From: support Date: Tue, 17 May 2022 15:22:52 +0000 (+0000) Subject: Built motion from commit e992f77f.|2.6.10 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22%7B%7Blicense.chat?a=commitdiff_plain;h=6771f029aa5e70190eccf7afadf8af320b636929;p=motion2.git Built motion from commit e992f77f.|2.6.10 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index fa25672..d31f159 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-05-17T14:50:22.421Z", + "time": "2022-05-17T15:15:24.358Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 66c7e57..a3f21ca 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-05-17T14:50:22.421Z", + "time": "2022-05-17T15:15:24.358Z", "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 f63bb31..cabef1b 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 _0x94b9=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','contactManager','integration','motionbar','urlForward','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','STRING','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x3f9b50,_0x5d40fc){var _0x48ffaf=function(_0x4092e3){while(--_0x4092e3){_0x3f9b50['push'](_0x3f9b50['shift']());}};_0x48ffaf(++_0x5d40fc);}(_0x94b9,0xe4));var _0x994b=function(_0x5bdd49,_0x411f8f){_0x5bdd49=_0x5bdd49-0x0;var _0x6c62c7=_0x94b9[_0x5bdd49];return _0x6c62c7;};'use strict';var Sequelize=require(_0x994b('0x0'));module[_0x994b('0x1')]={'name':{'type':Sequelize[_0x994b('0x2')],'get':function(_0x4765da){return this[_0x994b('0x3')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x994b('0x4'),_0x994b('0x5'),_0x994b('0x6'),'jscripty',_0x994b('0x7'),'browser','bot','script']],'msg':_0x994b('0x8')}},'comment':_0x994b('0x8')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x994b('0x9')},'data2':{'type':Sequelize[_0x994b('0xa')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x994b('0xb')},'data4':{'type':Sequelize[_0x994b('0xa')](0x1000),'comments':_0x994b('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x994b('0xd')},'data7':{'type':Sequelize[_0x994b('0xe')],'comments':_0x994b('0xf')}}; \ No newline at end of file +var _0x36a6=['sequelize','exports','VIRTUAL','STRING','contactManager','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]'];(function(_0x3b76d5,_0x464ae6){var _0x1a6511=function(_0x14587a){while(--_0x14587a){_0x3b76d5['push'](_0x3b76d5['shift']());}};_0x1a6511(++_0x464ae6);}(_0x36a6,0x1a2));var _0x636a=function(_0x2df982,_0x380bb8){_0x2df982=_0x2df982-0x0;var _0x208c55=_0x36a6[_0x2df982];return _0x208c55;};'use strict';var Sequelize=require(_0x636a('0x0'));module[_0x636a('0x1')]={'name':{'type':Sequelize[_0x636a('0x2')],'get':function(_0x286905){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x636a('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x636a('0x4'),'integration',_0x636a('0x5'),_0x636a('0x6'),'urlForward',_0x636a('0x7'),_0x636a('0x8'),_0x636a('0x9')]],'msg':_0x636a('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x636a('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x636a('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x636a('0xd')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x636a('0xe')},'data5':{'type':Sequelize[_0x636a('0x3')](0x1000),'comments':_0x636a('0xf')},'data6':{'type':Sequelize[_0x636a('0x3')],'comments':_0x636a('0x10')},'data7':{'type':Sequelize[_0x636a('0x11')],'comments':_0x636a('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 13502ff..49c8d85 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 _0xc757=['Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0xc757,0x103));var _0x7c75=function(_0x2ec90a,_0x4dea7f){_0x2ec90a=_0x2ec90a-0x0;var _0x5ac432=_0xc757[_0x2ec90a];return _0x5ac432;};'use strict';var emlformat=require(_0x7c75('0x0'));var rimraf=require(_0x7c75('0x1'));var zipdir=require(_0x7c75('0x2'));var jsonpatch=require(_0x7c75('0x3'));var rp=require(_0x7c75('0x4'));var moment=require('moment');var BPromise=require(_0x7c75('0x5'));var Mustache=require(_0x7c75('0x6'));var util=require(_0x7c75('0x7'));var path=require('path');var sox=require(_0x7c75('0x8'));var csv=require(_0x7c75('0x9'));var ejs=require(_0x7c75('0xa'));var fs=require('fs');var fs_extra=require(_0x7c75('0xb'));var _=require(_0x7c75('0xc'));var squel=require('squel');var crypto=require(_0x7c75('0xd'));var jsforce=require(_0x7c75('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7c75('0x9'));var querystring=require(_0x7c75('0xf'));var Papa=require(_0x7c75('0x10'));var Redis=require(_0x7c75('0x11'));var authService=require(_0x7c75('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7c75('0x13'));var hardwareService=require(_0x7c75('0x14'));var logger=require(_0x7c75('0x15'))(_0x7c75('0x16'));var utils=require(_0x7c75('0x17'));var config=require(_0x7c75('0x18'));var licenseUtil=require(_0x7c75('0x19'));var db=require(_0x7c75('0x1a'))['db'];function respondWithStatusCode(_0x151cf6,_0x2c3d69){_0x2c3d69=_0x2c3d69||0xcc;return function(_0x5e567d){if(_0x5e567d){return _0x151cf6[_0x7c75('0x1b')](_0x2c3d69);}return _0x151cf6[_0x7c75('0x1c')](_0x2c3d69)[_0x7c75('0x1d')]();};}function respondWithResult(_0x265d6a,_0xbaa7d2){_0xbaa7d2=_0xbaa7d2||0xc8;return function(_0x423165){if(_0x423165){return _0x265d6a[_0x7c75('0x1c')](_0xbaa7d2)[_0x7c75('0x1e')](_0x423165);}};}function respondWithFilteredResult(_0x5af69e,_0x306a6b){return function(_0x5a28e3){if(_0x5a28e3){var _0x5078aa=typeof _0x306a6b[_0x7c75('0x1f')]==='undefined'&&typeof _0x306a6b[_0x7c75('0x20')]===_0x7c75('0x21');var _0x338e58=_0x5a28e3[_0x7c75('0x22')];var _0x504bc3=_0x5078aa?0x0:_0x306a6b[_0x7c75('0x1f')];var _0x363ead=_0x5078aa?_0x5a28e3['count']:_0x306a6b[_0x7c75('0x1f')]+_0x306a6b[_0x7c75('0x20')];var _0x51c6d7;if(_0x363ead>=_0x338e58){_0x363ead=_0x338e58;_0x51c6d7=0xc8;}else{_0x51c6d7=0xce;}_0x5af69e[_0x7c75('0x1c')](_0x51c6d7);return _0x5af69e[_0x7c75('0x23')](_0x7c75('0x24'),_0x504bc3+'-'+_0x363ead+'/'+_0x338e58)[_0x7c75('0x1e')](_0x5a28e3);}return null;};}function patchUpdates(_0x3ac4c7){return function(_0x2fc47b){try{jsonpatch['apply'](_0x2fc47b,_0x3ac4c7,!![]);}catch(_0x275b8a){return BPromise[_0x7c75('0x25')](_0x275b8a);}return _0x2fc47b[_0x7c75('0x26')]();};}function saveUpdates(_0x365c18,_0x5a150d){return function(_0x5a98cd){if(_0x5a98cd){return _0x5a98cd[_0x7c75('0x27')](_0x365c18)[_0x7c75('0x28')](function(_0x207f56){return _0x207f56;});}return null;};}function removeEntity(_0x92ada2,_0x589a6d){return function(_0x1ac30b){if(_0x1ac30b){return _0x1ac30b[_0x7c75('0x29')]()[_0x7c75('0x28')](function(){_0x92ada2[_0x7c75('0x1c')](0xcc)[_0x7c75('0x1d')]();});}};}function handleEntityNotFound(_0x339280,_0x4f6ea3){return function(_0x2bc324){if(!_0x2bc324){_0x339280[_0x7c75('0x1b')](0x194);}return _0x2bc324;};}function handleError(_0x10b16b,_0x3406b1){_0x3406b1=_0x3406b1||0x1f4;return function(_0x38617e){logger[_0x7c75('0x2a')](_0x38617e[_0x7c75('0x2b')]);if(_0x38617e[_0x7c75('0x2c')]){delete _0x38617e[_0x7c75('0x2c')];}_0x10b16b[_0x7c75('0x1c')](_0x3406b1)[_0x7c75('0x2d')](_0x38617e);};}exports[_0x7c75('0x27')]=function(_0x5d491f,_0x2b5dfe){if(_0x5d491f[_0x7c75('0x2e')]['id']){delete _0x5d491f[_0x7c75('0x2e')]['id'];}return db[_0x7c75('0x2f')][_0x7c75('0x30')]({'where':{'id':_0x5d491f[_0x7c75('0x31')]['id']}})[_0x7c75('0x28')](handleEntityNotFound(_0x2b5dfe,null))[_0x7c75('0x28')](saveUpdates(_0x5d491f[_0x7c75('0x2e')],null))[_0x7c75('0x28')](respondWithResult(_0x2b5dfe,null))[_0x7c75('0x32')](handleError(_0x2b5dfe,null));};exports[_0x7c75('0x29')]=function(_0x3fce0e,_0x1f8ce0){return db[_0x7c75('0x2f')][_0x7c75('0x30')]({'where':{'id':_0x3fce0e['params']['id']}})['then'](handleEntityNotFound(_0x1f8ce0,null))[_0x7c75('0x28')](removeEntity(_0x1f8ce0,null))[_0x7c75('0x32')](handleError(_0x1f8ce0,null));}; \ No newline at end of file +var _0x9b76=['sendStatus','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9b76,0x65));var _0x69b7=function(_0x47c98d,_0x5c1cce){_0x47c98d=_0x47c98d-0x0;var _0x5a243e=_0x9b76[_0x47c98d];return _0x5a243e;};'use strict';var emlformat=require(_0x69b7('0x0'));var rimraf=require(_0x69b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x69b7('0x2'));var moment=require(_0x69b7('0x3'));var BPromise=require(_0x69b7('0x4'));var Mustache=require(_0x69b7('0x5'));var util=require('util');var path=require(_0x69b7('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x69b7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x69b7('0x8'));var squel=require(_0x69b7('0x9'));var crypto=require(_0x69b7('0xa'));var jsforce=require(_0x69b7('0xb'));var deskjs=require(_0x69b7('0xc'));var toCsv=require(_0x69b7('0xd'));var querystring=require(_0x69b7('0xe'));var Papa=require(_0x69b7('0xf'));var Redis=require(_0x69b7('0x10'));var authService=require(_0x69b7('0x11'));var qs=require(_0x69b7('0x12'));var as=require(_0x69b7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x69b7('0x14'));var config=require(_0x69b7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x69b7('0x16'))['db'];function respondWithStatusCode(_0x109e9d,_0x3a6ceb){_0x3a6ceb=_0x3a6ceb||0xcc;return function(_0x403664){if(_0x403664){return _0x109e9d['sendStatus'](_0x3a6ceb);}return _0x109e9d[_0x69b7('0x17')](_0x3a6ceb)[_0x69b7('0x18')]();};}function respondWithResult(_0x46c0c4,_0x2d874d){_0x2d874d=_0x2d874d||0xc8;return function(_0x17c0d){if(_0x17c0d){return _0x46c0c4['status'](_0x2d874d)[_0x69b7('0x19')](_0x17c0d);}};}function respondWithFilteredResult(_0x28442e,_0x3de357){return function(_0x1b6ad8){if(_0x1b6ad8){var _0x16866a=typeof _0x3de357[_0x69b7('0x1a')]===_0x69b7('0x1b')&&typeof _0x3de357[_0x69b7('0x1c')]===_0x69b7('0x1b');var _0x254e24=_0x1b6ad8['count'];var _0x4d05f7=_0x16866a?0x0:_0x3de357['offset'];var _0x56e049=_0x16866a?_0x1b6ad8[_0x69b7('0x1d')]:_0x3de357['offset']+_0x3de357[_0x69b7('0x1c')];var _0x38cd1e;if(_0x56e049>=_0x254e24){_0x56e049=_0x254e24;_0x38cd1e=0xc8;}else{_0x38cd1e=0xce;}_0x28442e['status'](_0x38cd1e);return _0x28442e[_0x69b7('0x1e')](_0x69b7('0x1f'),_0x4d05f7+'-'+_0x56e049+'/'+_0x254e24)['json'](_0x1b6ad8);}return null;};}function patchUpdates(_0x2a4cfa){return function(_0x2c2b69){try{jsonpatch[_0x69b7('0x20')](_0x2c2b69,_0x2a4cfa,!![]);}catch(_0x56c1f9){return BPromise['reject'](_0x56c1f9);}return _0x2c2b69[_0x69b7('0x21')]();};}function saveUpdates(_0x451273,_0x13ac33){return function(_0x234b40){if(_0x234b40){return _0x234b40[_0x69b7('0x22')](_0x451273)[_0x69b7('0x23')](function(_0x2518a1){return _0x2518a1;});}return null;};}function removeEntity(_0x4b07a1,_0x11a20a){return function(_0x2894c3){if(_0x2894c3){return _0x2894c3[_0x69b7('0x24')]()['then'](function(){_0x4b07a1[_0x69b7('0x17')](0xcc)[_0x69b7('0x18')]();});}};}function handleEntityNotFound(_0x2682ce,_0x1bf130){return function(_0x3ce399){if(!_0x3ce399){_0x2682ce[_0x69b7('0x25')](0x194);}return _0x3ce399;};}function handleError(_0x547ad4,_0x424bb0){_0x424bb0=_0x424bb0||0x1f4;return function(_0x2ee87d){logger['error'](_0x2ee87d[_0x69b7('0x26')]);if(_0x2ee87d[_0x69b7('0x27')]){delete _0x2ee87d[_0x69b7('0x27')];}_0x547ad4[_0x69b7('0x17')](_0x424bb0)[_0x69b7('0x28')](_0x2ee87d);};}exports['update']=function(_0x198cb6,_0x24128d){if(_0x198cb6['body']['id']){delete _0x198cb6[_0x69b7('0x29')]['id'];}return db[_0x69b7('0x2a')][_0x69b7('0x2b')]({'where':{'id':_0x198cb6[_0x69b7('0x2c')]['id']}})['then'](handleEntityNotFound(_0x24128d,null))[_0x69b7('0x23')](saveUpdates(_0x198cb6[_0x69b7('0x29')],null))[_0x69b7('0x23')](respondWithResult(_0x24128d,null))[_0x69b7('0x2d')](handleError(_0x24128d,null));};exports['destroy']=function(_0x56cefd,_0x39e627){return db['Action'][_0x69b7('0x2b')]({'where':{'id':_0x56cefd['params']['id']}})[_0x69b7('0x23')](handleEntityNotFound(_0x39e627,null))[_0x69b7('0x23')](removeEntity(_0x39e627,null))[_0x69b7('0x2d')](handleError(_0x39e627,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 07f1321..e53a137 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 _0x9a1b=['tools_actions','lodash','moment','bluebird','request-promise','path','../../config/environment','./action.attributes','define'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x9a1b,0x1ba));var _0xb9a1=function(_0x4824cb,_0x3f31bc){_0x4824cb=_0x4824cb-0x0;var _0x48811f=_0x9a1b[_0x4824cb];return _0x48811f;};'use strict';var _=require(_0xb9a1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb9a1('0x1'));var BPromise=require(_0xb9a1('0x2'));var rp=require(_0xb9a1('0x3'));var fs=require('fs');var path=require(_0xb9a1('0x4'));var rimraf=require('rimraf');var config=require(_0xb9a1('0x5'));var attributes=require(_0xb9a1('0x6'));module['exports']=function(_0x69b74e,_0x455fac){return _0x69b74e[_0xb9a1('0x7')]('Action',attributes,{'tableName':_0xb9a1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc584=['path','rimraf','../../config/environment','exports','define','Action','util','../../config/logger','bluebird'];(function(_0x345e27,_0x5773dd){var _0x1559fb=function(_0x5ad7c6){while(--_0x5ad7c6){_0x345e27['push'](_0x345e27['shift']());}};_0x1559fb(++_0x5773dd);}(_0xc584,0xa8));var _0x4c58=function(_0x2e3dfc,_0x454d6c){_0x2e3dfc=_0x2e3dfc-0x0;var _0x4b1245=_0xc584[_0x2e3dfc];return _0x4b1245;};'use strict';var _=require('lodash');var util=require(_0x4c58('0x0'));var logger=require(_0x4c58('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4c58('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c58('0x3'));var rimraf=require(_0x4c58('0x4'));var config=require(_0x4c58('0x5'));var attributes=require('./action.attributes');module[_0x4c58('0x6')]=function(_0x1a6d4c,_0x3e94f0){return _0x1a6d4c[_0x4c58('0x7')](_0x4c58('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 6609d9b..b401815 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 _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(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x814b,0x1a2));var _0xb814=function(_0x56ca61,_0x187321){_0x56ca61=_0x56ca61-0x0;var _0x1e7bee=_0x814b[_0x56ca61];return _0x1e7bee;};'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 +var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x4975,0x86));var _0x5497=function(_0x2589a5,_0x2f1a19){_0x2589a5=_0x2589a5-0x0;var _0x8a2e82=_0x4975[_0x2589a5];return _0x8a2e82;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 911870f..79dee97 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 _0x3c69=['../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x992b0c,_0x2955bf){var _0xa280e7=function(_0x391860){while(--_0x391860){_0x992b0c['push'](_0x992b0c['shift']());}};_0xa280e7(++_0x2955bf);}(_0x3c69,0x14a));var _0x93c6=function(_0x48eab4,_0x277c00){_0x48eab4=_0x48eab4-0x0;var _0xae2e9e=_0x3c69[_0x48eab4];return _0xae2e9e;};'use strict';var multer=require(_0x93c6('0x0'));var util=require('util');var path=require(_0x93c6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x93c6('0x2')]();var fs_extra=require(_0x93c6('0x3'));var auth=require(_0x93c6('0x4'));var interaction=require(_0x93c6('0x5'));var config=require(_0x93c6('0x6'));var controller=require('./action.controller');router[_0x93c6('0x7')](_0x93c6('0x8'),auth[_0x93c6('0x9')](),controller[_0x93c6('0xa')]);router[_0x93c6('0xb')](_0x93c6('0x8'),auth['isAuthenticated'](),controller[_0x93c6('0xc')]);module[_0x93c6('0xd')]=router; \ No newline at end of file +var _0x845d=['put','isAuthenticated','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller'];(function(_0x1b7a61,_0x555779){var _0x6c0126=function(_0x4b546b){while(--_0x4b546b){_0x1b7a61['push'](_0x1b7a61['shift']());}};_0x6c0126(++_0x555779);}(_0x845d,0x108));var _0xd845=function(_0x588faa,_0x33d3df){_0x588faa=_0x588faa-0x0;var _0x14c477=_0x845d[_0x588faa];return _0x14c477;};'use strict';var multer=require('multer');var util=require(_0xd845('0x0'));var path=require(_0xd845('0x1'));var timeout=require(_0xd845('0x2'));var express=require(_0xd845('0x3'));var router=express[_0xd845('0x4')]();var fs_extra=require(_0xd845('0x5'));var auth=require(_0xd845('0x6'));var interaction=require(_0xd845('0x7'));var config=require('../../config/environment');var controller=require(_0xd845('0x8'));router[_0xd845('0x9')]('/:id',auth[_0xd845('0xa')](),controller['update']);router['delete'](_0xd845('0xb'),auth[_0xd845('0xa')](),controller['destroy']);module[_0xd845('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 b3403bf..7426aa3 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 _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x46ed,0x168));var _0xd46e=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x46ed[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}}; \ No newline at end of file +var _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x199745,_0x2fc2bf){_0x199745=_0x199745-0x0;var _0x5401a3=_0x1cb9[_0x199745];return _0x5401a3;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 598c3c9..c7e355c 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 _0x6950=['join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%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\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','SUM(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20NULL','ValidationErrorItem','DESC','alias','foreignKey','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','../../files/reports','savename','countTable','run','runReport','cross_join','HOUR(%s)','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','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','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','keys','length','merge','create','role','user','Reports','UserProfileSection','find','userProfileId','autoAssociation','body','preview'];(function(_0x4df543,_0x1cd008){var _0x33e3b1=function(_0x239963){while(--_0x239963){_0x4df543['push'](_0x4df543['shift']());}};_0x33e3b1(++_0x1cd008);}(_0x6950,0xfb));var _0x0695=function(_0x39652c,_0x228e77){_0x39652c=_0x39652c-0x0;var _0x315138=_0x6950[_0x39652c];return _0x315138;};'use strict';var emlformat=require(_0x0695('0x0'));var rimraf=require(_0x0695('0x1'));var zipdir=require(_0x0695('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0695('0x3'));var moment=require('moment');var BPromise=require(_0x0695('0x4'));var Mustache=require(_0x0695('0x5'));var util=require(_0x0695('0x6'));var path=require('path');var sox=require(_0x0695('0x7'));var csv=require('to-csv');var ejs=require(_0x0695('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0695('0x9'));var squel=require(_0x0695('0xa'));var crypto=require(_0x0695('0xb'));var jsforce=require(_0x0695('0xc'));var deskjs=require(_0x0695('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0695('0xe'));var Papa=require(_0x0695('0xf'));var Redis=require(_0x0695('0x10'));var authService=require(_0x0695('0x11'));var qs=require(_0x0695('0x12'));var as=require(_0x0695('0x13'));var hardwareService=require(_0x0695('0x14'));var logger=require(_0x0695('0x15'))('api');var utils=require(_0x0695('0x16'));var config=require(_0x0695('0x17'));var licenseUtil=require(_0x0695('0x18'));var db=require(_0x0695('0x19'))['db'];var dbH=require(_0x0695('0x19'))['dbH'];function respondWithStatusCode(_0x5ac25f,_0x36a9cb){_0x36a9cb=_0x36a9cb||0xcc;return function(_0x521009){if(_0x521009){return _0x5ac25f[_0x0695('0x1a')](_0x36a9cb);}return _0x5ac25f[_0x0695('0x1b')](_0x36a9cb)['end']();};}function respondWithResult(_0x48954e,_0x3796de){_0x3796de=_0x3796de||0xc8;return function(_0x4eb422){if(_0x4eb422){return _0x48954e['status'](_0x3796de)[_0x0695('0x1c')](_0x4eb422);}};}function respondWithFilteredResult(_0x15d3e2,_0x364d93){return function(_0x3c8085){if(_0x3c8085){var _0x3a1e97=typeof _0x364d93[_0x0695('0x1d')]==='undefined'&&typeof _0x364d93[_0x0695('0x1e')]===_0x0695('0x1f');var _0x47efde=_0x3c8085[_0x0695('0x20')];var _0x36d7d5=_0x3a1e97?0x0:_0x364d93[_0x0695('0x1d')];var _0x27747d=_0x3a1e97?_0x3c8085['count']:_0x364d93[_0x0695('0x1d')]+_0x364d93[_0x0695('0x1e')];var _0x77c707;if(_0x27747d>=_0x47efde){_0x27747d=_0x47efde;_0x77c707=0xc8;}else{_0x77c707=0xce;}_0x15d3e2[_0x0695('0x1b')](_0x77c707);return _0x15d3e2[_0x0695('0x21')](_0x0695('0x22'),_0x36d7d5+'-'+_0x27747d+'/'+_0x47efde)['json'](_0x3c8085);}return null;};}function patchUpdates(_0x4e5dfc){return function(_0x42ba7c){try{jsonpatch[_0x0695('0x23')](_0x42ba7c,_0x4e5dfc,!![]);}catch(_0x1ea7ab){return BPromise[_0x0695('0x24')](_0x1ea7ab);}return _0x42ba7c[_0x0695('0x25')]();};}function saveUpdates(_0x52704b,_0x9b4412){return function(_0x203952){if(_0x203952){return _0x203952[_0x0695('0x26')](_0x52704b)[_0x0695('0x27')](function(_0xef79cc){return _0xef79cc;});}return null;};}function removeEntity(_0x48260e,_0x2b7c0a){return function(_0x435e76){if(_0x435e76){return _0x435e76[_0x0695('0x28')]()[_0x0695('0x27')](function(){var _0x484419=_0x435e76[_0x0695('0x29')]({'plain':!![]});var _0x485c13=_0x0695('0x2a');return db[_0x0695('0x2b')][_0x0695('0x28')]({'where':{'type':_0x485c13,'resourceId':_0x484419['id']}})[_0x0695('0x27')](function(){return _0x435e76;});})[_0x0695('0x27')](function(){_0x48260e[_0x0695('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56ff9c,_0x4ad38a){return function(_0x15b1e6){if(!_0x15b1e6){_0x56ff9c[_0x0695('0x1a')](0x194);}return _0x15b1e6;};}function handleError(_0x33a3d1,_0x425c5e){_0x425c5e=_0x425c5e||0x1f4;return function(_0x5d4b7f){logger[_0x0695('0x2c')](_0x5d4b7f[_0x0695('0x2d')]);if(_0x5d4b7f[_0x0695('0x2e')]){delete _0x5d4b7f[_0x0695('0x2e')];}_0x33a3d1[_0x0695('0x1b')](_0x425c5e)[_0x0695('0x2f')](_0x5d4b7f);};}exports['index']=function(_0xb9d7b1,_0x351745){var _0x37be55={},_0x268334={},_0x1f0f8f={'count':0x0,'rows':[]};var _0x37995d=_[_0x0695('0x30')](db[_0x0695('0x31')][_0x0695('0x32')],function(_0x287fcf){return{'name':_0x287fcf['fieldName'],'type':_0x287fcf[_0x0695('0x33')]['key']};});_0x268334[_0x0695('0x34')]=_[_0x0695('0x30')](_0x37995d,_0x0695('0x2e'));_0x268334[_0x0695('0x35')]=_['keys'](_0xb9d7b1['query']);_0x268334[_0x0695('0x36')]=_[_0x0695('0x37')](_0x268334[_0x0695('0x34')],_0x268334[_0x0695('0x35')]);_0x37be55['attributes']=_[_0x0695('0x37')](_0x268334['model'],qs[_0x0695('0x38')](_0xb9d7b1['query']['fields']));_0x37be55['attributes']=_0x37be55[_0x0695('0x39')]['length']?_0x37be55['attributes']:_0x268334[_0x0695('0x34')];if(!_0xb9d7b1[_0x0695('0x35')][_0x0695('0x3a')](_0x0695('0x3b'))){_0x37be55[_0x0695('0x1e')]=qs['limit'](_0xb9d7b1[_0x0695('0x35')][_0x0695('0x1e')]);_0x37be55[_0x0695('0x1d')]=qs[_0x0695('0x1d')](_0xb9d7b1['query']['offset']);}_0x37be55['order']=qs[_0x0695('0x3c')](_0xb9d7b1[_0x0695('0x35')][_0x0695('0x3c')]);_0x37be55[_0x0695('0x3d')]=qs[_0x0695('0x36')](_[_0x0695('0x3e')](_0xb9d7b1[_0x0695('0x35')],_0x268334[_0x0695('0x36')]),_0x37995d);if(_0xb9d7b1[_0x0695('0x35')]['filter']){_0x37be55[_0x0695('0x3d')]=_['merge'](_0x37be55[_0x0695('0x3d')],{'$or':_[_0x0695('0x30')](_0x37995d,function(_0x51dfe2){if(_0x51dfe2[_0x0695('0x33')]!==_0x0695('0x3f')){var _0x1983c1={};_0x1983c1[_0x51dfe2[_0x0695('0x2e')]]={'$like':'%'+_0xb9d7b1[_0x0695('0x35')][_0x0695('0x40')]+'%'};return _0x1983c1;}})});}_0x37be55=_['merge']({},_0x37be55,_0xb9d7b1[_0x0695('0x41')]);var _0x5e7bde={'where':_0x37be55[_0x0695('0x3d')]};return db[_0x0695('0x31')][_0x0695('0x20')](_0x5e7bde)[_0x0695('0x27')](function(_0x31e5ae){_0x1f0f8f['count']=_0x31e5ae;if(_0xb9d7b1[_0x0695('0x35')][_0x0695('0x42')]){_0x37be55[_0x0695('0x43')]=[{'all':!![]}];}return db[_0x0695('0x31')]['findAll'](_0x37be55);})['then'](function(_0x29bee){_0x1f0f8f[_0x0695('0x44')]=_0x29bee;return _0x1f0f8f;})[_0x0695('0x27')](respondWithFilteredResult(_0x351745,_0x37be55))[_0x0695('0x45')](handleError(_0x351745,null));};exports[_0x0695('0x46')]=function(_0x303bb8,_0x6869c5){var _0x43183b={'raw':![],'where':{'id':_0x303bb8[_0x0695('0x47')]['id']}},_0x5bf3e9={};_0x5bf3e9[_0x0695('0x34')]=_[_0x0695('0x48')](db[_0x0695('0x31')][_0x0695('0x32')]);_0x5bf3e9[_0x0695('0x35')]=_[_0x0695('0x48')](_0x303bb8[_0x0695('0x35')]);_0x5bf3e9[_0x0695('0x36')]=_[_0x0695('0x37')](_0x5bf3e9['model'],_0x5bf3e9['query']);_0x43183b['attributes']=_[_0x0695('0x37')](_0x5bf3e9[_0x0695('0x34')],qs[_0x0695('0x38')](_0x303bb8[_0x0695('0x35')]['fields']));_0x43183b['attributes']=_0x43183b[_0x0695('0x39')][_0x0695('0x49')]?_0x43183b[_0x0695('0x39')]:_0x5bf3e9[_0x0695('0x34')];if(_0x303bb8[_0x0695('0x35')][_0x0695('0x42')]){_0x43183b[_0x0695('0x43')]=[{'all':!![]}];}_0x43183b=_[_0x0695('0x4a')]({},_0x43183b,_0x303bb8[_0x0695('0x41')]);return db['AnalyticCustomReport']['find'](_0x43183b)[_0x0695('0x27')](handleEntityNotFound(_0x6869c5,null))[_0x0695('0x27')](respondWithResult(_0x6869c5,null))[_0x0695('0x45')](handleError(_0x6869c5,null));};exports['create']=function(_0xc7cb84,_0x45de1a){return db[_0x0695('0x31')][_0x0695('0x4b')](_0xc7cb84['body'],{})[_0x0695('0x27')](function(_0x45964b){var _0xad699a=_0xc7cb84['user'][_0x0695('0x29')]({'plain':!![]});if(!_0xad699a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xad699a[_0x0695('0x4c')]===_0x0695('0x4d')){var _0x571b20=_0x45964b[_0x0695('0x29')]({'plain':!![]});var _0x51046f=_0x0695('0x4e');return db[_0x0695('0x4f')][_0x0695('0x50')]({'where':{'name':_0x51046f,'userProfileId':_0xad699a[_0x0695('0x51')]},'raw':!![]})[_0x0695('0x27')](function(_0x4f0bd0){if(_0x4f0bd0&&_0x4f0bd0[_0x0695('0x52')]===0x0){return db[_0x0695('0x2b')][_0x0695('0x4b')]({'name':_0x571b20[_0x0695('0x2e')],'resourceId':_0x571b20['id'],'type':_0x0695('0x2a'),'sectionId':_0x4f0bd0['id']},{})[_0x0695('0x27')](function(){return _0x45964b;});}else{return _0x45964b;}})['catch'](function(_0x11e562){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11e562);throw _0x11e562;});}return _0x45964b;})[_0x0695('0x27')](respondWithResult(_0x45de1a,0xc9))[_0x0695('0x45')](handleError(_0x45de1a,null));};exports['update']=function(_0xde7124,_0x440691){if(_0xde7124[_0x0695('0x53')]['id']){delete _0xde7124[_0x0695('0x53')]['id'];}return db[_0x0695('0x31')][_0x0695('0x50')]({'where':{'id':_0xde7124[_0x0695('0x47')]['id']}})['then'](handleEntityNotFound(_0x440691,null))[_0x0695('0x27')](saveUpdates(_0xde7124[_0x0695('0x53')],null))['then'](respondWithResult(_0x440691,null))['catch'](handleError(_0x440691,null));};exports[_0x0695('0x28')]=function(_0x571f80,_0x4a8128){return db[_0x0695('0x31')][_0x0695('0x50')]({'where':{'id':_0x571f80[_0x0695('0x47')]['id']}})[_0x0695('0x27')](handleEntityNotFound(_0x4a8128,null))[_0x0695('0x27')](removeEntity(_0x4a8128,null))[_0x0695('0x45')](handleError(_0x4a8128,null));};exports[_0x0695('0x54')]=function(_0xc22433,_0x56bd24){var _0x3e300b=0xa;var _0x159d4a=[_0x0695('0x55'),_0x0695('0x56'),_0x0695('0x57'),'cross_join'];var _0x343f9d={'SUM':'SUM(%s)','COUNT':_0x0695('0x58'),'COUNT DISTINCT':_0x0695('0x59'),'MAX':_0x0695('0x5a'),'MIN':_0x0695('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x0695('0x5c'),'GROUP_CONCAT ASC':_0x0695('0x5d'),'GROUP_CONCAT DESC':_0x0695('0x5e')};var _0x5258a2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0695('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x0695('0x60'),'UNIX_TIMESTAMP':_0x0695('0x61')};var _0x30237f=function(_0x5564d1){return!_[_0x0695('0x62')]([_0x0695('0x63'),'IS\x20NOT\x20NULL',_0x0695('0x64'),_0x0695('0x65')],_0x5564d1);};var _0x3faaaa=function(_0x21d61d){if(!_0x21d61d||!_0x21d61d[_0x0695('0x66')]['length']){return'';}for(var _0x249da3='(',_0x357041=0x0;_0x357041<_0x21d61d[_0x0695('0x66')]['length'];_0x357041+=0x1){_0x357041>0x0&&(_0x249da3+='\x20'+_0x21d61d[_0x0695('0x67')]+'\x20');_0x249da3+=_0x21d61d[_0x0695('0x66')][_0x357041][_0x0695('0x68')]?_0x3faaaa(_0x21d61d['rules'][_0x357041][_0x0695('0x68')]):_0x21d61d[_0x0695('0x66')][_0x357041][_0x0695('0x69')]+'\x20'+_0x21d61d['rules'][_0x357041][_0x0695('0x6a')]+(_0x30237f(_0x21d61d['rules'][_0x357041]['condition'])?'\x20'+_0x21d61d[_0x0695('0x66')][_0x357041][_0x0695('0x6b')]:'');}return _0x249da3+')';};var _0x192daa={'where':{'id':_0xc22433[_0x0695('0x47')]['id']}},_0x2be11b,_0x2249b5,_0xa1be49,_0x522a55,_0x5211aa;_0x192daa=_[_0x0695('0x4a')]({},_0x192daa,_0xc22433[_0x0695('0x41')]);return db[_0x0695('0x31')][_0x0695('0x50')](_0x192daa)['then'](function(_0x13b5ff){if(_0x13b5ff){_0x2be11b=_0x13b5ff;return _0x13b5ff[_0x0695('0x6c')]();}return null;})[_0x0695('0x27')](function(_0x5570fb){if(_0x5570fb){if(!_0x5570fb['length']){throw new db[(_0x0695('0x6d'))]['ValidationErrorItem'](_0x0695('0x6e'),0x193);}_0x2249b5=_0x5570fb;return db[_0x0695('0x6f')][_0x0695('0x70')]({'raw':!![]});}return null;})[_0x0695('0x27')](function(_0x575235){if(_0x575235){_0xa1be49=_[_0x0695('0x71')](_0x575235,'id');var _0x37ac4c;var _0xed2403=squel[_0x0695('0x72')]();_0xed2403[_0x0695('0x73')](_0x2be11b[_0x0695('0x74')]);for(var _0x17a06a=0x0;_0x17a06a<_0x2249b5[_0x0695('0x49')];_0x17a06a+=0x1){_0x37ac4c=_0x2249b5[_0x17a06a]['MetricId']?_0xa1be49[_0x2249b5[_0x17a06a][_0x0695('0x75')]][_0x0695('0x76')]:_0x2249b5[_0x17a06a][_0x0695('0x69')];_0x37ac4c=_0x2249b5[_0x17a06a][_0x0695('0x77')]?_[_0x0695('0x78')](_0x343f9d[_0x2249b5[_0x17a06a][_0x0695('0x77')]],'%s',_0x37ac4c):_0x37ac4c;_0x37ac4c=_0x2249b5[_0x17a06a]['format']?_[_0x0695('0x78')](_0x5258a2[_0x2249b5[_0x17a06a][_0x0695('0x79')]],'%s',_0x37ac4c):_0x37ac4c;if(_0x2249b5[_0x17a06a][_0x0695('0x7a')]){_0xed2403[_0x0695('0x68')](_0x37ac4c);}_0x2249b5[_0x17a06a][_0x0695('0x7b')]&&_0xed2403[_0x0695('0x7c')](_0x37ac4c,_0x2249b5[_0x17a06a]['orderBy']==='DESC'?![]:!![]);_0xed2403[_0x0695('0x69')](_0x37ac4c,_0x2249b5[_0x17a06a]['alias']||_0x37ac4c);}if(_0x2be11b[_0x0695('0x7d')]){_0x2be11b[_0x0695('0x7d')]=JSON[_0x0695('0x7e')](_0x2be11b[_0x0695('0x7d')]);for(var _0x57b4d8=0x0;_0x57b4d8<_0x2be11b[_0x0695('0x7d')][_0x0695('0x49')];_0x57b4d8+=0x1){if(_0x2be11b['joins'][_0x57b4d8]['type']&&_[_0x0695('0x62')](_0x159d4a,_0x2be11b['joins'][_0x57b4d8][_0x0695('0x33')])&&_0x2be11b[_0x0695('0x7d')][_0x57b4d8][_0x0695('0x7f')]&&_0x2be11b[_0x0695('0x7d')][_0x57b4d8][_0x0695('0x80')]&&_0x2be11b[_0x0695('0x7d')][_0x57b4d8]['foreignKey']){_0xed2403[_0x2be11b['joins'][_0x57b4d8]['type']](_0x2be11b[_0x0695('0x7d')][_0x57b4d8][_0x0695('0x80')],null,util['format'](_0x0695('0x81'),_0x2be11b[_0x0695('0x74')],_0x2be11b['joins'][_0x57b4d8][_0x0695('0x7f')],_0x2be11b[_0x0695('0x7d')][_0x57b4d8][_0x0695('0x80')],_0x2be11b[_0x0695('0x7d')][_0x57b4d8]['foreignKey']));}}}if(_0x2be11b[_0x0695('0x82')]){_0x2be11b[_0x0695('0x82')]=JSON['parse'](_0x2be11b[_0x0695('0x82')]);_0xed2403['where'](_0x3faaaa(_0x2be11b['conditions'][_0x0695('0x68')]));}_0x5211aa=_0xed2403[_0x0695('0x83')]();_0xed2403['limit'](_0x3e300b);_0xed2403[_0x0695('0x1d')](0x0);logger[_0x0695('0x84')](_0x0695('0x85'),_0xed2403['toString']());return dbH[_0x0695('0x86')][_0x0695('0x35')](_0xed2403[_0x0695('0x87')](),{'type':dbH['sequelize'][_0x0695('0x88')][_0x0695('0x89')]});}})[_0x0695('0x27')](respondWithResult(_0x56bd24,null))['catch'](handleError(_0x56bd24,null));};function runReport(_0x522c3d,_0x48a3cb,_0x2683ab){var _0x3d388f=_0x48a3cb[_0x0695('0x2e')];var _0x515a77=0xa;var _0x35043f=['join',_0x0695('0x56'),_0x0695('0x57'),'cross_join'];var _0x16d4ee={'SUM':_0x0695('0x8a'),'COUNT':_0x0695('0x58'),'COUNT DISTINCT':_0x0695('0x59'),'MAX':'MAX(%s)','MIN':_0x0695('0x5b'),'AVG':_0x0695('0x8b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0695('0x5d'),'GROUP_CONCAT DESC':_0x0695('0x5e')};var _0x31d89e={'SEC_TO_TIME':_0x0695('0x8c'),'DATE':_0x0695('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x0695('0x60'),'UNIX_TIMESTAMP':_0x0695('0x61')};var _0x1762ec=function(_0x3ce835){return!_[_0x0695('0x62')]([_0x0695('0x63'),_0x0695('0x8d'),_0x0695('0x64'),_0x0695('0x65')],_0x3ce835);};var _0x56230b=function(_0x1e3e4f){if(!_0x1e3e4f||!_0x1e3e4f['rules'][_0x0695('0x49')]){return'';}for(var _0x3127ed='(',_0x3cd811=0x0;_0x3cd811<_0x1e3e4f[_0x0695('0x66')][_0x0695('0x49')];_0x3cd811+=0x1){_0x3cd811>0x0&&(_0x3127ed+='\x20'+_0x1e3e4f[_0x0695('0x67')]+'\x20');_0x3127ed+=_0x1e3e4f['rules'][_0x3cd811][_0x0695('0x68')]?_0x56230b(_0x1e3e4f[_0x0695('0x66')][_0x3cd811][_0x0695('0x68')]):_0x1e3e4f['rules'][_0x3cd811][_0x0695('0x69')]+'\x20'+_0x1e3e4f['rules'][_0x3cd811][_0x0695('0x6a')]+(_0x1762ec(_0x1e3e4f[_0x0695('0x66')][_0x3cd811][_0x0695('0x6a')])?'\x20'+_0x1e3e4f[_0x0695('0x66')][_0x3cd811][_0x0695('0x6b')]:'');}return _0x3127ed+')';};var _0x300aff={'where':{'id':_0x522c3d['id']}},_0x332f77,_0xf0043,_0x4855cb,_0x1adb47,_0x40cadd;_0x300aff=_[_0x0695('0x4a')]({},_0x300aff,_0x2683ab);return db['AnalyticCustomReport'][_0x0695('0x50')](_0x300aff)['then'](function(_0x4a23bd){if(_0x4a23bd){_0x332f77=_0x4a23bd;return _0x4a23bd[_0x0695('0x6c')]();}return null;})[_0x0695('0x27')](function(_0x8a17e0){if(_0x8a17e0){if(!_0x8a17e0[_0x0695('0x49')]){throw new db[(_0x0695('0x6d'))][(_0x0695('0x8e'))](_0x0695('0x6e'),0x193);}_0xf0043=_0x8a17e0;return db[_0x0695('0x6f')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x2dbaaf){if(_0x2dbaaf){_0x4855cb=_['keyBy'](_0x2dbaaf,'id');var _0x5d1e66;var _0x273838=squel[_0x0695('0x72')]();_0x273838[_0x0695('0x73')](_0x332f77['table']);for(var _0x5e6131=0x0;_0x5e6131<_0xf0043[_0x0695('0x49')];_0x5e6131+=0x1){_0x5d1e66=_0xf0043[_0x5e6131][_0x0695('0x75')]?_0x4855cb[_0xf0043[_0x5e6131][_0x0695('0x75')]][_0x0695('0x76')]:_0xf0043[_0x5e6131]['field'];_0x5d1e66=_0xf0043[_0x5e6131][_0x0695('0x77')]?_[_0x0695('0x78')](_0x16d4ee[_0xf0043[_0x5e6131]['function']],'%s',_0x5d1e66):_0x5d1e66;_0x5d1e66=_0xf0043[_0x5e6131]['format']?_[_0x0695('0x78')](_0x31d89e[_0xf0043[_0x5e6131][_0x0695('0x79')]],'%s',_0x5d1e66):_0x5d1e66;if(_0xf0043[_0x5e6131][_0x0695('0x7a')]){_0x273838['group'](_0x5d1e66);}_0xf0043[_0x5e6131][_0x0695('0x7b')]&&_0x273838['order'](_0x5d1e66,_0xf0043[_0x5e6131][_0x0695('0x7b')]===_0x0695('0x8f')?![]:!![]);_0x273838['field'](_0x5d1e66,_0xf0043[_0x5e6131][_0x0695('0x90')]||_0x5d1e66);}if(_0x332f77['joins']){_0x332f77[_0x0695('0x7d')]=JSON[_0x0695('0x7e')](_0x332f77['joins']);for(var _0x36933f=0x0;_0x36933f<_0x332f77[_0x0695('0x7d')][_0x0695('0x49')];_0x36933f+=0x1){if(_0x332f77[_0x0695('0x7d')][_0x36933f][_0x0695('0x33')]&&_[_0x0695('0x62')](_0x35043f,_0x332f77[_0x0695('0x7d')][_0x36933f][_0x0695('0x33')])&&_0x332f77[_0x0695('0x7d')][_0x36933f]['parentKey']&&_0x332f77[_0x0695('0x7d')][_0x36933f][_0x0695('0x80')]&&_0x332f77[_0x0695('0x7d')][_0x36933f][_0x0695('0x91')]){_0x273838[_0x332f77[_0x0695('0x7d')][_0x36933f]['type']](_0x332f77['joins'][_0x36933f][_0x0695('0x80')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x332f77['table'],_0x332f77[_0x0695('0x7d')][_0x36933f][_0x0695('0x7f')],_0x332f77[_0x0695('0x7d')][_0x36933f][_0x0695('0x80')],_0x332f77[_0x0695('0x7d')][_0x36933f][_0x0695('0x91')]));}}}if(_0x332f77[_0x0695('0x82')]){_0x332f77['conditions']=JSON['parse'](_0x332f77[_0x0695('0x82')]);_0x273838[_0x0695('0x3d')](_0x56230b(_0x332f77[_0x0695('0x82')][_0x0695('0x68')]));}_0x40cadd=_0x273838[_0x0695('0x83')]();_0x273838[_0x0695('0x1e')](_0x515a77);_0x273838[_0x0695('0x1d')](0x0);return;}})[_0x0695('0x27')](function(){if(_0x48a3cb[_0x0695('0x92')]===_0x0695('0x93')){return null;}var _0x386ac0=_[_0x0695('0x4a')](_0x48a3cb,{'name':_0x48a3cb[_0x0695('0x94')]||_0x48a3cb[_0x0695('0x2e')]||_0x332f77[_0x0695('0x2e')],'basename':_0x3d388f,'savename':util['format']('%s-%s.%s',_0x48a3cb['name']||_0x332f77[_0x0695('0x2e')],require(_0x0695('0x95'))[_0x0695('0x96')](0x4),_0x48a3cb['output']||_0x0695('0x97')),'reportId':_0x332f77['id'],'reportType':_0x0695('0x98')});return db[_0x0695('0x99')][_0x0695('0x4b')](_0x386ac0,{'raw':!![]});})[_0x0695('0x27')](function(_0x102e30){if(_0x332f77['table']===_0x0695('0x9a')){_0x40cadd['where'](_0x332f77['table']+_0x0695('0x9b'),_0x48a3cb[_0x0695('0x9c')],_0x48a3cb['endDate']);}else{_0x40cadd[_0x0695('0x3d')](_0x332f77[_0x0695('0x74')]+_0x0695('0x9d'),_0x48a3cb[_0x0695('0x9c')],_0x48a3cb[_0x0695('0x9e')]);}if(_0x102e30){logger['info'](_0x0695('0x9f'),_0x40cadd[_0x0695('0x87')]());require(_0x0695('0xa0'))['fork'](path['join'](__dirname,'../../components/export/',_0x102e30[_0x0695('0x92')]),[_0x102e30['id'],_0x40cadd[_0x0695('0x87')](),path[_0x0695('0x55')](__dirname,_0x0695('0xa1'),_0x102e30[_0x0695('0xa2')]),_0x3d388f]);return _0x102e30;}else{var _0x3af316=squel[_0x0695('0x72')]();_0x3af316[_0x0695('0x73')]('('+_0x40cadd[_0x0695('0x87')]()+')',_0x0695('0xa3'));_0x3af316[_0x0695('0x69')]('COUNT(*)',_0x0695('0x20'));_0x40cadd['limit'](_0x48a3cb['limit']||_0x515a77);_0x40cadd[_0x0695('0x1d')](_0x48a3cb[_0x0695('0x1d')]||0x0);return dbH[_0x0695('0x86')][_0x0695('0x35')](_0x3af316[_0x0695('0x87')](),{'type':dbH['sequelize'][_0x0695('0x88')][_0x0695('0x89')]})[_0x0695('0x27')](function(_0x29c285){if(!_0x29c285[_0x0695('0x49')]){_0x1adb47=0x0;}else{_0x1adb47=_0x29c285[0x0][_0x0695('0x20')]||0x0;}return dbH[_0x0695('0x86')]['query'](_0x40cadd[_0x0695('0x87')](),{'type':dbH[_0x0695('0x86')][_0x0695('0x88')][_0x0695('0x89')]});})[_0x0695('0x27')](function(_0x1605c0){return{'rows':_0x1605c0||[],'count':_0x1adb47};});}});}exports[_0x0695('0xa4')]=function(_0x48bdbc,_0x10fdd4){return runReport(_0x48bdbc['params'],_0x48bdbc['query'],_0x48bdbc[_0x0695('0x41')])['then'](respondWithResult(_0x10fdd4,null))[_0x0695('0x45')](handleError(_0x10fdd4,null));};exports[_0x0695('0xa5')]=runReport;exports['query']=function(_0x3b8b35,_0x455050){var _0x5d1d0=0xa;var _0x5a8b2f=[_0x0695('0x55'),_0x0695('0x56'),_0x0695('0x57'),_0x0695('0xa6')];var _0x32bdea={'SUM':_0x0695('0x8a'),'COUNT':_0x0695('0x58'),'COUNT DISTINCT':_0x0695('0x59'),'MAX':_0x0695('0x5a'),'MIN':'MIN(%s)','AVG':_0x0695('0x8b'),'GROUP_CONCAT':_0x0695('0x5c'),'GROUP_CONCAT ASC':_0x0695('0x5d'),'GROUP_CONCAT DESC':_0x0695('0x5e')};var _0x278056={'SEC_TO_TIME':_0x0695('0x8c'),'DATE':_0x0695('0x5f'),'HOUR':_0x0695('0xa7'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0695('0x61')};var _0x114707=function(_0x11516b){return!_[_0x0695('0x62')](['IS\x20NULL',_0x0695('0x8d'),_0x0695('0x64'),_0x0695('0x65')],_0x11516b);};var _0x9ef6e=function(_0x189522){if(!_0x189522||!_0x189522[_0x0695('0x66')]['length']){return'';}for(var _0x57896a='(',_0x3368f0=0x0;_0x3368f0<_0x189522[_0x0695('0x66')][_0x0695('0x49')];_0x3368f0+=0x1){_0x3368f0>0x0&&(_0x57896a+='\x20'+_0x189522[_0x0695('0x67')]+'\x20');_0x57896a+=_0x189522[_0x0695('0x66')][_0x3368f0][_0x0695('0x68')]?_0x9ef6e(_0x189522['rules'][_0x3368f0][_0x0695('0x68')]):_0x189522[_0x0695('0x66')][_0x3368f0][_0x0695('0x69')]+'\x20'+_0x189522[_0x0695('0x66')][_0x3368f0]['condition']+(_0x114707(_0x189522[_0x0695('0x66')][_0x3368f0][_0x0695('0x6a')])?'\x20'+_0x189522[_0x0695('0x66')][_0x3368f0]['value']:'');}return _0x57896a+')';};var _0x119437={'where':{'id':_0x3b8b35[_0x0695('0x47')]['id']}},_0x267fc7,_0x1537bd,_0x535e8b,_0x3645dd,_0x38e1f8;_0x119437=_[_0x0695('0x4a')]({},_0x119437,_0x3b8b35[_0x0695('0x41')]);return db[_0x0695('0x31')][_0x0695('0x50')](_0x119437)[_0x0695('0x27')](function(_0x387947){if(_0x387947){_0x267fc7=_0x387947;return _0x387947['getFields']();}return null;})[_0x0695('0x27')](function(_0x28082e){if(_0x28082e){if(!_0x28082e[_0x0695('0x49')]){throw new db['Sequelize'][(_0x0695('0x8e'))](_0x0695('0x6e'),0x193);}_0x1537bd=_0x28082e;return db['AnalyticMetric'][_0x0695('0x70')]({'raw':!![]});}return null;})[_0x0695('0x27')](function(_0x38afd2){if(_0x38afd2){_0x535e8b=_[_0x0695('0x71')](_0x38afd2,'id');var _0x5e73e7;var _0x5dbe9e=squel[_0x0695('0x72')]();_0x5dbe9e[_0x0695('0x73')](_0x267fc7[_0x0695('0x74')]);for(var _0x535723=0x0;_0x535723<_0x1537bd[_0x0695('0x49')];_0x535723+=0x1){_0x5e73e7=_0x1537bd[_0x535723][_0x0695('0x75')]?_0x535e8b[_0x1537bd[_0x535723][_0x0695('0x75')]][_0x0695('0x76')]:_0x1537bd[_0x535723]['field'];_0x5e73e7=_0x1537bd[_0x535723]['function']?_[_0x0695('0x78')](_0x32bdea[_0x1537bd[_0x535723][_0x0695('0x77')]],'%s',_0x5e73e7):_0x5e73e7;_0x5e73e7=_0x1537bd[_0x535723][_0x0695('0x79')]?_['replace'](_0x278056[_0x1537bd[_0x535723][_0x0695('0x79')]],'%s',_0x5e73e7):_0x5e73e7;if(_0x1537bd[_0x535723][_0x0695('0x7a')]){_0x5dbe9e[_0x0695('0x68')](_0x5e73e7);}_0x1537bd[_0x535723][_0x0695('0x7b')]&&_0x5dbe9e[_0x0695('0x7c')](_0x5e73e7,_0x1537bd[_0x535723][_0x0695('0x7b')]===_0x0695('0x8f')?![]:!![]);_0x5dbe9e[_0x0695('0x69')](_0x5e73e7,_0x1537bd[_0x535723][_0x0695('0x90')]||_0x5e73e7);}if(_0x267fc7[_0x0695('0x7d')]){_0x267fc7['joins']=JSON[_0x0695('0x7e')](_0x267fc7[_0x0695('0x7d')]);for(var _0x2465dd=0x0;_0x2465dd<_0x267fc7['joins'][_0x0695('0x49')];_0x2465dd+=0x1){if(_0x267fc7['joins'][_0x2465dd][_0x0695('0x33')]&&_[_0x0695('0x62')](_0x5a8b2f,_0x267fc7[_0x0695('0x7d')][_0x2465dd][_0x0695('0x33')])&&_0x267fc7[_0x0695('0x7d')][_0x2465dd][_0x0695('0x7f')]&&_0x267fc7[_0x0695('0x7d')][_0x2465dd][_0x0695('0x80')]&&_0x267fc7['joins'][_0x2465dd][_0x0695('0x91')]){_0x5dbe9e[_0x267fc7[_0x0695('0x7d')][_0x2465dd]['type']](_0x267fc7['joins'][_0x2465dd][_0x0695('0x80')],null,util['format'](_0x0695('0x81'),_0x267fc7[_0x0695('0x74')],_0x267fc7[_0x0695('0x7d')][_0x2465dd]['parentKey'],_0x267fc7['joins'][_0x2465dd][_0x0695('0x80')],_0x267fc7[_0x0695('0x7d')][_0x2465dd]['foreignKey']));}}}if(_0x267fc7['conditions']){_0x267fc7[_0x0695('0x82')]=JSON[_0x0695('0x7e')](_0x267fc7[_0x0695('0x82')]);_0x5dbe9e[_0x0695('0x3d')](_0x9ef6e(_0x267fc7['conditions'][_0x0695('0x68')]));}_0x38e1f8=_0x5dbe9e['clone']();_0x5dbe9e[_0x0695('0x1e')](_0x5d1d0);_0x5dbe9e[_0x0695('0x1d')](0x0);logger[_0x0695('0x84')]('Limited\x20Query:',_0x5dbe9e[_0x0695('0x87')]());return dbH[_0x0695('0x86')][_0x0695('0x35')](_0x5dbe9e['toString'](),{'type':dbH[_0x0695('0x86')][_0x0695('0x88')][_0x0695('0x89')]});}})[_0x0695('0x27')](function(){return{'sql':_0x38e1f8[_0x0695('0x87')]()};})[_0x0695('0x27')](respondWithResult(_0x455050,null))[_0x0695('0x45')](handleError(_0x455050,null));}; \ No newline at end of file +var _0x84ae=['IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','cross_join','HOUR(%s)','IS\x20NOT\x20NULL','findAll','%s.%s\x20=\x20%s.%s','output','web','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','right_join','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','intersection','model','attributes','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','catch','params','keys','fields','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','join','left_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)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL'];(function(_0x38c0b2,_0x4be4d0){var _0x299da6=function(_0x381b16){while(--_0x381b16){_0x38c0b2['push'](_0x38c0b2['shift']());}};_0x299da6(++_0x4be4d0);}(_0x84ae,0xe1));var _0xe84a=function(_0x22658d,_0x328f29){_0x22658d=_0x22658d-0x0;var _0x49a56b=_0x84ae[_0x22658d];return _0x49a56b;};'use strict';var emlformat=require(_0xe84a('0x0'));var rimraf=require(_0xe84a('0x1'));var zipdir=require(_0xe84a('0x2'));var jsonpatch=require(_0xe84a('0x3'));var rp=require('request-promise');var moment=require(_0xe84a('0x4'));var BPromise=require(_0xe84a('0x5'));var Mustache=require(_0xe84a('0x6'));var util=require(_0xe84a('0x7'));var path=require(_0xe84a('0x8'));var sox=require(_0xe84a('0x9'));var csv=require(_0xe84a('0xa'));var ejs=require(_0xe84a('0xb'));var fs=require('fs');var fs_extra=require(_0xe84a('0xc'));var _=require('lodash');var squel=require(_0xe84a('0xd'));var crypto=require(_0xe84a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe84a('0xf'));var toCsv=require(_0xe84a('0xa'));var querystring=require(_0xe84a('0x10'));var Papa=require(_0xe84a('0x11'));var Redis=require(_0xe84a('0x12'));var authService=require(_0xe84a('0x13'));var qs=require(_0xe84a('0x14'));var as=require(_0xe84a('0x15'));var hardwareService=require(_0xe84a('0x16'));var logger=require(_0xe84a('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe84a('0x18'));var db=require(_0xe84a('0x19'))['db'];var dbH=require(_0xe84a('0x19'))[_0xe84a('0x1a')];function respondWithStatusCode(_0x288d7a,_0x125ea1){_0x125ea1=_0x125ea1||0xcc;return function(_0xc2e3f){if(_0xc2e3f){return _0x288d7a[_0xe84a('0x1b')](_0x125ea1);}return _0x288d7a[_0xe84a('0x1c')](_0x125ea1)[_0xe84a('0x1d')]();};}function respondWithResult(_0x556ca9,_0x21c11d){_0x21c11d=_0x21c11d||0xc8;return function(_0x1fb921){if(_0x1fb921){return _0x556ca9[_0xe84a('0x1c')](_0x21c11d)[_0xe84a('0x1e')](_0x1fb921);}};}function respondWithFilteredResult(_0x2e2906,_0xf49740){return function(_0x19e067){if(_0x19e067){var _0x111301=typeof _0xf49740['offset']===_0xe84a('0x1f')&&typeof _0xf49740[_0xe84a('0x20')]==='undefined';var _0xdf68fc=_0x19e067['count'];var _0x420265=_0x111301?0x0:_0xf49740[_0xe84a('0x21')];var _0x184414=_0x111301?_0x19e067[_0xe84a('0x22')]:_0xf49740[_0xe84a('0x21')]+_0xf49740[_0xe84a('0x20')];var _0x2ca3c0;if(_0x184414>=_0xdf68fc){_0x184414=_0xdf68fc;_0x2ca3c0=0xc8;}else{_0x2ca3c0=0xce;}_0x2e2906[_0xe84a('0x1c')](_0x2ca3c0);return _0x2e2906[_0xe84a('0x23')](_0xe84a('0x24'),_0x420265+'-'+_0x184414+'/'+_0xdf68fc)[_0xe84a('0x1e')](_0x19e067);}return null;};}function patchUpdates(_0x627706){return function(_0x1a0db7){try{jsonpatch[_0xe84a('0x25')](_0x1a0db7,_0x627706,!![]);}catch(_0x9d0079){return BPromise['reject'](_0x9d0079);}return _0x1a0db7[_0xe84a('0x26')]();};}function saveUpdates(_0x1daa0b,_0x687a7f){return function(_0x29c9bf){if(_0x29c9bf){return _0x29c9bf['update'](_0x1daa0b)[_0xe84a('0x27')](function(_0x299896){return _0x299896;});}return null;};}function removeEntity(_0x12983c,_0x17c800){return function(_0x5cdef1){if(_0x5cdef1){return _0x5cdef1[_0xe84a('0x28')]()['then'](function(){var _0x33036d=_0x5cdef1[_0xe84a('0x29')]({'plain':!![]});var _0x312f58='CustomReports';return db[_0xe84a('0x2a')]['destroy']({'where':{'type':_0x312f58,'resourceId':_0x33036d['id']}})[_0xe84a('0x27')](function(){return _0x5cdef1;});})['then'](function(){_0x12983c[_0xe84a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2efd8a,_0x47427f){return function(_0x5499bb){if(!_0x5499bb){_0x2efd8a[_0xe84a('0x1b')](0x194);}return _0x5499bb;};}function handleError(_0x45a7fa,_0x458fd7){_0x458fd7=_0x458fd7||0x1f4;return function(_0x2a8136){logger[_0xe84a('0x2b')](_0x2a8136[_0xe84a('0x2c')]);if(_0x2a8136['name']){delete _0x2a8136[_0xe84a('0x2d')];}_0x45a7fa[_0xe84a('0x1c')](_0x458fd7)[_0xe84a('0x2e')](_0x2a8136);};}exports[_0xe84a('0x2f')]=function(_0x398a3d,_0x1e5865){var _0x2f1c68={},_0x4f45c1={},_0x15eabb={'count':0x0,'rows':[]};var _0x4a1297=_[_0xe84a('0x30')](db[_0xe84a('0x31')][_0xe84a('0x32')],function(_0x3a1e13){return{'name':_0x3a1e13[_0xe84a('0x33')],'type':_0x3a1e13[_0xe84a('0x34')][_0xe84a('0x35')]};});_0x4f45c1['model']=_[_0xe84a('0x30')](_0x4a1297,_0xe84a('0x2d'));_0x4f45c1[_0xe84a('0x36')]=_['keys'](_0x398a3d['query']);_0x4f45c1['filters']=_[_0xe84a('0x37')](_0x4f45c1[_0xe84a('0x38')],_0x4f45c1[_0xe84a('0x36')]);_0x2f1c68[_0xe84a('0x39')]=_[_0xe84a('0x37')](_0x4f45c1['model'],qs['fields'](_0x398a3d[_0xe84a('0x36')]['fields']));_0x2f1c68[_0xe84a('0x39')]=_0x2f1c68[_0xe84a('0x39')]['length']?_0x2f1c68[_0xe84a('0x39')]:_0x4f45c1[_0xe84a('0x38')];if(!_0x398a3d['query']['hasOwnProperty']('nolimit')){_0x2f1c68[_0xe84a('0x20')]=qs[_0xe84a('0x20')](_0x398a3d['query']['limit']);_0x2f1c68['offset']=qs[_0xe84a('0x21')](_0x398a3d[_0xe84a('0x36')][_0xe84a('0x21')]);}_0x2f1c68[_0xe84a('0x3a')]=qs[_0xe84a('0x3b')](_0x398a3d[_0xe84a('0x36')][_0xe84a('0x3b')]);_0x2f1c68[_0xe84a('0x3c')]=qs[_0xe84a('0x3d')](_['pick'](_0x398a3d[_0xe84a('0x36')],_0x4f45c1[_0xe84a('0x3d')]),_0x4a1297);if(_0x398a3d[_0xe84a('0x36')][_0xe84a('0x3e')]){_0x2f1c68[_0xe84a('0x3c')]=_['merge'](_0x2f1c68[_0xe84a('0x3c')],{'$or':_[_0xe84a('0x30')](_0x4a1297,function(_0x51bf37){if(_0x51bf37[_0xe84a('0x34')]!==_0xe84a('0x3f')){var _0x5768db={};_0x5768db[_0x51bf37[_0xe84a('0x2d')]]={'$like':'%'+_0x398a3d['query']['filter']+'%'};return _0x5768db;}})});}_0x2f1c68=_[_0xe84a('0x40')]({},_0x2f1c68,_0x398a3d[_0xe84a('0x41')]);var _0xe459a9={'where':_0x2f1c68[_0xe84a('0x3c')]};return db[_0xe84a('0x31')][_0xe84a('0x22')](_0xe459a9)['then'](function(_0x22008f){_0x15eabb[_0xe84a('0x22')]=_0x22008f;if(_0x398a3d['query'][_0xe84a('0x42')]){_0x2f1c68[_0xe84a('0x43')]=[{'all':!![]}];}return db[_0xe84a('0x31')]['findAll'](_0x2f1c68);})[_0xe84a('0x27')](function(_0x4e4913){_0x15eabb['rows']=_0x4e4913;return _0x15eabb;})[_0xe84a('0x27')](respondWithFilteredResult(_0x1e5865,_0x2f1c68))[_0xe84a('0x44')](handleError(_0x1e5865,null));};exports['show']=function(_0x4a190c,_0x480760){var _0x126b73={'raw':![],'where':{'id':_0x4a190c[_0xe84a('0x45')]['id']}},_0x53acf5={};_0x53acf5[_0xe84a('0x38')]=_[_0xe84a('0x46')](db[_0xe84a('0x31')]['rawAttributes']);_0x53acf5[_0xe84a('0x36')]=_[_0xe84a('0x46')](_0x4a190c['query']);_0x53acf5[_0xe84a('0x3d')]=_[_0xe84a('0x37')](_0x53acf5[_0xe84a('0x38')],_0x53acf5[_0xe84a('0x36')]);_0x126b73[_0xe84a('0x39')]=_['intersection'](_0x53acf5[_0xe84a('0x38')],qs[_0xe84a('0x47')](_0x4a190c['query']['fields']));_0x126b73['attributes']=_0x126b73[_0xe84a('0x39')]['length']?_0x126b73['attributes']:_0x53acf5[_0xe84a('0x38')];if(_0x4a190c['query'][_0xe84a('0x42')]){_0x126b73[_0xe84a('0x43')]=[{'all':!![]}];}_0x126b73=_[_0xe84a('0x40')]({},_0x126b73,_0x4a190c[_0xe84a('0x41')]);return db[_0xe84a('0x31')][_0xe84a('0x48')](_0x126b73)[_0xe84a('0x27')](handleEntityNotFound(_0x480760,null))[_0xe84a('0x27')](respondWithResult(_0x480760,null))[_0xe84a('0x44')](handleError(_0x480760,null));};exports[_0xe84a('0x49')]=function(_0x2de074,_0x3695d3){return db[_0xe84a('0x31')]['create'](_0x2de074[_0xe84a('0x4a')],{})['then'](function(_0x26f772){var _0x2e97b5=_0x2de074['user'][_0xe84a('0x29')]({'plain':!![]});if(!_0x2e97b5)throw new Error(_0xe84a('0x4b'));if(_0x2e97b5[_0xe84a('0x4c')]===_0xe84a('0x4d')){var _0x2eb827=_0x26f772[_0xe84a('0x29')]({'plain':!![]});var _0x5b8f3e=_0xe84a('0x4e');return db[_0xe84a('0x4f')][_0xe84a('0x48')]({'where':{'name':_0x5b8f3e,'userProfileId':_0x2e97b5[_0xe84a('0x50')]},'raw':!![]})[_0xe84a('0x27')](function(_0x4468b2){if(_0x4468b2&&_0x4468b2['autoAssociation']===0x0){return db['UserProfileResource'][_0xe84a('0x49')]({'name':_0x2eb827[_0xe84a('0x2d')],'resourceId':_0x2eb827['id'],'type':'CustomReports','sectionId':_0x4468b2['id']},{})['then'](function(){return _0x26f772;});}else{return _0x26f772;}})[_0xe84a('0x44')](function(_0x532fb9){logger[_0xe84a('0x2b')](_0xe84a('0x51'),_0x532fb9);throw _0x532fb9;});}return _0x26f772;})['then'](respondWithResult(_0x3695d3,0xc9))[_0xe84a('0x44')](handleError(_0x3695d3,null));};exports[_0xe84a('0x52')]=function(_0x1f68a2,_0x11a9c0){if(_0x1f68a2[_0xe84a('0x4a')]['id']){delete _0x1f68a2[_0xe84a('0x4a')]['id'];}return db['AnalyticCustomReport'][_0xe84a('0x48')]({'where':{'id':_0x1f68a2[_0xe84a('0x45')]['id']}})['then'](handleEntityNotFound(_0x11a9c0,null))[_0xe84a('0x27')](saveUpdates(_0x1f68a2[_0xe84a('0x4a')],null))[_0xe84a('0x27')](respondWithResult(_0x11a9c0,null))[_0xe84a('0x44')](handleError(_0x11a9c0,null));};exports['destroy']=function(_0x42b6c1,_0x4975eb){return db[_0xe84a('0x31')][_0xe84a('0x48')]({'where':{'id':_0x42b6c1[_0xe84a('0x45')]['id']}})['then'](handleEntityNotFound(_0x4975eb,null))['then'](removeEntity(_0x4975eb,null))[_0xe84a('0x44')](handleError(_0x4975eb,null));};exports['preview']=function(_0x2c096b,_0x5bd2d5){var _0x208588=0xa;var _0x4b5056=[_0xe84a('0x53'),_0xe84a('0x54'),'right_join','cross_join'];var _0xb38ecf={'SUM':_0xe84a('0x55'),'COUNT':_0xe84a('0x56'),'COUNT DISTINCT':_0xe84a('0x57'),'MAX':_0xe84a('0x58'),'MIN':_0xe84a('0x59'),'AVG':_0xe84a('0x5a'),'GROUP_CONCAT':_0xe84a('0x5b'),'GROUP_CONCAT ASC':_0xe84a('0x5c'),'GROUP_CONCAT DESC':_0xe84a('0x5d')};var _0x2c6818={'SEC_TO_TIME':_0xe84a('0x5e'),'DATE':_0xe84a('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe84a('0x60'),'UNIX_TIMESTAMP':_0xe84a('0x61')};var _0x31e806=function(_0x249e64){return!_['includes']([_0xe84a('0x62'),'IS\x20NOT\x20NULL',_0xe84a('0x63'),_0xe84a('0x64')],_0x249e64);};var _0x5aace4=function(_0x5df979){if(!_0x5df979||!_0x5df979[_0xe84a('0x65')][_0xe84a('0x66')]){return'';}for(var _0xdc38fd='(',_0x5984e1=0x0;_0x5984e1<_0x5df979[_0xe84a('0x65')][_0xe84a('0x66')];_0x5984e1+=0x1){_0x5984e1>0x0&&(_0xdc38fd+='\x20'+_0x5df979[_0xe84a('0x67')]+'\x20');_0xdc38fd+=_0x5df979['rules'][_0x5984e1][_0xe84a('0x68')]?_0x5aace4(_0x5df979['rules'][_0x5984e1]['group']):_0x5df979[_0xe84a('0x65')][_0x5984e1][_0xe84a('0x69')]+'\x20'+_0x5df979[_0xe84a('0x65')][_0x5984e1]['condition']+(_0x31e806(_0x5df979[_0xe84a('0x65')][_0x5984e1][_0xe84a('0x6a')])?'\x20'+_0x5df979['rules'][_0x5984e1][_0xe84a('0x6b')]:'');}return _0xdc38fd+')';};var _0x165b73={'where':{'id':_0x2c096b[_0xe84a('0x45')]['id']}},_0x5d280e,_0x2d8eca,_0x562a60,_0xb716bf,_0x3d22ca;_0x165b73=_[_0xe84a('0x40')]({},_0x165b73,_0x2c096b['options']);return db[_0xe84a('0x31')]['find'](_0x165b73)[_0xe84a('0x27')](function(_0x410085){if(_0x410085){_0x5d280e=_0x410085;return _0x410085[_0xe84a('0x6c')]();}return null;})[_0xe84a('0x27')](function(_0x5835b3){if(_0x5835b3){if(!_0x5835b3[_0xe84a('0x66')]){throw new db[(_0xe84a('0x6d'))][(_0xe84a('0x6e'))](_0xe84a('0x6f'),0x193);}_0x2d8eca=_0x5835b3;return db[_0xe84a('0x70')]['findAll']({'raw':!![]});}return null;})[_0xe84a('0x27')](function(_0x21608f){if(_0x21608f){_0x562a60=_[_0xe84a('0x71')](_0x21608f,'id');var _0x3a6a27;var _0x17e330=squel[_0xe84a('0x72')]();_0x17e330[_0xe84a('0x73')](_0x5d280e[_0xe84a('0x74')]);for(var _0x7c4bcf=0x0;_0x7c4bcf<_0x2d8eca[_0xe84a('0x66')];_0x7c4bcf+=0x1){_0x3a6a27=_0x2d8eca[_0x7c4bcf]['MetricId']?_0x562a60[_0x2d8eca[_0x7c4bcf][_0xe84a('0x75')]][_0xe84a('0x76')]:_0x2d8eca[_0x7c4bcf][_0xe84a('0x69')];_0x3a6a27=_0x2d8eca[_0x7c4bcf][_0xe84a('0x77')]?_[_0xe84a('0x78')](_0xb38ecf[_0x2d8eca[_0x7c4bcf][_0xe84a('0x77')]],'%s',_0x3a6a27):_0x3a6a27;_0x3a6a27=_0x2d8eca[_0x7c4bcf][_0xe84a('0x79')]?_['replace'](_0x2c6818[_0x2d8eca[_0x7c4bcf][_0xe84a('0x79')]],'%s',_0x3a6a27):_0x3a6a27;if(_0x2d8eca[_0x7c4bcf][_0xe84a('0x7a')]){_0x17e330[_0xe84a('0x68')](_0x3a6a27);}_0x2d8eca[_0x7c4bcf][_0xe84a('0x7b')]&&_0x17e330['order'](_0x3a6a27,_0x2d8eca[_0x7c4bcf]['orderBy']===_0xe84a('0x7c')?![]:!![]);_0x17e330[_0xe84a('0x69')](_0x3a6a27,_0x2d8eca[_0x7c4bcf][_0xe84a('0x7d')]||_0x3a6a27);}if(_0x5d280e['joins']){_0x5d280e[_0xe84a('0x7e')]=JSON[_0xe84a('0x7f')](_0x5d280e['joins']);for(var _0x4ae1cd=0x0;_0x4ae1cd<_0x5d280e[_0xe84a('0x7e')][_0xe84a('0x66')];_0x4ae1cd+=0x1){if(_0x5d280e['joins'][_0x4ae1cd]['type']&&_[_0xe84a('0x80')](_0x4b5056,_0x5d280e[_0xe84a('0x7e')][_0x4ae1cd][_0xe84a('0x34')])&&_0x5d280e[_0xe84a('0x7e')][_0x4ae1cd][_0xe84a('0x81')]&&_0x5d280e[_0xe84a('0x7e')][_0x4ae1cd][_0xe84a('0x82')]&&_0x5d280e[_0xe84a('0x7e')][_0x4ae1cd][_0xe84a('0x83')]){_0x17e330[_0x5d280e[_0xe84a('0x7e')][_0x4ae1cd][_0xe84a('0x34')]](_0x5d280e[_0xe84a('0x7e')][_0x4ae1cd][_0xe84a('0x82')],null,util[_0xe84a('0x79')]('%s.%s\x20=\x20%s.%s',_0x5d280e[_0xe84a('0x74')],_0x5d280e[_0xe84a('0x7e')][_0x4ae1cd][_0xe84a('0x81')],_0x5d280e['joins'][_0x4ae1cd][_0xe84a('0x82')],_0x5d280e[_0xe84a('0x7e')][_0x4ae1cd][_0xe84a('0x83')]));}}}if(_0x5d280e[_0xe84a('0x84')]){_0x5d280e[_0xe84a('0x84')]=JSON[_0xe84a('0x7f')](_0x5d280e[_0xe84a('0x84')]);_0x17e330[_0xe84a('0x3c')](_0x5aace4(_0x5d280e[_0xe84a('0x84')][_0xe84a('0x68')]));}_0x3d22ca=_0x17e330[_0xe84a('0x85')]();_0x17e330[_0xe84a('0x20')](_0x208588);_0x17e330['offset'](0x0);logger[_0xe84a('0x86')]('Limited\x20Query:',_0x17e330[_0xe84a('0x87')]());return dbH[_0xe84a('0x88')][_0xe84a('0x36')](_0x17e330[_0xe84a('0x87')](),{'type':dbH[_0xe84a('0x88')][_0xe84a('0x89')][_0xe84a('0x8a')]});}})[_0xe84a('0x27')](respondWithResult(_0x5bd2d5,null))[_0xe84a('0x44')](handleError(_0x5bd2d5,null));};function runReport(_0x1aad42,_0x47e3bf,_0x435f2f){var _0x528bb0=_0x47e3bf[_0xe84a('0x2d')];var _0x5ecb84=0xa;var _0x296297=['join',_0xe84a('0x54'),'right_join',_0xe84a('0x8b')];var _0xa2b992={'SUM':_0xe84a('0x55'),'COUNT':_0xe84a('0x56'),'COUNT DISTINCT':_0xe84a('0x57'),'MAX':'MAX(%s)','MIN':_0xe84a('0x59'),'AVG':_0xe84a('0x5a'),'GROUP_CONCAT':_0xe84a('0x5b'),'GROUP_CONCAT ASC':_0xe84a('0x5c'),'GROUP_CONCAT DESC':_0xe84a('0x5d')};var _0x39921b={'SEC_TO_TIME':_0xe84a('0x5e'),'DATE':'DATE(%s)','HOUR':_0xe84a('0x8c'),'ROUND':_0xe84a('0x60'),'UNIX_TIMESTAMP':_0xe84a('0x61')};var _0x41c3b0=function(_0x2191bb){return!_[_0xe84a('0x80')]([_0xe84a('0x62'),_0xe84a('0x8d'),_0xe84a('0x63'),'IS\x20NOT\x20EMPTY'],_0x2191bb);};var _0x5189de=function(_0x482a1c){if(!_0x482a1c||!_0x482a1c[_0xe84a('0x65')][_0xe84a('0x66')]){return'';}for(var _0x22361b='(',_0x535cd5=0x0;_0x535cd5<_0x482a1c[_0xe84a('0x65')][_0xe84a('0x66')];_0x535cd5+=0x1){_0x535cd5>0x0&&(_0x22361b+='\x20'+_0x482a1c['operator']+'\x20');_0x22361b+=_0x482a1c[_0xe84a('0x65')][_0x535cd5][_0xe84a('0x68')]?_0x5189de(_0x482a1c[_0xe84a('0x65')][_0x535cd5][_0xe84a('0x68')]):_0x482a1c[_0xe84a('0x65')][_0x535cd5]['field']+'\x20'+_0x482a1c[_0xe84a('0x65')][_0x535cd5]['condition']+(_0x41c3b0(_0x482a1c[_0xe84a('0x65')][_0x535cd5]['condition'])?'\x20'+_0x482a1c[_0xe84a('0x65')][_0x535cd5]['value']:'');}return _0x22361b+')';};var _0xa3a602={'where':{'id':_0x1aad42['id']}},_0x287c11,_0x5193d9,_0x47ee32,_0x426dee,_0x474316;_0xa3a602=_[_0xe84a('0x40')]({},_0xa3a602,_0x435f2f);return db[_0xe84a('0x31')][_0xe84a('0x48')](_0xa3a602)[_0xe84a('0x27')](function(_0x5d342a){if(_0x5d342a){_0x287c11=_0x5d342a;return _0x5d342a[_0xe84a('0x6c')]();}return null;})['then'](function(_0x14cd80){if(_0x14cd80){if(!_0x14cd80[_0xe84a('0x66')]){throw new db[(_0xe84a('0x6d'))][(_0xe84a('0x6e'))](_0xe84a('0x6f'),0x193);}_0x5193d9=_0x14cd80;return db['AnalyticMetric'][_0xe84a('0x8e')]({'raw':!![]});}return null;})[_0xe84a('0x27')](function(_0x3cfe0f){if(_0x3cfe0f){_0x47ee32=_[_0xe84a('0x71')](_0x3cfe0f,'id');var _0x51cf8c;var _0x13f24e=squel[_0xe84a('0x72')]();_0x13f24e['from'](_0x287c11['table']);for(var _0x57d8a3=0x0;_0x57d8a3<_0x5193d9['length'];_0x57d8a3+=0x1){_0x51cf8c=_0x5193d9[_0x57d8a3][_0xe84a('0x75')]?_0x47ee32[_0x5193d9[_0x57d8a3][_0xe84a('0x75')]]['metric']:_0x5193d9[_0x57d8a3][_0xe84a('0x69')];_0x51cf8c=_0x5193d9[_0x57d8a3][_0xe84a('0x77')]?_['replace'](_0xa2b992[_0x5193d9[_0x57d8a3]['function']],'%s',_0x51cf8c):_0x51cf8c;_0x51cf8c=_0x5193d9[_0x57d8a3][_0xe84a('0x79')]?_[_0xe84a('0x78')](_0x39921b[_0x5193d9[_0x57d8a3]['format']],'%s',_0x51cf8c):_0x51cf8c;if(_0x5193d9[_0x57d8a3][_0xe84a('0x7a')]){_0x13f24e[_0xe84a('0x68')](_0x51cf8c);}_0x5193d9[_0x57d8a3]['orderBy']&&_0x13f24e[_0xe84a('0x3a')](_0x51cf8c,_0x5193d9[_0x57d8a3][_0xe84a('0x7b')]===_0xe84a('0x7c')?![]:!![]);_0x13f24e['field'](_0x51cf8c,_0x5193d9[_0x57d8a3]['alias']||_0x51cf8c);}if(_0x287c11[_0xe84a('0x7e')]){_0x287c11[_0xe84a('0x7e')]=JSON[_0xe84a('0x7f')](_0x287c11['joins']);for(var _0x2b0259=0x0;_0x2b0259<_0x287c11[_0xe84a('0x7e')][_0xe84a('0x66')];_0x2b0259+=0x1){if(_0x287c11[_0xe84a('0x7e')][_0x2b0259][_0xe84a('0x34')]&&_['includes'](_0x296297,_0x287c11['joins'][_0x2b0259][_0xe84a('0x34')])&&_0x287c11[_0xe84a('0x7e')][_0x2b0259]['parentKey']&&_0x287c11[_0xe84a('0x7e')][_0x2b0259][_0xe84a('0x82')]&&_0x287c11[_0xe84a('0x7e')][_0x2b0259]['foreignKey']){_0x13f24e[_0x287c11[_0xe84a('0x7e')][_0x2b0259][_0xe84a('0x34')]](_0x287c11[_0xe84a('0x7e')][_0x2b0259][_0xe84a('0x82')],null,util[_0xe84a('0x79')](_0xe84a('0x8f'),_0x287c11['table'],_0x287c11[_0xe84a('0x7e')][_0x2b0259][_0xe84a('0x81')],_0x287c11[_0xe84a('0x7e')][_0x2b0259][_0xe84a('0x82')],_0x287c11[_0xe84a('0x7e')][_0x2b0259][_0xe84a('0x83')]));}}}if(_0x287c11[_0xe84a('0x84')]){_0x287c11['conditions']=JSON[_0xe84a('0x7f')](_0x287c11[_0xe84a('0x84')]);_0x13f24e[_0xe84a('0x3c')](_0x5189de(_0x287c11[_0xe84a('0x84')]['group']));}_0x474316=_0x13f24e[_0xe84a('0x85')]();_0x13f24e['limit'](_0x5ecb84);_0x13f24e[_0xe84a('0x21')](0x0);return;}})[_0xe84a('0x27')](function(){if(_0x47e3bf[_0xe84a('0x90')]===_0xe84a('0x91')){return null;}var _0x33691c=_[_0xe84a('0x40')](_0x47e3bf,{'name':_0x47e3bf['fullPath']||_0x47e3bf['name']||_0x287c11[_0xe84a('0x2d')],'basename':_0x528bb0,'savename':util[_0xe84a('0x79')]('%s-%s.%s',_0x47e3bf['name']||_0x287c11[_0xe84a('0x2d')],require(_0xe84a('0x92'))[_0xe84a('0x93')](0x4),_0x47e3bf[_0xe84a('0x90')]||_0xe84a('0x94')),'reportId':_0x287c11['id'],'reportType':'custom'});return db[_0xe84a('0x95')][_0xe84a('0x49')](_0x33691c,{'raw':!![]});})['then'](function(_0x4d36f3){if(_0x287c11[_0xe84a('0x74')]===_0xe84a('0x96')){_0x474316[_0xe84a('0x3c')](_0x287c11[_0xe84a('0x74')]+_0xe84a('0x97'),_0x47e3bf[_0xe84a('0x98')],_0x47e3bf[_0xe84a('0x99')]);}else{_0x474316[_0xe84a('0x3c')](_0x287c11['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x47e3bf[_0xe84a('0x98')],_0x47e3bf['endDate']);}if(_0x4d36f3){logger['info']('Run\x20Query:',_0x474316[_0xe84a('0x87')]());require('child_process')['fork'](path[_0xe84a('0x53')](__dirname,_0xe84a('0x9a'),_0x4d36f3[_0xe84a('0x90')]),[_0x4d36f3['id'],_0x474316['toString'](),path[_0xe84a('0x53')](__dirname,_0xe84a('0x9b'),_0x4d36f3[_0xe84a('0x9c')]),_0x528bb0]);return _0x4d36f3;}else{var _0x3c5baa=squel[_0xe84a('0x72')]();_0x3c5baa[_0xe84a('0x73')]('('+_0x474316[_0xe84a('0x87')]()+')',_0xe84a('0x9d'));_0x3c5baa[_0xe84a('0x69')](_0xe84a('0x9e'),_0xe84a('0x22'));_0x474316[_0xe84a('0x20')](_0x47e3bf[_0xe84a('0x20')]||_0x5ecb84);_0x474316['offset'](_0x47e3bf['offset']||0x0);return dbH[_0xe84a('0x88')]['query'](_0x3c5baa[_0xe84a('0x87')](),{'type':dbH[_0xe84a('0x88')][_0xe84a('0x89')]['SELECT']})[_0xe84a('0x27')](function(_0x58420b){if(!_0x58420b['length']){_0x426dee=0x0;}else{_0x426dee=_0x58420b[0x0][_0xe84a('0x22')]||0x0;}return dbH[_0xe84a('0x88')][_0xe84a('0x36')](_0x474316[_0xe84a('0x87')](),{'type':dbH['sequelize'][_0xe84a('0x89')][_0xe84a('0x8a')]});})[_0xe84a('0x27')](function(_0x27b3b4){return{'rows':_0x27b3b4||[],'count':_0x426dee};});}});}exports[_0xe84a('0x9f')]=function(_0x538e04,_0x19f196){return runReport(_0x538e04[_0xe84a('0x45')],_0x538e04[_0xe84a('0x36')],_0x538e04[_0xe84a('0x41')])[_0xe84a('0x27')](respondWithResult(_0x19f196,null))[_0xe84a('0x44')](handleError(_0x19f196,null));};exports['runReport']=runReport;exports[_0xe84a('0x36')]=function(_0x1a84f4,_0x18bcf9){var _0x55eb4b=0xa;var _0xfacc52=[_0xe84a('0x53'),'left_join',_0xe84a('0xa0'),'cross_join'];var _0x3d26cd={'SUM':_0xe84a('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe84a('0x57'),'MAX':'MAX(%s)','MIN':_0xe84a('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe84a('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2fed10={'SEC_TO_TIME':_0xe84a('0x5e'),'DATE':_0xe84a('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe84a('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x382f87=function(_0x47d11a){return!_[_0xe84a('0x80')](['IS\x20NULL',_0xe84a('0x8d'),_0xe84a('0x63'),'IS\x20NOT\x20EMPTY'],_0x47d11a);};var _0x35fc77=function(_0x32d348){if(!_0x32d348||!_0x32d348[_0xe84a('0x65')]['length']){return'';}for(var _0x257052='(',_0x2f5582=0x0;_0x2f5582<_0x32d348[_0xe84a('0x65')][_0xe84a('0x66')];_0x2f5582+=0x1){_0x2f5582>0x0&&(_0x257052+='\x20'+_0x32d348[_0xe84a('0x67')]+'\x20');_0x257052+=_0x32d348[_0xe84a('0x65')][_0x2f5582][_0xe84a('0x68')]?_0x35fc77(_0x32d348[_0xe84a('0x65')][_0x2f5582]['group']):_0x32d348['rules'][_0x2f5582]['field']+'\x20'+_0x32d348[_0xe84a('0x65')][_0x2f5582][_0xe84a('0x6a')]+(_0x382f87(_0x32d348[_0xe84a('0x65')][_0x2f5582][_0xe84a('0x6a')])?'\x20'+_0x32d348[_0xe84a('0x65')][_0x2f5582][_0xe84a('0x6b')]:'');}return _0x257052+')';};var _0x1769f0={'where':{'id':_0x1a84f4[_0xe84a('0x45')]['id']}},_0x436d5b,_0x3ea61e,_0x3e4364,_0x403e0a,_0x9d9736;_0x1769f0=_['merge']({},_0x1769f0,_0x1a84f4['options']);return db[_0xe84a('0x31')][_0xe84a('0x48')](_0x1769f0)['then'](function(_0xf8957){if(_0xf8957){_0x436d5b=_0xf8957;return _0xf8957['getFields']();}return null;})[_0xe84a('0x27')](function(_0x517faf){if(_0x517faf){if(!_0x517faf['length']){throw new db[(_0xe84a('0x6d'))][(_0xe84a('0x6e'))](_0xe84a('0x6f'),0x193);}_0x3ea61e=_0x517faf;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xe84a('0x27')](function(_0x2fb6cd){if(_0x2fb6cd){_0x3e4364=_[_0xe84a('0x71')](_0x2fb6cd,'id');var _0x40721c;var _0x7a680=squel[_0xe84a('0x72')]();_0x7a680[_0xe84a('0x73')](_0x436d5b[_0xe84a('0x74')]);for(var _0x1314f4=0x0;_0x1314f4<_0x3ea61e[_0xe84a('0x66')];_0x1314f4+=0x1){_0x40721c=_0x3ea61e[_0x1314f4]['MetricId']?_0x3e4364[_0x3ea61e[_0x1314f4][_0xe84a('0x75')]][_0xe84a('0x76')]:_0x3ea61e[_0x1314f4]['field'];_0x40721c=_0x3ea61e[_0x1314f4][_0xe84a('0x77')]?_['replace'](_0x3d26cd[_0x3ea61e[_0x1314f4]['function']],'%s',_0x40721c):_0x40721c;_0x40721c=_0x3ea61e[_0x1314f4][_0xe84a('0x79')]?_[_0xe84a('0x78')](_0x2fed10[_0x3ea61e[_0x1314f4]['format']],'%s',_0x40721c):_0x40721c;if(_0x3ea61e[_0x1314f4][_0xe84a('0x7a')]){_0x7a680[_0xe84a('0x68')](_0x40721c);}_0x3ea61e[_0x1314f4][_0xe84a('0x7b')]&&_0x7a680['order'](_0x40721c,_0x3ea61e[_0x1314f4][_0xe84a('0x7b')]===_0xe84a('0x7c')?![]:!![]);_0x7a680[_0xe84a('0x69')](_0x40721c,_0x3ea61e[_0x1314f4][_0xe84a('0x7d')]||_0x40721c);}if(_0x436d5b[_0xe84a('0x7e')]){_0x436d5b[_0xe84a('0x7e')]=JSON['parse'](_0x436d5b[_0xe84a('0x7e')]);for(var _0x3716b0=0x0;_0x3716b0<_0x436d5b[_0xe84a('0x7e')][_0xe84a('0x66')];_0x3716b0+=0x1){if(_0x436d5b[_0xe84a('0x7e')][_0x3716b0][_0xe84a('0x34')]&&_[_0xe84a('0x80')](_0xfacc52,_0x436d5b[_0xe84a('0x7e')][_0x3716b0][_0xe84a('0x34')])&&_0x436d5b[_0xe84a('0x7e')][_0x3716b0][_0xe84a('0x81')]&&_0x436d5b[_0xe84a('0x7e')][_0x3716b0][_0xe84a('0x82')]&&_0x436d5b['joins'][_0x3716b0][_0xe84a('0x83')]){_0x7a680[_0x436d5b['joins'][_0x3716b0][_0xe84a('0x34')]](_0x436d5b['joins'][_0x3716b0]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x436d5b[_0xe84a('0x74')],_0x436d5b[_0xe84a('0x7e')][_0x3716b0][_0xe84a('0x81')],_0x436d5b['joins'][_0x3716b0][_0xe84a('0x82')],_0x436d5b[_0xe84a('0x7e')][_0x3716b0][_0xe84a('0x83')]));}}}if(_0x436d5b[_0xe84a('0x84')]){_0x436d5b[_0xe84a('0x84')]=JSON[_0xe84a('0x7f')](_0x436d5b[_0xe84a('0x84')]);_0x7a680[_0xe84a('0x3c')](_0x35fc77(_0x436d5b['conditions']['group']));}_0x9d9736=_0x7a680['clone']();_0x7a680['limit'](_0x55eb4b);_0x7a680[_0xe84a('0x21')](0x0);logger[_0xe84a('0x86')](_0xe84a('0xa1'),_0x7a680[_0xe84a('0x87')]());return dbH[_0xe84a('0x88')][_0xe84a('0x36')](_0x7a680[_0xe84a('0x87')](),{'type':dbH['sequelize']['QueryTypes'][_0xe84a('0x8a')]});}})[_0xe84a('0x27')](function(){return{'sql':_0x9d9736[_0xe84a('0x87')]()};})[_0xe84a('0x27')](respondWithResult(_0x18bcf9,null))[_0xe84a('0x44')](handleError(_0x18bcf9,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 7ce6362..92a61bf 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 _0x5170=['path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x5170,0x199));var _0x0517=function(_0x20ed01,_0x51f6c4){_0x20ed01=_0x20ed01-0x0;var _0x3d2ab3=_0x5170[_0x20ed01];return _0x3d2ab3;};'use strict';var _=require(_0x0517('0x0'));var util=require(_0x0517('0x1'));var logger=require(_0x0517('0x2'))(_0x0517('0x3'));var moment=require(_0x0517('0x4'));var BPromise=require(_0x0517('0x5'));var rp=require(_0x0517('0x6'));var fs=require('fs');var path=require(_0x0517('0x7'));var rimraf=require(_0x0517('0x8'));var config=require('../../config/environment');var attributes=require(_0x0517('0x9'));module[_0x0517('0xa')]=function(_0x21d97b,_0x1bb9ae){return _0x21d97b[_0x0517('0xb')](_0x0517('0xc'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14c8=['./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x59b521,_0xa3b157){var _0x33e544=function(_0x5a3702){while(--_0x5a3702){_0x59b521['push'](_0x59b521['shift']());}};_0x33e544(++_0xa3b157);}(_0x14c8,0x184));var _0x814c=function(_0x37811b,_0x32bce1){_0x37811b=_0x37811b-0x0;var _0x588d47=_0x14c8[_0x37811b];return _0x588d47;};'use strict';var _=require(_0x814c('0x0'));var util=require(_0x814c('0x1'));var logger=require(_0x814c('0x2'))(_0x814c('0x3'));var moment=require('moment');var BPromise=require(_0x814c('0x4'));var rp=require(_0x814c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x814c('0x6'));var config=require(_0x814c('0x7'));var attributes=require(_0x814c('0x8'));module[_0x814c('0x9')]=function(_0x24de3d,_0x404130){return _0x24de3d[_0x814c('0xa')](_0x814c('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index ad3a26f..d2dc62f 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 _0xa370=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa370,0x173));var _0x0a37=function(_0x1111ac,_0x27f3d9){_0x1111ac=_0x1111ac-0x0;var _0x2b30c6=_0xa370[_0x1111ac];return _0x2b30c6;};'use strict';var _=require(_0x0a37('0x0'));var util=require('util');var moment=require(_0x0a37('0x1'));var BPromise=require(_0x0a37('0x2'));var rs=require(_0x0a37('0x3'));var fs=require('fs');var Redis=require(_0x0a37('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a37('0x5'));var logger=require(_0x0a37('0x6'))(_0x0a37('0x7'));var config=require(_0x0a37('0x8'));var jayson=require(_0x0a37('0x9'));var client=jayson[_0x0a37('0xa')][_0x0a37('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23f2b4,_0x4fa856,_0x3fdec7){return new BPromise(function(_0x42a395,_0x4de362){return client['request'](_0x23f2b4,_0x3fdec7)['then'](function(_0x51a764){logger[_0x0a37('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4fa856,'request\x20sent');logger[_0x0a37('0xd')](_0x0a37('0xe'),_0x4fa856,_0x0a37('0xf'),JSON[_0x0a37('0x10')](_0x51a764));if(_0x51a764[_0x0a37('0x11')]){if(_0x51a764['error'][_0x0a37('0x12')]===0x1f4){logger['error'](_0x0a37('0x13'),_0x4fa856,_0x51a764[_0x0a37('0x11')][_0x0a37('0x14')]);return _0x4de362(_0x51a764[_0x0a37('0x11')][_0x0a37('0x14')]);}logger[_0x0a37('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4fa856,_0x51a764[_0x0a37('0x11')][_0x0a37('0x14')]);return _0x42a395(_0x51a764['error'][_0x0a37('0x14')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x4fa856,_0x0a37('0xf'));_0x42a395(_0x51a764[_0x0a37('0x15')][_0x0a37('0x14')]);}})[_0x0a37('0x16')](function(_0xced11){logger[_0x0a37('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4fa856,_0xced11);_0x4de362(_0xced11);});});} \ No newline at end of file +var _0xa3f0=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xf7767a,_0x5d2d91){var _0x25109d=function(_0x5b1430){while(--_0x5b1430){_0xf7767a['push'](_0xf7767a['shift']());}};_0x25109d(++_0x5d2d91);}(_0xa3f0,0x177));var _0x0a3f=function(_0x323708,_0x4bebf2){_0x323708=_0x323708-0x0;var _0x3da3d7=_0xa3f0[_0x323708];return _0x3da3d7;};'use strict';var _=require('lodash');var util=require(_0x0a3f('0x0'));var moment=require(_0x0a3f('0x1'));var BPromise=require(_0x0a3f('0x2'));var rs=require(_0x0a3f('0x3'));var fs=require('fs');var Redis=require(_0x0a3f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a3f('0x5'));var logger=require(_0x0a3f('0x6'))(_0x0a3f('0x7'));var config=require(_0x0a3f('0x8'));var jayson=require(_0x0a3f('0x9'));var client=jayson[_0x0a3f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27e03d,_0x46e59f,_0x3b5908){return new BPromise(function(_0x423c07,_0x2e10d0){return client[_0x0a3f('0xb')](_0x27e03d,_0x3b5908)[_0x0a3f('0xc')](function(_0x11f609){logger['info'](_0x0a3f('0xd'),_0x46e59f,_0x0a3f('0xe'));logger[_0x0a3f('0xf')](_0x0a3f('0x10'),_0x46e59f,_0x0a3f('0xe'),JSON[_0x0a3f('0x11')](_0x11f609));if(_0x11f609[_0x0a3f('0x12')]){if(_0x11f609['error'][_0x0a3f('0x13')]===0x1f4){logger[_0x0a3f('0x12')](_0x0a3f('0xd'),_0x46e59f,_0x11f609[_0x0a3f('0x12')][_0x0a3f('0x14')]);return _0x2e10d0(_0x11f609[_0x0a3f('0x12')][_0x0a3f('0x14')]);}logger[_0x0a3f('0x12')](_0x0a3f('0xd'),_0x46e59f,_0x11f609['error'][_0x0a3f('0x14')]);return _0x423c07(_0x11f609[_0x0a3f('0x12')][_0x0a3f('0x14')]);}else{logger['info'](_0x0a3f('0xd'),_0x46e59f,_0x0a3f('0xe'));_0x423c07(_0x11f609[_0x0a3f('0x15')][_0x0a3f('0x14')]);}})[_0x0a3f('0x16')](function(_0x170487){logger[_0x0a3f('0x12')](_0x0a3f('0xd'),_0x46e59f,_0x170487);_0x2e10d0(_0x170487);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index ed7010e..d37a890 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 _0x9e79=['put','update','delete','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','run','/:id/query','post','create'];(function(_0x2495da,_0x11a291){var _0x15575c=function(_0x1cbe0c){while(--_0x1cbe0c){_0x2495da['push'](_0x2495da['shift']());}};_0x15575c(++_0x11a291);}(_0x9e79,0x114));var _0x99e7=function(_0x55b6a6,_0x1f6235){_0x55b6a6=_0x55b6a6-0x0;var _0x4d7974=_0x9e79[_0x55b6a6];return _0x4d7974;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x99e7('0x0'));var express=require(_0x99e7('0x1'));var router=express['Router']();var fs_extra=require(_0x99e7('0x2'));var auth=require(_0x99e7('0x3'));var interaction=require(_0x99e7('0x4'));var config=require(_0x99e7('0x5'));var controller=require(_0x99e7('0x6'));router['get']('/',auth[_0x99e7('0x7')](),controller[_0x99e7('0x8')]);router[_0x99e7('0x9')](_0x99e7('0xa'),auth[_0x99e7('0x7')](),controller[_0x99e7('0xb')]);router[_0x99e7('0x9')](_0x99e7('0xc'),auth[_0x99e7('0x7')](),controller[_0x99e7('0xd')]);router['get']('/:id/run',auth[_0x99e7('0x7')](),controller[_0x99e7('0xe')]);router['get'](_0x99e7('0xf'),auth[_0x99e7('0x7')](),controller['query']);router[_0x99e7('0x10')]('/',auth['isAuthenticated'](),controller[_0x99e7('0x11')]);router[_0x99e7('0x12')]('/:id',auth[_0x99e7('0x7')](),controller[_0x99e7('0x13')]);router[_0x99e7('0x14')](_0x99e7('0xa'),auth[_0x99e7('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0d47=['/:id','/:id/preview','/:id/run','/:id/query','query','create','put','delete','destroy','exports','multer','util','path','connect-timeout','get','isAuthenticated','index'];(function(_0x3e9bcb,_0x2b430f){var _0x22f215=function(_0x9b4421){while(--_0x9b4421){_0x3e9bcb['push'](_0x3e9bcb['shift']());}};_0x22f215(++_0x2b430f);}(_0x0d47,0xd6));var _0x70d4=function(_0x270294,_0x5c0cdd){_0x270294=_0x270294-0x0;var _0x198017=_0x0d47[_0x270294];return _0x198017;};'use strict';var multer=require(_0x70d4('0x0'));var util=require(_0x70d4('0x1'));var path=require(_0x70d4('0x2'));var timeout=require(_0x70d4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0x70d4('0x4')]('/',auth[_0x70d4('0x5')](),controller[_0x70d4('0x6')]);router[_0x70d4('0x4')](_0x70d4('0x7'),auth[_0x70d4('0x5')](),controller['show']);router[_0x70d4('0x4')](_0x70d4('0x8'),auth[_0x70d4('0x5')](),controller['preview']);router[_0x70d4('0x4')](_0x70d4('0x9'),auth[_0x70d4('0x5')](),controller['run']);router[_0x70d4('0x4')](_0x70d4('0xa'),auth[_0x70d4('0x5')](),controller[_0x70d4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x70d4('0xc')]);router[_0x70d4('0xd')](_0x70d4('0x7'),auth[_0x70d4('0x5')](),controller['update']);router[_0x70d4('0xe')](_0x70d4('0x7'),auth[_0x70d4('0x5')](),controller[_0x70d4('0xf')]);module[_0x70d4('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 60849ef..45c8cdd 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x71af84,_0x5f514d){var _0x1d550d=function(_0x17f9f4){while(--_0x17f9f4){_0x71af84['push'](_0x71af84['shift']());}};_0x1d550d(++_0x5f514d);}(_0xf494,0x1c6));var _0x4f49=function(_0x7a2540,_0x1454aa){_0x7a2540=_0x7a2540-0x0;var _0x3e6f43=_0xf494[_0x7a2540];return _0x3e6f43;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}}; \ No newline at end of file +var _0xae24=['sequelize','STRING'];(function(_0x12b0d0,_0x5491e8){var _0x651ce1=function(_0x2f3153){while(--_0x2f3153){_0x12b0d0['push'](_0x12b0d0['shift']());}};_0x651ce1(++_0x5491e8);}(_0xae24,0x182));var _0x4ae2=function(_0x3024a0,_0x12ef93){_0x3024a0=_0x3024a0-0x0;var _0x36eca6=_0xae24[_0x3024a0];return _0x36eca6;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index d89c941..d09c5fa 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 _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','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\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x3a80c7,_0x10ecb7){var _0x2c83df=function(_0x428e59){while(--_0x428e59){_0x3a80c7['push'](_0x3a80c7['shift']());}};_0x2c83df(++_0x10ecb7);}(_0xda19,0xd5));var _0x9da1=function(_0x2c9ea6,_0x4be9ac){_0x2c9ea6=_0x2c9ea6-0x0;var _0x4d979d=_0xda19[_0x2c9ea6];return _0x4d979d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));}; \ No newline at end of file +var _0x0295=['default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','SELECT','run','runReport','MAX(%s)','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','getFields','findAll','select','replace','output','web','%s-%s.%s','randomstring','generate','csv'];(function(_0x4136af,_0x35277b){var _0x29677d=function(_0x46014e){while(--_0x46014e){_0x4136af['push'](_0x4136af['shift']());}};_0x29677d(++_0x35277b);}(_0x0295,0x1f0));var _0x5029=function(_0x56608c,_0x29eb74){_0x56608c=_0x56608c-0x0;var _0x3c7fb0=_0x0295[_0x56608c];return _0x3c7fb0;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];var dbH=require(_0x5029('0x14'))['dbH'];function respondWithStatusCode(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xcc;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x15')](_0x49f836);}return _0x4fa22d[_0x5029('0x16')](_0x49f836)[_0x5029('0x17')]();};}function respondWithResult(_0x434630,_0x2c0b33){_0x2c0b33=_0x2c0b33||0xc8;return function(_0x11c24b){if(_0x11c24b){return _0x434630[_0x5029('0x16')](_0x2c0b33)[_0x5029('0x18')](_0x11c24b);}};}function respondWithFilteredResult(_0x10bf55,_0x326923){return function(_0x457c73){if(_0x457c73){var _0x353cba=typeof _0x326923[_0x5029('0x19')]===_0x5029('0x1a')&&typeof _0x326923[_0x5029('0x1b')]==='undefined';var _0x1ed567=_0x457c73[_0x5029('0x1c')];var _0x35de81=_0x353cba?0x0:_0x326923[_0x5029('0x19')];var _0x8cea01=_0x353cba?_0x457c73[_0x5029('0x1c')]:_0x326923[_0x5029('0x19')]+_0x326923['limit'];var _0x226a5c;if(_0x8cea01>=_0x1ed567){_0x8cea01=_0x1ed567;_0x226a5c=0xc8;}else{_0x226a5c=0xce;}_0x10bf55['status'](_0x226a5c);return _0x10bf55[_0x5029('0x1d')](_0x5029('0x1e'),_0x35de81+'-'+_0x8cea01+'/'+_0x1ed567)[_0x5029('0x18')](_0x457c73);}return null;};}function patchUpdates(_0x3cf0fb){return function(_0x4b5854){try{jsonpatch['apply'](_0x4b5854,_0x3cf0fb,!![]);}catch(_0x4c9184){return BPromise['reject'](_0x4c9184);}return _0x4b5854[_0x5029('0x1f')]();};}function saveUpdates(_0x853a34,_0x1eb228){return function(_0x2bbbcb){if(_0x2bbbcb){return _0x2bbbcb[_0x5029('0x20')](_0x853a34)[_0x5029('0x21')](function(_0x125c26){return _0x125c26;});}return null;};}function removeEntity(_0x356dac,_0x3e857d){return function(_0x4ceaae){if(_0x4ceaae){return _0x4ceaae['destroy']()['then'](function(){var _0x588d90=_0x4ceaae[_0x5029('0x22')]({'plain':!![]});var _0x51093c='DefaultReports';return db[_0x5029('0x23')][_0x5029('0x24')]({'where':{'type':_0x51093c,'resourceId':_0x588d90['id']}})[_0x5029('0x21')](function(){return _0x4ceaae;});})['then'](function(){_0x356dac[_0x5029('0x16')](0xcc)[_0x5029('0x17')]();});}};}function handleEntityNotFound(_0x5e45c4,_0x2b6d99){return function(_0x31f0a0){if(!_0x31f0a0){_0x5e45c4[_0x5029('0x15')](0x194);}return _0x31f0a0;};}function handleError(_0x4a24b9,_0x32da06){_0x32da06=_0x32da06||0x1f4;return function(_0x251f99){logger[_0x5029('0x25')](_0x251f99['stack']);if(_0x251f99[_0x5029('0x26')]){delete _0x251f99[_0x5029('0x26')];}_0x4a24b9['status'](_0x32da06)[_0x5029('0x27')](_0x251f99);};}exports[_0x5029('0x28')]=function(_0x4434ff,_0x1c3dd9){var _0x196830={},_0x2a1ed6={},_0x44255a={'count':0x0,'rows':[]};var _0x465153=_[_0x5029('0x29')](db[_0x5029('0x2a')][_0x5029('0x2b')],function(_0x4519c8){return{'name':_0x4519c8['fieldName'],'type':_0x4519c8[_0x5029('0x2c')]['key']};});_0x2a1ed6[_0x5029('0x2d')]=_['map'](_0x465153,'name');_0x2a1ed6[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x4434ff[_0x5029('0x2e')]);_0x2a1ed6['filters']=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],_0x2a1ed6[_0x5029('0x2e')]);_0x196830[_0x5029('0x31')]=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x32')]));_0x196830['attributes']=_0x196830[_0x5029('0x31')][_0x5029('0x33')]?_0x196830[_0x5029('0x31')]:_0x2a1ed6[_0x5029('0x2d')];if(!_0x4434ff['query'][_0x5029('0x34')](_0x5029('0x35'))){_0x196830[_0x5029('0x1b')]=qs['limit'](_0x4434ff['query'][_0x5029('0x1b')]);_0x196830[_0x5029('0x19')]=qs['offset'](_0x4434ff['query'][_0x5029('0x19')]);}_0x196830[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x37')]);_0x196830[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x3a')](_0x4434ff[_0x5029('0x2e')],_0x2a1ed6[_0x5029('0x39')]),_0x465153);if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3b')]){_0x196830[_0x5029('0x38')]=_[_0x5029('0x3c')](_0x196830['where'],{'$or':_['map'](_0x465153,function(_0x73797c){if(_0x73797c[_0x5029('0x2c')]!==_0x5029('0x3d')){var _0x48c9eb={};_0x48c9eb[_0x73797c[_0x5029('0x26')]]={'$like':'%'+_0x4434ff[_0x5029('0x2e')]['filter']+'%'};return _0x48c9eb;}})});}_0x196830=_[_0x5029('0x3c')]({},_0x196830,_0x4434ff['options']);var _0x506f0d={'where':_0x196830['where']};return db[_0x5029('0x2a')][_0x5029('0x1c')](_0x506f0d)[_0x5029('0x21')](function(_0x78768){_0x44255a[_0x5029('0x1c')]=_0x78768;if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3e')]){_0x196830[_0x5029('0x3f')]=[{'all':!![]}];}return db[_0x5029('0x2a')]['findAll'](_0x196830);})[_0x5029('0x21')](function(_0x236455){_0x44255a[_0x5029('0x40')]=_0x236455;return _0x44255a;})[_0x5029('0x21')](respondWithFilteredResult(_0x1c3dd9,_0x196830))[_0x5029('0x41')](handleError(_0x1c3dd9,null));};exports[_0x5029('0x42')]=function(_0x5658a7,_0x259db8){var _0xa1580a={'raw':!![],'where':{'id':_0x5658a7[_0x5029('0x43')]['id']}},_0x9434ed={};_0x9434ed[_0x5029('0x2d')]=_['keys'](db[_0x5029('0x2a')][_0x5029('0x2b')]);_0x9434ed[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x5658a7[_0x5029('0x2e')]);_0x9434ed[_0x5029('0x39')]=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],_0x9434ed[_0x5029('0x2e')]);_0xa1580a['attributes']=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x5658a7[_0x5029('0x2e')]['fields']));_0xa1580a['attributes']=_0xa1580a[_0x5029('0x31')][_0x5029('0x33')]?_0xa1580a[_0x5029('0x31')]:_0x9434ed[_0x5029('0x2d')];if(_0x5658a7[_0x5029('0x2e')][_0x5029('0x3e')]){_0xa1580a[_0x5029('0x3f')]=[{'all':!![]}];}_0xa1580a=_[_0x5029('0x3c')]({},_0xa1580a,_0x5658a7[_0x5029('0x44')]);return db[_0x5029('0x2a')][_0x5029('0x45')](_0xa1580a)[_0x5029('0x21')](handleEntityNotFound(_0x259db8,null))[_0x5029('0x21')](respondWithResult(_0x259db8,null))[_0x5029('0x41')](handleError(_0x259db8,null));};exports[_0x5029('0x46')]=function(_0x175cc0,_0x10fc07){return db[_0x5029('0x2a')][_0x5029('0x46')](_0x175cc0[_0x5029('0x47')],{})[_0x5029('0x21')](function(_0x489457){var _0x1069c4=_0x175cc0['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x1069c4)throw new Error(_0x5029('0x48'));if(_0x1069c4['role']==='user'){var _0x319bff=_0x489457['get']({'plain':!![]});var _0x4aaa43=_0x5029('0x49');return db[_0x5029('0x4a')][_0x5029('0x45')]({'where':{'name':_0x4aaa43,'userProfileId':_0x1069c4['userProfileId']},'raw':!![]})['then'](function(_0x1510bb){if(_0x1510bb&&_0x1510bb[_0x5029('0x4b')]===0x0){return db['UserProfileResource'][_0x5029('0x46')]({'name':_0x319bff['name'],'resourceId':_0x319bff['id'],'type':_0x5029('0x4c'),'sectionId':_0x1510bb['id']},{})['then'](function(){return _0x489457;});}else{return _0x489457;}})[_0x5029('0x41')](function(_0x27e1c0){logger[_0x5029('0x25')](_0x5029('0x4d'),_0x27e1c0);throw _0x27e1c0;});}return _0x489457;})[_0x5029('0x21')](respondWithResult(_0x10fc07,0xc9))[_0x5029('0x41')](handleError(_0x10fc07,null));};exports[_0x5029('0x20')]=function(_0xa25013,_0x586936){if(_0xa25013[_0x5029('0x47')]['id']){delete _0xa25013['body']['id'];}return db[_0x5029('0x2a')][_0x5029('0x45')]({'where':{'id':_0xa25013['params']['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x586936,null))['then'](saveUpdates(_0xa25013['body'],null))['then'](respondWithResult(_0x586936,null))[_0x5029('0x41')](handleError(_0x586936,null));};exports['destroy']=function(_0x49d1db,_0x353ae4){return db[_0x5029('0x2a')]['find']({'where':{'id':_0x49d1db[_0x5029('0x43')]['id']}})['then'](handleEntityNotFound(_0x353ae4,null))['then'](removeEntity(_0x353ae4,null))[_0x5029('0x41')](handleError(_0x353ae4,null));};exports[_0x5029('0x4e')]=function(_0x81e39c,_0x448273){var _0x164179=0xa;var _0x4e8d9f=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x4dca54={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4208ab={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x59a718=function(_0x560324){return!_[_0x5029('0x5e')]([_0x5029('0x5f'),_0x5029('0x60'),'IS\x20EMPTY',_0x5029('0x61')],_0x560324);};var _0x2d439a=function(_0x105638){if(!_0x105638||!_0x105638[_0x5029('0x62')][_0x5029('0x33')]){return'';}for(var _0x5264c6='(',_0x2ec5d0=0x0;_0x2ec5d0<_0x105638[_0x5029('0x62')][_0x5029('0x33')];_0x2ec5d0+=0x1){_0x2ec5d0>0x0&&(_0x5264c6+='\x20'+_0x105638['operator']+'\x20');_0x5264c6+=_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']?_0x2d439a(_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']):_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x63')]+'\x20'+_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')]+(_0x59a718(_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')])?'\x20'+_0x105638['rules'][_0x2ec5d0][_0x5029('0x65')]:'');}return _0x5264c6+')';};var _0x19220d={'where':{'id':_0x81e39c['params']['id']}},_0x1ff8df,_0x151562,_0x389700,_0x506f74,_0x13ca47;_0x19220d=_[_0x5029('0x3c')]({},_0x19220d,_0x81e39c['options']);return db[_0x5029('0x2a')]['find'](_0x19220d)[_0x5029('0x21')](function(_0x54daf9){if(_0x54daf9){_0x1ff8df=_0x54daf9;return _0x54daf9['getFields']();}return null;})[_0x5029('0x21')](function(_0x575f09){if(_0x575f09){if(!_0x575f09[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x151562=_0x575f09;return db[_0x5029('0x68')]['findAll']({'raw':!![]});}return null;})[_0x5029('0x21')](function(_0x255dfb){if(_0x255dfb){_0x389700=_[_0x5029('0x69')](_0x255dfb,'id');var _0x1cca02;var _0x1deed7=squel['select']();_0x1deed7[_0x5029('0x6a')](_0x1ff8df[_0x5029('0x6b')]);for(var _0x5890ac=0x0;_0x5890ac<_0x151562[_0x5029('0x33')];_0x5890ac+=0x1){_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6c')]?_0x389700[_0x151562[_0x5890ac][_0x5029('0x6c')]][_0x5029('0x6d')]:_0x151562[_0x5890ac][_0x5029('0x63')];_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6e')]?_['replace'](_0x4dca54[_0x151562[_0x5890ac]['function']],'%s',_0x1cca02):_0x1cca02;_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6f')]?_['replace'](_0x4208ab[_0x151562[_0x5890ac][_0x5029('0x6f')]],'%s',_0x1cca02):_0x1cca02;if(_0x151562[_0x5890ac][_0x5029('0x70')]){_0x1deed7['group'](_0x1cca02);}_0x151562[_0x5890ac][_0x5029('0x71')]&&_0x1deed7['order'](_0x1cca02,_0x151562[_0x5890ac]['orderBy']===_0x5029('0x72')?![]:!![]);_0x1deed7[_0x5029('0x63')](_0x1cca02,_0x151562[_0x5890ac][_0x5029('0x73')]||_0x1cca02);}if(_0x1ff8df[_0x5029('0x74')]){_0x1ff8df['joins']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x74')]);for(var _0x4a2ce8=0x0;_0x4a2ce8<_0x1ff8df[_0x5029('0x74')][_0x5029('0x33')];_0x4a2ce8+=0x1){if(_0x1ff8df['joins'][_0x4a2ce8]['type']&&_['includes'](_0x4e8d9f,_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x2c')])&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x77')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]){_0x1deed7[_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['type']](_0x1ff8df['joins'][_0x4a2ce8][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x1ff8df[_0x5029('0x6b')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['foreignTable'],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]));}}}if(_0x1ff8df[_0x5029('0x7a')]){_0x1ff8df['conditions']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x7a')]);_0x1deed7[_0x5029('0x38')](_0x2d439a(_0x1ff8df['conditions'][_0x5029('0x7b')]));}_0x13ca47=_0x1deed7[_0x5029('0x7c')]();_0x1deed7[_0x5029('0x1b')](_0x164179);_0x1deed7['offset'](0x0);logger[_0x5029('0x7d')](_0x5029('0x7e'),_0x1deed7['toString']());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1deed7[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')]['SELECT']});}})[_0x5029('0x21')](respondWithResult(_0x448273,null))[_0x5029('0x41')](handleError(_0x448273,null));};function runReport(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50=_0xe6ac28[_0x5029('0x26')];var _0x202c51=0xa;var _0x344203=['join',_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x3e47bd={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x4c40d1={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x41e2d8=function(_0x51098a){return!_['includes'](['IS\x20NULL',_0x5029('0x60'),_0x5029('0x84'),_0x5029('0x61')],_0x51098a);};var _0x4007c8=function(_0x3dc05a){if(!_0x3dc05a||!_0x3dc05a['rules'][_0x5029('0x33')]){return'';}for(var _0x2e4782='(',_0x2c0540=0x0;_0x2c0540<_0x3dc05a['rules']['length'];_0x2c0540+=0x1){_0x2c0540>0x0&&(_0x2e4782+='\x20'+_0x3dc05a[_0x5029('0x85')]+'\x20');_0x2e4782+=_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x7b')]?_0x4007c8(_0x3dc05a[_0x5029('0x62')][_0x2c0540]['group']):_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x63')]+'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')]+(_0x41e2d8(_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')])?'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x65')]:'');}return _0x2e4782+')';};var _0x5aecc2={'where':{'id':_0x426d70['id']}},_0x159450,_0x556c7a,_0x48bbe2,_0x3e3150,_0x533ee2;_0x5aecc2=_[_0x5029('0x3c')]({},_0x5aecc2,_0x153cdc);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x5aecc2)[_0x5029('0x21')](function(_0x1b6f4c){if(_0x1b6f4c){_0x159450=_0x1b6f4c;return _0x1b6f4c[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x1d6092){if(_0x1d6092){if(!_0x1d6092['length']){throw new db['Sequelize'][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x556c7a=_0x1d6092;return db['AnalyticMetric'][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x4b25ed){if(_0x4b25ed){_0x48bbe2=_[_0x5029('0x69')](_0x4b25ed,'id');var _0xb8da0b;var _0x13e07e=squel[_0x5029('0x88')]();_0x13e07e[_0x5029('0x6a')](_0x159450['table']);for(var _0x38c02a=0x0;_0x38c02a<_0x556c7a[_0x5029('0x33')];_0x38c02a+=0x1){_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6c')]?_0x48bbe2[_0x556c7a[_0x38c02a]['MetricId']][_0x5029('0x6d')]:_0x556c7a[_0x38c02a][_0x5029('0x63')];_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x3e47bd[_0x556c7a[_0x38c02a][_0x5029('0x6e')]],'%s',_0xb8da0b):_0xb8da0b;_0xb8da0b=_0x556c7a[_0x38c02a]['format']?_['replace'](_0x4c40d1[_0x556c7a[_0x38c02a][_0x5029('0x6f')]],'%s',_0xb8da0b):_0xb8da0b;if(_0x556c7a[_0x38c02a][_0x5029('0x70')]){_0x13e07e['group'](_0xb8da0b);}_0x556c7a[_0x38c02a][_0x5029('0x71')]&&_0x13e07e[_0x5029('0x36')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x13e07e[_0x5029('0x63')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x73')]||_0xb8da0b);}if(_0x159450[_0x5029('0x74')]){_0x159450[_0x5029('0x74')]=JSON['parse'](_0x159450['joins']);for(var _0x4243c3=0x0;_0x4243c3<_0x159450['joins'][_0x5029('0x33')];_0x4243c3+=0x1){if(_0x159450['joins'][_0x4243c3][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x344203,_0x159450[_0x5029('0x74')][_0x4243c3]['type'])&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')]&&_0x159450[_0x5029('0x74')][_0x4243c3]['foreignTable']&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]){_0x13e07e[_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x2c')]](_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x159450[_0x5029('0x6b')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]));}}}if(_0x159450[_0x5029('0x7a')]){_0x159450[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x159450['conditions']);_0x13e07e[_0x5029('0x38')](_0x4007c8(_0x159450[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x533ee2=_0x13e07e[_0x5029('0x7c')]();_0x13e07e[_0x5029('0x1b')](_0x202c51);_0x13e07e['offset'](0x0);return;}})[_0x5029('0x21')](function(){if(_0xe6ac28[_0x5029('0x8a')]===_0x5029('0x8b')){return null;}var _0xf7729c=_[_0x5029('0x3c')](_0xe6ac28,{'name':_0xe6ac28['fullPath']||_0xe6ac28[_0x5029('0x26')]||_0x159450[_0x5029('0x26')],'basename':_0x5e7f50,'savename':util[_0x5029('0x6f')](_0x5029('0x8c'),_0xe6ac28[_0x5029('0x26')]||_0x159450['name'],require(_0x5029('0x8d'))[_0x5029('0x8e')](0x4),_0xe6ac28[_0x5029('0x8a')]||_0x5029('0x8f')),'reportId':_0x159450['id'],'reportType':_0x5029('0x90')});return db[_0x5029('0x91')][_0x5029('0x46')](_0xf7729c,{'raw':!![]});})[_0x5029('0x21')](function(_0x4a7535){if(_0x159450['table']===_0x5029('0x92')){_0x533ee2[_0x5029('0x38')](_0x159450[_0x5029('0x6b')]+_0x5029('0x93'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28['endDate']);}else{_0x533ee2[_0x5029('0x38')](_0x159450['table']+_0x5029('0x95'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28[_0x5029('0x96')]);}if(_0x4a7535){logger[_0x5029('0x97')](_0x5029('0x98'),_0x533ee2[_0x5029('0x80')]());require('child_process')[_0x5029('0x99')](path[_0x5029('0x4f')](__dirname,'../../components/export/',_0x4a7535[_0x5029('0x8a')]),[_0x4a7535['id'],_0x533ee2[_0x5029('0x80')](),path['join'](__dirname,_0x5029('0x9a'),_0x4a7535['savename']),_0x5e7f50]);return _0x4a7535;}else{var _0x54c0f3=squel['select']();_0x54c0f3['from']('('+_0x533ee2[_0x5029('0x80')]()+')','countTable');_0x54c0f3[_0x5029('0x63')](_0x5029('0x9b'),'count');_0x533ee2[_0x5029('0x1b')](_0xe6ac28[_0x5029('0x1b')]||_0x202c51);_0x533ee2['offset'](_0xe6ac28[_0x5029('0x19')]||0x0);return dbH[_0x5029('0x7f')]['query'](_0x54c0f3[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')]['QueryTypes'][_0x5029('0x9c')]})[_0x5029('0x21')](function(_0x17c755){if(!_0x17c755[_0x5029('0x33')]){_0x3e3150=0x0;}else{_0x3e3150=_0x17c755[0x0][_0x5029('0x1c')]||0x0;}return dbH[_0x5029('0x7f')]['query'](_0x533ee2[_0x5029('0x80')](),{'type':dbH['sequelize'][_0x5029('0x81')][_0x5029('0x9c')]});})[_0x5029('0x21')](function(_0x3ebe00){return{'rows':_0x3ebe00||[],'count':_0x3e3150};});}});}exports[_0x5029('0x9d')]=function(_0x2138cc,_0x331af8){return runReport(_0x2138cc[_0x5029('0x43')],_0x2138cc[_0x5029('0x2e')],_0x2138cc[_0x5029('0x44')])[_0x5029('0x21')](respondWithResult(_0x331af8,null))[_0x5029('0x41')](handleError(_0x331af8,null));};exports[_0x5029('0x9e')]=runReport;exports[_0x5029('0x2e')]=function(_0x9de076,_0x2ac88e){var _0x55ee4f=0xa;var _0x1fa9eb=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x405d47={'SUM':'SUM(%s)','COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':_0x5029('0x9f'),'MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x29c3a2={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0xb39e9d=function(_0x124c5e){return!_['includes']([_0x5029('0x5f'),'IS\x20NOT\x20NULL',_0x5029('0x84'),_0x5029('0x61')],_0x124c5e);};var _0x120acc=function(_0x21bb22){if(!_0x21bb22||!_0x21bb22['rules'][_0x5029('0x33')]){return'';}for(var _0x339112='(',_0x5d7c1a=0x0;_0x5d7c1a<_0x21bb22[_0x5029('0x62')][_0x5029('0x33')];_0x5d7c1a+=0x1){_0x5d7c1a>0x0&&(_0x339112+='\x20'+_0x21bb22['operator']+'\x20');_0x339112+=_0x21bb22[_0x5029('0x62')][_0x5d7c1a][_0x5029('0x7b')]?_0x120acc(_0x21bb22['rules'][_0x5d7c1a]['group']):_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['field']+'\x20'+_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')]+(_0xb39e9d(_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')])?'\x20'+_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['value']:'');}return _0x339112+')';};var _0x327299={'where':{'id':_0x9de076['params']['id']}},_0x3463cc,_0x590cc2,_0x3ac39a,_0x37c47b,_0x62e4af;_0x327299=_[_0x5029('0x3c')]({},_0x327299,_0x9de076['options']);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x327299)[_0x5029('0x21')](function(_0x5e7ec8){if(_0x5e7ec8){_0x3463cc=_0x5e7ec8;return _0x5e7ec8[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x5aa480){if(_0x5aa480){if(!_0x5aa480[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590cc2=_0x5aa480;return db[_0x5029('0x68')][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x5842a5){if(_0x5842a5){_0x3ac39a=_['keyBy'](_0x5842a5,'id');var _0x313bdb;var _0x1d38e0=squel[_0x5029('0x88')]();_0x1d38e0['from'](_0x3463cc[_0x5029('0x6b')]);for(var _0x581237=0x0;_0x581237<_0x590cc2[_0x5029('0x33')];_0x581237+=0x1){_0x313bdb=_0x590cc2[_0x581237]['MetricId']?_0x3ac39a[_0x590cc2[_0x581237]['MetricId']]['metric']:_0x590cc2[_0x581237]['field'];_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x405d47[_0x590cc2[_0x581237][_0x5029('0x6e')]],'%s',_0x313bdb):_0x313bdb;_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6f')]?_[_0x5029('0x89')](_0x29c3a2[_0x590cc2[_0x581237]['format']],'%s',_0x313bdb):_0x313bdb;if(_0x590cc2[_0x581237][_0x5029('0x70')]){_0x1d38e0[_0x5029('0x7b')](_0x313bdb);}_0x590cc2[_0x581237][_0x5029('0x71')]&&_0x1d38e0[_0x5029('0x36')](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x1d38e0['field'](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x73')]||_0x313bdb);}if(_0x3463cc[_0x5029('0x74')]){_0x3463cc[_0x5029('0x74')]=JSON['parse'](_0x3463cc['joins']);for(var _0xd05bc9=0x0;_0xd05bc9<_0x3463cc[_0x5029('0x74')][_0x5029('0x33')];_0xd05bc9+=0x1){if(_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x1fa9eb,_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')])&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x76')]&&_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')]&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]){_0x1d38e0[_0x3463cc['joins'][_0xd05bc9][_0x5029('0x2c')]](_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x3463cc[_0x5029('0x6b')],_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x76')],_0x3463cc['joins'][_0xd05bc9]['foreignTable'],_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]));}}}if(_0x3463cc[_0x5029('0x7a')]){_0x3463cc[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x3463cc[_0x5029('0x7a')]);_0x1d38e0['where'](_0x120acc(_0x3463cc[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x62e4af=_0x1d38e0[_0x5029('0x7c')]();_0x1d38e0[_0x5029('0x1b')](_0x55ee4f);_0x1d38e0[_0x5029('0x19')](0x0);logger['debug'](_0x5029('0x7e'),_0x1d38e0[_0x5029('0x80')]());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1d38e0[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')][_0x5029('0x9c')]});}})[_0x5029('0x21')](function(){return{'sql':_0x62e4af[_0x5029('0x80')]()};})[_0x5029('0x21')](respondWithResult(_0x2ac88e,null))[_0x5029('0x41')](handleError(_0x2ac88e,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 850c35d..b9ae9b7 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 _0x2581=['lodash','util','../../config/logger','moment','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2581,0x1ad));var _0x1258=function(_0x1073e5,_0xb4ef22){_0x1073e5=_0x1073e5-0x0;var _0x27eba9=_0x2581[_0x1073e5];return _0x27eba9;};'use strict';var _=require(_0x1258('0x0'));var util=require(_0x1258('0x1'));var logger=require(_0x1258('0x2'))('api');var moment=require(_0x1258('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1258('0x4'));var rimraf=require('rimraf');var config=require(_0x1258('0x5'));var attributes=require(_0x1258('0x6'));module[_0x1258('0x7')]=function(_0x2ff83f,_0x567b5e){return _0x2ff83f[_0x1258('0x8')](_0x1258('0x9'),attributes,{'tableName':_0x1258('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe41=['path','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','../../config/logger','api','moment','bluebird'];(function(_0xae2e85,_0x235faf){var _0x5379f6=function(_0x4754c6){while(--_0x4754c6){_0xae2e85['push'](_0xae2e85['shift']());}};_0x5379f6(++_0x235faf);}(_0xfe41,0x1aa));var _0x1fe4=function(_0x2a0f1a,_0x4e7206){_0x2a0f1a=_0x2a0f1a-0x0;var _0x2721bc=_0xfe41[_0x2a0f1a];return _0x2721bc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1fe4('0x0'))(_0x1fe4('0x1'));var moment=require(_0x1fe4('0x2'));var BPromise=require(_0x1fe4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fe4('0x4'));var rimraf=require('rimraf');var config=require(_0x1fe4('0x5'));var attributes=require('./analyticDefaultReport.attributes');module[_0x1fe4('0x6')]=function(_0x58d792,_0x35fde9){return _0x58d792[_0x1fe4('0x7')](_0x1fe4('0x8'),attributes,{'tableName':_0x1fe4('0x9'),'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 f4e045f..8c15b58 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 _0x0eff=['request','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http'];(function(_0x1402c4,_0x3fd787){var _0x11053c=function(_0xbc540e){while(--_0xbc540e){_0x1402c4['push'](_0x1402c4['shift']());}};_0x11053c(++_0x3fd787);}(_0x0eff,0xbe));var _0xf0ef=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x0eff[_0x8dc04d];return _0x2f5f28;};'use strict';var _=require('lodash');var util=require(_0xf0ef('0x0'));var moment=require(_0xf0ef('0x1'));var BPromise=require('bluebird');var rs=require(_0xf0ef('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ef('0x3'))['db'];var utils=require(_0xf0ef('0x4'));var logger=require(_0xf0ef('0x5'))(_0xf0ef('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf0ef('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x21a869,_0x19d2ae,_0x3b3d56){return new BPromise(function(_0x56a7b4,_0x454594){return client[_0xf0ef('0x8')](_0x21a869,_0x3b3d56)['then'](function(_0x41b06f){logger[_0xf0ef('0x9')](_0xf0ef('0xa'),_0x19d2ae,'request\x20sent');logger[_0xf0ef('0xb')](_0xf0ef('0xc'),_0x19d2ae,_0xf0ef('0xd'),JSON['stringify'](_0x41b06f));if(_0x41b06f['error']){if(_0x41b06f[_0xf0ef('0xe')][_0xf0ef('0xf')]===0x1f4){logger[_0xf0ef('0xe')](_0xf0ef('0xa'),_0x19d2ae,_0x41b06f[_0xf0ef('0xe')]['message']);return _0x454594(_0x41b06f[_0xf0ef('0xe')][_0xf0ef('0x10')]);}logger['error'](_0xf0ef('0xa'),_0x19d2ae,_0x41b06f[_0xf0ef('0xe')][_0xf0ef('0x10')]);return _0x56a7b4(_0x41b06f[_0xf0ef('0xe')][_0xf0ef('0x10')]);}else{logger[_0xf0ef('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x19d2ae,_0xf0ef('0xd'));_0x56a7b4(_0x41b06f[_0xf0ef('0x11')]['message']);}})['catch'](function(_0x162bdb){logger[_0xf0ef('0xe')](_0xf0ef('0xa'),_0x19d2ae,_0x162bdb);_0x454594(_0x162bdb);});});} \ No newline at end of file +var _0xa3ed=['lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x22fdf0,_0x40e1f6){var _0x49387c=function(_0x3fed4d){while(--_0x3fed4d){_0x22fdf0['push'](_0x22fdf0['shift']());}};_0x49387c(++_0x40e1f6);}(_0xa3ed,0xa0));var _0xda3e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xa3ed[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xda3e('0x0'));var util=require(_0xda3e('0x1'));var moment=require(_0xda3e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda3e('0x3'));var db=require(_0xda3e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xda3e('0x5'));var config=require(_0xda3e('0x6'));var jayson=require(_0xda3e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x315c72,_0x2df3a4,_0x25aeee){return new BPromise(function(_0x50eb7f,_0x3ae171){return client[_0xda3e('0x8')](_0x315c72,_0x25aeee)[_0xda3e('0x9')](function(_0x1582b4){logger[_0xda3e('0xa')](_0xda3e('0xb'),_0x2df3a4,_0xda3e('0xc'));logger['debug'](_0xda3e('0xd'),_0x2df3a4,_0xda3e('0xc'),JSON[_0xda3e('0xe')](_0x1582b4));if(_0x1582b4[_0xda3e('0xf')]){if(_0x1582b4['error'][_0xda3e('0x10')]===0x1f4){logger['error'](_0xda3e('0xb'),_0x2df3a4,_0x1582b4[_0xda3e('0xf')]['message']);return _0x3ae171(_0x1582b4[_0xda3e('0xf')][_0xda3e('0x11')]);}logger[_0xda3e('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2df3a4,_0x1582b4[_0xda3e('0xf')][_0xda3e('0x11')]);return _0x50eb7f(_0x1582b4[_0xda3e('0xf')][_0xda3e('0x11')]);}else{logger['info'](_0xda3e('0xb'),_0x2df3a4,_0xda3e('0xc'));_0x50eb7f(_0x1582b4[_0xda3e('0x12')]['message']);}})[_0xda3e('0x13')](function(_0x29962e){logger['error'](_0xda3e('0xb'),_0x2df3a4,_0x29962e);_0x3ae171(_0x29962e);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 250991c..915b214 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 _0x9d22=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','update','delete'];(function(_0x1303b6,_0x3d7288){var _0x4a983f=function(_0x77db26){while(--_0x77db26){_0x1303b6['push'](_0x1303b6['shift']());}};_0x4a983f(++_0x3d7288);}(_0x9d22,0x192));var _0x29d2=function(_0x543a4e,_0x544f2e){_0x543a4e=_0x543a4e-0x0;var _0x27a3a9=_0x9d22[_0x543a4e];return _0x27a3a9;};'use strict';var multer=require(_0x29d2('0x0'));var util=require(_0x29d2('0x1'));var path=require(_0x29d2('0x2'));var timeout=require(_0x29d2('0x3'));var express=require(_0x29d2('0x4'));var router=express[_0x29d2('0x5')]();var fs_extra=require(_0x29d2('0x6'));var auth=require(_0x29d2('0x7'));var interaction=require(_0x29d2('0x8'));var config=require(_0x29d2('0x9'));var controller=require('./analyticDefaultReport.controller');router[_0x29d2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x29d2('0xb'),auth[_0x29d2('0xc')](),controller[_0x29d2('0xd')]);router[_0x29d2('0xa')](_0x29d2('0xe'),auth[_0x29d2('0xc')](),controller[_0x29d2('0xf')]);router['get'](_0x29d2('0x10'),auth[_0x29d2('0xc')](),controller[_0x29d2('0x11')]);router['get'](_0x29d2('0x12'),auth['isAuthenticated'](),controller[_0x29d2('0x13')]);router[_0x29d2('0x14')]('/',auth[_0x29d2('0xc')](),controller['create']);router['put'](_0x29d2('0xb'),auth[_0x29d2('0xc')](),controller[_0x29d2('0x15')]);router[_0x29d2('0x16')]('/:id',auth[_0x29d2('0xc')](),controller[_0x29d2('0x17')]);module[_0x29d2('0x18')]=router; \ No newline at end of file +var _0x20d6=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','run','query','post','create','exports'];(function(_0x322522,_0x4db288){var _0x293bcf=function(_0xf108b8){while(--_0xf108b8){_0x322522['push'](_0x322522['shift']());}};_0x293bcf(++_0x4db288);}(_0x20d6,0x140));var _0x620d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x20d6[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x620d('0x0'));var util=require(_0x620d('0x1'));var path=require('path');var timeout=require(_0x620d('0x2'));var express=require('express');var router=express[_0x620d('0x3')]();var fs_extra=require(_0x620d('0x4'));var auth=require(_0x620d('0x5'));var interaction=require(_0x620d('0x6'));var config=require(_0x620d('0x7'));var controller=require(_0x620d('0x8'));router['get']('/',auth[_0x620d('0x9')](),controller[_0x620d('0xa')]);router[_0x620d('0xb')](_0x620d('0xc'),auth[_0x620d('0x9')](),controller[_0x620d('0xd')]);router[_0x620d('0xb')](_0x620d('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0x620d('0xb')]('/:id/run',auth[_0x620d('0x9')](),controller[_0x620d('0xf')]);router[_0x620d('0xb')]('/:id/query',auth[_0x620d('0x9')](),controller[_0x620d('0x10')]);router[_0x620d('0x11')]('/',auth[_0x620d('0x9')](),controller[_0x620d('0x12')]);router['put'](_0x620d('0xc'),auth[_0x620d('0x9')](),controller['update']);router['delete'](_0x620d('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x620d('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 25de334..71f1a5e 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 _0x3f79=['STRING','ENUM','csv','pdf','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f79,0x1d1));var _0x93f7=function(_0x1a4be0,_0x5a56d6){_0x1a4be0=_0x1a4be0-0x0;var _0xcb2db7=_0x3f79[_0x1a4be0];return _0xcb2db7;};'use strict';var Sequelize=require(_0x93f7('0x0'));var moment=require(_0x93f7('0x1'));module[_0x93f7('0x2')]={'name':{'type':Sequelize[_0x93f7('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x93f7('0x4')](_0x93f7('0x5'),_0x93f7('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x93f7('0x5')},'savename':{'type':Sequelize[_0x93f7('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x93f7('0x7')]},'endDate':{'type':Sequelize[_0x93f7('0x7')]},'status':{'type':Sequelize[_0x93f7('0x3')],'defaultValue':_0x93f7('0x8')},'type':{'type':Sequelize[_0x93f7('0x4')](_0x93f7('0x9'),_0x93f7('0xa')),'allowNull':![],'defaultValue':_0x93f7('0x9')},'reportId':{'type':Sequelize[_0x93f7('0xb')](0xb)[_0x93f7('0xc')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd1a8=['pdf','xlsx','DATE','manual','UNSIGNED','sequelize','exports','STRING','ENUM','csv'];(function(_0x1849db,_0xcb8bac){var _0x139f04=function(_0x49f0bf){while(--_0x49f0bf){_0x1849db['push'](_0x1849db['shift']());}};_0x139f04(++_0xcb8bac);}(_0xd1a8,0x1b3));var _0x8d1a=function(_0x459461,_0x372ee3){_0x459461=_0x459461-0x0;var _0x20295a=_0xd1a8[_0x459461];return _0x20295a;};'use strict';var Sequelize=require(_0x8d1a('0x0'));var moment=require('moment');module[_0x8d1a('0x1')]={'name':{'type':Sequelize[_0x8d1a('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x8d1a('0x3')](_0x8d1a('0x4'),_0x8d1a('0x5'),_0x8d1a('0x6')),'allowNull':![],'defaultValue':_0x8d1a('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x8d1a('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8d1a('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x8d1a('0x3')](_0x8d1a('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x8d1a('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8d1a('0x9')]},'reportType':{'type':Sequelize[_0x8d1a('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index b472bf6..2eba6d5 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 _0x4bc8=['where','filter','merge','options','count','includeAll','AnalyticExtractedReport','rows','show','params','length','include','find','catch','create','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','output','existsSync','join','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','server/files/reports','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x4dc9dc,_0x4624e1){var _0x15d4d0=function(_0x4bd346){while(--_0x4bd346){_0x4dc9dc['push'](_0x4dc9dc['shift']());}};_0x15d4d0(++_0x4624e1);}(_0x4bc8,0x132));var _0x84bc=function(_0x6692e1,_0x49d9be){_0x6692e1=_0x6692e1-0x0;var _0x302923=_0x4bc8[_0x6692e1];return _0x302923;};'use strict';var emlformat=require(_0x84bc('0x0'));var rimraf=require(_0x84bc('0x1'));var zipdir=require(_0x84bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x84bc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x84bc('0x4'));var util=require(_0x84bc('0x5'));var path=require(_0x84bc('0x6'));var sox=require('sox');var csv=require(_0x84bc('0x7'));var ejs=require(_0x84bc('0x8'));var fs=require('fs');var fs_extra=require(_0x84bc('0x9'));var _=require(_0x84bc('0xa'));var squel=require(_0x84bc('0xb'));var crypto=require('crypto');var jsforce=require(_0x84bc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x84bc('0x7'));var querystring=require(_0x84bc('0xd'));var Papa=require(_0x84bc('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x84bc('0xf'));var as=require(_0x84bc('0x10'));var hardwareService=require(_0x84bc('0x11'));var logger=require(_0x84bc('0x12'))('api');var utils=require(_0x84bc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x84bc('0x14'));var db=require(_0x84bc('0x15'))['db'];function respondWithStatusCode(_0x143df0,_0x1cfa0d){_0x1cfa0d=_0x1cfa0d||0xcc;return function(_0x538677){if(_0x538677){return _0x143df0[_0x84bc('0x16')](_0x1cfa0d);}return _0x143df0[_0x84bc('0x17')](_0x1cfa0d)[_0x84bc('0x18')]();};}function respondWithResult(_0x4d5c49,_0x4a40c5){_0x4a40c5=_0x4a40c5||0xc8;return function(_0x3ff814){if(_0x3ff814){return _0x4d5c49[_0x84bc('0x17')](_0x4a40c5)['json'](_0x3ff814);}};}function respondWithFilteredResult(_0x57e79f,_0x29fbe1){return function(_0x1069a0){if(_0x1069a0){var _0x2d4d46=typeof _0x29fbe1['offset']===_0x84bc('0x19')&&typeof _0x29fbe1[_0x84bc('0x1a')]===_0x84bc('0x19');var _0x4afe65=_0x1069a0['count'];var _0x194d31=_0x2d4d46?0x0:_0x29fbe1['offset'];var _0x26d957=_0x2d4d46?_0x1069a0['count']:_0x29fbe1[_0x84bc('0x1b')]+_0x29fbe1[_0x84bc('0x1a')];var _0x1e7ec1;if(_0x26d957>=_0x4afe65){_0x26d957=_0x4afe65;_0x1e7ec1=0xc8;}else{_0x1e7ec1=0xce;}_0x57e79f[_0x84bc('0x17')](_0x1e7ec1);return _0x57e79f[_0x84bc('0x1c')](_0x84bc('0x1d'),_0x194d31+'-'+_0x26d957+'/'+_0x4afe65)[_0x84bc('0x1e')](_0x1069a0);}return null;};}function patchUpdates(_0x70381a){return function(_0x423da0){try{jsonpatch[_0x84bc('0x1f')](_0x423da0,_0x70381a,!![]);}catch(_0xb480ac){return BPromise[_0x84bc('0x20')](_0xb480ac);}return _0x423da0[_0x84bc('0x21')]();};}function saveUpdates(_0x32d790,_0x29ef73){return function(_0x334d31){if(_0x334d31){return _0x334d31[_0x84bc('0x22')](_0x32d790)[_0x84bc('0x23')](function(_0xe8470c){return _0xe8470c;});}return null;};}function removeEntity(_0x3ddbea,_0x176f9f){return function(_0x500c4f){if(_0x500c4f){return _0x500c4f['destroy']()['then'](function(){var _0x4b63fb=_0x500c4f[_0x84bc('0x24')]({'plain':!![]});var _0xf28d4f=_0x84bc('0x25');return db[_0x84bc('0x26')][_0x84bc('0x27')]({'where':{'type':_0xf28d4f,'resourceId':_0x4b63fb['id']}})['then'](function(){return _0x500c4f;});})['then'](function(){_0x3ddbea[_0x84bc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36e2e4,_0x2cc4c0){return function(_0x3204d2){if(!_0x3204d2){_0x36e2e4['sendStatus'](0x194);}return _0x3204d2;};}function handleError(_0x31f9b1,_0x513f1c){_0x513f1c=_0x513f1c||0x1f4;return function(_0x295bbd){logger['error'](_0x295bbd['stack']);if(_0x295bbd[_0x84bc('0x28')]){delete _0x295bbd[_0x84bc('0x28')];}_0x31f9b1[_0x84bc('0x17')](_0x513f1c)[_0x84bc('0x29')](_0x295bbd);};}exports[_0x84bc('0x2a')]=function(_0x25e21c,_0x52b61c){var _0x573c07={},_0x37eb68={},_0x49211d={'count':0x0,'rows':[]};var _0x362f34=_[_0x84bc('0x2b')](db['AnalyticExtractedReport'][_0x84bc('0x2c')],function(_0x2c1e37){return{'name':_0x2c1e37[_0x84bc('0x2d')],'type':_0x2c1e37[_0x84bc('0x2e')]['key']};});_0x37eb68[_0x84bc('0x2f')]=_[_0x84bc('0x2b')](_0x362f34,'name');_0x37eb68[_0x84bc('0x30')]=_[_0x84bc('0x31')](_0x25e21c[_0x84bc('0x30')]);_0x37eb68[_0x84bc('0x32')]=_[_0x84bc('0x33')](_0x37eb68[_0x84bc('0x2f')],_0x37eb68[_0x84bc('0x30')]);_0x573c07[_0x84bc('0x34')]=_[_0x84bc('0x33')](_0x37eb68['model'],qs[_0x84bc('0x35')](_0x25e21c[_0x84bc('0x30')][_0x84bc('0x35')]));_0x573c07[_0x84bc('0x34')]=_0x573c07[_0x84bc('0x34')]['length']?_0x573c07[_0x84bc('0x34')]:_0x37eb68[_0x84bc('0x2f')];if(!_0x25e21c['query'][_0x84bc('0x36')](_0x84bc('0x37'))){_0x573c07[_0x84bc('0x1a')]=qs['limit'](_0x25e21c[_0x84bc('0x30')][_0x84bc('0x1a')]);_0x573c07['offset']=qs[_0x84bc('0x1b')](_0x25e21c[_0x84bc('0x30')][_0x84bc('0x1b')]);}_0x573c07[_0x84bc('0x38')]=qs[_0x84bc('0x39')](_0x25e21c[_0x84bc('0x30')][_0x84bc('0x39')]);_0x573c07[_0x84bc('0x3a')]=qs[_0x84bc('0x32')](_['pick'](_0x25e21c['query'],_0x37eb68[_0x84bc('0x32')]),_0x362f34);if(_0x25e21c['query'][_0x84bc('0x3b')]){_0x573c07[_0x84bc('0x3a')]=_[_0x84bc('0x3c')](_0x573c07[_0x84bc('0x3a')],{'$or':_[_0x84bc('0x2b')](_0x362f34,function(_0x22054d){if(_0x22054d[_0x84bc('0x2e')]!=='VIRTUAL'){var _0x2eaccd={};_0x2eaccd[_0x22054d[_0x84bc('0x28')]]={'$like':'%'+_0x25e21c[_0x84bc('0x30')][_0x84bc('0x3b')]+'%'};return _0x2eaccd;}})});}_0x573c07=_[_0x84bc('0x3c')]({},_0x573c07,_0x25e21c[_0x84bc('0x3d')]);var _0x5534bb={'where':_0x573c07[_0x84bc('0x3a')]};return db['AnalyticExtractedReport'][_0x84bc('0x3e')](_0x5534bb)['then'](function(_0x164da4){_0x49211d[_0x84bc('0x3e')]=_0x164da4;if(_0x25e21c[_0x84bc('0x30')][_0x84bc('0x3f')]){_0x573c07['include']=[{'all':!![]}];}return db[_0x84bc('0x40')]['findAll'](_0x573c07);})[_0x84bc('0x23')](function(_0x49c39a){_0x49211d[_0x84bc('0x41')]=_0x49c39a;return _0x49211d;})[_0x84bc('0x23')](respondWithFilteredResult(_0x52b61c,_0x573c07))['catch'](handleError(_0x52b61c,null));};exports[_0x84bc('0x42')]=function(_0x28d0cc,_0x1f4bb2){var _0x3272ad={'raw':!![],'where':{'id':_0x28d0cc[_0x84bc('0x43')]['id']}},_0x2641aa={};_0x2641aa[_0x84bc('0x2f')]=_[_0x84bc('0x31')](db[_0x84bc('0x40')][_0x84bc('0x2c')]);_0x2641aa[_0x84bc('0x30')]=_[_0x84bc('0x31')](_0x28d0cc[_0x84bc('0x30')]);_0x2641aa[_0x84bc('0x32')]=_[_0x84bc('0x33')](_0x2641aa[_0x84bc('0x2f')],_0x2641aa[_0x84bc('0x30')]);_0x3272ad[_0x84bc('0x34')]=_[_0x84bc('0x33')](_0x2641aa[_0x84bc('0x2f')],qs[_0x84bc('0x35')](_0x28d0cc[_0x84bc('0x30')][_0x84bc('0x35')]));_0x3272ad[_0x84bc('0x34')]=_0x3272ad[_0x84bc('0x34')][_0x84bc('0x44')]?_0x3272ad[_0x84bc('0x34')]:_0x2641aa[_0x84bc('0x2f')];if(_0x28d0cc['query'][_0x84bc('0x3f')]){_0x3272ad[_0x84bc('0x45')]=[{'all':!![]}];}_0x3272ad=_[_0x84bc('0x3c')]({},_0x3272ad,_0x28d0cc[_0x84bc('0x3d')]);return db['AnalyticExtractedReport'][_0x84bc('0x46')](_0x3272ad)[_0x84bc('0x23')](handleEntityNotFound(_0x1f4bb2,null))[_0x84bc('0x23')](respondWithResult(_0x1f4bb2,null))[_0x84bc('0x47')](handleError(_0x1f4bb2,null));};exports[_0x84bc('0x48')]=function(_0x3492dc,_0x591d67){return db[_0x84bc('0x40')][_0x84bc('0x48')](_0x3492dc['body'],{})[_0x84bc('0x23')](function(_0x48c319){var _0x573971=_0x3492dc[_0x84bc('0x49')]['get']({'plain':!![]});if(!_0x573971)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x573971['role']===_0x84bc('0x49')){var _0x2ae41b=_0x48c319[_0x84bc('0x24')]({'plain':!![]});var _0x4a36b3=_0x84bc('0x25');return db[_0x84bc('0x4a')][_0x84bc('0x46')]({'where':{'name':_0x4a36b3,'userProfileId':_0x573971[_0x84bc('0x4b')]},'raw':!![]})[_0x84bc('0x23')](function(_0x1bf1c3){if(_0x1bf1c3&&_0x1bf1c3['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2ae41b['name'],'resourceId':_0x2ae41b['id'],'type':_0x1bf1c3[_0x84bc('0x28')],'sectionId':_0x1bf1c3['id']},{})[_0x84bc('0x23')](function(){return _0x48c319;});}else{return _0x48c319;}})[_0x84bc('0x47')](function(_0x313a9a){logger['error'](_0x84bc('0x4c'),_0x313a9a);throw _0x313a9a;});}return _0x48c319;})['then'](respondWithResult(_0x591d67,0xc9))[_0x84bc('0x47')](handleError(_0x591d67,null));};exports[_0x84bc('0x22')]=function(_0x5c72fb,_0x3d44d4){if(_0x5c72fb[_0x84bc('0x4d')]['id']){delete _0x5c72fb[_0x84bc('0x4d')]['id'];}return db['AnalyticExtractedReport'][_0x84bc('0x46')]({'where':{'id':_0x5c72fb[_0x84bc('0x43')]['id']}})[_0x84bc('0x23')](handleEntityNotFound(_0x3d44d4,null))['then'](saveUpdates(_0x5c72fb['body'],null))[_0x84bc('0x23')](respondWithResult(_0x3d44d4,null))[_0x84bc('0x47')](handleError(_0x3d44d4,null));};exports[_0x84bc('0x27')]=function(_0x581372,_0x444ca4){return db[_0x84bc('0x40')][_0x84bc('0x46')]({'where':{'id':_0x581372[_0x84bc('0x43')]['id']}})[_0x84bc('0x23')](handleEntityNotFound(_0x444ca4,null))[_0x84bc('0x23')](removeEntity(_0x444ca4,null))[_0x84bc('0x47')](handleError(_0x444ca4,null));};exports['download']=function(_0x58f54a,_0x290931,_0x142cc8){return db['AnalyticExtractedReport'][_0x84bc('0x46')]({'where':{'id':_0x58f54a[_0x84bc('0x43')]['id']},'attributes':[_0x84bc('0x28'),'basename','savename',_0x84bc('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x290931,null))[_0x84bc('0x23')](function(_0x38b5fd){if(_0x38b5fd){if(!fs[_0x84bc('0x4f')](path[_0x84bc('0x50')](config['root'],'server/files/reports',_0x38b5fd[_0x84bc('0x51')]))){throw new db['Sequelize'][(_0x84bc('0x52'))](_0x84bc('0x53'));}if(_0x58f54a[_0x84bc('0x30')][_0x84bc('0x54')]){return _0x290931[_0x84bc('0x16')](0xc8);}return _0x290931[_0x84bc('0x55')](path[_0x84bc('0x50')](config[_0x84bc('0x56')],_0x84bc('0x57'),_0x38b5fd['savename']),util[_0x84bc('0x58')](_0x84bc('0x59'),_0x38b5fd['basename']||_0x38b5fd[_0x84bc('0x28')],_0x38b5fd['output'][_0x84bc('0x5a')]()));}})[_0x84bc('0x47')](handleError(_0x290931,null));}; \ No newline at end of file +var _0xb033=['includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','existsSync','root','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','output','toLowerCase','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','merge','where','type','VIRTUAL','filter','options'];(function(_0x1cddea,_0x3d928c){var _0x1ee38f=function(_0x4a7032){while(--_0x4a7032){_0x1cddea['push'](_0x1cddea['shift']());}};_0x1ee38f(++_0x3d928c);}(_0xb033,0x137));var _0x3b03=function(_0x51c44a,_0x25064b){_0x51c44a=_0x51c44a-0x0;var _0x30bb5f=_0xb033[_0x51c44a];return _0x30bb5f;};'use strict';var emlformat=require(_0x3b03('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3b03('0x1'));var jsonpatch=require(_0x3b03('0x2'));var rp=require('request-promise');var moment=require(_0x3b03('0x3'));var BPromise=require(_0x3b03('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3b03('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3b03('0x6'));var fs=require('fs');var fs_extra=require(_0x3b03('0x7'));var _=require(_0x3b03('0x8'));var squel=require(_0x3b03('0x9'));var crypto=require(_0x3b03('0xa'));var jsforce=require(_0x3b03('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3b03('0xc'));var querystring=require('querystring');var Papa=require(_0x3b03('0xd'));var Redis=require(_0x3b03('0xe'));var authService=require(_0x3b03('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3b03('0x10'));var hardwareService=require(_0x3b03('0x11'));var logger=require(_0x3b03('0x12'))('api');var utils=require(_0x3b03('0x13'));var config=require(_0x3b03('0x14'));var licenseUtil=require(_0x3b03('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2040fb,_0x1fa275){_0x1fa275=_0x1fa275||0xcc;return function(_0x42dcc4){if(_0x42dcc4){return _0x2040fb[_0x3b03('0x16')](_0x1fa275);}return _0x2040fb[_0x3b03('0x17')](_0x1fa275)[_0x3b03('0x18')]();};}function respondWithResult(_0x379705,_0x37fb1f){_0x37fb1f=_0x37fb1f||0xc8;return function(_0x3f94e7){if(_0x3f94e7){return _0x379705[_0x3b03('0x17')](_0x37fb1f)['json'](_0x3f94e7);}};}function respondWithFilteredResult(_0x1ace05,_0x656369){return function(_0x9d1f47){if(_0x9d1f47){var _0x216590=typeof _0x656369[_0x3b03('0x19')]===_0x3b03('0x1a')&&typeof _0x656369['limit']==='undefined';var _0x42060c=_0x9d1f47[_0x3b03('0x1b')];var _0x34e5cf=_0x216590?0x0:_0x656369[_0x3b03('0x19')];var _0x35ceb9=_0x216590?_0x9d1f47['count']:_0x656369['offset']+_0x656369[_0x3b03('0x1c')];var _0x296991;if(_0x35ceb9>=_0x42060c){_0x35ceb9=_0x42060c;_0x296991=0xc8;}else{_0x296991=0xce;}_0x1ace05['status'](_0x296991);return _0x1ace05[_0x3b03('0x1d')](_0x3b03('0x1e'),_0x34e5cf+'-'+_0x35ceb9+'/'+_0x42060c)[_0x3b03('0x1f')](_0x9d1f47);}return null;};}function patchUpdates(_0x4e5e4c){return function(_0x307e96){try{jsonpatch['apply'](_0x307e96,_0x4e5e4c,!![]);}catch(_0x4a8036){return BPromise[_0x3b03('0x20')](_0x4a8036);}return _0x307e96[_0x3b03('0x21')]();};}function saveUpdates(_0x31b18d,_0x317ff8){return function(_0x344d37){if(_0x344d37){return _0x344d37[_0x3b03('0x22')](_0x31b18d)[_0x3b03('0x23')](function(_0xf7b5ca){return _0xf7b5ca;});}return null;};}function removeEntity(_0x41d743,_0x5856aa){return function(_0x32751f){if(_0x32751f){return _0x32751f['destroy']()['then'](function(){var _0x5af16a=_0x32751f[_0x3b03('0x24')]({'plain':!![]});var _0x33668e=_0x3b03('0x25');return db[_0x3b03('0x26')][_0x3b03('0x27')]({'where':{'type':_0x33668e,'resourceId':_0x5af16a['id']}})[_0x3b03('0x23')](function(){return _0x32751f;});})[_0x3b03('0x23')](function(){_0x41d743[_0x3b03('0x17')](0xcc)[_0x3b03('0x18')]();});}};}function handleEntityNotFound(_0x4dda7a,_0x2ca970){return function(_0x4aa496){if(!_0x4aa496){_0x4dda7a[_0x3b03('0x16')](0x194);}return _0x4aa496;};}function handleError(_0x2556f7,_0x1db7c5){_0x1db7c5=_0x1db7c5||0x1f4;return function(_0x1deee2){logger[_0x3b03('0x28')](_0x1deee2[_0x3b03('0x29')]);if(_0x1deee2['name']){delete _0x1deee2[_0x3b03('0x2a')];}_0x2556f7[_0x3b03('0x17')](_0x1db7c5)[_0x3b03('0x2b')](_0x1deee2);};}exports[_0x3b03('0x2c')]=function(_0x17189c,_0xec0be6){var _0x147897={},_0x3be911={},_0x2869a6={'count':0x0,'rows':[]};var _0x1de693=_[_0x3b03('0x2d')](db[_0x3b03('0x2e')][_0x3b03('0x2f')],function(_0x530850){return{'name':_0x530850['fieldName'],'type':_0x530850['type']['key']};});_0x3be911[_0x3b03('0x30')]=_[_0x3b03('0x2d')](_0x1de693,_0x3b03('0x2a'));_0x3be911[_0x3b03('0x31')]=_[_0x3b03('0x32')](_0x17189c[_0x3b03('0x31')]);_0x3be911['filters']=_[_0x3b03('0x33')](_0x3be911[_0x3b03('0x30')],_0x3be911[_0x3b03('0x31')]);_0x147897['attributes']=_[_0x3b03('0x33')](_0x3be911[_0x3b03('0x30')],qs[_0x3b03('0x34')](_0x17189c[_0x3b03('0x31')][_0x3b03('0x34')]));_0x147897['attributes']=_0x147897[_0x3b03('0x35')][_0x3b03('0x36')]?_0x147897[_0x3b03('0x35')]:_0x3be911[_0x3b03('0x30')];if(!_0x17189c[_0x3b03('0x31')]['hasOwnProperty'](_0x3b03('0x37'))){_0x147897[_0x3b03('0x1c')]=qs[_0x3b03('0x1c')](_0x17189c[_0x3b03('0x31')][_0x3b03('0x1c')]);_0x147897[_0x3b03('0x19')]=qs['offset'](_0x17189c[_0x3b03('0x31')][_0x3b03('0x19')]);}_0x147897[_0x3b03('0x38')]=qs[_0x3b03('0x39')](_0x17189c['query'][_0x3b03('0x39')]);_0x147897['where']=qs[_0x3b03('0x3a')](_['pick'](_0x17189c[_0x3b03('0x31')],_0x3be911['filters']),_0x1de693);if(_0x17189c['query']['filter']){_0x147897['where']=_[_0x3b03('0x3b')](_0x147897[_0x3b03('0x3c')],{'$or':_[_0x3b03('0x2d')](_0x1de693,function(_0x2aea03){if(_0x2aea03[_0x3b03('0x3d')]!==_0x3b03('0x3e')){var _0x39b0da={};_0x39b0da[_0x2aea03[_0x3b03('0x2a')]]={'$like':'%'+_0x17189c[_0x3b03('0x31')][_0x3b03('0x3f')]+'%'};return _0x39b0da;}})});}_0x147897=_[_0x3b03('0x3b')]({},_0x147897,_0x17189c[_0x3b03('0x40')]);var _0x164677={'where':_0x147897[_0x3b03('0x3c')]};return db[_0x3b03('0x2e')]['count'](_0x164677)[_0x3b03('0x23')](function(_0x35ac74){_0x2869a6[_0x3b03('0x1b')]=_0x35ac74;if(_0x17189c['query'][_0x3b03('0x41')]){_0x147897[_0x3b03('0x42')]=[{'all':!![]}];}return db[_0x3b03('0x2e')][_0x3b03('0x43')](_0x147897);})[_0x3b03('0x23')](function(_0x8eb07c){_0x2869a6[_0x3b03('0x44')]=_0x8eb07c;return _0x2869a6;})[_0x3b03('0x23')](respondWithFilteredResult(_0xec0be6,_0x147897))[_0x3b03('0x45')](handleError(_0xec0be6,null));};exports[_0x3b03('0x46')]=function(_0x5421b1,_0x18a132){var _0x65d439={'raw':!![],'where':{'id':_0x5421b1[_0x3b03('0x47')]['id']}},_0x491db6={};_0x491db6['model']=_[_0x3b03('0x32')](db[_0x3b03('0x2e')][_0x3b03('0x2f')]);_0x491db6['query']=_[_0x3b03('0x32')](_0x5421b1[_0x3b03('0x31')]);_0x491db6[_0x3b03('0x3a')]=_[_0x3b03('0x33')](_0x491db6[_0x3b03('0x30')],_0x491db6[_0x3b03('0x31')]);_0x65d439['attributes']=_[_0x3b03('0x33')](_0x491db6[_0x3b03('0x30')],qs[_0x3b03('0x34')](_0x5421b1[_0x3b03('0x31')][_0x3b03('0x34')]));_0x65d439[_0x3b03('0x35')]=_0x65d439[_0x3b03('0x35')][_0x3b03('0x36')]?_0x65d439[_0x3b03('0x35')]:_0x491db6[_0x3b03('0x30')];if(_0x5421b1[_0x3b03('0x31')][_0x3b03('0x41')]){_0x65d439['include']=[{'all':!![]}];}_0x65d439=_[_0x3b03('0x3b')]({},_0x65d439,_0x5421b1['options']);return db['AnalyticExtractedReport']['find'](_0x65d439)['then'](handleEntityNotFound(_0x18a132,null))[_0x3b03('0x23')](respondWithResult(_0x18a132,null))['catch'](handleError(_0x18a132,null));};exports[_0x3b03('0x48')]=function(_0x20e596,_0x389f63){return db['AnalyticExtractedReport'][_0x3b03('0x48')](_0x20e596[_0x3b03('0x49')],{})[_0x3b03('0x23')](function(_0x1689df){var _0x124869=_0x20e596[_0x3b03('0x4a')][_0x3b03('0x24')]({'plain':!![]});if(!_0x124869)throw new Error(_0x3b03('0x4b'));if(_0x124869[_0x3b03('0x4c')]==='user'){var _0x4ba956=_0x1689df[_0x3b03('0x24')]({'plain':!![]});var _0x5890d5='ExtractedReports';return db['UserProfileSection'][_0x3b03('0x4d')]({'where':{'name':_0x5890d5,'userProfileId':_0x124869[_0x3b03('0x4e')]},'raw':!![]})['then'](function(_0x5bef54){if(_0x5bef54&&_0x5bef54[_0x3b03('0x4f')]===0x0){return db[_0x3b03('0x26')][_0x3b03('0x48')]({'name':_0x4ba956[_0x3b03('0x2a')],'resourceId':_0x4ba956['id'],'type':_0x5bef54['name'],'sectionId':_0x5bef54['id']},{})[_0x3b03('0x23')](function(){return _0x1689df;});}else{return _0x1689df;}})[_0x3b03('0x45')](function(_0x301c7c){logger[_0x3b03('0x28')](_0x3b03('0x50'),_0x301c7c);throw _0x301c7c;});}return _0x1689df;})[_0x3b03('0x23')](respondWithResult(_0x389f63,0xc9))['catch'](handleError(_0x389f63,null));};exports[_0x3b03('0x22')]=function(_0x19fb8a,_0x3ba3a2){if(_0x19fb8a[_0x3b03('0x49')]['id']){delete _0x19fb8a[_0x3b03('0x49')]['id'];}return db[_0x3b03('0x2e')]['find']({'where':{'id':_0x19fb8a[_0x3b03('0x47')]['id']}})[_0x3b03('0x23')](handleEntityNotFound(_0x3ba3a2,null))[_0x3b03('0x23')](saveUpdates(_0x19fb8a[_0x3b03('0x49')],null))['then'](respondWithResult(_0x3ba3a2,null))[_0x3b03('0x45')](handleError(_0x3ba3a2,null));};exports[_0x3b03('0x27')]=function(_0x30495b,_0x3d7b83){return db[_0x3b03('0x2e')][_0x3b03('0x4d')]({'where':{'id':_0x30495b[_0x3b03('0x47')]['id']}})[_0x3b03('0x23')](handleEntityNotFound(_0x3d7b83,null))[_0x3b03('0x23')](removeEntity(_0x3d7b83,null))[_0x3b03('0x45')](handleError(_0x3d7b83,null));};exports[_0x3b03('0x51')]=function(_0x320323,_0x370568,_0x2ae9c8){return db[_0x3b03('0x2e')]['find']({'where':{'id':_0x320323[_0x3b03('0x47')]['id']},'attributes':['name',_0x3b03('0x52'),_0x3b03('0x53'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x370568,null))[_0x3b03('0x23')](function(_0x5a1dac){if(_0x5a1dac){if(!fs[_0x3b03('0x54')](path['join'](config[_0x3b03('0x55')],'server/files/reports',_0x5a1dac[_0x3b03('0x53')]))){throw new db['Sequelize'][(_0x3b03('0x56'))](_0x3b03('0x57'));}if(_0x320323[_0x3b03('0x31')][_0x3b03('0x58')]){return _0x370568[_0x3b03('0x16')](0xc8);}return _0x370568['download'](path[_0x3b03('0x59')](config[_0x3b03('0x55')],'server/files/reports',_0x5a1dac[_0x3b03('0x53')]),util[_0x3b03('0x5a')](_0x3b03('0x5b'),_0x5a1dac[_0x3b03('0x52')]||_0x5a1dac[_0x3b03('0x2a')],_0x5a1dac[_0x3b03('0x5c')][_0x3b03('0x5d')]()));}})[_0x3b03('0x45')](handleError(_0x370568,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 156f997..1c8663e 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 _0x1148=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x38a3d6,_0x52e305){var _0x3768d7=function(_0x1af8a9){while(--_0x1af8a9){_0x38a3d6['push'](_0x38a3d6['shift']());}};_0x3768d7(++_0x52e305);}(_0x1148,0xc2));var _0x8114=function(_0x481b7c,_0x18f807){_0x481b7c=_0x481b7c-0x0;var _0x213ae8=_0x1148[_0x481b7c];return _0x213ae8;};'use strict';var _=require(_0x8114('0x0'));var util=require(_0x8114('0x1'));var logger=require(_0x8114('0x2'))(_0x8114('0x3'));var moment=require(_0x8114('0x4'));var BPromise=require('bluebird');var rp=require(_0x8114('0x5'));var fs=require('fs');var path=require(_0x8114('0x6'));var rimraf=require(_0x8114('0x7'));var config=require(_0x8114('0x8'));var attributes=require(_0x8114('0x9'));module[_0x8114('0xa')]=function(_0x3249d5,_0x505423){return _0x3249d5[_0x8114('0xb')](_0x8114('0xc'),attributes,{'tableName':_0x8114('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab3a=['exports','define','analytics_extracted_reports','util','../../config/logger','api','moment','request-promise','path','rimraf','./analyticExtractedReport.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xab3a,0xd4));var _0xaab3=function(_0x305b12,_0x5ecd09){_0x305b12=_0x305b12-0x0;var _0x4141de=_0xab3a[_0x305b12];return _0x4141de;};'use strict';var _=require('lodash');var util=require(_0xaab3('0x0'));var logger=require(_0xaab3('0x1'))(_0xaab3('0x2'));var moment=require(_0xaab3('0x3'));var BPromise=require('bluebird');var rp=require(_0xaab3('0x4'));var fs=require('fs');var path=require(_0xaab3('0x5'));var rimraf=require(_0xaab3('0x6'));var config=require('../../config/environment');var attributes=require(_0xaab3('0x7'));module[_0xaab3('0x8')]=function(_0xd9b142,_0x396bee){return _0xd9b142[_0xaab3('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0xaab3('0xa'),'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 c84191f..312aa1d 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 _0xcd94=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4e918e,_0x2ab80f){var _0x153104=function(_0x221d45){while(--_0x221d45){_0x4e918e['push'](_0x4e918e['shift']());}};_0x153104(++_0x2ab80f);}(_0xcd94,0x1d0));var _0x4cd9=function(_0x50e0b4,_0x1057f7){_0x50e0b4=_0x50e0b4-0x0;var _0x2fa8b0=_0xcd94[_0x50e0b4];return _0x2fa8b0;};'use strict';var _=require(_0x4cd9('0x0'));var util=require(_0x4cd9('0x1'));var moment=require('moment');var BPromise=require(_0x4cd9('0x2'));var rs=require(_0x4cd9('0x3'));var fs=require('fs');var Redis=require(_0x4cd9('0x4'));var db=require(_0x4cd9('0x5'))['db'];var utils=require(_0x4cd9('0x6'));var logger=require(_0x4cd9('0x7'))('rpc');var config=require(_0x4cd9('0x8'));var jayson=require(_0x4cd9('0x9'));var client=jayson[_0x4cd9('0xa')][_0x4cd9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x373c0f,_0x33cac0,_0x4848c6){return new BPromise(function(_0x355e85,_0x311268){return client[_0x4cd9('0xc')](_0x373c0f,_0x4848c6)[_0x4cd9('0xd')](function(_0x199ab7){logger['info'](_0x4cd9('0xe'),_0x33cac0,_0x4cd9('0xf'));logger[_0x4cd9('0x10')](_0x4cd9('0x11'),_0x33cac0,_0x4cd9('0xf'),JSON[_0x4cd9('0x12')](_0x199ab7));if(_0x199ab7['error']){if(_0x199ab7[_0x4cd9('0x13')][_0x4cd9('0x14')]===0x1f4){logger[_0x4cd9('0x13')](_0x4cd9('0xe'),_0x33cac0,_0x199ab7[_0x4cd9('0x13')][_0x4cd9('0x15')]);return _0x311268(_0x199ab7[_0x4cd9('0x13')][_0x4cd9('0x15')]);}logger[_0x4cd9('0x13')](_0x4cd9('0xe'),_0x33cac0,_0x199ab7[_0x4cd9('0x13')]['message']);return _0x355e85(_0x199ab7['error']['message']);}else{logger[_0x4cd9('0x16')](_0x4cd9('0xe'),_0x33cac0,_0x4cd9('0xf'));_0x355e85(_0x199ab7[_0x4cd9('0x17')][_0x4cd9('0x15')]);}})['catch'](function(_0x4d2ae5){logger[_0x4cd9('0x13')](_0x4cd9('0xe'),_0x33cac0,_0x4d2ae5);_0x311268(_0x4d2ae5);});});} \ No newline at end of file +var _0xb171=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1b6a9f,_0x222fb1){var _0x1fe2e7=function(_0x341c28){while(--_0x341c28){_0x1b6a9f['push'](_0x1b6a9f['shift']());}};_0x1fe2e7(++_0x222fb1);}(_0xb171,0x69));var _0x1b17=function(_0x8aa324,_0x478d54){_0x8aa324=_0x8aa324-0x0;var _0xd955ba=_0xb171[_0x8aa324];return _0xd955ba;};'use strict';var _=require(_0x1b17('0x0'));var util=require(_0x1b17('0x1'));var moment=require(_0x1b17('0x2'));var BPromise=require(_0x1b17('0x3'));var rs=require(_0x1b17('0x4'));var fs=require('fs');var Redis=require(_0x1b17('0x5'));var db=require(_0x1b17('0x6'))['db'];var utils=require(_0x1b17('0x7'));var logger=require(_0x1b17('0x8'))(_0x1b17('0x9'));var config=require(_0x1b17('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1b17('0xb')][_0x1b17('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18950f,_0x9759fe,_0x37a83d){return new BPromise(function(_0x3b8599,_0x1c043e){return client[_0x1b17('0xd')](_0x18950f,_0x37a83d)[_0x1b17('0xe')](function(_0x512cb1){logger[_0x1b17('0xf')](_0x1b17('0x10'),_0x9759fe,_0x1b17('0x11'));logger[_0x1b17('0x12')](_0x1b17('0x13'),_0x9759fe,_0x1b17('0x11'),JSON[_0x1b17('0x14')](_0x512cb1));if(_0x512cb1[_0x1b17('0x15')]){if(_0x512cb1[_0x1b17('0x15')][_0x1b17('0x16')]===0x1f4){logger[_0x1b17('0x15')](_0x1b17('0x10'),_0x9759fe,_0x512cb1[_0x1b17('0x15')]['message']);return _0x1c043e(_0x512cb1['error']['message']);}logger[_0x1b17('0x15')](_0x1b17('0x10'),_0x9759fe,_0x512cb1[_0x1b17('0x15')][_0x1b17('0x17')]);return _0x3b8599(_0x512cb1[_0x1b17('0x15')][_0x1b17('0x17')]);}else{logger[_0x1b17('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x9759fe,'request\x20sent');_0x3b8599(_0x512cb1[_0x1b17('0x18')][_0x1b17('0x17')]);}})[_0x1b17('0x19')](function(_0x1acdcc){logger[_0x1b17('0x15')](_0x1b17('0x10'),_0x9759fe,_0x1acdcc);_0x1c043e(_0x1acdcc);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index ec4aca6..3d80e63 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 _0xea3e=['update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','download','post','create','put'];(function(_0x29bdcc,_0x5d1a49){var _0x1f1c67=function(_0x58b29e){while(--_0x58b29e){_0x29bdcc['push'](_0x29bdcc['shift']());}};_0x1f1c67(++_0x5d1a49);}(_0xea3e,0xa2));var _0xeea3=function(_0x121432,_0x3f39a6){_0x121432=_0x121432-0x0;var _0x11b7eb=_0xea3e[_0x121432];return _0x11b7eb;};'use strict';var multer=require('multer');var util=require(_0xeea3('0x0'));var path=require(_0xeea3('0x1'));var timeout=require(_0xeea3('0x2'));var express=require(_0xeea3('0x3'));var router=express[_0xeea3('0x4')]();var fs_extra=require(_0xeea3('0x5'));var auth=require(_0xeea3('0x6'));var interaction=require(_0xeea3('0x7'));var config=require(_0xeea3('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0xeea3('0x9')]('/',auth[_0xeea3('0xa')](),controller[_0xeea3('0xb')]);router['get'](_0xeea3('0xc'),auth['isAuthenticated'](),controller[_0xeea3('0xd')]);router[_0xeea3('0x9')]('/:id/download',auth[_0xeea3('0xa')](),controller[_0xeea3('0xe')]);router[_0xeea3('0xf')]('/',auth[_0xeea3('0xa')](),controller[_0xeea3('0x10')]);router[_0xeea3('0x11')](_0xeea3('0xc'),auth[_0xeea3('0xa')](),controller[_0xeea3('0x12')]);router[_0xeea3('0x13')](_0xeea3('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7ba9=['isAuthenticated','index','/:id','/:id/download','download','create','put','update','destroy','util','path','connect-timeout','express','fs-extra','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x299c46,_0x535de5){var _0x1f0adc=function(_0x56b91b){while(--_0x56b91b){_0x299c46['push'](_0x299c46['shift']());}};_0x1f0adc(++_0x535de5);}(_0x7ba9,0x1c3));var _0x97ba=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0x7ba9[_0x38854e];return _0x3f8415;};'use strict';var multer=require('multer');var util=require(_0x97ba('0x0'));var path=require(_0x97ba('0x1'));var timeout=require(_0x97ba('0x2'));var express=require(_0x97ba('0x3'));var router=express['Router']();var fs_extra=require(_0x97ba('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x97ba('0x5'));var controller=require(_0x97ba('0x6'));router[_0x97ba('0x7')]('/',auth[_0x97ba('0x8')](),controller[_0x97ba('0x9')]);router[_0x97ba('0x7')](_0x97ba('0xa'),auth[_0x97ba('0x8')](),controller['show']);router[_0x97ba('0x7')](_0x97ba('0xb'),auth[_0x97ba('0x8')](),controller[_0x97ba('0xc')]);router['post']('/',auth[_0x97ba('0x8')](),controller[_0x97ba('0xd')]);router[_0x97ba('0xe')](_0x97ba('0xa'),auth[_0x97ba('0x8')](),controller[_0x97ba('0xf')]);router['delete'](_0x97ba('0xa'),auth[_0x97ba('0x8')](),controller[_0x97ba('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 98fec3f..f73299f 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 _0xeb24=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x3de873,_0x174b5f){var _0x380b8c=function(_0x313dea){while(--_0x313dea){_0x3de873['push'](_0x3de873['shift']());}};_0x380b8c(++_0x174b5f);}(_0xeb24,0xb6));var _0x4eb2=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xeb24[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0x4eb2('0x0'));module[_0x4eb2('0x1')]={'field':{'type':Sequelize[_0x4eb2('0x2')]},'alias':{'type':Sequelize[_0x4eb2('0x3')]},'function':{'type':Sequelize[_0x4eb2('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x4eb2('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4eb2('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xd25c=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x40a6b5,_0x2ef12f){var _0x4bab77=function(_0x303e52){while(--_0x303e52){_0x40a6b5['push'](_0x40a6b5['shift']());}};_0x4bab77(++_0x2ef12f);}(_0xd25c,0x191));var _0xcd25=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xd25c[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0xcd25('0x0'));module[_0xcd25('0x1')]={'field':{'type':Sequelize[_0xcd25('0x2')]},'alias':{'type':Sequelize[_0xcd25('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xcd25('0x3')]},'groupBy':{'type':Sequelize[_0xcd25('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xcd25('0x3')]},'custom':{'type':Sequelize[_0xcd25('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 192a44e..81902a0 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 _0x643b=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','include','findAll','includeAll','catch','create','bulkCreate','body','find','bulkDestroy','ids','params','sequelize','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4c8779,_0x399ca4){var _0x55a207=function(_0x5323f5){while(--_0x5323f5){_0x4c8779['push'](_0x4c8779['shift']());}};_0x55a207(++_0x399ca4);}(_0x643b,0xde));var _0xb643=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x643b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb643('0x0'));var rimraf=require(_0xb643('0x1'));var zipdir=require(_0xb643('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb643('0x3'));var moment=require(_0xb643('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb643('0x5'));var util=require(_0xb643('0x6'));var path=require(_0xb643('0x7'));var sox=require(_0xb643('0x8'));var csv=require(_0xb643('0x9'));var ejs=require(_0xb643('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb643('0xb'));var squel=require(_0xb643('0xc'));var crypto=require(_0xb643('0xd'));var jsforce=require(_0xb643('0xe'));var deskjs=require(_0xb643('0xf'));var toCsv=require(_0xb643('0x9'));var querystring=require(_0xb643('0x10'));var Papa=require(_0xb643('0x11'));var Redis=require(_0xb643('0x12'));var authService=require(_0xb643('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb643('0x14'));var hardwareService=require(_0xb643('0x15'));var logger=require('../../config/logger')(_0xb643('0x16'));var utils=require(_0xb643('0x17'));var config=require(_0xb643('0x18'));var licenseUtil=require(_0xb643('0x19'));var db=require(_0xb643('0x1a'))['db'];function respondWithStatusCode(_0x5f40e1,_0x279b7e){_0x279b7e=_0x279b7e||0xcc;return function(_0x401952){if(_0x401952){return _0x5f40e1[_0xb643('0x1b')](_0x279b7e);}return _0x5f40e1['status'](_0x279b7e)['end']();};}function respondWithResult(_0x19b6c3,_0x15c6bc){_0x15c6bc=_0x15c6bc||0xc8;return function(_0x51425c){if(_0x51425c){return _0x19b6c3['status'](_0x15c6bc)[_0xb643('0x1c')](_0x51425c);}};}function respondWithFilteredResult(_0x117158,_0x1ce74c){return function(_0x4f87a6){if(_0x4f87a6){var _0x256a89=typeof _0x1ce74c[_0xb643('0x1d')]===_0xb643('0x1e')&&typeof _0x1ce74c['limit']===_0xb643('0x1e');var _0x241a3f=_0x4f87a6[_0xb643('0x1f')];var _0x3d5a3c=_0x256a89?0x0:_0x1ce74c[_0xb643('0x1d')];var _0x381d40=_0x256a89?_0x4f87a6[_0xb643('0x1f')]:_0x1ce74c['offset']+_0x1ce74c[_0xb643('0x20')];var _0x2a22c1;if(_0x381d40>=_0x241a3f){_0x381d40=_0x241a3f;_0x2a22c1=0xc8;}else{_0x2a22c1=0xce;}_0x117158[_0xb643('0x21')](_0x2a22c1);return _0x117158[_0xb643('0x22')](_0xb643('0x23'),_0x3d5a3c+'-'+_0x381d40+'/'+_0x241a3f)[_0xb643('0x1c')](_0x4f87a6);}return null;};}function patchUpdates(_0xa352a0){return function(_0x2f1a72){try{jsonpatch[_0xb643('0x24')](_0x2f1a72,_0xa352a0,!![]);}catch(_0x132d52){return BPromise[_0xb643('0x25')](_0x132d52);}return _0x2f1a72[_0xb643('0x26')]();};}function saveUpdates(_0x5487e0,_0x28975d){return function(_0x176f65){if(_0x176f65){return _0x176f65[_0xb643('0x27')](_0x5487e0)[_0xb643('0x28')](function(_0x147631){return _0x147631;});}return null;};}function removeEntity(_0x5efa9b,_0x1459bc){return function(_0x551a5a){if(_0x551a5a){return _0x551a5a[_0xb643('0x29')]()[_0xb643('0x28')](function(){_0x5efa9b[_0xb643('0x21')](0xcc)[_0xb643('0x2a')]();});}};}function handleEntityNotFound(_0xa98f05,_0x5403da){return function(_0x3aa548){if(!_0x3aa548){_0xa98f05['sendStatus'](0x194);}return _0x3aa548;};}function handleError(_0x5983f7,_0x5269ec){_0x5269ec=_0x5269ec||0x1f4;return function(_0x3bfc92){logger[_0xb643('0x2b')](_0x3bfc92['stack']);if(_0x3bfc92[_0xb643('0x2c')]){delete _0x3bfc92[_0xb643('0x2c')];}_0x5983f7[_0xb643('0x21')](_0x5269ec)[_0xb643('0x2d')](_0x3bfc92);};}exports[_0xb643('0x2e')]=function(_0x1ac834,_0x3f233a){var _0x2d4dd3={},_0x254042={},_0x1ddb1d={'count':0x0,'rows':[]};var _0x441855=_[_0xb643('0x2f')](db[_0xb643('0x30')][_0xb643('0x31')],function(_0x26e7b4){return{'name':_0x26e7b4['fieldName'],'type':_0x26e7b4[_0xb643('0x32')][_0xb643('0x33')]};});_0x254042['model']=_['map'](_0x441855,_0xb643('0x2c'));_0x254042[_0xb643('0x34')]=_[_0xb643('0x35')](_0x1ac834[_0xb643('0x34')]);_0x254042[_0xb643('0x36')]=_['intersection'](_0x254042[_0xb643('0x37')],_0x254042['query']);_0x2d4dd3[_0xb643('0x38')]=_[_0xb643('0x39')](_0x254042[_0xb643('0x37')],qs['fields'](_0x1ac834[_0xb643('0x34')][_0xb643('0x3a')]));_0x2d4dd3[_0xb643('0x38')]=_0x2d4dd3['attributes'][_0xb643('0x3b')]?_0x2d4dd3[_0xb643('0x38')]:_0x254042['model'];if(!_0x1ac834[_0xb643('0x34')]['hasOwnProperty'](_0xb643('0x3c'))){_0x2d4dd3[_0xb643('0x20')]=qs[_0xb643('0x20')](_0x1ac834[_0xb643('0x34')][_0xb643('0x20')]);_0x2d4dd3[_0xb643('0x1d')]=qs['offset'](_0x1ac834[_0xb643('0x34')][_0xb643('0x1d')]);}_0x2d4dd3[_0xb643('0x3d')]=qs[_0xb643('0x3e')](_0x1ac834[_0xb643('0x34')][_0xb643('0x3e')]);_0x2d4dd3[_0xb643('0x3f')]=qs['filters'](_[_0xb643('0x40')](_0x1ac834['query'],_0x254042[_0xb643('0x36')]),_0x441855);if(_0x1ac834['query']['filter']){_0x2d4dd3['where']=_[_0xb643('0x41')](_0x2d4dd3[_0xb643('0x3f')],{'$or':_['map'](_0x441855,function(_0x1b45ff){if(_0x1b45ff[_0xb643('0x32')]!==_0xb643('0x42')){var _0x4996ef={};_0x4996ef[_0x1b45ff[_0xb643('0x2c')]]={'$like':'%'+_0x1ac834[_0xb643('0x34')]['filter']+'%'};return _0x4996ef;}})});}_0x2d4dd3=_['merge']({},_0x2d4dd3,_0x1ac834['options']);var _0x433a43={'where':_0x2d4dd3[_0xb643('0x3f')]};return db[_0xb643('0x30')]['count'](_0x433a43)[_0xb643('0x28')](function(_0x50dc62){_0x1ddb1d['count']=_0x50dc62;if(_0x1ac834[_0xb643('0x34')]['includeAll']){_0x2d4dd3[_0xb643('0x43')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xb643('0x44')](_0x2d4dd3);})['then'](function(_0x529d36){_0x1ddb1d['rows']=_0x529d36;return _0x1ddb1d;})['then'](respondWithFilteredResult(_0x3f233a,_0x2d4dd3))['catch'](handleError(_0x3f233a,null));};exports['show']=function(_0x1e614e,_0x17d39f){var _0x5f0138={'raw':![],'where':{'id':_0x1e614e['params']['id']}},_0x51e2a8={};_0x51e2a8[_0xb643('0x37')]=_['keys'](db[_0xb643('0x30')]['rawAttributes']);_0x51e2a8[_0xb643('0x34')]=_[_0xb643('0x35')](_0x1e614e['query']);_0x51e2a8[_0xb643('0x36')]=_[_0xb643('0x39')](_0x51e2a8[_0xb643('0x37')],_0x51e2a8['query']);_0x5f0138[_0xb643('0x38')]=_['intersection'](_0x51e2a8[_0xb643('0x37')],qs[_0xb643('0x3a')](_0x1e614e[_0xb643('0x34')][_0xb643('0x3a')]));_0x5f0138[_0xb643('0x38')]=_0x5f0138['attributes'][_0xb643('0x3b')]?_0x5f0138[_0xb643('0x38')]:_0x51e2a8[_0xb643('0x37')];if(_0x1e614e[_0xb643('0x34')][_0xb643('0x45')]){_0x5f0138[_0xb643('0x43')]=[{'all':!![]}];}_0x5f0138=_[_0xb643('0x41')]({},_0x5f0138,_0x1e614e['options']);return db[_0xb643('0x30')]['find'](_0x5f0138)['then'](handleEntityNotFound(_0x17d39f,null))[_0xb643('0x28')](respondWithResult(_0x17d39f,null))[_0xb643('0x46')](handleError(_0x17d39f,null));};exports[_0xb643('0x47')]=function(_0x2197d6,_0x5b56ab){return db['AnalyticFieldReport'][_0xb643('0x47')](_0x2197d6['body'],{})['then'](respondWithResult(_0x5b56ab,0xc9))[_0xb643('0x46')](handleError(_0x5b56ab,null));};exports['bulkCreate']=function(_0x166a93,_0x378732){return db[_0xb643('0x30')][_0xb643('0x48')](_0x166a93[_0xb643('0x49')],{'raw':![],'individualHooks':!![]})[_0xb643('0x28')](respondWithResult(_0x378732,0xc9))[_0xb643('0x46')](handleError(_0x378732,null));};exports['update']=function(_0xd5b4f2,_0x345759){if(_0xd5b4f2[_0xb643('0x49')]['id']){delete _0xd5b4f2[_0xb643('0x49')]['id'];}return db[_0xb643('0x30')][_0xb643('0x4a')]({'where':{'id':_0xd5b4f2['params']['id']}})[_0xb643('0x28')](handleEntityNotFound(_0x345759,null))[_0xb643('0x28')](saveUpdates(_0xd5b4f2['body'],null))[_0xb643('0x28')](respondWithResult(_0x345759,null))['catch'](handleError(_0x345759,null));};exports[_0xb643('0x29')]=function(_0x5ab5bd,_0xe8987){return db[_0xb643('0x30')][_0xb643('0x4a')]({'where':{'id':_0x5ab5bd['params']['id']}})[_0xb643('0x28')](handleEntityNotFound(_0xe8987,null))[_0xb643('0x28')](removeEntity(_0xe8987,null))[_0xb643('0x46')](handleError(_0xe8987,null));};exports[_0xb643('0x4b')]=function(_0x403af2,_0x26b052){return db[_0xb643('0x30')]['destroy']({'where':{'id':_0x403af2[_0xb643('0x34')][_0xb643('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xb643('0x28')](respondWithResult(_0x26b052,0xcc))[_0xb643('0x46')](handleError(_0x26b052,null));};exports['addFields']=function(_0x25efde,_0x23e4e6,_0x57eea2){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x25efde[_0xb643('0x4d')]['id']}})['then'](handleEntityNotFound(_0x23e4e6,null))[_0xb643('0x28')](function(_0x554147){if(_0x554147){return db[_0xb643('0x4e')]['transaction'](function(_0x33b039){return db[_0xb643('0x30')][_0xb643('0x29')]({'where':{'CustomReportId':_0x25efde[_0xb643('0x4d')]['id']},'transaction':_0x33b039})[_0xb643('0x28')](function(_0x43021a){var _0x56785b=_[_0xb643('0x2f')](_0x25efde[_0xb643('0x49')],function(_0x2d9937){delete _0x2d9937['id'];_0x2d9937[_0xb643('0x4f')]=_0x25efde[_0xb643('0x4d')]['id'];return _0x2d9937;});return db[_0xb643('0x30')][_0xb643('0x48')](_0x56785b,{'transaction':_0x33b039});});})[_0xb643('0x28')](function(){return db[_0xb643('0x30')]['findAll']({'where':{'CustomReportId':_0x25efde[_0xb643('0x4d')]['id']}});});}})['then'](respondWithResult(_0x23e4e6,null))['catch'](handleError(_0x23e4e6,null));}; \ No newline at end of file +var _0xc086=['error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','find','create','bulkCreate','body','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','destroy','CustomReportId','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xc086,0x7f));var _0x6c08=function(_0x1c1ee7,_0x5a3408){_0x1c1ee7=_0x1c1ee7-0x0;var _0x332335=_0xc086[_0x1c1ee7];return _0x332335;};'use strict';var emlformat=require(_0x6c08('0x0'));var rimraf=require(_0x6c08('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c08('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6c08('0x3'));var Mustache=require('mustache');var util=require(_0x6c08('0x4'));var path=require(_0x6c08('0x5'));var sox=require(_0x6c08('0x6'));var csv=require(_0x6c08('0x7'));var ejs=require(_0x6c08('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c08('0x9'));var squel=require('squel');var crypto=require(_0x6c08('0xa'));var jsforce=require(_0x6c08('0xb'));var deskjs=require(_0x6c08('0xc'));var toCsv=require(_0x6c08('0x7'));var querystring=require(_0x6c08('0xd'));var Papa=require('papaparse');var Redis=require(_0x6c08('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6c08('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c08('0x10'));var logger=require(_0x6c08('0x11'))(_0x6c08('0x12'));var utils=require(_0x6c08('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6c08('0x14'));var db=require(_0x6c08('0x15'))['db'];function respondWithStatusCode(_0x469a4c,_0xc022fc){_0xc022fc=_0xc022fc||0xcc;return function(_0x1433f9){if(_0x1433f9){return _0x469a4c[_0x6c08('0x16')](_0xc022fc);}return _0x469a4c['status'](_0xc022fc)[_0x6c08('0x17')]();};}function respondWithResult(_0x562f37,_0x11de08){_0x11de08=_0x11de08||0xc8;return function(_0xeb104d){if(_0xeb104d){return _0x562f37[_0x6c08('0x18')](_0x11de08)['json'](_0xeb104d);}};}function respondWithFilteredResult(_0x58e1f7,_0x599178){return function(_0x225761){if(_0x225761){var _0x3bab82=typeof _0x599178['offset']===_0x6c08('0x19')&&typeof _0x599178[_0x6c08('0x1a')]===_0x6c08('0x19');var _0x348f2e=_0x225761[_0x6c08('0x1b')];var _0x37aaed=_0x3bab82?0x0:_0x599178[_0x6c08('0x1c')];var _0x2f63bc=_0x3bab82?_0x225761[_0x6c08('0x1b')]:_0x599178[_0x6c08('0x1c')]+_0x599178[_0x6c08('0x1a')];var _0x521e1c;if(_0x2f63bc>=_0x348f2e){_0x2f63bc=_0x348f2e;_0x521e1c=0xc8;}else{_0x521e1c=0xce;}_0x58e1f7[_0x6c08('0x18')](_0x521e1c);return _0x58e1f7[_0x6c08('0x1d')](_0x6c08('0x1e'),_0x37aaed+'-'+_0x2f63bc+'/'+_0x348f2e)[_0x6c08('0x1f')](_0x225761);}return null;};}function patchUpdates(_0xe969d){return function(_0x2d9d65){try{jsonpatch[_0x6c08('0x20')](_0x2d9d65,_0xe969d,!![]);}catch(_0x4ded63){return BPromise[_0x6c08('0x21')](_0x4ded63);}return _0x2d9d65[_0x6c08('0x22')]();};}function saveUpdates(_0x4230c0,_0x55b2d3){return function(_0x5356ad){if(_0x5356ad){return _0x5356ad[_0x6c08('0x23')](_0x4230c0)[_0x6c08('0x24')](function(_0x2eb0cd){return _0x2eb0cd;});}return null;};}function removeEntity(_0x1caccf,_0x16c488){return function(_0x205382){if(_0x205382){return _0x205382['destroy']()[_0x6c08('0x24')](function(){_0x1caccf[_0x6c08('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cddc8,_0x363e0){return function(_0x506a8){if(!_0x506a8){_0x1cddc8[_0x6c08('0x16')](0x194);}return _0x506a8;};}function handleError(_0x38dea7,_0x45b7d7){_0x45b7d7=_0x45b7d7||0x1f4;return function(_0x17e21f){logger[_0x6c08('0x25')](_0x17e21f[_0x6c08('0x26')]);if(_0x17e21f[_0x6c08('0x27')]){delete _0x17e21f[_0x6c08('0x27')];}_0x38dea7[_0x6c08('0x18')](_0x45b7d7)['send'](_0x17e21f);};}exports[_0x6c08('0x28')]=function(_0x37e534,_0x19011f){var _0x3c935f={},_0x3401a2={},_0x4f56f9={'count':0x0,'rows':[]};var _0x402e57=_[_0x6c08('0x29')](db[_0x6c08('0x2a')][_0x6c08('0x2b')],function(_0xf53222){return{'name':_0xf53222[_0x6c08('0x2c')],'type':_0xf53222[_0x6c08('0x2d')]['key']};});_0x3401a2[_0x6c08('0x2e')]=_[_0x6c08('0x29')](_0x402e57,_0x6c08('0x27'));_0x3401a2[_0x6c08('0x2f')]=_['keys'](_0x37e534['query']);_0x3401a2[_0x6c08('0x30')]=_[_0x6c08('0x31')](_0x3401a2['model'],_0x3401a2[_0x6c08('0x2f')]);_0x3c935f[_0x6c08('0x32')]=_['intersection'](_0x3401a2['model'],qs[_0x6c08('0x33')](_0x37e534[_0x6c08('0x2f')]['fields']));_0x3c935f['attributes']=_0x3c935f['attributes'][_0x6c08('0x34')]?_0x3c935f['attributes']:_0x3401a2[_0x6c08('0x2e')];if(!_0x37e534[_0x6c08('0x2f')][_0x6c08('0x35')]('nolimit')){_0x3c935f['limit']=qs[_0x6c08('0x1a')](_0x37e534[_0x6c08('0x2f')][_0x6c08('0x1a')]);_0x3c935f[_0x6c08('0x1c')]=qs['offset'](_0x37e534['query'][_0x6c08('0x1c')]);}_0x3c935f[_0x6c08('0x36')]=qs[_0x6c08('0x37')](_0x37e534['query']['sort']);_0x3c935f[_0x6c08('0x38')]=qs['filters'](_[_0x6c08('0x39')](_0x37e534[_0x6c08('0x2f')],_0x3401a2['filters']),_0x402e57);if(_0x37e534[_0x6c08('0x2f')]['filter']){_0x3c935f[_0x6c08('0x38')]=_[_0x6c08('0x3a')](_0x3c935f[_0x6c08('0x38')],{'$or':_[_0x6c08('0x29')](_0x402e57,function(_0x25a14c){if(_0x25a14c['type']!==_0x6c08('0x3b')){var _0x244e8f={};_0x244e8f[_0x25a14c[_0x6c08('0x27')]]={'$like':'%'+_0x37e534[_0x6c08('0x2f')][_0x6c08('0x3c')]+'%'};return _0x244e8f;}})});}_0x3c935f=_[_0x6c08('0x3a')]({},_0x3c935f,_0x37e534[_0x6c08('0x3d')]);var _0x5d58f6={'where':_0x3c935f[_0x6c08('0x38')]};return db[_0x6c08('0x2a')][_0x6c08('0x1b')](_0x5d58f6)[_0x6c08('0x24')](function(_0x5f19c8){_0x4f56f9[_0x6c08('0x1b')]=_0x5f19c8;if(_0x37e534[_0x6c08('0x2f')][_0x6c08('0x3e')]){_0x3c935f[_0x6c08('0x3f')]=[{'all':!![]}];}return db[_0x6c08('0x2a')][_0x6c08('0x40')](_0x3c935f);})[_0x6c08('0x24')](function(_0x5e8a55){_0x4f56f9[_0x6c08('0x41')]=_0x5e8a55;return _0x4f56f9;})[_0x6c08('0x24')](respondWithFilteredResult(_0x19011f,_0x3c935f))[_0x6c08('0x42')](handleError(_0x19011f,null));};exports[_0x6c08('0x43')]=function(_0x641514,_0x59ad6a){var _0x54eccc={'raw':![],'where':{'id':_0x641514['params']['id']}},_0x2f0cdd={};_0x2f0cdd[_0x6c08('0x2e')]=_['keys'](db['AnalyticFieldReport'][_0x6c08('0x2b')]);_0x2f0cdd[_0x6c08('0x2f')]=_[_0x6c08('0x44')](_0x641514['query']);_0x2f0cdd['filters']=_[_0x6c08('0x31')](_0x2f0cdd[_0x6c08('0x2e')],_0x2f0cdd[_0x6c08('0x2f')]);_0x54eccc[_0x6c08('0x32')]=_[_0x6c08('0x31')](_0x2f0cdd[_0x6c08('0x2e')],qs[_0x6c08('0x33')](_0x641514['query']['fields']));_0x54eccc['attributes']=_0x54eccc[_0x6c08('0x32')][_0x6c08('0x34')]?_0x54eccc[_0x6c08('0x32')]:_0x2f0cdd['model'];if(_0x641514['query']['includeAll']){_0x54eccc[_0x6c08('0x3f')]=[{'all':!![]}];}_0x54eccc=_['merge']({},_0x54eccc,_0x641514[_0x6c08('0x3d')]);return db[_0x6c08('0x2a')][_0x6c08('0x45')](_0x54eccc)['then'](handleEntityNotFound(_0x59ad6a,null))[_0x6c08('0x24')](respondWithResult(_0x59ad6a,null))[_0x6c08('0x42')](handleError(_0x59ad6a,null));};exports[_0x6c08('0x46')]=function(_0x46860c,_0x2001d2){return db['AnalyticFieldReport'][_0x6c08('0x46')](_0x46860c['body'],{})[_0x6c08('0x24')](respondWithResult(_0x2001d2,0xc9))[_0x6c08('0x42')](handleError(_0x2001d2,null));};exports[_0x6c08('0x47')]=function(_0xd50c06,_0x89e345){return db[_0x6c08('0x2a')][_0x6c08('0x47')](_0xd50c06[_0x6c08('0x48')],{'raw':![],'individualHooks':!![]})[_0x6c08('0x24')](respondWithResult(_0x89e345,0xc9))[_0x6c08('0x42')](handleError(_0x89e345,null));};exports[_0x6c08('0x23')]=function(_0x16599e,_0x184fa6){if(_0x16599e[_0x6c08('0x48')]['id']){delete _0x16599e[_0x6c08('0x48')]['id'];}return db[_0x6c08('0x2a')][_0x6c08('0x45')]({'where':{'id':_0x16599e['params']['id']}})[_0x6c08('0x24')](handleEntityNotFound(_0x184fa6,null))['then'](saveUpdates(_0x16599e[_0x6c08('0x48')],null))[_0x6c08('0x24')](respondWithResult(_0x184fa6,null))['catch'](handleError(_0x184fa6,null));};exports['destroy']=function(_0x38e2b8,_0x1765a4){return db['AnalyticFieldReport'][_0x6c08('0x45')]({'where':{'id':_0x38e2b8[_0x6c08('0x49')]['id']}})[_0x6c08('0x24')](handleEntityNotFound(_0x1765a4,null))[_0x6c08('0x24')](removeEntity(_0x1765a4,null))['catch'](handleError(_0x1765a4,null));};exports[_0x6c08('0x4a')]=function(_0x3caee5,_0x1d4a8d){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x3caee5[_0x6c08('0x2f')][_0x6c08('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1d4a8d,0xcc))[_0x6c08('0x42')](handleError(_0x1d4a8d,null));};exports[_0x6c08('0x4c')]=function(_0x2c5459,_0x5fc95e,_0x171ad4){return db[_0x6c08('0x4d')][_0x6c08('0x4e')]({'where':{'id':_0x2c5459['params']['id']}})['then'](handleEntityNotFound(_0x5fc95e,null))[_0x6c08('0x24')](function(_0xf9eff6){if(_0xf9eff6){return db['sequelize'][_0x6c08('0x4f')](function(_0x248087){return db[_0x6c08('0x2a')][_0x6c08('0x50')]({'where':{'CustomReportId':_0x2c5459[_0x6c08('0x49')]['id']},'transaction':_0x248087})[_0x6c08('0x24')](function(_0x507a8a){var _0xd72446=_[_0x6c08('0x29')](_0x2c5459[_0x6c08('0x48')],function(_0x5d2fb3){delete _0x5d2fb3['id'];_0x5d2fb3[_0x6c08('0x51')]=_0x2c5459['params']['id'];return _0x5d2fb3;});return db[_0x6c08('0x2a')][_0x6c08('0x47')](_0xd72446,{'transaction':_0x248087});});})[_0x6c08('0x24')](function(){return db[_0x6c08('0x2a')][_0x6c08('0x40')]({'where':{'CustomReportId':_0x2c5459[_0x6c08('0x49')]['id']}});});}})[_0x6c08('0x24')](respondWithResult(_0x5fc95e,null))[_0x6c08('0x42')](handleError(_0x5fc95e,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index dd2d518..fef4949 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 _0xd6e7=['analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticFieldReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6e7,0x83));var _0x7d6e=function(_0x3a86a7,_0x12ade0){_0x3a86a7=_0x3a86a7-0x0;var _0x19b1b6=_0xd6e7[_0x3a86a7];return _0x19b1b6;};'use strict';var _=require(_0x7d6e('0x0'));var util=require(_0x7d6e('0x1'));var logger=require(_0x7d6e('0x2'))(_0x7d6e('0x3'));var moment=require(_0x7d6e('0x4'));var BPromise=require(_0x7d6e('0x5'));var rp=require(_0x7d6e('0x6'));var fs=require('fs');var path=require(_0x7d6e('0x7'));var rimraf=require(_0x7d6e('0x8'));var config=require(_0x7d6e('0x9'));var attributes=require('./analyticFieldReport.attributes');module[_0x7d6e('0xa')]=function(_0x1e6bc2,_0xfa76a6){return _0x1e6bc2['define'](_0x7d6e('0xb'),attributes,{'tableName':_0x7d6e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f06=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','analytics_report_fields','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f06,0xad));var _0x67f0=function(_0xe6e539,_0xa2b4f2){_0xe6e539=_0xe6e539-0x0;var _0x19deac=_0x7f06[_0xe6e539];return _0x19deac;};'use strict';var _=require(_0x67f0('0x0'));var util=require(_0x67f0('0x1'));var logger=require('../../config/logger')(_0x67f0('0x2'));var moment=require(_0x67f0('0x3'));var BPromise=require(_0x67f0('0x4'));var rp=require(_0x67f0('0x5'));var fs=require('fs');var path=require(_0x67f0('0x6'));var rimraf=require(_0x67f0('0x7'));var config=require(_0x67f0('0x8'));var attributes=require(_0x67f0('0x9'));module[_0x67f0('0xa')]=function(_0xf18cfb,_0xa79e32){return _0xf18cfb['define']('AnalyticFieldReport',attributes,{'tableName':_0x67f0('0xb'),'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 80ef4f6..28e432e 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 _0x9eb7=['AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x1fc1f9,_0x454fb2){var _0x4987ca=function(_0x5e90dd){while(--_0x5e90dd){_0x1fc1f9['push'](_0x1fc1f9['shift']());}};_0x4987ca(++_0x454fb2);}(_0x9eb7,0x16d));var _0x79eb=function(_0x2ce00a,_0x4e6f89){_0x2ce00a=_0x2ce00a-0x0;var _0x17e5c1=_0x9eb7[_0x2ce00a];return _0x17e5c1;};'use strict';var _=require(_0x79eb('0x0'));var util=require(_0x79eb('0x1'));var moment=require(_0x79eb('0x2'));var BPromise=require('bluebird');var rs=require(_0x79eb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79eb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x79eb('0x5'))(_0x79eb('0x6'));var config=require(_0x79eb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x79eb('0x8')][_0x79eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x113b6b,_0x35fe4c,_0x31f634){return new BPromise(function(_0x13ed2f,_0x3ec3bf){return client[_0x79eb('0xa')](_0x113b6b,_0x31f634)[_0x79eb('0xb')](function(_0x3ff9c5){logger[_0x79eb('0xc')](_0x79eb('0xd'),_0x35fe4c,_0x79eb('0xe'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x35fe4c,_0x79eb('0xe'),JSON[_0x79eb('0xf')](_0x3ff9c5));if(_0x3ff9c5[_0x79eb('0x10')]){if(_0x3ff9c5[_0x79eb('0x10')][_0x79eb('0x11')]===0x1f4){logger['error'](_0x79eb('0xd'),_0x35fe4c,_0x3ff9c5[_0x79eb('0x10')][_0x79eb('0x12')]);return _0x3ec3bf(_0x3ff9c5['error'][_0x79eb('0x12')]);}logger[_0x79eb('0x10')](_0x79eb('0xd'),_0x35fe4c,_0x3ff9c5[_0x79eb('0x10')][_0x79eb('0x12')]);return _0x13ed2f(_0x3ff9c5['error'][_0x79eb('0x12')]);}else{logger[_0x79eb('0xc')](_0x79eb('0xd'),_0x35fe4c,'request\x20sent');_0x13ed2f(_0x3ff9c5[_0x79eb('0x13')][_0x79eb('0x12')]);}})[_0x79eb('0x14')](function(_0x2cb9bb){logger['error'](_0x79eb('0xd'),_0x35fe4c,_0x2cb9bb);_0x3ec3bf(_0x2cb9bb);});});} \ No newline at end of file +var _0x70e0=['../../config/logger','../../config/environment','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils'];(function(_0x469b7d,_0x4760f8){var _0xc78a4b=function(_0xd48e6c){while(--_0xd48e6c){_0x469b7d['push'](_0x469b7d['shift']());}};_0xc78a4b(++_0x4760f8);}(_0x70e0,0xe5));var _0x070e=function(_0x3daa4d,_0x22ae94){_0x3daa4d=_0x3daa4d-0x0;var _0x15117d=_0x70e0[_0x3daa4d];return _0x15117d;};'use strict';var _=require(_0x070e('0x0'));var util=require('util');var moment=require(_0x070e('0x1'));var BPromise=require(_0x070e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x070e('0x4'));var logger=require(_0x070e('0x5'))('rpc');var config=require(_0x070e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x7')][_0x070e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f6c29,_0x4d99a9,_0x32582e){return new BPromise(function(_0x39ae78,_0x5532c4){return client[_0x070e('0x9')](_0x4f6c29,_0x32582e)['then'](function(_0x79b211){logger[_0x070e('0xa')](_0x070e('0xb'),_0x4d99a9,_0x070e('0xc'));logger[_0x070e('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4d99a9,_0x070e('0xc'),JSON['stringify'](_0x79b211));if(_0x79b211[_0x070e('0xe')]){if(_0x79b211[_0x070e('0xe')][_0x070e('0xf')]===0x1f4){logger[_0x070e('0xe')](_0x070e('0xb'),_0x4d99a9,_0x79b211['error'][_0x070e('0x10')]);return _0x5532c4(_0x79b211[_0x070e('0xe')][_0x070e('0x10')]);}logger[_0x070e('0xe')](_0x070e('0xb'),_0x4d99a9,_0x79b211['error'][_0x070e('0x10')]);return _0x39ae78(_0x79b211[_0x070e('0xe')][_0x070e('0x10')]);}else{logger[_0x070e('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4d99a9,_0x070e('0xc'));_0x39ae78(_0x79b211['result']['message']);}})[_0x070e('0x11')](function(_0x307a97){logger[_0x070e('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4d99a9,_0x307a97);_0x5532c4(_0x307a97);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index be858db..9b600b2 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(_0x23c95b,_0x4cbf5c){var _0x56f481=function(_0xf047f2){while(--_0xf047f2){_0x23c95b['push'](_0x23c95b['shift']());}};_0x56f481(++_0x4cbf5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x6ba2ac,_0x3f505b){var _0x212fa0=function(_0x1a76e1){while(--_0x1a76e1){_0x6ba2ac['push'](_0x6ba2ac['shift']());}};_0x212fa0(++_0x3f505b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 9180e7b..8c96b9a 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 _0xf972=['sequelize','STRING','name'];(function(_0x2d1053,_0x3608eb){var _0x431161=function(_0x1809da){while(--_0x1809da){_0x2d1053['push'](_0x2d1053['shift']());}};_0x431161(++_0x3608eb);}(_0xf972,0x171));var _0x2f97=function(_0x3ab44e,_0x55c364){_0x3ab44e=_0x3ab44e-0x0;var _0x39a17d=_0xf972[_0x3ab44e];return _0x39a17d;};'use strict';var Sequelize=require(_0x2f97('0x0'));module['exports']={'name':{'type':Sequelize[_0x2f97('0x1')],'allowNull':![],'unique':_0x2f97('0x2')},'table':{'type':Sequelize[_0x2f97('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x2f97('0x1')]}}; \ No newline at end of file +var _0xab3a=['name','TEXT','sequelize','exports','STRING'];(function(_0xd03adb,_0x441f64){var _0x202bb3=function(_0x4a10f3){while(--_0x4a10f3){_0xd03adb['push'](_0xd03adb['shift']());}};_0x202bb3(++_0x441f64);}(_0xab3a,0x1d3));var _0xaab3=function(_0x353313,_0x5c3686){_0x353313=_0x353313-0x0;var _0x4cb750=_0xab3a[_0x353313];return _0x4cb750;};'use strict';var Sequelize=require(_0xaab3('0x0'));module[_0xaab3('0x1')]={'name':{'type':Sequelize[_0xaab3('0x2')],'allowNull':![],'unique':_0xaab3('0x3')},'table':{'type':Sequelize[_0xaab3('0x2')]},'metric':{'type':Sequelize[_0xaab3('0x4')]},'description':{'type':Sequelize[_0xaab3('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index af8ea5a..34d272a 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 _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0xa97151,_0x543980){var _0x12691a=function(_0x4958dc){while(--_0x4958dc){_0xa97151['push'](_0xa97151['shift']());}};_0x12691a(++_0x543980);}(_0xe14b,0x93));var _0xbe14=function(_0x73ae2e,_0x337c21){_0x73ae2e=_0x73ae2e-0x0;var _0xfafde9=_0xe14b[_0x73ae2e];return _0xfafde9;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));}; \ No newline at end of file +var _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x5b109d,_0x597212){var _0x54b0af=function(_0x80da62){while(--_0x80da62){_0x5b109d['push'](_0x5b109d['shift']());}};_0x54b0af(++_0x597212);}(_0xe14b,0x93));var _0xbe14=function(_0x3006a6,_0x46e382){_0x3006a6=_0x3006a6-0x0;var _0x1f63f8=_0xe14b[_0x3006a6];return _0x1f63f8;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 14783ab..144f9e9 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 _0x21cd=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','AnalyticMetric','lodash','util'];(function(_0x5ad07c,_0x324dcd){var _0x204bae=function(_0x1245bc){while(--_0x1245bc){_0x5ad07c['push'](_0x5ad07c['shift']());}};_0x204bae(++_0x324dcd);}(_0x21cd,0x6a));var _0xd21c=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x21cd[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xd21c('0x0'));var util=require(_0xd21c('0x1'));var logger=require(_0xd21c('0x2'))(_0xd21c('0x3'));var moment=require(_0xd21c('0x4'));var BPromise=require(_0xd21c('0x5'));var rp=require(_0xd21c('0x6'));var fs=require('fs');var path=require(_0xd21c('0x7'));var rimraf=require(_0xd21c('0x8'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0xd21c('0x9')]=function(_0x1ff4bd,_0x1ce1e6){return _0x1ff4bd[_0xd21c('0xa')](_0xd21c('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x102b=['AnalyticMetric','analytics_metrics','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','define'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x102b,0x1be));var _0xb102=function(_0x2a2cce,_0x2bfdf2){_0x2a2cce=_0x2a2cce-0x0;var _0x4f8783=_0x102b[_0x2a2cce];return _0x4f8783;};'use strict';var _=require('lodash');var util=require(_0xb102('0x0'));var logger=require('../../config/logger')(_0xb102('0x1'));var moment=require(_0xb102('0x2'));var BPromise=require(_0xb102('0x3'));var rp=require(_0xb102('0x4'));var fs=require('fs');var path=require(_0xb102('0x5'));var rimraf=require(_0xb102('0x6'));var config=require(_0xb102('0x7'));var attributes=require(_0xb102('0x8'));module['exports']=function(_0x3325b7,_0x370baa){return _0x3325b7[_0xb102('0x9')](_0xb102('0xa'),attributes,{'tableName':_0xb102('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 0c8cbab..964c57f 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 _0xcdf9=['moment','randomstring','ioredis','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util'];(function(_0xd98ca3,_0x38fbd9){var _0x35960d=function(_0x52e8ee){while(--_0x52e8ee){_0xd98ca3['push'](_0xd98ca3['shift']());}};_0x35960d(++_0x38fbd9);}(_0xcdf9,0x1b3));var _0x9cdf=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xcdf9[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x9cdf('0x0'));var util=require(_0x9cdf('0x1'));var moment=require(_0x9cdf('0x2'));var BPromise=require('bluebird');var rs=require(_0x9cdf('0x3'));var fs=require('fs');var Redis=require(_0x9cdf('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9cdf('0x5'));var client=jayson[_0x9cdf('0x6')][_0x9cdf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x21a92d,_0x983ae5,_0x4be702){return new BPromise(function(_0x1c3854,_0x4d19bd){return client[_0x9cdf('0x8')](_0x21a92d,_0x4be702)[_0x9cdf('0x9')](function(_0x2c6e3c){logger[_0x9cdf('0xa')](_0x9cdf('0xb'),_0x983ae5,_0x9cdf('0xc'));logger[_0x9cdf('0xd')](_0x9cdf('0xe'),_0x983ae5,_0x9cdf('0xc'),JSON['stringify'](_0x2c6e3c));if(_0x2c6e3c[_0x9cdf('0xf')]){if(_0x2c6e3c['error']['code']===0x1f4){logger['error'](_0x9cdf('0xb'),_0x983ae5,_0x2c6e3c['error']['message']);return _0x4d19bd(_0x2c6e3c[_0x9cdf('0xf')][_0x9cdf('0x10')]);}logger[_0x9cdf('0xf')](_0x9cdf('0xb'),_0x983ae5,_0x2c6e3c['error'][_0x9cdf('0x10')]);return _0x1c3854(_0x2c6e3c['error']['message']);}else{logger[_0x9cdf('0xa')](_0x9cdf('0xb'),_0x983ae5,_0x9cdf('0xc'));_0x1c3854(_0x2c6e3c[_0x9cdf('0x11')]['message']);}})[_0x9cdf('0x12')](function(_0x3c8434){logger[_0x9cdf('0xf')](_0x9cdf('0xb'),_0x983ae5,_0x3c8434);_0x4d19bd(_0x3c8434);});});} \ No newline at end of file +var _0x451f=['error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x75ce5b,_0x3b582f){var _0x22195e=function(_0x166668){while(--_0x166668){_0x75ce5b['push'](_0x75ce5b['shift']());}};_0x22195e(++_0x3b582f);}(_0x451f,0x1cc));var _0xf451=function(_0x2c4027,_0x4043c9){_0x2c4027=_0x2c4027-0x0;var _0x4cf424=_0x451f[_0x2c4027];return _0x4cf424;};'use strict';var _=require(_0xf451('0x0'));var util=require('util');var moment=require(_0xf451('0x1'));var BPromise=require(_0xf451('0x2'));var rs=require(_0xf451('0x3'));var fs=require('fs');var Redis=require(_0xf451('0x4'));var db=require(_0xf451('0x5'))['db'];var utils=require(_0xf451('0x6'));var logger=require(_0xf451('0x7'))(_0xf451('0x8'));var config=require(_0xf451('0x9'));var jayson=require(_0xf451('0xa'));var client=jayson[_0xf451('0xb')][_0xf451('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52c23,_0x3b5f4e,_0x1e27ef){return new BPromise(function(_0x22a866,_0x4335e7){return client[_0xf451('0xd')](_0x52c23,_0x1e27ef)[_0xf451('0xe')](function(_0x587c69){logger[_0xf451('0xf')](_0xf451('0x10'),_0x3b5f4e,_0xf451('0x11'));logger[_0xf451('0x12')](_0xf451('0x13'),_0x3b5f4e,_0xf451('0x11'),JSON['stringify'](_0x587c69));if(_0x587c69[_0xf451('0x14')]){if(_0x587c69[_0xf451('0x14')][_0xf451('0x15')]===0x1f4){logger[_0xf451('0x14')](_0xf451('0x10'),_0x3b5f4e,_0x587c69['error'][_0xf451('0x16')]);return _0x4335e7(_0x587c69[_0xf451('0x14')]['message']);}logger[_0xf451('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x3b5f4e,_0x587c69['error'][_0xf451('0x16')]);return _0x22a866(_0x587c69['error']['message']);}else{logger[_0xf451('0xf')](_0xf451('0x10'),_0x3b5f4e,_0xf451('0x11'));_0x22a866(_0x587c69[_0xf451('0x17')][_0xf451('0x16')]);}})['catch'](function(_0x282a97){logger[_0xf451('0x14')](_0xf451('0x10'),_0x3b5f4e,_0x282a97);_0x4335e7(_0x282a97);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index d43a049..12d63d4 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 _0x49df=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','delete','exports','path','connect-timeout','express'];(function(_0x3f528a,_0x4bb048){var _0x2e1291=function(_0x2bb501){while(--_0x2bb501){_0x3f528a['push'](_0x3f528a['shift']());}};_0x2e1291(++_0x4bb048);}(_0x49df,0xad));var _0xf49d=function(_0x689fb4,_0x30844d){_0x689fb4=_0x689fb4-0x0;var _0x5a6d16=_0x49df[_0x689fb4];return _0x5a6d16;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf49d('0x0'));var timeout=require(_0xf49d('0x1'));var express=require(_0xf49d('0x2'));var router=express[_0xf49d('0x3')]();var fs_extra=require(_0xf49d('0x4'));var auth=require(_0xf49d('0x5'));var interaction=require(_0xf49d('0x6'));var config=require('../../config/environment');var controller=require(_0xf49d('0x7'));router[_0xf49d('0x8')]('/',auth[_0xf49d('0x9')](),controller[_0xf49d('0xa')]);router[_0xf49d('0x8')](_0xf49d('0xb'),auth['isAuthenticated'](),controller[_0xf49d('0xc')]);router[_0xf49d('0xd')]('/',auth[_0xf49d('0x9')](),controller['create']);router['put'](_0xf49d('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xf49d('0xe')](_0xf49d('0xb'),auth[_0xf49d('0x9')](),controller['destroy']);module[_0xf49d('0xf')]=router; \ No newline at end of file +var _0x3079=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','show','create','/:id','update','destroy','exports'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x3079,0x110));var _0x9307=function(_0x10677f,_0x188ba1){_0x10677f=_0x10677f-0x0;var _0x5cb8b9=_0x3079[_0x10677f];return _0x5cb8b9;};'use strict';var multer=require('multer');var util=require(_0x9307('0x0'));var path=require(_0x9307('0x1'));var timeout=require(_0x9307('0x2'));var express=require(_0x9307('0x3'));var router=express['Router']();var fs_extra=require(_0x9307('0x4'));var auth=require(_0x9307('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9307('0x6'));router[_0x9307('0x7')]('/',auth[_0x9307('0x8')](),controller[_0x9307('0x9')]);router[_0x9307('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x9307('0xa')]);router['post']('/',auth[_0x9307('0x8')](),controller[_0x9307('0xb')]);router['put'](_0x9307('0xc'),auth[_0x9307('0x8')](),controller[_0x9307('0xd')]);router['delete']('/:id',auth[_0x9307('0x8')](),controller[_0x9307('0xe')]);module[_0x9307('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 37dad0d..73600f4 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 _0x37f3=['sequelize','TEXT'];(function(_0x4b47ba,_0x2aeb85){var _0x3d5034=function(_0x4c4f05){while(--_0x4c4f05){_0x4b47ba['push'](_0x4b47ba['shift']());}};_0x3d5034(++_0x2aeb85);}(_0x37f3,0xe0));var _0x337f=function(_0x4ec520,_0x15fee2){_0x4ec520=_0x4ec520-0x0;var _0xed49d7=_0x37f3[_0x4ec520];return _0xed49d7;};'use strict';var Sequelize=require(_0x337f('0x0'));module['exports']={'tree':{'type':Sequelize[_0x337f('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x4c58=['TEXT','sequelize'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x4c58,0xed));var _0x84c5=function(_0x1aa277,_0x1edd4f){_0x1aa277=_0x1aa277-0x0;var _0x2f21e5=_0x4c58[_0x1aa277];return _0x2f21e5;};'use strict';var Sequelize=require(_0x84c5('0x0'));module['exports']={'tree':{'type':Sequelize[_0x84c5('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index f0ded65..0811b1d 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 _0x9779=['includeAll','include','findAll','rows','show','params','options','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','end','error','send','map','AnalyticTreeReport','fieldName','key','name','keys','query','filters','intersection','model','attributes','fields','nolimit','sort','where','pick','filter','type','merge'];(function(_0x225bd6,_0xa696ad){var _0x406c9e=function(_0x2e01c7){while(--_0x2e01c7){_0x225bd6['push'](_0x225bd6['shift']());}};_0x406c9e(++_0xa696ad);}(_0x9779,0x98));var _0x9977=function(_0x5b31ce,_0xb5634){_0x5b31ce=_0x5b31ce-0x0;var _0x16d708=_0x9779[_0x5b31ce];return _0x16d708;};'use strict';var emlformat=require(_0x9977('0x0'));var rimraf=require(_0x9977('0x1'));var zipdir=require(_0x9977('0x2'));var jsonpatch=require(_0x9977('0x3'));var rp=require('request-promise');var moment=require(_0x9977('0x4'));var BPromise=require(_0x9977('0x5'));var Mustache=require(_0x9977('0x6'));var util=require('util');var path=require(_0x9977('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9977('0x8'));var fs=require('fs');var fs_extra=require(_0x9977('0x9'));var _=require('lodash');var squel=require(_0x9977('0xa'));var crypto=require(_0x9977('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9977('0xc'));var toCsv=require(_0x9977('0xd'));var querystring=require(_0x9977('0xe'));var Papa=require(_0x9977('0xf'));var Redis=require(_0x9977('0x10'));var authService=require(_0x9977('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9977('0x12'));var hardwareService=require(_0x9977('0x13'));var logger=require(_0x9977('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x9977('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9977('0x16'))['db'];function respondWithStatusCode(_0x262659,_0x4e2e3e){_0x4e2e3e=_0x4e2e3e||0xcc;return function(_0x306b18){if(_0x306b18){return _0x262659[_0x9977('0x17')](_0x4e2e3e);}return _0x262659[_0x9977('0x18')](_0x4e2e3e)['end']();};}function respondWithResult(_0x1597af,_0x1ce7af){_0x1ce7af=_0x1ce7af||0xc8;return function(_0xff2265){if(_0xff2265){return _0x1597af[_0x9977('0x18')](_0x1ce7af)['json'](_0xff2265);}};}function respondWithFilteredResult(_0x48699e,_0xdf2e2f){return function(_0x6d34c6){if(_0x6d34c6){var _0x5bdf47=typeof _0xdf2e2f[_0x9977('0x19')]===_0x9977('0x1a')&&typeof _0xdf2e2f[_0x9977('0x1b')]===_0x9977('0x1a');var _0x17f9d3=_0x6d34c6['count'];var _0x18c029=_0x5bdf47?0x0:_0xdf2e2f['offset'];var _0x3f271e=_0x5bdf47?_0x6d34c6[_0x9977('0x1c')]:_0xdf2e2f[_0x9977('0x19')]+_0xdf2e2f['limit'];var _0x2b492f;if(_0x3f271e>=_0x17f9d3){_0x3f271e=_0x17f9d3;_0x2b492f=0xc8;}else{_0x2b492f=0xce;}_0x48699e[_0x9977('0x18')](_0x2b492f);return _0x48699e['set'](_0x9977('0x1d'),_0x18c029+'-'+_0x3f271e+'/'+_0x17f9d3)[_0x9977('0x1e')](_0x6d34c6);}return null;};}function patchUpdates(_0x1fea5b){return function(_0x5896c){try{jsonpatch[_0x9977('0x1f')](_0x5896c,_0x1fea5b,!![]);}catch(_0x811dea){return BPromise[_0x9977('0x20')](_0x811dea);}return _0x5896c[_0x9977('0x21')]();};}function saveUpdates(_0x34e655,_0x5b3b90){return function(_0x316c75){if(_0x316c75){return _0x316c75[_0x9977('0x22')](_0x34e655)[_0x9977('0x23')](function(_0x5db765){return _0x5db765;});}return null;};}function removeEntity(_0x22f9e2,_0x587603){return function(_0x5b836f){if(_0x5b836f){return _0x5b836f['destroy']()['then'](function(){_0x22f9e2[_0x9977('0x18')](0xcc)[_0x9977('0x24')]();});}};}function handleEntityNotFound(_0x51b15e,_0x4e9914){return function(_0x36f08c){if(!_0x36f08c){_0x51b15e[_0x9977('0x17')](0x194);}return _0x36f08c;};}function handleError(_0x49a14e,_0x51cc03){_0x51cc03=_0x51cc03||0x1f4;return function(_0x29bdb3){logger[_0x9977('0x25')](_0x29bdb3['stack']);if(_0x29bdb3['name']){delete _0x29bdb3['name'];}_0x49a14e[_0x9977('0x18')](_0x51cc03)[_0x9977('0x26')](_0x29bdb3);};}exports['index']=function(_0x2af1bd,_0x237ad5){var _0x354a58={},_0xed26bd={},_0x34d36f={'count':0x0,'rows':[]};var _0x27975a=_[_0x9977('0x27')](db[_0x9977('0x28')]['rawAttributes'],function(_0x168df7){return{'name':_0x168df7[_0x9977('0x29')],'type':_0x168df7['type'][_0x9977('0x2a')]};});_0xed26bd['model']=_[_0x9977('0x27')](_0x27975a,_0x9977('0x2b'));_0xed26bd['query']=_[_0x9977('0x2c')](_0x2af1bd[_0x9977('0x2d')]);_0xed26bd[_0x9977('0x2e')]=_[_0x9977('0x2f')](_0xed26bd[_0x9977('0x30')],_0xed26bd['query']);_0x354a58[_0x9977('0x31')]=_[_0x9977('0x2f')](_0xed26bd['model'],qs[_0x9977('0x32')](_0x2af1bd[_0x9977('0x2d')][_0x9977('0x32')]));_0x354a58['attributes']=_0x354a58[_0x9977('0x31')]['length']?_0x354a58[_0x9977('0x31')]:_0xed26bd[_0x9977('0x30')];if(!_0x2af1bd['query']['hasOwnProperty'](_0x9977('0x33'))){_0x354a58[_0x9977('0x1b')]=qs[_0x9977('0x1b')](_0x2af1bd['query'][_0x9977('0x1b')]);_0x354a58[_0x9977('0x19')]=qs[_0x9977('0x19')](_0x2af1bd['query']['offset']);}_0x354a58['order']=qs[_0x9977('0x34')](_0x2af1bd[_0x9977('0x2d')]['sort']);_0x354a58[_0x9977('0x35')]=qs['filters'](_[_0x9977('0x36')](_0x2af1bd[_0x9977('0x2d')],_0xed26bd[_0x9977('0x2e')]),_0x27975a);if(_0x2af1bd[_0x9977('0x2d')][_0x9977('0x37')]){_0x354a58[_0x9977('0x35')]=_['merge'](_0x354a58[_0x9977('0x35')],{'$or':_[_0x9977('0x27')](_0x27975a,function(_0x5f1a3d){if(_0x5f1a3d[_0x9977('0x38')]!=='VIRTUAL'){var _0x194c87={};_0x194c87[_0x5f1a3d[_0x9977('0x2b')]]={'$like':'%'+_0x2af1bd[_0x9977('0x2d')][_0x9977('0x37')]+'%'};return _0x194c87;}})});}_0x354a58=_[_0x9977('0x39')]({},_0x354a58,_0x2af1bd['options']);var _0x4daf56={'where':_0x354a58['where']};return db['AnalyticTreeReport'][_0x9977('0x1c')](_0x4daf56)[_0x9977('0x23')](function(_0x34d636){_0x34d36f[_0x9977('0x1c')]=_0x34d636;if(_0x2af1bd[_0x9977('0x2d')][_0x9977('0x3a')]){_0x354a58[_0x9977('0x3b')]=[{'all':!![]}];}return db[_0x9977('0x28')][_0x9977('0x3c')](_0x354a58);})[_0x9977('0x23')](function(_0x476ac0){_0x34d36f[_0x9977('0x3d')]=_0x476ac0;return _0x34d36f;})[_0x9977('0x23')](respondWithFilteredResult(_0x237ad5,_0x354a58))['catch'](handleError(_0x237ad5,null));};exports[_0x9977('0x3e')]=function(_0x45f0b2,_0x2aac03){var _0x3e4096={'raw':!![],'where':{'id':_0x45f0b2[_0x9977('0x3f')]['id']}},_0x2535b4={};_0x2535b4['model']=_[_0x9977('0x2c')](db[_0x9977('0x28')]['rawAttributes']);_0x2535b4['query']=_[_0x9977('0x2c')](_0x45f0b2[_0x9977('0x2d')]);_0x2535b4['filters']=_[_0x9977('0x2f')](_0x2535b4[_0x9977('0x30')],_0x2535b4[_0x9977('0x2d')]);_0x3e4096[_0x9977('0x31')]=_[_0x9977('0x2f')](_0x2535b4['model'],qs['fields'](_0x45f0b2['query'][_0x9977('0x32')]));_0x3e4096[_0x9977('0x31')]=_0x3e4096['attributes']['length']?_0x3e4096[_0x9977('0x31')]:_0x2535b4[_0x9977('0x30')];if(_0x45f0b2['query']['includeAll']){_0x3e4096[_0x9977('0x3b')]=[{'all':!![]}];}_0x3e4096=_[_0x9977('0x39')]({},_0x3e4096,_0x45f0b2[_0x9977('0x40')]);return db[_0x9977('0x28')][_0x9977('0x41')](_0x3e4096)['then'](handleEntityNotFound(_0x2aac03,null))[_0x9977('0x23')](respondWithResult(_0x2aac03,null))[_0x9977('0x42')](handleError(_0x2aac03,null));};exports[_0x9977('0x43')]=function(_0x4845c9,_0x22c6bf){return db[_0x9977('0x28')]['create'](_0x4845c9[_0x9977('0x44')],{})[_0x9977('0x23')](respondWithResult(_0x22c6bf,0xc9))[_0x9977('0x42')](handleError(_0x22c6bf,null));};exports[_0x9977('0x22')]=function(_0x2a800e,_0x2c2bc3){if(_0x2a800e['body']['id']){delete _0x2a800e[_0x9977('0x44')]['id'];}return db[_0x9977('0x28')][_0x9977('0x41')]({'where':{'id':_0x2a800e[_0x9977('0x3f')]['id']}})[_0x9977('0x23')](handleEntityNotFound(_0x2c2bc3,null))['then'](saveUpdates(_0x2a800e[_0x9977('0x44')],null))[_0x9977('0x23')](respondWithResult(_0x2c2bc3,null))['catch'](handleError(_0x2c2bc3,null));};exports[_0x9977('0x45')]=function(_0x2503d7,_0x315ed6){return db['AnalyticTreeReport']['find']({'where':{'id':_0x2503d7['params']['id']}})['then'](handleEntityNotFound(_0x315ed6,null))[_0x9977('0x23')](removeEntity(_0x315ed6,null))[_0x9977('0x42')](handleError(_0x315ed6,null));}; \ No newline at end of file +var _0x3488=['destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x152363,_0x59654a){var _0x3092e5=function(_0x406359){while(--_0x406359){_0x152363['push'](_0x152363['shift']());}};_0x3092e5(++_0x59654a);}(_0x3488,0x73));var _0x8348=function(_0x166301,_0x5798af){_0x166301=_0x166301-0x0;var _0x492147=_0x3488[_0x166301];return _0x492147;};'use strict';var emlformat=require(_0x8348('0x0'));var rimraf=require(_0x8348('0x1'));var zipdir=require(_0x8348('0x2'));var jsonpatch=require(_0x8348('0x3'));var rp=require(_0x8348('0x4'));var moment=require(_0x8348('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8348('0x6'));var util=require(_0x8348('0x7'));var path=require('path');var sox=require(_0x8348('0x8'));var csv=require(_0x8348('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8348('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8348('0xb'));var jsforce=require(_0x8348('0xc'));var deskjs=require(_0x8348('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8348('0xe'));var Papa=require(_0x8348('0xf'));var Redis=require(_0x8348('0x10'));var authService=require(_0x8348('0x11'));var qs=require(_0x8348('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8348('0x13'));var logger=require(_0x8348('0x14'))(_0x8348('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8348('0x16'))['db'];function respondWithStatusCode(_0x261a68,_0x57c206){_0x57c206=_0x57c206||0xcc;return function(_0x38edde){if(_0x38edde){return _0x261a68[_0x8348('0x17')](_0x57c206);}return _0x261a68['status'](_0x57c206)[_0x8348('0x18')]();};}function respondWithResult(_0x325668,_0x50e73f){_0x50e73f=_0x50e73f||0xc8;return function(_0x521169){if(_0x521169){return _0x325668[_0x8348('0x19')](_0x50e73f)[_0x8348('0x1a')](_0x521169);}};}function respondWithFilteredResult(_0x53b4ca,_0x2b503a){return function(_0x4d2c50){if(_0x4d2c50){var _0x213432=typeof _0x2b503a[_0x8348('0x1b')]==='undefined'&&typeof _0x2b503a[_0x8348('0x1c')]==='undefined';var _0x43be2f=_0x4d2c50[_0x8348('0x1d')];var _0x2c5640=_0x213432?0x0:_0x2b503a['offset'];var _0x1843ac=_0x213432?_0x4d2c50[_0x8348('0x1d')]:_0x2b503a[_0x8348('0x1b')]+_0x2b503a[_0x8348('0x1c')];var _0x119e6e;if(_0x1843ac>=_0x43be2f){_0x1843ac=_0x43be2f;_0x119e6e=0xc8;}else{_0x119e6e=0xce;}_0x53b4ca['status'](_0x119e6e);return _0x53b4ca[_0x8348('0x1e')](_0x8348('0x1f'),_0x2c5640+'-'+_0x1843ac+'/'+_0x43be2f)[_0x8348('0x1a')](_0x4d2c50);}return null;};}function patchUpdates(_0x319375){return function(_0x58d5c7){try{jsonpatch[_0x8348('0x20')](_0x58d5c7,_0x319375,!![]);}catch(_0x249ac6){return BPromise[_0x8348('0x21')](_0x249ac6);}return _0x58d5c7[_0x8348('0x22')]();};}function saveUpdates(_0x26a210,_0x392d60){return function(_0x15edde){if(_0x15edde){return _0x15edde[_0x8348('0x23')](_0x26a210)[_0x8348('0x24')](function(_0x29d727){return _0x29d727;});}return null;};}function removeEntity(_0x48716d,_0x3436b9){return function(_0x3ae14e){if(_0x3ae14e){return _0x3ae14e[_0x8348('0x25')]()[_0x8348('0x24')](function(){_0x48716d[_0x8348('0x19')](0xcc)[_0x8348('0x18')]();});}};}function handleEntityNotFound(_0x214e3e,_0x263a3b){return function(_0xe1b0e5){if(!_0xe1b0e5){_0x214e3e[_0x8348('0x17')](0x194);}return _0xe1b0e5;};}function handleError(_0x284513,_0x3d7567){_0x3d7567=_0x3d7567||0x1f4;return function(_0x1924fe){logger[_0x8348('0x26')](_0x1924fe[_0x8348('0x27')]);if(_0x1924fe[_0x8348('0x28')]){delete _0x1924fe[_0x8348('0x28')];}_0x284513[_0x8348('0x19')](_0x3d7567)[_0x8348('0x29')](_0x1924fe);};}exports[_0x8348('0x2a')]=function(_0x1a0003,_0x2b2af3){var _0x3bf113={},_0x56deee={},_0xcfd1c0={'count':0x0,'rows':[]};var _0x1447f5=_[_0x8348('0x2b')](db[_0x8348('0x2c')][_0x8348('0x2d')],function(_0x2c6d77){return{'name':_0x2c6d77[_0x8348('0x2e')],'type':_0x2c6d77[_0x8348('0x2f')]['key']};});_0x56deee[_0x8348('0x30')]=_[_0x8348('0x2b')](_0x1447f5,_0x8348('0x28'));_0x56deee[_0x8348('0x31')]=_[_0x8348('0x32')](_0x1a0003['query']);_0x56deee[_0x8348('0x33')]=_['intersection'](_0x56deee[_0x8348('0x30')],_0x56deee['query']);_0x3bf113['attributes']=_[_0x8348('0x34')](_0x56deee['model'],qs[_0x8348('0x35')](_0x1a0003[_0x8348('0x31')][_0x8348('0x35')]));_0x3bf113[_0x8348('0x36')]=_0x3bf113['attributes'][_0x8348('0x37')]?_0x3bf113[_0x8348('0x36')]:_0x56deee[_0x8348('0x30')];if(!_0x1a0003[_0x8348('0x31')][_0x8348('0x38')](_0x8348('0x39'))){_0x3bf113[_0x8348('0x1c')]=qs['limit'](_0x1a0003['query']['limit']);_0x3bf113[_0x8348('0x1b')]=qs[_0x8348('0x1b')](_0x1a0003[_0x8348('0x31')][_0x8348('0x1b')]);}_0x3bf113[_0x8348('0x3a')]=qs['sort'](_0x1a0003[_0x8348('0x31')][_0x8348('0x3b')]);_0x3bf113['where']=qs[_0x8348('0x33')](_[_0x8348('0x3c')](_0x1a0003[_0x8348('0x31')],_0x56deee[_0x8348('0x33')]),_0x1447f5);if(_0x1a0003[_0x8348('0x31')][_0x8348('0x3d')]){_0x3bf113['where']=_[_0x8348('0x3e')](_0x3bf113[_0x8348('0x3f')],{'$or':_[_0x8348('0x2b')](_0x1447f5,function(_0x2844a7){if(_0x2844a7['type']!==_0x8348('0x40')){var _0x6dbe4e={};_0x6dbe4e[_0x2844a7[_0x8348('0x28')]]={'$like':'%'+_0x1a0003['query']['filter']+'%'};return _0x6dbe4e;}})});}_0x3bf113=_[_0x8348('0x3e')]({},_0x3bf113,_0x1a0003[_0x8348('0x41')]);var _0x442334={'where':_0x3bf113['where']};return db[_0x8348('0x2c')][_0x8348('0x1d')](_0x442334)[_0x8348('0x24')](function(_0x183933){_0xcfd1c0[_0x8348('0x1d')]=_0x183933;if(_0x1a0003[_0x8348('0x31')][_0x8348('0x42')]){_0x3bf113[_0x8348('0x43')]=[{'all':!![]}];}return db[_0x8348('0x2c')][_0x8348('0x44')](_0x3bf113);})[_0x8348('0x24')](function(_0xd0cb67){_0xcfd1c0[_0x8348('0x45')]=_0xd0cb67;return _0xcfd1c0;})[_0x8348('0x24')](respondWithFilteredResult(_0x2b2af3,_0x3bf113))['catch'](handleError(_0x2b2af3,null));};exports[_0x8348('0x46')]=function(_0x587c1c,_0x52ec74){var _0x40f754={'raw':!![],'where':{'id':_0x587c1c['params']['id']}},_0x51e76b={};_0x51e76b[_0x8348('0x30')]=_[_0x8348('0x32')](db[_0x8348('0x2c')][_0x8348('0x2d')]);_0x51e76b[_0x8348('0x31')]=_[_0x8348('0x32')](_0x587c1c['query']);_0x51e76b[_0x8348('0x33')]=_[_0x8348('0x34')](_0x51e76b[_0x8348('0x30')],_0x51e76b['query']);_0x40f754[_0x8348('0x36')]=_[_0x8348('0x34')](_0x51e76b[_0x8348('0x30')],qs[_0x8348('0x35')](_0x587c1c[_0x8348('0x31')]['fields']));_0x40f754[_0x8348('0x36')]=_0x40f754[_0x8348('0x36')][_0x8348('0x37')]?_0x40f754['attributes']:_0x51e76b[_0x8348('0x30')];if(_0x587c1c[_0x8348('0x31')][_0x8348('0x42')]){_0x40f754['include']=[{'all':!![]}];}_0x40f754=_['merge']({},_0x40f754,_0x587c1c['options']);return db[_0x8348('0x2c')][_0x8348('0x47')](_0x40f754)[_0x8348('0x24')](handleEntityNotFound(_0x52ec74,null))[_0x8348('0x24')](respondWithResult(_0x52ec74,null))[_0x8348('0x48')](handleError(_0x52ec74,null));};exports[_0x8348('0x49')]=function(_0x109e6d,_0x2987bd){return db[_0x8348('0x2c')][_0x8348('0x49')](_0x109e6d['body'],{})[_0x8348('0x24')](respondWithResult(_0x2987bd,0xc9))[_0x8348('0x48')](handleError(_0x2987bd,null));};exports[_0x8348('0x23')]=function(_0xb1dcf2,_0x51d502){if(_0xb1dcf2[_0x8348('0x4a')]['id']){delete _0xb1dcf2[_0x8348('0x4a')]['id'];}return db['AnalyticTreeReport'][_0x8348('0x47')]({'where':{'id':_0xb1dcf2[_0x8348('0x4b')]['id']}})[_0x8348('0x24')](handleEntityNotFound(_0x51d502,null))['then'](saveUpdates(_0xb1dcf2['body'],null))[_0x8348('0x24')](respondWithResult(_0x51d502,null))['catch'](handleError(_0x51d502,null));};exports[_0x8348('0x25')]=function(_0x1516ec,_0x90bd59){return db[_0x8348('0x2c')][_0x8348('0x47')]({'where':{'id':_0x1516ec[_0x8348('0x4b')]['id']}})[_0x8348('0x24')](handleEntityNotFound(_0x90bd59,null))['then'](removeEntity(_0x90bd59,null))[_0x8348('0x48')](handleError(_0x90bd59,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index b7f5f47..e758030 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 _0xfdd4=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xfdd4,0x164));var _0x4fdd=function(_0x4f67f1,_0x3d02bf){_0x4f67f1=_0x4f67f1-0x0;var _0x52c611=_0xfdd4[_0x4f67f1];return _0x52c611;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4fdd('0x0'))(_0x4fdd('0x1'));var moment=require(_0x4fdd('0x2'));var BPromise=require(_0x4fdd('0x3'));var rp=require(_0x4fdd('0x4'));var fs=require('fs');var path=require(_0x4fdd('0x5'));var rimraf=require(_0x4fdd('0x6'));var config=require(_0x4fdd('0x7'));var attributes=require(_0x4fdd('0x8'));module[_0x4fdd('0x9')]=function(_0x14c064,_0x2aa6ec){return _0x14c064[_0x4fdd('0xa')](_0x4fdd('0xb'),attributes,{'tableName':_0x4fdd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe966=['analytics_report_trees','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe966,0xf1));var _0x6e96=function(_0x25599a,_0x4024a5){_0x25599a=_0x25599a-0x0;var _0x5b8d3d=_0xe966[_0x25599a];return _0x5b8d3d;};'use strict';var _=require(_0x6e96('0x0'));var util=require(_0x6e96('0x1'));var logger=require('../../config/logger')(_0x6e96('0x2'));var moment=require('moment');var BPromise=require(_0x6e96('0x3'));var rp=require(_0x6e96('0x4'));var fs=require('fs');var path=require(_0x6e96('0x5'));var rimraf=require(_0x6e96('0x6'));var config=require(_0x6e96('0x7'));var attributes=require(_0x6e96('0x8'));module[_0x6e96('0x9')]=function(_0x1f8d91,_0x48bf30){return _0x1f8d91[_0x6e96('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0x6e96('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 61fc808..f8de6df 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x534817,_0x55cc0a){var _0x4e3ecb=function(_0x43046d){while(--_0x43046d){_0x534817['push'](_0x534817['shift']());}};_0x4e3ecb(++_0x55cc0a);}(_0xadb5,0xad));var _0x5adb=function(_0x456769,_0x426f89){_0x456769=_0x456769-0x0;var _0x261442=_0xadb5[_0x456769];return _0x261442;};'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']('AnalyticTreeReport,\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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x132a9a,_0x4da489){var _0x9dd201=function(_0x20435d){while(--_0x20435d){_0x132a9a['push'](_0x132a9a['shift']());}};_0x9dd201(++_0x4da489);}(_0xadb5,0xad));var _0x5adb=function(_0x27dcd0,_0x2d3b51){_0x27dcd0=_0x27dcd0-0x0;var _0x48fecc=_0xadb5[_0x27dcd0];return _0x48fecc;};'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']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 9269983..28cdf3f 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 _0xd890=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd890,0x143));var _0x0d89=function(_0x1afabf,_0x56fdcc){_0x1afabf=_0x1afabf-0x0;var _0x497ff1=_0xd890[_0x1afabf];return _0x497ff1;};'use strict';var multer=require(_0x0d89('0x0'));var util=require('util');var path=require(_0x0d89('0x1'));var timeout=require(_0x0d89('0x2'));var express=require(_0x0d89('0x3'));var router=express[_0x0d89('0x4')]();var fs_extra=require(_0x0d89('0x5'));var auth=require(_0x0d89('0x6'));var interaction=require(_0x0d89('0x7'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x0d89('0x8')]('/',auth[_0x0d89('0x9')](),controller['index']);router['get'](_0x0d89('0xa'),auth[_0x0d89('0x9')](),controller[_0x0d89('0xb')]);router['post']('/',auth[_0x0d89('0x9')](),controller[_0x0d89('0xc')]);router[_0x0d89('0xd')](_0x0d89('0xa'),auth[_0x0d89('0x9')](),controller[_0x0d89('0xe')]);router[_0x0d89('0xf')](_0x0d89('0xa'),auth[_0x0d89('0x9')](),controller[_0x0d89('0x10')]);module[_0x0d89('0x11')]=router; \ No newline at end of file +var _0x7066=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','show','post','create','put','update','delete','exports'];(function(_0x12acaa,_0x5ed722){var _0xe2b239=function(_0x3cc144){while(--_0x3cc144){_0x12acaa['push'](_0x12acaa['shift']());}};_0xe2b239(++_0x5ed722);}(_0x7066,0x1cb));var _0x6706=function(_0x2c1b8b,_0x3d5268){_0x2c1b8b=_0x2c1b8b-0x0;var _0x4e6585=_0x7066[_0x2c1b8b];return _0x4e6585;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6706('0x0'));var timeout=require('connect-timeout');var express=require(_0x6706('0x1'));var router=express[_0x6706('0x2')]();var fs_extra=require(_0x6706('0x3'));var auth=require(_0x6706('0x4'));var interaction=require(_0x6706('0x5'));var config=require(_0x6706('0x6'));var controller=require(_0x6706('0x7'));router[_0x6706('0x8')]('/',auth[_0x6706('0x9')](),controller['index']);router[_0x6706('0x8')]('/:id',auth[_0x6706('0x9')](),controller[_0x6706('0xa')]);router[_0x6706('0xb')]('/',auth[_0x6706('0x9')](),controller[_0x6706('0xc')]);router[_0x6706('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x6706('0xe')]);router[_0x6706('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6706('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 6fae99d..2312e49 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 _0x8ff9=['exports','STRING','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8ff9,0x188));var _0x98ff=function(_0x5396ac,_0x49f735){_0x5396ac=_0x5396ac-0x0;var _0x252f6c=_0x8ff9[_0x5396ac];return _0x252f6c;};'use strict';var Sequelize=require(_0x98ff('0x0'));module[_0x98ff('0x1')]={'name':{'type':Sequelize[_0x98ff('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x98ff('0x2')]}}; \ No newline at end of file +var _0xd6ce=['STRING','sequelize','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd6ce,0x127));var _0xed6c=function(_0x1aaf0b,_0x46149c){_0x1aaf0b=_0x1aaf0b-0x0;var _0x6b51d9=_0xd6ce[_0x1aaf0b];return _0x6b51d9;};'use strict';var Sequelize=require(_0xed6c('0x0'));module[_0xed6c('0x1')]={'name':{'type':Sequelize[_0xed6c('0x2')]},'basename':{'type':Sequelize[_0xed6c('0x2')]},'type':{'type':Sequelize[_0xed6c('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 49aa1ec..73ae1ab 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 _0x13a2=['index','map','Attachment','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','catch','show','params','keys','include','options','find','clone','get','createdAt','updatedAt','body','omit','create','file','originalname','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','download','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name'];(function(_0x9c6c1c,_0x21ead9){var _0x594c42=function(_0x27764b){while(--_0x27764b){_0x9c6c1c['push'](_0x9c6c1c['shift']());}};_0x594c42(++_0x21ead9);}(_0x13a2,0x1d6));var _0x213a=function(_0x41db7,_0x2f2055){_0x41db7=_0x41db7-0x0;var _0x4a6204=_0x13a2[_0x41db7];return _0x4a6204;};'use strict';var emlformat=require(_0x213a('0x0'));var rimraf=require(_0x213a('0x1'));var zipdir=require(_0x213a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x213a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x213a('0x4'));var path=require(_0x213a('0x5'));var sox=require(_0x213a('0x6'));var csv=require(_0x213a('0x7'));var ejs=require(_0x213a('0x8'));var fs=require('fs');var fs_extra=require(_0x213a('0x9'));var _=require(_0x213a('0xa'));var squel=require(_0x213a('0xb'));var crypto=require(_0x213a('0xc'));var jsforce=require(_0x213a('0xd'));var deskjs=require(_0x213a('0xe'));var toCsv=require(_0x213a('0x7'));var querystring=require(_0x213a('0xf'));var Papa=require(_0x213a('0x10'));var Redis=require(_0x213a('0x11'));var authService=require(_0x213a('0x12'));var qs=require(_0x213a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x213a('0x14'));var config=require(_0x213a('0x15'));var licenseUtil=require(_0x213a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e2a37,_0x315de5){_0x315de5=_0x315de5||0xcc;return function(_0x374d18){if(_0x374d18){return _0x3e2a37['sendStatus'](_0x315de5);}return _0x3e2a37[_0x213a('0x17')](_0x315de5)[_0x213a('0x18')]();};}function respondWithResult(_0x4f9105,_0x3fa321){_0x3fa321=_0x3fa321||0xc8;return function(_0x5f1e23){if(_0x5f1e23){return _0x4f9105[_0x213a('0x17')](_0x3fa321)['json'](_0x5f1e23);}};}function respondWithFilteredResult(_0x309106,_0x114fd4){return function(_0x7484a4){if(_0x7484a4){var _0x446d24=typeof _0x114fd4[_0x213a('0x19')]===_0x213a('0x1a')&&typeof _0x114fd4[_0x213a('0x1b')]===_0x213a('0x1a');var _0x2e1319=_0x7484a4['count'];var _0x2d0d03=_0x446d24?0x0:_0x114fd4[_0x213a('0x19')];var _0x545ad5=_0x446d24?_0x7484a4[_0x213a('0x1c')]:_0x114fd4['offset']+_0x114fd4[_0x213a('0x1b')];var _0x15fe7e;if(_0x545ad5>=_0x2e1319){_0x545ad5=_0x2e1319;_0x15fe7e=0xc8;}else{_0x15fe7e=0xce;}_0x309106[_0x213a('0x17')](_0x15fe7e);return _0x309106['set'](_0x213a('0x1d'),_0x2d0d03+'-'+_0x545ad5+'/'+_0x2e1319)[_0x213a('0x1e')](_0x7484a4);}return null;};}function patchUpdates(_0x44a561){return function(_0x1980b2){try{jsonpatch[_0x213a('0x1f')](_0x1980b2,_0x44a561,!![]);}catch(_0x3fa9e9){return BPromise[_0x213a('0x20')](_0x3fa9e9);}return _0x1980b2[_0x213a('0x21')]();};}function saveUpdates(_0x1e7f61,_0x455d2a){return function(_0x14771a){if(_0x14771a){return _0x14771a[_0x213a('0x22')](_0x1e7f61)[_0x213a('0x23')](function(_0x2ed89b){return _0x2ed89b;});}return null;};}function removeEntity(_0x2234f8,_0x5b2a04){return function(_0x5192c5){if(_0x5192c5){return _0x5192c5[_0x213a('0x24')]()['then'](function(){_0x2234f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x146dd5,_0x102cb3){return function(_0x147029){if(!_0x147029){_0x146dd5[_0x213a('0x25')](0x194);}return _0x147029;};}function handleError(_0x2cbedf,_0x320bf7){_0x320bf7=_0x320bf7||0x1f4;return function(_0x4bd682){logger['error'](_0x4bd682[_0x213a('0x26')]);if(_0x4bd682[_0x213a('0x27')]){delete _0x4bd682[_0x213a('0x27')];}_0x2cbedf[_0x213a('0x17')](_0x320bf7)['send'](_0x4bd682);};}exports[_0x213a('0x28')]=function(_0x17f351,_0x212cee){var _0x56ec0e={},_0x47c95a={},_0x3646d6={'count':0x0,'rows':[]};var _0x371487=_[_0x213a('0x29')](db[_0x213a('0x2a')][_0x213a('0x2b')],function(_0x4397a2){return{'name':_0x4397a2[_0x213a('0x2c')],'type':_0x4397a2[_0x213a('0x2d')]['key']};});_0x47c95a[_0x213a('0x2e')]=_[_0x213a('0x29')](_0x371487,_0x213a('0x27'));_0x47c95a[_0x213a('0x2f')]=_['keys'](_0x17f351[_0x213a('0x2f')]);_0x47c95a[_0x213a('0x30')]=_[_0x213a('0x31')](_0x47c95a[_0x213a('0x2e')],_0x47c95a[_0x213a('0x2f')]);_0x56ec0e[_0x213a('0x32')]=_[_0x213a('0x31')](_0x47c95a[_0x213a('0x2e')],qs[_0x213a('0x33')](_0x17f351[_0x213a('0x2f')][_0x213a('0x33')]));_0x56ec0e[_0x213a('0x32')]=_0x56ec0e[_0x213a('0x32')][_0x213a('0x34')]?_0x56ec0e[_0x213a('0x32')]:_0x47c95a[_0x213a('0x2e')];if(!_0x17f351['query']['hasOwnProperty'](_0x213a('0x35'))){_0x56ec0e[_0x213a('0x1b')]=qs['limit'](_0x17f351[_0x213a('0x2f')][_0x213a('0x1b')]);_0x56ec0e[_0x213a('0x19')]=qs[_0x213a('0x19')](_0x17f351[_0x213a('0x2f')]['offset']);}_0x56ec0e[_0x213a('0x36')]=qs[_0x213a('0x37')](_0x17f351['query'][_0x213a('0x37')]);_0x56ec0e[_0x213a('0x38')]=qs['filters'](_['pick'](_0x17f351[_0x213a('0x2f')],_0x47c95a['filters']),_0x371487);if(_0x17f351['query'][_0x213a('0x39')]){_0x56ec0e[_0x213a('0x38')]=_[_0x213a('0x3a')](_0x56ec0e[_0x213a('0x38')],{'$or':_[_0x213a('0x29')](_0x371487,function(_0xf3f469){if(_0xf3f469['type']!==_0x213a('0x3b')){var _0x2abdfc={};_0x2abdfc[_0xf3f469[_0x213a('0x27')]]={'$like':'%'+_0x17f351['query'][_0x213a('0x39')]+'%'};return _0x2abdfc;}})});}_0x56ec0e=_[_0x213a('0x3a')]({},_0x56ec0e,_0x17f351['options']);var _0x353091={'where':_0x56ec0e[_0x213a('0x38')]};return db['Attachment']['count'](_0x353091)[_0x213a('0x23')](function(_0x247a74){_0x3646d6['count']=_0x247a74;if(_0x17f351[_0x213a('0x2f')][_0x213a('0x3c')]){_0x56ec0e['include']=[{'all':!![]}];}return db[_0x213a('0x2a')]['findAll'](_0x56ec0e);})[_0x213a('0x23')](function(_0x24fc50){_0x3646d6['rows']=_0x24fc50;return _0x3646d6;})['then'](respondWithFilteredResult(_0x212cee,_0x56ec0e))[_0x213a('0x3d')](handleError(_0x212cee,null));};exports[_0x213a('0x3e')]=function(_0x55b9b6,_0x4863da){var _0x7d6f4f={'raw':!![],'where':{'id':_0x55b9b6[_0x213a('0x3f')]['id']}},_0x2879b9={};_0x2879b9[_0x213a('0x2e')]=_[_0x213a('0x40')](db[_0x213a('0x2a')]['rawAttributes']);_0x2879b9[_0x213a('0x2f')]=_['keys'](_0x55b9b6[_0x213a('0x2f')]);_0x2879b9[_0x213a('0x30')]=_['intersection'](_0x2879b9[_0x213a('0x2e')],_0x2879b9[_0x213a('0x2f')]);_0x7d6f4f[_0x213a('0x32')]=_['intersection'](_0x2879b9[_0x213a('0x2e')],qs[_0x213a('0x33')](_0x55b9b6['query'][_0x213a('0x33')]));_0x7d6f4f[_0x213a('0x32')]=_0x7d6f4f['attributes'][_0x213a('0x34')]?_0x7d6f4f[_0x213a('0x32')]:_0x2879b9['model'];if(_0x55b9b6[_0x213a('0x2f')][_0x213a('0x3c')]){_0x7d6f4f[_0x213a('0x41')]=[{'all':!![]}];}_0x7d6f4f=_['merge']({},_0x7d6f4f,_0x55b9b6[_0x213a('0x42')]);return db[_0x213a('0x2a')][_0x213a('0x43')](_0x7d6f4f)[_0x213a('0x23')](handleEntityNotFound(_0x4863da,null))[_0x213a('0x23')](respondWithResult(_0x4863da,null))[_0x213a('0x3d')](handleError(_0x4863da,null));};exports[_0x213a('0x44')]=function(_0x4d20fd,_0x1864d5){var _0xb0c14a={'where':{'id':_0x4d20fd['params']['id']}},_0x2efb16={};_0x2efb16['model']=_[_0x213a('0x40')](db[_0x213a('0x2a')]['rawAttributes']);_0xb0c14a['attributes']=_[_0x213a('0x31')](_0x2efb16[_0x213a('0x2e')],qs['fields'](_0x4d20fd[_0x213a('0x2f')][_0x213a('0x33')]));_0xb0c14a[_0x213a('0x32')]=_0xb0c14a['attributes'][_0x213a('0x34')]?_0xb0c14a['attributes']:_0x2efb16['model'];if(_0x4d20fd['query'][_0x213a('0x3c')]){_0xb0c14a[_0x213a('0x41')]=[{'all':!![]}];}_0xb0c14a=_['merge']({},_0xb0c14a,_0x4d20fd[_0x213a('0x42')]);return db[_0x213a('0x2a')][_0x213a('0x43')](_0xb0c14a)['then'](handleEntityNotFound(_0x1864d5,null))['then'](function(_0x5ee18c){if(_0x5ee18c){var _0x45cf63=_0x5ee18c[_0x213a('0x45')]({'plain':!![]});_0x45cf63=qs['omit'](_0x45cf63,['id',_0x213a('0x46'),_0x213a('0x47')]);_0x4d20fd[_0x213a('0x48')]=_[_0x213a('0x49')](_0x4d20fd[_0x213a('0x48')],['id','createdAt','updatedAt']);return db[_0x213a('0x2a')][_0x213a('0x4a')](_[_0x213a('0x3a')](_0x45cf63,_0x4d20fd[_0x213a('0x48')]),{'include':_0x4d20fd[_0x213a('0x2f')][_0x213a('0x3c')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x1864d5,0xc9))[_0x213a('0x3d')](handleError(_0x1864d5,null));};exports[_0x213a('0x22')]=function(_0x2f6c37,_0x5d502a){if(_0x2f6c37[_0x213a('0x48')]['id']){delete _0x2f6c37[_0x213a('0x48')]['id'];}return db[_0x213a('0x2a')][_0x213a('0x43')]({'where':{'id':_0x2f6c37[_0x213a('0x3f')]['id']}})[_0x213a('0x23')](handleEntityNotFound(_0x5d502a,null))[_0x213a('0x23')](saveUpdates(_0x2f6c37[_0x213a('0x48')],null))['then'](respondWithResult(_0x5d502a,null))[_0x213a('0x3d')](handleError(_0x5d502a,null));};exports[_0x213a('0x24')]=function(_0x36070b,_0x5dda15){return db[_0x213a('0x2a')][_0x213a('0x43')]({'where':{'id':_0x36070b['params']['id']}})[_0x213a('0x23')](handleEntityNotFound(_0x5dda15,null))['then'](removeEntity(_0x5dda15,null))[_0x213a('0x3d')](handleError(_0x5dda15,null));};exports[_0x213a('0x4a')]=function(_0x474e33,_0x5014c1,_0x23ff81){_0x474e33['body']['name']=_0x474e33[_0x213a('0x4b')][_0x213a('0x4c')];_0x474e33[_0x213a('0x48')]['basename']=_0x474e33[_0x213a('0x4b')][_0x213a('0x4d')];_0x474e33[_0x213a('0x48')][_0x213a('0x2d')]=_0x474e33[_0x213a('0x4b')][_0x213a('0x4e')];return db['Attachment'][_0x213a('0x4a')](_0x474e33[_0x213a('0x48')])[_0x213a('0x23')](respondWithResult(_0x5014c1,0xc9))['catch'](handleError(_0x5014c1,null));};exports['download']=function(_0x1dac04,_0x2ddce3,_0x3187ed){return db[_0x213a('0x2a')][_0x213a('0x4f')]({'where':{'id':_0x1dac04[_0x213a('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2ddce3,null))[_0x213a('0x23')](function(_0x3e0045){if(_0x3e0045){var _0x53af12=_0x3e0045[_0x213a('0x50')]!==null;var _0x46e1ef=path[_0x213a('0x51')](config[_0x213a('0x52')],_0x213a('0x53'));if(_0x53af12){_0x46e1ef=path[_0x213a('0x51')](_0x46e1ef,'offline-chat/');}var _0x2878de=path[_0x213a('0x51')](_0x46e1ef,_0x3e0045['basename']);return _0x2ddce3[_0x213a('0x54')](_0x2878de);}})[_0x213a('0x3d')](handleError(_0x2ddce3,null));}; \ No newline at end of file +var _0xabb3=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','params','find','clone','options','get','updatedAt','body','createdAt','create','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','root','server/files/attachments/','join','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x2d62f3,_0x368d1a){var _0x433499=function(_0x5b323f){while(--_0x5b323f){_0x2d62f3['push'](_0x2d62f3['shift']());}};_0x433499(++_0x368d1a);}(_0xabb3,0x196));var _0x3abb=function(_0x247f36,_0x333e5b){_0x247f36=_0x247f36-0x0;var _0x4e5abd=_0xabb3[_0x247f36];return _0x4e5abd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3abb('0x0'));var rp=require('request-promise');var moment=require(_0x3abb('0x1'));var BPromise=require(_0x3abb('0x2'));var Mustache=require(_0x3abb('0x3'));var util=require(_0x3abb('0x4'));var path=require(_0x3abb('0x5'));var sox=require('sox');var csv=require(_0x3abb('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3abb('0x7'));var squel=require(_0x3abb('0x8'));var crypto=require('crypto');var jsforce=require(_0x3abb('0x9'));var deskjs=require(_0x3abb('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3abb('0xb'));var Papa=require(_0x3abb('0xc'));var Redis=require(_0x3abb('0xd'));var authService=require(_0x3abb('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3abb('0xf'));var hardwareService=require(_0x3abb('0x10'));var logger=require(_0x3abb('0x11'))('api');var utils=require(_0x3abb('0x12'));var config=require(_0x3abb('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3abb('0x14'))['db'];function respondWithStatusCode(_0x33802c,_0x58719c){_0x58719c=_0x58719c||0xcc;return function(_0x1861dc){if(_0x1861dc){return _0x33802c[_0x3abb('0x15')](_0x58719c);}return _0x33802c[_0x3abb('0x16')](_0x58719c)[_0x3abb('0x17')]();};}function respondWithResult(_0x522c5b,_0x199585){_0x199585=_0x199585||0xc8;return function(_0x7ba1e8){if(_0x7ba1e8){return _0x522c5b['status'](_0x199585)['json'](_0x7ba1e8);}};}function respondWithFilteredResult(_0x496458,_0x221dda){return function(_0x162bf2){if(_0x162bf2){var _0x31eccb=typeof _0x221dda[_0x3abb('0x18')]===_0x3abb('0x19')&&typeof _0x221dda[_0x3abb('0x1a')]===_0x3abb('0x19');var _0x355367=_0x162bf2[_0x3abb('0x1b')];var _0x2f3d38=_0x31eccb?0x0:_0x221dda['offset'];var _0x372528=_0x31eccb?_0x162bf2[_0x3abb('0x1b')]:_0x221dda[_0x3abb('0x18')]+_0x221dda['limit'];var _0x4ea628;if(_0x372528>=_0x355367){_0x372528=_0x355367;_0x4ea628=0xc8;}else{_0x4ea628=0xce;}_0x496458['status'](_0x4ea628);return _0x496458[_0x3abb('0x1c')](_0x3abb('0x1d'),_0x2f3d38+'-'+_0x372528+'/'+_0x355367)[_0x3abb('0x1e')](_0x162bf2);}return null;};}function patchUpdates(_0x39ad12){return function(_0x28a29f){try{jsonpatch[_0x3abb('0x1f')](_0x28a29f,_0x39ad12,!![]);}catch(_0x21583e){return BPromise[_0x3abb('0x20')](_0x21583e);}return _0x28a29f[_0x3abb('0x21')]();};}function saveUpdates(_0xd43824,_0x17055f){return function(_0x17511f){if(_0x17511f){return _0x17511f[_0x3abb('0x22')](_0xd43824)[_0x3abb('0x23')](function(_0x593972){return _0x593972;});}return null;};}function removeEntity(_0x24927d,_0x5796fe){return function(_0x5e56f6){if(_0x5e56f6){return _0x5e56f6[_0x3abb('0x24')]()[_0x3abb('0x23')](function(){_0x24927d['status'](0xcc)[_0x3abb('0x17')]();});}};}function handleEntityNotFound(_0x404361,_0x814a7){return function(_0x376fa8){if(!_0x376fa8){_0x404361[_0x3abb('0x15')](0x194);}return _0x376fa8;};}function handleError(_0x30b19e,_0x2ad390){_0x2ad390=_0x2ad390||0x1f4;return function(_0x343355){logger[_0x3abb('0x25')](_0x343355[_0x3abb('0x26')]);if(_0x343355[_0x3abb('0x27')]){delete _0x343355[_0x3abb('0x27')];}_0x30b19e[_0x3abb('0x16')](_0x2ad390)['send'](_0x343355);};}exports[_0x3abb('0x28')]=function(_0x28ea3a,_0x3b74ae){var _0x1607c7={},_0x55ef89={},_0x5917c4={'count':0x0,'rows':[]};var _0x4c3d35=_[_0x3abb('0x29')](db[_0x3abb('0x2a')][_0x3abb('0x2b')],function(_0x515672){return{'name':_0x515672[_0x3abb('0x2c')],'type':_0x515672[_0x3abb('0x2d')]['key']};});_0x55ef89['model']=_[_0x3abb('0x29')](_0x4c3d35,_0x3abb('0x27'));_0x55ef89[_0x3abb('0x2e')]=_[_0x3abb('0x2f')](_0x28ea3a[_0x3abb('0x2e')]);_0x55ef89[_0x3abb('0x30')]=_[_0x3abb('0x31')](_0x55ef89['model'],_0x55ef89[_0x3abb('0x2e')]);_0x1607c7[_0x3abb('0x32')]=_[_0x3abb('0x31')](_0x55ef89['model'],qs[_0x3abb('0x33')](_0x28ea3a[_0x3abb('0x2e')][_0x3abb('0x33')]));_0x1607c7['attributes']=_0x1607c7[_0x3abb('0x32')][_0x3abb('0x34')]?_0x1607c7[_0x3abb('0x32')]:_0x55ef89[_0x3abb('0x35')];if(!_0x28ea3a[_0x3abb('0x2e')][_0x3abb('0x36')](_0x3abb('0x37'))){_0x1607c7['limit']=qs[_0x3abb('0x1a')](_0x28ea3a['query'][_0x3abb('0x1a')]);_0x1607c7[_0x3abb('0x18')]=qs[_0x3abb('0x18')](_0x28ea3a['query']['offset']);}_0x1607c7[_0x3abb('0x38')]=qs[_0x3abb('0x39')](_0x28ea3a['query'][_0x3abb('0x39')]);_0x1607c7['where']=qs[_0x3abb('0x30')](_[_0x3abb('0x3a')](_0x28ea3a[_0x3abb('0x2e')],_0x55ef89[_0x3abb('0x30')]),_0x4c3d35);if(_0x28ea3a[_0x3abb('0x2e')][_0x3abb('0x3b')]){_0x1607c7[_0x3abb('0x3c')]=_[_0x3abb('0x3d')](_0x1607c7[_0x3abb('0x3c')],{'$or':_[_0x3abb('0x29')](_0x4c3d35,function(_0x4da829){if(_0x4da829[_0x3abb('0x2d')]!=='VIRTUAL'){var _0x35595d={};_0x35595d[_0x4da829[_0x3abb('0x27')]]={'$like':'%'+_0x28ea3a[_0x3abb('0x2e')][_0x3abb('0x3b')]+'%'};return _0x35595d;}})});}_0x1607c7=_[_0x3abb('0x3d')]({},_0x1607c7,_0x28ea3a['options']);var _0x36ecfd={'where':_0x1607c7['where']};return db[_0x3abb('0x2a')][_0x3abb('0x1b')](_0x36ecfd)[_0x3abb('0x23')](function(_0x16df96){_0x5917c4[_0x3abb('0x1b')]=_0x16df96;if(_0x28ea3a['query'][_0x3abb('0x3e')]){_0x1607c7[_0x3abb('0x3f')]=[{'all':!![]}];}return db[_0x3abb('0x2a')][_0x3abb('0x40')](_0x1607c7);})[_0x3abb('0x23')](function(_0x3eff05){_0x5917c4[_0x3abb('0x41')]=_0x3eff05;return _0x5917c4;})['then'](respondWithFilteredResult(_0x3b74ae,_0x1607c7))[_0x3abb('0x42')](handleError(_0x3b74ae,null));};exports['show']=function(_0xe03bfe,_0x5ec310){var _0x48f7f3={'raw':!![],'where':{'id':_0xe03bfe[_0x3abb('0x43')]['id']}},_0x48adc4={};_0x48adc4['model']=_[_0x3abb('0x2f')](db[_0x3abb('0x2a')][_0x3abb('0x2b')]);_0x48adc4[_0x3abb('0x2e')]=_['keys'](_0xe03bfe['query']);_0x48adc4['filters']=_[_0x3abb('0x31')](_0x48adc4[_0x3abb('0x35')],_0x48adc4[_0x3abb('0x2e')]);_0x48f7f3[_0x3abb('0x32')]=_['intersection'](_0x48adc4[_0x3abb('0x35')],qs[_0x3abb('0x33')](_0xe03bfe[_0x3abb('0x2e')]['fields']));_0x48f7f3['attributes']=_0x48f7f3[_0x3abb('0x32')][_0x3abb('0x34')]?_0x48f7f3['attributes']:_0x48adc4[_0x3abb('0x35')];if(_0xe03bfe['query']['includeAll']){_0x48f7f3[_0x3abb('0x3f')]=[{'all':!![]}];}_0x48f7f3=_[_0x3abb('0x3d')]({},_0x48f7f3,_0xe03bfe['options']);return db[_0x3abb('0x2a')][_0x3abb('0x44')](_0x48f7f3)[_0x3abb('0x23')](handleEntityNotFound(_0x5ec310,null))['then'](respondWithResult(_0x5ec310,null))[_0x3abb('0x42')](handleError(_0x5ec310,null));};exports[_0x3abb('0x45')]=function(_0x4aa55d,_0x21c028){var _0x5b7f95={'where':{'id':_0x4aa55d['params']['id']}},_0x2beda7={};_0x2beda7[_0x3abb('0x35')]=_[_0x3abb('0x2f')](db['Attachment'][_0x3abb('0x2b')]);_0x5b7f95['attributes']=_[_0x3abb('0x31')](_0x2beda7['model'],qs[_0x3abb('0x33')](_0x4aa55d[_0x3abb('0x2e')]['fields']));_0x5b7f95[_0x3abb('0x32')]=_0x5b7f95['attributes'][_0x3abb('0x34')]?_0x5b7f95['attributes']:_0x2beda7[_0x3abb('0x35')];if(_0x4aa55d[_0x3abb('0x2e')][_0x3abb('0x3e')]){_0x5b7f95[_0x3abb('0x3f')]=[{'all':!![]}];}_0x5b7f95=_[_0x3abb('0x3d')]({},_0x5b7f95,_0x4aa55d[_0x3abb('0x46')]);return db[_0x3abb('0x2a')][_0x3abb('0x44')](_0x5b7f95)[_0x3abb('0x23')](handleEntityNotFound(_0x21c028,null))[_0x3abb('0x23')](function(_0x9ea20a){if(_0x9ea20a){var _0x4d6cea=_0x9ea20a[_0x3abb('0x47')]({'plain':!![]});_0x4d6cea=qs['omit'](_0x4d6cea,['id','createdAt',_0x3abb('0x48')]);_0x4aa55d[_0x3abb('0x49')]=_['omit'](_0x4aa55d[_0x3abb('0x49')],['id',_0x3abb('0x4a'),_0x3abb('0x48')]);return db[_0x3abb('0x2a')][_0x3abb('0x4b')](_[_0x3abb('0x3d')](_0x4d6cea,_0x4aa55d['body']),{'include':_0x4aa55d[_0x3abb('0x2e')][_0x3abb('0x3e')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x21c028,0xc9))['catch'](handleError(_0x21c028,null));};exports[_0x3abb('0x22')]=function(_0x4bc8bf,_0x29c4eb){if(_0x4bc8bf[_0x3abb('0x49')]['id']){delete _0x4bc8bf[_0x3abb('0x49')]['id'];}return db['Attachment'][_0x3abb('0x44')]({'where':{'id':_0x4bc8bf[_0x3abb('0x43')]['id']}})[_0x3abb('0x23')](handleEntityNotFound(_0x29c4eb,null))[_0x3abb('0x23')](saveUpdates(_0x4bc8bf[_0x3abb('0x49')],null))['then'](respondWithResult(_0x29c4eb,null))['catch'](handleError(_0x29c4eb,null));};exports[_0x3abb('0x24')]=function(_0x36ef54,_0x4e82b7){return db[_0x3abb('0x2a')][_0x3abb('0x44')]({'where':{'id':_0x36ef54[_0x3abb('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e82b7,null))[_0x3abb('0x23')](removeEntity(_0x4e82b7,null))[_0x3abb('0x42')](handleError(_0x4e82b7,null));};exports[_0x3abb('0x4b')]=function(_0x2cdef6,_0x4dc10f,_0x12a909){_0x2cdef6[_0x3abb('0x49')][_0x3abb('0x27')]=_0x2cdef6[_0x3abb('0x4c')][_0x3abb('0x4d')];_0x2cdef6[_0x3abb('0x49')][_0x3abb('0x4e')]=_0x2cdef6['file'][_0x3abb('0x4f')];_0x2cdef6[_0x3abb('0x49')][_0x3abb('0x2d')]=_0x2cdef6[_0x3abb('0x4c')][_0x3abb('0x50')];return db[_0x3abb('0x2a')]['create'](_0x2cdef6[_0x3abb('0x49')])[_0x3abb('0x23')](respondWithResult(_0x4dc10f,0xc9))[_0x3abb('0x42')](handleError(_0x4dc10f,null));};exports[_0x3abb('0x51')]=function(_0x54a7c4,_0x391d6f,_0x1bce63){return db['Attachment']['findOne']({'where':{'id':_0x54a7c4[_0x3abb('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x391d6f,null))[_0x3abb('0x23')](function(_0x3a3d91){if(_0x3a3d91){var _0x47617c=_0x3a3d91[_0x3abb('0x52')]!==null;var _0x3f39a6=path['join'](config[_0x3abb('0x53')],_0x3abb('0x54'));if(_0x47617c){_0x3f39a6=path[_0x3abb('0x55')](_0x3f39a6,'offline-chat/');}var _0x4d58ed=path['join'](_0x3f39a6,_0x3a3d91[_0x3abb('0x4e')]);return _0x391d6f[_0x3abb('0x51')](_0x4d58ed);}})['catch'](handleError(_0x391d6f,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 074b45b..fd81fb7 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 _0xa610=['util','../../config/logger','api','moment','bluebird','path','rimraf','./attachment.attributes','Attachment','attachments','lodash'];(function(_0x566476,_0x5cb80a){var _0x14ad48=function(_0x560fe0){while(--_0x560fe0){_0x566476['push'](_0x566476['shift']());}};_0x14ad48(++_0x5cb80a);}(_0xa610,0x149));var _0x0a61=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa610[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0a61('0x0'));var util=require(_0x0a61('0x1'));var logger=require(_0x0a61('0x2'))(_0x0a61('0x3'));var moment=require(_0x0a61('0x4'));var BPromise=require(_0x0a61('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a61('0x6'));var rimraf=require(_0x0a61('0x7'));var config=require('../../config/environment');var attributes=require(_0x0a61('0x8'));module['exports']=function(_0x48483c,_0x5bb91e){return _0x48483c['define'](_0x0a61('0x9'),attributes,{'tableName':_0x0a61('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6dd2=['path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','../../config/logger','api','moment','bluebird'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0x6dd2,0xce));var _0x26dd=function(_0x14cf42,_0x496bb3){_0x14cf42=_0x14cf42-0x0;var _0x31671a=_0x6dd2[_0x14cf42];return _0x31671a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x26dd('0x0'))(_0x26dd('0x1'));var moment=require(_0x26dd('0x2'));var BPromise=require(_0x26dd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x26dd('0x4'));var rimraf=require(_0x26dd('0x5'));var config=require(_0x26dd('0x6'));var attributes=require(_0x26dd('0x7'));module['exports']=function(_0x22572e,_0x5ec41a){return _0x22572e[_0x26dd('0x8')](_0x26dd('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index ec54dad..32d2a5c 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 _0xf46a=['http','then','request\x20sent','debug','stringify','error','code','Attachment,\x20%s,\x20%s','message','info','Attachment','create','options','CreateAttachment','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x42a058,_0x70c2e8){var _0x5787d4=function(_0x180e67){while(--_0x180e67){_0x42a058['push'](_0x42a058['shift']());}};_0x5787d4(++_0x70c2e8);}(_0xf46a,0xa4));var _0xaf46=function(_0x5baf32,_0x3ae37b){_0x5baf32=_0x5baf32-0x0;var _0x2eab43=_0xf46a[_0x5baf32];return _0x2eab43;};'use strict';var _=require(_0xaf46('0x0'));var util=require('util');var moment=require(_0xaf46('0x1'));var BPromise=require(_0xaf46('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf46('0x3'));var db=require(_0xaf46('0x4'))['db'];var utils=require(_0xaf46('0x5'));var logger=require(_0xaf46('0x6'))(_0xaf46('0x7'));var config=require(_0xaf46('0x8'));var jayson=require(_0xaf46('0x9'));var client=jayson[_0xaf46('0xa')][_0xaf46('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9e9887,_0x4f76cc,_0xa4a618){return new BPromise(function(_0x105943,_0x328d92){return client['request'](_0x9e9887,_0xa4a618)[_0xaf46('0xc')](function(_0x4e67c0){logger['info']('Attachment,\x20%s,\x20%s',_0x4f76cc,_0xaf46('0xd'));logger[_0xaf46('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0x4f76cc,_0xaf46('0xd'),JSON[_0xaf46('0xf')](_0x4e67c0));if(_0x4e67c0[_0xaf46('0x10')]){if(_0x4e67c0['error'][_0xaf46('0x11')]===0x1f4){logger['error'](_0xaf46('0x12'),_0x4f76cc,_0x4e67c0['error'][_0xaf46('0x13')]);return _0x328d92(_0x4e67c0['error'][_0xaf46('0x13')]);}logger[_0xaf46('0x10')](_0xaf46('0x12'),_0x4f76cc,_0x4e67c0[_0xaf46('0x10')][_0xaf46('0x13')]);return _0x105943(_0x4e67c0[_0xaf46('0x10')][_0xaf46('0x13')]);}else{logger[_0xaf46('0x14')]('Attachment,\x20%s,\x20%s',_0x4f76cc,'request\x20sent');_0x105943(_0x4e67c0['result'][_0xaf46('0x13')]);}})['catch'](function(_0x498720){logger[_0xaf46('0x10')](_0xaf46('0x12'),_0x4f76cc,_0x498720);_0x328d92(_0x498720);});});}exports['CreateAttachment']=function(_0x128ad8){var _0x3a26f1=this;return new Promise(function(_0x224413,_0xd1b9ce){return db[_0xaf46('0x15')][_0xaf46('0x16')](_0x128ad8['body'],{'raw':_0x128ad8[_0xaf46('0x17')]?_0x128ad8[_0xaf46('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xaf46('0xc')](function(_0x4459d5){logger['info']('CreateAttachment',_0x128ad8);logger['debug'](_0xaf46('0x18'),_0x128ad8,JSON[_0xaf46('0xf')](_0x4459d5));_0x224413(_0x4459d5);})['catch'](function(_0x183cb6){logger['error'](_0xaf46('0x18'),_0x183cb6[_0xaf46('0x13')],_0x128ad8);_0xd1b9ce(_0x3a26f1[_0xaf46('0x10')](0x1f4,_0x183cb6[_0xaf46('0x13')]));});});}; \ No newline at end of file +var _0x255f=['error','code','message','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3daff9,_0x1be9b9){var _0x1a8dd4=function(_0x5e78b0){while(--_0x5e78b0){_0x3daff9['push'](_0x3daff9['shift']());}};_0x1a8dd4(++_0x1be9b9);}(_0x255f,0x185));var _0xf255=function(_0x4293b5,_0x45689a){_0x4293b5=_0x4293b5-0x0;var _0xf27aee=_0x255f[_0x4293b5];return _0xf27aee;};'use strict';var _=require(_0xf255('0x0'));var util=require('util');var moment=require(_0xf255('0x1'));var BPromise=require(_0xf255('0x2'));var rs=require(_0xf255('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf255('0x4'))['db'];var utils=require(_0xf255('0x5'));var logger=require(_0xf255('0x6'))(_0xf255('0x7'));var config=require(_0xf255('0x8'));var jayson=require(_0xf255('0x9'));var client=jayson[_0xf255('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1236fb,_0x4b98fa,_0x481d8c){return new BPromise(function(_0x4a533f,_0x3cc3fc){return client['request'](_0x1236fb,_0x481d8c)[_0xf255('0xb')](function(_0x2f6020){logger['info'](_0xf255('0xc'),_0x4b98fa,'request\x20sent');logger[_0xf255('0xd')](_0xf255('0xe'),_0x4b98fa,_0xf255('0xf'),JSON[_0xf255('0x10')](_0x2f6020));if(_0x2f6020[_0xf255('0x11')]){if(_0x2f6020['error'][_0xf255('0x12')]===0x1f4){logger[_0xf255('0x11')](_0xf255('0xc'),_0x4b98fa,_0x2f6020['error'][_0xf255('0x13')]);return _0x3cc3fc(_0x2f6020[_0xf255('0x11')]['message']);}logger[_0xf255('0x11')](_0xf255('0xc'),_0x4b98fa,_0x2f6020[_0xf255('0x11')]['message']);return _0x4a533f(_0x2f6020[_0xf255('0x11')][_0xf255('0x13')]);}else{logger[_0xf255('0x14')](_0xf255('0xc'),_0x4b98fa,_0xf255('0xf'));_0x4a533f(_0x2f6020[_0xf255('0x15')]['message']);}})[_0xf255('0x16')](function(_0x4ed7c0){logger[_0xf255('0x11')]('Attachment,\x20%s,\x20%s',_0x4b98fa,_0x4ed7c0);_0x3cc3fc(_0x4ed7c0);});});}exports[_0xf255('0x17')]=function(_0x426286){var _0x45b51b=this;return new Promise(function(_0x43902c,_0x186558){return db[_0xf255('0x18')][_0xf255('0x19')](_0x426286[_0xf255('0x1a')],{'raw':_0x426286[_0xf255('0x1b')]?_0x426286[_0xf255('0x1b')][_0xf255('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2fe87d){logger[_0xf255('0x14')](_0xf255('0x17'),_0x426286);logger[_0xf255('0xd')](_0xf255('0x17'),_0x426286,JSON[_0xf255('0x10')](_0x2fe87d));_0x43902c(_0x2fe87d);})[_0xf255('0x16')](function(_0x5b9b5f){logger[_0xf255('0x11')](_0xf255('0x17'),_0x5b9b5f[_0xf255('0x13')],_0x426286);_0x186558(_0x45b51b[_0xf255('0x11')](0x1f4,_0x5b9b5f[_0xf255('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 8c4d98f..212874b 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x3edca9,_0x47b7f2){var _0x1ceba8=function(_0x520a73){while(--_0x520a73){_0x3edca9['push'](_0x3edca9['shift']());}};_0x1ceba8(++_0x47b7f2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3cc624,_0x388919){_0x3cc624=_0x3cc624-0x0;var _0xa12e2a=_0x5f2f[_0x3cc624];return _0xa12e2a;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x4ff960,_0x276049){var _0x4c90dd=function(_0x231069){while(--_0x231069){_0x4ff960['push'](_0x4ff960['shift']());}};_0x4c90dd(++_0x276049);}(_0xb10b,0x12a));var _0xbb10=function(_0x3a0585,_0x12062b){_0x3a0585=_0x3a0585-0x0;var _0xbdc3fc=_0xb10b[_0x3a0585];return _0xbdc3fc;};'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('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 3f670c2..0d2bb6a 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 _0x8e36=['domain','add','minutes','clearBlockUser','getLicense','catch','message','login','json','use','ad-login','User','passport','passport-local','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/environment','../../config/logger','api','undefined','activedirectory','baseDN','url','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online'];(function(_0x1b41c5,_0x6de6fd){var _0x1c0c8f=function(_0xd29b70){while(--_0xd29b70){_0x1b41c5['push'](_0x1b41c5['shift']());}};_0x1c0c8f(++_0x6de6fd);}(_0x8e36,0x1ce));var _0x68e3=function(_0x2bd8c3,_0x20968f){_0x2bd8c3=_0x2bd8c3-0x0;var _0x1c559f=_0x8e36[_0x2bd8c3];return _0x1c559f;};'use strict';var passport=require(_0x68e3('0x0'));var LocalStrategy=require(_0x68e3('0x1'))['Strategy'];var moment=require(_0x68e3('0x2'));var ActiveDirectory=require(_0x68e3('0x3'));var BPromise=require(_0x68e3('0x4'));var util=require(_0x68e3('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x68e3('0x6'));var utils=require('../../config/utils');var config=require(_0x68e3('0x7'));var logger=require(_0x68e3('0x8'))(_0x68e3('0x9'));function isActiveDirectoryConfigured(_0x42e67e){var _0x18e20e=![];if(typeof _0x42e67e['activedirectory']!==_0x68e3('0xa')){_0x18e20e=_0x42e67e[_0x68e3('0xb')][_0x68e3('0xc')]&&_0x42e67e['activedirectory'][_0x68e3('0xd')]&&_0x42e67e[_0x68e3('0xb')]['domain'];}return _0x18e20e;}function adAuthenticate(_0x3841fa,_0x541deb,_0x49d991){return new BPromise(function(_0xc6f626,_0x2d206b){try{var _0x342e11=new ActiveDirectory(_0x3841fa);_0x342e11['authenticate'](_0x541deb,_0x49d991,function(_0x328abf,_0x2412e4){if(_0x328abf){logger['error'](_0x68e3('0xe'),_0x541deb,util[_0x68e3('0xf')](_0x328abf,{'showHidden':![],'depth':null}));_0x2d206b(_0x68e3('0x10'));}else if(!_0x2412e4){logger[_0x68e3('0x11')](_0x68e3('0x12'),_0x541deb);_0x2d206b(_0x68e3('0x10'));}else{_0xc6f626(_0x2412e4);}});}catch(_0x216261){_0x2d206b(_0x216261);}});}function ActiveDirectoryAuthenticate(_0x9107f0,_0x2fc7c1,_0x276294,_0x6da79){var _0x580e89,_0x37efa9;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x2fc7c1);return _0x6da79(null,![],{'message':_0x68e3('0x10')});}return db[_0x68e3('0x13')][_0x68e3('0x14')]({'where':{'id':0x1},'attributes':[_0x68e3('0x15'),_0x68e3('0x16')],'raw':!![]})[_0x68e3('0x17')](function(_0x396629){_0x580e89=_0x396629;if(!_0x580e89['adSsoEnabled']){logger[_0x68e3('0x11')](_0x68e3('0x18'),_0x2fc7c1);throw new Error(_0x68e3('0x10'));}return _0x9107f0['findOne']({'attributes':['id',_0x68e3('0x19'),_0x68e3('0x1a'),_0x68e3('0x1b'),_0x68e3('0x1c'),_0x68e3('0x1d'),_0x68e3('0x1e'),_0x68e3('0x1f'),_0x68e3('0x20')],'where':{'name':_0x2fc7c1,'role':{'$or':['admin','user','agent']},'adSsoEnabled':!![]}});})['then'](function(_0x49284b){if(!_0x49284b||_0x49284b&&_0x49284b[_0x68e3('0x19')]!==_0x2fc7c1){throw new Error(_0x68e3('0x10'));}_0x37efa9=_0x49284b;var _0x3aa167=_0x37efa9[_0x68e3('0x19')]+'@'+config[_0x68e3('0xb')][_0x68e3('0x21')];return adAuthenticate(config['activedirectory'],_0x3aa167,_0x276294);})[_0x68e3('0x17')](function(_0x80bcda){if(_0x37efa9[_0x68e3('0x1d')]){throw new Error(_0x68e3('0x10'));}if(_0x580e89[_0x68e3('0x16')]>0x0){if(_0x37efa9[_0x68e3('0x1e')]){if(moment(_0x37efa9[_0x68e3('0x1f')])[_0x68e3('0x22')](_0x580e89[_0x68e3('0x16')],_0x68e3('0x23'))>moment()){throw new Error(_0x68e3('0x10'));}return utils[_0x68e3('0x24')](_0x37efa9,0x0,![],null)[_0x68e3('0x17')](function(){return utils['getLicense'](_0x37efa9);})[_0x68e3('0x17')](function(){return _0x6da79(null,_0x37efa9);});}else{return utils[_0x68e3('0x25')](_0x37efa9)[_0x68e3('0x17')](function(){return _0x6da79(null,_0x37efa9);});}}else{return utils[_0x68e3('0x25')](_0x37efa9)[_0x68e3('0x17')](function(){return _0x6da79(null,_0x37efa9);});}})[_0x68e3('0x26')](function(_0x492567){return _0x6da79(null,![],_0x492567);});}function handleError(_0x35256f,_0x1f105f,_0x7219d0){return _0x35256f['status'](_0x1f105f||0x1f4)['send']({'message':_0x7219d0?_0x7219d0[_0x68e3('0x27')]||_0x7219d0:''});}exports[_0x68e3('0x28')]=function(_0x478387,_0x512664,_0x38a482){passport['authenticate']('ad-login',function(_0x57869d,_0x5461d4,_0x39bd94){var _0xceb23d=_0x57869d||_0x39bd94;if(_0xceb23d){return handleError(_0x512664,0x191,_0xceb23d);}if(!_0x5461d4){return handleError(_0x512664,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4b16fe={'payload':{'id':_0x5461d4['id'],'role':_0x5461d4[_0x68e3('0x1c')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4b16fe)[_0x68e3('0x17')](function(_0x3d50f8){_0x512664[_0x68e3('0x29')]({'id':_0x5461d4['id'],'token':_0x3d50f8,'statusCall':'','isAlreadyLogged':_0x5461d4['online']});});}})(_0x478387,_0x512664,_0x38a482);};passport[_0x68e3('0x2a')](_0x68e3('0x2b'),new LocalStrategy({'usernameField':_0x68e3('0x19'),'passwordField':_0x68e3('0x1a')},function(_0x17a6f4,_0x150fd7,_0x29f4b4){return ActiveDirectoryAuthenticate(db[_0x68e3('0x2c')],_0x17a6f4,_0x150fd7,_0x29f4b4);})); \ No newline at end of file +var _0xc9d3=['passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','url','domain','authenticate','error','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','role','disabled','online','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','password'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc9d3,0xe1));var _0x3c9d=function(_0x333c10,_0x519ae7){_0x333c10=_0x333c10-0x0;var _0x592378=_0xc9d3[_0x333c10];return _0x592378;};'use strict';var passport=require(_0x3c9d('0x0'));var LocalStrategy=require(_0x3c9d('0x1'))[_0x3c9d('0x2')];var moment=require(_0x3c9d('0x3'));var ActiveDirectory=require(_0x3c9d('0x4'));var BPromise=require('bluebird');var util=require(_0x3c9d('0x5'));var db=require(_0x3c9d('0x6'))['db'];var authService=require(_0x3c9d('0x7'));var utils=require(_0x3c9d('0x8'));var config=require(_0x3c9d('0x9'));var logger=require(_0x3c9d('0xa'))('api');function isActiveDirectoryConfigured(_0x2dc65e){var _0x58bb8c=![];if(typeof _0x2dc65e[_0x3c9d('0xb')]!=='undefined'){_0x58bb8c=_0x2dc65e[_0x3c9d('0xb')]['baseDN']&&_0x2dc65e['activedirectory'][_0x3c9d('0xc')]&&_0x2dc65e[_0x3c9d('0xb')][_0x3c9d('0xd')];}return _0x58bb8c;}function adAuthenticate(_0x6592e2,_0x3b4973,_0x396dfd){return new BPromise(function(_0x41bb35,_0x4acee6){try{var _0x5f4be0=new ActiveDirectory(_0x6592e2);_0x5f4be0[_0x3c9d('0xe')](_0x3b4973,_0x396dfd,function(_0x482d79,_0x3a30a3){if(_0x482d79){logger[_0x3c9d('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x3b4973,util[_0x3c9d('0x10')](_0x482d79,{'showHidden':![],'depth':null}));_0x4acee6('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x3a30a3){logger[_0x3c9d('0xf')](_0x3c9d('0x11'),_0x3b4973);_0x4acee6('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x41bb35(_0x3a30a3);}});}catch(_0x1f8ae2){_0x4acee6(_0x1f8ae2);}});}function ActiveDirectoryAuthenticate(_0x341d6e,_0x4ddcd8,_0x1f049f,_0x2eff0c){var _0x4364d8,_0x1b9844;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x3c9d('0x12'),_0x4ddcd8);return _0x2eff0c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db['Setting'][_0x3c9d('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x3c9d('0x14')],'raw':!![]})[_0x3c9d('0x15')](function(_0x2c59e8){_0x4364d8=_0x2c59e8;if(!_0x4364d8[_0x3c9d('0x16')]){logger[_0x3c9d('0xf')](_0x3c9d('0x17'),_0x4ddcd8);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x341d6e[_0x3c9d('0x13')]({'attributes':['id',_0x3c9d('0x18'),'password','salt',_0x3c9d('0x19'),_0x3c9d('0x1a'),'blocked','blockedAt',_0x3c9d('0x1b')],'where':{'name':_0x4ddcd8,'role':{'$or':[_0x3c9d('0x1c'),_0x3c9d('0x1d'),_0x3c9d('0x1e')]},'adSsoEnabled':!![]}});})['then'](function(_0x2d8651){if(!_0x2d8651||_0x2d8651&&_0x2d8651[_0x3c9d('0x18')]!==_0x4ddcd8){throw new Error(_0x3c9d('0x1f'));}_0x1b9844=_0x2d8651;var _0x5cb4b2=_0x1b9844[_0x3c9d('0x18')]+'@'+config[_0x3c9d('0xb')][_0x3c9d('0xd')];return adAuthenticate(config['activedirectory'],_0x5cb4b2,_0x1f049f);})[_0x3c9d('0x15')](function(_0x53c5ac){if(_0x1b9844['disabled']){throw new Error(_0x3c9d('0x1f'));}if(_0x4364d8[_0x3c9d('0x14')]>0x0){if(_0x1b9844[_0x3c9d('0x20')]){if(moment(_0x1b9844['blockedAt'])[_0x3c9d('0x21')](_0x4364d8['blockDuration'],'minutes')>moment()){throw new Error(_0x3c9d('0x1f'));}return utils['clearBlockUser'](_0x1b9844,0x0,![],null)[_0x3c9d('0x15')](function(){return utils[_0x3c9d('0x22')](_0x1b9844);})['then'](function(){return _0x2eff0c(null,_0x1b9844);});}else{return utils[_0x3c9d('0x22')](_0x1b9844)[_0x3c9d('0x15')](function(){return _0x2eff0c(null,_0x1b9844);});}}else{return utils[_0x3c9d('0x22')](_0x1b9844)[_0x3c9d('0x15')](function(){return _0x2eff0c(null,_0x1b9844);});}})[_0x3c9d('0x23')](function(_0x337052){return _0x2eff0c(null,![],_0x337052);});}function handleError(_0x5727eb,_0x33dee1,_0xc38f63){return _0x5727eb[_0x3c9d('0x24')](_0x33dee1||0x1f4)[_0x3c9d('0x25')]({'message':_0xc38f63?_0xc38f63[_0x3c9d('0x26')]||_0xc38f63:''});}exports[_0x3c9d('0x27')]=function(_0x1eb545,_0x45d90d,_0x4c25b8){passport[_0x3c9d('0xe')](_0x3c9d('0x28'),function(_0x2873db,_0x2a06b4,_0xec394){var _0x265b6c=_0x2873db||_0xec394;if(_0x265b6c){return handleError(_0x45d90d,0x191,_0x265b6c);}if(!_0x2a06b4){return handleError(_0x45d90d,0x194,{'message':_0x3c9d('0x29')});}else{var _0x3ae73d={'payload':{'id':_0x2a06b4['id'],'role':_0x2a06b4[_0x3c9d('0x19')]},'options':{'expiresIn':0x15180}};return authService[_0x3c9d('0x2a')](_0x3ae73d)['then'](function(_0x93f556){_0x45d90d['json']({'id':_0x2a06b4['id'],'token':_0x93f556,'statusCall':'','isAlreadyLogged':_0x2a06b4[_0x3c9d('0x1b')]});});}})(_0x1eb545,_0x45d90d,_0x4c25b8);};passport[_0x3c9d('0x2b')](_0x3c9d('0x28'),new LocalStrategy({'usernameField':_0x3c9d('0x18'),'passwordField':_0x3c9d('0x2c')},function(_0x1bff33,_0xe0d052,_0x3038a6){return ActiveDirectoryAuthenticate(db['User'],_0x1bff33,_0xe0d052,_0x3038a6);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index d365140..ed74722 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 _0x3879=['post','exports','Router','./authActiveDirectory.controller'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x3879,0xfe));var _0x9387=function(_0x5cc4ac,_0x31bd5e){_0x5cc4ac=_0x5cc4ac-0x0;var _0x909a46=_0x3879[_0x5cc4ac];return _0x909a46;};'use strict';var express=require('express');var router=express[_0x9387('0x0')]();var controller=require(_0x9387('0x1'));router[_0x9387('0x2')]('/',controller['login']);module[_0x9387('0x3')]=router; \ No newline at end of file +var _0x2542=['exports','./authActiveDirectory.controller','post','login'];(function(_0x49805c,_0x25258b){var _0x881f59=function(_0x5e1ad9){while(--_0x5e1ad9){_0x49805c['push'](_0x49805c['shift']());}};_0x881f59(++_0x25258b);}(_0x2542,0x181));var _0x2254=function(_0x3a0b12,_0x4179d4){_0x3a0b12=_0x3a0b12-0x0;var _0x3c2efe=_0x2542[_0x3a0b12];return _0x3c2efe;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x2254('0x0'));router[_0x2254('0x1')]('/',controller[_0x2254('0x2')]);module[_0x2254('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index ccc408c..9a515b6 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(_0x5a20fa,_0x76391d){var _0x3cfb93=function(_0x51c452){while(--_0x51c452){_0x5a20fa['push'](_0x5a20fa['shift']());}};_0x3cfb93(++_0x76391d);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 _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(_0x3d773f,_0x3462b3){var _0x22bf3a=function(_0x2d295e){while(--_0x2d295e){_0x3d773f['push'](_0x3d773f['shift']());}};_0x22bf3a(++_0x3462b3);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 77a6008..e448c5e 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 _0x7a4c=['exports','express','passport','Router','../user/user.controller.js','get','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x3369b5,_0x49c485){var _0x478e7a=function(_0x434e36){while(--_0x434e36){_0x3369b5['push'](_0x3369b5['shift']());}};_0x478e7a(++_0x49c485);}(_0x7a4c,0x1cf));var _0xc7a4=function(_0x2c21fa,_0x5f0a10){_0x2c21fa=_0x2c21fa-0x0;var _0x5aafc6=_0x7a4c[_0x2c21fa];return _0x5aafc6;};'use strict';var express=require(_0xc7a4('0x0'));var passport=require(_0xc7a4('0x1'));var router=express[_0xc7a4('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xc7a4('0x3'));var authService=require('../../components/auth/service');router[_0xc7a4('0x4')]('/',controller[_0xc7a4('0x5')]);router[_0xc7a4('0x4')](_0xc7a4('0x6'),controller[_0xc7a4('0x7')],authService[_0xc7a4('0x8')],userController[_0xc7a4('0x5')],authService[_0xc7a4('0x9')]);module[_0xc7a4('0xa')]=router; \ No newline at end of file +var _0x7fad=['login','/callback','callback','isMiddleware','exports','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x369dac,_0x8261c1){var _0x2be5b2=function(_0x331384){while(--_0x331384){_0x369dac['push'](_0x369dac['shift']());}};_0x2be5b2(++_0x8261c1);}(_0x7fad,0x1db));var _0xd7fa=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x7fad[_0x4eafed];return _0x159c85;};'use strict';var express=require('express');var passport=require(_0xd7fa('0x0'));var router=express['Router']();var controller=require(_0xd7fa('0x1'));var userController=require(_0xd7fa('0x2'));var authService=require(_0xd7fa('0x3'));router[_0xd7fa('0x4')]('/',controller[_0xd7fa('0x5')]);router[_0xd7fa('0x4')](_0xd7fa('0x6'),controller[_0xd7fa('0x7')],authService[_0xd7fa('0x8')],userController[_0xd7fa('0x5')],authService['setTokenCookie']);module[_0xd7fa('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index d614179..acac6e7 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 _0x13be=['SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','json','online','forgot','body','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','then','password','role','blocked','blockedAt','loginAttempts','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blockDuration','add','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13be,0x7d));var _0xe13b=function(_0x47505b,_0xf838db){_0x47505b=_0x47505b-0x0;var _0x318935=_0x13be[_0x47505b];return _0x318935;};'use strict';var util=require('util');var passport=require(_0xe13b('0x0'));var LocalStrategy=require(_0xe13b('0x1'))[_0xe13b('0x2')];var jayson=require(_0xe13b('0x3'));var _=require('lodash');var rs=require(_0xe13b('0x4'));var moment=require(_0xe13b('0x5'));var db=require(_0xe13b('0x6'))['db'];var authService=require(_0xe13b('0x7'));var utils=require(_0xe13b('0x8'));var client=jayson[_0xe13b('0x9')][_0xe13b('0xa')]({'port':0x232b});function localAuthenticate(_0x5eb5a2,_0x44b112,_0x55bef2,_0x347f5a){var _0x270636,_0x4ac70f;return db['Setting'][_0xe13b('0xb')]({'where':{'id':0x1},'attributes':[_0xe13b('0xc'),'blockDuration'],'raw':!![]})[_0xe13b('0xd')](function(_0x3e557e){_0x270636=_0x3e557e;return _0x5eb5a2[_0xe13b('0xb')]({'attributes':['id','name',_0xe13b('0xe'),'salt',_0xe13b('0xf'),'disabled',_0xe13b('0x10'),_0xe13b('0x11'),_0xe13b('0x12')],'where':{'name':_0x44b112,'role':{'$or':['admin',_0xe13b('0x13'),_0xe13b('0x14')]}}});})[_0xe13b('0xd')](function(_0x18978b){if(!_0x18978b||_0x18978b&&_0x18978b[_0xe13b('0x15')]!==_0x44b112){throw new Error(_0xe13b('0x16'));}else{_0x4ac70f=_0x18978b;return _0x4ac70f;}})['then'](function(){_0x4ac70f[_0xe13b('0x17')](_0x55bef2,function(_0x24e39c,_0x4108b0){var _0x38f83e=_0x4ac70f[_0xe13b('0x12')]+0x1;if(_0x24e39c){return _0x347f5a(_0x24e39c);}else if(!_0x4108b0){if(_0x4ac70f[_0xe13b('0x18')]){return _0x347f5a(null,![],{'message':_0xe13b('0x16')});}else if(_0x270636[_0xe13b('0xc')]>0x0){if(_0x4ac70f[_0xe13b('0x10')]){if(_0x270636[_0xe13b('0x19')]>0x0){if(moment(_0x4ac70f[_0xe13b('0x11')])[_0xe13b('0x1a')](_0x270636['blockDuration'],_0xe13b('0x1b'))>moment()){return _0x347f5a(null,![],{'message':_0xe13b('0x16')});}else{return utils[_0xe13b('0x1c')](_0x4ac70f,_0x38f83e,![],null)[_0xe13b('0xd')](function(){return _0x347f5a(null,![],{'message':_0xe13b('0x16')});});}}else{return _0x347f5a(null,![],{'message':_0xe13b('0x16')});}}else{if(_0x38f83e>=_0x270636[_0xe13b('0xc')]){return utils[_0xe13b('0x1c')](_0x4ac70f,0x0,!![],moment())[_0xe13b('0xd')](function(){return _0x347f5a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x4ac70f,_0x38f83e,![],null)['then'](function(){return _0x347f5a(null,![],{'message':_0xe13b('0x16')});});}}}else{return _0x347f5a(null,![],{'message':_0xe13b('0x16')});}}else{if(_0x4ac70f[_0xe13b('0x18')]){return _0x347f5a(null,![],{'message':_0xe13b('0x16')});}else if(_0x270636[_0xe13b('0xc')]>0x0){if(_0x4ac70f[_0xe13b('0x10')]){if(_0x270636[_0xe13b('0x19')]>0x0){if(moment(_0x4ac70f['blockedAt'])[_0xe13b('0x1a')](_0x270636[_0xe13b('0x19')],'minutes')>moment()){return _0x347f5a(null,![],{'message':_0xe13b('0x16')});}else{return utils[_0xe13b('0x1c')](_0x4ac70f,0x0,![],null)['then'](function(){return utils[_0xe13b('0x1d')](_0x4ac70f);})[_0xe13b('0xd')](function(){return _0x347f5a(null,_0x4ac70f);});}}else{return _0x347f5a(null,![],{'message':_0xe13b('0x16')});}}else{return utils['clearBlockUser'](_0x4ac70f,0x0,![],null)[_0xe13b('0xd')](function(){return utils[_0xe13b('0x1d')](_0x4ac70f);})[_0xe13b('0xd')](function(){return _0x347f5a(null,_0x4ac70f);})[_0xe13b('0x1e')](function(_0x43c3cc){return _0x347f5a(null,![],_0x43c3cc);});}}else{if(_0x4ac70f[_0xe13b('0x10')]){return _0x347f5a(null,![],{'message':_0xe13b('0x16')});}else{return utils[_0xe13b('0x1d')](_0x4ac70f)['then'](function(){return _0x347f5a(null,_0x4ac70f);});}}}});})[_0xe13b('0x1e')](function(_0x3a6bbb){return _0x347f5a(null,![],_0x3a6bbb);});}function sendServiceMail(_0x4ff256){return db['MailAccount'][_0xe13b('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xe13b('0x15'),_0xe13b('0x20')],'include':[{'model':db[_0xe13b('0x21')],'as':_0xe13b('0x22'),'include':[{'model':db[_0xe13b('0x23')],'as':_0xe13b('0x23')}]}]})[_0xe13b('0xd')](function(_0x4cd810){if(!_0x4cd810){throw new Error(_0xe13b('0x24'));}var _0x4963d4=_0x4cd810[_0xe13b('0x25')]();var _0x33dad7={'account':_0x4963d4,'message':_[_0xe13b('0x26')]({'from':util[_0xe13b('0x27')](_0xe13b('0x28'),_0x4cd810[_0xe13b('0x15')],_0x4cd810[_0xe13b('0x20')]||_0x4cd810[_0xe13b('0x22')][_0xe13b('0x13')])},_0x4ff256)};return client[_0xe13b('0x29')]('SendMail',_0x33dad7);})[_0xe13b('0xd')](function(_0x17b676){if(_0x17b676[_0xe13b('0x2a')]){throw new Error(util['format'](_0xe13b('0x2b'),_0x17b676['error'][_0xe13b('0x2c')]||JSON[_0xe13b('0x2d')](_0x17b676[_0xe13b('0x2a')])));}return!![];});}function handleError(_0x1b730a,_0x5bddd7,_0x15eaa1){return _0x1b730a[_0xe13b('0x2e')](_0x5bddd7||0x1f4)[_0xe13b('0x2f')]({'message':_0x15eaa1?_0x15eaa1[_0xe13b('0x2c')]||_0x15eaa1:''});}exports[_0xe13b('0x30')]=function(_0x99c78c,_0x255b72,_0x1b2d50){passport['authenticate'](_0xe13b('0x31'),function(_0x3da805,_0x425a51,_0x54c38c){var _0x1fcb63=_0x3da805||_0x54c38c;if(_0x1fcb63){return handleError(_0x255b72,0x191,_0x1fcb63);}if(!_0x425a51){return handleError(_0x255b72,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4c776b={'payload':{'id':_0x425a51['id'],'role':_0x425a51[_0xe13b('0xf')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4c776b)['then'](function(_0x2f7bf1){_0x255b72[_0xe13b('0x32')]({'id':_0x425a51['id'],'token':_0x2f7bf1,'statusCall':'','isAlreadyLogged':_0x425a51[_0xe13b('0x33')]});});}})(_0x99c78c,_0x255b72,_0x1b2d50);};exports[_0xe13b('0x34')]=function(_0x302246,_0x2345ac){if(!_0x302246[_0xe13b('0x35')][_0xe13b('0x20')]){return handleError(_0x2345ac,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x2a54b3=rs[_0xe13b('0x36')]();_0x302246[_0xe13b('0x35')][_0xe13b('0x20')]=_0x302246[_0xe13b('0x35')]['email'][_0xe13b('0x37')]()[_0xe13b('0x38')]();var _0x2b5f52;return db[_0xe13b('0x39')][_0xe13b('0xb')]({'where':{'id':0x1},'attributes':[_0xe13b('0xc'),_0xe13b('0x19')],'raw':!![]})[_0xe13b('0xd')](function(_0x4aed39){_0x2b5f52=_0x4aed39;return db[_0xe13b('0x3a')][_0xe13b('0x1f')]({'where':{'email':_0x302246[_0xe13b('0x35')][_0xe13b('0x20')]}});})[_0xe13b('0xd')](function(_0x54da8a){if(!_0x54da8a){throw new Error(_0xe13b('0x3b'));}if(_0x54da8a[_0xe13b('0x18')]){throw new Error(_0xe13b('0x3c'));}if(_0x54da8a[_0xe13b('0x10')]){if(moment(_0x54da8a[_0xe13b('0x11')])[_0xe13b('0x1a')](_0x2b5f52['blockDuration'],_0xe13b('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x54da8a[_0xe13b('0x10')]=![];_0x54da8a[_0xe13b('0x11')]=null;}}_0x54da8a[_0xe13b('0x3d')]=_0x2a54b3;_0x54da8a[_0xe13b('0x3e')]=Date[_0xe13b('0x3f')]()+0x36ee80;return _0x54da8a[_0xe13b('0x40')]();})[_0xe13b('0xd')](function(){return sendServiceMail({'to':_0x302246[_0xe13b('0x35')][_0xe13b('0x20')],'subject':_0xe13b('0x41'),'text':_0xe13b('0x42')+_0xe13b('0x43')+_0xe13b('0x44')+_0x302246[_0xe13b('0x45')][_0xe13b('0x46')]+_0xe13b('0x47')+_0x2a54b3+'\x0a\x0a'+_0xe13b('0x48')});})[_0xe13b('0xd')](function(){_0x2345ac['status'](0xc8)[_0xe13b('0x2f')]({'message':'Reset\x20Email\x20sent!'});})[_0xe13b('0x1e')](function(_0x4e2133){return handleError(_0x2345ac,0x1f4,_0x4e2133);});};exports['reset']=function(_0x1dbcdf,_0x4204b0){return db[_0xe13b('0x3a')][_0xe13b('0x1f')]({'where':{'resetPasswordToken':_0x1dbcdf[_0xe13b('0x49')][_0xe13b('0x4a')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xe13b('0xd')](function(_0x2b0f54){if(!_0x2b0f54){throw new Error(_0xe13b('0x4b'));}return db['Setting'][_0xe13b('0xb')]({'attributes':['id',_0xe13b('0x4c'),_0xe13b('0x4d'),_0xe13b('0x4e')]})[_0xe13b('0xd')](function(_0x40b236){if(_0x40b236[_0xe13b('0x4c')])authService[_0xe13b('0x4f')](_0x1dbcdf['body']['password']);if(!_0x40b236[_0xe13b('0x4d')]||!_0x2b0f54[_0xe13b('0x50')])return _0x2b0f54;authService[_0xe13b('0x51')](_0x1dbcdf['body'][_0xe13b('0xe')],_0x2b0f54['previousPasswords'],_0x40b236['passwordHistoryLimit']);return _0x2b0f54;})[_0xe13b('0xd')](function(){_0x2b0f54['password']=_0x1dbcdf[_0xe13b('0x35')]['password'];_0x2b0f54['resetPasswordToken']=null;_0x2b0f54[_0xe13b('0x3e')]=null;return _0x2b0f54['save']();});})[_0xe13b('0xd')](function(){_0x4204b0[_0xe13b('0x2e')](0xc8)[_0xe13b('0x2f')]({'message':_0xe13b('0x52')});})[_0xe13b('0x1e')](function(_0xf6b3b){return handleError(_0x4204b0,0x1f4,_0xf6b3b);});};passport[_0xe13b('0x53')](_0xe13b('0x31'),new LocalStrategy({'usernameField':_0xe13b('0x15'),'passwordField':_0xe13b('0xe')},function(_0x44f9c3,_0xbbfbb4,_0x453ecc){return localAuthenticate(db[_0xe13b('0x3a')],_0x44f9c3,_0xbbfbb4,_0x453ecc);})); \ No newline at end of file +var _0x1a0f=['local-login','signToken','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','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','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','findOne','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message'];(function(_0x4534e3,_0x56de6e){var _0x50c3a3=function(_0xb4117f){while(--_0xb4117f){_0x4534e3['push'](_0x4534e3['shift']());}};_0x50c3a3(++_0x56de6e);}(_0x1a0f,0x1c8));var _0xf1a0=function(_0x25ff4a,_0x423dd3){_0x25ff4a=_0x25ff4a-0x0;var _0x5a689b=_0x1a0f[_0x25ff4a];return _0x5a689b;};'use strict';var util=require('util');var passport=require(_0xf1a0('0x0'));var LocalStrategy=require(_0xf1a0('0x1'))[_0xf1a0('0x2')];var jayson=require(_0xf1a0('0x3'));var _=require(_0xf1a0('0x4'));var rs=require('randomstring');var moment=require(_0xf1a0('0x5'));var db=require(_0xf1a0('0x6'))['db'];var authService=require(_0xf1a0('0x7'));var utils=require(_0xf1a0('0x8'));var client=jayson['client'][_0xf1a0('0x9')]({'port':0x232b});function localAuthenticate(_0x4069ca,_0x160224,_0x4c95e7,_0x41b5e2){var _0x19dc1c,_0x515959;return db['Setting'][_0xf1a0('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf1a0('0xb')],'raw':!![]})[_0xf1a0('0xc')](function(_0x445699){_0x19dc1c=_0x445699;return _0x4069ca['findOne']({'attributes':['id',_0xf1a0('0xd'),_0xf1a0('0xe'),_0xf1a0('0xf'),_0xf1a0('0x10'),_0xf1a0('0x11'),_0xf1a0('0x12'),_0xf1a0('0x13'),_0xf1a0('0x14')],'where':{'name':_0x160224,'role':{'$or':[_0xf1a0('0x15'),_0xf1a0('0x16'),_0xf1a0('0x17')]}}});})['then'](function(_0x27627b){if(!_0x27627b||_0x27627b&&_0x27627b[_0xf1a0('0xd')]!==_0x160224){throw new Error(_0xf1a0('0x18'));}else{_0x515959=_0x27627b;return _0x515959;}})['then'](function(){_0x515959[_0xf1a0('0x19')](_0x4c95e7,function(_0x19b5dc,_0x4213ae){var _0x217908=_0x515959[_0xf1a0('0x14')]+0x1;if(_0x19b5dc){return _0x41b5e2(_0x19b5dc);}else if(!_0x4213ae){if(_0x515959[_0xf1a0('0x11')]){return _0x41b5e2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x19dc1c[_0xf1a0('0x1a')]>0x0){if(_0x515959[_0xf1a0('0x12')]){if(_0x19dc1c[_0xf1a0('0xb')]>0x0){if(moment(_0x515959['blockedAt'])['add'](_0x19dc1c[_0xf1a0('0xb')],_0xf1a0('0x1b'))>moment()){return _0x41b5e2(null,![],{'message':_0xf1a0('0x18')});}else{return utils['clearBlockUser'](_0x515959,_0x217908,![],null)[_0xf1a0('0xc')](function(){return _0x41b5e2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x41b5e2(null,![],{'message':_0xf1a0('0x18')});}}else{if(_0x217908>=_0x19dc1c[_0xf1a0('0x1a')]){return utils[_0xf1a0('0x1c')](_0x515959,0x0,!![],moment())[_0xf1a0('0xc')](function(){return _0x41b5e2(null,![],{'message':_0xf1a0('0x18')});});}else{return utils[_0xf1a0('0x1c')](_0x515959,_0x217908,![],null)[_0xf1a0('0xc')](function(){return _0x41b5e2(null,![],{'message':_0xf1a0('0x18')});});}}}else{return _0x41b5e2(null,![],{'message':_0xf1a0('0x18')});}}else{if(_0x515959['disabled']){return _0x41b5e2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x19dc1c['allowedLoginAttempts']>0x0){if(_0x515959['blocked']){if(_0x19dc1c[_0xf1a0('0xb')]>0x0){if(moment(_0x515959['blockedAt'])[_0xf1a0('0x1d')](_0x19dc1c[_0xf1a0('0xb')],'minutes')>moment()){return _0x41b5e2(null,![],{'message':_0xf1a0('0x18')});}else{return utils[_0xf1a0('0x1c')](_0x515959,0x0,![],null)['then'](function(){return utils[_0xf1a0('0x1e')](_0x515959);})[_0xf1a0('0xc')](function(){return _0x41b5e2(null,_0x515959);});}}else{return _0x41b5e2(null,![],{'message':_0xf1a0('0x18')});}}else{return utils[_0xf1a0('0x1c')](_0x515959,0x0,![],null)[_0xf1a0('0xc')](function(){return utils[_0xf1a0('0x1e')](_0x515959);})[_0xf1a0('0xc')](function(){return _0x41b5e2(null,_0x515959);})[_0xf1a0('0x1f')](function(_0x18377c){return _0x41b5e2(null,![],_0x18377c);});}}else{if(_0x515959[_0xf1a0('0x12')]){return _0x41b5e2(null,![],{'message':_0xf1a0('0x18')});}else{return utils['getLicense'](_0x515959)[_0xf1a0('0xc')](function(){return _0x41b5e2(null,_0x515959);});}}}});})[_0xf1a0('0x1f')](function(_0x6e5251){return _0x41b5e2(null,![],_0x6e5251);});}function sendServiceMail(_0x5d60c2){return db[_0xf1a0('0x20')][_0xf1a0('0x21')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0xf1a0('0x22')],'as':_0xf1a0('0x23'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})[_0xf1a0('0xc')](function(_0x3b1a45){if(!_0x3b1a45){throw new Error(_0xf1a0('0x24'));}var _0x38d88e=_0x3b1a45[_0xf1a0('0x25')]();var _0x385324={'account':_0x38d88e,'message':_[_0xf1a0('0x26')]({'from':util[_0xf1a0('0x27')](_0xf1a0('0x28'),_0x3b1a45[_0xf1a0('0xd')],_0x3b1a45[_0xf1a0('0x29')]||_0x3b1a45['Smtp'][_0xf1a0('0x16')])},_0x5d60c2)};return client[_0xf1a0('0x2a')]('SendMail',_0x385324);})[_0xf1a0('0xc')](function(_0x1f798b){if(_0x1f798b[_0xf1a0('0x2b')]){throw new Error(util[_0xf1a0('0x27')](_0xf1a0('0x2c'),_0x1f798b['error']['message']||JSON[_0xf1a0('0x2d')](_0x1f798b[_0xf1a0('0x2b')])));}return!![];});}function handleError(_0x56cf4a,_0x557558,_0x123a7d){return _0x56cf4a['status'](_0x557558||0x1f4)[_0xf1a0('0x2e')]({'message':_0x123a7d?_0x123a7d[_0xf1a0('0x2f')]||_0x123a7d:''});}exports['login']=function(_0x41e8f7,_0x474819,_0x1b9b71){passport[_0xf1a0('0x19')](_0xf1a0('0x30'),function(_0x1f8abf,_0xdb99f8,_0x8f2097){var _0x497cb9=_0x1f8abf||_0x8f2097;if(_0x497cb9){return handleError(_0x474819,0x191,_0x497cb9);}if(!_0xdb99f8){return handleError(_0x474819,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4d1d53={'payload':{'id':_0xdb99f8['id'],'role':_0xdb99f8[_0xf1a0('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xf1a0('0x31')](_0x4d1d53)[_0xf1a0('0xc')](function(_0x3edceb){_0x474819['json']({'id':_0xdb99f8['id'],'token':_0x3edceb,'statusCall':'','isAlreadyLogged':_0xdb99f8[_0xf1a0('0x32')]});});}})(_0x41e8f7,_0x474819,_0x1b9b71);};exports['forgot']=function(_0x524ab8,_0x85ea84){if(!_0x524ab8[_0xf1a0('0x33')]['email']){return handleError(_0x85ea84,0x1f4,{'message':_0xf1a0('0x34')});}var _0x27a78b=rs[_0xf1a0('0x35')]();_0x524ab8[_0xf1a0('0x33')][_0xf1a0('0x29')]=_0x524ab8['body'][_0xf1a0('0x29')][_0xf1a0('0x36')]()[_0xf1a0('0x37')]();var _0x181c2f;return db[_0xf1a0('0x38')][_0xf1a0('0xa')]({'where':{'id':0x1},'attributes':[_0xf1a0('0x1a'),_0xf1a0('0xb')],'raw':!![]})[_0xf1a0('0xc')](function(_0x280692){_0x181c2f=_0x280692;return db[_0xf1a0('0x39')]['find']({'where':{'email':_0x524ab8[_0xf1a0('0x33')][_0xf1a0('0x29')]}});})[_0xf1a0('0xc')](function(_0xf39a36){if(!_0xf39a36){throw new Error(_0xf1a0('0x3a'));}if(_0xf39a36['disabled']){throw new Error(_0xf1a0('0x3b'));}if(_0xf39a36[_0xf1a0('0x12')]){if(moment(_0xf39a36[_0xf1a0('0x13')])[_0xf1a0('0x1d')](_0x181c2f['blockDuration'],'minutes')>moment()){throw new Error(_0xf1a0('0x3c'));}else{_0xf39a36['blocked']=![];_0xf39a36['blockedAt']=null;}}_0xf39a36['resetPasswordToken']=_0x27a78b;_0xf39a36[_0xf1a0('0x3d')]=Date[_0xf1a0('0x3e')]()+0x36ee80;return _0xf39a36[_0xf1a0('0x3f')]();})['then'](function(){return sendServiceMail({'to':_0x524ab8[_0xf1a0('0x33')][_0xf1a0('0x29')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xf1a0('0x40')+_0xf1a0('0x41')+'https://'+_0x524ab8[_0xf1a0('0x42')][_0xf1a0('0x43')]+'/reset/'+_0x27a78b+'\x0a\x0a'+_0xf1a0('0x44')});})[_0xf1a0('0xc')](function(){_0x85ea84[_0xf1a0('0x45')](0xc8)[_0xf1a0('0x2e')]({'message':_0xf1a0('0x46')});})[_0xf1a0('0x1f')](function(_0x297e30){return handleError(_0x85ea84,0x1f4,_0x297e30);});};exports[_0xf1a0('0x47')]=function(_0x4cba04,_0x4461eb){return db[_0xf1a0('0x39')]['find']({'where':{'resetPasswordToken':_0x4cba04[_0xf1a0('0x48')][_0xf1a0('0x49')],'resetPasswordExpires':{'$gt':Date[_0xf1a0('0x3e')]()}}})[_0xf1a0('0xc')](function(_0x4e5e26){if(!_0x4e5e26){throw new Error(_0xf1a0('0x4a'));}return db[_0xf1a0('0x38')][_0xf1a0('0xa')]({'attributes':['id',_0xf1a0('0x4b'),_0xf1a0('0x4c'),_0xf1a0('0x4d')]})[_0xf1a0('0xc')](function(_0x1a94db){if(_0x1a94db[_0xf1a0('0x4b')])authService[_0xf1a0('0x4e')](_0x4cba04[_0xf1a0('0x33')][_0xf1a0('0xe')]);if(!_0x1a94db['enforcePasswordHistory']||!_0x4e5e26[_0xf1a0('0x4f')])return _0x4e5e26;authService[_0xf1a0('0x50')](_0x4cba04[_0xf1a0('0x33')]['password'],_0x4e5e26['previousPasswords'],_0x1a94db[_0xf1a0('0x4d')]);return _0x4e5e26;})[_0xf1a0('0xc')](function(){_0x4e5e26[_0xf1a0('0xe')]=_0x4cba04[_0xf1a0('0x33')][_0xf1a0('0xe')];_0x4e5e26[_0xf1a0('0x51')]=null;_0x4e5e26[_0xf1a0('0x3d')]=null;return _0x4e5e26[_0xf1a0('0x3f')]();});})[_0xf1a0('0xc')](function(){_0x4461eb[_0xf1a0('0x45')](0xc8)[_0xf1a0('0x2e')]({'message':_0xf1a0('0x52')});})[_0xf1a0('0x1f')](function(_0x166840){return handleError(_0x4461eb,0x1f4,_0x166840);});};passport[_0xf1a0('0x53')]('local-login',new LocalStrategy({'usernameField':_0xf1a0('0xd'),'passwordField':_0xf1a0('0xe')},function(_0x7fb2c5,_0x5a11ab,_0x557a75){return localAuthenticate(db['User'],_0x7fb2c5,_0x5a11ab,_0x557a75);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 8f0a577..951d072 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 _0x7a9f=['exports','express','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset'];(function(_0x2ba24f,_0x2fd89a){var _0x39123c=function(_0x548fd5){while(--_0x548fd5){_0x2ba24f['push'](_0x2ba24f['shift']());}};_0x39123c(++_0x2fd89a);}(_0x7a9f,0x1ba));var _0xf7a9=function(_0x4db4e1,_0x32ffc6){_0x4db4e1=_0x4db4e1-0x0;var _0x1d9b3c=_0x7a9f[_0x4db4e1];return _0x1d9b3c;};'use strict';var express=require(_0xf7a9('0x0'));var router=express['Router']();var controller=require(_0xf7a9('0x1'));router[_0xf7a9('0x2')]('/',controller[_0xf7a9('0x3')]);router[_0xf7a9('0x2')](_0xf7a9('0x4'),controller[_0xf7a9('0x5')]);router[_0xf7a9('0x2')](_0xf7a9('0x6'),controller[_0xf7a9('0x7')]);module[_0xf7a9('0x8')]=router; \ No newline at end of file +var _0xc6c0=['Router','./authLocal.controller','post','login','/forgot','/reset/:token','reset','exports','express'];(function(_0x11b5b3,_0xf955f0){var _0x2fb60e=function(_0x377f3b){while(--_0x377f3b){_0x11b5b3['push'](_0x11b5b3['shift']());}};_0x2fb60e(++_0xf955f0);}(_0xc6c0,0x179));var _0x0c6c=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xc6c0[_0x5e36d1];return _0x950b9e;};'use strict';var express=require(_0x0c6c('0x0'));var router=express[_0x0c6c('0x1')]();var controller=require(_0x0c6c('0x2'));router[_0x0c6c('0x3')]('/',controller[_0x0c6c('0x4')]);router[_0x0c6c('0x3')](_0x0c6c('0x5'),controller['forgot']);router[_0x0c6c('0x3')](_0x0c6c('0x6'),controller[_0x0c6c('0x7')]);module[_0x0c6c('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 4464f90..0ffee0d 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 _0x7cf9=['sequelize','exports','STRING','INTEGER'];(function(_0x5df0ec,_0x4e9dd0){var _0x4c08a1=function(_0x5c5a53){while(--_0x5c5a53){_0x5df0ec['push'](_0x5df0ec['shift']());}};_0x4c08a1(++_0x4e9dd0);}(_0x7cf9,0xdc));var _0x97cf=function(_0x2f168a,_0x2e7371){_0x2f168a=_0x2f168a-0x0;var _0x279e5b=_0x7cf9[_0x2f168a];return _0x279e5b;};'use strict';var Sequelize=require(_0x97cf('0x0'));module[_0x97cf('0x1')]={'name':{'type':Sequelize[_0x97cf('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x97cf('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x97cf('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xe801=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x16e77a,_0x653888){var _0x2944d4=function(_0x3fdf45){while(--_0x3fdf45){_0x16e77a['push'](_0x16e77a['shift']());}};_0x2944d4(++_0x653888);}(_0xe801,0x1e0));var _0x1e80=function(_0x28c4e5,_0x461ece){_0x28c4e5=_0x28c4e5-0x0;var _0x4afb8c=_0xe801[_0x28c4e5];return _0x4afb8c;};'use strict';var Sequelize=require(_0x1e80('0x0'));module[_0x1e80('0x1')]={'name':{'type':Sequelize[_0x1e80('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x1e80('0x2')]},'description':{'type':Sequelize[_0x1e80('0x2')]},'status':{'type':Sequelize[_0x1e80('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1e80('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index cc74ea0..9fc8d5a 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 _0x6f14=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','destroy','then','end','error','name','send','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Automation','includeAll','findAll','rows','params','keys','include','options','find','create','catch','body','addConditions','ids','getConditions','findOne','Condition','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring'];(function(_0x3a53c8,_0x1f39e7){var _0x5a4943=function(_0x1657ba){while(--_0x1657ba){_0x3a53c8['push'](_0x3a53c8['shift']());}};_0x5a4943(++_0x1f39e7);}(_0x6f14,0x1dc));var _0x46f1=function(_0x476558,_0x32d07f){_0x476558=_0x476558-0x0;var _0x565cca=_0x6f14[_0x476558];return _0x565cca;};'use strict';var emlformat=require(_0x46f1('0x0'));var rimraf=require(_0x46f1('0x1'));var zipdir=require(_0x46f1('0x2'));var jsonpatch=require(_0x46f1('0x3'));var rp=require('request-promise');var moment=require(_0x46f1('0x4'));var BPromise=require(_0x46f1('0x5'));var Mustache=require(_0x46f1('0x6'));var util=require('util');var path=require(_0x46f1('0x7'));var sox=require(_0x46f1('0x8'));var csv=require('to-csv');var ejs=require(_0x46f1('0x9'));var fs=require('fs');var fs_extra=require(_0x46f1('0xa'));var _=require('lodash');var squel=require(_0x46f1('0xb'));var crypto=require(_0x46f1('0xc'));var jsforce=require(_0x46f1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x46f1('0xe'));var querystring=require(_0x46f1('0xf'));var Papa=require(_0x46f1('0x10'));var Redis=require(_0x46f1('0x11'));var authService=require(_0x46f1('0x12'));var qs=require(_0x46f1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46f1('0x14'));var logger=require(_0x46f1('0x15'))(_0x46f1('0x16'));var utils=require(_0x46f1('0x17'));var config=require(_0x46f1('0x18'));var licenseUtil=require(_0x46f1('0x19'));var db=require(_0x46f1('0x1a'))['db'];function respondWithStatusCode(_0x46ae94,_0x2c3ddd){_0x2c3ddd=_0x2c3ddd||0xcc;return function(_0x2d6895){if(_0x2d6895){return _0x46ae94[_0x46f1('0x1b')](_0x2c3ddd);}return _0x46ae94[_0x46f1('0x1c')](_0x2c3ddd)['end']();};}function respondWithResult(_0x310175,_0x3e13df){_0x3e13df=_0x3e13df||0xc8;return function(_0x54079a){if(_0x54079a){return _0x310175[_0x46f1('0x1c')](_0x3e13df)[_0x46f1('0x1d')](_0x54079a);}};}function respondWithFilteredResult(_0x263bb2,_0xed1ffc){return function(_0x1e7016){if(_0x1e7016){var _0x258e41=typeof _0xed1ffc[_0x46f1('0x1e')]==='undefined'&&typeof _0xed1ffc[_0x46f1('0x1f')]===_0x46f1('0x20');var _0x5bde3f=_0x1e7016[_0x46f1('0x21')];var _0x9eb2f5=_0x258e41?0x0:_0xed1ffc[_0x46f1('0x1e')];var _0x1503e8=_0x258e41?_0x1e7016[_0x46f1('0x21')]:_0xed1ffc[_0x46f1('0x1e')]+_0xed1ffc[_0x46f1('0x1f')];var _0x27c552;if(_0x1503e8>=_0x5bde3f){_0x1503e8=_0x5bde3f;_0x27c552=0xc8;}else{_0x27c552=0xce;}_0x263bb2[_0x46f1('0x1c')](_0x27c552);return _0x263bb2[_0x46f1('0x22')]('Content-Range',_0x9eb2f5+'-'+_0x1503e8+'/'+_0x5bde3f)[_0x46f1('0x1d')](_0x1e7016);}return null;};}function patchUpdates(_0x599fa6){return function(_0x4a69c7){try{jsonpatch[_0x46f1('0x23')](_0x4a69c7,_0x599fa6,!![]);}catch(_0xbf08bd){return BPromise['reject'](_0xbf08bd);}return _0x4a69c7[_0x46f1('0x24')]();};}function saveUpdates(_0x5caddb,_0x3250f4){return function(_0x1008c2){if(_0x1008c2){return _0x1008c2['update'](_0x5caddb)['then'](function(_0x2bdc19){return _0x2bdc19;});}return null;};}function removeEntity(_0x2ae220,_0x31cffb){return function(_0x14bd31){if(_0x14bd31){return _0x14bd31[_0x46f1('0x25')]()[_0x46f1('0x26')](function(){_0x2ae220[_0x46f1('0x1c')](0xcc)[_0x46f1('0x27')]();});}};}function handleEntityNotFound(_0x142b20,_0x21ad94){return function(_0x4de322){if(!_0x4de322){_0x142b20[_0x46f1('0x1b')](0x194);}return _0x4de322;};}function handleError(_0x3a975f,_0x911b53){_0x911b53=_0x911b53||0x1f4;return function(_0xaf9ef5){logger[_0x46f1('0x28')](_0xaf9ef5['stack']);if(_0xaf9ef5[_0x46f1('0x29')]){delete _0xaf9ef5[_0x46f1('0x29')];}_0x3a975f['status'](_0x911b53)[_0x46f1('0x2a')](_0xaf9ef5);};}exports['index']=function(_0xb64500,_0x5e792d){var _0x5bd1a7={},_0x1bfe02={},_0x2d1d11={'count':0x0,'rows':[]};var _0xf02d3e=_['map'](db['Automation'][_0x46f1('0x2b')],function(_0xee9114){return{'name':_0xee9114['fieldName'],'type':_0xee9114[_0x46f1('0x2c')][_0x46f1('0x2d')]};});_0x1bfe02[_0x46f1('0x2e')]=_[_0x46f1('0x2f')](_0xf02d3e,'name');_0x1bfe02[_0x46f1('0x30')]=_['keys'](_0xb64500['query']);_0x1bfe02[_0x46f1('0x31')]=_['intersection'](_0x1bfe02[_0x46f1('0x2e')],_0x1bfe02[_0x46f1('0x30')]);_0x5bd1a7[_0x46f1('0x32')]=_[_0x46f1('0x33')](_0x1bfe02['model'],qs[_0x46f1('0x34')](_0xb64500['query'][_0x46f1('0x34')]));_0x5bd1a7[_0x46f1('0x32')]=_0x5bd1a7['attributes'][_0x46f1('0x35')]?_0x5bd1a7[_0x46f1('0x32')]:_0x1bfe02['model'];if(!_0xb64500[_0x46f1('0x30')]['hasOwnProperty'](_0x46f1('0x36'))){_0x5bd1a7['limit']=qs[_0x46f1('0x1f')](_0xb64500['query'][_0x46f1('0x1f')]);_0x5bd1a7[_0x46f1('0x1e')]=qs[_0x46f1('0x1e')](_0xb64500['query'][_0x46f1('0x1e')]);}_0x5bd1a7[_0x46f1('0x37')]=qs[_0x46f1('0x38')](_0xb64500['query'][_0x46f1('0x38')]);_0x5bd1a7[_0x46f1('0x39')]=qs['filters'](_[_0x46f1('0x3a')](_0xb64500[_0x46f1('0x30')],_0x1bfe02[_0x46f1('0x31')]),_0xf02d3e);if(_0xb64500['query'][_0x46f1('0x3b')]){_0x5bd1a7['where']=_[_0x46f1('0x3c')](_0x5bd1a7[_0x46f1('0x39')],{'$or':_[_0x46f1('0x2f')](_0xf02d3e,function(_0x2ae1b2){if(_0x2ae1b2[_0x46f1('0x2c')]!==_0x46f1('0x3d')){var _0x541535={};_0x541535[_0x2ae1b2[_0x46f1('0x29')]]={'$like':'%'+_0xb64500[_0x46f1('0x30')]['filter']+'%'};return _0x541535;}})});}_0x5bd1a7=_[_0x46f1('0x3c')]({},_0x5bd1a7,_0xb64500['options']);var _0x50f323={'where':_0x5bd1a7[_0x46f1('0x39')]};return db[_0x46f1('0x3e')][_0x46f1('0x21')](_0x50f323)[_0x46f1('0x26')](function(_0x59ca30){_0x2d1d11['count']=_0x59ca30;if(_0xb64500[_0x46f1('0x30')][_0x46f1('0x3f')]){_0x5bd1a7['include']=[{'all':!![]}];}return db['Automation'][_0x46f1('0x40')](_0x5bd1a7);})[_0x46f1('0x26')](function(_0x23627f){_0x2d1d11[_0x46f1('0x41')]=_0x23627f;return _0x2d1d11;})['then'](respondWithFilteredResult(_0x5e792d,_0x5bd1a7))['catch'](handleError(_0x5e792d,null));};exports['show']=function(_0x851889,_0x44f014){var _0x5668cb={'raw':![],'where':{'id':_0x851889[_0x46f1('0x42')]['id']}},_0x1235ee={};_0x1235ee[_0x46f1('0x2e')]=_[_0x46f1('0x43')](db[_0x46f1('0x3e')]['rawAttributes']);_0x1235ee[_0x46f1('0x30')]=_[_0x46f1('0x43')](_0x851889['query']);_0x1235ee[_0x46f1('0x31')]=_['intersection'](_0x1235ee[_0x46f1('0x2e')],_0x1235ee[_0x46f1('0x30')]);_0x5668cb[_0x46f1('0x32')]=_[_0x46f1('0x33')](_0x1235ee['model'],qs[_0x46f1('0x34')](_0x851889['query']['fields']));_0x5668cb['attributes']=_0x5668cb['attributes'][_0x46f1('0x35')]?_0x5668cb[_0x46f1('0x32')]:_0x1235ee[_0x46f1('0x2e')];if(_0x851889[_0x46f1('0x30')][_0x46f1('0x3f')]){_0x5668cb[_0x46f1('0x44')]=[{'all':!![]}];}_0x5668cb=_[_0x46f1('0x3c')]({},_0x5668cb,_0x851889[_0x46f1('0x45')]);return db['Automation'][_0x46f1('0x46')](_0x5668cb)[_0x46f1('0x26')](handleEntityNotFound(_0x44f014,null))[_0x46f1('0x26')](respondWithResult(_0x44f014,null))['catch'](handleError(_0x44f014,null));};exports[_0x46f1('0x47')]=function(_0x196f27,_0xcd70aa){return db['Automation'][_0x46f1('0x47')](_0x196f27['body'],{})['then'](respondWithResult(_0xcd70aa,0xc9))[_0x46f1('0x48')](handleError(_0xcd70aa,null));};exports['update']=function(_0x1c4cb6,_0x1c7d0b){if(_0x1c4cb6['body']['id']){delete _0x1c4cb6['body']['id'];}return db['Automation'][_0x46f1('0x46')]({'where':{'id':_0x1c4cb6['params']['id']}})[_0x46f1('0x26')](handleEntityNotFound(_0x1c7d0b,null))[_0x46f1('0x26')](saveUpdates(_0x1c4cb6[_0x46f1('0x49')],null))[_0x46f1('0x26')](respondWithResult(_0x1c7d0b,null))['catch'](handleError(_0x1c7d0b,null));};exports['destroy']=function(_0x398e48,_0x50a5ec){return db['Automation'][_0x46f1('0x46')]({'where':{'id':_0x398e48['params']['id']}})[_0x46f1('0x26')](handleEntityNotFound(_0x50a5ec,null))['then'](removeEntity(_0x50a5ec,null))['catch'](handleError(_0x50a5ec,null));};exports['addConditions']=function(_0xd823d7,_0xffe3fb,_0x32c530){return db['Condition'][_0x46f1('0x46')]({'where':{'id':_0xd823d7[_0x46f1('0x42')]['id']}})[_0x46f1('0x26')](handleEntityNotFound(_0xffe3fb,null))['then'](function(_0x5e11b8){if(_0x5e11b8){return _0x5e11b8[_0x46f1('0x4a')](_0xd823d7['body']['ids'],_['omit'](_0xd823d7[_0x46f1('0x49')],[_0x46f1('0x4b'),'id'])||{});}})[_0x46f1('0x26')](respondWithResult(_0xffe3fb,null))[_0x46f1('0x48')](handleError(_0xffe3fb,null));};exports[_0x46f1('0x4c')]=function(_0x25a4d2,_0x57b97d,_0x24744b){var _0x169d85={};var _0x120ea1={};var _0x24ed57;var _0x39f36c;return db[_0x46f1('0x3e')][_0x46f1('0x4d')]({'where':{'id':_0x25a4d2[_0x46f1('0x42')]['id']}})[_0x46f1('0x26')](handleEntityNotFound(_0x57b97d,null))['then'](function(_0x3def40){if(_0x3def40){_0x24ed57=_0x3def40;_0x120ea1[_0x46f1('0x2e')]=_[_0x46f1('0x43')](db[_0x46f1('0x4e')]['rawAttributes']);_0x120ea1[_0x46f1('0x30')]=_['keys'](_0x25a4d2[_0x46f1('0x30')]);_0x120ea1['filters']=_[_0x46f1('0x33')](_0x120ea1[_0x46f1('0x2e')],_0x120ea1['query']);_0x169d85[_0x46f1('0x32')]=_[_0x46f1('0x33')](_0x120ea1[_0x46f1('0x2e')],qs['fields'](_0x25a4d2[_0x46f1('0x30')][_0x46f1('0x34')]));_0x169d85[_0x46f1('0x32')]=_0x169d85[_0x46f1('0x32')]['length']?_0x169d85[_0x46f1('0x32')]:_0x120ea1[_0x46f1('0x2e')];_0x169d85[_0x46f1('0x37')]=qs[_0x46f1('0x38')](_0x25a4d2['query'][_0x46f1('0x38')]);_0x169d85[_0x46f1('0x39')]=qs[_0x46f1('0x31')](_[_0x46f1('0x3a')](_0x25a4d2[_0x46f1('0x30')],_0x120ea1[_0x46f1('0x31')]));if(_0x25a4d2['query'][_0x46f1('0x3b')]){_0x169d85[_0x46f1('0x39')]=_[_0x46f1('0x3c')](_0x169d85['where'],{'$or':_[_0x46f1('0x2f')](_0x169d85[_0x46f1('0x32')],function(_0x9fb7c0){var _0x22bb5d={};_0x22bb5d[_0x9fb7c0]={'$like':'%'+_0x25a4d2['query'][_0x46f1('0x3b')]+'%'};return _0x22bb5d;})});}_0x169d85=_[_0x46f1('0x3c')]({},_0x169d85,_0x25a4d2[_0x46f1('0x45')]);return _0x24ed57[_0x46f1('0x4c')](_0x169d85);}})[_0x46f1('0x26')](function(_0x26bd0b){if(_0x26bd0b){_0x39f36c=_0x26bd0b[_0x46f1('0x35')];if(!_0x25a4d2[_0x46f1('0x30')]['hasOwnProperty'](_0x46f1('0x36'))){_0x169d85[_0x46f1('0x1f')]=qs[_0x46f1('0x1f')](_0x25a4d2[_0x46f1('0x30')]['limit']);_0x169d85['offset']=qs[_0x46f1('0x1e')](_0x25a4d2[_0x46f1('0x30')][_0x46f1('0x1e')]);}return _0x24ed57[_0x46f1('0x4c')](_0x169d85);}})[_0x46f1('0x26')](function(_0x4e4d9a){if(_0x4e4d9a){return _0x4e4d9a?{'count':_0x39f36c,'rows':_0x4e4d9a}:null;}})[_0x46f1('0x26')](respondWithResult(_0x57b97d,null))[_0x46f1('0x48')](handleError(_0x57b97d,null));};exports[_0x46f1('0x4f')]=function(_0x4b5a39,_0x662717,_0x2cecfc){return db[_0x46f1('0x50')][_0x46f1('0x46')]({'where':{'id':_0x4b5a39[_0x46f1('0x42')]['id']}})[_0x46f1('0x26')](handleEntityNotFound(_0x662717,null))['then'](function(_0x34cb73){if(_0x34cb73){return _0x34cb73[_0x46f1('0x4f')](_0x4b5a39['body']['ids'],_['omit'](_0x4b5a39['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x662717,null))[_0x46f1('0x48')](handleError(_0x662717,null));};exports[_0x46f1('0x51')]=function(_0x28cf95,_0x2527a0,_0x3eef2e){var _0x4db11f={};var _0x2ae1f4={};var _0x412539;var _0x20803c;return db[_0x46f1('0x3e')][_0x46f1('0x4d')]({'where':{'id':_0x28cf95[_0x46f1('0x42')]['id']}})['then'](handleEntityNotFound(_0x2527a0,null))[_0x46f1('0x26')](function(_0x261bc5){if(_0x261bc5){_0x412539=_0x261bc5;_0x2ae1f4['model']=_[_0x46f1('0x43')](db['Action'][_0x46f1('0x2b')]);_0x2ae1f4[_0x46f1('0x30')]=_['keys'](_0x28cf95[_0x46f1('0x30')]);_0x2ae1f4['filters']=_[_0x46f1('0x33')](_0x2ae1f4['model'],_0x2ae1f4['query']);_0x4db11f[_0x46f1('0x32')]=_[_0x46f1('0x33')](_0x2ae1f4['model'],qs[_0x46f1('0x34')](_0x28cf95[_0x46f1('0x30')][_0x46f1('0x34')]));_0x4db11f[_0x46f1('0x32')]=_0x4db11f[_0x46f1('0x32')]['length']?_0x4db11f[_0x46f1('0x32')]:_0x2ae1f4[_0x46f1('0x2e')];_0x4db11f[_0x46f1('0x37')]=qs[_0x46f1('0x38')](_0x28cf95[_0x46f1('0x30')][_0x46f1('0x38')]);_0x4db11f[_0x46f1('0x39')]=qs['filters'](_[_0x46f1('0x3a')](_0x28cf95[_0x46f1('0x30')],_0x2ae1f4[_0x46f1('0x31')]));if(_0x28cf95[_0x46f1('0x30')][_0x46f1('0x3b')]){_0x4db11f[_0x46f1('0x39')]=_['merge'](_0x4db11f[_0x46f1('0x39')],{'$or':_[_0x46f1('0x2f')](_0x4db11f[_0x46f1('0x32')],function(_0x1e5b54){var _0x3181a6={};_0x3181a6[_0x1e5b54]={'$like':'%'+_0x28cf95[_0x46f1('0x30')][_0x46f1('0x3b')]+'%'};return _0x3181a6;})});}_0x4db11f=_[_0x46f1('0x3c')]({},_0x4db11f,_0x28cf95['options']);return _0x412539['getActions'](_0x4db11f);}})[_0x46f1('0x26')](function(_0x3a7770){if(_0x3a7770){_0x20803c=_0x3a7770[_0x46f1('0x35')];if(!_0x28cf95[_0x46f1('0x30')]['hasOwnProperty']('nolimit')){_0x4db11f[_0x46f1('0x1f')]=qs['limit'](_0x28cf95[_0x46f1('0x30')][_0x46f1('0x1f')]);_0x4db11f[_0x46f1('0x1e')]=qs['offset'](_0x28cf95[_0x46f1('0x30')]['offset']);}return _0x412539[_0x46f1('0x51')](_0x4db11f);}})[_0x46f1('0x26')](function(_0x518d97){if(_0x518d97){return _0x518d97?{'count':_0x20803c,'rows':_0x518d97}:null;}})[_0x46f1('0x26')](respondWithResult(_0x2527a0,null))[_0x46f1('0x48')](handleError(_0x2527a0,null));}; \ No newline at end of file +var _0x7d12=['order','addActions','ids','getActions','Action','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','name','map','Automation','rawAttributes','type','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','length','create','body','update','find','addConditions','omit','getConditions','findOne','Condition'];(function(_0x1d679f,_0x34dd77){var _0x7bfb96=function(_0x45b190){while(--_0x45b190){_0x1d679f['push'](_0x1d679f['shift']());}};_0x7bfb96(++_0x34dd77);}(_0x7d12,0x9d));var _0x27d1=function(_0x27671f,_0x449b6a){_0x27671f=_0x27671f-0x0;var _0x523bbf=_0x7d12[_0x27671f];return _0x523bbf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27d1('0x0'));var zipdir=require(_0x27d1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x27d1('0x2'));var moment=require(_0x27d1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x27d1('0x4'));var util=require(_0x27d1('0x5'));var path=require(_0x27d1('0x6'));var sox=require(_0x27d1('0x7'));var csv=require(_0x27d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x27d1('0x9'));var squel=require(_0x27d1('0xa'));var crypto=require('crypto');var jsforce=require(_0x27d1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x27d1('0x8'));var querystring=require(_0x27d1('0xc'));var Papa=require(_0x27d1('0xd'));var Redis=require(_0x27d1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x27d1('0xf'));var as=require(_0x27d1('0x10'));var hardwareService=require(_0x27d1('0x11'));var logger=require(_0x27d1('0x12'))('api');var utils=require(_0x27d1('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x27d1('0x14'))['db'];function respondWithStatusCode(_0xd6dc96,_0x3e428f){_0x3e428f=_0x3e428f||0xcc;return function(_0x26c2cd){if(_0x26c2cd){return _0xd6dc96[_0x27d1('0x15')](_0x3e428f);}return _0xd6dc96[_0x27d1('0x16')](_0x3e428f)['end']();};}function respondWithResult(_0x417eec,_0x375a46){_0x375a46=_0x375a46||0xc8;return function(_0xba2c4f){if(_0xba2c4f){return _0x417eec[_0x27d1('0x16')](_0x375a46)[_0x27d1('0x17')](_0xba2c4f);}};}function respondWithFilteredResult(_0x2d769c,_0x3c6a97){return function(_0x272695){if(_0x272695){var _0x2b4ea0=typeof _0x3c6a97[_0x27d1('0x18')]===_0x27d1('0x19')&&typeof _0x3c6a97[_0x27d1('0x1a')]===_0x27d1('0x19');var _0x560b22=_0x272695[_0x27d1('0x1b')];var _0x3f1e9a=_0x2b4ea0?0x0:_0x3c6a97[_0x27d1('0x18')];var _0x325ed9=_0x2b4ea0?_0x272695[_0x27d1('0x1b')]:_0x3c6a97[_0x27d1('0x18')]+_0x3c6a97[_0x27d1('0x1a')];var _0x285787;if(_0x325ed9>=_0x560b22){_0x325ed9=_0x560b22;_0x285787=0xc8;}else{_0x285787=0xce;}_0x2d769c[_0x27d1('0x16')](_0x285787);return _0x2d769c[_0x27d1('0x1c')](_0x27d1('0x1d'),_0x3f1e9a+'-'+_0x325ed9+'/'+_0x560b22)[_0x27d1('0x17')](_0x272695);}return null;};}function patchUpdates(_0x1cb3a8){return function(_0x5417b8){try{jsonpatch[_0x27d1('0x1e')](_0x5417b8,_0x1cb3a8,!![]);}catch(_0x4f8459){return BPromise[_0x27d1('0x1f')](_0x4f8459);}return _0x5417b8[_0x27d1('0x20')]();};}function saveUpdates(_0xc56484,_0x471918){return function(_0x54df10){if(_0x54df10){return _0x54df10['update'](_0xc56484)[_0x27d1('0x21')](function(_0x2d798f){return _0x2d798f;});}return null;};}function removeEntity(_0x25d6b7,_0x54cb77){return function(_0xd37c61){if(_0xd37c61){return _0xd37c61[_0x27d1('0x22')]()[_0x27d1('0x21')](function(){_0x25d6b7[_0x27d1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x496dce,_0x18c880){return function(_0x3fdc98){if(!_0x3fdc98){_0x496dce[_0x27d1('0x15')](0x194);}return _0x3fdc98;};}function handleError(_0x2556a8,_0x2cb20b){_0x2cb20b=_0x2cb20b||0x1f4;return function(_0x23e7bd){logger['error'](_0x23e7bd['stack']);if(_0x23e7bd[_0x27d1('0x23')]){delete _0x23e7bd['name'];}_0x2556a8[_0x27d1('0x16')](_0x2cb20b)['send'](_0x23e7bd);};}exports['index']=function(_0x42bb4c,_0x158a51){var _0x2d49aa={},_0x54d19c={},_0x3a8488={'count':0x0,'rows':[]};var _0x4a6598=_[_0x27d1('0x24')](db[_0x27d1('0x25')][_0x27d1('0x26')],function(_0x59f4d7){return{'name':_0x59f4d7['fieldName'],'type':_0x59f4d7[_0x27d1('0x27')]['key']};});_0x54d19c['model']=_[_0x27d1('0x24')](_0x4a6598,_0x27d1('0x23'));_0x54d19c['query']=_[_0x27d1('0x28')](_0x42bb4c[_0x27d1('0x29')]);_0x54d19c[_0x27d1('0x2a')]=_[_0x27d1('0x2b')](_0x54d19c['model'],_0x54d19c[_0x27d1('0x29')]);_0x2d49aa[_0x27d1('0x2c')]=_[_0x27d1('0x2b')](_0x54d19c[_0x27d1('0x2d')],qs[_0x27d1('0x2e')](_0x42bb4c[_0x27d1('0x29')][_0x27d1('0x2e')]));_0x2d49aa['attributes']=_0x2d49aa[_0x27d1('0x2c')]['length']?_0x2d49aa[_0x27d1('0x2c')]:_0x54d19c[_0x27d1('0x2d')];if(!_0x42bb4c[_0x27d1('0x29')][_0x27d1('0x2f')](_0x27d1('0x30'))){_0x2d49aa[_0x27d1('0x1a')]=qs['limit'](_0x42bb4c[_0x27d1('0x29')][_0x27d1('0x1a')]);_0x2d49aa['offset']=qs[_0x27d1('0x18')](_0x42bb4c[_0x27d1('0x29')][_0x27d1('0x18')]);}_0x2d49aa['order']=qs[_0x27d1('0x31')](_0x42bb4c['query'][_0x27d1('0x31')]);_0x2d49aa['where']=qs['filters'](_[_0x27d1('0x32')](_0x42bb4c[_0x27d1('0x29')],_0x54d19c[_0x27d1('0x2a')]),_0x4a6598);if(_0x42bb4c[_0x27d1('0x29')][_0x27d1('0x33')]){_0x2d49aa[_0x27d1('0x34')]=_[_0x27d1('0x35')](_0x2d49aa[_0x27d1('0x34')],{'$or':_[_0x27d1('0x24')](_0x4a6598,function(_0x42f793){if(_0x42f793['type']!==_0x27d1('0x36')){var _0xaca47={};_0xaca47[_0x42f793['name']]={'$like':'%'+_0x42bb4c[_0x27d1('0x29')][_0x27d1('0x33')]+'%'};return _0xaca47;}})});}_0x2d49aa=_[_0x27d1('0x35')]({},_0x2d49aa,_0x42bb4c[_0x27d1('0x37')]);var _0x452b4c={'where':_0x2d49aa[_0x27d1('0x34')]};return db[_0x27d1('0x25')][_0x27d1('0x1b')](_0x452b4c)[_0x27d1('0x21')](function(_0x4cff60){_0x3a8488[_0x27d1('0x1b')]=_0x4cff60;if(_0x42bb4c[_0x27d1('0x29')][_0x27d1('0x38')]){_0x2d49aa[_0x27d1('0x39')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x2d49aa);})[_0x27d1('0x21')](function(_0x229601){_0x3a8488['rows']=_0x229601;return _0x3a8488;})[_0x27d1('0x21')](respondWithFilteredResult(_0x158a51,_0x2d49aa))[_0x27d1('0x3a')](handleError(_0x158a51,null));};exports[_0x27d1('0x3b')]=function(_0x4c3112,_0x446d79){var _0x5166b3={'raw':![],'where':{'id':_0x4c3112[_0x27d1('0x3c')]['id']}},_0x3876c0={};_0x3876c0[_0x27d1('0x2d')]=_[_0x27d1('0x28')](db[_0x27d1('0x25')][_0x27d1('0x26')]);_0x3876c0[_0x27d1('0x29')]=_[_0x27d1('0x28')](_0x4c3112[_0x27d1('0x29')]);_0x3876c0[_0x27d1('0x2a')]=_[_0x27d1('0x2b')](_0x3876c0['model'],_0x3876c0['query']);_0x5166b3[_0x27d1('0x2c')]=_[_0x27d1('0x2b')](_0x3876c0[_0x27d1('0x2d')],qs[_0x27d1('0x2e')](_0x4c3112['query']['fields']));_0x5166b3[_0x27d1('0x2c')]=_0x5166b3['attributes'][_0x27d1('0x3d')]?_0x5166b3[_0x27d1('0x2c')]:_0x3876c0['model'];if(_0x4c3112[_0x27d1('0x29')]['includeAll']){_0x5166b3[_0x27d1('0x39')]=[{'all':!![]}];}_0x5166b3=_['merge']({},_0x5166b3,_0x4c3112[_0x27d1('0x37')]);return db['Automation']['find'](_0x5166b3)['then'](handleEntityNotFound(_0x446d79,null))[_0x27d1('0x21')](respondWithResult(_0x446d79,null))[_0x27d1('0x3a')](handleError(_0x446d79,null));};exports[_0x27d1('0x3e')]=function(_0x5e431f,_0x2bd58b){return db[_0x27d1('0x25')][_0x27d1('0x3e')](_0x5e431f[_0x27d1('0x3f')],{})['then'](respondWithResult(_0x2bd58b,0xc9))[_0x27d1('0x3a')](handleError(_0x2bd58b,null));};exports[_0x27d1('0x40')]=function(_0x3e60b4,_0x428a04){if(_0x3e60b4[_0x27d1('0x3f')]['id']){delete _0x3e60b4['body']['id'];}return db[_0x27d1('0x25')][_0x27d1('0x41')]({'where':{'id':_0x3e60b4[_0x27d1('0x3c')]['id']}})[_0x27d1('0x21')](handleEntityNotFound(_0x428a04,null))[_0x27d1('0x21')](saveUpdates(_0x3e60b4[_0x27d1('0x3f')],null))[_0x27d1('0x21')](respondWithResult(_0x428a04,null))['catch'](handleError(_0x428a04,null));};exports[_0x27d1('0x22')]=function(_0x14a212,_0x322438){return db[_0x27d1('0x25')][_0x27d1('0x41')]({'where':{'id':_0x14a212[_0x27d1('0x3c')]['id']}})[_0x27d1('0x21')](handleEntityNotFound(_0x322438,null))[_0x27d1('0x21')](removeEntity(_0x322438,null))[_0x27d1('0x3a')](handleError(_0x322438,null));};exports[_0x27d1('0x42')]=function(_0x375a44,_0x290af9,_0x3f189d){return db['Condition'][_0x27d1('0x41')]({'where':{'id':_0x375a44[_0x27d1('0x3c')]['id']}})[_0x27d1('0x21')](handleEntityNotFound(_0x290af9,null))[_0x27d1('0x21')](function(_0x4ea431){if(_0x4ea431){return _0x4ea431[_0x27d1('0x42')](_0x375a44[_0x27d1('0x3f')]['ids'],_[_0x27d1('0x43')](_0x375a44[_0x27d1('0x3f')],['ids','id'])||{});}})[_0x27d1('0x21')](respondWithResult(_0x290af9,null))['catch'](handleError(_0x290af9,null));};exports[_0x27d1('0x44')]=function(_0x42309e,_0x221262,_0x10fdd4){var _0x28aebe={};var _0x2cb194={};var _0x2cb1d8;var _0x4d7d2b;return db[_0x27d1('0x25')][_0x27d1('0x45')]({'where':{'id':_0x42309e[_0x27d1('0x3c')]['id']}})[_0x27d1('0x21')](handleEntityNotFound(_0x221262,null))[_0x27d1('0x21')](function(_0x51f98a){if(_0x51f98a){_0x2cb1d8=_0x51f98a;_0x2cb194['model']=_['keys'](db[_0x27d1('0x46')][_0x27d1('0x26')]);_0x2cb194[_0x27d1('0x29')]=_['keys'](_0x42309e[_0x27d1('0x29')]);_0x2cb194[_0x27d1('0x2a')]=_['intersection'](_0x2cb194[_0x27d1('0x2d')],_0x2cb194[_0x27d1('0x29')]);_0x28aebe[_0x27d1('0x2c')]=_['intersection'](_0x2cb194[_0x27d1('0x2d')],qs['fields'](_0x42309e['query'][_0x27d1('0x2e')]));_0x28aebe[_0x27d1('0x2c')]=_0x28aebe[_0x27d1('0x2c')][_0x27d1('0x3d')]?_0x28aebe[_0x27d1('0x2c')]:_0x2cb194[_0x27d1('0x2d')];_0x28aebe[_0x27d1('0x47')]=qs[_0x27d1('0x31')](_0x42309e[_0x27d1('0x29')][_0x27d1('0x31')]);_0x28aebe[_0x27d1('0x34')]=qs[_0x27d1('0x2a')](_[_0x27d1('0x32')](_0x42309e['query'],_0x2cb194[_0x27d1('0x2a')]));if(_0x42309e[_0x27d1('0x29')][_0x27d1('0x33')]){_0x28aebe[_0x27d1('0x34')]=_[_0x27d1('0x35')](_0x28aebe[_0x27d1('0x34')],{'$or':_['map'](_0x28aebe[_0x27d1('0x2c')],function(_0x403927){var _0x172684={};_0x172684[_0x403927]={'$like':'%'+_0x42309e[_0x27d1('0x29')][_0x27d1('0x33')]+'%'};return _0x172684;})});}_0x28aebe=_[_0x27d1('0x35')]({},_0x28aebe,_0x42309e[_0x27d1('0x37')]);return _0x2cb1d8[_0x27d1('0x44')](_0x28aebe);}})['then'](function(_0x11d1eb){if(_0x11d1eb){_0x4d7d2b=_0x11d1eb[_0x27d1('0x3d')];if(!_0x42309e[_0x27d1('0x29')]['hasOwnProperty']('nolimit')){_0x28aebe[_0x27d1('0x1a')]=qs[_0x27d1('0x1a')](_0x42309e[_0x27d1('0x29')][_0x27d1('0x1a')]);_0x28aebe[_0x27d1('0x18')]=qs[_0x27d1('0x18')](_0x42309e[_0x27d1('0x29')][_0x27d1('0x18')]);}return _0x2cb1d8[_0x27d1('0x44')](_0x28aebe);}})[_0x27d1('0x21')](function(_0xdb5118){if(_0xdb5118){return _0xdb5118?{'count':_0x4d7d2b,'rows':_0xdb5118}:null;}})[_0x27d1('0x21')](respondWithResult(_0x221262,null))['catch'](handleError(_0x221262,null));};exports[_0x27d1('0x48')]=function(_0x513256,_0x22349e,_0x420b96){return db['Action'][_0x27d1('0x41')]({'where':{'id':_0x513256[_0x27d1('0x3c')]['id']}})[_0x27d1('0x21')](handleEntityNotFound(_0x22349e,null))[_0x27d1('0x21')](function(_0x1f756a){if(_0x1f756a){return _0x1f756a['addActions'](_0x513256['body'][_0x27d1('0x49')],_['omit'](_0x513256[_0x27d1('0x3f')],[_0x27d1('0x49'),'id'])||{});}})[_0x27d1('0x21')](respondWithResult(_0x22349e,null))[_0x27d1('0x3a')](handleError(_0x22349e,null));};exports[_0x27d1('0x4a')]=function(_0x3ea53c,_0x465839,_0x2d6fee){var _0x1c24ab={};var _0x433e98={};var _0x42338c;var _0x4d984d;return db[_0x27d1('0x25')][_0x27d1('0x45')]({'where':{'id':_0x3ea53c[_0x27d1('0x3c')]['id']}})[_0x27d1('0x21')](handleEntityNotFound(_0x465839,null))['then'](function(_0xf2c64){if(_0xf2c64){_0x42338c=_0xf2c64;_0x433e98[_0x27d1('0x2d')]=_[_0x27d1('0x28')](db[_0x27d1('0x4b')][_0x27d1('0x26')]);_0x433e98[_0x27d1('0x29')]=_[_0x27d1('0x28')](_0x3ea53c['query']);_0x433e98['filters']=_[_0x27d1('0x2b')](_0x433e98['model'],_0x433e98[_0x27d1('0x29')]);_0x1c24ab[_0x27d1('0x2c')]=_[_0x27d1('0x2b')](_0x433e98[_0x27d1('0x2d')],qs[_0x27d1('0x2e')](_0x3ea53c[_0x27d1('0x29')]['fields']));_0x1c24ab[_0x27d1('0x2c')]=_0x1c24ab['attributes'][_0x27d1('0x3d')]?_0x1c24ab[_0x27d1('0x2c')]:_0x433e98[_0x27d1('0x2d')];_0x1c24ab[_0x27d1('0x47')]=qs['sort'](_0x3ea53c[_0x27d1('0x29')][_0x27d1('0x31')]);_0x1c24ab[_0x27d1('0x34')]=qs[_0x27d1('0x2a')](_[_0x27d1('0x32')](_0x3ea53c[_0x27d1('0x29')],_0x433e98['filters']));if(_0x3ea53c[_0x27d1('0x29')][_0x27d1('0x33')]){_0x1c24ab['where']=_[_0x27d1('0x35')](_0x1c24ab['where'],{'$or':_[_0x27d1('0x24')](_0x1c24ab[_0x27d1('0x2c')],function(_0x2d9e90){var _0x399c22={};_0x399c22[_0x2d9e90]={'$like':'%'+_0x3ea53c[_0x27d1('0x29')][_0x27d1('0x33')]+'%'};return _0x399c22;})});}_0x1c24ab=_[_0x27d1('0x35')]({},_0x1c24ab,_0x3ea53c[_0x27d1('0x37')]);return _0x42338c['getActions'](_0x1c24ab);}})[_0x27d1('0x21')](function(_0x3ca48c){if(_0x3ca48c){_0x4d984d=_0x3ca48c[_0x27d1('0x3d')];if(!_0x3ea53c[_0x27d1('0x29')][_0x27d1('0x2f')]('nolimit')){_0x1c24ab[_0x27d1('0x1a')]=qs[_0x27d1('0x1a')](_0x3ea53c[_0x27d1('0x29')][_0x27d1('0x1a')]);_0x1c24ab[_0x27d1('0x18')]=qs['offset'](_0x3ea53c[_0x27d1('0x29')][_0x27d1('0x18')]);}return _0x42338c[_0x27d1('0x4a')](_0x1c24ab);}})[_0x27d1('0x21')](function(_0x3c0af2){if(_0x3c0af2){return _0x3c0af2?{'count':_0x4d984d,'rows':_0x3c0af2}:null;}})[_0x27d1('0x21')](respondWithResult(_0x465839,null))['catch'](handleError(_0x465839,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index b92b98c..356ffcd 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 _0x1074=['bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash','../../config/logger','api','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1074,0x1b6));var _0x4107=function(_0x33feca,_0x2bd9ae){_0x33feca=_0x33feca-0x0;var _0x3c558f=_0x1074[_0x33feca];return _0x3c558f;};'use strict';var _=require(_0x4107('0x0'));var util=require('util');var logger=require(_0x4107('0x1'))(_0x4107('0x2'));var moment=require(_0x4107('0x3'));var BPromise=require(_0x4107('0x4'));var rp=require(_0x4107('0x5'));var fs=require('fs');var path=require(_0x4107('0x6'));var rimraf=require(_0x4107('0x7'));var config=require(_0x4107('0x8'));var attributes=require(_0x4107('0x9'));module['exports']=function(_0x33ebd7,_0x5733df){return _0x33ebd7[_0x4107('0xa')](_0x4107('0xb'),attributes,{'tableName':_0x4107('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c0b=['../../config/logger','api','moment','bluebird','request-promise','rimraf','define','Automation','tools_automations','lodash'];(function(_0x83555e,_0x502ed1){var _0x42f2cf=function(_0x54d198){while(--_0x54d198){_0x83555e['push'](_0x83555e['shift']());}};_0x42f2cf(++_0x502ed1);}(_0x1c0b,0x1a3));var _0xb1c0=function(_0x26a72b,_0x4df8d8){_0x26a72b=_0x26a72b-0x0;var _0x5aa4af=_0x1c0b[_0x26a72b];return _0x5aa4af;};'use strict';var _=require(_0xb1c0('0x0'));var util=require('util');var logger=require(_0xb1c0('0x1'))(_0xb1c0('0x2'));var moment=require(_0xb1c0('0x3'));var BPromise=require(_0xb1c0('0x4'));var rp=require(_0xb1c0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb1c0('0x6'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module['exports']=function(_0x52b13c,_0x466047){return _0x52b13c[_0xb1c0('0x7')](_0xb1c0('0x8'),attributes,{'tableName':_0xb1c0('0x9'),'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 0d98469..1e0084a 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 _0x8383=['stringify','error','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xe14ee9,_0x4cd8e1){var _0x1dda60=function(_0x50b9cf){while(--_0x50b9cf){_0xe14ee9['push'](_0xe14ee9['shift']());}};_0x1dda60(++_0x4cd8e1);}(_0x8383,0x98));var _0x3838=function(_0xed5c38,_0x591348){_0xed5c38=_0xed5c38-0x0;var _0x296302=_0x8383[_0xed5c38];return _0x296302;};'use strict';var _=require(_0x3838('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3838('0x1'));var rs=require(_0x3838('0x2'));var fs=require('fs');var Redis=require(_0x3838('0x3'));var db=require(_0x3838('0x4'))['db'];var utils=require(_0x3838('0x5'));var logger=require(_0x3838('0x6'))(_0x3838('0x7'));var config=require(_0x3838('0x8'));var jayson=require(_0x3838('0x9'));var client=jayson[_0x3838('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x239750,_0x235001,_0x4cf52b){return new BPromise(function(_0x2abbda,_0x5e2e42){return client[_0x3838('0xb')](_0x239750,_0x4cf52b)[_0x3838('0xc')](function(_0x340c39){logger['info'](_0x3838('0xd'),_0x235001,_0x3838('0xe'));logger[_0x3838('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x235001,_0x3838('0xe'),JSON[_0x3838('0x10')](_0x340c39));if(_0x340c39[_0x3838('0x11')]){if(_0x340c39[_0x3838('0x11')]['code']===0x1f4){logger[_0x3838('0x11')](_0x3838('0xd'),_0x235001,_0x340c39[_0x3838('0x11')]['message']);return _0x5e2e42(_0x340c39[_0x3838('0x11')]['message']);}logger[_0x3838('0x11')](_0x3838('0xd'),_0x235001,_0x340c39[_0x3838('0x11')][_0x3838('0x12')]);return _0x2abbda(_0x340c39[_0x3838('0x11')]['message']);}else{logger[_0x3838('0x13')](_0x3838('0xd'),_0x235001,_0x3838('0xe'));_0x2abbda(_0x340c39[_0x3838('0x14')][_0x3838('0x12')]);}})['catch'](function(_0x464fd9){logger[_0x3838('0x11')](_0x3838('0xd'),_0x235001,_0x464fd9);_0x5e2e42(_0x464fd9);});});} \ No newline at end of file +var _0x1c9a=['http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1c9a,0x98));var _0xa1c9=function(_0x44d293,_0x511c7f){_0x44d293=_0x44d293-0x0;var _0x2315b1=_0x1c9a[_0x44d293];return _0x2315b1;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5448f2,_0x222624,_0x463c9c){return new BPromise(function(_0x3f07c2,_0x5059df){return client[_0xa1c9('0xa')](_0x5448f2,_0x463c9c)[_0xa1c9('0xb')](function(_0x24136d){logger[_0xa1c9('0xc')]('Automation,\x20%s,\x20%s',_0x222624,_0xa1c9('0xd'));logger[_0xa1c9('0xe')](_0xa1c9('0xf'),_0x222624,_0xa1c9('0xd'),JSON[_0xa1c9('0x10')](_0x24136d));if(_0x24136d[_0xa1c9('0x11')]){if(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x12')]===0x1f4){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x5059df(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x3f07c2(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}else{logger[_0xa1c9('0xc')](_0xa1c9('0x13'),_0x222624,_0xa1c9('0xd'));_0x3f07c2(_0x24136d[_0xa1c9('0x15')][_0xa1c9('0x14')]);}})[_0xa1c9('0x16')](function(_0x373f5d){logger['error'](_0xa1c9('0x13'),_0x222624,_0x373f5d);_0x5059df(_0x373f5d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 57c4914..d566c6d 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 _0x297b=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./automation.controller','get','/:id','isAuthenticated','/:id/actions','getActions','post','/:id/conditions','addConditions','put','delete','destroy','exports'];(function(_0x35268e,_0x4acfd1){var _0x28ba11=function(_0x34f637){while(--_0x34f637){_0x35268e['push'](_0x35268e['shift']());}};_0x28ba11(++_0x4acfd1);}(_0x297b,0x85));var _0xb297=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x297b[_0x36884e];return _0x1cc367;};'use strict';var multer=require(_0xb297('0x0'));var util=require('util');var path=require(_0xb297('0x1'));var timeout=require(_0xb297('0x2'));var express=require(_0xb297('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb297('0x4'));var interaction=require(_0xb297('0x5'));var config=require('../../config/environment');var controller=require(_0xb297('0x6'));router[_0xb297('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb297('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xb297('0x7')]('/:id/conditions',auth[_0xb297('0x9')](),controller['getConditions']);router['get'](_0xb297('0xa'),auth['isAuthenticated'](),controller[_0xb297('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb297('0xc')](_0xb297('0xd'),auth[_0xb297('0x9')](),controller[_0xb297('0xe')]);router[_0xb297('0xc')]('/:id/actions',auth[_0xb297('0x9')](),controller['addActions']);router[_0xb297('0xf')](_0xb297('0x8'),auth[_0xb297('0x9')](),controller['update']);router[_0xb297('0x10')](_0xb297('0x8'),auth[_0xb297('0x9')](),controller[_0xb297('0x11')]);module[_0xb297('0x12')]=router; \ No newline at end of file +var _0x255f=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','show','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','/:id','update','destroy','exports','multer','path'];(function(_0x52223e,_0x30a024){var _0x31d2ce=function(_0x14250a){while(--_0x14250a){_0x52223e['push'](_0x52223e['shift']());}};_0x31d2ce(++_0x30a024);}(_0x255f,0x185));var _0xf255=function(_0x2d5a8e,_0x5b80e7){_0x2d5a8e=_0x2d5a8e-0x0;var _0x36e155=_0x255f[_0x2d5a8e];return _0x36e155;};'use strict';var multer=require(_0xf255('0x0'));var util=require('util');var path=require(_0xf255('0x1'));var timeout=require(_0xf255('0x2'));var express=require(_0xf255('0x3'));var router=express['Router']();var fs_extra=require(_0xf255('0x4'));var auth=require(_0xf255('0x5'));var interaction=require(_0xf255('0x6'));var config=require(_0xf255('0x7'));var controller=require(_0xf255('0x8'));router[_0xf255('0x9')]('/',auth[_0xf255('0xa')](),controller['index']);router[_0xf255('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf255('0xb')]);router[_0xf255('0x9')]('/:id/conditions',auth[_0xf255('0xa')](),controller[_0xf255('0xc')]);router['get'](_0xf255('0xd'),auth['isAuthenticated'](),controller[_0xf255('0xe')]);router[_0xf255('0xf')]('/',auth[_0xf255('0xa')](),controller[_0xf255('0x10')]);router[_0xf255('0xf')]('/:id/conditions',auth[_0xf255('0xa')](),controller[_0xf255('0x11')]);router[_0xf255('0xf')]('/:id/actions',auth[_0xf255('0xa')](),controller[_0xf255('0x12')]);router['put'](_0xf255('0x13'),auth[_0xf255('0xa')](),controller[_0xf255('0x14')]);router['delete'](_0xf255('0x13'),auth[_0xf255('0xa')](),controller[_0xf255('0x15')]);module[_0xf255('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 88369ac..9af56e3 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 _0xeeaf=['#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#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)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','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\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence'];(function(_0xad9ed5,_0x3c39af){var _0x5d6242=function(_0x491434){while(--_0x491434){_0xad9ed5['push'](_0xad9ed5['shift']());}};_0x5d6242(++_0x3c39af);}(_0xeeaf,0x150));var _0xfeea=function(_0xf0ed01,_0x2445dc){_0xf0ed01=_0xf0ed01-0x0;var _0x556048=_0xeeaf[_0xf0ed01];return _0x556048;};'use strict';var Sequelize=require(_0xfeea('0x0'));module['exports']={'name':{'type':Sequelize[_0xfeea('0x1')],'unique':_0xfeea('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xfeea('0x3')](_0xfeea('0x4')),'allowNull':![],'defaultValue':_0xfeea('0x4')},'description':{'type':Sequelize[_0xfeea('0x1')]},'active':{'type':Sequelize[_0xfeea('0x5')],'defaultValue':0x0,'comment':_0xfeea('0x6')},'limitCalls':{'type':Sequelize[_0xfeea('0x7')](0x4)[_0xfeea('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xfeea('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xfeea('0x7')](0x3)[_0xfeea('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfeea('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xfeea('0x7')](0x3)[_0xfeea('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfeea('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfeea('0x7')](0x5)[_0xfeea('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfeea('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xfeea('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfeea('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfeea('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfeea('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfeea('0x7')](0x3)[_0xfeea('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xfeea('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xfeea('0x7')](0x3)[_0xfeea('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xfeea('0xe')},'dialTimezone':{'type':Sequelize[_0xfeea('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xfeea('0x1')],'defaultValue':_0xfeea('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xfeea('0x3')](_0xfeea('0x10'),_0xfeea('0x11'),_0xfeea('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xfeea('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xfeea('0x7')](0x9)[_0xfeea('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfeea('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xfeea('0x7')](0x9)[_0xfeea('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xfeea('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xfeea('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfeea('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xfeea('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xfeea('0x7')](0x9)[_0xfeea('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xfeea('0x7')](0x9)[_0xfeea('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfeea('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xfeea('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfeea('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xfeea('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfeea('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfeea('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xfeea('0x3')](_0xfeea('0x1a'),_0xfeea('0x1b')),'defaultValue':_0xfeea('0x1a')},'dialPrefix':{'type':Sequelize[_0xfeea('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfeea('0x7')](0x3)[_0xfeea('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfeea('0x1c')},'dialCutDigit':{'type':Sequelize[_0xfeea('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfeea('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfeea('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfeea('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfeea('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0xfeea('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfeea('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xfeea('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfeea('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfeea('0x7')](0x5)[_0xfeea('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xfeea('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfeea('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xfeea('0x7')](0x5)[_0xfeea('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfeea('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfeea('0x7')](0x3)[_0xfeea('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xfeea('0x7')](0x5)[_0xfeea('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfeea('0x23')}}; \ No newline at end of file +var _0xdbc6=['UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\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\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign'];(function(_0x35de8f,_0x25d742){var _0x335249=function(_0x39a4c8){while(--_0x39a4c8){_0x35de8f['push'](_0x35de8f['shift']());}};_0x335249(++_0x25d742);}(_0xdbc6,0x13b));var _0x6dbc=function(_0xa8cac4,_0x3c5c05){_0xa8cac4=_0xa8cac4-0x0;var _0x25b83f=_0xdbc6[_0xa8cac4];return _0x25b83f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6dbc('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x6dbc('0x1')](_0x6dbc('0x2')),'allowNull':![],'defaultValue':_0x6dbc('0x2')},'description':{'type':Sequelize[_0x6dbc('0x0')]},'active':{'type':Sequelize[_0x6dbc('0x3')],'defaultValue':0x0,'comment':_0x6dbc('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x6dbc('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x6dbc('0x6')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6dbc('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x6dbc('0x7')](0x3)[_0x6dbc('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6dbc('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6dbc('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6dbc('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6dbc('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6dbc('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x6dbc('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6dbc('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6dbc('0x7')](0x5)[_0x6dbc('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6dbc('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6dbc('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6dbc('0x7')](0x5)[_0x6dbc('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6dbc('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x6dbc('0x7')](0x3)[_0x6dbc('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x6dbc('0xe')},'dialTimezone':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':_0x6dbc('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x6dbc('0x10'),_0x6dbc('0x11'),_0x6dbc('0x12')),'defaultValue':_0x6dbc('0x10')},'dialAMDActive':{'type':Sequelize[_0x6dbc('0x3')],'defaultValue':0x0,'comment':_0x6dbc('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x6dbc('0x7')](0x9)[_0x6dbc('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x6dbc('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6dbc('0x7')](0x9)[_0x6dbc('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6dbc('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6dbc('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6dbc('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x6dbc('0x7')](0x9)[_0x6dbc('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6dbc('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x6dbc('0x7')](0x9)[_0x6dbc('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6dbc('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6dbc('0x7')](0x9)[_0x6dbc('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6dbc('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x6dbc('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6dbc('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6dbc('0x7')](0x9)[_0x6dbc('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x6dbc('0x1')]('DESC',_0x6dbc('0x1b')),'defaultValue':_0x6dbc('0x1c')},'dialPrefix':{'type':Sequelize[_0x6dbc('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x6dbc('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6dbc('0x1d')},'dialCutDigit':{'type':Sequelize[_0x6dbc('0x7')](0x3)[_0x6dbc('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6dbc('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x6dbc('0x7')](0x3)[_0x6dbc('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6dbc('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6dbc('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6dbc('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x6dbc('0x7')](0x3)[_0x6dbc('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6dbc('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x6dbc('0x7')](0x5)[_0x6dbc('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6dbc('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6dbc('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6dbc('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x6dbc('0x7')](0x5)[_0x6dbc('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6dbc('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x6dbc('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6dbc('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0x6dbc('0x7')](0x5)[_0x6dbc('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6dbc('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6dbc('0x7')](0x3)[_0x6dbc('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x6dbc('0x7')](0x5)[_0x6dbc('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6dbc('0x27')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 351428b..4431660 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 _0xe0dc=['limit','count','Content-Range','apply','reject','update','then','destroy','IvrCampaigns','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','keys','filters','intersection','attributes','fields','query','length','order','sort','where','pick','merge','type','VIRTUAL','filter','options','Campaign','includeAll','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','createdAt','updatedAt','omit','UserProfileSection','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','phone','field','NOW()','toString','from','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','deletedAt\x20IS\x20NULL','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined'];(function(_0x1cac7d,_0x587638){var _0x468636=function(_0x455ba1){while(--_0x455ba1){_0x1cac7d['push'](_0x1cac7d['shift']());}};_0x468636(++_0x587638);}(_0xe0dc,0x77));var _0xce0d=function(_0x7a2a2f,_0x26057a){_0x7a2a2f=_0x7a2a2f-0x0;var _0x4fbb2a=_0xe0dc[_0x7a2a2f];return _0x4fbb2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce0d('0x0'));var zipdir=require(_0xce0d('0x1'));var jsonpatch=require(_0xce0d('0x2'));var rp=require('request-promise');var moment=require(_0xce0d('0x3'));var BPromise=require(_0xce0d('0x4'));var Mustache=require('mustache');var util=require(_0xce0d('0x5'));var path=require(_0xce0d('0x6'));var sox=require(_0xce0d('0x7'));var csv=require(_0xce0d('0x8'));var ejs=require(_0xce0d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce0d('0xa'));var squel=require(_0xce0d('0xb'));var crypto=require(_0xce0d('0xc'));var jsforce=require(_0xce0d('0xd'));var deskjs=require(_0xce0d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xce0d('0xf'));var Papa=require(_0xce0d('0x10'));var Redis=require(_0xce0d('0x11'));var authService=require(_0xce0d('0x12'));var qs=require(_0xce0d('0x13'));var as=require(_0xce0d('0x14'));var hardwareService=require(_0xce0d('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xce0d('0x16'));var config=require(_0xce0d('0x17'));var licenseUtil=require(_0xce0d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a5ee2,_0x939148){_0x939148=_0x939148||0xcc;return function(_0x46333e){if(_0x46333e){return _0x3a5ee2[_0xce0d('0x19')](_0x939148);}return _0x3a5ee2[_0xce0d('0x1a')](_0x939148)[_0xce0d('0x1b')]();};}function respondWithResult(_0x3ab231,_0xb49710){_0xb49710=_0xb49710||0xc8;return function(_0x260743){if(_0x260743){return _0x3ab231[_0xce0d('0x1a')](_0xb49710)[_0xce0d('0x1c')](_0x260743);}};}function respondWithFilteredResult(_0x6852f1,_0x1f8b05){return function(_0x1b6930){if(_0x1b6930){var _0x4d0a7b=typeof _0x1f8b05[_0xce0d('0x1d')]===_0xce0d('0x1e')&&typeof _0x1f8b05[_0xce0d('0x1f')]===_0xce0d('0x1e');var _0x4fc046=_0x1b6930[_0xce0d('0x20')];var _0x19295b=_0x4d0a7b?0x0:_0x1f8b05[_0xce0d('0x1d')];var _0x598284=_0x4d0a7b?_0x1b6930[_0xce0d('0x20')]:_0x1f8b05[_0xce0d('0x1d')]+_0x1f8b05['limit'];var _0x5379aa;if(_0x598284>=_0x4fc046){_0x598284=_0x4fc046;_0x5379aa=0xc8;}else{_0x5379aa=0xce;}_0x6852f1[_0xce0d('0x1a')](_0x5379aa);return _0x6852f1['set'](_0xce0d('0x21'),_0x19295b+'-'+_0x598284+'/'+_0x4fc046)['json'](_0x1b6930);}return null;};}function patchUpdates(_0x36ace7){return function(_0x37f0fa){try{jsonpatch[_0xce0d('0x22')](_0x37f0fa,_0x36ace7,!![]);}catch(_0xc4f5c7){return BPromise[_0xce0d('0x23')](_0xc4f5c7);}return _0x37f0fa['save']();};}function saveUpdates(_0x337cc6,_0x4e4768){return function(_0x4e745c){if(_0x4e745c){return _0x4e745c[_0xce0d('0x24')](_0x337cc6)[_0xce0d('0x25')](function(_0xbfeca5){return _0xbfeca5;});}return null;};}function removeEntity(_0x407529,_0x5c3c0e){return function(_0x59b7f4){if(_0x59b7f4){return _0x59b7f4[_0xce0d('0x26')]()[_0xce0d('0x25')](function(){var _0x3a40e5=_0x59b7f4['get']({'plain':!![]});var _0x221134=_0xce0d('0x27');return db[_0xce0d('0x28')]['destroy']({'where':{'type':_0x221134,'resourceId':_0x3a40e5['id']}})[_0xce0d('0x25')](function(){return _0x59b7f4;});})[_0xce0d('0x25')](function(){_0x407529[_0xce0d('0x1a')](0xcc)[_0xce0d('0x1b')]();});}};}function handleEntityNotFound(_0x54ddaf,_0x51c773){return function(_0x13577e){if(!_0x13577e){_0x54ddaf[_0xce0d('0x19')](0x194);}return _0x13577e;};}function handleError(_0x2fbaca,_0x28f415){_0x28f415=_0x28f415||0x1f4;return function(_0x3e4b39){logger[_0xce0d('0x29')](_0x3e4b39[_0xce0d('0x2a')]);if(_0x3e4b39[_0xce0d('0x2b')]){delete _0x3e4b39[_0xce0d('0x2b')];}_0x2fbaca[_0xce0d('0x1a')](_0x28f415)[_0xce0d('0x2c')](_0x3e4b39);};}exports[_0xce0d('0x2d')]=function(_0x2ac5a1,_0x2e31d6){var _0x3bf08a={},_0x3c690={},_0x5b8758={'count':0x0,'rows':[]};var _0xd14899=_['map'](db['Campaign'][_0xce0d('0x2e')],function(_0x4b733d){return{'name':_0x4b733d[_0xce0d('0x2f')],'type':_0x4b733d['type'][_0xce0d('0x30')]};});_0x3c690[_0xce0d('0x31')]=_[_0xce0d('0x32')](_0xd14899,_0xce0d('0x2b'));_0x3c690['query']=_[_0xce0d('0x33')](_0x2ac5a1['query']);_0x3c690[_0xce0d('0x34')]=_[_0xce0d('0x35')](_0x3c690[_0xce0d('0x31')],_0x3c690['query']);_0x3bf08a[_0xce0d('0x36')]=_[_0xce0d('0x35')](_0x3c690[_0xce0d('0x31')],qs[_0xce0d('0x37')](_0x2ac5a1[_0xce0d('0x38')]['fields']));_0x3bf08a[_0xce0d('0x36')]=_0x3bf08a[_0xce0d('0x36')][_0xce0d('0x39')]?_0x3bf08a[_0xce0d('0x36')]:_0x3c690[_0xce0d('0x31')];if(!_0x2ac5a1[_0xce0d('0x38')]['hasOwnProperty']('nolimit')){_0x3bf08a['limit']=qs[_0xce0d('0x1f')](_0x2ac5a1[_0xce0d('0x38')][_0xce0d('0x1f')]);_0x3bf08a[_0xce0d('0x1d')]=qs[_0xce0d('0x1d')](_0x2ac5a1[_0xce0d('0x38')]['offset']);}_0x3bf08a[_0xce0d('0x3a')]=qs[_0xce0d('0x3b')](_0x2ac5a1[_0xce0d('0x38')]['sort']);_0x3bf08a[_0xce0d('0x3c')]=qs[_0xce0d('0x34')](_[_0xce0d('0x3d')](_0x2ac5a1[_0xce0d('0x38')],_0x3c690['filters']),_0xd14899);if(_0x2ac5a1[_0xce0d('0x38')]['filter']){_0x3bf08a[_0xce0d('0x3c')]=_[_0xce0d('0x3e')](_0x3bf08a['where'],{'$or':_[_0xce0d('0x32')](_0xd14899,function(_0x118037){if(_0x118037[_0xce0d('0x3f')]!==_0xce0d('0x40')){var _0x1b14c5={};_0x1b14c5[_0x118037[_0xce0d('0x2b')]]={'$like':'%'+_0x2ac5a1[_0xce0d('0x38')][_0xce0d('0x41')]+'%'};return _0x1b14c5;}})});}_0x3bf08a=_[_0xce0d('0x3e')]({},_0x3bf08a,_0x2ac5a1[_0xce0d('0x42')]);var _0x32dc5e={'where':_0x3bf08a[_0xce0d('0x3c')]};return db[_0xce0d('0x43')]['count'](_0x32dc5e)[_0xce0d('0x25')](function(_0x543347){_0x5b8758[_0xce0d('0x20')]=_0x543347;if(_0x2ac5a1[_0xce0d('0x38')][_0xce0d('0x44')]){_0x3bf08a['include']=[{'all':!![]}];}return db[_0xce0d('0x43')][_0xce0d('0x45')](_0x3bf08a);})[_0xce0d('0x25')](function(_0x123876){_0x5b8758[_0xce0d('0x46')]=_0x123876;return _0x5b8758;})[_0xce0d('0x25')](respondWithFilteredResult(_0x2e31d6,_0x3bf08a))[_0xce0d('0x47')](handleError(_0x2e31d6,null));};exports[_0xce0d('0x48')]=function(_0xf5122e,_0x34a106){var _0x219753={'raw':![],'where':{'id':_0xf5122e[_0xce0d('0x49')]['id']}},_0x4a6272={};_0x4a6272[_0xce0d('0x31')]=_[_0xce0d('0x33')](db['Campaign']['rawAttributes']);_0x4a6272['query']=_[_0xce0d('0x33')](_0xf5122e[_0xce0d('0x38')]);_0x4a6272[_0xce0d('0x34')]=_[_0xce0d('0x35')](_0x4a6272[_0xce0d('0x31')],_0x4a6272[_0xce0d('0x38')]);_0x219753[_0xce0d('0x36')]=_[_0xce0d('0x35')](_0x4a6272[_0xce0d('0x31')],qs[_0xce0d('0x37')](_0xf5122e[_0xce0d('0x38')][_0xce0d('0x37')]));_0x219753[_0xce0d('0x36')]=_0x219753[_0xce0d('0x36')][_0xce0d('0x39')]?_0x219753['attributes']:_0x4a6272[_0xce0d('0x31')];if(_0xf5122e[_0xce0d('0x38')]['includeAll']){_0x219753['include']=[{'all':!![]}];}_0x219753=_['merge']({},_0x219753,_0xf5122e['options']);return db[_0xce0d('0x43')][_0xce0d('0x4a')](_0x219753)[_0xce0d('0x25')](handleEntityNotFound(_0x34a106,null))[_0xce0d('0x25')](respondWithResult(_0x34a106,null))[_0xce0d('0x47')](handleError(_0x34a106,null));};exports[_0xce0d('0x4b')]=function(_0x497052,_0x5ba16e){return db[_0xce0d('0x43')]['create'](_0x497052[_0xce0d('0x4c')],{})[_0xce0d('0x25')](function(_0x3f724a){var _0xf92f95=_0x497052[_0xce0d('0x4d')]['get']({'plain':!![]});if(!_0xf92f95)throw new Error(_0xce0d('0x4e'));if(_0xf92f95[_0xce0d('0x4f')]===_0xce0d('0x4d')){var _0x15f678=_0x3f724a[_0xce0d('0x50')]({'plain':!![]});var _0xcbccf='IvrCampaigns';return db['UserProfileSection'][_0xce0d('0x4a')]({'where':{'name':_0xcbccf,'userProfileId':_0xf92f95[_0xce0d('0x51')]},'raw':!![]})[_0xce0d('0x25')](function(_0x3555ef){if(_0x3555ef&&_0x3555ef[_0xce0d('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x15f678[_0xce0d('0x2b')],'resourceId':_0x15f678['id'],'type':_0x3555ef['name'],'sectionId':_0x3555ef['id']},{})[_0xce0d('0x25')](function(){return _0x3f724a;});}else{return _0x3f724a;}})[_0xce0d('0x47')](function(_0x394035){logger['error'](_0xce0d('0x53'),_0x394035);throw _0x394035;});}return _0x3f724a;})[_0xce0d('0x25')](respondWithResult(_0x5ba16e,0xc9))[_0xce0d('0x47')](handleError(_0x5ba16e,null));};exports[_0xce0d('0x54')]=function(_0x4030a8,_0x3eebfc){var _0x2a27d5={'where':{'id':_0x4030a8[_0xce0d('0x49')]['id']}},_0x12a1ea={};_0x12a1ea['model']=_['keys'](db[_0xce0d('0x43')]['rawAttributes']);_0x2a27d5[_0xce0d('0x36')]=_[_0xce0d('0x35')](_0x12a1ea[_0xce0d('0x31')],qs['fields'](_0x4030a8[_0xce0d('0x38')][_0xce0d('0x37')]));_0x2a27d5[_0xce0d('0x36')]=_0x2a27d5[_0xce0d('0x36')][_0xce0d('0x39')]?_0x2a27d5[_0xce0d('0x36')]:_0x12a1ea['model'];if(_0x4030a8[_0xce0d('0x38')][_0xce0d('0x44')]){_0x2a27d5[_0xce0d('0x55')]=[{'all':!![]}];}_0x2a27d5=_[_0xce0d('0x3e')]({},_0x2a27d5,_0x4030a8['options']);return db['Campaign']['find'](_0x2a27d5)['then'](handleEntityNotFound(_0x3eebfc,null))[_0xce0d('0x25')](function(_0x25c334){if(_0x25c334){var _0x4bd5cc=_0x25c334[_0xce0d('0x50')]({'plain':!![]});_0x4bd5cc=qs['omit'](_0x4bd5cc,['id',_0xce0d('0x56'),_0xce0d('0x57')]);_0x4030a8[_0xce0d('0x4c')]=_[_0xce0d('0x58')](_0x4030a8[_0xce0d('0x4c')],['id',_0xce0d('0x56'),_0xce0d('0x57')]);return db[_0xce0d('0x43')][_0xce0d('0x4b')](_[_0xce0d('0x3e')](_0x4bd5cc,_0x4030a8[_0xce0d('0x4c')]),{'include':_0x4030a8[_0xce0d('0x38')][_0xce0d('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x467d22){var _0x29d4ae=_0x4030a8[_0xce0d('0x4d')][_0xce0d('0x50')]({'plain':!![]});if(!_0x29d4ae)throw new Error(_0xce0d('0x4e'));if(_0x29d4ae[_0xce0d('0x4f')]==='user'){var _0x15bab9=_0x467d22[_0xce0d('0x50')]({'plain':!![]});var _0xfe3fc='IvrCampaigns';return db[_0xce0d('0x59')]['find']({'where':{'name':_0xfe3fc,'userProfileId':_0x29d4ae['userProfileId']},'raw':!![]})['then'](function(_0x4192ee){if(_0x4192ee&&_0x4192ee[_0xce0d('0x52')]===0x0){return db[_0xce0d('0x28')][_0xce0d('0x4b')]({'name':_0x15bab9[_0xce0d('0x2b')],'resourceId':_0x15bab9['id'],'type':_0x4192ee[_0xce0d('0x2b')],'sectionId':_0x4192ee['id']},{})['then'](function(){return _0x467d22;});}else{return _0x467d22;}})[_0xce0d('0x47')](function(_0xd5c7cb){logger[_0xce0d('0x29')](_0xce0d('0x53'),_0xd5c7cb);throw _0xd5c7cb;});}return _0x467d22;});}})['then'](respondWithResult(_0x3eebfc,0xc9))['catch'](handleError(_0x3eebfc,null));};exports[_0xce0d('0x24')]=function(_0x11eefe,_0x120eb2){if(_0x11eefe[_0xce0d('0x4c')]['id']){delete _0x11eefe['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x11eefe[_0xce0d('0x49')]['id']}})[_0xce0d('0x25')](handleEntityNotFound(_0x120eb2,null))[_0xce0d('0x25')](saveUpdates(_0x11eefe[_0xce0d('0x4c')],null))[_0xce0d('0x25')](respondWithResult(_0x120eb2,null))[_0xce0d('0x47')](handleError(_0x120eb2,null));};exports['destroy']=function(_0x42df70,_0x5cb491){return db[_0xce0d('0x43')][_0xce0d('0x4a')]({'where':{'id':_0x42df70[_0xce0d('0x49')]['id']}})['then'](handleEntityNotFound(_0x5cb491,null))[_0xce0d('0x25')](removeEntity(_0x5cb491,null))['catch'](handleError(_0x5cb491,null));};exports[_0xce0d('0x5a')]=function(_0x35a27e,_0x22e2d6,_0x38add9){var _0x32b9f8={'raw':!![],'where':{}};var _0x1067fd={};var _0x9ffab3={'count':0x0,'rows':[]};return db['Campaign'][_0xce0d('0x5b')]({'where':{'id':_0x35a27e[_0xce0d('0x49')]['id']}})[_0xce0d('0x25')](handleEntityNotFound(_0x22e2d6,null))[_0xce0d('0x25')](function(_0x3ee294){if(_0x3ee294){_0x1067fd[_0xce0d('0x31')]=_[_0xce0d('0x33')](db[_0xce0d('0x5c')][_0xce0d('0x2e')]);_0x1067fd[_0xce0d('0x38')]=_[_0xce0d('0x33')](_0x35a27e[_0xce0d('0x38')]);_0x1067fd['filters']=_[_0xce0d('0x35')](_0x1067fd[_0xce0d('0x31')],_0x1067fd[_0xce0d('0x38')]);_0x32b9f8[_0xce0d('0x36')]=_[_0xce0d('0x35')](_0x1067fd[_0xce0d('0x31')],qs[_0xce0d('0x37')](_0x35a27e[_0xce0d('0x38')][_0xce0d('0x37')]));_0x32b9f8['attributes']=_0x32b9f8['attributes'][_0xce0d('0x39')]?_0x32b9f8[_0xce0d('0x36')]:_0x1067fd[_0xce0d('0x31')];if(!_0x35a27e['query'][_0xce0d('0x5d')](_0xce0d('0x5e'))){_0x32b9f8[_0xce0d('0x1f')]=qs[_0xce0d('0x1f')](_0x35a27e[_0xce0d('0x38')][_0xce0d('0x1f')]);_0x32b9f8[_0xce0d('0x1d')]=qs[_0xce0d('0x1d')](_0x35a27e['query']['offset']);}_0x32b9f8[_0xce0d('0x3a')]=qs[_0xce0d('0x3b')](_0x35a27e[_0xce0d('0x38')][_0xce0d('0x3b')]);_0x32b9f8[_0xce0d('0x3c')]=qs[_0xce0d('0x34')](_[_0xce0d('0x3d')](_0x35a27e['query'],_0x1067fd[_0xce0d('0x34')]));_0x32b9f8[_0xce0d('0x3c')][_0xce0d('0x5f')]=_0x3ee294['id'];if(_0x35a27e[_0xce0d('0x38')]['filter']){_0x32b9f8[_0xce0d('0x3c')]=_[_0xce0d('0x3e')](_0x32b9f8[_0xce0d('0x3c')],{'$or':_[_0xce0d('0x32')](_0x32b9f8[_0xce0d('0x36')],function(_0x93e3aa){var _0x45e154={};_0x45e154[_0x93e3aa]={'$like':'%'+_0x35a27e[_0xce0d('0x38')][_0xce0d('0x41')]+'%'};return _0x45e154;})});}_0x32b9f8=_[_0xce0d('0x3e')]({},_0x32b9f8,_0x35a27e[_0xce0d('0x42')]);return db[_0xce0d('0x5c')]['count']({'where':_0x32b9f8['where']})['then'](function(_0x2e10d0){_0x9ffab3[_0xce0d('0x20')]=_0x2e10d0;if(_0x35a27e[_0xce0d('0x38')][_0xce0d('0x44')]){_0x32b9f8[_0xce0d('0x55')]=[{'all':!![]}];}return db[_0xce0d('0x5c')][_0xce0d('0x45')](_0x32b9f8);})[_0xce0d('0x25')](function(_0x4c3c92){_0x9ffab3[_0xce0d('0x46')]=_0x4c3c92;return _0x9ffab3;});}})[_0xce0d('0x25')](respondWithFilteredResult(_0x22e2d6,_0x32b9f8))['catch'](handleError(_0x22e2d6,null));};exports[_0xce0d('0x60')]=function(_0x2f5be2,_0x192b34,_0x3337f5){var _0x344d46={'raw':!![],'where':{}};var _0x30a204={};var _0x3ad14e={'count':0x0,'rows':[]};return db[_0xce0d('0x43')]['findOne']({'where':{'id':_0x2f5be2[_0xce0d('0x49')]['id']}})[_0xce0d('0x25')](handleEntityNotFound(_0x192b34,null))[_0xce0d('0x25')](function(_0x17877d){if(_0x17877d){_0x30a204[_0xce0d('0x31')]=_[_0xce0d('0x33')](db[_0xce0d('0x61')]['rawAttributes']);_0x30a204['query']=_[_0xce0d('0x33')](_0x2f5be2[_0xce0d('0x38')]);_0x30a204[_0xce0d('0x34')]=_[_0xce0d('0x35')](_0x30a204[_0xce0d('0x31')],_0x30a204[_0xce0d('0x38')]);_0x344d46[_0xce0d('0x36')]=_[_0xce0d('0x35')](_0x30a204[_0xce0d('0x31')],qs[_0xce0d('0x37')](_0x2f5be2[_0xce0d('0x38')][_0xce0d('0x37')]));_0x344d46[_0xce0d('0x36')]=_0x344d46['attributes'][_0xce0d('0x39')]?_0x344d46[_0xce0d('0x36')]:_0x30a204[_0xce0d('0x31')];if(!_0x2f5be2['query'][_0xce0d('0x5d')](_0xce0d('0x5e'))){_0x344d46[_0xce0d('0x1f')]=qs[_0xce0d('0x1f')](_0x2f5be2[_0xce0d('0x38')]['limit']);_0x344d46['offset']=qs[_0xce0d('0x1d')](_0x2f5be2[_0xce0d('0x38')][_0xce0d('0x1d')]);}_0x344d46[_0xce0d('0x3a')]=qs['sort'](_0x2f5be2[_0xce0d('0x38')]['sort']);_0x344d46[_0xce0d('0x3c')]=qs[_0xce0d('0x34')](_['pick'](_0x2f5be2[_0xce0d('0x38')],_0x30a204[_0xce0d('0x34')]));_0x344d46[_0xce0d('0x3c')][_0xce0d('0x5f')]=_0x17877d['id'];if(_0x2f5be2[_0xce0d('0x38')][_0xce0d('0x41')]){_0x344d46['where']=_[_0xce0d('0x3e')](_0x344d46[_0xce0d('0x3c')],{'$or':_[_0xce0d('0x32')](_0x344d46[_0xce0d('0x36')],function(_0x545b6a){var _0x1acce8={};_0x1acce8[_0x545b6a]={'$like':'%'+_0x2f5be2[_0xce0d('0x38')]['filter']+'%'};return _0x1acce8;})});}_0x344d46=_['merge']({},_0x344d46,_0x2f5be2[_0xce0d('0x42')]);return db[_0xce0d('0x61')][_0xce0d('0x20')]({'where':_0x344d46[_0xce0d('0x3c')]})['then'](function(_0x4ebca4){_0x3ad14e['count']=_0x4ebca4;if(_0x2f5be2[_0xce0d('0x38')]['includeAll']){_0x344d46[_0xce0d('0x55')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xce0d('0x45')](_0x344d46);})['then'](function(_0x27e5c5){_0x3ad14e[_0xce0d('0x46')]=_0x27e5c5;return _0x3ad14e;});}})['then'](respondWithFilteredResult(_0x192b34,_0x344d46))[_0xce0d('0x47')](handleError(_0x192b34,null));};exports[_0xce0d('0x62')]=function(_0x5e77d5,_0x359457,_0x4ce9bd){var _0x35465d={'raw':!![],'where':{}};var _0x217c14={};var _0x3a8cfe={'count':0x0,'rows':[]};return db[_0xce0d('0x43')][_0xce0d('0x5b')]({'where':{'id':_0x5e77d5[_0xce0d('0x49')]['id']}})[_0xce0d('0x25')](handleEntityNotFound(_0x359457,null))[_0xce0d('0x25')](function(_0x23527c){if(_0x23527c){_0x217c14[_0xce0d('0x31')]=_[_0xce0d('0x33')](db[_0xce0d('0x63')][_0xce0d('0x2e')]);_0x217c14['query']=_[_0xce0d('0x33')](_0x5e77d5[_0xce0d('0x38')]);_0x217c14[_0xce0d('0x34')]=_[_0xce0d('0x35')](_0x217c14[_0xce0d('0x31')],_0x217c14[_0xce0d('0x38')]);_0x35465d[_0xce0d('0x36')]=_[_0xce0d('0x35')](_0x217c14[_0xce0d('0x31')],qs[_0xce0d('0x37')](_0x5e77d5['query']['fields']));_0x35465d[_0xce0d('0x36')]=_0x35465d[_0xce0d('0x36')][_0xce0d('0x39')]?_0x35465d[_0xce0d('0x36')]:_0x217c14[_0xce0d('0x31')];if(!_0x5e77d5[_0xce0d('0x38')][_0xce0d('0x5d')]('nolimit')){_0x35465d[_0xce0d('0x1f')]=qs[_0xce0d('0x1f')](_0x5e77d5[_0xce0d('0x38')]['limit']);_0x35465d['offset']=qs[_0xce0d('0x1d')](_0x5e77d5[_0xce0d('0x38')][_0xce0d('0x1d')]);}_0x35465d[_0xce0d('0x3a')]=qs['sort'](_0x5e77d5[_0xce0d('0x38')]['sort']);_0x35465d[_0xce0d('0x3c')]=qs[_0xce0d('0x34')](_['pick'](_0x5e77d5[_0xce0d('0x38')],_0x217c14['filters']));_0x35465d[_0xce0d('0x3c')]['CampaignId']=_0x23527c['id'];if(_0x5e77d5[_0xce0d('0x38')][_0xce0d('0x41')]){_0x35465d['where']=_['merge'](_0x35465d['where'],{'$or':_['map'](_0x35465d[_0xce0d('0x36')],function(_0x27f73f){var _0x29b3ea={};_0x29b3ea[_0x27f73f]={'$like':'%'+_0x5e77d5[_0xce0d('0x38')][_0xce0d('0x41')]+'%'};return _0x29b3ea;})});}_0x35465d=_[_0xce0d('0x3e')]({},_0x35465d,_0x5e77d5[_0xce0d('0x42')]);return db[_0xce0d('0x63')]['count']({'where':_0x35465d[_0xce0d('0x3c')]})[_0xce0d('0x25')](function(_0x4a0ae9){_0x3a8cfe[_0xce0d('0x20')]=_0x4a0ae9;if(_0x5e77d5[_0xce0d('0x38')][_0xce0d('0x44')]){_0x35465d['include']=[{'all':!![]}];}return db[_0xce0d('0x63')]['findAll'](_0x35465d);})[_0xce0d('0x25')](function(_0x3b289f){_0x3a8cfe['rows']=_0x3b289f;return _0x3a8cfe;});}})[_0xce0d('0x25')](respondWithFilteredResult(_0x359457,_0x35465d))[_0xce0d('0x47')](handleError(_0x359457,null));};exports['getHopperBlacks']=function(_0x442d57,_0x1a9e4e,_0x4d2796){var _0x4bf001={'raw':!![],'where':{}};var _0x3d60b5={};var _0x4d780b={'count':0x0,'rows':[]};return db[_0xce0d('0x43')][_0xce0d('0x5b')]({'where':{'id':_0x442d57[_0xce0d('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a9e4e,null))[_0xce0d('0x25')](function(_0x433b39){if(_0x433b39){_0x3d60b5[_0xce0d('0x31')]=_[_0xce0d('0x33')](db[_0xce0d('0x64')]['rawAttributes']);_0x3d60b5[_0xce0d('0x38')]=_['keys'](_0x442d57[_0xce0d('0x38')]);_0x3d60b5[_0xce0d('0x34')]=_[_0xce0d('0x35')](_0x3d60b5[_0xce0d('0x31')],_0x3d60b5[_0xce0d('0x38')]);_0x4bf001[_0xce0d('0x36')]=_[_0xce0d('0x35')](_0x3d60b5[_0xce0d('0x31')],qs[_0xce0d('0x37')](_0x442d57[_0xce0d('0x38')][_0xce0d('0x37')]));_0x4bf001[_0xce0d('0x36')]=_0x4bf001['attributes'][_0xce0d('0x39')]?_0x4bf001['attributes']:_0x3d60b5[_0xce0d('0x31')];if(!_0x442d57[_0xce0d('0x38')][_0xce0d('0x5d')]('nolimit')){_0x4bf001[_0xce0d('0x1f')]=qs['limit'](_0x442d57[_0xce0d('0x38')]['limit']);_0x4bf001[_0xce0d('0x1d')]=qs[_0xce0d('0x1d')](_0x442d57[_0xce0d('0x38')][_0xce0d('0x1d')]);}_0x4bf001[_0xce0d('0x3a')]=qs[_0xce0d('0x3b')](_0x442d57[_0xce0d('0x38')][_0xce0d('0x3b')]);_0x4bf001[_0xce0d('0x3c')]=qs[_0xce0d('0x34')](_[_0xce0d('0x3d')](_0x442d57[_0xce0d('0x38')],_0x3d60b5['filters']));_0x4bf001[_0xce0d('0x3c')][_0xce0d('0x5f')]=_0x433b39['id'];if(_0x442d57['query'][_0xce0d('0x41')]){_0x4bf001[_0xce0d('0x3c')]=_['merge'](_0x4bf001[_0xce0d('0x3c')],{'$or':_[_0xce0d('0x32')](_0x4bf001[_0xce0d('0x36')],function(_0x38c3df){var _0x114185={};_0x114185[_0x38c3df]={'$like':'%'+_0x442d57[_0xce0d('0x38')][_0xce0d('0x41')]+'%'};return _0x114185;})});}_0x4bf001=_['merge']({},_0x4bf001,_0x442d57[_0xce0d('0x42')]);return db[_0xce0d('0x64')][_0xce0d('0x20')]({'where':_0x4bf001[_0xce0d('0x3c')]})[_0xce0d('0x25')](function(_0x564a2b){_0x4d780b['count']=_0x564a2b;if(_0x442d57[_0xce0d('0x38')][_0xce0d('0x44')]){_0x4bf001['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xce0d('0x45')](_0x4bf001);})[_0xce0d('0x25')](function(_0x2da9b4){_0x4d780b['rows']=_0x2da9b4;return _0x4d780b;});}})['then'](respondWithFilteredResult(_0x1a9e4e,_0x4bf001))['catch'](handleError(_0x1a9e4e,null));};exports['getLists']=function(_0x317d85,_0x5da8df,_0x4863da){var _0x11c87a={};var _0xd940c7={};var _0x57e705;var _0x13188d;return db['Campaign'][_0xce0d('0x5b')]({'where':{'id':_0x317d85[_0xce0d('0x49')]['id']}})[_0xce0d('0x25')](handleEntityNotFound(_0x5da8df,null))['then'](function(_0x41767a){if(_0x41767a){_0x57e705=_0x41767a;_0xd940c7[_0xce0d('0x31')]=_['keys'](db[_0xce0d('0x65')][_0xce0d('0x2e')]);_0xd940c7[_0xce0d('0x38')]=_[_0xce0d('0x33')](_0x317d85[_0xce0d('0x38')]);_0xd940c7[_0xce0d('0x34')]=_[_0xce0d('0x35')](_0xd940c7['model'],_0xd940c7['query']);_0x11c87a['attributes']=_[_0xce0d('0x35')](_0xd940c7[_0xce0d('0x31')],qs[_0xce0d('0x37')](_0x317d85['query']['fields']));_0x11c87a[_0xce0d('0x36')]=_0x11c87a[_0xce0d('0x36')]['length']?_0x11c87a[_0xce0d('0x36')]:_0xd940c7[_0xce0d('0x31')];_0x11c87a[_0xce0d('0x3a')]=qs[_0xce0d('0x3b')](_0x317d85['query']['sort']);_0x11c87a['where']=qs[_0xce0d('0x34')](_[_0xce0d('0x3d')](_0x317d85[_0xce0d('0x38')],_0xd940c7[_0xce0d('0x34')]));if(_0x317d85['query'][_0xce0d('0x41')]){_0x11c87a[_0xce0d('0x3c')]=_['merge'](_0x11c87a[_0xce0d('0x3c')],{'$or':_['map'](_0x11c87a[_0xce0d('0x36')],function(_0x3a6f21){var _0xddc2ea={};_0xddc2ea[_0x3a6f21]={'$like':'%'+_0x317d85['query'][_0xce0d('0x41')]+'%'};return _0xddc2ea;})});}_0x11c87a=_['merge']({},_0x11c87a,_0x317d85[_0xce0d('0x42')]);return _0x57e705[_0xce0d('0x66')](_0x11c87a);}})[_0xce0d('0x25')](function(_0x446c39){if(_0x446c39){_0x13188d=_0x446c39[_0xce0d('0x39')];if(!_0x317d85['query'][_0xce0d('0x5d')]('nolimit')){_0x11c87a[_0xce0d('0x1f')]=qs[_0xce0d('0x1f')](_0x317d85['query'][_0xce0d('0x1f')]);_0x11c87a[_0xce0d('0x1d')]=qs[_0xce0d('0x1d')](_0x317d85[_0xce0d('0x38')]['offset']);}return _0x57e705['getLists'](_0x11c87a);}})['then'](function(_0x20c2bf){if(_0x20c2bf){return _0x20c2bf?{'count':_0x13188d,'rows':_0x20c2bf}:null;}})[_0xce0d('0x25')](respondWithResult(_0x5da8df,null))[_0xce0d('0x47')](handleError(_0x5da8df,null));};exports[_0xce0d('0x67')]=function(_0x3cb52f,_0x1a7c34,_0x3d47a5){var _0x1f2e46,_0x56144a;var _0x5dcfcb=[];var _0x402a73=moment()[_0xce0d('0x68')](_0xce0d('0x69'));return db[_0xce0d('0x43')]['find']({'where':{'id':_0x3cb52f['params']['id']}})[_0xce0d('0x25')](handleEntityNotFound(_0x1a7c34,null))['then'](function(_0x2b991){if(_0x2b991){_0x56144a=_0x2b991;return _0x2b991['addLists'](_0x3cb52f[_0xce0d('0x4c')][_0xce0d('0x6a')],_['omit'](_0x3cb52f['body'],[_0xce0d('0x6a'),'id'])||{});}return null;})[_0xce0d('0x6b')](function(_0x53cfe1){var _0x527794;var _0x4282ee;_0x1f2e46=_0x53cfe1||[];var _0x4aded0=[];if(_0x53cfe1){for(var _0x321ccd=0x0;_0x321ccd<_0x53cfe1['length'];_0x321ccd+=0x1){var _0x2e3b96=_0x53cfe1[_0x321ccd]['get']({'plain':!![]});_0x56144a[_0xce0d('0x6c')]=_0x3cb52f[_0xce0d('0x4c')][_0xce0d('0x6c')]?_0x3cb52f[_0xce0d('0x4c')]['dialCheckDuplicateType']:_0x56144a[_0xce0d('0x6c')];switch(_0x56144a[_0xce0d('0x6c')]){case'always':_0x527794=squel[_0xce0d('0x6d')]()[_0xce0d('0x6e')](_0xce0d('0x6f'))[_0xce0d('0x70')](['phone',_0xce0d('0x71'),_0xce0d('0x72'),_0xce0d('0x73'),'CampaignId',_0xce0d('0x56'),_0xce0d('0x57')],squel[_0xce0d('0x74')]()['field'](_0xce0d('0x75'),'phone')[_0xce0d('0x76')](_0xce0d('0x77'),_0xce0d('0x71'))[_0xce0d('0x76')]('id',_0xce0d('0x72'))[_0xce0d('0x76')](_0x2e3b96['CmListId'][_0xce0d('0x78')](),_0xce0d('0x73'))['field'](_0x3cb52f[_0xce0d('0x49')]['id'][_0xce0d('0x78')](),'CampaignId')[_0xce0d('0x76')]('\x27'+_0x402a73+'\x27','createdAt')['field']('\x27'+_0x402a73+'\x27',_0xce0d('0x57'))[_0xce0d('0x79')](_0xce0d('0x7a'))[_0xce0d('0x3c')]('deletedAt\x20IS\x20NULL')[_0xce0d('0x3c')](_0xce0d('0x7b'),_0x2e3b96[_0xce0d('0x7c')][_0xce0d('0x78')]())[_0xce0d('0x3c')](_0xce0d('0x7d'))[_0xce0d('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xce0d('0x76')](_0xce0d('0x7e'))['from'](_0xce0d('0x7f'))[_0xce0d('0x3c')]('CampaignId\x20=\x20?',_0x3cb52f['params']['id']['toString']()))['where'](_0xce0d('0x80'),squel[_0xce0d('0x74')]()[_0xce0d('0x76')](_0xce0d('0x81'))[_0xce0d('0x79')]('cm_hopper')[_0xce0d('0x3c')](_0xce0d('0x82'),_0x3cb52f[_0xce0d('0x49')]['id']['toString']())))['toString']();break;case _0xce0d('0x83'):_0x527794=squel[_0xce0d('0x6d')]()[_0xce0d('0x6e')](_0xce0d('0x6f'))[_0xce0d('0x70')]([_0xce0d('0x75'),'scheduledAt',_0xce0d('0x72'),_0xce0d('0x73'),'CampaignId','createdAt',_0xce0d('0x57')],squel['select']()[_0xce0d('0x76')]('phone',_0xce0d('0x75'))[_0xce0d('0x76')](_0xce0d('0x77'),_0xce0d('0x71'))[_0xce0d('0x76')]('id',_0xce0d('0x72'))[_0xce0d('0x76')](_0x2e3b96[_0xce0d('0x7c')][_0xce0d('0x78')](),_0xce0d('0x73'))[_0xce0d('0x76')](_0x3cb52f[_0xce0d('0x49')]['id'][_0xce0d('0x78')](),'CampaignId')[_0xce0d('0x76')]('\x27'+_0x402a73+'\x27',_0xce0d('0x56'))[_0xce0d('0x76')]('\x27'+_0x402a73+'\x27',_0xce0d('0x57'))[_0xce0d('0x79')](_0xce0d('0x7a'))[_0xce0d('0x3c')]('deletedAt\x20IS\x20NULL')['where'](_0xce0d('0x7b'),_0x2e3b96[_0xce0d('0x7c')][_0xce0d('0x78')]())[_0xce0d('0x3c')](_0xce0d('0x7d'))[_0xce0d('0x3c')](_0xce0d('0x80'),squel[_0xce0d('0x74')]()[_0xce0d('0x76')](_0xce0d('0x81'))[_0xce0d('0x79')]('cm_hopper')['where'](_0xce0d('0x82'),_0x3cb52f[_0xce0d('0x49')]['id']['toString']())))[_0xce0d('0x78')]();break;default:_0x527794=squel['insert']()['into']('cm_hopper')['fromQuery']([_0xce0d('0x75'),_0xce0d('0x71'),'ContactId',_0xce0d('0x73'),_0xce0d('0x5f'),_0xce0d('0x56'),_0xce0d('0x57')],squel['select']()[_0xce0d('0x76')]('phone',_0xce0d('0x75'))[_0xce0d('0x76')]('NOW()',_0xce0d('0x71'))['field']('id',_0xce0d('0x72'))[_0xce0d('0x76')](_0x2e3b96[_0xce0d('0x7c')][_0xce0d('0x78')](),_0xce0d('0x73'))[_0xce0d('0x76')](_0x3cb52f[_0xce0d('0x49')]['id'][_0xce0d('0x78')](),_0xce0d('0x5f'))[_0xce0d('0x76')]('\x27'+_0x402a73+'\x27',_0xce0d('0x56'))[_0xce0d('0x76')]('\x27'+_0x402a73+'\x27',_0xce0d('0x57'))[_0xce0d('0x79')](_0xce0d('0x7a'))[_0xce0d('0x3c')]('deletedAt\x20IS\x20NULL')['where'](_0xce0d('0x7b'),_0x2e3b96['CmListId'][_0xce0d('0x78')]())[_0xce0d('0x3c')](_0xce0d('0x7d')))[_0xce0d('0x78')]();}_0x4282ee=squel['insert']()[_0xce0d('0x6e')](_0xce0d('0x84'))[_0xce0d('0x70')]([_0xce0d('0x85'),_0xce0d('0x71'),_0xce0d('0x75'),_0xce0d('0x86'),'createdAt',_0xce0d('0x57')],squel['select']()[_0xce0d('0x76')](_0xce0d('0x87'),'id')[_0xce0d('0x76')]('NOW()',_0xce0d('0x71'))['field'](_0xce0d('0x88'),_0xce0d('0x75'))['field'](_0xce0d('0x89'),_0xce0d('0x86'))[_0xce0d('0x76')]('\x27'+_0x402a73+'\x27',_0xce0d('0x56'))[_0xce0d('0x76')]('\x27'+_0x402a73+'\x27','updatedAt')[_0xce0d('0x79')]('cm_contact_has_items','ci')['join'](_0xce0d('0x6f'),'h',_0xce0d('0x8a'))['where'](_0xce0d('0x8b'),_0x2e3b96[_0xce0d('0x7c')][_0xce0d('0x78')]())[_0xce0d('0x3c')]('h.CampaignId=?',_0x3cb52f[_0xce0d('0x49')]['id'][_0xce0d('0x78')]())[_0xce0d('0x3c')](_0xce0d('0x8c'),_0x402a73))[_0xce0d('0x78')]();_0x4aded0[_0xce0d('0x8d')](db[_0xce0d('0x8e')]['query'](_0x527794));_0x5dcfcb[_0xce0d('0x8d')](db[_0xce0d('0x8e')][_0xce0d('0x38')](_0x4282ee));}return BPromise[_0xce0d('0x8f')](_0x4aded0);}})['then'](function(){return BPromise['all'](_0x5dcfcb);})['then'](function(){return _0x1f2e46;})[_0xce0d('0x25')](respondWithResult(_0x1a7c34,null))['catch'](handleError(_0x1a7c34,null));};exports['removeLists']=function(_0xbc490e,_0x4fd5b8,_0x38504f){return db[_0xce0d('0x43')]['find']({'where':{'id':_0xbc490e[_0xce0d('0x49')]['id']}})[_0xce0d('0x25')](handleEntityNotFound(_0x4fd5b8,null))[_0xce0d('0x25')](function(_0x6dfc3e){if(_0x6dfc3e){return _0x6dfc3e[_0xce0d('0x90')](_0xbc490e[_0xce0d('0x38')][_0xce0d('0x6a')]);}})[_0xce0d('0x25')](function(_0x6d2639){if(_0x6d2639){return db[_0xce0d('0x5c')][_0xce0d('0x26')]({'where':{'ListId':_0xbc490e[_0xce0d('0x38')]['ids'],'CampaignId':_0xbc490e[_0xce0d('0x49')]['id']}})[_0xce0d('0x25')](function(){return _0x6d2639;});}})['then'](respondWithStatusCode(_0x4fd5b8,null))[_0xce0d('0x47')](handleError(_0x4fd5b8,null));};exports['getBlackLists']=function(_0xbfeab1,_0x1a6bf9,_0x3d33b5){var _0x18cacf={};var _0x1b02af={};var _0x52a0d0;var _0x26d5e3;return db[_0xce0d('0x43')][_0xce0d('0x5b')]({'where':{'id':_0xbfeab1[_0xce0d('0x49')]['id']}})[_0xce0d('0x25')](handleEntityNotFound(_0x1a6bf9,null))['then'](function(_0x3b928b){if(_0x3b928b){_0x52a0d0=_0x3b928b;_0x1b02af[_0xce0d('0x31')]=_[_0xce0d('0x33')](db[_0xce0d('0x65')]['rawAttributes']);_0x1b02af['query']=_[_0xce0d('0x33')](_0xbfeab1[_0xce0d('0x38')]);_0x1b02af[_0xce0d('0x34')]=_[_0xce0d('0x35')](_0x1b02af[_0xce0d('0x31')],_0x1b02af[_0xce0d('0x38')]);_0x18cacf[_0xce0d('0x36')]=_['intersection'](_0x1b02af[_0xce0d('0x31')],qs[_0xce0d('0x37')](_0xbfeab1[_0xce0d('0x38')]['fields']));_0x18cacf[_0xce0d('0x36')]=_0x18cacf[_0xce0d('0x36')]['length']?_0x18cacf[_0xce0d('0x36')]:_0x1b02af[_0xce0d('0x31')];_0x18cacf['order']=qs[_0xce0d('0x3b')](_0xbfeab1[_0xce0d('0x38')]['sort']);_0x18cacf['where']=qs[_0xce0d('0x34')](_[_0xce0d('0x3d')](_0xbfeab1[_0xce0d('0x38')],_0x1b02af[_0xce0d('0x34')]));if(_0xbfeab1[_0xce0d('0x38')]['filter']){_0x18cacf[_0xce0d('0x3c')]=_[_0xce0d('0x3e')](_0x18cacf[_0xce0d('0x3c')],{'$or':_[_0xce0d('0x32')](_0x18cacf[_0xce0d('0x36')],function(_0x50c43e){var _0x3e6a07={};_0x3e6a07[_0x50c43e]={'$like':'%'+_0xbfeab1[_0xce0d('0x38')]['filter']+'%'};return _0x3e6a07;})});}_0x18cacf=_[_0xce0d('0x3e')]({},_0x18cacf,_0xbfeab1['options']);return _0x52a0d0[_0xce0d('0x91')](_0x18cacf);}})[_0xce0d('0x25')](function(_0x14c059){if(_0x14c059){_0x26d5e3=_0x14c059[_0xce0d('0x39')];if(!_0xbfeab1[_0xce0d('0x38')][_0xce0d('0x5d')](_0xce0d('0x5e'))){_0x18cacf[_0xce0d('0x1f')]=qs[_0xce0d('0x1f')](_0xbfeab1[_0xce0d('0x38')][_0xce0d('0x1f')]);_0x18cacf['offset']=qs[_0xce0d('0x1d')](_0xbfeab1['query'][_0xce0d('0x1d')]);}return _0x52a0d0[_0xce0d('0x91')](_0x18cacf);}})[_0xce0d('0x25')](function(_0x45f627){if(_0x45f627){return _0x45f627?{'count':_0x26d5e3,'rows':_0x45f627}:null;}})[_0xce0d('0x25')](respondWithResult(_0x1a6bf9,null))[_0xce0d('0x47')](handleError(_0x1a6bf9,null));};exports[_0xce0d('0x92')]=function(_0x307264,_0x2d89ef,_0x288aa4){var _0x21258b,_0x260ffe;var _0xfa8c68=[];var _0x5b5d01=moment()[_0xce0d('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xce0d('0x43')]['find']({'where':{'id':_0x307264[_0xce0d('0x49')]['id']}})[_0xce0d('0x25')](handleEntityNotFound(_0x2d89ef,null))[_0xce0d('0x25')](function(_0xdd3cf6){if(_0xdd3cf6){_0x260ffe=_0xdd3cf6;return _0xdd3cf6[_0xce0d('0x92')](_0x307264['body']['ids'],_[_0xce0d('0x58')](_0x307264[_0xce0d('0x4c')],[_0xce0d('0x6a'),'id'])||{});}return null;})[_0xce0d('0x6b')](function(_0x13b643){var _0x6aa1b2;var _0x2fa868;_0x21258b=_0x13b643||[];var _0x265650=[];if(_0x13b643){for(var _0x3b9e66=0x0;_0x3b9e66<_0x13b643[_0xce0d('0x39')];_0x3b9e66+=0x1){var _0x53db9f=_0x13b643[_0x3b9e66]['get']({'plain':!![]});_0x6aa1b2=squel[_0xce0d('0x6d')]()['into'](_0xce0d('0x93'))[_0xce0d('0x70')](['phone',_0xce0d('0x72'),_0xce0d('0x73'),_0xce0d('0x5f'),_0xce0d('0x56'),'updatedAt'],squel[_0xce0d('0x74')]()[_0xce0d('0x76')](_0xce0d('0x75'),_0xce0d('0x75'))['field']('id',_0xce0d('0x72'))['field'](_0x53db9f[_0xce0d('0x7c')][_0xce0d('0x78')](),_0xce0d('0x73'))['field'](_0x307264[_0xce0d('0x49')]['id'][_0xce0d('0x78')](),'CampaignId')[_0xce0d('0x76')](_0xce0d('0x77'),'createdAt')[_0xce0d('0x76')](_0xce0d('0x77'),'updatedAt')[_0xce0d('0x79')](_0xce0d('0x7a'))[_0xce0d('0x3c')](_0xce0d('0x94'))[_0xce0d('0x3c')]('ListId\x20=\x20?',_0x53db9f[_0xce0d('0x7c')][_0xce0d('0x78')]())['where'](_0xce0d('0x7d')))[_0xce0d('0x78')]();_0x265650[_0xce0d('0x8d')](db[_0xce0d('0x8e')]['query'](_0x6aa1b2));}return BPromise[_0xce0d('0x8f')](_0x265650);}})['then'](function(){return _0x21258b;})[_0xce0d('0x25')](respondWithResult(_0x2d89ef,null))[_0xce0d('0x47')](handleError(_0x2d89ef,null));};exports[_0xce0d('0x95')]=function(_0x32333a,_0x19e9ae,_0x264c36){return db[_0xce0d('0x43')]['find']({'where':{'id':_0x32333a[_0xce0d('0x49')]['id']}})['then'](handleEntityNotFound(_0x19e9ae,null))[_0xce0d('0x25')](function(_0x55eeec){if(_0x55eeec){return _0x55eeec['removeBlackLists'](_0x32333a[_0xce0d('0x38')][_0xce0d('0x6a')]);}})[_0xce0d('0x25')](function(_0x5c996c){if(_0x5c996c){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x32333a[_0xce0d('0x38')]['ids'],'CampaignId':_0x32333a['params']['id']}})[_0xce0d('0x25')](function(){return _0x5c996c;});}})['then'](respondWithStatusCode(_0x19e9ae,null))[_0xce0d('0x47')](handleError(_0x19e9ae,null));}; \ No newline at end of file +var _0xd139=['spread','dialCheckDuplicateType','insert','into','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','cm_hopper','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','Campaign','rawAttributes','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','create','body','get','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','UserProfileSection','getHoppers','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','nolimit','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids'];(function(_0x207e92,_0x4c6711){var _0x40d323=function(_0x511ad7){while(--_0x511ad7){_0x207e92['push'](_0x207e92['shift']());}};_0x40d323(++_0x4c6711);}(_0xd139,0x14e));var _0x9d13=function(_0x373453,_0x5c41ea){_0x373453=_0x373453-0x0;var _0x233a00=_0xd139[_0x373453];return _0x233a00;};'use strict';var emlformat=require(_0x9d13('0x0'));var rimraf=require(_0x9d13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d13('0x2'));var moment=require(_0x9d13('0x3'));var BPromise=require(_0x9d13('0x4'));var Mustache=require(_0x9d13('0x5'));var util=require(_0x9d13('0x6'));var path=require(_0x9d13('0x7'));var sox=require(_0x9d13('0x8'));var csv=require('to-csv');var ejs=require(_0x9d13('0x9'));var fs=require('fs');var fs_extra=require(_0x9d13('0xa'));var _=require('lodash');var squel=require(_0x9d13('0xb'));var crypto=require('crypto');var jsforce=require(_0x9d13('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9d13('0xd'));var Redis=require(_0x9d13('0xe'));var authService=require(_0x9d13('0xf'));var qs=require(_0x9d13('0x10'));var as=require(_0x9d13('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d13('0x12'))(_0x9d13('0x13'));var utils=require(_0x9d13('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9d13('0x15'))['db'];function respondWithStatusCode(_0x3933d1,_0x39020){_0x39020=_0x39020||0xcc;return function(_0x331fea){if(_0x331fea){return _0x3933d1[_0x9d13('0x16')](_0x39020);}return _0x3933d1['status'](_0x39020)['end']();};}function respondWithResult(_0x37607a,_0x43bf27){_0x43bf27=_0x43bf27||0xc8;return function(_0x2f5442){if(_0x2f5442){return _0x37607a[_0x9d13('0x17')](_0x43bf27)[_0x9d13('0x18')](_0x2f5442);}};}function respondWithFilteredResult(_0x1a2b65,_0x38f368){return function(_0x47bcd3){if(_0x47bcd3){var _0x3acfc1=typeof _0x38f368[_0x9d13('0x19')]===_0x9d13('0x1a')&&typeof _0x38f368[_0x9d13('0x1b')]===_0x9d13('0x1a');var _0x42d5a5=_0x47bcd3[_0x9d13('0x1c')];var _0x10aa89=_0x3acfc1?0x0:_0x38f368[_0x9d13('0x19')];var _0x2acb0b=_0x3acfc1?_0x47bcd3[_0x9d13('0x1c')]:_0x38f368[_0x9d13('0x19')]+_0x38f368[_0x9d13('0x1b')];var _0x4d6b9d;if(_0x2acb0b>=_0x42d5a5){_0x2acb0b=_0x42d5a5;_0x4d6b9d=0xc8;}else{_0x4d6b9d=0xce;}_0x1a2b65[_0x9d13('0x17')](_0x4d6b9d);return _0x1a2b65[_0x9d13('0x1d')](_0x9d13('0x1e'),_0x10aa89+'-'+_0x2acb0b+'/'+_0x42d5a5)[_0x9d13('0x18')](_0x47bcd3);}return null;};}function patchUpdates(_0x4e1425){return function(_0x48ce3d){try{jsonpatch['apply'](_0x48ce3d,_0x4e1425,!![]);}catch(_0x223ea5){return BPromise[_0x9d13('0x1f')](_0x223ea5);}return _0x48ce3d[_0x9d13('0x20')]();};}function saveUpdates(_0x1fefe4,_0x3971e0){return function(_0x3040e7){if(_0x3040e7){return _0x3040e7[_0x9d13('0x21')](_0x1fefe4)[_0x9d13('0x22')](function(_0x5d14c8){return _0x5d14c8;});}return null;};}function removeEntity(_0xb34817,_0xd5a981){return function(_0x22963f){if(_0x22963f){return _0x22963f[_0x9d13('0x23')]()['then'](function(){var _0xe02b36=_0x22963f['get']({'plain':!![]});var _0x40c673=_0x9d13('0x24');return db[_0x9d13('0x25')][_0x9d13('0x23')]({'where':{'type':_0x40c673,'resourceId':_0xe02b36['id']}})[_0x9d13('0x22')](function(){return _0x22963f;});})[_0x9d13('0x22')](function(){_0xb34817[_0x9d13('0x17')](0xcc)[_0x9d13('0x26')]();});}};}function handleEntityNotFound(_0x5d854e,_0x2e7fa1){return function(_0x4edc05){if(!_0x4edc05){_0x5d854e[_0x9d13('0x16')](0x194);}return _0x4edc05;};}function handleError(_0x420926,_0x2f314b){_0x2f314b=_0x2f314b||0x1f4;return function(_0x1d9f56){logger[_0x9d13('0x27')](_0x1d9f56[_0x9d13('0x28')]);if(_0x1d9f56[_0x9d13('0x29')]){delete _0x1d9f56[_0x9d13('0x29')];}_0x420926[_0x9d13('0x17')](_0x2f314b)[_0x9d13('0x2a')](_0x1d9f56);};}exports[_0x9d13('0x2b')]=function(_0x21e35a,_0x523e5e){var _0x7c953f={},_0x580aa4={},_0x2295bc={'count':0x0,'rows':[]};var _0x581ccf=_['map'](db[_0x9d13('0x2c')][_0x9d13('0x2d')],function(_0x5dcdf1){return{'name':_0x5dcdf1['fieldName'],'type':_0x5dcdf1['type'][_0x9d13('0x2e')]};});_0x580aa4['model']=_[_0x9d13('0x2f')](_0x581ccf,_0x9d13('0x29'));_0x580aa4[_0x9d13('0x30')]=_['keys'](_0x21e35a[_0x9d13('0x30')]);_0x580aa4[_0x9d13('0x31')]=_[_0x9d13('0x32')](_0x580aa4[_0x9d13('0x33')],_0x580aa4['query']);_0x7c953f['attributes']=_[_0x9d13('0x32')](_0x580aa4[_0x9d13('0x33')],qs['fields'](_0x21e35a[_0x9d13('0x30')][_0x9d13('0x34')]));_0x7c953f[_0x9d13('0x35')]=_0x7c953f[_0x9d13('0x35')][_0x9d13('0x36')]?_0x7c953f[_0x9d13('0x35')]:_0x580aa4[_0x9d13('0x33')];if(!_0x21e35a['query'][_0x9d13('0x37')]('nolimit')){_0x7c953f['limit']=qs['limit'](_0x21e35a[_0x9d13('0x30')][_0x9d13('0x1b')]);_0x7c953f[_0x9d13('0x19')]=qs[_0x9d13('0x19')](_0x21e35a[_0x9d13('0x30')]['offset']);}_0x7c953f[_0x9d13('0x38')]=qs[_0x9d13('0x39')](_0x21e35a[_0x9d13('0x30')][_0x9d13('0x39')]);_0x7c953f[_0x9d13('0x3a')]=qs[_0x9d13('0x31')](_['pick'](_0x21e35a[_0x9d13('0x30')],_0x580aa4[_0x9d13('0x31')]),_0x581ccf);if(_0x21e35a[_0x9d13('0x30')]['filter']){_0x7c953f['where']=_[_0x9d13('0x3b')](_0x7c953f[_0x9d13('0x3a')],{'$or':_[_0x9d13('0x2f')](_0x581ccf,function(_0x4a36ea){if(_0x4a36ea[_0x9d13('0x3c')]!==_0x9d13('0x3d')){var _0x4cff31={};_0x4cff31[_0x4a36ea[_0x9d13('0x29')]]={'$like':'%'+_0x21e35a[_0x9d13('0x30')][_0x9d13('0x3e')]+'%'};return _0x4cff31;}})});}_0x7c953f=_[_0x9d13('0x3b')]({},_0x7c953f,_0x21e35a[_0x9d13('0x3f')]);var _0x28a68c={'where':_0x7c953f[_0x9d13('0x3a')]};return db[_0x9d13('0x2c')][_0x9d13('0x1c')](_0x28a68c)['then'](function(_0x56943){_0x2295bc[_0x9d13('0x1c')]=_0x56943;if(_0x21e35a[_0x9d13('0x30')][_0x9d13('0x40')]){_0x7c953f[_0x9d13('0x41')]=[{'all':!![]}];}return db[_0x9d13('0x2c')][_0x9d13('0x42')](_0x7c953f);})['then'](function(_0x30114a){_0x2295bc[_0x9d13('0x43')]=_0x30114a;return _0x2295bc;})[_0x9d13('0x22')](respondWithFilteredResult(_0x523e5e,_0x7c953f))[_0x9d13('0x44')](handleError(_0x523e5e,null));};exports[_0x9d13('0x45')]=function(_0x427ed0,_0x5a644f){var _0x5d69b9={'raw':![],'where':{'id':_0x427ed0['params']['id']}},_0x3b9d35={};_0x3b9d35[_0x9d13('0x33')]=_['keys'](db[_0x9d13('0x2c')][_0x9d13('0x2d')]);_0x3b9d35[_0x9d13('0x30')]=_[_0x9d13('0x46')](_0x427ed0[_0x9d13('0x30')]);_0x3b9d35['filters']=_[_0x9d13('0x32')](_0x3b9d35[_0x9d13('0x33')],_0x3b9d35[_0x9d13('0x30')]);_0x5d69b9[_0x9d13('0x35')]=_[_0x9d13('0x32')](_0x3b9d35[_0x9d13('0x33')],qs[_0x9d13('0x34')](_0x427ed0[_0x9d13('0x30')][_0x9d13('0x34')]));_0x5d69b9[_0x9d13('0x35')]=_0x5d69b9['attributes']['length']?_0x5d69b9[_0x9d13('0x35')]:_0x3b9d35[_0x9d13('0x33')];if(_0x427ed0['query'][_0x9d13('0x40')]){_0x5d69b9['include']=[{'all':!![]}];}_0x5d69b9=_[_0x9d13('0x3b')]({},_0x5d69b9,_0x427ed0[_0x9d13('0x3f')]);return db['Campaign']['find'](_0x5d69b9)[_0x9d13('0x22')](handleEntityNotFound(_0x5a644f,null))[_0x9d13('0x22')](respondWithResult(_0x5a644f,null))[_0x9d13('0x44')](handleError(_0x5a644f,null));};exports[_0x9d13('0x47')]=function(_0x35865e,_0x70514d){return db[_0x9d13('0x2c')][_0x9d13('0x47')](_0x35865e[_0x9d13('0x48')],{})['then'](function(_0x3a2177){var _0x5b0c6e=_0x35865e['user'][_0x9d13('0x49')]({'plain':!![]});if(!_0x5b0c6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b0c6e[_0x9d13('0x4a')]===_0x9d13('0x4b')){var _0x3457e5=_0x3a2177[_0x9d13('0x49')]({'plain':!![]});var _0x1aca60=_0x9d13('0x24');return db['UserProfileSection'][_0x9d13('0x4c')]({'where':{'name':_0x1aca60,'userProfileId':_0x5b0c6e[_0x9d13('0x4d')]},'raw':!![]})[_0x9d13('0x22')](function(_0x3967e6){if(_0x3967e6&&_0x3967e6[_0x9d13('0x4e')]===0x0){return db[_0x9d13('0x25')][_0x9d13('0x47')]({'name':_0x3457e5['name'],'resourceId':_0x3457e5['id'],'type':_0x3967e6[_0x9d13('0x29')],'sectionId':_0x3967e6['id']},{})[_0x9d13('0x22')](function(){return _0x3a2177;});}else{return _0x3a2177;}})[_0x9d13('0x44')](function(_0x259628){logger[_0x9d13('0x27')](_0x9d13('0x4f'),_0x259628);throw _0x259628;});}return _0x3a2177;})[_0x9d13('0x22')](respondWithResult(_0x70514d,0xc9))[_0x9d13('0x44')](handleError(_0x70514d,null));};exports[_0x9d13('0x50')]=function(_0x415629,_0x4a9fb7){var _0x3633e4={'where':{'id':_0x415629[_0x9d13('0x51')]['id']}},_0x16401b={};_0x16401b['model']=_[_0x9d13('0x46')](db['Campaign']['rawAttributes']);_0x3633e4[_0x9d13('0x35')]=_['intersection'](_0x16401b[_0x9d13('0x33')],qs[_0x9d13('0x34')](_0x415629[_0x9d13('0x30')][_0x9d13('0x34')]));_0x3633e4[_0x9d13('0x35')]=_0x3633e4[_0x9d13('0x35')][_0x9d13('0x36')]?_0x3633e4[_0x9d13('0x35')]:_0x16401b[_0x9d13('0x33')];if(_0x415629['query'][_0x9d13('0x40')]){_0x3633e4['include']=[{'all':!![]}];}_0x3633e4=_['merge']({},_0x3633e4,_0x415629[_0x9d13('0x3f')]);return db[_0x9d13('0x2c')][_0x9d13('0x4c')](_0x3633e4)[_0x9d13('0x22')](handleEntityNotFound(_0x4a9fb7,null))[_0x9d13('0x22')](function(_0x10de1b){if(_0x10de1b){var _0x743580=_0x10de1b[_0x9d13('0x49')]({'plain':!![]});_0x743580=qs[_0x9d13('0x52')](_0x743580,['id',_0x9d13('0x53'),_0x9d13('0x54')]);_0x415629[_0x9d13('0x48')]=_[_0x9d13('0x52')](_0x415629[_0x9d13('0x48')],['id',_0x9d13('0x53'),_0x9d13('0x54')]);return db[_0x9d13('0x2c')][_0x9d13('0x47')](_['merge'](_0x743580,_0x415629['body']),{'include':_0x415629[_0x9d13('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x9d13('0x22')](function(_0x14055b){var _0x467b93=_0x415629[_0x9d13('0x4b')][_0x9d13('0x49')]({'plain':!![]});if(!_0x467b93)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x467b93[_0x9d13('0x4a')]==='user'){var _0x4672aa=_0x14055b['get']({'plain':!![]});var _0x2d04fd=_0x9d13('0x24');return db[_0x9d13('0x55')][_0x9d13('0x4c')]({'where':{'name':_0x2d04fd,'userProfileId':_0x467b93[_0x9d13('0x4d')]},'raw':!![]})[_0x9d13('0x22')](function(_0x241728){if(_0x241728&&_0x241728[_0x9d13('0x4e')]===0x0){return db['UserProfileResource'][_0x9d13('0x47')]({'name':_0x4672aa[_0x9d13('0x29')],'resourceId':_0x4672aa['id'],'type':_0x241728['name'],'sectionId':_0x241728['id']},{})['then'](function(){return _0x14055b;});}else{return _0x14055b;}})[_0x9d13('0x44')](function(_0x45ada3){logger['error'](_0x9d13('0x4f'),_0x45ada3);throw _0x45ada3;});}return _0x14055b;});}})[_0x9d13('0x22')](respondWithResult(_0x4a9fb7,0xc9))['catch'](handleError(_0x4a9fb7,null));};exports[_0x9d13('0x21')]=function(_0x5099f8,_0x2945d6){if(_0x5099f8['body']['id']){delete _0x5099f8[_0x9d13('0x48')]['id'];}return db[_0x9d13('0x2c')][_0x9d13('0x4c')]({'where':{'id':_0x5099f8[_0x9d13('0x51')]['id']}})[_0x9d13('0x22')](handleEntityNotFound(_0x2945d6,null))[_0x9d13('0x22')](saveUpdates(_0x5099f8['body'],null))[_0x9d13('0x22')](respondWithResult(_0x2945d6,null))['catch'](handleError(_0x2945d6,null));};exports[_0x9d13('0x23')]=function(_0x5d1872,_0x300d4a){return db[_0x9d13('0x2c')][_0x9d13('0x4c')]({'where':{'id':_0x5d1872[_0x9d13('0x51')]['id']}})['then'](handleEntityNotFound(_0x300d4a,null))['then'](removeEntity(_0x300d4a,null))[_0x9d13('0x44')](handleError(_0x300d4a,null));};exports[_0x9d13('0x56')]=function(_0x2ff389,_0x38a388,_0x2239c3){var _0x48c02b={'raw':!![],'where':{}};var _0x595bce={};var _0x50c412={'count':0x0,'rows':[]};return db['Campaign'][_0x9d13('0x57')]({'where':{'id':_0x2ff389[_0x9d13('0x51')]['id']}})[_0x9d13('0x22')](handleEntityNotFound(_0x38a388,null))[_0x9d13('0x22')](function(_0x273c76){if(_0x273c76){_0x595bce['model']=_[_0x9d13('0x46')](db[_0x9d13('0x58')][_0x9d13('0x2d')]);_0x595bce[_0x9d13('0x30')]=_[_0x9d13('0x46')](_0x2ff389[_0x9d13('0x30')]);_0x595bce[_0x9d13('0x31')]=_[_0x9d13('0x32')](_0x595bce[_0x9d13('0x33')],_0x595bce[_0x9d13('0x30')]);_0x48c02b[_0x9d13('0x35')]=_[_0x9d13('0x32')](_0x595bce[_0x9d13('0x33')],qs['fields'](_0x2ff389['query'][_0x9d13('0x34')]));_0x48c02b[_0x9d13('0x35')]=_0x48c02b[_0x9d13('0x35')][_0x9d13('0x36')]?_0x48c02b[_0x9d13('0x35')]:_0x595bce[_0x9d13('0x33')];if(!_0x2ff389[_0x9d13('0x30')][_0x9d13('0x37')]('nolimit')){_0x48c02b[_0x9d13('0x1b')]=qs[_0x9d13('0x1b')](_0x2ff389['query']['limit']);_0x48c02b[_0x9d13('0x19')]=qs[_0x9d13('0x19')](_0x2ff389[_0x9d13('0x30')][_0x9d13('0x19')]);}_0x48c02b[_0x9d13('0x38')]=qs[_0x9d13('0x39')](_0x2ff389[_0x9d13('0x30')][_0x9d13('0x39')]);_0x48c02b[_0x9d13('0x3a')]=qs[_0x9d13('0x31')](_[_0x9d13('0x59')](_0x2ff389[_0x9d13('0x30')],_0x595bce[_0x9d13('0x31')]));_0x48c02b[_0x9d13('0x3a')][_0x9d13('0x5a')]=_0x273c76['id'];if(_0x2ff389['query']['filter']){_0x48c02b[_0x9d13('0x3a')]=_[_0x9d13('0x3b')](_0x48c02b[_0x9d13('0x3a')],{'$or':_[_0x9d13('0x2f')](_0x48c02b[_0x9d13('0x35')],function(_0x510f5c){var _0x77506c={};_0x77506c[_0x510f5c]={'$like':'%'+_0x2ff389[_0x9d13('0x30')][_0x9d13('0x3e')]+'%'};return _0x77506c;})});}_0x48c02b=_[_0x9d13('0x3b')]({},_0x48c02b,_0x2ff389[_0x9d13('0x3f')]);return db['CmHopper'][_0x9d13('0x1c')]({'where':_0x48c02b['where']})[_0x9d13('0x22')](function(_0x395185){_0x50c412[_0x9d13('0x1c')]=_0x395185;if(_0x2ff389[_0x9d13('0x30')][_0x9d13('0x40')]){_0x48c02b[_0x9d13('0x41')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x48c02b);})[_0x9d13('0x22')](function(_0x5aac3c){_0x50c412[_0x9d13('0x43')]=_0x5aac3c;return _0x50c412;});}})[_0x9d13('0x22')](respondWithFilteredResult(_0x38a388,_0x48c02b))['catch'](handleError(_0x38a388,null));};exports[_0x9d13('0x5b')]=function(_0x19ba54,_0x197016,_0x45e785){var _0x598baf={'raw':!![],'where':{}};var _0x26b0d9={};var _0x12c8af={'count':0x0,'rows':[]};return db['Campaign'][_0x9d13('0x57')]({'where':{'id':_0x19ba54[_0x9d13('0x51')]['id']}})[_0x9d13('0x22')](handleEntityNotFound(_0x197016,null))[_0x9d13('0x22')](function(_0x5e1ffd){if(_0x5e1ffd){_0x26b0d9[_0x9d13('0x33')]=_[_0x9d13('0x46')](db[_0x9d13('0x5c')][_0x9d13('0x2d')]);_0x26b0d9[_0x9d13('0x30')]=_[_0x9d13('0x46')](_0x19ba54[_0x9d13('0x30')]);_0x26b0d9['filters']=_['intersection'](_0x26b0d9[_0x9d13('0x33')],_0x26b0d9[_0x9d13('0x30')]);_0x598baf[_0x9d13('0x35')]=_['intersection'](_0x26b0d9[_0x9d13('0x33')],qs[_0x9d13('0x34')](_0x19ba54[_0x9d13('0x30')][_0x9d13('0x34')]));_0x598baf[_0x9d13('0x35')]=_0x598baf[_0x9d13('0x35')]['length']?_0x598baf[_0x9d13('0x35')]:_0x26b0d9[_0x9d13('0x33')];if(!_0x19ba54[_0x9d13('0x30')]['hasOwnProperty']('nolimit')){_0x598baf[_0x9d13('0x1b')]=qs[_0x9d13('0x1b')](_0x19ba54[_0x9d13('0x30')][_0x9d13('0x1b')]);_0x598baf['offset']=qs[_0x9d13('0x19')](_0x19ba54['query'][_0x9d13('0x19')]);}_0x598baf[_0x9d13('0x38')]=qs[_0x9d13('0x39')](_0x19ba54[_0x9d13('0x30')][_0x9d13('0x39')]);_0x598baf[_0x9d13('0x3a')]=qs['filters'](_[_0x9d13('0x59')](_0x19ba54[_0x9d13('0x30')],_0x26b0d9[_0x9d13('0x31')]));_0x598baf[_0x9d13('0x3a')][_0x9d13('0x5a')]=_0x5e1ffd['id'];if(_0x19ba54['query']['filter']){_0x598baf['where']=_['merge'](_0x598baf[_0x9d13('0x3a')],{'$or':_[_0x9d13('0x2f')](_0x598baf['attributes'],function(_0x4124f5){var _0x20b20c={};_0x20b20c[_0x4124f5]={'$like':'%'+_0x19ba54[_0x9d13('0x30')][_0x9d13('0x3e')]+'%'};return _0x20b20c;})});}_0x598baf=_[_0x9d13('0x3b')]({},_0x598baf,_0x19ba54[_0x9d13('0x3f')]);return db[_0x9d13('0x5c')]['count']({'where':_0x598baf[_0x9d13('0x3a')]})[_0x9d13('0x22')](function(_0x46470c){_0x12c8af[_0x9d13('0x1c')]=_0x46470c;if(_0x19ba54[_0x9d13('0x30')][_0x9d13('0x40')]){_0x598baf[_0x9d13('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x9d13('0x42')](_0x598baf);})[_0x9d13('0x22')](function(_0x1e192a){_0x12c8af['rows']=_0x1e192a;return _0x12c8af;});}})['then'](respondWithFilteredResult(_0x197016,_0x598baf))[_0x9d13('0x44')](handleError(_0x197016,null));};exports[_0x9d13('0x5d')]=function(_0x5732ef,_0x352810,_0x1ad817){var _0x57ab46={'raw':!![],'where':{}};var _0x28df53={};var _0x1d5bab={'count':0x0,'rows':[]};return db[_0x9d13('0x2c')][_0x9d13('0x57')]({'where':{'id':_0x5732ef[_0x9d13('0x51')]['id']}})[_0x9d13('0x22')](handleEntityNotFound(_0x352810,null))['then'](function(_0x38dcd4){if(_0x38dcd4){_0x28df53[_0x9d13('0x33')]=_[_0x9d13('0x46')](db[_0x9d13('0x5e')]['rawAttributes']);_0x28df53[_0x9d13('0x30')]=_[_0x9d13('0x46')](_0x5732ef['query']);_0x28df53[_0x9d13('0x31')]=_[_0x9d13('0x32')](_0x28df53[_0x9d13('0x33')],_0x28df53[_0x9d13('0x30')]);_0x57ab46[_0x9d13('0x35')]=_[_0x9d13('0x32')](_0x28df53[_0x9d13('0x33')],qs['fields'](_0x5732ef[_0x9d13('0x30')]['fields']));_0x57ab46[_0x9d13('0x35')]=_0x57ab46[_0x9d13('0x35')][_0x9d13('0x36')]?_0x57ab46[_0x9d13('0x35')]:_0x28df53[_0x9d13('0x33')];if(!_0x5732ef[_0x9d13('0x30')][_0x9d13('0x37')](_0x9d13('0x5f'))){_0x57ab46['limit']=qs['limit'](_0x5732ef['query']['limit']);_0x57ab46[_0x9d13('0x19')]=qs[_0x9d13('0x19')](_0x5732ef[_0x9d13('0x30')]['offset']);}_0x57ab46[_0x9d13('0x38')]=qs[_0x9d13('0x39')](_0x5732ef[_0x9d13('0x30')][_0x9d13('0x39')]);_0x57ab46[_0x9d13('0x3a')]=qs[_0x9d13('0x31')](_[_0x9d13('0x59')](_0x5732ef['query'],_0x28df53[_0x9d13('0x31')]));_0x57ab46[_0x9d13('0x3a')][_0x9d13('0x5a')]=_0x38dcd4['id'];if(_0x5732ef[_0x9d13('0x30')][_0x9d13('0x3e')]){_0x57ab46['where']=_['merge'](_0x57ab46[_0x9d13('0x3a')],{'$or':_[_0x9d13('0x2f')](_0x57ab46['attributes'],function(_0x47a30d){var _0x115149={};_0x115149[_0x47a30d]={'$like':'%'+_0x5732ef[_0x9d13('0x30')][_0x9d13('0x3e')]+'%'};return _0x115149;})});}_0x57ab46=_['merge']({},_0x57ab46,_0x5732ef[_0x9d13('0x3f')]);return db[_0x9d13('0x5e')][_0x9d13('0x1c')]({'where':_0x57ab46['where']})['then'](function(_0x49c0cb){_0x1d5bab[_0x9d13('0x1c')]=_0x49c0cb;if(_0x5732ef[_0x9d13('0x30')]['includeAll']){_0x57ab46[_0x9d13('0x41')]=[{'all':!![]}];}return db[_0x9d13('0x5e')][_0x9d13('0x42')](_0x57ab46);})[_0x9d13('0x22')](function(_0x42b00c){_0x1d5bab[_0x9d13('0x43')]=_0x42b00c;return _0x1d5bab;});}})[_0x9d13('0x22')](respondWithFilteredResult(_0x352810,_0x57ab46))['catch'](handleError(_0x352810,null));};exports[_0x9d13('0x60')]=function(_0x27dd16,_0x31dcc0,_0x2047e2){var _0x2ddb9e={'raw':!![],'where':{}};var _0xb12e35={};var _0x26a956={'count':0x0,'rows':[]};return db[_0x9d13('0x2c')][_0x9d13('0x57')]({'where':{'id':_0x27dd16[_0x9d13('0x51')]['id']}})['then'](handleEntityNotFound(_0x31dcc0,null))['then'](function(_0x408a42){if(_0x408a42){_0xb12e35[_0x9d13('0x33')]=_[_0x9d13('0x46')](db[_0x9d13('0x61')][_0x9d13('0x2d')]);_0xb12e35[_0x9d13('0x30')]=_['keys'](_0x27dd16[_0x9d13('0x30')]);_0xb12e35[_0x9d13('0x31')]=_['intersection'](_0xb12e35[_0x9d13('0x33')],_0xb12e35['query']);_0x2ddb9e[_0x9d13('0x35')]=_['intersection'](_0xb12e35[_0x9d13('0x33')],qs[_0x9d13('0x34')](_0x27dd16[_0x9d13('0x30')][_0x9d13('0x34')]));_0x2ddb9e[_0x9d13('0x35')]=_0x2ddb9e[_0x9d13('0x35')][_0x9d13('0x36')]?_0x2ddb9e[_0x9d13('0x35')]:_0xb12e35[_0x9d13('0x33')];if(!_0x27dd16['query'][_0x9d13('0x37')]('nolimit')){_0x2ddb9e[_0x9d13('0x1b')]=qs['limit'](_0x27dd16['query'][_0x9d13('0x1b')]);_0x2ddb9e[_0x9d13('0x19')]=qs[_0x9d13('0x19')](_0x27dd16[_0x9d13('0x30')]['offset']);}_0x2ddb9e[_0x9d13('0x38')]=qs[_0x9d13('0x39')](_0x27dd16[_0x9d13('0x30')]['sort']);_0x2ddb9e[_0x9d13('0x3a')]=qs[_0x9d13('0x31')](_[_0x9d13('0x59')](_0x27dd16['query'],_0xb12e35[_0x9d13('0x31')]));_0x2ddb9e[_0x9d13('0x3a')][_0x9d13('0x5a')]=_0x408a42['id'];if(_0x27dd16[_0x9d13('0x30')]['filter']){_0x2ddb9e[_0x9d13('0x3a')]=_[_0x9d13('0x3b')](_0x2ddb9e[_0x9d13('0x3a')],{'$or':_[_0x9d13('0x2f')](_0x2ddb9e[_0x9d13('0x35')],function(_0x4dbfc8){var _0x19f8ac={};_0x19f8ac[_0x4dbfc8]={'$like':'%'+_0x27dd16[_0x9d13('0x30')]['filter']+'%'};return _0x19f8ac;})});}_0x2ddb9e=_[_0x9d13('0x3b')]({},_0x2ddb9e,_0x27dd16[_0x9d13('0x3f')]);return db['CmHopperBlack']['count']({'where':_0x2ddb9e['where']})[_0x9d13('0x22')](function(_0x511b23){_0x26a956[_0x9d13('0x1c')]=_0x511b23;if(_0x27dd16['query'][_0x9d13('0x40')]){_0x2ddb9e['include']=[{'all':!![]}];}return db[_0x9d13('0x61')]['findAll'](_0x2ddb9e);})[_0x9d13('0x22')](function(_0x3c8077){_0x26a956['rows']=_0x3c8077;return _0x26a956;});}})[_0x9d13('0x22')](respondWithFilteredResult(_0x31dcc0,_0x2ddb9e))[_0x9d13('0x44')](handleError(_0x31dcc0,null));};exports['getLists']=function(_0x2e5733,_0x4d6f37,_0x23f0ab){var _0x1ca492={};var _0x32b532={};var _0x5da603;var _0x537ef7;return db[_0x9d13('0x2c')][_0x9d13('0x57')]({'where':{'id':_0x2e5733['params']['id']}})[_0x9d13('0x22')](handleEntityNotFound(_0x4d6f37,null))['then'](function(_0x835f24){if(_0x835f24){_0x5da603=_0x835f24;_0x32b532[_0x9d13('0x33')]=_[_0x9d13('0x46')](db[_0x9d13('0x62')][_0x9d13('0x2d')]);_0x32b532[_0x9d13('0x30')]=_[_0x9d13('0x46')](_0x2e5733[_0x9d13('0x30')]);_0x32b532[_0x9d13('0x31')]=_[_0x9d13('0x32')](_0x32b532[_0x9d13('0x33')],_0x32b532[_0x9d13('0x30')]);_0x1ca492[_0x9d13('0x35')]=_[_0x9d13('0x32')](_0x32b532['model'],qs[_0x9d13('0x34')](_0x2e5733[_0x9d13('0x30')][_0x9d13('0x34')]));_0x1ca492['attributes']=_0x1ca492[_0x9d13('0x35')]['length']?_0x1ca492[_0x9d13('0x35')]:_0x32b532[_0x9d13('0x33')];_0x1ca492['order']=qs[_0x9d13('0x39')](_0x2e5733[_0x9d13('0x30')][_0x9d13('0x39')]);_0x1ca492[_0x9d13('0x3a')]=qs[_0x9d13('0x31')](_[_0x9d13('0x59')](_0x2e5733[_0x9d13('0x30')],_0x32b532[_0x9d13('0x31')]));if(_0x2e5733['query'][_0x9d13('0x3e')]){_0x1ca492[_0x9d13('0x3a')]=_[_0x9d13('0x3b')](_0x1ca492[_0x9d13('0x3a')],{'$or':_[_0x9d13('0x2f')](_0x1ca492[_0x9d13('0x35')],function(_0x3a7f37){var _0xcd8a7a={};_0xcd8a7a[_0x3a7f37]={'$like':'%'+_0x2e5733[_0x9d13('0x30')]['filter']+'%'};return _0xcd8a7a;})});}_0x1ca492=_['merge']({},_0x1ca492,_0x2e5733['options']);return _0x5da603['getLists'](_0x1ca492);}})['then'](function(_0x20560c){if(_0x20560c){_0x537ef7=_0x20560c[_0x9d13('0x36')];if(!_0x2e5733[_0x9d13('0x30')][_0x9d13('0x37')](_0x9d13('0x5f'))){_0x1ca492['limit']=qs[_0x9d13('0x1b')](_0x2e5733['query'][_0x9d13('0x1b')]);_0x1ca492[_0x9d13('0x19')]=qs[_0x9d13('0x19')](_0x2e5733[_0x9d13('0x30')][_0x9d13('0x19')]);}return _0x5da603[_0x9d13('0x63')](_0x1ca492);}})[_0x9d13('0x22')](function(_0x10c5ee){if(_0x10c5ee){return _0x10c5ee?{'count':_0x537ef7,'rows':_0x10c5ee}:null;}})[_0x9d13('0x22')](respondWithResult(_0x4d6f37,null))[_0x9d13('0x44')](handleError(_0x4d6f37,null));};exports[_0x9d13('0x64')]=function(_0x544eaa,_0xa8443e,_0x3eab85){var _0x4b040a,_0x571a18;var _0x124578=[];var _0x47a2a3=moment()[_0x9d13('0x65')](_0x9d13('0x66'));return db[_0x9d13('0x2c')][_0x9d13('0x4c')]({'where':{'id':_0x544eaa[_0x9d13('0x51')]['id']}})['then'](handleEntityNotFound(_0xa8443e,null))['then'](function(_0x56ae22){if(_0x56ae22){_0x571a18=_0x56ae22;return _0x56ae22[_0x9d13('0x64')](_0x544eaa[_0x9d13('0x48')][_0x9d13('0x67')],_[_0x9d13('0x52')](_0x544eaa[_0x9d13('0x48')],[_0x9d13('0x67'),'id'])||{});}return null;})[_0x9d13('0x68')](function(_0x14667b){var _0x7317c8;var _0x4d3035;_0x4b040a=_0x14667b||[];var _0x302a58=[];if(_0x14667b){for(var _0x32c85d=0x0;_0x32c85d<_0x14667b[_0x9d13('0x36')];_0x32c85d+=0x1){var _0x5d27ca=_0x14667b[_0x32c85d][_0x9d13('0x49')]({'plain':!![]});_0x571a18['dialCheckDuplicateType']=_0x544eaa[_0x9d13('0x48')]['dialCheckDuplicateType']?_0x544eaa[_0x9d13('0x48')]['dialCheckDuplicateType']:_0x571a18['dialCheckDuplicateType'];switch(_0x571a18[_0x9d13('0x69')]){case'always':_0x7317c8=squel[_0x9d13('0x6a')]()[_0x9d13('0x6b')]('cm_hopper')[_0x9d13('0x6c')]([_0x9d13('0x6d'),_0x9d13('0x6e'),'ContactId',_0x9d13('0x6f'),_0x9d13('0x5a'),'createdAt','updatedAt'],squel[_0x9d13('0x70')]()['field'](_0x9d13('0x6d'),_0x9d13('0x6d'))[_0x9d13('0x71')](_0x9d13('0x72'),_0x9d13('0x6e'))[_0x9d13('0x71')]('id',_0x9d13('0x73'))[_0x9d13('0x71')](_0x5d27ca[_0x9d13('0x74')][_0x9d13('0x75')](),'ListId')[_0x9d13('0x71')](_0x544eaa['params']['id']['toString'](),_0x9d13('0x5a'))[_0x9d13('0x71')]('\x27'+_0x47a2a3+'\x27',_0x9d13('0x53'))['field']('\x27'+_0x47a2a3+'\x27',_0x9d13('0x54'))[_0x9d13('0x76')](_0x9d13('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0x9d13('0x3a')](_0x9d13('0x78'),_0x5d27ca[_0x9d13('0x74')]['toString']())[_0x9d13('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0x9d13('0x3a')](_0x9d13('0x79'),squel[_0x9d13('0x70')]()[_0x9d13('0x71')](_0x9d13('0x7a'))['from']('cm_hopper_final')[_0x9d13('0x3a')](_0x9d13('0x7b'),_0x544eaa['params']['id'][_0x9d13('0x75')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x9d13('0x7c'))[_0x9d13('0x76')]('cm_hopper')[_0x9d13('0x3a')](_0x9d13('0x7b'),_0x544eaa[_0x9d13('0x51')]['id'][_0x9d13('0x75')]())))[_0x9d13('0x75')]();break;case _0x9d13('0x7d'):_0x7317c8=squel[_0x9d13('0x6a')]()['into']('cm_hopper')['fromQuery']([_0x9d13('0x6d'),_0x9d13('0x6e'),_0x9d13('0x73'),_0x9d13('0x6f'),'CampaignId','createdAt',_0x9d13('0x54')],squel['select']()['field'](_0x9d13('0x6d'),_0x9d13('0x6d'))[_0x9d13('0x71')](_0x9d13('0x72'),_0x9d13('0x6e'))[_0x9d13('0x71')]('id',_0x9d13('0x73'))['field'](_0x5d27ca[_0x9d13('0x74')]['toString'](),_0x9d13('0x6f'))[_0x9d13('0x71')](_0x544eaa['params']['id'][_0x9d13('0x75')](),'CampaignId')[_0x9d13('0x71')]('\x27'+_0x47a2a3+'\x27',_0x9d13('0x53'))[_0x9d13('0x71')]('\x27'+_0x47a2a3+'\x27','updatedAt')[_0x9d13('0x76')](_0x9d13('0x77'))[_0x9d13('0x3a')](_0x9d13('0x7e'))['where'](_0x9d13('0x78'),_0x5d27ca[_0x9d13('0x74')][_0x9d13('0x75')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x9d13('0x79'),squel[_0x9d13('0x70')]()[_0x9d13('0x71')](_0x9d13('0x7c'))[_0x9d13('0x76')](_0x9d13('0x7f'))[_0x9d13('0x3a')](_0x9d13('0x7b'),_0x544eaa[_0x9d13('0x51')]['id'][_0x9d13('0x75')]())))['toString']();break;default:_0x7317c8=squel['insert']()[_0x9d13('0x6b')](_0x9d13('0x7f'))[_0x9d13('0x6c')]([_0x9d13('0x6d'),_0x9d13('0x6e'),_0x9d13('0x73'),'ListId','CampaignId',_0x9d13('0x53'),'updatedAt'],squel[_0x9d13('0x70')]()[_0x9d13('0x71')]('phone','phone')[_0x9d13('0x71')](_0x9d13('0x72'),'scheduledAt')[_0x9d13('0x71')]('id',_0x9d13('0x73'))[_0x9d13('0x71')](_0x5d27ca[_0x9d13('0x74')][_0x9d13('0x75')](),_0x9d13('0x6f'))[_0x9d13('0x71')](_0x544eaa[_0x9d13('0x51')]['id'][_0x9d13('0x75')](),_0x9d13('0x5a'))[_0x9d13('0x71')]('\x27'+_0x47a2a3+'\x27','createdAt')[_0x9d13('0x71')]('\x27'+_0x47a2a3+'\x27',_0x9d13('0x54'))[_0x9d13('0x76')](_0x9d13('0x77'))[_0x9d13('0x3a')](_0x9d13('0x7e'))[_0x9d13('0x3a')](_0x9d13('0x78'),_0x5d27ca['CmListId'][_0x9d13('0x75')]())[_0x9d13('0x3a')](_0x9d13('0x80')))[_0x9d13('0x75')]();}_0x4d3035=squel[_0x9d13('0x6a')]()[_0x9d13('0x6b')](_0x9d13('0x81'))['fromQuery']([_0x9d13('0x82'),_0x9d13('0x6e'),_0x9d13('0x6d'),_0x9d13('0x83'),_0x9d13('0x53'),_0x9d13('0x54')],squel[_0x9d13('0x70')]()[_0x9d13('0x71')]('h.id','id')[_0x9d13('0x71')](_0x9d13('0x72'),_0x9d13('0x6e'))[_0x9d13('0x71')](_0x9d13('0x84'),_0x9d13('0x6d'))[_0x9d13('0x71')](_0x9d13('0x85'),'OrderBy')[_0x9d13('0x71')]('\x27'+_0x47a2a3+'\x27',_0x9d13('0x53'))[_0x9d13('0x71')]('\x27'+_0x47a2a3+'\x27',_0x9d13('0x54'))[_0x9d13('0x76')](_0x9d13('0x86'),'ci')[_0x9d13('0x87')]('cm_hopper','h',_0x9d13('0x88'))[_0x9d13('0x3a')](_0x9d13('0x89'),_0x5d27ca[_0x9d13('0x74')][_0x9d13('0x75')]())[_0x9d13('0x3a')](_0x9d13('0x8a'),_0x544eaa[_0x9d13('0x51')]['id']['toString']())[_0x9d13('0x3a')]('h.createdAt\x20=\x20?',_0x47a2a3))[_0x9d13('0x75')]();_0x302a58[_0x9d13('0x8b')](db[_0x9d13('0x8c')]['query'](_0x7317c8));_0x124578[_0x9d13('0x8b')](db[_0x9d13('0x8c')][_0x9d13('0x30')](_0x4d3035));}return BPromise[_0x9d13('0x8d')](_0x302a58);}})['then'](function(){return BPromise[_0x9d13('0x8d')](_0x124578);})['then'](function(){return _0x4b040a;})[_0x9d13('0x22')](respondWithResult(_0xa8443e,null))[_0x9d13('0x44')](handleError(_0xa8443e,null));};exports[_0x9d13('0x8e')]=function(_0x5ce426,_0x4d6501,_0x16fed2){return db[_0x9d13('0x2c')][_0x9d13('0x4c')]({'where':{'id':_0x5ce426['params']['id']}})[_0x9d13('0x22')](handleEntityNotFound(_0x4d6501,null))['then'](function(_0x3a1741){if(_0x3a1741){return _0x3a1741[_0x9d13('0x8e')](_0x5ce426[_0x9d13('0x30')][_0x9d13('0x67')]);}})[_0x9d13('0x22')](function(_0xa28ad4){if(_0xa28ad4){return db[_0x9d13('0x58')]['destroy']({'where':{'ListId':_0x5ce426[_0x9d13('0x30')][_0x9d13('0x67')],'CampaignId':_0x5ce426[_0x9d13('0x51')]['id']}})[_0x9d13('0x22')](function(){return _0xa28ad4;});}})[_0x9d13('0x22')](respondWithStatusCode(_0x4d6501,null))[_0x9d13('0x44')](handleError(_0x4d6501,null));};exports['getBlackLists']=function(_0x368305,_0x52de2f,_0x43df61){var _0x265c7e={};var _0x32a901={};var _0x4c2eab;var _0x478d4d;return db[_0x9d13('0x2c')][_0x9d13('0x57')]({'where':{'id':_0x368305[_0x9d13('0x51')]['id']}})[_0x9d13('0x22')](handleEntityNotFound(_0x52de2f,null))[_0x9d13('0x22')](function(_0x3a3945){if(_0x3a3945){_0x4c2eab=_0x3a3945;_0x32a901['model']=_['keys'](db[_0x9d13('0x62')][_0x9d13('0x2d')]);_0x32a901[_0x9d13('0x30')]=_[_0x9d13('0x46')](_0x368305[_0x9d13('0x30')]);_0x32a901[_0x9d13('0x31')]=_[_0x9d13('0x32')](_0x32a901[_0x9d13('0x33')],_0x32a901[_0x9d13('0x30')]);_0x265c7e[_0x9d13('0x35')]=_[_0x9d13('0x32')](_0x32a901[_0x9d13('0x33')],qs[_0x9d13('0x34')](_0x368305[_0x9d13('0x30')][_0x9d13('0x34')]));_0x265c7e['attributes']=_0x265c7e[_0x9d13('0x35')][_0x9d13('0x36')]?_0x265c7e[_0x9d13('0x35')]:_0x32a901['model'];_0x265c7e[_0x9d13('0x38')]=qs['sort'](_0x368305[_0x9d13('0x30')][_0x9d13('0x39')]);_0x265c7e[_0x9d13('0x3a')]=qs[_0x9d13('0x31')](_[_0x9d13('0x59')](_0x368305[_0x9d13('0x30')],_0x32a901['filters']));if(_0x368305[_0x9d13('0x30')][_0x9d13('0x3e')]){_0x265c7e[_0x9d13('0x3a')]=_[_0x9d13('0x3b')](_0x265c7e['where'],{'$or':_[_0x9d13('0x2f')](_0x265c7e['attributes'],function(_0x425c9a){var _0xdf83cc={};_0xdf83cc[_0x425c9a]={'$like':'%'+_0x368305[_0x9d13('0x30')][_0x9d13('0x3e')]+'%'};return _0xdf83cc;})});}_0x265c7e=_['merge']({},_0x265c7e,_0x368305['options']);return _0x4c2eab[_0x9d13('0x8f')](_0x265c7e);}})[_0x9d13('0x22')](function(_0x3697af){if(_0x3697af){_0x478d4d=_0x3697af[_0x9d13('0x36')];if(!_0x368305['query']['hasOwnProperty'](_0x9d13('0x5f'))){_0x265c7e[_0x9d13('0x1b')]=qs[_0x9d13('0x1b')](_0x368305[_0x9d13('0x30')]['limit']);_0x265c7e[_0x9d13('0x19')]=qs['offset'](_0x368305['query'][_0x9d13('0x19')]);}return _0x4c2eab[_0x9d13('0x8f')](_0x265c7e);}})[_0x9d13('0x22')](function(_0x22b8d3){if(_0x22b8d3){return _0x22b8d3?{'count':_0x478d4d,'rows':_0x22b8d3}:null;}})[_0x9d13('0x22')](respondWithResult(_0x52de2f,null))[_0x9d13('0x44')](handleError(_0x52de2f,null));};exports['addBlackLists']=function(_0x3da927,_0x113c2e,_0x2749dd){var _0x239f16,_0x594bc9;var _0xabdd4f=[];var _0x467cda=moment()[_0x9d13('0x65')](_0x9d13('0x66'));return db['Campaign'][_0x9d13('0x4c')]({'where':{'id':_0x3da927[_0x9d13('0x51')]['id']}})[_0x9d13('0x22')](handleEntityNotFound(_0x113c2e,null))[_0x9d13('0x22')](function(_0x2fc27d){if(_0x2fc27d){_0x594bc9=_0x2fc27d;return _0x2fc27d['addBlackLists'](_0x3da927[_0x9d13('0x48')][_0x9d13('0x67')],_[_0x9d13('0x52')](_0x3da927[_0x9d13('0x48')],[_0x9d13('0x67'),'id'])||{});}return null;})['spread'](function(_0x3de94e){var _0x53e061;var _0x4f9bc4;_0x239f16=_0x3de94e||[];var _0x5370c9=[];if(_0x3de94e){for(var _0x575ff3=0x0;_0x575ff3<_0x3de94e[_0x9d13('0x36')];_0x575ff3+=0x1){var _0x4ec691=_0x3de94e[_0x575ff3]['get']({'plain':!![]});_0x53e061=squel['insert']()[_0x9d13('0x6b')](_0x9d13('0x90'))[_0x9d13('0x6c')]([_0x9d13('0x6d'),_0x9d13('0x73'),_0x9d13('0x6f'),_0x9d13('0x5a'),_0x9d13('0x53'),_0x9d13('0x54')],squel[_0x9d13('0x70')]()[_0x9d13('0x71')](_0x9d13('0x6d'),'phone')[_0x9d13('0x71')]('id','ContactId')[_0x9d13('0x71')](_0x4ec691[_0x9d13('0x74')][_0x9d13('0x75')](),_0x9d13('0x6f'))[_0x9d13('0x71')](_0x3da927[_0x9d13('0x51')]['id'][_0x9d13('0x75')](),_0x9d13('0x5a'))[_0x9d13('0x71')]('NOW()',_0x9d13('0x53'))[_0x9d13('0x71')](_0x9d13('0x72'),_0x9d13('0x54'))[_0x9d13('0x76')](_0x9d13('0x77'))[_0x9d13('0x3a')](_0x9d13('0x7e'))['where']('ListId\x20=\x20?',_0x4ec691['CmListId'][_0x9d13('0x75')]())['where'](_0x9d13('0x80')))[_0x9d13('0x75')]();_0x5370c9[_0x9d13('0x8b')](db[_0x9d13('0x8c')][_0x9d13('0x30')](_0x53e061));}return BPromise[_0x9d13('0x8d')](_0x5370c9);}})[_0x9d13('0x22')](function(){return _0x239f16;})['then'](respondWithResult(_0x113c2e,null))['catch'](handleError(_0x113c2e,null));};exports[_0x9d13('0x91')]=function(_0x30d0a6,_0x18e95a,_0x3082b1){return db[_0x9d13('0x2c')][_0x9d13('0x4c')]({'where':{'id':_0x30d0a6[_0x9d13('0x51')]['id']}})['then'](handleEntityNotFound(_0x18e95a,null))[_0x9d13('0x22')](function(_0x4e35c9){if(_0x4e35c9){return _0x4e35c9[_0x9d13('0x91')](_0x30d0a6[_0x9d13('0x30')][_0x9d13('0x67')]);}})[_0x9d13('0x22')](function(_0x18fbab){if(_0x18fbab){return db[_0x9d13('0x61')][_0x9d13('0x23')]({'where':{'ListId':_0x30d0a6['query'][_0x9d13('0x67')],'CampaignId':_0x30d0a6['params']['id']}})[_0x9d13('0x22')](function(){return _0x18fbab;});}})['then'](respondWithStatusCode(_0x18e95a,null))[_0x9d13('0x44')](handleError(_0x18e95a,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index c0de23c..50d9aed 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x32062c,_0x43ee1f){var _0xa8ccf1=function(_0x501489){while(--_0x501489){_0x32062c['push'](_0x32062c['shift']());}};_0xa8ccf1(++_0x43ee1f);}(_0x7a54,0x106));var _0x47a5=function(_0x483c5a,_0x5e9d87){_0x483c5a=_0x483c5a-0x0;var _0x5c6bb2=_0x7a54[_0x483c5a];return _0x5c6bb2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4063a4,_0x19d730){var _0x17908d=function(_0x3ce714){while(--_0x3ce714){_0x4063a4['push'](_0x4063a4['shift']());}};_0x17908d(++_0x19d730);}(_0x7a54,0x106));var _0x47a5=function(_0x58c8af,_0x5758d6){_0x58c8af=_0x58c8af-0x0;var _0x14603b=_0x7a54[_0x58c8af];return _0x14603b;};'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 427778c..206581e 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 _0x5178=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','include','map','model','then','util','moment','bluebird'];(function(_0x2ba006,_0x32c82d){var _0x4af089=function(_0x51de61){while(--_0x51de61){_0x2ba006['push'](_0x2ba006['shift']());}};_0x4af089(++_0x32c82d);}(_0x5178,0x171));var _0x8517=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5178[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x8517('0x0'));var moment=require(_0x8517('0x1'));var BPromise=require(_0x8517('0x2'));var rs=require(_0x8517('0x3'));var fs=require('fs');var Redis=require(_0x8517('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8517('0x5'))(_0x8517('0x6'));var config=require('../../config/environment');var jayson=require(_0x8517('0x7'));var client=jayson['client'][_0x8517('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45498e,_0x3615b2,_0x10f918){return new BPromise(function(_0x25146d,_0x49739b){return client[_0x8517('0x9')](_0x45498e,_0x10f918)['then'](function(_0x485677){logger[_0x8517('0xa')](_0x8517('0xb'),_0x3615b2,'request\x20sent');logger[_0x8517('0xc')](_0x8517('0xd'),_0x3615b2,_0x8517('0xe'),JSON[_0x8517('0xf')](_0x485677));if(_0x485677[_0x8517('0x10')]){if(_0x485677[_0x8517('0x10')][_0x8517('0x11')]===0x1f4){logger[_0x8517('0x10')]('Campaign,\x20%s,\x20%s',_0x3615b2,_0x485677[_0x8517('0x10')][_0x8517('0x12')]);return _0x49739b(_0x485677[_0x8517('0x10')][_0x8517('0x12')]);}logger[_0x8517('0x10')]('Campaign,\x20%s,\x20%s',_0x3615b2,_0x485677[_0x8517('0x10')][_0x8517('0x12')]);return _0x25146d(_0x485677[_0x8517('0x10')][_0x8517('0x12')]);}else{logger[_0x8517('0xa')](_0x8517('0xb'),_0x3615b2,_0x8517('0xe'));_0x25146d(_0x485677[_0x8517('0x13')][_0x8517('0x12')]);}})[_0x8517('0x14')](function(_0x22b687){logger[_0x8517('0x10')]('Campaign,\x20%s,\x20%s',_0x3615b2,_0x22b687);_0x49739b(_0x22b687);});});}exports[_0x8517('0x15')]=function(_0x100b76){var _0x38e0f3=this;return new Promise(function(_0xf1b53b,_0x64875e){return db[_0x8517('0x16')][_0x8517('0x17')]({'raw':_0x100b76['options']?_0x100b76[_0x8517('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x100b76['options']?_0x100b76[_0x8517('0x18')][_0x8517('0x19')]||null:null,'attributes':_0x100b76[_0x8517('0x18')]?_0x100b76[_0x8517('0x18')][_0x8517('0x1a')]||null:null,'limit':_0x100b76[_0x8517('0x18')]?_0x100b76['options']['limit']||null:null,'include':_0x100b76[_0x8517('0x18')]?_0x100b76[_0x8517('0x18')][_0x8517('0x1b')]?_[_0x8517('0x1c')](_0x100b76[_0x8517('0x18')][_0x8517('0x1b')],function(_0x5f02ee){return{'model':db[_0x5f02ee[_0x8517('0x1d')]],'as':_0x5f02ee['as'],'attributes':_0x5f02ee[_0x8517('0x1a')],'include':_0x5f02ee['include']?_[_0x8517('0x1c')](_0x5f02ee[_0x8517('0x1b')],function(_0x42c779){return{'model':db[_0x42c779['model']],'as':_0x42c779['as'],'attributes':_0x42c779[_0x8517('0x1a')],'include':_0x42c779['include']?_[_0x8517('0x1c')](_0x42c779[_0x8517('0x1b')],function(_0x448211){return{'model':db[_0x448211[_0x8517('0x1d')]],'as':_0x448211['as'],'attributes':_0x448211[_0x8517('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8517('0x1e')](function(_0x481ceb){logger[_0x8517('0xa')]('GetCampaign',_0x100b76);logger[_0x8517('0xc')](_0x8517('0x15'),_0x100b76,JSON[_0x8517('0xf')](_0x481ceb));_0xf1b53b(_0x481ceb);})[_0x8517('0x14')](function(_0x3e6f89){logger[_0x8517('0x10')]('GetCampaign',_0x3e6f89[_0x8517('0x12')],_0x100b76);_0x64875e(_0x38e0f3['error'](0x1f4,_0x3e6f89[_0x8517('0x12')]));});});}; \ No newline at end of file +var _0x342b=['map','model','lodash','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','raw','options','where','attributes','include'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x342b,0xbc));var _0xb342=function(_0xfde960,_0x146ba0){_0xfde960=_0xfde960-0x0;var _0x26e514=_0x342b[_0xfde960];return _0x26e514;};'use strict';var _=require(_0xb342('0x0'));var util=require('util');var moment=require(_0xb342('0x1'));var BPromise=require(_0xb342('0x2'));var rs=require(_0xb342('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb342('0x4'));var config=require(_0xb342('0x5'));var jayson=require(_0xb342('0x6'));var client=jayson[_0xb342('0x7')][_0xb342('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f6281,_0x30106f,_0x3c7ac7){return new BPromise(function(_0x54175e,_0x54c788){return client[_0xb342('0x9')](_0x2f6281,_0x3c7ac7)[_0xb342('0xa')](function(_0x4e8f65){logger[_0xb342('0xb')](_0xb342('0xc'),_0x30106f,_0xb342('0xd'));logger[_0xb342('0xe')](_0xb342('0xf'),_0x30106f,_0xb342('0xd'),JSON[_0xb342('0x10')](_0x4e8f65));if(_0x4e8f65[_0xb342('0x11')]){if(_0x4e8f65[_0xb342('0x11')][_0xb342('0x12')]===0x1f4){logger[_0xb342('0x11')]('Campaign,\x20%s,\x20%s',_0x30106f,_0x4e8f65[_0xb342('0x11')]['message']);return _0x54c788(_0x4e8f65['error']['message']);}logger[_0xb342('0x11')](_0xb342('0xc'),_0x30106f,_0x4e8f65[_0xb342('0x11')][_0xb342('0x13')]);return _0x54175e(_0x4e8f65[_0xb342('0x11')][_0xb342('0x13')]);}else{logger[_0xb342('0xb')](_0xb342('0xc'),_0x30106f,'request\x20sent');_0x54175e(_0x4e8f65[_0xb342('0x14')][_0xb342('0x13')]);}})['catch'](function(_0x5ee646){logger['error'](_0xb342('0xc'),_0x30106f,_0x5ee646);_0x54c788(_0x5ee646);});});}exports[_0xb342('0x15')]=function(_0x52b3b6){var _0x26583c=this;return new Promise(function(_0x2fa7cd,_0x1694c7){return db[_0xb342('0x16')][_0xb342('0x17')]({'raw':_0x52b3b6['options']?_0x52b3b6['options'][_0xb342('0x18')]===undefined?!![]:![]:!![],'where':_0x52b3b6['options']?_0x52b3b6[_0xb342('0x19')][_0xb342('0x1a')]||null:null,'attributes':_0x52b3b6[_0xb342('0x19')]?_0x52b3b6[_0xb342('0x19')][_0xb342('0x1b')]||null:null,'limit':_0x52b3b6['options']?_0x52b3b6[_0xb342('0x19')]['limit']||null:null,'include':_0x52b3b6[_0xb342('0x19')]?_0x52b3b6['options'][_0xb342('0x1c')]?_[_0xb342('0x1d')](_0x52b3b6[_0xb342('0x19')][_0xb342('0x1c')],function(_0x4eda3a){return{'model':db[_0x4eda3a[_0xb342('0x1e')]],'as':_0x4eda3a['as'],'attributes':_0x4eda3a['attributes'],'include':_0x4eda3a['include']?_[_0xb342('0x1d')](_0x4eda3a['include'],function(_0x31aa2b){return{'model':db[_0x31aa2b[_0xb342('0x1e')]],'as':_0x31aa2b['as'],'attributes':_0x31aa2b[_0xb342('0x1b')],'include':_0x31aa2b[_0xb342('0x1c')]?_['map'](_0x31aa2b[_0xb342('0x1c')],function(_0x31469f){return{'model':db[_0x31469f[_0xb342('0x1e')]],'as':_0x31469f['as'],'attributes':_0x31469f[_0xb342('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb342('0xa')](function(_0x27005b){logger[_0xb342('0xb')]('GetCampaign',_0x52b3b6);logger[_0xb342('0xe')](_0xb342('0x15'),_0x52b3b6,JSON[_0xb342('0x10')](_0x27005b));_0x2fa7cd(_0x27005b);})['catch'](function(_0x54cc70){logger['error'](_0xb342('0x15'),_0x54cc70['message'],_0x52b3b6);_0x1694c7(_0x26583c[_0xb342('0x11')](0x1f4,_0x54cc70['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index d24f407..f8f227d 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 _0xb00d=['getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','clone','addLists','addBlackLists','put','update','/:id','destroy','delete','removeLists','removeBlackLists','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','show','isAuthenticated','/:id/hopper_histories','/:id/hopper_finals'];(function(_0x5d07bb,_0x271464){var _0x42960a=function(_0x2f0724){while(--_0x2f0724){_0x5d07bb['push'](_0x5d07bb['shift']());}};_0x42960a(++_0x271464);}(_0xb00d,0x97));var _0xdb00=function(_0x2b4448,_0x5bcc69){_0x2b4448=_0x2b4448-0x0;var _0xb4b465=_0xb00d[_0x2b4448];return _0xb4b465;};'use strict';var multer=require(_0xdb00('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdb00('0x1'));var router=express[_0xdb00('0x2')]();var fs_extra=require(_0xdb00('0x3'));var auth=require(_0xdb00('0x4'));var interaction=require(_0xdb00('0x5'));var config=require(_0xdb00('0x6'));var controller=require(_0xdb00('0x7'));router[_0xdb00('0x8')]('/',auth['isAuthenticated'](),controller[_0xdb00('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdb00('0xa')]);router[_0xdb00('0x8')]('/:id/hoppers',auth[_0xdb00('0xb')](),controller['getHoppers']);router[_0xdb00('0x8')](_0xdb00('0xc'),auth['isAuthenticated'](),controller['getHopperHistories']);router['get'](_0xdb00('0xd'),auth[_0xdb00('0xb')](),controller[_0xdb00('0xe')]);router['get'](_0xdb00('0xf'),auth[_0xdb00('0xb')](),controller[_0xdb00('0x10')]);router[_0xdb00('0x8')](_0xdb00('0x11'),auth[_0xdb00('0xb')](),controller[_0xdb00('0x12')]);router['get'](_0xdb00('0x13'),auth[_0xdb00('0xb')](),controller['getBlackLists']);router[_0xdb00('0x14')]('/',auth[_0xdb00('0xb')](),controller[_0xdb00('0x15')]);router['post']('/:id/clone',auth[_0xdb00('0xb')](),controller[_0xdb00('0x16')]);router[_0xdb00('0x14')](_0xdb00('0x11'),auth[_0xdb00('0xb')](),controller[_0xdb00('0x17')]);router['post'](_0xdb00('0x13'),auth[_0xdb00('0xb')](),controller[_0xdb00('0x18')]);router[_0xdb00('0x19')]('/:id',auth[_0xdb00('0xb')](),controller[_0xdb00('0x1a')]);router['delete'](_0xdb00('0x1b'),auth['isAuthenticated'](),controller[_0xdb00('0x1c')]);router[_0xdb00('0x1d')](_0xdb00('0x11'),auth[_0xdb00('0xb')](),controller[_0xdb00('0x1e')]);router[_0xdb00('0x1d')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xdb00('0x1f')]);module[_0xdb00('0x20')]=router; \ No newline at end of file +var _0x0a70=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','post','create','/:id/clone','clone','addLists','put','delete','/:id/blacklists','removeBlackLists','exports'];(function(_0x26253d,_0x5dfc80){var _0x318a82=function(_0x22ae6a){while(--_0x22ae6a){_0x26253d['push'](_0x26253d['shift']());}};_0x318a82(++_0x5dfc80);}(_0x0a70,0x1c2));var _0x00a7=function(_0x8f239e,_0x5d4d21){_0x8f239e=_0x8f239e-0x0;var _0x12bef7=_0x0a70[_0x8f239e];return _0x12bef7;};'use strict';var multer=require(_0x00a7('0x0'));var util=require(_0x00a7('0x1'));var path=require('path');var timeout=require(_0x00a7('0x2'));var express=require(_0x00a7('0x3'));var router=express[_0x00a7('0x4')]();var fs_extra=require(_0x00a7('0x5'));var auth=require(_0x00a7('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x00a7('0x7'));router[_0x00a7('0x8')]('/',auth[_0x00a7('0x9')](),controller[_0x00a7('0xa')]);router[_0x00a7('0x8')](_0x00a7('0xb'),auth[_0x00a7('0x9')](),controller[_0x00a7('0xc')]);router[_0x00a7('0x8')](_0x00a7('0xd'),auth[_0x00a7('0x9')](),controller[_0x00a7('0xe')]);router[_0x00a7('0x8')](_0x00a7('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router['get']('/:id/hopper_finals',auth[_0x00a7('0x9')](),controller[_0x00a7('0x10')]);router[_0x00a7('0x8')](_0x00a7('0x11'),auth[_0x00a7('0x9')](),controller[_0x00a7('0x12')]);router['get'](_0x00a7('0x13'),auth[_0x00a7('0x9')](),controller['getLists']);router['get']('/:id/blacklists',auth[_0x00a7('0x9')](),controller['getBlackLists']);router[_0x00a7('0x14')]('/',auth[_0x00a7('0x9')](),controller[_0x00a7('0x15')]);router[_0x00a7('0x14')](_0x00a7('0x16'),auth[_0x00a7('0x9')](),controller[_0x00a7('0x17')]);router[_0x00a7('0x14')](_0x00a7('0x13'),auth[_0x00a7('0x9')](),controller[_0x00a7('0x18')]);router['post']('/:id/blacklists',auth[_0x00a7('0x9')](),controller['addBlackLists']);router[_0x00a7('0x19')](_0x00a7('0xb'),auth[_0x00a7('0x9')](),controller['update']);router[_0x00a7('0x1a')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x00a7('0x1a')](_0x00a7('0x13'),auth[_0x00a7('0x9')](),controller['removeLists']);router[_0x00a7('0x1a')](_0x00a7('0x1b'),auth[_0x00a7('0x9')](),controller[_0x00a7('0x1c')]);module[_0x00a7('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index f310f58..2de8489 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 _0xc58d=['getDataValue','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x2a3a18,_0x438fbf){var _0x5620f5=function(_0x3df409){while(--_0x3df409){_0x2a3a18['push'](_0x2a3a18['shift']());}};_0x5620f5(++_0x438fbf);}(_0xc58d,0x73));var _0xdc58=function(_0x4f12ee,_0xbe8277){_0x4f12ee=_0x4f12ee-0x0;var _0x4b0fe2=_0xc58d[_0x4f12ee];return _0x4b0fe2;};'use strict';var Sequelize=require(_0xdc58('0x0'));module[_0xdc58('0x1')]={'key':{'type':Sequelize[_0xdc58('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xdc58('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xdc58('0x4')],'get':function(){return this[_0xdc58('0x5')]('key');}}}; \ No newline at end of file +var _0x0a7d=['key','sequelize','STRING','VIRTUAL','getDataValue'];(function(_0x4ca55f,_0xf27e7f){var _0x1435c0=function(_0x25e733){while(--_0x25e733){_0x4ca55f['push'](_0x4ca55f['shift']());}};_0x1435c0(++_0xf27e7f);}(_0x0a7d,0x105));var _0xd0a7=function(_0x5a2d3f,_0x27b04e){_0x5a2d3f=_0x5a2d3f-0x0;var _0x5c65d8=_0x0a7d[_0x5a2d3f];return _0x5c65d8;};'use strict';var Sequelize=require(_0xd0a7('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xd0a7('0x1')]},'name':{'type':Sequelize[_0xd0a7('0x2')],'get':function(){return this[_0xd0a7('0x3')](_0xd0a7('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 76189fd..8ecaaad 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 _0xbc20=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','error','name','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','CannedAnswer','includeAll','rows','catch','show','params','length','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x26bc4b,_0x3cee9d){var _0x1e30ed=function(_0x122c24){while(--_0x122c24){_0x26bc4b['push'](_0x26bc4b['shift']());}};_0x1e30ed(++_0x3cee9d);}(_0xbc20,0xa0));var _0x0bc2=function(_0xae1a83,_0x1980d4){_0xae1a83=_0xae1a83-0x0;var _0xdb9da8=_0xbc20[_0xae1a83];return _0xdb9da8;};'use strict';var emlformat=require(_0x0bc2('0x0'));var rimraf=require(_0x0bc2('0x1'));var zipdir=require(_0x0bc2('0x2'));var jsonpatch=require(_0x0bc2('0x3'));var rp=require(_0x0bc2('0x4'));var moment=require(_0x0bc2('0x5'));var BPromise=require(_0x0bc2('0x6'));var Mustache=require('mustache');var util=require(_0x0bc2('0x7'));var path=require(_0x0bc2('0x8'));var sox=require('sox');var csv=require(_0x0bc2('0x9'));var ejs=require(_0x0bc2('0xa'));var fs=require('fs');var fs_extra=require(_0x0bc2('0xb'));var _=require(_0x0bc2('0xc'));var squel=require('squel');var crypto=require(_0x0bc2('0xd'));var jsforce=require(_0x0bc2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0bc2('0x9'));var querystring=require(_0x0bc2('0xf'));var Papa=require(_0x0bc2('0x10'));var Redis=require(_0x0bc2('0x11'));var authService=require(_0x0bc2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0bc2('0x13'));var hardwareService=require(_0x0bc2('0x14'));var logger=require(_0x0bc2('0x15'))(_0x0bc2('0x16'));var utils=require(_0x0bc2('0x17'));var config=require(_0x0bc2('0x18'));var licenseUtil=require(_0x0bc2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16655d,_0x20b05a){_0x20b05a=_0x20b05a||0xcc;return function(_0x4fd2f0){if(_0x4fd2f0){return _0x16655d[_0x0bc2('0x1a')](_0x20b05a);}return _0x16655d['status'](_0x20b05a)[_0x0bc2('0x1b')]();};}function respondWithResult(_0x507a44,_0xb64cc3){_0xb64cc3=_0xb64cc3||0xc8;return function(_0x5dab1a){if(_0x5dab1a){return _0x507a44[_0x0bc2('0x1c')](_0xb64cc3)[_0x0bc2('0x1d')](_0x5dab1a);}};}function respondWithFilteredResult(_0x181691,_0x4a8045){return function(_0x1161f1){if(_0x1161f1){var _0x321b7f=typeof _0x4a8045[_0x0bc2('0x1e')]===_0x0bc2('0x1f')&&typeof _0x4a8045['limit']===_0x0bc2('0x1f');var _0x32bc99=_0x1161f1[_0x0bc2('0x20')];var _0x23a9ab=_0x321b7f?0x0:_0x4a8045[_0x0bc2('0x1e')];var _0x5e1e15=_0x321b7f?_0x1161f1[_0x0bc2('0x20')]:_0x4a8045[_0x0bc2('0x1e')]+_0x4a8045[_0x0bc2('0x21')];var _0x3824b0;if(_0x5e1e15>=_0x32bc99){_0x5e1e15=_0x32bc99;_0x3824b0=0xc8;}else{_0x3824b0=0xce;}_0x181691[_0x0bc2('0x1c')](_0x3824b0);return _0x181691[_0x0bc2('0x22')](_0x0bc2('0x23'),_0x23a9ab+'-'+_0x5e1e15+'/'+_0x32bc99)['json'](_0x1161f1);}return null;};}function patchUpdates(_0x2fae58){return function(_0x56e351){try{jsonpatch[_0x0bc2('0x24')](_0x56e351,_0x2fae58,!![]);}catch(_0x579046){return BPromise[_0x0bc2('0x25')](_0x579046);}return _0x56e351['save']();};}function saveUpdates(_0x2c33c5,_0x37bfc8){return function(_0x1a9af1){if(_0x1a9af1){return _0x1a9af1[_0x0bc2('0x26')](_0x2c33c5)[_0x0bc2('0x27')](function(_0x1d2372){return _0x1d2372;});}return null;};}function removeEntity(_0x44539d,_0x3e9d65){return function(_0x56aca0){if(_0x56aca0){return _0x56aca0[_0x0bc2('0x28')]()[_0x0bc2('0x27')](function(){var _0x186394=_0x56aca0[_0x0bc2('0x29')]({'plain':!![]});var _0x505693=_0x0bc2('0x2a');return db[_0x0bc2('0x2b')][_0x0bc2('0x28')]({'where':{'type':_0x505693,'resourceId':_0x186394['id']}})[_0x0bc2('0x27')](function(){return _0x56aca0;});})['then'](function(){_0x44539d[_0x0bc2('0x1c')](0xcc)[_0x0bc2('0x1b')]();});}};}function handleEntityNotFound(_0x2080f4,_0x4722ad){return function(_0x153ad6){if(!_0x153ad6){_0x2080f4[_0x0bc2('0x1a')](0x194);}return _0x153ad6;};}function handleError(_0x29ca32,_0x64f4e5){_0x64f4e5=_0x64f4e5||0x1f4;return function(_0x528a02){logger[_0x0bc2('0x2c')](_0x528a02['stack']);if(_0x528a02['name']){delete _0x528a02[_0x0bc2('0x2d')];}_0x29ca32[_0x0bc2('0x1c')](_0x64f4e5)['send'](_0x528a02);};}exports[_0x0bc2('0x2e')]=function(_0x34f97f,_0x130666){var _0x34a90d={},_0x2be473={},_0x2775d2={'count':0x0,'rows':[]};var _0x15814a=_[_0x0bc2('0x2f')](db['CannedAnswer'][_0x0bc2('0x30')],function(_0x1f4b64){return{'name':_0x1f4b64[_0x0bc2('0x31')],'type':_0x1f4b64['type'][_0x0bc2('0x32')]};});_0x2be473[_0x0bc2('0x33')]=_[_0x0bc2('0x2f')](_0x15814a,_0x0bc2('0x2d'));_0x2be473['query']=_[_0x0bc2('0x34')](_0x34f97f[_0x0bc2('0x35')]);_0x2be473[_0x0bc2('0x36')]=_[_0x0bc2('0x37')](_0x2be473[_0x0bc2('0x33')],_0x2be473[_0x0bc2('0x35')]);_0x34a90d[_0x0bc2('0x38')]=_[_0x0bc2('0x37')](_0x2be473[_0x0bc2('0x33')],qs[_0x0bc2('0x39')](_0x34f97f[_0x0bc2('0x35')][_0x0bc2('0x39')]));_0x34a90d[_0x0bc2('0x38')]=_0x34a90d[_0x0bc2('0x38')]['length']?_0x34a90d[_0x0bc2('0x38')]:_0x2be473[_0x0bc2('0x33')];if(!_0x34f97f['query'][_0x0bc2('0x3a')](_0x0bc2('0x3b'))){_0x34a90d[_0x0bc2('0x21')]=qs['limit'](_0x34f97f[_0x0bc2('0x35')][_0x0bc2('0x21')]);_0x34a90d['offset']=qs[_0x0bc2('0x1e')](_0x34f97f[_0x0bc2('0x35')]['offset']);}_0x34a90d[_0x0bc2('0x3c')]=qs[_0x0bc2('0x3d')](_0x34f97f[_0x0bc2('0x35')][_0x0bc2('0x3d')]);_0x34a90d[_0x0bc2('0x3e')]=qs[_0x0bc2('0x36')](_[_0x0bc2('0x3f')](_0x34f97f[_0x0bc2('0x35')],_0x2be473[_0x0bc2('0x36')]),_0x15814a);if(_0x34f97f[_0x0bc2('0x35')]['filter']){_0x34a90d[_0x0bc2('0x3e')]=_[_0x0bc2('0x40')](_0x34a90d[_0x0bc2('0x3e')],{'$or':[{'key':{'$like':'%'+_0x34f97f[_0x0bc2('0x35')][_0x0bc2('0x41')]+'%'}},{'value':{'$like':'%'+_0x34f97f[_0x0bc2('0x35')]['filter']+'%'}}]});}_0x34a90d=_[_0x0bc2('0x40')]({},_0x34a90d,_0x34f97f['options']);var _0x28417c={'where':_0x34a90d[_0x0bc2('0x3e')]};return db[_0x0bc2('0x42')]['count'](_0x28417c)[_0x0bc2('0x27')](function(_0x4fb503){_0x2775d2[_0x0bc2('0x20')]=_0x4fb503;if(_0x34f97f[_0x0bc2('0x35')][_0x0bc2('0x43')]){_0x34a90d['include']=[{'all':!![]}];}return db[_0x0bc2('0x42')]['findAll'](_0x34a90d);})[_0x0bc2('0x27')](function(_0x38904c){_0x2775d2[_0x0bc2('0x44')]=_0x38904c;return _0x2775d2;})[_0x0bc2('0x27')](respondWithFilteredResult(_0x130666,_0x34a90d))[_0x0bc2('0x45')](handleError(_0x130666,null));};exports[_0x0bc2('0x46')]=function(_0x3e6e6a,_0x262c26){var _0x4cab99={'raw':!![],'where':{'id':_0x3e6e6a[_0x0bc2('0x47')]['id']}},_0x1ff630={};_0x1ff630['model']=_[_0x0bc2('0x34')](db[_0x0bc2('0x42')][_0x0bc2('0x30')]);_0x1ff630[_0x0bc2('0x35')]=_[_0x0bc2('0x34')](_0x3e6e6a[_0x0bc2('0x35')]);_0x1ff630['filters']=_['intersection'](_0x1ff630['model'],_0x1ff630[_0x0bc2('0x35')]);_0x4cab99[_0x0bc2('0x38')]=_[_0x0bc2('0x37')](_0x1ff630[_0x0bc2('0x33')],qs[_0x0bc2('0x39')](_0x3e6e6a[_0x0bc2('0x35')][_0x0bc2('0x39')]));_0x4cab99[_0x0bc2('0x38')]=_0x4cab99[_0x0bc2('0x38')][_0x0bc2('0x48')]?_0x4cab99[_0x0bc2('0x38')]:_0x1ff630['model'];if(_0x3e6e6a['query']['includeAll']){_0x4cab99[_0x0bc2('0x49')]=[{'all':!![]}];}_0x4cab99=_[_0x0bc2('0x40')]({},_0x4cab99,_0x3e6e6a['options']);return db[_0x0bc2('0x42')][_0x0bc2('0x4a')](_0x4cab99)['then'](handleEntityNotFound(_0x262c26,null))[_0x0bc2('0x27')](respondWithResult(_0x262c26,null))[_0x0bc2('0x45')](handleError(_0x262c26,null));};exports[_0x0bc2('0x26')]=function(_0x2014fd,_0x3d7c56){if(_0x2014fd['body']['id']){delete _0x2014fd[_0x0bc2('0x4b')]['id'];}return db[_0x0bc2('0x42')]['find']({'where':{'id':_0x2014fd['params']['id']}})[_0x0bc2('0x27')](handleEntityNotFound(_0x3d7c56,null))[_0x0bc2('0x27')](saveUpdates(_0x2014fd[_0x0bc2('0x4b')],null))[_0x0bc2('0x27')](respondWithResult(_0x3d7c56,null))['catch'](handleError(_0x3d7c56,null));};exports['destroy']=function(_0x640ff5,_0xf819d5){return db[_0x0bc2('0x42')][_0x0bc2('0x4a')]({'where':{'id':_0x640ff5['params']['id']}})[_0x0bc2('0x27')](handleEntityNotFound(_0xf819d5,null))[_0x0bc2('0x27')](removeEntity(_0xf819d5,null))['catch'](handleError(_0xf819d5,null));};exports[_0x0bc2('0x4c')]=function(_0x2da5d4,_0x430dda){var _0x3ea30e={'key':_0x2da5d4[_0x0bc2('0x4b')]['key']};if(_0x2da5d4[_0x0bc2('0x4b')][_0x0bc2('0x4d')]){_0x3ea30e[_0x0bc2('0x4d')]=_0x2da5d4['body'][_0x0bc2('0x4d')];}else if(_0x2da5d4[_0x0bc2('0x4b')][_0x0bc2('0x4e')]){_0x3ea30e[_0x0bc2('0x4e')]=_0x2da5d4[_0x0bc2('0x4b')][_0x0bc2('0x4e')];}else if(_0x2da5d4[_0x0bc2('0x4b')][_0x0bc2('0x4f')]){_0x3ea30e[_0x0bc2('0x4f')]=_0x2da5d4[_0x0bc2('0x4b')][_0x0bc2('0x4f')];}else if(_0x2da5d4[_0x0bc2('0x4b')][_0x0bc2('0x50')]){_0x3ea30e['ChatWebsiteId']=_0x2da5d4[_0x0bc2('0x4b')][_0x0bc2('0x50')];}return db[_0x0bc2('0x42')][_0x0bc2('0x4a')]({'where':_0x3ea30e})[_0x0bc2('0x27')](function(_0x1708a0){if(_0x1708a0){throw new db['Sequelize']['ValidationError'](_0x0bc2('0x51'));}return db[_0x0bc2('0x42')]['create'](_0x2da5d4['body']);})[_0x0bc2('0x27')](function(_0x30497b){var _0x2244c3=_0x2da5d4[_0x0bc2('0x52')][_0x0bc2('0x29')]({'plain':!![]});if(!_0x2244c3)throw new Error(_0x0bc2('0x53'));if(_0x2244c3['role']===_0x0bc2('0x52')){var _0x2694f9=_0x30497b[_0x0bc2('0x29')]({'plain':!![]});return db[_0x0bc2('0x54')][_0x0bc2('0x4a')]({'where':{'name':_0x0bc2('0x2a'),'userProfileId':_0x2244c3['userProfileId']},'raw':!![]})[_0x0bc2('0x27')](function(_0x132f4c){if(_0x132f4c&&_0x132f4c[_0x0bc2('0x55')]===0x0){return db[_0x0bc2('0x2b')][_0x0bc2('0x4c')]({'name':_0x2694f9['name'],'resourceId':_0x2694f9['id'],'type':_0x132f4c[_0x0bc2('0x2d')],'sectionId':_0x132f4c['id']},{})[_0x0bc2('0x27')](function(){return _0x30497b;});}else{return _0x30497b;}})[_0x0bc2('0x45')](function(_0x2699b7){logger[_0x0bc2('0x2c')](_0x0bc2('0x56'),_0x2699b7);throw _0x2699b7;});}return _0x30497b;})[_0x0bc2('0x27')](respondWithResult(_0x430dda,0xc9))[_0x0bc2('0x45')](handleError(_0x430dda,null));}; \ No newline at end of file +var _0x3dea=['SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','../../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','Content-Range','apply','update','then','get','CannedAnswers','UserProfileResource','destroy','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CannedAnswer','include','findAll','rows','catch','show','params','find','body','create','MailAccountId'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x3dea,0x16b));var _0xa3de=function(_0x5b11ae,_0x5ef9e3){_0x5b11ae=_0x5b11ae-0x0;var _0x3ef5f9=_0x3dea[_0x5b11ae];return _0x3ef5f9;};'use strict';var emlformat=require(_0xa3de('0x0'));var rimraf=require(_0xa3de('0x1'));var zipdir=require(_0xa3de('0x2'));var jsonpatch=require(_0xa3de('0x3'));var rp=require(_0xa3de('0x4'));var moment=require(_0xa3de('0x5'));var BPromise=require(_0xa3de('0x6'));var Mustache=require(_0xa3de('0x7'));var util=require(_0xa3de('0x8'));var path=require(_0xa3de('0x9'));var sox=require(_0xa3de('0xa'));var csv=require(_0xa3de('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa3de('0xc'));var _=require(_0xa3de('0xd'));var squel=require(_0xa3de('0xe'));var crypto=require(_0xa3de('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa3de('0xb'));var querystring=require(_0xa3de('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa3de('0x11'));var qs=require(_0xa3de('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa3de('0x13'));var logger=require(_0xa3de('0x14'))(_0xa3de('0x15'));var utils=require(_0xa3de('0x16'));var config=require(_0xa3de('0x17'));var licenseUtil=require(_0xa3de('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f5e0e,_0x11c11c){_0x11c11c=_0x11c11c||0xcc;return function(_0x1137ab){if(_0x1137ab){return _0x2f5e0e[_0xa3de('0x19')](_0x11c11c);}return _0x2f5e0e[_0xa3de('0x1a')](_0x11c11c)[_0xa3de('0x1b')]();};}function respondWithResult(_0x6f82a5,_0x50c51d){_0x50c51d=_0x50c51d||0xc8;return function(_0x281b80){if(_0x281b80){return _0x6f82a5[_0xa3de('0x1a')](_0x50c51d)[_0xa3de('0x1c')](_0x281b80);}};}function respondWithFilteredResult(_0x43d136,_0x3be866){return function(_0x4a4d17){if(_0x4a4d17){var _0xe8aba9=typeof _0x3be866[_0xa3de('0x1d')]===_0xa3de('0x1e')&&typeof _0x3be866[_0xa3de('0x1f')]===_0xa3de('0x1e');var _0x373951=_0x4a4d17['count'];var _0x13c7aa=_0xe8aba9?0x0:_0x3be866[_0xa3de('0x1d')];var _0x3fb473=_0xe8aba9?_0x4a4d17[_0xa3de('0x20')]:_0x3be866[_0xa3de('0x1d')]+_0x3be866[_0xa3de('0x1f')];var _0x1e4e76;if(_0x3fb473>=_0x373951){_0x3fb473=_0x373951;_0x1e4e76=0xc8;}else{_0x1e4e76=0xce;}_0x43d136['status'](_0x1e4e76);return _0x43d136[_0xa3de('0x21')](_0xa3de('0x22'),_0x13c7aa+'-'+_0x3fb473+'/'+_0x373951)[_0xa3de('0x1c')](_0x4a4d17);}return null;};}function patchUpdates(_0x1e228d){return function(_0x309efc){try{jsonpatch[_0xa3de('0x23')](_0x309efc,_0x1e228d,!![]);}catch(_0x4c530e){return BPromise['reject'](_0x4c530e);}return _0x309efc['save']();};}function saveUpdates(_0x2aa033,_0x534444){return function(_0x13b415){if(_0x13b415){return _0x13b415[_0xa3de('0x24')](_0x2aa033)[_0xa3de('0x25')](function(_0x1dc7d4){return _0x1dc7d4;});}return null;};}function removeEntity(_0x49e3e2,_0x2679d5){return function(_0x1998e0){if(_0x1998e0){return _0x1998e0['destroy']()[_0xa3de('0x25')](function(){var _0x5125a7=_0x1998e0[_0xa3de('0x26')]({'plain':!![]});var _0x19c830=_0xa3de('0x27');return db[_0xa3de('0x28')][_0xa3de('0x29')]({'where':{'type':_0x19c830,'resourceId':_0x5125a7['id']}})[_0xa3de('0x25')](function(){return _0x1998e0;});})[_0xa3de('0x25')](function(){_0x49e3e2[_0xa3de('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b1577,_0x43050c){return function(_0x439786){if(!_0x439786){_0x2b1577[_0xa3de('0x19')](0x194);}return _0x439786;};}function handleError(_0x716846,_0x5a0d0f){_0x5a0d0f=_0x5a0d0f||0x1f4;return function(_0x1f2d29){logger['error'](_0x1f2d29[_0xa3de('0x2a')]);if(_0x1f2d29[_0xa3de('0x2b')]){delete _0x1f2d29[_0xa3de('0x2b')];}_0x716846[_0xa3de('0x1a')](_0x5a0d0f)[_0xa3de('0x2c')](_0x1f2d29);};}exports['index']=function(_0x331e90,_0x3e5150){var _0x11bae7={},_0x419e52={},_0x17b6c2={'count':0x0,'rows':[]};var _0x392f7e=_['map'](db['CannedAnswer'][_0xa3de('0x2d')],function(_0x3a74fa){return{'name':_0x3a74fa[_0xa3de('0x2e')],'type':_0x3a74fa[_0xa3de('0x2f')][_0xa3de('0x30')]};});_0x419e52[_0xa3de('0x31')]=_[_0xa3de('0x32')](_0x392f7e,'name');_0x419e52['query']=_[_0xa3de('0x33')](_0x331e90[_0xa3de('0x34')]);_0x419e52[_0xa3de('0x35')]=_[_0xa3de('0x36')](_0x419e52[_0xa3de('0x31')],_0x419e52['query']);_0x11bae7[_0xa3de('0x37')]=_[_0xa3de('0x36')](_0x419e52[_0xa3de('0x31')],qs[_0xa3de('0x38')](_0x331e90[_0xa3de('0x34')][_0xa3de('0x38')]));_0x11bae7['attributes']=_0x11bae7[_0xa3de('0x37')][_0xa3de('0x39')]?_0x11bae7[_0xa3de('0x37')]:_0x419e52[_0xa3de('0x31')];if(!_0x331e90[_0xa3de('0x34')][_0xa3de('0x3a')]('nolimit')){_0x11bae7[_0xa3de('0x1f')]=qs[_0xa3de('0x1f')](_0x331e90[_0xa3de('0x34')]['limit']);_0x11bae7[_0xa3de('0x1d')]=qs['offset'](_0x331e90['query'][_0xa3de('0x1d')]);}_0x11bae7[_0xa3de('0x3b')]=qs[_0xa3de('0x3c')](_0x331e90[_0xa3de('0x34')][_0xa3de('0x3c')]);_0x11bae7[_0xa3de('0x3d')]=qs['filters'](_[_0xa3de('0x3e')](_0x331e90['query'],_0x419e52[_0xa3de('0x35')]),_0x392f7e);if(_0x331e90[_0xa3de('0x34')][_0xa3de('0x3f')]){_0x11bae7[_0xa3de('0x3d')]=_[_0xa3de('0x40')](_0x11bae7[_0xa3de('0x3d')],{'$or':[{'key':{'$like':'%'+_0x331e90['query']['filter']+'%'}},{'value':{'$like':'%'+_0x331e90[_0xa3de('0x34')][_0xa3de('0x3f')]+'%'}}]});}_0x11bae7=_['merge']({},_0x11bae7,_0x331e90[_0xa3de('0x41')]);var _0x5421bc={'where':_0x11bae7[_0xa3de('0x3d')]};return db[_0xa3de('0x42')]['count'](_0x5421bc)['then'](function(_0x1632fe){_0x17b6c2[_0xa3de('0x20')]=_0x1632fe;if(_0x331e90[_0xa3de('0x34')]['includeAll']){_0x11bae7[_0xa3de('0x43')]=[{'all':!![]}];}return db[_0xa3de('0x42')][_0xa3de('0x44')](_0x11bae7);})[_0xa3de('0x25')](function(_0x15b230){_0x17b6c2[_0xa3de('0x45')]=_0x15b230;return _0x17b6c2;})[_0xa3de('0x25')](respondWithFilteredResult(_0x3e5150,_0x11bae7))[_0xa3de('0x46')](handleError(_0x3e5150,null));};exports[_0xa3de('0x47')]=function(_0x57dbd7,_0x4a405c){var _0xe9422a={'raw':!![],'where':{'id':_0x57dbd7[_0xa3de('0x48')]['id']}},_0xc07381={};_0xc07381[_0xa3de('0x31')]=_[_0xa3de('0x33')](db['CannedAnswer'][_0xa3de('0x2d')]);_0xc07381[_0xa3de('0x34')]=_[_0xa3de('0x33')](_0x57dbd7[_0xa3de('0x34')]);_0xc07381['filters']=_['intersection'](_0xc07381[_0xa3de('0x31')],_0xc07381[_0xa3de('0x34')]);_0xe9422a[_0xa3de('0x37')]=_[_0xa3de('0x36')](_0xc07381[_0xa3de('0x31')],qs[_0xa3de('0x38')](_0x57dbd7[_0xa3de('0x34')][_0xa3de('0x38')]));_0xe9422a[_0xa3de('0x37')]=_0xe9422a[_0xa3de('0x37')][_0xa3de('0x39')]?_0xe9422a[_0xa3de('0x37')]:_0xc07381[_0xa3de('0x31')];if(_0x57dbd7['query']['includeAll']){_0xe9422a['include']=[{'all':!![]}];}_0xe9422a=_['merge']({},_0xe9422a,_0x57dbd7[_0xa3de('0x41')]);return db[_0xa3de('0x42')][_0xa3de('0x49')](_0xe9422a)[_0xa3de('0x25')](handleEntityNotFound(_0x4a405c,null))[_0xa3de('0x25')](respondWithResult(_0x4a405c,null))[_0xa3de('0x46')](handleError(_0x4a405c,null));};exports[_0xa3de('0x24')]=function(_0x593299,_0xdccc9e){if(_0x593299['body']['id']){delete _0x593299[_0xa3de('0x4a')]['id'];}return db['CannedAnswer'][_0xa3de('0x49')]({'where':{'id':_0x593299[_0xa3de('0x48')]['id']}})[_0xa3de('0x25')](handleEntityNotFound(_0xdccc9e,null))[_0xa3de('0x25')](saveUpdates(_0x593299[_0xa3de('0x4a')],null))['then'](respondWithResult(_0xdccc9e,null))[_0xa3de('0x46')](handleError(_0xdccc9e,null));};exports[_0xa3de('0x29')]=function(_0x12d966,_0x27d257){return db[_0xa3de('0x42')][_0xa3de('0x49')]({'where':{'id':_0x12d966[_0xa3de('0x48')]['id']}})[_0xa3de('0x25')](handleEntityNotFound(_0x27d257,null))[_0xa3de('0x25')](removeEntity(_0x27d257,null))[_0xa3de('0x46')](handleError(_0x27d257,null));};exports[_0xa3de('0x4b')]=function(_0x2aadfa,_0x305d9f){var _0x5ae001={'key':_0x2aadfa[_0xa3de('0x4a')][_0xa3de('0x30')]};if(_0x2aadfa[_0xa3de('0x4a')][_0xa3de('0x4c')]){_0x5ae001['MailAccountId']=_0x2aadfa[_0xa3de('0x4a')][_0xa3de('0x4c')];}else if(_0x2aadfa[_0xa3de('0x4a')]['SmsAccountId']){_0x5ae001[_0xa3de('0x4d')]=_0x2aadfa[_0xa3de('0x4a')]['SmsAccountId'];}else if(_0x2aadfa[_0xa3de('0x4a')][_0xa3de('0x4e')]){_0x5ae001[_0xa3de('0x4e')]=_0x2aadfa[_0xa3de('0x4a')][_0xa3de('0x4e')];}else if(_0x2aadfa[_0xa3de('0x4a')][_0xa3de('0x4f')]){_0x5ae001[_0xa3de('0x4f')]=_0x2aadfa['body'][_0xa3de('0x4f')];}return db['CannedAnswer']['find']({'where':_0x5ae001})[_0xa3de('0x25')](function(_0x909434){if(_0x909434){throw new db[(_0xa3de('0x50'))][(_0xa3de('0x51'))](_0xa3de('0x52'));}return db['CannedAnswer'][_0xa3de('0x4b')](_0x2aadfa[_0xa3de('0x4a')]);})[_0xa3de('0x25')](function(_0xf61e4d){var _0x4969a1=_0x2aadfa['user']['get']({'plain':!![]});if(!_0x4969a1)throw new Error(_0xa3de('0x53'));if(_0x4969a1['role']===_0xa3de('0x54')){var _0x3e1273=_0xf61e4d['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xa3de('0x27'),'userProfileId':_0x4969a1[_0xa3de('0x55')]},'raw':!![]})['then'](function(_0x2d346c){if(_0x2d346c&&_0x2d346c[_0xa3de('0x56')]===0x0){return db[_0xa3de('0x28')]['create']({'name':_0x3e1273[_0xa3de('0x2b')],'resourceId':_0x3e1273['id'],'type':_0x2d346c[_0xa3de('0x2b')],'sectionId':_0x2d346c['id']},{})[_0xa3de('0x25')](function(){return _0xf61e4d;});}else{return _0xf61e4d;}})[_0xa3de('0x46')](function(_0x27c372){logger[_0xa3de('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27c372);throw _0x27c372;});}return _0xf61e4d;})[_0xa3de('0x25')](respondWithResult(_0x305d9f,0xc9))[_0xa3de('0x46')](handleError(_0x305d9f,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 42d4973..e2e45fa 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 _0x3079=['api','moment','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','define','utf8mb4_unicode_ci','lodash','util'];(function(_0x53467c,_0x5b69eb){var _0x212648=function(_0x43613a){while(--_0x43613a){_0x53467c['push'](_0x53467c['shift']());}};_0x212648(++_0x5b69eb);}(_0x3079,0x112));var _0x9307=function(_0x4ce898,_0x16d932){_0x4ce898=_0x4ce898-0x0;var _0x2d9f21=_0x3079[_0x4ce898];return _0x2d9f21;};'use strict';var _=require(_0x9307('0x0'));var util=require(_0x9307('0x1'));var logger=require('../../config/logger')(_0x9307('0x2'));var moment=require(_0x9307('0x3'));var BPromise=require(_0x9307('0x4'));var rp=require(_0x9307('0x5'));var fs=require('fs');var path=require(_0x9307('0x6'));var rimraf=require('rimraf');var config=require(_0x9307('0x7'));var attributes=require(_0x9307('0x8'));module[_0x9307('0x9')]=function(_0x5b189b,_0x5deffa){return _0x5b189b[_0x9307('0xa')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9307('0xb')});}; \ No newline at end of file +var _0x7653=['api','moment','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0x7653,0x102));var _0x3765=function(_0x6adec3,_0x3d264a){_0x6adec3=_0x6adec3-0x0;var _0xf68ec2=_0x7653[_0x6adec3];return _0xf68ec2;};'use strict';var _=require(_0x3765('0x0'));var util=require(_0x3765('0x1'));var logger=require('../../config/logger')(_0x3765('0x2'));var moment=require(_0x3765('0x3'));var BPromise=require('bluebird');var rp=require(_0x3765('0x4'));var fs=require('fs');var path=require(_0x3765('0x5'));var rimraf=require(_0x3765('0x6'));var config=require('../../config/environment');var attributes=require(_0x3765('0x7'));module[_0x3765('0x8')]=function(_0x627087,_0x35ff41){return _0x627087[_0x3765('0x9')](_0x3765('0xa'),attributes,{'tableName':_0x3765('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3765('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 3fbfcd2..ed7774e 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(_0x3ee8ae,_0x4722e9){var _0x571c6d=function(_0x39150d){while(--_0x39150d){_0x3ee8ae['push'](_0x3ee8ae['shift']());}};_0x571c6d(++_0x4722e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x1bf373,_0x2bf3cf){var _0x3fd90a=function(_0x4b2f6d){while(--_0x4b2f6d){_0x1bf373['push'](_0x1bf373['shift']());}};_0x3fd90a(++_0x2bf3cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 8248dda..bfdc52b 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 _0x1c3b=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x29cc7d,_0xa495a6){var _0x272628=function(_0x189f6a){while(--_0x189f6a){_0x29cc7d['push'](_0x29cc7d['shift']());}};_0x272628(++_0xa495a6);}(_0x1c3b,0xbb));var _0xb1c3=function(_0x426059,_0x3c9e20){_0x426059=_0x426059-0x0;var _0x13903a=_0x1c3b[_0x426059];return _0x13903a;};'use strict';var multer=require(_0xb1c3('0x0'));var util=require('util');var path=require(_0xb1c3('0x1'));var timeout=require(_0xb1c3('0x2'));var express=require(_0xb1c3('0x3'));var router=express[_0xb1c3('0x4')]();var fs_extra=require(_0xb1c3('0x5'));var auth=require(_0xb1c3('0x6'));var interaction=require(_0xb1c3('0x7'));var config=require('../../config/environment');var controller=require(_0xb1c3('0x8'));router[_0xb1c3('0x9')]('/',auth['isAuthenticated'](),controller[_0xb1c3('0xa')]);router['get'](_0xb1c3('0xb'),auth[_0xb1c3('0xc')](),controller[_0xb1c3('0xd')]);router[_0xb1c3('0xe')]('/',auth['isAuthenticated'](),controller[_0xb1c3('0xf')]);router[_0xb1c3('0x10')](_0xb1c3('0xb'),auth[_0xb1c3('0xc')](),controller[_0xb1c3('0x11')]);router[_0xb1c3('0x12')](_0xb1c3('0xb'),auth['isAuthenticated'](),controller[_0xb1c3('0x13')]);module[_0xb1c3('0x14')]=router; \ No newline at end of file +var _0xde07=['get','isAuthenticated','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cannedAnswer.controller'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xde07,0x1b9));var _0x7de0=function(_0x526d2e,_0x23de5b){_0x526d2e=_0x526d2e-0x0;var _0x554567=_0xde07[_0x526d2e];return _0x554567;};'use strict';var multer=require(_0x7de0('0x0'));var util=require(_0x7de0('0x1'));var path=require(_0x7de0('0x2'));var timeout=require(_0x7de0('0x3'));var express=require(_0x7de0('0x4'));var router=express[_0x7de0('0x5')]();var fs_extra=require(_0x7de0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7de0('0x7'));var config=require('../../config/environment');var controller=require(_0x7de0('0x8'));router[_0x7de0('0x9')]('/',auth[_0x7de0('0xa')](),controller['index']);router[_0x7de0('0x9')](_0x7de0('0xb'),auth['isAuthenticated'](),controller[_0x7de0('0xc')]);router[_0x7de0('0xd')]('/',auth['isAuthenticated'](),controller[_0x7de0('0xe')]);router[_0x7de0('0xf')](_0x7de0('0xb'),auth[_0x7de0('0xa')](),controller['update']);router['delete'](_0x7de0('0xb'),auth['isAuthenticated'](),controller[_0x7de0('0x10')]);module[_0x7de0('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index e0b548c..aca2d2a 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 _0xca7b=['STRING','INTEGER','DATE','1970-01-01\x2000:00:01'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca7b,0x14e));var _0xbca7=function(_0x319d7e,_0xacccae){_0x319d7e=_0x319d7e-0x0;var _0x418e62=_0xca7b[_0x319d7e];return _0x418e62;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xbca7('0x0')],'allowNull':![],'defaultValue':_0xbca7('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xbca7('0x2')]},'dst':{'type':Sequelize[_0xbca7('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xbca7('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xbca7('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xbca7('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xbca7('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xbca7('0x2')]},'userfield':{'type':Sequelize[_0xbca7('0x2')]},'uniqueid':{'type':Sequelize[_0xbca7('0x2')]},'linkedid':{'type':Sequelize[_0xbca7('0x2')]},'sequence':{'type':Sequelize[_0xbca7('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbca7('0x2')]},'tag':{'type':Sequelize[_0xbca7('0x2')]}}; \ No newline at end of file +var _0x636f=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x31575f,_0xac0687){var _0x27353d=function(_0x1751cb){while(--_0x1751cb){_0x31575f['push'](_0x31575f['shift']());}};_0x27353d(++_0xac0687);}(_0x636f,0x188));var _0xf636=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x636f[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xf636('0x0')],'allowNull':![],'defaultValue':_0xf636('0x1')},'clid':{'type':Sequelize[_0xf636('0x2')]},'src':{'type':Sequelize[_0xf636('0x2')]},'dst':{'type':Sequelize[_0xf636('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf636('0x2')]},'dstchannel':{'type':Sequelize[_0xf636('0x2')]},'lastapp':{'type':Sequelize[_0xf636('0x2')]},'lastdata':{'type':Sequelize[_0xf636('0x2')]},'duration':{'type':Sequelize[_0xf636('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf636('0x2')]},'amaflags':{'type':Sequelize[_0xf636('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf636('0x2')]},'userfield':{'type':Sequelize[_0xf636('0x2')]},'uniqueid':{'type':Sequelize[_0xf636('0x2')]},'linkedid':{'type':Sequelize[_0xf636('0x2')]},'sequence':{'type':Sequelize[_0xf636('0x2')]},'peeraccount':{'type':Sequelize[_0xf636('0x2')]},'type':{'type':Sequelize[_0xf636('0x2')]},'tag':{'type':Sequelize[_0xf636('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 3d97ae1..88e5e0e 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 _0x8375=['attributes','intersection','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','length','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','save','destroy','then','error','stack','name','send','map','Cdr','fieldName','type','model','query','keys'];(function(_0x77cbc3,_0x3f2d07){var _0x263ee5=function(_0x29207c){while(--_0x29207c){_0x77cbc3['push'](_0x77cbc3['shift']());}};_0x263ee5(++_0x3f2d07);}(_0x8375,0xa8));var _0x5837=function(_0x5297e6,_0x19926d){_0x5297e6=_0x5297e6-0x0;var _0x58df8a=_0x8375[_0x5297e6];return _0x58df8a;};'use strict';var emlformat=require(_0x5837('0x0'));var rimraf=require(_0x5837('0x1'));var zipdir=require(_0x5837('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5837('0x3'));var moment=require(_0x5837('0x4'));var BPromise=require(_0x5837('0x5'));var Mustache=require(_0x5837('0x6'));var util=require(_0x5837('0x7'));var path=require(_0x5837('0x8'));var sox=require('sox');var csv=require(_0x5837('0x9'));var ejs=require(_0x5837('0xa'));var fs=require('fs');var fs_extra=require(_0x5837('0xb'));var _=require(_0x5837('0xc'));var squel=require(_0x5837('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5837('0xe'));var toCsv=require(_0x5837('0x9'));var querystring=require('querystring');var Papa=require(_0x5837('0xf'));var Redis=require('ioredis');var authService=require(_0x5837('0x10'));var qs=require(_0x5837('0x11'));var as=require(_0x5837('0x12'));var hardwareService=require(_0x5837('0x13'));var logger=require(_0x5837('0x14'))(_0x5837('0x15'));var utils=require('../../config/utils');var config=require(_0x5837('0x16'));var licenseUtil=require(_0x5837('0x17'));var db=require(_0x5837('0x18'))['db'];function respondWithStatusCode(_0x10c1a1,_0x143210){_0x143210=_0x143210||0xcc;return function(_0x485366){if(_0x485366){return _0x10c1a1['sendStatus'](_0x143210);}return _0x10c1a1['status'](_0x143210)[_0x5837('0x19')]();};}function respondWithResult(_0x111dbf,_0x469903){_0x469903=_0x469903||0xc8;return function(_0xa5718d){if(_0xa5718d){return _0x111dbf[_0x5837('0x1a')](_0x469903)[_0x5837('0x1b')](_0xa5718d);}};}function respondWithFilteredResult(_0x206f02,_0x754f39){return function(_0x10d882){if(_0x10d882){var _0x59a378=typeof _0x754f39[_0x5837('0x1c')]===_0x5837('0x1d')&&typeof _0x754f39['limit']===_0x5837('0x1d');var _0x2297b4=_0x10d882[_0x5837('0x1e')];var _0x49279d=_0x59a378?0x0:_0x754f39['offset'];var _0x4bee08=_0x59a378?_0x10d882[_0x5837('0x1e')]:_0x754f39[_0x5837('0x1c')]+_0x754f39[_0x5837('0x1f')];var _0x58e7f7;if(_0x4bee08>=_0x2297b4){_0x4bee08=_0x2297b4;_0x58e7f7=0xc8;}else{_0x58e7f7=0xce;}_0x206f02[_0x5837('0x1a')](_0x58e7f7);return _0x206f02[_0x5837('0x20')](_0x5837('0x21'),_0x49279d+'-'+_0x4bee08+'/'+_0x2297b4)[_0x5837('0x1b')](_0x10d882);}return null;};}function patchUpdates(_0x5881ff){return function(_0x4908c2){try{jsonpatch['apply'](_0x4908c2,_0x5881ff,!![]);}catch(_0x3d352f){return BPromise['reject'](_0x3d352f);}return _0x4908c2[_0x5837('0x22')]();};}function saveUpdates(_0x2bd103,_0x32733a){return function(_0x3a7efe){if(_0x3a7efe){return _0x3a7efe['update'](_0x2bd103)['then'](function(_0x1b80db){return _0x1b80db;});}return null;};}function removeEntity(_0x2262b9,_0x406506){return function(_0x5e8089){if(_0x5e8089){return _0x5e8089[_0x5837('0x23')]()[_0x5837('0x24')](function(){_0x2262b9[_0x5837('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41f86a,_0x2646ed){return function(_0x39babd){if(!_0x39babd){_0x41f86a['sendStatus'](0x194);}return _0x39babd;};}function handleError(_0x57baed,_0x1d545c){_0x1d545c=_0x1d545c||0x1f4;return function(_0x15655e){logger[_0x5837('0x25')](_0x15655e[_0x5837('0x26')]);if(_0x15655e[_0x5837('0x27')]){delete _0x15655e[_0x5837('0x27')];}_0x57baed[_0x5837('0x1a')](_0x1d545c)[_0x5837('0x28')](_0x15655e);};}exports['index']=function(_0x2f0c8d,_0x13830f){var _0x3cbd3f={},_0x3918ee={},_0x1c9f32={'count':0x0,'rows':[]};var _0x228f1=_[_0x5837('0x29')](db[_0x5837('0x2a')]['rawAttributes'],function(_0x4f7502){return{'name':_0x4f7502[_0x5837('0x2b')],'type':_0x4f7502[_0x5837('0x2c')]['key']};});_0x3918ee[_0x5837('0x2d')]=_[_0x5837('0x29')](_0x228f1,'name');_0x3918ee[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x2f0c8d[_0x5837('0x2e')]);_0x3918ee['filters']=_['intersection'](_0x3918ee['model'],_0x3918ee[_0x5837('0x2e')]);_0x3cbd3f[_0x5837('0x30')]=_[_0x5837('0x31')](_0x3918ee[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x2f0c8d['query']['fields']));_0x3cbd3f[_0x5837('0x30')]=_0x3cbd3f[_0x5837('0x30')]['length']?_0x3cbd3f['attributes']:_0x3918ee[_0x5837('0x2d')];if(!_0x2f0c8d['query']['hasOwnProperty'](_0x5837('0x33'))){_0x3cbd3f[_0x5837('0x1f')]=qs['limit'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1f')]);_0x3cbd3f[_0x5837('0x1c')]=qs['offset'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1c')]);}_0x3cbd3f[_0x5837('0x34')]=qs[_0x5837('0x35')](_0x2f0c8d[_0x5837('0x2e')]['sort']);_0x3cbd3f[_0x5837('0x36')]=qs['filters'](_['pick'](_0x2f0c8d[_0x5837('0x2e')],_0x3918ee[_0x5837('0x37')]),_0x228f1);if(_0x2f0c8d['query'][_0x5837('0x38')]){_0x3cbd3f[_0x5837('0x36')]=_[_0x5837('0x39')](_0x3cbd3f[_0x5837('0x36')],{'$or':_['map'](_0x228f1,function(_0x2ed688){if(_0x2ed688[_0x5837('0x2c')]!==_0x5837('0x3a')){var _0x5dcd18={};_0x5dcd18[_0x2ed688[_0x5837('0x27')]]={'$like':'%'+_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x38')]+'%'};return _0x5dcd18;}})});}_0x3cbd3f=_[_0x5837('0x39')]({},_0x3cbd3f,_0x2f0c8d[_0x5837('0x3b')]);var _0x76f00d={'where':_0x3cbd3f[_0x5837('0x36')]};return db[_0x5837('0x2a')][_0x5837('0x1e')](_0x76f00d)[_0x5837('0x24')](function(_0x1a5e2d){_0x1c9f32[_0x5837('0x1e')]=_0x1a5e2d;if(_0x2f0c8d['query']['includeAll']){_0x3cbd3f[_0x5837('0x3c')]=[{'all':!![]}];}return db[_0x5837('0x2a')]['findAll'](_0x3cbd3f);})[_0x5837('0x24')](function(_0x1ae168){_0x1c9f32[_0x5837('0x3d')]=_0x1ae168;return _0x1c9f32;})['then'](respondWithFilteredResult(_0x13830f,_0x3cbd3f))[_0x5837('0x3e')](handleError(_0x13830f,null));};exports[_0x5837('0x3f')]=function(_0x1c81ed,_0x3acdf5){var _0x4643e3={'raw':!![],'where':{'id':_0x1c81ed[_0x5837('0x40')]['id']}},_0xd443be={};_0xd443be[_0x5837('0x2d')]=_[_0x5837('0x2f')](db['Cdr'][_0x5837('0x41')]);_0xd443be[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x1c81ed['query']);_0xd443be['filters']=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],_0xd443be[_0x5837('0x2e')]);_0x4643e3[_0x5837('0x30')]=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x1c81ed[_0x5837('0x2e')][_0x5837('0x32')]));_0x4643e3[_0x5837('0x30')]=_0x4643e3[_0x5837('0x30')][_0x5837('0x42')]?_0x4643e3['attributes']:_0xd443be[_0x5837('0x2d')];if(_0x1c81ed['query'][_0x5837('0x43')]){_0x4643e3[_0x5837('0x3c')]=[{'all':!![]}];}_0x4643e3=_['merge']({},_0x4643e3,_0x1c81ed[_0x5837('0x3b')]);return db[_0x5837('0x2a')]['find'](_0x4643e3)[_0x5837('0x24')](handleEntityNotFound(_0x3acdf5,null))[_0x5837('0x24')](respondWithResult(_0x3acdf5,null))[_0x5837('0x3e')](handleError(_0x3acdf5,null));};exports[_0x5837('0x44')]=function(_0x54a23b,_0x55cf2b){return db[_0x5837('0x2a')][_0x5837('0x44')](_0x54a23b['body'],{})['then'](respondWithResult(_0x55cf2b,0xc9))['catch'](handleError(_0x55cf2b,null));};exports['update']=function(_0x38e987,_0x6423f2){if(_0x38e987[_0x5837('0x45')]['id']){delete _0x38e987['body']['id'];}return db['Cdr'][_0x5837('0x46')]({'where':{'id':_0x38e987[_0x5837('0x40')]['id']}})[_0x5837('0x24')](handleEntityNotFound(_0x6423f2,null))[_0x5837('0x24')](saveUpdates(_0x38e987[_0x5837('0x45')],null))[_0x5837('0x24')](respondWithResult(_0x6423f2,null))[_0x5837('0x3e')](handleError(_0x6423f2,null));};exports[_0x5837('0x23')]=function(_0x27f7b9,_0x38743a){return db['Cdr'][_0x5837('0x46')]({'where':{'id':_0x27f7b9[_0x5837('0x40')]['id']}})['then'](handleEntityNotFound(_0x38743a,null))[_0x5837('0x24')](removeEntity(_0x38743a,null))[_0x5837('0x3e')](handleError(_0x38743a,null));};exports[_0x5837('0x47')]=function(_0x397cd9,_0x38e75d){return db['Cdr'][_0x5837('0x47')]()[_0x5837('0x24')](respondWithResult(_0x38e75d,null))[_0x5837('0x3e')](handleError(_0x38e75d,null));}; \ No newline at end of file +var _0x4873=['lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','send','index','rawAttributes','type','key','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','Cdr','catch','show','model','fields','includeAll','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x4873,0x1df));var _0x3487=function(_0x28053c,_0x282867){_0x28053c=_0x28053c-0x0;var _0x481887=_0x4873[_0x28053c];return _0x481887;};'use strict';var emlformat=require(_0x3487('0x0'));var rimraf=require(_0x3487('0x1'));var zipdir=require(_0x3487('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3487('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3487('0x4'));var util=require(_0x3487('0x5'));var path=require(_0x3487('0x6'));var sox=require(_0x3487('0x7'));var csv=require(_0x3487('0x8'));var ejs=require(_0x3487('0x9'));var fs=require('fs');var fs_extra=require(_0x3487('0xa'));var _=require(_0x3487('0xb'));var squel=require('squel');var crypto=require(_0x3487('0xc'));var jsforce=require(_0x3487('0xd'));var deskjs=require(_0x3487('0xe'));var toCsv=require(_0x3487('0x8'));var querystring=require(_0x3487('0xf'));var Papa=require('papaparse');var Redis=require(_0x3487('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3487('0x11'));var as=require(_0x3487('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3487('0x13'));var utils=require(_0x3487('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3487('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x557d64,_0x395774){_0x395774=_0x395774||0xcc;return function(_0x1be2e0){if(_0x1be2e0){return _0x557d64[_0x3487('0x16')](_0x395774);}return _0x557d64[_0x3487('0x17')](_0x395774)[_0x3487('0x18')]();};}function respondWithResult(_0x1e468b,_0x4fbd63){_0x4fbd63=_0x4fbd63||0xc8;return function(_0x23ce3b){if(_0x23ce3b){return _0x1e468b[_0x3487('0x17')](_0x4fbd63)[_0x3487('0x19')](_0x23ce3b);}};}function respondWithFilteredResult(_0x4f79f0,_0x156e80){return function(_0x1b19c4){if(_0x1b19c4){var _0x38c0c1=typeof _0x156e80[_0x3487('0x1a')]===_0x3487('0x1b')&&typeof _0x156e80[_0x3487('0x1c')]===_0x3487('0x1b');var _0x32ecde=_0x1b19c4[_0x3487('0x1d')];var _0x2fa630=_0x38c0c1?0x0:_0x156e80[_0x3487('0x1a')];var _0x41795b=_0x38c0c1?_0x1b19c4[_0x3487('0x1d')]:_0x156e80[_0x3487('0x1a')]+_0x156e80['limit'];var _0x320349;if(_0x41795b>=_0x32ecde){_0x41795b=_0x32ecde;_0x320349=0xc8;}else{_0x320349=0xce;}_0x4f79f0['status'](_0x320349);return _0x4f79f0[_0x3487('0x1e')](_0x3487('0x1f'),_0x2fa630+'-'+_0x41795b+'/'+_0x32ecde)[_0x3487('0x19')](_0x1b19c4);}return null;};}function patchUpdates(_0x29546f){return function(_0xd788f8){try{jsonpatch[_0x3487('0x20')](_0xd788f8,_0x29546f,!![]);}catch(_0x479354){return BPromise[_0x3487('0x21')](_0x479354);}return _0xd788f8[_0x3487('0x22')]();};}function saveUpdates(_0x28f8f7,_0x97013d){return function(_0x11437c){if(_0x11437c){return _0x11437c[_0x3487('0x23')](_0x28f8f7)['then'](function(_0x384792){return _0x384792;});}return null;};}function removeEntity(_0x3e63e8,_0x25ed9f){return function(_0x482551){if(_0x482551){return _0x482551['destroy']()[_0x3487('0x24')](function(){_0x3e63e8[_0x3487('0x17')](0xcc)[_0x3487('0x18')]();});}};}function handleEntityNotFound(_0x3a9d76,_0x4c6882){return function(_0x79a183){if(!_0x79a183){_0x3a9d76[_0x3487('0x16')](0x194);}return _0x79a183;};}function handleError(_0x5484f6,_0x1e7126){_0x1e7126=_0x1e7126||0x1f4;return function(_0x3fb245){logger['error'](_0x3fb245['stack']);if(_0x3fb245[_0x3487('0x25')]){delete _0x3fb245[_0x3487('0x25')];}_0x5484f6[_0x3487('0x17')](_0x1e7126)[_0x3487('0x26')](_0x3fb245);};}exports[_0x3487('0x27')]=function(_0x1a02d6,_0x1c5bd6){var _0x38af4a={},_0x25e123={},_0x4dada9={'count':0x0,'rows':[]};var _0x24532a=_['map'](db['Cdr'][_0x3487('0x28')],function(_0x56ee54){return{'name':_0x56ee54['fieldName'],'type':_0x56ee54[_0x3487('0x29')][_0x3487('0x2a')]};});_0x25e123['model']=_['map'](_0x24532a,_0x3487('0x25'));_0x25e123[_0x3487('0x2b')]=_[_0x3487('0x2c')](_0x1a02d6['query']);_0x25e123[_0x3487('0x2d')]=_['intersection'](_0x25e123['model'],_0x25e123['query']);_0x38af4a[_0x3487('0x2e')]=_[_0x3487('0x2f')](_0x25e123['model'],qs['fields'](_0x1a02d6[_0x3487('0x2b')]['fields']));_0x38af4a['attributes']=_0x38af4a[_0x3487('0x2e')][_0x3487('0x30')]?_0x38af4a[_0x3487('0x2e')]:_0x25e123['model'];if(!_0x1a02d6[_0x3487('0x2b')][_0x3487('0x31')](_0x3487('0x32'))){_0x38af4a[_0x3487('0x1c')]=qs['limit'](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x1c')]);_0x38af4a['offset']=qs[_0x3487('0x1a')](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x1a')]);}_0x38af4a[_0x3487('0x33')]=qs[_0x3487('0x34')](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x34')]);_0x38af4a[_0x3487('0x35')]=qs[_0x3487('0x2d')](_['pick'](_0x1a02d6[_0x3487('0x2b')],_0x25e123[_0x3487('0x2d')]),_0x24532a);if(_0x1a02d6['query']['filter']){_0x38af4a[_0x3487('0x35')]=_[_0x3487('0x36')](_0x38af4a[_0x3487('0x35')],{'$or':_['map'](_0x24532a,function(_0x58006c){if(_0x58006c['type']!==_0x3487('0x37')){var _0x268674={};_0x268674[_0x58006c['name']]={'$like':'%'+_0x1a02d6[_0x3487('0x2b')][_0x3487('0x38')]+'%'};return _0x268674;}})});}_0x38af4a=_[_0x3487('0x36')]({},_0x38af4a,_0x1a02d6[_0x3487('0x39')]);var _0x106393={'where':_0x38af4a[_0x3487('0x35')]};return db[_0x3487('0x3a')][_0x3487('0x1d')](_0x106393)[_0x3487('0x24')](function(_0x565cb2){_0x4dada9[_0x3487('0x1d')]=_0x565cb2;if(_0x1a02d6[_0x3487('0x2b')]['includeAll']){_0x38af4a['include']=[{'all':!![]}];}return db[_0x3487('0x3a')]['findAll'](_0x38af4a);})['then'](function(_0x3eb68c){_0x4dada9['rows']=_0x3eb68c;return _0x4dada9;})['then'](respondWithFilteredResult(_0x1c5bd6,_0x38af4a))[_0x3487('0x3b')](handleError(_0x1c5bd6,null));};exports[_0x3487('0x3c')]=function(_0x58a4c8,_0x51b69c){var _0xc04317={'raw':!![],'where':{'id':_0x58a4c8['params']['id']}},_0x8cd06f={};_0x8cd06f[_0x3487('0x3d')]=_[_0x3487('0x2c')](db['Cdr'][_0x3487('0x28')]);_0x8cd06f[_0x3487('0x2b')]=_[_0x3487('0x2c')](_0x58a4c8['query']);_0x8cd06f[_0x3487('0x2d')]=_[_0x3487('0x2f')](_0x8cd06f[_0x3487('0x3d')],_0x8cd06f[_0x3487('0x2b')]);_0xc04317[_0x3487('0x2e')]=_[_0x3487('0x2f')](_0x8cd06f[_0x3487('0x3d')],qs[_0x3487('0x3e')](_0x58a4c8['query'][_0x3487('0x3e')]));_0xc04317[_0x3487('0x2e')]=_0xc04317[_0x3487('0x2e')][_0x3487('0x30')]?_0xc04317[_0x3487('0x2e')]:_0x8cd06f[_0x3487('0x3d')];if(_0x58a4c8[_0x3487('0x2b')][_0x3487('0x3f')]){_0xc04317['include']=[{'all':!![]}];}_0xc04317=_['merge']({},_0xc04317,_0x58a4c8[_0x3487('0x39')]);return db[_0x3487('0x3a')][_0x3487('0x40')](_0xc04317)[_0x3487('0x24')](handleEntityNotFound(_0x51b69c,null))['then'](respondWithResult(_0x51b69c,null))['catch'](handleError(_0x51b69c,null));};exports[_0x3487('0x41')]=function(_0x122456,_0x3fe91f){return db[_0x3487('0x3a')][_0x3487('0x41')](_0x122456[_0x3487('0x42')],{})[_0x3487('0x24')](respondWithResult(_0x3fe91f,0xc9))[_0x3487('0x3b')](handleError(_0x3fe91f,null));};exports['update']=function(_0x585a44,_0x320351){if(_0x585a44[_0x3487('0x42')]['id']){delete _0x585a44['body']['id'];}return db[_0x3487('0x3a')]['find']({'where':{'id':_0x585a44['params']['id']}})[_0x3487('0x24')](handleEntityNotFound(_0x320351,null))[_0x3487('0x24')](saveUpdates(_0x585a44['body'],null))[_0x3487('0x24')](respondWithResult(_0x320351,null))[_0x3487('0x3b')](handleError(_0x320351,null));};exports[_0x3487('0x43')]=function(_0x4ab5f8,_0x761f95){return db[_0x3487('0x3a')][_0x3487('0x40')]({'where':{'id':_0x4ab5f8[_0x3487('0x44')]['id']}})['then'](handleEntityNotFound(_0x761f95,null))[_0x3487('0x24')](removeEntity(_0x761f95,null))[_0x3487('0x3b')](handleError(_0x761f95,null));};exports[_0x3487('0x45')]=function(_0x33e826,_0x11125d){return db[_0x3487('0x3a')][_0x3487('0x45')]()['then'](respondWithResult(_0x11125d,null))[_0x3487('0x3b')](handleError(_0x11125d,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index e42d032..5fce631 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x530b12,_0x3adbd6){var _0x527f5f=function(_0x1307d9){while(--_0x1307d9){_0x530b12['push'](_0x530b12['shift']());}};_0x527f5f(++_0x3adbd6);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4cf794,_0x182a8a){var _0x289096=function(_0x215fe5){while(--_0x215fe5){_0x4cf794['push'](_0x4cf794['shift']());}};_0x289096(++_0x182a8a);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 2611f32..21abe5e 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 _0x7058=['jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x354bd6,_0x4a7c74){var _0x39bf52=function(_0x585791){while(--_0x585791){_0x354bd6['push'](_0x354bd6['shift']());}};_0x39bf52(++_0x4a7c74);}(_0x7058,0x7c));var _0x8705=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x7058[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var util=require(_0x8705('0x0'));var moment=require('moment');var BPromise=require(_0x8705('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8705('0x2'));var db=require(_0x8705('0x3'))['db'];var utils=require(_0x8705('0x4'));var logger=require(_0x8705('0x5'))(_0x8705('0x6'));var config=require(_0x8705('0x7'));var jayson=require(_0x8705('0x8'));var client=jayson[_0x8705('0x9')][_0x8705('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x294347,_0x5e825e,_0x56f333){return new BPromise(function(_0x3b8bc8,_0x71fc8){return client['request'](_0x294347,_0x56f333)[_0x8705('0xb')](function(_0x40421f){logger[_0x8705('0xc')](_0x8705('0xd'),_0x5e825e,_0x8705('0xe'));logger[_0x8705('0xf')](_0x8705('0x10'),_0x5e825e,_0x8705('0xe'),JSON[_0x8705('0x11')](_0x40421f));if(_0x40421f[_0x8705('0x12')]){if(_0x40421f[_0x8705('0x12')]['code']===0x1f4){logger[_0x8705('0x12')]('Cdr,\x20%s,\x20%s',_0x5e825e,_0x40421f[_0x8705('0x12')]['message']);return _0x71fc8(_0x40421f[_0x8705('0x12')]['message']);}logger[_0x8705('0x12')](_0x8705('0xd'),_0x5e825e,_0x40421f[_0x8705('0x12')][_0x8705('0x13')]);return _0x3b8bc8(_0x40421f[_0x8705('0x12')][_0x8705('0x13')]);}else{logger[_0x8705('0xc')](_0x8705('0xd'),_0x5e825e,'request\x20sent');_0x3b8bc8(_0x40421f[_0x8705('0x14')][_0x8705('0x13')]);}})[_0x8705('0x15')](function(_0x1101c1){logger[_0x8705('0x12')](_0x8705('0xd'),_0x5e825e,_0x1101c1);_0x71fc8(_0x1101c1);});});} \ No newline at end of file +var _0x60a4=['request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x5a0d9f,_0x3c5b09){var _0x333b83=function(_0x17fd88){while(--_0x17fd88){_0x5a0d9f['push'](_0x5a0d9f['shift']());}};_0x333b83(++_0x3c5b09);}(_0x60a4,0x123));var _0x460a=function(_0x393bf5,_0x225cac){_0x393bf5=_0x393bf5-0x0;var _0xcb023=_0x60a4[_0x393bf5];return _0xcb023;};'use strict';var _=require('lodash');var util=require(_0x460a('0x0'));var moment=require('moment');var BPromise=require(_0x460a('0x1'));var rs=require(_0x460a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x460a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x460a('0x4'))(_0x460a('0x5'));var config=require(_0x460a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x460a('0x7')][_0x460a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x669b68,_0x382936,_0x467681){return new BPromise(function(_0x2f097c,_0x7c1d4b){return client[_0x460a('0x9')](_0x669b68,_0x467681)[_0x460a('0xa')](function(_0x4c5212){logger[_0x460a('0xb')](_0x460a('0xc'),_0x382936,'request\x20sent');logger[_0x460a('0xd')](_0x460a('0xe'),_0x382936,_0x460a('0xf'),JSON[_0x460a('0x10')](_0x4c5212));if(_0x4c5212[_0x460a('0x11')]){if(_0x4c5212['error']['code']===0x1f4){logger[_0x460a('0x11')](_0x460a('0xc'),_0x382936,_0x4c5212[_0x460a('0x11')][_0x460a('0x12')]);return _0x7c1d4b(_0x4c5212[_0x460a('0x11')][_0x460a('0x12')]);}logger['error'](_0x460a('0xc'),_0x382936,_0x4c5212[_0x460a('0x11')][_0x460a('0x12')]);return _0x2f097c(_0x4c5212[_0x460a('0x11')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x382936,'request\x20sent');_0x2f097c(_0x4c5212['result'][_0x460a('0x12')]);}})[_0x460a('0x13')](function(_0x3817a7){logger[_0x460a('0x11')](_0x460a('0xc'),_0x382936,_0x3817a7);_0x7c1d4b(_0x3817a7);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index a5e4f89..73a6f90 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0xeee53b,_0x448722){var _0x1067c6=function(_0x40801b){while(--_0x40801b){_0xeee53b['push'](_0xeee53b['shift']());}};_0x1067c6(++_0x448722);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./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 c617eea..6e68da4 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 _0x58a7=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x4b08bd,_0x5e638b){var _0x5270d1=function(_0x3c4ce6){while(--_0x3c4ce6){_0x4b08bd['push'](_0x4b08bd['shift']());}};_0x5270d1(++_0x5e638b);}(_0x58a7,0x7a));var _0x758a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x58a7[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x758a('0x0'));module[_0x758a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x758a('0x2')],'allowNull':![],'defaultValue':_0x758a('0x3')},'appdata':{'type':Sequelize[_0x758a('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x758a('0x5')}}; \ No newline at end of file +var _0xea16=['INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xea16,0x1b7));var _0x6ea1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xea16[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x6ea1('0x0'));module['exports']={'priority':{'type':Sequelize[_0x6ea1('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6ea1('0x2')],'allowNull':![],'defaultValue':_0x6ea1('0x3')},'appdata':{'type':Sequelize[_0x6ea1('0x4')]()},'description':{'type':Sequelize[_0x6ea1('0x2')]},'interval':{'type':Sequelize[_0x6ea1('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 88635eb..4e0df0f 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 _0xfb71=['sendStatus','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','intersection','query','attributes','fields','length','includeAll','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','limit','count','status','set','reject','update','then','destroy'];(function(_0x508ea4,_0x366cab){var _0x253bd0=function(_0x31ef43){while(--_0x31ef43){_0x508ea4['push'](_0x508ea4['shift']());}};_0x253bd0(++_0x366cab);}(_0xfb71,0x1ef));var _0x1fb7=function(_0x251dcb,_0x3cc3ba){_0x251dcb=_0x251dcb-0x0;var _0x3b7b18=_0xfb71[_0x251dcb];return _0x3b7b18;};'use strict';var emlformat=require(_0x1fb7('0x0'));var rimraf=require(_0x1fb7('0x1'));var zipdir=require(_0x1fb7('0x2'));var jsonpatch=require(_0x1fb7('0x3'));var rp=require(_0x1fb7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1fb7('0x5'));var util=require(_0x1fb7('0x6'));var path=require(_0x1fb7('0x7'));var sox=require('sox');var csv=require(_0x1fb7('0x8'));var ejs=require(_0x1fb7('0x9'));var fs=require('fs');var fs_extra=require(_0x1fb7('0xa'));var _=require(_0x1fb7('0xb'));var squel=require(_0x1fb7('0xc'));var crypto=require(_0x1fb7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1fb7('0xe'));var toCsv=require(_0x1fb7('0x8'));var querystring=require('querystring');var Papa=require(_0x1fb7('0xf'));var Redis=require(_0x1fb7('0x10'));var authService=require(_0x1fb7('0x11'));var qs=require(_0x1fb7('0x12'));var as=require(_0x1fb7('0x13'));var hardwareService=require(_0x1fb7('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1fb7('0x15'));var config=require(_0x1fb7('0x16'));var licenseUtil=require(_0x1fb7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49ac10,_0x195eb2){_0x195eb2=_0x195eb2||0xcc;return function(_0x3cc07d){if(_0x3cc07d){return _0x49ac10['sendStatus'](_0x195eb2);}return _0x49ac10['status'](_0x195eb2)[_0x1fb7('0x18')]();};}function respondWithResult(_0x508475,_0x5117a1){_0x5117a1=_0x5117a1||0xc8;return function(_0x1b333b){if(_0x1b333b){return _0x508475['status'](_0x5117a1)[_0x1fb7('0x19')](_0x1b333b);}};}function respondWithFilteredResult(_0x34b6c0,_0x3245cf){return function(_0x5a010a){if(_0x5a010a){var _0xf4c50f=typeof _0x3245cf[_0x1fb7('0x1a')]===_0x1fb7('0x1b')&&typeof _0x3245cf[_0x1fb7('0x1c')]===_0x1fb7('0x1b');var _0x57387e=_0x5a010a[_0x1fb7('0x1d')];var _0x17de9d=_0xf4c50f?0x0:_0x3245cf[_0x1fb7('0x1a')];var _0x5e34c8=_0xf4c50f?_0x5a010a['count']:_0x3245cf[_0x1fb7('0x1a')]+_0x3245cf[_0x1fb7('0x1c')];var _0x1c4b31;if(_0x5e34c8>=_0x57387e){_0x5e34c8=_0x57387e;_0x1c4b31=0xc8;}else{_0x1c4b31=0xce;}_0x34b6c0[_0x1fb7('0x1e')](_0x1c4b31);return _0x34b6c0[_0x1fb7('0x1f')]('Content-Range',_0x17de9d+'-'+_0x5e34c8+'/'+_0x57387e)['json'](_0x5a010a);}return null;};}function patchUpdates(_0x4124d2){return function(_0x28ad2b){try{jsonpatch['apply'](_0x28ad2b,_0x4124d2,!![]);}catch(_0x3a90fe){return BPromise[_0x1fb7('0x20')](_0x3a90fe);}return _0x28ad2b['save']();};}function saveUpdates(_0x5792d1,_0x3c47be){return function(_0x294e2b){if(_0x294e2b){return _0x294e2b[_0x1fb7('0x21')](_0x5792d1)[_0x1fb7('0x22')](function(_0x10c424){return _0x10c424;});}return null;};}function removeEntity(_0xf41888,_0x350384){return function(_0x525149){if(_0x525149){return _0x525149[_0x1fb7('0x23')]()[_0x1fb7('0x22')](function(){_0xf41888['status'](0xcc)[_0x1fb7('0x18')]();});}};}function handleEntityNotFound(_0x4919a5,_0x4eee37){return function(_0xe7d132){if(!_0xe7d132){_0x4919a5[_0x1fb7('0x24')](0x194);}return _0xe7d132;};}function handleError(_0x2be17f,_0x5c1800){_0x5c1800=_0x5c1800||0x1f4;return function(_0x3695b6){logger[_0x1fb7('0x25')](_0x3695b6[_0x1fb7('0x26')]);if(_0x3695b6[_0x1fb7('0x27')]){delete _0x3695b6[_0x1fb7('0x27')];}_0x2be17f[_0x1fb7('0x1e')](_0x5c1800)[_0x1fb7('0x28')](_0x3695b6);};}exports[_0x1fb7('0x29')]=function(_0x39bb74,_0x24c1d2){var _0x57bba8={'raw':!![],'where':{'id':_0x39bb74[_0x1fb7('0x2a')]['id']}},_0x1513ef={};_0x1513ef[_0x1fb7('0x2b')]=_[_0x1fb7('0x2c')](db[_0x1fb7('0x2d')][_0x1fb7('0x2e')]);_0x1513ef['query']=_[_0x1fb7('0x2c')](_0x39bb74['query']);_0x1513ef['filters']=_[_0x1fb7('0x2f')](_0x1513ef[_0x1fb7('0x2b')],_0x1513ef[_0x1fb7('0x30')]);_0x57bba8[_0x1fb7('0x31')]=_['intersection'](_0x1513ef[_0x1fb7('0x2b')],qs[_0x1fb7('0x32')](_0x39bb74['query'][_0x1fb7('0x32')]));_0x57bba8[_0x1fb7('0x31')]=_0x57bba8[_0x1fb7('0x31')][_0x1fb7('0x33')]?_0x57bba8['attributes']:_0x1513ef[_0x1fb7('0x2b')];if(_0x39bb74[_0x1fb7('0x30')][_0x1fb7('0x34')]){_0x57bba8[_0x1fb7('0x35')]=[{'all':!![]}];}_0x57bba8=_[_0x1fb7('0x36')]({},_0x57bba8,_0x39bb74[_0x1fb7('0x37')]);return db[_0x1fb7('0x2d')][_0x1fb7('0x38')](_0x57bba8)['then'](handleEntityNotFound(_0x24c1d2,null))['then'](respondWithResult(_0x24c1d2,null))[_0x1fb7('0x39')](handleError(_0x24c1d2,null));};exports[_0x1fb7('0x21')]=function(_0x45b4e6,_0x2d5123){if(_0x45b4e6[_0x1fb7('0x3a')]['id']){delete _0x45b4e6[_0x1fb7('0x3a')]['id'];}return db[_0x1fb7('0x2d')][_0x1fb7('0x38')]({'where':{'id':_0x45b4e6[_0x1fb7('0x2a')]['id']}})[_0x1fb7('0x22')](handleEntityNotFound(_0x2d5123,null))[_0x1fb7('0x22')](saveUpdates(_0x45b4e6[_0x1fb7('0x3a')],null))[_0x1fb7('0x22')](respondWithResult(_0x2d5123,null))[_0x1fb7('0x39')](handleError(_0x2d5123,null));};exports[_0x1fb7('0x23')]=function(_0x592ed7,_0x6f2c46){return db[_0x1fb7('0x2d')][_0x1fb7('0x38')]({'where':{'id':_0x592ed7[_0x1fb7('0x2a')]['id']}})['then'](handleEntityNotFound(_0x6f2c46,null))[_0x1fb7('0x22')](removeEntity(_0x6f2c46,null))['catch'](handleError(_0x6f2c46,null));}; \ No newline at end of file +var _0xd136=['undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','show','params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset'];(function(_0x5ba549,_0x425afd){var _0x36e3a1=function(_0x464308){while(--_0x464308){_0x5ba549['push'](_0x5ba549['shift']());}};_0x36e3a1(++_0x425afd);}(_0xd136,0x94));var _0x6d13=function(_0x50d143,_0xd62c6){_0x50d143=_0x50d143-0x0;var _0x5ce60d=_0xd136[_0x50d143];return _0x5ce60d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d13('0x0'));var zipdir=require(_0x6d13('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d13('0x2'));var moment=require(_0x6d13('0x3'));var BPromise=require(_0x6d13('0x4'));var Mustache=require(_0x6d13('0x5'));var util=require(_0x6d13('0x6'));var path=require(_0x6d13('0x7'));var sox=require(_0x6d13('0x8'));var csv=require(_0x6d13('0x9'));var ejs=require(_0x6d13('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d13('0xb'));var squel=require(_0x6d13('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6d13('0xd'));var toCsv=require(_0x6d13('0x9'));var querystring=require(_0x6d13('0xe'));var Papa=require(_0x6d13('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6d13('0x10'));var as=require(_0x6d13('0x11'));var hardwareService=require(_0x6d13('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x6d13('0x13'));var config=require(_0x6d13('0x14'));var licenseUtil=require(_0x6d13('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b4cc3,_0x5ef7e6){_0x5ef7e6=_0x5ef7e6||0xcc;return function(_0x37d3c1){if(_0x37d3c1){return _0x1b4cc3[_0x6d13('0x16')](_0x5ef7e6);}return _0x1b4cc3['status'](_0x5ef7e6)['end']();};}function respondWithResult(_0x4ca95d,_0x37efd8){_0x37efd8=_0x37efd8||0xc8;return function(_0x10709d){if(_0x10709d){return _0x4ca95d[_0x6d13('0x17')](_0x37efd8)[_0x6d13('0x18')](_0x10709d);}};}function respondWithFilteredResult(_0x2f4c2b,_0x4f1bdf){return function(_0xf27049){if(_0xf27049){var _0x405368=typeof _0x4f1bdf[_0x6d13('0x19')]===_0x6d13('0x1a')&&typeof _0x4f1bdf[_0x6d13('0x1b')]===_0x6d13('0x1a');var _0xb17857=_0xf27049[_0x6d13('0x1c')];var _0xc6c2b=_0x405368?0x0:_0x4f1bdf['offset'];var _0x276fdd=_0x405368?_0xf27049[_0x6d13('0x1c')]:_0x4f1bdf[_0x6d13('0x19')]+_0x4f1bdf[_0x6d13('0x1b')];var _0x1f3603;if(_0x276fdd>=_0xb17857){_0x276fdd=_0xb17857;_0x1f3603=0xc8;}else{_0x1f3603=0xce;}_0x2f4c2b[_0x6d13('0x17')](_0x1f3603);return _0x2f4c2b[_0x6d13('0x1d')](_0x6d13('0x1e'),_0xc6c2b+'-'+_0x276fdd+'/'+_0xb17857)[_0x6d13('0x18')](_0xf27049);}return null;};}function patchUpdates(_0x427bb8){return function(_0x40f629){try{jsonpatch[_0x6d13('0x1f')](_0x40f629,_0x427bb8,!![]);}catch(_0x18889d){return BPromise[_0x6d13('0x20')](_0x18889d);}return _0x40f629[_0x6d13('0x21')]();};}function saveUpdates(_0x208876,_0x5619fc){return function(_0x387de2){if(_0x387de2){return _0x387de2['update'](_0x208876)[_0x6d13('0x22')](function(_0x204438){return _0x204438;});}return null;};}function removeEntity(_0x151aa4,_0x5bbc9d){return function(_0x1b0f94){if(_0x1b0f94){return _0x1b0f94[_0x6d13('0x23')]()[_0x6d13('0x22')](function(){_0x151aa4[_0x6d13('0x17')](0xcc)[_0x6d13('0x24')]();});}};}function handleEntityNotFound(_0x361432,_0x66e464){return function(_0x821eea){if(!_0x821eea){_0x361432['sendStatus'](0x194);}return _0x821eea;};}function handleError(_0xacf472,_0x4f70e2){_0x4f70e2=_0x4f70e2||0x1f4;return function(_0x4c8526){logger[_0x6d13('0x25')](_0x4c8526['stack']);if(_0x4c8526[_0x6d13('0x26')]){delete _0x4c8526[_0x6d13('0x26')];}_0xacf472[_0x6d13('0x17')](_0x4f70e2)['send'](_0x4c8526);};}exports[_0x6d13('0x27')]=function(_0xd469b6,_0x573080){var _0x2fcdfd={'raw':!![],'where':{'id':_0xd469b6[_0x6d13('0x28')]['id']}},_0x1eda96={};_0x1eda96[_0x6d13('0x29')]=_[_0x6d13('0x2a')](db[_0x6d13('0x2b')][_0x6d13('0x2c')]);_0x1eda96[_0x6d13('0x2d')]=_['keys'](_0xd469b6[_0x6d13('0x2d')]);_0x1eda96[_0x6d13('0x2e')]=_['intersection'](_0x1eda96[_0x6d13('0x29')],_0x1eda96[_0x6d13('0x2d')]);_0x2fcdfd[_0x6d13('0x2f')]=_['intersection'](_0x1eda96[_0x6d13('0x29')],qs[_0x6d13('0x30')](_0xd469b6[_0x6d13('0x2d')][_0x6d13('0x30')]));_0x2fcdfd[_0x6d13('0x2f')]=_0x2fcdfd[_0x6d13('0x2f')][_0x6d13('0x31')]?_0x2fcdfd['attributes']:_0x1eda96[_0x6d13('0x29')];if(_0xd469b6['query'][_0x6d13('0x32')]){_0x2fcdfd[_0x6d13('0x33')]=[{'all':!![]}];}_0x2fcdfd=_[_0x6d13('0x34')]({},_0x2fcdfd,_0xd469b6[_0x6d13('0x35')]);return db[_0x6d13('0x2b')][_0x6d13('0x36')](_0x2fcdfd)['then'](handleEntityNotFound(_0x573080,null))['then'](respondWithResult(_0x573080,null))[_0x6d13('0x37')](handleError(_0x573080,null));};exports[_0x6d13('0x38')]=function(_0xa922ff,_0x29aa5a){if(_0xa922ff[_0x6d13('0x39')]['id']){delete _0xa922ff[_0x6d13('0x39')]['id'];}return db['ChatApplication'][_0x6d13('0x36')]({'where':{'id':_0xa922ff[_0x6d13('0x28')]['id']}})[_0x6d13('0x22')](handleEntityNotFound(_0x29aa5a,null))[_0x6d13('0x22')](saveUpdates(_0xa922ff[_0x6d13('0x39')],null))[_0x6d13('0x22')](respondWithResult(_0x29aa5a,null))[_0x6d13('0x37')](handleError(_0x29aa5a,null));};exports[_0x6d13('0x23')]=function(_0x3cdff2,_0x3bffe6){return db['ChatApplication']['find']({'where':{'id':_0x3cdff2[_0x6d13('0x28')]['id']}})['then'](handleEntityNotFound(_0x3bffe6,null))['then'](removeEntity(_0x3bffe6,null))[_0x6d13('0x37')](handleError(_0x3bffe6,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9e91cfa..2a6bf0f 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 _0xb9ee=['rimraf','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x15867a,_0x46dc79){var _0x29b70f=function(_0x13721c){while(--_0x13721c){_0x15867a['push'](_0x15867a['shift']());}};_0x29b70f(++_0x46dc79);}(_0xb9ee,0x12d));var _0xeb9e=function(_0x4513df,_0x389801){_0x4513df=_0x4513df-0x0;var _0x1c8eae=_0xb9ee[_0x4513df];return _0x1c8eae;};'use strict';var _=require(_0xeb9e('0x0'));var util=require(_0xeb9e('0x1'));var logger=require(_0xeb9e('0x2'))('api');var moment=require(_0xeb9e('0x3'));var BPromise=require(_0xeb9e('0x4'));var rp=require(_0xeb9e('0x5'));var fs=require('fs');var path=require(_0xeb9e('0x6'));var rimraf=require(_0xeb9e('0x7'));var config=require('../../config/environment');var attributes=require(_0xeb9e('0x8'));module[_0xeb9e('0x9')]=function(_0x43daa8,_0x5b35fe){return _0x43daa8[_0xeb9e('0xa')](_0xeb9e('0xb'),attributes,{'tableName':_0xeb9e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xeb9e('0xd')});}; \ No newline at end of file +var _0xba47=['path','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x35e683,_0x128119){var _0x580795=function(_0x1facd4){while(--_0x1facd4){_0x35e683['push'](_0x35e683['shift']());}};_0x580795(++_0x128119);}(_0xba47,0x1ac));var _0x7ba4=function(_0x2aa795,_0x2652df){_0x2aa795=_0x2aa795-0x0;var _0x5bf515=_0xba47[_0x2aa795];return _0x5bf515;};'use strict';var _=require(_0x7ba4('0x0'));var util=require(_0x7ba4('0x1'));var logger=require(_0x7ba4('0x2'))('api');var moment=require(_0x7ba4('0x3'));var BPromise=require(_0x7ba4('0x4'));var rp=require(_0x7ba4('0x5'));var fs=require('fs');var path=require(_0x7ba4('0x6'));var rimraf=require('rimraf');var config=require(_0x7ba4('0x7'));var attributes=require(_0x7ba4('0x8'));module['exports']=function(_0x4f8c2d,_0x565107){return _0x4f8c2d[_0x7ba4('0x9')](_0x7ba4('0xa'),attributes,{'tableName':_0x7ba4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7ba4('0xc'),'collate':_0x7ba4('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 5970daa..027c0ea 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 _0xaae7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x55cf52,_0x2cf5c8){var _0x3a56de=function(_0x8ee79d){while(--_0x8ee79d){_0x55cf52['push'](_0x55cf52['shift']());}};_0x3a56de(++_0x2cf5c8);}(_0xaae7,0x93));var _0x7aae=function(_0x28bfd3,_0x5204df){_0x28bfd3=_0x28bfd3-0x0;var _0xa55a32=_0xaae7[_0x28bfd3];return _0xa55a32;};'use strict';var _=require(_0x7aae('0x0'));var util=require(_0x7aae('0x1'));var moment=require(_0x7aae('0x2'));var BPromise=require(_0x7aae('0x3'));var rs=require(_0x7aae('0x4'));var fs=require('fs');var Redis=require(_0x7aae('0x5'));var db=require(_0x7aae('0x6'))['db'];var utils=require(_0x7aae('0x7'));var logger=require(_0x7aae('0x8'))(_0x7aae('0x9'));var config=require(_0x7aae('0xa'));var jayson=require(_0x7aae('0xb'));var client=jayson['client'][_0x7aae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2fa309,_0x4e594a,_0x6e1c17){return new BPromise(function(_0x3183da,_0x4cb576){return client[_0x7aae('0xd')](_0x2fa309,_0x6e1c17)['then'](function(_0x1ca7c5){logger['info'](_0x7aae('0xe'),_0x4e594a,'request\x20sent');logger[_0x7aae('0xf')](_0x7aae('0x10'),_0x4e594a,_0x7aae('0x11'),JSON[_0x7aae('0x12')](_0x1ca7c5));if(_0x1ca7c5['error']){if(_0x1ca7c5[_0x7aae('0x13')][_0x7aae('0x14')]===0x1f4){logger[_0x7aae('0x13')](_0x7aae('0xe'),_0x4e594a,_0x1ca7c5['error'][_0x7aae('0x15')]);return _0x4cb576(_0x1ca7c5[_0x7aae('0x13')][_0x7aae('0x15')]);}logger[_0x7aae('0x13')](_0x7aae('0xe'),_0x4e594a,_0x1ca7c5[_0x7aae('0x13')][_0x7aae('0x15')]);return _0x3183da(_0x1ca7c5['error'][_0x7aae('0x15')]);}else{logger[_0x7aae('0x16')]('ChatApplication,\x20%s,\x20%s',_0x4e594a,_0x7aae('0x11'));_0x3183da(_0x1ca7c5[_0x7aae('0x17')]['message']);}})[_0x7aae('0x18')](function(_0x186676){logger[_0x7aae('0x13')](_0x7aae('0xe'),_0x4e594a,_0x186676);_0x4cb576(_0x186676);});});} \ No newline at end of file +var _0xb5e0=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch'];(function(_0xfa98fb,_0x2cebf6){var _0x1e6a1b=function(_0x114610){while(--_0x114610){_0xfa98fb['push'](_0xfa98fb['shift']());}};_0x1e6a1b(++_0x2cebf6);}(_0xb5e0,0x1e3));var _0x0b5e=function(_0x16f20e,_0x321898){_0x16f20e=_0x16f20e-0x0;var _0x32d8c0=_0xb5e0[_0x16f20e];return _0x32d8c0;};'use strict';var _=require(_0x0b5e('0x0'));var util=require(_0x0b5e('0x1'));var moment=require(_0x0b5e('0x2'));var BPromise=require(_0x0b5e('0x3'));var rs=require(_0x0b5e('0x4'));var fs=require('fs');var Redis=require(_0x0b5e('0x5'));var db=require(_0x0b5e('0x6'))['db'];var utils=require(_0x0b5e('0x7'));var logger=require(_0x0b5e('0x8'))(_0x0b5e('0x9'));var config=require(_0x0b5e('0xa'));var jayson=require(_0x0b5e('0xb'));var client=jayson['client'][_0x0b5e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2d1d,_0x57794b,_0x424baa){return new BPromise(function(_0x480566,_0x1d5a11){return client[_0x0b5e('0xd')](_0x3e2d1d,_0x424baa)[_0x0b5e('0xe')](function(_0x572871){logger['info'](_0x0b5e('0xf'),_0x57794b,'request\x20sent');logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x57794b,_0x0b5e('0x10'),JSON[_0x0b5e('0x11')](_0x572871));if(_0x572871['error']){if(_0x572871[_0x0b5e('0x12')]['code']===0x1f4){logger[_0x0b5e('0x12')](_0x0b5e('0xf'),_0x57794b,_0x572871['error'][_0x0b5e('0x13')]);return _0x1d5a11(_0x572871[_0x0b5e('0x12')][_0x0b5e('0x13')]);}logger[_0x0b5e('0x12')](_0x0b5e('0xf'),_0x57794b,_0x572871[_0x0b5e('0x12')][_0x0b5e('0x13')]);return _0x480566(_0x572871[_0x0b5e('0x12')][_0x0b5e('0x13')]);}else{logger[_0x0b5e('0x14')](_0x0b5e('0xf'),_0x57794b,'request\x20sent');_0x480566(_0x572871[_0x0b5e('0x15')]['message']);}})[_0x0b5e('0x16')](function(_0x59e8cb){logger[_0x0b5e('0x12')](_0x0b5e('0xf'),_0x57794b,_0x59e8cb);_0x1d5a11(_0x59e8cb);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 8ff0c01..af24237 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 _0x8422=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports'];(function(_0x1af0ea,_0x2bc63c){var _0x467c00=function(_0x161239){while(--_0x161239){_0x1af0ea['push'](_0x1af0ea['shift']());}};_0x467c00(++_0x2bc63c);}(_0x8422,0x132));var _0x2842=function(_0x27530d,_0x46480a){_0x27530d=_0x27530d-0x0;var _0x59e561=_0x8422[_0x27530d];return _0x59e561;};'use strict';var multer=require(_0x2842('0x0'));var util=require(_0x2842('0x1'));var path=require(_0x2842('0x2'));var timeout=require(_0x2842('0x3'));var express=require(_0x2842('0x4'));var router=express[_0x2842('0x5')]();var fs_extra=require(_0x2842('0x6'));var auth=require(_0x2842('0x7'));var interaction=require(_0x2842('0x8'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x2842('0x9')]('/:id',auth[_0x2842('0xa')](),controller[_0x2842('0xb')]);router[_0x2842('0xc')](_0x2842('0xd'),auth['isAuthenticated'](),controller[_0x2842('0xe')]);router[_0x2842('0xf')](_0x2842('0xd'),auth[_0x2842('0xa')](),controller[_0x2842('0x10')]);module[_0x2842('0x11')]=router; \ No newline at end of file +var _0x6ac1=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','put'];(function(_0x101a17,_0x5d047a){var _0x3b76ee=function(_0x89be1b){while(--_0x89be1b){_0x101a17['push'](_0x101a17['shift']());}};_0x3b76ee(++_0x5d047a);}(_0x6ac1,0x7a));var _0x16ac=function(_0x24563c,_0x49d7cd){_0x24563c=_0x24563c-0x0;var _0x14796e=_0x6ac1[_0x24563c];return _0x14796e;};'use strict';var multer=require(_0x16ac('0x0'));var util=require(_0x16ac('0x1'));var path=require(_0x16ac('0x2'));var timeout=require(_0x16ac('0x3'));var express=require(_0x16ac('0x4'));var router=express[_0x16ac('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x16ac('0x6'));var interaction=require(_0x16ac('0x7'));var config=require('../../config/environment');var controller=require(_0x16ac('0x8'));router[_0x16ac('0x9')](_0x16ac('0xa'),auth[_0x16ac('0xb')](),controller['show']);router[_0x16ac('0xc')](_0x16ac('0xa'),auth[_0x16ac('0xb')](),controller['update']);router[_0x16ac('0xd')](_0x16ac('0xa'),auth[_0x16ac('0xb')](),controller['destroy']);module[_0x16ac('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index dc6bcfb..1ad56bc 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 _0x995a=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2f2020,_0xab1788){var _0x11b320=function(_0x3bc9e1){while(--_0x3bc9e1){_0x2f2020['push'](_0x2f2020['shift']());}};_0x11b320(++_0xab1788);}(_0x995a,0xa0));var _0xa995=function(_0x28a7bf,_0x50bb05){_0x28a7bf=_0x28a7bf-0x0;var _0x1dd11d=_0x995a[_0x28a7bf];return _0x1dd11d;};'use strict';var Sequelize=require(_0xa995('0x0'));module[_0xa995('0x1')]={'name':{'type':Sequelize[_0xa995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa995('0x2')]},'write':{'type':Sequelize[_0xa995('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe9e5=['sequelize','exports','STRING','BOOLEAN'];(function(_0x810e4d,_0x909ef4){var _0x13f01c=function(_0x12fd89){while(--_0x12fd89){_0x810e4d['push'](_0x810e4d['shift']());}};_0x13f01c(++_0x909ef4);}(_0xe9e5,0x138));var _0x5e9e=function(_0xca2652,_0x1042e3){_0xca2652=_0xca2652-0x0;var _0x4eef3f=_0xe9e5[_0xca2652];return _0x4eef3f;};'use strict';var Sequelize=require(_0x5e9e('0x0'));module[_0x5e9e('0x1')]={'name':{'type':Sequelize[_0x5e9e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5e9e('0x2')]},'write':{'type':Sequelize[_0x5e9e('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 2530cf7..65ee8ae 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 _0x2812=['ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','ChatGroup','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','params','rawAttributes','keys','length','includeAll','create','body','find','destroy','describe','getUnread','ChatInternalMessage','addMembers','User','options','getMembers','hasOwnProperty','removeMembers','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','fast-json-patch','request-promise','moment','bluebird','path','to-csv'];(function(_0x2033c3,_0x42701a){var _0x39cb87=function(_0x2cefa2){while(--_0x2cefa2){_0x2033c3['push'](_0x2033c3['shift']());}};_0x39cb87(++_0x42701a);}(_0x2812,0x111));var _0x2281=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0x2812[_0xcfc44];return _0x307a25;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2281('0x0'));var rp=require(_0x2281('0x1'));var moment=require(_0x2281('0x2'));var BPromise=require(_0x2281('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2281('0x4'));var sox=require('sox');var csv=require(_0x2281('0x5'));var ejs=require(_0x2281('0x6'));var fs=require('fs');var fs_extra=require(_0x2281('0x7'));var _=require(_0x2281('0x8'));var squel=require(_0x2281('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2281('0xa'));var toCsv=require(_0x2281('0x5'));var querystring=require('querystring');var Papa=require(_0x2281('0xb'));var Redis=require(_0x2281('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x2281('0xd'));var as=require(_0x2281('0xe'));var hardwareService=require(_0x2281('0xf'));var logger=require(_0x2281('0x10'))(_0x2281('0x11'));var utils=require(_0x2281('0x12'));var config=require(_0x2281('0x13'));var licenseUtil=require(_0x2281('0x14'));var db=require(_0x2281('0x15'))['db'];config[_0x2281('0x16')]=_[_0x2281('0x17')](config['redis'],{'host':_0x2281('0x18'),'port':0x18eb});var socket=require(_0x2281('0x19'))(new Redis(config[_0x2281('0x16')]));require(_0x2281('0x1a'))['register'](socket);function respondWithStatusCode(_0xa9c331,_0x254bb1){_0x254bb1=_0x254bb1||0xcc;return function(_0x49f610){if(_0x49f610){return _0xa9c331[_0x2281('0x1b')](_0x254bb1);}return _0xa9c331[_0x2281('0x1c')](_0x254bb1)[_0x2281('0x1d')]();};}function respondWithResult(_0x1c5673,_0x320e56){_0x320e56=_0x320e56||0xc8;return function(_0x56a2be){if(_0x56a2be){return _0x1c5673['status'](_0x320e56)[_0x2281('0x1e')](_0x56a2be);}};}function respondWithFilteredResult(_0x4316b1,_0x2ceaad){return function(_0x3ff21f){if(_0x3ff21f){var _0xec6c83=typeof _0x2ceaad[_0x2281('0x1f')]===_0x2281('0x20')&&typeof _0x2ceaad[_0x2281('0x21')]==='undefined';var _0x418bd9=_0x3ff21f[_0x2281('0x22')];var _0x4e60d3=_0xec6c83?0x0:_0x2ceaad['offset'];var _0x4b8a12=_0xec6c83?_0x3ff21f[_0x2281('0x22')]:_0x2ceaad['offset']+_0x2ceaad[_0x2281('0x21')];var _0xc814a6;if(_0x4b8a12>=_0x418bd9){_0x4b8a12=_0x418bd9;_0xc814a6=0xc8;}else{_0xc814a6=0xce;}_0x4316b1[_0x2281('0x1c')](_0xc814a6);return _0x4316b1[_0x2281('0x23')](_0x2281('0x24'),_0x4e60d3+'-'+_0x4b8a12+'/'+_0x418bd9)['json'](_0x3ff21f);}return null;};}function patchUpdates(_0x3c24fe){return function(_0x3efa32){try{jsonpatch[_0x2281('0x25')](_0x3efa32,_0x3c24fe,!![]);}catch(_0x328ae8){return BPromise[_0x2281('0x26')](_0x328ae8);}return _0x3efa32[_0x2281('0x27')]();};}function saveUpdates(_0x29d64a,_0xa90ce2){return function(_0x47862a){if(_0x47862a){return _0x47862a[_0x2281('0x28')](_0x29d64a)[_0x2281('0x29')](function(_0x38f6f0){return _0x38f6f0;});}return null;};}function removeEntity(_0x44f269,_0x21cb34){return function(_0x2006d8){if(_0x2006d8){return _0x2006d8['destroy']()[_0x2281('0x29')](function(){_0x44f269['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x122319,_0x4bb2a6){return function(_0x3362a6){if(!_0x3362a6){_0x122319['sendStatus'](0x194);}return _0x3362a6;};}function handleError(_0x527e1d,_0x1fddcf){_0x1fddcf=_0x1fddcf||0x1f4;return function(_0x560523){logger[_0x2281('0x2a')](_0x560523[_0x2281('0x2b')]);if(_0x560523['name']){delete _0x560523[_0x2281('0x2c')];}_0x527e1d[_0x2281('0x1c')](_0x1fddcf)['send'](_0x560523);};}exports['index']=function(_0x33e996,_0x31c621){var _0x2008f3={},_0x2e3017={},_0x387320={'count':0x0,'rows':[]};var _0x5a97c8=_[_0x2281('0x2d')](db[_0x2281('0x2e')]['rawAttributes'],function(_0x281fa8){return{'name':_0x281fa8[_0x2281('0x2f')],'type':_0x281fa8[_0x2281('0x30')][_0x2281('0x31')]};});_0x2e3017[_0x2281('0x32')]=_[_0x2281('0x2d')](_0x5a97c8,'name');_0x2e3017[_0x2281('0x33')]=_['keys'](_0x33e996['query']);_0x2e3017[_0x2281('0x34')]=_[_0x2281('0x35')](_0x2e3017[_0x2281('0x32')],_0x2e3017[_0x2281('0x33')]);_0x2008f3[_0x2281('0x36')]=_[_0x2281('0x35')](_0x2e3017[_0x2281('0x32')],qs[_0x2281('0x37')](_0x33e996[_0x2281('0x33')][_0x2281('0x37')]));_0x2008f3['attributes']=_0x2008f3[_0x2281('0x36')]['length']?_0x2008f3[_0x2281('0x36')]:_0x2e3017[_0x2281('0x32')];if(!_0x33e996['query']['hasOwnProperty'](_0x2281('0x38'))){_0x2008f3[_0x2281('0x21')]=qs['limit'](_0x33e996['query']['limit']);_0x2008f3[_0x2281('0x1f')]=qs['offset'](_0x33e996[_0x2281('0x33')][_0x2281('0x1f')]);}_0x2008f3[_0x2281('0x39')]=qs[_0x2281('0x3a')](_0x33e996[_0x2281('0x33')]['sort']);_0x2008f3[_0x2281('0x3b')]=qs['filters'](_[_0x2281('0x3c')](_0x33e996[_0x2281('0x33')],_0x2e3017[_0x2281('0x34')]),_0x5a97c8);if(_0x33e996[_0x2281('0x33')][_0x2281('0x3d')]){_0x2008f3['where']=_['merge'](_0x2008f3['where'],{'$or':_[_0x2281('0x2d')](_0x5a97c8,function(_0x43893a){if(_0x43893a[_0x2281('0x30')]!==_0x2281('0x3e')){var _0x14b827={};_0x14b827[_0x43893a[_0x2281('0x2c')]]={'$like':'%'+_0x33e996[_0x2281('0x33')][_0x2281('0x3d')]+'%'};return _0x14b827;}})});}_0x2008f3=_[_0x2281('0x3f')]({},_0x2008f3,_0x33e996['options']);var _0x3f9e92={'where':_0x2008f3['where']};return db[_0x2281('0x2e')][_0x2281('0x22')](_0x3f9e92)[_0x2281('0x29')](function(_0x4094e6){_0x387320['count']=_0x4094e6;if(_0x33e996[_0x2281('0x33')]['includeAll']){_0x2008f3[_0x2281('0x40')]=[{'all':!![]}];}return db[_0x2281('0x2e')][_0x2281('0x41')](_0x2008f3);})[_0x2281('0x29')](function(_0x318b8a){_0x387320[_0x2281('0x42')]=_0x318b8a;return _0x387320;})[_0x2281('0x29')](respondWithFilteredResult(_0x31c621,_0x2008f3))[_0x2281('0x43')](handleError(_0x31c621,null));};exports['show']=function(_0x2eadfe,_0x3b0796){var _0x4a61b2={'raw':!![],'where':{'id':_0x2eadfe[_0x2281('0x44')]['id']}},_0x34a697={};_0x34a697[_0x2281('0x32')]=_['keys'](db[_0x2281('0x2e')][_0x2281('0x45')]);_0x34a697[_0x2281('0x33')]=_[_0x2281('0x46')](_0x2eadfe[_0x2281('0x33')]);_0x34a697[_0x2281('0x34')]=_[_0x2281('0x35')](_0x34a697[_0x2281('0x32')],_0x34a697[_0x2281('0x33')]);_0x4a61b2[_0x2281('0x36')]=_['intersection'](_0x34a697['model'],qs[_0x2281('0x37')](_0x2eadfe[_0x2281('0x33')][_0x2281('0x37')]));_0x4a61b2['attributes']=_0x4a61b2[_0x2281('0x36')][_0x2281('0x47')]?_0x4a61b2['attributes']:_0x34a697[_0x2281('0x32')];if(_0x2eadfe[_0x2281('0x33')][_0x2281('0x48')]){_0x4a61b2[_0x2281('0x40')]=[{'all':!![]}];}_0x4a61b2=_[_0x2281('0x3f')]({},_0x4a61b2,_0x2eadfe['options']);return db[_0x2281('0x2e')]['find'](_0x4a61b2)[_0x2281('0x29')](handleEntityNotFound(_0x3b0796,null))['then'](respondWithResult(_0x3b0796,null))[_0x2281('0x43')](handleError(_0x3b0796,null));};exports[_0x2281('0x49')]=function(_0x241c99,_0x949e40){return db[_0x2281('0x2e')]['create'](_0x241c99['body'],{})['then'](respondWithResult(_0x949e40,0xc9))['catch'](handleError(_0x949e40,null));};exports[_0x2281('0x28')]=function(_0x350bed,_0x37d2ff){if(_0x350bed[_0x2281('0x4a')]['id']){delete _0x350bed['body']['id'];}return db[_0x2281('0x2e')][_0x2281('0x4b')]({'where':{'id':_0x350bed[_0x2281('0x44')]['id']}})['then'](handleEntityNotFound(_0x37d2ff,null))[_0x2281('0x29')](saveUpdates(_0x350bed[_0x2281('0x4a')],null))['then'](respondWithResult(_0x37d2ff,null))[_0x2281('0x43')](handleError(_0x37d2ff,null));};exports[_0x2281('0x4c')]=function(_0x350f5a,_0xfda3a8){return db[_0x2281('0x2e')][_0x2281('0x4b')]({'where':{'id':_0x350f5a[_0x2281('0x44')]['id']}})['then'](handleEntityNotFound(_0xfda3a8,null))[_0x2281('0x29')](removeEntity(_0xfda3a8,null))['catch'](handleError(_0xfda3a8,null));};exports[_0x2281('0x4d')]=function(_0x22fecb,_0x21f109){return db['ChatGroup'][_0x2281('0x4d')]()[_0x2281('0x29')](respondWithResult(_0x21f109,null))['catch'](handleError(_0x21f109,null));};exports[_0x2281('0x4e')]=function(_0x38bce3,_0x17c64c,_0x28e903){return db[_0x2281('0x4f')]['count']({'where':{'ChatGroupId':_0x38bce3[_0x2281('0x44')]['id'],'ToId':_0x38bce3['user']['id'],'read':![]}})[_0x2281('0x29')](function(_0x16a2e3){return{'id':_['toInteger'](_0x38bce3['params']['id']),'count':_0x16a2e3};})[_0x2281('0x29')](respondWithResult(_0x17c64c,null))['catch'](handleError(_0x17c64c,null));};exports['addMembers']=function(_0x158739,_0x2c6dbd,_0x31a988){return db[_0x2281('0x2e')]['find']({'where':{'id':_0x158739['params']['id']}})[_0x2281('0x29')](handleEntityNotFound(_0x2c6dbd,null))['then'](function(_0x4290db){if(_0x4290db){return _0x4290db[_0x2281('0x50')](_0x158739[_0x2281('0x4a')]['ids'],_['omit'](_0x158739[_0x2281('0x4a')],['ids','id'])||{});}})[_0x2281('0x29')](respondWithResult(_0x2c6dbd,null))[_0x2281('0x43')](handleError(_0x2c6dbd,null));};exports['getMembers']=function(_0x4535ab,_0x5d8327,_0x29cc72){var _0x45e06d={};var _0x1ea9e4={};var _0x543cb3;var _0x101435;return db[_0x2281('0x2e')]['findOne']({'where':{'id':_0x4535ab[_0x2281('0x44')]['id']}})[_0x2281('0x29')](handleEntityNotFound(_0x5d8327,null))['then'](function(_0x15736d){if(_0x15736d){_0x543cb3=_0x15736d;_0x1ea9e4['model']=_[_0x2281('0x46')](db[_0x2281('0x51')][_0x2281('0x45')]);_0x1ea9e4[_0x2281('0x33')]=_['keys'](_0x4535ab['query']);_0x1ea9e4['filters']=_[_0x2281('0x35')](_0x1ea9e4[_0x2281('0x32')],_0x1ea9e4[_0x2281('0x33')]);_0x45e06d[_0x2281('0x36')]=_['intersection'](_0x1ea9e4[_0x2281('0x32')],qs[_0x2281('0x37')](_0x4535ab[_0x2281('0x33')][_0x2281('0x37')]));_0x45e06d['attributes']=_0x45e06d[_0x2281('0x36')][_0x2281('0x47')]?_0x45e06d[_0x2281('0x36')]:_0x1ea9e4[_0x2281('0x32')];_0x45e06d[_0x2281('0x39')]=qs[_0x2281('0x3a')](_0x4535ab[_0x2281('0x33')][_0x2281('0x3a')]);_0x45e06d['where']=qs[_0x2281('0x34')](_[_0x2281('0x3c')](_0x4535ab[_0x2281('0x33')],_0x1ea9e4[_0x2281('0x34')]));if(_0x4535ab['query'][_0x2281('0x3d')]){_0x45e06d['where']=_[_0x2281('0x3f')](_0x45e06d[_0x2281('0x3b')],{'$or':_[_0x2281('0x2d')](_0x45e06d[_0x2281('0x36')],function(_0x564208){var _0x1ca665={};_0x1ca665[_0x564208]={'$like':'%'+_0x4535ab['query']['filter']+'%'};return _0x1ca665;})});}_0x45e06d=_['merge']({},_0x45e06d,_0x4535ab[_0x2281('0x52')]);return _0x543cb3[_0x2281('0x53')](_0x45e06d);}})[_0x2281('0x29')](function(_0x5d42e5){if(_0x5d42e5){_0x101435=_0x5d42e5[_0x2281('0x47')];if(!_0x4535ab[_0x2281('0x33')][_0x2281('0x54')](_0x2281('0x38'))){_0x45e06d['limit']=qs['limit'](_0x4535ab[_0x2281('0x33')]['limit']);_0x45e06d[_0x2281('0x1f')]=qs['offset'](_0x4535ab[_0x2281('0x33')]['offset']);}return _0x543cb3[_0x2281('0x53')](_0x45e06d);}})[_0x2281('0x29')](function(_0x410499){if(_0x410499){return _0x410499?{'count':_0x101435,'rows':_0x410499}:null;}})[_0x2281('0x29')](respondWithResult(_0x5d8327,null))[_0x2281('0x43')](handleError(_0x5d8327,null));};exports[_0x2281('0x55')]=function(_0x1c0ead,_0x1c2a94,_0x3424e7){return db['ChatGroup'][_0x2281('0x4b')]({'where':{'id':_0x1c0ead[_0x2281('0x44')]['id']}})[_0x2281('0x29')](handleEntityNotFound(_0x1c2a94,null))[_0x2281('0x29')](function(_0x5ba525){if(_0x5ba525){return _0x5ba525[_0x2281('0x55')](_0x1c0ead[_0x2281('0x33')]['ids']);}})[_0x2281('0x29')](respondWithStatusCode(_0x1c2a94,null))[_0x2281('0x43')](handleError(_0x1c2a94,null));};exports['addMessage']=function(_0x35a753,_0x5db74c,_0xccc969){if(_0x35a753[_0x2281('0x4a')]['id']){delete _0x35a753[_0x2281('0x4a')]['id'];}return db['ChatGroup'][_0x2281('0x4b')]({'where':{'id':_0x35a753[_0x2281('0x44')]['id']}})[_0x2281('0x29')](handleEntityNotFound(_0x5db74c,null))['then'](function(_0x5707f2){if(_0x5707f2){_0x35a753[_0x2281('0x4a')][_0x2281('0x56')]=_0x5707f2['id'];return db[_0x2281('0x4f')]['create'](_0x35a753[_0x2281('0x4a')]);}})[_0x2281('0x29')](respondWithResult(_0x5db74c,null))[_0x2281('0x43')](handleError(_0x5db74c,null));};exports[_0x2281('0x57')]=function(_0x35ed85,_0x256823,_0x49775d){var _0x47d520={};var _0x3366c3={};var _0x53eb94;var _0x37f553;return db[_0x2281('0x2e')][_0x2281('0x58')]({'where':{'id':_0x35ed85[_0x2281('0x44')]['id']}})['then'](handleEntityNotFound(_0x256823,null))[_0x2281('0x29')](function(_0x127fb3){if(_0x127fb3){_0x53eb94=_0x127fb3;_0x3366c3[_0x2281('0x32')]=_[_0x2281('0x46')](db[_0x2281('0x4f')][_0x2281('0x45')]);_0x3366c3[_0x2281('0x33')]=_[_0x2281('0x46')](_0x35ed85['query']);_0x3366c3[_0x2281('0x34')]=_['intersection'](_0x3366c3[_0x2281('0x32')],_0x3366c3[_0x2281('0x33')]);_0x47d520[_0x2281('0x36')]=_['intersection'](_0x3366c3[_0x2281('0x32')],qs[_0x2281('0x37')](_0x35ed85['query'][_0x2281('0x37')]));_0x47d520[_0x2281('0x36')]=_0x47d520[_0x2281('0x36')][_0x2281('0x47')]?_0x47d520['attributes']:_0x3366c3[_0x2281('0x32')];_0x47d520[_0x2281('0x39')]=qs[_0x2281('0x3a')](_0x35ed85[_0x2281('0x33')]['sort']);_0x47d520[_0x2281('0x3b')]=qs[_0x2281('0x34')](_[_0x2281('0x3c')](_0x35ed85['query'],_0x3366c3[_0x2281('0x34')]));if(_0x35ed85[_0x2281('0x33')][_0x2281('0x3d')]){_0x47d520[_0x2281('0x3b')]=_[_0x2281('0x3f')](_0x47d520[_0x2281('0x3b')],{'$or':_[_0x2281('0x2d')](_0x47d520[_0x2281('0x36')],function(_0x180d84){var _0x1a4456={};_0x1a4456[_0x180d84]={'$like':'%'+_0x35ed85[_0x2281('0x33')]['filter']+'%'};return _0x1a4456;})});}if(_0x35ed85[_0x2281('0x33')][_0x2281('0x59')]){var _0x290784=_0x35ed85[_0x2281('0x33')][_0x2281('0x59')][_0x2281('0x5a')](',');var _0x51adfd={};_0x51adfd[_0x290784[0x0]]={'$gte':moment(_0x290784[0x1])[_0x2281('0x5b')](_0x2281('0x5c'))};_0x47d520[_0x2281('0x3b')]=_[_0x2281('0x3f')](_0x47d520[_0x2281('0x3b')],_0x51adfd);}_0x47d520=_['merge']({},_0x47d520,_0x35ed85['options']);return _0x53eb94[_0x2281('0x57')](_0x47d520);}})[_0x2281('0x29')](function(_0x269abf){if(_0x269abf){_0x37f553=_0x269abf['length'];if(!_0x35ed85[_0x2281('0x33')][_0x2281('0x54')](_0x2281('0x38'))){_0x47d520[_0x2281('0x21')]=qs[_0x2281('0x21')](_0x35ed85['query'][_0x2281('0x21')]);_0x47d520['offset']=qs[_0x2281('0x1f')](_0x35ed85['query'][_0x2281('0x1f')]);}return _0x53eb94[_0x2281('0x57')](_0x47d520);}})[_0x2281('0x29')](function(_0x1095de){if(_0x1095de){return _0x1095de?{'count':_0x37f553,'rows':_0x1095de}:null;}})[_0x2281('0x29')](respondWithResult(_0x256823,null))['catch'](handleError(_0x256823,null));}; \ No newline at end of file +var _0xd0a7=['find','catch','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','ids','getMembers','User','removeMembers','addMessage','getMessages','$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','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','undefined','offset','count','limit','Content-Range','json','reject','save','then','sendStatus','error','stack','name','send','index','map','ChatGroup','fieldName','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes'];(function(_0x24ab67,_0x1cdca5){var _0x1d75d1=function(_0x2b49dd){while(--_0x2b49dd){_0x24ab67['push'](_0x24ab67['shift']());}};_0x1d75d1(++_0x1cdca5);}(_0xd0a7,0x137));var _0x7d0a=function(_0x2919bc,_0x4a6cd8){_0x2919bc=_0x2919bc-0x0;var _0x5ae95e=_0xd0a7[_0x2919bc];return _0x5ae95e;};'use strict';var emlformat=require(_0x7d0a('0x0'));var rimraf=require(_0x7d0a('0x1'));var zipdir=require(_0x7d0a('0x2'));var jsonpatch=require(_0x7d0a('0x3'));var rp=require('request-promise');var moment=require(_0x7d0a('0x4'));var BPromise=require(_0x7d0a('0x5'));var Mustache=require(_0x7d0a('0x6'));var util=require(_0x7d0a('0x7'));var path=require(_0x7d0a('0x8'));var sox=require(_0x7d0a('0x9'));var csv=require(_0x7d0a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d0a('0xb'));var _=require(_0x7d0a('0xc'));var squel=require(_0x7d0a('0xd'));var crypto=require(_0x7d0a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7d0a('0xf'));var toCsv=require(_0x7d0a('0xa'));var querystring=require(_0x7d0a('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7d0a('0x11'));var qs=require(_0x7d0a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d0a('0x13'));var logger=require(_0x7d0a('0x14'))(_0x7d0a('0x15'));var utils=require(_0x7d0a('0x16'));var config=require(_0x7d0a('0x17'));var licenseUtil=require(_0x7d0a('0x18'));var db=require(_0x7d0a('0x19'))['db'];config['redis']=_['defaults'](config[_0x7d0a('0x1a')],{'host':_0x7d0a('0x1b'),'port':0x18eb});var socket=require(_0x7d0a('0x1c'))(new Redis(config['redis']));require(_0x7d0a('0x1d'))[_0x7d0a('0x1e')](socket);function respondWithStatusCode(_0x9f77ca,_0x5bb797){_0x5bb797=_0x5bb797||0xcc;return function(_0x30d4a4){if(_0x30d4a4){return _0x9f77ca['sendStatus'](_0x5bb797);}return _0x9f77ca[_0x7d0a('0x1f')](_0x5bb797)[_0x7d0a('0x20')]();};}function respondWithResult(_0x48e8bf,_0x5eb5c1){_0x5eb5c1=_0x5eb5c1||0xc8;return function(_0x66b8f6){if(_0x66b8f6){return _0x48e8bf[_0x7d0a('0x1f')](_0x5eb5c1)['json'](_0x66b8f6);}};}function respondWithFilteredResult(_0x65d2f0,_0x13f286){return function(_0x4e467e){if(_0x4e467e){var _0x41585a=typeof _0x13f286['offset']==='undefined'&&typeof _0x13f286['limit']===_0x7d0a('0x21');var _0x45e983=_0x4e467e['count'];var _0x446f9f=_0x41585a?0x0:_0x13f286[_0x7d0a('0x22')];var _0x30b468=_0x41585a?_0x4e467e[_0x7d0a('0x23')]:_0x13f286[_0x7d0a('0x22')]+_0x13f286[_0x7d0a('0x24')];var _0x9a70ba;if(_0x30b468>=_0x45e983){_0x30b468=_0x45e983;_0x9a70ba=0xc8;}else{_0x9a70ba=0xce;}_0x65d2f0[_0x7d0a('0x1f')](_0x9a70ba);return _0x65d2f0['set'](_0x7d0a('0x25'),_0x446f9f+'-'+_0x30b468+'/'+_0x45e983)[_0x7d0a('0x26')](_0x4e467e);}return null;};}function patchUpdates(_0x514a8c){return function(_0x97af82){try{jsonpatch['apply'](_0x97af82,_0x514a8c,!![]);}catch(_0x4e67f6){return BPromise[_0x7d0a('0x27')](_0x4e67f6);}return _0x97af82[_0x7d0a('0x28')]();};}function saveUpdates(_0x47a5bb,_0x3b9d4c){return function(_0x90939a){if(_0x90939a){return _0x90939a['update'](_0x47a5bb)[_0x7d0a('0x29')](function(_0x5a9a0d){return _0x5a9a0d;});}return null;};}function removeEntity(_0x1488df,_0x575a9a){return function(_0x5d9d5b){if(_0x5d9d5b){return _0x5d9d5b['destroy']()[_0x7d0a('0x29')](function(){_0x1488df[_0x7d0a('0x1f')](0xcc)[_0x7d0a('0x20')]();});}};}function handleEntityNotFound(_0x4391a4,_0x1214c6){return function(_0x2bd1c8){if(!_0x2bd1c8){_0x4391a4[_0x7d0a('0x2a')](0x194);}return _0x2bd1c8;};}function handleError(_0x276fd8,_0x430842){_0x430842=_0x430842||0x1f4;return function(_0x2aabe6){logger[_0x7d0a('0x2b')](_0x2aabe6[_0x7d0a('0x2c')]);if(_0x2aabe6[_0x7d0a('0x2d')]){delete _0x2aabe6[_0x7d0a('0x2d')];}_0x276fd8['status'](_0x430842)[_0x7d0a('0x2e')](_0x2aabe6);};}exports[_0x7d0a('0x2f')]=function(_0x49aa8b,_0x1019f6){var _0x236d4a={},_0x347867={},_0x26e902={'count':0x0,'rows':[]};var _0x238208=_[_0x7d0a('0x30')](db[_0x7d0a('0x31')]['rawAttributes'],function(_0x2f9153){return{'name':_0x2f9153[_0x7d0a('0x32')],'type':_0x2f9153['type'][_0x7d0a('0x33')]};});_0x347867['model']=_[_0x7d0a('0x30')](_0x238208,_0x7d0a('0x2d'));_0x347867[_0x7d0a('0x34')]=_['keys'](_0x49aa8b[_0x7d0a('0x34')]);_0x347867['filters']=_[_0x7d0a('0x35')](_0x347867[_0x7d0a('0x36')],_0x347867[_0x7d0a('0x34')]);_0x236d4a['attributes']=_['intersection'](_0x347867['model'],qs[_0x7d0a('0x37')](_0x49aa8b[_0x7d0a('0x34')][_0x7d0a('0x37')]));_0x236d4a[_0x7d0a('0x38')]=_0x236d4a['attributes'][_0x7d0a('0x39')]?_0x236d4a['attributes']:_0x347867[_0x7d0a('0x36')];if(!_0x49aa8b['query'][_0x7d0a('0x3a')](_0x7d0a('0x3b'))){_0x236d4a['limit']=qs['limit'](_0x49aa8b[_0x7d0a('0x34')]['limit']);_0x236d4a['offset']=qs[_0x7d0a('0x22')](_0x49aa8b[_0x7d0a('0x34')][_0x7d0a('0x22')]);}_0x236d4a[_0x7d0a('0x3c')]=qs[_0x7d0a('0x3d')](_0x49aa8b[_0x7d0a('0x34')][_0x7d0a('0x3d')]);_0x236d4a[_0x7d0a('0x3e')]=qs[_0x7d0a('0x3f')](_[_0x7d0a('0x40')](_0x49aa8b[_0x7d0a('0x34')],_0x347867[_0x7d0a('0x3f')]),_0x238208);if(_0x49aa8b[_0x7d0a('0x34')][_0x7d0a('0x41')]){_0x236d4a[_0x7d0a('0x3e')]=_[_0x7d0a('0x42')](_0x236d4a[_0x7d0a('0x3e')],{'$or':_[_0x7d0a('0x30')](_0x238208,function(_0x3e3e5f){if(_0x3e3e5f['type']!==_0x7d0a('0x43')){var _0x4e3159={};_0x4e3159[_0x3e3e5f[_0x7d0a('0x2d')]]={'$like':'%'+_0x49aa8b[_0x7d0a('0x34')][_0x7d0a('0x41')]+'%'};return _0x4e3159;}})});}_0x236d4a=_['merge']({},_0x236d4a,_0x49aa8b[_0x7d0a('0x44')]);var _0x514218={'where':_0x236d4a[_0x7d0a('0x3e')]};return db[_0x7d0a('0x31')][_0x7d0a('0x23')](_0x514218)['then'](function(_0x4c1f85){_0x26e902[_0x7d0a('0x23')]=_0x4c1f85;if(_0x49aa8b[_0x7d0a('0x34')][_0x7d0a('0x45')]){_0x236d4a[_0x7d0a('0x46')]=[{'all':!![]}];}return db['ChatGroup'][_0x7d0a('0x47')](_0x236d4a);})[_0x7d0a('0x29')](function(_0x2986dc){_0x26e902[_0x7d0a('0x48')]=_0x2986dc;return _0x26e902;})[_0x7d0a('0x29')](respondWithFilteredResult(_0x1019f6,_0x236d4a))['catch'](handleError(_0x1019f6,null));};exports[_0x7d0a('0x49')]=function(_0xf6cf12,_0x29f31d){var _0x289cc3={'raw':!![],'where':{'id':_0xf6cf12[_0x7d0a('0x4a')]['id']}},_0x470bd5={};_0x470bd5['model']=_[_0x7d0a('0x4b')](db[_0x7d0a('0x31')][_0x7d0a('0x4c')]);_0x470bd5[_0x7d0a('0x34')]=_[_0x7d0a('0x4b')](_0xf6cf12[_0x7d0a('0x34')]);_0x470bd5[_0x7d0a('0x3f')]=_[_0x7d0a('0x35')](_0x470bd5[_0x7d0a('0x36')],_0x470bd5[_0x7d0a('0x34')]);_0x289cc3[_0x7d0a('0x38')]=_[_0x7d0a('0x35')](_0x470bd5[_0x7d0a('0x36')],qs[_0x7d0a('0x37')](_0xf6cf12[_0x7d0a('0x34')][_0x7d0a('0x37')]));_0x289cc3['attributes']=_0x289cc3[_0x7d0a('0x38')]['length']?_0x289cc3[_0x7d0a('0x38')]:_0x470bd5[_0x7d0a('0x36')];if(_0xf6cf12[_0x7d0a('0x34')][_0x7d0a('0x45')]){_0x289cc3['include']=[{'all':!![]}];}_0x289cc3=_[_0x7d0a('0x42')]({},_0x289cc3,_0xf6cf12[_0x7d0a('0x44')]);return db[_0x7d0a('0x31')][_0x7d0a('0x4d')](_0x289cc3)[_0x7d0a('0x29')](handleEntityNotFound(_0x29f31d,null))[_0x7d0a('0x29')](respondWithResult(_0x29f31d,null))[_0x7d0a('0x4e')](handleError(_0x29f31d,null));};exports[_0x7d0a('0x4f')]=function(_0x112a14,_0x121189){return db[_0x7d0a('0x31')][_0x7d0a('0x4f')](_0x112a14[_0x7d0a('0x50')],{})['then'](respondWithResult(_0x121189,0xc9))[_0x7d0a('0x4e')](handleError(_0x121189,null));};exports['update']=function(_0x11b93f,_0x131bc8){if(_0x11b93f[_0x7d0a('0x50')]['id']){delete _0x11b93f[_0x7d0a('0x50')]['id'];}return db[_0x7d0a('0x31')][_0x7d0a('0x4d')]({'where':{'id':_0x11b93f[_0x7d0a('0x4a')]['id']}})[_0x7d0a('0x29')](handleEntityNotFound(_0x131bc8,null))[_0x7d0a('0x29')](saveUpdates(_0x11b93f[_0x7d0a('0x50')],null))['then'](respondWithResult(_0x131bc8,null))['catch'](handleError(_0x131bc8,null));};exports[_0x7d0a('0x51')]=function(_0x3227c7,_0x51d465){return db[_0x7d0a('0x31')][_0x7d0a('0x4d')]({'where':{'id':_0x3227c7[_0x7d0a('0x4a')]['id']}})[_0x7d0a('0x29')](handleEntityNotFound(_0x51d465,null))[_0x7d0a('0x29')](removeEntity(_0x51d465,null))['catch'](handleError(_0x51d465,null));};exports['describe']=function(_0xb473eb,_0x4032d8){return db['ChatGroup'][_0x7d0a('0x52')]()[_0x7d0a('0x29')](respondWithResult(_0x4032d8,null))[_0x7d0a('0x4e')](handleError(_0x4032d8,null));};exports[_0x7d0a('0x53')]=function(_0x3bff18,_0x14c7b3,_0x119e94){return db[_0x7d0a('0x54')]['count']({'where':{'ChatGroupId':_0x3bff18[_0x7d0a('0x4a')]['id'],'ToId':_0x3bff18[_0x7d0a('0x55')]['id'],'read':![]}})[_0x7d0a('0x29')](function(_0x25be5b){return{'id':_[_0x7d0a('0x56')](_0x3bff18[_0x7d0a('0x4a')]['id']),'count':_0x25be5b};})[_0x7d0a('0x29')](respondWithResult(_0x14c7b3,null))[_0x7d0a('0x4e')](handleError(_0x14c7b3,null));};exports['addMembers']=function(_0x3f70ad,_0xe89741,_0x2df2c5){return db[_0x7d0a('0x31')][_0x7d0a('0x4d')]({'where':{'id':_0x3f70ad['params']['id']}})['then'](handleEntityNotFound(_0xe89741,null))[_0x7d0a('0x29')](function(_0x56d684){if(_0x56d684){return _0x56d684['addMembers'](_0x3f70ad[_0x7d0a('0x50')][_0x7d0a('0x57')],_['omit'](_0x3f70ad[_0x7d0a('0x50')],[_0x7d0a('0x57'),'id'])||{});}})[_0x7d0a('0x29')](respondWithResult(_0xe89741,null))[_0x7d0a('0x4e')](handleError(_0xe89741,null));};exports[_0x7d0a('0x58')]=function(_0x19ac41,_0x32e2f6,_0x134db8){var _0x255e3b={};var _0x5ca438={};var _0xc23ed0;var _0x500255;return db['ChatGroup']['findOne']({'where':{'id':_0x19ac41[_0x7d0a('0x4a')]['id']}})[_0x7d0a('0x29')](handleEntityNotFound(_0x32e2f6,null))['then'](function(_0x389793){if(_0x389793){_0xc23ed0=_0x389793;_0x5ca438[_0x7d0a('0x36')]=_[_0x7d0a('0x4b')](db[_0x7d0a('0x59')]['rawAttributes']);_0x5ca438['query']=_[_0x7d0a('0x4b')](_0x19ac41[_0x7d0a('0x34')]);_0x5ca438['filters']=_[_0x7d0a('0x35')](_0x5ca438[_0x7d0a('0x36')],_0x5ca438[_0x7d0a('0x34')]);_0x255e3b[_0x7d0a('0x38')]=_[_0x7d0a('0x35')](_0x5ca438['model'],qs[_0x7d0a('0x37')](_0x19ac41[_0x7d0a('0x34')]['fields']));_0x255e3b[_0x7d0a('0x38')]=_0x255e3b[_0x7d0a('0x38')]['length']?_0x255e3b[_0x7d0a('0x38')]:_0x5ca438[_0x7d0a('0x36')];_0x255e3b[_0x7d0a('0x3c')]=qs[_0x7d0a('0x3d')](_0x19ac41[_0x7d0a('0x34')][_0x7d0a('0x3d')]);_0x255e3b[_0x7d0a('0x3e')]=qs['filters'](_['pick'](_0x19ac41[_0x7d0a('0x34')],_0x5ca438[_0x7d0a('0x3f')]));if(_0x19ac41[_0x7d0a('0x34')][_0x7d0a('0x41')]){_0x255e3b[_0x7d0a('0x3e')]=_[_0x7d0a('0x42')](_0x255e3b['where'],{'$or':_[_0x7d0a('0x30')](_0x255e3b[_0x7d0a('0x38')],function(_0x5729d4){var _0xbee54b={};_0xbee54b[_0x5729d4]={'$like':'%'+_0x19ac41[_0x7d0a('0x34')][_0x7d0a('0x41')]+'%'};return _0xbee54b;})});}_0x255e3b=_['merge']({},_0x255e3b,_0x19ac41['options']);return _0xc23ed0[_0x7d0a('0x58')](_0x255e3b);}})[_0x7d0a('0x29')](function(_0x3e9b8a){if(_0x3e9b8a){_0x500255=_0x3e9b8a[_0x7d0a('0x39')];if(!_0x19ac41[_0x7d0a('0x34')]['hasOwnProperty'](_0x7d0a('0x3b'))){_0x255e3b[_0x7d0a('0x24')]=qs[_0x7d0a('0x24')](_0x19ac41[_0x7d0a('0x34')][_0x7d0a('0x24')]);_0x255e3b[_0x7d0a('0x22')]=qs[_0x7d0a('0x22')](_0x19ac41[_0x7d0a('0x34')][_0x7d0a('0x22')]);}return _0xc23ed0['getMembers'](_0x255e3b);}})[_0x7d0a('0x29')](function(_0x86db3e){if(_0x86db3e){return _0x86db3e?{'count':_0x500255,'rows':_0x86db3e}:null;}})[_0x7d0a('0x29')](respondWithResult(_0x32e2f6,null))[_0x7d0a('0x4e')](handleError(_0x32e2f6,null));};exports[_0x7d0a('0x5a')]=function(_0x3dd0d0,_0x485296,_0x327cd8){return db[_0x7d0a('0x31')][_0x7d0a('0x4d')]({'where':{'id':_0x3dd0d0[_0x7d0a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x485296,null))[_0x7d0a('0x29')](function(_0xa07b02){if(_0xa07b02){return _0xa07b02[_0x7d0a('0x5a')](_0x3dd0d0[_0x7d0a('0x34')][_0x7d0a('0x57')]);}})['then'](respondWithStatusCode(_0x485296,null))[_0x7d0a('0x4e')](handleError(_0x485296,null));};exports[_0x7d0a('0x5b')]=function(_0x4635cc,_0xb32d66,_0x1fc974){if(_0x4635cc[_0x7d0a('0x50')]['id']){delete _0x4635cc[_0x7d0a('0x50')]['id'];}return db['ChatGroup'][_0x7d0a('0x4d')]({'where':{'id':_0x4635cc[_0x7d0a('0x4a')]['id']}})[_0x7d0a('0x29')](handleEntityNotFound(_0xb32d66,null))[_0x7d0a('0x29')](function(_0x1d63c6){if(_0x1d63c6){_0x4635cc['body']['ChatGroupId']=_0x1d63c6['id'];return db['ChatInternalMessage'][_0x7d0a('0x4f')](_0x4635cc['body']);}})[_0x7d0a('0x29')](respondWithResult(_0xb32d66,null))[_0x7d0a('0x4e')](handleError(_0xb32d66,null));};exports[_0x7d0a('0x5c')]=function(_0x20355d,_0x1696e1,_0x4c7148){var _0xe17b89={};var _0x5c2df1={};var _0x110ce2;var _0x4022a3;return db[_0x7d0a('0x31')]['findOne']({'where':{'id':_0x20355d['params']['id']}})[_0x7d0a('0x29')](handleEntityNotFound(_0x1696e1,null))[_0x7d0a('0x29')](function(_0x4cff25){if(_0x4cff25){_0x110ce2=_0x4cff25;_0x5c2df1[_0x7d0a('0x36')]=_[_0x7d0a('0x4b')](db[_0x7d0a('0x54')][_0x7d0a('0x4c')]);_0x5c2df1[_0x7d0a('0x34')]=_[_0x7d0a('0x4b')](_0x20355d[_0x7d0a('0x34')]);_0x5c2df1[_0x7d0a('0x3f')]=_[_0x7d0a('0x35')](_0x5c2df1['model'],_0x5c2df1[_0x7d0a('0x34')]);_0xe17b89[_0x7d0a('0x38')]=_[_0x7d0a('0x35')](_0x5c2df1[_0x7d0a('0x36')],qs[_0x7d0a('0x37')](_0x20355d[_0x7d0a('0x34')][_0x7d0a('0x37')]));_0xe17b89['attributes']=_0xe17b89[_0x7d0a('0x38')]['length']?_0xe17b89['attributes']:_0x5c2df1['model'];_0xe17b89[_0x7d0a('0x3c')]=qs['sort'](_0x20355d[_0x7d0a('0x34')]['sort']);_0xe17b89['where']=qs[_0x7d0a('0x3f')](_[_0x7d0a('0x40')](_0x20355d[_0x7d0a('0x34')],_0x5c2df1['filters']));if(_0x20355d[_0x7d0a('0x34')][_0x7d0a('0x41')]){_0xe17b89[_0x7d0a('0x3e')]=_[_0x7d0a('0x42')](_0xe17b89[_0x7d0a('0x3e')],{'$or':_[_0x7d0a('0x30')](_0xe17b89[_0x7d0a('0x38')],function(_0x51dd2f){var _0x366ce4={};_0x366ce4[_0x51dd2f]={'$like':'%'+_0x20355d['query'][_0x7d0a('0x41')]+'%'};return _0x366ce4;})});}if(_0x20355d['query']['$gte']){var _0x4a62da=_0x20355d[_0x7d0a('0x34')][_0x7d0a('0x5d')][_0x7d0a('0x5e')](',');var _0x12bd1e={};_0x12bd1e[_0x4a62da[0x0]]={'$gte':moment(_0x4a62da[0x1])[_0x7d0a('0x5f')](_0x7d0a('0x60'))};_0xe17b89['where']=_[_0x7d0a('0x42')](_0xe17b89['where'],_0x12bd1e);}_0xe17b89=_['merge']({},_0xe17b89,_0x20355d['options']);return _0x110ce2['getMessages'](_0xe17b89);}})[_0x7d0a('0x29')](function(_0x42f6a2){if(_0x42f6a2){_0x4022a3=_0x42f6a2['length'];if(!_0x20355d[_0x7d0a('0x34')][_0x7d0a('0x3a')](_0x7d0a('0x3b'))){_0xe17b89[_0x7d0a('0x24')]=qs[_0x7d0a('0x24')](_0x20355d[_0x7d0a('0x34')][_0x7d0a('0x24')]);_0xe17b89[_0x7d0a('0x22')]=qs[_0x7d0a('0x22')](_0x20355d['query']['offset']);}return _0x110ce2[_0x7d0a('0x5c')](_0xe17b89);}})[_0x7d0a('0x29')](function(_0x227782){if(_0x227782){return _0x227782?{'count':_0x4022a3,'rows':_0x227782}:null;}})[_0x7d0a('0x29')](respondWithResult(_0x1696e1,null))[_0x7d0a('0x4e')](handleError(_0x1696e1,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 741d93f..9d4b6e1 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 _0xc130=['events','ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x561ebe,_0x2335a0){var _0x62617c=function(_0x8304b8){while(--_0x8304b8){_0x561ebe['push'](_0x561ebe['shift']());}};_0x62617c(++_0x2335a0);}(_0xc130,0x170));var _0x0c13=function(_0x5bb79d,_0x4c01fb){_0x5bb79d=_0x5bb79d-0x0;var _0x53ad9b=_0xc130[_0x5bb79d];return _0x53ad9b;};'use strict';var EventEmitter=require(_0x0c13('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x0c13('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0c13('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0c13('0x3'),'afterDestroy':_0x0c13('0x4')};function emitEvent(_0x5bbd93){return function(_0x3f19,_0x1ec471,_0x102bac){ChatGroupEvents[_0x0c13('0x5')](_0x5bbd93+':'+_0x3f19['id'],_0x3f19);ChatGroupEvents[_0x0c13('0x5')](_0x5bbd93,_0x3f19);_0x102bac(null);};}for(var e in events){if(events[_0x0c13('0x6')](e)){var event=events[e];ChatGroup[_0x0c13('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x9b33=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1cb13c,_0x58a1b5){var _0x230242=function(_0x5030ea){while(--_0x5030ea){_0x1cb13c['push'](_0x1cb13c['shift']());}};_0x230242(++_0x58a1b5);}(_0x9b33,0xdb));var _0x39b3=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x9b33[_0x4d8ed9];return _0x1e2140;};'use strict';var EventEmitter=require(_0x39b3('0x0'));var ChatGroup=require(_0x39b3('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x39b3('0x2')](0x0);var events={'afterCreate':_0x39b3('0x3'),'afterUpdate':_0x39b3('0x4'),'afterDestroy':_0x39b3('0x5')};function emitEvent(_0x549117){return function(_0x5e68d8,_0x3dddb7,_0x2523c0){ChatGroupEvents[_0x39b3('0x6')](_0x549117+':'+_0x5e68d8['id'],_0x5e68d8);ChatGroupEvents[_0x39b3('0x6')](_0x549117,_0x5e68d8);_0x2523c0(null);};}for(var e in events){if(events[_0x39b3('0x7')](e)){var event=events[e];ChatGroup[_0x39b3('0x8')](e,emitEvent(event));}}module[_0x39b3('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 5a249c3..58ffb59 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 _0x908c=['request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util','api','moment','bluebird'];(function(_0x4159f9,_0x3e64c2){var _0x5987bb=function(_0x508063){while(--_0x508063){_0x4159f9['push'](_0x4159f9['shift']());}};_0x5987bb(++_0x3e64c2);}(_0x908c,0x119));var _0xc908=function(_0x2ba337,_0x196398){_0x2ba337=_0x2ba337-0x0;var _0x5dcde3=_0x908c[_0x2ba337];return _0x5dcde3;};'use strict';var _=require(_0xc908('0x0'));var util=require(_0xc908('0x1'));var logger=require('../../config/logger')(_0xc908('0x2'));var moment=require(_0xc908('0x3'));var BPromise=require(_0xc908('0x4'));var rp=require(_0xc908('0x5'));var fs=require('fs');var path=require(_0xc908('0x6'));var rimraf=require(_0xc908('0x7'));var config=require(_0xc908('0x8'));var attributes=require('./chatGroup.attributes');module[_0xc908('0x9')]=function(_0x9a0c1,_0xb43642){return _0x9a0c1[_0xc908('0xa')](_0xc908('0xb'),attributes,{'tableName':_0xc908('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb268=['rimraf','ChatGroup','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x51bd8e,_0x2cc5c6){var _0x33be4b=function(_0xbc27b5){while(--_0xbc27b5){_0x51bd8e['push'](_0x51bd8e['shift']());}};_0x33be4b(++_0x2cc5c6);}(_0xb268,0xbf));var _0x8b26=function(_0x17e765,_0x46b1a7){_0x17e765=_0x17e765-0x0;var _0x48216a=_0xb268[_0x17e765];return _0x48216a;};'use strict';var _=require(_0x8b26('0x0'));var util=require(_0x8b26('0x1'));var logger=require(_0x8b26('0x2'))('api');var moment=require(_0x8b26('0x3'));var BPromise=require(_0x8b26('0x4'));var rp=require(_0x8b26('0x5'));var fs=require('fs');var path=require(_0x8b26('0x6'));var rimraf=require(_0x8b26('0x7'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module['exports']=function(_0x47292e,_0x587a28){return _0x47292e['define'](_0x8b26('0x8'),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 a4425eb..de81c91 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 _0xaba6=['debug','stringify','error','code','message','result','lodash','util','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','localhost','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent'];(function(_0x5158e0,_0x397492){var _0x256510=function(_0x44c557){while(--_0x44c557){_0x5158e0['push'](_0x5158e0['shift']());}};_0x256510(++_0x397492);}(_0xaba6,0xe2));var _0x6aba=function(_0x353fba,_0x46db7e){_0x353fba=_0x353fba-0x0;var _0x4694e4=_0xaba6[_0x353fba];return _0x4694e4;};'use strict';var _=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6aba('0x2'))['db'];var utils=require(_0x6aba('0x3'));var logger=require('../../config/logger')(_0x6aba('0x4'));var config=require(_0x6aba('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x6aba('0x6')]=_['defaults'](config[_0x6aba('0x6')],{'host':_0x6aba('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6aba('0x6')]));require(_0x6aba('0x8'))['register'](socket);function respondWithRpcPromise(_0x1114bd,_0x1bd238,_0x1a2dcc){return new BPromise(function(_0x1a04c3,_0xdbc119){return client[_0x6aba('0x9')](_0x1114bd,_0x1a2dcc)[_0x6aba('0xa')](function(_0x55b1b6){logger[_0x6aba('0xb')](_0x6aba('0xc'),_0x1bd238,_0x6aba('0xd'));logger[_0x6aba('0xe')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1bd238,_0x6aba('0xd'),JSON[_0x6aba('0xf')](_0x55b1b6));if(_0x55b1b6['error']){if(_0x55b1b6[_0x6aba('0x10')][_0x6aba('0x11')]===0x1f4){logger[_0x6aba('0x10')]('ChatGroup,\x20%s,\x20%s',_0x1bd238,_0x55b1b6[_0x6aba('0x10')][_0x6aba('0x12')]);return _0xdbc119(_0x55b1b6[_0x6aba('0x10')]['message']);}logger[_0x6aba('0x10')](_0x6aba('0xc'),_0x1bd238,_0x55b1b6[_0x6aba('0x10')][_0x6aba('0x12')]);return _0x1a04c3(_0x55b1b6[_0x6aba('0x10')][_0x6aba('0x12')]);}else{logger[_0x6aba('0xb')]('ChatGroup,\x20%s,\x20%s',_0x1bd238,_0x6aba('0xd'));_0x1a04c3(_0x55b1b6[_0x6aba('0x13')][_0x6aba('0x12')]);}})['catch'](function(_0x1d6ad4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x1bd238,_0x1d6ad4);_0xdbc119(_0x1d6ad4);});});} \ No newline at end of file +var _0xd6bb=['ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info'];(function(_0x3397c0,_0xd3a82e){var _0x399945=function(_0x5a2c66){while(--_0x5a2c66){_0x3397c0['push'](_0x3397c0['shift']());}};_0x399945(++_0xd3a82e);}(_0xd6bb,0x1cc));var _0xbd6b=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0xd6bb[_0x1d1d09];return _0x8827e;};'use strict';var _=require(_0xbd6b('0x0'));var util=require('util');var moment=require(_0xbd6b('0x1'));var BPromise=require(_0xbd6b('0x2'));var rs=require(_0xbd6b('0x3'));var fs=require('fs');var Redis=require(_0xbd6b('0x4'));var db=require(_0xbd6b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd6b('0x6'))(_0xbd6b('0x7'));var config=require(_0xbd6b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbd6b('0x9')][_0xbd6b('0xa')]({'port':0x232a});config[_0xbd6b('0xb')]=_[_0xbd6b('0xc')](config[_0xbd6b('0xb')],{'host':_0xbd6b('0xd'),'port':0x18eb});var socket=require(_0xbd6b('0xe'))(new Redis(config[_0xbd6b('0xb')]));require(_0xbd6b('0xf'))[_0xbd6b('0x10')](socket);function respondWithRpcPromise(_0x66952a,_0x5a810b,_0x3c24e5){return new BPromise(function(_0x42c30e,_0x47c02d){return client[_0xbd6b('0x11')](_0x66952a,_0x3c24e5)[_0xbd6b('0x12')](function(_0x531a2a){logger[_0xbd6b('0x13')](_0xbd6b('0x14'),_0x5a810b,_0xbd6b('0x15'));logger[_0xbd6b('0x16')](_0xbd6b('0x17'),_0x5a810b,'request\x20sent',JSON[_0xbd6b('0x18')](_0x531a2a));if(_0x531a2a[_0xbd6b('0x19')]){if(_0x531a2a[_0xbd6b('0x19')][_0xbd6b('0x1a')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5a810b,_0x531a2a[_0xbd6b('0x19')][_0xbd6b('0x1b')]);return _0x47c02d(_0x531a2a[_0xbd6b('0x19')][_0xbd6b('0x1b')]);}logger[_0xbd6b('0x19')](_0xbd6b('0x14'),_0x5a810b,_0x531a2a['error'][_0xbd6b('0x1b')]);return _0x42c30e(_0x531a2a['error']['message']);}else{logger['info'](_0xbd6b('0x14'),_0x5a810b,_0xbd6b('0x15'));_0x42c30e(_0x531a2a[_0xbd6b('0x1c')]['message']);}})[_0xbd6b('0x1d')](function(_0x27ff92){logger['error'](_0xbd6b('0x14'),_0x5a810b,_0x27ff92);_0x47c02d(_0x27ff92);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index a09a039..0efbcfc 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 _0xb64b=['register','length','chatGroup:','save','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb64b,0x1ca));var _0xbb64=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0xb64b[_0x3b76f7];return _0x43984e;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xbb64('0x0'),'remove','update'];function createListener(_0x582947,_0x511624){return function(_0x5b3a1a){_0x511624[_0xbb64('0x1')](_0x582947,_0x5b3a1a);};}function removeListener(_0x235f88,_0x4c36d9){return function(){ChatGroupEvents['removeListener'](_0x235f88,_0x4c36d9);};}exports[_0xbb64('0x2')]=function(_0x5bc9e4){for(var _0x130ca8=0x0,_0x54990a=events[_0xbb64('0x3')];_0x130ca8<_0x54990a;_0x130ca8++){var _0x4618c5=events[_0x130ca8];var _0x5711d6=createListener(_0xbb64('0x4')+_0x4618c5,_0x5bc9e4);ChatGroupEvents['on'](_0x4618c5,_0x5711d6);}}; \ No newline at end of file +var _0x5fd6=['removeListener','register','length','chatGroup:','save','remove','update','emit'];(function(_0x10a19a,_0x1a45ec){var _0x3f7183=function(_0x33ef0c){while(--_0x33ef0c){_0x10a19a['push'](_0x10a19a['shift']());}};_0x3f7183(++_0x1a45ec);}(_0x5fd6,0xac));var _0x65fd=function(_0x4da158,_0x4ba875){_0x4da158=_0x4da158-0x0;var _0x31133e=_0x5fd6[_0x4da158];return _0x31133e;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x65fd('0x0'),_0x65fd('0x1'),_0x65fd('0x2')];function createListener(_0x25efa3,_0x2600ce){return function(_0x3fbe32){_0x2600ce[_0x65fd('0x3')](_0x25efa3,_0x3fbe32);};}function removeListener(_0x81f0f0,_0x5a4863){return function(){ChatGroupEvents[_0x65fd('0x4')](_0x81f0f0,_0x5a4863);};}exports[_0x65fd('0x5')]=function(_0x3ab80b){for(var _0x4750e3=0x0,_0x585855=events[_0x65fd('0x6')];_0x4750e3<_0x585855;_0x4750e3++){var _0x4f29f7=events[_0x4750e3];var _0x13b90a=createListener(_0x65fd('0x7')+_0x4f29f7,_0x3ab80b);ChatGroupEvents['on'](_0x4f29f7,_0x13b90a);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index e41a394..49d53e5 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 _0xda8e=['isAuthenticated','index','/describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','addMembers','post','put','update','delete','destroy','removeMembers','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get'];(function(_0x3d95dc,_0x5eb141){var _0xc88f=function(_0x381507){while(--_0x381507){_0x3d95dc['push'](_0x3d95dc['shift']());}};_0xc88f(++_0x5eb141);}(_0xda8e,0x114));var _0xeda8=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0xda8e[_0x2e2681];return _0x368a64;};'use strict';var multer=require(_0xeda8('0x0'));var util=require('util');var path=require(_0xeda8('0x1'));var timeout=require(_0xeda8('0x2'));var express=require(_0xeda8('0x3'));var router=express[_0xeda8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xeda8('0x5'));var interaction=require(_0xeda8('0x6'));var config=require(_0xeda8('0x7'));var controller=require(_0xeda8('0x8'));router[_0xeda8('0x9')]('/',auth[_0xeda8('0xa')](),controller[_0xeda8('0xb')]);router[_0xeda8('0x9')](_0xeda8('0xc'),auth[_0xeda8('0xa')](),controller['describe']);router[_0xeda8('0x9')](_0xeda8('0xd'),auth[_0xeda8('0xa')](),controller['show']);router[_0xeda8('0x9')](_0xeda8('0xe'),auth[_0xeda8('0xa')](),controller[_0xeda8('0xf')]);router[_0xeda8('0x9')](_0xeda8('0x10'),auth[_0xeda8('0xa')](),controller[_0xeda8('0x11')]);router[_0xeda8('0x9')](_0xeda8('0x12'),auth[_0xeda8('0xa')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xeda8('0x10'),auth[_0xeda8('0xa')](),controller[_0xeda8('0x13')]);router[_0xeda8('0x14')](_0xeda8('0x12'),auth[_0xeda8('0xa')](),controller['addMessage']);router[_0xeda8('0x15')]('/:id',auth[_0xeda8('0xa')](),controller[_0xeda8('0x16')]);router[_0xeda8('0x17')](_0xeda8('0xd'),auth['isAuthenticated'](),controller[_0xeda8('0x18')]);router['delete'](_0xeda8('0x10'),auth[_0xeda8('0xa')](),controller[_0xeda8('0x19')]);module['exports']=router; \ No newline at end of file +var _0x68a8=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id/unread','getUnread','/:id/members','/:id/messages','post','create','addMembers','addMessage','put','/:id','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x68a8,0xce));var _0x868a=function(_0x397dde,_0x4b2324){_0x397dde=_0x397dde-0x0;var _0x222c6f=_0x68a8[_0x397dde];return _0x222c6f;};'use strict';var multer=require(_0x868a('0x0'));var util=require(_0x868a('0x1'));var path=require(_0x868a('0x2'));var timeout=require(_0x868a('0x3'));var express=require(_0x868a('0x4'));var router=express[_0x868a('0x5')]();var fs_extra=require(_0x868a('0x6'));var auth=require(_0x868a('0x7'));var interaction=require(_0x868a('0x8'));var config=require(_0x868a('0x9'));var controller=require(_0x868a('0xa'));router[_0x868a('0xb')]('/',auth[_0x868a('0xc')](),controller[_0x868a('0xd')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x868a('0xe')]);router[_0x868a('0xb')]('/:id',auth[_0x868a('0xc')](),controller['show']);router[_0x868a('0xb')](_0x868a('0xf'),auth[_0x868a('0xc')](),controller[_0x868a('0x10')]);router[_0x868a('0xb')](_0x868a('0x11'),auth[_0x868a('0xc')](),controller['getMembers']);router[_0x868a('0xb')](_0x868a('0x12'),auth[_0x868a('0xc')](),controller['getMessages']);router[_0x868a('0x13')]('/',auth[_0x868a('0xc')](),controller[_0x868a('0x14')]);router[_0x868a('0x13')](_0x868a('0x11'),auth[_0x868a('0xc')](),controller[_0x868a('0x15')]);router[_0x868a('0x13')](_0x868a('0x12'),auth['isAuthenticated'](),controller[_0x868a('0x16')]);router[_0x868a('0x17')](_0x868a('0x18'),auth['isAuthenticated'](),controller[_0x868a('0x19')]);router[_0x868a('0x1a')](_0x868a('0x18'),auth[_0x868a('0xc')](),controller[_0x868a('0x1b')]);router['delete'](_0x868a('0x11'),auth[_0x868a('0xc')](),controller[_0x868a('0x1c')]);module[_0x868a('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 28945a8..2ef7634 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 _0x4e81=['DATE','long','ENUM','out','sequelize','exports','BOOLEAN','thumb','star','TEXT','STRING'];(function(_0x288eaa,_0x5a0c1f){var _0xfa6a0c=function(_0x5c6706){while(--_0x5c6706){_0x288eaa['push'](_0x288eaa['shift']());}};_0xfa6a0c(++_0x5a0c1f);}(_0x4e81,0x1bc));var _0x14e8=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x4e81[_0x12f688];return _0x59c3de;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'closed':{'type':Sequelize[_0x14e8('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM']('star',_0x14e8('0x3')),'defaultValue':_0x14e8('0x4')},'ratingMessage':{'type':Sequelize[_0x14e8('0x5')]},'pathTranscript':{'type':Sequelize[_0x14e8('0x5')]},'mailTranscript':{'type':Sequelize[_0x14e8('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x14e8('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x14e8('0x6')]},'note':{'type':Sequelize[_0x14e8('0x6')]},'browserName':{'type':Sequelize[_0x14e8('0x6')]},'browserVersion':{'type':Sequelize[_0x14e8('0x6')]},'osName':{'type':Sequelize[_0x14e8('0x6')]},'osVersion':{'type':Sequelize[_0x14e8('0x6')]},'deviceModel':{'type':Sequelize[_0x14e8('0x6')]},'deviceVendor':{'type':Sequelize[_0x14e8('0x6')]},'deviceType':{'type':Sequelize[_0x14e8('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x14e8('0x6')]},'formData':{'type':Sequelize[_0x14e8('0x5')](_0x14e8('0x8'))},'read1stAt':{'type':Sequelize[_0x14e8('0x7')]},'lastMsgAt':{'type':Sequelize[_0x14e8('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x14e8('0x9')]('in',_0x14e8('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x14e8('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x14e8('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x705f=['BOOLEAN','ENUM','star','thumb','TEXT','STRING','DATE','long','out'];(function(_0x5d344a,_0x41d02c){var _0xb8c23=function(_0x4be34e){while(--_0x4be34e){_0x5d344a['push'](_0x5d344a['shift']());}};_0xb8c23(++_0x41d02c);}(_0x705f,0x75));var _0xf705=function(_0x209603,_0x351b88){_0x209603=_0x209603-0x0;var _0x3e06d4=_0x705f[_0x209603];return _0x3e06d4;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xf705('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xf705('0x1')](_0xf705('0x2'),_0xf705('0x3')),'defaultValue':_0xf705('0x2')},'ratingMessage':{'type':Sequelize[_0xf705('0x4')]},'pathTranscript':{'type':Sequelize[_0xf705('0x4')]},'mailTranscript':{'type':Sequelize[_0xf705('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf705('0x6')]},'disposition':{'type':Sequelize[_0xf705('0x5')]},'secondDisposition':{'type':Sequelize[_0xf705('0x5')]},'thirdDisposition':{'type':Sequelize[_0xf705('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xf705('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xf705('0x5')]},'deviceModel':{'type':Sequelize[_0xf705('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xf705('0x4')]},'customerIp':{'type':Sequelize[_0xf705('0x5')]},'formData':{'type':Sequelize[_0xf705('0x4')](_0xf705('0x7'))},'read1stAt':{'type':Sequelize[_0xf705('0x6')]},'lastMsgAt':{'type':Sequelize[_0xf705('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xf705('0x1')]('in',_0xf705('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xf705('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xf705('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xf705('0x0')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 4d97f45..ac5d92f 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 _0x3b93=['agent_fullname','[%s]\x20%s:\x20%s\x0a','secret','appendFileSync','MailAccount','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','push','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','download','unix','toString','server','files','attachments','transcript-%d-%s.zip','firstName','createdAt','ChatWebsite','Owner','get','mkdirSync','Account','N.A.','closedAt','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','createWriteStream','lastName','direction','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','update','destroy','name','send','render','merge','body','contact','agent','interaction','map','ChatInteraction','rawAttributes','fieldName','type','getOptions','findAll','chat','query','user','show','model','keys','filters','attributes','intersection','fields','length','includeAll','include','options','create','find','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','parse','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','offline-chat/','join','close','mailTranscript','root','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','User','ChatWebsiteId','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','agent_alias','alias'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x3b93,0x117));var _0x33b9=function(_0x553b1f,_0x3d98ff){_0x553b1f=_0x553b1f-0x0;var _0x249314=_0x3b93[_0x553b1f];return _0x249314;};'use strict';var rimraf=require(_0x33b9('0x0'));var zipdir=require(_0x33b9('0x1'));var rp=require('request-promise');var moment=require(_0x33b9('0x2'));var BPromise=require(_0x33b9('0x3'));var Mustache=require(_0x33b9('0x4'));var util=require(_0x33b9('0x5'));var path=require(_0x33b9('0x6'));var ejs=require(_0x33b9('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x33b9('0x8'));var interaction=require(_0x33b9('0x9'));var qs=require(_0x33b9('0xa'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x33b9('0xb'));var config=require(_0x33b9('0xc'));var db=require('../../mysqldb')['db'];config[_0x33b9('0xd')]=_[_0x33b9('0xe')](config['redis'],{'host':_0x33b9('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33b9('0xd')]));require('./chatInteraction.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x33b9('0x10')][_0x33b9('0x11')]({'port':0x232b});var client9004=jayson[_0x33b9('0x10')][_0x33b9('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x117d30,_0x196611,_0x22307c,_0xd2bb3c){return new BPromise(function(_0x360f9a,_0x1d27c8){var _0x1df204=_0xd2bb3c||client;return _0x1df204[_0x33b9('0x12')](_0x117d30,_0x22307c)[_0x33b9('0x13')](function(_0x48c7fa){logger[_0x33b9('0x14')](_0x33b9('0x15'),_0x196611,_0x33b9('0x16'));logger[_0x33b9('0x17')](_0x33b9('0x18'),_0x196611,_0x33b9('0x16'),JSON['stringify'](_0x48c7fa));if(_0x48c7fa[_0x33b9('0x19')]){if(_0x48c7fa[_0x33b9('0x19')]['code']===0x1f4){logger['error'](_0x33b9('0x15'),_0x196611,_0x48c7fa[_0x33b9('0x19')][_0x33b9('0x1a')]);return _0x1d27c8(_0x48c7fa['error']['message']);}logger[_0x33b9('0x19')](_0x33b9('0x15'),_0x196611,_0x48c7fa[_0x33b9('0x19')][_0x33b9('0x1a')]);return _0x360f9a(_0x48c7fa[_0x33b9('0x19')]['message']);}else{logger[_0x33b9('0x14')](_0x33b9('0x15'),_0x196611,_0x33b9('0x16'));_0x360f9a(_0x48c7fa['result']['message']);}})[_0x33b9('0x1b')](function(_0x4a1f98){logger[_0x33b9('0x19')](_0x33b9('0x15'),_0x196611,_0x4a1f98);_0x1d27c8(_0x4a1f98);});});}function respondWithStatusCode(_0x4649cc,_0x45b853){_0x45b853=_0x45b853||0xcc;return function(_0x35fa97){if(_0x35fa97){return _0x4649cc[_0x33b9('0x1c')](_0x45b853);}return _0x4649cc[_0x33b9('0x1d')](_0x45b853)[_0x33b9('0x1e')]();};}function respondWithResult(_0x1fec9a,_0x29648e){_0x29648e=_0x29648e||0xc8;return function(_0x377421){if(_0x377421){return _0x1fec9a[_0x33b9('0x1d')](_0x29648e)[_0x33b9('0x1f')](_0x377421);}};}function respondWithFilteredResult(_0x25a7dc,_0xadfabc){return function(_0x3066a1){if(_0x3066a1){var _0x39737b=typeof _0xadfabc[_0x33b9('0x20')]==='undefined'&&typeof _0xadfabc[_0x33b9('0x21')]===_0x33b9('0x22');var _0x578fd5=_0x3066a1[_0x33b9('0x23')];var _0x40bca7=_0x39737b?0x0:_0xadfabc['offset'];var _0x555578=_0x39737b?_0x3066a1[_0x33b9('0x23')]:_0xadfabc[_0x33b9('0x20')]+_0xadfabc[_0x33b9('0x21')];var _0x54c5bf;if(_0x555578>=_0x578fd5){_0x555578=_0x578fd5;_0x54c5bf=0xc8;}else{_0x54c5bf=0xce;}_0x25a7dc[_0x33b9('0x1d')](_0x54c5bf);return _0x25a7dc['set']('Content-Range',_0x40bca7+'-'+_0x555578+'/'+_0x578fd5)[_0x33b9('0x1f')](_0x3066a1);}return null;};}function saveUpdates(_0x4491c3){return function(_0x531cc4){if(_0x531cc4){return _0x531cc4[_0x33b9('0x24')](_0x4491c3)['then'](function(_0x45a6a2){return _0x45a6a2;});}return null;};}function removeEntity(_0x3ff9b4){return function(_0x41e6b3){if(_0x41e6b3){return _0x41e6b3[_0x33b9('0x25')]()[_0x33b9('0x13')](function(){_0x3ff9b4[_0x33b9('0x1d')](0xcc)[_0x33b9('0x1e')]();});}};}function handleEntityNotFound(_0x4a3635){return function(_0x3b4e90){if(!_0x3b4e90){_0x4a3635[_0x33b9('0x1c')](0x194);}return _0x3b4e90;};}function handleError(_0x1ca809,_0x54ae42){_0x54ae42=_0x54ae42||0x1f4;return function(_0x3f49c5){logger['error'](_0x3f49c5['stack']);if(_0x3f49c5[_0x33b9('0x26')]){delete _0x3f49c5['name'];}_0x1ca809[_0x33b9('0x1d')](_0x54ae42)[_0x33b9('0x27')](_0x3f49c5);};}function getMustacheRender(_0x3a952a,_0x20af16){return Mustache[_0x33b9('0x28')](_0x3a952a,_[_0x33b9('0x29')](_0x20af16[_0x33b9('0x2a')],{'contact':_0x20af16[_0x33b9('0x2b')],'message':_0x20af16[_0x33b9('0x1a')],'agent':_0x20af16[_0x33b9('0x2c')],'interaction':_0x20af16[_0x33b9('0x2d')],'account':_0x20af16['account']}))||'';}exports['index']=function(_0x55ce2e,_0x29c622){var _0x1aaacc={};var _0x2cb6dc=_[_0x33b9('0x2e')](db[_0x33b9('0x2f')][_0x33b9('0x30')],function(_0x5cc813){return{'name':_0x5cc813[_0x33b9('0x31')],'type':_0x5cc813[_0x33b9('0x32')]['key']};});_0x1aaacc=qs[_0x33b9('0x33')](_0x2cb6dc,_0x55ce2e);return interaction[_0x33b9('0x34')](_0x33b9('0x35'),_0x55ce2e[_0x33b9('0x36')],_0x55ce2e[_0x33b9('0x37')],_0x1aaacc,_0x2cb6dc)[_0x33b9('0x13')](respondWithFilteredResult(_0x29c622,_0x1aaacc))[_0x33b9('0x1b')](handleError(_0x29c622,null));};exports[_0x33b9('0x38')]=function(_0x2b4181,_0x1343da){var _0x1ca7e7={'raw':![],'where':{'id':_0x2b4181['params']['id']}},_0xa8682e={};_0xa8682e[_0x33b9('0x39')]=_['keys'](db[_0x33b9('0x2f')][_0x33b9('0x30')]);_0xa8682e[_0x33b9('0x36')]=_[_0x33b9('0x3a')](_0x2b4181[_0x33b9('0x36')]);_0xa8682e[_0x33b9('0x3b')]=_['intersection'](_0xa8682e[_0x33b9('0x39')],_0xa8682e[_0x33b9('0x36')]);_0x1ca7e7[_0x33b9('0x3c')]=_[_0x33b9('0x3d')](_0xa8682e[_0x33b9('0x39')],qs[_0x33b9('0x3e')](_0x2b4181[_0x33b9('0x36')][_0x33b9('0x3e')]));_0x1ca7e7[_0x33b9('0x3c')]=_0x1ca7e7['attributes'][_0x33b9('0x3f')]?_0x1ca7e7[_0x33b9('0x3c')]:_0xa8682e[_0x33b9('0x39')];if(_0x2b4181[_0x33b9('0x36')][_0x33b9('0x40')]){_0x1ca7e7[_0x33b9('0x41')]=[{'all':!![]}];}_0x1ca7e7=_[_0x33b9('0x29')]({},_0x1ca7e7,_0x2b4181[_0x33b9('0x42')]);return db['ChatInteraction']['find'](_0x1ca7e7)[_0x33b9('0x13')](handleEntityNotFound(_0x1343da,null))['then'](respondWithResult(_0x1343da,null))['catch'](handleError(_0x1343da,null));};exports['create']=function(_0x3ac608,_0x59ef4e){return db['ChatInteraction'][_0x33b9('0x43')](_0x3ac608[_0x33b9('0x2a')],{})[_0x33b9('0x13')](respondWithResult(_0x59ef4e,0xc9))['catch'](handleError(_0x59ef4e,null));};exports[_0x33b9('0x24')]=function(_0x2b74f1,_0x356293){if(_0x2b74f1[_0x33b9('0x2a')]['id']){delete _0x2b74f1[_0x33b9('0x2a')]['id'];}return db[_0x33b9('0x2f')][_0x33b9('0x44')]({'where':{'id':_0x2b74f1[_0x33b9('0x45')]['id']}})[_0x33b9('0x13')](handleEntityNotFound(_0x356293,null))['then'](saveUpdates(_0x2b74f1[_0x33b9('0x2a')],null))[_0x33b9('0x13')](respondWithResult(_0x356293,null))[_0x33b9('0x1b')](handleError(_0x356293,null));};exports[_0x33b9('0x25')]=function(_0x49b8c5,_0x4767fe){return db[_0x33b9('0x2f')][_0x33b9('0x44')]({'where':{'id':_0x49b8c5[_0x33b9('0x45')]['id']}})[_0x33b9('0x13')](handleEntityNotFound(_0x4767fe,null))[_0x33b9('0x13')](removeEntity(_0x4767fe,null))[_0x33b9('0x1b')](handleError(_0x4767fe,null));};exports['describe']=function(_0x5380f2,_0x485b65){return db[_0x33b9('0x2f')][_0x33b9('0x46')]()['then'](respondWithResult(_0x485b65,null))[_0x33b9('0x1b')](handleError(_0x485b65,null));};exports[_0x33b9('0x47')]=function(_0x23d513,_0x6775f9){var _0x19cac5=_0x23d513[_0x33b9('0x45')]['id'];var _0x361293;var _0xfa669d;var _0x140551;return db['ChatInteraction']['findOne']({'where':{'id':_0x19cac5}})[_0x33b9('0x13')](function(_0xe5adc){_0x361293=_0xe5adc;return db['ChatWebsite'][_0x33b9('0x48')]({'where':{'id':_0xe5adc['ChatWebsiteId']},'attributes':['id',_0x33b9('0x49'),_0x33b9('0x4a'),_0x33b9('0x4b'),_0x33b9('0x4c'),'vidaooMetadata'],'raw':!![]});})[_0x33b9('0x13')](function(_0x4ed692){if(_0x4ed692&&_0x4ed692[_0x33b9('0x49')]&&_0x4ed692[_0x33b9('0x4a')]){_0xfa669d=_0x4ed692;var _0x2124fc={'interaction':{'id':_0x19cac5},'agent':{'id':_0x23d513[_0x33b9('0x37')]['id'],'name':_0x23d513[_0x33b9('0x37')][_0x33b9('0x26')],'fullname':_0x23d513['user'][_0x33b9('0x4d')],'email':_0x23d513[_0x33b9('0x37')]['email']},'contact':_0x23d513[_0x33b9('0x2a')]['contact'],'account':_0x23d513[_0x33b9('0x2a')]['account']};var _0x34392a={'rejectUnauthorized':![],'method':_0x33b9('0x4e'),'url':_0x33b9('0x4f'),'headers':{'X-APIKEY':_0x4ed692[_0x33b9('0x49')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x23d513[_0x33b9('0x37')][_0x33b9('0x50')]],'buttons':null,'topic':_0xfa669d[_0x33b9('0x4b')],'note':_[_0x33b9('0x51')](_0xfa669d['vidaooNote'])?null:getMustacheRender(_0xfa669d[_0x33b9('0x4c')],_0x2124fc),'metadata':null},'redirect':_0x33b9('0x52'),'json':!![]};try{if(!_[_0x33b9('0x51')](_0xfa669d[_0x33b9('0x53')])){var _0x25d262=getMustacheRender(_0xfa669d[_0x33b9('0x53')],_0x2124fc);var _0x5222f2=JSON[_0x33b9('0x54')](_0x25d262);_0x34392a['body'][_0x33b9('0x55')]=_0x5222f2;}}catch(_0x307cd8){throw new db['Sequelize'][(_0x33b9('0x56'))](_0x33b9('0x57'));}return rp(_0x34392a);}else{throw new db[(_0x33b9('0x58'))]['ValidationError'](_0x33b9('0x59'));}})[_0x33b9('0x13')](function(_0x9b170d){_0x140551=_0x9b170d;if(_0x140551['id']){var _0x4e40b0={'body':_0x140551[_0x33b9('0x5a')],'ChatWebsiteId':_0xfa669d['id'],'ChatInteractionId':_0x361293['id'],'direction':_0x33b9('0x5b'),'UserId':_0x23d513['user']['id']};return db['ChatMessage'][_0x33b9('0x43')](_0x4e40b0,{});}else{throw new db[(_0x33b9('0x58'))][(_0x33b9('0x56'))](_0x33b9('0x5c'));}})[_0x33b9('0x13')](function(){return _0x361293[_0x33b9('0x5d')]({'vidaooSessionId':_0x140551['id']});})[_0x33b9('0x13')](respondWithResult(_0x6775f9,null))['catch'](handleError(_0x6775f9,null));};exports['customUpdate']=function(_0x6ff65,_0x1f15bf){if(_0x6ff65[_0x33b9('0x2a')]['id']){delete _0x6ff65[_0x33b9('0x2a')]['id'];}return db[_0x33b9('0x2f')]['find']({'where':{'id':_0x6ff65['params']['id']},'include':[{'model':db[_0x33b9('0x5e')],'as':_0x33b9('0x5f')}]})[_0x33b9('0x13')](handleEntityNotFound(_0x1f15bf,null))[_0x33b9('0x13')](saveUpdates(_0x6ff65[_0x33b9('0x2a')],null))['then'](respondWithResult(_0x1f15bf,null))[_0x33b9('0x1b')](handleError(_0x1f15bf,null));};exports[_0x33b9('0x60')]=function(_0x1b56c7,_0x38d3b4){if(_0x1b56c7['body']['id']){delete _0x1b56c7['body']['id'];}return db[_0x33b9('0x2f')]['find']({'where':{'id':_0x1b56c7[_0x33b9('0x45')]['id']}})[_0x33b9('0x13')](function(_0x68e06c){if(!_0x68e06c){logger[_0x33b9('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x33b9('0x60'),0x194,_0x33b9('0x61'));_0x38d3b4[_0x33b9('0x1c')](0x194);}else{if(_0x68e06c[_0x33b9('0x62')]){throw new db[(_0x33b9('0x58'))][(_0x33b9('0x56'))](_0x33b9('0x63'));}}return _0x68e06c;})[_0x33b9('0x13')](function(_0x52f870){if(_0x52f870){return _0x52f870[_0x33b9('0x24')]({'closed':_0x1b56c7[_0x33b9('0x2a')][_0x33b9('0x64')],'disposition':_0x1b56c7[_0x33b9('0x2a')][_0x33b9('0x65')]})[_0x33b9('0x13')](function(_0x274f0c){return _0x274f0c;});}})[_0x33b9('0x13')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x1b56c7[_0x33b9('0x2a')],client9004);})[_0x33b9('0x13')](respondWithResult(_0x38d3b4,null))['catch'](handleError(_0x38d3b4,null));};exports['attachmentUpload']=function(_0x4138bc,_0x46476e){_0x4138bc['body'][_0x33b9('0x26')]=_0x4138bc[_0x33b9('0x66')][_0x33b9('0x67')];_0x4138bc[_0x33b9('0x2a')][_0x33b9('0x68')]=_0x4138bc[_0x33b9('0x66')][_0x33b9('0x69')];_0x4138bc[_0x33b9('0x2a')]['type']=_0x4138bc[_0x33b9('0x66')][_0x33b9('0x6a')];return db[_0x33b9('0x6b')][_0x33b9('0x43')](_0x4138bc[_0x33b9('0x2a')])['then'](respondWithResult(_0x46476e,0xc9))[_0x33b9('0x1b')](handleError(_0x46476e,null));};exports[_0x33b9('0x6c')]=function(_0x1899f4,_0x56cc0d){return db[_0x33b9('0x2f')][_0x33b9('0x48')]({'where':{'id':_0x1899f4[_0x33b9('0x45')]['id']},'raw':!![]})[_0x33b9('0x13')](handleEntityNotFound(_0x56cc0d,null))[_0x33b9('0x13')](function(_0x19db4e){if(_0x19db4e){if(_0x19db4e[_0x33b9('0x64')]){return _0x56cc0d[_0x33b9('0x1d')](0x193)[_0x33b9('0x1f')]({'status':0x193,'message':_0x33b9('0x6d')});}return db[_0x33b9('0x6b')][_0x33b9('0x48')]({'where':{'id':_0x1899f4[_0x33b9('0x36')][_0x33b9('0x6e')]},'raw':!![]})[_0x33b9('0x13')](handleEntityNotFound(_0x56cc0d,null));}})[_0x33b9('0x13')](function(_0x68dc9){if(_0x68dc9){var _0x4e7598=_0x68dc9['ChatOfflineMessageId']!==null;var _0x2f0df1=path['join'](config['root'],'server/files/attachments/');if(_0x4e7598){_0x2f0df1=path['join'](_0x2f0df1,_0x33b9('0x6f'));}var _0x5c76b0=path[_0x33b9('0x70')](_0x2f0df1,_0x68dc9[_0x33b9('0x68')]);return _0x56cc0d['download'](_0x5c76b0);}})['catch'](handleError(_0x56cc0d,null));};exports[_0x33b9('0x71')]=function(_0x2f839a,_0xa9740a){var _0x5bde69=null;var _0x503b98=null;var _0x3f00e0=null;if(_0x2f839a['body']['id']){delete _0x2f839a[_0x33b9('0x2a')]['id'];}if(_0x2f839a[_0x33b9('0x2a')][_0x33b9('0x72')]){_0x3f00e0=path[_0x33b9('0x70')](config[_0x33b9('0x73')],_0x33b9('0x74'),util[_0x33b9('0x75')]('transcript-%s.txt',Date[_0x33b9('0x76')]()));_0x2f839a[_0x33b9('0x2a')][_0x33b9('0x77')]=_0x3f00e0;}return db[_0x33b9('0x2f')][_0x33b9('0x44')]({'where':{'id':_0x2f839a['params']['id']},'include':[{'model':db[_0x33b9('0x78')],'as':_0x33b9('0x79'),'include':[{'model':db[_0x33b9('0x7a')],'as':_0x33b9('0x7a')}]}]})[_0x33b9('0x13')](handleEntityNotFound(_0xa9740a,null))[_0x33b9('0x13')](saveUpdates(_0x2f839a[_0x33b9('0x2a')],null))['then'](function(_0x57aee8){if(_0x57aee8){_0x5bde69=_0x57aee8;return db['ChatWebsite']['find']({'where':{'id':_0x5bde69[_0x33b9('0x7b')]}});}})[_0x33b9('0x13')](function(_0x2801ec){if(_0x2801ec){_0x503b98=_0x2801ec;return db[_0x33b9('0x5e')][_0x33b9('0x44')]({'where':{'id':_0x5bde69[_0x33b9('0x7c')]}});}})[_0x33b9('0x13')](function(_0x25ebab){if(_0x25ebab){if(_0x3f00e0){var _0x5f2dbb=null;for(var _0x17f8eb=0x1;_0x17f8eb<_0x5bde69[_0x33b9('0x79')]['length'];++_0x17f8eb){_0x5f2dbb=_0x5bde69[_0x33b9('0x79')][_0x17f8eb];var _0x3a56af=_0x5f2dbb[_0x33b9('0x62')]?util['format'](_0x33b9('0x7d'),_0x503b98[_0x33b9('0x7e')],_0x5f2dbb['UserId']):_0x33b9('0x7f');var _0x21c680=_0x2f839a[_0x33b9('0x2a')][_0x33b9('0x80')]||util[_0x33b9('0x75')](_0x33b9('0x7d'),_0x33b9('0x81'),_0x5f2dbb['ContactId']);switch(_0x503b98[_0x33b9('0x82')]){case'website_alias':_0x3a56af=_0x5f2dbb['UserId']?util[_0x33b9('0x75')](_0x33b9('0x7d'),_0x503b98[_0x33b9('0x7e')],_0x5f2dbb[_0x33b9('0x62')]):'System';break;case _0x33b9('0x83'):_0x3a56af=_0x5f2dbb[_0x33b9('0x62')]?_0x5f2dbb[_0x33b9('0x7a')][_0x33b9('0x84')]||_0x5f2dbb[_0x33b9('0x7a')]['fullname']:_0x33b9('0x7f');break;case _0x33b9('0x85'):_0x3a56af=_0x5f2dbb['UserId']?_0x5f2dbb[_0x33b9('0x7a')][_0x33b9('0x4d')]:_0x33b9('0x7f');break;default:_0x3a56af=_0x5f2dbb['UserId']?util[_0x33b9('0x75')](_0x33b9('0x7d'),_0x503b98[_0x33b9('0x7e')],_0x5f2dbb[_0x33b9('0x62')]):_0x33b9('0x7f');}var _0x5433dc=util[_0x33b9('0x75')](_0x33b9('0x86'),moment(_0x5f2dbb['createdAt'])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x5f2dbb['direction']==='in'?_0x21c680:_0x3a56af,_0x5f2dbb[_0x33b9('0x2a')]);if(!_0x5f2dbb[_0x33b9('0x87')]){fs[_0x33b9('0x88')](_0x3f00e0,_0x5433dc);}}return db[_0x33b9('0x89')][_0x33b9('0x48')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x33b9('0x8a')],'as':_0x33b9('0x8a'),'raw':!![]}]}]});}}})[_0x33b9('0x13')](function(_0x495564){if(!_0x495564||!_0x495564[_0x33b9('0x8b')]||!_0x2f839a[_0x33b9('0x2a')])return _0x5bde69;var _0x4a72e8=_0x495564[_0x33b9('0x8c')]();return respondWithRpcPromise(_0x33b9('0x8d'),_0x33b9('0x8e'),{'account':_0x4a72e8,'message':{'from':util[_0x33b9('0x75')](_0x33b9('0x8f'),_0x495564[_0x33b9('0x26')],_0x495564[_0x33b9('0x50')]||_0x495564[_0x33b9('0x8b')][_0x33b9('0x37')]),'to':_0x2f839a['body'][_0x33b9('0x72')],'subject':_0x33b9('0x90'),'text':util['format'](_0x33b9('0x91'),_0x2f839a['body'][_0x33b9('0x72')]),'attachments':[{'path':_0x3f00e0}]}})[_0x33b9('0x13')](function(){return _0x5bde69;})[_0x33b9('0x1b')](function(_0x1fbc6e){logger[_0x33b9('0x19')](_0x1fbc6e);});})['then'](respondWithStatusCode(_0xa9740a,0xc8))[_0x33b9('0x1b')](handleError(_0xa9740a,null));};exports[_0x33b9('0x92')]=function(_0x1bd61e,_0x5dc1d1){return db['ChatMessage'][_0x33b9('0x44')]({'where':{'id':_0x1bd61e[_0x33b9('0x45')]['id']}})[_0x33b9('0x13')](handleEntityNotFound(_0x5dc1d1,null))[_0x33b9('0x13')](function(_0x3b9dda){if(_0x3b9dda){return _0x3b9dda['addMessage'](_0x1bd61e[_0x33b9('0x2a')][_0x33b9('0x93')],_[_0x33b9('0x94')](_0x1bd61e[_0x33b9('0x2a')],[_0x33b9('0x93'),'id'])||{});}})[_0x33b9('0x13')](respondWithResult(_0x5dc1d1,null))['catch'](handleError(_0x5dc1d1,null));};exports[_0x33b9('0x95')]=function(_0x10b4a5,_0x4e76d4){var _0x1a7a02={'raw':![],'where':{}};var _0x176508={};var _0x17bd7f={'count':0x0,'rows':[]};return db[_0x33b9('0x2f')][_0x33b9('0x48')]({'where':{'id':_0x10b4a5[_0x33b9('0x45')]['id']}})[_0x33b9('0x13')](handleEntityNotFound(_0x4e76d4,null))[_0x33b9('0x13')](function(_0x4a4a50){if(_0x4a4a50){_0x176508[_0x33b9('0x39')]=_['keys'](db[_0x33b9('0x78')][_0x33b9('0x30')]);_0x176508[_0x33b9('0x36')]=_[_0x33b9('0x3a')](_0x10b4a5[_0x33b9('0x36')]);_0x176508[_0x33b9('0x3b')]=_[_0x33b9('0x3d')](_0x176508['model'],_0x176508[_0x33b9('0x36')]);_0x1a7a02[_0x33b9('0x3c')]=_[_0x33b9('0x3d')](_0x176508[_0x33b9('0x39')],qs['fields'](_0x10b4a5[_0x33b9('0x36')][_0x33b9('0x3e')]));_0x1a7a02[_0x33b9('0x3c')]=_0x1a7a02[_0x33b9('0x3c')]['length']?_0x1a7a02[_0x33b9('0x3c')]:_0x176508[_0x33b9('0x39')];if(!_0x10b4a5[_0x33b9('0x36')][_0x33b9('0x96')](_0x33b9('0x97'))){_0x1a7a02['limit']=qs[_0x33b9('0x21')](_0x10b4a5[_0x33b9('0x36')][_0x33b9('0x21')]);_0x1a7a02[_0x33b9('0x20')]=qs[_0x33b9('0x20')](_0x10b4a5[_0x33b9('0x36')]['offset']);}_0x1a7a02[_0x33b9('0x98')]=qs['sort'](_0x10b4a5[_0x33b9('0x36')][_0x33b9('0x99')]);_0x1a7a02[_0x33b9('0x9a')]=qs['filters'](_[_0x33b9('0x9b')](_0x10b4a5[_0x33b9('0x36')],_0x176508[_0x33b9('0x3b')]));_0x1a7a02[_0x33b9('0x9a')][_0x33b9('0x9c')]=_0x4a4a50['id'];if(_0x10b4a5[_0x33b9('0x36')][_0x33b9('0x9d')]){_0x1a7a02[_0x33b9('0x9a')]=_['merge'](_0x1a7a02[_0x33b9('0x9a')],{'$or':_[_0x33b9('0x2e')](_0x1a7a02[_0x33b9('0x3c')],function(_0x5221fa){var _0x3c4201={};_0x3c4201[_0x5221fa]={'$like':'%'+_0x10b4a5[_0x33b9('0x36')][_0x33b9('0x9d')]+'%'};return _0x3c4201;})});}if(_0x10b4a5[_0x33b9('0x36')][_0x33b9('0x9e')]){var _0x3ce0bf=_0x10b4a5[_0x33b9('0x36')][_0x33b9('0x9e')][_0x33b9('0x9f')](',');var _0x2d3942={};_0x2d3942[_0x3ce0bf[0x0]]={'$gte':moment(_0x3ce0bf[0x1])[_0x33b9('0x75')](_0x33b9('0xa0'))};_0x1a7a02[_0x33b9('0x9a')]=_[_0x33b9('0x29')](_0x1a7a02[_0x33b9('0x9a')],_0x2d3942);}_0x1a7a02=_[_0x33b9('0x29')]({},_0x1a7a02,_0x10b4a5[_0x33b9('0x42')]);return db[_0x33b9('0x78')][_0x33b9('0x23')]({'where':_0x1a7a02['where']})[_0x33b9('0x13')](function(_0x2fe2d4){_0x17bd7f['count']=_0x2fe2d4;if(_0x10b4a5[_0x33b9('0x36')]['includeAll']){_0x1a7a02[_0x33b9('0x41')]=[{'all':!![]}];}return db[_0x33b9('0x78')][_0x33b9('0x34')](_0x1a7a02);})[_0x33b9('0x13')](function(_0x433633){_0x17bd7f[_0x33b9('0xa1')]=_0x433633;return _0x17bd7f;});}})['then'](respondWithFilteredResult(_0x4e76d4,_0x1a7a02))['catch'](handleError(_0x4e76d4,null));};exports[_0x33b9('0xa2')]=function(_0x2e2017,_0x5b2e04){var _0x35f96e={'where':{}},_0x9e042a={},_0x3a292c={'count':0x0,'rows':[]};return db[_0x33b9('0x2f')][_0x33b9('0x48')]({'where':{'id':_0x2e2017[_0x33b9('0x45')]['id']}})[_0x33b9('0x13')](handleEntityNotFound(_0x5b2e04,null))[_0x33b9('0x13')](function(_0x23302f){if(_0x23302f){_0x9e042a[_0x33b9('0x39')]=_[_0x33b9('0x3a')](db[_0x33b9('0x78')][_0x33b9('0x30')]);_0x9e042a[_0x33b9('0x36')]=_['keys'](_0x2e2017[_0x33b9('0x36')]);_0x9e042a[_0x33b9('0x3b')]=_[_0x33b9('0x3d')](_0x9e042a['model'],_0x9e042a['query']);_0x35f96e[_0x33b9('0x3c')]=_['intersection'](_0x9e042a[_0x33b9('0x39')],qs[_0x33b9('0x3e')](_0x2e2017[_0x33b9('0x36')]['fields']));_0x35f96e['attributes']=_0x35f96e[_0x33b9('0x3c')][_0x33b9('0x3f')]?_0x35f96e[_0x33b9('0x3c')]:_0x9e042a['model'];if(!_0x2e2017[_0x33b9('0x36')]['hasOwnProperty'](_0x33b9('0x97'))){_0x35f96e[_0x33b9('0x21')]=qs[_0x33b9('0x21')](_0x2e2017[_0x33b9('0x36')][_0x33b9('0x21')]);_0x35f96e['offset']=qs[_0x33b9('0x20')](_0x2e2017[_0x33b9('0x36')][_0x33b9('0x20')]);}_0x35f96e[_0x33b9('0x98')]=qs['sort'](_0x2e2017[_0x33b9('0x36')]['sort']);_0x35f96e['where']=qs[_0x33b9('0x3b')](_[_0x33b9('0x9b')](_0x2e2017[_0x33b9('0x36')],_0x9e042a[_0x33b9('0x3b')]));_0x35f96e[_0x33b9('0x9a')][_0x33b9('0x9c')]=_0x23302f['id'];if(_0x2e2017[_0x33b9('0x36')][_0x33b9('0x9d')]){_0x35f96e[_0x33b9('0x9a')]=_[_0x33b9('0x29')](_0x35f96e['where'],{'$or':_['map'](_0x35f96e[_0x33b9('0x3c')],function(_0x117bdc){var _0x37fdbf={};_0x37fdbf[_0x117bdc]={'$like':'%'+_0x2e2017[_0x33b9('0x36')]['filter']+'%'};return _0x37fdbf;})});}_0x35f96e[_0x33b9('0x9a')][_0x33b9('0x87')]=![];if(_0x2e2017['query']['id']){_0x35f96e[_0x33b9('0x9a')]['id']={'$gt':_0x2e2017[_0x33b9('0x36')]['id']};}_0x35f96e=_[_0x33b9('0x29')]({},_0x35f96e,_0x2e2017[_0x33b9('0x42')]);return db[_0x33b9('0x78')][_0x33b9('0x23')]({'where':_0x35f96e[_0x33b9('0x9a')]})[_0x33b9('0x13')](function(_0x24a9df){_0x3a292c[_0x33b9('0x23')]=_0x24a9df;_0x35f96e[_0x33b9('0x41')]=[];if(_0x2e2017[_0x33b9('0x36')][_0x33b9('0xa3')]){_0x35f96e[_0x33b9('0x41')][_0x33b9('0xa4')]({'model':db[_0x33b9('0x7a')],'as':_0x33b9('0x7a'),'attributes':['id',_0x33b9('0x4d'),_0x33b9('0x84')]});}if(_0x2e2017['query'][_0x33b9('0x40')]){_0x35f96e['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x35f96e);})['then'](function(_0x246bd0){_0x3a292c[_0x33b9('0xa1')]=_0x246bd0;return _0x3a292c;});}})[_0x33b9('0x13')](respondWithFilteredResult(_0x5b2e04,_0x35f96e))[_0x33b9('0x1b')](handleError(_0x5b2e04,null));};exports[_0x33b9('0xa5')]=function(_0x4053ca,_0x527b54){return db[_0x33b9('0x2f')][_0x33b9('0x44')]({'where':{'id':_0x4053ca[_0x33b9('0x45')]['id']}})['then'](handleEntityNotFound(_0x527b54,null))[_0x33b9('0x13')](function(_0x538301){if(_0x538301){return _0x538301[_0x33b9('0xa6')](_0x4053ca[_0x33b9('0x2a')][_0x33b9('0x93')],_[_0x33b9('0x94')](_0x4053ca[_0x33b9('0x2a')],[_0x33b9('0x93'),'id'])||{})[_0x33b9('0xa7')](function(){return db[_0x33b9('0xa8')]['findAll']({'attributes':['id',_0x33b9('0x26'),'color'],'where':{'id':_0x4053ca[_0x33b9('0x2a')][_0x33b9('0x93')]}});})[_0x33b9('0x13')](function(_0x2abecd){socket['emit'](_0x33b9('0xa9'),{'id':Number(_0x4053ca[_0x33b9('0x45')]['id']),'tags':_0x2abecd||[]});return{'id':Number(_0x4053ca['params']['id']),'tags':_0x2abecd||[]};});}})[_0x33b9('0x13')](respondWithResult(_0x527b54,null))[_0x33b9('0x1b')](handleError(_0x527b54,null));};exports[_0x33b9('0xaa')]=function(_0x27e6d3,_0x93cbb6){return db[_0x33b9('0x2f')]['find']({'where':{'id':_0x27e6d3[_0x33b9('0x45')]['id']}})['then'](handleEntityNotFound(_0x93cbb6,null))[_0x33b9('0x13')](function(_0x3cc586){if(_0x3cc586){return _0x3cc586[_0x33b9('0xaa')](_0x27e6d3['query'][_0x33b9('0x93')]);}})[_0x33b9('0x13')](respondWithStatusCode(_0x93cbb6,null))['catch'](handleError(_0x93cbb6,null));};exports[_0x33b9('0xab')]=function(_0x8f7ab9,_0x24b8c2){var _0x815649=moment()[_0x33b9('0xac')]()[_0x33b9('0xad')]();var _0x5a9e59=path[_0x33b9('0x70')](config[_0x33b9('0x73')],_0x33b9('0xae'),_0x33b9('0xaf'),'tmp');var _0x2554b5=path['join'](config[_0x33b9('0x73')],_0x33b9('0xae'),_0x33b9('0xaf'),_0x33b9('0xb0'));var _0x3eb78b=path[_0x33b9('0x70')](_0x5a9e59,_0x815649);var _0x45d960=util['format'](_0x33b9('0xb1'),_0x8f7ab9[_0x33b9('0x45')]['id'],_0x815649);var _0x37ee68=path[_0x33b9('0x70')](_0x5a9e59,_0x45d960);var _0xef6ee0=[];_0xef6ee0[_0x33b9('0xa4')]({'model':db[_0x33b9('0x7a')],'as':_0x33b9('0x7a'),'attributes':['id',_0x33b9('0x4d')],'raw':!![]});_0xef6ee0[_0x33b9('0xa4')]({'model':db[_0x33b9('0x5e')],'as':_0x33b9('0x5f'),'attributes':['id',_0x33b9('0xb2'),'lastName'],'raw':!![]});if(_0x8f7ab9[_0x33b9('0x36')][_0x33b9('0xb0')]){_0xef6ee0[_0x33b9('0xa4')]({'model':db[_0x33b9('0x6b')],'as':'Attachment','raw':!![]});}var _0x2fb400=[{'model':db[_0x33b9('0x78')],'as':'Messages','attributes':['id','body',_0x33b9('0xb3'),'direction',_0x33b9('0x87'),'read'],'include':_0xef6ee0}];_0x2fb400[_0x33b9('0xa4')]({'model':db[_0x33b9('0xb4')],'as':'Account','attributes':['id',_0x33b9('0x26')]});_0x2fb400[_0x33b9('0xa4')]({'model':db[_0x33b9('0x7a')],'as':_0x33b9('0xb5'),'attributes':['id',_0x33b9('0x4d')]});return db[_0x33b9('0x2f')][_0x33b9('0x44')]({'where':{'id':_0x8f7ab9[_0x33b9('0x45')]['id']},'include':_0x2fb400})[_0x33b9('0x13')](handleEntityNotFound(_0x24b8c2,null))[_0x33b9('0x13')](function(_0x59cd2a){if(_0x59cd2a){var _0x2b394a=_0x59cd2a[_0x33b9('0xb6')]({'plain':!![]});fs[_0x33b9('0xb7')](_0x3eb78b);var _0x4d995d={'channel':'Chat','account':_0x2b394a[_0x33b9('0xb8')][_0x33b9('0x26')],'agent':_0x2b394a[_0x33b9('0xb5')]?_0x2b394a[_0x33b9('0xb5')][_0x33b9('0x4d')]:_0x33b9('0xb9'),'createdAt':moment(_0x2b394a[_0x33b9('0xb3')])[_0x33b9('0x75')](_0x33b9('0xa0'))[_0x33b9('0xad')](),'closedAt':_0x2b394a[_0x33b9('0x64')]?moment(_0x2b394a[_0x33b9('0xba')])[_0x33b9('0x75')](_0x33b9('0xa0'))[_0x33b9('0xad')]():'','disposition':_0x2b394a['disposition'],'chatInfo':{'browser':_0x2b394a[_0x33b9('0xbb')],'os':_0x2b394a[_0x33b9('0xbc')],'referer':_0x2b394a[_0x33b9('0xbd')],'customerIp':_0x2b394a['customerIp'],'customerPort':_0x2b394a[_0x33b9('0xbe')]?_0x2b394a[_0x33b9('0xbe')]:'N.A.'},'messages':_(_0x2b394a[_0x33b9('0x79')])[_0x33b9('0xbf')]()[_0x33b9('0x9d')]({'secret':![]})['map'](function(_0x4b8fab){if(_0x4b8fab[_0x33b9('0x6b')]){var _0xc5eb37=path[_0x33b9('0x70')](_0x2554b5,_0x4b8fab[_0x33b9('0x6b')]['basename']);if(fs[_0x33b9('0xc0')](_0xc5eb37)){fs[_0x33b9('0xc1')](_0xc5eb37)['pipe'](fs[_0x33b9('0xc2')](path[_0x33b9('0x70')](_0x3eb78b,_0x4b8fab[_0x33b9('0x6b')][_0x33b9('0x68')])));}}return{'date':moment(_0x4b8fab[_0x33b9('0xb3')])['format'](_0x33b9('0xa0'))['toString'](),'sender':_0x4b8fab['direction']==='out'?_0x4b8fab[_0x33b9('0x7a')]?_0x4b8fab[_0x33b9('0x7a')]['fullname']:_0x33b9('0x7f'):_0x4b8fab[_0x33b9('0x5f')][_0x33b9('0xb2')]+(_0x4b8fab[_0x33b9('0x5f')][_0x33b9('0xc3')]?'\x20'+_0x4b8fab['Contact'][_0x33b9('0xc3')]:''),'body':_0x4b8fab['Attachment']?_0x4b8fab[_0x33b9('0x6b')][_0x33b9('0x68')]:_0x4b8fab[_0x33b9('0x2a')],'direction':_0x4b8fab[_0x33b9('0xc4')]===_0x33b9('0x5b')?'A':'C','secret':_0x4b8fab['secret'],'read':_0x4b8fab[_0x33b9('0xc5')],'attachment':_0x4b8fab[_0x33b9('0x6b')]};})[_0x33b9('0xc6')]()};return ejs[_0x33b9('0xc7')](path[_0x33b9('0x70')](config[_0x33b9('0x73')],_0x33b9('0xae'),_0x33b9('0xc8'),_0x33b9('0xc9')),{'interaction':_0x4d995d})[_0x33b9('0x13')](function(_0x571747){var _0x1aee3c=path[_0x33b9('0x70')](_0x3eb78b,_0x33b9('0xca')+_0x2b394a['id']+'-'+_0x815649+_0x33b9('0xcb'));var _0x183f15={'path':_0x1aee3c,'channel':'Chat','interactionId':_0x2b394a['id']};return pdf['createPdfFromHTML'](_0x571747,_0x183f15);})[_0x33b9('0x13')](function(){return new Promise(function(_0x43e536,_0x1a61a8){zipdir(_0x3eb78b,{'saveTo':_0x37ee68},function(_0xb7b9fd,_0x2e99ba){if(_0xb7b9fd)return _0x1a61a8(_0xb7b9fd);return _0x43e536(_0x2e99ba);});})['then'](function(){return new BPromise(function(_0x431c46,_0x1fa80a){rimraf(_0x3eb78b,function(_0x5a05c8){if(_0x5a05c8)_0x1fa80a(_0x5a05c8);return _0x431c46();});});})[_0x33b9('0x13')](function(){return _0x24b8c2[_0x33b9('0xab')](_0x37ee68,_0x45d960,function(_0x507ae6){if(_0x507ae6){logger[_0x33b9('0x19')](_0x33b9('0xcc'),_0x507ae6);}else{fs[_0x33b9('0xcd')](_0x37ee68);}});});});}else{return _0x24b8c2[_0x33b9('0x1c')](0xc8);}})[_0x33b9('0x1b')](handleError(_0x24b8c2,null));}; \ No newline at end of file +var _0x6182=['stack','name','send','render','body','contact','agent','account','index','map','ChatInteraction','rawAttributes','fieldName','type','getOptions','findAll','query','user','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooNote','vidaooMetadata','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','vidaooTopic','isNull','follow','parse','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','file','originalname','basename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','format','pathTranscript','Messages','User','ContactId','%s%d','agentAlias','System','Visitor','agentIdentifier','agent_alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','nolimit','includeAgent','push','addTags','setTags','spread','Tag','color','emit','removeTags','unix','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','read','Account','mkdirSync','Chat','Owner','N.A.','toString','closedAt','osName','referer','customerIp','customerPort','createReadStream','pipe','out','lastName','value','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','../../components/export/pdf','../../config/environment','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','update','destroy','end'];(function(_0x3eff21,_0x5bf36c){var _0x1945bb=function(_0x319a9e){while(--_0x319a9e){_0x3eff21['push'](_0x3eff21['shift']());}};_0x1945bb(++_0x5bf36c);}(_0x6182,0x171));var _0x2618=function(_0x45146c,_0xc5be9c){_0x45146c=_0x45146c-0x0;var _0x2d2c89=_0x6182[_0x45146c];return _0x2d2c89;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x2618('0x0'));var rp=require(_0x2618('0x1'));var moment=require(_0x2618('0x2'));var BPromise=require(_0x2618('0x3'));var Mustache=require(_0x2618('0x4'));var util=require(_0x2618('0x5'));var path=require(_0x2618('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2618('0x7'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x2618('0x8'));var logger=require('../../config/logger')('api');var config=require(_0x2618('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x2618('0xa')],{'host':_0x2618('0xb'),'port':0x18eb});var socket=require(_0x2618('0xc'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x2618('0xd')](socket);var jayson=require(_0x2618('0xe'));var client=jayson['client'][_0x2618('0xf')]({'port':0x232b});var client9004=jayson[_0x2618('0x10')][_0x2618('0xf')]({'port':0x232c});function respondWithRpcPromise(_0x548919,_0x5f4a26,_0x48c856,_0x786bd){return new BPromise(function(_0x40a79e,_0x5a351d){var _0xdb3e98=_0x786bd||client;return _0xdb3e98[_0x2618('0x11')](_0x548919,_0x48c856)[_0x2618('0x12')](function(_0x5b527d){logger[_0x2618('0x13')](_0x2618('0x14'),_0x5f4a26,_0x2618('0x15'));logger[_0x2618('0x16')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5f4a26,_0x2618('0x15'),JSON[_0x2618('0x17')](_0x5b527d));if(_0x5b527d[_0x2618('0x18')]){if(_0x5b527d[_0x2618('0x18')][_0x2618('0x19')]===0x1f4){logger[_0x2618('0x18')](_0x2618('0x14'),_0x5f4a26,_0x5b527d[_0x2618('0x18')][_0x2618('0x1a')]);return _0x5a351d(_0x5b527d[_0x2618('0x18')][_0x2618('0x1a')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5f4a26,_0x5b527d[_0x2618('0x18')][_0x2618('0x1a')]);return _0x40a79e(_0x5b527d[_0x2618('0x18')]['message']);}else{logger[_0x2618('0x13')](_0x2618('0x14'),_0x5f4a26,_0x2618('0x15'));_0x40a79e(_0x5b527d[_0x2618('0x1b')]['message']);}})[_0x2618('0x1c')](function(_0x868f6f){logger[_0x2618('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x5f4a26,_0x868f6f);_0x5a351d(_0x868f6f);});});}function respondWithStatusCode(_0xe848ec,_0x503079){_0x503079=_0x503079||0xcc;return function(_0x43ad9d){if(_0x43ad9d){return _0xe848ec[_0x2618('0x1d')](_0x503079);}return _0xe848ec[_0x2618('0x1e')](_0x503079)['end']();};}function respondWithResult(_0x334403,_0x1d297b){_0x1d297b=_0x1d297b||0xc8;return function(_0x58dd32){if(_0x58dd32){return _0x334403[_0x2618('0x1e')](_0x1d297b)[_0x2618('0x1f')](_0x58dd32);}};}function respondWithFilteredResult(_0x37a26e,_0x151c02){return function(_0x5c6a40){if(_0x5c6a40){var _0x1d9790=typeof _0x151c02[_0x2618('0x20')]===_0x2618('0x21')&&typeof _0x151c02[_0x2618('0x22')]==='undefined';var _0x574575=_0x5c6a40[_0x2618('0x23')];var _0x476b12=_0x1d9790?0x0:_0x151c02[_0x2618('0x20')];var _0x3b6c6a=_0x1d9790?_0x5c6a40[_0x2618('0x23')]:_0x151c02[_0x2618('0x20')]+_0x151c02['limit'];var _0x4f3933;if(_0x3b6c6a>=_0x574575){_0x3b6c6a=_0x574575;_0x4f3933=0xc8;}else{_0x4f3933=0xce;}_0x37a26e['status'](_0x4f3933);return _0x37a26e['set']('Content-Range',_0x476b12+'-'+_0x3b6c6a+'/'+_0x574575)[_0x2618('0x1f')](_0x5c6a40);}return null;};}function saveUpdates(_0x47cb39){return function(_0x27b43d){if(_0x27b43d){return _0x27b43d[_0x2618('0x24')](_0x47cb39)[_0x2618('0x12')](function(_0x348e36){return _0x348e36;});}return null;};}function removeEntity(_0x541692){return function(_0x5976d2){if(_0x5976d2){return _0x5976d2[_0x2618('0x25')]()['then'](function(){_0x541692['status'](0xcc)[_0x2618('0x26')]();});}};}function handleEntityNotFound(_0x259ba4){return function(_0x417d0c){if(!_0x417d0c){_0x259ba4[_0x2618('0x1d')](0x194);}return _0x417d0c;};}function handleError(_0x1e5138,_0x1d4341){_0x1d4341=_0x1d4341||0x1f4;return function(_0x43c010){logger[_0x2618('0x18')](_0x43c010[_0x2618('0x27')]);if(_0x43c010[_0x2618('0x28')]){delete _0x43c010[_0x2618('0x28')];}_0x1e5138[_0x2618('0x1e')](_0x1d4341)[_0x2618('0x29')](_0x43c010);};}function getMustacheRender(_0x4acb1a,_0x5a18f8){return Mustache[_0x2618('0x2a')](_0x4acb1a,_['merge'](_0x5a18f8[_0x2618('0x2b')],{'contact':_0x5a18f8[_0x2618('0x2c')],'message':_0x5a18f8[_0x2618('0x1a')],'agent':_0x5a18f8[_0x2618('0x2d')],'interaction':_0x5a18f8['interaction'],'account':_0x5a18f8[_0x2618('0x2e')]}))||'';}exports[_0x2618('0x2f')]=function(_0x512a19,_0x3c47d0){var _0x247182={};var _0x51a534=_[_0x2618('0x30')](db[_0x2618('0x31')][_0x2618('0x32')],function(_0x17b6ea){return{'name':_0x17b6ea[_0x2618('0x33')],'type':_0x17b6ea[_0x2618('0x34')]['key']};});_0x247182=qs[_0x2618('0x35')](_0x51a534,_0x512a19);return interaction[_0x2618('0x36')]('chat',_0x512a19[_0x2618('0x37')],_0x512a19[_0x2618('0x38')],_0x247182,_0x51a534)[_0x2618('0x12')](respondWithFilteredResult(_0x3c47d0,_0x247182))['catch'](handleError(_0x3c47d0,null));};exports[_0x2618('0x39')]=function(_0x39067e,_0x4b61ce){var _0x16cc80={'raw':![],'where':{'id':_0x39067e[_0x2618('0x3a')]['id']}},_0xad01d1={};_0xad01d1[_0x2618('0x3b')]=_[_0x2618('0x3c')](db[_0x2618('0x31')]['rawAttributes']);_0xad01d1['query']=_[_0x2618('0x3c')](_0x39067e[_0x2618('0x37')]);_0xad01d1[_0x2618('0x3d')]=_[_0x2618('0x3e')](_0xad01d1['model'],_0xad01d1[_0x2618('0x37')]);_0x16cc80['attributes']=_['intersection'](_0xad01d1['model'],qs['fields'](_0x39067e['query'][_0x2618('0x3f')]));_0x16cc80[_0x2618('0x40')]=_0x16cc80[_0x2618('0x40')][_0x2618('0x41')]?_0x16cc80['attributes']:_0xad01d1[_0x2618('0x3b')];if(_0x39067e[_0x2618('0x37')][_0x2618('0x42')]){_0x16cc80[_0x2618('0x43')]=[{'all':!![]}];}_0x16cc80=_[_0x2618('0x44')]({},_0x16cc80,_0x39067e[_0x2618('0x45')]);return db[_0x2618('0x31')][_0x2618('0x46')](_0x16cc80)[_0x2618('0x12')](handleEntityNotFound(_0x4b61ce,null))['then'](respondWithResult(_0x4b61ce,null))[_0x2618('0x1c')](handleError(_0x4b61ce,null));};exports[_0x2618('0x47')]=function(_0x34faba,_0x58134a){return db[_0x2618('0x31')][_0x2618('0x47')](_0x34faba[_0x2618('0x2b')],{})[_0x2618('0x12')](respondWithResult(_0x58134a,0xc9))[_0x2618('0x1c')](handleError(_0x58134a,null));};exports[_0x2618('0x24')]=function(_0xe6b85d,_0x1cf0a4){if(_0xe6b85d[_0x2618('0x2b')]['id']){delete _0xe6b85d['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0xe6b85d['params']['id']}})['then'](handleEntityNotFound(_0x1cf0a4,null))['then'](saveUpdates(_0xe6b85d[_0x2618('0x2b')],null))[_0x2618('0x12')](respondWithResult(_0x1cf0a4,null))[_0x2618('0x1c')](handleError(_0x1cf0a4,null));};exports[_0x2618('0x25')]=function(_0x531130,_0x2b722c){return db[_0x2618('0x31')][_0x2618('0x46')]({'where':{'id':_0x531130['params']['id']}})[_0x2618('0x12')](handleEntityNotFound(_0x2b722c,null))['then'](removeEntity(_0x2b722c,null))['catch'](handleError(_0x2b722c,null));};exports[_0x2618('0x48')]=function(_0x1faf27,_0x4a7c30){return db[_0x2618('0x31')][_0x2618('0x48')]()[_0x2618('0x12')](respondWithResult(_0x4a7c30,null))[_0x2618('0x1c')](handleError(_0x4a7c30,null));};exports[_0x2618('0x49')]=function(_0x4910fd,_0xc93fcb){var _0xebbda=_0x4910fd[_0x2618('0x3a')]['id'];var _0x1aacc4;var _0x288dab;var _0x5611c9;return db[_0x2618('0x31')]['findOne']({'where':{'id':_0xebbda}})[_0x2618('0x12')](function(_0x7422cb){_0x1aacc4=_0x7422cb;return db[_0x2618('0x4a')][_0x2618('0x4b')]({'where':{'id':_0x7422cb[_0x2618('0x4c')]},'attributes':['id',_0x2618('0x4d'),'vidaooEscalation','vidaooTopic',_0x2618('0x4e'),_0x2618('0x4f')],'raw':!![]});})[_0x2618('0x12')](function(_0x17a948){if(_0x17a948&&_0x17a948['vidaooApiKey']&&_0x17a948[_0x2618('0x50')]){_0x288dab=_0x17a948;var _0x2c1ba8={'interaction':{'id':_0xebbda},'agent':{'id':_0x4910fd['user']['id'],'name':_0x4910fd[_0x2618('0x38')][_0x2618('0x28')],'fullname':_0x4910fd['user']['fullname'],'email':_0x4910fd[_0x2618('0x38')]['email']},'contact':_0x4910fd['body'][_0x2618('0x2c')],'account':_0x4910fd[_0x2618('0x2b')][_0x2618('0x2e')]};var _0x8a650c={'rejectUnauthorized':![],'method':_0x2618('0x51'),'url':_0x2618('0x52'),'headers':{'X-APIKEY':_0x17a948[_0x2618('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4910fd[_0x2618('0x38')][_0x2618('0x53')]],'buttons':null,'topic':_0x288dab[_0x2618('0x54')],'note':_[_0x2618('0x55')](_0x288dab['vidaooNote'])?null:getMustacheRender(_0x288dab['vidaooNote'],_0x2c1ba8),'metadata':null},'redirect':_0x2618('0x56'),'json':!![]};try{if(!_[_0x2618('0x55')](_0x288dab[_0x2618('0x4f')])){var _0x2397c2=getMustacheRender(_0x288dab[_0x2618('0x4f')],_0x2c1ba8);var _0x506a84=JSON[_0x2618('0x57')](_0x2397c2);_0x8a650c[_0x2618('0x2b')]['metadata']=_0x506a84;}}catch(_0xfb12fd){throw new db['Sequelize'][(_0x2618('0x58'))](_0x2618('0x59'));}return rp(_0x8a650c);}else{throw new db[(_0x2618('0x5a'))][(_0x2618('0x58'))](_0x2618('0x5b'));}})[_0x2618('0x12')](function(_0x226d8d){_0x5611c9=_0x226d8d;if(_0x5611c9['id']){var _0x27a1db={'body':_0x5611c9[_0x2618('0x5c')],'ChatWebsiteId':_0x288dab['id'],'ChatInteractionId':_0x1aacc4['id'],'direction':'out','UserId':_0x4910fd[_0x2618('0x38')]['id']};return db[_0x2618('0x5d')][_0x2618('0x47')](_0x27a1db,{});}else{throw new db[(_0x2618('0x5a'))]['ValidationError'](_0x2618('0x5e'));}})['then'](function(){return _0x1aacc4[_0x2618('0x5f')]({'vidaooSessionId':_0x5611c9['id']});})[_0x2618('0x12')](respondWithResult(_0xc93fcb,null))[_0x2618('0x1c')](handleError(_0xc93fcb,null));};exports['customUpdate']=function(_0x525d8c,_0x56addc){if(_0x525d8c[_0x2618('0x2b')]['id']){delete _0x525d8c[_0x2618('0x2b')]['id'];}return db[_0x2618('0x31')][_0x2618('0x46')]({'where':{'id':_0x525d8c[_0x2618('0x3a')]['id']},'include':[{'model':db[_0x2618('0x60')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x56addc,null))[_0x2618('0x12')](saveUpdates(_0x525d8c[_0x2618('0x2b')],null))[_0x2618('0x12')](respondWithResult(_0x56addc,null))[_0x2618('0x1c')](handleError(_0x56addc,null));};exports[_0x2618('0x61')]=function(_0xea921b,_0x3399f0){if(_0xea921b[_0x2618('0x2b')]['id']){delete _0xea921b[_0x2618('0x2b')]['id'];}return db[_0x2618('0x31')][_0x2618('0x46')]({'where':{'id':_0xea921b[_0x2618('0x3a')]['id']}})['then'](function(_0x4bf23d){if(!_0x4bf23d){logger[_0x2618('0x18')](_0x2618('0x62'),'abandon',0x194,_0x2618('0x63'));_0x3399f0['sendStatus'](0x194);}else{if(_0x4bf23d[_0x2618('0x64')]){throw new db[(_0x2618('0x5a'))][(_0x2618('0x58'))](_0x2618('0x65'));}}return _0x4bf23d;})[_0x2618('0x12')](function(_0x9ba87c){if(_0x9ba87c){return _0x9ba87c[_0x2618('0x24')]({'closed':_0xea921b[_0x2618('0x2b')]['closed'],'disposition':_0xea921b[_0x2618('0x2b')][_0x2618('0x66')]})[_0x2618('0x12')](function(_0x1df8a4){return _0x1df8a4;});}})['then'](function(){return respondWithRpcPromise(_0x2618('0x67'),'abandon',_0xea921b['body'],client9004);})[_0x2618('0x12')](respondWithResult(_0x3399f0,null))[_0x2618('0x1c')](handleError(_0x3399f0,null));};exports['attachmentUpload']=function(_0x3e736f,_0x2f408e){_0x3e736f['body'][_0x2618('0x28')]=_0x3e736f[_0x2618('0x68')][_0x2618('0x69')];_0x3e736f['body'][_0x2618('0x6a')]=_0x3e736f[_0x2618('0x68')]['filename'];_0x3e736f[_0x2618('0x2b')]['type']=_0x3e736f[_0x2618('0x68')][_0x2618('0x6b')];return db[_0x2618('0x6c')]['create'](_0x3e736f[_0x2618('0x2b')])[_0x2618('0x12')](respondWithResult(_0x2f408e,0xc9))[_0x2618('0x1c')](handleError(_0x2f408e,null));};exports[_0x2618('0x6d')]=function(_0x5e6d45,_0x492768){return db['ChatInteraction'][_0x2618('0x4b')]({'where':{'id':_0x5e6d45['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x492768,null))[_0x2618('0x12')](function(_0x3a0013){if(_0x3a0013){if(_0x3a0013[_0x2618('0x6e')]){return _0x492768['status'](0x193)[_0x2618('0x1f')]({'status':0x193,'message':_0x2618('0x6f')});}return db['Attachment'][_0x2618('0x4b')]({'where':{'id':_0x5e6d45[_0x2618('0x37')][_0x2618('0x70')]},'raw':!![]})[_0x2618('0x12')](handleEntityNotFound(_0x492768,null));}})['then'](function(_0x196388){if(_0x196388){var _0x392951=_0x196388[_0x2618('0x71')]!==null;var _0x395366=path[_0x2618('0x72')](config[_0x2618('0x73')],_0x2618('0x74'));if(_0x392951){_0x395366=path[_0x2618('0x72')](_0x395366,'offline-chat/');}var _0x500eda=path['join'](_0x395366,_0x196388[_0x2618('0x6a')]);return _0x492768[_0x2618('0x75')](_0x500eda);}})[_0x2618('0x1c')](handleError(_0x492768,null));};exports[_0x2618('0x76')]=function(_0x3c1f4b,_0xe33569){var _0x4f2c4c=null;var _0x481477=null;var _0x54c25f=null;if(_0x3c1f4b[_0x2618('0x2b')]['id']){delete _0x3c1f4b[_0x2618('0x2b')]['id'];}if(_0x3c1f4b['body'][_0x2618('0x77')]){_0x54c25f=path[_0x2618('0x72')](config[_0x2618('0x73')],_0x2618('0x78'),util[_0x2618('0x79')]('transcript-%s.txt',Date['now']()));_0x3c1f4b[_0x2618('0x2b')][_0x2618('0x7a')]=_0x54c25f;}return db[_0x2618('0x31')][_0x2618('0x46')]({'where':{'id':_0x3c1f4b['params']['id']},'include':[{'model':db[_0x2618('0x5d')],'as':_0x2618('0x7b'),'include':[{'model':db[_0x2618('0x7c')],'as':_0x2618('0x7c')}]}]})['then'](handleEntityNotFound(_0xe33569,null))[_0x2618('0x12')](saveUpdates(_0x3c1f4b[_0x2618('0x2b')],null))[_0x2618('0x12')](function(_0x3921ec){if(_0x3921ec){_0x4f2c4c=_0x3921ec;return db[_0x2618('0x4a')][_0x2618('0x46')]({'where':{'id':_0x4f2c4c['ChatWebsiteId']}});}})[_0x2618('0x12')](function(_0x1b9707){if(_0x1b9707){_0x481477=_0x1b9707;return db[_0x2618('0x60')][_0x2618('0x46')]({'where':{'id':_0x4f2c4c[_0x2618('0x7d')]}});}})[_0x2618('0x12')](function(_0x4d69d6){if(_0x4d69d6){if(_0x54c25f){var _0x542187=null;for(var _0x53179e=0x1;_0x53179e<_0x4f2c4c[_0x2618('0x7b')]['length'];++_0x53179e){_0x542187=_0x4f2c4c[_0x2618('0x7b')][_0x53179e];var _0x5c72a5=_0x542187[_0x2618('0x64')]?util['format'](_0x2618('0x7e'),_0x481477[_0x2618('0x7f')],_0x542187[_0x2618('0x64')]):_0x2618('0x80');var _0x2e3e1e=_0x3c1f4b[_0x2618('0x2b')]['customer']||util[_0x2618('0x79')]('%s%d',_0x2618('0x81'),_0x542187['ContactId']);switch(_0x481477[_0x2618('0x82')]){case'website_alias':_0x5c72a5=_0x542187[_0x2618('0x64')]?util[_0x2618('0x79')](_0x2618('0x7e'),_0x481477[_0x2618('0x7f')],_0x542187['UserId']):_0x2618('0x80');break;case _0x2618('0x83'):_0x5c72a5=_0x542187[_0x2618('0x64')]?_0x542187['User']['alias']||_0x542187[_0x2618('0x7c')][_0x2618('0x84')]:_0x2618('0x80');break;case _0x2618('0x85'):_0x5c72a5=_0x542187[_0x2618('0x64')]?_0x542187[_0x2618('0x7c')]['fullname']:_0x2618('0x80');break;default:_0x5c72a5=_0x542187[_0x2618('0x64')]?util[_0x2618('0x79')](_0x2618('0x7e'),_0x481477[_0x2618('0x7f')],_0x542187[_0x2618('0x64')]):_0x2618('0x80');}var _0x1a7a9e=util['format'](_0x2618('0x86'),moment(_0x542187[_0x2618('0x87')])[_0x2618('0x79')](_0x2618('0x88')),_0x542187[_0x2618('0x89')]==='in'?_0x2e3e1e:_0x5c72a5,_0x542187[_0x2618('0x2b')]);if(!_0x542187[_0x2618('0x8a')]){fs[_0x2618('0x8b')](_0x54c25f,_0x1a7a9e);}}return db[_0x2618('0x8c')][_0x2618('0x4b')]({'where':{'service':!![]},'include':[{'model':db[_0x2618('0x8d')],'as':_0x2618('0x8e'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x2618('0x8f'),'raw':!![]}]}]});}}})[_0x2618('0x12')](function(_0xa9399){if(!_0xa9399||!_0xa9399['Smtp']||!_0x3c1f4b['body'])return _0x4f2c4c;var _0x28b33c=_0xa9399['getSmtpOptions']();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x28b33c,'message':{'from':util[_0x2618('0x79')](_0x2618('0x90'),_0xa9399[_0x2618('0x28')],_0xa9399[_0x2618('0x53')]||_0xa9399['Smtp'][_0x2618('0x38')]),'to':_0x3c1f4b[_0x2618('0x2b')]['mailTranscript'],'subject':_0x2618('0x91'),'text':util[_0x2618('0x79')](_0x2618('0x92'),_0x3c1f4b['body'][_0x2618('0x77')]),'attachments':[{'path':_0x54c25f}]}})['then'](function(){return _0x4f2c4c;})[_0x2618('0x1c')](function(_0x5e2efd){logger['error'](_0x5e2efd);});})[_0x2618('0x12')](respondWithStatusCode(_0xe33569,0xc8))[_0x2618('0x1c')](handleError(_0xe33569,null));};exports[_0x2618('0x93')]=function(_0x1cd150,_0x10fe4f){return db[_0x2618('0x5d')][_0x2618('0x46')]({'where':{'id':_0x1cd150['params']['id']}})[_0x2618('0x12')](handleEntityNotFound(_0x10fe4f,null))['then'](function(_0x131eb7){if(_0x131eb7){return _0x131eb7[_0x2618('0x93')](_0x1cd150['body'][_0x2618('0x94')],_[_0x2618('0x95')](_0x1cd150[_0x2618('0x2b')],[_0x2618('0x94'),'id'])||{});}})[_0x2618('0x12')](respondWithResult(_0x10fe4f,null))['catch'](handleError(_0x10fe4f,null));};exports['getMessages']=function(_0x3256fe,_0x2588a5){var _0x34753f={'raw':![],'where':{}};var _0x27fd64={};var _0x581269={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x2618('0x4b')]({'where':{'id':_0x3256fe['params']['id']}})['then'](handleEntityNotFound(_0x2588a5,null))['then'](function(_0x5c83e8){if(_0x5c83e8){_0x27fd64['model']=_[_0x2618('0x3c')](db[_0x2618('0x5d')][_0x2618('0x32')]);_0x27fd64[_0x2618('0x37')]=_[_0x2618('0x3c')](_0x3256fe[_0x2618('0x37')]);_0x27fd64[_0x2618('0x3d')]=_[_0x2618('0x3e')](_0x27fd64[_0x2618('0x3b')],_0x27fd64[_0x2618('0x37')]);_0x34753f['attributes']=_['intersection'](_0x27fd64[_0x2618('0x3b')],qs[_0x2618('0x3f')](_0x3256fe[_0x2618('0x37')][_0x2618('0x3f')]));_0x34753f['attributes']=_0x34753f[_0x2618('0x40')][_0x2618('0x41')]?_0x34753f[_0x2618('0x40')]:_0x27fd64[_0x2618('0x3b')];if(!_0x3256fe[_0x2618('0x37')][_0x2618('0x96')]('nolimit')){_0x34753f[_0x2618('0x22')]=qs[_0x2618('0x22')](_0x3256fe[_0x2618('0x37')]['limit']);_0x34753f[_0x2618('0x20')]=qs[_0x2618('0x20')](_0x3256fe['query'][_0x2618('0x20')]);}_0x34753f[_0x2618('0x97')]=qs[_0x2618('0x98')](_0x3256fe['query'][_0x2618('0x98')]);_0x34753f[_0x2618('0x99')]=qs[_0x2618('0x3d')](_[_0x2618('0x9a')](_0x3256fe[_0x2618('0x37')],_0x27fd64[_0x2618('0x3d')]));_0x34753f[_0x2618('0x99')][_0x2618('0x9b')]=_0x5c83e8['id'];if(_0x3256fe[_0x2618('0x37')][_0x2618('0x9c')]){_0x34753f[_0x2618('0x99')]=_[_0x2618('0x44')](_0x34753f[_0x2618('0x99')],{'$or':_[_0x2618('0x30')](_0x34753f[_0x2618('0x40')],function(_0x3a3336){var _0x2563b0={};_0x2563b0[_0x3a3336]={'$like':'%'+_0x3256fe[_0x2618('0x37')][_0x2618('0x9c')]+'%'};return _0x2563b0;})});}if(_0x3256fe[_0x2618('0x37')][_0x2618('0x9d')]){var _0x3de746=_0x3256fe[_0x2618('0x37')][_0x2618('0x9d')]['split'](',');var _0x34d1c8={};_0x34d1c8[_0x3de746[0x0]]={'$gte':moment(_0x3de746[0x1])['format'](_0x2618('0x9e'))};_0x34753f[_0x2618('0x99')]=_[_0x2618('0x44')](_0x34753f[_0x2618('0x99')],_0x34d1c8);}_0x34753f=_[_0x2618('0x44')]({},_0x34753f,_0x3256fe[_0x2618('0x45')]);return db['ChatMessage'][_0x2618('0x23')]({'where':_0x34753f['where']})[_0x2618('0x12')](function(_0x3de999){_0x581269[_0x2618('0x23')]=_0x3de999;if(_0x3256fe['query'][_0x2618('0x42')]){_0x34753f['include']=[{'all':!![]}];}return db[_0x2618('0x5d')][_0x2618('0x36')](_0x34753f);})[_0x2618('0x12')](function(_0x88299a){_0x581269[_0x2618('0x9f')]=_0x88299a;return _0x581269;});}})[_0x2618('0x12')](respondWithFilteredResult(_0x2588a5,_0x34753f))[_0x2618('0x1c')](handleError(_0x2588a5,null));};exports[_0x2618('0xa0')]=function(_0x228ff0,_0x53e595){var _0x1775bc={'where':{}},_0xdf2e82={},_0x332d8e={'count':0x0,'rows':[]};return db[_0x2618('0x31')]['findOne']({'where':{'id':_0x228ff0[_0x2618('0x3a')]['id']}})[_0x2618('0x12')](handleEntityNotFound(_0x53e595,null))[_0x2618('0x12')](function(_0xe47b6a){if(_0xe47b6a){_0xdf2e82['model']=_[_0x2618('0x3c')](db['ChatMessage'][_0x2618('0x32')]);_0xdf2e82[_0x2618('0x37')]=_[_0x2618('0x3c')](_0x228ff0[_0x2618('0x37')]);_0xdf2e82['filters']=_[_0x2618('0x3e')](_0xdf2e82['model'],_0xdf2e82[_0x2618('0x37')]);_0x1775bc[_0x2618('0x40')]=_[_0x2618('0x3e')](_0xdf2e82[_0x2618('0x3b')],qs[_0x2618('0x3f')](_0x228ff0[_0x2618('0x37')]['fields']));_0x1775bc['attributes']=_0x1775bc[_0x2618('0x40')]['length']?_0x1775bc['attributes']:_0xdf2e82[_0x2618('0x3b')];if(!_0x228ff0[_0x2618('0x37')][_0x2618('0x96')](_0x2618('0xa1'))){_0x1775bc['limit']=qs[_0x2618('0x22')](_0x228ff0[_0x2618('0x37')][_0x2618('0x22')]);_0x1775bc[_0x2618('0x20')]=qs[_0x2618('0x20')](_0x228ff0[_0x2618('0x37')][_0x2618('0x20')]);}_0x1775bc[_0x2618('0x97')]=qs[_0x2618('0x98')](_0x228ff0['query']['sort']);_0x1775bc['where']=qs[_0x2618('0x3d')](_[_0x2618('0x9a')](_0x228ff0[_0x2618('0x37')],_0xdf2e82[_0x2618('0x3d')]));_0x1775bc[_0x2618('0x99')][_0x2618('0x9b')]=_0xe47b6a['id'];if(_0x228ff0[_0x2618('0x37')][_0x2618('0x9c')]){_0x1775bc['where']=_['merge'](_0x1775bc['where'],{'$or':_[_0x2618('0x30')](_0x1775bc[_0x2618('0x40')],function(_0x11c903){var _0x95e8b={};_0x95e8b[_0x11c903]={'$like':'%'+_0x228ff0['query']['filter']+'%'};return _0x95e8b;})});}_0x1775bc[_0x2618('0x99')]['secret']=![];if(_0x228ff0[_0x2618('0x37')]['id']){_0x1775bc[_0x2618('0x99')]['id']={'$gt':_0x228ff0['query']['id']};}_0x1775bc=_[_0x2618('0x44')]({},_0x1775bc,_0x228ff0['options']);return db['ChatMessage']['count']({'where':_0x1775bc[_0x2618('0x99')]})[_0x2618('0x12')](function(_0x2383d6){_0x332d8e[_0x2618('0x23')]=_0x2383d6;_0x1775bc[_0x2618('0x43')]=[];if(_0x228ff0[_0x2618('0x37')][_0x2618('0xa2')]){_0x1775bc['include'][_0x2618('0xa3')]({'model':db[_0x2618('0x7c')],'as':_0x2618('0x7c'),'attributes':['id','fullname','alias']});}if(_0x228ff0['query'][_0x2618('0x42')]){_0x1775bc['include']=[{'all':!![]}];}return db[_0x2618('0x5d')]['findAll'](_0x1775bc);})[_0x2618('0x12')](function(_0x213c84){_0x332d8e['rows']=_0x213c84;return _0x332d8e;});}})[_0x2618('0x12')](respondWithFilteredResult(_0x53e595,_0x1775bc))['catch'](handleError(_0x53e595,null));};exports[_0x2618('0xa4')]=function(_0x2550b1,_0x561f8a){return db['ChatInteraction'][_0x2618('0x46')]({'where':{'id':_0x2550b1[_0x2618('0x3a')]['id']}})[_0x2618('0x12')](handleEntityNotFound(_0x561f8a,null))[_0x2618('0x12')](function(_0x4cecf5){if(_0x4cecf5){return _0x4cecf5[_0x2618('0xa5')](_0x2550b1[_0x2618('0x2b')][_0x2618('0x94')],_[_0x2618('0x95')](_0x2550b1[_0x2618('0x2b')],['ids','id'])||{})[_0x2618('0xa6')](function(){return db[_0x2618('0xa7')][_0x2618('0x36')]({'attributes':['id',_0x2618('0x28'),_0x2618('0xa8')],'where':{'id':_0x2550b1[_0x2618('0x2b')]['ids']}});})['then'](function(_0x108f39){socket[_0x2618('0xa9')]('chatInteractionTags:save',{'id':Number(_0x2550b1['params']['id']),'tags':_0x108f39||[]});return{'id':Number(_0x2550b1[_0x2618('0x3a')]['id']),'tags':_0x108f39||[]};});}})['then'](respondWithResult(_0x561f8a,null))['catch'](handleError(_0x561f8a,null));};exports[_0x2618('0xaa')]=function(_0x423d4b,_0x52b175){return db[_0x2618('0x31')]['find']({'where':{'id':_0x423d4b[_0x2618('0x3a')]['id']}})[_0x2618('0x12')](handleEntityNotFound(_0x52b175,null))[_0x2618('0x12')](function(_0x3657e7){if(_0x3657e7){return _0x3657e7[_0x2618('0xaa')](_0x423d4b['query']['ids']);}})[_0x2618('0x12')](respondWithStatusCode(_0x52b175,null))[_0x2618('0x1c')](handleError(_0x52b175,null));};exports[_0x2618('0x75')]=function(_0x33d681,_0x4996a2){var _0x241407=moment()[_0x2618('0xab')]()['toString']();var _0x55bbc6=path[_0x2618('0x72')](config['root'],'server',_0x2618('0xac'),_0x2618('0xad'));var _0x4fa6ea=path[_0x2618('0x72')](config[_0x2618('0x73')],'server',_0x2618('0xac'),_0x2618('0xae'));var _0x159044=path[_0x2618('0x72')](_0x55bbc6,_0x241407);var _0x5b8cb5=util[_0x2618('0x79')](_0x2618('0xaf'),_0x33d681[_0x2618('0x3a')]['id'],_0x241407);var _0xb57dc8=path['join'](_0x55bbc6,_0x5b8cb5);var _0x132b75=[];_0x132b75[_0x2618('0xa3')]({'model':db[_0x2618('0x7c')],'as':_0x2618('0x7c'),'attributes':['id',_0x2618('0x84')],'raw':!![]});_0x132b75[_0x2618('0xa3')]({'model':db[_0x2618('0x60')],'as':_0x2618('0xb0'),'attributes':['id',_0x2618('0xb1'),'lastName'],'raw':!![]});if(_0x33d681[_0x2618('0x37')]['attachments']){_0x132b75['push']({'model':db['Attachment'],'as':_0x2618('0x6c'),'raw':!![]});}var _0x2b4fe6=[{'model':db[_0x2618('0x5d')],'as':_0x2618('0x7b'),'attributes':['id','body',_0x2618('0x87'),_0x2618('0x89'),_0x2618('0x8a'),_0x2618('0xb2')],'include':_0x132b75}];_0x2b4fe6[_0x2618('0xa3')]({'model':db['ChatWebsite'],'as':_0x2618('0xb3'),'attributes':['id',_0x2618('0x28')]});_0x2b4fe6[_0x2618('0xa3')]({'model':db['User'],'as':'Owner','attributes':['id',_0x2618('0x84')]});return db[_0x2618('0x31')][_0x2618('0x46')]({'where':{'id':_0x33d681[_0x2618('0x3a')]['id']},'include':_0x2b4fe6})[_0x2618('0x12')](handleEntityNotFound(_0x4996a2,null))[_0x2618('0x12')](function(_0x21086c){if(_0x21086c){var _0x2e9dac=_0x21086c['get']({'plain':!![]});fs[_0x2618('0xb4')](_0x159044);var _0x5d27e7={'channel':_0x2618('0xb5'),'account':_0x2e9dac[_0x2618('0xb3')][_0x2618('0x28')],'agent':_0x2e9dac[_0x2618('0xb6')]?_0x2e9dac[_0x2618('0xb6')]['fullname']:_0x2618('0xb7'),'createdAt':moment(_0x2e9dac[_0x2618('0x87')])[_0x2618('0x79')](_0x2618('0x9e'))[_0x2618('0xb8')](),'closedAt':_0x2e9dac[_0x2618('0x6e')]?moment(_0x2e9dac[_0x2618('0xb9')])[_0x2618('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2618('0xb8')]():'','disposition':_0x2e9dac[_0x2618('0x66')],'chatInfo':{'browser':_0x2e9dac['browserName'],'os':_0x2e9dac[_0x2618('0xba')],'referer':_0x2e9dac[_0x2618('0xbb')],'customerIp':_0x2e9dac[_0x2618('0xbc')],'customerPort':_0x2e9dac[_0x2618('0xbd')]?_0x2e9dac['customerPort']:_0x2618('0xb7')},'messages':_(_0x2e9dac[_0x2618('0x7b')])['tail']()['filter']({'secret':![]})['map'](function(_0x21f739){if(_0x21f739[_0x2618('0x6c')]){var _0x354a83=path[_0x2618('0x72')](_0x4fa6ea,_0x21f739[_0x2618('0x6c')][_0x2618('0x6a')]);if(fs['existsSync'](_0x354a83)){fs[_0x2618('0xbe')](_0x354a83)[_0x2618('0xbf')](fs['createWriteStream'](path[_0x2618('0x72')](_0x159044,_0x21f739[_0x2618('0x6c')][_0x2618('0x6a')])));}}return{'date':moment(_0x21f739[_0x2618('0x87')])['format'](_0x2618('0x9e'))[_0x2618('0xb8')](),'sender':_0x21f739['direction']===_0x2618('0xc0')?_0x21f739['User']?_0x21f739[_0x2618('0x7c')]['fullname']:'System':_0x21f739['Contact'][_0x2618('0xb1')]+(_0x21f739[_0x2618('0xb0')]['lastName']?'\x20'+_0x21f739[_0x2618('0xb0')][_0x2618('0xc1')]:''),'body':_0x21f739[_0x2618('0x6c')]?_0x21f739['Attachment'][_0x2618('0x6a')]:_0x21f739[_0x2618('0x2b')],'direction':_0x21f739[_0x2618('0x89')]==='out'?'A':'C','secret':_0x21f739['secret'],'read':_0x21f739[_0x2618('0xb2')],'attachment':_0x21f739[_0x2618('0x6c')]};})[_0x2618('0xc2')]()};return ejs[_0x2618('0xc3')](path[_0x2618('0x72')](config['root'],_0x2618('0xc4'),_0x2618('0xc5'),_0x2618('0xc6')),{'interaction':_0x5d27e7})['then'](function(_0x126445){var _0x5900e9=path[_0x2618('0x72')](_0x159044,_0x2618('0xc7')+_0x2e9dac['id']+'-'+_0x241407+_0x2618('0xc8'));var _0x35f756={'path':_0x5900e9,'channel':'Chat','interactionId':_0x2e9dac['id']};return pdf[_0x2618('0xc9')](_0x126445,_0x35f756);})['then'](function(){return new Promise(function(_0xb411d0,_0x1b05ac){zipdir(_0x159044,{'saveTo':_0xb57dc8},function(_0x3d8040,_0x3e122c){if(_0x3d8040)return _0x1b05ac(_0x3d8040);return _0xb411d0(_0x3e122c);});})[_0x2618('0x12')](function(){return new BPromise(function(_0x5be0a4,_0x1a65f8){rimraf(_0x159044,function(_0x2262bf){if(_0x2262bf)_0x1a65f8(_0x2262bf);return _0x5be0a4();});});})['then'](function(){return _0x4996a2['download'](_0xb57dc8,_0x5b8cb5,function(_0x1446bb){if(_0x1446bb){logger['error'](_0x2618('0xca'),_0x1446bb);}else{fs[_0x2618('0xcb')](_0xb57dc8);}});});});}else{return _0x4996a2['sendStatus'](0xc8);}})['catch'](handleError(_0x4996a2,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 95aa671..39b4d23 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 _0x91b6=['unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers','setDataValue','map'];(function(_0x3a22be,_0x2436ed){var _0x1085f1=function(_0x230ac2){while(--_0x230ac2){_0x3a22be['push'](_0x3a22be['shift']());}};_0x1085f1(++_0x2436ed);}(_0x91b6,0xd6));var _0x691b=function(_0x4ef230,_0x54f257){_0x4ef230=_0x4ef230-0x0;var _0x4c0d99=_0x91b6[_0x4ef230];return _0x4c0d99;};'use strict';var EventEmitter=require(_0x691b('0x0'));var ChatInteraction=require(_0x691b('0x1'))['db'][_0x691b('0x2')];var ChatMessage=require(_0x691b('0x1'))['db'][_0x691b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x691b('0x4')](0x0);var events={'afterCreate':_0x691b('0x5'),'afterUpdate':_0x691b('0x6'),'afterDestroy':'remove'};function emitEvent(_0xef1bf){return function(_0xd16cae,_0x1b3375,_0x183568){_0xd16cae[_0x691b('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x35d40d){_0xd16cae[_0x691b('0x8')]('Users',_0x35d40d[_0x691b('0x9')](function(_0x32421b){return{'id':_0x32421b['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0xd16cae['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x42087c){_0xd16cae[_0x691b('0x8')](_0x691b('0xa'),_0x42087c[_0x691b('0xb')]);ChatInteractionEvents[_0x691b('0xc')](_0xef1bf+':'+_0xd16cae['id'],_0xd16cae);ChatInteractionEvents[_0x691b('0xc')](_0xef1bf,_0xd16cae);_0x183568(null);})['catch'](_0x183568(null));};}for(var e in events){if(events[_0x691b('0xd')](e)){var event=events[e];ChatInteraction[_0x691b('0xe')](e,emitEvent(event));}}module[_0x691b('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0x2921=['emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x1472de,_0x400763){var _0x486627=function(_0x3910d1){while(--_0x3910d1){_0x1472de['push'](_0x1472de['shift']());}};_0x486627(++_0x400763);}(_0x2921,0xcd));var _0x1292=function(_0x54d96a,_0x1fdf52){_0x54d96a=_0x54d96a-0x0;var _0x5e3113=_0x2921[_0x54d96a];return _0x5e3113;};'use strict';var EventEmitter=require(_0x1292('0x0'));var ChatInteraction=require(_0x1292('0x1'))['db'][_0x1292('0x2')];var ChatMessage=require(_0x1292('0x1'))['db'][_0x1292('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1292('0x4')](0x0);var events={'afterCreate':_0x1292('0x5'),'afterUpdate':_0x1292('0x6'),'afterDestroy':_0x1292('0x7')};function emitEvent(_0x164d59){return function(_0x4ee739,_0xa3ae27,_0x1d310e){_0x4ee739['getUsers']({'attributes':['id'],'raw':!![]})[_0x1292('0x8')](function(_0x4d3723){_0x4ee739[_0x1292('0x9')](_0x1292('0xa'),_0x4d3723[_0x1292('0xb')](function(_0x400f9f){return{'id':_0x400f9f['id']};}));return ChatMessage[_0x1292('0xc')]({'where':{'ChatInteractionId':_0x4ee739['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1292('0x8')](function(_0x3ab4a4){_0x4ee739[_0x1292('0x9')](_0x1292('0xd'),_0x3ab4a4[_0x1292('0xe')]);ChatInteractionEvents[_0x1292('0xf')](_0x164d59+':'+_0x4ee739['id'],_0x4ee739);ChatInteractionEvents[_0x1292('0xf')](_0x164d59,_0x4ee739);_0x1d310e(null);})[_0x1292('0x10')](_0x1d310e(null));};}for(var e in events){if(events[_0x1292('0x11')](e)){var event=events[e];ChatInteraction[_0x1292('0x12')](e,emitEvent(event));}}module[_0x1292('0x13')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index b51d3f1..8668cba 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 _0xf6b2=['format','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','closed'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0xf6b2,0x1b2));var _0x2f6b=function(_0x176d91,_0x2a0829){_0x176d91=_0x176d91-0x0;var _0x1cf8d8=_0xf6b2[_0x176d91];return _0x1cf8d8;};'use strict';var _=require(_0x2f6b('0x0'));var util=require(_0x2f6b('0x1'));var logger=require(_0x2f6b('0x2'))(_0x2f6b('0x3'));var moment=require('moment');var BPromise=require(_0x2f6b('0x4'));var rp=require(_0x2f6b('0x5'));var fs=require('fs');var path=require(_0x2f6b('0x6'));var rimraf=require(_0x2f6b('0x7'));var config=require(_0x2f6b('0x8'));var attributes=require(_0x2f6b('0x9'));module[_0x2f6b('0xa')]=function(_0x26d28f,_0x481066){return _0x26d28f[_0x2f6b('0xb')]('ChatInteraction',attributes,{'tableName':_0x2f6b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2cc4a0,_0x16e889,_0x36677d){if(_0x2cc4a0['changed'](_0x2f6b('0xd'))){_0x2cc4a0['closedAt']=moment()[_0x2f6b('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x36677d(null,_0x2cc4a0);}},'charset':'utf8mb4','collate':_0x2f6b('0xf')});}; \ No newline at end of file +var _0x8902=['closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed'];(function(_0x5351d5,_0x24ba83){var _0x29597e=function(_0xac444c){while(--_0xac444c){_0x5351d5['push'](_0x5351d5['shift']());}};_0x29597e(++_0x24ba83);}(_0x8902,0x79));var _0x2890=function(_0x463020,_0x5c2963){_0x463020=_0x463020-0x0;var _0x34cb36=_0x8902[_0x463020];return _0x34cb36;};'use strict';var _=require('lodash');var util=require(_0x2890('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2890('0x1'));var fs=require('fs');var path=require(_0x2890('0x2'));var rimraf=require('rimraf');var config=require(_0x2890('0x3'));var attributes=require(_0x2890('0x4'));module[_0x2890('0x5')]=function(_0x355989,_0x369804){return _0x355989[_0x2890('0x6')]('ChatInteraction',attributes,{'tableName':_0x2890('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b1a35,_0x2cb8f7,_0x3f9290){if(_0x2b1a35[_0x2890('0x8')](_0x2890('0x9'))){_0x2b1a35[_0x2890('0xa')]=moment()['format'](_0x2890('0xb'));}_0x3f9290(null,_0x2b1a35);}},'charset':'utf8mb4','collate':_0x2890('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 2b6ef28..6fef4d2 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 _0x8969=['catch','then','addTags','ids','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8969,0x103));var _0x9896=function(_0x44e7e8,_0x2196a0){_0x44e7e8=_0x44e7e8-0x0;var _0xfbea4=_0x8969[_0x44e7e8];return _0xfbea4;};'use strict';var _=require(_0x9896('0x0'));var util=require(_0x9896('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9896('0x2'));var fs=require('fs');var Redis=require(_0x9896('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9896('0x4'));var logger=require(_0x9896('0x5'))(_0x9896('0x6'));var config=require(_0x9896('0x7'));var jayson=require(_0x9896('0x8'));var client=jayson[_0x9896('0x9')]['http']({'port':0x232a});config[_0x9896('0xa')]=_[_0x9896('0xb')](config[_0x9896('0xa')],{'host':_0x9896('0xc'),'port':0x18eb});var socket=require(_0x9896('0xd'))(new Redis(config[_0x9896('0xa')]));require(_0x9896('0xe'))[_0x9896('0xf')](socket);function respondWithRpcPromise(_0xc84bb4,_0x3849c5,_0x219b53){return new BPromise(function(_0x24f520,_0x59d276){return client[_0x9896('0x10')](_0xc84bb4,_0x219b53)['then'](function(_0x9dba25){logger[_0x9896('0x11')](_0x9896('0x12'),_0x3849c5,_0x9896('0x13'));logger['debug'](_0x9896('0x14'),_0x3849c5,_0x9896('0x13'),JSON[_0x9896('0x15')](_0x9dba25));if(_0x9dba25['error']){if(_0x9dba25[_0x9896('0x16')][_0x9896('0x17')]===0x1f4){logger[_0x9896('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x3849c5,_0x9dba25['error']['message']);return _0x59d276(_0x9dba25[_0x9896('0x16')][_0x9896('0x18')]);}logger[_0x9896('0x16')](_0x9896('0x12'),_0x3849c5,_0x9dba25[_0x9896('0x16')]['message']);return _0x24f520(_0x9dba25[_0x9896('0x16')][_0x9896('0x18')]);}else{logger[_0x9896('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x3849c5,_0x9896('0x13'));_0x24f520(_0x9dba25[_0x9896('0x19')][_0x9896('0x18')]);}})['catch'](function(_0x2a8d61){logger[_0x9896('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x3849c5,_0x2a8d61);_0x59d276(_0x2a8d61);});});}exports[_0x9896('0x1a')]=function(_0x5e290c){var _0x28754f=this;return new Promise(function(_0x3c6815,_0x5d6ea5){return db[_0x9896('0x1b')][_0x9896('0x1c')](_0x5e290c[_0x9896('0x1d')],{'raw':_0x5e290c[_0x9896('0x1e')]?_0x5e290c[_0x9896('0x1e')][_0x9896('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e290c[_0x9896('0x1e')]?_0x5e290c['options'][_0x9896('0x20')]||null:null,'attributes':_0x5e290c[_0x9896('0x1e')]?_0x5e290c[_0x9896('0x1e')]['attributes']||null:null,'limit':_0x5e290c[_0x9896('0x1e')]?_0x5e290c['options'][_0x9896('0x21')]||null:null})['then'](function(_0x54ce3a){logger['info']('UpdateChatInteraction',_0x5e290c);logger[_0x9896('0x22')](_0x9896('0x1a'),_0x5e290c,JSON[_0x9896('0x15')](_0x54ce3a));_0x3c6815(_0x54ce3a);})[_0x9896('0x23')](function(_0x26adf3){logger[_0x9896('0x16')](_0x9896('0x1a'),_0x26adf3['message'],_0x5e290c);_0x5d6ea5(_0x28754f['error'](0x1f4,_0x26adf3[_0x9896('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x1aee30){return new Promise(function(_0x476076,_0x4c2d2e){return db[_0x9896('0x1b')]['find']({'where':_0x1aee30[_0x9896('0x1e')]?_0x1aee30[_0x9896('0x1e')][_0x9896('0x20')]||null:null})[_0x9896('0x24')](function(_0x108f9f){if(_0x108f9f){return _0x108f9f[_0x9896('0x25')](_0x1aee30['body'][_0x9896('0x26')],_[_0x9896('0x27')](_0x1aee30[_0x9896('0x1d')],[_0x9896('0x26'),'id'])||{});}})[_0x9896('0x28')](function(_0x2588c1){logger[_0x9896('0x11')](_0x9896('0x29'),_0x1aee30);logger[_0x9896('0x22')](_0x9896('0x29'),_0x1aee30,JSON[_0x9896('0x15')](_0x2588c1));_0x476076(_0x2588c1);})[_0x9896('0x23')](function(_0x30c747){logger[_0x9896('0x16')]('AddTags',_0x30c747[_0x9896('0x18')],_0x1aee30);_0x4c2d2e(_this['error'](0x1f4,_0x30c747[_0x9896('0x18')]));});});}; \ No newline at end of file +var _0x060e=['then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','stringify','catch','AddTagsToChatInteraction','where','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request'];(function(_0x3551eb,_0x1e46d8){var _0x4264c5=function(_0x4e8259){while(--_0x4e8259){_0x3551eb['push'](_0x3551eb['shift']());}};_0x4264c5(++_0x1e46d8);}(_0x060e,0x70));var _0xe060=function(_0x429c0c,_0x560f5b){_0x429c0c=_0x429c0c-0x0;var _0x45c8a5=_0x060e[_0x429c0c];return _0x45c8a5;};'use strict';var _=require(_0xe060('0x0'));var util=require(_0xe060('0x1'));var moment=require(_0xe060('0x2'));var BPromise=require(_0xe060('0x3'));var rs=require(_0xe060('0x4'));var fs=require('fs');var Redis=require(_0xe060('0x5'));var db=require(_0xe060('0x6'))['db'];var utils=require(_0xe060('0x7'));var logger=require(_0xe060('0x8'))('rpc');var config=require(_0xe060('0x9'));var jayson=require(_0xe060('0xa'));var client=jayson[_0xe060('0xb')][_0xe060('0xc')]({'port':0x232a});config[_0xe060('0xd')]=_[_0xe060('0xe')](config['redis'],{'host':_0xe060('0xf'),'port':0x18eb});var socket=require(_0xe060('0x10'))(new Redis(config[_0xe060('0xd')]));require(_0xe060('0x11'))[_0xe060('0x12')](socket);function respondWithRpcPromise(_0x638079,_0x424bed,_0x10e3e8){return new BPromise(function(_0x469ce7,_0x258623){return client[_0xe060('0x13')](_0x638079,_0x10e3e8)[_0xe060('0x14')](function(_0x230312){logger[_0xe060('0x15')](_0xe060('0x16'),_0x424bed,_0xe060('0x17'));logger[_0xe060('0x18')](_0xe060('0x19'),_0x424bed,'request\x20sent',JSON['stringify'](_0x230312));if(_0x230312[_0xe060('0x1a')]){if(_0x230312[_0xe060('0x1a')]['code']===0x1f4){logger[_0xe060('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x424bed,_0x230312['error'][_0xe060('0x1b')]);return _0x258623(_0x230312[_0xe060('0x1a')]['message']);}logger[_0xe060('0x1a')](_0xe060('0x16'),_0x424bed,_0x230312[_0xe060('0x1a')][_0xe060('0x1b')]);return _0x469ce7(_0x230312['error']['message']);}else{logger[_0xe060('0x15')](_0xe060('0x16'),_0x424bed,'request\x20sent');_0x469ce7(_0x230312[_0xe060('0x1c')][_0xe060('0x1b')]);}})['catch'](function(_0x1615ae){logger[_0xe060('0x1a')](_0xe060('0x16'),_0x424bed,_0x1615ae);_0x258623(_0x1615ae);});});}exports[_0xe060('0x1d')]=function(_0x56387a){var _0x670b75=this;return new Promise(function(_0x417f56,_0x43fb36){return db[_0xe060('0x1e')][_0xe060('0x1f')](_0x56387a[_0xe060('0x20')],{'raw':_0x56387a[_0xe060('0x21')]?_0x56387a[_0xe060('0x21')][_0xe060('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56387a[_0xe060('0x21')]?_0x56387a[_0xe060('0x21')]['where']||null:null,'attributes':_0x56387a[_0xe060('0x21')]?_0x56387a[_0xe060('0x21')][_0xe060('0x23')]||null:null,'limit':_0x56387a[_0xe060('0x21')]?_0x56387a[_0xe060('0x21')][_0xe060('0x24')]||null:null})[_0xe060('0x14')](function(_0x378d30){logger[_0xe060('0x15')](_0xe060('0x1d'),_0x56387a);logger[_0xe060('0x18')](_0xe060('0x1d'),_0x56387a,JSON[_0xe060('0x25')](_0x378d30));_0x417f56(_0x378d30);})[_0xe060('0x26')](function(_0x956f17){logger[_0xe060('0x1a')](_0xe060('0x1d'),_0x956f17[_0xe060('0x1b')],_0x56387a);_0x43fb36(_0x670b75[_0xe060('0x1a')](0x1f4,_0x956f17[_0xe060('0x1b')]));});});};exports[_0xe060('0x27')]=function(_0x386d77){return new Promise(function(_0x5928da,_0x161554){return db['ChatInteraction']['find']({'where':_0x386d77['options']?_0x386d77[_0xe060('0x21')][_0xe060('0x28')]||null:null})['then'](function(_0x3a53e9){if(_0x3a53e9){return _0x3a53e9[_0xe060('0x29')](_0x386d77[_0xe060('0x20')]['ids'],_['omit'](_0x386d77[_0xe060('0x20')],[_0xe060('0x2a'),'id'])||{});}})['spread'](function(_0x59c027){logger['info']('AddTags',_0x386d77);logger[_0xe060('0x18')](_0xe060('0x2b'),_0x386d77,JSON[_0xe060('0x25')](_0x59c027));_0x5928da(_0x59c027);})[_0xe060('0x26')](function(_0x4b0eb9){logger[_0xe060('0x1a')]('AddTags',_0x4b0eb9[_0xe060('0x1b')],_0x386d77);_0x161554(_this[_0xe060('0x1a')](0x1f4,_0x4b0eb9[_0xe060('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 477437f..c985586 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 _0x11fe=['remove','update','register','length','save'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0x11fe,0xb8));var _0xe11f=function(_0x3b2141,_0x300475){_0x3b2141=_0x3b2141-0x0;var _0x58d916=_0x11fe[_0x3b2141];return _0x58d916;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xe11f('0x0'),_0xe11f('0x1'),_0xe11f('0x2')];function createListener(_0x1b2ba9,_0xa221ad){return function(_0x7fbf0a){_0xa221ad['emit'](_0x1b2ba9,_0x7fbf0a);};}function removeListener(_0x3de4e2,_0x45ecaa){return function(){ChatInteractionEvents['removeListener'](_0x3de4e2,_0x45ecaa);};}exports[_0xe11f('0x3')]=function(_0x561a45){for(var _0x1ac005=0x0,_0x5660c6=events[_0xe11f('0x4')];_0x1ac005<_0x5660c6;_0x1ac005++){var _0x5b7284=events[_0x1ac005];var _0x1e5b75=createListener('chatInteraction:'+_0x5b7284,_0x561a45);ChatInteractionEvents['on'](_0x5b7284,_0x1e5b75);}}; \ No newline at end of file +var _0xc4ad=['remove','emit','removeListener','register','length','chatInteraction:','save'];(function(_0x4fc1de,_0x3b30d8){var _0x5e274b=function(_0x2f52a1){while(--_0x2f52a1){_0x4fc1de['push'](_0x4fc1de['shift']());}};_0x5e274b(++_0x3b30d8);}(_0xc4ad,0xf4));var _0xdc4a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4ad[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xdc4a('0x0'),_0xdc4a('0x1'),'update'];function createListener(_0xffe665,_0x2ff0d7){return function(_0x2749ee){_0x2ff0d7[_0xdc4a('0x2')](_0xffe665,_0x2749ee);};}function removeListener(_0x41fdab,_0x4d7b08){return function(){ChatInteractionEvents[_0xdc4a('0x3')](_0x41fdab,_0x4d7b08);};}exports[_0xdc4a('0x4')]=function(_0x44afd7){for(var _0x544afd=0x0,_0xedf739=events[_0xdc4a('0x5')];_0x544afd<_0xedf739;_0x544afd++){var _0x2da6c6=events[_0x544afd];var _0x5763c4=createListener(_0xdc4a('0x6')+_0x2da6c6,_0x44afd7);ChatInteractionEvents['on'](_0x2da6c6,_0x5763c4);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index ea6747f..5a53e40 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 _0xf31e=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/:id','show','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','replace','file','attachmentUpload','addMessage','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xf31e,0xa2));var _0xef31=function(_0x32eca9,_0x79a379){_0x32eca9=_0x32eca9-0x0;var _0x2e6d1e=_0xf31e[_0x32eca9];return _0x2e6d1e;};'use strict';var multer=require(_0xef31('0x0'));var util=require(_0xef31('0x1'));var path=require(_0xef31('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xef31('0x3')]();var fs_extra=require(_0xef31('0x4'));var auth=require(_0xef31('0x5'));var interaction=require(_0xef31('0x6'));var config=require(_0xef31('0x7'));var controller=require(_0xef31('0x8'));router[_0xef31('0x9')]('/',auth[_0xef31('0xa')](),controller[_0xef31('0xb')]);router[_0xef31('0x9')]('/describe',auth[_0xef31('0xa')](),controller['describe']);router[_0xef31('0x9')](_0xef31('0xc'),auth['isChatInteractionAuthorized'](),controller[_0xef31('0xd')]);router['get']('/:id/attachment_download',auth[_0xef31('0xe')](),controller[_0xef31('0xf')]);router['get'](_0xef31('0x10'),auth[_0xef31('0xa')](),controller[_0xef31('0x11')]);router[_0xef31('0x9')](_0xef31('0x12'),auth['isChatInteractionAuthorized'](),controller[_0xef31('0x13')]);router[_0xef31('0x9')]('/:id/download',auth[_0xef31('0xa')](),controller[_0xef31('0x14')]);router[_0xef31('0x15')]('/',auth['isAuthenticated'](),controller[_0xef31('0x16')]);router[_0xef31('0x15')](_0xef31('0x17'),auth[_0xef31('0xa')](),controller[_0xef31('0x18')]);var upload=multer({'storage':multer[_0xef31('0x19')]({'destination':function(_0x3556d6,_0xec74df,_0x1423b4){_0x1423b4(null,path[_0xef31('0x1a')](config[_0xef31('0x1b')],_0xef31('0x1c')));},'filename':function(_0x2ee7cf,_0x291bfc,_0x33bc0c){_0x33bc0c(null,util[_0xef31('0x1d')](_0xef31('0x1e'),Date['now'](),_0x291bfc[_0xef31('0x1f')][_0xef31('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xef31('0x15')]('/:id/attachment_upload',upload['single'](_0xef31('0x21')),controller[_0xef31('0x22')]);router[_0xef31('0x15')]('/:id/messages',auth[_0xef31('0xe')](),controller[_0xef31('0x23')]);router[_0xef31('0x15')]('/:id/tags',auth[_0xef31('0xa')](),interaction['tracked'](_0xef31('0x24'),_0xef31('0x25')),controller[_0xef31('0x26')]);router[_0xef31('0x27')]('/:id',auth[_0xef31('0xa')](),interaction[_0xef31('0x28')](_0xef31('0x24'),_0xef31('0x29')),controller[_0xef31('0x2a')]);router['put'](_0xef31('0x2b'),controller[_0xef31('0x2c')]);router[_0xef31('0x27')](_0xef31('0x2d'),auth[_0xef31('0xe')](),controller['abandon']);router[_0xef31('0x27')](_0xef31('0x2e'),controller[_0xef31('0x2f')]);router[_0xef31('0x30')](_0xef31('0xc'),auth['isAuthenticated'](),interaction[_0xef31('0x28')](_0xef31('0x24'),_0xef31('0x31')),controller[_0xef31('0x32')]);router[_0xef31('0x30')](_0xef31('0x33'),auth[_0xef31('0xa')](),controller[_0xef31('0x34')]);module[_0xef31('0x35')]=router; \ No newline at end of file +var _0x5512=['now','originalname','replace','file','addMessage','chat','chatinteraction:addtags','addTags','tracked','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s'];(function(_0x4eac0d,_0x58d7d7){var _0x62d441=function(_0x5e65f0){while(--_0x5e65f0){_0x4eac0d['push'](_0x4eac0d['shift']());}};_0x62d441(++_0x58d7d7);}(_0x5512,0x79));var _0x2551=function(_0x506e5a,_0x1114fe){_0x506e5a=_0x506e5a-0x0;var _0x1ed706=_0x5512[_0x506e5a];return _0x1ed706;};'use strict';var multer=require(_0x2551('0x0'));var util=require(_0x2551('0x1'));var path=require(_0x2551('0x2'));var timeout=require(_0x2551('0x3'));var express=require(_0x2551('0x4'));var router=express[_0x2551('0x5')]();var fs_extra=require(_0x2551('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2551('0x7'));var config=require(_0x2551('0x8'));var controller=require('./chatInteraction.controller');router[_0x2551('0x9')]('/',auth[_0x2551('0xa')](),controller['index']);router[_0x2551('0x9')]('/describe',auth[_0x2551('0xa')](),controller['describe']);router[_0x2551('0x9')](_0x2551('0xb'),auth[_0x2551('0xc')](),controller[_0x2551('0xd')]);router[_0x2551('0x9')](_0x2551('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x2551('0xf')]);router[_0x2551('0x9')](_0x2551('0x10'),auth[_0x2551('0xa')](),controller['getMessages']);router[_0x2551('0x9')](_0x2551('0x11'),auth[_0x2551('0xc')](),controller[_0x2551('0x12')]);router[_0x2551('0x9')](_0x2551('0x13'),auth[_0x2551('0xa')](),controller[_0x2551('0x14')]);router[_0x2551('0x15')]('/',auth[_0x2551('0xa')](),controller['create']);router[_0x2551('0x15')](_0x2551('0x16'),auth[_0x2551('0xa')](),controller[_0x2551('0x17')]);var upload=multer({'storage':multer[_0x2551('0x18')]({'destination':function(_0x2202ca,_0x4f74cb,_0x39bfbd){_0x39bfbd(null,path[_0x2551('0x19')](config[_0x2551('0x1a')],_0x2551('0x1b')));},'filename':function(_0xe41d40,_0x1697cb,_0x2111ba){_0x2111ba(null,util['format'](_0x2551('0x1c'),Date[_0x2551('0x1d')](),_0x1697cb[_0x2551('0x1e')][_0x2551('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload['single'](_0x2551('0x20')),controller['attachmentUpload']);router['post']('/:id/messages',auth[_0x2551('0xc')](),controller[_0x2551('0x21')]);router[_0x2551('0x15')]('/:id/tags',auth[_0x2551('0xa')](),interaction['tracked'](_0x2551('0x22'),_0x2551('0x23')),controller[_0x2551('0x24')]);router['put'](_0x2551('0xb'),auth[_0x2551('0xa')](),interaction[_0x2551('0x25')](_0x2551('0x22'),_0x2551('0x26')),controller[_0x2551('0x27')]);router[_0x2551('0x28')](_0x2551('0x29'),controller[_0x2551('0x2a')]);router['put'](_0x2551('0x2b'),auth[_0x2551('0xc')](),controller['abandon']);router[_0x2551('0x28')](_0x2551('0x2c'),controller[_0x2551('0x2d')]);router[_0x2551('0x2e')]('/:id',auth[_0x2551('0xa')](),interaction[_0x2551('0x25')](_0x2551('0x22'),'chatinteraction:destroy'),controller[_0x2551('0x2f')]);router[_0x2551('0x2e')](_0x2551('0x30'),auth[_0x2551('0xa')](),controller[_0x2551('0x31')]);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 c300de0..36dc6dd 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 _0x38c3=['INTEGER','TEXT','medium','BOOLEAN'];(function(_0xfed94,_0x41cb7a){var _0x126db6=function(_0x14076f){while(--_0x14076f){_0xfed94['push'](_0xfed94['shift']());}};_0x126db6(++_0x41cb7a);}(_0x38c3,0xf1));var _0x338c=function(_0x4debdd,_0x114aab){_0x4debdd=_0x4debdd-0x0;var _0x4a83e6=_0x38c3[_0x4debdd];return _0x4a83e6;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x338c('0x0')](_0x338c('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x338c('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x338c('0x3')]}}; \ No newline at end of file +var _0xc5fc=['BOOLEAN','INTEGER','sequelize','exports'];(function(_0x1a3917,_0x4f02ea){var _0x49172a=function(_0xda2725){while(--_0xda2725){_0x1a3917['push'](_0x1a3917['shift']());}};_0x49172a(++_0x4f02ea);}(_0xc5fc,0xf6));var _0xcc5f=function(_0x2c4530,_0x1da779){_0x2c4530=_0x2c4530-0x0;var _0x41a69a=_0xc5fc[_0x2c4530];return _0x41a69a;};'use strict';var Sequelize=require(_0xcc5f('0x0'));module[_0xcc5f('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xcc5f('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xcc5f('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index e11b117..718144b 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 _0xdade=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','find','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','fullname','role','userpic','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','read','-createdAt','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatInternalMessage.socket','register','end','status','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query'];(function(_0x59c4c6,_0x5ed8ef){var _0x37ca0f=function(_0x6466a1){while(--_0x6466a1){_0x59c4c6['push'](_0x59c4c6['shift']());}};_0x37ca0f(++_0x5ed8ef);}(_0xdade,0xa2));var _0xedad=function(_0x2eaff4,_0x4852b7){_0x2eaff4=_0x2eaff4-0x0;var _0x278c7a=_0xdade[_0x2eaff4];return _0x278c7a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedad('0x0'));var zipdir=require(_0xedad('0x1'));var jsonpatch=require(_0xedad('0x2'));var rp=require(_0xedad('0x3'));var moment=require('moment');var BPromise=require(_0xedad('0x4'));var Mustache=require('mustache');var util=require(_0xedad('0x5'));var path=require(_0xedad('0x6'));var sox=require(_0xedad('0x7'));var csv=require(_0xedad('0x8'));var ejs=require(_0xedad('0x9'));var fs=require('fs');var fs_extra=require(_0xedad('0xa'));var _=require(_0xedad('0xb'));var squel=require(_0xedad('0xc'));var crypto=require(_0xedad('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xedad('0x8'));var querystring=require(_0xedad('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xedad('0xf'));var qs=require(_0xedad('0x10'));var as=require(_0xedad('0x11'));var hardwareService=require(_0xedad('0x12'));var logger=require('../../config/logger')(_0xedad('0x13'));var utils=require(_0xedad('0x14'));var config=require(_0xedad('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xedad('0x16'))['db'];config[_0xedad('0x17')]=_['defaults'](config[_0xedad('0x17')],{'host':_0xedad('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xedad('0x17')]));require(_0xedad('0x19'))[_0xedad('0x1a')](socket);function respondWithStatusCode(_0x5d66ab,_0x2e311e){_0x2e311e=_0x2e311e||0xcc;return function(_0x2724a2){if(_0x2724a2){return _0x5d66ab['sendStatus'](_0x2e311e);}return _0x5d66ab['status'](_0x2e311e)[_0xedad('0x1b')]();};}function respondWithResult(_0x11ec88,_0x21c14d){_0x21c14d=_0x21c14d||0xc8;return function(_0x9895f3){if(_0x9895f3){return _0x11ec88[_0xedad('0x1c')](_0x21c14d)[_0xedad('0x1d')](_0x9895f3);}};}function respondWithFilteredResult(_0x1e633c,_0x44dfab){return function(_0x3bb7c6){if(_0x3bb7c6){var _0x1393c6=typeof _0x44dfab[_0xedad('0x1e')]==='undefined'&&typeof _0x44dfab[_0xedad('0x1f')]===_0xedad('0x20');var _0x2970bb=_0x3bb7c6['count'];var _0x1dd7f2=_0x1393c6?0x0:_0x44dfab[_0xedad('0x1e')];var _0x1c6a4e=_0x1393c6?_0x3bb7c6[_0xedad('0x21')]:_0x44dfab[_0xedad('0x1e')]+_0x44dfab[_0xedad('0x1f')];var _0x57ab65;if(_0x1c6a4e>=_0x2970bb){_0x1c6a4e=_0x2970bb;_0x57ab65=0xc8;}else{_0x57ab65=0xce;}_0x1e633c['status'](_0x57ab65);return _0x1e633c[_0xedad('0x22')]('Content-Range',_0x1dd7f2+'-'+_0x1c6a4e+'/'+_0x2970bb)[_0xedad('0x1d')](_0x3bb7c6);}return null;};}function patchUpdates(_0x5eb604){return function(_0x1ff4cb){try{jsonpatch['apply'](_0x1ff4cb,_0x5eb604,!![]);}catch(_0x47d6d9){return BPromise[_0xedad('0x23')](_0x47d6d9);}return _0x1ff4cb[_0xedad('0x24')]();};}function saveUpdates(_0x1c2243,_0x20032d){return function(_0x2484f0){if(_0x2484f0){return _0x2484f0[_0xedad('0x25')](_0x1c2243)[_0xedad('0x26')](function(_0x436410){return _0x436410;});}return null;};}function removeEntity(_0x261e96,_0x5ee776){return function(_0x2dec4f){if(_0x2dec4f){return _0x2dec4f[_0xedad('0x27')]()[_0xedad('0x26')](function(){_0x261e96[_0xedad('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7e0227,_0x4c225c){return function(_0x5d00b5){if(!_0x5d00b5){_0x7e0227['sendStatus'](0x194);}return _0x5d00b5;};}function handleError(_0x35bec8,_0x21eaef){_0x21eaef=_0x21eaef||0x1f4;return function(_0xfada42){logger[_0xedad('0x28')](_0xfada42[_0xedad('0x29')]);if(_0xfada42['name']){delete _0xfada42[_0xedad('0x2a')];}_0x35bec8[_0xedad('0x1c')](_0x21eaef)[_0xedad('0x2b')](_0xfada42);};}exports[_0xedad('0x2c')]=function(_0x3c37ba,_0x2d3da7){var _0x255a4c={},_0x48d55={},_0x342dd4={'count':0x0,'rows':[]};var _0x1a9834=_[_0xedad('0x2d')](db[_0xedad('0x2e')][_0xedad('0x2f')],function(_0x35653d){return{'name':_0x35653d[_0xedad('0x30')],'type':_0x35653d[_0xedad('0x31')]['key']};});_0x48d55[_0xedad('0x32')]=_['map'](_0x1a9834,'name');_0x48d55[_0xedad('0x33')]=_[_0xedad('0x34')](_0x3c37ba['query']);_0x48d55[_0xedad('0x35')]=_[_0xedad('0x36')](_0x48d55['model'],_0x48d55[_0xedad('0x33')]);_0x255a4c[_0xedad('0x37')]=_[_0xedad('0x36')](_0x48d55[_0xedad('0x32')],qs[_0xedad('0x38')](_0x3c37ba[_0xedad('0x33')][_0xedad('0x38')]));_0x255a4c[_0xedad('0x37')]=_0x255a4c['attributes'][_0xedad('0x39')]?_0x255a4c['attributes']:_0x48d55[_0xedad('0x32')];if(!_0x3c37ba[_0xedad('0x33')][_0xedad('0x3a')](_0xedad('0x3b'))){_0x255a4c[_0xedad('0x1f')]=qs[_0xedad('0x1f')](_0x3c37ba[_0xedad('0x33')][_0xedad('0x1f')]);_0x255a4c[_0xedad('0x1e')]=qs[_0xedad('0x1e')](_0x3c37ba['query'][_0xedad('0x1e')]);}_0x255a4c[_0xedad('0x3c')]=qs[_0xedad('0x3d')](_0x3c37ba[_0xedad('0x33')]['sort']);_0x255a4c[_0xedad('0x3e')]=qs[_0xedad('0x35')](_[_0xedad('0x3f')](_0x3c37ba[_0xedad('0x33')],_0x48d55[_0xedad('0x35')]),_0x1a9834);if(_0x3c37ba[_0xedad('0x33')][_0xedad('0x40')]){_0x255a4c['where']=_[_0xedad('0x41')](_0x255a4c[_0xedad('0x3e')],{'$or':_[_0xedad('0x2d')](_0x1a9834,function(_0x5055f2){if(_0x5055f2[_0xedad('0x31')]!==_0xedad('0x42')){var _0x269550={};_0x269550[_0x5055f2[_0xedad('0x2a')]]={'$like':'%'+_0x3c37ba[_0xedad('0x33')][_0xedad('0x40')]+'%'};return _0x269550;}})});}_0x255a4c=_['merge']({},_0x255a4c,_0x3c37ba[_0xedad('0x43')]);var _0xd95e7e={'where':_0x255a4c[_0xedad('0x3e')]};return db[_0xedad('0x2e')][_0xedad('0x21')](_0xd95e7e)[_0xedad('0x26')](function(_0x2e42e6){_0x342dd4['count']=_0x2e42e6;if(_0x3c37ba[_0xedad('0x33')][_0xedad('0x44')]){_0x255a4c['include']=[{'all':!![]}];}return db[_0xedad('0x2e')]['findAll'](_0x255a4c);})[_0xedad('0x26')](function(_0x2c5a38){_0x342dd4['rows']=_0x2c5a38;return _0x342dd4;})['then'](respondWithFilteredResult(_0x2d3da7,_0x255a4c))[_0xedad('0x45')](handleError(_0x2d3da7,null));};exports[_0xedad('0x46')]=function(_0x2424b4,_0x21443f){var _0x47e09f={'raw':!![],'where':{'id':_0x2424b4[_0xedad('0x47')]['id']}},_0x135f9e={};_0x135f9e[_0xedad('0x32')]=_[_0xedad('0x34')](db[_0xedad('0x2e')][_0xedad('0x2f')]);_0x135f9e[_0xedad('0x33')]=_['keys'](_0x2424b4[_0xedad('0x33')]);_0x135f9e[_0xedad('0x35')]=_[_0xedad('0x36')](_0x135f9e[_0xedad('0x32')],_0x135f9e[_0xedad('0x33')]);_0x47e09f[_0xedad('0x37')]=_['intersection'](_0x135f9e[_0xedad('0x32')],qs[_0xedad('0x38')](_0x2424b4['query'][_0xedad('0x38')]));_0x47e09f[_0xedad('0x37')]=_0x47e09f['attributes']['length']?_0x47e09f[_0xedad('0x37')]:_0x135f9e[_0xedad('0x32')];if(_0x2424b4[_0xedad('0x33')][_0xedad('0x44')]){_0x47e09f['include']=[{'all':!![]}];}_0x47e09f=_['merge']({},_0x47e09f,_0x2424b4[_0xedad('0x43')]);return db['ChatInternalMessage'][_0xedad('0x48')](_0x47e09f)[_0xedad('0x26')](handleEntityNotFound(_0x21443f,null))[_0xedad('0x26')](respondWithResult(_0x21443f,null))[_0xedad('0x45')](handleError(_0x21443f,null));};exports['create']=function(_0x8ea881,_0x30a98e){return db['ChatInternalMessage']['create'](_0x8ea881[_0xedad('0x49')],{})['then'](respondWithResult(_0x30a98e,0xc9))[_0xedad('0x45')](handleError(_0x30a98e,null));};exports[_0xedad('0x25')]=function(_0x1a6997,_0x1a5424){if(_0x1a6997[_0xedad('0x49')]['id']){delete _0x1a6997[_0xedad('0x49')]['id'];}return db[_0xedad('0x2e')]['find']({'where':{'id':_0x1a6997['params']['id']}})['then'](handleEntityNotFound(_0x1a5424,null))['then'](saveUpdates(_0x1a6997['body'],null))['then'](respondWithResult(_0x1a5424,null))[_0xedad('0x45')](handleError(_0x1a5424,null));};exports[_0xedad('0x27')]=function(_0x39e42e,_0x267be5){return db['ChatInternalMessage'][_0xedad('0x48')]({'where':{'id':_0x39e42e[_0xedad('0x47')]['id']}})[_0xedad('0x26')](handleEntityNotFound(_0x267be5,null))['then'](removeEntity(_0x267be5,null))[_0xedad('0x45')](handleError(_0x267be5,null));};exports[_0xedad('0x4a')]=function(_0x314671,_0x51ba8c){return db[_0xedad('0x2e')][_0xedad('0x4a')]()['then'](respondWithResult(_0x51ba8c,null))[_0xedad('0x45')](handleError(_0x51ba8c,null));};function wrapUser(_0x3bbae3){return function(_0x47c41){var _0x3c57d6=_0x3bbae3[_0xedad('0x4b')]({'plain':!![]});_0x3c57d6[_0xedad('0x4c')]=[];if(_0x47c41){_0x3c57d6[_0xedad('0x4d')]=_0x47c41[_0xedad('0x4e')];_0x3c57d6[_0xedad('0x4f')]=_0x47c41;}else{_0x3c57d6[_0xedad('0x4d')]=moment(0x0)[_0xedad('0x50')](_0xedad('0x51'));_0x3c57d6['lastMessage']={};}return _0x3c57d6;};}exports[_0xedad('0x52')]=function(_0x264515,_0x864569,_0x1b2a8c){var _0x2ae588=[];return db[_0xedad('0x53')][_0xedad('0x54')]({'where':{'role':[_0xedad('0x55'),_0xedad('0x56'),'user']},'attributes':['id',_0xedad('0x57'),_0xedad('0x2a'),_0xedad('0x58'),_0xedad('0x59'),'internal',_0xedad('0x5a'),'lastLoginAt',_0xedad('0x5b'),_0xedad('0x5c')],'order':qs[_0xedad('0x3d')](_0xedad('0x5d')),'include':[{'model':db[_0xedad('0x5e')],'as':_0xedad('0x5f'),'attributes':['id',_0xedad('0x2a'),_0xedad('0x31')],'through':{'attributes':[]}}]})[_0xedad('0x26')](function(_0x242977){if(_0x242977){var _0x46363a=_0x264515[_0xedad('0x60')][_0xedad('0x4b')]({'plain':!![]});if(!_0x46363a)throw new Error(_0xedad('0x61'));if(_0x46363a[_0xedad('0x58')]===_0xedad('0x60')){return db[_0xedad('0x62')][_0xedad('0x48')]({'where':{'name':_0xedad('0x63'),'userProfileId':_0x46363a[_0xedad('0x64')]},'raw':!![]})[_0xedad('0x26')](function(_0x1d5dbb){if(_0x1d5dbb){if(_0x1d5dbb[_0xedad('0x65')]===0x0){return db[_0xedad('0x66')]['findAll']({'where':{'sectionId':_0x1d5dbb['id']},'raw':!![]})[_0xedad('0x26')](function(_0x32448f){var _0x5d75c6=[];if(_['isEmpty'](_0x32448f)){_0x5d75c6=_[_0xedad('0x40')](_0x242977,function(_0x4af6fe){if(_0x4af6fe[_0xedad('0x58')]!==_0xedad('0x55')){return _0x4af6fe;}});return _0x5d75c6;}else{for(var _0x5586fe=0x0;_0x5586fe<_0x242977[_0xedad('0x39')];_0x5586fe++){var _0x1821e5=_0x242977[_0x5586fe];if(_0x1821e5[_0xedad('0x58')]===_0xedad('0x55')){var _0xb2b995=_['find'](_0x32448f,function(_0x2b94e3){return _0x2b94e3[_0xedad('0x67')]===_0x1821e5['id'];});if(_0xb2b995)_0x5d75c6[_0xedad('0x68')](_0x1821e5);}else{_0x5d75c6[_0xedad('0x68')](_0x1821e5);}}return _0x5d75c6;}});}else{return _0x242977;}}else{var _0x13d58b=_[_0xedad('0x40')](_0x242977,function(_0x4389ff){if(_0x4389ff['role']!==_0xedad('0x55')){return _0x4389ff;}});return _0x13d58b;}});}else{return _0x242977;}}})[_0xedad('0x26')](function(_0x6c7b2d){var _0x46ddbb=[];if(_0x6c7b2d){_0x2ae588=_0x6c7b2d;for(var _0xff2e64=0x0;_0xff2e64<_0x6c7b2d[_0xedad('0x39')];_0xff2e64+=0x1){_0x2ae588[_0xff2e64][_0xedad('0x4c')]=[];_0x46ddbb['push'](db[_0xedad('0x2e')][_0xedad('0x48')]({'where':{'FromId':[_0x264515[_0xedad('0x60')]['id'],_0x6c7b2d[_0xff2e64]['id']],'ToId':[_0x264515[_0xedad('0x60')]['id'],_0x6c7b2d[_0xff2e64]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId','ToId',_0xedad('0x69'),_0xedad('0x49')],'order':qs['sort'](_0xedad('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xedad('0x26')](wrapUser(_0x6c7b2d[_0xff2e64])));}return BPromise['all'](_0x46ddbb);}return[];})[_0xedad('0x26')](function(_0xdbdd0c){return{'rows':_0xdbdd0c,'count':_0xdbdd0c[_0xedad('0x39')]};})[_0xedad('0x26')](respondWithResult(_0x864569,null))[_0xedad('0x45')](handleError(_0x864569,null));}; \ No newline at end of file +var _0x4338=['zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','create','body','destroy','find','describe','get','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','admin','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','resourceId','push','FromId','ToId','read','-createdAt','eml-format','rimraf'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x4338,0x13c));var _0x8433=function(_0xa61faa,_0x16ee53){_0xa61faa=_0xa61faa-0x0;var _0x56cf36=_0x4338[_0xa61faa];return _0x56cf36;};'use strict';var emlformat=require(_0x8433('0x0'));var rimraf=require(_0x8433('0x1'));var zipdir=require(_0x8433('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8433('0x3'));var moment=require(_0x8433('0x4'));var BPromise=require(_0x8433('0x5'));var Mustache=require(_0x8433('0x6'));var util=require(_0x8433('0x7'));var path=require(_0x8433('0x8'));var sox=require('sox');var csv=require(_0x8433('0x9'));var ejs=require(_0x8433('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8433('0xb'));var crypto=require(_0x8433('0xc'));var jsforce=require(_0x8433('0xd'));var deskjs=require(_0x8433('0xe'));var toCsv=require(_0x8433('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8433('0xf'));var as=require(_0x8433('0x10'));var hardwareService=require(_0x8433('0x11'));var logger=require(_0x8433('0x12'))(_0x8433('0x13'));var utils=require(_0x8433('0x14'));var config=require(_0x8433('0x15'));var licenseUtil=require(_0x8433('0x16'));var db=require(_0x8433('0x17'))['db'];config['redis']=_[_0x8433('0x18')](config[_0x8433('0x19')],{'host':_0x8433('0x1a'),'port':0x18eb});var socket=require(_0x8433('0x1b'))(new Redis(config[_0x8433('0x19')]));require(_0x8433('0x1c'))[_0x8433('0x1d')](socket);function respondWithStatusCode(_0x34889e,_0x4f0cc1){_0x4f0cc1=_0x4f0cc1||0xcc;return function(_0x156e92){if(_0x156e92){return _0x34889e[_0x8433('0x1e')](_0x4f0cc1);}return _0x34889e[_0x8433('0x1f')](_0x4f0cc1)[_0x8433('0x20')]();};}function respondWithResult(_0x6bb0e4,_0xfd34d9){_0xfd34d9=_0xfd34d9||0xc8;return function(_0x193a87){if(_0x193a87){return _0x6bb0e4[_0x8433('0x1f')](_0xfd34d9)[_0x8433('0x21')](_0x193a87);}};}function respondWithFilteredResult(_0x4ae6b2,_0x5fdefe){return function(_0x1c5386){if(_0x1c5386){var _0x5ed7d5=typeof _0x5fdefe['offset']===_0x8433('0x22')&&typeof _0x5fdefe[_0x8433('0x23')]===_0x8433('0x22');var _0x40f19b=_0x1c5386[_0x8433('0x24')];var _0xd838b6=_0x5ed7d5?0x0:_0x5fdefe[_0x8433('0x25')];var _0x36c816=_0x5ed7d5?_0x1c5386['count']:_0x5fdefe[_0x8433('0x25')]+_0x5fdefe[_0x8433('0x23')];var _0xb85f1b;if(_0x36c816>=_0x40f19b){_0x36c816=_0x40f19b;_0xb85f1b=0xc8;}else{_0xb85f1b=0xce;}_0x4ae6b2[_0x8433('0x1f')](_0xb85f1b);return _0x4ae6b2['set']('Content-Range',_0xd838b6+'-'+_0x36c816+'/'+_0x40f19b)[_0x8433('0x21')](_0x1c5386);}return null;};}function patchUpdates(_0x4cdf95){return function(_0x145708){try{jsonpatch[_0x8433('0x26')](_0x145708,_0x4cdf95,!![]);}catch(_0x1c9381){return BPromise[_0x8433('0x27')](_0x1c9381);}return _0x145708[_0x8433('0x28')]();};}function saveUpdates(_0x291f9e,_0x5e372a){return function(_0x36a4cc){if(_0x36a4cc){return _0x36a4cc[_0x8433('0x29')](_0x291f9e)[_0x8433('0x2a')](function(_0x1ee55a){return _0x1ee55a;});}return null;};}function removeEntity(_0x2eeece,_0x4aea66){return function(_0xd96673){if(_0xd96673){return _0xd96673['destroy']()['then'](function(){_0x2eeece[_0x8433('0x1f')](0xcc)[_0x8433('0x20')]();});}};}function handleEntityNotFound(_0x58ef86,_0x4dd3c0){return function(_0x22a544){if(!_0x22a544){_0x58ef86['sendStatus'](0x194);}return _0x22a544;};}function handleError(_0x2d9755,_0x21d0ae){_0x21d0ae=_0x21d0ae||0x1f4;return function(_0xf13885){logger['error'](_0xf13885[_0x8433('0x2b')]);if(_0xf13885[_0x8433('0x2c')]){delete _0xf13885[_0x8433('0x2c')];}_0x2d9755[_0x8433('0x1f')](_0x21d0ae)[_0x8433('0x2d')](_0xf13885);};}exports['index']=function(_0x22e27f,_0x21dbfd){var _0x22d60a={},_0x12b3cd={},_0x3e0d35={'count':0x0,'rows':[]};var _0x56d573=_[_0x8433('0x2e')](db[_0x8433('0x2f')][_0x8433('0x30')],function(_0x306c67){return{'name':_0x306c67[_0x8433('0x31')],'type':_0x306c67[_0x8433('0x32')][_0x8433('0x33')]};});_0x12b3cd[_0x8433('0x34')]=_[_0x8433('0x2e')](_0x56d573,_0x8433('0x2c'));_0x12b3cd['query']=_[_0x8433('0x35')](_0x22e27f[_0x8433('0x36')]);_0x12b3cd[_0x8433('0x37')]=_['intersection'](_0x12b3cd[_0x8433('0x34')],_0x12b3cd[_0x8433('0x36')]);_0x22d60a['attributes']=_[_0x8433('0x38')](_0x12b3cd['model'],qs[_0x8433('0x39')](_0x22e27f['query']['fields']));_0x22d60a[_0x8433('0x3a')]=_0x22d60a[_0x8433('0x3a')][_0x8433('0x3b')]?_0x22d60a[_0x8433('0x3a')]:_0x12b3cd[_0x8433('0x34')];if(!_0x22e27f['query']['hasOwnProperty'](_0x8433('0x3c'))){_0x22d60a[_0x8433('0x23')]=qs[_0x8433('0x23')](_0x22e27f['query']['limit']);_0x22d60a[_0x8433('0x25')]=qs[_0x8433('0x25')](_0x22e27f[_0x8433('0x36')][_0x8433('0x25')]);}_0x22d60a['order']=qs[_0x8433('0x3d')](_0x22e27f[_0x8433('0x36')][_0x8433('0x3d')]);_0x22d60a[_0x8433('0x3e')]=qs['filters'](_['pick'](_0x22e27f[_0x8433('0x36')],_0x12b3cd[_0x8433('0x37')]),_0x56d573);if(_0x22e27f['query'][_0x8433('0x3f')]){_0x22d60a[_0x8433('0x3e')]=_['merge'](_0x22d60a[_0x8433('0x3e')],{'$or':_[_0x8433('0x2e')](_0x56d573,function(_0x2c694d){if(_0x2c694d['type']!==_0x8433('0x40')){var _0x15bc6e={};_0x15bc6e[_0x2c694d[_0x8433('0x2c')]]={'$like':'%'+_0x22e27f['query'][_0x8433('0x3f')]+'%'};return _0x15bc6e;}})});}_0x22d60a=_[_0x8433('0x41')]({},_0x22d60a,_0x22e27f[_0x8433('0x42')]);var _0x591cba={'where':_0x22d60a[_0x8433('0x3e')]};return db[_0x8433('0x2f')][_0x8433('0x24')](_0x591cba)['then'](function(_0x4d7143){_0x3e0d35[_0x8433('0x24')]=_0x4d7143;if(_0x22e27f['query'][_0x8433('0x43')]){_0x22d60a['include']=[{'all':!![]}];}return db[_0x8433('0x2f')][_0x8433('0x44')](_0x22d60a);})[_0x8433('0x2a')](function(_0x2010e2){_0x3e0d35[_0x8433('0x45')]=_0x2010e2;return _0x3e0d35;})[_0x8433('0x2a')](respondWithFilteredResult(_0x21dbfd,_0x22d60a))[_0x8433('0x46')](handleError(_0x21dbfd,null));};exports[_0x8433('0x47')]=function(_0x5ab806,_0x3f1632){var _0xae18bf={'raw':!![],'where':{'id':_0x5ab806[_0x8433('0x48')]['id']}},_0x213120={};_0x213120[_0x8433('0x34')]=_['keys'](db[_0x8433('0x2f')]['rawAttributes']);_0x213120[_0x8433('0x36')]=_[_0x8433('0x35')](_0x5ab806[_0x8433('0x36')]);_0x213120[_0x8433('0x37')]=_[_0x8433('0x38')](_0x213120[_0x8433('0x34')],_0x213120[_0x8433('0x36')]);_0xae18bf['attributes']=_['intersection'](_0x213120[_0x8433('0x34')],qs[_0x8433('0x39')](_0x5ab806['query']['fields']));_0xae18bf[_0x8433('0x3a')]=_0xae18bf['attributes']['length']?_0xae18bf[_0x8433('0x3a')]:_0x213120['model'];if(_0x5ab806[_0x8433('0x36')][_0x8433('0x43')]){_0xae18bf['include']=[{'all':!![]}];}_0xae18bf=_['merge']({},_0xae18bf,_0x5ab806[_0x8433('0x42')]);return db[_0x8433('0x2f')]['find'](_0xae18bf)[_0x8433('0x2a')](handleEntityNotFound(_0x3f1632,null))['then'](respondWithResult(_0x3f1632,null))[_0x8433('0x46')](handleError(_0x3f1632,null));};exports[_0x8433('0x49')]=function(_0x22e37e,_0x5bc9c2){return db[_0x8433('0x2f')]['create'](_0x22e37e[_0x8433('0x4a')],{})[_0x8433('0x2a')](respondWithResult(_0x5bc9c2,0xc9))[_0x8433('0x46')](handleError(_0x5bc9c2,null));};exports['update']=function(_0x1f3aa3,_0x3505b2){if(_0x1f3aa3[_0x8433('0x4a')]['id']){delete _0x1f3aa3[_0x8433('0x4a')]['id'];}return db[_0x8433('0x2f')]['find']({'where':{'id':_0x1f3aa3[_0x8433('0x48')]['id']}})[_0x8433('0x2a')](handleEntityNotFound(_0x3505b2,null))['then'](saveUpdates(_0x1f3aa3['body'],null))[_0x8433('0x2a')](respondWithResult(_0x3505b2,null))[_0x8433('0x46')](handleError(_0x3505b2,null));};exports[_0x8433('0x4b')]=function(_0x260430,_0x459a61){return db[_0x8433('0x2f')][_0x8433('0x4c')]({'where':{'id':_0x260430[_0x8433('0x48')]['id']}})[_0x8433('0x2a')](handleEntityNotFound(_0x459a61,null))['then'](removeEntity(_0x459a61,null))[_0x8433('0x46')](handleError(_0x459a61,null));};exports[_0x8433('0x4d')]=function(_0x55c489,_0x1a03f8){return db[_0x8433('0x2f')]['describe']()['then'](respondWithResult(_0x1a03f8,null))['catch'](handleError(_0x1a03f8,null));};function wrapUser(_0xc407a8){return function(_0x99e41d){var _0x5e0102=_0xc407a8[_0x8433('0x4e')]({'plain':!![]});_0x5e0102[_0x8433('0x4f')]=[];if(_0x99e41d){_0x5e0102[_0x8433('0x50')]=_0x99e41d[_0x8433('0x51')];_0x5e0102['lastMessage']=_0x99e41d;}else{_0x5e0102[_0x8433('0x50')]=moment(0x0)['format'](_0x8433('0x52'));_0x5e0102[_0x8433('0x53')]={};}return _0x5e0102;};}exports['getUsers']=function(_0xb0b642,_0x1cd0fb,_0x14320c){var _0x3e1c5d=[];return db[_0x8433('0x54')][_0x8433('0x44')]({'where':{'role':[_0x8433('0x55'),_0x8433('0x56'),'user']},'attributes':['id',_0x8433('0x57'),_0x8433('0x2c'),_0x8433('0x58'),_0x8433('0x59'),_0x8433('0x5a'),'online',_0x8433('0x5b'),_0x8433('0x5c'),_0x8433('0x5d')],'order':qs['sort'](_0x8433('0x5e')),'include':[{'model':db[_0x8433('0x5f')],'as':'VoiceQueues','attributes':['id',_0x8433('0x2c'),_0x8433('0x32')],'through':{'attributes':[]}}]})['then'](function(_0xd7e5e4){if(_0xd7e5e4){var _0x16f794=_0xb0b642[_0x8433('0x60')][_0x8433('0x4e')]({'plain':!![]});if(!_0x16f794)throw new Error(_0x8433('0x61'));if(_0x16f794[_0x8433('0x58')]===_0x8433('0x60')){return db[_0x8433('0x62')][_0x8433('0x4c')]({'where':{'name':'Agents','userProfileId':_0x16f794['userProfileId']},'raw':!![]})[_0x8433('0x2a')](function(_0x2327e0){if(_0x2327e0){if(_0x2327e0[_0x8433('0x63')]===0x0){return db['UserProfileResource'][_0x8433('0x44')]({'where':{'sectionId':_0x2327e0['id']},'raw':!![]})[_0x8433('0x2a')](function(_0x969033){var _0x7818b4=[];if(_['isEmpty'](_0x969033)){_0x7818b4=_['filter'](_0xd7e5e4,function(_0x7f03d2){if(_0x7f03d2[_0x8433('0x58')]!==_0x8433('0x55')){return _0x7f03d2;}});return _0x7818b4;}else{for(var _0x22e173=0x0;_0x22e173<_0xd7e5e4['length'];_0x22e173++){var _0x298997=_0xd7e5e4[_0x22e173];if(_0x298997['role']===_0x8433('0x55')){var _0x61dea5=_[_0x8433('0x4c')](_0x969033,function(_0x1c1cc2){return _0x1c1cc2[_0x8433('0x64')]===_0x298997['id'];});if(_0x61dea5)_0x7818b4[_0x8433('0x65')](_0x298997);}else{_0x7818b4['push'](_0x298997);}}return _0x7818b4;}});}else{return _0xd7e5e4;}}else{var _0x291be4=_[_0x8433('0x3f')](_0xd7e5e4,function(_0x4fc3df){if(_0x4fc3df['role']!==_0x8433('0x55')){return _0x4fc3df;}});return _0x291be4;}});}else{return _0xd7e5e4;}}})[_0x8433('0x2a')](function(_0x41500a){var _0x260dc4=[];if(_0x41500a){_0x3e1c5d=_0x41500a;for(var _0x2894ed=0x0;_0x2894ed<_0x41500a['length'];_0x2894ed+=0x1){_0x3e1c5d[_0x2894ed][_0x8433('0x4f')]=[];_0x260dc4[_0x8433('0x65')](db[_0x8433('0x2f')]['find']({'where':{'FromId':[_0xb0b642[_0x8433('0x60')]['id'],_0x41500a[_0x2894ed]['id']],'ToId':[_0xb0b642[_0x8433('0x60')]['id'],_0x41500a[_0x2894ed]['id']],'ChatGroupId':null},'attributes':['id',_0x8433('0x51'),_0x8433('0x66'),_0x8433('0x67'),_0x8433('0x68'),_0x8433('0x4a')],'order':qs[_0x8433('0x3d')](_0x8433('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8433('0x2a')](wrapUser(_0x41500a[_0x2894ed])));}return BPromise['all'](_0x260dc4);}return[];})[_0x8433('0x2a')](function(_0x10438d){return{'rows':_0x10438d,'count':_0x10438d[_0x8433('0x3b')]};})[_0x8433('0x2a')](respondWithResult(_0x1cd0fb,null))[_0x8433('0x46')](handleError(_0x1cd0fb,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 7bb9eed..07e9929 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 _0x980c=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x980c,0x100));var _0xc980=function(_0x5e63da,_0x35a5e8){_0x5e63da=_0x5e63da-0x0;var _0x3046cb=_0x980c[_0x5e63da];return _0x3046cb;};'use strict';var EventEmitter=require(_0xc980('0x0'));var ChatInternalMessage=require(_0xc980('0x1'))['db'][_0xc980('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc980('0x3')](0x0);var events={'afterCreate':_0xc980('0x4'),'afterUpdate':_0xc980('0x5'),'afterDestroy':_0xc980('0x6')};function emitEvent(_0x41d503){return function(_0x31af83,_0x3dd395,_0x2af8db){ChatInternalMessageEvents['emit'](_0x41d503+':'+_0x31af83['id'],_0x31af83);ChatInternalMessageEvents[_0xc980('0x7')](_0x41d503,_0x31af83);_0x2af8db(null);};}for(var e in events){if(events[_0xc980('0x8')](e)){var event=events[e];ChatInternalMessage[_0xc980('0x9')](e,emitEvent(event));}}module[_0xc980('0xa')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x1475=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1475,0x144));var _0x5147=function(_0x2a7b8e,_0x50ffce){_0x2a7b8e=_0x2a7b8e-0x0;var _0x29b5c8=_0x1475[_0x2a7b8e];return _0x29b5c8;};'use strict';var EventEmitter=require(_0x5147('0x0'));var ChatInternalMessage=require(_0x5147('0x1'))['db'][_0x5147('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5147('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5147('0x4'),'afterDestroy':_0x5147('0x5')};function emitEvent(_0x4dac3e){return function(_0x4fcf2c,_0x2ba165,_0x113b91){ChatInternalMessageEvents[_0x5147('0x6')](_0x4dac3e+':'+_0x4fcf2c['id'],_0x4fcf2c);ChatInternalMessageEvents[_0x5147('0x6')](_0x4dac3e,_0x4fcf2c);_0x113b91(null);};}for(var e in events){if(events[_0x5147('0x7')](e)){var event=events[e];ChatInternalMessage[_0x5147('0x8')](e,emitEvent(event));}}module[_0x5147('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 76d7449..badf7c8 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 _0x39de=['request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','../../config/logger','api','moment','bluebird'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x39de,0x145));var _0xe39d=function(_0x4bf83e,_0x429223){_0x4bf83e=_0x4bf83e-0x0;var _0x5647c9=_0x39de[_0x4bf83e];return _0x5647c9;};'use strict';var _=require(_0xe39d('0x0'));var util=require('util');var logger=require(_0xe39d('0x1'))(_0xe39d('0x2'));var moment=require(_0xe39d('0x3'));var BPromise=require(_0xe39d('0x4'));var rp=require(_0xe39d('0x5'));var fs=require('fs');var path=require(_0xe39d('0x6'));var rimraf=require(_0xe39d('0x7'));var config=require(_0xe39d('0x8'));var attributes=require(_0xe39d('0x9'));module[_0xe39d('0xa')]=function(_0x327568,_0x50b77b){return _0x327568[_0xe39d('0xb')](_0xe39d('0xc'),attributes,{'tableName':_0xe39d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe39d('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6c09=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','utf8mb4'];(function(_0x1282a0,_0x58b2f9){var _0x18af0c=function(_0x5ac73f){while(--_0x5ac73f){_0x1282a0['push'](_0x1282a0['shift']());}};_0x18af0c(++_0x58b2f9);}(_0x6c09,0x1ae));var _0x96c0=function(_0x29c8fe,_0x2210bb){_0x29c8fe=_0x29c8fe-0x0;var _0x44a2bc=_0x6c09[_0x29c8fe];return _0x44a2bc;};'use strict';var _=require(_0x96c0('0x0'));var util=require('util');var logger=require(_0x96c0('0x1'))(_0x96c0('0x2'));var moment=require(_0x96c0('0x3'));var BPromise=require(_0x96c0('0x4'));var rp=require(_0x96c0('0x5'));var fs=require('fs');var path=require(_0x96c0('0x6'));var rimraf=require(_0x96c0('0x7'));var config=require('../../config/environment');var attributes=require(_0x96c0('0x8'));module[_0x96c0('0x9')]=function(_0x3db888,_0x4a930c){return _0x3db888[_0x96c0('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x96c0('0xb'),'collate':_0x96c0('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 1e7d0ee..b04368c 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 _0x33dc=['then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0xcfdb3b,_0x2eb63d){var _0x3e1505=function(_0x91fac2){while(--_0x91fac2){_0xcfdb3b['push'](_0xcfdb3b['shift']());}};_0x3e1505(++_0x2eb63d);}(_0x33dc,0x91));var _0xc33d=function(_0x5be7aa,_0x5de661){_0x5be7aa=_0x5be7aa-0x0;var _0x215408=_0x33dc[_0x5be7aa];return _0x215408;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc33d('0x0'));var BPromise=require('bluebird');var rs=require(_0xc33d('0x1'));var fs=require('fs');var Redis=require(_0xc33d('0x2'));var db=require(_0xc33d('0x3'))['db'];var utils=require(_0xc33d('0x4'));var logger=require(_0xc33d('0x5'))(_0xc33d('0x6'));var config=require(_0xc33d('0x7'));var jayson=require(_0xc33d('0x8'));var client=jayson[_0xc33d('0x9')][_0xc33d('0xa')]({'port':0x232a});config['redis']=_[_0xc33d('0xb')](config[_0xc33d('0xc')],{'host':_0xc33d('0xd'),'port':0x18eb});var socket=require(_0xc33d('0xe'))(new Redis(config['redis']));require(_0xc33d('0xf'))[_0xc33d('0x10')](socket);function respondWithRpcPromise(_0x3ca8d4,_0x94212f,_0x362cf0){return new BPromise(function(_0x143d8a,_0x1e7323){return client['request'](_0x3ca8d4,_0x362cf0)[_0xc33d('0x11')](function(_0x5bb189){logger[_0xc33d('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x94212f,'request\x20sent');logger[_0xc33d('0x13')](_0xc33d('0x14'),_0x94212f,_0xc33d('0x15'),JSON[_0xc33d('0x16')](_0x5bb189));if(_0x5bb189[_0xc33d('0x17')]){if(_0x5bb189[_0xc33d('0x17')][_0xc33d('0x18')]===0x1f4){logger[_0xc33d('0x17')](_0xc33d('0x19'),_0x94212f,_0x5bb189[_0xc33d('0x17')][_0xc33d('0x1a')]);return _0x1e7323(_0x5bb189[_0xc33d('0x17')][_0xc33d('0x1a')]);}logger[_0xc33d('0x17')](_0xc33d('0x19'),_0x94212f,_0x5bb189[_0xc33d('0x17')][_0xc33d('0x1a')]);return _0x143d8a(_0x5bb189[_0xc33d('0x17')][_0xc33d('0x1a')]);}else{logger[_0xc33d('0x12')](_0xc33d('0x19'),_0x94212f,'request\x20sent');_0x143d8a(_0x5bb189['result'][_0xc33d('0x1a')]);}})['catch'](function(_0x44d16b){logger[_0xc33d('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x94212f,_0x44d16b);_0x1e7323(_0x44d16b);});});} \ No newline at end of file +var _0x7ec0=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xa3b39f,_0x1f6984){var _0x2337b7=function(_0x5de041){while(--_0x5de041){_0xa3b39f['push'](_0xa3b39f['shift']());}};_0x2337b7(++_0x1f6984);}(_0x7ec0,0x129));var _0x07ec=function(_0x13da0b,_0x31c1c6){_0x13da0b=_0x13da0b-0x0;var _0x5c9ea9=_0x7ec0[_0x13da0b];return _0x5c9ea9;};'use strict';var _=require(_0x07ec('0x0'));var util=require(_0x07ec('0x1'));var moment=require(_0x07ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x07ec('0x3'));var fs=require('fs');var Redis=require(_0x07ec('0x4'));var db=require(_0x07ec('0x5'))['db'];var utils=require(_0x07ec('0x6'));var logger=require(_0x07ec('0x7'))('rpc');var config=require(_0x07ec('0x8'));var jayson=require(_0x07ec('0x9'));var client=jayson['client'][_0x07ec('0xa')]({'port':0x232a});config[_0x07ec('0xb')]=_[_0x07ec('0xc')](config[_0x07ec('0xb')],{'host':_0x07ec('0xd'),'port':0x18eb});var socket=require(_0x07ec('0xe'))(new Redis(config['redis']));require(_0x07ec('0xf'))[_0x07ec('0x10')](socket);function respondWithRpcPromise(_0x238ae3,_0x41b76e,_0x2054c9){return new BPromise(function(_0x26157d,_0x30ba35){return client[_0x07ec('0x11')](_0x238ae3,_0x2054c9)[_0x07ec('0x12')](function(_0x1b1416){logger[_0x07ec('0x13')](_0x07ec('0x14'),_0x41b76e,_0x07ec('0x15'));logger[_0x07ec('0x16')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x41b76e,_0x07ec('0x15'),JSON[_0x07ec('0x17')](_0x1b1416));if(_0x1b1416['error']){if(_0x1b1416[_0x07ec('0x18')][_0x07ec('0x19')]===0x1f4){logger[_0x07ec('0x18')](_0x07ec('0x14'),_0x41b76e,_0x1b1416[_0x07ec('0x18')]['message']);return _0x30ba35(_0x1b1416[_0x07ec('0x18')]['message']);}logger[_0x07ec('0x18')](_0x07ec('0x14'),_0x41b76e,_0x1b1416['error'][_0x07ec('0x1a')]);return _0x26157d(_0x1b1416[_0x07ec('0x18')]['message']);}else{logger['info'](_0x07ec('0x14'),_0x41b76e,_0x07ec('0x15'));_0x26157d(_0x1b1416['result'][_0x07ec('0x1a')]);}})['catch'](function(_0x2a9eeb){logger[_0x07ec('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x41b76e,_0x2a9eeb);_0x30ba35(_0x2a9eeb);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 0b215cf..2100d9f 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 _0x5a55=['register','chatInternalMessage:','./chatInternalMessage.events','save','update','emit','removeListener'];(function(_0x3ecf87,_0x1e07a9){var _0x4fae46=function(_0x4d5ba4){while(--_0x4d5ba4){_0x3ecf87['push'](_0x3ecf87['shift']());}};_0x4fae46(++_0x1e07a9);}(_0x5a55,0x1bb));var _0x55a5=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x5a55[_0x231e16];return _0x570a7c;};'use strict';var ChatInternalMessageEvents=require(_0x55a5('0x0'));var events=[_0x55a5('0x1'),'remove',_0x55a5('0x2')];function createListener(_0x261940,_0xb56eae){return function(_0x4d3c5f){_0xb56eae[_0x55a5('0x3')](_0x261940,_0x4d3c5f);};}function removeListener(_0x357ddc,_0x1b2b57){return function(){ChatInternalMessageEvents[_0x55a5('0x4')](_0x357ddc,_0x1b2b57);};}exports[_0x55a5('0x5')]=function(_0x50605a){for(var _0x3266d0=0x0,_0x25e3f7=events['length'];_0x3266d0<_0x25e3f7;_0x3266d0++){var _0x472df6=events[_0x3266d0];var _0x391da7=createListener(_0x55a5('0x6')+_0x472df6,_0x50605a);ChatInternalMessageEvents['on'](_0x472df6,_0x391da7);}}; \ No newline at end of file +var _0x0ddb=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0x0ddb,0xb7));var _0xb0dd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ddb[_0x321bb2];return _0x9c12ed;};'use strict';var ChatInternalMessageEvents=require(_0xb0dd('0x0'));var events=[_0xb0dd('0x1'),_0xb0dd('0x2'),_0xb0dd('0x3')];function createListener(_0x2852e1,_0x20b7aa){return function(_0x1706de){_0x20b7aa[_0xb0dd('0x4')](_0x2852e1,_0x1706de);};}function removeListener(_0x3bb346,_0x147a1d){return function(){ChatInternalMessageEvents[_0xb0dd('0x5')](_0x3bb346,_0x147a1d);};}exports['register']=function(_0x1977b3){for(var _0x1112ad=0x0,_0x15a80b=events['length'];_0x1112ad<_0x15a80b;_0x1112ad++){var _0x4bf742=events[_0x1112ad];var _0x5100c7=createListener(_0xb0dd('0x6')+_0x4bf742,_0x1977b3);ChatInternalMessageEvents['on'](_0x4bf742,_0x5100c7);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 885a481..3a4c273 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 _0x87c6=['express','Router','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2a6501,_0x9c5a0e){var _0x34d3ae=function(_0x204c8b){while(--_0x204c8b){_0x2a6501['push'](_0x2a6501['shift']());}};_0x34d3ae(++_0x9c5a0e);}(_0x87c6,0x150));var _0x687c=function(_0x48260b,_0x496068){_0x48260b=_0x48260b-0x0;var _0x15213f=_0x87c6[_0x48260b];return _0x15213f;};'use strict';var multer=require(_0x687c('0x0'));var util=require(_0x687c('0x1'));var path=require(_0x687c('0x2'));var timeout=require(_0x687c('0x3'));var express=require(_0x687c('0x4'));var router=express[_0x687c('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(_0x687c('0x6'));router[_0x687c('0x7')]('/',auth[_0x687c('0x8')](),controller['index']);router[_0x687c('0x7')](_0x687c('0x9'),auth[_0x687c('0x8')](),controller[_0x687c('0xa')]);router[_0x687c('0x7')](_0x687c('0xb'),auth[_0x687c('0x8')](),controller[_0x687c('0xc')]);router[_0x687c('0x7')](_0x687c('0xd'),auth[_0x687c('0x8')](),controller['show']);router[_0x687c('0xe')]('/',auth['isAuthenticated'](),controller[_0x687c('0xf')]);router['put']('/:id',controller[_0x687c('0x10')]);router[_0x687c('0x11')]('/:id',auth[_0x687c('0x8')](),controller[_0x687c('0x12')]);module[_0x687c('0x13')]=router; \ No newline at end of file +var _0xd2dc=['destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','/:id','show','post','put','update','delete'];(function(_0x23678e,_0x450fea){var _0x49b025=function(_0x4bba73){while(--_0x4bba73){_0x23678e['push'](_0x23678e['shift']());}};_0x49b025(++_0x450fea);}(_0xd2dc,0x18e));var _0xcd2d=function(_0xcef86f,_0x24dc09){_0xcef86f=_0xcef86f-0x0;var _0xd61e3=_0xd2dc[_0xcef86f];return _0xd61e3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcd2d('0x0'));var timeout=require(_0xcd2d('0x1'));var express=require(_0xcd2d('0x2'));var router=express['Router']();var fs_extra=require(_0xcd2d('0x3'));var auth=require(_0xcd2d('0x4'));var interaction=require(_0xcd2d('0x5'));var config=require(_0xcd2d('0x6'));var controller=require(_0xcd2d('0x7'));router[_0xcd2d('0x8')]('/',auth[_0xcd2d('0x9')](),controller[_0xcd2d('0xa')]);router[_0xcd2d('0x8')](_0xcd2d('0xb'),auth['isAuthenticated'](),controller[_0xcd2d('0xc')]);router[_0xcd2d('0x8')](_0xcd2d('0xd'),auth[_0xcd2d('0x9')](),controller['getUsers']);router[_0xcd2d('0x8')](_0xcd2d('0xe'),auth[_0xcd2d('0x9')](),controller[_0xcd2d('0xf')]);router[_0xcd2d('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcd2d('0x11')](_0xcd2d('0xe'),controller[_0xcd2d('0x12')]);router[_0xcd2d('0x13')](_0xcd2d('0xe'),auth[_0xcd2d('0x9')](),controller[_0xcd2d('0x14')]);module[_0xcd2d('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 6e253db..d194fad 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 _0x81cb=['DATE','TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0x3d602a,_0x229900){var _0x46b2e8=function(_0x278a2b){while(--_0x278a2b){_0x3d602a['push'](_0x3d602a['shift']());}};_0x46b2e8(++_0x229900);}(_0x81cb,0xaa));var _0xb81c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81cb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb81c('0x0'));module[_0xb81c('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb81c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb81c('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb81c('0x4')]('in',_0xb81c('0x5')),'defaultValue':_0xb81c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb81c('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb81c('0x7')]}}; \ No newline at end of file +var _0x83e1=['BOOLEAN','out','DATE','sequelize','exports','medium'];(function(_0x4e79d6,_0x152a4f){var _0x530183=function(_0x591ef0){while(--_0x591ef0){_0x4e79d6['push'](_0x4e79d6['shift']());}};_0x530183(++_0x152a4f);}(_0x83e1,0x1ad));var _0x183e=function(_0x145eb2,_0x396cab){_0x145eb2=_0x145eb2-0x0;var _0x447d25=_0x83e1[_0x145eb2];return _0x447d25;};'use strict';var Sequelize=require(_0x183e('0x0'));module[_0x183e('0x1')]={'body':{'type':Sequelize['TEXT'](_0x183e('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x183e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x183e('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x183e('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 663e647..9fc18e8 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 _0x9d32=['key','model','map','name','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','destroy','describe','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','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','QueryTypes','SELECT','contact','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat-interactions','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','internal','formData','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','update','send','index','ChatMessage','fieldName','type'];(function(_0x3f3658,_0x2ae9c7){var _0x1725cc=function(_0x3dae42){while(--_0x3dae42){_0x3f3658['push'](_0x3f3658['shift']());}};_0x1725cc(++_0x2ae9c7);}(_0x9d32,0x15e));var _0x29d3=function(_0x10a212,_0x579d85){_0x10a212=_0x10a212-0x0;var _0x23c82b=_0x9d32[_0x10a212];return _0x23c82b;};'use strict';var emlformat=require(_0x29d3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x29d3('0x1'));var jsonpatch=require(_0x29d3('0x2'));var rp=require('request-promise');var moment=require(_0x29d3('0x3'));var BPromise=require(_0x29d3('0x4'));var Mustache=require(_0x29d3('0x5'));var util=require('util');var path=require(_0x29d3('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x29d3('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x29d3('0x8'));var squel=require(_0x29d3('0x9'));var crypto=require(_0x29d3('0xa'));var jsforce=require(_0x29d3('0xb'));var deskjs=require(_0x29d3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x29d3('0xd'));var Papa=require(_0x29d3('0xe'));var Redis=require('ioredis');var authService=require(_0x29d3('0xf'));var qs=require(_0x29d3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29d3('0x11'));var logger=require(_0x29d3('0x12'))(_0x29d3('0x13'));var utils=require(_0x29d3('0x14'));var config=require(_0x29d3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x29d3('0x16'))['db'];config[_0x29d3('0x17')]=_[_0x29d3('0x18')](config[_0x29d3('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x29d3('0x19'))(new Redis(config['redis']));require(_0x29d3('0x1a'))[_0x29d3('0x1b')](socket);var jayson=require(_0x29d3('0x1c'));var client=jayson[_0x29d3('0x1d')][_0x29d3('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x12af08,_0x62336d,_0x3e048b,_0x438b81){return new BPromise(function(_0x37f0f3,_0xcfc8d7){var _0x58a323=_0x438b81||client;return _0x58a323[_0x29d3('0x1f')](_0x12af08,_0x3e048b)[_0x29d3('0x20')](function(_0x1b4bcb){logger[_0x29d3('0x21')]('ChatMessage,\x20%s,\x20%s',_0x62336d,_0x29d3('0x22'));logger[_0x29d3('0x23')](_0x29d3('0x24'),_0x62336d,_0x29d3('0x22'),JSON[_0x29d3('0x25')](_0x1b4bcb));if(_0x1b4bcb[_0x29d3('0x26')]){if(_0x1b4bcb[_0x29d3('0x26')][_0x29d3('0x27')]===0x1f4){logger[_0x29d3('0x26')]('ChatMessage,\x20%s,\x20%s',_0x62336d,_0x1b4bcb['error']['message']);return _0xcfc8d7(_0x1b4bcb[_0x29d3('0x26')]['message']);}logger[_0x29d3('0x26')](_0x29d3('0x28'),_0x62336d,_0x1b4bcb[_0x29d3('0x26')][_0x29d3('0x29')]);return _0x37f0f3(_0x1b4bcb[_0x29d3('0x26')][_0x29d3('0x29')]);}else{logger[_0x29d3('0x21')]('ChatMessage,\x20%s,\x20%s',_0x62336d,'request\x20sent');_0x37f0f3(_0x1b4bcb[_0x29d3('0x2a')][_0x29d3('0x29')]);}})['catch'](function(_0x4b2124){logger['error'](_0x29d3('0x28'),_0x62336d,_0x4b2124);_0xcfc8d7(_0x4b2124);});});}function respondWithStatusCode(_0x464b09,_0x2c3952){_0x2c3952=_0x2c3952||0xcc;return function(_0x4796a0){if(_0x4796a0){return _0x464b09[_0x29d3('0x2b')](_0x2c3952);}return _0x464b09['status'](_0x2c3952)[_0x29d3('0x2c')]();};}function respondWithResult(_0x19f3f0,_0x58ba65){_0x58ba65=_0x58ba65||0xc8;return function(_0x1a1471){if(_0x1a1471){return _0x19f3f0[_0x29d3('0x2d')](_0x58ba65)[_0x29d3('0x2e')](_0x1a1471);}};}function respondWithFilteredResult(_0x570325,_0x3ac954){return function(_0x45cab7){if(_0x45cab7){var _0x5ef601=typeof _0x3ac954[_0x29d3('0x2f')]===_0x29d3('0x30')&&typeof _0x3ac954['limit']==='undefined';var _0x8201ab=_0x45cab7[_0x29d3('0x31')];var _0x2c8719=_0x5ef601?0x0:_0x3ac954[_0x29d3('0x2f')];var _0x5af1f1=_0x5ef601?_0x45cab7[_0x29d3('0x31')]:_0x3ac954[_0x29d3('0x2f')]+_0x3ac954['limit'];var _0x2d6e96;if(_0x5af1f1>=_0x8201ab){_0x5af1f1=_0x8201ab;_0x2d6e96=0xc8;}else{_0x2d6e96=0xce;}_0x570325[_0x29d3('0x2d')](_0x2d6e96);return _0x570325[_0x29d3('0x32')](_0x29d3('0x33'),_0x2c8719+'-'+_0x5af1f1+'/'+_0x8201ab)[_0x29d3('0x2e')](_0x45cab7);}return null;};}function patchUpdates(_0x1998c2){return function(_0x49e40d){try{jsonpatch['apply'](_0x49e40d,_0x1998c2,!![]);}catch(_0x45c8d5){return BPromise['reject'](_0x45c8d5);}return _0x49e40d['save']();};}function saveUpdates(_0x22b6dc,_0x14f146){return function(_0x591fc9){if(_0x591fc9){return _0x591fc9[_0x29d3('0x34')](_0x22b6dc)[_0x29d3('0x20')](function(_0x55d2b8){return _0x55d2b8;});}return null;};}function removeEntity(_0x4695f8,_0x64a1a4){return function(_0x12aabf){if(_0x12aabf){return _0x12aabf['destroy']()['then'](function(){_0x4695f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54b12e,_0x261bfd){return function(_0xaa0abe){if(!_0xaa0abe){_0x54b12e[_0x29d3('0x2b')](0x194);}return _0xaa0abe;};}function handleError(_0x1f5df1,_0x10421f){_0x10421f=_0x10421f||0x1f4;return function(_0x4f36fe){logger[_0x29d3('0x26')](_0x4f36fe['stack']);if(_0x4f36fe['name']){delete _0x4f36fe['name'];}_0x1f5df1[_0x29d3('0x2d')](_0x10421f)[_0x29d3('0x35')](_0x4f36fe);};}exports[_0x29d3('0x36')]=function(_0x4c4166,_0x2630d9){var _0x35ccda={},_0x3dff6f={},_0x2d067a={'count':0x0,'rows':[]};var _0x4f27b3=_['map'](db[_0x29d3('0x37')]['rawAttributes'],function(_0x56067f){return{'name':_0x56067f[_0x29d3('0x38')],'type':_0x56067f[_0x29d3('0x39')][_0x29d3('0x3a')]};});_0x3dff6f[_0x29d3('0x3b')]=_[_0x29d3('0x3c')](_0x4f27b3,_0x29d3('0x3d'));_0x3dff6f[_0x29d3('0x3e')]=_['keys'](_0x4c4166['query']);_0x3dff6f['filters']=_[_0x29d3('0x3f')](_0x3dff6f[_0x29d3('0x3b')],_0x3dff6f['query']);_0x35ccda['attributes']=_[_0x29d3('0x3f')](_0x3dff6f['model'],qs[_0x29d3('0x40')](_0x4c4166[_0x29d3('0x3e')][_0x29d3('0x40')]));_0x35ccda[_0x29d3('0x41')]=_0x35ccda[_0x29d3('0x41')][_0x29d3('0x42')]?_0x35ccda[_0x29d3('0x41')]:_0x3dff6f[_0x29d3('0x3b')];if(!_0x4c4166[_0x29d3('0x3e')][_0x29d3('0x43')]('nolimit')){_0x35ccda['limit']=qs[_0x29d3('0x44')](_0x4c4166[_0x29d3('0x3e')][_0x29d3('0x44')]);_0x35ccda['offset']=qs[_0x29d3('0x2f')](_0x4c4166[_0x29d3('0x3e')][_0x29d3('0x2f')]);}_0x35ccda[_0x29d3('0x45')]=qs[_0x29d3('0x46')](_0x4c4166[_0x29d3('0x3e')][_0x29d3('0x46')]);_0x35ccda[_0x29d3('0x47')]=qs[_0x29d3('0x48')](_[_0x29d3('0x49')](_0x4c4166[_0x29d3('0x3e')],_0x3dff6f[_0x29d3('0x48')]),_0x4f27b3);if(_0x4c4166[_0x29d3('0x3e')][_0x29d3('0x4a')]){_0x35ccda['where']=_[_0x29d3('0x4b')](_0x35ccda[_0x29d3('0x47')],{'$or':_[_0x29d3('0x3c')](_0x4f27b3,function(_0x395aee){if(_0x395aee[_0x29d3('0x39')]!==_0x29d3('0x4c')){var _0x4bf18d={};_0x4bf18d[_0x395aee['name']]={'$like':'%'+_0x4c4166[_0x29d3('0x3e')][_0x29d3('0x4a')]+'%'};return _0x4bf18d;}})});}_0x35ccda=_[_0x29d3('0x4b')]({},_0x35ccda,_0x4c4166[_0x29d3('0x4d')]);var _0x2a8426={'where':_0x35ccda[_0x29d3('0x47')]};return db[_0x29d3('0x37')][_0x29d3('0x31')](_0x2a8426)['then'](function(_0x4a947c){_0x2d067a[_0x29d3('0x31')]=_0x4a947c;if(_0x4c4166[_0x29d3('0x3e')]['includeAll']){_0x35ccda[_0x29d3('0x4e')]=[{'all':!![]}];}return db['ChatMessage'][_0x29d3('0x4f')](_0x35ccda);})[_0x29d3('0x20')](function(_0x19399f){_0x2d067a[_0x29d3('0x50')]=_0x19399f;return _0x2d067a;})['then'](respondWithFilteredResult(_0x2630d9,_0x35ccda))[_0x29d3('0x51')](handleError(_0x2630d9,null));};exports[_0x29d3('0x52')]=function(_0x25b903,_0x28f56a){var _0x312c2f={'raw':!![],'where':{'id':_0x25b903[_0x29d3('0x53')]['id']}},_0x4ebcb2={};_0x4ebcb2[_0x29d3('0x3b')]=_[_0x29d3('0x54')](db[_0x29d3('0x37')][_0x29d3('0x55')]);_0x4ebcb2[_0x29d3('0x3e')]=_[_0x29d3('0x54')](_0x25b903[_0x29d3('0x3e')]);_0x4ebcb2['filters']=_[_0x29d3('0x3f')](_0x4ebcb2[_0x29d3('0x3b')],_0x4ebcb2['query']);_0x312c2f[_0x29d3('0x41')]=_[_0x29d3('0x3f')](_0x4ebcb2['model'],qs[_0x29d3('0x40')](_0x25b903[_0x29d3('0x3e')][_0x29d3('0x40')]));_0x312c2f[_0x29d3('0x41')]=_0x312c2f[_0x29d3('0x41')][_0x29d3('0x42')]?_0x312c2f['attributes']:_0x4ebcb2['model'];if(_0x25b903['query'][_0x29d3('0x56')]){_0x312c2f['include']=[{'all':!![]}];}_0x312c2f=_[_0x29d3('0x4b')]({},_0x312c2f,_0x25b903[_0x29d3('0x4d')]);return db[_0x29d3('0x37')][_0x29d3('0x57')](_0x312c2f)[_0x29d3('0x20')](handleEntityNotFound(_0x28f56a,null))[_0x29d3('0x20')](respondWithResult(_0x28f56a,null))[_0x29d3('0x51')](handleError(_0x28f56a,null));};exports[_0x29d3('0x58')]=function(_0x137fe7,_0x2c47ae){return db[_0x29d3('0x37')][_0x29d3('0x58')](_0x137fe7[_0x29d3('0x59')],{})[_0x29d3('0x20')](respondWithResult(_0x2c47ae,0xc9))[_0x29d3('0x51')](handleError(_0x2c47ae,null));};exports[_0x29d3('0x34')]=function(_0x56f7cb,_0xdc9439){if(_0x56f7cb[_0x29d3('0x59')]['id']){delete _0x56f7cb[_0x29d3('0x59')]['id'];}return db['ChatMessage'][_0x29d3('0x57')]({'where':{'id':_0x56f7cb['params']['id']}})[_0x29d3('0x20')](handleEntityNotFound(_0xdc9439,null))[_0x29d3('0x20')](saveUpdates(_0x56f7cb[_0x29d3('0x59')],null))['then'](respondWithResult(_0xdc9439,null))['catch'](handleError(_0xdc9439,null));};exports[_0x29d3('0x5a')]=function(_0x34d950,_0x3e7b9f){return db[_0x29d3('0x37')][_0x29d3('0x57')]({'where':{'id':_0x34d950['params']['id']}})[_0x29d3('0x20')](handleEntityNotFound(_0x3e7b9f,null))[_0x29d3('0x20')](removeEntity(_0x3e7b9f,null))['catch'](handleError(_0x3e7b9f,null));};exports[_0x29d3('0x5b')]=function(_0x4a6e8d,_0x26f936){return db[_0x29d3('0x37')][_0x29d3('0x5b')]()[_0x29d3('0x20')](respondWithResult(_0x26f936,null))['catch'](handleError(_0x26f936,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x29d3('0x5c')]=function(_0x5dc377,_0x2f9e43,_0x402e0b){var _0x24c544={'agent':{},'channel':_0x29d3('0x5d')};if(_0x5dc377[_0x29d3('0x59')]['id']){delete _0x5dc377[_0x29d3('0x59')]['id'];}_0x5dc377[_0x29d3('0x59')][_0x29d3('0x5e')]=!![];_0x5dc377['body'][_0x29d3('0x5f')]=moment()['format'](_0x29d3('0x60'));_0x5dc377['body'][_0x29d3('0x61')]=_0x5dc377['body'][_0x29d3('0x61')]||_0x5dc377[_0x29d3('0x62')]['id'];_0x24c544[_0x29d3('0x63')]['id']=_0x5dc377['body'][_0x29d3('0x61')];return db[_0x29d3('0x37')]['find']({'where':{'id':_0x5dc377['params']['id'],'UserId':null}})[_0x29d3('0x20')](handleEntityNotFound(_0x2f9e43,null))[_0x29d3('0x20')](saveUpdates(_0x5dc377[_0x29d3('0x59')],null))[_0x29d3('0x20')](function(_0x2a776c){if(_0x2a776c){_0x24c544[_0x29d3('0x29')]=_0x2a776c[_0x29d3('0x64')]({'plain':!![]});return db[_0x29d3('0x65')][_0x29d3('0x57')]({'where':{'id':_0x2a776c[_0x29d3('0x66')]}});}return null;})[_0x29d3('0x20')](handleEntityNotFound(_0x2f9e43,null))['then'](function(_0x2ffa38){if(_0x2ffa38){return _0x2ffa38[_0x29d3('0x34')]({'UserId':_0x5dc377['body']['UserId'],'read1stAt':_[_0x29d3('0x67')](_0x2ffa38[_0x29d3('0x68')])?moment()[_0x29d3('0x69')](_0x29d3('0x60')):undefined});}return null;})[_0x29d3('0x20')](function(_0x306e68){if(_0x306e68){_0x24c544[_0x29d3('0x6a')]=_0x306e68[_0x29d3('0x64')]({'plain':!![]});interaction_log[_0x29d3('0x21')](_0x29d3('0x6b'),_0x5dc377[_0x29d3('0x62')]['id'],_0x5dc377[_0x29d3('0x62')][_0x29d3('0x3d')],_0x5dc377['user'][_0x29d3('0x6c')],_0x24c544['interaction']['id'],_0x5dc377[_0x29d3('0x59')]?JSON['stringify'](_0x5dc377[_0x29d3('0x59')]):_0x29d3('0x6d'));return respondWithRpcPromise(_0x29d3('0x6e'),'acceptMessage',_0x24c544);}return null;})[_0x29d3('0x20')](function(_0x29dcce){var _0x4bc6e8=_0x29d3('0x6f')+_0x29dcce[_0x29d3('0x29')][_0x29d3('0x70')];return db[_0x29d3('0x71')][_0x29d3('0x3e')](_0x4bc6e8,{'type':db['Sequelize'][_0x29d3('0x72')][_0x29d3('0x73')],'raw':!![]})[_0x29d3('0x20')](function(_0x52c93d){return _0x52c93d;});})['then'](function(_0x227e77){if(_0x227e77){_0x24c544[_0x29d3('0x29')][_0x29d3('0x74')]=_0x227e77[0x0];if(!_0x5dc377[_0x29d3('0x59')][_0x29d3('0x61')])return;return db['User']['find']({'where':{'id':_0x5dc377['body']['UserId'],'role':'agent'},'attributes':['id',_0x29d3('0x3d'),_0x29d3('0x75'),_0x29d3('0x76'),'internal'],'raw':!![]});}return null;})['then'](function(_0xe2734e){if(!_0xe2734e)return null;_0x24c544[_0x29d3('0x29')][_0x29d3('0x63')]=_0xe2734e;return _0x24c544;})[_0x29d3('0x20')](function(_0x2d6899){if(_0x2d6899){if(_0x5dc377[_0x29d3('0x59')][_0x29d3('0x77')]){_0x24c544['message'][_0x29d3('0x78')]=util['format'](_0x29d3('0x79'),_0x5dc377['user'][_0x29d3('0x3d')]);_0x24c544[_0x29d3('0x29')][_0x29d3('0x7a')]=_0x24c544[_0x29d3('0x7a')];_0x24c544['message'][_0x29d3('0x7b')]=_0x24c544[_0x29d3('0x7a')];_0x24c544['message'][_0x29d3('0x7c')]='accept';return respondWithRpcPromise('EventManager',_0x29d3('0x7d'),{'event':_0x29d3('0x7e'),'message':_[_0x29d3('0x4b')](_0x24c544[_0x29d3('0x29')],JSON[_0x29d3('0x7f')](_0x24c544['interaction']['formData']))},client9002)['then'](function(){return _0x24c544;});}return _0x24c544;}return null;})['then'](respondWithResult(_0x2f9e43,null))[_0x29d3('0x51')](handleError(_0x2f9e43,null));};var interaction_log=require(_0x29d3('0x12'))(_0x29d3('0x80'));exports[_0x29d3('0x81')]=function(_0x1a5101,_0x61fbd3,_0x101497){var _0xbc22c7={'agent':{},'channel':_0x29d3('0x5d')};if(_0x1a5101[_0x29d3('0x59')]['id']){delete _0x1a5101[_0x29d3('0x59')]['id'];}_0x1a5101['body'][_0x29d3('0x61')]=_0x1a5101[_0x29d3('0x59')][_0x29d3('0x61')]||_0x1a5101[_0x29d3('0x62')]['id'];_0xbc22c7['agent']['id']=_0x1a5101[_0x29d3('0x59')]['UserId'];return db['ChatMessage']['find']({'where':{'id':_0x1a5101[_0x29d3('0x53')]['id'],'UserId':null}})[_0x29d3('0x20')](handleEntityNotFound(_0x61fbd3,null))[_0x29d3('0x20')](function(_0x13c172){if(_0x13c172){_0xbc22c7[_0x29d3('0x29')]=_0x13c172[_0x29d3('0x64')]({'plain':!![]});return db[_0x29d3('0x65')][_0x29d3('0x57')]({'where':{'id':_0x13c172['ChatInteractionId']}});}return null;})[_0x29d3('0x20')](handleEntityNotFound(_0x61fbd3,null))[_0x29d3('0x20')](function(_0x375d7e){if(_0x375d7e){_0xbc22c7[_0x29d3('0x6a')]=_0x375d7e[_0x29d3('0x64')]({'plain':!![]});interaction_log[_0x29d3('0x21')](_0x29d3('0x82'),_0x1a5101['user']['id'],_0x1a5101[_0x29d3('0x62')]['name'],_0x1a5101['user'][_0x29d3('0x6c')],_0xbc22c7[_0x29d3('0x6a')]['id'],_0x1a5101['body']?JSON[_0x29d3('0x25')](_0x1a5101[_0x29d3('0x59')]):_0x29d3('0x6d'));return respondWithRpcPromise(_0x29d3('0x83'),_0x29d3('0x84'),_0xbc22c7);}return null;})[_0x29d3('0x20')](function(_0x2e49bf){var _0x37fa6d=_0x29d3('0x6f')+_0x2e49bf[_0x29d3('0x29')][_0x29d3('0x70')];return db[_0x29d3('0x71')][_0x29d3('0x3e')](_0x37fa6d,{'type':db['Sequelize'][_0x29d3('0x72')][_0x29d3('0x73')],'raw':!![]})[_0x29d3('0x20')](function(_0x3c4116){return _0x3c4116;});})['then'](function(_0xe3a743){if(_0xe3a743){_0xbc22c7[_0x29d3('0x29')][_0x29d3('0x74')]=_0xe3a743[0x0];if(!_0x1a5101['body'][_0x29d3('0x61')])return;return db[_0x29d3('0x85')][_0x29d3('0x57')]({'where':{'id':_0x1a5101[_0x29d3('0x59')][_0x29d3('0x61')],'role':_0x29d3('0x63')},'attributes':['id','name',_0x29d3('0x75'),_0x29d3('0x76'),_0x29d3('0x86')],'raw':!![]});}return null;})['then'](function(_0x9bead2){if(!_0x9bead2)return null;_0xbc22c7[_0x29d3('0x29')]['agent']=_0x9bead2;return _0xbc22c7;})[_0x29d3('0x20')](function(_0x494dbd){if(_0x494dbd){_0x494dbd[_0x29d3('0x29')][_0x29d3('0x78')]=util[_0x29d3('0x69')](_0x29d3('0x79'),_0x1a5101[_0x29d3('0x62')][_0x29d3('0x3d')]);_0x494dbd[_0x29d3('0x29')][_0x29d3('0x7a')]=_0xbc22c7[_0x29d3('0x7a')];_0x494dbd[_0x29d3('0x29')][_0x29d3('0x7b')]=_0xbc22c7[_0x29d3('0x7a')];_0x494dbd[_0x29d3('0x29')][_0x29d3('0x7c')]='reject';respondWithRpcPromise(_0x29d3('0x7d'),_0x29d3('0x7d'),{'event':'rejectmessage','message':_[_0x29d3('0x4b')](_0xbc22c7[_0x29d3('0x29')],JSON[_0x29d3('0x7f')](_0xbc22c7[_0x29d3('0x6a')][_0x29d3('0x87')]))},client9002);return _0xbc22c7;}return null;})[_0x29d3('0x20')](respondWithResult(_0x61fbd3,null))[_0x29d3('0x51')](handleError(_0x61fbd3,null));}; \ No newline at end of file +var _0xd030=['isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT','contact','internal','rejectmessage','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','status','end','json','limit','undefined','offset','count','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','ChatMessage','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','chat-interactions','chat','read','readAt','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId'];(function(_0xe78ebd,_0x3a52e5){var _0x8cb3e5=function(_0x4dc01f){while(--_0x4dc01f){_0xe78ebd['push'](_0xe78ebd['shift']());}};_0x8cb3e5(++_0x3a52e5);}(_0xd030,0x1a7));var _0x0d03=function(_0x3e49dc,_0x44186a){_0x3e49dc=_0x3e49dc-0x0;var _0x3853ab=_0xd030[_0x3e49dc];return _0x3853ab;};'use strict';var emlformat=require(_0x0d03('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0d03('0x1'));var rp=require(_0x0d03('0x2'));var moment=require(_0x0d03('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0d03('0x4'));var util=require(_0x0d03('0x5'));var path=require('path');var sox=require(_0x0d03('0x6'));var csv=require('to-csv');var ejs=require(_0x0d03('0x7'));var fs=require('fs');var fs_extra=require(_0x0d03('0x8'));var _=require(_0x0d03('0x9'));var squel=require('squel');var crypto=require(_0x0d03('0xa'));var jsforce=require(_0x0d03('0xb'));var deskjs=require(_0x0d03('0xc'));var toCsv=require(_0x0d03('0xd'));var querystring=require(_0x0d03('0xe'));var Papa=require(_0x0d03('0xf'));var Redis=require(_0x0d03('0x10'));var authService=require(_0x0d03('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0d03('0x12'));var hardwareService=require(_0x0d03('0x13'));var logger=require('../../config/logger')(_0x0d03('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0d03('0x15'));var db=require(_0x0d03('0x16'))['db'];config[_0x0d03('0x17')]=_['defaults'](config[_0x0d03('0x17')],{'host':_0x0d03('0x18'),'port':0x18eb});var socket=require(_0x0d03('0x19'))(new Redis(config['redis']));require(_0x0d03('0x1a'))[_0x0d03('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0d03('0x1c')][_0x0d03('0x1d')]({'port':0x232c});var client9002=jayson[_0x0d03('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1502fb,_0x1a934f,_0xddbd12,_0x109130){return new BPromise(function(_0x3277e4,_0xb812f5){var _0x1fa0d0=_0x109130||client;return _0x1fa0d0[_0x0d03('0x1e')](_0x1502fb,_0xddbd12)['then'](function(_0x248a0f){logger[_0x0d03('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x1a934f,_0x0d03('0x20'));logger[_0x0d03('0x21')](_0x0d03('0x22'),_0x1a934f,_0x0d03('0x20'),JSON[_0x0d03('0x23')](_0x248a0f));if(_0x248a0f[_0x0d03('0x24')]){if(_0x248a0f['error']['code']===0x1f4){logger[_0x0d03('0x24')](_0x0d03('0x25'),_0x1a934f,_0x248a0f[_0x0d03('0x24')][_0x0d03('0x26')]);return _0xb812f5(_0x248a0f['error'][_0x0d03('0x26')]);}logger['error'](_0x0d03('0x25'),_0x1a934f,_0x248a0f[_0x0d03('0x24')][_0x0d03('0x26')]);return _0x3277e4(_0x248a0f[_0x0d03('0x24')]['message']);}else{logger[_0x0d03('0x1f')](_0x0d03('0x25'),_0x1a934f,_0x0d03('0x20'));_0x3277e4(_0x248a0f[_0x0d03('0x27')][_0x0d03('0x26')]);}})['catch'](function(_0x1b81e1){logger[_0x0d03('0x24')](_0x0d03('0x25'),_0x1a934f,_0x1b81e1);_0xb812f5(_0x1b81e1);});});}function respondWithStatusCode(_0x4e14eb,_0x33cb13){_0x33cb13=_0x33cb13||0xcc;return function(_0x25efd0){if(_0x25efd0){return _0x4e14eb['sendStatus'](_0x33cb13);}return _0x4e14eb[_0x0d03('0x28')](_0x33cb13)[_0x0d03('0x29')]();};}function respondWithResult(_0x144851,_0x283f4f){_0x283f4f=_0x283f4f||0xc8;return function(_0x382eb1){if(_0x382eb1){return _0x144851[_0x0d03('0x28')](_0x283f4f)[_0x0d03('0x2a')](_0x382eb1);}};}function respondWithFilteredResult(_0x277016,_0x4c6e33){return function(_0x179bf6){if(_0x179bf6){var _0x11fd91=typeof _0x4c6e33['offset']==='undefined'&&typeof _0x4c6e33[_0x0d03('0x2b')]===_0x0d03('0x2c');var _0x1944ad=_0x179bf6['count'];var _0x74d6ab=_0x11fd91?0x0:_0x4c6e33[_0x0d03('0x2d')];var _0x4df251=_0x11fd91?_0x179bf6[_0x0d03('0x2e')]:_0x4c6e33['offset']+_0x4c6e33[_0x0d03('0x2b')];var _0x30f76e;if(_0x4df251>=_0x1944ad){_0x4df251=_0x1944ad;_0x30f76e=0xc8;}else{_0x30f76e=0xce;}_0x277016[_0x0d03('0x28')](_0x30f76e);return _0x277016[_0x0d03('0x2f')]('Content-Range',_0x74d6ab+'-'+_0x4df251+'/'+_0x1944ad)[_0x0d03('0x2a')](_0x179bf6);}return null;};}function patchUpdates(_0x320041){return function(_0x3c7f42){try{jsonpatch[_0x0d03('0x30')](_0x3c7f42,_0x320041,!![]);}catch(_0x38557c){return BPromise[_0x0d03('0x31')](_0x38557c);}return _0x3c7f42[_0x0d03('0x32')]();};}function saveUpdates(_0x2159c9,_0x3be44d){return function(_0x24aa3c){if(_0x24aa3c){return _0x24aa3c[_0x0d03('0x33')](_0x2159c9)[_0x0d03('0x34')](function(_0x20ce06){return _0x20ce06;});}return null;};}function removeEntity(_0x3a4f0a,_0x3e08e3){return function(_0x1fe937){if(_0x1fe937){return _0x1fe937[_0x0d03('0x35')]()['then'](function(){_0x3a4f0a[_0x0d03('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4abd3b,_0x5f390e){return function(_0x3870e9){if(!_0x3870e9){_0x4abd3b[_0x0d03('0x36')](0x194);}return _0x3870e9;};}function handleError(_0xc03a40,_0x598d61){_0x598d61=_0x598d61||0x1f4;return function(_0x40f34d){logger[_0x0d03('0x24')](_0x40f34d[_0x0d03('0x37')]);if(_0x40f34d[_0x0d03('0x38')]){delete _0x40f34d['name'];}_0xc03a40['status'](_0x598d61)[_0x0d03('0x39')](_0x40f34d);};}exports[_0x0d03('0x3a')]=function(_0x29006e,_0x3a18a6){var _0x88fd45={},_0x2004e0={},_0x2ffdec={'count':0x0,'rows':[]};var _0x43337a=_['map'](db[_0x0d03('0x3b')][_0x0d03('0x3c')],function(_0x3d61e8){return{'name':_0x3d61e8[_0x0d03('0x3d')],'type':_0x3d61e8['type'][_0x0d03('0x3e')]};});_0x2004e0[_0x0d03('0x3f')]=_[_0x0d03('0x40')](_0x43337a,_0x0d03('0x38'));_0x2004e0[_0x0d03('0x41')]=_[_0x0d03('0x42')](_0x29006e['query']);_0x2004e0[_0x0d03('0x43')]=_[_0x0d03('0x44')](_0x2004e0[_0x0d03('0x3f')],_0x2004e0[_0x0d03('0x41')]);_0x88fd45[_0x0d03('0x45')]=_[_0x0d03('0x44')](_0x2004e0[_0x0d03('0x3f')],qs[_0x0d03('0x46')](_0x29006e['query'][_0x0d03('0x46')]));_0x88fd45[_0x0d03('0x45')]=_0x88fd45[_0x0d03('0x45')][_0x0d03('0x47')]?_0x88fd45[_0x0d03('0x45')]:_0x2004e0[_0x0d03('0x3f')];if(!_0x29006e['query']['hasOwnProperty']('nolimit')){_0x88fd45[_0x0d03('0x2b')]=qs[_0x0d03('0x2b')](_0x29006e[_0x0d03('0x41')]['limit']);_0x88fd45['offset']=qs[_0x0d03('0x2d')](_0x29006e[_0x0d03('0x41')][_0x0d03('0x2d')]);}_0x88fd45[_0x0d03('0x48')]=qs[_0x0d03('0x49')](_0x29006e['query'][_0x0d03('0x49')]);_0x88fd45['where']=qs[_0x0d03('0x43')](_['pick'](_0x29006e[_0x0d03('0x41')],_0x2004e0[_0x0d03('0x43')]),_0x43337a);if(_0x29006e[_0x0d03('0x41')][_0x0d03('0x4a')]){_0x88fd45[_0x0d03('0x4b')]=_['merge'](_0x88fd45[_0x0d03('0x4b')],{'$or':_[_0x0d03('0x40')](_0x43337a,function(_0x538098){if(_0x538098['type']!==_0x0d03('0x4c')){var _0xbfc66={};_0xbfc66[_0x538098['name']]={'$like':'%'+_0x29006e['query'][_0x0d03('0x4a')]+'%'};return _0xbfc66;}})});}_0x88fd45=_[_0x0d03('0x4d')]({},_0x88fd45,_0x29006e[_0x0d03('0x4e')]);var _0x3ea040={'where':_0x88fd45['where']};return db[_0x0d03('0x3b')][_0x0d03('0x2e')](_0x3ea040)[_0x0d03('0x34')](function(_0x28f28e){_0x2ffdec[_0x0d03('0x2e')]=_0x28f28e;if(_0x29006e[_0x0d03('0x41')][_0x0d03('0x4f')]){_0x88fd45[_0x0d03('0x50')]=[{'all':!![]}];}return db[_0x0d03('0x3b')][_0x0d03('0x51')](_0x88fd45);})[_0x0d03('0x34')](function(_0x39619e){_0x2ffdec[_0x0d03('0x52')]=_0x39619e;return _0x2ffdec;})[_0x0d03('0x34')](respondWithFilteredResult(_0x3a18a6,_0x88fd45))[_0x0d03('0x53')](handleError(_0x3a18a6,null));};exports[_0x0d03('0x54')]=function(_0x1e37a6,_0xc3ec66){var _0x31f996={'raw':!![],'where':{'id':_0x1e37a6['params']['id']}},_0x587761={};_0x587761[_0x0d03('0x3f')]=_[_0x0d03('0x42')](db[_0x0d03('0x3b')][_0x0d03('0x3c')]);_0x587761[_0x0d03('0x41')]=_[_0x0d03('0x42')](_0x1e37a6[_0x0d03('0x41')]);_0x587761[_0x0d03('0x43')]=_[_0x0d03('0x44')](_0x587761[_0x0d03('0x3f')],_0x587761[_0x0d03('0x41')]);_0x31f996['attributes']=_[_0x0d03('0x44')](_0x587761[_0x0d03('0x3f')],qs[_0x0d03('0x46')](_0x1e37a6[_0x0d03('0x41')][_0x0d03('0x46')]));_0x31f996[_0x0d03('0x45')]=_0x31f996[_0x0d03('0x45')][_0x0d03('0x47')]?_0x31f996['attributes']:_0x587761[_0x0d03('0x3f')];if(_0x1e37a6['query']['includeAll']){_0x31f996['include']=[{'all':!![]}];}_0x31f996=_[_0x0d03('0x4d')]({},_0x31f996,_0x1e37a6[_0x0d03('0x4e')]);return db[_0x0d03('0x3b')][_0x0d03('0x55')](_0x31f996)[_0x0d03('0x34')](handleEntityNotFound(_0xc3ec66,null))[_0x0d03('0x34')](respondWithResult(_0xc3ec66,null))['catch'](handleError(_0xc3ec66,null));};exports[_0x0d03('0x56')]=function(_0x166ef5,_0x1184e8){return db[_0x0d03('0x3b')][_0x0d03('0x56')](_0x166ef5[_0x0d03('0x57')],{})[_0x0d03('0x34')](respondWithResult(_0x1184e8,0xc9))[_0x0d03('0x53')](handleError(_0x1184e8,null));};exports[_0x0d03('0x33')]=function(_0x273e98,_0x1e0212){if(_0x273e98[_0x0d03('0x57')]['id']){delete _0x273e98['body']['id'];}return db[_0x0d03('0x3b')][_0x0d03('0x55')]({'where':{'id':_0x273e98[_0x0d03('0x58')]['id']}})[_0x0d03('0x34')](handleEntityNotFound(_0x1e0212,null))['then'](saveUpdates(_0x273e98[_0x0d03('0x57')],null))[_0x0d03('0x34')](respondWithResult(_0x1e0212,null))[_0x0d03('0x53')](handleError(_0x1e0212,null));};exports[_0x0d03('0x35')]=function(_0xbfd3f9,_0x3d36a9){return db[_0x0d03('0x3b')][_0x0d03('0x55')]({'where':{'id':_0xbfd3f9[_0x0d03('0x58')]['id']}})[_0x0d03('0x34')](handleEntityNotFound(_0x3d36a9,null))[_0x0d03('0x34')](removeEntity(_0x3d36a9,null))['catch'](handleError(_0x3d36a9,null));};exports[_0x0d03('0x59')]=function(_0x2c6c83,_0x2a88e4){return db[_0x0d03('0x3b')][_0x0d03('0x59')]()['then'](respondWithResult(_0x2a88e4,null))[_0x0d03('0x53')](handleError(_0x2a88e4,null));};var interaction_log=require('../../config/logger')(_0x0d03('0x5a'));exports['accept']=function(_0xcdfc2c,_0x5df7bb,_0x9a2966){var _0x113a93={'agent':{},'channel':_0x0d03('0x5b')};if(_0xcdfc2c[_0x0d03('0x57')]['id']){delete _0xcdfc2c[_0x0d03('0x57')]['id'];}_0xcdfc2c[_0x0d03('0x57')][_0x0d03('0x5c')]=!![];_0xcdfc2c['body'][_0x0d03('0x5d')]=moment()[_0x0d03('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0xcdfc2c['body']['UserId']=_0xcdfc2c['body'][_0x0d03('0x5f')]||_0xcdfc2c[_0x0d03('0x60')]['id'];_0x113a93[_0x0d03('0x61')]['id']=_0xcdfc2c[_0x0d03('0x57')][_0x0d03('0x5f')];return db[_0x0d03('0x3b')][_0x0d03('0x55')]({'where':{'id':_0xcdfc2c[_0x0d03('0x58')]['id'],'UserId':null}})[_0x0d03('0x34')](handleEntityNotFound(_0x5df7bb,null))[_0x0d03('0x34')](saveUpdates(_0xcdfc2c[_0x0d03('0x57')],null))['then'](function(_0x7ca2dc){if(_0x7ca2dc){_0x113a93[_0x0d03('0x26')]=_0x7ca2dc[_0x0d03('0x62')]({'plain':!![]});return db[_0x0d03('0x63')]['find']({'where':{'id':_0x7ca2dc[_0x0d03('0x64')]}});}return null;})[_0x0d03('0x34')](handleEntityNotFound(_0x5df7bb,null))[_0x0d03('0x34')](function(_0x7c05c0){if(_0x7c05c0){return _0x7c05c0[_0x0d03('0x33')]({'UserId':_0xcdfc2c[_0x0d03('0x57')]['UserId'],'read1stAt':_[_0x0d03('0x65')](_0x7c05c0['read1stAt'])?moment()[_0x0d03('0x5e')](_0x0d03('0x66')):undefined});}return null;})['then'](function(_0x25ce91){if(_0x25ce91){_0x113a93[_0x0d03('0x67')]=_0x25ce91['get']({'plain':!![]});interaction_log[_0x0d03('0x1f')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xcdfc2c[_0x0d03('0x60')]['id'],_0xcdfc2c[_0x0d03('0x60')][_0x0d03('0x38')],_0xcdfc2c[_0x0d03('0x60')][_0x0d03('0x68')],_0x113a93['interaction']['id'],_0xcdfc2c[_0x0d03('0x57')]?JSON[_0x0d03('0x23')](_0xcdfc2c['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x0d03('0x69'),_0x113a93);}return null;})[_0x0d03('0x34')](function(_0x5c77fc){var _0x2909b4=_0x0d03('0x6a')+_0x5c77fc[_0x0d03('0x26')][_0x0d03('0x6b')];return db[_0x0d03('0x6c')][_0x0d03('0x41')](_0x2909b4,{'type':db[_0x0d03('0x6d')][_0x0d03('0x6e')]['SELECT'],'raw':!![]})[_0x0d03('0x34')](function(_0x113830){return _0x113830;});})['then'](function(_0xd818b5){if(_0xd818b5){_0x113a93[_0x0d03('0x26')]['contact']=_0xd818b5[0x0];if(!_0xcdfc2c['body'][_0x0d03('0x5f')])return;return db[_0x0d03('0x6f')][_0x0d03('0x55')]({'where':{'id':_0xcdfc2c[_0x0d03('0x57')][_0x0d03('0x5f')],'role':_0x0d03('0x61')},'attributes':['id',_0x0d03('0x38'),_0x0d03('0x70'),_0x0d03('0x71'),'internal'],'raw':!![]});}return null;})[_0x0d03('0x34')](function(_0x1fcf04){if(!_0x1fcf04)return null;_0x113a93[_0x0d03('0x26')][_0x0d03('0x61')]=_0x1fcf04;return _0x113a93;})[_0x0d03('0x34')](function(_0x103f78){if(_0x103f78){if(_0xcdfc2c[_0x0d03('0x57')]['manual']){_0x113a93[_0x0d03('0x26')][_0x0d03('0x72')]=util['format'](_0x0d03('0x73'),_0xcdfc2c[_0x0d03('0x60')]['name']);_0x113a93['message'][_0x0d03('0x74')]=_0x113a93[_0x0d03('0x74')];_0x113a93[_0x0d03('0x26')]['motionChannel']=_0x113a93['channel'];_0x113a93[_0x0d03('0x26')][_0x0d03('0x75')]=_0x0d03('0x76');return respondWithRpcPromise(_0x0d03('0x77'),'EventManager',{'event':_0x0d03('0x78'),'message':_[_0x0d03('0x4d')](_0x113a93[_0x0d03('0x26')],JSON[_0x0d03('0x79')](_0x113a93[_0x0d03('0x67')][_0x0d03('0x7a')]))},client9002)[_0x0d03('0x34')](function(){return _0x113a93;});}return _0x113a93;}return null;})[_0x0d03('0x34')](respondWithResult(_0x5df7bb,null))['catch'](handleError(_0x5df7bb,null));};var interaction_log=require('../../config/logger')(_0x0d03('0x5a'));exports[_0x0d03('0x31')]=function(_0x1d58c2,_0x4138fe,_0x4ed01c){var _0x1c20a8={'agent':{},'channel':_0x0d03('0x5b')};if(_0x1d58c2[_0x0d03('0x57')]['id']){delete _0x1d58c2['body']['id'];}_0x1d58c2[_0x0d03('0x57')][_0x0d03('0x5f')]=_0x1d58c2[_0x0d03('0x57')][_0x0d03('0x5f')]||_0x1d58c2[_0x0d03('0x60')]['id'];_0x1c20a8[_0x0d03('0x61')]['id']=_0x1d58c2[_0x0d03('0x57')]['UserId'];return db[_0x0d03('0x3b')][_0x0d03('0x55')]({'where':{'id':_0x1d58c2[_0x0d03('0x58')]['id'],'UserId':null}})[_0x0d03('0x34')](handleEntityNotFound(_0x4138fe,null))['then'](function(_0x3df250){if(_0x3df250){_0x1c20a8[_0x0d03('0x26')]=_0x3df250[_0x0d03('0x62')]({'plain':!![]});return db[_0x0d03('0x63')][_0x0d03('0x55')]({'where':{'id':_0x3df250[_0x0d03('0x64')]}});}return null;})[_0x0d03('0x34')](handleEntityNotFound(_0x4138fe,null))[_0x0d03('0x34')](function(_0xaf792a){if(_0xaf792a){_0x1c20a8[_0x0d03('0x67')]=_0xaf792a[_0x0d03('0x62')]({'plain':!![]});interaction_log[_0x0d03('0x1f')](_0x0d03('0x7b'),_0x1d58c2[_0x0d03('0x60')]['id'],_0x1d58c2[_0x0d03('0x60')][_0x0d03('0x38')],_0x1d58c2[_0x0d03('0x60')][_0x0d03('0x68')],_0x1c20a8['interaction']['id'],_0x1d58c2[_0x0d03('0x57')]?JSON[_0x0d03('0x23')](_0x1d58c2[_0x0d03('0x57')]):_0x0d03('0x7c'));return respondWithRpcPromise(_0x0d03('0x7d'),_0x0d03('0x7e'),_0x1c20a8);}return null;})['then'](function(_0x9ccf71){var _0x5a4215=_0x0d03('0x6a')+_0x9ccf71['message'][_0x0d03('0x6b')];return db[_0x0d03('0x6c')][_0x0d03('0x41')](_0x5a4215,{'type':db[_0x0d03('0x6d')]['QueryTypes'][_0x0d03('0x7f')],'raw':!![]})['then'](function(_0x586e90){return _0x586e90;});})['then'](function(_0x507048){if(_0x507048){_0x1c20a8[_0x0d03('0x26')][_0x0d03('0x80')]=_0x507048[0x0];if(!_0x1d58c2[_0x0d03('0x57')][_0x0d03('0x5f')])return;return db['User'][_0x0d03('0x55')]({'where':{'id':_0x1d58c2[_0x0d03('0x57')][_0x0d03('0x5f')],'role':_0x0d03('0x61')},'attributes':['id',_0x0d03('0x38'),_0x0d03('0x70'),_0x0d03('0x71'),_0x0d03('0x81')],'raw':!![]});}return null;})['then'](function(_0x5aac53){if(!_0x5aac53)return null;_0x1c20a8[_0x0d03('0x26')]['agent']=_0x5aac53;return _0x1c20a8;})[_0x0d03('0x34')](function(_0x20171d){if(_0x20171d){_0x20171d[_0x0d03('0x26')][_0x0d03('0x72')]=util[_0x0d03('0x5e')](_0x0d03('0x73'),_0x1d58c2[_0x0d03('0x60')]['name']);_0x20171d[_0x0d03('0x26')][_0x0d03('0x74')]=_0x1c20a8[_0x0d03('0x74')];_0x20171d['message']['motionChannel']=_0x1c20a8['channel'];_0x20171d[_0x0d03('0x26')]['event']=_0x0d03('0x31');respondWithRpcPromise(_0x0d03('0x77'),_0x0d03('0x77'),{'event':_0x0d03('0x82'),'message':_['merge'](_0x1c20a8[_0x0d03('0x26')],JSON[_0x0d03('0x79')](_0x1c20a8[_0x0d03('0x67')][_0x0d03('0x7a')]))},client9002);return _0x1c20a8;}return null;})[_0x0d03('0x34')](respondWithResult(_0x4138fe,null))[_0x0d03('0x53')](handleError(_0x4138fe,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 0b936fe..908c09c 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 _0xc90a=['exports','events','../../mysqldb','ChatMessage','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x53a5d3,_0x130412){var _0x15b0e=function(_0x249520){while(--_0x249520){_0x53a5d3['push'](_0x53a5d3['shift']());}};_0x15b0e(++_0x130412);}(_0xc90a,0xa1));var _0xac90=function(_0x13939c,_0x28e042){_0x13939c=_0x13939c-0x0;var _0x8eacdf=_0xc90a[_0x13939c];return _0x8eacdf;};'use strict';var EventEmitter=require(_0xac90('0x0'));var ChatMessage=require(_0xac90('0x1'))['db'][_0xac90('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xac90('0x3'),'afterUpdate':_0xac90('0x4'),'afterDestroy':_0xac90('0x5')};function emitEvent(_0x506eff){return function(_0x426ec1,_0x3b3b51,_0x4aaca3){ChatMessageEvents['emit'](_0x506eff+':'+_0x426ec1['id'],_0x426ec1);ChatMessageEvents[_0xac90('0x6')](_0x506eff,_0x426ec1);_0x4aaca3(null);};}for(var e in events){if(events[_0xac90('0x7')](e)){var event=events[e];ChatMessage[_0xac90('0x8')](e,emitEvent(event));}}module[_0xac90('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0xcd92=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xcd92,0x6c));var _0x2cd9=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xcd92[_0x46698a];return _0x356db0;};'use strict';var EventEmitter=require(_0x2cd9('0x0'));var ChatMessage=require(_0x2cd9('0x1'))['db'][_0x2cd9('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2cd9('0x3')](0x0);var events={'afterCreate':_0x2cd9('0x4'),'afterUpdate':_0x2cd9('0x5'),'afterDestroy':_0x2cd9('0x6')};function emitEvent(_0x191a7b){return function(_0x52bc1e,_0x557ad5,_0x1390dc){ChatMessageEvents[_0x2cd9('0x7')](_0x191a7b+':'+_0x52bc1e['id'],_0x52bc1e);ChatMessageEvents[_0x2cd9('0x7')](_0x191a7b,_0x52bc1e);_0x1390dc(null);};}for(var e in events){if(events[_0x2cd9('0x8')](e)){var event=events[e];ChatMessage[_0x2cd9('0x9')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index c4312c8..ed5fd0b 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 _0x5fdd=['catch','error','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','path','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','ChatInteraction','findOne','ChatInteractionId','update','createdAt'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x5fdd,0x16f));var _0xd5fd=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0x5fdd[_0x152678];return _0x311a9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd5fd('0x0'))(_0xd5fd('0x1'));var moment=require('moment');var BPromise=require(_0xd5fd('0x2'));var rp=require(_0xd5fd('0x3'));var fs=require('fs');var path=require(_0xd5fd('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd5fd('0x5'));module[_0xd5fd('0x6')]=function(_0x280387,_0x58e392){return _0x280387[_0xd5fd('0x7')](_0xd5fd('0x8'),attributes,{'tableName':_0xd5fd('0x9'),'paranoid':![],'indexes':[{'name':_0xd5fd('0xa'),'fields':[_0xd5fd('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5fcdd2,_0x559dae,_0x59b39f){var _0x5b9d2e=_0x280387[_0xd5fd('0xc')];var _0x3818ed=_0x5fcdd2[_0xd5fd('0xd')]({'plain':!![]});if(_0x3818ed[_0xd5fd('0xe')][_0xd5fd('0xf')]()==='in'||_0x3818ed[_0xd5fd('0xe')][_0xd5fd('0xf')]()===_0xd5fd('0x10')&&!_0x3818ed[_0xd5fd('0x11')]&&!_['isNil'](_0x3818ed['UserId'])){_0x5b9d2e[_0xd5fd('0x12')][_0xd5fd('0x13')]({'where':{'id':_0x3818ed[_0xd5fd('0x14')]}})['then'](function(_0x21ba93){if(_0x21ba93){_0x21ba93[_0xd5fd('0x15')]({'lastMsgAt':_0x3818ed[_0xd5fd('0x16')],'lastMsgDirection':_0x3818ed['direction'][_0xd5fd('0xf')]()});}})[_0xd5fd('0x17')](function(_0x55cdea){console[_0xd5fd('0x18')](_0x55cdea);});}_0x59b39f();}},'charset':'utf8mb4','collate':_0xd5fd('0x19')});}; \ No newline at end of file +var _0xa9dc=['exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes'];(function(_0x52ea08,_0x15d935){var _0x28d546=function(_0x4a3aa7){while(--_0x4a3aa7){_0x52ea08['push'](_0x52ea08['shift']());}};_0x28d546(++_0x15d935);}(_0xa9dc,0xb0));var _0xca9d=function(_0xffd8b0,_0x12c51f){_0xffd8b0=_0xffd8b0-0x0;var _0x301ba0=_0xa9dc[_0xffd8b0];return _0x301ba0;};'use strict';var _=require(_0xca9d('0x0'));var util=require(_0xca9d('0x1'));var logger=require(_0xca9d('0x2'))(_0xca9d('0x3'));var moment=require(_0xca9d('0x4'));var BPromise=require('bluebird');var rp=require(_0xca9d('0x5'));var fs=require('fs');var path=require(_0xca9d('0x6'));var rimraf=require(_0xca9d('0x7'));var config=require(_0xca9d('0x8'));var attributes=require(_0xca9d('0x9'));module[_0xca9d('0xa')]=function(_0x5f3ac1,_0x64c921){return _0x5f3ac1['define'](_0xca9d('0xb'),attributes,{'tableName':_0xca9d('0xc'),'paranoid':![],'indexes':[{'name':_0xca9d('0xd'),'fields':[_0xca9d('0xe')],'type':_0xca9d('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a1b18,_0x3ea9fa,_0x20877e){var _0xfc4830=_0x5f3ac1[_0xca9d('0x10')];var _0x1450b8=_0x4a1b18[_0xca9d('0x11')]({'plain':!![]});if(_0x1450b8[_0xca9d('0x12')][_0xca9d('0x13')]()==='in'||_0x1450b8['direction'][_0xca9d('0x13')]()===_0xca9d('0x14')&&!_0x1450b8[_0xca9d('0x15')]&&!_[_0xca9d('0x16')](_0x1450b8[_0xca9d('0x17')])){_0xfc4830[_0xca9d('0x18')][_0xca9d('0x19')]({'where':{'id':_0x1450b8[_0xca9d('0x1a')]}})[_0xca9d('0x1b')](function(_0x10d920){if(_0x10d920){_0x10d920['update']({'lastMsgAt':_0x1450b8['createdAt'],'lastMsgDirection':_0x1450b8[_0xca9d('0x12')][_0xca9d('0x13')]()});}})[_0xca9d('0x1c')](function(_0xb546da){console['error'](_0xb546da);});}_0x20877e();}},'charset':_0xca9d('0x1d'),'collate':_0xca9d('0x1e')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 0b6eac0..8bbbba6 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 _0xd631=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateChatMessage','ChatMessage','body','raw','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1c89c4,_0x5b8b57){var _0x4a4717=function(_0x2421a2){while(--_0x2421a2){_0x1c89c4['push'](_0x1c89c4['shift']());}};_0x4a4717(++_0x5b8b57);}(_0xd631,0xbb));var _0x1d63=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xd631[_0x53abe5];return _0xc1c37e;};'use strict';var _=require(_0x1d63('0x0'));var util=require(_0x1d63('0x1'));var moment=require(_0x1d63('0x2'));var BPromise=require(_0x1d63('0x3'));var rs=require(_0x1d63('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1d63('0x5'))(_0x1d63('0x6'));var config=require(_0x1d63('0x7'));var jayson=require(_0x1d63('0x8'));var client=jayson[_0x1d63('0x9')][_0x1d63('0xa')]({'port':0x232a});config['redis']=_[_0x1d63('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1d63('0xc'))(new Redis(config['redis']));require(_0x1d63('0xd'))[_0x1d63('0xe')](socket);function respondWithRpcPromise(_0x51ac4d,_0x37e4ca,_0x12226f){return new BPromise(function(_0x41cb68,_0x10915e){return client[_0x1d63('0xf')](_0x51ac4d,_0x12226f)[_0x1d63('0x10')](function(_0xc2ac16){logger[_0x1d63('0x11')](_0x1d63('0x12'),_0x37e4ca,'request\x20sent');logger[_0x1d63('0x13')](_0x1d63('0x14'),_0x37e4ca,_0x1d63('0x15'),JSON[_0x1d63('0x16')](_0xc2ac16));if(_0xc2ac16[_0x1d63('0x17')]){if(_0xc2ac16['error'][_0x1d63('0x18')]===0x1f4){logger[_0x1d63('0x17')](_0x1d63('0x12'),_0x37e4ca,_0xc2ac16['error']['message']);return _0x10915e(_0xc2ac16[_0x1d63('0x17')][_0x1d63('0x19')]);}logger['error'](_0x1d63('0x12'),_0x37e4ca,_0xc2ac16[_0x1d63('0x17')][_0x1d63('0x19')]);return _0x41cb68(_0xc2ac16['error']['message']);}else{logger[_0x1d63('0x11')]('ChatMessage,\x20%s,\x20%s',_0x37e4ca,'request\x20sent');_0x41cb68(_0xc2ac16[_0x1d63('0x1a')]['message']);}})['catch'](function(_0x57287f){logger[_0x1d63('0x17')](_0x1d63('0x12'),_0x37e4ca,_0x57287f);_0x10915e(_0x57287f);});});}exports[_0x1d63('0x1b')]=function(_0x5954d2){var _0x2594c3=this;return new Promise(function(_0x413256,_0x322a2b){return db[_0x1d63('0x1c')]['create'](_0x5954d2[_0x1d63('0x1d')],{'raw':_0x5954d2['options']?_0x5954d2['options'][_0x1d63('0x1e')]===undefined?!![]:![]:!![]})[_0x1d63('0x10')](function(_0x4a374d){logger[_0x1d63('0x11')](_0x1d63('0x1b'),_0x5954d2);logger[_0x1d63('0x13')](_0x1d63('0x1b'),_0x5954d2,JSON[_0x1d63('0x16')](_0x4a374d));_0x413256(_0x4a374d);})[_0x1d63('0x1f')](function(_0x45371a){logger[_0x1d63('0x17')](_0x1d63('0x1b'),_0x45371a['message'],_0x5954d2);_0x322a2b(_0x2594c3[_0x1d63('0x17')](0x1f4,_0x45371a[_0x1d63('0x19')]));});});}; \ No newline at end of file +var _0x741f=['client','http','redis','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','create','options','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2bd57b,_0x11fdf8){var _0xd32252=function(_0x1c7dd6){while(--_0x1c7dd6){_0x2bd57b['push'](_0x2bd57b['shift']());}};_0xd32252(++_0x11fdf8);}(_0x741f,0x76));var _0xf741=function(_0xc7a26,_0x52a575){_0xc7a26=_0xc7a26-0x0;var _0x37eeaa=_0x741f[_0xc7a26];return _0x37eeaa;};'use strict';var _=require(_0xf741('0x0'));var util=require(_0xf741('0x1'));var moment=require('moment');var BPromise=require(_0xf741('0x2'));var rs=require(_0xf741('0x3'));var fs=require('fs');var Redis=require(_0xf741('0x4'));var db=require(_0xf741('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf741('0x6'))(_0xf741('0x7'));var config=require(_0xf741('0x8'));var jayson=require(_0xf741('0x9'));var client=jayson[_0xf741('0xa')][_0xf741('0xb')]({'port':0x232a});config[_0xf741('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf741('0xd'))(new Redis(config[_0xf741('0xc')]));require(_0xf741('0xe'))[_0xf741('0xf')](socket);function respondWithRpcPromise(_0x37ef9b,_0x4a8e22,_0x5b238d){return new BPromise(function(_0x4fd2e1,_0x5c96f9){return client[_0xf741('0x10')](_0x37ef9b,_0x5b238d)[_0xf741('0x11')](function(_0x3bed8f){logger[_0xf741('0x12')](_0xf741('0x13'),_0x4a8e22,_0xf741('0x14'));logger['debug'](_0xf741('0x15'),_0x4a8e22,_0xf741('0x14'),JSON[_0xf741('0x16')](_0x3bed8f));if(_0x3bed8f[_0xf741('0x17')]){if(_0x3bed8f[_0xf741('0x17')][_0xf741('0x18')]===0x1f4){logger[_0xf741('0x17')](_0xf741('0x13'),_0x4a8e22,_0x3bed8f[_0xf741('0x17')][_0xf741('0x19')]);return _0x5c96f9(_0x3bed8f['error'][_0xf741('0x19')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x4a8e22,_0x3bed8f[_0xf741('0x17')][_0xf741('0x19')]);return _0x4fd2e1(_0x3bed8f[_0xf741('0x17')][_0xf741('0x19')]);}else{logger[_0xf741('0x12')](_0xf741('0x13'),_0x4a8e22,_0xf741('0x14'));_0x4fd2e1(_0x3bed8f[_0xf741('0x1a')][_0xf741('0x19')]);}})[_0xf741('0x1b')](function(_0x164a92){logger[_0xf741('0x17')](_0xf741('0x13'),_0x4a8e22,_0x164a92);_0x5c96f9(_0x164a92);});});}exports[_0xf741('0x1c')]=function(_0x2a2b39){var _0x48e19e=this;return new Promise(function(_0x1eb5c4,_0x3362ec){return db['ChatMessage'][_0xf741('0x1d')](_0x2a2b39['body'],{'raw':_0x2a2b39[_0xf741('0x1e')]?_0x2a2b39[_0xf741('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xf741('0x11')](function(_0x432d70){logger[_0xf741('0x12')]('CreateChatMessage',_0x2a2b39);logger[_0xf741('0x1f')]('CreateChatMessage',_0x2a2b39,JSON['stringify'](_0x432d70));_0x1eb5c4(_0x432d70);})['catch'](function(_0x56a395){logger[_0xf741('0x17')](_0xf741('0x1c'),_0x56a395['message'],_0x2a2b39);_0x3362ec(_0x48e19e[_0xf741('0x17')](0x1f4,_0x56a395['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index b5668fa..e8f3909 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 _0xe9e7=['remove','emit','removeListener','chatMessage:','./chatMessage.events','save'];(function(_0x3b8025,_0x35323d){var _0x19a2ed=function(_0x561930){while(--_0x561930){_0x3b8025['push'](_0x3b8025['shift']());}};_0x19a2ed(++_0x35323d);}(_0xe9e7,0x1f0));var _0x7e9e=function(_0x5a1484,_0x7d60f7){_0x5a1484=_0x5a1484-0x0;var _0x357688=_0xe9e7[_0x5a1484];return _0x357688;};'use strict';var ChatMessageEvents=require(_0x7e9e('0x0'));var events=[_0x7e9e('0x1'),_0x7e9e('0x2'),'update'];function createListener(_0x1fd5fc,_0x99030){return function(_0x108c11){_0x99030[_0x7e9e('0x3')](_0x1fd5fc,_0x108c11);};}function removeListener(_0x410b21,_0x18bf13){return function(){ChatMessageEvents[_0x7e9e('0x4')](_0x410b21,_0x18bf13);};}exports['register']=function(_0x319f70){for(var _0x134fac=0x0,_0xba25=events['length'];_0x134fac<_0xba25;_0x134fac++){var _0x366350=events[_0x134fac];var _0x4d9f9a=createListener(_0x7e9e('0x5')+_0x366350,_0x319f70);ChatMessageEvents['on'](_0x366350,_0x4d9f9a);}}; \ No newline at end of file +var _0x089f=['remove','update','emit','register','length','save'];(function(_0x1b1ed8,_0x2b0f38){var _0x33e1d6=function(_0x545491){while(--_0x545491){_0x1b1ed8['push'](_0x1b1ed8['shift']());}};_0x33e1d6(++_0x2b0f38);}(_0x089f,0x1c7));var _0xf089=function(_0x1c4079,_0x5514c1){_0x1c4079=_0x1c4079-0x0;var _0x203723=_0x089f[_0x1c4079];return _0x203723;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xf089('0x0'),_0xf089('0x1'),_0xf089('0x2')];function createListener(_0x3c38bf,_0x196df6){return function(_0x4a5f5f){_0x196df6[_0xf089('0x3')](_0x3c38bf,_0x4a5f5f);};}function removeListener(_0x3195ed,_0x250428){return function(){ChatMessageEvents['removeListener'](_0x3195ed,_0x250428);};}exports[_0xf089('0x4')]=function(_0x126d3d){for(var _0x21bce2=0x0,_0x49b977=events[_0xf089('0x5')];_0x21bce2<_0x49b977;_0x21bce2++){var _0x1987d9=events[_0x21bce2];var _0x115de6=createListener('chatMessage:'+_0x1987d9,_0x126d3d);ChatMessageEvents['on'](_0x1987d9,_0x115de6);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index a8a2600..5a38300 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 _0x67fc=['put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','chat'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0x67fc,0xfa));var _0xc67f=function(_0x58f363,_0x135c64){_0x58f363=_0x58f363-0x0;var _0xcb2c83=_0x67fc[_0x58f363];return _0xcb2c83;};'use strict';var multer=require(_0xc67f('0x0'));var util=require(_0xc67f('0x1'));var path=require(_0xc67f('0x2'));var timeout=require(_0xc67f('0x3'));var express=require(_0xc67f('0x4'));var router=express[_0xc67f('0x5')]();var fs_extra=require(_0xc67f('0x6'));var auth=require(_0xc67f('0x7'));var interaction=require(_0xc67f('0x8'));var config=require(_0xc67f('0x9'));var controller=require(_0xc67f('0xa'));router['get']('/',auth[_0xc67f('0xb')](),controller[_0xc67f('0xc')]);router[_0xc67f('0xd')](_0xc67f('0xe'),auth['isAuthenticated'](),controller[_0xc67f('0xf')]);router['get'](_0xc67f('0x10'),auth[_0xc67f('0xb')](),controller[_0xc67f('0x11')]);router[_0xc67f('0x12')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xc67f('0x13'),'chatmessage:create'),controller['create']);router['put'](_0xc67f('0x10'),controller['update']);router[_0xc67f('0x14')](_0xc67f('0x15'),auth[_0xc67f('0xb')](),controller[_0xc67f('0x16')]);router[_0xc67f('0x14')]('/:id/reject',auth[_0xc67f('0xb')](),controller[_0xc67f('0x17')]);router[_0xc67f('0x18')](_0xc67f('0x10'),auth[_0xc67f('0xb')](),controller[_0xc67f('0x19')]);module[_0xc67f('0x1a')]=router; \ No newline at end of file +var _0xb4c7=['/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','tracked','chat','chatmessage:create','create','put','update','/:id/accept'];(function(_0x508dcc,_0x2914fa){var _0x4ea643=function(_0x56a778){while(--_0x56a778){_0x508dcc['push'](_0x508dcc['shift']());}};_0x4ea643(++_0x2914fa);}(_0xb4c7,0x117));var _0x7b4c=function(_0x4d791a,_0x4945d2){_0x4d791a=_0x4d791a-0x0;var _0x4b41b6=_0xb4c7[_0x4d791a];return _0x4b41b6;};'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('express');var router=express[_0x7b4c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7b4c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7b4c('0x6'));var controller=require('./chatMessage.controller');router[_0x7b4c('0x7')]('/',auth['isAuthenticated'](),controller[_0x7b4c('0x8')]);router[_0x7b4c('0x7')](_0x7b4c('0x9'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xb')]);router[_0x7b4c('0x7')](_0x7b4c('0xc'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xd')]);router['post']('/',auth[_0x7b4c('0xa')](),interaction[_0x7b4c('0xe')](_0x7b4c('0xf'),_0x7b4c('0x10')),controller[_0x7b4c('0x11')]);router[_0x7b4c('0x12')](_0x7b4c('0xc'),controller[_0x7b4c('0x13')]);router[_0x7b4c('0x12')](_0x7b4c('0x14'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x7b4c('0x15'),auth['isAuthenticated'](),controller[_0x7b4c('0x16')]);router[_0x7b4c('0x17')](_0x7b4c('0xc'),auth['isAuthenticated'](),controller[_0x7b4c('0x18')]);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 dd06adb..dcb0e66 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x30f91e,_0x387ab6){var _0x43f79c=function(_0x4fc4cd){while(--_0x4fc4cd){_0x30f91e['push'](_0x30f91e['shift']());}};_0x43f79c(++_0x387ab6);}(_0xdb28,0x106));var _0x8db2=function(_0x14a158,_0x377200){_0x14a158=_0x14a158-0x0;var _0x16695c=_0xdb28[_0x14a158];return _0x16695c;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x0b0e,0x187));var _0xe0b0=function(_0x6eb02d,_0x20bdf5){_0x6eb02d=_0x6eb02d-0x0;var _0xb756de=_0x0b0e[_0x6eb02d];return _0xb756de;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 2941d03..a866e74 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x7a54,0x106));var _0x47a5=function(_0x3e403d,_0x1ef137){_0x3e403d=_0x3e403d-0x0;var _0xe63698=_0x7a54[_0x3e403d];return _0xe63698;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x7a54,0x106));var _0x47a5=function(_0x1b068c,_0x1a6803){_0x1b068c=_0x1b068c-0x0;var _0x5519cf=_0x7a54[_0x1b068c];return _0x5519cf;};'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 b6990c2..4bc643f 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 _0x23f4=['remove','emit','hook','exports','../../mysqldb','save','update'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x23f4,0x1ee));var _0x423f=function(_0x3222d5,_0xdcca67){_0x3222d5=_0x3222d5-0x0;var _0x26386b=_0x23f4[_0x3222d5];return _0x26386b;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x423f('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x423f('0x1'),'afterUpdate':_0x423f('0x2'),'afterDestroy':_0x423f('0x3')};function emitEvent(_0x3503a0){return function(_0x1ab106,_0x129dba,_0x34bf9e){ChatOfflineMessageEvents[_0x423f('0x4')](_0x3503a0+':'+_0x1ab106['id'],_0x1ab106);ChatOfflineMessageEvents[_0x423f('0x4')](_0x3503a0,_0x1ab106);_0x34bf9e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x423f('0x5')](e,emitEvent(event));}}module[_0x423f('0x6')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x9c46=['update','remove','emit','hook','exports','../../mysqldb','ChatOfflineMessage','save'];(function(_0x44db60,_0x4ec8ca){var _0x3fa929=function(_0x5800a6){while(--_0x5800a6){_0x44db60['push'](_0x44db60['shift']());}};_0x3fa929(++_0x4ec8ca);}(_0x9c46,0xa5));var _0x69c4=function(_0x6b7376,_0x346d64){_0x6b7376=_0x6b7376-0x0;var _0x573aab=_0x9c46[_0x6b7376];return _0x573aab;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x69c4('0x0'))['db'][_0x69c4('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x69c4('0x2'),'afterUpdate':_0x69c4('0x3'),'afterDestroy':_0x69c4('0x4')};function emitEvent(_0x12df3f){return function(_0x45c96e,_0x23e2d5,_0x14fa0b){ChatOfflineMessageEvents['emit'](_0x12df3f+':'+_0x45c96e['id'],_0x45c96e);ChatOfflineMessageEvents[_0x69c4('0x5')](_0x12df3f,_0x45c96e);_0x14fa0b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x69c4('0x6')](e,emitEvent(event));}}module[_0x69c4('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 824b261..f041aeb 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 _0x8f02=['ChatOfflineMessage','chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','define'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x8f02,0x161));var _0x28f0=function(_0x2b6fb9,_0xc8b11){_0x2b6fb9=_0x2b6fb9-0x0;var _0x53b067=_0x8f02[_0x2b6fb9];return _0x53b067;};'use strict';var attributes=require(_0x28f0('0x0'));module['exports']=function(_0x44f081){return _0x44f081[_0x28f0('0x1')](_0x28f0('0x2'),attributes,{'tableName':_0x28f0('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x28f0('0x4'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xbce7=['utf8mb4_unicode_ci','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x5d44ef,_0x2aa635){var _0x1f054a=function(_0x314bbc){while(--_0x314bbc){_0x5d44ef['push'](_0x5d44ef['shift']());}};_0x1f054a(++_0x2aa635);}(_0xbce7,0xf6));var _0x7bce=function(_0x5b2767,_0xc983df){_0x5b2767=_0x5b2767-0x0;var _0x482816=_0xbce7[_0x5b2767];return _0x482816;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x7bce('0x0')]=function(_0x5f3010){return _0x5f3010['define'](_0x7bce('0x1'),attributes,{'tableName':_0x7bce('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7bce('0x3'),'collate':_0x7bce('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index d79efff..6c73419 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 _0xcd63=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','code','error','ChatOfflineMessage,\x20%s,\x20%s','message'];(function(_0x1e9ae1,_0x10dc5d){var _0xc6bc15=function(_0x1a6a7d){while(--_0x1a6a7d){_0x1e9ae1['push'](_0x1e9ae1['shift']());}};_0xc6bc15(++_0x10dc5d);}(_0xcd63,0xfe));var _0x3cd6=function(_0x57427b,_0x2b8c9e){_0x57427b=_0x57427b-0x0;var _0x2b1e2d=_0xcd63[_0x57427b];return _0x2b1e2d;};'use strict';var _=require(_0x3cd6('0x0'));var util=require(_0x3cd6('0x1'));var moment=require(_0x3cd6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3cd6('0x3'));var db=require(_0x3cd6('0x4'))['db'];var utils=require(_0x3cd6('0x5'));var logger=require(_0x3cd6('0x6'))(_0x3cd6('0x7'));var config=require(_0x3cd6('0x8'));var jayson=require(_0x3cd6('0x9'));var client=jayson[_0x3cd6('0xa')][_0x3cd6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe9557a,_0x57b7ec,_0xa1ba80){return new BPromise(function(_0x3e2d30,_0xa718da){return client[_0x3cd6('0xc')](_0xe9557a,_0xa1ba80)[_0x3cd6('0xd')](function(_0x31df6f){logger[_0x3cd6('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x57b7ec,_0x3cd6('0xf'));logger[_0x3cd6('0x10')](_0x3cd6('0x11'),_0x57b7ec,'request\x20sent',JSON['stringify'](_0x31df6f));if(_0x31df6f['error']){if(_0x31df6f['error'][_0x3cd6('0x12')]===0x1f4){logger[_0x3cd6('0x13')](_0x3cd6('0x14'),_0x57b7ec,_0x31df6f[_0x3cd6('0x13')][_0x3cd6('0x15')]);return _0xa718da(_0x31df6f[_0x3cd6('0x13')][_0x3cd6('0x15')]);}logger['error'](_0x3cd6('0x14'),_0x57b7ec,_0x31df6f['error'][_0x3cd6('0x15')]);return _0x3e2d30(_0x31df6f['error']['message']);}else{logger[_0x3cd6('0xe')](_0x3cd6('0x14'),_0x57b7ec,'request\x20sent');_0x3e2d30(_0x31df6f['result'][_0x3cd6('0x15')]);}})[_0x3cd6('0x16')](function(_0x474701){logger['error'](_0x3cd6('0x14'),_0x57b7ec,_0x474701);_0xa718da(_0x474701);});});} \ No newline at end of file +var _0xaeda=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xaeda,0x1b4));var _0xaaed=function(_0x2cb4c9,_0x12f8a1){_0x2cb4c9=_0x2cb4c9-0x0;var _0x4ac9d8=_0xaeda[_0x2cb4c9];return _0x4ac9d8;};'use strict';var _=require(_0xaaed('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaaed('0x1'));var rs=require(_0xaaed('0x2'));var fs=require('fs');var Redis=require(_0xaaed('0x3'));var db=require(_0xaaed('0x4'))['db'];var utils=require(_0xaaed('0x5'));var logger=require('../../config/logger')(_0xaaed('0x6'));var config=require(_0xaaed('0x7'));var jayson=require(_0xaaed('0x8'));var client=jayson[_0xaaed('0x9')][_0xaaed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40c228,_0xdd0bcf,_0x44648a){return new BPromise(function(_0x803226,_0x29e870){return client[_0xaaed('0xb')](_0x40c228,_0x44648a)['then'](function(_0x176aa6){logger[_0xaaed('0xc')](_0xaaed('0xd'),_0xdd0bcf,_0xaaed('0xe'));logger[_0xaaed('0xf')](_0xaaed('0x10'),_0xdd0bcf,'request\x20sent',JSON[_0xaaed('0x11')](_0x176aa6));if(_0x176aa6[_0xaaed('0x12')]){if(_0x176aa6[_0xaaed('0x12')][_0xaaed('0x13')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0xdd0bcf,_0x176aa6[_0xaaed('0x12')][_0xaaed('0x14')]);return _0x29e870(_0x176aa6[_0xaaed('0x12')][_0xaaed('0x14')]);}logger[_0xaaed('0x12')](_0xaaed('0xd'),_0xdd0bcf,_0x176aa6[_0xaaed('0x12')][_0xaaed('0x14')]);return _0x803226(_0x176aa6[_0xaaed('0x12')]['message']);}else{logger[_0xaaed('0xc')](_0xaaed('0xd'),_0xdd0bcf,_0xaaed('0xe'));_0x803226(_0x176aa6['result'][_0xaaed('0x14')]);}})[_0xaaed('0x15')](function(_0x16afc4){logger['error'](_0xaaed('0xd'),_0xdd0bcf,_0x16afc4);_0x29e870(_0x16afc4);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index ac94918..e6f30d3 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 _0xb232=['describe','/:id','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe'];(function(_0x349e12,_0x1aee4c){var _0x477fdf=function(_0x4ce477){while(--_0x4ce477){_0x349e12['push'](_0x349e12['shift']());}};_0x477fdf(++_0x1aee4c);}(_0xb232,0xdb));var _0x2b23=function(_0x34bb68,_0x5b0079){_0x34bb68=_0x34bb68-0x0;var _0x3db9fb=_0xb232[_0x34bb68];return _0x3db9fb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b23('0x0'));var timeout=require(_0x2b23('0x1'));var express=require(_0x2b23('0x2'));var router=express[_0x2b23('0x3')]();var fs_extra=require(_0x2b23('0x4'));var auth=require(_0x2b23('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2b23('0x6'));var controller=require(_0x2b23('0x7'));router['get']('/',auth[_0x2b23('0x8')](),controller[_0x2b23('0x9')]);router[_0x2b23('0xa')](_0x2b23('0xb'),auth[_0x2b23('0x8')](),controller[_0x2b23('0xc')]);router[_0x2b23('0xa')](_0x2b23('0xd'),auth[_0x2b23('0x8')](),controller['show']);router[_0x2b23('0xe')]('/',auth[_0x2b23('0x8')](),controller[_0x2b23('0xf')]);router[_0x2b23('0x10')](_0x2b23('0xd'),auth[_0x2b23('0x8')](),controller[_0x2b23('0x11')]);router[_0x2b23('0x12')]('/:id',auth[_0x2b23('0x8')](),controller[_0x2b23('0x13')]);module[_0x2b23('0x14')]=router; \ No newline at end of file +var _0x31b0=['describe','/:id','create','delete','destroy','util','path','connect-timeout','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe'];(function(_0xfc30ab,_0x9c311d){var _0x1180dc=function(_0x5745aa){while(--_0x5745aa){_0xfc30ab['push'](_0xfc30ab['shift']());}};_0x1180dc(++_0x9c311d);}(_0x31b0,0xd7));var _0x031b=function(_0x1bcd5b,_0x1d8aca){_0x1bcd5b=_0x1bcd5b-0x0;var _0x27d479=_0x31b0[_0x1bcd5b];return _0x27d479;};'use strict';var multer=require('multer');var util=require(_0x031b('0x0'));var path=require(_0x031b('0x1'));var timeout=require(_0x031b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x031b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x031b('0x4'));var controller=require(_0x031b('0x5'));router[_0x031b('0x6')]('/',auth[_0x031b('0x7')](),controller[_0x031b('0x8')]);router[_0x031b('0x6')](_0x031b('0x9'),auth[_0x031b('0x7')](),controller[_0x031b('0xa')]);router['get'](_0x031b('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x031b('0x7')](),controller[_0x031b('0xc')]);router['put'](_0x031b('0xb'),auth[_0x031b('0x7')](),controller['update']);router[_0x031b('0xd')]('/:id',auth[_0x031b('0x7')](),controller[_0x031b('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 3fec80f..7596e5b 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 _0x0e10=['ENUM','mouseOver','timeout','sequelize','exports','STRING'];(function(_0x1d5a18,_0x585dc8){var _0x411450=function(_0x3f4ad8){while(--_0x3f4ad8){_0x1d5a18['push'](_0x1d5a18['shift']());}};_0x411450(++_0x585dc8);}(_0x0e10,0x1b9));var _0x00e1=function(_0x13d01b,_0x4741d5){_0x13d01b=_0x13d01b-0x0;var _0x330936=_0x0e10[_0x13d01b];return _0x330936;};'use strict';var Sequelize=require(_0x00e1('0x0'));module[_0x00e1('0x1')]={'name':{'type':Sequelize[_0x00e1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x00e1('0x3')](_0x00e1('0x4'),_0x00e1('0x5')),'defaultValue':_0x00e1('0x4')},'selector':{'type':Sequelize[_0x00e1('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x34b7=['timeout','STRING','INTEGER','sequelize','exports','ENUM','mouseOver'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0x34b7,0x73));var _0x734b=function(_0x44d487,_0x13ba53){_0x44d487=_0x44d487-0x0;var _0x2a01ee=_0x34b7[_0x44d487];return _0x2a01ee;};'use strict';var Sequelize=require(_0x734b('0x0'));module[_0x734b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x734b('0x2')](_0x734b('0x3'),_0x734b('0x4')),'defaultValue':_0x734b('0x3')},'selector':{'type':Sequelize[_0x734b('0x5')]},'timeout':{'type':Sequelize[_0x734b('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 2f2badf..a406dda 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 _0xdbf7=['params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','options','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','show'];(function(_0x36fa0e,_0x5c2e92){var _0x3d9c51=function(_0x48856a){while(--_0x48856a){_0x36fa0e['push'](_0x36fa0e['shift']());}};_0x3d9c51(++_0x5c2e92);}(_0xdbf7,0x8d));var _0x7dbf=function(_0x1d7037,_0x57dd95){_0x1d7037=_0x1d7037-0x0;var _0x4d6568=_0xdbf7[_0x1d7037];return _0x4d6568;};'use strict';var emlformat=require(_0x7dbf('0x0'));var rimraf=require(_0x7dbf('0x1'));var zipdir=require(_0x7dbf('0x2'));var jsonpatch=require(_0x7dbf('0x3'));var rp=require(_0x7dbf('0x4'));var moment=require(_0x7dbf('0x5'));var BPromise=require(_0x7dbf('0x6'));var Mustache=require(_0x7dbf('0x7'));var util=require('util');var path=require(_0x7dbf('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x7dbf('0xa'));var _=require(_0x7dbf('0xb'));var squel=require(_0x7dbf('0xc'));var crypto=require(_0x7dbf('0xd'));var jsforce=require(_0x7dbf('0xe'));var deskjs=require(_0x7dbf('0xf'));var toCsv=require(_0x7dbf('0x10'));var querystring=require(_0x7dbf('0x11'));var Papa=require(_0x7dbf('0x12'));var Redis=require(_0x7dbf('0x13'));var authService=require(_0x7dbf('0x14'));var qs=require(_0x7dbf('0x15'));var as=require(_0x7dbf('0x16'));var hardwareService=require(_0x7dbf('0x17'));var logger=require('../../config/logger')(_0x7dbf('0x18'));var utils=require(_0x7dbf('0x19'));var config=require(_0x7dbf('0x1a'));var licenseUtil=require(_0x7dbf('0x1b'));var db=require(_0x7dbf('0x1c'))['db'];function respondWithStatusCode(_0x2254d7,_0x50bddb){_0x50bddb=_0x50bddb||0xcc;return function(_0x54bb0a){if(_0x54bb0a){return _0x2254d7['sendStatus'](_0x50bddb);}return _0x2254d7['status'](_0x50bddb)['end']();};}function respondWithResult(_0x524ed4,_0x201d38){_0x201d38=_0x201d38||0xc8;return function(_0x35686a){if(_0x35686a){return _0x524ed4[_0x7dbf('0x1d')](_0x201d38)['json'](_0x35686a);}};}function respondWithFilteredResult(_0x3dd291,_0x4492c8){return function(_0x38be73){if(_0x38be73){var _0x4a3cd3=typeof _0x4492c8[_0x7dbf('0x1e')]===_0x7dbf('0x1f')&&typeof _0x4492c8[_0x7dbf('0x20')]===_0x7dbf('0x1f');var _0x1d6b88=_0x38be73[_0x7dbf('0x21')];var _0xc47749=_0x4a3cd3?0x0:_0x4492c8['offset'];var _0x3abe64=_0x4a3cd3?_0x38be73['count']:_0x4492c8[_0x7dbf('0x1e')]+_0x4492c8['limit'];var _0x3dfcb8;if(_0x3abe64>=_0x1d6b88){_0x3abe64=_0x1d6b88;_0x3dfcb8=0xc8;}else{_0x3dfcb8=0xce;}_0x3dd291[_0x7dbf('0x1d')](_0x3dfcb8);return _0x3dd291[_0x7dbf('0x22')](_0x7dbf('0x23'),_0xc47749+'-'+_0x3abe64+'/'+_0x1d6b88)['json'](_0x38be73);}return null;};}function patchUpdates(_0xe2b82){return function(_0x104025){try{jsonpatch[_0x7dbf('0x24')](_0x104025,_0xe2b82,!![]);}catch(_0x56d108){return BPromise[_0x7dbf('0x25')](_0x56d108);}return _0x104025[_0x7dbf('0x26')]();};}function saveUpdates(_0x8b988d,_0xd2460c){return function(_0x4638b8){if(_0x4638b8){return _0x4638b8['update'](_0x8b988d)[_0x7dbf('0x27')](function(_0x26a5e2){return _0x26a5e2;});}return null;};}function removeEntity(_0x29f89f,_0x502014){return function(_0x48d753){if(_0x48d753){return _0x48d753[_0x7dbf('0x28')]()[_0x7dbf('0x27')](function(){_0x29f89f[_0x7dbf('0x1d')](0xcc)[_0x7dbf('0x29')]();});}};}function handleEntityNotFound(_0x205a70,_0x2360a3){return function(_0x35d4d2){if(!_0x35d4d2){_0x205a70['sendStatus'](0x194);}return _0x35d4d2;};}function handleError(_0x5a68fb,_0xba1115){_0xba1115=_0xba1115||0x1f4;return function(_0x2403d7){logger['error'](_0x2403d7[_0x7dbf('0x2a')]);if(_0x2403d7[_0x7dbf('0x2b')]){delete _0x2403d7[_0x7dbf('0x2b')];}_0x5a68fb[_0x7dbf('0x1d')](_0xba1115)['send'](_0x2403d7);};}exports[_0x7dbf('0x2c')]=function(_0x5dcdf4,_0x36d433){var _0x55c1f6={'raw':!![],'where':{'id':_0x5dcdf4[_0x7dbf('0x2d')]['id']}},_0x3c0515={};_0x3c0515[_0x7dbf('0x2e')]=_[_0x7dbf('0x2f')](db[_0x7dbf('0x30')][_0x7dbf('0x31')]);_0x3c0515[_0x7dbf('0x32')]=_[_0x7dbf('0x2f')](_0x5dcdf4[_0x7dbf('0x32')]);_0x3c0515[_0x7dbf('0x33')]=_[_0x7dbf('0x34')](_0x3c0515[_0x7dbf('0x2e')],_0x3c0515[_0x7dbf('0x32')]);_0x55c1f6[_0x7dbf('0x35')]=_[_0x7dbf('0x34')](_0x3c0515['model'],qs[_0x7dbf('0x36')](_0x5dcdf4[_0x7dbf('0x32')][_0x7dbf('0x36')]));_0x55c1f6[_0x7dbf('0x35')]=_0x55c1f6[_0x7dbf('0x35')]['length']?_0x55c1f6[_0x7dbf('0x35')]:_0x3c0515[_0x7dbf('0x2e')];if(_0x5dcdf4[_0x7dbf('0x32')][_0x7dbf('0x37')]){_0x55c1f6[_0x7dbf('0x38')]=[{'all':!![]}];}_0x55c1f6=_['merge']({},_0x55c1f6,_0x5dcdf4[_0x7dbf('0x39')]);return db[_0x7dbf('0x30')]['find'](_0x55c1f6)[_0x7dbf('0x27')](handleEntityNotFound(_0x36d433,null))['then'](respondWithResult(_0x36d433,null))[_0x7dbf('0x3a')](handleError(_0x36d433,null));};exports[_0x7dbf('0x3b')]=function(_0x431c00,_0x4ab0eb){return db[_0x7dbf('0x30')][_0x7dbf('0x3b')](_0x431c00['body'],{})[_0x7dbf('0x27')](respondWithResult(_0x4ab0eb,0xc9))[_0x7dbf('0x3a')](handleError(_0x4ab0eb,null));};exports['update']=function(_0x1a1362,_0x4fda6f){if(_0x1a1362[_0x7dbf('0x3c')]['id']){delete _0x1a1362['body']['id'];}return db[_0x7dbf('0x30')][_0x7dbf('0x3d')]({'where':{'id':_0x1a1362[_0x7dbf('0x2d')]['id']}})[_0x7dbf('0x27')](handleEntityNotFound(_0x4fda6f,null))[_0x7dbf('0x27')](saveUpdates(_0x1a1362[_0x7dbf('0x3c')],null))['then'](respondWithResult(_0x4fda6f,null))['catch'](handleError(_0x4fda6f,null));};exports[_0x7dbf('0x28')]=function(_0x1d2d5d,_0x5dda39){return db[_0x7dbf('0x30')][_0x7dbf('0x3d')]({'where':{'id':_0x1d2d5d[_0x7dbf('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5dda39,null))[_0x7dbf('0x27')](removeEntity(_0x5dda39,null))[_0x7dbf('0x3a')](handleError(_0x5dda39,null));}; \ No newline at end of file +var _0x75a2=['find','catch','create','body','update','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','reject','save','then','sendStatus','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','options'];(function(_0x3a61c2,_0x1c80ee){var _0x2b9093=function(_0xde11fa){while(--_0xde11fa){_0x3a61c2['push'](_0x3a61c2['shift']());}};_0x2b9093(++_0x1c80ee);}(_0x75a2,0x187));var _0x275a=function(_0x36aebb,_0x286ca8){_0x36aebb=_0x36aebb-0x0;var _0x1a5020=_0x75a2[_0x36aebb];return _0x1a5020;};'use strict';var emlformat=require(_0x275a('0x0'));var rimraf=require(_0x275a('0x1'));var zipdir=require(_0x275a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x275a('0x3'));var moment=require(_0x275a('0x4'));var BPromise=require(_0x275a('0x5'));var Mustache=require(_0x275a('0x6'));var util=require('util');var path=require(_0x275a('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(_0x275a('0x8'));var squel=require(_0x275a('0x9'));var crypto=require(_0x275a('0xa'));var jsforce=require(_0x275a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x275a('0xc'));var Papa=require(_0x275a('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x275a('0xe'));var hardwareService=require(_0x275a('0xf'));var logger=require(_0x275a('0x10'))(_0x275a('0x11'));var utils=require(_0x275a('0x12'));var config=require(_0x275a('0x13'));var licenseUtil=require(_0x275a('0x14'));var db=require(_0x275a('0x15'))['db'];function respondWithStatusCode(_0x2b5204,_0x991cd0){_0x991cd0=_0x991cd0||0xcc;return function(_0x263f8f){if(_0x263f8f){return _0x2b5204['sendStatus'](_0x991cd0);}return _0x2b5204[_0x275a('0x16')](_0x991cd0)[_0x275a('0x17')]();};}function respondWithResult(_0x480be0,_0x541c80){_0x541c80=_0x541c80||0xc8;return function(_0x2baa83){if(_0x2baa83){return _0x480be0[_0x275a('0x16')](_0x541c80)[_0x275a('0x18')](_0x2baa83);}};}function respondWithFilteredResult(_0x2560ae,_0x227cee){return function(_0x125348){if(_0x125348){var _0x283865=typeof _0x227cee[_0x275a('0x19')]===_0x275a('0x1a')&&typeof _0x227cee['limit']==='undefined';var _0x21cf70=_0x125348[_0x275a('0x1b')];var _0x50374a=_0x283865?0x0:_0x227cee[_0x275a('0x19')];var _0x59d755=_0x283865?_0x125348[_0x275a('0x1b')]:_0x227cee[_0x275a('0x19')]+_0x227cee['limit'];var _0xe59012;if(_0x59d755>=_0x21cf70){_0x59d755=_0x21cf70;_0xe59012=0xc8;}else{_0xe59012=0xce;}_0x2560ae[_0x275a('0x16')](_0xe59012);return _0x2560ae['set']('Content-Range',_0x50374a+'-'+_0x59d755+'/'+_0x21cf70)[_0x275a('0x18')](_0x125348);}return null;};}function patchUpdates(_0x456c61){return function(_0x4864c2){try{jsonpatch['apply'](_0x4864c2,_0x456c61,!![]);}catch(_0x4afb5e){return BPromise[_0x275a('0x1c')](_0x4afb5e);}return _0x4864c2[_0x275a('0x1d')]();};}function saveUpdates(_0x453bab,_0x7d58d2){return function(_0xbb91e7){if(_0xbb91e7){return _0xbb91e7['update'](_0x453bab)[_0x275a('0x1e')](function(_0x19ef1f){return _0x19ef1f;});}return null;};}function removeEntity(_0x2f9232,_0x21a0ee){return function(_0x32eb4b){if(_0x32eb4b){return _0x32eb4b['destroy']()[_0x275a('0x1e')](function(){_0x2f9232[_0x275a('0x16')](0xcc)[_0x275a('0x17')]();});}};}function handleEntityNotFound(_0x1441c3,_0x263fde){return function(_0x2bfe4d){if(!_0x2bfe4d){_0x1441c3[_0x275a('0x1f')](0x194);}return _0x2bfe4d;};}function handleError(_0x366002,_0x204f05){_0x204f05=_0x204f05||0x1f4;return function(_0x3ad063){logger['error'](_0x3ad063[_0x275a('0x20')]);if(_0x3ad063[_0x275a('0x21')]){delete _0x3ad063['name'];}_0x366002[_0x275a('0x16')](_0x204f05)[_0x275a('0x22')](_0x3ad063);};}exports[_0x275a('0x23')]=function(_0xa5048b,_0x5be632){var _0x265b1f={'raw':!![],'where':{'id':_0xa5048b[_0x275a('0x24')]['id']}},_0x440157={};_0x440157[_0x275a('0x25')]=_[_0x275a('0x26')](db[_0x275a('0x27')][_0x275a('0x28')]);_0x440157[_0x275a('0x29')]=_[_0x275a('0x26')](_0xa5048b[_0x275a('0x29')]);_0x440157['filters']=_[_0x275a('0x2a')](_0x440157[_0x275a('0x25')],_0x440157['query']);_0x265b1f[_0x275a('0x2b')]=_[_0x275a('0x2a')](_0x440157[_0x275a('0x25')],qs[_0x275a('0x2c')](_0xa5048b['query'][_0x275a('0x2c')]));_0x265b1f[_0x275a('0x2b')]=_0x265b1f[_0x275a('0x2b')][_0x275a('0x2d')]?_0x265b1f[_0x275a('0x2b')]:_0x440157['model'];if(_0xa5048b[_0x275a('0x29')][_0x275a('0x2e')]){_0x265b1f[_0x275a('0x2f')]=[{'all':!![]}];}_0x265b1f=_['merge']({},_0x265b1f,_0xa5048b[_0x275a('0x30')]);return db['ChatProactiveAction'][_0x275a('0x31')](_0x265b1f)['then'](handleEntityNotFound(_0x5be632,null))['then'](respondWithResult(_0x5be632,null))[_0x275a('0x32')](handleError(_0x5be632,null));};exports[_0x275a('0x33')]=function(_0x946a67,_0x4c098a){return db[_0x275a('0x27')][_0x275a('0x33')](_0x946a67[_0x275a('0x34')],{})[_0x275a('0x1e')](respondWithResult(_0x4c098a,0xc9))[_0x275a('0x32')](handleError(_0x4c098a,null));};exports[_0x275a('0x35')]=function(_0x232e32,_0x18a03f){if(_0x232e32['body']['id']){delete _0x232e32[_0x275a('0x34')]['id'];}return db[_0x275a('0x27')][_0x275a('0x31')]({'where':{'id':_0x232e32['params']['id']}})[_0x275a('0x1e')](handleEntityNotFound(_0x18a03f,null))[_0x275a('0x1e')](saveUpdates(_0x232e32[_0x275a('0x34')],null))['then'](respondWithResult(_0x18a03f,null))[_0x275a('0x32')](handleError(_0x18a03f,null));};exports[_0x275a('0x36')]=function(_0x593b3d,_0x315e7d){return db[_0x275a('0x27')]['find']({'where':{'id':_0x593b3d[_0x275a('0x24')]['id']}})['then'](handleEntityNotFound(_0x315e7d,null))[_0x275a('0x1e')](removeEntity(_0x315e7d,null))[_0x275a('0x32')](handleError(_0x315e7d,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index eed4719..2629edf 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 _0x944c=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','ChatProactiveAction','chat_proactive_actions','lodash','util','moment','bluebird'];(function(_0x37ae26,_0x2ecd70){var _0x1b1902=function(_0x5a6ae0){while(--_0x5a6ae0){_0x37ae26['push'](_0x37ae26['shift']());}};_0x1b1902(++_0x2ecd70);}(_0x944c,0x18c));var _0xc944=function(_0x4cd77a,_0x27fb35){_0x4cd77a=_0x4cd77a-0x0;var _0x8d22ab=_0x944c[_0x4cd77a];return _0x8d22ab;};'use strict';var _=require(_0xc944('0x0'));var util=require(_0xc944('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc944('0x2'));var BPromise=require(_0xc944('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc944('0x4'));var rimraf=require(_0xc944('0x5'));var config=require(_0xc944('0x6'));var attributes=require(_0xc944('0x7'));module['exports']=function(_0x2118b7,_0x5b52a4){return _0x2118b7['define'](_0xc944('0x8'),attributes,{'tableName':_0xc944('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb732=['ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./chatProactiveAction.attributes','define'];(function(_0x589002,_0x1c9c42){var _0x1ebe5a=function(_0x7f9547){while(--_0x7f9547){_0x589002['push'](_0x589002['shift']());}};_0x1ebe5a(++_0x1c9c42);}(_0xb732,0xa7));var _0x2b73=function(_0x2aae70,_0x1b8557){_0x2aae70=_0x2aae70-0x0;var _0x53c0bf=_0xb732[_0x2aae70];return _0x53c0bf;};'use strict';var _=require(_0x2b73('0x0'));var util=require('util');var logger=require(_0x2b73('0x1'))(_0x2b73('0x2'));var moment=require(_0x2b73('0x3'));var BPromise=require(_0x2b73('0x4'));var rp=require(_0x2b73('0x5'));var fs=require('fs');var path=require(_0x2b73('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2b73('0x7'));module['exports']=function(_0x5157a8,_0x218837){return _0x5157a8[_0x2b73('0x8')](_0x2b73('0x9'),attributes,{'tableName':_0x2b73('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index d53789a..59618d6 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 _0xfc36=['message','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4f73ce,_0x584350){var _0x2cbc2b=function(_0x420c09){while(--_0x420c09){_0x4f73ce['push'](_0x4f73ce['shift']());}};_0x2cbc2b(++_0x584350);}(_0xfc36,0x1a5));var _0x6fc3=function(_0x2c16e5,_0xc56a48){_0x2c16e5=_0x2c16e5-0x0;var _0x47d93b=_0xfc36[_0x2c16e5];return _0x47d93b;};'use strict';var _=require(_0x6fc3('0x0'));var util=require(_0x6fc3('0x1'));var moment=require('moment');var BPromise=require(_0x6fc3('0x2'));var rs=require(_0x6fc3('0x3'));var fs=require('fs');var Redis=require(_0x6fc3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6fc3('0x5'));var logger=require('../../config/logger')(_0x6fc3('0x6'));var config=require(_0x6fc3('0x7'));var jayson=require(_0x6fc3('0x8'));var client=jayson[_0x6fc3('0x9')][_0x6fc3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x467c8a,_0x9a58f4,_0xa88cd4){return new BPromise(function(_0x351b29,_0x312f8a){return client[_0x6fc3('0xb')](_0x467c8a,_0xa88cd4)['then'](function(_0x33d5e3){logger[_0x6fc3('0xc')](_0x6fc3('0xd'),_0x9a58f4,'request\x20sent');logger[_0x6fc3('0xe')](_0x6fc3('0xf'),_0x9a58f4,'request\x20sent',JSON[_0x6fc3('0x10')](_0x33d5e3));if(_0x33d5e3[_0x6fc3('0x11')]){if(_0x33d5e3['error'][_0x6fc3('0x12')]===0x1f4){logger[_0x6fc3('0x11')](_0x6fc3('0xd'),_0x9a58f4,_0x33d5e3['error']['message']);return _0x312f8a(_0x33d5e3[_0x6fc3('0x11')][_0x6fc3('0x13')]);}logger['error'](_0x6fc3('0xd'),_0x9a58f4,_0x33d5e3['error'][_0x6fc3('0x13')]);return _0x351b29(_0x33d5e3['error'][_0x6fc3('0x13')]);}else{logger['info'](_0x6fc3('0xd'),_0x9a58f4,'request\x20sent');_0x351b29(_0x33d5e3['result'][_0x6fc3('0x13')]);}})['catch'](function(_0x4855f6){logger[_0x6fc3('0x11')](_0x6fc3('0xd'),_0x9a58f4,_0x4855f6);_0x312f8a(_0x4855f6);});});} \ No newline at end of file +var _0xe5c8=['info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x51dd28,_0x29cf8e){var _0x1fc66e=function(_0x2abf54){while(--_0x2abf54){_0x51dd28['push'](_0x51dd28['shift']());}};_0x1fc66e(++_0x29cf8e);}(_0xe5c8,0x135));var _0x8e5c=function(_0x4a1775,_0x3b1e3e){_0x4a1775=_0x4a1775-0x0;var _0x30a179=_0xe5c8[_0x4a1775];return _0x30a179;};'use strict';var _=require('lodash');var util=require(_0x8e5c('0x0'));var moment=require(_0x8e5c('0x1'));var BPromise=require('bluebird');var rs=require(_0x8e5c('0x2'));var fs=require('fs');var Redis=require(_0x8e5c('0x3'));var db=require(_0x8e5c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e5c('0x5'))(_0x8e5c('0x6'));var config=require(_0x8e5c('0x7'));var jayson=require(_0x8e5c('0x8'));var client=jayson[_0x8e5c('0x9')][_0x8e5c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46fb28,_0x3f7fdb,_0x555b40){return new BPromise(function(_0x24b15f,_0x1894ed){return client[_0x8e5c('0xb')](_0x46fb28,_0x555b40)[_0x8e5c('0xc')](function(_0x18c81f){logger[_0x8e5c('0xd')](_0x8e5c('0xe'),_0x3f7fdb,'request\x20sent');logger[_0x8e5c('0xf')](_0x8e5c('0x10'),_0x3f7fdb,_0x8e5c('0x11'),JSON[_0x8e5c('0x12')](_0x18c81f));if(_0x18c81f[_0x8e5c('0x13')]){if(_0x18c81f[_0x8e5c('0x13')][_0x8e5c('0x14')]===0x1f4){logger['error'](_0x8e5c('0xe'),_0x3f7fdb,_0x18c81f[_0x8e5c('0x13')][_0x8e5c('0x15')]);return _0x1894ed(_0x18c81f[_0x8e5c('0x13')][_0x8e5c('0x15')]);}logger['error'](_0x8e5c('0xe'),_0x3f7fdb,_0x18c81f[_0x8e5c('0x13')][_0x8e5c('0x15')]);return _0x24b15f(_0x18c81f[_0x8e5c('0x13')][_0x8e5c('0x15')]);}else{logger[_0x8e5c('0xd')](_0x8e5c('0xe'),_0x3f7fdb,'request\x20sent');_0x24b15f(_0x18c81f[_0x8e5c('0x16')][_0x8e5c('0x15')]);}})['catch'](function(_0x44155e){logger[_0x8e5c('0x13')](_0x8e5c('0xe'),_0x3f7fdb,_0x44155e);_0x1894ed(_0x44155e);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index da81b77..03cee4a 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 _0x7fbe=['show','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x5f0e63,_0x3d7dd6){var _0x1e4574=function(_0x2df20d){while(--_0x2df20d){_0x5f0e63['push'](_0x5f0e63['shift']());}};_0x1e4574(++_0x3d7dd6);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3a831f,_0x31c8a4){_0x3a831f=_0x3a831f-0x0;var _0x26786c=_0x7fbe[_0x3a831f];return _0x26786c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0xc')]);router[_0xe7fb('0xd')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0xe')]);router[_0xe7fb('0xf')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller['update']);router['delete'](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0x10')]);module[_0xe7fb('0x11')]=router; \ No newline at end of file +var _0x7dfd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x16f287,_0x20a1f8){var _0x1f74ad=function(_0x5daa28){while(--_0x5daa28){_0x16f287['push'](_0x16f287['shift']());}};_0x1f74ad(++_0x20a1f8);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0xe')]);router[_0xd7df('0xf')]('/',auth[_0xd7df('0xd')](),controller['create']);router[_0xd7df('0x10')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0x11')]);router['delete'](_0xd7df('0xc'),auth['isAuthenticated'](),controller[_0xd7df('0x12')]);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 d40604b..493db1b 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 _0xb5a7=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xb5a7,0x66));var _0x7b5a=function(_0xa13ad7,_0x27270b){_0xa13ad7=_0xa13ad7-0x0;var _0x409c3d=_0xb5a7[_0xa13ad7];return _0x409c3d;};'use strict';var Sequelize=require(_0x7b5a('0x0'));module[_0x7b5a('0x1')]={'name':{'type':Sequelize[_0x7b5a('0x2')],'unique':_0x7b5a('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7b5a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7b5a('0x5')](_0x7b5a('0x6'),_0x7b5a('0x7'),_0x7b5a('0x8'))}}; \ No newline at end of file +var _0x58c6=['rrmemory','roundrobin','sequelize','exports','STRING','name','ENUM'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x58c6,0x167));var _0x658c=function(_0x2c8b7a,_0x483fe0){_0x2c8b7a=_0x2c8b7a-0x0;var _0x1c1cf9=_0x58c6[_0x2c8b7a];return _0x1c1cf9;};'use strict';var Sequelize=require(_0x658c('0x0'));module[_0x658c('0x1')]={'name':{'type':Sequelize[_0x658c('0x2')],'unique':_0x658c('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x658c('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x658c('0x4')](_0x658c('0x5'),'beepall',_0x658c('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index ffa59e2..c376868 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 _0x6444=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','map','ChatQueue','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','createdAt','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userChatQueue:save','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','omit','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x4b1e1f,_0x3b4477){var _0x41a007=function(_0x4c7686){while(--_0x4c7686){_0x4b1e1f['push'](_0x4b1e1f['shift']());}};_0x41a007(++_0x3b4477);}(_0x6444,0x112));var _0x4644=function(_0x52becd,_0x4c9daf){_0x52becd=_0x52becd-0x0;var _0x1dbddc=_0x6444[_0x52becd];return _0x1dbddc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4644('0x0'));var jsonpatch=require(_0x4644('0x1'));var rp=require(_0x4644('0x2'));var moment=require(_0x4644('0x3'));var BPromise=require(_0x4644('0x4'));var Mustache=require(_0x4644('0x5'));var util=require(_0x4644('0x6'));var path=require(_0x4644('0x7'));var sox=require(_0x4644('0x8'));var csv=require('to-csv');var ejs=require(_0x4644('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4644('0xa'));var crypto=require('crypto');var jsforce=require(_0x4644('0xb'));var deskjs=require(_0x4644('0xc'));var toCsv=require(_0x4644('0xd'));var querystring=require('querystring');var Papa=require(_0x4644('0xe'));var Redis=require(_0x4644('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4644('0x10'));var as=require(_0x4644('0x11'));var hardwareService=require(_0x4644('0x12'));var logger=require('../../config/logger')(_0x4644('0x13'));var utils=require(_0x4644('0x14'));var config=require(_0x4644('0x15'));var licenseUtil=require(_0x4644('0x16'));var db=require(_0x4644('0x17'))['db'];config[_0x4644('0x18')]=_[_0x4644('0x19')](config[_0x4644('0x18')],{'host':_0x4644('0x1a'),'port':0x18eb});var socket=require(_0x4644('0x1b'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x4644('0x1c')](socket);var jayson=require(_0x4644('0x1d'));var client=jayson[_0x4644('0x1e')][_0x4644('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x11195f,_0x5d6ce8,_0x19c60b,_0x5772cb){return new BPromise(function(_0x30d474,_0x3622b2){var _0x4f6663=_0x5772cb||client;return _0x4f6663[_0x4644('0x20')](_0x11195f,_0x19c60b)[_0x4644('0x21')](function(_0x28ed59){logger[_0x4644('0x22')](_0x4644('0x23'),_0x5d6ce8,_0x4644('0x24'));logger['debug'](_0x4644('0x25'),_0x5d6ce8,_0x4644('0x24'),JSON[_0x4644('0x26')](_0x28ed59));if(_0x28ed59[_0x4644('0x27')]){if(_0x28ed59['error'][_0x4644('0x28')]===0x1f4){logger[_0x4644('0x27')](_0x4644('0x23'),_0x5d6ce8,_0x28ed59['error'][_0x4644('0x29')]);return _0x3622b2(_0x28ed59['error'][_0x4644('0x29')]);}logger[_0x4644('0x27')](_0x4644('0x23'),_0x5d6ce8,_0x28ed59[_0x4644('0x27')][_0x4644('0x29')]);return _0x30d474(_0x28ed59['error'][_0x4644('0x29')]);}else{logger['info'](_0x4644('0x23'),_0x5d6ce8,'request\x20sent');_0x30d474(_0x28ed59[_0x4644('0x2a')][_0x4644('0x29')]);}})['catch'](function(_0x2ba17e){logger[_0x4644('0x27')](_0x4644('0x23'),_0x5d6ce8,_0x2ba17e);_0x3622b2(_0x2ba17e);});});}function respondWithStatusCode(_0x2008b6,_0x17a12e){_0x17a12e=_0x17a12e||0xcc;return function(_0x5a6d35){if(_0x5a6d35){return _0x2008b6['sendStatus'](_0x17a12e);}return _0x2008b6[_0x4644('0x2b')](_0x17a12e)[_0x4644('0x2c')]();};}function respondWithResult(_0x463971,_0x1d1a42){_0x1d1a42=_0x1d1a42||0xc8;return function(_0x41552c){if(_0x41552c){return _0x463971[_0x4644('0x2b')](_0x1d1a42)[_0x4644('0x2d')](_0x41552c);}};}function respondWithFilteredResult(_0x7fff05,_0x588a8b){return function(_0x1fe51f){if(_0x1fe51f){var _0x388f4b=typeof _0x588a8b[_0x4644('0x2e')]===_0x4644('0x2f')&&typeof _0x588a8b['limit']===_0x4644('0x2f');var _0x15341e=_0x1fe51f[_0x4644('0x30')];var _0x2dffbb=_0x388f4b?0x0:_0x588a8b[_0x4644('0x2e')];var _0x45dc2f=_0x388f4b?_0x1fe51f[_0x4644('0x30')]:_0x588a8b[_0x4644('0x2e')]+_0x588a8b[_0x4644('0x31')];var _0x19dfca;if(_0x45dc2f>=_0x15341e){_0x45dc2f=_0x15341e;_0x19dfca=0xc8;}else{_0x19dfca=0xce;}_0x7fff05['status'](_0x19dfca);return _0x7fff05[_0x4644('0x32')](_0x4644('0x33'),_0x2dffbb+'-'+_0x45dc2f+'/'+_0x15341e)[_0x4644('0x2d')](_0x1fe51f);}return null;};}function patchUpdates(_0x40c2a0){return function(_0x5814cf){try{jsonpatch['apply'](_0x5814cf,_0x40c2a0,!![]);}catch(_0x4f3b33){return BPromise[_0x4644('0x34')](_0x4f3b33);}return _0x5814cf[_0x4644('0x35')]();};}function saveUpdates(_0x84a519,_0x2d5720){return function(_0x1d9e1b){if(_0x1d9e1b){return _0x1d9e1b['update'](_0x84a519)[_0x4644('0x21')](function(_0x37c1ce){return _0x37c1ce;});}return null;};}function removeEntity(_0x41077b,_0x1b383b){return function(_0x2180c2){if(_0x2180c2){return _0x2180c2[_0x4644('0x36')]()[_0x4644('0x21')](function(){var _0x22ce6c=_0x2180c2[_0x4644('0x37')]({'plain':!![]});var _0x45290d=_0x4644('0x38');return db[_0x4644('0x39')]['destroy']({'where':{'type':_0x45290d,'resourceId':_0x22ce6c['id']}})[_0x4644('0x21')](function(){return _0x2180c2;});})[_0x4644('0x21')](function(){_0x41077b[_0x4644('0x2b')](0xcc)[_0x4644('0x2c')]();});}};}function handleEntityNotFound(_0x4358ae,_0x22c9c5){return function(_0xca218e){if(!_0xca218e){_0x4358ae[_0x4644('0x3a')](0x194);}return _0xca218e;};}function handleError(_0x5437a9,_0x199677){_0x199677=_0x199677||0x1f4;return function(_0x562941){logger[_0x4644('0x27')](_0x562941[_0x4644('0x3b')]);if(_0x562941[_0x4644('0x3c')]){delete _0x562941[_0x4644('0x3c')];}_0x5437a9['status'](_0x199677)['send'](_0x562941);};}exports['index']=function(_0x200a53,_0x49ea40){var _0x1722b6={},_0x15195e={},_0x1a7eb5={'count':0x0,'rows':[]};var _0xb2494=_[_0x4644('0x3d')](db[_0x4644('0x3e')][_0x4644('0x3f')],function(_0x1c95d3){return{'name':_0x1c95d3[_0x4644('0x40')],'type':_0x1c95d3['type']['key']};});_0x15195e[_0x4644('0x41')]=_[_0x4644('0x3d')](_0xb2494,_0x4644('0x3c'));_0x15195e[_0x4644('0x42')]=_[_0x4644('0x43')](_0x200a53[_0x4644('0x42')]);_0x15195e['filters']=_[_0x4644('0x44')](_0x15195e['model'],_0x15195e[_0x4644('0x42')]);_0x1722b6['attributes']=_[_0x4644('0x44')](_0x15195e[_0x4644('0x41')],qs[_0x4644('0x45')](_0x200a53[_0x4644('0x42')][_0x4644('0x45')]));_0x1722b6[_0x4644('0x46')]=_0x1722b6[_0x4644('0x46')][_0x4644('0x47')]?_0x1722b6[_0x4644('0x46')]:_0x15195e[_0x4644('0x41')];if(!_0x200a53[_0x4644('0x42')][_0x4644('0x48')](_0x4644('0x49'))){_0x1722b6[_0x4644('0x31')]=qs['limit'](_0x200a53[_0x4644('0x42')][_0x4644('0x31')]);_0x1722b6[_0x4644('0x2e')]=qs[_0x4644('0x2e')](_0x200a53[_0x4644('0x42')][_0x4644('0x2e')]);}_0x1722b6[_0x4644('0x4a')]=qs['sort'](_0x200a53[_0x4644('0x42')][_0x4644('0x4b')]);_0x1722b6[_0x4644('0x4c')]=qs[_0x4644('0x4d')](_[_0x4644('0x4e')](_0x200a53[_0x4644('0x42')],_0x15195e[_0x4644('0x4d')]),_0xb2494);if(_0x200a53[_0x4644('0x42')][_0x4644('0x4f')]){_0x1722b6['where']=_[_0x4644('0x50')](_0x1722b6[_0x4644('0x4c')],{'$or':_[_0x4644('0x3d')](_0xb2494,function(_0x3de003){if(_0x3de003['type']!==_0x4644('0x51')){var _0x1ddbf2={};_0x1ddbf2[_0x3de003[_0x4644('0x3c')]]={'$like':'%'+_0x200a53['query'][_0x4644('0x4f')]+'%'};return _0x1ddbf2;}})});}_0x1722b6=_[_0x4644('0x50')]({},_0x1722b6,_0x200a53[_0x4644('0x52')]);var _0x3dd73f={'where':_0x1722b6['where']};return db[_0x4644('0x3e')][_0x4644('0x30')](_0x3dd73f)['then'](function(_0x2971f0){_0x1a7eb5[_0x4644('0x30')]=_0x2971f0;if(_0x200a53['query']['includeAll']){_0x1722b6[_0x4644('0x53')]=[{'all':!![]}];}return db[_0x4644('0x3e')][_0x4644('0x54')](_0x1722b6);})[_0x4644('0x21')](function(_0x58c783){_0x1a7eb5[_0x4644('0x55')]=_0x58c783;return _0x1a7eb5;})[_0x4644('0x21')](respondWithFilteredResult(_0x49ea40,_0x1722b6))[_0x4644('0x56')](handleError(_0x49ea40,null));};exports[_0x4644('0x57')]=function(_0x285504,_0x23c6a2){var _0x49dd27={'raw':!![],'where':{'id':_0x285504[_0x4644('0x58')]['id']}},_0x4fd6f9={};_0x4fd6f9['model']=_[_0x4644('0x43')](db[_0x4644('0x3e')][_0x4644('0x3f')]);_0x4fd6f9[_0x4644('0x42')]=_[_0x4644('0x43')](_0x285504[_0x4644('0x42')]);_0x4fd6f9['filters']=_['intersection'](_0x4fd6f9[_0x4644('0x41')],_0x4fd6f9[_0x4644('0x42')]);_0x49dd27[_0x4644('0x46')]=_[_0x4644('0x44')](_0x4fd6f9['model'],qs[_0x4644('0x45')](_0x285504[_0x4644('0x42')][_0x4644('0x45')]));_0x49dd27[_0x4644('0x46')]=_0x49dd27['attributes'][_0x4644('0x47')]?_0x49dd27['attributes']:_0x4fd6f9[_0x4644('0x41')];if(_0x285504[_0x4644('0x42')]['includeAll']){_0x49dd27['include']=[{'all':!![]}];}_0x49dd27=_[_0x4644('0x50')]({},_0x49dd27,_0x285504[_0x4644('0x52')]);return db[_0x4644('0x3e')][_0x4644('0x59')](_0x49dd27)['then'](handleEntityNotFound(_0x23c6a2,null))['then'](respondWithResult(_0x23c6a2,null))['catch'](handleError(_0x23c6a2,null));};exports['create']=function(_0x3f4a0e,_0x395675){return db['ChatQueue']['create'](_0x3f4a0e[_0x4644('0x5a')],{})[_0x4644('0x21')](function(_0x4b82d0){var _0x4dec68=_0x3f4a0e['user']['get']({'plain':!![]});if(!_0x4dec68)throw new Error(_0x4644('0x5b'));if(_0x4dec68['role']===_0x4644('0x5c')){var _0x4a950b=_0x4b82d0[_0x4644('0x37')]({'plain':!![]});var _0x4161dc=_0x4644('0x38');return db[_0x4644('0x5d')]['find']({'where':{'name':_0x4161dc,'userProfileId':_0x4dec68[_0x4644('0x5e')]},'raw':!![]})[_0x4644('0x21')](function(_0x7139d5){if(_0x7139d5&&_0x7139d5[_0x4644('0x5f')]===0x0){return db[_0x4644('0x39')]['create']({'name':_0x4a950b[_0x4644('0x3c')],'resourceId':_0x4a950b['id'],'type':_0x7139d5[_0x4644('0x3c')],'sectionId':_0x7139d5['id']},{})[_0x4644('0x21')](function(){return _0x4b82d0;});}else{return _0x4b82d0;}})[_0x4644('0x56')](function(_0x59660a){logger[_0x4644('0x27')](_0x4644('0x60'),_0x59660a);throw _0x59660a;});}return _0x4b82d0;})[_0x4644('0x21')](respondWithResult(_0x395675,0xc9))[_0x4644('0x56')](handleError(_0x395675,null));};exports[_0x4644('0x61')]=function(_0x280afb,_0xf965d4){if(_0x280afb[_0x4644('0x5a')]['id']){delete _0x280afb['body']['id'];}return db[_0x4644('0x3e')]['find']({'where':{'id':_0x280afb['params']['id']}})['then'](handleEntityNotFound(_0xf965d4,null))[_0x4644('0x21')](saveUpdates(_0x280afb[_0x4644('0x5a')],null))[_0x4644('0x21')](respondWithResult(_0xf965d4,null))[_0x4644('0x56')](handleError(_0xf965d4,null));};exports['destroy']=function(_0x5937c8,_0x329c84){return db[_0x4644('0x3e')]['find']({'where':{'id':_0x5937c8['params']['id']}})[_0x4644('0x21')](handleEntityNotFound(_0x329c84,null))['then'](removeEntity(_0x329c84,null))['catch'](handleError(_0x329c84,null));};exports['describe']=function(_0x5bc014,_0x2893b0){return db[_0x4644('0x3e')][_0x4644('0x62')]()[_0x4644('0x21')](respondWithResult(_0x2893b0,null))[_0x4644('0x56')](handleError(_0x2893b0,null));};exports[_0x4644('0x63')]=function(_0x62e0ab,_0x5eec0b,_0x5005a0){var _0x503008={'raw':!![],'where':{}},_0x587bd2={},_0x316ff1;return db[_0x4644('0x3e')][_0x4644('0x64')]({'where':{'id':_0x62e0ab['params']['id']}})[_0x4644('0x21')](handleEntityNotFound(_0x5eec0b,null))[_0x4644('0x21')](function(_0x76ba36){if(_0x76ba36){_0x316ff1=_0x76ba36[_0x4644('0x37')]({'plain':!![]});_0x587bd2[_0x4644('0x41')]=_['keys'](db[_0x4644('0x65')][_0x4644('0x3f')]);_0x587bd2['query']=_[_0x4644('0x43')](_0x62e0ab[_0x4644('0x42')]);_0x587bd2[_0x4644('0x4d')]=_[_0x4644('0x44')](_0x587bd2[_0x4644('0x41')],_0x587bd2[_0x4644('0x42')]);_0x503008[_0x4644('0x46')]=_['intersection'](_0x587bd2[_0x4644('0x41')],qs[_0x4644('0x45')](_0x62e0ab[_0x4644('0x42')]['fields']));_0x503008[_0x4644('0x46')]=_0x503008[_0x4644('0x46')][_0x4644('0x47')]?_0x503008[_0x4644('0x46')]:_0x587bd2[_0x4644('0x41')];if(!_0x62e0ab[_0x4644('0x42')][_0x4644('0x48')](_0x4644('0x49'))){_0x503008[_0x4644('0x31')]=qs[_0x4644('0x31')](_0x62e0ab[_0x4644('0x42')][_0x4644('0x31')]);_0x503008[_0x4644('0x2e')]=qs[_0x4644('0x2e')](_0x62e0ab['query'][_0x4644('0x2e')]);}_0x503008['order']=qs[_0x4644('0x4b')](_0x62e0ab['query']['sort']);_0x503008[_0x4644('0x4c')]=qs[_0x4644('0x4d')](_[_0x4644('0x4e')](_0x62e0ab[_0x4644('0x42')],_0x587bd2[_0x4644('0x4d')]));_0x503008['where']['ChatQueueId']=_0x76ba36['id'];if(_0x62e0ab[_0x4644('0x42')][_0x4644('0x4f')]){_0x503008[_0x4644('0x4c')]=_[_0x4644('0x50')](_0x503008['where'],{'$or':_['map'](_0x503008[_0x4644('0x46')],function(_0x10108a){var _0x3ac694={};_0x3ac694[_0x10108a]={'$like':'%'+_0x62e0ab[_0x4644('0x42')][_0x4644('0x4f')]+'%'};return _0x3ac694;})});}_0x503008=_[_0x4644('0x50')]({},_0x503008,_0x62e0ab[_0x4644('0x52')]);return db['UserChatQueue'][_0x4644('0x54')](_0x503008);}})[_0x4644('0x21')](function(_0x204aeb){if(_0x204aeb){return db[_0x4644('0x66')][_0x4644('0x67')]({'where':{'id':_[_0x4644('0x3d')](_0x204aeb,_0x4644('0x68')),'role':_0x4644('0x69')},'attributes':['id',_0x4644('0x3c'),_0x4644('0x6a'),'updatedAt',_0x4644('0x6b')]});}})[_0x4644('0x21')](function(_0x54bb67){if(_0x54bb67){return{'count':_0x54bb67[_0x4644('0x30')],'rows':_[_0x4644('0x3d')](_0x54bb67['rows'],function(_0x483133){return{'membername':_0x483133[_0x4644('0x3c')],'UserId':_0x483133['id'],'queue_name':_0x316ff1['name'],'ChatQueueId':_0x316ff1['id'],'interface':util['format'](_0x4644('0x6c'),_0x4644('0x6d'),_0x483133[_0x4644('0x3c')]),'penalty':0x0,'paused':_0x483133[_0x4644('0x6a')],'createdAt':_0x483133[_0x4644('0x6b')],'updatedAt':_0x483133['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4644('0x21')](respondWithFilteredResult(_0x5eec0b,_0x503008))[_0x4644('0x56')](handleError(_0x5eec0b,null));};exports[_0x4644('0x6e')]=function(_0x18a793,_0xe9cdc1,_0x5d8551){var _0x59294d={};var _0x3cf457={};var _0x377f51;var _0x2ddd89;return db[_0x4644('0x3e')][_0x4644('0x64')]({'where':{'id':_0x18a793[_0x4644('0x58')]['id']}})['then'](handleEntityNotFound(_0xe9cdc1,null))[_0x4644('0x21')](function(_0x51bd98){if(_0x51bd98){_0x377f51=_0x51bd98;_0x3cf457['model']=_[_0x4644('0x43')](db[_0x4644('0x6f')][_0x4644('0x3f')]);_0x3cf457['query']=_[_0x4644('0x43')](_0x18a793[_0x4644('0x42')]);_0x3cf457[_0x4644('0x4d')]=_[_0x4644('0x44')](_0x3cf457[_0x4644('0x41')],_0x3cf457[_0x4644('0x42')]);_0x59294d['attributes']=_[_0x4644('0x44')](_0x3cf457['model'],qs[_0x4644('0x45')](_0x18a793[_0x4644('0x42')][_0x4644('0x45')]));_0x59294d['attributes']=_0x59294d['attributes'][_0x4644('0x47')]?_0x59294d[_0x4644('0x46')]:_0x3cf457[_0x4644('0x41')];_0x59294d['order']=qs['sort'](_0x18a793[_0x4644('0x42')]['sort']);_0x59294d[_0x4644('0x4c')]=qs[_0x4644('0x4d')](_[_0x4644('0x4e')](_0x18a793['query'],_0x3cf457[_0x4644('0x4d')]));if(_0x18a793['query']['filter']){_0x59294d[_0x4644('0x4c')]=_['merge'](_0x59294d[_0x4644('0x4c')],{'$or':_[_0x4644('0x3d')](_0x59294d[_0x4644('0x46')],function(_0x5e5144){var _0x1490f4={};_0x1490f4[_0x5e5144]={'$like':'%'+_0x18a793[_0x4644('0x42')][_0x4644('0x4f')]+'%'};return _0x1490f4;})});}_0x59294d=_[_0x4644('0x50')]({},_0x59294d,_0x18a793[_0x4644('0x52')]);return _0x377f51[_0x4644('0x6e')](_0x59294d);}})[_0x4644('0x21')](function(_0x6a3d35){if(_0x6a3d35){_0x2ddd89=_0x6a3d35[_0x4644('0x47')];if(!_0x18a793[_0x4644('0x42')][_0x4644('0x48')]('nolimit')){_0x59294d[_0x4644('0x31')]=qs['limit'](_0x18a793[_0x4644('0x42')]['limit']);_0x59294d[_0x4644('0x2e')]=qs[_0x4644('0x2e')](_0x18a793[_0x4644('0x42')][_0x4644('0x2e')]);}return _0x377f51[_0x4644('0x6e')](_0x59294d);}})[_0x4644('0x21')](function(_0x432168){if(_0x432168){return _0x432168?{'count':_0x2ddd89,'rows':_0x432168}:null;}})[_0x4644('0x21')](respondWithResult(_0xe9cdc1,null))[_0x4644('0x56')](handleError(_0xe9cdc1,null));};exports['addTeams']=function(_0x141c79,_0x39ea0e,_0x1730cd){var _0x35d0e1=_0x141c79['body'][_0x4644('0x70')];return db[_0x4644('0x6f')]['findAll']({'where':{'id':_0x35d0e1},'attributes':['id'],'include':[{'model':db[_0x4644('0x66')],'as':_0x4644('0x71'),'attributes':['id',_0x4644('0x3c'),_0x4644('0x72'),_0x4644('0x73'),'interface'],'raw':!![]}]})['then'](function(_0x508999){if(_0x508999){var _0x5a534f=_[_0x4644('0x74')](_0x508999,function(_0x12745c){var _0x2c64df=_0x12745c[_0x4644('0x37')]({'plain':!![]});return _0x2c64df[_0x4644('0x71')];});return db[_0x4644('0x3e')][_0x4644('0x59')]({'where':{'id':_0x141c79[_0x4644('0x58')]['id']}})[_0x4644('0x21')](function(_0xd4ab43){return db[_0x4644('0x75')][_0x4644('0x76')](function(_0x5afa19){return _0xd4ab43[_0x4644('0x77')](_0x35d0e1,{'transaction':_0x5afa19})[_0x4644('0x21')](function(){return BPromise['each'](_0x5a534f,function(_0x29dff6){return db[_0x4644('0x65')][_0x4644('0x78')]({'where':{'UserId':_0x29dff6['id'],'ChatQueueId':_0x141c79[_0x4644('0x58')]['id']},'transaction':_0x5afa19});});})[_0x4644('0x21')](function(){_0x5a534f[_0x4644('0x79')](function(_0xcedbb3){socket[_0x4644('0x7a')](_0x4644('0x7b'),{'UserId':_0xcedbb3['id'],'ChatQueueId':_0xd4ab43['id']});});});});});}})[_0x4644('0x21')](respondWithStatusCode(_0x39ea0e,null))['catch'](handleError(_0x39ea0e,null));};exports['removeTeams']=function(_0x30c565,_0x3983da,_0xdbfaa0){return db[_0x4644('0x6f')][_0x4644('0x54')]({'where':{'id':_0x30c565[_0x4644('0x42')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4644('0x66')],'as':_0x4644('0x71'),'attributes':['id'],'raw':!![]}]})[_0x4644('0x21')](handleEntityNotFound(_0x3983da,null))['then'](function(_0x2ce008){var _0x5ad129=_[_0x4644('0x3d')](_0x2ce008,'id');var _0x3fd0d6=[];var _0x17e04d=[];var _0x297d21=squel[_0x4644('0x7c')]();_0x297d21['field'](_0x4644('0x7d'))[_0x4644('0x7e')]('team_has_chat_queues','tq')[_0x4644('0x7f')](_0x4644('0x80'),'ut',_0x4644('0x81'))[_0x4644('0x4c')](_0x4644('0x82'),_0x30c565[_0x4644('0x58')]['id']);for(var _0x4bdf51=0x0;_0x4bdf51<_0x2ce008[_0x4644('0x47')];_0x4bdf51+=0x1){let _0x26149d=_0x2ce008[_0x4bdf51];for(var _0x4dfe33=0x0;_0x4dfe33<_0x26149d[_0x4644('0x71')][_0x4644('0x47')];_0x4dfe33+=0x1){let _0x406779=_0x26149d[_0x4644('0x71')][_0x4dfe33];var _0x48e56d=_0x297d21[_0x4644('0x83')]();_0x48e56d[_0x4644('0x4c')]('ut.UserId\x20=\x20?',_0x406779['id']);_0x17e04d[_0x4644('0x84')](db[_0x4644('0x75')][_0x4644('0x42')](_0x48e56d['toString'](),{'type':db[_0x4644('0x75')][_0x4644('0x85')][_0x4644('0x86')]})[_0x4644('0x21')](function(_0x11a683){if(_0x11a683[_0x4644('0x47')]===0x1){return _0x406779['id'];}else{var _0x32057e=_[_0x4644('0x87')](_[_0x4644('0x3d')](_0x11a683,_0x4644('0x88')),function(_0x221473){return _[_0x4644('0x89')](_0x5ad129,_0x221473);});if(_0x32057e){return _0x406779['id'];}}}));}}return BPromise['all'](_0x17e04d)[_0x4644('0x21')](function(_0x27cd3b){_0x3fd0d6=_(_0x3fd0d6)[_0x4644('0x8a')](_0x27cd3b)[_0x4644('0x8b')]()[_0x4644('0x8c')]();return db[_0x4644('0x3e')][_0x4644('0x59')]({'where':{'id':_0x30c565[_0x4644('0x58')]['id']}})['then'](function(_0x21bfab){return db['sequelize'][_0x4644('0x76')](function(_0x5f0608){return _0x21bfab[_0x4644('0x8d')](_0x30c565[_0x4644('0x42')][_0x4644('0x70')],{'transaction':_0x5f0608})[_0x4644('0x21')](function(){if(!_[_0x4644('0x8e')](_0x3fd0d6)){return _0x21bfab[_0x4644('0x8f')](_0x3fd0d6,{'transaction':_0x5f0608});}})[_0x4644('0x21')](function(){_0x3fd0d6['forEach'](function(_0x5280d3){socket[_0x4644('0x7a')](_0x4644('0x90'),{'UserId':_0x5280d3,'ChatQueueId':_0x21bfab['id']});});});});});});})['then'](respondWithStatusCode(_0x3983da,null))[_0x4644('0x56')](handleError(_0x3983da,null));};exports['addAgents']=function(_0x335d42,_0x10eea2,_0x34d451){return db[_0x4644('0x3e')][_0x4644('0x59')]({'where':{'id':_0x335d42[_0x4644('0x58')]['id']}})[_0x4644('0x21')](handleEntityNotFound(_0x10eea2,null))[_0x4644('0x21')](function(_0x1bb52e){if(_0x1bb52e){return _0x1bb52e['addAgents'](_0x335d42[_0x4644('0x5a')][_0x4644('0x70')],_[_0x4644('0x91')](_0x335d42['body'],[_0x4644('0x70'),'id'])||{})['spread'](function(_0x5d28bc){for(var _0xe14dcf=0x0;_0xe14dcf<_0x335d42[_0x4644('0x5a')]['ids'][_0x4644('0x47')];_0xe14dcf+=0x1){socket[_0x4644('0x7a')](_0x4644('0x7b'),{'UserId':Number(_0x335d42['body'][_0x4644('0x70')][_0xe14dcf]),'ChatQueueId':Number(_0x335d42[_0x4644('0x58')]['id'])});}return _0x5d28bc;});}})[_0x4644('0x21')](respondWithResult(_0x10eea2,null))[_0x4644('0x56')](handleError(_0x10eea2,null));};exports[_0x4644('0x8f')]=function(_0x161310,_0x28b021,_0x53414d){return db[_0x4644('0x3e')][_0x4644('0x59')]({'where':{'id':_0x161310[_0x4644('0x58')]['id']}})[_0x4644('0x21')](handleEntityNotFound(_0x28b021,null))[_0x4644('0x21')](function(_0x581ce0){if(_0x581ce0){return _0x581ce0[_0x4644('0x8f')](_0x161310[_0x4644('0x42')][_0x4644('0x70')])['then'](function(){if(_['isArray'](_0x161310[_0x4644('0x42')][_0x4644('0x70')])){for(var _0x2afaa7=0x0;_0x2afaa7<_0x161310[_0x4644('0x42')][_0x4644('0x70')][_0x4644('0x47')];_0x2afaa7+=0x1){socket[_0x4644('0x7a')](_0x4644('0x90'),{'UserId':Number(_0x161310[_0x4644('0x42')][_0x4644('0x70')][_0x2afaa7]),'ChatQueueId':Number(_0x161310[_0x4644('0x58')]['id'])});}}else{socket['emit'](_0x4644('0x90'),{'UserId':Number(_0x161310[_0x4644('0x42')][_0x4644('0x70')]),'ChatQueueId':Number(_0x161310[_0x4644('0x58')]['id'])});}});}})[_0x4644('0x21')](respondWithStatusCode(_0x28b021,null))[_0x4644('0x56')](handleError(_0x28b021,null));};exports[_0x4644('0x92')]=function(_0x263c8e,_0x3f621d,_0x2c12ea){var _0x1eae81={};var _0xb6ffe3={};var _0x1afa32;var _0x5c5c63;return db[_0x4644('0x3e')][_0x4644('0x64')]({'where':{'id':_0x263c8e[_0x4644('0x58')]['id']}})[_0x4644('0x21')](handleEntityNotFound(_0x3f621d,null))[_0x4644('0x21')](function(_0x11ce2d){if(_0x11ce2d){_0x1afa32=_0x11ce2d;_0xb6ffe3[_0x4644('0x41')]=_[_0x4644('0x43')](db['User']['rawAttributes']);_0xb6ffe3[_0x4644('0x42')]=_[_0x4644('0x43')](_0x263c8e['query']);_0xb6ffe3[_0x4644('0x4d')]=_[_0x4644('0x44')](_0xb6ffe3['model'],_0xb6ffe3[_0x4644('0x42')]);_0x1eae81[_0x4644('0x46')]=_['intersection'](_0xb6ffe3[_0x4644('0x41')],qs[_0x4644('0x45')](_0x263c8e[_0x4644('0x42')][_0x4644('0x45')]));_0x1eae81[_0x4644('0x46')]=_0x1eae81[_0x4644('0x46')]['length']?_0x1eae81[_0x4644('0x46')]:_0xb6ffe3['model'];_0x1eae81['order']=qs[_0x4644('0x4b')](_0x263c8e[_0x4644('0x42')]['sort']);_0x1eae81[_0x4644('0x4c')]=qs['filters'](_['pick'](_0x263c8e[_0x4644('0x42')],_0xb6ffe3[_0x4644('0x4d')]));if(_0x263c8e[_0x4644('0x42')][_0x4644('0x4f')]){_0x1eae81[_0x4644('0x4c')]=_[_0x4644('0x50')](_0x1eae81[_0x4644('0x4c')],{'$or':_[_0x4644('0x3d')](_0x1eae81['attributes'],function(_0xe49b0c){var _0x44714c={};_0x44714c[_0xe49b0c]={'$like':'%'+_0x263c8e[_0x4644('0x42')][_0x4644('0x4f')]+'%'};return _0x44714c;})});}_0x1eae81=_['merge']({},_0x1eae81,_0x263c8e[_0x4644('0x52')]);return _0x1afa32['getAgents'](_0x1eae81);}})[_0x4644('0x21')](function(_0x154d40){if(_0x154d40){_0x5c5c63=_0x154d40[_0x4644('0x47')];if(!_0x263c8e[_0x4644('0x42')][_0x4644('0x48')]('nolimit')){_0x1eae81['limit']=qs['limit'](_0x263c8e[_0x4644('0x42')]['limit']);_0x1eae81['offset']=qs[_0x4644('0x2e')](_0x263c8e[_0x4644('0x42')]['offset']);}return _0x1afa32[_0x4644('0x92')](_0x1eae81);}})[_0x4644('0x21')](function(_0x249c35){if(_0x249c35){return _0x249c35?{'count':_0x5c5c63,'rows':_0x249c35}:null;}})['then'](respondWithResult(_0x3f621d,null))[_0x4644('0x56')](handleError(_0x3f621d,null));}; \ No newline at end of file +var _0x33ca=['rows','%s/%s','SIP','getTeams','Team','addTeams','online','voicePause','interface','flatMap','Agents','each','forEach','emit','removeTeams','ids','field','team_has_chat_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','userChatQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','order','sort','where','filter','merge','options','includeAll','include','ChatQueue','findAll','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','getMembers','findOne','hasOwnProperty','nolimit','pick','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x33ca,0x1da));var _0xa33c=function(_0x21fe98,_0x429019){_0x21fe98=_0x21fe98-0x0;var _0x49e2eb=_0x33ca[_0x21fe98];return _0x49e2eb;};'use strict';var emlformat=require(_0xa33c('0x0'));var rimraf=require(_0xa33c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa33c('0x2'));var rp=require('request-promise');var moment=require(_0xa33c('0x3'));var BPromise=require(_0xa33c('0x4'));var Mustache=require(_0xa33c('0x5'));var util=require('util');var path=require(_0xa33c('0x6'));var sox=require(_0xa33c('0x7'));var csv=require('to-csv');var ejs=require(_0xa33c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa33c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa33c('0xa'));var toCsv=require(_0xa33c('0xb'));var querystring=require('querystring');var Papa=require(_0xa33c('0xc'));var Redis=require(_0xa33c('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa33c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa33c('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xa33c('0x10'));var db=require(_0xa33c('0x11'))['db'];config[_0xa33c('0x12')]=_[_0xa33c('0x13')](config['redis'],{'host':_0xa33c('0x14'),'port':0x18eb});var socket=require(_0xa33c('0x15'))(new Redis(config['redis']));require(_0xa33c('0x16'))[_0xa33c('0x17')](socket);var jayson=require(_0xa33c('0x18'));var client=jayson[_0xa33c('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb32700,_0x4e4ec7,_0x1ef121,_0x2120ed){return new BPromise(function(_0x2a9fa6,_0xc9371d){var _0x1a0313=_0x2120ed||client;return _0x1a0313[_0xa33c('0x1a')](_0xb32700,_0x1ef121)[_0xa33c('0x1b')](function(_0x2ca48b){logger['info'](_0xa33c('0x1c'),_0x4e4ec7,_0xa33c('0x1d'));logger[_0xa33c('0x1e')](_0xa33c('0x1f'),_0x4e4ec7,_0xa33c('0x1d'),JSON[_0xa33c('0x20')](_0x2ca48b));if(_0x2ca48b[_0xa33c('0x21')]){if(_0x2ca48b[_0xa33c('0x21')][_0xa33c('0x22')]===0x1f4){logger[_0xa33c('0x21')](_0xa33c('0x1c'),_0x4e4ec7,_0x2ca48b[_0xa33c('0x21')][_0xa33c('0x23')]);return _0xc9371d(_0x2ca48b[_0xa33c('0x21')][_0xa33c('0x23')]);}logger[_0xa33c('0x21')](_0xa33c('0x1c'),_0x4e4ec7,_0x2ca48b[_0xa33c('0x21')][_0xa33c('0x23')]);return _0x2a9fa6(_0x2ca48b[_0xa33c('0x21')][_0xa33c('0x23')]);}else{logger[_0xa33c('0x24')](_0xa33c('0x1c'),_0x4e4ec7,_0xa33c('0x1d'));_0x2a9fa6(_0x2ca48b['result']['message']);}})[_0xa33c('0x25')](function(_0x4d45c4){logger[_0xa33c('0x21')]('ChatQueue,\x20%s,\x20%s',_0x4e4ec7,_0x4d45c4);_0xc9371d(_0x4d45c4);});});}function respondWithStatusCode(_0x2f50a1,_0x5d3560){_0x5d3560=_0x5d3560||0xcc;return function(_0x4a9d96){if(_0x4a9d96){return _0x2f50a1[_0xa33c('0x26')](_0x5d3560);}return _0x2f50a1['status'](_0x5d3560)[_0xa33c('0x27')]();};}function respondWithResult(_0x2ee26b,_0x34ebf4){_0x34ebf4=_0x34ebf4||0xc8;return function(_0x213833){if(_0x213833){return _0x2ee26b['status'](_0x34ebf4)[_0xa33c('0x28')](_0x213833);}};}function respondWithFilteredResult(_0x22ad54,_0x542ffd){return function(_0x3369e8){if(_0x3369e8){var _0x7b60fb=typeof _0x542ffd[_0xa33c('0x29')]===_0xa33c('0x2a')&&typeof _0x542ffd[_0xa33c('0x2b')]===_0xa33c('0x2a');var _0x2d1601=_0x3369e8[_0xa33c('0x2c')];var _0x3de634=_0x7b60fb?0x0:_0x542ffd[_0xa33c('0x29')];var _0x126b5d=_0x7b60fb?_0x3369e8[_0xa33c('0x2c')]:_0x542ffd[_0xa33c('0x29')]+_0x542ffd[_0xa33c('0x2b')];var _0xc41c32;if(_0x126b5d>=_0x2d1601){_0x126b5d=_0x2d1601;_0xc41c32=0xc8;}else{_0xc41c32=0xce;}_0x22ad54[_0xa33c('0x2d')](_0xc41c32);return _0x22ad54[_0xa33c('0x2e')](_0xa33c('0x2f'),_0x3de634+'-'+_0x126b5d+'/'+_0x2d1601)[_0xa33c('0x28')](_0x3369e8);}return null;};}function patchUpdates(_0x2e4463){return function(_0x3b805a){try{jsonpatch['apply'](_0x3b805a,_0x2e4463,!![]);}catch(_0x31e4e5){return BPromise[_0xa33c('0x30')](_0x31e4e5);}return _0x3b805a[_0xa33c('0x31')]();};}function saveUpdates(_0x45e55c,_0x435d40){return function(_0x3070fc){if(_0x3070fc){return _0x3070fc[_0xa33c('0x32')](_0x45e55c)[_0xa33c('0x1b')](function(_0x46f658){return _0x46f658;});}return null;};}function removeEntity(_0x3bf9d6,_0x53b799){return function(_0x4b844c){if(_0x4b844c){return _0x4b844c[_0xa33c('0x33')]()[_0xa33c('0x1b')](function(){var _0xc0ee50=_0x4b844c[_0xa33c('0x34')]({'plain':!![]});var _0x3c9f2b=_0xa33c('0x35');return db[_0xa33c('0x36')][_0xa33c('0x33')]({'where':{'type':_0x3c9f2b,'resourceId':_0xc0ee50['id']}})['then'](function(){return _0x4b844c;});})[_0xa33c('0x1b')](function(){_0x3bf9d6[_0xa33c('0x2d')](0xcc)[_0xa33c('0x27')]();});}};}function handleEntityNotFound(_0x289be6,_0x13574f){return function(_0x3b3513){if(!_0x3b3513){_0x289be6[_0xa33c('0x26')](0x194);}return _0x3b3513;};}function handleError(_0x25a886,_0x3e082b){_0x3e082b=_0x3e082b||0x1f4;return function(_0x3218d5){logger[_0xa33c('0x21')](_0x3218d5[_0xa33c('0x37')]);if(_0x3218d5[_0xa33c('0x38')]){delete _0x3218d5[_0xa33c('0x38')];}_0x25a886[_0xa33c('0x2d')](_0x3e082b)[_0xa33c('0x39')](_0x3218d5);};}exports[_0xa33c('0x3a')]=function(_0x5d05a9,_0x3b9c2a){var _0x31e30c={},_0x544276={},_0x3c6b96={'count':0x0,'rows':[]};var _0x59b943=_[_0xa33c('0x3b')](db['ChatQueue'][_0xa33c('0x3c')],function(_0xfde6a9){return{'name':_0xfde6a9[_0xa33c('0x3d')],'type':_0xfde6a9[_0xa33c('0x3e')][_0xa33c('0x3f')]};});_0x544276['model']=_['map'](_0x59b943,_0xa33c('0x38'));_0x544276['query']=_['keys'](_0x5d05a9[_0xa33c('0x40')]);_0x544276[_0xa33c('0x41')]=_[_0xa33c('0x42')](_0x544276[_0xa33c('0x43')],_0x544276[_0xa33c('0x40')]);_0x31e30c[_0xa33c('0x44')]=_['intersection'](_0x544276[_0xa33c('0x43')],qs[_0xa33c('0x45')](_0x5d05a9[_0xa33c('0x40')][_0xa33c('0x45')]));_0x31e30c[_0xa33c('0x44')]=_0x31e30c[_0xa33c('0x44')][_0xa33c('0x46')]?_0x31e30c[_0xa33c('0x44')]:_0x544276[_0xa33c('0x43')];if(!_0x5d05a9[_0xa33c('0x40')]['hasOwnProperty']('nolimit')){_0x31e30c[_0xa33c('0x2b')]=qs[_0xa33c('0x2b')](_0x5d05a9[_0xa33c('0x40')][_0xa33c('0x2b')]);_0x31e30c[_0xa33c('0x29')]=qs[_0xa33c('0x29')](_0x5d05a9[_0xa33c('0x40')][_0xa33c('0x29')]);}_0x31e30c[_0xa33c('0x47')]=qs['sort'](_0x5d05a9[_0xa33c('0x40')][_0xa33c('0x48')]);_0x31e30c[_0xa33c('0x49')]=qs[_0xa33c('0x41')](_['pick'](_0x5d05a9['query'],_0x544276[_0xa33c('0x41')]),_0x59b943);if(_0x5d05a9[_0xa33c('0x40')][_0xa33c('0x4a')]){_0x31e30c[_0xa33c('0x49')]=_['merge'](_0x31e30c[_0xa33c('0x49')],{'$or':_['map'](_0x59b943,function(_0x1a7785){if(_0x1a7785['type']!=='VIRTUAL'){var _0x451e37={};_0x451e37[_0x1a7785[_0xa33c('0x38')]]={'$like':'%'+_0x5d05a9[_0xa33c('0x40')][_0xa33c('0x4a')]+'%'};return _0x451e37;}})});}_0x31e30c=_[_0xa33c('0x4b')]({},_0x31e30c,_0x5d05a9[_0xa33c('0x4c')]);var _0x2cf4ae={'where':_0x31e30c[_0xa33c('0x49')]};return db['ChatQueue'][_0xa33c('0x2c')](_0x2cf4ae)[_0xa33c('0x1b')](function(_0x3da99c){_0x3c6b96[_0xa33c('0x2c')]=_0x3da99c;if(_0x5d05a9[_0xa33c('0x40')][_0xa33c('0x4d')]){_0x31e30c[_0xa33c('0x4e')]=[{'all':!![]}];}return db[_0xa33c('0x4f')][_0xa33c('0x50')](_0x31e30c);})[_0xa33c('0x1b')](function(_0x3162a5){_0x3c6b96['rows']=_0x3162a5;return _0x3c6b96;})[_0xa33c('0x1b')](respondWithFilteredResult(_0x3b9c2a,_0x31e30c))['catch'](handleError(_0x3b9c2a,null));};exports[_0xa33c('0x51')]=function(_0x808cfb,_0x1886c1){var _0x595647={'raw':!![],'where':{'id':_0x808cfb[_0xa33c('0x52')]['id']}},_0x186063={};_0x186063[_0xa33c('0x43')]=_[_0xa33c('0x53')](db[_0xa33c('0x4f')][_0xa33c('0x3c')]);_0x186063['query']=_['keys'](_0x808cfb[_0xa33c('0x40')]);_0x186063[_0xa33c('0x41')]=_[_0xa33c('0x42')](_0x186063[_0xa33c('0x43')],_0x186063[_0xa33c('0x40')]);_0x595647['attributes']=_[_0xa33c('0x42')](_0x186063['model'],qs['fields'](_0x808cfb[_0xa33c('0x40')][_0xa33c('0x45')]));_0x595647['attributes']=_0x595647[_0xa33c('0x44')][_0xa33c('0x46')]?_0x595647['attributes']:_0x186063['model'];if(_0x808cfb[_0xa33c('0x40')][_0xa33c('0x4d')]){_0x595647[_0xa33c('0x4e')]=[{'all':!![]}];}_0x595647=_[_0xa33c('0x4b')]({},_0x595647,_0x808cfb['options']);return db[_0xa33c('0x4f')][_0xa33c('0x54')](_0x595647)[_0xa33c('0x1b')](handleEntityNotFound(_0x1886c1,null))[_0xa33c('0x1b')](respondWithResult(_0x1886c1,null))[_0xa33c('0x25')](handleError(_0x1886c1,null));};exports[_0xa33c('0x55')]=function(_0x237dd3,_0x35b8b8){return db[_0xa33c('0x4f')][_0xa33c('0x55')](_0x237dd3[_0xa33c('0x56')],{})[_0xa33c('0x1b')](function(_0x3643f0){var _0x13abc5=_0x237dd3[_0xa33c('0x57')][_0xa33c('0x34')]({'plain':!![]});if(!_0x13abc5)throw new Error(_0xa33c('0x58'));if(_0x13abc5[_0xa33c('0x59')]===_0xa33c('0x57')){var _0x3fbe4f=_0x3643f0['get']({'plain':!![]});var _0x34b1e5=_0xa33c('0x35');return db[_0xa33c('0x5a')][_0xa33c('0x54')]({'where':{'name':_0x34b1e5,'userProfileId':_0x13abc5[_0xa33c('0x5b')]},'raw':!![]})[_0xa33c('0x1b')](function(_0x17ce73){if(_0x17ce73&&_0x17ce73['autoAssociation']===0x0){return db[_0xa33c('0x36')]['create']({'name':_0x3fbe4f[_0xa33c('0x38')],'resourceId':_0x3fbe4f['id'],'type':_0x17ce73[_0xa33c('0x38')],'sectionId':_0x17ce73['id']},{})[_0xa33c('0x1b')](function(){return _0x3643f0;});}else{return _0x3643f0;}})[_0xa33c('0x25')](function(_0x462680){logger[_0xa33c('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x462680);throw _0x462680;});}return _0x3643f0;})[_0xa33c('0x1b')](respondWithResult(_0x35b8b8,0xc9))[_0xa33c('0x25')](handleError(_0x35b8b8,null));};exports[_0xa33c('0x32')]=function(_0x87599b,_0x51dfe3){if(_0x87599b['body']['id']){delete _0x87599b[_0xa33c('0x56')]['id'];}return db[_0xa33c('0x4f')][_0xa33c('0x54')]({'where':{'id':_0x87599b[_0xa33c('0x52')]['id']}})['then'](handleEntityNotFound(_0x51dfe3,null))['then'](saveUpdates(_0x87599b[_0xa33c('0x56')],null))[_0xa33c('0x1b')](respondWithResult(_0x51dfe3,null))[_0xa33c('0x25')](handleError(_0x51dfe3,null));};exports[_0xa33c('0x33')]=function(_0x338fe9,_0x5d6ce1){return db[_0xa33c('0x4f')]['find']({'where':{'id':_0x338fe9['params']['id']}})['then'](handleEntityNotFound(_0x5d6ce1,null))['then'](removeEntity(_0x5d6ce1,null))[_0xa33c('0x25')](handleError(_0x5d6ce1,null));};exports[_0xa33c('0x5c')]=function(_0xacace0,_0xdaca6a){return db[_0xa33c('0x4f')][_0xa33c('0x5c')]()['then'](respondWithResult(_0xdaca6a,null))[_0xa33c('0x25')](handleError(_0xdaca6a,null));};exports[_0xa33c('0x5d')]=function(_0x51ead2,_0x24867f,_0x5327d7){var _0x13634f={'raw':!![],'where':{}},_0xb8631c={},_0x1b7633;return db['ChatQueue'][_0xa33c('0x5e')]({'where':{'id':_0x51ead2['params']['id']}})[_0xa33c('0x1b')](handleEntityNotFound(_0x24867f,null))[_0xa33c('0x1b')](function(_0x5961b0){if(_0x5961b0){_0x1b7633=_0x5961b0[_0xa33c('0x34')]({'plain':!![]});_0xb8631c[_0xa33c('0x43')]=_['keys'](db['UserChatQueue'][_0xa33c('0x3c')]);_0xb8631c[_0xa33c('0x40')]=_[_0xa33c('0x53')](_0x51ead2['query']);_0xb8631c['filters']=_[_0xa33c('0x42')](_0xb8631c[_0xa33c('0x43')],_0xb8631c[_0xa33c('0x40')]);_0x13634f['attributes']=_[_0xa33c('0x42')](_0xb8631c[_0xa33c('0x43')],qs['fields'](_0x51ead2[_0xa33c('0x40')]['fields']));_0x13634f[_0xa33c('0x44')]=_0x13634f[_0xa33c('0x44')]['length']?_0x13634f[_0xa33c('0x44')]:_0xb8631c['model'];if(!_0x51ead2[_0xa33c('0x40')][_0xa33c('0x5f')](_0xa33c('0x60'))){_0x13634f[_0xa33c('0x2b')]=qs['limit'](_0x51ead2[_0xa33c('0x40')]['limit']);_0x13634f['offset']=qs[_0xa33c('0x29')](_0x51ead2[_0xa33c('0x40')][_0xa33c('0x29')]);}_0x13634f[_0xa33c('0x47')]=qs[_0xa33c('0x48')](_0x51ead2[_0xa33c('0x40')][_0xa33c('0x48')]);_0x13634f[_0xa33c('0x49')]=qs[_0xa33c('0x41')](_[_0xa33c('0x61')](_0x51ead2[_0xa33c('0x40')],_0xb8631c[_0xa33c('0x41')]));_0x13634f[_0xa33c('0x49')][_0xa33c('0x62')]=_0x5961b0['id'];if(_0x51ead2[_0xa33c('0x40')][_0xa33c('0x4a')]){_0x13634f[_0xa33c('0x49')]=_['merge'](_0x13634f[_0xa33c('0x49')],{'$or':_[_0xa33c('0x3b')](_0x13634f[_0xa33c('0x44')],function(_0x2410e8){var _0x2900a3={};_0x2900a3[_0x2410e8]={'$like':'%'+_0x51ead2[_0xa33c('0x40')][_0xa33c('0x4a')]+'%'};return _0x2900a3;})});}_0x13634f=_[_0xa33c('0x4b')]({},_0x13634f,_0x51ead2[_0xa33c('0x4c')]);return db['UserChatQueue'][_0xa33c('0x50')](_0x13634f);}})['then'](function(_0x39584c){if(_0x39584c){return db[_0xa33c('0x63')][_0xa33c('0x64')]({'where':{'id':_[_0xa33c('0x3b')](_0x39584c,_0xa33c('0x65')),'role':_0xa33c('0x66')},'attributes':['id',_0xa33c('0x38'),_0xa33c('0x67'),_0xa33c('0x68'),_0xa33c('0x69')]});}})['then'](function(_0x52ba05){if(_0x52ba05){return{'count':_0x52ba05[_0xa33c('0x2c')],'rows':_[_0xa33c('0x3b')](_0x52ba05[_0xa33c('0x6a')],function(_0x154652){return{'membername':_0x154652[_0xa33c('0x38')],'UserId':_0x154652['id'],'queue_name':_0x1b7633[_0xa33c('0x38')],'ChatQueueId':_0x1b7633['id'],'interface':util['format'](_0xa33c('0x6b'),_0xa33c('0x6c'),_0x154652[_0xa33c('0x38')]),'penalty':0x0,'paused':_0x154652['chatPause'],'createdAt':_0x154652['createdAt'],'updatedAt':_0x154652['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x24867f,_0x13634f))['catch'](handleError(_0x24867f,null));};exports[_0xa33c('0x6d')]=function(_0xf5d6c8,_0x289642,_0x442bf2){var _0x4ac5aa={};var _0x289519={};var _0x15b2c1;var _0x5e7ba0;return db[_0xa33c('0x4f')][_0xa33c('0x5e')]({'where':{'id':_0xf5d6c8[_0xa33c('0x52')]['id']}})[_0xa33c('0x1b')](handleEntityNotFound(_0x289642,null))[_0xa33c('0x1b')](function(_0x12b695){if(_0x12b695){_0x15b2c1=_0x12b695;_0x289519['model']=_[_0xa33c('0x53')](db[_0xa33c('0x6e')]['rawAttributes']);_0x289519[_0xa33c('0x40')]=_['keys'](_0xf5d6c8[_0xa33c('0x40')]);_0x289519[_0xa33c('0x41')]=_['intersection'](_0x289519[_0xa33c('0x43')],_0x289519[_0xa33c('0x40')]);_0x4ac5aa[_0xa33c('0x44')]=_['intersection'](_0x289519[_0xa33c('0x43')],qs[_0xa33c('0x45')](_0xf5d6c8['query'][_0xa33c('0x45')]));_0x4ac5aa[_0xa33c('0x44')]=_0x4ac5aa[_0xa33c('0x44')][_0xa33c('0x46')]?_0x4ac5aa[_0xa33c('0x44')]:_0x289519[_0xa33c('0x43')];_0x4ac5aa['order']=qs[_0xa33c('0x48')](_0xf5d6c8[_0xa33c('0x40')][_0xa33c('0x48')]);_0x4ac5aa[_0xa33c('0x49')]=qs[_0xa33c('0x41')](_[_0xa33c('0x61')](_0xf5d6c8[_0xa33c('0x40')],_0x289519['filters']));if(_0xf5d6c8[_0xa33c('0x40')]['filter']){_0x4ac5aa[_0xa33c('0x49')]=_['merge'](_0x4ac5aa['where'],{'$or':_['map'](_0x4ac5aa[_0xa33c('0x44')],function(_0x3e26f5){var _0x5c05db={};_0x5c05db[_0x3e26f5]={'$like':'%'+_0xf5d6c8['query']['filter']+'%'};return _0x5c05db;})});}_0x4ac5aa=_[_0xa33c('0x4b')]({},_0x4ac5aa,_0xf5d6c8['options']);return _0x15b2c1[_0xa33c('0x6d')](_0x4ac5aa);}})[_0xa33c('0x1b')](function(_0x1ea5b0){if(_0x1ea5b0){_0x5e7ba0=_0x1ea5b0[_0xa33c('0x46')];if(!_0xf5d6c8[_0xa33c('0x40')][_0xa33c('0x5f')](_0xa33c('0x60'))){_0x4ac5aa['limit']=qs[_0xa33c('0x2b')](_0xf5d6c8[_0xa33c('0x40')][_0xa33c('0x2b')]);_0x4ac5aa['offset']=qs[_0xa33c('0x29')](_0xf5d6c8['query'][_0xa33c('0x29')]);}return _0x15b2c1[_0xa33c('0x6d')](_0x4ac5aa);}})['then'](function(_0xf366e3){if(_0xf366e3){return _0xf366e3?{'count':_0x5e7ba0,'rows':_0xf366e3}:null;}})[_0xa33c('0x1b')](respondWithResult(_0x289642,null))[_0xa33c('0x25')](handleError(_0x289642,null));};exports[_0xa33c('0x6f')]=function(_0x9b0951,_0x5c71fb,_0x481e3d){var _0x49f387=_0x9b0951[_0xa33c('0x56')]['ids'];return db['Team'][_0xa33c('0x50')]({'where':{'id':_0x49f387},'attributes':['id'],'include':[{'model':db[_0xa33c('0x63')],'as':'Agents','attributes':['id','name',_0xa33c('0x70'),_0xa33c('0x71'),_0xa33c('0x72')],'raw':!![]}]})['then'](function(_0x2daaaf){if(_0x2daaaf){var _0x24c435=_[_0xa33c('0x73')](_0x2daaaf,function(_0x46b0cc){var _0x31b929=_0x46b0cc[_0xa33c('0x34')]({'plain':!![]});return _0x31b929[_0xa33c('0x74')];});return db['ChatQueue'][_0xa33c('0x54')]({'where':{'id':_0x9b0951['params']['id']}})['then'](function(_0x4070e8){return db['sequelize']['transaction'](function(_0x5653ba){return _0x4070e8[_0xa33c('0x6f')](_0x49f387,{'transaction':_0x5653ba})['then'](function(){return BPromise[_0xa33c('0x75')](_0x24c435,function(_0xcaa2bd){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0xcaa2bd['id'],'ChatQueueId':_0x9b0951[_0xa33c('0x52')]['id']},'transaction':_0x5653ba});});})[_0xa33c('0x1b')](function(){_0x24c435[_0xa33c('0x76')](function(_0x4250a0){socket[_0xa33c('0x77')]('userChatQueue:save',{'UserId':_0x4250a0['id'],'ChatQueueId':_0x4070e8['id']});});});});});}})[_0xa33c('0x1b')](respondWithStatusCode(_0x5c71fb,null))['catch'](handleError(_0x5c71fb,null));};exports[_0xa33c('0x78')]=function(_0xb30779,_0x549dcb,_0x1636f0){return db[_0xa33c('0x6e')][_0xa33c('0x50')]({'where':{'id':_0xb30779[_0xa33c('0x40')][_0xa33c('0x79')]},'attributes':['id'],'include':[{'model':db[_0xa33c('0x63')],'as':_0xa33c('0x74'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x549dcb,null))['then'](function(_0xf4802b){var _0x7de84b=_[_0xa33c('0x3b')](_0xf4802b,'id');var _0x2a7f6a=[];var _0x5a348c=[];var _0x1725ad=squel['select']();_0x1725ad[_0xa33c('0x7a')]('tq.TeamId')['from'](_0xa33c('0x7b'),'tq')[_0xa33c('0x7c')](_0xa33c('0x7d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa33c('0x49')]('ChatQueueId\x20=\x20?',_0xb30779[_0xa33c('0x52')]['id']);for(var _0x2311fe=0x0;_0x2311fe<_0xf4802b[_0xa33c('0x46')];_0x2311fe+=0x1){let _0x2c428a=_0xf4802b[_0x2311fe];for(var _0x1c27b5=0x0;_0x1c27b5<_0x2c428a[_0xa33c('0x74')][_0xa33c('0x46')];_0x1c27b5+=0x1){let _0x3ee5df=_0x2c428a[_0xa33c('0x74')][_0x1c27b5];var _0x32fafc=_0x1725ad[_0xa33c('0x7e')]();_0x32fafc['where'](_0xa33c('0x7f'),_0x3ee5df['id']);_0x5a348c[_0xa33c('0x80')](db[_0xa33c('0x81')][_0xa33c('0x40')](_0x32fafc[_0xa33c('0x82')](),{'type':db[_0xa33c('0x81')][_0xa33c('0x83')][_0xa33c('0x84')]})[_0xa33c('0x1b')](function(_0x360043){if(_0x360043[_0xa33c('0x46')]===0x1){return _0x3ee5df['id'];}else{var _0x347f37=_['every'](_[_0xa33c('0x3b')](_0x360043,_0xa33c('0x85')),function(_0x3fb7b1){return _[_0xa33c('0x86')](_0x7de84b,_0x3fb7b1);});if(_0x347f37){return _0x3ee5df['id'];}}}));}}return BPromise[_0xa33c('0x87')](_0x5a348c)[_0xa33c('0x1b')](function(_0x3435df){_0x2a7f6a=_(_0x2a7f6a)['union'](_0x3435df)[_0xa33c('0x88')]()[_0xa33c('0x89')]();return db['ChatQueue'][_0xa33c('0x54')]({'where':{'id':_0xb30779[_0xa33c('0x52')]['id']}})[_0xa33c('0x1b')](function(_0x14575c){return db[_0xa33c('0x81')]['transaction'](function(_0x6029ad){return _0x14575c['removeTeams'](_0xb30779[_0xa33c('0x40')]['ids'],{'transaction':_0x6029ad})['then'](function(){if(!_['isEmpty'](_0x2a7f6a)){return _0x14575c[_0xa33c('0x8a')](_0x2a7f6a,{'transaction':_0x6029ad});}})[_0xa33c('0x1b')](function(){_0x2a7f6a[_0xa33c('0x76')](function(_0x5b98c0){socket[_0xa33c('0x77')](_0xa33c('0x8b'),{'UserId':_0x5b98c0,'ChatQueueId':_0x14575c['id']});});});});});});})[_0xa33c('0x1b')](respondWithStatusCode(_0x549dcb,null))[_0xa33c('0x25')](handleError(_0x549dcb,null));};exports['addAgents']=function(_0x4df6ca,_0x51a707,_0x2c315b){return db[_0xa33c('0x4f')][_0xa33c('0x54')]({'where':{'id':_0x4df6ca[_0xa33c('0x52')]['id']}})[_0xa33c('0x1b')](handleEntityNotFound(_0x51a707,null))[_0xa33c('0x1b')](function(_0x15f00b){if(_0x15f00b){return _0x15f00b[_0xa33c('0x8c')](_0x4df6ca[_0xa33c('0x56')]['ids'],_[_0xa33c('0x8d')](_0x4df6ca['body'],['ids','id'])||{})['spread'](function(_0xfd300a){for(var _0x34631a=0x0;_0x34631a<_0x4df6ca[_0xa33c('0x56')][_0xa33c('0x79')]['length'];_0x34631a+=0x1){socket[_0xa33c('0x77')](_0xa33c('0x8e'),{'UserId':Number(_0x4df6ca[_0xa33c('0x56')][_0xa33c('0x79')][_0x34631a]),'ChatQueueId':Number(_0x4df6ca['params']['id'])});}return _0xfd300a;});}})['then'](respondWithResult(_0x51a707,null))[_0xa33c('0x25')](handleError(_0x51a707,null));};exports[_0xa33c('0x8a')]=function(_0x4cff4c,_0x4fd316,_0x2541b4){return db[_0xa33c('0x4f')][_0xa33c('0x54')]({'where':{'id':_0x4cff4c['params']['id']}})[_0xa33c('0x1b')](handleEntityNotFound(_0x4fd316,null))[_0xa33c('0x1b')](function(_0x2c9c31){if(_0x2c9c31){return _0x2c9c31[_0xa33c('0x8a')](_0x4cff4c[_0xa33c('0x40')][_0xa33c('0x79')])[_0xa33c('0x1b')](function(){if(_[_0xa33c('0x8f')](_0x4cff4c['query']['ids'])){for(var _0x1b5dc1=0x0;_0x1b5dc1<_0x4cff4c[_0xa33c('0x40')][_0xa33c('0x79')]['length'];_0x1b5dc1+=0x1){socket[_0xa33c('0x77')](_0xa33c('0x8b'),{'UserId':Number(_0x4cff4c[_0xa33c('0x40')][_0xa33c('0x79')][_0x1b5dc1]),'ChatQueueId':Number(_0x4cff4c[_0xa33c('0x52')]['id'])});}}else{socket[_0xa33c('0x77')](_0xa33c('0x8b'),{'UserId':Number(_0x4cff4c[_0xa33c('0x40')][_0xa33c('0x79')]),'ChatQueueId':Number(_0x4cff4c[_0xa33c('0x52')]['id'])});}});}})[_0xa33c('0x1b')](respondWithStatusCode(_0x4fd316,null))[_0xa33c('0x25')](handleError(_0x4fd316,null));};exports[_0xa33c('0x90')]=function(_0x3c4d5f,_0x21bbc6,_0x58d316){var _0x32f6f5={};var _0x283f28={};var _0xf19fcd;var _0x412d0d;return db['ChatQueue'][_0xa33c('0x5e')]({'where':{'id':_0x3c4d5f[_0xa33c('0x52')]['id']}})[_0xa33c('0x1b')](handleEntityNotFound(_0x21bbc6,null))[_0xa33c('0x1b')](function(_0x49de3a){if(_0x49de3a){_0xf19fcd=_0x49de3a;_0x283f28['model']=_[_0xa33c('0x53')](db[_0xa33c('0x63')][_0xa33c('0x3c')]);_0x283f28[_0xa33c('0x40')]=_[_0xa33c('0x53')](_0x3c4d5f[_0xa33c('0x40')]);_0x283f28['filters']=_[_0xa33c('0x42')](_0x283f28[_0xa33c('0x43')],_0x283f28[_0xa33c('0x40')]);_0x32f6f5[_0xa33c('0x44')]=_[_0xa33c('0x42')](_0x283f28[_0xa33c('0x43')],qs[_0xa33c('0x45')](_0x3c4d5f[_0xa33c('0x40')]['fields']));_0x32f6f5[_0xa33c('0x44')]=_0x32f6f5[_0xa33c('0x44')][_0xa33c('0x46')]?_0x32f6f5[_0xa33c('0x44')]:_0x283f28['model'];_0x32f6f5[_0xa33c('0x47')]=qs[_0xa33c('0x48')](_0x3c4d5f['query'][_0xa33c('0x48')]);_0x32f6f5[_0xa33c('0x49')]=qs[_0xa33c('0x41')](_[_0xa33c('0x61')](_0x3c4d5f[_0xa33c('0x40')],_0x283f28[_0xa33c('0x41')]));if(_0x3c4d5f['query'][_0xa33c('0x4a')]){_0x32f6f5[_0xa33c('0x49')]=_[_0xa33c('0x4b')](_0x32f6f5[_0xa33c('0x49')],{'$or':_[_0xa33c('0x3b')](_0x32f6f5[_0xa33c('0x44')],function(_0xcae3ca){var _0x205f57={};_0x205f57[_0xcae3ca]={'$like':'%'+_0x3c4d5f[_0xa33c('0x40')]['filter']+'%'};return _0x205f57;})});}_0x32f6f5=_['merge']({},_0x32f6f5,_0x3c4d5f[_0xa33c('0x4c')]);return _0xf19fcd['getAgents'](_0x32f6f5);}})[_0xa33c('0x1b')](function(_0x1c2ad9){if(_0x1c2ad9){_0x412d0d=_0x1c2ad9[_0xa33c('0x46')];if(!_0x3c4d5f[_0xa33c('0x40')][_0xa33c('0x5f')](_0xa33c('0x60'))){_0x32f6f5['limit']=qs[_0xa33c('0x2b')](_0x3c4d5f[_0xa33c('0x40')][_0xa33c('0x2b')]);_0x32f6f5['offset']=qs[_0xa33c('0x29')](_0x3c4d5f[_0xa33c('0x40')][_0xa33c('0x29')]);}return _0xf19fcd['getAgents'](_0x32f6f5);}})['then'](function(_0x37a9d0){if(_0x37a9d0){return _0x37a9d0?{'count':_0x412d0d,'rows':_0x37a9d0}:null;}})[_0xa33c('0x1b')](respondWithResult(_0x21bbc6,null))[_0xa33c('0x25')](handleError(_0x21bbc6,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index ee0f7be..47f99f3 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 _0x32f6=['remove','hook','exports','ChatQueue','setMaxListeners','update'];(function(_0x4ec58c,_0x3daded){var _0x398af2=function(_0x5292b4){while(--_0x5292b4){_0x4ec58c['push'](_0x4ec58c['shift']());}};_0x398af2(++_0x3daded);}(_0x32f6,0xbd));var _0x632f=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x32f6[_0x5a776b];return _0xbbef59;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x632f('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x632f('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x632f('0x2'),'afterDestroy':_0x632f('0x3')};function emitEvent(_0x1079f2){return function(_0x3b5c4a,_0x272348,_0x53a747){ChatQueueEvents['emit'](_0x1079f2+':'+_0x3b5c4a['id'],_0x3b5c4a);ChatQueueEvents['emit'](_0x1079f2,_0x3b5c4a);_0x53a747(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x632f('0x4')](e,emitEvent(event));}}module[_0x632f('0x5')]=ChatQueueEvents; \ No newline at end of file +var _0x0dc1=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue'];(function(_0x5ca784,_0x28bea2){var _0x5aa579=function(_0x531234){while(--_0x531234){_0x5ca784['push'](_0x5ca784['shift']());}};_0x5aa579(++_0x28bea2);}(_0x0dc1,0x198));var _0x10dc=function(_0x35c094,_0x3bb7d3){_0x35c094=_0x35c094-0x0;var _0x2aa0bb=_0x0dc1[_0x35c094];return _0x2aa0bb;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x10dc('0x0'))['db'][_0x10dc('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x10dc('0x2')](0x0);var events={'afterCreate':_0x10dc('0x3'),'afterUpdate':_0x10dc('0x4'),'afterDestroy':_0x10dc('0x5')};function emitEvent(_0x403a78){return function(_0x2a4c4c,_0xc7fae1,_0x5d4cbd){ChatQueueEvents['emit'](_0x403a78+':'+_0x2a4c4c['id'],_0x2a4c4c);ChatQueueEvents[_0x10dc('0x6')](_0x403a78,_0x2a4c4c);_0x5d4cbd(null);};}for(var e in events){if(events[_0x10dc('0x7')](e)){var event=events[e];ChatQueue[_0x10dc('0x8')](e,emitEvent(event));}}module[_0x10dc('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index ef81666..9d70ecb 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 _0xd94c=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash'];(function(_0x319cb9,_0x4b8d35){var _0x1735fc=function(_0x43b061){while(--_0x43b061){_0x319cb9['push'](_0x319cb9['shift']());}};_0x1735fc(++_0x4b8d35);}(_0xd94c,0x151));var _0xcd94=function(_0x57d53b,_0x4b0c2f){_0x57d53b=_0x57d53b-0x0;var _0x13a2df=_0xd94c[_0x57d53b];return _0x13a2df;};'use strict';var _=require(_0xcd94('0x0'));var util=require(_0xcd94('0x1'));var logger=require('../../config/logger')(_0xcd94('0x2'));var moment=require(_0xcd94('0x3'));var BPromise=require(_0xcd94('0x4'));var rp=require(_0xcd94('0x5'));var fs=require('fs');var path=require(_0xcd94('0x6'));var rimraf=require(_0xcd94('0x7'));var config=require(_0xcd94('0x8'));var attributes=require('./chatQueue.attributes');module[_0xcd94('0x9')]=function(_0x5a3a4d,_0x582a6f){return _0x5a3a4d[_0xcd94('0xa')](_0xcd94('0xb'),attributes,{'tableName':_0xcd94('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0604=['path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','moment','bluebird','request-promise'];(function(_0x337a13,_0x39554e){var _0x21fbd8=function(_0x30e5cf){while(--_0x30e5cf){_0x337a13['push'](_0x337a13['shift']());}};_0x21fbd8(++_0x39554e);}(_0x0604,0xd8));var _0x4060=function(_0xaf8756,_0x3bf6b6){_0xaf8756=_0xaf8756-0x0;var _0x122c5f=_0x0604[_0xaf8756];return _0x122c5f;};'use strict';var _=require(_0x4060('0x0'));var util=require(_0x4060('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4060('0x2'));var BPromise=require(_0x4060('0x3'));var rp=require(_0x4060('0x4'));var fs=require('fs');var path=require(_0x4060('0x5'));var rimraf=require(_0x4060('0x6'));var config=require(_0x4060('0x7'));var attributes=require(_0x4060('0x8'));module[_0x4060('0x9')]=function(_0x4193fe,_0x3863a2){return _0x4193fe[_0x4060('0xa')](_0x4060('0xb'),attributes,{'tableName':_0x4060('0xc'),'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 2a5d20e..2f0ac49 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 _0xa664=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','util','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0xf4666e,_0x571140){var _0x1853f1=function(_0x5160a5){while(--_0x5160a5){_0xf4666e['push'](_0xf4666e['shift']());}};_0x1853f1(++_0x571140);}(_0xa664,0x132));var _0x4a66=function(_0x125919,_0x2c5909){_0x125919=_0x125919-0x0;var _0x22f531=_0xa664[_0x125919];return _0x22f531;};'use strict';var _=require('lodash');var util=require(_0x4a66('0x0'));var moment=require(_0x4a66('0x1'));var BPromise=require(_0x4a66('0x2'));var rs=require(_0x4a66('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a66('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4a66('0x5'));var config=require(_0x4a66('0x6'));var jayson=require(_0x4a66('0x7'));var client=jayson[_0x4a66('0x8')][_0x4a66('0x9')]({'port':0x232a});config[_0x4a66('0xa')]=_[_0x4a66('0xb')](config['redis'],{'host':_0x4a66('0xc'),'port':0x18eb});var socket=require(_0x4a66('0xd'))(new Redis(config[_0x4a66('0xa')]));require(_0x4a66('0xe'))['register'](socket);function respondWithRpcPromise(_0x1f553d,_0x124ed0,_0x5b7ccd){return new BPromise(function(_0x11b0b7,_0x33430f){return client[_0x4a66('0xf')](_0x1f553d,_0x5b7ccd)[_0x4a66('0x10')](function(_0x2bebf3){logger[_0x4a66('0x11')](_0x4a66('0x12'),_0x124ed0,_0x4a66('0x13'));logger[_0x4a66('0x14')](_0x4a66('0x15'),_0x124ed0,_0x4a66('0x13'),JSON[_0x4a66('0x16')](_0x2bebf3));if(_0x2bebf3[_0x4a66('0x17')]){if(_0x2bebf3[_0x4a66('0x17')][_0x4a66('0x18')]===0x1f4){logger[_0x4a66('0x17')](_0x4a66('0x12'),_0x124ed0,_0x2bebf3['error'][_0x4a66('0x19')]);return _0x33430f(_0x2bebf3[_0x4a66('0x17')][_0x4a66('0x19')]);}logger[_0x4a66('0x17')](_0x4a66('0x12'),_0x124ed0,_0x2bebf3[_0x4a66('0x17')][_0x4a66('0x19')]);return _0x11b0b7(_0x2bebf3[_0x4a66('0x17')]['message']);}else{logger[_0x4a66('0x11')](_0x4a66('0x12'),_0x124ed0,_0x4a66('0x13'));_0x11b0b7(_0x2bebf3[_0x4a66('0x1a')]['message']);}})[_0x4a66('0x1b')](function(_0x398374){logger[_0x4a66('0x17')]('ChatQueue,\x20%s,\x20%s',_0x124ed0,_0x398374);_0x33430f(_0x398374);});});}exports['GetChatQueue']=function(_0x1e01b8){var _0x83a690=this;return new Promise(function(_0x25fb2c,_0x4c78e1){return db['ChatQueue'][_0x4a66('0x1c')]({'raw':_0x1e01b8[_0x4a66('0x1d')]?_0x1e01b8[_0x4a66('0x1d')][_0x4a66('0x1e')]===undefined?!![]:![]:!![],'where':_0x1e01b8[_0x4a66('0x1d')]?_0x1e01b8[_0x4a66('0x1d')][_0x4a66('0x1f')]||null:null,'attributes':_0x1e01b8[_0x4a66('0x1d')]?_0x1e01b8[_0x4a66('0x1d')][_0x4a66('0x20')]||null:null,'limit':_0x1e01b8[_0x4a66('0x1d')]?_0x1e01b8[_0x4a66('0x1d')][_0x4a66('0x21')]||null:null,'include':_0x1e01b8[_0x4a66('0x1d')]?_0x1e01b8[_0x4a66('0x1d')][_0x4a66('0x22')]?_[_0x4a66('0x23')](_0x1e01b8['options'][_0x4a66('0x22')],function(_0x4d58c){return{'model':db[_0x4d58c['model']],'as':_0x4d58c['as'],'attributes':_0x4d58c[_0x4a66('0x20')],'include':_0x4d58c[_0x4a66('0x22')]?_[_0x4a66('0x23')](_0x4d58c[_0x4a66('0x22')],function(_0x3260d4){return{'model':db[_0x3260d4['model']],'as':_0x3260d4['as'],'attributes':_0x3260d4['attributes'],'include':_0x3260d4[_0x4a66('0x22')]?_[_0x4a66('0x23')](_0x3260d4[_0x4a66('0x22')],function(_0x257485){return{'model':db[_0x257485[_0x4a66('0x24')]],'as':_0x257485['as'],'attributes':_0x257485[_0x4a66('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4a66('0x10')](function(_0x32bd79){logger[_0x4a66('0x11')](_0x4a66('0x25'),_0x1e01b8);logger[_0x4a66('0x14')](_0x4a66('0x25'),_0x1e01b8,JSON['stringify'](_0x32bd79));_0x25fb2c(_0x32bd79);})['catch'](function(_0xc6938d){logger['error'](_0x4a66('0x25'),_0xc6938d[_0x4a66('0x19')],_0x1e01b8);_0x4c78e1(_0x83a690[_0x4a66('0x17')](0x1f4,_0xc6938d[_0x4a66('0x19')]));});});};exports['ShowChatQueue']=function(_0x1fc788){var _0xe56dc=this;return new Promise(function(_0x33e098,_0x2acf4d){return db['ChatQueue']['find']({'raw':_0x1fc788[_0x4a66('0x1d')]?_0x1fc788[_0x4a66('0x1d')][_0x4a66('0x1e')]===undefined?!![]:![]:!![],'where':_0x1fc788[_0x4a66('0x1d')]?_0x1fc788[_0x4a66('0x1d')][_0x4a66('0x1f')]||null:null,'attributes':_0x1fc788[_0x4a66('0x1d')]?_0x1fc788[_0x4a66('0x1d')][_0x4a66('0x20')]||null:null,'include':_0x1fc788[_0x4a66('0x1d')]?_0x1fc788['options']['include']?_['map'](_0x1fc788[_0x4a66('0x1d')][_0x4a66('0x22')],function(_0x46177a){return{'model':db[_0x46177a[_0x4a66('0x24')]],'as':_0x46177a['as'],'attributes':_0x46177a[_0x4a66('0x20')],'include':_0x46177a['include']?_[_0x4a66('0x23')](_0x46177a['include'],function(_0x48de00){return{'model':db[_0x48de00[_0x4a66('0x24')]],'as':_0x48de00['as'],'attributes':_0x48de00[_0x4a66('0x20')],'include':_0x48de00[_0x4a66('0x22')]?_[_0x4a66('0x23')](_0x48de00['include'],function(_0x1ef7ff){return{'model':db[_0x1ef7ff['model']],'as':_0x1ef7ff['as'],'attributes':_0x1ef7ff[_0x4a66('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4a66('0x10')](function(_0x3252c9){logger[_0x4a66('0x11')](_0x4a66('0x26'),_0x1fc788);logger[_0x4a66('0x14')](_0x4a66('0x26'),_0x1fc788,JSON[_0x4a66('0x16')](_0x3252c9));_0x33e098(_0x3252c9);})[_0x4a66('0x1b')](function(_0x3a3703){logger[_0x4a66('0x17')](_0x4a66('0x26'),_0x3a3703[_0x4a66('0x19')],_0x1fc788);_0x2acf4d(_0xe56dc[_0x4a66('0x17')](0x1f4,_0x3a3703[_0x4a66('0x19')]));});});}; \ No newline at end of file +var _0xbf77=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','lodash','util','moment','bluebird'];(function(_0x35daf8,_0x43dd82){var _0x56fd37=function(_0x51bf23){while(--_0x51bf23){_0x35daf8['push'](_0x35daf8['shift']());}};_0x56fd37(++_0x43dd82);}(_0xbf77,0xec));var _0x7bf7=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xbf77[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0x7bf7('0x0'));var util=require(_0x7bf7('0x1'));var moment=require(_0x7bf7('0x2'));var BPromise=require(_0x7bf7('0x3'));var rs=require(_0x7bf7('0x4'));var fs=require('fs');var Redis=require(_0x7bf7('0x5'));var db=require(_0x7bf7('0x6'))['db'];var utils=require(_0x7bf7('0x7'));var logger=require('../../config/logger')(_0x7bf7('0x8'));var config=require(_0x7bf7('0x9'));var jayson=require(_0x7bf7('0xa'));var client=jayson['client'][_0x7bf7('0xb')]({'port':0x232a});config[_0x7bf7('0xc')]=_['defaults'](config[_0x7bf7('0xc')],{'host':_0x7bf7('0xd'),'port':0x18eb});var socket=require(_0x7bf7('0xe'))(new Redis(config[_0x7bf7('0xc')]));require('./chatQueue.socket')[_0x7bf7('0xf')](socket);function respondWithRpcPromise(_0x233c04,_0x310d53,_0x2cd7da){return new BPromise(function(_0x25571e,_0xb1c8b3){return client[_0x7bf7('0x10')](_0x233c04,_0x2cd7da)[_0x7bf7('0x11')](function(_0x35ff14){logger['info'](_0x7bf7('0x12'),_0x310d53,'request\x20sent');logger[_0x7bf7('0x13')](_0x7bf7('0x14'),_0x310d53,'request\x20sent',JSON[_0x7bf7('0x15')](_0x35ff14));if(_0x35ff14[_0x7bf7('0x16')]){if(_0x35ff14[_0x7bf7('0x16')][_0x7bf7('0x17')]===0x1f4){logger[_0x7bf7('0x16')](_0x7bf7('0x12'),_0x310d53,_0x35ff14[_0x7bf7('0x16')][_0x7bf7('0x18')]);return _0xb1c8b3(_0x35ff14[_0x7bf7('0x16')]['message']);}logger[_0x7bf7('0x16')](_0x7bf7('0x12'),_0x310d53,_0x35ff14['error'][_0x7bf7('0x18')]);return _0x25571e(_0x35ff14[_0x7bf7('0x16')][_0x7bf7('0x18')]);}else{logger[_0x7bf7('0x19')](_0x7bf7('0x12'),_0x310d53,_0x7bf7('0x1a'));_0x25571e(_0x35ff14['result'][_0x7bf7('0x18')]);}})[_0x7bf7('0x1b')](function(_0x41fd41){logger[_0x7bf7('0x16')](_0x7bf7('0x12'),_0x310d53,_0x41fd41);_0xb1c8b3(_0x41fd41);});});}exports[_0x7bf7('0x1c')]=function(_0x47057a){var _0x1f75eb=this;return new Promise(function(_0x222b39,_0x4b164a){return db[_0x7bf7('0x1d')][_0x7bf7('0x1e')]({'raw':_0x47057a[_0x7bf7('0x1f')]?_0x47057a[_0x7bf7('0x1f')][_0x7bf7('0x20')]===undefined?!![]:![]:!![],'where':_0x47057a[_0x7bf7('0x1f')]?_0x47057a[_0x7bf7('0x1f')][_0x7bf7('0x21')]||null:null,'attributes':_0x47057a[_0x7bf7('0x1f')]?_0x47057a[_0x7bf7('0x1f')][_0x7bf7('0x22')]||null:null,'limit':_0x47057a[_0x7bf7('0x1f')]?_0x47057a['options'][_0x7bf7('0x23')]||null:null,'include':_0x47057a[_0x7bf7('0x1f')]?_0x47057a[_0x7bf7('0x1f')][_0x7bf7('0x24')]?_[_0x7bf7('0x25')](_0x47057a[_0x7bf7('0x1f')][_0x7bf7('0x24')],function(_0x289282){return{'model':db[_0x289282['model']],'as':_0x289282['as'],'attributes':_0x289282['attributes'],'include':_0x289282[_0x7bf7('0x24')]?_[_0x7bf7('0x25')](_0x289282['include'],function(_0x303d84){return{'model':db[_0x303d84[_0x7bf7('0x26')]],'as':_0x303d84['as'],'attributes':_0x303d84[_0x7bf7('0x22')],'include':_0x303d84[_0x7bf7('0x24')]?_[_0x7bf7('0x25')](_0x303d84['include'],function(_0x4be063){return{'model':db[_0x4be063[_0x7bf7('0x26')]],'as':_0x4be063['as'],'attributes':_0x4be063[_0x7bf7('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7bf7('0x11')](function(_0x288d51){logger[_0x7bf7('0x19')](_0x7bf7('0x1c'),_0x47057a);logger[_0x7bf7('0x13')](_0x7bf7('0x1c'),_0x47057a,JSON[_0x7bf7('0x15')](_0x288d51));_0x222b39(_0x288d51);})[_0x7bf7('0x1b')](function(_0xa332ce){logger[_0x7bf7('0x16')](_0x7bf7('0x1c'),_0xa332ce[_0x7bf7('0x18')],_0x47057a);_0x4b164a(_0x1f75eb['error'](0x1f4,_0xa332ce[_0x7bf7('0x18')]));});});};exports[_0x7bf7('0x27')]=function(_0x59ea7a){var _0x122c8c=this;return new Promise(function(_0x5b10a7,_0x454718){return db['ChatQueue']['find']({'raw':_0x59ea7a[_0x7bf7('0x1f')]?_0x59ea7a[_0x7bf7('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x59ea7a['options']?_0x59ea7a[_0x7bf7('0x1f')][_0x7bf7('0x21')]||null:null,'attributes':_0x59ea7a[_0x7bf7('0x1f')]?_0x59ea7a['options'][_0x7bf7('0x22')]||null:null,'include':_0x59ea7a['options']?_0x59ea7a[_0x7bf7('0x1f')]['include']?_[_0x7bf7('0x25')](_0x59ea7a[_0x7bf7('0x1f')]['include'],function(_0x52c09b){return{'model':db[_0x52c09b['model']],'as':_0x52c09b['as'],'attributes':_0x52c09b[_0x7bf7('0x22')],'include':_0x52c09b[_0x7bf7('0x24')]?_[_0x7bf7('0x25')](_0x52c09b['include'],function(_0x441b0c){return{'model':db[_0x441b0c[_0x7bf7('0x26')]],'as':_0x441b0c['as'],'attributes':_0x441b0c[_0x7bf7('0x22')],'include':_0x441b0c[_0x7bf7('0x24')]?_[_0x7bf7('0x25')](_0x441b0c[_0x7bf7('0x24')],function(_0x258f18){return{'model':db[_0x258f18['model']],'as':_0x258f18['as'],'attributes':_0x258f18['attributes']};}):[]};}):[]};}):[]:[]})[_0x7bf7('0x11')](function(_0x116f8a){logger[_0x7bf7('0x19')](_0x7bf7('0x27'),_0x59ea7a);logger[_0x7bf7('0x13')](_0x7bf7('0x27'),_0x59ea7a,JSON[_0x7bf7('0x15')](_0x116f8a));_0x5b10a7(_0x116f8a);})[_0x7bf7('0x1b')](function(_0x5b1e30){logger[_0x7bf7('0x16')](_0x7bf7('0x27'),_0x5b1e30['message'],_0x59ea7a);_0x454718(_0x122c8c['error'](0x1f4,_0x5b1e30[_0x7bf7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 36da3ad..1b8c2a7 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 _0x303a=['removeListener','register','length','./chatQueue.events','remove','update','emit'];(function(_0x2e9edd,_0x20b98){var _0x5e42a5=function(_0x3bc294){while(--_0x3bc294){_0x2e9edd['push'](_0x2e9edd['shift']());}};_0x5e42a5(++_0x20b98);}(_0x303a,0x1a0));var _0xa303=function(_0x301dab,_0x38050a){_0x301dab=_0x301dab-0x0;var _0x2500a2=_0x303a[_0x301dab];return _0x2500a2;};'use strict';var ChatQueueEvents=require(_0xa303('0x0'));var events=['save',_0xa303('0x1'),_0xa303('0x2')];function createListener(_0x36e548,_0x19d27a){return function(_0x594b49){_0x19d27a[_0xa303('0x3')](_0x36e548,_0x594b49);};}function removeListener(_0x26b47c,_0x38a354){return function(){ChatQueueEvents[_0xa303('0x4')](_0x26b47c,_0x38a354);};}exports[_0xa303('0x5')]=function(_0x1c7ee9){for(var _0x2bc3d7=0x0,_0x3f61f1=events[_0xa303('0x6')];_0x2bc3d7<_0x3f61f1;_0x2bc3d7++){var _0x5d95fd=events[_0x2bc3d7];var _0x51e1ee=createListener('chatQueue:'+_0x5d95fd,_0x1c7ee9);ChatQueueEvents['on'](_0x5d95fd,_0x51e1ee);}}; \ No newline at end of file +var _0xb821=['remove','removeListener','register','length','chatQueue:','save'];(function(_0x3f2f28,_0x3eb88c){var _0xabef6b=function(_0x132e2d){while(--_0x132e2d){_0x3f2f28['push'](_0x3f2f28['shift']());}};_0xabef6b(++_0x3eb88c);}(_0xb821,0xa7));var _0x1b82=function(_0x27aa52,_0x8bba1e){_0x27aa52=_0x27aa52-0x0;var _0x1b5758=_0xb821[_0x27aa52];return _0x1b5758;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x1b82('0x0'),_0x1b82('0x1'),'update'];function createListener(_0x4a4f81,_0xbab478){return function(_0x578a10){_0xbab478['emit'](_0x4a4f81,_0x578a10);};}function removeListener(_0x3b1d14,_0x1403ab){return function(){ChatQueueEvents[_0x1b82('0x2')](_0x3b1d14,_0x1403ab);};}exports[_0x1b82('0x3')]=function(_0x597ca7){for(var _0x3e27c4=0x0,_0x192434=events[_0x1b82('0x4')];_0x3e27c4<_0x192434;_0x3e27c4++){var _0x3632dd=events[_0x3e27c4];var _0x18f45f=createListener(_0x1b82('0x5')+_0x3632dd,_0x597ca7);ChatQueueEvents['on'](_0x3632dd,_0x18f45f);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 8cd0f5d..39c792f 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3db01c,_0x1a1cb9){var _0x50920a=function(_0x40aec7){while(--_0x40aec7){_0x3db01c['push'](_0x3db01c['shift']());}};_0x50920a(++_0x1a1cb9);}(_0x008c,0x188));var _0xc008=function(_0x5219aa,_0x357da6){_0x5219aa=_0x5219aa-0x0;var _0x479261=_0x008c[_0x5219aa];return _0x479261;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x5afcd2,_0x144e3e){_0x5afcd2=_0x5afcd2-0x0;var _0xae54cb=_0x3e74[_0x5afcd2];return _0xae54cb;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 170419a..eaebab5 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 _0xf116=['DATE','moment','exports','STRING'];(function(_0x11f84a,_0x3084a0){var _0x480340=function(_0x1b935c){while(--_0x1b935c){_0x11f84a['push'](_0x11f84a['shift']());}};_0x480340(++_0x3084a0);}(_0xf116,0xad));var _0x6f11=function(_0x5e9d35,_0x382c91){_0x5e9d35=_0x5e9d35-0x0;var _0x3beb2e=_0xf116[_0x5e9d35];return _0x3beb2e;};'use strict';var moment=require(_0x6f11('0x0'));var Sequelize=require('sequelize');module[_0x6f11('0x1')]={'uniqueid':{'type':Sequelize[_0x6f11('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6f11('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6f11('0x3')]},'reason':{'type':Sequelize[_0x6f11('0x2')]}}; \ No newline at end of file +var _0x8342=['sequelize','exports','STRING','DATE','moment'];(function(_0x27f909,_0x5bc69c){var _0x23c0d4=function(_0x2439fa){while(--_0x2439fa){_0x27f909['push'](_0x27f909['shift']());}};_0x23c0d4(++_0x5bc69c);}(_0x8342,0x121));var _0x2834=function(_0x209581,_0x11f596){_0x209581=_0x209581-0x0;var _0x2fed45=_0x8342[_0x209581];return _0x2fed45;};'use strict';var moment=require(_0x2834('0x0'));var Sequelize=require(_0x2834('0x1'));module[_0x2834('0x2')]={'uniqueid':{'type':Sequelize[_0x2834('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2834('0x4')]},'leaveAt':{'type':Sequelize[_0x2834('0x4')]},'acceptAt':{'type':Sequelize[_0x2834('0x4')]},'exitAt':{'type':Sequelize[_0x2834('0x4')]},'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 9c0623a..42c87eb 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 _0xaac4=['ChatQueueReport','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','includeAll','create','body','update','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','apply','save','then','destroy','error','name','send','index'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xaac4,0x6c));var _0x4aac=function(_0x3d5e72,_0x3ab167){_0x3d5e72=_0x3d5e72-0x0;var _0x2230e4=_0xaac4[_0x3d5e72];return _0x2230e4;};'use strict';var emlformat=require(_0x4aac('0x0'));var rimraf=require(_0x4aac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4aac('0x2'));var rp=require(_0x4aac('0x3'));var moment=require(_0x4aac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4aac('0x5'));var util=require(_0x4aac('0x6'));var path=require(_0x4aac('0x7'));var sox=require(_0x4aac('0x8'));var csv=require(_0x4aac('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4aac('0xa'));var _=require(_0x4aac('0xb'));var squel=require(_0x4aac('0xc'));var crypto=require('crypto');var jsforce=require(_0x4aac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4aac('0x9'));var querystring=require(_0x4aac('0xe'));var Papa=require(_0x4aac('0xf'));var Redis=require(_0x4aac('0x10'));var authService=require(_0x4aac('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4aac('0x12'));var hardwareService=require(_0x4aac('0x13'));var logger=require(_0x4aac('0x14'))(_0x4aac('0x15'));var utils=require('../../config/utils');var config=require(_0x4aac('0x16'));var licenseUtil=require(_0x4aac('0x17'));var db=require(_0x4aac('0x18'))['db'];function respondWithStatusCode(_0xfec6bd,_0x323eb0){_0x323eb0=_0x323eb0||0xcc;return function(_0x30eefc){if(_0x30eefc){return _0xfec6bd[_0x4aac('0x19')](_0x323eb0);}return _0xfec6bd['status'](_0x323eb0)[_0x4aac('0x1a')]();};}function respondWithResult(_0x5b1b27,_0x35469f){_0x35469f=_0x35469f||0xc8;return function(_0x55cbf4){if(_0x55cbf4){return _0x5b1b27[_0x4aac('0x1b')](_0x35469f)['json'](_0x55cbf4);}};}function respondWithFilteredResult(_0x2c58d3,_0x442883){return function(_0x2dca5b){if(_0x2dca5b){var _0x593782=typeof _0x442883[_0x4aac('0x1c')]===_0x4aac('0x1d')&&typeof _0x442883['limit']==='undefined';var _0x5c02c6=_0x2dca5b['count'];var _0x1539fb=_0x593782?0x0:_0x442883[_0x4aac('0x1c')];var _0x44d2a1=_0x593782?_0x2dca5b['count']:_0x442883[_0x4aac('0x1c')]+_0x442883[_0x4aac('0x1e')];var _0x2f751b;if(_0x44d2a1>=_0x5c02c6){_0x44d2a1=_0x5c02c6;_0x2f751b=0xc8;}else{_0x2f751b=0xce;}_0x2c58d3[_0x4aac('0x1b')](_0x2f751b);return _0x2c58d3[_0x4aac('0x1f')](_0x4aac('0x20'),_0x1539fb+'-'+_0x44d2a1+'/'+_0x5c02c6)[_0x4aac('0x21')](_0x2dca5b);}return null;};}function patchUpdates(_0x2c26cc){return function(_0x331226){try{jsonpatch[_0x4aac('0x22')](_0x331226,_0x2c26cc,!![]);}catch(_0x39d457){return BPromise['reject'](_0x39d457);}return _0x331226[_0x4aac('0x23')]();};}function saveUpdates(_0x16eef9,_0x594ef1){return function(_0x192db5){if(_0x192db5){return _0x192db5['update'](_0x16eef9)[_0x4aac('0x24')](function(_0x23fb33){return _0x23fb33;});}return null;};}function removeEntity(_0x34a384,_0x3d4836){return function(_0x1a9cca){if(_0x1a9cca){return _0x1a9cca[_0x4aac('0x25')]()[_0x4aac('0x24')](function(){_0x34a384['status'](0xcc)[_0x4aac('0x1a')]();});}};}function handleEntityNotFound(_0x279c10,_0x431cd9){return function(_0x516261){if(!_0x516261){_0x279c10[_0x4aac('0x19')](0x194);}return _0x516261;};}function handleError(_0x1f135a,_0x1b57ed){_0x1b57ed=_0x1b57ed||0x1f4;return function(_0x18bafe){logger[_0x4aac('0x26')](_0x18bafe['stack']);if(_0x18bafe[_0x4aac('0x27')]){delete _0x18bafe['name'];}_0x1f135a['status'](_0x1b57ed)[_0x4aac('0x28')](_0x18bafe);};}exports[_0x4aac('0x29')]=function(_0x459028,_0x3a1bd3){var _0x37a98b={},_0x5133b8={},_0x2750f3={'count':0x0,'rows':[]};var _0xf7618d=_['map'](db[_0x4aac('0x2a')][_0x4aac('0x2b')],function(_0x59b69f){return{'name':_0x59b69f[_0x4aac('0x2c')],'type':_0x59b69f['type']['key']};});_0x5133b8[_0x4aac('0x2d')]=_[_0x4aac('0x2e')](_0xf7618d,_0x4aac('0x27'));_0x5133b8['query']=_[_0x4aac('0x2f')](_0x459028[_0x4aac('0x30')]);_0x5133b8[_0x4aac('0x31')]=_[_0x4aac('0x32')](_0x5133b8[_0x4aac('0x2d')],_0x5133b8['query']);_0x37a98b[_0x4aac('0x33')]=_[_0x4aac('0x32')](_0x5133b8[_0x4aac('0x2d')],qs[_0x4aac('0x34')](_0x459028['query'][_0x4aac('0x34')]));_0x37a98b[_0x4aac('0x33')]=_0x37a98b['attributes'][_0x4aac('0x35')]?_0x37a98b[_0x4aac('0x33')]:_0x5133b8['model'];if(!_0x459028[_0x4aac('0x30')][_0x4aac('0x36')](_0x4aac('0x37'))){_0x37a98b['limit']=qs['limit'](_0x459028[_0x4aac('0x30')][_0x4aac('0x1e')]);_0x37a98b['offset']=qs[_0x4aac('0x1c')](_0x459028[_0x4aac('0x30')]['offset']);}_0x37a98b[_0x4aac('0x38')]=qs[_0x4aac('0x39')](_0x459028[_0x4aac('0x30')][_0x4aac('0x39')]);_0x37a98b[_0x4aac('0x3a')]=qs[_0x4aac('0x31')](_[_0x4aac('0x3b')](_0x459028[_0x4aac('0x30')],_0x5133b8[_0x4aac('0x31')]),_0xf7618d);if(_0x459028['query'][_0x4aac('0x3c')]){_0x37a98b[_0x4aac('0x3a')]=_[_0x4aac('0x3d')](_0x37a98b['where'],{'$or':_[_0x4aac('0x2e')](_0xf7618d,function(_0x1717c0){if(_0x1717c0[_0x4aac('0x3e')]!==_0x4aac('0x3f')){var _0x2c9a8f={};_0x2c9a8f[_0x1717c0[_0x4aac('0x27')]]={'$like':'%'+_0x459028[_0x4aac('0x30')][_0x4aac('0x3c')]+'%'};return _0x2c9a8f;}})});}_0x37a98b=_[_0x4aac('0x3d')]({},_0x37a98b,_0x459028[_0x4aac('0x40')]);var _0x331514={'where':_0x37a98b['where']};return db[_0x4aac('0x2a')]['count'](_0x331514)[_0x4aac('0x24')](function(_0x1d1435){_0x2750f3['count']=_0x1d1435;if(_0x459028[_0x4aac('0x30')]['includeAll']){_0x37a98b['include']=[{'all':!![]}];}return db[_0x4aac('0x2a')][_0x4aac('0x41')](_0x37a98b);})[_0x4aac('0x24')](function(_0x3d1cd5){_0x2750f3['rows']=_0x3d1cd5;return _0x2750f3;})[_0x4aac('0x24')](respondWithFilteredResult(_0x3a1bd3,_0x37a98b))[_0x4aac('0x42')](handleError(_0x3a1bd3,null));};exports[_0x4aac('0x43')]=function(_0xf84265,_0x44fb73){var _0x354fed={'raw':!![],'where':{'id':_0xf84265[_0x4aac('0x44')]['id']}},_0x5d09f6={};_0x5d09f6['model']=_[_0x4aac('0x2f')](db[_0x4aac('0x2a')][_0x4aac('0x2b')]);_0x5d09f6['query']=_[_0x4aac('0x2f')](_0xf84265[_0x4aac('0x30')]);_0x5d09f6[_0x4aac('0x31')]=_[_0x4aac('0x32')](_0x5d09f6[_0x4aac('0x2d')],_0x5d09f6[_0x4aac('0x30')]);_0x354fed['attributes']=_['intersection'](_0x5d09f6[_0x4aac('0x2d')],qs['fields'](_0xf84265[_0x4aac('0x30')][_0x4aac('0x34')]));_0x354fed[_0x4aac('0x33')]=_0x354fed[_0x4aac('0x33')][_0x4aac('0x35')]?_0x354fed[_0x4aac('0x33')]:_0x5d09f6[_0x4aac('0x2d')];if(_0xf84265[_0x4aac('0x30')][_0x4aac('0x45')]){_0x354fed['include']=[{'all':!![]}];}_0x354fed=_[_0x4aac('0x3d')]({},_0x354fed,_0xf84265[_0x4aac('0x40')]);return db['ChatQueueReport']['find'](_0x354fed)[_0x4aac('0x24')](handleEntityNotFound(_0x44fb73,null))['then'](respondWithResult(_0x44fb73,null))['catch'](handleError(_0x44fb73,null));};exports['create']=function(_0x5191ba,_0x58c47b){return db['ChatQueueReport'][_0x4aac('0x46')](_0x5191ba[_0x4aac('0x47')],{})[_0x4aac('0x24')](respondWithResult(_0x58c47b,0xc9))[_0x4aac('0x42')](handleError(_0x58c47b,null));};exports[_0x4aac('0x48')]=function(_0x2d25f9,_0x74f0ad){if(_0x2d25f9[_0x4aac('0x47')]['id']){delete _0x2d25f9[_0x4aac('0x47')]['id'];}return db[_0x4aac('0x2a')]['find']({'where':{'id':_0x2d25f9[_0x4aac('0x44')]['id']}})[_0x4aac('0x24')](handleEntityNotFound(_0x74f0ad,null))['then'](saveUpdates(_0x2d25f9[_0x4aac('0x47')],null))[_0x4aac('0x24')](respondWithResult(_0x74f0ad,null))[_0x4aac('0x42')](handleError(_0x74f0ad,null));};exports[_0x4aac('0x25')]=function(_0x1b2179,_0x1164de){return db[_0x4aac('0x2a')][_0x4aac('0x49')]({'where':{'id':_0x1b2179[_0x4aac('0x44')]['id']}})[_0x4aac('0x24')](handleEntityNotFound(_0x1164de,null))[_0x4aac('0x24')](removeEntity(_0x1164de,null))[_0x4aac('0x42')](handleError(_0x1164de,null));};exports[_0x4aac('0x4a')]=function(_0x11419b,_0x1d9197){return db['ChatQueueReport'][_0x4aac('0x4a')]()['then'](respondWithResult(_0x1d9197,null))[_0x4aac('0x42')](handleError(_0x1d9197,null));}; \ No newline at end of file +var _0x6dc0=['undefined','limit','count','offset','Content-Range','apply','reject','save','then','name','send','index','map','ChatQueueReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x3e38ca,_0x5dfde2){var _0x5ab127=function(_0x6a7cd1){while(--_0x6a7cd1){_0x3e38ca['push'](_0x3e38ca['shift']());}};_0x5ab127(++_0x5dfde2);}(_0x6dc0,0xb6));var _0x06dc=function(_0x27b77f,_0x381ac8){_0x27b77f=_0x27b77f-0x0;var _0xd790d6=_0x6dc0[_0x27b77f];return _0xd790d6;};'use strict';var emlformat=require(_0x06dc('0x0'));var rimraf=require(_0x06dc('0x1'));var zipdir=require(_0x06dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06dc('0x3'));var moment=require(_0x06dc('0x4'));var BPromise=require(_0x06dc('0x5'));var Mustache=require(_0x06dc('0x6'));var util=require('util');var path=require(_0x06dc('0x7'));var sox=require(_0x06dc('0x8'));var csv=require('to-csv');var ejs=require(_0x06dc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x06dc('0xa'));var squel=require(_0x06dc('0xb'));var crypto=require(_0x06dc('0xc'));var jsforce=require(_0x06dc('0xd'));var deskjs=require(_0x06dc('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x06dc('0xf'));var authService=require(_0x06dc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x06dc('0x11'));var hardwareService=require(_0x06dc('0x12'));var logger=require(_0x06dc('0x13'))(_0x06dc('0x14'));var utils=require('../../config/utils');var config=require(_0x06dc('0x15'));var licenseUtil=require(_0x06dc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x527806,_0x534c07){_0x534c07=_0x534c07||0xcc;return function(_0x4f086f){if(_0x4f086f){return _0x527806[_0x06dc('0x17')](_0x534c07);}return _0x527806['status'](_0x534c07)['end']();};}function respondWithResult(_0x4874ce,_0x196cfd){_0x196cfd=_0x196cfd||0xc8;return function(_0x47753d){if(_0x47753d){return _0x4874ce[_0x06dc('0x18')](_0x196cfd)['json'](_0x47753d);}};}function respondWithFilteredResult(_0x183302,_0x1d92c2){return function(_0x145a07){if(_0x145a07){var _0x3da2c5=typeof _0x1d92c2['offset']===_0x06dc('0x19')&&typeof _0x1d92c2[_0x06dc('0x1a')]===_0x06dc('0x19');var _0x2478b9=_0x145a07[_0x06dc('0x1b')];var _0x51df31=_0x3da2c5?0x0:_0x1d92c2[_0x06dc('0x1c')];var _0x1d6ec8=_0x3da2c5?_0x145a07[_0x06dc('0x1b')]:_0x1d92c2[_0x06dc('0x1c')]+_0x1d92c2[_0x06dc('0x1a')];var _0x152ed2;if(_0x1d6ec8>=_0x2478b9){_0x1d6ec8=_0x2478b9;_0x152ed2=0xc8;}else{_0x152ed2=0xce;}_0x183302['status'](_0x152ed2);return _0x183302['set'](_0x06dc('0x1d'),_0x51df31+'-'+_0x1d6ec8+'/'+_0x2478b9)['json'](_0x145a07);}return null;};}function patchUpdates(_0x21c8c3){return function(_0x5088f3){try{jsonpatch[_0x06dc('0x1e')](_0x5088f3,_0x21c8c3,!![]);}catch(_0x369c60){return BPromise[_0x06dc('0x1f')](_0x369c60);}return _0x5088f3[_0x06dc('0x20')]();};}function saveUpdates(_0x8aaf2,_0x427f39){return function(_0x577284){if(_0x577284){return _0x577284['update'](_0x8aaf2)[_0x06dc('0x21')](function(_0x426260){return _0x426260;});}return null;};}function removeEntity(_0x56c345,_0x95dab2){return function(_0x5eab9b){if(_0x5eab9b){return _0x5eab9b['destroy']()['then'](function(){_0x56c345['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd3e42b,_0x5edc7b){return function(_0xfa043e){if(!_0xfa043e){_0xd3e42b['sendStatus'](0x194);}return _0xfa043e;};}function handleError(_0x52afcf,_0xa85ffc){_0xa85ffc=_0xa85ffc||0x1f4;return function(_0x26bbfe){logger['error'](_0x26bbfe['stack']);if(_0x26bbfe[_0x06dc('0x22')]){delete _0x26bbfe['name'];}_0x52afcf[_0x06dc('0x18')](_0xa85ffc)[_0x06dc('0x23')](_0x26bbfe);};}exports[_0x06dc('0x24')]=function(_0xfd5611,_0x1d98b8){var _0x31f5cd={},_0x164554={},_0x33ff4c={'count':0x0,'rows':[]};var _0x3f0e2d=_[_0x06dc('0x25')](db[_0x06dc('0x26')][_0x06dc('0x27')],function(_0x43e689){return{'name':_0x43e689['fieldName'],'type':_0x43e689['type'][_0x06dc('0x28')]};});_0x164554[_0x06dc('0x29')]=_[_0x06dc('0x25')](_0x3f0e2d,_0x06dc('0x22'));_0x164554[_0x06dc('0x2a')]=_[_0x06dc('0x2b')](_0xfd5611[_0x06dc('0x2a')]);_0x164554[_0x06dc('0x2c')]=_[_0x06dc('0x2d')](_0x164554[_0x06dc('0x29')],_0x164554['query']);_0x31f5cd[_0x06dc('0x2e')]=_[_0x06dc('0x2d')](_0x164554[_0x06dc('0x29')],qs[_0x06dc('0x2f')](_0xfd5611[_0x06dc('0x2a')]['fields']));_0x31f5cd[_0x06dc('0x2e')]=_0x31f5cd[_0x06dc('0x2e')][_0x06dc('0x30')]?_0x31f5cd['attributes']:_0x164554[_0x06dc('0x29')];if(!_0xfd5611[_0x06dc('0x2a')]['hasOwnProperty'](_0x06dc('0x31'))){_0x31f5cd[_0x06dc('0x1a')]=qs['limit'](_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x1a')]);_0x31f5cd[_0x06dc('0x1c')]=qs[_0x06dc('0x1c')](_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x1c')]);}_0x31f5cd[_0x06dc('0x32')]=qs[_0x06dc('0x33')](_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x33')]);_0x31f5cd['where']=qs['filters'](_['pick'](_0xfd5611[_0x06dc('0x2a')],_0x164554[_0x06dc('0x2c')]),_0x3f0e2d);if(_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x34')]){_0x31f5cd['where']=_['merge'](_0x31f5cd[_0x06dc('0x35')],{'$or':_[_0x06dc('0x25')](_0x3f0e2d,function(_0xdc718a){if(_0xdc718a[_0x06dc('0x36')]!==_0x06dc('0x37')){var _0xe65d69={};_0xe65d69[_0xdc718a[_0x06dc('0x22')]]={'$like':'%'+_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x34')]+'%'};return _0xe65d69;}})});}_0x31f5cd=_[_0x06dc('0x38')]({},_0x31f5cd,_0xfd5611[_0x06dc('0x39')]);var _0x11e2f6={'where':_0x31f5cd[_0x06dc('0x35')]};return db[_0x06dc('0x26')][_0x06dc('0x1b')](_0x11e2f6)[_0x06dc('0x21')](function(_0x3e9434){_0x33ff4c[_0x06dc('0x1b')]=_0x3e9434;if(_0xfd5611[_0x06dc('0x2a')][_0x06dc('0x3a')]){_0x31f5cd['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x06dc('0x3b')](_0x31f5cd);})[_0x06dc('0x21')](function(_0x4250fd){_0x33ff4c[_0x06dc('0x3c')]=_0x4250fd;return _0x33ff4c;})[_0x06dc('0x21')](respondWithFilteredResult(_0x1d98b8,_0x31f5cd))['catch'](handleError(_0x1d98b8,null));};exports[_0x06dc('0x3d')]=function(_0x37ec58,_0x64f6f3){var _0x59d4a0={'raw':!![],'where':{'id':_0x37ec58[_0x06dc('0x3e')]['id']}},_0x164684={};_0x164684['model']=_[_0x06dc('0x2b')](db[_0x06dc('0x26')][_0x06dc('0x27')]);_0x164684[_0x06dc('0x2a')]=_['keys'](_0x37ec58['query']);_0x164684[_0x06dc('0x2c')]=_[_0x06dc('0x2d')](_0x164684[_0x06dc('0x29')],_0x164684['query']);_0x59d4a0[_0x06dc('0x2e')]=_[_0x06dc('0x2d')](_0x164684[_0x06dc('0x29')],qs[_0x06dc('0x2f')](_0x37ec58[_0x06dc('0x2a')]['fields']));_0x59d4a0[_0x06dc('0x2e')]=_0x59d4a0['attributes']['length']?_0x59d4a0[_0x06dc('0x2e')]:_0x164684[_0x06dc('0x29')];if(_0x37ec58[_0x06dc('0x2a')][_0x06dc('0x3a')]){_0x59d4a0[_0x06dc('0x3f')]=[{'all':!![]}];}_0x59d4a0=_['merge']({},_0x59d4a0,_0x37ec58[_0x06dc('0x39')]);return db[_0x06dc('0x26')][_0x06dc('0x40')](_0x59d4a0)[_0x06dc('0x21')](handleEntityNotFound(_0x64f6f3,null))[_0x06dc('0x21')](respondWithResult(_0x64f6f3,null))[_0x06dc('0x41')](handleError(_0x64f6f3,null));};exports[_0x06dc('0x42')]=function(_0x6a5800,_0x1081a9){return db[_0x06dc('0x26')][_0x06dc('0x42')](_0x6a5800['body'],{})[_0x06dc('0x21')](respondWithResult(_0x1081a9,0xc9))[_0x06dc('0x41')](handleError(_0x1081a9,null));};exports['update']=function(_0xb9c6a2,_0x39e42a){if(_0xb9c6a2[_0x06dc('0x43')]['id']){delete _0xb9c6a2['body']['id'];}return db[_0x06dc('0x26')][_0x06dc('0x40')]({'where':{'id':_0xb9c6a2['params']['id']}})['then'](handleEntityNotFound(_0x39e42a,null))['then'](saveUpdates(_0xb9c6a2[_0x06dc('0x43')],null))[_0x06dc('0x21')](respondWithResult(_0x39e42a,null))[_0x06dc('0x41')](handleError(_0x39e42a,null));};exports['destroy']=function(_0x5dd2c2,_0x1d759b){return db[_0x06dc('0x26')][_0x06dc('0x40')]({'where':{'id':_0x5dd2c2[_0x06dc('0x3e')]['id']}})[_0x06dc('0x21')](handleEntityNotFound(_0x1d759b,null))['then'](removeEntity(_0x1d759b,null))[_0x06dc('0x41')](handleError(_0x1d759b,null));};exports[_0x06dc('0x44')]=function(_0x445aae,_0x5c911f){return db[_0x06dc('0x26')][_0x06dc('0x44')]()[_0x06dc('0x21')](respondWithResult(_0x5c911f,null))[_0x06dc('0x41')](handleError(_0x5c911f,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 9be8308..643cd44 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x13cd99,_0x50bd8d){var _0x1d42c7=function(_0x1fa433){while(--_0x1fa433){_0x13cd99['push'](_0x13cd99['shift']());}};_0x1d42c7(++_0x50bd8d);}(_0xe706,0xa3));var _0x6e70=function(_0x3ad62c,_0x465700){_0x3ad62c=_0x3ad62c-0x0;var _0x18e4f3=_0xe706[_0x3ad62c];return _0x18e4f3;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x296809,_0x1c9665){var _0x18c0d3=function(_0x249156){while(--_0x249156){_0x296809['push'](_0x296809['shift']());}};_0x18c0d3(++_0x1c9665);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 37d2653..57a9613 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 _0x7c87=['attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','update','body','where'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x7c87,0x1a1));var _0x77c8=function(_0x13efb3,_0x26996a){_0x13efb3=_0x13efb3-0x0;var _0x30f0d8=_0x7c87[_0x13efb3];return _0x30f0d8;};'use strict';var _=require(_0x77c8('0x0'));var util=require(_0x77c8('0x1'));var moment=require(_0x77c8('0x2'));var BPromise=require(_0x77c8('0x3'));var rs=require(_0x77c8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77c8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77c8('0x6'))(_0x77c8('0x7'));var config=require(_0x77c8('0x8'));var jayson=require(_0x77c8('0x9'));var client=jayson['client'][_0x77c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33faf9,_0x1fbc8f,_0x418ac5){return new BPromise(function(_0xeffe90,_0x45b13b){return client[_0x77c8('0xb')](_0x33faf9,_0x418ac5)[_0x77c8('0xc')](function(_0x5561aa){logger[_0x77c8('0xd')](_0x77c8('0xe'),_0x1fbc8f,_0x77c8('0xf'));logger[_0x77c8('0x10')](_0x77c8('0x11'),_0x1fbc8f,_0x77c8('0xf'),JSON[_0x77c8('0x12')](_0x5561aa));if(_0x5561aa[_0x77c8('0x13')]){if(_0x5561aa[_0x77c8('0x13')]['code']===0x1f4){logger[_0x77c8('0x13')](_0x77c8('0xe'),_0x1fbc8f,_0x5561aa[_0x77c8('0x13')][_0x77c8('0x14')]);return _0x45b13b(_0x5561aa['error'][_0x77c8('0x14')]);}logger['error'](_0x77c8('0xe'),_0x1fbc8f,_0x5561aa[_0x77c8('0x13')]['message']);return _0xeffe90(_0x5561aa[_0x77c8('0x13')][_0x77c8('0x14')]);}else{logger[_0x77c8('0xd')](_0x77c8('0xe'),_0x1fbc8f,_0x77c8('0xf'));_0xeffe90(_0x5561aa['result']['message']);}})[_0x77c8('0x15')](function(_0xc39f04){logger['error'](_0x77c8('0xe'),_0x1fbc8f,_0xc39f04);_0x45b13b(_0xc39f04);});});}exports[_0x77c8('0x16')]=function(_0x4412aa){var _0x546630=this;return new Promise(function(_0x5d5b9a,_0x5e8ed8){return db[_0x77c8('0x17')][_0x77c8('0x18')](_0x4412aa['body'],{'raw':_0x4412aa[_0x77c8('0x19')]?_0x4412aa[_0x77c8('0x19')][_0x77c8('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xba1577){logger[_0x77c8('0xd')](_0x77c8('0x16'),_0x4412aa);logger['debug'](_0x77c8('0x16'),_0x4412aa,JSON[_0x77c8('0x12')](_0xba1577));_0x5d5b9a(_0xba1577);})[_0x77c8('0x15')](function(_0x119eb3){logger[_0x77c8('0x13')](_0x77c8('0x16'),_0x119eb3['message'],_0x4412aa);_0x5e8ed8(_0x546630[_0x77c8('0x13')](0x1f4,_0x119eb3['message']));});});};exports[_0x77c8('0x1b')]=function(_0x45b2ab){var _0x2ce791=this;return new Promise(function(_0x50b498,_0x53bba8){return db[_0x77c8('0x17')][_0x77c8('0x1c')](_0x45b2ab[_0x77c8('0x1d')],{'raw':_0x45b2ab['options']?_0x45b2ab[_0x77c8('0x19')][_0x77c8('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45b2ab[_0x77c8('0x19')]?_0x45b2ab[_0x77c8('0x19')][_0x77c8('0x1e')]||null:null,'attributes':_0x45b2ab[_0x77c8('0x19')]?_0x45b2ab[_0x77c8('0x19')][_0x77c8('0x1f')]||null:null,'limit':_0x45b2ab[_0x77c8('0x19')]?_0x45b2ab[_0x77c8('0x19')]['limit']||null:null})[_0x77c8('0xc')](function(_0x58c68b){logger[_0x77c8('0xd')](_0x77c8('0x1b'),_0x45b2ab);logger['debug']('UpdateChatQueueReport',_0x45b2ab,JSON[_0x77c8('0x12')](_0x58c68b));_0x50b498(_0x58c68b);})[_0x77c8('0x15')](function(_0x555041){logger[_0x77c8('0x13')]('UpdateChatQueueReport',_0x555041['message'],_0x45b2ab);_0x53bba8(_0x2ce791[_0x77c8('0x13')](0x1f4,_0x555041[_0x77c8('0x14')]));});});}; \ No newline at end of file +var _0x88e2=['message','CreateChatQueueReport','ChatQueueReport','create','options','raw','debug','stringify','catch','UpdateChatQueueReport','update','body','where','attributes','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x88e2,0x96));var _0x288e=function(_0x408f13,_0x188203){_0x408f13=_0x408f13-0x0;var _0x4f3e25=_0x88e2[_0x408f13];return _0x4f3e25;};'use strict';var _=require(_0x288e('0x0'));var util=require(_0x288e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x288e('0x2'));var fs=require('fs');var Redis=require(_0x288e('0x3'));var db=require(_0x288e('0x4'))['db'];var utils=require(_0x288e('0x5'));var logger=require(_0x288e('0x6'))(_0x288e('0x7'));var config=require(_0x288e('0x8'));var jayson=require(_0x288e('0x9'));var client=jayson[_0x288e('0xa')][_0x288e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c93ae,_0x51a724,_0x4d0c23){return new BPromise(function(_0x2b3934,_0x3c7fce){return client[_0x288e('0xc')](_0x5c93ae,_0x4d0c23)[_0x288e('0xd')](function(_0x5ddae2){logger[_0x288e('0xe')](_0x288e('0xf'),_0x51a724,_0x288e('0x10'));logger['debug'](_0x288e('0x11'),_0x51a724,_0x288e('0x10'),JSON['stringify'](_0x5ddae2));if(_0x5ddae2['error']){if(_0x5ddae2['error'][_0x288e('0x12')]===0x1f4){logger[_0x288e('0x13')](_0x288e('0xf'),_0x51a724,_0x5ddae2['error']['message']);return _0x3c7fce(_0x5ddae2[_0x288e('0x13')][_0x288e('0x14')]);}logger['error'](_0x288e('0xf'),_0x51a724,_0x5ddae2[_0x288e('0x13')][_0x288e('0x14')]);return _0x2b3934(_0x5ddae2['error'][_0x288e('0x14')]);}else{logger[_0x288e('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x51a724,_0x288e('0x10'));_0x2b3934(_0x5ddae2['result'][_0x288e('0x14')]);}})['catch'](function(_0x486d13){logger[_0x288e('0x13')](_0x288e('0xf'),_0x51a724,_0x486d13);_0x3c7fce(_0x486d13);});});}exports[_0x288e('0x15')]=function(_0x1ab21d){var _0x36272c=this;return new Promise(function(_0xe2c70,_0x58a4f4){return db[_0x288e('0x16')][_0x288e('0x17')](_0x1ab21d['body'],{'raw':_0x1ab21d['options']?_0x1ab21d[_0x288e('0x18')][_0x288e('0x19')]===undefined?!![]:![]:!![]})[_0x288e('0xd')](function(_0x30f9db){logger[_0x288e('0xe')](_0x288e('0x15'),_0x1ab21d);logger[_0x288e('0x1a')](_0x288e('0x15'),_0x1ab21d,JSON[_0x288e('0x1b')](_0x30f9db));_0xe2c70(_0x30f9db);})[_0x288e('0x1c')](function(_0x4ddc50){logger[_0x288e('0x13')](_0x288e('0x15'),_0x4ddc50[_0x288e('0x14')],_0x1ab21d);_0x58a4f4(_0x36272c[_0x288e('0x13')](0x1f4,_0x4ddc50[_0x288e('0x14')]));});});};exports[_0x288e('0x1d')]=function(_0x4cf79e){var _0x20f87b=this;return new Promise(function(_0x5f9c23,_0x516804){return db['ChatQueueReport'][_0x288e('0x1e')](_0x4cf79e[_0x288e('0x1f')],{'raw':_0x4cf79e[_0x288e('0x18')]?_0x4cf79e[_0x288e('0x18')][_0x288e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cf79e[_0x288e('0x18')]?_0x4cf79e[_0x288e('0x18')][_0x288e('0x20')]||null:null,'attributes':_0x4cf79e['options']?_0x4cf79e[_0x288e('0x18')][_0x288e('0x21')]||null:null,'limit':_0x4cf79e['options']?_0x4cf79e[_0x288e('0x18')]['limit']||null:null})[_0x288e('0xd')](function(_0x32fa8e){logger[_0x288e('0xe')](_0x288e('0x1d'),_0x4cf79e);logger[_0x288e('0x1a')](_0x288e('0x1d'),_0x4cf79e,JSON[_0x288e('0x1b')](_0x32fa8e));_0x5f9c23(_0x32fa8e);})['catch'](function(_0x502aa1){logger['error']('UpdateChatQueueReport',_0x502aa1[_0x288e('0x14')],_0x4cf79e);_0x516804(_0x20f87b[_0x288e('0x13')](0x1f4,_0x502aa1[_0x288e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 83fc203..e3a870e 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 _0xd272=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xd272,0x156));var _0x2d27=function(_0x5e3132,_0x24d653){_0x5e3132=_0x5e3132-0x0;var _0x404fe8=_0xd272[_0x5e3132];return _0x404fe8;};'use strict';var multer=require(_0x2d27('0x0'));var util=require(_0x2d27('0x1'));var path=require(_0x2d27('0x2'));var timeout=require(_0x2d27('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2d27('0x4'));var auth=require(_0x2d27('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2d27('0x6'));var controller=require('./chatQueueReport.controller');router[_0x2d27('0x7')]('/',auth[_0x2d27('0x8')](),controller['index']);router[_0x2d27('0x7')](_0x2d27('0x9'),auth[_0x2d27('0x8')](),controller[_0x2d27('0xa')]);router['get'](_0x2d27('0xb'),auth[_0x2d27('0x8')](),controller[_0x2d27('0xc')]);router[_0x2d27('0xd')]('/',auth['isAuthenticated'](),controller[_0x2d27('0xe')]);router['put']('/:id',auth[_0x2d27('0x8')](),controller[_0x2d27('0xf')]);router[_0x2d27('0x10')](_0x2d27('0xb'),auth['isAuthenticated'](),controller[_0x2d27('0x11')]);module[_0x2d27('0x12')]=router; \ No newline at end of file +var _0x794d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','multer','util','express'];(function(_0x445b45,_0x752d9c){var _0x2b319b=function(_0x45d6a3){while(--_0x45d6a3){_0x445b45['push'](_0x445b45['shift']());}};_0x2b319b(++_0x752d9c);}(_0x794d,0xb1));var _0xd794=function(_0x31b4aa,_0x9a6429){_0x31b4aa=_0x31b4aa-0x0;var _0x1bb3dd=_0x794d[_0x31b4aa];return _0x1bb3dd;};'use strict';var multer=require(_0xd794('0x0'));var util=require(_0xd794('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd794('0x2'));var router=express[_0xd794('0x3')]();var fs_extra=require(_0xd794('0x4'));var auth=require(_0xd794('0x5'));var interaction=require(_0xd794('0x6'));var config=require(_0xd794('0x7'));var controller=require(_0xd794('0x8'));router[_0xd794('0x9')]('/',auth[_0xd794('0xa')](),controller[_0xd794('0xb')]);router['get'](_0xd794('0xc'),auth[_0xd794('0xa')](),controller[_0xd794('0xd')]);router['get'](_0xd794('0xe'),auth[_0xd794('0xa')](),controller[_0xd794('0xf')]);router[_0xd794('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd794('0xe'),auth[_0xd794('0xa')](),controller[_0xd794('0x11')]);router[_0xd794('0x12')](_0xd794('0xe'),auth[_0xd794('0xa')](),controller[_0xd794('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index adc99bb..4bee484 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0xdaa456,_0x3dbbe5){var _0x288a4a=function(_0x4e4d5d){while(--_0x4e4d5d){_0xdaa456['push'](_0xdaa456['shift']());}};_0x288a4a(++_0x3dbbe5);}(_0x54ef,0x112));var _0xf54e=function(_0x429841,_0xde67a9){_0x429841=_0x429841-0x0;var _0x3908f6=_0x54ef[_0x429841];return _0x3908f6;};'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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x17d3d0,_0x6ecac3){var _0x3a4144=function(_0x258783){while(--_0x258783){_0x17d3d0['push'](_0x17d3d0['shift']());}};_0x3a4144(++_0x6ecac3);}(_0xf4eb,0xec));var _0xbf4e=function(_0x92a015,_0x3494d1){_0x92a015=_0x92a015-0x0;var _0x25323b=_0xf4eb[_0x92a015];return _0x25323b;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 41f1e03..66894ad 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 _0x3900=['end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x59fada,_0x3d1b90){var _0x288d34=function(_0x4a1b7f){while(--_0x4a1b7f){_0x59fada['push'](_0x59fada['shift']());}};_0x288d34(++_0x3d1b90);}(_0x3900,0x1b7));var _0x0390=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0x3900[_0x43c8b8];return _0x413be3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0390('0x0'));var zipdir=require(_0x0390('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0390('0x2'));var moment=require(_0x0390('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0390('0x4'));var util=require(_0x0390('0x5'));var path=require(_0x0390('0x6'));var sox=require(_0x0390('0x7'));var csv=require('to-csv');var ejs=require(_0x0390('0x8'));var fs=require('fs');var fs_extra=require(_0x0390('0x9'));var _=require(_0x0390('0xa'));var squel=require(_0x0390('0xb'));var crypto=require(_0x0390('0xc'));var jsforce=require(_0x0390('0xd'));var deskjs=require(_0x0390('0xe'));var toCsv=require(_0x0390('0xf'));var querystring=require(_0x0390('0x10'));var Papa=require(_0x0390('0x11'));var Redis=require(_0x0390('0x12'));var authService=require(_0x0390('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0390('0x14'));var hardwareService=require(_0x0390('0x15'));var logger=require(_0x0390('0x16'))(_0x0390('0x17'));var utils=require(_0x0390('0x18'));var config=require(_0x0390('0x19'));var licenseUtil=require(_0x0390('0x1a'));var db=require(_0x0390('0x1b'))['db'];function respondWithStatusCode(_0x541b3d,_0x3422b5){_0x3422b5=_0x3422b5||0xcc;return function(_0x175555){if(_0x175555){return _0x541b3d['sendStatus'](_0x3422b5);}return _0x541b3d[_0x0390('0x1c')](_0x3422b5)[_0x0390('0x1d')]();};}function respondWithResult(_0xc6f6eb,_0x40d1fc){_0x40d1fc=_0x40d1fc||0xc8;return function(_0x3d771c){if(_0x3d771c){return _0xc6f6eb['status'](_0x40d1fc)[_0x0390('0x1e')](_0x3d771c);}};}function respondWithFilteredResult(_0x83abb4,_0x4abafb){return function(_0x35b910){if(_0x35b910){var _0x3a392d=typeof _0x4abafb[_0x0390('0x1f')]===_0x0390('0x20')&&typeof _0x4abafb[_0x0390('0x21')]==='undefined';var _0x171911=_0x35b910[_0x0390('0x22')];var _0x4411dd=_0x3a392d?0x0:_0x4abafb[_0x0390('0x1f')];var _0x9c1dbe=_0x3a392d?_0x35b910[_0x0390('0x22')]:_0x4abafb[_0x0390('0x1f')]+_0x4abafb[_0x0390('0x21')];var _0x34ac61;if(_0x9c1dbe>=_0x171911){_0x9c1dbe=_0x171911;_0x34ac61=0xc8;}else{_0x34ac61=0xce;}_0x83abb4[_0x0390('0x1c')](_0x34ac61);return _0x83abb4[_0x0390('0x23')](_0x0390('0x24'),_0x4411dd+'-'+_0x9c1dbe+'/'+_0x171911)[_0x0390('0x1e')](_0x35b910);}return null;};}function patchUpdates(_0x27bab9){return function(_0x37e7dc){try{jsonpatch['apply'](_0x37e7dc,_0x27bab9,!![]);}catch(_0x1a56e4){return BPromise[_0x0390('0x25')](_0x1a56e4);}return _0x37e7dc[_0x0390('0x26')]();};}function saveUpdates(_0x355205,_0x3e658c){return function(_0x125b40){if(_0x125b40){return _0x125b40['update'](_0x355205)[_0x0390('0x27')](function(_0x3927f0){return _0x3927f0;});}return null;};}function removeEntity(_0x2f25c8,_0x2550b8){return function(_0x2d9f33){if(_0x2d9f33){return _0x2d9f33[_0x0390('0x28')]()[_0x0390('0x27')](function(){_0x2f25c8[_0x0390('0x1c')](0xcc)[_0x0390('0x1d')]();});}};}function handleEntityNotFound(_0x182aeb,_0x31d900){return function(_0x2f5076){if(!_0x2f5076){_0x182aeb[_0x0390('0x29')](0x194);}return _0x2f5076;};}function handleError(_0xed0aa9,_0x3e4641){_0x3e4641=_0x3e4641||0x1f4;return function(_0x2b7cc9){logger[_0x0390('0x2a')](_0x2b7cc9['stack']);if(_0x2b7cc9['name']){delete _0x2b7cc9[_0x0390('0x2b')];}_0xed0aa9[_0x0390('0x1c')](_0x3e4641)['send'](_0x2b7cc9);};}exports[_0x0390('0x2c')]=function(_0x26d806,_0xc9b4e8){var _0x36b48d={},_0x2a19c4={},_0x5d79e8={'count':0x0,'rows':[]};var _0x147f06=_[_0x0390('0x2d')](db[_0x0390('0x2e')][_0x0390('0x2f')],function(_0x3137b6){return{'name':_0x3137b6[_0x0390('0x30')],'type':_0x3137b6[_0x0390('0x31')][_0x0390('0x32')]};});_0x2a19c4[_0x0390('0x33')]=_[_0x0390('0x2d')](_0x147f06,'name');_0x2a19c4[_0x0390('0x34')]=_[_0x0390('0x35')](_0x26d806[_0x0390('0x34')]);_0x2a19c4[_0x0390('0x36')]=_[_0x0390('0x37')](_0x2a19c4[_0x0390('0x33')],_0x2a19c4[_0x0390('0x34')]);_0x36b48d[_0x0390('0x38')]=_['intersection'](_0x2a19c4['model'],qs[_0x0390('0x39')](_0x26d806[_0x0390('0x34')][_0x0390('0x39')]));_0x36b48d['attributes']=_0x36b48d[_0x0390('0x38')][_0x0390('0x3a')]?_0x36b48d[_0x0390('0x38')]:_0x2a19c4['model'];if(!_0x26d806[_0x0390('0x34')]['hasOwnProperty'](_0x0390('0x3b'))){_0x36b48d['limit']=qs[_0x0390('0x21')](_0x26d806['query']['limit']);_0x36b48d[_0x0390('0x1f')]=qs[_0x0390('0x1f')](_0x26d806[_0x0390('0x34')][_0x0390('0x1f')]);}_0x36b48d['order']=qs[_0x0390('0x3c')](_0x26d806[_0x0390('0x34')]['sort']);_0x36b48d[_0x0390('0x3d')]=qs[_0x0390('0x36')](_[_0x0390('0x3e')](_0x26d806[_0x0390('0x34')],_0x2a19c4[_0x0390('0x36')]),_0x147f06);if(_0x26d806['query']['filter']){_0x36b48d[_0x0390('0x3d')]=_[_0x0390('0x3f')](_0x36b48d[_0x0390('0x3d')],{'$or':_[_0x0390('0x2d')](_0x147f06,function(_0x5ecb94){if(_0x5ecb94['type']!==_0x0390('0x40')){var _0x467d58={};_0x467d58[_0x5ecb94[_0x0390('0x2b')]]={'$like':'%'+_0x26d806['query'][_0x0390('0x41')]+'%'};return _0x467d58;}})});}_0x36b48d=_[_0x0390('0x3f')]({},_0x36b48d,_0x26d806[_0x0390('0x42')]);var _0x5db5e0={'where':_0x36b48d[_0x0390('0x3d')]};return db[_0x0390('0x2e')][_0x0390('0x22')](_0x5db5e0)[_0x0390('0x27')](function(_0x4b579c){_0x5d79e8['count']=_0x4b579c;if(_0x26d806['query'][_0x0390('0x43')]){_0x36b48d[_0x0390('0x44')]=[{'all':!![]}];}return db[_0x0390('0x2e')][_0x0390('0x45')](_0x36b48d);})[_0x0390('0x27')](function(_0x2524fe){_0x5d79e8[_0x0390('0x46')]=_0x2524fe;return _0x5d79e8;})[_0x0390('0x27')](respondWithFilteredResult(_0xc9b4e8,_0x36b48d))[_0x0390('0x47')](handleError(_0xc9b4e8,null));};exports[_0x0390('0x48')]=function(_0x53cd3d,_0x19570c){var _0x3d094d={'raw':!![],'where':{'id':_0x53cd3d[_0x0390('0x49')]['id']}},_0x573e1f={};_0x573e1f[_0x0390('0x33')]=_[_0x0390('0x35')](db[_0x0390('0x2e')]['rawAttributes']);_0x573e1f[_0x0390('0x34')]=_[_0x0390('0x35')](_0x53cd3d[_0x0390('0x34')]);_0x573e1f[_0x0390('0x36')]=_[_0x0390('0x37')](_0x573e1f[_0x0390('0x33')],_0x573e1f[_0x0390('0x34')]);_0x3d094d['attributes']=_[_0x0390('0x37')](_0x573e1f[_0x0390('0x33')],qs[_0x0390('0x39')](_0x53cd3d[_0x0390('0x34')]['fields']));_0x3d094d[_0x0390('0x38')]=_0x3d094d[_0x0390('0x38')][_0x0390('0x3a')]?_0x3d094d[_0x0390('0x38')]:_0x573e1f['model'];if(_0x53cd3d['query'][_0x0390('0x43')]){_0x3d094d[_0x0390('0x44')]=[{'all':!![]}];}_0x3d094d=_[_0x0390('0x3f')]({},_0x3d094d,_0x53cd3d[_0x0390('0x42')]);return db['ChatTransferReport'][_0x0390('0x4a')](_0x3d094d)[_0x0390('0x27')](handleEntityNotFound(_0x19570c,null))[_0x0390('0x27')](respondWithResult(_0x19570c,null))[_0x0390('0x47')](handleError(_0x19570c,null));};exports['create']=function(_0x361789,_0x38bf52){return db[_0x0390('0x2e')]['create'](_0x361789['body'],{})[_0x0390('0x27')](respondWithResult(_0x38bf52,0xc9))[_0x0390('0x47')](handleError(_0x38bf52,null));};exports[_0x0390('0x4b')]=function(_0x57d783,_0x40ba39){if(_0x57d783['body']['id']){delete _0x57d783[_0x0390('0x4c')]['id'];}return db[_0x0390('0x2e')][_0x0390('0x4a')]({'where':{'id':_0x57d783['params']['id']}})[_0x0390('0x27')](handleEntityNotFound(_0x40ba39,null))[_0x0390('0x27')](saveUpdates(_0x57d783['body'],null))['then'](respondWithResult(_0x40ba39,null))[_0x0390('0x47')](handleError(_0x40ba39,null));};exports[_0x0390('0x28')]=function(_0x4c0457,_0x46d689){return db[_0x0390('0x2e')]['find']({'where':{'id':_0x4c0457[_0x0390('0x49')]['id']}})[_0x0390('0x27')](handleEntityNotFound(_0x46d689,null))['then'](removeEntity(_0x46d689,null))[_0x0390('0x47')](handleError(_0x46d689,null));};exports[_0x0390('0x4d')]=function(_0x2c91ba,_0x2f1e28){return db[_0x0390('0x2e')][_0x0390('0x4d')]()['then'](respondWithResult(_0x2f1e28,null))['catch'](handleError(_0x2f1e28,null));}; \ No newline at end of file +var _0x5e68=['keys','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','findAll','rows','catch','show','params'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x5e68,0x1da));var _0x85e6=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5e68[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x85e6('0x0'));var rimraf=require(_0x85e6('0x1'));var zipdir=require(_0x85e6('0x2'));var jsonpatch=require(_0x85e6('0x3'));var rp=require(_0x85e6('0x4'));var moment=require(_0x85e6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x85e6('0x6'));var util=require('util');var path=require(_0x85e6('0x7'));var sox=require(_0x85e6('0x8'));var csv=require(_0x85e6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x85e6('0xa'));var _=require(_0x85e6('0xb'));var squel=require('squel');var crypto=require(_0x85e6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x85e6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x85e6('0xe'));var Papa=require(_0x85e6('0xf'));var Redis=require(_0x85e6('0x10'));var authService=require(_0x85e6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x85e6('0x12'));var hardwareService=require(_0x85e6('0x13'));var logger=require(_0x85e6('0x14'))(_0x85e6('0x15'));var utils=require(_0x85e6('0x16'));var config=require(_0x85e6('0x17'));var licenseUtil=require(_0x85e6('0x18'));var db=require(_0x85e6('0x19'))['db'];function respondWithStatusCode(_0x426e6d,_0x13aa52){_0x13aa52=_0x13aa52||0xcc;return function(_0x2eda72){if(_0x2eda72){return _0x426e6d[_0x85e6('0x1a')](_0x13aa52);}return _0x426e6d[_0x85e6('0x1b')](_0x13aa52)['end']();};}function respondWithResult(_0x24715d,_0x1c3380){_0x1c3380=_0x1c3380||0xc8;return function(_0x4a4406){if(_0x4a4406){return _0x24715d[_0x85e6('0x1b')](_0x1c3380)['json'](_0x4a4406);}};}function respondWithFilteredResult(_0x51fd09,_0xac1e35){return function(_0x25851e){if(_0x25851e){var _0x2ab7cb=typeof _0xac1e35[_0x85e6('0x1c')]===_0x85e6('0x1d')&&typeof _0xac1e35[_0x85e6('0x1e')]===_0x85e6('0x1d');var _0x171804=_0x25851e[_0x85e6('0x1f')];var _0x4e4dc2=_0x2ab7cb?0x0:_0xac1e35['offset'];var _0x499688=_0x2ab7cb?_0x25851e['count']:_0xac1e35['offset']+_0xac1e35['limit'];var _0x2bd921;if(_0x499688>=_0x171804){_0x499688=_0x171804;_0x2bd921=0xc8;}else{_0x2bd921=0xce;}_0x51fd09[_0x85e6('0x1b')](_0x2bd921);return _0x51fd09[_0x85e6('0x20')]('Content-Range',_0x4e4dc2+'-'+_0x499688+'/'+_0x171804)[_0x85e6('0x21')](_0x25851e);}return null;};}function patchUpdates(_0x4fcc82){return function(_0x32da59){try{jsonpatch['apply'](_0x32da59,_0x4fcc82,!![]);}catch(_0x46a4f8){return BPromise[_0x85e6('0x22')](_0x46a4f8);}return _0x32da59[_0x85e6('0x23')]();};}function saveUpdates(_0x5b7a18,_0x4cbd2d){return function(_0x47bc99){if(_0x47bc99){return _0x47bc99[_0x85e6('0x24')](_0x5b7a18)[_0x85e6('0x25')](function(_0xe91b3e){return _0xe91b3e;});}return null;};}function removeEntity(_0xe0b5be,_0x3c6d09){return function(_0x18a182){if(_0x18a182){return _0x18a182[_0x85e6('0x26')]()[_0x85e6('0x25')](function(){_0xe0b5be[_0x85e6('0x1b')](0xcc)[_0x85e6('0x27')]();});}};}function handleEntityNotFound(_0x324043,_0x4921b5){return function(_0x2fdbc0){if(!_0x2fdbc0){_0x324043[_0x85e6('0x1a')](0x194);}return _0x2fdbc0;};}function handleError(_0x57b8f1,_0x1f3db1){_0x1f3db1=_0x1f3db1||0x1f4;return function(_0x6c0a4e){logger[_0x85e6('0x28')](_0x6c0a4e[_0x85e6('0x29')]);if(_0x6c0a4e[_0x85e6('0x2a')]){delete _0x6c0a4e[_0x85e6('0x2a')];}_0x57b8f1['status'](_0x1f3db1)[_0x85e6('0x2b')](_0x6c0a4e);};}exports[_0x85e6('0x2c')]=function(_0x5c4274,_0x2314e8){var _0x43a614={},_0x7f3d2={},_0x12d161={'count':0x0,'rows':[]};var _0x3a2fe4=_[_0x85e6('0x2d')](db['ChatTransferReport'][_0x85e6('0x2e')],function(_0x26f763){return{'name':_0x26f763[_0x85e6('0x2f')],'type':_0x26f763[_0x85e6('0x30')]['key']};});_0x7f3d2[_0x85e6('0x31')]=_[_0x85e6('0x2d')](_0x3a2fe4,_0x85e6('0x2a'));_0x7f3d2[_0x85e6('0x32')]=_['keys'](_0x5c4274['query']);_0x7f3d2[_0x85e6('0x33')]=_['intersection'](_0x7f3d2['model'],_0x7f3d2[_0x85e6('0x32')]);_0x43a614[_0x85e6('0x34')]=_[_0x85e6('0x35')](_0x7f3d2[_0x85e6('0x31')],qs['fields'](_0x5c4274[_0x85e6('0x32')][_0x85e6('0x36')]));_0x43a614[_0x85e6('0x34')]=_0x43a614['attributes'][_0x85e6('0x37')]?_0x43a614[_0x85e6('0x34')]:_0x7f3d2[_0x85e6('0x31')];if(!_0x5c4274[_0x85e6('0x32')]['hasOwnProperty'](_0x85e6('0x38'))){_0x43a614[_0x85e6('0x1e')]=qs[_0x85e6('0x1e')](_0x5c4274[_0x85e6('0x32')][_0x85e6('0x1e')]);_0x43a614[_0x85e6('0x1c')]=qs[_0x85e6('0x1c')](_0x5c4274[_0x85e6('0x32')][_0x85e6('0x1c')]);}_0x43a614[_0x85e6('0x39')]=qs[_0x85e6('0x3a')](_0x5c4274['query']['sort']);_0x43a614[_0x85e6('0x3b')]=qs[_0x85e6('0x33')](_[_0x85e6('0x3c')](_0x5c4274[_0x85e6('0x32')],_0x7f3d2[_0x85e6('0x33')]),_0x3a2fe4);if(_0x5c4274[_0x85e6('0x32')][_0x85e6('0x3d')]){_0x43a614[_0x85e6('0x3b')]=_[_0x85e6('0x3e')](_0x43a614[_0x85e6('0x3b')],{'$or':_['map'](_0x3a2fe4,function(_0x5e27b6){if(_0x5e27b6[_0x85e6('0x30')]!==_0x85e6('0x3f')){var _0x2d5d8a={};_0x2d5d8a[_0x5e27b6[_0x85e6('0x2a')]]={'$like':'%'+_0x5c4274[_0x85e6('0x32')][_0x85e6('0x3d')]+'%'};return _0x2d5d8a;}})});}_0x43a614=_[_0x85e6('0x3e')]({},_0x43a614,_0x5c4274[_0x85e6('0x40')]);var _0x30f930={'where':_0x43a614[_0x85e6('0x3b')]};return db[_0x85e6('0x41')][_0x85e6('0x1f')](_0x30f930)[_0x85e6('0x25')](function(_0xc675c2){_0x12d161[_0x85e6('0x1f')]=_0xc675c2;if(_0x5c4274[_0x85e6('0x32')][_0x85e6('0x42')]){_0x43a614['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x85e6('0x43')](_0x43a614);})[_0x85e6('0x25')](function(_0x517290){_0x12d161[_0x85e6('0x44')]=_0x517290;return _0x12d161;})[_0x85e6('0x25')](respondWithFilteredResult(_0x2314e8,_0x43a614))[_0x85e6('0x45')](handleError(_0x2314e8,null));};exports[_0x85e6('0x46')]=function(_0x2a16e2,_0x336e91){var _0x4d553c={'raw':!![],'where':{'id':_0x2a16e2[_0x85e6('0x47')]['id']}},_0x13b6e8={};_0x13b6e8['model']=_[_0x85e6('0x48')](db[_0x85e6('0x41')][_0x85e6('0x2e')]);_0x13b6e8[_0x85e6('0x32')]=_[_0x85e6('0x48')](_0x2a16e2[_0x85e6('0x32')]);_0x13b6e8[_0x85e6('0x33')]=_[_0x85e6('0x35')](_0x13b6e8['model'],_0x13b6e8[_0x85e6('0x32')]);_0x4d553c[_0x85e6('0x34')]=_[_0x85e6('0x35')](_0x13b6e8['model'],qs[_0x85e6('0x36')](_0x2a16e2[_0x85e6('0x32')][_0x85e6('0x36')]));_0x4d553c['attributes']=_0x4d553c['attributes']['length']?_0x4d553c[_0x85e6('0x34')]:_0x13b6e8[_0x85e6('0x31')];if(_0x2a16e2[_0x85e6('0x32')]['includeAll']){_0x4d553c[_0x85e6('0x49')]=[{'all':!![]}];}_0x4d553c=_[_0x85e6('0x3e')]({},_0x4d553c,_0x2a16e2[_0x85e6('0x40')]);return db[_0x85e6('0x41')]['find'](_0x4d553c)[_0x85e6('0x25')](handleEntityNotFound(_0x336e91,null))[_0x85e6('0x25')](respondWithResult(_0x336e91,null))[_0x85e6('0x45')](handleError(_0x336e91,null));};exports[_0x85e6('0x4a')]=function(_0x324010,_0x156e3b){return db['ChatTransferReport'][_0x85e6('0x4a')](_0x324010[_0x85e6('0x4b')],{})['then'](respondWithResult(_0x156e3b,0xc9))['catch'](handleError(_0x156e3b,null));};exports[_0x85e6('0x24')]=function(_0x4a2899,_0x5bbdb6){if(_0x4a2899[_0x85e6('0x4b')]['id']){delete _0x4a2899[_0x85e6('0x4b')]['id'];}return db[_0x85e6('0x41')]['find']({'where':{'id':_0x4a2899[_0x85e6('0x47')]['id']}})[_0x85e6('0x25')](handleEntityNotFound(_0x5bbdb6,null))[_0x85e6('0x25')](saveUpdates(_0x4a2899[_0x85e6('0x4b')],null))[_0x85e6('0x25')](respondWithResult(_0x5bbdb6,null))[_0x85e6('0x45')](handleError(_0x5bbdb6,null));};exports[_0x85e6('0x26')]=function(_0x4e54ab,_0x321efc){return db[_0x85e6('0x41')][_0x85e6('0x4c')]({'where':{'id':_0x4e54ab['params']['id']}})[_0x85e6('0x25')](handleEntityNotFound(_0x321efc,null))['then'](removeEntity(_0x321efc,null))[_0x85e6('0x45')](handleError(_0x321efc,null));};exports[_0x85e6('0x4d')]=function(_0x101424,_0xe2e5c2){return db[_0x85e6('0x41')]['describe']()[_0x85e6('0x25')](respondWithResult(_0xe2e5c2,null))[_0x85e6('0x45')](handleError(_0xe2e5c2,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 231def3..0c98f19 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 _0xb7d0=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x4a1160,_0x22b485){var _0x2657cd=function(_0x3f07d6){while(--_0x3f07d6){_0x4a1160['push'](_0x4a1160['shift']());}};_0x2657cd(++_0x22b485);}(_0xb7d0,0x104));var _0x0b7d=function(_0x112e6a,_0x4dfc41){_0x112e6a=_0x112e6a-0x0;var _0x1b691b=_0xb7d0[_0x112e6a];return _0x1b691b;};'use strict';var _=require('lodash');var util=require(_0x0b7d('0x0'));var logger=require(_0x0b7d('0x1'))(_0x0b7d('0x2'));var moment=require('moment');var BPromise=require(_0x0b7d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b7d('0x4'));var rimraf=require(_0x0b7d('0x5'));var config=require(_0x0b7d('0x6'));var attributes=require(_0x0b7d('0x7'));module[_0x0b7d('0x8')]=function(_0x59915e,_0x973571){return _0x59915e[_0x0b7d('0x9')](_0x0b7d('0xa'),attributes,{'tableName':_0x0b7d('0xb'),'paranoid':![],'indexes':[{'name':_0x0b7d('0xc'),'fields':[_0x0b7d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2f63=['request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','bluebird'];(function(_0x5292fc,_0x1facac){var _0x572678=function(_0xf0db6e){while(--_0xf0db6e){_0x5292fc['push'](_0x5292fc['shift']());}};_0x572678(++_0x1facac);}(_0x2f63,0xee));var _0x32f6=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0x2f63[_0x49a57c];return _0x4e0316;};'use strict';var _=require('lodash');var util=require(_0x32f6('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x32f6('0x1'));var rp=require(_0x32f6('0x2'));var fs=require('fs');var path=require(_0x32f6('0x3'));var rimraf=require(_0x32f6('0x4'));var config=require(_0x32f6('0x5'));var attributes=require(_0x32f6('0x6'));module[_0x32f6('0x7')]=function(_0x431b5b,_0x2d3277){return _0x431b5b[_0x32f6('0x8')](_0x32f6('0x9'),attributes,{'tableName':_0x32f6('0xa'),'paranoid':![],'indexes':[{'name':_0x32f6('0xb'),'fields':[_0x32f6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 097d958..14606e2 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 _0x9e1b=['http','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','randomstring','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x4a83bf,_0x17f142){var _0x5420ec=function(_0xa94fb8){while(--_0xa94fb8){_0x4a83bf['push'](_0x4a83bf['shift']());}};_0x5420ec(++_0x17f142);}(_0x9e1b,0xfb));var _0xb9e1=function(_0x118e4e,_0x31f5ca){_0x118e4e=_0x118e4e-0x0;var _0x32ca14=_0x9e1b[_0x118e4e];return _0x32ca14;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb9e1('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9e1('0x1'))['db'];var utils=require(_0xb9e1('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0xb9e1('0x3'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb9e1('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x3428a1,_0x3ec089,_0x22613d){return new BPromise(function(_0x59550d,_0x4266b8){return client['request'](_0x3428a1,_0x22613d)['then'](function(_0xc848fb){logger[_0xb9e1('0x5')](_0xb9e1('0x6'),_0x3ec089,_0xb9e1('0x7'));logger[_0xb9e1('0x8')](_0xb9e1('0x9'),_0x3ec089,_0xb9e1('0x7'),JSON[_0xb9e1('0xa')](_0xc848fb));if(_0xc848fb[_0xb9e1('0xb')]){if(_0xc848fb[_0xb9e1('0xb')][_0xb9e1('0xc')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x3ec089,_0xc848fb[_0xb9e1('0xb')][_0xb9e1('0xd')]);return _0x4266b8(_0xc848fb['error'][_0xb9e1('0xd')]);}logger[_0xb9e1('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x3ec089,_0xc848fb[_0xb9e1('0xb')][_0xb9e1('0xd')]);return _0x59550d(_0xc848fb[_0xb9e1('0xb')][_0xb9e1('0xd')]);}else{logger[_0xb9e1('0x5')]('ChatTransferReport,\x20%s,\x20%s',_0x3ec089,_0xb9e1('0x7'));_0x59550d(_0xc848fb[_0xb9e1('0xe')][_0xb9e1('0xd')]);}})['catch'](function(_0x33bcd4){logger[_0xb9e1('0xb')](_0xb9e1('0x6'),_0x3ec089,_0x33bcd4);_0x4266b8(_0x33bcd4);});});} \ No newline at end of file +var _0x03a6=['message','result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s'];(function(_0x58f656,_0x1bca2c){var _0x3037be=function(_0x5600b5){while(--_0x5600b5){_0x58f656['push'](_0x58f656['shift']());}};_0x3037be(++_0x1bca2c);}(_0x03a6,0x136));var _0x603a=function(_0x4e978c,_0x1f8118){_0x4e978c=_0x4e978c-0x0;var _0x2c1a8e=_0x03a6[_0x4e978c];return _0x2c1a8e;};'use strict';var _=require('lodash');var util=require(_0x603a('0x0'));var moment=require(_0x603a('0x1'));var BPromise=require(_0x603a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x603a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x603a('0x4'));var logger=require(_0x603a('0x5'))(_0x603a('0x6'));var config=require(_0x603a('0x7'));var jayson=require(_0x603a('0x8'));var client=jayson[_0x603a('0x9')][_0x603a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x524d4e,_0x51e6ba,_0x54339a){return new BPromise(function(_0x236b23,_0x5a705c){return client[_0x603a('0xb')](_0x524d4e,_0x54339a)[_0x603a('0xc')](function(_0x29d749){logger[_0x603a('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x51e6ba,_0x603a('0xe'));logger['debug'](_0x603a('0xf'),_0x51e6ba,_0x603a('0xe'),JSON[_0x603a('0x10')](_0x29d749));if(_0x29d749[_0x603a('0x11')]){if(_0x29d749[_0x603a('0x11')][_0x603a('0x12')]===0x1f4){logger[_0x603a('0x11')](_0x603a('0x13'),_0x51e6ba,_0x29d749[_0x603a('0x11')][_0x603a('0x14')]);return _0x5a705c(_0x29d749[_0x603a('0x11')]['message']);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x51e6ba,_0x29d749[_0x603a('0x11')][_0x603a('0x14')]);return _0x236b23(_0x29d749['error'][_0x603a('0x14')]);}else{logger[_0x603a('0xd')](_0x603a('0x13'),_0x51e6ba,_0x603a('0xe'));_0x236b23(_0x29d749[_0x603a('0x15')][_0x603a('0x14')]);}})['catch'](function(_0x21ea6d){logger['error'](_0x603a('0x13'),_0x51e6ba,_0x21ea6d);_0x5a705c(_0x21ea6d);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index c15a933..2b4f44f 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 _0x13fc=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xea367b,_0x131726){var _0x2a0cfb=function(_0x3c15d2){while(--_0x3c15d2){_0xea367b['push'](_0xea367b['shift']());}};_0x2a0cfb(++_0x131726);}(_0x13fc,0x14e));var _0xc13f=function(_0x5c4291,_0x4e7086){_0x5c4291=_0x5c4291-0x0;var _0x3090f1=_0x13fc[_0x5c4291];return _0x3090f1;};'use strict';var multer=require(_0xc13f('0x0'));var util=require(_0xc13f('0x1'));var path=require(_0xc13f('0x2'));var timeout=require(_0xc13f('0x3'));var express=require(_0xc13f('0x4'));var router=express[_0xc13f('0x5')]();var fs_extra=require(_0xc13f('0x6'));var auth=require(_0xc13f('0x7'));var interaction=require(_0xc13f('0x8'));var config=require(_0xc13f('0x9'));var controller=require(_0xc13f('0xa'));router[_0xc13f('0xb')]('/',auth[_0xc13f('0xc')](),controller['index']);router['get']('/describe',auth[_0xc13f('0xc')](),controller['describe']);router['get']('/:id',auth[_0xc13f('0xc')](),controller['show']);router[_0xc13f('0xd')]('/',auth[_0xc13f('0xc')](),controller['create']);router[_0xc13f('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc13f('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xc13f('0x10')]);module[_0xc13f('0x11')]=router; \ No newline at end of file +var _0x3668=['./chatTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','post','create','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3668,0x14f));var _0x8366=function(_0x6a16c7,_0x2b9622){_0x6a16c7=_0x6a16c7-0x0;var _0xd05f43=_0x3668[_0x6a16c7];return _0xd05f43;};'use strict';var multer=require(_0x8366('0x0'));var util=require('util');var path=require(_0x8366('0x1'));var timeout=require(_0x8366('0x2'));var express=require(_0x8366('0x3'));var router=express[_0x8366('0x4')]();var fs_extra=require(_0x8366('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8366('0x6'));var config=require('../../config/environment');var controller=require(_0x8366('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8366('0x8')]);router[_0x8366('0x9')](_0x8366('0xa'),auth[_0x8366('0xb')](),controller[_0x8366('0xc')]);router['get'](_0x8366('0xd'),auth[_0x8366('0xb')](),controller['show']);router[_0x8366('0xe')]('/',auth[_0x8366('0xb')](),controller[_0x8366('0xf')]);router[_0x8366('0x10')](_0x8366('0xd'),auth[_0x8366('0xb')](),controller['update']);router[_0x8366('0x11')]('/:id',auth[_0x8366('0xb')](),controller['destroy']);module[_0x8366('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index cd9a5f6..8dc6a30 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 _0x9c44=['input','parse','getDataValue','setDataValue','onlineForm','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Feedback','ENUM','star','thumb','name'];(function(_0x100ea5,_0x2f13b4){var _0x1c331=function(_0x247f46){while(--_0x247f46){_0x100ea5['push'](_0x100ea5['shift']());}};_0x1c331(++_0x2f13b4);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x49c4('0x0')]={'name':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![],'unique':_0x49c4('0x2')},'description':{'type':Sequelize[_0x49c4('0x1')]},'mapKey':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x4')},'customerAlias':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![],'defaultValue':_0x49c4('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x49c4('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![],'defaultValue':_0x49c4('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x49c4('0x1')]},'animation':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x49c4('0x8'),_0x49c4('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0xa')},'start_chat_button':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0xc')},'download_transcript':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x49c4('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x49c4('0xf')]},'closingQuestion':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x11')},'noteTitle':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x12')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0xb')},'skipMessageButton':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x13')},'ratingType':{'type':Sequelize[_0x49c4('0x14')](_0x49c4('0x15'),_0x49c4('0x16')),'defaultValue':_0x49c4('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x49c4('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x49c4('0x17'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x49c4('0x18'),'props':{'title':_0x49c4('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x49c4('0x3'),'type':_0x49c4('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0x49c4('0x19')](this[_0x49c4('0x1a')]('onlineForm')):{};},'set':function(_0x207358){return this[_0x49c4('0x1b')](_0x49c4('0x1c'),JSON[_0x49c4('0x1d')](_0x207358));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x49c4('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x49c4('0x3'),'type':_0x49c4('0x3')},'variable':null},{'type':_0x49c4('0x1e'),'config':{'placeholder':_0x49c4('0x1f')},'props':{'title':'Comments','helpText':_0x49c4('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x49c4('0x1a')](_0x49c4('0x21'))?JSON[_0x49c4('0x19')](this[_0x49c4('0x1a')](_0x49c4('0x21'))):{};},'set':function(_0x26ba17){return this[_0x49c4('0x1b')](_0x49c4('0x21'),JSON[_0x49c4('0x1d')](_0x26ba17));}},'token':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x49c4('0x1')]},'forwardOffline':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x49c4('0x1')]},'waitingTitle':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x23')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x24')},'skipUnmanaged':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x25')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x49c4('0x1')]},'notificationTemplate':{'type':Sequelize[_0x49c4('0xf')],'defaultValue':function(){return _0x49c4('0x26');}},'notificationSound':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x49c4('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x29')},'messagesAlignment':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x49c4('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x49c4('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x49c4('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x49c4('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x49c4('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x2c')},'systemAvatar':{'type':Sequelize[_0x49c4('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x49c4('0xd')],'comment':_0x49c4('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2d2510){if(!_0x2d2510)this[_0x49c4('0x1b')](_0x49c4('0x2e'),null);this[_0x49c4('0x1b')](_0x49c4('0x2f'),_0x2d2510);}},'vidaooEscalation':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x49c4('0x1')]},'vidaooTopic':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![],'defaultValue':_0x49c4('0x30')},'vidaooNote':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':function(){return _0x49c4('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x49c4('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x878f=['Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','BOOLEAN','Feedback','thumb','star','TEXT','stringify','input','name','text','onlineForm','parse','getDataValue','textarea','Comments','offlineForm','setDataValue','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','website_alias','bottom_right','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#ffffff','INTEGER','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us'];(function(_0x219407,_0x36c620){var _0x240e77=function(_0x1d0a73){while(--_0x1d0a73){_0x219407['push'](_0x219407['shift']());}};_0x240e77(++_0x36c620);}(_0x878f,0x173));var _0xf878=function(_0x54ffd5,_0x3d0c57){_0x54ffd5=_0x54ffd5-0x0;var _0x50589b=_0x878f[_0x54ffd5];return _0x50589b;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xf878('0x0'));module[_0xf878('0x1')]={'name':{'type':Sequelize[_0xf878('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xf878('0x2')],'allowNull':![],'unique':_0xf878('0x3')},'description':{'type':Sequelize[_0xf878('0x2')]},'mapKey':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x4')},'mapKeyOffline':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x4')},'key':{'type':Sequelize[_0xf878('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xf878('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf878('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf878('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf878('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf878('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf878('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf878('0x7')](_0xf878('0x8'),'squared'),'defaultValue':_0xf878('0x8')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xf878('0x9')},'start_chat_button':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0xa')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xf878('0xb')},'header_offline':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf878('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x10')},'noteTitle':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x11')},'placeholderMessage':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x12')},'closingMessage':{'type':Sequelize[_0xf878('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0xb')},'skipMessageButton':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x13')},'conditionAgreement':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x15')},'ratingType':{'type':Sequelize[_0xf878('0x7')]('star',_0xf878('0x16')),'defaultValue':_0xf878('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xf878('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf878('0x18')],'defaultValue':function(){return JSON[_0xf878('0x19')]({'items':[{'type':_0xf878('0x1a'),'variable':null,'config':{'placeholder':_0xf878('0x1b'),'type':_0xf878('0x1c'),'required':!![]},'props':{'title':_0xf878('0x1b'),'helpText':''}},{'type':_0xf878('0x1a'),'props':{'title':_0xf878('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf878('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xf878('0x1d'))?JSON[_0xf878('0x1e')](this[_0xf878('0x1f')](_0xf878('0x1d'))):{};},'set':function(_0x20449e){return this['setDataValue']('onlineForm',JSON['stringify'](_0x20449e));}},'offlineForm':{'type':Sequelize[_0xf878('0x18')],'defaultValue':function(){return JSON[_0xf878('0x19')]({'items':[{'type':_0xf878('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xf878('0x4'),'type':_0xf878('0x4')},'variable':null},{'type':_0xf878('0x20'),'config':{'placeholder':_0xf878('0x21')},'props':{'title':_0xf878('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xf878('0x22'))?JSON[_0xf878('0x1e')](this['getDataValue'](_0xf878('0x22'))):{};},'set':function(_0x52da83){return this[_0xf878('0x23')]('offlineForm',JSON[_0xf878('0x19')](_0x52da83));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf878('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf878('0x2')]},'forwardOffline':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf878('0x2')]},'waitingTitle':{'type':Sequelize[_0xf878('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x26')},'offlineMessageBody':{'type':Sequelize[_0xf878('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xf878('0x14')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf878('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x13')},'sendUnmanaged':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf878('0x18')]},'showAgentAvatar':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf878('0x2')]},'notificationTemplate':{'type':Sequelize[_0xf878('0x18')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf878('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf878('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf878('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xf878('0x18')]},'showCustomerAvatar':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf878('0x2')],'allowNull':![],'defaultValue':_0xf878('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf878('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf878('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf878('0x2')],'defaultValue':_0xf878('0x2b')},'systemAvatar':{'type':Sequelize[_0xf878('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf878('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![],'comment':_0xf878('0x2c'),'set':function(_0x47ec1b){if(!_0x47ec1b)this[_0xf878('0x23')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xf878('0x2d'),_0x47ec1b);}},'vidaooEscalation':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf878('0x2')]},'vidaooTopic':{'type':Sequelize[_0xf878('0x2')],'allowNull':![],'defaultValue':_0xf878('0x2e')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xf878('0x2f');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf878('0x14')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf878('0x18')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 42bb5b2..6b224e0 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 _0x0058=['emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','findOne','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','agentAvatar','addCustomerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','custom','isNil','server/files/images/logos/','server/files/images/avatars/','download','customerAvatar','showCustomerAvatar','notify','user-agent-parser','headers','user-agent','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','List','applications','Applications','priority','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','lastName','x-real-port','referer','browser','version','format','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','update','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','MailAccountId','toPairsIn','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','internal','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','ONLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','Interval','Intervals','../../config/license/util','getLicense','License','increment','chatLicenseExceeded','some','readFileSync','server/files/chat/iframe.ejs','remote','stringify','x-real-ip','connection','remoteAddress','virtual','alignment','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','json','getApplications','chatProactiveAction','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','false','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0058,0x129));var _0x8005=function(_0x21a5c8,_0x164ac7){_0x21a5c8=_0x21a5c8-0x0;var _0x1647a7=_0x0058[_0x21a5c8];return _0x1647a7;};'use strict';var BPromise=require(_0x8005('0x0'));var Mustache=require(_0x8005('0x1'));var util=require(_0x8005('0x2'));var path=require(_0x8005('0x3'));var ejs=require(_0x8005('0x4'));var fs=require('fs');var fs_extra=require(_0x8005('0x5'));var _=require('lodash');var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0x8005('0x6'));var logger=require('../../config/logger')(_0x8005('0x7'));var config=require(_0x8005('0x8'));var db=require('../../mysqldb')['db'];config[_0x8005('0x9')]=_[_0x8005('0xa')](config[_0x8005('0x9')],{'host':_0x8005('0xb'),'port':0x18eb});var socket=require(_0x8005('0xc'))(new Redis(config[_0x8005('0x9')]));require(_0x8005('0xd'))[_0x8005('0xe')](socket);var htmlToText=require(_0x8005('0xf'));var jayson=require(_0x8005('0x10'));var client=jayson[_0x8005('0x11')][_0x8005('0x12')]({'port':0x232c});var client9002=jayson[_0x8005('0x11')]['http']({'port':0x232a});var client9003=jayson[_0x8005('0x11')][_0x8005('0x12')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x5ea0bb,_0x2138d1,_0x1e17eb,_0x44d11b){return new BPromise(function(_0x474426,_0x2f18c8){var _0x44003b=_0x44d11b||client;return _0x44003b[_0x8005('0x13')](_0x5ea0bb,_0x1e17eb)[_0x8005('0x14')](function(_0x97b904){logger[_0x8005('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x2138d1,'request\x20sent');logger[_0x8005('0x16')](_0x8005('0x17'),_0x2138d1,_0x8005('0x18'),JSON['stringify'](_0x97b904));if(_0x97b904[_0x8005('0x19')]){if(_0x97b904['error'][_0x8005('0x1a')]===0x1f4){logger['error'](_0x8005('0x1b'),_0x2138d1,_0x97b904[_0x8005('0x19')]['message']);return _0x2f18c8(_0x97b904['error'][_0x8005('0x1c')]);}logger['error'](_0x8005('0x1b'),_0x2138d1,_0x97b904[_0x8005('0x19')][_0x8005('0x1c')]);return _0x474426(_0x97b904[_0x8005('0x19')][_0x8005('0x1c')]);}else{logger[_0x8005('0x15')](_0x8005('0x1b'),_0x2138d1,_0x8005('0x18'));_0x474426(_0x97b904[_0x8005('0x1d')][_0x8005('0x1c')]);}})[_0x8005('0x1e')](function(_0x252df8){logger['error'](_0x8005('0x1b'),_0x2138d1,_0x252df8);_0x2f18c8(_0x252df8);});});}function respondWithStatusCode(_0x498cc4,_0x13ac76){_0x13ac76=_0x13ac76||0xcc;return function(_0x533e3d){if(_0x533e3d){return _0x498cc4[_0x8005('0x1f')](_0x13ac76);}return _0x498cc4[_0x8005('0x20')](_0x13ac76)[_0x8005('0x21')]();};}function respondWithResult(_0x52f6ba,_0x16c284){_0x16c284=_0x16c284||0xc8;return function(_0x572053){if(_0x572053){return _0x52f6ba[_0x8005('0x20')](_0x16c284)['json'](_0x572053);}};}function respondWithFilteredResult(_0xe7235c,_0x1bb31a){return function(_0x1d0213){if(_0x1d0213){var _0x2a786d=typeof _0x1bb31a[_0x8005('0x22')]===_0x8005('0x23')&&typeof _0x1bb31a[_0x8005('0x24')]===_0x8005('0x23');var _0x442ee1=_0x1d0213[_0x8005('0x25')];var _0x2d70c7=_0x2a786d?0x0:_0x1bb31a[_0x8005('0x22')];var _0x1c8bf2=_0x2a786d?_0x1d0213['count']:_0x1bb31a['offset']+_0x1bb31a[_0x8005('0x24')];var _0x5550a6;if(_0x1c8bf2>=_0x442ee1){_0x1c8bf2=_0x442ee1;_0x5550a6=0xc8;}else{_0x5550a6=0xce;}_0xe7235c[_0x8005('0x20')](_0x5550a6);return _0xe7235c[_0x8005('0x26')](_0x8005('0x27'),_0x2d70c7+'-'+_0x1c8bf2+'/'+_0x442ee1)['json'](_0x1d0213);}return null;};}function saveUpdates(_0x2ecc95){return function(_0xe2813b){if(_0xe2813b){return _0xe2813b['update'](_0x2ecc95)[_0x8005('0x14')](function(_0x2fbb7d){return _0x2fbb7d;});}return null;};}function removeEntity(_0x14fe1f){return function(_0x2ccb72){if(_0x2ccb72){return _0x2ccb72[_0x8005('0x28')]()[_0x8005('0x14')](function(){var _0x384d64=_0x2ccb72[_0x8005('0x29')]({'plain':!![]});var _0x2e3bc5='ChatWebsites';return db[_0x8005('0x2a')][_0x8005('0x28')]({'where':{'type':_0x2e3bc5,'resourceId':_0x384d64['id']}})[_0x8005('0x14')](function(){return _0x2ccb72;});})[_0x8005('0x14')](function(){_0x14fe1f[_0x8005('0x20')](0xcc)[_0x8005('0x21')]();});}};}function handleEntityNotFound(_0x1e7138){return function(_0x3b51b2){if(!_0x3b51b2){_0x1e7138[_0x8005('0x1f')](0x194);}return _0x3b51b2;};}function handleError(_0x35f040,_0xdc9501){_0xdc9501=_0xdc9501||0x1f4;return function(_0x2b05f4){logger[_0x8005('0x19')](_0x2b05f4[_0x8005('0x2b')]);if(_0x2b05f4[_0x8005('0x2c')]){delete _0x2b05f4[_0x8005('0x2c')];}_0x35f040[_0x8005('0x20')](_0xdc9501)[_0x8005('0x2d')](_0x2b05f4);};}exports[_0x8005('0x2e')]=function(_0xdb4c12,_0x57c23c){var _0x1b72fc={'include':[{'model':db[_0x8005('0x2f')],'as':_0x8005('0x30')}]},_0x2a649c={},_0x598c45={'count':0x0,'rows':[]};var _0x1b9ae1=_['map'](db[_0x8005('0x31')][_0x8005('0x32')],function(_0x4c3b88){return{'name':_0x4c3b88['fieldName'],'type':_0x4c3b88['type'][_0x8005('0x33')]};});_0x2a649c[_0x8005('0x34')]=_[_0x8005('0x35')](_0x1b9ae1,'name');_0x2a649c[_0x8005('0x36')]=_['keys'](_0xdb4c12[_0x8005('0x36')]);_0x2a649c[_0x8005('0x37')]=_['intersection'](_0x2a649c['model'],_0x2a649c[_0x8005('0x36')]);_0x1b72fc[_0x8005('0x38')]=_[_0x8005('0x39')](_0x2a649c[_0x8005('0x34')],qs[_0x8005('0x3a')](_0xdb4c12[_0x8005('0x36')][_0x8005('0x3a')]));_0x1b72fc[_0x8005('0x38')]=_0x1b72fc[_0x8005('0x38')][_0x8005('0x3b')]?_0x1b72fc[_0x8005('0x38')]:_0x2a649c['model'];if(!_0xdb4c12['query'][_0x8005('0x3c')](_0x8005('0x3d'))){_0x1b72fc[_0x8005('0x24')]=qs[_0x8005('0x24')](_0xdb4c12[_0x8005('0x36')][_0x8005('0x24')]);_0x1b72fc[_0x8005('0x22')]=qs[_0x8005('0x22')](_0xdb4c12[_0x8005('0x36')][_0x8005('0x22')]);}_0x1b72fc[_0x8005('0x3e')]=qs[_0x8005('0x3f')](_0xdb4c12[_0x8005('0x36')][_0x8005('0x3f')]);_0x1b72fc[_0x8005('0x40')]=qs[_0x8005('0x37')](_[_0x8005('0x41')](_0xdb4c12['query'],_0x2a649c[_0x8005('0x37')]),_0x1b9ae1);if(_0xdb4c12['query'][_0x8005('0x42')]){_0x1b72fc[_0x8005('0x40')]=_['merge'](_0x1b72fc[_0x8005('0x40')],{'$or':_[_0x8005('0x35')](_0x1b9ae1,function(_0x447022){if(_0x447022[_0x8005('0x43')]!==_0x8005('0x44')){var _0x7858bb={};_0x7858bb[_0x447022[_0x8005('0x2c')]]={'$like':'%'+_0xdb4c12[_0x8005('0x36')]['filter']+'%'};return _0x7858bb;}})});}_0x1b72fc=_[_0x8005('0x45')]({},_0x1b72fc,_0xdb4c12[_0x8005('0x46')]);var _0x265d3b={'where':_0x1b72fc[_0x8005('0x40')]};return db[_0x8005('0x31')]['count'](_0x265d3b)[_0x8005('0x14')](function(_0xa22c9f){_0x598c45[_0x8005('0x25')]=_0xa22c9f;if(_0xdb4c12[_0x8005('0x36')][_0x8005('0x47')]){_0x1b72fc[_0x8005('0x48')]=[{'all':!![]}];}return db[_0x8005('0x31')][_0x8005('0x49')](_0x1b72fc);})[_0x8005('0x14')](function(_0x104ad1){_0x598c45[_0x8005('0x4a')]=_0x104ad1;return _0x598c45;})[_0x8005('0x14')](respondWithFilteredResult(_0x57c23c,_0x1b72fc))['catch'](handleError(_0x57c23c,null));};exports['show']=function(_0x46756d,_0x503ac8){var _0x570a77={'raw':![],'where':{'id':_0x46756d['params']['id']},'include':[{'model':db[_0x8005('0x2f')],'as':_0x8005('0x30')}]},_0x2f6271={};_0x2f6271[_0x8005('0x34')]=_[_0x8005('0x4b')](db[_0x8005('0x31')][_0x8005('0x32')]);_0x2f6271['query']=_[_0x8005('0x4b')](_0x46756d[_0x8005('0x36')]);_0x2f6271[_0x8005('0x37')]=_['intersection'](_0x2f6271['model'],_0x2f6271[_0x8005('0x36')]);_0x570a77[_0x8005('0x38')]=_[_0x8005('0x39')](_0x2f6271['model'],qs[_0x8005('0x3a')](_0x46756d[_0x8005('0x36')]['fields']));_0x570a77[_0x8005('0x38')]=_0x570a77['attributes'][_0x8005('0x3b')]?_0x570a77['attributes']:_0x2f6271['model'];if(_0x46756d[_0x8005('0x36')][_0x8005('0x47')]){_0x570a77[_0x8005('0x48')]=[{'all':!![]}];}_0x570a77=_[_0x8005('0x45')]({},_0x570a77,_0x46756d[_0x8005('0x46')]);return db[_0x8005('0x31')][_0x8005('0x4c')](_0x570a77)[_0x8005('0x14')](handleEntityNotFound(_0x503ac8,null))['then'](respondWithResult(_0x503ac8,null))['catch'](handleError(_0x503ac8,null));};exports[_0x8005('0x4d')]=function(_0x186f08,_0x55759d){return db[_0x8005('0x31')]['create'](_0x186f08[_0x8005('0x4e')],{})[_0x8005('0x14')](function(_0x24f844){var _0x4f7f22=_0x186f08[_0x8005('0x4f')][_0x8005('0x29')]({'plain':!![]});if(!_0x4f7f22)throw new Error(_0x8005('0x50'));if(_0x4f7f22[_0x8005('0x51')]==='user'){var _0x2bee05=_0x24f844[_0x8005('0x29')]({'plain':!![]});var _0x4d2f7d=_0x8005('0x52');return db[_0x8005('0x53')]['find']({'where':{'name':_0x4d2f7d,'userProfileId':_0x4f7f22[_0x8005('0x54')]},'raw':!![]})[_0x8005('0x14')](function(_0xe64dff){if(_0xe64dff&&_0xe64dff[_0x8005('0x55')]===0x0){return db[_0x8005('0x2a')][_0x8005('0x4d')]({'name':_0x2bee05['name'],'resourceId':_0x2bee05['id'],'type':_0xe64dff['name'],'sectionId':_0xe64dff['id']},{})['then'](function(){return _0x24f844;});}else{return _0x24f844;}})['catch'](function(_0x31661f){logger['error'](_0x8005('0x56'),_0x31661f);throw _0x31661f;});}return _0x24f844;})[_0x8005('0x14')](respondWithResult(_0x55759d,0xc9))[_0x8005('0x1e')](handleError(_0x55759d,null));};exports['update']=function(_0x49d2ee,_0x2dd9a6){if(_0x49d2ee[_0x8005('0x4e')]['id']){delete _0x49d2ee[_0x8005('0x4e')]['id'];}return db[_0x8005('0x31')]['find']({'where':{'id':_0x49d2ee[_0x8005('0x57')]['id']},'include':[{'model':db[_0x8005('0x2f')],'as':'mandatoryDispositionPause'}]})[_0x8005('0x14')](handleEntityNotFound(_0x2dd9a6,null))[_0x8005('0x14')](saveUpdates(_0x49d2ee['body'],null))[_0x8005('0x14')](respondWithResult(_0x2dd9a6,null))[_0x8005('0x1e')](handleError(_0x2dd9a6,null));};exports[_0x8005('0x28')]=function(_0x273d4f,_0x1430a5){return db[_0x8005('0x31')][_0x8005('0x4c')]({'where':{'id':_0x273d4f[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x1430a5,null))[_0x8005('0x14')](removeEntity(_0x1430a5,null))[_0x8005('0x1e')](handleError(_0x1430a5,null));};exports[_0x8005('0x58')]=function(_0x38123f,_0x4b18e5){return db[_0x8005('0x31')][_0x8005('0x58')]()[_0x8005('0x14')](respondWithResult(_0x4b18e5,null))[_0x8005('0x1e')](handleError(_0x4b18e5,null));};exports[_0x8005('0x59')]=function(_0x14490a,_0x343ecc){if(_0x14490a['body']['id']){delete _0x14490a[_0x8005('0x4e')]['id'];}return db[_0x8005('0x31')]['find']({'where':{'id':_0x14490a['params']['id']}})['then'](handleEntityNotFound(_0x343ecc,null))[_0x8005('0x14')](function(_0x5ef6e8){if(_0x5ef6e8){_0x14490a[_0x8005('0x4e')][_0x8005('0x5a')]=_0x5ef6e8['id'];return db['Disposition']['create'](_0x14490a[_0x8005('0x4e')]);}})['then'](respondWithResult(_0x343ecc,null))[_0x8005('0x1e')](handleError(_0x343ecc,null));};exports['getDispositions']=function(_0xeaf8b9,_0x5d680f){var _0x30da28={'raw':![],'where':{}};var _0x536c5e={};var _0x1e1879={'count':0x0,'rows':[]};return db[_0x8005('0x31')][_0x8005('0x5b')]({'where':{'id':_0xeaf8b9[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x5d680f,null))[_0x8005('0x14')](function(_0x435690){if(_0x435690){_0x536c5e['model']=_['keys'](db[_0x8005('0x5c')][_0x8005('0x32')]);_0x536c5e[_0x8005('0x36')]=_[_0x8005('0x4b')](_0xeaf8b9[_0x8005('0x36')]);_0x536c5e[_0x8005('0x37')]=_[_0x8005('0x39')](_0x536c5e['model'],_0x536c5e[_0x8005('0x36')]);_0x30da28[_0x8005('0x38')]=_['intersection'](_0x536c5e[_0x8005('0x34')],qs[_0x8005('0x3a')](_0xeaf8b9[_0x8005('0x36')][_0x8005('0x3a')]));_0x30da28[_0x8005('0x38')]=_0x30da28['attributes']['length']?_0x30da28[_0x8005('0x38')]:_0x536c5e[_0x8005('0x34')];if(!_0xeaf8b9[_0x8005('0x36')][_0x8005('0x3c')](_0x8005('0x3d'))){_0x30da28['limit']=qs[_0x8005('0x24')](_0xeaf8b9[_0x8005('0x36')][_0x8005('0x24')]);_0x30da28[_0x8005('0x22')]=qs[_0x8005('0x22')](_0xeaf8b9['query'][_0x8005('0x22')]);}_0x30da28['order']=qs[_0x8005('0x3f')](_0xeaf8b9[_0x8005('0x36')][_0x8005('0x3f')]);_0x30da28['where']=qs[_0x8005('0x37')](_['pick'](_0xeaf8b9[_0x8005('0x36')],_0x536c5e['filters']));_0x30da28[_0x8005('0x40')][_0x8005('0x5a')]=_0x435690['id'];if(_0xeaf8b9[_0x8005('0x36')][_0x8005('0x42')]){_0x30da28[_0x8005('0x40')]=_[_0x8005('0x45')](_0x30da28[_0x8005('0x40')],{'$or':_[_0x8005('0x35')](_0x30da28[_0x8005('0x38')],function(_0x543d22){var _0x5972d3={};_0x5972d3[_0x543d22]={'$like':'%'+_0xeaf8b9[_0x8005('0x36')][_0x8005('0x42')]+'%'};return _0x5972d3;})});}_0x30da28=_[_0x8005('0x45')]({},_0x30da28,_0xeaf8b9[_0x8005('0x46')]);return db[_0x8005('0x5c')][_0x8005('0x25')]({'where':_0x30da28['where']})[_0x8005('0x14')](function(_0x26d713){_0x1e1879['count']=_0x26d713;if(_0xeaf8b9[_0x8005('0x36')][_0x8005('0x47')]){_0x30da28[_0x8005('0x48')]=[{'all':!![]}];}return db[_0x8005('0x5c')][_0x8005('0x49')](_0x30da28);})[_0x8005('0x14')](function(_0x106964){_0x1e1879['rows']=_0x106964;return _0x1e1879;});}})[_0x8005('0x14')](respondWithFilteredResult(_0x5d680f,_0x30da28))[_0x8005('0x1e')](handleError(_0x5d680f,null));};exports['removeDispositions']=function(_0x4f1f9a,_0x11e85b){return db[_0x8005('0x31')][_0x8005('0x4c')]({'where':{'id':_0x4f1f9a[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x11e85b,null))[_0x8005('0x14')](function(_0x3af028){if(_0x3af028){return _0x3af028[_0x8005('0x5d')](_0x4f1f9a['query'][_0x8005('0x5e')]);}})[_0x8005('0x14')](respondWithStatusCode(_0x11e85b,null))[_0x8005('0x1e')](handleError(_0x11e85b,null));};exports['addAnswer']=function(_0x209a20,_0x36ba78){if(_0x209a20[_0x8005('0x4e')]['id']){delete _0x209a20[_0x8005('0x4e')]['id'];}return db['ChatWebsite'][_0x8005('0x4c')]({'where':{'id':_0x209a20['params']['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x36ba78,null))[_0x8005('0x14')](function(_0x55e576){if(_0x55e576){_0x209a20['body'][_0x8005('0x5a')]=_0x55e576['id'];return db[_0x8005('0x5f')][_0x8005('0x4d')](_0x209a20[_0x8005('0x4e')]);}})['then'](respondWithResult(_0x36ba78,null))['catch'](handleError(_0x36ba78,null));};exports[_0x8005('0x60')]=function(_0x4b7243,_0x272514){var _0x3610e5={'raw':![],'where':{}};var _0x3992a4={};var _0xeb478f={'count':0x0,'rows':[]};return db[_0x8005('0x31')][_0x8005('0x5b')]({'where':{'id':_0x4b7243[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x272514,null))[_0x8005('0x14')](function(_0x155257){if(_0x155257){_0x3992a4[_0x8005('0x34')]=_[_0x8005('0x4b')](db[_0x8005('0x5f')][_0x8005('0x32')]);_0x3992a4[_0x8005('0x36')]=_[_0x8005('0x4b')](_0x4b7243[_0x8005('0x36')]);_0x3992a4[_0x8005('0x37')]=_['intersection'](_0x3992a4[_0x8005('0x34')],_0x3992a4[_0x8005('0x36')]);_0x3610e5[_0x8005('0x38')]=_['intersection'](_0x3992a4['model'],qs[_0x8005('0x3a')](_0x4b7243[_0x8005('0x36')][_0x8005('0x3a')]));_0x3610e5[_0x8005('0x38')]=_0x3610e5[_0x8005('0x38')]['length']?_0x3610e5[_0x8005('0x38')]:_0x3992a4[_0x8005('0x34')];if(!_0x4b7243[_0x8005('0x36')][_0x8005('0x3c')](_0x8005('0x3d'))){_0x3610e5[_0x8005('0x24')]=qs[_0x8005('0x24')](_0x4b7243[_0x8005('0x36')][_0x8005('0x24')]);_0x3610e5[_0x8005('0x22')]=qs[_0x8005('0x22')](_0x4b7243[_0x8005('0x36')][_0x8005('0x22')]);}_0x3610e5[_0x8005('0x3e')]=qs['sort'](_0x4b7243['query'][_0x8005('0x3f')]);_0x3610e5[_0x8005('0x40')]=qs[_0x8005('0x37')](_[_0x8005('0x41')](_0x4b7243[_0x8005('0x36')],_0x3992a4[_0x8005('0x37')]));_0x3610e5['where'][_0x8005('0x5a')]=_0x155257['id'];if(_0x4b7243[_0x8005('0x36')][_0x8005('0x42')]){_0x3610e5[_0x8005('0x40')]=_[_0x8005('0x45')](_0x3610e5[_0x8005('0x40')],{'$or':_[_0x8005('0x35')](_0x3610e5[_0x8005('0x38')],function(_0x2f81f3){var _0x55feb0={};_0x55feb0[_0x2f81f3]={'$like':'%'+_0x4b7243[_0x8005('0x36')][_0x8005('0x42')]+'%'};return _0x55feb0;})});}_0x3610e5=_['merge']({},_0x3610e5,_0x4b7243['options']);return db['CannedAnswer']['count']({'where':_0x3610e5['where']})['then'](function(_0x3e3853){_0xeb478f[_0x8005('0x25')]=_0x3e3853;if(_0x4b7243[_0x8005('0x36')][_0x8005('0x47')]){_0x3610e5['include']=[{'all':!![]}];}return db[_0x8005('0x5f')][_0x8005('0x49')](_0x3610e5);})[_0x8005('0x14')](function(_0x19c9ed){_0xeb478f[_0x8005('0x4a')]=_0x19c9ed;return _0xeb478f;});}})[_0x8005('0x14')](respondWithFilteredResult(_0x272514,_0x3610e5))[_0x8005('0x1e')](handleError(_0x272514,null));};exports[_0x8005('0x61')]=function(_0x5f2d06,_0x21bab1){return db['ChatWebsite'][_0x8005('0x4c')]({'where':{'id':_0x5f2d06[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x21bab1,null))[_0x8005('0x14')](function(_0x55f785){if(_0x55f785){return _0x55f785[_0x8005('0x61')](_0x5f2d06[_0x8005('0x36')]['ids']);}})['then'](respondWithStatusCode(_0x21bab1,null))[_0x8005('0x1e')](handleError(_0x21bab1,null));};exports[_0x8005('0x62')]=function(_0xa11345,_0x4647b8){_0xa11345[_0x8005('0x4e')][_0x8005('0x63')]=_0xa11345[_0x8005('0x64')]['filename'];return db['ChatWebsite'][_0x8005('0x4c')]({'where':{'id':_0xa11345[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x4647b8,null))[_0x8005('0x14')](saveUpdates(_0xa11345[_0x8005('0x4e')],null))[_0x8005('0x14')](respondWithResult(_0x4647b8,null))[_0x8005('0x1e')](handleError(_0x4647b8,null));};exports['addAvatar']=function(_0x2b68cb,_0x1c7786){_0x2b68cb['body'][_0x8005('0x65')]=_0x2b68cb[_0x8005('0x64')]['filename'];return db[_0x8005('0x31')]['find']({'where':{'id':_0x2b68cb[_0x8005('0x57')]['id']}})['then'](handleEntityNotFound(_0x1c7786,null))['then'](saveUpdates(_0x2b68cb['body'],null))[_0x8005('0x14')](respondWithResult(_0x1c7786,null))[_0x8005('0x1e')](handleError(_0x1c7786,null));};exports[_0x8005('0x66')]=function(_0x1545ea,_0x2043d5){_0x1545ea[_0x8005('0x4e')]['customerAvatar']=_0x1545ea['file'][_0x8005('0x67')];return db[_0x8005('0x31')][_0x8005('0x4c')]({'where':{'id':_0x1545ea['params']['id']}})['then'](handleEntityNotFound(_0x2043d5,null))[_0x8005('0x14')](saveUpdates(_0x1545ea[_0x8005('0x4e')],null))[_0x8005('0x14')](respondWithResult(_0x2043d5,null))[_0x8005('0x1e')](handleError(_0x2043d5,null));};exports[_0x8005('0x68')]=function(_0x1339a3,_0x1ba213){_0x1339a3['body'][_0x8005('0x69')]=_0x1339a3[_0x8005('0x64')][_0x8005('0x67')];return db[_0x8005('0x31')][_0x8005('0x4c')]({'where':{'id':_0x1339a3[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x1ba213,null))[_0x8005('0x14')](saveUpdates(_0x1339a3[_0x8005('0x4e')],null))[_0x8005('0x14')](respondWithResult(_0x1ba213,null))[_0x8005('0x1e')](handleError(_0x1ba213,null));};exports[_0x8005('0x6a')]=function(_0x30e1c1,_0x34f9e2){var _0x19857d=path[_0x8005('0x6b')](config[_0x8005('0x6c')],_0x8005('0x6d'));var _0x210076={'where':{'id':_0x30e1c1[_0x8005('0x57')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x347796=![];return require('../../config/license/util')['getLicense']()[_0x8005('0x14')](function(_0x4afa81){if(_0x4afa81){_0x347796=_0x4afa81[_0x8005('0x6e')];}})[_0x8005('0x14')](function(){return db[_0x8005('0x31')][_0x8005('0x4c')](_0x210076);})[_0x8005('0x14')](handleEntityNotFound(_0x34f9e2,null))['then'](function(_0x5e9784){if(_0x5e9784){if(!_[_0x8005('0x6f')](_0x5e9784['sitepic'])){if(fs['existsSync'](path[_0x8005('0x6b')](config[_0x8005('0x6c')],_0x8005('0x70'),_0x5e9784[_0x8005('0x63')]))&&_0x347796){_0x19857d=path['join'](config['root'],_0x8005('0x70'),_0x5e9784[_0x8005('0x63')]);}}return _0x34f9e2['download'](_0x19857d);}})[_0x8005('0x1e')](handleError(_0x34f9e2,null));};exports['getAvatar']=function(_0x4e80ec,_0x57cf23){var _0x1f353c=path[_0x8005('0x6b')](config[_0x8005('0x6c')],'server/files/images/avatars/default_avatar.png');var _0x37f9e4={'where':{'id':_0x4e80ec[_0x8005('0x57')]['id']},'attributes':['id',_0x8005('0x65')],'raw':!![]};return db['ChatWebsite'][_0x8005('0x4c')](_0x37f9e4)[_0x8005('0x14')](handleEntityNotFound(_0x57cf23,null))['then'](function(_0x11431b){if(_0x11431b){if(!_[_0x8005('0x6f')](_0x11431b[_0x8005('0x65')])){if(fs['existsSync'](path[_0x8005('0x6b')](config[_0x8005('0x6c')],_0x8005('0x71'),_0x11431b['agentAvatar']))){_0x1f353c=path[_0x8005('0x6b')](config['root'],'server/files/images/avatars/',_0x11431b['agentAvatar']);}}return _0x57cf23[_0x8005('0x72')](_0x1f353c);}})[_0x8005('0x1e')](handleError(_0x57cf23,null));};exports['getCustomerAvatar']=function(_0x610578,_0x5183b4){var _0x41355c=path[_0x8005('0x6b')](config[_0x8005('0x6c')],'server/files/images/avatars/customer_avatar.png');var _0xbf2ea6={'where':{'id':_0x610578[_0x8005('0x57')]['id']},'attributes':['id',_0x8005('0x73'),_0x8005('0x74')],'raw':!![]};return db[_0x8005('0x31')][_0x8005('0x4c')](_0xbf2ea6)[_0x8005('0x14')](handleEntityNotFound(_0x5183b4,null))['then'](function(_0x4420f5){if(_0x4420f5){if(!_['isNil'](_0x4420f5[_0x8005('0x73')])){if(fs['existsSync'](path[_0x8005('0x6b')](config['root'],_0x8005('0x71'),_0x4420f5['customerAvatar']))&&_0x4420f5['showCustomerAvatar']){_0x41355c=path[_0x8005('0x6b')](config['root'],_0x8005('0x71'),_0x4420f5[_0x8005('0x73')]);}}return _0x5183b4[_0x8005('0x72')](_0x41355c);}})[_0x8005('0x1e')](handleError(_0x5183b4,null));};exports['getSystemAvatar']=function(_0x9e70a1,_0x145a30){var _0x5b1089=path[_0x8005('0x6b')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x3002da={'where':{'id':_0x9e70a1[_0x8005('0x57')]['id']},'attributes':['id',_0x8005('0x69')],'raw':!![]};return db['ChatWebsite'][_0x8005('0x4c')](_0x3002da)[_0x8005('0x14')](handleEntityNotFound(_0x145a30,null))['then'](function(_0x4ad14f){if(_0x4ad14f){if(!_[_0x8005('0x6f')](_0x4ad14f[_0x8005('0x69')])){if(fs['existsSync'](path[_0x8005('0x6b')](config['root'],_0x8005('0x71'),_0x4ad14f[_0x8005('0x69')]))){_0x5b1089=path[_0x8005('0x6b')](config['root'],_0x8005('0x71'),_0x4ad14f[_0x8005('0x69')]);}}return _0x145a30['download'](_0x5b1089);}})[_0x8005('0x1e')](handleError(_0x145a30,null));};exports[_0x8005('0x75')]=function(_0x4eb4cf,_0xbfc925){var _0x38a5a9=require(_0x8005('0x76'));var _0x1df53d=new _0x38a5a9();var _0x53131c=_0x1df53d['setUA'](_0x4eb4cf[_0x8005('0x77')][_0x8005('0x78')])['getResult']();var _0xd1e57f={'body':_0x4eb4cf[_0x8005('0x4e')],'channel':_0x8005('0x79')};var _0x3891a5=[];var _0x4dbea5=[];var _0x425daf={};var _0x2d31b3=![];return db[_0x8005('0x7a')]['describe']()[_0x8005('0x14')](function(_0x601395){if(!_0x601395){throw new db[(_0x8005('0x7b'))][(_0x8005('0x7c'))]('no\x20available\x20attributes');}_0x3891a5=_[_0x8005('0x7d')](_[_0x8005('0x4b')](_0x601395),[_0x8005('0x7e'),_0x8005('0x7f')]);_0x4dbea5=_[_0x8005('0x7d')](_[_0x8005('0x4b')](_0x601395),[_0x8005('0x7e'),'updatedAt','CompanyId',_0x8005('0x80')]);if(_0x4eb4cf[_0x8005('0x4e')]['id']){delete _0x4eb4cf[_0x8005('0x4e')]['id'];}if(_[_0x8005('0x6f')](_0x4eb4cf[_0x8005('0x4e')][_0x8005('0x81')])){throw new db[(_0x8005('0x7b'))][(_0x8005('0x7c'))](_0x8005('0x82'));}if(_[_0x8005('0x6f')](_0x4eb4cf['body'][_0x8005('0x4e')])||_0x4eb4cf[_0x8005('0x4e')]['body']===''){throw new db[(_0x8005('0x7b'))][(_0x8005('0x7c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8005('0x6f')](_0x4eb4cf[_0x8005('0x4e')][_0x8005('0x83')])){throw new db[(_0x8005('0x7b'))][(_0x8005('0x7c'))](_0x8005('0x84')+_0x4dbea5);}if(!_[_0x8005('0x85')](_0x4dbea5,_0x4eb4cf[_0x8005('0x4e')][_0x8005('0x83')])){throw new db['Sequelize'][(_0x8005('0x7c'))](_0x8005('0x86')+_0x4dbea5);}_0x425daf[_0x4eb4cf[_0x8005('0x4e')][_0x8005('0x83')]]=_0x4eb4cf[_0x8005('0x4e')][_0x8005('0x81')];})[_0x8005('0x14')](function(){return db[_0x8005('0x31')]['find']({'where':{'id':_0x4eb4cf[_0x8005('0x57')]['id']},'include':[{'model':db[_0x8005('0x87')],'as':'List','include':[{'model':db['CmContact'],'as':_0x8005('0x88'),'where':_0x425daf,'limit':0x1,'order':[[_0x8005('0x7f'),_0x8005('0x89')]]}]},{'model':db[_0x8005('0x8a')],'as':'Applications'}]});})[_0x8005('0x14')](handleEntityNotFound(_0xbfc925,null))[_0x8005('0x14')](function(_0x9e88a4){if(_0x9e88a4&&_0x9e88a4[_0x8005('0x8b')]){_0xd1e57f['account']=_0x9e88a4;_0xd1e57f[_0x8005('0x8c')]=_0x9e88a4[_0x8005('0x8d')];_0xd1e57f['list']=_0x9e88a4[_0x8005('0x8b')];_0xd1e57f[_0x8005('0x8c')]=_['orderBy'](_0xd1e57f['applications'],[_0x8005('0x8e')],[_0x8005('0x8f')]);if(_0xd1e57f['account'][_0x8005('0x8d')]){delete _0xd1e57f['account'][_0x8005('0x8d')];}if(_0xd1e57f[_0x8005('0x90')][_0x8005('0x8b')]&&_0xd1e57f[_0x8005('0x90')][_0x8005('0x8b')][_0x8005('0x88')][_0x8005('0x3b')]){return _0xd1e57f[_0x8005('0x90')][_0x8005('0x8b')][_0x8005('0x88')][0x0];}var _0x5cc46b=_[_0x8005('0xa')](_0x4eb4cf[_0x8005('0x4e')],{'firstName':_0x4eb4cf['body'][_0x8005('0x81')],'ListId':_0x9e88a4[_0x8005('0x80')]});_0x5cc46b[_0x4eb4cf['body'][_0x8005('0x83')]]=_0x4eb4cf[_0x8005('0x4e')][_0x8005('0x81')];return db[_0x8005('0x7a')]['create'](_0x5cc46b,{'fields':_0x3891a5,'raw':!![]});}})['then'](handleEntityNotFound(_0xbfc925,null))[_0x8005('0x14')](function(_0x47f769){_0xd1e57f[_0x8005('0x91')]=_0x47f769;var _0x14e694=_0x4eb4cf[_0x8005('0x4e')][_0x8005('0x92')];if(_0x4eb4cf[_0x8005('0x77')][_0x8005('0x93')]){_0x14e694=_0x4eb4cf['headers'][_0x8005('0x93')];}else if(_0x4eb4cf['headers'][_0x8005('0x94')]){_0x14e694=_[_0x8005('0x95')](_0x4eb4cf[_0x8005('0x77')][_0x8005('0x94')]['split'](','));}if(_0x47f769){var _0x3dc2f7={'ContactId':_0x47f769['id'],'ChatWebsiteId':_0x4eb4cf[_0x8005('0x57')]['id'],'from':(_0x47f769['firstName']||'')+'\x20'+(_0x47f769[_0x8005('0x96')]||''),'customerIp':_0x14e694,'customerPort':_0x4eb4cf[_0x8005('0x77')][_0x8005('0x97')]?_0x4eb4cf[_0x8005('0x77')][_0x8005('0x97')]:null,'referer':_0x4eb4cf[_0x8005('0x4e')][_0x8005('0x98')],'browserName':_0x53131c[_0x8005('0x99')][_0x8005('0x2c')]&&_0x53131c[_0x8005('0x99')][_0x8005('0x9a')]?util[_0x8005('0x9b')]('%s\x20%s',_0x53131c[_0x8005('0x99')][_0x8005('0x2c')],_0x53131c[_0x8005('0x99')][_0x8005('0x9a')]):_0x8005('0x9c'),'browserVersion':_0x53131c[_0x8005('0x99')]['version']||_0x8005('0x9c'),'osName':util[_0x8005('0x9b')]('%s\x20%s',_0x53131c['os'][_0x8005('0x2c')],_0x53131c['os'][_0x8005('0x9a')]),'osVersion':_0x53131c['os'][_0x8005('0x9a')],'deviceModel':_0x53131c[_0x8005('0x9d')][_0x8005('0x34')]&&_0x53131c[_0x8005('0x9d')][_0x8005('0x9e')]?util[_0x8005('0x9b')](_0x8005('0x9f'),_0x53131c[_0x8005('0x9d')][_0x8005('0x34')],_0x53131c[_0x8005('0x9d')]['vendor'],_0x53131c['device'][_0x8005('0x43')]):null,'deviceVendor':_0x53131c[_0x8005('0x9d')][_0x8005('0x9e')],'deviceType':_0x53131c[_0x8005('0x9d')][_0x8005('0x43')],'formData':JSON['stringify'](_0x4eb4cf[_0x8005('0x4e')])};var _0x2a6fed={'ChatWebsiteId':_0x4eb4cf[_0x8005('0x57')]['id'],'closed':![]};if(_0x4eb4cf[_0x8005('0x4e')][_0x8005('0xa0')]){_0x2a6fed[_0x8005('0xa0')]=_0x4eb4cf[_0x8005('0x4e')][_0x8005('0xa0')];return db[_0x8005('0xa1')]['find']({'where':_0x2a6fed})[_0x8005('0x14')](function(_0x1e379b){if(_0x1e379b){return[_0x1e379b,![]];}_0x3dc2f7[_0x8005('0xa0')]=_0x4eb4cf[_0x8005('0x4e')][_0x8005('0xa0')];_0x3dc2f7[_0x8005('0xa2')]=_0x4eb4cf[_0x8005('0x4e')]['externalUrl'];return db['ChatInteraction']['create'](_0x3dc2f7)['then'](function(_0x1f24d7){return[_0x1f24d7,!![]];});});}_0x2a6fed[_0x8005('0xa3')]=_0x47f769['id'];if(_0x4eb4cf[_0x8005('0x4e')][_0x8005('0xa4')]&&_0x4eb4cf[_0x8005('0x4e')][_0x8005('0xa4')]['id']){_0x2a6fed['id']=_0x4eb4cf[_0x8005('0x4e')][_0x8005('0xa4')]['id'];return db['ChatInteraction']['find']({'where':_0x2a6fed})[_0x8005('0x14')](function(_0x13d3e2){if(_0x13d3e2){return[_0x13d3e2,![]];}return db[_0x8005('0xa1')]['create'](_0x3dc2f7)[_0x8005('0x14')](function(_0x329a09){return[_0x329a09,!![]];});});}return db[_0x8005('0xa1')]['create'](_0x3dc2f7)[_0x8005('0x14')](function(_0x295ebf){return[_0x295ebf,!![]];});}})[_0x8005('0xa5')](function(_0x1f526f,_0x1df7d1){if(_0x1f526f){_0x2d31b3=_0x1df7d1;if(!_0x1df7d1){var _0x5248a2={'from':(_0xd1e57f[_0x8005('0x91')][_0x8005('0xa6')]||'')+'\x20'+(_0xd1e57f[_0x8005('0x91')][_0x8005('0x96')]||'')};if(_0x4eb4cf['body'][_0x8005('0xa0')]&&_0x4eb4cf['body'][_0x8005('0xa7')]&&_0x4eb4cf[_0x8005('0x4e')]['threadId']!=_0x4eb4cf[_0x8005('0x4e')][_0x8005('0xa7')]){_0x5248a2[_0x8005('0xa0')]=_0x4eb4cf[_0x8005('0x4e')][_0x8005('0xa7')];}return _0x1f526f[_0x8005('0xa8')](_0x5248a2);}else{return _0x1f526f;}}})[_0x8005('0x14')](function(_0x504920){_0xd1e57f[_0x8005('0xa4')]=_0x504920[_0x8005('0x29')]({'plain':!![]});_0xd1e57f[_0x8005('0xa4')]['created']=_0x2d31b3;if(_0xd1e57f[_0x8005('0xa4')][_0x8005('0xa9')]){if(_0xd1e57f[_0x8005('0x90')][_0x8005('0xaa')]){_0xd1e57f[_0x8005('0x8c')][_0x8005('0xab')]({'id':0x0,'priority':_0xd1e57f[_0x8005('0x8c')]['length']+0x1,'app':_0x8005('0xac'),'appdata':_0x8005('0xad'),'interval':_0x8005('0xae')});}}return db[_0x8005('0xaf')][_0x8005('0x4d')]({'body':_0x4eb4cf[_0x8005('0x4e')]['body'],'ChatWebsiteId':_0x4eb4cf[_0x8005('0x57')]['id'],'ChatInteractionId':_0x504920['id'],'direction':'in','ContactId':_0xd1e57f[_0x8005('0x91')]['id'],'AttachmentId':_0x4eb4cf['body']['AttachmentId']});})[_0x8005('0x14')](function(_0x472697){_0xd1e57f[_0x8005('0x1c')]=_0x472697;if(_0xd1e57f[_0x8005('0xa4')][_0x8005('0xb0')]){return db[_0x8005('0xb1')]['find']({'attributes':['id',_0x8005('0x2c')],'where':{'id':_0xd1e57f[_0x8005('0xa4')][_0x8005('0xb0')]}})[_0x8005('0x14')](function(_0x51ea51){if(_0x51ea51){_0xd1e57f['applications'][_0x8005('0xb2')]({'id':0x0,'priority':0x0,'app':_0x8005('0xb3'),'appdata':_0x51ea51[_0x8005('0x2c')]+','+(_0xd1e57f['account'][_0x8005('0xb4')]||0xa),'interval':_0x8005('0xae')});_0xd1e57f[_0x8005('0xb5')]=!![];}return respondWithRpcPromise(_0x8005('0xb6'),_0x8005('0xb7'),_0xd1e57f);});}return respondWithRpcPromise('Start',_0x8005('0xb7'),_0xd1e57f);})[_0x8005('0x14')](function(_0x44d5e9){respondWithRpcPromise(_0x8005('0xb8'),_0x8005('0xb8'),{'event':'notify','message':_0x44d5e9},client9002);return _0x44d5e9;})[_0x8005('0x14')](respondWithResult(_0xbfc925,null))[_0x8005('0x1e')](handleError(_0xbfc925,null));};exports[_0x8005('0xb9')]=function(_0x2d211c,_0x47a2e6){var _0x527abb,_0x564255,_0x40b86f;var _0x18ec12=[];var _0x24fa5f={};var _0x387b52=_0x2d211c[_0x8005('0xba')]||[];var _0x4ab1bd=[];var _0x574b9a;return db[_0x8005('0x7a')][_0x8005('0x58')]()[_0x8005('0x14')](function(_0x245f37){if(!_0x245f37){throw new db[(_0x8005('0x7b'))][(_0x8005('0x7c'))]('no\x20available\x20attributes');}_0x18ec12=_[_0x8005('0x7d')](_[_0x8005('0x4b')](_0x245f37),['createdAt',_0x8005('0x7f'),'CompanyId',_0x8005('0x80')]);if(_0x2d211c[_0x8005('0x4e')]['id']){delete _0x2d211c['body']['id'];}if(_[_0x8005('0x6f')](_0x2d211c['body'][_0x8005('0x81')])){throw _0x47a2e6[_0x8005('0x20')](0x1f4)['send'](new db['Sequelize'][(_0x8005('0x7c'))](_0x8005('0x82')));}if(_['isNil'](_0x2d211c['body'][_0x8005('0x4e')])||_0x2d211c['body']['body']===''){throw _0x47a2e6[_0x8005('0x20')](0x1f4)['send'](new db[(_0x8005('0x7b'))][(_0x8005('0x7c'))](_0x8005('0xbb')));}if(_[_0x8005('0x6f')](_0x2d211c[_0x8005('0x4e')][_0x8005('0xbc')])){throw _0x47a2e6[_0x8005('0x20')](0x1f4)[_0x8005('0x2d')](new db[(_0x8005('0x7b'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x18ec12));}if(!_['includes'](_0x18ec12,_0x2d211c[_0x8005('0x4e')][_0x8005('0xbc')])){throw _0x47a2e6[_0x8005('0x20')](0x1f4)[_0x8005('0x2d')](new db[(_0x8005('0x7b'))][(_0x8005('0x7c'))](_0x8005('0xbd')+_0x18ec12));}_0x24fa5f[_0x2d211c[_0x8005('0x4e')][_0x8005('0xbc')]]=_0x2d211c['body'][_0x8005('0x81')];})[_0x8005('0x14')](function(){return db[_0x8005('0x31')][_0x8005('0x4c')]({'where':{'id':_0x2d211c[_0x8005('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0x8005('0x8b')},{'model':db[_0x8005('0xbe')],'as':'MailAccount'}]});})[_0x8005('0x14')](handleEntityNotFound(_0x47a2e6,null))[_0x8005('0x14')](function(_0x26136a){if(_0x26136a&&_0x26136a[_0x8005('0x8b')]){_0x564255=_0x26136a;var _0x15bc5f=_[_0x8005('0xa')](_0x2d211c[_0x8005('0x4e')],{'firstName':_0x2d211c['body'][_0x8005('0x81')],'phone':_0x2d211c[_0x8005('0x4e')][_0x8005('0x81')],'ListId':_0x26136a[_0x8005('0x80')]});_0x15bc5f[_0x2d211c[_0x8005('0x4e')][_0x8005('0xbc')]]=_0x2d211c[_0x8005('0x4e')]['from'];return db[_0x8005('0x7a')]['findOrCreate']({'where':_0x24fa5f,'defaults':_0x15bc5f});}})[_0x8005('0xa5')](function(_0x106eeb){if(_0x106eeb){_0x40b86f=_0x106eeb;var _0x4604f1=fs['readFileSync'](path[_0x8005('0x6b')](config[_0x8005('0x6c')],_0x8005('0xbf')),_0x8005('0xc0'));var _0x5e86b6=ejs[_0x8005('0xc1')](_0x4604f1,{'body':_[_0x8005('0xc2')](_0x2d211c['body'][_0x8005('0x4e')]),'bodyTitle':_0x564255['offlineMessageBody']});return db[_0x8005('0xc3')][_0x8005('0x4d')]({'body':_0x5e86b6,'plainBody':htmlToText[_0x8005('0xc4')](_0x5e86b6),'ContactId':_0x106eeb['id'],'ChatWebsiteId':_0x564255['id']});}})[_0x8005('0x14')](function(_0x2230a0){_0x574b9a=_0x2230a0;if(_0x387b52[_0x8005('0x3b')]){var _0x36f6f8=_0x387b52['map'](function(_0x29b0e5){return{'name':_0x29b0e5[_0x8005('0xc5')],'basename':_0x29b0e5['filename'],'type':_0x29b0e5[_0x8005('0xc6')],'ChatOfflineMessageId':_0x2230a0['id']};});_0x4ab1bd=_0x36f6f8[_0x8005('0x35')](_0x30ab9a=>{var _0x10a5dc={'filename':_0x30ab9a[_0x8005('0x2c')],'path':path[_0x8005('0x6b')](config[_0x8005('0x6c')],_0x8005('0xc7'),_0x8005('0xba'),_0x8005('0xc8'),_0x8005('0xc9'),_0x30ab9a[_0x8005('0xca')])};return _0x10a5dc;});if(!_0x564255[_0x8005('0xcb')]){return db['sequelize'][_0x8005('0xcc')](function(_0x4302f7){return db[_0x8005('0xcd')][_0x8005('0xce')](_0x36f6f8,{'transaction':_0x4302f7});});}}})['then'](function(){if(_0x574b9a){_0x527abb=_0x574b9a;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x8005('0xcf')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x8005('0xd0')],'as':_0x8005('0xd0'),'raw':!![]}]}]});}})[_0x8005('0x14')](function(_0x2b28f5){if(_0x2b28f5&&_0x2b28f5[_0x8005('0xd1')]&&_0x564255[_0x8005('0xd2')]&&_0x564255['forwardOfflineAddress']){var _0xd2bcf3=_0x2b28f5[_0x8005('0xd3')]();return respondWithRpcPromise(_0x8005('0xd4'),_0x8005('0xd5'),{'account':_0xd2bcf3,'message':{'from':util[_0x8005('0x9b')](_0x8005('0xd6'),_0x2b28f5[_0x8005('0x2c')],_0x2b28f5[_0x8005('0xd7')]||_0x2b28f5[_0x8005('0xd1')]['user']),'to':_0x564255[_0x8005('0xd8')],'subject':_0x564255['offlineMessageSubject'],'html':_0x527abb[_0x8005('0x4e')],'attachments':_0x4ab1bd}},client9003)[_0x8005('0x14')](function(){return _0x527abb;})[_0x8005('0x1e')](function(_0x14311f){logger[_0x8005('0x19')](_0x14311f);});}})[_0x8005('0x14')](function(){if(_0x564255&&_0x564255[_0x8005('0xcb')]&&_0x564255[_0x8005('0xd9')]){var _0x50475c=[];if(_0x387b52[_0x8005('0x3b')]){_0x50475c=_0x387b52[_0x8005('0x35')](function(_0x3a0f5a){return{'name':_0x3a0f5a['originalname'],'basename':_0x3a0f5a[_0x8005('0x67')],'type':_0x3a0f5a[_0x8005('0xc6')],'ChatOfflineMessageId':_0x574b9a['id']};});}var _0x2137c0;if(!_[_0x8005('0x6f')](_0x564255['subjectOffline'])){var _0x53744f=_[_0x8005('0x35')](_0x2d211c[_0x8005('0x4e')],function(_0xa8f330){return _0xa8f330;});var _0x2c473f=_[_0x8005('0xda')](_0x53744f)[0x0];var _0x48eec5=_[_0x8005('0xdb')](_0x2c473f,function(_0x43b723){return _0x43b723;});_0x2137c0=_0x48eec5[0x1][_0x564255['subjectOffline']];}var _0x34c93={'from':_0x40b86f[_0x8005('0xd7')],'firstName':_0x40b86f[_0x8005('0xa6')],'lastName':_0x40b86f[_0x8005('0x96')],'mapKey':_0x8005('0xd7'),'message':{'from':_0x40b86f['email'],'to':_0x564255[_0x8005('0xbe')][_0x8005('0xd7')],'cc':'','subject':_[_0x8005('0x6f')](_0x2137c0)?_0x564255['offlineMessageSubject']:_0x2137c0,'messageId':'','sentAt':new Date(),'attach':_0x50475c[_0x8005('0x3b')],'attachments':_0x50475c,'originChannel':'Chat','ChatWebsiteId':_0x564255['id'],'ChatOfflineMessageId':_0x527abb['id'],'originTo':_0x564255[_0x8005('0xbe')][_0x8005('0xd7')]},'body':_0x527abb[_0x8005('0x4e')]};var _0x4a3744={'account':{'id':_0x564255[_0x8005('0xd9')]},'body':_0x34c93,'log':_0x8005('0xdc')};return respondWithRpcPromise('NotifyMailAccount',_0x8005('0xdd'),_0x4a3744,client9001)['then'](function(){return _0x527abb;})['catch'](function(_0x16e51b){logger[_0x8005('0x19')](_0x16e51b);});}return;})[_0x8005('0x14')](function(){if(_0x527abb){return _0x527abb;}})['then'](respondWithResult(_0x47a2e6,null))['catch'](function(_0x557157){logger[_0x8005('0x19')](_0x8005('0x1e'),_0x557157);for(var _0x21a879 of _0x387b52){var _0x19c4dd=path[_0x8005('0x6b')](config[_0x8005('0x6c')],_0x8005('0xc7'),_0x8005('0xba'),'attachments',_0x8005('0xc9'),_0x21a879[_0x8005('0x67')]);fs_extra[_0x8005('0xde')](_0x19c4dd)[_0x8005('0x1e')](function(_0x21ba00){logger[_0x8005('0x19')](_0x8005('0xdf'),_0x19c4dd,_0x21ba00);});}});};exports[_0x8005('0xe0')]=function(_0x488a47,_0x352238){return db['ChatInteraction'][_0x8005('0x4c')]({'where':{'id':_0x488a47[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x352238,null))[_0x8005('0x14')](function(_0x2eef53){if(_0x2eef53){return _0x2eef53[_0x8005('0xe0')](_0x488a47['body'][_0x8005('0x5e')],_[_0x8005('0xe1')](_0x488a47[_0x8005('0x4e')],[_0x8005('0x5e'),'id'])||{});}})[_0x8005('0x14')](respondWithResult(_0x352238,null))[_0x8005('0x1e')](handleError(_0x352238,null));};exports[_0x8005('0xe2')]=function(_0x5d1552,_0x4f71a4){var _0x52ed50={'raw':![],'where':{}};var _0x1c6252={};var _0x278214={'count':0x0,'rows':[]};return db[_0x8005('0x31')][_0x8005('0x5b')]({'where':{'id':_0x5d1552[_0x8005('0x57')]['id']}})['then'](handleEntityNotFound(_0x4f71a4,null))[_0x8005('0x14')](function(_0x19c2db){if(_0x19c2db){_0x1c6252[_0x8005('0x34')]=_[_0x8005('0x4b')](db[_0x8005('0xa1')][_0x8005('0x32')]);_0x1c6252[_0x8005('0x36')]=_[_0x8005('0x4b')](_0x5d1552[_0x8005('0x36')]);_0x1c6252[_0x8005('0x37')]=_[_0x8005('0x39')](_0x1c6252[_0x8005('0x34')],_0x1c6252[_0x8005('0x36')]);_0x52ed50[_0x8005('0x38')]=_['intersection'](_0x1c6252[_0x8005('0x34')],qs[_0x8005('0x3a')](_0x5d1552[_0x8005('0x36')][_0x8005('0x3a')]));_0x52ed50[_0x8005('0x38')]=_0x52ed50[_0x8005('0x38')][_0x8005('0x3b')]?_0x52ed50['attributes']:_0x1c6252[_0x8005('0x34')];if(!_0x5d1552['query']['hasOwnProperty'](_0x8005('0x3d'))){_0x52ed50['limit']=qs[_0x8005('0x24')](_0x5d1552[_0x8005('0x36')][_0x8005('0x24')]);_0x52ed50[_0x8005('0x22')]=qs[_0x8005('0x22')](_0x5d1552[_0x8005('0x36')][_0x8005('0x22')]);}_0x52ed50['order']=qs[_0x8005('0x3f')](_0x5d1552[_0x8005('0x36')][_0x8005('0x3f')]);_0x52ed50[_0x8005('0x40')]=qs['filters'](_[_0x8005('0x41')](_0x5d1552[_0x8005('0x36')],_0x1c6252[_0x8005('0x37')]));_0x52ed50[_0x8005('0x40')][_0x8005('0x5a')]=_0x19c2db['id'];if(_0x5d1552['query'][_0x8005('0x42')]){_0x52ed50[_0x8005('0x40')]=_[_0x8005('0x45')](_0x52ed50['where'],{'$or':_[_0x8005('0x35')](_0x52ed50['attributes'],function(_0x33a4a9){var _0x48d7b2={};_0x48d7b2[_0x33a4a9]={'$like':'%'+_0x5d1552['query']['filter']+'%'};return _0x48d7b2;})});}_0x52ed50=_[_0x8005('0x45')]({},_0x52ed50,_0x5d1552['options']);return db[_0x8005('0xa1')]['count']({'where':_0x52ed50['where']})[_0x8005('0x14')](function(_0x408d9c){_0x278214[_0x8005('0x25')]=_0x408d9c;if(_0x5d1552['query'][_0x8005('0x47')]){_0x52ed50[_0x8005('0x48')]=[{'model':db[_0x8005('0x7a')],'as':_0x8005('0xe3'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name','fullname',_0x8005('0xe4')],'required':![]},{'model':db['Tag'],'as':_0x8005('0xe5'),'attributes':['id',_0x8005('0x2c'),_0x8005('0xe6')],'where':_0x5d1552[_0x8005('0x36')][_0x8005('0xe7')]?{'id':_0x5d1552[_0x8005('0x36')][_0x8005('0xe7')]}:undefined,'required':_0x5d1552['query'][_0x8005('0xe7')]?!![]:![]}];}return db[_0x8005('0xa1')][_0x8005('0x49')](_0x52ed50);})[_0x8005('0x14')](function(_0x5f2b82){_0x278214[_0x8005('0x4a')]=_0x5f2b82;return _0x278214;});}})[_0x8005('0x14')](respondWithFilteredResult(_0x4f71a4,_0x52ed50))['catch'](handleError(_0x4f71a4,null));};function iftimePromise(_0x5f236b,_0x11fb7e){return respondWithRpcPromise(_0x8005('0xe8'),_0x8005('0xe9'),{'command':_0x11fb7e[_0x8005('0xea')]?util['format']('iftime\x20%s,%s',_0x5f236b[_0x8005('0xeb')],_0x11fb7e[_0x8005('0xea')]):util[_0x8005('0x9b')](_0x8005('0xec'),_0x5f236b['interval'])},client9002)['then'](function(_0x1339f9){var _0x294bc1=_0x1339f9&&_0x1339f9[_0x8005('0xed')](_0x8005('0xee'))>=0x0?!![]:![];logger[_0x8005('0x15')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x11fb7e['id'],_0x5f236b['id'],_0x5f236b[_0x8005('0xeb')],_0x294bc1?_0x8005('0xef'):'OFFLINE',_0x11fb7e[_0x8005('0xea')]?_0x11fb7e['timezone']:'No\x20timezone');return _0x294bc1;})[_0x8005('0x1e')](function(_0x32609d){logger[_0x8005('0x19')](_0x8005('0xf0'),_0x11fb7e['id'],_0x5f236b['id'],_0x5f236b[_0x8005('0xeb')],util['inspect'](_0x32609d,{'showHidden':![],'depth':null}),_0x11fb7e[_0x8005('0xea')]?_0x11fb7e[_0x8005('0xea')]:_0x8005('0xf1'));return![];});}exports['getSnippet']=function(_0x3af3a9,_0x1eaa3f){var _0x5d44de=0x0;var _0x4d3e5b=0x0;var _0x10620a=![];var _0x41d2b4;var _0x107968;return db[_0x8005('0x31')][_0x8005('0x4c')]({'where':{'id':_0x3af3a9[_0x8005('0x57')]['id']},'include':[{'model':db[_0x8005('0xf2')],'as':_0x8005('0xf2'),'include':[{'model':db['Interval'],'as':_0x8005('0xf3'),'attributes':['id',_0x8005('0xeb')],'raw':!![]}]}]})[_0x8005('0x14')](handleEntityNotFound(_0x1eaa3f,null))[_0x8005('0x14')](function(_0x3af87e){if(_0x3af87e){_0x41d2b4=_0x3af87e;return _0x3af87e['getProactiveActions']({'raw':!![]});}})[_0x8005('0x14')](function(_0x33c9d9){if(_0x41d2b4){if(_0x33c9d9){_0x107968=_0x33c9d9;}}return require(_0x8005('0xf4'))[_0x8005('0xf5')]();})[_0x8005('0x14')](function(_0x239cad){if(_0x239cad){_0x4d3e5b=_0x239cad['virtual'];_0x10620a=_0x239cad['custom'];}})['then'](function(){return db[_0x8005('0xa1')][_0x8005('0x25')]({'where':{'closed':![]}});})[_0x8005('0x14')](function(_0x58b20f){_0x5d44de=_0x58b20f;if(_0x4d3e5b&&_0x58b20f>_0x4d3e5b){return db[_0x8005('0xf6')][_0x8005('0x5b')]({'where':{'id':0x1}})['then'](function(_0x28671a){if(_0x28671a){_0x28671a[_0x8005('0xf7')](_0x8005('0xf8'));}});}})[_0x8005('0x14')](function(){if(_0x41d2b4[_0x8005('0xf2')]&&_0x41d2b4[_0x8005('0xf2')][_0x8005('0xf3')]){var _0x365ceb=[];for(var _0x20a2fe=0x0;_0x20a2fe<_0x41d2b4['Interval'][_0x8005('0xf3')][_0x8005('0x3b')];_0x20a2fe++){var _0x33e7a5=_0x41d2b4[_0x8005('0xf2')]['Intervals'][_0x20a2fe][_0x8005('0x29')]({'plain':!![]});_0x365ceb[_0x8005('0xab')](iftimePromise(_0x33e7a5,_0x41d2b4));}return BPromise['all'](_0x365ceb)[_0x8005('0x14')](function(_0x20fb70){return _[_0x8005('0xf9')](_0x20fb70);});}else{return!![];}})[_0x8005('0x14')](function(_0x29da8f){var _0x57698f=fs[_0x8005('0xfa')](path['join'](config[_0x8005('0x6c')],_0x8005('0xfb')),'utf8');var _0x33a3d2={'remote':_0x41d2b4[_0x8005('0xfc')],'query':querystring[_0x8005('0xfd')](_['merge'](_0x41d2b4[_0x8005('0x29')]({'plain':!![]}),{'customerIp':_0x3af3a9['headers']['x-forwarded-for']||_0x3af3a9[_0x8005('0x77')][_0x8005('0xfe')]||_0x3af3a9[_0x8005('0xff')][_0x8005('0x100')]||_0x3af3a9['ip'],'referer':_0x3af3a9[_0x8005('0x77')][_0x8005('0x98')],'openedInteractions':_0x5d44de,'maxInteractions':_0x4d3e5b,'virtual':_0x10620a[_0x8005('0x101')],'online':_0x29da8f,'custom':_0x10620a}))['replace'](/'/g,'\x5c\x27')};_0x1eaa3f[_0x8005('0x2d')](ejs[_0x8005('0xc1')](Mustache[_0x8005('0xc1')](_0x57698f,_0x33a3d2),{'proactiveActions':_0x107968,'alignment':_0x41d2b4[_0x8005('0x102')],'verticalAlignment':_0x41d2b4[_0x8005('0x103')],'div_color':_0x41d2b4[_0x8005('0xe6')],'labelText':_0x41d2b4['labelText'],'text_color':_0x41d2b4[_0x8005('0x104')],'text_button_color':_0x41d2b4[_0x8005('0x105')],'button_color':_0x41d2b4[_0x8005('0x106')],'background_color':_0x41d2b4[_0x8005('0x107')],'hideWhenOffline':_0x41d2b4[_0x8005('0x108')],'interval':_0x41d2b4[_0x8005('0x109')]}));})[_0x8005('0x1e')](handleError(_0x1eaa3f,null));};exports[_0x8005('0x10a')]=function(_0x318785,_0x291d5d){var _0x1a4f16=_0x318785['params']['id'];var _0x4ad847=_0x318785['body'];var _0x3fe3c9=0xc8;var _0x4aec31=null;return db[_0x8005('0x10b')][_0x8005('0xcc')]({'isolationLevel':db[_0x8005('0x10b')][_0x8005('0x10c')][_0x8005('0x10d')][_0x8005('0x10e')]},function(_0x54131b){return db[_0x8005('0x31')][_0x8005('0x5b')]({'where':{'id':_0x1a4f16},'transaction':_0x54131b})[_0x8005('0x14')](function(_0x1bf583){if(_0x1bf583){return db[_0x8005('0x8a')][_0x8005('0x28')]({'where':{'ChatWebsiteId':_0x1a4f16},'transaction':_0x54131b})['then'](function(){var _0x132748=_[_0x8005('0x35')](_0x4ad847,function(_0x2a8fa5){_0x2a8fa5[_0x8005('0x5a')]=_0x1a4f16;return _0x2a8fa5;});return db['ChatApplication'][_0x8005('0xce')](_0x132748,{'transaction':_0x54131b});});}else{_0x3fe3c9=0x194;_0x4aec31=[];}});})['then'](function(){if(_0x3fe3c9!==0x194){return db['ChatApplication'][_0x8005('0x10f')]({'where':{'ChatWebsiteId':_0x1a4f16},'order':_0x8005('0x8e')})[_0x8005('0x14')](function(_0x5cbbae){_0x4aec31=_0x5cbbae;});}})[_0x8005('0x1e')](function(_0x1907eb){_0x3fe3c9=0x1f4;logger[_0x8005('0x19')](_0x1907eb[_0x8005('0x2b')]);if(_0x1907eb[_0x8005('0x2c')]){delete _0x1907eb[_0x8005('0x2c')];}_0x4aec31=_0x1907eb;})[_0x8005('0x110')](function(){if(_0x4aec31===null){_0x291d5d[_0x8005('0x1f')](_0x3fe3c9);}else{if(_0x3fe3c9===0x1f4){_0x291d5d['status'](_0x3fe3c9)[_0x8005('0x2d')](_0x4aec31);}else{_0x291d5d[_0x8005('0x20')](_0x3fe3c9)[_0x8005('0x111')](_0x4aec31);}}});};exports[_0x8005('0x112')]=function(_0x69c32b,_0xee3405){var _0x10fc99={};var _0x5ae0ee={};var _0x392323;var _0x3cd530;return db['ChatWebsite']['findOne']({'where':{'id':_0x69c32b[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0xee3405,null))[_0x8005('0x14')](function(_0x9206a6){if(_0x9206a6){_0x392323=_0x9206a6;_0x5ae0ee['model']=_[_0x8005('0x4b')](db[_0x8005('0x8a')]['rawAttributes']);_0x5ae0ee[_0x8005('0x36')]=_[_0x8005('0x4b')](_0x69c32b[_0x8005('0x36')]);_0x5ae0ee['filters']=_['intersection'](_0x5ae0ee['model'],_0x5ae0ee[_0x8005('0x36')]);_0x10fc99[_0x8005('0x38')]=_[_0x8005('0x39')](_0x5ae0ee['model'],qs[_0x8005('0x3a')](_0x69c32b[_0x8005('0x36')][_0x8005('0x3a')]));_0x10fc99[_0x8005('0x38')]=_0x10fc99[_0x8005('0x38')][_0x8005('0x3b')]?_0x10fc99[_0x8005('0x38')]:_0x5ae0ee['model'];_0x10fc99['order']=qs[_0x8005('0x3f')](_0x69c32b[_0x8005('0x36')][_0x8005('0x3f')]);_0x10fc99[_0x8005('0x40')]=qs[_0x8005('0x37')](_['pick'](_0x69c32b[_0x8005('0x36')],_0x5ae0ee[_0x8005('0x37')]));if(_0x69c32b[_0x8005('0x36')][_0x8005('0x42')]){_0x10fc99[_0x8005('0x40')]=_['merge'](_0x10fc99[_0x8005('0x40')],{'$or':_[_0x8005('0x35')](_0x10fc99['attributes'],function(_0x12dece){var _0x528e4e={};_0x528e4e[_0x12dece]={'$like':'%'+_0x69c32b['query'][_0x8005('0x42')]+'%'};return _0x528e4e;})});}_0x10fc99=_[_0x8005('0x45')]({},_0x10fc99,_0x69c32b['options']);return _0x392323['getApplications'](_0x10fc99);}})[_0x8005('0x14')](function(_0x47002b){if(_0x47002b){_0x3cd530=_0x47002b[_0x8005('0x3b')];if(!_0x69c32b[_0x8005('0x36')]['hasOwnProperty'](_0x8005('0x3d'))){_0x10fc99[_0x8005('0x24')]=qs[_0x8005('0x24')](_0x69c32b[_0x8005('0x36')][_0x8005('0x24')]);_0x10fc99[_0x8005('0x22')]=qs[_0x8005('0x22')](_0x69c32b[_0x8005('0x36')][_0x8005('0x22')]);}return _0x392323[_0x8005('0x112')](_0x10fc99);}})[_0x8005('0x14')](function(_0x2773b2){if(_0x2773b2){return _0x2773b2?{'count':_0x3cd530,'rows':_0x2773b2}:null;}})['then'](respondWithResult(_0xee3405,null))[_0x8005('0x1e')](handleError(_0xee3405,null));};exports['addProactiveActions']=function(_0x274fd5,_0x309d0a){return db[_0x8005('0x113')][_0x8005('0x4c')]({'where':{'id':_0x274fd5['params']['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x309d0a,null))[_0x8005('0x14')](function(_0x594758){if(_0x594758){return _0x594758[_0x8005('0x114')](_0x274fd5[_0x8005('0x4e')][_0x8005('0x5e')],_['omit'](_0x274fd5[_0x8005('0x4e')],['ids','id'])||{});}})['then'](respondWithResult(_0x309d0a,null))[_0x8005('0x1e')](handleError(_0x309d0a,null));};exports[_0x8005('0x115')]=function(_0x378806,_0x48f1c1){var _0x4b2609={};var _0x8a4862={};var _0x7ef3d8;var _0x155ed6;return db[_0x8005('0x31')][_0x8005('0x5b')]({'where':{'id':_0x378806[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x48f1c1,null))[_0x8005('0x14')](function(_0x461106){if(_0x461106){_0x7ef3d8=_0x461106;_0x8a4862[_0x8005('0x34')]=_[_0x8005('0x4b')](db[_0x8005('0x116')][_0x8005('0x32')]);_0x8a4862[_0x8005('0x36')]=_['keys'](_0x378806[_0x8005('0x36')]);_0x8a4862[_0x8005('0x37')]=_[_0x8005('0x39')](_0x8a4862[_0x8005('0x34')],_0x8a4862['query']);_0x4b2609[_0x8005('0x38')]=_['intersection'](_0x8a4862['model'],qs[_0x8005('0x3a')](_0x378806[_0x8005('0x36')]['fields']));_0x4b2609[_0x8005('0x38')]=_0x4b2609[_0x8005('0x38')]['length']?_0x4b2609[_0x8005('0x38')]:_0x8a4862[_0x8005('0x34')];_0x4b2609[_0x8005('0x3e')]=qs['sort'](_0x378806[_0x8005('0x36')][_0x8005('0x3f')]);_0x4b2609[_0x8005('0x40')]=qs[_0x8005('0x37')](_[_0x8005('0x41')](_0x378806[_0x8005('0x36')],_0x8a4862['filters']));if(_0x378806[_0x8005('0x36')]['filter']){_0x4b2609['where']=_[_0x8005('0x45')](_0x4b2609[_0x8005('0x40')],{'$or':_['map'](_0x4b2609[_0x8005('0x38')],function(_0x192eb1){var _0x1fd5c0={};_0x1fd5c0[_0x192eb1]={'$like':'%'+_0x378806[_0x8005('0x36')][_0x8005('0x42')]+'%'};return _0x1fd5c0;})});}_0x4b2609=_[_0x8005('0x45')]({},_0x4b2609,_0x378806[_0x8005('0x46')]);return _0x7ef3d8[_0x8005('0x115')](_0x4b2609);}})[_0x8005('0x14')](function(_0x2f6e13){if(_0x2f6e13){_0x155ed6=_0x2f6e13[_0x8005('0x3b')];if(!_0x378806[_0x8005('0x36')]['hasOwnProperty']('nolimit')){_0x4b2609['limit']=qs['limit'](_0x378806[_0x8005('0x36')][_0x8005('0x24')]);_0x4b2609['offset']=qs['offset'](_0x378806[_0x8005('0x36')][_0x8005('0x22')]);}return _0x7ef3d8[_0x8005('0x115')](_0x4b2609);}})['then'](function(_0x500ec1){if(_0x500ec1){return _0x500ec1?{'count':_0x155ed6,'rows':_0x500ec1}:null;}})[_0x8005('0x14')](respondWithResult(_0x48f1c1,null))['catch'](handleError(_0x48f1c1,null));};exports[_0x8005('0x117')]=function(_0xfa6f28,_0x264eba){var _0x3dc9fe=_0xfa6f28[_0x8005('0x36')]['online']===_0x8005('0x118')?'offlineForm':_0x8005('0x119');return db[_0x8005('0x31')]['find']({'attributes':['id',_0x3dc9fe],'where':{'id':_0xfa6f28[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x264eba,null))['then'](function(_0x5e1c21){if(_0x5e1c21){var _0x45e893=_0x5e1c21[_0x3dc9fe];var _0xc067a3=_0x45e893&&_0x45e893['items']?_0x45e893[_0x8005('0x11a')]:[];_0x264eba[_0x8005('0x2d')]({'fromKey':_['isNil'](_0x45e893[_0x8005('0x11b')])?undefined:_0x45e893[_0x8005('0x11b')],'count':_0xc067a3[_0x8005('0x3b')],'rows':_0xc067a3});}})[_0x8005('0x1e')](handleError(_0x264eba,null));};exports[_0x8005('0x11c')]=function(_0x43e3ca,_0xe0f393){var _0x34b3b1={'raw':![],'where':{}};var _0x270869={};var _0x263288={'count':0x0,'rows':[]};return db[_0x8005('0x31')]['findOne']({'where':{'id':_0x43e3ca[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0xe0f393,null))[_0x8005('0x14')](function(_0x24db76){if(_0x24db76){_0x270869[_0x8005('0x34')]=_[_0x8005('0x4b')](db[_0x8005('0xc3')][_0x8005('0x32')]);_0x270869[_0x8005('0x36')]=_['keys'](_0x43e3ca[_0x8005('0x36')]);_0x270869['filters']=_['intersection'](_0x270869[_0x8005('0x34')],_0x270869[_0x8005('0x36')]);_0x34b3b1[_0x8005('0x38')]=_[_0x8005('0x39')](_0x270869[_0x8005('0x34')],qs[_0x8005('0x3a')](_0x43e3ca[_0x8005('0x36')][_0x8005('0x3a')]));_0x34b3b1['attributes']=_0x34b3b1[_0x8005('0x38')][_0x8005('0x3b')]?_0x34b3b1[_0x8005('0x38')]:_0x270869[_0x8005('0x34')];if(!_0x43e3ca[_0x8005('0x36')][_0x8005('0x3c')]('nolimit')){_0x34b3b1['limit']=qs[_0x8005('0x24')](_0x43e3ca[_0x8005('0x36')][_0x8005('0x24')]);_0x34b3b1[_0x8005('0x22')]=qs[_0x8005('0x22')](_0x43e3ca[_0x8005('0x36')][_0x8005('0x22')]);}_0x34b3b1[_0x8005('0x3e')]=qs[_0x8005('0x3f')](_0x43e3ca[_0x8005('0x36')]['sort']);_0x34b3b1['where']=qs[_0x8005('0x37')](_[_0x8005('0x41')](_0x43e3ca[_0x8005('0x36')],_0x270869['filters']));_0x34b3b1[_0x8005('0x40')][_0x8005('0x5a')]=_0x24db76['id'];if(_0x43e3ca['query'][_0x8005('0x42')]){_0x34b3b1['where']=_[_0x8005('0x45')](_0x34b3b1[_0x8005('0x40')],{'$or':_[_0x8005('0x35')](_0x34b3b1[_0x8005('0x38')],function(_0x12c42f){var _0x583568={};_0x583568[_0x12c42f]={'$like':'%'+_0x43e3ca['query']['filter']+'%'};return _0x583568;})});}_0x34b3b1=_['merge']({},_0x34b3b1,_0x43e3ca[_0x8005('0x46')]);return db[_0x8005('0xc3')][_0x8005('0x25')]({'where':_0x34b3b1[_0x8005('0x40')]})[_0x8005('0x14')](function(_0x56054a){_0x263288[_0x8005('0x25')]=_0x56054a;if(_0x43e3ca[_0x8005('0x36')]['includeAll']){_0x34b3b1['include']=[{'all':!![]}];}else{_0x34b3b1[_0x8005('0x48')]=[{'model':db[_0x8005('0x7a')],'as':_0x8005('0xe3'),'required':![]},{'model':db[_0x8005('0xcd')],'as':_0x8005('0x11d'),'required':![]}];}return db[_0x8005('0xc3')]['findAll'](_0x34b3b1);})[_0x8005('0x14')](function(_0x12dc67){_0x263288['rows']=_0x12dc67;return _0x263288;});}})['then'](respondWithFilteredResult(_0xe0f393,_0x34b3b1))[_0x8005('0x1e')](handleError(_0xe0f393,null));};exports['addAgents']=function(_0x62d44,_0x570da3){return db['ChatWebsite'][_0x8005('0x4c')]({'where':{'id':_0x62d44[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x570da3,null))[_0x8005('0x14')](function(_0x1b55e7){if(_0x1b55e7){return _0x1b55e7[_0x8005('0x11e')](_0x62d44[_0x8005('0x4e')][_0x8005('0x5e')],_['omit'](_0x62d44[_0x8005('0x4e')],['ids','id'])||{})[_0x8005('0xa5')](function(_0x553660){for(var _0x1cb759=0x0;_0x1cb759<_0x62d44['body'][_0x8005('0x5e')]['length'];_0x1cb759+=0x1){socket[_0x8005('0x11f')]('userChatWebsite:save',{'UserId':Number(_0x62d44[_0x8005('0x4e')][_0x8005('0x5e')][_0x1cb759]),'ChatWebsiteId':Number(_0x62d44[_0x8005('0x57')]['id'])});}return _0x553660;});}})[_0x8005('0x14')](respondWithResult(_0x570da3,null))['catch'](handleError(_0x570da3,null));};exports['removeAgents']=function(_0x645108,_0x4096ef){return db['ChatWebsite'][_0x8005('0x4c')]({'where':{'id':_0x645108[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x4096ef,null))['then'](function(_0x1a0386){if(_0x1a0386){return _0x1a0386[_0x8005('0x120')](_0x645108[_0x8005('0x36')][_0x8005('0x5e')])[_0x8005('0x14')](function(){if(_[_0x8005('0x121')](_0x645108[_0x8005('0x36')][_0x8005('0x5e')])){for(var _0x14c60d=0x0;_0x14c60d<_0x645108[_0x8005('0x36')][_0x8005('0x5e')][_0x8005('0x3b')];_0x14c60d+=0x1){socket[_0x8005('0x11f')](_0x8005('0x122'),{'UserId':Number(_0x645108['query'][_0x8005('0x5e')][_0x14c60d]),'ChatWebsiteId':Number(_0x645108[_0x8005('0x57')]['id'])});}}else{socket[_0x8005('0x11f')](_0x8005('0x122'),{'UserId':Number(_0x645108[_0x8005('0x36')][_0x8005('0x5e')]),'ChatWebsiteId':Number(_0x645108['params']['id'])});}});}})[_0x8005('0x14')](respondWithStatusCode(_0x4096ef,null))['catch'](handleError(_0x4096ef,null));};exports['getAgents']=function(_0x376aad,_0x49e8b7){var _0x3d1f31={};var _0x2cb598={};var _0x534036;var _0x2d077d;return db['ChatWebsite'][_0x8005('0x5b')]({'where':{'id':_0x376aad[_0x8005('0x57')]['id']}})[_0x8005('0x14')](handleEntityNotFound(_0x49e8b7,null))['then'](function(_0x5ec56c){if(_0x5ec56c){_0x534036=_0x5ec56c;_0x2cb598[_0x8005('0x34')]=_[_0x8005('0x4b')](db[_0x8005('0xb1')][_0x8005('0x32')]);_0x2cb598[_0x8005('0x36')]=_[_0x8005('0x4b')](_0x376aad[_0x8005('0x36')]);_0x2cb598[_0x8005('0x37')]=_[_0x8005('0x39')](_0x2cb598['model'],_0x2cb598['query']);_0x3d1f31[_0x8005('0x38')]=_[_0x8005('0x39')](_0x2cb598['model'],qs[_0x8005('0x3a')](_0x376aad[_0x8005('0x36')][_0x8005('0x3a')]));_0x3d1f31['attributes']=_0x3d1f31[_0x8005('0x38')][_0x8005('0x3b')]?_0x3d1f31[_0x8005('0x38')]:_0x2cb598['model'];_0x3d1f31[_0x8005('0x3e')]=qs[_0x8005('0x3f')](_0x376aad[_0x8005('0x36')]['sort']);_0x3d1f31[_0x8005('0x40')]=qs[_0x8005('0x37')](_['pick'](_0x376aad['query'],_0x2cb598['filters']));if(_0x376aad[_0x8005('0x36')][_0x8005('0x42')]){_0x3d1f31[_0x8005('0x40')]=_[_0x8005('0x45')](_0x3d1f31[_0x8005('0x40')],{'$or':_['map'](_0x3d1f31[_0x8005('0x38')],function(_0x58c895){var _0x5e90d9={};_0x5e90d9[_0x58c895]={'$like':'%'+_0x376aad[_0x8005('0x36')]['filter']+'%'};return _0x5e90d9;})});}_0x3d1f31=_[_0x8005('0x45')]({},_0x3d1f31,_0x376aad[_0x8005('0x46')]);return _0x534036[_0x8005('0x123')](_0x3d1f31);}})[_0x8005('0x14')](function(_0xc7127f){if(_0xc7127f){_0x2d077d=_0xc7127f[_0x8005('0x3b')];if(!_0x376aad['query']['hasOwnProperty'](_0x8005('0x3d'))){_0x3d1f31['limit']=qs['limit'](_0x376aad[_0x8005('0x36')][_0x8005('0x24')]);_0x3d1f31[_0x8005('0x22')]=qs[_0x8005('0x22')](_0x376aad[_0x8005('0x36')][_0x8005('0x22')]);}return _0x534036[_0x8005('0x123')](_0x3d1f31);}})[_0x8005('0x14')](function(_0x3af32){if(_0x3af32){return _0x3af32?{'count':_0x2d077d,'rows':_0x3af32}:null;}})[_0x8005('0x14')](respondWithResult(_0x49e8b7,null))[_0x8005('0x1e')](handleError(_0x49e8b7,null));}; \ No newline at end of file +var _0x881f=['files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','attachments','offline-chat','basename','sequelize','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','email','offlineMessageSubject','openNewInteraction','originalname','toPairsIn','subjectOffline','lastName','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','virtual','License','increment','chatLicenseExceeded','push','some','server/files/chat/iframe.ejs','remote','connection','remoteAddress','replace','render','alignment','labelText','textColor','textButtonColor','color_button','backgroundColor','IntervalId','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','html-to-text','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','status','end','json','undefined','limit','offset','count','set','Content-Range','update','destroy','UserProfileResource','sendStatus','stack','name','send','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','ChatWebsites','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','pick','removeDispositions','CannedAnswer','removeAnswers','ids','addLogo','sitepic','file','addAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','ValidationError','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','contact','cf-connecting-ip','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline'];(function(_0x537f15,_0x26421f){var _0x492b6e=function(_0x31f9b7){while(--_0x31f9b7){_0x537f15['push'](_0x537f15['shift']());}};_0x492b6e(++_0x26421f);}(_0x881f,0x18b));var _0xf881=function(_0x58719e,_0x4b47a8){_0x58719e=_0x58719e-0x0;var _0x412ec0=_0x881f[_0x58719e];return _0x412ec0;};'use strict';var BPromise=require(_0xf881('0x0'));var Mustache=require(_0xf881('0x1'));var util=require(_0xf881('0x2'));var path=require(_0xf881('0x3'));var ejs=require(_0xf881('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf881('0x5'));var querystring=require(_0xf881('0x6'));var Redis=require('ioredis');var qs=require(_0xf881('0x7'));var logger=require(_0xf881('0x8'))(_0xf881('0x9'));var config=require(_0xf881('0xa'));var db=require('../../mysqldb')['db'];config[_0xf881('0xb')]=_[_0xf881('0xc')](config[_0xf881('0xb')],{'host':_0xf881('0xd'),'port':0x18eb});var socket=require(_0xf881('0xe'))(new Redis(config[_0xf881('0xb')]));require('./chatWebsite.socket')[_0xf881('0xf')](socket);var htmlToText=require(_0xf881('0x10'));var jayson=require('jayson/promise');var client=jayson[_0xf881('0x11')]['http']({'port':0x232c});var client9002=jayson[_0xf881('0x11')]['http']({'port':0x232a});var client9003=jayson['client'][_0xf881('0x12')]({'port':0x232b});var client9001=jayson[_0xf881('0x11')][_0xf881('0x12')]({'port':0x2329});function respondWithRpcPromise(_0xa8c864,_0x24bbbe,_0x1942ce,_0x3617cf){return new BPromise(function(_0x33a40e,_0x4391f4){var _0x865c43=_0x3617cf||client;return _0x865c43[_0xf881('0x13')](_0xa8c864,_0x1942ce)[_0xf881('0x14')](function(_0x443f02){logger[_0xf881('0x15')](_0xf881('0x16'),_0x24bbbe,'request\x20sent');logger[_0xf881('0x17')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x24bbbe,_0xf881('0x18'),JSON[_0xf881('0x19')](_0x443f02));if(_0x443f02[_0xf881('0x1a')]){if(_0x443f02['error'][_0xf881('0x1b')]===0x1f4){logger[_0xf881('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x24bbbe,_0x443f02[_0xf881('0x1a')][_0xf881('0x1c')]);return _0x4391f4(_0x443f02[_0xf881('0x1a')][_0xf881('0x1c')]);}logger['error'](_0xf881('0x16'),_0x24bbbe,_0x443f02['error']['message']);return _0x33a40e(_0x443f02[_0xf881('0x1a')]['message']);}else{logger[_0xf881('0x15')](_0xf881('0x16'),_0x24bbbe,_0xf881('0x18'));_0x33a40e(_0x443f02['result']['message']);}})[_0xf881('0x1d')](function(_0x450e81){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x24bbbe,_0x450e81);_0x4391f4(_0x450e81);});});}function respondWithStatusCode(_0x5a8929,_0x4f7b20){_0x4f7b20=_0x4f7b20||0xcc;return function(_0x469d0c){if(_0x469d0c){return _0x5a8929['sendStatus'](_0x4f7b20);}return _0x5a8929[_0xf881('0x1e')](_0x4f7b20)[_0xf881('0x1f')]();};}function respondWithResult(_0x42f705,_0x6a8d6d){_0x6a8d6d=_0x6a8d6d||0xc8;return function(_0x35c566){if(_0x35c566){return _0x42f705[_0xf881('0x1e')](_0x6a8d6d)[_0xf881('0x20')](_0x35c566);}};}function respondWithFilteredResult(_0x415872,_0x5e7c41){return function(_0xccfd7){if(_0xccfd7){var _0x124410=typeof _0x5e7c41['offset']===_0xf881('0x21')&&typeof _0x5e7c41[_0xf881('0x22')]===_0xf881('0x21');var _0xa2e5b=_0xccfd7['count'];var _0x2ef860=_0x124410?0x0:_0x5e7c41[_0xf881('0x23')];var _0x1cff3f=_0x124410?_0xccfd7[_0xf881('0x24')]:_0x5e7c41[_0xf881('0x23')]+_0x5e7c41[_0xf881('0x22')];var _0x197570;if(_0x1cff3f>=_0xa2e5b){_0x1cff3f=_0xa2e5b;_0x197570=0xc8;}else{_0x197570=0xce;}_0x415872[_0xf881('0x1e')](_0x197570);return _0x415872[_0xf881('0x25')](_0xf881('0x26'),_0x2ef860+'-'+_0x1cff3f+'/'+_0xa2e5b)[_0xf881('0x20')](_0xccfd7);}return null;};}function saveUpdates(_0x583a7e){return function(_0x26fc4e){if(_0x26fc4e){return _0x26fc4e[_0xf881('0x27')](_0x583a7e)[_0xf881('0x14')](function(_0x5a78d9){return _0x5a78d9;});}return null;};}function removeEntity(_0x4d9bb2){return function(_0xabb28f){if(_0xabb28f){return _0xabb28f[_0xf881('0x28')]()[_0xf881('0x14')](function(){var _0x59bd98=_0xabb28f['get']({'plain':!![]});var _0x297d3b='ChatWebsites';return db[_0xf881('0x29')][_0xf881('0x28')]({'where':{'type':_0x297d3b,'resourceId':_0x59bd98['id']}})[_0xf881('0x14')](function(){return _0xabb28f;});})[_0xf881('0x14')](function(){_0x4d9bb2[_0xf881('0x1e')](0xcc)[_0xf881('0x1f')]();});}};}function handleEntityNotFound(_0x3c1b5f){return function(_0x10a7d4){if(!_0x10a7d4){_0x3c1b5f[_0xf881('0x2a')](0x194);}return _0x10a7d4;};}function handleError(_0x16a74f,_0x52621d){_0x52621d=_0x52621d||0x1f4;return function(_0x70a34f){logger[_0xf881('0x1a')](_0x70a34f[_0xf881('0x2b')]);if(_0x70a34f[_0xf881('0x2c')]){delete _0x70a34f[_0xf881('0x2c')];}_0x16a74f[_0xf881('0x1e')](_0x52621d)[_0xf881('0x2d')](_0x70a34f);};}exports['index']=function(_0x26b98c,_0x19f38e){var _0x4c8722={'include':[{'model':db['Pause'],'as':_0xf881('0x2e')}]},_0x41365b={},_0x28312f={'count':0x0,'rows':[]};var _0x580cd6=_[_0xf881('0x2f')](db[_0xf881('0x30')][_0xf881('0x31')],function(_0x34c9d3){return{'name':_0x34c9d3[_0xf881('0x32')],'type':_0x34c9d3[_0xf881('0x33')]['key']};});_0x41365b[_0xf881('0x34')]=_['map'](_0x580cd6,_0xf881('0x2c'));_0x41365b['query']=_[_0xf881('0x35')](_0x26b98c['query']);_0x41365b[_0xf881('0x36')]=_[_0xf881('0x37')](_0x41365b[_0xf881('0x34')],_0x41365b[_0xf881('0x38')]);_0x4c8722[_0xf881('0x39')]=_[_0xf881('0x37')](_0x41365b[_0xf881('0x34')],qs[_0xf881('0x3a')](_0x26b98c[_0xf881('0x38')]['fields']));_0x4c8722[_0xf881('0x39')]=_0x4c8722[_0xf881('0x39')]['length']?_0x4c8722[_0xf881('0x39')]:_0x41365b[_0xf881('0x34')];if(!_0x26b98c[_0xf881('0x38')][_0xf881('0x3b')](_0xf881('0x3c'))){_0x4c8722[_0xf881('0x22')]=qs[_0xf881('0x22')](_0x26b98c[_0xf881('0x38')]['limit']);_0x4c8722[_0xf881('0x23')]=qs['offset'](_0x26b98c[_0xf881('0x38')][_0xf881('0x23')]);}_0x4c8722[_0xf881('0x3d')]=qs[_0xf881('0x3e')](_0x26b98c[_0xf881('0x38')][_0xf881('0x3e')]);_0x4c8722[_0xf881('0x3f')]=qs[_0xf881('0x36')](_['pick'](_0x26b98c[_0xf881('0x38')],_0x41365b[_0xf881('0x36')]),_0x580cd6);if(_0x26b98c[_0xf881('0x38')][_0xf881('0x40')]){_0x4c8722[_0xf881('0x3f')]=_[_0xf881('0x41')](_0x4c8722['where'],{'$or':_[_0xf881('0x2f')](_0x580cd6,function(_0x30567f){if(_0x30567f[_0xf881('0x33')]!==_0xf881('0x42')){var _0x36b1a1={};_0x36b1a1[_0x30567f['name']]={'$like':'%'+_0x26b98c[_0xf881('0x38')][_0xf881('0x40')]+'%'};return _0x36b1a1;}})});}_0x4c8722=_[_0xf881('0x41')]({},_0x4c8722,_0x26b98c[_0xf881('0x43')]);var _0x36e648={'where':_0x4c8722[_0xf881('0x3f')]};return db[_0xf881('0x30')][_0xf881('0x24')](_0x36e648)[_0xf881('0x14')](function(_0x11691a){_0x28312f[_0xf881('0x24')]=_0x11691a;if(_0x26b98c[_0xf881('0x38')][_0xf881('0x44')]){_0x4c8722[_0xf881('0x45')]=[{'all':!![]}];}return db['ChatWebsite'][_0xf881('0x46')](_0x4c8722);})[_0xf881('0x14')](function(_0x3f6bbf){_0x28312f[_0xf881('0x47')]=_0x3f6bbf;return _0x28312f;})[_0xf881('0x14')](respondWithFilteredResult(_0x19f38e,_0x4c8722))['catch'](handleError(_0x19f38e,null));};exports[_0xf881('0x48')]=function(_0x586596,_0x3543f4){var _0x551f92={'raw':![],'where':{'id':_0x586596[_0xf881('0x49')]['id']},'include':[{'model':db[_0xf881('0x4a')],'as':_0xf881('0x2e')}]},_0x12017d={};_0x12017d[_0xf881('0x34')]=_[_0xf881('0x35')](db['ChatWebsite'][_0xf881('0x31')]);_0x12017d['query']=_[_0xf881('0x35')](_0x586596['query']);_0x12017d['filters']=_['intersection'](_0x12017d[_0xf881('0x34')],_0x12017d[_0xf881('0x38')]);_0x551f92[_0xf881('0x39')]=_[_0xf881('0x37')](_0x12017d[_0xf881('0x34')],qs[_0xf881('0x3a')](_0x586596['query'][_0xf881('0x3a')]));_0x551f92['attributes']=_0x551f92['attributes'][_0xf881('0x4b')]?_0x551f92[_0xf881('0x39')]:_0x12017d[_0xf881('0x34')];if(_0x586596[_0xf881('0x38')][_0xf881('0x44')]){_0x551f92['include']=[{'all':!![]}];}_0x551f92=_['merge']({},_0x551f92,_0x586596[_0xf881('0x43')]);return db[_0xf881('0x30')][_0xf881('0x4c')](_0x551f92)[_0xf881('0x14')](handleEntityNotFound(_0x3543f4,null))[_0xf881('0x14')](respondWithResult(_0x3543f4,null))['catch'](handleError(_0x3543f4,null));};exports[_0xf881('0x4d')]=function(_0x5385c1,_0x56302f){return db[_0xf881('0x30')]['create'](_0x5385c1[_0xf881('0x4e')],{})[_0xf881('0x14')](function(_0x66460d){var _0x5a969d=_0x5385c1['user']['get']({'plain':!![]});if(!_0x5a969d)throw new Error(_0xf881('0x4f'));if(_0x5a969d[_0xf881('0x50')]===_0xf881('0x51')){var _0x315c31=_0x66460d[_0xf881('0x52')]({'plain':!![]});var _0x30d99=_0xf881('0x53');return db['UserProfileSection'][_0xf881('0x4c')]({'where':{'name':_0x30d99,'userProfileId':_0x5a969d[_0xf881('0x54')]},'raw':!![]})['then'](function(_0x9502ae){if(_0x9502ae&&_0x9502ae[_0xf881('0x55')]===0x0){return db[_0xf881('0x29')][_0xf881('0x4d')]({'name':_0x315c31['name'],'resourceId':_0x315c31['id'],'type':_0x9502ae[_0xf881('0x2c')],'sectionId':_0x9502ae['id']},{})[_0xf881('0x14')](function(){return _0x66460d;});}else{return _0x66460d;}})[_0xf881('0x1d')](function(_0x58dd28){logger[_0xf881('0x1a')](_0xf881('0x56'),_0x58dd28);throw _0x58dd28;});}return _0x66460d;})[_0xf881('0x14')](respondWithResult(_0x56302f,0xc9))['catch'](handleError(_0x56302f,null));};exports['update']=function(_0x1b34b1,_0x33f465){if(_0x1b34b1[_0xf881('0x4e')]['id']){delete _0x1b34b1[_0xf881('0x4e')]['id'];}return db[_0xf881('0x30')]['find']({'where':{'id':_0x1b34b1[_0xf881('0x49')]['id']},'include':[{'model':db[_0xf881('0x4a')],'as':_0xf881('0x2e')}]})[_0xf881('0x14')](handleEntityNotFound(_0x33f465,null))[_0xf881('0x14')](saveUpdates(_0x1b34b1[_0xf881('0x4e')],null))[_0xf881('0x14')](respondWithResult(_0x33f465,null))[_0xf881('0x1d')](handleError(_0x33f465,null));};exports[_0xf881('0x28')]=function(_0x58938e,_0x226ae5){return db[_0xf881('0x30')][_0xf881('0x4c')]({'where':{'id':_0x58938e[_0xf881('0x49')]['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x226ae5,null))[_0xf881('0x14')](removeEntity(_0x226ae5,null))[_0xf881('0x1d')](handleError(_0x226ae5,null));};exports[_0xf881('0x57')]=function(_0x120fc1,_0x20217e){return db['ChatWebsite'][_0xf881('0x57')]()['then'](respondWithResult(_0x20217e,null))[_0xf881('0x1d')](handleError(_0x20217e,null));};exports[_0xf881('0x58')]=function(_0x46ad0e,_0x2c241b){if(_0x46ad0e[_0xf881('0x4e')]['id']){delete _0x46ad0e[_0xf881('0x4e')]['id'];}return db[_0xf881('0x30')][_0xf881('0x4c')]({'where':{'id':_0x46ad0e[_0xf881('0x49')]['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x2c241b,null))[_0xf881('0x14')](function(_0x2cc1fb){if(_0x2cc1fb){_0x46ad0e[_0xf881('0x4e')][_0xf881('0x59')]=_0x2cc1fb['id'];return db['Disposition'][_0xf881('0x4d')](_0x46ad0e[_0xf881('0x4e')]);}})[_0xf881('0x14')](respondWithResult(_0x2c241b,null))['catch'](handleError(_0x2c241b,null));};exports[_0xf881('0x5a')]=function(_0x489ba8,_0x27578f){var _0x77563a={'raw':![],'where':{}};var _0x3561b4={};var _0x10243f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xf881('0x5b')]({'where':{'id':_0x489ba8[_0xf881('0x49')]['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x27578f,null))[_0xf881('0x14')](function(_0x1f2601){if(_0x1f2601){_0x3561b4[_0xf881('0x34')]=_[_0xf881('0x35')](db[_0xf881('0x5c')][_0xf881('0x31')]);_0x3561b4['query']=_[_0xf881('0x35')](_0x489ba8[_0xf881('0x38')]);_0x3561b4[_0xf881('0x36')]=_[_0xf881('0x37')](_0x3561b4[_0xf881('0x34')],_0x3561b4[_0xf881('0x38')]);_0x77563a[_0xf881('0x39')]=_[_0xf881('0x37')](_0x3561b4[_0xf881('0x34')],qs[_0xf881('0x3a')](_0x489ba8['query'][_0xf881('0x3a')]));_0x77563a[_0xf881('0x39')]=_0x77563a['attributes'][_0xf881('0x4b')]?_0x77563a[_0xf881('0x39')]:_0x3561b4[_0xf881('0x34')];if(!_0x489ba8[_0xf881('0x38')][_0xf881('0x3b')](_0xf881('0x3c'))){_0x77563a['limit']=qs[_0xf881('0x22')](_0x489ba8[_0xf881('0x38')][_0xf881('0x22')]);_0x77563a[_0xf881('0x23')]=qs[_0xf881('0x23')](_0x489ba8[_0xf881('0x38')][_0xf881('0x23')]);}_0x77563a[_0xf881('0x3d')]=qs[_0xf881('0x3e')](_0x489ba8[_0xf881('0x38')][_0xf881('0x3e')]);_0x77563a[_0xf881('0x3f')]=qs[_0xf881('0x36')](_[_0xf881('0x5d')](_0x489ba8['query'],_0x3561b4['filters']));_0x77563a[_0xf881('0x3f')]['ChatWebsiteId']=_0x1f2601['id'];if(_0x489ba8[_0xf881('0x38')][_0xf881('0x40')]){_0x77563a[_0xf881('0x3f')]=_['merge'](_0x77563a[_0xf881('0x3f')],{'$or':_[_0xf881('0x2f')](_0x77563a[_0xf881('0x39')],function(_0x1d2aea){var _0x437564={};_0x437564[_0x1d2aea]={'$like':'%'+_0x489ba8[_0xf881('0x38')][_0xf881('0x40')]+'%'};return _0x437564;})});}_0x77563a=_[_0xf881('0x41')]({},_0x77563a,_0x489ba8[_0xf881('0x43')]);return db['Disposition'][_0xf881('0x24')]({'where':_0x77563a[_0xf881('0x3f')]})[_0xf881('0x14')](function(_0x25def6){_0x10243f[_0xf881('0x24')]=_0x25def6;if(_0x489ba8[_0xf881('0x38')][_0xf881('0x44')]){_0x77563a[_0xf881('0x45')]=[{'all':!![]}];}return db['Disposition'][_0xf881('0x46')](_0x77563a);})[_0xf881('0x14')](function(_0x1bf931){_0x10243f[_0xf881('0x47')]=_0x1bf931;return _0x10243f;});}})[_0xf881('0x14')](respondWithFilteredResult(_0x27578f,_0x77563a))[_0xf881('0x1d')](handleError(_0x27578f,null));};exports[_0xf881('0x5e')]=function(_0x17407a,_0x2cc3d5){return db[_0xf881('0x30')][_0xf881('0x4c')]({'where':{'id':_0x17407a['params']['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x2cc3d5,null))[_0xf881('0x14')](function(_0x28a889){if(_0x28a889){return _0x28a889[_0xf881('0x5e')](_0x17407a[_0xf881('0x38')]['ids']);}})[_0xf881('0x14')](respondWithStatusCode(_0x2cc3d5,null))['catch'](handleError(_0x2cc3d5,null));};exports['addAnswer']=function(_0x14f918,_0x5b3d7f){if(_0x14f918[_0xf881('0x4e')]['id']){delete _0x14f918[_0xf881('0x4e')]['id'];}return db['ChatWebsite'][_0xf881('0x4c')]({'where':{'id':_0x14f918[_0xf881('0x49')]['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x5b3d7f,null))[_0xf881('0x14')](function(_0x453298){if(_0x453298){_0x14f918[_0xf881('0x4e')]['ChatWebsiteId']=_0x453298['id'];return db[_0xf881('0x5f')]['create'](_0x14f918[_0xf881('0x4e')]);}})[_0xf881('0x14')](respondWithResult(_0x5b3d7f,null))[_0xf881('0x1d')](handleError(_0x5b3d7f,null));};exports['getAnswers']=function(_0x1a6aaa,_0x26142f){var _0x5cb0af={'raw':![],'where':{}};var _0xf61965={};var _0x4f04de={'count':0x0,'rows':[]};return db[_0xf881('0x30')]['findOne']({'where':{'id':_0x1a6aaa[_0xf881('0x49')]['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x26142f,null))['then'](function(_0x14dc19){if(_0x14dc19){_0xf61965[_0xf881('0x34')]=_[_0xf881('0x35')](db[_0xf881('0x5f')][_0xf881('0x31')]);_0xf61965[_0xf881('0x38')]=_[_0xf881('0x35')](_0x1a6aaa['query']);_0xf61965['filters']=_['intersection'](_0xf61965['model'],_0xf61965[_0xf881('0x38')]);_0x5cb0af['attributes']=_['intersection'](_0xf61965['model'],qs[_0xf881('0x3a')](_0x1a6aaa[_0xf881('0x38')][_0xf881('0x3a')]));_0x5cb0af[_0xf881('0x39')]=_0x5cb0af[_0xf881('0x39')]['length']?_0x5cb0af['attributes']:_0xf61965['model'];if(!_0x1a6aaa[_0xf881('0x38')][_0xf881('0x3b')](_0xf881('0x3c'))){_0x5cb0af[_0xf881('0x22')]=qs[_0xf881('0x22')](_0x1a6aaa[_0xf881('0x38')][_0xf881('0x22')]);_0x5cb0af[_0xf881('0x23')]=qs['offset'](_0x1a6aaa['query'][_0xf881('0x23')]);}_0x5cb0af[_0xf881('0x3d')]=qs[_0xf881('0x3e')](_0x1a6aaa[_0xf881('0x38')][_0xf881('0x3e')]);_0x5cb0af[_0xf881('0x3f')]=qs[_0xf881('0x36')](_[_0xf881('0x5d')](_0x1a6aaa['query'],_0xf61965[_0xf881('0x36')]));_0x5cb0af['where'][_0xf881('0x59')]=_0x14dc19['id'];if(_0x1a6aaa['query']['filter']){_0x5cb0af[_0xf881('0x3f')]=_[_0xf881('0x41')](_0x5cb0af['where'],{'$or':_[_0xf881('0x2f')](_0x5cb0af[_0xf881('0x39')],function(_0x455338){var _0x238373={};_0x238373[_0x455338]={'$like':'%'+_0x1a6aaa[_0xf881('0x38')][_0xf881('0x40')]+'%'};return _0x238373;})});}_0x5cb0af=_[_0xf881('0x41')]({},_0x5cb0af,_0x1a6aaa[_0xf881('0x43')]);return db[_0xf881('0x5f')][_0xf881('0x24')]({'where':_0x5cb0af[_0xf881('0x3f')]})[_0xf881('0x14')](function(_0x28d746){_0x4f04de[_0xf881('0x24')]=_0x28d746;if(_0x1a6aaa[_0xf881('0x38')]['includeAll']){_0x5cb0af['include']=[{'all':!![]}];}return db[_0xf881('0x5f')][_0xf881('0x46')](_0x5cb0af);})[_0xf881('0x14')](function(_0x698b0c){_0x4f04de['rows']=_0x698b0c;return _0x4f04de;});}})[_0xf881('0x14')](respondWithFilteredResult(_0x26142f,_0x5cb0af))[_0xf881('0x1d')](handleError(_0x26142f,null));};exports['removeAnswers']=function(_0x35e4da,_0x147fd){return db['ChatWebsite'][_0xf881('0x4c')]({'where':{'id':_0x35e4da['params']['id']}})['then'](handleEntityNotFound(_0x147fd,null))['then'](function(_0x359ccd){if(_0x359ccd){return _0x359ccd[_0xf881('0x60')](_0x35e4da[_0xf881('0x38')][_0xf881('0x61')]);}})[_0xf881('0x14')](respondWithStatusCode(_0x147fd,null))[_0xf881('0x1d')](handleError(_0x147fd,null));};exports[_0xf881('0x62')]=function(_0x256b4d,_0x2b9f2c){_0x256b4d['body'][_0xf881('0x63')]=_0x256b4d[_0xf881('0x64')]['filename'];return db['ChatWebsite'][_0xf881('0x4c')]({'where':{'id':_0x256b4d['params']['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x2b9f2c,null))[_0xf881('0x14')](saveUpdates(_0x256b4d['body'],null))[_0xf881('0x14')](respondWithResult(_0x2b9f2c,null))[_0xf881('0x1d')](handleError(_0x2b9f2c,null));};exports[_0xf881('0x65')]=function(_0x1c69dc,_0x760175){_0x1c69dc[_0xf881('0x4e')]['agentAvatar']=_0x1c69dc[_0xf881('0x64')]['filename'];return db[_0xf881('0x30')][_0xf881('0x4c')]({'where':{'id':_0x1c69dc['params']['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x760175,null))[_0xf881('0x14')](saveUpdates(_0x1c69dc[_0xf881('0x4e')],null))[_0xf881('0x14')](respondWithResult(_0x760175,null))[_0xf881('0x1d')](handleError(_0x760175,null));};exports['addCustomerAvatar']=function(_0x303607,_0x33f1ee){_0x303607[_0xf881('0x4e')][_0xf881('0x66')]=_0x303607[_0xf881('0x64')][_0xf881('0x67')];return db[_0xf881('0x30')]['find']({'where':{'id':_0x303607[_0xf881('0x49')]['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x33f1ee,null))[_0xf881('0x14')](saveUpdates(_0x303607['body'],null))['then'](respondWithResult(_0x33f1ee,null))[_0xf881('0x1d')](handleError(_0x33f1ee,null));};exports[_0xf881('0x68')]=function(_0x5a901c,_0x823ee){_0x5a901c[_0xf881('0x4e')][_0xf881('0x69')]=_0x5a901c[_0xf881('0x64')][_0xf881('0x67')];return db[_0xf881('0x30')]['find']({'where':{'id':_0x5a901c[_0xf881('0x49')]['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x823ee,null))['then'](saveUpdates(_0x5a901c[_0xf881('0x4e')],null))[_0xf881('0x14')](respondWithResult(_0x823ee,null))[_0xf881('0x1d')](handleError(_0x823ee,null));};exports[_0xf881('0x6a')]=function(_0x5e01c7,_0x2ef406){var _0x4e681d=path[_0xf881('0x6b')](config['root'],_0xf881('0x6c'));var _0x144fc1={'where':{'id':_0x5e01c7[_0xf881('0x49')]['id']},'attributes':['id',_0xf881('0x63')],'raw':!![]};var _0x423f6a=![];return require(_0xf881('0x6d'))[_0xf881('0x6e')]()[_0xf881('0x14')](function(_0x5ebe6c){if(_0x5ebe6c){_0x423f6a=_0x5ebe6c[_0xf881('0x6f')];}})[_0xf881('0x14')](function(){return db[_0xf881('0x30')][_0xf881('0x4c')](_0x144fc1);})['then'](handleEntityNotFound(_0x2ef406,null))['then'](function(_0x24da84){if(_0x24da84){if(!_[_0xf881('0x70')](_0x24da84[_0xf881('0x63')])){if(fs[_0xf881('0x71')](path[_0xf881('0x6b')](config[_0xf881('0x72')],_0xf881('0x73'),_0x24da84[_0xf881('0x63')]))&&_0x423f6a){_0x4e681d=path[_0xf881('0x6b')](config[_0xf881('0x72')],_0xf881('0x73'),_0x24da84[_0xf881('0x63')]);}}return _0x2ef406['download'](_0x4e681d);}})[_0xf881('0x1d')](handleError(_0x2ef406,null));};exports[_0xf881('0x74')]=function(_0x1ede2f,_0x173ca7){var _0x241a0c=path[_0xf881('0x6b')](config['root'],_0xf881('0x75'));var _0x2ad3be={'where':{'id':_0x1ede2f['params']['id']},'attributes':['id',_0xf881('0x76')],'raw':!![]};return db[_0xf881('0x30')][_0xf881('0x4c')](_0x2ad3be)[_0xf881('0x14')](handleEntityNotFound(_0x173ca7,null))['then'](function(_0x598c58){if(_0x598c58){if(!_[_0xf881('0x70')](_0x598c58[_0xf881('0x76')])){if(fs[_0xf881('0x71')](path[_0xf881('0x6b')](config['root'],'server/files/images/avatars/',_0x598c58['agentAvatar']))){_0x241a0c=path[_0xf881('0x6b')](config[_0xf881('0x72')],_0xf881('0x77'),_0x598c58[_0xf881('0x76')]);}}return _0x173ca7[_0xf881('0x78')](_0x241a0c);}})[_0xf881('0x1d')](handleError(_0x173ca7,null));};exports[_0xf881('0x79')]=function(_0x474391,_0x4d3947){var _0x1c3412=path['join'](config[_0xf881('0x72')],_0xf881('0x7a'));var _0x22e469={'where':{'id':_0x474391[_0xf881('0x49')]['id']},'attributes':['id',_0xf881('0x66'),'showCustomerAvatar'],'raw':!![]};return db[_0xf881('0x30')][_0xf881('0x4c')](_0x22e469)['then'](handleEntityNotFound(_0x4d3947,null))[_0xf881('0x14')](function(_0x248135){if(_0x248135){if(!_['isNil'](_0x248135['customerAvatar'])){if(fs[_0xf881('0x71')](path[_0xf881('0x6b')](config[_0xf881('0x72')],_0xf881('0x77'),_0x248135[_0xf881('0x66')]))&&_0x248135[_0xf881('0x7b')]){_0x1c3412=path[_0xf881('0x6b')](config[_0xf881('0x72')],_0xf881('0x77'),_0x248135[_0xf881('0x66')]);}}return _0x4d3947[_0xf881('0x78')](_0x1c3412);}})[_0xf881('0x1d')](handleError(_0x4d3947,null));};exports[_0xf881('0x7c')]=function(_0x158188,_0x558f19){var _0x5d2591=path[_0xf881('0x6b')](config[_0xf881('0x72')],_0xf881('0x7d'));var _0x1b732c={'where':{'id':_0x158188[_0xf881('0x49')]['id']},'attributes':['id',_0xf881('0x69')],'raw':!![]};return db['ChatWebsite'][_0xf881('0x4c')](_0x1b732c)[_0xf881('0x14')](handleEntityNotFound(_0x558f19,null))['then'](function(_0x2d0dab){if(_0x2d0dab){if(!_['isNil'](_0x2d0dab[_0xf881('0x69')])){if(fs[_0xf881('0x71')](path['join'](config[_0xf881('0x72')],_0xf881('0x77'),_0x2d0dab['systemAvatar']))){_0x5d2591=path[_0xf881('0x6b')](config['root'],_0xf881('0x77'),_0x2d0dab[_0xf881('0x69')]);}}return _0x558f19[_0xf881('0x78')](_0x5d2591);}})[_0xf881('0x1d')](handleError(_0x558f19,null));};exports[_0xf881('0x7e')]=function(_0x205212,_0x231e39){var _0x4d0824=require(_0xf881('0x7f'));var _0x46472c=new _0x4d0824();var _0x29c17c=_0x46472c['setUA'](_0x205212[_0xf881('0x80')][_0xf881('0x81')])[_0xf881('0x82')]();var _0x3249ef={'body':_0x205212[_0xf881('0x4e')],'channel':_0xf881('0x83')};var _0x41b054=[];var _0x946667=[];var _0x1fe12c={};var _0xfa28d1=![];return db[_0xf881('0x84')]['describe']()['then'](function(_0x47727a){if(!_0x47727a){throw new db['Sequelize']['ValidationError'](_0xf881('0x85'));}_0x41b054=_[_0xf881('0x86')](_[_0xf881('0x35')](_0x47727a),['createdAt',_0xf881('0x87')]);_0x946667=_[_0xf881('0x86')](_[_0xf881('0x35')](_0x47727a),[_0xf881('0x88'),_0xf881('0x87'),_0xf881('0x89'),_0xf881('0x8a')]);if(_0x205212[_0xf881('0x4e')]['id']){delete _0x205212[_0xf881('0x4e')]['id'];}if(_['isNil'](_0x205212[_0xf881('0x4e')][_0xf881('0x8b')])){throw new db[(_0xf881('0x8c'))]['ValidationError'](_0xf881('0x8d'));}if(_[_0xf881('0x70')](_0x205212['body']['body'])||_0x205212[_0xf881('0x4e')][_0xf881('0x4e')]===''){throw new db[(_0xf881('0x8c'))][(_0xf881('0x8e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf881('0x70')](_0x205212['body'][_0xf881('0x8f')])){throw new db[(_0xf881('0x8c'))][(_0xf881('0x8e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x946667);}if(!_[_0xf881('0x90')](_0x946667,_0x205212[_0xf881('0x4e')]['mapKey'])){throw new db[(_0xf881('0x8c'))][(_0xf881('0x8e'))](_0xf881('0x91')+_0x946667);}_0x1fe12c[_0x205212['body']['mapKey']]=_0x205212[_0xf881('0x4e')][_0xf881('0x8b')];})['then'](function(){return db[_0xf881('0x30')]['find']({'where':{'id':_0x205212[_0xf881('0x49')]['id']},'include':[{'model':db['CmList'],'as':_0xf881('0x92'),'include':[{'model':db['CmContact'],'as':_0xf881('0x93'),'where':_0x1fe12c,'limit':0x1,'order':[[_0xf881('0x87'),_0xf881('0x94')]]}]},{'model':db[_0xf881('0x95')],'as':_0xf881('0x96')}]});})['then'](handleEntityNotFound(_0x231e39,null))[_0xf881('0x14')](function(_0x1bca04){if(_0x1bca04&&_0x1bca04[_0xf881('0x92')]){_0x3249ef[_0xf881('0x97')]=_0x1bca04;_0x3249ef[_0xf881('0x98')]=_0x1bca04[_0xf881('0x96')];_0x3249ef[_0xf881('0x99')]=_0x1bca04[_0xf881('0x92')];_0x3249ef[_0xf881('0x98')]=_[_0xf881('0x9a')](_0x3249ef[_0xf881('0x98')],[_0xf881('0x9b')],['asc']);if(_0x3249ef[_0xf881('0x97')][_0xf881('0x96')]){delete _0x3249ef[_0xf881('0x97')][_0xf881('0x96')];}if(_0x3249ef['account'][_0xf881('0x92')]&&_0x3249ef[_0xf881('0x97')]['List'][_0xf881('0x93')][_0xf881('0x4b')]){return _0x3249ef[_0xf881('0x97')][_0xf881('0x92')][_0xf881('0x93')][0x0];}var _0x2cf04b=_[_0xf881('0xc')](_0x205212[_0xf881('0x4e')],{'firstName':_0x205212[_0xf881('0x4e')]['from'],'ListId':_0x1bca04[_0xf881('0x8a')]});_0x2cf04b[_0x205212[_0xf881('0x4e')][_0xf881('0x8f')]]=_0x205212[_0xf881('0x4e')]['from'];return db[_0xf881('0x84')][_0xf881('0x4d')](_0x2cf04b,{'fields':_0x41b054,'raw':!![]});}})[_0xf881('0x14')](handleEntityNotFound(_0x231e39,null))['then'](function(_0x44b677){_0x3249ef[_0xf881('0x9c')]=_0x44b677;var _0x145bc8=_0x205212[_0xf881('0x4e')]['customerIp'];if(_0x205212['headers'][_0xf881('0x9d')]){_0x145bc8=_0x205212[_0xf881('0x80')][_0xf881('0x9d')];}else if(_0x205212[_0xf881('0x80')][_0xf881('0x9e')]){_0x145bc8=_['first'](_0x205212[_0xf881('0x80')]['x-forwarded-for'][_0xf881('0x9f')](','));}if(_0x44b677){var _0x2131c4={'ContactId':_0x44b677['id'],'ChatWebsiteId':_0x205212[_0xf881('0x49')]['id'],'from':(_0x44b677[_0xf881('0xa0')]||'')+'\x20'+(_0x44b677['lastName']||''),'customerIp':_0x145bc8,'customerPort':_0x205212[_0xf881('0x80')][_0xf881('0xa1')]?_0x205212['headers'][_0xf881('0xa1')]:null,'referer':_0x205212[_0xf881('0x4e')][_0xf881('0xa2')],'browserName':_0x29c17c[_0xf881('0xa3')]['name']&&_0x29c17c[_0xf881('0xa3')][_0xf881('0xa4')]?util[_0xf881('0xa5')](_0xf881('0xa6'),_0x29c17c['browser'][_0xf881('0x2c')],_0x29c17c[_0xf881('0xa3')][_0xf881('0xa4')]):_0xf881('0xa7'),'browserVersion':_0x29c17c['browser'][_0xf881('0xa4')]||_0xf881('0xa7'),'osName':util['format'](_0xf881('0xa6'),_0x29c17c['os'][_0xf881('0x2c')],_0x29c17c['os']['version']),'osVersion':_0x29c17c['os']['version'],'deviceModel':_0x29c17c[_0xf881('0xa8')]['model']&&_0x29c17c[_0xf881('0xa8')][_0xf881('0xa9')]?util[_0xf881('0xa5')]('%s\x20%s\x20%s',_0x29c17c[_0xf881('0xa8')][_0xf881('0x34')],_0x29c17c[_0xf881('0xa8')]['vendor'],_0x29c17c['device']['type']):null,'deviceVendor':_0x29c17c['device'][_0xf881('0xa9')],'deviceType':_0x29c17c[_0xf881('0xa8')]['type'],'formData':JSON[_0xf881('0x19')](_0x205212[_0xf881('0x4e')])};var _0x1b6cc1={'ChatWebsiteId':_0x205212['params']['id'],'closed':![]};if(_0x205212['body'][_0xf881('0xaa')]){_0x1b6cc1['threadId']=_0x205212[_0xf881('0x4e')]['threadId'];return db[_0xf881('0xab')][_0xf881('0x4c')]({'where':_0x1b6cc1})[_0xf881('0x14')](function(_0x32604a){if(_0x32604a){return[_0x32604a,![]];}_0x2131c4[_0xf881('0xaa')]=_0x205212[_0xf881('0x4e')]['threadId'];_0x2131c4[_0xf881('0xac')]=_0x205212[_0xf881('0x4e')][_0xf881('0xac')];return db[_0xf881('0xab')]['create'](_0x2131c4)[_0xf881('0x14')](function(_0x32e946){return[_0x32e946,!![]];});});}_0x1b6cc1['ContactId']=_0x44b677['id'];if(_0x205212['body']['interaction']&&_0x205212[_0xf881('0x4e')][_0xf881('0xad')]['id']){_0x1b6cc1['id']=_0x205212['body'][_0xf881('0xad')]['id'];return db[_0xf881('0xab')][_0xf881('0x4c')]({'where':_0x1b6cc1})[_0xf881('0x14')](function(_0x37acc3){if(_0x37acc3){return[_0x37acc3,![]];}return db['ChatInteraction'][_0xf881('0x4d')](_0x2131c4)[_0xf881('0x14')](function(_0x5ca7be){return[_0x5ca7be,!![]];});});}return db[_0xf881('0xab')]['create'](_0x2131c4)['then'](function(_0x4272ab){return[_0x4272ab,!![]];});}})[_0xf881('0xae')](function(_0x35a711,_0x5d79f6){if(_0x35a711){_0xfa28d1=_0x5d79f6;if(!_0x5d79f6){var _0x34de51={'from':(_0x3249ef[_0xf881('0x9c')]['firstName']||'')+'\x20'+(_0x3249ef[_0xf881('0x9c')]['lastName']||'')};if(_0x205212[_0xf881('0x4e')]['threadId']&&_0x205212[_0xf881('0x4e')][_0xf881('0xaf')]&&_0x205212[_0xf881('0x4e')][_0xf881('0xaa')]!=_0x205212[_0xf881('0x4e')][_0xf881('0xaf')]){_0x34de51[_0xf881('0xaa')]=_0x205212[_0xf881('0x4e')][_0xf881('0xaf')];}return _0x35a711[_0xf881('0x27')](_0x34de51);}else{return _0x35a711;}}})[_0xf881('0x14')](function(_0x652f62){_0x3249ef[_0xf881('0xad')]=_0x652f62[_0xf881('0x52')]({'plain':!![]});_0x3249ef['interaction'][_0xf881('0xb0')]=_0xfa28d1;if(_0x3249ef['interaction'][_0xf881('0xb0')]){if(_0x3249ef[_0xf881('0x97')][_0xf881('0xb1')]){_0x3249ef[_0xf881('0x98')]['push']({'id':0x0,'priority':_0x3249ef[_0xf881('0x98')][_0xf881('0x4b')]+0x1,'app':'close','appdata':_0xf881('0xb2'),'interval':_0xf881('0xb3')});}}return db[_0xf881('0xb4')][_0xf881('0x4d')]({'body':_0x205212['body'][_0xf881('0x4e')],'ChatWebsiteId':_0x205212['params']['id'],'ChatInteractionId':_0x652f62['id'],'direction':'in','ContactId':_0x3249ef[_0xf881('0x9c')]['id'],'AttachmentId':_0x205212[_0xf881('0x4e')][_0xf881('0xb5')]});})['then'](function(_0xbb70e2){_0x3249ef[_0xf881('0x1c')]=_0xbb70e2;if(_0x3249ef[_0xf881('0xad')][_0xf881('0xb6')]){return db[_0xf881('0xb7')][_0xf881('0x4c')]({'attributes':['id','name'],'where':{'id':_0x3249ef[_0xf881('0xad')][_0xf881('0xb6')]}})[_0xf881('0x14')](function(_0x4c1d4f){if(_0x4c1d4f){_0x3249ef[_0xf881('0x98')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf881('0xb8'),'appdata':_0x4c1d4f['name']+','+(_0x3249ef['account'][_0xf881('0xb9')]||0xa),'interval':_0xf881('0xb3')});_0x3249ef[_0xf881('0xba')]=!![];}return respondWithRpcPromise(_0xf881('0xbb'),_0xf881('0xbc'),_0x3249ef);});}return respondWithRpcPromise(_0xf881('0xbb'),'startRouting',_0x3249ef);})[_0xf881('0x14')](function(_0x2ef669){respondWithRpcPromise(_0xf881('0xbd'),_0xf881('0xbd'),{'event':'notify','message':_0x2ef669},client9002);return _0x2ef669;})[_0xf881('0x14')](respondWithResult(_0x231e39,null))['catch'](handleError(_0x231e39,null));};exports[_0xf881('0xbe')]=function(_0x464364,_0x784010){var _0x3cbd61,_0x1c7548,_0x24e968;var _0x35fdf4=[];var _0x1fb340={};var _0x1a7680=_0x464364[_0xf881('0xbf')]||[];var _0x5bb8b6=[];var _0x5abf78;return db[_0xf881('0x84')]['describe']()[_0xf881('0x14')](function(_0x3342fc){if(!_0x3342fc){throw new db[(_0xf881('0x8c'))][(_0xf881('0x8e'))](_0xf881('0x85'));}_0x35fdf4=_[_0xf881('0x86')](_['keys'](_0x3342fc),[_0xf881('0x88'),_0xf881('0x87'),_0xf881('0x89'),_0xf881('0x8a')]);if(_0x464364[_0xf881('0x4e')]['id']){delete _0x464364[_0xf881('0x4e')]['id'];}if(_[_0xf881('0x70')](_0x464364[_0xf881('0x4e')][_0xf881('0x8b')])){throw _0x784010[_0xf881('0x1e')](0x1f4)[_0xf881('0x2d')](new db['Sequelize'][(_0xf881('0x8e'))]('from\x20is\x20mandatory'));}if(_[_0xf881('0x70')](_0x464364[_0xf881('0x4e')][_0xf881('0x4e')])||_0x464364[_0xf881('0x4e')]['body']===''){throw _0x784010['status'](0x1f4)['send'](new db[(_0xf881('0x8c'))][(_0xf881('0x8e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xf881('0x70')](_0x464364[_0xf881('0x4e')][_0xf881('0xc0')])){throw _0x784010['status'](0x1f4)[_0xf881('0x2d')](new db['Sequelize']['ValidationError'](_0xf881('0xc1')+_0x35fdf4));}if(!_[_0xf881('0x90')](_0x35fdf4,_0x464364[_0xf881('0x4e')][_0xf881('0xc0')])){throw _0x784010[_0xf881('0x1e')](0x1f4)[_0xf881('0x2d')](new db[(_0xf881('0x8c'))][(_0xf881('0x8e'))](_0xf881('0xc2')+_0x35fdf4));}_0x1fb340[_0x464364['body'][_0xf881('0xc0')]]=_0x464364['body'][_0xf881('0x8b')];})['then'](function(){return db[_0xf881('0x30')][_0xf881('0x4c')]({'where':{'id':_0x464364[_0xf881('0x49')]['id']},'include':[{'model':db[_0xf881('0xc3')],'as':_0xf881('0x92')},{'model':db['MailAccount'],'as':_0xf881('0xc4')}]});})[_0xf881('0x14')](handleEntityNotFound(_0x784010,null))[_0xf881('0x14')](function(_0x2a33a7){if(_0x2a33a7&&_0x2a33a7[_0xf881('0x92')]){_0x1c7548=_0x2a33a7;var _0x107574=_[_0xf881('0xc')](_0x464364[_0xf881('0x4e')],{'firstName':_0x464364[_0xf881('0x4e')][_0xf881('0x8b')],'phone':_0x464364[_0xf881('0x4e')]['from'],'ListId':_0x2a33a7[_0xf881('0x8a')]});_0x107574[_0x464364[_0xf881('0x4e')][_0xf881('0xc0')]]=_0x464364[_0xf881('0x4e')][_0xf881('0x8b')];return db[_0xf881('0x84')][_0xf881('0xc5')]({'where':_0x1fb340,'defaults':_0x107574});}})[_0xf881('0xae')](function(_0x53252f){if(_0x53252f){_0x24e968=_0x53252f;var _0x46d77e=fs['readFileSync'](path[_0xf881('0x6b')](config['root'],_0xf881('0xc6')),_0xf881('0xc7'));var _0x5af1c8=ejs['render'](_0x46d77e,{'body':_[_0xf881('0xc8')](_0x464364[_0xf881('0x4e')][_0xf881('0x4e')]),'bodyTitle':_0x1c7548[_0xf881('0xc9')]});return db[_0xf881('0xca')][_0xf881('0x4d')]({'body':_0x5af1c8,'plainBody':htmlToText[_0xf881('0xcb')](_0x5af1c8),'ContactId':_0x53252f['id'],'ChatWebsiteId':_0x1c7548['id']});}})[_0xf881('0x14')](function(_0x174911){_0x5abf78=_0x174911;if(_0x1a7680['length']){var _0x5f30e0=_0x1a7680['map'](function(_0x438415){return{'name':_0x438415['originalname'],'basename':_0x438415[_0xf881('0x67')],'type':_0x438415[_0xf881('0xcc')],'ChatOfflineMessageId':_0x174911['id']};});_0x5bb8b6=_0x5f30e0['map'](_0xd4d94d=>{var _0x116f48={'filename':_0xd4d94d[_0xf881('0x2c')],'path':path[_0xf881('0x6b')](config['root'],_0xf881('0xcd'),'files',_0xf881('0xce'),_0xf881('0xcf'),_0xd4d94d[_0xf881('0xd0')])};return _0x116f48;});if(!_0x1c7548['openNewInteraction']){return db[_0xf881('0xd1')]['transaction'](function(_0xd7706f){return db[_0xf881('0xd2')][_0xf881('0xd3')](_0x5f30e0,{'transaction':_0xd7706f});});}}})[_0xf881('0x14')](function(){if(_0x5abf78){_0x3cbd61=_0x5abf78;return db[_0xf881('0xc4')][_0xf881('0x5b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf881('0xd4'),'raw':!![],'include':[{'model':db[_0xf881('0xd5')],'as':_0xf881('0xd5'),'raw':!![]}]}]});}})[_0xf881('0x14')](function(_0x5813bc){if(_0x5813bc&&_0x5813bc[_0xf881('0xd4')]&&_0x1c7548[_0xf881('0xd6')]&&_0x1c7548[_0xf881('0xd7')]){var _0x25d587=_0x5813bc['getSmtpOptions']();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x25d587,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x5813bc[_0xf881('0x2c')],_0x5813bc[_0xf881('0xd8')]||_0x5813bc['Smtp'][_0xf881('0x51')]),'to':_0x1c7548[_0xf881('0xd7')],'subject':_0x1c7548[_0xf881('0xd9')],'html':_0x3cbd61[_0xf881('0x4e')],'attachments':_0x5bb8b6}},client9003)[_0xf881('0x14')](function(){return _0x3cbd61;})[_0xf881('0x1d')](function(_0x43d9eb){logger[_0xf881('0x1a')](_0x43d9eb);});}})['then'](function(){if(_0x1c7548&&_0x1c7548[_0xf881('0xda')]&&_0x1c7548['MailAccountId']){var _0x12b985=[];if(_0x1a7680[_0xf881('0x4b')]){_0x12b985=_0x1a7680[_0xf881('0x2f')](function(_0x5bbc2a){return{'name':_0x5bbc2a[_0xf881('0xdb')],'basename':_0x5bbc2a[_0xf881('0x67')],'type':_0x5bbc2a[_0xf881('0xcc')],'ChatOfflineMessageId':_0x5abf78['id']};});}var _0x15ee31;if(!_['isNil'](_0x1c7548['subjectOffline'])){var _0x58bbb4=_[_0xf881('0x2f')](_0x464364['body'],function(_0x14ed0c){return _0x14ed0c;});var _0x57c155=_[_0xf881('0xdc')](_0x58bbb4)[0x0];var _0x462fcb=_['mapValues'](_0x57c155,function(_0xc94a8b){return _0xc94a8b;});_0x15ee31=_0x462fcb[0x1][_0x1c7548[_0xf881('0xdd')]];}var _0x7a300={'from':_0x24e968['email'],'firstName':_0x24e968['firstName'],'lastName':_0x24e968[_0xf881('0xde')],'mapKey':'email','message':{'from':_0x24e968['email'],'to':_0x1c7548[_0xf881('0xc4')][_0xf881('0xd8')],'cc':'','subject':_[_0xf881('0x70')](_0x15ee31)?_0x1c7548[_0xf881('0xd9')]:_0x15ee31,'messageId':'','sentAt':new Date(),'attach':_0x12b985[_0xf881('0x4b')],'attachments':_0x12b985,'originChannel':_0xf881('0xdf'),'ChatWebsiteId':_0x1c7548['id'],'ChatOfflineMessageId':_0x3cbd61['id'],'originTo':_0x1c7548['MailAccount'][_0xf881('0xd8')]},'body':_0x3cbd61['body']};var _0x490065={'account':{'id':_0x1c7548[_0xf881('0xe0')]},'body':_0x7a300,'log':_0xf881('0xe1')};return respondWithRpcPromise(_0xf881('0xe1'),_0xf881('0xe2'),_0x490065,client9001)[_0xf881('0x14')](function(){return _0x3cbd61;})['catch'](function(_0x17f12c){logger[_0xf881('0x1a')](_0x17f12c);});}return;})[_0xf881('0x14')](function(){if(_0x3cbd61){return _0x3cbd61;}})[_0xf881('0x14')](respondWithResult(_0x784010,null))[_0xf881('0x1d')](function(_0x4f634b){logger[_0xf881('0x1a')]('catch',_0x4f634b);for(var _0x8f2337 of _0x1a7680){var _0x1f2a19=path[_0xf881('0x6b')](config[_0xf881('0x72')],_0xf881('0xcd'),_0xf881('0xbf'),_0xf881('0xce'),_0xf881('0xcf'),_0x8f2337[_0xf881('0x67')]);fs_extra[_0xf881('0xe3')](_0x1f2a19)[_0xf881('0x1d')](function(_0x2fe295){logger[_0xf881('0x1a')](_0xf881('0xe4'),_0x1f2a19,_0x2fe295);});}});};exports[_0xf881('0xe5')]=function(_0x2ce46b,_0x123140){return db[_0xf881('0xab')][_0xf881('0x4c')]({'where':{'id':_0x2ce46b[_0xf881('0x49')]['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x123140,null))['then'](function(_0x2b4ebb){if(_0x2b4ebb){return _0x2b4ebb[_0xf881('0xe5')](_0x2ce46b['body'][_0xf881('0x61')],_[_0xf881('0xe6')](_0x2ce46b[_0xf881('0x4e')],[_0xf881('0x61'),'id'])||{});}})[_0xf881('0x14')](respondWithResult(_0x123140,null))['catch'](handleError(_0x123140,null));};exports['getInteractions']=function(_0x311b31,_0x1d5d2c){var _0x19f9d2={'raw':![],'where':{}};var _0x1edaf3={};var _0x3dcfc2={'count':0x0,'rows':[]};return db[_0xf881('0x30')][_0xf881('0x5b')]({'where':{'id':_0x311b31['params']['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x1d5d2c,null))[_0xf881('0x14')](function(_0x55edf2){if(_0x55edf2){_0x1edaf3['model']=_[_0xf881('0x35')](db['ChatInteraction']['rawAttributes']);_0x1edaf3[_0xf881('0x38')]=_[_0xf881('0x35')](_0x311b31[_0xf881('0x38')]);_0x1edaf3[_0xf881('0x36')]=_[_0xf881('0x37')](_0x1edaf3[_0xf881('0x34')],_0x1edaf3[_0xf881('0x38')]);_0x19f9d2[_0xf881('0x39')]=_[_0xf881('0x37')](_0x1edaf3[_0xf881('0x34')],qs[_0xf881('0x3a')](_0x311b31[_0xf881('0x38')]['fields']));_0x19f9d2['attributes']=_0x19f9d2[_0xf881('0x39')]['length']?_0x19f9d2['attributes']:_0x1edaf3[_0xf881('0x34')];if(!_0x311b31[_0xf881('0x38')][_0xf881('0x3b')]('nolimit')){_0x19f9d2[_0xf881('0x22')]=qs['limit'](_0x311b31[_0xf881('0x38')][_0xf881('0x22')]);_0x19f9d2[_0xf881('0x23')]=qs['offset'](_0x311b31[_0xf881('0x38')][_0xf881('0x23')]);}_0x19f9d2[_0xf881('0x3d')]=qs[_0xf881('0x3e')](_0x311b31[_0xf881('0x38')][_0xf881('0x3e')]);_0x19f9d2[_0xf881('0x3f')]=qs['filters'](_[_0xf881('0x5d')](_0x311b31[_0xf881('0x38')],_0x1edaf3[_0xf881('0x36')]));_0x19f9d2[_0xf881('0x3f')][_0xf881('0x59')]=_0x55edf2['id'];if(_0x311b31['query']['filter']){_0x19f9d2[_0xf881('0x3f')]=_[_0xf881('0x41')](_0x19f9d2[_0xf881('0x3f')],{'$or':_['map'](_0x19f9d2[_0xf881('0x39')],function(_0xccd5df){var _0x5e84fe={};_0x5e84fe[_0xccd5df]={'$like':'%'+_0x311b31[_0xf881('0x38')][_0xf881('0x40')]+'%'};return _0x5e84fe;})});}_0x19f9d2=_['merge']({},_0x19f9d2,_0x311b31[_0xf881('0x43')]);return db[_0xf881('0xab')][_0xf881('0x24')]({'where':_0x19f9d2['where']})['then'](function(_0x5007f5){_0x3dcfc2[_0xf881('0x24')]=_0x5007f5;if(_0x311b31[_0xf881('0x38')][_0xf881('0x44')]){_0x19f9d2[_0xf881('0x45')]=[{'model':db[_0xf881('0x84')],'as':_0xf881('0xe7'),'required':![]},{'model':db[_0xf881('0xb7')],'as':_0xf881('0xe8'),'attributes':[_0xf881('0x2c'),_0xf881('0xe9'),'internal'],'required':![]},{'model':db[_0xf881('0xea')],'as':'Tags','attributes':['id',_0xf881('0x2c'),_0xf881('0xeb')],'where':_0x311b31[_0xf881('0x38')][_0xf881('0xec')]?{'id':_0x311b31[_0xf881('0x38')][_0xf881('0xec')]}:undefined,'required':_0x311b31[_0xf881('0x38')][_0xf881('0xec')]?!![]:![]}];}return db['ChatInteraction'][_0xf881('0x46')](_0x19f9d2);})[_0xf881('0x14')](function(_0x15b0fd){_0x3dcfc2['rows']=_0x15b0fd;return _0x3dcfc2;});}})[_0xf881('0x14')](respondWithFilteredResult(_0x1d5d2c,_0x19f9d2))['catch'](handleError(_0x1d5d2c,null));};function iftimePromise(_0x426ad4,_0x3b1b0c){return respondWithRpcPromise(_0xf881('0xed'),_0xf881('0xee'),{'command':_0x3b1b0c[_0xf881('0xef')]?util[_0xf881('0xa5')](_0xf881('0xf0'),_0x426ad4[_0xf881('0xf1')],_0x3b1b0c[_0xf881('0xef')]):util[_0xf881('0xa5')](_0xf881('0xf2'),_0x426ad4[_0xf881('0xf1')])},client9002)[_0xf881('0x14')](function(_0x23b5a0){var _0x5077fa=_0x23b5a0&&_0x23b5a0[_0xf881('0xf3')](_0xf881('0xf4'))>=0x0?!![]:![];logger[_0xf881('0x15')](_0xf881('0xf5'),_0x3b1b0c['id'],_0x426ad4['id'],_0x426ad4[_0xf881('0xf1')],_0x5077fa?_0xf881('0xf6'):_0xf881('0xf7'),_0x3b1b0c[_0xf881('0xef')]?_0x3b1b0c[_0xf881('0xef')]:_0xf881('0xf8'));return _0x5077fa;})[_0xf881('0x1d')](function(_0x509ad2){logger[_0xf881('0x1a')](_0xf881('0xf5'),_0x3b1b0c['id'],_0x426ad4['id'],_0x426ad4[_0xf881('0xf1')],util[_0xf881('0xf9')](_0x509ad2,{'showHidden':![],'depth':null}),_0x3b1b0c[_0xf881('0xef')]?_0x3b1b0c[_0xf881('0xef')]:_0xf881('0xf8'));return![];});}exports[_0xf881('0xee')]=function(_0x54d6dc,_0x92e8b8){var _0x48fed0=0x0;var _0x830939=0x0;var _0x39a49a=![];var _0x2a18b3;var _0x56ce73;return db[_0xf881('0x30')][_0xf881('0x4c')]({'where':{'id':_0x54d6dc[_0xf881('0x49')]['id']},'include':[{'model':db['Interval'],'as':_0xf881('0xfa'),'include':[{'model':db[_0xf881('0xfa')],'as':_0xf881('0xfb'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xf881('0x14')](handleEntityNotFound(_0x92e8b8,null))[_0xf881('0x14')](function(_0x18e08a){if(_0x18e08a){_0x2a18b3=_0x18e08a;return _0x18e08a['getProactiveActions']({'raw':!![]});}})['then'](function(_0x310944){if(_0x2a18b3){if(_0x310944){_0x56ce73=_0x310944;}}return require(_0xf881('0x6d'))[_0xf881('0x6e')]();})[_0xf881('0x14')](function(_0x1e489a){if(_0x1e489a){_0x830939=_0x1e489a[_0xf881('0xfc')];_0x39a49a=_0x1e489a['custom'];}})[_0xf881('0x14')](function(){return db['ChatInteraction'][_0xf881('0x24')]({'where':{'closed':![]}});})[_0xf881('0x14')](function(_0x281063){_0x48fed0=_0x281063;if(_0x830939&&_0x281063>_0x830939){return db[_0xf881('0xfd')][_0xf881('0x5b')]({'where':{'id':0x1}})[_0xf881('0x14')](function(_0x19ce47){if(_0x19ce47){_0x19ce47[_0xf881('0xfe')](_0xf881('0xff'));}});}})[_0xf881('0x14')](function(){if(_0x2a18b3['Interval']&&_0x2a18b3[_0xf881('0xfa')][_0xf881('0xfb')]){var _0x8c5b11=[];for(var _0x4ba66d=0x0;_0x4ba66d<_0x2a18b3[_0xf881('0xfa')]['Intervals']['length'];_0x4ba66d++){var _0x3be103=_0x2a18b3[_0xf881('0xfa')][_0xf881('0xfb')][_0x4ba66d][_0xf881('0x52')]({'plain':!![]});_0x8c5b11[_0xf881('0x100')](iftimePromise(_0x3be103,_0x2a18b3));}return BPromise['all'](_0x8c5b11)[_0xf881('0x14')](function(_0x4cf6fc){return _[_0xf881('0x101')](_0x4cf6fc);});}else{return!![];}})[_0xf881('0x14')](function(_0x11c850){var _0x315c19=fs['readFileSync'](path['join'](config[_0xf881('0x72')],_0xf881('0x102')),'utf8');var _0x49b7f2={'remote':_0x2a18b3[_0xf881('0x103')],'query':querystring['stringify'](_[_0xf881('0x41')](_0x2a18b3['get']({'plain':!![]}),{'customerIp':_0x54d6dc['headers'][_0xf881('0x9e')]||_0x54d6dc['headers']['x-real-ip']||_0x54d6dc[_0xf881('0x104')][_0xf881('0x105')]||_0x54d6dc['ip'],'referer':_0x54d6dc[_0xf881('0x80')][_0xf881('0xa2')],'openedInteractions':_0x48fed0,'maxInteractions':_0x830939,'virtual':_0x39a49a[_0xf881('0xfc')],'online':_0x11c850,'custom':_0x39a49a}))[_0xf881('0x106')](/'/g,'\x5c\x27')};_0x92e8b8['send'](ejs['render'](Mustache[_0xf881('0x107')](_0x315c19,_0x49b7f2),{'proactiveActions':_0x56ce73,'alignment':_0x2a18b3[_0xf881('0x108')],'verticalAlignment':_0x2a18b3['verticalAlignment'],'div_color':_0x2a18b3['color'],'labelText':_0x2a18b3[_0xf881('0x109')],'text_color':_0x2a18b3[_0xf881('0x10a')],'text_button_color':_0x2a18b3[_0xf881('0x10b')],'button_color':_0x2a18b3[_0xf881('0x10c')],'background_color':_0x2a18b3[_0xf881('0x10d')],'hideWhenOffline':_0x2a18b3['hideWhenOffline'],'interval':_0x2a18b3[_0xf881('0x10e')]}));})[_0xf881('0x1d')](handleError(_0x92e8b8,null));};exports['addApplications']=function(_0x401253,_0x1a5a3f){var _0x229705=_0x401253[_0xf881('0x49')]['id'];var _0x3f3f80=_0x401253['body'];var _0x4fa6f5=0xc8;var _0x4971c7=null;return db[_0xf881('0xd1')][_0xf881('0x10f')]({'isolationLevel':db[_0xf881('0xd1')][_0xf881('0x110')][_0xf881('0x111')]['READ_COMMITTED']},function(_0x18cd3b){return db['ChatWebsite'][_0xf881('0x5b')]({'where':{'id':_0x229705},'transaction':_0x18cd3b})['then'](function(_0x145c62){if(_0x145c62){return db[_0xf881('0x95')][_0xf881('0x28')]({'where':{'ChatWebsiteId':_0x229705},'transaction':_0x18cd3b})[_0xf881('0x14')](function(){var _0x5f792b=_[_0xf881('0x2f')](_0x3f3f80,function(_0x4fad32){_0x4fad32[_0xf881('0x59')]=_0x229705;return _0x4fad32;});return db[_0xf881('0x95')][_0xf881('0xd3')](_0x5f792b,{'transaction':_0x18cd3b});});}else{_0x4fa6f5=0x194;_0x4971c7=[];}});})[_0xf881('0x14')](function(){if(_0x4fa6f5!==0x194){return db['ChatApplication'][_0xf881('0x112')]({'where':{'ChatWebsiteId':_0x229705},'order':_0xf881('0x9b')})[_0xf881('0x14')](function(_0xd68c5f){_0x4971c7=_0xd68c5f;});}})[_0xf881('0x1d')](function(_0x9bac9d){_0x4fa6f5=0x1f4;logger['error'](_0x9bac9d[_0xf881('0x2b')]);if(_0x9bac9d[_0xf881('0x2c')]){delete _0x9bac9d[_0xf881('0x2c')];}_0x4971c7=_0x9bac9d;})[_0xf881('0x113')](function(){if(_0x4971c7===null){_0x1a5a3f['sendStatus'](_0x4fa6f5);}else{if(_0x4fa6f5===0x1f4){_0x1a5a3f[_0xf881('0x1e')](_0x4fa6f5)[_0xf881('0x2d')](_0x4971c7);}else{_0x1a5a3f[_0xf881('0x1e')](_0x4fa6f5)[_0xf881('0x20')](_0x4971c7);}}});};exports[_0xf881('0x114')]=function(_0x5e0809,_0x57f149){var _0x108b38={};var _0x126acc={};var _0x3e3959;var _0x1a2573;return db[_0xf881('0x30')]['findOne']({'where':{'id':_0x5e0809[_0xf881('0x49')]['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x57f149,null))[_0xf881('0x14')](function(_0x36cf10){if(_0x36cf10){_0x3e3959=_0x36cf10;_0x126acc[_0xf881('0x34')]=_['keys'](db['ChatApplication'][_0xf881('0x31')]);_0x126acc[_0xf881('0x38')]=_[_0xf881('0x35')](_0x5e0809['query']);_0x126acc[_0xf881('0x36')]=_[_0xf881('0x37')](_0x126acc[_0xf881('0x34')],_0x126acc['query']);_0x108b38[_0xf881('0x39')]=_[_0xf881('0x37')](_0x126acc[_0xf881('0x34')],qs[_0xf881('0x3a')](_0x5e0809[_0xf881('0x38')][_0xf881('0x3a')]));_0x108b38['attributes']=_0x108b38[_0xf881('0x39')][_0xf881('0x4b')]?_0x108b38[_0xf881('0x39')]:_0x126acc[_0xf881('0x34')];_0x108b38[_0xf881('0x3d')]=qs[_0xf881('0x3e')](_0x5e0809['query'][_0xf881('0x3e')]);_0x108b38[_0xf881('0x3f')]=qs['filters'](_['pick'](_0x5e0809['query'],_0x126acc[_0xf881('0x36')]));if(_0x5e0809[_0xf881('0x38')][_0xf881('0x40')]){_0x108b38[_0xf881('0x3f')]=_[_0xf881('0x41')](_0x108b38[_0xf881('0x3f')],{'$or':_[_0xf881('0x2f')](_0x108b38['attributes'],function(_0x3d2d4a){var _0x3a807d={};_0x3a807d[_0x3d2d4a]={'$like':'%'+_0x5e0809[_0xf881('0x38')][_0xf881('0x40')]+'%'};return _0x3a807d;})});}_0x108b38=_[_0xf881('0x41')]({},_0x108b38,_0x5e0809[_0xf881('0x43')]);return _0x3e3959['getApplications'](_0x108b38);}})['then'](function(_0x17d206){if(_0x17d206){_0x1a2573=_0x17d206['length'];if(!_0x5e0809[_0xf881('0x38')]['hasOwnProperty']('nolimit')){_0x108b38[_0xf881('0x22')]=qs[_0xf881('0x22')](_0x5e0809[_0xf881('0x38')]['limit']);_0x108b38[_0xf881('0x23')]=qs[_0xf881('0x23')](_0x5e0809[_0xf881('0x38')][_0xf881('0x23')]);}return _0x3e3959[_0xf881('0x114')](_0x108b38);}})[_0xf881('0x14')](function(_0x1a32e8){if(_0x1a32e8){return _0x1a32e8?{'count':_0x1a2573,'rows':_0x1a32e8}:null;}})['then'](respondWithResult(_0x57f149,null))[_0xf881('0x1d')](handleError(_0x57f149,null));};exports['addProactiveActions']=function(_0x320b50,_0xb4919a){return db['chatProactiveAction'][_0xf881('0x4c')]({'where':{'id':_0x320b50['params']['id']}})[_0xf881('0x14')](handleEntityNotFound(_0xb4919a,null))['then'](function(_0x2c296a){if(_0x2c296a){return _0x2c296a[_0xf881('0x115')](_0x320b50['body'][_0xf881('0x61')],_[_0xf881('0xe6')](_0x320b50[_0xf881('0x4e')],['ids','id'])||{});}})['then'](respondWithResult(_0xb4919a,null))[_0xf881('0x1d')](handleError(_0xb4919a,null));};exports[_0xf881('0x116')]=function(_0x367523,_0x286dc8){var _0x4a5d66={};var _0x5381a2={};var _0x3c0ef6;var _0x2e8c3f;return db['ChatWebsite'][_0xf881('0x5b')]({'where':{'id':_0x367523[_0xf881('0x49')]['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x286dc8,null))[_0xf881('0x14')](function(_0x5cbd8a){if(_0x5cbd8a){_0x3c0ef6=_0x5cbd8a;_0x5381a2['model']=_[_0xf881('0x35')](db[_0xf881('0x117')][_0xf881('0x31')]);_0x5381a2[_0xf881('0x38')]=_[_0xf881('0x35')](_0x367523[_0xf881('0x38')]);_0x5381a2['filters']=_[_0xf881('0x37')](_0x5381a2[_0xf881('0x34')],_0x5381a2[_0xf881('0x38')]);_0x4a5d66[_0xf881('0x39')]=_[_0xf881('0x37')](_0x5381a2[_0xf881('0x34')],qs[_0xf881('0x3a')](_0x367523[_0xf881('0x38')]['fields']));_0x4a5d66[_0xf881('0x39')]=_0x4a5d66[_0xf881('0x39')][_0xf881('0x4b')]?_0x4a5d66['attributes']:_0x5381a2[_0xf881('0x34')];_0x4a5d66[_0xf881('0x3d')]=qs['sort'](_0x367523[_0xf881('0x38')][_0xf881('0x3e')]);_0x4a5d66[_0xf881('0x3f')]=qs['filters'](_[_0xf881('0x5d')](_0x367523[_0xf881('0x38')],_0x5381a2['filters']));if(_0x367523['query']['filter']){_0x4a5d66[_0xf881('0x3f')]=_[_0xf881('0x41')](_0x4a5d66[_0xf881('0x3f')],{'$or':_['map'](_0x4a5d66[_0xf881('0x39')],function(_0x3f69ff){var _0x20051f={};_0x20051f[_0x3f69ff]={'$like':'%'+_0x367523[_0xf881('0x38')][_0xf881('0x40')]+'%'};return _0x20051f;})});}_0x4a5d66=_['merge']({},_0x4a5d66,_0x367523['options']);return _0x3c0ef6['getProactiveActions'](_0x4a5d66);}})[_0xf881('0x14')](function(_0x30890f){if(_0x30890f){_0x2e8c3f=_0x30890f['length'];if(!_0x367523['query'][_0xf881('0x3b')](_0xf881('0x3c'))){_0x4a5d66[_0xf881('0x22')]=qs[_0xf881('0x22')](_0x367523[_0xf881('0x38')]['limit']);_0x4a5d66[_0xf881('0x23')]=qs['offset'](_0x367523['query'][_0xf881('0x23')]);}return _0x3c0ef6[_0xf881('0x116')](_0x4a5d66);}})[_0xf881('0x14')](function(_0x111b1c){if(_0x111b1c){return _0x111b1c?{'count':_0x2e8c3f,'rows':_0x111b1c}:null;}})['then'](respondWithResult(_0x286dc8,null))[_0xf881('0x1d')](handleError(_0x286dc8,null));};exports[_0xf881('0x118')]=function(_0x2411a9,_0x1198cb){var _0x579dec=_0x2411a9[_0xf881('0x38')][_0xf881('0x119')]==='false'?_0xf881('0x11a'):'onlineForm';return db['ChatWebsite'][_0xf881('0x4c')]({'attributes':['id',_0x579dec],'where':{'id':_0x2411a9[_0xf881('0x49')]['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x1198cb,null))[_0xf881('0x14')](function(_0x2636ed){if(_0x2636ed){var _0x20f52d=_0x2636ed[_0x579dec];var _0x4edebe=_0x20f52d&&_0x20f52d[_0xf881('0x11b')]?_0x20f52d[_0xf881('0x11b')]:[];_0x1198cb[_0xf881('0x2d')]({'fromKey':_[_0xf881('0x70')](_0x20f52d[_0xf881('0x11c')])?undefined:_0x20f52d[_0xf881('0x11c')],'count':_0x4edebe[_0xf881('0x4b')],'rows':_0x4edebe});}})[_0xf881('0x1d')](handleError(_0x1198cb,null));};exports[_0xf881('0x11d')]=function(_0x430f27,_0x58095f){var _0x576a88={'raw':![],'where':{}};var _0x2d4d08={};var _0x31bc14={'count':0x0,'rows':[]};return db[_0xf881('0x30')][_0xf881('0x5b')]({'where':{'id':_0x430f27[_0xf881('0x49')]['id']}})['then'](handleEntityNotFound(_0x58095f,null))[_0xf881('0x14')](function(_0x5dafe9){if(_0x5dafe9){_0x2d4d08[_0xf881('0x34')]=_[_0xf881('0x35')](db[_0xf881('0xca')]['rawAttributes']);_0x2d4d08['query']=_['keys'](_0x430f27[_0xf881('0x38')]);_0x2d4d08[_0xf881('0x36')]=_[_0xf881('0x37')](_0x2d4d08['model'],_0x2d4d08[_0xf881('0x38')]);_0x576a88[_0xf881('0x39')]=_[_0xf881('0x37')](_0x2d4d08[_0xf881('0x34')],qs[_0xf881('0x3a')](_0x430f27[_0xf881('0x38')]['fields']));_0x576a88[_0xf881('0x39')]=_0x576a88[_0xf881('0x39')][_0xf881('0x4b')]?_0x576a88[_0xf881('0x39')]:_0x2d4d08[_0xf881('0x34')];if(!_0x430f27[_0xf881('0x38')][_0xf881('0x3b')](_0xf881('0x3c'))){_0x576a88[_0xf881('0x22')]=qs[_0xf881('0x22')](_0x430f27[_0xf881('0x38')]['limit']);_0x576a88[_0xf881('0x23')]=qs[_0xf881('0x23')](_0x430f27[_0xf881('0x38')][_0xf881('0x23')]);}_0x576a88[_0xf881('0x3d')]=qs[_0xf881('0x3e')](_0x430f27[_0xf881('0x38')][_0xf881('0x3e')]);_0x576a88['where']=qs[_0xf881('0x36')](_[_0xf881('0x5d')](_0x430f27[_0xf881('0x38')],_0x2d4d08[_0xf881('0x36')]));_0x576a88[_0xf881('0x3f')][_0xf881('0x59')]=_0x5dafe9['id'];if(_0x430f27['query']['filter']){_0x576a88[_0xf881('0x3f')]=_[_0xf881('0x41')](_0x576a88[_0xf881('0x3f')],{'$or':_[_0xf881('0x2f')](_0x576a88[_0xf881('0x39')],function(_0x530e8b){var _0x1e54c2={};_0x1e54c2[_0x530e8b]={'$like':'%'+_0x430f27[_0xf881('0x38')][_0xf881('0x40')]+'%'};return _0x1e54c2;})});}_0x576a88=_['merge']({},_0x576a88,_0x430f27[_0xf881('0x43')]);return db['ChatOfflineMessage']['count']({'where':_0x576a88[_0xf881('0x3f')]})[_0xf881('0x14')](function(_0x1b8247){_0x31bc14[_0xf881('0x24')]=_0x1b8247;if(_0x430f27[_0xf881('0x38')][_0xf881('0x44')]){_0x576a88[_0xf881('0x45')]=[{'all':!![]}];}else{_0x576a88[_0xf881('0x45')]=[{'model':db[_0xf881('0x84')],'as':_0xf881('0xe7'),'required':![]},{'model':db['Attachment'],'as':_0xf881('0x11e'),'required':![]}];}return db[_0xf881('0xca')]['findAll'](_0x576a88);})[_0xf881('0x14')](function(_0x3eb313){_0x31bc14[_0xf881('0x47')]=_0x3eb313;return _0x31bc14;});}})[_0xf881('0x14')](respondWithFilteredResult(_0x58095f,_0x576a88))[_0xf881('0x1d')](handleError(_0x58095f,null));};exports[_0xf881('0x11f')]=function(_0x87295c,_0x9ab01c){return db[_0xf881('0x30')][_0xf881('0x4c')]({'where':{'id':_0x87295c['params']['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x9ab01c,null))['then'](function(_0x39a149){if(_0x39a149){return _0x39a149[_0xf881('0x11f')](_0x87295c[_0xf881('0x4e')][_0xf881('0x61')],_[_0xf881('0xe6')](_0x87295c[_0xf881('0x4e')],['ids','id'])||{})[_0xf881('0xae')](function(_0x4e7731){for(var _0x22947a=0x0;_0x22947a<_0x87295c[_0xf881('0x4e')][_0xf881('0x61')]['length'];_0x22947a+=0x1){socket[_0xf881('0x120')]('userChatWebsite:save',{'UserId':Number(_0x87295c[_0xf881('0x4e')][_0xf881('0x61')][_0x22947a]),'ChatWebsiteId':Number(_0x87295c[_0xf881('0x49')]['id'])});}return _0x4e7731;});}})[_0xf881('0x14')](respondWithResult(_0x9ab01c,null))[_0xf881('0x1d')](handleError(_0x9ab01c,null));};exports['removeAgents']=function(_0x5741a7,_0x187d66){return db[_0xf881('0x30')]['find']({'where':{'id':_0x5741a7[_0xf881('0x49')]['id']}})['then'](handleEntityNotFound(_0x187d66,null))[_0xf881('0x14')](function(_0x64384d){if(_0x64384d){return _0x64384d[_0xf881('0x121')](_0x5741a7['query']['ids'])[_0xf881('0x14')](function(){if(_[_0xf881('0x122')](_0x5741a7['query']['ids'])){for(var _0x48c31f=0x0;_0x48c31f<_0x5741a7['query'][_0xf881('0x61')]['length'];_0x48c31f+=0x1){socket['emit'](_0xf881('0x123'),{'UserId':Number(_0x5741a7[_0xf881('0x38')]['ids'][_0x48c31f]),'ChatWebsiteId':Number(_0x5741a7[_0xf881('0x49')]['id'])});}}else{socket['emit'](_0xf881('0x123'),{'UserId':Number(_0x5741a7[_0xf881('0x38')][_0xf881('0x61')]),'ChatWebsiteId':Number(_0x5741a7['params']['id'])});}});}})['then'](respondWithStatusCode(_0x187d66,null))[_0xf881('0x1d')](handleError(_0x187d66,null));};exports['getAgents']=function(_0x513bed,_0x15d623){var _0x250d9d={};var _0x47172d={};var _0x3c00bf;var _0x533541;return db[_0xf881('0x30')][_0xf881('0x5b')]({'where':{'id':_0x513bed[_0xf881('0x49')]['id']}})[_0xf881('0x14')](handleEntityNotFound(_0x15d623,null))['then'](function(_0x5e3180){if(_0x5e3180){_0x3c00bf=_0x5e3180;_0x47172d['model']=_[_0xf881('0x35')](db['User'][_0xf881('0x31')]);_0x47172d['query']=_[_0xf881('0x35')](_0x513bed['query']);_0x47172d['filters']=_[_0xf881('0x37')](_0x47172d[_0xf881('0x34')],_0x47172d['query']);_0x250d9d[_0xf881('0x39')]=_[_0xf881('0x37')](_0x47172d[_0xf881('0x34')],qs[_0xf881('0x3a')](_0x513bed[_0xf881('0x38')]['fields']));_0x250d9d[_0xf881('0x39')]=_0x250d9d['attributes'][_0xf881('0x4b')]?_0x250d9d[_0xf881('0x39')]:_0x47172d[_0xf881('0x34')];_0x250d9d[_0xf881('0x3d')]=qs['sort'](_0x513bed['query']['sort']);_0x250d9d[_0xf881('0x3f')]=qs['filters'](_[_0xf881('0x5d')](_0x513bed[_0xf881('0x38')],_0x47172d[_0xf881('0x36')]));if(_0x513bed[_0xf881('0x38')]['filter']){_0x250d9d['where']=_['merge'](_0x250d9d[_0xf881('0x3f')],{'$or':_[_0xf881('0x2f')](_0x250d9d[_0xf881('0x39')],function(_0x4fa95e){var _0xd967f5={};_0xd967f5[_0x4fa95e]={'$like':'%'+_0x513bed[_0xf881('0x38')][_0xf881('0x40')]+'%'};return _0xd967f5;})});}_0x250d9d=_[_0xf881('0x41')]({},_0x250d9d,_0x513bed[_0xf881('0x43')]);return _0x3c00bf[_0xf881('0x124')](_0x250d9d);}})['then'](function(_0x38ff4e){if(_0x38ff4e){_0x533541=_0x38ff4e[_0xf881('0x4b')];if(!_0x513bed[_0xf881('0x38')]['hasOwnProperty'](_0xf881('0x3c'))){_0x250d9d[_0xf881('0x22')]=qs[_0xf881('0x22')](_0x513bed['query'][_0xf881('0x22')]);_0x250d9d[_0xf881('0x23')]=qs['offset'](_0x513bed['query']['offset']);}return _0x3c00bf['getAgents'](_0x250d9d);}})['then'](function(_0x451280){if(_0x451280){return _0x451280?{'count':_0x533541,'rows':_0x451280}:null;}})['then'](respondWithResult(_0x15d623,null))[_0xf881('0x1d')](handleError(_0x15d623,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index c50b64a..6bf60bf 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 _0x3248=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x3248,0x1b0));var _0x8324=function(_0x2aa08b,_0x23e9b9){_0x2aa08b=_0x2aa08b-0x0;var _0x2ea276=_0x3248[_0x2aa08b];return _0x2ea276;};'use strict';var EventEmitter=require(_0x8324('0x0'));var ChatWebsite=require(_0x8324('0x1'))['db'][_0x8324('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8324('0x3')](0x0);var events={'afterCreate':_0x8324('0x4'),'afterUpdate':_0x8324('0x5'),'afterDestroy':_0x8324('0x6')};function emitEvent(_0x5a7e4d){return function(_0x4c565b,_0x2e46f3,_0xbf17e8){ChatWebsiteEvents['emit'](_0x5a7e4d+':'+_0x4c565b['id'],_0x4c565b);ChatWebsiteEvents[_0x8324('0x7')](_0x5a7e4d,_0x4c565b);_0xbf17e8(null);};}for(var e in events){if(events[_0x8324('0x8')](e)){var event=events[e];ChatWebsite[_0x8324('0x9')](e,emitEvent(event));}}module[_0x8324('0xa')]=ChatWebsiteEvents; \ No newline at end of file +var _0x4be6=['hook','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4be6,0xb5));var _0x64be=function(_0x368cd6,_0x275b63){_0x368cd6=_0x368cd6-0x0;var _0x16161d=_0x4be6[_0x368cd6];return _0x16161d;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x64be('0x0'))['db'][_0x64be('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x64be('0x2')](0x0);var events={'afterCreate':_0x64be('0x3'),'afterUpdate':_0x64be('0x4'),'afterDestroy':_0x64be('0x5')};function emitEvent(_0xebbf1b){return function(_0x85d7a2,_0x217ce6,_0x311160){ChatWebsiteEvents['emit'](_0xebbf1b+':'+_0x85d7a2['id'],_0x85d7a2);ChatWebsiteEvents[_0x64be('0x6')](_0xebbf1b,_0x85d7a2);_0x311160(null);};}for(var e in events){if(events[_0x64be('0x7')](e)){var event=events[e];ChatWebsite[_0x64be('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 3fb6f22..ed11823 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 _0x5e73=['./chatWebsite.attributes','ChatWebsite','lodash','../../config/logger','api','moment','path','rimraf'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x5e73,0x1b2));var _0x35e7=function(_0x2b257b,_0x2a9042){_0x2b257b=_0x2b257b-0x0;var _0x8162e6=_0x5e73[_0x2b257b];return _0x8162e6;};'use strict';var _=require(_0x35e7('0x0'));var util=require('util');var logger=require(_0x35e7('0x1'))(_0x35e7('0x2'));var moment=require(_0x35e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x35e7('0x4'));var rimraf=require(_0x35e7('0x5'));var config=require('../../config/environment');var attributes=require(_0x35e7('0x6'));module['exports']=function(_0x37e464,_0x23f023){return _0x37e464['define'](_0x35e7('0x7'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa770=['../../config/environment','./chatWebsite.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x327b5f,_0x131c53){var _0x21879d=function(_0x2277c6){while(--_0x2277c6){_0x327b5f['push'](_0x327b5f['shift']());}};_0x21879d(++_0x131c53);}(_0xa770,0x10b));var _0x0a77=function(_0x30e2fa,_0x5aa8fa){_0x30e2fa=_0x30e2fa-0x0;var _0x187bca=_0xa770[_0x30e2fa];return _0x187bca;};'use strict';var _=require(_0x0a77('0x0'));var util=require(_0x0a77('0x1'));var logger=require(_0x0a77('0x2'))(_0x0a77('0x3'));var moment=require(_0x0a77('0x4'));var BPromise=require(_0x0a77('0x5'));var rp=require(_0x0a77('0x6'));var fs=require('fs');var path=require(_0x0a77('0x7'));var rimraf=require(_0x0a77('0x8'));var config=require(_0x0a77('0x9'));var attributes=require(_0x0a77('0xa'));module['exports']=function(_0x1335ca,_0x1db4a8){return _0x1335ca[_0x0a77('0xb')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index bcf9131..71059f3 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 _0xe9b8=['socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost'];(function(_0x451353,_0x19710b){var _0x102315=function(_0x51204c){while(--_0x51204c){_0x451353['push'](_0x451353['shift']());}};_0x102315(++_0x19710b);}(_0xe9b8,0x1eb));var _0x8e9b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe9b8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8e9b('0x0'));var util=require(_0x8e9b('0x1'));var moment=require(_0x8e9b('0x2'));var BPromise=require(_0x8e9b('0x3'));var rs=require(_0x8e9b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e9b('0x5'))['db'];var utils=require(_0x8e9b('0x6'));var logger=require('../../config/logger')(_0x8e9b('0x7'));var config=require(_0x8e9b('0x8'));var jayson=require(_0x8e9b('0x9'));var client=jayson['client'][_0x8e9b('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8e9b('0xb')],{'host':_0x8e9b('0xc'),'port':0x18eb});var socket=require(_0x8e9b('0xd'))(new Redis(config[_0x8e9b('0xb')]));require(_0x8e9b('0xe'))[_0x8e9b('0xf')](socket);function respondWithRpcPromise(_0x3ea91d,_0x4b5ffd,_0x1f76f2){return new BPromise(function(_0x163def,_0xdaee33){return client['request'](_0x3ea91d,_0x1f76f2)[_0x8e9b('0x10')](function(_0x3e2ba1){logger[_0x8e9b('0x11')](_0x8e9b('0x12'),_0x4b5ffd,_0x8e9b('0x13'));logger[_0x8e9b('0x14')](_0x8e9b('0x15'),_0x4b5ffd,'request\x20sent',JSON[_0x8e9b('0x16')](_0x3e2ba1));if(_0x3e2ba1['error']){if(_0x3e2ba1[_0x8e9b('0x17')][_0x8e9b('0x18')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4b5ffd,_0x3e2ba1[_0x8e9b('0x17')][_0x8e9b('0x19')]);return _0xdaee33(_0x3e2ba1[_0x8e9b('0x17')][_0x8e9b('0x19')]);}logger[_0x8e9b('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x4b5ffd,_0x3e2ba1['error']['message']);return _0x163def(_0x3e2ba1[_0x8e9b('0x17')][_0x8e9b('0x19')]);}else{logger['info'](_0x8e9b('0x12'),_0x4b5ffd,_0x8e9b('0x13'));_0x163def(_0x3e2ba1[_0x8e9b('0x1a')][_0x8e9b('0x19')]);}})[_0x8e9b('0x1b')](function(_0x1baffa){logger[_0x8e9b('0x17')](_0x8e9b('0x12'),_0x4b5ffd,_0x1baffa);_0xdaee33(_0x1baffa);});});} \ No newline at end of file +var _0xd682=['../../config/logger','rpc','../../config/environment','client','defaults','localhost','socket.io-emitter','redis','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','code','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0xd682,0xe4));var _0x2d68=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xd682[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x2d68('0x0'));var util=require(_0x2d68('0x1'));var moment=require(_0x2d68('0x2'));var BPromise=require('bluebird');var rs=require(_0x2d68('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d68('0x4'))['db'];var utils=require(_0x2d68('0x5'));var logger=require(_0x2d68('0x6'))(_0x2d68('0x7'));var config=require(_0x2d68('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2d68('0x9')]['http']({'port':0x232a});config['redis']=_[_0x2d68('0xa')](config['redis'],{'host':_0x2d68('0xb'),'port':0x18eb});var socket=require(_0x2d68('0xc'))(new Redis(config[_0x2d68('0xd')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x1f32fe,_0x5367af,_0x5e36e6){return new BPromise(function(_0x626021,_0x3c445f){return client[_0x2d68('0xe')](_0x1f32fe,_0x5e36e6)[_0x2d68('0xf')](function(_0x43233a){logger[_0x2d68('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x5367af,_0x2d68('0x11'));logger[_0x2d68('0x12')](_0x2d68('0x13'),_0x5367af,_0x2d68('0x11'),JSON['stringify'](_0x43233a));if(_0x43233a['error']){if(_0x43233a['error'][_0x2d68('0x14')]===0x1f4){logger[_0x2d68('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x5367af,_0x43233a[_0x2d68('0x15')][_0x2d68('0x16')]);return _0x3c445f(_0x43233a[_0x2d68('0x15')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5367af,_0x43233a[_0x2d68('0x15')][_0x2d68('0x16')]);return _0x626021(_0x43233a[_0x2d68('0x15')][_0x2d68('0x16')]);}else{logger[_0x2d68('0x10')](_0x2d68('0x17'),_0x5367af,_0x2d68('0x11'));_0x626021(_0x43233a[_0x2d68('0x18')]['message']);}})[_0x2d68('0x19')](function(_0x11b1d5){logger[_0x2d68('0x15')](_0x2d68('0x17'),_0x5367af,_0x11b1d5);_0x3c445f(_0x11b1d5);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 38a12b0..a55e423 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 _0xec35=['./chatWebsite.events','save','remove','update','emit','removeListener','length','chatWebsite:'];(function(_0xc56c3,_0x3f6ba2){var _0x6fabbb=function(_0x376c96){while(--_0x376c96){_0xc56c3['push'](_0xc56c3['shift']());}};_0x6fabbb(++_0x3f6ba2);}(_0xec35,0x88));var _0x5ec3=function(_0x353b11,_0x1cb36c){_0x353b11=_0x353b11-0x0;var _0x12cc49=_0xec35[_0x353b11];return _0x12cc49;};'use strict';var ChatWebsiteEvents=require(_0x5ec3('0x0'));var events=[_0x5ec3('0x1'),_0x5ec3('0x2'),_0x5ec3('0x3')];function createListener(_0x1e6568,_0x471f4c){return function(_0x441e0f){_0x471f4c[_0x5ec3('0x4')](_0x1e6568,_0x441e0f);};}function removeListener(_0x11befe,_0x2a3827){return function(){ChatWebsiteEvents[_0x5ec3('0x5')](_0x11befe,_0x2a3827);};}exports['register']=function(_0x36f6af){for(var _0x155628=0x0,_0x276fb8=events[_0x5ec3('0x6')];_0x155628<_0x276fb8;_0x155628++){var _0x7f6159=events[_0x155628];var _0x3d839a=createListener(_0x5ec3('0x7')+_0x7f6159,_0x36f6af);ChatWebsiteEvents['on'](_0x7f6159,_0x3d839a);}}; \ No newline at end of file +var _0x6a2c=['update','emit','register','length','chatWebsite:','save','remove'];(function(_0x5e6bc5,_0x33ddf9){var _0x131f40=function(_0x2c76b1){while(--_0x2c76b1){_0x5e6bc5['push'](_0x5e6bc5['shift']());}};_0x131f40(++_0x33ddf9);}(_0x6a2c,0x67));var _0xc6a2=function(_0x19f201,_0x20677b){_0x19f201=_0x19f201-0x0;var _0x586554=_0x6a2c[_0x19f201];return _0x586554;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xc6a2('0x0'),_0xc6a2('0x1'),_0xc6a2('0x2')];function createListener(_0x9f69d6,_0x2eaba2){return function(_0x204345){_0x2eaba2[_0xc6a2('0x3')](_0x9f69d6,_0x204345);};}function removeListener(_0x2ac3d6,_0x478bf2){return function(){ChatWebsiteEvents['removeListener'](_0x2ac3d6,_0x478bf2);};}exports[_0xc6a2('0x4')]=function(_0x273b0a){for(var _0x1fa80b=0x0,_0xf293f6=events[_0xc6a2('0x5')];_0x1fa80b<_0xf293f6;_0x1fa80b++){var _0x4a7ae3=events[_0x1fa80b];var _0x6a76e6=createListener(_0xc6a2('0x6')+_0x4a7ae3,_0x273b0a);ChatWebsiteEvents['on'](_0x4a7ae3,_0x6a76e6);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 628bc1e..64207d3 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 _0x3c76=['format','%s-%s','now','originalname','single','file','addLogo','root','addAvatar','server/files/images/avatars/','addCustomerAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','any','/:id/interactions','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join'];(function(_0x393b80,_0x17aaa5){var _0x1e0cbc=function(_0x987b1e){while(--_0x987b1e){_0x393b80['push'](_0x393b80['shift']());}};_0x1e0cbc(++_0x17aaa5);}(_0x3c76,0x1e4));var _0x63c7=function(_0x1dd3b3,_0x54db4c){_0x1dd3b3=_0x1dd3b3-0x0;var _0xab5e42=_0x3c76[_0x1dd3b3];return _0xab5e42;};'use strict';var multer=require(_0x63c7('0x0'));var util=require(_0x63c7('0x1'));var path=require(_0x63c7('0x2'));var timeout=require(_0x63c7('0x3'));var express=require(_0x63c7('0x4'));var router=express[_0x63c7('0x5')]();var fs_extra=require(_0x63c7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x63c7('0x7'));var config=require(_0x63c7('0x8'));var controller=require('./chatWebsite.controller');router[_0x63c7('0x9')]('/',auth[_0x63c7('0xa')](),controller[_0x63c7('0xb')]);router[_0x63c7('0x9')](_0x63c7('0xc'),auth['isAuthenticated'](),controller[_0x63c7('0xd')]);router[_0x63c7('0x9')]('/:id',auth[_0x63c7('0xa')](),controller['show']);router[_0x63c7('0x9')](_0x63c7('0xe'),auth[_0x63c7('0xa')](),controller[_0x63c7('0xf')]);router[_0x63c7('0x9')](_0x63c7('0x10'),auth[_0x63c7('0xa')](),controller['getAnswers']);router[_0x63c7('0x9')](_0x63c7('0x11'),controller[_0x63c7('0x12')]);router[_0x63c7('0x9')](_0x63c7('0x13'),controller[_0x63c7('0x14')]);router['get'](_0x63c7('0x15'),controller['getCustomerAvatar']);router['get'](_0x63c7('0x16'),controller[_0x63c7('0x17')]);router[_0x63c7('0x9')]('/:id/interactions',auth[_0x63c7('0xa')](),controller[_0x63c7('0x18')]);router['get'](_0x63c7('0x19'),controller[_0x63c7('0x1a')]);router[_0x63c7('0x9')]('/:id/applications',auth[_0x63c7('0xa')](),controller[_0x63c7('0x1b')]);router[_0x63c7('0x9')](_0x63c7('0x1c'),auth['isAuthenticated'](),controller[_0x63c7('0x1d')]);router[_0x63c7('0x9')](_0x63c7('0x1e'),controller[_0x63c7('0x1f')]);router[_0x63c7('0x9')](_0x63c7('0x20'),auth[_0x63c7('0xa')](),controller[_0x63c7('0x21')]);router[_0x63c7('0x9')]('/:id/users',auth[_0x63c7('0xa')](),controller[_0x63c7('0x22')]);router[_0x63c7('0x23')]('/',auth[_0x63c7('0xa')](),controller[_0x63c7('0x24')]);router['post']('/:id/dispositions',auth[_0x63c7('0xa')](),controller[_0x63c7('0x25')]);router[_0x63c7('0x23')](_0x63c7('0x10'),auth[_0x63c7('0xa')](),controller[_0x63c7('0x26')]);var upload=multer({'storage':multer[_0x63c7('0x27')]({'destination':function(_0x204da5,_0x455c81,_0x59007c){_0x59007c(null,path[_0x63c7('0x28')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5b9a38,_0x3719f4,_0x5f4278){_0x5f4278(null,util[_0x63c7('0x29')](_0x63c7('0x2a'),Date[_0x63c7('0x2b')](),_0x3719f4[_0x63c7('0x2c')]));}})});router[_0x63c7('0x23')]('/:id/logo',upload[_0x63c7('0x2d')](_0x63c7('0x2e')),controller[_0x63c7('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x342289,_0x2a93a2,_0xd18f09){_0xd18f09(null,path['join'](config[_0x63c7('0x30')],'server/files/images/avatars/'));},'filename':function(_0x2107b4,_0x5ae889,_0x53ae41){_0x53ae41(null,util[_0x63c7('0x29')](_0x63c7('0x2a'),Date[_0x63c7('0x2b')](),_0x5ae889['originalname']));}})});router[_0x63c7('0x23')](_0x63c7('0x13'),upload[_0x63c7('0x2d')](_0x63c7('0x2e')),controller[_0x63c7('0x31')]);var upload=multer({'storage':multer[_0x63c7('0x27')]({'destination':function(_0x49667e,_0x35c25b,_0x42249e){_0x42249e(null,path[_0x63c7('0x28')](config[_0x63c7('0x30')],_0x63c7('0x32')));},'filename':function(_0x2575d7,_0x1b2b7d,_0xb0f0d3){_0xb0f0d3(null,util['format'](_0x63c7('0x2a'),Date[_0x63c7('0x2b')](),_0x1b2b7d['originalname']));}})});router[_0x63c7('0x23')]('/:id/customer_avatar',upload[_0x63c7('0x2d')](_0x63c7('0x2e')),controller[_0x63c7('0x33')]);var upload=multer({'storage':multer[_0x63c7('0x27')]({'destination':function(_0x30b667,_0x1e7bd5,_0x288a49){_0x288a49(null,path[_0x63c7('0x28')](config[_0x63c7('0x30')],_0x63c7('0x32')));},'filename':function(_0xcdf499,_0xc9808c,_0x24c8c7){_0x24c8c7(null,util[_0x63c7('0x29')](_0x63c7('0x2a'),Date[_0x63c7('0x2b')](),_0xc9808c['originalname']));}})});router[_0x63c7('0x23')](_0x63c7('0x16'),upload[_0x63c7('0x2d')]('file'),controller['addSystemAvatar']);router[_0x63c7('0x23')](_0x63c7('0x34'),controller[_0x63c7('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x63c7('0x27')]({'destination':function(_0x4fb7ae,_0x36ffed,_0x1940d1){const _0x3b18af=path[_0x63c7('0x28')](config[_0x63c7('0x30')],_0x63c7('0x36'),_0x63c7('0x37'),_0x63c7('0x38'));fs_extra[_0x63c7('0x39')](_0x3b18af,function(){_0x1940d1(null,_0x3b18af);});},'filename':function(_0x6bb512,_0x582fa8,_0x36c346){const _0x41d3eb=_0x582fa8[_0x63c7('0x2c')][_0x63c7('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x16a6cb=path[_0x63c7('0x3b')](_0x41d3eb);const _0x55a716=Date[_0x63c7('0x2b')]()+'-'+_0x41d3eb['replace'](_0x16a6cb,'')+_0x16a6cb;_0x36c346(null,_0x55a716);}})});router[_0x63c7('0x23')]('/:id/offline',offlineUploadMulter[_0x63c7('0x3c')](),controller['offline']);router[_0x63c7('0x23')](_0x63c7('0x3d'),auth[_0x63c7('0xa')](),controller['addInteraction']);router[_0x63c7('0x23')](_0x63c7('0x3e'),auth[_0x63c7('0xa')](),controller[_0x63c7('0x3f')]);router[_0x63c7('0x23')](_0x63c7('0x1c'),auth[_0x63c7('0xa')](),controller[_0x63c7('0x40')]);router[_0x63c7('0x23')](_0x63c7('0x41'),auth[_0x63c7('0xa')](),controller[_0x63c7('0x42')]);router[_0x63c7('0x43')](_0x63c7('0x44'),auth['isAuthenticated'](),controller[_0x63c7('0x45')]);router['delete'](_0x63c7('0x44'),auth['isAuthenticated'](),controller[_0x63c7('0x46')]);router[_0x63c7('0x47')](_0x63c7('0xe'),auth[_0x63c7('0xa')](),controller[_0x63c7('0x48')]);router[_0x63c7('0x47')](_0x63c7('0x10'),auth[_0x63c7('0xa')](),controller[_0x63c7('0x49')]);router[_0x63c7('0x47')]('/:id/users',auth[_0x63c7('0xa')](),controller[_0x63c7('0x4a')]);module['exports']=router; \ No newline at end of file +var _0x5b05=['update','delete','removeDispositions','removeAnswers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getApplications','getProactiveActions','/:id/fields','getFields','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','file','addLogo','format','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','single','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','offline','/:id/interactions','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put'];(function(_0x236b13,_0xd848df){var _0x4def23=function(_0x804f56){while(--_0x804f56){_0x236b13['push'](_0x236b13['shift']());}};_0x4def23(++_0xd848df);}(_0x5b05,0x91));var _0x55b0=function(_0x3c54f4,_0x52963a){_0x3c54f4=_0x3c54f4-0x0;var _0x3b4b94=_0x5b05[_0x3c54f4];return _0x3b4b94;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x55b0('0x0'));var timeout=require(_0x55b0('0x1'));var express=require(_0x55b0('0x2'));var router=express[_0x55b0('0x3')]();var fs_extra=require(_0x55b0('0x4'));var auth=require(_0x55b0('0x5'));var interaction=require(_0x55b0('0x6'));var config=require('../../config/environment');var controller=require(_0x55b0('0x7'));router[_0x55b0('0x8')]('/',auth[_0x55b0('0x9')](),controller[_0x55b0('0xa')]);router[_0x55b0('0x8')](_0x55b0('0xb'),auth[_0x55b0('0x9')](),controller[_0x55b0('0xc')]);router['get'](_0x55b0('0xd'),auth[_0x55b0('0x9')](),controller[_0x55b0('0xe')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x55b0('0xf')]);router[_0x55b0('0x8')](_0x55b0('0x10'),auth[_0x55b0('0x9')](),controller[_0x55b0('0x11')]);router[_0x55b0('0x8')](_0x55b0('0x12'),controller['getLogo']);router[_0x55b0('0x8')]('/:id/avatar',controller[_0x55b0('0x13')]);router[_0x55b0('0x8')]('/:id/customer_avatar',controller[_0x55b0('0x14')]);router[_0x55b0('0x8')](_0x55b0('0x15'),controller[_0x55b0('0x16')]);router[_0x55b0('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x55b0('0x17')]);router[_0x55b0('0x8')](_0x55b0('0x18'),controller['getSnippet']);router[_0x55b0('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x55b0('0x19')]);router[_0x55b0('0x8')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x55b0('0x1a')]);router[_0x55b0('0x8')](_0x55b0('0x1b'),controller[_0x55b0('0x1c')]);router[_0x55b0('0x8')]('/:id/offline_messages',auth[_0x55b0('0x9')](),controller['getOfflineMessages']);router[_0x55b0('0x8')](_0x55b0('0x1d'),auth[_0x55b0('0x9')](),controller[_0x55b0('0x1e')]);router[_0x55b0('0x1f')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x55b0('0x20'),auth[_0x55b0('0x9')](),controller[_0x55b0('0x21')]);router['post'](_0x55b0('0x10'),auth[_0x55b0('0x9')](),controller[_0x55b0('0x22')]);var upload=multer({'storage':multer[_0x55b0('0x23')]({'destination':function(_0x5b68c8,_0x20ec52,_0x23c345){_0x23c345(null,path[_0x55b0('0x24')](config[_0x55b0('0x25')],_0x55b0('0x26')));},'filename':function(_0x5c6374,_0x85f35f,_0x5d2315){_0x5d2315(null,util['format'](_0x55b0('0x27'),Date[_0x55b0('0x28')](),_0x85f35f[_0x55b0('0x29')]));}})});router['post'](_0x55b0('0x12'),upload['single'](_0x55b0('0x2a')),controller[_0x55b0('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfaccab,_0x1632a4,_0x16d501){_0x16d501(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0xd6800e,_0x54ba3c,_0x34f365){_0x34f365(null,util[_0x55b0('0x2c')]('%s-%s',Date[_0x55b0('0x28')](),_0x54ba3c[_0x55b0('0x29')]));}})});router['post']('/:id/avatar',upload['single'](_0x55b0('0x2a')),controller[_0x55b0('0x2d')]);var upload=multer({'storage':multer[_0x55b0('0x23')]({'destination':function(_0x2168c8,_0x2c2675,_0x53132e){_0x53132e(null,path[_0x55b0('0x24')](config['root'],_0x55b0('0x2e')));},'filename':function(_0x2df892,_0x579060,_0x490050){_0x490050(null,util[_0x55b0('0x2c')](_0x55b0('0x27'),Date[_0x55b0('0x28')](),_0x579060[_0x55b0('0x29')]));}})});router[_0x55b0('0x1f')](_0x55b0('0x2f'),upload['single'](_0x55b0('0x2a')),controller[_0x55b0('0x30')]);var upload=multer({'storage':multer[_0x55b0('0x23')]({'destination':function(_0xe8a0e5,_0x271233,_0x2624ab){_0x2624ab(null,path[_0x55b0('0x24')](config[_0x55b0('0x25')],_0x55b0('0x2e')));},'filename':function(_0x4b70a1,_0x30def4,_0x5d59e7){_0x5d59e7(null,util[_0x55b0('0x2c')](_0x55b0('0x27'),Date[_0x55b0('0x28')](),_0x30def4['originalname']));}})});router[_0x55b0('0x1f')](_0x55b0('0x15'),upload[_0x55b0('0x31')](_0x55b0('0x2a')),controller['addSystemAvatar']);router[_0x55b0('0x1f')](_0x55b0('0x32'),controller[_0x55b0('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x55b0('0x23')]({'destination':function(_0xdaa3f1,_0x591c33,_0x1a9857){const _0x268f60=path[_0x55b0('0x24')](config[_0x55b0('0x25')],_0x55b0('0x34'),_0x55b0('0x35'),_0x55b0('0x36'));fs_extra['ensureDir'](_0x268f60,function(){_0x1a9857(null,_0x268f60);});},'filename':function(_0x2b8474,_0x1f088c,_0x4aa435){const _0x24c5e7=_0x1f088c[_0x55b0('0x29')][_0x55b0('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x452dd7=path[_0x55b0('0x38')](_0x24c5e7);const _0x3b7e26=Date[_0x55b0('0x28')]()+'-'+_0x24c5e7['replace'](_0x452dd7,'')+_0x452dd7;_0x4aa435(null,_0x3b7e26);}})});router[_0x55b0('0x1f')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x55b0('0x39')]);router[_0x55b0('0x1f')](_0x55b0('0x3a'),auth['isAuthenticated'](),controller[_0x55b0('0x3b')]);router[_0x55b0('0x1f')]('/:id/applications',auth[_0x55b0('0x9')](),controller[_0x55b0('0x3c')]);router[_0x55b0('0x1f')](_0x55b0('0x3d'),auth[_0x55b0('0x9')](),controller[_0x55b0('0x3e')]);router[_0x55b0('0x1f')](_0x55b0('0x1d'),auth[_0x55b0('0x9')](),controller[_0x55b0('0x3f')]);router[_0x55b0('0x40')](_0x55b0('0xd'),auth[_0x55b0('0x9')](),controller[_0x55b0('0x41')]);router['delete'](_0x55b0('0xd'),auth[_0x55b0('0x9')](),controller['destroy']);router[_0x55b0('0x42')](_0x55b0('0x20'),auth[_0x55b0('0x9')](),controller[_0x55b0('0x43')]);router[_0x55b0('0x42')](_0x55b0('0x10'),auth['isAuthenticated'](),controller[_0x55b0('0x44')]);router[_0x55b0('0x42')](_0x55b0('0x1d'),auth[_0x55b0('0x9')](),controller['removeAgents']);module[_0x55b0('0x45')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 3da1f7b..b1a72eb 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 _0x3ab1=['/client-logs','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','env','production','app','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x4f3019,_0x162d8b){var _0x1b449a=function(_0x4da52e){while(--_0x4da52e){_0x4f3019['push'](_0x4f3019['shift']());}};_0x1b449a(++_0x162d8b);}(_0x3ab1,0xea));var _0x13ab=function(_0x1a232b,_0x4d1ddb){_0x1a232b=_0x1a232b-0x0;var _0x3e8282=_0x3ab1[_0x1a232b];return _0x3e8282;};var beaverLogger=require(_0x13ab('0x0'));var express=require(_0x13ab('0x1'));var auth=require(_0x13ab('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x13ab('0x3')]===_0x13ab('0x4')||![];function clientSideLogs(_0x12bc3a,_0x130954,_0x5be626){var _0x334207=_0x12bc3a[_0x13ab('0x5')]['get']('client-side-logger');if(!_0x334207){throw new Error(_0x13ab('0x6'));}return beaverLogger[_0x13ab('0x7')]({'uri':_0x13ab('0x8'),'logger':_0x334207,'enableCors':!isProduction})(_0x12bc3a,_0x130954,_0x5be626);}router['use'](auth[_0x13ab('0x9')](),clientSideLogs);module[_0x13ab('0xa')]=router; \ No newline at end of file +var _0x9738=['client-side-logger','expressEndpoint','/client-logs','isAuthenticated','exports','beaver-logger/server','express','../config/environment','env','get'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x9738,0x18b));var _0x8973=function(_0x2dfd36,_0x91520){_0x2dfd36=_0x2dfd36-0x0;var _0x4e4e2d=_0x9738[_0x2dfd36];return _0x4e4e2d;};var beaverLogger=require(_0x8973('0x0'));var express=require(_0x8973('0x1'));var auth=require('../components/auth/service');var config=require(_0x8973('0x2'));var router=express['Router']();var isProduction=config[_0x8973('0x3')]==='production'||![];function clientSideLogs(_0xd41284,_0x38690d,_0x596974){var _0x12ecbe=_0xd41284['app'][_0x8973('0x4')](_0x8973('0x5'));if(!_0x12ecbe){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x8973('0x6')]({'uri':_0x8973('0x7'),'logger':_0x12ecbe,'enableCors':!isProduction})(_0xd41284,_0x38690d,_0x596974);}router['use'](auth[_0x8973('0x8')](),clientSideLogs);module[_0x8973('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 9a58616..e3160bd 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 _0xb035=['MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365','Dynamics365'];(function(_0x3497f5,_0x157212){var _0x35d256=function(_0x395dae){while(--_0x395dae){_0x3497f5['push'](_0x3497f5['shift']());}};_0x35d256(++_0x157212);}(_0xb035,0x1aa));var _0x5b03=function(_0x404fbe,_0x1944dc){_0x404fbe=_0x404fbe-0x0;var _0x5869ae=_0xb035[_0x404fbe];return _0x5869ae;};'use strict';var Sequelize=require('sequelize');module[_0x5b03('0x0')]={'name':{'type':Sequelize[_0x5b03('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x5b03('0x2'),_0x5b03('0x3'),_0x5b03('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x5b03('0x5')](_0x5b03('0x6'),_0x5b03('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x5b03('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x5b03('0x1')],'comment':_0x5b03('0x8')},'data4':{'type':Sequelize[_0x5b03('0x1')],'comment':_0x5b03('0x9')},'data5':{'type':Sequelize[_0x5b03('0xa')],'comment':_0x5b03('0xb')},'data6':{'type':Sequelize[_0x5b03('0xa')],'comment':_0x5b03('0xc')},'data7':{'type':Sequelize[_0x5b03('0xa')],'comment':_0x5b03('0xd')}}; \ No newline at end of file +var _0xc44d=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','MicrosoftAzure','Outlook365','Dynamics365'];(function(_0x25e48c,_0x465fc9){var _0x4175f4=function(_0x1773d1){while(--_0x1773d1){_0x25e48c['push'](_0x25e48c['shift']());}};_0x4175f4(++_0x465fc9);}(_0xc44d,0x161));var _0xdc44=function(_0x14a320,_0x36f9d8){_0x14a320=_0x14a320-0x0;var _0x3b364f=_0xc44d[_0x14a320];return _0x3b364f;};'use strict';var Sequelize=require(_0xdc44('0x0'));module[_0xdc44('0x1')]={'name':{'type':Sequelize[_0xdc44('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdc44('0x3')]('AmazonAWS','Google',_0xdc44('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xdc44('0x3')](_0xdc44('0x5'),_0xdc44('0x6'))},'data1':{'type':Sequelize[_0xdc44('0x2')],'comment':_0xdc44('0x7')},'data2':{'type':Sequelize['STRING'],'comment':_0xdc44('0x8')},'data3':{'type':Sequelize[_0xdc44('0x2')],'comment':_0xdc44('0x9')},'data4':{'type':Sequelize[_0xdc44('0x2')],'comment':_0xdc44('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0xdc44('0xb')},'data6':{'type':Sequelize[_0xdc44('0xc')],'comment':_0xdc44('0xd')},'data7':{'type':Sequelize[_0xdc44('0xc')],'comment':_0xdc44('0xe')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 467688d..880e72b 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 _0xfed6=['status','end','offset','limit','count','set','Content-Range','json','update','then','destroy','error','stack','name','send','padEnd','slice','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','CloudProvider','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','options','find','catch','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','service','values','includes','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','params','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','parse','from','isValidIdToken','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus'];(function(_0x4b57ec,_0x3a8166){var _0x47d417=function(_0xdff2fc){while(--_0xdff2fc){_0x4b57ec['push'](_0x4b57ec['shift']());}};_0x47d417(++_0x3a8166);}(_0xfed6,0x1c0));var _0x6fed=function(_0x50641e,_0x3bc2fe){_0x50641e=_0x50641e-0x0;var _0x426fa1=_0xfed6[_0x50641e];return _0x426fa1;};'use strict';var _=require(_0x6fed('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0x6fed('0x1'));var config=require(_0x6fed('0x2'));var logger=require(_0x6fed('0x3'))(_0x6fed('0x4'));var db=require(_0x6fed('0x5'))['db'];var oauth=require(_0x6fed('0x6'));config[_0x6fed('0x7')]=_[_0x6fed('0x8')](config[_0x6fed('0x7')],{'host':_0x6fed('0x9'),'port':0x18eb});var socket=require(_0x6fed('0xa'))(new Redis(config[_0x6fed('0x7')]));var redis=new Redis(config[_0x6fed('0x7')]);function respondWithStatusCode(_0x26d728,_0x47da6a){_0x47da6a=_0x47da6a||0xcc;return function(_0x1f9111){if(_0x1f9111){return _0x26d728[_0x6fed('0xb')](_0x47da6a);}return _0x26d728[_0x6fed('0xc')](_0x47da6a)[_0x6fed('0xd')]();};}function respondWithResult(_0x13b793,_0x2abecb){_0x2abecb=_0x2abecb||0xc8;return function(_0x3ad558){if(_0x3ad558){return _0x13b793[_0x6fed('0xc')](_0x2abecb)['json'](_0x3ad558);}};}function respondWithFilteredResult(_0x4efdaa,_0x28502c){return function(_0xc7f68b){if(_0xc7f68b){var _0x3bbf31=typeof _0x28502c[_0x6fed('0xe')]==='undefined'&&typeof _0x28502c[_0x6fed('0xf')]==='undefined';var _0xe07aaf=_0xc7f68b[_0x6fed('0x10')];var _0x4606bb=_0x3bbf31?0x0:_0x28502c['offset'];var _0x29daf6=_0x3bbf31?_0xc7f68b['count']:_0x28502c[_0x6fed('0xe')]+_0x28502c[_0x6fed('0xf')];var _0x7686dc;if(_0x29daf6>=_0xe07aaf){_0x29daf6=_0xe07aaf;_0x7686dc=0xc8;}else{_0x7686dc=0xce;}_0x4efdaa[_0x6fed('0xc')](_0x7686dc);return _0x4efdaa[_0x6fed('0x11')](_0x6fed('0x12'),_0x4606bb+'-'+_0x29daf6+'/'+_0xe07aaf)[_0x6fed('0x13')](_0xc7f68b);}return null;};}function saveUpdates(_0x1e13d1){return function(_0x110216){if(_0x110216){return _0x110216[_0x6fed('0x14')](_0x1e13d1)[_0x6fed('0x15')](function(_0x28acfc){return _0x28acfc;});}return null;};}function removeEntity(_0x844008){return function(_0x11843c){if(_0x11843c){return _0x11843c[_0x6fed('0x16')]()['then'](function(){_0x844008['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bd346){return function(_0x46248c){if(!_0x46248c){_0x4bd346[_0x6fed('0xb')](0x194);}return _0x46248c;};}function handleError(_0x3d2f52,_0x2872b8){_0x2872b8=_0x2872b8||0x1f4;return function(_0x4f528e){logger[_0x6fed('0x17')](_0x4f528e[_0x6fed('0x18')]);if(_0x4f528e[_0x6fed('0x19')]){delete _0x4f528e['name'];}_0x3d2f52[_0x6fed('0xc')](_0x2872b8)[_0x6fed('0x1a')](_0x4f528e);};}function maskClientSecret(_0x2deb4d){return _[_0x6fed('0x1b')](_0x2deb4d[_0x6fed('0x1c')](0x0,0x3),0x14,'*');}exports['index']=function(_0x466d6b,_0x5569ea){var _0x4ad31a={},_0x2b8e5e={},_0x163d01={'count':0x0,'rows':[]};var _0x1c9a22=_[_0x6fed('0x1d')](db['CloudProvider'][_0x6fed('0x1e')],function(_0x2ba7ce){return{'name':_0x2ba7ce[_0x6fed('0x1f')],'type':_0x2ba7ce[_0x6fed('0x20')][_0x6fed('0x21')]};});_0x2b8e5e[_0x6fed('0x22')]=_[_0x6fed('0x1d')](_0x1c9a22,_0x6fed('0x19'));_0x2b8e5e[_0x6fed('0x23')]=_[_0x6fed('0x24')](_0x466d6b[_0x6fed('0x23')]);_0x2b8e5e[_0x6fed('0x25')]=_['intersection'](_0x2b8e5e[_0x6fed('0x22')],_0x2b8e5e[_0x6fed('0x23')]);_0x4ad31a['attributes']=_[_0x6fed('0x26')](_0x2b8e5e['model'],qs[_0x6fed('0x27')](_0x466d6b[_0x6fed('0x23')][_0x6fed('0x27')]));_0x4ad31a[_0x6fed('0x28')]=_0x4ad31a[_0x6fed('0x28')][_0x6fed('0x29')]?_0x4ad31a['attributes']:_0x2b8e5e[_0x6fed('0x22')];if(!_0x466d6b[_0x6fed('0x23')][_0x6fed('0x2a')]('nolimit')){_0x4ad31a[_0x6fed('0xf')]=qs[_0x6fed('0xf')](_0x466d6b[_0x6fed('0x23')]['limit']);_0x4ad31a[_0x6fed('0xe')]=qs['offset'](_0x466d6b[_0x6fed('0x23')][_0x6fed('0xe')]);}_0x4ad31a[_0x6fed('0x2b')]=qs[_0x6fed('0x2c')](_0x466d6b[_0x6fed('0x23')][_0x6fed('0x2c')]);_0x4ad31a[_0x6fed('0x2d')]=qs[_0x6fed('0x25')](_[_0x6fed('0x2e')](_0x466d6b[_0x6fed('0x23')],_0x2b8e5e[_0x6fed('0x25')]),_0x1c9a22);if(_0x466d6b[_0x6fed('0x23')][_0x6fed('0x2f')]){_0x4ad31a[_0x6fed('0x2d')]=_[_0x6fed('0x30')](_0x4ad31a[_0x6fed('0x2d')],{'$or':_[_0x6fed('0x1d')](_0x1c9a22,function(_0x1be6b3){if(_0x1be6b3[_0x6fed('0x20')]!==_0x6fed('0x31')){var _0x5a31dd={};_0x5a31dd[_0x1be6b3[_0x6fed('0x19')]]={'$like':'%'+_0x466d6b['query'][_0x6fed('0x2f')]+'%'};return _0x5a31dd;}})});}_0x4ad31a=_[_0x6fed('0x30')]({},_0x4ad31a,_0x466d6b['options']);var _0x2af860={'where':_0x4ad31a[_0x6fed('0x2d')]};return db[_0x6fed('0x32')][_0x6fed('0x10')](_0x2af860)[_0x6fed('0x15')](function(_0x423a07){_0x163d01['count']=_0x423a07;if(_0x466d6b[_0x6fed('0x23')][_0x6fed('0x33')]){_0x4ad31a[_0x6fed('0x34')]=[{'all':!![]}];}return db[_0x6fed('0x32')][_0x6fed('0x35')](_0x4ad31a);})[_0x6fed('0x15')](function(_0x4abddf){_0x163d01[_0x6fed('0x36')]=_[_0x6fed('0x1d')](_0x4abddf,function(_0x3e480b){if(_0x3e480b['service']===_0x6fed('0x37')){var _0x3a915e=encryptor[_0x6fed('0x38')](_0x3e480b[_0x6fed('0x39')]);_0x3e480b[_0x6fed('0x39')]=maskClientSecret(_0x3a915e);}return _0x3e480b;});return _0x163d01;})[_0x6fed('0x15')](respondWithFilteredResult(_0x5569ea,_0x4ad31a))['catch'](handleError(_0x5569ea,null));};exports['show']=function(_0x2123d1,_0x52a9ed){var _0x5c7b5f={'raw':!![],'where':{'id':_0x2123d1['params']['id']}},_0x1e3494={};_0x1e3494[_0x6fed('0x22')]=_['keys'](db[_0x6fed('0x32')]['rawAttributes']);_0x1e3494[_0x6fed('0x23')]=_[_0x6fed('0x24')](_0x2123d1[_0x6fed('0x23')]);_0x1e3494[_0x6fed('0x25')]=_[_0x6fed('0x26')](_0x1e3494['model'],_0x1e3494['query']);_0x5c7b5f[_0x6fed('0x28')]=_['intersection'](_0x1e3494[_0x6fed('0x22')],qs[_0x6fed('0x27')](_0x2123d1[_0x6fed('0x23')][_0x6fed('0x27')]));_0x5c7b5f[_0x6fed('0x28')]=_0x5c7b5f[_0x6fed('0x28')][_0x6fed('0x29')]?_0x5c7b5f[_0x6fed('0x28')]:_0x1e3494[_0x6fed('0x22')];if(_0x2123d1[_0x6fed('0x23')][_0x6fed('0x33')]){_0x5c7b5f['include']=[{'all':!![]}];}_0x5c7b5f=_[_0x6fed('0x30')]({},_0x5c7b5f,_0x2123d1[_0x6fed('0x3a')]);return db[_0x6fed('0x32')][_0x6fed('0x3b')](_0x5c7b5f)[_0x6fed('0x15')](handleEntityNotFound(_0x52a9ed,null))['then'](function(_0x505052){if(_0x505052['service']===_0x6fed('0x37')){var _0x4ac5fb=encryptor['decryptString'](_0x505052[_0x6fed('0x39')]);_0x505052[_0x6fed('0x39')]=maskClientSecret(_0x4ac5fb);}return _0x505052;})[_0x6fed('0x15')](respondWithResult(_0x52a9ed,null))[_0x6fed('0x3c')](handleError(_0x52a9ed,null));};exports['create']=function(_0x44250e,_0x3ddd20){if(!_0x44250e['body'][_0x6fed('0x19')])throw new Error(_0x6fed('0x3d'));if(!_0x44250e['body']['service'])throw new Error(_0x6fed('0x3e'));var _0x2c7a58=db[_0x6fed('0x32')][_0x6fed('0x1e')][_0x6fed('0x3f')][_0x6fed('0x40')];if(!_0x2c7a58[_0x6fed('0x41')](_0x44250e[_0x6fed('0x42')][_0x6fed('0x3f')]))throw new Error(_0x6fed('0x43')+_0x2c7a58['join'](',\x20'));if(_0x44250e[_0x6fed('0x42')]['service']===_0x6fed('0x37')&&_0x44250e['body'][_0x6fed('0x39')]){_0x44250e['body'][_0x6fed('0x39')]=encryptor[_0x6fed('0x44')](_0x44250e[_0x6fed('0x42')][_0x6fed('0x39')]);}return db[_0x6fed('0x32')]['create'](_0x44250e[_0x6fed('0x42')],{})[_0x6fed('0x15')](respondWithResult(_0x3ddd20,0xc9))[_0x6fed('0x3c')](handleError(_0x3ddd20,null));};exports[_0x6fed('0x14')]=function(_0x517e12,_0x5df2ea){if(_0x517e12['body']['id']){delete _0x517e12[_0x6fed('0x42')]['id'];}return db[_0x6fed('0x32')][_0x6fed('0x3b')]({'where':{'id':_0x517e12[_0x6fed('0x45')]['id']}})['then'](handleEntityNotFound(_0x5df2ea,null))[_0x6fed('0x15')](function(_0x4259d3){if(_0x4259d3['service']===_0x6fed('0x37')&&_0x517e12[_0x6fed('0x42')][_0x6fed('0x39')]){_0x517e12[_0x6fed('0x42')]['data3']=encryptor[_0x6fed('0x44')](_0x517e12[_0x6fed('0x42')]['data3']);}return _0x4259d3;})['then'](saveUpdates(_0x517e12['body'],null))[_0x6fed('0x15')](respondWithResult(_0x5df2ea,null))['catch'](handleError(_0x5df2ea,null));};exports[_0x6fed('0x16')]=function(_0x23d73b,_0x2fc2b5){return db[_0x6fed('0x32')][_0x6fed('0x3b')]({'where':{'id':_0x23d73b[_0x6fed('0x45')]['id']}})[_0x6fed('0x15')](handleEntityNotFound(_0x2fc2b5,null))[_0x6fed('0x15')](removeEntity(_0x2fc2b5,null))['catch'](handleError(_0x2fc2b5,null));};exports['oauth2MicrosoftAuthorize']=function(_0x14dafe,_0x438000){return db[_0x6fed('0x32')][_0x6fed('0x46')]({'where':{'id':_0x14dafe[_0x6fed('0x45')]['id']},'raw':!![]})[_0x6fed('0x15')](function(_0xc37249){if(!_0xc37249)return _0x438000[_0x6fed('0xb')](0x194);return{'url':oauth[_0x6fed('0x47')](_0xc37249,_0x14dafe[_0x6fed('0x48')]['id'])};})[_0x6fed('0x15')](respondWithResult(_0x438000,null))[_0x6fed('0x3c')](handleError(_0x438000,null));};exports[_0x6fed('0x49')]=function(_0x531207,_0x19d04d){var _0x257c68=_0x531207[_0x6fed('0x42')];var _0x2cca10;var _0x552941;if(_0x257c68[_0x6fed('0x17')])throw _0x257c68;redis[_0x6fed('0x4a')](_0x257c68[_0x6fed('0x4b')])[_0x6fed('0x15')](function(_0x4d7251){if(!_0x4d7251)throw new Error('Invalid\x20state\x20parameter');_0x2cca10=JSON[_0x6fed('0x4c')](_0x4d7251);var _0x39074a=Buffer[_0x6fed('0x4d')](_0x257c68[_0x6fed('0x4b')],'base64')['toString']('ascii');_0x552941=JSON[_0x6fed('0x4c')](_0x39074a);if(!oauth[_0x6fed('0x4e')](_0x257c68['id_token'],_0x2cca10['oauth2Claims']))throw new Error(_0x6fed('0x4f'));redis[_0x6fed('0x50')](_0x257c68['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x257c68[_0x6fed('0x51')],_0x2cca10);})['then'](function(_0x4bb08f){_0x2cca10[_0x6fed('0x52')]=_0x4bb08f[_0x6fed('0x53')];_0x2cca10[_0x6fed('0x54')]=_0x4bb08f[_0x6fed('0x55')];return db['CloudProvider']['update']({'data5':_0x2cca10['data5'],'data6':_0x2cca10[_0x6fed('0x54')]},{'where':{'id':_0x2cca10['id']}});})[_0x6fed('0x15')](function(){oauth[_0x6fed('0x56')](_0x2cca10);socket[_0x6fed('0x57')](_0x6fed('0x58'),{'id':_0x552941['id']});return;})['then'](respondWithStatusCode(_0x19d04d,null))[_0x6fed('0x3c')](function(_0x159521){if(_0x552941){socket[_0x6fed('0x57')]('microsoftAuthorization:error',{'id':_0x552941['id']});}if(!_0x2cca10){logger[_0x6fed('0x17')](_0x6fed('0x59'),_0x159521);return _0x19d04d['status'](0x1f4)[_0x6fed('0x1a')](_0x159521[_0x6fed('0x5a')]);}logger[_0x6fed('0x17')](_0x6fed('0x5b'),_0x2cca10['id'],JSON['stringify'](_0x159521));});}; \ No newline at end of file +var _0x435b=['filter','VIRTUAL','merge','options','includeAll','include','rows','service','MicrosoftAzure','decryptString','data3','catch','show','create','body','Name\x20parameter\x20not\x20specified','values','includes','join','encryptString','params','find','oauth2MicrosoftAuthorize','findOne','user','get','state','Invalid\x20state\x20parameter','from','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','code','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','./cloudProvider.oauth','redis','defaults','socket.io-emitter','end','offset','undefined','count','limit','status','Content-Range','json','update','then','destroy','sendStatus','error','stack','name','send','padEnd','slice','index','CloudProvider','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2e997e,_0x4edf31){var _0x5a6cb1=function(_0x3904da){while(--_0x3904da){_0x2e997e['push'](_0x2e997e['shift']());}};_0x5a6cb1(++_0x4edf31);}(_0x435b,0x19d));var _0xb435=function(_0x57d637,_0x28087d){_0x57d637=_0x57d637-0x0;var _0x423330=_0x435b[_0x57d637];return _0x423330;};'use strict';var _=require(_0xb435('0x0'));var Redis=require(_0xb435('0x1'));var qs=require(_0xb435('0x2'));var encryptor=require(_0xb435('0x3'));var config=require(_0xb435('0x4'));var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var oauth=require(_0xb435('0x5'));config[_0xb435('0x6')]=_[_0xb435('0x7')](config[_0xb435('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xb435('0x8'))(new Redis(config[_0xb435('0x6')]));var redis=new Redis(config[_0xb435('0x6')]);function respondWithStatusCode(_0x55ae52,_0x413a98){_0x413a98=_0x413a98||0xcc;return function(_0x56c75c){if(_0x56c75c){return _0x55ae52['sendStatus'](_0x413a98);}return _0x55ae52['status'](_0x413a98)[_0xb435('0x9')]();};}function respondWithResult(_0x1847b2,_0x4d0fcc){_0x4d0fcc=_0x4d0fcc||0xc8;return function(_0x18f785){if(_0x18f785){return _0x1847b2['status'](_0x4d0fcc)['json'](_0x18f785);}};}function respondWithFilteredResult(_0x49200a,_0x1442be){return function(_0x3a7322){if(_0x3a7322){var _0x50e9fb=typeof _0x1442be[_0xb435('0xa')]===_0xb435('0xb')&&typeof _0x1442be['limit']===_0xb435('0xb');var _0x9815d5=_0x3a7322[_0xb435('0xc')];var _0x5e4278=_0x50e9fb?0x0:_0x1442be[_0xb435('0xa')];var _0x580a7c=_0x50e9fb?_0x3a7322[_0xb435('0xc')]:_0x1442be[_0xb435('0xa')]+_0x1442be[_0xb435('0xd')];var _0x4666b2;if(_0x580a7c>=_0x9815d5){_0x580a7c=_0x9815d5;_0x4666b2=0xc8;}else{_0x4666b2=0xce;}_0x49200a[_0xb435('0xe')](_0x4666b2);return _0x49200a['set'](_0xb435('0xf'),_0x5e4278+'-'+_0x580a7c+'/'+_0x9815d5)[_0xb435('0x10')](_0x3a7322);}return null;};}function saveUpdates(_0x99a673){return function(_0x163cbf){if(_0x163cbf){return _0x163cbf[_0xb435('0x11')](_0x99a673)[_0xb435('0x12')](function(_0x939493){return _0x939493;});}return null;};}function removeEntity(_0x438cd2){return function(_0x566a43){if(_0x566a43){return _0x566a43[_0xb435('0x13')]()[_0xb435('0x12')](function(){_0x438cd2[_0xb435('0xe')](0xcc)[_0xb435('0x9')]();});}};}function handleEntityNotFound(_0x7375cd){return function(_0x544c30){if(!_0x544c30){_0x7375cd[_0xb435('0x14')](0x194);}return _0x544c30;};}function handleError(_0x257a42,_0x2f8ab6){_0x2f8ab6=_0x2f8ab6||0x1f4;return function(_0x139885){logger[_0xb435('0x15')](_0x139885[_0xb435('0x16')]);if(_0x139885[_0xb435('0x17')]){delete _0x139885[_0xb435('0x17')];}_0x257a42[_0xb435('0xe')](_0x2f8ab6)[_0xb435('0x18')](_0x139885);};}function maskClientSecret(_0x28354d){return _[_0xb435('0x19')](_0x28354d[_0xb435('0x1a')](0x0,0x3),0x14,'*');}exports[_0xb435('0x1b')]=function(_0x12bb6b,_0x27d91c){var _0x56d02c={},_0x4d36c1={},_0x4a1ce4={'count':0x0,'rows':[]};var _0x2e96e8=_['map'](db[_0xb435('0x1c')][_0xb435('0x1d')],function(_0x34da64){return{'name':_0x34da64[_0xb435('0x1e')],'type':_0x34da64[_0xb435('0x1f')]['key']};});_0x4d36c1[_0xb435('0x20')]=_[_0xb435('0x21')](_0x2e96e8,_0xb435('0x17'));_0x4d36c1[_0xb435('0x22')]=_[_0xb435('0x23')](_0x12bb6b[_0xb435('0x22')]);_0x4d36c1[_0xb435('0x24')]=_[_0xb435('0x25')](_0x4d36c1[_0xb435('0x20')],_0x4d36c1[_0xb435('0x22')]);_0x56d02c[_0xb435('0x26')]=_[_0xb435('0x25')](_0x4d36c1['model'],qs[_0xb435('0x27')](_0x12bb6b[_0xb435('0x22')][_0xb435('0x27')]));_0x56d02c[_0xb435('0x26')]=_0x56d02c['attributes'][_0xb435('0x28')]?_0x56d02c[_0xb435('0x26')]:_0x4d36c1[_0xb435('0x20')];if(!_0x12bb6b['query'][_0xb435('0x29')](_0xb435('0x2a'))){_0x56d02c['limit']=qs[_0xb435('0xd')](_0x12bb6b[_0xb435('0x22')][_0xb435('0xd')]);_0x56d02c[_0xb435('0xa')]=qs['offset'](_0x12bb6b[_0xb435('0x22')]['offset']);}_0x56d02c[_0xb435('0x2b')]=qs[_0xb435('0x2c')](_0x12bb6b['query'][_0xb435('0x2c')]);_0x56d02c[_0xb435('0x2d')]=qs[_0xb435('0x24')](_[_0xb435('0x2e')](_0x12bb6b['query'],_0x4d36c1[_0xb435('0x24')]),_0x2e96e8);if(_0x12bb6b['query'][_0xb435('0x2f')]){_0x56d02c[_0xb435('0x2d')]=_['merge'](_0x56d02c['where'],{'$or':_[_0xb435('0x21')](_0x2e96e8,function(_0x1ace94){if(_0x1ace94['type']!==_0xb435('0x30')){var _0x4572e8={};_0x4572e8[_0x1ace94[_0xb435('0x17')]]={'$like':'%'+_0x12bb6b[_0xb435('0x22')][_0xb435('0x2f')]+'%'};return _0x4572e8;}})});}_0x56d02c=_[_0xb435('0x31')]({},_0x56d02c,_0x12bb6b[_0xb435('0x32')]);var _0x3db784={'where':_0x56d02c[_0xb435('0x2d')]};return db[_0xb435('0x1c')][_0xb435('0xc')](_0x3db784)[_0xb435('0x12')](function(_0x5dc0af){_0x4a1ce4[_0xb435('0xc')]=_0x5dc0af;if(_0x12bb6b[_0xb435('0x22')][_0xb435('0x33')]){_0x56d02c[_0xb435('0x34')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x56d02c);})[_0xb435('0x12')](function(_0x355818){_0x4a1ce4[_0xb435('0x35')]=_[_0xb435('0x21')](_0x355818,function(_0x50b3cd){if(_0x50b3cd[_0xb435('0x36')]===_0xb435('0x37')){var _0x5cfd25=encryptor[_0xb435('0x38')](_0x50b3cd[_0xb435('0x39')]);_0x50b3cd[_0xb435('0x39')]=maskClientSecret(_0x5cfd25);}return _0x50b3cd;});return _0x4a1ce4;})['then'](respondWithFilteredResult(_0x27d91c,_0x56d02c))[_0xb435('0x3a')](handleError(_0x27d91c,null));};exports[_0xb435('0x3b')]=function(_0xf84ead,_0x3f5eb0){var _0x124452={'raw':!![],'where':{'id':_0xf84ead['params']['id']}},_0x8a20ae={};_0x8a20ae[_0xb435('0x20')]=_[_0xb435('0x23')](db['CloudProvider'][_0xb435('0x1d')]);_0x8a20ae['query']=_['keys'](_0xf84ead[_0xb435('0x22')]);_0x8a20ae['filters']=_[_0xb435('0x25')](_0x8a20ae[_0xb435('0x20')],_0x8a20ae[_0xb435('0x22')]);_0x124452[_0xb435('0x26')]=_['intersection'](_0x8a20ae['model'],qs['fields'](_0xf84ead[_0xb435('0x22')][_0xb435('0x27')]));_0x124452[_0xb435('0x26')]=_0x124452[_0xb435('0x26')][_0xb435('0x28')]?_0x124452['attributes']:_0x8a20ae[_0xb435('0x20')];if(_0xf84ead[_0xb435('0x22')]['includeAll']){_0x124452['include']=[{'all':!![]}];}_0x124452=_[_0xb435('0x31')]({},_0x124452,_0xf84ead['options']);return db[_0xb435('0x1c')]['find'](_0x124452)[_0xb435('0x12')](handleEntityNotFound(_0x3f5eb0,null))['then'](function(_0x4b3c4d){if(_0x4b3c4d[_0xb435('0x36')]===_0xb435('0x37')){var _0x5b70ee=encryptor[_0xb435('0x38')](_0x4b3c4d[_0xb435('0x39')]);_0x4b3c4d['data3']=maskClientSecret(_0x5b70ee);}return _0x4b3c4d;})[_0xb435('0x12')](respondWithResult(_0x3f5eb0,null))[_0xb435('0x3a')](handleError(_0x3f5eb0,null));};exports[_0xb435('0x3c')]=function(_0x206538,_0x20a7c8){if(!_0x206538[_0xb435('0x3d')][_0xb435('0x17')])throw new Error(_0xb435('0x3e'));if(!_0x206538[_0xb435('0x3d')][_0xb435('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x586456=db[_0xb435('0x1c')]['rawAttributes'][_0xb435('0x36')][_0xb435('0x3f')];if(!_0x586456[_0xb435('0x40')](_0x206538[_0xb435('0x3d')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x586456[_0xb435('0x41')](',\x20'));if(_0x206538[_0xb435('0x3d')][_0xb435('0x36')]===_0xb435('0x37')&&_0x206538[_0xb435('0x3d')][_0xb435('0x39')]){_0x206538[_0xb435('0x3d')][_0xb435('0x39')]=encryptor[_0xb435('0x42')](_0x206538[_0xb435('0x3d')]['data3']);}return db[_0xb435('0x1c')]['create'](_0x206538['body'],{})[_0xb435('0x12')](respondWithResult(_0x20a7c8,0xc9))[_0xb435('0x3a')](handleError(_0x20a7c8,null));};exports['update']=function(_0x57e211,_0x1833e7){if(_0x57e211[_0xb435('0x3d')]['id']){delete _0x57e211['body']['id'];}return db['CloudProvider']['find']({'where':{'id':_0x57e211[_0xb435('0x43')]['id']}})[_0xb435('0x12')](handleEntityNotFound(_0x1833e7,null))[_0xb435('0x12')](function(_0x432806){if(_0x432806[_0xb435('0x36')]===_0xb435('0x37')&&_0x57e211['body'][_0xb435('0x39')]){_0x57e211[_0xb435('0x3d')][_0xb435('0x39')]=encryptor['encryptString'](_0x57e211[_0xb435('0x3d')][_0xb435('0x39')]);}return _0x432806;})['then'](saveUpdates(_0x57e211[_0xb435('0x3d')],null))[_0xb435('0x12')](respondWithResult(_0x1833e7,null))[_0xb435('0x3a')](handleError(_0x1833e7,null));};exports['destroy']=function(_0x50c13a,_0x5e75c8){return db[_0xb435('0x1c')][_0xb435('0x44')]({'where':{'id':_0x50c13a[_0xb435('0x43')]['id']}})['then'](handleEntityNotFound(_0x5e75c8,null))[_0xb435('0x12')](removeEntity(_0x5e75c8,null))[_0xb435('0x3a')](handleError(_0x5e75c8,null));};exports[_0xb435('0x45')]=function(_0x919c13,_0x157b4c){return db[_0xb435('0x1c')][_0xb435('0x46')]({'where':{'id':_0x919c13['params']['id']},'raw':!![]})[_0xb435('0x12')](function(_0x311009){if(!_0x311009)return _0x157b4c[_0xb435('0x14')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x311009,_0x919c13[_0xb435('0x47')]['id'])};})[_0xb435('0x12')](respondWithResult(_0x157b4c,null))['catch'](handleError(_0x157b4c,null));};exports['oauth2MicrosoftCallback']=function(_0x1dedbd,_0x59fdbb){var _0x864a38=_0x1dedbd[_0xb435('0x3d')];var _0x2eab1c;var _0xbf9d1a;if(_0x864a38[_0xb435('0x15')])throw _0x864a38;redis[_0xb435('0x48')](_0x864a38[_0xb435('0x49')])['then'](function(_0x3a8895){if(!_0x3a8895)throw new Error(_0xb435('0x4a'));_0x2eab1c=JSON['parse'](_0x3a8895);var _0xffec7d=Buffer[_0xb435('0x4b')](_0x864a38['state'],'base64')[_0xb435('0x4c')](_0xb435('0x4d'));_0xbf9d1a=JSON['parse'](_0xffec7d);if(!oauth[_0xb435('0x4e')](_0x864a38[_0xb435('0x4f')],_0x2eab1c[_0xb435('0x50')]))throw new Error(_0xb435('0x51'));redis['del'](_0x864a38[_0xb435('0x49')]);return oauth['getOauth2MicrosoftAccessToken'](_0x864a38[_0xb435('0x52')],_0x2eab1c);})[_0xb435('0x12')](function(_0x4b4d03){_0x2eab1c[_0xb435('0x53')]=_0x4b4d03[_0xb435('0x54')];_0x2eab1c[_0xb435('0x55')]=_0x4b4d03[_0xb435('0x56')];return db[_0xb435('0x1c')]['update']({'data5':_0x2eab1c['data5'],'data6':_0x2eab1c[_0xb435('0x55')]},{'where':{'id':_0x2eab1c['id']}});})[_0xb435('0x12')](function(){oauth['startRefreshInterval'](_0x2eab1c);socket[_0xb435('0x57')](_0xb435('0x58'),{'id':_0xbf9d1a['id']});return;})[_0xb435('0x12')](respondWithStatusCode(_0x59fdbb,null))[_0xb435('0x3a')](function(_0x3e38c5){if(_0xbf9d1a){socket[_0xb435('0x57')]('microsoftAuthorization:error',{'id':_0xbf9d1a['id']});}if(!_0x2eab1c){logger[_0xb435('0x15')](_0xb435('0x59'),_0x3e38c5);return _0x59fdbb['status'](0x1f4)[_0xb435('0x18')](_0x3e38c5['message']);}logger[_0xb435('0x15')](_0xb435('0x5a'),_0x2eab1c['id'],JSON[_0xb435('0x5b')](_0x3e38c5));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index a047f6c..1edb9c4 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 _0x19f3=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x19f3,0x1a7));var _0x319f=function(_0x3fd455,_0x1f7c5b){_0x3fd455=_0x3fd455-0x0;var _0x1c259f=_0x19f3[_0x3fd455];return _0x1c259f;};'use strict';var _=require(_0x319f('0x0'));var util=require(_0x319f('0x1'));var logger=require(_0x319f('0x2'))('api');var moment=require(_0x319f('0x3'));var BPromise=require(_0x319f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x319f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x319f('0x6'));module[_0x319f('0x7')]=function(_0x131330,_0xeb014d){return _0x131330[_0x319f('0x8')](_0x319f('0x9'),attributes,{'tableName':_0x319f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9eff=['define','CloudProvider','cloud_providers','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x323d5c,_0x3a85d8){var _0x2ec1ca=function(_0x2edccb){while(--_0x2edccb){_0x323d5c['push'](_0x323d5c['shift']());}};_0x2ec1ca(++_0x3a85d8);}(_0x9eff,0x137));var _0xf9ef=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x9eff[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xf9ef('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf9ef('0x1'));var moment=require(_0xf9ef('0x2'));var BPromise=require(_0xf9ef('0x3'));var rp=require(_0xf9ef('0x4'));var fs=require('fs');var path=require(_0xf9ef('0x5'));var rimraf=require(_0xf9ef('0x6'));var config=require(_0xf9ef('0x7'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x587daf,_0xa9c296){return _0x587daf[_0xf9ef('0x8')](_0xf9ef('0x9'),attributes,{'tableName':_0xf9ef('0xa'),'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 00ee85c..a54d451 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 _0x6ec7=['type','push','data7','/.default','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','data2','code','id_token','from','stringify','toString','randomBytes','hex','client_id','data1','response_type','redirect_uri','response_mode','form_post','state','prompt','login','key','value','join','oauth2Claims','oauth2/','decode','issuer','aud','audience','nonce','exp','resolve','data3','CloudProvider','findOne','then','data6','data4','{TENANT_ID}','data5','access_token','refresh_token','update','catch','error','authorization_code','decryptString','bind','intervals','findAll','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','util','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office.com/SMTP.Send','/authorize','/token','map'];(function(_0x4fce36,_0x4adbfa){var _0x423cae=function(_0x168fcd){while(--_0x168fcd){_0x4fce36['push'](_0x4fce36['shift']());}};_0x423cae(++_0x4adbfa);}(_0x6ec7,0x158));var _0x76ec=function(_0x4fb6c,_0x343465){_0x4fb6c=_0x4fb6c-0x0;var _0x31db60=_0x6ec7[_0x4fb6c];return _0x31db60;};'use strict';var _=require('lodash');var crypto=require(_0x76ec('0x0'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x76ec('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x76ec('0x2'));var logger=require('../../config/logger')(_0x76ec('0x3'));var schedule=require(_0x76ec('0x4'));var db=require(_0x76ec('0x5'))['db'];config['redis']=_['defaults'](config[_0x76ec('0x6')],{'host':_0x76ec('0x7'),'port':0x18eb});var redis=new Redis(config[_0x76ec('0x6')]);var MICROSOFT_AUTH_URL=_0x76ec('0x8');var AZURE_AUTH_SCOPES={'Outlook365':[_0x76ec('0x9'),'profile',_0x76ec('0xa'),_0x76ec('0xb'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0x76ec('0xc')],'Dynamics365':[_0x76ec('0x9'),_0x76ec('0xb')]};var MICROSOFT_AUTH_ENDPOINT=_0x76ec('0xd');var MICROSOFT_TOKEN_ENDPOINT=_0x76ec('0xe');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x44a1f6){var _0x19dd55=_[_0x76ec('0xf')](AZURE_AUTH_SCOPES[_0x44a1f6['type']]);if(_0x44a1f6[_0x76ec('0x10')]==='Dynamics365')_0x19dd55[_0x76ec('0x11')](_0x44a1f6[_0x76ec('0x12')]+_0x76ec('0x13'));return _0x19dd55['join']('\x20');}function getAccessTokenScope(_0x1de183){if(_0x1de183['type']==='Outlook365')return _0x76ec('0x14');if(_0x1de183[_0x76ec('0x10')]==='Dynamics365')return _0x1de183['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x4816a7,_0x3e209f){var _0x4b03f7=MICROSOFT_AUTH_URL[_0x76ec('0x15')]('{TENANT_ID}',_0x4816a7[_0x76ec('0x16')]);var _0x19205a=[_0x76ec('0x17'),_0x76ec('0x18')];var _0x2cdf81=Buffer[_0x76ec('0x19')](JSON[_0x76ec('0x1a')]({'id':_0x3e209f}))[_0x76ec('0x1b')]('base64');var _0x3526ec=crypto[_0x76ec('0x1c')](0x10)[_0x76ec('0x1b')](_0x76ec('0x1d'));var _0x1931ff=getAuthorizationScopes(_0x4816a7);var _0x26d97e=[{'key':_0x76ec('0x1e'),'value':_0x4816a7[_0x76ec('0x1f')]},{'key':_0x76ec('0x20'),'value':encodeURIComponent(_0x19205a['join']('\x20'))},{'key':_0x76ec('0x21'),'value':_0x4816a7['data4']},{'key':_0x76ec('0x22'),'value':_0x76ec('0x23')},{'key':'scope','value':encodeURIComponent(_0x1931ff)},{'key':_0x76ec('0x24'),'value':_0x2cdf81},{'key':'nonce','value':_0x3526ec},{'key':_0x76ec('0x25'),'value':_0x76ec('0x26')}];var _0x2e1070=_0x4b03f7+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x76ec('0xf')](_0x26d97e,function(_0x570c51){return _0x570c51[_0x76ec('0x27')]+'='+_0x570c51[_0x76ec('0x28')];})[_0x76ec('0x29')]('&');_0x4816a7[_0x76ec('0x2a')]={'issuer':_0x4b03f7[_0x76ec('0x15')](_0x76ec('0x2b'),''),'audience':_0x4816a7[_0x76ec('0x1f')],'state':_0x2cdf81,'nonce':_0x3526ec};redis['set'](_0x2cdf81,JSON[_0x76ec('0x1a')](_0x4816a7));return _0x2e1070;}function isValidIdToken(_0x3f7e2b,_0x581921){try{var _0x244f90=jwt[_0x76ec('0x2c')](_0x3f7e2b,{'complete':!![]});var _0x44e9ab=_0x244f90['payload'];if(_0x44e9ab['iss']!==_0x581921[_0x76ec('0x2d')])return![];if(_0x44e9ab[_0x76ec('0x2e')]!==_0x581921[_0x76ec('0x2f')])return![];if(_0x44e9ab[_0x76ec('0x30')]!==_0x581921[_0x76ec('0x30')])return![];if(moment()['isAfter'](moment['unix'](_0x44e9ab[_0x76ec('0x31')])))return![];return!![];}catch(_0xed7be0){throw _0xed7be0;}}function refreshOauth2MicrosoftAccessToken(_0x436274){return Promise[_0x76ec('0x32')]()['then'](function(){if(_0x436274[_0x76ec('0x33')])return _0x436274;return db[_0x76ec('0x34')][_0x76ec('0x35')]({'where':{'id':_0x436274['id']},'raw':!![]});})[_0x76ec('0x36')](function(_0x189d66){var _0xf8c6f3={'grant_type':'refresh_token','refresh_token':_0x189d66[_0x76ec('0x37')],'scope':getAccessTokenScope(_0x189d66),'redirect_uri':_0x189d66[_0x76ec('0x38')],'client_id':_0x189d66[_0x76ec('0x1f')],'client_secret':encryptor['decryptString'](_0x189d66['data3'])};var _0x16353f={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x76ec('0x39'),_0x189d66['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xf8c6f3,'json':!![]};return rp(_0x16353f);})['then'](function(_0x1c75e8){_0x436274[_0x76ec('0x3a')]=_0x1c75e8[_0x76ec('0x3b')];_0x436274[_0x76ec('0x37')]=_0x1c75e8[_0x76ec('0x3c')];return db[_0x76ec('0x34')][_0x76ec('0x3d')]({'data5':_0x436274[_0x76ec('0x3a')],'data6':_0x436274[_0x76ec('0x37')]},{'where':{'id':_0x436274['id']}});})[_0x76ec('0x36')](function(){return _0x436274;})[_0x76ec('0x3e')](function(_0x44b4c8){logger[_0x76ec('0x3f')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x436274['id'],_0x44b4c8);});}function getOauth2MicrosoftAccessToken(_0x299a38,_0x25c2e6){var _0x580b66={'grant_type':_0x76ec('0x40'),'code':_0x299a38,'scope':getAccessTokenScope(_0x25c2e6),'redirect_uri':_0x25c2e6[_0x76ec('0x38')],'client_id':_0x25c2e6[_0x76ec('0x1f')],'client_secret':encryptor[_0x76ec('0x41')](_0x25c2e6[_0x76ec('0x33')])};var _0x5e243a={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x76ec('0x15')](_0x76ec('0x39'),_0x25c2e6[_0x76ec('0x16')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x580b66,'json':!![]};return rp(_0x5e243a);}function startRefreshInterval(_0x186317){var _0x5e7198=schedule['intervals'];if(_0x5e7198[_0x186317['id']])clearInterval(_0x5e7198[_0x186317['id']]);_0x5e7198[_0x186317['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x76ec('0x42')](this,{'id':_0x186317['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x76ec('0x43')]=_0x5e7198;}function startAllRefreshIntervals(){return db[_0x76ec('0x34')][_0x76ec('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x76ec('0x36')](function(_0x47f57b){var _0x30e16b=_0x47f57b[_0x76ec('0xf')](function(_0x4001b2){return refreshOauth2MicrosoftAccessToken(_0x4001b2)[_0x76ec('0x36')](function(_0x41d20b){startRefreshInterval(_0x41d20b);});});return Promise['all'](_0x30e16b);})['catch'](function(_0x4c9f47){var _0x156c85=_0x4c9f47?util[_0x76ec('0x45')](_0x4c9f47,{'showHidden':![],'depth':null}):'';logger['error'](_0x76ec('0x46'),_0x156c85);});}module[_0x76ec('0x47')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x8241=['../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','Dynamics365','push','data7','/.default','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','data2','id_token','from','base64','randomBytes','toString','hex','response_type','redirect_uri','data4','response_mode','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','stringify','decode','payload','aud','audience','exp','resolve','data3','findOne','then','refresh_token','data6','data1','decryptString','POST','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','CloudProvider','findAll','all','inspect','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api'];(function(_0x214d77,_0x4ab0f0){var _0x381f48=function(_0x1cf948){while(--_0x1cf948){_0x214d77['push'](_0x214d77['shift']());}};_0x381f48(++_0x4ab0f0);}(_0x8241,0x1c4));var _0x1824=function(_0x489eef,_0x3f3949){_0x489eef=_0x489eef-0x0;var _0x54fc21=_0x8241[_0x489eef];return _0x54fc21;};'use strict';var _=require(_0x1824('0x0'));var crypto=require(_0x1824('0x1'));var jwt=require(_0x1824('0x2'));var moment=require('moment');var Redis=require(_0x1824('0x3'));var rp=require(_0x1824('0x4'));var util=require(_0x1824('0x5'));var encryptor=require(_0x1824('0x6'));var config=require(_0x1824('0x7'));var logger=require(_0x1824('0x8'))(_0x1824('0x9'));var schedule=require(_0x1824('0xa'));var db=require(_0x1824('0xb'))['db'];config['redis']=_[_0x1824('0xc')](config[_0x1824('0xd')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x1824('0xd')]);var MICROSOFT_AUTH_URL=_0x1824('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0x1824('0xf'),_0x1824('0x10'),_0x1824('0x11'),_0x1824('0x12'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x1824('0x13'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x1824('0xf'),_0x1824('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0x1824('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x1824('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x43df63){var _0x2083c3=_[_0x1824('0x16')](AZURE_AUTH_SCOPES[_0x43df63['type']]);if(_0x43df63[_0x1824('0x17')]===_0x1824('0x18'))_0x2083c3[_0x1824('0x19')](_0x43df63[_0x1824('0x1a')]+_0x1824('0x1b'));return _0x2083c3['join']('\x20');}function getAccessTokenScope(_0x1d61e6){if(_0x1d61e6[_0x1824('0x17')]===_0x1824('0x1c'))return _0x1824('0x1d');if(_0x1d61e6[_0x1824('0x17')]===_0x1824('0x18'))return _0x1d61e6[_0x1824('0x1a')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x35af6a,_0x3af134){var _0x448aca=MICROSOFT_AUTH_URL[_0x1824('0x1e')](_0x1824('0x1f'),_0x35af6a[_0x1824('0x20')]);var _0x571872=['code',_0x1824('0x21')];var _0xd2d37f=Buffer[_0x1824('0x22')](JSON['stringify']({'id':_0x3af134}))['toString'](_0x1824('0x23'));var _0x2d4958=crypto[_0x1824('0x24')](0x10)[_0x1824('0x25')](_0x1824('0x26'));var _0x4ec221=getAuthorizationScopes(_0x35af6a);var _0x111402=[{'key':'client_id','value':_0x35af6a['data1']},{'key':_0x1824('0x27'),'value':encodeURIComponent(_0x571872['join']('\x20'))},{'key':_0x1824('0x28'),'value':_0x35af6a[_0x1824('0x29')]},{'key':_0x1824('0x2a'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x4ec221)},{'key':_0x1824('0x2b'),'value':_0xd2d37f},{'key':_0x1824('0x2c'),'value':_0x2d4958},{'key':_0x1824('0x2d'),'value':_0x1824('0x2e')}];var _0x90492e=_0x448aca+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x1824('0x16')](_0x111402,function(_0x32990b){return _0x32990b[_0x1824('0x2f')]+'='+_0x32990b[_0x1824('0x30')];})['join']('&');_0x35af6a[_0x1824('0x31')]={'issuer':_0x448aca[_0x1824('0x1e')](_0x1824('0x32'),''),'audience':_0x35af6a['data1'],'state':_0xd2d37f,'nonce':_0x2d4958};redis['set'](_0xd2d37f,JSON[_0x1824('0x33')](_0x35af6a));return _0x90492e;}function isValidIdToken(_0x208166,_0x12dd67){try{var _0x130102=jwt[_0x1824('0x34')](_0x208166,{'complete':!![]});var _0x51ab42=_0x130102[_0x1824('0x35')];if(_0x51ab42['iss']!==_0x12dd67['issuer'])return![];if(_0x51ab42[_0x1824('0x36')]!==_0x12dd67[_0x1824('0x37')])return![];if(_0x51ab42[_0x1824('0x2c')]!==_0x12dd67['nonce'])return![];if(moment()['isAfter'](moment['unix'](_0x51ab42[_0x1824('0x38')])))return![];return!![];}catch(_0x216ca5){throw _0x216ca5;}}function refreshOauth2MicrosoftAccessToken(_0x20ae66){return Promise[_0x1824('0x39')]()['then'](function(){if(_0x20ae66[_0x1824('0x3a')])return _0x20ae66;return db['CloudProvider'][_0x1824('0x3b')]({'where':{'id':_0x20ae66['id']},'raw':!![]});})[_0x1824('0x3c')](function(_0xa35fa4){var _0x4ba5b4={'grant_type':_0x1824('0x3d'),'refresh_token':_0xa35fa4[_0x1824('0x3e')],'scope':getAccessTokenScope(_0xa35fa4),'redirect_uri':_0xa35fa4[_0x1824('0x29')],'client_id':_0xa35fa4[_0x1824('0x3f')],'client_secret':encryptor[_0x1824('0x40')](_0xa35fa4['data3'])};var _0x16ad20={'method':_0x1824('0x41'),'uri':MICROSOFT_AUTH_URL[_0x1824('0x1e')](_0x1824('0x1f'),_0xa35fa4[_0x1824('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4ba5b4,'json':!![]};return rp(_0x16ad20);})[_0x1824('0x3c')](function(_0x188777){_0x20ae66[_0x1824('0x42')]=_0x188777['access_token'];_0x20ae66[_0x1824('0x3e')]=_0x188777['refresh_token'];return db['CloudProvider']['update']({'data5':_0x20ae66['data5'],'data6':_0x20ae66[_0x1824('0x3e')]},{'where':{'id':_0x20ae66['id']}});})[_0x1824('0x3c')](function(){return _0x20ae66;})[_0x1824('0x43')](function(_0x29731){logger[_0x1824('0x44')](_0x1824('0x45'),_0x20ae66['id'],_0x29731);});}function getOauth2MicrosoftAccessToken(_0x3932ad,_0x187a3b){var _0x599c41={'grant_type':'authorization_code','code':_0x3932ad,'scope':getAccessTokenScope(_0x187a3b),'redirect_uri':_0x187a3b[_0x1824('0x29')],'client_id':_0x187a3b[_0x1824('0x3f')],'client_secret':encryptor['decryptString'](_0x187a3b['data3'])};var _0xe542b0={'method':_0x1824('0x41'),'uri':MICROSOFT_AUTH_URL[_0x1824('0x1e')](_0x1824('0x1f'),_0x187a3b[_0x1824('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x599c41,'json':!![]};return rp(_0xe542b0);}function startRefreshInterval(_0x26c451){var _0x52e9c0=schedule[_0x1824('0x46')];if(_0x52e9c0[_0x26c451['id']])clearInterval(_0x52e9c0[_0x26c451['id']]);_0x52e9c0[_0x26c451['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x1824('0x47')](this,{'id':_0x26c451['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x1824('0x46')]=_0x52e9c0;}function startAllRefreshIntervals(){return db[_0x1824('0x48')][_0x1824('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x1824('0x3c')](function(_0x23cff6){var _0x177249=_0x23cff6[_0x1824('0x16')](function(_0x4c0e52){return refreshOauth2MicrosoftAccessToken(_0x4c0e52)[_0x1824('0x3c')](function(_0x3c44a0){startRefreshInterval(_0x3c44a0);});});return Promise[_0x1824('0x4a')](_0x177249);})[_0x1824('0x43')](function(_0x4fc8c4){var _0x225d0a=_0x4fc8c4?util[_0x1824('0x4b')](_0x4fc8c4,{'showHidden':![],'depth':null}):'';logger[_0x1824('0x44')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x225d0a);});}module[_0x1824('0x4c')]={'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 4200ccb..1f2f75c 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 _0x80c4=['request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4d674b,_0x176474){var _0x535a1f=function(_0xac7726){while(--_0xac7726){_0x4d674b['push'](_0x4d674b['shift']());}};_0x535a1f(++_0x176474);}(_0x80c4,0xa3));var _0x480c=function(_0xc7272c,_0x281fe1){_0xc7272c=_0xc7272c-0x0;var _0x2760ca=_0x80c4[_0xc7272c];return _0x2760ca;};'use strict';var _=require(_0x480c('0x0'));var util=require('util');var moment=require(_0x480c('0x1'));var BPromise=require(_0x480c('0x2'));var rs=require(_0x480c('0x3'));var fs=require('fs');var Redis=require(_0x480c('0x4'));var db=require(_0x480c('0x5'))['db'];var utils=require(_0x480c('0x6'));var logger=require('../../config/logger')(_0x480c('0x7'));var config=require(_0x480c('0x8'));var jayson=require(_0x480c('0x9'));var client=jayson[_0x480c('0xa')][_0x480c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40a5a6,_0x3a69ec,_0x277efe){return new BPromise(function(_0x21545d,_0x510038){return client[_0x480c('0xc')](_0x40a5a6,_0x277efe)[_0x480c('0xd')](function(_0x292aca){logger[_0x480c('0xe')](_0x480c('0xf'),_0x3a69ec,_0x480c('0x10'));logger[_0x480c('0x11')](_0x480c('0x12'),_0x3a69ec,_0x480c('0x10'),JSON[_0x480c('0x13')](_0x292aca));if(_0x292aca[_0x480c('0x14')]){if(_0x292aca[_0x480c('0x14')][_0x480c('0x15')]===0x1f4){logger[_0x480c('0x14')](_0x480c('0xf'),_0x3a69ec,_0x292aca[_0x480c('0x14')][_0x480c('0x16')]);return _0x510038(_0x292aca[_0x480c('0x14')]['message']);}logger[_0x480c('0x14')](_0x480c('0xf'),_0x3a69ec,_0x292aca['error'][_0x480c('0x16')]);return _0x21545d(_0x292aca[_0x480c('0x14')][_0x480c('0x16')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x3a69ec,_0x480c('0x10'));_0x21545d(_0x292aca[_0x480c('0x17')][_0x480c('0x16')]);}})[_0x480c('0x18')](function(_0x93d6c5){logger['error']('CloudProvider,\x20%s,\x20%s',_0x3a69ec,_0x93d6c5);_0x510038(_0x93d6c5);});});} \ No newline at end of file +var _0x4d5a=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request'];(function(_0x36b569,_0xd23237){var _0x9383d2=function(_0x4a4669){while(--_0x4a4669){_0x36b569['push'](_0x36b569['shift']());}};_0x9383d2(++_0xd23237);}(_0x4d5a,0x15e));var _0xa4d5=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x4d5a[_0x46aff0];return _0x9d78cf;};'use strict';var _=require('lodash');var util=require(_0xa4d5('0x0'));var moment=require(_0xa4d5('0x1'));var BPromise=require(_0xa4d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4d5('0x3'));var db=require(_0xa4d5('0x4'))['db'];var utils=require(_0xa4d5('0x5'));var logger=require(_0xa4d5('0x6'))('rpc');var config=require(_0xa4d5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa4d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1856aa,_0x166db3,_0x318315){return new BPromise(function(_0x408db0,_0x3bed6b){return client[_0xa4d5('0x9')](_0x1856aa,_0x318315)['then'](function(_0x5586de){logger[_0xa4d5('0xa')](_0xa4d5('0xb'),_0x166db3,_0xa4d5('0xc'));logger[_0xa4d5('0xd')](_0xa4d5('0xe'),_0x166db3,_0xa4d5('0xc'),JSON[_0xa4d5('0xf')](_0x5586de));if(_0x5586de[_0xa4d5('0x10')]){if(_0x5586de['error']['code']===0x1f4){logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);return _0x3bed6b(_0x5586de['error']['message']);}logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);return _0x408db0(_0x5586de[_0xa4d5('0x10')][_0xa4d5('0x11')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x166db3,_0xa4d5('0xc'));_0x408db0(_0x5586de[_0xa4d5('0x12')]['message']);}})[_0xa4d5('0x13')](function(_0x31eed7){logger[_0xa4d5('0x10')](_0xa4d5('0xb'),_0x166db3,_0x31eed7);_0x3bed6b(_0x31eed7);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 75e2c8f..248cfce 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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x34e752,_0x32e2a2){var _0x7c6347=function(_0x4db671){while(--_0x4db671){_0x34e752['push'](_0x34e752['shift']());}};_0x7c6347(++_0x32e2a2);}(_0x1261,0x144));var _0x1126=function(_0x4d6bfd,_0x8d79ff){_0x4d6bfd=_0x4d6bfd-0x0;var _0x243a46=_0x1261[_0x4d6bfd];return _0x243a46;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x7a54,0x106));var _0x47a5=function(_0x4788ec,_0xde789d){_0x4788ec=_0x4788ec-0x0;var _0x2282f1=_0x7a54[_0x4788ec];return _0x2282f1;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 57b5fc3..bbe19fe 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 _0x3c14=['sequelize','STRING','name'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x3c14,0x186));var _0x43c1=function(_0x4d7a70,_0x2d3bfa){_0x4d7a70=_0x4d7a70-0x0;var _0x3aafbb=_0x3c14[_0x4d7a70];return _0x3aafbb;};'use strict';var Sequelize=require(_0x43c1('0x0'));module['exports']={'name':{'type':Sequelize[_0x43c1('0x1')],'unique':_0x43c1('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x43c1('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x43c1('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x43c1('0x1')]},'type':{'type':Sequelize[_0x43c1('0x1')]},'street':{'type':Sequelize[_0x43c1('0x1')]},'postalCode':{'type':Sequelize[_0x43c1('0x1')]},'city':{'type':Sequelize[_0x43c1('0x1')]},'country':{'type':Sequelize[_0x43c1('0x1')]},'email':{'type':Sequelize[_0x43c1('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x43c1('0x1')]}}; \ No newline at end of file +var _0x8373=['name','sequelize','exports','STRING'];(function(_0x387f0d,_0x31aca5){var _0x5336c6=function(_0x118f8f){while(--_0x118f8f){_0x387f0d['push'](_0x387f0d['shift']());}};_0x5336c6(++_0x31aca5);}(_0x8373,0x1c5));var _0x3837=function(_0xcfb203,_0x2cfcd6){_0xcfb203=_0xcfb203-0x0;var _0x318a37=_0x8373[_0xcfb203];return _0x318a37;};'use strict';var Sequelize=require(_0x3837('0x0'));module[_0x3837('0x1')]={'name':{'type':Sequelize[_0x3837('0x2')],'unique':_0x3837('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3837('0x2')]},'companyId':{'type':Sequelize[_0x3837('0x2')]},'website':{'type':Sequelize[_0x3837('0x2')]},'phone':{'type':Sequelize[_0x3837('0x2')]},'fax':{'type':Sequelize[_0x3837('0x2')]},'type':{'type':Sequelize[_0x3837('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x3837('0x2')]},'city':{'type':Sequelize[_0x3837('0x2')]},'country':{'type':Sequelize[_0x3837('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3837('0x2')]},'sStreet':{'type':Sequelize[_0x3837('0x2')]},'sPostalCode':{'type':Sequelize[_0x3837('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x3837('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 6c403bd..d729801 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 _0x1fab=['findOne','pick','getContacts','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','ids','omit'];(function(_0x187664,_0x57a4f3){var _0x1da05b=function(_0x2e81a8){while(--_0x2e81a8){_0x187664['push'](_0x187664['shift']());}};_0x1da05b(++_0x57a4f3);}(_0x1fab,0x1ac));var _0xb1fa=function(_0x1b1b90,_0x3d4143){_0x1b1b90=_0x1b1b90-0x0;var _0x11de94=_0x1fab[_0x1b1b90];return _0x11de94;};'use strict';var emlformat=require(_0xb1fa('0x0'));var rimraf=require(_0xb1fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb1fa('0x2'));var rp=require('request-promise');var moment=require(_0xb1fa('0x3'));var BPromise=require(_0xb1fa('0x4'));var Mustache=require(_0xb1fa('0x5'));var util=require(_0xb1fa('0x6'));var path=require('path');var sox=require(_0xb1fa('0x7'));var csv=require(_0xb1fa('0x8'));var ejs=require(_0xb1fa('0x9'));var fs=require('fs');var fs_extra=require(_0xb1fa('0xa'));var _=require('lodash');var squel=require(_0xb1fa('0xb'));var crypto=require(_0xb1fa('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb1fa('0xd'));var toCsv=require(_0xb1fa('0x8'));var querystring=require(_0xb1fa('0xe'));var Papa=require(_0xb1fa('0xf'));var Redis=require(_0xb1fa('0x10'));var authService=require(_0xb1fa('0x11'));var qs=require(_0xb1fa('0x12'));var as=require(_0xb1fa('0x13'));var hardwareService=require(_0xb1fa('0x14'));var logger=require(_0xb1fa('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xb1fa('0x16'));var licenseUtil=require(_0xb1fa('0x17'));var db=require(_0xb1fa('0x18'))['db'];function respondWithStatusCode(_0x5bec30,_0x5e5999){_0x5e5999=_0x5e5999||0xcc;return function(_0xd2cfe3){if(_0xd2cfe3){return _0x5bec30[_0xb1fa('0x19')](_0x5e5999);}return _0x5bec30[_0xb1fa('0x1a')](_0x5e5999)[_0xb1fa('0x1b')]();};}function respondWithResult(_0x4e8877,_0x11ec10){_0x11ec10=_0x11ec10||0xc8;return function(_0x5d1373){if(_0x5d1373){return _0x4e8877[_0xb1fa('0x1a')](_0x11ec10)['json'](_0x5d1373);}};}function respondWithFilteredResult(_0x21b926,_0x500ec4){return function(_0x95c031){if(_0x95c031){var _0x12eec7=typeof _0x500ec4[_0xb1fa('0x1c')]===_0xb1fa('0x1d')&&typeof _0x500ec4[_0xb1fa('0x1e')]===_0xb1fa('0x1d');var _0x506cfb=_0x95c031[_0xb1fa('0x1f')];var _0x3378e1=_0x12eec7?0x0:_0x500ec4[_0xb1fa('0x1c')];var _0x167b38=_0x12eec7?_0x95c031[_0xb1fa('0x1f')]:_0x500ec4[_0xb1fa('0x1c')]+_0x500ec4[_0xb1fa('0x1e')];var _0x37b2aa;if(_0x167b38>=_0x506cfb){_0x167b38=_0x506cfb;_0x37b2aa=0xc8;}else{_0x37b2aa=0xce;}_0x21b926[_0xb1fa('0x1a')](_0x37b2aa);return _0x21b926['set'](_0xb1fa('0x20'),_0x3378e1+'-'+_0x167b38+'/'+_0x506cfb)['json'](_0x95c031);}return null;};}function patchUpdates(_0x454906){return function(_0x475565){try{jsonpatch[_0xb1fa('0x21')](_0x475565,_0x454906,!![]);}catch(_0x940f33){return BPromise['reject'](_0x940f33);}return _0x475565[_0xb1fa('0x22')]();};}function saveUpdates(_0x45b174,_0x3a3369){return function(_0x165b4e){if(_0x165b4e){return _0x165b4e['update'](_0x45b174)[_0xb1fa('0x23')](function(_0x2e1fef){return _0x2e1fef;});}return null;};}function removeEntity(_0x45893d,_0x24099e){return function(_0x4469d9){if(_0x4469d9){return _0x4469d9[_0xb1fa('0x24')]()['then'](function(){var _0x5e0536=_0x4469d9[_0xb1fa('0x25')]({'plain':!![]});var _0x325ce3=_0xb1fa('0x26');return db[_0xb1fa('0x27')]['destroy']({'where':{'type':_0x325ce3,'resourceId':_0x5e0536['id']}})[_0xb1fa('0x23')](function(){return _0x4469d9;});})[_0xb1fa('0x23')](function(){_0x45893d[_0xb1fa('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b196,_0x8c681c){return function(_0x1460c9){if(!_0x1460c9){_0x52b196[_0xb1fa('0x19')](0x194);}return _0x1460c9;};}function handleError(_0x1b71d0,_0x29e10e){_0x29e10e=_0x29e10e||0x1f4;return function(_0x559550){logger[_0xb1fa('0x28')](_0x559550[_0xb1fa('0x29')]);if(_0x559550[_0xb1fa('0x2a')]){delete _0x559550['name'];}_0x1b71d0['status'](_0x29e10e)['send'](_0x559550);};}exports[_0xb1fa('0x2b')]=function(_0x140220,_0x699930){var _0x2326f7={},_0x5cc965={},_0x2e9e58={'count':0x0,'rows':[]};return db[_0xb1fa('0x2c')][_0xb1fa('0x2d')]()['then'](function(_0x5ce47d){_0x5cc965[_0xb1fa('0x2e')]=_[_0xb1fa('0x2f')](_0x5ce47d);_0x5cc965[_0xb1fa('0x30')]=_[_0xb1fa('0x2f')](_0x140220['query']);_0x5cc965['filters']=_[_0xb1fa('0x31')](_0x5cc965['model'],_0x5cc965[_0xb1fa('0x30')]);_0x2326f7[_0xb1fa('0x32')]=_['intersection'](_0x5cc965['model'],qs[_0xb1fa('0x33')](_0x140220[_0xb1fa('0x30')][_0xb1fa('0x33')]));_0x2326f7[_0xb1fa('0x32')]=_0x2326f7[_0xb1fa('0x32')]['length']?_0x2326f7[_0xb1fa('0x32')]:_0x5cc965[_0xb1fa('0x2e')];if(!_0x140220[_0xb1fa('0x30')][_0xb1fa('0x34')](_0xb1fa('0x35'))){_0x2326f7[_0xb1fa('0x1e')]=qs[_0xb1fa('0x1e')](_0x140220[_0xb1fa('0x30')]['limit']);_0x2326f7[_0xb1fa('0x1c')]=qs['offset'](_0x140220[_0xb1fa('0x30')][_0xb1fa('0x1c')]);}_0x2326f7[_0xb1fa('0x36')]=qs[_0xb1fa('0x37')](_0x140220[_0xb1fa('0x30')]['sort']);_0x2326f7['where']=qs[_0xb1fa('0x38')](_['pick'](_0x140220[_0xb1fa('0x30')],_0x5cc965[_0xb1fa('0x38')]),_0x5ce47d);if(_0x140220[_0xb1fa('0x30')][_0xb1fa('0x39')]){_0x2326f7[_0xb1fa('0x3a')]=_[_0xb1fa('0x3b')](_0x2326f7[_0xb1fa('0x3a')],{'$or':_['map'](_0x2326f7[_0xb1fa('0x32')],function(_0x2ed529){var _0x288aff={};_0x288aff[_0x2ed529]={'$like':'%'+_0x140220[_0xb1fa('0x30')][_0xb1fa('0x39')]+'%'};return _0x288aff;})});}_0x2326f7=_[_0xb1fa('0x3b')]({},_0x2326f7,_0x140220[_0xb1fa('0x3c')]);var _0x2e850e={'where':_0x2326f7[_0xb1fa('0x3a')]};return db[_0xb1fa('0x2c')][_0xb1fa('0x1f')](_0x2e850e)[_0xb1fa('0x23')](function(_0x1ea4b5){_0x2e9e58[_0xb1fa('0x1f')]=_0x1ea4b5;if(_0x140220[_0xb1fa('0x30')][_0xb1fa('0x3d')]){_0x2326f7[_0xb1fa('0x3e')]=[{'all':!![]}];}return db[_0xb1fa('0x2c')]['findAll'](_0x2326f7);})[_0xb1fa('0x23')](function(_0x492d4e){_0x2e9e58[_0xb1fa('0x3f')]=_0x492d4e;return _0x2e9e58;})[_0xb1fa('0x23')](respondWithFilteredResult(_0x699930,_0x2326f7))['catch'](handleError(_0x699930,null));})[_0xb1fa('0x40')](handleError(_0x699930,null));};exports[_0xb1fa('0x41')]=function(_0x45ca9b,_0x3ef4d5){var _0x3e1f62={'raw':![],'where':{'id':_0x45ca9b[_0xb1fa('0x42')]['id']}},_0x4777ae={};_0x4777ae['model']=_[_0xb1fa('0x2f')](db[_0xb1fa('0x2c')][_0xb1fa('0x43')]);_0x4777ae[_0xb1fa('0x30')]=_['keys'](_0x45ca9b['query']);_0x4777ae[_0xb1fa('0x38')]=_[_0xb1fa('0x31')](_0x4777ae[_0xb1fa('0x2e')],_0x4777ae[_0xb1fa('0x30')]);_0x3e1f62[_0xb1fa('0x32')]=_[_0xb1fa('0x31')](_0x4777ae[_0xb1fa('0x2e')],qs[_0xb1fa('0x33')](_0x45ca9b[_0xb1fa('0x30')][_0xb1fa('0x33')]));_0x3e1f62[_0xb1fa('0x32')]=_0x3e1f62['attributes'][_0xb1fa('0x44')]?_0x3e1f62[_0xb1fa('0x32')]:_0x4777ae['model'];if(_0x45ca9b[_0xb1fa('0x30')][_0xb1fa('0x3d')]){_0x3e1f62[_0xb1fa('0x3e')]=[{'all':!![]}];}_0x3e1f62=_['merge']({},_0x3e1f62,_0x45ca9b[_0xb1fa('0x3c')]);return db[_0xb1fa('0x2c')][_0xb1fa('0x45')](_0x3e1f62)[_0xb1fa('0x23')](handleEntityNotFound(_0x3ef4d5,null))['then'](respondWithResult(_0x3ef4d5,null))[_0xb1fa('0x40')](handleError(_0x3ef4d5,null));};exports[_0xb1fa('0x46')]=function(_0x19307c,_0x37e5b0){return db['CmCompany'][_0xb1fa('0x46')](_0x19307c[_0xb1fa('0x47')],{})[_0xb1fa('0x23')](function(_0x210ace){var _0x5b4470=_0x19307c[_0xb1fa('0x48')][_0xb1fa('0x25')]({'plain':!![]});if(!_0x5b4470)throw new Error(_0xb1fa('0x49'));if(_0x5b4470[_0xb1fa('0x4a')]===_0xb1fa('0x48')){var _0x4ab5af=_0x210ace[_0xb1fa('0x25')]({'plain':!![]});var _0x4c697c=_0xb1fa('0x26');return db['UserProfileSection'][_0xb1fa('0x45')]({'where':{'name':_0x4c697c,'userProfileId':_0x5b4470[_0xb1fa('0x4b')]},'raw':!![]})['then'](function(_0x5ae30c){if(_0x5ae30c&&_0x5ae30c['autoAssociation']===0x0){return db[_0xb1fa('0x27')]['create']({'name':_0x4ab5af[_0xb1fa('0x2a')],'resourceId':_0x4ab5af['id'],'type':_0x5ae30c[_0xb1fa('0x2a')],'sectionId':_0x5ae30c['id']},{})[_0xb1fa('0x23')](function(){return _0x210ace;});}else{return _0x210ace;}})[_0xb1fa('0x40')](function(_0x2f1845){logger['error'](_0xb1fa('0x4c'),_0x2f1845);throw _0x2f1845;});}return _0x210ace;})['then'](respondWithResult(_0x37e5b0,0xc9))[_0xb1fa('0x40')](handleError(_0x37e5b0,null));};exports[_0xb1fa('0x4d')]=function(_0x19ca7b,_0x100a14){if(_0x19ca7b[_0xb1fa('0x47')]['id']){delete _0x19ca7b[_0xb1fa('0x47')]['id'];}return db[_0xb1fa('0x2c')][_0xb1fa('0x45')]({'where':{'id':_0x19ca7b[_0xb1fa('0x42')]['id']}})[_0xb1fa('0x23')](handleEntityNotFound(_0x100a14,null))[_0xb1fa('0x23')](saveUpdates(_0x19ca7b[_0xb1fa('0x47')],null))[_0xb1fa('0x23')](respondWithResult(_0x100a14,null))['catch'](handleError(_0x100a14,null));};exports[_0xb1fa('0x24')]=function(_0xcfc102,_0x249c16){return db[_0xb1fa('0x2c')][_0xb1fa('0x45')]({'where':{'id':_0xcfc102[_0xb1fa('0x42')]['id']}})[_0xb1fa('0x23')](handleEntityNotFound(_0x249c16,null))[_0xb1fa('0x23')](removeEntity(_0x249c16,null))[_0xb1fa('0x40')](handleError(_0x249c16,null));};exports[_0xb1fa('0x2d')]=function(_0x88a94e,_0x3ab8e3){return db[_0xb1fa('0x2c')][_0xb1fa('0x2d')]()[_0xb1fa('0x23')](respondWithResult(_0x3ab8e3,null))['catch'](handleError(_0x3ab8e3,null));};exports['addContacts']=function(_0x516729,_0x95db89,_0x57c5a5){return db[_0xb1fa('0x4e')][_0xb1fa('0x45')]({'where':{'id':_0x516729[_0xb1fa('0x42')]['id']}})['then'](handleEntityNotFound(_0x95db89,null))['then'](function(_0x3b728f){if(_0x3b728f){return _0x3b728f[_0xb1fa('0x4f')](_0x516729[_0xb1fa('0x47')][_0xb1fa('0x50')],_[_0xb1fa('0x51')](_0x516729['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x95db89,null))[_0xb1fa('0x40')](handleError(_0x95db89,null));};exports['getContacts']=function(_0x5c31c5,_0x2ce01b,_0x4dc290){var _0x49c8ac={};var _0x3c6c8c={};var _0x359f47;var _0x21c562;return db[_0xb1fa('0x2c')][_0xb1fa('0x52')]({'where':{'id':_0x5c31c5['params']['id']}})['then'](handleEntityNotFound(_0x2ce01b,null))[_0xb1fa('0x23')](function(_0x267169){if(_0x267169){_0x359f47=_0x267169;_0x3c6c8c[_0xb1fa('0x2e')]=_[_0xb1fa('0x2f')](db[_0xb1fa('0x4e')][_0xb1fa('0x43')]);_0x3c6c8c[_0xb1fa('0x30')]=_['keys'](_0x5c31c5[_0xb1fa('0x30')]);_0x3c6c8c[_0xb1fa('0x38')]=_[_0xb1fa('0x31')](_0x3c6c8c['model'],_0x3c6c8c[_0xb1fa('0x30')]);_0x49c8ac[_0xb1fa('0x32')]=_[_0xb1fa('0x31')](_0x3c6c8c['model'],qs[_0xb1fa('0x33')](_0x5c31c5[_0xb1fa('0x30')][_0xb1fa('0x33')]));_0x49c8ac['attributes']=_0x49c8ac[_0xb1fa('0x32')]['length']?_0x49c8ac[_0xb1fa('0x32')]:_0x3c6c8c['model'];_0x49c8ac[_0xb1fa('0x36')]=qs['sort'](_0x5c31c5[_0xb1fa('0x30')][_0xb1fa('0x37')]);_0x49c8ac[_0xb1fa('0x3a')]=qs['filters'](_[_0xb1fa('0x53')](_0x5c31c5[_0xb1fa('0x30')],_0x3c6c8c[_0xb1fa('0x38')]));if(_0x5c31c5[_0xb1fa('0x30')][_0xb1fa('0x39')]){_0x49c8ac['where']=_[_0xb1fa('0x3b')](_0x49c8ac[_0xb1fa('0x3a')],{'$or':_['map'](_0x49c8ac[_0xb1fa('0x32')],function(_0x3bd605){var _0x4fd939={};_0x4fd939[_0x3bd605]={'$like':'%'+_0x5c31c5[_0xb1fa('0x30')][_0xb1fa('0x39')]+'%'};return _0x4fd939;})});}_0x49c8ac=_[_0xb1fa('0x3b')]({},_0x49c8ac,_0x5c31c5['options']);return _0x359f47[_0xb1fa('0x54')](_0x49c8ac);}})[_0xb1fa('0x23')](function(_0x25af4a){if(_0x25af4a){_0x21c562=_0x25af4a['length'];if(!_0x5c31c5[_0xb1fa('0x30')][_0xb1fa('0x34')](_0xb1fa('0x35'))){_0x49c8ac['limit']=qs[_0xb1fa('0x1e')](_0x5c31c5[_0xb1fa('0x30')][_0xb1fa('0x1e')]);_0x49c8ac[_0xb1fa('0x1c')]=qs['offset'](_0x5c31c5[_0xb1fa('0x30')][_0xb1fa('0x1c')]);}return _0x359f47['getContacts'](_0x49c8ac);}})[_0xb1fa('0x23')](function(_0x206e55){if(_0x206e55){return _0x206e55?{'count':_0x21c562,'rows':_0x206e55}:null;}})[_0xb1fa('0x23')](respondWithResult(_0x2ce01b,null))[_0xb1fa('0x40')](handleError(_0x2ce01b,null));}; \ No newline at end of file +var _0x77d7=['update','then','destroy','UserProfileResource','end','sendStatus','stack','name','send','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','CmCompany','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','Companies','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','getContacts','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save'];(function(_0x552841,_0x383b1d){var _0x3c33f0=function(_0x4a4184){while(--_0x4a4184){_0x552841['push'](_0x552841['shift']());}};_0x3c33f0(++_0x383b1d);}(_0x77d7,0xd7));var _0x777d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x77d7[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0x777d('0x0'));var rimraf=require(_0x777d('0x1'));var zipdir=require(_0x777d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x777d('0x3'));var moment=require(_0x777d('0x4'));var BPromise=require(_0x777d('0x5'));var Mustache=require(_0x777d('0x6'));var util=require(_0x777d('0x7'));var path=require('path');var sox=require(_0x777d('0x8'));var csv=require(_0x777d('0x9'));var ejs=require(_0x777d('0xa'));var fs=require('fs');var fs_extra=require(_0x777d('0xb'));var _=require(_0x777d('0xc'));var squel=require(_0x777d('0xd'));var crypto=require(_0x777d('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x777d('0x9'));var querystring=require(_0x777d('0xf'));var Papa=require('papaparse');var Redis=require(_0x777d('0x10'));var authService=require(_0x777d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x777d('0x12'));var hardwareService=require(_0x777d('0x13'));var logger=require(_0x777d('0x14'))(_0x777d('0x15'));var utils=require(_0x777d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x777d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bc692,_0x28bcc4){_0x28bcc4=_0x28bcc4||0xcc;return function(_0x3b537d){if(_0x3b537d){return _0x5bc692['sendStatus'](_0x28bcc4);}return _0x5bc692[_0x777d('0x18')](_0x28bcc4)['end']();};}function respondWithResult(_0x3c46d3,_0x9abfd0){_0x9abfd0=_0x9abfd0||0xc8;return function(_0x2c8d60){if(_0x2c8d60){return _0x3c46d3[_0x777d('0x18')](_0x9abfd0)[_0x777d('0x19')](_0x2c8d60);}};}function respondWithFilteredResult(_0x38871f,_0x3518de){return function(_0xa3d179){if(_0xa3d179){var _0x4acd78=typeof _0x3518de[_0x777d('0x1a')]===_0x777d('0x1b')&&typeof _0x3518de[_0x777d('0x1c')]===_0x777d('0x1b');var _0x20a463=_0xa3d179[_0x777d('0x1d')];var _0x447c98=_0x4acd78?0x0:_0x3518de[_0x777d('0x1a')];var _0x4cd664=_0x4acd78?_0xa3d179[_0x777d('0x1d')]:_0x3518de['offset']+_0x3518de[_0x777d('0x1c')];var _0x3db4e1;if(_0x4cd664>=_0x20a463){_0x4cd664=_0x20a463;_0x3db4e1=0xc8;}else{_0x3db4e1=0xce;}_0x38871f[_0x777d('0x18')](_0x3db4e1);return _0x38871f['set'](_0x777d('0x1e'),_0x447c98+'-'+_0x4cd664+'/'+_0x20a463)[_0x777d('0x19')](_0xa3d179);}return null;};}function patchUpdates(_0x7e6b1f){return function(_0x5da3fa){try{jsonpatch[_0x777d('0x1f')](_0x5da3fa,_0x7e6b1f,!![]);}catch(_0x489a9a){return BPromise[_0x777d('0x20')](_0x489a9a);}return _0x5da3fa[_0x777d('0x21')]();};}function saveUpdates(_0x3bb0f7,_0x283996){return function(_0x1ddaf2){if(_0x1ddaf2){return _0x1ddaf2[_0x777d('0x22')](_0x3bb0f7)[_0x777d('0x23')](function(_0x5e4d54){return _0x5e4d54;});}return null;};}function removeEntity(_0x5b04e7,_0xd02048){return function(_0x2afa7f){if(_0x2afa7f){return _0x2afa7f[_0x777d('0x24')]()['then'](function(){var _0x3e283f=_0x2afa7f['get']({'plain':!![]});var _0x21fc7d='Companies';return db[_0x777d('0x25')][_0x777d('0x24')]({'where':{'type':_0x21fc7d,'resourceId':_0x3e283f['id']}})[_0x777d('0x23')](function(){return _0x2afa7f;});})[_0x777d('0x23')](function(){_0x5b04e7[_0x777d('0x18')](0xcc)[_0x777d('0x26')]();});}};}function handleEntityNotFound(_0x36fabb,_0x415f2f){return function(_0xb7b4){if(!_0xb7b4){_0x36fabb[_0x777d('0x27')](0x194);}return _0xb7b4;};}function handleError(_0x2179f2,_0x38512f){_0x38512f=_0x38512f||0x1f4;return function(_0x46b905){logger['error'](_0x46b905[_0x777d('0x28')]);if(_0x46b905[_0x777d('0x29')]){delete _0x46b905[_0x777d('0x29')];}_0x2179f2[_0x777d('0x18')](_0x38512f)[_0x777d('0x2a')](_0x46b905);};}exports['index']=function(_0x208721,_0x27ab55){var _0x3f9a8d={},_0x2b925c={},_0x2f68d6={'count':0x0,'rows':[]};return db['CmCompany'][_0x777d('0x2b')]()[_0x777d('0x23')](function(_0xc365a5){_0x2b925c[_0x777d('0x2c')]=_[_0x777d('0x2d')](_0xc365a5);_0x2b925c['query']=_[_0x777d('0x2d')](_0x208721[_0x777d('0x2e')]);_0x2b925c[_0x777d('0x2f')]=_[_0x777d('0x30')](_0x2b925c[_0x777d('0x2c')],_0x2b925c[_0x777d('0x2e')]);_0x3f9a8d[_0x777d('0x31')]=_['intersection'](_0x2b925c[_0x777d('0x2c')],qs[_0x777d('0x32')](_0x208721[_0x777d('0x2e')][_0x777d('0x32')]));_0x3f9a8d[_0x777d('0x31')]=_0x3f9a8d[_0x777d('0x31')][_0x777d('0x33')]?_0x3f9a8d[_0x777d('0x31')]:_0x2b925c['model'];if(!_0x208721['query'][_0x777d('0x34')](_0x777d('0x35'))){_0x3f9a8d[_0x777d('0x1c')]=qs[_0x777d('0x1c')](_0x208721[_0x777d('0x2e')][_0x777d('0x1c')]);_0x3f9a8d[_0x777d('0x1a')]=qs[_0x777d('0x1a')](_0x208721['query'][_0x777d('0x1a')]);}_0x3f9a8d[_0x777d('0x36')]=qs['sort'](_0x208721[_0x777d('0x2e')][_0x777d('0x37')]);_0x3f9a8d[_0x777d('0x38')]=qs['filters'](_[_0x777d('0x39')](_0x208721[_0x777d('0x2e')],_0x2b925c[_0x777d('0x2f')]),_0xc365a5);if(_0x208721['query'][_0x777d('0x3a')]){_0x3f9a8d['where']=_[_0x777d('0x3b')](_0x3f9a8d[_0x777d('0x38')],{'$or':_[_0x777d('0x3c')](_0x3f9a8d['attributes'],function(_0x3027ad){var _0x9a91dd={};_0x9a91dd[_0x3027ad]={'$like':'%'+_0x208721[_0x777d('0x2e')][_0x777d('0x3a')]+'%'};return _0x9a91dd;})});}_0x3f9a8d=_['merge']({},_0x3f9a8d,_0x208721[_0x777d('0x3d')]);var _0x2085f6={'where':_0x3f9a8d['where']};return db[_0x777d('0x3e')][_0x777d('0x1d')](_0x2085f6)[_0x777d('0x23')](function(_0x419e86){_0x2f68d6[_0x777d('0x1d')]=_0x419e86;if(_0x208721[_0x777d('0x2e')][_0x777d('0x3f')]){_0x3f9a8d[_0x777d('0x40')]=[{'all':!![]}];}return db[_0x777d('0x3e')][_0x777d('0x41')](_0x3f9a8d);})['then'](function(_0x5094c1){_0x2f68d6[_0x777d('0x42')]=_0x5094c1;return _0x2f68d6;})['then'](respondWithFilteredResult(_0x27ab55,_0x3f9a8d))[_0x777d('0x43')](handleError(_0x27ab55,null));})[_0x777d('0x43')](handleError(_0x27ab55,null));};exports[_0x777d('0x44')]=function(_0x515003,_0x5c1180){var _0x5f1a0a={'raw':![],'where':{'id':_0x515003[_0x777d('0x45')]['id']}},_0x547230={};_0x547230[_0x777d('0x2c')]=_[_0x777d('0x2d')](db[_0x777d('0x3e')]['rawAttributes']);_0x547230['query']=_[_0x777d('0x2d')](_0x515003['query']);_0x547230['filters']=_[_0x777d('0x30')](_0x547230[_0x777d('0x2c')],_0x547230[_0x777d('0x2e')]);_0x5f1a0a[_0x777d('0x31')]=_['intersection'](_0x547230[_0x777d('0x2c')],qs[_0x777d('0x32')](_0x515003[_0x777d('0x2e')][_0x777d('0x32')]));_0x5f1a0a[_0x777d('0x31')]=_0x5f1a0a[_0x777d('0x31')][_0x777d('0x33')]?_0x5f1a0a[_0x777d('0x31')]:_0x547230[_0x777d('0x2c')];if(_0x515003['query'][_0x777d('0x3f')]){_0x5f1a0a[_0x777d('0x40')]=[{'all':!![]}];}_0x5f1a0a=_[_0x777d('0x3b')]({},_0x5f1a0a,_0x515003[_0x777d('0x3d')]);return db[_0x777d('0x3e')][_0x777d('0x46')](_0x5f1a0a)[_0x777d('0x23')](handleEntityNotFound(_0x5c1180,null))['then'](respondWithResult(_0x5c1180,null))[_0x777d('0x43')](handleError(_0x5c1180,null));};exports[_0x777d('0x47')]=function(_0x45fb32,_0x524a45){return db[_0x777d('0x3e')]['create'](_0x45fb32[_0x777d('0x48')],{})[_0x777d('0x23')](function(_0xb3eee9){var _0x2f6683=_0x45fb32[_0x777d('0x49')]['get']({'plain':!![]});if(!_0x2f6683)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f6683[_0x777d('0x4a')]===_0x777d('0x49')){var _0x449203=_0xb3eee9['get']({'plain':!![]});var _0x52d1dc=_0x777d('0x4b');return db[_0x777d('0x4c')][_0x777d('0x46')]({'where':{'name':_0x52d1dc,'userProfileId':_0x2f6683['userProfileId']},'raw':!![]})['then'](function(_0x31ebe2){if(_0x31ebe2&&_0x31ebe2[_0x777d('0x4d')]===0x0){return db[_0x777d('0x25')][_0x777d('0x47')]({'name':_0x449203[_0x777d('0x29')],'resourceId':_0x449203['id'],'type':_0x31ebe2[_0x777d('0x29')],'sectionId':_0x31ebe2['id']},{})[_0x777d('0x23')](function(){return _0xb3eee9;});}else{return _0xb3eee9;}})['catch'](function(_0x5fcb18){logger[_0x777d('0x4e')](_0x777d('0x4f'),_0x5fcb18);throw _0x5fcb18;});}return _0xb3eee9;})['then'](respondWithResult(_0x524a45,0xc9))[_0x777d('0x43')](handleError(_0x524a45,null));};exports[_0x777d('0x22')]=function(_0x3d2e66,_0xd78c3d){if(_0x3d2e66[_0x777d('0x48')]['id']){delete _0x3d2e66[_0x777d('0x48')]['id'];}return db['CmCompany'][_0x777d('0x46')]({'where':{'id':_0x3d2e66[_0x777d('0x45')]['id']}})[_0x777d('0x23')](handleEntityNotFound(_0xd78c3d,null))[_0x777d('0x23')](saveUpdates(_0x3d2e66[_0x777d('0x48')],null))['then'](respondWithResult(_0xd78c3d,null))[_0x777d('0x43')](handleError(_0xd78c3d,null));};exports[_0x777d('0x24')]=function(_0x282868,_0x3271a6){return db[_0x777d('0x3e')][_0x777d('0x46')]({'where':{'id':_0x282868[_0x777d('0x45')]['id']}})[_0x777d('0x23')](handleEntityNotFound(_0x3271a6,null))[_0x777d('0x23')](removeEntity(_0x3271a6,null))['catch'](handleError(_0x3271a6,null));};exports[_0x777d('0x2b')]=function(_0x32f56b,_0x493581){return db[_0x777d('0x3e')][_0x777d('0x2b')]()[_0x777d('0x23')](respondWithResult(_0x493581,null))['catch'](handleError(_0x493581,null));};exports[_0x777d('0x50')]=function(_0x563e3e,_0x24bd61,_0x1478e7){return db['CmContact'][_0x777d('0x46')]({'where':{'id':_0x563e3e[_0x777d('0x45')]['id']}})[_0x777d('0x23')](handleEntityNotFound(_0x24bd61,null))[_0x777d('0x23')](function(_0x1b877d){if(_0x1b877d){return _0x1b877d[_0x777d('0x50')](_0x563e3e[_0x777d('0x48')]['ids'],_['omit'](_0x563e3e[_0x777d('0x48')],['ids','id'])||{});}})[_0x777d('0x23')](respondWithResult(_0x24bd61,null))[_0x777d('0x43')](handleError(_0x24bd61,null));};exports['getContacts']=function(_0x54dbc7,_0x287959,_0x8a3778){var _0x2055bf={};var _0x3b6206={};var _0x3eaf4f;var _0x160a06;return db[_0x777d('0x3e')]['findOne']({'where':{'id':_0x54dbc7['params']['id']}})[_0x777d('0x23')](handleEntityNotFound(_0x287959,null))['then'](function(_0x365617){if(_0x365617){_0x3eaf4f=_0x365617;_0x3b6206[_0x777d('0x2c')]=_[_0x777d('0x2d')](db[_0x777d('0x51')]['rawAttributes']);_0x3b6206[_0x777d('0x2e')]=_[_0x777d('0x2d')](_0x54dbc7[_0x777d('0x2e')]);_0x3b6206[_0x777d('0x2f')]=_['intersection'](_0x3b6206[_0x777d('0x2c')],_0x3b6206[_0x777d('0x2e')]);_0x2055bf['attributes']=_[_0x777d('0x30')](_0x3b6206[_0x777d('0x2c')],qs[_0x777d('0x32')](_0x54dbc7[_0x777d('0x2e')][_0x777d('0x32')]));_0x2055bf[_0x777d('0x31')]=_0x2055bf[_0x777d('0x31')]['length']?_0x2055bf[_0x777d('0x31')]:_0x3b6206['model'];_0x2055bf[_0x777d('0x36')]=qs[_0x777d('0x37')](_0x54dbc7[_0x777d('0x2e')][_0x777d('0x37')]);_0x2055bf[_0x777d('0x38')]=qs[_0x777d('0x2f')](_['pick'](_0x54dbc7['query'],_0x3b6206[_0x777d('0x2f')]));if(_0x54dbc7[_0x777d('0x2e')]['filter']){_0x2055bf[_0x777d('0x38')]=_[_0x777d('0x3b')](_0x2055bf['where'],{'$or':_[_0x777d('0x3c')](_0x2055bf['attributes'],function(_0x78faba){var _0xf858a2={};_0xf858a2[_0x78faba]={'$like':'%'+_0x54dbc7[_0x777d('0x2e')][_0x777d('0x3a')]+'%'};return _0xf858a2;})});}_0x2055bf=_[_0x777d('0x3b')]({},_0x2055bf,_0x54dbc7[_0x777d('0x3d')]);return _0x3eaf4f['getContacts'](_0x2055bf);}})['then'](function(_0x15e39a){if(_0x15e39a){_0x160a06=_0x15e39a['length'];if(!_0x54dbc7[_0x777d('0x2e')]['hasOwnProperty'](_0x777d('0x35'))){_0x2055bf[_0x777d('0x1c')]=qs[_0x777d('0x1c')](_0x54dbc7[_0x777d('0x2e')][_0x777d('0x1c')]);_0x2055bf['offset']=qs[_0x777d('0x1a')](_0x54dbc7[_0x777d('0x2e')][_0x777d('0x1a')]);}return _0x3eaf4f[_0x777d('0x52')](_0x2055bf);}})[_0x777d('0x23')](function(_0x4e33ce){if(_0x4e33ce){return _0x4e33ce?{'count':_0x160a06,'rows':_0x4e33ce}:null;}})[_0x777d('0x23')](respondWithResult(_0x287959,null))[_0x777d('0x43')](handleError(_0x287959,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 5c608b7..670aa00 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 _0xdbc1=['./cmCompany.attributes','define','cm_companies','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x30717e,_0xd96659){var _0x38e97f=function(_0x2b2eeb){while(--_0x2b2eeb){_0x30717e['push'](_0x30717e['shift']());}};_0x38e97f(++_0xd96659);}(_0xdbc1,0x161));var _0x1dbc=function(_0x4ccf96,_0x34978e){_0x4ccf96=_0x4ccf96-0x0;var _0xd103b7=_0xdbc1[_0x4ccf96];return _0xd103b7;};'use strict';var _=require(_0x1dbc('0x0'));var util=require(_0x1dbc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1dbc('0x2'));var BPromise=require(_0x1dbc('0x3'));var rp=require(_0x1dbc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1dbc('0x5'));var config=require(_0x1dbc('0x6'));var attributes=require(_0x1dbc('0x7'));module['exports']=function(_0x1accc8,_0x2cdcb8){return _0x1accc8[_0x1dbc('0x8')]('CmCompany',attributes,{'tableName':_0x1dbc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6df1=['exports','define','cm_companies','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./cmCompany.attributes'];(function(_0x739d0b,_0x59c088){var _0x46dfd8=function(_0x51302f){while(--_0x51302f){_0x739d0b['push'](_0x739d0b['shift']());}};_0x46dfd8(++_0x59c088);}(_0x6df1,0xe7));var _0x16df=function(_0x1b97f3,_0xce63f3){_0x1b97f3=_0x1b97f3-0x0;var _0x32d818=_0x6df1[_0x1b97f3];return _0x32d818;};'use strict';var _=require(_0x16df('0x0'));var util=require(_0x16df('0x1'));var logger=require(_0x16df('0x2'))(_0x16df('0x3'));var moment=require(_0x16df('0x4'));var BPromise=require('bluebird');var rp=require(_0x16df('0x5'));var fs=require('fs');var path=require(_0x16df('0x6'));var rimraf=require(_0x16df('0x7'));var config=require('../../config/environment');var attributes=require(_0x16df('0x8'));module[_0x16df('0x9')]=function(_0x2a9aeb,_0x2a8ab8){return _0x2a9aeb[_0x16df('0xa')]('CmCompany',attributes,{'tableName':_0x16df('0xb'),'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 73b1fde..58d94f0 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 _0x7288=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x4e172f,_0xcd6760){var _0xf03f51=function(_0x3756d7){while(--_0x3756d7){_0x4e172f['push'](_0x4e172f['shift']());}};_0xf03f51(++_0xcd6760);}(_0x7288,0x134));var _0x8728=function(_0x1fff75,_0xb0a79e){_0x1fff75=_0x1fff75-0x0;var _0x14a0b4=_0x7288[_0x1fff75];return _0x14a0b4;};'use strict';var _=require(_0x8728('0x0'));var util=require(_0x8728('0x1'));var moment=require(_0x8728('0x2'));var BPromise=require(_0x8728('0x3'));var rs=require(_0x8728('0x4'));var fs=require('fs');var Redis=require(_0x8728('0x5'));var db=require(_0x8728('0x6'))['db'];var utils=require(_0x8728('0x7'));var logger=require(_0x8728('0x8'))(_0x8728('0x9'));var config=require('../../config/environment');var jayson=require(_0x8728('0xa'));var client=jayson[_0x8728('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4198cd,_0x3bbeb5,_0x25ba67){return new BPromise(function(_0xbc105,_0x5bc022){return client[_0x8728('0xc')](_0x4198cd,_0x25ba67)[_0x8728('0xd')](function(_0x58e457){logger[_0x8728('0xe')](_0x8728('0xf'),_0x3bbeb5,_0x8728('0x10'));logger[_0x8728('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x3bbeb5,'request\x20sent',JSON['stringify'](_0x58e457));if(_0x58e457['error']){if(_0x58e457[_0x8728('0x12')][_0x8728('0x13')]===0x1f4){logger[_0x8728('0x12')](_0x8728('0xf'),_0x3bbeb5,_0x58e457[_0x8728('0x12')][_0x8728('0x14')]);return _0x5bc022(_0x58e457[_0x8728('0x12')][_0x8728('0x14')]);}logger[_0x8728('0x12')]('CmCompany,\x20%s,\x20%s',_0x3bbeb5,_0x58e457[_0x8728('0x12')][_0x8728('0x14')]);return _0xbc105(_0x58e457['error'][_0x8728('0x14')]);}else{logger[_0x8728('0xe')](_0x8728('0xf'),_0x3bbeb5,'request\x20sent');_0xbc105(_0x58e457[_0x8728('0x15')][_0x8728('0x14')]);}})[_0x8728('0x16')](function(_0x52b22c){logger[_0x8728('0x12')](_0x8728('0xf'),_0x3bbeb5,_0x52b22c);_0x5bc022(_0x52b22c);});});} \ No newline at end of file +var _0xd66a=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2f0ba3,_0x33c1c6){var _0x1c5633=function(_0x142c29){while(--_0x142c29){_0x2f0ba3['push'](_0x2f0ba3['shift']());}};_0x1c5633(++_0x33c1c6);}(_0xd66a,0x8a));var _0xad66=function(_0x28089e,_0x530f8a){_0x28089e=_0x28089e-0x0;var _0x46a73c=_0xd66a[_0x28089e];return _0x46a73c;};'use strict';var _=require(_0xad66('0x0'));var util=require(_0xad66('0x1'));var moment=require(_0xad66('0x2'));var BPromise=require(_0xad66('0x3'));var rs=require(_0xad66('0x4'));var fs=require('fs');var Redis=require(_0xad66('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xad66('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xad66('0x7'));var jayson=require(_0xad66('0x8'));var client=jayson[_0xad66('0x9')][_0xad66('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fd1fe,_0x407a0a,_0x3c2f4b){return new BPromise(function(_0x547c51,_0x1c34b6){return client['request'](_0x1fd1fe,_0x3c2f4b)[_0xad66('0xb')](function(_0x2d6ac4){logger[_0xad66('0xc')](_0xad66('0xd'),_0x407a0a,_0xad66('0xe'));logger[_0xad66('0xf')](_0xad66('0x10'),_0x407a0a,_0xad66('0xe'),JSON[_0xad66('0x11')](_0x2d6ac4));if(_0x2d6ac4[_0xad66('0x12')]){if(_0x2d6ac4[_0xad66('0x12')][_0xad66('0x13')]===0x1f4){logger[_0xad66('0x12')]('CmCompany,\x20%s,\x20%s',_0x407a0a,_0x2d6ac4[_0xad66('0x12')]['message']);return _0x1c34b6(_0x2d6ac4[_0xad66('0x12')][_0xad66('0x14')]);}logger['error'](_0xad66('0xd'),_0x407a0a,_0x2d6ac4[_0xad66('0x12')]['message']);return _0x547c51(_0x2d6ac4['error'][_0xad66('0x14')]);}else{logger[_0xad66('0xc')](_0xad66('0xd'),_0x407a0a,_0xad66('0xe'));_0x547c51(_0x2d6ac4[_0xad66('0x15')]['message']);}})[_0xad66('0x16')](function(_0x40cdb5){logger['error']('CmCompany,\x20%s,\x20%s',_0x407a0a,_0x40cdb5);_0x1c34b6(_0x40cdb5);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index c6a4a1c..74c8c72 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 _0xc274=['addContacts','put','update','delete','/:id','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','/:id/contacts','post','create'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc274,0x151));var _0x4c27=function(_0x17c9ce,_0x53692a){_0x17c9ce=_0x17c9ce-0x0;var _0x4f44d7=_0xc274[_0x17c9ce];return _0x4f44d7;};'use strict';var multer=require('multer');var util=require(_0x4c27('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4c27('0x1'));var router=express[_0x4c27('0x2')]();var fs_extra=require(_0x4c27('0x3'));var auth=require(_0x4c27('0x4'));var interaction=require(_0x4c27('0x5'));var config=require(_0x4c27('0x6'));var controller=require('./cmCompany.controller');router[_0x4c27('0x7')]('/',auth['isAuthenticated'](),controller[_0x4c27('0x8')]);router[_0x4c27('0x7')](_0x4c27('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x4c27('0x7')]('/:id',auth[_0x4c27('0xa')](),controller[_0x4c27('0xb')]);router[_0x4c27('0x7')](_0x4c27('0xc'),auth[_0x4c27('0xa')](),controller['getContacts']);router[_0x4c27('0xd')]('/',auth[_0x4c27('0xa')](),controller[_0x4c27('0xe')]);router[_0x4c27('0xd')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x4c27('0xf')]);router[_0x4c27('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x4c27('0x11')]);router[_0x4c27('0x12')](_0x4c27('0x13'),auth['isAuthenticated'](),controller[_0x4c27('0x14')]);module[_0x4c27('0x15')]=router; \ No newline at end of file +var _0xe95b=['create','/:id/contacts','addContacts','put','update','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xe95b,0xcf));var _0xbe95=function(_0x54d6b3,_0x27f781){_0x54d6b3=_0x54d6b3-0x0;var _0x361476=_0xe95b[_0x54d6b3];return _0x361476;};'use strict';var multer=require('multer');var util=require(_0xbe95('0x0'));var path=require(_0xbe95('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbe95('0x2')]();var fs_extra=require(_0xbe95('0x3'));var auth=require(_0xbe95('0x4'));var interaction=require(_0xbe95('0x5'));var config=require('../../config/environment');var controller=require(_0xbe95('0x6'));router[_0xbe95('0x7')]('/',auth[_0xbe95('0x8')](),controller['index']);router['get'](_0xbe95('0x9'),auth[_0xbe95('0x8')](),controller[_0xbe95('0xa')]);router[_0xbe95('0x7')](_0xbe95('0xb'),auth[_0xbe95('0x8')](),controller[_0xbe95('0xc')]);router[_0xbe95('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router['post']('/',auth[_0xbe95('0x8')](),controller[_0xbe95('0xd')]);router['post'](_0xbe95('0xe'),auth['isAuthenticated'](),controller[_0xbe95('0xf')]);router[_0xbe95('0x10')](_0xbe95('0xb'),auth[_0xbe95('0x8')](),controller[_0xbe95('0x11')]);router['delete'](_0xbe95('0xb'),auth[_0xbe95('0x8')](),controller[_0xbe95('0x12')]);module[_0xbe95('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 1d3e7c1..45be0e7 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 _0xe5f5=['lodash','exports','STRING','INTEGER','UNSIGNED','NOW'];(function(_0x58547b,_0x4b89c2){var _0x1d3fd2=function(_0x4ac500){while(--_0x4ac500){_0x58547b['push'](_0x58547b['shift']());}};_0x1d3fd2(++_0x4b89c2);}(_0xe5f5,0x1ec));var _0x5e5f=function(_0x1ef6a1,_0x59fbc1){_0x1ef6a1=_0x1ef6a1-0x0;var _0x24b89e=_0xe5f5[_0x1ef6a1];return _0x24b89e;};'use strict';var _=require(_0x5e5f('0x0'));var Sequelize=require('sequelize');module[_0x5e5f('0x1')]={'firstName':{'type':Sequelize[_0x5e5f('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x5e5f('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x5e5f('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x5e5f('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x5e5f('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5e5f('0x2')]},'url':{'type':Sequelize[_0x5e5f('0x2')]},'facebook':{'type':Sequelize[_0x5e5f('0x2')]},'fb_data':{'type':Sequelize[_0x5e5f('0x2')]},'twitter':{'type':Sequelize[_0x5e5f('0x2')]},'skype':{'type':Sequelize[_0x5e5f('0x2')]},'teams':{'type':Sequelize[_0x5e5f('0x2')]},'viber':{'type':Sequelize[_0x5e5f('0x2')]},'line':{'type':Sequelize[_0x5e5f('0x2')]},'wechat':{'type':Sequelize[_0x5e5f('0x2')]},'telegram':{'type':Sequelize[_0x5e5f('0x2')]},'UserId':{'type':Sequelize[_0x5e5f('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x5e5f('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5e5f('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x5e5f('0x5')]},'dialTimezone':{'type':Sequelize[_0x5e5f('0x2')]},'utcOffset':{'type':Sequelize[_0x5e5f('0x3')]}}; \ No newline at end of file +var _0xb399=['UNSIGNED','DATE','NOW','lodash','sequelize','STRING','INTEGER'];(function(_0x4771f5,_0x127457){var _0x3e22ea=function(_0x46ca12){while(--_0x46ca12){_0x4771f5['push'](_0x4771f5['shift']());}};_0x3e22ea(++_0x127457);}(_0xb399,0x1d1));var _0x9b39=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xb399[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x9b39('0x0'));var Sequelize=require(_0x9b39('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x9b39('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9b39('0x2')]},'street':{'type':Sequelize[_0x9b39('0x2')]},'postalCode':{'type':Sequelize[_0x9b39('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9b39('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x9b39('0x2')]},'mobile':{'type':Sequelize[_0x9b39('0x2')]},'fax':{'type':Sequelize[_0x9b39('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x9b39('0x2')]},'facebook':{'type':Sequelize[_0x9b39('0x2')]},'fb_data':{'type':Sequelize[_0x9b39('0x2')]},'twitter':{'type':Sequelize[_0x9b39('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x9b39('0x2')]},'viber':{'type':Sequelize[_0x9b39('0x2')]},'line':{'type':Sequelize[_0x9b39('0x2')]},'wechat':{'type':Sequelize[_0x9b39('0x2')]},'telegram':{'type':Sequelize[_0x9b39('0x2')]},'UserId':{'type':Sequelize[_0x9b39('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x9b39('0x2')]},'priority':{'type':Sequelize[_0x9b39('0x3')](0x2)[_0x9b39('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9b39('0x5')],'defaultValue':Sequelize[_0x9b39('0x6')]},'dialTimezone':{'type':Sequelize[_0x9b39('0x2')]},'utcOffset':{'type':Sequelize[_0x9b39('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index ab877e8..9c80acb 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(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 0e623fc..023e678 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 _0x81a4=['emit','hasOwnProperty','hook','exports','CmContact','save','update','remove'];(function(_0x53c077,_0x5d25ae){var _0x2f699d=function(_0x1711f5){while(--_0x1711f5){_0x53c077['push'](_0x53c077['shift']());}};_0x2f699d(++_0x5d25ae);}(_0x81a4,0x1bc));var _0x481a=function(_0x3048ea,_0x3838c2){_0x3048ea=_0x3048ea-0x0;var _0x1a13c4=_0x81a4[_0x3048ea];return _0x1a13c4;};'use strict';var EventEmitter=require('events');var CmContact=require('../../mysqldb')['db'][_0x481a('0x0')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x481a('0x1'),'afterUpdate':_0x481a('0x2'),'afterDestroy':_0x481a('0x3')};function emitEvent(_0xfd549f){return function(_0x37d6cd,_0x96fb6,_0x1db80e){CmContactEvents[_0x481a('0x4')](_0xfd549f+':'+_0x37d6cd['id'],_0x37d6cd);CmContactEvents[_0x481a('0x4')](_0xfd549f,_0x37d6cd);_0x1db80e(null);};}for(var e in events){if(events[_0x481a('0x5')](e)){var event=events[e];CmContact[_0x481a('0x6')](e,emitEvent(event));}}module[_0x481a('0x7')]=CmContactEvents; \ No newline at end of file +var _0xe6c8=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update'];(function(_0x485cc1,_0xfcafa2){var _0x52eb0e=function(_0x4aea33){while(--_0x4aea33){_0x485cc1['push'](_0x485cc1['shift']());}};_0x52eb0e(++_0xfcafa2);}(_0xe6c8,0xd4));var _0x8e6c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe6c8[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x8e6c('0x0'));var CmContact=require(_0x8e6c('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8e6c('0x2'),'afterUpdate':_0x8e6c('0x3'),'afterDestroy':_0x8e6c('0x4')};function emitEvent(_0x5d96b5){return function(_0x54e45a,_0xc71d28,_0x1a6907){CmContactEvents[_0x8e6c('0x5')](_0x5d96b5+':'+_0x54e45a['id'],_0x54e45a);CmContactEvents[_0x8e6c('0x5')](_0x5d96b5,_0x54e45a);_0x1a6907(null);};}for(var e in events){if(events[_0x8e6c('0x6')](e)){var event=events[e];CmContact[_0x8e6c('0x7')](e,emitEvent(event));}}module[_0x8e6c('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 6461ec5..87f5ae2 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 _0xccde=['length','afterCreate','message','List\x20not\x20found','models','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4_unicode_ci','error','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','timezones','utcOffset','add','format','then','ret','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','catch','findOne','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','cmContact','Campaign','minutes','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','Lists','get','onlyIfOpen','outbound','CmList','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s'];(function(_0x4b3cad,_0xc339fc){var _0x5f0eb8=function(_0x488fc5){while(--_0x488fc5){_0x4b3cad['push'](_0x4b3cad['shift']());}};_0x5f0eb8(++_0xc339fc);}(_0xccde,0x1c4));var _0xeccd=function(_0x4e198a,_0x5a6bad){_0x4e198a=_0x4e198a-0x0;var _0xb84bfe=_0xccde[_0x4e198a];return _0xb84bfe;};'use strict';var _=require('lodash');var util=require(_0xeccd('0x0'));var logger=require(_0xeccd('0x1'))('api');var moment=require('moment');var BPromise=require(_0xeccd('0x2'));var rp=require(_0xeccd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeccd('0x4'));var config=require(_0xeccd('0x5'));var shared=require('../../config/environment/shared');var attributes=require(_0xeccd('0x6'));module[_0xeccd('0x7')]=function(_0x50c374,_0x5991a1){return _0x50c374['define'](_0xeccd('0x8'),attributes,{'tableName':_0xeccd('0x9'),'paranoid':!![],'indexes':[{'name':_0xeccd('0xa'),'fields':[_0xeccd('0xa')]},{'name':_0xeccd('0xb'),'fields':[_0xeccd('0xc'),_0xeccd('0xd'),_0xeccd('0xa'),_0xeccd('0xe'),_0xeccd('0xf'),_0xeccd('0x10')],'type':_0xeccd('0x11')}],'timestamps':!![],'charset':'utf8mb4','collate':_0xeccd('0x12'),'hooks':{'afterCreate':function(_0x243f36,_0x5e7857,_0x5c8d1b){var _0x471688=_0x50c374['models'];var _0x18807b=_0x243f36['get']({'plain':!![]});function _0x1493e5(){return function(_0x23b74c){logger[_0xeccd('0x13')]('cmContact','afterCreate',util[_0xeccd('0x14')](_0x23b74c,{'showHidden':![],'depth':null}));};}function _0x5aac02(_0x20aa63,_0x454df5){var _0x3dd890=_0x454df5['scheduledat']?_0x454df5[_0xeccd('0x15')]:moment()['format'](_0xeccd('0x16'));return new BPromise(function(_0x41412b,_0x2de842){if(_[_0xeccd('0x17')](_0x454df5[_0xeccd('0x18')])){_0x41412b({'ret':_0x3dd890});}else{_0x471688[_0xeccd('0x19')]['findOne']({'where':{'id':_0x20aa63['id']}})['then'](function(_0x237294){if(!_[_0xeccd('0x17')](_0x237294)){var _0x4d7730=_0x237294['dialTimezone'];if(!_[_0xeccd('0x17')](_0x4d7730)){var _0x2d0f0c=shared[_0xeccd('0x1a')];var _0x244d6f=_0x2d0f0c[_0x4d7730];var _0x30a8f4=_0x2d0f0c[_0x454df5['dialTimezone']];if(!_[_0xeccd('0x17')](_0x244d6f)&&!_[_0xeccd('0x17')](_0x30a8f4)){var _0xf7b8f4=_0x244d6f[_0xeccd('0x1b')]-_0x30a8f4[_0xeccd('0x1b')];_0x3dd890=_0x454df5[_0xeccd('0x15')]?_0x454df5[_0xeccd('0x15')]:moment();var _0x4d9c92=moment(_0x3dd890)[_0xeccd('0x1c')](_0xf7b8f4,'minutes');_0x41412b({'ret':_0x4d9c92[_0xeccd('0x1d')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x41412b({'ret':_0x3dd890});}else _0x41412b({'ret':_0x3dd890});}else{_0x41412b({'ret':_0x3dd890});}});}});return 0xa;}var _0x491b71=function(_0x3b5124){return new BPromise(function(_0x1b6dd8,_0x3b87de){_0x5aac02(_0x3b5124,_0x18807b)[_0xeccd('0x1e')](function(_0x509ea0){_0x18807b[_0xeccd('0x15')]=_0x509ea0[_0xeccd('0x1f')];_0x471688[_0xeccd('0x20')]['findOne']({'where':{'phone':_0x18807b[_0xeccd('0xa')],'VoiceQueueId':_0x3b5124['id']}})[_0xeccd('0x1e')](function(_0x5e84d7){if(!_[_0xeccd('0x17')](_0x5e84d7)){throw new Error('cmContact,\x20afterCreate\x20'+_0x18807b['phone']+_0xeccd('0x21')+_0x3b5124['id']);}return _0x471688['CmHopper']['create']({'phone':_0x18807b[_0xeccd('0xa')],'ContactId':_0x18807b['id'],'ListId':_0x18807b[_0xeccd('0x22')],'priority':_0x18807b[_0xeccd('0x23')]?_0x18807b[_0xeccd('0x23')]:0x2,'scheduledat':_0x18807b[_0xeccd('0x15')]?_0x18807b['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x18807b[_0xeccd('0x24')]?!![]:![],'callbackuniqueid':_0x18807b[_0xeccd('0x24')]?_0x18807b['callbackUniqueid']:undefined,'callbackat':_0x18807b[_0xeccd('0x24')]?moment()[_0xeccd('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x3b5124['id']});})[_0xeccd('0x25')](function(_0x3d1df7){_0x3b87de(_0x3d1df7);});});});};var _0x50852f=function(_0x3d561c){return new BPromise(function(_0x3f8c5a,_0x5b41d2){_0x5aac02(_0x3d561c,_0x18807b)[_0xeccd('0x1e')](function(_0x38b7fa){_0x18807b['scheduledat']=_0x38b7fa[_0xeccd('0x1f')];_0x471688[_0xeccd('0x20')][_0xeccd('0x26')]({'where':{'phone':_0x18807b['phone'],'VoiceQueueId':_0x3d561c['id']}})[_0xeccd('0x1e')](function(_0x26c947){if(!_[_0xeccd('0x17')](_0x26c947)){throw new Error('cmContact,\x20afterCreate\x20'+_0x18807b[_0xeccd('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x3d561c['id']);}return _0x471688[_0xeccd('0x27')][_0xeccd('0x26')]({'where':{'calleridnum':_0x18807b['phone'],'VoiceQueueId':_0x3d561c['id']}});})['then'](function(_0x2be379){if(!_[_0xeccd('0x17')](_0x2be379)){throw new Error(_0xeccd('0x28')+_0x18807b[_0xeccd('0xa')]+_0xeccd('0x29')+_0x3d561c['id']);}return _0x471688[_0xeccd('0x20')][_0xeccd('0x2a')]({'phone':_0x18807b[_0xeccd('0xa')],'ContactId':_0x18807b['id'],'ListId':_0x18807b[_0xeccd('0x22')],'priority':_0x18807b['priority']?_0x18807b['priority']:0x2,'scheduledat':_0x18807b[_0xeccd('0x15')]?_0x18807b[_0xeccd('0x15')]:moment()[_0xeccd('0x1d')](_0xeccd('0x16')),'callback':_0x18807b[_0xeccd('0x24')]?!![]:![],'callbackuniqueid':_0x18807b[_0xeccd('0x24')]?_0x18807b[_0xeccd('0x24')]:undefined,'callbackat':_0x18807b[_0xeccd('0x24')]?moment()[_0xeccd('0x1d')](_0xeccd('0x16')):undefined,'VoiceQueueId':_0x3d561c['id']});})['catch'](function(_0x19d5b3){_0x5b41d2(_0x19d5b3);});});});};function _0x53e36a(){return function(_0x568cc5){logger[_0xeccd('0x13')](_0xeccd('0x2b'),'afterCreate',util[_0xeccd('0x14')](_0x568cc5,{'showHidden':![],'depth':null}));};}function _0x13a88f(_0x169dc8,_0x2ba3b2){var _0x3482e6=_0x2ba3b2[_0xeccd('0x15')]?_0x2ba3b2[_0xeccd('0x15')]:moment()[_0xeccd('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x531178,_0x3eb45e){if(_[_0xeccd('0x17')](_0x2ba3b2[_0xeccd('0x18')])){_0x531178({'ret':_0x3482e6});}else{_0x471688[_0xeccd('0x2c')][_0xeccd('0x26')]({'where':{'id':_0x169dc8['id']}})['then'](function(_0x587c5a){if(!_[_0xeccd('0x17')](_0x587c5a)){var _0x10e0fe=_0x587c5a[_0xeccd('0x18')];if(!_[_0xeccd('0x17')](_0x10e0fe)){var _0x3e3b2a=shared[_0xeccd('0x1a')];var _0x5f07f0=_0x3e3b2a[_0x10e0fe];var _0x5a81a8=_0x3e3b2a[_0x2ba3b2['dialTimezone']];if(!_[_0xeccd('0x17')](_0x5f07f0)&&!_[_0xeccd('0x17')](_0x5a81a8)){var _0x1d5c55=_0x5f07f0[_0xeccd('0x1b')]-_0x5a81a8[_0xeccd('0x1b')];_0x3482e6=_0x2ba3b2['scheduledat']?_0x2ba3b2[_0xeccd('0x15')]:moment();var _0x46b8c4=moment(_0x3482e6)[_0xeccd('0x1c')](_0x1d5c55,_0xeccd('0x2d'));_0x531178({'ret':_0x46b8c4[_0xeccd('0x1d')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x531178({'ret':_0x3482e6});}else _0x531178({'ret':_0x3482e6});}else{_0x531178({'ret':_0x3482e6});}});}});return 0xa;}var _0x547b70=function(_0x412737){return new BPromise(function(_0x1bae6b,_0x237922){_0x13a88f(_0x412737,_0x18807b)[_0xeccd('0x1e')](function(_0x2dbdb8){_0x18807b[_0xeccd('0x15')]=_0x2dbdb8['ret'];_0x471688[_0xeccd('0x20')][_0xeccd('0x26')]({'where':{'phone':_0x18807b[_0xeccd('0xa')],'CampaignId':_0x412737['id']}})['then'](function(_0x468e95){if(!_[_0xeccd('0x17')](_0x468e95)){throw new Error(_0xeccd('0x2e')+_0x18807b[_0xeccd('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x412737['id']);}return _0x471688[_0xeccd('0x20')]['create']({'phone':_0x18807b['phone'],'ContactId':_0x18807b['id'],'ListId':_0x18807b[_0xeccd('0x22')],'priority':_0x18807b[_0xeccd('0x23')]?_0x18807b['priority']:0x2,'scheduledat':_0x18807b[_0xeccd('0x15')]?_0x18807b['scheduledat']:moment()[_0xeccd('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x18807b[_0xeccd('0x24')]?!![]:![],'callbackuniqueid':_0x18807b[_0xeccd('0x24')]?_0x18807b[_0xeccd('0x24')]:undefined,'callbackat':_0x18807b[_0xeccd('0x24')]?moment()['format'](_0xeccd('0x16')):undefined,'CampaignId':_0x412737['id']});})[_0xeccd('0x25')](function(_0x40ec0a){_0x237922(_0x40ec0a);});});});};var _0xe77ba0=function(_0x1b23b9){return new BPromise(function(_0x495908,_0x4dae0c){_0x13a88f(_0x1b23b9,_0x18807b)[_0xeccd('0x1e')](function(_0x508b91){_0x18807b['scheduledat']=_0x508b91[_0xeccd('0x1f')];_0x471688['CmHopper'][_0xeccd('0x26')]({'where':{'phone':_0x18807b[_0xeccd('0xa')],'CampaignId':_0x1b23b9['id']}})[_0xeccd('0x1e')](function(_0xd26ab1){if(!_[_0xeccd('0x17')](_0xd26ab1)){throw new Error(_0xeccd('0x2e')+_0x18807b['phone']+_0xeccd('0x2f')+_0x1b23b9['id']);}return _0x471688['CmHopperFinal'][_0xeccd('0x26')]({'where':{'calleridnum':_0x18807b['phone'],'CampaignId':_0x1b23b9['id']}});})[_0xeccd('0x1e')](function(_0x234464){if(!_[_0xeccd('0x17')](_0x234464)){throw new Error(_0xeccd('0x28')+_0x18807b['phone']+_0xeccd('0x30')+_0x1b23b9['id']);}return _0x471688['CmHopper']['create']({'phone':_0x18807b['phone'],'ContactId':_0x18807b['id'],'ListId':_0x18807b[_0xeccd('0x22')],'priority':_0x18807b[_0xeccd('0x23')]?_0x18807b[_0xeccd('0x23')]:0x2,'scheduledat':_0x18807b[_0xeccd('0x15')]?_0x18807b[_0xeccd('0x15')]:moment()['format'](_0xeccd('0x16')),'callback':_0x18807b[_0xeccd('0x24')]?!![]:![],'callbackuniqueid':_0x18807b['callbackUniqueid']?_0x18807b[_0xeccd('0x24')]:undefined,'callbackat':_0x18807b[_0xeccd('0x24')]?moment()[_0xeccd('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x1b23b9['id']});})[_0xeccd('0x25')](function(_0x57ea4e){_0x4dae0c(_0x57ea4e);});});});};if(_0x18807b[_0xeccd('0x22')]){_0x471688['VoiceQueue'][_0xeccd('0x31')]({'where':{'type':'outbound'},'attributes':['id',_0xeccd('0x32'),_0xeccd('0x18')],'include':[{'model':_0x471688['CmList'],'as':_0xeccd('0x33'),'where':{'id':_0x18807b[_0xeccd('0x22')]}}]})[_0xeccd('0x1e')](function(_0x34637e){if(_0x34637e){var _0x2cb906=[];for(var _0x526f1e=0x0,_0x5a2b11;_0x526f1e<_0x34637e['length'];_0x526f1e+=0x1){_0x5a2b11=_0x34637e[_0x526f1e][_0xeccd('0x34')]({'plain':!![]});switch(_0x5a2b11[_0xeccd('0x32')]){case'always':_0x50852f(_0x5a2b11)[_0xeccd('0x25')](_0x1493e5());break;case _0xeccd('0x35'):_0x491b71(_0x5a2b11)[_0xeccd('0x25')](_0x1493e5());break;default:_0x13a88f(_0x5a2b11,_0x18807b)['then'](function(_0x9ec625){_0x18807b['scheduledat']=_0x9ec625['ret'];_0x471688[_0xeccd('0x20')][_0xeccd('0x2a')]({'phone':_0x18807b[_0xeccd('0xa')],'ContactId':_0x18807b['id'],'ListId':_0x18807b['ListId'],'scheduledat':_0x18807b['scheduledat']?_0x18807b[_0xeccd('0x15')]:moment()[_0xeccd('0x1d')](_0xeccd('0x16')),'priority':_0x18807b[_0xeccd('0x23')]?_0x18807b[_0xeccd('0x23')]:0x2,'callback':_0x18807b[_0xeccd('0x24')]?!![]:![],'callbackuniqueid':_0x18807b[_0xeccd('0x24')]?_0x18807b[_0xeccd('0x24')]:undefined,'callbackat':_0x18807b[_0xeccd('0x24')]?moment()['format'](_0xeccd('0x16')):undefined,'VoiceQueueId':_0x5a2b11['id']})[_0xeccd('0x25')](_0x1493e5());});}}}})['then'](function(){return _0x471688['VoiceQueue'][_0xeccd('0x31')]({'where':{'type':_0xeccd('0x36')},'attributes':['id'],'include':[{'model':_0x471688[_0xeccd('0x37')],'as':_0xeccd('0x38'),'where':{'id':_0x18807b['ListId']}}]})[_0xeccd('0x1e')](function(_0x431a11){if(_0x431a11){var _0x157e24=[];for(var _0x19d248=0x0,_0xbb88b2;_0x19d248<_0x431a11['length'];_0x19d248+=0x1){_0xbb88b2=_0x431a11[_0x19d248][_0xeccd('0x34')]({'plain':!![]});_0x471688[_0xeccd('0x39')][_0xeccd('0x2a')]({'phone':_0x18807b[_0xeccd('0xa')],'ContactId':_0x18807b['id'],'ListId':_0x18807b[_0xeccd('0x22')],'VoiceQueueId':_0xbb88b2['id']})[_0xeccd('0x25')](function(_0x2caa10){logger['error'](_0xeccd('0x3a'),'afterCreate',_0x2caa10['message']);});}}});})[_0xeccd('0x1e')](function(){return _0x471688['Campaign'][_0xeccd('0x31')]({'attributes':['id',_0xeccd('0x32'),'dialTimezone'],'include':[{'model':_0x471688[_0xeccd('0x37')],'as':_0xeccd('0x33'),'where':{'id':_0x18807b[_0xeccd('0x22')]}}]})[_0xeccd('0x1e')](function(_0x217970){if(_0x217970){var _0x403b02=[];for(var _0x2ac601=0x0,_0x512793;_0x2ac601<_0x217970[_0xeccd('0x3b')];_0x2ac601+=0x1){_0x512793=_0x217970[_0x2ac601]['get']({'plain':!![]});switch(_0x512793[_0xeccd('0x32')]){case'always':_0xe77ba0(_0x512793)[_0xeccd('0x25')](_0x53e36a());break;case'onlyIfOpen':_0x547b70(_0x512793)[_0xeccd('0x25')](_0x53e36a());break;default:_0x471688[_0xeccd('0x20')]['create']({'phone':_0x18807b[_0xeccd('0xa')],'ContactId':_0x18807b['id'],'ListId':_0x18807b[_0xeccd('0x22')],'scheduledat':_0x18807b[_0xeccd('0x15')]?_0x18807b[_0xeccd('0x15')]:moment()[_0xeccd('0x1d')](_0xeccd('0x16')),'priority':_0x18807b[_0xeccd('0x23')]?_0x18807b[_0xeccd('0x23')]:0x2,'callback':_0x18807b[_0xeccd('0x24')]?!![]:![],'callbackuniqueid':_0x18807b[_0xeccd('0x24')]?_0x18807b[_0xeccd('0x24')]:undefined,'callbackat':_0x18807b[_0xeccd('0x24')]?moment()[_0xeccd('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x512793['id']})[_0xeccd('0x25')](_0x53e36a());}}}});})['then'](function(){return _0x471688['Campaign'][_0xeccd('0x31')]({'attributes':['id'],'include':[{'model':_0x471688[_0xeccd('0x37')],'as':_0xeccd('0x38'),'where':{'id':_0x18807b['ListId']}}]})[_0xeccd('0x1e')](function(_0x37c1b7){if(_0x37c1b7){var _0x3eebbb=[];for(var _0x2bdacc=0x0,_0x4e7850;_0x2bdacc<_0x37c1b7[_0xeccd('0x3b')];_0x2bdacc+=0x1){_0x4e7850=_0x37c1b7[_0x2bdacc][_0xeccd('0x34')]({'plain':!![]});_0x471688[_0xeccd('0x39')][_0xeccd('0x2a')]({'phone':_0x18807b['phone'],'ContactId':_0x18807b['id'],'ListId':_0x18807b[_0xeccd('0x22')],'CampaignId':_0x4e7850['id']})[_0xeccd('0x25')](function(_0x166bfb){logger[_0xeccd('0x13')]('cmContact,\x20%s,\x20%s',_0xeccd('0x3c'),_0x166bfb['message']);});}}});})[_0xeccd('0x1e')](function(){_0x5c8d1b();})[_0xeccd('0x25')](function(_0x5a51b4){logger[_0xeccd('0x13')](_0xeccd('0x3a'),_0xeccd('0x3c'),_0x5a51b4[_0xeccd('0x3d')]);_0x5c8d1b(_0x5a51b4);});}else{_0x5c8d1b(new Error(_0xeccd('0x3e')));}},'afterDestroy':function(_0x1b2974,_0x57cb2b,_0xc51eb8){var _0x4c69eb=_0x50c374[_0xeccd('0x3f')];var _0x3f9ab3=_0x1b2974[_0xeccd('0x34')]({'plain':!![]});return _0x4c69eb[_0xeccd('0x20')]['findAll']({'raw':!![],'where':{'ListId':_0x3f9ab3[_0xeccd('0x22')],'ContactId':_0x3f9ab3['id']}})['then'](function(_0xb716b1){if(!_[_0xeccd('0x40')](_0xb716b1)){var _0x483730=[];for(var _0x56a0c0=0x0;_0x56a0c0<_0xb716b1[_0xeccd('0x3b')];_0x56a0c0+=0x1){var _0x63b0b6=_0x4c69eb[_0xeccd('0x20')][_0xeccd('0x41')]({'where':{'ListId':_0xb716b1[_0x56a0c0][_0xeccd('0x22')],'ContactId':_0xb716b1[_0x56a0c0][_0xeccd('0x42')],'VoiceQueueId':_0xb716b1[_0x56a0c0][_0xeccd('0x43')],'CampaignId':_0xb716b1[_0x56a0c0][_0xeccd('0x44')]}});_0x483730['push'](_0x63b0b6);}return BPromise[_0xeccd('0x45')](_0x483730);}})[_0xeccd('0x1e')](function(_0x5764c6){logger[_0xeccd('0x46')](_0xeccd('0x47'),util[_0xeccd('0x14')](_0x5764c6,{'showHidden':![],'depth':null}));_0xc51eb8();})[_0xeccd('0x25')](function(_0xc5acfc){logger['error'](_0xeccd('0x48'),util[_0xeccd('0x14')](_0xc5acfc,{'showHidden':![],'depth':null}));_0xc51eb8(_0xc5acfc);});}}});}; \ No newline at end of file +var _0xa680=['\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','afterCreate','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','dialCheckDuplicateType','CmList','Lists','length','get','onlyIfOpen','CmHopperBlack','cmContact,\x20%s,\x20%s','message','findAll','always','BlackLists','List\x20not\x20found','isEmpty','destroy','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','then','timezones','utcOffset','add','minutes','ret','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'];(function(_0x221dc4,_0x3dd87a){var _0x37e3a8=function(_0x5526b4){while(--_0x5526b4){_0x221dc4['push'](_0x221dc4['shift']());}};_0x37e3a8(++_0x3dd87a);}(_0xa680,0x14d));var _0x0a68=function(_0x1947f7,_0x246322){_0x1947f7=_0x1947f7-0x0;var _0x3f5d6c=_0xa680[_0x1947f7];return _0x3f5d6c;};'use strict';var _=require(_0x0a68('0x0'));var util=require('util');var logger=require(_0x0a68('0x1'))(_0x0a68('0x2'));var moment=require(_0x0a68('0x3'));var BPromise=require(_0x0a68('0x4'));var rp=require(_0x0a68('0x5'));var fs=require('fs');var path=require(_0x0a68('0x6'));var rimraf=require(_0x0a68('0x7'));var config=require(_0x0a68('0x8'));var shared=require('../../config/environment/shared');var attributes=require('./cmContact.attributes');module[_0x0a68('0x9')]=function(_0x18d28e,_0x14fdba){return _0x18d28e[_0x0a68('0xa')](_0x0a68('0xb'),attributes,{'tableName':_0x0a68('0xc'),'paranoid':!![],'indexes':[{'name':_0x0a68('0xd'),'fields':[_0x0a68('0xd')]},{'name':_0x0a68('0xe'),'fields':[_0x0a68('0xf'),_0x0a68('0x10'),_0x0a68('0xd'),_0x0a68('0x11'),_0x0a68('0x12'),'email'],'type':_0x0a68('0x13')}],'timestamps':!![],'charset':_0x0a68('0x14'),'collate':_0x0a68('0x15'),'hooks':{'afterCreate':function(_0x55a094,_0xdb7315,_0x16d2b8){var _0x1f03a4=_0x18d28e[_0x0a68('0x16')];var _0x5401d7=_0x55a094['get']({'plain':!![]});function _0x20bb1f(){return function(_0x412c6){logger[_0x0a68('0x17')]('cmContact','afterCreate',util[_0x0a68('0x18')](_0x412c6,{'showHidden':![],'depth':null}));};}function _0x48e272(_0x4f6ed0,_0x145b37){var _0x45ecb2=_0x145b37[_0x0a68('0x19')]?_0x145b37[_0x0a68('0x19')]:moment()[_0x0a68('0x1a')](_0x0a68('0x1b'));return new BPromise(function(_0x25d748,_0x583ef9){if(_[_0x0a68('0x1c')](_0x145b37[_0x0a68('0x1d')])){_0x25d748({'ret':_0x45ecb2});}else{_0x1f03a4[_0x0a68('0x1e')]['findOne']({'where':{'id':_0x4f6ed0['id']}})[_0x0a68('0x1f')](function(_0x1a9f6b){if(!_[_0x0a68('0x1c')](_0x1a9f6b)){var _0x5969a9=_0x1a9f6b[_0x0a68('0x1d')];if(!_[_0x0a68('0x1c')](_0x5969a9)){var _0x2f4168=shared[_0x0a68('0x20')];var _0x2f4b64=_0x2f4168[_0x5969a9];var _0x767a09=_0x2f4168[_0x145b37[_0x0a68('0x1d')]];if(!_[_0x0a68('0x1c')](_0x2f4b64)&&!_['isNil'](_0x767a09)){var _0x51240d=_0x2f4b64['utcOffset']-_0x767a09[_0x0a68('0x21')];_0x45ecb2=_0x145b37[_0x0a68('0x19')]?_0x145b37[_0x0a68('0x19')]:moment();var _0x1e82dd=moment(_0x45ecb2)[_0x0a68('0x22')](_0x51240d,_0x0a68('0x23'));_0x25d748({'ret':_0x1e82dd[_0x0a68('0x1a')](_0x0a68('0x1b'))});}else _0x25d748({'ret':_0x45ecb2});}else _0x25d748({'ret':_0x45ecb2});}else{_0x25d748({'ret':_0x45ecb2});}});}});return 0xa;}var _0x464d8e=function(_0x21b775){return new BPromise(function(_0x447fba,_0x582f64){_0x48e272(_0x21b775,_0x5401d7)[_0x0a68('0x1f')](function(_0x2349ab){_0x5401d7[_0x0a68('0x19')]=_0x2349ab[_0x0a68('0x24')];_0x1f03a4['CmHopper'][_0x0a68('0x25')]({'where':{'phone':_0x5401d7['phone'],'VoiceQueueId':_0x21b775['id']}})['then'](function(_0x4184d2){if(!_[_0x0a68('0x1c')](_0x4184d2)){throw new Error(_0x0a68('0x26')+_0x5401d7[_0x0a68('0xd')]+_0x0a68('0x27')+_0x21b775['id']);}return _0x1f03a4[_0x0a68('0x28')][_0x0a68('0x29')]({'phone':_0x5401d7['phone'],'ContactId':_0x5401d7['id'],'ListId':_0x5401d7[_0x0a68('0x2a')],'priority':_0x5401d7[_0x0a68('0x2b')]?_0x5401d7[_0x0a68('0x2b')]:0x2,'scheduledat':_0x5401d7[_0x0a68('0x19')]?_0x5401d7[_0x0a68('0x19')]:moment()['format'](_0x0a68('0x1b')),'callback':_0x5401d7['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5401d7[_0x0a68('0x2c')]?_0x5401d7[_0x0a68('0x2c')]:undefined,'callbackat':_0x5401d7['callbackUniqueid']?moment()[_0x0a68('0x1a')](_0x0a68('0x1b')):undefined,'VoiceQueueId':_0x21b775['id']});})[_0x0a68('0x2d')](function(_0xd585ab){_0x582f64(_0xd585ab);});});});};var _0x31ab3f=function(_0x50ba0e){return new BPromise(function(_0x5b9dc0,_0x4576a1){_0x48e272(_0x50ba0e,_0x5401d7)[_0x0a68('0x1f')](function(_0xe55aab){_0x5401d7[_0x0a68('0x19')]=_0xe55aab['ret'];_0x1f03a4[_0x0a68('0x28')][_0x0a68('0x25')]({'where':{'phone':_0x5401d7[_0x0a68('0xd')],'VoiceQueueId':_0x50ba0e['id']}})[_0x0a68('0x1f')](function(_0x4d4d34){if(!_[_0x0a68('0x1c')](_0x4d4d34)){throw new Error(_0x0a68('0x26')+_0x5401d7[_0x0a68('0xd')]+_0x0a68('0x2e')+_0x50ba0e['id']);}return _0x1f03a4['CmHopperFinal'][_0x0a68('0x25')]({'where':{'calleridnum':_0x5401d7[_0x0a68('0xd')],'VoiceQueueId':_0x50ba0e['id']}});})[_0x0a68('0x1f')](function(_0x3bf63a){if(!_['isNil'](_0x3bf63a)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x5401d7['phone']+_0x0a68('0x2f')+_0x50ba0e['id']);}return _0x1f03a4[_0x0a68('0x28')]['create']({'phone':_0x5401d7[_0x0a68('0xd')],'ContactId':_0x5401d7['id'],'ListId':_0x5401d7['ListId'],'priority':_0x5401d7['priority']?_0x5401d7[_0x0a68('0x2b')]:0x2,'scheduledat':_0x5401d7['scheduledat']?_0x5401d7[_0x0a68('0x19')]:moment()[_0x0a68('0x1a')](_0x0a68('0x1b')),'callback':_0x5401d7[_0x0a68('0x2c')]?!![]:![],'callbackuniqueid':_0x5401d7[_0x0a68('0x2c')]?_0x5401d7[_0x0a68('0x2c')]:undefined,'callbackat':_0x5401d7[_0x0a68('0x2c')]?moment()[_0x0a68('0x1a')](_0x0a68('0x1b')):undefined,'VoiceQueueId':_0x50ba0e['id']});})[_0x0a68('0x2d')](function(_0x426818){_0x4576a1(_0x426818);});});});};function _0x1c8836(){return function(_0x3677e1){logger[_0x0a68('0x17')]('cmContact',_0x0a68('0x30'),util[_0x0a68('0x18')](_0x3677e1,{'showHidden':![],'depth':null}));};}function _0x5cbe82(_0xc2f6e5,_0x5155fa){var _0x3e42ca=_0x5155fa[_0x0a68('0x19')]?_0x5155fa[_0x0a68('0x19')]:moment()['format'](_0x0a68('0x1b'));return new BPromise(function(_0x4347a6,_0x5e9779){if(_[_0x0a68('0x1c')](_0x5155fa[_0x0a68('0x1d')])){_0x4347a6({'ret':_0x3e42ca});}else{_0x1f03a4[_0x0a68('0x31')]['findOne']({'where':{'id':_0xc2f6e5['id']}})[_0x0a68('0x1f')](function(_0x479504){if(!_['isNil'](_0x479504)){var _0x580f9d=_0x479504[_0x0a68('0x1d')];if(!_[_0x0a68('0x1c')](_0x580f9d)){var _0x5d1f6c=shared[_0x0a68('0x20')];var _0x5b1baa=_0x5d1f6c[_0x580f9d];var _0x324db5=_0x5d1f6c[_0x5155fa[_0x0a68('0x1d')]];if(!_[_0x0a68('0x1c')](_0x5b1baa)&&!_[_0x0a68('0x1c')](_0x324db5)){var _0x421f90=_0x5b1baa[_0x0a68('0x21')]-_0x324db5[_0x0a68('0x21')];_0x3e42ca=_0x5155fa['scheduledat']?_0x5155fa[_0x0a68('0x19')]:moment();var _0x1625ee=moment(_0x3e42ca)['add'](_0x421f90,_0x0a68('0x23'));_0x4347a6({'ret':_0x1625ee[_0x0a68('0x1a')](_0x0a68('0x1b'))});}else _0x4347a6({'ret':_0x3e42ca});}else _0x4347a6({'ret':_0x3e42ca});}else{_0x4347a6({'ret':_0x3e42ca});}});}});return 0xa;}var _0x303715=function(_0x396681){return new BPromise(function(_0x80f610,_0x36af87){_0x5cbe82(_0x396681,_0x5401d7)['then'](function(_0x2ca7ca){_0x5401d7[_0x0a68('0x19')]=_0x2ca7ca[_0x0a68('0x24')];_0x1f03a4[_0x0a68('0x28')][_0x0a68('0x25')]({'where':{'phone':_0x5401d7[_0x0a68('0xd')],'CampaignId':_0x396681['id']}})[_0x0a68('0x1f')](function(_0xaecd30){if(!_['isNil'](_0xaecd30)){throw new Error('cmContact,\x20afterCreate\x20'+_0x5401d7['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x396681['id']);}return _0x1f03a4[_0x0a68('0x28')][_0x0a68('0x29')]({'phone':_0x5401d7[_0x0a68('0xd')],'ContactId':_0x5401d7['id'],'ListId':_0x5401d7[_0x0a68('0x2a')],'priority':_0x5401d7['priority']?_0x5401d7[_0x0a68('0x2b')]:0x2,'scheduledat':_0x5401d7[_0x0a68('0x19')]?_0x5401d7[_0x0a68('0x19')]:moment()[_0x0a68('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x5401d7['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5401d7[_0x0a68('0x2c')]?_0x5401d7[_0x0a68('0x2c')]:undefined,'callbackat':_0x5401d7[_0x0a68('0x2c')]?moment()['format'](_0x0a68('0x1b')):undefined,'CampaignId':_0x396681['id']});})['catch'](function(_0x738149){_0x36af87(_0x738149);});});});};var _0x50f7e2=function(_0x23ce17){return new BPromise(function(_0x58006b,_0x50f5d0){_0x5cbe82(_0x23ce17,_0x5401d7)[_0x0a68('0x1f')](function(_0xef995c){_0x5401d7['scheduledat']=_0xef995c[_0x0a68('0x24')];_0x1f03a4[_0x0a68('0x28')][_0x0a68('0x25')]({'where':{'phone':_0x5401d7[_0x0a68('0xd')],'CampaignId':_0x23ce17['id']}})['then'](function(_0x3034cd){if(!_['isNil'](_0x3034cd)){throw new Error(_0x0a68('0x26')+_0x5401d7[_0x0a68('0xd')]+_0x0a68('0x32')+_0x23ce17['id']);}return _0x1f03a4[_0x0a68('0x33')]['findOne']({'where':{'calleridnum':_0x5401d7[_0x0a68('0xd')],'CampaignId':_0x23ce17['id']}});})[_0x0a68('0x1f')](function(_0xf8e20a){if(!_['isNil'](_0xf8e20a)){throw new Error(_0x0a68('0x34')+_0x5401d7[_0x0a68('0xd')]+_0x0a68('0x35')+_0x23ce17['id']);}return _0x1f03a4[_0x0a68('0x28')][_0x0a68('0x29')]({'phone':_0x5401d7[_0x0a68('0xd')],'ContactId':_0x5401d7['id'],'ListId':_0x5401d7[_0x0a68('0x2a')],'priority':_0x5401d7[_0x0a68('0x2b')]?_0x5401d7['priority']:0x2,'scheduledat':_0x5401d7['scheduledat']?_0x5401d7[_0x0a68('0x19')]:moment()[_0x0a68('0x1a')](_0x0a68('0x1b')),'callback':_0x5401d7[_0x0a68('0x2c')]?!![]:![],'callbackuniqueid':_0x5401d7[_0x0a68('0x2c')]?_0x5401d7[_0x0a68('0x2c')]:undefined,'callbackat':_0x5401d7['callbackUniqueid']?moment()['format'](_0x0a68('0x1b')):undefined,'CampaignId':_0x23ce17['id']});})[_0x0a68('0x2d')](function(_0x481992){_0x50f5d0(_0x481992);});});});};if(_0x5401d7['ListId']){_0x1f03a4[_0x0a68('0x1e')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x0a68('0x36'),'dialTimezone'],'include':[{'model':_0x1f03a4[_0x0a68('0x37')],'as':_0x0a68('0x38'),'where':{'id':_0x5401d7['ListId']}}]})[_0x0a68('0x1f')](function(_0x2361e9){if(_0x2361e9){var _0x43191e=[];for(var _0x4d183d=0x0,_0x337735;_0x4d183d<_0x2361e9[_0x0a68('0x39')];_0x4d183d+=0x1){_0x337735=_0x2361e9[_0x4d183d][_0x0a68('0x3a')]({'plain':!![]});switch(_0x337735[_0x0a68('0x36')]){case'always':_0x31ab3f(_0x337735)[_0x0a68('0x2d')](_0x20bb1f());break;case _0x0a68('0x3b'):_0x464d8e(_0x337735)['catch'](_0x20bb1f());break;default:_0x5cbe82(_0x337735,_0x5401d7)[_0x0a68('0x1f')](function(_0x312a9c){_0x5401d7['scheduledat']=_0x312a9c[_0x0a68('0x24')];_0x1f03a4[_0x0a68('0x28')][_0x0a68('0x29')]({'phone':_0x5401d7[_0x0a68('0xd')],'ContactId':_0x5401d7['id'],'ListId':_0x5401d7[_0x0a68('0x2a')],'scheduledat':_0x5401d7['scheduledat']?_0x5401d7[_0x0a68('0x19')]:moment()[_0x0a68('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x5401d7[_0x0a68('0x2b')]?_0x5401d7['priority']:0x2,'callback':_0x5401d7[_0x0a68('0x2c')]?!![]:![],'callbackuniqueid':_0x5401d7['callbackUniqueid']?_0x5401d7[_0x0a68('0x2c')]:undefined,'callbackat':_0x5401d7['callbackUniqueid']?moment()[_0x0a68('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x337735['id']})['catch'](_0x20bb1f());});}}}})[_0x0a68('0x1f')](function(){return _0x1f03a4[_0x0a68('0x1e')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x1f03a4[_0x0a68('0x37')],'as':'BlackLists','where':{'id':_0x5401d7['ListId']}}]})[_0x0a68('0x1f')](function(_0x3912f8){if(_0x3912f8){var _0x44533c=[];for(var _0x26365c=0x0,_0x3ea6b8;_0x26365c<_0x3912f8['length'];_0x26365c+=0x1){_0x3ea6b8=_0x3912f8[_0x26365c][_0x0a68('0x3a')]({'plain':!![]});_0x1f03a4[_0x0a68('0x3c')][_0x0a68('0x29')]({'phone':_0x5401d7[_0x0a68('0xd')],'ContactId':_0x5401d7['id'],'ListId':_0x5401d7[_0x0a68('0x2a')],'VoiceQueueId':_0x3ea6b8['id']})[_0x0a68('0x2d')](function(_0x1026ee){logger['error'](_0x0a68('0x3d'),_0x0a68('0x30'),_0x1026ee[_0x0a68('0x3e')]);});}}});})[_0x0a68('0x1f')](function(){return _0x1f03a4[_0x0a68('0x31')][_0x0a68('0x3f')]({'attributes':['id',_0x0a68('0x36'),_0x0a68('0x1d')],'include':[{'model':_0x1f03a4[_0x0a68('0x37')],'as':_0x0a68('0x38'),'where':{'id':_0x5401d7[_0x0a68('0x2a')]}}]})[_0x0a68('0x1f')](function(_0x1ba624){if(_0x1ba624){var _0x49a7e7=[];for(var _0x4094ab=0x0,_0x415ab6;_0x4094ab<_0x1ba624[_0x0a68('0x39')];_0x4094ab+=0x1){_0x415ab6=_0x1ba624[_0x4094ab][_0x0a68('0x3a')]({'plain':!![]});switch(_0x415ab6[_0x0a68('0x36')]){case _0x0a68('0x40'):_0x50f7e2(_0x415ab6)[_0x0a68('0x2d')](_0x1c8836());break;case'onlyIfOpen':_0x303715(_0x415ab6)[_0x0a68('0x2d')](_0x1c8836());break;default:_0x1f03a4['CmHopper'][_0x0a68('0x29')]({'phone':_0x5401d7[_0x0a68('0xd')],'ContactId':_0x5401d7['id'],'ListId':_0x5401d7[_0x0a68('0x2a')],'scheduledat':_0x5401d7[_0x0a68('0x19')]?_0x5401d7[_0x0a68('0x19')]:moment()[_0x0a68('0x1a')](_0x0a68('0x1b')),'priority':_0x5401d7[_0x0a68('0x2b')]?_0x5401d7[_0x0a68('0x2b')]:0x2,'callback':_0x5401d7[_0x0a68('0x2c')]?!![]:![],'callbackuniqueid':_0x5401d7[_0x0a68('0x2c')]?_0x5401d7['callbackUniqueid']:undefined,'callbackat':_0x5401d7[_0x0a68('0x2c')]?moment()[_0x0a68('0x1a')](_0x0a68('0x1b')):undefined,'CampaignId':_0x415ab6['id']})[_0x0a68('0x2d')](_0x1c8836());}}}});})['then'](function(){return _0x1f03a4[_0x0a68('0x31')][_0x0a68('0x3f')]({'attributes':['id'],'include':[{'model':_0x1f03a4[_0x0a68('0x37')],'as':_0x0a68('0x41'),'where':{'id':_0x5401d7['ListId']}}]})[_0x0a68('0x1f')](function(_0x1059fe){if(_0x1059fe){var _0x93d0cb=[];for(var _0xcfee82=0x0,_0x44cb0c;_0xcfee82<_0x1059fe[_0x0a68('0x39')];_0xcfee82+=0x1){_0x44cb0c=_0x1059fe[_0xcfee82][_0x0a68('0x3a')]({'plain':!![]});_0x1f03a4[_0x0a68('0x3c')][_0x0a68('0x29')]({'phone':_0x5401d7[_0x0a68('0xd')],'ContactId':_0x5401d7['id'],'ListId':_0x5401d7[_0x0a68('0x2a')],'CampaignId':_0x44cb0c['id']})[_0x0a68('0x2d')](function(_0x3992e3){logger[_0x0a68('0x17')](_0x0a68('0x3d'),_0x0a68('0x30'),_0x3992e3[_0x0a68('0x3e')]);});}}});})['then'](function(){_0x16d2b8();})[_0x0a68('0x2d')](function(_0x2bb3f5){logger['error'](_0x0a68('0x3d'),'afterCreate',_0x2bb3f5[_0x0a68('0x3e')]);_0x16d2b8(_0x2bb3f5);});}else{_0x16d2b8(new Error(_0x0a68('0x42')));}},'afterDestroy':function(_0x274840,_0x43b542,_0x5a06ae){var _0x48ebd6=_0x18d28e[_0x0a68('0x16')];var _0x3ede0f=_0x274840[_0x0a68('0x3a')]({'plain':!![]});return _0x48ebd6[_0x0a68('0x28')][_0x0a68('0x3f')]({'raw':!![],'where':{'ListId':_0x3ede0f[_0x0a68('0x2a')],'ContactId':_0x3ede0f['id']}})['then'](function(_0x2c6bd8){if(!_[_0x0a68('0x43')](_0x2c6bd8)){var _0x4d3e65=[];for(var _0x31f881=0x0;_0x31f881<_0x2c6bd8[_0x0a68('0x39')];_0x31f881+=0x1){var _0x5a4c67=_0x48ebd6[_0x0a68('0x28')][_0x0a68('0x44')]({'where':{'ListId':_0x2c6bd8[_0x31f881]['ListId'],'ContactId':_0x2c6bd8[_0x31f881]['ContactId'],'VoiceQueueId':_0x2c6bd8[_0x31f881][_0x0a68('0x45')],'CampaignId':_0x2c6bd8[_0x31f881][_0x0a68('0x46')]}});_0x4d3e65[_0x0a68('0x47')](_0x5a4c67);}return BPromise[_0x0a68('0x48')](_0x4d3e65);}})[_0x0a68('0x1f')](function(_0xc1364e){logger[_0x0a68('0x49')](_0x0a68('0x4a'),util[_0x0a68('0x18')](_0xc1364e,{'showHidden':![],'depth':null}));_0x5a06ae();})[_0x0a68('0x2d')](function(_0x49bdfb){logger[_0x0a68('0x17')](_0x0a68('0x4b'),util[_0x0a68('0x18')](_0x49bdfb,{'showHidden':![],'depth':null}));_0x5a06ae(_0x49bdfb);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 35d192b..51d0d0d 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(_0x345010,_0x539853){var _0xe0deef=function(_0x5517a0){while(--_0x5517a0){_0x345010['push'](_0x345010['shift']());}};_0xe0deef(++_0x539853);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var 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(_0x551597,_0x5205e5){var _0x5c5071=function(_0x59917e){while(--_0x59917e){_0x551597['push'](_0x551597['shift']());}};_0x5c5071(++_0x5205e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 9f0b1b6..536fabd 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 _0xecd5=['exports','INTEGER','STRING','PHONE'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0xecd5,0x110));var _0x5ecd=function(_0x19bb90,_0x543f2a){_0x19bb90=_0x19bb90-0x0;var _0x453ba7=_0xecd5[_0x19bb90];return _0x453ba7;};'use strict';var Sequelize=require('sequelize');module[_0x5ecd('0x0')]={'CmContactId':{'type':Sequelize[_0x5ecd('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x5ecd('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x5ecd('0x2')],'defaultValue':_0x5ecd('0x3')},'OrderBy':{'type':Sequelize[_0x5ecd('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0x5ecd('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x0851=['INTEGER','STRING','PHONE','sequelize','exports'];(function(_0x10e870,_0x4c4324){var _0x29b93d=function(_0x11943e){while(--_0x11943e){_0x10e870['push'](_0x10e870['shift']());}};_0x29b93d(++_0x4c4324);}(_0x0851,0x8a));var _0x1085=function(_0x41476c,_0x91403){_0x41476c=_0x41476c-0x0;var _0x367e81=_0x0851[_0x41476c];return _0x367e81;};'use strict';var Sequelize=require(_0x1085('0x0'));module[_0x1085('0x1')]={'CmContactId':{'type':Sequelize[_0x1085('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x1085('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x1085('0x3')],'defaultValue':_0x1085('0x4')},'OrderBy':{'type':Sequelize[_0x1085('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x1085('0x3')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 0b5e999..88728bb 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 _0x8152=['offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','get','CmContactHasItems','UserProfileResource','destroy','end','stack','name','index','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','CmContactHasItem','includeAll','include','findAll','rows','catch','show','params','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8152,0x1a1));var _0x2815=function(_0x5e6811,_0x16c3e8){_0x5e6811=_0x5e6811-0x0;var _0x22d471=_0x8152[_0x5e6811];return _0x22d471;};'use strict';var emlformat=require(_0x2815('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2815('0x1'));var jsonpatch=require(_0x2815('0x2'));var rp=require(_0x2815('0x3'));var moment=require(_0x2815('0x4'));var BPromise=require(_0x2815('0x5'));var Mustache=require(_0x2815('0x6'));var util=require(_0x2815('0x7'));var path=require(_0x2815('0x8'));var sox=require(_0x2815('0x9'));var csv=require(_0x2815('0xa'));var ejs=require(_0x2815('0xb'));var fs=require('fs');var fs_extra=require(_0x2815('0xc'));var _=require(_0x2815('0xd'));var squel=require('squel');var crypto=require(_0x2815('0xe'));var jsforce=require(_0x2815('0xf'));var deskjs=require(_0x2815('0x10'));var toCsv=require(_0x2815('0xa'));var querystring=require(_0x2815('0x11'));var Papa=require(_0x2815('0x12'));var Redis=require(_0x2815('0x13'));var authService=require(_0x2815('0x14'));var qs=require(_0x2815('0x15'));var as=require(_0x2815('0x16'));var hardwareService=require(_0x2815('0x17'));var logger=require(_0x2815('0x18'))(_0x2815('0x19'));var utils=require(_0x2815('0x1a'));var config=require(_0x2815('0x1b'));var licenseUtil=require(_0x2815('0x1c'));var db=require(_0x2815('0x1d'))['db'];function respondWithStatusCode(_0x261df5,_0xbd0dcc){_0xbd0dcc=_0xbd0dcc||0xcc;return function(_0x4c9213){if(_0x4c9213){return _0x261df5[_0x2815('0x1e')](_0xbd0dcc);}return _0x261df5[_0x2815('0x1f')](_0xbd0dcc)['end']();};}function respondWithResult(_0x396c2d,_0x3b02b9){_0x3b02b9=_0x3b02b9||0xc8;return function(_0x14f9f3){if(_0x14f9f3){return _0x396c2d['status'](_0x3b02b9)[_0x2815('0x20')](_0x14f9f3);}};}function respondWithFilteredResult(_0x3650fb,_0x1f196b){return function(_0x51c254){if(_0x51c254){var _0xdba83e=typeof _0x1f196b[_0x2815('0x21')]==='undefined'&&typeof _0x1f196b['limit']===_0x2815('0x22');var _0x1ddf14=_0x51c254[_0x2815('0x23')];var _0x417b46=_0xdba83e?0x0:_0x1f196b[_0x2815('0x21')];var _0x3913aa=_0xdba83e?_0x51c254['count']:_0x1f196b[_0x2815('0x21')]+_0x1f196b[_0x2815('0x24')];var _0x56700b;if(_0x3913aa>=_0x1ddf14){_0x3913aa=_0x1ddf14;_0x56700b=0xc8;}else{_0x56700b=0xce;}_0x3650fb[_0x2815('0x1f')](_0x56700b);return _0x3650fb[_0x2815('0x25')](_0x2815('0x26'),_0x417b46+'-'+_0x3913aa+'/'+_0x1ddf14)[_0x2815('0x20')](_0x51c254);}return null;};}function patchUpdates(_0x19adf5){return function(_0x48d48b){try{jsonpatch[_0x2815('0x27')](_0x48d48b,_0x19adf5,!![]);}catch(_0x34c69a){return BPromise[_0x2815('0x28')](_0x34c69a);}return _0x48d48b['save']();};}function saveUpdates(_0x187a59,_0x51d400){return function(_0x9eaec){if(_0x9eaec){return _0x9eaec[_0x2815('0x29')](_0x187a59)[_0x2815('0x2a')](function(_0x55b679){return _0x55b679;});}return null;};}function removeEntity(_0x430de8,_0x44e919){return function(_0x308762){if(_0x308762){return _0x308762['destroy']()['then'](function(){var _0x3f8259=_0x308762[_0x2815('0x2b')]({'plain':!![]});var _0x4d484d=_0x2815('0x2c');return db[_0x2815('0x2d')][_0x2815('0x2e')]({'where':{'type':_0x4d484d,'resourceId':_0x3f8259['id']}})[_0x2815('0x2a')](function(){return _0x308762;});})[_0x2815('0x2a')](function(){_0x430de8[_0x2815('0x1f')](0xcc)[_0x2815('0x2f')]();});}};}function handleEntityNotFound(_0x34c997,_0x1f6414){return function(_0x2cbe8e){if(!_0x2cbe8e){_0x34c997['sendStatus'](0x194);}return _0x2cbe8e;};}function handleError(_0x3d18eb,_0x40b880){_0x40b880=_0x40b880||0x1f4;return function(_0x49b519){logger['error'](_0x49b519[_0x2815('0x30')]);if(_0x49b519[_0x2815('0x31')]){delete _0x49b519[_0x2815('0x31')];}_0x3d18eb[_0x2815('0x1f')](_0x40b880)['send'](_0x49b519);};}exports[_0x2815('0x32')]=function(_0x47a2d6,_0x1ea14e){var _0x3e89b8={},_0x57f8db={},_0x384c21={'count':0x0,'rows':[]};var _0x2200dc=_['map'](db['CmContactHasItem'][_0x2815('0x33')],function(_0x591a06){return{'name':_0x591a06[_0x2815('0x34')],'type':_0x591a06['type'][_0x2815('0x35')]};});_0x57f8db['model']=_[_0x2815('0x36')](_0x2200dc,_0x2815('0x31'));_0x57f8db[_0x2815('0x37')]=_[_0x2815('0x38')](_0x47a2d6[_0x2815('0x37')]);_0x57f8db[_0x2815('0x39')]=_[_0x2815('0x3a')](_0x57f8db[_0x2815('0x3b')],_0x57f8db[_0x2815('0x37')]);_0x3e89b8[_0x2815('0x3c')]=_[_0x2815('0x3a')](_0x57f8db[_0x2815('0x3b')],qs[_0x2815('0x3d')](_0x47a2d6[_0x2815('0x37')][_0x2815('0x3d')]));_0x3e89b8[_0x2815('0x3c')]=_0x3e89b8[_0x2815('0x3c')][_0x2815('0x3e')]?_0x3e89b8[_0x2815('0x3c')]:_0x57f8db[_0x2815('0x3b')];if(!_0x47a2d6[_0x2815('0x37')]['hasOwnProperty'](_0x2815('0x3f'))){_0x3e89b8['limit']=qs[_0x2815('0x24')](_0x47a2d6[_0x2815('0x37')][_0x2815('0x24')]);_0x3e89b8[_0x2815('0x21')]=qs[_0x2815('0x21')](_0x47a2d6['query'][_0x2815('0x21')]);}_0x3e89b8[_0x2815('0x40')]=qs[_0x2815('0x41')](_0x47a2d6[_0x2815('0x37')]['sort']);_0x3e89b8[_0x2815('0x42')]=qs[_0x2815('0x39')](_[_0x2815('0x43')](_0x47a2d6[_0x2815('0x37')],_0x57f8db[_0x2815('0x39')]),_0x2200dc);if(_0x47a2d6[_0x2815('0x37')][_0x2815('0x44')]){_0x3e89b8['where']=_['merge'](_0x3e89b8[_0x2815('0x42')],{'$or':_[_0x2815('0x36')](_0x2200dc,function(_0xf49b02){if(_0xf49b02[_0x2815('0x45')]!==_0x2815('0x46')){var _0x59a71a={};_0x59a71a[_0xf49b02[_0x2815('0x31')]]={'$like':'%'+_0x47a2d6[_0x2815('0x37')][_0x2815('0x44')]+'%'};return _0x59a71a;}})});}_0x3e89b8=_['merge']({},_0x3e89b8,_0x47a2d6[_0x2815('0x47')]);var _0x39fbb5={'where':_0x3e89b8[_0x2815('0x42')]};return db[_0x2815('0x48')]['count'](_0x39fbb5)[_0x2815('0x2a')](function(_0x26e4c6){_0x384c21[_0x2815('0x23')]=_0x26e4c6;if(_0x47a2d6[_0x2815('0x37')][_0x2815('0x49')]){_0x3e89b8[_0x2815('0x4a')]=[{'all':!![]}];}return db[_0x2815('0x48')][_0x2815('0x4b')](_0x3e89b8);})['then'](function(_0x436289){_0x384c21[_0x2815('0x4c')]=_0x436289;return _0x384c21;})[_0x2815('0x2a')](respondWithFilteredResult(_0x1ea14e,_0x3e89b8))[_0x2815('0x4d')](handleError(_0x1ea14e,null));};exports[_0x2815('0x4e')]=function(_0x43984e,_0x1cb590){var _0x218ed6={'raw':!![],'where':{'id':_0x43984e[_0x2815('0x4f')]['id']}},_0x4572b7={};_0x4572b7[_0x2815('0x3b')]=_[_0x2815('0x38')](db[_0x2815('0x48')][_0x2815('0x33')]);_0x4572b7['query']=_[_0x2815('0x38')](_0x43984e[_0x2815('0x37')]);_0x4572b7[_0x2815('0x39')]=_[_0x2815('0x3a')](_0x4572b7[_0x2815('0x3b')],_0x4572b7[_0x2815('0x37')]);_0x218ed6[_0x2815('0x3c')]=_[_0x2815('0x3a')](_0x4572b7[_0x2815('0x3b')],qs[_0x2815('0x3d')](_0x43984e[_0x2815('0x37')][_0x2815('0x3d')]));_0x218ed6['attributes']=_0x218ed6['attributes'][_0x2815('0x3e')]?_0x218ed6[_0x2815('0x3c')]:_0x4572b7[_0x2815('0x3b')];if(_0x43984e['query']['includeAll']){_0x218ed6[_0x2815('0x4a')]=[{'all':!![]}];}_0x218ed6=_[_0x2815('0x50')]({},_0x218ed6,_0x43984e[_0x2815('0x47')]);return db[_0x2815('0x48')]['find'](_0x218ed6)[_0x2815('0x2a')](handleEntityNotFound(_0x1cb590,null))[_0x2815('0x2a')](respondWithResult(_0x1cb590,null))[_0x2815('0x4d')](handleError(_0x1cb590,null));};exports[_0x2815('0x51')]=function(_0x535f1f,_0x230620){return db[_0x2815('0x48')]['create'](_0x535f1f[_0x2815('0x52')],{})[_0x2815('0x2a')](function(_0x289844){var _0x465766=_0x535f1f[_0x2815('0x53')][_0x2815('0x2b')]({'plain':!![]});if(!_0x465766)throw new Error(_0x2815('0x54'));if(_0x465766['role']==='user'){var _0x847f86=_0x289844['get']({'plain':!![]});var _0x6c1c0=_0x2815('0x2c');return db[_0x2815('0x55')][_0x2815('0x56')]({'where':{'name':_0x6c1c0,'userProfileId':_0x465766[_0x2815('0x57')]},'raw':!![]})['then'](function(_0xb8c878){if(_0xb8c878&&_0xb8c878['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x847f86[_0x2815('0x31')],'resourceId':_0x847f86['id'],'type':_0xb8c878['name'],'sectionId':_0xb8c878['id']},{})[_0x2815('0x2a')](function(){return _0x289844;});}else{return _0x289844;}})[_0x2815('0x4d')](function(_0x57a801){logger[_0x2815('0x58')](_0x2815('0x59'),_0x57a801);throw _0x57a801;});}return _0x289844;})[_0x2815('0x2a')](respondWithResult(_0x230620,0xc9))[_0x2815('0x4d')](handleError(_0x230620,null));};exports[_0x2815('0x29')]=function(_0x16c3e5,_0x4dfa31){if(_0x16c3e5[_0x2815('0x52')]['id']){delete _0x16c3e5[_0x2815('0x52')]['id'];}return db[_0x2815('0x48')][_0x2815('0x56')]({'where':{'id':_0x16c3e5[_0x2815('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4dfa31,null))[_0x2815('0x2a')](saveUpdates(_0x16c3e5[_0x2815('0x52')],null))[_0x2815('0x2a')](respondWithResult(_0x4dfa31,null))['catch'](handleError(_0x4dfa31,null));};exports[_0x2815('0x2e')]=function(_0x403d63,_0x22724c){return db[_0x2815('0x48')][_0x2815('0x56')]({'where':{'id':_0x403d63[_0x2815('0x4f')]['id']}})['then'](handleEntityNotFound(_0x22724c,null))[_0x2815('0x2a')](removeEntity(_0x22724c,null))[_0x2815('0x4d')](handleError(_0x22724c,null));}; \ No newline at end of file +var _0x0401=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','then','UserProfileResource','end','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','VIRTUAL','filter','options','CmContactHasItem','includeAll','include','findAll','catch','show','params','rawAttributes','merge','create','get','role','user','CmContactHasItems','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2540db,_0x9b7318){var _0xbf6e9f=function(_0x5be1c6){while(--_0x5be1c6){_0x2540db['push'](_0x2540db['shift']());}};_0xbf6e9f(++_0x9b7318);}(_0x0401,0xeb));var _0x1040=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x0401[_0x31a371];return _0x2a5bd6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1040('0x0'));var zipdir=require(_0x1040('0x1'));var jsonpatch=require(_0x1040('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1040('0x3'));var Mustache=require(_0x1040('0x4'));var util=require(_0x1040('0x5'));var path=require(_0x1040('0x6'));var sox=require(_0x1040('0x7'));var csv=require(_0x1040('0x8'));var ejs=require(_0x1040('0x9'));var fs=require('fs');var fs_extra=require(_0x1040('0xa'));var _=require(_0x1040('0xb'));var squel=require(_0x1040('0xc'));var crypto=require(_0x1040('0xd'));var jsforce=require(_0x1040('0xe'));var deskjs=require(_0x1040('0xf'));var toCsv=require(_0x1040('0x8'));var querystring=require(_0x1040('0x10'));var Papa=require(_0x1040('0x11'));var Redis=require(_0x1040('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1040('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1040('0x14'));var logger=require(_0x1040('0x15'))(_0x1040('0x16'));var utils=require(_0x1040('0x17'));var config=require(_0x1040('0x18'));var licenseUtil=require(_0x1040('0x19'));var db=require(_0x1040('0x1a'))['db'];function respondWithStatusCode(_0x336480,_0x2ea8cf){_0x2ea8cf=_0x2ea8cf||0xcc;return function(_0x183976){if(_0x183976){return _0x336480[_0x1040('0x1b')](_0x2ea8cf);}return _0x336480[_0x1040('0x1c')](_0x2ea8cf)['end']();};}function respondWithResult(_0x51cb8b,_0x1babc8){_0x1babc8=_0x1babc8||0xc8;return function(_0x2fadb5){if(_0x2fadb5){return _0x51cb8b[_0x1040('0x1c')](_0x1babc8)[_0x1040('0x1d')](_0x2fadb5);}};}function respondWithFilteredResult(_0x25fd79,_0x371c88){return function(_0x455f87){if(_0x455f87){var _0x2e743a=typeof _0x371c88['offset']===_0x1040('0x1e')&&typeof _0x371c88[_0x1040('0x1f')]===_0x1040('0x1e');var _0x553ce9=_0x455f87[_0x1040('0x20')];var _0x1ff3bf=_0x2e743a?0x0:_0x371c88[_0x1040('0x21')];var _0x2fa01a=_0x2e743a?_0x455f87[_0x1040('0x20')]:_0x371c88[_0x1040('0x21')]+_0x371c88[_0x1040('0x1f')];var _0x5bfb34;if(_0x2fa01a>=_0x553ce9){_0x2fa01a=_0x553ce9;_0x5bfb34=0xc8;}else{_0x5bfb34=0xce;}_0x25fd79[_0x1040('0x1c')](_0x5bfb34);return _0x25fd79['set'](_0x1040('0x22'),_0x1ff3bf+'-'+_0x2fa01a+'/'+_0x553ce9)['json'](_0x455f87);}return null;};}function patchUpdates(_0x1ed96b){return function(_0x2a2848){try{jsonpatch[_0x1040('0x23')](_0x2a2848,_0x1ed96b,!![]);}catch(_0x1b16e2){return BPromise['reject'](_0x1b16e2);}return _0x2a2848[_0x1040('0x24')]();};}function saveUpdates(_0x4b031b,_0xbce0cc){return function(_0x5787cb){if(_0x5787cb){return _0x5787cb[_0x1040('0x25')](_0x4b031b)['then'](function(_0x30787e){return _0x30787e;});}return null;};}function removeEntity(_0x7e0458,_0x392e19){return function(_0x49773d){if(_0x49773d){return _0x49773d[_0x1040('0x26')]()[_0x1040('0x27')](function(){var _0x5d0b71=_0x49773d['get']({'plain':!![]});var _0x14423f='CmContactHasItems';return db[_0x1040('0x28')][_0x1040('0x26')]({'where':{'type':_0x14423f,'resourceId':_0x5d0b71['id']}})['then'](function(){return _0x49773d;});})[_0x1040('0x27')](function(){_0x7e0458[_0x1040('0x1c')](0xcc)[_0x1040('0x29')]();});}};}function handleEntityNotFound(_0x433e02,_0x4b4717){return function(_0x1158e8){if(!_0x1158e8){_0x433e02[_0x1040('0x1b')](0x194);}return _0x1158e8;};}function handleError(_0x2013d8,_0x5c5b1d){_0x5c5b1d=_0x5c5b1d||0x1f4;return function(_0x3724af){logger['error'](_0x3724af[_0x1040('0x2a')]);if(_0x3724af[_0x1040('0x2b')]){delete _0x3724af['name'];}_0x2013d8[_0x1040('0x1c')](_0x5c5b1d)[_0x1040('0x2c')](_0x3724af);};}exports['index']=function(_0x2da720,_0x209f66){var _0xc4494c={},_0x383e4a={},_0x56e77e={'count':0x0,'rows':[]};var _0x288c5a=_[_0x1040('0x2d')](db['CmContactHasItem']['rawAttributes'],function(_0x2c23ff){return{'name':_0x2c23ff[_0x1040('0x2e')],'type':_0x2c23ff[_0x1040('0x2f')][_0x1040('0x30')]};});_0x383e4a[_0x1040('0x31')]=_[_0x1040('0x2d')](_0x288c5a,_0x1040('0x2b'));_0x383e4a[_0x1040('0x32')]=_[_0x1040('0x33')](_0x2da720[_0x1040('0x32')]);_0x383e4a[_0x1040('0x34')]=_[_0x1040('0x35')](_0x383e4a[_0x1040('0x31')],_0x383e4a['query']);_0xc4494c['attributes']=_[_0x1040('0x35')](_0x383e4a['model'],qs[_0x1040('0x36')](_0x2da720['query'][_0x1040('0x36')]));_0xc4494c[_0x1040('0x37')]=_0xc4494c[_0x1040('0x37')][_0x1040('0x38')]?_0xc4494c['attributes']:_0x383e4a[_0x1040('0x31')];if(!_0x2da720[_0x1040('0x32')]['hasOwnProperty']('nolimit')){_0xc4494c['limit']=qs[_0x1040('0x1f')](_0x2da720[_0x1040('0x32')][_0x1040('0x1f')]);_0xc4494c['offset']=qs[_0x1040('0x21')](_0x2da720[_0x1040('0x32')][_0x1040('0x21')]);}_0xc4494c[_0x1040('0x39')]=qs[_0x1040('0x3a')](_0x2da720[_0x1040('0x32')][_0x1040('0x3a')]);_0xc4494c[_0x1040('0x3b')]=qs[_0x1040('0x34')](_['pick'](_0x2da720[_0x1040('0x32')],_0x383e4a['filters']),_0x288c5a);if(_0x2da720[_0x1040('0x32')]['filter']){_0xc4494c[_0x1040('0x3b')]=_['merge'](_0xc4494c['where'],{'$or':_['map'](_0x288c5a,function(_0x1314ca){if(_0x1314ca[_0x1040('0x2f')]!==_0x1040('0x3c')){var _0x114fe1={};_0x114fe1[_0x1314ca[_0x1040('0x2b')]]={'$like':'%'+_0x2da720[_0x1040('0x32')][_0x1040('0x3d')]+'%'};return _0x114fe1;}})});}_0xc4494c=_['merge']({},_0xc4494c,_0x2da720[_0x1040('0x3e')]);var _0x10650a={'where':_0xc4494c[_0x1040('0x3b')]};return db[_0x1040('0x3f')]['count'](_0x10650a)['then'](function(_0x1a8ec6){_0x56e77e[_0x1040('0x20')]=_0x1a8ec6;if(_0x2da720[_0x1040('0x32')][_0x1040('0x40')]){_0xc4494c[_0x1040('0x41')]=[{'all':!![]}];}return db[_0x1040('0x3f')][_0x1040('0x42')](_0xc4494c);})[_0x1040('0x27')](function(_0x51bcb6){_0x56e77e['rows']=_0x51bcb6;return _0x56e77e;})[_0x1040('0x27')](respondWithFilteredResult(_0x209f66,_0xc4494c))[_0x1040('0x43')](handleError(_0x209f66,null));};exports[_0x1040('0x44')]=function(_0x1767ec,_0x2513af){var _0x125b9e={'raw':!![],'where':{'id':_0x1767ec[_0x1040('0x45')]['id']}},_0x2b6d33={};_0x2b6d33[_0x1040('0x31')]=_['keys'](db[_0x1040('0x3f')][_0x1040('0x46')]);_0x2b6d33[_0x1040('0x32')]=_[_0x1040('0x33')](_0x1767ec[_0x1040('0x32')]);_0x2b6d33['filters']=_['intersection'](_0x2b6d33['model'],_0x2b6d33[_0x1040('0x32')]);_0x125b9e[_0x1040('0x37')]=_[_0x1040('0x35')](_0x2b6d33[_0x1040('0x31')],qs[_0x1040('0x36')](_0x1767ec[_0x1040('0x32')][_0x1040('0x36')]));_0x125b9e[_0x1040('0x37')]=_0x125b9e[_0x1040('0x37')][_0x1040('0x38')]?_0x125b9e[_0x1040('0x37')]:_0x2b6d33[_0x1040('0x31')];if(_0x1767ec['query'][_0x1040('0x40')]){_0x125b9e[_0x1040('0x41')]=[{'all':!![]}];}_0x125b9e=_[_0x1040('0x47')]({},_0x125b9e,_0x1767ec['options']);return db[_0x1040('0x3f')]['find'](_0x125b9e)['then'](handleEntityNotFound(_0x2513af,null))[_0x1040('0x27')](respondWithResult(_0x2513af,null))[_0x1040('0x43')](handleError(_0x2513af,null));};exports[_0x1040('0x48')]=function(_0x521fd9,_0x193a64){return db[_0x1040('0x3f')]['create'](_0x521fd9['body'],{})[_0x1040('0x27')](function(_0x59a9eb){var _0x3d3fb3=_0x521fd9['user'][_0x1040('0x49')]({'plain':!![]});if(!_0x3d3fb3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d3fb3[_0x1040('0x4a')]===_0x1040('0x4b')){var _0x5d1cfb=_0x59a9eb[_0x1040('0x49')]({'plain':!![]});var _0x1cf180=_0x1040('0x4c');return db[_0x1040('0x4d')][_0x1040('0x4e')]({'where':{'name':_0x1cf180,'userProfileId':_0x3d3fb3[_0x1040('0x4f')]},'raw':!![]})[_0x1040('0x27')](function(_0x45e18a){if(_0x45e18a&&_0x45e18a[_0x1040('0x50')]===0x0){return db[_0x1040('0x28')][_0x1040('0x48')]({'name':_0x5d1cfb[_0x1040('0x2b')],'resourceId':_0x5d1cfb['id'],'type':_0x45e18a[_0x1040('0x2b')],'sectionId':_0x45e18a['id']},{})['then'](function(){return _0x59a9eb;});}else{return _0x59a9eb;}})['catch'](function(_0x2e96c1){logger['error'](_0x1040('0x51'),_0x2e96c1);throw _0x2e96c1;});}return _0x59a9eb;})['then'](respondWithResult(_0x193a64,0xc9))[_0x1040('0x43')](handleError(_0x193a64,null));};exports[_0x1040('0x25')]=function(_0x1cf5ad,_0x939444){if(_0x1cf5ad[_0x1040('0x52')]['id']){delete _0x1cf5ad[_0x1040('0x52')]['id'];}return db[_0x1040('0x3f')][_0x1040('0x4e')]({'where':{'id':_0x1cf5ad[_0x1040('0x45')]['id']}})[_0x1040('0x27')](handleEntityNotFound(_0x939444,null))['then'](saveUpdates(_0x1cf5ad[_0x1040('0x52')],null))[_0x1040('0x27')](respondWithResult(_0x939444,null))[_0x1040('0x43')](handleError(_0x939444,null));};exports[_0x1040('0x26')]=function(_0x15f78c,_0xbab59e){return db[_0x1040('0x3f')][_0x1040('0x4e')]({'where':{'id':_0x15f78c[_0x1040('0x45')]['id']}})[_0x1040('0x27')](handleEntityNotFound(_0xbab59e,null))[_0x1040('0x27')](removeEntity(_0xbab59e,null))[_0x1040('0x43')](handleError(_0xbab59e,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index ac31a37..88ff702 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 _0x77b7=['define','CmContactHasItem','cm_contact_has_items','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x77b7,0xb7));var _0x777b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x77b7[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x777b('0x0'));var logger=require(_0x777b('0x1'))(_0x777b('0x2'));var moment=require(_0x777b('0x3'));var BPromise=require(_0x777b('0x4'));var rp=require(_0x777b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x777b('0x6'));var config=require(_0x777b('0x7'));var attributes=require('./cmContactHasItem.attributes');module[_0x777b('0x8')]=function(_0x4afbec,_0x453152){return _0x4afbec[_0x777b('0x9')](_0x777b('0xa'),attributes,{'tableName':_0x777b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87ee=['CmContactHasItem','cm_contact_has_items','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x87ee,0x120));var _0xe87e=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x87ee[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0xe87e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe87e('0x1'));var BPromise=require(_0xe87e('0x2'));var rp=require(_0xe87e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe87e('0x4'));var config=require(_0xe87e('0x5'));var attributes=require(_0xe87e('0x6'));module[_0xe87e('0x7')]=function(_0x182f26,_0x434657){return _0x182f26[_0xe87e('0x8')](_0xe87e('0x9'),attributes,{'tableName':_0xe87e('0xa'),'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 9a2071c..e8fc18b 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 _0xf10f=['../../config/logger','rpc','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0xccc444,_0x4deaf1){var _0x369415=function(_0x5b6134){while(--_0x5b6134){_0xccc444['push'](_0xccc444['shift']());}};_0x369415(++_0x4deaf1);}(_0xf10f,0xeb));var _0xff10=function(_0x49bcb9,_0x14ee59){_0x49bcb9=_0x49bcb9-0x0;var _0x5e81c5=_0xf10f[_0x49bcb9];return _0x5e81c5;};'use strict';var _=require(_0xff10('0x0'));var util=require(_0xff10('0x1'));var moment=require('moment');var BPromise=require(_0xff10('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff10('0x3'))['db'];var utils=require(_0xff10('0x4'));var logger=require(_0xff10('0x5'))(_0xff10('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xff10('0x7')][_0xff10('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d536a,_0x5ef589,_0x293f94){return new BPromise(function(_0x3eeef9,_0x2a8b51){return client[_0xff10('0x9')](_0x4d536a,_0x293f94)['then'](function(_0x1e0567){logger[_0xff10('0xa')](_0xff10('0xb'),_0x5ef589,_0xff10('0xc'));logger[_0xff10('0xd')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x5ef589,_0xff10('0xc'),JSON[_0xff10('0xe')](_0x1e0567));if(_0x1e0567[_0xff10('0xf')]){if(_0x1e0567[_0xff10('0xf')][_0xff10('0x10')]===0x1f4){logger[_0xff10('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x5ef589,_0x1e0567[_0xff10('0xf')]['message']);return _0x2a8b51(_0x1e0567[_0xff10('0xf')][_0xff10('0x11')]);}logger[_0xff10('0xf')](_0xff10('0xb'),_0x5ef589,_0x1e0567[_0xff10('0xf')][_0xff10('0x11')]);return _0x3eeef9(_0x1e0567[_0xff10('0xf')][_0xff10('0x11')]);}else{logger[_0xff10('0xa')](_0xff10('0xb'),_0x5ef589,_0xff10('0xc'));_0x3eeef9(_0x1e0567[_0xff10('0x12')][_0xff10('0x11')]);}})[_0xff10('0x13')](function(_0x51f29e){logger[_0xff10('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x5ef589,_0x51f29e);_0x2a8b51(_0x51f29e);});});} \ No newline at end of file +var _0x4c59=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x3b0f37,_0x4d9eb6){var _0x479d5e=function(_0x35fbcb){while(--_0x35fbcb){_0x3b0f37['push'](_0x3b0f37['shift']());}};_0x479d5e(++_0x4d9eb6);}(_0x4c59,0x14c));var _0x94c5=function(_0x16bc92,_0x1b0935){_0x16bc92=_0x16bc92-0x0;var _0x27a2d2=_0x4c59[_0x16bc92];return _0x27a2d2;};'use strict';var _=require(_0x94c5('0x0'));var util=require(_0x94c5('0x1'));var moment=require(_0x94c5('0x2'));var BPromise=require(_0x94c5('0x3'));var rs=require(_0x94c5('0x4'));var fs=require('fs');var Redis=require(_0x94c5('0x5'));var db=require(_0x94c5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x94c5('0x7'))(_0x94c5('0x8'));var config=require(_0x94c5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x94c5('0xa')][_0x94c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x187b1a,_0xa348f2,_0xb68e80){return new BPromise(function(_0x30a483,_0x3b6441){return client['request'](_0x187b1a,_0xb68e80)['then'](function(_0x340f00){logger[_0x94c5('0xc')](_0x94c5('0xd'),_0xa348f2,_0x94c5('0xe'));logger[_0x94c5('0xf')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0xa348f2,_0x94c5('0xe'),JSON[_0x94c5('0x10')](_0x340f00));if(_0x340f00[_0x94c5('0x11')]){if(_0x340f00['error'][_0x94c5('0x12')]===0x1f4){logger[_0x94c5('0x11')](_0x94c5('0xd'),_0xa348f2,_0x340f00['error'][_0x94c5('0x13')]);return _0x3b6441(_0x340f00[_0x94c5('0x11')]['message']);}logger[_0x94c5('0x11')](_0x94c5('0xd'),_0xa348f2,_0x340f00[_0x94c5('0x11')]['message']);return _0x30a483(_0x340f00[_0x94c5('0x11')][_0x94c5('0x13')]);}else{logger[_0x94c5('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0xa348f2,_0x94c5('0xe'));_0x30a483(_0x340f00[_0x94c5('0x14')][_0x94c5('0x13')]);}})[_0x94c5('0x15')](function(_0x49591f){logger[_0x94c5('0x11')](_0x94c5('0xd'),_0xa348f2,_0x49591f);_0x3b6441(_0x49591f);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index f5dd3f6..0c69591 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 _0xc06a=['destroy','exports','util','path','connect-timeout','Router','fs-extra','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x2dc96f,_0x459058){var _0xd012da=function(_0x38d032){while(--_0x38d032){_0x2dc96f['push'](_0x2dc96f['shift']());}};_0xd012da(++_0x459058);}(_0xc06a,0x9a));var _0xac06=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc06a[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require(_0xac06('0x0'));var path=require(_0xac06('0x1'));var timeout=require(_0xac06('0x2'));var express=require('express');var router=express[_0xac06('0x3')]();var fs_extra=require(_0xac06('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac06('0x5'));var controller=require(_0xac06('0x6'));router[_0xac06('0x7')]('/',auth[_0xac06('0x8')](),controller[_0xac06('0x9')]);router[_0xac06('0x7')](_0xac06('0xa'),auth[_0xac06('0x8')](),controller[_0xac06('0xb')]);router[_0xac06('0xc')]('/',auth['isAuthenticated'](),controller[_0xac06('0xd')]);router[_0xac06('0xe')](_0xac06('0xa'),auth[_0xac06('0x8')](),controller[_0xac06('0xf')]);router[_0xac06('0x10')](_0xac06('0xa'),auth['isAuthenticated'](),controller[_0xac06('0x11')]);module[_0xac06('0x12')]=router; \ No newline at end of file +var _0xa8e2=['update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','create','put'];(function(_0x42058e,_0x1b8697){var _0x36e15a=function(_0x34bcb7){while(--_0x34bcb7){_0x42058e['push'](_0x42058e['shift']());}};_0x36e15a(++_0x1b8697);}(_0xa8e2,0xa6));var _0x2a8e=function(_0x908418,_0x2ef8d7){_0x908418=_0x908418-0x0;var _0x225095=_0xa8e2[_0x908418];return _0x225095;};'use strict';var multer=require('multer');var util=require(_0x2a8e('0x0'));var path=require(_0x2a8e('0x1'));var timeout=require(_0x2a8e('0x2'));var express=require(_0x2a8e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2a8e('0x4'));var interaction=require(_0x2a8e('0x5'));var config=require(_0x2a8e('0x6'));var controller=require(_0x2a8e('0x7'));router[_0x2a8e('0x8')]('/',auth[_0x2a8e('0x9')](),controller[_0x2a8e('0xa')]);router[_0x2a8e('0x8')](_0x2a8e('0xb'),auth[_0x2a8e('0x9')](),controller['show']);router['post']('/',auth[_0x2a8e('0x9')](),controller[_0x2a8e('0xc')]);router[_0x2a8e('0xd')](_0x2a8e('0xb'),auth['isAuthenticated'](),controller[_0x2a8e('0xe')]);router[_0x2a8e('0xf')]('/:id',auth[_0x2a8e('0x9')](),controller[_0x2a8e('0x10')]);module[_0x2a8e('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 68ce39c..545616e 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 _0xfc74=['alias','name','TEXT','long','type','parse','values','setDataValue','stringify','BOOLEAN','voice','lodash','VIRTUAL','getDataValue','STRING'];(function(_0xe74f80,_0xccec66){var _0x2585b8=function(_0x421474){while(--_0x421474){_0xe74f80['push'](_0xe74f80['shift']());}};_0x2585b8(++_0xccec66);}(_0xfc74,0x1dc));var _0x4fc7=function(_0x773e88,_0x3268e7){_0x773e88=_0x773e88-0x0;var _0x528134=_0xfc74[_0x773e88];return _0x528134;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4fc7('0x0'));module['exports']={'name':{'type':Sequelize[_0x4fc7('0x1')],'get':function(_0x16796a){return this[_0x4fc7('0x2')]('alias');}},'alias':{'type':Sequelize[_0x4fc7('0x3')],'allowNull':![],'set':function(_0x2c00f1){this['setDataValue'](_0x4fc7('0x4'),_0x2c00f1?_0x2c00f1:this[_0x4fc7('0x2')](_0x4fc7('0x5')));}},'type':{'type':Sequelize[_0x4fc7('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x4fc7('0x6')](_0x4fc7('0x7')),'get':function(){if(this[_0x4fc7('0x2')](_0x4fc7('0x8'))==='select'){return JSON[_0x4fc7('0x9')](this['getDataValue'](_0x4fc7('0xa')));}else{return this[_0x4fc7('0x2')](_0x4fc7('0xa'));}},'set':function(_0xeb540b){if(Array['isArray'](_0xeb540b)){this[_0x4fc7('0xb')](_0x4fc7('0xa'),JSON[_0x4fc7('0xc')](_0xeb540b));}else{this[_0x4fc7('0xb')]('values',_0xeb540b);}}},'required':{'type':Sequelize[_0x4fc7('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x4fc7('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x4fc7('0xe'))}}; \ No newline at end of file +var _0x1b98=['values','isArray','stringify','BOOLEAN','voice','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','TEXT','long','type','select','parse'];(function(_0x3f6c29,_0x370d86){var _0x4af959=function(_0x263612){while(--_0x263612){_0x3f6c29['push'](_0x3f6c29['shift']());}};_0x4af959(++_0x370d86);}(_0x1b98,0x95));var _0x81b9=function(_0x114586,_0x1f844b){_0x114586=_0x114586-0x0;var _0xe1cfd=_0x1b98[_0x114586];return _0xe1cfd;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x81b9('0x0')]={'name':{'type':Sequelize[_0x81b9('0x1')],'get':function(_0x1766a4){return this[_0x81b9('0x2')]('alias');}},'alias':{'type':Sequelize[_0x81b9('0x3')],'allowNull':![],'set':function(_0x11fc57){this[_0x81b9('0x4')](_0x81b9('0x5'),_0x11fc57?_0x11fc57:this[_0x81b9('0x2')]('name'));}},'type':{'type':Sequelize[_0x81b9('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x81b9('0x6')](_0x81b9('0x7')),'get':function(){if(this['getDataValue'](_0x81b9('0x8'))===_0x81b9('0x9')){return JSON[_0x81b9('0xa')](this['getDataValue'](_0x81b9('0xb')));}else{return this[_0x81b9('0x2')]('values');}},'set':function(_0x12bbc1){if(Array[_0x81b9('0xc')](_0x12bbc1)){this['setDataValue'](_0x81b9('0xb'),JSON[_0x81b9('0xd')](_0x12bbc1));}else{this['setDataValue']('values',_0x12bbc1);}}},'required':{'type':Sequelize[_0x81b9('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x81b9('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x81b9('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index f1dfc76..0b0afe3 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 _0x53a1=['keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','rows','catch','show','params','fields','options','find','body','create','sequelize','Sequelize','text','number','INTEGER','BOOLEAN','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','map','CmCustomField','rawAttributes','fieldName','type','key','query'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0x53a1,0x1c2));var _0x153a=function(_0x9f721,_0x14bcc5){_0x9f721=_0x9f721-0x0;var _0x20052d=_0x53a1[_0x9f721];return _0x20052d;};'use strict';var emlformat=require(_0x153a('0x0'));var rimraf=require(_0x153a('0x1'));var zipdir=require(_0x153a('0x2'));var jsonpatch=require(_0x153a('0x3'));var rp=require(_0x153a('0x4'));var moment=require('moment');var BPromise=require(_0x153a('0x5'));var Mustache=require(_0x153a('0x6'));var util=require(_0x153a('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x153a('0x8'));var fs=require('fs');var fs_extra=require(_0x153a('0x9'));var _=require('lodash');var squel=require(_0x153a('0xa'));var crypto=require(_0x153a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x153a('0xc'));var toCsv=require(_0x153a('0xd'));var querystring=require(_0x153a('0xe'));var Papa=require('papaparse');var Redis=require(_0x153a('0xf'));var authService=require(_0x153a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x153a('0x11'));var hardwareService=require(_0x153a('0x12'));var logger=require(_0x153a('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x153a('0x14'));var db=require(_0x153a('0x15'))['db'];function respondWithStatusCode(_0x52cc71,_0x2df499){_0x2df499=_0x2df499||0xcc;return function(_0x43a749){if(_0x43a749){return _0x52cc71[_0x153a('0x16')](_0x2df499);}return _0x52cc71[_0x153a('0x17')](_0x2df499)[_0x153a('0x18')]();};}function respondWithResult(_0x3341dc,_0x377145){_0x377145=_0x377145||0xc8;return function(_0x56543c){if(_0x56543c){return _0x3341dc[_0x153a('0x17')](_0x377145)[_0x153a('0x19')](_0x56543c);}};}function respondWithFilteredResult(_0x444820,_0x86ccbe){return function(_0x157621){if(_0x157621){var _0x4960df=typeof _0x86ccbe[_0x153a('0x1a')]===_0x153a('0x1b')&&typeof _0x86ccbe[_0x153a('0x1c')]===_0x153a('0x1b');var _0x3e0685=_0x157621[_0x153a('0x1d')];var _0x5388bd=_0x4960df?0x0:_0x86ccbe[_0x153a('0x1a')];var _0x4dad06=_0x4960df?_0x157621[_0x153a('0x1d')]:_0x86ccbe[_0x153a('0x1a')]+_0x86ccbe[_0x153a('0x1c')];var _0x3d5626;if(_0x4dad06>=_0x3e0685){_0x4dad06=_0x3e0685;_0x3d5626=0xc8;}else{_0x3d5626=0xce;}_0x444820['status'](_0x3d5626);return _0x444820[_0x153a('0x1e')](_0x153a('0x1f'),_0x5388bd+'-'+_0x4dad06+'/'+_0x3e0685)['json'](_0x157621);}return null;};}function patchUpdates(_0x22758e){return function(_0x4cabc0){try{jsonpatch[_0x153a('0x20')](_0x4cabc0,_0x22758e,!![]);}catch(_0x28a1f0){return BPromise[_0x153a('0x21')](_0x28a1f0);}return _0x4cabc0[_0x153a('0x22')]();};}function saveUpdates(_0xe55d76,_0x3ed87e){return function(_0x4fb1f3){if(_0x4fb1f3){return _0x4fb1f3[_0x153a('0x23')](_0xe55d76)['then'](function(_0x755b0e){return _0x755b0e;});}return null;};}function removeEntity(_0x25c56b,_0x2012c0){return function(_0x246bcb){if(_0x246bcb){return _0x246bcb[_0x153a('0x24')]()[_0x153a('0x25')](function(){_0x25c56b[_0x153a('0x17')](0xcc)[_0x153a('0x18')]();});}};}function handleEntityNotFound(_0x3407d2,_0x5ef2c4){return function(_0x4ca557){if(!_0x4ca557){_0x3407d2[_0x153a('0x16')](0x194);}return _0x4ca557;};}function handleError(_0x2967ce,_0x2a35aa){_0x2a35aa=_0x2a35aa||0x1f4;return function(_0x5574ae){logger[_0x153a('0x26')](_0x5574ae['stack']);if(_0x5574ae[_0x153a('0x27')]){delete _0x5574ae[_0x153a('0x27')];}_0x2967ce[_0x153a('0x17')](_0x2a35aa)['send'](_0x5574ae);};}exports[_0x153a('0x28')]=function(_0x199b32,_0x42f69d){var _0x18d00a={},_0x160cd2={},_0x48c5aa={'count':0x0,'rows':[]};var _0xfa0c8c=_[_0x153a('0x29')](db[_0x153a('0x2a')][_0x153a('0x2b')],function(_0x2f6a2a){return{'name':_0x2f6a2a[_0x153a('0x2c')],'type':_0x2f6a2a[_0x153a('0x2d')][_0x153a('0x2e')]};});_0x160cd2['model']=_['differenceBy'](_['map'](_0xfa0c8c,_0x153a('0x27')),[_0x153a('0x27')]);_0x160cd2[_0x153a('0x2f')]=_[_0x153a('0x30')](_0x199b32[_0x153a('0x2f')]);_0x160cd2[_0x153a('0x31')]=_[_0x153a('0x32')](_0x160cd2[_0x153a('0x33')],_0x160cd2[_0x153a('0x2f')]);_0x18d00a[_0x153a('0x34')]=_[_0x153a('0x32')](_0x160cd2[_0x153a('0x33')],qs['fields'](_0x199b32[_0x153a('0x2f')]['fields']));_0x18d00a[_0x153a('0x34')]=_0x18d00a['attributes'][_0x153a('0x35')]?_0x18d00a[_0x153a('0x34')]:_0x160cd2[_0x153a('0x33')];if(!_0x199b32[_0x153a('0x2f')][_0x153a('0x36')](_0x153a('0x37'))){_0x18d00a[_0x153a('0x1c')]=qs['limit'](_0x199b32['query'][_0x153a('0x1c')]);_0x18d00a[_0x153a('0x1a')]=qs[_0x153a('0x1a')](_0x199b32['query'][_0x153a('0x1a')]);}_0x18d00a[_0x153a('0x38')]=qs[_0x153a('0x39')](_0x199b32['query']['sort']);_0x18d00a['where']=qs[_0x153a('0x31')](_[_0x153a('0x3a')](_0x199b32[_0x153a('0x2f')],_0x160cd2[_0x153a('0x31')]),_0xfa0c8c);if(_0x199b32[_0x153a('0x2f')][_0x153a('0x3b')]){_0x18d00a[_0x153a('0x3c')]=_[_0x153a('0x3d')](_0x18d00a[_0x153a('0x3c')],{'$or':_[_0x153a('0x29')](_0xfa0c8c,function(_0x116807){if(_0x116807[_0x153a('0x2d')]!=='VIRTUAL'){var _0x4b6531={};_0x4b6531[_0x116807[_0x153a('0x27')]]={'$like':'%'+_0x199b32[_0x153a('0x2f')][_0x153a('0x3b')]+'%'};return _0x4b6531;}})});}_0x18d00a=_[_0x153a('0x3d')]({},_0x18d00a,_0x199b32['options']);var _0x595fd6={'where':_0x18d00a[_0x153a('0x3c')]};return db['CmCustomField']['count'](_0x595fd6)[_0x153a('0x25')](function(_0x446d57){_0x48c5aa[_0x153a('0x1d')]=_0x446d57;if(_0x199b32[_0x153a('0x2f')][_0x153a('0x3e')]){_0x18d00a[_0x153a('0x3f')]=[{'all':!![]}];}return db[_0x153a('0x2a')]['findAll'](_0x18d00a);})[_0x153a('0x25')](function(_0xf9aa6f){_0x48c5aa[_0x153a('0x40')]=_0xf9aa6f;return _0x48c5aa;})[_0x153a('0x25')](respondWithFilteredResult(_0x42f69d,_0x18d00a))[_0x153a('0x41')](handleError(_0x42f69d,null));};exports[_0x153a('0x42')]=function(_0x33da2a,_0x2b5d95){var _0x5e0e90={'raw':!![],'where':{'id':_0x33da2a[_0x153a('0x43')]['id']}},_0x2bf20b={};_0x2bf20b['model']=_[_0x153a('0x30')](db['CmCustomField'][_0x153a('0x2b')]);_0x2bf20b['query']=_[_0x153a('0x30')](_0x33da2a[_0x153a('0x2f')]);_0x2bf20b[_0x153a('0x31')]=_[_0x153a('0x32')](_0x2bf20b[_0x153a('0x33')],_0x2bf20b[_0x153a('0x2f')]);_0x5e0e90[_0x153a('0x34')]=_[_0x153a('0x32')](_0x2bf20b[_0x153a('0x33')],qs['fields'](_0x33da2a[_0x153a('0x2f')][_0x153a('0x44')]));_0x5e0e90[_0x153a('0x34')]=_0x5e0e90[_0x153a('0x34')][_0x153a('0x35')]?_0x5e0e90[_0x153a('0x34')]:_0x2bf20b[_0x153a('0x33')];if(_0x33da2a[_0x153a('0x2f')][_0x153a('0x3e')]){_0x5e0e90[_0x153a('0x3f')]=[{'all':!![]}];}_0x5e0e90=_[_0x153a('0x3d')]({},_0x5e0e90,_0x33da2a[_0x153a('0x45')]);return db[_0x153a('0x2a')][_0x153a('0x46')](_0x5e0e90)[_0x153a('0x25')](handleEntityNotFound(_0x2b5d95,null))[_0x153a('0x25')](respondWithResult(_0x2b5d95,null))[_0x153a('0x41')](handleError(_0x2b5d95,null));};exports['update']=function(_0x45ad22,_0x2e5a02){if(_0x45ad22[_0x153a('0x47')]['id']){delete _0x45ad22[_0x153a('0x47')]['id'];}return db[_0x153a('0x2a')]['find']({'where':{'id':_0x45ad22['params']['id']}})[_0x153a('0x25')](handleEntityNotFound(_0x2e5a02,null))['then'](saveUpdates(_0x45ad22[_0x153a('0x47')],null))[_0x153a('0x25')](respondWithResult(_0x2e5a02,null))[_0x153a('0x41')](handleError(_0x2e5a02,null));};exports[_0x153a('0x24')]=function(_0x2c0dd7,_0x1568c3){return db[_0x153a('0x2a')][_0x153a('0x46')]({'where':{'id':_0x2c0dd7[_0x153a('0x43')]['id']}})[_0x153a('0x25')](handleEntityNotFound(_0x1568c3,null))['then'](removeEntity(_0x1568c3,null))['catch'](handleError(_0x1568c3,null));};exports[_0x153a('0x48')]=function(_0x3da7d9,_0x57ed29){var _0x5c967c;return db[_0x153a('0x49')]['transaction'](function(_0xb47fbb){return db[_0x153a('0x2a')][_0x153a('0x48')](_0x3da7d9[_0x153a('0x47')],{'transaction':_0xb47fbb})['then'](function(_0x30b012){_0x5c967c=_0x30b012;var _0x2a11e6={'type':db[_0x153a('0x4a')]['TEXT'],'transaction':_0xb47fbb};switch(_0x3da7d9['body'][_0x153a('0x2d')]){case _0x153a('0x4b'):_0x2a11e6[_0x153a('0x2d')]=db[_0x153a('0x4a')]['TEXT'];break;case _0x153a('0x4c'):_0x2a11e6[_0x153a('0x2d')]=db[_0x153a('0x4a')][_0x153a('0x4d')];break;case'switch':_0x2a11e6[_0x153a('0x2d')]=db[_0x153a('0x4a')][_0x153a('0x4e')];_0x2a11e6['defaultValue']=![];break;default:}return db[_0x153a('0x49')][_0x153a('0x4f')][_0x153a('0x50')]('cm_contacts',util[_0x153a('0x51')](_0x153a('0x52'),_0x5c967c['id']),_0x2a11e6);})['then'](function(){return _0x5c967c;});})[_0x153a('0x25')](respondWithResult(_0x57ed29,0xc9))['catch'](handleError(_0x57ed29,null));}; \ No newline at end of file +var _0xa7bb=['hasOwnProperty','nolimit','order','where','VIRTUAL','merge','options','includeAll','rows','catch','show','params','rawAttributes','include','find','body','sequelize','transaction','create','Sequelize','TEXT','text','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','map','CmCustomField','fieldName','type','key','keys','filters','intersection','model','attributes','fields','length','query'];(function(_0x3d8240,_0x2663d4){var _0x3d0372=function(_0xc47c6b){while(--_0xc47c6b){_0x3d8240['push'](_0x3d8240['shift']());}};_0x3d0372(++_0x2663d4);}(_0xa7bb,0x70));var _0xba7b=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa7bb[_0x220dbb];return _0x2b77de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba7b('0x0'));var zipdir=require(_0xba7b('0x1'));var jsonpatch=require(_0xba7b('0x2'));var rp=require(_0xba7b('0x3'));var moment=require(_0xba7b('0x4'));var BPromise=require(_0xba7b('0x5'));var Mustache=require(_0xba7b('0x6'));var util=require('util');var path=require('path');var sox=require(_0xba7b('0x7'));var csv=require(_0xba7b('0x8'));var ejs=require(_0xba7b('0x9'));var fs=require('fs');var fs_extra=require(_0xba7b('0xa'));var _=require(_0xba7b('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xba7b('0xc'));var deskjs=require(_0xba7b('0xd'));var toCsv=require(_0xba7b('0x8'));var querystring=require(_0xba7b('0xe'));var Papa=require(_0xba7b('0xf'));var Redis=require(_0xba7b('0x10'));var authService=require(_0xba7b('0x11'));var qs=require(_0xba7b('0x12'));var as=require(_0xba7b('0x13'));var hardwareService=require(_0xba7b('0x14'));var logger=require('../../config/logger')(_0xba7b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xba7b('0x16'));var db=require(_0xba7b('0x17'))['db'];function respondWithStatusCode(_0x422665,_0x3685df){_0x3685df=_0x3685df||0xcc;return function(_0x69e7ee){if(_0x69e7ee){return _0x422665[_0xba7b('0x18')](_0x3685df);}return _0x422665['status'](_0x3685df)['end']();};}function respondWithResult(_0x32c413,_0x150ce2){_0x150ce2=_0x150ce2||0xc8;return function(_0x212879){if(_0x212879){return _0x32c413[_0xba7b('0x19')](_0x150ce2)[_0xba7b('0x1a')](_0x212879);}};}function respondWithFilteredResult(_0x48cd82,_0x5d45c0){return function(_0xb40813){if(_0xb40813){var _0x72b165=typeof _0x5d45c0[_0xba7b('0x1b')]===_0xba7b('0x1c')&&typeof _0x5d45c0[_0xba7b('0x1d')]===_0xba7b('0x1c');var _0x5b35eb=_0xb40813[_0xba7b('0x1e')];var _0x1ec15e=_0x72b165?0x0:_0x5d45c0[_0xba7b('0x1b')];var _0x3b2d94=_0x72b165?_0xb40813[_0xba7b('0x1e')]:_0x5d45c0['offset']+_0x5d45c0[_0xba7b('0x1d')];var _0x2fab05;if(_0x3b2d94>=_0x5b35eb){_0x3b2d94=_0x5b35eb;_0x2fab05=0xc8;}else{_0x2fab05=0xce;}_0x48cd82['status'](_0x2fab05);return _0x48cd82[_0xba7b('0x1f')](_0xba7b('0x20'),_0x1ec15e+'-'+_0x3b2d94+'/'+_0x5b35eb)[_0xba7b('0x1a')](_0xb40813);}return null;};}function patchUpdates(_0x213e94){return function(_0x5bbc78){try{jsonpatch[_0xba7b('0x21')](_0x5bbc78,_0x213e94,!![]);}catch(_0x11cf03){return BPromise['reject'](_0x11cf03);}return _0x5bbc78[_0xba7b('0x22')]();};}function saveUpdates(_0x4d3be1,_0x416ddb){return function(_0x340821){if(_0x340821){return _0x340821[_0xba7b('0x23')](_0x4d3be1)[_0xba7b('0x24')](function(_0x1429a3){return _0x1429a3;});}return null;};}function removeEntity(_0x2e0eef,_0x1a9825){return function(_0x2d2a18){if(_0x2d2a18){return _0x2d2a18[_0xba7b('0x25')]()[_0xba7b('0x24')](function(){_0x2e0eef[_0xba7b('0x19')](0xcc)[_0xba7b('0x26')]();});}};}function handleEntityNotFound(_0x1a214b,_0x250f28){return function(_0xf95d10){if(!_0xf95d10){_0x1a214b[_0xba7b('0x18')](0x194);}return _0xf95d10;};}function handleError(_0x329332,_0x2e83ae){_0x2e83ae=_0x2e83ae||0x1f4;return function(_0x418117){logger[_0xba7b('0x27')](_0x418117[_0xba7b('0x28')]);if(_0x418117['name']){delete _0x418117[_0xba7b('0x29')];}_0x329332[_0xba7b('0x19')](_0x2e83ae)[_0xba7b('0x2a')](_0x418117);};}exports['index']=function(_0x5ab5a1,_0x2e9184){var _0xd25861={},_0x3ac290={},_0x7c1aec={'count':0x0,'rows':[]};var _0x33f839=_[_0xba7b('0x2b')](db[_0xba7b('0x2c')]['rawAttributes'],function(_0x24e30e){return{'name':_0x24e30e[_0xba7b('0x2d')],'type':_0x24e30e[_0xba7b('0x2e')][_0xba7b('0x2f')]};});_0x3ac290['model']=_['differenceBy'](_[_0xba7b('0x2b')](_0x33f839,'name'),[_0xba7b('0x29')]);_0x3ac290['query']=_[_0xba7b('0x30')](_0x5ab5a1['query']);_0x3ac290[_0xba7b('0x31')]=_[_0xba7b('0x32')](_0x3ac290[_0xba7b('0x33')],_0x3ac290['query']);_0xd25861[_0xba7b('0x34')]=_[_0xba7b('0x32')](_0x3ac290[_0xba7b('0x33')],qs['fields'](_0x5ab5a1['query'][_0xba7b('0x35')]));_0xd25861[_0xba7b('0x34')]=_0xd25861[_0xba7b('0x34')][_0xba7b('0x36')]?_0xd25861[_0xba7b('0x34')]:_0x3ac290[_0xba7b('0x33')];if(!_0x5ab5a1[_0xba7b('0x37')][_0xba7b('0x38')](_0xba7b('0x39'))){_0xd25861[_0xba7b('0x1d')]=qs[_0xba7b('0x1d')](_0x5ab5a1[_0xba7b('0x37')]['limit']);_0xd25861[_0xba7b('0x1b')]=qs[_0xba7b('0x1b')](_0x5ab5a1[_0xba7b('0x37')][_0xba7b('0x1b')]);}_0xd25861[_0xba7b('0x3a')]=qs['sort'](_0x5ab5a1[_0xba7b('0x37')]['sort']);_0xd25861[_0xba7b('0x3b')]=qs[_0xba7b('0x31')](_['pick'](_0x5ab5a1[_0xba7b('0x37')],_0x3ac290[_0xba7b('0x31')]),_0x33f839);if(_0x5ab5a1[_0xba7b('0x37')]['filter']){_0xd25861['where']=_['merge'](_0xd25861[_0xba7b('0x3b')],{'$or':_[_0xba7b('0x2b')](_0x33f839,function(_0x29069c){if(_0x29069c[_0xba7b('0x2e')]!==_0xba7b('0x3c')){var _0x36c6b7={};_0x36c6b7[_0x29069c[_0xba7b('0x29')]]={'$like':'%'+_0x5ab5a1['query']['filter']+'%'};return _0x36c6b7;}})});}_0xd25861=_[_0xba7b('0x3d')]({},_0xd25861,_0x5ab5a1[_0xba7b('0x3e')]);var _0x4429e5={'where':_0xd25861['where']};return db[_0xba7b('0x2c')][_0xba7b('0x1e')](_0x4429e5)['then'](function(_0x802902){_0x7c1aec['count']=_0x802902;if(_0x5ab5a1[_0xba7b('0x37')][_0xba7b('0x3f')]){_0xd25861['include']=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0xd25861);})['then'](function(_0x62aade){_0x7c1aec[_0xba7b('0x40')]=_0x62aade;return _0x7c1aec;})['then'](respondWithFilteredResult(_0x2e9184,_0xd25861))[_0xba7b('0x41')](handleError(_0x2e9184,null));};exports[_0xba7b('0x42')]=function(_0xc04d6d,_0x47aedb){var _0x22d2fe={'raw':!![],'where':{'id':_0xc04d6d[_0xba7b('0x43')]['id']}},_0x12e0eb={};_0x12e0eb[_0xba7b('0x33')]=_[_0xba7b('0x30')](db[_0xba7b('0x2c')][_0xba7b('0x44')]);_0x12e0eb['query']=_['keys'](_0xc04d6d[_0xba7b('0x37')]);_0x12e0eb['filters']=_[_0xba7b('0x32')](_0x12e0eb[_0xba7b('0x33')],_0x12e0eb[_0xba7b('0x37')]);_0x22d2fe[_0xba7b('0x34')]=_[_0xba7b('0x32')](_0x12e0eb[_0xba7b('0x33')],qs[_0xba7b('0x35')](_0xc04d6d[_0xba7b('0x37')]['fields']));_0x22d2fe['attributes']=_0x22d2fe['attributes'][_0xba7b('0x36')]?_0x22d2fe[_0xba7b('0x34')]:_0x12e0eb[_0xba7b('0x33')];if(_0xc04d6d[_0xba7b('0x37')][_0xba7b('0x3f')]){_0x22d2fe[_0xba7b('0x45')]=[{'all':!![]}];}_0x22d2fe=_['merge']({},_0x22d2fe,_0xc04d6d['options']);return db[_0xba7b('0x2c')][_0xba7b('0x46')](_0x22d2fe)['then'](handleEntityNotFound(_0x47aedb,null))[_0xba7b('0x24')](respondWithResult(_0x47aedb,null))['catch'](handleError(_0x47aedb,null));};exports[_0xba7b('0x23')]=function(_0x24313a,_0x4ea13a){if(_0x24313a['body']['id']){delete _0x24313a[_0xba7b('0x47')]['id'];}return db[_0xba7b('0x2c')]['find']({'where':{'id':_0x24313a['params']['id']}})[_0xba7b('0x24')](handleEntityNotFound(_0x4ea13a,null))[_0xba7b('0x24')](saveUpdates(_0x24313a[_0xba7b('0x47')],null))['then'](respondWithResult(_0x4ea13a,null))[_0xba7b('0x41')](handleError(_0x4ea13a,null));};exports[_0xba7b('0x25')]=function(_0x34bc7e,_0x3a2e46){return db[_0xba7b('0x2c')][_0xba7b('0x46')]({'where':{'id':_0x34bc7e[_0xba7b('0x43')]['id']}})[_0xba7b('0x24')](handleEntityNotFound(_0x3a2e46,null))['then'](removeEntity(_0x3a2e46,null))[_0xba7b('0x41')](handleError(_0x3a2e46,null));};exports['create']=function(_0x146bde,_0x1be956){var _0x542900;return db[_0xba7b('0x48')][_0xba7b('0x49')](function(_0x37bf0e){return db[_0xba7b('0x2c')][_0xba7b('0x4a')](_0x146bde['body'],{'transaction':_0x37bf0e})[_0xba7b('0x24')](function(_0x46d17b){_0x542900=_0x46d17b;var _0x5b6ea6={'type':db[_0xba7b('0x4b')][_0xba7b('0x4c')],'transaction':_0x37bf0e};switch(_0x146bde['body']['type']){case _0xba7b('0x4d'):_0x5b6ea6[_0xba7b('0x2e')]=db[_0xba7b('0x4b')][_0xba7b('0x4c')];break;case'number':_0x5b6ea6[_0xba7b('0x2e')]=db[_0xba7b('0x4b')]['INTEGER'];break;case'switch':_0x5b6ea6[_0xba7b('0x2e')]=db[_0xba7b('0x4b')][_0xba7b('0x4e')];_0x5b6ea6[_0xba7b('0x4f')]=![];break;default:}return db[_0xba7b('0x48')][_0xba7b('0x50')][_0xba7b('0x51')](_0xba7b('0x52'),util['format'](_0xba7b('0x53'),_0x542900['id']),_0x5b6ea6);})[_0xba7b('0x24')](function(){return _0x542900;});})[_0xba7b('0x24')](respondWithResult(_0x1be956,0xc9))[_0xba7b('0x41')](handleError(_0x1be956,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 2f7eb3e..1088bd7 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 _0xa680=['moment','bluebird','request-promise','path','rimraf','../../config/environment','cm_custom_fields','util','api'];(function(_0x4bfb0b,_0x55984e){var _0x5bf16e=function(_0x320a43){while(--_0x320a43){_0x4bfb0b['push'](_0x4bfb0b['shift']());}};_0x5bf16e(++_0x55984e);}(_0xa680,0x181));var _0x0a68=function(_0x1546b6,_0x717a6e){_0x1546b6=_0x1546b6-0x0;var _0x1d0365=_0xa680[_0x1546b6];return _0x1d0365;};'use strict';var _=require('lodash');var util=require(_0x0a68('0x0'));var logger=require('../../config/logger')(_0x0a68('0x1'));var moment=require(_0x0a68('0x2'));var BPromise=require(_0x0a68('0x3'));var rp=require(_0x0a68('0x4'));var fs=require('fs');var path=require(_0x0a68('0x5'));var rimraf=require(_0x0a68('0x6'));var config=require(_0x0a68('0x7'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x5ae68c,_0x36286d){return _0x5ae68c['define']('CmCustomField',attributes,{'tableName':_0x0a68('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8bb3=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','CmCustomField','lodash'];(function(_0x14cc30,_0xd574b){var _0x3ad39c=function(_0x58bc4f){while(--_0x58bc4f){_0x14cc30['push'](_0x14cc30['shift']());}};_0x3ad39c(++_0xd574b);}(_0x8bb3,0x133));var _0x38bb=function(_0x4fd8df,_0x246462){_0x4fd8df=_0x4fd8df-0x0;var _0x6aff37=_0x8bb3[_0x4fd8df];return _0x6aff37;};'use strict';var _=require(_0x38bb('0x0'));var util=require(_0x38bb('0x1'));var logger=require('../../config/logger')(_0x38bb('0x2'));var moment=require(_0x38bb('0x3'));var BPromise=require(_0x38bb('0x4'));var rp=require(_0x38bb('0x5'));var fs=require('fs');var path=require(_0x38bb('0x6'));var rimraf=require(_0x38bb('0x7'));var config=require(_0x38bb('0x8'));var attributes=require(_0x38bb('0x9'));module['exports']=function(_0x527745,_0x239119){return _0x527745['define'](_0x38bb('0xa'),attributes,{'tableName':'cm_custom_fields','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 fca3070..bd9cf1b 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 _0x2764=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x2764,0xfd));var _0x4276=function(_0x1e3099,_0x200fb5){_0x1e3099=_0x1e3099-0x0;var _0x30bcf6=_0x2764[_0x1e3099];return _0x30bcf6;};'use strict';var _=require('lodash');var util=require(_0x4276('0x0'));var moment=require(_0x4276('0x1'));var BPromise=require(_0x4276('0x2'));var rs=require(_0x4276('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4276('0x4'))['db'];var utils=require(_0x4276('0x5'));var logger=require(_0x4276('0x6'))('rpc');var config=require(_0x4276('0x7'));var jayson=require(_0x4276('0x8'));var client=jayson[_0x4276('0x9')][_0x4276('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17bde9,_0xe567d4,_0x96b5fc){return new BPromise(function(_0x14e783,_0x37bec2){return client[_0x4276('0xb')](_0x17bde9,_0x96b5fc)[_0x4276('0xc')](function(_0x8f5d8d){logger[_0x4276('0xd')]('CmCustomField,\x20%s,\x20%s',_0xe567d4,_0x4276('0xe'));logger[_0x4276('0xf')](_0x4276('0x10'),_0xe567d4,_0x4276('0xe'),JSON['stringify'](_0x8f5d8d));if(_0x8f5d8d[_0x4276('0x11')]){if(_0x8f5d8d[_0x4276('0x11')][_0x4276('0x12')]===0x1f4){logger[_0x4276('0x11')](_0x4276('0x13'),_0xe567d4,_0x8f5d8d['error'][_0x4276('0x14')]);return _0x37bec2(_0x8f5d8d[_0x4276('0x11')][_0x4276('0x14')]);}logger[_0x4276('0x11')]('CmCustomField,\x20%s,\x20%s',_0xe567d4,_0x8f5d8d[_0x4276('0x11')]['message']);return _0x14e783(_0x8f5d8d[_0x4276('0x11')][_0x4276('0x14')]);}else{logger[_0x4276('0xd')](_0x4276('0x13'),_0xe567d4,_0x4276('0xe'));_0x14e783(_0x8f5d8d[_0x4276('0x15')]['message']);}})[_0x4276('0x16')](function(_0x5d4c03){logger[_0x4276('0x11')](_0x4276('0x13'),_0xe567d4,_0x5d4c03);_0x37bec2(_0x5d4c03);});});} \ No newline at end of file +var _0x2d50=['http','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x5b317b,_0x498413){var _0x1800b3=function(_0x428bd5){while(--_0x428bd5){_0x5b317b['push'](_0x5b317b['shift']());}};_0x1800b3(++_0x498413);}(_0x2d50,0x14f));var _0x02d5=function(_0x39fa50,_0x4f0f04){_0x39fa50=_0x39fa50-0x0;var _0x4d7f62=_0x2d50[_0x39fa50];return _0x4d7f62;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x02d5('0x0'));var rs=require(_0x02d5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02d5('0x2'))['db'];var utils=require(_0x02d5('0x3'));var logger=require(_0x02d5('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x02d5('0x5'));var client=jayson[_0x02d5('0x6')][_0x02d5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5a7fec,_0x4e318f,_0x58cd1f){return new BPromise(function(_0x3b0fce,_0x3ee4ce){return client['request'](_0x5a7fec,_0x58cd1f)[_0x02d5('0x8')](function(_0x24b717){logger['info'](_0x02d5('0x9'),_0x4e318f,_0x02d5('0xa'));logger[_0x02d5('0xb')](_0x02d5('0xc'),_0x4e318f,_0x02d5('0xa'),JSON[_0x02d5('0xd')](_0x24b717));if(_0x24b717[_0x02d5('0xe')]){if(_0x24b717[_0x02d5('0xe')][_0x02d5('0xf')]===0x1f4){logger[_0x02d5('0xe')](_0x02d5('0x9'),_0x4e318f,_0x24b717['error'][_0x02d5('0x10')]);return _0x3ee4ce(_0x24b717[_0x02d5('0xe')][_0x02d5('0x10')]);}logger[_0x02d5('0xe')](_0x02d5('0x9'),_0x4e318f,_0x24b717[_0x02d5('0xe')][_0x02d5('0x10')]);return _0x3b0fce(_0x24b717[_0x02d5('0xe')]['message']);}else{logger[_0x02d5('0x11')](_0x02d5('0x9'),_0x4e318f,'request\x20sent');_0x3b0fce(_0x24b717['result'][_0x02d5('0x10')]);}})['catch'](function(_0x4736bf){logger[_0x02d5('0xe')](_0x02d5('0x9'),_0x4e318f,_0x4736bf);_0x3ee4ce(_0x4736bf);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 347bdcc..b37b72b 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 _0xc569=['post','create','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x184d15,_0x156b5d){var _0x4989da=function(_0x5ea4f0){while(--_0x5ea4f0){_0x184d15['push'](_0x184d15['shift']());}};_0x4989da(++_0x156b5d);}(_0xc569,0x159));var _0x9c56=function(_0x4a7573,_0x53e1c4){_0x4a7573=_0x4a7573-0x0;var _0x3606f0=_0xc569[_0x4a7573];return _0x3606f0;};'use strict';var multer=require(_0x9c56('0x0'));var util=require(_0x9c56('0x1'));var path=require(_0x9c56('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c56('0x3'));var router=express[_0x9c56('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c56('0x5'));var interaction=require(_0x9c56('0x6'));var config=require(_0x9c56('0x7'));var controller=require('./cmCustomField.controller');router[_0x9c56('0x8')]('/',auth[_0x9c56('0x9')](),controller[_0x9c56('0xa')]);router[_0x9c56('0x8')]('/:id',auth[_0x9c56('0x9')](),controller[_0x9c56('0xb')]);router[_0x9c56('0xc')]('/',auth[_0x9c56('0x9')](),controller[_0x9c56('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9c56('0xe')]);router[_0x9c56('0xf')]('/:id',auth[_0x9c56('0x9')](),controller['destroy']);module[_0x9c56('0x10')]=router; \ No newline at end of file +var _0x80c3=['isAuthenticated','post','put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','get','/:id'];(function(_0x4fc051,_0x116315){var _0x27a80a=function(_0x238082){while(--_0x238082){_0x4fc051['push'](_0x4fc051['shift']());}};_0x27a80a(++_0x116315);}(_0x80c3,0x18f));var _0x380c=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x80c3[_0x5e36d1];return _0x950b9e;};'use strict';var multer=require(_0x380c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x380c('0x1'));var express=require('express');var router=express[_0x380c('0x2')]();var fs_extra=require(_0x380c('0x3'));var auth=require(_0x380c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0x380c('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x380c('0x5')](_0x380c('0x6'),auth[_0x380c('0x7')](),controller['show']);router[_0x380c('0x8')]('/',auth[_0x380c('0x7')](),controller['create']);router[_0x380c('0x9')](_0x380c('0x6'),auth['isAuthenticated'](),controller[_0x380c('0xa')]);router[_0x380c('0xb')](_0x380c('0x6'),auth['isAuthenticated'](),controller[_0x380c('0xc')]);module[_0x380c('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 9ebb0ea..afc8a13 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 _0xf311=['exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize'];(function(_0x5af3c6,_0x1e5f0f){var _0x4d0539=function(_0x183708){while(--_0x183708){_0x5af3c6['push'](_0x5af3c6['shift']());}};_0x4d0539(++_0x1e5f0f);}(_0xf311,0xcf));var _0x1f31=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xf311[_0x413feb];return _0x40ee88;};'use strict';var moment=require(_0x1f31('0x0'));var Sequelize=require(_0x1f31('0x1'));module[_0x1f31('0x2')]={'phone':{'type':Sequelize[_0x1f31('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x1f31('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x1f31('0x5')],'defaultValue':moment()[_0x1f31('0x6')](_0x1f31('0x7'))},'countbusyretry':{'type':Sequelize[_0x1f31('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1f31('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x1f31('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1f31('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1f31('0x5')]},'priority':{'type':Sequelize[_0x1f31('0x8')](0x2)[_0x1f31('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x1f31('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x1f31('0x8')],'unique':_0x1f31('0xa')},'ListId':{'type':Sequelize[_0x1f31('0x8')],'unique':_0x1f31('0xa')},'UserId':{'type':Sequelize[_0x1f31('0x8')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x1f31('0xa')},'CampaignId':{'type':Sequelize[_0x1f31('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0x1f31('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1f31('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1f31('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x1f31('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x1f31('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x1f31('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x6a56=['DATE','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x3da63b,_0x4b6e37){var _0x361f3d=function(_0x1569e2){while(--_0x1569e2){_0x3da63b['push'](_0x3da63b['shift']());}};_0x361f3d(++_0x4b6e37);}(_0x6a56,0xb3));var _0x66a5=function(_0x4ea6af,_0x4aa32e){_0x4ea6af=_0x4ea6af-0x0;var _0x4cb1e6=_0x6a56[_0x4ea6af];return _0x4cb1e6;};'use strict';var moment=require(_0x66a5('0x0'));var Sequelize=require(_0x66a5('0x1'));module[_0x66a5('0x2')]={'phone':{'type':Sequelize[_0x66a5('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x66a5('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x66a5('0x5')](_0x66a5('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x66a5('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x66a5('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x66a5('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x66a5('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x66a5('0x8')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x66a5('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x66a5('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x66a5('0xa')},'ListId':{'type':Sequelize[_0x66a5('0x7')],'unique':_0x66a5('0xa')},'UserId':{'type':Sequelize[_0x66a5('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x66a5('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x66a5('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x66a5('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x66a5('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x66a5('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x66a5('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x66a5('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x66a5('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x66a5('0x8')],'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 3e92e13..d9d0735 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 _0xeec6=['isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','Contact','CmCompany','Company','List','Queue','getPreviewRecall','UPDATE','CmList','dialActive','getOpenContacts','isNumber','entity\x20not\x20found','getTimezones','timezones','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','json','update','sendStatus','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','key','model','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$iLike','$notILike','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','then','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','createdAt','updatedAt','state','statedesc','membername','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','outbound','preview','dialPreviewAutoRecallMe','value','direction','prev'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xeec6,0x1c2));var _0x6eec=function(_0xea1570,_0x2f7856){_0xea1570=_0xea1570-0x0;var _0x579e74=_0xeec6[_0xea1570];return _0x579e74;};'use strict';var moment=require(_0x6eec('0x0'));var _=require(_0x6eec('0x1'));var qs=require(_0x6eec('0x2'));var logger=require(_0x6eec('0x3'))('api');var shared=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];function respondWithResult(_0x1699ce,_0x2d7a15){_0x2d7a15=_0x2d7a15||0xc8;return function(_0x3e7b6b){if(_0x3e7b6b){return _0x1699ce[_0x6eec('0x6')](_0x2d7a15)['json'](_0x3e7b6b);}};}function respondWithFilteredResult(_0x185f31,_0x3c6eda){return function(_0x48064a){if(_0x48064a){var _0x5a5e47=typeof _0x3c6eda[_0x6eec('0x7')]===_0x6eec('0x8')&&typeof _0x3c6eda[_0x6eec('0x9')]==='undefined';var _0x2be38f=_0x48064a[_0x6eec('0xa')];var _0x1c774d=_0x5a5e47?0x0:_0x3c6eda['offset'];var _0x595dd4=_0x5a5e47?_0x48064a['count']:_0x3c6eda[_0x6eec('0x7')]+_0x3c6eda[_0x6eec('0x9')];var _0x51a9e3;if(_0x595dd4>=_0x2be38f){_0x595dd4=_0x2be38f;_0x51a9e3=0xc8;}else{_0x51a9e3=0xce;}_0x185f31['status'](_0x51a9e3);return _0x185f31[_0x6eec('0xb')]('Content-Range',_0x1c774d+'-'+_0x595dd4+'/'+_0x2be38f)[_0x6eec('0xc')](_0x48064a);}return null;};}function saveUpdates(_0x3387c2,_0x162db1){return function(_0x3fe94b){if(_0x3fe94b){return _0x3fe94b[_0x6eec('0xd')](_0x3387c2)['then'](function(_0x25e2a5){return _0x25e2a5;});}return null;};}function handleEntityNotFound(_0x3b2972,_0x462dbb){return function(_0xc35914){if(!_0xc35914){_0x3b2972[_0x6eec('0xe')](0x194);}return _0xc35914;};}function handleError(_0x2b35d6,_0x345852){_0x345852=_0x345852||0x1f4;return function(_0x393271){logger[_0x6eec('0xf')](_0x393271[_0x6eec('0x10')]);if(_0x393271['name']){delete _0x393271[_0x6eec('0x11')];}_0x2b35d6['status'](_0x345852)[_0x6eec('0x12')](_0x393271);};}exports[_0x6eec('0x13')]=function(_0x512619,_0x3ee353){var _0x80736b={},_0xb1eab7={},_0x56c78b={'count':0x0,'rows':[]};var _0x87f3be=_[_0x6eec('0x14')](db[_0x6eec('0x15')][_0x6eec('0x16')],function(_0xd86135){return{'name':_0xd86135[_0x6eec('0x17')],'type':_0xd86135['type'][_0x6eec('0x18')]};});_0xb1eab7[_0x6eec('0x19')]=_[_0x6eec('0x14')](_0x87f3be,_0x6eec('0x11'));_0xb1eab7[_0x6eec('0x1a')]=_[_0x6eec('0x1b')](_0x512619['query']);_0xb1eab7[_0x6eec('0x1c')]=_[_0x6eec('0x1d')](_0xb1eab7[_0x6eec('0x19')],_0xb1eab7[_0x6eec('0x1a')]);_0xb1eab7[_0x6eec('0x1c')]=_[_0x6eec('0x1e')](_0xb1eab7['filters'],[_0x6eec('0x1f'),_0x6eec('0x20'),_0x6eec('0x21'),_0x6eec('0x22'),_0x6eec('0x23'),_0x6eec('0x24'),_0x6eec('0x25'),_0x6eec('0x26'),_0x6eec('0x27'),'$between',_0x6eec('0x28'),_0x6eec('0x29'),_0x6eec('0x2a'),_0x6eec('0x2b'),'$notLike',_0x6eec('0x2c'),_0x6eec('0x2d'),'$like','$overlap',_0x6eec('0x2e'),'$contained',_0x6eec('0x2f')]);_0x80736b[_0x6eec('0x30')]=_[_0x6eec('0x1d')](_0xb1eab7[_0x6eec('0x19')],qs[_0x6eec('0x31')](_0x512619[_0x6eec('0x1a')][_0x6eec('0x31')]));_0x80736b[_0x6eec('0x30')]=_0x80736b[_0x6eec('0x30')][_0x6eec('0x32')]?_0x80736b['attributes']:_0xb1eab7[_0x6eec('0x19')];if(!_0x512619['query'][_0x6eec('0x33')](_0x6eec('0x34'))){_0x80736b[_0x6eec('0x9')]=qs['limit'](_0x512619['query']['limit']);_0x80736b[_0x6eec('0x7')]=qs[_0x6eec('0x7')](_0x512619[_0x6eec('0x1a')][_0x6eec('0x7')]);}_0x80736b[_0x6eec('0x35')]=qs[_0x6eec('0x36')](_0x512619[_0x6eec('0x1a')][_0x6eec('0x36')]);_0x80736b[_0x6eec('0x37')]=qs[_0x6eec('0x1c')](_[_0x6eec('0x38')](_0x512619[_0x6eec('0x1a')],_0xb1eab7['filters']),_0x87f3be);if(_0x512619[_0x6eec('0x1a')][_0x6eec('0x39')]){_0x80736b[_0x6eec('0x37')]=_['merge'](_0x80736b[_0x6eec('0x37')],{'$or':_[_0x6eec('0x14')](_0x87f3be,function(_0xd857fa){if(_0xd857fa[_0x6eec('0x3a')]!==_0x6eec('0x3b')){var _0x34d3b1={};_0x34d3b1[_0xd857fa['name']]={'$like':'%'+_0x512619[_0x6eec('0x1a')][_0x6eec('0x39')]+'%'};return _0x34d3b1;}})});}_0x80736b=_[_0x6eec('0x3c')]({},_0x80736b,_0x512619['options']);var _0x53acd9={'where':_0x80736b[_0x6eec('0x37')]};return db[_0x6eec('0x15')][_0x6eec('0xa')](_0x53acd9)[_0x6eec('0x3d')](function(_0x402bac){_0x56c78b['count']=_0x402bac;if(_0x512619[_0x6eec('0x1a')][_0x6eec('0x3e')]){_0x80736b[_0x6eec('0x3f')]=[{'all':!![]}];}return db[_0x6eec('0x15')][_0x6eec('0x40')](_0x80736b);})[_0x6eec('0x3d')](function(_0x36cfe1){_0x56c78b[_0x6eec('0x41')]=_0x36cfe1;return _0x56c78b;})['then'](respondWithFilteredResult(_0x3ee353,_0x80736b))[_0x6eec('0x42')](handleError(_0x3ee353,null));};exports[_0x6eec('0x43')]=function(_0x4d30c9,_0x5b3283){var _0x160fc0={'raw':!![],'where':{'id':_0x4d30c9[_0x6eec('0x44')]['id']}},_0x66f786={};_0x66f786[_0x6eec('0x19')]=_['keys'](db['CmHopper'][_0x6eec('0x16')]);_0x66f786['query']=_['keys'](_0x4d30c9[_0x6eec('0x1a')]);_0x66f786[_0x6eec('0x1c')]=_[_0x6eec('0x1d')](_0x66f786[_0x6eec('0x19')],_0x66f786[_0x6eec('0x1a')]);_0x160fc0['attributes']=_[_0x6eec('0x1d')](_0x66f786[_0x6eec('0x19')],qs['fields'](_0x4d30c9[_0x6eec('0x1a')][_0x6eec('0x31')]));_0x160fc0['attributes']=_0x160fc0[_0x6eec('0x30')][_0x6eec('0x32')]?_0x160fc0['attributes']:_0x66f786[_0x6eec('0x19')];if(_0x4d30c9[_0x6eec('0x1a')][_0x6eec('0x3e')]){_0x160fc0[_0x6eec('0x3f')]=[{'all':!![]}];}_0x160fc0=_['merge']({},_0x160fc0,_0x4d30c9[_0x6eec('0x45')]);return db[_0x6eec('0x15')][_0x6eec('0x46')](_0x160fc0)[_0x6eec('0x3d')](handleEntityNotFound(_0x5b3283,null))[_0x6eec('0x3d')](respondWithResult(_0x5b3283,null))['catch'](handleError(_0x5b3283,null));};exports['create']=function(_0x1edb5f,_0x3d5c80){return db[_0x6eec('0x15')][_0x6eec('0x47')](_0x1edb5f[_0x6eec('0x48')],{})['then'](respondWithResult(_0x3d5c80,0xc9))[_0x6eec('0x42')](handleError(_0x3d5c80,null));};exports['update']=function(_0x20524a,_0x408295){if(_0x20524a[_0x6eec('0x48')]['id']){delete _0x20524a['body']['id'];}return db[_0x6eec('0x15')][_0x6eec('0x46')]({'where':{'id':_0x20524a[_0x6eec('0x44')]['id']}})[_0x6eec('0x3d')](handleEntityNotFound(_0x408295,null))[_0x6eec('0x3d')](saveUpdates(_0x20524a['body'],null))[_0x6eec('0x3d')](respondWithResult(_0x408295,null))['catch'](handleError(_0x408295,null));};exports['describe']=function(_0x2529ad,_0x535d96){return db[_0x6eec('0x15')][_0x6eec('0x49')]()[_0x6eec('0x3d')](respondWithResult(_0x535d96,null))['catch'](handleError(_0x535d96,null));};exports['destroy']=function(_0x6b200d,_0x142914){var _0x1d6626;var _0x2d0fc0=_0x6b200d[_0x6eec('0x44')]['id'];return db[_0x6eec('0x15')][_0x6eec('0x46')]({'where':{'id':_0x6b200d[_0x6eec('0x44')]['id']}})[_0x6eec('0x3d')](handleEntityNotFound(_0x142914,null))[_0x6eec('0x3d')](function(_0x4e1be2){if(_0x4e1be2){return _0x4e1be2['destroy']()[_0x6eec('0x3d')](function(_0x2270ce){return _0x2270ce;});}})[_0x6eec('0x3d')](function(_0x577fb6){_0x1d6626=_0x577fb6;if(_0x577fb6){if(_0x577fb6[_0x6eec('0x4a')]||_0x577fb6[_0x6eec('0x4b')]){return db[_0x577fb6[_0x6eec('0x4a')]?_0x6eec('0x4c'):_0x6eec('0x4d')][_0x6eec('0x46')]({'where':{'id':_0x577fb6[_0x6eec('0x4a')]?_0x577fb6[_0x6eec('0x4a')]:_0x577fb6['CampaignId']},'attributes':['id',_0x6eec('0x11')],'raw':!![]});}}})[_0x6eec('0x3d')](function(_0x3374ef){var _0x3e77f3={};if(_0x3374ef){_['merge'](_0x3e77f3,_['omit'](_0x1d6626['dataValues'],[_0x6eec('0x4e'),_0x6eec('0x4f'),'id']));_0x3e77f3[_0x6eec('0x50')]=0x15;_0x3e77f3[_0x6eec('0x51')]='deleted';_0x3e77f3['campaign']=_0x3374ef[_0x6eec('0x11')];_0x3e77f3[_0x6eec('0x52')]=_0x6b200d[_0x6eec('0x53')]['name'];_0x3e77f3[_0x6eec('0x54')]=_0x6b200d[_0x6eec('0x53')]['id'];_0x3e77f3[_0x6eec('0x55')]=!![];_0x3e77f3[_0x6eec('0x56')]=moment()[_0x6eec('0x57')](_0x6eec('0x58'));_0x3e77f3[_0x6eec('0x59')]=_0x1d6626[_0x6eec('0x5a')];_0x3e77f3[_0x6eec('0x5b')]=_0x1d6626['VoiceQueueId']?_0x6eec('0x5c'):'ivr';return db[_0x6eec('0x5d')][_0x6eec('0x46')]({'where':{'id':_0x3e77f3[_0x6eec('0x5e')]},'attributes':[_0x6eec('0x5f'),_0x6eec('0x60')]})[_0x6eec('0x3d')](function(_0x274975){if(!_['isNil'](_0x142914)&&!_[_0x6eec('0x61')](_0x274975['firstName'])){_0x3e77f3[_0x6eec('0x62')]=_0x274975['firstName'];if(!_[_0x6eec('0x61')](_0x274975[_0x6eec('0x60')])){_0x3e77f3[_0x6eec('0x62')]+='\x20'+_0x274975[_0x6eec('0x60')];}}})[_0x6eec('0x63')](function(){return db[_0x6eec('0x64')][_0x6eec('0x47')](_0x3e77f3);});}})[_0x6eec('0x3d')](function(_0x130002){return db[_0x6eec('0x65')]['destroy']({'where':{'CmHopperId':_0x2d0fc0}});})['then'](function(){return _0x142914[_0x6eec('0x6')](0xcc)[_0x6eec('0x66')]();})[_0x6eec('0x42')](handleError(_0x142914,null));};exports[_0x6eec('0x67')]=function(_0x20b040,_0x4a8fca){var _0x1d8fb1=[];return db[_0x6eec('0x5d')]['describe']()['then'](function(_0x5dc8b3){_0x1d8fb1=_[_0x6eec('0x1b')](_0x5dc8b3);return _0x20b040[_0x6eec('0x53')]['getVoiceQueues']({'where':{'type':_0x6eec('0x68'),'dialActive':!![],'dialMethod':_0x6eec('0x69')},'attributes':['id','dialOrderByScheduledAt',_0x6eec('0x6a')],'raw':!![]});})[_0x6eec('0x3d')](function(_0xc852b3){if(_0xc852b3&&_0xc852b3[_0x6eec('0x32')]){return db['sequelize']['transaction'](function(_0x54fcd0){var _0x1230fc={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6eec('0x57')](_0x6eec('0x58'))},'VoiceQueueId':{'$in':_[_0x6eec('0x14')](_0xc852b3,'id')},'$or':[{'UserId':null},{'UserId':_0x20b040[_0x6eec('0x53')]['id']}]};var _0x169607={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0xc852b3)[_0x6eec('0x39')]([_0x6eec('0x6a'),0x0])[_0x6eec('0x14')]('id')[_0x6eec('0x6b')]()},'$or':[{'UserId':null},{'UserId':_0x20b040[_0x6eec('0x53')]['id']}]};var _0x2799ca={'$or':[_0x1230fc,_0x169607]};var _0x386a67=[];if(_0x20b040[_0x6eec('0x48')][_0x6eec('0x6c')]&&_0x20b040[_0x6eec('0x48')]['direction']===_0x6eec('0x6d')){if(!_[_0x6eec('0x6e')](_0x20b040['body'][_0x6eec('0x6f')])){_0x2799ca['id']={'$in':_0x20b040[_0x6eec('0x48')]['hopperIds']};}_0x386a67=[[_0x6eec('0x70'),_0x6eec('0x71')],[_0x6eec('0x72'),_0xc852b3[0x0][_0x6eec('0x73')]==='ASC'?_0x6eec('0x74'):_0x6eec('0x71')],db[_0x6eec('0x75')][_0x6eec('0x76')](_0x6eec('0x77')),['id',_0x6eec('0x74')]];}else{if(!_['isEmpty'](_0x20b040[_0x6eec('0x48')]['hopperIds'])){_0x2799ca['id']={'$notIn':_0x20b040[_0x6eec('0x48')][_0x6eec('0x6f')]};}_0x386a67=[[_0x6eec('0x70'),_0x6eec('0x74')],[_0x6eec('0x72'),_0xc852b3[0x0][_0x6eec('0x73')]],db[_0x6eec('0x75')][_0x6eec('0x76')](_0x6eec('0x78')),['id','ASC']];}return db[_0x6eec('0x15')][_0x6eec('0x79')]({'attributes':['id',_0x6eec('0x7a'),'phone',_0x6eec('0x7b')],'where':_0x2799ca,'order':_0x386a67,'transaction':_0x54fcd0,'lock':_0x54fcd0[_0x6eec('0x7c')]['UPDATE'],'include':[{'model':db[_0x6eec('0x5d')],'as':_0x6eec('0x7d'),'attributes':_0x1d8fb1,'include':[{'model':db[_0x6eec('0x7e')],'as':_0x6eec('0x7f'),'attributes':['id',_0x6eec('0x11')]}]},{'model':db['CmList'],'as':_0x6eec('0x80'),'attributes':['id',_0x6eec('0x11')]},{'model':db[_0x6eec('0x4c')],'as':_0x6eec('0x81'),'attributes':['id',_0x6eec('0x11'),'dialActive']}]})[_0x6eec('0x3d')](function(_0x16e5dd){if(_0x16e5dd){return _0x16e5dd[_0x6eec('0xd')]({'UserId':_0x20b040[_0x6eec('0x53')]['id']},{'transaction':_0x54fcd0});}});});}})[_0x6eec('0x3d')](handleEntityNotFound(_0x4a8fca,null))[_0x6eec('0x3d')](respondWithResult(_0x4a8fca,null))[_0x6eec('0x42')](handleError(_0x4a8fca,null));};exports[_0x6eec('0x82')]=function(_0x59feac,_0x43d89a,_0x59341a){var _0x55b7bb=[];var _0xd209bc=_0x59feac[_0x6eec('0x44')]['id'];var _0x23a2ba=_0x59feac['user']['id'];return db[_0x6eec('0x5d')]['describe']()[_0x6eec('0x3d')](function(_0x185793){_0x55b7bb=_[_0x6eec('0x1b')](_0x185793);return db[_0x6eec('0x75')]['transaction'](function(_0x4a64ed){const _0x5e0824={'id':_0xd209bc};return db[_0x6eec('0x15')][_0x6eec('0x79')]({'attributes':['id',_0x6eec('0x7a'),_0x6eec('0x7b')],'where':_0x5e0824,'transaction':_0x4a64ed,'lock':_0x4a64ed['LOCK'][_0x6eec('0x83')],'include':[{'model':db['CmContact'],'as':_0x6eec('0x7d'),'attributes':_0x55b7bb,'include':[{'model':db[_0x6eec('0x7e')],'as':'Company','attributes':['id',_0x6eec('0x11')]}]},{'model':db[_0x6eec('0x84')],'as':_0x6eec('0x80'),'attributes':['id',_0x6eec('0x11')]},{'model':db[_0x6eec('0x4c')],'as':_0x6eec('0x81'),'attributes':['id','name',_0x6eec('0x85')]}]})['then'](function(_0x64c2ef){if(_0x64c2ef){return _0x64c2ef[_0x6eec('0xd')]({'UserId':_0x23a2ba},{'transaction':_0x4a64ed});}});});})['then'](handleEntityNotFound(_0x43d89a,null))[_0x6eec('0x3d')](respondWithResult(_0x43d89a,null))['catch'](handleError(_0x43d89a,null));};exports[_0x6eec('0x86')]=function(_0x1d1683,_0x8a4166){return _0x1d1683[_0x6eec('0x53')]['getVoiceQueues']({'where':{'type':_0x6eec('0x68'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x6eec('0x3d')](function(_0x2c0a85){if(_0x2c0a85&&_0x2c0a85['length']){return db[_0x6eec('0x15')][_0x6eec('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6eec('0x57')](_0x6eec('0x58'))},'VoiceQueueId':{'$in':_[_0x6eec('0x14')](_0x2c0a85,'id')},'$or':[{'UserId':null},{'UserId':_0x1d1683['user']['id']}]}});}return 0x0;})[_0x6eec('0x3d')](function(_0x18e949){if(!_[_0x6eec('0x61')](_0x18e949)&&_[_0x6eec('0x87')](_0x18e949)){return _0x8a4166[_0x6eec('0x6')](0xc8)[_0x6eec('0xc')]({'contacts':_0x18e949});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s',_0x6eec('0x86'),0x194,_0x6eec('0x88'));_0x8a4166['sendStatus'](0x194);}})['catch'](handleError(_0x8a4166,null));};exports[_0x6eec('0x89')]=function(_0x1b62ba,_0x52b8b4){var _0x2c7853=shared[_0x6eec('0x8a')];var _0x1e69a0=[];_['map'](_0x2c7853,function(_0xcd62ad){_0x1e69a0['push']({'id':_0xcd62ad[_0x6eec('0x11')],'name':_0xcd62ad[_0x6eec('0x11')],'utcOffset':_0xcd62ad['utcOffset']});});return _0x52b8b4[_0x6eec('0x6')](0xc8)[_0x6eec('0xc')]({'tz':_0x1e69a0});};exports[_0x6eec('0x8b')]=function(_0x4a7a37,_0xf4f91){var _0xc4e3bc=shared[_0x6eec('0x8a')];var _0x1bdf2b={};if(!_[_0x6eec('0x61')](_0xc4e3bc[_0x4a7a37[_0x6eec('0x48')]['id']]))_0x1bdf2b=_0xc4e3bc[_0x4a7a37['body']['id']];return _0xf4f91[_0x6eec('0x6')](0xc8)[_0x6eec('0xc')](_0x1bdf2b);}; \ No newline at end of file +var _0x6737=['$ne','$eq','$not','$between','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$any','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','CmHopper','find','create','body','params','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','ivr','CmContact','firstName','calleridname','isNil','lastName','finally','CmHopperFinal','end','getVoiceQueues','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','literal','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','ASC','findOne','scheduledat','LOCK','UPDATE','Contact','Company','CmList','List','Queue','dialActive','recallme','CmCompany','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','limit','count','offset','set','Content-Range','json','update','then','sendStatus','error','stack','send','rawAttributes','type','key','model','map','name','query','filters','intersection','$and','$or','$gt','$gte','$lt'];(function(_0xc15f31,_0x3b513a){var _0x1fb9fd=function(_0x5e6e95){while(--_0x5e6e95){_0xc15f31['push'](_0xc15f31['shift']());}};_0x1fb9fd(++_0x3b513a);}(_0x6737,0xe2));var _0x7673=function(_0x54b40e,_0x231ab7){_0x54b40e=_0x54b40e-0x0;var _0x90dbe6=_0x6737[_0x54b40e];return _0x90dbe6;};'use strict';var moment=require('moment');var _=require(_0x7673('0x0'));var qs=require(_0x7673('0x1'));var logger=require('../../config/logger')(_0x7673('0x2'));var shared=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];function respondWithResult(_0x12efff,_0x54002e){_0x54002e=_0x54002e||0xc8;return function(_0x32e6f2){if(_0x32e6f2){return _0x12efff[_0x7673('0x5')](_0x54002e)['json'](_0x32e6f2);}};}function respondWithFilteredResult(_0x2f5edc,_0x15230f){return function(_0x5af802){if(_0x5af802){var _0x4e4b24=typeof _0x15230f['offset']==='undefined'&&typeof _0x15230f[_0x7673('0x6')]==='undefined';var _0x3b3184=_0x5af802[_0x7673('0x7')];var _0x5bfae2=_0x4e4b24?0x0:_0x15230f[_0x7673('0x8')];var _0x331f57=_0x4e4b24?_0x5af802[_0x7673('0x7')]:_0x15230f['offset']+_0x15230f['limit'];var _0x3ca258;if(_0x331f57>=_0x3b3184){_0x331f57=_0x3b3184;_0x3ca258=0xc8;}else{_0x3ca258=0xce;}_0x2f5edc['status'](_0x3ca258);return _0x2f5edc[_0x7673('0x9')](_0x7673('0xa'),_0x5bfae2+'-'+_0x331f57+'/'+_0x3b3184)[_0x7673('0xb')](_0x5af802);}return null;};}function saveUpdates(_0x451c87,_0x41d6bd){return function(_0x119e42){if(_0x119e42){return _0x119e42[_0x7673('0xc')](_0x451c87)[_0x7673('0xd')](function(_0x1da115){return _0x1da115;});}return null;};}function handleEntityNotFound(_0x20a649,_0x5c8626){return function(_0x26f0c4){if(!_0x26f0c4){_0x20a649[_0x7673('0xe')](0x194);}return _0x26f0c4;};}function handleError(_0x408470,_0x2c83d){_0x2c83d=_0x2c83d||0x1f4;return function(_0x224cea){logger[_0x7673('0xf')](_0x224cea[_0x7673('0x10')]);if(_0x224cea['name']){delete _0x224cea['name'];}_0x408470[_0x7673('0x5')](_0x2c83d)[_0x7673('0x11')](_0x224cea);};}exports['index']=function(_0x3afbb3,_0x17699a){var _0x58a821={},_0x33ff7d={},_0x44704d={'count':0x0,'rows':[]};var _0x1015ba=_['map'](db['CmHopper'][_0x7673('0x12')],function(_0x267fa3){return{'name':_0x267fa3['fieldName'],'type':_0x267fa3[_0x7673('0x13')][_0x7673('0x14')]};});_0x33ff7d[_0x7673('0x15')]=_[_0x7673('0x16')](_0x1015ba,_0x7673('0x17'));_0x33ff7d[_0x7673('0x18')]=_['keys'](_0x3afbb3['query']);_0x33ff7d[_0x7673('0x19')]=_[_0x7673('0x1a')](_0x33ff7d[_0x7673('0x15')],_0x33ff7d[_0x7673('0x18')]);_0x33ff7d[_0x7673('0x19')]=_['concat'](_0x33ff7d[_0x7673('0x19')],[_0x7673('0x1b'),_0x7673('0x1c'),_0x7673('0x1d'),_0x7673('0x1e'),_0x7673('0x1f'),'$lte',_0x7673('0x20'),_0x7673('0x21'),_0x7673('0x22'),_0x7673('0x23'),'$notBetween','$in',_0x7673('0x24'),_0x7673('0x25'),_0x7673('0x26'),_0x7673('0x27'),_0x7673('0x28'),_0x7673('0x25'),_0x7673('0x29'),'$contains','$contained',_0x7673('0x2a')]);_0x58a821[_0x7673('0x2b')]=_[_0x7673('0x1a')](_0x33ff7d[_0x7673('0x15')],qs[_0x7673('0x2c')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x2c')]));_0x58a821['attributes']=_0x58a821['attributes'][_0x7673('0x2d')]?_0x58a821[_0x7673('0x2b')]:_0x33ff7d[_0x7673('0x15')];if(!_0x3afbb3[_0x7673('0x18')]['hasOwnProperty'](_0x7673('0x2e'))){_0x58a821['limit']=qs[_0x7673('0x6')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x6')]);_0x58a821[_0x7673('0x8')]=qs[_0x7673('0x8')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x8')]);}_0x58a821[_0x7673('0x2f')]=qs[_0x7673('0x30')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x30')]);_0x58a821[_0x7673('0x31')]=qs[_0x7673('0x19')](_['pick'](_0x3afbb3[_0x7673('0x18')],_0x33ff7d[_0x7673('0x19')]),_0x1015ba);if(_0x3afbb3[_0x7673('0x18')][_0x7673('0x32')]){_0x58a821[_0x7673('0x31')]=_[_0x7673('0x33')](_0x58a821[_0x7673('0x31')],{'$or':_['map'](_0x1015ba,function(_0x563e2d){if(_0x563e2d[_0x7673('0x13')]!==_0x7673('0x34')){var _0x2d34cb={};_0x2d34cb[_0x563e2d[_0x7673('0x17')]]={'$like':'%'+_0x3afbb3[_0x7673('0x18')][_0x7673('0x32')]+'%'};return _0x2d34cb;}})});}_0x58a821=_[_0x7673('0x33')]({},_0x58a821,_0x3afbb3['options']);var _0x2845f6={'where':_0x58a821[_0x7673('0x31')]};return db['CmHopper'][_0x7673('0x7')](_0x2845f6)[_0x7673('0xd')](function(_0x287eee){_0x44704d[_0x7673('0x7')]=_0x287eee;if(_0x3afbb3['query'][_0x7673('0x35')]){_0x58a821[_0x7673('0x36')]=[{'all':!![]}];}return db['CmHopper'][_0x7673('0x37')](_0x58a821);})[_0x7673('0xd')](function(_0x1be04a){_0x44704d['rows']=_0x1be04a;return _0x44704d;})[_0x7673('0xd')](respondWithFilteredResult(_0x17699a,_0x58a821))[_0x7673('0x38')](handleError(_0x17699a,null));};exports[_0x7673('0x39')]=function(_0x5dfb9a,_0x4c6106){var _0x13ce30={'raw':!![],'where':{'id':_0x5dfb9a['params']['id']}},_0x5efdf6={};_0x5efdf6[_0x7673('0x15')]=_[_0x7673('0x3a')](db['CmHopper'][_0x7673('0x12')]);_0x5efdf6[_0x7673('0x18')]=_[_0x7673('0x3a')](_0x5dfb9a[_0x7673('0x18')]);_0x5efdf6[_0x7673('0x19')]=_[_0x7673('0x1a')](_0x5efdf6['model'],_0x5efdf6[_0x7673('0x18')]);_0x13ce30['attributes']=_[_0x7673('0x1a')](_0x5efdf6['model'],qs[_0x7673('0x2c')](_0x5dfb9a[_0x7673('0x18')]['fields']));_0x13ce30['attributes']=_0x13ce30[_0x7673('0x2b')]['length']?_0x13ce30[_0x7673('0x2b')]:_0x5efdf6[_0x7673('0x15')];if(_0x5dfb9a[_0x7673('0x18')][_0x7673('0x35')]){_0x13ce30[_0x7673('0x36')]=[{'all':!![]}];}_0x13ce30=_['merge']({},_0x13ce30,_0x5dfb9a['options']);return db[_0x7673('0x3b')][_0x7673('0x3c')](_0x13ce30)['then'](handleEntityNotFound(_0x4c6106,null))[_0x7673('0xd')](respondWithResult(_0x4c6106,null))[_0x7673('0x38')](handleError(_0x4c6106,null));};exports[_0x7673('0x3d')]=function(_0x5991d7,_0x1a9017){return db[_0x7673('0x3b')][_0x7673('0x3d')](_0x5991d7[_0x7673('0x3e')],{})[_0x7673('0xd')](respondWithResult(_0x1a9017,0xc9))[_0x7673('0x38')](handleError(_0x1a9017,null));};exports[_0x7673('0xc')]=function(_0x232576,_0x58e17d){if(_0x232576['body']['id']){delete _0x232576[_0x7673('0x3e')]['id'];}return db[_0x7673('0x3b')][_0x7673('0x3c')]({'where':{'id':_0x232576[_0x7673('0x3f')]['id']}})[_0x7673('0xd')](handleEntityNotFound(_0x58e17d,null))[_0x7673('0xd')](saveUpdates(_0x232576[_0x7673('0x3e')],null))['then'](respondWithResult(_0x58e17d,null))[_0x7673('0x38')](handleError(_0x58e17d,null));};exports[_0x7673('0x40')]=function(_0x461ac3,_0x2de2e9){return db[_0x7673('0x3b')]['describe']()[_0x7673('0xd')](respondWithResult(_0x2de2e9,null))[_0x7673('0x38')](handleError(_0x2de2e9,null));};exports[_0x7673('0x41')]=function(_0x2397fb,_0x3f76a3){var _0x4c022d;var _0x56cd7a=_0x2397fb[_0x7673('0x3f')]['id'];return db[_0x7673('0x3b')]['find']({'where':{'id':_0x2397fb[_0x7673('0x3f')]['id']}})[_0x7673('0xd')](handleEntityNotFound(_0x3f76a3,null))[_0x7673('0xd')](function(_0x32a5e7){if(_0x32a5e7){return _0x32a5e7[_0x7673('0x41')]()['then'](function(_0x23789d){return _0x23789d;});}})[_0x7673('0xd')](function(_0x2a275b){_0x4c022d=_0x2a275b;if(_0x2a275b){if(_0x2a275b[_0x7673('0x42')]||_0x2a275b['CampaignId']){return db[_0x2a275b[_0x7673('0x42')]?_0x7673('0x43'):_0x7673('0x44')][_0x7673('0x3c')]({'where':{'id':_0x2a275b[_0x7673('0x42')]?_0x2a275b[_0x7673('0x42')]:_0x2a275b[_0x7673('0x45')]},'attributes':['id',_0x7673('0x17')],'raw':!![]});}}})[_0x7673('0xd')](function(_0x362409){var _0xcb9e0b={};if(_0x362409){_['merge'](_0xcb9e0b,_[_0x7673('0x46')](_0x4c022d['dataValues'],[_0x7673('0x47'),_0x7673('0x48'),'id']));_0xcb9e0b[_0x7673('0x49')]=0x15;_0xcb9e0b['statedesc']=_0x7673('0x4a');_0xcb9e0b[_0x7673('0x4b')]=_0x362409[_0x7673('0x17')];_0xcb9e0b[_0x7673('0x4c')]=_0x2397fb[_0x7673('0x4d')][_0x7673('0x17')];_0xcb9e0b[_0x7673('0x4e')]=_0x2397fb[_0x7673('0x4d')]['id'];_0xcb9e0b[_0x7673('0x4a')]=!![];_0xcb9e0b[_0x7673('0x4f')]=moment()[_0x7673('0x50')](_0x7673('0x51'));_0xcb9e0b[_0x7673('0x52')]=_0x4c022d[_0x7673('0x53')];_0xcb9e0b['campaigntype']=_0x4c022d[_0x7673('0x42')]?'queue':_0x7673('0x54');return db[_0x7673('0x55')][_0x7673('0x3c')]({'where':{'id':_0xcb9e0b['ContactId']},'attributes':[_0x7673('0x56'),'lastName']})['then'](function(_0x1804a4){if(!_['isNil'](_0x3f76a3)&&!_['isNil'](_0x1804a4[_0x7673('0x56')])){_0xcb9e0b[_0x7673('0x57')]=_0x1804a4[_0x7673('0x56')];if(!_[_0x7673('0x58')](_0x1804a4[_0x7673('0x59')])){_0xcb9e0b[_0x7673('0x57')]+='\x20'+_0x1804a4[_0x7673('0x59')];}}})[_0x7673('0x5a')](function(){return db[_0x7673('0x5b')][_0x7673('0x3d')](_0xcb9e0b);});}})[_0x7673('0xd')](function(_0x5e1985){return db['CmHopperAdditionalPhone'][_0x7673('0x41')]({'where':{'CmHopperId':_0x56cd7a}});})[_0x7673('0xd')](function(){return _0x3f76a3[_0x7673('0x5')](0xcc)[_0x7673('0x5c')]();})[_0x7673('0x38')](handleError(_0x3f76a3,null));};exports['getPreview']=function(_0x5caca9,_0x44fa26){var _0x7ac2d=[];return db[_0x7673('0x55')][_0x7673('0x40')]()[_0x7673('0xd')](function(_0x47b5b3){_0x7ac2d=_[_0x7673('0x3a')](_0x47b5b3);return _0x5caca9[_0x7673('0x4d')][_0x7673('0x5d')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7673('0x5e')},'attributes':['id','dialOrderByScheduledAt',_0x7673('0x5f')],'raw':!![]});})[_0x7673('0xd')](function(_0x31be3a){if(_0x31be3a&&_0x31be3a['length']){return db[_0x7673('0x60')][_0x7673('0x61')](function(_0x562a20){var _0x53c638={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7673('0x51'))},'VoiceQueueId':{'$in':_[_0x7673('0x16')](_0x31be3a,'id')},'$or':[{'UserId':null},{'UserId':_0x5caca9[_0x7673('0x4d')]['id']}]};var _0x40776d={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x31be3a)['filter']([_0x7673('0x5f'),0x0])['map']('id')[_0x7673('0x62')]()},'$or':[{'UserId':null},{'UserId':_0x5caca9[_0x7673('0x4d')]['id']}]};var _0x12cfe7={'$or':[_0x53c638,_0x40776d]};var _0x2a8feb=[];if(_0x5caca9['body'][_0x7673('0x63')]&&_0x5caca9[_0x7673('0x3e')][_0x7673('0x63')]==='prev'){if(!_['isEmpty'](_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')])){_0x12cfe7['id']={'$in':_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')]};}_0x2a8feb=[[_0x7673('0x65'),'ASC'],[_0x7673('0x66'),_0x31be3a[0x0][_0x7673('0x67')]==='ASC'?'DESC':'ASC'],db[_0x7673('0x60')][_0x7673('0x68')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x7673('0x69')]];}else{if(!_['isEmpty'](_0x5caca9['body'][_0x7673('0x64')])){_0x12cfe7['id']={'$notIn':_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')]};}_0x2a8feb=[[_0x7673('0x65'),'DESC'],[_0x7673('0x66'),_0x31be3a[0x0]['dialOrderByScheduledAt']],db[_0x7673('0x60')][_0x7673('0x68')](_0x7673('0x6a')),['id',_0x7673('0x6b')]];}return db[_0x7673('0x3b')][_0x7673('0x6c')]({'attributes':['id',_0x7673('0x6d'),'phone','recallme'],'where':_0x12cfe7,'order':_0x2a8feb,'transaction':_0x562a20,'lock':_0x562a20[_0x7673('0x6e')][_0x7673('0x6f')],'include':[{'model':db[_0x7673('0x55')],'as':_0x7673('0x70'),'attributes':_0x7ac2d,'include':[{'model':db['CmCompany'],'as':_0x7673('0x71'),'attributes':['id',_0x7673('0x17')]}]},{'model':db[_0x7673('0x72')],'as':_0x7673('0x73'),'attributes':['id',_0x7673('0x17')]},{'model':db['VoiceQueue'],'as':_0x7673('0x74'),'attributes':['id',_0x7673('0x17'),_0x7673('0x75')]}]})['then'](function(_0x376f42){if(_0x376f42){return _0x376f42[_0x7673('0xc')]({'UserId':_0x5caca9[_0x7673('0x4d')]['id']},{'transaction':_0x562a20});}});});}})[_0x7673('0xd')](handleEntityNotFound(_0x44fa26,null))[_0x7673('0xd')](respondWithResult(_0x44fa26,null))[_0x7673('0x38')](handleError(_0x44fa26,null));};exports['getPreviewRecall']=function(_0xc74a16,_0x36a751,_0xc6660d){var _0x413d2a=[];var _0x1a32e3=_0xc74a16[_0x7673('0x3f')]['id'];var _0x533e5b=_0xc74a16[_0x7673('0x4d')]['id'];return db[_0x7673('0x55')][_0x7673('0x40')]()[_0x7673('0xd')](function(_0x52de39){_0x413d2a=_[_0x7673('0x3a')](_0x52de39);return db[_0x7673('0x60')][_0x7673('0x61')](function(_0xc4e03e){const _0xfed5e5={'id':_0x1a32e3};return db[_0x7673('0x3b')][_0x7673('0x6c')]({'attributes':['id',_0x7673('0x6d'),_0x7673('0x76')],'where':_0xfed5e5,'transaction':_0xc4e03e,'lock':_0xc4e03e[_0x7673('0x6e')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x7673('0x70'),'attributes':_0x413d2a,'include':[{'model':db[_0x7673('0x77')],'as':_0x7673('0x71'),'attributes':['id','name']}]},{'model':db[_0x7673('0x72')],'as':_0x7673('0x73'),'attributes':['id',_0x7673('0x17')]},{'model':db['VoiceQueue'],'as':_0x7673('0x74'),'attributes':['id','name',_0x7673('0x75')]}]})[_0x7673('0xd')](function(_0x4c7b28){if(_0x4c7b28){return _0x4c7b28['update']({'UserId':_0x533e5b},{'transaction':_0xc4e03e});}});});})[_0x7673('0xd')](handleEntityNotFound(_0x36a751,null))[_0x7673('0xd')](respondWithResult(_0x36a751,null))['catch'](handleError(_0x36a751,null));};exports['getOpenContacts']=function(_0x384aac,_0x595493){return _0x384aac[_0x7673('0x4d')][_0x7673('0x5d')]({'where':{'type':_0x7673('0x78'),'dialActive':!![],'dialMethod':_0x7673('0x5e')},'attributes':['id'],'raw':!![]})[_0x7673('0xd')](function(_0x3c82d3){if(_0x3c82d3&&_0x3c82d3[_0x7673('0x2d')]){return db[_0x7673('0x3b')][_0x7673('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7673('0x51'))},'VoiceQueueId':{'$in':_[_0x7673('0x16')](_0x3c82d3,'id')},'$or':[{'UserId':null},{'UserId':_0x384aac[_0x7673('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x1cc5c2){if(!_[_0x7673('0x58')](_0x1cc5c2)&&_[_0x7673('0x79')](_0x1cc5c2)){return _0x595493[_0x7673('0x5')](0xc8)[_0x7673('0xb')]({'contacts':_0x1cc5c2});}else{logger[_0x7673('0xf')](_0x7673('0x7a'),'getOpenContacts',0x194,_0x7673('0x7b'));_0x595493['sendStatus'](0x194);}})[_0x7673('0x38')](handleError(_0x595493,null));};exports[_0x7673('0x7c')]=function(_0x1c61f9,_0x3a7767){var _0x4ed050=shared[_0x7673('0x7d')];var _0x31e97c=[];_[_0x7673('0x16')](_0x4ed050,function(_0x541a8a){_0x31e97c[_0x7673('0x7e')]({'id':_0x541a8a[_0x7673('0x17')],'name':_0x541a8a[_0x7673('0x17')],'utcOffset':_0x541a8a[_0x7673('0x7f')]});});return _0x3a7767['status'](0xc8)[_0x7673('0xb')]({'tz':_0x31e97c});};exports[_0x7673('0x80')]=function(_0x493c4d,_0x2d3583){var _0x332c63=shared['timezones'];var _0x3ba1aa={};if(!_['isNil'](_0x332c63[_0x493c4d[_0x7673('0x3e')]['id']]))_0x3ba1aa=_0x332c63[_0x493c4d['body']['id']];return _0x2d3583[_0x7673('0x5')](0xc8)[_0x7673('0xb')](_0x3ba1aa);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 2581f84..803db1e 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 _0xf494=['define','scheduledat','phone','priority','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x417f11,_0x8196fc){var _0x35cfb4=function(_0x4e9d88){while(--_0x4e9d88){_0x417f11['push'](_0x417f11['shift']());}};_0x35cfb4(++_0x8196fc);}(_0xf494,0x1c6));var _0x4f49=function(_0x6ebf46,_0x15132e){_0x6ebf46=_0x6ebf46-0x0;var _0x448f35=_0xf494[_0x6ebf46];return _0x448f35;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]},{'name':_0x4f49('0xd'),'fields':[_0x4f49('0xd')]},{'name':_0x4f49('0xe'),'fields':[_0x4f49('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2a07=['api','moment','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger'];(function(_0x16d24f,_0x4686a5){var _0x3beec6=function(_0x552ae0){while(--_0x552ae0){_0x16d24f['push'](_0x16d24f['shift']());}};_0x3beec6(++_0x4686a5);}(_0x2a07,0x74));var _0x72a0=function(_0x438434,_0x36f21f){_0x438434=_0x438434-0x0;var _0x3b97c9=_0x2a07[_0x438434];return _0x3b97c9;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[{'name':_0x72a0('0xe'),'fields':[_0x72a0('0xe')]},{'name':_0x72a0('0xf'),'fields':[_0x72a0('0xf')]},{'name':_0x72a0('0x10'),'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 2c16f17..ef5fc3f 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 _0x94db=['GetContactDialer','describe','transaction','order','LOCK','UPDATE','Contact','User','Agent','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','sequelize','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','\x20,\x201,\x20null','GetContactRecallMe','CmContact','GetCmHopperPreview','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','NOW()','name','CmList','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','GetCmHopper','debug','stringify','catch','error','message','ShowCmHopper','find','info','CreateCmHopper','create','UpdateCmHopper','update','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper'];(function(_0x4b6778,_0x505a76){var _0x22dbb9=function(_0x4881eb){while(--_0x4881eb){_0x4b6778['push'](_0x4b6778['shift']());}};_0x22dbb9(++_0x505a76);}(_0x94db,0x1b8));var _0xb94d=function(_0xb88439,_0x36cbc6){_0xb88439=_0xb88439-0x0;var _0x3df599=_0x94db[_0xb88439];return _0x3df599;};'use strict';var _=require(_0xb94d('0x0'));var util=require(_0xb94d('0x1'));var moment=require(_0xb94d('0x2'));var BPromise=require(_0xb94d('0x3'));var db=require(_0xb94d('0x4'))['db'];var logger=require(_0xb94d('0x5'))(_0xb94d('0x6'));exports['GetCmHopper']=function(_0x2c06da){var _0x1d4f74=this;return new Promise(function(_0x19b9c3,_0xf76590){return db[_0xb94d('0x7')][_0xb94d('0x8')]({'raw':_0x2c06da['options']?_0x2c06da[_0xb94d('0x9')][_0xb94d('0xa')]===undefined?!![]:![]:!![],'where':_0x2c06da[_0xb94d('0x9')]?_0x2c06da[_0xb94d('0x9')][_0xb94d('0xb')]||null:null,'attributes':_0x2c06da[_0xb94d('0x9')]?_0x2c06da['options'][_0xb94d('0xc')]||null:null,'limit':_0x2c06da[_0xb94d('0x9')]?_0x2c06da[_0xb94d('0x9')][_0xb94d('0xd')]||null:null,'include':_0x2c06da[_0xb94d('0x9')]?_0x2c06da[_0xb94d('0x9')][_0xb94d('0xe')]?_[_0xb94d('0xf')](_0x2c06da[_0xb94d('0x9')]['include'],function(_0x3c73ec){return{'model':db[_0x3c73ec[_0xb94d('0x10')]],'as':_0x3c73ec['as'],'attributes':_0x3c73ec[_0xb94d('0xc')],'include':_0x3c73ec[_0xb94d('0xe')]?_[_0xb94d('0xf')](_0x3c73ec[_0xb94d('0xe')],function(_0x126e37){return{'model':db[_0x126e37[_0xb94d('0x10')]],'as':_0x126e37['as'],'attributes':_0x126e37['attributes'],'include':_0x126e37[_0xb94d('0xe')]?_['map'](_0x126e37[_0xb94d('0xe')],function(_0x5a50d7){return{'model':db[_0x5a50d7[_0xb94d('0x10')]],'as':_0x5a50d7['as'],'attributes':_0x5a50d7['attributes']};}):[]};}):[]};}):[]:[]})[_0xb94d('0x11')](function(_0x3d0714){logger['info'](_0xb94d('0x12'),_0x2c06da);logger[_0xb94d('0x13')]('GetCmHopper',_0x2c06da,JSON[_0xb94d('0x14')](_0x3d0714));_0x19b9c3(_0x3d0714);})[_0xb94d('0x15')](function(_0xff8eda){logger[_0xb94d('0x16')]('GetCmHopper',_0xff8eda['message'],_0x2c06da);_0xf76590(_0x1d4f74[_0xb94d('0x16')](0x1f4,_0xff8eda[_0xb94d('0x17')]));});});};exports[_0xb94d('0x18')]=function(_0x3b27fe){var _0x42423f=this;return new Promise(function(_0x40a4a0,_0x138920){return db[_0xb94d('0x7')][_0xb94d('0x19')]({'raw':_0x3b27fe[_0xb94d('0x9')]?_0x3b27fe[_0xb94d('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x3b27fe[_0xb94d('0x9')]?_0x3b27fe[_0xb94d('0x9')]['where']||null:null,'attributes':_0x3b27fe[_0xb94d('0x9')]?_0x3b27fe[_0xb94d('0x9')][_0xb94d('0xc')]||null:null,'include':_0x3b27fe[_0xb94d('0x9')]?_0x3b27fe[_0xb94d('0x9')]['include']?_['map'](_0x3b27fe['options'][_0xb94d('0xe')],function(_0x3c9b1a){return{'model':db[_0x3c9b1a[_0xb94d('0x10')]],'as':_0x3c9b1a['as'],'attributes':_0x3c9b1a[_0xb94d('0xc')],'include':_0x3c9b1a[_0xb94d('0xe')]?_['map'](_0x3c9b1a[_0xb94d('0xe')],function(_0x270cf4){return{'model':db[_0x270cf4[_0xb94d('0x10')]],'as':_0x270cf4['as'],'attributes':_0x270cf4['attributes'],'include':_0x270cf4[_0xb94d('0xe')]?_[_0xb94d('0xf')](_0x270cf4['include'],function(_0x383e94){return{'model':db[_0x383e94[_0xb94d('0x10')]],'as':_0x383e94['as'],'attributes':_0x383e94['attributes']};}):[]};}):[]};}):[]:[]})[_0xb94d('0x11')](function(_0x8ab9c){logger[_0xb94d('0x1a')](_0xb94d('0x18'),_0x3b27fe);logger[_0xb94d('0x13')](_0xb94d('0x18'),_0x3b27fe,JSON['stringify'](_0x8ab9c));_0x40a4a0(_0x8ab9c);})[_0xb94d('0x15')](function(_0x121d7c){logger[_0xb94d('0x16')]('ShowCmHopper',_0x121d7c[_0xb94d('0x17')],_0x3b27fe);_0x138920(_0x42423f['error'](0x1f4,_0x121d7c['message']));});});};exports[_0xb94d('0x1b')]=function(_0x8b62f3){var _0x280aff=this;return new Promise(function(_0x21d57e,_0xb8fd81){return db[_0xb94d('0x7')][_0xb94d('0x1c')](_0x8b62f3['body'],{'raw':_0x8b62f3[_0xb94d('0x9')]?_0x8b62f3[_0xb94d('0x9')]['raw']===undefined?!![]:![]:!![]})[_0xb94d('0x11')](function(_0x3c2985){logger['info']('CreateCmHopper',_0x8b62f3);logger['debug'](_0xb94d('0x1b'),_0x8b62f3,JSON['stringify'](_0x3c2985));_0x21d57e(_0x3c2985);})[_0xb94d('0x15')](function(_0x430fc4){logger[_0xb94d('0x16')](_0xb94d('0x1b'),_0x430fc4[_0xb94d('0x17')],_0x8b62f3);_0xb8fd81(_0x280aff[_0xb94d('0x16')](0x1f4,_0x430fc4[_0xb94d('0x17')]));});});};exports[_0xb94d('0x1d')]=function(_0x3c146f){var _0x3245f0=this;return new Promise(function(_0x367849,_0x270c2a){return db[_0xb94d('0x7')][_0xb94d('0x1e')](_0x3c146f[_0xb94d('0x1f')],{'raw':_0x3c146f['options']?_0x3c146f['options'][_0xb94d('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c146f[_0xb94d('0x9')]?_0x3c146f[_0xb94d('0x9')][_0xb94d('0xb')]||null:null,'attributes':_0x3c146f['options']?_0x3c146f[_0xb94d('0x9')][_0xb94d('0xc')]||null:null,'limit':_0x3c146f[_0xb94d('0x9')]?_0x3c146f[_0xb94d('0x9')][_0xb94d('0xd')]||null:null})['then'](function(_0x47d34f){logger['info'](_0xb94d('0x1d'),_0x3c146f);logger['info'](_0xb94d('0x20'),JSON[_0xb94d('0x14')](_0x3c146f[_0xb94d('0x9')][_0xb94d('0xb')]),_0x3c146f['body']['active']);logger[_0xb94d('0x13')](_0xb94d('0x1d'),_0x3c146f,JSON[_0xb94d('0x14')](_0x47d34f));_0x367849(_0x47d34f);})[_0xb94d('0x15')](function(_0x1cd943){logger[_0xb94d('0x16')](_0xb94d('0x1d'),_0x1cd943['message'],_0x3c146f);_0x270c2a(_0x3245f0[_0xb94d('0x16')](0x1f4,_0x1cd943[_0xb94d('0x17')]));});});};exports['DestroyCmHopper']=function(_0x517bce){var _0x38eb86=this;return new Promise(function(_0x39efc0,_0x4fee3d){return db[_0xb94d('0x7')]['destroy']({'where':_0x517bce[_0xb94d('0x9')]?_0x517bce[_0xb94d('0x9')]['where']||null:null})[_0xb94d('0x11')](function(_0x52d3eb){logger['info'](_0xb94d('0x21'),_0x517bce);logger[_0xb94d('0x13')](_0xb94d('0x21'),_0x517bce,JSON[_0xb94d('0x14')](_0x52d3eb));_0x39efc0(_0x52d3eb);})[_0xb94d('0x15')](function(_0x3baf0a){logger[_0xb94d('0x16')]('DestroyCmHopper',_0x3baf0a['message'],_0x517bce);_0x4fee3d(_0x38eb86[_0xb94d('0x16')](0x1f4,_0x3baf0a[_0xb94d('0x17')]));});});};exports[_0xb94d('0x22')]=function(_0x20b5df){var _0xf7709d=this;return new Promise(function(_0x3fe4e3,_0x1127b6){return db['CmContact'][_0xb94d('0x23')]()[_0xb94d('0x11')](function(_0x56d6c7){return db['sequelize'][_0xb94d('0x24')](function(_0x153e15){return db[_0xb94d('0x7')]['findAll']({'where':_0x20b5df['options']?_0x20b5df[_0xb94d('0x9')]['where']||null:null,'attributes':_0x20b5df[_0xb94d('0x9')]?_0x20b5df[_0xb94d('0x9')][_0xb94d('0xc')]||null:null,'limit':_0x20b5df['options']?_0x20b5df[_0xb94d('0x9')][_0xb94d('0xd')]||null:null,'order':_0x20b5df['options']?_0x20b5df[_0xb94d('0x9')][_0xb94d('0x25')]||null:null,'transaction':_0x153e15,'lock':_0x153e15[_0xb94d('0x26')][_0xb94d('0x27')],'include':[{'model':db['CmContact'],'as':_0xb94d('0x28'),'attributes':_['keys'](_0x56d6c7)},{'model':db[_0xb94d('0x29')],'as':_0xb94d('0x2a'),'attributes':['id','name',_0xb94d('0x2b')]}]})[_0xb94d('0x11')](function(_0x49bab5){var _0x1ebb01=[];var _0x4e785a=[];for(var _0x47da6c=0x0;_0x47da6c<_0x49bab5[_0xb94d('0x2c')];_0x47da6c+=0x1){var _0xbe3562=_0x49bab5[_0x47da6c][_0xb94d('0x2d')];if(_0xbe3562===null){_0x1ebb01[_0xb94d('0x2e')](_0x49bab5[_0x47da6c][_0xb94d('0x1e')](_0x20b5df['body'],{'transaction':_0x153e15}));}else if(!_0x4e785a[_0xb94d('0x2f')](_0xbe3562)){_0x4e785a[_0xb94d('0x2e')](_0xbe3562);_0x1ebb01['push'](_0x49bab5[_0x47da6c][_0xb94d('0x1e')](_0x20b5df['body'],{'transaction':_0x153e15}));}}return BPromise[_0xb94d('0x30')](_0x1ebb01);});})[_0xb94d('0x11')](function(_0x1cafa8){logger[_0xb94d('0x1a')]('GetContactDialer',_0x20b5df);if(_0x1cafa8['length']>0x0){logger[_0xb94d('0x1a')](_0xb94d('0x31'),_0x1cafa8[0x0][_0xb94d('0x32')]['id'],_0x1cafa8[0x0][_0xb94d('0x32')][_0xb94d('0x33')],_0x1cafa8[0x0]['dataValues'][_0xb94d('0x34')]);}logger[_0xb94d('0x13')](_0xb94d('0x22'),_0x20b5df,JSON[_0xb94d('0x14')](_0x1cafa8));_0x3fe4e3(_0x1cafa8);})['catch'](function(_0x419067){logger[_0xb94d('0x16')](_0xb94d('0x22'),_0x419067['message'],_0x20b5df);_0x1127b6(_0xf7709d[_0xb94d('0x16')](0x1f4,_0x419067[_0xb94d('0x17')]));});});});};exports[_0xb94d('0x35')]=function(_0x4e4d49){var _0x1cd7bb=this;return new Promise(function(_0x2c9787,_0x155758){return db[_0xb94d('0x36')][_0xb94d('0x24')](function(_0x15870b){return db[_0xb94d('0x37')][_0xb94d('0x1c')](_0x4e4d49[_0xb94d('0x1f')],{'raw':_0x4e4d49['options']?_0x4e4d49[_0xb94d('0x9')][_0xb94d('0xa')]===undefined?!![]:![]:!![],'transaction':_0x15870b})[_0xb94d('0x11')](function(){logger[_0xb94d('0x1a')](_0xb94d('0x38'),JSON[_0xb94d('0x14')](_0x4e4d49[_0xb94d('0x9')][_0xb94d('0xb')]),_0x4e4d49[_0xb94d('0x9')][_0xb94d('0xb')]['active']);return db[_0xb94d('0x7')][_0xb94d('0x39')]({'where':_0x4e4d49[_0xb94d('0x9')]?_0x4e4d49[_0xb94d('0x9')]['where']||null:null,'transaction':_0x15870b});});})[_0xb94d('0x11')](function(_0x558d24){logger['info'](_0xb94d('0x35'),_0x4e4d49);logger[_0xb94d('0x13')]('MoveContactManagedDialer',_0x4e4d49,JSON[_0xb94d('0x14')](_0x558d24));_0x2c9787(_0x558d24);})[_0xb94d('0x15')](function(_0xb3e109){logger[_0xb94d('0x16')](_0xb94d('0x35'),_0xb3e109[_0xb94d('0x17')],_0x4e4d49);_0x155758(_0x1cd7bb[_0xb94d('0x16')](0x1f4,_0xb3e109[_0xb94d('0x17')]));});});};exports[_0xb94d('0x3a')]=function(_0x17d16c){var _0x72d6b6=this;return new Promise(function(_0x6caba8,_0x586b72){return db[_0xb94d('0x7')]['findAll']({'raw':_0x17d16c[_0xb94d('0x9')]?_0x17d16c[_0xb94d('0x9')][_0xb94d('0xa')]===undefined?!![]:![]:!![],'where':_0x17d16c[_0xb94d('0x9')]?_0x17d16c[_0xb94d('0x9')][_0xb94d('0xb')]||null:null,'attributes':[[db[_0xb94d('0x36')]['fn'](_0xb94d('0x3b'),db[_0xb94d('0x36')]['fn']('IF',db[_0xb94d('0x36')][_0xb94d('0x3c')](_0xb94d('0x3d')+util['format'](_0xb94d('0x3e'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+_0xb94d('0x3f')))),'contactsRescheduled']]})['then'](function(_0x3d2842){logger[_0xb94d('0x1a')](_0xb94d('0x3a'),_0x17d16c);logger[_0xb94d('0x13')](_0xb94d('0x3a'),_0x17d16c,JSON[_0xb94d('0x14')](_0x3d2842));_0x6caba8(_0x3d2842);})['catch'](function(_0x36a197){logger[_0xb94d('0x16')](_0xb94d('0x3a'),_0x36a197[_0xb94d('0x17')],_0x17d16c);_0x586b72(_0x72d6b6[_0xb94d('0x16')](0x1f4,_0x36a197[_0xb94d('0x17')]));});});};exports[_0xb94d('0x40')]=function(_0x578786){var _0x24b57c=this;return new Promise(function(_0xee2cd8,_0x5bc7fd){return db[_0xb94d('0x41')][_0xb94d('0x23')]()[_0xb94d('0x11')](function(){return db[_0xb94d('0x36')][_0xb94d('0x24')](function(_0x52bab8){return db[_0xb94d('0x7')][_0xb94d('0x8')]({'where':_0x578786[_0xb94d('0x9')]?_0x578786[_0xb94d('0x9')][_0xb94d('0xb')]||null:null,'attributes':_0x578786['options']?_0x578786[_0xb94d('0x9')][_0xb94d('0xc')]||null:null,'limit':0x1,'order':_0x578786[_0xb94d('0x9')]?_0x578786[_0xb94d('0x9')][_0xb94d('0x25')]||null:null,'group':db['CmHopper'][_0xb94d('0x2d')],'transaction':_0x52bab8,'lock':_0x52bab8[_0xb94d('0x26')][_0xb94d('0x27')],'include':_0x578786['options']?_0x578786[_0xb94d('0x9')][_0xb94d('0xe')]?_[_0xb94d('0xf')](_0x578786[_0xb94d('0x9')]['include'],function(_0x4dd171){return{'model':db[_0x4dd171[_0xb94d('0x10')]],'as':_0x4dd171['as'],'attributes':_0x4dd171[_0xb94d('0xc')],'include':_0x4dd171[_0xb94d('0xe')]?_[_0xb94d('0xf')](_0x4dd171[_0xb94d('0xe')],function(_0x4ecf15){return{'model':db[_0x4ecf15[_0xb94d('0x10')]],'as':_0x4ecf15['as'],'attributes':_0x4ecf15['attributes'],'include':_0x4ecf15['include']?_[_0xb94d('0xf')](_0x4ecf15[_0xb94d('0xe')],function(_0x11a4bd){return{'model':db[_0x11a4bd[_0xb94d('0x10')]],'as':_0x11a4bd['as'],'attributes':_0x11a4bd[_0xb94d('0xc')]};}):[]};}):[]};}):[]:[]})[_0xb94d('0x11')](function(_0xa514fa){var _0x5e2071=[];for(var _0x2118d1=0x0;_0x2118d1<_0xa514fa[_0xb94d('0x2c')];_0x2118d1+=0x1){_0x5e2071[_0xb94d('0x2e')](_0xa514fa[_0x2118d1]['update'](_0x578786['body'],{'transaction':_0x52bab8}));}return BPromise['all'](_0x5e2071);});})[_0xb94d('0x11')](function(_0x367ce7){logger['info'](_0xb94d('0x40'),_0x578786);logger[_0xb94d('0x13')](_0xb94d('0x40'),_0x578786,JSON['stringify'](_0x367ce7));_0xee2cd8(_0x367ce7);})[_0xb94d('0x15')](function(_0x50e4bb){logger['error']('GetContactRecallMe',_0x50e4bb[_0xb94d('0x17')],_0x578786);_0x5bc7fd(_0x24b57c[_0xb94d('0x16')](0x1f4,_0x50e4bb[_0xb94d('0x17')]));});});});};exports[_0xb94d('0x42')]=function(_0x418ba0){var _0x25d693=this;return new Promise(function(_0x59e200,_0x284b9f){db[_0xb94d('0x41')][_0xb94d('0x23')]()['then'](function(_0x487a26){return db[_0xb94d('0x7')]['findAll']({'raw':_0x418ba0[_0xb94d('0x9')]?_0x418ba0[_0xb94d('0x9')][_0xb94d('0xa')]===undefined?!![]:![]:!![],'where':_0x418ba0['options']?_0x418ba0[_0xb94d('0x9')][_0xb94d('0xb')]||null:null,'attributes':_0x418ba0['options']?_0x418ba0[_0xb94d('0x9')]['attributes']||null:null,'limit':_0x418ba0[_0xb94d('0x9')]?_0x418ba0['options']['limit']||null:null,'include':_0x418ba0[_0xb94d('0x9')]?_0x418ba0[_0xb94d('0x9')][_0xb94d('0xe')]?_[_0xb94d('0xf')](_0x418ba0['options']['include'],function(_0x131b94){return{'model':db[_0x131b94[_0xb94d('0x10')]],'as':_0x131b94['as'],'attributes':_0x131b94['as']===_0xb94d('0x28')?_['keys'](_0x487a26):_0x131b94['attributes'],'include':_0x131b94[_0xb94d('0xe')]?_['map'](_0x131b94['include'],function(_0x4c58b5){return{'model':db[_0x4c58b5[_0xb94d('0x10')]],'as':_0x4c58b5['as'],'attributes':_0x4c58b5['attributes'],'include':_0x4c58b5['include']?_[_0xb94d('0xf')](_0x4c58b5[_0xb94d('0xe')],function(_0x4d8203){return{'model':db[_0x4d8203[_0xb94d('0x10')]],'as':_0x4d8203['as'],'attributes':_0x4d8203['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x199d3e){logger[_0xb94d('0x1a')](_0xb94d('0x12'),_0x418ba0);logger[_0xb94d('0x13')](_0xb94d('0x12'),_0x418ba0,JSON[_0xb94d('0x14')](_0x199d3e));_0x59e200(_0x199d3e);})[_0xb94d('0x15')](function(_0x3f9d3a){logger['error']('GetCmHopper',_0x3f9d3a[_0xb94d('0x17')],_0x418ba0);_0x284b9f(_0x25d693[_0xb94d('0x16')](0x1f4,_0x3f9d3a[_0xb94d('0x17')]));});});});};exports['GetContactByPhone']=function(_0x1f4425){var _0x8f56f6=this;return new Promise(function(_0x5a2cb4,_0xf9ac50){return db[_0xb94d('0x41')][_0xb94d('0x43')]({'raw':!![],'where':{'phone':_0x1f4425['options'][_0xb94d('0xb')][_0xb94d('0x44')]},'attributes':['id',_0xb94d('0x45')],'order':[['id','DESC']]})[_0xb94d('0x11')](function(_0x3c76b0){logger['info'](_0xb94d('0x46'),_0x1f4425);logger[_0xb94d('0x13')]('getContactByPhone',_0x1f4425,JSON['stringify'](_0x3c76b0));_0x5a2cb4(_0x3c76b0);})[_0xb94d('0x15')](function(_0x3b65b7){logger[_0xb94d('0x16')](_0xb94d('0x46'),_0x3b65b7['message'],_0x1f4425);_0xf9ac50(_0x8f56f6['error'](0x1f4,_0x3b65b7[_0xb94d('0x17')]));});});};exports[_0xb94d('0x47')]=function(_0x2bb178){var _0x3c4fa2=this;return new Promise(function(_0x568d28,_0x55ed42){return db[_0xb94d('0x36')][_0xb94d('0x24')](function(_0x367264){var _0x3c6222=_0x2bb178[_0xb94d('0x9')]&&_0x2bb178[_0xb94d('0x9')][_0xb94d('0xb')]?_0x2bb178['options'][_0xb94d('0xb')]:{};return db[_0xb94d('0x7')][_0xb94d('0x1e')](_0x2bb178[_0xb94d('0x1f')],{'where':_0x3c6222,'transaction':_0x367264})[_0xb94d('0x11')](function(_0x54850b){logger[_0xb94d('0x1a')](_0xb94d('0x47'),_0x2bb178);logger['debug'](_0xb94d('0x47'),_0x2bb178,JSON[_0xb94d('0x14')](_0x54850b));_0x568d28(_0x54850b);})['catch'](function(_0x2fd200){logger['error']('ResetActiveCalls',_0x2fd200['message'],_0x2bb178);_0x55ed42(_0x3c4fa2[_0xb94d('0x16')](0x1f4,_0x2fd200['message']));});});});};exports[_0xb94d('0x48')]=function(_0x20a1a3){var _0x2f8a38=this;var _0x62f8=_0x20a1a3[_0xb94d('0x1f')]['where'][_0xb94d('0x49')];var _0x166179=_0x20a1a3[_0xb94d('0x1f')]['where']['interval'];var _0x3fcb64=_0x20a1a3[_0xb94d('0x1f')][_0xb94d('0xb')][_0xb94d('0x4a')];return new Promise(function(_0x2e804f,_0x364bb4){return db[_0xb94d('0x7')]['findAll']({'where':{'voiceQueueId':{'$in':_0x62f8},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xb94d('0x36')][_0xb94d('0x3c')](_0xb94d('0x4b')+_0x166179+'\x20MINUTE'),'$gt':db['sequelize'][_0xb94d('0x3c')](_0xb94d('0x4c'))}},'UserId':{'$in':_0x3fcb64}},'include':[{'model':db[_0xb94d('0x41')],'as':'Contact'},{'model':db[_0xb94d('0x29')],'as':_0xb94d('0x2a'),'attributes':['id',_0xb94d('0x4d'),'voicePause']},{'model':db[_0xb94d('0x4e')],'as':'List'}]})[_0xb94d('0x11')](function(_0x53efd2){if(_0x53efd2[_0xb94d('0x2c')]>0x0){return db[_0xb94d('0x36')][_0xb94d('0x24')](function(_0x24980b){return db[_0xb94d('0x7')][_0xb94d('0x1e')]({'recallmeNotifiedDate':db[_0xb94d('0x36')][_0xb94d('0x3c')](_0xb94d('0x4c'))},{'where':{'id':{'$in':_['map'](_0x53efd2,'id')}},'transaction':_0x24980b})[_0xb94d('0x11')](function(){_0x2e804f(_0x53efd2);})[_0xb94d('0x15')](function(_0x3e0fe9){logger[_0xb94d('0x16')]('CmHopperHandlePreviewRecallNotifications',_0x3e0fe9[_0xb94d('0x17')],_0x20a1a3);_0x364bb4(_0x2f8a38['error'](0x1f4,_0x3e0fe9[_0xb94d('0x17')]));});})[_0xb94d('0x15')](function(_0x4f7aa3){logger[_0xb94d('0x16')](_0xb94d('0x48'),_0x4f7aa3['message'],_0x20a1a3);_0x364bb4(_0x2f8a38[_0xb94d('0x16')](0x1f4,_0x4f7aa3[_0xb94d('0x17')]));});}else{_0x2e804f(_0x53efd2);}});});}; \ No newline at end of file +var _0xb8f0=['includes','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','active','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','CmContact','all','GetCmHopperPreview','Contact','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','literal','\x20MINUTE','User','Agent','List','NOW()','lodash','util','moment','bluebird','../../config/logger','rpc','GetCmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','catch','error','message','ShowCmHopper','CmHopper','info','create','body','CreateCmHopper','stringify','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','DestroyCmHopper','GetContactDialer','describe','sequelize','transaction','order','LOCK','UPDATE','keys','name','voicePause','length','UserId','push'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0xb8f0,0x112));var _0x0b8f=function(_0x3db039,_0x30c8dd){_0x3db039=_0x3db039-0x0;var _0x293a41=_0xb8f0[_0x3db039];return _0x293a41;};'use strict';var _=require(_0x0b8f('0x0'));var util=require(_0x0b8f('0x1'));var moment=require(_0x0b8f('0x2'));var BPromise=require(_0x0b8f('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x0b8f('0x4'))(_0x0b8f('0x5'));exports[_0x0b8f('0x6')]=function(_0x5ce80c){var _0x142593=this;return new Promise(function(_0x452208,_0x36b484){return db['CmHopper'][_0x0b8f('0x7')]({'raw':_0x5ce80c[_0x0b8f('0x8')]?_0x5ce80c[_0x0b8f('0x8')][_0x0b8f('0x9')]===undefined?!![]:![]:!![],'where':_0x5ce80c[_0x0b8f('0x8')]?_0x5ce80c[_0x0b8f('0x8')][_0x0b8f('0xa')]||null:null,'attributes':_0x5ce80c['options']?_0x5ce80c['options'][_0x0b8f('0xb')]||null:null,'limit':_0x5ce80c[_0x0b8f('0x8')]?_0x5ce80c[_0x0b8f('0x8')][_0x0b8f('0xc')]||null:null,'include':_0x5ce80c[_0x0b8f('0x8')]?_0x5ce80c[_0x0b8f('0x8')][_0x0b8f('0xd')]?_[_0x0b8f('0xe')](_0x5ce80c['options'][_0x0b8f('0xd')],function(_0x4255c0){return{'model':db[_0x4255c0[_0x0b8f('0xf')]],'as':_0x4255c0['as'],'attributes':_0x4255c0[_0x0b8f('0xb')],'include':_0x4255c0[_0x0b8f('0xd')]?_[_0x0b8f('0xe')](_0x4255c0[_0x0b8f('0xd')],function(_0xe28b92){return{'model':db[_0xe28b92[_0x0b8f('0xf')]],'as':_0xe28b92['as'],'attributes':_0xe28b92[_0x0b8f('0xb')],'include':_0xe28b92[_0x0b8f('0xd')]?_[_0x0b8f('0xe')](_0xe28b92[_0x0b8f('0xd')],function(_0x2fb8e0){return{'model':db[_0x2fb8e0['model']],'as':_0x2fb8e0['as'],'attributes':_0x2fb8e0['attributes']};}):[]};}):[]};}):[]:[]})[_0x0b8f('0x10')](function(_0x13aadb){logger['info'](_0x0b8f('0x6'),_0x5ce80c);logger[_0x0b8f('0x11')](_0x0b8f('0x6'),_0x5ce80c,JSON['stringify'](_0x13aadb));_0x452208(_0x13aadb);})[_0x0b8f('0x12')](function(_0x4017ae){logger[_0x0b8f('0x13')](_0x0b8f('0x6'),_0x4017ae[_0x0b8f('0x14')],_0x5ce80c);_0x36b484(_0x142593[_0x0b8f('0x13')](0x1f4,_0x4017ae[_0x0b8f('0x14')]));});});};exports[_0x0b8f('0x15')]=function(_0x29558e){var _0x255c42=this;return new Promise(function(_0x41a925,_0x51a239){return db[_0x0b8f('0x16')]['find']({'raw':_0x29558e['options']?_0x29558e[_0x0b8f('0x8')][_0x0b8f('0x9')]===undefined?!![]:![]:!![],'where':_0x29558e[_0x0b8f('0x8')]?_0x29558e['options'][_0x0b8f('0xa')]||null:null,'attributes':_0x29558e[_0x0b8f('0x8')]?_0x29558e[_0x0b8f('0x8')][_0x0b8f('0xb')]||null:null,'include':_0x29558e[_0x0b8f('0x8')]?_0x29558e[_0x0b8f('0x8')]['include']?_[_0x0b8f('0xe')](_0x29558e[_0x0b8f('0x8')][_0x0b8f('0xd')],function(_0x597966){return{'model':db[_0x597966[_0x0b8f('0xf')]],'as':_0x597966['as'],'attributes':_0x597966['attributes'],'include':_0x597966[_0x0b8f('0xd')]?_[_0x0b8f('0xe')](_0x597966[_0x0b8f('0xd')],function(_0xa5e2b6){return{'model':db[_0xa5e2b6['model']],'as':_0xa5e2b6['as'],'attributes':_0xa5e2b6[_0x0b8f('0xb')],'include':_0xa5e2b6[_0x0b8f('0xd')]?_['map'](_0xa5e2b6['include'],function(_0x266654){return{'model':db[_0x266654[_0x0b8f('0xf')]],'as':_0x266654['as'],'attributes':_0x266654[_0x0b8f('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc55083){logger[_0x0b8f('0x17')]('ShowCmHopper',_0x29558e);logger[_0x0b8f('0x11')](_0x0b8f('0x15'),_0x29558e,JSON['stringify'](_0xc55083));_0x41a925(_0xc55083);})['catch'](function(_0x3c9824){logger[_0x0b8f('0x13')](_0x0b8f('0x15'),_0x3c9824['message'],_0x29558e);_0x51a239(_0x255c42['error'](0x1f4,_0x3c9824[_0x0b8f('0x14')]));});});};exports['CreateCmHopper']=function(_0x1ac2ff){var _0x43fc75=this;return new Promise(function(_0x54a5d3,_0x255727){return db[_0x0b8f('0x16')][_0x0b8f('0x18')](_0x1ac2ff[_0x0b8f('0x19')],{'raw':_0x1ac2ff[_0x0b8f('0x8')]?_0x1ac2ff['options'][_0x0b8f('0x9')]===undefined?!![]:![]:!![]})[_0x0b8f('0x10')](function(_0xf8dc70){logger[_0x0b8f('0x17')]('CreateCmHopper',_0x1ac2ff);logger['debug'](_0x0b8f('0x1a'),_0x1ac2ff,JSON[_0x0b8f('0x1b')](_0xf8dc70));_0x54a5d3(_0xf8dc70);})[_0x0b8f('0x12')](function(_0x49be41){logger[_0x0b8f('0x13')](_0x0b8f('0x1a'),_0x49be41['message'],_0x1ac2ff);_0x255727(_0x43fc75[_0x0b8f('0x13')](0x1f4,_0x49be41[_0x0b8f('0x14')]));});});};exports[_0x0b8f('0x1c')]=function(_0x47959a){var _0x19234b=this;return new Promise(function(_0x5d79f8,_0x1d26d1){return db[_0x0b8f('0x16')][_0x0b8f('0x1d')](_0x47959a[_0x0b8f('0x19')],{'raw':_0x47959a[_0x0b8f('0x8')]?_0x47959a[_0x0b8f('0x8')][_0x0b8f('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47959a[_0x0b8f('0x8')]?_0x47959a[_0x0b8f('0x8')][_0x0b8f('0xa')]||null:null,'attributes':_0x47959a[_0x0b8f('0x8')]?_0x47959a[_0x0b8f('0x8')][_0x0b8f('0xb')]||null:null,'limit':_0x47959a[_0x0b8f('0x8')]?_0x47959a[_0x0b8f('0x8')][_0x0b8f('0xc')]||null:null})['then'](function(_0x24742a){logger['info'](_0x0b8f('0x1c'),_0x47959a);logger['info'](_0x0b8f('0x1e'),JSON[_0x0b8f('0x1b')](_0x47959a['options'][_0x0b8f('0xa')]),_0x47959a[_0x0b8f('0x19')]['active']);logger[_0x0b8f('0x11')]('UpdateCmHopper',_0x47959a,JSON[_0x0b8f('0x1b')](_0x24742a));_0x5d79f8(_0x24742a);})[_0x0b8f('0x12')](function(_0xc0a910){logger[_0x0b8f('0x13')](_0x0b8f('0x1c'),_0xc0a910[_0x0b8f('0x14')],_0x47959a);_0x1d26d1(_0x19234b[_0x0b8f('0x13')](0x1f4,_0xc0a910['message']));});});};exports['DestroyCmHopper']=function(_0x2ac09a){var _0x1fe390=this;return new Promise(function(_0x554aa7,_0x533103){return db['CmHopper'][_0x0b8f('0x1f')]({'where':_0x2ac09a['options']?_0x2ac09a['options']['where']||null:null})[_0x0b8f('0x10')](function(_0x51804e){logger[_0x0b8f('0x17')](_0x0b8f('0x20'),_0x2ac09a);logger['debug'](_0x0b8f('0x20'),_0x2ac09a,JSON[_0x0b8f('0x1b')](_0x51804e));_0x554aa7(_0x51804e);})[_0x0b8f('0x12')](function(_0x3e5a56){logger['error']('DestroyCmHopper',_0x3e5a56[_0x0b8f('0x14')],_0x2ac09a);_0x533103(_0x1fe390[_0x0b8f('0x13')](0x1f4,_0x3e5a56['message']));});});};exports[_0x0b8f('0x21')]=function(_0x185887){var _0x4926cb=this;return new Promise(function(_0x2501ec,_0x4c4983){return db['CmContact'][_0x0b8f('0x22')]()['then'](function(_0x144223){return db[_0x0b8f('0x23')][_0x0b8f('0x24')](function(_0x5a3939){return db[_0x0b8f('0x16')][_0x0b8f('0x7')]({'where':_0x185887[_0x0b8f('0x8')]?_0x185887[_0x0b8f('0x8')][_0x0b8f('0xa')]||null:null,'attributes':_0x185887['options']?_0x185887[_0x0b8f('0x8')][_0x0b8f('0xb')]||null:null,'limit':_0x185887[_0x0b8f('0x8')]?_0x185887['options'][_0x0b8f('0xc')]||null:null,'order':_0x185887[_0x0b8f('0x8')]?_0x185887[_0x0b8f('0x8')][_0x0b8f('0x25')]||null:null,'transaction':_0x5a3939,'lock':_0x5a3939[_0x0b8f('0x26')][_0x0b8f('0x27')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0x0b8f('0x28')](_0x144223)},{'model':db['User'],'as':'Agent','attributes':['id',_0x0b8f('0x29'),_0x0b8f('0x2a')]}]})['then'](function(_0x4e72fa){var _0x490778=[];var _0x31b7ee=[];for(var _0x5c8054=0x0;_0x5c8054<_0x4e72fa[_0x0b8f('0x2b')];_0x5c8054+=0x1){var _0x5f5ac9=_0x4e72fa[_0x5c8054][_0x0b8f('0x2c')];if(_0x5f5ac9===null){_0x490778[_0x0b8f('0x2d')](_0x4e72fa[_0x5c8054][_0x0b8f('0x1d')](_0x185887[_0x0b8f('0x19')],{'transaction':_0x5a3939}));}else if(!_0x31b7ee[_0x0b8f('0x2e')](_0x5f5ac9)){_0x31b7ee['push'](_0x5f5ac9);_0x490778['push'](_0x4e72fa[_0x5c8054]['update'](_0x185887[_0x0b8f('0x19')],{'transaction':_0x5a3939}));}}return BPromise['all'](_0x490778);});})[_0x0b8f('0x10')](function(_0x1d5555){logger[_0x0b8f('0x17')]('GetContactDialer',_0x185887);if(_0x1d5555['length']>0x0){logger['info'](_0x0b8f('0x2f'),_0x1d5555[0x0]['dataValues']['id'],_0x1d5555[0x0][_0x0b8f('0x30')]['ContactId'],_0x1d5555[0x0][_0x0b8f('0x30')][_0x0b8f('0x31')]);}logger[_0x0b8f('0x11')](_0x0b8f('0x21'),_0x185887,JSON[_0x0b8f('0x1b')](_0x1d5555));_0x2501ec(_0x1d5555);})[_0x0b8f('0x12')](function(_0x5a6da9){logger[_0x0b8f('0x13')](_0x0b8f('0x21'),_0x5a6da9['message'],_0x185887);_0x4c4983(_0x4926cb[_0x0b8f('0x13')](0x1f4,_0x5a6da9[_0x0b8f('0x14')]));});});});};exports[_0x0b8f('0x32')]=function(_0x2cba54){var _0x3dc73b=this;return new Promise(function(_0x3df0ba,_0x394d58){return db['sequelize']['transaction'](function(_0x578091){return db['CmHopperFinal'][_0x0b8f('0x18')](_0x2cba54[_0x0b8f('0x19')],{'raw':_0x2cba54['options']?_0x2cba54[_0x0b8f('0x8')][_0x0b8f('0x9')]===undefined?!![]:![]:!![],'transaction':_0x578091})['then'](function(){logger[_0x0b8f('0x17')](_0x0b8f('0x33'),JSON['stringify'](_0x2cba54[_0x0b8f('0x8')][_0x0b8f('0xa')]),_0x2cba54[_0x0b8f('0x8')][_0x0b8f('0xa')][_0x0b8f('0x31')]);return db[_0x0b8f('0x16')]['destroy']({'where':_0x2cba54['options']?_0x2cba54[_0x0b8f('0x8')][_0x0b8f('0xa')]||null:null,'transaction':_0x578091});});})['then'](function(_0x3f355b){logger[_0x0b8f('0x17')](_0x0b8f('0x32'),_0x2cba54);logger[_0x0b8f('0x11')]('MoveContactManagedDialer',_0x2cba54,JSON[_0x0b8f('0x1b')](_0x3f355b));_0x3df0ba(_0x3f355b);})[_0x0b8f('0x12')](function(_0x598f0c){logger[_0x0b8f('0x13')]('MoveContactManagedDialer',_0x598f0c[_0x0b8f('0x14')],_0x2cba54);_0x394d58(_0x3dc73b['error'](0x1f4,_0x598f0c[_0x0b8f('0x14')]));});});};exports[_0x0b8f('0x34')]=function(_0x6080bf){var _0x769243=this;return new Promise(function(_0x5d3a5e,_0x32f450){return db[_0x0b8f('0x16')][_0x0b8f('0x7')]({'raw':_0x6080bf[_0x0b8f('0x8')]?_0x6080bf[_0x0b8f('0x8')][_0x0b8f('0x9')]===undefined?!![]:![]:!![],'where':_0x6080bf['options']?_0x6080bf[_0x0b8f('0x8')][_0x0b8f('0xa')]||null:null,'attributes':[[db[_0x0b8f('0x23')]['fn'](_0x0b8f('0x35'),db[_0x0b8f('0x23')]['fn']('IF',db[_0x0b8f('0x23')]['literal'](_0x0b8f('0x36')+util[_0x0b8f('0x37')](_0x0b8f('0x38'),moment()['format'](_0x0b8f('0x39')))+'\x20,\x201,\x20null'))),_0x0b8f('0x3a')]]})[_0x0b8f('0x10')](function(_0xfef99){logger[_0x0b8f('0x17')](_0x0b8f('0x34'),_0x6080bf);logger[_0x0b8f('0x11')](_0x0b8f('0x34'),_0x6080bf,JSON[_0x0b8f('0x1b')](_0xfef99));_0x5d3a5e(_0xfef99);})[_0x0b8f('0x12')](function(_0x3c8d3e){logger[_0x0b8f('0x13')]('CountReScheduled',_0x3c8d3e[_0x0b8f('0x14')],_0x6080bf);_0x32f450(_0x769243['error'](0x1f4,_0x3c8d3e['message']));});});};exports[_0x0b8f('0x3b')]=function(_0xcfc673){var _0x2f299b=this;return new Promise(function(_0x154f00,_0x569332){return db[_0x0b8f('0x3c')]['describe']()[_0x0b8f('0x10')](function(){return db[_0x0b8f('0x23')][_0x0b8f('0x24')](function(_0xcf7456){return db[_0x0b8f('0x16')][_0x0b8f('0x7')]({'where':_0xcfc673['options']?_0xcfc673[_0x0b8f('0x8')]['where']||null:null,'attributes':_0xcfc673[_0x0b8f('0x8')]?_0xcfc673[_0x0b8f('0x8')]['attributes']||null:null,'limit':0x1,'order':_0xcfc673[_0x0b8f('0x8')]?_0xcfc673['options'][_0x0b8f('0x25')]||null:null,'group':db[_0x0b8f('0x16')][_0x0b8f('0x2c')],'transaction':_0xcf7456,'lock':_0xcf7456['LOCK'][_0x0b8f('0x27')],'include':_0xcfc673[_0x0b8f('0x8')]?_0xcfc673[_0x0b8f('0x8')]['include']?_[_0x0b8f('0xe')](_0xcfc673['options']['include'],function(_0x40c1c0){return{'model':db[_0x40c1c0[_0x0b8f('0xf')]],'as':_0x40c1c0['as'],'attributes':_0x40c1c0[_0x0b8f('0xb')],'include':_0x40c1c0[_0x0b8f('0xd')]?_['map'](_0x40c1c0[_0x0b8f('0xd')],function(_0x523340){return{'model':db[_0x523340[_0x0b8f('0xf')]],'as':_0x523340['as'],'attributes':_0x523340[_0x0b8f('0xb')],'include':_0x523340[_0x0b8f('0xd')]?_[_0x0b8f('0xe')](_0x523340['include'],function(_0xc8ae2e){return{'model':db[_0xc8ae2e[_0x0b8f('0xf')]],'as':_0xc8ae2e['as'],'attributes':_0xc8ae2e[_0x0b8f('0xb')]};}):[]};}):[]};}):[]:[]})[_0x0b8f('0x10')](function(_0x36bfc3){var _0x5548dd=[];for(var _0x230c4c=0x0;_0x230c4c<_0x36bfc3[_0x0b8f('0x2b')];_0x230c4c+=0x1){_0x5548dd[_0x0b8f('0x2d')](_0x36bfc3[_0x230c4c][_0x0b8f('0x1d')](_0xcfc673['body'],{'transaction':_0xcf7456}));}return BPromise[_0x0b8f('0x3d')](_0x5548dd);});})[_0x0b8f('0x10')](function(_0x5af5c2){logger[_0x0b8f('0x17')](_0x0b8f('0x3b'),_0xcfc673);logger[_0x0b8f('0x11')](_0x0b8f('0x3b'),_0xcfc673,JSON[_0x0b8f('0x1b')](_0x5af5c2));_0x154f00(_0x5af5c2);})[_0x0b8f('0x12')](function(_0x372cf5){logger['error'](_0x0b8f('0x3b'),_0x372cf5[_0x0b8f('0x14')],_0xcfc673);_0x569332(_0x2f299b[_0x0b8f('0x13')](0x1f4,_0x372cf5[_0x0b8f('0x14')]));});});});};exports[_0x0b8f('0x3e')]=function(_0xfccca8){var _0x4499b4=this;return new Promise(function(_0x43dfc3,_0x26eaeb){db[_0x0b8f('0x3c')][_0x0b8f('0x22')]()[_0x0b8f('0x10')](function(_0x154bbc){return db[_0x0b8f('0x16')]['findAll']({'raw':_0xfccca8[_0x0b8f('0x8')]?_0xfccca8[_0x0b8f('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0xfccca8[_0x0b8f('0x8')]?_0xfccca8[_0x0b8f('0x8')][_0x0b8f('0xa')]||null:null,'attributes':_0xfccca8[_0x0b8f('0x8')]?_0xfccca8[_0x0b8f('0x8')]['attributes']||null:null,'limit':_0xfccca8[_0x0b8f('0x8')]?_0xfccca8['options'][_0x0b8f('0xc')]||null:null,'include':_0xfccca8['options']?_0xfccca8[_0x0b8f('0x8')][_0x0b8f('0xd')]?_[_0x0b8f('0xe')](_0xfccca8[_0x0b8f('0x8')][_0x0b8f('0xd')],function(_0xfccd59){return{'model':db[_0xfccd59[_0x0b8f('0xf')]],'as':_0xfccd59['as'],'attributes':_0xfccd59['as']===_0x0b8f('0x3f')?_[_0x0b8f('0x28')](_0x154bbc):_0xfccd59[_0x0b8f('0xb')],'include':_0xfccd59[_0x0b8f('0xd')]?_['map'](_0xfccd59[_0x0b8f('0xd')],function(_0x32ac2b){return{'model':db[_0x32ac2b[_0x0b8f('0xf')]],'as':_0x32ac2b['as'],'attributes':_0x32ac2b[_0x0b8f('0xb')],'include':_0x32ac2b['include']?_[_0x0b8f('0xe')](_0x32ac2b[_0x0b8f('0xd')],function(_0x1797fa){return{'model':db[_0x1797fa[_0x0b8f('0xf')]],'as':_0x1797fa['as'],'attributes':_0x1797fa['attributes']};}):[]};}):[]};}):[]:[]})[_0x0b8f('0x10')](function(_0x537477){logger['info'](_0x0b8f('0x6'),_0xfccca8);logger[_0x0b8f('0x11')](_0x0b8f('0x6'),_0xfccca8,JSON[_0x0b8f('0x1b')](_0x537477));_0x43dfc3(_0x537477);})[_0x0b8f('0x12')](function(_0x8f58da){logger[_0x0b8f('0x13')](_0x0b8f('0x6'),_0x8f58da[_0x0b8f('0x14')],_0xfccca8);_0x26eaeb(_0x4499b4['error'](0x1f4,_0x8f58da[_0x0b8f('0x14')]));});});});};exports[_0x0b8f('0x40')]=function(_0x27910d){var _0x8d3703=this;return new Promise(function(_0x1e2a30,_0x4abe3c){return db[_0x0b8f('0x3c')][_0x0b8f('0x41')]({'raw':!![],'where':{'phone':_0x27910d[_0x0b8f('0x8')]['where']['phone']},'attributes':['id',_0x0b8f('0x42')],'order':[['id',_0x0b8f('0x43')]]})[_0x0b8f('0x10')](function(_0x4a71bc){logger[_0x0b8f('0x17')](_0x0b8f('0x44'),_0x27910d);logger['debug']('getContactByPhone',_0x27910d,JSON[_0x0b8f('0x1b')](_0x4a71bc));_0x1e2a30(_0x4a71bc);})['catch'](function(_0x27b4ce){logger[_0x0b8f('0x13')](_0x0b8f('0x44'),_0x27b4ce[_0x0b8f('0x14')],_0x27910d);_0x4abe3c(_0x8d3703['error'](0x1f4,_0x27b4ce[_0x0b8f('0x14')]));});});};exports[_0x0b8f('0x45')]=function(_0x151542){var _0x1384c1=this;return new Promise(function(_0x3de5b3,_0x27a235){return db[_0x0b8f('0x23')][_0x0b8f('0x24')](function(_0x859fe0){var _0xcd618f=_0x151542[_0x0b8f('0x8')]&&_0x151542[_0x0b8f('0x8')][_0x0b8f('0xa')]?_0x151542[_0x0b8f('0x8')]['where']:{};return db[_0x0b8f('0x16')][_0x0b8f('0x1d')](_0x151542['body'],{'where':_0xcd618f,'transaction':_0x859fe0})['then'](function(_0xe16dd6){logger[_0x0b8f('0x17')](_0x0b8f('0x45'),_0x151542);logger[_0x0b8f('0x11')](_0x0b8f('0x45'),_0x151542,JSON[_0x0b8f('0x1b')](_0xe16dd6));_0x3de5b3(_0xe16dd6);})[_0x0b8f('0x12')](function(_0xa1fc62){logger[_0x0b8f('0x13')](_0x0b8f('0x45'),_0xa1fc62[_0x0b8f('0x14')],_0x151542);_0x27a235(_0x1384c1['error'](0x1f4,_0xa1fc62[_0x0b8f('0x14')]));});});});};exports[_0x0b8f('0x46')]=function(_0x14ea6d){var _0x4f67e0=this;var _0x444f8c=_0x14ea6d[_0x0b8f('0x19')][_0x0b8f('0xa')][_0x0b8f('0x47')];var _0xc32830=_0x14ea6d['body'][_0x0b8f('0xa')][_0x0b8f('0x48')];var _0x51ee4f=_0x14ea6d[_0x0b8f('0x19')][_0x0b8f('0xa')][_0x0b8f('0x49')];return new Promise(function(_0x358daa,_0x1ceb1b){return db[_0x0b8f('0x16')][_0x0b8f('0x7')]({'where':{'voiceQueueId':{'$in':_0x444f8c},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x0b8f('0x23')][_0x0b8f('0x4a')]('NOW()\x20+\x20INTERVAL\x20'+_0xc32830+_0x0b8f('0x4b')),'$gt':db[_0x0b8f('0x23')][_0x0b8f('0x4a')]('NOW()')}},'UserId':{'$in':_0x51ee4f}},'include':[{'model':db[_0x0b8f('0x3c')],'as':'Contact'},{'model':db[_0x0b8f('0x4c')],'as':_0x0b8f('0x4d'),'attributes':['id',_0x0b8f('0x29'),'voicePause']},{'model':db['CmList'],'as':_0x0b8f('0x4e')}]})['then'](function(_0x399b5f){if(_0x399b5f[_0x0b8f('0x2b')]>0x0){return db[_0x0b8f('0x23')]['transaction'](function(_0x8a1f4){return db[_0x0b8f('0x16')]['update']({'recallmeNotifiedDate':db[_0x0b8f('0x23')]['literal'](_0x0b8f('0x4f'))},{'where':{'id':{'$in':_['map'](_0x399b5f,'id')}},'transaction':_0x8a1f4})[_0x0b8f('0x10')](function(){_0x358daa(_0x399b5f);})[_0x0b8f('0x12')](function(_0x2102b4){logger[_0x0b8f('0x13')]('CmHopperHandlePreviewRecallNotifications',_0x2102b4[_0x0b8f('0x14')],_0x14ea6d);_0x1ceb1b(_0x4f67e0['error'](0x1f4,_0x2102b4[_0x0b8f('0x14')]));});})[_0x0b8f('0x12')](function(_0x47d3f1){logger[_0x0b8f('0x13')]('CmHopperHandlePreviewRecallNotifications',_0x47d3f1[_0x0b8f('0x14')],_0x14ea6d);_0x1ceb1b(_0x4f67e0['error'](0x1f4,_0x47d3f1[_0x0b8f('0x14')]));});}else{_0x358daa(_0x399b5f);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 3ea2230..3d0b0f6 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 _0x4b63=['getPreview','/timezone','put','update','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','isAuthenticated','get','/describe','describe','/opencontacts','/timezones','getTimezones','/:id','/:id/previewrecall','getPreviewRecall','post','/preview'];(function(_0x116cde,_0x315b6e){var _0x2ada78=function(_0x453187){while(--_0x453187){_0x116cde['push'](_0x116cde['shift']());}};_0x2ada78(++_0x315b6e);}(_0x4b63,0xd6));var _0x34b6=function(_0x1e196b,_0x175aa7){_0x1e196b=_0x1e196b-0x0;var _0x330e6d=_0x4b63[_0x1e196b];return _0x330e6d;};'use strict';var express=require(_0x34b6('0x0'));var router=express[_0x34b6('0x1')]();var auth=require(_0x34b6('0x2'));var controller=require(_0x34b6('0x3'));router['get']('/',auth[_0x34b6('0x4')](),controller['index']);router[_0x34b6('0x5')](_0x34b6('0x6'),auth[_0x34b6('0x4')](),controller[_0x34b6('0x7')]);router[_0x34b6('0x5')](_0x34b6('0x8'),auth[_0x34b6('0x4')](),controller['getOpenContacts']);router[_0x34b6('0x5')](_0x34b6('0x9'),auth[_0x34b6('0x4')](),controller[_0x34b6('0xa')]);router[_0x34b6('0x5')](_0x34b6('0xb'),auth[_0x34b6('0x4')](),controller['show']);router[_0x34b6('0x5')](_0x34b6('0xc'),auth['isAuthenticated'](),controller[_0x34b6('0xd')]);router['post']('/',auth[_0x34b6('0x4')](),controller['create']);router[_0x34b6('0xe')](_0x34b6('0xf'),auth['isAuthenticated'](),controller[_0x34b6('0x10')]);router[_0x34b6('0xe')](_0x34b6('0x11'),auth[_0x34b6('0x4')](),controller['getTimezone']);router[_0x34b6('0x12')](_0x34b6('0xb'),auth[_0x34b6('0x4')](),controller[_0x34b6('0x13')]);router[_0x34b6('0x14')](_0x34b6('0xb'),auth[_0x34b6('0x4')](),controller[_0x34b6('0x15')]);module[_0x34b6('0x16')]=router; \ No newline at end of file +var _0x1ab6=['isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/:id','/:id/previewrecall','post','getPreview','/timezone','getTimezone','update','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get'];(function(_0x55a777,_0x2c95f7){var _0x8ca6a1=function(_0x3cc973){while(--_0x3cc973){_0x55a777['push'](_0x55a777['shift']());}};_0x8ca6a1(++_0x2c95f7);}(_0x1ab6,0x73));var _0x61ab=function(_0x2ac7b9,_0x295272){_0x2ac7b9=_0x2ac7b9-0x0;var _0x51375d=_0x1ab6[_0x2ac7b9];return _0x51375d;};'use strict';var express=require(_0x61ab('0x0'));var router=express[_0x61ab('0x1')]();var auth=require(_0x61ab('0x2'));var controller=require(_0x61ab('0x3'));router[_0x61ab('0x4')]('/',auth[_0x61ab('0x5')](),controller[_0x61ab('0x6')]);router['get'](_0x61ab('0x7'),auth['isAuthenticated'](),controller[_0x61ab('0x8')]);router[_0x61ab('0x4')](_0x61ab('0x9'),auth['isAuthenticated'](),controller[_0x61ab('0xa')]);router[_0x61ab('0x4')]('/timezones',auth[_0x61ab('0x5')](),controller['getTimezones']);router['get'](_0x61ab('0xb'),auth[_0x61ab('0x5')](),controller['show']);router['get'](_0x61ab('0xc'),auth[_0x61ab('0x5')](),controller['getPreviewRecall']);router[_0x61ab('0xd')]('/',auth[_0x61ab('0x5')](),controller['create']);router[_0x61ab('0xd')]('/preview',auth[_0x61ab('0x5')](),controller[_0x61ab('0xe')]);router[_0x61ab('0xd')](_0x61ab('0xf'),auth[_0x61ab('0x5')](),controller[_0x61ab('0x10')]);router['put'](_0x61ab('0xb'),auth[_0x61ab('0x5')](),controller[_0x61ab('0x11')]);router['delete'](_0x61ab('0xb'),auth['isAuthenticated'](),controller[_0x61ab('0x12')]);module[_0x61ab('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index ecb3884..5aa88eb 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 _0x05d5=['INTEGER','STRING','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x4fd1e9,_0x5e61f6){var _0x3577ae=function(_0x2ae094){while(--_0x2ae094){_0x4fd1e9['push'](_0x4fd1e9['shift']());}};_0x3577ae(++_0x5e61f6);}(_0x05d5,0x10b));var _0x505d=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x05d5[_0x2a6809];return _0x11c371;};'use strict';var moment=require(_0x505d('0x0'));var Sequelize=require('sequelize');module['exports']={'CmHopperId':{'type':Sequelize[_0x505d('0x1')]},'phone':{'type':Sequelize[_0x505d('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x505d('0x3'))},'countbusyretry':{'type':Sequelize[_0x505d('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x505d('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x505d('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x505d('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x505d('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x505d('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x505d('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd86c=['exports','INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3b986a,_0x148398){var _0x386a50=function(_0x7f1879){while(--_0x7f1879){_0x3b986a['push'](_0x3b986a['shift']());}};_0x386a50(++_0x148398);}(_0xd86c,0x198));var _0xcd86=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0xd86c[_0x1347f8];return _0x218368;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xcd86('0x0')]={'CmHopperId':{'type':Sequelize[_0xcd86('0x1')]},'phone':{'type':Sequelize[_0xcd86('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xcd86('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xcd86('0x3')],'defaultValue':moment()[_0xcd86('0x4')](_0xcd86('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcd86('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xcd86('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xcd86('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xcd86('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xcd86('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xcd86('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcd86('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index a68ed20..2f3780e 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 _0x9b95=['params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','show'];(function(_0x284278,_0x56603e){var _0x3e8b50=function(_0x365b71){while(--_0x365b71){_0x284278['push'](_0x284278['shift']());}};_0x3e8b50(++_0x56603e);}(_0x9b95,0xed));var _0x59b9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9b95[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x59b9('0x0'));var rimraf=require(_0x59b9('0x1'));var zipdir=require(_0x59b9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x59b9('0x3'));var moment=require(_0x59b9('0x4'));var BPromise=require(_0x59b9('0x5'));var Mustache=require(_0x59b9('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x59b9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59b9('0x8'));var _=require(_0x59b9('0x9'));var squel=require(_0x59b9('0xa'));var crypto=require(_0x59b9('0xb'));var jsforce=require(_0x59b9('0xc'));var deskjs=require(_0x59b9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x59b9('0xe'));var Papa=require(_0x59b9('0xf'));var Redis=require('ioredis');var authService=require(_0x59b9('0x10'));var qs=require(_0x59b9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x59b9('0x12'));var config=require(_0x59b9('0x13'));var licenseUtil=require(_0x59b9('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54a186,_0x35494f){_0x35494f=_0x35494f||0xcc;return function(_0x8a32e6){if(_0x8a32e6){return _0x54a186[_0x59b9('0x15')](_0x35494f);}return _0x54a186[_0x59b9('0x16')](_0x35494f)[_0x59b9('0x17')]();};}function respondWithResult(_0x4d1694,_0x541cb1){_0x541cb1=_0x541cb1||0xc8;return function(_0x14468f){if(_0x14468f){return _0x4d1694['status'](_0x541cb1)['json'](_0x14468f);}};}function respondWithFilteredResult(_0x6e724b,_0x59fbff){return function(_0x18636a){if(_0x18636a){var _0x1c7bf4=typeof _0x59fbff['offset']===_0x59b9('0x18')&&typeof _0x59fbff[_0x59b9('0x19')]===_0x59b9('0x18');var _0x26a33a=_0x18636a[_0x59b9('0x1a')];var _0x5d9196=_0x1c7bf4?0x0:_0x59fbff[_0x59b9('0x1b')];var _0x2dfd5d=_0x1c7bf4?_0x18636a[_0x59b9('0x1a')]:_0x59fbff['offset']+_0x59fbff[_0x59b9('0x19')];var _0x25ba1b;if(_0x2dfd5d>=_0x26a33a){_0x2dfd5d=_0x26a33a;_0x25ba1b=0xc8;}else{_0x25ba1b=0xce;}_0x6e724b[_0x59b9('0x16')](_0x25ba1b);return _0x6e724b[_0x59b9('0x1c')](_0x59b9('0x1d'),_0x5d9196+'-'+_0x2dfd5d+'/'+_0x26a33a)[_0x59b9('0x1e')](_0x18636a);}return null;};}function patchUpdates(_0x2cf24e){return function(_0x19df17){try{jsonpatch['apply'](_0x19df17,_0x2cf24e,!![]);}catch(_0x65ed7d){return BPromise[_0x59b9('0x1f')](_0x65ed7d);}return _0x19df17['save']();};}function saveUpdates(_0x4e7658,_0x427547){return function(_0x20ffd4){if(_0x20ffd4){return _0x20ffd4[_0x59b9('0x20')](_0x4e7658)[_0x59b9('0x21')](function(_0x43c40d){return _0x43c40d;});}return null;};}function removeEntity(_0x22aad5,_0x43ceca){return function(_0x138892){if(_0x138892){return _0x138892[_0x59b9('0x22')]()[_0x59b9('0x21')](function(){var _0x2d18cb=_0x138892[_0x59b9('0x23')]({'plain':!![]});var _0xe27c1=_0x59b9('0x24');return db[_0x59b9('0x25')][_0x59b9('0x22')]({'where':{'type':_0xe27c1,'resourceId':_0x2d18cb['id']}})[_0x59b9('0x21')](function(){return _0x138892;});})[_0x59b9('0x21')](function(){_0x22aad5[_0x59b9('0x16')](0xcc)[_0x59b9('0x17')]();});}};}function handleEntityNotFound(_0x9fcf76,_0x1e5fc5){return function(_0x228f2e){if(!_0x228f2e){_0x9fcf76[_0x59b9('0x15')](0x194);}return _0x228f2e;};}function handleError(_0x251ac0,_0xdc4834){_0xdc4834=_0xdc4834||0x1f4;return function(_0x5337fc){logger[_0x59b9('0x26')](_0x5337fc[_0x59b9('0x27')]);if(_0x5337fc[_0x59b9('0x28')]){delete _0x5337fc[_0x59b9('0x28')];}_0x251ac0[_0x59b9('0x16')](_0xdc4834)['send'](_0x5337fc);};}exports[_0x59b9('0x29')]=function(_0x317c26,_0x3bffe1){var _0x19a436={},_0x3ab99f={},_0x2717a8={'count':0x0,'rows':[]};var _0x378cfc=_[_0x59b9('0x2a')](db[_0x59b9('0x2b')][_0x59b9('0x2c')],function(_0x5470e3){return{'name':_0x5470e3[_0x59b9('0x2d')],'type':_0x5470e3[_0x59b9('0x2e')][_0x59b9('0x2f')]};});_0x3ab99f[_0x59b9('0x30')]=_[_0x59b9('0x2a')](_0x378cfc,_0x59b9('0x28'));_0x3ab99f[_0x59b9('0x31')]=_[_0x59b9('0x32')](_0x317c26[_0x59b9('0x31')]);_0x3ab99f[_0x59b9('0x33')]=_[_0x59b9('0x34')](_0x3ab99f['model'],_0x3ab99f['query']);_0x19a436[_0x59b9('0x35')]=_[_0x59b9('0x34')](_0x3ab99f['model'],qs['fields'](_0x317c26[_0x59b9('0x31')][_0x59b9('0x36')]));_0x19a436['attributes']=_0x19a436[_0x59b9('0x35')][_0x59b9('0x37')]?_0x19a436[_0x59b9('0x35')]:_0x3ab99f[_0x59b9('0x30')];if(!_0x317c26[_0x59b9('0x31')]['hasOwnProperty'](_0x59b9('0x38'))){_0x19a436[_0x59b9('0x19')]=qs[_0x59b9('0x19')](_0x317c26[_0x59b9('0x31')]['limit']);_0x19a436['offset']=qs[_0x59b9('0x1b')](_0x317c26[_0x59b9('0x31')][_0x59b9('0x1b')]);}_0x19a436[_0x59b9('0x39')]=qs['sort'](_0x317c26['query'][_0x59b9('0x3a')]);_0x19a436['where']=qs[_0x59b9('0x33')](_['pick'](_0x317c26['query'],_0x3ab99f[_0x59b9('0x33')]),_0x378cfc);if(_0x317c26[_0x59b9('0x31')]['filter']){_0x19a436[_0x59b9('0x3b')]=_[_0x59b9('0x3c')](_0x19a436[_0x59b9('0x3b')],{'$or':_[_0x59b9('0x2a')](_0x378cfc,function(_0x586c9f){if(_0x586c9f['type']!==_0x59b9('0x3d')){var _0xc16e44={};_0xc16e44[_0x586c9f['name']]={'$like':'%'+_0x317c26[_0x59b9('0x31')][_0x59b9('0x3e')]+'%'};return _0xc16e44;}})});}_0x19a436=_[_0x59b9('0x3c')]({},_0x19a436,_0x317c26[_0x59b9('0x3f')]);var _0x55a47b={'where':_0x19a436['where']};return db['CmHopperAdditionalPhone']['count'](_0x55a47b)[_0x59b9('0x21')](function(_0x11ea15){_0x2717a8[_0x59b9('0x1a')]=_0x11ea15;if(_0x317c26[_0x59b9('0x31')][_0x59b9('0x40')]){_0x19a436['include']=[{'all':!![]}];}return db[_0x59b9('0x2b')][_0x59b9('0x41')](_0x19a436);})[_0x59b9('0x21')](function(_0x200ae1){_0x2717a8['rows']=_0x200ae1;return _0x2717a8;})[_0x59b9('0x21')](respondWithFilteredResult(_0x3bffe1,_0x19a436))['catch'](handleError(_0x3bffe1,null));};exports[_0x59b9('0x42')]=function(_0xda7bf3,_0x534866){var _0x5f2806={'raw':!![],'where':{'id':_0xda7bf3[_0x59b9('0x43')]['id']}},_0xc94dc5={};_0xc94dc5[_0x59b9('0x30')]=_[_0x59b9('0x32')](db[_0x59b9('0x2b')][_0x59b9('0x2c')]);_0xc94dc5['query']=_['keys'](_0xda7bf3[_0x59b9('0x31')]);_0xc94dc5[_0x59b9('0x33')]=_[_0x59b9('0x34')](_0xc94dc5['model'],_0xc94dc5[_0x59b9('0x31')]);_0x5f2806[_0x59b9('0x35')]=_['intersection'](_0xc94dc5['model'],qs['fields'](_0xda7bf3[_0x59b9('0x31')][_0x59b9('0x36')]));_0x5f2806[_0x59b9('0x35')]=_0x5f2806['attributes']['length']?_0x5f2806['attributes']:_0xc94dc5[_0x59b9('0x30')];if(_0xda7bf3[_0x59b9('0x31')]['includeAll']){_0x5f2806['include']=[{'all':!![]}];}_0x5f2806=_[_0x59b9('0x3c')]({},_0x5f2806,_0xda7bf3['options']);return db[_0x59b9('0x2b')][_0x59b9('0x44')](_0x5f2806)[_0x59b9('0x21')](handleEntityNotFound(_0x534866,null))[_0x59b9('0x21')](respondWithResult(_0x534866,null))[_0x59b9('0x45')](handleError(_0x534866,null));};exports[_0x59b9('0x46')]=function(_0x5e2c35,_0x31279a){return db['CmHopperAdditionalPhone']['create'](_0x5e2c35['body'],{})['then'](function(_0x42a78f){var _0x2bb64e=_0x5e2c35[_0x59b9('0x47')][_0x59b9('0x23')]({'plain':!![]});if(!_0x2bb64e)throw new Error(_0x59b9('0x48'));if(_0x2bb64e['role']===_0x59b9('0x47')){var _0x3b13c4=_0x42a78f['get']({'plain':!![]});var _0x4e18a9=_0x59b9('0x24');return db['UserProfileSection'][_0x59b9('0x44')]({'where':{'name':_0x4e18a9,'userProfileId':_0x2bb64e[_0x59b9('0x49')]},'raw':!![]})[_0x59b9('0x21')](function(_0x173b20){if(_0x173b20&&_0x173b20[_0x59b9('0x4a')]===0x0){return db['UserProfileResource'][_0x59b9('0x46')]({'name':_0x3b13c4['name'],'resourceId':_0x3b13c4['id'],'type':_0x173b20[_0x59b9('0x28')],'sectionId':_0x173b20['id']},{})['then'](function(){return _0x42a78f;});}else{return _0x42a78f;}})['catch'](function(_0x71f4cb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x71f4cb);throw _0x71f4cb;});}return _0x42a78f;})[_0x59b9('0x21')](respondWithResult(_0x31279a,0xc9))[_0x59b9('0x45')](handleError(_0x31279a,null));};exports[_0x59b9('0x20')]=function(_0x3d9109,_0x5370ab){if(_0x3d9109['body']['id']){delete _0x3d9109['body']['id'];}return db[_0x59b9('0x2b')][_0x59b9('0x44')]({'where':{'id':_0x3d9109['params']['id']}})['then'](handleEntityNotFound(_0x5370ab,null))[_0x59b9('0x21')](saveUpdates(_0x3d9109[_0x59b9('0x4b')],null))[_0x59b9('0x21')](respondWithResult(_0x5370ab,null))['catch'](handleError(_0x5370ab,null));};exports['destroy']=function(_0x7a4160,_0x1871a4){return db[_0x59b9('0x2b')][_0x59b9('0x44')]({'where':{'id':_0x7a4160[_0x59b9('0x43')]['id']}})[_0x59b9('0x21')](handleEntityNotFound(_0x1871a4,null))[_0x59b9('0x21')](removeEntity(_0x1871a4,null))['catch'](handleError(_0x1871a4,null));}; \ No newline at end of file +var _0x9750=['Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','include','findAll','catch','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x1c8a27,_0x5e8d84){var _0x25d3a7=function(_0x7bb4e1){while(--_0x7bb4e1){_0x1c8a27['push'](_0x1c8a27['shift']());}};_0x25d3a7(++_0x5e8d84);}(_0x9750,0x125));var _0x0975=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9750[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require(_0x0975('0x0'));var rimraf=require(_0x0975('0x1'));var zipdir=require(_0x0975('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0975('0x3'));var moment=require(_0x0975('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0975('0x5'));var util=require('util');var path=require(_0x0975('0x6'));var sox=require('sox');var csv=require(_0x0975('0x7'));var ejs=require(_0x0975('0x8'));var fs=require('fs');var fs_extra=require(_0x0975('0x9'));var _=require(_0x0975('0xa'));var squel=require(_0x0975('0xb'));var crypto=require(_0x0975('0xc'));var jsforce=require(_0x0975('0xd'));var deskjs=require(_0x0975('0xe'));var toCsv=require(_0x0975('0x7'));var querystring=require(_0x0975('0xf'));var Papa=require(_0x0975('0x10'));var Redis=require(_0x0975('0x11'));var authService=require(_0x0975('0x12'));var qs=require(_0x0975('0x13'));var as=require(_0x0975('0x14'));var hardwareService=require(_0x0975('0x15'));var logger=require(_0x0975('0x16'))('api');var utils=require(_0x0975('0x17'));var config=require(_0x0975('0x18'));var licenseUtil=require(_0x0975('0x19'));var db=require(_0x0975('0x1a'))['db'];function respondWithStatusCode(_0x2ad3c8,_0x5355b2){_0x5355b2=_0x5355b2||0xcc;return function(_0x3cc5fa){if(_0x3cc5fa){return _0x2ad3c8[_0x0975('0x1b')](_0x5355b2);}return _0x2ad3c8[_0x0975('0x1c')](_0x5355b2)[_0x0975('0x1d')]();};}function respondWithResult(_0x461c57,_0x17842d){_0x17842d=_0x17842d||0xc8;return function(_0xe223ac){if(_0xe223ac){return _0x461c57[_0x0975('0x1c')](_0x17842d)['json'](_0xe223ac);}};}function respondWithFilteredResult(_0x556950,_0xfc1322){return function(_0x4f91ed){if(_0x4f91ed){var _0x3fd870=typeof _0xfc1322[_0x0975('0x1e')]===_0x0975('0x1f')&&typeof _0xfc1322[_0x0975('0x20')]===_0x0975('0x1f');var _0x13b6ef=_0x4f91ed[_0x0975('0x21')];var _0x126ce6=_0x3fd870?0x0:_0xfc1322[_0x0975('0x1e')];var _0x1b1ff7=_0x3fd870?_0x4f91ed['count']:_0xfc1322[_0x0975('0x1e')]+_0xfc1322[_0x0975('0x20')];var _0x2852ae;if(_0x1b1ff7>=_0x13b6ef){_0x1b1ff7=_0x13b6ef;_0x2852ae=0xc8;}else{_0x2852ae=0xce;}_0x556950['status'](_0x2852ae);return _0x556950[_0x0975('0x22')](_0x0975('0x23'),_0x126ce6+'-'+_0x1b1ff7+'/'+_0x13b6ef)[_0x0975('0x24')](_0x4f91ed);}return null;};}function patchUpdates(_0x469fe0){return function(_0x5b69f5){try{jsonpatch[_0x0975('0x25')](_0x5b69f5,_0x469fe0,!![]);}catch(_0x237d2d){return BPromise[_0x0975('0x26')](_0x237d2d);}return _0x5b69f5['save']();};}function saveUpdates(_0x17e49b,_0xcf3210){return function(_0x34e167){if(_0x34e167){return _0x34e167[_0x0975('0x27')](_0x17e49b)[_0x0975('0x28')](function(_0x12d949){return _0x12d949;});}return null;};}function removeEntity(_0x44f806,_0x108b0f){return function(_0x46a619){if(_0x46a619){return _0x46a619[_0x0975('0x29')]()[_0x0975('0x28')](function(){var _0x3769ea=_0x46a619[_0x0975('0x2a')]({'plain':!![]});var _0x1cbbfc='CmHopperAdditionalPhones';return db[_0x0975('0x2b')][_0x0975('0x29')]({'where':{'type':_0x1cbbfc,'resourceId':_0x3769ea['id']}})['then'](function(){return _0x46a619;});})[_0x0975('0x28')](function(){_0x44f806['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30c1ed,_0x4b25f8){return function(_0x1244d5){if(!_0x1244d5){_0x30c1ed[_0x0975('0x1b')](0x194);}return _0x1244d5;};}function handleError(_0x18d6a1,_0x4f9d59){_0x4f9d59=_0x4f9d59||0x1f4;return function(_0x19ce58){logger['error'](_0x19ce58[_0x0975('0x2c')]);if(_0x19ce58[_0x0975('0x2d')]){delete _0x19ce58[_0x0975('0x2d')];}_0x18d6a1['status'](_0x4f9d59)[_0x0975('0x2e')](_0x19ce58);};}exports[_0x0975('0x2f')]=function(_0x488cdc,_0x2f448e){var _0x57e116={},_0x26a33a={},_0x17f593={'count':0x0,'rows':[]};var _0x24d029=_[_0x0975('0x30')](db[_0x0975('0x31')][_0x0975('0x32')],function(_0x2b92db){return{'name':_0x2b92db[_0x0975('0x33')],'type':_0x2b92db[_0x0975('0x34')][_0x0975('0x35')]};});_0x26a33a[_0x0975('0x36')]=_[_0x0975('0x30')](_0x24d029,_0x0975('0x2d'));_0x26a33a[_0x0975('0x37')]=_[_0x0975('0x38')](_0x488cdc['query']);_0x26a33a[_0x0975('0x39')]=_[_0x0975('0x3a')](_0x26a33a[_0x0975('0x36')],_0x26a33a['query']);_0x57e116[_0x0975('0x3b')]=_[_0x0975('0x3a')](_0x26a33a[_0x0975('0x36')],qs[_0x0975('0x3c')](_0x488cdc['query'][_0x0975('0x3c')]));_0x57e116['attributes']=_0x57e116['attributes'][_0x0975('0x3d')]?_0x57e116[_0x0975('0x3b')]:_0x26a33a['model'];if(!_0x488cdc[_0x0975('0x37')][_0x0975('0x3e')](_0x0975('0x3f'))){_0x57e116[_0x0975('0x20')]=qs['limit'](_0x488cdc[_0x0975('0x37')][_0x0975('0x20')]);_0x57e116[_0x0975('0x1e')]=qs[_0x0975('0x1e')](_0x488cdc[_0x0975('0x37')][_0x0975('0x1e')]);}_0x57e116[_0x0975('0x40')]=qs[_0x0975('0x41')](_0x488cdc[_0x0975('0x37')][_0x0975('0x41')]);_0x57e116['where']=qs[_0x0975('0x39')](_['pick'](_0x488cdc[_0x0975('0x37')],_0x26a33a[_0x0975('0x39')]),_0x24d029);if(_0x488cdc[_0x0975('0x37')][_0x0975('0x42')]){_0x57e116[_0x0975('0x43')]=_[_0x0975('0x44')](_0x57e116['where'],{'$or':_[_0x0975('0x30')](_0x24d029,function(_0x2f5564){if(_0x2f5564[_0x0975('0x34')]!==_0x0975('0x45')){var _0x3a8a33={};_0x3a8a33[_0x2f5564[_0x0975('0x2d')]]={'$like':'%'+_0x488cdc['query']['filter']+'%'};return _0x3a8a33;}})});}_0x57e116=_[_0x0975('0x44')]({},_0x57e116,_0x488cdc['options']);var _0x37f777={'where':_0x57e116[_0x0975('0x43')]};return db[_0x0975('0x31')][_0x0975('0x21')](_0x37f777)[_0x0975('0x28')](function(_0x11b311){_0x17f593[_0x0975('0x21')]=_0x11b311;if(_0x488cdc[_0x0975('0x37')]['includeAll']){_0x57e116[_0x0975('0x46')]=[{'all':!![]}];}return db[_0x0975('0x31')][_0x0975('0x47')](_0x57e116);})[_0x0975('0x28')](function(_0x58cee9){_0x17f593['rows']=_0x58cee9;return _0x17f593;})['then'](respondWithFilteredResult(_0x2f448e,_0x57e116))[_0x0975('0x48')](handleError(_0x2f448e,null));};exports['show']=function(_0x54b45a,_0x408197){var _0xb4e478={'raw':!![],'where':{'id':_0x54b45a[_0x0975('0x49')]['id']}},_0x13433e={};_0x13433e['model']=_[_0x0975('0x38')](db[_0x0975('0x31')][_0x0975('0x32')]);_0x13433e[_0x0975('0x37')]=_[_0x0975('0x38')](_0x54b45a[_0x0975('0x37')]);_0x13433e[_0x0975('0x39')]=_['intersection'](_0x13433e[_0x0975('0x36')],_0x13433e[_0x0975('0x37')]);_0xb4e478[_0x0975('0x3b')]=_[_0x0975('0x3a')](_0x13433e[_0x0975('0x36')],qs[_0x0975('0x3c')](_0x54b45a[_0x0975('0x37')][_0x0975('0x3c')]));_0xb4e478[_0x0975('0x3b')]=_0xb4e478[_0x0975('0x3b')][_0x0975('0x3d')]?_0xb4e478[_0x0975('0x3b')]:_0x13433e[_0x0975('0x36')];if(_0x54b45a[_0x0975('0x37')]['includeAll']){_0xb4e478[_0x0975('0x46')]=[{'all':!![]}];}_0xb4e478=_[_0x0975('0x44')]({},_0xb4e478,_0x54b45a[_0x0975('0x4a')]);return db[_0x0975('0x31')][_0x0975('0x4b')](_0xb4e478)[_0x0975('0x28')](handleEntityNotFound(_0x408197,null))['then'](respondWithResult(_0x408197,null))[_0x0975('0x48')](handleError(_0x408197,null));};exports['create']=function(_0x2b27bb,_0x1724aa){return db[_0x0975('0x31')][_0x0975('0x4c')](_0x2b27bb[_0x0975('0x4d')],{})['then'](function(_0x2c43a4){var _0x33d43e=_0x2b27bb[_0x0975('0x4e')][_0x0975('0x2a')]({'plain':!![]});if(!_0x33d43e)throw new Error(_0x0975('0x4f'));if(_0x33d43e[_0x0975('0x50')]==='user'){var _0x1e339c=_0x2c43a4[_0x0975('0x2a')]({'plain':!![]});var _0x12e4c3='CmHopperAdditionalPhones';return db['UserProfileSection'][_0x0975('0x4b')]({'where':{'name':_0x12e4c3,'userProfileId':_0x33d43e['userProfileId']},'raw':!![]})[_0x0975('0x28')](function(_0x1899de){if(_0x1899de&&_0x1899de['autoAssociation']===0x0){return db['UserProfileResource'][_0x0975('0x4c')]({'name':_0x1e339c[_0x0975('0x2d')],'resourceId':_0x1e339c['id'],'type':_0x1899de[_0x0975('0x2d')],'sectionId':_0x1899de['id']},{})['then'](function(){return _0x2c43a4;});}else{return _0x2c43a4;}})[_0x0975('0x48')](function(_0x417041){logger['error'](_0x0975('0x51'),_0x417041);throw _0x417041;});}return _0x2c43a4;})['then'](respondWithResult(_0x1724aa,0xc9))['catch'](handleError(_0x1724aa,null));};exports[_0x0975('0x27')]=function(_0x3d6df0,_0x1f7f81){if(_0x3d6df0[_0x0975('0x4d')]['id']){delete _0x3d6df0['body']['id'];}return db['CmHopperAdditionalPhone'][_0x0975('0x4b')]({'where':{'id':_0x3d6df0['params']['id']}})['then'](handleEntityNotFound(_0x1f7f81,null))[_0x0975('0x28')](saveUpdates(_0x3d6df0[_0x0975('0x4d')],null))[_0x0975('0x28')](respondWithResult(_0x1f7f81,null))[_0x0975('0x48')](handleError(_0x1f7f81,null));};exports[_0x0975('0x29')]=function(_0x7e0002,_0x2ad673){return db[_0x0975('0x31')]['find']({'where':{'id':_0x7e0002[_0x0975('0x49')]['id']}})[_0x0975('0x28')](handleEntityNotFound(_0x2ad673,null))[_0x0975('0x28')](removeEntity(_0x2ad673,null))['catch'](handleError(_0x2ad673,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 7addb68..820eb2f 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 _0x9b25=['util','api','moment','bluebird','request-promise','path','../../config/environment','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash'];(function(_0x227d6f,_0x555816){var _0x20b29d=function(_0x3de7db){while(--_0x3de7db){_0x227d6f['push'](_0x227d6f['shift']());}};_0x20b29d(++_0x555816);}(_0x9b25,0x175));var _0x59b2=function(_0xba153,_0x157238){_0xba153=_0xba153-0x0;var _0x235a1e=_0x9b25[_0xba153];return _0x235a1e;};'use strict';var _=require(_0x59b2('0x0'));var util=require(_0x59b2('0x1'));var logger=require('../../config/logger')(_0x59b2('0x2'));var moment=require(_0x59b2('0x3'));var BPromise=require(_0x59b2('0x4'));var rp=require(_0x59b2('0x5'));var fs=require('fs');var path=require(_0x59b2('0x6'));var rimraf=require('rimraf');var config=require(_0x59b2('0x7'));var attributes=require('./cmHopperAdditionalPhone.attributes');module['exports']=function(_0x17dbd8,_0xe1539f){return _0x17dbd8[_0x59b2('0x8')](_0x59b2('0x9'),attributes,{'tableName':_0x59b2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb28=['path','rimraf','../../config/environment','exports','CmHopperAdditionalPhone','../../config/logger','api','bluebird','request-promise'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0xeb28,0x1d0));var _0x8eb2=function(_0x3e27b4,_0x1d5dad){_0x3e27b4=_0x3e27b4-0x0;var _0x22ee2d=_0xeb28[_0x3e27b4];return _0x22ee2d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8eb2('0x0'))(_0x8eb2('0x1'));var moment=require('moment');var BPromise=require(_0x8eb2('0x2'));var rp=require(_0x8eb2('0x3'));var fs=require('fs');var path=require(_0x8eb2('0x4'));var rimraf=require(_0x8eb2('0x5'));var config=require(_0x8eb2('0x6'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x8eb2('0x7')]=function(_0x215a1e,_0x58fd15){return _0x215a1e['define'](_0x8eb2('0x8'),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 7f681a3..1533c40 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 _0x0655=['OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','countnosuchnumberretry','countagentrejectretry','SwapAdditionalPhones','duration','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone'];(function(_0x8e24a3,_0x4816ac){var _0x1022f4=function(_0x546832){while(--_0x546832){_0x8e24a3['push'](_0x8e24a3['shift']());}};_0x1022f4(++_0x4816ac);}(_0x0655,0x176));var _0x5065=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0x0655[_0xef4cf0];return _0x497ad2;};'use strict';var _=require(_0x5065('0x0'));var util=require(_0x5065('0x1'));var moment=require(_0x5065('0x2'));var BPromise=require(_0x5065('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5065('0x4'));var db=require(_0x5065('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5065('0x6'))(_0x5065('0x7'));var config=require(_0x5065('0x8'));var jayson=require(_0x5065('0x9'));var client=jayson[_0x5065('0xa')][_0x5065('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4cfa03,_0x432ea1,_0x2ec3a3){return new BPromise(function(_0x49f1d0,_0x2bc916){return client[_0x5065('0xc')](_0x4cfa03,_0x2ec3a3)['then'](function(_0x2c25f8){logger[_0x5065('0xd')](_0x5065('0xe'),_0x432ea1,_0x5065('0xf'));logger['debug'](_0x5065('0x10'),_0x432ea1,_0x5065('0xf'),JSON[_0x5065('0x11')](_0x2c25f8));if(_0x2c25f8[_0x5065('0x12')]){if(_0x2c25f8[_0x5065('0x12')]['code']===0x1f4){logger[_0x5065('0x12')](_0x5065('0xe'),_0x432ea1,_0x2c25f8['error'][_0x5065('0x13')]);return _0x2bc916(_0x2c25f8[_0x5065('0x12')]['message']);}logger[_0x5065('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x432ea1,_0x2c25f8['error'][_0x5065('0x13')]);return _0x49f1d0(_0x2c25f8[_0x5065('0x12')]['message']);}else{logger[_0x5065('0xd')](_0x5065('0xe'),_0x432ea1,_0x5065('0xf'));_0x49f1d0(_0x2c25f8[_0x5065('0x14')][_0x5065('0x13')]);}})[_0x5065('0x15')](function(_0x35ab3c){logger[_0x5065('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x432ea1,_0x35ab3c);_0x2bc916(_0x35ab3c);});});}exports[_0x5065('0x16')]=function(_0x380dcb){var _0x5bbbdd=this;return new Promise(function(_0x1ff9bf,_0x58ff55){return db[_0x5065('0x17')][_0x5065('0x18')]({'raw':!![],'where':{'ContactId':_0x380dcb[_0x5065('0x19')][_0x5065('0x1a')],'ListId':_0x380dcb['body'][_0x5065('0x1b')],'VoiceQueueId':_0x380dcb[_0x5065('0x19')][_0x5065('0x1c')]===undefined?null:_0x380dcb[_0x5065('0x19')][_0x5065('0x1c')],'CampaignId':_0x380dcb['body'][_0x5065('0x1d')]===undefined?null:_0x380dcb[_0x5065('0x19')]['CampaignId']}})[_0x5065('0x1e')](function(_0x3df6a4){if(_0x3df6a4!=null){return db[_0x5065('0x1f')][_0x5065('0x18')]({'raw':!![],'where':{'CmHopperId':_0x3df6a4['id'],'OrderBy':{'$gt':_0x3df6a4['OrderBy']}},'order':[[_0x5065('0x20'),_0x5065('0x21')]]})[_0x5065('0x1e')](function(_0x514470){var _0x333b7c=0x0;if(_0x514470){if(_0x514470[_0x5065('0x22')]+_0x514470[_0x5065('0x23')]+_0x514470[_0x5065('0x24')]+_0x514470['countnosuchnumberretry']+_0x514470[_0x5065('0x25')]+_0x514470[_0x5065('0x26')]+_0x514470[_0x5065('0x27')]+_0x514470['countagentrejectretry']<_0x380dcb[_0x5065('0x28')][_0x5065('0x29')])_0x333b7c=0x1;_0x1ff9bf({'additional':_0x333b7c});}else{return db[_0x5065('0x1f')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x3df6a4['id']},'order':[[_0x5065('0x20'),_0x5065('0x21')]]})['then'](function(_0x421d38){var _0x32aaa8=0x0;if(_0x421d38){if(_0x421d38[_0x5065('0x22')]+_0x421d38[_0x5065('0x23')]+_0x421d38[_0x5065('0x24')]+_0x421d38[_0x5065('0x2a')]+_0x421d38[_0x5065('0x25')]+_0x421d38[_0x5065('0x26')]+_0x421d38[_0x5065('0x27')]+_0x421d38[_0x5065('0x2b')]<_0x380dcb[_0x5065('0x28')][_0x5065('0x29')])_0x32aaa8=0x1;_0x1ff9bf({'additional':_0x32aaa8});}else{_0x1ff9bf({'additional':0x0});}})[_0x5065('0x15')](function(_0x2906a1){logger[_0x5065('0x12')](_0x5065('0x16'),_0x2906a1[_0x5065('0x13')]);_0x58ff55(_0x5bbbdd[_0x5065('0x12')](0x1f4,_0x2906a1[_0x5065('0x13')]));});}})[_0x5065('0x15')](function(_0xbede33){logger[_0x5065('0x12')](_0x5065('0x16'),_0xbede33[_0x5065('0x13')]);_0x58ff55(_0x5bbbdd['error'](0x1f4,_0xbede33[_0x5065('0x13')]));});}else _0x1ff9bf({'additional':0x0});});});};exports[_0x5065('0x2c')]=function(_0x221d30){var _0xc79f4f=this;return new Promise(function(_0x1a7e0c,_0x821ef3){return db['CmHopper'][_0x5065('0x18')]({'raw':!![],'where':{'ContactId':_0x221d30[_0x5065('0x19')][_0x5065('0x1a')],'ListId':_0x221d30[_0x5065('0x19')][_0x5065('0x1b')],'VoiceQueueId':_0x221d30[_0x5065('0x19')][_0x5065('0x1c')]===undefined?null:_0x221d30['body']['VoiceQueueId'],'CampaignId':_0x221d30[_0x5065('0x19')]['CampaignId']===undefined?null:_0x221d30[_0x5065('0x19')][_0x5065('0x1d')]}})[_0x5065('0x1e')](function(_0x1863a9){if(_0x1863a9!=null){return db[_0x5065('0x1f')][_0x5065('0x18')]({'raw':!![],'where':{'CmHopperId':_0x1863a9['id'],'OrderBy':{'$gte':_0x1863a9[_0x5065('0x20')]}},'order':[[_0x5065('0x20'),_0x5065('0x21')]]})[_0x5065('0x1e')](function(_0x804a23){if(_0x804a23)return activateAdditionalPhone(_0x1863a9,_0x221d30['body'],_0x804a23,_0x221d30[_0x5065('0x2d')],_0x221d30['waitTime'])[_0x5065('0x1e')](function(_0x1e3442){_0x1a7e0c(_0x1e3442);});else{return db['CmHopperAdditionalPhone'][_0x5065('0x18')]({'raw':!![],'where':{'CmHopperId':_0x1863a9['id']},'order':[['OrderBy','ASC']]})[_0x5065('0x1e')](function(_0x2213d5){if(_0x2213d5)return activateAdditionalPhone(_0x1863a9,_0x221d30['body'],_0x2213d5,_0x221d30[_0x5065('0x2d')],_0x221d30['waitTime'])[_0x5065('0x1e')](function(_0x5e5c07){_0x1a7e0c(_0x5e5c07);});else{_0x1a7e0c({'id':_0x1863a9['id'],'phone':''});}})['catch'](function(_0x42f6f7){logger[_0x5065('0x12')](_0x5065('0x16'),_0x42f6f7[_0x5065('0x13')]);_0x821ef3(_0xc79f4f['error'](0x1f4,_0x42f6f7[_0x5065('0x13')]));});}})[_0x5065('0x15')](function(_0x48e87c){logger[_0x5065('0x12')](_0x5065('0x16'),_0x48e87c[_0x5065('0x13')]);_0x821ef3(_0xc79f4f[_0x5065('0x12')](0x1f4,_0x48e87c['message']));});}else _0x1a7e0c(0x1);});});};function activateAdditionalPhone(_0x37ada0,_0x81b10d,_0x2c2703,_0x236f55,_0x5e5e4e){return new Promise(function(_0x26c02d,_0x31ad71){var _0x19b32d;if(_[_0x5065('0x2e')](_0x2c2703['scheduledat'])){_0x2c2703[_0x5065('0x2f')]=moment();}if(moment()>moment(_0x2c2703[_0x5065('0x2f')])){_0x19b32d=moment()[_0x5065('0x30')](_0x5e5e4e||0x3,_0x5065('0x31'));}else{if(_0x2c2703[_0x5065('0x20')]==0x0){_0x19b32d=moment(_0x2c2703['scheduledat']);}else{_0x19b32d=moment()[_0x5065('0x30')](_0x5e5e4e||0x3,_0x5065('0x31'));}}if(_[_0x5065('0x2e')](_0x19b32d)){_0x19b32d=moment()[_0x5065('0x30')](_0x5e5e4e||0x3,_0x5065('0x31'));}var _0x116fd8={'phone':_0x37ada0[_0x5065('0x32')],'active':0x0,'OrderBy':_[_0x5065('0x2e')](_0x37ada0[_0x5065('0x20')])?0x0:_0x37ada0[_0x5065('0x20')],'scheduledat':moment()[_0x5065('0x30')](_0x236f55||0x1,_0x5065('0x31')),'countbusyretry':_0x81b10d[_0x5065('0x22')],'countcongestionretry':_0x81b10d[_0x5065('0x23')],'countnoanswerretry':_0x81b10d[_0x5065('0x24')],'countnosuchnumberretry':_0x81b10d[_0x5065('0x2a')],'countdropretry':_0x81b10d[_0x5065('0x25')],'countabandonedretry':_0x81b10d[_0x5065('0x26')],'countmachineretry':_0x81b10d[_0x5065('0x27')],'countagentrejectretry':_0x81b10d[_0x5065('0x2b')],'createdAt':_0x81b10d[_0x5065('0x33')],'updatedAt':_0x81b10d['updatedAt']};var _0x3295bf={'CmHopperId':_0x37ada0['id'],'phone':_0x2c2703['phone'],'active':0x0,'OrderBy':_[_0x5065('0x2e')](_0x2c2703[_0x5065('0x20')])?0x0:_0x2c2703[_0x5065('0x20')],'scheduledat':_0x19b32d,'countbusyretry':_0x2c2703[_0x5065('0x22')],'countcongestionretry':_0x2c2703[_0x5065('0x23')],'countnoanswerretry':_0x2c2703[_0x5065('0x24')],'countnosuchnumberretry':_0x2c2703[_0x5065('0x2a')],'countdropretry':_0x2c2703['countdropretry'],'countabandonedretry':_0x2c2703[_0x5065('0x26')],'countmachineretry':_0x2c2703[_0x5065('0x27')],'countagentrejectretry':_0x2c2703[_0x5065('0x2b')],'createdAt':_0x2c2703[_0x5065('0x33')],'updatedAt':_0x2c2703[_0x5065('0x34')]};return db['sequelize'][_0x5065('0x35')](function(_0x41452a){return db[_0x5065('0x1f')][_0x5065('0x36')](_0x116fd8,{'where':{'id':_0x2c2703['id']}},{'transaction':_0x41452a})[_0x5065('0x1e')](function(){return db[_0x5065('0x17')][_0x5065('0x36')](_0x3295bf,{'where':{'id':_0x37ada0['id']}},{'transaction':_0x41452a});});})[_0x5065('0x1e')](function(_0x5e36a6){_0x26c02d({'id':_0x37ada0['id'],'phone':_0x2c2703[_0x5065('0x32')]});})[_0x5065('0x15')](function(_0x5a1150){logger[_0x5065('0x12')](_0x5065('0x37'),_0x5a1150['message']);_0x31ad71({'error':_0x5a1150[_0x5065('0x13')]});});});}exports[_0x5065('0x38')]=function(_0x19412f){var _0xe6850e=this;return new Promise(function(_0x334357,_0x42644e){return db[_0x5065('0x17')][_0x5065('0x36')](_0x19412f[_0x5065('0x19')][_0x5065('0x39')],{'where':{'id':_0x19412f[_0x5065('0x19')]['id']}})[_0x5065('0x1e')](function(_0x6d36f4){_0x334357(_0x6d36f4);})[_0x5065('0x15')](function(_0x1bfd7c){logger[_0x5065('0x12')](_0x5065('0x38'),_0x1bfd7c[_0x5065('0x13')]);_0x42644e(_0xe6850e['error'](0x1f4,_0x1bfd7c[_0x5065('0x13')]));});});}; \ No newline at end of file +var _0xf24b=['field','IncrementPreviewCounters','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','message','CmHopperAdditionalPhone,\x20%s,\x20%s','result','VerifyAdditionalPhones','CmHopper','findOne','body','ListId','CampaignId','OrderBy','ASC','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countbusyretry','countcongestionretry','catch','SwapAdditionalPhones','ContactId','VoiceQueueId','duration','waitTime','isNil','scheduledat','minutes','add','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf24b,0xad));var _0xbf24=function(_0x8cb2f9,_0x2b8706){_0x8cb2f9=_0x8cb2f9-0x0;var _0x164887=_0xf24b[_0x8cb2f9];return _0x164887;};'use strict';var _=require(_0xbf24('0x0'));var util=require(_0xbf24('0x1'));var moment=require(_0xbf24('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf24('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf24('0x4'))['db'];var utils=require(_0xbf24('0x5'));var logger=require('../../config/logger')(_0xbf24('0x6'));var config=require(_0xbf24('0x7'));var jayson=require(_0xbf24('0x8'));var client=jayson[_0xbf24('0x9')][_0xbf24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dd757,_0x10ae5f,_0x3e983e){return new BPromise(function(_0x455e1e,_0x519ad7){return client['request'](_0x4dd757,_0x3e983e)[_0xbf24('0xb')](function(_0x3a94e7){logger[_0xbf24('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x10ae5f,_0xbf24('0xd'));logger['debug'](_0xbf24('0xe'),_0x10ae5f,'request\x20sent',JSON['stringify'](_0x3a94e7));if(_0x3a94e7[_0xbf24('0xf')]){if(_0x3a94e7[_0xbf24('0xf')]['code']===0x1f4){logger[_0xbf24('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x10ae5f,_0x3a94e7[_0xbf24('0xf')][_0xbf24('0x10')]);return _0x519ad7(_0x3a94e7[_0xbf24('0xf')][_0xbf24('0x10')]);}logger['error'](_0xbf24('0x11'),_0x10ae5f,_0x3a94e7[_0xbf24('0xf')]['message']);return _0x455e1e(_0x3a94e7['error'][_0xbf24('0x10')]);}else{logger[_0xbf24('0xc')](_0xbf24('0x11'),_0x10ae5f,_0xbf24('0xd'));_0x455e1e(_0x3a94e7[_0xbf24('0x12')][_0xbf24('0x10')]);}})['catch'](function(_0x188217){logger['error'](_0xbf24('0x11'),_0x10ae5f,_0x188217);_0x519ad7(_0x188217);});});}exports[_0xbf24('0x13')]=function(_0x1897fe){var _0x3b761a=this;return new Promise(function(_0x4907b9,_0x126976){return db[_0xbf24('0x14')][_0xbf24('0x15')]({'raw':!![],'where':{'ContactId':_0x1897fe[_0xbf24('0x16')]['ContactId'],'ListId':_0x1897fe[_0xbf24('0x16')][_0xbf24('0x17')],'VoiceQueueId':_0x1897fe['body']['VoiceQueueId']===undefined?null:_0x1897fe[_0xbf24('0x16')]['VoiceQueueId'],'CampaignId':_0x1897fe[_0xbf24('0x16')][_0xbf24('0x18')]===undefined?null:_0x1897fe['body'][_0xbf24('0x18')]}})[_0xbf24('0xb')](function(_0x23622a){if(_0x23622a!=null){return db['CmHopperAdditionalPhone'][_0xbf24('0x15')]({'raw':!![],'where':{'CmHopperId':_0x23622a['id'],'OrderBy':{'$gt':_0x23622a[_0xbf24('0x19')]}},'order':[[_0xbf24('0x19'),_0xbf24('0x1a')]]})[_0xbf24('0xb')](function(_0x48edae){var _0x1fe604=0x0;if(_0x48edae){if(_0x48edae['countbusyretry']+_0x48edae['countcongestionretry']+_0x48edae[_0xbf24('0x1b')]+_0x48edae[_0xbf24('0x1c')]+_0x48edae[_0xbf24('0x1d')]+_0x48edae[_0xbf24('0x1e')]+_0x48edae[_0xbf24('0x1f')]+_0x48edae[_0xbf24('0x20')]<_0x1897fe[_0xbf24('0x21')][_0xbf24('0x22')])_0x1fe604=0x1;_0x4907b9({'additional':_0x1fe604});}else{return db[_0xbf24('0x23')][_0xbf24('0x15')]({'raw':!![],'where':{'CmHopperId':_0x23622a['id']},'order':[[_0xbf24('0x19'),_0xbf24('0x1a')]]})[_0xbf24('0xb')](function(_0x238e35){var _0x235985=0x0;if(_0x238e35){if(_0x238e35[_0xbf24('0x24')]+_0x238e35[_0xbf24('0x25')]+_0x238e35[_0xbf24('0x1b')]+_0x238e35[_0xbf24('0x1c')]+_0x238e35['countdropretry']+_0x238e35[_0xbf24('0x1e')]+_0x238e35[_0xbf24('0x1f')]+_0x238e35[_0xbf24('0x20')]<_0x1897fe['entity'][_0xbf24('0x22')])_0x235985=0x1;_0x4907b9({'additional':_0x235985});}else{_0x4907b9({'additional':0x0});}})[_0xbf24('0x26')](function(_0x5449e8){logger['error'](_0xbf24('0x13'),_0x5449e8[_0xbf24('0x10')]);_0x126976(_0x3b761a['error'](0x1f4,_0x5449e8[_0xbf24('0x10')]));});}})[_0xbf24('0x26')](function(_0x4b295f){logger[_0xbf24('0xf')]('VerifyAdditionalPhones',_0x4b295f['message']);_0x126976(_0x3b761a[_0xbf24('0xf')](0x1f4,_0x4b295f[_0xbf24('0x10')]));});}else _0x4907b9({'additional':0x0});});});};exports[_0xbf24('0x27')]=function(_0x347858){var _0x2f14d9=this;return new Promise(function(_0x20d44c,_0x4e5b1e){return db[_0xbf24('0x14')][_0xbf24('0x15')]({'raw':!![],'where':{'ContactId':_0x347858[_0xbf24('0x16')][_0xbf24('0x28')],'ListId':_0x347858[_0xbf24('0x16')]['ListId'],'VoiceQueueId':_0x347858[_0xbf24('0x16')][_0xbf24('0x29')]===undefined?null:_0x347858[_0xbf24('0x16')][_0xbf24('0x29')],'CampaignId':_0x347858[_0xbf24('0x16')][_0xbf24('0x18')]===undefined?null:_0x347858['body'][_0xbf24('0x18')]}})['then'](function(_0x5c6e54){if(_0x5c6e54!=null){return db[_0xbf24('0x23')][_0xbf24('0x15')]({'raw':!![],'where':{'CmHopperId':_0x5c6e54['id'],'OrderBy':{'$gte':_0x5c6e54[_0xbf24('0x19')]}},'order':[[_0xbf24('0x19'),_0xbf24('0x1a')]]})[_0xbf24('0xb')](function(_0x59ee64){if(_0x59ee64)return activateAdditionalPhone(_0x5c6e54,_0x347858['body'],_0x59ee64,_0x347858[_0xbf24('0x2a')],_0x347858[_0xbf24('0x2b')])[_0xbf24('0xb')](function(_0x44b127){_0x20d44c(_0x44b127);});else{return db['CmHopperAdditionalPhone'][_0xbf24('0x15')]({'raw':!![],'where':{'CmHopperId':_0x5c6e54['id']},'order':[[_0xbf24('0x19'),_0xbf24('0x1a')]]})[_0xbf24('0xb')](function(_0x3a8b57){if(_0x3a8b57)return activateAdditionalPhone(_0x5c6e54,_0x347858[_0xbf24('0x16')],_0x3a8b57,_0x347858[_0xbf24('0x2a')],_0x347858[_0xbf24('0x2b')])[_0xbf24('0xb')](function(_0x1f46f6){_0x20d44c(_0x1f46f6);});else{_0x20d44c({'id':_0x5c6e54['id'],'phone':''});}})[_0xbf24('0x26')](function(_0x3adb1e){logger[_0xbf24('0xf')]('VerifyAdditionalPhones',_0x3adb1e[_0xbf24('0x10')]);_0x4e5b1e(_0x2f14d9[_0xbf24('0xf')](0x1f4,_0x3adb1e[_0xbf24('0x10')]));});}})[_0xbf24('0x26')](function(_0x3d2a7e){logger['error'](_0xbf24('0x13'),_0x3d2a7e[_0xbf24('0x10')]);_0x4e5b1e(_0x2f14d9[_0xbf24('0xf')](0x1f4,_0x3d2a7e[_0xbf24('0x10')]));});}else _0x20d44c(0x1);});});};function activateAdditionalPhone(_0x5e6b74,_0x1dd279,_0x131e16,_0x393ea1,_0x341bce){return new Promise(function(_0x19ebae,_0x1cfdd0){var _0x5d0fc0;if(_[_0xbf24('0x2c')](_0x131e16[_0xbf24('0x2d')])){_0x131e16[_0xbf24('0x2d')]=moment();}if(moment()>moment(_0x131e16[_0xbf24('0x2d')])){_0x5d0fc0=moment()['add'](_0x341bce||0x3,_0xbf24('0x2e'));}else{if(_0x131e16[_0xbf24('0x19')]==0x0){_0x5d0fc0=moment(_0x131e16[_0xbf24('0x2d')]);}else{_0x5d0fc0=moment()['add'](_0x341bce||0x3,_0xbf24('0x2e'));}}if(_[_0xbf24('0x2c')](_0x5d0fc0)){_0x5d0fc0=moment()[_0xbf24('0x2f')](_0x341bce||0x3,_0xbf24('0x2e'));}var _0x428ccc={'phone':_0x5e6b74[_0xbf24('0x30')],'active':0x0,'OrderBy':_[_0xbf24('0x2c')](_0x5e6b74[_0xbf24('0x19')])?0x0:_0x5e6b74[_0xbf24('0x19')],'scheduledat':moment()[_0xbf24('0x2f')](_0x393ea1||0x1,_0xbf24('0x2e')),'countbusyretry':_0x1dd279[_0xbf24('0x24')],'countcongestionretry':_0x1dd279[_0xbf24('0x25')],'countnoanswerretry':_0x1dd279[_0xbf24('0x1b')],'countnosuchnumberretry':_0x1dd279['countnosuchnumberretry'],'countdropretry':_0x1dd279['countdropretry'],'countabandonedretry':_0x1dd279[_0xbf24('0x1e')],'countmachineretry':_0x1dd279[_0xbf24('0x1f')],'countagentrejectretry':_0x1dd279[_0xbf24('0x20')],'createdAt':_0x1dd279[_0xbf24('0x31')],'updatedAt':_0x1dd279[_0xbf24('0x32')]};var _0x35ce74={'CmHopperId':_0x5e6b74['id'],'phone':_0x131e16[_0xbf24('0x30')],'active':0x0,'OrderBy':_['isNil'](_0x131e16['OrderBy'])?0x0:_0x131e16[_0xbf24('0x19')],'scheduledat':_0x5d0fc0,'countbusyretry':_0x131e16['countbusyretry'],'countcongestionretry':_0x131e16[_0xbf24('0x25')],'countnoanswerretry':_0x131e16['countnoanswerretry'],'countnosuchnumberretry':_0x131e16['countnosuchnumberretry'],'countdropretry':_0x131e16[_0xbf24('0x1d')],'countabandonedretry':_0x131e16['countabandonedretry'],'countmachineretry':_0x131e16[_0xbf24('0x1f')],'countagentrejectretry':_0x131e16[_0xbf24('0x20')],'createdAt':_0x131e16['createdAt'],'updatedAt':_0x131e16[_0xbf24('0x32')]};return db[_0xbf24('0x33')][_0xbf24('0x34')](function(_0x2d7362){return db[_0xbf24('0x23')]['update'](_0x428ccc,{'where':{'id':_0x131e16['id']}},{'transaction':_0x2d7362})[_0xbf24('0xb')](function(){return db[_0xbf24('0x14')][_0xbf24('0x35')](_0x35ce74,{'where':{'id':_0x5e6b74['id']}},{'transaction':_0x2d7362});});})[_0xbf24('0xb')](function(_0x22aaa4){_0x19ebae({'id':_0x5e6b74['id'],'phone':_0x131e16[_0xbf24('0x30')]});})['catch'](function(_0x2d89df){logger[_0xbf24('0xf')](_0xbf24('0x36'),_0x2d89df[_0xbf24('0x10')]);_0x1cfdd0({'error':_0x2d89df[_0xbf24('0x10')]});});});}exports['IncrementPreviewCounters']=function(_0x393cff){var _0x50aae7=this;return new Promise(function(_0x2b6bb6,_0x7db145){return db[_0xbf24('0x14')][_0xbf24('0x35')](_0x393cff['body'][_0xbf24('0x37')],{'where':{'id':_0x393cff[_0xbf24('0x16')]['id']}})[_0xbf24('0xb')](function(_0x1eaf60){_0x2b6bb6(_0x1eaf60);})[_0xbf24('0x26')](function(_0x956039){logger[_0xbf24('0xf')](_0xbf24('0x38'),_0x956039[_0xbf24('0x10')]);_0x7db145(_0x50aae7[_0xbf24('0xf')](0x1f4,_0x956039['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index f907b2c..0e98c92 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 _0x13ea=['isAuthenticated','show','post','create','put','/:id','update','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get'];(function(_0x5932d6,_0x2fd1da){var _0x5d0d42=function(_0x237e22){while(--_0x237e22){_0x5932d6['push'](_0x5932d6['shift']());}};_0x5d0d42(++_0x2fd1da);}(_0x13ea,0xa9));var _0xa13e=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0x13ea[_0x2f6f50];return _0x2cf365;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa13e('0x0'));var timeout=require(_0xa13e('0x1'));var express=require(_0xa13e('0x2'));var router=express['Router']();var fs_extra=require(_0xa13e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa13e('0x4'));var config=require('../../config/environment');var controller=require(_0xa13e('0x5'));router[_0xa13e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xa13e('0x7')](),controller[_0xa13e('0x8')]);router[_0xa13e('0x9')]('/',auth['isAuthenticated'](),controller[_0xa13e('0xa')]);router[_0xa13e('0xb')](_0xa13e('0xc'),auth[_0xa13e('0x7')](),controller[_0xa13e('0xd')]);router['delete'](_0xa13e('0xc'),auth[_0xa13e('0x7')](),controller[_0xa13e('0xe')]);module[_0xa13e('0xf')]=router; \ No newline at end of file +var _0x253d=['isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2aa301,_0x5aac2b){var _0x36fa9f=function(_0x2ce360){while(--_0x2ce360){_0x2aa301['push'](_0x2aa301['shift']());}};_0x36fa9f(++_0x5aac2b);}(_0x253d,0x1b3));var _0xd253=function(_0x18a168,_0x32cfcd){_0x18a168=_0x18a168-0x0;var _0x26b846=_0x253d[_0x18a168];return _0x26b846;};'use strict';var multer=require(_0xd253('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd253('0x1')]();var fs_extra=require(_0xd253('0x2'));var auth=require(_0xd253('0x3'));var interaction=require(_0xd253('0x4'));var config=require(_0xd253('0x5'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0xd253('0x6')]('/',auth[_0xd253('0x7')](),controller[_0xd253('0x8')]);router[_0xd253('0x6')](_0xd253('0x9'),auth['isAuthenticated'](),controller[_0xd253('0xa')]);router[_0xd253('0xb')]('/',auth[_0xd253('0x7')](),controller[_0xd253('0xc')]);router[_0xd253('0xd')](_0xd253('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xd253('0xe')]('/:id',auth[_0xd253('0x7')](),controller[_0xd253('0xf')]);module[_0xd253('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 038f639..1276c20 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 _0xb8ba=['sequelize','exports','INTEGER','contactListQueue','moment'];(function(_0x4f3038,_0x535fd2){var _0x5b255a=function(_0x11b96b){while(--_0x11b96b){_0x4f3038['push'](_0x4f3038['shift']());}};_0x5b255a(++_0x535fd2);}(_0xb8ba,0x6d));var _0xab8b=function(_0x3167e3,_0x5b3673){_0x3167e3=_0x3167e3-0x0;var _0x2611e0=_0xb8ba[_0x3167e3];return _0x2611e0;};'use strict';var moment=require(_0xab8b('0x0'));var Sequelize=require(_0xab8b('0x1'));module[_0xab8b('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xab8b('0x3')],'unique':_0xab8b('0x4')},'ListId':{'type':Sequelize[_0xab8b('0x3')],'unique':_0xab8b('0x4')},'VoiceQueueId':{'type':Sequelize[_0xab8b('0x3')],'unique':_0xab8b('0x4')}}; \ No newline at end of file +var _0x6462=['sequelize','exports','STRING','contactListQueue','INTEGER','moment'];(function(_0xb70f0c,_0xa3c6ca){var _0x48eb86=function(_0x32ea72){while(--_0x32ea72){_0xb70f0c['push'](_0xb70f0c['shift']());}};_0x48eb86(++_0xa3c6ca);}(_0x6462,0x11f));var _0x2646=function(_0x55ba28,_0x5379fe){_0x55ba28=_0x55ba28-0x0;var _0x5c6f70=_0x6462[_0x55ba28];return _0x5c6f70;};'use strict';var moment=require(_0x2646('0x0'));var Sequelize=require(_0x2646('0x1'));module[_0x2646('0x2')]={'phone':{'type':Sequelize[_0x2646('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x2646('0x4')},'ListId':{'type':Sequelize[_0x2646('0x5')],'unique':_0x2646('0x4')},'VoiceQueueId':{'type':Sequelize[_0x2646('0x5')],'unique':_0x2646('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index c2fdcc9..cc3f467 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 _0xfa24=['name','send','map','CmHopperBlack','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x42e5f4,_0x227c39){var _0xe8c411=function(_0x22748d){while(--_0x22748d){_0x42e5f4['push'](_0x42e5f4['shift']());}};_0xe8c411(++_0x227c39);}(_0xfa24,0xff));var _0x4fa2=function(_0x471448,_0x1c0e9e){_0x471448=_0x471448-0x0;var _0x38190b=_0xfa24[_0x471448];return _0x38190b;};'use strict';var emlformat=require(_0x4fa2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4fa2('0x1'));var jsonpatch=require(_0x4fa2('0x2'));var rp=require(_0x4fa2('0x3'));var moment=require(_0x4fa2('0x4'));var BPromise=require(_0x4fa2('0x5'));var Mustache=require(_0x4fa2('0x6'));var util=require(_0x4fa2('0x7'));var path=require(_0x4fa2('0x8'));var sox=require('sox');var csv=require(_0x4fa2('0x9'));var ejs=require(_0x4fa2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4fa2('0xb'));var squel=require(_0x4fa2('0xc'));var crypto=require('crypto');var jsforce=require(_0x4fa2('0xd'));var deskjs=require(_0x4fa2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4fa2('0xf'));var authService=require(_0x4fa2('0x10'));var qs=require(_0x4fa2('0x11'));var as=require(_0x4fa2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4fa2('0x13'))(_0x4fa2('0x14'));var utils=require(_0x4fa2('0x15'));var config=require(_0x4fa2('0x16'));var licenseUtil=require(_0x4fa2('0x17'));var db=require(_0x4fa2('0x18'))['db'];function respondWithStatusCode(_0x503a8c,_0x38f7d8){_0x38f7d8=_0x38f7d8||0xcc;return function(_0x10a403){if(_0x10a403){return _0x503a8c[_0x4fa2('0x19')](_0x38f7d8);}return _0x503a8c[_0x4fa2('0x1a')](_0x38f7d8)[_0x4fa2('0x1b')]();};}function respondWithResult(_0x2a800d,_0x310e4d){_0x310e4d=_0x310e4d||0xc8;return function(_0x2a6522){if(_0x2a6522){return _0x2a800d['status'](_0x310e4d)[_0x4fa2('0x1c')](_0x2a6522);}};}function respondWithFilteredResult(_0x48c0db,_0x14d310){return function(_0x3959b8){if(_0x3959b8){var _0x2979ef=typeof _0x14d310['offset']===_0x4fa2('0x1d')&&typeof _0x14d310[_0x4fa2('0x1e')]===_0x4fa2('0x1d');var _0x44933f=_0x3959b8[_0x4fa2('0x1f')];var _0x5b7c00=_0x2979ef?0x0:_0x14d310[_0x4fa2('0x20')];var _0x41ed4e=_0x2979ef?_0x3959b8[_0x4fa2('0x1f')]:_0x14d310['offset']+_0x14d310['limit'];var _0x3b94a;if(_0x41ed4e>=_0x44933f){_0x41ed4e=_0x44933f;_0x3b94a=0xc8;}else{_0x3b94a=0xce;}_0x48c0db[_0x4fa2('0x1a')](_0x3b94a);return _0x48c0db['set'](_0x4fa2('0x21'),_0x5b7c00+'-'+_0x41ed4e+'/'+_0x44933f)[_0x4fa2('0x1c')](_0x3959b8);}return null;};}function patchUpdates(_0x137582){return function(_0x58d8d6){try{jsonpatch[_0x4fa2('0x22')](_0x58d8d6,_0x137582,!![]);}catch(_0x3644a4){return BPromise[_0x4fa2('0x23')](_0x3644a4);}return _0x58d8d6[_0x4fa2('0x24')]();};}function saveUpdates(_0x3b0cfa,_0x203820){return function(_0x58c8ed){if(_0x58c8ed){return _0x58c8ed[_0x4fa2('0x25')](_0x3b0cfa)[_0x4fa2('0x26')](function(_0x5d60c9){return _0x5d60c9;});}return null;};}function removeEntity(_0x4eda6e,_0x3554af){return function(_0x4a5b70){if(_0x4a5b70){return _0x4a5b70[_0x4fa2('0x27')]()[_0x4fa2('0x26')](function(){_0x4eda6e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a3282,_0x35fe84){return function(_0x4f2c07){if(!_0x4f2c07){_0x1a3282['sendStatus'](0x194);}return _0x4f2c07;};}function handleError(_0x343532,_0x11e1bb){_0x11e1bb=_0x11e1bb||0x1f4;return function(_0x59ec00){logger[_0x4fa2('0x28')](_0x59ec00['stack']);if(_0x59ec00[_0x4fa2('0x29')]){delete _0x59ec00['name'];}_0x343532['status'](_0x11e1bb)[_0x4fa2('0x2a')](_0x59ec00);};}exports['index']=function(_0xda141c,_0x4905a7){var _0xc1f765={},_0x31c4df={},_0x1580c4={'count':0x0,'rows':[]};var _0xbfa5bd=_[_0x4fa2('0x2b')](db[_0x4fa2('0x2c')][_0x4fa2('0x2d')],function(_0x168805){return{'name':_0x168805[_0x4fa2('0x2e')],'type':_0x168805[_0x4fa2('0x2f')]['key']};});_0x31c4df[_0x4fa2('0x30')]=_['map'](_0xbfa5bd,_0x4fa2('0x29'));_0x31c4df['query']=_[_0x4fa2('0x31')](_0xda141c[_0x4fa2('0x32')]);_0x31c4df[_0x4fa2('0x33')]=_[_0x4fa2('0x34')](_0x31c4df[_0x4fa2('0x30')],_0x31c4df['query']);_0xc1f765[_0x4fa2('0x35')]=_[_0x4fa2('0x34')](_0x31c4df[_0x4fa2('0x30')],qs[_0x4fa2('0x36')](_0xda141c['query'][_0x4fa2('0x36')]));_0xc1f765[_0x4fa2('0x35')]=_0xc1f765['attributes']['length']?_0xc1f765['attributes']:_0x31c4df[_0x4fa2('0x30')];if(!_0xda141c[_0x4fa2('0x32')]['hasOwnProperty'](_0x4fa2('0x37'))){_0xc1f765[_0x4fa2('0x1e')]=qs[_0x4fa2('0x1e')](_0xda141c[_0x4fa2('0x32')]['limit']);_0xc1f765[_0x4fa2('0x20')]=qs[_0x4fa2('0x20')](_0xda141c['query'][_0x4fa2('0x20')]);}_0xc1f765[_0x4fa2('0x38')]=qs[_0x4fa2('0x39')](_0xda141c[_0x4fa2('0x32')][_0x4fa2('0x39')]);_0xc1f765[_0x4fa2('0x3a')]=qs[_0x4fa2('0x33')](_[_0x4fa2('0x3b')](_0xda141c[_0x4fa2('0x32')],_0x31c4df[_0x4fa2('0x33')]),_0xbfa5bd);if(_0xda141c[_0x4fa2('0x32')][_0x4fa2('0x3c')]){_0xc1f765[_0x4fa2('0x3a')]=_[_0x4fa2('0x3d')](_0xc1f765[_0x4fa2('0x3a')],{'$or':_[_0x4fa2('0x2b')](_0xbfa5bd,function(_0x38fe57){if(_0x38fe57[_0x4fa2('0x2f')]!==_0x4fa2('0x3e')){var _0x56e2d8={};_0x56e2d8[_0x38fe57[_0x4fa2('0x29')]]={'$like':'%'+_0xda141c[_0x4fa2('0x32')][_0x4fa2('0x3c')]+'%'};return _0x56e2d8;}})});}_0xc1f765=_[_0x4fa2('0x3d')]({},_0xc1f765,_0xda141c[_0x4fa2('0x3f')]);var _0x128496={'where':_0xc1f765[_0x4fa2('0x3a')]};return db[_0x4fa2('0x2c')][_0x4fa2('0x1f')](_0x128496)[_0x4fa2('0x26')](function(_0x4903bd){_0x1580c4['count']=_0x4903bd;if(_0xda141c[_0x4fa2('0x32')][_0x4fa2('0x40')]){_0xc1f765[_0x4fa2('0x41')]=[{'all':!![]}];}return db[_0x4fa2('0x2c')]['findAll'](_0xc1f765);})[_0x4fa2('0x26')](function(_0x3a56cf){_0x1580c4[_0x4fa2('0x42')]=_0x3a56cf;return _0x1580c4;})[_0x4fa2('0x26')](respondWithFilteredResult(_0x4905a7,_0xc1f765))[_0x4fa2('0x43')](handleError(_0x4905a7,null));};exports[_0x4fa2('0x44')]=function(_0x3251d5,_0x2d0eb1){var _0x48d87b={'raw':!![],'where':{'id':_0x3251d5[_0x4fa2('0x45')]['id']}},_0x372c36={};_0x372c36[_0x4fa2('0x30')]=_['keys'](db['CmHopperBlack'][_0x4fa2('0x2d')]);_0x372c36[_0x4fa2('0x32')]=_[_0x4fa2('0x31')](_0x3251d5[_0x4fa2('0x32')]);_0x372c36[_0x4fa2('0x33')]=_['intersection'](_0x372c36['model'],_0x372c36['query']);_0x48d87b[_0x4fa2('0x35')]=_[_0x4fa2('0x34')](_0x372c36[_0x4fa2('0x30')],qs[_0x4fa2('0x36')](_0x3251d5[_0x4fa2('0x32')][_0x4fa2('0x36')]));_0x48d87b[_0x4fa2('0x35')]=_0x48d87b['attributes'][_0x4fa2('0x46')]?_0x48d87b[_0x4fa2('0x35')]:_0x372c36[_0x4fa2('0x30')];if(_0x3251d5[_0x4fa2('0x32')][_0x4fa2('0x40')]){_0x48d87b[_0x4fa2('0x41')]=[{'all':!![]}];}_0x48d87b=_[_0x4fa2('0x3d')]({},_0x48d87b,_0x3251d5[_0x4fa2('0x3f')]);return db['CmHopperBlack'][_0x4fa2('0x47')](_0x48d87b)[_0x4fa2('0x26')](handleEntityNotFound(_0x2d0eb1,null))[_0x4fa2('0x26')](respondWithResult(_0x2d0eb1,null))[_0x4fa2('0x43')](handleError(_0x2d0eb1,null));};exports[_0x4fa2('0x25')]=function(_0x5bdc16,_0xc9ec8e){if(_0x5bdc16[_0x4fa2('0x48')]['id']){delete _0x5bdc16[_0x4fa2('0x48')]['id'];}return db[_0x4fa2('0x2c')][_0x4fa2('0x47')]({'where':{'id':_0x5bdc16['params']['id']}})[_0x4fa2('0x26')](handleEntityNotFound(_0xc9ec8e,null))['then'](saveUpdates(_0x5bdc16[_0x4fa2('0x48')],null))[_0x4fa2('0x26')](respondWithResult(_0xc9ec8e,null))[_0x4fa2('0x43')](handleError(_0xc9ec8e,null));};exports[_0x4fa2('0x27')]=function(_0x4118e5,_0x3fc6d9){return db['CmHopperBlack'][_0x4fa2('0x47')]({'where':{'id':_0x4118e5[_0x4fa2('0x45')]['id']}})['then'](handleEntityNotFound(_0x3fc6d9,null))[_0x4fa2('0x26')](removeEntity(_0x3fc6d9,null))[_0x4fa2('0x43')](handleError(_0x3fc6d9,null));};exports[_0x4fa2('0x49')]=function(_0x3c571f,_0x12c16f){return db[_0x4fa2('0x2c')][_0x4fa2('0x49')]()[_0x4fa2('0x26')](respondWithResult(_0x12c16f,null))[_0x4fa2('0x43')](handleError(_0x12c16f,null));}; \ No newline at end of file +var _0xd1b9=['ejs','fs-extra','squel','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','json','offset','limit','undefined','count','status','Content-Range','then','destroy','end','error','stack','name','CmHopperBlack','type','key','model','map','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','options','find','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox'];(function(_0x239795,_0x391f30){var _0x25c22b=function(_0x228619){while(--_0x228619){_0x239795['push'](_0x239795['shift']());}};_0x25c22b(++_0x391f30);}(_0xd1b9,0x1a1));var _0x9d1b=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0xd1b9[_0x207811];return _0x170d56;};'use strict';var emlformat=require(_0x9d1b('0x0'));var rimraf=require(_0x9d1b('0x1'));var zipdir=require(_0x9d1b('0x2'));var jsonpatch=require(_0x9d1b('0x3'));var rp=require(_0x9d1b('0x4'));var moment=require(_0x9d1b('0x5'));var BPromise=require(_0x9d1b('0x6'));var Mustache=require('mustache');var util=require(_0x9d1b('0x7'));var path=require('path');var sox=require(_0x9d1b('0x8'));var csv=require('to-csv');var ejs=require(_0x9d1b('0x9'));var fs=require('fs');var fs_extra=require(_0x9d1b('0xa'));var _=require('lodash');var squel=require(_0x9d1b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9d1b('0xc'));var toCsv=require(_0x9d1b('0xd'));var querystring=require(_0x9d1b('0xe'));var Papa=require('papaparse');var Redis=require(_0x9d1b('0xf'));var authService=require(_0x9d1b('0x10'));var qs=require(_0x9d1b('0x11'));var as=require(_0x9d1b('0x12'));var hardwareService=require(_0x9d1b('0x13'));var logger=require('../../config/logger')(_0x9d1b('0x14'));var utils=require(_0x9d1b('0x15'));var config=require(_0x9d1b('0x16'));var licenseUtil=require(_0x9d1b('0x17'));var db=require(_0x9d1b('0x18'))['db'];function respondWithStatusCode(_0x2dd966,_0x28cba4){_0x28cba4=_0x28cba4||0xcc;return function(_0x426abf){if(_0x426abf){return _0x2dd966[_0x9d1b('0x19')](_0x28cba4);}return _0x2dd966['status'](_0x28cba4)['end']();};}function respondWithResult(_0x3aa691,_0x1ec601){_0x1ec601=_0x1ec601||0xc8;return function(_0x40c548){if(_0x40c548){return _0x3aa691['status'](_0x1ec601)[_0x9d1b('0x1a')](_0x40c548);}};}function respondWithFilteredResult(_0x153e7c,_0x46568c){return function(_0x5af51f){if(_0x5af51f){var _0x174969=typeof _0x46568c[_0x9d1b('0x1b')]==='undefined'&&typeof _0x46568c[_0x9d1b('0x1c')]===_0x9d1b('0x1d');var _0x466e4d=_0x5af51f[_0x9d1b('0x1e')];var _0x156a96=_0x174969?0x0:_0x46568c[_0x9d1b('0x1b')];var _0x744509=_0x174969?_0x5af51f[_0x9d1b('0x1e')]:_0x46568c[_0x9d1b('0x1b')]+_0x46568c[_0x9d1b('0x1c')];var _0x481675;if(_0x744509>=_0x466e4d){_0x744509=_0x466e4d;_0x481675=0xc8;}else{_0x481675=0xce;}_0x153e7c[_0x9d1b('0x1f')](_0x481675);return _0x153e7c['set'](_0x9d1b('0x20'),_0x156a96+'-'+_0x744509+'/'+_0x466e4d)[_0x9d1b('0x1a')](_0x5af51f);}return null;};}function patchUpdates(_0xb41c5e){return function(_0x540995){try{jsonpatch['apply'](_0x540995,_0xb41c5e,!![]);}catch(_0x4376a4){return BPromise['reject'](_0x4376a4);}return _0x540995['save']();};}function saveUpdates(_0x55ad10,_0x5343c9){return function(_0x1f4f83){if(_0x1f4f83){return _0x1f4f83['update'](_0x55ad10)[_0x9d1b('0x21')](function(_0x13150c){return _0x13150c;});}return null;};}function removeEntity(_0x35ff37,_0x55b791){return function(_0x1e1dd7){if(_0x1e1dd7){return _0x1e1dd7[_0x9d1b('0x22')]()[_0x9d1b('0x21')](function(){_0x35ff37[_0x9d1b('0x1f')](0xcc)[_0x9d1b('0x23')]();});}};}function handleEntityNotFound(_0x5edc78,_0x474180){return function(_0x378fff){if(!_0x378fff){_0x5edc78[_0x9d1b('0x19')](0x194);}return _0x378fff;};}function handleError(_0xf111a4,_0x13ec74){_0x13ec74=_0x13ec74||0x1f4;return function(_0x518edc){logger[_0x9d1b('0x24')](_0x518edc[_0x9d1b('0x25')]);if(_0x518edc[_0x9d1b('0x26')]){delete _0x518edc['name'];}_0xf111a4[_0x9d1b('0x1f')](_0x13ec74)['send'](_0x518edc);};}exports['index']=function(_0x1b47da,_0xd9fec3){var _0x3ddc90={},_0x17254d={},_0x1fd6fa={'count':0x0,'rows':[]};var _0xad9577=_['map'](db[_0x9d1b('0x27')]['rawAttributes'],function(_0x524dd7){return{'name':_0x524dd7['fieldName'],'type':_0x524dd7[_0x9d1b('0x28')][_0x9d1b('0x29')]};});_0x17254d[_0x9d1b('0x2a')]=_[_0x9d1b('0x2b')](_0xad9577,_0x9d1b('0x26'));_0x17254d['query']=_[_0x9d1b('0x2c')](_0x1b47da['query']);_0x17254d[_0x9d1b('0x2d')]=_[_0x9d1b('0x2e')](_0x17254d[_0x9d1b('0x2a')],_0x17254d['query']);_0x3ddc90[_0x9d1b('0x2f')]=_[_0x9d1b('0x2e')](_0x17254d[_0x9d1b('0x2a')],qs[_0x9d1b('0x30')](_0x1b47da[_0x9d1b('0x31')][_0x9d1b('0x30')]));_0x3ddc90[_0x9d1b('0x2f')]=_0x3ddc90[_0x9d1b('0x2f')][_0x9d1b('0x32')]?_0x3ddc90['attributes']:_0x17254d[_0x9d1b('0x2a')];if(!_0x1b47da['query'][_0x9d1b('0x33')]('nolimit')){_0x3ddc90[_0x9d1b('0x1c')]=qs['limit'](_0x1b47da[_0x9d1b('0x31')][_0x9d1b('0x1c')]);_0x3ddc90[_0x9d1b('0x1b')]=qs[_0x9d1b('0x1b')](_0x1b47da[_0x9d1b('0x31')][_0x9d1b('0x1b')]);}_0x3ddc90[_0x9d1b('0x34')]=qs['sort'](_0x1b47da[_0x9d1b('0x31')][_0x9d1b('0x35')]);_0x3ddc90['where']=qs[_0x9d1b('0x2d')](_[_0x9d1b('0x36')](_0x1b47da[_0x9d1b('0x31')],_0x17254d[_0x9d1b('0x2d')]),_0xad9577);if(_0x1b47da[_0x9d1b('0x31')][_0x9d1b('0x37')]){_0x3ddc90[_0x9d1b('0x38')]=_[_0x9d1b('0x39')](_0x3ddc90[_0x9d1b('0x38')],{'$or':_['map'](_0xad9577,function(_0x21f200){if(_0x21f200[_0x9d1b('0x28')]!==_0x9d1b('0x3a')){var _0xbb98ec={};_0xbb98ec[_0x21f200['name']]={'$like':'%'+_0x1b47da[_0x9d1b('0x31')][_0x9d1b('0x37')]+'%'};return _0xbb98ec;}})});}_0x3ddc90=_[_0x9d1b('0x39')]({},_0x3ddc90,_0x1b47da['options']);var _0x3975b5={'where':_0x3ddc90[_0x9d1b('0x38')]};return db[_0x9d1b('0x27')][_0x9d1b('0x1e')](_0x3975b5)[_0x9d1b('0x21')](function(_0xe18bcf){_0x1fd6fa['count']=_0xe18bcf;if(_0x1b47da[_0x9d1b('0x31')][_0x9d1b('0x3b')]){_0x3ddc90[_0x9d1b('0x3c')]=[{'all':!![]}];}return db[_0x9d1b('0x27')]['findAll'](_0x3ddc90);})['then'](function(_0x91f836){_0x1fd6fa[_0x9d1b('0x3d')]=_0x91f836;return _0x1fd6fa;})[_0x9d1b('0x21')](respondWithFilteredResult(_0xd9fec3,_0x3ddc90))[_0x9d1b('0x3e')](handleError(_0xd9fec3,null));};exports[_0x9d1b('0x3f')]=function(_0x1d3dfa,_0x136467){var _0x3c2fa4={'raw':!![],'where':{'id':_0x1d3dfa[_0x9d1b('0x40')]['id']}},_0x32c963={};_0x32c963[_0x9d1b('0x2a')]=_[_0x9d1b('0x2c')](db['CmHopperBlack'][_0x9d1b('0x41')]);_0x32c963[_0x9d1b('0x31')]=_[_0x9d1b('0x2c')](_0x1d3dfa[_0x9d1b('0x31')]);_0x32c963['filters']=_[_0x9d1b('0x2e')](_0x32c963[_0x9d1b('0x2a')],_0x32c963[_0x9d1b('0x31')]);_0x3c2fa4[_0x9d1b('0x2f')]=_[_0x9d1b('0x2e')](_0x32c963['model'],qs[_0x9d1b('0x30')](_0x1d3dfa['query']['fields']));_0x3c2fa4['attributes']=_0x3c2fa4[_0x9d1b('0x2f')][_0x9d1b('0x32')]?_0x3c2fa4[_0x9d1b('0x2f')]:_0x32c963[_0x9d1b('0x2a')];if(_0x1d3dfa[_0x9d1b('0x31')][_0x9d1b('0x3b')]){_0x3c2fa4[_0x9d1b('0x3c')]=[{'all':!![]}];}_0x3c2fa4=_[_0x9d1b('0x39')]({},_0x3c2fa4,_0x1d3dfa[_0x9d1b('0x42')]);return db[_0x9d1b('0x27')][_0x9d1b('0x43')](_0x3c2fa4)[_0x9d1b('0x21')](handleEntityNotFound(_0x136467,null))['then'](respondWithResult(_0x136467,null))['catch'](handleError(_0x136467,null));};exports[_0x9d1b('0x44')]=function(_0x4fb578,_0x167f75){if(_0x4fb578[_0x9d1b('0x45')]['id']){delete _0x4fb578[_0x9d1b('0x45')]['id'];}return db[_0x9d1b('0x27')][_0x9d1b('0x43')]({'where':{'id':_0x4fb578['params']['id']}})['then'](handleEntityNotFound(_0x167f75,null))[_0x9d1b('0x21')](saveUpdates(_0x4fb578[_0x9d1b('0x45')],null))[_0x9d1b('0x21')](respondWithResult(_0x167f75,null))[_0x9d1b('0x3e')](handleError(_0x167f75,null));};exports[_0x9d1b('0x22')]=function(_0x1efa47,_0xdd2589){return db[_0x9d1b('0x27')][_0x9d1b('0x43')]({'where':{'id':_0x1efa47[_0x9d1b('0x40')]['id']}})[_0x9d1b('0x21')](handleEntityNotFound(_0xdd2589,null))[_0x9d1b('0x21')](removeEntity(_0xdd2589,null))['catch'](handleError(_0xdd2589,null));};exports['describe']=function(_0x446392,_0x4c7c10){return db[_0x9d1b('0x27')][_0x9d1b('0x46')]()[_0x9d1b('0x21')](respondWithResult(_0x4c7c10,null))[_0x9d1b('0x3e')](handleError(_0x4c7c10,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index d2d942a..369c78e 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 _0xfce8=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','CmHopperBlack','cm_hopper_black'];(function(_0x176453,_0x1fd657){var _0x352218=function(_0x2b6344){while(--_0x2b6344){_0x176453['push'](_0x176453['shift']());}};_0x352218(++_0x1fd657);}(_0xfce8,0x134));var _0x8fce=function(_0x390902,_0x2c7de0){_0x390902=_0x390902-0x0;var _0x498aba=_0xfce8[_0x390902];return _0x498aba;};'use strict';var _=require(_0x8fce('0x0'));var util=require(_0x8fce('0x1'));var logger=require(_0x8fce('0x2'))('api');var moment=require(_0x8fce('0x3'));var BPromise=require(_0x8fce('0x4'));var rp=require(_0x8fce('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8fce('0x6'));var config=require(_0x8fce('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0x8fce('0x8')]=function(_0x42b718,_0x500aa1){return _0x42b718['define'](_0x8fce('0x9'),attributes,{'tableName':_0x8fce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7119=['define','CmHopperBlack','cm_hopper_black','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports'];(function(_0x2978fe,_0x12c111){var _0x1b63e8=function(_0x313eab){while(--_0x313eab){_0x2978fe['push'](_0x2978fe['shift']());}};_0x1b63e8(++_0x12c111);}(_0x7119,0x1cb));var _0x9711=function(_0x3dc089,_0x5ccb0d){_0x3dc089=_0x3dc089-0x0;var _0x34d9d3=_0x7119[_0x3dc089];return _0x34d9d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9711('0x0'))(_0x9711('0x1'));var moment=require(_0x9711('0x2'));var BPromise=require(_0x9711('0x3'));var rp=require(_0x9711('0x4'));var fs=require('fs');var path=require(_0x9711('0x5'));var rimraf=require(_0x9711('0x6'));var config=require('../../config/environment');var attributes=require(_0x9711('0x7'));module[_0x9711('0x8')]=function(_0x18d6fc,_0x28f61b){return _0x18d6fc[_0x9711('0x9')](_0x9711('0xa'),attributes,{'tableName':_0x9711('0xb'),'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 f6130b4..dd9d113 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 _0x4391=['UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','util','moment','bluebird','randomstring','ioredis','../../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','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','map','include','model'];(function(_0x48242c,_0x18307c){var _0x9a6e4e=function(_0x11525e){while(--_0x11525e){_0x48242c['push'](_0x48242c['shift']());}};_0x9a6e4e(++_0x18307c);}(_0x4391,0xee));var _0x1439=function(_0x15a7c1,_0x45adca){_0x15a7c1=_0x15a7c1-0x0;var _0x3a7230=_0x4391[_0x15a7c1];return _0x3a7230;};'use strict';var _=require('lodash');var util=require(_0x1439('0x0'));var moment=require(_0x1439('0x1'));var BPromise=require(_0x1439('0x2'));var rs=require(_0x1439('0x3'));var fs=require('fs');var Redis=require(_0x1439('0x4'));var db=require(_0x1439('0x5'))['db'];var utils=require(_0x1439('0x6'));var logger=require(_0x1439('0x7'))(_0x1439('0x8'));var config=require(_0x1439('0x9'));var jayson=require(_0x1439('0xa'));var client=jayson[_0x1439('0xb')][_0x1439('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26df90,_0x175a63,_0x4a4c1a){return new BPromise(function(_0xf58ef2,_0x47f4c1){return client['request'](_0x26df90,_0x4a4c1a)[_0x1439('0xd')](function(_0x469d2e){logger[_0x1439('0xe')](_0x1439('0xf'),_0x175a63,_0x1439('0x10'));logger[_0x1439('0x11')](_0x1439('0x12'),_0x175a63,'request\x20sent',JSON[_0x1439('0x13')](_0x469d2e));if(_0x469d2e['error']){if(_0x469d2e[_0x1439('0x14')][_0x1439('0x15')]===0x1f4){logger[_0x1439('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x175a63,_0x469d2e[_0x1439('0x14')][_0x1439('0x16')]);return _0x47f4c1(_0x469d2e[_0x1439('0x14')][_0x1439('0x16')]);}logger[_0x1439('0x14')](_0x1439('0xf'),_0x175a63,_0x469d2e[_0x1439('0x14')][_0x1439('0x16')]);return _0xf58ef2(_0x469d2e[_0x1439('0x14')]['message']);}else{logger[_0x1439('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x175a63,_0x1439('0x10'));_0xf58ef2(_0x469d2e['result']['message']);}})[_0x1439('0x17')](function(_0x4ef9b3){logger[_0x1439('0x14')](_0x1439('0xf'),_0x175a63,_0x4ef9b3);_0x47f4c1(_0x4ef9b3);});});}exports[_0x1439('0x18')]=function(_0x1b7ad7){var _0x50e53e=this;return new Promise(function(_0x1ac521,_0x20d4a1){return db[_0x1439('0x19')][_0x1439('0x1a')]({'raw':_0x1b7ad7[_0x1439('0x1b')]?_0x1b7ad7[_0x1439('0x1b')][_0x1439('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b7ad7[_0x1439('0x1b')]?_0x1b7ad7[_0x1439('0x1b')][_0x1439('0x1d')]||null:null,'attributes':_0x1b7ad7[_0x1439('0x1b')]?_0x1b7ad7['options'][_0x1439('0x1e')]||null:null,'limit':_0x1b7ad7[_0x1439('0x1b')]?_0x1b7ad7['options'][_0x1439('0x1f')]||null:null,'include':_0x1b7ad7[_0x1439('0x1b')]?_0x1b7ad7[_0x1439('0x1b')]['include']?_[_0x1439('0x20')](_0x1b7ad7[_0x1439('0x1b')][_0x1439('0x21')],function(_0x511549){return{'model':db[_0x511549[_0x1439('0x22')]],'as':_0x511549['as'],'attributes':_0x511549[_0x1439('0x1e')],'include':_0x511549[_0x1439('0x21')]?_[_0x1439('0x20')](_0x511549[_0x1439('0x21')],function(_0x4d69a1){return{'model':db[_0x4d69a1[_0x1439('0x22')]],'as':_0x4d69a1['as'],'attributes':_0x4d69a1[_0x1439('0x1e')],'include':_0x4d69a1[_0x1439('0x21')]?_['map'](_0x4d69a1['include'],function(_0x40a239){return{'model':db[_0x40a239['model']],'as':_0x40a239['as'],'attributes':_0x40a239['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b2862){logger[_0x1439('0xe')](_0x1439('0x18'),_0x1b7ad7);logger[_0x1439('0x11')]('GetCmHopperBlack',_0x1b7ad7,JSON[_0x1439('0x13')](_0x3b2862));_0x1ac521(_0x3b2862);})['catch'](function(_0x270e07){logger['error']('GetCmHopperBlack',_0x270e07[_0x1439('0x16')],_0x1b7ad7);_0x20d4a1(_0x50e53e[_0x1439('0x14')](0x1f4,_0x270e07[_0x1439('0x16')]));});});};exports[_0x1439('0x23')]=function(_0x453f5b){var _0x46ead4=this;return new Promise(function(_0x3a4e21,_0xda5f62){return db['CmHopperBlack'][_0x1439('0x24')](_0x453f5b[_0x1439('0x25')],{'raw':_0x453f5b[_0x1439('0x1b')]?_0x453f5b[_0x1439('0x1b')][_0x1439('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x453f5b[_0x1439('0x1b')]?_0x453f5b[_0x1439('0x1b')]['where']||null:null,'attributes':_0x453f5b[_0x1439('0x1b')]?_0x453f5b[_0x1439('0x1b')][_0x1439('0x1e')]||null:null,'limit':_0x453f5b['options']?_0x453f5b[_0x1439('0x1b')][_0x1439('0x1f')]||null:null})[_0x1439('0xd')](function(_0x15ab2a){logger[_0x1439('0xe')]('UpdateCmHopperBlack',_0x453f5b);logger[_0x1439('0x11')]('UpdateCmHopperBlack',_0x453f5b,JSON['stringify'](_0x15ab2a));_0x3a4e21(_0x15ab2a);})[_0x1439('0x17')](function(_0xf3c8b1){logger[_0x1439('0x14')](_0x1439('0x23'),_0xf3c8b1[_0x1439('0x16')],_0x453f5b);_0xda5f62(_0x46ead4[_0x1439('0x14')](0x1f4,_0xf3c8b1[_0x1439('0x16')]));});});};exports['DestroyCmHopperBlack']=function(_0x3bca52){var _0x55de0e=this;return new Promise(function(_0x55bf71,_0x384f36){return db[_0x1439('0x19')]['destroy']({'where':_0x3bca52['options']?_0x3bca52[_0x1439('0x1b')][_0x1439('0x1d')]||null:null})[_0x1439('0xd')](function(_0xfdccc5){logger[_0x1439('0xe')]('DestroyCmHopperBlack',_0x3bca52);logger[_0x1439('0x11')](_0x1439('0x26'),_0x3bca52,JSON[_0x1439('0x13')](_0xfdccc5));_0x55bf71(_0xfdccc5);})['catch'](function(_0xe5d94){logger[_0x1439('0x14')](_0x1439('0x26'),_0xe5d94[_0x1439('0x16')],_0x3bca52);_0x384f36(_0x55de0e[_0x1439('0x14')](0x1f4,_0xe5d94[_0x1439('0x16')]));});});}; \ No newline at end of file +var _0xaef3=['stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','debug','UpdateCmHopperBlack','body','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xaef3,0x15e));var _0x3aef=function(_0x510c60,_0x50247e){_0x510c60=_0x510c60-0x0;var _0x49c4aa=_0xaef3[_0x510c60];return _0x49c4aa;};'use strict';var _=require(_0x3aef('0x0'));var util=require(_0x3aef('0x1'));var moment=require(_0x3aef('0x2'));var BPromise=require(_0x3aef('0x3'));var rs=require(_0x3aef('0x4'));var fs=require('fs');var Redis=require(_0x3aef('0x5'));var db=require(_0x3aef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3aef('0x7'))(_0x3aef('0x8'));var config=require(_0x3aef('0x9'));var jayson=require(_0x3aef('0xa'));var client=jayson[_0x3aef('0xb')][_0x3aef('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309144,_0x1b1836,_0x4bcabd){return new BPromise(function(_0x411605,_0x16f897){return client[_0x3aef('0xd')](_0x309144,_0x4bcabd)[_0x3aef('0xe')](function(_0xa2d9bd){logger[_0x3aef('0xf')](_0x3aef('0x10'),_0x1b1836,_0x3aef('0x11'));logger['debug'](_0x3aef('0x12'),_0x1b1836,_0x3aef('0x11'),JSON[_0x3aef('0x13')](_0xa2d9bd));if(_0xa2d9bd['error']){if(_0xa2d9bd[_0x3aef('0x14')][_0x3aef('0x15')]===0x1f4){logger['error'](_0x3aef('0x10'),_0x1b1836,_0xa2d9bd[_0x3aef('0x14')][_0x3aef('0x16')]);return _0x16f897(_0xa2d9bd[_0x3aef('0x14')][_0x3aef('0x16')]);}logger[_0x3aef('0x14')](_0x3aef('0x10'),_0x1b1836,_0xa2d9bd[_0x3aef('0x14')]['message']);return _0x411605(_0xa2d9bd[_0x3aef('0x14')]['message']);}else{logger[_0x3aef('0xf')](_0x3aef('0x10'),_0x1b1836,_0x3aef('0x11'));_0x411605(_0xa2d9bd[_0x3aef('0x17')][_0x3aef('0x16')]);}})[_0x3aef('0x18')](function(_0x1138f8){logger[_0x3aef('0x14')](_0x3aef('0x10'),_0x1b1836,_0x1138f8);_0x16f897(_0x1138f8);});});}exports[_0x3aef('0x19')]=function(_0x5dfeb6){var _0x1ea476=this;return new Promise(function(_0x4f66d8,_0x5acad5){return db[_0x3aef('0x1a')][_0x3aef('0x1b')]({'raw':_0x5dfeb6['options']?_0x5dfeb6[_0x3aef('0x1c')][_0x3aef('0x1d')]===undefined?!![]:![]:!![],'where':_0x5dfeb6[_0x3aef('0x1c')]?_0x5dfeb6[_0x3aef('0x1c')][_0x3aef('0x1e')]||null:null,'attributes':_0x5dfeb6[_0x3aef('0x1c')]?_0x5dfeb6[_0x3aef('0x1c')][_0x3aef('0x1f')]||null:null,'limit':_0x5dfeb6[_0x3aef('0x1c')]?_0x5dfeb6[_0x3aef('0x1c')][_0x3aef('0x20')]||null:null,'include':_0x5dfeb6[_0x3aef('0x1c')]?_0x5dfeb6[_0x3aef('0x1c')][_0x3aef('0x21')]?_[_0x3aef('0x22')](_0x5dfeb6[_0x3aef('0x1c')][_0x3aef('0x21')],function(_0x592cb8){return{'model':db[_0x592cb8[_0x3aef('0x23')]],'as':_0x592cb8['as'],'attributes':_0x592cb8['attributes'],'include':_0x592cb8[_0x3aef('0x21')]?_[_0x3aef('0x22')](_0x592cb8[_0x3aef('0x21')],function(_0x4fa6b0){return{'model':db[_0x4fa6b0[_0x3aef('0x23')]],'as':_0x4fa6b0['as'],'attributes':_0x4fa6b0[_0x3aef('0x1f')],'include':_0x4fa6b0[_0x3aef('0x21')]?_[_0x3aef('0x22')](_0x4fa6b0[_0x3aef('0x21')],function(_0x3cbfc1){return{'model':db[_0x3cbfc1['model']],'as':_0x3cbfc1['as'],'attributes':_0x3cbfc1[_0x3aef('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3aef('0xe')](function(_0x2ff5be){logger[_0x3aef('0xf')](_0x3aef('0x19'),_0x5dfeb6);logger[_0x3aef('0x24')](_0x3aef('0x19'),_0x5dfeb6,JSON[_0x3aef('0x13')](_0x2ff5be));_0x4f66d8(_0x2ff5be);})['catch'](function(_0x54b060){logger[_0x3aef('0x14')]('GetCmHopperBlack',_0x54b060['message'],_0x5dfeb6);_0x5acad5(_0x1ea476[_0x3aef('0x14')](0x1f4,_0x54b060['message']));});});};exports[_0x3aef('0x25')]=function(_0x4db4d){var _0x57a3db=this;return new Promise(function(_0x37b805,_0x496d05){return db['CmHopperBlack']['update'](_0x4db4d[_0x3aef('0x26')],{'raw':_0x4db4d[_0x3aef('0x1c')]?_0x4db4d[_0x3aef('0x1c')][_0x3aef('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4db4d[_0x3aef('0x1c')]?_0x4db4d[_0x3aef('0x1c')][_0x3aef('0x1e')]||null:null,'attributes':_0x4db4d[_0x3aef('0x1c')]?_0x4db4d[_0x3aef('0x1c')]['attributes']||null:null,'limit':_0x4db4d[_0x3aef('0x1c')]?_0x4db4d[_0x3aef('0x1c')][_0x3aef('0x20')]||null:null})[_0x3aef('0xe')](function(_0x43c00a){logger[_0x3aef('0xf')](_0x3aef('0x25'),_0x4db4d);logger['debug'](_0x3aef('0x25'),_0x4db4d,JSON[_0x3aef('0x13')](_0x43c00a));_0x37b805(_0x43c00a);})[_0x3aef('0x18')](function(_0x1e99b){logger['error']('UpdateCmHopperBlack',_0x1e99b['message'],_0x4db4d);_0x496d05(_0x57a3db[_0x3aef('0x14')](0x1f4,_0x1e99b[_0x3aef('0x16')]));});});};exports[_0x3aef('0x27')]=function(_0x5b25d4){var _0x4e3cdc=this;return new Promise(function(_0x63a35a,_0x476d65){return db[_0x3aef('0x1a')][_0x3aef('0x28')]({'where':_0x5b25d4[_0x3aef('0x1c')]?_0x5b25d4['options'][_0x3aef('0x1e')]||null:null})[_0x3aef('0xe')](function(_0x1bf22f){logger['info'](_0x3aef('0x27'),_0x5b25d4);logger[_0x3aef('0x24')]('DestroyCmHopperBlack',_0x5b25d4,JSON[_0x3aef('0x13')](_0x1bf22f));_0x63a35a(_0x1bf22f);})['catch'](function(_0x4a8f5f){logger[_0x3aef('0x14')](_0x3aef('0x27'),_0x4a8f5f[_0x3aef('0x16')],_0x5b25d4);_0x476d65(_0x4e3cdc[_0x3aef('0x14')](0x1f4,_0x4a8f5f['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index f941301..af175a0 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 _0x781d=['isAuthenticated','index','/describe','describe','put','/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x781d,0x14a));var _0xd781=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x781d[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd781('0x2'));var router=express[_0xd781('0x3')]();var fs_extra=require(_0xd781('0x4'));var auth=require(_0xd781('0x5'));var interaction=require(_0xd781('0x6'));var config=require(_0xd781('0x7'));var controller=require(_0xd781('0x8'));router[_0xd781('0x9')]('/',auth[_0xd781('0xa')](),controller[_0xd781('0xb')]);router['get'](_0xd781('0xc'),auth[_0xd781('0xa')](),controller[_0xd781('0xd')]);router[_0xd781('0x9')]('/:id',auth[_0xd781('0xa')](),controller['show']);router[_0xd781('0xe')](_0xd781('0xf'),auth['isAuthenticated'](),controller[_0xd781('0x10')]);router[_0xd781('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd781('0x12')]);module[_0xd781('0x13')]=router; \ No newline at end of file +var _0x3d04=['show','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','describe','/:id'];(function(_0xac1d19,_0x447fa8){var _0x1133e0=function(_0x44a661){while(--_0x44a661){_0xac1d19['push'](_0xac1d19['shift']());}};_0x1133e0(++_0x447fa8);}(_0x3d04,0xbe));var _0x43d0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3d04[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var path=require(_0x43d0('0x2'));var timeout=require(_0x43d0('0x3'));var express=require(_0x43d0('0x4'));var router=express[_0x43d0('0x5')]();var fs_extra=require(_0x43d0('0x6'));var auth=require(_0x43d0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x43d0('0x8'));var controller=require(_0x43d0('0x9'));router[_0x43d0('0xa')]('/',auth[_0x43d0('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x43d0('0xc')]);router[_0x43d0('0xa')](_0x43d0('0xd'),auth[_0x43d0('0xb')](),controller[_0x43d0('0xe')]);router['put']('/:id',auth[_0x43d0('0xb')](),controller['update']);router['delete'](_0x43d0('0xd'),auth[_0x43d0('0xb')](),controller[_0x43d0('0xf')]);module[_0x43d0('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index bc988d8..36b07ed 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 _0x5c08=['diff','seconds','BOOLEAN','sequelize','exports','STRING','DATE','INTEGER','endtime'];(function(_0x4c88a7,_0x5c1843){var _0x468f0b=function(_0x168b94){while(--_0x168b94){_0x4c88a7['push'](_0x4c88a7['shift']());}};_0x468f0b(++_0x5c1843);}(_0x5c08,0x186));var _0x85c0=function(_0x5ec84c,_0xa6b2b1){_0x5ec84c=_0x5ec84c-0x0;var _0x4d86d7=_0x5c08[_0x5ec84c];return _0x4d86d7;};'use strict';var Sequelize=require(_0x85c0('0x0'));var moment=require('moment');module[_0x85c0('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x85c0('0x2')]},'scheduledat':{'type':Sequelize[_0x85c0('0x3')]},'countbusyretry':{'type':Sequelize[_0x85c0('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x85c0('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x85c0('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x85c0('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x85c0('0x2')]},'originatecalleridname':{'type':Sequelize[_0x85c0('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x85c0('0x2')]},'starttime':{'type':Sequelize[_0x85c0('0x3')]},'responsetime':{'type':Sequelize[_0x85c0('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x85c0('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x85c0('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x85c0('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x85c0('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x85c0('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x85c0('0x2')]},'campaign':{'type':Sequelize[_0x85c0('0x2')]},'campaigntype':{'type':Sequelize[_0x85c0('0x2')]},'membername':{'type':Sequelize[_0x85c0('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x85c0('0x2')]},'secondDisposition':{'type':Sequelize[_0x85c0('0x2')]},'thirdDisposition':{'type':Sequelize[_0x85c0('0x2')]},'dispositionat':{'type':Sequelize[_0x85c0('0x3')],'set':function(_0x56fdcb){var _0x7ad8c9=this['getDataValue'](_0x85c0('0x5'));if(_0x7ad8c9&&_0x56fdcb){this['setDataValue']('followuptime',moment(_0x56fdcb)[_0x85c0('0x6')](moment(_0x7ad8c9),_0x85c0('0x7')));}}},'amd':{'type':Sequelize[_0x85c0('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x85c0('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x85c0('0x3')]},'callback':{'type':Sequelize[_0x85c0('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x85c0('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x85c0('0x3')]},'deleted':{'type':Sequelize[_0x85c0('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x85c0('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x85c0('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x85c0('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x85c0('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x85c0('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb6d3=['endtime','setDataValue','diff','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE'];(function(_0x1a5780,_0xcb2409){var _0x379b2e=function(_0x2d8d77){while(--_0x2d8d77){_0x1a5780['push'](_0x1a5780['shift']());}};_0x379b2e(++_0xcb2409);}(_0xb6d3,0x16c));var _0x3b6d=function(_0x13de3c,_0x3e06df){_0x13de3c=_0x13de3c-0x0;var _0x1b43b4=_0xb6d3[_0x13de3c];return _0x1b43b4;};'use strict';var Sequelize=require(_0x3b6d('0x0'));var moment=require(_0x3b6d('0x1'));module[_0x3b6d('0x2')]={'state':{'type':Sequelize[_0x3b6d('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x3b6d('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x3b6d('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3b6d('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3b6d('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x3b6d('0x4')]},'calleridnum':{'type':Sequelize[_0x3b6d('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x3b6d('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x3b6d('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x3b6d('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3b6d('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3b6d('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3b6d('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3b6d('0x4')]},'campaign':{'type':Sequelize[_0x3b6d('0x4')]},'campaigntype':{'type':Sequelize[_0x3b6d('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x3b6d('0x4')]},'secondDisposition':{'type':Sequelize[_0x3b6d('0x4')]},'thirdDisposition':{'type':Sequelize[_0x3b6d('0x4')]},'dispositionat':{'type':Sequelize[_0x3b6d('0x5')],'set':function(_0x38af35){var _0x35bf9b=this['getDataValue'](_0x3b6d('0x6'));if(_0x35bf9b&&_0x38af35){this[_0x3b6d('0x7')]('followuptime',moment(_0x38af35)[_0x3b6d('0x8')](moment(_0x35bf9b),'seconds'));}}},'amd':{'type':Sequelize[_0x3b6d('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3b6d('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x3b6d('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x3b6d('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x3b6d('0x5')]},'callback':{'type':Sequelize[_0x3b6d('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3b6d('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x3b6d('0x5')]},'recallme':{'type':Sequelize[_0x3b6d('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x3b6d('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3b6d('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3b6d('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3b6d('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 f710d2c..07405a7 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.controller.js +++ b/server/api/cmHopperFinal/cmHopperFinal.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4888=['ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','NOW()','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','find','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','CmHopperFinal','includeAll','include','rows','catch','params','options','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','createdAt','updatedAt','select','field','ANY_VALUE(ContactId)','ContactId'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x4888,0x198));var _0x8488=function(_0x46dab8,_0x4ef8ed){_0x46dab8=_0x46dab8-0x0;var _0x3d1e3a=_0x4888[_0x46dab8];return _0x3d1e3a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8488('0x0'));var zipdir=require(_0x8488('0x1'));var jsonpatch=require(_0x8488('0x2'));var rp=require(_0x8488('0x3'));var moment=require(_0x8488('0x4'));var BPromise=require(_0x8488('0x5'));var Mustache=require(_0x8488('0x6'));var util=require('util');var path=require(_0x8488('0x7'));var sox=require(_0x8488('0x8'));var csv=require(_0x8488('0x9'));var ejs=require(_0x8488('0xa'));var fs=require('fs');var fs_extra=require(_0x8488('0xb'));var _=require(_0x8488('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8488('0x9'));var querystring=require(_0x8488('0xd'));var Papa=require('papaparse');var Redis=require(_0x8488('0xe'));var authService=require(_0x8488('0xf'));var qs=require(_0x8488('0x10'));var as=require(_0x8488('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8488('0x12'))(_0x8488('0x13'));var utils=require(_0x8488('0x14'));var config=require(_0x8488('0x15'));var licenseUtil=require(_0x8488('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14462e,_0x3d1f7a){_0x3d1f7a=_0x3d1f7a||0xcc;return function(_0x58f83d){if(_0x58f83d){return _0x14462e['sendStatus'](_0x3d1f7a);}return _0x14462e[_0x8488('0x17')](_0x3d1f7a)['end']();};}function respondWithResult(_0x214083,_0x4e94fc){_0x4e94fc=_0x4e94fc||0xc8;return function(_0x5161a3){if(_0x5161a3){return _0x214083[_0x8488('0x17')](_0x4e94fc)[_0x8488('0x18')](_0x5161a3);}};}function respondWithFilteredResult(_0x5700b,_0x2bcb7c){return function(_0x3b3cfa){if(_0x3b3cfa){var _0x8d3b3d=typeof _0x2bcb7c[_0x8488('0x19')]==='undefined'&&typeof _0x2bcb7c[_0x8488('0x1a')]===_0x8488('0x1b');var _0x3edfe4=_0x3b3cfa[_0x8488('0x1c')];var _0x60ae2f=_0x8d3b3d?0x0:_0x2bcb7c[_0x8488('0x19')];var _0x1aedb1=_0x8d3b3d?_0x3b3cfa[_0x8488('0x1c')]:_0x2bcb7c[_0x8488('0x19')]+_0x2bcb7c[_0x8488('0x1a')];var _0x10bfd6;if(_0x1aedb1>=_0x3edfe4){_0x1aedb1=_0x3edfe4;_0x10bfd6=0xc8;}else{_0x10bfd6=0xce;}_0x5700b[_0x8488('0x17')](_0x10bfd6);return _0x5700b[_0x8488('0x1d')]('Content-Range',_0x60ae2f+'-'+_0x1aedb1+'/'+_0x3edfe4)['json'](_0x3b3cfa);}return null;};}function patchUpdates(_0x340d6b){return function(_0x12d40f){try{jsonpatch[_0x8488('0x1e')](_0x12d40f,_0x340d6b,!![]);}catch(_0x3c9fc2){return BPromise[_0x8488('0x1f')](_0x3c9fc2);}return _0x12d40f[_0x8488('0x20')]();};}function saveUpdates(_0x43b672,_0x3c078c){return function(_0x39dd43){if(_0x39dd43){return _0x39dd43['update'](_0x43b672)[_0x8488('0x21')](function(_0x4e07e1){return _0x4e07e1;});}return null;};}function removeEntity(_0x140b0b,_0x1361a6){return function(_0x290b33){if(_0x290b33){return _0x290b33['destroy']()['then'](function(){_0x140b0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x472624,_0x51fe30){return function(_0x58057a){if(!_0x58057a){_0x472624[_0x8488('0x22')](0x194);}return _0x58057a;};}function handleError(_0x2f350a,_0x2b3c97){_0x2b3c97=_0x2b3c97||0x1f4;return function(_0x6ebee0){logger[_0x8488('0x23')](_0x6ebee0['stack']);if(_0x6ebee0[_0x8488('0x24')]){delete _0x6ebee0[_0x8488('0x24')];}_0x2f350a[_0x8488('0x17')](_0x2b3c97)[_0x8488('0x25')](_0x6ebee0);};}exports[_0x8488('0x26')]=function(_0x27f5cf,_0x2c15ff){var _0x296b6c={},_0x368f9c={},_0x1d9317={'count':0x0,'rows':[]};var _0x888b24=_['map'](db['CmHopperFinal']['rawAttributes'],function(_0x292fe8){return{'name':_0x292fe8[_0x8488('0x27')],'type':_0x292fe8[_0x8488('0x28')][_0x8488('0x29')]};});_0x368f9c[_0x8488('0x2a')]=_[_0x8488('0x2b')](_0x888b24,'name');_0x368f9c[_0x8488('0x2c')]=_[_0x8488('0x2d')](_0x27f5cf[_0x8488('0x2c')]);_0x368f9c[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x368f9c['model'],_0x368f9c[_0x8488('0x2c')]);_0x296b6c[_0x8488('0x30')]=_['intersection'](_0x368f9c[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x31')]));_0x296b6c[_0x8488('0x30')]=_0x296b6c['attributes'][_0x8488('0x32')]?_0x296b6c[_0x8488('0x30')]:_0x368f9c[_0x8488('0x2a')];if(!_0x27f5cf['query'][_0x8488('0x33')]('nolimit')){_0x296b6c[_0x8488('0x1a')]=qs[_0x8488('0x1a')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x1a')]);_0x296b6c['offset']=qs[_0x8488('0x19')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x19')]);}_0x296b6c['order']=qs[_0x8488('0x34')](_0x27f5cf[_0x8488('0x2c')][_0x8488('0x34')]);_0x296b6c[_0x8488('0x35')]=qs[_0x8488('0x2e')](_[_0x8488('0x36')](_0x27f5cf[_0x8488('0x2c')],_0x368f9c[_0x8488('0x2e')]),_0x888b24);if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]){_0x296b6c[_0x8488('0x35')]=_['merge'](_0x296b6c['where'],{'$or':_[_0x8488('0x2b')](_0x888b24,function(_0x36c17a){if(_0x36c17a[_0x8488('0x28')]!==_0x8488('0x38')){var _0x2d9fa1={};_0x2d9fa1[_0x36c17a[_0x8488('0x24')]]={'$like':'%'+_0x27f5cf[_0x8488('0x2c')][_0x8488('0x37')]+'%'};return _0x2d9fa1;}})});}_0x296b6c=_[_0x8488('0x39')]({},_0x296b6c,_0x27f5cf['options']);var _0xf5a0a0={'where':_0x296b6c[_0x8488('0x35')]};return db[_0x8488('0x3a')]['count'](_0xf5a0a0)[_0x8488('0x21')](function(_0xa50c4b){_0x1d9317[_0x8488('0x1c')]=_0xa50c4b;if(_0x27f5cf[_0x8488('0x2c')][_0x8488('0x3b')]){_0x296b6c[_0x8488('0x3c')]=[{'all':!![]}];}return db[_0x8488('0x3a')]['findAll'](_0x296b6c);})[_0x8488('0x21')](function(_0x1c33a1){_0x1d9317[_0x8488('0x3d')]=_0x1c33a1;return _0x1d9317;})['then'](respondWithFilteredResult(_0x2c15ff,_0x296b6c))[_0x8488('0x3e')](handleError(_0x2c15ff,null));};exports['show']=function(_0x40ee7e,_0x34b11b){var _0x5cbd11={'raw':!![],'where':{'id':_0x40ee7e[_0x8488('0x3f')]['id']}},_0x22a3f3={};_0x22a3f3[_0x8488('0x2a')]=_[_0x8488('0x2d')](db[_0x8488('0x3a')]['rawAttributes']);_0x22a3f3[_0x8488('0x2c')]=_['keys'](_0x40ee7e[_0x8488('0x2c')]);_0x22a3f3[_0x8488('0x2e')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],_0x22a3f3[_0x8488('0x2c')]);_0x5cbd11[_0x8488('0x30')]=_[_0x8488('0x2f')](_0x22a3f3[_0x8488('0x2a')],qs[_0x8488('0x31')](_0x40ee7e[_0x8488('0x2c')][_0x8488('0x31')]));_0x5cbd11[_0x8488('0x30')]=_0x5cbd11[_0x8488('0x30')][_0x8488('0x32')]?_0x5cbd11[_0x8488('0x30')]:_0x22a3f3[_0x8488('0x2a')];if(_0x40ee7e[_0x8488('0x2c')]['includeAll']){_0x5cbd11[_0x8488('0x3c')]=[{'all':!![]}];}_0x5cbd11=_[_0x8488('0x39')]({},_0x5cbd11,_0x40ee7e[_0x8488('0x40')]);return db[_0x8488('0x3a')]['find'](_0x5cbd11)[_0x8488('0x21')](handleEntityNotFound(_0x34b11b,null))[_0x8488('0x21')](respondWithResult(_0x34b11b,null))[_0x8488('0x3e')](handleError(_0x34b11b,null));};exports[_0x8488('0x41')]=function(_0x52042c,_0x1f0516){return db[_0x8488('0x3a')][_0x8488('0x41')]()[_0x8488('0x21')](respondWithResult(_0x1f0516,null))[_0x8488('0x3e')](handleError(_0x1f0516,null));};exports[_0x8488('0x42')]=function(_0x886a9e,_0x299d8e){if(_0x886a9e[_0x8488('0x43')][_0x8488('0x44')]){delete _0x886a9e[_0x8488('0x43')][_0x8488('0x44')];}return db[_0x8488('0x3a')]['find']({'where':{'uniqueid':_0x886a9e['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x299d8e,null))[_0x8488('0x21')](saveUpdates(_0x886a9e[_0x8488('0x43')],null))[_0x8488('0x21')](respondWithResult(_0x299d8e,null))[_0x8488('0x3e')](handleError(_0x299d8e,null));};exports[_0x8488('0x45')]=function(_0x25f2dc,_0x27dfd2,_0x24fa20){return db['CmHopperFinal'][_0x8488('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x25f2dc[_0x8488('0x3f')]['id']},'attributes':[[db['sequelize']['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x8488('0x4a')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x4b')))),_0x8488('0x4c')],[db['sequelize']['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db['sequelize'][_0x8488('0x49')]('`state`\x20=\x205,\x201,\x20null'))),_0x8488('0x4d')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x208,\x201,\x20null'))),_0x8488('0x4e')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x4f')))),'dropContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x50')))),_0x8488('0x51')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x52')))),_0x8488('0x53')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')]['literal'](_0x8488('0x54')))),'answeringMachine']]})[_0x8488('0x21')](handleEntityNotFound(_0x27dfd2,null))[_0x8488('0x21')](respondWithResult(_0x27dfd2,null))[_0x8488('0x3e')](handleError(_0x27dfd2,null));};exports[_0x8488('0x55')]=function(_0x1971f3,_0x24ba2d,_0x4facfb){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x1971f3[_0x8488('0x3f')]['id']},'attributes':[[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x56')))),_0x8488('0x4a')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x4b')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db['sequelize'][_0x8488('0x49')](_0x8488('0x57')))),_0x8488('0x4e')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x8488('0x58')],[db[_0x8488('0x48')]['fn']('COUNT',db[_0x8488('0x48')]['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')](_0x8488('0x50')))),_0x8488('0x51')],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db['sequelize']['fn']('IF',db[_0x8488('0x48')][_0x8488('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0x8488('0x48')]['fn'](_0x8488('0x47'),db[_0x8488('0x48')]['fn']('IF',db['sequelize'][_0x8488('0x49')](_0x8488('0x54')))),'answeringMachine']]})[_0x8488('0x21')](handleEntityNotFound(_0x24ba2d,null))['then'](respondWithResult(_0x24ba2d,null))[_0x8488('0x3e')](handleError(_0x24ba2d,null));};exports[_0x8488('0x59')]=function(_0x44a50b,_0x5815cb,_0xbee86e){return db[_0x8488('0x5a')]['find']({'where':{'id':_0x44a50b['params']['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x5815cb,null))[_0x8488('0x21')](function(_0xfedfd2){var _0x3ab1b6;if(_0xfedfd2){_0x3ab1b6=squel[_0x8488('0x5b')]()[_0x8488('0x5c')](_0x8488('0x5d'))[_0x8488('0x5e')]([_0x8488('0x5f'),_0x8488('0x60'),'ContactId',_0x8488('0x61'),'VoiceQueueId',_0x8488('0x62'),_0x8488('0x63')],squel[_0x8488('0x64')]()[_0x8488('0x65')]('ANY_VALUE(calleridnum)',_0x8488('0x5f'))[_0x8488('0x65')]('NOW()',_0x8488('0x60'))['field'](_0x8488('0x66'),_0x8488('0x67'))[_0x8488('0x65')](_0x8488('0x68'),_0x8488('0x61'))[_0x8488('0x65')](_0x8488('0x69'),_0x8488('0x6a'))['field'](_0x8488('0x6b'),'createdAt')['field'](_0x8488('0x6b'),_0x8488('0x63'))[_0x8488('0x6c')]('cm_hopper_final')['where'](_0x8488('0x6d'),_0x44a50b[_0x8488('0x3f')]['id']['toString']())[_0x8488('0x35')](_0x8488('0x6e'),_0x44a50b[_0x8488('0x43')][_0x8488('0x6f')][_0x8488('0x70')]())[_0x8488('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x8488('0x35')](_0x8488('0x71'),squel[_0x8488('0x64')]()['field'](_0x8488('0x5f'))[_0x8488('0x6c')](_0x8488('0x5d'))['where'](_0x8488('0x6d'),_0x44a50b[_0x8488('0x3f')]['id']['toString']()))['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()['field'](_0x8488('0x72'))[_0x8488('0x6c')]('cm_hopper_final')['where'](_0x8488('0x6d'),_0x44a50b['params']['id'][_0x8488('0x70')]())[_0x8488('0x35')](_0x8488('0x73')))[_0x8488('0x74')]('ContactId'))[_0x8488('0x70')]();return db['sequelize'][_0x8488('0x2c')](_0x3ab1b6);}return[];})['then'](respondWithResult(_0x5815cb,null))[_0x8488('0x3e')](handleError(_0x5815cb,null));};exports[_0x8488('0x75')]=function(_0x267401,_0x1e635a,_0x31ab35){return db[_0x8488('0x76')][_0x8488('0x77')]({'where':{'id':_0x267401[_0x8488('0x3f')]['id']}})[_0x8488('0x21')](handleEntityNotFound(_0x1e635a,null))[_0x8488('0x21')](function(_0xce1d1a){var _0xc9c221;if(_0xce1d1a){_0xc9c221=squel[_0x8488('0x5b')]()[_0x8488('0x5c')]('cm_hopper')[_0x8488('0x5e')]([_0x8488('0x5f'),'scheduledAt',_0x8488('0x67'),_0x8488('0x61'),_0x8488('0x78'),_0x8488('0x62'),_0x8488('0x63')],squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x79'),_0x8488('0x5f'))[_0x8488('0x65')](_0x8488('0x6b'),'scheduledAt')[_0x8488('0x65')](_0x8488('0x66'),'ContactId')[_0x8488('0x65')](_0x8488('0x68'),_0x8488('0x61'))[_0x8488('0x65')](_0x8488('0x7a'),'CampaignId')['field'](_0x8488('0x6b'),_0x8488('0x62'))[_0x8488('0x65')](_0x8488('0x6b'),_0x8488('0x63'))[_0x8488('0x6c')](_0x8488('0x7b'))[_0x8488('0x35')](_0x8488('0x7c'),_0x267401[_0x8488('0x3f')]['id'][_0x8488('0x70')]())[_0x8488('0x35')](_0x8488('0x6e'),_0x267401[_0x8488('0x43')][_0x8488('0x6f')]['toString']())[_0x8488('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x5f'))[_0x8488('0x6c')](_0x8488('0x5d'))[_0x8488('0x35')](_0x8488('0x7c'),_0x267401[_0x8488('0x3f')]['id'][_0x8488('0x70')]()))['where'](_0x8488('0x71'),squel[_0x8488('0x64')]()[_0x8488('0x65')](_0x8488('0x72'))[_0x8488('0x6c')](_0x8488('0x7b'))['where'](_0x8488('0x7c'),_0x267401['params']['id'][_0x8488('0x70')]())[_0x8488('0x35')]('state\x20=\x204'))['group'](_0x8488('0x67')))[_0x8488('0x70')]();return db[_0x8488('0x48')][_0x8488('0x2c')](_0xc9c221);}return[];})[_0x8488('0x21')](respondWithResult(_0x1e635a,null))['catch'](handleError(_0x1e635a,null));};exports[_0x8488('0x7d')]=function(_0x19c5c6,_0x50f773,_0x52c750){return db[_0x8488('0x7e')][_0x8488('0x7f')]({'where':{'VoiceQueueId':_0x19c5c6[_0x8488('0x43')]['VoiceQueueId'],'CampaignId':_0x19c5c6['body'][_0x8488('0x78')],'ContactId':_0x19c5c6[_0x8488('0x43')][_0x8488('0x67')]}})['then'](handleEntityNotFound(_0x50f773,null))[_0x8488('0x21')](function(_0x1e4e51){if(_0x1e4e51){return _0x1e4e51;}return null;})[_0x8488('0x21')](respondWithResult(_0x50f773,null))[_0x8488('0x3e')](handleError(_0x50f773,null));}; \ No newline at end of file +var _0x814b=['into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','Campaign','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','CmHopperFinal','includeAll','include','findAll','catch','params','find','describe','body','uniqueid','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','COUNT','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x814b,0x1a2));var _0xb814=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x814b[_0x489b87];return _0x1823b6;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}exports[_0xb814('0x2e')]=function(_0x52ed64,_0x9008b2){var _0x37d24d={},_0x530744={},_0x499f22={'count':0x0,'rows':[]};var _0x20577b=_[_0xb814('0x2f')](db['CmHopperFinal'][_0xb814('0x30')],function(_0x526610){return{'name':_0x526610[_0xb814('0x31')],'type':_0x526610['type']['key']};});_0x530744[_0xb814('0x32')]=_['map'](_0x20577b,_0xb814('0x2c'));_0x530744[_0xb814('0x33')]=_[_0xb814('0x34')](_0x52ed64['query']);_0x530744['filters']=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],_0x530744['query']);_0x37d24d[_0xb814('0x36')]=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],qs[_0xb814('0x37')](_0x52ed64[_0xb814('0x33')][_0xb814('0x37')]));_0x37d24d[_0xb814('0x36')]=_0x37d24d['attributes'][_0xb814('0x38')]?_0x37d24d[_0xb814('0x36')]:_0x530744[_0xb814('0x32')];if(!_0x52ed64[_0xb814('0x33')][_0xb814('0x39')]('nolimit')){_0x37d24d[_0xb814('0x21')]=qs['limit'](_0x52ed64[_0xb814('0x33')][_0xb814('0x21')]);_0x37d24d[_0xb814('0x1f')]=qs['offset'](_0x52ed64[_0xb814('0x33')][_0xb814('0x1f')]);}_0x37d24d['order']=qs[_0xb814('0x3a')](_0x52ed64[_0xb814('0x33')][_0xb814('0x3a')]);_0x37d24d[_0xb814('0x3b')]=qs[_0xb814('0x3c')](_[_0xb814('0x3d')](_0x52ed64['query'],_0x530744[_0xb814('0x3c')]),_0x20577b);if(_0x52ed64['query'][_0xb814('0x3e')]){_0x37d24d['where']=_[_0xb814('0x3f')](_0x37d24d['where'],{'$or':_[_0xb814('0x2f')](_0x20577b,function(_0x26675a){if(_0x26675a['type']!=='VIRTUAL'){var _0x5dd6bc={};_0x5dd6bc[_0x26675a['name']]={'$like':'%'+_0x52ed64[_0xb814('0x33')][_0xb814('0x3e')]+'%'};return _0x5dd6bc;}})});}_0x37d24d=_[_0xb814('0x3f')]({},_0x37d24d,_0x52ed64[_0xb814('0x40')]);var _0x51cdba={'where':_0x37d24d['where']};return db[_0xb814('0x41')]['count'](_0x51cdba)[_0xb814('0x28')](function(_0x1098eb){_0x499f22[_0xb814('0x22')]=_0x1098eb;if(_0x52ed64[_0xb814('0x33')][_0xb814('0x42')]){_0x37d24d[_0xb814('0x43')]=[{'all':!![]}];}return db[_0xb814('0x41')][_0xb814('0x44')](_0x37d24d);})[_0xb814('0x28')](function(_0x4b6ff8){_0x499f22['rows']=_0x4b6ff8;return _0x499f22;})['then'](respondWithFilteredResult(_0x9008b2,_0x37d24d))[_0xb814('0x45')](handleError(_0x9008b2,null));};exports['show']=function(_0x29416a,_0x580171){var _0x411723={'raw':!![],'where':{'id':_0x29416a[_0xb814('0x46')]['id']}},_0x44ff56={};_0x44ff56[_0xb814('0x32')]=_['keys'](db[_0xb814('0x41')][_0xb814('0x30')]);_0x44ff56[_0xb814('0x33')]=_[_0xb814('0x34')](_0x29416a[_0xb814('0x33')]);_0x44ff56[_0xb814('0x3c')]=_['intersection'](_0x44ff56[_0xb814('0x32')],_0x44ff56[_0xb814('0x33')]);_0x411723[_0xb814('0x36')]=_[_0xb814('0x35')](_0x44ff56[_0xb814('0x32')],qs[_0xb814('0x37')](_0x29416a[_0xb814('0x33')]['fields']));_0x411723['attributes']=_0x411723[_0xb814('0x36')][_0xb814('0x38')]?_0x411723[_0xb814('0x36')]:_0x44ff56[_0xb814('0x32')];if(_0x29416a[_0xb814('0x33')][_0xb814('0x42')]){_0x411723[_0xb814('0x43')]=[{'all':!![]}];}_0x411723=_[_0xb814('0x3f')]({},_0x411723,_0x29416a[_0xb814('0x40')]);return db[_0xb814('0x41')][_0xb814('0x47')](_0x411723)['then'](handleEntityNotFound(_0x580171,null))[_0xb814('0x28')](respondWithResult(_0x580171,null))[_0xb814('0x45')](handleError(_0x580171,null));};exports['describe']=function(_0x338e80,_0x55234d){return db[_0xb814('0x41')][_0xb814('0x48')]()[_0xb814('0x28')](respondWithResult(_0x55234d,null))[_0xb814('0x45')](handleError(_0x55234d,null));};exports[_0xb814('0x27')]=function(_0x4096d4,_0x2cc806){if(_0x4096d4[_0xb814('0x49')][_0xb814('0x4a')]){delete _0x4096d4[_0xb814('0x49')]['uniqueid'];}return db['CmHopperFinal'][_0xb814('0x47')]({'where':{'uniqueid':_0x4096d4[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x2cc806,null))[_0xb814('0x28')](saveUpdates(_0x4096d4[_0xb814('0x49')],null))[_0xb814('0x28')](respondWithResult(_0x2cc806,null))[_0xb814('0x45')](handleError(_0x2cc806,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x26fd0b,_0x388324,_0xf27a6e){return db['CmHopperFinal'][_0xb814('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x26fd0b['params']['id']},'attributes':[[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x4c')))),_0xb814('0x4d')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x4f')))),'noAnswerContacts'],[db[_0xb814('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x50')))),'busyContacts'],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x51')))),'congestionContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x53')))),_0xb814('0x54')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x55')))),_0xb814('0x56')],[db['sequelize']['fn'](_0xb814('0x52'),db['sequelize']['fn']('IF',db['sequelize'][_0xb814('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb814('0x57')],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db['sequelize']['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x58')))),_0xb814('0x59')]]})[_0xb814('0x28')](handleEntityNotFound(_0x388324,null))[_0xb814('0x28')](respondWithResult(_0x388324,null))[_0xb814('0x45')](handleError(_0x388324,null));};exports[_0xb814('0x5a')]=function(_0x2e5f99,_0x113350,_0x46014f){return db['CmHopperFinal'][_0xb814('0x44')]({'raw':![],'where':{'CampaignId':_0x2e5f99[_0xb814('0x46')]['id']},'attributes':[[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x4c')))),'noSuchContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0xb814('0x5b')],[db['sequelize']['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x50')))),_0xb814('0x5c')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x51')))),_0xb814('0x5d')],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x53')))),'dropContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xb814('0x56')],[db['sequelize']['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x5e')))),_0xb814('0x57')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x58')))),_0xb814('0x59')]]})[_0xb814('0x28')](handleEntityNotFound(_0x113350,null))['then'](respondWithResult(_0x113350,null))[_0xb814('0x45')](handleError(_0x113350,null));};exports[_0xb814('0x5f')]=function(_0xee204,_0x5aabbe,_0x30f717){return db[_0xb814('0x60')][_0xb814('0x47')]({'where':{'id':_0xee204[_0xb814('0x46')]['id']}})['then'](handleEntityNotFound(_0x5aabbe,null))['then'](function(_0x28eaf8){var _0x295488;if(_0x28eaf8){_0x295488=squel[_0xb814('0x61')]()[_0xb814('0x62')](_0xb814('0x63'))[_0xb814('0x64')]([_0xb814('0x65'),_0xb814('0x66'),_0xb814('0x67'),_0xb814('0x68'),_0xb814('0x69'),_0xb814('0x6a'),_0xb814('0x6b')],squel[_0xb814('0x6c')]()[_0xb814('0x6d')]('ANY_VALUE(calleridnum)',_0xb814('0x65'))[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x66'))[_0xb814('0x6d')](_0xb814('0x6f'),'ContactId')[_0xb814('0x6d')]('ANY_VALUE(ListId)',_0xb814('0x68'))[_0xb814('0x6d')](_0xb814('0x70'),_0xb814('0x69'))[_0xb814('0x6d')]('NOW()','createdAt')[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x6b'))[_0xb814('0x71')]('cm_hopper_final')[_0xb814('0x3b')]('VoiceQueueId\x20=\x20?',_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]())['where']('state\x20=\x20?',_0xee204[_0xb814('0x49')]['state'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x73'))[_0xb814('0x3b')](_0xb814('0x74'),squel[_0xb814('0x6c')]()[_0xb814('0x6d')]('phone')[_0xb814('0x71')]('cm_hopper')[_0xb814('0x3b')]('VoiceQueueId\x20=\x20?',_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]()))['where'](_0xb814('0x74'),squel['select']()[_0xb814('0x6d')](_0xb814('0x75'))['from']('cm_hopper_final')[_0xb814('0x3b')](_0xb814('0x76'),_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x77')))[_0xb814('0x78')](_0xb814('0x67')))[_0xb814('0x72')]();return db[_0xb814('0x4b')]['query'](_0x295488);}return[];})['then'](respondWithResult(_0x5aabbe,null))['catch'](handleError(_0x5aabbe,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x52b6da,_0x45a202,_0x75a33){return db[_0xb814('0x79')]['find']({'where':{'id':_0x52b6da[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x45a202,null))[_0xb814('0x28')](function(_0x26ce5b){var _0x161658;if(_0x26ce5b){_0x161658=squel[_0xb814('0x61')]()[_0xb814('0x62')](_0xb814('0x63'))['fromQuery']([_0xb814('0x65'),_0xb814('0x66'),_0xb814('0x67'),_0xb814('0x68'),'CampaignId',_0xb814('0x6a'),_0xb814('0x6b')],squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x7a'),'phone')['field'](_0xb814('0x6e'),'scheduledAt')[_0xb814('0x6d')](_0xb814('0x6f'),'ContactId')[_0xb814('0x6d')]('ANY_VALUE(ListId)',_0xb814('0x68'))['field'](_0xb814('0x7b'),_0xb814('0x7c'))[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x6a'))[_0xb814('0x6d')](_0xb814('0x6e'),'updatedAt')['from'](_0xb814('0x7d'))['where']('CampaignId\x20=\x20?',_0x52b6da[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')]('state\x20=\x20?',_0x52b6da[_0xb814('0x49')]['state'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x73'))[_0xb814('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x65'))['from'](_0xb814('0x63'))[_0xb814('0x3b')](_0xb814('0x7e'),_0x52b6da['params']['id'][_0xb814('0x72')]()))[_0xb814('0x3b')](_0xb814('0x74'),squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x75'))[_0xb814('0x71')](_0xb814('0x7d'))[_0xb814('0x3b')](_0xb814('0x7e'),_0x52b6da[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')]('state\x20=\x204'))['group'](_0xb814('0x67')))['toString']();return db[_0xb814('0x4b')][_0xb814('0x33')](_0x161658);}return[];})[_0xb814('0x28')](respondWithResult(_0x45a202,null))[_0xb814('0x45')](handleError(_0x45a202,null));};exports[_0xb814('0x7f')]=function(_0x2f1674,_0xf0610f,_0x5db5d0){return db['CmHopper'][_0xb814('0x80')]({'where':{'VoiceQueueId':_0x2f1674['body'][_0xb814('0x69')],'CampaignId':_0x2f1674[_0xb814('0x49')][_0xb814('0x7c')],'ContactId':_0x2f1674['body'][_0xb814('0x67')]}})[_0xb814('0x28')](handleEntityNotFound(_0xf0610f,null))[_0xb814('0x28')](function(_0x38c6da){if(_0x38c6da){return _0x38c6da;}return null;})[_0xb814('0x28')](respondWithResult(_0xf0610f,null))['catch'](handleError(_0xf0610f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 3656808..c22555f 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 _0x250f=['uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','cm_hopper_final','calleridnum'];(function(_0x527786,_0x54c406){var _0x4b406b=function(_0x2a96b2){while(--_0x2a96b2){_0x527786['push'](_0x527786['shift']());}};_0x4b406b(++_0x54c406);}(_0x250f,0x187));var _0xf250=function(_0x514c17,_0x5d6489){_0x514c17=_0x514c17-0x0;var _0x130bbe=_0x250f[_0x514c17];return _0x130bbe;};'use strict';var _=require(_0xf250('0x0'));var util=require(_0xf250('0x1'));var logger=require('../../config/logger')(_0xf250('0x2'));var moment=require(_0xf250('0x3'));var BPromise=require(_0xf250('0x4'));var rp=require(_0xf250('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf250('0x6'));var config=require(_0xf250('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0xf250('0x8')]=function(_0x486aae,_0x10ed42){return _0x486aae[_0xf250('0x9')]('CmHopperFinal',attributes,{'tableName':_0xf250('0xa'),'paranoid':![],'indexes':[{'name':_0xf250('0xb'),'fields':[_0xf250('0xb')]},{'name':_0xf250('0xc'),'fields':[_0xf250('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x82d3=['rimraf','../../config/environment','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment','request-promise','path'];(function(_0x13d7d8,_0x47db44){var _0x23e72d=function(_0x53735a){while(--_0x53735a){_0x13d7d8['push'](_0x13d7d8['shift']());}};_0x23e72d(++_0x47db44);}(_0x82d3,0x180));var _0x382d=function(_0x5441e0,_0x40cd95){_0x5441e0=_0x5441e0-0x0;var _0x23d4bf=_0x82d3[_0x5441e0];return _0x23d4bf;};'use strict';var _=require('lodash');var util=require(_0x382d('0x0'));var logger=require(_0x382d('0x1'))(_0x382d('0x2'));var moment=require(_0x382d('0x3'));var BPromise=require('bluebird');var rp=require(_0x382d('0x4'));var fs=require('fs');var path=require(_0x382d('0x5'));var rimraf=require(_0x382d('0x6'));var config=require(_0x382d('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0x382d('0x8')]=function(_0xd51822,_0x511658){return _0xd51822['define'](_0x382d('0x9'),attributes,{'tableName':_0x382d('0xa'),'paranoid':![],'indexes':[{'name':_0x382d('0xb'),'fields':[_0x382d('0xb')]},{'name':'uniqueid','fields':[_0x382d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 1eea185..3df22f2 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x242c05,_0x87b7d3){var _0x1b2b5c=function(_0x160d4d){while(--_0x160d4d){_0x242c05['push'](_0x242c05['shift']());}};_0x1b2b5c(++_0x87b7d3);}(_0x7a54,0x106));var _0x47a5=function(_0x1d3841,_0x3160ba){_0x1d3841=_0x1d3841-0x0;var _0x2188c4=_0x7a54[_0x1d3841];return _0x2188c4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x57ae26,_0x28be51){var _0x2f6d54=function(_0x2e59ce){while(--_0x2e59ce){_0x57ae26['push'](_0x57ae26['shift']());}};_0x2f6d54(++_0x28be51);}(_0x7a54,0x106));var _0x47a5=function(_0x1b7ae1,_0x22485a){_0x1b7ae1=_0x1b7ae1-0x0;var _0x3ebe6d=_0x7a54[_0x1b7ae1];return _0x3ebe6d;};'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 e2744ba..9e43d0c 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 _0x782b=['get','isAuthenticated','index','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller'];(function(_0x40af45,_0xc068d9){var _0xc46faa=function(_0x38f784){while(--_0x38f784){_0x40af45['push'](_0x40af45['shift']());}};_0xc46faa(++_0xc068d9);}(_0x782b,0x89));var _0xb782=function(_0x1d98c4,_0xa18ecd){_0x1d98c4=_0x1d98c4-0x0;var _0x450ca6=_0x782b[_0x1d98c4];return _0x450ca6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb782('0x0'));var timeout=require('connect-timeout');var express=require(_0xb782('0x1'));var router=express[_0xb782('0x2')]();var fs_extra=require(_0xb782('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb782('0x4'));var config=require(_0xb782('0x5'));var controller=require(_0xb782('0x6'));router[_0xb782('0x7')]('/',auth[_0xb782('0x8')](),controller[_0xb782('0x9')]);router[_0xb782('0x7')]('/describe',auth[_0xb782('0x8')](),controller[_0xb782('0xa')]);router[_0xb782('0x7')](_0xb782('0xb'),auth['isAuthenticated'](),controller[_0xb782('0xc')]);router[_0xb782('0x7')](_0xb782('0xd'),auth[_0xb782('0x8')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xb782('0x7')](_0xb782('0xe'),auth[_0xb782('0x8')](),controller[_0xb782('0xf')]);router[_0xb782('0x10')](_0xb782('0x11'),auth[_0xb782('0x8')](),controller[_0xb782('0x12')]);router['post']('/voice/campaign/moveContacts/:id',auth[_0xb782('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0xb782('0x13'),auth[_0xb782('0x8')](),controller[_0xb782('0x14')]);router[_0xb782('0x15')](_0xb782('0xb'),auth['isAuthenticated'](),controller[_0xb782('0x16')]);module[_0xb782('0x17')]=router; \ No newline at end of file +var _0xdeb3=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','get','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/checkContactHopper','put','update','exports','util'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xdeb3,0xb7));var _0x3deb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xdeb3[_0x19950b];return _0x3c6b41;};'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['countContactsQueueCampaignHopperFinal']);router['get'](_0x3deb('0xe'),auth[_0x3deb('0x8')](),controller[_0x3deb('0xf')]);router['post'](_0x3deb('0x10'),auth[_0x3deb('0x8')](),controller[_0x3deb('0x11')]);router[_0x3deb('0x12')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x3deb('0x12')](_0x3deb('0x13'),auth[_0x3deb('0x8')](),controller['checkContactHopper']);router[_0x3deb('0x14')](_0x3deb('0xb'),auth['isAuthenticated'](),controller[_0x3deb('0x15')]);module[_0x3deb('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index ae20bab..d851056 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 _0x007d=['exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x2a972c,_0x2f8026){var _0xc3c903=function(_0x2b66e6){while(--_0x2b66e6){_0x2a972c['push'](_0x2a972c['shift']());}};_0xc3c903(++_0x2f8026);}(_0x007d,0xff));var _0xd007=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x007d[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0xd007('0x0')]={'state':{'type':Sequelize[_0xd007('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xd007('0x2')]},'scheduledat':{'type':Sequelize[_0xd007('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd007('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd007('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd007('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd007('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xd007('0x2')]},'originatecalleridname':{'type':Sequelize[_0xd007('0x2')]},'calleridnum':{'type':Sequelize[_0xd007('0x2')]},'calleridname':{'type':Sequelize[_0xd007('0x2')]},'starttime':{'type':Sequelize[_0xd007('0x3')]},'responsetime':{'type':Sequelize[_0xd007('0x3')]},'answertime':{'type':Sequelize[_0xd007('0x3')]},'droptime':{'type':Sequelize[_0xd007('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xd007('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd007('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd007('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd007('0x2')]},'campaign':{'type':Sequelize[_0xd007('0x2')]},'campaigntype':{'type':Sequelize[_0xd007('0x2')]},'membername':{'type':Sequelize[_0xd007('0x2')]},'reason':{'type':Sequelize[_0xd007('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xd007('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd007('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd007('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xd007('0x3')]},'edited':{'type':Sequelize[_0xd007('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd007('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd007('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xd007('0x2')]}}; \ No newline at end of file +var _0x0bb0=['BOOLEAN','sequelize','INTEGER','STRING','DATE'];(function(_0x82140,_0x3a9d87){var _0x2b15a6=function(_0x2b565e){while(--_0x2b565e){_0x82140['push'](_0x82140['shift']());}};_0x2b15a6(++_0x3a9d87);}(_0x0bb0,0x11e));var _0x00bb=function(_0x1449ab,_0x5ad863){_0x1449ab=_0x1449ab-0x0;var _0x441f66=_0x0bb0[_0x1449ab];return _0x441f66;};'use strict';var Sequelize=require(_0x00bb('0x0'));module['exports']={'state':{'type':Sequelize[_0x00bb('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x00bb('0x2')]},'scheduledat':{'type':Sequelize[_0x00bb('0x3')]},'countbusyretry':{'type':Sequelize[_0x00bb('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x00bb('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x00bb('0x2')]},'calleridnum':{'type':Sequelize[_0x00bb('0x2')]},'calleridname':{'type':Sequelize[_0x00bb('0x2')]},'starttime':{'type':Sequelize[_0x00bb('0x3')]},'responsetime':{'type':Sequelize[_0x00bb('0x3')]},'answertime':{'type':Sequelize[_0x00bb('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x00bb('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x00bb('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x00bb('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x00bb('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x00bb('0x2')]},'campaign':{'type':Sequelize[_0x00bb('0x2')]},'campaigntype':{'type':Sequelize[_0x00bb('0x2')]},'membername':{'type':Sequelize[_0x00bb('0x2')]},'reason':{'type':Sequelize[_0x00bb('0x2')]},'amd':{'type':Sequelize[_0x00bb('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x00bb('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x00bb('0x3')]},'recallme':{'type':Sequelize[_0x00bb('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x00bb('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x00bb('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x00bb('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x00bb('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x00bb('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x00bb('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x00bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 05001cb..1a48dff 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 _0xf388=['json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','params','find','create','body','describe','uniqueid','eml-format','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x1d2601,_0x1cc9e4){var _0x34ea1b=function(_0x34d234){while(--_0x34d234){_0x1d2601['push'](_0x1d2601['shift']());}};_0x34ea1b(++_0x1cc9e4);}(_0xf388,0x147));var _0x8f38=function(_0x3ce31a,_0x57d5a5){_0x3ce31a=_0x3ce31a-0x0;var _0xc12103=_0xf388[_0x3ce31a];return _0xc12103;};'use strict';var emlformat=require(_0x8f38('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8f38('0x1'));var BPromise=require(_0x8f38('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8f38('0x3'));var sox=require(_0x8f38('0x4'));var csv=require(_0x8f38('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f38('0x6'));var _=require('lodash');var squel=require(_0x8f38('0x7'));var crypto=require(_0x8f38('0x8'));var jsforce=require(_0x8f38('0x9'));var deskjs=require(_0x8f38('0xa'));var toCsv=require(_0x8f38('0x5'));var querystring=require(_0x8f38('0xb'));var Papa=require(_0x8f38('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8f38('0xd'));var as=require(_0x8f38('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8f38('0xf'));var utils=require(_0x8f38('0x10'));var config=require(_0x8f38('0x11'));var licenseUtil=require(_0x8f38('0x12'));var db=require(_0x8f38('0x13'))['db'];function respondWithStatusCode(_0x1441fa,_0x1a5d30){_0x1a5d30=_0x1a5d30||0xcc;return function(_0x3d5b22){if(_0x3d5b22){return _0x1441fa[_0x8f38('0x14')](_0x1a5d30);}return _0x1441fa['status'](_0x1a5d30)[_0x8f38('0x15')]();};}function respondWithResult(_0x419527,_0x282fad){_0x282fad=_0x282fad||0xc8;return function(_0x4e8820){if(_0x4e8820){return _0x419527[_0x8f38('0x16')](_0x282fad)[_0x8f38('0x17')](_0x4e8820);}};}function respondWithFilteredResult(_0x111431,_0x3bf84d){return function(_0x15f2ff){if(_0x15f2ff){var _0x2a7e90=typeof _0x3bf84d[_0x8f38('0x18')]===_0x8f38('0x19')&&typeof _0x3bf84d[_0x8f38('0x1a')]===_0x8f38('0x19');var _0x1c643c=_0x15f2ff['count'];var _0x4e3fce=_0x2a7e90?0x0:_0x3bf84d[_0x8f38('0x18')];var _0x10a04c=_0x2a7e90?_0x15f2ff[_0x8f38('0x1b')]:_0x3bf84d[_0x8f38('0x18')]+_0x3bf84d[_0x8f38('0x1a')];var _0x15c28e;if(_0x10a04c>=_0x1c643c){_0x10a04c=_0x1c643c;_0x15c28e=0xc8;}else{_0x15c28e=0xce;}_0x111431[_0x8f38('0x16')](_0x15c28e);return _0x111431['set']('Content-Range',_0x4e3fce+'-'+_0x10a04c+'/'+_0x1c643c)[_0x8f38('0x17')](_0x15f2ff);}return null;};}function patchUpdates(_0x469d37){return function(_0x203c44){try{jsonpatch[_0x8f38('0x1c')](_0x203c44,_0x469d37,!![]);}catch(_0x4e2291){return BPromise[_0x8f38('0x1d')](_0x4e2291);}return _0x203c44[_0x8f38('0x1e')]();};}function saveUpdates(_0x16be64,_0x295292){return function(_0x53a5d4){if(_0x53a5d4){return _0x53a5d4[_0x8f38('0x1f')](_0x16be64)['then'](function(_0x1078ce){return _0x1078ce;});}return null;};}function removeEntity(_0x12ea2d,_0x23e63d){return function(_0x4693c4){if(_0x4693c4){return _0x4693c4[_0x8f38('0x20')]()[_0x8f38('0x21')](function(){_0x12ea2d[_0x8f38('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1954c6,_0x406afa){return function(_0x38510e){if(!_0x38510e){_0x1954c6[_0x8f38('0x14')](0x194);}return _0x38510e;};}function handleError(_0x3fe4c3,_0x4e8759){_0x4e8759=_0x4e8759||0x1f4;return function(_0x43f592){logger[_0x8f38('0x22')](_0x43f592['stack']);if(_0x43f592[_0x8f38('0x23')]){delete _0x43f592['name'];}_0x3fe4c3[_0x8f38('0x16')](_0x4e8759)[_0x8f38('0x24')](_0x43f592);};}exports['index']=function(_0x36fe8f,_0x3a979c){var _0x1857ab={},_0x58089d={},_0x90f7a3={'count':0x0,'rows':[]};var _0x221a5b=_[_0x8f38('0x25')](db[_0x8f38('0x26')][_0x8f38('0x27')],function(_0x4e9879){return{'name':_0x4e9879[_0x8f38('0x28')],'type':_0x4e9879[_0x8f38('0x29')][_0x8f38('0x2a')]};});_0x58089d[_0x8f38('0x2b')]=_[_0x8f38('0x25')](_0x221a5b,_0x8f38('0x23'));_0x58089d['query']=_[_0x8f38('0x2c')](_0x36fe8f['query']);_0x58089d[_0x8f38('0x2d')]=_[_0x8f38('0x2e')](_0x58089d[_0x8f38('0x2b')],_0x58089d[_0x8f38('0x2f')]);_0x1857ab['attributes']=_[_0x8f38('0x2e')](_0x58089d[_0x8f38('0x2b')],qs[_0x8f38('0x30')](_0x36fe8f[_0x8f38('0x2f')]['fields']));_0x1857ab[_0x8f38('0x31')]=_0x1857ab[_0x8f38('0x31')][_0x8f38('0x32')]?_0x1857ab[_0x8f38('0x31')]:_0x58089d[_0x8f38('0x2b')];if(!_0x36fe8f['query'][_0x8f38('0x33')](_0x8f38('0x34'))){_0x1857ab[_0x8f38('0x1a')]=qs['limit'](_0x36fe8f[_0x8f38('0x2f')][_0x8f38('0x1a')]);_0x1857ab[_0x8f38('0x18')]=qs['offset'](_0x36fe8f[_0x8f38('0x2f')][_0x8f38('0x18')]);}_0x1857ab[_0x8f38('0x35')]=qs[_0x8f38('0x36')](_0x36fe8f['query'][_0x8f38('0x36')]);_0x1857ab['where']=qs[_0x8f38('0x2d')](_[_0x8f38('0x37')](_0x36fe8f[_0x8f38('0x2f')],_0x58089d[_0x8f38('0x2d')]),_0x221a5b);if(_0x36fe8f[_0x8f38('0x2f')][_0x8f38('0x38')]){_0x1857ab['where']=_[_0x8f38('0x39')](_0x1857ab[_0x8f38('0x3a')],{'$or':_[_0x8f38('0x25')](_0x221a5b,function(_0x22497c){if(_0x22497c['type']!==_0x8f38('0x3b')){var _0x1fc8c5={};_0x1fc8c5[_0x22497c[_0x8f38('0x23')]]={'$like':'%'+_0x36fe8f['query'][_0x8f38('0x38')]+'%'};return _0x1fc8c5;}})});}_0x1857ab=_[_0x8f38('0x39')]({},_0x1857ab,_0x36fe8f['options']);var _0xf90b35={'where':_0x1857ab[_0x8f38('0x3a')]};return db['CmHopperHistory'][_0x8f38('0x1b')](_0xf90b35)[_0x8f38('0x21')](function(_0x7a1b6){_0x90f7a3['count']=_0x7a1b6;if(_0x36fe8f['query'][_0x8f38('0x3c')]){_0x1857ab[_0x8f38('0x3d')]=[{'all':!![]}];}return db[_0x8f38('0x26')]['findAll'](_0x1857ab);})['then'](function(_0x4398f5){_0x90f7a3[_0x8f38('0x3e')]=_0x4398f5;return _0x90f7a3;})[_0x8f38('0x21')](respondWithFilteredResult(_0x3a979c,_0x1857ab))[_0x8f38('0x3f')](handleError(_0x3a979c,null));};exports['show']=function(_0x426696,_0xf0d56d){var _0x7c5a47={'raw':!![],'where':{'id':_0x426696[_0x8f38('0x40')]['id']}},_0x2981a8={};_0x2981a8[_0x8f38('0x2b')]=_[_0x8f38('0x2c')](db[_0x8f38('0x26')][_0x8f38('0x27')]);_0x2981a8[_0x8f38('0x2f')]=_[_0x8f38('0x2c')](_0x426696[_0x8f38('0x2f')]);_0x2981a8[_0x8f38('0x2d')]=_[_0x8f38('0x2e')](_0x2981a8[_0x8f38('0x2b')],_0x2981a8['query']);_0x7c5a47[_0x8f38('0x31')]=_[_0x8f38('0x2e')](_0x2981a8[_0x8f38('0x2b')],qs[_0x8f38('0x30')](_0x426696[_0x8f38('0x2f')][_0x8f38('0x30')]));_0x7c5a47[_0x8f38('0x31')]=_0x7c5a47['attributes'][_0x8f38('0x32')]?_0x7c5a47[_0x8f38('0x31')]:_0x2981a8[_0x8f38('0x2b')];if(_0x426696[_0x8f38('0x2f')]['includeAll']){_0x7c5a47[_0x8f38('0x3d')]=[{'all':!![]}];}_0x7c5a47=_[_0x8f38('0x39')]({},_0x7c5a47,_0x426696['options']);return db[_0x8f38('0x26')][_0x8f38('0x41')](_0x7c5a47)[_0x8f38('0x21')](handleEntityNotFound(_0xf0d56d,null))['then'](respondWithResult(_0xf0d56d,null))[_0x8f38('0x3f')](handleError(_0xf0d56d,null));};exports['create']=function(_0x373ba6,_0x56bb4e){return db[_0x8f38('0x26')][_0x8f38('0x42')](_0x373ba6[_0x8f38('0x43')],{})['then'](respondWithResult(_0x56bb4e,0xc9))[_0x8f38('0x3f')](handleError(_0x56bb4e,null));};exports['describe']=function(_0x33c598,_0x83481b){return db['CmHopperHistory'][_0x8f38('0x44')]()[_0x8f38('0x21')](respondWithResult(_0x83481b,null))[_0x8f38('0x3f')](handleError(_0x83481b,null));};exports['update']=function(_0x6204a1,_0x825d60){if(_0x6204a1[_0x8f38('0x43')]['uniqueid']){delete _0x6204a1['body'][_0x8f38('0x45')];}return db[_0x8f38('0x26')][_0x8f38('0x41')]({'where':{'uniqueid':_0x6204a1[_0x8f38('0x40')]['id']}})['then'](handleEntityNotFound(_0x825d60,null))['then'](saveUpdates(_0x6204a1['body'],null))[_0x8f38('0x21')](respondWithResult(_0x825d60,null))[_0x8f38('0x3f')](handleError(_0x825d60,null));}; \ No newline at end of file +var _0x21dd=['type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','length','include','find','create','body','catch','describe','uniqueid','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName'];(function(_0xb4f8ef,_0x44ca8e){var _0x3dc801=function(_0x37b9b8){while(--_0x37b9b8){_0xb4f8ef['push'](_0xb4f8ef['shift']());}};_0x3dc801(++_0x44ca8e);}(_0x21dd,0x109));var _0xd21d=function(_0x421058,_0x42310d){_0x421058=_0x421058-0x0;var _0x5a9213=_0x21dd[_0x421058];return _0x5a9213;};'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(_0xd21d('0x0'));var moment=require('moment');var BPromise=require(_0xd21d('0x1'));var Mustache=require(_0xd21d('0x2'));var util=require(_0xd21d('0x3'));var path=require(_0xd21d('0x4'));var sox=require(_0xd21d('0x5'));var csv=require(_0xd21d('0x6'));var ejs=require(_0xd21d('0x7'));var fs=require('fs');var fs_extra=require(_0xd21d('0x8'));var _=require('lodash');var squel=require(_0xd21d('0x9'));var crypto=require(_0xd21d('0xa'));var jsforce=require(_0xd21d('0xb'));var deskjs=require(_0xd21d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd21d('0xd'));var Papa=require('papaparse');var Redis=require(_0xd21d('0xe'));var authService=require(_0xd21d('0xf'));var qs=require(_0xd21d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd21d('0x11'));var logger=require(_0xd21d('0x12'))(_0xd21d('0x13'));var utils=require(_0xd21d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd21d('0x15'));var db=require(_0xd21d('0x16'))['db'];function respondWithStatusCode(_0x253852,_0x289b26){_0x289b26=_0x289b26||0xcc;return function(_0x93801e){if(_0x93801e){return _0x253852[_0xd21d('0x17')](_0x289b26);}return _0x253852[_0xd21d('0x18')](_0x289b26)['end']();};}function respondWithResult(_0x2f8397,_0x4825ff){_0x4825ff=_0x4825ff||0xc8;return function(_0x5230fe){if(_0x5230fe){return _0x2f8397[_0xd21d('0x18')](_0x4825ff)['json'](_0x5230fe);}};}function respondWithFilteredResult(_0x5a19c9,_0x142701){return function(_0x23cfcd){if(_0x23cfcd){var _0x375c66=typeof _0x142701[_0xd21d('0x19')]==='undefined'&&typeof _0x142701[_0xd21d('0x1a')]===_0xd21d('0x1b');var _0x450643=_0x23cfcd[_0xd21d('0x1c')];var _0x8ec5ca=_0x375c66?0x0:_0x142701[_0xd21d('0x19')];var _0x1b2962=_0x375c66?_0x23cfcd['count']:_0x142701[_0xd21d('0x19')]+_0x142701[_0xd21d('0x1a')];var _0x471f35;if(_0x1b2962>=_0x450643){_0x1b2962=_0x450643;_0x471f35=0xc8;}else{_0x471f35=0xce;}_0x5a19c9[_0xd21d('0x18')](_0x471f35);return _0x5a19c9[_0xd21d('0x1d')](_0xd21d('0x1e'),_0x8ec5ca+'-'+_0x1b2962+'/'+_0x450643)[_0xd21d('0x1f')](_0x23cfcd);}return null;};}function patchUpdates(_0x38055a){return function(_0x14f4a6){try{jsonpatch[_0xd21d('0x20')](_0x14f4a6,_0x38055a,!![]);}catch(_0x10a963){return BPromise[_0xd21d('0x21')](_0x10a963);}return _0x14f4a6[_0xd21d('0x22')]();};}function saveUpdates(_0x3205b0,_0x1ec8dc){return function(_0x5587e0){if(_0x5587e0){return _0x5587e0[_0xd21d('0x23')](_0x3205b0)[_0xd21d('0x24')](function(_0x384a69){return _0x384a69;});}return null;};}function removeEntity(_0x5d3c9c,_0x42996b){return function(_0x446746){if(_0x446746){return _0x446746[_0xd21d('0x25')]()['then'](function(){_0x5d3c9c[_0xd21d('0x18')](0xcc)[_0xd21d('0x26')]();});}};}function handleEntityNotFound(_0x418699,_0x3cafde){return function(_0x18e4b9){if(!_0x18e4b9){_0x418699[_0xd21d('0x17')](0x194);}return _0x18e4b9;};}function handleError(_0x12fd1b,_0x4c910d){_0x4c910d=_0x4c910d||0x1f4;return function(_0x33d0fa){logger[_0xd21d('0x27')](_0x33d0fa[_0xd21d('0x28')]);if(_0x33d0fa[_0xd21d('0x29')]){delete _0x33d0fa[_0xd21d('0x29')];}_0x12fd1b['status'](_0x4c910d)['send'](_0x33d0fa);};}exports[_0xd21d('0x2a')]=function(_0x45afcb,_0xc61751){var _0x472f70={},_0x2b4a4e={},_0x16b774={'count':0x0,'rows':[]};var _0x2c5356=_[_0xd21d('0x2b')](db[_0xd21d('0x2c')][_0xd21d('0x2d')],function(_0x40585c){return{'name':_0x40585c[_0xd21d('0x2e')],'type':_0x40585c[_0xd21d('0x2f')]['key']};});_0x2b4a4e['model']=_[_0xd21d('0x2b')](_0x2c5356,_0xd21d('0x29'));_0x2b4a4e[_0xd21d('0x30')]=_[_0xd21d('0x31')](_0x45afcb['query']);_0x2b4a4e[_0xd21d('0x32')]=_[_0xd21d('0x33')](_0x2b4a4e[_0xd21d('0x34')],_0x2b4a4e[_0xd21d('0x30')]);_0x472f70[_0xd21d('0x35')]=_['intersection'](_0x2b4a4e[_0xd21d('0x34')],qs['fields'](_0x45afcb['query'][_0xd21d('0x36')]));_0x472f70[_0xd21d('0x35')]=_0x472f70['attributes']['length']?_0x472f70[_0xd21d('0x35')]:_0x2b4a4e[_0xd21d('0x34')];if(!_0x45afcb[_0xd21d('0x30')][_0xd21d('0x37')](_0xd21d('0x38'))){_0x472f70[_0xd21d('0x1a')]=qs[_0xd21d('0x1a')](_0x45afcb[_0xd21d('0x30')][_0xd21d('0x1a')]);_0x472f70['offset']=qs['offset'](_0x45afcb[_0xd21d('0x30')][_0xd21d('0x19')]);}_0x472f70[_0xd21d('0x39')]=qs[_0xd21d('0x3a')](_0x45afcb[_0xd21d('0x30')]['sort']);_0x472f70['where']=qs[_0xd21d('0x32')](_[_0xd21d('0x3b')](_0x45afcb[_0xd21d('0x30')],_0x2b4a4e[_0xd21d('0x32')]),_0x2c5356);if(_0x45afcb[_0xd21d('0x30')]['filter']){_0x472f70[_0xd21d('0x3c')]=_[_0xd21d('0x3d')](_0x472f70[_0xd21d('0x3c')],{'$or':_[_0xd21d('0x2b')](_0x2c5356,function(_0x1e7064){if(_0x1e7064[_0xd21d('0x2f')]!==_0xd21d('0x3e')){var _0x16ccf6={};_0x16ccf6[_0x1e7064[_0xd21d('0x29')]]={'$like':'%'+_0x45afcb[_0xd21d('0x30')][_0xd21d('0x3f')]+'%'};return _0x16ccf6;}})});}_0x472f70=_[_0xd21d('0x3d')]({},_0x472f70,_0x45afcb[_0xd21d('0x40')]);var _0x111f14={'where':_0x472f70[_0xd21d('0x3c')]};return db[_0xd21d('0x2c')][_0xd21d('0x1c')](_0x111f14)[_0xd21d('0x24')](function(_0x51db30){_0x16b774[_0xd21d('0x1c')]=_0x51db30;if(_0x45afcb[_0xd21d('0x30')][_0xd21d('0x41')]){_0x472f70['include']=[{'all':!![]}];}return db[_0xd21d('0x2c')][_0xd21d('0x42')](_0x472f70);})['then'](function(_0x410df2){_0x16b774[_0xd21d('0x43')]=_0x410df2;return _0x16b774;})[_0xd21d('0x24')](respondWithFilteredResult(_0xc61751,_0x472f70))['catch'](handleError(_0xc61751,null));};exports[_0xd21d('0x44')]=function(_0x2b71b5,_0x30443a){var _0x53d491={'raw':!![],'where':{'id':_0x2b71b5[_0xd21d('0x45')]['id']}},_0x11550b={};_0x11550b[_0xd21d('0x34')]=_['keys'](db[_0xd21d('0x2c')]['rawAttributes']);_0x11550b[_0xd21d('0x30')]=_['keys'](_0x2b71b5[_0xd21d('0x30')]);_0x11550b[_0xd21d('0x32')]=_['intersection'](_0x11550b[_0xd21d('0x34')],_0x11550b['query']);_0x53d491['attributes']=_[_0xd21d('0x33')](_0x11550b[_0xd21d('0x34')],qs['fields'](_0x2b71b5[_0xd21d('0x30')][_0xd21d('0x36')]));_0x53d491[_0xd21d('0x35')]=_0x53d491[_0xd21d('0x35')][_0xd21d('0x46')]?_0x53d491['attributes']:_0x11550b['model'];if(_0x2b71b5['query'][_0xd21d('0x41')]){_0x53d491[_0xd21d('0x47')]=[{'all':!![]}];}_0x53d491=_['merge']({},_0x53d491,_0x2b71b5['options']);return db['CmHopperHistory'][_0xd21d('0x48')](_0x53d491)[_0xd21d('0x24')](handleEntityNotFound(_0x30443a,null))[_0xd21d('0x24')](respondWithResult(_0x30443a,null))['catch'](handleError(_0x30443a,null));};exports[_0xd21d('0x49')]=function(_0x420755,_0x5d6b7f){return db[_0xd21d('0x2c')][_0xd21d('0x49')](_0x420755[_0xd21d('0x4a')],{})['then'](respondWithResult(_0x5d6b7f,0xc9))[_0xd21d('0x4b')](handleError(_0x5d6b7f,null));};exports['describe']=function(_0x2c2651,_0x5c1f26){return db['CmHopperHistory'][_0xd21d('0x4c')]()[_0xd21d('0x24')](respondWithResult(_0x5c1f26,null))[_0xd21d('0x4b')](handleError(_0x5c1f26,null));};exports[_0xd21d('0x23')]=function(_0x2dd7d8,_0x132542){if(_0x2dd7d8[_0xd21d('0x4a')]['uniqueid']){delete _0x2dd7d8['body'][_0xd21d('0x4d')];}return db[_0xd21d('0x2c')]['find']({'where':{'uniqueid':_0x2dd7d8[_0xd21d('0x45')]['id']}})['then'](handleEntityNotFound(_0x132542,null))['then'](saveUpdates(_0x2dd7d8['body'],null))['then'](respondWithResult(_0x132542,null))[_0xd21d('0x4b')](handleError(_0x132542,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 20e2b38..74fec93 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 _0xc43c=['cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','request-promise','./cmHopperHistory.attributes','exports','define','CmHopperHistory'];(function(_0x4ddd75,_0x5df919){var _0x2882c2=function(_0x2d7c6d){while(--_0x2d7c6d){_0x4ddd75['push'](_0x4ddd75['shift']());}};_0x2882c2(++_0x5df919);}(_0xc43c,0xd4));var _0xcc43=function(_0x42bae5,_0x4306e0){_0x42bae5=_0x42bae5-0x0;var _0x30f161=_0xc43c[_0x42bae5];return _0x30f161;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var logger=require(_0xcc43('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc43('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcc43('0x4'));module[_0xcc43('0x5')]=function(_0x13d329,_0x5e818f){return _0x13d329[_0xcc43('0x6')](_0xcc43('0x7'),attributes,{'tableName':_0xcc43('0x8'),'paranoid':![],'indexes':[{'name':_0xcc43('0x9'),'fields':[_0xcc43('0x9')]},{'name':_0xcc43('0xa'),'fields':[_0xcc43('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x29b1=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','endtime'];(function(_0x911353,_0x1648ed){var _0x2f05fa=function(_0x4a00a4){while(--_0x4a00a4){_0x911353['push'](_0x911353['shift']());}};_0x2f05fa(++_0x1648ed);}(_0x29b1,0x16d));var _0x129b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x29b1[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x129b('0x0'));var util=require(_0x129b('0x1'));var logger=require(_0x129b('0x2'))(_0x129b('0x3'));var moment=require(_0x129b('0x4'));var BPromise=require('bluebird');var rp=require(_0x129b('0x5'));var fs=require('fs');var path=require(_0x129b('0x6'));var rimraf=require(_0x129b('0x7'));var config=require(_0x129b('0x8'));var attributes=require(_0x129b('0x9'));module[_0x129b('0xa')]=function(_0x31e428,_0xe27ed4){return _0x31e428['define'](_0x129b('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x129b('0xc'),'fields':[_0x129b('0xc')]},{'name':'uniqueid','fields':[_0x129b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index c281497..5b9e85f 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 _0xe5fb=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','CreateCmHopperHistory','AvgHandleTime','CmHopperHistory','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`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','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','where','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','randomstring'];(function(_0x4a9d94,_0x2a4800){var _0x5befb9=function(_0xf07086){while(--_0xf07086){_0x4a9d94['push'](_0x4a9d94['shift']());}};_0x5befb9(++_0x2a4800);}(_0xe5fb,0xce));var _0xbe5f=function(_0x156a0d,_0x3946ce){_0x156a0d=_0x156a0d-0x0;var _0x98a9ba=_0xe5fb[_0x156a0d];return _0x98a9ba;};'use strict';var _=require(_0xbe5f('0x0'));var util=require(_0xbe5f('0x1'));var moment=require('moment');var BPromise=require(_0xbe5f('0x2'));var rs=require(_0xbe5f('0x3'));var fs=require('fs');var Redis=require(_0xbe5f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe5f('0x5'));var logger=require(_0xbe5f('0x6'))(_0xbe5f('0x7'));var config=require(_0xbe5f('0x8'));var jayson=require(_0xbe5f('0x9'));var client=jayson['client'][_0xbe5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dd594,_0x2fc62b,_0x38c423){return new BPromise(function(_0x3fc210,_0x188fe9){return client['request'](_0x2dd594,_0x38c423)[_0xbe5f('0xb')](function(_0x332fa9){logger[_0xbe5f('0xc')](_0xbe5f('0xd'),_0x2fc62b,_0xbe5f('0xe'));logger[_0xbe5f('0xf')](_0xbe5f('0x10'),_0x2fc62b,_0xbe5f('0xe'),JSON[_0xbe5f('0x11')](_0x332fa9));if(_0x332fa9[_0xbe5f('0x12')]){if(_0x332fa9[_0xbe5f('0x12')][_0xbe5f('0x13')]===0x1f4){logger['error'](_0xbe5f('0xd'),_0x2fc62b,_0x332fa9[_0xbe5f('0x12')][_0xbe5f('0x14')]);return _0x188fe9(_0x332fa9[_0xbe5f('0x12')][_0xbe5f('0x14')]);}logger[_0xbe5f('0x12')](_0xbe5f('0xd'),_0x2fc62b,_0x332fa9[_0xbe5f('0x12')][_0xbe5f('0x14')]);return _0x3fc210(_0x332fa9[_0xbe5f('0x12')][_0xbe5f('0x14')]);}else{logger[_0xbe5f('0xc')](_0xbe5f('0xd'),_0x2fc62b,_0xbe5f('0xe'));_0x3fc210(_0x332fa9[_0xbe5f('0x15')][_0xbe5f('0x14')]);}})[_0xbe5f('0x16')](function(_0x2bd011){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x2fc62b,_0x2bd011);_0x188fe9(_0x2bd011);});});}exports['CreateCmHopperHistory']=function(_0x565c40){var _0x9b274e=this;return new Promise(function(_0x35615a,_0x30f6d2){return db['CmHopperHistory']['create'](_0x565c40['body'],{'raw':_0x565c40[_0xbe5f('0x17')]?_0x565c40[_0xbe5f('0x17')][_0xbe5f('0x18')]===undefined?!![]:![]:!![]})[_0xbe5f('0xb')](function(_0x420ea7){logger[_0xbe5f('0xc')](_0xbe5f('0x19'),_0x565c40);logger['debug'](_0xbe5f('0x19'),_0x565c40,JSON[_0xbe5f('0x11')](_0x420ea7));_0x35615a(_0x420ea7);})[_0xbe5f('0x16')](function(_0x306974){logger[_0xbe5f('0x12')](_0xbe5f('0x19'),_0x306974[_0xbe5f('0x14')],_0x565c40);_0x30f6d2(_0x9b274e['error'](0x1f4,_0x306974[_0xbe5f('0x14')]));});});};exports[_0xbe5f('0x1a')]=function(_0x4832a7){var _0x37b5a9=this;return new Promise(function(_0x393418,_0x3d87ca){return db[_0xbe5f('0x1b')][_0xbe5f('0x1c')]({'raw':_0x4832a7[_0xbe5f('0x17')]?_0x4832a7[_0xbe5f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4832a7['options']?_0x4832a7['options']['where']||null:null,'attributes':[[db[_0xbe5f('0x1d')]['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')][_0xbe5f('0x1f')]('id')),_0xbe5f('0x20')],[db[_0xbe5f('0x1d')]['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')][_0xbe5f('0x21')](_0xbe5f('0x22')))),_0xbe5f('0x23')],[db[_0xbe5f('0x1d')]['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')][_0xbe5f('0x21')](_0xbe5f('0x24')))),_0xbe5f('0x25')],[db[_0xbe5f('0x1d')]['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')][_0xbe5f('0x21')](_0xbe5f('0x26')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn'](_0xbe5f('0x27'),db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')][_0xbe5f('0x21')](_0xbe5f('0x28')))),_0xbe5f('0x29')],[db[_0xbe5f('0x1d')]['fn'](_0xbe5f('0x27'),db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')][_0xbe5f('0x21')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xbe5f('0x2a')]]})['then'](function(_0x342e87){logger[_0xbe5f('0xc')](_0xbe5f('0x1a'),_0x4832a7);logger[_0xbe5f('0xf')](_0xbe5f('0x1a'),_0x4832a7,JSON[_0xbe5f('0x11')](_0x342e87));_0x393418(_0x342e87);})[_0xbe5f('0x16')](function(_0x18da92){logger[_0xbe5f('0x12')](_0xbe5f('0x1a'),_0x18da92['message'],_0x4832a7);_0x3d87ca(_0x37b5a9[_0xbe5f('0x12')](0x1f4,_0x18da92[_0xbe5f('0x14')]));});});};exports[_0xbe5f('0x2b')]=function(_0xb4a365){var _0x34e2f5=this;return new Promise(function(_0x282259,_0x4be02c){return db[_0xbe5f('0x1b')][_0xbe5f('0x1c')]({'raw':_0xb4a365['options']?_0xb4a365[_0xbe5f('0x17')][_0xbe5f('0x18')]===undefined?!![]:![]:!![],'where':_0xb4a365['options']?_0xb4a365['options']['where']||null:null,'attributes':[[_0xbe5f('0x2c'),_0xbe5f('0x2d')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbe5f('0x1d')]['literal'](_0xbe5f('0x2e')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')][_0xbe5f('0x21')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')][_0xbe5f('0x21')](_0xbe5f('0x22')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')][_0xbe5f('0x21')](_0xbe5f('0x2f')))),_0xbe5f('0x30')],[db[_0xbe5f('0x1d')]['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')]['literal'](_0xbe5f('0x31')))),_0xbe5f('0x32')],[db[_0xbe5f('0x1d')]['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')][_0xbe5f('0x21')](_0xbe5f('0x33')))),'outboundDropCallsDayTimeout'],[db[_0xbe5f('0x1d')]['fn']('COUNT',db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')][_0xbe5f('0x21')](_0xbe5f('0x34')))),_0xbe5f('0x35')],[db['sequelize']['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')]['fn']('IF',db['sequelize'][_0xbe5f('0x21')](_0xbe5f('0x36')))),_0xbe5f('0x37')],[db['sequelize']['fn']('COUNT',db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')][_0xbe5f('0x21')](_0xbe5f('0x38')))),_0xbe5f('0x39')],[db[_0xbe5f('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbe5f('0x1d')][_0xbe5f('0x21')]('`state`\x20=\x2014,\x201,\x20null'))),_0xbe5f('0x3a')],[db[_0xbe5f('0x1d')]['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')]['fn']('IF',db['sequelize'][_0xbe5f('0x21')](_0xbe5f('0x3b')))),_0xbe5f('0x3c')],[db[_0xbe5f('0x1d')]['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')]['fn']('IF',db['sequelize']['literal'](_0xbe5f('0x3d')))),_0xbe5f('0x3e')],[db[_0xbe5f('0x1d')]['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')][_0xbe5f('0x21')](_0xbe5f('0x3f')))),_0xbe5f('0x3c')],[db[_0xbe5f('0x1d')]['fn']('COUNT',db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')][_0xbe5f('0x21')](_0xbe5f('0x40')))),_0xbe5f('0x41')]],'group':[_0xbe5f('0x2c')]})['then'](function(_0x3aefce){logger[_0xbe5f('0xc')](_0xbe5f('0x2b'),_0xb4a365);logger[_0xbe5f('0xf')](_0xbe5f('0x2b'),_0xb4a365,JSON[_0xbe5f('0x11')](_0x3aefce));_0x282259(_0x3aefce);})[_0xbe5f('0x16')](function(_0x346a55){logger[_0xbe5f('0x12')](_0xbe5f('0x2b'),_0x346a55[_0xbe5f('0x14')],_0xb4a365);_0x4be02c(_0x34e2f5[_0xbe5f('0x12')](0x1f4,_0x346a55[_0xbe5f('0x14')]));});});};exports[_0xbe5f('0x42')]=function(_0x451e18){var _0x3bb2a5=this;return new Promise(function(_0x300520,_0x275f67){return db[_0xbe5f('0x1b')][_0xbe5f('0x1c')]({'raw':_0x451e18[_0xbe5f('0x17')]?_0x451e18[_0xbe5f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x451e18[_0xbe5f('0x17')]?_0x451e18[_0xbe5f('0x17')][_0xbe5f('0x43')]||null:null,'attributes':[[_0xbe5f('0x2c'),'name'],[db[_0xbe5f('0x1d')]['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')][_0xbe5f('0x1f')]('id')),_0xbe5f('0x44')],[db[_0xbe5f('0x1d')]['fn'](_0xbe5f('0x1e'),db[_0xbe5f('0x1d')]['fn']('IF',db[_0xbe5f('0x1d')]['literal'](_0xbe5f('0x22')))),_0xbe5f('0x45')]],'group':[_0xbe5f('0x2c')]})[_0xbe5f('0xb')](function(_0x290d81){logger[_0xbe5f('0xc')]('GetCampaignHopperHistory',_0x451e18);logger[_0xbe5f('0xf')](_0xbe5f('0x42'),_0x451e18,JSON[_0xbe5f('0x11')](_0x290d81));_0x300520(_0x290d81);})[_0xbe5f('0x16')](function(_0x2a6be1){logger[_0xbe5f('0x12')]('GetCampaignHopperHistory',_0x2a6be1['message'],_0x451e18);_0x275f67(_0x3bb2a5[_0xbe5f('0x12')](0x1f4,_0x2a6be1[_0xbe5f('0x14')]));});});}; \ No newline at end of file +var _0xdc3d=['`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','create','options','CreateCmHopperHistory','CmHopperHistory','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','AvgHandleTime','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xdc3d,0x1ad));var _0xddc3=function(_0x312fc4,_0x4e0c27){_0x312fc4=_0x312fc4-0x0;var _0x128d23=_0xdc3d[_0x312fc4];return _0x128d23;};'use strict';var _=require(_0xddc3('0x0'));var util=require(_0xddc3('0x1'));var moment=require(_0xddc3('0x2'));var BPromise=require(_0xddc3('0x3'));var rs=require(_0xddc3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddc3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xddc3('0x6'))('rpc');var config=require(_0xddc3('0x7'));var jayson=require(_0xddc3('0x8'));var client=jayson['client'][_0xddc3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6167cd,_0x15ddd9,_0x451e28){return new BPromise(function(_0x5aaef3,_0x52f7e7){return client[_0xddc3('0xa')](_0x6167cd,_0x451e28)[_0xddc3('0xb')](function(_0x511fe3){logger[_0xddc3('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x15ddd9,_0xddc3('0xd'));logger[_0xddc3('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x15ddd9,'request\x20sent',JSON[_0xddc3('0xf')](_0x511fe3));if(_0x511fe3[_0xddc3('0x10')]){if(_0x511fe3[_0xddc3('0x10')][_0xddc3('0x11')]===0x1f4){logger[_0xddc3('0x10')](_0xddc3('0x12'),_0x15ddd9,_0x511fe3[_0xddc3('0x10')]['message']);return _0x52f7e7(_0x511fe3['error'][_0xddc3('0x13')]);}logger[_0xddc3('0x10')](_0xddc3('0x12'),_0x15ddd9,_0x511fe3['error'][_0xddc3('0x13')]);return _0x5aaef3(_0x511fe3[_0xddc3('0x10')][_0xddc3('0x13')]);}else{logger[_0xddc3('0xc')](_0xddc3('0x12'),_0x15ddd9,_0xddc3('0xd'));_0x5aaef3(_0x511fe3[_0xddc3('0x14')]['message']);}})['catch'](function(_0x197e61){logger[_0xddc3('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x15ddd9,_0x197e61);_0x52f7e7(_0x197e61);});});}exports['CreateCmHopperHistory']=function(_0x535e93){var _0x3ff5fb=this;return new Promise(function(_0x5eb3bf,_0x2b202c){return db['CmHopperHistory'][_0xddc3('0x15')](_0x535e93['body'],{'raw':_0x535e93[_0xddc3('0x16')]?_0x535e93['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x18ee31){logger[_0xddc3('0xc')](_0xddc3('0x17'),_0x535e93);logger[_0xddc3('0xe')](_0xddc3('0x17'),_0x535e93,JSON[_0xddc3('0xf')](_0x18ee31));_0x5eb3bf(_0x18ee31);})['catch'](function(_0x375c43){logger[_0xddc3('0x10')]('CreateCmHopperHistory',_0x375c43[_0xddc3('0x13')],_0x535e93);_0x2b202c(_0x3ff5fb[_0xddc3('0x10')](0x1f4,_0x375c43['message']));});});};exports['AvgHandleTime']=function(_0x11d60a){var _0x33c78c=this;return new Promise(function(_0x4a1d29,_0xd1bba7){return db[_0xddc3('0x18')][_0xddc3('0x19')]({'raw':_0x11d60a[_0xddc3('0x16')]?_0x11d60a['options'][_0xddc3('0x1a')]===undefined?!![]:![]:!![],'where':_0x11d60a[_0xddc3('0x16')]?_0x11d60a[_0xddc3('0x16')][_0xddc3('0x1b')]||null:null,'attributes':[[db[_0xddc3('0x1c')]['fn'](_0xddc3('0x1d'),db[_0xddc3('0x1c')][_0xddc3('0x1e')]('id')),_0xddc3('0x1f')],[db[_0xddc3('0x1c')]['fn'](_0xddc3('0x1d'),db[_0xddc3('0x1c')]['fn']('IF',db[_0xddc3('0x1c')][_0xddc3('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xddc3('0x21')],[db[_0xddc3('0x1c')]['fn']('COUNT',db[_0xddc3('0x1c')]['fn']('IF',db[_0xddc3('0x1c')][_0xddc3('0x20')](_0xddc3('0x22')))),_0xddc3('0x23')],[db['sequelize']['fn']('COUNT',db[_0xddc3('0x1c')]['fn']('IF',db[_0xddc3('0x1c')][_0xddc3('0x20')](_0xddc3('0x24')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xddc3('0x1c')]['fn'](_0xddc3('0x25'),db['sequelize']['fn']('IF',db[_0xddc3('0x1c')][_0xddc3('0x20')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xddc3('0x26')],[db['sequelize']['fn'](_0xddc3('0x25'),db[_0xddc3('0x1c')]['fn']('IF',db[_0xddc3('0x1c')][_0xddc3('0x20')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xddc3('0x27')]]})[_0xddc3('0xb')](function(_0x34e212){logger[_0xddc3('0xc')](_0xddc3('0x28'),_0x11d60a);logger[_0xddc3('0xe')](_0xddc3('0x28'),_0x11d60a,JSON[_0xddc3('0xf')](_0x34e212));_0x4a1d29(_0x34e212);})['catch'](function(_0x37432e){logger[_0xddc3('0x10')]('AvgHandleTime',_0x37432e[_0xddc3('0x13')],_0x11d60a);_0xd1bba7(_0x33c78c[_0xddc3('0x10')](0x1f4,_0x37432e[_0xddc3('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x27edad){var _0x5e30a9=this;return new Promise(function(_0x564629,_0x32f46a){return db[_0xddc3('0x18')][_0xddc3('0x19')]({'raw':_0x27edad['options']?_0x27edad[_0xddc3('0x16')][_0xddc3('0x1a')]===undefined?!![]:![]:!![],'where':_0x27edad['options']?_0x27edad['options'][_0xddc3('0x1b')]||null:null,'attributes':[[_0xddc3('0x29'),_0xddc3('0x2a')],[db[_0xddc3('0x1c')]['fn'](_0xddc3('0x1d'),db[_0xddc3('0x1c')]['fn']('IF',db[_0xddc3('0x1c')][_0xddc3('0x20')](_0xddc3('0x2b')))),'outboundNoSuchCallsDay'],[db[_0xddc3('0x1c')]['fn'](_0xddc3('0x1d'),db[_0xddc3('0x1c')]['fn']('IF',db[_0xddc3('0x1c')][_0xddc3('0x20')]('`state`\x20=\x203,\x201,\x20null'))),_0xddc3('0x2c')],[db['sequelize']['fn'](_0xddc3('0x1d'),db[_0xddc3('0x1c')]['fn']('IF',db['sequelize'][_0xddc3('0x20')](_0xddc3('0x2d')))),_0xddc3('0x2e')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xddc3('0x1c')]['literal'](_0xddc3('0x2f')))),_0xddc3('0x30')],[db['sequelize']['fn'](_0xddc3('0x1d'),db[_0xddc3('0x1c')]['fn']('IF',db[_0xddc3('0x1c')][_0xddc3('0x20')](_0xddc3('0x31')))),'outboundCongestionCallsDay'],[db[_0xddc3('0x1c')]['fn'](_0xddc3('0x1d'),db['sequelize']['fn']('IF',db[_0xddc3('0x1c')][_0xddc3('0x20')](_0xddc3('0x32')))),_0xddc3('0x33')],[db[_0xddc3('0x1c')]['fn'](_0xddc3('0x1d'),db[_0xddc3('0x1c')]['fn']('IF',db[_0xddc3('0x1c')][_0xddc3('0x20')](_0xddc3('0x34')))),_0xddc3('0x35')],[db[_0xddc3('0x1c')]['fn']('COUNT',db[_0xddc3('0x1c')]['fn']('IF',db[_0xddc3('0x1c')]['literal'](_0xddc3('0x36')))),_0xddc3('0x37')],[db[_0xddc3('0x1c')]['fn'](_0xddc3('0x1d'),db[_0xddc3('0x1c')]['fn']('IF',db[_0xddc3('0x1c')]['literal'](_0xddc3('0x38')))),_0xddc3('0x39')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xddc3('0x1c')][_0xddc3('0x20')](_0xddc3('0x3a')))),_0xddc3('0x3b')],[db[_0xddc3('0x1c')]['fn'](_0xddc3('0x1d'),db[_0xddc3('0x1c')]['fn']('IF',db[_0xddc3('0x1c')][_0xddc3('0x20')](_0xddc3('0x3c')))),_0xddc3('0x3d')],[db[_0xddc3('0x1c')]['fn'](_0xddc3('0x1d'),db[_0xddc3('0x1c')]['fn']('IF',db[_0xddc3('0x1c')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0xddc3('0x1c')]['fn'](_0xddc3('0x1d'),db[_0xddc3('0x1c')]['fn']('IF',db[_0xddc3('0x1c')]['literal'](_0xddc3('0x3e')))),_0xddc3('0x3d')],[db[_0xddc3('0x1c')]['fn']('COUNT',db[_0xddc3('0x1c')]['fn']('IF',db[_0xddc3('0x1c')][_0xddc3('0x20')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xddc3('0x3f')]],'group':[_0xddc3('0x29')]})[_0xddc3('0xb')](function(_0x18dcde){logger[_0xddc3('0xc')](_0xddc3('0x40'),_0x27edad);logger[_0xddc3('0xe')](_0xddc3('0x40'),_0x27edad,JSON['stringify'](_0x18dcde));_0x564629(_0x18dcde);})['catch'](function(_0x1a641b){logger[_0xddc3('0x10')]('GetVoiceQueueHopperHistory',_0x1a641b[_0xddc3('0x13')],_0x27edad);_0x32f46a(_0x5e30a9['error'](0x1f4,_0x1a641b[_0xddc3('0x13')]));});});};exports[_0xddc3('0x41')]=function(_0x144450){var _0x48a1ba=this;return new Promise(function(_0x3c37d5,_0x560723){return db[_0xddc3('0x18')][_0xddc3('0x19')]({'raw':_0x144450[_0xddc3('0x16')]?_0x144450[_0xddc3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x144450[_0xddc3('0x16')]?_0x144450[_0xddc3('0x16')][_0xddc3('0x1b')]||null:null,'attributes':[[_0xddc3('0x29'),_0xddc3('0x2a')],[db[_0xddc3('0x1c')]['fn'](_0xddc3('0x1d'),db['sequelize']['col']('id')),_0xddc3('0x42')],[db[_0xddc3('0x1c')]['fn']('COUNT',db[_0xddc3('0x1c')]['fn']('IF',db['sequelize'][_0xddc3('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xddc3('0x43')]],'group':[_0xddc3('0x29')]})[_0xddc3('0xb')](function(_0x19ea31){logger['info'](_0xddc3('0x41'),_0x144450);logger['debug']('GetCampaignHopperHistory',_0x144450,JSON['stringify'](_0x19ea31));_0x3c37d5(_0x19ea31);})[_0xddc3('0x44')](function(_0x3e4c9d){logger[_0xddc3('0x10')](_0xddc3('0x41'),_0x3e4c9d['message'],_0x144450);_0x560723(_0x48a1ba['error'](0x1f4,_0x3e4c9d['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 876ed5b..9b6ac08 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 _0x5a7a=['describe','show','post','create','put','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated'];(function(_0x215f2c,_0x4dbda1){var _0x193f9d=function(_0x4f3b3f){while(--_0x4f3b3f){_0x215f2c['push'](_0x215f2c['shift']());}};_0x193f9d(++_0x4dbda1);}(_0x5a7a,0x16a));var _0xa5a7=function(_0x3856d8,_0x1924aa){_0x3856d8=_0x3856d8-0x0;var _0x436991=_0x5a7a[_0x3856d8];return _0x436991;};'use strict';var multer=require(_0xa5a7('0x0'));var util=require(_0xa5a7('0x1'));var path=require(_0xa5a7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa5a7('0x3')]();var fs_extra=require(_0xa5a7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa5a7('0x5'));var config=require(_0xa5a7('0x6'));var controller=require(_0xa5a7('0x7'));router[_0xa5a7('0x8')]('/',auth['isAuthenticated'](),controller[_0xa5a7('0x9')]);router[_0xa5a7('0x8')](_0xa5a7('0xa'),auth[_0xa5a7('0xb')](),controller[_0xa5a7('0xc')]);router['get']('/:id',auth[_0xa5a7('0xb')](),controller[_0xa5a7('0xd')]);router[_0xa5a7('0xe')]('/',auth[_0xa5a7('0xb')](),controller[_0xa5a7('0xf')]);router[_0xa5a7('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x3e71=['../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','describe','/:id','isAuthenticated','post','create','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x216687,_0x22dc4c){var _0xd1a759=function(_0x47fa38){while(--_0x47fa38){_0x216687['push'](_0x216687['shift']());}};_0xd1a759(++_0x22dc4c);}(_0x3e71,0x1ed));var _0x13e7=function(_0x5dc8a5,_0x3a97c6){_0x5dc8a5=_0x5dc8a5-0x0;var _0x4d1301=_0x3e71[_0x5dc8a5];return _0x4d1301;};'use strict';var multer=require(_0x13e7('0x0'));var util=require('util');var path=require(_0x13e7('0x1'));var timeout=require(_0x13e7('0x2'));var express=require(_0x13e7('0x3'));var router=express[_0x13e7('0x4')]();var fs_extra=require(_0x13e7('0x5'));var auth=require(_0x13e7('0x6'));var interaction=require(_0x13e7('0x7'));var config=require(_0x13e7('0x8'));var controller=require(_0x13e7('0x9'));router[_0x13e7('0xa')]('/',auth['isAuthenticated'](),controller[_0x13e7('0xb')]);router[_0x13e7('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x13e7('0xc')]);router[_0x13e7('0xa')](_0x13e7('0xd'),auth[_0x13e7('0xe')](),controller['show']);router[_0x13e7('0xf')]('/',auth[_0x13e7('0xe')](),controller[_0x13e7('0x10')]);router[_0x13e7('0x11')](_0x13e7('0xd'),auth[_0x13e7('0xe')](),controller[_0x13e7('0x12')]);module[_0x13e7('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 08da0cf..6d038e5 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 _0x3a5e=['sequelize','exports','STRING','name'];(function(_0x11c1a1,_0x17ba8c){var _0x483746=function(_0x5253c3){while(--_0x5253c3){_0x11c1a1['push'](_0x11c1a1['shift']());}};_0x483746(++_0x17ba8c);}(_0x3a5e,0x14c));var _0xe3a5=function(_0x1a6156,_0x1e7722){_0x1a6156=_0x1a6156-0x0;var _0x559292=_0x3a5e[_0x1a6156];return _0x559292;};'use strict';var Sequelize=require(_0xe3a5('0x0'));module[_0xe3a5('0x1')]={'name':{'type':Sequelize[_0xe3a5('0x2')],'unique':_0xe3a5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe3a5('0x2')]},'dialPrefix':{'type':Sequelize[_0xe3a5('0x2')]}}; \ No newline at end of file +var _0x3685=['STRING','name','sequelize'];(function(_0x5c7053,_0x38ed2c){var _0x7893a=function(_0xfa6ce0){while(--_0xfa6ce0){_0x5c7053['push'](_0x5c7053['shift']());}};_0x7893a(++_0x38ed2c);}(_0x3685,0xf8));var _0x5368=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3685[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x5368('0x0'));module['exports']={'name':{'type':Sequelize[_0x5368('0x1')],'unique':_0x5368('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5368('0x1')]},'dialPrefix':{'type':Sequelize[_0x5368('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 5de7246..0cbcfa6 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 _0x549a=['fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','findOne','hasOwnProperty','findAll','rows','removeDispositions','ids','tags','join','isArray','push','CmContact','omit','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','format','cf_%d','raw','alias','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','customField_','select','item','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','cm_contact_has_items','description_additionalPhone_','toString','each','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','number','INTEGER','Sequelize','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','User','info','spread','zip-dir'];(function(_0x1a0ea3,_0x43d52c){var _0x16a746=function(_0x126bd9){while(--_0x126bd9){_0x1a0ea3['push'](_0x1a0ea3['shift']());}};_0x16a746(++_0x43d52c);}(_0x549a,0x1e8));var _0xa549=function(_0xe14fe9,_0x19aa8e){_0xe14fe9=_0xe14fe9-0x0;var _0x1c1498=_0x549a[_0xe14fe9];return _0x1c1498;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa549('0x0'));var jsonpatch=require(_0xa549('0x1'));var rp=require(_0xa549('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa549('0x3'));var util=require(_0xa549('0x4'));var path=require(_0xa549('0x5'));var sox=require(_0xa549('0x6'));var csv=require('to-csv');var ejs=require(_0xa549('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa549('0x8'));var squel=require(_0xa549('0x9'));var crypto=require('crypto');var jsforce=require(_0xa549('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa549('0xb'));var Redis=require(_0xa549('0xc'));var authService=require(_0xa549('0xd'));var qs=require(_0xa549('0xe'));var as=require(_0xa549('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa549('0x10'))('api');var utils=require(_0xa549('0x11'));var config=require(_0xa549('0x12'));var licenseUtil=require(_0xa549('0x13'));var db=require(_0xa549('0x14'))['db'];var csv_results;config[_0xa549('0x15')]=_[_0xa549('0x16')](config[_0xa549('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa549('0x15')]));require(_0xa549('0x17'))[_0xa549('0x18')](socket);function respondWithStatusCode(_0x31264e,_0x2b446a){_0x2b446a=_0x2b446a||0xcc;return function(_0x33bc69){if(_0x33bc69){return _0x31264e[_0xa549('0x19')](_0x2b446a);}return _0x31264e[_0xa549('0x1a')](_0x2b446a)[_0xa549('0x1b')]();};}function respondWithResult(_0x5d5e87,_0x273ad0){_0x273ad0=_0x273ad0||0xc8;return function(_0x30faa7){if(_0x30faa7){return _0x5d5e87[_0xa549('0x1a')](_0x273ad0)[_0xa549('0x1c')](_0x30faa7);}};}function respondWithFilteredResult(_0x1fc80f,_0x4f9b71){return function(_0x42f36f){if(_0x42f36f){var _0x283efe=typeof _0x4f9b71[_0xa549('0x1d')]===_0xa549('0x1e')&&typeof _0x4f9b71[_0xa549('0x1f')]===_0xa549('0x1e');var _0x468f36=_0x42f36f[_0xa549('0x20')];var _0x1692d9=_0x283efe?0x0:_0x4f9b71['offset'];var _0x4e9f77=_0x283efe?_0x42f36f['count']:_0x4f9b71[_0xa549('0x1d')]+_0x4f9b71[_0xa549('0x1f')];var _0x3644ca;if(_0x4e9f77>=_0x468f36){_0x4e9f77=_0x468f36;_0x3644ca=0xc8;}else{_0x3644ca=0xce;}_0x1fc80f['status'](_0x3644ca);return _0x1fc80f['set'](_0xa549('0x21'),_0x1692d9+'-'+_0x4e9f77+'/'+_0x468f36)[_0xa549('0x1c')](_0x42f36f);}return null;};}function patchUpdates(_0x244a38){return function(_0x544ea5){try{jsonpatch[_0xa549('0x22')](_0x544ea5,_0x244a38,!![]);}catch(_0x2acf39){return BPromise['reject'](_0x2acf39);}return _0x544ea5[_0xa549('0x23')]();};}function saveUpdates(_0x197adf,_0x25cba4){return function(_0x3bded2){if(_0x3bded2){return _0x3bded2[_0xa549('0x24')](_0x197adf)[_0xa549('0x25')](function(_0x1fe128){return _0x1fe128;});}return null;};}function removeEntity(_0x14ab30,_0x6a0f4a){return function(_0x57c2a3){if(_0x57c2a3){return _0x57c2a3[_0xa549('0x26')]()[_0xa549('0x25')](function(){var _0x22f1fd=_0x57c2a3[_0xa549('0x27')]({'plain':!![]});var _0x46165c=_0xa549('0x28');return db[_0xa549('0x29')][_0xa549('0x26')]({'where':{'type':_0x46165c,'resourceId':_0x22f1fd['id']}})[_0xa549('0x25')](function(){return _0x57c2a3;});})['then'](function(){_0x14ab30[_0xa549('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f8eb5,_0x5746c7){return function(_0x475d17){if(!_0x475d17){_0x4f8eb5['sendStatus'](0x194);}return _0x475d17;};}function handleError(_0x22a787,_0x1335b2){_0x1335b2=_0x1335b2||0x1f4;return function(_0x54c733){logger[_0xa549('0x2a')](_0x54c733[_0xa549('0x2b')]);if(_0x54c733[_0xa549('0x2c')]){delete _0x54c733[_0xa549('0x2c')];}_0x22a787[_0xa549('0x1a')](_0x1335b2)[_0xa549('0x2d')](_0x54c733);};}exports[_0xa549('0x2e')]=function(_0x43ee35,_0x4dc6f0){var _0x23d81e={},_0x1e1cd6={},_0xc01aca={'count':0x0,'rows':[]};var _0x9fcd0a=_[_0xa549('0x2f')](db[_0xa549('0x30')][_0xa549('0x31')],function(_0xfd8ca2){return{'name':_0xfd8ca2[_0xa549('0x32')],'type':_0xfd8ca2[_0xa549('0x33')][_0xa549('0x34')]};});_0x1e1cd6['model']=_[_0xa549('0x2f')](_0x9fcd0a,_0xa549('0x2c'));_0x1e1cd6[_0xa549('0x35')]=_[_0xa549('0x36')](_0x43ee35['query']);_0x1e1cd6[_0xa549('0x37')]=_['intersection'](_0x1e1cd6[_0xa549('0x38')],_0x1e1cd6[_0xa549('0x35')]);_0x23d81e[_0xa549('0x39')]=_[_0xa549('0x3a')](_0x1e1cd6[_0xa549('0x38')],qs[_0xa549('0x3b')](_0x43ee35[_0xa549('0x35')][_0xa549('0x3b')]));_0x23d81e['attributes']=_0x23d81e[_0xa549('0x39')][_0xa549('0x3c')]?_0x23d81e['attributes']:_0x1e1cd6[_0xa549('0x38')];if(!_0x43ee35['query']['hasOwnProperty'](_0xa549('0x3d'))){_0x23d81e[_0xa549('0x1f')]=qs[_0xa549('0x1f')](_0x43ee35[_0xa549('0x35')]['limit']);_0x23d81e['offset']=qs[_0xa549('0x1d')](_0x43ee35[_0xa549('0x35')][_0xa549('0x1d')]);}_0x23d81e[_0xa549('0x3e')]=qs[_0xa549('0x3f')](_0x43ee35[_0xa549('0x35')][_0xa549('0x3f')]);_0x23d81e['where']=qs[_0xa549('0x37')](_[_0xa549('0x40')](_0x43ee35[_0xa549('0x35')],_0x1e1cd6['filters']),_0x9fcd0a);if(_0x43ee35[_0xa549('0x35')][_0xa549('0x41')]){_0x23d81e[_0xa549('0x42')]=_[_0xa549('0x43')](_0x23d81e['where'],{'$or':_[_0xa549('0x2f')](_0x9fcd0a,function(_0x19ba82){if(_0x19ba82[_0xa549('0x33')]!==_0xa549('0x44')){var _0x8f70d={};_0x8f70d[_0x19ba82[_0xa549('0x2c')]]={'$like':'%'+_0x43ee35['query'][_0xa549('0x41')]+'%'};return _0x8f70d;}})});}_0x23d81e=_[_0xa549('0x43')]({},_0x23d81e,_0x43ee35[_0xa549('0x45')]);var _0x2d4753={'where':_0x23d81e[_0xa549('0x42')]};return db['CmList'][_0xa549('0x20')](_0x2d4753)[_0xa549('0x25')](function(_0x211f83){_0xc01aca[_0xa549('0x20')]=_0x211f83;if(_0x43ee35['query'][_0xa549('0x46')]){_0x23d81e[_0xa549('0x47')]=[{'all':!![]}];}return db[_0xa549('0x30')]['findAll'](_0x23d81e);})[_0xa549('0x25')](function(_0x3b3bff){_0xc01aca['rows']=_0x3b3bff;return _0xc01aca;})['then'](respondWithFilteredResult(_0x4dc6f0,_0x23d81e))[_0xa549('0x48')](handleError(_0x4dc6f0,null));};exports[_0xa549('0x49')]=function(_0x4987d4,_0x549b45){var _0x2a83a9={'raw':![],'where':{'id':_0x4987d4[_0xa549('0x4a')]['id']}},_0x7dd30={};_0x7dd30[_0xa549('0x38')]=_['keys'](db['CmList'][_0xa549('0x31')]);_0x7dd30[_0xa549('0x35')]=_[_0xa549('0x36')](_0x4987d4['query']);_0x7dd30[_0xa549('0x37')]=_['intersection'](_0x7dd30[_0xa549('0x38')],_0x7dd30[_0xa549('0x35')]);_0x2a83a9[_0xa549('0x39')]=_[_0xa549('0x3a')](_0x7dd30[_0xa549('0x38')],qs[_0xa549('0x3b')](_0x4987d4[_0xa549('0x35')]['fields']));_0x2a83a9[_0xa549('0x39')]=_0x2a83a9[_0xa549('0x39')][_0xa549('0x3c')]?_0x2a83a9[_0xa549('0x39')]:_0x7dd30[_0xa549('0x38')];if(_0x4987d4[_0xa549('0x35')]['includeAll']){_0x2a83a9[_0xa549('0x47')]=[{'all':!![]}];}_0x2a83a9=_[_0xa549('0x43')]({},_0x2a83a9,_0x4987d4[_0xa549('0x45')]);return db['CmList'][_0xa549('0x4b')](_0x2a83a9)['then'](handleEntityNotFound(_0x549b45,null))[_0xa549('0x25')](respondWithResult(_0x549b45,null))[_0xa549('0x48')](handleError(_0x549b45,null));};exports[_0xa549('0x4c')]=function(_0x161a20,_0x5bb164){return db[_0xa549('0x30')][_0xa549('0x4c')](_0x161a20[_0xa549('0x4d')],{})[_0xa549('0x25')](function(_0x16a67c){var _0x379741=_0x161a20[_0xa549('0x4e')]['get']({'plain':!![]});if(!_0x379741)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x379741[_0xa549('0x4f')]==='user'){var _0x13aa4a=_0x16a67c[_0xa549('0x27')]({'plain':!![]});var _0x2f19aa='Lists';return db[_0xa549('0x50')][_0xa549('0x4b')]({'where':{'name':_0x2f19aa,'userProfileId':_0x379741[_0xa549('0x51')]},'raw':!![]})[_0xa549('0x25')](function(_0x3afd19){if(_0x3afd19&&_0x3afd19[_0xa549('0x52')]===0x0){return db[_0xa549('0x29')][_0xa549('0x4c')]({'name':_0x13aa4a[_0xa549('0x2c')],'resourceId':_0x13aa4a['id'],'type':_0x3afd19[_0xa549('0x2c')],'sectionId':_0x3afd19['id']},{})[_0xa549('0x25')](function(){return _0x16a67c;});}else{return _0x16a67c;}})[_0xa549('0x48')](function(_0x4c9eed){logger[_0xa549('0x2a')](_0xa549('0x53'),_0x4c9eed);throw _0x4c9eed;});}return _0x16a67c;})[_0xa549('0x25')](respondWithResult(_0x5bb164,0xc9))[_0xa549('0x48')](handleError(_0x5bb164,null));};exports[_0xa549('0x24')]=function(_0x539723,_0x279aad){if(_0x539723[_0xa549('0x4d')]['id']){delete _0x539723[_0xa549('0x4d')]['id'];}return db[_0xa549('0x30')][_0xa549('0x4b')]({'where':{'id':_0x539723[_0xa549('0x4a')]['id']}})[_0xa549('0x25')](handleEntityNotFound(_0x279aad,null))[_0xa549('0x25')](saveUpdates(_0x539723[_0xa549('0x4d')],null))[_0xa549('0x25')](respondWithResult(_0x279aad,null))['catch'](handleError(_0x279aad,null));};exports[_0xa549('0x26')]=function(_0x5bae3c,_0x2c39bc){return db[_0xa549('0x30')][_0xa549('0x4b')]({'where':{'id':_0x5bae3c[_0xa549('0x4a')]['id']}})[_0xa549('0x25')](handleEntityNotFound(_0x2c39bc,null))[_0xa549('0x25')](removeEntity(_0x2c39bc,null))[_0xa549('0x48')](handleError(_0x2c39bc,null));};exports[_0xa549('0x54')]=function(_0x228405,_0x4b98a7){return db[_0xa549('0x30')][_0xa549('0x54')]()[_0xa549('0x25')](respondWithResult(_0x4b98a7,null))[_0xa549('0x48')](handleError(_0x4b98a7,null));};exports[_0xa549('0x55')]=function(_0x4b257b,_0x3c075d,_0x25b2d2){if(_0x4b257b[_0xa549('0x4d')]['id']){delete _0x4b257b[_0xa549('0x4d')]['id'];}return db[_0xa549('0x30')]['find']({'where':{'id':_0x4b257b[_0xa549('0x4a')]['id']}})[_0xa549('0x25')](handleEntityNotFound(_0x3c075d,null))[_0xa549('0x25')](function(_0x4655a8){if(_0x4655a8){_0x4b257b[_0xa549('0x4d')][_0xa549('0x56')]=_0x4655a8['id'];return db[_0xa549('0x57')][_0xa549('0x4c')](_0x4b257b[_0xa549('0x4d')]);}})[_0xa549('0x25')](respondWithResult(_0x3c075d,null))[_0xa549('0x48')](handleError(_0x3c075d,null));};exports['getDispositions']=function(_0x21714b,_0x2fbe75,_0x2e6553){var _0x37d28c={'raw':![],'where':{}};var _0x2e4a3c={};var _0x8bd33b={'count':0x0,'rows':[]};return db[_0xa549('0x30')][_0xa549('0x58')]({'where':{'id':_0x21714b[_0xa549('0x4a')]['id']}})[_0xa549('0x25')](handleEntityNotFound(_0x2fbe75,null))[_0xa549('0x25')](function(_0x35dffe){if(_0x35dffe){_0x2e4a3c['model']=_[_0xa549('0x36')](db[_0xa549('0x57')][_0xa549('0x31')]);_0x2e4a3c[_0xa549('0x35')]=_['keys'](_0x21714b[_0xa549('0x35')]);_0x2e4a3c['filters']=_[_0xa549('0x3a')](_0x2e4a3c[_0xa549('0x38')],_0x2e4a3c['query']);_0x37d28c[_0xa549('0x39')]=_[_0xa549('0x3a')](_0x2e4a3c[_0xa549('0x38')],qs[_0xa549('0x3b')](_0x21714b[_0xa549('0x35')][_0xa549('0x3b')]));_0x37d28c[_0xa549('0x39')]=_0x37d28c['attributes']['length']?_0x37d28c['attributes']:_0x2e4a3c['model'];if(!_0x21714b[_0xa549('0x35')][_0xa549('0x59')](_0xa549('0x3d'))){_0x37d28c[_0xa549('0x1f')]=qs['limit'](_0x21714b['query']['limit']);_0x37d28c[_0xa549('0x1d')]=qs[_0xa549('0x1d')](_0x21714b[_0xa549('0x35')][_0xa549('0x1d')]);}_0x37d28c[_0xa549('0x3e')]=qs['sort'](_0x21714b[_0xa549('0x35')][_0xa549('0x3f')]);_0x37d28c[_0xa549('0x42')]=qs['filters'](_[_0xa549('0x40')](_0x21714b[_0xa549('0x35')],_0x2e4a3c[_0xa549('0x37')]));_0x37d28c[_0xa549('0x42')]['ListId']=_0x35dffe['id'];if(_0x21714b[_0xa549('0x35')][_0xa549('0x41')]){_0x37d28c[_0xa549('0x42')]=_[_0xa549('0x43')](_0x37d28c['where'],{'$or':_['map'](_0x37d28c[_0xa549('0x39')],function(_0x1ae517){var _0x1efb50={};_0x1efb50[_0x1ae517]={'$like':'%'+_0x21714b[_0xa549('0x35')][_0xa549('0x41')]+'%'};return _0x1efb50;})});}_0x37d28c=_[_0xa549('0x43')]({},_0x37d28c,_0x21714b[_0xa549('0x45')]);return db['Disposition'][_0xa549('0x20')]({'where':_0x37d28c['where']})['then'](function(_0x3d0e08){_0x8bd33b[_0xa549('0x20')]=_0x3d0e08;if(_0x21714b['query'][_0xa549('0x46')]){_0x37d28c['include']=[{'all':!![]}];}return db['Disposition'][_0xa549('0x5a')](_0x37d28c);})[_0xa549('0x25')](function(_0x31ade6){_0x8bd33b[_0xa549('0x5b')]=_0x31ade6;return _0x8bd33b;});}})['then'](respondWithFilteredResult(_0x2fbe75,_0x37d28c))['catch'](handleError(_0x2fbe75,null));};exports[_0xa549('0x5c')]=function(_0x3f977d,_0x57ca1a,_0x526f55){return db[_0xa549('0x30')]['find']({'where':{'id':_0x3f977d['params']['id']}})[_0xa549('0x25')](handleEntityNotFound(_0x57ca1a,null))[_0xa549('0x25')](function(_0x27f460){if(_0x27f460){return _0x27f460[_0xa549('0x5c')](_0x3f977d['query'][_0xa549('0x5d')]);}})['then'](respondWithStatusCode(_0x57ca1a,null))[_0xa549('0x48')](handleError(_0x57ca1a,null));};exports['addContacts']=function(_0x282796,_0x864c0,_0x7d2032){return db[_0xa549('0x30')]['find']({'where':{'id':_0x282796[_0xa549('0x4a')]['id']}})[_0xa549('0x25')](handleEntityNotFound(_0x864c0,null))[_0xa549('0x25')](function(_0x5a8fa7){if(_0x5a8fa7){var _0x4f2f66=[];var _0x7dd4ab={'success':[],'errors':[]};return db['CmContact'][_0xa549('0x54')]()[_0xa549('0x25')](function(_0x3b7aac){if(_0x282796[_0xa549('0x4d')][_0xa549('0x5e')]&&_['isArray'](_0x282796[_0xa549('0x4d')]['tags'])){if(_0x282796[_0xa549('0x4d')][_0xa549('0x5e')][_0xa549('0x3c')]){_0x282796[_0xa549('0x4d')][_0xa549('0x5e')]=_0x282796['body'][_0xa549('0x5e')][_0xa549('0x5f')](';')+';';}else{_0x282796[_0xa549('0x4d')][_0xa549('0x5e')]=null;}}else{_0x282796['body']['tags']=null;}if(_0x282796[_0xa549('0x4d')]&&_[_0xa549('0x60')](_0x282796[_0xa549('0x4d')])){for(var _0xed009c=0x0;_0xed009c<_0x282796[_0xa549('0x4d')][_0xa549('0x3c')];_0xed009c+=0x1){_0x282796['body'][_0xed009c]['ListId']=_0x282796[_0xa549('0x4a')]['id'];_0x4f2f66[_0xa549('0x61')](_0x282796['body'][_0xed009c]);}return BPromise['each'](_0x4f2f66,function(_0x54634e){return db[_0xa549('0x62')][_0xa549('0x4c')](_[_0xa549('0x63')](_0x54634e,['ids','id'])||{},{'fields':_[_0xa549('0x36')](_0x3b7aac),'raw':!![]})[_0xa549('0x25')](function(_0x5c0067){_0x7dd4ab[_0xa549('0x64')][_0xa549('0x61')](_0x5c0067['dataValues']);})['catch'](function(_0x3cb475){_0x7dd4ab[_0xa549('0x65')][_0xa549('0x61')]({'data':_0x54634e,'error':_0x3cb475[_0xa549('0x66')]});});})[_0xa549('0x25')](function(_0x5a4033){return _0x7dd4ab;})[_0xa549('0x48')](function(_0x425e35){return _0x425e35;});}else{_0x864c0[_0xa549('0x1a')](0x190)['json']({'message':_0xa549('0x67')});}});}})[_0xa549('0x25')](respondWithResult(_0x864c0,null))[_0xa549('0x48')](handleError(_0x864c0,null));};exports[_0xa549('0x68')]=function(_0x1e9663,_0x3c7d71,_0x4d37de){var _0x423032;return db['CmList'][_0xa549('0x4b')]({'where':{'id':_0x1e9663[_0xa549('0x4a')]['id']},'include':[{'model':db[_0xa549('0x69')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x3c7d71,null))[_0xa549('0x25')](function(_0x50792d){if(_0x50792d){_0x423032=_0x50792d;return db[_0xa549('0x62')][_0xa549('0x31')];}})[_0xa549('0x25')](function(_0x1a51af){if(_0x1a51af){var _0x44ebe8={};var _0x24403f={};_0x24403f[_0xa549('0x38')]=_[_0xa549('0x6a')](_['keys'](_0x1a51af),_[_0xa549('0x2f')](_0x423032['CustomFields'],function(_0x49c79a){return util[_0xa549('0x6b')](_0xa549('0x6c'),_0x49c79a['id']);}));_0x24403f[_0xa549('0x35')]=_[_0xa549('0x36')](_0x1e9663[_0xa549('0x35')]);_0x24403f[_0xa549('0x37')]=_['intersection'](_0x24403f[_0xa549('0x38')],_0x24403f[_0xa549('0x35')]);_0x44ebe8[_0xa549('0x39')]=_[_0xa549('0x3a')](_0x24403f['model'],qs[_0xa549('0x3b')](_0x1e9663[_0xa549('0x35')]['fields']));_0x44ebe8[_0xa549('0x39')]=_0x44ebe8[_0xa549('0x39')][_0xa549('0x3c')]?_0x44ebe8[_0xa549('0x39')]:_0x24403f[_0xa549('0x38')];if(!_0x1e9663[_0xa549('0x35')]['hasOwnProperty'](_0xa549('0x3d'))){_0x44ebe8[_0xa549('0x1f')]=qs[_0xa549('0x1f')](_0x1e9663['query'][_0xa549('0x1f')]);_0x44ebe8['offset']=qs[_0xa549('0x1d')](_0x1e9663['query'][_0xa549('0x1d')]);}_0x44ebe8[_0xa549('0x3e')]=qs[_0xa549('0x3f')](_0x1e9663['query'][_0xa549('0x3f')]);_0x44ebe8[_0xa549('0x42')]=qs[_0xa549('0x37')](_[_0xa549('0x40')](_0x1e9663[_0xa549('0x35')],_0x24403f[_0xa549('0x37')]));_0x44ebe8[_0xa549('0x6d')]=!![];if(_0x1e9663[_0xa549('0x35')]['filter']){_0x44ebe8[_0xa549('0x42')]=_[_0xa549('0x43')](_0x44ebe8[_0xa549('0x42')],{'$or':_['map'](_0x44ebe8['attributes'],function(_0x55b97d){var _0x4df634={};_0x4df634[_0x55b97d]={'$like':'%'+_0x1e9663[_0xa549('0x35')][_0xa549('0x41')]+'%'};return _0x4df634;})});}_0x44ebe8=_['merge']({},_0x44ebe8,_0x1e9663[_0xa549('0x45')]);return _0x423032[_0xa549('0x68')](_0x44ebe8);}})[_0xa549('0x25')](respondWithResult(_0x3c7d71,null))['catch'](handleError(_0x3c7d71,null));};exports['getContactsCsv']=function(_0x20af6f,_0x2c0d42,_0x5bc8f1){var _0x52c1f9;var _0x2ab3af;var _0x555780;var _0x280c68=_0x20af6f[_0xa549('0x4a')]['id'];csv_results=[];return db['ContactItemType'][_0xa549('0x5a')]({'attributes':['id',_0xa549('0x2c')],'raw':!![],'order':['OrderBy']})[_0xa549('0x25')](function(_0x3c2f15){_0x52c1f9=_0x3c2f15;var _0x3d65b0=_[_0xa549('0x36')](db['CmContact'][_0xa549('0x31')]);return db[_0xa549('0x69')]['findAll']({'raw':!![],'attributes':['id',_0xa549('0x6e')]})['then'](function(_0x52f474){_0x2ab3af=_0x52f474;var _0x12c54b=squel['select']()[_0xa549('0x3b')](_0x3d65b0)[_0xa549('0x6f')](_0xa549('0x70'),'c')['where'](_0xa549('0x71'),_0x280c68)[_0xa549('0x42')](_0xa549('0x72'))[_0xa549('0x73')]();for(var _0x4d54eb=0x0;_0x4d54eb<_0x2ab3af[_0xa549('0x3c')];_0x4d54eb++){_0x12c54b[_0xa549('0x74')]('c.cf_'+_0x2ab3af[_0x4d54eb]['id'],_0xa549('0x75')+_0x2ab3af[_0x4d54eb][_0xa549('0x6e')]);}for(var _0x4d54eb=0x0;_0x4d54eb<_0x52c1f9[_0xa549('0x3c')];_0x4d54eb++){_0x12c54b[_0xa549('0x74')](squel[_0xa549('0x76')]()[_0xa549('0x74')](_0xa549('0x77'))['from']('cm_contact_has_items')['where'](_0xa549('0x78'),_0x52c1f9[_0x4d54eb]['id'])[_0xa549('0x42')](_0xa549('0x79')),_0xa549('0x7a')+_0x52c1f9[_0x4d54eb][_0xa549('0x2c')]);_0x12c54b['field'](squel[_0xa549('0x76')]()[_0xa549('0x74')](_0xa549('0x7b'))['from'](_0xa549('0x7c'))[_0xa549('0x42')](_0xa549('0x78'),_0x52c1f9[_0x4d54eb]['id'])[_0xa549('0x42')](_0xa549('0x79')),_0xa549('0x7d')+_0x52c1f9[_0x4d54eb]['name']);}var _0x924537=[];_0x924537[_0xa549('0x61')](_0x12c54b[_0xa549('0x7e')]());BPromise[_0xa549('0x7f')](_0x924537,handleQuery)[_0xa549('0x25')](function(_0x30fcde){handleQuery(_0x12c54b[_0xa549('0x7e')]());var _0x2427d7=csv_results[0x0];if(!_[_0xa549('0x80')](_0x2427d7)){var _0x488124=toCsv(_0x2427d7);var _0x14fbec=Date[_0xa549('0x81')]();fs[_0xa549('0x82')](util[_0xa549('0x6b')](_0xa549('0x83'),_0x280c68,_0x14fbec),_0x488124);_0x2c0d42[_0xa549('0x84')](_0xa549('0x85'),_0xa549('0x86')+util[_0xa549('0x6b')](_0xa549('0x87'),_0x280c68,_0x14fbec));_0x2c0d42[_0xa549('0x84')](_0xa549('0x88'),_0xa549('0x89'));return _0x2c0d42[_0xa549('0x8a')](util['format'](_0xa549('0x83'),_0x280c68,_0x14fbec));}else{return _0x2c0d42[_0xa549('0x19')](0xcc);}});});});};exports[_0xa549('0x8b')]=function(_0x1c7168,_0x4eda49,_0x5770cc){var _0x24f101;delete _0x1c7168['body']['id'];return db[_0xa549('0x30')][_0xa549('0x58')]({'where':{'id':_0x1c7168[_0xa549('0x4a')]['id']}})[_0xa549('0x25')](handleEntityNotFound(_0x4eda49,null))[_0xa549('0x25')](function(_0x30ae67){if(_0x30ae67){return db[_0xa549('0x8c')][_0xa549('0x8d')](function(_0x136900){return db[_0xa549('0x69')]['create'](_0x1c7168[_0xa549('0x4d')],{'transaction':_0x136900})[_0xa549('0x25')](function(_0x1c257b){_0x24f101=_0x1c257b;return _0x30ae67[_0xa549('0x8e')](_0x1c257b,{'transaction':_0x136900});})[_0xa549('0x25')](function(){var _0x35fd6c={'type':db['Sequelize'][_0xa549('0x8f')],'transaction':_0x136900};switch(_0x1c7168['body'][_0xa549('0x33')]){case _0xa549('0x90'):_0x35fd6c[_0xa549('0x33')]=db['Sequelize']['TEXT'];break;case _0xa549('0x91'):_0x35fd6c[_0xa549('0x33')]=db['Sequelize'][_0xa549('0x92')];break;case'switch':_0x35fd6c[_0xa549('0x33')]=db[_0xa549('0x93')][_0xa549('0x94')];_0x35fd6c[_0xa549('0x95')]=![];break;default:}return db[_0xa549('0x8c')][_0xa549('0x96')][_0xa549('0x97')](_0xa549('0x70'),util['format'](_0xa549('0x98'),_0x24f101['id']),_0x35fd6c);})[_0xa549('0x25')](function(){return _0x24f101;});});}})[_0xa549('0x25')](respondWithResult(_0x4eda49,null))['catch'](handleError(_0x4eda49,null));};exports['getCustomFields']=function(_0x2ef381,_0x4d8fe5,_0x98dd18){var _0x15a028={};var _0x32e825={};var _0x4d8337;var _0x401cf0;return db['CmList'][_0xa549('0x58')]({'where':{'id':_0x2ef381[_0xa549('0x4a')]['id']}})[_0xa549('0x25')](handleEntityNotFound(_0x4d8fe5,null))['then'](function(_0x5c8859){if(_0x5c8859){_0x4d8337=_0x5c8859;_0x32e825[_0xa549('0x38')]=_['keys'](db[_0xa549('0x69')]['rawAttributes']);_0x32e825['query']=_[_0xa549('0x36')](_0x2ef381[_0xa549('0x35')]);_0x32e825[_0xa549('0x37')]=_[_0xa549('0x3a')](_0x32e825[_0xa549('0x38')],_0x32e825[_0xa549('0x35')]);_0x15a028[_0xa549('0x39')]=_[_0xa549('0x3a')](_0x32e825[_0xa549('0x38')],qs[_0xa549('0x3b')](_0x2ef381[_0xa549('0x35')]['fields']));_0x15a028[_0xa549('0x39')]=_0x15a028[_0xa549('0x39')][_0xa549('0x3c')]?_0x15a028[_0xa549('0x39')]:_0x32e825[_0xa549('0x38')];_0x15a028[_0xa549('0x3e')]=qs['sort'](_0x2ef381['query']['sort']);_0x15a028[_0xa549('0x42')]=qs['filters'](_[_0xa549('0x40')](_0x2ef381[_0xa549('0x35')],_0x32e825[_0xa549('0x37')]));_0x15a028[_0xa549('0x42')]=_[_0xa549('0x43')](_0x15a028[_0xa549('0x42')],{'$or':[{'ListId':_0x5c8859['id']},{'ListId':null}]});if(_0x2ef381[_0xa549('0x35')][_0xa549('0x41')]){_0x15a028['where']=_[_0xa549('0x43')](_0x15a028[_0xa549('0x42')],{'$or':_[_0xa549('0x2f')](_0x15a028[_0xa549('0x39')],function(_0x355423){var _0xc78239={};_0xc78239[_0x355423]={'$like':'%'+_0x2ef381[_0xa549('0x35')][_0xa549('0x41')]+'%'};return _0xc78239;})});}_0x15a028=_[_0xa549('0x43')]({},_0x15a028,_0x2ef381[_0xa549('0x45')]);return db['CmCustomField'][_0xa549('0x99')](_0x15a028);}})[_0xa549('0x25')](respondWithResult(_0x4d8fe5,null))[_0xa549('0x48')](handleError(_0x4d8fe5,null));};exports[_0xa549('0x9a')]=function(_0x4e1a9f,_0x41ebb2){return db[_0xa549('0x69')][_0xa549('0x99')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x41ebb2,null))[_0xa549('0x25')](function(_0x3d9eb7){return _0x3d9eb7;})[_0xa549('0x25')](respondWithResult(_0x41ebb2,null))[_0xa549('0x48')](handleError(_0x41ebb2,null));};exports[_0xa549('0x9b')]=function(_0xeaa11b,_0x1cea41,_0x32f766){return db[_0xa549('0x30')][_0xa549('0x4b')]({'where':{'id':_0xeaa11b[_0xa549('0x4a')]['id']}})[_0xa549('0x25')](handleEntityNotFound(_0x1cea41,null))[_0xa549('0x25')](function(_0x4254ea){if(_0x4254ea){return _0x4254ea[_0xa549('0x9b')](_0xeaa11b['body'][_0xa549('0x5d')],_[_0xa549('0x63')](_0xeaa11b['body'],[_0xa549('0x5d'),'id'])||{})['spread'](function(_0x2328f5){for(var _0x24078b=0x0;_0x24078b<_0xeaa11b['body'][_0xa549('0x5d')][_0xa549('0x3c')];_0x24078b+=0x1){socket[_0xa549('0x9c')](_0xa549('0x9d'),{'UserId':Number(_0xeaa11b[_0xa549('0x4d')][_0xa549('0x5d')][_0x24078b]),'CmListId':Number(_0xeaa11b[_0xa549('0x4a')]['id'])});}return _0x2328f5;});}})[_0xa549('0x25')](respondWithResult(_0x1cea41,null))[_0xa549('0x48')](handleError(_0x1cea41,null));};exports[_0xa549('0x9e')]=function(_0x2b4a7c,_0xba0d6b,_0x88df8b){return db['CmList'][_0xa549('0x4b')]({'where':{'id':_0x2b4a7c['params']['id']}})['then'](handleEntityNotFound(_0xba0d6b,null))[_0xa549('0x25')](function(_0x230fd7){if(_0x230fd7){return _0x230fd7[_0xa549('0x9e')](_0x2b4a7c[_0xa549('0x35')]['ids'])['then'](function(){if(_['isArray'](_0x2b4a7c[_0xa549('0x35')][_0xa549('0x5d')])){for(var _0x2ef510=0x0;_0x2ef510<_0x2b4a7c[_0xa549('0x35')]['ids']['length'];_0x2ef510+=0x1){socket['emit'](_0xa549('0x9f'),{'UserId':Number(_0x2b4a7c[_0xa549('0x35')]['ids'][_0x2ef510]),'CmListId':Number(_0x2b4a7c[_0xa549('0x4a')]['id'])});}}else{socket[_0xa549('0x9c')]('userCmList:remove',{'UserId':Number(_0x2b4a7c['query'][_0xa549('0x5d')]),'CmListId':Number(_0x2b4a7c[_0xa549('0x4a')]['id'])});}});}})[_0xa549('0x25')](respondWithStatusCode(_0xba0d6b,null))[_0xa549('0x48')](handleError(_0xba0d6b,null));};exports['getAgents']=function(_0x59e691,_0x3f744c,_0x10953a){var _0x39f930={};var _0xa9fdb1={};var _0x1b3a92;var _0x37104c;return db[_0xa549('0x30')]['findOne']({'where':{'id':_0x59e691['params']['id']}})['then'](handleEntityNotFound(_0x3f744c,null))['then'](function(_0x4362e9){if(_0x4362e9){_0x1b3a92=_0x4362e9;_0xa9fdb1[_0xa549('0x38')]=_[_0xa549('0x36')](db[_0xa549('0xa0')][_0xa549('0x31')]);_0xa9fdb1[_0xa549('0x35')]=_[_0xa549('0x36')](_0x59e691[_0xa549('0x35')]);_0xa9fdb1['filters']=_[_0xa549('0x3a')](_0xa9fdb1[_0xa549('0x38')],_0xa9fdb1['query']);_0x39f930[_0xa549('0x39')]=_[_0xa549('0x3a')](_0xa9fdb1['model'],qs[_0xa549('0x3b')](_0x59e691['query'][_0xa549('0x3b')]));_0x39f930[_0xa549('0x39')]=_0x39f930['attributes'][_0xa549('0x3c')]?_0x39f930[_0xa549('0x39')]:_0xa9fdb1[_0xa549('0x38')];_0x39f930['order']=qs['sort'](_0x59e691[_0xa549('0x35')][_0xa549('0x3f')]);_0x39f930[_0xa549('0x42')]=qs[_0xa549('0x37')](_[_0xa549('0x40')](_0x59e691[_0xa549('0x35')],_0xa9fdb1['filters']));if(_0x59e691[_0xa549('0x35')][_0xa549('0x41')]){_0x39f930['where']=_['merge'](_0x39f930[_0xa549('0x42')],{'$or':_['map'](_0x39f930[_0xa549('0x39')],function(_0x13d1db){var _0x132eb0={};_0x132eb0[_0x13d1db]={'$like':'%'+_0x59e691['query'][_0xa549('0x41')]+'%'};return _0x132eb0;})});}_0x39f930=_[_0xa549('0x43')]({},_0x39f930,_0x59e691['options']);return _0x1b3a92['getAgents'](_0x39f930);}})[_0xa549('0x25')](function(_0x118a47){if(_0x118a47){_0x37104c=_0x118a47[_0xa549('0x3c')];if(!_0x59e691['query'][_0xa549('0x59')](_0xa549('0x3d'))){_0x39f930[_0xa549('0x1f')]=qs['limit'](_0x59e691[_0xa549('0x35')]['limit']);_0x39f930[_0xa549('0x1d')]=qs[_0xa549('0x1d')](_0x59e691[_0xa549('0x35')]['offset']);}return _0x1b3a92['getAgents'](_0x39f930);}})['then'](function(_0x57057c){if(_0x57057c){return _0x57057c?{'count':_0x37104c,'rows':_0x57057c}:null;}})[_0xa549('0x25')](respondWithResult(_0x3f744c,null))[_0xa549('0x48')](handleError(_0x3f744c,null));};function handleQuery(_0x13c409){logger[_0xa549('0xa1')](_0x13c409);return db['sequelize']['query'](_0x13c409)[_0xa549('0xa2')](function(_0x2c3b38){csv_results[_0xa549('0x61')](_0x2c3b38);})['catch'](function(_0x109c10){logger[_0xa549('0x2a')](_0x109c10['message']);});} \ No newline at end of file +var _0x06c3=['role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','ListId','Disposition','getDispositions','findOne','removeDispositions','ids','addContacts','CmContact','isArray','tags','push','each','success','dataValues','errors','message','getContacts','concat','hasOwnProperty','raw','getContactsCsv','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','addCustomField','transaction','CmCustomField','addCustomFields','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','spread','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','status','offset','count','limit','set','Content-Range','json','apply','reject','save','update','then','get','Lists','UserProfileResource','sendStatus','name','send','index','map','CmList','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x342a3e,_0x82ee7b){var _0x2d8605=function(_0x256141){while(--_0x256141){_0x342a3e['push'](_0x342a3e['shift']());}};_0x2d8605(++_0x82ee7b);}(_0x06c3,0xf2));var _0x306c=function(_0x493329,_0x31251c){_0x493329=_0x493329-0x0;var _0x429b36=_0x06c3[_0x493329];return _0x429b36;};'use strict';var emlformat=require(_0x306c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x306c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x306c('0x2'));var moment=require(_0x306c('0x3'));var BPromise=require(_0x306c('0x4'));var Mustache=require('mustache');var util=require(_0x306c('0x5'));var path=require(_0x306c('0x6'));var sox=require('sox');var csv=require(_0x306c('0x7'));var ejs=require(_0x306c('0x8'));var fs=require('fs');var fs_extra=require(_0x306c('0x9'));var _=require(_0x306c('0xa'));var squel=require(_0x306c('0xb'));var crypto=require(_0x306c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x306c('0xd'));var toCsv=require(_0x306c('0x7'));var querystring=require(_0x306c('0xe'));var Papa=require('papaparse');var Redis=require(_0x306c('0xf'));var authService=require(_0x306c('0x10'));var qs=require(_0x306c('0x11'));var as=require(_0x306c('0x12'));var hardwareService=require(_0x306c('0x13'));var logger=require('../../config/logger')(_0x306c('0x14'));var utils=require('../../config/utils');var config=require(_0x306c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x306c('0x16'))['db'];var csv_results;config[_0x306c('0x17')]=_[_0x306c('0x18')](config[_0x306c('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x306c('0x19'))(new Redis(config[_0x306c('0x17')]));require(_0x306c('0x1a'))[_0x306c('0x1b')](socket);function respondWithStatusCode(_0x4de53e,_0x442a35){_0x442a35=_0x442a35||0xcc;return function(_0x57d03a){if(_0x57d03a){return _0x4de53e['sendStatus'](_0x442a35);}return _0x4de53e[_0x306c('0x1c')](_0x442a35)['end']();};}function respondWithResult(_0x380cf6,_0x11d603){_0x11d603=_0x11d603||0xc8;return function(_0x3c746e){if(_0x3c746e){return _0x380cf6[_0x306c('0x1c')](_0x11d603)['json'](_0x3c746e);}};}function respondWithFilteredResult(_0x2ce46b,_0x5ba9c9){return function(_0x9dc0dc){if(_0x9dc0dc){var _0xa86b99=typeof _0x5ba9c9[_0x306c('0x1d')]==='undefined'&&typeof _0x5ba9c9['limit']==='undefined';var _0x47db9f=_0x9dc0dc[_0x306c('0x1e')];var _0x1ac665=_0xa86b99?0x0:_0x5ba9c9[_0x306c('0x1d')];var _0x41f54c=_0xa86b99?_0x9dc0dc['count']:_0x5ba9c9[_0x306c('0x1d')]+_0x5ba9c9[_0x306c('0x1f')];var _0x4aea38;if(_0x41f54c>=_0x47db9f){_0x41f54c=_0x47db9f;_0x4aea38=0xc8;}else{_0x4aea38=0xce;}_0x2ce46b[_0x306c('0x1c')](_0x4aea38);return _0x2ce46b[_0x306c('0x20')](_0x306c('0x21'),_0x1ac665+'-'+_0x41f54c+'/'+_0x47db9f)[_0x306c('0x22')](_0x9dc0dc);}return null;};}function patchUpdates(_0x389ec6){return function(_0x3bef78){try{jsonpatch[_0x306c('0x23')](_0x3bef78,_0x389ec6,!![]);}catch(_0x685285){return BPromise[_0x306c('0x24')](_0x685285);}return _0x3bef78[_0x306c('0x25')]();};}function saveUpdates(_0x45b5d4,_0x34b1bb){return function(_0x447b18){if(_0x447b18){return _0x447b18[_0x306c('0x26')](_0x45b5d4)[_0x306c('0x27')](function(_0x2f2f9e){return _0x2f2f9e;});}return null;};}function removeEntity(_0x425c92,_0x2db617){return function(_0x24ddbc){if(_0x24ddbc){return _0x24ddbc['destroy']()[_0x306c('0x27')](function(){var _0x1e0292=_0x24ddbc[_0x306c('0x28')]({'plain':!![]});var _0x4f6d3b=_0x306c('0x29');return db[_0x306c('0x2a')]['destroy']({'where':{'type':_0x4f6d3b,'resourceId':_0x1e0292['id']}})[_0x306c('0x27')](function(){return _0x24ddbc;});})['then'](function(){_0x425c92[_0x306c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a183a,_0x29248d){return function(_0x22eb7e){if(!_0x22eb7e){_0x4a183a[_0x306c('0x2b')](0x194);}return _0x22eb7e;};}function handleError(_0xa612cf,_0x48e4f4){_0x48e4f4=_0x48e4f4||0x1f4;return function(_0x4c1b54){logger['error'](_0x4c1b54['stack']);if(_0x4c1b54[_0x306c('0x2c')]){delete _0x4c1b54['name'];}_0xa612cf[_0x306c('0x1c')](_0x48e4f4)[_0x306c('0x2d')](_0x4c1b54);};}exports[_0x306c('0x2e')]=function(_0xfc7f79,_0x1d45ff){var _0x3f39a0={},_0x4b1bf3={},_0x28bd48={'count':0x0,'rows':[]};var _0x1f027f=_[_0x306c('0x2f')](db[_0x306c('0x30')][_0x306c('0x31')],function(_0xd7037c){return{'name':_0xd7037c[_0x306c('0x32')],'type':_0xd7037c['type'][_0x306c('0x33')]};});_0x4b1bf3[_0x306c('0x34')]=_[_0x306c('0x2f')](_0x1f027f,_0x306c('0x2c'));_0x4b1bf3[_0x306c('0x35')]=_[_0x306c('0x36')](_0xfc7f79[_0x306c('0x35')]);_0x4b1bf3['filters']=_[_0x306c('0x37')](_0x4b1bf3[_0x306c('0x34')],_0x4b1bf3['query']);_0x3f39a0[_0x306c('0x38')]=_[_0x306c('0x37')](_0x4b1bf3[_0x306c('0x34')],qs[_0x306c('0x39')](_0xfc7f79['query']['fields']));_0x3f39a0[_0x306c('0x38')]=_0x3f39a0['attributes']['length']?_0x3f39a0['attributes']:_0x4b1bf3['model'];if(!_0xfc7f79[_0x306c('0x35')]['hasOwnProperty'](_0x306c('0x3a'))){_0x3f39a0[_0x306c('0x1f')]=qs[_0x306c('0x1f')](_0xfc7f79['query']['limit']);_0x3f39a0[_0x306c('0x1d')]=qs[_0x306c('0x1d')](_0xfc7f79['query'][_0x306c('0x1d')]);}_0x3f39a0[_0x306c('0x3b')]=qs[_0x306c('0x3c')](_0xfc7f79['query'][_0x306c('0x3c')]);_0x3f39a0[_0x306c('0x3d')]=qs[_0x306c('0x3e')](_[_0x306c('0x3f')](_0xfc7f79['query'],_0x4b1bf3[_0x306c('0x3e')]),_0x1f027f);if(_0xfc7f79[_0x306c('0x35')][_0x306c('0x40')]){_0x3f39a0[_0x306c('0x3d')]=_[_0x306c('0x41')](_0x3f39a0['where'],{'$or':_[_0x306c('0x2f')](_0x1f027f,function(_0x2535c0){if(_0x2535c0[_0x306c('0x42')]!==_0x306c('0x43')){var _0x4000e1={};_0x4000e1[_0x2535c0[_0x306c('0x2c')]]={'$like':'%'+_0xfc7f79[_0x306c('0x35')][_0x306c('0x40')]+'%'};return _0x4000e1;}})});}_0x3f39a0=_['merge']({},_0x3f39a0,_0xfc7f79[_0x306c('0x44')]);var _0xc8ac45={'where':_0x3f39a0[_0x306c('0x3d')]};return db[_0x306c('0x30')]['count'](_0xc8ac45)['then'](function(_0x372405){_0x28bd48[_0x306c('0x1e')]=_0x372405;if(_0xfc7f79[_0x306c('0x35')][_0x306c('0x45')]){_0x3f39a0[_0x306c('0x46')]=[{'all':!![]}];}return db[_0x306c('0x30')][_0x306c('0x47')](_0x3f39a0);})[_0x306c('0x27')](function(_0x2c12c9){_0x28bd48[_0x306c('0x48')]=_0x2c12c9;return _0x28bd48;})['then'](respondWithFilteredResult(_0x1d45ff,_0x3f39a0))[_0x306c('0x49')](handleError(_0x1d45ff,null));};exports[_0x306c('0x4a')]=function(_0x55afcf,_0x309dfd){var _0x4ff28f={'raw':![],'where':{'id':_0x55afcf[_0x306c('0x4b')]['id']}},_0x241cd6={};_0x241cd6[_0x306c('0x34')]=_[_0x306c('0x36')](db[_0x306c('0x30')]['rawAttributes']);_0x241cd6['query']=_['keys'](_0x55afcf[_0x306c('0x35')]);_0x241cd6['filters']=_[_0x306c('0x37')](_0x241cd6[_0x306c('0x34')],_0x241cd6[_0x306c('0x35')]);_0x4ff28f[_0x306c('0x38')]=_[_0x306c('0x37')](_0x241cd6[_0x306c('0x34')],qs[_0x306c('0x39')](_0x55afcf[_0x306c('0x35')][_0x306c('0x39')]));_0x4ff28f['attributes']=_0x4ff28f[_0x306c('0x38')][_0x306c('0x4c')]?_0x4ff28f[_0x306c('0x38')]:_0x241cd6[_0x306c('0x34')];if(_0x55afcf[_0x306c('0x35')][_0x306c('0x45')]){_0x4ff28f[_0x306c('0x46')]=[{'all':!![]}];}_0x4ff28f=_['merge']({},_0x4ff28f,_0x55afcf[_0x306c('0x44')]);return db[_0x306c('0x30')][_0x306c('0x4d')](_0x4ff28f)[_0x306c('0x27')](handleEntityNotFound(_0x309dfd,null))['then'](respondWithResult(_0x309dfd,null))[_0x306c('0x49')](handleError(_0x309dfd,null));};exports[_0x306c('0x4e')]=function(_0x4d0859,_0x5d727e){return db['CmList'][_0x306c('0x4e')](_0x4d0859[_0x306c('0x4f')],{})[_0x306c('0x27')](function(_0x5955ec){var _0x21c1ad=_0x4d0859[_0x306c('0x50')][_0x306c('0x28')]({'plain':!![]});if(!_0x21c1ad)throw new Error(_0x306c('0x51'));if(_0x21c1ad[_0x306c('0x52')]===_0x306c('0x50')){var _0x2c58c8=_0x5955ec[_0x306c('0x28')]({'plain':!![]});var _0x307175=_0x306c('0x29');return db[_0x306c('0x53')]['find']({'where':{'name':_0x307175,'userProfileId':_0x21c1ad[_0x306c('0x54')]},'raw':!![]})[_0x306c('0x27')](function(_0x5863bb){if(_0x5863bb&&_0x5863bb[_0x306c('0x55')]===0x0){return db[_0x306c('0x2a')][_0x306c('0x4e')]({'name':_0x2c58c8[_0x306c('0x2c')],'resourceId':_0x2c58c8['id'],'type':_0x5863bb[_0x306c('0x2c')],'sectionId':_0x5863bb['id']},{})[_0x306c('0x27')](function(){return _0x5955ec;});}else{return _0x5955ec;}})['catch'](function(_0x464a8c){logger[_0x306c('0x56')](_0x306c('0x57'),_0x464a8c);throw _0x464a8c;});}return _0x5955ec;})[_0x306c('0x27')](respondWithResult(_0x5d727e,0xc9))[_0x306c('0x49')](handleError(_0x5d727e,null));};exports[_0x306c('0x26')]=function(_0x393cf1,_0x33c61d){if(_0x393cf1['body']['id']){delete _0x393cf1[_0x306c('0x4f')]['id'];}return db[_0x306c('0x30')][_0x306c('0x4d')]({'where':{'id':_0x393cf1[_0x306c('0x4b')]['id']}})[_0x306c('0x27')](handleEntityNotFound(_0x33c61d,null))[_0x306c('0x27')](saveUpdates(_0x393cf1[_0x306c('0x4f')],null))[_0x306c('0x27')](respondWithResult(_0x33c61d,null))[_0x306c('0x49')](handleError(_0x33c61d,null));};exports[_0x306c('0x58')]=function(_0x354841,_0x324dcb){return db['CmList'][_0x306c('0x4d')]({'where':{'id':_0x354841[_0x306c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x324dcb,null))['then'](removeEntity(_0x324dcb,null))['catch'](handleError(_0x324dcb,null));};exports['describe']=function(_0x5a6256,_0x10c1f8){return db[_0x306c('0x30')][_0x306c('0x59')]()[_0x306c('0x27')](respondWithResult(_0x10c1f8,null))[_0x306c('0x49')](handleError(_0x10c1f8,null));};exports[_0x306c('0x5a')]=function(_0x5e7669,_0x1c1bcb,_0x5c70d0){if(_0x5e7669[_0x306c('0x4f')]['id']){delete _0x5e7669['body']['id'];}return db[_0x306c('0x30')]['find']({'where':{'id':_0x5e7669[_0x306c('0x4b')]['id']}})[_0x306c('0x27')](handleEntityNotFound(_0x1c1bcb,null))['then'](function(_0x3cb674){if(_0x3cb674){_0x5e7669[_0x306c('0x4f')][_0x306c('0x5b')]=_0x3cb674['id'];return db[_0x306c('0x5c')][_0x306c('0x4e')](_0x5e7669[_0x306c('0x4f')]);}})[_0x306c('0x27')](respondWithResult(_0x1c1bcb,null))[_0x306c('0x49')](handleError(_0x1c1bcb,null));};exports[_0x306c('0x5d')]=function(_0x35012a,_0x12ad4f,_0xc0dc0a){var _0x224408={'raw':![],'where':{}};var _0x497f83={};var _0x22a17c={'count':0x0,'rows':[]};return db[_0x306c('0x30')][_0x306c('0x5e')]({'where':{'id':_0x35012a[_0x306c('0x4b')]['id']}})[_0x306c('0x27')](handleEntityNotFound(_0x12ad4f,null))['then'](function(_0x30ea7e){if(_0x30ea7e){_0x497f83[_0x306c('0x34')]=_['keys'](db['Disposition'][_0x306c('0x31')]);_0x497f83[_0x306c('0x35')]=_[_0x306c('0x36')](_0x35012a['query']);_0x497f83[_0x306c('0x3e')]=_[_0x306c('0x37')](_0x497f83[_0x306c('0x34')],_0x497f83['query']);_0x224408[_0x306c('0x38')]=_[_0x306c('0x37')](_0x497f83[_0x306c('0x34')],qs[_0x306c('0x39')](_0x35012a[_0x306c('0x35')][_0x306c('0x39')]));_0x224408[_0x306c('0x38')]=_0x224408['attributes']['length']?_0x224408[_0x306c('0x38')]:_0x497f83[_0x306c('0x34')];if(!_0x35012a['query']['hasOwnProperty'](_0x306c('0x3a'))){_0x224408[_0x306c('0x1f')]=qs[_0x306c('0x1f')](_0x35012a[_0x306c('0x35')][_0x306c('0x1f')]);_0x224408[_0x306c('0x1d')]=qs['offset'](_0x35012a['query'][_0x306c('0x1d')]);}_0x224408[_0x306c('0x3b')]=qs[_0x306c('0x3c')](_0x35012a['query'][_0x306c('0x3c')]);_0x224408[_0x306c('0x3d')]=qs[_0x306c('0x3e')](_[_0x306c('0x3f')](_0x35012a[_0x306c('0x35')],_0x497f83[_0x306c('0x3e')]));_0x224408['where'][_0x306c('0x5b')]=_0x30ea7e['id'];if(_0x35012a[_0x306c('0x35')][_0x306c('0x40')]){_0x224408[_0x306c('0x3d')]=_[_0x306c('0x41')](_0x224408[_0x306c('0x3d')],{'$or':_[_0x306c('0x2f')](_0x224408[_0x306c('0x38')],function(_0x41964d){var _0x203440={};_0x203440[_0x41964d]={'$like':'%'+_0x35012a['query'][_0x306c('0x40')]+'%'};return _0x203440;})});}_0x224408=_[_0x306c('0x41')]({},_0x224408,_0x35012a[_0x306c('0x44')]);return db[_0x306c('0x5c')][_0x306c('0x1e')]({'where':_0x224408[_0x306c('0x3d')]})[_0x306c('0x27')](function(_0xd9f0cb){_0x22a17c[_0x306c('0x1e')]=_0xd9f0cb;if(_0x35012a[_0x306c('0x35')][_0x306c('0x45')]){_0x224408[_0x306c('0x46')]=[{'all':!![]}];}return db[_0x306c('0x5c')][_0x306c('0x47')](_0x224408);})['then'](function(_0x5d3f76){_0x22a17c[_0x306c('0x48')]=_0x5d3f76;return _0x22a17c;});}})[_0x306c('0x27')](respondWithFilteredResult(_0x12ad4f,_0x224408))[_0x306c('0x49')](handleError(_0x12ad4f,null));};exports[_0x306c('0x5f')]=function(_0x2dd243,_0x5a953a,_0x59f564){return db['CmList'][_0x306c('0x4d')]({'where':{'id':_0x2dd243['params']['id']}})[_0x306c('0x27')](handleEntityNotFound(_0x5a953a,null))['then'](function(_0x49a0ce){if(_0x49a0ce){return _0x49a0ce['removeDispositions'](_0x2dd243[_0x306c('0x35')][_0x306c('0x60')]);}})['then'](respondWithStatusCode(_0x5a953a,null))[_0x306c('0x49')](handleError(_0x5a953a,null));};exports[_0x306c('0x61')]=function(_0x3158ce,_0x1ea771,_0x5deaee){return db[_0x306c('0x30')]['find']({'where':{'id':_0x3158ce['params']['id']}})[_0x306c('0x27')](handleEntityNotFound(_0x1ea771,null))[_0x306c('0x27')](function(_0x507a1e){if(_0x507a1e){var _0x4c10f3=[];var _0x329e35={'success':[],'errors':[]};return db[_0x306c('0x62')]['describe']()[_0x306c('0x27')](function(_0x568071){if(_0x3158ce[_0x306c('0x4f')]['tags']&&_[_0x306c('0x63')](_0x3158ce[_0x306c('0x4f')]['tags'])){if(_0x3158ce[_0x306c('0x4f')]['tags'][_0x306c('0x4c')]){_0x3158ce[_0x306c('0x4f')][_0x306c('0x64')]=_0x3158ce[_0x306c('0x4f')]['tags']['join'](';')+';';}else{_0x3158ce[_0x306c('0x4f')][_0x306c('0x64')]=null;}}else{_0x3158ce[_0x306c('0x4f')][_0x306c('0x64')]=null;}if(_0x3158ce[_0x306c('0x4f')]&&_[_0x306c('0x63')](_0x3158ce[_0x306c('0x4f')])){for(var _0x732e2f=0x0;_0x732e2f<_0x3158ce['body']['length'];_0x732e2f+=0x1){_0x3158ce[_0x306c('0x4f')][_0x732e2f][_0x306c('0x5b')]=_0x3158ce[_0x306c('0x4b')]['id'];_0x4c10f3[_0x306c('0x65')](_0x3158ce[_0x306c('0x4f')][_0x732e2f]);}return BPromise[_0x306c('0x66')](_0x4c10f3,function(_0x2f8f46){return db[_0x306c('0x62')][_0x306c('0x4e')](_['omit'](_0x2f8f46,[_0x306c('0x60'),'id'])||{},{'fields':_[_0x306c('0x36')](_0x568071),'raw':!![]})[_0x306c('0x27')](function(_0x19447d){_0x329e35[_0x306c('0x67')][_0x306c('0x65')](_0x19447d[_0x306c('0x68')]);})[_0x306c('0x49')](function(_0x34e377){_0x329e35[_0x306c('0x69')][_0x306c('0x65')]({'data':_0x2f8f46,'error':_0x34e377[_0x306c('0x6a')]});});})[_0x306c('0x27')](function(_0x270bc5){return _0x329e35;})['catch'](function(_0x500466){return _0x500466;});}else{_0x1ea771['status'](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x1ea771,null))[_0x306c('0x49')](handleError(_0x1ea771,null));};exports[_0x306c('0x6b')]=function(_0x2605c7,_0x2da6e7,_0x2a82ba){var _0x592838;return db[_0x306c('0x30')]['find']({'where':{'id':_0x2605c7['params']['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x306c('0x27')](handleEntityNotFound(_0x2da6e7,null))[_0x306c('0x27')](function(_0x42af8d){if(_0x42af8d){_0x592838=_0x42af8d;return db[_0x306c('0x62')][_0x306c('0x31')];}})[_0x306c('0x27')](function(_0x361cff){if(_0x361cff){var _0x19d958={};var _0x49c073={};_0x49c073[_0x306c('0x34')]=_[_0x306c('0x6c')](_[_0x306c('0x36')](_0x361cff),_[_0x306c('0x2f')](_0x592838['CustomFields'],function(_0x429f14){return util['format']('cf_%d',_0x429f14['id']);}));_0x49c073[_0x306c('0x35')]=_[_0x306c('0x36')](_0x2605c7['query']);_0x49c073['filters']=_['intersection'](_0x49c073[_0x306c('0x34')],_0x49c073['query']);_0x19d958['attributes']=_['intersection'](_0x49c073['model'],qs['fields'](_0x2605c7['query'][_0x306c('0x39')]));_0x19d958[_0x306c('0x38')]=_0x19d958['attributes'][_0x306c('0x4c')]?_0x19d958[_0x306c('0x38')]:_0x49c073[_0x306c('0x34')];if(!_0x2605c7[_0x306c('0x35')][_0x306c('0x6d')](_0x306c('0x3a'))){_0x19d958[_0x306c('0x1f')]=qs[_0x306c('0x1f')](_0x2605c7[_0x306c('0x35')]['limit']);_0x19d958['offset']=qs[_0x306c('0x1d')](_0x2605c7[_0x306c('0x35')]['offset']);}_0x19d958[_0x306c('0x3b')]=qs[_0x306c('0x3c')](_0x2605c7['query'][_0x306c('0x3c')]);_0x19d958['where']=qs['filters'](_[_0x306c('0x3f')](_0x2605c7[_0x306c('0x35')],_0x49c073[_0x306c('0x3e')]));_0x19d958[_0x306c('0x6e')]=!![];if(_0x2605c7[_0x306c('0x35')]['filter']){_0x19d958['where']=_['merge'](_0x19d958[_0x306c('0x3d')],{'$or':_[_0x306c('0x2f')](_0x19d958['attributes'],function(_0xf60d3e){var _0x15810e={};_0x15810e[_0xf60d3e]={'$like':'%'+_0x2605c7[_0x306c('0x35')][_0x306c('0x40')]+'%'};return _0x15810e;})});}_0x19d958=_[_0x306c('0x41')]({},_0x19d958,_0x2605c7[_0x306c('0x44')]);return _0x592838[_0x306c('0x6b')](_0x19d958);}})['then'](respondWithResult(_0x2da6e7,null))[_0x306c('0x49')](handleError(_0x2da6e7,null));};exports[_0x306c('0x6f')]=function(_0x3a7d28,_0x16930,_0x2d59f4){var _0x39177c;var _0xe0441d;var _0x384ba9;var _0x1d33e9=_0x3a7d28[_0x306c('0x4b')]['id'];csv_results=[];return db['ContactItemType']['findAll']({'attributes':['id',_0x306c('0x2c')],'raw':!![],'order':[_0x306c('0x70')]})[_0x306c('0x27')](function(_0x12feb7){_0x39177c=_0x12feb7;var _0x45509b=_[_0x306c('0x36')](db[_0x306c('0x62')][_0x306c('0x31')]);return db['CmCustomField'][_0x306c('0x47')]({'raw':!![],'attributes':['id',_0x306c('0x71')]})[_0x306c('0x27')](function(_0x4f3c84){_0xe0441d=_0x4f3c84;var _0x369cc8=squel[_0x306c('0x72')]()[_0x306c('0x39')](_0x45509b)[_0x306c('0x73')](_0x306c('0x74'),'c')[_0x306c('0x3d')](_0x306c('0x75'),_0x1d33e9)[_0x306c('0x3d')]('c.deletedAt\x20is\x20null')['distinct']();for(var _0x160c46=0x0;_0x160c46<_0xe0441d[_0x306c('0x4c')];_0x160c46++){_0x369cc8[_0x306c('0x76')](_0x306c('0x77')+_0xe0441d[_0x160c46]['id'],_0x306c('0x78')+_0xe0441d[_0x160c46][_0x306c('0x71')]);}for(var _0x160c46=0x0;_0x160c46<_0x39177c[_0x306c('0x4c')];_0x160c46++){_0x369cc8['field'](squel[_0x306c('0x72')]()[_0x306c('0x76')](_0x306c('0x79'))[_0x306c('0x73')](_0x306c('0x7a'))[_0x306c('0x3d')](_0x306c('0x7b'),_0x39177c[_0x160c46]['id'])[_0x306c('0x3d')]('CmContactId\x20=\x20c.id'),_0x306c('0x7c')+_0x39177c[_0x160c46]['name']);_0x369cc8[_0x306c('0x76')](squel[_0x306c('0x72')]()[_0x306c('0x76')](_0x306c('0x7d'))['from'](_0x306c('0x7a'))['where'](_0x306c('0x7b'),_0x39177c[_0x160c46]['id'])['where'](_0x306c('0x7e')),_0x306c('0x7f')+_0x39177c[_0x160c46]['name']);}var _0x5bfeb2=[];_0x5bfeb2['push'](_0x369cc8[_0x306c('0x80')]());BPromise[_0x306c('0x66')](_0x5bfeb2,handleQuery)['then'](function(_0x3b9861){handleQuery(_0x369cc8[_0x306c('0x80')]());var _0x1fd7e5=csv_results[0x0];if(!_['isEmpty'](_0x1fd7e5)){var _0x3bd940=toCsv(_0x1fd7e5);var _0x55827a=Date['now']();fs['writeFileSync'](util[_0x306c('0x81')](_0x306c('0x82'),_0x1d33e9,_0x55827a),_0x3bd940);_0x16930[_0x306c('0x83')](_0x306c('0x84'),_0x306c('0x85')+util['format'](_0x306c('0x86'),_0x1d33e9,_0x55827a));_0x16930[_0x306c('0x83')]('Content-type',_0x306c('0x87'));return _0x16930[_0x306c('0x88')](util[_0x306c('0x81')](_0x306c('0x82'),_0x1d33e9,_0x55827a));}else{return _0x16930[_0x306c('0x2b')](0xcc);}});});});};exports[_0x306c('0x89')]=function(_0x2e5a30,_0x49ee8b,_0x4395ac){var _0x5b4a56;delete _0x2e5a30['body']['id'];return db[_0x306c('0x30')]['findOne']({'where':{'id':_0x2e5a30['params']['id']}})[_0x306c('0x27')](handleEntityNotFound(_0x49ee8b,null))['then'](function(_0x23090b){if(_0x23090b){return db['sequelize'][_0x306c('0x8a')](function(_0x47c01f){return db[_0x306c('0x8b')][_0x306c('0x4e')](_0x2e5a30['body'],{'transaction':_0x47c01f})[_0x306c('0x27')](function(_0x1a64f0){_0x5b4a56=_0x1a64f0;return _0x23090b[_0x306c('0x8c')](_0x1a64f0,{'transaction':_0x47c01f});})[_0x306c('0x27')](function(){var _0x4f901e={'type':db['Sequelize']['TEXT'],'transaction':_0x47c01f};switch(_0x2e5a30[_0x306c('0x4f')][_0x306c('0x42')]){case'text':_0x4f901e['type']=db[_0x306c('0x8d')]['TEXT'];break;case _0x306c('0x8e'):_0x4f901e['type']=db['Sequelize'][_0x306c('0x8f')];break;case _0x306c('0x90'):_0x4f901e[_0x306c('0x42')]=db[_0x306c('0x8d')][_0x306c('0x91')];_0x4f901e[_0x306c('0x92')]=![];break;default:}return db[_0x306c('0x93')][_0x306c('0x94')]['addColumn'](_0x306c('0x74'),util[_0x306c('0x81')](_0x306c('0x95'),_0x5b4a56['id']),_0x4f901e);})[_0x306c('0x27')](function(){return _0x5b4a56;});});}})[_0x306c('0x27')](respondWithResult(_0x49ee8b,null))[_0x306c('0x49')](handleError(_0x49ee8b,null));};exports[_0x306c('0x96')]=function(_0x859044,_0x463e58,_0x4a831e){var _0x7575bf={};var _0x233760={};var _0x4ed176;var _0x507534;return db[_0x306c('0x30')]['findOne']({'where':{'id':_0x859044[_0x306c('0x4b')]['id']}})[_0x306c('0x27')](handleEntityNotFound(_0x463e58,null))[_0x306c('0x27')](function(_0x2bd1e3){if(_0x2bd1e3){_0x4ed176=_0x2bd1e3;_0x233760['model']=_[_0x306c('0x36')](db[_0x306c('0x8b')][_0x306c('0x31')]);_0x233760[_0x306c('0x35')]=_[_0x306c('0x36')](_0x859044[_0x306c('0x35')]);_0x233760['filters']=_[_0x306c('0x37')](_0x233760['model'],_0x233760[_0x306c('0x35')]);_0x7575bf['attributes']=_[_0x306c('0x37')](_0x233760[_0x306c('0x34')],qs['fields'](_0x859044[_0x306c('0x35')]['fields']));_0x7575bf['attributes']=_0x7575bf[_0x306c('0x38')][_0x306c('0x4c')]?_0x7575bf[_0x306c('0x38')]:_0x233760['model'];_0x7575bf[_0x306c('0x3b')]=qs[_0x306c('0x3c')](_0x859044[_0x306c('0x35')][_0x306c('0x3c')]);_0x7575bf[_0x306c('0x3d')]=qs[_0x306c('0x3e')](_[_0x306c('0x3f')](_0x859044[_0x306c('0x35')],_0x233760['filters']));_0x7575bf[_0x306c('0x3d')]=_[_0x306c('0x41')](_0x7575bf[_0x306c('0x3d')],{'$or':[{'ListId':_0x2bd1e3['id']},{'ListId':null}]});if(_0x859044[_0x306c('0x35')][_0x306c('0x40')]){_0x7575bf[_0x306c('0x3d')]=_[_0x306c('0x41')](_0x7575bf['where'],{'$or':_[_0x306c('0x2f')](_0x7575bf[_0x306c('0x38')],function(_0x11a04d){var _0x215387={};_0x215387[_0x11a04d]={'$like':'%'+_0x859044[_0x306c('0x35')]['filter']+'%'};return _0x215387;})});}_0x7575bf=_[_0x306c('0x41')]({},_0x7575bf,_0x859044[_0x306c('0x44')]);return db[_0x306c('0x8b')][_0x306c('0x97')](_0x7575bf);}})[_0x306c('0x27')](respondWithResult(_0x463e58,null))[_0x306c('0x49')](handleError(_0x463e58,null));};exports[_0x306c('0x98')]=function(_0x3da8e1,_0x3e8a35){return db['CmCustomField'][_0x306c('0x97')]({'where':{'ListId':null}})[_0x306c('0x27')](handleEntityNotFound(_0x3e8a35,null))[_0x306c('0x27')](function(_0x3a863f){return _0x3a863f;})[_0x306c('0x27')](respondWithResult(_0x3e8a35,null))[_0x306c('0x49')](handleError(_0x3e8a35,null));};exports[_0x306c('0x99')]=function(_0x1f35d5,_0x57aba0,_0x268e25){return db[_0x306c('0x30')][_0x306c('0x4d')]({'where':{'id':_0x1f35d5[_0x306c('0x4b')]['id']}})[_0x306c('0x27')](handleEntityNotFound(_0x57aba0,null))['then'](function(_0x31c60e){if(_0x31c60e){return _0x31c60e['addAgents'](_0x1f35d5[_0x306c('0x4f')]['ids'],_['omit'](_0x1f35d5['body'],['ids','id'])||{})['spread'](function(_0x223ad8){for(var _0x5899b8=0x0;_0x5899b8<_0x1f35d5[_0x306c('0x4f')][_0x306c('0x60')][_0x306c('0x4c')];_0x5899b8+=0x1){socket[_0x306c('0x9a')](_0x306c('0x9b'),{'UserId':Number(_0x1f35d5[_0x306c('0x4f')][_0x306c('0x60')][_0x5899b8]),'CmListId':Number(_0x1f35d5['params']['id'])});}return _0x223ad8;});}})[_0x306c('0x27')](respondWithResult(_0x57aba0,null))[_0x306c('0x49')](handleError(_0x57aba0,null));};exports['removeAgents']=function(_0x1be3a6,_0x471fce,_0xaf7d4e){return db['CmList'][_0x306c('0x4d')]({'where':{'id':_0x1be3a6['params']['id']}})[_0x306c('0x27')](handleEntityNotFound(_0x471fce,null))[_0x306c('0x27')](function(_0x4ee5ef){if(_0x4ee5ef){return _0x4ee5ef[_0x306c('0x9c')](_0x1be3a6['query'][_0x306c('0x60')])['then'](function(){if(_[_0x306c('0x63')](_0x1be3a6[_0x306c('0x35')][_0x306c('0x60')])){for(var _0x1a89cb=0x0;_0x1a89cb<_0x1be3a6[_0x306c('0x35')][_0x306c('0x60')][_0x306c('0x4c')];_0x1a89cb+=0x1){socket[_0x306c('0x9a')](_0x306c('0x9d'),{'UserId':Number(_0x1be3a6[_0x306c('0x35')][_0x306c('0x60')][_0x1a89cb]),'CmListId':Number(_0x1be3a6[_0x306c('0x4b')]['id'])});}}else{socket['emit'](_0x306c('0x9d'),{'UserId':Number(_0x1be3a6[_0x306c('0x35')][_0x306c('0x60')]),'CmListId':Number(_0x1be3a6['params']['id'])});}});}})[_0x306c('0x27')](respondWithStatusCode(_0x471fce,null))[_0x306c('0x49')](handleError(_0x471fce,null));};exports[_0x306c('0x9e')]=function(_0x203158,_0x31aa06,_0x3a5aef){var _0x4fda32={};var _0x2ffd43={};var _0x33bc14;var _0x364036;return db['CmList'][_0x306c('0x5e')]({'where':{'id':_0x203158['params']['id']}})[_0x306c('0x27')](handleEntityNotFound(_0x31aa06,null))[_0x306c('0x27')](function(_0x40cdf5){if(_0x40cdf5){_0x33bc14=_0x40cdf5;_0x2ffd43[_0x306c('0x34')]=_[_0x306c('0x36')](db[_0x306c('0x9f')][_0x306c('0x31')]);_0x2ffd43[_0x306c('0x35')]=_[_0x306c('0x36')](_0x203158[_0x306c('0x35')]);_0x2ffd43[_0x306c('0x3e')]=_[_0x306c('0x37')](_0x2ffd43['model'],_0x2ffd43[_0x306c('0x35')]);_0x4fda32[_0x306c('0x38')]=_[_0x306c('0x37')](_0x2ffd43[_0x306c('0x34')],qs[_0x306c('0x39')](_0x203158[_0x306c('0x35')][_0x306c('0x39')]));_0x4fda32[_0x306c('0x38')]=_0x4fda32[_0x306c('0x38')][_0x306c('0x4c')]?_0x4fda32[_0x306c('0x38')]:_0x2ffd43[_0x306c('0x34')];_0x4fda32[_0x306c('0x3b')]=qs['sort'](_0x203158[_0x306c('0x35')][_0x306c('0x3c')]);_0x4fda32[_0x306c('0x3d')]=qs[_0x306c('0x3e')](_[_0x306c('0x3f')](_0x203158[_0x306c('0x35')],_0x2ffd43[_0x306c('0x3e')]));if(_0x203158[_0x306c('0x35')][_0x306c('0x40')]){_0x4fda32[_0x306c('0x3d')]=_[_0x306c('0x41')](_0x4fda32['where'],{'$or':_[_0x306c('0x2f')](_0x4fda32[_0x306c('0x38')],function(_0x19fc03){var _0x4ea48b={};_0x4ea48b[_0x19fc03]={'$like':'%'+_0x203158['query'][_0x306c('0x40')]+'%'};return _0x4ea48b;})});}_0x4fda32=_[_0x306c('0x41')]({},_0x4fda32,_0x203158[_0x306c('0x44')]);return _0x33bc14[_0x306c('0x9e')](_0x4fda32);}})[_0x306c('0x27')](function(_0x4af24d){if(_0x4af24d){_0x364036=_0x4af24d[_0x306c('0x4c')];if(!_0x203158[_0x306c('0x35')][_0x306c('0x6d')](_0x306c('0x3a'))){_0x4fda32[_0x306c('0x1f')]=qs[_0x306c('0x1f')](_0x203158[_0x306c('0x35')][_0x306c('0x1f')]);_0x4fda32[_0x306c('0x1d')]=qs[_0x306c('0x1d')](_0x203158['query']['offset']);}return _0x33bc14[_0x306c('0x9e')](_0x4fda32);}})[_0x306c('0x27')](function(_0x9a346){if(_0x9a346){return _0x9a346?{'count':_0x364036,'rows':_0x9a346}:null;}})['then'](respondWithResult(_0x31aa06,null))[_0x306c('0x49')](handleError(_0x31aa06,null));};function handleQuery(_0x1a73f6){logger[_0x306c('0xa0')](_0x1a73f6);return db['sequelize'][_0x306c('0x35')](_0x1a73f6)[_0x306c('0xa1')](function(_0x48e57a){csv_results[_0x306c('0x65')](_0x48e57a);})[_0x306c('0x49')](function(_0xe8e80f){logger[_0x306c('0x56')](_0xe8e80f[_0x306c('0x6a')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 228347c..80dda33 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x5fc3[_0x3d42d8];return _0x27fc41;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x5d1d6c,_0x8c94ff){var _0x3f4b02=function(_0x12a703){while(--_0x12a703){_0x5d1d6c['push'](_0x5d1d6c['shift']());}};_0x3f4b02(++_0x8c94ff);}(_0x814b,0x1a2));var _0xb814=function(_0x3b395a,_0xb9a82d){_0x3b395a=_0x3b395a-0x0;var _0x4aeef2=_0x814b[_0x3b395a];return _0x4aeef2;};'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 2f66f20..3287322 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 _0xa75b=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','api','moment','bluebird'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0xa75b,0x170));var _0xba75=function(_0x36fd93,_0x4d1ffa){_0x36fd93=_0x36fd93-0x0;var _0x3c7d38=_0xa75b[_0x36fd93];return _0x3c7d38;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba75('0x1'));var moment=require(_0xba75('0x2'));var BPromise=require(_0xba75('0x3'));var rp=require(_0xba75('0x4'));var fs=require('fs');var path=require(_0xba75('0x5'));var rimraf=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var attributes=require(_0xba75('0x8'));module[_0xba75('0x9')]=function(_0x41afc9,_0x2baa28){return _0x41afc9[_0xba75('0xa')](_0xba75('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb903=['rimraf','../../config/environment','./cmList.attributes','exports','cm_lists','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x180237,_0xfd4959){var _0x56fa74=function(_0x520793){while(--_0x520793){_0x180237['push'](_0x180237['shift']());}};_0x56fa74(++_0xfd4959);}(_0xb903,0x185));var _0x3b90=function(_0x5cf176,_0xc29eef){_0x5cf176=_0x5cf176-0x0;var _0x5d5254=_0xb903[_0x5cf176];return _0x5d5254;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var fs=require('fs');var path=require(_0x3b90('0x6'));var rimraf=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var attributes=require(_0x3b90('0x9'));module[_0x3b90('0xa')]=function(_0x5acd76,_0x15b68f){return _0x5acd76['define']('CmList',attributes,{'tableName':_0x3b90('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 cb40e91..a1ecad2 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 _0x0964=['request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register'];(function(_0x4384ea,_0x3810c6){var _0x5c4aae=function(_0x2d3fac){while(--_0x2d3fac){_0x4384ea['push'](_0x4384ea['shift']());}};_0x5c4aae(++_0x3810c6);}(_0x0964,0x138));var _0x4096=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x0964[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0x4096('0x0'));var util=require(_0x4096('0x1'));var moment=require(_0x4096('0x2'));var BPromise=require(_0x4096('0x3'));var rs=require(_0x4096('0x4'));var fs=require('fs');var Redis=require(_0x4096('0x5'));var db=require(_0x4096('0x6'))['db'];var utils=require(_0x4096('0x7'));var logger=require('../../config/logger')(_0x4096('0x8'));var config=require(_0x4096('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4096('0xa')][_0x4096('0xb')]({'port':0x232a});config[_0x4096('0xc')]=_[_0x4096('0xd')](config[_0x4096('0xc')],{'host':_0x4096('0xe'),'port':0x18eb});var socket=require(_0x4096('0xf'))(new Redis(config[_0x4096('0xc')]));require(_0x4096('0x10'))[_0x4096('0x11')](socket);function respondWithRpcPromise(_0x92a980,_0x3d3a83,_0x21eed5){return new BPromise(function(_0x55b3c3,_0x59fcd0){return client[_0x4096('0x12')](_0x92a980,_0x21eed5)[_0x4096('0x13')](function(_0x274c45){logger['info'](_0x4096('0x14'),_0x3d3a83,_0x4096('0x15'));logger[_0x4096('0x16')]('CmList,\x20%s,\x20%s,\x20%s',_0x3d3a83,_0x4096('0x15'),JSON[_0x4096('0x17')](_0x274c45));if(_0x274c45[_0x4096('0x18')]){if(_0x274c45[_0x4096('0x18')][_0x4096('0x19')]===0x1f4){logger['error'](_0x4096('0x14'),_0x3d3a83,_0x274c45[_0x4096('0x18')][_0x4096('0x1a')]);return _0x59fcd0(_0x274c45[_0x4096('0x18')]['message']);}logger[_0x4096('0x18')]('CmList,\x20%s,\x20%s',_0x3d3a83,_0x274c45[_0x4096('0x18')][_0x4096('0x1a')]);return _0x55b3c3(_0x274c45[_0x4096('0x18')][_0x4096('0x1a')]);}else{logger[_0x4096('0x1b')](_0x4096('0x14'),_0x3d3a83,_0x4096('0x15'));_0x55b3c3(_0x274c45[_0x4096('0x1c')]['message']);}})[_0x4096('0x1d')](function(_0x11eb7b){logger[_0x4096('0x18')]('CmList,\x20%s,\x20%s',_0x3d3a83,_0x11eb7b);_0x59fcd0(_0x11eb7b);});});} \ No newline at end of file +var _0xbd91=['debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','redis','localhost','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s'];(function(_0x59b2a1,_0x1f631f){var _0x4908d1=function(_0x14c9b8){while(--_0x14c9b8){_0x59b2a1['push'](_0x59b2a1['shift']());}};_0x4908d1(++_0x1f631f);}(_0xbd91,0xea));var _0x1bd9=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xbd91[_0x4a7631];return _0x1a5a6f;};'use strict';var _=require(_0x1bd9('0x0'));var util=require(_0x1bd9('0x1'));var moment=require('moment');var BPromise=require(_0x1bd9('0x2'));var rs=require(_0x1bd9('0x3'));var fs=require('fs');var Redis=require(_0x1bd9('0x4'));var db=require(_0x1bd9('0x5'))['db'];var utils=require(_0x1bd9('0x6'));var logger=require('../../config/logger')(_0x1bd9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1bd9('0x8')]['http']({'port':0x232a});config[_0x1bd9('0x9')]=_['defaults'](config[_0x1bd9('0x9')],{'host':_0x1bd9('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1bd9('0x9')]));require(_0x1bd9('0xb'))['register'](socket);function respondWithRpcPromise(_0x27b890,_0x162761,_0x233be7){return new BPromise(function(_0x3a3810,_0x2f07b6){return client[_0x1bd9('0xc')](_0x27b890,_0x233be7)[_0x1bd9('0xd')](function(_0x5813f5){logger[_0x1bd9('0xe')](_0x1bd9('0xf'),_0x162761,'request\x20sent');logger[_0x1bd9('0x10')](_0x1bd9('0x11'),_0x162761,'request\x20sent',JSON[_0x1bd9('0x12')](_0x5813f5));if(_0x5813f5[_0x1bd9('0x13')]){if(_0x5813f5[_0x1bd9('0x13')][_0x1bd9('0x14')]===0x1f4){logger[_0x1bd9('0x13')](_0x1bd9('0xf'),_0x162761,_0x5813f5['error'][_0x1bd9('0x15')]);return _0x2f07b6(_0x5813f5['error']['message']);}logger[_0x1bd9('0x13')](_0x1bd9('0xf'),_0x162761,_0x5813f5[_0x1bd9('0x13')][_0x1bd9('0x15')]);return _0x3a3810(_0x5813f5[_0x1bd9('0x13')][_0x1bd9('0x15')]);}else{logger[_0x1bd9('0xe')]('CmList,\x20%s,\x20%s',_0x162761,_0x1bd9('0x16'));_0x3a3810(_0x5813f5[_0x1bd9('0x17')][_0x1bd9('0x15')]);}})[_0x1bd9('0x18')](function(_0x255ed9){logger[_0x1bd9('0x13')]('CmList,\x20%s,\x20%s',_0x162761,_0x255ed9);_0x2f07b6(_0x255ed9);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 7570197..3874211 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 _0xb7c2=['update','emit','removeListener','register','length','cmList:','./cmList.events','save','remove'];(function(_0x44b967,_0x4ace3f){var _0xe3c187=function(_0x11f252){while(--_0x11f252){_0x44b967['push'](_0x44b967['shift']());}};_0xe3c187(++_0x4ace3f);}(_0xb7c2,0x114));var _0x2b7c=function(_0x9aa69f,_0x401ad2){_0x9aa69f=_0x9aa69f-0x0;var _0x377472=_0xb7c2[_0x9aa69f];return _0x377472;};'use strict';var CmListEvents=require(_0x2b7c('0x0'));var events=[_0x2b7c('0x1'),_0x2b7c('0x2'),_0x2b7c('0x3')];function createListener(_0x1de8ae,_0x25e203){return function(_0x1426b9){_0x25e203[_0x2b7c('0x4')](_0x1de8ae,_0x1426b9);};}function removeListener(_0x271979,_0x15cfc8){return function(){CmListEvents[_0x2b7c('0x5')](_0x271979,_0x15cfc8);};}exports[_0x2b7c('0x6')]=function(_0x2d6856){for(var _0x1df508=0x0,_0x2f825a=events[_0x2b7c('0x7')];_0x1df508<_0x2f825a;_0x1df508++){var _0x144fe8=events[_0x1df508];var _0x1b6e5c=createListener(_0x2b7c('0x8')+_0x144fe8,_0x2d6856);CmListEvents['on'](_0x144fe8,_0x1b6e5c);}}; \ No newline at end of file +var _0xb801=['./cmList.events','remove','update','emit','length','cmList:'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xb801,0x126));var _0x1b80=function(_0xbd8310,_0x3df6c9){_0xbd8310=_0xbd8310-0x0;var _0x1d1435=_0xb801[_0xbd8310];return _0x1d1435;};'use strict';var CmListEvents=require(_0x1b80('0x0'));var events=['save',_0x1b80('0x1'),_0x1b80('0x2')];function createListener(_0x1b69d0,_0x167b60){return function(_0x4d7b76){_0x167b60[_0x1b80('0x3')](_0x1b69d0,_0x4d7b76);};}function removeListener(_0x36cb52,_0x7c30f3){return function(){CmListEvents['removeListener'](_0x36cb52,_0x7c30f3);};}exports['register']=function(_0x59093d){for(var _0x308cee=0x0,_0x3f4365=events[_0x1b80('0x4')];_0x308cee<_0x3f4365;_0x308cee++){var _0x28333a=events[_0x308cee];var _0x5b8983=createListener(_0x1b80('0x5')+_0x28333a,_0x59093d);CmListEvents['on'](_0x28333a,_0x5b8983);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index e2a8ce9..1d41aa9 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 _0x46ee=['getCustomFields','/:id/users','post','create','addDisposition','addContacts','addCustomField','put','update','delete','removeDispositions','multer','util','path','connect-timeout','express','Router','fs-extra','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields'];(function(_0x2cbfe5,_0x1fb99b){var _0x3f69ad=function(_0x10b7c6){while(--_0x10b7c6){_0x2cbfe5['push'](_0x2cbfe5['shift']());}};_0x3f69ad(++_0x1fb99b);}(_0x46ee,0x6b));var _0xe46e=function(_0x217e5e,_0x40226f){_0x217e5e=_0x217e5e-0x0;var _0x2f7b44=_0x46ee[_0x217e5e];return _0x2f7b44;};'use strict';var multer=require(_0xe46e('0x0'));var util=require(_0xe46e('0x1'));var path=require(_0xe46e('0x2'));var timeout=require(_0xe46e('0x3'));var express=require(_0xe46e('0x4'));var router=express[_0xe46e('0x5')]();var fs_extra=require(_0xe46e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmList.controller');router[_0xe46e('0x7')]('/',auth[_0xe46e('0x8')](),controller[_0xe46e('0x9')]);router['get'](_0xe46e('0xa'),auth['isAuthenticated'](),controller[_0xe46e('0xb')]);router[_0xe46e('0x7')](_0xe46e('0xc'),auth['isAuthenticated'](),controller[_0xe46e('0xd')]);router[_0xe46e('0x7')](_0xe46e('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xe46e('0x7')](_0xe46e('0xf'),auth['isAuthenticated'](),controller[_0xe46e('0x10')]);router[_0xe46e('0x7')](_0xe46e('0x11'),auth[_0xe46e('0x8')](),controller['getContacts']);router[_0xe46e('0x7')](_0xe46e('0x12'),auth[_0xe46e('0x8')](),controller[_0xe46e('0x13')]);router[_0xe46e('0x7')](_0xe46e('0x14'),auth['isAuthenticated'](),controller[_0xe46e('0x15')]);router['get'](_0xe46e('0x16'),auth[_0xe46e('0x8')](),controller['getAgents']);router[_0xe46e('0x17')]('/',auth[_0xe46e('0x8')](),controller[_0xe46e('0x18')]);router[_0xe46e('0x17')]('/:id/dispositions',auth[_0xe46e('0x8')](),controller[_0xe46e('0x19')]);router[_0xe46e('0x17')](_0xe46e('0x11'),auth[_0xe46e('0x8')](),controller[_0xe46e('0x1a')]);router['post'](_0xe46e('0x14'),auth[_0xe46e('0x8')](),controller[_0xe46e('0x1b')]);router['post'](_0xe46e('0x16'),auth[_0xe46e('0x8')](),controller['addAgents']);router[_0xe46e('0x1c')](_0xe46e('0xe'),auth[_0xe46e('0x8')](),controller[_0xe46e('0x1d')]);router[_0xe46e('0x1e')](_0xe46e('0xe'),auth[_0xe46e('0x8')](),controller['destroy']);router['delete'](_0xe46e('0xf'),auth[_0xe46e('0x8')](),controller[_0xe46e('0x1f')]);router[_0xe46e('0x1e')](_0xe46e('0x16'),auth[_0xe46e('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x9245=['delete','destroy','removeDispositions','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/describe','/global_fields','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addCustomField','addAgents','update'];(function(_0x565baf,_0x188fd8){var _0x5ce59f=function(_0x1cf936){while(--_0x1cf936){_0x565baf['push'](_0x565baf['shift']());}};_0x5ce59f(++_0x188fd8);}(_0x9245,0x164));var _0x5924=function(_0x5384dc,_0x386657){_0x5384dc=_0x5384dc-0x0;var _0x2a21d5=_0x9245[_0x5384dc];return _0x2a21d5;};'use strict';var multer=require(_0x5924('0x0'));var util=require(_0x5924('0x1'));var path=require(_0x5924('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5924('0x3')]();var fs_extra=require(_0x5924('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5924('0x5'));var config=require(_0x5924('0x6'));var controller=require('./cmList.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5924('0x7')]);router[_0x5924('0x8')](_0x5924('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x5924('0x8')](_0x5924('0xa'),auth[_0x5924('0xb')](),controller['getGlobalCustomFields']);router[_0x5924('0x8')](_0x5924('0xc'),auth['isAuthenticated'](),controller[_0x5924('0xd')]);router['get'](_0x5924('0xe'),auth[_0x5924('0xb')](),controller[_0x5924('0xf')]);router[_0x5924('0x8')](_0x5924('0x10'),auth[_0x5924('0xb')](),controller['getContacts']);router['get']('/:id/contacts/csv',auth[_0x5924('0xb')](),controller[_0x5924('0x11')]);router[_0x5924('0x8')](_0x5924('0x12'),auth[_0x5924('0xb')](),controller[_0x5924('0x13')]);router[_0x5924('0x8')](_0x5924('0x14'),auth[_0x5924('0xb')](),controller[_0x5924('0x15')]);router[_0x5924('0x16')]('/',auth[_0x5924('0xb')](),controller[_0x5924('0x17')]);router[_0x5924('0x16')](_0x5924('0xe'),auth[_0x5924('0xb')](),controller[_0x5924('0x18')]);router[_0x5924('0x16')](_0x5924('0x10'),auth[_0x5924('0xb')](),controller['addContacts']);router[_0x5924('0x16')](_0x5924('0x12'),auth['isAuthenticated'](),controller[_0x5924('0x19')]);router[_0x5924('0x16')](_0x5924('0x14'),auth[_0x5924('0xb')](),controller[_0x5924('0x1a')]);router['put'](_0x5924('0xc'),auth[_0x5924('0xb')](),controller[_0x5924('0x1b')]);router[_0x5924('0x1c')](_0x5924('0xc'),auth[_0x5924('0xb')](),controller[_0x5924('0x1d')]);router[_0x5924('0x1c')](_0x5924('0xe'),auth[_0x5924('0xb')](),controller[_0x5924('0x1e')]);router[_0x5924('0x1c')]('/:id/users',auth[_0x5924('0xb')](),controller['removeAgents']);module[_0x5924('0x1f')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index a751ed0..5e14cf9 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 _0x5c58=['sequelize','getDataValue','field','STRING'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x5c58,0x114));var _0x85c5=function(_0x1dc46e,_0x5d3b2f){_0x1dc46e=_0x1dc46e-0x0;var _0x12f8ba=_0x5c58[_0x1dc46e];return _0x12f8ba;};'use strict';var Sequelize=require(_0x85c5('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2fc5e1){return this[_0x85c5('0x1')](_0x85c5('0x2'));}},'field':{'type':Sequelize[_0x85c5('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x85c5('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0xad1a=['STRING','sequelize','VIRTUAL','getDataValue','field'];(function(_0x49365d,_0x227a7c){var _0x508eaa=function(_0x4c4464){while(--_0x4c4464){_0x49365d['push'](_0x49365d['shift']());}};_0x508eaa(++_0x227a7c);}(_0xad1a,0x1e1));var _0xaad1=function(_0x2bb153,_0x304a74){_0x2bb153=_0x2bb153-0x0;var _0x1b8cd9=_0xad1a[_0x2bb153];return _0x1b8cd9;};'use strict';var Sequelize=require(_0xaad1('0x0'));module['exports']={'name':{'type':Sequelize[_0xaad1('0x1')],'get':function(_0x288890){return this[_0xaad1('0x2')](_0xaad1('0x3'));}},'field':{'type':Sequelize[_0xaad1('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xaad1('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xaad1('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index f2066bb..7c8e9aa 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x37978c,_0x218395){var _0x5a45f5=function(_0x1eb6e7){while(--_0x1eb6e7){_0x37978c['push'](_0x37978c['shift']());}};_0x5a45f5(++_0x218395);}(_0x7a54,0x106));var _0x47a5=function(_0x5dbabf,_0x3be274){_0x5dbabf=_0x5dbabf-0x0;var _0x4bab72=_0x7a54[_0x5dbabf];return _0x4bab72;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x348a46,_0x5e4061){var _0x45d19a=function(_0x480b02){while(--_0x480b02){_0x348a46['push'](_0x348a46['shift']());}};_0x45d19a(++_0x5e4061);}(_0x7a54,0x106));var _0x47a5=function(_0x6ce3fb,_0x4a0633){_0x6ce3fb=_0x6ce3fb-0x0;var _0x2a2ff2=_0x7a54[_0x6ce3fb];return _0x2a2ff2;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 4d4d6cd..9d4121c 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 _0x5592=['util','../../config/logger','api','moment','path','rimraf','define','Condition','tools_conditions'];(function(_0x14f457,_0x540565){var _0x51056d=function(_0x906c18){while(--_0x906c18){_0x14f457['push'](_0x14f457['shift']());}};_0x51056d(++_0x540565);}(_0x5592,0x14d));var _0x2559=function(_0x479dce,_0x4dce8b){_0x479dce=_0x479dce-0x0;var _0x320557=_0x5592[_0x479dce];return _0x320557;};'use strict';var _=require('lodash');var util=require(_0x2559('0x0'));var logger=require(_0x2559('0x1'))(_0x2559('0x2'));var moment=require(_0x2559('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2559('0x4'));var rimraf=require(_0x2559('0x5'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module['exports']=function(_0x368343,_0x304ea3){return _0x368343[_0x2559('0x6')](_0x2559('0x7'),attributes,{'tableName':_0x2559('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70b1=['Condition','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define'];(function(_0x313243,_0x11b852){var _0x38309e=function(_0x5a8641){while(--_0x5a8641){_0x313243['push'](_0x313243['shift']());}};_0x38309e(++_0x11b852);}(_0x70b1,0x17a));var _0x170b=function(_0x2caaef,_0x3c19ed){_0x2caaef=_0x2caaef-0x0;var _0xd011f8=_0x70b1[_0x2caaef];return _0xd011f8;};'use strict';var _=require(_0x170b('0x0'));var util=require(_0x170b('0x1'));var logger=require(_0x170b('0x2'))('api');var moment=require(_0x170b('0x3'));var BPromise=require(_0x170b('0x4'));var rp=require(_0x170b('0x5'));var fs=require('fs');var path=require(_0x170b('0x6'));var rimraf=require(_0x170b('0x7'));var config=require(_0x170b('0x8'));var attributes=require(_0x170b('0x9'));module[_0x170b('0xa')]=function(_0x212627,_0x32a4d7){return _0x212627[_0x170b('0xb')](_0x170b('0xc'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 8b053d3..7ff42b3 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 _0x30a2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0xfc8faf,_0x86244a){var _0x48c40b=function(_0x107c22){while(--_0x107c22){_0xfc8faf['push'](_0xfc8faf['shift']());}};_0x48c40b(++_0x86244a);}(_0x30a2,0x8d));var _0x230a=function(_0x380b8f,_0x32271d){_0x380b8f=_0x380b8f-0x0;var _0x646c69=_0x30a2[_0x380b8f];return _0x646c69;};'use strict';var _=require(_0x230a('0x0'));var util=require('util');var moment=require(_0x230a('0x1'));var BPromise=require(_0x230a('0x2'));var rs=require(_0x230a('0x3'));var fs=require('fs');var Redis=require(_0x230a('0x4'));var db=require(_0x230a('0x5'))['db'];var utils=require(_0x230a('0x6'));var logger=require(_0x230a('0x7'))(_0x230a('0x8'));var config=require(_0x230a('0x9'));var jayson=require(_0x230a('0xa'));var client=jayson['client'][_0x230a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4dd662,_0x43daae,_0x493119){return new BPromise(function(_0x5f0c79,_0x4a5dd7){return client[_0x230a('0xc')](_0x4dd662,_0x493119)[_0x230a('0xd')](function(_0x5c8e69){logger[_0x230a('0xe')](_0x230a('0xf'),_0x43daae,_0x230a('0x10'));logger[_0x230a('0x11')](_0x230a('0x12'),_0x43daae,_0x230a('0x10'),JSON['stringify'](_0x5c8e69));if(_0x5c8e69[_0x230a('0x13')]){if(_0x5c8e69[_0x230a('0x13')][_0x230a('0x14')]===0x1f4){logger[_0x230a('0x13')](_0x230a('0xf'),_0x43daae,_0x5c8e69[_0x230a('0x13')][_0x230a('0x15')]);return _0x4a5dd7(_0x5c8e69[_0x230a('0x13')][_0x230a('0x15')]);}logger[_0x230a('0x13')](_0x230a('0xf'),_0x43daae,_0x5c8e69[_0x230a('0x13')]['message']);return _0x5f0c79(_0x5c8e69[_0x230a('0x13')][_0x230a('0x15')]);}else{logger[_0x230a('0xe')]('Condition,\x20%s,\x20%s',_0x43daae,_0x230a('0x10'));_0x5f0c79(_0x5c8e69[_0x230a('0x16')]['message']);}})[_0x230a('0x17')](function(_0x970bd4){logger[_0x230a('0x13')](_0x230a('0xf'),_0x43daae,_0x970bd4);_0x4a5dd7(_0x970bd4);});});} \ No newline at end of file +var _0xa94e=['../../config/environment','jayson/promise','request','info','debug','request\x20sent','error','Condition,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x254f07,_0x50b496){var _0x69712e=function(_0x47e23e){while(--_0x47e23e){_0x254f07['push'](_0x254f07['shift']());}};_0x69712e(++_0x50b496);}(_0xa94e,0x76));var _0xea94=function(_0x28b722,_0x1ab398){_0x28b722=_0x28b722-0x0;var _0x3c0f46=_0xa94e[_0x28b722];return _0x3c0f46;};'use strict';var _=require(_0xea94('0x0'));var util=require(_0xea94('0x1'));var moment=require(_0xea94('0x2'));var BPromise=require('bluebird');var rs=require(_0xea94('0x3'));var fs=require('fs');var Redis=require(_0xea94('0x4'));var db=require(_0xea94('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xea94('0x6'))(_0xea94('0x7'));var config=require(_0xea94('0x8'));var jayson=require(_0xea94('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4098bd,_0x107d80,_0x42e6b4){return new BPromise(function(_0x4dc372,_0x266be1){return client[_0xea94('0xa')](_0x4098bd,_0x42e6b4)['then'](function(_0x17cfe0){logger[_0xea94('0xb')]('Condition,\x20%s,\x20%s',_0x107d80,'request\x20sent');logger[_0xea94('0xc')]('Condition,\x20%s,\x20%s,\x20%s',_0x107d80,_0xea94('0xd'),JSON['stringify'](_0x17cfe0));if(_0x17cfe0[_0xea94('0xe')]){if(_0x17cfe0['error']['code']===0x1f4){logger[_0xea94('0xe')](_0xea94('0xf'),_0x107d80,_0x17cfe0[_0xea94('0xe')][_0xea94('0x10')]);return _0x266be1(_0x17cfe0['error'][_0xea94('0x10')]);}logger[_0xea94('0xe')](_0xea94('0xf'),_0x107d80,_0x17cfe0[_0xea94('0xe')][_0xea94('0x10')]);return _0x4dc372(_0x17cfe0[_0xea94('0xe')][_0xea94('0x10')]);}else{logger[_0xea94('0xb')](_0xea94('0xf'),_0x107d80,_0xea94('0xd'));_0x4dc372(_0x17cfe0[_0xea94('0x11')][_0xea94('0x10')]);}})['catch'](function(_0x3e1b63){logger['error'](_0xea94('0xf'),_0x107d80,_0x3e1b63);_0x266be1(_0x3e1b63);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index a0e13fe..7e2f359 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 _0xe073=['Router','../../components/auth/service','../../config/environment','put','/:id','update','delete','isAuthenticated','destroy','exports','util','path'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe073,0x14e));var _0x3e07=function(_0x2ee122,_0x29a979){_0x2ee122=_0x2ee122-0x0;var _0x3d9be6=_0xe073[_0x2ee122];return _0x3d9be6;};'use strict';var multer=require('multer');var util=require(_0x3e07('0x0'));var path=require(_0x3e07('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3e07('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3e07('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3e07('0x4'));var controller=require('./condition.controller');router[_0x3e07('0x5')](_0x3e07('0x6'),auth['isAuthenticated'](),controller[_0x3e07('0x7')]);router[_0x3e07('0x8')](_0x3e07('0x6'),auth[_0x3e07('0x9')](),controller[_0x3e07('0xa')]);module[_0x3e07('0xb')]=router; \ No newline at end of file +var _0x21af=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update'];(function(_0x545bed,_0x221e96){var _0x16c79c=function(_0x465346){while(--_0x465346){_0x545bed['push'](_0x545bed['shift']());}};_0x16c79c(++_0x221e96);}(_0x21af,0xf2));var _0xf21a=function(_0x3c619c,_0x1f56e8){_0x3c619c=_0x3c619c-0x0;var _0x27b820=_0x21af[_0x3c619c];return _0x27b820;};'use strict';var multer=require(_0xf21a('0x0'));var util=require(_0xf21a('0x1'));var path=require(_0xf21a('0x2'));var timeout=require('connect-timeout');var express=require(_0xf21a('0x3'));var router=express[_0xf21a('0x4')]();var fs_extra=require(_0xf21a('0x5'));var auth=require(_0xf21a('0x6'));var interaction=require(_0xf21a('0x7'));var config=require(_0xf21a('0x8'));var controller=require(_0xf21a('0x9'));router['put'](_0xf21a('0xa'),auth[_0xf21a('0xb')](),controller[_0xf21a('0xc')]);router['delete'](_0xf21a('0xa'),auth[_0xf21a('0xb')](),controller[_0xf21a('0xd')]);module[_0xf21a('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 222bdf7..d79e4ec 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 _0x18e1=['STRING','sequelize','name'];(function(_0x4fc877,_0x3d1514){var _0x4b4bc9=function(_0x22d9a0){while(--_0x22d9a0){_0x4fc877['push'](_0x4fc877['shift']());}};_0x4b4bc9(++_0x3d1514);}(_0x18e1,0xdc));var _0x118e=function(_0x55f947,_0x52c099){_0x55f947=_0x55f947-0x0;var _0xcea0b2=_0x18e1[_0x55f947];return _0xcea0b2;};'use strict';var Sequelize=require(_0x118e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x118e('0x1')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x118e('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x4021=['INTEGER','sequelize','exports','STRING','name'];(function(_0x1d17a5,_0x133cc9){var _0x25f3d1=function(_0x20118c){while(--_0x20118c){_0x1d17a5['push'](_0x1d17a5['shift']());}};_0x25f3d1(++_0x133cc9);}(_0x4021,0xb5));var _0x1402=function(_0x377f50,_0x5589ba){_0x377f50=_0x377f50-0x0;var _0x14a9d2=_0x4021[_0x377f50];return _0x14a9d2;};'use strict';var Sequelize=require(_0x1402('0x0'));module[_0x1402('0x1')]={'name':{'type':Sequelize[_0x1402('0x2')],'allowNull':![],'unique':_0x1402('0x3')},'OrderBy':{'type':Sequelize[_0x1402('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x1402('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 d14c072..2be4038 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 _0x6a55=['../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','update','then','destroy','get','ContactItemTypes','UserProfileResource','end','error','name','index','map','ContactItemType','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','params','CmContactHasItem','eml-format','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x6a55,0xdb));var _0x56a5=function(_0x3f5210,_0x32f195){_0x3f5210=_0x3f5210-0x0;var _0x53c3ab=_0x6a55[_0x3f5210];return _0x53c3ab;};'use strict';var emlformat=require(_0x56a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x56a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x56a5('0x2'));var util=require('util');var path=require(_0x56a5('0x3'));var sox=require('sox');var csv=require(_0x56a5('0x4'));var ejs=require(_0x56a5('0x5'));var fs=require('fs');var fs_extra=require(_0x56a5('0x6'));var _=require(_0x56a5('0x7'));var squel=require(_0x56a5('0x8'));var crypto=require(_0x56a5('0x9'));var jsforce=require(_0x56a5('0xa'));var deskjs=require(_0x56a5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x56a5('0xc'));var Papa=require(_0x56a5('0xd'));var Redis=require(_0x56a5('0xe'));var authService=require(_0x56a5('0xf'));var qs=require(_0x56a5('0x10'));var as=require(_0x56a5('0x11'));var hardwareService=require(_0x56a5('0x12'));var logger=require(_0x56a5('0x13'))(_0x56a5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x56a5('0x15'));var db=require(_0x56a5('0x16'))['db'];function respondWithStatusCode(_0x2b9d7d,_0x1a9bf0){_0x1a9bf0=_0x1a9bf0||0xcc;return function(_0x2de420){if(_0x2de420){return _0x2b9d7d[_0x56a5('0x17')](_0x1a9bf0);}return _0x2b9d7d['status'](_0x1a9bf0)['end']();};}function respondWithResult(_0x3e3ff6,_0x1e416f){_0x1e416f=_0x1e416f||0xc8;return function(_0x176c7b){if(_0x176c7b){return _0x3e3ff6[_0x56a5('0x18')](_0x1e416f)[_0x56a5('0x19')](_0x176c7b);}};}function respondWithFilteredResult(_0x2db112,_0xe3091f){return function(_0x5c4028){if(_0x5c4028){var _0x360297=typeof _0xe3091f['offset']===_0x56a5('0x1a')&&typeof _0xe3091f['limit']===_0x56a5('0x1a');var _0x3f3e5b=_0x5c4028[_0x56a5('0x1b')];var _0x28fe74=_0x360297?0x0:_0xe3091f[_0x56a5('0x1c')];var _0x143f3d=_0x360297?_0x5c4028[_0x56a5('0x1b')]:_0xe3091f['offset']+_0xe3091f[_0x56a5('0x1d')];var _0x3db687;if(_0x143f3d>=_0x3f3e5b){_0x143f3d=_0x3f3e5b;_0x3db687=0xc8;}else{_0x3db687=0xce;}_0x2db112[_0x56a5('0x18')](_0x3db687);return _0x2db112[_0x56a5('0x1e')]('Content-Range',_0x28fe74+'-'+_0x143f3d+'/'+_0x3f3e5b)[_0x56a5('0x19')](_0x5c4028);}return null;};}function patchUpdates(_0x1fdb7a){return function(_0xa274f4){try{jsonpatch[_0x56a5('0x1f')](_0xa274f4,_0x1fdb7a,!![]);}catch(_0x155d3b){return BPromise['reject'](_0x155d3b);}return _0xa274f4['save']();};}function saveUpdates(_0x29f181,_0x1c4ab8){return function(_0x487505){if(_0x487505){return _0x487505[_0x56a5('0x20')](_0x29f181)[_0x56a5('0x21')](function(_0x615d49){return _0x615d49;});}return null;};}function removeEntity(_0x15d9f8,_0xe1ded0){return function(_0x616922){if(_0x616922){return _0x616922[_0x56a5('0x22')]()[_0x56a5('0x21')](function(){var _0x2f4514=_0x616922[_0x56a5('0x23')]({'plain':!![]});var _0xcf212=_0x56a5('0x24');return db[_0x56a5('0x25')]['destroy']({'where':{'type':_0xcf212,'resourceId':_0x2f4514['id']}})[_0x56a5('0x21')](function(){return _0x616922;});})[_0x56a5('0x21')](function(){_0x15d9f8[_0x56a5('0x18')](0xcc)[_0x56a5('0x26')]();});}};}function handleEntityNotFound(_0x43a815,_0x527e84){return function(_0x18e863){if(!_0x18e863){_0x43a815['sendStatus'](0x194);}return _0x18e863;};}function handleError(_0x2efde7,_0x3c6ac1){_0x3c6ac1=_0x3c6ac1||0x1f4;return function(_0x1b27b5){logger[_0x56a5('0x27')](_0x1b27b5['stack']);if(_0x1b27b5[_0x56a5('0x28')]){delete _0x1b27b5[_0x56a5('0x28')];}_0x2efde7[_0x56a5('0x18')](_0x3c6ac1)['send'](_0x1b27b5);};}exports[_0x56a5('0x29')]=function(_0x29dbe7,_0xeb4378){var _0x214649={},_0x55978e={},_0x4e1a6b={'count':0x0,'rows':[]};var _0x78b2b1=_[_0x56a5('0x2a')](db[_0x56a5('0x2b')][_0x56a5('0x2c')],function(_0x643937){return{'name':_0x643937['fieldName'],'type':_0x643937['type'][_0x56a5('0x2d')]};});_0x55978e[_0x56a5('0x2e')]=_[_0x56a5('0x2a')](_0x78b2b1,'name');_0x55978e[_0x56a5('0x2f')]=_[_0x56a5('0x30')](_0x29dbe7['query']);_0x55978e['filters']=_['intersection'](_0x55978e['model'],_0x55978e[_0x56a5('0x2f')]);_0x214649[_0x56a5('0x31')]=_[_0x56a5('0x32')](_0x55978e['model'],qs[_0x56a5('0x33')](_0x29dbe7['query'][_0x56a5('0x33')]));_0x214649[_0x56a5('0x31')]=_0x214649['attributes'][_0x56a5('0x34')]?_0x214649['attributes']:_0x55978e[_0x56a5('0x2e')];if(!_0x29dbe7[_0x56a5('0x2f')][_0x56a5('0x35')]('nolimit')){_0x214649[_0x56a5('0x1d')]=qs[_0x56a5('0x1d')](_0x29dbe7[_0x56a5('0x2f')]['limit']);_0x214649[_0x56a5('0x1c')]=qs[_0x56a5('0x1c')](_0x29dbe7[_0x56a5('0x2f')][_0x56a5('0x1c')]);}_0x214649[_0x56a5('0x36')]=qs['sort'](_0x29dbe7['query'][_0x56a5('0x37')]);_0x214649[_0x56a5('0x38')]=qs[_0x56a5('0x39')](_[_0x56a5('0x3a')](_0x29dbe7[_0x56a5('0x2f')],_0x55978e[_0x56a5('0x39')]),_0x78b2b1);if(_0x29dbe7[_0x56a5('0x2f')][_0x56a5('0x3b')]){_0x214649[_0x56a5('0x38')]=_[_0x56a5('0x3c')](_0x214649[_0x56a5('0x38')],{'$or':_[_0x56a5('0x2a')](_0x78b2b1,function(_0x184186){if(_0x184186[_0x56a5('0x3d')]!==_0x56a5('0x3e')){var _0x32318c={};_0x32318c[_0x184186[_0x56a5('0x28')]]={'$like':'%'+_0x29dbe7[_0x56a5('0x2f')][_0x56a5('0x3b')]+'%'};return _0x32318c;}})});}_0x214649=_[_0x56a5('0x3c')]({},_0x214649,_0x29dbe7[_0x56a5('0x3f')]);var _0x1cca30={'where':_0x214649['where']};return db['ContactItemType'][_0x56a5('0x1b')](_0x1cca30)['then'](function(_0x7c3c3e){_0x4e1a6b[_0x56a5('0x1b')]=_0x7c3c3e;if(_0x29dbe7[_0x56a5('0x2f')][_0x56a5('0x40')]){_0x214649[_0x56a5('0x41')]=[{'all':!![]}];}return db[_0x56a5('0x2b')]['findAll'](_0x214649);})['then'](function(_0x29ab9b){_0x4e1a6b[_0x56a5('0x42')]=_0x29ab9b;return _0x4e1a6b;})[_0x56a5('0x21')](respondWithFilteredResult(_0xeb4378,_0x214649))[_0x56a5('0x43')](handleError(_0xeb4378,null));};exports[_0x56a5('0x44')]=function(_0x2ae3ea,_0x50f029){var _0x1191d0={'raw':!![],'where':{'id':_0x2ae3ea['params']['id']}},_0x252c94={};_0x252c94[_0x56a5('0x2e')]=_[_0x56a5('0x30')](db[_0x56a5('0x2b')][_0x56a5('0x2c')]);_0x252c94['query']=_[_0x56a5('0x30')](_0x2ae3ea['query']);_0x252c94[_0x56a5('0x39')]=_[_0x56a5('0x32')](_0x252c94['model'],_0x252c94[_0x56a5('0x2f')]);_0x1191d0['attributes']=_[_0x56a5('0x32')](_0x252c94[_0x56a5('0x2e')],qs['fields'](_0x2ae3ea[_0x56a5('0x2f')]['fields']));_0x1191d0[_0x56a5('0x31')]=_0x1191d0['attributes'][_0x56a5('0x34')]?_0x1191d0['attributes']:_0x252c94[_0x56a5('0x2e')];if(_0x2ae3ea[_0x56a5('0x2f')][_0x56a5('0x40')]){_0x1191d0[_0x56a5('0x41')]=[{'all':!![]}];}_0x1191d0=_[_0x56a5('0x3c')]({},_0x1191d0,_0x2ae3ea[_0x56a5('0x3f')]);return db[_0x56a5('0x2b')]['find'](_0x1191d0)['then'](handleEntityNotFound(_0x50f029,null))['then'](respondWithResult(_0x50f029,null))[_0x56a5('0x43')](handleError(_0x50f029,null));};exports[_0x56a5('0x45')]=function(_0x1e510a,_0x55d2e2){return db[_0x56a5('0x2b')][_0x56a5('0x45')](_0x1e510a[_0x56a5('0x46')],{})['then'](function(_0x19829f){var _0x3e38b9=_0x1e510a['user'][_0x56a5('0x23')]({'plain':!![]});if(!_0x3e38b9)throw new Error(_0x56a5('0x47'));if(_0x3e38b9[_0x56a5('0x48')]===_0x56a5('0x49')){var _0xcb3cb9=_0x19829f['get']({'plain':!![]});var _0x2b1fcb=_0x56a5('0x24');return db[_0x56a5('0x4a')][_0x56a5('0x4b')]({'where':{'name':_0x2b1fcb,'userProfileId':_0x3e38b9[_0x56a5('0x4c')]},'raw':!![]})['then'](function(_0x22be73){if(_0x22be73&&_0x22be73[_0x56a5('0x4d')]===0x0){return db['UserProfileResource'][_0x56a5('0x45')]({'name':_0xcb3cb9[_0x56a5('0x28')],'resourceId':_0xcb3cb9['id'],'type':_0x22be73[_0x56a5('0x28')],'sectionId':_0x22be73['id']},{})['then'](function(){return _0x19829f;});}else{return _0x19829f;}})[_0x56a5('0x43')](function(_0x5c41a9){logger[_0x56a5('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c41a9);throw _0x5c41a9;});}return _0x19829f;})[_0x56a5('0x21')](respondWithResult(_0x55d2e2,0xc9))[_0x56a5('0x43')](handleError(_0x55d2e2,null));};exports[_0x56a5('0x20')]=function(_0x14647d,_0x4afdb9){if(_0x14647d[_0x56a5('0x46')]['id']){delete _0x14647d['body']['id'];}return db[_0x56a5('0x2b')][_0x56a5('0x4b')]({'where':{'id':_0x14647d[_0x56a5('0x4e')]['id']}})[_0x56a5('0x21')](handleEntityNotFound(_0x4afdb9,null))[_0x56a5('0x21')](saveUpdates(_0x14647d[_0x56a5('0x46')],null))[_0x56a5('0x21')](respondWithResult(_0x4afdb9,null))[_0x56a5('0x43')](handleError(_0x4afdb9,null));};exports[_0x56a5('0x22')]=function(_0x76c6bb,_0x5279fe){return db[_0x56a5('0x2b')][_0x56a5('0x4b')]({'where':{'id':_0x76c6bb['params']['id']}})[_0x56a5('0x21')](handleEntityNotFound(_0x5279fe,null))['then'](db[_0x56a5('0x4f')][_0x56a5('0x20')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x76c6bb[_0x56a5('0x4e')]['id']}}))[_0x56a5('0x21')](removeEntity(_0x5279fe,null))[_0x56a5('0x43')](handleError(_0x5279fe,null));}; \ No newline at end of file +var _0xed3c=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ContactItemTypes','UserProfileSection','userProfileId','autoAssociation','body','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed3c,0x1a6));var _0xced3=function(_0x1f5143,_0x5e31e6){_0x1f5143=_0x1f5143-0x0;var _0x383a38=_0xed3c[_0x1f5143];return _0x383a38;};'use strict';var emlformat=require(_0xced3('0x0'));var rimraf=require(_0xced3('0x1'));var zipdir=require(_0xced3('0x2'));var jsonpatch=require(_0xced3('0x3'));var rp=require('request-promise');var moment=require(_0xced3('0x4'));var BPromise=require(_0xced3('0x5'));var Mustache=require(_0xced3('0x6'));var util=require('util');var path=require('path');var sox=require(_0xced3('0x7'));var csv=require(_0xced3('0x8'));var ejs=require(_0xced3('0x9'));var fs=require('fs');var fs_extra=require(_0xced3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xced3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xced3('0xc'));var Redis=require(_0xced3('0xd'));var authService=require(_0xced3('0xe'));var qs=require(_0xced3('0xf'));var as=require(_0xced3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xced3('0x11'))(_0xced3('0x12'));var utils=require(_0xced3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xced3('0x14'));var db=require(_0xced3('0x15'))['db'];function respondWithStatusCode(_0x42d879,_0x3b2ac4){_0x3b2ac4=_0x3b2ac4||0xcc;return function(_0x457caf){if(_0x457caf){return _0x42d879[_0xced3('0x16')](_0x3b2ac4);}return _0x42d879[_0xced3('0x17')](_0x3b2ac4)['end']();};}function respondWithResult(_0x65bb58,_0x5e186e){_0x5e186e=_0x5e186e||0xc8;return function(_0xf2db6f){if(_0xf2db6f){return _0x65bb58[_0xced3('0x17')](_0x5e186e)[_0xced3('0x18')](_0xf2db6f);}};}function respondWithFilteredResult(_0x39e4aa,_0x4dd4c3){return function(_0x146a21){if(_0x146a21){var _0x322c2d=typeof _0x4dd4c3['offset']===_0xced3('0x19')&&typeof _0x4dd4c3[_0xced3('0x1a')]===_0xced3('0x19');var _0x17f611=_0x146a21['count'];var _0x4569af=_0x322c2d?0x0:_0x4dd4c3['offset'];var _0x353580=_0x322c2d?_0x146a21[_0xced3('0x1b')]:_0x4dd4c3[_0xced3('0x1c')]+_0x4dd4c3[_0xced3('0x1a')];var _0x44143f;if(_0x353580>=_0x17f611){_0x353580=_0x17f611;_0x44143f=0xc8;}else{_0x44143f=0xce;}_0x39e4aa[_0xced3('0x17')](_0x44143f);return _0x39e4aa[_0xced3('0x1d')](_0xced3('0x1e'),_0x4569af+'-'+_0x353580+'/'+_0x17f611)[_0xced3('0x18')](_0x146a21);}return null;};}function patchUpdates(_0x17c011){return function(_0x2008f2){try{jsonpatch['apply'](_0x2008f2,_0x17c011,!![]);}catch(_0x5b8b1f){return BPromise['reject'](_0x5b8b1f);}return _0x2008f2[_0xced3('0x1f')]();};}function saveUpdates(_0x342b9e,_0x21e074){return function(_0x4bf915){if(_0x4bf915){return _0x4bf915[_0xced3('0x20')](_0x342b9e)[_0xced3('0x21')](function(_0x526854){return _0x526854;});}return null;};}function removeEntity(_0x559fa2,_0x3adf14){return function(_0x101708){if(_0x101708){return _0x101708[_0xced3('0x22')]()[_0xced3('0x21')](function(){var _0x50f7c1=_0x101708[_0xced3('0x23')]({'plain':!![]});var _0x23f92b='ContactItemTypes';return db[_0xced3('0x24')]['destroy']({'where':{'type':_0x23f92b,'resourceId':_0x50f7c1['id']}})[_0xced3('0x21')](function(){return _0x101708;});})[_0xced3('0x21')](function(){_0x559fa2[_0xced3('0x17')](0xcc)[_0xced3('0x25')]();});}};}function handleEntityNotFound(_0x2ec2c4,_0x502cf1){return function(_0x5454c0){if(!_0x5454c0){_0x2ec2c4[_0xced3('0x16')](0x194);}return _0x5454c0;};}function handleError(_0x5bb425,_0x2ab8a8){_0x2ab8a8=_0x2ab8a8||0x1f4;return function(_0x1e6923){logger['error'](_0x1e6923[_0xced3('0x26')]);if(_0x1e6923[_0xced3('0x27')]){delete _0x1e6923[_0xced3('0x27')];}_0x5bb425[_0xced3('0x17')](_0x2ab8a8)[_0xced3('0x28')](_0x1e6923);};}exports[_0xced3('0x29')]=function(_0x895a32,_0x41d003){var _0x116cc7={},_0x559b8e={},_0xa78899={'count':0x0,'rows':[]};var _0x1b8baa=_[_0xced3('0x2a')](db[_0xced3('0x2b')][_0xced3('0x2c')],function(_0x21e4a2){return{'name':_0x21e4a2[_0xced3('0x2d')],'type':_0x21e4a2[_0xced3('0x2e')][_0xced3('0x2f')]};});_0x559b8e[_0xced3('0x30')]=_[_0xced3('0x2a')](_0x1b8baa,_0xced3('0x27'));_0x559b8e[_0xced3('0x31')]=_[_0xced3('0x32')](_0x895a32[_0xced3('0x31')]);_0x559b8e[_0xced3('0x33')]=_[_0xced3('0x34')](_0x559b8e[_0xced3('0x30')],_0x559b8e[_0xced3('0x31')]);_0x116cc7[_0xced3('0x35')]=_[_0xced3('0x34')](_0x559b8e['model'],qs[_0xced3('0x36')](_0x895a32['query'][_0xced3('0x36')]));_0x116cc7[_0xced3('0x35')]=_0x116cc7[_0xced3('0x35')][_0xced3('0x37')]?_0x116cc7[_0xced3('0x35')]:_0x559b8e[_0xced3('0x30')];if(!_0x895a32[_0xced3('0x31')][_0xced3('0x38')](_0xced3('0x39'))){_0x116cc7[_0xced3('0x1a')]=qs['limit'](_0x895a32[_0xced3('0x31')][_0xced3('0x1a')]);_0x116cc7['offset']=qs[_0xced3('0x1c')](_0x895a32[_0xced3('0x31')][_0xced3('0x1c')]);}_0x116cc7['order']=qs['sort'](_0x895a32[_0xced3('0x31')]['sort']);_0x116cc7[_0xced3('0x3a')]=qs[_0xced3('0x33')](_['pick'](_0x895a32[_0xced3('0x31')],_0x559b8e[_0xced3('0x33')]),_0x1b8baa);if(_0x895a32[_0xced3('0x31')]['filter']){_0x116cc7[_0xced3('0x3a')]=_['merge'](_0x116cc7['where'],{'$or':_[_0xced3('0x2a')](_0x1b8baa,function(_0x31e281){if(_0x31e281[_0xced3('0x2e')]!=='VIRTUAL'){var _0xb2cf20={};_0xb2cf20[_0x31e281[_0xced3('0x27')]]={'$like':'%'+_0x895a32[_0xced3('0x31')][_0xced3('0x3b')]+'%'};return _0xb2cf20;}})});}_0x116cc7=_[_0xced3('0x3c')]({},_0x116cc7,_0x895a32[_0xced3('0x3d')]);var _0x30e890={'where':_0x116cc7[_0xced3('0x3a')]};return db[_0xced3('0x2b')][_0xced3('0x1b')](_0x30e890)[_0xced3('0x21')](function(_0x38855f){_0xa78899[_0xced3('0x1b')]=_0x38855f;if(_0x895a32[_0xced3('0x31')][_0xced3('0x3e')]){_0x116cc7['include']=[{'all':!![]}];}return db[_0xced3('0x2b')][_0xced3('0x3f')](_0x116cc7);})[_0xced3('0x21')](function(_0x1a6c1f){_0xa78899[_0xced3('0x40')]=_0x1a6c1f;return _0xa78899;})[_0xced3('0x21')](respondWithFilteredResult(_0x41d003,_0x116cc7))[_0xced3('0x41')](handleError(_0x41d003,null));};exports[_0xced3('0x42')]=function(_0x1ab7e0,_0x4cea5c){var _0x6c0238={'raw':!![],'where':{'id':_0x1ab7e0[_0xced3('0x43')]['id']}},_0x47ab23={};_0x47ab23[_0xced3('0x30')]=_[_0xced3('0x32')](db['ContactItemType'][_0xced3('0x2c')]);_0x47ab23[_0xced3('0x31')]=_[_0xced3('0x32')](_0x1ab7e0[_0xced3('0x31')]);_0x47ab23['filters']=_[_0xced3('0x34')](_0x47ab23[_0xced3('0x30')],_0x47ab23[_0xced3('0x31')]);_0x6c0238[_0xced3('0x35')]=_[_0xced3('0x34')](_0x47ab23['model'],qs[_0xced3('0x36')](_0x1ab7e0[_0xced3('0x31')][_0xced3('0x36')]));_0x6c0238[_0xced3('0x35')]=_0x6c0238[_0xced3('0x35')][_0xced3('0x37')]?_0x6c0238[_0xced3('0x35')]:_0x47ab23['model'];if(_0x1ab7e0[_0xced3('0x31')][_0xced3('0x3e')]){_0x6c0238['include']=[{'all':!![]}];}_0x6c0238=_['merge']({},_0x6c0238,_0x1ab7e0[_0xced3('0x3d')]);return db['ContactItemType'][_0xced3('0x44')](_0x6c0238)[_0xced3('0x21')](handleEntityNotFound(_0x4cea5c,null))[_0xced3('0x21')](respondWithResult(_0x4cea5c,null))[_0xced3('0x41')](handleError(_0x4cea5c,null));};exports[_0xced3('0x45')]=function(_0x1b3396,_0x3700ed){return db[_0xced3('0x2b')][_0xced3('0x45')](_0x1b3396['body'],{})[_0xced3('0x21')](function(_0x8df206){var _0x2aa876=_0x1b3396[_0xced3('0x46')][_0xced3('0x23')]({'plain':!![]});if(!_0x2aa876)throw new Error(_0xced3('0x47'));if(_0x2aa876['role']===_0xced3('0x46')){var _0x629ecf=_0x8df206[_0xced3('0x23')]({'plain':!![]});var _0x409da0=_0xced3('0x48');return db[_0xced3('0x49')][_0xced3('0x44')]({'where':{'name':_0x409da0,'userProfileId':_0x2aa876[_0xced3('0x4a')]},'raw':!![]})[_0xced3('0x21')](function(_0x44d779){if(_0x44d779&&_0x44d779[_0xced3('0x4b')]===0x0){return db[_0xced3('0x24')]['create']({'name':_0x629ecf[_0xced3('0x27')],'resourceId':_0x629ecf['id'],'type':_0x44d779['name'],'sectionId':_0x44d779['id']},{})[_0xced3('0x21')](function(){return _0x8df206;});}else{return _0x8df206;}})[_0xced3('0x41')](function(_0xc93e05){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc93e05);throw _0xc93e05;});}return _0x8df206;})[_0xced3('0x21')](respondWithResult(_0x3700ed,0xc9))[_0xced3('0x41')](handleError(_0x3700ed,null));};exports['update']=function(_0x3f41cc,_0x4ae67d){if(_0x3f41cc[_0xced3('0x4c')]['id']){delete _0x3f41cc[_0xced3('0x4c')]['id'];}return db['ContactItemType'][_0xced3('0x44')]({'where':{'id':_0x3f41cc[_0xced3('0x43')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x4ae67d,null))['then'](saveUpdates(_0x3f41cc[_0xced3('0x4c')],null))['then'](respondWithResult(_0x4ae67d,null))[_0xced3('0x41')](handleError(_0x4ae67d,null));};exports[_0xced3('0x22')]=function(_0x4694b8,_0x168c36){return db[_0xced3('0x2b')][_0xced3('0x44')]({'where':{'id':_0x4694b8[_0xced3('0x43')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x168c36,null))[_0xced3('0x21')](db[_0xced3('0x4d')][_0xced3('0x20')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4694b8['params']['id']}}))[_0xced3('0x21')](removeEntity(_0x168c36,null))[_0xced3('0x41')](handleError(_0x168c36,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 00d39b3..4e40f5e 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 _0x3da7=['moment','bluebird','../../config/environment','./contactItemType.attributes','define','ContactItemType','lodash','../../config/logger','api'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0x3da7,0x14a));var _0x73da=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x3da7[_0x2261ce];return _0x524640;};'use strict';var _=require(_0x73da('0x0'));var util=require('util');var logger=require(_0x73da('0x1'))(_0x73da('0x2'));var moment=require(_0x73da('0x3'));var BPromise=require(_0x73da('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x73da('0x5'));var attributes=require(_0x73da('0x6'));module['exports']=function(_0x17af10,_0x27057b){return _0x17af10[_0x73da('0x7')](_0x73da('0x8'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79f7=['rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3cff0b,_0x139618){var _0x6a22a=function(_0x13cd99){while(--_0x13cd99){_0x3cff0b['push'](_0x3cff0b['shift']());}};_0x6a22a(++_0x139618);}(_0x79f7,0xbb));var _0x779f=function(_0x28a2be,_0x5f6b50){_0x28a2be=_0x28a2be-0x0;var _0x3925f2=_0x79f7[_0x28a2be];return _0x3925f2;};'use strict';var _=require('lodash');var util=require(_0x779f('0x0'));var logger=require(_0x779f('0x1'))(_0x779f('0x2'));var moment=require('moment');var BPromise=require(_0x779f('0x3'));var rp=require(_0x779f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x779f('0x5'));var config=require(_0x779f('0x6'));var attributes=require(_0x779f('0x7'));module[_0x779f('0x8')]=function(_0x4e672b,_0x22a512){return _0x4e672b[_0x779f('0x9')](_0x779f('0xa'),attributes,{'tableName':_0x779f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 0404d1c..df22503 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 _0x4bb0=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','error','ContactItemType,\x20%s,\x20%s','message','info','catch'];(function(_0x534a75,_0x32e732){var _0xcc7d09=function(_0xe48fde){while(--_0xe48fde){_0x534a75['push'](_0x534a75['shift']());}};_0xcc7d09(++_0x32e732);}(_0x4bb0,0x73));var _0x04bb=function(_0x3f2d02,_0x2c7deb){_0x3f2d02=_0x3f2d02-0x0;var _0x54092b=_0x4bb0[_0x3f2d02];return _0x54092b;};'use strict';var _=require(_0x04bb('0x0'));var util=require(_0x04bb('0x1'));var moment=require(_0x04bb('0x2'));var BPromise=require(_0x04bb('0x3'));var rs=require(_0x04bb('0x4'));var fs=require('fs');var Redis=require(_0x04bb('0x5'));var db=require(_0x04bb('0x6'))['db'];var utils=require(_0x04bb('0x7'));var logger=require(_0x04bb('0x8'))(_0x04bb('0x9'));var config=require(_0x04bb('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x04bb('0xb')][_0x04bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x453fde,_0x3b8695,_0x152da4){return new BPromise(function(_0x1b6fbd,_0x2f35cc){return client[_0x04bb('0xd')](_0x453fde,_0x152da4)[_0x04bb('0xe')](function(_0x5594d8){logger['info']('ContactItemType,\x20%s,\x20%s',_0x3b8695,_0x04bb('0xf'));logger[_0x04bb('0x10')](_0x04bb('0x11'),_0x3b8695,_0x04bb('0xf'),JSON['stringify'](_0x5594d8));if(_0x5594d8[_0x04bb('0x12')]){if(_0x5594d8[_0x04bb('0x12')]['code']===0x1f4){logger[_0x04bb('0x12')](_0x04bb('0x13'),_0x3b8695,_0x5594d8[_0x04bb('0x12')][_0x04bb('0x14')]);return _0x2f35cc(_0x5594d8['error'][_0x04bb('0x14')]);}logger[_0x04bb('0x12')](_0x04bb('0x13'),_0x3b8695,_0x5594d8['error']['message']);return _0x1b6fbd(_0x5594d8[_0x04bb('0x12')][_0x04bb('0x14')]);}else{logger[_0x04bb('0x15')](_0x04bb('0x13'),_0x3b8695,_0x04bb('0xf'));_0x1b6fbd(_0x5594d8['result'][_0x04bb('0x14')]);}})[_0x04bb('0x16')](function(_0xc000c6){logger['error']('ContactItemType,\x20%s,\x20%s',_0x3b8695,_0xc000c6);_0x2f35cc(_0xc000c6);});});} \ No newline at end of file +var _0x112a=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x323cd8,_0x21bbac){var _0x2c757f=function(_0xafd810){while(--_0xafd810){_0x323cd8['push'](_0x323cd8['shift']());}};_0x2c757f(++_0x21bbac);}(_0x112a,0x115));var _0xa112=function(_0x491bee,_0x1a689e){_0x491bee=_0x491bee-0x0;var _0x53e540=_0x112a[_0x491bee];return _0x53e540;};'use strict';var _=require(_0xa112('0x0'));var util=require(_0xa112('0x1'));var moment=require(_0xa112('0x2'));var BPromise=require(_0xa112('0x3'));var rs=require(_0xa112('0x4'));var fs=require('fs');var Redis=require(_0xa112('0x5'));var db=require(_0xa112('0x6'))['db'];var utils=require(_0xa112('0x7'));var logger=require(_0xa112('0x8'))(_0xa112('0x9'));var config=require(_0xa112('0xa'));var jayson=require(_0xa112('0xb'));var client=jayson[_0xa112('0xc')][_0xa112('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x676aa8,_0x11331d,_0x3aaae7){return new BPromise(function(_0x7f5ede,_0x377238){return client[_0xa112('0xe')](_0x676aa8,_0x3aaae7)[_0xa112('0xf')](function(_0xb6dcd){logger[_0xa112('0x10')]('ContactItemType,\x20%s,\x20%s',_0x11331d,_0xa112('0x11'));logger['debug'](_0xa112('0x12'),_0x11331d,_0xa112('0x11'),JSON[_0xa112('0x13')](_0xb6dcd));if(_0xb6dcd[_0xa112('0x14')]){if(_0xb6dcd[_0xa112('0x14')][_0xa112('0x15')]===0x1f4){logger[_0xa112('0x14')](_0xa112('0x16'),_0x11331d,_0xb6dcd[_0xa112('0x14')][_0xa112('0x17')]);return _0x377238(_0xb6dcd[_0xa112('0x14')][_0xa112('0x17')]);}logger[_0xa112('0x14')](_0xa112('0x16'),_0x11331d,_0xb6dcd['error'][_0xa112('0x17')]);return _0x7f5ede(_0xb6dcd[_0xa112('0x14')][_0xa112('0x17')]);}else{logger[_0xa112('0x10')](_0xa112('0x16'),_0x11331d,_0xa112('0x11'));_0x7f5ede(_0xb6dcd[_0xa112('0x18')][_0xa112('0x17')]);}})[_0xa112('0x19')](function(_0x2a0959){logger[_0xa112('0x14')](_0xa112('0x16'),_0x11331d,_0x2a0959);_0x377238(_0x2a0959);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index e09cf16..89d9333 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 _0xec00=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','show','create','/:id','update','delete'];(function(_0x1a7433,_0x3e65ed){var _0x24c1cd=function(_0x2a0304){while(--_0x2a0304){_0x1a7433['push'](_0x1a7433['shift']());}};_0x24c1cd(++_0x3e65ed);}(_0xec00,0xbf));var _0x0ec0=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0xec00[_0x5534fe];return _0x3d1dc2;};'use strict';var multer=require(_0x0ec0('0x0'));var util=require(_0x0ec0('0x1'));var path=require(_0x0ec0('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ec0('0x3'));var router=express[_0x0ec0('0x4')]();var fs_extra=require(_0x0ec0('0x5'));var auth=require(_0x0ec0('0x6'));var interaction=require(_0x0ec0('0x7'));var config=require(_0x0ec0('0x8'));var controller=require(_0x0ec0('0x9'));router[_0x0ec0('0xa')]('/',auth[_0x0ec0('0xb')](),controller[_0x0ec0('0xc')]);router['get']('/:id',auth[_0x0ec0('0xb')](),controller[_0x0ec0('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0ec0('0xe')]);router['put'](_0x0ec0('0xf'),auth[_0x0ec0('0xb')](),controller[_0x0ec0('0x10')]);router[_0x0ec0('0x11')](_0x0ec0('0xf'),auth[_0x0ec0('0xb')](),controller['destroy']);module[_0x0ec0('0x12')]=router; \ No newline at end of file +var _0xea53=['./contactItemType.controller','get','isAuthenticated','index','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x16f7c3,_0x7cc6bd){var _0x259a52=function(_0x5d494a){while(--_0x5d494a){_0x16f7c3['push'](_0x16f7c3['shift']());}};_0x259a52(++_0x7cc6bd);}(_0xea53,0x1ea));var _0x3ea5=function(_0x1a624d,_0x314d2c){_0x1a624d=_0x1a624d-0x0;var _0x3703b3=_0xea53[_0x1a624d];return _0x3703b3;};'use strict';var multer=require(_0x3ea5('0x0'));var util=require(_0x3ea5('0x1'));var path=require(_0x3ea5('0x2'));var timeout=require(_0x3ea5('0x3'));var express=require(_0x3ea5('0x4'));var router=express[_0x3ea5('0x5')]();var fs_extra=require(_0x3ea5('0x6'));var auth=require(_0x3ea5('0x7'));var interaction=require(_0x3ea5('0x8'));var config=require(_0x3ea5('0x9'));var controller=require(_0x3ea5('0xa'));router[_0x3ea5('0xb')]('/',auth[_0x3ea5('0xc')](),controller[_0x3ea5('0xd')]);router['get']('/:id',auth[_0x3ea5('0xc')](),controller['show']);router[_0x3ea5('0xe')]('/',auth[_0x3ea5('0xc')](),controller[_0x3ea5('0xf')]);router['put'](_0x3ea5('0x10'),auth['isAuthenticated'](),controller[_0x3ea5('0x11')]);router[_0x3ea5('0x12')](_0x3ea5('0x10'),auth[_0x3ea5('0xc')](),controller['destroy']);module[_0x3ea5('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index e1e5975..76836ed 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(_0x4cf1a3,_0x458d03){var _0x3b507b=function(_0x20b831){while(--_0x20b831){_0x4cf1a3['push'](_0x4cf1a3['shift']());}};_0x3b507b(++_0x458d03);}(_0xb10b,0x12a));var _0xbb10=function(_0x13c70c,_0x546b34){_0x13c70c=_0x13c70c-0x0;var _0x50f0f2=_0xb10b[_0x13c70c];return _0x50f0f2;};'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 _0xb10b=['name','sequelize','STRING'];(function(_0x24fbf1,_0x4a8e90){var _0x2e8593=function(_0x3689e0){while(--_0x3689e0){_0x24fbf1['push'](_0x24fbf1['shift']());}};_0x2e8593(++_0x4a8e90);}(_0xb10b,0x12a));var _0xbb10=function(_0x2aab8e,_0x440d3b){_0x2aab8e=_0x2aab8e-0x0;var _0x2a67=_0xb10b[_0x2aab8e];return _0x2a67;};'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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 5bc3e3b..eae6ae8 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 _0x13a9=['attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','getItems','findOne','DashboardItem','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','CustomDashboards','UserProfileResource','error','stack','name','index','Dashboard','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','length','attributes','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','role','update','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1'];(function(_0x1e2e92,_0x14fe3f){var _0x2541ac=function(_0x45a489){while(--_0x45a489){_0x1e2e92['push'](_0x1e2e92['shift']());}};_0x2541ac(++_0x14fe3f);}(_0x13a9,0x10e));var _0x913a=function(_0x4e0334,_0x57bf8){_0x4e0334=_0x4e0334-0x0;var _0x270733=_0x13a9[_0x4e0334];return _0x270733;};'use strict';var emlformat=require(_0x913a('0x0'));var rimraf=require(_0x913a('0x1'));var zipdir=require(_0x913a('0x2'));var jsonpatch=require(_0x913a('0x3'));var rp=require('request-promise');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('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x913a('0xa'));var squel=require(_0x913a('0xb'));var crypto=require('crypto');var jsforce=require(_0x913a('0xc'));var deskjs=require(_0x913a('0xd'));var toCsv=require(_0x913a('0xe'));var querystring=require(_0x913a('0xf'));var Papa=require('papaparse');var Redis=require(_0x913a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x913a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x913a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x913a('0x13'));var config=require(_0x913a('0x14'));var licenseUtil=require(_0x913a('0x15'));var db=require(_0x913a('0x16'))['db'];config[_0x913a('0x17')]=_[_0x913a('0x18')](config['redis'],{'host':_0x913a('0x19'),'port':0x18eb});var socket=require(_0x913a('0x1a'))(new Redis(config['redis']));require(_0x913a('0x1b'))[_0x913a('0x1c')](socket);function respondWithStatusCode(_0x23db48,_0x4e2a79){_0x4e2a79=_0x4e2a79||0xcc;return function(_0x5b8b70){if(_0x5b8b70){return _0x23db48[_0x913a('0x1d')](_0x4e2a79);}return _0x23db48[_0x913a('0x1e')](_0x4e2a79)[_0x913a('0x1f')]();};}function respondWithResult(_0x5440c3,_0x3fabfc){_0x3fabfc=_0x3fabfc||0xc8;return function(_0x4299e4){if(_0x4299e4){return _0x5440c3[_0x913a('0x1e')](_0x3fabfc)[_0x913a('0x20')](_0x4299e4);}};}function respondWithFilteredResult(_0x26b33a,_0x35aa2c){return function(_0x443c17){if(_0x443c17){var _0x595e85=typeof _0x35aa2c[_0x913a('0x21')]===_0x913a('0x22')&&typeof _0x35aa2c[_0x913a('0x23')]===_0x913a('0x22');var _0x6fe362=_0x443c17[_0x913a('0x24')];var _0x2942a8=_0x595e85?0x0:_0x35aa2c[_0x913a('0x21')];var _0x1489b6=_0x595e85?_0x443c17[_0x913a('0x24')]:_0x35aa2c['offset']+_0x35aa2c['limit'];var _0x4aa97f;if(_0x1489b6>=_0x6fe362){_0x1489b6=_0x6fe362;_0x4aa97f=0xc8;}else{_0x4aa97f=0xce;}_0x26b33a[_0x913a('0x1e')](_0x4aa97f);return _0x26b33a[_0x913a('0x25')](_0x913a('0x26'),_0x2942a8+'-'+_0x1489b6+'/'+_0x6fe362)[_0x913a('0x20')](_0x443c17);}return null;};}function patchUpdates(_0x5128a4){return function(_0xd98805){try{jsonpatch[_0x913a('0x27')](_0xd98805,_0x5128a4,!![]);}catch(_0x5ec6d0){return BPromise[_0x913a('0x28')](_0x5ec6d0);}return _0xd98805[_0x913a('0x29')]();};}function saveUpdates(_0x53e37f,_0x5a220b){return function(_0x273f4c){if(_0x273f4c){return _0x273f4c['update'](_0x53e37f)['then'](function(_0x15c732){return _0x15c732;});}return null;};}function removeEntity(_0x2628e9,_0x36d4fb){return function(_0x4ada43){if(_0x4ada43){return _0x4ada43[_0x913a('0x2a')]()[_0x913a('0x2b')](function(){var _0x538b59=_0x4ada43[_0x913a('0x2c')]({'plain':!![]});var _0x16a550=_0x913a('0x2d');return db[_0x913a('0x2e')]['destroy']({'where':{'type':_0x16a550,'resourceId':_0x538b59['id']}})[_0x913a('0x2b')](function(){return _0x4ada43;});})[_0x913a('0x2b')](function(){_0x2628e9[_0x913a('0x1e')](0xcc)[_0x913a('0x1f')]();});}};}function handleEntityNotFound(_0x20ac10,_0x15e45a){return function(_0x2ab993){if(!_0x2ab993){_0x20ac10[_0x913a('0x1d')](0x194);}return _0x2ab993;};}function handleError(_0x34c179,_0xa39820){_0xa39820=_0xa39820||0x1f4;return function(_0x44df8f){logger[_0x913a('0x2f')](_0x44df8f[_0x913a('0x30')]);if(_0x44df8f[_0x913a('0x31')]){delete _0x44df8f[_0x913a('0x31')];}_0x34c179['status'](_0xa39820)['send'](_0x44df8f);};}exports[_0x913a('0x32')]=function(_0x370a20,_0x2e98e4){var _0xa5b601={},_0x29b46d={},_0x3dad99={'count':0x0,'rows':[]};var _0x409767=_['map'](db[_0x913a('0x33')][_0x913a('0x34')],function(_0x1d07f5){return{'name':_0x1d07f5[_0x913a('0x35')],'type':_0x1d07f5[_0x913a('0x36')][_0x913a('0x37')]};});_0x29b46d[_0x913a('0x38')]=_[_0x913a('0x39')](_0x409767,_0x913a('0x31'));_0x29b46d[_0x913a('0x3a')]=_['keys'](_0x370a20[_0x913a('0x3a')]);_0x29b46d['filters']=_[_0x913a('0x3b')](_0x29b46d[_0x913a('0x38')],_0x29b46d['query']);_0xa5b601['attributes']=_[_0x913a('0x3b')](_0x29b46d[_0x913a('0x38')],qs[_0x913a('0x3c')](_0x370a20['query']['fields']));_0xa5b601['attributes']=_0xa5b601['attributes'][_0x913a('0x3d')]?_0xa5b601[_0x913a('0x3e')]:_0x29b46d[_0x913a('0x38')];if(!_0x370a20[_0x913a('0x3a')]['hasOwnProperty']('nolimit')){_0xa5b601[_0x913a('0x23')]=qs['limit'](_0x370a20['query'][_0x913a('0x23')]);_0xa5b601[_0x913a('0x21')]=qs[_0x913a('0x21')](_0x370a20[_0x913a('0x3a')][_0x913a('0x21')]);}_0xa5b601[_0x913a('0x3f')]=qs['sort'](_0x370a20[_0x913a('0x3a')][_0x913a('0x40')]);_0xa5b601[_0x913a('0x41')]=qs[_0x913a('0x42')](_[_0x913a('0x43')](_0x370a20[_0x913a('0x3a')],_0x29b46d[_0x913a('0x42')]),_0x409767);if(_0x370a20[_0x913a('0x3a')][_0x913a('0x44')]){_0xa5b601[_0x913a('0x41')]=_[_0x913a('0x45')](_0xa5b601['where'],{'$or':_[_0x913a('0x39')](_0x409767,function(_0x75324c){if(_0x75324c[_0x913a('0x36')]!==_0x913a('0x46')){var _0x204d3d={};_0x204d3d[_0x75324c['name']]={'$like':'%'+_0x370a20[_0x913a('0x3a')][_0x913a('0x44')]+'%'};return _0x204d3d;}})});}_0xa5b601=_[_0x913a('0x45')]({},_0xa5b601,_0x370a20[_0x913a('0x47')]);var _0x1b7240={'where':_0xa5b601[_0x913a('0x41')]};return db[_0x913a('0x33')]['count'](_0x1b7240)['then'](function(_0x11b2f7){_0x3dad99[_0x913a('0x24')]=_0x11b2f7;if(_0x370a20['query'][_0x913a('0x48')]){_0xa5b601[_0x913a('0x49')]=[{'all':!![]}];}return db[_0x913a('0x33')][_0x913a('0x4a')](_0xa5b601);})[_0x913a('0x2b')](function(_0x4ffdb0){_0x3dad99[_0x913a('0x4b')]=_0x4ffdb0;return _0x3dad99;})[_0x913a('0x2b')](respondWithFilteredResult(_0x2e98e4,_0xa5b601))[_0x913a('0x4c')](handleError(_0x2e98e4,null));};exports['show']=function(_0x174629,_0x2447d2){var _0x5923c4={'raw':![],'where':{'id':_0x174629[_0x913a('0x4d')]['id']}},_0x3f4582={};_0x3f4582[_0x913a('0x38')]=_[_0x913a('0x4e')](db[_0x913a('0x33')][_0x913a('0x34')]);_0x3f4582[_0x913a('0x3a')]=_[_0x913a('0x4e')](_0x174629[_0x913a('0x3a')]);_0x3f4582[_0x913a('0x42')]=_[_0x913a('0x3b')](_0x3f4582[_0x913a('0x38')],_0x3f4582[_0x913a('0x3a')]);_0x5923c4['attributes']=_[_0x913a('0x3b')](_0x3f4582[_0x913a('0x38')],qs[_0x913a('0x3c')](_0x174629['query'][_0x913a('0x3c')]));_0x5923c4[_0x913a('0x3e')]=_0x5923c4['attributes'][_0x913a('0x3d')]?_0x5923c4[_0x913a('0x3e')]:_0x3f4582[_0x913a('0x38')];if(_0x174629['query'][_0x913a('0x48')]){_0x5923c4[_0x913a('0x49')]=[{'all':!![]}];}_0x5923c4=_[_0x913a('0x45')]({},_0x5923c4,_0x174629[_0x913a('0x47')]);return db[_0x913a('0x33')]['find'](_0x5923c4)[_0x913a('0x2b')](handleEntityNotFound(_0x2447d2,null))[_0x913a('0x2b')](respondWithResult(_0x2447d2,null))['catch'](handleError(_0x2447d2,null));};exports[_0x913a('0x4f')]=function(_0x111191,_0x1e9500){return db[_0x913a('0x33')][_0x913a('0x4f')](_0x111191[_0x913a('0x50')],{})['then'](function(_0x877f0d){var _0x295177=_0x111191[_0x913a('0x51')][_0x913a('0x2c')]({'plain':!![]});if(!_0x295177)throw new Error(_0x913a('0x52'));if(_0x295177['role']==='user'){var _0x453240=_0x877f0d['get']({'plain':!![]});var _0x2148af=_0x913a('0x2d');return db[_0x913a('0x53')][_0x913a('0x54')]({'where':{'name':_0x2148af,'userProfileId':_0x295177['userProfileId']},'raw':!![]})[_0x913a('0x2b')](function(_0x5811ef){if(_0x5811ef&&_0x5811ef[_0x913a('0x55')]===0x0){return db[_0x913a('0x2e')][_0x913a('0x4f')]({'name':_0x453240[_0x913a('0x31')],'resourceId':_0x453240['id'],'type':_0x5811ef[_0x913a('0x31')],'sectionId':_0x5811ef['id']},{})[_0x913a('0x2b')](function(){return _0x877f0d;});}else{return _0x877f0d;}})[_0x913a('0x4c')](function(_0x571412){logger[_0x913a('0x2f')](_0x913a('0x56'),_0x571412);throw _0x571412;});}return _0x877f0d;})[_0x913a('0x2b')](respondWithResult(_0x1e9500,0xc9))[_0x913a('0x4c')](handleError(_0x1e9500,null));};exports[_0x913a('0x57')]=function(_0xf031db,_0x4d9f50){var _0x5776db={'where':{'id':_0xf031db['params']['id']}},_0x178715={};_0x178715[_0x913a('0x38')]=_[_0x913a('0x4e')](db[_0x913a('0x33')][_0x913a('0x34')]);_0x5776db['attributes']=_['intersection'](_0x178715['model'],qs[_0x913a('0x3c')](_0xf031db['query']['fields']));_0x5776db[_0x913a('0x3e')]=_0x5776db[_0x913a('0x3e')][_0x913a('0x3d')]?_0x5776db[_0x913a('0x3e')]:_0x178715['model'];if(_0xf031db['query']['includeAll']){_0x5776db[_0x913a('0x49')]=[{'all':!![]}];}_0x5776db=_[_0x913a('0x45')]({},_0x5776db,_0xf031db[_0x913a('0x47')]);return db[_0x913a('0x33')][_0x913a('0x54')](_0x5776db)[_0x913a('0x2b')](handleEntityNotFound(_0x4d9f50,null))[_0x913a('0x2b')](function(_0x5c0f78){if(_0x5c0f78){var _0x3798ee=_0x5c0f78[_0x913a('0x2c')]({'plain':!![]});_0x3798ee=qs['omit'](_0x3798ee,['id',_0x913a('0x58'),_0x913a('0x59')]);_0xf031db[_0x913a('0x50')]=_['omit'](_0xf031db[_0x913a('0x50')],['id',_0x913a('0x58'),_0x913a('0x59')]);return db[_0x913a('0x33')][_0x913a('0x4f')](_['merge'](_0x3798ee,_0xf031db[_0x913a('0x50')]),{'include':_0xf031db[_0x913a('0x3a')][_0x913a('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x57e8c6){var _0x1df094=_0xf031db[_0x913a('0x51')]['get']({'plain':!![]});if(!_0x1df094)throw new Error(_0x913a('0x52'));if(_0x1df094[_0x913a('0x5a')]==='user'){var _0x27f1a4=_0x57e8c6[_0x913a('0x2c')]({'plain':!![]});var _0x3accdf=_0x913a('0x2d');return db[_0x913a('0x53')][_0x913a('0x54')]({'where':{'name':_0x3accdf,'userProfileId':_0x1df094['userProfileId']},'raw':!![]})['then'](function(_0x5b6a8c){if(_0x5b6a8c&&_0x5b6a8c['autoAssociation']===0x0){return db[_0x913a('0x2e')][_0x913a('0x4f')]({'name':_0x27f1a4[_0x913a('0x31')],'resourceId':_0x27f1a4['id'],'type':_0x5b6a8c['name'],'sectionId':_0x5b6a8c['id']},{})[_0x913a('0x2b')](function(){return _0x57e8c6;});}else{return _0x57e8c6;}})[_0x913a('0x4c')](function(_0x3cf576){logger[_0x913a('0x2f')](_0x913a('0x56'),_0x3cf576);throw _0x3cf576;});}return _0x57e8c6;});}})[_0x913a('0x2b')](respondWithResult(_0x4d9f50,0xc9))[_0x913a('0x4c')](handleError(_0x4d9f50,null));};exports[_0x913a('0x5b')]=function(_0x533e80,_0x1cd8d9){if(_0x533e80['body']['id']){delete _0x533e80[_0x913a('0x50')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x533e80[_0x913a('0x4d')]['id']}})[_0x913a('0x2b')](handleEntityNotFound(_0x1cd8d9,null))[_0x913a('0x2b')](saveUpdates(_0x533e80['body'],null))[_0x913a('0x2b')](respondWithResult(_0x1cd8d9,null))['catch'](handleError(_0x1cd8d9,null));};exports[_0x913a('0x2a')]=function(_0x497094,_0xa07801){return db[_0x913a('0x33')][_0x913a('0x54')]({'where':{'id':_0x497094[_0x913a('0x4d')]['id']}})[_0x913a('0x2b')](handleEntityNotFound(_0xa07801,null))['then'](removeEntity(_0xa07801,null))[_0x913a('0x4c')](handleError(_0xa07801,null));};function widgetAttributes(_0x4ef037){try{switch(_0x4ef037['type']){case'iframe':return[{'name':_0x913a('0x5c'),'value':_0x4ef037[_0x913a('0x5c')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x0]?_0x4ef037[_0x913a('0x5d')][0x0]['value']:undefined)||_0x913a('0x5e')}];case'custom':return[{'name':_0x913a('0x5f'),'value':_0x4ef037[_0x913a('0x5f')]||(_0x4ef037['attrs']&&_0x4ef037['attrs'][0x0]?_0x4ef037[_0x913a('0x5d')][0x0][_0x913a('0x60')]:undefined)||''}];case _0x913a('0x61'):return[{'name':_0x913a('0x62'),'value':_0x4ef037['attrHourFormat']||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x0]?_0x4ef037[_0x913a('0x5d')][0x0][_0x913a('0x60')]:undefined)||_0x913a('0x63')},{'name':_0x913a('0x64'),'value':_0x4ef037[_0x913a('0x64')]||(_0x4ef037['attrs']&&_0x4ef037[_0x913a('0x5d')][0x1]?_0x4ef037['attrs'][0x1][_0x913a('0x60')]:undefined)||'0.00'},{'name':_0x913a('0x65'),'value':_0x4ef037[_0x913a('0x65')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037['attrs'][0x2]?_0x4ef037[_0x913a('0x5d')][0x2]['value']:undefined)||0xc}];case _0x913a('0x66'):return[{'name':_0x913a('0x67'),'value':_0x4ef037[_0x913a('0x67')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x0]?_0x4ef037[_0x913a('0x5d')][0x0]['value']:undefined)||_0x913a('0x68')},{'name':_0x913a('0x69'),'value':_0x4ef037['attrVoiceQueues']||(_0x4ef037['attrs']&&_0x4ef037[_0x913a('0x5d')][0x1]?_0x4ef037[_0x913a('0x5d')][0x1][_0x913a('0x60')]:undefined)||[]},{'name':_0x913a('0x65'),'value':_0x4ef037[_0x913a('0x65')]||(_0x4ef037['attrs']&&_0x4ef037[_0x913a('0x5d')][0x2]?_0x4ef037[_0x913a('0x5d')][0x2][_0x913a('0x60')]:undefined)||0x14},{'name':_0x913a('0x6a'),'value':_0x4ef037['attrChannel']||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x3]?_0x4ef037[_0x913a('0x5d')][0x3][_0x913a('0x60')]:undefined)||_0x913a('0x6b')},{'name':'attrEmailAccounts','value':_0x4ef037[_0x913a('0x6c')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x4]?_0x4ef037[_0x913a('0x5d')][0x4][_0x913a('0x60')]:undefined)||''},{'name':_0x913a('0x6d'),'value':_0x4ef037[_0x913a('0x6d')]||(_0x4ef037['attrs']&&_0x4ef037[_0x913a('0x5d')][0x5]?_0x4ef037[_0x913a('0x5d')][0x5][_0x913a('0x60')]:undefined)||''},{'name':_0x913a('0x6e'),'value':_0x4ef037[_0x913a('0x6e')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x6]?_0x4ef037[_0x913a('0x5d')][0x6]['value']:undefined)||''},{'name':_0x913a('0x6f'),'value':_0x4ef037[_0x913a('0x6f')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x7]?_0x4ef037[_0x913a('0x5d')][0x7][_0x913a('0x60')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x4ef037[_0x913a('0x70')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x8]?_0x4ef037['attrs'][0x8][_0x913a('0x60')]:undefined)||''},{'name':_0x913a('0x71'),'value':_0x4ef037[_0x913a('0x71')]||(_0x4ef037['attrs']&&_0x4ef037[_0x913a('0x5d')][0x9]?_0x4ef037['attrs'][0x9][_0x913a('0x60')]:undefined)||''}];case _0x913a('0x72'):case _0x913a('0x73'):return[{'name':_0x913a('0x74'),'value':_0x4ef037['attrSerie1']||(_0x4ef037['attrs']&&_0x4ef037['attrs'][0x0]?_0x4ef037[_0x913a('0x5d')][0x0][_0x913a('0x60')]:undefined)||_0x913a('0x68')},{'name':_0x913a('0x75'),'value':_0x4ef037[_0x913a('0x75')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x1]?_0x4ef037[_0x913a('0x5d')][0x1][_0x913a('0x60')]:undefined)||null},{'name':_0x913a('0x76'),'value':_0x4ef037[_0x913a('0x76')]||(_0x4ef037['attrs']&&_0x4ef037[_0x913a('0x5d')][0x2]?_0x4ef037['attrs'][0x2][_0x913a('0x60')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x4ef037[_0x913a('0x69')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037['attrs'][0x3]?_0x4ef037[_0x913a('0x5d')][0x3][_0x913a('0x60')]:undefined)||[]},{'name':'attrChannel','value':_0x4ef037[_0x913a('0x6a')]||(_0x4ef037['attrs']&&_0x4ef037[_0x913a('0x5d')][0x4]?_0x4ef037['attrs'][0x4][_0x913a('0x60')]:undefined)||_0x913a('0x6b')},{'name':_0x913a('0x6c'),'value':_0x4ef037[_0x913a('0x6c')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x5]?_0x4ef037[_0x913a('0x5d')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x4ef037['attrFaxAccounts']||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x6]?_0x4ef037[_0x913a('0x5d')][0x6][_0x913a('0x60')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x4ef037[_0x913a('0x6e')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x7]?_0x4ef037[_0x913a('0x5d')][0x7][_0x913a('0x60')]:undefined)||''},{'name':_0x913a('0x6f'),'value':_0x4ef037[_0x913a('0x6f')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037['attrs'][0x8]?_0x4ef037[_0x913a('0x5d')][0x8][_0x913a('0x60')]:undefined)||''},{'name':_0x913a('0x70'),'value':_0x4ef037[_0x913a('0x70')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x9]?_0x4ef037[_0x913a('0x5d')][0x9][_0x913a('0x60')]:undefined)||''},{'name':'attrChatWebsites','value':_0x4ef037['attrChatWebsites']||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0xa]?_0x4ef037[_0x913a('0x5d')][0xa][_0x913a('0x60')]:undefined)||''}];case'web-report':return[{'name':_0x913a('0x77'),'type':_0x4ef037[_0x913a('0x78')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x0]?_0x4ef037[_0x913a('0x5d')][0x0][_0x913a('0x36')]:undefined)||null,'value':_0x4ef037[_0x913a('0x77')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x0]?_0x4ef037[_0x913a('0x5d')][0x0][_0x913a('0x60')]:undefined)||null},{'name':'attrRefresh','value':_0x4ef037[_0x913a('0x79')]||(_0x4ef037[_0x913a('0x5d')]&&_0x4ef037[_0x913a('0x5d')][0x1]?_0x4ef037['attrs'][0x1][_0x913a('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x1ddc93){logger[_0x913a('0x2f')](_0x913a('0x7a'),JSON['stringify'](_0x1ddc93));return[];}}exports[_0x913a('0x7b')]=function(_0x185fc3,_0x1d2dbf,_0x5b1b37){if(_0x185fc3[_0x913a('0x50')]['id']){delete _0x185fc3['body']['id'];}return db[_0x913a('0x33')][_0x913a('0x54')]({'where':{'id':_0x185fc3[_0x913a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1d2dbf,null))[_0x913a('0x2b')](function(_0x4d14bd){if(_0x4d14bd){_0x185fc3[_0x913a('0x50')]['DashboardId']=_0x4d14bd['id'];_0x185fc3['body'][_0x913a('0x5d')]=widgetAttributes(_0x185fc3[_0x913a('0x50')]);return db['DashboardItem'][_0x913a('0x4f')](_0x185fc3[_0x913a('0x50')]);}})[_0x913a('0x2b')](respondWithResult(_0x1d2dbf,null))[_0x913a('0x4c')](handleError(_0x1d2dbf,null));};exports[_0x913a('0x7c')]=function(_0x32cb41,_0x5abae8,_0x43a297){var _0x967e8c={};var _0xc8e2ac={};var _0x566d50;var _0x1e9b24;return db['Dashboard'][_0x913a('0x7d')]({'where':{'id':_0x32cb41['params']['id']}})[_0x913a('0x2b')](handleEntityNotFound(_0x5abae8,null))[_0x913a('0x2b')](function(_0xd92ce0){if(_0xd92ce0){_0x566d50=_0xd92ce0;_0xc8e2ac[_0x913a('0x38')]=_['keys'](db[_0x913a('0x7e')][_0x913a('0x34')]);_0xc8e2ac[_0x913a('0x3a')]=_[_0x913a('0x4e')](_0x32cb41['query']);_0xc8e2ac[_0x913a('0x42')]=_[_0x913a('0x3b')](_0xc8e2ac[_0x913a('0x38')],_0xc8e2ac[_0x913a('0x3a')]);_0x967e8c[_0x913a('0x3e')]=_[_0x913a('0x3b')](_0xc8e2ac[_0x913a('0x38')],qs['fields'](_0x32cb41[_0x913a('0x3a')][_0x913a('0x3c')]));_0x967e8c[_0x913a('0x3e')]=_0x967e8c[_0x913a('0x3e')][_0x913a('0x3d')]?_0x967e8c[_0x913a('0x3e')]:_0xc8e2ac[_0x913a('0x38')];_0x967e8c[_0x913a('0x3f')]=qs[_0x913a('0x40')](_0x32cb41[_0x913a('0x3a')][_0x913a('0x40')]);_0x967e8c[_0x913a('0x41')]=qs[_0x913a('0x42')](_['pick'](_0x32cb41[_0x913a('0x3a')],_0xc8e2ac[_0x913a('0x42')]));if(_0x32cb41['query'][_0x913a('0x44')]){_0x967e8c[_0x913a('0x41')]=_[_0x913a('0x45')](_0x967e8c[_0x913a('0x41')],{'$or':_[_0x913a('0x39')](_0x967e8c[_0x913a('0x3e')],function(_0x478645){var _0x801a5a={};_0x801a5a[_0x478645]={'$like':'%'+_0x32cb41[_0x913a('0x3a')][_0x913a('0x44')]+'%'};return _0x801a5a;})});}_0x967e8c=_[_0x913a('0x45')]({},_0x967e8c,_0x32cb41[_0x913a('0x47')]);return _0x566d50[_0x913a('0x7c')](_0x967e8c);}})['then'](function(_0x5820df){if(_0x5820df){_0x1e9b24=_0x5820df[_0x913a('0x3d')];if(!_0x32cb41[_0x913a('0x3a')][_0x913a('0x7f')](_0x913a('0x80'))){_0x967e8c[_0x913a('0x23')]=qs[_0x913a('0x23')](_0x32cb41[_0x913a('0x3a')][_0x913a('0x23')]);_0x967e8c[_0x913a('0x21')]=qs[_0x913a('0x21')](_0x32cb41[_0x913a('0x3a')][_0x913a('0x21')]);}return _0x566d50[_0x913a('0x7c')](_0x967e8c);}})['then'](function(_0x16313c){if(_0x16313c){return _0x16313c?{'count':_0x1e9b24,'rows':_0x16313c}:null;}})[_0x913a('0x2b')](respondWithResult(_0x5abae8,null))[_0x913a('0x4c')](handleError(_0x5abae8,null));}; \ No newline at end of file +var _0xf337=['status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','UserProfileSection','userProfileId','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrChannel','attrEmailAccounts','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','getItems','DashboardItem','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register'];(function(_0x2bd602,_0x2bdd18){var _0x32fac9=function(_0x17be3e){while(--_0x17be3e){_0x2bd602['push'](_0x2bd602['shift']());}};_0x32fac9(++_0x2bdd18);}(_0xf337,0x175));var _0x7f33=function(_0xcfdd0c,_0x1de2ba){_0xcfdd0c=_0xcfdd0c-0x0;var _0x40e44f=_0xf337[_0xcfdd0c];return _0x40e44f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f33('0x0'));var zipdir=require(_0x7f33('0x1'));var jsonpatch=require(_0x7f33('0x2'));var rp=require(_0x7f33('0x3'));var moment=require(_0x7f33('0x4'));var BPromise=require(_0x7f33('0x5'));var Mustache=require(_0x7f33('0x6'));var util=require(_0x7f33('0x7'));var path=require(_0x7f33('0x8'));var sox=require(_0x7f33('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f33('0xa'));var _=require(_0x7f33('0xb'));var squel=require(_0x7f33('0xc'));var crypto=require('crypto');var jsforce=require(_0x7f33('0xd'));var deskjs=require(_0x7f33('0xe'));var toCsv=require(_0x7f33('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7f33('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7f33('0x11'));var hardwareService=require(_0x7f33('0x12'));var logger=require(_0x7f33('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x7f33('0x14'));var licenseUtil=require(_0x7f33('0x15'));var db=require(_0x7f33('0x16'))['db'];config[_0x7f33('0x17')]=_[_0x7f33('0x18')](config[_0x7f33('0x17')],{'host':_0x7f33('0x19'),'port':0x18eb});var socket=require(_0x7f33('0x1a'))(new Redis(config[_0x7f33('0x17')]));require(_0x7f33('0x1b'))[_0x7f33('0x1c')](socket);function respondWithStatusCode(_0x1e54fa,_0xe5ff6){_0xe5ff6=_0xe5ff6||0xcc;return function(_0x462e50){if(_0x462e50){return _0x1e54fa['sendStatus'](_0xe5ff6);}return _0x1e54fa[_0x7f33('0x1d')](_0xe5ff6)[_0x7f33('0x1e')]();};}function respondWithResult(_0x4fa32f,_0x417ff4){_0x417ff4=_0x417ff4||0xc8;return function(_0x73ed6a){if(_0x73ed6a){return _0x4fa32f[_0x7f33('0x1d')](_0x417ff4)['json'](_0x73ed6a);}};}function respondWithFilteredResult(_0x548063,_0x1f39a2){return function(_0x200866){if(_0x200866){var _0x52ab42=typeof _0x1f39a2[_0x7f33('0x1f')]===_0x7f33('0x20')&&typeof _0x1f39a2[_0x7f33('0x21')]===_0x7f33('0x20');var _0x51cb34=_0x200866['count'];var _0x32ca7a=_0x52ab42?0x0:_0x1f39a2[_0x7f33('0x1f')];var _0x4b4d4b=_0x52ab42?_0x200866[_0x7f33('0x22')]:_0x1f39a2[_0x7f33('0x1f')]+_0x1f39a2[_0x7f33('0x21')];var _0x248960;if(_0x4b4d4b>=_0x51cb34){_0x4b4d4b=_0x51cb34;_0x248960=0xc8;}else{_0x248960=0xce;}_0x548063['status'](_0x248960);return _0x548063[_0x7f33('0x23')](_0x7f33('0x24'),_0x32ca7a+'-'+_0x4b4d4b+'/'+_0x51cb34)[_0x7f33('0x25')](_0x200866);}return null;};}function patchUpdates(_0x1b69b9){return function(_0x784bb7){try{jsonpatch[_0x7f33('0x26')](_0x784bb7,_0x1b69b9,!![]);}catch(_0x562ce6){return BPromise[_0x7f33('0x27')](_0x562ce6);}return _0x784bb7[_0x7f33('0x28')]();};}function saveUpdates(_0x24ce39,_0x32a216){return function(_0x450b84){if(_0x450b84){return _0x450b84[_0x7f33('0x29')](_0x24ce39)[_0x7f33('0x2a')](function(_0xac05b7){return _0xac05b7;});}return null;};}function removeEntity(_0x43a8f9,_0xb2dc4){return function(_0xb1daf9){if(_0xb1daf9){return _0xb1daf9['destroy']()['then'](function(){var _0x1e8cfb=_0xb1daf9[_0x7f33('0x2b')]({'plain':!![]});var _0x1a2b31='CustomDashboards';return db[_0x7f33('0x2c')][_0x7f33('0x2d')]({'where':{'type':_0x1a2b31,'resourceId':_0x1e8cfb['id']}})[_0x7f33('0x2a')](function(){return _0xb1daf9;});})[_0x7f33('0x2a')](function(){_0x43a8f9[_0x7f33('0x1d')](0xcc)[_0x7f33('0x1e')]();});}};}function handleEntityNotFound(_0x497319,_0x12ecc6){return function(_0x4505a7){if(!_0x4505a7){_0x497319[_0x7f33('0x2e')](0x194);}return _0x4505a7;};}function handleError(_0xfeec82,_0x1f31c7){_0x1f31c7=_0x1f31c7||0x1f4;return function(_0x21d1b0){logger[_0x7f33('0x2f')](_0x21d1b0[_0x7f33('0x30')]);if(_0x21d1b0[_0x7f33('0x31')]){delete _0x21d1b0['name'];}_0xfeec82[_0x7f33('0x1d')](_0x1f31c7)[_0x7f33('0x32')](_0x21d1b0);};}exports[_0x7f33('0x33')]=function(_0x5384d2,_0x478a4a){var _0x87b3d={},_0x5b4e42={},_0x16af70={'count':0x0,'rows':[]};var _0x28781a=_[_0x7f33('0x34')](db[_0x7f33('0x35')][_0x7f33('0x36')],function(_0x18f30e){return{'name':_0x18f30e[_0x7f33('0x37')],'type':_0x18f30e[_0x7f33('0x38')][_0x7f33('0x39')]};});_0x5b4e42[_0x7f33('0x3a')]=_[_0x7f33('0x34')](_0x28781a,_0x7f33('0x31'));_0x5b4e42['query']=_[_0x7f33('0x3b')](_0x5384d2[_0x7f33('0x3c')]);_0x5b4e42['filters']=_['intersection'](_0x5b4e42[_0x7f33('0x3a')],_0x5b4e42[_0x7f33('0x3c')]);_0x87b3d[_0x7f33('0x3d')]=_[_0x7f33('0x3e')](_0x5b4e42[_0x7f33('0x3a')],qs[_0x7f33('0x3f')](_0x5384d2[_0x7f33('0x3c')][_0x7f33('0x3f')]));_0x87b3d[_0x7f33('0x3d')]=_0x87b3d[_0x7f33('0x3d')][_0x7f33('0x40')]?_0x87b3d[_0x7f33('0x3d')]:_0x5b4e42[_0x7f33('0x3a')];if(!_0x5384d2[_0x7f33('0x3c')][_0x7f33('0x41')](_0x7f33('0x42'))){_0x87b3d['limit']=qs[_0x7f33('0x21')](_0x5384d2['query']['limit']);_0x87b3d['offset']=qs[_0x7f33('0x1f')](_0x5384d2[_0x7f33('0x3c')][_0x7f33('0x1f')]);}_0x87b3d[_0x7f33('0x43')]=qs[_0x7f33('0x44')](_0x5384d2['query'][_0x7f33('0x44')]);_0x87b3d['where']=qs[_0x7f33('0x45')](_[_0x7f33('0x46')](_0x5384d2[_0x7f33('0x3c')],_0x5b4e42['filters']),_0x28781a);if(_0x5384d2[_0x7f33('0x3c')][_0x7f33('0x47')]){_0x87b3d['where']=_['merge'](_0x87b3d[_0x7f33('0x48')],{'$or':_['map'](_0x28781a,function(_0x513f92){if(_0x513f92['type']!==_0x7f33('0x49')){var _0x504b55={};_0x504b55[_0x513f92['name']]={'$like':'%'+_0x5384d2['query'][_0x7f33('0x47')]+'%'};return _0x504b55;}})});}_0x87b3d=_[_0x7f33('0x4a')]({},_0x87b3d,_0x5384d2[_0x7f33('0x4b')]);var _0xfcab50={'where':_0x87b3d[_0x7f33('0x48')]};return db[_0x7f33('0x35')][_0x7f33('0x22')](_0xfcab50)[_0x7f33('0x2a')](function(_0x33df99){_0x16af70[_0x7f33('0x22')]=_0x33df99;if(_0x5384d2['query'][_0x7f33('0x4c')]){_0x87b3d[_0x7f33('0x4d')]=[{'all':!![]}];}return db[_0x7f33('0x35')][_0x7f33('0x4e')](_0x87b3d);})[_0x7f33('0x2a')](function(_0xf1e1f6){_0x16af70[_0x7f33('0x4f')]=_0xf1e1f6;return _0x16af70;})[_0x7f33('0x2a')](respondWithFilteredResult(_0x478a4a,_0x87b3d))[_0x7f33('0x50')](handleError(_0x478a4a,null));};exports[_0x7f33('0x51')]=function(_0x1942fd,_0xbb13b2){var _0xe5209={'raw':![],'where':{'id':_0x1942fd[_0x7f33('0x52')]['id']}},_0x124911={};_0x124911[_0x7f33('0x3a')]=_[_0x7f33('0x3b')](db[_0x7f33('0x35')]['rawAttributes']);_0x124911[_0x7f33('0x3c')]=_[_0x7f33('0x3b')](_0x1942fd[_0x7f33('0x3c')]);_0x124911[_0x7f33('0x45')]=_[_0x7f33('0x3e')](_0x124911[_0x7f33('0x3a')],_0x124911[_0x7f33('0x3c')]);_0xe5209[_0x7f33('0x3d')]=_[_0x7f33('0x3e')](_0x124911[_0x7f33('0x3a')],qs[_0x7f33('0x3f')](_0x1942fd['query'][_0x7f33('0x3f')]));_0xe5209[_0x7f33('0x3d')]=_0xe5209['attributes']['length']?_0xe5209[_0x7f33('0x3d')]:_0x124911[_0x7f33('0x3a')];if(_0x1942fd[_0x7f33('0x3c')][_0x7f33('0x4c')]){_0xe5209[_0x7f33('0x4d')]=[{'all':!![]}];}_0xe5209=_[_0x7f33('0x4a')]({},_0xe5209,_0x1942fd[_0x7f33('0x4b')]);return db[_0x7f33('0x35')][_0x7f33('0x53')](_0xe5209)[_0x7f33('0x2a')](handleEntityNotFound(_0xbb13b2,null))[_0x7f33('0x2a')](respondWithResult(_0xbb13b2,null))[_0x7f33('0x50')](handleError(_0xbb13b2,null));};exports['create']=function(_0x138b65,_0xde6471){return db[_0x7f33('0x35')][_0x7f33('0x54')](_0x138b65[_0x7f33('0x55')],{})[_0x7f33('0x2a')](function(_0x224f2c){var _0x4d76ef=_0x138b65[_0x7f33('0x56')][_0x7f33('0x2b')]({'plain':!![]});if(!_0x4d76ef)throw new Error(_0x7f33('0x57'));if(_0x4d76ef['role']==='user'){var _0x3ac370=_0x224f2c[_0x7f33('0x2b')]({'plain':!![]});var _0x18383f=_0x7f33('0x58');return db['UserProfileSection'][_0x7f33('0x53')]({'where':{'name':_0x18383f,'userProfileId':_0x4d76ef['userProfileId']},'raw':!![]})[_0x7f33('0x2a')](function(_0x28490a){if(_0x28490a&&_0x28490a[_0x7f33('0x59')]===0x0){return db[_0x7f33('0x2c')]['create']({'name':_0x3ac370[_0x7f33('0x31')],'resourceId':_0x3ac370['id'],'type':_0x28490a[_0x7f33('0x31')],'sectionId':_0x28490a['id']},{})['then'](function(){return _0x224f2c;});}else{return _0x224f2c;}})[_0x7f33('0x50')](function(_0x45e4dd){logger[_0x7f33('0x2f')](_0x7f33('0x5a'),_0x45e4dd);throw _0x45e4dd;});}return _0x224f2c;})[_0x7f33('0x2a')](respondWithResult(_0xde6471,0xc9))['catch'](handleError(_0xde6471,null));};exports[_0x7f33('0x5b')]=function(_0x2868d5,_0x37d2c4){var _0x5034e3={'where':{'id':_0x2868d5[_0x7f33('0x52')]['id']}},_0x591be7={};_0x591be7[_0x7f33('0x3a')]=_[_0x7f33('0x3b')](db[_0x7f33('0x35')][_0x7f33('0x36')]);_0x5034e3[_0x7f33('0x3d')]=_[_0x7f33('0x3e')](_0x591be7[_0x7f33('0x3a')],qs[_0x7f33('0x3f')](_0x2868d5[_0x7f33('0x3c')]['fields']));_0x5034e3[_0x7f33('0x3d')]=_0x5034e3['attributes'][_0x7f33('0x40')]?_0x5034e3[_0x7f33('0x3d')]:_0x591be7[_0x7f33('0x3a')];if(_0x2868d5['query'][_0x7f33('0x4c')]){_0x5034e3[_0x7f33('0x4d')]=[{'all':!![]}];}_0x5034e3=_[_0x7f33('0x4a')]({},_0x5034e3,_0x2868d5[_0x7f33('0x4b')]);return db[_0x7f33('0x35')][_0x7f33('0x53')](_0x5034e3)[_0x7f33('0x2a')](handleEntityNotFound(_0x37d2c4,null))[_0x7f33('0x2a')](function(_0x5ea55c){if(_0x5ea55c){var _0x466aac=_0x5ea55c[_0x7f33('0x2b')]({'plain':!![]});_0x466aac=qs[_0x7f33('0x5c')](_0x466aac,['id',_0x7f33('0x5d'),_0x7f33('0x5e')]);_0x2868d5[_0x7f33('0x55')]=_[_0x7f33('0x5c')](_0x2868d5[_0x7f33('0x55')],['id',_0x7f33('0x5d'),_0x7f33('0x5e')]);return db[_0x7f33('0x35')][_0x7f33('0x54')](_[_0x7f33('0x4a')](_0x466aac,_0x2868d5['body']),{'include':_0x2868d5[_0x7f33('0x3c')][_0x7f33('0x4c')]?[{'all':!![]}]:undefined})[_0x7f33('0x2a')](function(_0x3c50e7){var _0x180a6e=_0x2868d5[_0x7f33('0x56')][_0x7f33('0x2b')]({'plain':!![]});if(!_0x180a6e)throw new Error(_0x7f33('0x57'));if(_0x180a6e[_0x7f33('0x5f')]===_0x7f33('0x56')){var _0x296a38=_0x3c50e7[_0x7f33('0x2b')]({'plain':!![]});var _0x106bfa='CustomDashboards';return db[_0x7f33('0x60')][_0x7f33('0x53')]({'where':{'name':_0x106bfa,'userProfileId':_0x180a6e[_0x7f33('0x61')]},'raw':!![]})[_0x7f33('0x2a')](function(_0xe9706){if(_0xe9706&&_0xe9706[_0x7f33('0x59')]===0x0){return db[_0x7f33('0x2c')][_0x7f33('0x54')]({'name':_0x296a38[_0x7f33('0x31')],'resourceId':_0x296a38['id'],'type':_0xe9706[_0x7f33('0x31')],'sectionId':_0xe9706['id']},{})['then'](function(){return _0x3c50e7;});}else{return _0x3c50e7;}})[_0x7f33('0x50')](function(_0x4c10b4){logger[_0x7f33('0x2f')](_0x7f33('0x5a'),_0x4c10b4);throw _0x4c10b4;});}return _0x3c50e7;});}})['then'](respondWithResult(_0x37d2c4,0xc9))[_0x7f33('0x50')](handleError(_0x37d2c4,null));};exports[_0x7f33('0x29')]=function(_0x4fce57,_0x1e034f){if(_0x4fce57['body']['id']){delete _0x4fce57[_0x7f33('0x55')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x4fce57[_0x7f33('0x52')]['id']}})['then'](handleEntityNotFound(_0x1e034f,null))[_0x7f33('0x2a')](saveUpdates(_0x4fce57[_0x7f33('0x55')],null))[_0x7f33('0x2a')](respondWithResult(_0x1e034f,null))[_0x7f33('0x50')](handleError(_0x1e034f,null));};exports[_0x7f33('0x2d')]=function(_0x1900aa,_0x3f2d89){return db[_0x7f33('0x35')][_0x7f33('0x53')]({'where':{'id':_0x1900aa[_0x7f33('0x52')]['id']}})[_0x7f33('0x2a')](handleEntityNotFound(_0x3f2d89,null))[_0x7f33('0x2a')](removeEntity(_0x3f2d89,null))[_0x7f33('0x50')](handleError(_0x3f2d89,null));};function widgetAttributes(_0x3c5d79){try{switch(_0x3c5d79['type']){case _0x7f33('0x62'):return[{'name':'attrUrl','value':_0x3c5d79[_0x7f33('0x63')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x0]?_0x3c5d79['attrs'][0x0][_0x7f33('0x65')]:undefined)||'https://'}];case _0x7f33('0x66'):return[{'name':_0x7f33('0x67'),'value':_0x3c5d79[_0x7f33('0x67')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x0]?_0x3c5d79[_0x7f33('0x64')][0x0][_0x7f33('0x65')]:undefined)||''}];case _0x7f33('0x68'):return[{'name':_0x7f33('0x69'),'value':_0x3c5d79[_0x7f33('0x69')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x0]?_0x3c5d79[_0x7f33('0x64')][0x0][_0x7f33('0x65')]:undefined)||_0x7f33('0x6a')},{'name':_0x7f33('0x6b'),'value':_0x3c5d79[_0x7f33('0x6b')]||(_0x3c5d79['attrs']&&_0x3c5d79[_0x7f33('0x64')][0x1]?_0x3c5d79[_0x7f33('0x64')][0x1]['value']:undefined)||_0x7f33('0x6c')},{'name':_0x7f33('0x6d'),'value':_0x3c5d79[_0x7f33('0x6d')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x2]?_0x3c5d79[_0x7f33('0x64')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x7f33('0x6e'),'value':_0x3c5d79[_0x7f33('0x6e')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x0]?_0x3c5d79[_0x7f33('0x64')][0x0][_0x7f33('0x65')]:undefined)||'total'},{'name':_0x7f33('0x6f'),'value':_0x3c5d79[_0x7f33('0x6f')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x1]?_0x3c5d79[_0x7f33('0x64')][0x1][_0x7f33('0x65')]:undefined)||[]},{'name':'attrFontSize','value':_0x3c5d79[_0x7f33('0x6d')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x2]?_0x3c5d79['attrs'][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x3c5d79['attrChannel']||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x3]?_0x3c5d79[_0x7f33('0x64')][0x3]['value']:undefined)||_0x7f33('0x70')},{'name':'attrEmailAccounts','value':_0x3c5d79['attrEmailAccounts']||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x4]?_0x3c5d79[_0x7f33('0x64')][0x4]['value']:undefined)||''},{'name':_0x7f33('0x71'),'value':_0x3c5d79['attrFaxAccounts']||(_0x3c5d79['attrs']&&_0x3c5d79[_0x7f33('0x64')][0x5]?_0x3c5d79[_0x7f33('0x64')][0x5][_0x7f33('0x65')]:undefined)||''},{'name':_0x7f33('0x72'),'value':_0x3c5d79[_0x7f33('0x72')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x6]?_0x3c5d79[_0x7f33('0x64')][0x6][_0x7f33('0x65')]:undefined)||''},{'name':_0x7f33('0x73'),'value':_0x3c5d79[_0x7f33('0x73')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x7]?_0x3c5d79[_0x7f33('0x64')][0x7][_0x7f33('0x65')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3c5d79[_0x7f33('0x74')]||(_0x3c5d79['attrs']&&_0x3c5d79[_0x7f33('0x64')][0x8]?_0x3c5d79[_0x7f33('0x64')][0x8][_0x7f33('0x65')]:undefined)||''},{'name':'attrChatWebsites','value':_0x3c5d79[_0x7f33('0x75')]||(_0x3c5d79['attrs']&&_0x3c5d79[_0x7f33('0x64')][0x9]?_0x3c5d79[_0x7f33('0x64')][0x9]['value']:undefined)||''}];case _0x7f33('0x76'):case _0x7f33('0x77'):return[{'name':_0x7f33('0x78'),'value':_0x3c5d79[_0x7f33('0x78')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x0]?_0x3c5d79[_0x7f33('0x64')][0x0][_0x7f33('0x65')]:undefined)||_0x7f33('0x79')},{'name':_0x7f33('0x7a'),'value':_0x3c5d79[_0x7f33('0x7a')]||(_0x3c5d79['attrs']&&_0x3c5d79['attrs'][0x1]?_0x3c5d79['attrs'][0x1][_0x7f33('0x65')]:undefined)||null},{'name':_0x7f33('0x7b'),'value':_0x3c5d79[_0x7f33('0x7b')]||(_0x3c5d79['attrs']&&_0x3c5d79[_0x7f33('0x64')][0x2]?_0x3c5d79['attrs'][0x2][_0x7f33('0x65')]:undefined)||null},{'name':_0x7f33('0x6f'),'value':_0x3c5d79[_0x7f33('0x6f')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79['attrs'][0x3]?_0x3c5d79[_0x7f33('0x64')][0x3][_0x7f33('0x65')]:undefined)||[]},{'name':_0x7f33('0x7c'),'value':_0x3c5d79[_0x7f33('0x7c')]||(_0x3c5d79['attrs']&&_0x3c5d79[_0x7f33('0x64')][0x4]?_0x3c5d79[_0x7f33('0x64')][0x4][_0x7f33('0x65')]:undefined)||_0x7f33('0x70')},{'name':_0x7f33('0x7d'),'value':_0x3c5d79['attrEmailAccounts']||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x5]?_0x3c5d79[_0x7f33('0x64')][0x5][_0x7f33('0x65')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x3c5d79[_0x7f33('0x71')]||(_0x3c5d79['attrs']&&_0x3c5d79[_0x7f33('0x64')][0x6]?_0x3c5d79['attrs'][0x6][_0x7f33('0x65')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x3c5d79[_0x7f33('0x72')]||(_0x3c5d79['attrs']&&_0x3c5d79[_0x7f33('0x64')][0x7]?_0x3c5d79[_0x7f33('0x64')][0x7][_0x7f33('0x65')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3c5d79[_0x7f33('0x73')]||(_0x3c5d79['attrs']&&_0x3c5d79[_0x7f33('0x64')][0x8]?_0x3c5d79[_0x7f33('0x64')][0x8][_0x7f33('0x65')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3c5d79[_0x7f33('0x74')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x9]?_0x3c5d79['attrs'][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x3c5d79[_0x7f33('0x75')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0xa]?_0x3c5d79['attrs'][0xa][_0x7f33('0x65')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x3c5d79[_0x7f33('0x7e')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x0]?_0x3c5d79[_0x7f33('0x64')][0x0]['type']:undefined)||null,'value':_0x3c5d79[_0x7f33('0x7f')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79[_0x7f33('0x64')][0x0]?_0x3c5d79[_0x7f33('0x64')][0x0]['value']:undefined)||null},{'name':_0x7f33('0x80'),'value':_0x3c5d79[_0x7f33('0x80')]||(_0x3c5d79[_0x7f33('0x64')]&&_0x3c5d79['attrs'][0x1]?_0x3c5d79['attrs'][0x1][_0x7f33('0x65')]:undefined)||0x0}];default:return[];}}catch(_0x5eada8){logger['error'](_0x7f33('0x81'),JSON[_0x7f33('0x82')](_0x5eada8));return[];}}exports[_0x7f33('0x83')]=function(_0x11714b,_0x310aca,_0x1b3565){if(_0x11714b[_0x7f33('0x55')]['id']){delete _0x11714b[_0x7f33('0x55')]['id'];}return db[_0x7f33('0x35')][_0x7f33('0x53')]({'where':{'id':_0x11714b['params']['id']}})['then'](handleEntityNotFound(_0x310aca,null))[_0x7f33('0x2a')](function(_0x414bd5){if(_0x414bd5){_0x11714b['body']['DashboardId']=_0x414bd5['id'];_0x11714b[_0x7f33('0x55')]['attrs']=widgetAttributes(_0x11714b[_0x7f33('0x55')]);return db['DashboardItem'][_0x7f33('0x54')](_0x11714b[_0x7f33('0x55')]);}})[_0x7f33('0x2a')](respondWithResult(_0x310aca,null))[_0x7f33('0x50')](handleError(_0x310aca,null));};exports[_0x7f33('0x84')]=function(_0x631850,_0x42d58c,_0xcead8b){var _0x532bfa={};var _0x301638={};var _0x47c6bb;var _0x33b463;return db['Dashboard']['findOne']({'where':{'id':_0x631850[_0x7f33('0x52')]['id']}})[_0x7f33('0x2a')](handleEntityNotFound(_0x42d58c,null))[_0x7f33('0x2a')](function(_0x530798){if(_0x530798){_0x47c6bb=_0x530798;_0x301638[_0x7f33('0x3a')]=_['keys'](db[_0x7f33('0x85')][_0x7f33('0x36')]);_0x301638[_0x7f33('0x3c')]=_[_0x7f33('0x3b')](_0x631850[_0x7f33('0x3c')]);_0x301638['filters']=_[_0x7f33('0x3e')](_0x301638[_0x7f33('0x3a')],_0x301638['query']);_0x532bfa[_0x7f33('0x3d')]=_[_0x7f33('0x3e')](_0x301638[_0x7f33('0x3a')],qs['fields'](_0x631850['query'][_0x7f33('0x3f')]));_0x532bfa[_0x7f33('0x3d')]=_0x532bfa['attributes'][_0x7f33('0x40')]?_0x532bfa['attributes']:_0x301638[_0x7f33('0x3a')];_0x532bfa[_0x7f33('0x43')]=qs[_0x7f33('0x44')](_0x631850['query'][_0x7f33('0x44')]);_0x532bfa[_0x7f33('0x48')]=qs[_0x7f33('0x45')](_['pick'](_0x631850[_0x7f33('0x3c')],_0x301638[_0x7f33('0x45')]));if(_0x631850['query'][_0x7f33('0x47')]){_0x532bfa['where']=_[_0x7f33('0x4a')](_0x532bfa[_0x7f33('0x48')],{'$or':_[_0x7f33('0x34')](_0x532bfa[_0x7f33('0x3d')],function(_0x17d359){var _0xfa2b11={};_0xfa2b11[_0x17d359]={'$like':'%'+_0x631850[_0x7f33('0x3c')][_0x7f33('0x47')]+'%'};return _0xfa2b11;})});}_0x532bfa=_[_0x7f33('0x4a')]({},_0x532bfa,_0x631850[_0x7f33('0x4b')]);return _0x47c6bb['getItems'](_0x532bfa);}})[_0x7f33('0x2a')](function(_0x1d8308){if(_0x1d8308){_0x33b463=_0x1d8308[_0x7f33('0x40')];if(!_0x631850[_0x7f33('0x3c')][_0x7f33('0x41')](_0x7f33('0x42'))){_0x532bfa[_0x7f33('0x21')]=qs[_0x7f33('0x21')](_0x631850[_0x7f33('0x3c')][_0x7f33('0x21')]);_0x532bfa[_0x7f33('0x1f')]=qs[_0x7f33('0x1f')](_0x631850['query'][_0x7f33('0x1f')]);}return _0x47c6bb[_0x7f33('0x84')](_0x532bfa);}})[_0x7f33('0x2a')](function(_0xd2bf93){if(_0xd2bf93){return _0xd2bf93?{'count':_0x33b463,'rows':_0xd2bf93}:null;}})[_0x7f33('0x2a')](respondWithResult(_0x42d58c,null))[_0x7f33('0x50')](handleError(_0x42d58c,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index f7936a5..65bf320 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 _0x1e43=['events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x1e43,0x168));var _0x31e4=function(_0x48f7cf,_0x4baa04){_0x48f7cf=_0x48f7cf-0x0;var _0xc201c0=_0x1e43[_0x48f7cf];return _0xc201c0;};'use strict';var EventEmitter=require(_0x31e4('0x0'));var Dashboard=require(_0x31e4('0x1'))['db'][_0x31e4('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x31e4('0x3')](0x0);var events={'afterCreate':_0x31e4('0x4'),'afterUpdate':_0x31e4('0x5'),'afterDestroy':_0x31e4('0x6')};function emitEvent(_0x510dc7){return function(_0x18b49e,_0x3a5d4d,_0x510051){DashboardEvents[_0x31e4('0x7')](_0x510dc7+':'+_0x18b49e['id'],_0x18b49e);DashboardEvents['emit'](_0x510dc7,_0x18b49e);_0x510051(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0xfeef=['save','update','remove','emit','hook','exports','events','Dashboard','setMaxListeners'];(function(_0x2bc7bc,_0x827ea){var _0xbae862=function(_0xdde795){while(--_0xdde795){_0x2bc7bc['push'](_0x2bc7bc['shift']());}};_0xbae862(++_0x827ea);}(_0xfeef,0x10b));var _0xffee=function(_0x88642e,_0x5a7cfc){_0x88642e=_0x88642e-0x0;var _0x1adf98=_0xfeef[_0x88642e];return _0x1adf98;};'use strict';var EventEmitter=require(_0xffee('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xffee('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xffee('0x2')](0x0);var events={'afterCreate':_0xffee('0x3'),'afterUpdate':_0xffee('0x4'),'afterDestroy':_0xffee('0x5')};function emitEvent(_0x35cf46){return function(_0x1ad432,_0x19e939,_0x2c399a){DashboardEvents[_0xffee('0x6')](_0x35cf46+':'+_0x1ad432['id'],_0x1ad432);DashboardEvents[_0xffee('0x6')](_0x35cf46,_0x1ad432);_0x2c399a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xffee('0x7')](e,emitEvent(event));}}module[_0xffee('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 358f555..0ff01c8 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 _0x51c7=['path','rimraf','../../config/environment','define','Dashboard','dashboards','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0x51c7,0x96));var _0x751c=function(_0x5d5ea8,_0x24952a){_0x5d5ea8=_0x5d5ea8-0x0;var _0x553c87=_0x51c7[_0x5d5ea8];return _0x553c87;};'use strict';var _=require(_0x751c('0x0'));var util=require(_0x751c('0x1'));var logger=require(_0x751c('0x2'))('api');var moment=require(_0x751c('0x3'));var BPromise=require(_0x751c('0x4'));var rp=require(_0x751c('0x5'));var fs=require('fs');var path=require(_0x751c('0x6'));var rimraf=require(_0x751c('0x7'));var config=require(_0x751c('0x8'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x58aca1,_0x42637e){return _0x58aca1[_0x751c('0x9')](_0x751c('0xa'),attributes,{'tableName':_0x751c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01f6=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','Dashboard'];(function(_0x31d999,_0xe8f241){var _0x171f68=function(_0x47288e){while(--_0x47288e){_0x31d999['push'](_0x31d999['shift']());}};_0x171f68(++_0xe8f241);}(_0x01f6,0xea));var _0x601f=function(_0x4853fc,_0x52cd55){_0x4853fc=_0x4853fc-0x0;var _0x23be73=_0x01f6[_0x4853fc];return _0x23be73;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x601f('0x0'))(_0x601f('0x1'));var moment=require('moment');var BPromise=require(_0x601f('0x2'));var rp=require(_0x601f('0x3'));var fs=require('fs');var path=require(_0x601f('0x4'));var rimraf=require(_0x601f('0x5'));var config=require(_0x601f('0x6'));var attributes=require('./dashboard.attributes');module[_0x601f('0x7')]=function(_0x5724a2,_0x824bec){return _0x5724a2['define'](_0x601f('0x8'),attributes,{'tableName':'dashboards','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 d88dc8f..4956ace 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 _0x2d8d=['stringify','code','Dashboard,\x20%s,\x20%s','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','request\x20sent','debug'];(function(_0x54a6c1,_0x2be625){var _0x2af157=function(_0x14fb5e){while(--_0x14fb5e){_0x54a6c1['push'](_0x54a6c1['shift']());}};_0x2af157(++_0x2be625);}(_0x2d8d,0x115));var _0xd2d8=function(_0x325501,_0x5242f6){_0x325501=_0x325501-0x0;var _0x2c1626=_0x2d8d[_0x325501];return _0x2c1626;};'use strict';var _=require('lodash');var util=require(_0xd2d8('0x0'));var moment=require('moment');var BPromise=require(_0xd2d8('0x1'));var rs=require(_0xd2d8('0x2'));var fs=require('fs');var Redis=require(_0xd2d8('0x3'));var db=require(_0xd2d8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd2d8('0x5'));var config=require(_0xd2d8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd2d8('0x7')][_0xd2d8('0x8')]({'port':0x232a});config[_0xd2d8('0x9')]=_[_0xd2d8('0xa')](config[_0xd2d8('0x9')],{'host':_0xd2d8('0xb'),'port':0x18eb});var socket=require(_0xd2d8('0xc'))(new Redis(config[_0xd2d8('0x9')]));require(_0xd2d8('0xd'))[_0xd2d8('0xe')](socket);function respondWithRpcPromise(_0x11d914,_0x56ae4b,_0x330d12){return new BPromise(function(_0x57d96f,_0x2bea45){return client[_0xd2d8('0xf')](_0x11d914,_0x330d12)[_0xd2d8('0x10')](function(_0x5bc3e7){logger[_0xd2d8('0x11')]('Dashboard,\x20%s,\x20%s',_0x56ae4b,_0xd2d8('0x12'));logger[_0xd2d8('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x56ae4b,_0xd2d8('0x12'),JSON[_0xd2d8('0x14')](_0x5bc3e7));if(_0x5bc3e7['error']){if(_0x5bc3e7['error'][_0xd2d8('0x15')]===0x1f4){logger['error'](_0xd2d8('0x16'),_0x56ae4b,_0x5bc3e7[_0xd2d8('0x17')]['message']);return _0x2bea45(_0x5bc3e7[_0xd2d8('0x17')][_0xd2d8('0x18')]);}logger[_0xd2d8('0x17')](_0xd2d8('0x16'),_0x56ae4b,_0x5bc3e7[_0xd2d8('0x17')][_0xd2d8('0x18')]);return _0x57d96f(_0x5bc3e7[_0xd2d8('0x17')][_0xd2d8('0x18')]);}else{logger[_0xd2d8('0x11')](_0xd2d8('0x16'),_0x56ae4b,_0xd2d8('0x12'));_0x57d96f(_0x5bc3e7[_0xd2d8('0x19')][_0xd2d8('0x18')]);}})[_0xd2d8('0x1a')](function(_0x6cfd3c){logger['error'](_0xd2d8('0x16'),_0x56ae4b,_0x6cfd3c);_0x2bea45(_0x6cfd3c);});});} \ No newline at end of file +var _0x99a6=['client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','info','request\x20sent','debug','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x24ce0f,_0x371a56){var _0x2a2954=function(_0x118052){while(--_0x118052){_0x24ce0f['push'](_0x24ce0f['shift']());}};_0x2a2954(++_0x371a56);}(_0x99a6,0x7d));var _0x699a=function(_0x411b14,_0x3f9e36){_0x411b14=_0x411b14-0x0;var _0x402736=_0x99a6[_0x411b14];return _0x402736;};'use strict';var _=require(_0x699a('0x0'));var util=require(_0x699a('0x1'));var moment=require(_0x699a('0x2'));var BPromise=require(_0x699a('0x3'));var rs=require(_0x699a('0x4'));var fs=require('fs');var Redis=require(_0x699a('0x5'));var db=require(_0x699a('0x6'))['db'];var utils=require(_0x699a('0x7'));var logger=require(_0x699a('0x8'))(_0x699a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x699a('0xa')][_0x699a('0xb')]({'port':0x232a});config[_0x699a('0xc')]=_['defaults'](config[_0x699a('0xc')],{'host':_0x699a('0xd'),'port':0x18eb});var socket=require(_0x699a('0xe'))(new Redis(config[_0x699a('0xc')]));require(_0x699a('0xf'))[_0x699a('0x10')](socket);function respondWithRpcPromise(_0x2fbe93,_0x5eedb0,_0x5de563){return new BPromise(function(_0x583bc2,_0x158782){return client['request'](_0x2fbe93,_0x5de563)['then'](function(_0x168a1c){logger[_0x699a('0x11')]('Dashboard,\x20%s,\x20%s',_0x5eedb0,_0x699a('0x12'));logger[_0x699a('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x5eedb0,_0x699a('0x12'),JSON[_0x699a('0x14')](_0x168a1c));if(_0x168a1c[_0x699a('0x15')]){if(_0x168a1c[_0x699a('0x15')][_0x699a('0x16')]===0x1f4){logger[_0x699a('0x15')](_0x699a('0x17'),_0x5eedb0,_0x168a1c['error'][_0x699a('0x18')]);return _0x158782(_0x168a1c[_0x699a('0x15')][_0x699a('0x18')]);}logger[_0x699a('0x15')](_0x699a('0x17'),_0x5eedb0,_0x168a1c[_0x699a('0x15')][_0x699a('0x18')]);return _0x583bc2(_0x168a1c[_0x699a('0x15')][_0x699a('0x18')]);}else{logger[_0x699a('0x11')](_0x699a('0x17'),_0x5eedb0,_0x699a('0x12'));_0x583bc2(_0x168a1c[_0x699a('0x19')]['message']);}})[_0x699a('0x1a')](function(_0x1b14ed){logger[_0x699a('0x15')](_0x699a('0x17'),_0x5eedb0,_0x1b14ed);_0x158782(_0x1b14ed);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 7879268..97d2393 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 _0x9c55=['remove','emit','removeListener','register','length','dashboard:','./dashboard.events','save'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x9c55,0x12e));var _0x59c5=function(_0x448313,_0x2b5e0f){_0x448313=_0x448313-0x0;var _0x3740be=_0x9c55[_0x448313];return _0x3740be;};'use strict';var DashboardEvents=require(_0x59c5('0x0'));var events=[_0x59c5('0x1'),_0x59c5('0x2'),'update'];function createListener(_0x4370ed,_0x46dc6a){return function(_0x319389){_0x46dc6a[_0x59c5('0x3')](_0x4370ed,_0x319389);};}function removeListener(_0x4a83ef,_0x58287a){return function(){DashboardEvents[_0x59c5('0x4')](_0x4a83ef,_0x58287a);};}exports[_0x59c5('0x5')]=function(_0x45a84a){for(var _0x10f4fd=0x0,_0x4b642b=events[_0x59c5('0x6')];_0x10f4fd<_0x4b642b;_0x10f4fd++){var _0x41f8bc=events[_0x10f4fd];var _0x391339=createListener(_0x59c5('0x7')+_0x41f8bc,_0x45a84a);DashboardEvents['on'](_0x41f8bc,_0x391339);}}; \ No newline at end of file +var _0x14ea=['register','dashboard:','./dashboard.events','save','remove','update','emit','removeListener'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x14ea,0xd2));var _0xa14e=function(_0x4e6845,_0x5001f6){_0x4e6845=_0x4e6845-0x0;var _0x3703e2=_0x14ea[_0x4e6845];return _0x3703e2;};'use strict';var DashboardEvents=require(_0xa14e('0x0'));var events=[_0xa14e('0x1'),_0xa14e('0x2'),_0xa14e('0x3')];function createListener(_0x153ee2,_0x2f870f){return function(_0x31441b){_0x2f870f[_0xa14e('0x4')](_0x153ee2,_0x31441b);};}function removeListener(_0x26e986,_0x568d41){return function(){DashboardEvents[_0xa14e('0x5')](_0x26e986,_0x568d41);};}exports[_0xa14e('0x6')]=function(_0x159d1f){for(var _0x5a5631=0x0,_0x290e9c=events['length'];_0x5a5631<_0x290e9c;_0x5a5631++){var _0x19e0a9=events[_0x5a5631];var _0x366428=createListener(_0xa14e('0x7')+_0x19e0a9,_0x159d1f);DashboardEvents['on'](_0x19e0a9,_0x366428);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 759a48f..b7480c7 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 _0x1555=['./dashboard.controller','get','isAuthenticated','index','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x26448f,_0x4c5be8){var _0x23f221=function(_0x5eb608){while(--_0x5eb608){_0x26448f['push'](_0x26448f['shift']());}};_0x23f221(++_0x4c5be8);}(_0x1555,0x15f));var _0x5155=function(_0x72352c,_0xce6196){_0x72352c=_0x72352c-0x0;var _0x56a0e0=_0x1555[_0x72352c];return _0x56a0e0;};'use strict';var multer=require(_0x5155('0x0'));var util=require(_0x5155('0x1'));var path=require(_0x5155('0x2'));var timeout=require(_0x5155('0x3'));var express=require(_0x5155('0x4'));var router=express[_0x5155('0x5')]();var fs_extra=require(_0x5155('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5155('0x7'));var config=require(_0x5155('0x8'));var controller=require(_0x5155('0x9'));router[_0x5155('0xa')]('/',auth[_0x5155('0xb')](),controller[_0x5155('0xc')]);router['get']('/:id',auth[_0x5155('0xb')](),controller[_0x5155('0xd')]);router[_0x5155('0xa')](_0x5155('0xe'),auth[_0x5155('0xb')](),controller[_0x5155('0xf')]);router[_0x5155('0x10')]('/',auth[_0x5155('0xb')](),controller[_0x5155('0x11')]);router[_0x5155('0x10')](_0x5155('0x12'),auth['isAuthenticated'](),controller[_0x5155('0x13')]);router[_0x5155('0x10')]('/:id/items',auth[_0x5155('0xb')](),controller[_0x5155('0x14')]);router['put'](_0x5155('0x15'),auth[_0x5155('0xb')](),controller['update']);router['delete'](_0x5155('0x15'),auth[_0x5155('0xb')](),controller[_0x5155('0x16')]);module[_0x5155('0x17')]=router; \ No newline at end of file +var _0xea1b=['../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','getItems','post','create','/:id/clone','clone','addItem','update','destroy','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x454ea3,_0xc74a1c){var _0x5ad18a=function(_0x347b91){while(--_0x347b91){_0x454ea3['push'](_0x454ea3['shift']());}};_0x5ad18a(++_0xc74a1c);}(_0xea1b,0x7e));var _0xbea1=function(_0x250375,_0x568052){_0x250375=_0x250375-0x0;var _0x6f08f5=_0xea1b[_0x250375];return _0x6f08f5;};'use strict';var multer=require(_0xbea1('0x0'));var util=require(_0xbea1('0x1'));var path=require(_0xbea1('0x2'));var timeout=require('connect-timeout');var express=require(_0xbea1('0x3'));var router=express['Router']();var fs_extra=require(_0xbea1('0x4'));var auth=require(_0xbea1('0x5'));var interaction=require(_0xbea1('0x6'));var config=require(_0xbea1('0x7'));var controller=require(_0xbea1('0x8'));router[_0xbea1('0x9')]('/',auth[_0xbea1('0xa')](),controller[_0xbea1('0xb')]);router[_0xbea1('0x9')](_0xbea1('0xc'),auth['isAuthenticated'](),controller[_0xbea1('0xd')]);router[_0xbea1('0x9')]('/:id/items',auth[_0xbea1('0xa')](),controller[_0xbea1('0xe')]);router[_0xbea1('0xf')]('/',auth[_0xbea1('0xa')](),controller[_0xbea1('0x10')]);router[_0xbea1('0xf')](_0xbea1('0x11'),auth[_0xbea1('0xa')](),controller[_0xbea1('0x12')]);router[_0xbea1('0xf')]('/:id/items',auth['isAuthenticated'](),controller[_0xbea1('0x13')]);router['put'](_0xbea1('0xc'),auth[_0xbea1('0xa')](),controller[_0xbea1('0x14')]);router['delete'](_0xbea1('0xc'),auth[_0xbea1('0xa')](),controller[_0xbea1('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 8e7c5e1..fc1e736 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 _0xc4aa=['getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x2b6060,_0x37e3f5){var _0x5d19c6=function(_0x17c310){while(--_0x17c310){_0x2b6060['push'](_0x2b6060['shift']());}};_0x5d19c6(++_0x37e3f5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4aa[_0x5f09c5];return _0x426ad9;};'use strict';var Sequelize=require(_0xac4a('0x0'));var squel=require(_0xac4a('0x1'));var _=require(_0xac4a('0x2'));module[_0xac4a('0x3')]={'title':{'type':Sequelize[_0xac4a('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xac4a('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this[_0xac4a('0x5')](_0xac4a('0x6')));}catch(_0x730a38){return[];}},'set':function(_0x215f39){try{this[_0xac4a('0x7')](_0xac4a('0x6'),JSON[_0xac4a('0x8')](_0x215f39));}catch(_0x10525b){this['setDataValue']('attrs',JSON[_0xac4a('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xac4a('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xac4a('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xac4a('0x9')]},'background':{'type':Sequelize[_0xac4a('0x4')],'allowNull':![],'defaultValue':_0xac4a('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xac4a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xac4a('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0xbd51=['setDataValue','INTEGER','#ffffff','#2196f3','sequelize','lodash','exports','STRING','attrs','stringify'];(function(_0x312f92,_0x3aa0d0){var _0x14c7e=function(_0x2474cb){while(--_0x2474cb){_0x312f92['push'](_0x312f92['shift']());}};_0x14c7e(++_0x3aa0d0);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x53a21f,_0x536f9a){_0x53a21f=_0x53a21f-0x0;var _0x50815d=_0xbd51[_0x53a21f];return _0x50815d;};'use strict';var Sequelize=require(_0x1bd5('0x0'));var squel=require('squel');var _=require(_0x1bd5('0x1'));module[_0x1bd5('0x2')]={'title':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x1bd5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x1bd5('0x4')));}catch(_0x362b24){return[];}},'set':function(_0x43e6b6){try{this['setDataValue'](_0x1bd5('0x4'),JSON[_0x1bd5('0x5')](_0x43e6b6));}catch(_0x19077c){this[_0x1bd5('0x6')](_0x1bd5('0x4'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x1bd5('0x7')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x1bd5('0x7')]},'col':{'type':Sequelize[_0x1bd5('0x7')]},'background':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![],'defaultValue':_0x1bd5('0x8'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![],'defaultValue':_0x1bd5('0x9'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x1bd5('0x7')],'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 ec08e5a..bc5fe26 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 _0x1115=['clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','show','DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','model','fields','length','includeAll','merge','options','catch','find','params','type','iframe','attrUrl','attrs','value','https://','custom','attrPath'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1115,0x1b6));var _0x5111=function(_0x31c7b3,_0x4da6c8){_0x31c7b3=_0x31c7b3-0x0;var _0x22a194=_0x1115[_0x31c7b3];return _0x22a194;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5111('0x0'));var zipdir=require(_0x5111('0x1'));var jsonpatch=require(_0x5111('0x2'));var rp=require(_0x5111('0x3'));var moment=require(_0x5111('0x4'));var BPromise=require(_0x5111('0x5'));var Mustache=require(_0x5111('0x6'));var util=require(_0x5111('0x7'));var path=require(_0x5111('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5111('0x9'));var fs=require('fs');var fs_extra=require(_0x5111('0xa'));var _=require('lodash');var squel=require(_0x5111('0xb'));var crypto=require(_0x5111('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5111('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5111('0xe'));var Papa=require(_0x5111('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5111('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5111('0x11'));var logger=require('../../config/logger')(_0x5111('0x12'));var utils=require(_0x5111('0x13'));var config=require(_0x5111('0x14'));var licenseUtil=require(_0x5111('0x15'));var db=require(_0x5111('0x16'))['db'];config[_0x5111('0x17')]=_[_0x5111('0x18')](config[_0x5111('0x17')],{'host':_0x5111('0x19'),'port':0x18eb});var socket=require(_0x5111('0x1a'))(new Redis(config[_0x5111('0x17')]));require(_0x5111('0x1b'))[_0x5111('0x1c')](socket);function respondWithStatusCode(_0x3e60b5,_0x3721d5){_0x3721d5=_0x3721d5||0xcc;return function(_0x291d54){if(_0x291d54){return _0x3e60b5[_0x5111('0x1d')](_0x3721d5);}return _0x3e60b5[_0x5111('0x1e')](_0x3721d5)['end']();};}function respondWithResult(_0x1ac606,_0x54e2b7){_0x54e2b7=_0x54e2b7||0xc8;return function(_0x5ba7b1){if(_0x5ba7b1){return _0x1ac606[_0x5111('0x1e')](_0x54e2b7)[_0x5111('0x1f')](_0x5ba7b1);}};}function respondWithFilteredResult(_0x638470,_0x51ce4a){return function(_0x367f8d){if(_0x367f8d){var _0xa3f4ba=typeof _0x51ce4a['offset']===_0x5111('0x20')&&typeof _0x51ce4a[_0x5111('0x21')]===_0x5111('0x20');var _0x1b3b45=_0x367f8d['count'];var _0x52d236=_0xa3f4ba?0x0:_0x51ce4a[_0x5111('0x22')];var _0x1b0e5c=_0xa3f4ba?_0x367f8d[_0x5111('0x23')]:_0x51ce4a[_0x5111('0x22')]+_0x51ce4a[_0x5111('0x21')];var _0x3e8de1;if(_0x1b0e5c>=_0x1b3b45){_0x1b0e5c=_0x1b3b45;_0x3e8de1=0xc8;}else{_0x3e8de1=0xce;}_0x638470[_0x5111('0x1e')](_0x3e8de1);return _0x638470[_0x5111('0x24')](_0x5111('0x25'),_0x52d236+'-'+_0x1b0e5c+'/'+_0x1b3b45)['json'](_0x367f8d);}return null;};}function patchUpdates(_0x3f462d){return function(_0x162ff9){try{jsonpatch[_0x5111('0x26')](_0x162ff9,_0x3f462d,!![]);}catch(_0x5bf534){return BPromise[_0x5111('0x27')](_0x5bf534);}return _0x162ff9[_0x5111('0x28')]();};}function saveUpdates(_0x2d9446,_0x268070){return function(_0x10a3fe){if(_0x10a3fe){return _0x10a3fe[_0x5111('0x29')](_0x2d9446)[_0x5111('0x2a')](function(_0x316b39){return _0x316b39;});}return null;};}function removeEntity(_0x382bd0,_0x1a5793){return function(_0x4ffdc3){if(_0x4ffdc3){return _0x4ffdc3[_0x5111('0x2b')]()[_0x5111('0x2a')](function(){_0x382bd0[_0x5111('0x1e')](0xcc)[_0x5111('0x2c')]();});}};}function handleEntityNotFound(_0x265149,_0x403dd7){return function(_0x2e24ed){if(!_0x2e24ed){_0x265149['sendStatus'](0x194);}return _0x2e24ed;};}function handleError(_0x1ce17f,_0x46134c){_0x46134c=_0x46134c||0x1f4;return function(_0x25a75a){logger['error'](_0x25a75a[_0x5111('0x2d')]);if(_0x25a75a[_0x5111('0x2e')]){delete _0x25a75a[_0x5111('0x2e')];}_0x1ce17f['status'](_0x46134c)['send'](_0x25a75a);};}exports[_0x5111('0x2f')]=function(_0x5165fc,_0xbacf9e){var _0x5b5a6d={'raw':![],'where':{'id':_0x5165fc['params']['id']}},_0x35ed41={};_0x35ed41['model']=_['keys'](db[_0x5111('0x30')][_0x5111('0x31')]);_0x35ed41[_0x5111('0x32')]=_[_0x5111('0x33')](_0x5165fc[_0x5111('0x32')]);_0x35ed41[_0x5111('0x34')]=_[_0x5111('0x35')](_0x35ed41['model'],_0x35ed41[_0x5111('0x32')]);_0x5b5a6d[_0x5111('0x36')]=_[_0x5111('0x35')](_0x35ed41[_0x5111('0x37')],qs['fields'](_0x5165fc['query'][_0x5111('0x38')]));_0x5b5a6d[_0x5111('0x36')]=_0x5b5a6d[_0x5111('0x36')][_0x5111('0x39')]?_0x5b5a6d[_0x5111('0x36')]:_0x35ed41[_0x5111('0x37')];if(_0x5165fc[_0x5111('0x32')][_0x5111('0x3a')]){_0x5b5a6d['include']=[{'all':!![]}];}_0x5b5a6d=_[_0x5111('0x3b')]({},_0x5b5a6d,_0x5165fc[_0x5111('0x3c')]);return db[_0x5111('0x30')]['find'](_0x5b5a6d)[_0x5111('0x2a')](handleEntityNotFound(_0xbacf9e,null))[_0x5111('0x2a')](respondWithResult(_0xbacf9e,null))[_0x5111('0x3d')](handleError(_0xbacf9e,null));};exports['destroy']=function(_0x4ecbc9,_0x4c26b1){return db[_0x5111('0x30')][_0x5111('0x3e')]({'where':{'id':_0x4ecbc9[_0x5111('0x3f')]['id']}})[_0x5111('0x2a')](handleEntityNotFound(_0x4c26b1,null))[_0x5111('0x2a')](removeEntity(_0x4c26b1,null))['catch'](handleError(_0x4c26b1,null));};function widgetAttributes(_0x45d094){try{switch(_0x45d094[_0x5111('0x40')]){case _0x5111('0x41'):return[{'name':_0x5111('0x42'),'value':_0x45d094['attrUrl']||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x0]?_0x45d094[_0x5111('0x43')][0x0][_0x5111('0x44')]:undefined)||_0x5111('0x45')}];case _0x5111('0x46'):return[{'name':_0x5111('0x47'),'value':_0x45d094[_0x5111('0x47')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x0]?_0x45d094[_0x5111('0x43')][0x0][_0x5111('0x44')]:undefined)||''}];case _0x5111('0x48'):return[{'name':'attrHourFormat','value':_0x45d094[_0x5111('0x49')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094['attrs'][0x0]?_0x45d094[_0x5111('0x43')][0x0][_0x5111('0x44')]:undefined)||_0x5111('0x4a')},{'name':_0x5111('0x4b'),'value':_0x45d094[_0x5111('0x4b')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x1]?_0x45d094['attrs'][0x1][_0x5111('0x44')]:undefined)||_0x5111('0x4c')},{'name':_0x5111('0x4d'),'value':_0x45d094[_0x5111('0x4d')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094['attrs'][0x2]?_0x45d094['attrs'][0x2][_0x5111('0x44')]:undefined)||0xc}];case _0x5111('0x4e'):return[{'name':'attrMetric','value':_0x45d094[_0x5111('0x4f')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x0]?_0x45d094[_0x5111('0x43')][0x0][_0x5111('0x44')]:undefined)||_0x5111('0x50')},{'name':_0x5111('0x51'),'value':_0x45d094[_0x5111('0x51')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x1]?_0x45d094['attrs'][0x1]['value']:undefined)||[]},{'name':_0x5111('0x4d'),'value':_0x45d094[_0x5111('0x4d')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x2]?_0x45d094[_0x5111('0x43')][0x2][_0x5111('0x44')]:undefined)||0x14},{'name':'attrChannel','value':_0x45d094[_0x5111('0x52')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x3]?_0x45d094[_0x5111('0x43')][0x3]['value']:undefined)||_0x5111('0x53')},{'name':_0x5111('0x54'),'value':_0x45d094[_0x5111('0x54')]||(_0x45d094['attrs']&&_0x45d094[_0x5111('0x43')][0x4]?_0x45d094[_0x5111('0x43')][0x4][_0x5111('0x44')]:undefined)||''},{'name':_0x5111('0x55'),'value':_0x45d094['attrFaxAccounts']||(_0x45d094['attrs']&&_0x45d094[_0x5111('0x43')][0x5]?_0x45d094['attrs'][0x5]['value']:undefined)||''},{'name':_0x5111('0x56'),'value':_0x45d094[_0x5111('0x56')]||(_0x45d094['attrs']&&_0x45d094[_0x5111('0x43')][0x6]?_0x45d094[_0x5111('0x43')][0x6][_0x5111('0x44')]:undefined)||''},{'name':_0x5111('0x57'),'value':_0x45d094[_0x5111('0x57')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x7]?_0x45d094[_0x5111('0x43')][0x7][_0x5111('0x44')]:undefined)||''},{'name':_0x5111('0x58'),'value':_0x45d094[_0x5111('0x58')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094['attrs'][0x8]?_0x45d094[_0x5111('0x43')][0x8][_0x5111('0x44')]:undefined)||''},{'name':_0x5111('0x59'),'value':_0x45d094[_0x5111('0x59')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x9]?_0x45d094[_0x5111('0x43')][0x9]['value']:undefined)||''}];case'multibar-chart':case _0x5111('0x5a'):return[{'name':'attrSerie1','value':_0x45d094[_0x5111('0x5b')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x0]?_0x45d094[_0x5111('0x43')][0x0][_0x5111('0x44')]:undefined)||_0x5111('0x50')},{'name':_0x5111('0x5c'),'value':_0x45d094['attrSerie2']||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x1]?_0x45d094['attrs'][0x1][_0x5111('0x44')]:undefined)||null},{'name':_0x5111('0x5d'),'value':_0x45d094['attrSerie3']||(_0x45d094[_0x5111('0x43')]&&_0x45d094['attrs'][0x2]?_0x45d094['attrs'][0x2]['value']:undefined)||null},{'name':_0x5111('0x51'),'value':_0x45d094[_0x5111('0x51')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x3]?_0x45d094['attrs'][0x3][_0x5111('0x44')]:undefined)||[]},{'name':_0x5111('0x52'),'value':_0x45d094[_0x5111('0x52')]||(_0x45d094['attrs']&&_0x45d094[_0x5111('0x43')][0x4]?_0x45d094[_0x5111('0x43')][0x4][_0x5111('0x44')]:undefined)||'voice'},{'name':_0x5111('0x54'),'value':_0x45d094['attrEmailAccounts']||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x5]?_0x45d094[_0x5111('0x43')][0x5][_0x5111('0x44')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x45d094[_0x5111('0x55')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x6]?_0x45d094[_0x5111('0x43')][0x6][_0x5111('0x44')]:undefined)||''},{'name':_0x5111('0x56'),'value':_0x45d094[_0x5111('0x56')]||(_0x45d094['attrs']&&_0x45d094[_0x5111('0x43')][0x7]?_0x45d094['attrs'][0x7][_0x5111('0x44')]:undefined)||''},{'name':_0x5111('0x57'),'value':_0x45d094[_0x5111('0x57')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x8]?_0x45d094[_0x5111('0x43')][0x8]['value']:undefined)||''},{'name':_0x5111('0x58'),'value':_0x45d094[_0x5111('0x58')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x9]?_0x45d094[_0x5111('0x43')][0x9][_0x5111('0x44')]:undefined)||''},{'name':'attrChatWebsites','value':_0x45d094[_0x5111('0x59')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0xa]?_0x45d094[_0x5111('0x43')][0xa][_0x5111('0x44')]:undefined)||''}];case'web-report':return[{'name':_0x5111('0x5e'),'type':_0x45d094[_0x5111('0x5f')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x0]?_0x45d094[_0x5111('0x43')][0x0][_0x5111('0x40')]:undefined)||null,'value':_0x45d094[_0x5111('0x5e')]||(_0x45d094['attrs']&&_0x45d094['attrs'][0x0]?_0x45d094['attrs'][0x0][_0x5111('0x44')]:undefined)||null},{'name':_0x5111('0x60'),'value':_0x45d094[_0x5111('0x60')]||(_0x45d094[_0x5111('0x43')]&&_0x45d094[_0x5111('0x43')][0x1]?_0x45d094['attrs'][0x1][_0x5111('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x2d2d52){logger[_0x5111('0x61')](_0x5111('0x62'),JSON[_0x5111('0x63')](_0x2d2d52));return[];}}exports[_0x5111('0x64')]=function(_0x8bc97b,_0x3dee92){if(_0x8bc97b[_0x5111('0x65')]){_0x8bc97b[_0x5111('0x65')]['attrs']=widgetAttributes(_0x8bc97b[_0x5111('0x65')]);}return db[_0x5111('0x30')]['create'](_0x8bc97b[_0x5111('0x65')],{})[_0x5111('0x2a')](respondWithResult(_0x3dee92,0xc9))['catch'](handleError(_0x3dee92,null));};exports[_0x5111('0x29')]=function(_0x3aaecb,_0x1db9a3){if(_0x3aaecb[_0x5111('0x65')]['id']){delete _0x3aaecb[_0x5111('0x65')]['id'];}_0x3aaecb[_0x5111('0x65')][_0x5111('0x43')]=widgetAttributes(_0x3aaecb['body']);return db[_0x5111('0x30')]['find']({'where':{'id':_0x3aaecb['params']['id']}})[_0x5111('0x2a')](handleEntityNotFound(_0x1db9a3,null))['then'](saveUpdates(_0x3aaecb[_0x5111('0x65')],null))['then'](respondWithResult(_0x1db9a3,null))[_0x5111('0x3d')](handleError(_0x1db9a3,null));}; \ No newline at end of file +var _0x9fd4=['defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','stack','name','send','show','model','DashboardItem','rawAttributes','query','intersection','attributes','fields','includeAll','include','options','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','value','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','params','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','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x323d87,_0x4ef3f9){var _0x5e8f74=function(_0x185735){while(--_0x185735){_0x323d87['push'](_0x323d87['shift']());}};_0x5e8f74(++_0x4ef3f9);}(_0x9fd4,0x16c));var _0x49fd=function(_0x57140b,_0xec482d){_0x57140b=_0x57140b-0x0;var _0x31cf97=_0x9fd4[_0x57140b];return _0x31cf97;};'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'];config[_0x49fd('0x1b')]=_[_0x49fd('0x1c')](config[_0x49fd('0x1b')],{'host':_0x49fd('0x1d'),'port':0x18eb});var socket=require(_0x49fd('0x1e'))(new Redis(config[_0x49fd('0x1b')]));require(_0x49fd('0x1f'))[_0x49fd('0x20')](socket);function respondWithStatusCode(_0x44c18c,_0x46760f){_0x46760f=_0x46760f||0xcc;return function(_0x1a9063){if(_0x1a9063){return _0x44c18c[_0x49fd('0x21')](_0x46760f);}return _0x44c18c[_0x49fd('0x22')](_0x46760f)[_0x49fd('0x23')]();};}function respondWithResult(_0x3ca675,_0x2f8d68){_0x2f8d68=_0x2f8d68||0xc8;return function(_0x12ae8f){if(_0x12ae8f){return _0x3ca675[_0x49fd('0x22')](_0x2f8d68)[_0x49fd('0x24')](_0x12ae8f);}};}function respondWithFilteredResult(_0x320fe5,_0x475eee){return function(_0xb55d24){if(_0xb55d24){var _0x5d568d=typeof _0x475eee['offset']===_0x49fd('0x25')&&typeof _0x475eee[_0x49fd('0x26')]==='undefined';var _0x5c323a=_0xb55d24[_0x49fd('0x27')];var _0x53cbd1=_0x5d568d?0x0:_0x475eee[_0x49fd('0x28')];var _0xbb113b=_0x5d568d?_0xb55d24['count']:_0x475eee[_0x49fd('0x28')]+_0x475eee[_0x49fd('0x26')];var _0x5ae3bc;if(_0xbb113b>=_0x5c323a){_0xbb113b=_0x5c323a;_0x5ae3bc=0xc8;}else{_0x5ae3bc=0xce;}_0x320fe5[_0x49fd('0x22')](_0x5ae3bc);return _0x320fe5[_0x49fd('0x29')](_0x49fd('0x2a'),_0x53cbd1+'-'+_0xbb113b+'/'+_0x5c323a)[_0x49fd('0x24')](_0xb55d24);}return null;};}function patchUpdates(_0x20fa0d){return function(_0x156221){try{jsonpatch['apply'](_0x156221,_0x20fa0d,!![]);}catch(_0x46019d){return BPromise[_0x49fd('0x2b')](_0x46019d);}return _0x156221[_0x49fd('0x2c')]();};}function saveUpdates(_0x4bf811,_0x3fa0c){return function(_0x10de13){if(_0x10de13){return _0x10de13[_0x49fd('0x2d')](_0x4bf811)['then'](function(_0x597161){return _0x597161;});}return null;};}function removeEntity(_0x497469,_0x13c5a8){return function(_0x1c9a0e){if(_0x1c9a0e){return _0x1c9a0e[_0x49fd('0x2e')]()[_0x49fd('0x2f')](function(){_0x497469[_0x49fd('0x22')](0xcc)[_0x49fd('0x23')]();});}};}function handleEntityNotFound(_0x20873e,_0x9afc1c){return function(_0x54c8bb){if(!_0x54c8bb){_0x20873e[_0x49fd('0x21')](0x194);}return _0x54c8bb;};}function handleError(_0x52b35d,_0x32fc19){_0x32fc19=_0x32fc19||0x1f4;return function(_0x89badc){logger['error'](_0x89badc[_0x49fd('0x30')]);if(_0x89badc[_0x49fd('0x31')]){delete _0x89badc[_0x49fd('0x31')];}_0x52b35d[_0x49fd('0x22')](_0x32fc19)[_0x49fd('0x32')](_0x89badc);};}exports[_0x49fd('0x33')]=function(_0x23dcc0,_0x242203){var _0x4ae11b={'raw':![],'where':{'id':_0x23dcc0['params']['id']}},_0x42181b={};_0x42181b[_0x49fd('0x34')]=_['keys'](db[_0x49fd('0x35')][_0x49fd('0x36')]);_0x42181b[_0x49fd('0x37')]=_['keys'](_0x23dcc0['query']);_0x42181b['filters']=_[_0x49fd('0x38')](_0x42181b[_0x49fd('0x34')],_0x42181b['query']);_0x4ae11b[_0x49fd('0x39')]=_['intersection'](_0x42181b['model'],qs[_0x49fd('0x3a')](_0x23dcc0[_0x49fd('0x37')][_0x49fd('0x3a')]));_0x4ae11b[_0x49fd('0x39')]=_0x4ae11b[_0x49fd('0x39')]['length']?_0x4ae11b['attributes']:_0x42181b[_0x49fd('0x34')];if(_0x23dcc0[_0x49fd('0x37')][_0x49fd('0x3b')]){_0x4ae11b[_0x49fd('0x3c')]=[{'all':!![]}];}_0x4ae11b=_['merge']({},_0x4ae11b,_0x23dcc0[_0x49fd('0x3d')]);return db[_0x49fd('0x35')][_0x49fd('0x3e')](_0x4ae11b)[_0x49fd('0x2f')](handleEntityNotFound(_0x242203,null))[_0x49fd('0x2f')](respondWithResult(_0x242203,null))[_0x49fd('0x3f')](handleError(_0x242203,null));};exports[_0x49fd('0x2e')]=function(_0x25b9c2,_0x98571b){return db[_0x49fd('0x35')][_0x49fd('0x3e')]({'where':{'id':_0x25b9c2['params']['id']}})[_0x49fd('0x2f')](handleEntityNotFound(_0x98571b,null))[_0x49fd('0x2f')](removeEntity(_0x98571b,null))[_0x49fd('0x3f')](handleError(_0x98571b,null));};function widgetAttributes(_0xfea54d){try{switch(_0xfea54d[_0x49fd('0x40')]){case _0x49fd('0x41'):return[{'name':_0x49fd('0x42'),'value':_0xfea54d[_0x49fd('0x42')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d['attrs'][0x0]?_0xfea54d[_0x49fd('0x43')][0x0]['value']:undefined)||_0x49fd('0x44')}];case _0x49fd('0x45'):return[{'name':'attrPath','value':_0xfea54d[_0x49fd('0x46')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d['attrs'][0x0]?_0xfea54d[_0x49fd('0x43')][0x0]['value']:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0xfea54d[_0x49fd('0x47')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x0]?_0xfea54d[_0x49fd('0x43')][0x0]['value']:undefined)||_0x49fd('0x48')},{'name':_0x49fd('0x49'),'value':_0xfea54d[_0x49fd('0x49')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x1]?_0xfea54d[_0x49fd('0x43')][0x1][_0x49fd('0x4a')]:undefined)||_0x49fd('0x4b')},{'name':'attrFontSize','value':_0xfea54d[_0x49fd('0x4c')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d['attrs'][0x2]?_0xfea54d[_0x49fd('0x43')][0x2][_0x49fd('0x4a')]:undefined)||0xc}];case'counter':return[{'name':_0x49fd('0x4d'),'value':_0xfea54d['attrMetric']||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x0]?_0xfea54d[_0x49fd('0x43')][0x0][_0x49fd('0x4a')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0xfea54d[_0x49fd('0x4e')]||(_0xfea54d['attrs']&&_0xfea54d[_0x49fd('0x43')][0x1]?_0xfea54d[_0x49fd('0x43')][0x1][_0x49fd('0x4a')]:undefined)||[]},{'name':_0x49fd('0x4c'),'value':_0xfea54d['attrFontSize']||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x2]?_0xfea54d[_0x49fd('0x43')][0x2][_0x49fd('0x4a')]:undefined)||0x14},{'name':_0x49fd('0x4f'),'value':_0xfea54d[_0x49fd('0x4f')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x3]?_0xfea54d[_0x49fd('0x43')][0x3][_0x49fd('0x4a')]:undefined)||_0x49fd('0x50')},{'name':_0x49fd('0x51'),'value':_0xfea54d[_0x49fd('0x51')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d['attrs'][0x4]?_0xfea54d['attrs'][0x4][_0x49fd('0x4a')]:undefined)||''},{'name':_0x49fd('0x52'),'value':_0xfea54d[_0x49fd('0x52')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d['attrs'][0x5]?_0xfea54d[_0x49fd('0x43')][0x5][_0x49fd('0x4a')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xfea54d[_0x49fd('0x53')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x6]?_0xfea54d[_0x49fd('0x43')][0x6][_0x49fd('0x4a')]:undefined)||''},{'name':_0x49fd('0x54'),'value':_0xfea54d[_0x49fd('0x54')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x7]?_0xfea54d[_0x49fd('0x43')][0x7][_0x49fd('0x4a')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0xfea54d[_0x49fd('0x55')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x8]?_0xfea54d[_0x49fd('0x43')][0x8][_0x49fd('0x4a')]:undefined)||''},{'name':_0x49fd('0x56'),'value':_0xfea54d['attrChatWebsites']||(_0xfea54d['attrs']&&_0xfea54d[_0x49fd('0x43')][0x9]?_0xfea54d[_0x49fd('0x43')][0x9][_0x49fd('0x4a')]:undefined)||''}];case'multibar-chart':case _0x49fd('0x57'):return[{'name':_0x49fd('0x58'),'value':_0xfea54d['attrSerie1']||(_0xfea54d['attrs']&&_0xfea54d['attrs'][0x0]?_0xfea54d[_0x49fd('0x43')][0x0]['value']:undefined)||'total'},{'name':'attrSerie2','value':_0xfea54d[_0x49fd('0x59')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x1]?_0xfea54d[_0x49fd('0x43')][0x1][_0x49fd('0x4a')]:undefined)||null},{'name':_0x49fd('0x5a'),'value':_0xfea54d[_0x49fd('0x5a')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x2]?_0xfea54d[_0x49fd('0x43')][0x2]['value']:undefined)||null},{'name':_0x49fd('0x4e'),'value':_0xfea54d[_0x49fd('0x4e')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x3]?_0xfea54d[_0x49fd('0x43')][0x3][_0x49fd('0x4a')]:undefined)||[]},{'name':'attrChannel','value':_0xfea54d[_0x49fd('0x4f')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d['attrs'][0x4]?_0xfea54d['attrs'][0x4][_0x49fd('0x4a')]:undefined)||'voice'},{'name':_0x49fd('0x51'),'value':_0xfea54d['attrEmailAccounts']||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d['attrs'][0x5]?_0xfea54d[_0x49fd('0x43')][0x5][_0x49fd('0x4a')]:undefined)||''},{'name':'attrFaxAccounts','value':_0xfea54d[_0x49fd('0x52')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x6]?_0xfea54d[_0x49fd('0x43')][0x6][_0x49fd('0x4a')]:undefined)||''},{'name':_0x49fd('0x53'),'value':_0xfea54d[_0x49fd('0x53')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d['attrs'][0x7]?_0xfea54d[_0x49fd('0x43')][0x7][_0x49fd('0x4a')]:undefined)||''},{'name':_0x49fd('0x54'),'value':_0xfea54d['attrOpenchannelAccounts']||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x8]?_0xfea54d[_0x49fd('0x43')][0x8][_0x49fd('0x4a')]:undefined)||''},{'name':_0x49fd('0x55'),'value':_0xfea54d[_0x49fd('0x55')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x9]?_0xfea54d[_0x49fd('0x43')][0x9]['value']:undefined)||''},{'name':_0x49fd('0x56'),'value':_0xfea54d[_0x49fd('0x56')]||(_0xfea54d['attrs']&&_0xfea54d[_0x49fd('0x43')][0xa]?_0xfea54d[_0x49fd('0x43')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0xfea54d[_0x49fd('0x5b')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x0]?_0xfea54d[_0x49fd('0x43')][0x0][_0x49fd('0x40')]:undefined)||null,'value':_0xfea54d['attrReport']||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d['attrs'][0x0]?_0xfea54d[_0x49fd('0x43')][0x0]['value']:undefined)||null},{'name':_0x49fd('0x5c'),'value':_0xfea54d[_0x49fd('0x5c')]||(_0xfea54d[_0x49fd('0x43')]&&_0xfea54d[_0x49fd('0x43')][0x1]?_0xfea54d['attrs'][0x1][_0x49fd('0x4a')]:undefined)||0x0}];default:return[];}}catch(_0x4feef4){logger['error'](_0x49fd('0x5d'),JSON[_0x49fd('0x5e')](_0x4feef4));return[];}}exports[_0x49fd('0x5f')]=function(_0x58215b,_0x264fe9){if(_0x58215b[_0x49fd('0x60')]){_0x58215b[_0x49fd('0x60')][_0x49fd('0x43')]=widgetAttributes(_0x58215b[_0x49fd('0x60')]);}return db[_0x49fd('0x35')]['create'](_0x58215b['body'],{})[_0x49fd('0x2f')](respondWithResult(_0x264fe9,0xc9))[_0x49fd('0x3f')](handleError(_0x264fe9,null));};exports[_0x49fd('0x2d')]=function(_0x388aee,_0x27806a){if(_0x388aee[_0x49fd('0x60')]['id']){delete _0x388aee[_0x49fd('0x60')]['id'];}_0x388aee[_0x49fd('0x60')][_0x49fd('0x43')]=widgetAttributes(_0x388aee[_0x49fd('0x60')]);return db[_0x49fd('0x35')][_0x49fd('0x3e')]({'where':{'id':_0x388aee[_0x49fd('0x61')]['id']}})['then'](handleEntityNotFound(_0x27806a,null))[_0x49fd('0x2f')](saveUpdates(_0x388aee[_0x49fd('0x60')],null))[_0x49fd('0x2f')](respondWithResult(_0x27806a,null))['catch'](handleError(_0x27806a,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 1ef2901..4ccc994 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 _0xdda7=['update','remove','emit','hook','events','../../mysqldb','DashboardItem','save'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xdda7,0x8c));var _0x7dda=function(_0x5df39c,_0x5c5c62){_0x5df39c=_0x5df39c-0x0;var _0xaf468e=_0xdda7[_0x5df39c];return _0xaf468e;};'use strict';var EventEmitter=require(_0x7dda('0x0'));var DashboardItem=require(_0x7dda('0x1'))['db'][_0x7dda('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7dda('0x3'),'afterUpdate':_0x7dda('0x4'),'afterDestroy':_0x7dda('0x5')};function emitEvent(_0x54df12){return function(_0x1f85a6,_0x4e1d72,_0x108031){DashboardItemEvents['emit'](_0x54df12+':'+_0x1f85a6['id'],_0x1f85a6);DashboardItemEvents[_0x7dda('0x6')](_0x54df12,_0x1f85a6);_0x108031(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x7dda('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xa3a4=['DashboardItem','setMaxListeners','update','remove','emit','hook','events','../../mysqldb'];(function(_0x118e16,_0x2a6f97){var _0x9f7b89=function(_0xd8909a){while(--_0xd8909a){_0x118e16['push'](_0x118e16['shift']());}};_0x9f7b89(++_0x2a6f97);}(_0xa3a4,0x6e));var _0x4a3a=function(_0x8efd06,_0x58b5c4){_0x8efd06=_0x8efd06-0x0;var _0x5cdb5f=_0xa3a4[_0x8efd06];return _0x5cdb5f;};'use strict';var EventEmitter=require(_0x4a3a('0x0'));var DashboardItem=require(_0x4a3a('0x1'))['db'][_0x4a3a('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x4a3a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a3a('0x4'),'afterDestroy':_0x4a3a('0x5')};function emitEvent(_0x465d18){return function(_0x27b07f,_0x5446e7,_0xcce8e0){DashboardItemEvents[_0x4a3a('0x6')](_0x465d18+':'+_0x27b07f['id'],_0x27b07f);DashboardItemEvents['emit'](_0x465d18,_0x27b07f);_0xcce8e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x4a3a('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 3085d5a..b8aa86c 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 _0x3e20=['path','rimraf','exports','define','DashboardItem','dashboard_items','lodash','util','api','bluebird','request-promise'];(function(_0x5b3c11,_0x9d539){var _0x5f4a82=function(_0x58fa2e){while(--_0x58fa2e){_0x5b3c11['push'](_0x5b3c11['shift']());}};_0x5f4a82(++_0x9d539);}(_0x3e20,0xa0));var _0x03e2=function(_0x234cf2,_0x45d5cd){_0x234cf2=_0x234cf2-0x0;var _0xcdc56d=_0x3e20[_0x234cf2];return _0xcdc56d;};'use strict';var _=require(_0x03e2('0x0'));var util=require(_0x03e2('0x1'));var logger=require('../../config/logger')(_0x03e2('0x2'));var moment=require('moment');var BPromise=require(_0x03e2('0x3'));var rp=require(_0x03e2('0x4'));var fs=require('fs');var path=require(_0x03e2('0x5'));var rimraf=require(_0x03e2('0x6'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x03e2('0x7')]=function(_0x4a509d,_0x1fbb97){return _0x4a509d[_0x03e2('0x8')](_0x03e2('0x9'),attributes,{'tableName':_0x03e2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf83f=['bluebird','request-promise','path','../../config/environment','exports','define','DashboardItem','dashboard_items','lodash','util','api','moment'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0xf83f,0xf8));var _0xff83=function(_0x1fbac9,_0x125a34){_0x1fbac9=_0x1fbac9-0x0;var _0x11858f=_0xf83f[_0x1fbac9];return _0x11858f;};'use strict';var _=require(_0xff83('0x0'));var util=require(_0xff83('0x1'));var logger=require('../../config/logger')(_0xff83('0x2'));var moment=require(_0xff83('0x3'));var BPromise=require(_0xff83('0x4'));var rp=require(_0xff83('0x5'));var fs=require('fs');var path=require(_0xff83('0x6'));var rimraf=require('rimraf');var config=require(_0xff83('0x7'));var attributes=require('./dashboardItem.attributes');module[_0xff83('0x8')]=function(_0x5a24ba,_0x22a1b6){return _0x5a24ba[_0xff83('0x9')](_0xff83('0xa'),attributes,{'tableName':_0xff83('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index fcde607..cd38df0 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 _0xb7fb=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','DashboardItem,\x20%s,\x20%s','message','catch','lodash','util','../../config/utils'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xb7fb,0xd9));var _0xbb7f=function(_0x198396,_0x49883b){_0x198396=_0x198396-0x0;var _0x15c689=_0xb7fb[_0x198396];return _0x15c689;};'use strict';var _=require(_0xbb7f('0x0'));var util=require(_0xbb7f('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(_0xbb7f('0x2'));var logger=require(_0xbb7f('0x3'))(_0xbb7f('0x4'));var config=require(_0xbb7f('0x5'));var jayson=require(_0xbb7f('0x6'));var client=jayson[_0xbb7f('0x7')][_0xbb7f('0x8')]({'port':0x232a});config[_0xbb7f('0x9')]=_['defaults'](config[_0xbb7f('0x9')],{'host':_0xbb7f('0xa'),'port':0x18eb});var socket=require(_0xbb7f('0xb'))(new Redis(config[_0xbb7f('0x9')]));require('./dashboardItem.socket')[_0xbb7f('0xc')](socket);function respondWithRpcPromise(_0x39cf53,_0x10f022,_0x456928){return new BPromise(function(_0x5e69d,_0x2a69b4){return client[_0xbb7f('0xd')](_0x39cf53,_0x456928)['then'](function(_0x51364d){logger[_0xbb7f('0xe')]('DashboardItem,\x20%s,\x20%s',_0x10f022,_0xbb7f('0xf'));logger[_0xbb7f('0x10')](_0xbb7f('0x11'),_0x10f022,_0xbb7f('0xf'),JSON['stringify'](_0x51364d));if(_0x51364d[_0xbb7f('0x12')]){if(_0x51364d[_0xbb7f('0x12')]['code']===0x1f4){logger[_0xbb7f('0x12')](_0xbb7f('0x13'),_0x10f022,_0x51364d['error'][_0xbb7f('0x14')]);return _0x2a69b4(_0x51364d['error'][_0xbb7f('0x14')]);}logger['error'](_0xbb7f('0x13'),_0x10f022,_0x51364d[_0xbb7f('0x12')][_0xbb7f('0x14')]);return _0x5e69d(_0x51364d[_0xbb7f('0x12')][_0xbb7f('0x14')]);}else{logger[_0xbb7f('0xe')](_0xbb7f('0x13'),_0x10f022,_0xbb7f('0xf'));_0x5e69d(_0x51364d['result'][_0xbb7f('0x14')]);}})[_0xbb7f('0x15')](function(_0x273073){logger[_0xbb7f('0x12')](_0xbb7f('0x13'),_0x10f022,_0x273073);_0x2a69b4(_0x273073);});});} \ No newline at end of file +var _0x24cd=['localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','DashboardItem,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','defaults','redis'];(function(_0x4c4762,_0x403415){var _0x16ea8e=function(_0x31c3cb){while(--_0x31c3cb){_0x4c4762['push'](_0x4c4762['shift']());}};_0x16ea8e(++_0x403415);}(_0x24cd,0x13a));var _0xd24c=function(_0xda3338,_0x58d4e0){_0xda3338=_0xda3338-0x0;var _0x10f45c=_0x24cd[_0xda3338];return _0x10f45c;};'use strict';var _=require(_0xd24c('0x0'));var util=require('util');var moment=require(_0xd24c('0x1'));var BPromise=require('bluebird');var rs=require(_0xd24c('0x2'));var fs=require('fs');var Redis=require(_0xd24c('0x3'));var db=require(_0xd24c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd24c('0x5'))(_0xd24c('0x6'));var config=require(_0xd24c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd24c('0x8')]['http']({'port':0x232a});config['redis']=_[_0xd24c('0x9')](config[_0xd24c('0xa')],{'host':_0xd24c('0xb'),'port':0x18eb});var socket=require(_0xd24c('0xc'))(new Redis(config[_0xd24c('0xa')]));require('./dashboardItem.socket')[_0xd24c('0xd')](socket);function respondWithRpcPromise(_0x5ea673,_0x45a054,_0x4419c7){return new BPromise(function(_0x2c9e59,_0x3391d8){return client[_0xd24c('0xe')](_0x5ea673,_0x4419c7)[_0xd24c('0xf')](function(_0xf5b30d){logger[_0xd24c('0x10')]('DashboardItem,\x20%s,\x20%s',_0x45a054,_0xd24c('0x11'));logger[_0xd24c('0x12')](_0xd24c('0x13'),_0x45a054,_0xd24c('0x11'),JSON[_0xd24c('0x14')](_0xf5b30d));if(_0xf5b30d[_0xd24c('0x15')]){if(_0xf5b30d[_0xd24c('0x15')]['code']===0x1f4){logger[_0xd24c('0x15')](_0xd24c('0x16'),_0x45a054,_0xf5b30d['error'][_0xd24c('0x17')]);return _0x3391d8(_0xf5b30d[_0xd24c('0x15')][_0xd24c('0x17')]);}logger[_0xd24c('0x15')]('DashboardItem,\x20%s,\x20%s',_0x45a054,_0xf5b30d['error'][_0xd24c('0x17')]);return _0x2c9e59(_0xf5b30d[_0xd24c('0x15')]['message']);}else{logger[_0xd24c('0x10')](_0xd24c('0x16'),_0x45a054,_0xd24c('0x11'));_0x2c9e59(_0xf5b30d[_0xd24c('0x18')][_0xd24c('0x17')]);}})['catch'](function(_0x5ea2da){logger[_0xd24c('0x15')](_0xd24c('0x16'),_0x45a054,_0x5ea2da);_0x3391d8(_0x5ea2da);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 715d220..e7ddf23 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 _0x3d0b=['register','dashboardItem:','./dashboardItem.events','save','remove','update','emit'];(function(_0xad09cb,_0x18b848){var _0x37b003=function(_0x23020c){while(--_0x23020c){_0xad09cb['push'](_0xad09cb['shift']());}};_0x37b003(++_0x18b848);}(_0x3d0b,0x1bb));var _0xb3d0=function(_0xf61d62,_0x5e1ce1){_0xf61d62=_0xf61d62-0x0;var _0x1b8b00=_0x3d0b[_0xf61d62];return _0x1b8b00;};'use strict';var DashboardItemEvents=require(_0xb3d0('0x0'));var events=[_0xb3d0('0x1'),_0xb3d0('0x2'),_0xb3d0('0x3')];function createListener(_0x51c616,_0x57c4c1){return function(_0x15a78c){_0x57c4c1[_0xb3d0('0x4')](_0x51c616,_0x15a78c);};}function removeListener(_0x36c977,_0x222a87){return function(){DashboardItemEvents['removeListener'](_0x36c977,_0x222a87);};}exports[_0xb3d0('0x5')]=function(_0x2cf668){for(var _0x2c6393=0x0,_0x5a9698=events['length'];_0x2c6393<_0x5a9698;_0x2c6393++){var _0x37ceeb=events[_0x2c6393];var _0xd028d7=createListener(_0xb3d0('0x6')+_0x37ceeb,_0x2cf668);DashboardItemEvents['on'](_0x37ceeb,_0xd028d7);}}; \ No newline at end of file +var _0x919e=['emit','removeListener','length','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0xea6018,_0x4cf082){var _0x57b54d=function(_0x49099a){while(--_0x49099a){_0xea6018['push'](_0xea6018['shift']());}};_0x57b54d(++_0x4cf082);}(_0x919e,0x1d2));var _0xe919=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x919e[_0x14add3];return _0x4a174f;};'use strict';var DashboardItemEvents=require(_0xe919('0x0'));var events=[_0xe919('0x1'),_0xe919('0x2'),'update'];function createListener(_0xc5756e,_0x5c3b4e){return function(_0x4d6ab5){_0x5c3b4e[_0xe919('0x3')](_0xc5756e,_0x4d6ab5);};}function removeListener(_0x1e77e1,_0x336711){return function(){DashboardItemEvents[_0xe919('0x4')](_0x1e77e1,_0x336711);};}exports['register']=function(_0x4b8b6a){for(var _0x3c4d1e=0x0,_0x4963f=events[_0xe919('0x5')];_0x3c4d1e<_0x4963f;_0x3c4d1e++){var _0x285b13=events[_0x3c4d1e];var _0x8e987d=createListener(_0xe919('0x6')+_0x285b13,_0x4b8b6a);DashboardItemEvents['on'](_0x285b13,_0x8e987d);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index e04913e..2f9a3f8 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 _0x1f48=['multer','util','path','express','Router','fs-extra','../../config/environment','get','/:id','isAuthenticated','post','create','delete','destroy','exports'];(function(_0x448422,_0x362248){var _0xcc0afd=function(_0x576b07){while(--_0x576b07){_0x448422['push'](_0x448422['shift']());}};_0xcc0afd(++_0x362248);}(_0x1f48,0x186));var _0x81f4=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x1f48[_0xda464c];return _0x19e222;};'use strict';var multer=require(_0x81f4('0x0'));var util=require(_0x81f4('0x1'));var path=require(_0x81f4('0x2'));var timeout=require('connect-timeout');var express=require(_0x81f4('0x3'));var router=express[_0x81f4('0x4')]();var fs_extra=require(_0x81f4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x81f4('0x6'));var controller=require('./dashboardItem.controller');router[_0x81f4('0x7')](_0x81f4('0x8'),auth[_0x81f4('0x9')](),controller['show']);router[_0x81f4('0xa')]('/',auth[_0x81f4('0x9')](),controller[_0x81f4('0xb')]);router['put']('/:id',auth[_0x81f4('0x9')](),controller['update']);router[_0x81f4('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x81f4('0xd')]);module[_0x81f4('0xe')]=router; \ No newline at end of file +var _0xa0df=['isAuthenticated','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','post'];(function(_0x49b446,_0x2e7a57){var _0x41875c=function(_0x548626){while(--_0x548626){_0x49b446['push'](_0x49b446['shift']());}};_0x41875c(++_0x2e7a57);}(_0xa0df,0xcf));var _0xfa0d=function(_0x1a6923,_0x42fe04){_0x1a6923=_0x1a6923-0x0;var _0x5ee1a3=_0xa0df[_0x1a6923];return _0x5ee1a3;};'use strict';var multer=require('multer');var util=require(_0xfa0d('0x0'));var path=require('path');var timeout=require(_0xfa0d('0x1'));var express=require(_0xfa0d('0x2'));var router=express[_0xfa0d('0x3')]();var fs_extra=require(_0xfa0d('0x4'));var auth=require(_0xfa0d('0x5'));var interaction=require(_0xfa0d('0x6'));var config=require(_0xfa0d('0x7'));var controller=require(_0xfa0d('0x8'));router[_0xfa0d('0x9')](_0xfa0d('0xa'),auth['isAuthenticated'](),controller[_0xfa0d('0xb')]);router[_0xfa0d('0xc')]('/',auth[_0xfa0d('0xd')](),controller[_0xfa0d('0xe')]);router[_0xfa0d('0xf')](_0xfa0d('0xa'),auth[_0xfa0d('0xd')](),controller[_0xfa0d('0x10')]);router[_0xfa0d('0x11')](_0xfa0d('0xa'),auth[_0xfa0d('0xd')](),controller[_0xfa0d('0x12')]);module[_0xfa0d('0x13')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 67d8924..f0a235d 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 _0x9846=['sequelize','exports','STRING','ENUM','first','second','third'];(function(_0x43bea1,_0x3e629d){var _0x5e760b=function(_0x173979){while(--_0x173979){_0x43bea1['push'](_0x43bea1['shift']());}};_0x5e760b(++_0x3e629d);}(_0x9846,0x77));var _0x6984=function(_0x598a8d,_0x26d433){_0x598a8d=_0x598a8d-0x0;var _0x2072aa=_0x9846[_0x598a8d];return _0x2072aa;};'use strict';var Sequelize=require(_0x6984('0x0'));module[_0x6984('0x1')]={'name':{'type':Sequelize[_0x6984('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x6984('0x3')](_0x6984('0x4'),_0x6984('0x5'),_0x6984('0x6')),'allowNull':![],'defaultValue':_0x6984('0x4')},'description':{'type':Sequelize[_0x6984('0x2')]}}; \ No newline at end of file +var _0x487a=['ENUM','first','third','sequelize','STRING'];(function(_0x39a9e7,_0x504acb){var _0x118386=function(_0x519793){while(--_0x519793){_0x39a9e7['push'](_0x39a9e7['shift']());}};_0x118386(++_0x504acb);}(_0x487a,0x193));var _0xa487=function(_0x5471ec,_0x1ce81a){_0x5471ec=_0x5471ec-0x0;var _0x121d4c=_0x487a[_0x5471ec];return _0x121d4c;};'use strict';var Sequelize=require(_0xa487('0x0'));module['exports']={'name':{'type':Sequelize[_0xa487('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xa487('0x2')](_0xa487('0x3'),'second',_0xa487('0x4')),'allowNull':![],'defaultValue':_0xa487('0x3')},'description':{'type':Sequelize[_0xa487('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 2318904..687f51a 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 _0xfa45=['keys','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','then','get','Dispositions','UserProfileResource','stack','name','index','map','Disposition','fieldName','type','model','query'];(function(_0x4b55cb,_0x49791b){var _0x2631df=function(_0x2bf591){while(--_0x2bf591){_0x4b55cb['push'](_0x4b55cb['shift']());}};_0x2631df(++_0x49791b);}(_0xfa45,0x11b));var _0x5fa4=function(_0x4a1e41,_0x4d50f7){_0x4a1e41=_0x4a1e41-0x0;var _0x1d4a12=_0xfa45[_0x4a1e41];return _0x1d4a12;};'use strict';var emlformat=require(_0x5fa4('0x0'));var rimraf=require(_0x5fa4('0x1'));var zipdir=require(_0x5fa4('0x2'));var jsonpatch=require(_0x5fa4('0x3'));var rp=require(_0x5fa4('0x4'));var moment=require(_0x5fa4('0x5'));var BPromise=require(_0x5fa4('0x6'));var Mustache=require('mustache');var util=require(_0x5fa4('0x7'));var path=require('path');var sox=require(_0x5fa4('0x8'));var csv=require(_0x5fa4('0x9'));var ejs=require(_0x5fa4('0xa'));var fs=require('fs');var fs_extra=require(_0x5fa4('0xb'));var _=require(_0x5fa4('0xc'));var squel=require(_0x5fa4('0xd'));var crypto=require(_0x5fa4('0xe'));var jsforce=require(_0x5fa4('0xf'));var deskjs=require(_0x5fa4('0x10'));var toCsv=require(_0x5fa4('0x9'));var querystring=require('querystring');var Papa=require(_0x5fa4('0x11'));var Redis=require('ioredis');var authService=require(_0x5fa4('0x12'));var qs=require(_0x5fa4('0x13'));var as=require(_0x5fa4('0x14'));var hardwareService=require(_0x5fa4('0x15'));var logger=require(_0x5fa4('0x16'))(_0x5fa4('0x17'));var utils=require(_0x5fa4('0x18'));var config=require(_0x5fa4('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5fa4('0x1a'))['db'];function respondWithStatusCode(_0x4a6ce3,_0x25abcd){_0x25abcd=_0x25abcd||0xcc;return function(_0x2eeea3){if(_0x2eeea3){return _0x4a6ce3[_0x5fa4('0x1b')](_0x25abcd);}return _0x4a6ce3[_0x5fa4('0x1c')](_0x25abcd)[_0x5fa4('0x1d')]();};}function respondWithResult(_0x51af4c,_0x397328){_0x397328=_0x397328||0xc8;return function(_0x3921b0){if(_0x3921b0){return _0x51af4c['status'](_0x397328)[_0x5fa4('0x1e')](_0x3921b0);}};}function respondWithFilteredResult(_0x40ce98,_0x4d8471){return function(_0x442064){if(_0x442064){var _0x5cacd7=typeof _0x4d8471['offset']===_0x5fa4('0x1f')&&typeof _0x4d8471[_0x5fa4('0x20')]===_0x5fa4('0x1f');var _0x21d502=_0x442064[_0x5fa4('0x21')];var _0x100a46=_0x5cacd7?0x0:_0x4d8471['offset'];var _0x3d6380=_0x5cacd7?_0x442064[_0x5fa4('0x21')]:_0x4d8471[_0x5fa4('0x22')]+_0x4d8471[_0x5fa4('0x20')];var _0x7273f9;if(_0x3d6380>=_0x21d502){_0x3d6380=_0x21d502;_0x7273f9=0xc8;}else{_0x7273f9=0xce;}_0x40ce98[_0x5fa4('0x1c')](_0x7273f9);return _0x40ce98[_0x5fa4('0x23')](_0x5fa4('0x24'),_0x100a46+'-'+_0x3d6380+'/'+_0x21d502)[_0x5fa4('0x1e')](_0x442064);}return null;};}function patchUpdates(_0x1b50c6){return function(_0x7998dc){try{jsonpatch[_0x5fa4('0x25')](_0x7998dc,_0x1b50c6,!![]);}catch(_0x541f44){return BPromise['reject'](_0x541f44);}return _0x7998dc[_0x5fa4('0x26')]();};}function saveUpdates(_0x3b23d6,_0x18eb29){return function(_0x1cd221){if(_0x1cd221){return _0x1cd221['update'](_0x3b23d6)['then'](function(_0x45f9d9){return _0x45f9d9;});}return null;};}function removeEntity(_0x54134f,_0xe63c6b){return function(_0x1a242a){if(_0x1a242a){return _0x1a242a[_0x5fa4('0x27')]()[_0x5fa4('0x28')](function(){var _0x5c479f=_0x1a242a[_0x5fa4('0x29')]({'plain':!![]});var _0x3d2abb=_0x5fa4('0x2a');return db[_0x5fa4('0x2b')]['destroy']({'where':{'type':_0x3d2abb,'resourceId':_0x5c479f['id']}})['then'](function(){return _0x1a242a;});})[_0x5fa4('0x28')](function(){_0x54134f[_0x5fa4('0x1c')](0xcc)[_0x5fa4('0x1d')]();});}};}function handleEntityNotFound(_0xf91114,_0x5a7580){return function(_0x34006f){if(!_0x34006f){_0xf91114[_0x5fa4('0x1b')](0x194);}return _0x34006f;};}function handleError(_0x2355e6,_0x41fbfd){_0x41fbfd=_0x41fbfd||0x1f4;return function(_0x51833c){logger['error'](_0x51833c[_0x5fa4('0x2c')]);if(_0x51833c[_0x5fa4('0x2d')]){delete _0x51833c[_0x5fa4('0x2d')];}_0x2355e6[_0x5fa4('0x1c')](_0x41fbfd)['send'](_0x51833c);};}exports[_0x5fa4('0x2e')]=function(_0x1c6082,_0x14ea77){var _0x25ce24={},_0x1f6b19={},_0x1764b6={'count':0x0,'rows':[]};var _0x2c5397=_[_0x5fa4('0x2f')](db[_0x5fa4('0x30')]['rawAttributes'],function(_0x2c4abf){return{'name':_0x2c4abf[_0x5fa4('0x31')],'type':_0x2c4abf[_0x5fa4('0x32')]['key']};});_0x1f6b19[_0x5fa4('0x33')]=_[_0x5fa4('0x2f')](_0x2c5397,_0x5fa4('0x2d'));_0x1f6b19[_0x5fa4('0x34')]=_[_0x5fa4('0x35')](_0x1c6082[_0x5fa4('0x34')]);_0x1f6b19['filters']=_[_0x5fa4('0x36')](_0x1f6b19[_0x5fa4('0x33')],_0x1f6b19[_0x5fa4('0x34')]);_0x25ce24[_0x5fa4('0x37')]=_[_0x5fa4('0x36')](_0x1f6b19['model'],qs[_0x5fa4('0x38')](_0x1c6082[_0x5fa4('0x34')]['fields']));_0x25ce24[_0x5fa4('0x37')]=_0x25ce24['attributes'][_0x5fa4('0x39')]?_0x25ce24['attributes']:_0x1f6b19[_0x5fa4('0x33')];if(!_0x1c6082[_0x5fa4('0x34')]['hasOwnProperty']('nolimit')){_0x25ce24['limit']=qs[_0x5fa4('0x20')](_0x1c6082[_0x5fa4('0x34')][_0x5fa4('0x20')]);_0x25ce24[_0x5fa4('0x22')]=qs['offset'](_0x1c6082['query'][_0x5fa4('0x22')]);}_0x25ce24[_0x5fa4('0x3a')]=qs[_0x5fa4('0x3b')](_0x1c6082['query'][_0x5fa4('0x3b')]);_0x25ce24[_0x5fa4('0x3c')]=qs[_0x5fa4('0x3d')](_['pick'](_0x1c6082[_0x5fa4('0x34')],_0x1f6b19[_0x5fa4('0x3d')]),_0x2c5397);if(_0x1c6082['query'][_0x5fa4('0x3e')]){_0x25ce24['where']=_[_0x5fa4('0x3f')](_0x25ce24[_0x5fa4('0x3c')],{'$or':_[_0x5fa4('0x2f')](_0x2c5397,function(_0x2f23b){if(_0x2f23b['type']!==_0x5fa4('0x40')){var _0xfdc187={};_0xfdc187[_0x2f23b[_0x5fa4('0x2d')]]={'$like':'%'+_0x1c6082[_0x5fa4('0x34')]['filter']+'%'};return _0xfdc187;}})});}_0x25ce24=_[_0x5fa4('0x3f')]({},_0x25ce24,_0x1c6082[_0x5fa4('0x41')]);var _0x15b081={'where':_0x25ce24[_0x5fa4('0x3c')]};return db[_0x5fa4('0x30')][_0x5fa4('0x21')](_0x15b081)[_0x5fa4('0x28')](function(_0x41683c){_0x1764b6[_0x5fa4('0x21')]=_0x41683c;if(_0x1c6082['query'][_0x5fa4('0x42')]){_0x25ce24[_0x5fa4('0x43')]=[{'all':!![]}];}return db[_0x5fa4('0x30')][_0x5fa4('0x44')](_0x25ce24);})[_0x5fa4('0x28')](function(_0x282257){_0x1764b6[_0x5fa4('0x45')]=_0x282257;return _0x1764b6;})[_0x5fa4('0x28')](respondWithFilteredResult(_0x14ea77,_0x25ce24))[_0x5fa4('0x46')](handleError(_0x14ea77,null));};exports[_0x5fa4('0x47')]=function(_0x724049,_0x1ad8ca){var _0x566499={'raw':!![],'where':{'id':_0x724049[_0x5fa4('0x48')]['id']}},_0x245d28={};_0x245d28[_0x5fa4('0x33')]=_[_0x5fa4('0x35')](db[_0x5fa4('0x30')]['rawAttributes']);_0x245d28[_0x5fa4('0x34')]=_[_0x5fa4('0x35')](_0x724049[_0x5fa4('0x34')]);_0x245d28[_0x5fa4('0x3d')]=_[_0x5fa4('0x36')](_0x245d28[_0x5fa4('0x33')],_0x245d28[_0x5fa4('0x34')]);_0x566499[_0x5fa4('0x37')]=_[_0x5fa4('0x36')](_0x245d28[_0x5fa4('0x33')],qs['fields'](_0x724049[_0x5fa4('0x34')][_0x5fa4('0x38')]));_0x566499[_0x5fa4('0x37')]=_0x566499[_0x5fa4('0x37')][_0x5fa4('0x39')]?_0x566499[_0x5fa4('0x37')]:_0x245d28[_0x5fa4('0x33')];if(_0x724049['query']['includeAll']){_0x566499[_0x5fa4('0x43')]=[{'all':!![]}];}_0x566499=_['merge']({},_0x566499,_0x724049[_0x5fa4('0x41')]);return db[_0x5fa4('0x30')][_0x5fa4('0x49')](_0x566499)[_0x5fa4('0x28')](handleEntityNotFound(_0x1ad8ca,null))[_0x5fa4('0x28')](respondWithResult(_0x1ad8ca,null))[_0x5fa4('0x46')](handleError(_0x1ad8ca,null));};exports[_0x5fa4('0x4a')]=function(_0x571cd2,_0x6e95a){return db[_0x5fa4('0x30')][_0x5fa4('0x4a')](_0x571cd2['body'],{})[_0x5fa4('0x28')](function(_0x4a29b4){var _0x40cc84=_0x571cd2[_0x5fa4('0x4b')][_0x5fa4('0x29')]({'plain':!![]});if(!_0x40cc84)throw new Error(_0x5fa4('0x4c'));if(_0x40cc84[_0x5fa4('0x4d')]===_0x5fa4('0x4b')){var _0xcba431=_0x4a29b4['get']({'plain':!![]});var _0x429683=_0x5fa4('0x2a');return db[_0x5fa4('0x4e')][_0x5fa4('0x49')]({'where':{'name':_0x429683,'userProfileId':_0x40cc84[_0x5fa4('0x4f')]},'raw':!![]})[_0x5fa4('0x28')](function(_0x3e5770){if(_0x3e5770&&_0x3e5770[_0x5fa4('0x50')]===0x0){return db[_0x5fa4('0x2b')][_0x5fa4('0x4a')]({'name':_0xcba431['name'],'resourceId':_0xcba431['id'],'type':_0x3e5770[_0x5fa4('0x2d')],'sectionId':_0x3e5770['id']},{})[_0x5fa4('0x28')](function(){return _0x4a29b4;});}else{return _0x4a29b4;}})['catch'](function(_0xd1527f){logger[_0x5fa4('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd1527f);throw _0xd1527f;});}return _0x4a29b4;})[_0x5fa4('0x28')](respondWithResult(_0x6e95a,0xc9))[_0x5fa4('0x46')](handleError(_0x6e95a,null));};exports[_0x5fa4('0x52')]=function(_0x47d207,_0x14aa7c){if(_0x47d207[_0x5fa4('0x53')]['id']){delete _0x47d207[_0x5fa4('0x53')]['id'];}return db[_0x5fa4('0x30')][_0x5fa4('0x49')]({'where':{'id':_0x47d207[_0x5fa4('0x48')]['id']}})[_0x5fa4('0x28')](handleEntityNotFound(_0x14aa7c,null))['then'](saveUpdates(_0x47d207[_0x5fa4('0x53')],null))[_0x5fa4('0x28')](respondWithResult(_0x14aa7c,null))[_0x5fa4('0x46')](handleError(_0x14aa7c,null));};exports[_0x5fa4('0x27')]=function(_0x4ecf5b,_0x30b4c4){return db[_0x5fa4('0x30')][_0x5fa4('0x49')]({'where':{'id':_0x4ecf5b[_0x5fa4('0x48')]['id']}})[_0x5fa4('0x28')](handleEntityNotFound(_0x30b4c4,null))[_0x5fa4('0x28')](removeEntity(_0x30b4c4,null))['catch'](handleError(_0x30b4c4,null));}; \ No newline at end of file +var _0x8786=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','stack','name','index','map','Disposition','rawAttributes','fieldName','key'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8786,0x7a));var _0x6878=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8786[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x6878('0x0'));var rimraf=require(_0x6878('0x1'));var zipdir=require(_0x6878('0x2'));var jsonpatch=require(_0x6878('0x3'));var rp=require(_0x6878('0x4'));var moment=require(_0x6878('0x5'));var BPromise=require(_0x6878('0x6'));var Mustache=require(_0x6878('0x7'));var util=require(_0x6878('0x8'));var path=require(_0x6878('0x9'));var sox=require(_0x6878('0xa'));var csv=require(_0x6878('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6878('0xc'));var _=require(_0x6878('0xd'));var squel=require('squel');var crypto=require(_0x6878('0xe'));var jsforce=require(_0x6878('0xf'));var deskjs=require(_0x6878('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6878('0x11'));var Papa=require(_0x6878('0x12'));var Redis=require(_0x6878('0x13'));var authService=require(_0x6878('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6878('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6878('0x16'))(_0x6878('0x17'));var utils=require(_0x6878('0x18'));var config=require(_0x6878('0x19'));var licenseUtil=require(_0x6878('0x1a'));var db=require(_0x6878('0x1b'))['db'];function respondWithStatusCode(_0x44d56d,_0x545586){_0x545586=_0x545586||0xcc;return function(_0x2429dc){if(_0x2429dc){return _0x44d56d[_0x6878('0x1c')](_0x545586);}return _0x44d56d[_0x6878('0x1d')](_0x545586)[_0x6878('0x1e')]();};}function respondWithResult(_0xcc6864,_0x16f3a3){_0x16f3a3=_0x16f3a3||0xc8;return function(_0x4ad0f6){if(_0x4ad0f6){return _0xcc6864[_0x6878('0x1d')](_0x16f3a3)[_0x6878('0x1f')](_0x4ad0f6);}};}function respondWithFilteredResult(_0x24483f,_0x47f270){return function(_0x427035){if(_0x427035){var _0x4adabf=typeof _0x47f270['offset']===_0x6878('0x20')&&typeof _0x47f270[_0x6878('0x21')]===_0x6878('0x20');var _0xc7fa48=_0x427035[_0x6878('0x22')];var _0x13c551=_0x4adabf?0x0:_0x47f270[_0x6878('0x23')];var _0x1bbb84=_0x4adabf?_0x427035['count']:_0x47f270['offset']+_0x47f270[_0x6878('0x21')];var _0x4faa99;if(_0x1bbb84>=_0xc7fa48){_0x1bbb84=_0xc7fa48;_0x4faa99=0xc8;}else{_0x4faa99=0xce;}_0x24483f['status'](_0x4faa99);return _0x24483f['set']('Content-Range',_0x13c551+'-'+_0x1bbb84+'/'+_0xc7fa48)['json'](_0x427035);}return null;};}function patchUpdates(_0x483ea4){return function(_0xee56df){try{jsonpatch['apply'](_0xee56df,_0x483ea4,!![]);}catch(_0x438e94){return BPromise[_0x6878('0x24')](_0x438e94);}return _0xee56df[_0x6878('0x25')]();};}function saveUpdates(_0x28fee8,_0xed07b7){return function(_0x4527c2){if(_0x4527c2){return _0x4527c2[_0x6878('0x26')](_0x28fee8)[_0x6878('0x27')](function(_0x7eac9f){return _0x7eac9f;});}return null;};}function removeEntity(_0x4fbb89,_0x3a4c4e){return function(_0x385abb){if(_0x385abb){return _0x385abb[_0x6878('0x28')]()[_0x6878('0x27')](function(){var _0x32be4d=_0x385abb[_0x6878('0x29')]({'plain':!![]});var _0x5cdfd1=_0x6878('0x2a');return db[_0x6878('0x2b')]['destroy']({'where':{'type':_0x5cdfd1,'resourceId':_0x32be4d['id']}})[_0x6878('0x27')](function(){return _0x385abb;});})['then'](function(){_0x4fbb89[_0x6878('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x167f3d,_0x5d19d9){return function(_0xd26154){if(!_0xd26154){_0x167f3d[_0x6878('0x1c')](0x194);}return _0xd26154;};}function handleError(_0x552d13,_0x4456c0){_0x4456c0=_0x4456c0||0x1f4;return function(_0x35968e){logger['error'](_0x35968e[_0x6878('0x2c')]);if(_0x35968e['name']){delete _0x35968e[_0x6878('0x2d')];}_0x552d13['status'](_0x4456c0)['send'](_0x35968e);};}exports[_0x6878('0x2e')]=function(_0x5c81d2,_0x537023){var _0x33e738={},_0x2f6032={},_0xf56440={'count':0x0,'rows':[]};var _0x25fdbe=_[_0x6878('0x2f')](db[_0x6878('0x30')][_0x6878('0x31')],function(_0x184428){return{'name':_0x184428[_0x6878('0x32')],'type':_0x184428['type'][_0x6878('0x33')]};});_0x2f6032[_0x6878('0x34')]=_[_0x6878('0x2f')](_0x25fdbe,_0x6878('0x2d'));_0x2f6032[_0x6878('0x35')]=_[_0x6878('0x36')](_0x5c81d2[_0x6878('0x35')]);_0x2f6032[_0x6878('0x37')]=_[_0x6878('0x38')](_0x2f6032[_0x6878('0x34')],_0x2f6032['query']);_0x33e738[_0x6878('0x39')]=_['intersection'](_0x2f6032[_0x6878('0x34')],qs['fields'](_0x5c81d2[_0x6878('0x35')][_0x6878('0x3a')]));_0x33e738['attributes']=_0x33e738['attributes'][_0x6878('0x3b')]?_0x33e738['attributes']:_0x2f6032['model'];if(!_0x5c81d2[_0x6878('0x35')][_0x6878('0x3c')](_0x6878('0x3d'))){_0x33e738[_0x6878('0x21')]=qs[_0x6878('0x21')](_0x5c81d2[_0x6878('0x35')][_0x6878('0x21')]);_0x33e738[_0x6878('0x23')]=qs[_0x6878('0x23')](_0x5c81d2[_0x6878('0x35')]['offset']);}_0x33e738[_0x6878('0x3e')]=qs[_0x6878('0x3f')](_0x5c81d2[_0x6878('0x35')][_0x6878('0x3f')]);_0x33e738[_0x6878('0x40')]=qs[_0x6878('0x37')](_[_0x6878('0x41')](_0x5c81d2[_0x6878('0x35')],_0x2f6032[_0x6878('0x37')]),_0x25fdbe);if(_0x5c81d2['query'][_0x6878('0x42')]){_0x33e738[_0x6878('0x40')]=_[_0x6878('0x43')](_0x33e738[_0x6878('0x40')],{'$or':_[_0x6878('0x2f')](_0x25fdbe,function(_0x151eab){if(_0x151eab[_0x6878('0x44')]!==_0x6878('0x45')){var _0x57ea7f={};_0x57ea7f[_0x151eab[_0x6878('0x2d')]]={'$like':'%'+_0x5c81d2[_0x6878('0x35')][_0x6878('0x42')]+'%'};return _0x57ea7f;}})});}_0x33e738=_[_0x6878('0x43')]({},_0x33e738,_0x5c81d2['options']);var _0x52be0b={'where':_0x33e738[_0x6878('0x40')]};return db[_0x6878('0x30')][_0x6878('0x22')](_0x52be0b)[_0x6878('0x27')](function(_0x191d53){_0xf56440[_0x6878('0x22')]=_0x191d53;if(_0x5c81d2['query'][_0x6878('0x46')]){_0x33e738['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x33e738);})[_0x6878('0x27')](function(_0x368996){_0xf56440[_0x6878('0x47')]=_0x368996;return _0xf56440;})[_0x6878('0x27')](respondWithFilteredResult(_0x537023,_0x33e738))[_0x6878('0x48')](handleError(_0x537023,null));};exports[_0x6878('0x49')]=function(_0x2fffca,_0x121bc5){var _0x3a2b08={'raw':!![],'where':{'id':_0x2fffca[_0x6878('0x4a')]['id']}},_0x500f67={};_0x500f67[_0x6878('0x34')]=_[_0x6878('0x36')](db[_0x6878('0x30')][_0x6878('0x31')]);_0x500f67[_0x6878('0x35')]=_[_0x6878('0x36')](_0x2fffca[_0x6878('0x35')]);_0x500f67[_0x6878('0x37')]=_[_0x6878('0x38')](_0x500f67[_0x6878('0x34')],_0x500f67['query']);_0x3a2b08['attributes']=_[_0x6878('0x38')](_0x500f67[_0x6878('0x34')],qs[_0x6878('0x3a')](_0x2fffca[_0x6878('0x35')][_0x6878('0x3a')]));_0x3a2b08[_0x6878('0x39')]=_0x3a2b08[_0x6878('0x39')][_0x6878('0x3b')]?_0x3a2b08[_0x6878('0x39')]:_0x500f67[_0x6878('0x34')];if(_0x2fffca[_0x6878('0x35')][_0x6878('0x46')]){_0x3a2b08[_0x6878('0x4b')]=[{'all':!![]}];}_0x3a2b08=_[_0x6878('0x43')]({},_0x3a2b08,_0x2fffca[_0x6878('0x4c')]);return db['Disposition'][_0x6878('0x4d')](_0x3a2b08)[_0x6878('0x27')](handleEntityNotFound(_0x121bc5,null))['then'](respondWithResult(_0x121bc5,null))['catch'](handleError(_0x121bc5,null));};exports[_0x6878('0x4e')]=function(_0x298b42,_0x480d5){return db[_0x6878('0x30')][_0x6878('0x4e')](_0x298b42['body'],{})[_0x6878('0x27')](function(_0xefeec){var _0x4fb47f=_0x298b42[_0x6878('0x4f')][_0x6878('0x29')]({'plain':!![]});if(!_0x4fb47f)throw new Error(_0x6878('0x50'));if(_0x4fb47f[_0x6878('0x51')]===_0x6878('0x4f')){var _0x1ecff5=_0xefeec[_0x6878('0x29')]({'plain':!![]});var _0x3e35da=_0x6878('0x2a');return db[_0x6878('0x52')][_0x6878('0x4d')]({'where':{'name':_0x3e35da,'userProfileId':_0x4fb47f[_0x6878('0x53')]},'raw':!![]})['then'](function(_0xd87f44){if(_0xd87f44&&_0xd87f44[_0x6878('0x54')]===0x0){return db[_0x6878('0x2b')]['create']({'name':_0x1ecff5[_0x6878('0x2d')],'resourceId':_0x1ecff5['id'],'type':_0xd87f44['name'],'sectionId':_0xd87f44['id']},{})[_0x6878('0x27')](function(){return _0xefeec;});}else{return _0xefeec;}})[_0x6878('0x48')](function(_0x62f954){logger[_0x6878('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x62f954);throw _0x62f954;});}return _0xefeec;})[_0x6878('0x27')](respondWithResult(_0x480d5,0xc9))[_0x6878('0x48')](handleError(_0x480d5,null));};exports['update']=function(_0x254404,_0x6c406b){if(_0x254404[_0x6878('0x56')]['id']){delete _0x254404[_0x6878('0x56')]['id'];}return db[_0x6878('0x30')][_0x6878('0x4d')]({'where':{'id':_0x254404[_0x6878('0x4a')]['id']}})[_0x6878('0x27')](handleEntityNotFound(_0x6c406b,null))['then'](saveUpdates(_0x254404[_0x6878('0x56')],null))[_0x6878('0x27')](respondWithResult(_0x6c406b,null))[_0x6878('0x48')](handleError(_0x6c406b,null));};exports[_0x6878('0x28')]=function(_0x3b9020,_0x5d6d9a){return db[_0x6878('0x30')][_0x6878('0x4d')]({'where':{'id':_0x3b9020[_0x6878('0x4a')]['id']}})[_0x6878('0x27')](handleEntityNotFound(_0x5d6d9a,null))[_0x6878('0x27')](removeEntity(_0x5d6d9a,null))[_0x6878('0x48')](handleError(_0x5d6d9a,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 19bd2f1..32e8197 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 _0x49d6=['Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./disposition.attributes','exports'];(function(_0x37d86b,_0x4a4334){var _0x14847d=function(_0x591420){while(--_0x591420){_0x37d86b['push'](_0x37d86b['shift']());}};_0x14847d(++_0x4a4334);}(_0x49d6,0x1bf));var _0x649d=function(_0x7d48b6,_0x413434){_0x7d48b6=_0x7d48b6-0x0;var _0x16d10d=_0x49d6[_0x7d48b6];return _0x16d10d;};'use strict';var _=require(_0x649d('0x0'));var util=require('util');var logger=require(_0x649d('0x1'))(_0x649d('0x2'));var moment=require(_0x649d('0x3'));var BPromise=require(_0x649d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x649d('0x5'));var config=require(_0x649d('0x6'));var attributes=require(_0x649d('0x7'));module[_0x649d('0x8')]=function(_0x4ebac4,_0x54562c){return _0x4ebac4['define'](_0x649d('0x9'),attributes,{'tableName':_0x649d('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x649d('0xb'),'fields':[_0x649d('0xc'),_0x649d('0xd')]},{'unique':!![],'name':_0x649d('0xe'),'fields':[_0x649d('0xc'),_0x649d('0xf')]},{'unique':!![],'name':_0x649d('0x10'),'fields':[_0x649d('0xc'),_0x649d('0x11')]},{'unique':!![],'name':_0x649d('0x12'),'fields':[_0x649d('0xc'),_0x649d('0x13')]},{'unique':!![],'name':_0x649d('0x14'),'fields':[_0x649d('0xc'),_0x649d('0x15')]},{'unique':!![],'name':'name_openchannel','fields':['name',_0x649d('0x16')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x649d('0xc'),_0x649d('0x17')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe41=['FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax'];(function(_0x19a342,_0x707413){var _0x1438ad=function(_0x5e6225){while(--_0x5e6225){_0x19a342['push'](_0x19a342['shift']());}};_0x1438ad(++_0x707413);}(_0xbe41,0x1b9));var _0x1be4=function(_0x49fe3d,_0x1f7fa1){_0x49fe3d=_0x49fe3d-0x0;var _0x2100f6=_0xbe41[_0x49fe3d];return _0x2100f6;};'use strict';var _=require(_0x1be4('0x0'));var util=require(_0x1be4('0x1'));var logger=require(_0x1be4('0x2'))(_0x1be4('0x3'));var moment=require(_0x1be4('0x4'));var BPromise=require(_0x1be4('0x5'));var rp=require(_0x1be4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1be4('0x7'));var config=require(_0x1be4('0x8'));var attributes=require(_0x1be4('0x9'));module['exports']=function(_0x2f6063,_0x47489e){return _0x2f6063[_0x1be4('0xa')](_0x1be4('0xb'),attributes,{'tableName':_0x1be4('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name','ListId']},{'unique':!![],'name':'name_chat','fields':[_0x1be4('0xd'),_0x1be4('0xe')]},{'unique':!![],'name':_0x1be4('0xf'),'fields':[_0x1be4('0xd'),'MailAccountId']},{'unique':!![],'name':_0x1be4('0x10'),'fields':[_0x1be4('0xd'),_0x1be4('0x11')]},{'unique':!![],'name':_0x1be4('0x12'),'fields':[_0x1be4('0xd'),_0x1be4('0x13')]},{'unique':!![],'name':_0x1be4('0x14'),'fields':[_0x1be4('0xd'),_0x1be4('0x15')]},{'unique':!![],'name':_0x1be4('0x16'),'fields':[_0x1be4('0xd'),'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 612b43e..d88d135 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(_0xcec0d1,_0x3abb38){var _0x67eed2=function(_0x58853d){while(--_0x58853d){_0xcec0d1['push'](_0xcec0d1['shift']());}};_0x67eed2(++_0x3abb38);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x5aed49,_0x5b71f8){var _0x3efc4b=function(_0x234aa3){while(--_0x234aa3){_0x5aed49['push'](_0x5aed49['shift']());}};_0x3efc4b(++_0x5b71f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 bdc25d9..e987ed1 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 _0x120d=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x70404,_0x507113){var _0x2da0b9=function(_0x3fa2a9){while(--_0x3fa2a9){_0x70404['push'](_0x70404['shift']());}};_0x2da0b9(++_0x507113);}(_0x120d,0x140));var _0xd120=function(_0x4e7c2,_0x3b3347){_0x4e7c2=_0x4e7c2-0x0;var _0x84bb35=_0x120d[_0x4e7c2];return _0x84bb35;};'use strict';var multer=require(_0xd120('0x0'));var util=require(_0xd120('0x1'));var path=require(_0xd120('0x2'));var timeout=require(_0xd120('0x3'));var express=require('express');var router=express[_0xd120('0x4')]();var fs_extra=require(_0xd120('0x5'));var auth=require(_0xd120('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd120('0x7'));var controller=require(_0xd120('0x8'));router[_0xd120('0x9')]('/',auth[_0xd120('0xa')](),controller['index']);router['get'](_0xd120('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd120('0xc')]('/',auth[_0xd120('0xa')](),controller[_0xd120('0xd')]);router[_0xd120('0xe')]('/:id',auth[_0xd120('0xa')](),controller[_0xd120('0xf')]);router[_0xd120('0x10')](_0xd120('0xb'),auth['isAuthenticated'](),controller[_0xd120('0x11')]);module[_0xd120('0x12')]=router; \ No newline at end of file +var _0xa9ed=['delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','put','update'];(function(_0x35837f,_0x15a5e1){var _0x21d3ce=function(_0x2e30a1){while(--_0x2e30a1){_0x35837f['push'](_0x35837f['shift']());}};_0x21d3ce(++_0x15a5e1);}(_0xa9ed,0xb3));var _0xda9e=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0xa9ed[_0x5d860f];return _0x236490;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xda9e('0x0'));var timeout=require(_0xda9e('0x1'));var express=require(_0xda9e('0x2'));var router=express[_0xda9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xda9e('0x4'));var interaction=require(_0xda9e('0x5'));var config=require(_0xda9e('0x6'));var controller=require('./disposition.controller');router[_0xda9e('0x7')]('/',auth[_0xda9e('0x8')](),controller[_0xda9e('0x9')]);router[_0xda9e('0x7')](_0xda9e('0xa'),auth[_0xda9e('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xda9e('0xb')](_0xda9e('0xa'),auth[_0xda9e('0x8')](),controller[_0xda9e('0xc')]);router[_0xda9e('0xd')](_0xda9e('0xa'),auth[_0xda9e('0x8')](),controller[_0xda9e('0xe')]);module[_0xda9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index e70de7f..6b952ff 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 _0x6313=['7200','12000','14400','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6313,0x6a));var _0x3631=function(_0x39ca94,_0x378f98){_0x39ca94=_0x39ca94-0x0;var _0x484538=_0x6313[_0x39ca94];return _0x484538;};'use strict';var Sequelize=require(_0x3631('0x0'));module[_0x3631('0x1')]={'name':{'type':Sequelize[_0x3631('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3631('0x2')]},'ecm':{'type':Sequelize[_0x3631('0x3')](_0x3631('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x3631('0x2')],'defaultValue':_0x3631('0x5')},'localstationid':{'type':Sequelize[_0x3631('0x2')],'unique':_0x3631('0x6')},'minrate':{'type':Sequelize[_0x3631('0x3')](_0x3631('0x7'),_0x3631('0x8'),_0x3631('0x9'),'9600',_0x3631('0xa'),_0x3631('0xb')),'defaultValue':_0x3631('0x8')},'maxrate':{'type':Sequelize[_0x3631('0x3')](_0x3631('0x7'),'4800','7200','9600',_0x3631('0xa'),_0x3631('0xb')),'defaultValue':_0x3631('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x3631('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x3631('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x3631('0x3')](_0x3631('0xd'),_0x3631('0xe'),_0x3631('0xf'),_0x3631('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x3631('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3631('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3631('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3631('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3631('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3631('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x3631('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x3631('0x12')],'defaultValue':![],'comment':_0x3631('0x14'),'set':function(_0x389677){if(!_0x389677)this['setDataValue'](_0x3631('0x15'),null);this[_0x3631('0x16')]('mandatoryDisposition',_0x389677);}}}; \ No newline at end of file +var _0xe712=['STRING','ENUM','yes','localstationid','2400','4800','9600','12000','14400','7200','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe712,0x1cc));var _0x2e71=function(_0x1881fe,_0x38b56e){_0x1881fe=_0x1881fe-0x0;var _0x5ad2ef=_0xe712[_0x1881fe];return _0x5ad2ef;};'use strict';var Sequelize=require(_0x2e71('0x0'));module[_0x2e71('0x1')]={'name':{'type':Sequelize[_0x2e71('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2e71('0x2')]},'ecm':{'type':Sequelize[_0x2e71('0x3')](_0x2e71('0x4'),'no'),'defaultValue':_0x2e71('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x2e71('0x2')],'unique':_0x2e71('0x5')},'minrate':{'type':Sequelize[_0x2e71('0x3')](_0x2e71('0x6'),_0x2e71('0x7'),'7200',_0x2e71('0x8'),_0x2e71('0x9'),_0x2e71('0xa')),'defaultValue':_0x2e71('0x7')},'maxrate':{'type':Sequelize[_0x2e71('0x3')](_0x2e71('0x6'),_0x2e71('0x7'),_0x2e71('0xb'),'9600',_0x2e71('0x9'),_0x2e71('0xa')),'defaultValue':_0x2e71('0xa')},'modem':{'type':Sequelize[_0x2e71('0x2')],'defaultValue':_0x2e71('0xc')},'gateway':{'type':Sequelize[_0x2e71('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x2e71('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x2e71('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x2e71('0x3')](_0x2e71('0xe'),_0x2e71('0xf'),'DADHI',_0x2e71('0x10')),'defaultValue':_0x2e71('0xe')},'key':{'type':Sequelize[_0x2e71('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2e71('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x2e71('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2e71('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2e71('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2e71('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2e71('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2e71('0x12')],'defaultValue':![],'comment':_0x2e71('0x13'),'set':function(_0xad9f4b){if(!_0xad9f4b)this[_0x2e71('0x14')](_0x2e71('0x15'),null);this['setDataValue']('mandatoryDisposition',_0xad9f4b);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 159eab0..56bf452 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 _0x2efb=['addApplications','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','FaxApplication','priority','finally','getApplications','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','appdata','Answer','push','Set','ecm','gateway','faxdetect','headerinfo','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','ReceiveFax','updateAccountApplications','VoiceExtension','tech','key','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','out','filename','user','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','User','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','merge','options','includeAll','include','findAll','rows','catch','show','intersection','find','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','pick','FaxAccountId','filter','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','internal','color','tag'];(function(_0x92b1f5,_0xdf7a26){var _0x3c1d17=function(_0x1d0b68){while(--_0x1d0b68){_0x92b1f5['push'](_0x92b1f5['shift']());}};_0x3c1d17(++_0xdf7a26);}(_0x2efb,0x1d7));var _0xb2ef=function(_0x5a19dd,_0x30c16d){_0x5a19dd=_0x5a19dd-0x0;var _0x361faa=_0x2efb[_0x5a19dd];return _0x361faa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb2ef('0x0'));var zipdir=require(_0xb2ef('0x1'));var jsonpatch=require(_0xb2ef('0x2'));var rp=require(_0xb2ef('0x3'));var moment=require(_0xb2ef('0x4'));var BPromise=require(_0xb2ef('0x5'));var Mustache=require(_0xb2ef('0x6'));var util=require(_0xb2ef('0x7'));var path=require(_0xb2ef('0x8'));var sox=require('sox');var csv=require(_0xb2ef('0x9'));var ejs=require(_0xb2ef('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb2ef('0xb'));var squel=require('squel');var crypto=require(_0xb2ef('0xc'));var jsforce=require(_0xb2ef('0xd'));var deskjs=require(_0xb2ef('0xe'));var toCsv=require(_0xb2ef('0x9'));var querystring=require(_0xb2ef('0xf'));var Papa=require(_0xb2ef('0x10'));var Redis=require(_0xb2ef('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb2ef('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2ef('0x13'))(_0xb2ef('0x14'));var utils=require(_0xb2ef('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb2ef('0x16'))['db'];config[_0xb2ef('0x17')]=_[_0xb2ef('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb2ef('0x19'))(new Redis(config[_0xb2ef('0x17')]));require(_0xb2ef('0x1a'))[_0xb2ef('0x1b')](socket);var jayson=require(_0xb2ef('0x1c'));var client=jayson[_0xb2ef('0x1d')][_0xb2ef('0x1e')]({'port':0x232c});var client9002=jayson[_0xb2ef('0x1d')][_0xb2ef('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xe76276,_0x109667,_0x4df417,_0x427554){return new BPromise(function(_0x4be554,_0x87c6fa){var _0x21d15f=_0x427554||client;return _0x21d15f[_0xb2ef('0x1f')](_0xe76276,_0x4df417)[_0xb2ef('0x20')](function(_0x5cc57c){logger['info']('FaxAccount,\x20%s,\x20%s',_0x109667,_0xb2ef('0x21'));logger[_0xb2ef('0x22')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x109667,_0xb2ef('0x21'),JSON[_0xb2ef('0x23')](_0x5cc57c));if(_0x5cc57c[_0xb2ef('0x24')]){if(_0x5cc57c[_0xb2ef('0x24')][_0xb2ef('0x25')]===0x1f4){logger[_0xb2ef('0x24')](_0xb2ef('0x26'),_0x109667,_0x5cc57c[_0xb2ef('0x24')]['message']);return _0x87c6fa(_0x5cc57c[_0xb2ef('0x24')][_0xb2ef('0x27')]);}logger[_0xb2ef('0x24')](_0xb2ef('0x26'),_0x109667,_0x5cc57c[_0xb2ef('0x24')][_0xb2ef('0x27')]);return _0x4be554(_0x5cc57c[_0xb2ef('0x24')]['message']);}else{logger['info'](_0xb2ef('0x26'),_0x109667,_0xb2ef('0x21'));_0x4be554(_0x5cc57c['result'][_0xb2ef('0x27')]);}})['catch'](function(_0x1ac5e2){logger['error'](_0xb2ef('0x26'),_0x109667,_0x1ac5e2);_0x87c6fa(_0x1ac5e2);});});}function respondWithStatusCode(_0x50802c,_0x1195e5){_0x1195e5=_0x1195e5||0xcc;return function(_0x291299){if(_0x291299){return _0x50802c[_0xb2ef('0x28')](_0x1195e5);}return _0x50802c[_0xb2ef('0x29')](_0x1195e5)[_0xb2ef('0x2a')]();};}function respondWithResult(_0xf7a3e3,_0x204f58){_0x204f58=_0x204f58||0xc8;return function(_0x34af12){if(_0x34af12){return _0xf7a3e3[_0xb2ef('0x29')](_0x204f58)[_0xb2ef('0x2b')](_0x34af12);}};}function respondWithFilteredResult(_0x3b3507,_0x15c724){return function(_0x5b3c3b){if(_0x5b3c3b){var _0x2a7899=typeof _0x15c724[_0xb2ef('0x2c')]===_0xb2ef('0x2d')&&typeof _0x15c724[_0xb2ef('0x2e')]===_0xb2ef('0x2d');var _0x38510a=_0x5b3c3b[_0xb2ef('0x2f')];var _0x5d0f74=_0x2a7899?0x0:_0x15c724[_0xb2ef('0x2c')];var _0xe2c012=_0x2a7899?_0x5b3c3b['count']:_0x15c724[_0xb2ef('0x2c')]+_0x15c724[_0xb2ef('0x2e')];var _0x104017;if(_0xe2c012>=_0x38510a){_0xe2c012=_0x38510a;_0x104017=0xc8;}else{_0x104017=0xce;}_0x3b3507['status'](_0x104017);return _0x3b3507['set']('Content-Range',_0x5d0f74+'-'+_0xe2c012+'/'+_0x38510a)[_0xb2ef('0x2b')](_0x5b3c3b);}return null;};}function patchUpdates(_0x16dbd8){return function(_0x3dd084){try{jsonpatch['apply'](_0x3dd084,_0x16dbd8,!![]);}catch(_0x2173ba){return BPromise[_0xb2ef('0x30')](_0x2173ba);}return _0x3dd084[_0xb2ef('0x31')]();};}function saveUpdates(_0x33fa98,_0x44b9c5){return function(_0x1453e3){if(_0x1453e3){return _0x1453e3[_0xb2ef('0x32')](_0x33fa98)[_0xb2ef('0x20')](function(_0x2b5e28){return _0x2b5e28;});}return null;};}function removeEntity(_0xd47c67,_0x2efe79){return function(_0x18fef7){if(_0x18fef7){return _0x18fef7[_0xb2ef('0x33')]()['then'](function(){var _0xfc2655=_0x18fef7[_0xb2ef('0x34')]({'plain':!![]});var _0x404c6b=_0xb2ef('0x35');return db[_0xb2ef('0x36')][_0xb2ef('0x33')]({'where':{'type':_0x404c6b,'resourceId':_0xfc2655['id']}})['then'](function(){return _0x18fef7;});})[_0xb2ef('0x20')](function(){_0xd47c67[_0xb2ef('0x29')](0xcc)[_0xb2ef('0x2a')]();});}};}function handleEntityNotFound(_0x280b08,_0x16e500){return function(_0x53ae3d){if(!_0x53ae3d){_0x280b08[_0xb2ef('0x28')](0x194);}return _0x53ae3d;};}function handleError(_0x29e619,_0x372ce2){_0x372ce2=_0x372ce2||0x1f4;return function(_0x47a996){logger[_0xb2ef('0x24')](_0x47a996[_0xb2ef('0x37')]);if(_0x47a996[_0xb2ef('0x38')]){delete _0x47a996[_0xb2ef('0x38')];}_0x29e619[_0xb2ef('0x29')](_0x372ce2)[_0xb2ef('0x39')](_0x47a996);};}exports[_0xb2ef('0x3a')]=function(_0x552db0,_0x7ca38a){var _0x1fdd34={'include':[{'model':db[_0xb2ef('0x3b')],'as':_0xb2ef('0x3c')}]},_0x5ab8fa={},_0x5762d7={'count':0x0,'rows':[]};var _0x423293=_[_0xb2ef('0x3d')](db[_0xb2ef('0x3e')][_0xb2ef('0x3f')],function(_0x37ff32){return{'name':_0x37ff32['fieldName'],'type':_0x37ff32[_0xb2ef('0x40')]['key']};});_0x5ab8fa[_0xb2ef('0x41')]=_[_0xb2ef('0x3d')](_0x423293,_0xb2ef('0x38'));_0x5ab8fa[_0xb2ef('0x42')]=_[_0xb2ef('0x43')](_0x552db0[_0xb2ef('0x42')]);_0x5ab8fa[_0xb2ef('0x44')]=_['intersection'](_0x5ab8fa[_0xb2ef('0x41')],_0x5ab8fa[_0xb2ef('0x42')]);_0x1fdd34[_0xb2ef('0x45')]=_['intersection'](_0x5ab8fa['model'],qs['fields'](_0x552db0[_0xb2ef('0x42')][_0xb2ef('0x46')]));_0x1fdd34[_0xb2ef('0x45')]=_0x1fdd34[_0xb2ef('0x45')][_0xb2ef('0x47')]?_0x1fdd34['attributes']:_0x5ab8fa[_0xb2ef('0x41')];if(!_0x552db0[_0xb2ef('0x42')][_0xb2ef('0x48')]('nolimit')){_0x1fdd34[_0xb2ef('0x2e')]=qs['limit'](_0x552db0[_0xb2ef('0x42')][_0xb2ef('0x2e')]);_0x1fdd34[_0xb2ef('0x2c')]=qs[_0xb2ef('0x2c')](_0x552db0['query'][_0xb2ef('0x2c')]);}_0x1fdd34[_0xb2ef('0x49')]=qs['sort'](_0x552db0['query'][_0xb2ef('0x4a')]);_0x1fdd34['where']=qs[_0xb2ef('0x44')](_['pick'](_0x552db0[_0xb2ef('0x42')],_0x5ab8fa['filters']),_0x423293);if(_0x552db0[_0xb2ef('0x42')]['filter']){_0x1fdd34[_0xb2ef('0x4b')]=_[_0xb2ef('0x4c')](_0x1fdd34[_0xb2ef('0x4b')],{'$or':_[_0xb2ef('0x3d')](_0x423293,function(_0x1bc06d){if(_0x1bc06d[_0xb2ef('0x40')]!=='VIRTUAL'){var _0x8ccd01={};_0x8ccd01[_0x1bc06d['name']]={'$like':'%'+_0x552db0[_0xb2ef('0x42')]['filter']+'%'};return _0x8ccd01;}})});}_0x1fdd34=_[_0xb2ef('0x4c')]({},_0x1fdd34,_0x552db0[_0xb2ef('0x4d')]);var _0x396839={'where':_0x1fdd34[_0xb2ef('0x4b')]};return db[_0xb2ef('0x3e')]['count'](_0x396839)[_0xb2ef('0x20')](function(_0x583f35){_0x5762d7['count']=_0x583f35;if(_0x552db0[_0xb2ef('0x42')][_0xb2ef('0x4e')]){_0x1fdd34[_0xb2ef('0x4f')]=[{'all':!![]}];}return db['FaxAccount'][_0xb2ef('0x50')](_0x1fdd34);})[_0xb2ef('0x20')](function(_0xded0b5){_0x5762d7[_0xb2ef('0x51')]=_0xded0b5;return _0x5762d7;})['then'](respondWithFilteredResult(_0x7ca38a,_0x1fdd34))[_0xb2ef('0x52')](handleError(_0x7ca38a,null));};exports[_0xb2ef('0x53')]=function(_0x232646,_0xcce55e){var _0x14665f={'raw':![],'where':{'id':_0x232646['params']['id']},'include':[{'model':db['Pause'],'as':_0xb2ef('0x3c')}]},_0x51cafd={};_0x51cafd[_0xb2ef('0x41')]=_[_0xb2ef('0x43')](db[_0xb2ef('0x3e')][_0xb2ef('0x3f')]);_0x51cafd[_0xb2ef('0x42')]=_[_0xb2ef('0x43')](_0x232646[_0xb2ef('0x42')]);_0x51cafd[_0xb2ef('0x44')]=_[_0xb2ef('0x54')](_0x51cafd[_0xb2ef('0x41')],_0x51cafd[_0xb2ef('0x42')]);_0x14665f[_0xb2ef('0x45')]=_[_0xb2ef('0x54')](_0x51cafd[_0xb2ef('0x41')],qs[_0xb2ef('0x46')](_0x232646['query']['fields']));_0x14665f[_0xb2ef('0x45')]=_0x14665f[_0xb2ef('0x45')]['length']?_0x14665f[_0xb2ef('0x45')]:_0x51cafd[_0xb2ef('0x41')];if(_0x232646[_0xb2ef('0x42')][_0xb2ef('0x4e')]){_0x14665f['include']=[{'all':!![]}];}_0x14665f=_[_0xb2ef('0x4c')]({},_0x14665f,_0x232646[_0xb2ef('0x4d')]);return db[_0xb2ef('0x3e')][_0xb2ef('0x55')](_0x14665f)['then'](handleEntityNotFound(_0xcce55e,null))[_0xb2ef('0x20')](respondWithResult(_0xcce55e,null))['catch'](handleError(_0xcce55e,null));};exports['create']=function(_0x164b30,_0xd1578){return db[_0xb2ef('0x3e')]['create'](_0x164b30['body'],{})['then'](function(_0x221e11){var _0x192741=_0x164b30['user'][_0xb2ef('0x34')]({'plain':!![]});if(!_0x192741)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x192741['role']==='user'){var _0x390719=_0x221e11[_0xb2ef('0x34')]({'plain':!![]});var _0x272eb0=_0xb2ef('0x35');return db['UserProfileSection'][_0xb2ef('0x55')]({'where':{'name':_0x272eb0,'userProfileId':_0x192741[_0xb2ef('0x56')]},'raw':!![]})[_0xb2ef('0x20')](function(_0x99ff50){if(_0x99ff50&&_0x99ff50['autoAssociation']===0x0){return db[_0xb2ef('0x36')][_0xb2ef('0x57')]({'name':_0x390719['name'],'resourceId':_0x390719['id'],'type':_0x99ff50[_0xb2ef('0x38')],'sectionId':_0x99ff50['id']},{})['then'](function(){return _0x221e11;});}else{return _0x221e11;}})['catch'](function(_0x17e5e6){logger['error'](_0xb2ef('0x58'),_0x17e5e6);throw _0x17e5e6;});}return _0x221e11;})[_0xb2ef('0x20')](respondWithResult(_0xd1578,0xc9))[_0xb2ef('0x52')](handleError(_0xd1578,null));};exports[_0xb2ef('0x32')]=function(_0x492531,_0xe7a783){if(_0x492531[_0xb2ef('0x59')]['id']){delete _0x492531['body']['id'];}return db[_0xb2ef('0x3e')]['find']({'where':{'id':_0x492531[_0xb2ef('0x5a')]['id']},'include':[{'model':db[_0xb2ef('0x3b')],'as':_0xb2ef('0x3c')}]})['then'](handleEntityNotFound(_0xe7a783,null))[_0xb2ef('0x20')](saveUpdates(_0x492531['body'],null))[_0xb2ef('0x20')](respondWithResult(_0xe7a783,null))['catch'](handleError(_0xe7a783,null));};exports[_0xb2ef('0x33')]=function(_0x29dc86,_0x179dfb){return db['FaxAccount']['find']({'where':{'id':_0x29dc86[_0xb2ef('0x5a')]['id']}})[_0xb2ef('0x20')](handleEntityNotFound(_0x179dfb,null))['then'](removeEntity(_0x179dfb,null))['catch'](handleError(_0x179dfb,null));};exports[_0xb2ef('0x5b')]=function(_0x53435a,_0x1b2aa5){return db[_0xb2ef('0x3e')][_0xb2ef('0x5b')]()['then'](respondWithResult(_0x1b2aa5,null))['catch'](handleError(_0x1b2aa5,null));};exports[_0xb2ef('0x5c')]=function(_0x34e1f3,_0x1efee8,_0xe6337b){if(_0x34e1f3[_0xb2ef('0x59')]['id']){delete _0x34e1f3[_0xb2ef('0x59')]['id'];}return db[_0xb2ef('0x3e')]['find']({'where':{'id':_0x34e1f3[_0xb2ef('0x5a')]['id']}})[_0xb2ef('0x20')](handleEntityNotFound(_0x1efee8,null))['then'](function(_0x56dd46){if(_0x56dd46){_0x34e1f3[_0xb2ef('0x59')]['FaxAccountId']=_0x56dd46['id'];return db[_0xb2ef('0x5d')]['create'](_0x34e1f3[_0xb2ef('0x59')]);}})[_0xb2ef('0x20')](respondWithResult(_0x1efee8,null))[_0xb2ef('0x52')](handleError(_0x1efee8,null));};exports[_0xb2ef('0x5e')]=function(_0x42068a,_0x27fe95,_0x1a4824){var _0x278dce={'raw':![],'where':{}};var _0x257881={};var _0x336c4b={'count':0x0,'rows':[]};return db[_0xb2ef('0x3e')][_0xb2ef('0x5f')]({'where':{'id':_0x42068a[_0xb2ef('0x5a')]['id']}})[_0xb2ef('0x20')](handleEntityNotFound(_0x27fe95,null))[_0xb2ef('0x20')](function(_0x412ec3){if(_0x412ec3){_0x257881[_0xb2ef('0x41')]=_[_0xb2ef('0x43')](db[_0xb2ef('0x5d')]['rawAttributes']);_0x257881[_0xb2ef('0x42')]=_[_0xb2ef('0x43')](_0x42068a[_0xb2ef('0x42')]);_0x257881[_0xb2ef('0x44')]=_[_0xb2ef('0x54')](_0x257881['model'],_0x257881[_0xb2ef('0x42')]);_0x278dce[_0xb2ef('0x45')]=_['intersection'](_0x257881['model'],qs['fields'](_0x42068a[_0xb2ef('0x42')][_0xb2ef('0x46')]));_0x278dce['attributes']=_0x278dce['attributes'][_0xb2ef('0x47')]?_0x278dce[_0xb2ef('0x45')]:_0x257881[_0xb2ef('0x41')];if(!_0x42068a[_0xb2ef('0x42')][_0xb2ef('0x48')](_0xb2ef('0x60'))){_0x278dce[_0xb2ef('0x2e')]=qs[_0xb2ef('0x2e')](_0x42068a[_0xb2ef('0x42')][_0xb2ef('0x2e')]);_0x278dce[_0xb2ef('0x2c')]=qs[_0xb2ef('0x2c')](_0x42068a[_0xb2ef('0x42')][_0xb2ef('0x2c')]);}_0x278dce[_0xb2ef('0x49')]=qs[_0xb2ef('0x4a')](_0x42068a[_0xb2ef('0x42')][_0xb2ef('0x4a')]);_0x278dce[_0xb2ef('0x4b')]=qs['filters'](_[_0xb2ef('0x61')](_0x42068a[_0xb2ef('0x42')],_0x257881['filters']));_0x278dce['where'][_0xb2ef('0x62')]=_0x412ec3['id'];if(_0x42068a[_0xb2ef('0x42')][_0xb2ef('0x63')]){_0x278dce['where']=_['merge'](_0x278dce[_0xb2ef('0x4b')],{'$or':_['map'](_0x278dce[_0xb2ef('0x45')],function(_0x2ae0c3){var _0x1e2ea4={};_0x1e2ea4[_0x2ae0c3]={'$like':'%'+_0x42068a[_0xb2ef('0x42')][_0xb2ef('0x63')]+'%'};return _0x1e2ea4;})});}_0x278dce=_[_0xb2ef('0x4c')]({},_0x278dce,_0x42068a[_0xb2ef('0x4d')]);return db[_0xb2ef('0x5d')][_0xb2ef('0x2f')]({'where':_0x278dce[_0xb2ef('0x4b')]})[_0xb2ef('0x20')](function(_0x9017f9){_0x336c4b['count']=_0x9017f9;if(_0x42068a[_0xb2ef('0x42')][_0xb2ef('0x4e')]){_0x278dce[_0xb2ef('0x4f')]=[{'all':!![]}];}return db[_0xb2ef('0x5d')][_0xb2ef('0x50')](_0x278dce);})['then'](function(_0x1065e5){_0x336c4b[_0xb2ef('0x51')]=_0x1065e5;return _0x336c4b;});}})[_0xb2ef('0x20')](respondWithFilteredResult(_0x27fe95,_0x278dce))[_0xb2ef('0x52')](handleError(_0x27fe95,null));};exports[_0xb2ef('0x64')]=function(_0x3df6fe,_0x164599,_0x5a51c3){return db[_0xb2ef('0x3e')][_0xb2ef('0x55')]({'where':{'id':_0x3df6fe[_0xb2ef('0x5a')]['id']}})[_0xb2ef('0x20')](handleEntityNotFound(_0x164599,null))[_0xb2ef('0x20')](function(_0x43e1ba){if(_0x43e1ba){return _0x43e1ba[_0xb2ef('0x64')](_0x3df6fe[_0xb2ef('0x42')][_0xb2ef('0x65')]);}})[_0xb2ef('0x20')](respondWithStatusCode(_0x164599,null))[_0xb2ef('0x52')](handleError(_0x164599,null));};exports[_0xb2ef('0x66')]=function(_0x201323,_0x1bb199,_0x240779){if(_0x201323['body']['id']){delete _0x201323[_0xb2ef('0x59')]['id'];}return db['FaxAccount'][_0xb2ef('0x55')]({'where':{'id':_0x201323[_0xb2ef('0x5a')]['id']}})[_0xb2ef('0x20')](handleEntityNotFound(_0x1bb199,null))['then'](function(_0x4b79ab){if(_0x4b79ab){_0x201323[_0xb2ef('0x59')]['FaxAccountId']=_0x4b79ab['id'];return db[_0xb2ef('0x67')][_0xb2ef('0x57')](_0x201323[_0xb2ef('0x59')]);}})[_0xb2ef('0x20')](respondWithResult(_0x1bb199,null))[_0xb2ef('0x52')](handleError(_0x1bb199,null));};exports[_0xb2ef('0x68')]=function(_0x443bd8,_0x4e8c06,_0x4930f8){var _0x2652b1={'raw':![],'where':{}};var _0xd0070={};var _0x4ca9ba={'count':0x0,'rows':[]};return db[_0xb2ef('0x3e')][_0xb2ef('0x5f')]({'where':{'id':_0x443bd8[_0xb2ef('0x5a')]['id']}})[_0xb2ef('0x20')](handleEntityNotFound(_0x4e8c06,null))[_0xb2ef('0x20')](function(_0x2a276b){if(_0x2a276b){_0xd0070['model']=_['keys'](db[_0xb2ef('0x67')][_0xb2ef('0x3f')]);_0xd0070[_0xb2ef('0x42')]=_['keys'](_0x443bd8[_0xb2ef('0x42')]);_0xd0070['filters']=_[_0xb2ef('0x54')](_0xd0070['model'],_0xd0070[_0xb2ef('0x42')]);_0x2652b1[_0xb2ef('0x45')]=_[_0xb2ef('0x54')](_0xd0070[_0xb2ef('0x41')],qs[_0xb2ef('0x46')](_0x443bd8[_0xb2ef('0x42')][_0xb2ef('0x46')]));_0x2652b1[_0xb2ef('0x45')]=_0x2652b1[_0xb2ef('0x45')][_0xb2ef('0x47')]?_0x2652b1[_0xb2ef('0x45')]:_0xd0070[_0xb2ef('0x41')];if(!_0x443bd8[_0xb2ef('0x42')][_0xb2ef('0x48')]('nolimit')){_0x2652b1['limit']=qs[_0xb2ef('0x2e')](_0x443bd8[_0xb2ef('0x42')][_0xb2ef('0x2e')]);_0x2652b1[_0xb2ef('0x2c')]=qs[_0xb2ef('0x2c')](_0x443bd8[_0xb2ef('0x42')]['offset']);}_0x2652b1[_0xb2ef('0x49')]=qs[_0xb2ef('0x4a')](_0x443bd8[_0xb2ef('0x42')][_0xb2ef('0x4a')]);_0x2652b1['where']=qs['filters'](_[_0xb2ef('0x61')](_0x443bd8[_0xb2ef('0x42')],_0xd0070[_0xb2ef('0x44')]));_0x2652b1[_0xb2ef('0x4b')]['FaxAccountId']=_0x2a276b['id'];if(_0x443bd8['query']['filter']){_0x2652b1[_0xb2ef('0x4b')]=_['merge'](_0x2652b1[_0xb2ef('0x4b')],{'$or':_[_0xb2ef('0x3d')](_0x2652b1[_0xb2ef('0x45')],function(_0x4f7f50){var _0xcec33d={};_0xcec33d[_0x4f7f50]={'$like':'%'+_0x443bd8[_0xb2ef('0x42')][_0xb2ef('0x63')]+'%'};return _0xcec33d;})});}_0x2652b1=_[_0xb2ef('0x4c')]({},_0x2652b1,_0x443bd8['options']);return db[_0xb2ef('0x67')][_0xb2ef('0x2f')]({'where':_0x2652b1[_0xb2ef('0x4b')]})[_0xb2ef('0x20')](function(_0x29df46){_0x4ca9ba['count']=_0x29df46;if(_0x443bd8['query']['includeAll']){_0x2652b1[_0xb2ef('0x4f')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2652b1);})[_0xb2ef('0x20')](function(_0x49cd22){_0x4ca9ba[_0xb2ef('0x51')]=_0x49cd22;return _0x4ca9ba;});}})['then'](respondWithFilteredResult(_0x4e8c06,_0x2652b1))[_0xb2ef('0x52')](handleError(_0x4e8c06,null));};exports[_0xb2ef('0x69')]=function(_0x1dacce,_0x5cb6ec,_0x12847b){return db['FaxAccount'][_0xb2ef('0x55')]({'where':{'id':_0x1dacce[_0xb2ef('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5cb6ec,null))[_0xb2ef('0x20')](function(_0x4adf23){if(_0x4adf23){return _0x4adf23[_0xb2ef('0x69')](_0x1dacce[_0xb2ef('0x42')][_0xb2ef('0x65')]);}})[_0xb2ef('0x20')](respondWithStatusCode(_0x5cb6ec,null))[_0xb2ef('0x52')](handleError(_0x5cb6ec,null));};exports[_0xb2ef('0x6a')]=function(_0x53aa17,_0x320345,_0x210096){return db[_0xb2ef('0x6b')][_0xb2ef('0x55')]({'where':{'id':_0x53aa17[_0xb2ef('0x5a')]['id']}})[_0xb2ef('0x20')](handleEntityNotFound(_0x320345,null))[_0xb2ef('0x20')](function(_0x3e1c72){if(_0x3e1c72){return _0x3e1c72[_0xb2ef('0x6a')](_0x53aa17[_0xb2ef('0x59')]['ids'],_[_0xb2ef('0x6c')](_0x53aa17[_0xb2ef('0x59')],[_0xb2ef('0x65'),'id'])||{});}})[_0xb2ef('0x20')](respondWithResult(_0x320345,null))[_0xb2ef('0x52')](handleError(_0x320345,null));};exports[_0xb2ef('0x6d')]=function(_0xa2f647,_0x4b1c17,_0x159a1a){var _0x4af3bb={'raw':![],'where':{}};var _0x120789={};var _0x3ca2d2={'count':0x0,'rows':[]};return db[_0xb2ef('0x3e')][_0xb2ef('0x5f')]({'where':{'id':_0xa2f647[_0xb2ef('0x5a')]['id']}})[_0xb2ef('0x20')](handleEntityNotFound(_0x4b1c17,null))[_0xb2ef('0x20')](function(_0x484cca){if(_0x484cca){_0x120789[_0xb2ef('0x41')]=_['keys'](db[_0xb2ef('0x6b')][_0xb2ef('0x3f')]);_0x120789[_0xb2ef('0x42')]=_['keys'](_0xa2f647[_0xb2ef('0x42')]);_0x120789['filters']=_['intersection'](_0x120789[_0xb2ef('0x41')],_0x120789['query']);_0x4af3bb['attributes']=_[_0xb2ef('0x54')](_0x120789[_0xb2ef('0x41')],qs[_0xb2ef('0x46')](_0xa2f647[_0xb2ef('0x42')][_0xb2ef('0x46')]));_0x4af3bb[_0xb2ef('0x45')]=_0x4af3bb[_0xb2ef('0x45')]['length']?_0x4af3bb[_0xb2ef('0x45')]:_0x120789['model'];if(!_0xa2f647[_0xb2ef('0x42')][_0xb2ef('0x48')](_0xb2ef('0x60'))){_0x4af3bb['limit']=qs[_0xb2ef('0x2e')](_0xa2f647['query'][_0xb2ef('0x2e')]);_0x4af3bb[_0xb2ef('0x2c')]=qs[_0xb2ef('0x2c')](_0xa2f647['query'][_0xb2ef('0x2c')]);}_0x4af3bb[_0xb2ef('0x49')]=qs[_0xb2ef('0x4a')](_0xa2f647[_0xb2ef('0x42')][_0xb2ef('0x4a')]);_0x4af3bb[_0xb2ef('0x4b')]=qs[_0xb2ef('0x44')](_[_0xb2ef('0x61')](_0xa2f647[_0xb2ef('0x42')],_0x120789[_0xb2ef('0x44')]));_0x4af3bb[_0xb2ef('0x4b')][_0xb2ef('0x62')]=_0x484cca['id'];if(_0xa2f647[_0xb2ef('0x42')]['filter']){_0x4af3bb[_0xb2ef('0x4b')]=_[_0xb2ef('0x4c')](_0x4af3bb[_0xb2ef('0x4b')],{'$or':_['map'](_0x4af3bb['attributes'],function(_0x2f9469){var _0x4421a9={};_0x4421a9[_0x2f9469]={'$like':'%'+_0xa2f647[_0xb2ef('0x42')][_0xb2ef('0x63')]+'%'};return _0x4421a9;})});}_0x4af3bb=_[_0xb2ef('0x4c')]({},_0x4af3bb,_0xa2f647[_0xb2ef('0x4d')]);return db['FaxInteraction'][_0xb2ef('0x2f')]({'where':_0x4af3bb[_0xb2ef('0x4b')]})[_0xb2ef('0x20')](function(_0x20aa2d){_0x3ca2d2[_0xb2ef('0x2f')]=_0x20aa2d;if(_0xa2f647[_0xb2ef('0x42')][_0xb2ef('0x4e')]){_0x4af3bb[_0xb2ef('0x4f')]=[{'model':db[_0xb2ef('0x6e')],'as':_0xb2ef('0x6f'),'required':![]},{'model':db['User'],'as':_0xb2ef('0x70'),'attributes':['name',_0xb2ef('0x71'),_0xb2ef('0x72')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xb2ef('0x38'),_0xb2ef('0x73')],'where':_0xa2f647[_0xb2ef('0x42')][_0xb2ef('0x74')]?{'id':_0xa2f647[_0xb2ef('0x42')]['tag']}:undefined,'required':_0xa2f647[_0xb2ef('0x42')][_0xb2ef('0x74')]?!![]:![]}];}return db['FaxInteraction'][_0xb2ef('0x50')](_0x4af3bb);})[_0xb2ef('0x20')](function(_0xbe9b5){_0x3ca2d2['rows']=_0xbe9b5;return _0x3ca2d2;});}})['then'](respondWithFilteredResult(_0x4b1c17,_0x4af3bb))[_0xb2ef('0x52')](handleError(_0x4b1c17,null));};exports[_0xb2ef('0x75')]=function(_0x3229dc,_0x3be88c){var _0x3b7db8=_0x3229dc[_0xb2ef('0x5a')]['id'];var _0x517665=_0x3229dc[_0xb2ef('0x59')];var _0x295945=0xc8;var _0x394bc1=null;return db[_0xb2ef('0x76')]['transaction']({'isolationLevel':db[_0xb2ef('0x76')][_0xb2ef('0x77')][_0xb2ef('0x78')]['READ_COMMITTED']},function(_0x1018d4){return db['FaxAccount'][_0xb2ef('0x5f')]({'where':{'id':_0x3b7db8},'transaction':_0x1018d4})[_0xb2ef('0x20')](function(_0x2b70e3){if(_0x2b70e3){return db['FaxApplication'][_0xb2ef('0x33')]({'where':{'FaxAccountId':_0x3b7db8},'transaction':_0x1018d4})['then'](function(){var _0x14a0ee=_[_0xb2ef('0x3d')](_0x517665,function(_0x1e639f){_0x1e639f['FaxAccountId']=_0x3b7db8;return _0x1e639f;});return db['FaxApplication'][_0xb2ef('0x79')](_0x14a0ee,{'transaction':_0x1018d4});});}else{_0x295945=0x194;_0x394bc1=[];}});})[_0xb2ef('0x20')](function(){if(_0x295945!==0x194){return db[_0xb2ef('0x7a')]['findAndCountAll']({'where':{'FaxAccountId':_0x3b7db8},'order':_0xb2ef('0x7b')})[_0xb2ef('0x20')](function(_0x161ffa){_0x394bc1=_0x161ffa;});}})[_0xb2ef('0x52')](function(_0x5b6a21){_0x295945=0x1f4;logger[_0xb2ef('0x24')](_0x5b6a21['stack']);if(_0x5b6a21[_0xb2ef('0x38')]){delete _0x5b6a21[_0xb2ef('0x38')];}_0x394bc1=_0x5b6a21;})[_0xb2ef('0x7c')](function(){if(_0x394bc1===null){_0x3be88c[_0xb2ef('0x28')](_0x295945);}else{if(_0x295945===0x1f4){_0x3be88c[_0xb2ef('0x29')](_0x295945)[_0xb2ef('0x39')](_0x394bc1);}else{_0x3be88c[_0xb2ef('0x29')](_0x295945)['json'](_0x394bc1);}}});};exports[_0xb2ef('0x7d')]=function(_0x5b71e5,_0x2ef086,_0x359990){var _0x2423fe={};var _0x101494={};var _0x5a9090;var _0x3acd5c;return db[_0xb2ef('0x3e')][_0xb2ef('0x5f')]({'where':{'id':_0x5b71e5[_0xb2ef('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2ef086,null))[_0xb2ef('0x20')](function(_0x52d149){if(_0x52d149){_0x5a9090=_0x52d149;_0x101494[_0xb2ef('0x41')]=_[_0xb2ef('0x43')](db[_0xb2ef('0x7a')][_0xb2ef('0x3f')]);_0x101494['query']=_[_0xb2ef('0x43')](_0x5b71e5[_0xb2ef('0x42')]);_0x101494[_0xb2ef('0x44')]=_[_0xb2ef('0x54')](_0x101494[_0xb2ef('0x41')],_0x101494['query']);_0x2423fe[_0xb2ef('0x45')]=_['intersection'](_0x101494[_0xb2ef('0x41')],qs[_0xb2ef('0x46')](_0x5b71e5[_0xb2ef('0x42')][_0xb2ef('0x46')]));_0x2423fe[_0xb2ef('0x45')]=_0x2423fe[_0xb2ef('0x45')][_0xb2ef('0x47')]?_0x2423fe['attributes']:_0x101494[_0xb2ef('0x41')];_0x2423fe[_0xb2ef('0x49')]=qs[_0xb2ef('0x4a')](_0x5b71e5[_0xb2ef('0x42')][_0xb2ef('0x4a')]);_0x2423fe[_0xb2ef('0x4b')]=qs[_0xb2ef('0x44')](_['pick'](_0x5b71e5['query'],_0x101494[_0xb2ef('0x44')]));if(_0x5b71e5[_0xb2ef('0x42')][_0xb2ef('0x63')]){_0x2423fe['where']=_[_0xb2ef('0x4c')](_0x2423fe[_0xb2ef('0x4b')],{'$or':_[_0xb2ef('0x3d')](_0x2423fe[_0xb2ef('0x45')],function(_0x344611){var _0x2c5960={};_0x2c5960[_0x344611]={'$like':'%'+_0x5b71e5[_0xb2ef('0x42')][_0xb2ef('0x63')]+'%'};return _0x2c5960;})});}_0x2423fe=_[_0xb2ef('0x4c')]({},_0x2423fe,_0x5b71e5['options']);return _0x5a9090[_0xb2ef('0x7d')](_0x2423fe);}})[_0xb2ef('0x20')](function(_0x41a701){if(_0x41a701){_0x3acd5c=_0x41a701[_0xb2ef('0x47')];if(!_0x5b71e5['query'][_0xb2ef('0x48')](_0xb2ef('0x60'))){_0x2423fe[_0xb2ef('0x2e')]=qs[_0xb2ef('0x2e')](_0x5b71e5['query'][_0xb2ef('0x2e')]);_0x2423fe[_0xb2ef('0x2c')]=qs['offset'](_0x5b71e5['query'][_0xb2ef('0x2c')]);}return _0x5a9090[_0xb2ef('0x7d')](_0x2423fe);}})[_0xb2ef('0x20')](function(_0x1054ef){if(_0x1054ef){return _0x1054ef?{'count':_0x3acd5c,'rows':_0x1054ef}:null;}})[_0xb2ef('0x20')](respondWithResult(_0x2ef086,null))[_0xb2ef('0x52')](handleError(_0x2ef086,null));};function Extension(_0x5ef1b6,_0x5c4cd3,_0x5d664a,_0x3c26d8){this['context']=_0xb2ef('0x7e');this['exten']=_0x5ef1b6[_0xb2ef('0x7f')];this[_0xb2ef('0x80')]=_0x3c26d8;this['type']=_0xb2ef('0x81');this[_0xb2ef('0x82')]=_0xb2ef('0x83');this[_0xb2ef('0x62')]=_0x5ef1b6['id'];this[_0xb2ef('0x7b')]=_0x5c4cd3;this[_0xb2ef('0x84')]=_0x5d664a;}function createExtensionsReciveFax(_0x167eb6){var _0xc13354=0x1;var _0x2f920c=[];_0x2f920c['push'](new Extension(_0x167eb6,_0xc13354,'',_0xb2ef('0x85')));_0xc13354+=0x1;_0x2f920c[_0xb2ef('0x86')](new Extension(_0x167eb6,_0xc13354,'CDR(type)=inbound-fax',_0xb2ef('0x87')));_0xc13354+=0x1;for(var _0x3b8aee in _0x167eb6){if(_0x167eb6[_0xb2ef('0x48')](_0x3b8aee)&&(_0x3b8aee===_0xb2ef('0x88')||_0x3b8aee===_0xb2ef('0x7f')||_0x3b8aee===_0xb2ef('0x89')||_0x3b8aee===_0xb2ef('0x8a')||_0x3b8aee===_0xb2ef('0x8b')||_0x3b8aee===_0xb2ef('0x8c')||_0x3b8aee===_0xb2ef('0x8d')||_0x3b8aee===_0xb2ef('0x8e')||_0x3b8aee===_0xb2ef('0x8f'))){_0x2f920c['push'](new Extension(_0x167eb6,_0xc13354,_0xb2ef('0x90')+_0x3b8aee+')='+_0x167eb6[_0x3b8aee],_0xb2ef('0x87')));_0xc13354+=0x1;}}_0x2f920c[_0xb2ef('0x86')](new Extension(_0x167eb6,_0xc13354,'6',_0xb2ef('0x91')));_0xc13354+=0x1;_0x2f920c['push'](new Extension(_0x167eb6,_0xc13354,_0xb2ef('0x92'),_0xb2ef('0x93')));_0xc13354=0x0;return _0x2f920c;}exports['addAccountApplications']=function(_0x24dcdd,_0x4f6580,_0x2b3a08){var _0x230c11;return db['sequelize']['transaction'](function(_0x26ad70){return db[_0xb2ef('0x3e')][_0xb2ef('0x57')](_0x24dcdd['body'],{'transaction':_0x26ad70})[_0xb2ef('0x20')](function(_0x21df45){_0x230c11=_0x21df45[_0xb2ef('0x34')]({'plain':!![]});return db['VoiceExtension'][_0xb2ef('0x79')](createExtensionsReciveFax(_0x230c11),{'transaction':_0x26ad70});});})[_0xb2ef('0x20')](function(){return _0x230c11;})[_0xb2ef('0x20')](respondWithResult(_0x4f6580,null))['catch'](handleError(_0x4f6580,null));};exports[_0xb2ef('0x94')]=function(_0x5588f9,_0x1fe57a,_0x25b9f7){var _0x484fb4;return db['sequelize']['transaction'](function(_0x12a4f0){return db[_0xb2ef('0x3e')][_0xb2ef('0x32')](_0x5588f9['body'],{'where':{'id':_0x5588f9[_0xb2ef('0x59')]['id']},'transaction':_0x12a4f0})[_0xb2ef('0x20')](function(_0x49d543){return db[_0xb2ef('0x95')][_0xb2ef('0x33')]({'where':{'FaxAccountId':_0x5588f9[_0xb2ef('0x59')]['id']},'transaction':_0x12a4f0})[_0xb2ef('0x20')](function(_0x1c8e9e){return db[_0xb2ef('0x95')][_0xb2ef('0x79')](createExtensionsReciveFax(_[_0xb2ef('0x6c')](_0x5588f9['body'],[_0xb2ef('0x96'),_0xb2ef('0x97'),_0xb2ef('0x98'),_0xb2ef('0x99'),_0xb2ef('0x9a'),'ListId'])),{'transaction':_0x12a4f0});});});})[_0xb2ef('0x20')](function(){return db['FaxAccount'][_0xb2ef('0x9b')](_0x5588f9[_0xb2ef('0x59')]['id']);})['then'](respondWithResult(_0x1fe57a,null))[_0xb2ef('0x52')](handleError(_0x1fe57a,null));};exports[_0xb2ef('0x9c')]=function(_0xd89f0,_0x57c994,_0x15f6b0){var _0x2433ad={'raw':!![],'where':{}};var _0x24bdab={};var _0x47f624={'count':0x0,'rows':[]};return db[_0xb2ef('0x3e')][_0xb2ef('0x5f')]({'where':{'id':_0xd89f0[_0xb2ef('0x5a')]['id']}})[_0xb2ef('0x20')](handleEntityNotFound(_0x57c994,null))['then'](function(_0x559784){if(_0x559784){_0x24bdab['model']=_[_0xb2ef('0x43')](db[_0xb2ef('0x9d')][_0xb2ef('0x3f')]);_0x24bdab['query']=_['keys'](_0xd89f0[_0xb2ef('0x42')]);_0x24bdab[_0xb2ef('0x44')]=_[_0xb2ef('0x54')](_0x24bdab[_0xb2ef('0x41')],_0x24bdab[_0xb2ef('0x42')]);_0x2433ad[_0xb2ef('0x45')]=_[_0xb2ef('0x54')](_0x24bdab[_0xb2ef('0x41')],qs[_0xb2ef('0x46')](_0xd89f0['query'][_0xb2ef('0x46')]));_0x2433ad[_0xb2ef('0x45')]=_0x2433ad['attributes'][_0xb2ef('0x47')]?_0x2433ad['attributes']:_0x24bdab[_0xb2ef('0x41')];if(!_0xd89f0['query']['hasOwnProperty'](_0xb2ef('0x60'))){_0x2433ad[_0xb2ef('0x2e')]=qs[_0xb2ef('0x2e')](_0xd89f0[_0xb2ef('0x42')][_0xb2ef('0x2e')]);_0x2433ad[_0xb2ef('0x2c')]=qs['offset'](_0xd89f0[_0xb2ef('0x42')][_0xb2ef('0x2c')]);}_0x2433ad[_0xb2ef('0x49')]=qs[_0xb2ef('0x4a')](_0xd89f0[_0xb2ef('0x42')]['sort']);_0x2433ad[_0xb2ef('0x4b')]=qs['filters'](_[_0xb2ef('0x61')](_0xd89f0[_0xb2ef('0x42')],_0x24bdab[_0xb2ef('0x44')]));_0x2433ad[_0xb2ef('0x4b')][_0xb2ef('0x62')]=_0x559784['id'];if(_0xd89f0[_0xb2ef('0x42')][_0xb2ef('0x63')]){_0x2433ad[_0xb2ef('0x4b')]=_[_0xb2ef('0x4c')](_0x2433ad[_0xb2ef('0x4b')],{'$or':_['map'](_0x2433ad[_0xb2ef('0x45')],function(_0x3ce1e7){var _0x52f7e0={};_0x52f7e0[_0x3ce1e7]={'$like':'%'+_0xd89f0[_0xb2ef('0x42')][_0xb2ef('0x63')]+'%'};return _0x52f7e0;})});}if(_0xd89f0[_0xb2ef('0x42')][_0xb2ef('0x9e')]){var _0x3bbfb0=_0xd89f0['query'][_0xb2ef('0x9e')]['split'](',');var _0x58a5ac={};_0x58a5ac[_0x3bbfb0[0x0]]={'$gte':moment(_0x3bbfb0[0x1])[_0xb2ef('0x9f')](_0xb2ef('0xa0'))};_0x2433ad['where']=_[_0xb2ef('0x4c')](_0x2433ad[_0xb2ef('0x4b')],_0x58a5ac);}_0x2433ad=_['merge']({},_0x2433ad,_0xd89f0[_0xb2ef('0x4d')]);return db[_0xb2ef('0x9d')][_0xb2ef('0x2f')]({'where':_0x2433ad['where']})[_0xb2ef('0x20')](function(_0x257875){_0x47f624[_0xb2ef('0x2f')]=_0x257875;if(_0xd89f0['query'][_0xb2ef('0x4e')]){_0x2433ad[_0xb2ef('0x4f')]=[{'all':!![]}];}return db[_0xb2ef('0x9d')][_0xb2ef('0x50')](_0x2433ad);})[_0xb2ef('0x20')](function(_0x5398bd){_0x47f624[_0xb2ef('0x51')]=_0x5398bd;return _0x47f624;});}})[_0xb2ef('0x20')](respondWithFilteredResult(_0x57c994,_0x2433ad))[_0xb2ef('0x52')](handleError(_0x57c994,null));};exports['send']=function(_0x8cca4d,_0x2de621,_0x427a5b){var _0x57ddf2,_0x5ca471={},_0x8591cf;if(_0x8cca4d[_0xb2ef('0x59')]['to']){_0x8591cf=_0x8cca4d[_0xb2ef('0x59')]['to'][0x0];}return db[_0xb2ef('0x3e')][_0xb2ef('0x55')]({'where':{'id':_0x8cca4d[_0xb2ef('0x5a')]['id']},'include':[{'model':db[_0xb2ef('0xa1')],'as':_0xb2ef('0xa2'),'include':[{'model':db[_0xb2ef('0x6e')],'as':_0xb2ef('0xa3'),'where':{'fax':_0x8591cf},'limit':0x1,'order':[[_0xb2ef('0x99'),_0xb2ef('0xa4')]]}]}]})[_0xb2ef('0x20')](handleEntityNotFound(_0x2de621,null))[_0xb2ef('0x20')](function(_0xf39109){_0x57ddf2=_0xf39109;if(_0x8cca4d[_0xb2ef('0x59')][_0xb2ef('0xa5')]&&_0x8cca4d[_0xb2ef('0x59')][_0xb2ef('0xa5')]['length']){for(var _0x521379=0x0;_0x521379<_0x8cca4d['body'][_0xb2ef('0xa5')][_0xb2ef('0x47')];_0x521379+=0x1){_0x8cca4d[_0xb2ef('0x59')][_0xb2ef('0xa5')][_0x521379]={'filename':_0x8cca4d[_0xb2ef('0x59')][_0xb2ef('0xa5')][_0x521379]['name'],'id':_0x8cca4d[_0xb2ef('0x59')]['attachments'][_0x521379]['id'],'path':path[_0xb2ef('0xa6')](config[_0xb2ef('0xa7')],_0xb2ef('0xa8'),_0x8cca4d[_0xb2ef('0x59')][_0xb2ef('0xa5')][_0x521379][_0xb2ef('0xa9')])};}}return respondWithRpcPromise(_0xb2ef('0xaa'),_0xb2ef('0xaa'),{'FaxAccountId':_[_0xb2ef('0xab')](_0x8cca4d[_0xb2ef('0x5a')]['id'])?undefined:_0x8cca4d[_0xb2ef('0x5a')]['id'],'path':_['isNil'](_0x8cca4d['body'][_0xb2ef('0xa5')][0x0][_0xb2ef('0x8')])?undefined:_0x8cca4d[_0xb2ef('0x59')][_0xb2ef('0xa5')][0x0][_0xb2ef('0x8')],'fax':_[_0xb2ef('0xab')](_0x8cca4d[_0xb2ef('0x59')]['to'][0x0])?undefined:_0x8cca4d[_0xb2ef('0x59')]['to'][0x0]},client9002);})['then'](function(){if(_0x57ddf2){if(_[_0xb2ef('0xab')](_0x8cca4d['body'][_0xb2ef('0xac')])){_0x8cca4d[_0xb2ef('0x59')]['from']=util[_0xb2ef('0x9f')](_0xb2ef('0xad'),_0x57ddf2[_0xb2ef('0x38')],_0x57ddf2[_0xb2ef('0xae')]);}if(_0x57ddf2[_0xb2ef('0xa2')]){if(_0x57ddf2[_0xb2ef('0xa2')]['Contacts'][_0xb2ef('0x47')]){return _0x57ddf2[_0xb2ef('0xa2')][_0xb2ef('0xa3')][0x0];}else{return db['CmContact'][_0xb2ef('0x57')](_[_0xb2ef('0x18')](_0x8cca4d['body'],{'firstName':_0x8cca4d['body']['to'][0x0],'phone':_0x8cca4d[_0xb2ef('0x59')]['to'][0x0],'fax':_0x8cca4d[_0xb2ef('0x59')]['to'][0x0],'ListId':_0x57ddf2[_0xb2ef('0xaf')]}));}}else{throw new Error(_0xb2ef('0xb0'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xb2ef('0x20')](function(_0x58ef6a){if(_0x58ef6a){return db[_0xb2ef('0x6b')][_0xb2ef('0x55')]({'where':{'ContactId':_0x58ef6a['id'],'closed':![],'FaxAccountId':_0x57ddf2['id']}})[_0xb2ef('0x20')](function(_0x4402a6){if(_0x4402a6){return[_0x4402a6,![]];}return db[_0xb2ef('0x6b')][_0xb2ef('0x57')]({'UserId':_0x8cca4d['user']['id'],'ContactId':_0x58ef6a['id'],'FaxAccountId':_0x57ddf2['id'],'fax':_0x8cca4d[_0xb2ef('0x59')]['to'][0x0],'firstMsgDirection':_0xb2ef('0xb1'),'Messages':[_['merge'](_0x8cca4d[_0xb2ef('0x59')],{'read':![],'body':_0x8cca4d[_0xb2ef('0x59')][_0xb2ef('0xa5')][0x0][_0xb2ef('0xb2')],'FaxAccountId':_0x57ddf2['id'],'UserId':_0x8cca4d[_0xb2ef('0xb3')]['id'],'ContactId':_0x58ef6a['id'],'AttachmentId':_0x8cca4d['body'][_0xb2ef('0xa5')][0x0]['id']})]},{'include':[{'model':db[_0xb2ef('0x9d')],'as':_0xb2ef('0xb4')}]})[_0xb2ef('0x20')](function(_0x346153){return[_0x346153,!![]];});});}else{throw new Error(_0xb2ef('0xb5'));}})['spread'](function(_0x393ef3,_0x43ec6f){if(_0x43ec6f){return _0x393ef3;}return db[_0xb2ef('0x9d')]['create']({'direction':'out','read':![],'body':_0x8cca4d[_0xb2ef('0x59')][_0xb2ef('0xa5')][0x0][_0xb2ef('0xb2')],'FaxAccountId':_0x57ddf2['id'],'FaxInteractionId':_0x393ef3['id'],'UserId':_0x8cca4d[_0xb2ef('0xb3')]['id'],'ContactId':_0x393ef3[_0xb2ef('0xb6')],'AttachmentId':_0x8cca4d[_0xb2ef('0x59')][_0xb2ef('0xa5')][0x0]['id']})[_0xb2ef('0x20')](function(_0x33aba6){_0x393ef3[_0xb2ef('0xb7')][_0xb2ef('0xb4')]=[];_0x393ef3[_0xb2ef('0xb7')]['Messages'][_0xb2ef('0x86')](_0x33aba6['dataValues']);return _0x393ef3;});})[_0xb2ef('0x20')](function(_0x38e56a){respondWithRpcPromise(_0xb2ef('0xb8'),_0xb2ef('0xb8'),{'FaxAccountId':_[_0xb2ef('0xab')](_0x8cca4d[_0xb2ef('0x5a')]['id'])?undefined:_0x8cca4d[_0xb2ef('0x5a')]['id'],'path':_[_0xb2ef('0xab')](_0x8cca4d[_0xb2ef('0x59')][_0xb2ef('0xa5')][0x0]['path'])?undefined:_0x8cca4d[_0xb2ef('0x59')]['attachments'][0x0][_0xb2ef('0x8')],'fax':_[_0xb2ef('0xab')](_0x8cca4d[_0xb2ef('0x59')]['to'][0x0])?undefined:_0x8cca4d[_0xb2ef('0x59')]['to'][0x0],'AttachmentId':_0x8cca4d[_0xb2ef('0x59')][_0xb2ef('0xa5')][0x0]['id']},client9002)['then'](function(_0x946647){logger[_0xb2ef('0xb9')](_0xb2ef('0xba'),_0x946647);})[_0xb2ef('0x52')](function(_0x4b44d7){logger[_0xb2ef('0xb9')](_0xb2ef('0xba'),_0x4b44d7);});return _0x38e56a;})[_0xb2ef('0x20')](respondWithResult(_0x2de621,null))[_0xb2ef('0x52')](handleError(_0x2de621,null));};exports[_0xb2ef('0xbb')]=function(_0x409998,_0x49c58c,_0x2928c2){return db[_0xb2ef('0x3e')][_0xb2ef('0x55')]({'where':{'id':_0x409998[_0xb2ef('0x5a')]['id']}})[_0xb2ef('0x20')](handleEntityNotFound(_0x49c58c,null))[_0xb2ef('0x20')](function(_0x516640){if(_0x516640){return _0x516640[_0xb2ef('0xbb')](_0x409998[_0xb2ef('0x59')][_0xb2ef('0x65')],_[_0xb2ef('0x6c')](_0x409998[_0xb2ef('0x59')],[_0xb2ef('0x65'),'id'])||{})[_0xb2ef('0xbc')](function(_0x453d8b){for(var _0x3dfd5a=0x0;_0x3dfd5a<_0x409998[_0xb2ef('0x59')]['ids'][_0xb2ef('0x47')];_0x3dfd5a+=0x1){socket[_0xb2ef('0xbd')](_0xb2ef('0xbe'),{'UserId':Number(_0x409998[_0xb2ef('0x59')][_0xb2ef('0x65')][_0x3dfd5a]),'FaxAccountId':Number(_0x409998[_0xb2ef('0x5a')]['id'])});}return _0x453d8b;});}})['then'](respondWithResult(_0x49c58c,null))['catch'](handleError(_0x49c58c,null));};exports[_0xb2ef('0xbf')]=function(_0x10915d,_0x507334,_0x98c98e){return db['FaxAccount'][_0xb2ef('0x55')]({'where':{'id':_0x10915d[_0xb2ef('0x5a')]['id']}})['then'](handleEntityNotFound(_0x507334,null))[_0xb2ef('0x20')](function(_0x35ff7b){if(_0x35ff7b){return _0x35ff7b[_0xb2ef('0xbf')](_0x10915d['query'][_0xb2ef('0x65')])[_0xb2ef('0x20')](function(){if(_[_0xb2ef('0xc0')](_0x10915d[_0xb2ef('0x42')][_0xb2ef('0x65')])){for(var _0x41372c=0x0;_0x41372c<_0x10915d[_0xb2ef('0x42')][_0xb2ef('0x65')][_0xb2ef('0x47')];_0x41372c+=0x1){socket[_0xb2ef('0xbd')](_0xb2ef('0xc1'),{'UserId':Number(_0x10915d[_0xb2ef('0x42')]['ids'][_0x41372c]),'FaxAccountId':Number(_0x10915d['params']['id'])});}}else{socket[_0xb2ef('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x10915d['query'][_0xb2ef('0x65')]),'FaxAccountId':Number(_0x10915d[_0xb2ef('0x5a')]['id'])});}});}})[_0xb2ef('0x20')](respondWithStatusCode(_0x507334,null))[_0xb2ef('0x52')](handleError(_0x507334,null));};exports['getAgents']=function(_0x13da5c,_0x33a6db,_0x14a3c8){var _0x3f0a67={};var _0x1f5dee={};var _0x305846;var _0x2dca3b;return db[_0xb2ef('0x3e')][_0xb2ef('0x5f')]({'where':{'id':_0x13da5c['params']['id']}})[_0xb2ef('0x20')](handleEntityNotFound(_0x33a6db,null))[_0xb2ef('0x20')](function(_0x2c5c75){if(_0x2c5c75){_0x305846=_0x2c5c75;_0x1f5dee[_0xb2ef('0x41')]=_['keys'](db[_0xb2ef('0xc2')][_0xb2ef('0x3f')]);_0x1f5dee[_0xb2ef('0x42')]=_[_0xb2ef('0x43')](_0x13da5c[_0xb2ef('0x42')]);_0x1f5dee['filters']=_[_0xb2ef('0x54')](_0x1f5dee['model'],_0x1f5dee[_0xb2ef('0x42')]);_0x3f0a67[_0xb2ef('0x45')]=_['intersection'](_0x1f5dee[_0xb2ef('0x41')],qs[_0xb2ef('0x46')](_0x13da5c['query']['fields']));_0x3f0a67['attributes']=_0x3f0a67['attributes']['length']?_0x3f0a67['attributes']:_0x1f5dee[_0xb2ef('0x41')];_0x3f0a67[_0xb2ef('0x49')]=qs['sort'](_0x13da5c[_0xb2ef('0x42')][_0xb2ef('0x4a')]);_0x3f0a67['where']=qs[_0xb2ef('0x44')](_[_0xb2ef('0x61')](_0x13da5c[_0xb2ef('0x42')],_0x1f5dee[_0xb2ef('0x44')]));if(_0x13da5c[_0xb2ef('0x42')][_0xb2ef('0x63')]){_0x3f0a67[_0xb2ef('0x4b')]=_[_0xb2ef('0x4c')](_0x3f0a67[_0xb2ef('0x4b')],{'$or':_[_0xb2ef('0x3d')](_0x3f0a67[_0xb2ef('0x45')],function(_0x58ccda){var _0xde9ef1={};_0xde9ef1[_0x58ccda]={'$like':'%'+_0x13da5c[_0xb2ef('0x42')][_0xb2ef('0x63')]+'%'};return _0xde9ef1;})});}_0x3f0a67=_[_0xb2ef('0x4c')]({},_0x3f0a67,_0x13da5c[_0xb2ef('0x4d')]);return _0x305846[_0xb2ef('0xc3')](_0x3f0a67);}})[_0xb2ef('0x20')](function(_0x5eebea){if(_0x5eebea){_0x2dca3b=_0x5eebea[_0xb2ef('0x47')];if(!_0x13da5c[_0xb2ef('0x42')][_0xb2ef('0x48')](_0xb2ef('0x60'))){_0x3f0a67['limit']=qs['limit'](_0x13da5c[_0xb2ef('0x42')]['limit']);_0x3f0a67[_0xb2ef('0x2c')]=qs[_0xb2ef('0x2c')](_0x13da5c[_0xb2ef('0x42')][_0xb2ef('0x2c')]);}return _0x305846[_0xb2ef('0xc3')](_0x3f0a67);}})['then'](function(_0xb5b8b7){if(_0xb5b8b7){return _0xb5b8b7?{'count':_0x2dca3b,'rows':_0xb5b8b7}:null;}})[_0xb2ef('0x20')](respondWithResult(_0x33a6db,null))[_0xb2ef('0x52')](handleError(_0x33a6db,null));}; \ No newline at end of file +var _0xf4e2=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','destroy','get','FaxAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','include','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','FaxAccountId','Disposition','findOne','options','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','system','description','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','faxdetect','maxrate','minrate','modem','t38timeout','Wait','ReceiveFax','addAccountApplications','bulkCreate','updateAccountApplications','VoiceExtension','tech','TrunkId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','basename','isNil','path','from','format','\x22%s\x22\x20<%s>','fax','defaults','ListId','List\x20not\x20found','filename','Messages','Contact\x20not\x20found','spread','out','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0xf4e2,0x17d));var _0x2f4e=function(_0x124728,_0x463dca){_0x124728=_0x124728-0x0;var _0x8eb20f=_0xf4e2[_0x124728];return _0x8eb20f;};'use strict';var emlformat=require(_0x2f4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2f4e('0x1'));var jsonpatch=require(_0x2f4e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2f4e('0x3'));var Mustache=require(_0x2f4e('0x4'));var util=require(_0x2f4e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x2f4e('0x6'));var ejs=require(_0x2f4e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f4e('0x8'));var squel=require(_0x2f4e('0x9'));var crypto=require(_0x2f4e('0xa'));var jsforce=require(_0x2f4e('0xb'));var deskjs=require(_0x2f4e('0xc'));var toCsv=require(_0x2f4e('0x6'));var querystring=require(_0x2f4e('0xd'));var Papa=require(_0x2f4e('0xe'));var Redis=require(_0x2f4e('0xf'));var authService=require(_0x2f4e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2f4e('0x11'));var hardwareService=require(_0x2f4e('0x12'));var logger=require(_0x2f4e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x2f4e('0x14'));var licenseUtil=require(_0x2f4e('0x15'));var db=require(_0x2f4e('0x16'))['db'];config[_0x2f4e('0x17')]=_['defaults'](config[_0x2f4e('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2f4e('0x17')]));require('./faxAccount.socket')[_0x2f4e('0x18')](socket);var jayson=require(_0x2f4e('0x19'));var client=jayson[_0x2f4e('0x1a')][_0x2f4e('0x1b')]({'port':0x232c});var client9002=jayson[_0x2f4e('0x1a')][_0x2f4e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xe1c997,_0x1302f1,_0x13142c,_0x24434c){return new BPromise(function(_0x28c5ec,_0x5e97dc){var _0x48ce2b=_0x24434c||client;return _0x48ce2b[_0x2f4e('0x1c')](_0xe1c997,_0x13142c)[_0x2f4e('0x1d')](function(_0x5664fc){logger[_0x2f4e('0x1e')](_0x2f4e('0x1f'),_0x1302f1,'request\x20sent');logger[_0x2f4e('0x20')](_0x2f4e('0x21'),_0x1302f1,_0x2f4e('0x22'),JSON[_0x2f4e('0x23')](_0x5664fc));if(_0x5664fc[_0x2f4e('0x24')]){if(_0x5664fc[_0x2f4e('0x24')][_0x2f4e('0x25')]===0x1f4){logger['error'](_0x2f4e('0x1f'),_0x1302f1,_0x5664fc[_0x2f4e('0x24')][_0x2f4e('0x26')]);return _0x5e97dc(_0x5664fc['error'][_0x2f4e('0x26')]);}logger[_0x2f4e('0x24')](_0x2f4e('0x1f'),_0x1302f1,_0x5664fc['error']['message']);return _0x28c5ec(_0x5664fc[_0x2f4e('0x24')][_0x2f4e('0x26')]);}else{logger[_0x2f4e('0x1e')](_0x2f4e('0x1f'),_0x1302f1,_0x2f4e('0x22'));_0x28c5ec(_0x5664fc[_0x2f4e('0x27')]['message']);}})['catch'](function(_0xfab624){logger[_0x2f4e('0x24')](_0x2f4e('0x1f'),_0x1302f1,_0xfab624);_0x5e97dc(_0xfab624);});});}function respondWithStatusCode(_0x2c713c,_0x1e49e9){_0x1e49e9=_0x1e49e9||0xcc;return function(_0x3554ac){if(_0x3554ac){return _0x2c713c[_0x2f4e('0x28')](_0x1e49e9);}return _0x2c713c['status'](_0x1e49e9)[_0x2f4e('0x29')]();};}function respondWithResult(_0x3bbcfa,_0x2723d9){_0x2723d9=_0x2723d9||0xc8;return function(_0x22c5a2){if(_0x22c5a2){return _0x3bbcfa[_0x2f4e('0x2a')](_0x2723d9)['json'](_0x22c5a2);}};}function respondWithFilteredResult(_0x57cee9,_0x58e547){return function(_0x53abd6){if(_0x53abd6){var _0x412989=typeof _0x58e547[_0x2f4e('0x2b')]==='undefined'&&typeof _0x58e547['limit']===_0x2f4e('0x2c');var _0x1b8937=_0x53abd6[_0x2f4e('0x2d')];var _0x62c671=_0x412989?0x0:_0x58e547[_0x2f4e('0x2b')];var _0x545e4f=_0x412989?_0x53abd6[_0x2f4e('0x2d')]:_0x58e547[_0x2f4e('0x2b')]+_0x58e547[_0x2f4e('0x2e')];var _0x37438d;if(_0x545e4f>=_0x1b8937){_0x545e4f=_0x1b8937;_0x37438d=0xc8;}else{_0x37438d=0xce;}_0x57cee9[_0x2f4e('0x2a')](_0x37438d);return _0x57cee9[_0x2f4e('0x2f')](_0x2f4e('0x30'),_0x62c671+'-'+_0x545e4f+'/'+_0x1b8937)[_0x2f4e('0x31')](_0x53abd6);}return null;};}function patchUpdates(_0x245343){return function(_0x2b380d){try{jsonpatch[_0x2f4e('0x32')](_0x2b380d,_0x245343,!![]);}catch(_0xc0db4a){return BPromise[_0x2f4e('0x33')](_0xc0db4a);}return _0x2b380d[_0x2f4e('0x34')]();};}function saveUpdates(_0x55013d,_0x248bc2){return function(_0x37b14e){if(_0x37b14e){return _0x37b14e['update'](_0x55013d)[_0x2f4e('0x1d')](function(_0x5ce3b8){return _0x5ce3b8;});}return null;};}function removeEntity(_0x5ab2ef,_0x8a7bc9){return function(_0x2e3281){if(_0x2e3281){return _0x2e3281[_0x2f4e('0x35')]()[_0x2f4e('0x1d')](function(){var _0x1b6c70=_0x2e3281[_0x2f4e('0x36')]({'plain':!![]});var _0x52de36=_0x2f4e('0x37');return db[_0x2f4e('0x38')]['destroy']({'where':{'type':_0x52de36,'resourceId':_0x1b6c70['id']}})[_0x2f4e('0x1d')](function(){return _0x2e3281;});})[_0x2f4e('0x1d')](function(){_0x5ab2ef[_0x2f4e('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1812b3,_0x195f10){return function(_0x42273a){if(!_0x42273a){_0x1812b3[_0x2f4e('0x28')](0x194);}return _0x42273a;};}function handleError(_0x30920a,_0x104459){_0x104459=_0x104459||0x1f4;return function(_0x2605a6){logger[_0x2f4e('0x24')](_0x2605a6['stack']);if(_0x2605a6[_0x2f4e('0x39')]){delete _0x2605a6[_0x2f4e('0x39')];}_0x30920a[_0x2f4e('0x2a')](_0x104459)[_0x2f4e('0x3a')](_0x2605a6);};}exports[_0x2f4e('0x3b')]=function(_0x3f236b,_0x4e3811){var _0x507e06={'include':[{'model':db[_0x2f4e('0x3c')],'as':_0x2f4e('0x3d')}]},_0x2bfe67={},_0x238ec8={'count':0x0,'rows':[]};var _0x32eee6=_[_0x2f4e('0x3e')](db[_0x2f4e('0x3f')][_0x2f4e('0x40')],function(_0x108c8f){return{'name':_0x108c8f[_0x2f4e('0x41')],'type':_0x108c8f[_0x2f4e('0x42')][_0x2f4e('0x43')]};});_0x2bfe67[_0x2f4e('0x44')]=_[_0x2f4e('0x3e')](_0x32eee6,_0x2f4e('0x39'));_0x2bfe67[_0x2f4e('0x45')]=_[_0x2f4e('0x46')](_0x3f236b[_0x2f4e('0x45')]);_0x2bfe67['filters']=_[_0x2f4e('0x47')](_0x2bfe67[_0x2f4e('0x44')],_0x2bfe67[_0x2f4e('0x45')]);_0x507e06[_0x2f4e('0x48')]=_[_0x2f4e('0x47')](_0x2bfe67['model'],qs[_0x2f4e('0x49')](_0x3f236b[_0x2f4e('0x45')][_0x2f4e('0x49')]));_0x507e06[_0x2f4e('0x48')]=_0x507e06[_0x2f4e('0x48')][_0x2f4e('0x4a')]?_0x507e06['attributes']:_0x2bfe67['model'];if(!_0x3f236b[_0x2f4e('0x45')][_0x2f4e('0x4b')](_0x2f4e('0x4c'))){_0x507e06[_0x2f4e('0x2e')]=qs['limit'](_0x3f236b[_0x2f4e('0x45')][_0x2f4e('0x2e')]);_0x507e06[_0x2f4e('0x2b')]=qs[_0x2f4e('0x2b')](_0x3f236b[_0x2f4e('0x45')][_0x2f4e('0x2b')]);}_0x507e06[_0x2f4e('0x4d')]=qs[_0x2f4e('0x4e')](_0x3f236b[_0x2f4e('0x45')][_0x2f4e('0x4e')]);_0x507e06[_0x2f4e('0x4f')]=qs[_0x2f4e('0x50')](_[_0x2f4e('0x51')](_0x3f236b['query'],_0x2bfe67[_0x2f4e('0x50')]),_0x32eee6);if(_0x3f236b['query']['filter']){_0x507e06[_0x2f4e('0x4f')]=_[_0x2f4e('0x52')](_0x507e06[_0x2f4e('0x4f')],{'$or':_[_0x2f4e('0x3e')](_0x32eee6,function(_0x42fde4){if(_0x42fde4[_0x2f4e('0x42')]!=='VIRTUAL'){var _0xae97b8={};_0xae97b8[_0x42fde4['name']]={'$like':'%'+_0x3f236b[_0x2f4e('0x45')][_0x2f4e('0x53')]+'%'};return _0xae97b8;}})});}_0x507e06=_[_0x2f4e('0x52')]({},_0x507e06,_0x3f236b['options']);var _0x4894e4={'where':_0x507e06['where']};return db[_0x2f4e('0x3f')]['count'](_0x4894e4)[_0x2f4e('0x1d')](function(_0x4866a5){_0x238ec8[_0x2f4e('0x2d')]=_0x4866a5;if(_0x3f236b[_0x2f4e('0x45')]['includeAll']){_0x507e06[_0x2f4e('0x54')]=[{'all':!![]}];}return db[_0x2f4e('0x3f')]['findAll'](_0x507e06);})[_0x2f4e('0x1d')](function(_0x2abfa8){_0x238ec8[_0x2f4e('0x55')]=_0x2abfa8;return _0x238ec8;})[_0x2f4e('0x1d')](respondWithFilteredResult(_0x4e3811,_0x507e06))[_0x2f4e('0x56')](handleError(_0x4e3811,null));};exports[_0x2f4e('0x57')]=function(_0x4d7444,_0x12a6f0){var _0x586d7d={'raw':![],'where':{'id':_0x4d7444[_0x2f4e('0x58')]['id']},'include':[{'model':db[_0x2f4e('0x3c')],'as':_0x2f4e('0x3d')}]},_0x5c3bcc={};_0x5c3bcc[_0x2f4e('0x44')]=_[_0x2f4e('0x46')](db['FaxAccount'][_0x2f4e('0x40')]);_0x5c3bcc[_0x2f4e('0x45')]=_[_0x2f4e('0x46')](_0x4d7444[_0x2f4e('0x45')]);_0x5c3bcc[_0x2f4e('0x50')]=_['intersection'](_0x5c3bcc[_0x2f4e('0x44')],_0x5c3bcc[_0x2f4e('0x45')]);_0x586d7d[_0x2f4e('0x48')]=_[_0x2f4e('0x47')](_0x5c3bcc['model'],qs[_0x2f4e('0x49')](_0x4d7444['query'][_0x2f4e('0x49')]));_0x586d7d[_0x2f4e('0x48')]=_0x586d7d[_0x2f4e('0x48')][_0x2f4e('0x4a')]?_0x586d7d[_0x2f4e('0x48')]:_0x5c3bcc[_0x2f4e('0x44')];if(_0x4d7444[_0x2f4e('0x45')][_0x2f4e('0x59')]){_0x586d7d[_0x2f4e('0x54')]=[{'all':!![]}];}_0x586d7d=_['merge']({},_0x586d7d,_0x4d7444['options']);return db['FaxAccount'][_0x2f4e('0x5a')](_0x586d7d)['then'](handleEntityNotFound(_0x12a6f0,null))['then'](respondWithResult(_0x12a6f0,null))['catch'](handleError(_0x12a6f0,null));};exports['create']=function(_0x40e9e3,_0x30c216){return db['FaxAccount'][_0x2f4e('0x5b')](_0x40e9e3[_0x2f4e('0x5c')],{})[_0x2f4e('0x1d')](function(_0x56ea3a){var _0x56e1ac=_0x40e9e3[_0x2f4e('0x5d')][_0x2f4e('0x36')]({'plain':!![]});if(!_0x56e1ac)throw new Error(_0x2f4e('0x5e'));if(_0x56e1ac[_0x2f4e('0x5f')]===_0x2f4e('0x5d')){var _0x47208b=_0x56ea3a[_0x2f4e('0x36')]({'plain':!![]});var _0x907c79=_0x2f4e('0x37');return db['UserProfileSection'][_0x2f4e('0x5a')]({'where':{'name':_0x907c79,'userProfileId':_0x56e1ac[_0x2f4e('0x60')]},'raw':!![]})[_0x2f4e('0x1d')](function(_0xa872e0){if(_0xa872e0&&_0xa872e0[_0x2f4e('0x61')]===0x0){return db[_0x2f4e('0x38')][_0x2f4e('0x5b')]({'name':_0x47208b['name'],'resourceId':_0x47208b['id'],'type':_0xa872e0[_0x2f4e('0x39')],'sectionId':_0xa872e0['id']},{})[_0x2f4e('0x1d')](function(){return _0x56ea3a;});}else{return _0x56ea3a;}})['catch'](function(_0xb9dd20){logger['error'](_0x2f4e('0x62'),_0xb9dd20);throw _0xb9dd20;});}return _0x56ea3a;})[_0x2f4e('0x1d')](respondWithResult(_0x30c216,0xc9))[_0x2f4e('0x56')](handleError(_0x30c216,null));};exports[_0x2f4e('0x63')]=function(_0x7ceea0,_0x467d9c){if(_0x7ceea0['body']['id']){delete _0x7ceea0[_0x2f4e('0x5c')]['id'];}return db[_0x2f4e('0x3f')][_0x2f4e('0x5a')]({'where':{'id':_0x7ceea0['params']['id']},'include':[{'model':db[_0x2f4e('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x2f4e('0x1d')](handleEntityNotFound(_0x467d9c,null))[_0x2f4e('0x1d')](saveUpdates(_0x7ceea0['body'],null))[_0x2f4e('0x1d')](respondWithResult(_0x467d9c,null))[_0x2f4e('0x56')](handleError(_0x467d9c,null));};exports[_0x2f4e('0x35')]=function(_0xc5b631,_0x4a671c){return db[_0x2f4e('0x3f')][_0x2f4e('0x5a')]({'where':{'id':_0xc5b631['params']['id']}})[_0x2f4e('0x1d')](handleEntityNotFound(_0x4a671c,null))[_0x2f4e('0x1d')](removeEntity(_0x4a671c,null))[_0x2f4e('0x56')](handleError(_0x4a671c,null));};exports[_0x2f4e('0x64')]=function(_0x426446,_0x10d75c){return db['FaxAccount'][_0x2f4e('0x64')]()[_0x2f4e('0x1d')](respondWithResult(_0x10d75c,null))[_0x2f4e('0x56')](handleError(_0x10d75c,null));};exports[_0x2f4e('0x65')]=function(_0xd2535,_0x541f9a,_0x919e4b){if(_0xd2535[_0x2f4e('0x5c')]['id']){delete _0xd2535[_0x2f4e('0x5c')]['id'];}return db[_0x2f4e('0x3f')][_0x2f4e('0x5a')]({'where':{'id':_0xd2535[_0x2f4e('0x58')]['id']}})[_0x2f4e('0x1d')](handleEntityNotFound(_0x541f9a,null))[_0x2f4e('0x1d')](function(_0x267946){if(_0x267946){_0xd2535[_0x2f4e('0x5c')][_0x2f4e('0x66')]=_0x267946['id'];return db[_0x2f4e('0x67')][_0x2f4e('0x5b')](_0xd2535['body']);}})[_0x2f4e('0x1d')](respondWithResult(_0x541f9a,null))[_0x2f4e('0x56')](handleError(_0x541f9a,null));};exports['getDispositions']=function(_0x184d42,_0x3d9898,_0x9842ff){var _0x47d12b={'raw':![],'where':{}};var _0x46316f={};var _0x574956={'count':0x0,'rows':[]};return db[_0x2f4e('0x3f')][_0x2f4e('0x68')]({'where':{'id':_0x184d42[_0x2f4e('0x58')]['id']}})[_0x2f4e('0x1d')](handleEntityNotFound(_0x3d9898,null))['then'](function(_0x18478d){if(_0x18478d){_0x46316f['model']=_[_0x2f4e('0x46')](db[_0x2f4e('0x67')][_0x2f4e('0x40')]);_0x46316f[_0x2f4e('0x45')]=_[_0x2f4e('0x46')](_0x184d42[_0x2f4e('0x45')]);_0x46316f[_0x2f4e('0x50')]=_[_0x2f4e('0x47')](_0x46316f[_0x2f4e('0x44')],_0x46316f['query']);_0x47d12b[_0x2f4e('0x48')]=_[_0x2f4e('0x47')](_0x46316f[_0x2f4e('0x44')],qs[_0x2f4e('0x49')](_0x184d42['query'][_0x2f4e('0x49')]));_0x47d12b[_0x2f4e('0x48')]=_0x47d12b[_0x2f4e('0x48')][_0x2f4e('0x4a')]?_0x47d12b[_0x2f4e('0x48')]:_0x46316f[_0x2f4e('0x44')];if(!_0x184d42[_0x2f4e('0x45')][_0x2f4e('0x4b')](_0x2f4e('0x4c'))){_0x47d12b[_0x2f4e('0x2e')]=qs[_0x2f4e('0x2e')](_0x184d42['query'][_0x2f4e('0x2e')]);_0x47d12b[_0x2f4e('0x2b')]=qs['offset'](_0x184d42[_0x2f4e('0x45')]['offset']);}_0x47d12b['order']=qs['sort'](_0x184d42[_0x2f4e('0x45')][_0x2f4e('0x4e')]);_0x47d12b['where']=qs[_0x2f4e('0x50')](_[_0x2f4e('0x51')](_0x184d42['query'],_0x46316f[_0x2f4e('0x50')]));_0x47d12b[_0x2f4e('0x4f')]['FaxAccountId']=_0x18478d['id'];if(_0x184d42[_0x2f4e('0x45')][_0x2f4e('0x53')]){_0x47d12b[_0x2f4e('0x4f')]=_['merge'](_0x47d12b[_0x2f4e('0x4f')],{'$or':_[_0x2f4e('0x3e')](_0x47d12b['attributes'],function(_0x11a164){var _0x20cd38={};_0x20cd38[_0x11a164]={'$like':'%'+_0x184d42[_0x2f4e('0x45')][_0x2f4e('0x53')]+'%'};return _0x20cd38;})});}_0x47d12b=_[_0x2f4e('0x52')]({},_0x47d12b,_0x184d42[_0x2f4e('0x69')]);return db[_0x2f4e('0x67')]['count']({'where':_0x47d12b[_0x2f4e('0x4f')]})[_0x2f4e('0x1d')](function(_0x4f883c){_0x574956[_0x2f4e('0x2d')]=_0x4f883c;if(_0x184d42[_0x2f4e('0x45')][_0x2f4e('0x59')]){_0x47d12b[_0x2f4e('0x54')]=[{'all':!![]}];}return db['Disposition'][_0x2f4e('0x6a')](_0x47d12b);})[_0x2f4e('0x1d')](function(_0x54998a){_0x574956[_0x2f4e('0x55')]=_0x54998a;return _0x574956;});}})[_0x2f4e('0x1d')](respondWithFilteredResult(_0x3d9898,_0x47d12b))[_0x2f4e('0x56')](handleError(_0x3d9898,null));};exports[_0x2f4e('0x6b')]=function(_0x285a63,_0x2d043f,_0x3e8f3f){return db[_0x2f4e('0x3f')][_0x2f4e('0x5a')]({'where':{'id':_0x285a63[_0x2f4e('0x58')]['id']}})[_0x2f4e('0x1d')](handleEntityNotFound(_0x2d043f,null))[_0x2f4e('0x1d')](function(_0x32ce00){if(_0x32ce00){return _0x32ce00[_0x2f4e('0x6b')](_0x285a63[_0x2f4e('0x45')][_0x2f4e('0x6c')]);}})[_0x2f4e('0x1d')](respondWithStatusCode(_0x2d043f,null))['catch'](handleError(_0x2d043f,null));};exports[_0x2f4e('0x6d')]=function(_0x4d7eab,_0x3e4570,_0xa25ff5){if(_0x4d7eab[_0x2f4e('0x5c')]['id']){delete _0x4d7eab['body']['id'];}return db['FaxAccount'][_0x2f4e('0x5a')]({'where':{'id':_0x4d7eab[_0x2f4e('0x58')]['id']}})[_0x2f4e('0x1d')](handleEntityNotFound(_0x3e4570,null))[_0x2f4e('0x1d')](function(_0x48ec70){if(_0x48ec70){_0x4d7eab['body'][_0x2f4e('0x66')]=_0x48ec70['id'];return db['CannedAnswer'][_0x2f4e('0x5b')](_0x4d7eab[_0x2f4e('0x5c')]);}})['then'](respondWithResult(_0x3e4570,null))[_0x2f4e('0x56')](handleError(_0x3e4570,null));};exports[_0x2f4e('0x6e')]=function(_0xb4225e,_0x24b715,_0x553a31){var _0x2aafe3={'raw':![],'where':{}};var _0x3a902f={};var _0x51f477={'count':0x0,'rows':[]};return db[_0x2f4e('0x3f')][_0x2f4e('0x68')]({'where':{'id':_0xb4225e[_0x2f4e('0x58')]['id']}})[_0x2f4e('0x1d')](handleEntityNotFound(_0x24b715,null))[_0x2f4e('0x1d')](function(_0x53b3c1){if(_0x53b3c1){_0x3a902f[_0x2f4e('0x44')]=_['keys'](db[_0x2f4e('0x6f')][_0x2f4e('0x40')]);_0x3a902f[_0x2f4e('0x45')]=_[_0x2f4e('0x46')](_0xb4225e[_0x2f4e('0x45')]);_0x3a902f['filters']=_[_0x2f4e('0x47')](_0x3a902f['model'],_0x3a902f[_0x2f4e('0x45')]);_0x2aafe3['attributes']=_['intersection'](_0x3a902f[_0x2f4e('0x44')],qs['fields'](_0xb4225e[_0x2f4e('0x45')]['fields']));_0x2aafe3['attributes']=_0x2aafe3[_0x2f4e('0x48')][_0x2f4e('0x4a')]?_0x2aafe3[_0x2f4e('0x48')]:_0x3a902f['model'];if(!_0xb4225e[_0x2f4e('0x45')][_0x2f4e('0x4b')]('nolimit')){_0x2aafe3['limit']=qs['limit'](_0xb4225e[_0x2f4e('0x45')]['limit']);_0x2aafe3[_0x2f4e('0x2b')]=qs[_0x2f4e('0x2b')](_0xb4225e[_0x2f4e('0x45')]['offset']);}_0x2aafe3[_0x2f4e('0x4d')]=qs[_0x2f4e('0x4e')](_0xb4225e['query'][_0x2f4e('0x4e')]);_0x2aafe3[_0x2f4e('0x4f')]=qs[_0x2f4e('0x50')](_[_0x2f4e('0x51')](_0xb4225e[_0x2f4e('0x45')],_0x3a902f[_0x2f4e('0x50')]));_0x2aafe3['where']['FaxAccountId']=_0x53b3c1['id'];if(_0xb4225e[_0x2f4e('0x45')]['filter']){_0x2aafe3[_0x2f4e('0x4f')]=_[_0x2f4e('0x52')](_0x2aafe3[_0x2f4e('0x4f')],{'$or':_['map'](_0x2aafe3[_0x2f4e('0x48')],function(_0x17a873){var _0xc63249={};_0xc63249[_0x17a873]={'$like':'%'+_0xb4225e['query'][_0x2f4e('0x53')]+'%'};return _0xc63249;})});}_0x2aafe3=_[_0x2f4e('0x52')]({},_0x2aafe3,_0xb4225e[_0x2f4e('0x69')]);return db[_0x2f4e('0x6f')][_0x2f4e('0x2d')]({'where':_0x2aafe3[_0x2f4e('0x4f')]})[_0x2f4e('0x1d')](function(_0x519dce){_0x51f477[_0x2f4e('0x2d')]=_0x519dce;if(_0xb4225e[_0x2f4e('0x45')][_0x2f4e('0x59')]){_0x2aafe3[_0x2f4e('0x54')]=[{'all':!![]}];}return db[_0x2f4e('0x6f')][_0x2f4e('0x6a')](_0x2aafe3);})[_0x2f4e('0x1d')](function(_0x19ce7b){_0x51f477[_0x2f4e('0x55')]=_0x19ce7b;return _0x51f477;});}})['then'](respondWithFilteredResult(_0x24b715,_0x2aafe3))[_0x2f4e('0x56')](handleError(_0x24b715,null));};exports[_0x2f4e('0x70')]=function(_0x10571b,_0x1cb37a,_0x32f5e3){return db['FaxAccount'][_0x2f4e('0x5a')]({'where':{'id':_0x10571b[_0x2f4e('0x58')]['id']}})[_0x2f4e('0x1d')](handleEntityNotFound(_0x1cb37a,null))['then'](function(_0x5d5fd3){if(_0x5d5fd3){return _0x5d5fd3['removeAnswers'](_0x10571b[_0x2f4e('0x45')][_0x2f4e('0x6c')]);}})[_0x2f4e('0x1d')](respondWithStatusCode(_0x1cb37a,null))[_0x2f4e('0x56')](handleError(_0x1cb37a,null));};exports[_0x2f4e('0x71')]=function(_0x42e5cc,_0x5ae937,_0x332d2f){return db[_0x2f4e('0x72')]['find']({'where':{'id':_0x42e5cc[_0x2f4e('0x58')]['id']}})['then'](handleEntityNotFound(_0x5ae937,null))[_0x2f4e('0x1d')](function(_0xb25f){if(_0xb25f){return _0xb25f[_0x2f4e('0x71')](_0x42e5cc[_0x2f4e('0x5c')][_0x2f4e('0x6c')],_[_0x2f4e('0x73')](_0x42e5cc['body'],[_0x2f4e('0x6c'),'id'])||{});}})[_0x2f4e('0x1d')](respondWithResult(_0x5ae937,null))[_0x2f4e('0x56')](handleError(_0x5ae937,null));};exports['getInteractions']=function(_0x550ac2,_0x24755a,_0x1b6cf8){var _0x134046={'raw':![],'where':{}};var _0x4d3289={};var _0x3f57cd={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x550ac2[_0x2f4e('0x58')]['id']}})[_0x2f4e('0x1d')](handleEntityNotFound(_0x24755a,null))[_0x2f4e('0x1d')](function(_0x6eef3d){if(_0x6eef3d){_0x4d3289[_0x2f4e('0x44')]=_['keys'](db[_0x2f4e('0x72')][_0x2f4e('0x40')]);_0x4d3289[_0x2f4e('0x45')]=_[_0x2f4e('0x46')](_0x550ac2[_0x2f4e('0x45')]);_0x4d3289['filters']=_[_0x2f4e('0x47')](_0x4d3289[_0x2f4e('0x44')],_0x4d3289['query']);_0x134046[_0x2f4e('0x48')]=_[_0x2f4e('0x47')](_0x4d3289['model'],qs['fields'](_0x550ac2[_0x2f4e('0x45')][_0x2f4e('0x49')]));_0x134046['attributes']=_0x134046[_0x2f4e('0x48')][_0x2f4e('0x4a')]?_0x134046[_0x2f4e('0x48')]:_0x4d3289[_0x2f4e('0x44')];if(!_0x550ac2[_0x2f4e('0x45')][_0x2f4e('0x4b')](_0x2f4e('0x4c'))){_0x134046[_0x2f4e('0x2e')]=qs[_0x2f4e('0x2e')](_0x550ac2[_0x2f4e('0x45')][_0x2f4e('0x2e')]);_0x134046[_0x2f4e('0x2b')]=qs[_0x2f4e('0x2b')](_0x550ac2[_0x2f4e('0x45')]['offset']);}_0x134046[_0x2f4e('0x4d')]=qs['sort'](_0x550ac2[_0x2f4e('0x45')][_0x2f4e('0x4e')]);_0x134046[_0x2f4e('0x4f')]=qs['filters'](_[_0x2f4e('0x51')](_0x550ac2[_0x2f4e('0x45')],_0x4d3289[_0x2f4e('0x50')]));_0x134046[_0x2f4e('0x4f')]['FaxAccountId']=_0x6eef3d['id'];if(_0x550ac2[_0x2f4e('0x45')][_0x2f4e('0x53')]){_0x134046['where']=_['merge'](_0x134046['where'],{'$or':_['map'](_0x134046[_0x2f4e('0x48')],function(_0x23464d){var _0x1dc6b3={};_0x1dc6b3[_0x23464d]={'$like':'%'+_0x550ac2[_0x2f4e('0x45')][_0x2f4e('0x53')]+'%'};return _0x1dc6b3;})});}_0x134046=_['merge']({},_0x134046,_0x550ac2[_0x2f4e('0x69')]);return db[_0x2f4e('0x72')][_0x2f4e('0x2d')]({'where':_0x134046[_0x2f4e('0x4f')]})[_0x2f4e('0x1d')](function(_0x17b491){_0x3f57cd[_0x2f4e('0x2d')]=_0x17b491;if(_0x550ac2['query'][_0x2f4e('0x59')]){_0x134046[_0x2f4e('0x54')]=[{'model':db[_0x2f4e('0x74')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x2f4e('0x75'),'attributes':[_0x2f4e('0x39'),_0x2f4e('0x76'),_0x2f4e('0x77')],'required':![]},{'model':db[_0x2f4e('0x78')],'as':_0x2f4e('0x79'),'attributes':['id','name',_0x2f4e('0x7a')],'where':_0x550ac2[_0x2f4e('0x45')][_0x2f4e('0x7b')]?{'id':_0x550ac2['query'][_0x2f4e('0x7b')]}:undefined,'required':_0x550ac2[_0x2f4e('0x45')][_0x2f4e('0x7b')]?!![]:![]}];}return db['FaxInteraction'][_0x2f4e('0x6a')](_0x134046);})[_0x2f4e('0x1d')](function(_0x436ae7){_0x3f57cd['rows']=_0x436ae7;return _0x3f57cd;});}})['then'](respondWithFilteredResult(_0x24755a,_0x134046))[_0x2f4e('0x56')](handleError(_0x24755a,null));};exports['addApplications']=function(_0x2045c8,_0x26ade8){var _0x344715=_0x2045c8[_0x2f4e('0x58')]['id'];var _0x1996f0=_0x2045c8['body'];var _0x34e22e=0xc8;var _0x37de5f=null;return db[_0x2f4e('0x7c')][_0x2f4e('0x7d')]({'isolationLevel':db['sequelize'][_0x2f4e('0x7e')][_0x2f4e('0x7f')][_0x2f4e('0x80')]},function(_0xd6d3c5){return db[_0x2f4e('0x3f')]['findOne']({'where':{'id':_0x344715},'transaction':_0xd6d3c5})[_0x2f4e('0x1d')](function(_0x95ac4e){if(_0x95ac4e){return db[_0x2f4e('0x81')][_0x2f4e('0x35')]({'where':{'FaxAccountId':_0x344715},'transaction':_0xd6d3c5})['then'](function(){var _0x40976f=_[_0x2f4e('0x3e')](_0x1996f0,function(_0x430389){_0x430389[_0x2f4e('0x66')]=_0x344715;return _0x430389;});return db[_0x2f4e('0x81')]['bulkCreate'](_0x40976f,{'transaction':_0xd6d3c5});});}else{_0x34e22e=0x194;_0x37de5f=[];}});})[_0x2f4e('0x1d')](function(){if(_0x34e22e!==0x194){return db[_0x2f4e('0x81')][_0x2f4e('0x82')]({'where':{'FaxAccountId':_0x344715},'order':_0x2f4e('0x83')})[_0x2f4e('0x1d')](function(_0x3a1303){_0x37de5f=_0x3a1303;});}})[_0x2f4e('0x56')](function(_0x701ca2){_0x34e22e=0x1f4;logger[_0x2f4e('0x24')](_0x701ca2['stack']);if(_0x701ca2[_0x2f4e('0x39')]){delete _0x701ca2[_0x2f4e('0x39')];}_0x37de5f=_0x701ca2;})['finally'](function(){if(_0x37de5f===null){_0x26ade8[_0x2f4e('0x28')](_0x34e22e);}else{if(_0x34e22e===0x1f4){_0x26ade8[_0x2f4e('0x2a')](_0x34e22e)[_0x2f4e('0x3a')](_0x37de5f);}else{_0x26ade8[_0x2f4e('0x2a')](_0x34e22e)[_0x2f4e('0x31')](_0x37de5f);}}});};exports[_0x2f4e('0x84')]=function(_0x109a49,_0x5c2b4d,_0x447097){var _0x1ca32c={};var _0x187637={};var _0x2804fc;var _0x4b23ea;return db[_0x2f4e('0x3f')]['findOne']({'where':{'id':_0x109a49[_0x2f4e('0x58')]['id']}})[_0x2f4e('0x1d')](handleEntityNotFound(_0x5c2b4d,null))[_0x2f4e('0x1d')](function(_0x56444e){if(_0x56444e){_0x2804fc=_0x56444e;_0x187637[_0x2f4e('0x44')]=_['keys'](db[_0x2f4e('0x81')][_0x2f4e('0x40')]);_0x187637[_0x2f4e('0x45')]=_['keys'](_0x109a49['query']);_0x187637[_0x2f4e('0x50')]=_[_0x2f4e('0x47')](_0x187637['model'],_0x187637[_0x2f4e('0x45')]);_0x1ca32c[_0x2f4e('0x48')]=_[_0x2f4e('0x47')](_0x187637[_0x2f4e('0x44')],qs[_0x2f4e('0x49')](_0x109a49[_0x2f4e('0x45')][_0x2f4e('0x49')]));_0x1ca32c[_0x2f4e('0x48')]=_0x1ca32c[_0x2f4e('0x48')]['length']?_0x1ca32c[_0x2f4e('0x48')]:_0x187637[_0x2f4e('0x44')];_0x1ca32c['order']=qs[_0x2f4e('0x4e')](_0x109a49[_0x2f4e('0x45')][_0x2f4e('0x4e')]);_0x1ca32c[_0x2f4e('0x4f')]=qs['filters'](_[_0x2f4e('0x51')](_0x109a49['query'],_0x187637[_0x2f4e('0x50')]));if(_0x109a49['query']['filter']){_0x1ca32c[_0x2f4e('0x4f')]=_[_0x2f4e('0x52')](_0x1ca32c[_0x2f4e('0x4f')],{'$or':_[_0x2f4e('0x3e')](_0x1ca32c[_0x2f4e('0x48')],function(_0x183b95){var _0xb11de5={};_0xb11de5[_0x183b95]={'$like':'%'+_0x109a49[_0x2f4e('0x45')][_0x2f4e('0x53')]+'%'};return _0xb11de5;})});}_0x1ca32c=_[_0x2f4e('0x52')]({},_0x1ca32c,_0x109a49[_0x2f4e('0x69')]);return _0x2804fc[_0x2f4e('0x84')](_0x1ca32c);}})[_0x2f4e('0x1d')](function(_0x52f301){if(_0x52f301){_0x4b23ea=_0x52f301[_0x2f4e('0x4a')];if(!_0x109a49[_0x2f4e('0x45')][_0x2f4e('0x4b')]('nolimit')){_0x1ca32c[_0x2f4e('0x2e')]=qs[_0x2f4e('0x2e')](_0x109a49[_0x2f4e('0x45')][_0x2f4e('0x2e')]);_0x1ca32c[_0x2f4e('0x2b')]=qs[_0x2f4e('0x2b')](_0x109a49[_0x2f4e('0x45')]['offset']);}return _0x2804fc[_0x2f4e('0x84')](_0x1ca32c);}})[_0x2f4e('0x1d')](function(_0x3ac547){if(_0x3ac547){return _0x3ac547?{'count':_0x4b23ea,'rows':_0x3ac547}:null;}})[_0x2f4e('0x1d')](respondWithResult(_0x5c2b4d,null))[_0x2f4e('0x56')](handleError(_0x5c2b4d,null));};function Extension(_0x5d64a1,_0x359583,_0x292c0c,_0x3da39a){this[_0x2f4e('0x85')]=_0x2f4e('0x86');this['exten']=_0x5d64a1['localstationid'];this['app']=_0x3da39a;this[_0x2f4e('0x42')]=_0x2f4e('0x87');this[_0x2f4e('0x88')]='Fax\x20Extension';this[_0x2f4e('0x66')]=_0x5d64a1['id'];this[_0x2f4e('0x83')]=_0x359583;this[_0x2f4e('0x89')]=_0x292c0c;}function createExtensionsReciveFax(_0x25e770){var _0x2281d7=0x1;var _0x4aff71=[];_0x4aff71[_0x2f4e('0x8a')](new Extension(_0x25e770,_0x2281d7,'',_0x2f4e('0x8b')));_0x2281d7+=0x1;_0x4aff71['push'](new Extension(_0x25e770,_0x2281d7,_0x2f4e('0x8c'),_0x2f4e('0x8d')));_0x2281d7+=0x1;for(var _0x2dfd35 in _0x25e770){if(_0x25e770[_0x2f4e('0x4b')](_0x2dfd35)&&(_0x2dfd35===_0x2f4e('0x8e')||_0x2dfd35===_0x2f4e('0x8f')||_0x2dfd35==='gateway'||_0x2dfd35===_0x2f4e('0x90')||_0x2dfd35==='headerinfo'||_0x2dfd35===_0x2f4e('0x91')||_0x2dfd35===_0x2f4e('0x92')||_0x2dfd35===_0x2f4e('0x93')||_0x2dfd35===_0x2f4e('0x94'))){_0x4aff71['push'](new Extension(_0x25e770,_0x2281d7,'FAXOPT('+_0x2dfd35+')='+_0x25e770[_0x2dfd35],_0x2f4e('0x8d')));_0x2281d7+=0x1;}}_0x4aff71[_0x2f4e('0x8a')](new Extension(_0x25e770,_0x2281d7,'6',_0x2f4e('0x95')));_0x2281d7+=0x1;_0x4aff71[_0x2f4e('0x8a')](new Extension(_0x25e770,_0x2281d7,'/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',_0x2f4e('0x96')));_0x2281d7=0x0;return _0x4aff71;}exports[_0x2f4e('0x97')]=function(_0x5574db,_0x33b407,_0x454906){var _0x5c70b4;return db[_0x2f4e('0x7c')][_0x2f4e('0x7d')](function(_0x15f5ce){return db[_0x2f4e('0x3f')][_0x2f4e('0x5b')](_0x5574db['body'],{'transaction':_0x15f5ce})[_0x2f4e('0x1d')](function(_0x3e1feb){_0x5c70b4=_0x3e1feb['get']({'plain':!![]});return db['VoiceExtension'][_0x2f4e('0x98')](createExtensionsReciveFax(_0x5c70b4),{'transaction':_0x15f5ce});});})['then'](function(){return _0x5c70b4;})[_0x2f4e('0x1d')](respondWithResult(_0x33b407,null))[_0x2f4e('0x56')](handleError(_0x33b407,null));};exports[_0x2f4e('0x99')]=function(_0x3a70f7,_0x685d23,_0x10ba85){var _0x47901d;return db['sequelize'][_0x2f4e('0x7d')](function(_0x53aafa){return db[_0x2f4e('0x3f')][_0x2f4e('0x63')](_0x3a70f7[_0x2f4e('0x5c')],{'where':{'id':_0x3a70f7[_0x2f4e('0x5c')]['id']},'transaction':_0x53aafa})[_0x2f4e('0x1d')](function(_0x29d6e8){return db[_0x2f4e('0x9a')][_0x2f4e('0x35')]({'where':{'FaxAccountId':_0x3a70f7[_0x2f4e('0x5c')]['id']},'transaction':_0x53aafa})['then'](function(_0x21db71){return db[_0x2f4e('0x9a')][_0x2f4e('0x98')](createExtensionsReciveFax(_[_0x2f4e('0x73')](_0x3a70f7[_0x2f4e('0x5c')],[_0x2f4e('0x9b'),'key','createdAt','updatedAt',_0x2f4e('0x9c'),'ListId'])),{'transaction':_0x53aafa});});});})[_0x2f4e('0x1d')](function(){return db[_0x2f4e('0x3f')]['findById'](_0x3a70f7[_0x2f4e('0x5c')]['id']);})['then'](respondWithResult(_0x685d23,null))['catch'](handleError(_0x685d23,null));};exports[_0x2f4e('0x9d')]=function(_0x41e4ab,_0x5662c8,_0x42f3c4){var _0xe3b7db={'raw':!![],'where':{}};var _0x1937f6={};var _0x784f0e={'count':0x0,'rows':[]};return db[_0x2f4e('0x3f')][_0x2f4e('0x68')]({'where':{'id':_0x41e4ab[_0x2f4e('0x58')]['id']}})[_0x2f4e('0x1d')](handleEntityNotFound(_0x5662c8,null))['then'](function(_0xbe433){if(_0xbe433){_0x1937f6[_0x2f4e('0x44')]=_[_0x2f4e('0x46')](db['FaxMessage']['rawAttributes']);_0x1937f6[_0x2f4e('0x45')]=_[_0x2f4e('0x46')](_0x41e4ab[_0x2f4e('0x45')]);_0x1937f6[_0x2f4e('0x50')]=_[_0x2f4e('0x47')](_0x1937f6[_0x2f4e('0x44')],_0x1937f6[_0x2f4e('0x45')]);_0xe3b7db['attributes']=_[_0x2f4e('0x47')](_0x1937f6[_0x2f4e('0x44')],qs[_0x2f4e('0x49')](_0x41e4ab[_0x2f4e('0x45')]['fields']));_0xe3b7db[_0x2f4e('0x48')]=_0xe3b7db[_0x2f4e('0x48')][_0x2f4e('0x4a')]?_0xe3b7db[_0x2f4e('0x48')]:_0x1937f6['model'];if(!_0x41e4ab[_0x2f4e('0x45')][_0x2f4e('0x4b')](_0x2f4e('0x4c'))){_0xe3b7db['limit']=qs[_0x2f4e('0x2e')](_0x41e4ab[_0x2f4e('0x45')][_0x2f4e('0x2e')]);_0xe3b7db[_0x2f4e('0x2b')]=qs[_0x2f4e('0x2b')](_0x41e4ab[_0x2f4e('0x45')]['offset']);}_0xe3b7db[_0x2f4e('0x4d')]=qs[_0x2f4e('0x4e')](_0x41e4ab[_0x2f4e('0x45')][_0x2f4e('0x4e')]);_0xe3b7db[_0x2f4e('0x4f')]=qs[_0x2f4e('0x50')](_[_0x2f4e('0x51')](_0x41e4ab[_0x2f4e('0x45')],_0x1937f6[_0x2f4e('0x50')]));_0xe3b7db[_0x2f4e('0x4f')][_0x2f4e('0x66')]=_0xbe433['id'];if(_0x41e4ab['query']['filter']){_0xe3b7db[_0x2f4e('0x4f')]=_['merge'](_0xe3b7db['where'],{'$or':_['map'](_0xe3b7db[_0x2f4e('0x48')],function(_0x49c7c8){var _0x35eb1c={};_0x35eb1c[_0x49c7c8]={'$like':'%'+_0x41e4ab[_0x2f4e('0x45')]['filter']+'%'};return _0x35eb1c;})});}if(_0x41e4ab[_0x2f4e('0x45')][_0x2f4e('0x9e')]){var _0x5c236e=_0x41e4ab[_0x2f4e('0x45')][_0x2f4e('0x9e')][_0x2f4e('0x9f')](',');var _0x579904={};_0x579904[_0x5c236e[0x0]]={'$gte':moment(_0x5c236e[0x1])['format'](_0x2f4e('0xa0'))};_0xe3b7db[_0x2f4e('0x4f')]=_['merge'](_0xe3b7db[_0x2f4e('0x4f')],_0x579904);}_0xe3b7db=_[_0x2f4e('0x52')]({},_0xe3b7db,_0x41e4ab[_0x2f4e('0x69')]);return db[_0x2f4e('0xa1')][_0x2f4e('0x2d')]({'where':_0xe3b7db['where']})[_0x2f4e('0x1d')](function(_0x1d69e6){_0x784f0e[_0x2f4e('0x2d')]=_0x1d69e6;if(_0x41e4ab[_0x2f4e('0x45')][_0x2f4e('0x59')]){_0xe3b7db[_0x2f4e('0x54')]=[{'all':!![]}];}return db[_0x2f4e('0xa1')]['findAll'](_0xe3b7db);})['then'](function(_0x14c68e){_0x784f0e[_0x2f4e('0x55')]=_0x14c68e;return _0x784f0e;});}})['then'](respondWithFilteredResult(_0x5662c8,_0xe3b7db))[_0x2f4e('0x56')](handleError(_0x5662c8,null));};exports[_0x2f4e('0x3a')]=function(_0x46af56,_0x40d369,_0x228da8){var _0x1a3794,_0x51a1c9={},_0x1ae1fb;if(_0x46af56['body']['to']){_0x1ae1fb=_0x46af56[_0x2f4e('0x5c')]['to'][0x0];}return db[_0x2f4e('0x3f')][_0x2f4e('0x5a')]({'where':{'id':_0x46af56[_0x2f4e('0x58')]['id']},'include':[{'model':db[_0x2f4e('0xa2')],'as':_0x2f4e('0xa3'),'include':[{'model':db[_0x2f4e('0x74')],'as':_0x2f4e('0xa4'),'where':{'fax':_0x1ae1fb},'limit':0x1,'order':[[_0x2f4e('0xa5'),_0x2f4e('0xa6')]]}]}]})[_0x2f4e('0x1d')](handleEntityNotFound(_0x40d369,null))[_0x2f4e('0x1d')](function(_0x433380){_0x1a3794=_0x433380;if(_0x46af56[_0x2f4e('0x5c')][_0x2f4e('0xa7')]&&_0x46af56[_0x2f4e('0x5c')]['attachments'][_0x2f4e('0x4a')]){for(var _0x9c921d=0x0;_0x9c921d<_0x46af56['body'][_0x2f4e('0xa7')][_0x2f4e('0x4a')];_0x9c921d+=0x1){_0x46af56[_0x2f4e('0x5c')]['attachments'][_0x9c921d]={'filename':_0x46af56[_0x2f4e('0x5c')][_0x2f4e('0xa7')][_0x9c921d]['name'],'id':_0x46af56[_0x2f4e('0x5c')][_0x2f4e('0xa7')][_0x9c921d]['id'],'path':path[_0x2f4e('0xa8')](config[_0x2f4e('0xa9')],_0x2f4e('0xaa'),_0x46af56[_0x2f4e('0x5c')][_0x2f4e('0xa7')][_0x9c921d][_0x2f4e('0xab')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_['isNil'](_0x46af56[_0x2f4e('0x58')]['id'])?undefined:_0x46af56[_0x2f4e('0x58')]['id'],'path':_[_0x2f4e('0xac')](_0x46af56['body'][_0x2f4e('0xa7')][0x0][_0x2f4e('0xad')])?undefined:_0x46af56['body'][_0x2f4e('0xa7')][0x0][_0x2f4e('0xad')],'fax':_[_0x2f4e('0xac')](_0x46af56[_0x2f4e('0x5c')]['to'][0x0])?undefined:_0x46af56['body']['to'][0x0]},client9002);})[_0x2f4e('0x1d')](function(){if(_0x1a3794){if(_[_0x2f4e('0xac')](_0x46af56[_0x2f4e('0x5c')]['from'])){_0x46af56[_0x2f4e('0x5c')][_0x2f4e('0xae')]=util[_0x2f4e('0xaf')](_0x2f4e('0xb0'),_0x1a3794[_0x2f4e('0x39')],_0x1a3794[_0x2f4e('0xb1')]);}if(_0x1a3794[_0x2f4e('0xa3')]){if(_0x1a3794[_0x2f4e('0xa3')][_0x2f4e('0xa4')][_0x2f4e('0x4a')]){return _0x1a3794['List']['Contacts'][0x0];}else{return db['CmContact']['create'](_[_0x2f4e('0xb2')](_0x46af56[_0x2f4e('0x5c')],{'firstName':_0x46af56['body']['to'][0x0],'phone':_0x46af56[_0x2f4e('0x5c')]['to'][0x0],'fax':_0x46af56['body']['to'][0x0],'ListId':_0x1a3794[_0x2f4e('0xb3')]}));}}else{throw new Error(_0x2f4e('0xb4'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x2f4e('0x1d')](function(_0x113db2){if(_0x113db2){return db[_0x2f4e('0x72')][_0x2f4e('0x5a')]({'where':{'ContactId':_0x113db2['id'],'closed':![],'FaxAccountId':_0x1a3794['id']}})[_0x2f4e('0x1d')](function(_0x2238f3){if(_0x2238f3){return[_0x2238f3,![]];}return db['FaxInteraction']['create']({'UserId':_0x46af56[_0x2f4e('0x5d')]['id'],'ContactId':_0x113db2['id'],'FaxAccountId':_0x1a3794['id'],'fax':_0x46af56[_0x2f4e('0x5c')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x2f4e('0x52')](_0x46af56[_0x2f4e('0x5c')],{'read':![],'body':_0x46af56[_0x2f4e('0x5c')]['attachments'][0x0][_0x2f4e('0xb5')],'FaxAccountId':_0x1a3794['id'],'UserId':_0x46af56[_0x2f4e('0x5d')]['id'],'ContactId':_0x113db2['id'],'AttachmentId':_0x46af56['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x2f4e('0xa1')],'as':_0x2f4e('0xb6')}]})['then'](function(_0x215000){return[_0x215000,!![]];});});}else{throw new Error(_0x2f4e('0xb7'));}})[_0x2f4e('0xb8')](function(_0x5e42fb,_0x5f10bb){if(_0x5f10bb){return _0x5e42fb;}return db[_0x2f4e('0xa1')][_0x2f4e('0x5b')]({'direction':_0x2f4e('0xb9'),'read':![],'body':_0x46af56['body'][_0x2f4e('0xa7')][0x0][_0x2f4e('0xb5')],'FaxAccountId':_0x1a3794['id'],'FaxInteractionId':_0x5e42fb['id'],'UserId':_0x46af56[_0x2f4e('0x5d')]['id'],'ContactId':_0x5e42fb['ContactId'],'AttachmentId':_0x46af56[_0x2f4e('0x5c')]['attachments'][0x0]['id']})[_0x2f4e('0x1d')](function(_0x2aac2b){_0x5e42fb[_0x2f4e('0xba')][_0x2f4e('0xb6')]=[];_0x5e42fb[_0x2f4e('0xba')][_0x2f4e('0xb6')][_0x2f4e('0x8a')](_0x2aac2b['dataValues']);return _0x5e42fb;});})[_0x2f4e('0x1d')](function(_0xae59d8){respondWithRpcPromise(_0x2f4e('0xbb'),_0x2f4e('0xbb'),{'FaxAccountId':_[_0x2f4e('0xac')](_0x46af56['params']['id'])?undefined:_0x46af56[_0x2f4e('0x58')]['id'],'path':_[_0x2f4e('0xac')](_0x46af56['body'][_0x2f4e('0xa7')][0x0][_0x2f4e('0xad')])?undefined:_0x46af56['body'][_0x2f4e('0xa7')][0x0][_0x2f4e('0xad')],'fax':_['isNil'](_0x46af56[_0x2f4e('0x5c')]['to'][0x0])?undefined:_0x46af56[_0x2f4e('0x5c')]['to'][0x0],'AttachmentId':_0x46af56['body'][_0x2f4e('0xa7')][0x0]['id']},client9002)[_0x2f4e('0x1d')](function(_0x4d9b19){logger[_0x2f4e('0x1e')]('SendFaxRpc,\x20%s',_0x4d9b19);})['catch'](function(_0x167543){logger[_0x2f4e('0x1e')](_0x2f4e('0xbc'),_0x167543);});return _0xae59d8;})['then'](respondWithResult(_0x40d369,null))[_0x2f4e('0x56')](handleError(_0x40d369,null));};exports['addAgents']=function(_0x1cbc95,_0x28dec2,_0x3154f3){return db['FaxAccount'][_0x2f4e('0x5a')]({'where':{'id':_0x1cbc95[_0x2f4e('0x58')]['id']}})[_0x2f4e('0x1d')](handleEntityNotFound(_0x28dec2,null))[_0x2f4e('0x1d')](function(_0x5269de){if(_0x5269de){return _0x5269de[_0x2f4e('0xbd')](_0x1cbc95[_0x2f4e('0x5c')][_0x2f4e('0x6c')],_[_0x2f4e('0x73')](_0x1cbc95[_0x2f4e('0x5c')],['ids','id'])||{})[_0x2f4e('0xb8')](function(_0x562929){for(var _0x400333=0x0;_0x400333<_0x1cbc95[_0x2f4e('0x5c')][_0x2f4e('0x6c')][_0x2f4e('0x4a')];_0x400333+=0x1){socket[_0x2f4e('0xbe')](_0x2f4e('0xbf'),{'UserId':Number(_0x1cbc95['body'][_0x2f4e('0x6c')][_0x400333]),'FaxAccountId':Number(_0x1cbc95[_0x2f4e('0x58')]['id'])});}return _0x562929;});}})[_0x2f4e('0x1d')](respondWithResult(_0x28dec2,null))['catch'](handleError(_0x28dec2,null));};exports['removeAgents']=function(_0x5b6b78,_0x290f19,_0x56fe80){return db[_0x2f4e('0x3f')][_0x2f4e('0x5a')]({'where':{'id':_0x5b6b78[_0x2f4e('0x58')]['id']}})['then'](handleEntityNotFound(_0x290f19,null))[_0x2f4e('0x1d')](function(_0x3b38fa){if(_0x3b38fa){return _0x3b38fa[_0x2f4e('0xc0')](_0x5b6b78[_0x2f4e('0x45')]['ids'])[_0x2f4e('0x1d')](function(){if(_[_0x2f4e('0xc1')](_0x5b6b78['query'][_0x2f4e('0x6c')])){for(var _0x475960=0x0;_0x475960<_0x5b6b78['query'][_0x2f4e('0x6c')][_0x2f4e('0x4a')];_0x475960+=0x1){socket[_0x2f4e('0xbe')](_0x2f4e('0xc2'),{'UserId':Number(_0x5b6b78[_0x2f4e('0x45')][_0x2f4e('0x6c')][_0x475960]),'FaxAccountId':Number(_0x5b6b78[_0x2f4e('0x58')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x5b6b78['query'][_0x2f4e('0x6c')]),'FaxAccountId':Number(_0x5b6b78[_0x2f4e('0x58')]['id'])});}});}})[_0x2f4e('0x1d')](respondWithStatusCode(_0x290f19,null))[_0x2f4e('0x56')](handleError(_0x290f19,null));};exports[_0x2f4e('0xc3')]=function(_0x2fa0d9,_0x8a6549,_0xf9cf16){var _0x31fab1={};var _0x1b8f19={};var _0x1d0cbf;var _0x19aab8;return db[_0x2f4e('0x3f')][_0x2f4e('0x68')]({'where':{'id':_0x2fa0d9[_0x2f4e('0x58')]['id']}})[_0x2f4e('0x1d')](handleEntityNotFound(_0x8a6549,null))[_0x2f4e('0x1d')](function(_0x14cbbf){if(_0x14cbbf){_0x1d0cbf=_0x14cbbf;_0x1b8f19[_0x2f4e('0x44')]=_[_0x2f4e('0x46')](db[_0x2f4e('0xc4')][_0x2f4e('0x40')]);_0x1b8f19[_0x2f4e('0x45')]=_[_0x2f4e('0x46')](_0x2fa0d9[_0x2f4e('0x45')]);_0x1b8f19[_0x2f4e('0x50')]=_[_0x2f4e('0x47')](_0x1b8f19[_0x2f4e('0x44')],_0x1b8f19[_0x2f4e('0x45')]);_0x31fab1[_0x2f4e('0x48')]=_[_0x2f4e('0x47')](_0x1b8f19[_0x2f4e('0x44')],qs['fields'](_0x2fa0d9[_0x2f4e('0x45')]['fields']));_0x31fab1['attributes']=_0x31fab1['attributes'][_0x2f4e('0x4a')]?_0x31fab1[_0x2f4e('0x48')]:_0x1b8f19[_0x2f4e('0x44')];_0x31fab1[_0x2f4e('0x4d')]=qs[_0x2f4e('0x4e')](_0x2fa0d9['query']['sort']);_0x31fab1['where']=qs[_0x2f4e('0x50')](_['pick'](_0x2fa0d9['query'],_0x1b8f19['filters']));if(_0x2fa0d9[_0x2f4e('0x45')][_0x2f4e('0x53')]){_0x31fab1[_0x2f4e('0x4f')]=_[_0x2f4e('0x52')](_0x31fab1[_0x2f4e('0x4f')],{'$or':_[_0x2f4e('0x3e')](_0x31fab1['attributes'],function(_0xa1063c){var _0x3ac6f3={};_0x3ac6f3[_0xa1063c]={'$like':'%'+_0x2fa0d9[_0x2f4e('0x45')]['filter']+'%'};return _0x3ac6f3;})});}_0x31fab1=_[_0x2f4e('0x52')]({},_0x31fab1,_0x2fa0d9[_0x2f4e('0x69')]);return _0x1d0cbf[_0x2f4e('0xc3')](_0x31fab1);}})[_0x2f4e('0x1d')](function(_0xf2b604){if(_0xf2b604){_0x19aab8=_0xf2b604['length'];if(!_0x2fa0d9[_0x2f4e('0x45')][_0x2f4e('0x4b')](_0x2f4e('0x4c'))){_0x31fab1[_0x2f4e('0x2e')]=qs[_0x2f4e('0x2e')](_0x2fa0d9[_0x2f4e('0x45')][_0x2f4e('0x2e')]);_0x31fab1[_0x2f4e('0x2b')]=qs[_0x2f4e('0x2b')](_0x2fa0d9[_0x2f4e('0x45')][_0x2f4e('0x2b')]);}return _0x1d0cbf[_0x2f4e('0xc3')](_0x31fab1);}})['then'](function(_0xcf0ca0){if(_0xcf0ca0){return _0xcf0ca0?{'count':_0x19aab8,'rows':_0xcf0ca0}:null;}})[_0x2f4e('0x1d')](respondWithResult(_0x8a6549,null))['catch'](handleError(_0x8a6549,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 7942846..4f79e33 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 _0xa76a=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa76a,0xad));var _0xaa76=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa76a[_0x5c351c];return _0x26f3b3;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xaa76('0x0'))['db'][_0xaa76('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xaa76('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaa76('0x3'),'afterDestroy':_0xaa76('0x4')};function emitEvent(_0x3c5bab){return function(_0x3778ba,_0x344e9d,_0xe59019){FaxAccountEvents[_0xaa76('0x5')](_0x3c5bab+':'+_0x3778ba['id'],_0x3778ba);FaxAccountEvents[_0xaa76('0x5')](_0x3c5bab,_0x3778ba);_0xe59019(null);};}for(var e in events){if(events[_0xaa76('0x6')](e)){var event=events[e];FaxAccount[_0xaa76('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x68b4=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x10a55a,_0x171fa0){var _0x58accd=function(_0x3e5a06){while(--_0x3e5a06){_0x10a55a['push'](_0x10a55a['shift']());}};_0x58accd(++_0x171fa0);}(_0x68b4,0xff));var _0x468b=function(_0x110d06,_0x400891){_0x110d06=_0x110d06-0x0;var _0x55fecb=_0x68b4[_0x110d06];return _0x55fecb;};'use strict';var EventEmitter=require(_0x468b('0x0'));var FaxAccount=require(_0x468b('0x1'))['db'][_0x468b('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x468b('0x3')](0x0);var events={'afterCreate':_0x468b('0x4'),'afterUpdate':_0x468b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3e9295){return function(_0x92bd08,_0x37b3b4,_0x19300e){FaxAccountEvents[_0x468b('0x6')](_0x3e9295+':'+_0x92bd08['id'],_0x92bd08);FaxAccountEvents[_0x468b('0x6')](_0x3e9295,_0x92bd08);_0x19300e(null);};}for(var e in events){if(events[_0x468b('0x7')](e)){var event=events[e];FaxAccount[_0x468b('0x8')](e,emitEvent(event));}}module[_0x468b('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index f641239..9da1cc3 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 _0xa6c6=['./faxAccount.attributes','define','fax_accounts','util','moment','path','rimraf','../../config/environment'];(function(_0x3114af,_0x482e75){var _0xf4a23=function(_0x148507){while(--_0x148507){_0x3114af['push'](_0x3114af['shift']());}};_0xf4a23(++_0x482e75);}(_0xa6c6,0x14b));var _0x6a6c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa6c6[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x6a6c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x6a6c('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a6c('0x2'));var rimraf=require(_0x6a6c('0x3'));var config=require(_0x6a6c('0x4'));var attributes=require(_0x6a6c('0x5'));module['exports']=function(_0x2997b5,_0x55bb60){return _0x2997b5[_0x6a6c('0x6')]('FaxAccount',attributes,{'tableName':_0x6a6c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06e2=['define','FaxAccount','fax_accounts','../../config/logger','api','path','rimraf','../../config/environment','./faxAccount.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x06e2,0x1c5));var _0x206e=function(_0x196736,_0x2d674a){_0x196736=_0x196736-0x0;var _0x1713c2=_0x06e2[_0x196736];return _0x1713c2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x206e('0x0'))(_0x206e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x206e('0x2'));var rimraf=require(_0x206e('0x3'));var config=require(_0x206e('0x4'));var attributes=require(_0x206e('0x5'));module[_0x206e('0x6')]=function(_0x8b8d56,_0x2af067){return _0x8b8d56[_0x206e('0x7')](_0x206e('0x8'),attributes,{'tableName':_0x206e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 6019d10..6f3b0a7 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 _0xe832=['Contacts','DESC','FaxApplication','Applications','applications','list','orderBy','priority','asc','length','create','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','AttachmentId','UserId','User','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','body','from\x20is\x20mandatory','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','FaxAccount','find','account','List'];(function(_0xd6e79,_0x2df92f){var _0x4709fe=function(_0x10fd0f){while(--_0x10fd0f){_0xd6e79['push'](_0xd6e79['shift']());}};_0x4709fe(++_0x2df92f);}(_0xe832,0xce));var _0x2e83=function(_0x4795bd,_0x44fce0){_0x4795bd=_0x4795bd-0x0;var _0x49c80e=_0xe832[_0x4795bd];return _0x49c80e;};'use strict';var _=require('lodash');var util=require(_0x2e83('0x0'));var moment=require(_0x2e83('0x1'));var BPromise=require(_0x2e83('0x2'));var rs=require(_0x2e83('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e83('0x4'))['db'];var utils=require(_0x2e83('0x5'));var logger=require('../../config/logger')(_0x2e83('0x6'));var config=require('../../config/environment');var jayson=require(_0x2e83('0x7'));var client=jayson[_0x2e83('0x8')][_0x2e83('0x9')]({'port':0x232c});config[_0x2e83('0xa')]=_[_0x2e83('0xb')](config[_0x2e83('0xa')],{'host':_0x2e83('0xc'),'port':0x18eb});var socket=require(_0x2e83('0xd'))(new Redis(config[_0x2e83('0xa')]));require('./faxAccount.socket')[_0x2e83('0xe')](socket);function respondWithRpcPromise(_0x1bcf34,_0x29a081,_0x49f44d){return new BPromise(function(_0x54f0a6,_0x407ee7){return client[_0x2e83('0xf')](_0x1bcf34,_0x49f44d)[_0x2e83('0x10')](function(_0x139f61){logger[_0x2e83('0x11')]('FaxAccount,\x20%s,\x20%s',_0x29a081,_0x2e83('0x12'));logger['debug'](_0x2e83('0x13'),_0x29a081,_0x2e83('0x12'),JSON[_0x2e83('0x14')](_0x139f61));if(_0x139f61[_0x2e83('0x15')]){if(_0x139f61[_0x2e83('0x15')][_0x2e83('0x16')]===0x1f4){logger[_0x2e83('0x15')](_0x2e83('0x17'),_0x29a081,_0x139f61[_0x2e83('0x15')]['message']);return _0x407ee7(_0x139f61[_0x2e83('0x15')]['message']);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x29a081,_0x139f61['error'][_0x2e83('0x18')]);return _0x54f0a6(_0x139f61[_0x2e83('0x15')]['message']);}else{logger[_0x2e83('0x11')]('FaxAccount,\x20%s,\x20%s',_0x29a081,'request\x20sent');_0x54f0a6(_0x139f61[_0x2e83('0x19')][_0x2e83('0x18')]);}})[_0x2e83('0x1a')](function(_0x5e964c){logger[_0x2e83('0x15')](_0x2e83('0x17'),_0x29a081,_0x5e964c);_0x407ee7(_0x5e964c);});});}exports['GetFaxAccount']=function(_0x187d46){var _0x50983f=this;return new Promise(function(_0x537ee2,_0x27a814){return db['FaxAccount'][_0x2e83('0x1b')]({'raw':_0x187d46[_0x2e83('0x1c')]?_0x187d46[_0x2e83('0x1c')][_0x2e83('0x1d')]===undefined?!![]:![]:!![],'where':_0x187d46['options']?_0x187d46[_0x2e83('0x1c')][_0x2e83('0x1e')]||null:null,'attributes':_0x187d46[_0x2e83('0x1c')]?_0x187d46['options'][_0x2e83('0x1f')]||null:null,'limit':_0x187d46[_0x2e83('0x1c')]?_0x187d46['options'][_0x2e83('0x20')]||null:null,'include':_0x187d46[_0x2e83('0x1c')]?_0x187d46[_0x2e83('0x1c')][_0x2e83('0x21')]?_[_0x2e83('0x22')](_0x187d46[_0x2e83('0x1c')][_0x2e83('0x21')],function(_0x2c450e){return{'model':db[_0x2c450e[_0x2e83('0x23')]],'as':_0x2c450e['as'],'attributes':_0x2c450e[_0x2e83('0x1f')],'include':_0x2c450e['include']?_[_0x2e83('0x22')](_0x2c450e[_0x2e83('0x21')],function(_0x5975fb){return{'model':db[_0x5975fb[_0x2e83('0x23')]],'as':_0x5975fb['as'],'attributes':_0x5975fb[_0x2e83('0x1f')],'include':_0x5975fb[_0x2e83('0x21')]?_[_0x2e83('0x22')](_0x5975fb[_0x2e83('0x21')],function(_0x6ac7a9){return{'model':db[_0x6ac7a9[_0x2e83('0x23')]],'as':_0x6ac7a9['as'],'attributes':_0x6ac7a9[_0x2e83('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2e83('0x10')](function(_0x507700){logger[_0x2e83('0x11')](_0x2e83('0x24'),_0x187d46);logger['debug'](_0x2e83('0x24'),_0x187d46,JSON['stringify'](_0x507700));_0x537ee2(_0x507700);})[_0x2e83('0x1a')](function(_0x592efd){logger['error'](_0x2e83('0x24'),_0x592efd[_0x2e83('0x18')],_0x187d46);_0x27a814(_0x50983f['error'](0x1f4,_0x592efd[_0x2e83('0x18')]));});});};exports[_0x2e83('0x25')]=function(_0x271569,_0x377143,_0x10eb50){var _0x102d29=this;return new Promise(function(_0x178af2,_0x233956){var _0x18e870={'body':_0x271569['body'],'channel':_0x2e83('0x26')};var _0x857c90=[];var _0x59801a=[];var _0x3e5e6b={};return db[_0x2e83('0x27')][_0x2e83('0x28')]()[_0x2e83('0x10')](function(_0x2eb0e2){if(!_0x2eb0e2){throw new db[(_0x2e83('0x29'))][(_0x2e83('0x2a'))](_0x2e83('0x2b'));}_0x857c90=_[_0x2e83('0x2c')](_[_0x2e83('0x2d')](_0x2eb0e2),[_0x2e83('0x2e'),_0x2e83('0x2f')]);_0x59801a=_['difference'](_['keys'](_0x2eb0e2),[_0x2e83('0x2e'),'updatedAt',_0x2e83('0x30'),'ListId']);if(_0x271569[_0x2e83('0x31')]['id']){delete _0x271569[_0x2e83('0x31')]['id'];}if(_['isNil'](_0x271569[_0x2e83('0x31')]['from'])){throw new db[(_0x2e83('0x29'))][(_0x2e83('0x2a'))](_0x2e83('0x32'));}if(_['isNil'](_0x271569[_0x2e83('0x31')][_0x2e83('0x31')])||_0x271569[_0x2e83('0x31')][_0x2e83('0x31')]===''){throw new db['Sequelize'][(_0x2e83('0x2a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2e83('0x33')](_0x271569[_0x2e83('0x31')]['mapKey'])){throw new db['Sequelize'][(_0x2e83('0x2a'))](_0x2e83('0x34')+_0x59801a);}if(!_[_0x2e83('0x35')](_0x59801a,_0x271569['body'][_0x2e83('0x36')])){throw new db['Sequelize'][(_0x2e83('0x2a'))](_0x2e83('0x37')+_0x59801a);}_0x3e5e6b[_0x271569['body']['mapKey']]=_0x271569['body'][_0x2e83('0x38')];})[_0x2e83('0x10')](function(){return db[_0x2e83('0x39')][_0x2e83('0x3a')]({'where':{'id':_0x271569[_0x2e83('0x3b')]['id']},'include':[{'model':db['CmList'],'as':_0x2e83('0x3c'),'include':[{'model':db[_0x2e83('0x27')],'as':_0x2e83('0x3d'),'where':_0x3e5e6b,'limit':0x1,'order':[[_0x2e83('0x2f'),_0x2e83('0x3e')]]}]},{'model':db[_0x2e83('0x3f')],'as':_0x2e83('0x40')}]});})[_0x2e83('0x10')](function(_0x29b4da){if(_0x29b4da&&_0x29b4da[_0x2e83('0x3c')]){var _0x6dca71=_0x29b4da['get']({'plain':!![]});_0x18e870[_0x2e83('0x3b')]=_0x6dca71;_0x18e870[_0x2e83('0x41')]=_0x6dca71['Applications'];_0x18e870[_0x2e83('0x42')]=_0x6dca71[_0x2e83('0x3c')];_0x18e870[_0x2e83('0x41')]=_[_0x2e83('0x43')](_0x18e870[_0x2e83('0x41')],[_0x2e83('0x44')],[_0x2e83('0x45')]);if(_0x18e870[_0x2e83('0x3b')]['Applications']){delete _0x18e870[_0x2e83('0x3b')][_0x2e83('0x40')];}if(_0x18e870[_0x2e83('0x3b')][_0x2e83('0x3c')]&&_0x18e870[_0x2e83('0x3b')][_0x2e83('0x3c')]['Contacts'][_0x2e83('0x46')]){return _0x18e870[_0x2e83('0x3b')][_0x2e83('0x3c')][_0x2e83('0x3d')][0x0];}var _0x5587ec=_[_0x2e83('0xb')](_0x271569[_0x2e83('0x31')],{'firstName':_0x271569[_0x2e83('0x31')][_0x2e83('0x38')],'ListId':_0x6dca71['ListId']});_0x5587ec[_0x271569['body']['mapKey']]=_0x271569[_0x2e83('0x31')][_0x2e83('0x38')];return db[_0x2e83('0x27')][_0x2e83('0x47')](_0x5587ec,{'fields':_0x857c90,'raw':!![]});}})[_0x2e83('0x10')](function(_0x15a600){_0x18e870['contact']=_0x15a600;if(_0x15a600){var _0x1fabd1={'ContactId':_0x15a600['id'],'FaxAccountId':_0x271569[_0x2e83('0x3b')]['id'],'fax':_0x15a600['fax']};return db[_0x2e83('0x48')][_0x2e83('0x3a')]({'where':{'ContactId':_0x15a600['id'],'closed':![],'FaxAccountId':_0x271569[_0x2e83('0x3b')]['id']}})[_0x2e83('0x10')](function(_0x343136){if(_0x343136){return[_0x343136,![]];}return db['FaxInteraction'][_0x2e83('0x47')](_0x1fabd1)['then'](function(_0x1df8cd){return[_0x1df8cd,!![]];});});}else{throw new Error(_0x2e83('0x49'));}})[_0x2e83('0x4a')](function(_0x49cf5d,_0x4aacbf){var _0x48ff5e=_0x49cf5d[_0x2e83('0x4b')]({'plain':!![]});if(_0x4aacbf){if(_0x18e870[_0x2e83('0x3b')][_0x2e83('0x4c')]){_0x18e870[_0x2e83('0x41')][_0x2e83('0x4d')]({'id':0x0,'priority':_0x18e870[_0x2e83('0x41')]['length']+0x1,'app':_0x2e83('0x4e'),'appdata':_0x2e83('0x4f'),'interval':_0x2e83('0x50')});}_0x48ff5e[_0x2e83('0x51')]=!![];}else{_0x48ff5e['created']=![];}_0x18e870[_0x2e83('0x52')]=_0x48ff5e;return db['FaxMessage'][_0x2e83('0x47')]({'body':_0x271569[_0x2e83('0x31')][_0x2e83('0x31')],'FaxAccountId':_0x271569[_0x2e83('0x3b')]['id'],'FaxInteractionId':_0x49cf5d['id'],'direction':'in','ContactId':_0x49cf5d['ContactId'],'AttachmentId':_0x271569[_0x2e83('0x31')][_0x2e83('0x53')]});})[_0x2e83('0x10')](function(_0x3aa6db){_0x18e870[_0x2e83('0x18')]=_0x3aa6db;if(_0x18e870[_0x2e83('0x52')][_0x2e83('0x54')]){return db[_0x2e83('0x55')][_0x2e83('0x3a')]({'attributes':['id','name'],'where':{'id':_0x18e870[_0x2e83('0x52')][_0x2e83('0x54')]}})[_0x2e83('0x10')](function(_0x4da2dc){if(_0x4da2dc){_0x18e870[_0x2e83('0x41')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4da2dc['name']+','+(_0x18e870[_0x2e83('0x3b')][_0x2e83('0x56')]||0xa),'interval':_0x2e83('0x50')});}return respondWithRpcPromise(_0x2e83('0x57'),_0x2e83('0x58'),_0x18e870);});}return respondWithRpcPromise(_0x2e83('0x57'),'startRouting',_0x18e870);})[_0x2e83('0x10')](function(_0xafc7e6){_0x178af2(_0xafc7e6);})[_0x2e83('0x1a')](function(_0x43d2a8){_0x233956(_0x102d29[_0x2e83('0x15')](0x1f4,_0x43d2a8[_0x2e83('0x18')]));});});}; \ No newline at end of file +var _0x4daf=['NotifyFaxAccount','body','fax','CmContact','ValidationError','no\x20available\x20attributes','keys','createdAt','difference','updatedAt','CompanyId','ListId','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','from','account','CmList','List','Contacts','FaxApplication','Applications','list','applications','orderBy','priority','asc','length','create','contact','find','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','push','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','name','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','register','request','then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','options','raw','where','attributes','limit','include','map','model','catch'];(function(_0x4f616b,_0x4cb423){var _0x1ef1c0=function(_0x5c59f8){while(--_0x5c59f8){_0x4f616b['push'](_0x4f616b['shift']());}};_0x1ef1c0(++_0x4cb423);}(_0x4daf,0x13c));var _0xf4da=function(_0x4512ee,_0x43e5aa){_0x4512ee=_0x4512ee-0x0;var _0x23510c=_0x4daf[_0x4512ee];return _0x23510c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf4da('0x0'));var BPromise=require(_0xf4da('0x1'));var rs=require(_0xf4da('0x2'));var fs=require('fs');var Redis=require(_0xf4da('0x3'));var db=require(_0xf4da('0x4'))['db'];var utils=require(_0xf4da('0x5'));var logger=require(_0xf4da('0x6'))(_0xf4da('0x7'));var config=require(_0xf4da('0x8'));var jayson=require(_0xf4da('0x9'));var client=jayson[_0xf4da('0xa')][_0xf4da('0xb')]({'port':0x232c});config[_0xf4da('0xc')]=_[_0xf4da('0xd')](config[_0xf4da('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf4da('0xe'))(new Redis(config['redis']));require(_0xf4da('0xf'))[_0xf4da('0x10')](socket);function respondWithRpcPromise(_0x4f888b,_0xc320d2,_0x3bc9d4){return new BPromise(function(_0x3e874a,_0x4287ba){return client[_0xf4da('0x11')](_0x4f888b,_0x3bc9d4)[_0xf4da('0x12')](function(_0x1dd7b0){logger['info'](_0xf4da('0x13'),_0xc320d2,'request\x20sent');logger[_0xf4da('0x14')](_0xf4da('0x15'),_0xc320d2,'request\x20sent',JSON[_0xf4da('0x16')](_0x1dd7b0));if(_0x1dd7b0['error']){if(_0x1dd7b0[_0xf4da('0x17')][_0xf4da('0x18')]===0x1f4){logger[_0xf4da('0x17')](_0xf4da('0x13'),_0xc320d2,_0x1dd7b0[_0xf4da('0x17')][_0xf4da('0x19')]);return _0x4287ba(_0x1dd7b0[_0xf4da('0x17')][_0xf4da('0x19')]);}logger[_0xf4da('0x17')]('FaxAccount,\x20%s,\x20%s',_0xc320d2,_0x1dd7b0['error'][_0xf4da('0x19')]);return _0x3e874a(_0x1dd7b0['error'][_0xf4da('0x19')]);}else{logger[_0xf4da('0x1a')](_0xf4da('0x13'),_0xc320d2,'request\x20sent');_0x3e874a(_0x1dd7b0['result'][_0xf4da('0x19')]);}})['catch'](function(_0x3c18a7){logger[_0xf4da('0x17')](_0xf4da('0x13'),_0xc320d2,_0x3c18a7);_0x4287ba(_0x3c18a7);});});}exports['GetFaxAccount']=function(_0xe541af){var _0x97e2a8=this;return new Promise(function(_0x3a7aae,_0x546e36){return db['FaxAccount']['findAll']({'raw':_0xe541af[_0xf4da('0x1b')]?_0xe541af['options'][_0xf4da('0x1c')]===undefined?!![]:![]:!![],'where':_0xe541af['options']?_0xe541af[_0xf4da('0x1b')][_0xf4da('0x1d')]||null:null,'attributes':_0xe541af[_0xf4da('0x1b')]?_0xe541af[_0xf4da('0x1b')][_0xf4da('0x1e')]||null:null,'limit':_0xe541af['options']?_0xe541af[_0xf4da('0x1b')][_0xf4da('0x1f')]||null:null,'include':_0xe541af[_0xf4da('0x1b')]?_0xe541af['options'][_0xf4da('0x20')]?_[_0xf4da('0x21')](_0xe541af[_0xf4da('0x1b')][_0xf4da('0x20')],function(_0x2d284f){return{'model':db[_0x2d284f[_0xf4da('0x22')]],'as':_0x2d284f['as'],'attributes':_0x2d284f[_0xf4da('0x1e')],'include':_0x2d284f[_0xf4da('0x20')]?_[_0xf4da('0x21')](_0x2d284f[_0xf4da('0x20')],function(_0x279031){return{'model':db[_0x279031[_0xf4da('0x22')]],'as':_0x279031['as'],'attributes':_0x279031[_0xf4da('0x1e')],'include':_0x279031[_0xf4da('0x20')]?_['map'](_0x279031['include'],function(_0x4c46a0){return{'model':db[_0x4c46a0[_0xf4da('0x22')]],'as':_0x4c46a0['as'],'attributes':_0x4c46a0['attributes']};}):[]};}):[]};}):[]:[]})[_0xf4da('0x12')](function(_0xb00479){logger[_0xf4da('0x1a')]('GetFaxAccount',_0xe541af);logger['debug']('GetFaxAccount',_0xe541af,JSON[_0xf4da('0x16')](_0xb00479));_0x3a7aae(_0xb00479);})[_0xf4da('0x23')](function(_0xb58bc8){logger['error']('GetFaxAccount',_0xb58bc8[_0xf4da('0x19')],_0xe541af);_0x546e36(_0x97e2a8[_0xf4da('0x17')](0x1f4,_0xb58bc8[_0xf4da('0x19')]));});});};exports[_0xf4da('0x24')]=function(_0x1e4cae,_0x427751,_0x4465e5){var _0x44fb7b=this;return new Promise(function(_0x3170df,_0x56d154){var _0xf72f74={'body':_0x1e4cae[_0xf4da('0x25')],'channel':_0xf4da('0x26')};var _0x473c55=[];var _0x55826f=[];var _0x4748bc={};return db[_0xf4da('0x27')]['describe']()[_0xf4da('0x12')](function(_0x329ebb){if(!_0x329ebb){throw new db['Sequelize'][(_0xf4da('0x28'))](_0xf4da('0x29'));}_0x473c55=_['difference'](_[_0xf4da('0x2a')](_0x329ebb),[_0xf4da('0x2b'),'updatedAt']);_0x55826f=_[_0xf4da('0x2c')](_[_0xf4da('0x2a')](_0x329ebb),['createdAt',_0xf4da('0x2d'),_0xf4da('0x2e'),_0xf4da('0x2f')]);if(_0x1e4cae[_0xf4da('0x25')]['id']){delete _0x1e4cae['body']['id'];}if(_[_0xf4da('0x30')](_0x1e4cae[_0xf4da('0x25')]['from'])){throw new db[(_0xf4da('0x31'))]['ValidationError'](_0xf4da('0x32'));}if(_[_0xf4da('0x30')](_0x1e4cae[_0xf4da('0x25')][_0xf4da('0x25')])||_0x1e4cae[_0xf4da('0x25')][_0xf4da('0x25')]===''){throw new db[(_0xf4da('0x31'))][(_0xf4da('0x28'))](_0xf4da('0x33'));}if(_[_0xf4da('0x30')](_0x1e4cae[_0xf4da('0x25')]['mapKey'])){throw new db[(_0xf4da('0x31'))][(_0xf4da('0x28'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x55826f);}if(!_[_0xf4da('0x34')](_0x55826f,_0x1e4cae['body']['mapKey'])){throw new db[(_0xf4da('0x31'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x55826f);}_0x4748bc[_0x1e4cae[_0xf4da('0x25')][_0xf4da('0x35')]]=_0x1e4cae[_0xf4da('0x25')][_0xf4da('0x36')];})[_0xf4da('0x12')](function(){return db['FaxAccount']['find']({'where':{'id':_0x1e4cae[_0xf4da('0x37')]['id']},'include':[{'model':db[_0xf4da('0x38')],'as':_0xf4da('0x39'),'include':[{'model':db[_0xf4da('0x27')],'as':_0xf4da('0x3a'),'where':_0x4748bc,'limit':0x1,'order':[[_0xf4da('0x2d'),'DESC']]}]},{'model':db[_0xf4da('0x3b')],'as':_0xf4da('0x3c')}]});})[_0xf4da('0x12')](function(_0x16dbd7){if(_0x16dbd7&&_0x16dbd7[_0xf4da('0x39')]){var _0x302a32=_0x16dbd7['get']({'plain':!![]});_0xf72f74[_0xf4da('0x37')]=_0x302a32;_0xf72f74['applications']=_0x302a32[_0xf4da('0x3c')];_0xf72f74[_0xf4da('0x3d')]=_0x302a32['List'];_0xf72f74[_0xf4da('0x3e')]=_[_0xf4da('0x3f')](_0xf72f74[_0xf4da('0x3e')],[_0xf4da('0x40')],[_0xf4da('0x41')]);if(_0xf72f74[_0xf4da('0x37')]['Applications']){delete _0xf72f74['account'][_0xf4da('0x3c')];}if(_0xf72f74[_0xf4da('0x37')][_0xf4da('0x39')]&&_0xf72f74[_0xf4da('0x37')][_0xf4da('0x39')][_0xf4da('0x3a')][_0xf4da('0x42')]){return _0xf72f74['account']['List']['Contacts'][0x0];}var _0x2f489e=_['defaults'](_0x1e4cae[_0xf4da('0x25')],{'firstName':_0x1e4cae[_0xf4da('0x25')][_0xf4da('0x36')],'ListId':_0x302a32[_0xf4da('0x2f')]});_0x2f489e[_0x1e4cae[_0xf4da('0x25')][_0xf4da('0x35')]]=_0x1e4cae[_0xf4da('0x25')][_0xf4da('0x36')];return db[_0xf4da('0x27')][_0xf4da('0x43')](_0x2f489e,{'fields':_0x473c55,'raw':!![]});}})['then'](function(_0x2e1865){_0xf72f74[_0xf4da('0x44')]=_0x2e1865;if(_0x2e1865){var _0x5418c8={'ContactId':_0x2e1865['id'],'FaxAccountId':_0x1e4cae['account']['id'],'fax':_0x2e1865[_0xf4da('0x26')]};return db['FaxInteraction'][_0xf4da('0x45')]({'where':{'ContactId':_0x2e1865['id'],'closed':![],'FaxAccountId':_0x1e4cae[_0xf4da('0x37')]['id']}})[_0xf4da('0x12')](function(_0x43cee4){if(_0x43cee4){return[_0x43cee4,![]];}return db[_0xf4da('0x46')][_0xf4da('0x43')](_0x5418c8)[_0xf4da('0x12')](function(_0x1ffd3c){return[_0x1ffd3c,!![]];});});}else{throw new Error(_0xf4da('0x47'));}})[_0xf4da('0x48')](function(_0x465299,_0x3f07e7){var _0x4aedc1=_0x465299[_0xf4da('0x49')]({'plain':!![]});if(_0x3f07e7){if(_0xf72f74[_0xf4da('0x37')][_0xf4da('0x4a')]){_0xf72f74['applications'][_0xf4da('0x4b')]({'id':0x0,'priority':_0xf72f74[_0xf4da('0x3e')]['length']+0x1,'app':'close','appdata':_0xf4da('0x4c'),'interval':_0xf4da('0x4d')});}_0x4aedc1[_0xf4da('0x4e')]=!![];}else{_0x4aedc1['created']=![];}_0xf72f74[_0xf4da('0x4f')]=_0x4aedc1;return db[_0xf4da('0x50')][_0xf4da('0x43')]({'body':_0x1e4cae[_0xf4da('0x25')]['body'],'FaxAccountId':_0x1e4cae['account']['id'],'FaxInteractionId':_0x465299['id'],'direction':'in','ContactId':_0x465299['ContactId'],'AttachmentId':_0x1e4cae[_0xf4da('0x25')][_0xf4da('0x51')]});})['then'](function(_0x44ffe8){_0xf72f74['message']=_0x44ffe8;if(_0xf72f74[_0xf4da('0x4f')]['UserId']){return db['User'][_0xf4da('0x45')]({'attributes':['id',_0xf4da('0x52')],'where':{'id':_0xf72f74[_0xf4da('0x4f')][_0xf4da('0x53')]}})[_0xf4da('0x12')](function(_0x19397d){if(_0x19397d){_0xf72f74[_0xf4da('0x3e')][_0xf4da('0x54')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x19397d[_0xf4da('0x52')]+','+(_0xf72f74[_0xf4da('0x37')][_0xf4da('0x55')]||0xa),'interval':_0xf4da('0x4d')});}return respondWithRpcPromise(_0xf4da('0x56'),_0xf4da('0x57'),_0xf72f74);});}return respondWithRpcPromise(_0xf4da('0x56'),_0xf4da('0x57'),_0xf72f74);})[_0xf4da('0x12')](function(_0x2328c8){_0x3170df(_0x2328c8);})[_0xf4da('0x23')](function(_0x50ae6){_0x56d154(_0x44fb7b[_0xf4da('0x17')](0x1f4,_0x50ae6[_0xf4da('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index ec06711..da4967e 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 _0x315d=['remove','update','emit','register','length','./faxAccount.events'];(function(_0x1a1117,_0x879478){var _0x58edab=function(_0x255c03){while(--_0x255c03){_0x1a1117['push'](_0x1a1117['shift']());}};_0x58edab(++_0x879478);}(_0x315d,0xe9));var _0xd315=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x315d[_0x3dd15e];return _0x231fd0;};'use strict';var FaxAccountEvents=require(_0xd315('0x0'));var events=['save',_0xd315('0x1'),_0xd315('0x2')];function createListener(_0x433dd9,_0x1c1307){return function(_0x5af3e5){_0x1c1307[_0xd315('0x3')](_0x433dd9,_0x5af3e5);};}function removeListener(_0x1429db,_0x3bd686){return function(){FaxAccountEvents['removeListener'](_0x1429db,_0x3bd686);};}exports[_0xd315('0x4')]=function(_0x4d2085){for(var _0x4b45fb=0x0,_0x1c98be=events[_0xd315('0x5')];_0x4b45fb<_0x1c98be;_0x4b45fb++){var _0x230b32=events[_0x4b45fb];var _0x394531=createListener('faxAccount:'+_0x230b32,_0x4d2085);FaxAccountEvents['on'](_0x230b32,_0x394531);}}; \ No newline at end of file +var _0x00af=['./faxAccount.events','update','register','length','faxAccount:'];(function(_0x52ed5e,_0x57fe53){var _0x438782=function(_0x3b0e6b){while(--_0x3b0e6b){_0x52ed5e['push'](_0x52ed5e['shift']());}};_0x438782(++_0x57fe53);}(_0x00af,0x172));var _0xf00a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x00af[_0x4cf98e];return _0x1623ac;};'use strict';var FaxAccountEvents=require(_0xf00a('0x0'));var events=['save','remove',_0xf00a('0x1')];function createListener(_0x3c104d,_0x2f3bb7){return function(_0x27473d){_0x2f3bb7['emit'](_0x3c104d,_0x27473d);};}function removeListener(_0x1faebd,_0x4f9cce){return function(){FaxAccountEvents['removeListener'](_0x1faebd,_0x4f9cce);};}exports[_0xf00a('0x2')]=function(_0x5f34e6){for(var _0x24eeeb=0x0,_0xd11747=events[_0xf00a('0x3')];_0x24eeeb<_0xd11747;_0x24eeeb++){var _0x58bd62=events[_0x24eeeb];var _0x2511ad=createListener(_0xf00a('0x4')+_0x58bd62,_0x5f34e6);FaxAccountEvents['on'](_0x58bd62,_0x2511ad);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index f8a24a3..f7e2d2e 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(_0x1ebeaf,_0x2b7387){var _0x388001=function(_0x336f3f){while(--_0x336f3f){_0x1ebeaf['push'](_0x1ebeaf['shift']());}};_0x388001(++_0x2b7387);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x17bec1,_0x5927a6){var _0x1502c8=function(_0x16ac6b){while(--_0x16ac6b){_0x17bec1['push'](_0x17bec1['shift']());}};_0x1502c8(++_0x5927a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 0656bcc..4b0734f 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 _0x5814=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x5f4025,_0x45e202){var _0x546658=function(_0xc3baed){while(--_0xc3baed){_0x5f4025['push'](_0x5f4025['shift']());}};_0x546658(++_0x45e202);}(_0x5814,0x110));var _0x4581=function(_0x2ef8e9,_0x42bf2c){_0x2ef8e9=_0x2ef8e9-0x0;var _0x28e94d=_0x5814[_0x2ef8e9];return _0x28e94d;};'use strict';var Sequelize=require(_0x4581('0x0'));module[_0x4581('0x1')]={'priority':{'type':Sequelize[_0x4581('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4581('0x3')],'allowNull':![],'defaultValue':_0x4581('0x4')},'appdata':{'type':Sequelize[_0x4581('0x5')]()},'description':{'type':Sequelize[_0x4581('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4581('0x6')}}; \ No newline at end of file +var _0x4665=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x16feac,_0x4cb36f){var _0x42b6d7=function(_0x3dc2d2){while(--_0x3dc2d2){_0x16feac['push'](_0x16feac['shift']());}};_0x42b6d7(++_0x4cb36f);}(_0x4665,0xe5));var _0x5466=function(_0x5882ee,_0x583eea){_0x5882ee=_0x5882ee-0x0;var _0x5bae6d=_0x4665[_0x5882ee];return _0x5bae6d;};'use strict';var Sequelize=require('sequelize');module[_0x5466('0x0')]={'priority':{'type':Sequelize[_0x5466('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5466('0x2')],'allowNull':![],'defaultValue':_0x5466('0x3')},'appdata':{'type':Sequelize[_0x5466('0x4')]()},'description':{'type':Sequelize[_0x5466('0x2')]},'interval':{'type':Sequelize[_0x5466('0x2')],'defaultValue':_0x5466('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index e430331..7b13d25 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 _0x5f57=['limit','count','set','apply','save','update','then','destroy','end','error','stack','send','index','map','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','params','FaxApplication','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x57cf94,_0x2b099c){var _0x73983f=function(_0xce3742){while(--_0xce3742){_0x57cf94['push'](_0x57cf94['shift']());}};_0x73983f(++_0x2b099c);}(_0x5f57,0x10b));var _0x75f5=function(_0x16ff44,_0x474210){_0x16ff44=_0x16ff44-0x0;var _0x54dff8=_0x5f57[_0x16ff44];return _0x54dff8;};'use strict';var emlformat=require(_0x75f5('0x0'));var rimraf=require(_0x75f5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x75f5('0x2'));var rp=require(_0x75f5('0x3'));var moment=require(_0x75f5('0x4'));var BPromise=require(_0x75f5('0x5'));var Mustache=require('mustache');var util=require(_0x75f5('0x6'));var path=require(_0x75f5('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('lodash');var squel=require(_0x75f5('0x8'));var crypto=require(_0x75f5('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x75f5('0xa'));var toCsv=require(_0x75f5('0xb'));var querystring=require('querystring');var Papa=require(_0x75f5('0xc'));var Redis=require(_0x75f5('0xd'));var authService=require(_0x75f5('0xe'));var qs=require(_0x75f5('0xf'));var as=require(_0x75f5('0x10'));var hardwareService=require(_0x75f5('0x11'));var logger=require(_0x75f5('0x12'))(_0x75f5('0x13'));var utils=require(_0x75f5('0x14'));var config=require(_0x75f5('0x15'));var licenseUtil=require(_0x75f5('0x16'));var db=require(_0x75f5('0x17'))['db'];function respondWithStatusCode(_0x11e246,_0x159da8){_0x159da8=_0x159da8||0xcc;return function(_0x5bf92c){if(_0x5bf92c){return _0x11e246[_0x75f5('0x18')](_0x159da8);}return _0x11e246[_0x75f5('0x19')](_0x159da8)['end']();};}function respondWithResult(_0x5b101e,_0x56b430){_0x56b430=_0x56b430||0xc8;return function(_0x1c60f6){if(_0x1c60f6){return _0x5b101e[_0x75f5('0x19')](_0x56b430)[_0x75f5('0x1a')](_0x1c60f6);}};}function respondWithFilteredResult(_0x2725d,_0x1d0fd1){return function(_0x3ed2eb){if(_0x3ed2eb){var _0x7dfbf7=typeof _0x1d0fd1[_0x75f5('0x1b')]===_0x75f5('0x1c')&&typeof _0x1d0fd1[_0x75f5('0x1d')]===_0x75f5('0x1c');var _0x2b7048=_0x3ed2eb[_0x75f5('0x1e')];var _0x5a6650=_0x7dfbf7?0x0:_0x1d0fd1['offset'];var _0x3c86e3=_0x7dfbf7?_0x3ed2eb[_0x75f5('0x1e')]:_0x1d0fd1['offset']+_0x1d0fd1[_0x75f5('0x1d')];var _0x53eb2c;if(_0x3c86e3>=_0x2b7048){_0x3c86e3=_0x2b7048;_0x53eb2c=0xc8;}else{_0x53eb2c=0xce;}_0x2725d[_0x75f5('0x19')](_0x53eb2c);return _0x2725d[_0x75f5('0x1f')]('Content-Range',_0x5a6650+'-'+_0x3c86e3+'/'+_0x2b7048)['json'](_0x3ed2eb);}return null;};}function patchUpdates(_0x1e47b8){return function(_0x22cec8){try{jsonpatch[_0x75f5('0x20')](_0x22cec8,_0x1e47b8,!![]);}catch(_0x49d038){return BPromise['reject'](_0x49d038);}return _0x22cec8[_0x75f5('0x21')]();};}function saveUpdates(_0x1eb0e3,_0x52618b){return function(_0x5b4be7){if(_0x5b4be7){return _0x5b4be7[_0x75f5('0x22')](_0x1eb0e3)[_0x75f5('0x23')](function(_0x17bd7f){return _0x17bd7f;});}return null;};}function removeEntity(_0x1010ec,_0x45321e){return function(_0x50a75b){if(_0x50a75b){return _0x50a75b[_0x75f5('0x24')]()[_0x75f5('0x23')](function(){_0x1010ec[_0x75f5('0x19')](0xcc)[_0x75f5('0x25')]();});}};}function handleEntityNotFound(_0x275732,_0x49d46a){return function(_0x252f74){if(!_0x252f74){_0x275732[_0x75f5('0x18')](0x194);}return _0x252f74;};}function handleError(_0x1dde98,_0x373c86){_0x373c86=_0x373c86||0x1f4;return function(_0x5e0cf4){logger[_0x75f5('0x26')](_0x5e0cf4[_0x75f5('0x27')]);if(_0x5e0cf4['name']){delete _0x5e0cf4['name'];}_0x1dde98[_0x75f5('0x19')](_0x373c86)[_0x75f5('0x28')](_0x5e0cf4);};}exports[_0x75f5('0x29')]=function(_0x5d9cf2,_0x36c66e){var _0x31e6e2={},_0x576ddc={},_0x144555={'count':0x0,'rows':[]};var _0x4e2c1f=_[_0x75f5('0x2a')](db['FaxApplication'][_0x75f5('0x2b')],function(_0x4efb3f){return{'name':_0x4efb3f[_0x75f5('0x2c')],'type':_0x4efb3f[_0x75f5('0x2d')][_0x75f5('0x2e')]};});_0x576ddc['model']=_[_0x75f5('0x2a')](_0x4e2c1f,_0x75f5('0x2f'));_0x576ddc['query']=_[_0x75f5('0x30')](_0x5d9cf2[_0x75f5('0x31')]);_0x576ddc[_0x75f5('0x32')]=_[_0x75f5('0x33')](_0x576ddc[_0x75f5('0x34')],_0x576ddc[_0x75f5('0x31')]);_0x31e6e2[_0x75f5('0x35')]=_[_0x75f5('0x33')](_0x576ddc[_0x75f5('0x34')],qs[_0x75f5('0x36')](_0x5d9cf2[_0x75f5('0x31')][_0x75f5('0x36')]));_0x31e6e2[_0x75f5('0x35')]=_0x31e6e2[_0x75f5('0x35')][_0x75f5('0x37')]?_0x31e6e2[_0x75f5('0x35')]:_0x576ddc['model'];if(!_0x5d9cf2[_0x75f5('0x31')]['hasOwnProperty'](_0x75f5('0x38'))){_0x31e6e2[_0x75f5('0x1d')]=qs['limit'](_0x5d9cf2['query'][_0x75f5('0x1d')]);_0x31e6e2[_0x75f5('0x1b')]=qs[_0x75f5('0x1b')](_0x5d9cf2[_0x75f5('0x31')][_0x75f5('0x1b')]);}_0x31e6e2[_0x75f5('0x39')]=qs[_0x75f5('0x3a')](_0x5d9cf2[_0x75f5('0x31')][_0x75f5('0x3a')]);_0x31e6e2[_0x75f5('0x3b')]=qs[_0x75f5('0x32')](_[_0x75f5('0x3c')](_0x5d9cf2[_0x75f5('0x31')],_0x576ddc[_0x75f5('0x32')]),_0x4e2c1f);if(_0x5d9cf2[_0x75f5('0x31')][_0x75f5('0x3d')]){_0x31e6e2[_0x75f5('0x3b')]=_[_0x75f5('0x3e')](_0x31e6e2['where'],{'$or':_['map'](_0x4e2c1f,function(_0x239ebe){if(_0x239ebe['type']!==_0x75f5('0x3f')){var _0x5ce353={};_0x5ce353[_0x239ebe[_0x75f5('0x2f')]]={'$like':'%'+_0x5d9cf2[_0x75f5('0x31')][_0x75f5('0x3d')]+'%'};return _0x5ce353;}})});}_0x31e6e2=_['merge']({},_0x31e6e2,_0x5d9cf2['options']);var _0x3d06cb={'where':_0x31e6e2[_0x75f5('0x3b')]};return db['FaxApplication'][_0x75f5('0x1e')](_0x3d06cb)['then'](function(_0x1d6cac){_0x144555[_0x75f5('0x1e')]=_0x1d6cac;if(_0x5d9cf2[_0x75f5('0x31')][_0x75f5('0x40')]){_0x31e6e2[_0x75f5('0x41')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x31e6e2);})['then'](function(_0x2b4e35){_0x144555['rows']=_0x2b4e35;return _0x144555;})[_0x75f5('0x23')](respondWithFilteredResult(_0x36c66e,_0x31e6e2))[_0x75f5('0x42')](handleError(_0x36c66e,null));};exports[_0x75f5('0x43')]=function(_0x3b541f,_0x20095b){var _0x3dbc96={'raw':!![],'where':{'id':_0x3b541f[_0x75f5('0x44')]['id']}},_0x113681={};_0x113681[_0x75f5('0x34')]=_[_0x75f5('0x30')](db[_0x75f5('0x45')][_0x75f5('0x2b')]);_0x113681[_0x75f5('0x31')]=_['keys'](_0x3b541f[_0x75f5('0x31')]);_0x113681[_0x75f5('0x32')]=_['intersection'](_0x113681['model'],_0x113681[_0x75f5('0x31')]);_0x3dbc96[_0x75f5('0x35')]=_[_0x75f5('0x33')](_0x113681[_0x75f5('0x34')],qs['fields'](_0x3b541f['query'][_0x75f5('0x36')]));_0x3dbc96[_0x75f5('0x35')]=_0x3dbc96[_0x75f5('0x35')][_0x75f5('0x37')]?_0x3dbc96[_0x75f5('0x35')]:_0x113681[_0x75f5('0x34')];if(_0x3b541f[_0x75f5('0x31')][_0x75f5('0x40')]){_0x3dbc96[_0x75f5('0x41')]=[{'all':!![]}];}_0x3dbc96=_['merge']({},_0x3dbc96,_0x3b541f[_0x75f5('0x46')]);return db[_0x75f5('0x45')][_0x75f5('0x47')](_0x3dbc96)[_0x75f5('0x23')](handleEntityNotFound(_0x20095b,null))[_0x75f5('0x23')](respondWithResult(_0x20095b,null))[_0x75f5('0x42')](handleError(_0x20095b,null));};exports[_0x75f5('0x48')]=function(_0x1c27da,_0x445029){return db[_0x75f5('0x45')]['create'](_0x1c27da[_0x75f5('0x49')],{})['then'](respondWithResult(_0x445029,0xc9))[_0x75f5('0x42')](handleError(_0x445029,null));};exports[_0x75f5('0x22')]=function(_0x373cdf,_0x4ddf2c){if(_0x373cdf[_0x75f5('0x49')]['id']){delete _0x373cdf[_0x75f5('0x49')]['id'];}return db[_0x75f5('0x45')][_0x75f5('0x47')]({'where':{'id':_0x373cdf[_0x75f5('0x44')]['id']}})[_0x75f5('0x23')](handleEntityNotFound(_0x4ddf2c,null))[_0x75f5('0x23')](saveUpdates(_0x373cdf[_0x75f5('0x49')],null))[_0x75f5('0x23')](respondWithResult(_0x4ddf2c,null))[_0x75f5('0x42')](handleError(_0x4ddf2c,null));};exports[_0x75f5('0x24')]=function(_0x412f65,_0x514b82){return db[_0x75f5('0x45')][_0x75f5('0x47')]({'where':{'id':_0x412f65[_0x75f5('0x44')]['id']}})[_0x75f5('0x23')](handleEntityNotFound(_0x514b82,null))[_0x75f5('0x23')](removeEntity(_0x514b82,null))['catch'](handleError(_0x514b82,null));}; \ No newline at end of file +var _0xa385=['request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','FaxApplication','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','catch','show','params','options','find','create','body','zip-dir','fast-json-patch'];(function(_0x1fca05,_0x2fcdbb){var _0x229b23=function(_0x4815a1){while(--_0x4815a1){_0x1fca05['push'](_0x1fca05['shift']());}};_0x229b23(++_0x2fcdbb);}(_0xa385,0x8c));var _0x5a38=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xa385[_0x51020b];return _0x371e47;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5a38('0x0'));var jsonpatch=require(_0x5a38('0x1'));var rp=require(_0x5a38('0x2'));var moment=require(_0x5a38('0x3'));var BPromise=require(_0x5a38('0x4'));var Mustache=require('mustache');var util=require(_0x5a38('0x5'));var path=require('path');var sox=require(_0x5a38('0x6'));var csv=require(_0x5a38('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a38('0x8'));var squel=require(_0x5a38('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5a38('0x7'));var querystring=require('querystring');var Papa=require(_0x5a38('0xa'));var Redis=require(_0x5a38('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x5a38('0xc'));var as=require(_0x5a38('0xd'));var hardwareService=require(_0x5a38('0xe'));var logger=require(_0x5a38('0xf'))('api');var utils=require(_0x5a38('0x10'));var config=require(_0x5a38('0x11'));var licenseUtil=require(_0x5a38('0x12'));var db=require(_0x5a38('0x13'))['db'];function respondWithStatusCode(_0x340f91,_0x4e2716){_0x4e2716=_0x4e2716||0xcc;return function(_0x34d75c){if(_0x34d75c){return _0x340f91[_0x5a38('0x14')](_0x4e2716);}return _0x340f91[_0x5a38('0x15')](_0x4e2716)[_0x5a38('0x16')]();};}function respondWithResult(_0x14e791,_0x59c5b2){_0x59c5b2=_0x59c5b2||0xc8;return function(_0x2e2550){if(_0x2e2550){return _0x14e791[_0x5a38('0x15')](_0x59c5b2)['json'](_0x2e2550);}};}function respondWithFilteredResult(_0x484915,_0x5910af){return function(_0x13b37c){if(_0x13b37c){var _0x584b9f=typeof _0x5910af[_0x5a38('0x17')]===_0x5a38('0x18')&&typeof _0x5910af[_0x5a38('0x19')]===_0x5a38('0x18');var _0x1610ea=_0x13b37c[_0x5a38('0x1a')];var _0x1f3ed5=_0x584b9f?0x0:_0x5910af[_0x5a38('0x17')];var _0x47dc2d=_0x584b9f?_0x13b37c[_0x5a38('0x1a')]:_0x5910af[_0x5a38('0x17')]+_0x5910af['limit'];var _0x300720;if(_0x47dc2d>=_0x1610ea){_0x47dc2d=_0x1610ea;_0x300720=0xc8;}else{_0x300720=0xce;}_0x484915['status'](_0x300720);return _0x484915[_0x5a38('0x1b')](_0x5a38('0x1c'),_0x1f3ed5+'-'+_0x47dc2d+'/'+_0x1610ea)[_0x5a38('0x1d')](_0x13b37c);}return null;};}function patchUpdates(_0x2a8ede){return function(_0x459b9d){try{jsonpatch[_0x5a38('0x1e')](_0x459b9d,_0x2a8ede,!![]);}catch(_0x26fdfd){return BPromise[_0x5a38('0x1f')](_0x26fdfd);}return _0x459b9d[_0x5a38('0x20')]();};}function saveUpdates(_0x1b733e,_0x363f57){return function(_0x1e2f73){if(_0x1e2f73){return _0x1e2f73[_0x5a38('0x21')](_0x1b733e)[_0x5a38('0x22')](function(_0x3c0049){return _0x3c0049;});}return null;};}function removeEntity(_0x393a74,_0x32cddc){return function(_0x52529a){if(_0x52529a){return _0x52529a['destroy']()['then'](function(){_0x393a74[_0x5a38('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x322273,_0xe71ec2){return function(_0x28095d){if(!_0x28095d){_0x322273['sendStatus'](0x194);}return _0x28095d;};}function handleError(_0x567cfe,_0x29df60){_0x29df60=_0x29df60||0x1f4;return function(_0x2c0feb){logger[_0x5a38('0x23')](_0x2c0feb[_0x5a38('0x24')]);if(_0x2c0feb[_0x5a38('0x25')]){delete _0x2c0feb['name'];}_0x567cfe[_0x5a38('0x15')](_0x29df60)[_0x5a38('0x26')](_0x2c0feb);};}exports['index']=function(_0x79e24d,_0x22c089){var _0x41df1a={},_0x1ab778={},_0x29edea={'count':0x0,'rows':[]};var _0x36a52a=_['map'](db[_0x5a38('0x27')][_0x5a38('0x28')],function(_0x548dff){return{'name':_0x548dff[_0x5a38('0x29')],'type':_0x548dff[_0x5a38('0x2a')][_0x5a38('0x2b')]};});_0x1ab778[_0x5a38('0x2c')]=_[_0x5a38('0x2d')](_0x36a52a,_0x5a38('0x25'));_0x1ab778['query']=_[_0x5a38('0x2e')](_0x79e24d[_0x5a38('0x2f')]);_0x1ab778[_0x5a38('0x30')]=_[_0x5a38('0x31')](_0x1ab778['model'],_0x1ab778[_0x5a38('0x2f')]);_0x41df1a[_0x5a38('0x32')]=_['intersection'](_0x1ab778['model'],qs[_0x5a38('0x33')](_0x79e24d[_0x5a38('0x2f')]['fields']));_0x41df1a[_0x5a38('0x32')]=_0x41df1a[_0x5a38('0x32')][_0x5a38('0x34')]?_0x41df1a['attributes']:_0x1ab778[_0x5a38('0x2c')];if(!_0x79e24d['query'][_0x5a38('0x35')](_0x5a38('0x36'))){_0x41df1a['limit']=qs[_0x5a38('0x19')](_0x79e24d[_0x5a38('0x2f')]['limit']);_0x41df1a[_0x5a38('0x17')]=qs['offset'](_0x79e24d['query'][_0x5a38('0x17')]);}_0x41df1a[_0x5a38('0x37')]=qs['sort'](_0x79e24d[_0x5a38('0x2f')][_0x5a38('0x38')]);_0x41df1a['where']=qs[_0x5a38('0x30')](_[_0x5a38('0x39')](_0x79e24d['query'],_0x1ab778[_0x5a38('0x30')]),_0x36a52a);if(_0x79e24d['query'][_0x5a38('0x3a')]){_0x41df1a[_0x5a38('0x3b')]=_[_0x5a38('0x3c')](_0x41df1a[_0x5a38('0x3b')],{'$or':_[_0x5a38('0x2d')](_0x36a52a,function(_0x24cca5){if(_0x24cca5[_0x5a38('0x2a')]!==_0x5a38('0x3d')){var _0x340dcf={};_0x340dcf[_0x24cca5[_0x5a38('0x25')]]={'$like':'%'+_0x79e24d['query'][_0x5a38('0x3a')]+'%'};return _0x340dcf;}})});}_0x41df1a=_[_0x5a38('0x3c')]({},_0x41df1a,_0x79e24d['options']);var _0x5c0a4c={'where':_0x41df1a[_0x5a38('0x3b')]};return db[_0x5a38('0x27')][_0x5a38('0x1a')](_0x5c0a4c)['then'](function(_0x2b5bc2){_0x29edea[_0x5a38('0x1a')]=_0x2b5bc2;if(_0x79e24d['query'][_0x5a38('0x3e')]){_0x41df1a[_0x5a38('0x3f')]=[{'all':!![]}];}return db[_0x5a38('0x27')]['findAll'](_0x41df1a);})[_0x5a38('0x22')](function(_0x5a85a6){_0x29edea['rows']=_0x5a85a6;return _0x29edea;})[_0x5a38('0x22')](respondWithFilteredResult(_0x22c089,_0x41df1a))[_0x5a38('0x40')](handleError(_0x22c089,null));};exports[_0x5a38('0x41')]=function(_0x2807fe,_0x1d7468){var _0x49dea9={'raw':!![],'where':{'id':_0x2807fe[_0x5a38('0x42')]['id']}},_0x2da7c5={};_0x2da7c5[_0x5a38('0x2c')]=_[_0x5a38('0x2e')](db[_0x5a38('0x27')][_0x5a38('0x28')]);_0x2da7c5['query']=_[_0x5a38('0x2e')](_0x2807fe[_0x5a38('0x2f')]);_0x2da7c5[_0x5a38('0x30')]=_[_0x5a38('0x31')](_0x2da7c5[_0x5a38('0x2c')],_0x2da7c5[_0x5a38('0x2f')]);_0x49dea9['attributes']=_[_0x5a38('0x31')](_0x2da7c5[_0x5a38('0x2c')],qs[_0x5a38('0x33')](_0x2807fe[_0x5a38('0x2f')][_0x5a38('0x33')]));_0x49dea9[_0x5a38('0x32')]=_0x49dea9['attributes'][_0x5a38('0x34')]?_0x49dea9[_0x5a38('0x32')]:_0x2da7c5['model'];if(_0x2807fe[_0x5a38('0x2f')]['includeAll']){_0x49dea9[_0x5a38('0x3f')]=[{'all':!![]}];}_0x49dea9=_[_0x5a38('0x3c')]({},_0x49dea9,_0x2807fe[_0x5a38('0x43')]);return db[_0x5a38('0x27')][_0x5a38('0x44')](_0x49dea9)[_0x5a38('0x22')](handleEntityNotFound(_0x1d7468,null))[_0x5a38('0x22')](respondWithResult(_0x1d7468,null))['catch'](handleError(_0x1d7468,null));};exports[_0x5a38('0x45')]=function(_0x2bd745,_0x11ab98){return db[_0x5a38('0x27')][_0x5a38('0x45')](_0x2bd745['body'],{})['then'](respondWithResult(_0x11ab98,0xc9))[_0x5a38('0x40')](handleError(_0x11ab98,null));};exports[_0x5a38('0x21')]=function(_0x4aa34e,_0x48b83a){if(_0x4aa34e['body']['id']){delete _0x4aa34e[_0x5a38('0x46')]['id'];}return db[_0x5a38('0x27')]['find']({'where':{'id':_0x4aa34e[_0x5a38('0x42')]['id']}})[_0x5a38('0x22')](handleEntityNotFound(_0x48b83a,null))[_0x5a38('0x22')](saveUpdates(_0x4aa34e['body'],null))[_0x5a38('0x22')](respondWithResult(_0x48b83a,null))[_0x5a38('0x40')](handleError(_0x48b83a,null));};exports['destroy']=function(_0x2bfed8,_0x13be62){return db[_0x5a38('0x27')][_0x5a38('0x44')]({'where':{'id':_0x2bfed8[_0x5a38('0x42')]['id']}})[_0x5a38('0x22')](handleEntityNotFound(_0x13be62,null))['then'](removeEntity(_0x13be62,null))[_0x5a38('0x40')](handleError(_0x13be62,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 5bea775..d3e9073 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 _0xab67=['request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird'];(function(_0x2965b3,_0x1c0483){var _0x3f8693=function(_0x4f39f6){while(--_0x4f39f6){_0x2965b3['push'](_0x2965b3['shift']());}};_0x3f8693(++_0x1c0483);}(_0xab67,0x65));var _0x7ab6=function(_0x27929e,_0x75968b){_0x27929e=_0x27929e-0x0;var _0x3125c0=_0xab67[_0x27929e];return _0x3125c0;};'use strict';var _=require('lodash');var util=require(_0x7ab6('0x0'));var logger=require('../../config/logger')(_0x7ab6('0x1'));var moment=require(_0x7ab6('0x2'));var BPromise=require(_0x7ab6('0x3'));var rp=require(_0x7ab6('0x4'));var fs=require('fs');var path=require(_0x7ab6('0x5'));var rimraf=require(_0x7ab6('0x6'));var config=require(_0x7ab6('0x7'));var attributes=require(_0x7ab6('0x8'));module[_0x7ab6('0x9')]=function(_0x321db0,_0x5ec0d1){return _0x321db0[_0x7ab6('0xa')](_0x7ab6('0xb'),attributes,{'tableName':_0x7ab6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7ab6('0xd'),'collate':_0x7ab6('0xe')});}; \ No newline at end of file +var _0x50cd=['exports','define','fax_applications','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxApplication.attributes'];(function(_0xe538ca,_0x4b2735){var _0xe37a83=function(_0x5d59d5){while(--_0x5d59d5){_0xe538ca['push'](_0xe538ca['shift']());}};_0xe37a83(++_0x4b2735);}(_0x50cd,0x93));var _0xd50c=function(_0x106466,_0xe55a0){_0x106466=_0x106466-0x0;var _0x4ae2aa=_0x50cd[_0x106466];return _0x4ae2aa;};'use strict';var _=require('lodash');var util=require(_0xd50c('0x0'));var logger=require(_0xd50c('0x1'))(_0xd50c('0x2'));var moment=require(_0xd50c('0x3'));var BPromise=require(_0xd50c('0x4'));var rp=require(_0xd50c('0x5'));var fs=require('fs');var path=require(_0xd50c('0x6'));var rimraf=require(_0xd50c('0x7'));var config=require('../../config/environment');var attributes=require(_0xd50c('0x8'));module[_0xd50c('0x9')]=function(_0x1dac7c,_0x8ccca){return _0x1dac7c[_0xd50c('0xa')]('FaxApplication',attributes,{'tableName':_0xd50c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd50c('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 0042e62..9e01e7b 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 _0xfc4e=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','UpdateFaxApplication','FaxApplication','update','body','raw','where','options','attributes','limit','catch','lodash','util','moment','bluebird'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xfc4e,0xb0));var _0xefc4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xfc4e[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xefc4('0x0'));var util=require(_0xefc4('0x1'));var moment=require(_0xefc4('0x2'));var BPromise=require(_0xefc4('0x3'));var rs=require(_0xefc4('0x4'));var fs=require('fs');var Redis=require(_0xefc4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xefc4('0x6'))(_0xefc4('0x7'));var config=require(_0xefc4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xefc4('0x9')][_0xefc4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4553d0,_0x3aaa31,_0x2aec65){return new BPromise(function(_0x221890,_0x3bb84e){return client['request'](_0x4553d0,_0x2aec65)[_0xefc4('0xb')](function(_0x43ad95){logger['info'](_0xefc4('0xc'),_0x3aaa31,_0xefc4('0xd'));logger[_0xefc4('0xe')](_0xefc4('0xf'),_0x3aaa31,_0xefc4('0xd'),JSON[_0xefc4('0x10')](_0x43ad95));if(_0x43ad95[_0xefc4('0x11')]){if(_0x43ad95[_0xefc4('0x11')]['code']===0x1f4){logger[_0xefc4('0x11')](_0xefc4('0xc'),_0x3aaa31,_0x43ad95[_0xefc4('0x11')][_0xefc4('0x12')]);return _0x3bb84e(_0x43ad95[_0xefc4('0x11')]['message']);}logger[_0xefc4('0x11')]('FaxApplication,\x20%s,\x20%s',_0x3aaa31,_0x43ad95[_0xefc4('0x11')][_0xefc4('0x12')]);return _0x221890(_0x43ad95[_0xefc4('0x11')]['message']);}else{logger[_0xefc4('0x13')](_0xefc4('0xc'),_0x3aaa31,_0xefc4('0xd'));_0x221890(_0x43ad95['result'][_0xefc4('0x12')]);}})['catch'](function(_0x1fbaac){logger[_0xefc4('0x11')]('FaxApplication,\x20%s,\x20%s',_0x3aaa31,_0x1fbaac);_0x3bb84e(_0x1fbaac);});});}exports[_0xefc4('0x14')]=function(_0x23b80a){var _0x22bab5=this;return new Promise(function(_0x50a00e,_0x5f2f97){return db[_0xefc4('0x15')][_0xefc4('0x16')](_0x23b80a[_0xefc4('0x17')],{'raw':_0x23b80a['options']?_0x23b80a['options'][_0xefc4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23b80a['options']?_0x23b80a['options'][_0xefc4('0x19')]||null:null,'attributes':_0x23b80a[_0xefc4('0x1a')]?_0x23b80a[_0xefc4('0x1a')][_0xefc4('0x1b')]||null:null,'limit':_0x23b80a[_0xefc4('0x1a')]?_0x23b80a['options'][_0xefc4('0x1c')]||null:null})['then'](function(_0x3a6ba1){logger[_0xefc4('0x13')](_0xefc4('0x14'),_0x23b80a);logger['debug'](_0xefc4('0x14'),_0x23b80a,JSON[_0xefc4('0x10')](_0x3a6ba1));_0x50a00e(_0x3a6ba1);})[_0xefc4('0x1d')](function(_0x411b44){logger[_0xefc4('0x11')](_0xefc4('0x14'),_0x411b44[_0xefc4('0x12')],_0x23b80a);_0x5f2f97(_0x22bab5['error'](0x1f4,_0x411b44['message']));});});}; \ No newline at end of file +var _0x1737=['FaxApplication','update','options','raw','where','attributes','limit','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','UpdateFaxApplication'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x1737,0x147));var _0x7173=function(_0x176ca0,_0x31a832){_0x176ca0=_0x176ca0-0x0;var _0x78019a=_0x1737[_0x176ca0];return _0x78019a;};'use strict';var _=require(_0x7173('0x0'));var util=require(_0x7173('0x1'));var moment=require('moment');var BPromise=require(_0x7173('0x2'));var rs=require(_0x7173('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7173('0x4'))['db'];var utils=require(_0x7173('0x5'));var logger=require('../../config/logger')(_0x7173('0x6'));var config=require('../../config/environment');var jayson=require(_0x7173('0x7'));var client=jayson[_0x7173('0x8')][_0x7173('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3029ee,_0x2e3a78,_0x3e1f34){return new BPromise(function(_0x3c97f9,_0x2e9520){return client['request'](_0x3029ee,_0x3e1f34)[_0x7173('0xa')](function(_0x104bfa){logger[_0x7173('0xb')](_0x7173('0xc'),_0x2e3a78,'request\x20sent');logger[_0x7173('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x2e3a78,_0x7173('0xe'),JSON[_0x7173('0xf')](_0x104bfa));if(_0x104bfa[_0x7173('0x10')]){if(_0x104bfa['error'][_0x7173('0x11')]===0x1f4){logger[_0x7173('0x10')](_0x7173('0xc'),_0x2e3a78,_0x104bfa['error'][_0x7173('0x12')]);return _0x2e9520(_0x104bfa[_0x7173('0x10')][_0x7173('0x12')]);}logger[_0x7173('0x10')](_0x7173('0xc'),_0x2e3a78,_0x104bfa['error']['message']);return _0x3c97f9(_0x104bfa['error'][_0x7173('0x12')]);}else{logger[_0x7173('0xb')](_0x7173('0xc'),_0x2e3a78,_0x7173('0xe'));_0x3c97f9(_0x104bfa[_0x7173('0x13')][_0x7173('0x12')]);}})['catch'](function(_0x351eb6){logger['error'](_0x7173('0xc'),_0x2e3a78,_0x351eb6);_0x2e9520(_0x351eb6);});});}exports[_0x7173('0x14')]=function(_0x8fbc82){var _0x39a7ae=this;return new Promise(function(_0x460d81,_0x1ea347){return db[_0x7173('0x15')][_0x7173('0x16')](_0x8fbc82['body'],{'raw':_0x8fbc82[_0x7173('0x17')]?_0x8fbc82[_0x7173('0x17')][_0x7173('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8fbc82[_0x7173('0x17')]?_0x8fbc82[_0x7173('0x17')][_0x7173('0x19')]||null:null,'attributes':_0x8fbc82[_0x7173('0x17')]?_0x8fbc82[_0x7173('0x17')][_0x7173('0x1a')]||null:null,'limit':_0x8fbc82[_0x7173('0x17')]?_0x8fbc82[_0x7173('0x17')][_0x7173('0x1b')]||null:null})['then'](function(_0x5e6373){logger['info']('UpdateFaxApplication',_0x8fbc82);logger[_0x7173('0xd')](_0x7173('0x14'),_0x8fbc82,JSON[_0x7173('0xf')](_0x5e6373));_0x460d81(_0x5e6373);})[_0x7173('0x1c')](function(_0x4cd687){logger[_0x7173('0x10')]('UpdateFaxApplication',_0x4cd687[_0x7173('0x12')],_0x8fbc82);_0x1ea347(_0x39a7ae['error'](0x1f4,_0x4cd687['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 0d57163..d083e28 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 _0x8603=['../../components/interaction/service','./faxApplication.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x1e393b,_0x355f6b){var _0x3d0bfe=function(_0x320830){while(--_0x320830){_0x1e393b['push'](_0x1e393b['shift']());}};_0x3d0bfe(++_0x355f6b);}(_0x8603,0x190));var _0x3860=function(_0x25981f,_0x392e24){_0x25981f=_0x25981f-0x0;var _0x2aacbf=_0x8603[_0x25981f];return _0x2aacbf;};'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 _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x5e64bb,_0x1abf81){var _0x32cd6c=function(_0x22e596){while(--_0x22e596){_0x5e64bb['push'](_0x5e64bb['shift']());}};_0x32cd6c(++_0x1abf81);}(_0x2032,0xd9));var _0x2203=function(_0x4d0b56,_0x2f10a1){_0x4d0b56=_0x4d0b56-0x0;var _0x146c48=_0x2032[_0x4d0b56];return _0x146c48;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 63ea896..ce495d4 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 _0xb4f8=['BOOLEAN','DATE','STRING','ENUM','out','exports'];(function(_0x4092f7,_0xeeac3c){var _0x1e3948=function(_0x2c8fcb){while(--_0x2c8fcb){_0x4092f7['push'](_0x4092f7['shift']());}};_0x1e3948(++_0xeeac3c);}(_0xb4f8,0x83));var _0x8b4f=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xb4f8[_0x500419];return _0x241c1a;};'use strict';var Sequelize=require('sequelize');module[_0x8b4f('0x0')]={'closed':{'type':Sequelize[_0x8b4f('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8b4f('0x2')]},'disposition':{'type':Sequelize[_0x8b4f('0x3')]},'secondDisposition':{'type':Sequelize[_0x8b4f('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8b4f('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x8b4f('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x8b4f('0x4')]('in',_0x8b4f('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8b4f('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x8b4f('0x4')]('in',_0x8b4f('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xfb0a=['out','sequelize','BOOLEAN','DATE','STRING','ENUM'];(function(_0x22da20,_0x3a63c4){var _0x306203=function(_0x117e4b){while(--_0x117e4b){_0x22da20['push'](_0x22da20['shift']());}};_0x306203(++_0x3a63c4);}(_0xfb0a,0x7f));var _0xafb0=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0xfb0a[_0x5cb97e];return _0x1714b4;};'use strict';var Sequelize=require(_0xafb0('0x0'));module['exports']={'closed':{'type':Sequelize[_0xafb0('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xafb0('0x2')]},'disposition':{'type':Sequelize[_0xafb0('0x3')]},'secondDisposition':{'type':Sequelize[_0xafb0('0x3')]},'thirdDisposition':{'type':Sequelize[_0xafb0('0x3')]},'note':{'type':Sequelize[_0xafb0('0x3')]},'read1stAt':{'type':Sequelize[_0xafb0('0x2')]},'fax':{'type':Sequelize[_0xafb0('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xafb0('0x4')]('in',_0xafb0('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 95f28f4..655cb08 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 _0xee92=['keys','filters','attributes','intersection','fields','length','includeAll','include','merge','find','catch','create','update','body','describe','FaxMessage','addMessage','ids','findOne','nolimit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','rimraf','bluebird','util','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','redis','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','then','destroy','error','stack','name','index','map','FaxInteraction','rawAttributes','fieldName','type','findAll','fax','query','user','show','params','model'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xee92,0x16d));var _0x2ee9=function(_0x34dee1,_0x43eed8){_0x34dee1=_0x34dee1-0x0;var _0x1910ea=_0xee92[_0x34dee1];return _0x1910ea;};'use strict';var rimraf=require(_0x2ee9('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x2ee9('0x1'));var util=require(_0x2ee9('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0x2ee9('0x3'));var interaction=require(_0x2ee9('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x2ee9('0x5'))(_0x2ee9('0x6'));var config=require(_0x2ee9('0x7'));var db=require('../../mysqldb')['db'];config[_0x2ee9('0x8')]=_['defaults'](config[_0x2ee9('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x2ee9('0x9'))(new Redis(config['redis']));require(_0x2ee9('0xa'))[_0x2ee9('0xb')](socket);function respondWithStatusCode(_0x3b74d9,_0x41c0f4){_0x41c0f4=_0x41c0f4||0xcc;return function(_0x56a1f1){if(_0x56a1f1){return _0x3b74d9[_0x2ee9('0xc')](_0x41c0f4);}return _0x3b74d9[_0x2ee9('0xd')](_0x41c0f4)[_0x2ee9('0xe')]();};}function respondWithResult(_0x43890c,_0x5b242d){_0x5b242d=_0x5b242d||0xc8;return function(_0xf49f9){if(_0xf49f9){return _0x43890c[_0x2ee9('0xd')](_0x5b242d)['json'](_0xf49f9);}};}function respondWithFilteredResult(_0x547f68,_0x3a607b){return function(_0x3ccb37){if(_0x3ccb37){var _0x5f3d27=typeof _0x3a607b[_0x2ee9('0xf')]===_0x2ee9('0x10')&&typeof _0x3a607b[_0x2ee9('0x11')]===_0x2ee9('0x10');var _0x50246e=_0x3ccb37['count'];var _0x4ab70b=_0x5f3d27?0x0:_0x3a607b['offset'];var _0x3dfad5=_0x5f3d27?_0x3ccb37[_0x2ee9('0x12')]:_0x3a607b[_0x2ee9('0xf')]+_0x3a607b['limit'];var _0x353a8d;if(_0x3dfad5>=_0x50246e){_0x3dfad5=_0x50246e;_0x353a8d=0xc8;}else{_0x353a8d=0xce;}_0x547f68[_0x2ee9('0xd')](_0x353a8d);return _0x547f68[_0x2ee9('0x13')](_0x2ee9('0x14'),_0x4ab70b+'-'+_0x3dfad5+'/'+_0x50246e)['json'](_0x3ccb37);}return null;};}function saveUpdates(_0x4afa7c){return function(_0x2009a0){if(_0x2009a0){return _0x2009a0['update'](_0x4afa7c)[_0x2ee9('0x15')](function(_0x4bab6a){return _0x4bab6a;});}return null;};}function removeEntity(_0x12327a){return function(_0x41f2ae){if(_0x41f2ae){return _0x41f2ae[_0x2ee9('0x16')]()['then'](function(){_0x12327a['status'](0xcc)[_0x2ee9('0xe')]();});}};}function handleEntityNotFound(_0x26b697){return function(_0x18c1d4){if(!_0x18c1d4){_0x26b697['sendStatus'](0x194);}return _0x18c1d4;};}function handleError(_0x2031ad,_0x3707ae){_0x3707ae=_0x3707ae||0x1f4;return function(_0x44f9d9){logger[_0x2ee9('0x17')](_0x44f9d9[_0x2ee9('0x18')]);if(_0x44f9d9[_0x2ee9('0x19')]){delete _0x44f9d9[_0x2ee9('0x19')];}_0x2031ad[_0x2ee9('0xd')](_0x3707ae)['send'](_0x44f9d9);};}exports[_0x2ee9('0x1a')]=function(_0x42f8d5,_0x252e48){var _0x51f695={};var _0x2ca574=_[_0x2ee9('0x1b')](db[_0x2ee9('0x1c')][_0x2ee9('0x1d')],function(_0x3936a7){return{'name':_0x3936a7[_0x2ee9('0x1e')],'type':_0x3936a7[_0x2ee9('0x1f')]['key']};});_0x51f695=qs['getOptions'](_0x2ca574,_0x42f8d5);return interaction[_0x2ee9('0x20')](_0x2ee9('0x21'),_0x42f8d5[_0x2ee9('0x22')],_0x42f8d5[_0x2ee9('0x23')],_0x51f695,_0x2ca574)[_0x2ee9('0x15')](respondWithFilteredResult(_0x252e48,_0x51f695))['catch'](handleError(_0x252e48,null));};exports[_0x2ee9('0x24')]=function(_0xd84c78,_0x9561e1){var _0x2629b3={'raw':![],'where':{'id':_0xd84c78[_0x2ee9('0x25')]['id']}},_0x2b5b94={};_0x2b5b94[_0x2ee9('0x26')]=_[_0x2ee9('0x27')](db[_0x2ee9('0x1c')]['rawAttributes']);_0x2b5b94[_0x2ee9('0x22')]=_['keys'](_0xd84c78[_0x2ee9('0x22')]);_0x2b5b94[_0x2ee9('0x28')]=_['intersection'](_0x2b5b94[_0x2ee9('0x26')],_0x2b5b94['query']);_0x2629b3[_0x2ee9('0x29')]=_[_0x2ee9('0x2a')](_0x2b5b94[_0x2ee9('0x26')],qs[_0x2ee9('0x2b')](_0xd84c78[_0x2ee9('0x22')]['fields']));_0x2629b3[_0x2ee9('0x29')]=_0x2629b3[_0x2ee9('0x29')][_0x2ee9('0x2c')]?_0x2629b3['attributes']:_0x2b5b94[_0x2ee9('0x26')];if(_0xd84c78[_0x2ee9('0x22')][_0x2ee9('0x2d')]){_0x2629b3[_0x2ee9('0x2e')]=[{'all':!![]}];}_0x2629b3=_[_0x2ee9('0x2f')]({},_0x2629b3,_0xd84c78['options']);return db[_0x2ee9('0x1c')][_0x2ee9('0x30')](_0x2629b3)[_0x2ee9('0x15')](handleEntityNotFound(_0x9561e1,null))[_0x2ee9('0x15')](respondWithResult(_0x9561e1,null))[_0x2ee9('0x31')](handleError(_0x9561e1,null));};exports[_0x2ee9('0x32')]=function(_0x35bf2f,_0x54f862){return db[_0x2ee9('0x1c')][_0x2ee9('0x32')](_0x35bf2f['body'],{})[_0x2ee9('0x15')](respondWithResult(_0x54f862,0xc9))[_0x2ee9('0x31')](handleError(_0x54f862,null));};exports[_0x2ee9('0x33')]=function(_0x5d837c,_0x4bed20){if(_0x5d837c[_0x2ee9('0x34')]['id']){delete _0x5d837c[_0x2ee9('0x34')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x5d837c[_0x2ee9('0x25')]['id']}})[_0x2ee9('0x15')](handleEntityNotFound(_0x4bed20,null))[_0x2ee9('0x15')](saveUpdates(_0x5d837c['body'],null))[_0x2ee9('0x15')](respondWithResult(_0x4bed20,null))['catch'](handleError(_0x4bed20,null));};exports[_0x2ee9('0x16')]=function(_0x4e72b6,_0x1d05c7){return db[_0x2ee9('0x1c')][_0x2ee9('0x30')]({'where':{'id':_0x4e72b6[_0x2ee9('0x25')]['id']}})['then'](handleEntityNotFound(_0x1d05c7,null))['then'](removeEntity(_0x1d05c7,null))['catch'](handleError(_0x1d05c7,null));};exports['describe']=function(_0x35cd8a,_0x183283){return db[_0x2ee9('0x1c')][_0x2ee9('0x35')]()[_0x2ee9('0x15')](respondWithResult(_0x183283,null))['catch'](handleError(_0x183283,null));};exports['addMessage']=function(_0x45143b,_0xa03112){return db[_0x2ee9('0x36')][_0x2ee9('0x30')]({'where':{'id':_0x45143b[_0x2ee9('0x25')]['id']}})[_0x2ee9('0x15')](handleEntityNotFound(_0xa03112,null))[_0x2ee9('0x15')](function(_0x4ae366){if(_0x4ae366){return _0x4ae366[_0x2ee9('0x37')](_0x45143b[_0x2ee9('0x34')][_0x2ee9('0x38')],_['omit'](_0x45143b[_0x2ee9('0x34')],['ids','id'])||{});}})[_0x2ee9('0x15')](respondWithResult(_0xa03112,null))[_0x2ee9('0x31')](handleError(_0xa03112,null));};exports['getMessages']=function(_0x5849b4,_0x1fc5ee){var _0x3c0747={'raw':![],'where':{}};var _0x3984e0={};var _0x2ec9c5={'count':0x0,'rows':[]};return db[_0x2ee9('0x1c')][_0x2ee9('0x39')]({'where':{'id':_0x5849b4[_0x2ee9('0x25')]['id']}})[_0x2ee9('0x15')](handleEntityNotFound(_0x1fc5ee,null))['then'](function(_0x2a7ee7){if(_0x2a7ee7){_0x3984e0[_0x2ee9('0x26')]=_[_0x2ee9('0x27')](db[_0x2ee9('0x36')]['rawAttributes']);_0x3984e0[_0x2ee9('0x22')]=_[_0x2ee9('0x27')](_0x5849b4[_0x2ee9('0x22')]);_0x3984e0[_0x2ee9('0x28')]=_[_0x2ee9('0x2a')](_0x3984e0[_0x2ee9('0x26')],_0x3984e0[_0x2ee9('0x22')]);_0x3c0747[_0x2ee9('0x29')]=_[_0x2ee9('0x2a')](_0x3984e0[_0x2ee9('0x26')],qs[_0x2ee9('0x2b')](_0x5849b4[_0x2ee9('0x22')]['fields']));_0x3c0747[_0x2ee9('0x29')]=_0x3c0747[_0x2ee9('0x29')][_0x2ee9('0x2c')]?_0x3c0747[_0x2ee9('0x29')]:_0x3984e0[_0x2ee9('0x26')];if(!_0x5849b4[_0x2ee9('0x22')]['hasOwnProperty'](_0x2ee9('0x3a'))){_0x3c0747['limit']=qs[_0x2ee9('0x11')](_0x5849b4[_0x2ee9('0x22')][_0x2ee9('0x11')]);_0x3c0747[_0x2ee9('0xf')]=qs['offset'](_0x5849b4['query']['offset']);}_0x3c0747[_0x2ee9('0x3b')]=qs[_0x2ee9('0x3c')](_0x5849b4[_0x2ee9('0x22')][_0x2ee9('0x3c')]);_0x3c0747[_0x2ee9('0x3d')]=qs[_0x2ee9('0x28')](_[_0x2ee9('0x3e')](_0x5849b4[_0x2ee9('0x22')],_0x3984e0[_0x2ee9('0x28')]));_0x3c0747['where']['FaxInteractionId']=_0x2a7ee7['id'];if(_0x5849b4[_0x2ee9('0x22')][_0x2ee9('0x3f')]){_0x3c0747[_0x2ee9('0x3d')]=_[_0x2ee9('0x2f')](_0x3c0747[_0x2ee9('0x3d')],{'$or':_[_0x2ee9('0x1b')](_0x3c0747[_0x2ee9('0x29')],function(_0x24d44a){var _0x4e07bd={};_0x4e07bd[_0x24d44a]={'$like':'%'+_0x5849b4[_0x2ee9('0x22')][_0x2ee9('0x3f')]+'%'};return _0x4e07bd;})});}if(_0x5849b4['query'][_0x2ee9('0x40')]){var _0x127566=_0x5849b4[_0x2ee9('0x22')][_0x2ee9('0x40')][_0x2ee9('0x41')](',');var _0x57e3b2={};_0x57e3b2[_0x127566[0x0]]={'$gte':moment(_0x127566[0x1])[_0x2ee9('0x42')](_0x2ee9('0x43'))};_0x3c0747[_0x2ee9('0x3d')]=_[_0x2ee9('0x2f')](_0x3c0747['where'],_0x57e3b2);}_0x3c0747=_[_0x2ee9('0x2f')]({},_0x3c0747,_0x5849b4['options']);return db['FaxMessage'][_0x2ee9('0x12')]({'where':_0x3c0747[_0x2ee9('0x3d')]})[_0x2ee9('0x15')](function(_0x23c2d2){_0x2ec9c5[_0x2ee9('0x12')]=_0x23c2d2;if(_0x5849b4[_0x2ee9('0x22')][_0x2ee9('0x2d')]){_0x3c0747['include']=[{'all':!![]}];}return db[_0x2ee9('0x36')][_0x2ee9('0x20')](_0x3c0747);})['then'](function(_0x368652){_0x2ec9c5[_0x2ee9('0x44')]=_0x368652;return _0x2ec9c5;});}})['then'](respondWithFilteredResult(_0x1fc5ee,_0x3c0747))[_0x2ee9('0x31')](handleError(_0x1fc5ee,null));};exports[_0x2ee9('0x45')]=function(_0x5c4864,_0x35d127){return db[_0x2ee9('0x1c')][_0x2ee9('0x30')]({'where':{'id':_0x5c4864[_0x2ee9('0x25')]['id']}})[_0x2ee9('0x15')](handleEntityNotFound(_0x35d127,null))[_0x2ee9('0x15')](function(_0x579965){if(_0x579965){return _0x579965[_0x2ee9('0x46')](_0x5c4864[_0x2ee9('0x34')][_0x2ee9('0x38')],_[_0x2ee9('0x47')](_0x5c4864['body'],[_0x2ee9('0x38'),'id'])||{})['spread'](function(){return db['Tag'][_0x2ee9('0x20')]({'attributes':['id',_0x2ee9('0x19'),_0x2ee9('0x48')],'where':{'id':_0x5c4864[_0x2ee9('0x34')]['ids']}});})['then'](function(_0x36f5d0){socket[_0x2ee9('0x49')](_0x2ee9('0x4a'),{'id':Number(_0x5c4864['params']['id']),'tags':_0x36f5d0||[]});return{'id':Number(_0x5c4864['params']['id']),'tags':_0x36f5d0||[]};});}})[_0x2ee9('0x15')](respondWithResult(_0x35d127,null))[_0x2ee9('0x31')](handleError(_0x35d127,null));};exports[_0x2ee9('0x4b')]=function(_0x1874b0,_0x59aa6f){return db['FaxInteraction'][_0x2ee9('0x30')]({'where':{'id':_0x1874b0[_0x2ee9('0x25')]['id']}})[_0x2ee9('0x15')](handleEntityNotFound(_0x59aa6f,null))[_0x2ee9('0x15')](function(_0x46f906){if(_0x46f906){return _0x46f906[_0x2ee9('0x4b')](_0x1874b0[_0x2ee9('0x22')][_0x2ee9('0x38')]);}})['then'](respondWithStatusCode(_0x59aa6f,null))[_0x2ee9('0x31')](handleError(_0x59aa6f,null));};exports[_0x2ee9('0x4c')]=function(_0x527a65,_0x29a874){var _0x4cffcf=moment()[_0x2ee9('0x4d')]()[_0x2ee9('0x4e')]();var _0x5b9f37=path[_0x2ee9('0x4f')](config[_0x2ee9('0x50')],_0x2ee9('0x51'),_0x2ee9('0x52'),_0x2ee9('0x53'));var _0x5f3354=path[_0x2ee9('0x4f')](config[_0x2ee9('0x50')],'server',_0x2ee9('0x52'),_0x2ee9('0x54'));var _0x4de2aa=path['join'](_0x5b9f37,_0x4cffcf);var _0x1fc7a6=util[_0x2ee9('0x42')](_0x2ee9('0x55'),_0x527a65['params']['id'],_0x4cffcf);var _0xc1bed=path['join'](_0x5b9f37,_0x1fc7a6);var _0x55bdfb=[];_0x55bdfb[_0x2ee9('0x56')]({'model':db[_0x2ee9('0x57')],'as':_0x2ee9('0x57'),'raw':!![]});var _0x1156ca=[{'model':db[_0x2ee9('0x36')],'as':_0x2ee9('0x58'),'attributes':['id','body',_0x2ee9('0x59')],'include':_0x55bdfb}];return db['FaxInteraction']['find']({'where':{'id':_0x527a65[_0x2ee9('0x25')]['id']},'include':_0x1156ca})[_0x2ee9('0x15')](handleEntityNotFound(_0x29a874,null))[_0x2ee9('0x15')](function(_0x46b100){if(_0x46b100&&_0x46b100[_0x2ee9('0x58')]){var _0x2d7ba8=_0x46b100[_0x2ee9('0x5a')]({'plain':!![]});fs[_0x2ee9('0x5b')](_0x4de2aa);for(var _0x32286b=0x0;_0x32286b<_0x2d7ba8['Messages'][_0x2ee9('0x2c')];_0x32286b++){var _0x985bb4=_0x2d7ba8[_0x2ee9('0x58')][_0x32286b][_0x2ee9('0x57')];if(_0x985bb4){var _0x37d95f=path[_0x2ee9('0x4f')](_0x5f3354,_0x985bb4[_0x2ee9('0x5c')]);if(fs[_0x2ee9('0x5d')](_0x37d95f)){fs[_0x2ee9('0x5e')](_0x37d95f)[_0x2ee9('0x5f')](fs[_0x2ee9('0x60')](path['join'](_0x4de2aa,_0x985bb4['basename'])));}}}return BPromise[_0x2ee9('0x61')]()[_0x2ee9('0x15')](function(){return new BPromise(function(_0x1aa74c,_0x23e09f){zipdir(_0x4de2aa,{'saveTo':_0xc1bed},function(_0x4cd0de,_0x2ce93d){if(_0x4cd0de)return _0x23e09f(_0x4cd0de);return _0x1aa74c(_0x2ce93d);});})[_0x2ee9('0x15')](function(){return new BPromise(function(_0x40ec61,_0x362451){rimraf(_0x4de2aa,function(_0x16b108){if(_0x16b108)_0x362451(_0x16b108);return _0x40ec61();});});})[_0x2ee9('0x15')](function(){return _0x29a874['download'](_0xc1bed,_0x1fc7a6,function(_0x276a55){if(_0x276a55){console[_0x2ee9('0x62')](_0x2ee9('0x63'),_0x276a55);}else{fs[_0x2ee9('0x64')](_0xc1bed);}});});});}else{return _0x29a874['sendStatus'](0xc8);}})['catch'](handleError(_0x29a874,null));}; \ No newline at end of file +var _0x106c=['setTags','Tag','color','emit','removeTags','download','unix','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','basename','pipe','createWriteStream','resolve','unlinkSync','rimraf','zip-dir','bluebird','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','update','then','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query','user','catch','show','params','model','keys','filters','intersection','attributes','length','includeAll','include','merge','options','find','create','body','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','nolimit','sort','where','pick','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','addTags'];(function(_0xd1f021,_0x5856c7){var _0x5ef4a4=function(_0x101973){while(--_0x101973){_0xd1f021['push'](_0xd1f021['shift']());}};_0x5ef4a4(++_0x5856c7);}(_0x106c,0x151));var _0xc106=function(_0x33a86f,_0x3e0e7f){_0x33a86f=_0x33a86f-0x0;var _0x70610c=_0x106c[_0x33a86f];return _0x70610c;};'use strict';var rimraf=require(_0xc106('0x0'));var zipdir=require(_0xc106('0x1'));var moment=require('moment');var BPromise=require(_0xc106('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0xc106('0x3'));var Redis=require(_0xc106('0x4'));var interaction=require(_0xc106('0x5'));var qs=require(_0xc106('0x6'));var logger=require(_0xc106('0x7'))(_0xc106('0x8'));var config=require(_0xc106('0x9'));var db=require(_0xc106('0xa'))['db'];config[_0xc106('0xb')]=_[_0xc106('0xc')](config[_0xc106('0xb')],{'host':_0xc106('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc106('0xb')]));require(_0xc106('0xe'))[_0xc106('0xf')](socket);function respondWithStatusCode(_0x5fe5bd,_0x47251c){_0x47251c=_0x47251c||0xcc;return function(_0x47d10b){if(_0x47d10b){return _0x5fe5bd[_0xc106('0x10')](_0x47251c);}return _0x5fe5bd['status'](_0x47251c)[_0xc106('0x11')]();};}function respondWithResult(_0x55861a,_0x2430f8){_0x2430f8=_0x2430f8||0xc8;return function(_0x56160b){if(_0x56160b){return _0x55861a[_0xc106('0x12')](_0x2430f8)['json'](_0x56160b);}};}function respondWithFilteredResult(_0x2104f7,_0x4d7f7d){return function(_0x36873b){if(_0x36873b){var _0x3e3be8=typeof _0x4d7f7d[_0xc106('0x13')]===_0xc106('0x14')&&typeof _0x4d7f7d[_0xc106('0x15')]===_0xc106('0x14');var _0x532136=_0x36873b[_0xc106('0x16')];var _0x4b2c43=_0x3e3be8?0x0:_0x4d7f7d[_0xc106('0x13')];var _0x2e6921=_0x3e3be8?_0x36873b[_0xc106('0x16')]:_0x4d7f7d['offset']+_0x4d7f7d[_0xc106('0x15')];var _0x50b4fe;if(_0x2e6921>=_0x532136){_0x2e6921=_0x532136;_0x50b4fe=0xc8;}else{_0x50b4fe=0xce;}_0x2104f7[_0xc106('0x12')](_0x50b4fe);return _0x2104f7[_0xc106('0x17')](_0xc106('0x18'),_0x4b2c43+'-'+_0x2e6921+'/'+_0x532136)[_0xc106('0x19')](_0x36873b);}return null;};}function saveUpdates(_0x2ac0b2){return function(_0x16fab0){if(_0x16fab0){return _0x16fab0[_0xc106('0x1a')](_0x2ac0b2)[_0xc106('0x1b')](function(_0x4ee17a){return _0x4ee17a;});}return null;};}function removeEntity(_0x21dc63){return function(_0x2b585a){if(_0x2b585a){return _0x2b585a['destroy']()[_0xc106('0x1b')](function(){_0x21dc63[_0xc106('0x12')](0xcc)[_0xc106('0x11')]();});}};}function handleEntityNotFound(_0x464238){return function(_0x1c0db2){if(!_0x1c0db2){_0x464238[_0xc106('0x10')](0x194);}return _0x1c0db2;};}function handleError(_0x522eaa,_0x551109){_0x551109=_0x551109||0x1f4;return function(_0x7cdc47){logger[_0xc106('0x1c')](_0x7cdc47[_0xc106('0x1d')]);if(_0x7cdc47[_0xc106('0x1e')]){delete _0x7cdc47[_0xc106('0x1e')];}_0x522eaa['status'](_0x551109)[_0xc106('0x1f')](_0x7cdc47);};}exports[_0xc106('0x20')]=function(_0x2005fd,_0x32ea9e){var _0x3c4603={};var _0x5bb200=_[_0xc106('0x21')](db[_0xc106('0x22')][_0xc106('0x23')],function(_0x453799){return{'name':_0x453799[_0xc106('0x24')],'type':_0x453799[_0xc106('0x25')][_0xc106('0x26')]};});_0x3c4603=qs[_0xc106('0x27')](_0x5bb200,_0x2005fd);return interaction[_0xc106('0x28')](_0xc106('0x29'),_0x2005fd[_0xc106('0x2a')],_0x2005fd[_0xc106('0x2b')],_0x3c4603,_0x5bb200)[_0xc106('0x1b')](respondWithFilteredResult(_0x32ea9e,_0x3c4603))[_0xc106('0x2c')](handleError(_0x32ea9e,null));};exports[_0xc106('0x2d')]=function(_0x1eb534,_0x2e418c){var _0x2ee79f={'raw':![],'where':{'id':_0x1eb534[_0xc106('0x2e')]['id']}},_0x3861a2={};_0x3861a2[_0xc106('0x2f')]=_['keys'](db[_0xc106('0x22')]['rawAttributes']);_0x3861a2[_0xc106('0x2a')]=_[_0xc106('0x30')](_0x1eb534[_0xc106('0x2a')]);_0x3861a2[_0xc106('0x31')]=_[_0xc106('0x32')](_0x3861a2['model'],_0x3861a2[_0xc106('0x2a')]);_0x2ee79f[_0xc106('0x33')]=_[_0xc106('0x32')](_0x3861a2[_0xc106('0x2f')],qs['fields'](_0x1eb534[_0xc106('0x2a')]['fields']));_0x2ee79f[_0xc106('0x33')]=_0x2ee79f[_0xc106('0x33')][_0xc106('0x34')]?_0x2ee79f[_0xc106('0x33')]:_0x3861a2[_0xc106('0x2f')];if(_0x1eb534['query'][_0xc106('0x35')]){_0x2ee79f[_0xc106('0x36')]=[{'all':!![]}];}_0x2ee79f=_[_0xc106('0x37')]({},_0x2ee79f,_0x1eb534[_0xc106('0x38')]);return db['FaxInteraction'][_0xc106('0x39')](_0x2ee79f)['then'](handleEntityNotFound(_0x2e418c,null))[_0xc106('0x1b')](respondWithResult(_0x2e418c,null))['catch'](handleError(_0x2e418c,null));};exports[_0xc106('0x3a')]=function(_0x2bb7e5,_0x438a59){return db[_0xc106('0x22')][_0xc106('0x3a')](_0x2bb7e5[_0xc106('0x3b')],{})['then'](respondWithResult(_0x438a59,0xc9))[_0xc106('0x2c')](handleError(_0x438a59,null));};exports[_0xc106('0x1a')]=function(_0x1e99b8,_0x3ed5d0){if(_0x1e99b8[_0xc106('0x3b')]['id']){delete _0x1e99b8[_0xc106('0x3b')]['id'];}return db[_0xc106('0x22')][_0xc106('0x39')]({'where':{'id':_0x1e99b8[_0xc106('0x2e')]['id']}})[_0xc106('0x1b')](handleEntityNotFound(_0x3ed5d0,null))[_0xc106('0x1b')](saveUpdates(_0x1e99b8[_0xc106('0x3b')],null))[_0xc106('0x1b')](respondWithResult(_0x3ed5d0,null))[_0xc106('0x2c')](handleError(_0x3ed5d0,null));};exports[_0xc106('0x3c')]=function(_0x40c8f8,_0x89839b){return db[_0xc106('0x22')][_0xc106('0x39')]({'where':{'id':_0x40c8f8[_0xc106('0x2e')]['id']}})[_0xc106('0x1b')](handleEntityNotFound(_0x89839b,null))['then'](removeEntity(_0x89839b,null))[_0xc106('0x2c')](handleError(_0x89839b,null));};exports[_0xc106('0x3d')]=function(_0xdf333f,_0x28ad54){return db[_0xc106('0x22')][_0xc106('0x3d')]()[_0xc106('0x1b')](respondWithResult(_0x28ad54,null))[_0xc106('0x2c')](handleError(_0x28ad54,null));};exports[_0xc106('0x3e')]=function(_0x296fe7,_0x562e1f){return db[_0xc106('0x3f')]['find']({'where':{'id':_0x296fe7['params']['id']}})[_0xc106('0x1b')](handleEntityNotFound(_0x562e1f,null))[_0xc106('0x1b')](function(_0x2e0c4c){if(_0x2e0c4c){return _0x2e0c4c['addMessage'](_0x296fe7[_0xc106('0x3b')][_0xc106('0x40')],_[_0xc106('0x41')](_0x296fe7[_0xc106('0x3b')],[_0xc106('0x40'),'id'])||{});}})['then'](respondWithResult(_0x562e1f,null))['catch'](handleError(_0x562e1f,null));};exports[_0xc106('0x42')]=function(_0xbc3f40,_0x2f5b6f){var _0x1f54d3={'raw':![],'where':{}};var _0x1f916b={};var _0x375e09={'count':0x0,'rows':[]};return db[_0xc106('0x22')][_0xc106('0x43')]({'where':{'id':_0xbc3f40[_0xc106('0x2e')]['id']}})[_0xc106('0x1b')](handleEntityNotFound(_0x2f5b6f,null))[_0xc106('0x1b')](function(_0x5444bf){if(_0x5444bf){_0x1f916b[_0xc106('0x2f')]=_[_0xc106('0x30')](db['FaxMessage']['rawAttributes']);_0x1f916b[_0xc106('0x2a')]=_[_0xc106('0x30')](_0xbc3f40['query']);_0x1f916b[_0xc106('0x31')]=_['intersection'](_0x1f916b[_0xc106('0x2f')],_0x1f916b[_0xc106('0x2a')]);_0x1f54d3[_0xc106('0x33')]=_[_0xc106('0x32')](_0x1f916b[_0xc106('0x2f')],qs['fields'](_0xbc3f40[_0xc106('0x2a')]['fields']));_0x1f54d3[_0xc106('0x33')]=_0x1f54d3[_0xc106('0x33')]['length']?_0x1f54d3[_0xc106('0x33')]:_0x1f916b[_0xc106('0x2f')];if(!_0xbc3f40['query']['hasOwnProperty'](_0xc106('0x44'))){_0x1f54d3['limit']=qs[_0xc106('0x15')](_0xbc3f40['query'][_0xc106('0x15')]);_0x1f54d3['offset']=qs[_0xc106('0x13')](_0xbc3f40[_0xc106('0x2a')][_0xc106('0x13')]);}_0x1f54d3['order']=qs[_0xc106('0x45')](_0xbc3f40['query']['sort']);_0x1f54d3[_0xc106('0x46')]=qs['filters'](_[_0xc106('0x47')](_0xbc3f40['query'],_0x1f916b['filters']));_0x1f54d3['where'][_0xc106('0x48')]=_0x5444bf['id'];if(_0xbc3f40['query'][_0xc106('0x49')]){_0x1f54d3[_0xc106('0x46')]=_[_0xc106('0x37')](_0x1f54d3[_0xc106('0x46')],{'$or':_['map'](_0x1f54d3['attributes'],function(_0x213ccd){var _0x5f2fa2={};_0x5f2fa2[_0x213ccd]={'$like':'%'+_0xbc3f40[_0xc106('0x2a')]['filter']+'%'};return _0x5f2fa2;})});}if(_0xbc3f40['query'][_0xc106('0x4a')]){var _0xecf664=_0xbc3f40[_0xc106('0x2a')]['$gte'][_0xc106('0x4b')](',');var _0x52b54a={};_0x52b54a[_0xecf664[0x0]]={'$gte':moment(_0xecf664[0x1])[_0xc106('0x4c')](_0xc106('0x4d'))};_0x1f54d3[_0xc106('0x46')]=_[_0xc106('0x37')](_0x1f54d3[_0xc106('0x46')],_0x52b54a);}_0x1f54d3=_[_0xc106('0x37')]({},_0x1f54d3,_0xbc3f40[_0xc106('0x38')]);return db['FaxMessage'][_0xc106('0x16')]({'where':_0x1f54d3[_0xc106('0x46')]})[_0xc106('0x1b')](function(_0x33934e){_0x375e09[_0xc106('0x16')]=_0x33934e;if(_0xbc3f40[_0xc106('0x2a')][_0xc106('0x35')]){_0x1f54d3[_0xc106('0x36')]=[{'all':!![]}];}return db[_0xc106('0x3f')][_0xc106('0x28')](_0x1f54d3);})[_0xc106('0x1b')](function(_0x14e9ef){_0x375e09['rows']=_0x14e9ef;return _0x375e09;});}})[_0xc106('0x1b')](respondWithFilteredResult(_0x2f5b6f,_0x1f54d3))['catch'](handleError(_0x2f5b6f,null));};exports[_0xc106('0x4e')]=function(_0x4f194d,_0xd69456){return db[_0xc106('0x22')][_0xc106('0x39')]({'where':{'id':_0x4f194d[_0xc106('0x2e')]['id']}})[_0xc106('0x1b')](handleEntityNotFound(_0xd69456,null))[_0xc106('0x1b')](function(_0x34ac19){if(_0x34ac19){return _0x34ac19[_0xc106('0x4f')](_0x4f194d['body'][_0xc106('0x40')],_[_0xc106('0x41')](_0x4f194d[_0xc106('0x3b')],[_0xc106('0x40'),'id'])||{})['spread'](function(){return db[_0xc106('0x50')][_0xc106('0x28')]({'attributes':['id',_0xc106('0x1e'),_0xc106('0x51')],'where':{'id':_0x4f194d[_0xc106('0x3b')][_0xc106('0x40')]}});})[_0xc106('0x1b')](function(_0x153aae){socket[_0xc106('0x52')]('faxInteractionTags:save',{'id':Number(_0x4f194d[_0xc106('0x2e')]['id']),'tags':_0x153aae||[]});return{'id':Number(_0x4f194d[_0xc106('0x2e')]['id']),'tags':_0x153aae||[]};});}})[_0xc106('0x1b')](respondWithResult(_0xd69456,null))[_0xc106('0x2c')](handleError(_0xd69456,null));};exports[_0xc106('0x53')]=function(_0x4c1739,_0x1c5f3e){return db[_0xc106('0x22')]['find']({'where':{'id':_0x4c1739[_0xc106('0x2e')]['id']}})[_0xc106('0x1b')](handleEntityNotFound(_0x1c5f3e,null))[_0xc106('0x1b')](function(_0x335113){if(_0x335113){return _0x335113[_0xc106('0x53')](_0x4c1739['query'][_0xc106('0x40')]);}})[_0xc106('0x1b')](respondWithStatusCode(_0x1c5f3e,null))[_0xc106('0x2c')](handleError(_0x1c5f3e,null));};exports[_0xc106('0x54')]=function(_0x139199,_0xc0f64e){var _0x2e7002=moment()[_0xc106('0x55')]()[_0xc106('0x56')]();var _0x5d6989=path['join'](config[_0xc106('0x57')],_0xc106('0x58'),_0xc106('0x59'),_0xc106('0x5a'));var _0x3d5e81=path[_0xc106('0x5b')](config[_0xc106('0x57')],_0xc106('0x58'),'files',_0xc106('0x5c'));var _0x2b273e=path[_0xc106('0x5b')](_0x5d6989,_0x2e7002);var _0x2ac617=util[_0xc106('0x4c')](_0xc106('0x5d'),_0x139199[_0xc106('0x2e')]['id'],_0x2e7002);var _0xd0bc6d=path[_0xc106('0x5b')](_0x5d6989,_0x2ac617);var _0xa30f5=[];_0xa30f5[_0xc106('0x5e')]({'model':db['Attachment'],'as':_0xc106('0x5f'),'raw':!![]});var _0x24620a=[{'model':db[_0xc106('0x3f')],'as':_0xc106('0x60'),'attributes':['id',_0xc106('0x3b'),_0xc106('0x61')],'include':_0xa30f5}];return db['FaxInteraction'][_0xc106('0x39')]({'where':{'id':_0x139199[_0xc106('0x2e')]['id']},'include':_0x24620a})[_0xc106('0x1b')](handleEntityNotFound(_0xc0f64e,null))[_0xc106('0x1b')](function(_0x5098be){if(_0x5098be&&_0x5098be[_0xc106('0x60')]){var _0x36ef0e=_0x5098be[_0xc106('0x62')]({'plain':!![]});fs['mkdirSync'](_0x2b273e);for(var _0x1a13a6=0x0;_0x1a13a6<_0x36ef0e[_0xc106('0x60')][_0xc106('0x34')];_0x1a13a6++){var _0x20089d=_0x36ef0e['Messages'][_0x1a13a6][_0xc106('0x5f')];if(_0x20089d){var _0x5b3ed1=path['join'](_0x3d5e81,_0x20089d[_0xc106('0x63')]);if(fs['existsSync'](_0x5b3ed1)){fs['createReadStream'](_0x5b3ed1)[_0xc106('0x64')](fs[_0xc106('0x65')](path[_0xc106('0x5b')](_0x2b273e,_0x20089d['basename'])));}}}return BPromise[_0xc106('0x66')]()[_0xc106('0x1b')](function(){return new BPromise(function(_0x1bdfdd,_0x207fcb){zipdir(_0x2b273e,{'saveTo':_0xd0bc6d},function(_0x457e4f,_0x110619){if(_0x457e4f)return _0x207fcb(_0x457e4f);return _0x1bdfdd(_0x110619);});})[_0xc106('0x1b')](function(){return new BPromise(function(_0x1ee2b3,_0x4ab595){rimraf(_0x2b273e,function(_0x308537){if(_0x308537)_0x4ab595(_0x308537);return _0x1ee2b3();});});})[_0xc106('0x1b')](function(){return _0xc0f64e[_0xc106('0x54')](_0xd0bc6d,_0x2ac617,function(_0x7e5a58){if(_0x7e5a58){console['log']('err',_0x7e5a58);}else{fs[_0xc106('0x67')](_0xd0bc6d);}});});});}else{return _0xc0f64e[_0xc106('0x10')](0xc8);}})[_0xc106('0x2c')](handleError(_0xc0f64e,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 9ef975b..1bf70bc 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 _0x0660=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update','then','setDataValue','findAll','unreadMessages','length','emit'];(function(_0xbbd5cc,_0x5c72d5){var _0x1d7c29=function(_0x1ba8bc){while(--_0x1ba8bc){_0xbbd5cc['push'](_0xbbd5cc['shift']());}};_0x1d7c29(++_0x5c72d5);}(_0x0660,0x120));var _0x0066=function(_0x39a1a2,_0x41df12){_0x39a1a2=_0x39a1a2-0x0;var _0x23371b=_0x0660[_0x39a1a2];return _0x23371b;};'use strict';var EventEmitter=require(_0x0066('0x0'));var FaxInteraction=require(_0x0066('0x1'))['db'][_0x0066('0x2')];var FaxMessage=require(_0x0066('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x0066('0x3')](0x0);var events={'afterCreate':_0x0066('0x4'),'afterUpdate':_0x0066('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5c1476){return function(_0x5064da,_0x496a3f,_0x5709b0){_0x5064da['getUsers']({'attributes':['id'],'raw':!![]})[_0x0066('0x6')](function(_0x491c97){_0x5064da[_0x0066('0x7')]('Users',_0x491c97['map'](function(_0x34e31b){return{'id':_0x34e31b['id']};}));return FaxMessage[_0x0066('0x8')]({'where':{'FaxInteractionId':_0x5064da['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0066('0x6')](function(_0x50bf4a){_0x5064da[_0x0066('0x7')](_0x0066('0x9'),_0x50bf4a[_0x0066('0xa')]);FaxInteractionEvents[_0x0066('0xb')](_0x5c1476+':'+_0x5064da['id'],_0x5064da);FaxInteractionEvents[_0x0066('0xb')](_0x5c1476,_0x5064da);_0x5709b0(null);})['catch'](_0x5709b0(null));};}for(var e in events){if(events[_0x0066('0xc')](e)){var event=events[e];FaxInteraction[_0x0066('0xd')](e,emitEvent(event));}}module[_0x0066('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0x42d4=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users'];(function(_0x10509b,_0x2a89fc){var _0x4db814=function(_0x2049e1){while(--_0x2049e1){_0x10509b['push'](_0x10509b['shift']());}};_0x4db814(++_0x2a89fc);}(_0x42d4,0x19f));var _0x442d=function(_0x1021f8,_0x58f94d){_0x1021f8=_0x1021f8-0x0;var _0x29edce=_0x42d4[_0x1021f8];return _0x29edce;};'use strict';var EventEmitter=require(_0x442d('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0x442d('0x1'))['db'][_0x442d('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x442d('0x3')](0x0);var events={'afterCreate':_0x442d('0x4'),'afterUpdate':_0x442d('0x5'),'afterDestroy':'remove'};function emitEvent(_0xcf3a78){return function(_0x1a52a2,_0x50dfea,_0x47131a){_0x1a52a2[_0x442d('0x6')]({'attributes':['id'],'raw':!![]})[_0x442d('0x7')](function(_0x367541){_0x1a52a2[_0x442d('0x8')](_0x442d('0x9'),_0x367541['map'](function(_0x32313a){return{'id':_0x32313a['id']};}));return FaxMessage[_0x442d('0xa')]({'where':{'FaxInteractionId':_0x1a52a2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x442d('0x7')](function(_0x107c70){_0x1a52a2[_0x442d('0x8')](_0x442d('0xb'),_0x107c70[_0x442d('0xc')]);FaxInteractionEvents['emit'](_0xcf3a78+':'+_0x1a52a2['id'],_0x1a52a2);FaxInteractionEvents[_0x442d('0xd')](_0xcf3a78,_0x1a52a2);_0x47131a(null);})[_0x442d('0xe')](_0x47131a(null));};}for(var e in events){if(events[_0x442d('0xf')](e)){var event=events[e];FaxInteraction[_0x442d('0x10')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 87467d3..8364d83 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 _0xa9c7=['bluebird','path','exports','define','FaxInteraction','fax_interactions','closedAt','format','lodash','api'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9c7,0x148));var _0x7a9c=function(_0x1073ad,_0x44bf0b){_0x1073ad=_0x1073ad-0x0;var _0x528474=_0xa9c7[_0x1073ad];return _0x528474;};'use strict';var _=require(_0x7a9c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7a9c('0x1'));var moment=require('moment');var BPromise=require(_0x7a9c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a9c('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0x7a9c('0x4')]=function(_0x2cb4d6,_0x150e60){return _0x2cb4d6[_0x7a9c('0x5')](_0x7a9c('0x6'),attributes,{'tableName':_0x7a9c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x337afa,_0x436bb4,_0x38c762){if(_0x337afa['changed']('closed')){_0x337afa[_0x7a9c('0x8')]=moment()[_0x7a9c('0x9')]('YYYY-MM-DD\x20HH:mm:ss');}_0x38c762(null,_0x337afa);}}});}; \ No newline at end of file +var _0x0d78=['api','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x175989,_0x309275){var _0x1408f9=function(_0xbbfedb){while(--_0xbbfedb){_0x175989['push'](_0x175989['shift']());}};_0x1408f9(++_0x309275);}(_0x0d78,0x134));var _0x80d7=function(_0x27463e,_0x157d81){_0x27463e=_0x27463e-0x0;var _0x16952a=_0x0d78[_0x27463e];return _0x16952a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x80d7('0x0'));var moment=require('moment');var BPromise=require(_0x80d7('0x1'));var rp=require(_0x80d7('0x2'));var fs=require('fs');var path=require(_0x80d7('0x3'));var rimraf=require(_0x80d7('0x4'));var config=require('../../config/environment');var attributes=require(_0x80d7('0x5'));module['exports']=function(_0x3b22d0,_0xfcc3ba){return _0x3b22d0[_0x80d7('0x6')](_0x80d7('0x7'),attributes,{'tableName':_0x80d7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x527b16,_0x579994,_0x2d92d4){if(_0x527b16[_0x80d7('0x9')](_0x80d7('0xa'))){_0x527b16[_0x80d7('0xb')]=moment()[_0x80d7('0xc')](_0x80d7('0xd'));}_0x2d92d4(null,_0x527b16);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 8b1811e..e18cc6b 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 _0xfe40=['localhost','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','limit','debug','AddTagsToFaxInteraction','find','addTags','body','omit','ids','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis'];(function(_0x575287,_0x288709){var _0x224c5f=function(_0x1c7bee){while(--_0x1c7bee){_0x575287['push'](_0x575287['shift']());}};_0x224c5f(++_0x288709);}(_0xfe40,0xb9));var _0x0fe4=function(_0x4b7ac6,_0x454ef8){_0x4b7ac6=_0x4b7ac6-0x0;var _0x3efa64=_0xfe40[_0x4b7ac6];return _0x3efa64;};'use strict';var _=require('lodash');var util=require(_0x0fe4('0x0'));var moment=require(_0x0fe4('0x1'));var BPromise=require(_0x0fe4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fe4('0x3'));var db=require(_0x0fe4('0x4'))['db'];var utils=require(_0x0fe4('0x5'));var logger=require(_0x0fe4('0x6'))('rpc');var config=require(_0x0fe4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fe4('0x8')]['http']({'port':0x232a});config[_0x0fe4('0x9')]=_['defaults'](config['redis'],{'host':_0x0fe4('0xa'),'port':0x18eb});var socket=require(_0x0fe4('0xb'))(new Redis(config['redis']));require(_0x0fe4('0xc'))[_0x0fe4('0xd')](socket);function respondWithRpcPromise(_0x5c3bbd,_0x30727d,_0x41a9eb){return new BPromise(function(_0x146b7f,_0x54b594){return client['request'](_0x5c3bbd,_0x41a9eb)[_0x0fe4('0xe')](function(_0x1b3ab6){logger[_0x0fe4('0xf')](_0x0fe4('0x10'),_0x30727d,'request\x20sent');logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x30727d,_0x0fe4('0x11'),JSON[_0x0fe4('0x12')](_0x1b3ab6));if(_0x1b3ab6[_0x0fe4('0x13')]){if(_0x1b3ab6[_0x0fe4('0x13')]['code']===0x1f4){logger[_0x0fe4('0x13')](_0x0fe4('0x10'),_0x30727d,_0x1b3ab6['error'][_0x0fe4('0x14')]);return _0x54b594(_0x1b3ab6[_0x0fe4('0x13')][_0x0fe4('0x14')]);}logger[_0x0fe4('0x13')](_0x0fe4('0x10'),_0x30727d,_0x1b3ab6[_0x0fe4('0x13')]['message']);return _0x146b7f(_0x1b3ab6['error']['message']);}else{logger[_0x0fe4('0xf')](_0x0fe4('0x10'),_0x30727d,_0x0fe4('0x11'));_0x146b7f(_0x1b3ab6[_0x0fe4('0x15')]['message']);}})[_0x0fe4('0x16')](function(_0x57f032){logger['error'](_0x0fe4('0x10'),_0x30727d,_0x57f032);_0x54b594(_0x57f032);});});}exports[_0x0fe4('0x17')]=function(_0x1eb843){var _0x2e42db=this;return new Promise(function(_0x3ddae4,_0x8a9154){return db[_0x0fe4('0x18')][_0x0fe4('0x19')](_0x1eb843['body'],{'raw':_0x1eb843[_0x0fe4('0x1a')]?_0x1eb843[_0x0fe4('0x1a')][_0x0fe4('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1eb843[_0x0fe4('0x1a')]?_0x1eb843['options'][_0x0fe4('0x1c')]||null:null,'attributes':_0x1eb843[_0x0fe4('0x1a')]?_0x1eb843[_0x0fe4('0x1a')][_0x0fe4('0x1d')]||null:null,'limit':_0x1eb843[_0x0fe4('0x1a')]?_0x1eb843[_0x0fe4('0x1a')][_0x0fe4('0x1e')]||null:null})[_0x0fe4('0xe')](function(_0x4f5027){logger[_0x0fe4('0xf')](_0x0fe4('0x17'),_0x1eb843);logger[_0x0fe4('0x1f')](_0x0fe4('0x17'),_0x1eb843,JSON[_0x0fe4('0x12')](_0x4f5027));_0x3ddae4(_0x4f5027);})[_0x0fe4('0x16')](function(_0x4c40b1){logger[_0x0fe4('0x13')](_0x0fe4('0x17'),_0x4c40b1[_0x0fe4('0x14')],_0x1eb843);_0x8a9154(_0x2e42db[_0x0fe4('0x13')](0x1f4,_0x4c40b1[_0x0fe4('0x14')]));});});};exports[_0x0fe4('0x20')]=function(_0xf62f92){return new Promise(function(_0x2c6088,_0x17fc56){return db[_0x0fe4('0x18')][_0x0fe4('0x21')]({'where':_0xf62f92[_0x0fe4('0x1a')]?_0xf62f92[_0x0fe4('0x1a')][_0x0fe4('0x1c')]||null:null})[_0x0fe4('0xe')](function(_0x4b2245){if(_0x4b2245){return _0x4b2245[_0x0fe4('0x22')](_0xf62f92[_0x0fe4('0x23')]['ids'],_[_0x0fe4('0x24')](_0xf62f92[_0x0fe4('0x23')],[_0x0fe4('0x25'),'id'])||{});}})['spread'](function(_0x5ee62a){logger[_0x0fe4('0xf')](_0x0fe4('0x26'),_0xf62f92);logger[_0x0fe4('0x1f')](_0x0fe4('0x26'),_0xf62f92,JSON[_0x0fe4('0x12')](_0x5ee62a));_0x2c6088(_0x5ee62a);})['catch'](function(_0x4e87f5){logger['error'](_0x0fe4('0x26'),_0x4e87f5['message'],_0xf62f92);_0x17fc56(_this[_0x0fe4('0x13')](0x1f4,_0x4e87f5[_0x0fe4('0x14')]));});});}; \ No newline at end of file +var _0x093a=['limit','UpdateFaxInteraction','AddTagsToFaxInteraction','addTags','body','omit','ids','spread','AddTags','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','FaxInteraction','update','options','raw','where','attributes'];(function(_0x528c9a,_0x4205df){var _0x35db6f=function(_0xb4a0b9){while(--_0xb4a0b9){_0x528c9a['push'](_0x528c9a['shift']());}};_0x35db6f(++_0x4205df);}(_0x093a,0x106));var _0xa093=function(_0x5e2751,_0x518a55){_0x5e2751=_0x5e2751-0x0;var _0x139a39=_0x093a[_0x5e2751];return _0x139a39;};'use strict';var _=require('lodash');var util=require(_0xa093('0x0'));var moment=require('moment');var BPromise=require(_0xa093('0x1'));var rs=require(_0xa093('0x2'));var fs=require('fs');var Redis=require(_0xa093('0x3'));var db=require(_0xa093('0x4'))['db'];var utils=require(_0xa093('0x5'));var logger=require(_0xa093('0x6'))(_0xa093('0x7'));var config=require('../../config/environment');var jayson=require(_0xa093('0x8'));var client=jayson[_0xa093('0x9')][_0xa093('0xa')]({'port':0x232a});config[_0xa093('0xb')]=_['defaults'](config[_0xa093('0xb')],{'host':_0xa093('0xc'),'port':0x18eb});var socket=require(_0xa093('0xd'))(new Redis(config[_0xa093('0xb')]));require(_0xa093('0xe'))[_0xa093('0xf')](socket);function respondWithRpcPromise(_0xddb65a,_0x53a02a,_0x356f9e){return new BPromise(function(_0x21745a,_0x2a1e94){return client[_0xa093('0x10')](_0xddb65a,_0x356f9e)[_0xa093('0x11')](function(_0x5d93dc){logger[_0xa093('0x12')](_0xa093('0x13'),_0x53a02a,_0xa093('0x14'));logger['debug'](_0xa093('0x15'),_0x53a02a,_0xa093('0x14'),JSON[_0xa093('0x16')](_0x5d93dc));if(_0x5d93dc['error']){if(_0x5d93dc[_0xa093('0x17')]['code']===0x1f4){logger[_0xa093('0x17')](_0xa093('0x13'),_0x53a02a,_0x5d93dc['error']['message']);return _0x2a1e94(_0x5d93dc[_0xa093('0x17')][_0xa093('0x18')]);}logger[_0xa093('0x17')](_0xa093('0x13'),_0x53a02a,_0x5d93dc[_0xa093('0x17')][_0xa093('0x18')]);return _0x21745a(_0x5d93dc[_0xa093('0x17')]['message']);}else{logger['info'](_0xa093('0x13'),_0x53a02a,_0xa093('0x14'));_0x21745a(_0x5d93dc['result'][_0xa093('0x18')]);}})[_0xa093('0x19')](function(_0x20b09f){logger['error'](_0xa093('0x13'),_0x53a02a,_0x20b09f);_0x2a1e94(_0x20b09f);});});}exports['UpdateFaxInteraction']=function(_0x429a1d){var _0x57961e=this;return new Promise(function(_0x16bda9,_0xe75c05){return db[_0xa093('0x1a')][_0xa093('0x1b')](_0x429a1d['body'],{'raw':_0x429a1d[_0xa093('0x1c')]?_0x429a1d['options'][_0xa093('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x429a1d[_0xa093('0x1c')]?_0x429a1d[_0xa093('0x1c')][_0xa093('0x1e')]||null:null,'attributes':_0x429a1d[_0xa093('0x1c')]?_0x429a1d[_0xa093('0x1c')][_0xa093('0x1f')]||null:null,'limit':_0x429a1d[_0xa093('0x1c')]?_0x429a1d[_0xa093('0x1c')][_0xa093('0x20')]||null:null})[_0xa093('0x11')](function(_0x5ac905){logger['info']('UpdateFaxInteraction',_0x429a1d);logger['debug'](_0xa093('0x21'),_0x429a1d,JSON[_0xa093('0x16')](_0x5ac905));_0x16bda9(_0x5ac905);})[_0xa093('0x19')](function(_0x864862){logger[_0xa093('0x17')](_0xa093('0x21'),_0x864862[_0xa093('0x18')],_0x429a1d);_0xe75c05(_0x57961e[_0xa093('0x17')](0x1f4,_0x864862['message']));});});};exports[_0xa093('0x22')]=function(_0x2c2f39){return new Promise(function(_0x434a35,_0x222c69){return db[_0xa093('0x1a')]['find']({'where':_0x2c2f39[_0xa093('0x1c')]?_0x2c2f39['options'][_0xa093('0x1e')]||null:null})[_0xa093('0x11')](function(_0x13f56d){if(_0x13f56d){return _0x13f56d[_0xa093('0x23')](_0x2c2f39[_0xa093('0x24')]['ids'],_[_0xa093('0x25')](_0x2c2f39['body'],[_0xa093('0x26'),'id'])||{});}})[_0xa093('0x27')](function(_0x43cac2){logger[_0xa093('0x12')](_0xa093('0x28'),_0x2c2f39);logger[_0xa093('0x29')](_0xa093('0x28'),_0x2c2f39,JSON[_0xa093('0x16')](_0x43cac2));_0x434a35(_0x43cac2);})['catch'](function(_0x25368c){logger[_0xa093('0x17')](_0xa093('0x28'),_0x25368c[_0xa093('0x18')],_0x2c2f39);_0x222c69(_this[_0xa093('0x17')](0x1f4,_0x25368c[_0xa093('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index a4cf6d6..0be3fb9 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 _0x7bb1=['save','remove','update','emit','removeListener','register','faxInteraction:'];(function(_0x580057,_0x556c92){var _0x1dea32=function(_0x31eb35){while(--_0x31eb35){_0x580057['push'](_0x580057['shift']());}};_0x1dea32(++_0x556c92);}(_0x7bb1,0xd9));var _0x17bb=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x7bb1[_0x68ee8b];return _0x5148f7;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x17bb('0x0'),_0x17bb('0x1'),_0x17bb('0x2')];function createListener(_0x4f7ee0,_0x25d60e){return function(_0x2dedbf){_0x25d60e[_0x17bb('0x3')](_0x4f7ee0,_0x2dedbf);};}function removeListener(_0x448a01,_0xdcf423){return function(){FaxInteractionEvents[_0x17bb('0x4')](_0x448a01,_0xdcf423);};}exports[_0x17bb('0x5')]=function(_0x5344eb){for(var _0x3ebbfe=0x0,_0x4d6916=events['length'];_0x3ebbfe<_0x4d6916;_0x3ebbfe++){var _0x2bdcbf=events[_0x3ebbfe];var _0x1ee04f=createListener(_0x17bb('0x6')+_0x2bdcbf,_0x5344eb);FaxInteractionEvents['on'](_0x2bdcbf,_0x1ee04f);}}; \ No newline at end of file +var _0x920f=['removeListener','register','length','./faxInteraction.events','update','emit'];(function(_0x192826,_0x4112ba){var _0x31b0f4=function(_0x469745){while(--_0x469745){_0x192826['push'](_0x192826['shift']());}};_0x31b0f4(++_0x4112ba);}(_0x920f,0x1ad));var _0xf920=function(_0x2beb23,_0x1456a4){_0x2beb23=_0x2beb23-0x0;var _0x3757a3=_0x920f[_0x2beb23];return _0x3757a3;};'use strict';var FaxInteractionEvents=require(_0xf920('0x0'));var events=['save','remove',_0xf920('0x1')];function createListener(_0x4fd50f,_0x3d9321){return function(_0x3c9149){_0x3d9321[_0xf920('0x2')](_0x4fd50f,_0x3c9149);};}function removeListener(_0x2bb14c,_0xe2b121){return function(){FaxInteractionEvents[_0xf920('0x3')](_0x2bb14c,_0xe2b121);};}exports[_0xf920('0x4')]=function(_0x53473d){for(var _0x454c10=0x0,_0x452eb8=events[_0xf920('0x5')];_0x454c10<_0x452eb8;_0x454c10++){var _0x1fbc01=events[_0x454c10];var _0x59bc93=createListener('faxInteraction:'+_0x1fbc01,_0x53473d);FaxInteractionEvents['on'](_0x1fbc01,_0x59bc93);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index ab09934..123236c 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 _0xa535=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post','create','/:id/messages','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','destroy','removeTags','exports'];(function(_0x18fe2a,_0x514773){var _0x11c348=function(_0x3054c4){while(--_0x3054c4){_0x18fe2a['push'](_0x18fe2a['shift']());}};_0x11c348(++_0x514773);}(_0xa535,0x1ad));var _0x5a53=function(_0x420e67,_0x31d1a3){_0x420e67=_0x420e67-0x0;var _0x43bab1=_0xa535[_0x420e67];return _0x43bab1;};'use strict';var multer=require(_0x5a53('0x0'));var util=require(_0x5a53('0x1'));var path=require(_0x5a53('0x2'));var timeout=require(_0x5a53('0x3'));var express=require(_0x5a53('0x4'));var router=express[_0x5a53('0x5')]();var fs_extra=require(_0x5a53('0x6'));var auth=require(_0x5a53('0x7'));var interaction=require(_0x5a53('0x8'));var config=require(_0x5a53('0x9'));var controller=require('./faxInteraction.controller');router[_0x5a53('0xa')]('/',auth[_0x5a53('0xb')](),controller[_0x5a53('0xc')]);router[_0x5a53('0xa')](_0x5a53('0xd'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x5a53('0xe'),auth[_0x5a53('0xb')](),controller[_0x5a53('0xf')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x5a53('0xa')](_0x5a53('0x10'),auth[_0x5a53('0xb')](),controller[_0x5a53('0x11')]);router[_0x5a53('0x12')]('/',auth[_0x5a53('0xb')](),controller[_0x5a53('0x13')]);router[_0x5a53('0x12')](_0x5a53('0x14'),auth[_0x5a53('0xb')](),controller['addMessage']);router[_0x5a53('0x12')](_0x5a53('0x15'),auth[_0x5a53('0xb')](),interaction[_0x5a53('0x16')](_0x5a53('0x17'),_0x5a53('0x18')),controller[_0x5a53('0x19')]);router[_0x5a53('0x1a')]('/:id',auth[_0x5a53('0xb')](),interaction[_0x5a53('0x16')]('fax',_0x5a53('0x1b')),controller[_0x5a53('0x1c')]);router[_0x5a53('0x1d')](_0x5a53('0xe'),auth['isAuthenticated'](),interaction[_0x5a53('0x16')](_0x5a53('0x17'),'faxinteraction:destroy'),controller[_0x5a53('0x1e')]);router[_0x5a53('0x1d')](_0x5a53('0x15'),auth[_0x5a53('0xb')](),controller[_0x5a53('0x1f')]);module[_0x5a53('0x20')]=router; \ No newline at end of file +var _0x890e=['/describe','describe','get','/:id','show','/:id/messages','download','create','post','addMessage','fax','addTags','put','tracked','faxinteraction:update','update','destroy','delete','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index'];(function(_0x482e30,_0x11c205){var _0x59bf70=function(_0x564a33){while(--_0x564a33){_0x482e30['push'](_0x482e30['shift']());}};_0x59bf70(++_0x11c205);}(_0x890e,0xce));var _0xe890=function(_0x4814a5,_0x1f4ba4){_0x4814a5=_0x4814a5-0x0;var _0x1103aa=_0x890e[_0x4814a5];return _0x1103aa;};'use strict';var multer=require(_0xe890('0x0'));var util=require(_0xe890('0x1'));var path=require(_0xe890('0x2'));var timeout=require('connect-timeout');var express=require(_0xe890('0x3'));var router=express[_0xe890('0x4')]();var fs_extra=require(_0xe890('0x5'));var auth=require(_0xe890('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe890('0x7'));var controller=require(_0xe890('0x8'));router['get']('/',auth[_0xe890('0x9')](),controller[_0xe890('0xa')]);router['get'](_0xe890('0xb'),auth['isAuthenticated'](),controller[_0xe890('0xc')]);router[_0xe890('0xd')](_0xe890('0xe'),auth[_0xe890('0x9')](),controller[_0xe890('0xf')]);router[_0xe890('0xd')](_0xe890('0x10'),auth[_0xe890('0x9')](),controller['getMessages']);router[_0xe890('0xd')]('/:id/download',auth[_0xe890('0x9')](),controller[_0xe890('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe890('0x12')]);router[_0xe890('0x13')](_0xe890('0x10'),auth['isAuthenticated'](),controller[_0xe890('0x14')]);router[_0xe890('0x13')]('/:id/tags',auth[_0xe890('0x9')](),interaction['tracked'](_0xe890('0x15'),'faxinteraction:addtags'),controller[_0xe890('0x16')]);router[_0xe890('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0xe890('0x18')](_0xe890('0x15'),_0xe890('0x19')),controller[_0xe890('0x1a')]);router['delete'](_0xe890('0xe'),auth[_0xe890('0x9')](),interaction[_0xe890('0x18')]('fax','faxinteraction:destroy'),controller[_0xe890('0x1b')]);router[_0xe890('0x1c')]('/:id/tags',auth[_0xe890('0x9')](),controller[_0xe890('0x1d')]);module[_0xe890('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 0c1dfc9..f0fe18e 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 _0xb903=['medium','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb903,0x185));var _0x3b90=function(_0x5ef0ea,_0xa695a9){_0x5ef0ea=_0x5ef0ea-0x0;var _0x4090c4=_0xb903[_0x5ef0ea];return _0x4090c4;};'use strict';var Sequelize=require(_0x3b90('0x0'));module[_0x3b90('0x1')]={'body':{'type':Sequelize[_0x3b90('0x2')](_0x3b90('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3b90('0x4')]('in',_0x3b90('0x5')),'defaultValue':_0x3b90('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x3b90('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x3b90('0x6')]}}; \ No newline at end of file +var _0xaba6=['out','DATE','sequelize','exports'];(function(_0x137e87,_0xe9dda6){var _0x5a4110=function(_0x351d12){while(--_0x351d12){_0x137e87['push'](_0x137e87['shift']());}};_0x5a4110(++_0xe9dda6);}(_0xaba6,0xe2));var _0x6aba=function(_0x51ab33,_0x71a8a8){_0x51ab33=_0x51ab33-0x0;var _0x5e1298=_0xaba6[_0x51ab33];return _0x5e1298;};'use strict';var Sequelize=require(_0x6aba('0x0'));module[_0x6aba('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x6aba('0x2')),'defaultValue':_0x6aba('0x2'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x6aba('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 79311b4..9eb2a1b 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 _0x2b71=['describe','fax-interactions','accept','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','../../config/logger','fax','get','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','event','reject','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','root','files','attachments','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','destroy','stack','name','index','map','FaxMessage','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','include','findAll','rows','show','includeAll','find','body','params'];(function(_0x233cb1,_0x8ca9a2){var _0x29ee7e=function(_0x20e277){while(--_0x20e277){_0x233cb1['push'](_0x233cb1['shift']());}};_0x29ee7e(++_0x8ca9a2);}(_0x2b71,0x155));var _0x12b7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2b71[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x12b7('0x0'));var rimraf=require(_0x12b7('0x1'));var zipdir=require(_0x12b7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x12b7('0x3'));var moment=require(_0x12b7('0x4'));var BPromise=require(_0x12b7('0x5'));var Mustache=require(_0x12b7('0x6'));var util=require(_0x12b7('0x7'));var path=require(_0x12b7('0x8'));var sox=require(_0x12b7('0x9'));var csv=require('to-csv');var ejs=require(_0x12b7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12b7('0xb'));var squel=require(_0x12b7('0xc'));var crypto=require(_0x12b7('0xd'));var jsforce=require(_0x12b7('0xe'));var deskjs=require(_0x12b7('0xf'));var toCsv=require(_0x12b7('0x10'));var querystring=require(_0x12b7('0x11'));var Papa=require(_0x12b7('0x12'));var Redis=require(_0x12b7('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x12b7('0x14'));var hardwareService=require(_0x12b7('0x15'));var logger=require('../../config/logger')(_0x12b7('0x16'));var utils=require('../../config/utils');var config=require(_0x12b7('0x17'));var licenseUtil=require(_0x12b7('0x18'));var db=require('../../mysqldb')['db'];config[_0x12b7('0x19')]=_[_0x12b7('0x1a')](config['redis'],{'host':_0x12b7('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x12b7('0x1c'))[_0x12b7('0x1d')](socket);var jayson=require(_0x12b7('0x1e'));var client=jayson[_0x12b7('0x1f')][_0x12b7('0x20')]({'port':0x232c});var client9002=jayson[_0x12b7('0x1f')][_0x12b7('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x34ac01,_0x50d9be,_0x4f0594,_0x895005){return new BPromise(function(_0x2c8b76,_0x1cfd04){var _0x11c1bf=_0x895005||client;return _0x11c1bf[_0x12b7('0x21')](_0x34ac01,_0x4f0594)[_0x12b7('0x22')](function(_0x3a3944){logger[_0x12b7('0x23')](_0x12b7('0x24'),_0x50d9be,'request\x20sent');logger['debug'](_0x12b7('0x25'),_0x50d9be,_0x12b7('0x26'),JSON[_0x12b7('0x27')](_0x3a3944));if(_0x3a3944[_0x12b7('0x28')]){if(_0x3a3944[_0x12b7('0x28')][_0x12b7('0x29')]===0x1f4){logger['error'](_0x12b7('0x24'),_0x50d9be,_0x3a3944[_0x12b7('0x28')][_0x12b7('0x2a')]);return _0x1cfd04(_0x3a3944[_0x12b7('0x28')]['message']);}logger['error'](_0x12b7('0x24'),_0x50d9be,_0x3a3944['error']['message']);return _0x2c8b76(_0x3a3944[_0x12b7('0x28')][_0x12b7('0x2a')]);}else{logger[_0x12b7('0x23')](_0x12b7('0x24'),_0x50d9be,_0x12b7('0x26'));_0x2c8b76(_0x3a3944[_0x12b7('0x2b')][_0x12b7('0x2a')]);}})[_0x12b7('0x2c')](function(_0x14226f){logger[_0x12b7('0x28')](_0x12b7('0x24'),_0x50d9be,_0x14226f);_0x1cfd04(_0x14226f);});});}function respondWithStatusCode(_0x19dd72,_0x5b6a06){_0x5b6a06=_0x5b6a06||0xcc;return function(_0x2f2409){if(_0x2f2409){return _0x19dd72[_0x12b7('0x2d')](_0x5b6a06);}return _0x19dd72[_0x12b7('0x2e')](_0x5b6a06)[_0x12b7('0x2f')]();};}function respondWithResult(_0x1b71fc,_0x164a8e){_0x164a8e=_0x164a8e||0xc8;return function(_0x363f22){if(_0x363f22){return _0x1b71fc['status'](_0x164a8e)[_0x12b7('0x30')](_0x363f22);}};}function respondWithFilteredResult(_0x57f972,_0x1fa8f6){return function(_0x2b266c){if(_0x2b266c){var _0x5603de=typeof _0x1fa8f6[_0x12b7('0x31')]===_0x12b7('0x32')&&typeof _0x1fa8f6[_0x12b7('0x33')]===_0x12b7('0x32');var _0x54fd9f=_0x2b266c[_0x12b7('0x34')];var _0x237e1a=_0x5603de?0x0:_0x1fa8f6[_0x12b7('0x31')];var _0x49e822=_0x5603de?_0x2b266c[_0x12b7('0x34')]:_0x1fa8f6[_0x12b7('0x31')]+_0x1fa8f6[_0x12b7('0x33')];var _0x42df34;if(_0x49e822>=_0x54fd9f){_0x49e822=_0x54fd9f;_0x42df34=0xc8;}else{_0x42df34=0xce;}_0x57f972['status'](_0x42df34);return _0x57f972['set']('Content-Range',_0x237e1a+'-'+_0x49e822+'/'+_0x54fd9f)[_0x12b7('0x30')](_0x2b266c);}return null;};}function patchUpdates(_0x3222ed){return function(_0x17fd07){try{jsonpatch[_0x12b7('0x35')](_0x17fd07,_0x3222ed,!![]);}catch(_0x33eee6){return BPromise['reject'](_0x33eee6);}return _0x17fd07[_0x12b7('0x36')]();};}function saveUpdates(_0x1bf6fb,_0x22c287){return function(_0x12a090){if(_0x12a090){return _0x12a090[_0x12b7('0x37')](_0x1bf6fb)['then'](function(_0xa1ddf1){return _0xa1ddf1;});}return null;};}function removeEntity(_0x39eefe,_0x4f6451){return function(_0x403d32){if(_0x403d32){return _0x403d32[_0x12b7('0x38')]()[_0x12b7('0x22')](function(){_0x39eefe[_0x12b7('0x2e')](0xcc)[_0x12b7('0x2f')]();});}};}function handleEntityNotFound(_0x256bba,_0x5365d0){return function(_0x3bedcf){if(!_0x3bedcf){_0x256bba[_0x12b7('0x2d')](0x194);}return _0x3bedcf;};}function handleError(_0x738060,_0x54c28f){_0x54c28f=_0x54c28f||0x1f4;return function(_0x2a1b51){logger[_0x12b7('0x28')](_0x2a1b51[_0x12b7('0x39')]);if(_0x2a1b51[_0x12b7('0x3a')]){delete _0x2a1b51[_0x12b7('0x3a')];}_0x738060['status'](_0x54c28f)['send'](_0x2a1b51);};}exports[_0x12b7('0x3b')]=function(_0x4987da,_0x227294){var _0x1e07b7={},_0x23db0f={},_0xc84631={'count':0x0,'rows':[]};var _0x4af550=_[_0x12b7('0x3c')](db[_0x12b7('0x3d')][_0x12b7('0x3e')],function(_0x435723){return{'name':_0x435723['fieldName'],'type':_0x435723[_0x12b7('0x3f')][_0x12b7('0x40')]};});_0x23db0f['model']=_[_0x12b7('0x3c')](_0x4af550,_0x12b7('0x3a'));_0x23db0f[_0x12b7('0x41')]=_[_0x12b7('0x42')](_0x4987da[_0x12b7('0x41')]);_0x23db0f[_0x12b7('0x43')]=_['intersection'](_0x23db0f[_0x12b7('0x44')],_0x23db0f[_0x12b7('0x41')]);_0x1e07b7[_0x12b7('0x45')]=_[_0x12b7('0x46')](_0x23db0f[_0x12b7('0x44')],qs[_0x12b7('0x47')](_0x4987da['query'][_0x12b7('0x47')]));_0x1e07b7[_0x12b7('0x45')]=_0x1e07b7[_0x12b7('0x45')][_0x12b7('0x48')]?_0x1e07b7['attributes']:_0x23db0f[_0x12b7('0x44')];if(!_0x4987da[_0x12b7('0x41')][_0x12b7('0x49')]('nolimit')){_0x1e07b7[_0x12b7('0x33')]=qs[_0x12b7('0x33')](_0x4987da[_0x12b7('0x41')][_0x12b7('0x33')]);_0x1e07b7['offset']=qs['offset'](_0x4987da[_0x12b7('0x41')][_0x12b7('0x31')]);}_0x1e07b7[_0x12b7('0x4a')]=qs['sort'](_0x4987da['query'][_0x12b7('0x4b')]);_0x1e07b7[_0x12b7('0x4c')]=qs[_0x12b7('0x43')](_['pick'](_0x4987da['query'],_0x23db0f[_0x12b7('0x43')]),_0x4af550);if(_0x4987da[_0x12b7('0x41')][_0x12b7('0x4d')]){_0x1e07b7[_0x12b7('0x4c')]=_[_0x12b7('0x4e')](_0x1e07b7['where'],{'$or':_[_0x12b7('0x3c')](_0x4af550,function(_0x5b65b7){if(_0x5b65b7['type']!=='VIRTUAL'){var _0x821a6c={};_0x821a6c[_0x5b65b7[_0x12b7('0x3a')]]={'$like':'%'+_0x4987da[_0x12b7('0x41')][_0x12b7('0x4d')]+'%'};return _0x821a6c;}})});}_0x1e07b7=_[_0x12b7('0x4e')]({},_0x1e07b7,_0x4987da[_0x12b7('0x4f')]);var _0x3b2aab={'where':_0x1e07b7[_0x12b7('0x4c')]};return db[_0x12b7('0x3d')][_0x12b7('0x34')](_0x3b2aab)['then'](function(_0x5f198e){_0xc84631[_0x12b7('0x34')]=_0x5f198e;if(_0x4987da[_0x12b7('0x41')]['includeAll']){_0x1e07b7[_0x12b7('0x50')]=[{'all':!![]}];}return db[_0x12b7('0x3d')][_0x12b7('0x51')](_0x1e07b7);})[_0x12b7('0x22')](function(_0x25affb){_0xc84631[_0x12b7('0x52')]=_0x25affb;return _0xc84631;})[_0x12b7('0x22')](respondWithFilteredResult(_0x227294,_0x1e07b7))['catch'](handleError(_0x227294,null));};exports[_0x12b7('0x53')]=function(_0x2182f5,_0x52948f){var _0x44eb51={'raw':!![],'where':{'id':_0x2182f5['params']['id']}},_0x2d7f87={};_0x2d7f87[_0x12b7('0x44')]=_['keys'](db['FaxMessage'][_0x12b7('0x3e')]);_0x2d7f87['query']=_[_0x12b7('0x42')](_0x2182f5[_0x12b7('0x41')]);_0x2d7f87[_0x12b7('0x43')]=_[_0x12b7('0x46')](_0x2d7f87['model'],_0x2d7f87['query']);_0x44eb51[_0x12b7('0x45')]=_[_0x12b7('0x46')](_0x2d7f87[_0x12b7('0x44')],qs[_0x12b7('0x47')](_0x2182f5['query']['fields']));_0x44eb51[_0x12b7('0x45')]=_0x44eb51[_0x12b7('0x45')]['length']?_0x44eb51[_0x12b7('0x45')]:_0x2d7f87[_0x12b7('0x44')];if(_0x2182f5['query'][_0x12b7('0x54')]){_0x44eb51[_0x12b7('0x50')]=[{'all':!![]}];}_0x44eb51=_[_0x12b7('0x4e')]({},_0x44eb51,_0x2182f5['options']);return db['FaxMessage'][_0x12b7('0x55')](_0x44eb51)[_0x12b7('0x22')](handleEntityNotFound(_0x52948f,null))[_0x12b7('0x22')](respondWithResult(_0x52948f,null))[_0x12b7('0x2c')](handleError(_0x52948f,null));};exports[_0x12b7('0x37')]=function(_0x323fe0,_0x58e294){if(_0x323fe0['body']['id']){delete _0x323fe0[_0x12b7('0x56')]['id'];}return db[_0x12b7('0x3d')][_0x12b7('0x55')]({'where':{'id':_0x323fe0[_0x12b7('0x57')]['id']}})['then'](handleEntityNotFound(_0x58e294,null))[_0x12b7('0x22')](saveUpdates(_0x323fe0[_0x12b7('0x56')],null))[_0x12b7('0x22')](respondWithResult(_0x58e294,null))[_0x12b7('0x2c')](handleError(_0x58e294,null));};exports[_0x12b7('0x38')]=function(_0x3ae2b1,_0x664ffb){return db[_0x12b7('0x3d')]['find']({'where':{'id':_0x3ae2b1[_0x12b7('0x57')]['id']}})[_0x12b7('0x22')](handleEntityNotFound(_0x664ffb,null))[_0x12b7('0x22')](removeEntity(_0x664ffb,null))[_0x12b7('0x2c')](handleError(_0x664ffb,null));};exports['describe']=function(_0x334f28,_0x22e24d){return db[_0x12b7('0x3d')][_0x12b7('0x58')]()[_0x12b7('0x22')](respondWithResult(_0x22e24d,null))[_0x12b7('0x2c')](handleError(_0x22e24d,null));};var interaction_log=require('../../config/logger')(_0x12b7('0x59'));exports[_0x12b7('0x5a')]=function(_0x48fcc4,_0x415d92,_0x47a905){var _0x5b211d={'agent':{},'channel':'fax'};if(_0x48fcc4[_0x12b7('0x56')]['id']){delete _0x48fcc4['body']['id'];}_0x48fcc4['body']['read']=!![];_0x48fcc4[_0x12b7('0x56')]['readAt']=moment()[_0x12b7('0x5b')](_0x12b7('0x5c'));_0x48fcc4[_0x12b7('0x56')]['UserId']=_0x48fcc4[_0x12b7('0x56')][_0x12b7('0x5d')]||_0x48fcc4[_0x12b7('0x5e')]['id'];_0x5b211d['agent']['id']=_0x48fcc4[_0x12b7('0x56')][_0x12b7('0x5d')];return db[_0x12b7('0x3d')][_0x12b7('0x55')]({'where':{'id':_0x48fcc4[_0x12b7('0x57')]['id'],'UserId':null}})[_0x12b7('0x22')](handleEntityNotFound(_0x415d92,null))[_0x12b7('0x22')](saveUpdates(_0x48fcc4['body'],null))[_0x12b7('0x22')](function(_0x1a3a77){if(_0x1a3a77){_0x5b211d[_0x12b7('0x2a')]=_0x1a3a77['get']({'plain':!![]});return db['FaxInteraction'][_0x12b7('0x55')]({'where':{'id':_0x1a3a77[_0x12b7('0x5f')]}});}return null;})[_0x12b7('0x22')](handleEntityNotFound(_0x415d92,null))[_0x12b7('0x22')](function(_0xa71dc1){if(_0xa71dc1){return _0xa71dc1[_0x12b7('0x37')]({'UserId':_0x48fcc4[_0x12b7('0x56')]['UserId'],'read1stAt':_[_0x12b7('0x60')](_0xa71dc1[_0x12b7('0x61')])?moment()['format'](_0x12b7('0x5c')):undefined});}return null;})[_0x12b7('0x22')](function(_0x294e90){if(_0x294e90){_0x5b211d[_0x12b7('0x62')]=_0x294e90['get']({'plain':!![]});interaction_log[_0x12b7('0x23')](_0x12b7('0x63'),_0x48fcc4[_0x12b7('0x5e')]['id'],_0x48fcc4[_0x12b7('0x5e')][_0x12b7('0x3a')],_0x48fcc4['user'][_0x12b7('0x64')],_0x5b211d[_0x12b7('0x62')]['id'],_0x48fcc4['body']?JSON['stringify'](_0x48fcc4[_0x12b7('0x56')]):_0x12b7('0x65'));return respondWithRpcPromise(_0x12b7('0x66'),_0x12b7('0x67'),_0x5b211d);}return null;})[_0x12b7('0x22')](function(_0x713e38){var _0x82f067=_0x12b7('0x68')+_0x713e38[_0x12b7('0x2a')][_0x12b7('0x69')];return db[_0x12b7('0x6a')][_0x12b7('0x41')](_0x82f067,{'type':db[_0x12b7('0x6b')][_0x12b7('0x6c')][_0x12b7('0x6d')],'raw':!![]})[_0x12b7('0x22')](function(_0x45a403){return _0x45a403;});})[_0x12b7('0x22')](function(_0x138344){if(_0x138344){_0x5b211d['message'][_0x12b7('0x6e')]=_0x138344[0x0];if(!_0x48fcc4[_0x12b7('0x56')][_0x12b7('0x5d')])return;return db[_0x12b7('0x6f')][_0x12b7('0x55')]({'where':{'id':_0x48fcc4['body'][_0x12b7('0x5d')],'role':_0x12b7('0x70')},'attributes':['id',_0x12b7('0x3a'),_0x12b7('0x71'),_0x12b7('0x72'),_0x12b7('0x73')],'raw':!![]});}return null;})['then'](function(_0x576fa2){if(!_0x576fa2)return null;_0x5b211d['message'][_0x12b7('0x70')]=_0x576fa2;return _0x5b211d;})[_0x12b7('0x22')](function(_0x4f05b7){if(_0x4f05b7){if(_0x48fcc4[_0x12b7('0x56')]['manual']){_0x5b211d[_0x12b7('0x2a')][_0x12b7('0x74')]=util[_0x12b7('0x5b')](_0x12b7('0x75'),_0x48fcc4[_0x12b7('0x5e')][_0x12b7('0x3a')]);_0x5b211d['message'][_0x12b7('0x76')]=_0x5b211d[_0x12b7('0x76')];_0x5b211d[_0x12b7('0x2a')][_0x12b7('0x77')]=_0x5b211d[_0x12b7('0x76')];_0x5b211d[_0x12b7('0x2a')]['event']=_0x12b7('0x5a');return respondWithRpcPromise(_0x12b7('0x78'),_0x12b7('0x78'),{'event':_0x12b7('0x79'),'message':_0x5b211d[_0x12b7('0x2a')]},client9002)[_0x12b7('0x22')](function(){return _0x5b211d;});}return _0x5b211d;}return null;})['then'](respondWithResult(_0x415d92,null))['catch'](handleError(_0x415d92,null));};var interaction_log=require(_0x12b7('0x7a'))(_0x12b7('0x59'));exports['reject']=function(_0x4a251b,_0xcb5e3b,_0x3f008e){var _0x24e389={'agent':{},'channel':_0x12b7('0x7b')};if(_0x4a251b[_0x12b7('0x56')]['id']){delete _0x4a251b['body']['id'];}_0x4a251b[_0x12b7('0x56')]['UserId']=_0x4a251b['body'][_0x12b7('0x5d')]||_0x4a251b[_0x12b7('0x5e')]['id'];_0x24e389[_0x12b7('0x70')]['id']=_0x4a251b[_0x12b7('0x56')]['UserId'];return db[_0x12b7('0x3d')]['find']({'where':{'id':_0x4a251b[_0x12b7('0x57')]['id'],'UserId':null}})[_0x12b7('0x22')](handleEntityNotFound(_0xcb5e3b,null))[_0x12b7('0x22')](function(_0x5084ff){if(_0x5084ff){_0x24e389[_0x12b7('0x2a')]=_0x5084ff[_0x12b7('0x7c')]({'plain':!![]});return db[_0x12b7('0x7d')]['find']({'where':{'id':_0x5084ff[_0x12b7('0x5f')]}});}return null;})[_0x12b7('0x22')](handleEntityNotFound(_0xcb5e3b,null))['then'](function(_0x3579c9){if(_0x3579c9){_0x24e389[_0x12b7('0x62')]=_0x3579c9[_0x12b7('0x7c')]({'plain':!![]});interaction_log['info'](_0x12b7('0x7e'),_0x4a251b[_0x12b7('0x5e')]['id'],_0x4a251b[_0x12b7('0x5e')][_0x12b7('0x3a')],_0x4a251b['user'][_0x12b7('0x64')],_0x24e389['interaction']['id'],_0x4a251b[_0x12b7('0x56')]?JSON[_0x12b7('0x27')](_0x4a251b['body']):_0x12b7('0x65'));return respondWithRpcPromise(_0x12b7('0x7f'),'rejectMessage',_0x24e389);}return null;})[_0x12b7('0x22')](function(_0x74cdcc){var _0x3d93ce='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x74cdcc[_0x12b7('0x2a')]['ContactId'];return db[_0x12b7('0x6a')][_0x12b7('0x41')](_0x3d93ce,{'type':db[_0x12b7('0x6b')][_0x12b7('0x6c')][_0x12b7('0x6d')],'raw':!![]})[_0x12b7('0x22')](function(_0xe773db){return _0xe773db;});})[_0x12b7('0x22')](function(_0x392f74){if(_0x392f74){_0x24e389[_0x12b7('0x2a')][_0x12b7('0x6e')]=_0x392f74[0x0];if(!_0x4a251b['body'][_0x12b7('0x5d')])return;return db[_0x12b7('0x6f')][_0x12b7('0x55')]({'where':{'id':_0x4a251b[_0x12b7('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0x12b7('0x3a'),_0x12b7('0x71'),'email',_0x12b7('0x73')],'raw':!![]});}return null;})['then'](function(_0x997929){if(!_0x997929)return null;_0x24e389['message'][_0x12b7('0x70')]=_0x997929;return _0x24e389;})[_0x12b7('0x22')](function(_0x18f0db){if(_0x18f0db){_0x18f0db['message'][_0x12b7('0x74')]=util[_0x12b7('0x5b')](_0x12b7('0x75'),_0x4a251b[_0x12b7('0x5e')][_0x12b7('0x3a')]);_0x18f0db[_0x12b7('0x2a')][_0x12b7('0x76')]=_0x24e389[_0x12b7('0x76')];_0x18f0db[_0x12b7('0x2a')]['motionChannel']=_0x24e389['channel'];_0x18f0db[_0x12b7('0x2a')][_0x12b7('0x80')]=_0x12b7('0x81');respondWithRpcPromise(_0x12b7('0x78'),_0x12b7('0x78'),{'event':_0x12b7('0x82'),'message':_0x18f0db[_0x12b7('0x2a')]},client9002);return _0x24e389;}return null;})['then'](respondWithResult(_0xcb5e3b,null))[_0x12b7('0x2c')](handleError(_0xcb5e3b,null));};exports[_0x12b7('0x83')]=function(_0x2b401e,_0x3914bb){var _0x52d92b;return db['FaxMessage'][_0x12b7('0x83')](_0x2b401e[_0x12b7('0x56')],{})[_0x12b7('0x22')](function(_0x2bda1c){_0x52d92b=_0x2bda1c;return db['CmContact'][_0x12b7('0x84')]({'where':{'id':_0x52d92b[_0x12b7('0x69')]}});})['then'](function(_0x479601){if(_[_0x12b7('0x60')](_0x479601)){return;}else{_0x52d92b[_0x12b7('0x7b')]=_0x479601[_0x12b7('0x7b')];return db[_0x12b7('0x85')][_0x12b7('0x84')]({'where':{'id':_0x52d92b[_0x12b7('0x86')]}});}})['then'](function(_0x48301f){return respondWithRpcPromise(_0x12b7('0x87'),_0x12b7('0x87'),{'FaxAccountId':_[_0x12b7('0x60')](_0x2b401e[_0x12b7('0x56')])?undefined:_0x2b401e[_0x12b7('0x56')]['FaxAccountId'],'path':_[_0x12b7('0x60')](_0x48301f)?undefined:util[_0x12b7('0x5b')](_0x12b7('0x88'),_0x48301f[_0x12b7('0x89')]),'fax':_[_0x12b7('0x60')](_0x52d92b['fax'])?undefined:_0x52d92b[_0x12b7('0x7b')],'AttachmentId':_0x52d92b[_0x12b7('0x86')]},client9002);})[_0x12b7('0x22')](respondWithResult(_0x3914bb,0xc9))[_0x12b7('0x2c')](handleError(_0x3914bb,null));};exports['download']=function(_0x4eb034,_0x8fe6b6){var _0x319865=path[_0x12b7('0x8a')](config[_0x12b7('0x8b')],'server',_0x12b7('0x8c'),_0x12b7('0x8d'));return db['FaxMessage'][_0x12b7('0x55')]({'where':{'id':_0x4eb034[_0x12b7('0x57')]['id']},'include':[{'model':db['Attachment'],'as':_0x12b7('0x85')}]})[_0x12b7('0x22')](handleEntityNotFound(_0x8fe6b6,null))[_0x12b7('0x22')](function(_0x296aeb){if(_0x296aeb){return _0x8fe6b6[_0x12b7('0x8e')](path[_0x12b7('0x8a')](_0x319865,_0x296aeb['Attachment']['basename']));}})[_0x12b7('0x2c')](handleError(_0x8fe6b6,null));}; \ No newline at end of file +var _0x4898=['include','merge','find','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','SIP/%s','channel','event','fax-interactions','FaxInteraction','FaxInteractionId','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','interface','motionChannel','EventManager','rejectmessage','create','CmContact','findOne','fax','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','files','attachments','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','client','http','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','code','FaxMessage,\x20%s,\x20%s','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','update','destroy','stack','name','send','index','map','FaxMessage','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','show','params','rawAttributes'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x4898,0x1e7));var _0x8489=function(_0x1254c5,_0x5ebe61){_0x1254c5=_0x1254c5-0x0;var _0x29cd22=_0x4898[_0x1254c5];return _0x29cd22;};'use strict';var emlformat=require(_0x8489('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8489('0x1'));var jsonpatch=require(_0x8489('0x2'));var rp=require(_0x8489('0x3'));var moment=require(_0x8489('0x4'));var BPromise=require(_0x8489('0x5'));var Mustache=require('mustache');var util=require(_0x8489('0x6'));var path=require(_0x8489('0x7'));var sox=require(_0x8489('0x8'));var csv=require('to-csv');var ejs=require(_0x8489('0x9'));var fs=require('fs');var fs_extra=require(_0x8489('0xa'));var _=require('lodash');var squel=require(_0x8489('0xb'));var crypto=require(_0x8489('0xc'));var jsforce=require(_0x8489('0xd'));var deskjs=require(_0x8489('0xe'));var toCsv=require(_0x8489('0xf'));var querystring=require(_0x8489('0x10'));var Papa=require(_0x8489('0x11'));var Redis=require(_0x8489('0x12'));var authService=require(_0x8489('0x13'));var qs=require(_0x8489('0x14'));var as=require(_0x8489('0x15'));var hardwareService=require(_0x8489('0x16'));var logger=require(_0x8489('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x8489('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8489('0x19'))['db'];config[_0x8489('0x1a')]=_[_0x8489('0x1b')](config[_0x8489('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x8489('0x1c'))(new Redis(config[_0x8489('0x1a')]));require(_0x8489('0x1d'))[_0x8489('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8489('0x1f')][_0x8489('0x20')]({'port':0x232c});var client9002=jayson[_0x8489('0x1f')][_0x8489('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x36438d,_0x43ba6b,_0x2902c9,_0xdad845){return new BPromise(function(_0x12cfa1,_0x3ec89b){var _0x34ebc7=_0xdad845||client;return _0x34ebc7['request'](_0x36438d,_0x2902c9)[_0x8489('0x21')](function(_0x16ce5b){logger[_0x8489('0x22')]('FaxMessage,\x20%s,\x20%s',_0x43ba6b,_0x8489('0x23'));logger[_0x8489('0x24')](_0x8489('0x25'),_0x43ba6b,_0x8489('0x23'),JSON[_0x8489('0x26')](_0x16ce5b));if(_0x16ce5b['error']){if(_0x16ce5b['error'][_0x8489('0x27')]===0x1f4){logger['error'](_0x8489('0x28'),_0x43ba6b,_0x16ce5b[_0x8489('0x29')][_0x8489('0x2a')]);return _0x3ec89b(_0x16ce5b[_0x8489('0x29')]['message']);}logger['error'](_0x8489('0x28'),_0x43ba6b,_0x16ce5b[_0x8489('0x29')][_0x8489('0x2a')]);return _0x12cfa1(_0x16ce5b['error']['message']);}else{logger[_0x8489('0x22')](_0x8489('0x28'),_0x43ba6b,_0x8489('0x23'));_0x12cfa1(_0x16ce5b[_0x8489('0x2b')][_0x8489('0x2a')]);}})[_0x8489('0x2c')](function(_0x752f44){logger['error'](_0x8489('0x28'),_0x43ba6b,_0x752f44);_0x3ec89b(_0x752f44);});});}function respondWithStatusCode(_0xc15883,_0x3bce06){_0x3bce06=_0x3bce06||0xcc;return function(_0x2aa03b){if(_0x2aa03b){return _0xc15883[_0x8489('0x2d')](_0x3bce06);}return _0xc15883['status'](_0x3bce06)[_0x8489('0x2e')]();};}function respondWithResult(_0x568c64,_0x4290b6){_0x4290b6=_0x4290b6||0xc8;return function(_0x35bd6c){if(_0x35bd6c){return _0x568c64[_0x8489('0x2f')](_0x4290b6)[_0x8489('0x30')](_0x35bd6c);}};}function respondWithFilteredResult(_0x581511,_0x17285a){return function(_0x7d8395){if(_0x7d8395){var _0x5799ec=typeof _0x17285a[_0x8489('0x31')]===_0x8489('0x32')&&typeof _0x17285a[_0x8489('0x33')]===_0x8489('0x32');var _0x207586=_0x7d8395['count'];var _0xe81582=_0x5799ec?0x0:_0x17285a[_0x8489('0x31')];var _0x19932a=_0x5799ec?_0x7d8395[_0x8489('0x34')]:_0x17285a[_0x8489('0x31')]+_0x17285a[_0x8489('0x33')];var _0x219d08;if(_0x19932a>=_0x207586){_0x19932a=_0x207586;_0x219d08=0xc8;}else{_0x219d08=0xce;}_0x581511[_0x8489('0x2f')](_0x219d08);return _0x581511[_0x8489('0x35')]('Content-Range',_0xe81582+'-'+_0x19932a+'/'+_0x207586)[_0x8489('0x30')](_0x7d8395);}return null;};}function patchUpdates(_0x46ba49){return function(_0x2ff684){try{jsonpatch['apply'](_0x2ff684,_0x46ba49,!![]);}catch(_0x156c63){return BPromise[_0x8489('0x36')](_0x156c63);}return _0x2ff684['save']();};}function saveUpdates(_0x324633,_0x3b6ce6){return function(_0xc5149c){if(_0xc5149c){return _0xc5149c[_0x8489('0x37')](_0x324633)[_0x8489('0x21')](function(_0x19918d){return _0x19918d;});}return null;};}function removeEntity(_0xb11d2f,_0xdd473d){return function(_0x320dca){if(_0x320dca){return _0x320dca[_0x8489('0x38')]()[_0x8489('0x21')](function(){_0xb11d2f[_0x8489('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x150462,_0x35fcc0){return function(_0x55d48f){if(!_0x55d48f){_0x150462['sendStatus'](0x194);}return _0x55d48f;};}function handleError(_0x22b38f,_0x5739fd){_0x5739fd=_0x5739fd||0x1f4;return function(_0x29cd3a){logger['error'](_0x29cd3a[_0x8489('0x39')]);if(_0x29cd3a[_0x8489('0x3a')]){delete _0x29cd3a['name'];}_0x22b38f[_0x8489('0x2f')](_0x5739fd)[_0x8489('0x3b')](_0x29cd3a);};}exports[_0x8489('0x3c')]=function(_0x17525f,_0x5a25a1){var _0xfd0a7e={},_0x28933f={},_0x57eefb={'count':0x0,'rows':[]};var _0x4a2ef3=_[_0x8489('0x3d')](db[_0x8489('0x3e')]['rawAttributes'],function(_0x4998a9){return{'name':_0x4998a9[_0x8489('0x3f')],'type':_0x4998a9[_0x8489('0x40')]['key']};});_0x28933f[_0x8489('0x41')]=_[_0x8489('0x3d')](_0x4a2ef3,_0x8489('0x3a'));_0x28933f[_0x8489('0x42')]=_[_0x8489('0x43')](_0x17525f[_0x8489('0x42')]);_0x28933f[_0x8489('0x44')]=_['intersection'](_0x28933f[_0x8489('0x41')],_0x28933f['query']);_0xfd0a7e[_0x8489('0x45')]=_[_0x8489('0x46')](_0x28933f[_0x8489('0x41')],qs[_0x8489('0x47')](_0x17525f[_0x8489('0x42')][_0x8489('0x47')]));_0xfd0a7e[_0x8489('0x45')]=_0xfd0a7e[_0x8489('0x45')][_0x8489('0x48')]?_0xfd0a7e['attributes']:_0x28933f['model'];if(!_0x17525f[_0x8489('0x42')]['hasOwnProperty'](_0x8489('0x49'))){_0xfd0a7e[_0x8489('0x33')]=qs[_0x8489('0x33')](_0x17525f[_0x8489('0x42')][_0x8489('0x33')]);_0xfd0a7e[_0x8489('0x31')]=qs[_0x8489('0x31')](_0x17525f[_0x8489('0x42')][_0x8489('0x31')]);}_0xfd0a7e[_0x8489('0x4a')]=qs[_0x8489('0x4b')](_0x17525f[_0x8489('0x42')]['sort']);_0xfd0a7e[_0x8489('0x4c')]=qs[_0x8489('0x44')](_[_0x8489('0x4d')](_0x17525f['query'],_0x28933f[_0x8489('0x44')]),_0x4a2ef3);if(_0x17525f[_0x8489('0x42')][_0x8489('0x4e')]){_0xfd0a7e[_0x8489('0x4c')]=_['merge'](_0xfd0a7e[_0x8489('0x4c')],{'$or':_[_0x8489('0x3d')](_0x4a2ef3,function(_0x5b9ba5){if(_0x5b9ba5[_0x8489('0x40')]!==_0x8489('0x4f')){var _0x3c2e55={};_0x3c2e55[_0x5b9ba5[_0x8489('0x3a')]]={'$like':'%'+_0x17525f[_0x8489('0x42')]['filter']+'%'};return _0x3c2e55;}})});}_0xfd0a7e=_['merge']({},_0xfd0a7e,_0x17525f[_0x8489('0x50')]);var _0x30a2df={'where':_0xfd0a7e[_0x8489('0x4c')]};return db[_0x8489('0x3e')]['count'](_0x30a2df)['then'](function(_0x19fb70){_0x57eefb[_0x8489('0x34')]=_0x19fb70;if(_0x17525f['query'][_0x8489('0x51')]){_0xfd0a7e['include']=[{'all':!![]}];}return db[_0x8489('0x3e')]['findAll'](_0xfd0a7e);})[_0x8489('0x21')](function(_0x3a343f){_0x57eefb['rows']=_0x3a343f;return _0x57eefb;})[_0x8489('0x21')](respondWithFilteredResult(_0x5a25a1,_0xfd0a7e))[_0x8489('0x2c')](handleError(_0x5a25a1,null));};exports[_0x8489('0x52')]=function(_0x41b5f2,_0x55dfa2){var _0x378c7f={'raw':!![],'where':{'id':_0x41b5f2[_0x8489('0x53')]['id']}},_0x5a4dce={};_0x5a4dce[_0x8489('0x41')]=_[_0x8489('0x43')](db[_0x8489('0x3e')][_0x8489('0x54')]);_0x5a4dce[_0x8489('0x42')]=_[_0x8489('0x43')](_0x41b5f2[_0x8489('0x42')]);_0x5a4dce[_0x8489('0x44')]=_[_0x8489('0x46')](_0x5a4dce['model'],_0x5a4dce['query']);_0x378c7f[_0x8489('0x45')]=_[_0x8489('0x46')](_0x5a4dce[_0x8489('0x41')],qs[_0x8489('0x47')](_0x41b5f2[_0x8489('0x42')][_0x8489('0x47')]));_0x378c7f['attributes']=_0x378c7f['attributes'][_0x8489('0x48')]?_0x378c7f[_0x8489('0x45')]:_0x5a4dce['model'];if(_0x41b5f2['query'][_0x8489('0x51')]){_0x378c7f[_0x8489('0x55')]=[{'all':!![]}];}_0x378c7f=_[_0x8489('0x56')]({},_0x378c7f,_0x41b5f2['options']);return db[_0x8489('0x3e')][_0x8489('0x57')](_0x378c7f)[_0x8489('0x21')](handleEntityNotFound(_0x55dfa2,null))[_0x8489('0x21')](respondWithResult(_0x55dfa2,null))[_0x8489('0x2c')](handleError(_0x55dfa2,null));};exports[_0x8489('0x37')]=function(_0x4ca96d,_0x266801){if(_0x4ca96d[_0x8489('0x58')]['id']){delete _0x4ca96d['body']['id'];}return db[_0x8489('0x3e')][_0x8489('0x57')]({'where':{'id':_0x4ca96d[_0x8489('0x53')]['id']}})[_0x8489('0x21')](handleEntityNotFound(_0x266801,null))[_0x8489('0x21')](saveUpdates(_0x4ca96d['body'],null))['then'](respondWithResult(_0x266801,null))[_0x8489('0x2c')](handleError(_0x266801,null));};exports['destroy']=function(_0x5dc0ec,_0x31c14c){return db[_0x8489('0x3e')][_0x8489('0x57')]({'where':{'id':_0x5dc0ec[_0x8489('0x53')]['id']}})[_0x8489('0x21')](handleEntityNotFound(_0x31c14c,null))[_0x8489('0x21')](removeEntity(_0x31c14c,null))['catch'](handleError(_0x31c14c,null));};exports[_0x8489('0x59')]=function(_0x2d8621,_0x35da04){return db[_0x8489('0x3e')][_0x8489('0x59')]()[_0x8489('0x21')](respondWithResult(_0x35da04,null))[_0x8489('0x2c')](handleError(_0x35da04,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x8489('0x5a')]=function(_0x558d34,_0x4476d7,_0x5f5472){var _0xde2698={'agent':{},'channel':'fax'};if(_0x558d34[_0x8489('0x58')]['id']){delete _0x558d34[_0x8489('0x58')]['id'];}_0x558d34[_0x8489('0x58')][_0x8489('0x5b')]=!![];_0x558d34[_0x8489('0x58')][_0x8489('0x5c')]=moment()[_0x8489('0x5d')](_0x8489('0x5e'));_0x558d34['body'][_0x8489('0x5f')]=_0x558d34[_0x8489('0x58')][_0x8489('0x5f')]||_0x558d34['user']['id'];_0xde2698[_0x8489('0x60')]['id']=_0x558d34[_0x8489('0x58')]['UserId'];return db[_0x8489('0x3e')][_0x8489('0x57')]({'where':{'id':_0x558d34[_0x8489('0x53')]['id'],'UserId':null}})[_0x8489('0x21')](handleEntityNotFound(_0x4476d7,null))[_0x8489('0x21')](saveUpdates(_0x558d34['body'],null))['then'](function(_0x1f15b1){if(_0x1f15b1){_0xde2698[_0x8489('0x2a')]=_0x1f15b1[_0x8489('0x61')]({'plain':!![]});return db['FaxInteraction'][_0x8489('0x57')]({'where':{'id':_0x1f15b1['FaxInteractionId']}});}return null;})[_0x8489('0x21')](handleEntityNotFound(_0x4476d7,null))['then'](function(_0xf01dc6){if(_0xf01dc6){return _0xf01dc6['update']({'UserId':_0x558d34['body'][_0x8489('0x5f')],'read1stAt':_[_0x8489('0x62')](_0xf01dc6[_0x8489('0x63')])?moment()[_0x8489('0x5d')](_0x8489('0x5e')):undefined});}return null;})['then'](function(_0x4342a1){if(_0x4342a1){_0xde2698[_0x8489('0x64')]=_0x4342a1[_0x8489('0x61')]({'plain':!![]});interaction_log[_0x8489('0x22')](_0x8489('0x65'),_0x558d34[_0x8489('0x66')]['id'],_0x558d34[_0x8489('0x66')][_0x8489('0x3a')],_0x558d34[_0x8489('0x66')][_0x8489('0x67')],_0xde2698['interaction']['id'],_0x558d34[_0x8489('0x58')]?JSON[_0x8489('0x26')](_0x558d34[_0x8489('0x58')]):_0x8489('0x68'));return respondWithRpcPromise(_0x8489('0x69'),_0x8489('0x6a'),_0xde2698);}return null;})[_0x8489('0x21')](function(_0x55487e){var _0x362290='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x55487e[_0x8489('0x2a')][_0x8489('0x6b')];return db[_0x8489('0x6c')][_0x8489('0x42')](_0x362290,{'type':db[_0x8489('0x6d')][_0x8489('0x6e')][_0x8489('0x6f')],'raw':!![]})[_0x8489('0x21')](function(_0x3e759d){return _0x3e759d;});})['then'](function(_0x444baf){if(_0x444baf){_0xde2698['message']['contact']=_0x444baf[0x0];if(!_0x558d34[_0x8489('0x58')][_0x8489('0x5f')])return;return db['User'][_0x8489('0x57')]({'where':{'id':_0x558d34[_0x8489('0x58')]['UserId'],'role':_0x8489('0x60')},'attributes':['id',_0x8489('0x3a'),_0x8489('0x70'),_0x8489('0x71'),_0x8489('0x72')],'raw':!![]});}return null;})[_0x8489('0x21')](function(_0x57e959){if(!_0x57e959)return null;_0xde2698['message'][_0x8489('0x60')]=_0x57e959;return _0xde2698;})[_0x8489('0x21')](function(_0x1ddf4d){if(_0x1ddf4d){if(_0x558d34[_0x8489('0x58')][_0x8489('0x73')]){_0xde2698['message']['interface']=util[_0x8489('0x5d')](_0x8489('0x74'),_0x558d34['user'][_0x8489('0x3a')]);_0xde2698[_0x8489('0x2a')][_0x8489('0x75')]=_0xde2698['channel'];_0xde2698['message']['motionChannel']=_0xde2698[_0x8489('0x75')];_0xde2698[_0x8489('0x2a')][_0x8489('0x76')]=_0x8489('0x5a');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0xde2698['message']},client9002)[_0x8489('0x21')](function(){return _0xde2698;});}return _0xde2698;}return null;})[_0x8489('0x21')](respondWithResult(_0x4476d7,null))['catch'](handleError(_0x4476d7,null));};var interaction_log=require(_0x8489('0x17'))(_0x8489('0x77'));exports[_0x8489('0x36')]=function(_0x5cc9cc,_0x5b0028,_0x46fe76){var _0x4ac379={'agent':{},'channel':'fax'};if(_0x5cc9cc[_0x8489('0x58')]['id']){delete _0x5cc9cc['body']['id'];}_0x5cc9cc[_0x8489('0x58')]['UserId']=_0x5cc9cc[_0x8489('0x58')]['UserId']||_0x5cc9cc[_0x8489('0x66')]['id'];_0x4ac379[_0x8489('0x60')]['id']=_0x5cc9cc[_0x8489('0x58')][_0x8489('0x5f')];return db['FaxMessage']['find']({'where':{'id':_0x5cc9cc[_0x8489('0x53')]['id'],'UserId':null}})[_0x8489('0x21')](handleEntityNotFound(_0x5b0028,null))[_0x8489('0x21')](function(_0x55a993){if(_0x55a993){_0x4ac379['message']=_0x55a993[_0x8489('0x61')]({'plain':!![]});return db[_0x8489('0x78')]['find']({'where':{'id':_0x55a993[_0x8489('0x79')]}});}return null;})[_0x8489('0x21')](handleEntityNotFound(_0x5b0028,null))[_0x8489('0x21')](function(_0x20e301){if(_0x20e301){_0x4ac379[_0x8489('0x64')]=_0x20e301[_0x8489('0x61')]({'plain':!![]});interaction_log[_0x8489('0x22')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5cc9cc[_0x8489('0x66')]['id'],_0x5cc9cc[_0x8489('0x66')][_0x8489('0x3a')],_0x5cc9cc[_0x8489('0x66')][_0x8489('0x67')],_0x4ac379[_0x8489('0x64')]['id'],_0x5cc9cc[_0x8489('0x58')]?JSON[_0x8489('0x26')](_0x5cc9cc[_0x8489('0x58')]):'null');return respondWithRpcPromise(_0x8489('0x7a'),_0x8489('0x7b'),_0x4ac379);}return null;})['then'](function(_0x3c437e){var _0x149ac4=_0x8489('0x7c')+_0x3c437e['message'][_0x8489('0x6b')];return db[_0x8489('0x6c')][_0x8489('0x42')](_0x149ac4,{'type':db[_0x8489('0x6d')][_0x8489('0x6e')][_0x8489('0x6f')],'raw':!![]})[_0x8489('0x21')](function(_0x1a394d){return _0x1a394d;});})[_0x8489('0x21')](function(_0x28bb06){if(_0x28bb06){_0x4ac379[_0x8489('0x2a')]['contact']=_0x28bb06[0x0];if(!_0x5cc9cc['body'][_0x8489('0x5f')])return;return db[_0x8489('0x7d')][_0x8489('0x57')]({'where':{'id':_0x5cc9cc[_0x8489('0x58')][_0x8489('0x5f')],'role':'agent'},'attributes':['id',_0x8489('0x3a'),_0x8489('0x70'),_0x8489('0x71'),_0x8489('0x72')],'raw':!![]});}return null;})[_0x8489('0x21')](function(_0x47bb5d){if(!_0x47bb5d)return null;_0x4ac379['message'][_0x8489('0x60')]=_0x47bb5d;return _0x4ac379;})[_0x8489('0x21')](function(_0x2db95d){if(_0x2db95d){_0x2db95d['message'][_0x8489('0x7e')]=util[_0x8489('0x5d')]('SIP/%s',_0x5cc9cc[_0x8489('0x66')][_0x8489('0x3a')]);_0x2db95d['message'][_0x8489('0x75')]=_0x4ac379[_0x8489('0x75')];_0x2db95d[_0x8489('0x2a')][_0x8489('0x7f')]=_0x4ac379[_0x8489('0x75')];_0x2db95d[_0x8489('0x2a')][_0x8489('0x76')]='reject';respondWithRpcPromise(_0x8489('0x80'),_0x8489('0x80'),{'event':_0x8489('0x81'),'message':_0x2db95d[_0x8489('0x2a')]},client9002);return _0x4ac379;}return null;})[_0x8489('0x21')](respondWithResult(_0x5b0028,null))[_0x8489('0x2c')](handleError(_0x5b0028,null));};exports['create']=function(_0x2c3e22,_0x1f9446){var _0x2e5d0f;return db['FaxMessage'][_0x8489('0x82')](_0x2c3e22[_0x8489('0x58')],{})['then'](function(_0x307861){_0x2e5d0f=_0x307861;return db[_0x8489('0x83')][_0x8489('0x84')]({'where':{'id':_0x2e5d0f[_0x8489('0x6b')]}});})['then'](function(_0x245ae5){if(_[_0x8489('0x62')](_0x245ae5)){return;}else{_0x2e5d0f[_0x8489('0x85')]=_0x245ae5[_0x8489('0x85')];return db[_0x8489('0x86')][_0x8489('0x84')]({'where':{'id':_0x2e5d0f['AttachmentId']}});}})[_0x8489('0x21')](function(_0x26f448){return respondWithRpcPromise(_0x8489('0x87'),_0x8489('0x87'),{'FaxAccountId':_['isNil'](_0x2c3e22[_0x8489('0x58')])?undefined:_0x2c3e22['body'][_0x8489('0x88')],'path':_[_0x8489('0x62')](_0x26f448)?undefined:util[_0x8489('0x5d')](_0x8489('0x89'),_0x26f448[_0x8489('0x8a')]),'fax':_[_0x8489('0x62')](_0x2e5d0f[_0x8489('0x85')])?undefined:_0x2e5d0f['fax'],'AttachmentId':_0x2e5d0f['AttachmentId']},client9002);})[_0x8489('0x21')](respondWithResult(_0x1f9446,0xc9))[_0x8489('0x2c')](handleError(_0x1f9446,null));};exports['download']=function(_0x127603,_0x560e26){var _0x1a7364=path[_0x8489('0x8b')](config['root'],'server',_0x8489('0x8c'),_0x8489('0x8d'));return db[_0x8489('0x3e')][_0x8489('0x57')]({'where':{'id':_0x127603[_0x8489('0x53')]['id']},'include':[{'model':db[_0x8489('0x86')],'as':_0x8489('0x86')}]})['then'](handleEntityNotFound(_0x560e26,null))[_0x8489('0x21')](function(_0x3201ea){if(_0x3201ea){return _0x560e26[_0x8489('0x8e')](path[_0x8489('0x8b')](_0x1a7364,_0x3201ea[_0x8489('0x86')][_0x8489('0x8a')]));}})[_0x8489('0x2c')](handleError(_0x560e26,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 819b34d..2030b80 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 _0x9536=['../../mysqldb','FaxMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9536,0x179));var _0x6953=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x9536[_0x274dd7];return _0x148829;};'use strict';var EventEmitter=require(_0x6953('0x0'));var FaxMessage=require(_0x6953('0x1'))['db'][_0x6953('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x6953('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6953('0x4'),'afterDestroy':'remove'};function emitEvent(_0x42fb54){return function(_0x3c32c7,_0x1dee7c,_0x3ba964){FaxMessageEvents[_0x6953('0x5')](_0x42fb54+':'+_0x3c32c7['id'],_0x3c32c7);FaxMessageEvents['emit'](_0x42fb54,_0x3c32c7);_0x3ba964(null);};}for(var e in events){if(events[_0x6953('0x6')](e)){var event=events[e];FaxMessage[_0x6953('0x7')](e,emitEvent(event));}}module[_0x6953('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x47a1=['events','setMaxListeners','update','remove','emit','hook','exports'];(function(_0x541c9e,_0x47f1a7){var _0x50dc53=function(_0x259431){while(--_0x259431){_0x541c9e['push'](_0x541c9e['shift']());}};_0x50dc53(++_0x47f1a7);}(_0x47a1,0xbd));var _0x147a=function(_0x56ec3b,_0x7899fa){_0x56ec3b=_0x56ec3b-0x0;var _0x4dfa9d=_0x47a1[_0x56ec3b];return _0x4dfa9d;};'use strict';var EventEmitter=require(_0x147a('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x147a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x147a('0x2'),'afterDestroy':_0x147a('0x3')};function emitEvent(_0x5e69bc){return function(_0xd80e93,_0x66a8e2,_0xc2071d){FaxMessageEvents[_0x147a('0x4')](_0x5e69bc+':'+_0xd80e93['id'],_0xd80e93);FaxMessageEvents[_0x147a('0x4')](_0x5e69bc,_0xd80e93);_0xc2071d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x147a('0x5')](e,emitEvent(event));}}module[_0x147a('0x6')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index a040a25..a493035 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 _0x727b=['FaxMessage','fti_fax_messages','body','FULLTEXT','get','toLowerCase','direction','out','secret','isNil','UserId','FaxInteraction','update','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports'];(function(_0x27c754,_0xc88e75){var _0x4239d9=function(_0x145120){while(--_0x145120){_0x27c754['push'](_0x27c754['shift']());}};_0x4239d9(++_0xc88e75);}(_0x727b,0x18b));var _0xb727=function(_0x2cb477,_0x132ebb){_0x2cb477=_0x2cb477-0x0;var _0x5f209d=_0x727b[_0x2cb477];return _0x5f209d;};'use strict';var _=require(_0xb727('0x0'));var util=require(_0xb727('0x1'));var logger=require(_0xb727('0x2'))('api');var moment=require(_0xb727('0x3'));var BPromise=require('bluebird');var rp=require(_0xb727('0x4'));var fs=require('fs');var path=require(_0xb727('0x5'));var rimraf=require(_0xb727('0x6'));var config=require(_0xb727('0x7'));var attributes=require(_0xb727('0x8'));module[_0xb727('0x9')]=function(_0x39b2cc,_0x7dd4e4){return _0x39b2cc['define'](_0xb727('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xb727('0xb'),'fields':[_0xb727('0xc')],'type':_0xb727('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3da12a,_0x5b67d0,_0x55b6cb){var _0x656cfb=_0x39b2cc['models'];var _0x50dfaa=_0x3da12a[_0xb727('0xe')]({'plain':!![]});if(_0x50dfaa['direction'][_0xb727('0xf')]()==='in'||_0x50dfaa[_0xb727('0x10')][_0xb727('0xf')]()===_0xb727('0x11')&&!_0x50dfaa[_0xb727('0x12')]&&!_[_0xb727('0x13')](_0x50dfaa[_0xb727('0x14')])){_0x656cfb[_0xb727('0x15')]['findOne']({'where':{'id':_0x50dfaa['FaxInteractionId']}})['then'](function(_0x5d0e3f){if(_0x5d0e3f){_0x5d0e3f[_0xb727('0x16')]({'lastMsgAt':_0x50dfaa[_0xb727('0x17')],'lastMsgDirection':_0x50dfaa[_0xb727('0x10')]['toLowerCase']()});}})[_0xb727('0x18')](function(_0x48e5fd){console[_0xb727('0x19')](_0x48e5fd);});}_0x55b6cb();}},'charset':_0xb727('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5597=['createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','models','get','toLowerCase','direction','out','isNil','FaxInteraction','then','update'];(function(_0x548f86,_0x50a063){var _0xd76591=function(_0x4be134){while(--_0x4be134){_0x548f86['push'](_0x548f86['shift']());}};_0xd76591(++_0x50a063);}(_0x5597,0x122));var _0x7559=function(_0x47e3a0,_0x3ec1cc){_0x47e3a0=_0x47e3a0-0x0;var _0x2e66e5=_0x5597[_0x47e3a0];return _0x2e66e5;};'use strict';var _=require(_0x7559('0x0'));var util=require(_0x7559('0x1'));var logger=require(_0x7559('0x2'))('api');var moment=require(_0x7559('0x3'));var BPromise=require(_0x7559('0x4'));var rp=require(_0x7559('0x5'));var fs=require('fs');var path=require(_0x7559('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7559('0x7'));module[_0x7559('0x8')]=function(_0x550a65,_0x29045b){return _0x550a65[_0x7559('0x9')](_0x7559('0xa'),attributes,{'tableName':_0x7559('0xb'),'paranoid':![],'indexes':[{'name':_0x7559('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1814c9,_0x50bded,_0x524c55){var _0x49a274=_0x550a65[_0x7559('0xd')];var _0x51e3c9=_0x1814c9[_0x7559('0xe')]({'plain':!![]});if(_0x51e3c9['direction'][_0x7559('0xf')]()==='in'||_0x51e3c9[_0x7559('0x10')][_0x7559('0xf')]()===_0x7559('0x11')&&!_0x51e3c9['secret']&&!_[_0x7559('0x12')](_0x51e3c9['UserId'])){_0x49a274[_0x7559('0x13')]['findOne']({'where':{'id':_0x51e3c9['FaxInteractionId']}})[_0x7559('0x14')](function(_0x2056ce){if(_0x2056ce){_0x2056ce[_0x7559('0x15')]({'lastMsgAt':_0x51e3c9[_0x7559('0x16')],'lastMsgDirection':_0x51e3c9[_0x7559('0x10')]['toLowerCase']()});}})[_0x7559('0x17')](function(_0xbef00b){console[_0x7559('0x18')](_0xbef00b);});}_0x524c55();}},'charset':_0x7559('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 68c7fd7..0cdf100 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 _0x70e0=['FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','CreateFaxMessage','FaxMessage','create','body','options','stringify','catch','update','raw','where','limit','UpdateFaxMessage','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0x4cce3d,_0x1e84ea){var _0x39b6df=function(_0x2ca86b){while(--_0x2ca86b){_0x4cce3d['push'](_0x4cce3d['shift']());}};_0x39b6df(++_0x1e84ea);}(_0x70e0,0x17b));var _0x070e=function(_0x310321,_0x52c494){_0x310321=_0x310321-0x0;var _0x279c51=_0x70e0[_0x310321];return _0x279c51;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x070e('0x9')],{'host':_0x070e('0xa'),'port':0x18eb});var socket=require(_0x070e('0xb'))(new Redis(config[_0x070e('0x9')]));require(_0x070e('0xc'))[_0x070e('0xd')](socket);function respondWithRpcPromise(_0x11ffa8,_0x4e99e6,_0x49b2fb){return new BPromise(function(_0x50f4eb,_0x2e3e5e){return client[_0x070e('0xe')](_0x11ffa8,_0x49b2fb)[_0x070e('0xf')](function(_0xa927a2){logger[_0x070e('0x10')](_0x070e('0x11'),_0x4e99e6,_0x070e('0x12'));logger[_0x070e('0x13')](_0x070e('0x14'),_0x4e99e6,_0x070e('0x12'),JSON['stringify'](_0xa927a2));if(_0xa927a2['error']){if(_0xa927a2[_0x070e('0x15')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x4e99e6,_0xa927a2[_0x070e('0x15')][_0x070e('0x16')]);return _0x2e3e5e(_0xa927a2['error']['message']);}logger[_0x070e('0x15')](_0x070e('0x11'),_0x4e99e6,_0xa927a2[_0x070e('0x15')][_0x070e('0x16')]);return _0x50f4eb(_0xa927a2['error']['message']);}else{logger[_0x070e('0x10')](_0x070e('0x11'),_0x4e99e6,_0x070e('0x12'));_0x50f4eb(_0xa927a2[_0x070e('0x17')][_0x070e('0x16')]);}})['catch'](function(_0x3938b5){logger[_0x070e('0x15')](_0x070e('0x11'),_0x4e99e6,_0x3938b5);_0x2e3e5e(_0x3938b5);});});}exports[_0x070e('0x18')]=function(_0x259893){var _0x5c16fd=this;return new Promise(function(_0x5b2f48,_0x4e958f){return db[_0x070e('0x19')][_0x070e('0x1a')](_0x259893[_0x070e('0x1b')],{'raw':_0x259893['options']?_0x259893[_0x070e('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x070e('0xf')](function(_0x3f6985){logger[_0x070e('0x10')](_0x070e('0x18'),_0x259893);logger[_0x070e('0x13')](_0x070e('0x18'),_0x259893,JSON[_0x070e('0x1d')](_0x3f6985));_0x5b2f48(_0x3f6985);})[_0x070e('0x1e')](function(_0x595c7e){logger[_0x070e('0x15')](_0x070e('0x18'),_0x595c7e[_0x070e('0x16')],_0x259893);_0x4e958f(_0x5c16fd['error'](0x1f4,_0x595c7e[_0x070e('0x16')]));});});};exports['UpdateFaxMessage']=function(_0x4a2dbd){var _0x2ccbd7=this;return new Promise(function(_0x25f6e,_0x41deb1){return db[_0x070e('0x19')][_0x070e('0x1f')](_0x4a2dbd['body'],{'raw':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x21')]||null:null,'attributes':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')]['attributes']||null:null,'limit':_0x4a2dbd[_0x070e('0x1c')]?_0x4a2dbd[_0x070e('0x1c')][_0x070e('0x22')]||null:null})['then'](function(_0x5c5f0d){logger[_0x070e('0x10')](_0x070e('0x23'),_0x4a2dbd);logger[_0x070e('0x13')]('UpdateFaxMessage',_0x4a2dbd,JSON[_0x070e('0x1d')](_0x5c5f0d));_0x25f6e(_0x5c5f0d);})[_0x070e('0x1e')](function(_0x3a9425){logger[_0x070e('0x15')]('UpdateFaxMessage',_0x3a9425['message'],_0x4a2dbd);_0x41deb1(_0x2ccbd7['error'](0x1f4,_0x3a9425['message']));});});}; \ No newline at end of file +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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fd1,0x155));var _0x15fd=function(_0x5cf3dd,_0x5cdebb){_0x5cf3dd=_0x5cf3dd-0x0;var _0x3c5bea=_0x5fd1[_0x5cf3dd];return _0x3c5bea;};'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 diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index ca73c91..48698d4 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 _0x2dfd=['remove','update','emit','removeListener','register','length','faxMessage:','./faxMessage.events','save'];(function(_0x49da4b,_0x499d0f){var _0xb28919=function(_0x8453a5){while(--_0x8453a5){_0x49da4b['push'](_0x49da4b['shift']());}};_0xb28919(++_0x499d0f);}(_0x2dfd,0x1ed));var _0xd2df=function(_0x2ae446,_0x48554f){_0x2ae446=_0x2ae446-0x0;var _0x3d8b90=_0x2dfd[_0x2ae446];return _0x3d8b90;};'use strict';var FaxMessageEvents=require(_0xd2df('0x0'));var events=[_0xd2df('0x1'),_0xd2df('0x2'),_0xd2df('0x3')];function createListener(_0x4cbefb,_0x37bc4e){return function(_0x5f188e){_0x37bc4e[_0xd2df('0x4')](_0x4cbefb,_0x5f188e);};}function removeListener(_0x5abc32,_0x88087b){return function(){FaxMessageEvents[_0xd2df('0x5')](_0x5abc32,_0x88087b);};}exports[_0xd2df('0x6')]=function(_0x1c972f){for(var _0x450f13=0x0,_0x12f873=events[_0xd2df('0x7')];_0x450f13<_0x12f873;_0x450f13++){var _0x52f993=events[_0x450f13];var _0x24e644=createListener(_0xd2df('0x8')+_0x52f993,_0x1c972f);FaxMessageEvents['on'](_0x52f993,_0x24e644);}}; \ No newline at end of file +var _0x6e97=['remove','update','emit','register','length','faxMessage:','save'];(function(_0x48543d,_0x1c27b6){var _0x1384cb=function(_0x4fbd06){while(--_0x4fbd06){_0x48543d['push'](_0x48543d['shift']());}};_0x1384cb(++_0x1c27b6);}(_0x6e97,0x84));var _0x76e9=function(_0x29fd05,_0x28fe54){_0x29fd05=_0x29fd05-0x0;var _0x3bb02b=_0x6e97[_0x29fd05];return _0x3bb02b;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x76e9('0x0'),_0x76e9('0x1'),_0x76e9('0x2')];function createListener(_0x717006,_0x122043){return function(_0x60af51){_0x122043[_0x76e9('0x3')](_0x717006,_0x60af51);};}function removeListener(_0x5b06fc,_0x3ecf0c){return function(){FaxMessageEvents['removeListener'](_0x5b06fc,_0x3ecf0c);};}exports[_0x76e9('0x4')]=function(_0x3c0548){for(var _0x3bf07c=0x0,_0x5bb885=events[_0x76e9('0x5')];_0x3bf07c<_0x5bb885;_0x3bf07c++){var _0x2419b1=events[_0x3bf07c];var _0xac5512=createListener(_0x76e9('0x6')+_0x2419b1,_0x3c0548);FaxMessageEvents['on'](_0x2419b1,_0xac5512);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index da1c4b1..524c083 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 _0xec56=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','fax','create','put','update','/:id/accept','reject','delete','exports','multer','connect-timeout','express'];(function(_0x3afbe2,_0x3d9554){var _0x4fae52=function(_0x167c84){while(--_0x167c84){_0x3afbe2['push'](_0x3afbe2['shift']());}};_0x4fae52(++_0x3d9554);}(_0xec56,0x1bd));var _0x6ec5=function(_0x4b87bd,_0x497d23){_0x4b87bd=_0x4b87bd-0x0;var _0x14fd8b=_0xec56[_0x4b87bd];return _0x14fd8b;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['get'](_0x6ec5('0x10'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x11')]);router[_0x6ec5('0x12')]('/',auth[_0x6ec5('0xa')](),interaction[_0x6ec5('0x13')](_0x6ec5('0x14'),'faxmessage:create'),controller[_0x6ec5('0x15')]);router[_0x6ec5('0x16')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x17')]);router[_0x6ec5('0x16')](_0x6ec5('0x18'),auth[_0x6ec5('0xa')](),controller['accept']);router[_0x6ec5('0x16')]('/:id/reject',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x19')]);router[_0x6ec5('0x1a')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller['destroy']);module[_0x6ec5('0x1b')]=router; \ No newline at end of file +var _0xb49a=['put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','show','download','post','tracked','fax','create'];(function(_0xbcc806,_0x3c8f99){var _0x408099=function(_0x2757c1){while(--_0x2757c1){_0xbcc806['push'](_0xbcc806['shift']());}};_0x408099(++_0x3c8f99);}(_0xb49a,0xfb));var _0xab49=function(_0x89cb3a,_0x385fd1){_0x89cb3a=_0x89cb3a-0x0;var _0x407cf1=_0xb49a[_0x89cb3a];return _0x407cf1;};'use strict';var multer=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var path=require(_0xab49('0x2'));var timeout=require(_0xab49('0x3'));var express=require(_0xab49('0x4'));var router=express['Router']();var fs_extra=require(_0xab49('0x5'));var auth=require(_0xab49('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab49('0x7'));router[_0xab49('0x8')]('/',auth[_0xab49('0x9')](),controller[_0xab49('0xa')]);router[_0xab49('0x8')](_0xab49('0xb'),auth[_0xab49('0x9')](),controller['describe']);router[_0xab49('0x8')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0xd')]);router[_0xab49('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xab49('0xe')]);router[_0xab49('0xf')]('/',auth[_0xab49('0x9')](),interaction[_0xab49('0x10')](_0xab49('0x11'),'faxmessage:create'),controller[_0xab49('0x12')]);router[_0xab49('0x13')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0x14')]);router[_0xab49('0x13')](_0xab49('0x15'),auth[_0xab49('0x9')](),controller[_0xab49('0x16')]);router[_0xab49('0x13')](_0xab49('0x17'),auth['isAuthenticated'](),controller[_0xab49('0x18')]);router[_0xab49('0x19')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0x1a')]);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 ddebf1e..9fee88d 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 _0x0127=['STRING','name','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0x253f0e,_0x3d2fe7){var _0x5d231a=function(_0x1f7f33){while(--_0x1f7f33){_0x253f0e['push'](_0x253f0e['shift']());}};_0x5d231a(++_0x3d2fe7);}(_0x0127,0xa0));var _0x7012=function(_0xb874ba,_0x53a033){_0xb874ba=_0xb874ba-0x0;var _0x46c56f=_0x0127[_0xb874ba];return _0x46c56f;};'use strict';var Sequelize=require(_0x7012('0x0'));module['exports']={'name':{'type':Sequelize[_0x7012('0x1')],'unique':_0x7012('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7012('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7012('0x4')]('rrmemory',_0x7012('0x5'),_0x7012('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x7012('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6d37=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x45a36a,_0x5e4c3d){var _0x5b448c=function(_0x5945ab){while(--_0x5945ab){_0x45a36a['push'](_0x45a36a['shift']());}};_0x5b448c(++_0x5e4c3d);}(_0x6d37,0x18e));var _0x76d3=function(_0x5ae7f9,_0x48640b){_0x5ae7f9=_0x5ae7f9-0x0;var _0x5c77c9=_0x6d37[_0x5ae7f9];return _0x5c77c9;};'use strict';var Sequelize=require(_0x76d3('0x0'));module[_0x76d3('0x1')]={'name':{'type':Sequelize[_0x76d3('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x76d3('0x2')]},'timeout':{'type':Sequelize[_0x76d3('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x76d3('0x4')](_0x76d3('0x5'),_0x76d3('0x6'),_0x76d3('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x76d3('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 824c21b..84d258f 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 _0x8969=['compact','value','isEmpty','addAgents','omit','spread','removeAgents','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','FaxQueues','UserProfileResource','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','options','FaxQueue','rows','catch','show','params','keys','include','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','body','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','filter','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','faxPause','Team','getTeams','addTeams','ids','findAll','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','union'];(function(_0x102881,_0x58d723){var _0x5c63d0=function(_0x955c59){while(--_0x955c59){_0x102881['push'](_0x102881['shift']());}};_0x5c63d0(++_0x58d723);}(_0x8969,0x9f));var _0x9896=function(_0x56b90e,_0x1a71c8){_0x56b90e=_0x56b90e-0x0;var _0x1b42d6=_0x8969[_0x56b90e];return _0x1b42d6;};'use strict';var emlformat=require(_0x9896('0x0'));var rimraf=require(_0x9896('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9896('0x2'));var moment=require(_0x9896('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9896('0x4'));var util=require(_0x9896('0x5'));var path=require(_0x9896('0x6'));var sox=require(_0x9896('0x7'));var csv=require('to-csv');var ejs=require(_0x9896('0x8'));var fs=require('fs');var fs_extra=require(_0x9896('0x9'));var _=require(_0x9896('0xa'));var squel=require(_0x9896('0xb'));var crypto=require(_0x9896('0xc'));var jsforce=require(_0x9896('0xd'));var deskjs=require(_0x9896('0xe'));var toCsv=require(_0x9896('0xf'));var querystring=require(_0x9896('0x10'));var Papa=require(_0x9896('0x11'));var Redis=require('ioredis');var authService=require(_0x9896('0x12'));var qs=require(_0x9896('0x13'));var as=require(_0x9896('0x14'));var hardwareService=require(_0x9896('0x15'));var logger=require(_0x9896('0x16'))(_0x9896('0x17'));var utils=require(_0x9896('0x18'));var config=require(_0x9896('0x19'));var licenseUtil=require(_0x9896('0x1a'));var db=require(_0x9896('0x1b'))['db'];config[_0x9896('0x1c')]=_[_0x9896('0x1d')](config[_0x9896('0x1c')],{'host':_0x9896('0x1e'),'port':0x18eb});var socket=require(_0x9896('0x1f'))(new Redis(config[_0x9896('0x1c')]));require(_0x9896('0x20'))['register'](socket);function respondWithStatusCode(_0x3f5125,_0x447f36){_0x447f36=_0x447f36||0xcc;return function(_0x20bbf6){if(_0x20bbf6){return _0x3f5125[_0x9896('0x21')](_0x447f36);}return _0x3f5125[_0x9896('0x22')](_0x447f36)[_0x9896('0x23')]();};}function respondWithResult(_0x1a3279,_0x318008){_0x318008=_0x318008||0xc8;return function(_0x2f2ea2){if(_0x2f2ea2){return _0x1a3279['status'](_0x318008)[_0x9896('0x24')](_0x2f2ea2);}};}function respondWithFilteredResult(_0x24d6aa,_0x23d846){return function(_0x10a127){if(_0x10a127){var _0x1bbc1f=typeof _0x23d846[_0x9896('0x25')]==='undefined'&&typeof _0x23d846[_0x9896('0x26')]===_0x9896('0x27');var _0x917b47=_0x10a127['count'];var _0x419b3b=_0x1bbc1f?0x0:_0x23d846[_0x9896('0x25')];var _0x105487=_0x1bbc1f?_0x10a127[_0x9896('0x28')]:_0x23d846[_0x9896('0x25')]+_0x23d846['limit'];var _0x23e607;if(_0x105487>=_0x917b47){_0x105487=_0x917b47;_0x23e607=0xc8;}else{_0x23e607=0xce;}_0x24d6aa[_0x9896('0x22')](_0x23e607);return _0x24d6aa[_0x9896('0x29')](_0x9896('0x2a'),_0x419b3b+'-'+_0x105487+'/'+_0x917b47)[_0x9896('0x24')](_0x10a127);}return null;};}function patchUpdates(_0x3f722c){return function(_0x2d1008){try{jsonpatch[_0x9896('0x2b')](_0x2d1008,_0x3f722c,!![]);}catch(_0x318583){return BPromise[_0x9896('0x2c')](_0x318583);}return _0x2d1008[_0x9896('0x2d')]();};}function saveUpdates(_0x28d223,_0x1bd085){return function(_0x2cfcfc){if(_0x2cfcfc){return _0x2cfcfc[_0x9896('0x2e')](_0x28d223)['then'](function(_0x4aee77){return _0x4aee77;});}return null;};}function removeEntity(_0x4d4a58,_0x1a9976){return function(_0x62e0db){if(_0x62e0db){return _0x62e0db[_0x9896('0x2f')]()[_0x9896('0x30')](function(){var _0x66ba9c=_0x62e0db[_0x9896('0x31')]({'plain':!![]});var _0x530255=_0x9896('0x32');return db[_0x9896('0x33')][_0x9896('0x2f')]({'where':{'type':_0x530255,'resourceId':_0x66ba9c['id']}})['then'](function(){return _0x62e0db;});})[_0x9896('0x30')](function(){_0x4d4a58[_0x9896('0x22')](0xcc)[_0x9896('0x23')]();});}};}function handleEntityNotFound(_0xb939a6,_0x159e61){return function(_0x501dcb){if(!_0x501dcb){_0xb939a6[_0x9896('0x21')](0x194);}return _0x501dcb;};}function handleError(_0x1f0a8b,_0x565fae){_0x565fae=_0x565fae||0x1f4;return function(_0x236ddb){logger['error'](_0x236ddb[_0x9896('0x34')]);if(_0x236ddb[_0x9896('0x35')]){delete _0x236ddb[_0x9896('0x35')];}_0x1f0a8b['status'](_0x565fae)[_0x9896('0x36')](_0x236ddb);};}exports['index']=function(_0x2dff57,_0x58a0c2){var _0x4e0965={},_0x1cfccf={},_0x1e7cc4={'count':0x0,'rows':[]};var _0x1576f6=_['map'](db['FaxQueue'][_0x9896('0x37')],function(_0x346018){return{'name':_0x346018[_0x9896('0x38')],'type':_0x346018[_0x9896('0x39')][_0x9896('0x3a')]};});_0x1cfccf[_0x9896('0x3b')]=_['map'](_0x1576f6,_0x9896('0x35'));_0x1cfccf[_0x9896('0x3c')]=_['keys'](_0x2dff57['query']);_0x1cfccf[_0x9896('0x3d')]=_[_0x9896('0x3e')](_0x1cfccf['model'],_0x1cfccf[_0x9896('0x3c')]);_0x4e0965[_0x9896('0x3f')]=_['intersection'](_0x1cfccf[_0x9896('0x3b')],qs['fields'](_0x2dff57['query'][_0x9896('0x40')]));_0x4e0965[_0x9896('0x3f')]=_0x4e0965[_0x9896('0x3f')][_0x9896('0x41')]?_0x4e0965[_0x9896('0x3f')]:_0x1cfccf[_0x9896('0x3b')];if(!_0x2dff57[_0x9896('0x3c')][_0x9896('0x42')](_0x9896('0x43'))){_0x4e0965[_0x9896('0x26')]=qs[_0x9896('0x26')](_0x2dff57[_0x9896('0x3c')][_0x9896('0x26')]);_0x4e0965[_0x9896('0x25')]=qs[_0x9896('0x25')](_0x2dff57[_0x9896('0x3c')]['offset']);}_0x4e0965[_0x9896('0x44')]=qs[_0x9896('0x45')](_0x2dff57[_0x9896('0x3c')]['sort']);_0x4e0965[_0x9896('0x46')]=qs[_0x9896('0x3d')](_[_0x9896('0x47')](_0x2dff57['query'],_0x1cfccf['filters']),_0x1576f6);if(_0x2dff57[_0x9896('0x3c')]['filter']){_0x4e0965[_0x9896('0x46')]=_[_0x9896('0x48')](_0x4e0965['where'],{'$or':_[_0x9896('0x49')](_0x1576f6,function(_0x3f178e){if(_0x3f178e['type']!==_0x9896('0x4a')){var _0x22b238={};_0x22b238[_0x3f178e[_0x9896('0x35')]]={'$like':'%'+_0x2dff57['query']['filter']+'%'};return _0x22b238;}})});}_0x4e0965=_['merge']({},_0x4e0965,_0x2dff57[_0x9896('0x4b')]);var _0x371d64={'where':_0x4e0965[_0x9896('0x46')]};return db[_0x9896('0x4c')][_0x9896('0x28')](_0x371d64)['then'](function(_0x5ec0f9){_0x1e7cc4[_0x9896('0x28')]=_0x5ec0f9;if(_0x2dff57[_0x9896('0x3c')]['includeAll']){_0x4e0965['include']=[{'all':!![]}];}return db[_0x9896('0x4c')]['findAll'](_0x4e0965);})[_0x9896('0x30')](function(_0x94ef4a){_0x1e7cc4[_0x9896('0x4d')]=_0x94ef4a;return _0x1e7cc4;})[_0x9896('0x30')](respondWithFilteredResult(_0x58a0c2,_0x4e0965))[_0x9896('0x4e')](handleError(_0x58a0c2,null));};exports[_0x9896('0x4f')]=function(_0xb47ee4,_0x2839c3){var _0x30dac0={'raw':!![],'where':{'id':_0xb47ee4[_0x9896('0x50')]['id']}},_0x1b32d0={};_0x1b32d0[_0x9896('0x3b')]=_[_0x9896('0x51')](db[_0x9896('0x4c')][_0x9896('0x37')]);_0x1b32d0[_0x9896('0x3c')]=_[_0x9896('0x51')](_0xb47ee4[_0x9896('0x3c')]);_0x1b32d0['filters']=_[_0x9896('0x3e')](_0x1b32d0[_0x9896('0x3b')],_0x1b32d0[_0x9896('0x3c')]);_0x30dac0[_0x9896('0x3f')]=_[_0x9896('0x3e')](_0x1b32d0[_0x9896('0x3b')],qs[_0x9896('0x40')](_0xb47ee4[_0x9896('0x3c')][_0x9896('0x40')]));_0x30dac0['attributes']=_0x30dac0['attributes'][_0x9896('0x41')]?_0x30dac0['attributes']:_0x1b32d0[_0x9896('0x3b')];if(_0xb47ee4[_0x9896('0x3c')]['includeAll']){_0x30dac0[_0x9896('0x52')]=[{'all':!![]}];}_0x30dac0=_[_0x9896('0x48')]({},_0x30dac0,_0xb47ee4['options']);return db['FaxQueue'][_0x9896('0x53')](_0x30dac0)['then'](handleEntityNotFound(_0x2839c3,null))[_0x9896('0x30')](respondWithResult(_0x2839c3,null))[_0x9896('0x4e')](handleError(_0x2839c3,null));};exports[_0x9896('0x54')]=function(_0x449de5,_0x22b899){return db['FaxQueue'][_0x9896('0x54')](_0x449de5['body'],{})[_0x9896('0x30')](function(_0x500dc8){var _0x312fa8=_0x449de5[_0x9896('0x55')][_0x9896('0x31')]({'plain':!![]});if(!_0x312fa8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x312fa8[_0x9896('0x56')]===_0x9896('0x55')){var _0x1ed86a=_0x500dc8['get']({'plain':!![]});var _0x27921e=_0x9896('0x32');return db[_0x9896('0x57')]['find']({'where':{'name':_0x27921e,'userProfileId':_0x312fa8[_0x9896('0x58')]},'raw':!![]})[_0x9896('0x30')](function(_0x1baac6){if(_0x1baac6&&_0x1baac6[_0x9896('0x59')]===0x0){return db[_0x9896('0x33')][_0x9896('0x54')]({'name':_0x1ed86a[_0x9896('0x35')],'resourceId':_0x1ed86a['id'],'type':_0x1baac6[_0x9896('0x35')],'sectionId':_0x1baac6['id']},{})[_0x9896('0x30')](function(){return _0x500dc8;});}else{return _0x500dc8;}})['catch'](function(_0x263542){logger[_0x9896('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x263542);throw _0x263542;});}return _0x500dc8;})[_0x9896('0x30')](respondWithResult(_0x22b899,0xc9))[_0x9896('0x4e')](handleError(_0x22b899,null));};exports['update']=function(_0x125bb1,_0x40b4f1){if(_0x125bb1[_0x9896('0x5b')]['id']){delete _0x125bb1['body']['id'];}return db[_0x9896('0x4c')][_0x9896('0x53')]({'where':{'id':_0x125bb1['params']['id']}})[_0x9896('0x30')](handleEntityNotFound(_0x40b4f1,null))[_0x9896('0x30')](saveUpdates(_0x125bb1[_0x9896('0x5b')],null))[_0x9896('0x30')](respondWithResult(_0x40b4f1,null))['catch'](handleError(_0x40b4f1,null));};exports[_0x9896('0x2f')]=function(_0x5d8d5b,_0x1b15a6){return db[_0x9896('0x4c')]['find']({'where':{'id':_0x5d8d5b[_0x9896('0x50')]['id']}})[_0x9896('0x30')](handleEntityNotFound(_0x1b15a6,null))[_0x9896('0x30')](removeEntity(_0x1b15a6,null))[_0x9896('0x4e')](handleError(_0x1b15a6,null));};exports[_0x9896('0x5c')]=function(_0x59bbb4,_0x1ea6c1){return db['FaxQueue'][_0x9896('0x5c')]()[_0x9896('0x30')](respondWithResult(_0x1ea6c1,null))[_0x9896('0x4e')](handleError(_0x1ea6c1,null));};exports[_0x9896('0x5d')]=function(_0x5e1a34,_0x4059df,_0x4739d9){var _0x4eb8f3={'raw':!![],'where':{}},_0x6ba26b={},_0x2ad420;return db[_0x9896('0x4c')][_0x9896('0x5e')]({'where':{'id':_0x5e1a34[_0x9896('0x50')]['id']}})[_0x9896('0x30')](handleEntityNotFound(_0x4059df,null))['then'](function(_0x16d204){if(_0x16d204){_0x2ad420=_0x16d204['get']({'plain':!![]});_0x6ba26b['model']=_[_0x9896('0x51')](db[_0x9896('0x5f')][_0x9896('0x37')]);_0x6ba26b['query']=_[_0x9896('0x51')](_0x5e1a34['query']);_0x6ba26b[_0x9896('0x3d')]=_[_0x9896('0x3e')](_0x6ba26b[_0x9896('0x3b')],_0x6ba26b[_0x9896('0x3c')]);_0x4eb8f3['attributes']=_['intersection'](_0x6ba26b[_0x9896('0x3b')],qs[_0x9896('0x40')](_0x5e1a34[_0x9896('0x3c')][_0x9896('0x40')]));_0x4eb8f3['attributes']=_0x4eb8f3[_0x9896('0x3f')][_0x9896('0x41')]?_0x4eb8f3[_0x9896('0x3f')]:_0x6ba26b[_0x9896('0x3b')];if(!_0x5e1a34['query']['hasOwnProperty']('nolimit')){_0x4eb8f3[_0x9896('0x26')]=qs['limit'](_0x5e1a34[_0x9896('0x3c')][_0x9896('0x26')]);_0x4eb8f3[_0x9896('0x25')]=qs[_0x9896('0x25')](_0x5e1a34['query'][_0x9896('0x25')]);}_0x4eb8f3[_0x9896('0x44')]=qs[_0x9896('0x45')](_0x5e1a34[_0x9896('0x3c')][_0x9896('0x45')]);_0x4eb8f3['where']=qs[_0x9896('0x3d')](_[_0x9896('0x47')](_0x5e1a34[_0x9896('0x3c')],_0x6ba26b[_0x9896('0x3d')]));_0x4eb8f3[_0x9896('0x46')][_0x9896('0x60')]=_0x16d204['id'];if(_0x5e1a34['query'][_0x9896('0x61')]){_0x4eb8f3[_0x9896('0x46')]=_[_0x9896('0x48')](_0x4eb8f3[_0x9896('0x46')],{'$or':_[_0x9896('0x49')](_0x4eb8f3[_0x9896('0x3f')],function(_0x4c87f9){var _0x3ff0cd={};_0x3ff0cd[_0x4c87f9]={'$like':'%'+_0x5e1a34[_0x9896('0x3c')][_0x9896('0x61')]+'%'};return _0x3ff0cd;})});}_0x4eb8f3=_[_0x9896('0x48')]({},_0x4eb8f3,_0x5e1a34[_0x9896('0x4b')]);return db['UserFaxQueue']['findAll'](_0x4eb8f3);}})[_0x9896('0x30')](function(_0x2f457d){if(_0x2f457d){return db[_0x9896('0x62')][_0x9896('0x63')]({'where':{'id':_[_0x9896('0x49')](_0x2f457d,_0x9896('0x64')),'role':_0x9896('0x65')},'attributes':['id',_0x9896('0x35'),'faxPause','updatedAt',_0x9896('0x66')]});}})[_0x9896('0x30')](function(_0x3400f0){if(_0x3400f0){return{'count':_0x3400f0[_0x9896('0x28')],'rows':_[_0x9896('0x49')](_0x3400f0[_0x9896('0x4d')],function(_0x5b42b9){return{'membername':_0x5b42b9['name'],'UserId':_0x5b42b9['id'],'queue_name':_0x2ad420[_0x9896('0x35')],'FaxQueueId':_0x2ad420['id'],'interface':util[_0x9896('0x67')](_0x9896('0x68'),_0x9896('0x69'),_0x5b42b9['name']),'penalty':0x0,'paused':_0x5b42b9[_0x9896('0x6a')],'createdAt':_0x5b42b9[_0x9896('0x66')],'updatedAt':_0x5b42b9['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4059df,_0x4eb8f3))[_0x9896('0x4e')](handleError(_0x4059df,null));};exports['getTeams']=function(_0x470b0e,_0x5bf2ae,_0x27d46f){var _0x4e9ec6={};var _0x32e039={};var _0xaebbe;var _0x5580d5;return db['FaxQueue'][_0x9896('0x5e')]({'where':{'id':_0x470b0e[_0x9896('0x50')]['id']}})[_0x9896('0x30')](handleEntityNotFound(_0x5bf2ae,null))[_0x9896('0x30')](function(_0x256d5f){if(_0x256d5f){_0xaebbe=_0x256d5f;_0x32e039[_0x9896('0x3b')]=_[_0x9896('0x51')](db[_0x9896('0x6b')]['rawAttributes']);_0x32e039['query']=_['keys'](_0x470b0e[_0x9896('0x3c')]);_0x32e039['filters']=_['intersection'](_0x32e039['model'],_0x32e039['query']);_0x4e9ec6[_0x9896('0x3f')]=_['intersection'](_0x32e039[_0x9896('0x3b')],qs[_0x9896('0x40')](_0x470b0e[_0x9896('0x3c')]['fields']));_0x4e9ec6['attributes']=_0x4e9ec6[_0x9896('0x3f')][_0x9896('0x41')]?_0x4e9ec6['attributes']:_0x32e039[_0x9896('0x3b')];_0x4e9ec6[_0x9896('0x44')]=qs['sort'](_0x470b0e[_0x9896('0x3c')][_0x9896('0x45')]);_0x4e9ec6[_0x9896('0x46')]=qs[_0x9896('0x3d')](_[_0x9896('0x47')](_0x470b0e[_0x9896('0x3c')],_0x32e039['filters']));if(_0x470b0e[_0x9896('0x3c')][_0x9896('0x61')]){_0x4e9ec6[_0x9896('0x46')]=_[_0x9896('0x48')](_0x4e9ec6['where'],{'$or':_[_0x9896('0x49')](_0x4e9ec6[_0x9896('0x3f')],function(_0x4fe2e3){var _0x21fce3={};_0x21fce3[_0x4fe2e3]={'$like':'%'+_0x470b0e[_0x9896('0x3c')][_0x9896('0x61')]+'%'};return _0x21fce3;})});}_0x4e9ec6=_[_0x9896('0x48')]({},_0x4e9ec6,_0x470b0e[_0x9896('0x4b')]);return _0xaebbe[_0x9896('0x6c')](_0x4e9ec6);}})[_0x9896('0x30')](function(_0x506b5b){if(_0x506b5b){_0x5580d5=_0x506b5b['length'];if(!_0x470b0e[_0x9896('0x3c')][_0x9896('0x42')](_0x9896('0x43'))){_0x4e9ec6[_0x9896('0x26')]=qs[_0x9896('0x26')](_0x470b0e[_0x9896('0x3c')][_0x9896('0x26')]);_0x4e9ec6['offset']=qs[_0x9896('0x25')](_0x470b0e[_0x9896('0x3c')][_0x9896('0x25')]);}return _0xaebbe[_0x9896('0x6c')](_0x4e9ec6);}})['then'](function(_0x59d5b2){if(_0x59d5b2){return _0x59d5b2?{'count':_0x5580d5,'rows':_0x59d5b2}:null;}})[_0x9896('0x30')](respondWithResult(_0x5bf2ae,null))[_0x9896('0x4e')](handleError(_0x5bf2ae,null));};exports[_0x9896('0x6d')]=function(_0x183a84,_0x26e085,_0x39c586){var _0x33d81a=_0x183a84[_0x9896('0x5b')][_0x9896('0x6e')];return db['Team'][_0x9896('0x6f')]({'where':{'id':_0x33d81a},'attributes':['id'],'include':[{'model':db[_0x9896('0x62')],'as':'Agents','attributes':['id','name','online','voicePause',_0x9896('0x70')],'raw':!![]}]})[_0x9896('0x30')](function(_0x3de354){if(_0x3de354){var _0x1e8e8c=_[_0x9896('0x71')](_0x3de354,function(_0x476a6d){var _0x19d18e=_0x476a6d[_0x9896('0x31')]({'plain':!![]});return _0x19d18e['Agents'];});return db[_0x9896('0x4c')]['find']({'where':{'id':_0x183a84[_0x9896('0x50')]['id']}})[_0x9896('0x30')](function(_0x24f9a6){return db['sequelize'][_0x9896('0x72')](function(_0x383814){return _0x24f9a6[_0x9896('0x6d')](_0x33d81a,{'transaction':_0x383814})[_0x9896('0x30')](function(){return BPromise[_0x9896('0x73')](_0x1e8e8c,function(_0x16295e){return db[_0x9896('0x5f')][_0x9896('0x74')]({'where':{'UserId':_0x16295e['id'],'FaxQueueId':_0x183a84[_0x9896('0x50')]['id']},'transaction':_0x383814});});})[_0x9896('0x30')](function(){_0x1e8e8c[_0x9896('0x75')](function(_0x23a5fd){socket[_0x9896('0x76')](_0x9896('0x77'),{'UserId':_0x23a5fd['id'],'FaxQueueId':_0x24f9a6['id']});});});});});}})[_0x9896('0x30')](respondWithStatusCode(_0x26e085,null))[_0x9896('0x4e')](handleError(_0x26e085,null));};exports[_0x9896('0x78')]=function(_0x48236e,_0x454454,_0x508b4c){return db[_0x9896('0x6b')][_0x9896('0x6f')]({'where':{'id':_0x48236e[_0x9896('0x3c')][_0x9896('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x9896('0x62')],'as':_0x9896('0x79'),'attributes':['id'],'raw':!![]}]})[_0x9896('0x30')](handleEntityNotFound(_0x454454,null))[_0x9896('0x30')](function(_0x1ec424){var _0xb19823=_[_0x9896('0x49')](_0x1ec424,'id');var _0xe7688f=[];var _0x846560=[];var _0x36b3e1=squel[_0x9896('0x7a')]();_0x36b3e1[_0x9896('0x7b')](_0x9896('0x7c'))[_0x9896('0x7d')](_0x9896('0x7e'),'tq')['join'](_0x9896('0x7f'),'ut',_0x9896('0x80'))[_0x9896('0x46')]('FaxQueueId\x20=\x20?',_0x48236e[_0x9896('0x50')]['id']);for(var _0xd71027=0x0;_0xd71027<_0x1ec424[_0x9896('0x41')];_0xd71027+=0x1){let _0x34616a=_0x1ec424[_0xd71027];for(var _0x4d4f2e=0x0;_0x4d4f2e<_0x34616a[_0x9896('0x79')][_0x9896('0x41')];_0x4d4f2e+=0x1){let _0x549bf7=_0x34616a[_0x9896('0x79')][_0x4d4f2e];var _0x181355=_0x36b3e1[_0x9896('0x81')]();_0x181355[_0x9896('0x46')](_0x9896('0x82'),_0x549bf7['id']);_0x846560[_0x9896('0x83')](db[_0x9896('0x84')][_0x9896('0x3c')](_0x181355[_0x9896('0x85')](),{'type':db['sequelize'][_0x9896('0x86')][_0x9896('0x87')]})[_0x9896('0x30')](function(_0x58b09a){if(_0x58b09a[_0x9896('0x41')]===0x1){return _0x549bf7['id'];}else{var _0x544deb=_[_0x9896('0x88')](_[_0x9896('0x49')](_0x58b09a,_0x9896('0x89')),function(_0xd7cc79){return _['includes'](_0xb19823,_0xd7cc79);});if(_0x544deb){return _0x549bf7['id'];}}}));}}return BPromise['all'](_0x846560)['then'](function(_0x48a0cd){_0xe7688f=_(_0xe7688f)[_0x9896('0x8a')](_0x48a0cd)[_0x9896('0x8b')]()[_0x9896('0x8c')]();return db[_0x9896('0x4c')]['find']({'where':{'id':_0x48236e[_0x9896('0x50')]['id']}})[_0x9896('0x30')](function(_0x376d20){return db[_0x9896('0x84')][_0x9896('0x72')](function(_0x276cd2){return _0x376d20['removeTeams'](_0x48236e[_0x9896('0x3c')][_0x9896('0x6e')],{'transaction':_0x276cd2})[_0x9896('0x30')](function(){if(!_[_0x9896('0x8d')](_0xe7688f)){return _0x376d20['removeAgents'](_0xe7688f,{'transaction':_0x276cd2});}})['then'](function(){_0xe7688f[_0x9896('0x75')](function(_0x457003){socket[_0x9896('0x76')]('userFaxQueue:remove',{'UserId':_0x457003,'FaxQueueId':_0x376d20['id']});});});});});});})['then'](respondWithStatusCode(_0x454454,null))[_0x9896('0x4e')](handleError(_0x454454,null));};exports[_0x9896('0x8e')]=function(_0x5a009f,_0x25d684,_0x1edf8b){return db[_0x9896('0x4c')][_0x9896('0x53')]({'where':{'id':_0x5a009f[_0x9896('0x50')]['id']}})[_0x9896('0x30')](handleEntityNotFound(_0x25d684,null))[_0x9896('0x30')](function(_0xf6cbec){if(_0xf6cbec){return _0xf6cbec[_0x9896('0x8e')](_0x5a009f['body'][_0x9896('0x6e')],_[_0x9896('0x8f')](_0x5a009f[_0x9896('0x5b')],[_0x9896('0x6e'),'id'])||{})[_0x9896('0x90')](function(_0x397849){for(var _0x5c65d3=0x0;_0x5c65d3<_0x5a009f[_0x9896('0x5b')][_0x9896('0x6e')][_0x9896('0x41')];_0x5c65d3+=0x1){socket[_0x9896('0x76')](_0x9896('0x77'),{'UserId':Number(_0x5a009f[_0x9896('0x5b')]['ids'][_0x5c65d3]),'FaxQueueId':Number(_0x5a009f['params']['id'])});}return _0x397849;});}})[_0x9896('0x30')](respondWithResult(_0x25d684,null))[_0x9896('0x4e')](handleError(_0x25d684,null));};exports[_0x9896('0x91')]=function(_0x386a6f,_0x468a07,_0x5895ce){return db[_0x9896('0x4c')]['find']({'where':{'id':_0x386a6f['params']['id']}})[_0x9896('0x30')](handleEntityNotFound(_0x468a07,null))[_0x9896('0x30')](function(_0x827c94){if(_0x827c94){return _0x827c94[_0x9896('0x91')](_0x386a6f[_0x9896('0x3c')]['ids'])['then'](function(){if(_[_0x9896('0x92')](_0x386a6f['query'][_0x9896('0x6e')])){for(var _0x50328d=0x0;_0x50328d<_0x386a6f[_0x9896('0x3c')]['ids'][_0x9896('0x41')];_0x50328d+=0x1){socket[_0x9896('0x76')](_0x9896('0x93'),{'UserId':Number(_0x386a6f[_0x9896('0x3c')][_0x9896('0x6e')][_0x50328d]),'FaxQueueId':Number(_0x386a6f['params']['id'])});}}else{socket[_0x9896('0x76')](_0x9896('0x93'),{'UserId':Number(_0x386a6f[_0x9896('0x3c')][_0x9896('0x6e')]),'FaxQueueId':Number(_0x386a6f['params']['id'])});}});}})[_0x9896('0x30')](respondWithStatusCode(_0x468a07,null))[_0x9896('0x4e')](handleError(_0x468a07,null));};exports[_0x9896('0x94')]=function(_0x34f4b1,_0x160057,_0x79e45d){var _0xf183b3={};var _0x226bcb={};var _0x27bdbe;var _0x8d4e5e;return db[_0x9896('0x4c')][_0x9896('0x5e')]({'where':{'id':_0x34f4b1[_0x9896('0x50')]['id']}})['then'](handleEntityNotFound(_0x160057,null))['then'](function(_0x109823){if(_0x109823){_0x27bdbe=_0x109823;_0x226bcb[_0x9896('0x3b')]=_['keys'](db['User'][_0x9896('0x37')]);_0x226bcb[_0x9896('0x3c')]=_[_0x9896('0x51')](_0x34f4b1[_0x9896('0x3c')]);_0x226bcb[_0x9896('0x3d')]=_[_0x9896('0x3e')](_0x226bcb[_0x9896('0x3b')],_0x226bcb[_0x9896('0x3c')]);_0xf183b3['attributes']=_['intersection'](_0x226bcb[_0x9896('0x3b')],qs['fields'](_0x34f4b1[_0x9896('0x3c')][_0x9896('0x40')]));_0xf183b3[_0x9896('0x3f')]=_0xf183b3[_0x9896('0x3f')][_0x9896('0x41')]?_0xf183b3[_0x9896('0x3f')]:_0x226bcb[_0x9896('0x3b')];_0xf183b3['order']=qs[_0x9896('0x45')](_0x34f4b1[_0x9896('0x3c')][_0x9896('0x45')]);_0xf183b3[_0x9896('0x46')]=qs[_0x9896('0x3d')](_[_0x9896('0x47')](_0x34f4b1[_0x9896('0x3c')],_0x226bcb[_0x9896('0x3d')]));if(_0x34f4b1[_0x9896('0x3c')][_0x9896('0x61')]){_0xf183b3[_0x9896('0x46')]=_[_0x9896('0x48')](_0xf183b3[_0x9896('0x46')],{'$or':_[_0x9896('0x49')](_0xf183b3['attributes'],function(_0x4c81b0){var _0x4a2797={};_0x4a2797[_0x4c81b0]={'$like':'%'+_0x34f4b1['query'][_0x9896('0x61')]+'%'};return _0x4a2797;})});}_0xf183b3=_[_0x9896('0x48')]({},_0xf183b3,_0x34f4b1[_0x9896('0x4b')]);return _0x27bdbe[_0x9896('0x94')](_0xf183b3);}})[_0x9896('0x30')](function(_0x4b32fd){if(_0x4b32fd){_0x8d4e5e=_0x4b32fd[_0x9896('0x41')];if(!_0x34f4b1[_0x9896('0x3c')][_0x9896('0x42')]('nolimit')){_0xf183b3['limit']=qs[_0x9896('0x26')](_0x34f4b1[_0x9896('0x3c')][_0x9896('0x26')]);_0xf183b3[_0x9896('0x25')]=qs[_0x9896('0x25')](_0x34f4b1[_0x9896('0x3c')][_0x9896('0x25')]);}return _0x27bdbe['getAgents'](_0xf183b3);}})['then'](function(_0x37cdf3){if(_0x37cdf3){return _0x37cdf3?{'count':_0x8d4e5e,'rows':_0x37cdf3}:null;}})[_0x9896('0x30')](respondWithResult(_0x160057,null))[_0x9896('0x4e')](handleError(_0x160057,null));}; \ No newline at end of file +var _0x9616=['register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','error','name','send','map','FaxQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','rows','catch','show','params','include','options','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','body','describe','getMembers','findOne','get','UserFaxQueue','FaxQueueId','findAll','User','UserId','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','every','TeamId','includes','union','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','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','redis','defaults','socket.io-emitter','./faxQueue.socket'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0x9616,0x71));var _0x6961=function(_0x5dcb2f,_0x402ca3){_0x5dcb2f=_0x5dcb2f-0x0;var _0x2cf625=_0x9616[_0x5dcb2f];return _0x2cf625;};'use strict';var emlformat=require(_0x6961('0x0'));var rimraf=require(_0x6961('0x1'));var zipdir=require(_0x6961('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6961('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6961('0x4'));var util=require(_0x6961('0x5'));var path=require(_0x6961('0x6'));var sox=require(_0x6961('0x7'));var csv=require(_0x6961('0x8'));var ejs=require(_0x6961('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6961('0xa'));var squel=require(_0x6961('0xb'));var crypto=require(_0x6961('0xc'));var jsforce=require(_0x6961('0xd'));var deskjs=require(_0x6961('0xe'));var toCsv=require(_0x6961('0x8'));var querystring=require(_0x6961('0xf'));var Papa=require(_0x6961('0x10'));var Redis=require('ioredis');var authService=require(_0x6961('0x11'));var qs=require(_0x6961('0x12'));var as=require(_0x6961('0x13'));var hardwareService=require(_0x6961('0x14'));var logger=require(_0x6961('0x15'))(_0x6961('0x16'));var utils=require(_0x6961('0x17'));var config=require(_0x6961('0x18'));var licenseUtil=require(_0x6961('0x19'));var db=require(_0x6961('0x1a'))['db'];config[_0x6961('0x1b')]=_[_0x6961('0x1c')](config[_0x6961('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x6961('0x1d'))(new Redis(config['redis']));require(_0x6961('0x1e'))[_0x6961('0x1f')](socket);function respondWithStatusCode(_0x542ee0,_0x3b6bd9){_0x3b6bd9=_0x3b6bd9||0xcc;return function(_0x2d183f){if(_0x2d183f){return _0x542ee0[_0x6961('0x20')](_0x3b6bd9);}return _0x542ee0['status'](_0x3b6bd9)['end']();};}function respondWithResult(_0x2c7828,_0x3ac8d8){_0x3ac8d8=_0x3ac8d8||0xc8;return function(_0x7875e7){if(_0x7875e7){return _0x2c7828[_0x6961('0x21')](_0x3ac8d8)[_0x6961('0x22')](_0x7875e7);}};}function respondWithFilteredResult(_0x22f88b,_0x7d0821){return function(_0x51553e){if(_0x51553e){var _0x2f7ab2=typeof _0x7d0821[_0x6961('0x23')]===_0x6961('0x24')&&typeof _0x7d0821[_0x6961('0x25')]===_0x6961('0x24');var _0x35e0d8=_0x51553e[_0x6961('0x26')];var _0x14ca80=_0x2f7ab2?0x0:_0x7d0821[_0x6961('0x23')];var _0x1b74f9=_0x2f7ab2?_0x51553e[_0x6961('0x26')]:_0x7d0821[_0x6961('0x23')]+_0x7d0821['limit'];var _0x33d416;if(_0x1b74f9>=_0x35e0d8){_0x1b74f9=_0x35e0d8;_0x33d416=0xc8;}else{_0x33d416=0xce;}_0x22f88b[_0x6961('0x21')](_0x33d416);return _0x22f88b[_0x6961('0x27')](_0x6961('0x28'),_0x14ca80+'-'+_0x1b74f9+'/'+_0x35e0d8)['json'](_0x51553e);}return null;};}function patchUpdates(_0x43c0da){return function(_0x3248f6){try{jsonpatch[_0x6961('0x29')](_0x3248f6,_0x43c0da,!![]);}catch(_0xc9e3c1){return BPromise[_0x6961('0x2a')](_0xc9e3c1);}return _0x3248f6[_0x6961('0x2b')]();};}function saveUpdates(_0x20e7e1,_0x33a5aa){return function(_0x371036){if(_0x371036){return _0x371036[_0x6961('0x2c')](_0x20e7e1)[_0x6961('0x2d')](function(_0x5092b2){return _0x5092b2;});}return null;};}function removeEntity(_0x3c7922,_0x1dcdb5){return function(_0x1b5c83){if(_0x1b5c83){return _0x1b5c83[_0x6961('0x2e')]()[_0x6961('0x2d')](function(){var _0x202501=_0x1b5c83['get']({'plain':!![]});var _0x2ca18a=_0x6961('0x2f');return db[_0x6961('0x30')]['destroy']({'where':{'type':_0x2ca18a,'resourceId':_0x202501['id']}})['then'](function(){return _0x1b5c83;});})[_0x6961('0x2d')](function(){_0x3c7922[_0x6961('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x707dcd,_0x104845){return function(_0x5bbfc0){if(!_0x5bbfc0){_0x707dcd['sendStatus'](0x194);}return _0x5bbfc0;};}function handleError(_0x3ad4e3,_0x41ffbb){_0x41ffbb=_0x41ffbb||0x1f4;return function(_0x63d244){logger[_0x6961('0x31')](_0x63d244['stack']);if(_0x63d244[_0x6961('0x32')]){delete _0x63d244[_0x6961('0x32')];}_0x3ad4e3[_0x6961('0x21')](_0x41ffbb)[_0x6961('0x33')](_0x63d244);};}exports['index']=function(_0x3d1f43,_0xd200b5){var _0x284c54={},_0x16f1c6={},_0x598c4f={'count':0x0,'rows':[]};var _0x18680c=_[_0x6961('0x34')](db[_0x6961('0x35')][_0x6961('0x36')],function(_0x3aaca5){return{'name':_0x3aaca5[_0x6961('0x37')],'type':_0x3aaca5['type'][_0x6961('0x38')]};});_0x16f1c6[_0x6961('0x39')]=_[_0x6961('0x34')](_0x18680c,_0x6961('0x32'));_0x16f1c6[_0x6961('0x3a')]=_[_0x6961('0x3b')](_0x3d1f43[_0x6961('0x3a')]);_0x16f1c6[_0x6961('0x3c')]=_[_0x6961('0x3d')](_0x16f1c6[_0x6961('0x39')],_0x16f1c6['query']);_0x284c54[_0x6961('0x3e')]=_[_0x6961('0x3d')](_0x16f1c6['model'],qs['fields'](_0x3d1f43['query'][_0x6961('0x3f')]));_0x284c54[_0x6961('0x3e')]=_0x284c54[_0x6961('0x3e')][_0x6961('0x40')]?_0x284c54[_0x6961('0x3e')]:_0x16f1c6['model'];if(!_0x3d1f43[_0x6961('0x3a')][_0x6961('0x41')](_0x6961('0x42'))){_0x284c54[_0x6961('0x25')]=qs[_0x6961('0x25')](_0x3d1f43['query'][_0x6961('0x25')]);_0x284c54[_0x6961('0x23')]=qs['offset'](_0x3d1f43[_0x6961('0x3a')][_0x6961('0x23')]);}_0x284c54[_0x6961('0x43')]=qs['sort'](_0x3d1f43[_0x6961('0x3a')][_0x6961('0x44')]);_0x284c54[_0x6961('0x45')]=qs[_0x6961('0x3c')](_[_0x6961('0x46')](_0x3d1f43[_0x6961('0x3a')],_0x16f1c6['filters']),_0x18680c);if(_0x3d1f43[_0x6961('0x3a')]['filter']){_0x284c54['where']=_[_0x6961('0x47')](_0x284c54[_0x6961('0x45')],{'$or':_[_0x6961('0x34')](_0x18680c,function(_0x2f2016){if(_0x2f2016['type']!==_0x6961('0x48')){var _0x428fb8={};_0x428fb8[_0x2f2016[_0x6961('0x32')]]={'$like':'%'+_0x3d1f43[_0x6961('0x3a')][_0x6961('0x49')]+'%'};return _0x428fb8;}})});}_0x284c54=_['merge']({},_0x284c54,_0x3d1f43['options']);var _0x15e571={'where':_0x284c54[_0x6961('0x45')]};return db[_0x6961('0x35')]['count'](_0x15e571)[_0x6961('0x2d')](function(_0x31957f){_0x598c4f[_0x6961('0x26')]=_0x31957f;if(_0x3d1f43[_0x6961('0x3a')][_0x6961('0x4a')]){_0x284c54['include']=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x284c54);})[_0x6961('0x2d')](function(_0x2ab194){_0x598c4f[_0x6961('0x4b')]=_0x2ab194;return _0x598c4f;})[_0x6961('0x2d')](respondWithFilteredResult(_0xd200b5,_0x284c54))[_0x6961('0x4c')](handleError(_0xd200b5,null));};exports[_0x6961('0x4d')]=function(_0xaf32c0,_0x1800f6){var _0x507dd8={'raw':!![],'where':{'id':_0xaf32c0[_0x6961('0x4e')]['id']}},_0x13b505={};_0x13b505['model']=_[_0x6961('0x3b')](db[_0x6961('0x35')]['rawAttributes']);_0x13b505[_0x6961('0x3a')]=_[_0x6961('0x3b')](_0xaf32c0[_0x6961('0x3a')]);_0x13b505[_0x6961('0x3c')]=_[_0x6961('0x3d')](_0x13b505[_0x6961('0x39')],_0x13b505['query']);_0x507dd8[_0x6961('0x3e')]=_[_0x6961('0x3d')](_0x13b505[_0x6961('0x39')],qs[_0x6961('0x3f')](_0xaf32c0[_0x6961('0x3a')][_0x6961('0x3f')]));_0x507dd8[_0x6961('0x3e')]=_0x507dd8[_0x6961('0x3e')][_0x6961('0x40')]?_0x507dd8['attributes']:_0x13b505['model'];if(_0xaf32c0[_0x6961('0x3a')]['includeAll']){_0x507dd8[_0x6961('0x4f')]=[{'all':!![]}];}_0x507dd8=_['merge']({},_0x507dd8,_0xaf32c0[_0x6961('0x50')]);return db['FaxQueue']['find'](_0x507dd8)['then'](handleEntityNotFound(_0x1800f6,null))[_0x6961('0x2d')](respondWithResult(_0x1800f6,null))[_0x6961('0x4c')](handleError(_0x1800f6,null));};exports[_0x6961('0x51')]=function(_0x3f2b65,_0x4c5e20){return db['FaxQueue']['create'](_0x3f2b65['body'],{})[_0x6961('0x2d')](function(_0x213ddf){var _0xb57d6c=_0x3f2b65['user']['get']({'plain':!![]});if(!_0xb57d6c)throw new Error(_0x6961('0x52'));if(_0xb57d6c[_0x6961('0x53')]===_0x6961('0x54')){var _0x5d271c=_0x213ddf['get']({'plain':!![]});var _0x109144=_0x6961('0x2f');return db[_0x6961('0x55')][_0x6961('0x56')]({'where':{'name':_0x109144,'userProfileId':_0xb57d6c['userProfileId']},'raw':!![]})[_0x6961('0x2d')](function(_0x522b81){if(_0x522b81&&_0x522b81[_0x6961('0x57')]===0x0){return db[_0x6961('0x30')][_0x6961('0x51')]({'name':_0x5d271c[_0x6961('0x32')],'resourceId':_0x5d271c['id'],'type':_0x522b81[_0x6961('0x32')],'sectionId':_0x522b81['id']},{})[_0x6961('0x2d')](function(){return _0x213ddf;});}else{return _0x213ddf;}})['catch'](function(_0x2e68aa){logger[_0x6961('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e68aa);throw _0x2e68aa;});}return _0x213ddf;})[_0x6961('0x2d')](respondWithResult(_0x4c5e20,0xc9))[_0x6961('0x4c')](handleError(_0x4c5e20,null));};exports[_0x6961('0x2c')]=function(_0x120358,_0x2e3410){if(_0x120358[_0x6961('0x58')]['id']){delete _0x120358[_0x6961('0x58')]['id'];}return db[_0x6961('0x35')]['find']({'where':{'id':_0x120358['params']['id']}})[_0x6961('0x2d')](handleEntityNotFound(_0x2e3410,null))[_0x6961('0x2d')](saveUpdates(_0x120358[_0x6961('0x58')],null))[_0x6961('0x2d')](respondWithResult(_0x2e3410,null))[_0x6961('0x4c')](handleError(_0x2e3410,null));};exports['destroy']=function(_0x4ae5a0,_0x5337f5){return db[_0x6961('0x35')]['find']({'where':{'id':_0x4ae5a0[_0x6961('0x4e')]['id']}})[_0x6961('0x2d')](handleEntityNotFound(_0x5337f5,null))[_0x6961('0x2d')](removeEntity(_0x5337f5,null))[_0x6961('0x4c')](handleError(_0x5337f5,null));};exports['describe']=function(_0xde2e03,_0x1234b8){return db[_0x6961('0x35')][_0x6961('0x59')]()[_0x6961('0x2d')](respondWithResult(_0x1234b8,null))[_0x6961('0x4c')](handleError(_0x1234b8,null));};exports[_0x6961('0x5a')]=function(_0x21a4f9,_0x10dd21,_0x2e6b5c){var _0x1d29a9={'raw':!![],'where':{}},_0x29d8f0={},_0x37fbfb;return db[_0x6961('0x35')][_0x6961('0x5b')]({'where':{'id':_0x21a4f9[_0x6961('0x4e')]['id']}})[_0x6961('0x2d')](handleEntityNotFound(_0x10dd21,null))[_0x6961('0x2d')](function(_0x20f969){if(_0x20f969){_0x37fbfb=_0x20f969[_0x6961('0x5c')]({'plain':!![]});_0x29d8f0[_0x6961('0x39')]=_[_0x6961('0x3b')](db[_0x6961('0x5d')][_0x6961('0x36')]);_0x29d8f0[_0x6961('0x3a')]=_[_0x6961('0x3b')](_0x21a4f9[_0x6961('0x3a')]);_0x29d8f0[_0x6961('0x3c')]=_['intersection'](_0x29d8f0[_0x6961('0x39')],_0x29d8f0[_0x6961('0x3a')]);_0x1d29a9['attributes']=_[_0x6961('0x3d')](_0x29d8f0['model'],qs[_0x6961('0x3f')](_0x21a4f9[_0x6961('0x3a')][_0x6961('0x3f')]));_0x1d29a9[_0x6961('0x3e')]=_0x1d29a9[_0x6961('0x3e')][_0x6961('0x40')]?_0x1d29a9[_0x6961('0x3e')]:_0x29d8f0[_0x6961('0x39')];if(!_0x21a4f9['query'][_0x6961('0x41')](_0x6961('0x42'))){_0x1d29a9[_0x6961('0x25')]=qs['limit'](_0x21a4f9[_0x6961('0x3a')][_0x6961('0x25')]);_0x1d29a9[_0x6961('0x23')]=qs[_0x6961('0x23')](_0x21a4f9[_0x6961('0x3a')]['offset']);}_0x1d29a9['order']=qs[_0x6961('0x44')](_0x21a4f9[_0x6961('0x3a')]['sort']);_0x1d29a9['where']=qs[_0x6961('0x3c')](_['pick'](_0x21a4f9[_0x6961('0x3a')],_0x29d8f0[_0x6961('0x3c')]));_0x1d29a9[_0x6961('0x45')][_0x6961('0x5e')]=_0x20f969['id'];if(_0x21a4f9['query']['filter']){_0x1d29a9['where']=_[_0x6961('0x47')](_0x1d29a9[_0x6961('0x45')],{'$or':_['map'](_0x1d29a9[_0x6961('0x3e')],function(_0x4b1553){var _0x10288f={};_0x10288f[_0x4b1553]={'$like':'%'+_0x21a4f9[_0x6961('0x3a')][_0x6961('0x49')]+'%'};return _0x10288f;})});}_0x1d29a9=_[_0x6961('0x47')]({},_0x1d29a9,_0x21a4f9[_0x6961('0x50')]);return db[_0x6961('0x5d')][_0x6961('0x5f')](_0x1d29a9);}})[_0x6961('0x2d')](function(_0x43d444){if(_0x43d444){return db[_0x6961('0x60')]['findAndCountAll']({'where':{'id':_['map'](_0x43d444,_0x6961('0x61')),'role':'agent'},'attributes':['id',_0x6961('0x32'),_0x6961('0x62'),'updatedAt',_0x6961('0x63')]});}})[_0x6961('0x2d')](function(_0x1e8997){if(_0x1e8997){return{'count':_0x1e8997[_0x6961('0x26')],'rows':_['map'](_0x1e8997[_0x6961('0x4b')],function(_0x2e8b5d){return{'membername':_0x2e8b5d[_0x6961('0x32')],'UserId':_0x2e8b5d['id'],'queue_name':_0x37fbfb[_0x6961('0x32')],'FaxQueueId':_0x37fbfb['id'],'interface':util[_0x6961('0x64')](_0x6961('0x65'),_0x6961('0x66'),_0x2e8b5d[_0x6961('0x32')]),'penalty':0x0,'paused':_0x2e8b5d[_0x6961('0x62')],'createdAt':_0x2e8b5d['createdAt'],'updatedAt':_0x2e8b5d[_0x6961('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6961('0x2d')](respondWithFilteredResult(_0x10dd21,_0x1d29a9))[_0x6961('0x4c')](handleError(_0x10dd21,null));};exports[_0x6961('0x68')]=function(_0x2fa222,_0xa49f1f,_0x432f4c){var _0x16c4f8={};var _0x2eaab5={};var _0x5d7526;var _0x5c554b;return db['FaxQueue'][_0x6961('0x5b')]({'where':{'id':_0x2fa222[_0x6961('0x4e')]['id']}})[_0x6961('0x2d')](handleEntityNotFound(_0xa49f1f,null))[_0x6961('0x2d')](function(_0x21b00c){if(_0x21b00c){_0x5d7526=_0x21b00c;_0x2eaab5['model']=_['keys'](db[_0x6961('0x69')][_0x6961('0x36')]);_0x2eaab5[_0x6961('0x3a')]=_['keys'](_0x2fa222[_0x6961('0x3a')]);_0x2eaab5[_0x6961('0x3c')]=_[_0x6961('0x3d')](_0x2eaab5[_0x6961('0x39')],_0x2eaab5[_0x6961('0x3a')]);_0x16c4f8[_0x6961('0x3e')]=_[_0x6961('0x3d')](_0x2eaab5[_0x6961('0x39')],qs[_0x6961('0x3f')](_0x2fa222[_0x6961('0x3a')][_0x6961('0x3f')]));_0x16c4f8[_0x6961('0x3e')]=_0x16c4f8[_0x6961('0x3e')][_0x6961('0x40')]?_0x16c4f8[_0x6961('0x3e')]:_0x2eaab5[_0x6961('0x39')];_0x16c4f8['order']=qs['sort'](_0x2fa222[_0x6961('0x3a')][_0x6961('0x44')]);_0x16c4f8[_0x6961('0x45')]=qs['filters'](_['pick'](_0x2fa222[_0x6961('0x3a')],_0x2eaab5[_0x6961('0x3c')]));if(_0x2fa222[_0x6961('0x3a')][_0x6961('0x49')]){_0x16c4f8[_0x6961('0x45')]=_[_0x6961('0x47')](_0x16c4f8['where'],{'$or':_[_0x6961('0x34')](_0x16c4f8[_0x6961('0x3e')],function(_0x34d124){var _0x16d541={};_0x16d541[_0x34d124]={'$like':'%'+_0x2fa222[_0x6961('0x3a')][_0x6961('0x49')]+'%'};return _0x16d541;})});}_0x16c4f8=_['merge']({},_0x16c4f8,_0x2fa222[_0x6961('0x50')]);return _0x5d7526['getTeams'](_0x16c4f8);}})[_0x6961('0x2d')](function(_0x1ecee1){if(_0x1ecee1){_0x5c554b=_0x1ecee1['length'];if(!_0x2fa222[_0x6961('0x3a')][_0x6961('0x41')](_0x6961('0x42'))){_0x16c4f8[_0x6961('0x25')]=qs['limit'](_0x2fa222[_0x6961('0x3a')]['limit']);_0x16c4f8[_0x6961('0x23')]=qs[_0x6961('0x23')](_0x2fa222[_0x6961('0x3a')][_0x6961('0x23')]);}return _0x5d7526[_0x6961('0x68')](_0x16c4f8);}})[_0x6961('0x2d')](function(_0x23c6ea){if(_0x23c6ea){return _0x23c6ea?{'count':_0x5c554b,'rows':_0x23c6ea}:null;}})[_0x6961('0x2d')](respondWithResult(_0xa49f1f,null))[_0x6961('0x4c')](handleError(_0xa49f1f,null));};exports['addTeams']=function(_0x450f1d,_0x4e3203,_0x385b63){var _0x2f8994=_0x450f1d['body'][_0x6961('0x6a')];return db[_0x6961('0x69')]['findAll']({'where':{'id':_0x2f8994},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6961('0x6b'),'attributes':['id','name',_0x6961('0x6c'),_0x6961('0x6d'),'interface'],'raw':!![]}]})[_0x6961('0x2d')](function(_0xb7236a){if(_0xb7236a){var _0x41318f=_[_0x6961('0x6e')](_0xb7236a,function(_0xf214d2){var _0x9098bc=_0xf214d2[_0x6961('0x5c')]({'plain':!![]});return _0x9098bc[_0x6961('0x6b')];});return db['FaxQueue'][_0x6961('0x56')]({'where':{'id':_0x450f1d['params']['id']}})[_0x6961('0x2d')](function(_0x3ea340){return db[_0x6961('0x6f')][_0x6961('0x70')](function(_0xd487c5){return _0x3ea340[_0x6961('0x71')](_0x2f8994,{'transaction':_0xd487c5})[_0x6961('0x2d')](function(){return BPromise[_0x6961('0x72')](_0x41318f,function(_0x5b178c){return db[_0x6961('0x5d')][_0x6961('0x73')]({'where':{'UserId':_0x5b178c['id'],'FaxQueueId':_0x450f1d[_0x6961('0x4e')]['id']},'transaction':_0xd487c5});});})['then'](function(){_0x41318f[_0x6961('0x74')](function(_0x22374c){socket[_0x6961('0x75')]('userFaxQueue:save',{'UserId':_0x22374c['id'],'FaxQueueId':_0x3ea340['id']});});});});});}})[_0x6961('0x2d')](respondWithStatusCode(_0x4e3203,null))[_0x6961('0x4c')](handleError(_0x4e3203,null));};exports[_0x6961('0x76')]=function(_0xcc4454,_0x196296,_0x774c64){return db[_0x6961('0x69')][_0x6961('0x5f')]({'where':{'id':_0xcc4454[_0x6961('0x3a')][_0x6961('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x6961('0x60')],'as':_0x6961('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x6961('0x2d')](handleEntityNotFound(_0x196296,null))[_0x6961('0x2d')](function(_0x54c591){var _0x22ec37=_[_0x6961('0x34')](_0x54c591,'id');var _0x91e414=[];var _0x5ade46=[];var _0x2ad49f=squel[_0x6961('0x77')]();_0x2ad49f[_0x6961('0x78')](_0x6961('0x79'))[_0x6961('0x7a')](_0x6961('0x7b'),'tq')[_0x6961('0x7c')](_0x6961('0x7d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6961('0x45')](_0x6961('0x7e'),_0xcc4454['params']['id']);for(var _0x317d46=0x0;_0x317d46<_0x54c591[_0x6961('0x40')];_0x317d46+=0x1){let _0x82c89f=_0x54c591[_0x317d46];for(var _0x3a877f=0x0;_0x3a877f<_0x82c89f['Agents']['length'];_0x3a877f+=0x1){let _0x2cb8d5=_0x82c89f[_0x6961('0x6b')][_0x3a877f];var _0x147c15=_0x2ad49f[_0x6961('0x7f')]();_0x147c15[_0x6961('0x45')](_0x6961('0x80'),_0x2cb8d5['id']);_0x5ade46['push'](db[_0x6961('0x6f')][_0x6961('0x3a')](_0x147c15[_0x6961('0x81')](),{'type':db[_0x6961('0x6f')]['QueryTypes']['SELECT']})[_0x6961('0x2d')](function(_0x42dab5){if(_0x42dab5['length']===0x1){return _0x2cb8d5['id'];}else{var _0x385124=_[_0x6961('0x82')](_[_0x6961('0x34')](_0x42dab5,_0x6961('0x83')),function(_0x14f156){return _[_0x6961('0x84')](_0x22ec37,_0x14f156);});if(_0x385124){return _0x2cb8d5['id'];}}}));}}return BPromise['all'](_0x5ade46)[_0x6961('0x2d')](function(_0x5bc4ad){_0x91e414=_(_0x91e414)[_0x6961('0x85')](_0x5bc4ad)['compact']()[_0x6961('0x86')]();return db['FaxQueue'][_0x6961('0x56')]({'where':{'id':_0xcc4454['params']['id']}})['then'](function(_0x2bbd78){return db[_0x6961('0x6f')][_0x6961('0x70')](function(_0x55818f){return _0x2bbd78[_0x6961('0x76')](_0xcc4454[_0x6961('0x3a')][_0x6961('0x6a')],{'transaction':_0x55818f})[_0x6961('0x2d')](function(){if(!_[_0x6961('0x87')](_0x91e414)){return _0x2bbd78[_0x6961('0x88')](_0x91e414,{'transaction':_0x55818f});}})[_0x6961('0x2d')](function(){_0x91e414[_0x6961('0x74')](function(_0x3bb04e){socket[_0x6961('0x75')](_0x6961('0x89'),{'UserId':_0x3bb04e,'FaxQueueId':_0x2bbd78['id']});});});});});});})[_0x6961('0x2d')](respondWithStatusCode(_0x196296,null))[_0x6961('0x4c')](handleError(_0x196296,null));};exports[_0x6961('0x8a')]=function(_0x3ca4fb,_0x54a5f4,_0x28b879){return db[_0x6961('0x35')][_0x6961('0x56')]({'where':{'id':_0x3ca4fb['params']['id']}})[_0x6961('0x2d')](handleEntityNotFound(_0x54a5f4,null))['then'](function(_0x2c887c){if(_0x2c887c){return _0x2c887c[_0x6961('0x8a')](_0x3ca4fb['body']['ids'],_[_0x6961('0x8b')](_0x3ca4fb[_0x6961('0x58')],[_0x6961('0x6a'),'id'])||{})[_0x6961('0x8c')](function(_0x53338a){for(var _0x1b74fe=0x0;_0x1b74fe<_0x3ca4fb[_0x6961('0x58')]['ids'][_0x6961('0x40')];_0x1b74fe+=0x1){socket['emit'](_0x6961('0x8d'),{'UserId':Number(_0x3ca4fb[_0x6961('0x58')][_0x6961('0x6a')][_0x1b74fe]),'FaxQueueId':Number(_0x3ca4fb[_0x6961('0x4e')]['id'])});}return _0x53338a;});}})['then'](respondWithResult(_0x54a5f4,null))[_0x6961('0x4c')](handleError(_0x54a5f4,null));};exports[_0x6961('0x88')]=function(_0x44cd3a,_0x304e9b,_0x49d5c3){return db[_0x6961('0x35')][_0x6961('0x56')]({'where':{'id':_0x44cd3a[_0x6961('0x4e')]['id']}})[_0x6961('0x2d')](handleEntityNotFound(_0x304e9b,null))['then'](function(_0x22f3a4){if(_0x22f3a4){return _0x22f3a4[_0x6961('0x88')](_0x44cd3a[_0x6961('0x3a')]['ids'])[_0x6961('0x2d')](function(){if(_[_0x6961('0x8e')](_0x44cd3a[_0x6961('0x3a')][_0x6961('0x6a')])){for(var _0x3d118c=0x0;_0x3d118c<_0x44cd3a[_0x6961('0x3a')]['ids'][_0x6961('0x40')];_0x3d118c+=0x1){socket['emit'](_0x6961('0x89'),{'UserId':Number(_0x44cd3a[_0x6961('0x3a')][_0x6961('0x6a')][_0x3d118c]),'FaxQueueId':Number(_0x44cd3a[_0x6961('0x4e')]['id'])});}}else{socket[_0x6961('0x75')](_0x6961('0x89'),{'UserId':Number(_0x44cd3a['query'][_0x6961('0x6a')]),'FaxQueueId':Number(_0x44cd3a[_0x6961('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x304e9b,null))['catch'](handleError(_0x304e9b,null));};exports[_0x6961('0x8f')]=function(_0x1b6e1f,_0x15ea42,_0x2153ed){var _0x442863={};var _0x5717e4={};var _0x392073;var _0x2a6a78;return db[_0x6961('0x35')][_0x6961('0x5b')]({'where':{'id':_0x1b6e1f[_0x6961('0x4e')]['id']}})['then'](handleEntityNotFound(_0x15ea42,null))[_0x6961('0x2d')](function(_0x38e359){if(_0x38e359){_0x392073=_0x38e359;_0x5717e4[_0x6961('0x39')]=_['keys'](db['User'][_0x6961('0x36')]);_0x5717e4[_0x6961('0x3a')]=_['keys'](_0x1b6e1f[_0x6961('0x3a')]);_0x5717e4[_0x6961('0x3c')]=_['intersection'](_0x5717e4['model'],_0x5717e4[_0x6961('0x3a')]);_0x442863[_0x6961('0x3e')]=_[_0x6961('0x3d')](_0x5717e4[_0x6961('0x39')],qs[_0x6961('0x3f')](_0x1b6e1f['query'][_0x6961('0x3f')]));_0x442863['attributes']=_0x442863[_0x6961('0x3e')][_0x6961('0x40')]?_0x442863['attributes']:_0x5717e4[_0x6961('0x39')];_0x442863[_0x6961('0x43')]=qs[_0x6961('0x44')](_0x1b6e1f['query'][_0x6961('0x44')]);_0x442863[_0x6961('0x45')]=qs[_0x6961('0x3c')](_[_0x6961('0x46')](_0x1b6e1f[_0x6961('0x3a')],_0x5717e4[_0x6961('0x3c')]));if(_0x1b6e1f[_0x6961('0x3a')]['filter']){_0x442863[_0x6961('0x45')]=_['merge'](_0x442863[_0x6961('0x45')],{'$or':_[_0x6961('0x34')](_0x442863[_0x6961('0x3e')],function(_0x54fd10){var _0x15bde3={};_0x15bde3[_0x54fd10]={'$like':'%'+_0x1b6e1f['query'][_0x6961('0x49')]+'%'};return _0x15bde3;})});}_0x442863=_[_0x6961('0x47')]({},_0x442863,_0x1b6e1f[_0x6961('0x50')]);return _0x392073['getAgents'](_0x442863);}})['then'](function(_0x1b4964){if(_0x1b4964){_0x2a6a78=_0x1b4964[_0x6961('0x40')];if(!_0x1b6e1f[_0x6961('0x3a')][_0x6961('0x41')](_0x6961('0x42'))){_0x442863['limit']=qs[_0x6961('0x25')](_0x1b6e1f[_0x6961('0x3a')][_0x6961('0x25')]);_0x442863[_0x6961('0x23')]=qs[_0x6961('0x23')](_0x1b6e1f['query']['offset']);}return _0x392073[_0x6961('0x8f')](_0x442863);}})[_0x6961('0x2d')](function(_0xb9e1fd){if(_0xb9e1fd){return _0xb9e1fd?{'count':_0x2a6a78,'rows':_0xb9e1fd}:null;}})[_0x6961('0x2d')](respondWithResult(_0x15ea42,null))['catch'](handleError(_0x15ea42,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 453e6c0..d88c4cd 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 _0xfc60=['save','update','remove','emit','exports','events','setMaxListeners'];(function(_0x4bf1f5,_0x14025e){var _0xcd975=function(_0x25aad3){while(--_0x25aad3){_0x4bf1f5['push'](_0x4bf1f5['shift']());}};_0xcd975(++_0x14025e);}(_0xfc60,0xec));var _0x0fc6=function(_0x3ce4a2,_0xdc404){_0x3ce4a2=_0x3ce4a2-0x0;var _0x54ef49=_0xfc60[_0x3ce4a2];return _0x54ef49;};'use strict';var EventEmitter=require(_0x0fc6('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x0fc6('0x1')](0x0);var events={'afterCreate':_0x0fc6('0x2'),'afterUpdate':_0x0fc6('0x3'),'afterDestroy':_0x0fc6('0x4')};function emitEvent(_0x18c4f0){return function(_0x2bf21c,_0x427cce,_0x48a57e){FaxQueueEvents['emit'](_0x18c4f0+':'+_0x2bf21c['id'],_0x2bf21c);FaxQueueEvents[_0x0fc6('0x5')](_0x18c4f0,_0x2bf21c);_0x48a57e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x0fc6('0x6')]=FaxQueueEvents; \ No newline at end of file +var _0x296a=['../../mysqldb','setMaxListeners','emit','hasOwnProperty','hook','exports','events'];(function(_0x2f89c0,_0x455702){var _0x164223=function(_0x11a234){while(--_0x11a234){_0x2f89c0['push'](_0x2f89c0['shift']());}};_0x164223(++_0x455702);}(_0x296a,0x16b));var _0xa296=function(_0x483a1a,_0x4d1757){_0x483a1a=_0x483a1a-0x0;var _0x3cc225=_0x296a[_0x483a1a];return _0x3cc225;};'use strict';var EventEmitter=require(_0xa296('0x0'));var FaxQueue=require(_0xa296('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xa296('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x353ac9){return function(_0x448326,_0x1222f9,_0x36ac10){FaxQueueEvents[_0xa296('0x3')](_0x353ac9+':'+_0x448326['id'],_0x448326);FaxQueueEvents[_0xa296('0x3')](_0x353ac9,_0x448326);_0x36ac10(null);};}for(var e in events){if(events[_0xa296('0x4')](e)){var event=events[e];FaxQueue[_0xa296('0x5')](e,emitEvent(event));}}module[_0xa296('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index b07263e..45b8e2b 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 _0xf139=['fax_queues','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxQueue'];(function(_0x9745bb,_0x2f1992){var _0x51088b=function(_0x5b1e79){while(--_0x5b1e79){_0x9745bb['push'](_0x9745bb['shift']());}};_0x51088b(++_0x2f1992);}(_0xf139,0x64));var _0x9f13=function(_0xf0a32,_0x5184ec){_0xf0a32=_0xf0a32-0x0;var _0x36ecf8=_0xf139[_0xf0a32];return _0x36ecf8;};'use strict';var _=require('lodash');var util=require(_0x9f13('0x0'));var logger=require('../../config/logger')(_0x9f13('0x1'));var moment=require('moment');var BPromise=require(_0x9f13('0x2'));var rp=require(_0x9f13('0x3'));var fs=require('fs');var path=require(_0x9f13('0x4'));var rimraf=require(_0x9f13('0x5'));var config=require(_0x9f13('0x6'));var attributes=require('./faxQueue.attributes');module[_0x9f13('0x7')]=function(_0x37c69e,_0x16b288){return _0x37c69e[_0x9f13('0x8')](_0x9f13('0x9'),attributes,{'tableName':_0x9f13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa31=['util','api','moment','path','../../config/environment','./faxQueue.attributes','exports','fax_queues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa31,0x190));var _0x1aa3=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xaa31[_0xef8146];return _0x5a6cb0;};'use strict';var _=require('lodash');var util=require(_0x1aa3('0x0'));var logger=require('../../config/logger')(_0x1aa3('0x1'));var moment=require(_0x1aa3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1aa3('0x3'));var rimraf=require('rimraf');var config=require(_0x1aa3('0x4'));var attributes=require(_0x1aa3('0x5'));module[_0x1aa3('0x6')]=function(_0x1500eb,_0x2e3635){return _0x1500eb['define']('FaxQueue',attributes,{'tableName':_0x1aa3('0x7'),'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 3124a1f..915b8fb 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 _0xcb99=['defaults','localhost','socket.io-emitter','./faxQueue.socket','register','info','request\x20sent','debug','error','code','FaxQueue,\x20%s,\x20%s','message','result','GetFaxQueue','FaxQueue','options','raw','where','attributes','map','model','include','then','catch','ShowFaxQueue','find','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcb99,0x14b));var _0x9cb9=function(_0x48b122,_0x2e66d2){_0x48b122=_0x48b122-0x0;var _0x5f573a=_0xcb99[_0x48b122];return _0x5f573a;};'use strict';var _=require('lodash');var util=require(_0x9cb9('0x0'));var moment=require('moment');var BPromise=require(_0x9cb9('0x1'));var rs=require(_0x9cb9('0x2'));var fs=require('fs');var Redis=require(_0x9cb9('0x3'));var db=require(_0x9cb9('0x4'))['db'];var utils=require(_0x9cb9('0x5'));var logger=require(_0x9cb9('0x6'))('rpc');var config=require(_0x9cb9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9cb9('0x8')][_0x9cb9('0x9')]({'port':0x232a});config[_0x9cb9('0xa')]=_[_0x9cb9('0xb')](config['redis'],{'host':_0x9cb9('0xc'),'port':0x18eb});var socket=require(_0x9cb9('0xd'))(new Redis(config[_0x9cb9('0xa')]));require(_0x9cb9('0xe'))[_0x9cb9('0xf')](socket);function respondWithRpcPromise(_0x5a0d20,_0x19fd81,_0x54a1b1){return new BPromise(function(_0x5a18e6,_0x32811f){return client['request'](_0x5a0d20,_0x54a1b1)['then'](function(_0x390c40){logger[_0x9cb9('0x10')]('FaxQueue,\x20%s,\x20%s',_0x19fd81,_0x9cb9('0x11'));logger[_0x9cb9('0x12')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x19fd81,_0x9cb9('0x11'),JSON['stringify'](_0x390c40));if(_0x390c40[_0x9cb9('0x13')]){if(_0x390c40[_0x9cb9('0x13')][_0x9cb9('0x14')]===0x1f4){logger[_0x9cb9('0x13')](_0x9cb9('0x15'),_0x19fd81,_0x390c40[_0x9cb9('0x13')]['message']);return _0x32811f(_0x390c40['error'][_0x9cb9('0x16')]);}logger[_0x9cb9('0x13')](_0x9cb9('0x15'),_0x19fd81,_0x390c40['error'][_0x9cb9('0x16')]);return _0x5a18e6(_0x390c40[_0x9cb9('0x13')][_0x9cb9('0x16')]);}else{logger[_0x9cb9('0x10')](_0x9cb9('0x15'),_0x19fd81,'request\x20sent');_0x5a18e6(_0x390c40[_0x9cb9('0x17')][_0x9cb9('0x16')]);}})['catch'](function(_0x306ff2){logger[_0x9cb9('0x13')](_0x9cb9('0x15'),_0x19fd81,_0x306ff2);_0x32811f(_0x306ff2);});});}exports[_0x9cb9('0x18')]=function(_0x17863c){var _0x4fb8cd=this;return new Promise(function(_0x20d50f,_0x34693f){return db[_0x9cb9('0x19')]['findAll']({'raw':_0x17863c[_0x9cb9('0x1a')]?_0x17863c[_0x9cb9('0x1a')][_0x9cb9('0x1b')]===undefined?!![]:![]:!![],'where':_0x17863c[_0x9cb9('0x1a')]?_0x17863c['options'][_0x9cb9('0x1c')]||null:null,'attributes':_0x17863c[_0x9cb9('0x1a')]?_0x17863c[_0x9cb9('0x1a')][_0x9cb9('0x1d')]||null:null,'limit':_0x17863c['options']?_0x17863c['options']['limit']||null:null,'include':_0x17863c[_0x9cb9('0x1a')]?_0x17863c[_0x9cb9('0x1a')]['include']?_[_0x9cb9('0x1e')](_0x17863c[_0x9cb9('0x1a')]['include'],function(_0x2672a7){return{'model':db[_0x2672a7[_0x9cb9('0x1f')]],'as':_0x2672a7['as'],'attributes':_0x2672a7[_0x9cb9('0x1d')],'include':_0x2672a7[_0x9cb9('0x20')]?_['map'](_0x2672a7[_0x9cb9('0x20')],function(_0x1424c0){return{'model':db[_0x1424c0['model']],'as':_0x1424c0['as'],'attributes':_0x1424c0[_0x9cb9('0x1d')],'include':_0x1424c0[_0x9cb9('0x20')]?_['map'](_0x1424c0['include'],function(_0x384b9e){return{'model':db[_0x384b9e[_0x9cb9('0x1f')]],'as':_0x384b9e['as'],'attributes':_0x384b9e[_0x9cb9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9cb9('0x21')](function(_0x2cb8e6){logger[_0x9cb9('0x10')](_0x9cb9('0x18'),_0x17863c);logger['debug']('GetFaxQueue',_0x17863c,JSON['stringify'](_0x2cb8e6));_0x20d50f(_0x2cb8e6);})[_0x9cb9('0x22')](function(_0x124a5d){logger[_0x9cb9('0x13')]('GetFaxQueue',_0x124a5d[_0x9cb9('0x16')],_0x17863c);_0x34693f(_0x4fb8cd[_0x9cb9('0x13')](0x1f4,_0x124a5d['message']));});});};exports[_0x9cb9('0x23')]=function(_0x2c234c){var _0x57fc09=this;return new Promise(function(_0x2a0c81,_0x4e4397){return db[_0x9cb9('0x19')][_0x9cb9('0x24')]({'raw':_0x2c234c[_0x9cb9('0x1a')]?_0x2c234c[_0x9cb9('0x1a')][_0x9cb9('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c234c[_0x9cb9('0x1a')]?_0x2c234c['options'][_0x9cb9('0x1c')]||null:null,'attributes':_0x2c234c[_0x9cb9('0x1a')]?_0x2c234c[_0x9cb9('0x1a')][_0x9cb9('0x1d')]||null:null,'include':_0x2c234c[_0x9cb9('0x1a')]?_0x2c234c[_0x9cb9('0x1a')][_0x9cb9('0x20')]?_['map'](_0x2c234c[_0x9cb9('0x1a')][_0x9cb9('0x20')],function(_0x12e586){return{'model':db[_0x12e586[_0x9cb9('0x1f')]],'as':_0x12e586['as'],'attributes':_0x12e586[_0x9cb9('0x1d')],'include':_0x12e586[_0x9cb9('0x20')]?_[_0x9cb9('0x1e')](_0x12e586[_0x9cb9('0x20')],function(_0x569c25){return{'model':db[_0x569c25[_0x9cb9('0x1f')]],'as':_0x569c25['as'],'attributes':_0x569c25['attributes'],'include':_0x569c25['include']?_[_0x9cb9('0x1e')](_0x569c25[_0x9cb9('0x20')],function(_0x2fd772){return{'model':db[_0x2fd772[_0x9cb9('0x1f')]],'as':_0x2fd772['as'],'attributes':_0x2fd772[_0x9cb9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9cb9('0x21')](function(_0x2288c7){logger[_0x9cb9('0x10')]('ShowFaxQueue',_0x2c234c);logger['debug']('ShowFaxQueue',_0x2c234c,JSON[_0x9cb9('0x25')](_0x2288c7));_0x2a0c81(_0x2288c7);})[_0x9cb9('0x22')](function(_0x7ee262){logger['error'](_0x9cb9('0x23'),_0x7ee262[_0x9cb9('0x16')],_0x2c234c);_0x4e4397(_0x57fc09[_0x9cb9('0x13')](0x1f4,_0x7ee262[_0x9cb9('0x16')]));});});}; \ No newline at end of file +var _0xbb2b=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','request','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','include','map','model','then','ShowFaxQueue','find','raw','lodash','util','moment','bluebird','ioredis'];(function(_0x3c5f40,_0xb82ced){var _0x5b610e=function(_0x2e3193){while(--_0x2e3193){_0x3c5f40['push'](_0x3c5f40['shift']());}};_0x5b610e(++_0xb82ced);}(_0xbb2b,0x163));var _0xbbb2=function(_0x28f6ee,_0x12342d){_0x28f6ee=_0x28f6ee-0x0;var _0x5c511b=_0xbb2b[_0x28f6ee];return _0x5c511b;};'use strict';var _=require(_0xbbb2('0x0'));var util=require(_0xbbb2('0x1'));var moment=require(_0xbbb2('0x2'));var BPromise=require(_0xbbb2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbb2('0x4'));var db=require(_0xbbb2('0x5'))['db'];var utils=require(_0xbbb2('0x6'));var logger=require('../../config/logger')(_0xbbb2('0x7'));var config=require(_0xbbb2('0x8'));var jayson=require(_0xbbb2('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xbbb2('0xa')]=_[_0xbbb2('0xb')](config[_0xbbb2('0xa')],{'host':_0xbbb2('0xc'),'port':0x18eb});var socket=require(_0xbbb2('0xd'))(new Redis(config['redis']));require(_0xbbb2('0xe'))['register'](socket);function respondWithRpcPromise(_0x50d2bd,_0xa2b0ca,_0x385686){return new BPromise(function(_0x4e7fe4,_0x173310){return client[_0xbbb2('0xf')](_0x50d2bd,_0x385686)['then'](function(_0x49ac41){logger[_0xbbb2('0x10')](_0xbbb2('0x11'),_0xa2b0ca,'request\x20sent');logger[_0xbbb2('0x12')](_0xbbb2('0x13'),_0xa2b0ca,_0xbbb2('0x14'),JSON[_0xbbb2('0x15')](_0x49ac41));if(_0x49ac41[_0xbbb2('0x16')]){if(_0x49ac41[_0xbbb2('0x16')]['code']===0x1f4){logger[_0xbbb2('0x16')](_0xbbb2('0x11'),_0xa2b0ca,_0x49ac41[_0xbbb2('0x16')][_0xbbb2('0x17')]);return _0x173310(_0x49ac41['error'][_0xbbb2('0x17')]);}logger[_0xbbb2('0x16')]('FaxQueue,\x20%s,\x20%s',_0xa2b0ca,_0x49ac41[_0xbbb2('0x16')][_0xbbb2('0x17')]);return _0x4e7fe4(_0x49ac41[_0xbbb2('0x16')]['message']);}else{logger[_0xbbb2('0x10')]('FaxQueue,\x20%s,\x20%s',_0xa2b0ca,_0xbbb2('0x14'));_0x4e7fe4(_0x49ac41[_0xbbb2('0x18')]['message']);}})[_0xbbb2('0x19')](function(_0x4ddc17){logger[_0xbbb2('0x16')]('FaxQueue,\x20%s,\x20%s',_0xa2b0ca,_0x4ddc17);_0x173310(_0x4ddc17);});});}exports[_0xbbb2('0x1a')]=function(_0x2d168a){var _0x793d11=this;return new Promise(function(_0x1b79c1,_0x31eed3){return db[_0xbbb2('0x1b')][_0xbbb2('0x1c')]({'raw':_0x2d168a[_0xbbb2('0x1d')]?_0x2d168a['options']['raw']===undefined?!![]:![]:!![],'where':_0x2d168a[_0xbbb2('0x1d')]?_0x2d168a[_0xbbb2('0x1d')][_0xbbb2('0x1e')]||null:null,'attributes':_0x2d168a[_0xbbb2('0x1d')]?_0x2d168a[_0xbbb2('0x1d')][_0xbbb2('0x1f')]||null:null,'limit':_0x2d168a[_0xbbb2('0x1d')]?_0x2d168a['options'][_0xbbb2('0x20')]||null:null,'include':_0x2d168a[_0xbbb2('0x1d')]?_0x2d168a['options'][_0xbbb2('0x21')]?_[_0xbbb2('0x22')](_0x2d168a[_0xbbb2('0x1d')][_0xbbb2('0x21')],function(_0x2335e3){return{'model':db[_0x2335e3[_0xbbb2('0x23')]],'as':_0x2335e3['as'],'attributes':_0x2335e3[_0xbbb2('0x1f')],'include':_0x2335e3['include']?_[_0xbbb2('0x22')](_0x2335e3['include'],function(_0x557087){return{'model':db[_0x557087[_0xbbb2('0x23')]],'as':_0x557087['as'],'attributes':_0x557087[_0xbbb2('0x1f')],'include':_0x557087[_0xbbb2('0x21')]?_[_0xbbb2('0x22')](_0x557087[_0xbbb2('0x21')],function(_0x2f8a9f){return{'model':db[_0x2f8a9f[_0xbbb2('0x23')]],'as':_0x2f8a9f['as'],'attributes':_0x2f8a9f[_0xbbb2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbbb2('0x24')](function(_0x4ce0dd){logger[_0xbbb2('0x10')](_0xbbb2('0x1a'),_0x2d168a);logger['debug']('GetFaxQueue',_0x2d168a,JSON[_0xbbb2('0x15')](_0x4ce0dd));_0x1b79c1(_0x4ce0dd);})[_0xbbb2('0x19')](function(_0x2628d3){logger[_0xbbb2('0x16')](_0xbbb2('0x1a'),_0x2628d3['message'],_0x2d168a);_0x31eed3(_0x793d11['error'](0x1f4,_0x2628d3[_0xbbb2('0x17')]));});});};exports[_0xbbb2('0x25')]=function(_0x50d6d3){var _0x321374=this;return new Promise(function(_0x349394,_0x453e8d){return db[_0xbbb2('0x1b')][_0xbbb2('0x26')]({'raw':_0x50d6d3['options']?_0x50d6d3[_0xbbb2('0x1d')][_0xbbb2('0x27')]===undefined?!![]:![]:!![],'where':_0x50d6d3[_0xbbb2('0x1d')]?_0x50d6d3['options'][_0xbbb2('0x1e')]||null:null,'attributes':_0x50d6d3[_0xbbb2('0x1d')]?_0x50d6d3[_0xbbb2('0x1d')][_0xbbb2('0x1f')]||null:null,'include':_0x50d6d3[_0xbbb2('0x1d')]?_0x50d6d3[_0xbbb2('0x1d')][_0xbbb2('0x21')]?_[_0xbbb2('0x22')](_0x50d6d3[_0xbbb2('0x1d')][_0xbbb2('0x21')],function(_0x5f2ddf){return{'model':db[_0x5f2ddf[_0xbbb2('0x23')]],'as':_0x5f2ddf['as'],'attributes':_0x5f2ddf['attributes'],'include':_0x5f2ddf[_0xbbb2('0x21')]?_[_0xbbb2('0x22')](_0x5f2ddf[_0xbbb2('0x21')],function(_0x1b61b2){return{'model':db[_0x1b61b2[_0xbbb2('0x23')]],'as':_0x1b61b2['as'],'attributes':_0x1b61b2['attributes'],'include':_0x1b61b2[_0xbbb2('0x21')]?_[_0xbbb2('0x22')](_0x1b61b2['include'],function(_0x426ad0){return{'model':db[_0x426ad0[_0xbbb2('0x23')]],'as':_0x426ad0['as'],'attributes':_0x426ad0[_0xbbb2('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3373d3){logger[_0xbbb2('0x10')](_0xbbb2('0x25'),_0x50d6d3);logger['debug'](_0xbbb2('0x25'),_0x50d6d3,JSON['stringify'](_0x3373d3));_0x349394(_0x3373d3);})[_0xbbb2('0x19')](function(_0x1dedb0){logger['error'](_0xbbb2('0x25'),_0x1dedb0[_0xbbb2('0x17')],_0x50d6d3);_0x453e8d(_0x321374[_0xbbb2('0x16')](0x1f4,_0x1dedb0['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index f4fa5eb..a956657 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 _0x4605=['length','faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x4cdba5,_0x5373a7){var _0x3be43d=function(_0x5e007c){while(--_0x5e007c){_0x4cdba5['push'](_0x4cdba5['shift']());}};_0x3be43d(++_0x5373a7);}(_0x4605,0x1d6));var _0x5460=function(_0xe73228,_0x226565){_0xe73228=_0xe73228-0x0;var _0x3288ea=_0x4605[_0xe73228];return _0x3288ea;};'use strict';var FaxQueueEvents=require(_0x5460('0x0'));var events=[_0x5460('0x1'),_0x5460('0x2'),_0x5460('0x3')];function createListener(_0x4eb351,_0x2ec187){return function(_0x445244){_0x2ec187[_0x5460('0x4')](_0x4eb351,_0x445244);};}function removeListener(_0x1e1f39,_0x550c5c){return function(){FaxQueueEvents[_0x5460('0x5')](_0x1e1f39,_0x550c5c);};}exports[_0x5460('0x6')]=function(_0xca3553){for(var _0x39cad0=0x0,_0x5ae55d=events[_0x5460('0x7')];_0x39cad0<_0x5ae55d;_0x39cad0++){var _0x2b86a6=events[_0x39cad0];var _0x568083=createListener(_0x5460('0x8')+_0x2b86a6,_0xca3553);FaxQueueEvents['on'](_0x2b86a6,_0x568083);}}; \ No newline at end of file +var _0xf97f=['faxQueue:','./faxQueue.events','save','removeListener','register','length'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xf97f,0xc7));var _0xff97=function(_0x54857a,_0x2a3e8e){_0x54857a=_0x54857a-0x0;var _0x1f06e3=_0xf97f[_0x54857a];return _0x1f06e3;};'use strict';var FaxQueueEvents=require(_0xff97('0x0'));var events=[_0xff97('0x1'),'remove','update'];function createListener(_0x59e18f,_0xa25c47){return function(_0x150c25){_0xa25c47['emit'](_0x59e18f,_0x150c25);};}function removeListener(_0x3439cd,_0x299b24){return function(){FaxQueueEvents[_0xff97('0x2')](_0x3439cd,_0x299b24);};}exports[_0xff97('0x3')]=function(_0x2d19a6){for(var _0x5a6aaa=0x0,_0x2ce0bc=events[_0xff97('0x4')];_0x5a6aaa<_0x2ce0bc;_0x5a6aaa++){var _0x4c302d=events[_0x5a6aaa];var _0x5141fa=createListener(_0xff97('0x5')+_0x4c302d,_0x2d19a6);FaxQueueEvents['on'](_0x4c302d,_0x5141fa);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 743e054..91b1380 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 _0x11e5=['update','destroy','removeTeams','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11e5,0x8b));var _0x511e=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0x11e5[_0x3fe6df];return _0x372a0e;};'use strict';var multer=require(_0x511e('0x0'));var util=require('util');var path=require(_0x511e('0x1'));var timeout=require(_0x511e('0x2'));var express=require('express');var router=express[_0x511e('0x3')]();var fs_extra=require(_0x511e('0x4'));var auth=require(_0x511e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x511e('0x6'));var controller=require('./faxQueue.controller');router['get']('/',auth[_0x511e('0x7')](),controller[_0x511e('0x8')]);router[_0x511e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x511e('0xa')]);router[_0x511e('0x9')](_0x511e('0xb'),auth[_0x511e('0x7')](),controller[_0x511e('0xc')]);router[_0x511e('0x9')](_0x511e('0xd'),auth[_0x511e('0x7')](),controller[_0x511e('0xe')]);router[_0x511e('0x9')](_0x511e('0xf'),auth['isAuthenticated'](),controller[_0x511e('0x10')]);router['get']('/:id/users',auth[_0x511e('0x7')](),controller[_0x511e('0x11')]);router[_0x511e('0x12')]('/',auth[_0x511e('0x7')](),controller[_0x511e('0x13')]);router[_0x511e('0x12')]('/:id/teams',auth[_0x511e('0x7')](),controller[_0x511e('0x14')]);router['post'](_0x511e('0x15'),auth[_0x511e('0x7')](),controller['addAgents']);router[_0x511e('0x16')](_0x511e('0xb'),auth[_0x511e('0x7')](),controller[_0x511e('0x17')]);router['delete'](_0x511e('0xb'),auth[_0x511e('0x7')](),controller[_0x511e('0x18')]);router['delete'](_0x511e('0xf'),auth['isAuthenticated'](),controller[_0x511e('0x19')]);router['delete']('/:id/users',auth[_0x511e('0x7')](),controller['removeAgents']);module[_0x511e('0x1a')]=router; \ No newline at end of file +var _0x1623=['delete','destroy','removeAgents','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxQueue.controller','isAuthenticated','index','/describe','describe','get','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1623,0xab));var _0x3162=function(_0xd0fdd8,_0x162e22){_0xd0fdd8=_0xd0fdd8-0x0;var _0xdbf707=_0x1623[_0xd0fdd8];return _0xdbf707;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0xd')]);router[_0x3162('0xb')]('/:id/members',auth['isAuthenticated'](),controller[_0x3162('0xe')]);router[_0x3162('0xb')](_0x3162('0xf'),auth[_0x3162('0x7')](),controller[_0x3162('0x10')]);router[_0x3162('0xb')](_0x3162('0x11'),auth[_0x3162('0x7')](),controller[_0x3162('0x12')]);router['post']('/',auth[_0x3162('0x7')](),controller['create']);router[_0x3162('0x13')](_0x3162('0xf'),auth['isAuthenticated'](),controller['addTeams']);router[_0x3162('0x13')](_0x3162('0x11'),auth[_0x3162('0x7')](),controller['addAgents']);router[_0x3162('0x14')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller['update']);router[_0x3162('0x15')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0x16')]);router[_0x3162('0x15')](_0x3162('0xf'),auth[_0x3162('0x7')](),controller['removeTeams']);router[_0x3162('0x15')](_0x3162('0x11'),auth[_0x3162('0x7')](),controller[_0x3162('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 5a11fa5..d61e093 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 _0x6d53=['STRING','DATE','moment','sequelize'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x6d53,0x17a));var _0x36d5=function(_0x3fb989,_0x4b69c6){_0x3fb989=_0x3fb989-0x0;var _0x4df03e=_0x6d53[_0x3fb989];return _0x4df03e;};'use strict';var moment=require(_0x36d5('0x0'));var Sequelize=require(_0x36d5('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x36d5('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x36d5('0x2')]},'joinAt':{'type':Sequelize[_0x36d5('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x36d5('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x36d5('0x2')]}}; \ No newline at end of file +var _0x01e3=['moment','sequelize','exports','STRING','DATE'];(function(_0x923df3,_0x5b02c2){var _0x26a4e9=function(_0x504d88){while(--_0x504d88){_0x923df3['push'](_0x923df3['shift']());}};_0x26a4e9(++_0x5b02c2);}(_0x01e3,0x122));var _0x301e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01e3[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x301e('0x0'));var Sequelize=require(_0x301e('0x1'));module[_0x301e('0x2')]={'uniqueid':{'type':Sequelize[_0x301e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x301e('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x301e('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x301e('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index e8146d7..c8c590f 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 _0x9c2c=['catch','show','params','keys','length','include','find','create','body','describe','eml-format','rimraf','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','FaxQueueReport','findAll','rows'];(function(_0x30dbb6,_0x44b94d){var _0x1d0135=function(_0x14ed7a){while(--_0x14ed7a){_0x30dbb6['push'](_0x30dbb6['shift']());}};_0x1d0135(++_0x44b94d);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc9c2('0x0'));var rimraf=require(_0xc9c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc9c2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc9c2('0x3'));var util=require(_0xc9c2('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xc9c2('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9c2('0x6'));var _=require(_0xc9c2('0x7'));var squel=require(_0xc9c2('0x8'));var crypto=require(_0xc9c2('0x9'));var jsforce=require(_0xc9c2('0xa'));var deskjs=require(_0xc9c2('0xb'));var toCsv=require(_0xc9c2('0x5'));var querystring=require(_0xc9c2('0xc'));var Papa=require(_0xc9c2('0xd'));var Redis=require('ioredis');var authService=require(_0xc9c2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc9c2('0xf'));var hardwareService=require(_0xc9c2('0x10'));var logger=require(_0xc9c2('0x11'))(_0xc9c2('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc9c2('0x13'));var db=require(_0xc9c2('0x14'))['db'];function respondWithStatusCode(_0x568f69,_0x7ec780){_0x7ec780=_0x7ec780||0xcc;return function(_0x1f08a7){if(_0x1f08a7){return _0x568f69[_0xc9c2('0x15')](_0x7ec780);}return _0x568f69[_0xc9c2('0x16')](_0x7ec780)[_0xc9c2('0x17')]();};}function respondWithResult(_0x3b0058,_0x33b288){_0x33b288=_0x33b288||0xc8;return function(_0x132702){if(_0x132702){return _0x3b0058[_0xc9c2('0x16')](_0x33b288)[_0xc9c2('0x18')](_0x132702);}};}function respondWithFilteredResult(_0xf94209,_0x383667){return function(_0x480d7c){if(_0x480d7c){var _0x27840d=typeof _0x383667[_0xc9c2('0x19')]===_0xc9c2('0x1a')&&typeof _0x383667[_0xc9c2('0x1b')]===_0xc9c2('0x1a');var _0x49413b=_0x480d7c[_0xc9c2('0x1c')];var _0x37c027=_0x27840d?0x0:_0x383667[_0xc9c2('0x19')];var _0x4e4ded=_0x27840d?_0x480d7c[_0xc9c2('0x1c')]:_0x383667[_0xc9c2('0x19')]+_0x383667[_0xc9c2('0x1b')];var _0x484ca3;if(_0x4e4ded>=_0x49413b){_0x4e4ded=_0x49413b;_0x484ca3=0xc8;}else{_0x484ca3=0xce;}_0xf94209[_0xc9c2('0x16')](_0x484ca3);return _0xf94209[_0xc9c2('0x1d')]('Content-Range',_0x37c027+'-'+_0x4e4ded+'/'+_0x49413b)['json'](_0x480d7c);}return null;};}function patchUpdates(_0x37e3){return function(_0x50f280){try{jsonpatch[_0xc9c2('0x1e')](_0x50f280,_0x37e3,!![]);}catch(_0x140c8a){return BPromise[_0xc9c2('0x1f')](_0x140c8a);}return _0x50f280[_0xc9c2('0x20')]();};}function saveUpdates(_0x3e1774,_0x53c460){return function(_0x1fbac4){if(_0x1fbac4){return _0x1fbac4[_0xc9c2('0x21')](_0x3e1774)[_0xc9c2('0x22')](function(_0x11cc07){return _0x11cc07;});}return null;};}function removeEntity(_0x32c372,_0x385030){return function(_0x56e515){if(_0x56e515){return _0x56e515[_0xc9c2('0x23')]()[_0xc9c2('0x22')](function(){_0x32c372['status'](0xcc)[_0xc9c2('0x17')]();});}};}function handleEntityNotFound(_0x4b3b97,_0xa18b32){return function(_0xd803e9){if(!_0xd803e9){_0x4b3b97[_0xc9c2('0x15')](0x194);}return _0xd803e9;};}function handleError(_0x2222e4,_0x484d55){_0x484d55=_0x484d55||0x1f4;return function(_0x2073ef){logger['error'](_0x2073ef[_0xc9c2('0x24')]);if(_0x2073ef[_0xc9c2('0x25')]){delete _0x2073ef[_0xc9c2('0x25')];}_0x2222e4[_0xc9c2('0x16')](_0x484d55)[_0xc9c2('0x26')](_0x2073ef);};}exports['index']=function(_0x3cedb5,_0xe2f93b){var _0x40033a={},_0x1554ae={},_0xa89cb8={'count':0x0,'rows':[]};var _0x460832=_[_0xc9c2('0x27')](db['FaxQueueReport'][_0xc9c2('0x28')],function(_0x4a9fca){return{'name':_0x4a9fca[_0xc9c2('0x29')],'type':_0x4a9fca[_0xc9c2('0x2a')]['key']};});_0x1554ae[_0xc9c2('0x2b')]=_[_0xc9c2('0x27')](_0x460832,_0xc9c2('0x25'));_0x1554ae[_0xc9c2('0x2c')]=_['keys'](_0x3cedb5[_0xc9c2('0x2c')]);_0x1554ae[_0xc9c2('0x2d')]=_['intersection'](_0x1554ae['model'],_0x1554ae[_0xc9c2('0x2c')]);_0x40033a[_0xc9c2('0x2e')]=_[_0xc9c2('0x2f')](_0x1554ae['model'],qs['fields'](_0x3cedb5[_0xc9c2('0x2c')][_0xc9c2('0x30')]));_0x40033a['attributes']=_0x40033a[_0xc9c2('0x2e')]['length']?_0x40033a[_0xc9c2('0x2e')]:_0x1554ae[_0xc9c2('0x2b')];if(!_0x3cedb5[_0xc9c2('0x2c')][_0xc9c2('0x31')](_0xc9c2('0x32'))){_0x40033a[_0xc9c2('0x1b')]=qs[_0xc9c2('0x1b')](_0x3cedb5[_0xc9c2('0x2c')][_0xc9c2('0x1b')]);_0x40033a['offset']=qs[_0xc9c2('0x19')](_0x3cedb5['query'][_0xc9c2('0x19')]);}_0x40033a[_0xc9c2('0x33')]=qs['sort'](_0x3cedb5[_0xc9c2('0x2c')][_0xc9c2('0x34')]);_0x40033a['where']=qs[_0xc9c2('0x2d')](_[_0xc9c2('0x35')](_0x3cedb5[_0xc9c2('0x2c')],_0x1554ae['filters']),_0x460832);if(_0x3cedb5[_0xc9c2('0x2c')]['filter']){_0x40033a[_0xc9c2('0x36')]=_[_0xc9c2('0x37')](_0x40033a['where'],{'$or':_[_0xc9c2('0x27')](_0x460832,function(_0x3f718a){if(_0x3f718a[_0xc9c2('0x2a')]!==_0xc9c2('0x38')){var _0x3f9248={};_0x3f9248[_0x3f718a[_0xc9c2('0x25')]]={'$like':'%'+_0x3cedb5[_0xc9c2('0x2c')][_0xc9c2('0x39')]+'%'};return _0x3f9248;}})});}_0x40033a=_[_0xc9c2('0x37')]({},_0x40033a,_0x3cedb5[_0xc9c2('0x3a')]);var _0x8d6710={'where':_0x40033a['where']};return db['FaxQueueReport'][_0xc9c2('0x1c')](_0x8d6710)[_0xc9c2('0x22')](function(_0x4507c9){_0xa89cb8[_0xc9c2('0x1c')]=_0x4507c9;if(_0x3cedb5[_0xc9c2('0x2c')][_0xc9c2('0x3b')]){_0x40033a['include']=[{'all':!![]}];}return db[_0xc9c2('0x3c')][_0xc9c2('0x3d')](_0x40033a);})[_0xc9c2('0x22')](function(_0x46c740){_0xa89cb8[_0xc9c2('0x3e')]=_0x46c740;return _0xa89cb8;})['then'](respondWithFilteredResult(_0xe2f93b,_0x40033a))[_0xc9c2('0x3f')](handleError(_0xe2f93b,null));};exports[_0xc9c2('0x40')]=function(_0x2126f8,_0x4f6bc9){var _0x3a05f8={'raw':!![],'where':{'id':_0x2126f8[_0xc9c2('0x41')]['id']}},_0xd3d946={};_0xd3d946[_0xc9c2('0x2b')]=_[_0xc9c2('0x42')](db['FaxQueueReport']['rawAttributes']);_0xd3d946[_0xc9c2('0x2c')]=_[_0xc9c2('0x42')](_0x2126f8['query']);_0xd3d946[_0xc9c2('0x2d')]=_[_0xc9c2('0x2f')](_0xd3d946[_0xc9c2('0x2b')],_0xd3d946[_0xc9c2('0x2c')]);_0x3a05f8[_0xc9c2('0x2e')]=_[_0xc9c2('0x2f')](_0xd3d946[_0xc9c2('0x2b')],qs['fields'](_0x2126f8[_0xc9c2('0x2c')]['fields']));_0x3a05f8[_0xc9c2('0x2e')]=_0x3a05f8['attributes'][_0xc9c2('0x43')]?_0x3a05f8['attributes']:_0xd3d946[_0xc9c2('0x2b')];if(_0x2126f8['query'][_0xc9c2('0x3b')]){_0x3a05f8[_0xc9c2('0x44')]=[{'all':!![]}];}_0x3a05f8=_[_0xc9c2('0x37')]({},_0x3a05f8,_0x2126f8[_0xc9c2('0x3a')]);return db[_0xc9c2('0x3c')][_0xc9c2('0x45')](_0x3a05f8)[_0xc9c2('0x22')](handleEntityNotFound(_0x4f6bc9,null))['then'](respondWithResult(_0x4f6bc9,null))[_0xc9c2('0x3f')](handleError(_0x4f6bc9,null));};exports[_0xc9c2('0x46')]=function(_0x412df0,_0xad73d4){return db[_0xc9c2('0x3c')][_0xc9c2('0x46')](_0x412df0['body'],{})[_0xc9c2('0x22')](respondWithResult(_0xad73d4,0xc9))[_0xc9c2('0x3f')](handleError(_0xad73d4,null));};exports[_0xc9c2('0x21')]=function(_0x88fa84,_0x2e9925){if(_0x88fa84[_0xc9c2('0x47')]['id']){delete _0x88fa84[_0xc9c2('0x47')]['id'];}return db[_0xc9c2('0x3c')]['find']({'where':{'id':_0x88fa84[_0xc9c2('0x41')]['id']}})[_0xc9c2('0x22')](handleEntityNotFound(_0x2e9925,null))[_0xc9c2('0x22')](saveUpdates(_0x88fa84[_0xc9c2('0x47')],null))[_0xc9c2('0x22')](respondWithResult(_0x2e9925,null))['catch'](handleError(_0x2e9925,null));};exports[_0xc9c2('0x23')]=function(_0x4e2589,_0xdedc7c){return db['FaxQueueReport'][_0xc9c2('0x45')]({'where':{'id':_0x4e2589['params']['id']}})[_0xc9c2('0x22')](handleEntityNotFound(_0xdedc7c,null))['then'](removeEntity(_0xdedc7c,null))['catch'](handleError(_0xdedc7c,null));};exports[_0xc9c2('0x48')]=function(_0x45f11e,_0x355d57){return db[_0xc9c2('0x3c')][_0xc9c2('0x48')]()[_0xc9c2('0x22')](respondWithResult(_0x355d57,null))[_0xc9c2('0x3f')](handleError(_0x355d57,null));}; \ No newline at end of file +var _0xf958=['order','sort','where','pick','filter','merge','type','options','count','include','findAll','rows','catch','params','includeAll','find','create','body','destroy','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','offset','Content-Range','reject','save','then','error','name','send','map','FaxQueueReport','rawAttributes','fieldName','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x298949,_0x449add){var _0xecbfe1=function(_0x3fd157){while(--_0x3fd157){_0x298949['push'](_0x298949['shift']());}};_0xecbfe1(++_0x449add);}(_0xf958,0xe6));var _0x8f95=function(_0x1a6638,_0x4dc8e3){_0x1a6638=_0x1a6638-0x0;var _0x58ec60=_0xf958[_0x1a6638];return _0x58ec60;};'use strict';var emlformat=require(_0x8f95('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f95('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f95('0x2'));var moment=require('moment');var BPromise=require(_0x8f95('0x3'));var Mustache=require(_0x8f95('0x4'));var util=require(_0x8f95('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8f95('0x6'));var ejs=require(_0x8f95('0x7'));var fs=require('fs');var fs_extra=require(_0x8f95('0x8'));var _=require(_0x8f95('0x9'));var squel=require('squel');var crypto=require(_0x8f95('0xa'));var jsforce=require(_0x8f95('0xb'));var deskjs=require(_0x8f95('0xc'));var toCsv=require(_0x8f95('0x6'));var querystring=require(_0x8f95('0xd'));var Papa=require('papaparse');var Redis=require(_0x8f95('0xe'));var authService=require(_0x8f95('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8f95('0x10'));var hardwareService=require(_0x8f95('0x11'));var logger=require(_0x8f95('0x12'))('api');var utils=require(_0x8f95('0x13'));var config=require(_0x8f95('0x14'));var licenseUtil=require(_0x8f95('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x464cff,_0x158a35){_0x158a35=_0x158a35||0xcc;return function(_0x7fc65f){if(_0x7fc65f){return _0x464cff['sendStatus'](_0x158a35);}return _0x464cff[_0x8f95('0x16')](_0x158a35)[_0x8f95('0x17')]();};}function respondWithResult(_0x230d97,_0x13f9e8){_0x13f9e8=_0x13f9e8||0xc8;return function(_0x12f4d3){if(_0x12f4d3){return _0x230d97[_0x8f95('0x16')](_0x13f9e8)[_0x8f95('0x18')](_0x12f4d3);}};}function respondWithFilteredResult(_0x572747,_0x517c3e){return function(_0x4da5f0){if(_0x4da5f0){var _0x56e816=typeof _0x517c3e['offset']===_0x8f95('0x19')&&typeof _0x517c3e[_0x8f95('0x1a')]===_0x8f95('0x19');var _0x907633=_0x4da5f0['count'];var _0x5da758=_0x56e816?0x0:_0x517c3e[_0x8f95('0x1b')];var _0x17b85b=_0x56e816?_0x4da5f0['count']:_0x517c3e[_0x8f95('0x1b')]+_0x517c3e[_0x8f95('0x1a')];var _0x400849;if(_0x17b85b>=_0x907633){_0x17b85b=_0x907633;_0x400849=0xc8;}else{_0x400849=0xce;}_0x572747[_0x8f95('0x16')](_0x400849);return _0x572747['set'](_0x8f95('0x1c'),_0x5da758+'-'+_0x17b85b+'/'+_0x907633)[_0x8f95('0x18')](_0x4da5f0);}return null;};}function patchUpdates(_0x2b90bf){return function(_0x406da2){try{jsonpatch['apply'](_0x406da2,_0x2b90bf,!![]);}catch(_0x53f819){return BPromise[_0x8f95('0x1d')](_0x53f819);}return _0x406da2[_0x8f95('0x1e')]();};}function saveUpdates(_0x13e7c5,_0x1c7a29){return function(_0x166c3c){if(_0x166c3c){return _0x166c3c['update'](_0x13e7c5)[_0x8f95('0x1f')](function(_0xa3b182){return _0xa3b182;});}return null;};}function removeEntity(_0x4ea420,_0x205c3e){return function(_0x284eb7){if(_0x284eb7){return _0x284eb7['destroy']()[_0x8f95('0x1f')](function(){_0x4ea420[_0x8f95('0x16')](0xcc)[_0x8f95('0x17')]();});}};}function handleEntityNotFound(_0xb00b6f,_0x48d79f){return function(_0x2ef192){if(!_0x2ef192){_0xb00b6f['sendStatus'](0x194);}return _0x2ef192;};}function handleError(_0x4d09c4,_0x3382d8){_0x3382d8=_0x3382d8||0x1f4;return function(_0x5dabb6){logger[_0x8f95('0x20')](_0x5dabb6['stack']);if(_0x5dabb6['name']){delete _0x5dabb6[_0x8f95('0x21')];}_0x4d09c4['status'](_0x3382d8)[_0x8f95('0x22')](_0x5dabb6);};}exports['index']=function(_0x43c843,_0x3fc1d9){var _0x470bf4={},_0x2bb4ea={},_0x467956={'count':0x0,'rows':[]};var _0x28a270=_[_0x8f95('0x23')](db[_0x8f95('0x24')][_0x8f95('0x25')],function(_0x430d53){return{'name':_0x430d53[_0x8f95('0x26')],'type':_0x430d53['type'][_0x8f95('0x27')]};});_0x2bb4ea[_0x8f95('0x28')]=_['map'](_0x28a270,'name');_0x2bb4ea['query']=_[_0x8f95('0x29')](_0x43c843['query']);_0x2bb4ea[_0x8f95('0x2a')]=_['intersection'](_0x2bb4ea['model'],_0x2bb4ea[_0x8f95('0x2b')]);_0x470bf4[_0x8f95('0x2c')]=_[_0x8f95('0x2d')](_0x2bb4ea[_0x8f95('0x28')],qs[_0x8f95('0x2e')](_0x43c843[_0x8f95('0x2b')][_0x8f95('0x2e')]));_0x470bf4[_0x8f95('0x2c')]=_0x470bf4[_0x8f95('0x2c')][_0x8f95('0x2f')]?_0x470bf4['attributes']:_0x2bb4ea[_0x8f95('0x28')];if(!_0x43c843['query'][_0x8f95('0x30')](_0x8f95('0x31'))){_0x470bf4[_0x8f95('0x1a')]=qs[_0x8f95('0x1a')](_0x43c843['query'][_0x8f95('0x1a')]);_0x470bf4[_0x8f95('0x1b')]=qs[_0x8f95('0x1b')](_0x43c843['query']['offset']);}_0x470bf4[_0x8f95('0x32')]=qs[_0x8f95('0x33')](_0x43c843['query'][_0x8f95('0x33')]);_0x470bf4[_0x8f95('0x34')]=qs[_0x8f95('0x2a')](_[_0x8f95('0x35')](_0x43c843[_0x8f95('0x2b')],_0x2bb4ea[_0x8f95('0x2a')]),_0x28a270);if(_0x43c843[_0x8f95('0x2b')][_0x8f95('0x36')]){_0x470bf4[_0x8f95('0x34')]=_[_0x8f95('0x37')](_0x470bf4[_0x8f95('0x34')],{'$or':_[_0x8f95('0x23')](_0x28a270,function(_0x1bf4c3){if(_0x1bf4c3[_0x8f95('0x38')]!=='VIRTUAL'){var _0x9c12d2={};_0x9c12d2[_0x1bf4c3[_0x8f95('0x21')]]={'$like':'%'+_0x43c843[_0x8f95('0x2b')][_0x8f95('0x36')]+'%'};return _0x9c12d2;}})});}_0x470bf4=_[_0x8f95('0x37')]({},_0x470bf4,_0x43c843[_0x8f95('0x39')]);var _0x220e47={'where':_0x470bf4[_0x8f95('0x34')]};return db[_0x8f95('0x24')][_0x8f95('0x3a')](_0x220e47)[_0x8f95('0x1f')](function(_0x5a3ad6){_0x467956[_0x8f95('0x3a')]=_0x5a3ad6;if(_0x43c843[_0x8f95('0x2b')]['includeAll']){_0x470bf4[_0x8f95('0x3b')]=[{'all':!![]}];}return db[_0x8f95('0x24')][_0x8f95('0x3c')](_0x470bf4);})[_0x8f95('0x1f')](function(_0x3a1097){_0x467956[_0x8f95('0x3d')]=_0x3a1097;return _0x467956;})[_0x8f95('0x1f')](respondWithFilteredResult(_0x3fc1d9,_0x470bf4))[_0x8f95('0x3e')](handleError(_0x3fc1d9,null));};exports['show']=function(_0x21e82c,_0x160fcf){var _0x203fa6={'raw':!![],'where':{'id':_0x21e82c[_0x8f95('0x3f')]['id']}},_0x328a72={};_0x328a72[_0x8f95('0x28')]=_['keys'](db[_0x8f95('0x24')][_0x8f95('0x25')]);_0x328a72[_0x8f95('0x2b')]=_[_0x8f95('0x29')](_0x21e82c['query']);_0x328a72['filters']=_['intersection'](_0x328a72[_0x8f95('0x28')],_0x328a72[_0x8f95('0x2b')]);_0x203fa6['attributes']=_[_0x8f95('0x2d')](_0x328a72['model'],qs[_0x8f95('0x2e')](_0x21e82c[_0x8f95('0x2b')]['fields']));_0x203fa6[_0x8f95('0x2c')]=_0x203fa6[_0x8f95('0x2c')][_0x8f95('0x2f')]?_0x203fa6[_0x8f95('0x2c')]:_0x328a72[_0x8f95('0x28')];if(_0x21e82c[_0x8f95('0x2b')][_0x8f95('0x40')]){_0x203fa6[_0x8f95('0x3b')]=[{'all':!![]}];}_0x203fa6=_[_0x8f95('0x37')]({},_0x203fa6,_0x21e82c[_0x8f95('0x39')]);return db['FaxQueueReport'][_0x8f95('0x41')](_0x203fa6)[_0x8f95('0x1f')](handleEntityNotFound(_0x160fcf,null))[_0x8f95('0x1f')](respondWithResult(_0x160fcf,null))[_0x8f95('0x3e')](handleError(_0x160fcf,null));};exports[_0x8f95('0x42')]=function(_0x2c094a,_0x4c21ab){return db[_0x8f95('0x24')][_0x8f95('0x42')](_0x2c094a[_0x8f95('0x43')],{})[_0x8f95('0x1f')](respondWithResult(_0x4c21ab,0xc9))[_0x8f95('0x3e')](handleError(_0x4c21ab,null));};exports['update']=function(_0x335201,_0x301384){if(_0x335201[_0x8f95('0x43')]['id']){delete _0x335201[_0x8f95('0x43')]['id'];}return db[_0x8f95('0x24')][_0x8f95('0x41')]({'where':{'id':_0x335201[_0x8f95('0x3f')]['id']}})['then'](handleEntityNotFound(_0x301384,null))[_0x8f95('0x1f')](saveUpdates(_0x335201[_0x8f95('0x43')],null))[_0x8f95('0x1f')](respondWithResult(_0x301384,null))[_0x8f95('0x3e')](handleError(_0x301384,null));};exports[_0x8f95('0x44')]=function(_0x489813,_0x18464a){return db[_0x8f95('0x24')][_0x8f95('0x41')]({'where':{'id':_0x489813[_0x8f95('0x3f')]['id']}})['then'](handleEntityNotFound(_0x18464a,null))[_0x8f95('0x1f')](removeEntity(_0x18464a,null))[_0x8f95('0x3e')](handleError(_0x18464a,null));};exports[_0x8f95('0x45')]=function(_0xe902de,_0x5aa278){return db[_0x8f95('0x24')][_0x8f95('0x45')]()[_0x8f95('0x1f')](respondWithResult(_0x5aa278,null))[_0x8f95('0x3e')](handleError(_0x5aa278,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 962adc1..6740f8e 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 _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x5554b9,_0x825fd9){var _0x115445=function(_0x50759a){while(--_0x50759a){_0x5554b9['push'](_0x5554b9['shift']());}};_0x115445(++_0x825fd9);}(_0x7a54,0x106));var _0x47a5=function(_0x6317c6,_0x4f84ef){_0x6317c6=_0x6317c6-0x0;var _0x21e73f=_0x7a54[_0x6317c6];return _0x21e73f;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x43fb86,_0xebd024){var _0x99fb7e=function(_0x5edf73){while(--_0x5edf73){_0x43fb86['push'](_0x43fb86['shift']());}};_0x99fb7e(++_0xebd024);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc4aa[_0x4f9b18];return _0x29f20c;};'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/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 705e44f..94b9bdb 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 _0xf064=['update','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xf064,0x176));var _0x4f06=function(_0x3da612,_0x332456){_0x3da612=_0x3da612-0x0;var _0x1a9d1d=_0xf064[_0x3da612];return _0x1a9d1d;};'use strict';var _=require(_0x4f06('0x0'));var util=require(_0x4f06('0x1'));var moment=require('moment');var BPromise=require(_0x4f06('0x2'));var rs=require(_0x4f06('0x3'));var fs=require('fs');var Redis=require(_0x4f06('0x4'));var db=require(_0x4f06('0x5'))['db'];var utils=require(_0x4f06('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4f06('0x7'));var jayson=require(_0x4f06('0x8'));var client=jayson['client'][_0x4f06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fe38d,_0x2079fd,_0xf2458f){return new BPromise(function(_0x3a0eb1,_0x32c521){return client[_0x4f06('0xa')](_0x2fe38d,_0xf2458f)[_0x4f06('0xb')](function(_0x3e152d){logger[_0x4f06('0xc')](_0x4f06('0xd'),_0x2079fd,_0x4f06('0xe'));logger[_0x4f06('0xf')](_0x4f06('0x10'),_0x2079fd,_0x4f06('0xe'),JSON[_0x4f06('0x11')](_0x3e152d));if(_0x3e152d['error']){if(_0x3e152d[_0x4f06('0x12')][_0x4f06('0x13')]===0x1f4){logger[_0x4f06('0x12')](_0x4f06('0xd'),_0x2079fd,_0x3e152d[_0x4f06('0x12')][_0x4f06('0x14')]);return _0x32c521(_0x3e152d[_0x4f06('0x12')][_0x4f06('0x14')]);}logger['error'](_0x4f06('0xd'),_0x2079fd,_0x3e152d['error'][_0x4f06('0x14')]);return _0x3a0eb1(_0x3e152d[_0x4f06('0x12')][_0x4f06('0x14')]);}else{logger[_0x4f06('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x2079fd,_0x4f06('0xe'));_0x3a0eb1(_0x3e152d['result']['message']);}})[_0x4f06('0x15')](function(_0x17fc90){logger['error'](_0x4f06('0xd'),_0x2079fd,_0x17fc90);_0x32c521(_0x17fc90);});});}exports[_0x4f06('0x16')]=function(_0x2bc419){var _0x220c8f=this;return new Promise(function(_0x3db923,_0x4f3e2e){return db[_0x4f06('0x17')][_0x4f06('0x18')](_0x2bc419[_0x4f06('0x19')],{'raw':_0x2bc419['options']?_0x2bc419[_0x4f06('0x1a')][_0x4f06('0x1b')]===undefined?!![]:![]:!![]})[_0x4f06('0xb')](function(_0x4c4d8e){logger[_0x4f06('0xc')]('CreateFaxQueueReport',_0x2bc419);logger[_0x4f06('0xf')](_0x4f06('0x16'),_0x2bc419,JSON[_0x4f06('0x11')](_0x4c4d8e));_0x3db923(_0x4c4d8e);})[_0x4f06('0x15')](function(_0x305610){logger[_0x4f06('0x12')](_0x4f06('0x16'),_0x305610['message'],_0x2bc419);_0x4f3e2e(_0x220c8f[_0x4f06('0x12')](0x1f4,_0x305610['message']));});});};exports[_0x4f06('0x1c')]=function(_0x29df65){var _0x391fd4=this;return new Promise(function(_0x2fb160,_0x3ae20d){return db[_0x4f06('0x17')][_0x4f06('0x1d')](_0x29df65['body'],{'raw':_0x29df65[_0x4f06('0x1a')]?_0x29df65[_0x4f06('0x1a')][_0x4f06('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29df65[_0x4f06('0x1a')]?_0x29df65['options'][_0x4f06('0x1e')]||null:null,'attributes':_0x29df65['options']?_0x29df65[_0x4f06('0x1a')]['attributes']||null:null,'limit':_0x29df65['options']?_0x29df65[_0x4f06('0x1a')]['limit']||null:null})['then'](function(_0x4a4e91){logger['info'](_0x4f06('0x1c'),_0x29df65);logger[_0x4f06('0xf')](_0x4f06('0x1c'),_0x29df65,JSON['stringify'](_0x4a4e91));_0x2fb160(_0x4a4e91);})[_0x4f06('0x15')](function(_0x48fa50){logger[_0x4f06('0x12')](_0x4f06('0x1c'),_0x48fa50[_0x4f06('0x14')],_0x29df65);_0x3ae20d(_0x391fd4[_0x4f06('0x12')](0x1f4,_0x48fa50['message']));});});}; \ No newline at end of file +var _0x22c2=['body','options','then','update','raw','where','limit','UpdateFaxQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','FaxQueueReport,\x20%s,\x20%s','catch','CreateFaxQueueReport','FaxQueueReport','create'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x22c2,0x168));var _0x222c=function(_0x4e19f8,_0x3173b6){_0x4e19f8=_0x4e19f8-0x0;var _0x2d2b3d=_0x22c2[_0x4e19f8];return _0x2d2b3d;};'use strict';var _=require(_0x222c('0x0'));var util=require('util');var moment=require(_0x222c('0x1'));var BPromise=require(_0x222c('0x2'));var rs=require(_0x222c('0x3'));var fs=require('fs');var Redis=require(_0x222c('0x4'));var db=require(_0x222c('0x5'))['db'];var utils=require(_0x222c('0x6'));var logger=require(_0x222c('0x7'))(_0x222c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x222c('0x9')][_0x222c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2542d4,_0x3afc79,_0x72f8a6){return new BPromise(function(_0x1fc140,_0x1e6a18){return client[_0x222c('0xb')](_0x2542d4,_0x72f8a6)['then'](function(_0x48a6e9){logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x3afc79,_0x222c('0xc'));logger[_0x222c('0xd')](_0x222c('0xe'),_0x3afc79,_0x222c('0xc'),JSON[_0x222c('0xf')](_0x48a6e9));if(_0x48a6e9['error']){if(_0x48a6e9[_0x222c('0x10')]['code']===0x1f4){logger[_0x222c('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x3afc79,_0x48a6e9[_0x222c('0x10')][_0x222c('0x11')]);return _0x1e6a18(_0x48a6e9[_0x222c('0x10')]['message']);}logger[_0x222c('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x3afc79,_0x48a6e9[_0x222c('0x10')]['message']);return _0x1fc140(_0x48a6e9[_0x222c('0x10')][_0x222c('0x11')]);}else{logger[_0x222c('0x12')](_0x222c('0x13'),_0x3afc79,_0x222c('0xc'));_0x1fc140(_0x48a6e9['result'][_0x222c('0x11')]);}})[_0x222c('0x14')](function(_0xb94c11){logger['error'](_0x222c('0x13'),_0x3afc79,_0xb94c11);_0x1e6a18(_0xb94c11);});});}exports[_0x222c('0x15')]=function(_0x4feb70){var _0x2e1157=this;return new Promise(function(_0x4f0294,_0x23c86){return db[_0x222c('0x16')][_0x222c('0x17')](_0x4feb70[_0x222c('0x18')],{'raw':_0x4feb70[_0x222c('0x19')]?_0x4feb70[_0x222c('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x222c('0x1a')](function(_0x3bc284){logger[_0x222c('0x12')](_0x222c('0x15'),_0x4feb70);logger['debug']('CreateFaxQueueReport',_0x4feb70,JSON[_0x222c('0xf')](_0x3bc284));_0x4f0294(_0x3bc284);})['catch'](function(_0x200125){logger[_0x222c('0x10')](_0x222c('0x15'),_0x200125[_0x222c('0x11')],_0x4feb70);_0x23c86(_0x2e1157[_0x222c('0x10')](0x1f4,_0x200125[_0x222c('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0x31212e){var _0x248d7c=this;return new Promise(function(_0x2b9973,_0x572111){return db['FaxQueueReport'][_0x222c('0x1b')](_0x31212e[_0x222c('0x18')],{'raw':_0x31212e[_0x222c('0x19')]?_0x31212e[_0x222c('0x19')][_0x222c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31212e['options']?_0x31212e[_0x222c('0x19')][_0x222c('0x1d')]||null:null,'attributes':_0x31212e[_0x222c('0x19')]?_0x31212e[_0x222c('0x19')]['attributes']||null:null,'limit':_0x31212e[_0x222c('0x19')]?_0x31212e[_0x222c('0x19')][_0x222c('0x1e')]||null:null})['then'](function(_0x375fd3){logger['info'](_0x222c('0x1f'),_0x31212e);logger[_0x222c('0xd')](_0x222c('0x1f'),_0x31212e,JSON[_0x222c('0xf')](_0x375fd3));_0x2b9973(_0x375fd3);})[_0x222c('0x14')](function(_0x3c23a2){logger[_0x222c('0x10')](_0x222c('0x1f'),_0x3c23a2['message'],_0x31212e);_0x572111(_0x248d7c[_0x222c('0x10')](0x1f4,_0x3c23a2[_0x222c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 2a6f530..c56938e 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 _0x72cd=['destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create'];(function(_0x10a0ce,_0x54168d){var _0x3cc655=function(_0x3a734b){while(--_0x3a734b){_0x10a0ce['push'](_0x10a0ce['shift']());}};_0x3cc655(++_0x54168d);}(_0x72cd,0x10f));var _0xd72c=function(_0x293b7d,_0xd02601){_0x293b7d=_0x293b7d-0x0;var _0x32c4b7=_0x72cd[_0x293b7d];return _0x32c4b7;};'use strict';var multer=require('multer');var util=require(_0xd72c('0x0'));var path=require(_0xd72c('0x1'));var timeout=require('connect-timeout');var express=require(_0xd72c('0x2'));var router=express['Router']();var fs_extra=require(_0xd72c('0x3'));var auth=require(_0xd72c('0x4'));var interaction=require(_0xd72c('0x5'));var config=require(_0xd72c('0x6'));var controller=require(_0xd72c('0x7'));router[_0xd72c('0x8')]('/',auth['isAuthenticated'](),controller[_0xd72c('0x9')]);router[_0xd72c('0x8')](_0xd72c('0xa'),auth['isAuthenticated'](),controller[_0xd72c('0xb')]);router[_0xd72c('0x8')](_0xd72c('0xc'),auth[_0xd72c('0xd')](),controller[_0xd72c('0xe')]);router[_0xd72c('0xf')]('/',auth['isAuthenticated'](),controller[_0xd72c('0x10')]);router['put']('/:id',auth[_0xd72c('0xd')](),controller['update']);router['delete'](_0xd72c('0xc'),auth[_0xd72c('0xd')](),controller[_0xd72c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x61c5=['put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0xb91420,_0x1ddde1){var _0x5b423=function(_0x118d06){while(--_0x118d06){_0xb91420['push'](_0xb91420['shift']());}};_0x5b423(++_0x1ddde1);}(_0x61c5,0xc1));var _0x561c=function(_0x4b288c,_0x4dea83){_0x4b288c=_0x4b288c-0x0;var _0x18e473=_0x61c5[_0x4b288c];return _0x18e473;};'use strict';var multer=require(_0x561c('0x0'));var util=require('util');var path=require(_0x561c('0x1'));var timeout=require(_0x561c('0x2'));var express=require(_0x561c('0x3'));var router=express[_0x561c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x561c('0x5'));var interaction=require(_0x561c('0x6'));var config=require(_0x561c('0x7'));var controller=require('./faxQueueReport.controller');router[_0x561c('0x8')]('/',auth[_0x561c('0x9')](),controller[_0x561c('0xa')]);router[_0x561c('0x8')](_0x561c('0xb'),auth[_0x561c('0x9')](),controller[_0x561c('0xc')]);router[_0x561c('0x8')](_0x561c('0xd'),auth[_0x561c('0x9')](),controller[_0x561c('0xe')]);router[_0x561c('0xf')]('/',auth[_0x561c('0x9')](),controller[_0x561c('0x10')]);router[_0x561c('0x11')](_0x561c('0xd'),auth[_0x561c('0x9')](),controller[_0x561c('0x12')]);router[_0x561c('0x13')](_0x561c('0xd'),auth[_0x561c('0x9')](),controller[_0x561c('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index b7b8754..3504e66 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x293691,_0x177c0b){var _0x3d163d=function(_0x3f91b2){while(--_0x3f91b2){_0x293691['push'](_0x293691['shift']());}};_0x3d163d(++_0x177c0b);}(_0x70e0,0x17b));var _0x070e=function(_0x460c35,_0x46a003){_0x460c35=_0x460c35-0x0;var _0x166ba5=_0x70e0[_0x460c35];return _0x166ba5;};'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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x3f41c7,_0x404b79){var _0x49cec5=function(_0x4000e9){while(--_0x4000e9){_0x3f41c7['push'](_0x3f41c7['shift']());}};_0x49cec5(++_0x404b79);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xcb91[_0x2aa0e7];return _0x1472c0;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 0a5633c..7b4c168 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 _0x0edd=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0edd,0x11a));var _0xd0ed=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0edd[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0xd0ed('0x0'));var rimraf=require(_0xd0ed('0x1'));var zipdir=require(_0xd0ed('0x2'));var jsonpatch=require(_0xd0ed('0x3'));var rp=require(_0xd0ed('0x4'));var moment=require(_0xd0ed('0x5'));var BPromise=require(_0xd0ed('0x6'));var Mustache=require(_0xd0ed('0x7'));var util=require(_0xd0ed('0x8'));var path=require(_0xd0ed('0x9'));var sox=require(_0xd0ed('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd0ed('0xb'));var _=require(_0xd0ed('0xc'));var squel=require(_0xd0ed('0xd'));var crypto=require(_0xd0ed('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd0ed('0xf'));var toCsv=require(_0xd0ed('0x10'));var querystring=require(_0xd0ed('0x11'));var Papa=require(_0xd0ed('0x12'));var Redis=require(_0xd0ed('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd0ed('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0ed('0x15'));var logger=require(_0xd0ed('0x16'))(_0xd0ed('0x17'));var utils=require(_0xd0ed('0x18'));var config=require(_0xd0ed('0x19'));var licenseUtil=require(_0xd0ed('0x1a'));var db=require(_0xd0ed('0x1b'))['db'];function respondWithStatusCode(_0x2e5671,_0x8a499d){_0x8a499d=_0x8a499d||0xcc;return function(_0x49b501){if(_0x49b501){return _0x2e5671[_0xd0ed('0x1c')](_0x8a499d);}return _0x2e5671[_0xd0ed('0x1d')](_0x8a499d)[_0xd0ed('0x1e')]();};}function respondWithResult(_0x138f32,_0x4ad205){_0x4ad205=_0x4ad205||0xc8;return function(_0x1ceae7){if(_0x1ceae7){return _0x138f32[_0xd0ed('0x1d')](_0x4ad205)[_0xd0ed('0x1f')](_0x1ceae7);}};}function respondWithFilteredResult(_0x1811de,_0x222275){return function(_0x1269d9){if(_0x1269d9){var _0x5df97f=typeof _0x222275[_0xd0ed('0x20')]===_0xd0ed('0x21')&&typeof _0x222275[_0xd0ed('0x22')]==='undefined';var _0x390f5a=_0x1269d9[_0xd0ed('0x23')];var _0x330cdb=_0x5df97f?0x0:_0x222275[_0xd0ed('0x20')];var _0x5bd582=_0x5df97f?_0x1269d9[_0xd0ed('0x23')]:_0x222275[_0xd0ed('0x20')]+_0x222275[_0xd0ed('0x22')];var _0x3ccd77;if(_0x5bd582>=_0x390f5a){_0x5bd582=_0x390f5a;_0x3ccd77=0xc8;}else{_0x3ccd77=0xce;}_0x1811de[_0xd0ed('0x1d')](_0x3ccd77);return _0x1811de[_0xd0ed('0x24')](_0xd0ed('0x25'),_0x330cdb+'-'+_0x5bd582+'/'+_0x390f5a)[_0xd0ed('0x1f')](_0x1269d9);}return null;};}function patchUpdates(_0x526be8){return function(_0x11d282){try{jsonpatch[_0xd0ed('0x26')](_0x11d282,_0x526be8,!![]);}catch(_0x2b2314){return BPromise[_0xd0ed('0x27')](_0x2b2314);}return _0x11d282[_0xd0ed('0x28')]();};}function saveUpdates(_0x40dab6,_0x573aff){return function(_0x47955c){if(_0x47955c){return _0x47955c[_0xd0ed('0x29')](_0x40dab6)[_0xd0ed('0x2a')](function(_0x3339f4){return _0x3339f4;});}return null;};}function removeEntity(_0xe71c5a,_0x321738){return function(_0x459462){if(_0x459462){return _0x459462['destroy']()[_0xd0ed('0x2a')](function(){_0xe71c5a['status'](0xcc)[_0xd0ed('0x1e')]();});}};}function handleEntityNotFound(_0xd0f1f3,_0x3fb8b2){return function(_0x40b388){if(!_0x40b388){_0xd0f1f3[_0xd0ed('0x1c')](0x194);}return _0x40b388;};}function handleError(_0x316ae4,_0x208918){_0x208918=_0x208918||0x1f4;return function(_0x2b96f0){logger[_0xd0ed('0x2b')](_0x2b96f0[_0xd0ed('0x2c')]);if(_0x2b96f0['name']){delete _0x2b96f0[_0xd0ed('0x2d')];}_0x316ae4[_0xd0ed('0x1d')](_0x208918)[_0xd0ed('0x2e')](_0x2b96f0);};}exports['index']=function(_0x26fc62,_0x58bb24){var _0x4ec8f3={},_0x1c79dd={},_0x4d1dd7={'count':0x0,'rows':[]};var _0x5b8485=_[_0xd0ed('0x2f')](db[_0xd0ed('0x30')][_0xd0ed('0x31')],function(_0x41678e){return{'name':_0x41678e[_0xd0ed('0x32')],'type':_0x41678e[_0xd0ed('0x33')][_0xd0ed('0x34')]};});_0x1c79dd[_0xd0ed('0x35')]=_[_0xd0ed('0x2f')](_0x5b8485,_0xd0ed('0x2d'));_0x1c79dd[_0xd0ed('0x36')]=_['keys'](_0x26fc62['query']);_0x1c79dd[_0xd0ed('0x37')]=_['intersection'](_0x1c79dd['model'],_0x1c79dd['query']);_0x4ec8f3[_0xd0ed('0x38')]=_[_0xd0ed('0x39')](_0x1c79dd[_0xd0ed('0x35')],qs[_0xd0ed('0x3a')](_0x26fc62[_0xd0ed('0x36')][_0xd0ed('0x3a')]));_0x4ec8f3[_0xd0ed('0x38')]=_0x4ec8f3[_0xd0ed('0x38')][_0xd0ed('0x3b')]?_0x4ec8f3[_0xd0ed('0x38')]:_0x1c79dd[_0xd0ed('0x35')];if(!_0x26fc62[_0xd0ed('0x36')][_0xd0ed('0x3c')](_0xd0ed('0x3d'))){_0x4ec8f3[_0xd0ed('0x22')]=qs[_0xd0ed('0x22')](_0x26fc62[_0xd0ed('0x36')][_0xd0ed('0x22')]);_0x4ec8f3['offset']=qs[_0xd0ed('0x20')](_0x26fc62[_0xd0ed('0x36')][_0xd0ed('0x20')]);}_0x4ec8f3['order']=qs[_0xd0ed('0x3e')](_0x26fc62[_0xd0ed('0x36')]['sort']);_0x4ec8f3[_0xd0ed('0x3f')]=qs[_0xd0ed('0x37')](_['pick'](_0x26fc62['query'],_0x1c79dd[_0xd0ed('0x37')]),_0x5b8485);if(_0x26fc62[_0xd0ed('0x36')][_0xd0ed('0x40')]){_0x4ec8f3[_0xd0ed('0x3f')]=_[_0xd0ed('0x41')](_0x4ec8f3[_0xd0ed('0x3f')],{'$or':_[_0xd0ed('0x2f')](_0x5b8485,function(_0x1319c4){if(_0x1319c4['type']!=='VIRTUAL'){var _0x334bce={};_0x334bce[_0x1319c4[_0xd0ed('0x2d')]]={'$like':'%'+_0x26fc62[_0xd0ed('0x36')][_0xd0ed('0x40')]+'%'};return _0x334bce;}})});}_0x4ec8f3=_[_0xd0ed('0x41')]({},_0x4ec8f3,_0x26fc62[_0xd0ed('0x42')]);var _0xcc7912={'where':_0x4ec8f3[_0xd0ed('0x3f')]};return db[_0xd0ed('0x30')]['count'](_0xcc7912)[_0xd0ed('0x2a')](function(_0x4e3ea9){_0x4d1dd7[_0xd0ed('0x23')]=_0x4e3ea9;if(_0x26fc62['query'][_0xd0ed('0x43')]){_0x4ec8f3['include']=[{'all':!![]}];}return db[_0xd0ed('0x30')]['findAll'](_0x4ec8f3);})[_0xd0ed('0x2a')](function(_0x41b0fd){_0x4d1dd7['rows']=_0x41b0fd;return _0x4d1dd7;})[_0xd0ed('0x2a')](respondWithFilteredResult(_0x58bb24,_0x4ec8f3))[_0xd0ed('0x44')](handleError(_0x58bb24,null));};exports[_0xd0ed('0x45')]=function(_0x30a900,_0x17612d){var _0x1c9efe={'raw':!![],'where':{'id':_0x30a900[_0xd0ed('0x46')]['id']}},_0x253335={};_0x253335[_0xd0ed('0x35')]=_[_0xd0ed('0x47')](db['FaxTransferReport'][_0xd0ed('0x31')]);_0x253335[_0xd0ed('0x36')]=_['keys'](_0x30a900['query']);_0x253335[_0xd0ed('0x37')]=_[_0xd0ed('0x39')](_0x253335[_0xd0ed('0x35')],_0x253335[_0xd0ed('0x36')]);_0x1c9efe['attributes']=_[_0xd0ed('0x39')](_0x253335[_0xd0ed('0x35')],qs['fields'](_0x30a900[_0xd0ed('0x36')][_0xd0ed('0x3a')]));_0x1c9efe[_0xd0ed('0x38')]=_0x1c9efe[_0xd0ed('0x38')][_0xd0ed('0x3b')]?_0x1c9efe[_0xd0ed('0x38')]:_0x253335[_0xd0ed('0x35')];if(_0x30a900[_0xd0ed('0x36')][_0xd0ed('0x43')]){_0x1c9efe[_0xd0ed('0x48')]=[{'all':!![]}];}_0x1c9efe=_[_0xd0ed('0x41')]({},_0x1c9efe,_0x30a900[_0xd0ed('0x42')]);return db['FaxTransferReport'][_0xd0ed('0x49')](_0x1c9efe)['then'](handleEntityNotFound(_0x17612d,null))[_0xd0ed('0x2a')](respondWithResult(_0x17612d,null))[_0xd0ed('0x44')](handleError(_0x17612d,null));};exports[_0xd0ed('0x4a')]=function(_0x470c3d,_0x2413bb){return db[_0xd0ed('0x30')][_0xd0ed('0x4a')](_0x470c3d['body'],{})[_0xd0ed('0x2a')](respondWithResult(_0x2413bb,0xc9))[_0xd0ed('0x44')](handleError(_0x2413bb,null));};exports['update']=function(_0x3153e4,_0x1d0518){if(_0x3153e4[_0xd0ed('0x4b')]['id']){delete _0x3153e4['body']['id'];}return db[_0xd0ed('0x30')][_0xd0ed('0x49')]({'where':{'id':_0x3153e4[_0xd0ed('0x46')]['id']}})[_0xd0ed('0x2a')](handleEntityNotFound(_0x1d0518,null))['then'](saveUpdates(_0x3153e4[_0xd0ed('0x4b')],null))[_0xd0ed('0x2a')](respondWithResult(_0x1d0518,null))['catch'](handleError(_0x1d0518,null));};exports[_0xd0ed('0x4c')]=function(_0x2cf874,_0x32b3d4){return db[_0xd0ed('0x30')][_0xd0ed('0x49')]({'where':{'id':_0x2cf874['params']['id']}})[_0xd0ed('0x2a')](handleEntityNotFound(_0x32b3d4,null))[_0xd0ed('0x2a')](removeEntity(_0x32b3d4,null))[_0xd0ed('0x44')](handleError(_0x32b3d4,null));};exports[_0xd0ed('0x4d')]=function(_0x41e153,_0x41ef50){return db[_0xd0ed('0x30')][_0xd0ed('0x4d')]()[_0xd0ed('0x2a')](respondWithResult(_0x41ef50,null))['catch'](handleError(_0x41ef50,null));}; \ No newline at end of file +var _0xf11e=['map','FaxTransferReport','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','params','rawAttributes','include','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','reject','update','then','destroy','sendStatus','error','index'];(function(_0x402d0e,_0x5da4d7){var _0x34b9fa=function(_0x36a4d3){while(--_0x36a4d3){_0x402d0e['push'](_0x402d0e['shift']());}};_0x34b9fa(++_0x5da4d7);}(_0xf11e,0xba));var _0xef11=function(_0x3cbef2,_0x25abb4){_0x3cbef2=_0x3cbef2-0x0;var _0x1a89e8=_0xf11e[_0x3cbef2];return _0x1a89e8;};'use strict';var emlformat=require(_0xef11('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef11('0x1'));var jsonpatch=require(_0xef11('0x2'));var rp=require(_0xef11('0x3'));var moment=require(_0xef11('0x4'));var BPromise=require(_0xef11('0x5'));var Mustache=require(_0xef11('0x6'));var util=require(_0xef11('0x7'));var path=require('path');var sox=require(_0xef11('0x8'));var csv=require(_0xef11('0x9'));var ejs=require(_0xef11('0xa'));var fs=require('fs');var fs_extra=require(_0xef11('0xb'));var _=require(_0xef11('0xc'));var squel=require(_0xef11('0xd'));var crypto=require(_0xef11('0xe'));var jsforce=require(_0xef11('0xf'));var deskjs=require(_0xef11('0x10'));var toCsv=require(_0xef11('0x9'));var querystring=require(_0xef11('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xef11('0x12'));var qs=require(_0xef11('0x13'));var as=require(_0xef11('0x14'));var hardwareService=require(_0xef11('0x15'));var logger=require(_0xef11('0x16'))(_0xef11('0x17'));var utils=require(_0xef11('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xef11('0x19'));var db=require(_0xef11('0x1a'))['db'];function respondWithStatusCode(_0x217187,_0x5321b0){_0x5321b0=_0x5321b0||0xcc;return function(_0x1c8014){if(_0x1c8014){return _0x217187['sendStatus'](_0x5321b0);}return _0x217187[_0xef11('0x1b')](_0x5321b0)[_0xef11('0x1c')]();};}function respondWithResult(_0x4e83aa,_0x130ca3){_0x130ca3=_0x130ca3||0xc8;return function(_0x52eb43){if(_0x52eb43){return _0x4e83aa[_0xef11('0x1b')](_0x130ca3)[_0xef11('0x1d')](_0x52eb43);}};}function respondWithFilteredResult(_0x50696b,_0x9845af){return function(_0x5e6591){if(_0x5e6591){var _0x584277=typeof _0x9845af[_0xef11('0x1e')]===_0xef11('0x1f')&&typeof _0x9845af['limit']===_0xef11('0x1f');var _0x1ce6ee=_0x5e6591[_0xef11('0x20')];var _0x471e54=_0x584277?0x0:_0x9845af[_0xef11('0x1e')];var _0x213acb=_0x584277?_0x5e6591[_0xef11('0x20')]:_0x9845af[_0xef11('0x1e')]+_0x9845af['limit'];var _0x228fd7;if(_0x213acb>=_0x1ce6ee){_0x213acb=_0x1ce6ee;_0x228fd7=0xc8;}else{_0x228fd7=0xce;}_0x50696b[_0xef11('0x1b')](_0x228fd7);return _0x50696b[_0xef11('0x21')](_0xef11('0x22'),_0x471e54+'-'+_0x213acb+'/'+_0x1ce6ee)[_0xef11('0x1d')](_0x5e6591);}return null;};}function patchUpdates(_0x320329){return function(_0x420760){try{jsonpatch['apply'](_0x420760,_0x320329,!![]);}catch(_0x1d9e84){return BPromise[_0xef11('0x23')](_0x1d9e84);}return _0x420760['save']();};}function saveUpdates(_0x5d2345,_0x3ca22c){return function(_0xe10abf){if(_0xe10abf){return _0xe10abf[_0xef11('0x24')](_0x5d2345)[_0xef11('0x25')](function(_0x144b5b){return _0x144b5b;});}return null;};}function removeEntity(_0x4a1c57,_0x371adb){return function(_0x2710bf){if(_0x2710bf){return _0x2710bf[_0xef11('0x26')]()['then'](function(){_0x4a1c57['status'](0xcc)[_0xef11('0x1c')]();});}};}function handleEntityNotFound(_0x4cc7e4,_0xb43733){return function(_0x11fbe0){if(!_0x11fbe0){_0x4cc7e4[_0xef11('0x27')](0x194);}return _0x11fbe0;};}function handleError(_0x1044b4,_0x2f8027){_0x2f8027=_0x2f8027||0x1f4;return function(_0x337858){logger[_0xef11('0x28')](_0x337858['stack']);if(_0x337858['name']){delete _0x337858['name'];}_0x1044b4[_0xef11('0x1b')](_0x2f8027)['send'](_0x337858);};}exports[_0xef11('0x29')]=function(_0x1db360,_0xf85d62){var _0x1b5318={},_0xf2d9ec={},_0x3b3555={'count':0x0,'rows':[]};var _0x58ab7c=_[_0xef11('0x2a')](db[_0xef11('0x2b')]['rawAttributes'],function(_0x850a8){return{'name':_0x850a8[_0xef11('0x2c')],'type':_0x850a8[_0xef11('0x2d')][_0xef11('0x2e')]};});_0xf2d9ec[_0xef11('0x2f')]=_[_0xef11('0x2a')](_0x58ab7c,_0xef11('0x30'));_0xf2d9ec[_0xef11('0x31')]=_[_0xef11('0x32')](_0x1db360[_0xef11('0x31')]);_0xf2d9ec[_0xef11('0x33')]=_[_0xef11('0x34')](_0xf2d9ec[_0xef11('0x2f')],_0xf2d9ec['query']);_0x1b5318[_0xef11('0x35')]=_[_0xef11('0x34')](_0xf2d9ec[_0xef11('0x2f')],qs[_0xef11('0x36')](_0x1db360[_0xef11('0x31')][_0xef11('0x36')]));_0x1b5318[_0xef11('0x35')]=_0x1b5318['attributes'][_0xef11('0x37')]?_0x1b5318[_0xef11('0x35')]:_0xf2d9ec[_0xef11('0x2f')];if(!_0x1db360[_0xef11('0x31')]['hasOwnProperty'](_0xef11('0x38'))){_0x1b5318[_0xef11('0x39')]=qs[_0xef11('0x39')](_0x1db360['query']['limit']);_0x1b5318[_0xef11('0x1e')]=qs[_0xef11('0x1e')](_0x1db360[_0xef11('0x31')][_0xef11('0x1e')]);}_0x1b5318[_0xef11('0x3a')]=qs[_0xef11('0x3b')](_0x1db360[_0xef11('0x31')][_0xef11('0x3b')]);_0x1b5318[_0xef11('0x3c')]=qs[_0xef11('0x33')](_[_0xef11('0x3d')](_0x1db360[_0xef11('0x31')],_0xf2d9ec[_0xef11('0x33')]),_0x58ab7c);if(_0x1db360[_0xef11('0x31')][_0xef11('0x3e')]){_0x1b5318['where']=_[_0xef11('0x3f')](_0x1b5318['where'],{'$or':_[_0xef11('0x2a')](_0x58ab7c,function(_0x219a01){if(_0x219a01[_0xef11('0x2d')]!==_0xef11('0x40')){var _0x2e7dea={};_0x2e7dea[_0x219a01[_0xef11('0x30')]]={'$like':'%'+_0x1db360[_0xef11('0x31')]['filter']+'%'};return _0x2e7dea;}})});}_0x1b5318=_[_0xef11('0x3f')]({},_0x1b5318,_0x1db360['options']);var _0x26aa1a={'where':_0x1b5318['where']};return db['FaxTransferReport'][_0xef11('0x20')](_0x26aa1a)[_0xef11('0x25')](function(_0x26a377){_0x3b3555[_0xef11('0x20')]=_0x26a377;if(_0x1db360[_0xef11('0x31')][_0xef11('0x41')]){_0x1b5318['include']=[{'all':!![]}];}return db[_0xef11('0x2b')]['findAll'](_0x1b5318);})[_0xef11('0x25')](function(_0x13b3af){_0x3b3555[_0xef11('0x42')]=_0x13b3af;return _0x3b3555;})[_0xef11('0x25')](respondWithFilteredResult(_0xf85d62,_0x1b5318))[_0xef11('0x43')](handleError(_0xf85d62,null));};exports['show']=function(_0x33ed97,_0x5b8fa1){var _0x32aa33={'raw':!![],'where':{'id':_0x33ed97[_0xef11('0x44')]['id']}},_0x5f2ccb={};_0x5f2ccb[_0xef11('0x2f')]=_[_0xef11('0x32')](db['FaxTransferReport'][_0xef11('0x45')]);_0x5f2ccb[_0xef11('0x31')]=_[_0xef11('0x32')](_0x33ed97[_0xef11('0x31')]);_0x5f2ccb[_0xef11('0x33')]=_[_0xef11('0x34')](_0x5f2ccb['model'],_0x5f2ccb[_0xef11('0x31')]);_0x32aa33[_0xef11('0x35')]=_[_0xef11('0x34')](_0x5f2ccb[_0xef11('0x2f')],qs[_0xef11('0x36')](_0x33ed97[_0xef11('0x31')][_0xef11('0x36')]));_0x32aa33['attributes']=_0x32aa33[_0xef11('0x35')][_0xef11('0x37')]?_0x32aa33[_0xef11('0x35')]:_0x5f2ccb[_0xef11('0x2f')];if(_0x33ed97[_0xef11('0x31')][_0xef11('0x41')]){_0x32aa33[_0xef11('0x46')]=[{'all':!![]}];}_0x32aa33=_[_0xef11('0x3f')]({},_0x32aa33,_0x33ed97[_0xef11('0x47')]);return db[_0xef11('0x2b')][_0xef11('0x48')](_0x32aa33)[_0xef11('0x25')](handleEntityNotFound(_0x5b8fa1,null))[_0xef11('0x25')](respondWithResult(_0x5b8fa1,null))['catch'](handleError(_0x5b8fa1,null));};exports[_0xef11('0x49')]=function(_0x3c472a,_0x507d78){return db[_0xef11('0x2b')]['create'](_0x3c472a[_0xef11('0x4a')],{})[_0xef11('0x25')](respondWithResult(_0x507d78,0xc9))[_0xef11('0x43')](handleError(_0x507d78,null));};exports[_0xef11('0x24')]=function(_0x2e0c93,_0x30e54d){if(_0x2e0c93['body']['id']){delete _0x2e0c93[_0xef11('0x4a')]['id'];}return db[_0xef11('0x2b')]['find']({'where':{'id':_0x2e0c93['params']['id']}})[_0xef11('0x25')](handleEntityNotFound(_0x30e54d,null))[_0xef11('0x25')](saveUpdates(_0x2e0c93[_0xef11('0x4a')],null))['then'](respondWithResult(_0x30e54d,null))[_0xef11('0x43')](handleError(_0x30e54d,null));};exports['destroy']=function(_0x5212b6,_0x2e4e6d){return db[_0xef11('0x2b')]['find']({'where':{'id':_0x5212b6[_0xef11('0x44')]['id']}})[_0xef11('0x25')](handleEntityNotFound(_0x2e4e6d,null))[_0xef11('0x25')](removeEntity(_0x2e4e6d,null))[_0xef11('0x43')](handleError(_0x2e4e6d,null));};exports[_0xef11('0x4b')]=function(_0x1acc1b,_0x5a73ae){return db['FaxTransferReport'][_0xef11('0x4b')]()[_0xef11('0x25')](respondWithResult(_0x5a73ae,null))[_0xef11('0x43')](handleError(_0x5a73ae,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 7d3543f..1eb3c44 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 _0xeeb9=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xeeb9,0xde));var _0x9eeb=function(_0x684d05,_0x2ca605){_0x684d05=_0x684d05-0x0;var _0xf8f8a0=_0xeeb9[_0x684d05];return _0xf8f8a0;};'use strict';var _=require(_0x9eeb('0x0'));var util=require(_0x9eeb('0x1'));var logger=require(_0x9eeb('0x2'))(_0x9eeb('0x3'));var moment=require(_0x9eeb('0x4'));var BPromise=require('bluebird');var rp=require(_0x9eeb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9eeb('0x6'));var config=require('../../config/environment');var attributes=require(_0x9eeb('0x7'));module[_0x9eeb('0x8')]=function(_0x5871c2,_0x30a1fd){return _0x5871c2[_0x9eeb('0x9')](_0x9eeb('0xa'),attributes,{'tableName':_0x9eeb('0xb'),'paranoid':![],'indexes':[{'name':_0x9eeb('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e38=['exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes'];(function(_0x146aac,_0x378163){var _0x2c0c27=function(_0x4c211a){while(--_0x4c211a){_0x146aac['push'](_0x146aac['shift']());}};_0x2c0c27(++_0x378163);}(_0x9e38,0x155));var _0x89e3=function(_0x3158d2,_0x277d23){_0x3158d2=_0x3158d2-0x0;var _0x57c15a=_0x9e38[_0x3158d2];return _0x57c15a;};'use strict';var _=require(_0x89e3('0x0'));var util=require(_0x89e3('0x1'));var logger=require(_0x89e3('0x2'))(_0x89e3('0x3'));var moment=require(_0x89e3('0x4'));var BPromise=require(_0x89e3('0x5'));var rp=require(_0x89e3('0x6'));var fs=require('fs');var path=require(_0x89e3('0x7'));var rimraf=require(_0x89e3('0x8'));var config=require(_0x89e3('0x9'));var attributes=require(_0x89e3('0xa'));module[_0x89e3('0xb')]=function(_0x424668,_0x592c1f){return _0x424668[_0x89e3('0xc')](_0x89e3('0xd'),attributes,{'tableName':_0x89e3('0xe'),'paranoid':![],'indexes':[{'name':_0x89e3('0xf'),'fields':[_0x89e3('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index daa4803..02d0185 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 _0x536b=['debug','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x536b,0x143));var _0xb536=function(_0x44232b,_0x13fc1b){_0x44232b=_0x44232b-0x0;var _0x3fe401=_0x536b[_0x44232b];return _0x3fe401;};'use strict';var _=require(_0xb536('0x0'));var util=require(_0xb536('0x1'));var moment=require('moment');var BPromise=require(_0xb536('0x2'));var rs=require(_0xb536('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb536('0x4'))['db'];var utils=require(_0xb536('0x5'));var logger=require(_0xb536('0x6'))(_0xb536('0x7'));var config=require('../../config/environment');var jayson=require(_0xb536('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a50a7,_0x1298c4,_0x16d843){return new BPromise(function(_0x5cfd88,_0x4eaa3d){return client[_0xb536('0x9')](_0x5a50a7,_0x16d843)[_0xb536('0xa')](function(_0x5ebc3b){logger['info'](_0xb536('0xb'),_0x1298c4,_0xb536('0xc'));logger[_0xb536('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x1298c4,_0xb536('0xc'),JSON[_0xb536('0xe')](_0x5ebc3b));if(_0x5ebc3b[_0xb536('0xf')]){if(_0x5ebc3b['error'][_0xb536('0x10')]===0x1f4){logger[_0xb536('0xf')](_0xb536('0xb'),_0x1298c4,_0x5ebc3b[_0xb536('0xf')][_0xb536('0x11')]);return _0x4eaa3d(_0x5ebc3b[_0xb536('0xf')]['message']);}logger[_0xb536('0xf')](_0xb536('0xb'),_0x1298c4,_0x5ebc3b['error'][_0xb536('0x11')]);return _0x5cfd88(_0x5ebc3b[_0xb536('0xf')][_0xb536('0x11')]);}else{logger[_0xb536('0x12')](_0xb536('0xb'),_0x1298c4,_0xb536('0xc'));_0x5cfd88(_0x5ebc3b[_0xb536('0x13')][_0xb536('0x11')]);}})[_0xb536('0x14')](function(_0xbbe5aa){logger[_0xb536('0xf')](_0xb536('0xb'),_0x1298c4,_0xbbe5aa);_0x4eaa3d(_0xbbe5aa);});});} \ No newline at end of file +var _0x4c3c=['error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x57b6e6,_0x34212a){var _0x3189a4=function(_0x22733c){while(--_0x22733c){_0x57b6e6['push'](_0x57b6e6['shift']());}};_0x3189a4(++_0x34212a);}(_0x4c3c,0x119));var _0xc4c3=function(_0x117649,_0x51deae){_0x117649=_0x117649-0x0;var _0x492fcb=_0x4c3c[_0x117649];return _0x492fcb;};'use strict';var _=require(_0xc4c3('0x0'));var util=require('util');var moment=require(_0xc4c3('0x1'));var BPromise=require(_0xc4c3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc4c3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc4c3('0x4'));var logger=require(_0xc4c3('0x5'))(_0xc4c3('0x6'));var config=require(_0xc4c3('0x7'));var jayson=require(_0xc4c3('0x8'));var client=jayson[_0xc4c3('0x9')][_0xc4c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381227,_0x47d441,_0x51c4bc){return new BPromise(function(_0x23b36b,_0x118a7f){return client['request'](_0x381227,_0x51c4bc)[_0xc4c3('0xb')](function(_0x592848){logger[_0xc4c3('0xc')](_0xc4c3('0xd'),_0x47d441,_0xc4c3('0xe'));logger[_0xc4c3('0xf')](_0xc4c3('0x10'),_0x47d441,_0xc4c3('0xe'),JSON[_0xc4c3('0x11')](_0x592848));if(_0x592848[_0xc4c3('0x12')]){if(_0x592848['error'][_0xc4c3('0x13')]===0x1f4){logger[_0xc4c3('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x47d441,_0x592848['error'][_0xc4c3('0x14')]);return _0x118a7f(_0x592848['error'][_0xc4c3('0x14')]);}logger['error'](_0xc4c3('0xd'),_0x47d441,_0x592848[_0xc4c3('0x12')][_0xc4c3('0x14')]);return _0x23b36b(_0x592848[_0xc4c3('0x12')][_0xc4c3('0x14')]);}else{logger[_0xc4c3('0xc')](_0xc4c3('0xd'),_0x47d441,_0xc4c3('0xe'));_0x23b36b(_0x592848[_0xc4c3('0x15')][_0xc4c3('0x14')]);}})[_0xc4c3('0x16')](function(_0x4e6de3){logger[_0xc4c3('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x47d441,_0x4e6de3);_0x118a7f(_0x4e6de3);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index c1dcfaf..d07dfe9 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 _0xe6bb=['express','Router','./faxTransferReport.controller','get','index','/describe','/:id','isAuthenticated','create','put','delete','destroy','multer','path','connect-timeout'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xe6bb,0x183));var _0xbe6b=function(_0x471012,_0x59d270){_0x471012=_0x471012-0x0;var _0xa8ca71=_0xe6bb[_0x471012];return _0xa8ca71;};'use strict';var multer=require(_0xbe6b('0x0'));var util=require('util');var path=require(_0xbe6b('0x1'));var timeout=require(_0xbe6b('0x2'));var express=require(_0xbe6b('0x3'));var router=express[_0xbe6b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe6b('0x5'));router[_0xbe6b('0x6')]('/',auth['isAuthenticated'](),controller[_0xbe6b('0x7')]);router[_0xbe6b('0x6')](_0xbe6b('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xbe6b('0x6')](_0xbe6b('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xbe6b('0xa')](),controller[_0xbe6b('0xb')]);router[_0xbe6b('0xc')](_0xbe6b('0x9'),auth[_0xbe6b('0xa')](),controller['update']);router[_0xbe6b('0xd')](_0xbe6b('0x9'),auth['isAuthenticated'](),controller[_0xbe6b('0xe')]);module['exports']=router; \ No newline at end of file +var _0xb600=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','index','get','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','destroy','exports','multer','path','connect-timeout'];(function(_0x155483,_0x3413e7){var _0x30a141=function(_0x53d5d8){while(--_0x53d5d8){_0x155483['push'](_0x155483['shift']());}};_0x30a141(++_0x3413e7);}(_0xb600,0x123));var _0x0b60=function(_0x493057,_0x44d38b){_0x493057=_0x493057-0x0;var _0x3c8f43=_0xb600[_0x493057];return _0x3c8f43;};'use strict';var multer=require(_0x0b60('0x0'));var util=require('util');var path=require(_0x0b60('0x1'));var timeout=require(_0x0b60('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0b60('0x3'));var auth=require(_0x0b60('0x4'));var interaction=require(_0x0b60('0x5'));var config=require(_0x0b60('0x6'));var controller=require(_0x0b60('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0b60('0x8')]);router[_0x0b60('0x9')](_0x0b60('0xa'),auth[_0x0b60('0xb')](),controller[_0x0b60('0xc')]);router[_0x0b60('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x0b60('0xd')]);router[_0x0b60('0xe')]('/',auth[_0x0b60('0xb')](),controller[_0x0b60('0xf')]);router[_0x0b60('0x10')](_0x0b60('0x11'),auth['isAuthenticated'](),controller[_0x0b60('0x12')]);router['delete']('/:id',auth[_0x0b60('0xb')](),controller[_0x0b60('0x13')]);module[_0x0b60('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index b5a35d5..7d62acd 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 _0xed69=['addConfiguration','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x5618f8,_0x2f69f3){var _0x3b2b04=function(_0x749ae4){while(--_0x749ae4){_0x5618f8['push'](_0x5618f8['shift']());}};_0x3b2b04(++_0x2f69f3);}(_0xed69,0x1df));var _0x9ed6=function(_0x32f9ca,_0x2fa8bc){_0x32f9ca=_0x32f9ca-0x0;var _0x52e083=_0xed69[_0x32f9ca];return _0x52e083;};'use strict';var multer=require(_0x9ed6('0x0'));var util=require(_0x9ed6('0x1'));var path=require(_0x9ed6('0x2'));var timeout=require(_0x9ed6('0x3'));var express=require(_0x9ed6('0x4'));var router=express[_0x9ed6('0x5')]();var fs_extra=require(_0x9ed6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9ed6('0x7'));var config=require(_0x9ed6('0x8'));var controller=require(_0x9ed6('0x9'));router[_0x9ed6('0xa')]('/',auth[_0x9ed6('0xb')](),controller[_0x9ed6('0xc')]);router[_0x9ed6('0xa')](_0x9ed6('0xd'),auth['isAuthenticated'](),controller[_0x9ed6('0xe')]);router[_0x9ed6('0xa')](_0x9ed6('0xf'),auth[_0x9ed6('0xb')](),controller[_0x9ed6('0x10')]);router[_0x9ed6('0xa')](_0x9ed6('0x11'),auth[_0x9ed6('0xb')](),controller[_0x9ed6('0x12')]);router[_0x9ed6('0x13')]('/',auth[_0x9ed6('0xb')](),controller[_0x9ed6('0x14')]);router[_0x9ed6('0x13')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x9ed6('0x15')]);router[_0x9ed6('0x16')](_0x9ed6('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9ed6('0xd'),auth[_0x9ed6('0xb')](),controller[_0x9ed6('0x17')]);module[_0x9ed6('0x18')]=router; \ No newline at end of file +var _0x4637=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/configurations','post','create','addConfiguration','put','/:id','update'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x4637,0xb3));var _0x7463=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x4637[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0x7463('0x0'));var util=require(_0x7463('0x1'));var path=require('path');var timeout=require(_0x7463('0x2'));var express=require(_0x7463('0x3'));var router=express[_0x7463('0x4')]();var fs_extra=require(_0x7463('0x5'));var auth=require(_0x7463('0x6'));var interaction=require(_0x7463('0x7'));var config=require(_0x7463('0x8'));var controller=require('./intDeskAccount.controller');router[_0x7463('0x9')]('/',auth[_0x7463('0xa')](),controller[_0x7463('0xb')]);router[_0x7463('0x9')]('/:id',auth[_0x7463('0xa')](),controller['show']);router[_0x7463('0x9')](_0x7463('0xc'),auth[_0x7463('0xa')](),controller['getConfigurations']);router[_0x7463('0x9')]('/:id/fields',auth[_0x7463('0xa')](),controller['getFields']);router[_0x7463('0xd')]('/',auth[_0x7463('0xa')](),controller[_0x7463('0xe')]);router['post']('/:id/configurations',auth[_0x7463('0xa')](),controller[_0x7463('0xf')]);router[_0x7463('0x10')](_0x7463('0x11'),auth['isAuthenticated'](),controller[_0x7463('0x12')]);router[_0x7463('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7463('0x14')]);module[_0x7463('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index aa5aaa7..33eb4ff 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 _0x62ec=['integrationTab','newTab','STRING','ENUM','basic'];(function(_0x34fc85,_0x200630){var _0x54686d=function(_0x529372){while(--_0x529372){_0x34fc85['push'](_0x34fc85['shift']());}};_0x54686d(++_0x200630);}(_0x62ec,0x1b5));var _0xc62e=function(_0x261bbf,_0x1f67a9){_0x261bbf=_0x261bbf-0x0;var _0x1b5c66=_0x62ec[_0x261bbf];return _0x1b5c66;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc62e('0x0')]},'description':{'type':Sequelize[_0xc62e('0x0')]},'username':{'type':Sequelize[_0xc62e('0x0')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xc62e('0x1')]('basic'),'defaultValue':_0xc62e('0x2')},'password':{'type':Sequelize[_0xc62e('0x0')]},'consumerKey':{'type':Sequelize[_0xc62e('0x0')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xc62e('0x0')]},'tokenSecret':{'type':Sequelize[_0xc62e('0x0')]},'serverUrl':{'type':Sequelize[_0xc62e('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xc62e('0x1')](_0xc62e('0x3'),_0xc62e('0x4')),'defaultValue':_0xc62e('0x3')}}; \ No newline at end of file +var _0x4c82=['ENUM','basic','integrationTab','newTab','sequelize','STRING'];(function(_0xad0226,_0x209816){var _0x358de1=function(_0x564763){while(--_0x564763){_0xad0226['push'](_0xad0226['shift']());}};_0x358de1(++_0x209816);}(_0x4c82,0xa6));var _0x24c8=function(_0x5c84a6,_0x321f95){_0x5c84a6=_0x5c84a6-0x0;var _0xb8c5f0=_0x4c82[_0x5c84a6];return _0xb8c5f0;};'use strict';var Sequelize=require(_0x24c8('0x0'));module['exports']={'name':{'type':Sequelize[_0x24c8('0x1')]},'description':{'type':Sequelize[_0x24c8('0x1')]},'username':{'type':Sequelize[_0x24c8('0x1')]},'remoteUri':{'type':Sequelize[_0x24c8('0x1')]},'authType':{'type':Sequelize[_0x24c8('0x2')](_0x24c8('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x24c8('0x1')]},'consumerKey':{'type':Sequelize[_0x24c8('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x24c8('0x1')]},'tokenSecret':{'type':Sequelize[_0x24c8('0x1')]},'serverUrl':{'type':Sequelize[_0x24c8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x24c8('0x2')](_0x24c8('0x4'),_0x24c8('0x5')),'defaultValue':_0x24c8('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index a970ef8..423b0ea 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 _0x801f=['includeAll','rows','catch','show','params','include','find','create','body','getConfigurations','findOne','DeskConfiguration','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','password','consumerSecret','token','remoteUri','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','authType','basic','headers','username','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','destroy','then','error','stack','name','map','DeskAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0x801f,0x1e0));var _0xf801=function(_0x42d903,_0xbc931d){_0x42d903=_0x42d903-0x0;var _0x7406c=_0x801f[_0x42d903];return _0x7406c;};'use strict';var emlformat=require(_0xf801('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf801('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf801('0x2'));var moment=require(_0xf801('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf801('0x4'));var util=require(_0xf801('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf801('0x6'));var fs=require('fs');var fs_extra=require(_0xf801('0x7'));var _=require(_0xf801('0x8'));var squel=require(_0xf801('0x9'));var crypto=require(_0xf801('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf801('0xb'));var querystring=require(_0xf801('0xc'));var Papa=require(_0xf801('0xd'));var Redis=require('ioredis');var authService=require(_0xf801('0xe'));var qs=require(_0xf801('0xf'));var as=require(_0xf801('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf801('0x11'))(_0xf801('0x12'));var utils=require(_0xf801('0x13'));var config=require(_0xf801('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf801('0x15'))['db'];var integrations=require(_0xf801('0x16'));function respondWithStatusCode(_0x186f59,_0x165053){_0x165053=_0x165053||0xcc;return function(_0x3d3a1f){if(_0x3d3a1f){return _0x186f59[_0xf801('0x17')](_0x165053);}return _0x186f59[_0xf801('0x18')](_0x165053)[_0xf801('0x19')]();};}function respondWithResult(_0x3fb0f7,_0x5c97ff){_0x5c97ff=_0x5c97ff||0xc8;return function(_0x37e322){if(_0x37e322){return _0x3fb0f7['status'](_0x5c97ff)['json'](_0x37e322);}};}function respondWithFilteredResult(_0x683e64,_0x278da2){return function(_0x2b8d89){if(_0x2b8d89){var _0x14cc47=typeof _0x278da2[_0xf801('0x1a')]==='undefined'&&typeof _0x278da2['limit']===_0xf801('0x1b');var _0x4f224a=_0x2b8d89[_0xf801('0x1c')];var _0x1486dc=_0x14cc47?0x0:_0x278da2[_0xf801('0x1a')];var _0x521742=_0x14cc47?_0x2b8d89[_0xf801('0x1c')]:_0x278da2[_0xf801('0x1a')]+_0x278da2[_0xf801('0x1d')];var _0x3bb840;if(_0x521742>=_0x4f224a){_0x521742=_0x4f224a;_0x3bb840=0xc8;}else{_0x3bb840=0xce;}_0x683e64[_0xf801('0x18')](_0x3bb840);return _0x683e64[_0xf801('0x1e')](_0xf801('0x1f'),_0x1486dc+'-'+_0x521742+'/'+_0x4f224a)['json'](_0x2b8d89);}return null;};}function patchUpdates(_0x5ccfa2){return function(_0xfaf21b){try{jsonpatch['apply'](_0xfaf21b,_0x5ccfa2,!![]);}catch(_0x2dcb20){return BPromise[_0xf801('0x20')](_0x2dcb20);}return _0xfaf21b['save']();};}function saveUpdates(_0x34eb45,_0x2ea5f6){return function(_0x26e72e){if(_0x26e72e){return _0x26e72e['update'](_0x34eb45)['then'](function(_0x9b3b13){return _0x9b3b13;});}return null;};}function removeEntity(_0x4bf0ba,_0x2ad2ee){return function(_0x5b1d02){if(_0x5b1d02){return _0x5b1d02[_0xf801('0x21')]()[_0xf801('0x22')](function(){_0x4bf0ba[_0xf801('0x18')](0xcc)[_0xf801('0x19')]();});}};}function handleEntityNotFound(_0x1e1f87,_0x48ae2e){return function(_0x56dfb8){if(!_0x56dfb8){_0x1e1f87[_0xf801('0x17')](0x194);}return _0x56dfb8;};}function handleError(_0x42c054,_0xc53278){_0xc53278=_0xc53278||0x1f4;return function(_0x535a18){logger[_0xf801('0x23')](_0x535a18[_0xf801('0x24')]);if(_0x535a18[_0xf801('0x25')]){delete _0x535a18[_0xf801('0x25')];}_0x42c054[_0xf801('0x18')](_0xc53278)['send'](_0x535a18);};}exports['index']=function(_0x4da586,_0x2afd99){var _0x358054={},_0x4e4d0a={},_0x4ea5ae={'count':0x0,'rows':[]};var _0x4849fd=_[_0xf801('0x26')](db[_0xf801('0x27')][_0xf801('0x28')],function(_0x1c9c96){return{'name':_0x1c9c96[_0xf801('0x29')],'type':_0x1c9c96[_0xf801('0x2a')]['key']};});_0x4e4d0a[_0xf801('0x2b')]=_[_0xf801('0x26')](_0x4849fd,_0xf801('0x25'));_0x4e4d0a[_0xf801('0x2c')]=_[_0xf801('0x2d')](_0x4da586[_0xf801('0x2c')]);_0x4e4d0a[_0xf801('0x2e')]=_[_0xf801('0x2f')](_0x4e4d0a[_0xf801('0x2b')],_0x4e4d0a[_0xf801('0x2c')]);_0x358054[_0xf801('0x30')]=_['intersection'](_0x4e4d0a[_0xf801('0x2b')],qs[_0xf801('0x31')](_0x4da586[_0xf801('0x2c')][_0xf801('0x31')]));_0x358054[_0xf801('0x30')]=_0x358054[_0xf801('0x30')][_0xf801('0x32')]?_0x358054[_0xf801('0x30')]:_0x4e4d0a['model'];if(!_0x4da586[_0xf801('0x2c')][_0xf801('0x33')]('nolimit')){_0x358054[_0xf801('0x1d')]=qs[_0xf801('0x1d')](_0x4da586['query'][_0xf801('0x1d')]);_0x358054[_0xf801('0x1a')]=qs['offset'](_0x4da586[_0xf801('0x2c')][_0xf801('0x1a')]);}_0x358054[_0xf801('0x34')]=qs[_0xf801('0x35')](_0x4da586[_0xf801('0x2c')][_0xf801('0x35')]);_0x358054[_0xf801('0x36')]=qs['filters'](_[_0xf801('0x37')](_0x4da586['query'],_0x4e4d0a[_0xf801('0x2e')]),_0x4849fd);if(_0x4da586[_0xf801('0x2c')][_0xf801('0x38')]){_0x358054[_0xf801('0x36')]=_['merge'](_0x358054[_0xf801('0x36')],{'$or':_[_0xf801('0x26')](_0x4849fd,function(_0x4bacda){if(_0x4bacda['type']!==_0xf801('0x39')){var _0x1b749c={};_0x1b749c[_0x4bacda[_0xf801('0x25')]]={'$like':'%'+_0x4da586[_0xf801('0x2c')][_0xf801('0x38')]+'%'};return _0x1b749c;}})});}_0x358054=_[_0xf801('0x3a')]({},_0x358054,_0x4da586[_0xf801('0x3b')]);var _0x21e2f7={'where':_0x358054[_0xf801('0x36')]};return db[_0xf801('0x27')][_0xf801('0x1c')](_0x21e2f7)[_0xf801('0x22')](function(_0x16af81){_0x4ea5ae[_0xf801('0x1c')]=_0x16af81;if(_0x4da586[_0xf801('0x2c')][_0xf801('0x3c')]){_0x358054['include']=[{'all':!![]}];}return db['DeskAccount']['findAll'](_0x358054);})['then'](function(_0x7c8302){_0x4ea5ae[_0xf801('0x3d')]=_0x7c8302;return _0x4ea5ae;})['then'](respondWithFilteredResult(_0x2afd99,_0x358054))[_0xf801('0x3e')](handleError(_0x2afd99,null));};exports[_0xf801('0x3f')]=function(_0x50731e,_0x4abb8c){var _0x39757e={'raw':![],'where':{'id':_0x50731e[_0xf801('0x40')]['id']}},_0x417649={};_0x417649[_0xf801('0x2b')]=_[_0xf801('0x2d')](db[_0xf801('0x27')][_0xf801('0x28')]);_0x417649[_0xf801('0x2c')]=_[_0xf801('0x2d')](_0x50731e[_0xf801('0x2c')]);_0x417649[_0xf801('0x2e')]=_[_0xf801('0x2f')](_0x417649[_0xf801('0x2b')],_0x417649[_0xf801('0x2c')]);_0x39757e['attributes']=_[_0xf801('0x2f')](_0x417649[_0xf801('0x2b')],qs[_0xf801('0x31')](_0x50731e[_0xf801('0x2c')][_0xf801('0x31')]));_0x39757e[_0xf801('0x30')]=_0x39757e[_0xf801('0x30')][_0xf801('0x32')]?_0x39757e[_0xf801('0x30')]:_0x417649[_0xf801('0x2b')];if(_0x50731e[_0xf801('0x2c')][_0xf801('0x3c')]){_0x39757e[_0xf801('0x41')]=[{'all':!![]}];}_0x39757e=_[_0xf801('0x3a')]({},_0x39757e,_0x50731e[_0xf801('0x3b')]);return db[_0xf801('0x27')][_0xf801('0x42')](_0x39757e)[_0xf801('0x22')](handleEntityNotFound(_0x4abb8c,null))[_0xf801('0x22')](respondWithResult(_0x4abb8c,null))[_0xf801('0x3e')](handleError(_0x4abb8c,null));};exports[_0xf801('0x43')]=function(_0x14b0b,_0x7fe0cc){return db[_0xf801('0x27')][_0xf801('0x43')](_0x14b0b[_0xf801('0x44')],{})[_0xf801('0x22')](respondWithResult(_0x7fe0cc,0xc9))[_0xf801('0x3e')](handleError(_0x7fe0cc,null));};exports['update']=function(_0x407c5c,_0x449352){if(_0x407c5c['body']['id']){delete _0x407c5c['body']['id'];}return db[_0xf801('0x27')][_0xf801('0x42')]({'where':{'id':_0x407c5c[_0xf801('0x40')]['id']}})[_0xf801('0x22')](handleEntityNotFound(_0x449352,null))['then'](saveUpdates(_0x407c5c['body'],null))[_0xf801('0x22')](respondWithResult(_0x449352,null))[_0xf801('0x3e')](handleError(_0x449352,null));};exports[_0xf801('0x21')]=function(_0x39f285,_0x361cec){return db['DeskAccount'][_0xf801('0x42')]({'where':{'id':_0x39f285['params']['id']}})[_0xf801('0x22')](handleEntityNotFound(_0x361cec,null))['then'](removeEntity(_0x361cec,null))[_0xf801('0x3e')](handleError(_0x361cec,null));};exports[_0xf801('0x45')]=function(_0x567cb4,_0x33da0a,_0x51afb5){var _0x5d9ec3={};var _0xe9179f={};var _0x56207;var _0x3605b7;return db[_0xf801('0x27')][_0xf801('0x46')]({'where':{'id':_0x567cb4[_0xf801('0x40')]['id']}})[_0xf801('0x22')](handleEntityNotFound(_0x33da0a,null))[_0xf801('0x22')](function(_0x3ef08a){if(_0x3ef08a){_0x56207=_0x3ef08a;_0xe9179f[_0xf801('0x2b')]=_['keys'](db[_0xf801('0x47')]['rawAttributes']);_0xe9179f['query']=_[_0xf801('0x2d')](_0x567cb4[_0xf801('0x2c')]);_0xe9179f[_0xf801('0x2e')]=_['intersection'](_0xe9179f[_0xf801('0x2b')],_0xe9179f[_0xf801('0x2c')]);_0x5d9ec3['attributes']=_['intersection'](_0xe9179f[_0xf801('0x2b')],qs[_0xf801('0x31')](_0x567cb4[_0xf801('0x2c')][_0xf801('0x31')]));_0x5d9ec3['attributes']=_0x5d9ec3['attributes'][_0xf801('0x32')]?_0x5d9ec3['attributes']:_0xe9179f[_0xf801('0x2b')];_0x5d9ec3[_0xf801('0x34')]=qs[_0xf801('0x35')](_0x567cb4[_0xf801('0x2c')]['sort']);_0x5d9ec3[_0xf801('0x36')]=qs[_0xf801('0x2e')](_[_0xf801('0x37')](_0x567cb4['query'],_0xe9179f[_0xf801('0x2e')]));if(_0x567cb4[_0xf801('0x2c')]['filter']){_0x5d9ec3['where']=_['merge'](_0x5d9ec3[_0xf801('0x36')],{'$or':_[_0xf801('0x26')](_0x5d9ec3[_0xf801('0x30')],function(_0x5250f6){var _0x8a0b3d={};_0x8a0b3d[_0x5250f6]={'$like':'%'+_0x567cb4[_0xf801('0x2c')][_0xf801('0x38')]+'%'};return _0x8a0b3d;})});}_0x5d9ec3=_[_0xf801('0x3a')]({},_0x5d9ec3,_0x567cb4[_0xf801('0x3b')]);return _0x56207[_0xf801('0x45')](_0x5d9ec3);}})['then'](function(_0x323b73){if(_0x323b73){_0x3605b7=_0x323b73[_0xf801('0x32')];if(!_0x567cb4[_0xf801('0x2c')][_0xf801('0x33')](_0xf801('0x48'))){_0x5d9ec3[_0xf801('0x1d')]=qs[_0xf801('0x1d')](_0x567cb4[_0xf801('0x2c')][_0xf801('0x1d')]);_0x5d9ec3[_0xf801('0x1a')]=qs[_0xf801('0x1a')](_0x567cb4[_0xf801('0x2c')][_0xf801('0x1a')]);}return _0x56207[_0xf801('0x45')](_0x5d9ec3);}})[_0xf801('0x22')](function(_0x1bf1fa){if(_0x1bf1fa){return _0x1bf1fa?{'count':_0x3605b7,'rows':_0x1bf1fa}:null;}})[_0xf801('0x22')](respondWithResult(_0x33da0a,null))['catch'](handleError(_0x33da0a,null));};exports[_0xf801('0x49')]=function(_0x38f7c3,_0x33f8fc,_0x2c1483){if(_0x38f7c3[_0xf801('0x44')]['id']){delete _0x38f7c3[_0xf801('0x44')]['id'];}return db[_0xf801('0x27')][_0xf801('0x46')]({'where':{'id':_0x38f7c3[_0xf801('0x40')]['id']}})[_0xf801('0x22')](handleEntityNotFound(_0x33f8fc,null))[_0xf801('0x22')](function(_0x1a214c){if(_0x1a214c){_0x38f7c3[_0xf801('0x44')][_0xf801('0x4a')]=_0x1a214c['id'];_0x38f7c3[_0xf801('0x44')]['Subjects']=integrations[_0xf801('0x4b')](_0x38f7c3[_0xf801('0x44')][_0xf801('0x4c')],_0x38f7c3[_0xf801('0x44')][_0xf801('0x2a')]);_0x38f7c3[_0xf801('0x44')][_0xf801('0x4d')]=integrations[_0xf801('0x4e')](_0x38f7c3[_0xf801('0x44')][_0xf801('0x4c')],_0x38f7c3[_0xf801('0x44')][_0xf801('0x2a')]);return db['DeskConfiguration'][_0xf801('0x43')](_0x38f7c3[_0xf801('0x44')],{'include':[{'model':db[_0xf801('0x4f')],'as':'Subjects'},{'model':db[_0xf801('0x4f')],'as':_0xf801('0x4d')}]});}return null;})[_0xf801('0x22')](respondWithResult(_0x33f8fc,null))[_0xf801('0x3e')](handleError(_0x33f8fc,null));};exports[_0xf801('0x50')]=function(_0x35ec4d,_0x549e9a,_0x15c08d){var _0x35103d=[{'name':_0xf801('0x51'),'label':_0xf801('0x51'),'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 _0xc270d2='';return db[_0xf801('0x27')][_0xf801('0x46')]({'where':{'id':_0x35ec4d[_0xf801('0x40')]['id']},'attributes':['id','remoteUri','authType','username',_0xf801('0x52'),'consumerKey',_0xf801('0x53'),_0xf801('0x54'),'tokenSecret']})[_0xf801('0x22')](handleEntityNotFound(_0x549e9a,null))[_0xf801('0x22')](function(_0x1e7a85){if(_0x1e7a85){_0xc270d2=_0x1e7a85[_0xf801('0x55')];var _0x1d3ec4=_0xc270d2[_0xf801('0x56')](-0x1);if(_0x1d3ec4==='/'){_0xc270d2=_0xc270d2[_0xf801('0x57')](0x0,_0xc270d2[_0xf801('0x58')](_0x1d3ec4));}var _0xe547f3={'method':'GET','uri':util[_0xf801('0x59')](_0xf801('0x5a'),_0xc270d2),'headers':{'Content-Type':_0xf801('0x5b'),'Accept':_0xf801('0x5b')},'json':!![]};if(_0x1e7a85[_0xf801('0x5c')]===_0xf801('0x5d')){_0xe547f3[_0xf801('0x5e')]['Authorization']=util[_0xf801('0x59')]('Basic\x20%s',new Buffer(util[_0xf801('0x59')]('%s:%s',_0x1e7a85[_0xf801('0x5f')],_0x1e7a85[_0xf801('0x52')]))['toString'](_0xf801('0x60')));}return rp(_0xe547f3)['then'](function(_0x237d87){return _0x35103d[_0xf801('0x61')](_[_0xf801('0x26')](_0x237d87[_0xf801('0x62')][_0xf801('0x63')],function(_0x7a73ae){return{'id':_0x7a73ae[_0xf801('0x25')],'name':_0x7a73ae[_0xf801('0x25')],'type':_0x7a73ae['type'],'active':_0x7a73ae[_0xf801('0x64')],'label':_0x7a73ae[_0xf801('0x65')],'custom':!![]};}));});}})[_0xf801('0x22')](function(_0x2d3901){return{'count':_0x2d3901[_0xf801('0x32')],'rows':_0x2d3901};})[_0xf801('0x22')](respondWithResult(_0x549e9a,null))[_0xf801('0x3e')](function(_0x31092b){var _0x2b2562=_0x35ec4d[_0xf801('0x2c')][_0xf801('0x66')]?0x1f4:_0x31092b[_0xf801('0x67')]||0x1f4;logger[_0xf801('0x23')](_0xf801('0x68'),_0xf801('0x50'),_0x2b2562,JSON[_0xf801('0x69')](_0x31092b));delete _0x31092b[_0xf801('0x25')];if(_0x2b2562===0x191){_0x2b2562=0x190;}_0x549e9a[_0xf801('0x18')](_0x2b2562)[_0xf801('0x6a')](_0x35ec4d[_0xf801('0x2c')]['test']?{'message':_0xf801('0x6b'),'statusCode':_0x31092b[_0xf801('0x67')]}:_0x31092b);});}; \ No newline at end of file +var _0x1fd3=['query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','pick','filter','where','merge','options','includeAll','findAll','rows','show','include','create','body','catch','params','find','sort','nolimit','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskField','Subjects','getFields','priority','username','consumerKey','consumerSecret','token','tokenSecret','remoteUri','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','count','set','reject','save','update','then','destroy','end','stack','name','send','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','keys'];(function(_0x24764f,_0x408b9d){var _0x347a86=function(_0x56b3b8){while(--_0x56b3b8){_0x24764f['push'](_0x24764f['shift']());}};_0x347a86(++_0x408b9d);}(_0x1fd3,0x12f));var _0x31fd=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x1fd3[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31fd('0x0'));var zipdir=require(_0x31fd('0x1'));var jsonpatch=require(_0x31fd('0x2'));var rp=require(_0x31fd('0x3'));var moment=require(_0x31fd('0x4'));var BPromise=require(_0x31fd('0x5'));var Mustache=require(_0x31fd('0x6'));var util=require(_0x31fd('0x7'));var path=require('path');var sox=require(_0x31fd('0x8'));var csv=require(_0x31fd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31fd('0xa'));var _=require(_0x31fd('0xb'));var squel=require(_0x31fd('0xc'));var crypto=require(_0x31fd('0xd'));var jsforce=require(_0x31fd('0xe'));var deskjs=require(_0x31fd('0xf'));var toCsv=require(_0x31fd('0x9'));var querystring=require(_0x31fd('0x10'));var Papa=require(_0x31fd('0x11'));var Redis=require(_0x31fd('0x12'));var authService=require(_0x31fd('0x13'));var qs=require(_0x31fd('0x14'));var as=require(_0x31fd('0x15'));var hardwareService=require(_0x31fd('0x16'));var logger=require(_0x31fd('0x17'))(_0x31fd('0x18'));var utils=require(_0x31fd('0x19'));var config=require(_0x31fd('0x1a'));var licenseUtil=require(_0x31fd('0x1b'));var db=require(_0x31fd('0x1c'))['db'];var integrations=require(_0x31fd('0x1d'));function respondWithStatusCode(_0x396498,_0x14df53){_0x14df53=_0x14df53||0xcc;return function(_0x3dfcaa){if(_0x3dfcaa){return _0x396498[_0x31fd('0x1e')](_0x14df53);}return _0x396498[_0x31fd('0x1f')](_0x14df53)['end']();};}function respondWithResult(_0x4f40af,_0x348a8d){_0x348a8d=_0x348a8d||0xc8;return function(_0x2f8d23){if(_0x2f8d23){return _0x4f40af[_0x31fd('0x1f')](_0x348a8d)['json'](_0x2f8d23);}};}function respondWithFilteredResult(_0xe64c14,_0x145e70){return function(_0x5cffa3){if(_0x5cffa3){var _0x4bd0d8=typeof _0x145e70[_0x31fd('0x20')]===_0x31fd('0x21')&&typeof _0x145e70['limit']==='undefined';var _0x26e710=_0x5cffa3[_0x31fd('0x22')];var _0x1236c7=_0x4bd0d8?0x0:_0x145e70[_0x31fd('0x20')];var _0x764688=_0x4bd0d8?_0x5cffa3[_0x31fd('0x22')]:_0x145e70[_0x31fd('0x20')]+_0x145e70['limit'];var _0x206908;if(_0x764688>=_0x26e710){_0x764688=_0x26e710;_0x206908=0xc8;}else{_0x206908=0xce;}_0xe64c14['status'](_0x206908);return _0xe64c14[_0x31fd('0x23')]('Content-Range',_0x1236c7+'-'+_0x764688+'/'+_0x26e710)['json'](_0x5cffa3);}return null;};}function patchUpdates(_0x1a8772){return function(_0x1d0ad5){try{jsonpatch['apply'](_0x1d0ad5,_0x1a8772,!![]);}catch(_0x2039de){return BPromise[_0x31fd('0x24')](_0x2039de);}return _0x1d0ad5[_0x31fd('0x25')]();};}function saveUpdates(_0x11c92a,_0x14914b){return function(_0x2d96ff){if(_0x2d96ff){return _0x2d96ff[_0x31fd('0x26')](_0x11c92a)[_0x31fd('0x27')](function(_0x24742f){return _0x24742f;});}return null;};}function removeEntity(_0x5348c5,_0x1886d3){return function(_0x4a4ee0){if(_0x4a4ee0){return _0x4a4ee0[_0x31fd('0x28')]()[_0x31fd('0x27')](function(){_0x5348c5[_0x31fd('0x1f')](0xcc)[_0x31fd('0x29')]();});}};}function handleEntityNotFound(_0x3c27ba,_0x2fc642){return function(_0x20cfaa){if(!_0x20cfaa){_0x3c27ba[_0x31fd('0x1e')](0x194);}return _0x20cfaa;};}function handleError(_0x1c8c23,_0x238006){_0x238006=_0x238006||0x1f4;return function(_0x16268c){logger['error'](_0x16268c[_0x31fd('0x2a')]);if(_0x16268c[_0x31fd('0x2b')]){delete _0x16268c[_0x31fd('0x2b')];}_0x1c8c23['status'](_0x238006)[_0x31fd('0x2c')](_0x16268c);};}exports[_0x31fd('0x2d')]=function(_0x58cb4c,_0x567baa){var _0x35afe8={},_0x22d4d5={},_0x42f3c9={'count':0x0,'rows':[]};var _0x7bcf69=_['map'](db[_0x31fd('0x2e')][_0x31fd('0x2f')],function(_0x12cd0d){return{'name':_0x12cd0d[_0x31fd('0x30')],'type':_0x12cd0d[_0x31fd('0x31')][_0x31fd('0x32')]};});_0x22d4d5[_0x31fd('0x33')]=_[_0x31fd('0x34')](_0x7bcf69,_0x31fd('0x2b'));_0x22d4d5['query']=_[_0x31fd('0x35')](_0x58cb4c[_0x31fd('0x36')]);_0x22d4d5[_0x31fd('0x37')]=_[_0x31fd('0x38')](_0x22d4d5[_0x31fd('0x33')],_0x22d4d5[_0x31fd('0x36')]);_0x35afe8[_0x31fd('0x39')]=_['intersection'](_0x22d4d5[_0x31fd('0x33')],qs[_0x31fd('0x3a')](_0x58cb4c['query'][_0x31fd('0x3a')]));_0x35afe8[_0x31fd('0x39')]=_0x35afe8[_0x31fd('0x39')][_0x31fd('0x3b')]?_0x35afe8[_0x31fd('0x39')]:_0x22d4d5[_0x31fd('0x33')];if(!_0x58cb4c['query'][_0x31fd('0x3c')]('nolimit')){_0x35afe8[_0x31fd('0x3d')]=qs[_0x31fd('0x3d')](_0x58cb4c[_0x31fd('0x36')][_0x31fd('0x3d')]);_0x35afe8['offset']=qs['offset'](_0x58cb4c[_0x31fd('0x36')]['offset']);}_0x35afe8[_0x31fd('0x3e')]=qs['sort'](_0x58cb4c['query']['sort']);_0x35afe8['where']=qs[_0x31fd('0x37')](_[_0x31fd('0x3f')](_0x58cb4c[_0x31fd('0x36')],_0x22d4d5[_0x31fd('0x37')]),_0x7bcf69);if(_0x58cb4c[_0x31fd('0x36')][_0x31fd('0x40')]){_0x35afe8[_0x31fd('0x41')]=_[_0x31fd('0x42')](_0x35afe8[_0x31fd('0x41')],{'$or':_[_0x31fd('0x34')](_0x7bcf69,function(_0x1dda8f){if(_0x1dda8f['type']!=='VIRTUAL'){var _0x371f49={};_0x371f49[_0x1dda8f['name']]={'$like':'%'+_0x58cb4c[_0x31fd('0x36')]['filter']+'%'};return _0x371f49;}})});}_0x35afe8=_['merge']({},_0x35afe8,_0x58cb4c[_0x31fd('0x43')]);var _0x272551={'where':_0x35afe8['where']};return db['DeskAccount'][_0x31fd('0x22')](_0x272551)[_0x31fd('0x27')](function(_0x5e2f8d){_0x42f3c9[_0x31fd('0x22')]=_0x5e2f8d;if(_0x58cb4c['query'][_0x31fd('0x44')]){_0x35afe8['include']=[{'all':!![]}];}return db[_0x31fd('0x2e')][_0x31fd('0x45')](_0x35afe8);})[_0x31fd('0x27')](function(_0xad0f0c){_0x42f3c9[_0x31fd('0x46')]=_0xad0f0c;return _0x42f3c9;})['then'](respondWithFilteredResult(_0x567baa,_0x35afe8))['catch'](handleError(_0x567baa,null));};exports[_0x31fd('0x47')]=function(_0xa846fa,_0x2b5ad7){var _0x3c455f={'raw':![],'where':{'id':_0xa846fa['params']['id']}},_0x30ffb7={};_0x30ffb7['model']=_[_0x31fd('0x35')](db[_0x31fd('0x2e')]['rawAttributes']);_0x30ffb7[_0x31fd('0x36')]=_[_0x31fd('0x35')](_0xa846fa[_0x31fd('0x36')]);_0x30ffb7['filters']=_[_0x31fd('0x38')](_0x30ffb7[_0x31fd('0x33')],_0x30ffb7['query']);_0x3c455f[_0x31fd('0x39')]=_[_0x31fd('0x38')](_0x30ffb7[_0x31fd('0x33')],qs[_0x31fd('0x3a')](_0xa846fa['query']['fields']));_0x3c455f[_0x31fd('0x39')]=_0x3c455f[_0x31fd('0x39')][_0x31fd('0x3b')]?_0x3c455f[_0x31fd('0x39')]:_0x30ffb7['model'];if(_0xa846fa['query']['includeAll']){_0x3c455f[_0x31fd('0x48')]=[{'all':!![]}];}_0x3c455f=_['merge']({},_0x3c455f,_0xa846fa[_0x31fd('0x43')]);return db[_0x31fd('0x2e')]['find'](_0x3c455f)[_0x31fd('0x27')](handleEntityNotFound(_0x2b5ad7,null))['then'](respondWithResult(_0x2b5ad7,null))['catch'](handleError(_0x2b5ad7,null));};exports[_0x31fd('0x49')]=function(_0x569fd7,_0x2ae1d5){return db[_0x31fd('0x2e')][_0x31fd('0x49')](_0x569fd7[_0x31fd('0x4a')],{})[_0x31fd('0x27')](respondWithResult(_0x2ae1d5,0xc9))[_0x31fd('0x4b')](handleError(_0x2ae1d5,null));};exports[_0x31fd('0x26')]=function(_0x51c744,_0x4c00fd){if(_0x51c744[_0x31fd('0x4a')]['id']){delete _0x51c744[_0x31fd('0x4a')]['id'];}return db[_0x31fd('0x2e')]['find']({'where':{'id':_0x51c744[_0x31fd('0x4c')]['id']}})[_0x31fd('0x27')](handleEntityNotFound(_0x4c00fd,null))[_0x31fd('0x27')](saveUpdates(_0x51c744[_0x31fd('0x4a')],null))[_0x31fd('0x27')](respondWithResult(_0x4c00fd,null))[_0x31fd('0x4b')](handleError(_0x4c00fd,null));};exports[_0x31fd('0x28')]=function(_0x276826,_0xeb5dbc){return db[_0x31fd('0x2e')][_0x31fd('0x4d')]({'where':{'id':_0x276826[_0x31fd('0x4c')]['id']}})[_0x31fd('0x27')](handleEntityNotFound(_0xeb5dbc,null))[_0x31fd('0x27')](removeEntity(_0xeb5dbc,null))[_0x31fd('0x4b')](handleError(_0xeb5dbc,null));};exports['getConfigurations']=function(_0x4979ca,_0x1e57d3,_0x419c88){var _0x3f419e={};var _0x44b212={};var _0x75279c;var _0x3f3bb4;return db['DeskAccount']['findOne']({'where':{'id':_0x4979ca['params']['id']}})['then'](handleEntityNotFound(_0x1e57d3,null))[_0x31fd('0x27')](function(_0x47a0bc){if(_0x47a0bc){_0x75279c=_0x47a0bc;_0x44b212[_0x31fd('0x33')]=_['keys'](db['DeskConfiguration'][_0x31fd('0x2f')]);_0x44b212[_0x31fd('0x36')]=_[_0x31fd('0x35')](_0x4979ca[_0x31fd('0x36')]);_0x44b212[_0x31fd('0x37')]=_[_0x31fd('0x38')](_0x44b212['model'],_0x44b212[_0x31fd('0x36')]);_0x3f419e[_0x31fd('0x39')]=_[_0x31fd('0x38')](_0x44b212['model'],qs[_0x31fd('0x3a')](_0x4979ca[_0x31fd('0x36')]['fields']));_0x3f419e[_0x31fd('0x39')]=_0x3f419e[_0x31fd('0x39')][_0x31fd('0x3b')]?_0x3f419e['attributes']:_0x44b212[_0x31fd('0x33')];_0x3f419e[_0x31fd('0x3e')]=qs['sort'](_0x4979ca['query'][_0x31fd('0x4e')]);_0x3f419e[_0x31fd('0x41')]=qs[_0x31fd('0x37')](_[_0x31fd('0x3f')](_0x4979ca['query'],_0x44b212[_0x31fd('0x37')]));if(_0x4979ca[_0x31fd('0x36')][_0x31fd('0x40')]){_0x3f419e[_0x31fd('0x41')]=_['merge'](_0x3f419e[_0x31fd('0x41')],{'$or':_[_0x31fd('0x34')](_0x3f419e[_0x31fd('0x39')],function(_0x2b6eb6){var _0x4899d7={};_0x4899d7[_0x2b6eb6]={'$like':'%'+_0x4979ca[_0x31fd('0x36')][_0x31fd('0x40')]+'%'};return _0x4899d7;})});}_0x3f419e=_[_0x31fd('0x42')]({},_0x3f419e,_0x4979ca[_0x31fd('0x43')]);return _0x75279c['getConfigurations'](_0x3f419e);}})['then'](function(_0x30dca5){if(_0x30dca5){_0x3f3bb4=_0x30dca5[_0x31fd('0x3b')];if(!_0x4979ca[_0x31fd('0x36')]['hasOwnProperty'](_0x31fd('0x4f'))){_0x3f419e[_0x31fd('0x3d')]=qs[_0x31fd('0x3d')](_0x4979ca[_0x31fd('0x36')]['limit']);_0x3f419e[_0x31fd('0x20')]=qs[_0x31fd('0x20')](_0x4979ca[_0x31fd('0x36')][_0x31fd('0x20')]);}return _0x75279c[_0x31fd('0x50')](_0x3f419e);}})[_0x31fd('0x27')](function(_0x5afcd6){if(_0x5afcd6){return _0x5afcd6?{'count':_0x3f3bb4,'rows':_0x5afcd6}:null;}})[_0x31fd('0x27')](respondWithResult(_0x1e57d3,null))[_0x31fd('0x4b')](handleError(_0x1e57d3,null));};exports[_0x31fd('0x51')]=function(_0x2eaa2b,_0x12c9f2,_0x5e6404){if(_0x2eaa2b['body']['id']){delete _0x2eaa2b[_0x31fd('0x4a')]['id'];}return db[_0x31fd('0x2e')][_0x31fd('0x52')]({'where':{'id':_0x2eaa2b[_0x31fd('0x4c')]['id']}})[_0x31fd('0x27')](handleEntityNotFound(_0x12c9f2,null))[_0x31fd('0x27')](function(_0x4190d6){if(_0x4190d6){_0x2eaa2b['body'][_0x31fd('0x53')]=_0x4190d6['id'];_0x2eaa2b['body']['Subjects']=integrations[_0x31fd('0x54')](_0x2eaa2b['body'][_0x31fd('0x55')],_0x2eaa2b[_0x31fd('0x4a')][_0x31fd('0x31')]);_0x2eaa2b['body'][_0x31fd('0x56')]=integrations[_0x31fd('0x57')](_0x2eaa2b[_0x31fd('0x4a')]['channel'],_0x2eaa2b[_0x31fd('0x4a')]['type']);return db['DeskConfiguration'][_0x31fd('0x49')](_0x2eaa2b[_0x31fd('0x4a')],{'include':[{'model':db[_0x31fd('0x58')],'as':_0x31fd('0x59')},{'model':db['DeskField'],'as':_0x31fd('0x56')}]});}return null;})[_0x31fd('0x27')](respondWithResult(_0x12c9f2,null))[_0x31fd('0x4b')](handleError(_0x12c9f2,null));};exports[_0x31fd('0x5a')]=function(_0x5148ce,_0x1dc993,_0x26b9b9){var _0x449e30=[{'name':'priority','label':_0x31fd('0x5b'),'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 _0x2c60a5='';return db[_0x31fd('0x2e')]['findOne']({'where':{'id':_0x5148ce[_0x31fd('0x4c')]['id']},'attributes':['id','remoteUri','authType',_0x31fd('0x5c'),'password',_0x31fd('0x5d'),_0x31fd('0x5e'),_0x31fd('0x5f'),_0x31fd('0x60')]})[_0x31fd('0x27')](handleEntityNotFound(_0x1dc993,null))[_0x31fd('0x27')](function(_0x5c1104){if(_0x5c1104){_0x2c60a5=_0x5c1104[_0x31fd('0x61')];var _0xdd6cf1=_0x2c60a5['slice'](-0x1);if(_0xdd6cf1==='/'){_0x2c60a5=_0x2c60a5['substring'](0x0,_0x2c60a5[_0x31fd('0x62')](_0xdd6cf1));}var _0x30ac3b={'method':_0x31fd('0x63'),'uri':util[_0x31fd('0x64')](_0x31fd('0x65'),_0x2c60a5),'headers':{'Content-Type':_0x31fd('0x66'),'Accept':_0x31fd('0x66')},'json':!![]};if(_0x5c1104[_0x31fd('0x67')]==='basic'){_0x30ac3b[_0x31fd('0x68')][_0x31fd('0x69')]=util[_0x31fd('0x64')](_0x31fd('0x6a'),new Buffer(util['format'](_0x31fd('0x6b'),_0x5c1104['username'],_0x5c1104['password']))[_0x31fd('0x6c')](_0x31fd('0x6d')));}return rp(_0x30ac3b)[_0x31fd('0x27')](function(_0x4927a9){return _0x449e30[_0x31fd('0x6e')](_[_0x31fd('0x34')](_0x4927a9[_0x31fd('0x6f')][_0x31fd('0x70')],function(_0x1628d1){return{'id':_0x1628d1['name'],'name':_0x1628d1['name'],'type':_0x1628d1[_0x31fd('0x31')],'active':_0x1628d1['active'],'label':_0x1628d1[_0x31fd('0x71')],'custom':!![]};}));});}})[_0x31fd('0x27')](function(_0x116009){return{'count':_0x116009[_0x31fd('0x3b')],'rows':_0x116009};})[_0x31fd('0x27')](respondWithResult(_0x1dc993,null))[_0x31fd('0x4b')](function(_0x298d51){var _0x1cd3a2=_0x5148ce['query'][_0x31fd('0x72')]?0x1f4:_0x298d51[_0x31fd('0x73')]||0x1f4;logger['error'](_0x31fd('0x74'),_0x31fd('0x5a'),_0x1cd3a2,JSON[_0x31fd('0x75')](_0x298d51));delete _0x298d51[_0x31fd('0x2b')];if(_0x1cd3a2===0x191){_0x1cd3a2=0x190;}_0x1dc993['status'](_0x1cd3a2)[_0x31fd('0x2c')](_0x5148ce[_0x31fd('0x36')][_0x31fd('0x72')]?{'message':_0x31fd('0x76'),'statusCode':_0x298d51[_0x31fd('0x73')]}:_0x298d51);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index fa1a447..380a975 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 _0x3ab8=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','DeskAccount','lodash'];(function(_0x273d18,_0x505e74){var _0x578550=function(_0x5515fd){while(--_0x5515fd){_0x273d18['push'](_0x273d18['shift']());}};_0x578550(++_0x505e74);}(_0x3ab8,0x1c7));var _0x83ab=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3ab8[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x83ab('0x0'));var util=require(_0x83ab('0x1'));var logger=require('../../config/logger')(_0x83ab('0x2'));var moment=require(_0x83ab('0x3'));var BPromise=require(_0x83ab('0x4'));var rp=require(_0x83ab('0x5'));var fs=require('fs');var path=require(_0x83ab('0x6'));var rimraf=require(_0x83ab('0x7'));var config=require(_0x83ab('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x83ab('0x9'));module[_0x83ab('0xa')]=function(_0x480fc3,_0x570fde){return _0x480fc3['define'](_0x83ab('0xb'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xecd6=['./intDeskAccount.attributes','exports','define','DeskAccount','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xecd6,0x19c));var _0x6ecd=function(_0x80c7da,_0x246729){_0x80c7da=_0x80c7da-0x0;var _0x42e4b6=_0xecd6[_0x80c7da];return _0x42e4b6;};'use strict';var _=require(_0x6ecd('0x0'));var util=require(_0x6ecd('0x1'));var logger=require(_0x6ecd('0x2'))(_0x6ecd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6ecd('0x4'));var fs=require('fs');var path=require(_0x6ecd('0x5'));var rimraf=require(_0x6ecd('0x6'));var config=require(_0x6ecd('0x7'));var attributes=require(_0x6ecd('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x6ecd('0x9')]=function(_0x3671e4,_0x198f1d){return _0x3671e4[_0x6ecd('0xa')](_0x6ecd('0xb'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 5849caa..5d50f12 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 _0xbfa1=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskAccount,\x20%s,\x20%s','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','include','model','map','debug','find','ShowDeskAccount','lodash','util','moment'];(function(_0x29417d,_0x2c180c){var _0x1a2b35=function(_0x2b644c){while(--_0x2b644c){_0x29417d['push'](_0x29417d['shift']());}};_0x1a2b35(++_0x2c180c);}(_0xbfa1,0x189));var _0x1bfa=function(_0xed2b66,_0x13c18a){_0xed2b66=_0xed2b66-0x0;var _0x5c2fc4=_0xbfa1[_0xed2b66];return _0x5c2fc4;};'use strict';var _=require(_0x1bfa('0x0'));var util=require(_0x1bfa('0x1'));var moment=require(_0x1bfa('0x2'));var BPromise=require(_0x1bfa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bfa('0x4'));var db=require(_0x1bfa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1bfa('0x6'))(_0x1bfa('0x7'));var config=require('../../config/environment');var jayson=require(_0x1bfa('0x8'));var client=jayson[_0x1bfa('0x9')][_0x1bfa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b632,_0x3fefce,_0x5bd36c){return new BPromise(function(_0x12298e,_0x121f5f){return client[_0x1bfa('0xb')](_0x36b632,_0x5bd36c)[_0x1bfa('0xc')](function(_0x4919e0){logger['info']('DeskAccount,\x20%s,\x20%s',_0x3fefce,_0x1bfa('0xd'));logger['debug'](_0x1bfa('0xe'),_0x3fefce,_0x1bfa('0xd'),JSON[_0x1bfa('0xf')](_0x4919e0));if(_0x4919e0['error']){if(_0x4919e0[_0x1bfa('0x10')][_0x1bfa('0x11')]===0x1f4){logger[_0x1bfa('0x10')]('DeskAccount,\x20%s,\x20%s',_0x3fefce,_0x4919e0[_0x1bfa('0x10')][_0x1bfa('0x12')]);return _0x121f5f(_0x4919e0[_0x1bfa('0x10')][_0x1bfa('0x12')]);}logger['error'](_0x1bfa('0x13'),_0x3fefce,_0x4919e0[_0x1bfa('0x10')]['message']);return _0x12298e(_0x4919e0['error']['message']);}else{logger[_0x1bfa('0x14')](_0x1bfa('0x13'),_0x3fefce,_0x1bfa('0xd'));_0x12298e(_0x4919e0[_0x1bfa('0x15')][_0x1bfa('0x12')]);}})[_0x1bfa('0x16')](function(_0x257689){logger[_0x1bfa('0x10')]('DeskAccount,\x20%s,\x20%s',_0x3fefce,_0x257689);_0x121f5f(_0x257689);});});}exports[_0x1bfa('0x17')]=function(_0x52d7ae){var _0x4f1767=this;return new Promise(function(_0x470df3,_0x13c528){return db[_0x1bfa('0x18')][_0x1bfa('0x19')]({'raw':_0x52d7ae['options']?_0x52d7ae[_0x1bfa('0x1a')][_0x1bfa('0x1b')]===undefined?!![]:![]:!![],'where':_0x52d7ae[_0x1bfa('0x1a')]?_0x52d7ae[_0x1bfa('0x1a')][_0x1bfa('0x1c')]||null:null,'attributes':_0x52d7ae['options']?_0x52d7ae['options'][_0x1bfa('0x1d')]||null:null,'limit':_0x52d7ae[_0x1bfa('0x1a')]?_0x52d7ae['options']['limit']||null:null,'include':_0x52d7ae[_0x1bfa('0x1a')]?_0x52d7ae[_0x1bfa('0x1a')][_0x1bfa('0x1e')]?_['map'](_0x52d7ae[_0x1bfa('0x1a')]['include'],function(_0x4ab6cc){return{'model':db[_0x4ab6cc[_0x1bfa('0x1f')]],'as':_0x4ab6cc['as'],'attributes':_0x4ab6cc[_0x1bfa('0x1d')],'include':_0x4ab6cc['include']?_[_0x1bfa('0x20')](_0x4ab6cc[_0x1bfa('0x1e')],function(_0x24a679){return{'model':db[_0x24a679[_0x1bfa('0x1f')]],'as':_0x24a679['as'],'attributes':_0x24a679[_0x1bfa('0x1d')],'include':_0x24a679[_0x1bfa('0x1e')]?_[_0x1bfa('0x20')](_0x24a679[_0x1bfa('0x1e')],function(_0x3e6c55){return{'model':db[_0x3e6c55[_0x1bfa('0x1f')]],'as':_0x3e6c55['as'],'attributes':_0x3e6c55[_0x1bfa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1bfa('0xc')](function(_0x4317c3){logger[_0x1bfa('0x14')](_0x1bfa('0x17'),_0x52d7ae);logger[_0x1bfa('0x21')]('GetDeskAccount',_0x52d7ae,JSON['stringify'](_0x4317c3));_0x470df3(_0x4317c3);})[_0x1bfa('0x16')](function(_0x2883a3){logger[_0x1bfa('0x10')](_0x1bfa('0x17'),_0x2883a3['message'],_0x52d7ae);_0x13c528(_0x4f1767[_0x1bfa('0x10')](0x1f4,_0x2883a3[_0x1bfa('0x12')]));});});};exports['ShowDeskAccount']=function(_0x112e1d){var _0x549a9e=this;return new Promise(function(_0x55acf0,_0x11ab20){return db[_0x1bfa('0x18')][_0x1bfa('0x22')]({'raw':_0x112e1d[_0x1bfa('0x1a')]?_0x112e1d[_0x1bfa('0x1a')][_0x1bfa('0x1b')]===undefined?!![]:![]:!![],'where':_0x112e1d[_0x1bfa('0x1a')]?_0x112e1d[_0x1bfa('0x1a')][_0x1bfa('0x1c')]||null:null,'attributes':_0x112e1d[_0x1bfa('0x1a')]?_0x112e1d[_0x1bfa('0x1a')][_0x1bfa('0x1d')]||null:null,'include':_0x112e1d[_0x1bfa('0x1a')]?_0x112e1d['options'][_0x1bfa('0x1e')]?_[_0x1bfa('0x20')](_0x112e1d['options'][_0x1bfa('0x1e')],function(_0x3fb09c){return{'model':db[_0x3fb09c[_0x1bfa('0x1f')]],'as':_0x3fb09c['as'],'attributes':_0x3fb09c[_0x1bfa('0x1d')],'include':_0x3fb09c[_0x1bfa('0x1e')]?_['map'](_0x3fb09c[_0x1bfa('0x1e')],function(_0x3a9632){return{'model':db[_0x3a9632[_0x1bfa('0x1f')]],'as':_0x3a9632['as'],'attributes':_0x3a9632[_0x1bfa('0x1d')],'include':_0x3a9632[_0x1bfa('0x1e')]?_[_0x1bfa('0x20')](_0x3a9632[_0x1bfa('0x1e')],function(_0xc2f687){return{'model':db[_0xc2f687[_0x1bfa('0x1f')]],'as':_0xc2f687['as'],'attributes':_0xc2f687[_0x1bfa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1bfa('0xc')](function(_0x3b8e09){logger['info'](_0x1bfa('0x23'),_0x112e1d);logger['debug'](_0x1bfa('0x23'),_0x112e1d,JSON[_0x1bfa('0xf')](_0x3b8e09));_0x55acf0(_0x3b8e09);})[_0x1bfa('0x16')](function(_0x3614d3){logger[_0x1bfa('0x10')](_0x1bfa('0x23'),_0x3614d3[_0x1bfa('0x12')],_0x112e1d);_0x11ab20(_0x549a9e[_0x1bfa('0x10')](0x1f4,_0x3614d3[_0x1bfa('0x12')]));});});}; \ No newline at end of file +var _0x9cef=['options','raw','limit','include','map','attributes','model','debug','stringify','ShowDeskAccount','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','code','message','DeskAccount,\x20%s,\x20%s','catch','GetDeskAccount','DeskAccount','findAll'];(function(_0x430ce1,_0x12449a){var _0x3c64e9=function(_0x496bce){while(--_0x496bce){_0x430ce1['push'](_0x430ce1['shift']());}};_0x3c64e9(++_0x12449a);}(_0x9cef,0xdd));var _0xf9ce=function(_0x3a2e4b,_0x1fc1f7){_0x3a2e4b=_0x3a2e4b-0x0;var _0x3697d9=_0x9cef[_0x3a2e4b];return _0x3697d9;};'use strict';var _=require(_0xf9ce('0x0'));var util=require('util');var moment=require(_0xf9ce('0x1'));var BPromise=require(_0xf9ce('0x2'));var rs=require(_0xf9ce('0x3'));var fs=require('fs');var Redis=require(_0xf9ce('0x4'));var db=require(_0xf9ce('0x5'))['db'];var utils=require(_0xf9ce('0x6'));var logger=require('../../config/logger')(_0xf9ce('0x7'));var config=require(_0xf9ce('0x8'));var jayson=require(_0xf9ce('0x9'));var client=jayson[_0xf9ce('0xa')][_0xf9ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a9462,_0x3c1adf,_0x5931d0){return new BPromise(function(_0x26b81e,_0x582af7){return client[_0xf9ce('0xc')](_0x5a9462,_0x5931d0)[_0xf9ce('0xd')](function(_0x46984a){logger[_0xf9ce('0xe')]('DeskAccount,\x20%s,\x20%s',_0x3c1adf,_0xf9ce('0xf'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x3c1adf,_0xf9ce('0xf'),JSON['stringify'](_0x46984a));if(_0x46984a['error']){if(_0x46984a[_0xf9ce('0x10')][_0xf9ce('0x11')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x3c1adf,_0x46984a[_0xf9ce('0x10')][_0xf9ce('0x12')]);return _0x582af7(_0x46984a[_0xf9ce('0x10')]['message']);}logger[_0xf9ce('0x10')](_0xf9ce('0x13'),_0x3c1adf,_0x46984a[_0xf9ce('0x10')][_0xf9ce('0x12')]);return _0x26b81e(_0x46984a[_0xf9ce('0x10')][_0xf9ce('0x12')]);}else{logger[_0xf9ce('0xe')](_0xf9ce('0x13'),_0x3c1adf,_0xf9ce('0xf'));_0x26b81e(_0x46984a['result']['message']);}})[_0xf9ce('0x14')](function(_0xfa68fd){logger[_0xf9ce('0x10')](_0xf9ce('0x13'),_0x3c1adf,_0xfa68fd);_0x582af7(_0xfa68fd);});});}exports[_0xf9ce('0x15')]=function(_0x424fdc){var _0x1af89d=this;return new Promise(function(_0x47eebe,_0xab3690){return db[_0xf9ce('0x16')][_0xf9ce('0x17')]({'raw':_0x424fdc[_0xf9ce('0x18')]?_0x424fdc[_0xf9ce('0x18')][_0xf9ce('0x19')]===undefined?!![]:![]:!![],'where':_0x424fdc[_0xf9ce('0x18')]?_0x424fdc[_0xf9ce('0x18')]['where']||null:null,'attributes':_0x424fdc[_0xf9ce('0x18')]?_0x424fdc[_0xf9ce('0x18')]['attributes']||null:null,'limit':_0x424fdc[_0xf9ce('0x18')]?_0x424fdc[_0xf9ce('0x18')][_0xf9ce('0x1a')]||null:null,'include':_0x424fdc[_0xf9ce('0x18')]?_0x424fdc[_0xf9ce('0x18')][_0xf9ce('0x1b')]?_[_0xf9ce('0x1c')](_0x424fdc['options'][_0xf9ce('0x1b')],function(_0x58c5da){return{'model':db[_0x58c5da['model']],'as':_0x58c5da['as'],'attributes':_0x58c5da[_0xf9ce('0x1d')],'include':_0x58c5da[_0xf9ce('0x1b')]?_['map'](_0x58c5da[_0xf9ce('0x1b')],function(_0x2e6c20){return{'model':db[_0x2e6c20[_0xf9ce('0x1e')]],'as':_0x2e6c20['as'],'attributes':_0x2e6c20['attributes'],'include':_0x2e6c20[_0xf9ce('0x1b')]?_['map'](_0x2e6c20['include'],function(_0x558008){return{'model':db[_0x558008[_0xf9ce('0x1e')]],'as':_0x558008['as'],'attributes':_0x558008['attributes']};}):[]};}):[]};}):[]:[]})[_0xf9ce('0xd')](function(_0x1cfed9){logger['info'](_0xf9ce('0x15'),_0x424fdc);logger[_0xf9ce('0x1f')](_0xf9ce('0x15'),_0x424fdc,JSON[_0xf9ce('0x20')](_0x1cfed9));_0x47eebe(_0x1cfed9);})[_0xf9ce('0x14')](function(_0x301982){logger['error'](_0xf9ce('0x15'),_0x301982['message'],_0x424fdc);_0xab3690(_0x1af89d['error'](0x1f4,_0x301982['message']));});});};exports[_0xf9ce('0x21')]=function(_0x3b6c0b){var _0x37dcac=this;return new Promise(function(_0x1b4885,_0x7c2326){return db[_0xf9ce('0x16')]['find']({'raw':_0x3b6c0b['options']?_0x3b6c0b['options'][_0xf9ce('0x19')]===undefined?!![]:![]:!![],'where':_0x3b6c0b[_0xf9ce('0x18')]?_0x3b6c0b['options'][_0xf9ce('0x22')]||null:null,'attributes':_0x3b6c0b[_0xf9ce('0x18')]?_0x3b6c0b['options'][_0xf9ce('0x1d')]||null:null,'include':_0x3b6c0b[_0xf9ce('0x18')]?_0x3b6c0b[_0xf9ce('0x18')][_0xf9ce('0x1b')]?_[_0xf9ce('0x1c')](_0x3b6c0b[_0xf9ce('0x18')]['include'],function(_0x339a59){return{'model':db[_0x339a59[_0xf9ce('0x1e')]],'as':_0x339a59['as'],'attributes':_0x339a59[_0xf9ce('0x1d')],'include':_0x339a59[_0xf9ce('0x1b')]?_[_0xf9ce('0x1c')](_0x339a59[_0xf9ce('0x1b')],function(_0x22988e){return{'model':db[_0x22988e[_0xf9ce('0x1e')]],'as':_0x22988e['as'],'attributes':_0x22988e['attributes'],'include':_0x22988e[_0xf9ce('0x1b')]?_[_0xf9ce('0x1c')](_0x22988e[_0xf9ce('0x1b')],function(_0x23646){return{'model':db[_0x23646[_0xf9ce('0x1e')]],'as':_0x23646['as'],'attributes':_0x23646['attributes']};}):[]};}):[]};}):[]:[]})[_0xf9ce('0xd')](function(_0x565885){logger[_0xf9ce('0xe')](_0xf9ce('0x21'),_0x3b6c0b);logger[_0xf9ce('0x1f')](_0xf9ce('0x21'),_0x3b6c0b,JSON['stringify'](_0x565885));_0x1b4885(_0x565885);})[_0xf9ce('0x14')](function(_0x5a292f){logger[_0xf9ce('0x10')]('ShowDeskAccount',_0x5a292f['message'],_0x3b6c0b);_0x7c2326(_0x37dcac[_0xf9ce('0x10')](0x1f4,_0x5a292f[_0xf9ce('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index cb8e392..e125fd0 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x1d930e,_0x20d8b8){var _0x5bbd66=function(_0x3c7488){while(--_0x3c7488){_0x1d930e['push'](_0x1d930e['shift']());}};_0x5bbd66(++_0x20d8b8);}(_0x55ca,0x126));var _0xa55c=function(_0x2b0267,_0x59cab1){_0x2b0267=_0x2b0267-0x0;var _0x289a4a=_0x55ca[_0x2b0267];return _0x289a4a;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5f2501,_0x3d8d47){var _0x417610=function(_0x220ebe){while(--_0x220ebe){_0x5f2501['push'](_0x5f2501['shift']());}};_0x417610(++_0x3d8d47);}(_0x008c,0x188));var _0xc008=function(_0x3fb150,_0x5e32ed){_0x3fb150=_0x3fb150-0x0;var _0x56f4a8=_0x008c[_0x3fb150];return _0x56f4a8;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index c318e17..4f7d723 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 _0x1ce6=['STRING','sequelize','exports'];(function(_0x2d8f05,_0x3cfe31){var _0x25254c=function(_0x4994b4){while(--_0x4994b4){_0x2d8f05['push'](_0x2d8f05['shift']());}};_0x25254c(++_0x3cfe31);}(_0x1ce6,0xe8));var _0x61ce=function(_0x2ade26,_0x23a8e9){_0x2ade26=_0x2ade26-0x0;var _0x13ba40=_0x1ce6[_0x2ade26];return _0x13ba40;};'use strict';var Sequelize=require(_0x61ce('0x0'));module[_0x61ce('0x1')]={'name':{'type':Sequelize[_0x61ce('0x2')]},'description':{'type':Sequelize[_0x61ce('0x2')]}}; \ No newline at end of file +var _0x5fb4=['sequelize','exports','STRING'];(function(_0x224ed8,_0x36363c){var _0x1c16c7=function(_0x48dcc7){while(--_0x48dcc7){_0x224ed8['push'](_0x224ed8['shift']());}};_0x1c16c7(++_0x36363c);}(_0x5fb4,0xab));var _0x45fb=function(_0x1c4c35,_0x2b6119){_0x1c4c35=_0x1c4c35-0x0;var _0x4439a3=_0x5fb4[_0x1c4c35];return _0x4439a3;};'use strict';var Sequelize=require(_0x45fb('0x0'));module[_0x45fb('0x1')]={'name':{'type':Sequelize[_0x45fb('0x2')]},'description':{'type':Sequelize[_0x45fb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index b19896a..872a642 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 _0xd73e=['nolimit','getSubjects','getDescriptions','DeskField','getTags','Tag','hasOwnProperty','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL','includeAll','include','DeskConfiguration','findAll','catch','show','options','find','create','update','body','params','getFields','findOne','pick'];(function(_0x305c01,_0x3cff44){var _0x1b7ff1=function(_0x4dbdaf){while(--_0x4dbdaf){_0x305c01['push'](_0x305c01['shift']());}};_0x1b7ff1(++_0x3cff44);}(_0xd73e,0x165));var _0xed73=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd73e[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xed73('0x0'));var rimraf=require(_0xed73('0x1'));var zipdir=require(_0xed73('0x2'));var jsonpatch=require(_0xed73('0x3'));var rp=require(_0xed73('0x4'));var moment=require('moment');var BPromise=require(_0xed73('0x5'));var Mustache=require(_0xed73('0x6'));var util=require(_0xed73('0x7'));var path=require(_0xed73('0x8'));var sox=require(_0xed73('0x9'));var csv=require(_0xed73('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed73('0xb'));var _=require(_0xed73('0xc'));var squel=require(_0xed73('0xd'));var crypto=require(_0xed73('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xed73('0xf'));var toCsv=require(_0xed73('0xa'));var querystring=require(_0xed73('0x10'));var Papa=require(_0xed73('0x11'));var Redis=require(_0xed73('0x12'));var authService=require(_0xed73('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xed73('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xed73('0x15'));var utils=require(_0xed73('0x16'));var config=require(_0xed73('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xed73('0x18'))['db'];function respondWithStatusCode(_0x525210,_0x2b7be8){_0x2b7be8=_0x2b7be8||0xcc;return function(_0x53e371){if(_0x53e371){return _0x525210[_0xed73('0x19')](_0x2b7be8);}return _0x525210[_0xed73('0x1a')](_0x2b7be8)[_0xed73('0x1b')]();};}function respondWithResult(_0x2b4814,_0x5c65e7){_0x5c65e7=_0x5c65e7||0xc8;return function(_0x595e9f){if(_0x595e9f){return _0x2b4814['status'](_0x5c65e7)['json'](_0x595e9f);}};}function respondWithFilteredResult(_0x252a66,_0x28aef8){return function(_0x103bd4){if(_0x103bd4){var _0x1adada=typeof _0x28aef8[_0xed73('0x1c')]===_0xed73('0x1d')&&typeof _0x28aef8[_0xed73('0x1e')]==='undefined';var _0x29ed8c=_0x103bd4['count'];var _0x186d16=_0x1adada?0x0:_0x28aef8[_0xed73('0x1c')];var _0x56617b=_0x1adada?_0x103bd4[_0xed73('0x1f')]:_0x28aef8[_0xed73('0x1c')]+_0x28aef8[_0xed73('0x1e')];var _0x4a87ca;if(_0x56617b>=_0x29ed8c){_0x56617b=_0x29ed8c;_0x4a87ca=0xc8;}else{_0x4a87ca=0xce;}_0x252a66[_0xed73('0x1a')](_0x4a87ca);return _0x252a66[_0xed73('0x20')](_0xed73('0x21'),_0x186d16+'-'+_0x56617b+'/'+_0x29ed8c)[_0xed73('0x22')](_0x103bd4);}return null;};}function patchUpdates(_0x333959){return function(_0xfe6638){try{jsonpatch[_0xed73('0x23')](_0xfe6638,_0x333959,!![]);}catch(_0x3a2c7f){return BPromise[_0xed73('0x24')](_0x3a2c7f);}return _0xfe6638[_0xed73('0x25')]();};}function saveUpdates(_0x2b4aca,_0xad0922){return function(_0x1e97f8){if(_0x1e97f8){return _0x1e97f8['update'](_0x2b4aca)[_0xed73('0x26')](function(_0x2ca0ed){return _0x2ca0ed;});}return null;};}function removeEntity(_0x13b649,_0x2c4871){return function(_0x50c058){if(_0x50c058){return _0x50c058[_0xed73('0x27')]()['then'](function(){_0x13b649['status'](0xcc)[_0xed73('0x1b')]();});}};}function handleEntityNotFound(_0x3f5dae,_0x1779c7){return function(_0x45b039){if(!_0x45b039){_0x3f5dae[_0xed73('0x19')](0x194);}return _0x45b039;};}function handleError(_0x58e018,_0x2a1b1e){_0x2a1b1e=_0x2a1b1e||0x1f4;return function(_0x24b267){logger[_0xed73('0x28')](_0x24b267['stack']);if(_0x24b267['name']){delete _0x24b267[_0xed73('0x29')];}_0x58e018[_0xed73('0x1a')](_0x2a1b1e)[_0xed73('0x2a')](_0x24b267);};}exports[_0xed73('0x2b')]=function(_0x455d89,_0x299c9e){var _0x331ce5={},_0x370b45={},_0x64b337={'count':0x0,'rows':[]};var _0x4e8b89=_[_0xed73('0x2c')](db['DeskConfiguration'][_0xed73('0x2d')],function(_0x3b55a0){return{'name':_0x3b55a0[_0xed73('0x2e')],'type':_0x3b55a0[_0xed73('0x2f')][_0xed73('0x30')]};});_0x370b45[_0xed73('0x31')]=_['map'](_0x4e8b89,_0xed73('0x29'));_0x370b45['query']=_[_0xed73('0x32')](_0x455d89['query']);_0x370b45[_0xed73('0x33')]=_[_0xed73('0x34')](_0x370b45[_0xed73('0x31')],_0x370b45[_0xed73('0x35')]);_0x331ce5[_0xed73('0x36')]=_[_0xed73('0x34')](_0x370b45['model'],qs[_0xed73('0x37')](_0x455d89['query'][_0xed73('0x37')]));_0x331ce5['attributes']=_0x331ce5[_0xed73('0x36')][_0xed73('0x38')]?_0x331ce5['attributes']:_0x370b45[_0xed73('0x31')];if(!_0x455d89[_0xed73('0x35')]['hasOwnProperty']('nolimit')){_0x331ce5[_0xed73('0x1e')]=qs[_0xed73('0x1e')](_0x455d89['query'][_0xed73('0x1e')]);_0x331ce5['offset']=qs[_0xed73('0x1c')](_0x455d89[_0xed73('0x35')]['offset']);}_0x331ce5[_0xed73('0x39')]=qs[_0xed73('0x3a')](_0x455d89['query'][_0xed73('0x3a')]);_0x331ce5['where']=qs[_0xed73('0x33')](_['pick'](_0x455d89[_0xed73('0x35')],_0x370b45[_0xed73('0x33')]),_0x4e8b89);if(_0x455d89[_0xed73('0x35')][_0xed73('0x3b')]){_0x331ce5[_0xed73('0x3c')]=_[_0xed73('0x3d')](_0x331ce5[_0xed73('0x3c')],{'$or':_['map'](_0x4e8b89,function(_0x286842){if(_0x286842[_0xed73('0x2f')]!==_0xed73('0x3e')){var _0x55b383={};_0x55b383[_0x286842[_0xed73('0x29')]]={'$like':'%'+_0x455d89['query']['filter']+'%'};return _0x55b383;}})});}_0x331ce5=_[_0xed73('0x3d')]({},_0x331ce5,_0x455d89['options']);var _0x3ca6b8={'where':_0x331ce5[_0xed73('0x3c')]};return db['DeskConfiguration'][_0xed73('0x1f')](_0x3ca6b8)[_0xed73('0x26')](function(_0x235fcb){_0x64b337[_0xed73('0x1f')]=_0x235fcb;if(_0x455d89[_0xed73('0x35')][_0xed73('0x3f')]){_0x331ce5[_0xed73('0x40')]=[{'all':!![]}];}return db[_0xed73('0x41')][_0xed73('0x42')](_0x331ce5);})['then'](function(_0xdc0883){_0x64b337['rows']=_0xdc0883;return _0x64b337;})['then'](respondWithFilteredResult(_0x299c9e,_0x331ce5))[_0xed73('0x43')](handleError(_0x299c9e,null));};exports[_0xed73('0x44')]=function(_0x448349,_0x10ab30){var _0x2797f7={'raw':![],'where':{'id':_0x448349['params']['id']}},_0x28069b={};_0x28069b[_0xed73('0x31')]=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x28069b[_0xed73('0x35')]=_[_0xed73('0x32')](_0x448349[_0xed73('0x35')]);_0x28069b[_0xed73('0x33')]=_['intersection'](_0x28069b['model'],_0x28069b[_0xed73('0x35')]);_0x2797f7['attributes']=_[_0xed73('0x34')](_0x28069b[_0xed73('0x31')],qs[_0xed73('0x37')](_0x448349[_0xed73('0x35')][_0xed73('0x37')]));_0x2797f7['attributes']=_0x2797f7['attributes'][_0xed73('0x38')]?_0x2797f7['attributes']:_0x28069b[_0xed73('0x31')];if(_0x448349[_0xed73('0x35')][_0xed73('0x3f')]){_0x2797f7[_0xed73('0x40')]=[{'all':!![]}];}_0x2797f7=_[_0xed73('0x3d')]({},_0x2797f7,_0x448349[_0xed73('0x45')]);return db['DeskConfiguration'][_0xed73('0x46')](_0x2797f7)[_0xed73('0x26')](handleEntityNotFound(_0x10ab30,null))[_0xed73('0x26')](respondWithResult(_0x10ab30,null))[_0xed73('0x43')](handleError(_0x10ab30,null));};exports[_0xed73('0x47')]=function(_0x233b0f,_0x19fb32){return db['DeskConfiguration'][_0xed73('0x47')](_0x233b0f['body'],{})[_0xed73('0x26')](respondWithResult(_0x19fb32,0xc9))['catch'](handleError(_0x19fb32,null));};exports[_0xed73('0x48')]=function(_0x7c7ad2,_0x4d8d12){if(_0x7c7ad2[_0xed73('0x49')]['id']){delete _0x7c7ad2['body']['id'];}return db[_0xed73('0x41')][_0xed73('0x46')]({'where':{'id':_0x7c7ad2[_0xed73('0x4a')]['id']}})[_0xed73('0x26')](handleEntityNotFound(_0x4d8d12,null))[_0xed73('0x26')](saveUpdates(_0x7c7ad2[_0xed73('0x49')],null))[_0xed73('0x26')](respondWithResult(_0x4d8d12,null))[_0xed73('0x43')](handleError(_0x4d8d12,null));};exports['destroy']=function(_0x4101a6,_0x1cfacf){return db[_0xed73('0x41')][_0xed73('0x46')]({'where':{'id':_0x4101a6[_0xed73('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1cfacf,null))[_0xed73('0x26')](removeEntity(_0x1cfacf,null))[_0xed73('0x43')](handleError(_0x1cfacf,null));};exports[_0xed73('0x4b')]=function(_0x26b1d3,_0x30bb76,_0x105caa){var _0x2d8929={};var _0x1e56b7={};var _0x326038;var _0x51231d;return db[_0xed73('0x41')][_0xed73('0x4c')]({'where':{'id':_0x26b1d3[_0xed73('0x4a')]['id']}})['then'](handleEntityNotFound(_0x30bb76,null))['then'](function(_0xa1a8a){if(_0xa1a8a){_0x326038=_0xa1a8a;_0x1e56b7['model']=_[_0xed73('0x32')](db['DeskField'][_0xed73('0x2d')]);_0x1e56b7[_0xed73('0x35')]=_[_0xed73('0x32')](_0x26b1d3['query']);_0x1e56b7[_0xed73('0x33')]=_['intersection'](_0x1e56b7[_0xed73('0x31')],_0x1e56b7['query']);_0x2d8929[_0xed73('0x36')]=_['intersection'](_0x1e56b7[_0xed73('0x31')],qs[_0xed73('0x37')](_0x26b1d3[_0xed73('0x35')]['fields']));_0x2d8929['attributes']=_0x2d8929[_0xed73('0x36')][_0xed73('0x38')]?_0x2d8929[_0xed73('0x36')]:_0x1e56b7['model'];_0x2d8929['order']=qs['sort'](_0x26b1d3['query'][_0xed73('0x3a')]);_0x2d8929[_0xed73('0x3c')]=qs['filters'](_[_0xed73('0x4d')](_0x26b1d3[_0xed73('0x35')],_0x1e56b7[_0xed73('0x33')]));if(_0x26b1d3[_0xed73('0x35')][_0xed73('0x3b')]){_0x2d8929['where']=_[_0xed73('0x3d')](_0x2d8929[_0xed73('0x3c')],{'$or':_['map'](_0x2d8929[_0xed73('0x36')],function(_0x18c7ca){var _0x3669b1={};_0x3669b1[_0x18c7ca]={'$like':'%'+_0x26b1d3['query'][_0xed73('0x3b')]+'%'};return _0x3669b1;})});}_0x2d8929=_[_0xed73('0x3d')]({},_0x2d8929,_0x26b1d3[_0xed73('0x45')]);return _0x326038[_0xed73('0x4b')](_0x2d8929);}})[_0xed73('0x26')](function(_0x4b4ce7){if(_0x4b4ce7){_0x51231d=_0x4b4ce7[_0xed73('0x38')];if(!_0x26b1d3['query']['hasOwnProperty'](_0xed73('0x4e'))){_0x2d8929['limit']=qs['limit'](_0x26b1d3[_0xed73('0x35')]['limit']);_0x2d8929[_0xed73('0x1c')]=qs[_0xed73('0x1c')](_0x26b1d3[_0xed73('0x35')]['offset']);}return _0x326038[_0xed73('0x4b')](_0x2d8929);}})['then'](function(_0x4d7fc9){if(_0x4d7fc9){return _0x4d7fc9?{'count':_0x51231d,'rows':_0x4d7fc9}:null;}})['then'](respondWithResult(_0x30bb76,null))['catch'](handleError(_0x30bb76,null));};exports[_0xed73('0x4f')]=function(_0x2d917a,_0x3e8182,_0x3f4dd6){var _0x1bd72c={};var _0x49a75b={};var _0x4fd29f;var _0x49a188;return db['DeskConfiguration'][_0xed73('0x4c')]({'where':{'id':_0x2d917a[_0xed73('0x4a')]['id']}})[_0xed73('0x26')](handleEntityNotFound(_0x3e8182,null))[_0xed73('0x26')](function(_0x5c36a0){if(_0x5c36a0){_0x4fd29f=_0x5c36a0;_0x49a75b[_0xed73('0x31')]=_[_0xed73('0x32')](db['DeskField'][_0xed73('0x2d')]);_0x49a75b['query']=_['keys'](_0x2d917a[_0xed73('0x35')]);_0x49a75b[_0xed73('0x33')]=_['intersection'](_0x49a75b[_0xed73('0x31')],_0x49a75b[_0xed73('0x35')]);_0x1bd72c[_0xed73('0x36')]=_['intersection'](_0x49a75b['model'],qs['fields'](_0x2d917a[_0xed73('0x35')][_0xed73('0x37')]));_0x1bd72c[_0xed73('0x36')]=_0x1bd72c[_0xed73('0x36')]['length']?_0x1bd72c[_0xed73('0x36')]:_0x49a75b[_0xed73('0x31')];_0x1bd72c['order']=qs[_0xed73('0x3a')](_0x2d917a['query'][_0xed73('0x3a')]);_0x1bd72c[_0xed73('0x3c')]=qs[_0xed73('0x33')](_[_0xed73('0x4d')](_0x2d917a['query'],_0x49a75b['filters']));if(_0x2d917a['query']['filter']){_0x1bd72c[_0xed73('0x3c')]=_[_0xed73('0x3d')](_0x1bd72c[_0xed73('0x3c')],{'$or':_['map'](_0x1bd72c['attributes'],function(_0x4809f3){var _0x3c3829={};_0x3c3829[_0x4809f3]={'$like':'%'+_0x2d917a['query'][_0xed73('0x3b')]+'%'};return _0x3c3829;})});}_0x1bd72c=_[_0xed73('0x3d')]({},_0x1bd72c,_0x2d917a[_0xed73('0x45')]);return _0x4fd29f[_0xed73('0x4f')](_0x1bd72c);}})[_0xed73('0x26')](function(_0x3c28cb){if(_0x3c28cb){_0x49a188=_0x3c28cb['length'];if(!_0x2d917a['query']['hasOwnProperty'](_0xed73('0x4e'))){_0x1bd72c[_0xed73('0x1e')]=qs[_0xed73('0x1e')](_0x2d917a[_0xed73('0x35')][_0xed73('0x1e')]);_0x1bd72c['offset']=qs[_0xed73('0x1c')](_0x2d917a['query']['offset']);}return _0x4fd29f['getSubjects'](_0x1bd72c);}})[_0xed73('0x26')](function(_0x4067e2){if(_0x4067e2){return _0x4067e2?{'count':_0x49a188,'rows':_0x4067e2}:null;}})[_0xed73('0x26')](respondWithResult(_0x3e8182,null))[_0xed73('0x43')](handleError(_0x3e8182,null));};exports[_0xed73('0x50')]=function(_0x11ef2c,_0x27aa04,_0x28ab33){var _0x3b794d={};var _0x57abfb={};var _0x502ab7;var _0x4ffeb4;return db['DeskConfiguration'][_0xed73('0x4c')]({'where':{'id':_0x11ef2c['params']['id']}})[_0xed73('0x26')](handleEntityNotFound(_0x27aa04,null))[_0xed73('0x26')](function(_0x5effe8){if(_0x5effe8){_0x502ab7=_0x5effe8;_0x57abfb[_0xed73('0x31')]=_[_0xed73('0x32')](db[_0xed73('0x51')][_0xed73('0x2d')]);_0x57abfb[_0xed73('0x35')]=_['keys'](_0x11ef2c[_0xed73('0x35')]);_0x57abfb[_0xed73('0x33')]=_['intersection'](_0x57abfb[_0xed73('0x31')],_0x57abfb['query']);_0x3b794d[_0xed73('0x36')]=_[_0xed73('0x34')](_0x57abfb[_0xed73('0x31')],qs[_0xed73('0x37')](_0x11ef2c[_0xed73('0x35')][_0xed73('0x37')]));_0x3b794d[_0xed73('0x36')]=_0x3b794d[_0xed73('0x36')]['length']?_0x3b794d[_0xed73('0x36')]:_0x57abfb['model'];_0x3b794d['order']=qs['sort'](_0x11ef2c[_0xed73('0x35')][_0xed73('0x3a')]);_0x3b794d['where']=qs['filters'](_[_0xed73('0x4d')](_0x11ef2c[_0xed73('0x35')],_0x57abfb[_0xed73('0x33')]));if(_0x11ef2c['query'][_0xed73('0x3b')]){_0x3b794d[_0xed73('0x3c')]=_['merge'](_0x3b794d[_0xed73('0x3c')],{'$or':_[_0xed73('0x2c')](_0x3b794d[_0xed73('0x36')],function(_0x54e71a){var _0x39708c={};_0x39708c[_0x54e71a]={'$like':'%'+_0x11ef2c[_0xed73('0x35')][_0xed73('0x3b')]+'%'};return _0x39708c;})});}_0x3b794d=_[_0xed73('0x3d')]({},_0x3b794d,_0x11ef2c['options']);return _0x502ab7[_0xed73('0x50')](_0x3b794d);}})[_0xed73('0x26')](function(_0x34e3bc){if(_0x34e3bc){_0x4ffeb4=_0x34e3bc[_0xed73('0x38')];if(!_0x11ef2c['query']['hasOwnProperty'](_0xed73('0x4e'))){_0x3b794d['limit']=qs[_0xed73('0x1e')](_0x11ef2c[_0xed73('0x35')][_0xed73('0x1e')]);_0x3b794d[_0xed73('0x1c')]=qs['offset'](_0x11ef2c[_0xed73('0x35')][_0xed73('0x1c')]);}return _0x502ab7['getDescriptions'](_0x3b794d);}})[_0xed73('0x26')](function(_0x5e2d3a){if(_0x5e2d3a){return _0x5e2d3a?{'count':_0x4ffeb4,'rows':_0x5e2d3a}:null;}})[_0xed73('0x26')](respondWithResult(_0x27aa04,null))['catch'](handleError(_0x27aa04,null));};exports[_0xed73('0x52')]=function(_0x18ae25,_0x1990ea,_0x1b2e84){var _0x49ecf4={};var _0x148756={};var _0x406e7f;var _0x248f75;return db[_0xed73('0x41')][_0xed73('0x4c')]({'where':{'id':_0x18ae25['params']['id']}})[_0xed73('0x26')](handleEntityNotFound(_0x1990ea,null))[_0xed73('0x26')](function(_0x2aaa75){if(_0x2aaa75){_0x406e7f=_0x2aaa75;_0x148756[_0xed73('0x31')]=_[_0xed73('0x32')](db[_0xed73('0x53')][_0xed73('0x2d')]);_0x148756['query']=_[_0xed73('0x32')](_0x18ae25[_0xed73('0x35')]);_0x148756['filters']=_[_0xed73('0x34')](_0x148756[_0xed73('0x31')],_0x148756[_0xed73('0x35')]);_0x49ecf4['attributes']=_['intersection'](_0x148756[_0xed73('0x31')],qs[_0xed73('0x37')](_0x18ae25[_0xed73('0x35')][_0xed73('0x37')]));_0x49ecf4[_0xed73('0x36')]=_0x49ecf4[_0xed73('0x36')][_0xed73('0x38')]?_0x49ecf4[_0xed73('0x36')]:_0x148756['model'];_0x49ecf4[_0xed73('0x39')]=qs[_0xed73('0x3a')](_0x18ae25[_0xed73('0x35')][_0xed73('0x3a')]);_0x49ecf4[_0xed73('0x3c')]=qs[_0xed73('0x33')](_['pick'](_0x18ae25[_0xed73('0x35')],_0x148756[_0xed73('0x33')]));if(_0x18ae25[_0xed73('0x35')]['filter']){_0x49ecf4[_0xed73('0x3c')]=_[_0xed73('0x3d')](_0x49ecf4[_0xed73('0x3c')],{'$or':_[_0xed73('0x2c')](_0x49ecf4[_0xed73('0x36')],function(_0x437404){var _0x5e1790={};_0x5e1790[_0x437404]={'$like':'%'+_0x18ae25[_0xed73('0x35')][_0xed73('0x3b')]+'%'};return _0x5e1790;})});}_0x49ecf4=_[_0xed73('0x3d')]({},_0x49ecf4,_0x18ae25['options']);return _0x406e7f[_0xed73('0x52')](_0x49ecf4);}})[_0xed73('0x26')](function(_0x1a225d){if(_0x1a225d){_0x248f75=_0x1a225d[_0xed73('0x38')];if(!_0x18ae25['query'][_0xed73('0x54')](_0xed73('0x4e'))){_0x49ecf4[_0xed73('0x1e')]=qs[_0xed73('0x1e')](_0x18ae25[_0xed73('0x35')][_0xed73('0x1e')]);_0x49ecf4[_0xed73('0x1c')]=qs['offset'](_0x18ae25[_0xed73('0x35')]['offset']);}return _0x406e7f[_0xed73('0x52')](_0x49ecf4);}})[_0xed73('0x26')](function(_0x274e2f){if(_0x274e2f){return _0x274e2f?{'count':_0x248f75,'rows':_0x274e2f}:null;}})[_0xed73('0x26')](respondWithResult(_0x1990ea,null))[_0xed73('0x43')](handleError(_0x1990ea,null));};exports[_0xed73('0x55')]=function(_0xa6fde2,_0x10085c,_0x5d5c1d){if(_0xa6fde2[_0xed73('0x49')]['id']){delete _0xa6fde2[_0xed73('0x49')]['id'];}return db[_0xed73('0x41')][_0xed73('0x4c')]({'where':{'id':_0xa6fde2['params']['id']}})[_0xed73('0x26')](handleEntityNotFound(_0x10085c,null))[_0xed73('0x26')](function(_0x23edb8){if(_0x23edb8){return _0x23edb8['setTags'](_0xa6fde2[_0xed73('0x49')][_0xed73('0x56')]||[]);}return null;})[_0xed73('0x26')](respondWithResult(_0x10085c,null))[_0xed73('0x43')](handleError(_0x10085c,null));}; \ No newline at end of file +var _0xbf2d=['fast-json-patch','request-promise','bluebird','mustache','path','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/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','show','catch','create','body','find','params','getFields','findOne','DeskField','sort','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf'];(function(_0xab9958,_0x11023f){var _0x1f1cae=function(_0x5cf4dc){while(--_0x5cf4dc){_0xab9958['push'](_0xab9958['shift']());}};_0x1f1cae(++_0x11023f);}(_0xbf2d,0xfa));var _0xdbf2=function(_0x49d826,_0xdfaf0d){_0x49d826=_0x49d826-0x0;var _0x447db2=_0xbf2d[_0x49d826];return _0x447db2;};'use strict';var emlformat=require(_0xdbf2('0x0'));var rimraf=require(_0xdbf2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdbf2('0x2'));var rp=require(_0xdbf2('0x3'));var moment=require('moment');var BPromise=require(_0xdbf2('0x4'));var Mustache=require(_0xdbf2('0x5'));var util=require('util');var path=require(_0xdbf2('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdbf2('0x7'));var fs=require('fs');var fs_extra=require(_0xdbf2('0x8'));var _=require(_0xdbf2('0x9'));var squel=require(_0xdbf2('0xa'));var crypto=require(_0xdbf2('0xb'));var jsforce=require(_0xdbf2('0xc'));var deskjs=require(_0xdbf2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdbf2('0xe'));var Papa=require(_0xdbf2('0xf'));var Redis=require(_0xdbf2('0x10'));var authService=require(_0xdbf2('0x11'));var qs=require(_0xdbf2('0x12'));var as=require(_0xdbf2('0x13'));var hardwareService=require(_0xdbf2('0x14'));var logger=require(_0xdbf2('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xdbf2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdbf2('0x17'))['db'];function respondWithStatusCode(_0x123bd2,_0x195f06){_0x195f06=_0x195f06||0xcc;return function(_0x39accd){if(_0x39accd){return _0x123bd2[_0xdbf2('0x18')](_0x195f06);}return _0x123bd2[_0xdbf2('0x19')](_0x195f06)[_0xdbf2('0x1a')]();};}function respondWithResult(_0x23f71f,_0x21b755){_0x21b755=_0x21b755||0xc8;return function(_0x2b1b4f){if(_0x2b1b4f){return _0x23f71f[_0xdbf2('0x19')](_0x21b755)[_0xdbf2('0x1b')](_0x2b1b4f);}};}function respondWithFilteredResult(_0xdbd468,_0x4f0495){return function(_0x5051cc){if(_0x5051cc){var _0x1b4e0a=typeof _0x4f0495[_0xdbf2('0x1c')]==='undefined'&&typeof _0x4f0495['limit']===_0xdbf2('0x1d');var _0x33a4b0=_0x5051cc['count'];var _0x50b5b4=_0x1b4e0a?0x0:_0x4f0495['offset'];var _0x4ede81=_0x1b4e0a?_0x5051cc['count']:_0x4f0495[_0xdbf2('0x1c')]+_0x4f0495[_0xdbf2('0x1e')];var _0x37e707;if(_0x4ede81>=_0x33a4b0){_0x4ede81=_0x33a4b0;_0x37e707=0xc8;}else{_0x37e707=0xce;}_0xdbd468[_0xdbf2('0x19')](_0x37e707);return _0xdbd468[_0xdbf2('0x1f')](_0xdbf2('0x20'),_0x50b5b4+'-'+_0x4ede81+'/'+_0x33a4b0)[_0xdbf2('0x1b')](_0x5051cc);}return null;};}function patchUpdates(_0x3cec76){return function(_0xac613c){try{jsonpatch[_0xdbf2('0x21')](_0xac613c,_0x3cec76,!![]);}catch(_0x583731){return BPromise[_0xdbf2('0x22')](_0x583731);}return _0xac613c[_0xdbf2('0x23')]();};}function saveUpdates(_0x2cf3ff,_0x31ab01){return function(_0x117e5d){if(_0x117e5d){return _0x117e5d[_0xdbf2('0x24')](_0x2cf3ff)[_0xdbf2('0x25')](function(_0x17a5bf){return _0x17a5bf;});}return null;};}function removeEntity(_0x3ccb69,_0x531927){return function(_0x373634){if(_0x373634){return _0x373634[_0xdbf2('0x26')]()[_0xdbf2('0x25')](function(){_0x3ccb69[_0xdbf2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cd0a4,_0x4f2e17){return function(_0x1e808a){if(!_0x1e808a){_0x4cd0a4['sendStatus'](0x194);}return _0x1e808a;};}function handleError(_0x1b4ab2,_0x3b6961){_0x3b6961=_0x3b6961||0x1f4;return function(_0x4f8053){logger['error'](_0x4f8053[_0xdbf2('0x27')]);if(_0x4f8053[_0xdbf2('0x28')]){delete _0x4f8053[_0xdbf2('0x28')];}_0x1b4ab2[_0xdbf2('0x19')](_0x3b6961)['send'](_0x4f8053);};}exports[_0xdbf2('0x29')]=function(_0x3cec43,_0x3c06ec){var _0x441f28={},_0x23f311={},_0x5042f1={'count':0x0,'rows':[]};var _0x2ff128=_[_0xdbf2('0x2a')](db[_0xdbf2('0x2b')][_0xdbf2('0x2c')],function(_0x2d12d6){return{'name':_0x2d12d6[_0xdbf2('0x2d')],'type':_0x2d12d6[_0xdbf2('0x2e')][_0xdbf2('0x2f')]};});_0x23f311[_0xdbf2('0x30')]=_[_0xdbf2('0x2a')](_0x2ff128,_0xdbf2('0x28'));_0x23f311[_0xdbf2('0x31')]=_[_0xdbf2('0x32')](_0x3cec43['query']);_0x23f311[_0xdbf2('0x33')]=_[_0xdbf2('0x34')](_0x23f311[_0xdbf2('0x30')],_0x23f311[_0xdbf2('0x31')]);_0x441f28[_0xdbf2('0x35')]=_['intersection'](_0x23f311[_0xdbf2('0x30')],qs[_0xdbf2('0x36')](_0x3cec43[_0xdbf2('0x31')]['fields']));_0x441f28[_0xdbf2('0x35')]=_0x441f28['attributes'][_0xdbf2('0x37')]?_0x441f28[_0xdbf2('0x35')]:_0x23f311[_0xdbf2('0x30')];if(!_0x3cec43[_0xdbf2('0x31')][_0xdbf2('0x38')](_0xdbf2('0x39'))){_0x441f28[_0xdbf2('0x1e')]=qs['limit'](_0x3cec43[_0xdbf2('0x31')][_0xdbf2('0x1e')]);_0x441f28[_0xdbf2('0x1c')]=qs['offset'](_0x3cec43[_0xdbf2('0x31')][_0xdbf2('0x1c')]);}_0x441f28[_0xdbf2('0x3a')]=qs['sort'](_0x3cec43[_0xdbf2('0x31')]['sort']);_0x441f28[_0xdbf2('0x3b')]=qs[_0xdbf2('0x33')](_[_0xdbf2('0x3c')](_0x3cec43[_0xdbf2('0x31')],_0x23f311['filters']),_0x2ff128);if(_0x3cec43[_0xdbf2('0x31')]['filter']){_0x441f28[_0xdbf2('0x3b')]=_['merge'](_0x441f28[_0xdbf2('0x3b')],{'$or':_['map'](_0x2ff128,function(_0x45c304){if(_0x45c304[_0xdbf2('0x2e')]!=='VIRTUAL'){var _0x554f80={};_0x554f80[_0x45c304[_0xdbf2('0x28')]]={'$like':'%'+_0x3cec43['query'][_0xdbf2('0x3d')]+'%'};return _0x554f80;}})});}_0x441f28=_[_0xdbf2('0x3e')]({},_0x441f28,_0x3cec43[_0xdbf2('0x3f')]);var _0x10f9cd={'where':_0x441f28[_0xdbf2('0x3b')]};return db[_0xdbf2('0x2b')][_0xdbf2('0x40')](_0x10f9cd)[_0xdbf2('0x25')](function(_0x4394e4){_0x5042f1['count']=_0x4394e4;if(_0x3cec43[_0xdbf2('0x31')][_0xdbf2('0x41')]){_0x441f28[_0xdbf2('0x42')]=[{'all':!![]}];}return db[_0xdbf2('0x2b')][_0xdbf2('0x43')](_0x441f28);})[_0xdbf2('0x25')](function(_0x9771cb){_0x5042f1[_0xdbf2('0x44')]=_0x9771cb;return _0x5042f1;})['then'](respondWithFilteredResult(_0x3c06ec,_0x441f28))['catch'](handleError(_0x3c06ec,null));};exports[_0xdbf2('0x45')]=function(_0xe24eee,_0x37c8fd){var _0x1bdc56={'raw':![],'where':{'id':_0xe24eee['params']['id']}},_0x5b9868={};_0x5b9868[_0xdbf2('0x30')]=_[_0xdbf2('0x32')](db[_0xdbf2('0x2b')][_0xdbf2('0x2c')]);_0x5b9868[_0xdbf2('0x31')]=_['keys'](_0xe24eee[_0xdbf2('0x31')]);_0x5b9868[_0xdbf2('0x33')]=_[_0xdbf2('0x34')](_0x5b9868[_0xdbf2('0x30')],_0x5b9868['query']);_0x1bdc56[_0xdbf2('0x35')]=_[_0xdbf2('0x34')](_0x5b9868[_0xdbf2('0x30')],qs[_0xdbf2('0x36')](_0xe24eee['query'][_0xdbf2('0x36')]));_0x1bdc56['attributes']=_0x1bdc56['attributes'][_0xdbf2('0x37')]?_0x1bdc56[_0xdbf2('0x35')]:_0x5b9868[_0xdbf2('0x30')];if(_0xe24eee[_0xdbf2('0x31')][_0xdbf2('0x41')]){_0x1bdc56[_0xdbf2('0x42')]=[{'all':!![]}];}_0x1bdc56=_[_0xdbf2('0x3e')]({},_0x1bdc56,_0xe24eee[_0xdbf2('0x3f')]);return db[_0xdbf2('0x2b')]['find'](_0x1bdc56)[_0xdbf2('0x25')](handleEntityNotFound(_0x37c8fd,null))[_0xdbf2('0x25')](respondWithResult(_0x37c8fd,null))[_0xdbf2('0x46')](handleError(_0x37c8fd,null));};exports[_0xdbf2('0x47')]=function(_0x30b595,_0x339fec){return db[_0xdbf2('0x2b')][_0xdbf2('0x47')](_0x30b595[_0xdbf2('0x48')],{})[_0xdbf2('0x25')](respondWithResult(_0x339fec,0xc9))[_0xdbf2('0x46')](handleError(_0x339fec,null));};exports['update']=function(_0x316b3b,_0x4cd281){if(_0x316b3b['body']['id']){delete _0x316b3b[_0xdbf2('0x48')]['id'];}return db[_0xdbf2('0x2b')][_0xdbf2('0x49')]({'where':{'id':_0x316b3b[_0xdbf2('0x4a')]['id']}})[_0xdbf2('0x25')](handleEntityNotFound(_0x4cd281,null))[_0xdbf2('0x25')](saveUpdates(_0x316b3b['body'],null))[_0xdbf2('0x25')](respondWithResult(_0x4cd281,null))[_0xdbf2('0x46')](handleError(_0x4cd281,null));};exports[_0xdbf2('0x26')]=function(_0x2501ff,_0x37522f){return db[_0xdbf2('0x2b')][_0xdbf2('0x49')]({'where':{'id':_0x2501ff[_0xdbf2('0x4a')]['id']}})[_0xdbf2('0x25')](handleEntityNotFound(_0x37522f,null))['then'](removeEntity(_0x37522f,null))[_0xdbf2('0x46')](handleError(_0x37522f,null));};exports[_0xdbf2('0x4b')]=function(_0x5ab187,_0x3478d8,_0x576ff9){var _0x184fd8={};var _0x3b6c2f={};var _0x316759;var _0x231bf;return db['DeskConfiguration'][_0xdbf2('0x4c')]({'where':{'id':_0x5ab187['params']['id']}})[_0xdbf2('0x25')](handleEntityNotFound(_0x3478d8,null))[_0xdbf2('0x25')](function(_0x3c1c44){if(_0x3c1c44){_0x316759=_0x3c1c44;_0x3b6c2f[_0xdbf2('0x30')]=_[_0xdbf2('0x32')](db[_0xdbf2('0x4d')][_0xdbf2('0x2c')]);_0x3b6c2f[_0xdbf2('0x31')]=_[_0xdbf2('0x32')](_0x5ab187[_0xdbf2('0x31')]);_0x3b6c2f[_0xdbf2('0x33')]=_[_0xdbf2('0x34')](_0x3b6c2f[_0xdbf2('0x30')],_0x3b6c2f['query']);_0x184fd8['attributes']=_[_0xdbf2('0x34')](_0x3b6c2f[_0xdbf2('0x30')],qs[_0xdbf2('0x36')](_0x5ab187[_0xdbf2('0x31')][_0xdbf2('0x36')]));_0x184fd8[_0xdbf2('0x35')]=_0x184fd8[_0xdbf2('0x35')]['length']?_0x184fd8[_0xdbf2('0x35')]:_0x3b6c2f[_0xdbf2('0x30')];_0x184fd8['order']=qs[_0xdbf2('0x4e')](_0x5ab187['query'][_0xdbf2('0x4e')]);_0x184fd8[_0xdbf2('0x3b')]=qs[_0xdbf2('0x33')](_[_0xdbf2('0x3c')](_0x5ab187[_0xdbf2('0x31')],_0x3b6c2f['filters']));if(_0x5ab187[_0xdbf2('0x31')][_0xdbf2('0x3d')]){_0x184fd8['where']=_['merge'](_0x184fd8['where'],{'$or':_[_0xdbf2('0x2a')](_0x184fd8[_0xdbf2('0x35')],function(_0x55dd45){var _0x2d494e={};_0x2d494e[_0x55dd45]={'$like':'%'+_0x5ab187[_0xdbf2('0x31')]['filter']+'%'};return _0x2d494e;})});}_0x184fd8=_['merge']({},_0x184fd8,_0x5ab187[_0xdbf2('0x3f')]);return _0x316759['getFields'](_0x184fd8);}})['then'](function(_0x25a7d2){if(_0x25a7d2){_0x231bf=_0x25a7d2[_0xdbf2('0x37')];if(!_0x5ab187[_0xdbf2('0x31')][_0xdbf2('0x38')]('nolimit')){_0x184fd8[_0xdbf2('0x1e')]=qs[_0xdbf2('0x1e')](_0x5ab187[_0xdbf2('0x31')][_0xdbf2('0x1e')]);_0x184fd8[_0xdbf2('0x1c')]=qs['offset'](_0x5ab187[_0xdbf2('0x31')][_0xdbf2('0x1c')]);}return _0x316759[_0xdbf2('0x4b')](_0x184fd8);}})['then'](function(_0x2cdae2){if(_0x2cdae2){return _0x2cdae2?{'count':_0x231bf,'rows':_0x2cdae2}:null;}})['then'](respondWithResult(_0x3478d8,null))[_0xdbf2('0x46')](handleError(_0x3478d8,null));};exports[_0xdbf2('0x4f')]=function(_0x4204e7,_0x327a19,_0x15b190){var _0x48a251={};var _0x4c0e15={};var _0x10c9db;var _0xeff83e;return db[_0xdbf2('0x2b')][_0xdbf2('0x4c')]({'where':{'id':_0x4204e7['params']['id']}})[_0xdbf2('0x25')](handleEntityNotFound(_0x327a19,null))['then'](function(_0x5efeb9){if(_0x5efeb9){_0x10c9db=_0x5efeb9;_0x4c0e15[_0xdbf2('0x30')]=_[_0xdbf2('0x32')](db['DeskField']['rawAttributes']);_0x4c0e15[_0xdbf2('0x31')]=_['keys'](_0x4204e7[_0xdbf2('0x31')]);_0x4c0e15[_0xdbf2('0x33')]=_[_0xdbf2('0x34')](_0x4c0e15['model'],_0x4c0e15[_0xdbf2('0x31')]);_0x48a251['attributes']=_['intersection'](_0x4c0e15[_0xdbf2('0x30')],qs[_0xdbf2('0x36')](_0x4204e7[_0xdbf2('0x31')][_0xdbf2('0x36')]));_0x48a251[_0xdbf2('0x35')]=_0x48a251[_0xdbf2('0x35')][_0xdbf2('0x37')]?_0x48a251[_0xdbf2('0x35')]:_0x4c0e15['model'];_0x48a251[_0xdbf2('0x3a')]=qs[_0xdbf2('0x4e')](_0x4204e7[_0xdbf2('0x31')][_0xdbf2('0x4e')]);_0x48a251[_0xdbf2('0x3b')]=qs['filters'](_[_0xdbf2('0x3c')](_0x4204e7[_0xdbf2('0x31')],_0x4c0e15[_0xdbf2('0x33')]));if(_0x4204e7[_0xdbf2('0x31')][_0xdbf2('0x3d')]){_0x48a251['where']=_[_0xdbf2('0x3e')](_0x48a251[_0xdbf2('0x3b')],{'$or':_['map'](_0x48a251[_0xdbf2('0x35')],function(_0x254314){var _0x402676={};_0x402676[_0x254314]={'$like':'%'+_0x4204e7['query'][_0xdbf2('0x3d')]+'%'};return _0x402676;})});}_0x48a251=_[_0xdbf2('0x3e')]({},_0x48a251,_0x4204e7[_0xdbf2('0x3f')]);return _0x10c9db[_0xdbf2('0x4f')](_0x48a251);}})[_0xdbf2('0x25')](function(_0x1125a8){if(_0x1125a8){_0xeff83e=_0x1125a8[_0xdbf2('0x37')];if(!_0x4204e7[_0xdbf2('0x31')][_0xdbf2('0x38')]('nolimit')){_0x48a251[_0xdbf2('0x1e')]=qs['limit'](_0x4204e7['query'][_0xdbf2('0x1e')]);_0x48a251['offset']=qs[_0xdbf2('0x1c')](_0x4204e7[_0xdbf2('0x31')][_0xdbf2('0x1c')]);}return _0x10c9db[_0xdbf2('0x4f')](_0x48a251);}})[_0xdbf2('0x25')](function(_0x3ef0f4){if(_0x3ef0f4){return _0x3ef0f4?{'count':_0xeff83e,'rows':_0x3ef0f4}:null;}})[_0xdbf2('0x25')](respondWithResult(_0x327a19,null))['catch'](handleError(_0x327a19,null));};exports[_0xdbf2('0x50')]=function(_0x3e7f77,_0x1f0114,_0xaa8971){var _0x3a46fc={};var _0x51290d={};var _0x587207;var _0x89237d;return db['DeskConfiguration']['findOne']({'where':{'id':_0x3e7f77[_0xdbf2('0x4a')]['id']}})[_0xdbf2('0x25')](handleEntityNotFound(_0x1f0114,null))[_0xdbf2('0x25')](function(_0x14f1c0){if(_0x14f1c0){_0x587207=_0x14f1c0;_0x51290d[_0xdbf2('0x30')]=_[_0xdbf2('0x32')](db[_0xdbf2('0x4d')]['rawAttributes']);_0x51290d[_0xdbf2('0x31')]=_[_0xdbf2('0x32')](_0x3e7f77[_0xdbf2('0x31')]);_0x51290d[_0xdbf2('0x33')]=_['intersection'](_0x51290d[_0xdbf2('0x30')],_0x51290d[_0xdbf2('0x31')]);_0x3a46fc[_0xdbf2('0x35')]=_['intersection'](_0x51290d[_0xdbf2('0x30')],qs[_0xdbf2('0x36')](_0x3e7f77[_0xdbf2('0x31')]['fields']));_0x3a46fc[_0xdbf2('0x35')]=_0x3a46fc[_0xdbf2('0x35')][_0xdbf2('0x37')]?_0x3a46fc['attributes']:_0x51290d[_0xdbf2('0x30')];_0x3a46fc[_0xdbf2('0x3a')]=qs[_0xdbf2('0x4e')](_0x3e7f77[_0xdbf2('0x31')][_0xdbf2('0x4e')]);_0x3a46fc[_0xdbf2('0x3b')]=qs[_0xdbf2('0x33')](_['pick'](_0x3e7f77[_0xdbf2('0x31')],_0x51290d[_0xdbf2('0x33')]));if(_0x3e7f77[_0xdbf2('0x31')][_0xdbf2('0x3d')]){_0x3a46fc['where']=_[_0xdbf2('0x3e')](_0x3a46fc[_0xdbf2('0x3b')],{'$or':_[_0xdbf2('0x2a')](_0x3a46fc[_0xdbf2('0x35')],function(_0x13a362){var _0x54db00={};_0x54db00[_0x13a362]={'$like':'%'+_0x3e7f77[_0xdbf2('0x31')][_0xdbf2('0x3d')]+'%'};return _0x54db00;})});}_0x3a46fc=_['merge']({},_0x3a46fc,_0x3e7f77[_0xdbf2('0x3f')]);return _0x587207[_0xdbf2('0x50')](_0x3a46fc);}})[_0xdbf2('0x25')](function(_0x4f8828){if(_0x4f8828){_0x89237d=_0x4f8828['length'];if(!_0x3e7f77[_0xdbf2('0x31')][_0xdbf2('0x38')](_0xdbf2('0x39'))){_0x3a46fc[_0xdbf2('0x1e')]=qs['limit'](_0x3e7f77[_0xdbf2('0x31')][_0xdbf2('0x1e')]);_0x3a46fc[_0xdbf2('0x1c')]=qs[_0xdbf2('0x1c')](_0x3e7f77['query'][_0xdbf2('0x1c')]);}return _0x587207[_0xdbf2('0x50')](_0x3a46fc);}})[_0xdbf2('0x25')](function(_0x22708d){if(_0x22708d){return _0x22708d?{'count':_0x89237d,'rows':_0x22708d}:null;}})['then'](respondWithResult(_0x1f0114,null))[_0xdbf2('0x46')](handleError(_0x1f0114,null));};exports[_0xdbf2('0x51')]=function(_0x11346e,_0x47341d,_0x15dc9b){var _0x1e40e1={};var _0x53d545={};var _0x2e5b30;var _0x157afb;return db['DeskConfiguration'][_0xdbf2('0x4c')]({'where':{'id':_0x11346e[_0xdbf2('0x4a')]['id']}})[_0xdbf2('0x25')](handleEntityNotFound(_0x47341d,null))[_0xdbf2('0x25')](function(_0x2d329c){if(_0x2d329c){_0x2e5b30=_0x2d329c;_0x53d545['model']=_[_0xdbf2('0x32')](db[_0xdbf2('0x52')]['rawAttributes']);_0x53d545[_0xdbf2('0x31')]=_[_0xdbf2('0x32')](_0x11346e[_0xdbf2('0x31')]);_0x53d545[_0xdbf2('0x33')]=_[_0xdbf2('0x34')](_0x53d545[_0xdbf2('0x30')],_0x53d545[_0xdbf2('0x31')]);_0x1e40e1[_0xdbf2('0x35')]=_[_0xdbf2('0x34')](_0x53d545['model'],qs[_0xdbf2('0x36')](_0x11346e['query']['fields']));_0x1e40e1[_0xdbf2('0x35')]=_0x1e40e1[_0xdbf2('0x35')]['length']?_0x1e40e1[_0xdbf2('0x35')]:_0x53d545[_0xdbf2('0x30')];_0x1e40e1[_0xdbf2('0x3a')]=qs[_0xdbf2('0x4e')](_0x11346e['query'][_0xdbf2('0x4e')]);_0x1e40e1[_0xdbf2('0x3b')]=qs['filters'](_['pick'](_0x11346e[_0xdbf2('0x31')],_0x53d545['filters']));if(_0x11346e['query'][_0xdbf2('0x3d')]){_0x1e40e1[_0xdbf2('0x3b')]=_[_0xdbf2('0x3e')](_0x1e40e1[_0xdbf2('0x3b')],{'$or':_['map'](_0x1e40e1[_0xdbf2('0x35')],function(_0x3b77ab){var _0x219a39={};_0x219a39[_0x3b77ab]={'$like':'%'+_0x11346e[_0xdbf2('0x31')][_0xdbf2('0x3d')]+'%'};return _0x219a39;})});}_0x1e40e1=_[_0xdbf2('0x3e')]({},_0x1e40e1,_0x11346e[_0xdbf2('0x3f')]);return _0x2e5b30[_0xdbf2('0x51')](_0x1e40e1);}})[_0xdbf2('0x25')](function(_0x1dc20d){if(_0x1dc20d){_0x157afb=_0x1dc20d[_0xdbf2('0x37')];if(!_0x11346e['query'][_0xdbf2('0x38')](_0xdbf2('0x39'))){_0x1e40e1[_0xdbf2('0x1e')]=qs[_0xdbf2('0x1e')](_0x11346e['query']['limit']);_0x1e40e1[_0xdbf2('0x1c')]=qs[_0xdbf2('0x1c')](_0x11346e['query'][_0xdbf2('0x1c')]);}return _0x2e5b30['getTags'](_0x1e40e1);}})[_0xdbf2('0x25')](function(_0x590fb1){if(_0x590fb1){return _0x590fb1?{'count':_0x157afb,'rows':_0x590fb1}:null;}})[_0xdbf2('0x25')](respondWithResult(_0x47341d,null))[_0xdbf2('0x46')](handleError(_0x47341d,null));};exports[_0xdbf2('0x53')]=function(_0x4fbde5,_0x18ba31,_0x3617e1){if(_0x4fbde5[_0xdbf2('0x48')]['id']){delete _0x4fbde5[_0xdbf2('0x48')]['id'];}return db[_0xdbf2('0x2b')][_0xdbf2('0x4c')]({'where':{'id':_0x4fbde5[_0xdbf2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x18ba31,null))['then'](function(_0x2e9171){if(_0x2e9171){return _0x2e9171[_0xdbf2('0x53')](_0x4fbde5[_0xdbf2('0x48')]['ids']||[]);}return null;})[_0xdbf2('0x25')](respondWithResult(_0x18ba31,null))[_0xdbf2('0x46')](handleError(_0x18ba31,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 6f7df7a..430fe98 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 _0x2f68=['path','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','lodash','util','api','moment','bluebird'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x2f68,0x1a9));var _0x82f6=function(_0x48e894,_0x5165db){_0x48e894=_0x48e894-0x0;var _0x3f2997=_0x2f68[_0x48e894];return _0x3f2997;};'use strict';var _=require(_0x82f6('0x0'));var util=require(_0x82f6('0x1'));var logger=require('../../config/logger')(_0x82f6('0x2'));var moment=require(_0x82f6('0x3'));var BPromise=require(_0x82f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x82f6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x82f6('0x6'));module[_0x82f6('0x7')]=function(_0x18525f,_0x2048e){return _0x18525f[_0x82f6('0x8')](_0x82f6('0x9'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9019=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations'];(function(_0x38d7f0,_0x9f9bd9){var _0x5b30b6=function(_0x441220){while(--_0x441220){_0x38d7f0['push'](_0x38d7f0['shift']());}};_0x5b30b6(++_0x9f9bd9);}(_0x9019,0x9c));var _0x9901=function(_0x430459,_0x58519c){_0x430459=_0x430459-0x0;var _0x3a2439=_0x9019[_0x430459];return _0x3a2439;};'use strict';var _=require(_0x9901('0x0'));var util=require(_0x9901('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9901('0x2'));var BPromise=require(_0x9901('0x3'));var rp=require(_0x9901('0x4'));var fs=require('fs');var path=require(_0x9901('0x5'));var rimraf=require(_0x9901('0x6'));var config=require(_0x9901('0x7'));var attributes=require(_0x9901('0x8'));module[_0x9901('0x9')]=function(_0x32131d,_0x2469d1){return _0x32131d[_0x9901('0xa')]('DeskConfiguration',attributes,{'tableName':_0x9901('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index bf202e3..6af4422 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 _0xafa7=['error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0xafa7,0x122));var _0x7afa=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0xafa7[_0x5f0501];return _0x3c2c45;};'use strict';var _=require(_0x7afa('0x0'));var util=require(_0x7afa('0x1'));var moment=require('moment');var BPromise=require(_0x7afa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7afa('0x3'));var db=require(_0x7afa('0x4'))['db'];var utils=require(_0x7afa('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7afa('0x6'));var jayson=require(_0x7afa('0x7'));var client=jayson[_0x7afa('0x8')][_0x7afa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2243f6,_0x2b826f,_0x59c1f0){return new BPromise(function(_0xde102c,_0x225de7){return client[_0x7afa('0xa')](_0x2243f6,_0x59c1f0)[_0x7afa('0xb')](function(_0x40bff1){logger[_0x7afa('0xc')](_0x7afa('0xd'),_0x2b826f,'request\x20sent');logger[_0x7afa('0xe')](_0x7afa('0xf'),_0x2b826f,_0x7afa('0x10'),JSON[_0x7afa('0x11')](_0x40bff1));if(_0x40bff1[_0x7afa('0x12')]){if(_0x40bff1[_0x7afa('0x12')][_0x7afa('0x13')]===0x1f4){logger[_0x7afa('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x2b826f,_0x40bff1['error']['message']);return _0x225de7(_0x40bff1[_0x7afa('0x12')][_0x7afa('0x14')]);}logger[_0x7afa('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x2b826f,_0x40bff1[_0x7afa('0x12')][_0x7afa('0x14')]);return _0xde102c(_0x40bff1[_0x7afa('0x12')]['message']);}else{logger['info'](_0x7afa('0xd'),_0x2b826f,'request\x20sent');_0xde102c(_0x40bff1[_0x7afa('0x15')]['message']);}})['catch'](function(_0xc6fd10){logger[_0x7afa('0x12')](_0x7afa('0xd'),_0x2b826f,_0xc6fd10);_0x225de7(_0xc6fd10);});});} \ No newline at end of file +var _0x86be=['../../config/utils','../../config/logger','rpc','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x95b44e,_0x4af5e1){var _0x4d33ea=function(_0x35acd6){while(--_0x35acd6){_0x95b44e['push'](_0x95b44e['shift']());}};_0x4d33ea(++_0x4af5e1);}(_0x86be,0x176));var _0xe86b=function(_0x14039a,_0x2510cb){_0x14039a=_0x14039a-0x0;var _0x12a3d0=_0x86be[_0x14039a];return _0x12a3d0;};'use strict';var _=require(_0xe86b('0x0'));var util=require('util');var moment=require(_0xe86b('0x1'));var BPromise=require(_0xe86b('0x2'));var rs=require(_0xe86b('0x3'));var fs=require('fs');var Redis=require(_0xe86b('0x4'));var db=require(_0xe86b('0x5'))['db'];var utils=require(_0xe86b('0x6'));var logger=require(_0xe86b('0x7'))(_0xe86b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe86b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa52177,_0x40aac9,_0x456af3){return new BPromise(function(_0x55daf1,_0x451793){return client[_0xe86b('0xa')](_0xa52177,_0x456af3)[_0xe86b('0xb')](function(_0x58715b){logger[_0xe86b('0xc')](_0xe86b('0xd'),_0x40aac9,_0xe86b('0xe'));logger['debug'](_0xe86b('0xf'),_0x40aac9,_0xe86b('0xe'),JSON[_0xe86b('0x10')](_0x58715b));if(_0x58715b[_0xe86b('0x11')]){if(_0x58715b[_0xe86b('0x11')][_0xe86b('0x12')]===0x1f4){logger[_0xe86b('0x11')](_0xe86b('0xd'),_0x40aac9,_0x58715b['error']['message']);return _0x451793(_0x58715b[_0xe86b('0x11')][_0xe86b('0x13')]);}logger[_0xe86b('0x11')](_0xe86b('0xd'),_0x40aac9,_0x58715b[_0xe86b('0x11')][_0xe86b('0x13')]);return _0x55daf1(_0x58715b[_0xe86b('0x11')][_0xe86b('0x13')]);}else{logger[_0xe86b('0xc')](_0xe86b('0xd'),_0x40aac9,_0xe86b('0xe'));_0x55daf1(_0x58715b['result'][_0xe86b('0x13')]);}})['catch'](function(_0x3c5ad6){logger[_0xe86b('0x11')](_0xe86b('0xd'),_0x40aac9,_0x3c5ad6);_0x451793(_0x3c5ad6);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index f4c993c..55f544e 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 _0x75ab=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','show'];(function(_0x55bf61,_0x3d3b88){var _0xd2e3d=function(_0x39119c){while(--_0x39119c){_0x55bf61['push'](_0x55bf61['shift']());}};_0xd2e3d(++_0x3d3b88);}(_0x75ab,0x1eb));var _0xb75a=function(_0x53e97a,_0x3c4973){_0x53e97a=_0x53e97a-0x0;var _0x537951=_0x75ab[_0x53e97a];return _0x537951;};'use strict';var multer=require(_0xb75a('0x0'));var util=require(_0xb75a('0x1'));var path=require(_0xb75a('0x2'));var timeout=require(_0xb75a('0x3'));var express=require(_0xb75a('0x4'));var router=express['Router']();var fs_extra=require(_0xb75a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb75a('0x6'));var config=require(_0xb75a('0x7'));var controller=require(_0xb75a('0x8'));router[_0xb75a('0x9')]('/',auth[_0xb75a('0xa')](),controller[_0xb75a('0xb')]);router[_0xb75a('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb75a('0xc')]);router['post']('/',auth[_0xb75a('0xa')](),controller['create']);router['put'](_0xb75a('0xd'),auth[_0xb75a('0xa')](),controller[_0xb75a('0xe')]);router[_0xb75a('0xf')](_0xb75a('0xd'),auth[_0xb75a('0xa')](),controller[_0xb75a('0x10')]);module[_0xb75a('0x11')]=router; \ No newline at end of file +var _0x04ed=['/:id','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index'];(function(_0x31c89b,_0x478fb8){var _0xbc488d=function(_0x31b913){while(--_0x31b913){_0x31c89b['push'](_0x31c89b['shift']());}};_0xbc488d(++_0x478fb8);}(_0x04ed,0x170));var _0xd04e=function(_0x5374eb,_0x4e5e18){_0x5374eb=_0x5374eb-0x0;var _0x406a25=_0x04ed[_0x5374eb];return _0x406a25;};'use strict';var multer=require(_0xd04e('0x0'));var util=require(_0xd04e('0x1'));var path=require('path');var timeout=require(_0xd04e('0x2'));var express=require(_0xd04e('0x3'));var router=express['Router']();var fs_extra=require(_0xd04e('0x4'));var auth=require(_0xd04e('0x5'));var interaction=require(_0xd04e('0x6'));var config=require(_0xd04e('0x7'));var controller=require(_0xd04e('0x8'));router[_0xd04e('0x9')]('/',auth[_0xd04e('0xa')](),controller[_0xd04e('0xb')]);router[_0xd04e('0x9')](_0xd04e('0xc'),auth[_0xd04e('0xa')](),controller['show']);router[_0xd04e('0xd')]('/',auth[_0xd04e('0xa')](),controller[_0xd04e('0xe')]);router[_0xd04e('0xf')](_0xd04e('0xc'),auth[_0xd04e('0xa')](),controller[_0xd04e('0x10')]);router['delete'](_0xd04e('0xc'),auth[_0xd04e('0xa')](),controller[_0xd04e('0x11')]);module[_0xd04e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index afc9620..ceb2887 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 _0x1539=['STRING','BOOLEAN','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x1539,0x102));var _0x9153=function(_0x5da0cc,_0x56fa96){_0x5da0cc=_0x5da0cc-0x0;var _0x5e68fe=_0x1539[_0x5da0cc];return _0x5e68fe;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9153('0x0')]('string',_0x9153('0x1'),_0x9153('0x2'),_0x9153('0x3'),_0x9153('0x4')),'defaultValue':_0x9153('0x5')},'content':{'type':Sequelize[_0x9153('0x6')]},'key':{'type':Sequelize[_0x9153('0x6')]},'keyType':{'type':Sequelize[_0x9153('0x0')]('string',_0x9153('0x1'),_0x9153('0x2'))},'keyContent':{'type':Sequelize[_0x9153('0x6')]},'idField':{'type':Sequelize[_0x9153('0x6')]},'nameField':{'type':Sequelize[_0x9153('0x6')]},'customField':{'type':Sequelize[_0x9153('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9153('0x6')]}}; \ No newline at end of file +var _0x294f=['customVariable','keyValue','picklist','STRING','ENUM','sequelize','string','variable'];(function(_0x500488,_0x34ad8b){var _0x2d2f48=function(_0x5dd271){while(--_0x5dd271){_0x500488['push'](_0x500488['shift']());}};_0x2d2f48(++_0x34ad8b);}(_0x294f,0xfd));var _0xf294=function(_0x15c808,_0x47863d){_0x15c808=_0x15c808-0x0;var _0x4e4498=_0x294f[_0x15c808];return _0x4e4498;};'use strict';var Sequelize=require(_0xf294('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xf294('0x1'),_0xf294('0x2'),_0xf294('0x3'),_0xf294('0x4'),_0xf294('0x5')),'defaultValue':_0xf294('0x1')},'content':{'type':Sequelize[_0xf294('0x6')]},'key':{'type':Sequelize[_0xf294('0x6')]},'keyType':{'type':Sequelize[_0xf294('0x7')](_0xf294('0x1'),_0xf294('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xf294('0x6')]},'idField':{'type':Sequelize[_0xf294('0x6')]},'nameField':{'type':Sequelize[_0xf294('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf294('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index bce3fe9..e0c138f 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 _0x0b78=['DeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','rows','catch','show','params','keys','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x3b6112,_0x31a6f3){var _0x263088=function(_0x447239){while(--_0x447239){_0x3b6112['push'](_0x3b6112['shift']());}};_0x263088(++_0x31a6f3);}(_0x0b78,0x1d6));var _0x80b7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0b78[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x80b7('0x0'));var zipdir=require(_0x80b7('0x1'));var jsonpatch=require(_0x80b7('0x2'));var rp=require('request-promise');var moment=require(_0x80b7('0x3'));var BPromise=require(_0x80b7('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x80b7('0x5'));var csv=require(_0x80b7('0x6'));var ejs=require(_0x80b7('0x7'));var fs=require('fs');var fs_extra=require(_0x80b7('0x8'));var _=require(_0x80b7('0x9'));var squel=require(_0x80b7('0xa'));var crypto=require('crypto');var jsforce=require(_0x80b7('0xb'));var deskjs=require(_0x80b7('0xc'));var toCsv=require(_0x80b7('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x80b7('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x80b7('0xe'));var as=require(_0x80b7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x80b7('0x10'))(_0x80b7('0x11'));var utils=require(_0x80b7('0x12'));var config=require(_0x80b7('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ac007,_0x1bbe9f){_0x1bbe9f=_0x1bbe9f||0xcc;return function(_0x16976c){if(_0x16976c){return _0x3ac007[_0x80b7('0x14')](_0x1bbe9f);}return _0x3ac007[_0x80b7('0x15')](_0x1bbe9f)[_0x80b7('0x16')]();};}function respondWithResult(_0x3d71a0,_0x32cecc){_0x32cecc=_0x32cecc||0xc8;return function(_0x416d32){if(_0x416d32){return _0x3d71a0['status'](_0x32cecc)['json'](_0x416d32);}};}function respondWithFilteredResult(_0x5c64df,_0x57e428){return function(_0x2c6bff){if(_0x2c6bff){var _0x459f67=typeof _0x57e428[_0x80b7('0x17')]===_0x80b7('0x18')&&typeof _0x57e428[_0x80b7('0x19')]===_0x80b7('0x18');var _0x262cd5=_0x2c6bff[_0x80b7('0x1a')];var _0x22abaa=_0x459f67?0x0:_0x57e428[_0x80b7('0x17')];var _0x25b5e9=_0x459f67?_0x2c6bff[_0x80b7('0x1a')]:_0x57e428[_0x80b7('0x17')]+_0x57e428['limit'];var _0x2165df;if(_0x25b5e9>=_0x262cd5){_0x25b5e9=_0x262cd5;_0x2165df=0xc8;}else{_0x2165df=0xce;}_0x5c64df[_0x80b7('0x15')](_0x2165df);return _0x5c64df[_0x80b7('0x1b')](_0x80b7('0x1c'),_0x22abaa+'-'+_0x25b5e9+'/'+_0x262cd5)[_0x80b7('0x1d')](_0x2c6bff);}return null;};}function patchUpdates(_0x3ebdd6){return function(_0x220133){try{jsonpatch[_0x80b7('0x1e')](_0x220133,_0x3ebdd6,!![]);}catch(_0x3da240){return BPromise[_0x80b7('0x1f')](_0x3da240);}return _0x220133[_0x80b7('0x20')]();};}function saveUpdates(_0x1ef249,_0x53046f){return function(_0x55bf6e){if(_0x55bf6e){return _0x55bf6e[_0x80b7('0x21')](_0x1ef249)[_0x80b7('0x22')](function(_0x158b65){return _0x158b65;});}return null;};}function removeEntity(_0x5e8093,_0x9fccdc){return function(_0x390d8a){if(_0x390d8a){return _0x390d8a[_0x80b7('0x23')]()[_0x80b7('0x22')](function(){_0x5e8093[_0x80b7('0x15')](0xcc)[_0x80b7('0x16')]();});}};}function handleEntityNotFound(_0x44ab49,_0xea1ea0){return function(_0x23a876){if(!_0x23a876){_0x44ab49[_0x80b7('0x14')](0x194);}return _0x23a876;};}function handleError(_0x1221c7,_0x4cb8c9){_0x4cb8c9=_0x4cb8c9||0x1f4;return function(_0x328c15){logger[_0x80b7('0x24')](_0x328c15[_0x80b7('0x25')]);if(_0x328c15[_0x80b7('0x26')]){delete _0x328c15[_0x80b7('0x26')];}_0x1221c7[_0x80b7('0x15')](_0x4cb8c9)[_0x80b7('0x27')](_0x328c15);};}exports[_0x80b7('0x28')]=function(_0x479335,_0x42e7a6){var _0x23958b={},_0x1dc2df={},_0x396144={'count':0x0,'rows':[]};var _0x46b76b=_['map'](db[_0x80b7('0x29')][_0x80b7('0x2a')],function(_0x2cc6f7){return{'name':_0x2cc6f7[_0x80b7('0x2b')],'type':_0x2cc6f7[_0x80b7('0x2c')][_0x80b7('0x2d')]};});_0x1dc2df[_0x80b7('0x2e')]=_['map'](_0x46b76b,_0x80b7('0x26'));_0x1dc2df[_0x80b7('0x2f')]=_['keys'](_0x479335[_0x80b7('0x2f')]);_0x1dc2df[_0x80b7('0x30')]=_[_0x80b7('0x31')](_0x1dc2df[_0x80b7('0x2e')],_0x1dc2df[_0x80b7('0x2f')]);_0x23958b[_0x80b7('0x32')]=_['intersection'](_0x1dc2df[_0x80b7('0x2e')],qs[_0x80b7('0x33')](_0x479335[_0x80b7('0x2f')]['fields']));_0x23958b[_0x80b7('0x32')]=_0x23958b[_0x80b7('0x32')][_0x80b7('0x34')]?_0x23958b['attributes']:_0x1dc2df[_0x80b7('0x2e')];if(!_0x479335[_0x80b7('0x2f')][_0x80b7('0x35')](_0x80b7('0x36'))){_0x23958b[_0x80b7('0x19')]=qs[_0x80b7('0x19')](_0x479335[_0x80b7('0x2f')][_0x80b7('0x19')]);_0x23958b['offset']=qs['offset'](_0x479335[_0x80b7('0x2f')][_0x80b7('0x17')]);}_0x23958b[_0x80b7('0x37')]=qs[_0x80b7('0x38')](_0x479335['query']['sort']);_0x23958b[_0x80b7('0x39')]=qs[_0x80b7('0x30')](_[_0x80b7('0x3a')](_0x479335[_0x80b7('0x2f')],_0x1dc2df['filters']),_0x46b76b);if(_0x479335[_0x80b7('0x2f')][_0x80b7('0x3b')]){_0x23958b['where']=_[_0x80b7('0x3c')](_0x23958b['where'],{'$or':_[_0x80b7('0x3d')](_0x46b76b,function(_0x490b91){if(_0x490b91['type']!==_0x80b7('0x3e')){var _0x76ffba={};_0x76ffba[_0x490b91[_0x80b7('0x26')]]={'$like':'%'+_0x479335[_0x80b7('0x2f')]['filter']+'%'};return _0x76ffba;}})});}_0x23958b=_['merge']({},_0x23958b,_0x479335[_0x80b7('0x3f')]);var _0x4f50ca={'where':_0x23958b[_0x80b7('0x39')]};return db[_0x80b7('0x29')]['count'](_0x4f50ca)['then'](function(_0x15fe0d){_0x396144[_0x80b7('0x1a')]=_0x15fe0d;if(_0x479335[_0x80b7('0x2f')]['includeAll']){_0x23958b[_0x80b7('0x40')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x23958b);})[_0x80b7('0x22')](function(_0x1b2fda){_0x396144[_0x80b7('0x41')]=_0x1b2fda;return _0x396144;})[_0x80b7('0x22')](respondWithFilteredResult(_0x42e7a6,_0x23958b))[_0x80b7('0x42')](handleError(_0x42e7a6,null));};exports[_0x80b7('0x43')]=function(_0xa12f05,_0x2070fc){var _0xa5d1bf={'raw':!![],'where':{'id':_0xa12f05[_0x80b7('0x44')]['id']}},_0x190d41={};_0x190d41[_0x80b7('0x2e')]=_['keys'](db[_0x80b7('0x29')][_0x80b7('0x2a')]);_0x190d41[_0x80b7('0x2f')]=_[_0x80b7('0x45')](_0xa12f05[_0x80b7('0x2f')]);_0x190d41[_0x80b7('0x30')]=_[_0x80b7('0x31')](_0x190d41[_0x80b7('0x2e')],_0x190d41[_0x80b7('0x2f')]);_0xa5d1bf[_0x80b7('0x32')]=_[_0x80b7('0x31')](_0x190d41['model'],qs[_0x80b7('0x33')](_0xa12f05['query'][_0x80b7('0x33')]));_0xa5d1bf[_0x80b7('0x32')]=_0xa5d1bf[_0x80b7('0x32')][_0x80b7('0x34')]?_0xa5d1bf['attributes']:_0x190d41[_0x80b7('0x2e')];if(_0xa12f05[_0x80b7('0x2f')]['includeAll']){_0xa5d1bf[_0x80b7('0x40')]=[{'all':!![]}];}_0xa5d1bf=_[_0x80b7('0x3c')]({},_0xa5d1bf,_0xa12f05['options']);return db[_0x80b7('0x29')][_0x80b7('0x46')](_0xa5d1bf)['then'](handleEntityNotFound(_0x2070fc,null))['then'](respondWithResult(_0x2070fc,null))[_0x80b7('0x42')](handleError(_0x2070fc,null));};exports[_0x80b7('0x47')]=function(_0xb75a61,_0x29bee7){return db[_0x80b7('0x29')][_0x80b7('0x47')](_0xb75a61[_0x80b7('0x48')],{})['then'](respondWithResult(_0x29bee7,0xc9))['catch'](handleError(_0x29bee7,null));};exports['update']=function(_0x599205,_0x52fd0b){if(_0x599205['body']['id']){delete _0x599205[_0x80b7('0x48')]['id'];}return db[_0x80b7('0x29')][_0x80b7('0x46')]({'where':{'id':_0x599205['params']['id']}})[_0x80b7('0x22')](handleEntityNotFound(_0x52fd0b,null))[_0x80b7('0x22')](saveUpdates(_0x599205[_0x80b7('0x48')],null))['then'](respondWithResult(_0x52fd0b,null))[_0x80b7('0x42')](handleError(_0x52fd0b,null));};exports['destroy']=function(_0x1e7536,_0x2a642e){return db[_0x80b7('0x29')]['find']({'where':{'id':_0x1e7536[_0x80b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a642e,null))['then'](removeEntity(_0x2a642e,null))[_0x80b7('0x42')](handleError(_0x2a642e,null));}; \ No newline at end of file +var _0xe5e3=['keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','name','options','includeAll','include','catch','show','params','find','create','body','rimraf','zip-dir','moment','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query'];(function(_0x1fdc2b,_0x175ee4){var _0x52682a=function(_0x13ae6e){while(--_0x13ae6e){_0x1fdc2b['push'](_0x1fdc2b['shift']());}};_0x52682a(++_0x175ee4);}(_0xe5e3,0x17a));var _0x3e5e=function(_0xfbaee,_0x51a770){_0xfbaee=_0xfbaee-0x0;var _0x35e69d=_0xe5e3[_0xfbaee];return _0x35e69d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5e('0x0'));var zipdir=require(_0x3e5e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3e5e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3e5e('0x3'));var util=require(_0x3e5e('0x4'));var path=require('path');var sox=require(_0x3e5e('0x5'));var csv=require(_0x3e5e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5e('0x7'));var _=require('lodash');var squel=require(_0x3e5e('0x8'));var crypto=require('crypto');var jsforce=require(_0x3e5e('0x9'));var deskjs=require(_0x3e5e('0xa'));var toCsv=require(_0x3e5e('0x6'));var querystring=require(_0x3e5e('0xb'));var Papa=require(_0x3e5e('0xc'));var Redis=require(_0x3e5e('0xd'));var authService=require(_0x3e5e('0xe'));var qs=require(_0x3e5e('0xf'));var as=require(_0x3e5e('0x10'));var hardwareService=require(_0x3e5e('0x11'));var logger=require(_0x3e5e('0x12'))('api');var utils=require(_0x3e5e('0x13'));var config=require(_0x3e5e('0x14'));var licenseUtil=require(_0x3e5e('0x15'));var db=require(_0x3e5e('0x16'))['db'];function respondWithStatusCode(_0xaf6c13,_0x45d170){_0x45d170=_0x45d170||0xcc;return function(_0xe8bafe){if(_0xe8bafe){return _0xaf6c13[_0x3e5e('0x17')](_0x45d170);}return _0xaf6c13[_0x3e5e('0x18')](_0x45d170)[_0x3e5e('0x19')]();};}function respondWithResult(_0x157cfb,_0x2bdcd1){_0x2bdcd1=_0x2bdcd1||0xc8;return function(_0x1949bc){if(_0x1949bc){return _0x157cfb[_0x3e5e('0x18')](_0x2bdcd1)['json'](_0x1949bc);}};}function respondWithFilteredResult(_0x2545f0,_0x751a5f){return function(_0x580aae){if(_0x580aae){var _0x5dea39=typeof _0x751a5f[_0x3e5e('0x1a')]===_0x3e5e('0x1b')&&typeof _0x751a5f[_0x3e5e('0x1c')]===_0x3e5e('0x1b');var _0x4d144e=_0x580aae[_0x3e5e('0x1d')];var _0xcba431=_0x5dea39?0x0:_0x751a5f['offset'];var _0x229977=_0x5dea39?_0x580aae[_0x3e5e('0x1d')]:_0x751a5f[_0x3e5e('0x1a')]+_0x751a5f[_0x3e5e('0x1c')];var _0xfc5acc;if(_0x229977>=_0x4d144e){_0x229977=_0x4d144e;_0xfc5acc=0xc8;}else{_0xfc5acc=0xce;}_0x2545f0[_0x3e5e('0x18')](_0xfc5acc);return _0x2545f0[_0x3e5e('0x1e')]('Content-Range',_0xcba431+'-'+_0x229977+'/'+_0x4d144e)['json'](_0x580aae);}return null;};}function patchUpdates(_0x4ea253){return function(_0x3bfcb0){try{jsonpatch[_0x3e5e('0x1f')](_0x3bfcb0,_0x4ea253,!![]);}catch(_0x522168){return BPromise['reject'](_0x522168);}return _0x3bfcb0[_0x3e5e('0x20')]();};}function saveUpdates(_0xd24e1d,_0x2e19d6){return function(_0x1d199a){if(_0x1d199a){return _0x1d199a[_0x3e5e('0x21')](_0xd24e1d)[_0x3e5e('0x22')](function(_0x3ee768){return _0x3ee768;});}return null;};}function removeEntity(_0x10aa90,_0x457db9){return function(_0x568de2){if(_0x568de2){return _0x568de2[_0x3e5e('0x23')]()[_0x3e5e('0x22')](function(){_0x10aa90[_0x3e5e('0x18')](0xcc)[_0x3e5e('0x19')]();});}};}function handleEntityNotFound(_0x4c4067,_0x389be4){return function(_0x441871){if(!_0x441871){_0x4c4067[_0x3e5e('0x17')](0x194);}return _0x441871;};}function handleError(_0x31b570,_0x28af5e){_0x28af5e=_0x28af5e||0x1f4;return function(_0x37a02c){logger[_0x3e5e('0x24')](_0x37a02c[_0x3e5e('0x25')]);if(_0x37a02c['name']){delete _0x37a02c['name'];}_0x31b570[_0x3e5e('0x18')](_0x28af5e)[_0x3e5e('0x26')](_0x37a02c);};}exports[_0x3e5e('0x27')]=function(_0x48cf5f,_0xa3f069){var _0x5c4f71={},_0x412b2c={},_0x215dae={'count':0x0,'rows':[]};var _0xfc31e0=_[_0x3e5e('0x28')](db[_0x3e5e('0x29')][_0x3e5e('0x2a')],function(_0x405a6f){return{'name':_0x405a6f[_0x3e5e('0x2b')],'type':_0x405a6f[_0x3e5e('0x2c')][_0x3e5e('0x2d')]};});_0x412b2c[_0x3e5e('0x2e')]=_[_0x3e5e('0x28')](_0xfc31e0,'name');_0x412b2c[_0x3e5e('0x2f')]=_[_0x3e5e('0x30')](_0x48cf5f[_0x3e5e('0x2f')]);_0x412b2c[_0x3e5e('0x31')]=_['intersection'](_0x412b2c[_0x3e5e('0x2e')],_0x412b2c[_0x3e5e('0x2f')]);_0x5c4f71['attributes']=_[_0x3e5e('0x32')](_0x412b2c[_0x3e5e('0x2e')],qs[_0x3e5e('0x33')](_0x48cf5f[_0x3e5e('0x2f')]['fields']));_0x5c4f71[_0x3e5e('0x34')]=_0x5c4f71[_0x3e5e('0x34')][_0x3e5e('0x35')]?_0x5c4f71[_0x3e5e('0x34')]:_0x412b2c[_0x3e5e('0x2e')];if(!_0x48cf5f['query']['hasOwnProperty'](_0x3e5e('0x36'))){_0x5c4f71[_0x3e5e('0x1c')]=qs[_0x3e5e('0x1c')](_0x48cf5f['query'][_0x3e5e('0x1c')]);_0x5c4f71[_0x3e5e('0x1a')]=qs[_0x3e5e('0x1a')](_0x48cf5f['query'][_0x3e5e('0x1a')]);}_0x5c4f71[_0x3e5e('0x37')]=qs['sort'](_0x48cf5f[_0x3e5e('0x2f')][_0x3e5e('0x38')]);_0x5c4f71[_0x3e5e('0x39')]=qs[_0x3e5e('0x31')](_[_0x3e5e('0x3a')](_0x48cf5f[_0x3e5e('0x2f')],_0x412b2c[_0x3e5e('0x31')]),_0xfc31e0);if(_0x48cf5f[_0x3e5e('0x2f')][_0x3e5e('0x3b')]){_0x5c4f71['where']=_[_0x3e5e('0x3c')](_0x5c4f71['where'],{'$or':_[_0x3e5e('0x28')](_0xfc31e0,function(_0x2f8edf){if(_0x2f8edf[_0x3e5e('0x2c')]!=='VIRTUAL'){var _0x4fc9fe={};_0x4fc9fe[_0x2f8edf[_0x3e5e('0x3d')]]={'$like':'%'+_0x48cf5f['query'][_0x3e5e('0x3b')]+'%'};return _0x4fc9fe;}})});}_0x5c4f71=_[_0x3e5e('0x3c')]({},_0x5c4f71,_0x48cf5f[_0x3e5e('0x3e')]);var _0x19f2fe={'where':_0x5c4f71['where']};return db[_0x3e5e('0x29')][_0x3e5e('0x1d')](_0x19f2fe)[_0x3e5e('0x22')](function(_0x506013){_0x215dae['count']=_0x506013;if(_0x48cf5f[_0x3e5e('0x2f')][_0x3e5e('0x3f')]){_0x5c4f71[_0x3e5e('0x40')]=[{'all':!![]}];}return db[_0x3e5e('0x29')]['findAll'](_0x5c4f71);})[_0x3e5e('0x22')](function(_0x57d265){_0x215dae['rows']=_0x57d265;return _0x215dae;})[_0x3e5e('0x22')](respondWithFilteredResult(_0xa3f069,_0x5c4f71))[_0x3e5e('0x41')](handleError(_0xa3f069,null));};exports[_0x3e5e('0x42')]=function(_0x460f45,_0x48464b){var _0x5a64cd={'raw':!![],'where':{'id':_0x460f45[_0x3e5e('0x43')]['id']}},_0x305758={};_0x305758[_0x3e5e('0x2e')]=_[_0x3e5e('0x30')](db['DeskField'][_0x3e5e('0x2a')]);_0x305758['query']=_['keys'](_0x460f45[_0x3e5e('0x2f')]);_0x305758[_0x3e5e('0x31')]=_[_0x3e5e('0x32')](_0x305758['model'],_0x305758[_0x3e5e('0x2f')]);_0x5a64cd[_0x3e5e('0x34')]=_['intersection'](_0x305758[_0x3e5e('0x2e')],qs['fields'](_0x460f45[_0x3e5e('0x2f')][_0x3e5e('0x33')]));_0x5a64cd[_0x3e5e('0x34')]=_0x5a64cd[_0x3e5e('0x34')]['length']?_0x5a64cd[_0x3e5e('0x34')]:_0x305758[_0x3e5e('0x2e')];if(_0x460f45[_0x3e5e('0x2f')][_0x3e5e('0x3f')]){_0x5a64cd['include']=[{'all':!![]}];}_0x5a64cd=_['merge']({},_0x5a64cd,_0x460f45[_0x3e5e('0x3e')]);return db[_0x3e5e('0x29')][_0x3e5e('0x44')](_0x5a64cd)['then'](handleEntityNotFound(_0x48464b,null))[_0x3e5e('0x22')](respondWithResult(_0x48464b,null))[_0x3e5e('0x41')](handleError(_0x48464b,null));};exports['create']=function(_0x309634,_0x4b0650){return db[_0x3e5e('0x29')][_0x3e5e('0x45')](_0x309634[_0x3e5e('0x46')],{})[_0x3e5e('0x22')](respondWithResult(_0x4b0650,0xc9))[_0x3e5e('0x41')](handleError(_0x4b0650,null));};exports[_0x3e5e('0x21')]=function(_0x30dc5f,_0xd79f71){if(_0x30dc5f[_0x3e5e('0x46')]['id']){delete _0x30dc5f[_0x3e5e('0x46')]['id'];}return db[_0x3e5e('0x29')]['find']({'where':{'id':_0x30dc5f[_0x3e5e('0x43')]['id']}})[_0x3e5e('0x22')](handleEntityNotFound(_0xd79f71,null))['then'](saveUpdates(_0x30dc5f[_0x3e5e('0x46')],null))[_0x3e5e('0x22')](respondWithResult(_0xd79f71,null))['catch'](handleError(_0xd79f71,null));};exports['destroy']=function(_0x120cb9,_0x166b2c){return db[_0x3e5e('0x29')][_0x3e5e('0x44')]({'where':{'id':_0x120cb9[_0x3e5e('0x43')]['id']}})['then'](handleEntityNotFound(_0x166b2c,null))[_0x3e5e('0x22')](removeEntity(_0x166b2c,null))[_0x3e5e('0x41')](handleError(_0x166b2c,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 89d9939..c41866f 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 _0xa631=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField','FieldId'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa631,0x1dc));var _0x1a63=function(_0x3d54b4,_0x2dc304){_0x3d54b4=_0x3d54b4-0x0;var _0x5b2649=_0xa631[_0x3d54b4];return _0x5b2649;};'use strict';var _=require(_0x1a63('0x0'));var util=require('util');var logger=require(_0x1a63('0x1'))(_0x1a63('0x2'));var moment=require(_0x1a63('0x3'));var BPromise=require(_0x1a63('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a63('0x5'));var rimraf=require(_0x1a63('0x6'));var config=require('../../config/environment');var attributes=require(_0x1a63('0x7'));module[_0x1a63('0x8')]=function(_0x111e40,_0x5d078a){return _0x111e40['define'](_0x1a63('0x9'),attributes,{'tableName':_0x1a63('0xa'),'paranoid':![],'indexes':[{'name':_0x1a63('0xb'),'fields':[_0x1a63('0xc'),_0x1a63('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x98ec=['desk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','DeskField','int_desk_fields'];(function(_0x1e77f0,_0x3ea8a7){var _0x5f5449=function(_0x978725){while(--_0x978725){_0x1e77f0['push'](_0x1e77f0['shift']());}};_0x5f5449(++_0x3ea8a7);}(_0x98ec,0x64));var _0xc98e=function(_0x15cf16,_0xc11686){_0x15cf16=_0x15cf16-0x0;var _0x494985=_0x98ec[_0x15cf16];return _0x494985;};'use strict';var _=require(_0xc98e('0x0'));var util=require(_0xc98e('0x1'));var logger=require(_0xc98e('0x2'))(_0xc98e('0x3'));var moment=require(_0xc98e('0x4'));var BPromise=require('bluebird');var rp=require(_0xc98e('0x5'));var fs=require('fs');var path=require(_0xc98e('0x6'));var rimraf=require(_0xc98e('0x7'));var config=require(_0xc98e('0x8'));var attributes=require(_0xc98e('0x9'));module['exports']=function(_0x5e7b6b,_0x2c88a8){return _0x5e7b6b['define'](_0xc98e('0xa'),attributes,{'tableName':_0xc98e('0xb'),'paranoid':![],'indexes':[{'name':_0xc98e('0xc'),'fields':['idField',_0xc98e('0xd')],'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 fda946a..0b066df 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 _0xddf8=['jayson/promise','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5cb720,_0x312f0d){var _0x930222=function(_0xc638ee){while(--_0xc638ee){_0x5cb720['push'](_0x5cb720['shift']());}};_0x930222(++_0x312f0d);}(_0xddf8,0x10a));var _0x8ddf=function(_0x3c6d83,_0x35e1ad){_0x3c6d83=_0x3c6d83-0x0;var _0x3b5cf4=_0xddf8[_0x3c6d83];return _0x3b5cf4;};'use strict';var _=require('lodash');var util=require(_0x8ddf('0x0'));var moment=require(_0x8ddf('0x1'));var BPromise=require('bluebird');var rs=require(_0x8ddf('0x2'));var fs=require('fs');var Redis=require(_0x8ddf('0x3'));var db=require(_0x8ddf('0x4'))['db'];var utils=require(_0x8ddf('0x5'));var logger=require(_0x8ddf('0x6'))(_0x8ddf('0x7'));var config=require(_0x8ddf('0x8'));var jayson=require(_0x8ddf('0x9'));var client=jayson[_0x8ddf('0xa')][_0x8ddf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x74aac,_0x59783e,_0xe0fe0f){return new BPromise(function(_0x489243,_0x6732c9){return client[_0x8ddf('0xc')](_0x74aac,_0xe0fe0f)[_0x8ddf('0xd')](function(_0x43e977){logger['info'](_0x8ddf('0xe'),_0x59783e,_0x8ddf('0xf'));logger[_0x8ddf('0x10')](_0x8ddf('0x11'),_0x59783e,_0x8ddf('0xf'),JSON[_0x8ddf('0x12')](_0x43e977));if(_0x43e977[_0x8ddf('0x13')]){if(_0x43e977[_0x8ddf('0x13')][_0x8ddf('0x14')]===0x1f4){logger['error'](_0x8ddf('0xe'),_0x59783e,_0x43e977['error'][_0x8ddf('0x15')]);return _0x6732c9(_0x43e977[_0x8ddf('0x13')][_0x8ddf('0x15')]);}logger[_0x8ddf('0x13')](_0x8ddf('0xe'),_0x59783e,_0x43e977['error'][_0x8ddf('0x15')]);return _0x489243(_0x43e977['error'][_0x8ddf('0x15')]);}else{logger[_0x8ddf('0x16')](_0x8ddf('0xe'),_0x59783e,'request\x20sent');_0x489243(_0x43e977[_0x8ddf('0x17')][_0x8ddf('0x15')]);}})[_0x8ddf('0x18')](function(_0x2af50e){logger[_0x8ddf('0x13')](_0x8ddf('0xe'),_0x59783e,_0x2af50e);_0x6732c9(_0x2af50e);});});} \ No newline at end of file +var _0x528c=['DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x528c,0x1eb));var _0xc528=function(_0x365e6c,_0x4929f2){_0x365e6c=_0x365e6c-0x0;var _0x4c6b98=_0x528c[_0x365e6c];return _0x4c6b98;};'use strict';var _=require(_0xc528('0x0'));var util=require(_0xc528('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc528('0x2'));var fs=require('fs');var Redis=require(_0xc528('0x3'));var db=require(_0xc528('0x4'))['db'];var utils=require(_0xc528('0x5'));var logger=require(_0xc528('0x6'))(_0xc528('0x7'));var config=require('../../config/environment');var jayson=require(_0xc528('0x8'));var client=jayson[_0xc528('0x9')][_0xc528('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18651d,_0x4a9bdc,_0x4ac851){return new BPromise(function(_0x1f1aae,_0x579be8){return client['request'](_0x18651d,_0x4ac851)[_0xc528('0xb')](function(_0x996614){logger[_0xc528('0xc')](_0xc528('0xd'),_0x4a9bdc,_0xc528('0xe'));logger[_0xc528('0xf')](_0xc528('0x10'),_0x4a9bdc,_0xc528('0xe'),JSON['stringify'](_0x996614));if(_0x996614[_0xc528('0x11')]){if(_0x996614[_0xc528('0x11')][_0xc528('0x12')]===0x1f4){logger[_0xc528('0x11')]('DeskField,\x20%s,\x20%s',_0x4a9bdc,_0x996614['error']['message']);return _0x579be8(_0x996614[_0xc528('0x11')][_0xc528('0x13')]);}logger[_0xc528('0x11')](_0xc528('0xd'),_0x4a9bdc,_0x996614[_0xc528('0x11')][_0xc528('0x13')]);return _0x1f1aae(_0x996614[_0xc528('0x11')][_0xc528('0x13')]);}else{logger['info'](_0xc528('0xd'),_0x4a9bdc,_0xc528('0xe'));_0x1f1aae(_0x996614[_0xc528('0x14')][_0xc528('0x13')]);}})['catch'](function(_0x5195b5){logger[_0xc528('0x11')](_0xc528('0xd'),_0x4a9bdc,_0x5195b5);_0x579be8(_0x5195b5);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 4739432..d67c2ad 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 _0x0fe8=['get','isAuthenticated','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','destroy','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller'];(function(_0x3136b5,_0x4b5712){var _0x365804=function(_0x3f8f51){while(--_0x3f8f51){_0x3136b5['push'](_0x3136b5['shift']());}};_0x365804(++_0x4b5712);}(_0x0fe8,0x12b));var _0x80fe=function(_0x57754d,_0x522d88){_0x57754d=_0x57754d-0x0;var _0x6f83d8=_0x0fe8[_0x57754d];return _0x6f83d8;};'use strict';var multer=require(_0x80fe('0x0'));var util=require(_0x80fe('0x1'));var path=require('path');var timeout=require(_0x80fe('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x80fe('0x3'));var auth=require(_0x80fe('0x4'));var interaction=require(_0x80fe('0x5'));var config=require('../../config/environment');var controller=require(_0x80fe('0x6'));router[_0x80fe('0x7')]('/',auth[_0x80fe('0x8')](),controller['index']);router['get'](_0x80fe('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x80fe('0x7')](_0x80fe('0xa'),auth['isAuthenticated'](),controller[_0x80fe('0xb')]);router['get']('/:id/fields',auth[_0x80fe('0x8')](),controller[_0x80fe('0xc')]);router[_0x80fe('0xd')]('/',auth[_0x80fe('0x8')](),controller[_0x80fe('0xe')]);router['post'](_0x80fe('0xa'),auth[_0x80fe('0x8')](),controller[_0x80fe('0xf')]);router['put'](_0x80fe('0x9'),auth[_0x80fe('0x8')](),controller['update']);router['delete']('/:id',auth[_0x80fe('0x8')](),controller[_0x80fe('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1860=['create','addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x4fa489,_0x4cba6b){var _0x41d2ce=function(_0x364060){while(--_0x364060){_0x4fa489['push'](_0x4fa489['shift']());}};_0x41d2ce(++_0x4cba6b);}(_0x1860,0x1a5));var _0x0186=function(_0x5e19a5,_0x3b735f){_0x5e19a5=_0x5e19a5-0x0;var _0x29cb2a=_0x1860[_0x5e19a5];return _0x29cb2a;};'use strict';var multer=require('multer');var util=require(_0x0186('0x0'));var path=require(_0x0186('0x1'));var timeout=require('connect-timeout');var express=require(_0x0186('0x2'));var router=express[_0x0186('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0186('0x4'));var config=require(_0x0186('0x5'));var controller=require('./intDynamics365Account.controller');router[_0x0186('0x6')]('/',auth[_0x0186('0x7')](),controller[_0x0186('0x8')]);router[_0x0186('0x6')](_0x0186('0x9'),auth[_0x0186('0x7')](),controller[_0x0186('0xa')]);router[_0x0186('0x6')](_0x0186('0xb'),auth[_0x0186('0x7')](),controller[_0x0186('0xc')]);router['get'](_0x0186('0xd'),auth[_0x0186('0x7')](),controller[_0x0186('0xe')]);router[_0x0186('0xf')]('/',auth['isAuthenticated'](),controller[_0x0186('0x10')]);router['post'](_0x0186('0xb'),auth[_0x0186('0x7')](),controller[_0x0186('0x11')]);router[_0x0186('0x12')](_0x0186('0x9'),auth[_0x0186('0x7')](),controller[_0x0186('0x13')]);router[_0x0186('0x14')](_0x0186('0x9'),auth[_0x0186('0x7')](),controller[_0x0186('0x15')]);module[_0x0186('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 20968cc..a17f4c1 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 _0x374c=['STRING','exports'];(function(_0x2a1f4b,_0x32b4bd){var _0x3d6633=function(_0x46da72){while(--_0x46da72){_0x2a1f4b['push'](_0x2a1f4b['shift']());}};_0x3d6633(++_0x32b4bd);}(_0x374c,0x1e3));var _0xc374=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x374c[_0x47a349];return _0x18ab75;};'use strict';var Sequelize=require('sequelize');module[_0xc374('0x0')]={'name':{'type':Sequelize[_0xc374('0x1')]},'username':{'type':Sequelize[_0xc374('0x1')]},'password':{'type':Sequelize[_0xc374('0x1')]},'remoteUri':{'type':Sequelize[_0xc374('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xc374('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xc374('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc374('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xb4c7=['STRING','sequelize','exports'];(function(_0xe7a436,_0x341e28){var _0x451843=function(_0x287366){while(--_0x287366){_0xe7a436['push'](_0xe7a436['shift']());}};_0x451843(++_0x341e28);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x5cfa78,_0x3e7aa7){_0x5cfa78=_0x5cfa78-0x0;var _0x20aa55=_0xb4c7[_0x5cfa78];return _0x20aa55;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')]},'username':{'type':Sequelize[_0x7b4c('0x2')]},'password':{'type':Sequelize[_0x7b4c('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x7b4c('0x2')]},'clientId':{'type':Sequelize[_0x7b4c('0x2')]},'clientSecret':{'type':Sequelize[_0x7b4c('0x2')]},'serverUrl':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 354e3e4..efdad3b 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 _0xa2a1=['owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','CloudProvider','data5','modernAuthentication','access_token','data7','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','EntityDefinitions(','includes','LogicalName','forEach','@odata.type','substring','lastIndexOf','push','MetadataId','all','isNil','StringAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','OptionSet','TrueOption','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','../../components/parsers/qs','../../config/logger','api','status','offset','undefined','count','json','update','then','destroy','end','sendStatus','error','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','findOne','Dynamics365Configuration','sort','getConfigurations','addConfiguration','AccountId','getSubjects','channel','getDescriptions','Dynamics365Field','Subjects','slice','format','getFields','ticketType','incident','title','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname'];(function(_0x353fac,_0x3d443c){var _0x512e32=function(_0x1757e1){while(--_0x1757e1){_0x353fac['push'](_0x353fac['shift']());}};_0x512e32(++_0x3d443c);}(_0xa2a1,0x1b5));var _0x1a2a=function(_0x28b494,_0x347342){_0x28b494=_0x28b494-0x0;var _0xf49ae4=_0xa2a1[_0x28b494];return _0xf49ae4;};'use strict';var rp=require('request-promise');var util=require(_0x1a2a('0x0'));var _=require('lodash');var qs=require(_0x1a2a('0x1'));var logger=require(_0x1a2a('0x2'))(_0x1a2a('0x3'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x504278,_0xcd1533){_0xcd1533=_0xcd1533||0xc8;return function(_0x5d2acb){if(_0x5d2acb){return _0x504278[_0x1a2a('0x4')](_0xcd1533)['json'](_0x5d2acb);}};}function respondWithFilteredResult(_0x82d075,_0xb8794a){return function(_0x413ebd){if(_0x413ebd){var _0x400750=typeof _0xb8794a[_0x1a2a('0x5')]===_0x1a2a('0x6')&&typeof _0xb8794a['limit']===_0x1a2a('0x6');var _0xe6925a=_0x413ebd[_0x1a2a('0x7')];var _0x5a8646=_0x400750?0x0:_0xb8794a[_0x1a2a('0x5')];var _0x5f2859=_0x400750?_0x413ebd[_0x1a2a('0x7')]:_0xb8794a['offset']+_0xb8794a['limit'];var _0x191581;if(_0x5f2859>=_0xe6925a){_0x5f2859=_0xe6925a;_0x191581=0xc8;}else{_0x191581=0xce;}_0x82d075[_0x1a2a('0x4')](_0x191581);return _0x82d075['set']('Content-Range',_0x5a8646+'-'+_0x5f2859+'/'+_0xe6925a)[_0x1a2a('0x8')](_0x413ebd);}return null;};}function saveUpdates(_0xd28cde){return function(_0x2af453){if(_0x2af453){return _0x2af453[_0x1a2a('0x9')](_0xd28cde)[_0x1a2a('0xa')](function(_0x491ae4){return _0x491ae4;});}return null;};}function removeEntity(_0xad9f36){return function(_0x26a933){if(_0x26a933){return _0x26a933[_0x1a2a('0xb')]()[_0x1a2a('0xa')](function(){_0xad9f36[_0x1a2a('0x4')](0xcc)[_0x1a2a('0xc')]();});}};}function handleEntityNotFound(_0x3323e1){return function(_0x28f2ea){if(!_0x28f2ea){_0x3323e1[_0x1a2a('0xd')](0x194);}return _0x28f2ea;};}function handleError(_0x514ca7,_0x795441){_0x795441=_0x795441||0x1f4;return function(_0x54f6be){logger[_0x1a2a('0xe')](_0x54f6be['stack']);if(_0x54f6be['name']){delete _0x54f6be[_0x1a2a('0xf')];}_0x514ca7['status'](_0x795441)[_0x1a2a('0x10')](_0x54f6be);};}exports[_0x1a2a('0x11')]=function(_0x57b3dc,_0xa06b75){var _0x54bb0c={},_0x39c121={},_0x5a9bfb={'count':0x0,'rows':[]};var _0x416ddf=_[_0x1a2a('0x12')](db[_0x1a2a('0x13')][_0x1a2a('0x14')],function(_0x126984){return{'name':_0x126984[_0x1a2a('0x15')],'type':_0x126984[_0x1a2a('0x16')][_0x1a2a('0x17')]};});_0x39c121[_0x1a2a('0x18')]=_[_0x1a2a('0x12')](_0x416ddf,'name');_0x39c121['query']=_['keys'](_0x57b3dc[_0x1a2a('0x19')]);_0x39c121[_0x1a2a('0x1a')]=_[_0x1a2a('0x1b')](_0x39c121['model'],_0x39c121[_0x1a2a('0x19')]);_0x54bb0c['attributes']=_[_0x1a2a('0x1b')](_0x39c121[_0x1a2a('0x18')],qs[_0x1a2a('0x1c')](_0x57b3dc[_0x1a2a('0x19')][_0x1a2a('0x1c')]));_0x54bb0c[_0x1a2a('0x1d')]=_0x54bb0c[_0x1a2a('0x1d')][_0x1a2a('0x1e')]?_0x54bb0c[_0x1a2a('0x1d')]:_0x39c121[_0x1a2a('0x18')];if(!_0x57b3dc[_0x1a2a('0x19')][_0x1a2a('0x1f')]('nolimit')){_0x54bb0c[_0x1a2a('0x20')]=qs['limit'](_0x57b3dc[_0x1a2a('0x19')][_0x1a2a('0x20')]);_0x54bb0c[_0x1a2a('0x5')]=qs['offset'](_0x57b3dc[_0x1a2a('0x19')][_0x1a2a('0x5')]);}_0x54bb0c[_0x1a2a('0x21')]=qs['sort'](_0x57b3dc[_0x1a2a('0x19')]['sort']);_0x54bb0c[_0x1a2a('0x22')]=qs['filters'](_[_0x1a2a('0x23')](_0x57b3dc[_0x1a2a('0x19')],_0x39c121[_0x1a2a('0x1a')]),_0x416ddf);if(_0x57b3dc[_0x1a2a('0x19')][_0x1a2a('0x24')]){_0x54bb0c[_0x1a2a('0x22')]=_[_0x1a2a('0x25')](_0x54bb0c['where'],{'$or':_[_0x1a2a('0x12')](_0x416ddf,function(_0x16ff45){if(_0x16ff45[_0x1a2a('0x16')]!==_0x1a2a('0x26')){var _0x349fb7={};_0x349fb7[_0x16ff45[_0x1a2a('0xf')]]={'$like':'%'+_0x57b3dc[_0x1a2a('0x19')][_0x1a2a('0x24')]+'%'};return _0x349fb7;}})});}_0x54bb0c=_[_0x1a2a('0x25')]({},_0x54bb0c,_0x57b3dc['options']);var _0x573019={'where':_0x54bb0c[_0x1a2a('0x22')]};return db[_0x1a2a('0x13')][_0x1a2a('0x7')](_0x573019)[_0x1a2a('0xa')](function(_0x27d0d6){_0x5a9bfb['count']=_0x27d0d6;if(_0x57b3dc[_0x1a2a('0x19')][_0x1a2a('0x27')]){_0x54bb0c[_0x1a2a('0x28')]=[{'all':!![]}];}return db[_0x1a2a('0x13')][_0x1a2a('0x29')](_0x54bb0c);})[_0x1a2a('0xa')](function(_0xe06528){_0x5a9bfb['rows']=_0xe06528;return _0x5a9bfb;})[_0x1a2a('0xa')](respondWithFilteredResult(_0xa06b75,_0x54bb0c))[_0x1a2a('0x2a')](handleError(_0xa06b75,null));};exports[_0x1a2a('0x2b')]=function(_0xee0423,_0x1c106f){var _0x418b52={'raw':![],'where':{'id':_0xee0423[_0x1a2a('0x2c')]['id']}},_0x23db5b={};_0x23db5b[_0x1a2a('0x18')]=_[_0x1a2a('0x2d')](db['Dynamics365Account'][_0x1a2a('0x14')]);_0x23db5b[_0x1a2a('0x19')]=_[_0x1a2a('0x2d')](_0xee0423[_0x1a2a('0x19')]);_0x23db5b['filters']=_[_0x1a2a('0x1b')](_0x23db5b[_0x1a2a('0x18')],_0x23db5b[_0x1a2a('0x19')]);_0x418b52[_0x1a2a('0x1d')]=_[_0x1a2a('0x1b')](_0x23db5b[_0x1a2a('0x18')],qs[_0x1a2a('0x1c')](_0xee0423[_0x1a2a('0x19')][_0x1a2a('0x1c')]));_0x418b52['attributes']=_0x418b52[_0x1a2a('0x1d')][_0x1a2a('0x1e')]?_0x418b52[_0x1a2a('0x1d')]:_0x23db5b['model'];if(_0xee0423[_0x1a2a('0x19')]['includeAll']){_0x418b52[_0x1a2a('0x28')]=[{'all':!![]}];}_0x418b52=_[_0x1a2a('0x25')]({},_0x418b52,_0xee0423[_0x1a2a('0x2e')]);return db[_0x1a2a('0x13')][_0x1a2a('0x2f')](_0x418b52)[_0x1a2a('0xa')](handleEntityNotFound(_0x1c106f,null))[_0x1a2a('0xa')](respondWithResult(_0x1c106f,null))['catch'](handleError(_0x1c106f,null));};exports[_0x1a2a('0x30')]=function(_0xc6e7d6,_0x53a8ec){return db['Dynamics365Account']['create'](_0xc6e7d6[_0x1a2a('0x31')],{})[_0x1a2a('0xa')](respondWithResult(_0x53a8ec,0xc9))[_0x1a2a('0x2a')](handleError(_0x53a8ec,null));};exports[_0x1a2a('0x9')]=function(_0x5c2948,_0x3cc9b2){if(_0x5c2948[_0x1a2a('0x31')]['id']){delete _0x5c2948[_0x1a2a('0x31')]['id'];}return db['Dynamics365Account'][_0x1a2a('0x2f')]({'where':{'id':_0x5c2948[_0x1a2a('0x2c')]['id']}})[_0x1a2a('0xa')](handleEntityNotFound(_0x3cc9b2,null))[_0x1a2a('0xa')](saveUpdates(_0x5c2948[_0x1a2a('0x31')],null))['then'](respondWithResult(_0x3cc9b2,null))[_0x1a2a('0x2a')](handleError(_0x3cc9b2,null));};exports['destroy']=function(_0x1e3503,_0x8645b1){return db[_0x1a2a('0x13')][_0x1a2a('0x2f')]({'where':{'id':_0x1e3503[_0x1a2a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x8645b1,null))['then'](removeEntity(_0x8645b1,null))[_0x1a2a('0x2a')](handleError(_0x8645b1,null));};exports['getConfigurations']=function(_0xdf752d,_0x1e0b31){var _0x48896b={};var _0x4e92b6={};var _0x5a72fd;var _0x17c122;return db['Dynamics365Account'][_0x1a2a('0x32')]({'where':{'id':_0xdf752d[_0x1a2a('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1e0b31,null))[_0x1a2a('0xa')](function(_0x5dfbc3){if(_0x5dfbc3){_0x5a72fd=_0x5dfbc3;_0x4e92b6[_0x1a2a('0x18')]=_['keys'](db[_0x1a2a('0x33')][_0x1a2a('0x14')]);_0x4e92b6[_0x1a2a('0x19')]=_['keys'](_0xdf752d[_0x1a2a('0x19')]);_0x4e92b6['filters']=_[_0x1a2a('0x1b')](_0x4e92b6[_0x1a2a('0x18')],_0x4e92b6['query']);_0x48896b['attributes']=_[_0x1a2a('0x1b')](_0x4e92b6[_0x1a2a('0x18')],qs['fields'](_0xdf752d[_0x1a2a('0x19')][_0x1a2a('0x1c')]));_0x48896b[_0x1a2a('0x1d')]=_0x48896b[_0x1a2a('0x1d')][_0x1a2a('0x1e')]?_0x48896b[_0x1a2a('0x1d')]:_0x4e92b6[_0x1a2a('0x18')];_0x48896b['order']=qs[_0x1a2a('0x34')](_0xdf752d[_0x1a2a('0x19')]['sort']);_0x48896b[_0x1a2a('0x22')]=qs['filters'](_[_0x1a2a('0x23')](_0xdf752d[_0x1a2a('0x19')],_0x4e92b6[_0x1a2a('0x1a')]));if(_0xdf752d[_0x1a2a('0x19')][_0x1a2a('0x24')]){_0x48896b[_0x1a2a('0x22')]=_['merge'](_0x48896b[_0x1a2a('0x22')],{'$or':_['map'](_0x48896b[_0x1a2a('0x1d')],function(_0x514639){var _0x11542e={};_0x11542e[_0x514639]={'$like':'%'+_0xdf752d['query'][_0x1a2a('0x24')]+'%'};return _0x11542e;})});}_0x48896b=_[_0x1a2a('0x25')]({},_0x48896b,_0xdf752d['options']);return _0x5a72fd['getConfigurations'](_0x48896b);}})['then'](function(_0x25585a){if(_0x25585a){_0x17c122=_0x25585a[_0x1a2a('0x1e')];if(!_0xdf752d['query']['hasOwnProperty']('nolimit')){_0x48896b[_0x1a2a('0x20')]=qs[_0x1a2a('0x20')](_0xdf752d[_0x1a2a('0x19')]['limit']);_0x48896b[_0x1a2a('0x5')]=qs['offset'](_0xdf752d['query'][_0x1a2a('0x5')]);}return _0x5a72fd[_0x1a2a('0x35')](_0x48896b);}})[_0x1a2a('0xa')](function(_0x12c770){if(_0x12c770){return _0x12c770?{'count':_0x17c122,'rows':_0x12c770}:null;}})[_0x1a2a('0xa')](respondWithResult(_0x1e0b31,null))[_0x1a2a('0x2a')](handleError(_0x1e0b31,null));};exports[_0x1a2a('0x36')]=function(_0x307b73,_0x326137){if(_0x307b73['body']['id']){delete _0x307b73['body']['id'];}return db[_0x1a2a('0x13')][_0x1a2a('0x32')]({'where':{'id':_0x307b73[_0x1a2a('0x2c')]['id']}})[_0x1a2a('0xa')](handleEntityNotFound(_0x326137,null))[_0x1a2a('0xa')](function(_0x13ad77){if(_0x13ad77){_0x307b73['body'][_0x1a2a('0x37')]=_0x13ad77['id'];_0x307b73['body']['Subjects']=integrations[_0x1a2a('0x38')](_0x307b73[_0x1a2a('0x31')][_0x1a2a('0x39')],_0x307b73[_0x1a2a('0x31')]['type']);_0x307b73['body']['Descriptions']=integrations[_0x1a2a('0x3a')](_0x307b73[_0x1a2a('0x31')]['channel'],_0x307b73[_0x1a2a('0x31')][_0x1a2a('0x16')]);return db[_0x1a2a('0x33')]['create'](_0x307b73[_0x1a2a('0x31')],{'include':[{'model':db[_0x1a2a('0x3b')],'as':_0x1a2a('0x3c')},{'model':db[_0x1a2a('0x3b')],'as':'Descriptions'}]});}return null;})[_0x1a2a('0xa')](respondWithResult(_0x326137,null))['catch'](handleError(_0x326137,null));};function sanitizeRemoteUri(_0x5a7d3d){var _0x55a1bb=_0x5a7d3d[_0x1a2a('0x3d')](-0x1);if(_0x55a1bb==='/')return _0x5a7d3d['substring'](0x0,_0x5a7d3d['lastIndexOf'](_0x55a1bb));return _0x5a7d3d;}function getWebApiUrl(_0x1d0a18){return util[_0x1a2a('0x3e')]('%s/api/data/v9.0/',_0x1d0a18);}exports[_0x1a2a('0x3f')]=function(_0x5ce87b,_0x15a3b4){var _0xdd9d52=_0x5ce87b[_0x1a2a('0x19')][_0x1a2a('0x40')];var _0x2af71a=_0xdd9d52===_0x1a2a('0x41')?'Incident':'PhoneCall';var _0x3b1abb='';var _0x22b637='';var _0x33e616='';var _0x26c2a5='';var _0x4b7fef='';var _0x3cb05b='';var _0x4e4f4b='';var _0xda05a1='';var _0x444d63=[_0x1a2a('0x42'),'description','customerid',_0x1a2a('0x43'),_0x1a2a('0x44'),'subject',_0x1a2a('0x45'),_0x1a2a('0x46'),_0x1a2a('0x47'),_0x1a2a('0x48')];var _0x4bfb33=[_0x1a2a('0x49'),_0x1a2a('0x4a'),_0x1a2a('0x4b'),_0x1a2a('0x4c'),_0x1a2a('0x4d'),_0x1a2a('0x4e'),_0x1a2a('0x4f'),'contractidname',_0x1a2a('0x50'),_0x1a2a('0x51'),'createdbyname',_0x1a2a('0x52'),_0x1a2a('0x53'),_0x1a2a('0x54'),_0x1a2a('0x55'),_0x1a2a('0x56'),_0x1a2a('0x57'),_0x1a2a('0x58'),_0x1a2a('0x59'),'entitlementidname',_0x1a2a('0x5a'),_0x1a2a('0x5b'),_0x1a2a('0x5c'),_0x1a2a('0x5d'),'firstresponsebykpiidname',_0x1a2a('0x5e'),'importsequencenumber','influencescore',_0x1a2a('0x5f'),_0x1a2a('0x60'),_0x1a2a('0x61'),'modifiedbyexternalpartyname',_0x1a2a('0x62'),_0x1a2a('0x63'),_0x1a2a('0x64'),'modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0x1a2a('0x65'),'msdyn_iotalertname',_0x1a2a('0x66'),_0x1a2a('0x67'),_0x1a2a('0x68'),_0x1a2a('0x69'),_0x1a2a('0x6a'),_0x1a2a('0x6b'),'parentcaseidname',_0x1a2a('0x6c'),_0x1a2a('0x6d'),_0x1a2a('0x6e'),'productidname',_0x1a2a('0x6f'),_0x1a2a('0x70'),_0x1a2a('0x71'),_0x1a2a('0x72'),_0x1a2a('0x73'),_0x1a2a('0x74'),_0x1a2a('0x75'),_0x1a2a('0x76'),_0x1a2a('0x77'),_0x1a2a('0x78'),'statecode',_0x1a2a('0x79'),'subjectidname',_0x1a2a('0x7a'),_0x1a2a('0x7b'),_0x1a2a('0x7c'),_0x1a2a('0x7d'),_0x1a2a('0x7e'),_0x1a2a('0x7f')];var _0x180272=_0x444d63[_0x1a2a('0x80')](_0x4bfb33);return db[_0x1a2a('0x13')]['findOne']({'where':{'id':_0x5ce87b[_0x1a2a('0x2c')]['id']},'attributes':['id','username',_0x1a2a('0x81'),_0x1a2a('0x82'),_0x1a2a('0x83'),_0x1a2a('0x84'),_0x1a2a('0x85'),'modernAuthentication'],'include':[{'model':db['CloudProvider'],'as':_0x1a2a('0x86'),'attributes':['id',_0x1a2a('0x87'),'data7']}]})[_0x1a2a('0xa')](handleEntityNotFound(_0x15a3b4,null))[_0x1a2a('0xa')](function(_0x4eaa1e){if(_0x4eaa1e){if(_0x4eaa1e[_0x1a2a('0x88')]){_0x4eaa1e[_0x1a2a('0x89')]=_0x4eaa1e[_0x1a2a('0x86')][_0x1a2a('0x87')];_0xda05a1=sanitizeRemoteUri(_0x4eaa1e[_0x1a2a('0x86')][_0x1a2a('0x8a')]);_0x4e4f4b=getWebApiUrl(_0xda05a1);return _0x4eaa1e;}_0xda05a1=sanitizeRemoteUri(_0x4eaa1e['remoteUri']);_0x4e4f4b=getWebApiUrl(_0xda05a1);var _0x1dee44={'method':_0x1a2a('0x8b'),'uri':_0x1a2a('0x8c')+_0x4eaa1e[_0x1a2a('0x83')]+_0x1a2a('0x8d'),'form':{'client_id':_0x4eaa1e['clientId'],'resource':_0xda05a1,'username':_0x4eaa1e['username'],'password':_0x4eaa1e[_0x1a2a('0x81')],'grant_type':_0x1a2a('0x81'),'client_secret':_0x4eaa1e[_0x1a2a('0x85')]},'json':!![]};return rp(_0x1dee44);}})[_0x1a2a('0xa')](function(_0x39713f){_0x3cb05b=_0x39713f[_0x1a2a('0x89')];var _0x3ba2fc={'method':_0x1a2a('0x8e'),'uri':encodeURI(_0x4e4f4b+_0x1a2a('0x8f')+_0x2af71a+'\x27'),'headers':{'Authorization':_0x1a2a('0x90')+_0x3cb05b,'If-None-Match':null,'OData-Version':_0x1a2a('0x91')},'json':!![]};return rp(_0x3ba2fc);})[_0x1a2a('0xa')](function(_0x526ece){var _0x58c355=_0x526ece['value'][0x0];var _0x74e129=_0x58c355['MetadataId'];var _0x4b3414={'method':_0x1a2a('0x8e'),'uri':_0x4e4f4b+_0x1a2a('0x92')+_0x74e129+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x1a2a('0x90')+_0x3cb05b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4b3414);})[_0x1a2a('0xa')](function(_0x4879e6){_0x3b1abb=_0x4879e6;_0x22b637=_0x3b1abb['Attributes'];_0x22b637=_['remove'](_0x22b637,function(_0x37d6f1){return!_0x180272[_0x1a2a('0x93')](_0x37d6f1[_0x1a2a('0x94')]);});var _0x13f057=[];var _0x33c243=[];_0x22b637[_0x1a2a('0x95')](function(_0x3c101b){if(_0x3c101b[_0x1a2a('0x96')]){var _0x4e5091=_0x3c101b['@odata.type'][_0x1a2a('0x97')](_0x3c101b['@odata.type'][_0x1a2a('0x98')]('.')+0x1);if(_0x4e5091==='PicklistAttributeMetadata'){_0x13f057[_0x1a2a('0x99')](getSelectList(_0x4e4f4b,_0xdd9d52,_0x33c243,_0x3b1abb[_0x1a2a('0x9a')],_0x3c101b[_0x1a2a('0x9a')],_0x3cb05b));}}});return Promise[_0x1a2a('0x9b')](_0x13f057);})[_0x1a2a('0xa')](function(_0x2b7bb6){_0x33e616=_0x2b7bb6[0x0];var _0x40b95d=[];var _0x22d49d=[];_0x22b637[_0x1a2a('0x95')](function(_0x2c4eda){if(!_[_0x1a2a('0x9c')](_0x2c4eda[_0x1a2a('0x96')])){var _0x92ee91=_0x2c4eda[_0x1a2a('0x96')]['substring'](_0x2c4eda[_0x1a2a('0x96')][_0x1a2a('0x98')]('.')+0x1);if(_0x92ee91==='BooleanAttributeMetadata'){_0x40b95d['push'](getBooleanList(_0x4e4f4b,_0xdd9d52,_0x22d49d,_0x3b1abb[_0x1a2a('0x9a')],_0x2c4eda[_0x1a2a('0x9a')],_0x3cb05b));}}});return Promise[_0x1a2a('0x9b')](_0x40b95d);})[_0x1a2a('0xa')](function(_0x3e5da4){_0x26c2a5=_0x3e5da4[0x0];var _0x3c01cc=[];var _0x213a73=[];_0x22b637[_0x1a2a('0x95')](function(_0x48cb03){if(_0x48cb03['@odata.type']){var _0xa60f9b=_0x48cb03[_0x1a2a('0x96')]['substring'](_0x48cb03[_0x1a2a('0x96')][_0x1a2a('0x98')]('.')+0x1);if(_0xa60f9b===_0x1a2a('0x9d')||_0xa60f9b==='DoubleAttributeMetadata'||_0xa60f9b==='BigIntAttributeMetadata'||_0xa60f9b==='IntegerAttributeMetadata'||_0xa60f9b===_0x1a2a('0x9e')||_0xa60f9b===_0x1a2a('0x9f')||_0xa60f9b===_0x1a2a('0xa0')||_0xa60f9b===_0x1a2a('0xa1')||_0xa60f9b===_0x1a2a('0xa2')||_0xa60f9b===_0x1a2a('0xa3')){_0x3c01cc[_0x1a2a('0x99')](getInputList(_0x4e4f4b,_0xdd9d52,_0xa60f9b,_0x213a73,_0x3b1abb['MetadataId'],_0x48cb03[_0x1a2a('0x9a')],_0x3cb05b));}}});return Promise['all'](_0x3c01cc);})[_0x1a2a('0xa')](function(_0x1d7e88){_0x4b7fef=_0x1d7e88[0x0];var _0x1bfc58=_0x33e616[_0x1a2a('0x80')](_0x26c2a5)[_0x1a2a('0x80')](_0x4b7fef);var _0x54a6b4={'count':_0x1bfc58[_0x1a2a('0x1e')],'rows':_0x1bfc58};return _0x54a6b4;})[_0x1a2a('0xa')](respondWithResult(_0x15a3b4,null))['catch'](function(_0x55787d){var _0x1ab145=_0x5ce87b[_0x1a2a('0x19')][_0x1a2a('0xa4')]?0x1f4:_0x55787d[_0x1a2a('0xa5')]||0x1f4;logger[_0x1a2a('0xe')](_0x55787d['stack']);delete _0x55787d[_0x1a2a('0xf')];if(_0x1ab145===0x191){_0x1ab145=0x190;}_0x15a3b4[_0x1a2a('0x4')](_0x1ab145)[_0x1a2a('0x10')](_0x5ce87b[_0x1a2a('0x19')][_0x1a2a('0xa4')]?{'message':'Wrong\x20credentials','statusCode':_0x55787d[_0x1a2a('0xa5')]}:_0x55787d);});};function getSelectList(_0xef1b6,_0x3338c0,_0x4bcadb,_0x3b282e,_0x336d53,_0x4bcedf){var _0x545cc8={'method':_0x1a2a('0x8e'),'uri':_0xef1b6+_0x1a2a('0x92')+_0x3b282e+_0x1a2a('0xa6')+_0x336d53+_0x1a2a('0xa7')+_0x1a2a('0xa8'),'headers':{'Authorization':'Bearer\x20'+_0x4bcedf,'If-None-Match':null,'OData-Version':_0x1a2a('0x91')},'json':!![]};return rp(_0x545cc8)['then'](function(_0x21daa1){var _0x4f450f=[];var _0x19eac4=_0x21daa1['OptionSet'][_0x1a2a('0xa9')];_0x19eac4[_0x1a2a('0x95')](function(_0x1664d5){_0x4f450f[_0x1a2a('0x99')]({'name':_0x1664d5[_0x1a2a('0xaa')][_0x1a2a('0xab')][_0x1a2a('0xaa')],'value':String(_0x1664d5[_0x1a2a('0xac')])});});var _0x423969={'id':_0x3338c0+'_'+_0x21daa1[_0x1a2a('0x94')],'name':_0x21daa1['DisplayName'][_0x1a2a('0xab')][_0x1a2a('0xaa')],'custom':![],'options':_0x4f450f};_0x4bcadb['push'](_0x423969);return _0x4bcadb;});}function getBooleanList(_0x1faeba,_0x3d918c,_0xb2bae8,_0x21b658,_0x219454,_0x13b5f1){var _0x58a1e2={'method':_0x1a2a('0x8e'),'uri':_0x1faeba+_0x1a2a('0x92')+_0x21b658+_0x1a2a('0xa6')+_0x219454+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x1a2a('0x90')+_0x13b5f1,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x58a1e2)[_0x1a2a('0xa')](function(_0x4e6314){var _0x18249a=[];_0x18249a[_0x1a2a('0x99')]({'name':_0x4e6314[_0x1a2a('0xad')][_0x1a2a('0xae')]['Label']['UserLocalizedLabel'][_0x1a2a('0xaa')],'value':_0x1a2a('0xaf')},{'name':_0x4e6314['OptionSet'][_0x1a2a('0xb0')]['Label'][_0x1a2a('0xab')][_0x1a2a('0xaa')],'value':_0x1a2a('0xb1')});var _0x425fb8={'id':_0x3d918c+'_'+_0x4e6314['LogicalName'],'name':_0x4e6314[_0x1a2a('0xb2')][_0x1a2a('0xab')][_0x1a2a('0xaa')],'custom':![],'options':_0x18249a};_0xb2bae8['push'](_0x425fb8);return _0xb2bae8;});}function getInputList(_0x4581da,_0x1d5519,_0x42ee64,_0x64b6c9,_0x26b88a,_0x1f6ff2,_0x18cebd){var _0xa9c496={'method':_0x1a2a('0x8e'),'uri':_0x4581da+_0x1a2a('0x92')+_0x26b88a+')/Attributes('+_0x1f6ff2+_0x1a2a('0xb3')+_0x42ee64+_0x1a2a('0xb4'),'headers':{'Authorization':'Bearer\x20'+_0x18cebd,'If-None-Match':null,'OData-Version':_0x1a2a('0x91')},'json':!![]};return rp(_0xa9c496)[_0x1a2a('0xa')](function(_0x37e92e){var _0x412849={'id':_0x1d5519+'_'+_0x37e92e[_0x1a2a('0x94')],'name':_0x37e92e[_0x1a2a('0xb2')]['UserLocalizedLabel']?_0x37e92e[_0x1a2a('0xb2')][_0x1a2a('0xab')][_0x1a2a('0xaa')]:_0x37e92e[_0x1a2a('0x94')],'custom':![],'options':[]};_0x64b6c9[_0x1a2a('0x99')](_0x412849);return _0x64b6c9;});} \ No newline at end of file +var _0xaf33=['contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','tenantId','clientId','clientSecret','CloudProvider','data5','data7','modernAuthentication','remoteUri','POST','/oauth2/token','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20','OptionSet','Options','UserLocalizedLabel','Label','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','getConfigurations','findOne','Subjects','getSubjects','channel','Dynamics365Configuration','Dynamics365Field','Descriptions','slice','substring','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','billedserviceunits','contactidname','contactidyominame'];(function(_0x514816,_0x57c091){var _0x5c3a43=function(_0xd4a413){while(--_0xd4a413){_0x514816['push'](_0x514816['shift']());}};_0x5c3a43(++_0x57c091);}(_0xaf33,0x12c));var _0x3af3=function(_0x18c08a,_0x46e340){_0x18c08a=_0x18c08a-0x0;var _0x388429=_0xaf33[_0x18c08a];return _0x388429;};'use strict';var rp=require(_0x3af3('0x0'));var util=require(_0x3af3('0x1'));var _=require(_0x3af3('0x2'));var qs=require(_0x3af3('0x3'));var logger=require('../../config/logger')(_0x3af3('0x4'));var db=require(_0x3af3('0x5'))['db'];var integrations=require(_0x3af3('0x6'));function respondWithResult(_0x2ef234,_0x1158d3){_0x1158d3=_0x1158d3||0xc8;return function(_0x285f25){if(_0x285f25){return _0x2ef234[_0x3af3('0x7')](_0x1158d3)[_0x3af3('0x8')](_0x285f25);}};}function respondWithFilteredResult(_0x23c8a8,_0x403bf7){return function(_0x51f5a9){if(_0x51f5a9){var _0x3533c4=typeof _0x403bf7[_0x3af3('0x9')]==='undefined'&&typeof _0x403bf7[_0x3af3('0xa')]==='undefined';var _0x2b0ff1=_0x51f5a9['count'];var _0x41198d=_0x3533c4?0x0:_0x403bf7[_0x3af3('0x9')];var _0x18f0cc=_0x3533c4?_0x51f5a9[_0x3af3('0xb')]:_0x403bf7['offset']+_0x403bf7['limit'];var _0x447010;if(_0x18f0cc>=_0x2b0ff1){_0x18f0cc=_0x2b0ff1;_0x447010=0xc8;}else{_0x447010=0xce;}_0x23c8a8['status'](_0x447010);return _0x23c8a8[_0x3af3('0xc')](_0x3af3('0xd'),_0x41198d+'-'+_0x18f0cc+'/'+_0x2b0ff1)[_0x3af3('0x8')](_0x51f5a9);}return null;};}function saveUpdates(_0x2cb48e){return function(_0x5d95a6){if(_0x5d95a6){return _0x5d95a6[_0x3af3('0xe')](_0x2cb48e)[_0x3af3('0xf')](function(_0x57f3fb){return _0x57f3fb;});}return null;};}function removeEntity(_0x2f9849){return function(_0x3f499c){if(_0x3f499c){return _0x3f499c[_0x3af3('0x10')]()['then'](function(){_0x2f9849['status'](0xcc)[_0x3af3('0x11')]();});}};}function handleEntityNotFound(_0x5e3204){return function(_0x2cdc0e){if(!_0x2cdc0e){_0x5e3204[_0x3af3('0x12')](0x194);}return _0x2cdc0e;};}function handleError(_0x6d855b,_0x401fef){_0x401fef=_0x401fef||0x1f4;return function(_0x1a5786){logger[_0x3af3('0x13')](_0x1a5786['stack']);if(_0x1a5786[_0x3af3('0x14')]){delete _0x1a5786[_0x3af3('0x14')];}_0x6d855b[_0x3af3('0x7')](_0x401fef)[_0x3af3('0x15')](_0x1a5786);};}exports[_0x3af3('0x16')]=function(_0x31f596,_0xae7a78){var _0x48ebf1={},_0x348f58={},_0x30dced={'count':0x0,'rows':[]};var _0x29eeec=_[_0x3af3('0x17')](db[_0x3af3('0x18')][_0x3af3('0x19')],function(_0x271080){return{'name':_0x271080[_0x3af3('0x1a')],'type':_0x271080[_0x3af3('0x1b')][_0x3af3('0x1c')]};});_0x348f58['model']=_[_0x3af3('0x17')](_0x29eeec,_0x3af3('0x14'));_0x348f58['query']=_[_0x3af3('0x1d')](_0x31f596[_0x3af3('0x1e')]);_0x348f58[_0x3af3('0x1f')]=_[_0x3af3('0x20')](_0x348f58[_0x3af3('0x21')],_0x348f58['query']);_0x48ebf1[_0x3af3('0x22')]=_['intersection'](_0x348f58[_0x3af3('0x21')],qs[_0x3af3('0x23')](_0x31f596[_0x3af3('0x1e')][_0x3af3('0x23')]));_0x48ebf1[_0x3af3('0x22')]=_0x48ebf1[_0x3af3('0x22')][_0x3af3('0x24')]?_0x48ebf1[_0x3af3('0x22')]:_0x348f58['model'];if(!_0x31f596[_0x3af3('0x1e')][_0x3af3('0x25')](_0x3af3('0x26'))){_0x48ebf1[_0x3af3('0xa')]=qs['limit'](_0x31f596[_0x3af3('0x1e')]['limit']);_0x48ebf1[_0x3af3('0x9')]=qs[_0x3af3('0x9')](_0x31f596[_0x3af3('0x1e')]['offset']);}_0x48ebf1[_0x3af3('0x27')]=qs[_0x3af3('0x28')](_0x31f596['query'][_0x3af3('0x28')]);_0x48ebf1['where']=qs['filters'](_[_0x3af3('0x29')](_0x31f596[_0x3af3('0x1e')],_0x348f58[_0x3af3('0x1f')]),_0x29eeec);if(_0x31f596['query'][_0x3af3('0x2a')]){_0x48ebf1['where']=_[_0x3af3('0x2b')](_0x48ebf1[_0x3af3('0x2c')],{'$or':_[_0x3af3('0x17')](_0x29eeec,function(_0xb76bdc){if(_0xb76bdc['type']!==_0x3af3('0x2d')){var _0x2ebc85={};_0x2ebc85[_0xb76bdc[_0x3af3('0x14')]]={'$like':'%'+_0x31f596[_0x3af3('0x1e')]['filter']+'%'};return _0x2ebc85;}})});}_0x48ebf1=_[_0x3af3('0x2b')]({},_0x48ebf1,_0x31f596['options']);var _0x58686e={'where':_0x48ebf1[_0x3af3('0x2c')]};return db[_0x3af3('0x18')][_0x3af3('0xb')](_0x58686e)['then'](function(_0x5bd8f0){_0x30dced[_0x3af3('0xb')]=_0x5bd8f0;if(_0x31f596['query'][_0x3af3('0x2e')]){_0x48ebf1['include']=[{'all':!![]}];}return db['Dynamics365Account'][_0x3af3('0x2f')](_0x48ebf1);})[_0x3af3('0xf')](function(_0x59b2d6){_0x30dced[_0x3af3('0x30')]=_0x59b2d6;return _0x30dced;})[_0x3af3('0xf')](respondWithFilteredResult(_0xae7a78,_0x48ebf1))[_0x3af3('0x31')](handleError(_0xae7a78,null));};exports[_0x3af3('0x32')]=function(_0x5bdc28,_0x2d6ed9){var _0x286269={'raw':![],'where':{'id':_0x5bdc28[_0x3af3('0x33')]['id']}},_0x5f5523={};_0x5f5523[_0x3af3('0x21')]=_[_0x3af3('0x1d')](db[_0x3af3('0x18')][_0x3af3('0x19')]);_0x5f5523[_0x3af3('0x1e')]=_[_0x3af3('0x1d')](_0x5bdc28[_0x3af3('0x1e')]);_0x5f5523[_0x3af3('0x1f')]=_['intersection'](_0x5f5523['model'],_0x5f5523[_0x3af3('0x1e')]);_0x286269['attributes']=_['intersection'](_0x5f5523[_0x3af3('0x21')],qs[_0x3af3('0x23')](_0x5bdc28[_0x3af3('0x1e')][_0x3af3('0x23')]));_0x286269[_0x3af3('0x22')]=_0x286269[_0x3af3('0x22')]['length']?_0x286269[_0x3af3('0x22')]:_0x5f5523[_0x3af3('0x21')];if(_0x5bdc28[_0x3af3('0x1e')][_0x3af3('0x2e')]){_0x286269[_0x3af3('0x34')]=[{'all':!![]}];}_0x286269=_[_0x3af3('0x2b')]({},_0x286269,_0x5bdc28[_0x3af3('0x35')]);return db['Dynamics365Account'][_0x3af3('0x36')](_0x286269)['then'](handleEntityNotFound(_0x2d6ed9,null))[_0x3af3('0xf')](respondWithResult(_0x2d6ed9,null))[_0x3af3('0x31')](handleError(_0x2d6ed9,null));};exports[_0x3af3('0x37')]=function(_0x3d6518,_0x504e91){return db[_0x3af3('0x18')][_0x3af3('0x37')](_0x3d6518['body'],{})[_0x3af3('0xf')](respondWithResult(_0x504e91,0xc9))[_0x3af3('0x31')](handleError(_0x504e91,null));};exports[_0x3af3('0xe')]=function(_0x5c9a4f,_0x155902){if(_0x5c9a4f[_0x3af3('0x38')]['id']){delete _0x5c9a4f[_0x3af3('0x38')]['id'];}return db[_0x3af3('0x18')][_0x3af3('0x36')]({'where':{'id':_0x5c9a4f[_0x3af3('0x33')]['id']}})['then'](handleEntityNotFound(_0x155902,null))['then'](saveUpdates(_0x5c9a4f['body'],null))[_0x3af3('0xf')](respondWithResult(_0x155902,null))[_0x3af3('0x31')](handleError(_0x155902,null));};exports[_0x3af3('0x10')]=function(_0x10d8ab,_0x39db3a){return db['Dynamics365Account'][_0x3af3('0x36')]({'where':{'id':_0x10d8ab[_0x3af3('0x33')]['id']}})['then'](handleEntityNotFound(_0x39db3a,null))[_0x3af3('0xf')](removeEntity(_0x39db3a,null))[_0x3af3('0x31')](handleError(_0x39db3a,null));};exports[_0x3af3('0x39')]=function(_0x1e31a9,_0x53eea2){var _0x114371={};var _0x435a11={};var _0x1a35b2;var _0x1c1bb;return db[_0x3af3('0x18')]['findOne']({'where':{'id':_0x1e31a9['params']['id']}})['then'](handleEntityNotFound(_0x53eea2,null))[_0x3af3('0xf')](function(_0xf4cdd9){if(_0xf4cdd9){_0x1a35b2=_0xf4cdd9;_0x435a11[_0x3af3('0x21')]=_[_0x3af3('0x1d')](db['Dynamics365Configuration'][_0x3af3('0x19')]);_0x435a11[_0x3af3('0x1e')]=_[_0x3af3('0x1d')](_0x1e31a9[_0x3af3('0x1e')]);_0x435a11['filters']=_[_0x3af3('0x20')](_0x435a11[_0x3af3('0x21')],_0x435a11[_0x3af3('0x1e')]);_0x114371[_0x3af3('0x22')]=_[_0x3af3('0x20')](_0x435a11[_0x3af3('0x21')],qs['fields'](_0x1e31a9[_0x3af3('0x1e')][_0x3af3('0x23')]));_0x114371[_0x3af3('0x22')]=_0x114371[_0x3af3('0x22')]['length']?_0x114371[_0x3af3('0x22')]:_0x435a11[_0x3af3('0x21')];_0x114371[_0x3af3('0x27')]=qs['sort'](_0x1e31a9[_0x3af3('0x1e')][_0x3af3('0x28')]);_0x114371[_0x3af3('0x2c')]=qs[_0x3af3('0x1f')](_[_0x3af3('0x29')](_0x1e31a9[_0x3af3('0x1e')],_0x435a11['filters']));if(_0x1e31a9[_0x3af3('0x1e')][_0x3af3('0x2a')]){_0x114371[_0x3af3('0x2c')]=_[_0x3af3('0x2b')](_0x114371[_0x3af3('0x2c')],{'$or':_[_0x3af3('0x17')](_0x114371[_0x3af3('0x22')],function(_0x2d090e){var _0x4e2646={};_0x4e2646[_0x2d090e]={'$like':'%'+_0x1e31a9[_0x3af3('0x1e')][_0x3af3('0x2a')]+'%'};return _0x4e2646;})});}_0x114371=_[_0x3af3('0x2b')]({},_0x114371,_0x1e31a9[_0x3af3('0x35')]);return _0x1a35b2[_0x3af3('0x39')](_0x114371);}})[_0x3af3('0xf')](function(_0x33e560){if(_0x33e560){_0x1c1bb=_0x33e560['length'];if(!_0x1e31a9[_0x3af3('0x1e')][_0x3af3('0x25')]('nolimit')){_0x114371[_0x3af3('0xa')]=qs[_0x3af3('0xa')](_0x1e31a9[_0x3af3('0x1e')][_0x3af3('0xa')]);_0x114371[_0x3af3('0x9')]=qs['offset'](_0x1e31a9['query'][_0x3af3('0x9')]);}return _0x1a35b2[_0x3af3('0x39')](_0x114371);}})[_0x3af3('0xf')](function(_0x126165){if(_0x126165){return _0x126165?{'count':_0x1c1bb,'rows':_0x126165}:null;}})[_0x3af3('0xf')](respondWithResult(_0x53eea2,null))[_0x3af3('0x31')](handleError(_0x53eea2,null));};exports['addConfiguration']=function(_0x45fa1d,_0x4f6785){if(_0x45fa1d[_0x3af3('0x38')]['id']){delete _0x45fa1d[_0x3af3('0x38')]['id'];}return db[_0x3af3('0x18')][_0x3af3('0x3a')]({'where':{'id':_0x45fa1d[_0x3af3('0x33')]['id']}})['then'](handleEntityNotFound(_0x4f6785,null))['then'](function(_0x12c659){if(_0x12c659){_0x45fa1d[_0x3af3('0x38')]['AccountId']=_0x12c659['id'];_0x45fa1d['body'][_0x3af3('0x3b')]=integrations[_0x3af3('0x3c')](_0x45fa1d[_0x3af3('0x38')][_0x3af3('0x3d')],_0x45fa1d['body'][_0x3af3('0x1b')]);_0x45fa1d[_0x3af3('0x38')]['Descriptions']=integrations['getDescriptions'](_0x45fa1d[_0x3af3('0x38')][_0x3af3('0x3d')],_0x45fa1d[_0x3af3('0x38')][_0x3af3('0x1b')]);return db[_0x3af3('0x3e')][_0x3af3('0x37')](_0x45fa1d[_0x3af3('0x38')],{'include':[{'model':db[_0x3af3('0x3f')],'as':'Subjects'},{'model':db[_0x3af3('0x3f')],'as':_0x3af3('0x40')}]});}return null;})['then'](respondWithResult(_0x4f6785,null))[_0x3af3('0x31')](handleError(_0x4f6785,null));};function sanitizeRemoteUri(_0x2b5075){var _0x30f198=_0x2b5075[_0x3af3('0x41')](-0x1);if(_0x30f198==='/')return _0x2b5075[_0x3af3('0x42')](0x0,_0x2b5075['lastIndexOf'](_0x30f198));return _0x2b5075;}function getWebApiUrl(_0x1227a2){return util['format'](_0x3af3('0x43'),_0x1227a2);}exports['getFields']=function(_0x5a5118,_0x4b620b){var _0x15105a=_0x5a5118[_0x3af3('0x1e')][_0x3af3('0x44')];var _0x31a7f7=_0x15105a===_0x3af3('0x45')?_0x3af3('0x46'):_0x3af3('0x47');var _0x382cc2='';var _0x281fbb='';var _0x4a4d58='';var _0x583ec5='';var _0x11fe9a='';var _0x5b2c8b='';var _0x4aa6c1='';var _0xfb1377='';var _0x3d45a7=[_0x3af3('0x48'),_0x3af3('0x49'),_0x3af3('0x4a'),_0x3af3('0x4b'),_0x3af3('0x4c'),_0x3af3('0x4d'),_0x3af3('0x4e'),_0x3af3('0x4f'),_0x3af3('0x50'),'phonecall_activity_parties'];var _0x472dee=['accountidname','accountidyominame','actualserviceunits',_0x3af3('0x51'),_0x3af3('0x52'),_0x3af3('0x53'),_0x3af3('0x54'),_0x3af3('0x55'),_0x3af3('0x56'),'createdbyexternalpartyyominame',_0x3af3('0x57'),_0x3af3('0x58'),_0x3af3('0x59'),'createdonbehalfbyname','createdonbehalfbyyominame','customeridname',_0x3af3('0x5a'),_0x3af3('0x5b'),'emailaddress',_0x3af3('0x5c'),_0x3af3('0x5d'),_0x3af3('0x5e'),_0x3af3('0x5f'),_0x3af3('0x60'),_0x3af3('0x61'),_0x3af3('0x62'),'importsequencenumber',_0x3af3('0x63'),_0x3af3('0x64'),'lastonholdtime',_0x3af3('0x65'),_0x3af3('0x66'),_0x3af3('0x67'),_0x3af3('0x68'),_0x3af3('0x69'),_0x3af3('0x6a'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0x3af3('0x6b'),_0x3af3('0x6c'),_0x3af3('0x6d'),'onholdtime','overriddencreatedon','owneridname',_0x3af3('0x6e'),_0x3af3('0x6f'),'parentcaseidname',_0x3af3('0x70'),_0x3af3('0x71'),_0x3af3('0x72'),_0x3af3('0x73'),_0x3af3('0x74'),_0x3af3('0x75'),_0x3af3('0x76'),'responseby',_0x3af3('0x77'),_0x3af3('0x78'),_0x3af3('0x79'),_0x3af3('0x7a'),_0x3af3('0x7b'),_0x3af3('0x7c'),_0x3af3('0x7d'),_0x3af3('0x7e'),_0x3af3('0x7f'),_0x3af3('0x80'),_0x3af3('0x81'),'transactioncurrencyidname',_0x3af3('0x82'),_0x3af3('0x83'),_0x3af3('0x84')];var _0x3c657b=_0x3d45a7[_0x3af3('0x85')](_0x472dee);return db[_0x3af3('0x18')][_0x3af3('0x3a')]({'where':{'id':_0x5a5118[_0x3af3('0x33')]['id']},'attributes':['id','username','password','remoteUri',_0x3af3('0x86'),_0x3af3('0x87'),_0x3af3('0x88'),'modernAuthentication'],'include':[{'model':db[_0x3af3('0x89')],'as':_0x3af3('0x89'),'attributes':['id',_0x3af3('0x8a'),_0x3af3('0x8b')]}]})[_0x3af3('0xf')](handleEntityNotFound(_0x4b620b,null))[_0x3af3('0xf')](function(_0x5297ce){if(_0x5297ce){if(_0x5297ce[_0x3af3('0x8c')]){_0x5297ce['access_token']=_0x5297ce[_0x3af3('0x89')]['data5'];_0xfb1377=sanitizeRemoteUri(_0x5297ce[_0x3af3('0x89')][_0x3af3('0x8b')]);_0x4aa6c1=getWebApiUrl(_0xfb1377);return _0x5297ce;}_0xfb1377=sanitizeRemoteUri(_0x5297ce[_0x3af3('0x8d')]);_0x4aa6c1=getWebApiUrl(_0xfb1377);var _0x3db372={'method':_0x3af3('0x8e'),'uri':'https://login.microsoftonline.com/'+_0x5297ce[_0x3af3('0x86')]+_0x3af3('0x8f'),'form':{'client_id':_0x5297ce[_0x3af3('0x87')],'resource':_0xfb1377,'username':_0x5297ce['username'],'password':_0x5297ce['password'],'grant_type':_0x3af3('0x90'),'client_secret':_0x5297ce[_0x3af3('0x88')]},'json':!![]};return rp(_0x3db372);}})[_0x3af3('0xf')](function(_0x3d4cd5){_0x5b2c8b=_0x3d4cd5[_0x3af3('0x91')];var _0x5bb679={'method':_0x3af3('0x92'),'uri':encodeURI(_0x4aa6c1+_0x3af3('0x93')+_0x31a7f7+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x5b2c8b,'If-None-Match':null,'OData-Version':_0x3af3('0x94')},'json':!![]};return rp(_0x5bb679);})[_0x3af3('0xf')](function(_0x119df8){var _0x5a7400=_0x119df8[_0x3af3('0x95')][0x0];var _0xfbd5fd=_0x5a7400[_0x3af3('0x96')];var _0x5959ec={'method':'GET','uri':_0x4aa6c1+_0x3af3('0x97')+_0xfbd5fd+_0x3af3('0x98'),'headers':{'Authorization':'Bearer\x20'+_0x5b2c8b,'If-None-Match':null,'OData-Version':_0x3af3('0x94')},'json':!![]};return rp(_0x5959ec);})[_0x3af3('0xf')](function(_0x53dfb0){_0x382cc2=_0x53dfb0;_0x281fbb=_0x382cc2[_0x3af3('0x99')];_0x281fbb=_[_0x3af3('0x9a')](_0x281fbb,function(_0x3eede2){return!_0x3c657b[_0x3af3('0x9b')](_0x3eede2['LogicalName']);});var _0x1fd87f=[];var _0x198231=[];_0x281fbb[_0x3af3('0x9c')](function(_0x1ab11b){if(_0x1ab11b[_0x3af3('0x9d')]){var _0x2e6ef1=_0x1ab11b['@odata.type'][_0x3af3('0x42')](_0x1ab11b[_0x3af3('0x9d')][_0x3af3('0x9e')]('.')+0x1);if(_0x2e6ef1===_0x3af3('0x9f')){_0x1fd87f[_0x3af3('0xa0')](getSelectList(_0x4aa6c1,_0x15105a,_0x198231,_0x382cc2[_0x3af3('0x96')],_0x1ab11b[_0x3af3('0x96')],_0x5b2c8b));}}});return Promise[_0x3af3('0xa1')](_0x1fd87f);})[_0x3af3('0xf')](function(_0x19f4d1){_0x4a4d58=_0x19f4d1[0x0];var _0x4f43ca=[];var _0xc30496=[];_0x281fbb['forEach'](function(_0x14ddf6){if(!_[_0x3af3('0xa2')](_0x14ddf6['@odata.type'])){var _0xedd574=_0x14ddf6[_0x3af3('0x9d')][_0x3af3('0x42')](_0x14ddf6[_0x3af3('0x9d')][_0x3af3('0x9e')]('.')+0x1);if(_0xedd574==='BooleanAttributeMetadata'){_0x4f43ca[_0x3af3('0xa0')](getBooleanList(_0x4aa6c1,_0x15105a,_0xc30496,_0x382cc2[_0x3af3('0x96')],_0x14ddf6['MetadataId'],_0x5b2c8b));}}});return Promise[_0x3af3('0xa1')](_0x4f43ca);})['then'](function(_0x242c37){_0x583ec5=_0x242c37[0x0];var _0x3d1d5b=[];var _0x44a605=[];_0x281fbb[_0x3af3('0x9c')](function(_0x49eaec){if(_0x49eaec[_0x3af3('0x9d')]){var _0x43a5d9=_0x49eaec[_0x3af3('0x9d')][_0x3af3('0x42')](_0x49eaec[_0x3af3('0x9d')][_0x3af3('0x9e')]('.')+0x1);if(_0x43a5d9===_0x3af3('0xa3')||_0x43a5d9===_0x3af3('0xa4')||_0x43a5d9===_0x3af3('0xa5')||_0x43a5d9===_0x3af3('0xa6')||_0x43a5d9===_0x3af3('0xa7')||_0x43a5d9==='DateTimeAttributeMetadata'||_0x43a5d9===_0x3af3('0xa8')||_0x43a5d9===_0x3af3('0xa9')||_0x43a5d9===_0x3af3('0xaa')||_0x43a5d9===_0x3af3('0xab')){_0x3d1d5b[_0x3af3('0xa0')](getInputList(_0x4aa6c1,_0x15105a,_0x43a5d9,_0x44a605,_0x382cc2[_0x3af3('0x96')],_0x49eaec[_0x3af3('0x96')],_0x5b2c8b));}}});return Promise[_0x3af3('0xa1')](_0x3d1d5b);})[_0x3af3('0xf')](function(_0x51d799){_0x11fe9a=_0x51d799[0x0];var _0x213768=_0x4a4d58[_0x3af3('0x85')](_0x583ec5)[_0x3af3('0x85')](_0x11fe9a);var _0x3ba4ba={'count':_0x213768[_0x3af3('0x24')],'rows':_0x213768};return _0x3ba4ba;})[_0x3af3('0xf')](respondWithResult(_0x4b620b,null))[_0x3af3('0x31')](function(_0x40ea31){var _0x1ea6c9=_0x5a5118[_0x3af3('0x1e')][_0x3af3('0xac')]?0x1f4:_0x40ea31[_0x3af3('0xad')]||0x1f4;logger[_0x3af3('0x13')](_0x40ea31['stack']);delete _0x40ea31[_0x3af3('0x14')];if(_0x1ea6c9===0x191){_0x1ea6c9=0x190;}_0x4b620b[_0x3af3('0x7')](_0x1ea6c9)[_0x3af3('0x15')](_0x5a5118[_0x3af3('0x1e')]['test']?{'message':_0x3af3('0xae'),'statusCode':_0x40ea31[_0x3af3('0xad')]}:_0x40ea31);});};function getSelectList(_0x162cfb,_0x4368da,_0x3e0067,_0x1a5b70,_0x319327,_0x415a8a){var _0x5a66ad={'method':_0x3af3('0x92'),'uri':_0x162cfb+_0x3af3('0x97')+_0x1a5b70+_0x3af3('0xaf')+_0x319327+_0x3af3('0xb0')+_0x3af3('0xb1'),'headers':{'Authorization':_0x3af3('0xb2')+_0x415a8a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5a66ad)[_0x3af3('0xf')](function(_0x26c55b){var _0x1e59dd=[];var _0x18a8fd=_0x26c55b[_0x3af3('0xb3')][_0x3af3('0xb4')];_0x18a8fd['forEach'](function(_0x48806c){_0x1e59dd[_0x3af3('0xa0')]({'name':_0x48806c['Label'][_0x3af3('0xb5')][_0x3af3('0xb6')],'value':String(_0x48806c[_0x3af3('0xb7')])});});var _0x1d84bd={'id':_0x4368da+'_'+_0x26c55b[_0x3af3('0xb8')],'name':_0x26c55b[_0x3af3('0xb9')][_0x3af3('0xb5')][_0x3af3('0xb6')],'custom':![],'options':_0x1e59dd};_0x3e0067[_0x3af3('0xa0')](_0x1d84bd);return _0x3e0067;});}function getBooleanList(_0x30210b,_0x2eaedd,_0x34c33b,_0x275279,_0x2a22e8,_0x5c5f06){var _0x35390c={'method':_0x3af3('0x92'),'uri':_0x30210b+_0x3af3('0x97')+_0x275279+_0x3af3('0xaf')+_0x2a22e8+_0x3af3('0xba'),'headers':{'Authorization':_0x3af3('0xb2')+_0x5c5f06,'If-None-Match':null,'OData-Version':_0x3af3('0x94')},'json':!![]};return rp(_0x35390c)[_0x3af3('0xf')](function(_0x5c7c8a){var _0x5c41ab=[];_0x5c41ab[_0x3af3('0xa0')]({'name':_0x5c7c8a['OptionSet']['TrueOption'][_0x3af3('0xb6')][_0x3af3('0xb5')]['Label'],'value':_0x3af3('0xbb')},{'name':_0x5c7c8a[_0x3af3('0xb3')][_0x3af3('0xbc')][_0x3af3('0xb6')][_0x3af3('0xb5')][_0x3af3('0xb6')],'value':_0x3af3('0xbd')});var _0x1cfc6b={'id':_0x2eaedd+'_'+_0x5c7c8a['LogicalName'],'name':_0x5c7c8a['DisplayName'][_0x3af3('0xb5')][_0x3af3('0xb6')],'custom':![],'options':_0x5c41ab};_0x34c33b[_0x3af3('0xa0')](_0x1cfc6b);return _0x34c33b;});}function getInputList(_0x28b4da,_0x34d680,_0x4365f0,_0x4ff37a,_0x165b38,_0x5c018d,_0x43ce5f){var _0x1b1779={'method':_0x3af3('0x92'),'uri':_0x28b4da+'EntityDefinitions('+_0x165b38+_0x3af3('0xaf')+_0x5c018d+_0x3af3('0xbe')+_0x4365f0+_0x3af3('0xbf'),'headers':{'Authorization':_0x3af3('0xb2')+_0x43ce5f,'If-None-Match':null,'OData-Version':_0x3af3('0x94')},'json':!![]};return rp(_0x1b1779)[_0x3af3('0xf')](function(_0x259991){var _0x3b6a74={'id':_0x34d680+'_'+_0x259991[_0x3af3('0xb8')],'name':_0x259991[_0x3af3('0xb9')]['UserLocalizedLabel']?_0x259991[_0x3af3('0xb9')][_0x3af3('0xb5')]['Label']:_0x259991[_0x3af3('0xb8')],'custom':![],'options':[]};_0x4ff37a[_0x3af3('0xa0')](_0x3b6a74);return _0x4ff37a;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index aec5007..aeb115a 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 _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x96f67e,_0x407f26){var _0x1fb6c2=function(_0x1a70a3){while(--_0x1a70a3){_0x96f67e['push'](_0x96f67e['shift']());}};_0x1fb6c2(++_0x407f26);}(_0x757a,0xde));var _0xa757=function(_0x103752,_0x327965){_0x103752=_0x103752-0x0;var _0x174586=_0x757a[_0x103752];return _0x174586;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x452faa,_0xd4be28){var _0x59f64c=function(_0x2aa03c){while(--_0x2aa03c){_0x452faa['push'](_0x452faa['shift']());}};_0x59f64c(++_0xd4be28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',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 bbfef72..97cb274 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 _0xe854=['Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetDynamics365Account','Dynamics365Account','options','attributes','limit','include','map','model','then','ShowDynamics365Account','find','raw','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info'];(function(_0x401507,_0x185ff0){var _0x424a34=function(_0x20f1c1){while(--_0x20f1c1){_0x401507['push'](_0x401507['shift']());}};_0x424a34(++_0x185ff0);}(_0xe854,0xf5));var _0x4e85=function(_0x3296c3,_0xc96c4a){_0x3296c3=_0x3296c3-0x0;var _0x1fb66a=_0xe854[_0x3296c3];return _0x1fb66a;};'use strict';var _=require(_0x4e85('0x0'));var util=require(_0x4e85('0x1'));var moment=require('moment');var BPromise=require(_0x4e85('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e85('0x3'));var db=require(_0x4e85('0x4'))['db'];var utils=require(_0x4e85('0x5'));var logger=require(_0x4e85('0x6'))('rpc');var config=require(_0x4e85('0x7'));var jayson=require(_0x4e85('0x8'));var client=jayson['client'][_0x4e85('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f1592,_0x296425,_0x363e66){return new BPromise(function(_0x20ce31,_0x7e4e2c){return client['request'](_0x2f1592,_0x363e66)['then'](function(_0x41a6d4){logger[_0x4e85('0xa')](_0x4e85('0xb'),_0x296425,'request\x20sent');logger[_0x4e85('0xc')](_0x4e85('0xd'),_0x296425,_0x4e85('0xe'),JSON[_0x4e85('0xf')](_0x41a6d4));if(_0x41a6d4[_0x4e85('0x10')]){if(_0x41a6d4['error'][_0x4e85('0x11')]===0x1f4){logger['error'](_0x4e85('0xb'),_0x296425,_0x41a6d4[_0x4e85('0x10')][_0x4e85('0x12')]);return _0x7e4e2c(_0x41a6d4[_0x4e85('0x10')][_0x4e85('0x12')]);}logger[_0x4e85('0x10')](_0x4e85('0xb'),_0x296425,_0x41a6d4[_0x4e85('0x10')][_0x4e85('0x12')]);return _0x20ce31(_0x41a6d4[_0x4e85('0x10')]['message']);}else{logger['info'](_0x4e85('0xb'),_0x296425,_0x4e85('0xe'));_0x20ce31(_0x41a6d4['result'][_0x4e85('0x12')]);}})['catch'](function(_0x357f66){logger[_0x4e85('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x296425,_0x357f66);_0x7e4e2c(_0x357f66);});});}exports[_0x4e85('0x13')]=function(_0x2f69dd){var _0x392475=this;return new Promise(function(_0x35ef18,_0x3d6759){return db[_0x4e85('0x14')]['findAll']({'raw':_0x2f69dd['options']?_0x2f69dd[_0x4e85('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2f69dd[_0x4e85('0x15')]?_0x2f69dd[_0x4e85('0x15')]['where']||null:null,'attributes':_0x2f69dd[_0x4e85('0x15')]?_0x2f69dd[_0x4e85('0x15')][_0x4e85('0x16')]||null:null,'limit':_0x2f69dd[_0x4e85('0x15')]?_0x2f69dd[_0x4e85('0x15')][_0x4e85('0x17')]||null:null,'include':_0x2f69dd[_0x4e85('0x15')]?_0x2f69dd['options'][_0x4e85('0x18')]?_[_0x4e85('0x19')](_0x2f69dd[_0x4e85('0x15')]['include'],function(_0x5a18c7){return{'model':db[_0x5a18c7[_0x4e85('0x1a')]],'as':_0x5a18c7['as'],'attributes':_0x5a18c7[_0x4e85('0x16')],'include':_0x5a18c7[_0x4e85('0x18')]?_[_0x4e85('0x19')](_0x5a18c7[_0x4e85('0x18')],function(_0x519c91){return{'model':db[_0x519c91[_0x4e85('0x1a')]],'as':_0x519c91['as'],'attributes':_0x519c91[_0x4e85('0x16')],'include':_0x519c91['include']?_[_0x4e85('0x19')](_0x519c91[_0x4e85('0x18')],function(_0x17248b){return{'model':db[_0x17248b[_0x4e85('0x1a')]],'as':_0x17248b['as'],'attributes':_0x17248b['attributes']};}):[]};}):[]};}):[]:[]})[_0x4e85('0x1b')](function(_0x32b5f7){logger[_0x4e85('0xa')](_0x4e85('0x13'),_0x2f69dd);logger[_0x4e85('0xc')](_0x4e85('0x13'),_0x2f69dd,JSON[_0x4e85('0xf')](_0x32b5f7));_0x35ef18(_0x32b5f7);})['catch'](function(_0x59374b){logger[_0x4e85('0x10')](_0x4e85('0x13'),_0x59374b[_0x4e85('0x12')],_0x2f69dd);_0x3d6759(_0x392475[_0x4e85('0x10')](0x1f4,_0x59374b['message']));});});};exports[_0x4e85('0x1c')]=function(_0x5af61b){var _0x4c23ce=this;return new Promise(function(_0xf0a1f8,_0x4396d1){return db[_0x4e85('0x14')][_0x4e85('0x1d')]({'raw':_0x5af61b[_0x4e85('0x15')]?_0x5af61b['options'][_0x4e85('0x1e')]===undefined?!![]:![]:!![],'where':_0x5af61b[_0x4e85('0x15')]?_0x5af61b[_0x4e85('0x15')]['where']||null:null,'attributes':_0x5af61b[_0x4e85('0x15')]?_0x5af61b[_0x4e85('0x15')]['attributes']||null:null,'include':_0x5af61b['options']?_0x5af61b[_0x4e85('0x15')][_0x4e85('0x18')]?_[_0x4e85('0x19')](_0x5af61b[_0x4e85('0x15')][_0x4e85('0x18')],function(_0x5ef60c){return{'model':db[_0x5ef60c[_0x4e85('0x1a')]],'as':_0x5ef60c['as'],'attributes':_0x5ef60c[_0x4e85('0x16')],'include':_0x5ef60c[_0x4e85('0x18')]?_[_0x4e85('0x19')](_0x5ef60c[_0x4e85('0x18')],function(_0x457fe3){return{'model':db[_0x457fe3[_0x4e85('0x1a')]],'as':_0x457fe3['as'],'attributes':_0x457fe3[_0x4e85('0x16')],'include':_0x457fe3[_0x4e85('0x18')]?_[_0x4e85('0x19')](_0x457fe3['include'],function(_0x2569a6){return{'model':db[_0x2569a6[_0x4e85('0x1a')]],'as':_0x2569a6['as'],'attributes':_0x2569a6[_0x4e85('0x16')]};}):[]};}):[]};}):[]:[]})[_0x4e85('0x1b')](function(_0x4dfdf4){logger[_0x4e85('0xa')]('ShowDynamics365Account',_0x5af61b);logger[_0x4e85('0xc')](_0x4e85('0x1c'),_0x5af61b,JSON[_0x4e85('0xf')](_0x4dfdf4));_0xf0a1f8(_0x4dfdf4);})[_0x4e85('0x1f')](function(_0x55e9fe){logger[_0x4e85('0x10')]('ShowDynamics365Account',_0x55e9fe[_0x4e85('0x12')],_0x5af61b);_0x4396d1(_0x4c23ce[_0x4e85('0x10')](0x1f4,_0x55e9fe[_0x4e85('0x12')]));});});}; \ No newline at end of file +var _0x64bd=['client','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','map','include','model','attributes','catch','ShowDynamics365Account','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64bd,0x101));var _0xd64b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x64bd[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xd64b('0x0'));var moment=require(_0xd64b('0x1'));var BPromise=require('bluebird');var rs=require(_0xd64b('0x2'));var fs=require('fs');var Redis=require(_0xd64b('0x3'));var db=require(_0xd64b('0x4'))['db'];var utils=require(_0xd64b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd64b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd64b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ea79d,_0x2f864a,_0xeb1b6c){return new BPromise(function(_0x17853a,_0x544760){return client['request'](_0x2ea79d,_0xeb1b6c)[_0xd64b('0x8')](function(_0x30bc3a){logger['info'](_0xd64b('0x9'),_0x2f864a,_0xd64b('0xa'));logger[_0xd64b('0xb')](_0xd64b('0xc'),_0x2f864a,_0xd64b('0xa'),JSON[_0xd64b('0xd')](_0x30bc3a));if(_0x30bc3a[_0xd64b('0xe')]){if(_0x30bc3a[_0xd64b('0xe')][_0xd64b('0xf')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x2f864a,_0x30bc3a[_0xd64b('0xe')]['message']);return _0x544760(_0x30bc3a[_0xd64b('0xe')][_0xd64b('0x10')]);}logger[_0xd64b('0xe')](_0xd64b('0x9'),_0x2f864a,_0x30bc3a[_0xd64b('0xe')][_0xd64b('0x10')]);return _0x17853a(_0x30bc3a['error'][_0xd64b('0x10')]);}else{logger[_0xd64b('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x2f864a,_0xd64b('0xa'));_0x17853a(_0x30bc3a[_0xd64b('0x12')][_0xd64b('0x10')]);}})['catch'](function(_0x1d63d8){logger[_0xd64b('0xe')](_0xd64b('0x9'),_0x2f864a,_0x1d63d8);_0x544760(_0x1d63d8);});});}exports[_0xd64b('0x13')]=function(_0x479f9d){var _0x14bda6=this;return new Promise(function(_0x240c24,_0x38c9b2){return db[_0xd64b('0x14')][_0xd64b('0x15')]({'raw':_0x479f9d['options']?_0x479f9d[_0xd64b('0x16')][_0xd64b('0x17')]===undefined?!![]:![]:!![],'where':_0x479f9d[_0xd64b('0x16')]?_0x479f9d['options'][_0xd64b('0x18')]||null:null,'attributes':_0x479f9d[_0xd64b('0x16')]?_0x479f9d['options']['attributes']||null:null,'limit':_0x479f9d[_0xd64b('0x16')]?_0x479f9d[_0xd64b('0x16')][_0xd64b('0x19')]||null:null,'include':_0x479f9d[_0xd64b('0x16')]?_0x479f9d['options']['include']?_[_0xd64b('0x1a')](_0x479f9d[_0xd64b('0x16')][_0xd64b('0x1b')],function(_0x411ee4){return{'model':db[_0x411ee4[_0xd64b('0x1c')]],'as':_0x411ee4['as'],'attributes':_0x411ee4[_0xd64b('0x1d')],'include':_0x411ee4[_0xd64b('0x1b')]?_['map'](_0x411ee4[_0xd64b('0x1b')],function(_0x44638e){return{'model':db[_0x44638e[_0xd64b('0x1c')]],'as':_0x44638e['as'],'attributes':_0x44638e['attributes'],'include':_0x44638e[_0xd64b('0x1b')]?_['map'](_0x44638e[_0xd64b('0x1b')],function(_0x30eae0){return{'model':db[_0x30eae0[_0xd64b('0x1c')]],'as':_0x30eae0['as'],'attributes':_0x30eae0['attributes']};}):[]};}):[]};}):[]:[]})[_0xd64b('0x8')](function(_0x263620){logger[_0xd64b('0x11')]('GetDynamics365Account',_0x479f9d);logger[_0xd64b('0xb')](_0xd64b('0x13'),_0x479f9d,JSON['stringify'](_0x263620));_0x240c24(_0x263620);})[_0xd64b('0x1e')](function(_0x4160db){logger[_0xd64b('0xe')](_0xd64b('0x13'),_0x4160db['message'],_0x479f9d);_0x38c9b2(_0x14bda6[_0xd64b('0xe')](0x1f4,_0x4160db['message']));});});};exports[_0xd64b('0x1f')]=function(_0x3e9009){var _0x169f9f=this;return new Promise(function(_0x224fe1,_0x12f998){return db[_0xd64b('0x14')][_0xd64b('0x20')]({'raw':_0x3e9009[_0xd64b('0x16')]?_0x3e9009[_0xd64b('0x16')][_0xd64b('0x17')]===undefined?!![]:![]:!![],'where':_0x3e9009[_0xd64b('0x16')]?_0x3e9009[_0xd64b('0x16')]['where']||null:null,'attributes':_0x3e9009[_0xd64b('0x16')]?_0x3e9009[_0xd64b('0x16')][_0xd64b('0x1d')]||null:null,'include':_0x3e9009[_0xd64b('0x16')]?_0x3e9009[_0xd64b('0x16')]['include']?_[_0xd64b('0x1a')](_0x3e9009[_0xd64b('0x16')][_0xd64b('0x1b')],function(_0x4b9f87){return{'model':db[_0x4b9f87[_0xd64b('0x1c')]],'as':_0x4b9f87['as'],'attributes':_0x4b9f87['attributes'],'include':_0x4b9f87[_0xd64b('0x1b')]?_[_0xd64b('0x1a')](_0x4b9f87[_0xd64b('0x1b')],function(_0x3a19cb){return{'model':db[_0x3a19cb[_0xd64b('0x1c')]],'as':_0x3a19cb['as'],'attributes':_0x3a19cb[_0xd64b('0x1d')],'include':_0x3a19cb[_0xd64b('0x1b')]?_[_0xd64b('0x1a')](_0x3a19cb[_0xd64b('0x1b')],function(_0xadefe7){return{'model':db[_0xadefe7[_0xd64b('0x1c')]],'as':_0xadefe7['as'],'attributes':_0xadefe7[_0xd64b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd64b('0x8')](function(_0x4e0aaa){logger[_0xd64b('0x11')]('ShowDynamics365Account',_0x3e9009);logger[_0xd64b('0xb')]('ShowDynamics365Account',_0x3e9009,JSON['stringify'](_0x4e0aaa));_0x224fe1(_0x4e0aaa);})['catch'](function(_0x37617e){logger[_0xd64b('0xe')](_0xd64b('0x1f'),_0x37617e['message'],_0x3e9009);_0x12f998(_0x169f9f[_0xd64b('0xe')](0x1f4,_0x37617e['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 55030a4..1e6f844 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 _0x1177=['exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','put','/:id','update','destroy'];(function(_0xc121f9,_0x21de36){var _0x4fa515=function(_0x4c1e5f){while(--_0x4c1e5f){_0xc121f9['push'](_0xc121f9['shift']());}};_0x4fa515(++_0x21de36);}(_0x1177,0x143));var _0x7117=function(_0x27855,_0x10e1aa){_0x27855=_0x27855-0x0;var _0xfb560=_0x1177[_0x27855];return _0xfb560;};'use strict';var multer=require(_0x7117('0x0'));var util=require('util');var path=require(_0x7117('0x1'));var timeout=require(_0x7117('0x2'));var express=require(_0x7117('0x3'));var router=express['Router']();var fs_extra=require(_0x7117('0x4'));var auth=require(_0x7117('0x5'));var interaction=require(_0x7117('0x6'));var config=require(_0x7117('0x7'));var controller=require(_0x7117('0x8'));router[_0x7117('0x9')]('/',auth[_0x7117('0xa')](),controller[_0x7117('0xb')]);router[_0x7117('0x9')]('/:id',auth[_0x7117('0xa')](),controller[_0x7117('0xc')]);router[_0x7117('0x9')]('/:id/fields',auth[_0x7117('0xa')](),controller[_0x7117('0xd')]);router[_0x7117('0x9')](_0x7117('0xe'),auth['isAuthenticated'](),controller[_0x7117('0xf')]);router[_0x7117('0x9')]('/:id/descriptions',auth[_0x7117('0xa')](),controller[_0x7117('0x10')]);router[_0x7117('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7117('0x12')](_0x7117('0x13'),auth['isAuthenticated'](),controller[_0x7117('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7117('0x15')]);module[_0x7117('0x16')]=router; \ No newline at end of file +var _0xe9d0=['index','/:id','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','./intDynamics365Configuration.controller','get'];(function(_0xf332d4,_0x472fe2){var _0x23dba1=function(_0x4c733e){while(--_0x4c733e){_0xf332d4['push'](_0xf332d4['shift']());}};_0x23dba1(++_0x472fe2);}(_0xe9d0,0x84));var _0x0e9d=function(_0x1783b0,_0x3cc23c){_0x1783b0=_0x1783b0-0x0;var _0xbc205a=_0xe9d0[_0x1783b0];return _0xbc205a;};'use strict';var multer=require(_0x0e9d('0x0'));var util=require('util');var path=require(_0x0e9d('0x1'));var timeout=require(_0x0e9d('0x2'));var express=require(_0x0e9d('0x3'));var router=express[_0x0e9d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0e9d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0e9d('0x6'));router[_0x0e9d('0x7')]('/',auth['isAuthenticated'](),controller[_0x0e9d('0x8')]);router[_0x0e9d('0x7')](_0x0e9d('0x9'),auth[_0x0e9d('0xa')](),controller['show']);router[_0x0e9d('0x7')]('/:id/fields',auth[_0x0e9d('0xa')](),controller[_0x0e9d('0xb')]);router[_0x0e9d('0x7')](_0x0e9d('0xc'),auth[_0x0e9d('0xa')](),controller[_0x0e9d('0xd')]);router[_0x0e9d('0x7')](_0x0e9d('0xe'),auth['isAuthenticated'](),controller[_0x0e9d('0xf')]);router[_0x0e9d('0x10')]('/',auth[_0x0e9d('0xa')](),controller['create']);router[_0x0e9d('0x11')](_0x0e9d('0x9'),auth['isAuthenticated'](),controller[_0x0e9d('0x12')]);router['delete']('/:id',auth[_0x0e9d('0xa')](),controller[_0x0e9d('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 29d79a6..2b52311 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 _0x83dd=['incident','phonecall','nothing','contact','BOOLEAN','sequelize','exports','STRING','ENUM'];(function(_0x3cec8c,_0x3f6c1d){var _0x38032e=function(_0x4ef75b){while(--_0x4ef75b){_0x3cec8c['push'](_0x3cec8c['shift']());}};_0x38032e(++_0x3f6c1d);}(_0x83dd,0x188));var _0xd83d=function(_0x41564a,_0x3178fe){_0x41564a=_0x41564a-0x0;var _0x756bbb=_0x83dd[_0x41564a];return _0x756bbb;};'use strict';var Sequelize=require(_0xd83d('0x0'));module[_0xd83d('0x1')]={'name':{'type':Sequelize[_0xd83d('0x2')]},'description':{'type':Sequelize[_0xd83d('0x2')]},'ticketType':{'type':Sequelize[_0xd83d('0x3')](_0xd83d('0x4'),_0xd83d('0x5')),'defaultValue':_0xd83d('0x4')},'moduleCreate':{'type':Sequelize[_0xd83d('0x3')]('contact',_0xd83d('0x6')),'defaultValue':_0xd83d('0x7'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xd83d('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xd83d('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd3aa=['nothing','BOOLEAN','sequelize','exports','STRING','ENUM','phonecall','incident','contact'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0xd3aa,0x14f));var _0xad3a=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0xd3aa[_0x152121];return _0x592a85;};'use strict';var Sequelize=require(_0xad3a('0x0'));module[_0xad3a('0x1')]={'name':{'type':Sequelize[_0xad3a('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xad3a('0x3')]('incident',_0xad3a('0x4')),'defaultValue':_0xad3a('0x5')},'moduleCreate':{'type':Sequelize[_0xad3a('0x3')](_0xad3a('0x6'),_0xad3a('0x7')),'defaultValue':_0xad3a('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xad3a('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xad3a('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index d5ff887..6334fd5 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 _0x55a4=['where','pick','filter','merge','type','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','update','body','getFields','findOne','Dynamics365Field','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','send','index','fieldName','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x187718,_0x427383){var _0x29ddf4=function(_0x2ec62a){while(--_0x2ec62a){_0x187718['push'](_0x187718['shift']());}};_0x29ddf4(++_0x427383);}(_0x55a4,0x68));var _0x455a=function(_0x5505de,_0x12977f){_0x5505de=_0x5505de-0x0;var _0xe6093b=_0x55a4[_0x5505de];return _0xe6093b;};'use strict';var emlformat=require(_0x455a('0x0'));var rimraf=require(_0x455a('0x1'));var zipdir=require(_0x455a('0x2'));var jsonpatch=require(_0x455a('0x3'));var rp=require(_0x455a('0x4'));var moment=require(_0x455a('0x5'));var BPromise=require(_0x455a('0x6'));var Mustache=require(_0x455a('0x7'));var util=require(_0x455a('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x455a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x455a('0xa'));var squel=require(_0x455a('0xb'));var crypto=require(_0x455a('0xc'));var jsforce=require(_0x455a('0xd'));var deskjs=require(_0x455a('0xe'));var toCsv=require(_0x455a('0x9'));var querystring=require(_0x455a('0xf'));var Papa=require(_0x455a('0x10'));var Redis=require('ioredis');var authService=require(_0x455a('0x11'));var qs=require(_0x455a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x455a('0x13'));var logger=require(_0x455a('0x14'))(_0x455a('0x15'));var utils=require(_0x455a('0x16'));var config=require(_0x455a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x455a('0x18'))['db'];function respondWithStatusCode(_0x333633,_0x27d779){_0x27d779=_0x27d779||0xcc;return function(_0x2e23a9){if(_0x2e23a9){return _0x333633['sendStatus'](_0x27d779);}return _0x333633[_0x455a('0x19')](_0x27d779)[_0x455a('0x1a')]();};}function respondWithResult(_0x35b6ff,_0x2e3cf0){_0x2e3cf0=_0x2e3cf0||0xc8;return function(_0x345af4){if(_0x345af4){return _0x35b6ff[_0x455a('0x19')](_0x2e3cf0)['json'](_0x345af4);}};}function respondWithFilteredResult(_0x1d6229,_0xf49e83){return function(_0x3f380d){if(_0x3f380d){var _0x3e0320=typeof _0xf49e83[_0x455a('0x1b')]===_0x455a('0x1c')&&typeof _0xf49e83[_0x455a('0x1d')]==='undefined';var _0x1c3552=_0x3f380d[_0x455a('0x1e')];var _0x4a8b70=_0x3e0320?0x0:_0xf49e83[_0x455a('0x1b')];var _0x4a7a47=_0x3e0320?_0x3f380d[_0x455a('0x1e')]:_0xf49e83[_0x455a('0x1b')]+_0xf49e83['limit'];var _0x26a675;if(_0x4a7a47>=_0x1c3552){_0x4a7a47=_0x1c3552;_0x26a675=0xc8;}else{_0x26a675=0xce;}_0x1d6229['status'](_0x26a675);return _0x1d6229[_0x455a('0x1f')](_0x455a('0x20'),_0x4a8b70+'-'+_0x4a7a47+'/'+_0x1c3552)['json'](_0x3f380d);}return null;};}function patchUpdates(_0x3b4ff8){return function(_0x1dffd5){try{jsonpatch[_0x455a('0x21')](_0x1dffd5,_0x3b4ff8,!![]);}catch(_0x5a863b){return BPromise[_0x455a('0x22')](_0x5a863b);}return _0x1dffd5['save']();};}function saveUpdates(_0x5998ee,_0x4a9bd1){return function(_0x1ffb08){if(_0x1ffb08){return _0x1ffb08['update'](_0x5998ee)[_0x455a('0x23')](function(_0x275836){return _0x275836;});}return null;};}function removeEntity(_0x85b11c,_0x12f293){return function(_0x3f641a){if(_0x3f641a){return _0x3f641a[_0x455a('0x24')]()['then'](function(){_0x85b11c[_0x455a('0x19')](0xcc)[_0x455a('0x1a')]();});}};}function handleEntityNotFound(_0x1543eb,_0x19345f){return function(_0x3a8f85){if(!_0x3a8f85){_0x1543eb['sendStatus'](0x194);}return _0x3a8f85;};}function handleError(_0x36b37d,_0x4f715d){_0x4f715d=_0x4f715d||0x1f4;return function(_0x2c428a){logger[_0x455a('0x25')](_0x2c428a['stack']);if(_0x2c428a[_0x455a('0x26')]){delete _0x2c428a[_0x455a('0x26')];}_0x36b37d[_0x455a('0x19')](_0x4f715d)[_0x455a('0x27')](_0x2c428a);};}exports[_0x455a('0x28')]=function(_0x4ff3c4,_0xeabf65){var _0x457a77={},_0x44a49f={},_0x3f9130={'count':0x0,'rows':[]};var _0x58ca4b=_['map'](db['Dynamics365Configuration']['rawAttributes'],function(_0x21d91a){return{'name':_0x21d91a[_0x455a('0x29')],'type':_0x21d91a['type']['key']};});_0x44a49f[_0x455a('0x2a')]=_[_0x455a('0x2b')](_0x58ca4b,_0x455a('0x26'));_0x44a49f[_0x455a('0x2c')]=_[_0x455a('0x2d')](_0x4ff3c4[_0x455a('0x2c')]);_0x44a49f[_0x455a('0x2e')]=_['intersection'](_0x44a49f['model'],_0x44a49f[_0x455a('0x2c')]);_0x457a77[_0x455a('0x2f')]=_[_0x455a('0x30')](_0x44a49f[_0x455a('0x2a')],qs['fields'](_0x4ff3c4[_0x455a('0x2c')][_0x455a('0x31')]));_0x457a77[_0x455a('0x2f')]=_0x457a77[_0x455a('0x2f')][_0x455a('0x32')]?_0x457a77[_0x455a('0x2f')]:_0x44a49f[_0x455a('0x2a')];if(!_0x4ff3c4[_0x455a('0x2c')]['hasOwnProperty'](_0x455a('0x33'))){_0x457a77[_0x455a('0x1d')]=qs[_0x455a('0x1d')](_0x4ff3c4[_0x455a('0x2c')][_0x455a('0x1d')]);_0x457a77[_0x455a('0x1b')]=qs['offset'](_0x4ff3c4[_0x455a('0x2c')][_0x455a('0x1b')]);}_0x457a77[_0x455a('0x34')]=qs['sort'](_0x4ff3c4[_0x455a('0x2c')][_0x455a('0x35')]);_0x457a77[_0x455a('0x36')]=qs[_0x455a('0x2e')](_[_0x455a('0x37')](_0x4ff3c4[_0x455a('0x2c')],_0x44a49f[_0x455a('0x2e')]),_0x58ca4b);if(_0x4ff3c4[_0x455a('0x2c')][_0x455a('0x38')]){_0x457a77[_0x455a('0x36')]=_[_0x455a('0x39')](_0x457a77[_0x455a('0x36')],{'$or':_[_0x455a('0x2b')](_0x58ca4b,function(_0x1e99b0){if(_0x1e99b0[_0x455a('0x3a')]!==_0x455a('0x3b')){var _0x2008fd={};_0x2008fd[_0x1e99b0['name']]={'$like':'%'+_0x4ff3c4[_0x455a('0x2c')][_0x455a('0x38')]+'%'};return _0x2008fd;}})});}_0x457a77=_['merge']({},_0x457a77,_0x4ff3c4[_0x455a('0x3c')]);var _0x2220fa={'where':_0x457a77['where']};return db[_0x455a('0x3d')][_0x455a('0x1e')](_0x2220fa)['then'](function(_0x4ccc62){_0x3f9130['count']=_0x4ccc62;if(_0x4ff3c4[_0x455a('0x2c')][_0x455a('0x3e')]){_0x457a77[_0x455a('0x3f')]=[{'all':!![]}];}return db[_0x455a('0x3d')][_0x455a('0x40')](_0x457a77);})['then'](function(_0x2436c5){_0x3f9130[_0x455a('0x41')]=_0x2436c5;return _0x3f9130;})[_0x455a('0x23')](respondWithFilteredResult(_0xeabf65,_0x457a77))[_0x455a('0x42')](handleError(_0xeabf65,null));};exports['show']=function(_0x213600,_0x44a71a){var _0x21197d={'raw':![],'where':{'id':_0x213600[_0x455a('0x43')]['id']}},_0x1eeb60={};_0x1eeb60[_0x455a('0x2a')]=_['keys'](db[_0x455a('0x3d')][_0x455a('0x44')]);_0x1eeb60[_0x455a('0x2c')]=_[_0x455a('0x2d')](_0x213600['query']);_0x1eeb60[_0x455a('0x2e')]=_[_0x455a('0x30')](_0x1eeb60[_0x455a('0x2a')],_0x1eeb60['query']);_0x21197d['attributes']=_[_0x455a('0x30')](_0x1eeb60[_0x455a('0x2a')],qs[_0x455a('0x31')](_0x213600[_0x455a('0x2c')]['fields']));_0x21197d[_0x455a('0x2f')]=_0x21197d['attributes'][_0x455a('0x32')]?_0x21197d[_0x455a('0x2f')]:_0x1eeb60[_0x455a('0x2a')];if(_0x213600[_0x455a('0x2c')]['includeAll']){_0x21197d[_0x455a('0x3f')]=[{'all':!![]}];}_0x21197d=_[_0x455a('0x39')]({},_0x21197d,_0x213600[_0x455a('0x3c')]);return db[_0x455a('0x3d')][_0x455a('0x45')](_0x21197d)[_0x455a('0x23')](handleEntityNotFound(_0x44a71a,null))['then'](respondWithResult(_0x44a71a,null))[_0x455a('0x42')](handleError(_0x44a71a,null));};exports[_0x455a('0x46')]=function(_0x3f1621,_0x103aa5){return db['Dynamics365Configuration'][_0x455a('0x46')](_0x3f1621['body'],{})[_0x455a('0x23')](respondWithResult(_0x103aa5,0xc9))[_0x455a('0x42')](handleError(_0x103aa5,null));};exports[_0x455a('0x47')]=function(_0x1f856a,_0x50a241){if(_0x1f856a[_0x455a('0x48')]['id']){delete _0x1f856a[_0x455a('0x48')]['id'];}return db[_0x455a('0x3d')][_0x455a('0x45')]({'where':{'id':_0x1f856a[_0x455a('0x43')]['id']}})[_0x455a('0x23')](handleEntityNotFound(_0x50a241,null))[_0x455a('0x23')](saveUpdates(_0x1f856a[_0x455a('0x48')],null))[_0x455a('0x23')](respondWithResult(_0x50a241,null))[_0x455a('0x42')](handleError(_0x50a241,null));};exports[_0x455a('0x24')]=function(_0x31e958,_0x39217f){return db[_0x455a('0x3d')][_0x455a('0x45')]({'where':{'id':_0x31e958['params']['id']}})[_0x455a('0x23')](handleEntityNotFound(_0x39217f,null))[_0x455a('0x23')](removeEntity(_0x39217f,null))[_0x455a('0x42')](handleError(_0x39217f,null));};exports[_0x455a('0x49')]=function(_0x186879,_0x4b3229,_0x2c78b7){var _0x3e0178={};var _0x518008={};var _0x506ed6;var _0xe16e69;return db[_0x455a('0x3d')][_0x455a('0x4a')]({'where':{'id':_0x186879['params']['id']}})[_0x455a('0x23')](handleEntityNotFound(_0x4b3229,null))[_0x455a('0x23')](function(_0x2d43a4){if(_0x2d43a4){_0x506ed6=_0x2d43a4;_0x518008[_0x455a('0x2a')]=_[_0x455a('0x2d')](db[_0x455a('0x4b')][_0x455a('0x44')]);_0x518008['query']=_[_0x455a('0x2d')](_0x186879[_0x455a('0x2c')]);_0x518008[_0x455a('0x2e')]=_[_0x455a('0x30')](_0x518008[_0x455a('0x2a')],_0x518008[_0x455a('0x2c')]);_0x3e0178['attributes']=_[_0x455a('0x30')](_0x518008['model'],qs[_0x455a('0x31')](_0x186879[_0x455a('0x2c')][_0x455a('0x31')]));_0x3e0178['attributes']=_0x3e0178[_0x455a('0x2f')][_0x455a('0x32')]?_0x3e0178[_0x455a('0x2f')]:_0x518008['model'];_0x3e0178[_0x455a('0x34')]=qs[_0x455a('0x35')](_0x186879[_0x455a('0x2c')]['sort']);_0x3e0178['where']=qs['filters'](_[_0x455a('0x37')](_0x186879[_0x455a('0x2c')],_0x518008[_0x455a('0x2e')]));if(_0x186879[_0x455a('0x2c')][_0x455a('0x38')]){_0x3e0178['where']=_['merge'](_0x3e0178[_0x455a('0x36')],{'$or':_['map'](_0x3e0178['attributes'],function(_0x17456d){var _0x107b4b={};_0x107b4b[_0x17456d]={'$like':'%'+_0x186879[_0x455a('0x2c')][_0x455a('0x38')]+'%'};return _0x107b4b;})});}_0x3e0178=_[_0x455a('0x39')]({},_0x3e0178,_0x186879[_0x455a('0x3c')]);return _0x506ed6['getFields'](_0x3e0178);}})[_0x455a('0x23')](function(_0x5a6979){if(_0x5a6979){_0xe16e69=_0x5a6979['length'];if(!_0x186879[_0x455a('0x2c')][_0x455a('0x4c')](_0x455a('0x33'))){_0x3e0178[_0x455a('0x1d')]=qs[_0x455a('0x1d')](_0x186879[_0x455a('0x2c')]['limit']);_0x3e0178[_0x455a('0x1b')]=qs[_0x455a('0x1b')](_0x186879['query']['offset']);}return _0x506ed6[_0x455a('0x49')](_0x3e0178);}})[_0x455a('0x23')](function(_0x13e753){if(_0x13e753){return _0x13e753?{'count':_0xe16e69,'rows':_0x13e753}:null;}})[_0x455a('0x23')](respondWithResult(_0x4b3229,null))[_0x455a('0x42')](handleError(_0x4b3229,null));};exports[_0x455a('0x4d')]=function(_0x5ebce1,_0x2bc756,_0x175dc2){var _0x224e3f={};var _0x138622={};var _0x26f9d9;var _0x9693ce;return db[_0x455a('0x3d')][_0x455a('0x4a')]({'where':{'id':_0x5ebce1['params']['id']}})[_0x455a('0x23')](handleEntityNotFound(_0x2bc756,null))[_0x455a('0x23')](function(_0x2b4690){if(_0x2b4690){_0x26f9d9=_0x2b4690;_0x138622[_0x455a('0x2a')]=_[_0x455a('0x2d')](db['Dynamics365Field'][_0x455a('0x44')]);_0x138622[_0x455a('0x2c')]=_[_0x455a('0x2d')](_0x5ebce1[_0x455a('0x2c')]);_0x138622[_0x455a('0x2e')]=_[_0x455a('0x30')](_0x138622[_0x455a('0x2a')],_0x138622[_0x455a('0x2c')]);_0x224e3f[_0x455a('0x2f')]=_[_0x455a('0x30')](_0x138622['model'],qs[_0x455a('0x31')](_0x5ebce1[_0x455a('0x2c')]['fields']));_0x224e3f[_0x455a('0x2f')]=_0x224e3f[_0x455a('0x2f')][_0x455a('0x32')]?_0x224e3f['attributes']:_0x138622[_0x455a('0x2a')];_0x224e3f[_0x455a('0x34')]=qs[_0x455a('0x35')](_0x5ebce1[_0x455a('0x2c')][_0x455a('0x35')]);_0x224e3f[_0x455a('0x36')]=qs[_0x455a('0x2e')](_[_0x455a('0x37')](_0x5ebce1[_0x455a('0x2c')],_0x138622['filters']));if(_0x5ebce1['query'][_0x455a('0x38')]){_0x224e3f[_0x455a('0x36')]=_[_0x455a('0x39')](_0x224e3f[_0x455a('0x36')],{'$or':_[_0x455a('0x2b')](_0x224e3f['attributes'],function(_0x2314b4){var _0x43798d={};_0x43798d[_0x2314b4]={'$like':'%'+_0x5ebce1[_0x455a('0x2c')]['filter']+'%'};return _0x43798d;})});}_0x224e3f=_[_0x455a('0x39')]({},_0x224e3f,_0x5ebce1[_0x455a('0x3c')]);return _0x26f9d9[_0x455a('0x4d')](_0x224e3f);}})[_0x455a('0x23')](function(_0x403442){if(_0x403442){_0x9693ce=_0x403442[_0x455a('0x32')];if(!_0x5ebce1[_0x455a('0x2c')][_0x455a('0x4c')]('nolimit')){_0x224e3f[_0x455a('0x1d')]=qs['limit'](_0x5ebce1['query'][_0x455a('0x1d')]);_0x224e3f[_0x455a('0x1b')]=qs[_0x455a('0x1b')](_0x5ebce1[_0x455a('0x2c')][_0x455a('0x1b')]);}return _0x26f9d9[_0x455a('0x4d')](_0x224e3f);}})[_0x455a('0x23')](function(_0x6f85db){if(_0x6f85db){return _0x6f85db?{'count':_0x9693ce,'rows':_0x6f85db}:null;}})[_0x455a('0x23')](respondWithResult(_0x2bc756,null))[_0x455a('0x42')](handleError(_0x2bc756,null));};exports[_0x455a('0x4e')]=function(_0x6fa670,_0x1e009b,_0x1edd29){var _0x44c1ae={};var _0x3d73a7={};var _0x27d3d0;var _0x246a2a;return db['Dynamics365Configuration'][_0x455a('0x4a')]({'where':{'id':_0x6fa670[_0x455a('0x43')]['id']}})[_0x455a('0x23')](handleEntityNotFound(_0x1e009b,null))[_0x455a('0x23')](function(_0x408864){if(_0x408864){_0x27d3d0=_0x408864;_0x3d73a7[_0x455a('0x2a')]=_[_0x455a('0x2d')](db['Dynamics365Field'][_0x455a('0x44')]);_0x3d73a7[_0x455a('0x2c')]=_[_0x455a('0x2d')](_0x6fa670[_0x455a('0x2c')]);_0x3d73a7[_0x455a('0x2e')]=_[_0x455a('0x30')](_0x3d73a7['model'],_0x3d73a7['query']);_0x44c1ae[_0x455a('0x2f')]=_[_0x455a('0x30')](_0x3d73a7[_0x455a('0x2a')],qs['fields'](_0x6fa670['query'][_0x455a('0x31')]));_0x44c1ae['attributes']=_0x44c1ae[_0x455a('0x2f')][_0x455a('0x32')]?_0x44c1ae[_0x455a('0x2f')]:_0x3d73a7[_0x455a('0x2a')];_0x44c1ae[_0x455a('0x34')]=qs['sort'](_0x6fa670[_0x455a('0x2c')][_0x455a('0x35')]);_0x44c1ae[_0x455a('0x36')]=qs['filters'](_[_0x455a('0x37')](_0x6fa670[_0x455a('0x2c')],_0x3d73a7[_0x455a('0x2e')]));if(_0x6fa670[_0x455a('0x2c')][_0x455a('0x38')]){_0x44c1ae['where']=_['merge'](_0x44c1ae[_0x455a('0x36')],{'$or':_['map'](_0x44c1ae[_0x455a('0x2f')],function(_0x5960f0){var _0x3f2e5b={};_0x3f2e5b[_0x5960f0]={'$like':'%'+_0x6fa670[_0x455a('0x2c')]['filter']+'%'};return _0x3f2e5b;})});}_0x44c1ae=_[_0x455a('0x39')]({},_0x44c1ae,_0x6fa670[_0x455a('0x3c')]);return _0x27d3d0[_0x455a('0x4e')](_0x44c1ae);}})['then'](function(_0x5dd127){if(_0x5dd127){_0x246a2a=_0x5dd127[_0x455a('0x32')];if(!_0x6fa670['query']['hasOwnProperty']('nolimit')){_0x44c1ae[_0x455a('0x1d')]=qs['limit'](_0x6fa670[_0x455a('0x2c')][_0x455a('0x1d')]);_0x44c1ae[_0x455a('0x1b')]=qs[_0x455a('0x1b')](_0x6fa670[_0x455a('0x2c')][_0x455a('0x1b')]);}return _0x27d3d0[_0x455a('0x4e')](_0x44c1ae);}})['then'](function(_0x4844ea){if(_0x4844ea){return _0x4844ea?{'count':_0x246a2a,'rows':_0x4844ea}:null;}})[_0x455a('0x23')](respondWithResult(_0x1e009b,null))[_0x455a('0x42')](handleError(_0x1e009b,null));}; \ No newline at end of file +var _0x2233=['then','destroy','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','rows','catch','show','params','includeAll','options','find','create','body','findOne','Dynamics365Field','getFields','getSubjects','order','getDescriptions','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','update'];(function(_0x379a5c,_0x49523e){var _0x657fd2=function(_0x4e1a2f){while(--_0x4e1a2f){_0x379a5c['push'](_0x379a5c['shift']());}};_0x657fd2(++_0x49523e);}(_0x2233,0x1ec));var _0x3223=function(_0x1d997f,_0x259b5a){_0x1d997f=_0x1d997f-0x0;var _0x307704=_0x2233[_0x1d997f];return _0x307704;};'use strict';var emlformat=require(_0x3223('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3223('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3223('0x2'));var moment=require('moment');var BPromise=require(_0x3223('0x3'));var Mustache=require(_0x3223('0x4'));var util=require(_0x3223('0x5'));var path=require(_0x3223('0x6'));var sox=require(_0x3223('0x7'));var csv=require(_0x3223('0x8'));var ejs=require(_0x3223('0x9'));var fs=require('fs');var fs_extra=require(_0x3223('0xa'));var _=require(_0x3223('0xb'));var squel=require(_0x3223('0xc'));var crypto=require('crypto');var jsforce=require(_0x3223('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3223('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3223('0xe'));var qs=require(_0x3223('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3223('0x10'));var logger=require('../../config/logger')(_0x3223('0x11'));var utils=require(_0x3223('0x12'));var config=require(_0x3223('0x13'));var licenseUtil=require(_0x3223('0x14'));var db=require(_0x3223('0x15'))['db'];function respondWithStatusCode(_0x164576,_0x47b8de){_0x47b8de=_0x47b8de||0xcc;return function(_0x4ccc46){if(_0x4ccc46){return _0x164576[_0x3223('0x16')](_0x47b8de);}return _0x164576['status'](_0x47b8de)[_0x3223('0x17')]();};}function respondWithResult(_0x1cffc1,_0x554fd2){_0x554fd2=_0x554fd2||0xc8;return function(_0x35cad8){if(_0x35cad8){return _0x1cffc1[_0x3223('0x18')](_0x554fd2)[_0x3223('0x19')](_0x35cad8);}};}function respondWithFilteredResult(_0x2308bf,_0x22cd9f){return function(_0x37b321){if(_0x37b321){var _0x3538ef=typeof _0x22cd9f[_0x3223('0x1a')]===_0x3223('0x1b')&&typeof _0x22cd9f[_0x3223('0x1c')]===_0x3223('0x1b');var _0x13d77e=_0x37b321[_0x3223('0x1d')];var _0x5a53e8=_0x3538ef?0x0:_0x22cd9f[_0x3223('0x1a')];var _0x1afd84=_0x3538ef?_0x37b321[_0x3223('0x1d')]:_0x22cd9f['offset']+_0x22cd9f[_0x3223('0x1c')];var _0x1dd7e1;if(_0x1afd84>=_0x13d77e){_0x1afd84=_0x13d77e;_0x1dd7e1=0xc8;}else{_0x1dd7e1=0xce;}_0x2308bf[_0x3223('0x18')](_0x1dd7e1);return _0x2308bf[_0x3223('0x1e')]('Content-Range',_0x5a53e8+'-'+_0x1afd84+'/'+_0x13d77e)[_0x3223('0x19')](_0x37b321);}return null;};}function patchUpdates(_0x2dc754){return function(_0x38c579){try{jsonpatch[_0x3223('0x1f')](_0x38c579,_0x2dc754,!![]);}catch(_0xad47c1){return BPromise['reject'](_0xad47c1);}return _0x38c579['save']();};}function saveUpdates(_0x395bec,_0x824075){return function(_0x11c8da){if(_0x11c8da){return _0x11c8da[_0x3223('0x20')](_0x395bec)[_0x3223('0x21')](function(_0x19c17f){return _0x19c17f;});}return null;};}function removeEntity(_0x50b44e,_0x7024e9){return function(_0x4f7e30){if(_0x4f7e30){return _0x4f7e30[_0x3223('0x22')]()[_0x3223('0x21')](function(){_0x50b44e[_0x3223('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x395dfb,_0x3ccd28){return function(_0x50b873){if(!_0x50b873){_0x395dfb['sendStatus'](0x194);}return _0x50b873;};}function handleError(_0x419ca6,_0x4b6c14){_0x4b6c14=_0x4b6c14||0x1f4;return function(_0x3290c0){logger[_0x3223('0x23')](_0x3290c0[_0x3223('0x24')]);if(_0x3290c0[_0x3223('0x25')]){delete _0x3290c0[_0x3223('0x25')];}_0x419ca6['status'](_0x4b6c14)[_0x3223('0x26')](_0x3290c0);};}exports['index']=function(_0x79ff22,_0x5a0bd8){var _0x269ea2={},_0x814614={},_0x5452fd={'count':0x0,'rows':[]};var _0xc0d2c0=_[_0x3223('0x27')](db[_0x3223('0x28')][_0x3223('0x29')],function(_0xc71bd9){return{'name':_0xc71bd9[_0x3223('0x2a')],'type':_0xc71bd9['type'][_0x3223('0x2b')]};});_0x814614[_0x3223('0x2c')]=_[_0x3223('0x27')](_0xc0d2c0,'name');_0x814614[_0x3223('0x2d')]=_[_0x3223('0x2e')](_0x79ff22[_0x3223('0x2d')]);_0x814614[_0x3223('0x2f')]=_[_0x3223('0x30')](_0x814614[_0x3223('0x2c')],_0x814614[_0x3223('0x2d')]);_0x269ea2['attributes']=_[_0x3223('0x30')](_0x814614[_0x3223('0x2c')],qs[_0x3223('0x31')](_0x79ff22[_0x3223('0x2d')][_0x3223('0x31')]));_0x269ea2[_0x3223('0x32')]=_0x269ea2[_0x3223('0x32')][_0x3223('0x33')]?_0x269ea2[_0x3223('0x32')]:_0x814614['model'];if(!_0x79ff22[_0x3223('0x2d')][_0x3223('0x34')](_0x3223('0x35'))){_0x269ea2[_0x3223('0x1c')]=qs[_0x3223('0x1c')](_0x79ff22['query'][_0x3223('0x1c')]);_0x269ea2[_0x3223('0x1a')]=qs[_0x3223('0x1a')](_0x79ff22[_0x3223('0x2d')][_0x3223('0x1a')]);}_0x269ea2['order']=qs[_0x3223('0x36')](_0x79ff22['query']['sort']);_0x269ea2[_0x3223('0x37')]=qs[_0x3223('0x2f')](_[_0x3223('0x38')](_0x79ff22[_0x3223('0x2d')],_0x814614[_0x3223('0x2f')]),_0xc0d2c0);if(_0x79ff22[_0x3223('0x2d')][_0x3223('0x39')]){_0x269ea2[_0x3223('0x37')]=_[_0x3223('0x3a')](_0x269ea2[_0x3223('0x37')],{'$or':_[_0x3223('0x27')](_0xc0d2c0,function(_0x2384e1){if(_0x2384e1[_0x3223('0x3b')]!=='VIRTUAL'){var _0x2c9220={};_0x2c9220[_0x2384e1['name']]={'$like':'%'+_0x79ff22[_0x3223('0x2d')][_0x3223('0x39')]+'%'};return _0x2c9220;}})});}_0x269ea2=_[_0x3223('0x3a')]({},_0x269ea2,_0x79ff22['options']);var _0x755402={'where':_0x269ea2[_0x3223('0x37')]};return db[_0x3223('0x28')][_0x3223('0x1d')](_0x755402)['then'](function(_0x579665){_0x5452fd[_0x3223('0x1d')]=_0x579665;if(_0x79ff22['query']['includeAll']){_0x269ea2['include']=[{'all':!![]}];}return db[_0x3223('0x28')]['findAll'](_0x269ea2);})[_0x3223('0x21')](function(_0x2a06ea){_0x5452fd[_0x3223('0x3c')]=_0x2a06ea;return _0x5452fd;})[_0x3223('0x21')](respondWithFilteredResult(_0x5a0bd8,_0x269ea2))[_0x3223('0x3d')](handleError(_0x5a0bd8,null));};exports[_0x3223('0x3e')]=function(_0x20c279,_0x4ffbfb){var _0x150356={'raw':![],'where':{'id':_0x20c279[_0x3223('0x3f')]['id']}},_0x12e44c={};_0x12e44c[_0x3223('0x2c')]=_[_0x3223('0x2e')](db[_0x3223('0x28')]['rawAttributes']);_0x12e44c['query']=_[_0x3223('0x2e')](_0x20c279['query']);_0x12e44c['filters']=_['intersection'](_0x12e44c[_0x3223('0x2c')],_0x12e44c[_0x3223('0x2d')]);_0x150356[_0x3223('0x32')]=_[_0x3223('0x30')](_0x12e44c['model'],qs['fields'](_0x20c279[_0x3223('0x2d')][_0x3223('0x31')]));_0x150356[_0x3223('0x32')]=_0x150356[_0x3223('0x32')][_0x3223('0x33')]?_0x150356['attributes']:_0x12e44c['model'];if(_0x20c279[_0x3223('0x2d')][_0x3223('0x40')]){_0x150356['include']=[{'all':!![]}];}_0x150356=_[_0x3223('0x3a')]({},_0x150356,_0x20c279[_0x3223('0x41')]);return db['Dynamics365Configuration'][_0x3223('0x42')](_0x150356)['then'](handleEntityNotFound(_0x4ffbfb,null))[_0x3223('0x21')](respondWithResult(_0x4ffbfb,null))['catch'](handleError(_0x4ffbfb,null));};exports['create']=function(_0x5178d5,_0x33dc19){return db[_0x3223('0x28')][_0x3223('0x43')](_0x5178d5['body'],{})[_0x3223('0x21')](respondWithResult(_0x33dc19,0xc9))['catch'](handleError(_0x33dc19,null));};exports[_0x3223('0x20')]=function(_0x51f9d1,_0x250e16){if(_0x51f9d1[_0x3223('0x44')]['id']){delete _0x51f9d1[_0x3223('0x44')]['id'];}return db[_0x3223('0x28')]['find']({'where':{'id':_0x51f9d1['params']['id']}})[_0x3223('0x21')](handleEntityNotFound(_0x250e16,null))[_0x3223('0x21')](saveUpdates(_0x51f9d1[_0x3223('0x44')],null))['then'](respondWithResult(_0x250e16,null))[_0x3223('0x3d')](handleError(_0x250e16,null));};exports['destroy']=function(_0x47cf43,_0x4fa821){return db[_0x3223('0x28')][_0x3223('0x42')]({'where':{'id':_0x47cf43['params']['id']}})[_0x3223('0x21')](handleEntityNotFound(_0x4fa821,null))[_0x3223('0x21')](removeEntity(_0x4fa821,null))['catch'](handleError(_0x4fa821,null));};exports['getFields']=function(_0x1ad1e3,_0x15ec4a,_0x2c850b){var _0x4522ff={};var _0x1cfce5={};var _0x35b1ee;var _0x14167d;return db[_0x3223('0x28')][_0x3223('0x45')]({'where':{'id':_0x1ad1e3[_0x3223('0x3f')]['id']}})[_0x3223('0x21')](handleEntityNotFound(_0x15ec4a,null))[_0x3223('0x21')](function(_0x42b522){if(_0x42b522){_0x35b1ee=_0x42b522;_0x1cfce5[_0x3223('0x2c')]=_[_0x3223('0x2e')](db[_0x3223('0x46')][_0x3223('0x29')]);_0x1cfce5[_0x3223('0x2d')]=_[_0x3223('0x2e')](_0x1ad1e3['query']);_0x1cfce5[_0x3223('0x2f')]=_[_0x3223('0x30')](_0x1cfce5[_0x3223('0x2c')],_0x1cfce5[_0x3223('0x2d')]);_0x4522ff['attributes']=_[_0x3223('0x30')](_0x1cfce5['model'],qs[_0x3223('0x31')](_0x1ad1e3[_0x3223('0x2d')][_0x3223('0x31')]));_0x4522ff['attributes']=_0x4522ff[_0x3223('0x32')][_0x3223('0x33')]?_0x4522ff[_0x3223('0x32')]:_0x1cfce5[_0x3223('0x2c')];_0x4522ff['order']=qs[_0x3223('0x36')](_0x1ad1e3[_0x3223('0x2d')][_0x3223('0x36')]);_0x4522ff[_0x3223('0x37')]=qs[_0x3223('0x2f')](_[_0x3223('0x38')](_0x1ad1e3['query'],_0x1cfce5['filters']));if(_0x1ad1e3[_0x3223('0x2d')][_0x3223('0x39')]){_0x4522ff[_0x3223('0x37')]=_[_0x3223('0x3a')](_0x4522ff[_0x3223('0x37')],{'$or':_[_0x3223('0x27')](_0x4522ff['attributes'],function(_0x3d98f6){var _0x4f06b4={};_0x4f06b4[_0x3d98f6]={'$like':'%'+_0x1ad1e3[_0x3223('0x2d')][_0x3223('0x39')]+'%'};return _0x4f06b4;})});}_0x4522ff=_[_0x3223('0x3a')]({},_0x4522ff,_0x1ad1e3[_0x3223('0x41')]);return _0x35b1ee[_0x3223('0x47')](_0x4522ff);}})['then'](function(_0xea676){if(_0xea676){_0x14167d=_0xea676[_0x3223('0x33')];if(!_0x1ad1e3['query'][_0x3223('0x34')]('nolimit')){_0x4522ff[_0x3223('0x1c')]=qs[_0x3223('0x1c')](_0x1ad1e3['query'][_0x3223('0x1c')]);_0x4522ff[_0x3223('0x1a')]=qs['offset'](_0x1ad1e3['query'][_0x3223('0x1a')]);}return _0x35b1ee[_0x3223('0x47')](_0x4522ff);}})[_0x3223('0x21')](function(_0x412371){if(_0x412371){return _0x412371?{'count':_0x14167d,'rows':_0x412371}:null;}})[_0x3223('0x21')](respondWithResult(_0x15ec4a,null))[_0x3223('0x3d')](handleError(_0x15ec4a,null));};exports[_0x3223('0x48')]=function(_0x4f1649,_0x2123ae,_0x1f146e){var _0xeaae40={};var _0x1168c5={};var _0x40b4c7;var _0x47999b;return db[_0x3223('0x28')]['findOne']({'where':{'id':_0x4f1649[_0x3223('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2123ae,null))[_0x3223('0x21')](function(_0x26c9ae){if(_0x26c9ae){_0x40b4c7=_0x26c9ae;_0x1168c5[_0x3223('0x2c')]=_[_0x3223('0x2e')](db[_0x3223('0x46')][_0x3223('0x29')]);_0x1168c5[_0x3223('0x2d')]=_[_0x3223('0x2e')](_0x4f1649[_0x3223('0x2d')]);_0x1168c5[_0x3223('0x2f')]=_[_0x3223('0x30')](_0x1168c5[_0x3223('0x2c')],_0x1168c5[_0x3223('0x2d')]);_0xeaae40[_0x3223('0x32')]=_[_0x3223('0x30')](_0x1168c5[_0x3223('0x2c')],qs[_0x3223('0x31')](_0x4f1649['query']['fields']));_0xeaae40[_0x3223('0x32')]=_0xeaae40[_0x3223('0x32')][_0x3223('0x33')]?_0xeaae40['attributes']:_0x1168c5[_0x3223('0x2c')];_0xeaae40[_0x3223('0x49')]=qs[_0x3223('0x36')](_0x4f1649['query'][_0x3223('0x36')]);_0xeaae40[_0x3223('0x37')]=qs[_0x3223('0x2f')](_[_0x3223('0x38')](_0x4f1649['query'],_0x1168c5[_0x3223('0x2f')]));if(_0x4f1649[_0x3223('0x2d')]['filter']){_0xeaae40[_0x3223('0x37')]=_[_0x3223('0x3a')](_0xeaae40['where'],{'$or':_[_0x3223('0x27')](_0xeaae40['attributes'],function(_0x3fff80){var _0x5c1aa6={};_0x5c1aa6[_0x3fff80]={'$like':'%'+_0x4f1649[_0x3223('0x2d')]['filter']+'%'};return _0x5c1aa6;})});}_0xeaae40=_['merge']({},_0xeaae40,_0x4f1649[_0x3223('0x41')]);return _0x40b4c7[_0x3223('0x48')](_0xeaae40);}})['then'](function(_0x2dba84){if(_0x2dba84){_0x47999b=_0x2dba84['length'];if(!_0x4f1649[_0x3223('0x2d')][_0x3223('0x34')](_0x3223('0x35'))){_0xeaae40[_0x3223('0x1c')]=qs[_0x3223('0x1c')](_0x4f1649[_0x3223('0x2d')]['limit']);_0xeaae40['offset']=qs[_0x3223('0x1a')](_0x4f1649[_0x3223('0x2d')][_0x3223('0x1a')]);}return _0x40b4c7['getSubjects'](_0xeaae40);}})[_0x3223('0x21')](function(_0x588177){if(_0x588177){return _0x588177?{'count':_0x47999b,'rows':_0x588177}:null;}})[_0x3223('0x21')](respondWithResult(_0x2123ae,null))['catch'](handleError(_0x2123ae,null));};exports[_0x3223('0x4a')]=function(_0x501bcc,_0x352d85,_0x3c4665){var _0x36982d={};var _0x508600={};var _0x4a4290;var _0x4fa7d8;return db[_0x3223('0x28')][_0x3223('0x45')]({'where':{'id':_0x501bcc[_0x3223('0x3f')]['id']}})['then'](handleEntityNotFound(_0x352d85,null))[_0x3223('0x21')](function(_0x551302){if(_0x551302){_0x4a4290=_0x551302;_0x508600[_0x3223('0x2c')]=_[_0x3223('0x2e')](db['Dynamics365Field']['rawAttributes']);_0x508600[_0x3223('0x2d')]=_[_0x3223('0x2e')](_0x501bcc[_0x3223('0x2d')]);_0x508600[_0x3223('0x2f')]=_[_0x3223('0x30')](_0x508600[_0x3223('0x2c')],_0x508600[_0x3223('0x2d')]);_0x36982d[_0x3223('0x32')]=_['intersection'](_0x508600[_0x3223('0x2c')],qs['fields'](_0x501bcc[_0x3223('0x2d')]['fields']));_0x36982d[_0x3223('0x32')]=_0x36982d['attributes']['length']?_0x36982d[_0x3223('0x32')]:_0x508600[_0x3223('0x2c')];_0x36982d['order']=qs['sort'](_0x501bcc[_0x3223('0x2d')][_0x3223('0x36')]);_0x36982d[_0x3223('0x37')]=qs[_0x3223('0x2f')](_['pick'](_0x501bcc[_0x3223('0x2d')],_0x508600[_0x3223('0x2f')]));if(_0x501bcc['query'][_0x3223('0x39')]){_0x36982d[_0x3223('0x37')]=_[_0x3223('0x3a')](_0x36982d[_0x3223('0x37')],{'$or':_[_0x3223('0x27')](_0x36982d[_0x3223('0x32')],function(_0x3ed51f){var _0x41adde={};_0x41adde[_0x3ed51f]={'$like':'%'+_0x501bcc[_0x3223('0x2d')][_0x3223('0x39')]+'%'};return _0x41adde;})});}_0x36982d=_[_0x3223('0x3a')]({},_0x36982d,_0x501bcc[_0x3223('0x41')]);return _0x4a4290[_0x3223('0x4a')](_0x36982d);}})[_0x3223('0x21')](function(_0x30e52f){if(_0x30e52f){_0x4fa7d8=_0x30e52f[_0x3223('0x33')];if(!_0x501bcc[_0x3223('0x2d')][_0x3223('0x34')](_0x3223('0x35'))){_0x36982d[_0x3223('0x1c')]=qs[_0x3223('0x1c')](_0x501bcc['query'][_0x3223('0x1c')]);_0x36982d['offset']=qs[_0x3223('0x1a')](_0x501bcc[_0x3223('0x2d')]['offset']);}return _0x4a4290[_0x3223('0x4a')](_0x36982d);}})[_0x3223('0x21')](function(_0x48b3bf){if(_0x48b3bf){return _0x48b3bf?{'count':_0x4fa7d8,'rows':_0x48b3bf}:null;}})[_0x3223('0x21')](respondWithResult(_0x352d85,null))[_0x3223('0x3d')](handleError(_0x352d85,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 95fc5e4..e79b703 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0x503c75,_0x10835c){var _0x578b3e=function(_0x902af9){while(--_0x902af9){_0x503c75['push'](_0x503c75['shift']());}};_0x578b3e(++_0x10835c);}(_0x9f62,0x154));var _0x29f6=function(_0x476eb3,_0x5d0502){_0x476eb3=_0x476eb3-0x0;var _0x17e46d=_0x9f62[_0x476eb3];return _0x17e46d;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf109=['Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x50bf00,_0x19f221){var _0x364cae=function(_0xfc90c2){while(--_0xfc90c2){_0x50bf00['push'](_0x50bf00['shift']());}};_0x364cae(++_0x19f221);}(_0xf109,0xce));var _0x9f10=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xf109[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'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 9f1c962..5c6506f 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 _0xf714=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf714,0xb5));var _0x4f71=function(_0x29a7a9,_0x46c742){_0x29a7a9=_0x29a7a9-0x0;var _0x53713b=_0xf714[_0x29a7a9];return _0x53713b;};'use strict';var _=require(_0x4f71('0x0'));var util=require(_0x4f71('0x1'));var moment=require(_0x4f71('0x2'));var BPromise=require(_0x4f71('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f71('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4f71('0x5'));var jayson=require(_0x4f71('0x6'));var client=jayson[_0x4f71('0x7')][_0x4f71('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4803ce,_0x4d797a,_0x1a4fc5){return new BPromise(function(_0x4c8d11,_0x18e190){return client['request'](_0x4803ce,_0x1a4fc5)[_0x4f71('0x9')](function(_0x2597e9){logger[_0x4f71('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4d797a,_0x4f71('0xb'));logger[_0x4f71('0xc')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4d797a,'request\x20sent',JSON[_0x4f71('0xd')](_0x2597e9));if(_0x2597e9[_0x4f71('0xe')]){if(_0x2597e9['error']['code']===0x1f4){logger[_0x4f71('0xe')](_0x4f71('0xf'),_0x4d797a,_0x2597e9[_0x4f71('0xe')][_0x4f71('0x10')]);return _0x18e190(_0x2597e9[_0x4f71('0xe')][_0x4f71('0x10')]);}logger[_0x4f71('0xe')](_0x4f71('0xf'),_0x4d797a,_0x2597e9[_0x4f71('0xe')][_0x4f71('0x10')]);return _0x4c8d11(_0x2597e9['error']['message']);}else{logger['info'](_0x4f71('0xf'),_0x4d797a,_0x4f71('0xb'));_0x4c8d11(_0x2597e9['result'][_0x4f71('0x10')]);}})[_0x4f71('0x11')](function(_0x232bfa){logger[_0x4f71('0xe')](_0x4f71('0xf'),_0x4d797a,_0x232bfa);_0x18e190(_0x232bfa);});});} \ No newline at end of file +var _0x3460=['rpc','client','http','info','request\x20sent','debug','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x371a5f,_0x1b52e1){var _0xa79760=function(_0x2361d9){while(--_0x2361d9){_0x371a5f['push'](_0x371a5f['shift']());}};_0xa79760(++_0x1b52e1);}(_0x3460,0x161));var _0x0346=function(_0x16856d,_0xc34f36){_0x16856d=_0x16856d-0x0;var _0x46c86b=_0x3460[_0x16856d];return _0x46c86b;};'use strict';var _=require(_0x0346('0x0'));var util=require(_0x0346('0x1'));var moment=require(_0x0346('0x2'));var BPromise=require(_0x0346('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0346('0x4'));var db=require(_0x0346('0x5'))['db'];var utils=require(_0x0346('0x6'));var logger=require('../../config/logger')(_0x0346('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0346('0x8')][_0x0346('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52ec3b,_0x2b3faa,_0x5063ef){return new BPromise(function(_0x27e707,_0x552724){return client['request'](_0x52ec3b,_0x5063ef)['then'](function(_0x53ab2f){logger[_0x0346('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2b3faa,_0x0346('0xb'));logger[_0x0346('0xc')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2b3faa,_0x0346('0xb'),JSON[_0x0346('0xd')](_0x53ab2f));if(_0x53ab2f['error']){if(_0x53ab2f[_0x0346('0xe')][_0x0346('0xf')]===0x1f4){logger[_0x0346('0xe')](_0x0346('0x10'),_0x2b3faa,_0x53ab2f[_0x0346('0xe')]['message']);return _0x552724(_0x53ab2f[_0x0346('0xe')]['message']);}logger['error'](_0x0346('0x10'),_0x2b3faa,_0x53ab2f[_0x0346('0xe')][_0x0346('0x11')]);return _0x27e707(_0x53ab2f[_0x0346('0xe')][_0x0346('0x11')]);}else{logger[_0x0346('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2b3faa,_0x0346('0xb'));_0x27e707(_0x53ab2f[_0x0346('0x12')]['message']);}})[_0x0346('0x13')](function(_0x5ad7ed){logger[_0x0346('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2b3faa,_0x5ad7ed);_0x552724(_0x5ad7ed);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index e5aa481..601d810 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 _0x0f8b=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','post','create','put','update'];(function(_0x455127,_0x205384){var _0x20930c=function(_0x1685a2){while(--_0x1685a2){_0x455127['push'](_0x455127['shift']());}};_0x20930c(++_0x205384);}(_0x0f8b,0x168));var _0xb0f8=function(_0x4142c6,_0x30b59e){_0x4142c6=_0x4142c6-0x0;var _0x510824=_0x0f8b[_0x4142c6];return _0x510824;};'use strict';var multer=require(_0xb0f8('0x0'));var util=require(_0xb0f8('0x1'));var path=require(_0xb0f8('0x2'));var timeout=require(_0xb0f8('0x3'));var express=require(_0xb0f8('0x4'));var router=express[_0xb0f8('0x5')]();var fs_extra=require(_0xb0f8('0x6'));var auth=require(_0xb0f8('0x7'));var interaction=require(_0xb0f8('0x8'));var config=require(_0xb0f8('0x9'));var controller=require(_0xb0f8('0xa'));router[_0xb0f8('0xb')]('/',auth[_0xb0f8('0xc')](),controller['index']);router[_0xb0f8('0xb')](_0xb0f8('0xd'),auth[_0xb0f8('0xc')](),controller['show']);router[_0xb0f8('0xe')]('/',auth[_0xb0f8('0xc')](),controller[_0xb0f8('0xf')]);router[_0xb0f8('0x10')](_0xb0f8('0xd'),auth[_0xb0f8('0xc')](),controller[_0xb0f8('0x11')]);router[_0xb0f8('0x12')](_0xb0f8('0xd'),auth[_0xb0f8('0xc')](),controller[_0xb0f8('0x13')]);module[_0xb0f8('0x14')]=router; \ No newline at end of file +var _0xfa30=['create','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','post'];(function(_0x5b26b3,_0x3a0b79){var _0x3f898c=function(_0x3b3485){while(--_0x3b3485){_0x5b26b3['push'](_0x5b26b3['shift']());}};_0x3f898c(++_0x3a0b79);}(_0xfa30,0x1e2));var _0x0fa3=function(_0x1022da,_0x36943e){_0x1022da=_0x1022da-0x0;var _0xf92d2e=_0xfa30[_0x1022da];return _0xf92d2e;};'use strict';var multer=require('multer');var util=require(_0x0fa3('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0fa3('0x1'));var router=express[_0x0fa3('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0fa3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0fa3('0x4'));var controller=require(_0x0fa3('0x5'));router[_0x0fa3('0x6')]('/',auth['isAuthenticated'](),controller[_0x0fa3('0x7')]);router[_0x0fa3('0x6')](_0x0fa3('0x8'),auth[_0x0fa3('0x9')](),controller['show']);router[_0x0fa3('0xa')]('/',auth['isAuthenticated'](),controller[_0x0fa3('0xb')]);router[_0x0fa3('0xc')](_0x0fa3('0x8'),auth[_0x0fa3('0x9')](),controller[_0x0fa3('0xd')]);router[_0x0fa3('0xe')](_0x0fa3('0x8'),auth['isAuthenticated'](),controller[_0x0fa3('0xf')]);module[_0x0fa3('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 121e0b0..0995bb9 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 _0xa8b5=['picklist','string','STRING','BOOLEAN','sequelize','ENUM','customVariable'];(function(_0x471948,_0xe88457){var _0x214cf5=function(_0x4bba74){while(--_0x4bba74){_0x471948['push'](_0x471948['shift']());}};_0x214cf5(++_0xe88457);}(_0xa8b5,0x115));var _0x5a8b=function(_0x1796d7,_0x2f2ed3){_0x1796d7=_0x1796d7-0x0;var _0x25fe90=_0xa8b5[_0x1796d7];return _0x25fe90;};'use strict';var Sequelize=require(_0x5a8b('0x0'));module['exports']={'type':{'type':Sequelize[_0x5a8b('0x1')]('string','variable',_0x5a8b('0x2'),'keyValue',_0x5a8b('0x3')),'defaultValue':_0x5a8b('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5a8b('0x1')](_0x5a8b('0x4'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x5a8b('0x5')]},'idField':{'type':Sequelize[_0x5a8b('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5a8b('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5a8b('0x5')]}}; \ No newline at end of file +var _0x58b0=['BOOLEAN','sequelize','exports','string','variable','keyValue','picklist','STRING','ENUM','customVariable'];(function(_0x427e74,_0x14cd59){var _0x2096e9=function(_0x45bd47){while(--_0x45bd47){_0x427e74['push'](_0x427e74['shift']());}};_0x2096e9(++_0x14cd59);}(_0x58b0,0xe7));var _0x058b=function(_0x2c5d4d,_0x1d4d5e){_0x2c5d4d=_0x2c5d4d-0x0;var _0x14dfe0=_0x58b0[_0x2c5d4d];return _0x14dfe0;};'use strict';var Sequelize=require(_0x058b('0x0'));module[_0x058b('0x1')]={'type':{'type':Sequelize['ENUM'](_0x058b('0x2'),_0x058b('0x3'),'customVariable',_0x058b('0x4'),_0x058b('0x5')),'defaultValue':_0x058b('0x2')},'content':{'type':Sequelize[_0x058b('0x6')]},'key':{'type':Sequelize[_0x058b('0x6')]},'keyType':{'type':Sequelize[_0x058b('0x7')](_0x058b('0x2'),'variable',_0x058b('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x058b('0x6')]},'nameField':{'type':Sequelize[_0x058b('0x6')]},'customField':{'type':Sequelize[_0x058b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x058b('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 9baea2c..d24bc96 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 _0x23da=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','catch','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Field'];(function(_0x2e8ea8,_0x15a943){var _0x123d3c=function(_0x5d4468){while(--_0x5d4468){_0x2e8ea8['push'](_0x2e8ea8['shift']());}};_0x123d3c(++_0x15a943);}(_0x23da,0x195));var _0xa23d=function(_0xffd6f2,_0xf89337){_0xffd6f2=_0xffd6f2-0x0;var _0x3411a4=_0x23da[_0xffd6f2];return _0x3411a4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa23d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa23d('0x1'));var moment=require(_0xa23d('0x2'));var BPromise=require(_0xa23d('0x3'));var Mustache=require('mustache');var util=require(_0xa23d('0x4'));var path=require(_0xa23d('0x5'));var sox=require(_0xa23d('0x6'));var csv=require('to-csv');var ejs=require(_0xa23d('0x7'));var fs=require('fs');var fs_extra=require(_0xa23d('0x8'));var _=require(_0xa23d('0x9'));var squel=require(_0xa23d('0xa'));var crypto=require(_0xa23d('0xb'));var jsforce=require(_0xa23d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa23d('0xd'));var querystring=require('querystring');var Papa=require(_0xa23d('0xe'));var Redis=require(_0xa23d('0xf'));var authService=require(_0xa23d('0x10'));var qs=require(_0xa23d('0x11'));var as=require(_0xa23d('0x12'));var hardwareService=require(_0xa23d('0x13'));var logger=require(_0xa23d('0x14'))(_0xa23d('0x15'));var utils=require(_0xa23d('0x16'));var config=require(_0xa23d('0x17'));var licenseUtil=require(_0xa23d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28d771,_0x3efaa0){_0x3efaa0=_0x3efaa0||0xcc;return function(_0x2546ce){if(_0x2546ce){return _0x28d771['sendStatus'](_0x3efaa0);}return _0x28d771[_0xa23d('0x19')](_0x3efaa0)[_0xa23d('0x1a')]();};}function respondWithResult(_0x13b69a,_0x182239){_0x182239=_0x182239||0xc8;return function(_0x206f65){if(_0x206f65){return _0x13b69a[_0xa23d('0x19')](_0x182239)[_0xa23d('0x1b')](_0x206f65);}};}function respondWithFilteredResult(_0x32463b,_0x1bf586){return function(_0x35b49f){if(_0x35b49f){var _0x17b9f1=typeof _0x1bf586[_0xa23d('0x1c')]===_0xa23d('0x1d')&&typeof _0x1bf586['limit']==='undefined';var _0x15534f=_0x35b49f['count'];var _0x9f4997=_0x17b9f1?0x0:_0x1bf586['offset'];var _0x127e1b=_0x17b9f1?_0x35b49f[_0xa23d('0x1e')]:_0x1bf586[_0xa23d('0x1c')]+_0x1bf586['limit'];var _0x566b83;if(_0x127e1b>=_0x15534f){_0x127e1b=_0x15534f;_0x566b83=0xc8;}else{_0x566b83=0xce;}_0x32463b[_0xa23d('0x19')](_0x566b83);return _0x32463b['set'](_0xa23d('0x1f'),_0x9f4997+'-'+_0x127e1b+'/'+_0x15534f)[_0xa23d('0x1b')](_0x35b49f);}return null;};}function patchUpdates(_0x490cde){return function(_0x407482){try{jsonpatch[_0xa23d('0x20')](_0x407482,_0x490cde,!![]);}catch(_0x1dfbfb){return BPromise[_0xa23d('0x21')](_0x1dfbfb);}return _0x407482['save']();};}function saveUpdates(_0x29f2a6,_0x1ce5e8){return function(_0x5bfc5a){if(_0x5bfc5a){return _0x5bfc5a[_0xa23d('0x22')](_0x29f2a6)[_0xa23d('0x23')](function(_0x199051){return _0x199051;});}return null;};}function removeEntity(_0x2811f4,_0x1ba75d){return function(_0x4a1de4){if(_0x4a1de4){return _0x4a1de4[_0xa23d('0x24')]()[_0xa23d('0x23')](function(){_0x2811f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eecf3,_0x4c1336){return function(_0x4b486f){if(!_0x4b486f){_0x1eecf3[_0xa23d('0x25')](0x194);}return _0x4b486f;};}function handleError(_0x43fec0,_0x136718){_0x136718=_0x136718||0x1f4;return function(_0x50cc52){logger[_0xa23d('0x26')](_0x50cc52[_0xa23d('0x27')]);if(_0x50cc52[_0xa23d('0x28')]){delete _0x50cc52['name'];}_0x43fec0['status'](_0x136718)[_0xa23d('0x29')](_0x50cc52);};}exports[_0xa23d('0x2a')]=function(_0x157c85,_0x5efa42){var _0x2a9035={},_0x20e636={},_0x4450f3={'count':0x0,'rows':[]};var _0x58c2fd=_[_0xa23d('0x2b')](db[_0xa23d('0x2c')][_0xa23d('0x2d')],function(_0x4a91ef){return{'name':_0x4a91ef[_0xa23d('0x2e')],'type':_0x4a91ef[_0xa23d('0x2f')][_0xa23d('0x30')]};});_0x20e636[_0xa23d('0x31')]=_['map'](_0x58c2fd,_0xa23d('0x28'));_0x20e636[_0xa23d('0x32')]=_[_0xa23d('0x33')](_0x157c85[_0xa23d('0x32')]);_0x20e636[_0xa23d('0x34')]=_[_0xa23d('0x35')](_0x20e636['model'],_0x20e636[_0xa23d('0x32')]);_0x2a9035[_0xa23d('0x36')]=_[_0xa23d('0x35')](_0x20e636['model'],qs[_0xa23d('0x37')](_0x157c85['query'][_0xa23d('0x37')]));_0x2a9035[_0xa23d('0x36')]=_0x2a9035[_0xa23d('0x36')][_0xa23d('0x38')]?_0x2a9035['attributes']:_0x20e636['model'];if(!_0x157c85[_0xa23d('0x32')]['hasOwnProperty']('nolimit')){_0x2a9035['limit']=qs[_0xa23d('0x39')](_0x157c85[_0xa23d('0x32')][_0xa23d('0x39')]);_0x2a9035[_0xa23d('0x1c')]=qs[_0xa23d('0x1c')](_0x157c85[_0xa23d('0x32')][_0xa23d('0x1c')]);}_0x2a9035[_0xa23d('0x3a')]=qs[_0xa23d('0x3b')](_0x157c85[_0xa23d('0x32')][_0xa23d('0x3b')]);_0x2a9035['where']=qs[_0xa23d('0x34')](_[_0xa23d('0x3c')](_0x157c85[_0xa23d('0x32')],_0x20e636[_0xa23d('0x34')]),_0x58c2fd);if(_0x157c85['query'][_0xa23d('0x3d')]){_0x2a9035[_0xa23d('0x3e')]=_[_0xa23d('0x3f')](_0x2a9035[_0xa23d('0x3e')],{'$or':_[_0xa23d('0x2b')](_0x58c2fd,function(_0x45a185){if(_0x45a185[_0xa23d('0x2f')]!==_0xa23d('0x40')){var _0xa40750={};_0xa40750[_0x45a185['name']]={'$like':'%'+_0x157c85[_0xa23d('0x32')][_0xa23d('0x3d')]+'%'};return _0xa40750;}})});}_0x2a9035=_[_0xa23d('0x3f')]({},_0x2a9035,_0x157c85[_0xa23d('0x41')]);var _0x47a34a={'where':_0x2a9035[_0xa23d('0x3e')]};return db[_0xa23d('0x2c')][_0xa23d('0x1e')](_0x47a34a)[_0xa23d('0x23')](function(_0x38e7e9){_0x4450f3[_0xa23d('0x1e')]=_0x38e7e9;if(_0x157c85[_0xa23d('0x32')][_0xa23d('0x42')]){_0x2a9035[_0xa23d('0x43')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xa23d('0x44')](_0x2a9035);})['then'](function(_0x30ba38){_0x4450f3[_0xa23d('0x45')]=_0x30ba38;return _0x4450f3;})[_0xa23d('0x23')](respondWithFilteredResult(_0x5efa42,_0x2a9035))['catch'](handleError(_0x5efa42,null));};exports['show']=function(_0x3998bc,_0x36419f){var _0x6aee9e={'raw':!![],'where':{'id':_0x3998bc[_0xa23d('0x46')]['id']}},_0x459327={};_0x459327[_0xa23d('0x31')]=_[_0xa23d('0x33')](db[_0xa23d('0x2c')][_0xa23d('0x2d')]);_0x459327[_0xa23d('0x32')]=_[_0xa23d('0x33')](_0x3998bc['query']);_0x459327['filters']=_[_0xa23d('0x35')](_0x459327[_0xa23d('0x31')],_0x459327[_0xa23d('0x32')]);_0x6aee9e[_0xa23d('0x36')]=_[_0xa23d('0x35')](_0x459327['model'],qs[_0xa23d('0x37')](_0x3998bc[_0xa23d('0x32')][_0xa23d('0x37')]));_0x6aee9e['attributes']=_0x6aee9e[_0xa23d('0x36')]['length']?_0x6aee9e[_0xa23d('0x36')]:_0x459327[_0xa23d('0x31')];if(_0x3998bc[_0xa23d('0x32')][_0xa23d('0x42')]){_0x6aee9e[_0xa23d('0x43')]=[{'all':!![]}];}_0x6aee9e=_['merge']({},_0x6aee9e,_0x3998bc[_0xa23d('0x41')]);return db['Dynamics365Field'][_0xa23d('0x47')](_0x6aee9e)[_0xa23d('0x23')](handleEntityNotFound(_0x36419f,null))[_0xa23d('0x23')](respondWithResult(_0x36419f,null))['catch'](handleError(_0x36419f,null));};exports[_0xa23d('0x48')]=function(_0x33be4d,_0x321243){return db[_0xa23d('0x2c')][_0xa23d('0x48')](_0x33be4d[_0xa23d('0x49')],{})['then'](respondWithResult(_0x321243,0xc9))[_0xa23d('0x4a')](handleError(_0x321243,null));};exports['update']=function(_0xe86176,_0x8edf7d){if(_0xe86176[_0xa23d('0x49')]['id']){delete _0xe86176[_0xa23d('0x49')]['id'];}return db[_0xa23d('0x2c')][_0xa23d('0x47')]({'where':{'id':_0xe86176[_0xa23d('0x46')]['id']}})[_0xa23d('0x23')](handleEntityNotFound(_0x8edf7d,null))['then'](saveUpdates(_0xe86176[_0xa23d('0x49')],null))[_0xa23d('0x23')](respondWithResult(_0x8edf7d,null))['catch'](handleError(_0x8edf7d,null));};exports[_0xa23d('0x24')]=function(_0x1f6997,_0x2e0042){return db['Dynamics365Field'][_0xa23d('0x47')]({'where':{'id':_0x1f6997[_0xa23d('0x46')]['id']}})[_0xa23d('0x23')](handleEntityNotFound(_0x2e0042,null))[_0xa23d('0x23')](removeEntity(_0x2e0042,null))['catch'](handleError(_0x2e0042,null));}; \ No newline at end of file +var _0x03fb=['model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','map','type','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','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','../../mysqldb','status','end','offset','undefined','limit','count','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','query','keys','filters','intersection'];(function(_0x5e4cfd,_0x50f345){var _0x59c628=function(_0x499f93){while(--_0x499f93){_0x5e4cfd['push'](_0x5e4cfd['shift']());}};_0x59c628(++_0x50f345);}(_0x03fb,0xae));var _0xb03f=function(_0x196bbf,_0x3a0d24){_0x196bbf=_0x196bbf-0x0;var _0x155966=_0x03fb[_0x196bbf];return _0x155966;};'use strict';var emlformat=require(_0xb03f('0x0'));var rimraf=require(_0xb03f('0x1'));var zipdir=require(_0xb03f('0x2'));var jsonpatch=require(_0xb03f('0x3'));var rp=require(_0xb03f('0x4'));var moment=require(_0xb03f('0x5'));var BPromise=require(_0xb03f('0x6'));var Mustache=require(_0xb03f('0x7'));var util=require(_0xb03f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xb03f('0x9'));var ejs=require(_0xb03f('0xa'));var fs=require('fs');var fs_extra=require(_0xb03f('0xb'));var _=require(_0xb03f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb03f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb03f('0x9'));var querystring=require(_0xb03f('0xe'));var Papa=require('papaparse');var Redis=require(_0xb03f('0xf'));var authService=require(_0xb03f('0x10'));var qs=require(_0xb03f('0x11'));var as=require(_0xb03f('0x12'));var hardwareService=require(_0xb03f('0x13'));var logger=require(_0xb03f('0x14'))(_0xb03f('0x15'));var utils=require(_0xb03f('0x16'));var config=require(_0xb03f('0x17'));var licenseUtil=require(_0xb03f('0x18'));var db=require(_0xb03f('0x19'))['db'];function respondWithStatusCode(_0x7dceb0,_0x39c5f6){_0x39c5f6=_0x39c5f6||0xcc;return function(_0x186b11){if(_0x186b11){return _0x7dceb0['sendStatus'](_0x39c5f6);}return _0x7dceb0[_0xb03f('0x1a')](_0x39c5f6)[_0xb03f('0x1b')]();};}function respondWithResult(_0x3bc43f,_0x28d7c9){_0x28d7c9=_0x28d7c9||0xc8;return function(_0x470730){if(_0x470730){return _0x3bc43f['status'](_0x28d7c9)['json'](_0x470730);}};}function respondWithFilteredResult(_0x381f72,_0x561fb7){return function(_0x1671da){if(_0x1671da){var _0x4aee9c=typeof _0x561fb7[_0xb03f('0x1c')]===_0xb03f('0x1d')&&typeof _0x561fb7[_0xb03f('0x1e')]==='undefined';var _0x5c2425=_0x1671da[_0xb03f('0x1f')];var _0x57887f=_0x4aee9c?0x0:_0x561fb7[_0xb03f('0x1c')];var _0x4a378a=_0x4aee9c?_0x1671da['count']:_0x561fb7['offset']+_0x561fb7[_0xb03f('0x1e')];var _0x44df9c;if(_0x4a378a>=_0x5c2425){_0x4a378a=_0x5c2425;_0x44df9c=0xc8;}else{_0x44df9c=0xce;}_0x381f72[_0xb03f('0x1a')](_0x44df9c);return _0x381f72['set']('Content-Range',_0x57887f+'-'+_0x4a378a+'/'+_0x5c2425)[_0xb03f('0x20')](_0x1671da);}return null;};}function patchUpdates(_0x45b3cd){return function(_0x103adb){try{jsonpatch[_0xb03f('0x21')](_0x103adb,_0x45b3cd,!![]);}catch(_0x41f040){return BPromise[_0xb03f('0x22')](_0x41f040);}return _0x103adb[_0xb03f('0x23')]();};}function saveUpdates(_0x383a94,_0x52919b){return function(_0x3d8f0c){if(_0x3d8f0c){return _0x3d8f0c['update'](_0x383a94)[_0xb03f('0x24')](function(_0x591e7e){return _0x591e7e;});}return null;};}function removeEntity(_0x43727b,_0x16dd22){return function(_0x326db0){if(_0x326db0){return _0x326db0[_0xb03f('0x25')]()[_0xb03f('0x24')](function(){_0x43727b[_0xb03f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x563db8,_0x518051){return function(_0x598cc7){if(!_0x598cc7){_0x563db8[_0xb03f('0x26')](0x194);}return _0x598cc7;};}function handleError(_0x2fb8c3,_0x4dad32){_0x4dad32=_0x4dad32||0x1f4;return function(_0x14d903){logger[_0xb03f('0x27')](_0x14d903[_0xb03f('0x28')]);if(_0x14d903[_0xb03f('0x29')]){delete _0x14d903[_0xb03f('0x29')];}_0x2fb8c3[_0xb03f('0x1a')](_0x4dad32)[_0xb03f('0x2a')](_0x14d903);};}exports[_0xb03f('0x2b')]=function(_0x85d749,_0x11b804){var _0x5c0195={},_0x3ca6c7={},_0x1e6526={'count':0x0,'rows':[]};var _0x5404f5=_['map'](db[_0xb03f('0x2c')][_0xb03f('0x2d')],function(_0x215a61){return{'name':_0x215a61[_0xb03f('0x2e')],'type':_0x215a61['type']['key']};});_0x3ca6c7['model']=_['map'](_0x5404f5,_0xb03f('0x29'));_0x3ca6c7[_0xb03f('0x2f')]=_[_0xb03f('0x30')](_0x85d749[_0xb03f('0x2f')]);_0x3ca6c7[_0xb03f('0x31')]=_[_0xb03f('0x32')](_0x3ca6c7['model'],_0x3ca6c7[_0xb03f('0x2f')]);_0x5c0195['attributes']=_[_0xb03f('0x32')](_0x3ca6c7[_0xb03f('0x33')],qs[_0xb03f('0x34')](_0x85d749[_0xb03f('0x2f')][_0xb03f('0x34')]));_0x5c0195['attributes']=_0x5c0195[_0xb03f('0x35')][_0xb03f('0x36')]?_0x5c0195['attributes']:_0x3ca6c7['model'];if(!_0x85d749['query'][_0xb03f('0x37')]('nolimit')){_0x5c0195[_0xb03f('0x1e')]=qs[_0xb03f('0x1e')](_0x85d749[_0xb03f('0x2f')]['limit']);_0x5c0195['offset']=qs['offset'](_0x85d749[_0xb03f('0x2f')]['offset']);}_0x5c0195[_0xb03f('0x38')]=qs[_0xb03f('0x39')](_0x85d749[_0xb03f('0x2f')][_0xb03f('0x39')]);_0x5c0195[_0xb03f('0x3a')]=qs[_0xb03f('0x31')](_['pick'](_0x85d749['query'],_0x3ca6c7['filters']),_0x5404f5);if(_0x85d749['query'][_0xb03f('0x3b')]){_0x5c0195[_0xb03f('0x3a')]=_[_0xb03f('0x3c')](_0x5c0195[_0xb03f('0x3a')],{'$or':_[_0xb03f('0x3d')](_0x5404f5,function(_0x27918d){if(_0x27918d[_0xb03f('0x3e')]!=='VIRTUAL'){var _0x301b69={};_0x301b69[_0x27918d[_0xb03f('0x29')]]={'$like':'%'+_0x85d749[_0xb03f('0x2f')]['filter']+'%'};return _0x301b69;}})});}_0x5c0195=_['merge']({},_0x5c0195,_0x85d749[_0xb03f('0x3f')]);var _0x1d5321={'where':_0x5c0195[_0xb03f('0x3a')]};return db['Dynamics365Field']['count'](_0x1d5321)['then'](function(_0x491be1){_0x1e6526[_0xb03f('0x1f')]=_0x491be1;if(_0x85d749[_0xb03f('0x2f')][_0xb03f('0x40')]){_0x5c0195['include']=[{'all':!![]}];}return db[_0xb03f('0x2c')][_0xb03f('0x41')](_0x5c0195);})['then'](function(_0x4aba3b){_0x1e6526[_0xb03f('0x42')]=_0x4aba3b;return _0x1e6526;})[_0xb03f('0x24')](respondWithFilteredResult(_0x11b804,_0x5c0195))[_0xb03f('0x43')](handleError(_0x11b804,null));};exports[_0xb03f('0x44')]=function(_0xd8c5b1,_0x42c5a2){var _0x34b63c={'raw':!![],'where':{'id':_0xd8c5b1[_0xb03f('0x45')]['id']}},_0x508c5b={};_0x508c5b['model']=_[_0xb03f('0x30')](db[_0xb03f('0x2c')][_0xb03f('0x2d')]);_0x508c5b[_0xb03f('0x2f')]=_[_0xb03f('0x30')](_0xd8c5b1[_0xb03f('0x2f')]);_0x508c5b['filters']=_[_0xb03f('0x32')](_0x508c5b['model'],_0x508c5b[_0xb03f('0x2f')]);_0x34b63c[_0xb03f('0x35')]=_['intersection'](_0x508c5b[_0xb03f('0x33')],qs[_0xb03f('0x34')](_0xd8c5b1['query'][_0xb03f('0x34')]));_0x34b63c[_0xb03f('0x35')]=_0x34b63c[_0xb03f('0x35')][_0xb03f('0x36')]?_0x34b63c['attributes']:_0x508c5b[_0xb03f('0x33')];if(_0xd8c5b1[_0xb03f('0x2f')][_0xb03f('0x40')]){_0x34b63c[_0xb03f('0x46')]=[{'all':!![]}];}_0x34b63c=_[_0xb03f('0x3c')]({},_0x34b63c,_0xd8c5b1[_0xb03f('0x3f')]);return db[_0xb03f('0x2c')][_0xb03f('0x47')](_0x34b63c)['then'](handleEntityNotFound(_0x42c5a2,null))['then'](respondWithResult(_0x42c5a2,null))['catch'](handleError(_0x42c5a2,null));};exports[_0xb03f('0x48')]=function(_0x4d2706,_0x46cc44){return db[_0xb03f('0x2c')][_0xb03f('0x48')](_0x4d2706[_0xb03f('0x49')],{})['then'](respondWithResult(_0x46cc44,0xc9))['catch'](handleError(_0x46cc44,null));};exports[_0xb03f('0x4a')]=function(_0x51be3c,_0xe1c029){if(_0x51be3c[_0xb03f('0x49')]['id']){delete _0x51be3c[_0xb03f('0x49')]['id'];}return db[_0xb03f('0x2c')][_0xb03f('0x47')]({'where':{'id':_0x51be3c[_0xb03f('0x45')]['id']}})[_0xb03f('0x24')](handleEntityNotFound(_0xe1c029,null))[_0xb03f('0x24')](saveUpdates(_0x51be3c['body'],null))['then'](respondWithResult(_0xe1c029,null))[_0xb03f('0x43')](handleError(_0xe1c029,null));};exports[_0xb03f('0x25')]=function(_0x45b38b,_0x512438){return db[_0xb03f('0x2c')][_0xb03f('0x47')]({'where':{'id':_0x45b38b[_0xb03f('0x45')]['id']}})[_0xb03f('0x24')](handleEntityNotFound(_0x512438,null))[_0xb03f('0x24')](removeEntity(_0x512438,null))['catch'](handleError(_0x512438,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index ff139b9..f8474d8 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 _0x6ab4=['moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','lodash','util','../../config/logger'];(function(_0x43297c,_0x40e4da){var _0x57e5f2=function(_0xb4d1de){while(--_0xb4d1de){_0x43297c['push'](_0x43297c['shift']());}};_0x57e5f2(++_0x40e4da);}(_0x6ab4,0x135));var _0x46ab=function(_0x4d1140,_0x47b4ee){_0x4d1140=_0x4d1140-0x0;var _0x1bd5d2=_0x6ab4[_0x4d1140];return _0x1bd5d2;};'use strict';var _=require(_0x46ab('0x0'));var util=require(_0x46ab('0x1'));var logger=require(_0x46ab('0x2'))('api');var moment=require(_0x46ab('0x3'));var BPromise=require('bluebird');var rp=require(_0x46ab('0x4'));var fs=require('fs');var path=require(_0x46ab('0x5'));var rimraf=require(_0x46ab('0x6'));var config=require(_0x46ab('0x7'));var attributes=require(_0x46ab('0x8'));module[_0x46ab('0x9')]=function(_0xf7c7c9,_0x149750){return _0xf7c7c9['define'](_0x46ab('0xa'),attributes,{'tableName':_0x46ab('0xb'),'paranoid':![],'indexes':[{'name':_0x46ab('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x868a=['bluebird','request-promise','path','../../config/environment','./intDynamics365Field.attributes','define','int_dynamics365_fields','dynamics365_unique_index','../../config/logger','api','moment'];(function(_0x546261,_0x44b70f){var _0x1c6263=function(_0x45a5de){while(--_0x45a5de){_0x546261['push'](_0x546261['shift']());}};_0x1c6263(++_0x44b70f);}(_0x868a,0x131));var _0xa868=function(_0x46b809,_0x4fecbd){_0x46b809=_0x46b809-0x0;var _0x22ed80=_0x868a[_0x46b809];return _0x22ed80;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa868('0x0'))(_0xa868('0x1'));var moment=require(_0xa868('0x2'));var BPromise=require(_0xa868('0x3'));var rp=require(_0xa868('0x4'));var fs=require('fs');var path=require(_0xa868('0x5'));var rimraf=require('rimraf');var config=require(_0xa868('0x6'));var attributes=require(_0xa868('0x7'));module['exports']=function(_0x5581af,_0x54bfa1){return _0x5581af[_0xa868('0x8')]('Dynamics365Field',attributes,{'tableName':_0xa868('0x9'),'paranoid':![],'indexes':[{'name':_0xa868('0xa'),'fields':['idField','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 d1becdf..348ef2d 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 _0xd47b=['request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils','rpc','client','http','then','Dynamics365Field,\x20%s,\x20%s'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xd47b,0x1e3));var _0xbd47=function(_0x549652,_0x28a9f8){_0x549652=_0x549652-0x0;var _0x58cff0=_0xd47b[_0x549652];return _0x58cff0;};'use strict';var _=require(_0xbd47('0x0'));var util=require('util');var moment=require(_0xbd47('0x1'));var BPromise=require(_0xbd47('0x2'));var rs=require(_0xbd47('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd47('0x4'));var logger=require('../../config/logger')(_0xbd47('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbd47('0x6')][_0xbd47('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e14a2,_0x52a477,_0x4ead66){return new BPromise(function(_0x2ae488,_0x2687b6){return client['request'](_0x5e14a2,_0x4ead66)[_0xbd47('0x8')](function(_0x7990b3){logger['info'](_0xbd47('0x9'),_0x52a477,_0xbd47('0xa'));logger['debug'](_0xbd47('0xb'),_0x52a477,'request\x20sent',JSON['stringify'](_0x7990b3));if(_0x7990b3[_0xbd47('0xc')]){if(_0x7990b3[_0xbd47('0xc')][_0xbd47('0xd')]===0x1f4){logger[_0xbd47('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x52a477,_0x7990b3[_0xbd47('0xc')][_0xbd47('0xe')]);return _0x2687b6(_0x7990b3['error'][_0xbd47('0xe')]);}logger[_0xbd47('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x52a477,_0x7990b3['error']['message']);return _0x2ae488(_0x7990b3['error'][_0xbd47('0xe')]);}else{logger[_0xbd47('0xf')](_0xbd47('0x9'),_0x52a477,'request\x20sent');_0x2ae488(_0x7990b3['result'][_0xbd47('0xe')]);}})[_0xbd47('0x10')](function(_0x21a49a){logger[_0xbd47('0xc')](_0xbd47('0x9'),_0x52a477,_0x21a49a);_0x2687b6(_0x21a49a);});});} \ No newline at end of file +var _0xca55=['request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5a75f2,_0x35c25b){var _0x2cbfa9=function(_0x308d21){while(--_0x308d21){_0x5a75f2['push'](_0x5a75f2['shift']());}};_0x2cbfa9(++_0x35c25b);}(_0xca55,0x14a));var _0x5ca5=function(_0x1e47ce,_0x47bf41){_0x1e47ce=_0x1e47ce-0x0;var _0x22cdb9=_0xca55[_0x1e47ce];return _0x22cdb9;};'use strict';var _=require('lodash');var util=require(_0x5ca5('0x0'));var moment=require('moment');var BPromise=require(_0x5ca5('0x1'));var rs=require(_0x5ca5('0x2'));var fs=require('fs');var Redis=require(_0x5ca5('0x3'));var db=require(_0x5ca5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ca5('0x5'))(_0x5ca5('0x6'));var config=require(_0x5ca5('0x7'));var jayson=require(_0x5ca5('0x8'));var client=jayson['client'][_0x5ca5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x183bb6,_0x1fb331,_0x48cd27){return new BPromise(function(_0x446045,_0x435da5){return client[_0x5ca5('0xa')](_0x183bb6,_0x48cd27)['then'](function(_0x24586c){logger[_0x5ca5('0xb')](_0x5ca5('0xc'),_0x1fb331,_0x5ca5('0xd'));logger[_0x5ca5('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x1fb331,_0x5ca5('0xd'),JSON['stringify'](_0x24586c));if(_0x24586c[_0x5ca5('0xf')]){if(_0x24586c[_0x5ca5('0xf')][_0x5ca5('0x10')]===0x1f4){logger[_0x5ca5('0xf')](_0x5ca5('0xc'),_0x1fb331,_0x24586c['error'][_0x5ca5('0x11')]);return _0x435da5(_0x24586c[_0x5ca5('0xf')]['message']);}logger[_0x5ca5('0xf')](_0x5ca5('0xc'),_0x1fb331,_0x24586c[_0x5ca5('0xf')][_0x5ca5('0x11')]);return _0x446045(_0x24586c[_0x5ca5('0xf')][_0x5ca5('0x11')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x1fb331,'request\x20sent');_0x446045(_0x24586c[_0x5ca5('0x12')][_0x5ca5('0x11')]);}})[_0x5ca5('0x13')](function(_0xaf6e6e){logger['error'](_0x5ca5('0xc'),_0x1fb331,_0xaf6e6e);_0x435da5(_0xaf6e6e);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 5587d6d..1b5b8ee 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 _0xe9b0=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xe9b0,0x1dc));var _0x0e9b=function(_0x3be0c4,_0x5b7eff){_0x3be0c4=_0x3be0c4-0x0;var _0x11af9f=_0xe9b0[_0x3be0c4];return _0x11af9f;};'use strict';var multer=require(_0x0e9b('0x0'));var util=require(_0x0e9b('0x1'));var path=require('path');var timeout=require(_0x0e9b('0x2'));var express=require(_0x0e9b('0x3'));var router=express['Router']();var fs_extra=require(_0x0e9b('0x4'));var auth=require(_0x0e9b('0x5'));var interaction=require(_0x0e9b('0x6'));var config=require(_0x0e9b('0x7'));var controller=require(_0x0e9b('0x8'));router[_0x0e9b('0x9')]('/',auth['isAuthenticated'](),controller[_0x0e9b('0xa')]);router[_0x0e9b('0x9')]('/:id',auth[_0x0e9b('0xb')](),controller[_0x0e9b('0xc')]);router[_0x0e9b('0x9')](_0x0e9b('0xd'),auth[_0x0e9b('0xb')](),controller[_0x0e9b('0xe')]);router[_0x0e9b('0x9')](_0x0e9b('0xf'),auth[_0x0e9b('0xb')](),controller[_0x0e9b('0x10')]);router[_0x0e9b('0x11')]('/',auth[_0x0e9b('0xb')](),controller[_0x0e9b('0x12')]);router['post'](_0x0e9b('0xd'),auth[_0x0e9b('0xb')](),controller['addConfiguration']);router[_0x0e9b('0x13')](_0x0e9b('0x14'),auth[_0x0e9b('0xb')](),controller[_0x0e9b('0x15')]);router[_0x0e9b('0x16')](_0x0e9b('0x14'),auth[_0x0e9b('0xb')](),controller['destroy']);module[_0x0e9b('0x17')]=router; \ No newline at end of file +var _0x7c66=['show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x7c66,0x163));var _0x67c6=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7c66[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x67c6('0x0'));var path=require('path');var timeout=require(_0x67c6('0x1'));var express=require(_0x67c6('0x2'));var router=express[_0x67c6('0x3')]();var fs_extra=require(_0x67c6('0x4'));var auth=require(_0x67c6('0x5'));var interaction=require(_0x67c6('0x6'));var config=require(_0x67c6('0x7'));var controller=require(_0x67c6('0x8'));router[_0x67c6('0x9')]('/',auth[_0x67c6('0xa')](),controller[_0x67c6('0xb')]);router['get'](_0x67c6('0xc'),auth[_0x67c6('0xa')](),controller[_0x67c6('0xd')]);router[_0x67c6('0x9')](_0x67c6('0xe'),auth[_0x67c6('0xa')](),controller[_0x67c6('0xf')]);router['get'](_0x67c6('0x10'),auth[_0x67c6('0xa')](),controller['getFields']);router[_0x67c6('0x11')]('/',auth['isAuthenticated'](),controller[_0x67c6('0x12')]);router[_0x67c6('0x11')](_0x67c6('0xe'),auth[_0x67c6('0xa')](),controller[_0x67c6('0x13')]);router[_0x67c6('0x14')](_0x67c6('0xc'),auth[_0x67c6('0xa')](),controller[_0x67c6('0x15')]);router[_0x67c6('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 4db234a..7b6026c 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 _0x583c=['exports','STRING','username','sequelize'];(function(_0x23655c,_0x52a09e){var _0x18cf31=function(_0x567a8f){while(--_0x567a8f){_0x23655c['push'](_0x23655c['shift']());}};_0x18cf31(++_0x52a09e);}(_0x583c,0x12b));var _0xc583=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0x583c[_0x2d91c6];return _0x3a8d19;};'use strict';var Sequelize=require(_0xc583('0x0'));module[_0xc583('0x1')]={'name':{'type':Sequelize[_0xc583('0x2')]},'description':{'type':Sequelize[_0xc583('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc583('0x3')},'apiKey':{'type':Sequelize[_0xc583('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xc583('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x430c=['sequelize','STRING','username'];(function(_0x8c12ce,_0x2b4f78){var _0x50283f=function(_0x412f09){while(--_0x412f09){_0x8c12ce['push'](_0x8c12ce['shift']());}};_0x50283f(++_0x2b4f78);}(_0x430c,0x1a1));var _0xc430=function(_0x430459,_0x58519c){_0x430459=_0x430459-0x0;var _0x3a2439=_0x430c[_0x430459];return _0x3a2439;};'use strict';var Sequelize=require(_0xc430('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc430('0x1')]},'username':{'type':Sequelize[_0xc430('0x1')],'unique':_0xc430('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 1621954..1a6b552 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 _0xb248=['Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','find','create','body','catch','getConfigurations','FreshdeskConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','agent','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','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','../../components/integrations/configuration','status','end','json','offset','undefined','set'];(function(_0x53b22e,_0x5e248f){var _0x14a0a4=function(_0x5dcfb9){while(--_0x5dcfb9){_0x53b22e['push'](_0x53b22e['shift']());}};_0x14a0a4(++_0x5e248f);}(_0xb248,0xc6));var _0x8b24=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb248[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8b24('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b24('0x1'));var jsonpatch=require(_0x8b24('0x2'));var rp=require(_0x8b24('0x3'));var moment=require(_0x8b24('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8b24('0x5'));var util=require(_0x8b24('0x6'));var path=require('path');var sox=require(_0x8b24('0x7'));var csv=require(_0x8b24('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b24('0x9'));var _=require(_0x8b24('0xa'));var squel=require('squel');var crypto=require(_0x8b24('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8b24('0xc'));var toCsv=require(_0x8b24('0x8'));var querystring=require(_0x8b24('0xd'));var Papa=require('papaparse');var Redis=require(_0x8b24('0xe'));var authService=require(_0x8b24('0xf'));var qs=require(_0x8b24('0x10'));var as=require(_0x8b24('0x11'));var hardwareService=require(_0x8b24('0x12'));var logger=require(_0x8b24('0x13'))(_0x8b24('0x14'));var utils=require(_0x8b24('0x15'));var config=require(_0x8b24('0x16'));var licenseUtil=require(_0x8b24('0x17'));var db=require(_0x8b24('0x18'))['db'];var integrations=require(_0x8b24('0x19'));function respondWithStatusCode(_0x40c1e6,_0x40ea49){_0x40ea49=_0x40ea49||0xcc;return function(_0x495ba4){if(_0x495ba4){return _0x40c1e6['sendStatus'](_0x40ea49);}return _0x40c1e6[_0x8b24('0x1a')](_0x40ea49)[_0x8b24('0x1b')]();};}function respondWithResult(_0xf92148,_0x32a451){_0x32a451=_0x32a451||0xc8;return function(_0x22a11e){if(_0x22a11e){return _0xf92148[_0x8b24('0x1a')](_0x32a451)[_0x8b24('0x1c')](_0x22a11e);}};}function respondWithFilteredResult(_0x3cd934,_0x4e66ae){return function(_0x5a5745){if(_0x5a5745){var _0x552a28=typeof _0x4e66ae[_0x8b24('0x1d')]==='undefined'&&typeof _0x4e66ae['limit']===_0x8b24('0x1e');var _0x1d7722=_0x5a5745['count'];var _0x1bafdf=_0x552a28?0x0:_0x4e66ae['offset'];var _0x3b4805=_0x552a28?_0x5a5745['count']:_0x4e66ae[_0x8b24('0x1d')]+_0x4e66ae['limit'];var _0x9ab9bd;if(_0x3b4805>=_0x1d7722){_0x3b4805=_0x1d7722;_0x9ab9bd=0xc8;}else{_0x9ab9bd=0xce;}_0x3cd934[_0x8b24('0x1a')](_0x9ab9bd);return _0x3cd934[_0x8b24('0x1f')](_0x8b24('0x20'),_0x1bafdf+'-'+_0x3b4805+'/'+_0x1d7722)[_0x8b24('0x1c')](_0x5a5745);}return null;};}function patchUpdates(_0x44aae9){return function(_0x2f62b3){try{jsonpatch['apply'](_0x2f62b3,_0x44aae9,!![]);}catch(_0x265879){return BPromise[_0x8b24('0x21')](_0x265879);}return _0x2f62b3['save']();};}function saveUpdates(_0xd9b96,_0x13dd68){return function(_0x2225a6){if(_0x2225a6){return _0x2225a6[_0x8b24('0x22')](_0xd9b96)[_0x8b24('0x23')](function(_0x10b721){return _0x10b721;});}return null;};}function removeEntity(_0x347591,_0x3fddf8){return function(_0x2e8c46){if(_0x2e8c46){return _0x2e8c46[_0x8b24('0x24')]()[_0x8b24('0x23')](function(){_0x347591[_0x8b24('0x1a')](0xcc)[_0x8b24('0x1b')]();});}};}function handleEntityNotFound(_0x3d541e,_0x19600a){return function(_0x35d496){if(!_0x35d496){_0x3d541e[_0x8b24('0x25')](0x194);}return _0x35d496;};}function handleError(_0x1a62e9,_0x44ee85){_0x44ee85=_0x44ee85||0x1f4;return function(_0x279837){logger[_0x8b24('0x26')](_0x279837[_0x8b24('0x27')]);if(_0x279837[_0x8b24('0x28')]){delete _0x279837[_0x8b24('0x28')];}_0x1a62e9[_0x8b24('0x1a')](_0x44ee85)[_0x8b24('0x29')](_0x279837);};}exports[_0x8b24('0x2a')]=function(_0x140a50,_0x5d3958){var _0x36ff89={},_0x59d6e1={},_0xadbba0={'count':0x0,'rows':[]};var _0x14316c=_[_0x8b24('0x2b')](db[_0x8b24('0x2c')][_0x8b24('0x2d')],function(_0x4de1cf){return{'name':_0x4de1cf[_0x8b24('0x2e')],'type':_0x4de1cf[_0x8b24('0x2f')][_0x8b24('0x30')]};});_0x59d6e1['model']=_['map'](_0x14316c,'name');_0x59d6e1[_0x8b24('0x31')]=_[_0x8b24('0x32')](_0x140a50[_0x8b24('0x31')]);_0x59d6e1[_0x8b24('0x33')]=_[_0x8b24('0x34')](_0x59d6e1[_0x8b24('0x35')],_0x59d6e1[_0x8b24('0x31')]);_0x36ff89[_0x8b24('0x36')]=_[_0x8b24('0x34')](_0x59d6e1['model'],qs[_0x8b24('0x37')](_0x140a50[_0x8b24('0x31')][_0x8b24('0x37')]));_0x36ff89['attributes']=_0x36ff89[_0x8b24('0x36')][_0x8b24('0x38')]?_0x36ff89[_0x8b24('0x36')]:_0x59d6e1[_0x8b24('0x35')];if(!_0x140a50[_0x8b24('0x31')][_0x8b24('0x39')](_0x8b24('0x3a'))){_0x36ff89[_0x8b24('0x3b')]=qs[_0x8b24('0x3b')](_0x140a50['query'][_0x8b24('0x3b')]);_0x36ff89[_0x8b24('0x1d')]=qs['offset'](_0x140a50[_0x8b24('0x31')][_0x8b24('0x1d')]);}_0x36ff89['order']=qs[_0x8b24('0x3c')](_0x140a50[_0x8b24('0x31')][_0x8b24('0x3c')]);_0x36ff89[_0x8b24('0x3d')]=qs['filters'](_[_0x8b24('0x3e')](_0x140a50[_0x8b24('0x31')],_0x59d6e1[_0x8b24('0x33')]),_0x14316c);if(_0x140a50[_0x8b24('0x31')][_0x8b24('0x3f')]){_0x36ff89[_0x8b24('0x3d')]=_['merge'](_0x36ff89[_0x8b24('0x3d')],{'$or':_[_0x8b24('0x2b')](_0x14316c,function(_0x2d70bc){if(_0x2d70bc[_0x8b24('0x2f')]!==_0x8b24('0x40')){var _0x3405b2={};_0x3405b2[_0x2d70bc[_0x8b24('0x28')]]={'$like':'%'+_0x140a50[_0x8b24('0x31')][_0x8b24('0x3f')]+'%'};return _0x3405b2;}})});}_0x36ff89=_[_0x8b24('0x41')]({},_0x36ff89,_0x140a50[_0x8b24('0x42')]);var _0x531425={'where':_0x36ff89[_0x8b24('0x3d')]};return db['FreshdeskAccount'][_0x8b24('0x43')](_0x531425)[_0x8b24('0x23')](function(_0x191905){_0xadbba0['count']=_0x191905;if(_0x140a50[_0x8b24('0x31')][_0x8b24('0x44')]){_0x36ff89[_0x8b24('0x45')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x8b24('0x46')](_0x36ff89);})['then'](function(_0x507021){_0xadbba0[_0x8b24('0x47')]=_0x507021;return _0xadbba0;})['then'](respondWithFilteredResult(_0x5d3958,_0x36ff89))['catch'](handleError(_0x5d3958,null));};exports[_0x8b24('0x48')]=function(_0xd3f68,_0x3ee117){var _0x3c6dc2={'raw':![],'where':{'id':_0xd3f68[_0x8b24('0x49')]['id']}},_0x44a734={};_0x44a734[_0x8b24('0x35')]=_['keys'](db['FreshdeskAccount'][_0x8b24('0x2d')]);_0x44a734[_0x8b24('0x31')]=_[_0x8b24('0x32')](_0xd3f68[_0x8b24('0x31')]);_0x44a734['filters']=_[_0x8b24('0x34')](_0x44a734[_0x8b24('0x35')],_0x44a734[_0x8b24('0x31')]);_0x3c6dc2['attributes']=_[_0x8b24('0x34')](_0x44a734['model'],qs[_0x8b24('0x37')](_0xd3f68[_0x8b24('0x31')]['fields']));_0x3c6dc2[_0x8b24('0x36')]=_0x3c6dc2[_0x8b24('0x36')][_0x8b24('0x38')]?_0x3c6dc2[_0x8b24('0x36')]:_0x44a734[_0x8b24('0x35')];if(_0xd3f68[_0x8b24('0x31')][_0x8b24('0x44')]){_0x3c6dc2[_0x8b24('0x45')]=[{'all':!![]}];}_0x3c6dc2=_[_0x8b24('0x41')]({},_0x3c6dc2,_0xd3f68[_0x8b24('0x42')]);return db[_0x8b24('0x2c')][_0x8b24('0x4a')](_0x3c6dc2)['then'](handleEntityNotFound(_0x3ee117,null))[_0x8b24('0x23')](respondWithResult(_0x3ee117,null))['catch'](handleError(_0x3ee117,null));};exports[_0x8b24('0x4b')]=function(_0x43cd46,_0x4f9a82){return db['FreshdeskAccount'][_0x8b24('0x4b')](_0x43cd46[_0x8b24('0x4c')],{})[_0x8b24('0x23')](respondWithResult(_0x4f9a82,0xc9))[_0x8b24('0x4d')](handleError(_0x4f9a82,null));};exports[_0x8b24('0x22')]=function(_0x22619e,_0x3d0d0b){if(_0x22619e[_0x8b24('0x4c')]['id']){delete _0x22619e['body']['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x22619e[_0x8b24('0x49')]['id']}})['then'](handleEntityNotFound(_0x3d0d0b,null))[_0x8b24('0x23')](saveUpdates(_0x22619e[_0x8b24('0x4c')],null))[_0x8b24('0x23')](respondWithResult(_0x3d0d0b,null))[_0x8b24('0x4d')](handleError(_0x3d0d0b,null));};exports['destroy']=function(_0x3bc90a,_0x3df397){return db[_0x8b24('0x2c')][_0x8b24('0x4a')]({'where':{'id':_0x3bc90a[_0x8b24('0x49')]['id']}})[_0x8b24('0x23')](handleEntityNotFound(_0x3df397,null))[_0x8b24('0x23')](removeEntity(_0x3df397,null))[_0x8b24('0x4d')](handleError(_0x3df397,null));};exports[_0x8b24('0x4e')]=function(_0x2a03fc,_0x229377,_0x1f4882){var _0x12b0ea={};var _0x437919={};var _0x1b7687;var _0x19bf6f;return db[_0x8b24('0x2c')]['findOne']({'where':{'id':_0x2a03fc[_0x8b24('0x49')]['id']}})[_0x8b24('0x23')](handleEntityNotFound(_0x229377,null))[_0x8b24('0x23')](function(_0x3dcec6){if(_0x3dcec6){_0x1b7687=_0x3dcec6;_0x437919['model']=_[_0x8b24('0x32')](db[_0x8b24('0x4f')][_0x8b24('0x2d')]);_0x437919[_0x8b24('0x31')]=_[_0x8b24('0x32')](_0x2a03fc[_0x8b24('0x31')]);_0x437919[_0x8b24('0x33')]=_[_0x8b24('0x34')](_0x437919[_0x8b24('0x35')],_0x437919[_0x8b24('0x31')]);_0x12b0ea[_0x8b24('0x36')]=_[_0x8b24('0x34')](_0x437919[_0x8b24('0x35')],qs[_0x8b24('0x37')](_0x2a03fc[_0x8b24('0x31')][_0x8b24('0x37')]));_0x12b0ea['attributes']=_0x12b0ea['attributes']['length']?_0x12b0ea[_0x8b24('0x36')]:_0x437919['model'];_0x12b0ea['order']=qs[_0x8b24('0x3c')](_0x2a03fc[_0x8b24('0x31')]['sort']);_0x12b0ea[_0x8b24('0x3d')]=qs[_0x8b24('0x33')](_[_0x8b24('0x3e')](_0x2a03fc[_0x8b24('0x31')],_0x437919[_0x8b24('0x33')]));if(_0x2a03fc[_0x8b24('0x31')][_0x8b24('0x3f')]){_0x12b0ea['where']=_[_0x8b24('0x41')](_0x12b0ea[_0x8b24('0x3d')],{'$or':_[_0x8b24('0x2b')](_0x12b0ea['attributes'],function(_0x4dd8cc){var _0x2abfed={};_0x2abfed[_0x4dd8cc]={'$like':'%'+_0x2a03fc[_0x8b24('0x31')][_0x8b24('0x3f')]+'%'};return _0x2abfed;})});}_0x12b0ea=_['merge']({},_0x12b0ea,_0x2a03fc[_0x8b24('0x42')]);return _0x1b7687['getConfigurations'](_0x12b0ea);}})[_0x8b24('0x23')](function(_0x402ec9){if(_0x402ec9){_0x19bf6f=_0x402ec9[_0x8b24('0x38')];if(!_0x2a03fc[_0x8b24('0x31')][_0x8b24('0x39')]('nolimit')){_0x12b0ea[_0x8b24('0x3b')]=qs[_0x8b24('0x3b')](_0x2a03fc[_0x8b24('0x31')][_0x8b24('0x3b')]);_0x12b0ea[_0x8b24('0x1d')]=qs['offset'](_0x2a03fc['query'][_0x8b24('0x1d')]);}return _0x1b7687[_0x8b24('0x4e')](_0x12b0ea);}})[_0x8b24('0x23')](function(_0x568530){if(_0x568530){return _0x568530?{'count':_0x19bf6f,'rows':_0x568530}:null;}})[_0x8b24('0x23')](respondWithResult(_0x229377,null))[_0x8b24('0x4d')](handleError(_0x229377,null));};exports['addConfiguration']=function(_0x4ecc6c,_0x77e133,_0x2d54ba){if(_0x4ecc6c[_0x8b24('0x4c')]['id']){delete _0x4ecc6c[_0x8b24('0x4c')]['id'];}return db[_0x8b24('0x2c')][_0x8b24('0x50')]({'where':{'id':_0x4ecc6c[_0x8b24('0x49')]['id']}})[_0x8b24('0x23')](handleEntityNotFound(_0x77e133,null))[_0x8b24('0x23')](function(_0x5afbc9){if(_0x5afbc9){_0x4ecc6c[_0x8b24('0x4c')][_0x8b24('0x51')]=_0x5afbc9['id'];_0x4ecc6c[_0x8b24('0x4c')][_0x8b24('0x52')]=integrations[_0x8b24('0x53')](_0x4ecc6c['body']['channel'],_0x4ecc6c[_0x8b24('0x4c')][_0x8b24('0x2f')]);_0x4ecc6c['body'][_0x8b24('0x54')]=integrations['getDescriptions'](_0x4ecc6c[_0x8b24('0x4c')]['channel'],_0x4ecc6c['body'][_0x8b24('0x2f')]);return db[_0x8b24('0x4f')]['create'](_0x4ecc6c[_0x8b24('0x4c')],{'include':[{'model':db['FreshdeskField'],'as':_0x8b24('0x52')},{'model':db['FreshdeskField'],'as':_0x8b24('0x54')}]});}return null;})[_0x8b24('0x23')](respondWithResult(_0x77e133,null))[_0x8b24('0x4d')](handleError(_0x77e133,null));};exports[_0x8b24('0x55')]=function(_0x57bedb,_0x80db9,_0x3abc65){var _0x304b57='';return db[_0x8b24('0x2c')]['findOne']({'where':{'id':_0x57bedb[_0x8b24('0x49')]['id']},'attributes':['id',_0x8b24('0x56'),_0x8b24('0x57')]})[_0x8b24('0x23')](handleEntityNotFound(_0x80db9,null))['then'](function(_0x525617){if(_0x525617){_0x304b57=_0x525617['remoteUri'];var _0x346fac=_0x304b57[_0x8b24('0x58')](-0x1);if(_0x346fac==='/'){_0x304b57=_0x304b57[_0x8b24('0x59')](0x0,_0x304b57[_0x8b24('0x5a')](_0x346fac));}return rp({'method':_0x8b24('0x5b'),'uri':util[_0x8b24('0x5c')]('%s/%s',_0x304b57,_0x8b24('0x5d')),'headers':{'Authorization':util['format'](_0x8b24('0x5e'),new Buffer(util[_0x8b24('0x5c')](_0x8b24('0x5f'),_0x525617[_0x8b24('0x57')]))[_0x8b24('0x60')](_0x8b24('0x61')))},'json':!![]});}})[_0x8b24('0x23')](function(_0x5078c7){if(_0x5078c7){var _0x4d86c8=[_0x8b24('0x62'),'subject',_0x8b24('0x63'),'description',_0x8b24('0x1a'),_0x8b24('0x64'),_0x8b24('0x65'),_0x8b24('0x66'),_0x8b24('0x67'),_0x8b24('0x65'),_0x8b24('0x68')];_[_0x8b24('0x69')](_0x5078c7,function(_0x1bad3c){return _0x4d86c8[_0x8b24('0x6a')](_0x1bad3c[_0x8b24('0x28')])||!_0x1bad3c[_0x8b24('0x6b')]&&_0x1bad3c[_0x8b24('0x2f')]!==_0x8b24('0x6c')&&_0x1bad3c[_0x8b24('0x2f')]!==_0x8b24('0x6d');});return{'count':_0x5078c7[_0x8b24('0x38')],'rows':_['map'](_0x5078c7,function(_0x41ee80){return{'id':_0x41ee80['name'],'name':_0x41ee80[_0x8b24('0x6e')],'custom':!_0x41ee80[_0x8b24('0x6b')],'options':_0x41ee80[_0x8b24('0x6f')]?_[_0x8b24('0x2b')](_0x41ee80[_0x8b24('0x6f')],function(_0x1cd82d){return{'name':_[_0x8b24('0x70')](_0x1cd82d),'value':_0x1cd82d};}):[]};})};}})[_0x8b24('0x23')](respondWithResult(_0x80db9,null))['catch'](function(_0x4fd50a){var _0x169054=_0x57bedb[_0x8b24('0x31')]['test']?0x1f4:_0x4fd50a['statusCode']||0x1f4;logger[_0x8b24('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x8b24('0x55'),_0x169054,JSON['stringify'](_0x4fd50a));delete _0x4fd50a[_0x8b24('0x28')];if(_0x169054===0x191){_0x169054=0x190;}_0x80db9[_0x8b24('0x1a')](_0x169054)[_0x8b24('0x29')](_0x57bedb[_0x8b24('0x31')][_0x8b24('0x71')]?{'message':_0x8b24('0x72'),'statusCode':_0x4fd50a['statusCode']}:_0x4fd50a);});}; \ No newline at end of file +var _0xb01a=['model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','toString','base64','requester','subject','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type'];(function(_0x4f918e,_0xcd500e){var _0x15ee0c=function(_0x1a2fb2){while(--_0x1a2fb2){_0x4f918e['push'](_0x4f918e['shift']());}};_0x15ee0c(++_0xcd500e);}(_0xb01a,0x1a1));var _0xab01=function(_0x141cdc,_0xa038e9){_0x141cdc=_0x141cdc-0x0;var _0x2d7d88=_0xb01a[_0x141cdc];return _0x2d7d88;};'use strict';var emlformat=require(_0xab01('0x0'));var rimraf=require(_0xab01('0x1'));var zipdir=require(_0xab01('0x2'));var jsonpatch=require(_0xab01('0x3'));var rp=require(_0xab01('0x4'));var moment=require(_0xab01('0x5'));var BPromise=require(_0xab01('0x6'));var Mustache=require(_0xab01('0x7'));var util=require(_0xab01('0x8'));var path=require(_0xab01('0x9'));var sox=require(_0xab01('0xa'));var csv=require(_0xab01('0xb'));var ejs=require(_0xab01('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab01('0xd'));var squel=require(_0xab01('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xab01('0xf'));var toCsv=require(_0xab01('0xb'));var querystring=require('querystring');var Papa=require(_0xab01('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xab01('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab01('0x12'));var logger=require(_0xab01('0x13'))('api');var utils=require(_0xab01('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xab01('0x15'))['db'];var integrations=require(_0xab01('0x16'));function respondWithStatusCode(_0x1ededa,_0xe9d23c){_0xe9d23c=_0xe9d23c||0xcc;return function(_0x449402){if(_0x449402){return _0x1ededa[_0xab01('0x17')](_0xe9d23c);}return _0x1ededa[_0xab01('0x18')](_0xe9d23c)[_0xab01('0x19')]();};}function respondWithResult(_0x509ceb,_0x4812c6){_0x4812c6=_0x4812c6||0xc8;return function(_0x512124){if(_0x512124){return _0x509ceb['status'](_0x4812c6)[_0xab01('0x1a')](_0x512124);}};}function respondWithFilteredResult(_0x4c0557,_0x2bfa8a){return function(_0x2d9c23){if(_0x2d9c23){var _0x26af11=typeof _0x2bfa8a[_0xab01('0x1b')]==='undefined'&&typeof _0x2bfa8a[_0xab01('0x1c')]==='undefined';var _0x2adbe5=_0x2d9c23[_0xab01('0x1d')];var _0x47e994=_0x26af11?0x0:_0x2bfa8a['offset'];var _0x22dd53=_0x26af11?_0x2d9c23[_0xab01('0x1d')]:_0x2bfa8a[_0xab01('0x1b')]+_0x2bfa8a[_0xab01('0x1c')];var _0x290d30;if(_0x22dd53>=_0x2adbe5){_0x22dd53=_0x2adbe5;_0x290d30=0xc8;}else{_0x290d30=0xce;}_0x4c0557[_0xab01('0x18')](_0x290d30);return _0x4c0557[_0xab01('0x1e')](_0xab01('0x1f'),_0x47e994+'-'+_0x22dd53+'/'+_0x2adbe5)[_0xab01('0x1a')](_0x2d9c23);}return null;};}function patchUpdates(_0x331daf){return function(_0x50d0bd){try{jsonpatch[_0xab01('0x20')](_0x50d0bd,_0x331daf,!![]);}catch(_0x80802a){return BPromise[_0xab01('0x21')](_0x80802a);}return _0x50d0bd[_0xab01('0x22')]();};}function saveUpdates(_0x405c93,_0x180344){return function(_0x380176){if(_0x380176){return _0x380176[_0xab01('0x23')](_0x405c93)['then'](function(_0x3fba2e){return _0x3fba2e;});}return null;};}function removeEntity(_0x152d5e,_0x27b430){return function(_0x343ae6){if(_0x343ae6){return _0x343ae6[_0xab01('0x24')]()[_0xab01('0x25')](function(){_0x152d5e[_0xab01('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1efebe,_0x16a719){return function(_0x2758d){if(!_0x2758d){_0x1efebe[_0xab01('0x17')](0x194);}return _0x2758d;};}function handleError(_0x27e549,_0x46088d){_0x46088d=_0x46088d||0x1f4;return function(_0x46af29){logger['error'](_0x46af29[_0xab01('0x26')]);if(_0x46af29[_0xab01('0x27')]){delete _0x46af29[_0xab01('0x27')];}_0x27e549[_0xab01('0x18')](_0x46088d)[_0xab01('0x28')](_0x46af29);};}exports[_0xab01('0x29')]=function(_0x51a927,_0x3c2474){var _0x209e10={},_0x4a22c0={},_0x65afdd={'count':0x0,'rows':[]};var _0x16cc49=_[_0xab01('0x2a')](db[_0xab01('0x2b')][_0xab01('0x2c')],function(_0x18b4de){return{'name':_0x18b4de[_0xab01('0x2d')],'type':_0x18b4de[_0xab01('0x2e')]['key']};});_0x4a22c0[_0xab01('0x2f')]=_[_0xab01('0x2a')](_0x16cc49,'name');_0x4a22c0[_0xab01('0x30')]=_[_0xab01('0x31')](_0x51a927[_0xab01('0x30')]);_0x4a22c0[_0xab01('0x32')]=_[_0xab01('0x33')](_0x4a22c0[_0xab01('0x2f')],_0x4a22c0['query']);_0x209e10[_0xab01('0x34')]=_[_0xab01('0x33')](_0x4a22c0[_0xab01('0x2f')],qs[_0xab01('0x35')](_0x51a927[_0xab01('0x30')][_0xab01('0x35')]));_0x209e10[_0xab01('0x34')]=_0x209e10['attributes']['length']?_0x209e10['attributes']:_0x4a22c0[_0xab01('0x2f')];if(!_0x51a927[_0xab01('0x30')][_0xab01('0x36')](_0xab01('0x37'))){_0x209e10[_0xab01('0x1c')]=qs[_0xab01('0x1c')](_0x51a927[_0xab01('0x30')][_0xab01('0x1c')]);_0x209e10[_0xab01('0x1b')]=qs[_0xab01('0x1b')](_0x51a927[_0xab01('0x30')][_0xab01('0x1b')]);}_0x209e10[_0xab01('0x38')]=qs[_0xab01('0x39')](_0x51a927[_0xab01('0x30')][_0xab01('0x39')]);_0x209e10['where']=qs['filters'](_[_0xab01('0x3a')](_0x51a927[_0xab01('0x30')],_0x4a22c0['filters']),_0x16cc49);if(_0x51a927[_0xab01('0x30')][_0xab01('0x3b')]){_0x209e10[_0xab01('0x3c')]=_['merge'](_0x209e10[_0xab01('0x3c')],{'$or':_['map'](_0x16cc49,function(_0x535b32){if(_0x535b32[_0xab01('0x2e')]!==_0xab01('0x3d')){var _0x595017={};_0x595017[_0x535b32[_0xab01('0x27')]]={'$like':'%'+_0x51a927[_0xab01('0x30')]['filter']+'%'};return _0x595017;}})});}_0x209e10=_[_0xab01('0x3e')]({},_0x209e10,_0x51a927[_0xab01('0x3f')]);var _0x265ec9={'where':_0x209e10[_0xab01('0x3c')]};return db[_0xab01('0x2b')][_0xab01('0x1d')](_0x265ec9)['then'](function(_0x109ad6){_0x65afdd[_0xab01('0x1d')]=_0x109ad6;if(_0x51a927[_0xab01('0x30')][_0xab01('0x40')]){_0x209e10[_0xab01('0x41')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x209e10);})['then'](function(_0x3132d5){_0x65afdd[_0xab01('0x42')]=_0x3132d5;return _0x65afdd;})['then'](respondWithFilteredResult(_0x3c2474,_0x209e10))[_0xab01('0x43')](handleError(_0x3c2474,null));};exports[_0xab01('0x44')]=function(_0x1df4d9,_0x7d039e){var _0x3ef323={'raw':![],'where':{'id':_0x1df4d9[_0xab01('0x45')]['id']}},_0x1cb057={};_0x1cb057[_0xab01('0x2f')]=_[_0xab01('0x31')](db[_0xab01('0x2b')][_0xab01('0x2c')]);_0x1cb057[_0xab01('0x30')]=_[_0xab01('0x31')](_0x1df4d9[_0xab01('0x30')]);_0x1cb057[_0xab01('0x32')]=_[_0xab01('0x33')](_0x1cb057[_0xab01('0x2f')],_0x1cb057['query']);_0x3ef323['attributes']=_[_0xab01('0x33')](_0x1cb057[_0xab01('0x2f')],qs[_0xab01('0x35')](_0x1df4d9[_0xab01('0x30')][_0xab01('0x35')]));_0x3ef323[_0xab01('0x34')]=_0x3ef323['attributes'][_0xab01('0x46')]?_0x3ef323[_0xab01('0x34')]:_0x1cb057['model'];if(_0x1df4d9[_0xab01('0x30')][_0xab01('0x40')]){_0x3ef323[_0xab01('0x41')]=[{'all':!![]}];}_0x3ef323=_['merge']({},_0x3ef323,_0x1df4d9[_0xab01('0x3f')]);return db[_0xab01('0x2b')][_0xab01('0x47')](_0x3ef323)[_0xab01('0x25')](handleEntityNotFound(_0x7d039e,null))[_0xab01('0x25')](respondWithResult(_0x7d039e,null))['catch'](handleError(_0x7d039e,null));};exports[_0xab01('0x48')]=function(_0x5e5847,_0x79fa9f){return db[_0xab01('0x2b')][_0xab01('0x48')](_0x5e5847['body'],{})[_0xab01('0x25')](respondWithResult(_0x79fa9f,0xc9))[_0xab01('0x43')](handleError(_0x79fa9f,null));};exports[_0xab01('0x23')]=function(_0x1b11c4,_0x5e4316){if(_0x1b11c4[_0xab01('0x49')]['id']){delete _0x1b11c4[_0xab01('0x49')]['id'];}return db[_0xab01('0x2b')][_0xab01('0x47')]({'where':{'id':_0x1b11c4[_0xab01('0x45')]['id']}})['then'](handleEntityNotFound(_0x5e4316,null))[_0xab01('0x25')](saveUpdates(_0x1b11c4[_0xab01('0x49')],null))['then'](respondWithResult(_0x5e4316,null))[_0xab01('0x43')](handleError(_0x5e4316,null));};exports[_0xab01('0x24')]=function(_0x182d45,_0x1ccdbd){return db[_0xab01('0x2b')][_0xab01('0x47')]({'where':{'id':_0x182d45[_0xab01('0x45')]['id']}})['then'](handleEntityNotFound(_0x1ccdbd,null))['then'](removeEntity(_0x1ccdbd,null))[_0xab01('0x43')](handleError(_0x1ccdbd,null));};exports[_0xab01('0x4a')]=function(_0x1a0a14,_0x35ac7b,_0x4de07a){var _0x4d181a={};var _0x7eec31={};var _0x460fb7;var _0x1f1b6f;return db[_0xab01('0x2b')][_0xab01('0x4b')]({'where':{'id':_0x1a0a14[_0xab01('0x45')]['id']}})[_0xab01('0x25')](handleEntityNotFound(_0x35ac7b,null))['then'](function(_0x4f2af6){if(_0x4f2af6){_0x460fb7=_0x4f2af6;_0x7eec31[_0xab01('0x2f')]=_[_0xab01('0x31')](db[_0xab01('0x4c')][_0xab01('0x2c')]);_0x7eec31[_0xab01('0x30')]=_['keys'](_0x1a0a14['query']);_0x7eec31['filters']=_[_0xab01('0x33')](_0x7eec31[_0xab01('0x2f')],_0x7eec31[_0xab01('0x30')]);_0x4d181a[_0xab01('0x34')]=_[_0xab01('0x33')](_0x7eec31[_0xab01('0x2f')],qs[_0xab01('0x35')](_0x1a0a14[_0xab01('0x30')]['fields']));_0x4d181a[_0xab01('0x34')]=_0x4d181a[_0xab01('0x34')][_0xab01('0x46')]?_0x4d181a[_0xab01('0x34')]:_0x7eec31[_0xab01('0x2f')];_0x4d181a[_0xab01('0x38')]=qs[_0xab01('0x39')](_0x1a0a14[_0xab01('0x30')][_0xab01('0x39')]);_0x4d181a[_0xab01('0x3c')]=qs[_0xab01('0x32')](_[_0xab01('0x3a')](_0x1a0a14[_0xab01('0x30')],_0x7eec31[_0xab01('0x32')]));if(_0x1a0a14[_0xab01('0x30')][_0xab01('0x3b')]){_0x4d181a[_0xab01('0x3c')]=_['merge'](_0x4d181a[_0xab01('0x3c')],{'$or':_[_0xab01('0x2a')](_0x4d181a['attributes'],function(_0xacd26f){var _0x40a3ab={};_0x40a3ab[_0xacd26f]={'$like':'%'+_0x1a0a14[_0xab01('0x30')][_0xab01('0x3b')]+'%'};return _0x40a3ab;})});}_0x4d181a=_[_0xab01('0x3e')]({},_0x4d181a,_0x1a0a14[_0xab01('0x3f')]);return _0x460fb7['getConfigurations'](_0x4d181a);}})[_0xab01('0x25')](function(_0x96867e){if(_0x96867e){_0x1f1b6f=_0x96867e['length'];if(!_0x1a0a14['query']['hasOwnProperty'](_0xab01('0x37'))){_0x4d181a[_0xab01('0x1c')]=qs[_0xab01('0x1c')](_0x1a0a14[_0xab01('0x30')][_0xab01('0x1c')]);_0x4d181a['offset']=qs[_0xab01('0x1b')](_0x1a0a14[_0xab01('0x30')][_0xab01('0x1b')]);}return _0x460fb7[_0xab01('0x4a')](_0x4d181a);}})[_0xab01('0x25')](function(_0x117477){if(_0x117477){return _0x117477?{'count':_0x1f1b6f,'rows':_0x117477}:null;}})[_0xab01('0x25')](respondWithResult(_0x35ac7b,null))[_0xab01('0x43')](handleError(_0x35ac7b,null));};exports[_0xab01('0x4d')]=function(_0x4a260b,_0x9f3dba,_0x3a5f47){if(_0x4a260b['body']['id']){delete _0x4a260b[_0xab01('0x49')]['id'];}return db[_0xab01('0x2b')][_0xab01('0x4b')]({'where':{'id':_0x4a260b[_0xab01('0x45')]['id']}})[_0xab01('0x25')](handleEntityNotFound(_0x9f3dba,null))[_0xab01('0x25')](function(_0x5505da){if(_0x5505da){_0x4a260b[_0xab01('0x49')][_0xab01('0x4e')]=_0x5505da['id'];_0x4a260b[_0xab01('0x49')][_0xab01('0x4f')]=integrations[_0xab01('0x50')](_0x4a260b[_0xab01('0x49')]['channel'],_0x4a260b[_0xab01('0x49')][_0xab01('0x2e')]);_0x4a260b['body'][_0xab01('0x51')]=integrations['getDescriptions'](_0x4a260b['body'][_0xab01('0x52')],_0x4a260b['body']['type']);return db[_0xab01('0x4c')]['create'](_0x4a260b[_0xab01('0x49')],{'include':[{'model':db[_0xab01('0x53')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0xab01('0x25')](respondWithResult(_0x9f3dba,null))[_0xab01('0x43')](handleError(_0x9f3dba,null));};exports[_0xab01('0x54')]=function(_0x38e126,_0x15e56b,_0x445263){var _0x1cf09f='';return db[_0xab01('0x2b')]['findOne']({'where':{'id':_0x38e126['params']['id']},'attributes':['id',_0xab01('0x55'),_0xab01('0x56')]})[_0xab01('0x25')](handleEntityNotFound(_0x15e56b,null))[_0xab01('0x25')](function(_0x1a9904){if(_0x1a9904){_0x1cf09f=_0x1a9904['remoteUri'];var _0x46ac1e=_0x1cf09f[_0xab01('0x57')](-0x1);if(_0x46ac1e==='/'){_0x1cf09f=_0x1cf09f[_0xab01('0x58')](0x0,_0x1cf09f[_0xab01('0x59')](_0x46ac1e));}return rp({'method':'GET','uri':util['format'](_0xab01('0x5a'),_0x1cf09f,_0xab01('0x5b')),'headers':{'Authorization':util[_0xab01('0x5c')](_0xab01('0x5d'),new Buffer(util[_0xab01('0x5c')]('%s:X',_0x1a9904[_0xab01('0x56')]))[_0xab01('0x5e')](_0xab01('0x5f')))},'json':!![]});}})[_0xab01('0x25')](function(_0xb682dc){if(_0xb682dc){var _0x16d2ee=[_0xab01('0x60'),_0xab01('0x61'),'agent',_0xab01('0x62'),_0xab01('0x18'),_0xab01('0x63'),_0xab01('0x64'),_0xab01('0x65'),_0xab01('0x66'),_0xab01('0x64'),_0xab01('0x67')];_[_0xab01('0x68')](_0xb682dc,function(_0x5db277){return _0x16d2ee[_0xab01('0x69')](_0x5db277[_0xab01('0x27')])||!_0x5db277[_0xab01('0x6a')]&&_0x5db277['type']!==_0xab01('0x6b')&&_0x5db277['type']!==_0xab01('0x6c');});return{'count':_0xb682dc['length'],'rows':_[_0xab01('0x2a')](_0xb682dc,function(_0x3ad39c){return{'id':_0x3ad39c[_0xab01('0x27')],'name':_0x3ad39c['label'],'custom':!_0x3ad39c[_0xab01('0x6a')],'options':_0x3ad39c[_0xab01('0x6d')]?_[_0xab01('0x2a')](_0x3ad39c[_0xab01('0x6d')],function(_0x584a0b){return{'name':_[_0xab01('0x6e')](_0x584a0b),'value':_0x584a0b};}):[]};})};}})[_0xab01('0x25')](respondWithResult(_0x15e56b,null))[_0xab01('0x43')](function(_0x389b29){var _0x3ed1a8=_0x38e126[_0xab01('0x30')][_0xab01('0x6f')]?0x1f4:_0x389b29['statusCode']||0x1f4;logger[_0xab01('0x70')](_0xab01('0x71'),_0xab01('0x54'),_0x3ed1a8,JSON[_0xab01('0x72')](_0x389b29));delete _0x389b29['name'];if(_0x3ed1a8===0x191){_0x3ed1a8=0x190;}_0x15e56b[_0xab01('0x18')](_0x3ed1a8)['send'](_0x38e126[_0xab01('0x30')][_0xab01('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0x389b29[_0xab01('0x73')]}:_0x389b29);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index ba9d0a9..b9860ec 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 _0xde0c=['bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash','util','api','moment'];(function(_0xf62bd,_0x5307af){var _0x5577ed=function(_0x596bcc){while(--_0x596bcc){_0xf62bd['push'](_0xf62bd['shift']());}};_0x5577ed(++_0x5307af);}(_0xde0c,0x14e));var _0xcde0=function(_0x3e026c,_0x1cfed8){_0x3e026c=_0x3e026c-0x0;var _0x158342=_0xde0c[_0x3e026c];return _0x158342;};'use strict';var _=require(_0xcde0('0x0'));var util=require(_0xcde0('0x1'));var logger=require('../../config/logger')(_0xcde0('0x2'));var moment=require(_0xcde0('0x3'));var BPromise=require(_0xcde0('0x4'));var rp=require(_0xcde0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcde0('0x6'));var config=require(_0xcde0('0x7'));var attributes=require(_0xcde0('0x8'));var integrations=require(_0xcde0('0x9'));module[_0xcde0('0xa')]=function(_0x599594,_0x4145df){return _0x599594[_0xcde0('0xb')](_0xcde0('0xc'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b4d=['rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x24bbd5,_0x34a7c4){var _0x8fb737=function(_0xda751f){while(--_0xda751f){_0x24bbd5['push'](_0x24bbd5['shift']());}};_0x8fb737(++_0x34a7c4);}(_0x1b4d,0x10e));var _0xd1b4=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x1b4d[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xd1b4('0x0'));var util=require(_0xd1b4('0x1'));var logger=require(_0xd1b4('0x2'))(_0xd1b4('0x3'));var moment=require(_0xd1b4('0x4'));var BPromise=require('bluebird');var rp=require(_0xd1b4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1b4('0x6'));var config=require(_0xd1b4('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xd1b4('0x8'));module[_0xd1b4('0x9')]=function(_0x3566d3,_0x4f209a){return _0x3566d3[_0xd1b4('0xa')]('FreshdeskAccount',attributes,{'tableName':_0xd1b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 0d60877..faa4579 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 _0x4d39=['catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','model','map','stringify','find','ShowFreshdeskAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0xb03f9,_0x588391){var _0x3ec30a=function(_0x3ef5e7){while(--_0x3ef5e7){_0xb03f9['push'](_0xb03f9['shift']());}};_0x3ec30a(++_0x588391);}(_0x4d39,0x18f));var _0x94d3=function(_0x350855,_0x33a744){_0x350855=_0x350855-0x0;var _0x50c972=_0x4d39[_0x350855];return _0x50c972;};'use strict';var _=require('lodash');var util=require(_0x94d3('0x0'));var moment=require('moment');var BPromise=require(_0x94d3('0x1'));var rs=require(_0x94d3('0x2'));var fs=require('fs');var Redis=require(_0x94d3('0x3'));var db=require(_0x94d3('0x4'))['db'];var utils=require(_0x94d3('0x5'));var logger=require(_0x94d3('0x6'))(_0x94d3('0x7'));var config=require(_0x94d3('0x8'));var jayson=require(_0x94d3('0x9'));var client=jayson[_0x94d3('0xa')][_0x94d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5768bd,_0x3510fc,_0x1f4dff){return new BPromise(function(_0x847975,_0x28e4c1){return client['request'](_0x5768bd,_0x1f4dff)[_0x94d3('0xc')](function(_0x5ae8eb){logger[_0x94d3('0xd')](_0x94d3('0xe'),_0x3510fc,'request\x20sent');logger[_0x94d3('0xf')](_0x94d3('0x10'),_0x3510fc,_0x94d3('0x11'),JSON['stringify'](_0x5ae8eb));if(_0x5ae8eb['error']){if(_0x5ae8eb[_0x94d3('0x12')][_0x94d3('0x13')]===0x1f4){logger[_0x94d3('0x12')](_0x94d3('0xe'),_0x3510fc,_0x5ae8eb[_0x94d3('0x12')][_0x94d3('0x14')]);return _0x28e4c1(_0x5ae8eb[_0x94d3('0x12')][_0x94d3('0x14')]);}logger[_0x94d3('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x3510fc,_0x5ae8eb[_0x94d3('0x12')][_0x94d3('0x14')]);return _0x847975(_0x5ae8eb[_0x94d3('0x12')][_0x94d3('0x14')]);}else{logger['info'](_0x94d3('0xe'),_0x3510fc,_0x94d3('0x11'));_0x847975(_0x5ae8eb['result'][_0x94d3('0x14')]);}})[_0x94d3('0x15')](function(_0x534d4e){logger['error'](_0x94d3('0xe'),_0x3510fc,_0x534d4e);_0x28e4c1(_0x534d4e);});});}exports[_0x94d3('0x16')]=function(_0x4978ad){var _0x5b9431=this;return new Promise(function(_0x2d1633,_0x2ffd21){return db[_0x94d3('0x17')][_0x94d3('0x18')]({'raw':_0x4978ad['options']?_0x4978ad[_0x94d3('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4978ad[_0x94d3('0x19')]?_0x4978ad['options'][_0x94d3('0x1a')]||null:null,'attributes':_0x4978ad[_0x94d3('0x19')]?_0x4978ad['options'][_0x94d3('0x1b')]||null:null,'limit':_0x4978ad[_0x94d3('0x19')]?_0x4978ad[_0x94d3('0x19')][_0x94d3('0x1c')]||null:null,'include':_0x4978ad['options']?_0x4978ad[_0x94d3('0x19')][_0x94d3('0x1d')]?_['map'](_0x4978ad[_0x94d3('0x19')]['include'],function(_0x42f355){return{'model':db[_0x42f355[_0x94d3('0x1e')]],'as':_0x42f355['as'],'attributes':_0x42f355[_0x94d3('0x1b')],'include':_0x42f355[_0x94d3('0x1d')]?_[_0x94d3('0x1f')](_0x42f355['include'],function(_0x32d2b2){return{'model':db[_0x32d2b2[_0x94d3('0x1e')]],'as':_0x32d2b2['as'],'attributes':_0x32d2b2['attributes'],'include':_0x32d2b2[_0x94d3('0x1d')]?_['map'](_0x32d2b2[_0x94d3('0x1d')],function(_0x30b57b){return{'model':db[_0x30b57b['model']],'as':_0x30b57b['as'],'attributes':_0x30b57b[_0x94d3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x94d3('0xc')](function(_0x483b95){logger['info'](_0x94d3('0x16'),_0x4978ad);logger[_0x94d3('0xf')](_0x94d3('0x16'),_0x4978ad,JSON[_0x94d3('0x20')](_0x483b95));_0x2d1633(_0x483b95);})[_0x94d3('0x15')](function(_0x46c488){logger[_0x94d3('0x12')](_0x94d3('0x16'),_0x46c488[_0x94d3('0x14')],_0x4978ad);_0x2ffd21(_0x5b9431['error'](0x1f4,_0x46c488[_0x94d3('0x14')]));});});};exports['ShowFreshdeskAccount']=function(_0xf29638){var _0x2ded5f=this;return new Promise(function(_0x3f04e4,_0x40a452){return db[_0x94d3('0x17')][_0x94d3('0x21')]({'raw':_0xf29638[_0x94d3('0x19')]?_0xf29638[_0x94d3('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xf29638['options']?_0xf29638[_0x94d3('0x19')][_0x94d3('0x1a')]||null:null,'attributes':_0xf29638[_0x94d3('0x19')]?_0xf29638['options']['attributes']||null:null,'include':_0xf29638[_0x94d3('0x19')]?_0xf29638['options']['include']?_[_0x94d3('0x1f')](_0xf29638[_0x94d3('0x19')][_0x94d3('0x1d')],function(_0x17b8f6){return{'model':db[_0x17b8f6[_0x94d3('0x1e')]],'as':_0x17b8f6['as'],'attributes':_0x17b8f6[_0x94d3('0x1b')],'include':_0x17b8f6[_0x94d3('0x1d')]?_[_0x94d3('0x1f')](_0x17b8f6['include'],function(_0x52dff1){return{'model':db[_0x52dff1[_0x94d3('0x1e')]],'as':_0x52dff1['as'],'attributes':_0x52dff1[_0x94d3('0x1b')],'include':_0x52dff1['include']?_[_0x94d3('0x1f')](_0x52dff1[_0x94d3('0x1d')],function(_0x1992b9){return{'model':db[_0x1992b9[_0x94d3('0x1e')]],'as':_0x1992b9['as'],'attributes':_0x1992b9[_0x94d3('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf44acf){logger['info']('ShowFreshdeskAccount',_0xf29638);logger['debug']('ShowFreshdeskAccount',_0xf29638,JSON[_0x94d3('0x20')](_0xf44acf));_0x3f04e4(_0xf44acf);})[_0x94d3('0x15')](function(_0x499928){logger[_0x94d3('0x12')](_0x94d3('0x22'),_0x499928[_0x94d3('0x14')],_0xf29638);_0x40a452(_0x2ded5f[_0x94d3('0x12')](0x1f4,_0x499928['message']));});});}; \ No newline at end of file +var _0x689c=['client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x689c,0x9e));var _0xc689=function(_0x510e2f,_0x17452d){_0x510e2f=_0x510e2f-0x0;var _0x561381=_0x689c[_0x510e2f];return _0x561381;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc689('0x0'));var BPromise=require(_0xc689('0x1'));var rs=require(_0xc689('0x2'));var fs=require('fs');var Redis=require(_0xc689('0x3'));var db=require(_0xc689('0x4'))['db'];var utils=require(_0xc689('0x5'));var logger=require('../../config/logger')(_0xc689('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc689('0x7')][_0xc689('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9f8a,_0xedb406,_0x2e7400){return new BPromise(function(_0x57f82f,_0x17ff9c){return client[_0xc689('0x9')](_0x2b9f8a,_0x2e7400)[_0xc689('0xa')](function(_0x4a6c06){logger[_0xc689('0xb')](_0xc689('0xc'),_0xedb406,_0xc689('0xd'));logger[_0xc689('0xe')](_0xc689('0xf'),_0xedb406,_0xc689('0xd'),JSON[_0xc689('0x10')](_0x4a6c06));if(_0x4a6c06[_0xc689('0x11')]){if(_0x4a6c06[_0xc689('0x11')][_0xc689('0x12')]===0x1f4){logger[_0xc689('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0xedb406,_0x4a6c06[_0xc689('0x11')]['message']);return _0x17ff9c(_0x4a6c06[_0xc689('0x11')][_0xc689('0x13')]);}logger[_0xc689('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0xedb406,_0x4a6c06[_0xc689('0x11')][_0xc689('0x13')]);return _0x57f82f(_0x4a6c06['error'][_0xc689('0x13')]);}else{logger[_0xc689('0xb')](_0xc689('0xc'),_0xedb406,_0xc689('0xd'));_0x57f82f(_0x4a6c06['result']['message']);}})[_0xc689('0x14')](function(_0x214ca0){logger[_0xc689('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0xedb406,_0x214ca0);_0x17ff9c(_0x214ca0);});});}exports['GetFreshdeskAccount']=function(_0x17a126){var _0x1edaef=this;return new Promise(function(_0xbbc8aa,_0x38665c){return db[_0xc689('0x15')][_0xc689('0x16')]({'raw':_0x17a126['options']?_0x17a126[_0xc689('0x17')][_0xc689('0x18')]===undefined?!![]:![]:!![],'where':_0x17a126['options']?_0x17a126['options']['where']||null:null,'attributes':_0x17a126['options']?_0x17a126['options'][_0xc689('0x19')]||null:null,'limit':_0x17a126[_0xc689('0x17')]?_0x17a126[_0xc689('0x17')][_0xc689('0x1a')]||null:null,'include':_0x17a126[_0xc689('0x17')]?_0x17a126[_0xc689('0x17')][_0xc689('0x1b')]?_[_0xc689('0x1c')](_0x17a126[_0xc689('0x17')][_0xc689('0x1b')],function(_0x8215e5){return{'model':db[_0x8215e5[_0xc689('0x1d')]],'as':_0x8215e5['as'],'attributes':_0x8215e5[_0xc689('0x19')],'include':_0x8215e5[_0xc689('0x1b')]?_[_0xc689('0x1c')](_0x8215e5[_0xc689('0x1b')],function(_0x3bca6d){return{'model':db[_0x3bca6d[_0xc689('0x1d')]],'as':_0x3bca6d['as'],'attributes':_0x3bca6d[_0xc689('0x19')],'include':_0x3bca6d[_0xc689('0x1b')]?_[_0xc689('0x1c')](_0x3bca6d[_0xc689('0x1b')],function(_0x47ab9e){return{'model':db[_0x47ab9e['model']],'as':_0x47ab9e['as'],'attributes':_0x47ab9e[_0xc689('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc689('0xa')](function(_0x35b570){logger[_0xc689('0xb')](_0xc689('0x1e'),_0x17a126);logger[_0xc689('0xe')]('GetFreshdeskAccount',_0x17a126,JSON[_0xc689('0x10')](_0x35b570));_0xbbc8aa(_0x35b570);})['catch'](function(_0x9c114d){logger['error'](_0xc689('0x1e'),_0x9c114d[_0xc689('0x13')],_0x17a126);_0x38665c(_0x1edaef['error'](0x1f4,_0x9c114d['message']));});});};exports[_0xc689('0x1f')]=function(_0x2ebacf){var _0x400272=this;return new Promise(function(_0x455b33,_0x6c7127){return db[_0xc689('0x15')][_0xc689('0x20')]({'raw':_0x2ebacf[_0xc689('0x17')]?_0x2ebacf['options'][_0xc689('0x18')]===undefined?!![]:![]:!![],'where':_0x2ebacf['options']?_0x2ebacf['options']['where']||null:null,'attributes':_0x2ebacf[_0xc689('0x17')]?_0x2ebacf[_0xc689('0x17')][_0xc689('0x19')]||null:null,'include':_0x2ebacf[_0xc689('0x17')]?_0x2ebacf[_0xc689('0x17')]['include']?_[_0xc689('0x1c')](_0x2ebacf[_0xc689('0x17')][_0xc689('0x1b')],function(_0x5bbbae){return{'model':db[_0x5bbbae[_0xc689('0x1d')]],'as':_0x5bbbae['as'],'attributes':_0x5bbbae[_0xc689('0x19')],'include':_0x5bbbae[_0xc689('0x1b')]?_[_0xc689('0x1c')](_0x5bbbae['include'],function(_0x1654aa){return{'model':db[_0x1654aa[_0xc689('0x1d')]],'as':_0x1654aa['as'],'attributes':_0x1654aa[_0xc689('0x19')],'include':_0x1654aa[_0xc689('0x1b')]?_['map'](_0x1654aa[_0xc689('0x1b')],function(_0x8a888e){return{'model':db[_0x8a888e['model']],'as':_0x8a888e['as'],'attributes':_0x8a888e[_0xc689('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc689('0xa')](function(_0x5ba2d1){logger['info']('ShowFreshdeskAccount',_0x2ebacf);logger['debug']('ShowFreshdeskAccount',_0x2ebacf,JSON[_0xc689('0x10')](_0x5ba2d1));_0x455b33(_0x5ba2d1);})[_0xc689('0x14')](function(_0x178aa8){logger[_0xc689('0x11')]('ShowFreshdeskAccount',_0x178aa8[_0xc689('0x13')],_0x2ebacf);_0x6c7127(_0x400272[_0xc689('0x11')](0x1f4,_0x178aa8['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 27f6b5d..fbd4b96 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 _0x452f=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','setTags','/:id','update','delete','destroy','exports','multer'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x452f,0x144));var _0xf452=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0x452f[_0x448f8];return _0xa73126;};'use strict';var multer=require(_0xf452('0x0'));var util=require(_0xf452('0x1'));var path=require(_0xf452('0x2'));var timeout=require(_0xf452('0x3'));var express=require(_0xf452('0x4'));var router=express[_0xf452('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf452('0x6'));var interaction=require(_0xf452('0x7'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0xf452('0x8')]('/',auth[_0xf452('0x9')](),controller[_0xf452('0xa')]);router[_0xf452('0x8')]('/:id',auth[_0xf452('0x9')](),controller['show']);router[_0xf452('0x8')](_0xf452('0xb'),auth[_0xf452('0x9')](),controller[_0xf452('0xc')]);router[_0xf452('0x8')](_0xf452('0xd'),auth['isAuthenticated'](),controller[_0xf452('0xe')]);router[_0xf452('0x8')](_0xf452('0xf'),auth[_0xf452('0x9')](),controller[_0xf452('0x10')]);router[_0xf452('0x8')](_0xf452('0x11'),auth[_0xf452('0x9')](),controller['getTags']);router[_0xf452('0x12')]('/',auth[_0xf452('0x9')](),controller['create']);router[_0xf452('0x12')]('/:id/tags',auth[_0xf452('0x9')](),controller[_0xf452('0x13')]);router['put'](_0xf452('0x14'),auth[_0xf452('0x9')](),controller[_0xf452('0x15')]);router[_0xf452('0x16')](_0xf452('0x14'),auth['isAuthenticated'](),controller[_0xf452('0x17')]);module[_0xf452('0x18')]=router; \ No newline at end of file +var _0xdc05=['destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','getFields','getSubjects','getDescriptions','/:id/tags','getTags','post','setTags','update','delete'];(function(_0x304636,_0x210e77){var _0x4beed5=function(_0x299b14){while(--_0x299b14){_0x304636['push'](_0x304636['shift']());}};_0x4beed5(++_0x210e77);}(_0xdc05,0x1e5));var _0x5dc0=function(_0x1b8846,_0x39625e){_0x1b8846=_0x1b8846-0x0;var _0x367251=_0xdc05[_0x1b8846];return _0x367251;};'use strict';var multer=require(_0x5dc0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5dc0('0x1'));var express=require(_0x5dc0('0x2'));var router=express[_0x5dc0('0x3')]();var fs_extra=require(_0x5dc0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5dc0('0x5'));var config=require(_0x5dc0('0x6'));var controller=require(_0x5dc0('0x7'));router[_0x5dc0('0x8')]('/',auth[_0x5dc0('0x9')](),controller[_0x5dc0('0xa')]);router[_0x5dc0('0x8')](_0x5dc0('0xb'),auth[_0x5dc0('0x9')](),controller['show']);router[_0x5dc0('0x8')]('/:id/fields',auth[_0x5dc0('0x9')](),controller[_0x5dc0('0xc')]);router['get']('/:id/subjects',auth[_0x5dc0('0x9')](),controller[_0x5dc0('0xd')]);router[_0x5dc0('0x8')]('/:id/descriptions',auth[_0x5dc0('0x9')](),controller[_0x5dc0('0xe')]);router[_0x5dc0('0x8')](_0x5dc0('0xf'),auth[_0x5dc0('0x9')](),controller[_0x5dc0('0x10')]);router[_0x5dc0('0x11')]('/',auth[_0x5dc0('0x9')](),controller['create']);router['post'](_0x5dc0('0xf'),auth[_0x5dc0('0x9')](),controller[_0x5dc0('0x12')]);router['put'](_0x5dc0('0xb'),auth[_0x5dc0('0x9')](),controller[_0x5dc0('0x13')]);router[_0x5dc0('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x5dc0('0x15')]);module[_0x5dc0('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 a688135..1544233 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1f3f=['exports','STRING','sequelize'];(function(_0x566de6,_0x429dab){var _0x37e177=function(_0x4d0b65){while(--_0x4d0b65){_0x566de6['push'](_0x566de6['shift']());}};_0x37e177(++_0x429dab);}(_0x1f3f,0x13d));var _0xf1f3=function(_0x619fcc,_0x3bd756){_0x619fcc=_0x619fcc-0x0;var _0x4737a6=_0x1f3f[_0x619fcc];return _0x4737a6;};'use strict';var Sequelize=require(_0xf1f3('0x0'));module[_0xf1f3('0x1')]={'name':{'type':Sequelize[_0xf1f3('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 38655f3..9010744 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 _0x1877=['count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','create','find','body','getFields','FreshdeskField','sort','pick','getSubjects','getDescriptions','Tag','getTags','setTags','ids','rimraf','fast-json-patch','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit'];(function(_0x3030ab,_0x37169a){var _0x24c606=function(_0x3c84fd){while(--_0x3c84fd){_0x3030ab['push'](_0x3030ab['shift']());}};_0x24c606(++_0x37169a);}(_0x1877,0x87));var _0x7187=function(_0xc7f23c,_0x2be758){_0xc7f23c=_0xc7f23c-0x0;var _0x4b4def=_0x1877[_0xc7f23c];return _0x4b4def;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7187('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7187('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7187('0x2'));var util=require(_0x7187('0x3'));var path=require(_0x7187('0x4'));var sox=require(_0x7187('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7187('0x6'));var _=require(_0x7187('0x7'));var squel=require(_0x7187('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7187('0x9'));var toCsv=require(_0x7187('0xa'));var querystring=require('querystring');var Papa=require(_0x7187('0xb'));var Redis=require(_0x7187('0xc'));var authService=require(_0x7187('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x7187('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7187('0xf'))(_0x7187('0x10'));var utils=require(_0x7187('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x7187('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x132898,_0x147b38){_0x147b38=_0x147b38||0xcc;return function(_0x230626){if(_0x230626){return _0x132898[_0x7187('0x13')](_0x147b38);}return _0x132898[_0x7187('0x14')](_0x147b38)[_0x7187('0x15')]();};}function respondWithResult(_0x1848c4,_0x4d2d6b){_0x4d2d6b=_0x4d2d6b||0xc8;return function(_0x4a3c50){if(_0x4a3c50){return _0x1848c4[_0x7187('0x14')](_0x4d2d6b)[_0x7187('0x16')](_0x4a3c50);}};}function respondWithFilteredResult(_0x834daa,_0x3bbe40){return function(_0x367cbe){if(_0x367cbe){var _0x54e552=typeof _0x3bbe40['offset']===_0x7187('0x17')&&typeof _0x3bbe40[_0x7187('0x18')]==='undefined';var _0xb38104=_0x367cbe[_0x7187('0x19')];var _0x28889f=_0x54e552?0x0:_0x3bbe40[_0x7187('0x1a')];var _0x3798a3=_0x54e552?_0x367cbe[_0x7187('0x19')]:_0x3bbe40[_0x7187('0x1a')]+_0x3bbe40[_0x7187('0x18')];var _0x5085df;if(_0x3798a3>=_0xb38104){_0x3798a3=_0xb38104;_0x5085df=0xc8;}else{_0x5085df=0xce;}_0x834daa[_0x7187('0x14')](_0x5085df);return _0x834daa[_0x7187('0x1b')](_0x7187('0x1c'),_0x28889f+'-'+_0x3798a3+'/'+_0xb38104)[_0x7187('0x16')](_0x367cbe);}return null;};}function patchUpdates(_0x5546c2){return function(_0x1b0f2a){try{jsonpatch[_0x7187('0x1d')](_0x1b0f2a,_0x5546c2,!![]);}catch(_0xbe2553){return BPromise[_0x7187('0x1e')](_0xbe2553);}return _0x1b0f2a[_0x7187('0x1f')]();};}function saveUpdates(_0x470576,_0x25bae7){return function(_0x3c11eb){if(_0x3c11eb){return _0x3c11eb[_0x7187('0x20')](_0x470576)[_0x7187('0x21')](function(_0x59f963){return _0x59f963;});}return null;};}function removeEntity(_0x37fa38,_0x39c00d){return function(_0x21deb4){if(_0x21deb4){return _0x21deb4[_0x7187('0x22')]()['then'](function(){_0x37fa38[_0x7187('0x14')](0xcc)[_0x7187('0x15')]();});}};}function handleEntityNotFound(_0x5c95d1,_0x1c721b){return function(_0x5db79f){if(!_0x5db79f){_0x5c95d1[_0x7187('0x13')](0x194);}return _0x5db79f;};}function handleError(_0x4362b2,_0x38ddb0){_0x38ddb0=_0x38ddb0||0x1f4;return function(_0x29311b){logger[_0x7187('0x23')](_0x29311b[_0x7187('0x24')]);if(_0x29311b[_0x7187('0x25')]){delete _0x29311b[_0x7187('0x25')];}_0x4362b2[_0x7187('0x14')](_0x38ddb0)[_0x7187('0x26')](_0x29311b);};}exports[_0x7187('0x27')]=function(_0x5dbc75,_0x4194c5){var _0x1608e4={},_0x3f11d3={},_0x746bb1={'count':0x0,'rows':[]};var _0x2bc0cc=_[_0x7187('0x28')](db[_0x7187('0x29')][_0x7187('0x2a')],function(_0x1724f9){return{'name':_0x1724f9[_0x7187('0x2b')],'type':_0x1724f9[_0x7187('0x2c')]['key']};});_0x3f11d3[_0x7187('0x2d')]=_[_0x7187('0x28')](_0x2bc0cc,_0x7187('0x25'));_0x3f11d3[_0x7187('0x2e')]=_[_0x7187('0x2f')](_0x5dbc75[_0x7187('0x2e')]);_0x3f11d3[_0x7187('0x30')]=_[_0x7187('0x31')](_0x3f11d3['model'],_0x3f11d3['query']);_0x1608e4[_0x7187('0x32')]=_[_0x7187('0x31')](_0x3f11d3[_0x7187('0x2d')],qs[_0x7187('0x33')](_0x5dbc75['query']['fields']));_0x1608e4[_0x7187('0x32')]=_0x1608e4[_0x7187('0x32')][_0x7187('0x34')]?_0x1608e4[_0x7187('0x32')]:_0x3f11d3[_0x7187('0x2d')];if(!_0x5dbc75[_0x7187('0x2e')][_0x7187('0x35')](_0x7187('0x36'))){_0x1608e4[_0x7187('0x18')]=qs[_0x7187('0x18')](_0x5dbc75[_0x7187('0x2e')][_0x7187('0x18')]);_0x1608e4[_0x7187('0x1a')]=qs['offset'](_0x5dbc75[_0x7187('0x2e')][_0x7187('0x1a')]);}_0x1608e4[_0x7187('0x37')]=qs['sort'](_0x5dbc75['query']['sort']);_0x1608e4[_0x7187('0x38')]=qs['filters'](_['pick'](_0x5dbc75[_0x7187('0x2e')],_0x3f11d3[_0x7187('0x30')]),_0x2bc0cc);if(_0x5dbc75[_0x7187('0x2e')][_0x7187('0x39')]){_0x1608e4['where']=_[_0x7187('0x3a')](_0x1608e4[_0x7187('0x38')],{'$or':_[_0x7187('0x28')](_0x2bc0cc,function(_0x1bc793){if(_0x1bc793[_0x7187('0x2c')]!==_0x7187('0x3b')){var _0x3c1ac5={};_0x3c1ac5[_0x1bc793['name']]={'$like':'%'+_0x5dbc75[_0x7187('0x2e')][_0x7187('0x39')]+'%'};return _0x3c1ac5;}})});}_0x1608e4=_[_0x7187('0x3a')]({},_0x1608e4,_0x5dbc75[_0x7187('0x3c')]);var _0x61d9e8={'where':_0x1608e4[_0x7187('0x38')]};return db['FreshdeskConfiguration']['count'](_0x61d9e8)[_0x7187('0x21')](function(_0x11034d){_0x746bb1['count']=_0x11034d;if(_0x5dbc75['query'][_0x7187('0x3d')]){_0x1608e4['include']=[{'all':!![]}];}return db[_0x7187('0x29')][_0x7187('0x3e')](_0x1608e4);})[_0x7187('0x21')](function(_0x2b1f54){_0x746bb1['rows']=_0x2b1f54;return _0x746bb1;})['then'](respondWithFilteredResult(_0x4194c5,_0x1608e4))[_0x7187('0x3f')](handleError(_0x4194c5,null));};exports[_0x7187('0x40')]=function(_0x17b720,_0x5ae191){var _0x3f82e4={'raw':![],'where':{'id':_0x17b720[_0x7187('0x41')]['id']}},_0x3900f1={};_0x3900f1[_0x7187('0x2d')]=_[_0x7187('0x2f')](db[_0x7187('0x29')][_0x7187('0x2a')]);_0x3900f1[_0x7187('0x2e')]=_['keys'](_0x17b720[_0x7187('0x2e')]);_0x3900f1[_0x7187('0x30')]=_[_0x7187('0x31')](_0x3900f1[_0x7187('0x2d')],_0x3900f1[_0x7187('0x2e')]);_0x3f82e4[_0x7187('0x32')]=_[_0x7187('0x31')](_0x3900f1[_0x7187('0x2d')],qs[_0x7187('0x33')](_0x17b720[_0x7187('0x2e')][_0x7187('0x33')]));_0x3f82e4[_0x7187('0x32')]=_0x3f82e4[_0x7187('0x32')][_0x7187('0x34')]?_0x3f82e4['attributes']:_0x3900f1[_0x7187('0x2d')];if(_0x17b720[_0x7187('0x2e')][_0x7187('0x3d')]){_0x3f82e4[_0x7187('0x42')]=[{'all':!![]}];}_0x3f82e4=_[_0x7187('0x3a')]({},_0x3f82e4,_0x17b720['options']);return db[_0x7187('0x29')]['find'](_0x3f82e4)[_0x7187('0x21')](handleEntityNotFound(_0x5ae191,null))[_0x7187('0x21')](respondWithResult(_0x5ae191,null))[_0x7187('0x3f')](handleError(_0x5ae191,null));};exports[_0x7187('0x43')]=function(_0x5c4c14,_0x1217e8){return db['FreshdeskConfiguration']['create'](_0x5c4c14['body'],{})['then'](respondWithResult(_0x1217e8,0xc9))[_0x7187('0x3f')](handleError(_0x1217e8,null));};exports['update']=function(_0x1445d2,_0x4dc7d2){if(_0x1445d2['body']['id']){delete _0x1445d2['body']['id'];}return db[_0x7187('0x29')][_0x7187('0x44')]({'where':{'id':_0x1445d2[_0x7187('0x41')]['id']}})['then'](handleEntityNotFound(_0x4dc7d2,null))[_0x7187('0x21')](saveUpdates(_0x1445d2[_0x7187('0x45')],null))[_0x7187('0x21')](respondWithResult(_0x4dc7d2,null))[_0x7187('0x3f')](handleError(_0x4dc7d2,null));};exports[_0x7187('0x22')]=function(_0x206ca3,_0x11f617){return db['FreshdeskConfiguration'][_0x7187('0x44')]({'where':{'id':_0x206ca3[_0x7187('0x41')]['id']}})['then'](handleEntityNotFound(_0x11f617,null))[_0x7187('0x21')](removeEntity(_0x11f617,null))[_0x7187('0x3f')](handleError(_0x11f617,null));};exports[_0x7187('0x46')]=function(_0x4cbe5a,_0x1d790b,_0x5f12d0){var _0x451d8a={};var _0x1f08ee={};var _0x1893fe;var _0x23d450;return db[_0x7187('0x29')]['findOne']({'where':{'id':_0x4cbe5a[_0x7187('0x41')]['id']}})[_0x7187('0x21')](handleEntityNotFound(_0x1d790b,null))[_0x7187('0x21')](function(_0x2c937d){if(_0x2c937d){_0x1893fe=_0x2c937d;_0x1f08ee[_0x7187('0x2d')]=_['keys'](db[_0x7187('0x47')][_0x7187('0x2a')]);_0x1f08ee['query']=_[_0x7187('0x2f')](_0x4cbe5a[_0x7187('0x2e')]);_0x1f08ee[_0x7187('0x30')]=_[_0x7187('0x31')](_0x1f08ee[_0x7187('0x2d')],_0x1f08ee[_0x7187('0x2e')]);_0x451d8a[_0x7187('0x32')]=_['intersection'](_0x1f08ee[_0x7187('0x2d')],qs[_0x7187('0x33')](_0x4cbe5a[_0x7187('0x2e')][_0x7187('0x33')]));_0x451d8a['attributes']=_0x451d8a['attributes']['length']?_0x451d8a[_0x7187('0x32')]:_0x1f08ee[_0x7187('0x2d')];_0x451d8a['order']=qs[_0x7187('0x48')](_0x4cbe5a[_0x7187('0x2e')][_0x7187('0x48')]);_0x451d8a[_0x7187('0x38')]=qs[_0x7187('0x30')](_[_0x7187('0x49')](_0x4cbe5a[_0x7187('0x2e')],_0x1f08ee[_0x7187('0x30')]));if(_0x4cbe5a['query']['filter']){_0x451d8a[_0x7187('0x38')]=_['merge'](_0x451d8a['where'],{'$or':_[_0x7187('0x28')](_0x451d8a['attributes'],function(_0x2e61bd){var _0x55dc53={};_0x55dc53[_0x2e61bd]={'$like':'%'+_0x4cbe5a['query'][_0x7187('0x39')]+'%'};return _0x55dc53;})});}_0x451d8a=_[_0x7187('0x3a')]({},_0x451d8a,_0x4cbe5a[_0x7187('0x3c')]);return _0x1893fe[_0x7187('0x46')](_0x451d8a);}})[_0x7187('0x21')](function(_0x4233c7){if(_0x4233c7){_0x23d450=_0x4233c7[_0x7187('0x34')];if(!_0x4cbe5a[_0x7187('0x2e')][_0x7187('0x35')](_0x7187('0x36'))){_0x451d8a[_0x7187('0x18')]=qs[_0x7187('0x18')](_0x4cbe5a['query'][_0x7187('0x18')]);_0x451d8a[_0x7187('0x1a')]=qs[_0x7187('0x1a')](_0x4cbe5a['query'][_0x7187('0x1a')]);}return _0x1893fe[_0x7187('0x46')](_0x451d8a);}})[_0x7187('0x21')](function(_0x49aa22){if(_0x49aa22){return _0x49aa22?{'count':_0x23d450,'rows':_0x49aa22}:null;}})[_0x7187('0x21')](respondWithResult(_0x1d790b,null))[_0x7187('0x3f')](handleError(_0x1d790b,null));};exports[_0x7187('0x4a')]=function(_0x2b0d8f,_0x3c0dce,_0x30d73c){var _0x4efff2={};var _0x2c21a9={};var _0x467f9f;var _0x1300b5;return db[_0x7187('0x29')]['findOne']({'where':{'id':_0x2b0d8f[_0x7187('0x41')]['id']}})['then'](handleEntityNotFound(_0x3c0dce,null))['then'](function(_0x13ec43){if(_0x13ec43){_0x467f9f=_0x13ec43;_0x2c21a9[_0x7187('0x2d')]=_['keys'](db['FreshdeskField'][_0x7187('0x2a')]);_0x2c21a9['query']=_[_0x7187('0x2f')](_0x2b0d8f[_0x7187('0x2e')]);_0x2c21a9[_0x7187('0x30')]=_[_0x7187('0x31')](_0x2c21a9[_0x7187('0x2d')],_0x2c21a9[_0x7187('0x2e')]);_0x4efff2[_0x7187('0x32')]=_[_0x7187('0x31')](_0x2c21a9[_0x7187('0x2d')],qs[_0x7187('0x33')](_0x2b0d8f['query'][_0x7187('0x33')]));_0x4efff2[_0x7187('0x32')]=_0x4efff2['attributes'][_0x7187('0x34')]?_0x4efff2[_0x7187('0x32')]:_0x2c21a9['model'];_0x4efff2[_0x7187('0x37')]=qs[_0x7187('0x48')](_0x2b0d8f[_0x7187('0x2e')][_0x7187('0x48')]);_0x4efff2[_0x7187('0x38')]=qs[_0x7187('0x30')](_[_0x7187('0x49')](_0x2b0d8f[_0x7187('0x2e')],_0x2c21a9[_0x7187('0x30')]));if(_0x2b0d8f[_0x7187('0x2e')]['filter']){_0x4efff2[_0x7187('0x38')]=_[_0x7187('0x3a')](_0x4efff2[_0x7187('0x38')],{'$or':_['map'](_0x4efff2[_0x7187('0x32')],function(_0x3fefb0){var _0x7bd43b={};_0x7bd43b[_0x3fefb0]={'$like':'%'+_0x2b0d8f[_0x7187('0x2e')][_0x7187('0x39')]+'%'};return _0x7bd43b;})});}_0x4efff2=_[_0x7187('0x3a')]({},_0x4efff2,_0x2b0d8f[_0x7187('0x3c')]);return _0x467f9f[_0x7187('0x4a')](_0x4efff2);}})[_0x7187('0x21')](function(_0x4d4b45){if(_0x4d4b45){_0x1300b5=_0x4d4b45[_0x7187('0x34')];if(!_0x2b0d8f[_0x7187('0x2e')][_0x7187('0x35')](_0x7187('0x36'))){_0x4efff2['limit']=qs[_0x7187('0x18')](_0x2b0d8f[_0x7187('0x2e')][_0x7187('0x18')]);_0x4efff2[_0x7187('0x1a')]=qs[_0x7187('0x1a')](_0x2b0d8f[_0x7187('0x2e')][_0x7187('0x1a')]);}return _0x467f9f['getSubjects'](_0x4efff2);}})[_0x7187('0x21')](function(_0x3b98af){if(_0x3b98af){return _0x3b98af?{'count':_0x1300b5,'rows':_0x3b98af}:null;}})[_0x7187('0x21')](respondWithResult(_0x3c0dce,null))[_0x7187('0x3f')](handleError(_0x3c0dce,null));};exports[_0x7187('0x4b')]=function(_0x27e1d0,_0xe87e66,_0x347bfe){var _0x1e077e={};var _0x32521c={};var _0xe135ec;var _0x31aac5;return db[_0x7187('0x29')]['findOne']({'where':{'id':_0x27e1d0[_0x7187('0x41')]['id']}})[_0x7187('0x21')](handleEntityNotFound(_0xe87e66,null))[_0x7187('0x21')](function(_0x595036){if(_0x595036){_0xe135ec=_0x595036;_0x32521c[_0x7187('0x2d')]=_[_0x7187('0x2f')](db[_0x7187('0x47')]['rawAttributes']);_0x32521c[_0x7187('0x2e')]=_[_0x7187('0x2f')](_0x27e1d0['query']);_0x32521c[_0x7187('0x30')]=_[_0x7187('0x31')](_0x32521c['model'],_0x32521c['query']);_0x1e077e['attributes']=_[_0x7187('0x31')](_0x32521c[_0x7187('0x2d')],qs['fields'](_0x27e1d0[_0x7187('0x2e')][_0x7187('0x33')]));_0x1e077e['attributes']=_0x1e077e[_0x7187('0x32')]['length']?_0x1e077e[_0x7187('0x32')]:_0x32521c[_0x7187('0x2d')];_0x1e077e[_0x7187('0x37')]=qs[_0x7187('0x48')](_0x27e1d0[_0x7187('0x2e')][_0x7187('0x48')]);_0x1e077e[_0x7187('0x38')]=qs['filters'](_['pick'](_0x27e1d0[_0x7187('0x2e')],_0x32521c[_0x7187('0x30')]));if(_0x27e1d0[_0x7187('0x2e')][_0x7187('0x39')]){_0x1e077e[_0x7187('0x38')]=_[_0x7187('0x3a')](_0x1e077e[_0x7187('0x38')],{'$or':_['map'](_0x1e077e[_0x7187('0x32')],function(_0xf55e34){var _0x2ef7ed={};_0x2ef7ed[_0xf55e34]={'$like':'%'+_0x27e1d0[_0x7187('0x2e')]['filter']+'%'};return _0x2ef7ed;})});}_0x1e077e=_['merge']({},_0x1e077e,_0x27e1d0[_0x7187('0x3c')]);return _0xe135ec[_0x7187('0x4b')](_0x1e077e);}})[_0x7187('0x21')](function(_0x57d0d8){if(_0x57d0d8){_0x31aac5=_0x57d0d8['length'];if(!_0x27e1d0[_0x7187('0x2e')][_0x7187('0x35')](_0x7187('0x36'))){_0x1e077e[_0x7187('0x18')]=qs[_0x7187('0x18')](_0x27e1d0['query']['limit']);_0x1e077e['offset']=qs[_0x7187('0x1a')](_0x27e1d0[_0x7187('0x2e')][_0x7187('0x1a')]);}return _0xe135ec[_0x7187('0x4b')](_0x1e077e);}})[_0x7187('0x21')](function(_0x519e38){if(_0x519e38){return _0x519e38?{'count':_0x31aac5,'rows':_0x519e38}:null;}})['then'](respondWithResult(_0xe87e66,null))[_0x7187('0x3f')](handleError(_0xe87e66,null));};exports['getTags']=function(_0x478a51,_0x37d0e1,_0x439edc){var _0x223ca1={};var _0x3c17da={};var _0x233d5c;var _0x3f457f;return db[_0x7187('0x29')]['findOne']({'where':{'id':_0x478a51['params']['id']}})[_0x7187('0x21')](handleEntityNotFound(_0x37d0e1,null))[_0x7187('0x21')](function(_0x5e8925){if(_0x5e8925){_0x233d5c=_0x5e8925;_0x3c17da['model']=_['keys'](db[_0x7187('0x4c')]['rawAttributes']);_0x3c17da['query']=_['keys'](_0x478a51[_0x7187('0x2e')]);_0x3c17da[_0x7187('0x30')]=_[_0x7187('0x31')](_0x3c17da[_0x7187('0x2d')],_0x3c17da[_0x7187('0x2e')]);_0x223ca1['attributes']=_['intersection'](_0x3c17da[_0x7187('0x2d')],qs[_0x7187('0x33')](_0x478a51['query'][_0x7187('0x33')]));_0x223ca1[_0x7187('0x32')]=_0x223ca1[_0x7187('0x32')]['length']?_0x223ca1[_0x7187('0x32')]:_0x3c17da[_0x7187('0x2d')];_0x223ca1[_0x7187('0x37')]=qs[_0x7187('0x48')](_0x478a51[_0x7187('0x2e')][_0x7187('0x48')]);_0x223ca1[_0x7187('0x38')]=qs['filters'](_['pick'](_0x478a51[_0x7187('0x2e')],_0x3c17da[_0x7187('0x30')]));if(_0x478a51['query']['filter']){_0x223ca1[_0x7187('0x38')]=_['merge'](_0x223ca1[_0x7187('0x38')],{'$or':_[_0x7187('0x28')](_0x223ca1[_0x7187('0x32')],function(_0xfad6ac){var _0x4e5462={};_0x4e5462[_0xfad6ac]={'$like':'%'+_0x478a51[_0x7187('0x2e')][_0x7187('0x39')]+'%'};return _0x4e5462;})});}_0x223ca1=_['merge']({},_0x223ca1,_0x478a51[_0x7187('0x3c')]);return _0x233d5c[_0x7187('0x4d')](_0x223ca1);}})[_0x7187('0x21')](function(_0x536619){if(_0x536619){_0x3f457f=_0x536619[_0x7187('0x34')];if(!_0x478a51[_0x7187('0x2e')][_0x7187('0x35')]('nolimit')){_0x223ca1['limit']=qs[_0x7187('0x18')](_0x478a51[_0x7187('0x2e')][_0x7187('0x18')]);_0x223ca1[_0x7187('0x1a')]=qs[_0x7187('0x1a')](_0x478a51['query'][_0x7187('0x1a')]);}return _0x233d5c['getTags'](_0x223ca1);}})['then'](function(_0x1684b3){if(_0x1684b3){return _0x1684b3?{'count':_0x3f457f,'rows':_0x1684b3}:null;}})[_0x7187('0x21')](respondWithResult(_0x37d0e1,null))[_0x7187('0x3f')](handleError(_0x37d0e1,null));};exports[_0x7187('0x4e')]=function(_0x244d29,_0x4a62cd,_0x51345d){if(_0x244d29['body']['id']){delete _0x244d29[_0x7187('0x45')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x244d29[_0x7187('0x41')]['id']}})[_0x7187('0x21')](handleEntityNotFound(_0x4a62cd,null))[_0x7187('0x21')](function(_0x279a4a){if(_0x279a4a){return _0x279a4a['setTags'](_0x244d29[_0x7187('0x45')][_0x7187('0x4f')]||[]);}return null;})['then'](respondWithResult(_0x4a62cd,null))['catch'](handleError(_0x4a62cd,null));}; \ No newline at end of file +var _0x7642=['then','destroy','error','name','send','index','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','FreshdeskConfiguration','includeAll','include','findAll','catch','show','create','body','find','params','getFields','findOne','FreshdeskField','getSubjects','pick','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','reject','save','update'];(function(_0x53d4f7,_0x1e0f8c){var _0x339e61=function(_0x5b9f1f){while(--_0x5b9f1f){_0x53d4f7['push'](_0x53d4f7['shift']());}};_0x339e61(++_0x1e0f8c);}(_0x7642,0xc6));var _0x2764=function(_0x431c5b,_0x103781){_0x431c5b=_0x431c5b-0x0;var _0x3b50b5=_0x7642[_0x431c5b];return _0x3b50b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2764('0x0'));var zipdir=require(_0x2764('0x1'));var jsonpatch=require(_0x2764('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2764('0x3'));var util=require(_0x2764('0x4'));var path=require(_0x2764('0x5'));var sox=require('sox');var csv=require(_0x2764('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2764('0x7'));var squel=require(_0x2764('0x8'));var crypto=require(_0x2764('0x9'));var jsforce=require(_0x2764('0xa'));var deskjs=require(_0x2764('0xb'));var toCsv=require(_0x2764('0x6'));var querystring=require('querystring');var Papa=require(_0x2764('0xc'));var Redis=require(_0x2764('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2764('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2764('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x2764('0x10'));var licenseUtil=require(_0x2764('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf03dfb,_0x11128f){_0x11128f=_0x11128f||0xcc;return function(_0x413dec){if(_0x413dec){return _0xf03dfb[_0x2764('0x12')](_0x11128f);}return _0xf03dfb[_0x2764('0x13')](_0x11128f)[_0x2764('0x14')]();};}function respondWithResult(_0x41edd4,_0xd2ca85){_0xd2ca85=_0xd2ca85||0xc8;return function(_0x581100){if(_0x581100){return _0x41edd4['status'](_0xd2ca85)['json'](_0x581100);}};}function respondWithFilteredResult(_0x5fa258,_0x6a8e6b){return function(_0x3aeb37){if(_0x3aeb37){var _0x45aa98=typeof _0x6a8e6b['offset']==='undefined'&&typeof _0x6a8e6b[_0x2764('0x15')]===_0x2764('0x16');var _0x32d405=_0x3aeb37[_0x2764('0x17')];var _0x5423e7=_0x45aa98?0x0:_0x6a8e6b[_0x2764('0x18')];var _0x3fd6b5=_0x45aa98?_0x3aeb37['count']:_0x6a8e6b[_0x2764('0x18')]+_0x6a8e6b[_0x2764('0x15')];var _0x475ebe;if(_0x3fd6b5>=_0x32d405){_0x3fd6b5=_0x32d405;_0x475ebe=0xc8;}else{_0x475ebe=0xce;}_0x5fa258[_0x2764('0x13')](_0x475ebe);return _0x5fa258['set'](_0x2764('0x19'),_0x5423e7+'-'+_0x3fd6b5+'/'+_0x32d405)[_0x2764('0x1a')](_0x3aeb37);}return null;};}function patchUpdates(_0x45c874){return function(_0x465ec4){try{jsonpatch['apply'](_0x465ec4,_0x45c874,!![]);}catch(_0x2a7453){return BPromise[_0x2764('0x1b')](_0x2a7453);}return _0x465ec4[_0x2764('0x1c')]();};}function saveUpdates(_0x45b7f2,_0x588097){return function(_0x5b18ef){if(_0x5b18ef){return _0x5b18ef[_0x2764('0x1d')](_0x45b7f2)[_0x2764('0x1e')](function(_0x1e8755){return _0x1e8755;});}return null;};}function removeEntity(_0x52bb54,_0x55b3c6){return function(_0x1f3302){if(_0x1f3302){return _0x1f3302[_0x2764('0x1f')]()[_0x2764('0x1e')](function(){_0x52bb54[_0x2764('0x13')](0xcc)[_0x2764('0x14')]();});}};}function handleEntityNotFound(_0x815c78,_0x6d3463){return function(_0x5906a2){if(!_0x5906a2){_0x815c78['sendStatus'](0x194);}return _0x5906a2;};}function handleError(_0x367caf,_0x5e0465){_0x5e0465=_0x5e0465||0x1f4;return function(_0x4e3f24){logger[_0x2764('0x20')](_0x4e3f24['stack']);if(_0x4e3f24[_0x2764('0x21')]){delete _0x4e3f24[_0x2764('0x21')];}_0x367caf[_0x2764('0x13')](_0x5e0465)[_0x2764('0x22')](_0x4e3f24);};}exports[_0x2764('0x23')]=function(_0xc03b20,_0x7f2902){var _0x188ab1={},_0x30e1e6={},_0x530334={'count':0x0,'rows':[]};var _0x24d623=_[_0x2764('0x24')](db['FreshdeskConfiguration'][_0x2764('0x25')],function(_0x8e3bef){return{'name':_0x8e3bef['fieldName'],'type':_0x8e3bef[_0x2764('0x26')][_0x2764('0x27')]};});_0x30e1e6['model']=_[_0x2764('0x24')](_0x24d623,_0x2764('0x21'));_0x30e1e6[_0x2764('0x28')]=_[_0x2764('0x29')](_0xc03b20[_0x2764('0x28')]);_0x30e1e6['filters']=_[_0x2764('0x2a')](_0x30e1e6[_0x2764('0x2b')],_0x30e1e6['query']);_0x188ab1[_0x2764('0x2c')]=_[_0x2764('0x2a')](_0x30e1e6[_0x2764('0x2b')],qs[_0x2764('0x2d')](_0xc03b20['query'][_0x2764('0x2d')]));_0x188ab1[_0x2764('0x2c')]=_0x188ab1['attributes'][_0x2764('0x2e')]?_0x188ab1['attributes']:_0x30e1e6[_0x2764('0x2b')];if(!_0xc03b20[_0x2764('0x28')][_0x2764('0x2f')](_0x2764('0x30'))){_0x188ab1[_0x2764('0x15')]=qs[_0x2764('0x15')](_0xc03b20[_0x2764('0x28')]['limit']);_0x188ab1[_0x2764('0x18')]=qs[_0x2764('0x18')](_0xc03b20[_0x2764('0x28')]['offset']);}_0x188ab1[_0x2764('0x31')]=qs[_0x2764('0x32')](_0xc03b20[_0x2764('0x28')]['sort']);_0x188ab1['where']=qs[_0x2764('0x33')](_['pick'](_0xc03b20[_0x2764('0x28')],_0x30e1e6['filters']),_0x24d623);if(_0xc03b20['query'][_0x2764('0x34')]){_0x188ab1[_0x2764('0x35')]=_[_0x2764('0x36')](_0x188ab1[_0x2764('0x35')],{'$or':_[_0x2764('0x24')](_0x24d623,function(_0xa20eeb){if(_0xa20eeb[_0x2764('0x26')]!==_0x2764('0x37')){var _0x11a9c6={};_0x11a9c6[_0xa20eeb[_0x2764('0x21')]]={'$like':'%'+_0xc03b20[_0x2764('0x28')][_0x2764('0x34')]+'%'};return _0x11a9c6;}})});}_0x188ab1=_[_0x2764('0x36')]({},_0x188ab1,_0xc03b20[_0x2764('0x38')]);var _0xb51f71={'where':_0x188ab1[_0x2764('0x35')]};return db[_0x2764('0x39')][_0x2764('0x17')](_0xb51f71)[_0x2764('0x1e')](function(_0x319e83){_0x530334[_0x2764('0x17')]=_0x319e83;if(_0xc03b20[_0x2764('0x28')][_0x2764('0x3a')]){_0x188ab1[_0x2764('0x3b')]=[{'all':!![]}];}return db[_0x2764('0x39')][_0x2764('0x3c')](_0x188ab1);})['then'](function(_0x4b8859){_0x530334['rows']=_0x4b8859;return _0x530334;})['then'](respondWithFilteredResult(_0x7f2902,_0x188ab1))[_0x2764('0x3d')](handleError(_0x7f2902,null));};exports[_0x2764('0x3e')]=function(_0x1f6cbc,_0xccb393){var _0x330e0e={'raw':![],'where':{'id':_0x1f6cbc['params']['id']}},_0x925bbe={};_0x925bbe['model']=_[_0x2764('0x29')](db[_0x2764('0x39')]['rawAttributes']);_0x925bbe[_0x2764('0x28')]=_[_0x2764('0x29')](_0x1f6cbc[_0x2764('0x28')]);_0x925bbe[_0x2764('0x33')]=_['intersection'](_0x925bbe[_0x2764('0x2b')],_0x925bbe[_0x2764('0x28')]);_0x330e0e[_0x2764('0x2c')]=_['intersection'](_0x925bbe[_0x2764('0x2b')],qs['fields'](_0x1f6cbc['query'][_0x2764('0x2d')]));_0x330e0e[_0x2764('0x2c')]=_0x330e0e['attributes'][_0x2764('0x2e')]?_0x330e0e['attributes']:_0x925bbe[_0x2764('0x2b')];if(_0x1f6cbc[_0x2764('0x28')][_0x2764('0x3a')]){_0x330e0e[_0x2764('0x3b')]=[{'all':!![]}];}_0x330e0e=_[_0x2764('0x36')]({},_0x330e0e,_0x1f6cbc[_0x2764('0x38')]);return db[_0x2764('0x39')]['find'](_0x330e0e)['then'](handleEntityNotFound(_0xccb393,null))[_0x2764('0x1e')](respondWithResult(_0xccb393,null))[_0x2764('0x3d')](handleError(_0xccb393,null));};exports[_0x2764('0x3f')]=function(_0x37c874,_0x164fc4){return db[_0x2764('0x39')][_0x2764('0x3f')](_0x37c874[_0x2764('0x40')],{})[_0x2764('0x1e')](respondWithResult(_0x164fc4,0xc9))['catch'](handleError(_0x164fc4,null));};exports[_0x2764('0x1d')]=function(_0x24ce67,_0x28f274){if(_0x24ce67[_0x2764('0x40')]['id']){delete _0x24ce67[_0x2764('0x40')]['id'];}return db[_0x2764('0x39')][_0x2764('0x41')]({'where':{'id':_0x24ce67[_0x2764('0x42')]['id']}})[_0x2764('0x1e')](handleEntityNotFound(_0x28f274,null))[_0x2764('0x1e')](saveUpdates(_0x24ce67[_0x2764('0x40')],null))[_0x2764('0x1e')](respondWithResult(_0x28f274,null))[_0x2764('0x3d')](handleError(_0x28f274,null));};exports[_0x2764('0x1f')]=function(_0x4f8105,_0x157755){return db[_0x2764('0x39')][_0x2764('0x41')]({'where':{'id':_0x4f8105[_0x2764('0x42')]['id']}})[_0x2764('0x1e')](handleEntityNotFound(_0x157755,null))[_0x2764('0x1e')](removeEntity(_0x157755,null))['catch'](handleError(_0x157755,null));};exports[_0x2764('0x43')]=function(_0x4f5496,_0x2df913,_0x4c7611){var _0x5ed832={};var _0x2f1287={};var _0x3efe94;var _0x2ae98b;return db[_0x2764('0x39')][_0x2764('0x44')]({'where':{'id':_0x4f5496[_0x2764('0x42')]['id']}})[_0x2764('0x1e')](handleEntityNotFound(_0x2df913,null))[_0x2764('0x1e')](function(_0x502858){if(_0x502858){_0x3efe94=_0x502858;_0x2f1287[_0x2764('0x2b')]=_['keys'](db[_0x2764('0x45')][_0x2764('0x25')]);_0x2f1287['query']=_[_0x2764('0x29')](_0x4f5496['query']);_0x2f1287[_0x2764('0x33')]=_['intersection'](_0x2f1287[_0x2764('0x2b')],_0x2f1287[_0x2764('0x28')]);_0x5ed832[_0x2764('0x2c')]=_['intersection'](_0x2f1287[_0x2764('0x2b')],qs[_0x2764('0x2d')](_0x4f5496[_0x2764('0x28')][_0x2764('0x2d')]));_0x5ed832['attributes']=_0x5ed832[_0x2764('0x2c')][_0x2764('0x2e')]?_0x5ed832[_0x2764('0x2c')]:_0x2f1287[_0x2764('0x2b')];_0x5ed832[_0x2764('0x31')]=qs[_0x2764('0x32')](_0x4f5496[_0x2764('0x28')]['sort']);_0x5ed832[_0x2764('0x35')]=qs[_0x2764('0x33')](_['pick'](_0x4f5496['query'],_0x2f1287[_0x2764('0x33')]));if(_0x4f5496['query'][_0x2764('0x34')]){_0x5ed832[_0x2764('0x35')]=_[_0x2764('0x36')](_0x5ed832[_0x2764('0x35')],{'$or':_[_0x2764('0x24')](_0x5ed832['attributes'],function(_0x4c9fe4){var _0x2478bf={};_0x2478bf[_0x4c9fe4]={'$like':'%'+_0x4f5496[_0x2764('0x28')][_0x2764('0x34')]+'%'};return _0x2478bf;})});}_0x5ed832=_[_0x2764('0x36')]({},_0x5ed832,_0x4f5496['options']);return _0x3efe94[_0x2764('0x43')](_0x5ed832);}})['then'](function(_0x2a3295){if(_0x2a3295){_0x2ae98b=_0x2a3295['length'];if(!_0x4f5496[_0x2764('0x28')]['hasOwnProperty'](_0x2764('0x30'))){_0x5ed832[_0x2764('0x15')]=qs[_0x2764('0x15')](_0x4f5496[_0x2764('0x28')]['limit']);_0x5ed832[_0x2764('0x18')]=qs[_0x2764('0x18')](_0x4f5496['query'][_0x2764('0x18')]);}return _0x3efe94[_0x2764('0x43')](_0x5ed832);}})[_0x2764('0x1e')](function(_0x51dc05){if(_0x51dc05){return _0x51dc05?{'count':_0x2ae98b,'rows':_0x51dc05}:null;}})[_0x2764('0x1e')](respondWithResult(_0x2df913,null))[_0x2764('0x3d')](handleError(_0x2df913,null));};exports[_0x2764('0x46')]=function(_0xb7848b,_0x4ec216,_0x3835fb){var _0x5a3d46={};var _0x4d1575={};var _0x262865;var _0x390324;return db[_0x2764('0x39')][_0x2764('0x44')]({'where':{'id':_0xb7848b[_0x2764('0x42')]['id']}})[_0x2764('0x1e')](handleEntityNotFound(_0x4ec216,null))[_0x2764('0x1e')](function(_0x993424){if(_0x993424){_0x262865=_0x993424;_0x4d1575[_0x2764('0x2b')]=_[_0x2764('0x29')](db[_0x2764('0x45')][_0x2764('0x25')]);_0x4d1575[_0x2764('0x28')]=_[_0x2764('0x29')](_0xb7848b[_0x2764('0x28')]);_0x4d1575['filters']=_[_0x2764('0x2a')](_0x4d1575[_0x2764('0x2b')],_0x4d1575[_0x2764('0x28')]);_0x5a3d46['attributes']=_[_0x2764('0x2a')](_0x4d1575[_0x2764('0x2b')],qs['fields'](_0xb7848b[_0x2764('0x28')][_0x2764('0x2d')]));_0x5a3d46[_0x2764('0x2c')]=_0x5a3d46[_0x2764('0x2c')][_0x2764('0x2e')]?_0x5a3d46[_0x2764('0x2c')]:_0x4d1575[_0x2764('0x2b')];_0x5a3d46[_0x2764('0x31')]=qs[_0x2764('0x32')](_0xb7848b[_0x2764('0x28')][_0x2764('0x32')]);_0x5a3d46['where']=qs['filters'](_[_0x2764('0x47')](_0xb7848b[_0x2764('0x28')],_0x4d1575[_0x2764('0x33')]));if(_0xb7848b[_0x2764('0x28')]['filter']){_0x5a3d46[_0x2764('0x35')]=_[_0x2764('0x36')](_0x5a3d46[_0x2764('0x35')],{'$or':_[_0x2764('0x24')](_0x5a3d46[_0x2764('0x2c')],function(_0x53c6d8){var _0x556193={};_0x556193[_0x53c6d8]={'$like':'%'+_0xb7848b[_0x2764('0x28')][_0x2764('0x34')]+'%'};return _0x556193;})});}_0x5a3d46=_[_0x2764('0x36')]({},_0x5a3d46,_0xb7848b['options']);return _0x262865[_0x2764('0x46')](_0x5a3d46);}})[_0x2764('0x1e')](function(_0x1686e6){if(_0x1686e6){_0x390324=_0x1686e6[_0x2764('0x2e')];if(!_0xb7848b[_0x2764('0x28')][_0x2764('0x2f')](_0x2764('0x30'))){_0x5a3d46[_0x2764('0x15')]=qs[_0x2764('0x15')](_0xb7848b[_0x2764('0x28')][_0x2764('0x15')]);_0x5a3d46[_0x2764('0x18')]=qs[_0x2764('0x18')](_0xb7848b[_0x2764('0x28')][_0x2764('0x18')]);}return _0x262865[_0x2764('0x46')](_0x5a3d46);}})[_0x2764('0x1e')](function(_0x5163c1){if(_0x5163c1){return _0x5163c1?{'count':_0x390324,'rows':_0x5163c1}:null;}})[_0x2764('0x1e')](respondWithResult(_0x4ec216,null))[_0x2764('0x3d')](handleError(_0x4ec216,null));};exports['getDescriptions']=function(_0x1eaaa6,_0x421fcb,_0x3590c3){var _0x450220={};var _0x5c696e={};var _0x5c53b1;var _0x1be3b0;return db[_0x2764('0x39')][_0x2764('0x44')]({'where':{'id':_0x1eaaa6[_0x2764('0x42')]['id']}})[_0x2764('0x1e')](handleEntityNotFound(_0x421fcb,null))[_0x2764('0x1e')](function(_0x558397){if(_0x558397){_0x5c53b1=_0x558397;_0x5c696e[_0x2764('0x2b')]=_['keys'](db[_0x2764('0x45')][_0x2764('0x25')]);_0x5c696e['query']=_['keys'](_0x1eaaa6[_0x2764('0x28')]);_0x5c696e[_0x2764('0x33')]=_[_0x2764('0x2a')](_0x5c696e[_0x2764('0x2b')],_0x5c696e[_0x2764('0x28')]);_0x450220[_0x2764('0x2c')]=_[_0x2764('0x2a')](_0x5c696e[_0x2764('0x2b')],qs[_0x2764('0x2d')](_0x1eaaa6['query'][_0x2764('0x2d')]));_0x450220[_0x2764('0x2c')]=_0x450220[_0x2764('0x2c')][_0x2764('0x2e')]?_0x450220['attributes']:_0x5c696e[_0x2764('0x2b')];_0x450220['order']=qs[_0x2764('0x32')](_0x1eaaa6[_0x2764('0x28')]['sort']);_0x450220[_0x2764('0x35')]=qs[_0x2764('0x33')](_[_0x2764('0x47')](_0x1eaaa6[_0x2764('0x28')],_0x5c696e[_0x2764('0x33')]));if(_0x1eaaa6['query'][_0x2764('0x34')]){_0x450220[_0x2764('0x35')]=_[_0x2764('0x36')](_0x450220[_0x2764('0x35')],{'$or':_[_0x2764('0x24')](_0x450220[_0x2764('0x2c')],function(_0x2ccf4b){var _0x2d57ce={};_0x2d57ce[_0x2ccf4b]={'$like':'%'+_0x1eaaa6[_0x2764('0x28')][_0x2764('0x34')]+'%'};return _0x2d57ce;})});}_0x450220=_[_0x2764('0x36')]({},_0x450220,_0x1eaaa6[_0x2764('0x38')]);return _0x5c53b1[_0x2764('0x48')](_0x450220);}})[_0x2764('0x1e')](function(_0x551aca){if(_0x551aca){_0x1be3b0=_0x551aca[_0x2764('0x2e')];if(!_0x1eaaa6[_0x2764('0x28')][_0x2764('0x2f')](_0x2764('0x30'))){_0x450220['limit']=qs['limit'](_0x1eaaa6[_0x2764('0x28')][_0x2764('0x15')]);_0x450220['offset']=qs['offset'](_0x1eaaa6[_0x2764('0x28')][_0x2764('0x18')]);}return _0x5c53b1[_0x2764('0x48')](_0x450220);}})[_0x2764('0x1e')](function(_0x26ed03){if(_0x26ed03){return _0x26ed03?{'count':_0x1be3b0,'rows':_0x26ed03}:null;}})[_0x2764('0x1e')](respondWithResult(_0x421fcb,null))[_0x2764('0x3d')](handleError(_0x421fcb,null));};exports[_0x2764('0x49')]=function(_0x57c2cd,_0x2fafed,_0x2d9fa1){var _0x317234={};var _0x561674={};var _0x123e9c;var _0x56aaa1;return db[_0x2764('0x39')][_0x2764('0x44')]({'where':{'id':_0x57c2cd[_0x2764('0x42')]['id']}})[_0x2764('0x1e')](handleEntityNotFound(_0x2fafed,null))['then'](function(_0x372111){if(_0x372111){_0x123e9c=_0x372111;_0x561674[_0x2764('0x2b')]=_['keys'](db[_0x2764('0x4a')][_0x2764('0x25')]);_0x561674[_0x2764('0x28')]=_[_0x2764('0x29')](_0x57c2cd[_0x2764('0x28')]);_0x561674[_0x2764('0x33')]=_['intersection'](_0x561674[_0x2764('0x2b')],_0x561674[_0x2764('0x28')]);_0x317234[_0x2764('0x2c')]=_['intersection'](_0x561674[_0x2764('0x2b')],qs['fields'](_0x57c2cd[_0x2764('0x28')]['fields']));_0x317234[_0x2764('0x2c')]=_0x317234['attributes']['length']?_0x317234['attributes']:_0x561674[_0x2764('0x2b')];_0x317234[_0x2764('0x31')]=qs[_0x2764('0x32')](_0x57c2cd['query'][_0x2764('0x32')]);_0x317234[_0x2764('0x35')]=qs['filters'](_[_0x2764('0x47')](_0x57c2cd[_0x2764('0x28')],_0x561674[_0x2764('0x33')]));if(_0x57c2cd['query'][_0x2764('0x34')]){_0x317234[_0x2764('0x35')]=_[_0x2764('0x36')](_0x317234[_0x2764('0x35')],{'$or':_['map'](_0x317234[_0x2764('0x2c')],function(_0x31e6ff){var _0x3d1e37={};_0x3d1e37[_0x31e6ff]={'$like':'%'+_0x57c2cd['query'][_0x2764('0x34')]+'%'};return _0x3d1e37;})});}_0x317234=_[_0x2764('0x36')]({},_0x317234,_0x57c2cd[_0x2764('0x38')]);return _0x123e9c['getTags'](_0x317234);}})['then'](function(_0x3f0b6a){if(_0x3f0b6a){_0x56aaa1=_0x3f0b6a[_0x2764('0x2e')];if(!_0x57c2cd['query'][_0x2764('0x2f')]('nolimit')){_0x317234[_0x2764('0x15')]=qs[_0x2764('0x15')](_0x57c2cd['query']['limit']);_0x317234[_0x2764('0x18')]=qs[_0x2764('0x18')](_0x57c2cd[_0x2764('0x28')]['offset']);}return _0x123e9c[_0x2764('0x49')](_0x317234);}})['then'](function(_0x5907e4){if(_0x5907e4){return _0x5907e4?{'count':_0x56aaa1,'rows':_0x5907e4}:null;}})[_0x2764('0x1e')](respondWithResult(_0x2fafed,null))[_0x2764('0x3d')](handleError(_0x2fafed,null));};exports[_0x2764('0x4b')]=function(_0x5ceb83,_0x203e3c,_0x58dc81){if(_0x5ceb83[_0x2764('0x40')]['id']){delete _0x5ceb83[_0x2764('0x40')]['id'];}return db[_0x2764('0x39')][_0x2764('0x44')]({'where':{'id':_0x5ceb83[_0x2764('0x42')]['id']}})[_0x2764('0x1e')](handleEntityNotFound(_0x203e3c,null))[_0x2764('0x1e')](function(_0x20b29b){if(_0x20b29b){return _0x20b29b['setTags'](_0x5ceb83[_0x2764('0x40')]['ids']||[]);}return null;})[_0x2764('0x1e')](respondWithResult(_0x203e3c,null))[_0x2764('0x3d')](handleError(_0x203e3c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 9d860a9..fb6b877 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 _0x51ba=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','int_freshdesk_configurations','util','../../config/logger'];(function(_0x135411,_0x3c6a8f){var _0x1bbc84=function(_0xdc002c){while(--_0xdc002c){_0x135411['push'](_0x135411['shift']());}};_0x1bbc84(++_0x3c6a8f);}(_0x51ba,0x6c));var _0xa51b=function(_0x51c77d,_0x1964fe){_0x51c77d=_0x51c77d-0x0;var _0x1256e6=_0x51ba[_0x51c77d];return _0x1256e6;};'use strict';var _=require('lodash');var util=require(_0xa51b('0x0'));var logger=require(_0xa51b('0x1'))(_0xa51b('0x2'));var moment=require('moment');var BPromise=require(_0xa51b('0x3'));var rp=require(_0xa51b('0x4'));var fs=require('fs');var path=require(_0xa51b('0x5'));var rimraf=require(_0xa51b('0x6'));var config=require(_0xa51b('0x7'));var attributes=require(_0xa51b('0x8'));module['exports']=function(_0xf9d50c,_0xa47049){return _0xf9d50c['define']('FreshdeskConfiguration',attributes,{'tableName':_0xa51b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5a2=['request-promise','path','../../config/environment','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','moment','bluebird'];(function(_0x159533,_0x2d49ce){var _0x1111f5=function(_0x2e4edc){while(--_0x2e4edc){_0x159533['push'](_0x159533['shift']());}};_0x1111f5(++_0x2d49ce);}(_0xe5a2,0x1b4));var _0x2e5a=function(_0x3ec2ea,_0x4fdbf7){_0x3ec2ea=_0x3ec2ea-0x0;var _0x32d4ac=_0xe5a2[_0x3ec2ea];return _0x32d4ac;};'use strict';var _=require('lodash');var util=require(_0x2e5a('0x0'));var logger=require(_0x2e5a('0x1'))('api');var moment=require(_0x2e5a('0x2'));var BPromise=require(_0x2e5a('0x3'));var rp=require(_0x2e5a('0x4'));var fs=require('fs');var path=require(_0x2e5a('0x5'));var rimraf=require('rimraf');var config=require(_0x2e5a('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x2d328e,_0x3921b0){return _0x2d328e[_0x2e5a('0x7')](_0x2e5a('0x8'),attributes,{'tableName':_0x2e5a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 1ebad33..2f2a8d4 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 _0x700f=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x700f,0x101));var _0xf700=function(_0x567403,_0x29eb04){_0x567403=_0x567403-0x0;var _0x27cef5=_0x700f[_0x567403];return _0x27cef5;};'use strict';var _=require(_0xf700('0x0'));var util=require('util');var moment=require(_0xf700('0x1'));var BPromise=require(_0xf700('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf700('0x3'));var db=require(_0xf700('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf700('0x5'))(_0xf700('0x6'));var config=require(_0xf700('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf700('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47493b,_0x44fe55,_0xf4b028){return new BPromise(function(_0x2fa64,_0x24bcbc){return client[_0xf700('0x9')](_0x47493b,_0xf4b028)[_0xf700('0xa')](function(_0x498a79){logger[_0xf700('0xb')](_0xf700('0xc'),_0x44fe55,_0xf700('0xd'));logger[_0xf700('0xe')](_0xf700('0xf'),_0x44fe55,_0xf700('0xd'),JSON[_0xf700('0x10')](_0x498a79));if(_0x498a79[_0xf700('0x11')]){if(_0x498a79[_0xf700('0x11')][_0xf700('0x12')]===0x1f4){logger[_0xf700('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x44fe55,_0x498a79[_0xf700('0x11')][_0xf700('0x13')]);return _0x24bcbc(_0x498a79[_0xf700('0x11')][_0xf700('0x13')]);}logger[_0xf700('0x11')](_0xf700('0xc'),_0x44fe55,_0x498a79['error'][_0xf700('0x13')]);return _0x2fa64(_0x498a79[_0xf700('0x11')][_0xf700('0x13')]);}else{logger[_0xf700('0xb')](_0xf700('0xc'),_0x44fe55,_0xf700('0xd'));_0x2fa64(_0x498a79['result'][_0xf700('0x13')]);}})['catch'](function(_0x3b9f58){logger[_0xf700('0x11')](_0xf700('0xc'),_0x44fe55,_0x3b9f58);_0x24bcbc(_0x3b9f58);});});} \ No newline at end of file +var _0xbed3=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x183b11,_0x155358){var _0x2ab891=function(_0x49726b){while(--_0x49726b){_0x183b11['push'](_0x183b11['shift']());}};_0x2ab891(++_0x155358);}(_0xbed3,0x129));var _0x3bed=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbed3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x3bed('0x0'));var util=require(_0x3bed('0x1'));var moment=require(_0x3bed('0x2'));var BPromise=require('bluebird');var rs=require(_0x3bed('0x3'));var fs=require('fs');var Redis=require(_0x3bed('0x4'));var db=require(_0x3bed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3bed('0x6'))(_0x3bed('0x7'));var config=require('../../config/environment');var jayson=require(_0x3bed('0x8'));var client=jayson[_0x3bed('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56b717,_0x3572c3,_0x48443c){return new BPromise(function(_0x526a01,_0x3c925d){return client['request'](_0x56b717,_0x48443c)[_0x3bed('0xa')](function(_0x452913){logger[_0x3bed('0xb')](_0x3bed('0xc'),_0x3572c3,'request\x20sent');logger[_0x3bed('0xd')](_0x3bed('0xe'),_0x3572c3,_0x3bed('0xf'),JSON[_0x3bed('0x10')](_0x452913));if(_0x452913[_0x3bed('0x11')]){if(_0x452913['error']['code']===0x1f4){logger['error'](_0x3bed('0xc'),_0x3572c3,_0x452913[_0x3bed('0x11')][_0x3bed('0x12')]);return _0x3c925d(_0x452913[_0x3bed('0x11')]['message']);}logger[_0x3bed('0x11')](_0x3bed('0xc'),_0x3572c3,_0x452913[_0x3bed('0x11')][_0x3bed('0x12')]);return _0x526a01(_0x452913[_0x3bed('0x11')][_0x3bed('0x12')]);}else{logger[_0x3bed('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3572c3,_0x3bed('0xf'));_0x526a01(_0x452913[_0x3bed('0x13')]['message']);}})[_0x3bed('0x14')](function(_0x43b5f6){logger[_0x3bed('0x11')](_0x3bed('0xc'),_0x3572c3,_0x43b5f6);_0x3c925d(_0x43b5f6);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 7be8696..6038aa3 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 _0x1aa2=['post','create','put','/:id','delete','multer','util','path','connect-timeout','Router','../../components/interaction/service','index','get','isAuthenticated','show'];(function(_0x1eb3b0,_0x84bc40){var _0xbecd61=function(_0x442e68){while(--_0x442e68){_0x1eb3b0['push'](_0x1eb3b0['shift']());}};_0xbecd61(++_0x84bc40);}(_0x1aa2,0xd7));var _0x21aa=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0x1aa2[_0x4b4f24];return _0x1c13d4;};'use strict';var multer=require(_0x21aa('0x0'));var util=require(_0x21aa('0x1'));var path=require(_0x21aa('0x2'));var timeout=require(_0x21aa('0x3'));var express=require('express');var router=express[_0x21aa('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x21aa('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x21aa('0x6')]);router[_0x21aa('0x7')]('/:id',auth[_0x21aa('0x8')](),controller[_0x21aa('0x9')]);router[_0x21aa('0xa')]('/',auth[_0x21aa('0x8')](),controller[_0x21aa('0xb')]);router[_0x21aa('0xc')](_0x21aa('0xd'),auth[_0x21aa('0x8')](),controller['update']);router[_0x21aa('0xe')](_0x21aa('0xd'),auth[_0x21aa('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xefe1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x20076b,_0x4f218e){var _0x1ae3de=function(_0x545d7a){while(--_0x545d7a){_0x20076b['push'](_0x20076b['shift']());}};_0x1ae3de(++_0x4f218e);}(_0xefe1,0x13f));var _0x1efe=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xefe1[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x1efe('0x0'));var util=require(_0x1efe('0x1'));var path=require(_0x1efe('0x2'));var timeout=require(_0x1efe('0x3'));var express=require(_0x1efe('0x4'));var router=express['Router']();var fs_extra=require(_0x1efe('0x5'));var auth=require(_0x1efe('0x6'));var interaction=require(_0x1efe('0x7'));var config=require(_0x1efe('0x8'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1efe('0x9')](_0x1efe('0xa'),auth[_0x1efe('0xb')](),controller['show']);router[_0x1efe('0xc')]('/',auth[_0x1efe('0xb')](),controller['create']);router[_0x1efe('0xd')](_0x1efe('0xa'),auth['isAuthenticated'](),controller[_0x1efe('0xe')]);router[_0x1efe('0xf')](_0x1efe('0xa'),auth[_0x1efe('0xb')](),controller[_0x1efe('0x10')]);module[_0x1efe('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index a402148..ddb1d8a 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 _0x9c24=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x480370,_0x101481){var _0x52025a=function(_0x3a0b33){while(--_0x3a0b33){_0x480370['push'](_0x480370['shift']());}};_0x52025a(++_0x101481);}(_0x9c24,0x1aa));var _0x49c2=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x9c24[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0x49c2('0x0'));module[_0x49c2('0x1')]={'type':{'type':Sequelize[_0x49c2('0x2')](_0x49c2('0x3'),_0x49c2('0x4'),_0x49c2('0x5'),_0x49c2('0x6'),_0x49c2('0x7')),'defaultValue':_0x49c2('0x3')},'content':{'type':Sequelize[_0x49c2('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x49c2('0x2')]('string','variable',_0x49c2('0x5'))},'keyContent':{'type':Sequelize[_0x49c2('0x8')]},'idField':{'type':Sequelize[_0x49c2('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x49c2('0x8')]}}; \ No newline at end of file +var _0xe511=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x3e240a,_0x252254){var _0x2eb250=function(_0x44079d){while(--_0x44079d){_0x3e240a['push'](_0x3e240a['shift']());}};_0x2eb250(++_0x252254);}(_0xe511,0x1e7));var _0x1e51=function(_0x3dbeae,_0x48de1c){_0x3dbeae=_0x3dbeae-0x0;var _0x545eff=_0xe511[_0x3dbeae];return _0x545eff;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'type':{'type':Sequelize[_0x1e51('0x2')](_0x1e51('0x3'),_0x1e51('0x4'),_0x1e51('0x5'),_0x1e51('0x6'),_0x1e51('0x7')),'defaultValue':_0x1e51('0x3')},'content':{'type':Sequelize[_0x1e51('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1e51('0x2')](_0x1e51('0x3'),_0x1e51('0x4'),_0x1e51('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1e51('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1e51('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 819e909..91bea43 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.controller.js +++ b/server/api/intFreshdeskField/intFreshdeskField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e6c=['set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x4ce1b9,_0x397a4b){var _0x2bb15d=function(_0x3790ad){while(--_0x3790ad){_0x4ce1b9['push'](_0x4ce1b9['shift']());}};_0x2bb15d(++_0x397a4b);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xc6e6('0x0'));var rimraf=require(_0xc6e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6e6('0x2'));var rp=require(_0xc6e6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6e6('0x4'));var util=require('util');var path=require(_0xc6e6('0x5'));var sox=require('sox');var csv=require(_0xc6e6('0x6'));var ejs=require(_0xc6e6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6e6('0x8'));var squel=require(_0xc6e6('0x9'));var crypto=require('crypto');var jsforce=require(_0xc6e6('0xa'));var deskjs=require(_0xc6e6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc6e6('0xc'));var Papa=require('papaparse');var Redis=require(_0xc6e6('0xd'));var authService=require(_0xc6e6('0xe'));var qs=require(_0xc6e6('0xf'));var as=require(_0xc6e6('0x10'));var hardwareService=require(_0xc6e6('0x11'));var logger=require(_0xc6e6('0x12'))(_0xc6e6('0x13'));var utils=require(_0xc6e6('0x14'));var config=require(_0xc6e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6e6('0x16'))['db'];function respondWithStatusCode(_0x525d60,_0x3a30ce){_0x3a30ce=_0x3a30ce||0xcc;return function(_0x314d0f){if(_0x314d0f){return _0x525d60[_0xc6e6('0x17')](_0x3a30ce);}return _0x525d60[_0xc6e6('0x18')](_0x3a30ce)['end']();};}function respondWithResult(_0x149ac6,_0x2bfe7d){_0x2bfe7d=_0x2bfe7d||0xc8;return function(_0x13be73){if(_0x13be73){return _0x149ac6[_0xc6e6('0x18')](_0x2bfe7d)[_0xc6e6('0x19')](_0x13be73);}};}function respondWithFilteredResult(_0x4cdf15,_0x413cf8){return function(_0x178b34){if(_0x178b34){var _0x569474=typeof _0x413cf8[_0xc6e6('0x1a')]===_0xc6e6('0x1b')&&typeof _0x413cf8[_0xc6e6('0x1c')]==='undefined';var _0x51fd7c=_0x178b34['count'];var _0x3a1ccc=_0x569474?0x0:_0x413cf8['offset'];var _0x46e58f=_0x569474?_0x178b34[_0xc6e6('0x1d')]:_0x413cf8[_0xc6e6('0x1a')]+_0x413cf8[_0xc6e6('0x1c')];var _0x19e1e4;if(_0x46e58f>=_0x51fd7c){_0x46e58f=_0x51fd7c;_0x19e1e4=0xc8;}else{_0x19e1e4=0xce;}_0x4cdf15[_0xc6e6('0x18')](_0x19e1e4);return _0x4cdf15[_0xc6e6('0x1e')](_0xc6e6('0x1f'),_0x3a1ccc+'-'+_0x46e58f+'/'+_0x51fd7c)[_0xc6e6('0x19')](_0x178b34);}return null;};}function patchUpdates(_0x3d734d){return function(_0x4a36b6){try{jsonpatch[_0xc6e6('0x20')](_0x4a36b6,_0x3d734d,!![]);}catch(_0x4ad70e){return BPromise[_0xc6e6('0x21')](_0x4ad70e);}return _0x4a36b6[_0xc6e6('0x22')]();};}function saveUpdates(_0x2be6fc,_0x2f69f1){return function(_0x4f1d68){if(_0x4f1d68){return _0x4f1d68[_0xc6e6('0x23')](_0x2be6fc)[_0xc6e6('0x24')](function(_0x3a96df){return _0x3a96df;});}return null;};}function removeEntity(_0x36ebfa,_0x107561){return function(_0x4c35ae){if(_0x4c35ae){return _0x4c35ae[_0xc6e6('0x25')]()['then'](function(){_0x36ebfa[_0xc6e6('0x18')](0xcc)[_0xc6e6('0x26')]();});}};}function handleEntityNotFound(_0x2e5e0e,_0x64e1dc){return function(_0x53a1bf){if(!_0x53a1bf){_0x2e5e0e[_0xc6e6('0x17')](0x194);}return _0x53a1bf;};}function handleError(_0x5a5e47,_0x28577b){_0x28577b=_0x28577b||0x1f4;return function(_0x534745){logger[_0xc6e6('0x27')](_0x534745[_0xc6e6('0x28')]);if(_0x534745[_0xc6e6('0x29')]){delete _0x534745[_0xc6e6('0x29')];}_0x5a5e47[_0xc6e6('0x18')](_0x28577b)['send'](_0x534745);};}exports[_0xc6e6('0x2a')]=function(_0x1501bd,_0x166313){var _0x1af05c={},_0x4d1284={},_0x34ae96={'count':0x0,'rows':[]};var _0x50b735=_[_0xc6e6('0x2b')](db[_0xc6e6('0x2c')][_0xc6e6('0x2d')],function(_0xc578b3){return{'name':_0xc578b3[_0xc6e6('0x2e')],'type':_0xc578b3[_0xc6e6('0x2f')][_0xc6e6('0x30')]};});_0x4d1284[_0xc6e6('0x31')]=_[_0xc6e6('0x2b')](_0x50b735,_0xc6e6('0x29'));_0x4d1284[_0xc6e6('0x32')]=_[_0xc6e6('0x33')](_0x1501bd[_0xc6e6('0x32')]);_0x4d1284[_0xc6e6('0x34')]=_[_0xc6e6('0x35')](_0x4d1284[_0xc6e6('0x31')],_0x4d1284[_0xc6e6('0x32')]);_0x1af05c['attributes']=_[_0xc6e6('0x35')](_0x4d1284[_0xc6e6('0x31')],qs['fields'](_0x1501bd['query'][_0xc6e6('0x36')]));_0x1af05c[_0xc6e6('0x37')]=_0x1af05c[_0xc6e6('0x37')][_0xc6e6('0x38')]?_0x1af05c[_0xc6e6('0x37')]:_0x4d1284[_0xc6e6('0x31')];if(!_0x1501bd['query'][_0xc6e6('0x39')](_0xc6e6('0x3a'))){_0x1af05c[_0xc6e6('0x1c')]=qs['limit'](_0x1501bd['query'][_0xc6e6('0x1c')]);_0x1af05c[_0xc6e6('0x1a')]=qs[_0xc6e6('0x1a')](_0x1501bd[_0xc6e6('0x32')]['offset']);}_0x1af05c['order']=qs[_0xc6e6('0x3b')](_0x1501bd['query'][_0xc6e6('0x3b')]);_0x1af05c['where']=qs[_0xc6e6('0x34')](_[_0xc6e6('0x3c')](_0x1501bd[_0xc6e6('0x32')],_0x4d1284[_0xc6e6('0x34')]),_0x50b735);if(_0x1501bd['query']['filter']){_0x1af05c[_0xc6e6('0x3d')]=_[_0xc6e6('0x3e')](_0x1af05c[_0xc6e6('0x3d')],{'$or':_[_0xc6e6('0x2b')](_0x50b735,function(_0x4bb732){if(_0x4bb732['type']!==_0xc6e6('0x3f')){var _0x1326c7={};_0x1326c7[_0x4bb732[_0xc6e6('0x29')]]={'$like':'%'+_0x1501bd[_0xc6e6('0x32')]['filter']+'%'};return _0x1326c7;}})});}_0x1af05c=_[_0xc6e6('0x3e')]({},_0x1af05c,_0x1501bd[_0xc6e6('0x40')]);var _0x5ddab4={'where':_0x1af05c['where']};return db[_0xc6e6('0x2c')]['count'](_0x5ddab4)[_0xc6e6('0x24')](function(_0x3817fc){_0x34ae96['count']=_0x3817fc;if(_0x1501bd[_0xc6e6('0x32')]['includeAll']){_0x1af05c[_0xc6e6('0x41')]=[{'all':!![]}];}return db['FreshdeskField'][_0xc6e6('0x42')](_0x1af05c);})[_0xc6e6('0x24')](function(_0x247076){_0x34ae96[_0xc6e6('0x43')]=_0x247076;return _0x34ae96;})[_0xc6e6('0x24')](respondWithFilteredResult(_0x166313,_0x1af05c))[_0xc6e6('0x44')](handleError(_0x166313,null));};exports[_0xc6e6('0x45')]=function(_0x69766,_0x5ecf6c){var _0x5722db={'raw':!![],'where':{'id':_0x69766[_0xc6e6('0x46')]['id']}},_0x3e3da6={};_0x3e3da6[_0xc6e6('0x31')]=_[_0xc6e6('0x33')](db['FreshdeskField'][_0xc6e6('0x2d')]);_0x3e3da6[_0xc6e6('0x32')]=_[_0xc6e6('0x33')](_0x69766[_0xc6e6('0x32')]);_0x3e3da6['filters']=_[_0xc6e6('0x35')](_0x3e3da6[_0xc6e6('0x31')],_0x3e3da6[_0xc6e6('0x32')]);_0x5722db[_0xc6e6('0x37')]=_[_0xc6e6('0x35')](_0x3e3da6['model'],qs[_0xc6e6('0x36')](_0x69766['query'][_0xc6e6('0x36')]));_0x5722db['attributes']=_0x5722db[_0xc6e6('0x37')][_0xc6e6('0x38')]?_0x5722db[_0xc6e6('0x37')]:_0x3e3da6[_0xc6e6('0x31')];if(_0x69766[_0xc6e6('0x32')][_0xc6e6('0x47')]){_0x5722db[_0xc6e6('0x41')]=[{'all':!![]}];}_0x5722db=_[_0xc6e6('0x3e')]({},_0x5722db,_0x69766['options']);return db[_0xc6e6('0x2c')][_0xc6e6('0x48')](_0x5722db)[_0xc6e6('0x24')](handleEntityNotFound(_0x5ecf6c,null))['then'](respondWithResult(_0x5ecf6c,null))[_0xc6e6('0x44')](handleError(_0x5ecf6c,null));};exports[_0xc6e6('0x49')]=function(_0x38ecc3,_0x42ed90){return db[_0xc6e6('0x2c')][_0xc6e6('0x49')](_0x38ecc3[_0xc6e6('0x4a')],{})[_0xc6e6('0x24')](respondWithResult(_0x42ed90,0xc9))[_0xc6e6('0x44')](handleError(_0x42ed90,null));};exports[_0xc6e6('0x23')]=function(_0x3bfe85,_0x470167){if(_0x3bfe85[_0xc6e6('0x4a')]['id']){delete _0x3bfe85[_0xc6e6('0x4a')]['id'];}return db['FreshdeskField'][_0xc6e6('0x48')]({'where':{'id':_0x3bfe85['params']['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x470167,null))[_0xc6e6('0x24')](saveUpdates(_0x3bfe85['body'],null))['then'](respondWithResult(_0x470167,null))['catch'](handleError(_0x470167,null));};exports['destroy']=function(_0x531dca,_0x3edc16){return db[_0xc6e6('0x2c')][_0xc6e6('0x48')]({'where':{'id':_0x531dca[_0xc6e6('0x46')]['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x3edc16,null))['then'](removeEntity(_0x3edc16,null))['catch'](handleError(_0x3edc16,null));}; \ No newline at end of file +var _0x6f2f=['Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','update','body','eml-format','rimraf','moment','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count'];(function(_0x33c70e,_0xd8cb0b){var _0x5a33e5=function(_0x3b7f9d){while(--_0x3b7f9d){_0x33c70e['push'](_0x33c70e['shift']());}};_0x5a33e5(++_0xd8cb0b);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x6f2f[_0x2283dc];return _0x16db90;};'use strict';var emlformat=require(_0xf6f2('0x0'));var rimraf=require(_0xf6f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf6f2('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf6f2('0x3'));var path=require(_0xf6f2('0x4'));var sox=require(_0xf6f2('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6f2('0x6'));var _=require(_0xf6f2('0x7'));var squel=require(_0xf6f2('0x8'));var crypto=require(_0xf6f2('0x9'));var jsforce=require(_0xf6f2('0xa'));var deskjs=require(_0xf6f2('0xb'));var toCsv=require(_0xf6f2('0xc'));var querystring=require(_0xf6f2('0xd'));var Papa=require(_0xf6f2('0xe'));var Redis=require(_0xf6f2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf6f2('0x10'));var as=require(_0xf6f2('0x11'));var hardwareService=require(_0xf6f2('0x12'));var logger=require(_0xf6f2('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf6f2('0x14'));var db=require(_0xf6f2('0x15'))['db'];function respondWithStatusCode(_0x131a18,_0x4afa2){_0x4afa2=_0x4afa2||0xcc;return function(_0x1626ce){if(_0x1626ce){return _0x131a18[_0xf6f2('0x16')](_0x4afa2);}return _0x131a18['status'](_0x4afa2)[_0xf6f2('0x17')]();};}function respondWithResult(_0x5ef5ac,_0xccf687){_0xccf687=_0xccf687||0xc8;return function(_0x3cf95f){if(_0x3cf95f){return _0x5ef5ac[_0xf6f2('0x18')](_0xccf687)['json'](_0x3cf95f);}};}function respondWithFilteredResult(_0x2b28c1,_0x27c0dc){return function(_0x314f9a){if(_0x314f9a){var _0x26c176=typeof _0x27c0dc[_0xf6f2('0x19')]===_0xf6f2('0x1a')&&typeof _0x27c0dc[_0xf6f2('0x1b')]===_0xf6f2('0x1a');var _0x4115dd=_0x314f9a[_0xf6f2('0x1c')];var _0x400055=_0x26c176?0x0:_0x27c0dc[_0xf6f2('0x19')];var _0x42b93b=_0x26c176?_0x314f9a[_0xf6f2('0x1c')]:_0x27c0dc[_0xf6f2('0x19')]+_0x27c0dc['limit'];var _0x4de8bd;if(_0x42b93b>=_0x4115dd){_0x42b93b=_0x4115dd;_0x4de8bd=0xc8;}else{_0x4de8bd=0xce;}_0x2b28c1[_0xf6f2('0x18')](_0x4de8bd);return _0x2b28c1['set'](_0xf6f2('0x1d'),_0x400055+'-'+_0x42b93b+'/'+_0x4115dd)[_0xf6f2('0x1e')](_0x314f9a);}return null;};}function patchUpdates(_0x312429){return function(_0x1ad76b){try{jsonpatch['apply'](_0x1ad76b,_0x312429,!![]);}catch(_0xd020e6){return BPromise[_0xf6f2('0x1f')](_0xd020e6);}return _0x1ad76b[_0xf6f2('0x20')]();};}function saveUpdates(_0x3321a0,_0x5dce4f){return function(_0x19be8e){if(_0x19be8e){return _0x19be8e['update'](_0x3321a0)[_0xf6f2('0x21')](function(_0x56b97a){return _0x56b97a;});}return null;};}function removeEntity(_0x1e33c,_0x151905){return function(_0x582862){if(_0x582862){return _0x582862[_0xf6f2('0x22')]()[_0xf6f2('0x21')](function(){_0x1e33c[_0xf6f2('0x18')](0xcc)[_0xf6f2('0x17')]();});}};}function handleEntityNotFound(_0x219a12,_0x1f3500){return function(_0x3304ec){if(!_0x3304ec){_0x219a12[_0xf6f2('0x16')](0x194);}return _0x3304ec;};}function handleError(_0x5dac6a,_0x2b233f){_0x2b233f=_0x2b233f||0x1f4;return function(_0x2081f6){logger[_0xf6f2('0x23')](_0x2081f6[_0xf6f2('0x24')]);if(_0x2081f6[_0xf6f2('0x25')]){delete _0x2081f6[_0xf6f2('0x25')];}_0x5dac6a[_0xf6f2('0x18')](_0x2b233f)[_0xf6f2('0x26')](_0x2081f6);};}exports[_0xf6f2('0x27')]=function(_0x40243e,_0x2c643d){var _0x4accfe={},_0x2aa645={},_0x26c4dc={'count':0x0,'rows':[]};var _0x17c63f=_[_0xf6f2('0x28')](db[_0xf6f2('0x29')][_0xf6f2('0x2a')],function(_0x228b24){return{'name':_0x228b24[_0xf6f2('0x2b')],'type':_0x228b24[_0xf6f2('0x2c')][_0xf6f2('0x2d')]};});_0x2aa645[_0xf6f2('0x2e')]=_[_0xf6f2('0x28')](_0x17c63f,'name');_0x2aa645[_0xf6f2('0x2f')]=_[_0xf6f2('0x30')](_0x40243e[_0xf6f2('0x2f')]);_0x2aa645[_0xf6f2('0x31')]=_[_0xf6f2('0x32')](_0x2aa645[_0xf6f2('0x2e')],_0x2aa645[_0xf6f2('0x2f')]);_0x4accfe[_0xf6f2('0x33')]=_[_0xf6f2('0x32')](_0x2aa645[_0xf6f2('0x2e')],qs[_0xf6f2('0x34')](_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x34')]));_0x4accfe['attributes']=_0x4accfe['attributes']['length']?_0x4accfe[_0xf6f2('0x33')]:_0x2aa645[_0xf6f2('0x2e')];if(!_0x40243e['query']['hasOwnProperty'](_0xf6f2('0x35'))){_0x4accfe[_0xf6f2('0x1b')]=qs[_0xf6f2('0x1b')](_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x1b')]);_0x4accfe[_0xf6f2('0x19')]=qs['offset'](_0x40243e[_0xf6f2('0x2f')]['offset']);}_0x4accfe[_0xf6f2('0x36')]=qs[_0xf6f2('0x37')](_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x37')]);_0x4accfe['where']=qs[_0xf6f2('0x31')](_[_0xf6f2('0x38')](_0x40243e[_0xf6f2('0x2f')],_0x2aa645['filters']),_0x17c63f);if(_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x39')]){_0x4accfe[_0xf6f2('0x3a')]=_['merge'](_0x4accfe[_0xf6f2('0x3a')],{'$or':_['map'](_0x17c63f,function(_0x38b20d){if(_0x38b20d[_0xf6f2('0x2c')]!==_0xf6f2('0x3b')){var _0x55e44d={};_0x55e44d[_0x38b20d[_0xf6f2('0x25')]]={'$like':'%'+_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x39')]+'%'};return _0x55e44d;}})});}_0x4accfe=_[_0xf6f2('0x3c')]({},_0x4accfe,_0x40243e[_0xf6f2('0x3d')]);var _0x4ee53f={'where':_0x4accfe[_0xf6f2('0x3a')]};return db[_0xf6f2('0x29')][_0xf6f2('0x1c')](_0x4ee53f)[_0xf6f2('0x21')](function(_0x3986f1){_0x26c4dc[_0xf6f2('0x1c')]=_0x3986f1;if(_0x40243e[_0xf6f2('0x2f')]['includeAll']){_0x4accfe[_0xf6f2('0x3e')]=[{'all':!![]}];}return db[_0xf6f2('0x29')][_0xf6f2('0x3f')](_0x4accfe);})['then'](function(_0x244a8c){_0x26c4dc[_0xf6f2('0x40')]=_0x244a8c;return _0x26c4dc;})[_0xf6f2('0x21')](respondWithFilteredResult(_0x2c643d,_0x4accfe))[_0xf6f2('0x41')](handleError(_0x2c643d,null));};exports[_0xf6f2('0x42')]=function(_0x4c4f17,_0x47090b){var _0x31f367={'raw':!![],'where':{'id':_0x4c4f17[_0xf6f2('0x43')]['id']}},_0x34ba3a={};_0x34ba3a[_0xf6f2('0x2e')]=_['keys'](db[_0xf6f2('0x29')]['rawAttributes']);_0x34ba3a[_0xf6f2('0x2f')]=_[_0xf6f2('0x30')](_0x4c4f17[_0xf6f2('0x2f')]);_0x34ba3a[_0xf6f2('0x31')]=_[_0xf6f2('0x32')](_0x34ba3a[_0xf6f2('0x2e')],_0x34ba3a[_0xf6f2('0x2f')]);_0x31f367[_0xf6f2('0x33')]=_[_0xf6f2('0x32')](_0x34ba3a[_0xf6f2('0x2e')],qs[_0xf6f2('0x34')](_0x4c4f17['query'][_0xf6f2('0x34')]));_0x31f367[_0xf6f2('0x33')]=_0x31f367[_0xf6f2('0x33')]['length']?_0x31f367['attributes']:_0x34ba3a['model'];if(_0x4c4f17[_0xf6f2('0x2f')][_0xf6f2('0x44')]){_0x31f367['include']=[{'all':!![]}];}_0x31f367=_['merge']({},_0x31f367,_0x4c4f17[_0xf6f2('0x3d')]);return db[_0xf6f2('0x29')][_0xf6f2('0x45')](_0x31f367)[_0xf6f2('0x21')](handleEntityNotFound(_0x47090b,null))[_0xf6f2('0x21')](respondWithResult(_0x47090b,null))[_0xf6f2('0x41')](handleError(_0x47090b,null));};exports['create']=function(_0x5b4737,_0x5daa2c){return db['FreshdeskField'][_0xf6f2('0x46')](_0x5b4737['body'],{})[_0xf6f2('0x21')](respondWithResult(_0x5daa2c,0xc9))[_0xf6f2('0x41')](handleError(_0x5daa2c,null));};exports[_0xf6f2('0x47')]=function(_0x3b7d67,_0x28da53){if(_0x3b7d67['body']['id']){delete _0x3b7d67['body']['id'];}return db[_0xf6f2('0x29')]['find']({'where':{'id':_0x3b7d67['params']['id']}})[_0xf6f2('0x21')](handleEntityNotFound(_0x28da53,null))[_0xf6f2('0x21')](saveUpdates(_0x3b7d67[_0xf6f2('0x48')],null))[_0xf6f2('0x21')](respondWithResult(_0x28da53,null))[_0xf6f2('0x41')](handleError(_0x28da53,null));};exports[_0xf6f2('0x22')]=function(_0x5351f5,_0x443277){return db[_0xf6f2('0x29')]['find']({'where':{'id':_0x5351f5[_0xf6f2('0x43')]['id']}})[_0xf6f2('0x21')](handleEntityNotFound(_0x443277,null))[_0xf6f2('0x21')](removeEntity(_0x443277,null))['catch'](handleError(_0x443277,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index f3f56a7..42b0b75 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 _0xefbb=['rimraf','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x16065b,_0x5e000b){var _0x484f0e=function(_0x1a681a){while(--_0x1a681a){_0x16065b['push'](_0x16065b['shift']());}};_0x484f0e(++_0x5e000b);}(_0xefbb,0x11b));var _0xbefb=function(_0x538a2c,_0x142df){_0x538a2c=_0x538a2c-0x0;var _0x4d3269=_0xefbb[_0x538a2c];return _0x4d3269;};'use strict';var _=require(_0xbefb('0x0'));var util=require(_0xbefb('0x1'));var logger=require(_0xbefb('0x2'))(_0xbefb('0x3'));var moment=require(_0xbefb('0x4'));var BPromise=require('bluebird');var rp=require(_0xbefb('0x5'));var fs=require('fs');var path=require(_0xbefb('0x6'));var rimraf=require(_0xbefb('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x48e358,_0x292420){return _0x48e358['define']('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xbefb('0x8'),_0xbefb('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x70c8=['FieldId','../../config/logger','moment','bluebird','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField'];(function(_0x3c3f0c,_0x1f0c60){var _0x2e1c0f=function(_0x1493e2){while(--_0x1493e2){_0x3c3f0c['push'](_0x3c3f0c['shift']());}};_0x2e1c0f(++_0x1f0c60);}(_0x70c8,0xa9));var _0x870c=function(_0x380b29,_0x436efa){_0x380b29=_0x380b29-0x0;var _0x4d0890=_0x70c8[_0x380b29];return _0x4d0890;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x870c('0x0'))('api');var moment=require(_0x870c('0x1'));var BPromise=require(_0x870c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x870c('0x3'));var attributes=require(_0x870c('0x4'));module[_0x870c('0x5')]=function(_0x3e27fa,_0x18c445){return _0x3e27fa[_0x870c('0x6')](_0x870c('0x7'),attributes,{'tableName':_0x870c('0x8'),'paranoid':![],'indexes':[{'name':_0x870c('0x9'),'fields':[_0x870c('0xa'),_0x870c('0xb')],'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 2a43fde..70c346f 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 _0x912f=['request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','FreshdeskField,\x20%s,\x20%s'];(function(_0x4c233e,_0xb01a03){var _0x1dcd1e=function(_0x3d522f){while(--_0x3d522f){_0x4c233e['push'](_0x4c233e['shift']());}};_0x1dcd1e(++_0xb01a03);}(_0x912f,0x126));var _0xf912=function(_0x4d3f44,_0x3dad12){_0x4d3f44=_0x4d3f44-0x0;var _0x199f6f=_0x912f[_0x4d3f44];return _0x199f6f;};'use strict';var _=require('lodash');var util=require(_0xf912('0x0'));var moment=require('moment');var BPromise=require(_0xf912('0x1'));var rs=require(_0xf912('0x2'));var fs=require('fs');var Redis=require(_0xf912('0x3'));var db=require(_0xf912('0x4'))['db'];var utils=require(_0xf912('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf912('0x6'));var jayson=require(_0xf912('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x506dad,_0x28345c,_0x131a43){return new BPromise(function(_0x23582c,_0x43a0aa){return client[_0xf912('0x8')](_0x506dad,_0x131a43)[_0xf912('0x9')](function(_0x2bf0c8){logger[_0xf912('0xa')](_0xf912('0xb'),_0x28345c,_0xf912('0xc'));logger['debug'](_0xf912('0xd'),_0x28345c,_0xf912('0xc'),JSON[_0xf912('0xe')](_0x2bf0c8));if(_0x2bf0c8[_0xf912('0xf')]){if(_0x2bf0c8[_0xf912('0xf')]['code']===0x1f4){logger[_0xf912('0xf')](_0xf912('0xb'),_0x28345c,_0x2bf0c8['error'][_0xf912('0x10')]);return _0x43a0aa(_0x2bf0c8['error'][_0xf912('0x10')]);}logger[_0xf912('0xf')](_0xf912('0xb'),_0x28345c,_0x2bf0c8[_0xf912('0xf')][_0xf912('0x10')]);return _0x23582c(_0x2bf0c8[_0xf912('0xf')][_0xf912('0x10')]);}else{logger[_0xf912('0xa')](_0xf912('0xb'),_0x28345c,'request\x20sent');_0x23582c(_0x2bf0c8[_0xf912('0x11')][_0xf912('0x10')]);}})['catch'](function(_0x393be2){logger[_0xf912('0xf')](_0xf912('0xb'),_0x28345c,_0x393be2);_0x43a0aa(_0x393be2);});});} \ No newline at end of file +var _0xa123=['../../config/environment','jayson/promise','client','http','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x42db23,_0x112b01){var _0x2d1e4e=function(_0x96342f){while(--_0x96342f){_0x42db23['push'](_0x42db23['shift']());}};_0x2d1e4e(++_0x112b01);}(_0xa123,0x10d));var _0x3a12=function(_0xabb1ce,_0x5a5ca7){_0xabb1ce=_0xabb1ce-0x0;var _0x23f75e=_0xa123[_0xabb1ce];return _0x23f75e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3a12('0x0'));var BPromise=require(_0x3a12('0x1'));var rs=require(_0x3a12('0x2'));var fs=require('fs');var Redis=require(_0x3a12('0x3'));var db=require(_0x3a12('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a12('0x5'))(_0x3a12('0x6'));var config=require(_0x3a12('0x7'));var jayson=require(_0x3a12('0x8'));var client=jayson[_0x3a12('0x9')][_0x3a12('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x138b4c,_0xd3f1cb,_0x62c457){return new BPromise(function(_0x5a5b34,_0x1599ef){return client['request'](_0x138b4c,_0x62c457)[_0x3a12('0xb')](function(_0x569fe4){logger['info'](_0x3a12('0xc'),_0xd3f1cb,_0x3a12('0xd'));logger[_0x3a12('0xe')](_0x3a12('0xf'),_0xd3f1cb,_0x3a12('0xd'),JSON[_0x3a12('0x10')](_0x569fe4));if(_0x569fe4['error']){if(_0x569fe4['error'][_0x3a12('0x11')]===0x1f4){logger[_0x3a12('0x12')]('FreshdeskField,\x20%s,\x20%s',_0xd3f1cb,_0x569fe4[_0x3a12('0x12')]['message']);return _0x1599ef(_0x569fe4[_0x3a12('0x12')][_0x3a12('0x13')]);}logger[_0x3a12('0x12')]('FreshdeskField,\x20%s,\x20%s',_0xd3f1cb,_0x569fe4[_0x3a12('0x12')]['message']);return _0x5a5b34(_0x569fe4[_0x3a12('0x12')]['message']);}else{logger[_0x3a12('0x14')](_0x3a12('0xc'),_0xd3f1cb,_0x3a12('0xd'));_0x5a5b34(_0x569fe4[_0x3a12('0x15')]['message']);}})[_0x3a12('0x16')](function(_0x4790d7){logger[_0x3a12('0x12')](_0x3a12('0xc'),_0xd3f1cb,_0x4790d7);_0x1599ef(_0x4790d7);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index b1cac11..06361f1 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 _0xa5fa=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create','addConfiguration','put','update','destroy','exports','util','path'];(function(_0xfd9618,_0x4ab482){var _0x55142b=function(_0x4c7711){while(--_0x4c7711){_0xfd9618['push'](_0xfd9618['shift']());}};_0x55142b(++_0x4ab482);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x526c62,_0x1848af){_0x526c62=_0x526c62-0x0;var _0x23e196=_0xa5fa[_0x526c62];return _0x23e196;};'use strict';var multer=require('multer');var util=require(_0xaa5f('0x0'));var path=require(_0xaa5f('0x1'));var timeout=require(_0xaa5f('0x2'));var express=require(_0xaa5f('0x3'));var router=express['Router']();var fs_extra=require(_0xaa5f('0x4'));var auth=require(_0xaa5f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaa5f('0x6'));var controller=require(_0xaa5f('0x7'));router[_0xaa5f('0x8')]('/',auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xa')]);router[_0xaa5f('0x8')](_0xaa5f('0xb'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xc')]);router[_0xaa5f('0x8')](_0xaa5f('0xd'),auth['isAuthenticated'](),controller[_0xaa5f('0xe')]);router[_0xaa5f('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0xaa5f('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaa5f('0x10')]);router['post'](_0xaa5f('0xd'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x11')]);router[_0xaa5f('0x12')](_0xaa5f('0xb'),auth['isAuthenticated'](),controller[_0xaa5f('0x13')]);router['delete'](_0xaa5f('0xb'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x14')]);module[_0xaa5f('0x15')]=router; \ No newline at end of file +var _0x1be1=['getFields','post','create','addConfiguration','/:id','delete','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','show','/:id/configurations','/:id/fields'];(function(_0x5e11a9,_0x182cee){var _0x44884c=function(_0x1864e9){while(--_0x1864e9){_0x5e11a9['push'](_0x5e11a9['shift']());}};_0x44884c(++_0x182cee);}(_0x1be1,0x192));var _0x11be=function(_0x13920e,_0x1a8cf7){_0x13920e=_0x13920e-0x0;var _0x73878a=_0x1be1[_0x13920e];return _0x73878a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var fs_extra=require(_0x11be('0x3'));var auth=require(_0x11be('0x4'));var interaction=require(_0x11be('0x5'));var config=require('../../config/environment');var controller=require(_0x11be('0x6'));router[_0x11be('0x7')]('/',auth[_0x11be('0x8')](),controller['index']);router[_0x11be('0x7')]('/:id',auth[_0x11be('0x8')](),controller[_0x11be('0x9')]);router[_0x11be('0x7')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller['getConfigurations']);router[_0x11be('0x7')](_0x11be('0xb'),auth['isAuthenticated'](),controller[_0x11be('0xc')]);router[_0x11be('0xd')]('/',auth[_0x11be('0x8')](),controller[_0x11be('0xe')]);router['post'](_0x11be('0xa'),auth[_0x11be('0x8')](),controller[_0x11be('0xf')]);router['put'](_0x11be('0x10'),auth[_0x11be('0x8')](),controller['update']);router[_0x11be('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index df89658..c9f31cc 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 _0x0b0e=['STRING','username','remoteUri','sequelize'];(function(_0x195a26,_0x5a830a){var _0x2e4d4d=function(_0x4dd229){while(--_0x4dd229){_0x195a26['push'](_0x195a26['shift']());}};_0x2e4d4d(++_0x5a830a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x25ccbe,_0xc935c0){_0x25ccbe=_0x25ccbe-0x0;var _0x289529=_0x0b0e[_0x25ccbe];return _0x289529;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0b0('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe0b0('0x1')],'unique':_0xe0b0('0x2')},'apiKey':{'type':Sequelize[_0xe0b0('0x1')]},'remoteUri':{'type':Sequelize[_0xe0b0('0x1')],'unique':_0xe0b0('0x3')},'serverUrl':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xda2d=['exports','STRING','username'];(function(_0x498a64,_0x170ddf){var _0x7d0eb6=function(_0x10f4e3){while(--_0x10f4e3){_0x498a64['push'](_0x498a64['shift']());}};_0x7d0eb6(++_0x170ddf);}(_0xda2d,0x102));var _0xdda2=function(_0x168090,_0x5c7b43){_0x168090=_0x168090-0x0;var _0x1ebfcf=_0xda2d[_0x168090];return _0x1ebfcf;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'name':{'type':Sequelize[_0xdda2('0x1')]},'description':{'type':Sequelize[_0xdda2('0x1')]},'username':{'type':Sequelize[_0xdda2('0x1')],'unique':_0xdda2('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xdda2('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 5bf7b91..fc48fb7 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 _0x80d1=['FreshsalesField','username','apiKey','remoteUri','slice','substring','GET','format','%s%s','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','update','then','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','keys','filters','intersection','model','attributes','fields','query','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','create','body','find','params','destroy','FreshsalesConfiguration','filter','getConfigurations','nolimit','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions'];(function(_0x168585,_0x2239e1){var _0x55c137=function(_0x1e8e9b){while(--_0x1e8e9b){_0x168585['push'](_0x168585['shift']());}};_0x55c137(++_0x2239e1);}(_0x80d1,0x1aa));var _0x180d=function(_0xcff500,_0x5a4796){_0xcff500=_0xcff500-0x0;var _0x5df3d0=_0x80d1[_0xcff500];return _0x5df3d0;};'use strict';var emlformat=require(_0x180d('0x0'));var rimraf=require(_0x180d('0x1'));var zipdir=require(_0x180d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x180d('0x3'));var moment=require(_0x180d('0x4'));var BPromise=require(_0x180d('0x5'));var Mustache=require('mustache');var util=require(_0x180d('0x6'));var path=require(_0x180d('0x7'));var sox=require(_0x180d('0x8'));var csv=require(_0x180d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x180d('0xa'));var squel=require('squel');var crypto=require(_0x180d('0xb'));var jsforce=require(_0x180d('0xc'));var deskjs=require(_0x180d('0xd'));var toCsv=require(_0x180d('0x9'));var querystring=require(_0x180d('0xe'));var Papa=require(_0x180d('0xf'));var Redis=require(_0x180d('0x10'));var authService=require(_0x180d('0x11'));var qs=require(_0x180d('0x12'));var as=require(_0x180d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x180d('0x14'))(_0x180d('0x15'));var utils=require(_0x180d('0x16'));var config=require(_0x180d('0x17'));var licenseUtil=require(_0x180d('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x401f0f,_0x16c106){_0x16c106=_0x16c106||0xcc;return function(_0x28e019){if(_0x28e019){return _0x401f0f[_0x180d('0x19')](_0x16c106);}return _0x401f0f[_0x180d('0x1a')](_0x16c106)[_0x180d('0x1b')]();};}function respondWithResult(_0x5202a9,_0x34521f){_0x34521f=_0x34521f||0xc8;return function(_0x567bcf){if(_0x567bcf){return _0x5202a9['status'](_0x34521f)[_0x180d('0x1c')](_0x567bcf);}};}function respondWithFilteredResult(_0x142a9b,_0x4ece0a){return function(_0x36f0f4){if(_0x36f0f4){var _0x33181a=typeof _0x4ece0a[_0x180d('0x1d')]===_0x180d('0x1e')&&typeof _0x4ece0a['limit']==='undefined';var _0x41722a=_0x36f0f4[_0x180d('0x1f')];var _0x5d72ad=_0x33181a?0x0:_0x4ece0a[_0x180d('0x1d')];var _0x14ad09=_0x33181a?_0x36f0f4[_0x180d('0x1f')]:_0x4ece0a[_0x180d('0x1d')]+_0x4ece0a[_0x180d('0x20')];var _0x292e47;if(_0x14ad09>=_0x41722a){_0x14ad09=_0x41722a;_0x292e47=0xc8;}else{_0x292e47=0xce;}_0x142a9b[_0x180d('0x1a')](_0x292e47);return _0x142a9b[_0x180d('0x21')]('Content-Range',_0x5d72ad+'-'+_0x14ad09+'/'+_0x41722a)[_0x180d('0x1c')](_0x36f0f4);}return null;};}function patchUpdates(_0x3ca742){return function(_0x30414f){try{jsonpatch[_0x180d('0x22')](_0x30414f,_0x3ca742,!![]);}catch(_0x2494d3){return BPromise['reject'](_0x2494d3);}return _0x30414f['save']();};}function saveUpdates(_0x2cbc74,_0x1c2cbd){return function(_0x4fe874){if(_0x4fe874){return _0x4fe874[_0x180d('0x23')](_0x2cbc74)[_0x180d('0x24')](function(_0x4eb89f){return _0x4eb89f;});}return null;};}function removeEntity(_0x226345,_0x20ede8){return function(_0x30608f){if(_0x30608f){return _0x30608f['destroy']()[_0x180d('0x24')](function(){_0x226345[_0x180d('0x1a')](0xcc)[_0x180d('0x1b')]();});}};}function handleEntityNotFound(_0x9df707,_0x4550a5){return function(_0x17d5bc){if(!_0x17d5bc){_0x9df707[_0x180d('0x19')](0x194);}return _0x17d5bc;};}function handleError(_0x4a98b2,_0x17f3e5){_0x17f3e5=_0x17f3e5||0x1f4;return function(_0x3a6214){logger[_0x180d('0x25')](_0x3a6214[_0x180d('0x26')]);if(_0x3a6214['name']){delete _0x3a6214[_0x180d('0x27')];}_0x4a98b2['status'](_0x17f3e5)[_0x180d('0x28')](_0x3a6214);};}exports[_0x180d('0x29')]=function(_0x349da3,_0x31fed1){var _0x1f810f={},_0x355ef8={},_0x487533={'count':0x0,'rows':[]};var _0x5c966c=_[_0x180d('0x2a')](db[_0x180d('0x2b')][_0x180d('0x2c')],function(_0x43c450){return{'name':_0x43c450[_0x180d('0x2d')],'type':_0x43c450[_0x180d('0x2e')]['key']};});_0x355ef8['model']=_['map'](_0x5c966c,'name');_0x355ef8['query']=_[_0x180d('0x2f')](_0x349da3['query']);_0x355ef8[_0x180d('0x30')]=_[_0x180d('0x31')](_0x355ef8[_0x180d('0x32')],_0x355ef8['query']);_0x1f810f[_0x180d('0x33')]=_[_0x180d('0x31')](_0x355ef8[_0x180d('0x32')],qs[_0x180d('0x34')](_0x349da3[_0x180d('0x35')][_0x180d('0x34')]));_0x1f810f[_0x180d('0x33')]=_0x1f810f[_0x180d('0x33')]['length']?_0x1f810f[_0x180d('0x33')]:_0x355ef8['model'];if(!_0x349da3['query']['hasOwnProperty']('nolimit')){_0x1f810f[_0x180d('0x20')]=qs[_0x180d('0x20')](_0x349da3[_0x180d('0x35')][_0x180d('0x20')]);_0x1f810f[_0x180d('0x1d')]=qs['offset'](_0x349da3['query'][_0x180d('0x1d')]);}_0x1f810f[_0x180d('0x36')]=qs[_0x180d('0x37')](_0x349da3[_0x180d('0x35')][_0x180d('0x37')]);_0x1f810f[_0x180d('0x38')]=qs[_0x180d('0x30')](_[_0x180d('0x39')](_0x349da3['query'],_0x355ef8['filters']),_0x5c966c);if(_0x349da3['query']['filter']){_0x1f810f[_0x180d('0x38')]=_[_0x180d('0x3a')](_0x1f810f[_0x180d('0x38')],{'$or':_[_0x180d('0x2a')](_0x5c966c,function(_0x34a8ee){if(_0x34a8ee[_0x180d('0x2e')]!==_0x180d('0x3b')){var _0x5e0cb2={};_0x5e0cb2[_0x34a8ee[_0x180d('0x27')]]={'$like':'%'+_0x349da3[_0x180d('0x35')]['filter']+'%'};return _0x5e0cb2;}})});}_0x1f810f=_[_0x180d('0x3a')]({},_0x1f810f,_0x349da3[_0x180d('0x3c')]);var _0xbd235c={'where':_0x1f810f[_0x180d('0x38')]};return db[_0x180d('0x2b')][_0x180d('0x1f')](_0xbd235c)[_0x180d('0x24')](function(_0x102e77){_0x487533[_0x180d('0x1f')]=_0x102e77;if(_0x349da3[_0x180d('0x35')][_0x180d('0x3d')]){_0x1f810f[_0x180d('0x3e')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x180d('0x3f')](_0x1f810f);})[_0x180d('0x24')](function(_0x2fd43e){_0x487533[_0x180d('0x40')]=_0x2fd43e;return _0x487533;})[_0x180d('0x24')](respondWithFilteredResult(_0x31fed1,_0x1f810f))[_0x180d('0x41')](handleError(_0x31fed1,null));};exports[_0x180d('0x42')]=function(_0x3d3a00,_0x39ca7c){var _0x14ee5b={'raw':![],'where':{'id':_0x3d3a00['params']['id']}},_0x569e23={};_0x569e23[_0x180d('0x32')]=_['keys'](db[_0x180d('0x2b')][_0x180d('0x2c')]);_0x569e23[_0x180d('0x35')]=_[_0x180d('0x2f')](_0x3d3a00[_0x180d('0x35')]);_0x569e23[_0x180d('0x30')]=_[_0x180d('0x31')](_0x569e23[_0x180d('0x32')],_0x569e23[_0x180d('0x35')]);_0x14ee5b[_0x180d('0x33')]=_['intersection'](_0x569e23[_0x180d('0x32')],qs[_0x180d('0x34')](_0x3d3a00['query']['fields']));_0x14ee5b['attributes']=_0x14ee5b['attributes'][_0x180d('0x43')]?_0x14ee5b[_0x180d('0x33')]:_0x569e23['model'];if(_0x3d3a00['query'][_0x180d('0x3d')]){_0x14ee5b[_0x180d('0x3e')]=[{'all':!![]}];}_0x14ee5b=_[_0x180d('0x3a')]({},_0x14ee5b,_0x3d3a00['options']);return db[_0x180d('0x2b')]['find'](_0x14ee5b)[_0x180d('0x24')](handleEntityNotFound(_0x39ca7c,null))[_0x180d('0x24')](respondWithResult(_0x39ca7c,null))[_0x180d('0x41')](handleError(_0x39ca7c,null));};exports[_0x180d('0x44')]=function(_0x2befc4,_0x4bd042){return db[_0x180d('0x2b')][_0x180d('0x44')](_0x2befc4[_0x180d('0x45')],{})[_0x180d('0x24')](respondWithResult(_0x4bd042,0xc9))[_0x180d('0x41')](handleError(_0x4bd042,null));};exports[_0x180d('0x23')]=function(_0x3e2e2c,_0x36de63){if(_0x3e2e2c['body']['id']){delete _0x3e2e2c[_0x180d('0x45')]['id'];}return db['FreshsalesAccount'][_0x180d('0x46')]({'where':{'id':_0x3e2e2c[_0x180d('0x47')]['id']}})['then'](handleEntityNotFound(_0x36de63,null))[_0x180d('0x24')](saveUpdates(_0x3e2e2c[_0x180d('0x45')],null))[_0x180d('0x24')](respondWithResult(_0x36de63,null))[_0x180d('0x41')](handleError(_0x36de63,null));};exports[_0x180d('0x48')]=function(_0x1a2a40,_0x1727ce){return db['FreshsalesAccount'][_0x180d('0x46')]({'where':{'id':_0x1a2a40[_0x180d('0x47')]['id']}})[_0x180d('0x24')](handleEntityNotFound(_0x1727ce,null))[_0x180d('0x24')](removeEntity(_0x1727ce,null))[_0x180d('0x41')](handleError(_0x1727ce,null));};exports['getConfigurations']=function(_0x431a76,_0x706ff0,_0x41a8cd){var _0x10d360={};var _0x4b5ea9={};var _0x17a832;var _0x203e6a;return db[_0x180d('0x2b')]['findOne']({'where':{'id':_0x431a76[_0x180d('0x47')]['id']}})[_0x180d('0x24')](handleEntityNotFound(_0x706ff0,null))[_0x180d('0x24')](function(_0x1325f6){if(_0x1325f6){_0x17a832=_0x1325f6;_0x4b5ea9[_0x180d('0x32')]=_['keys'](db[_0x180d('0x49')]['rawAttributes']);_0x4b5ea9[_0x180d('0x35')]=_[_0x180d('0x2f')](_0x431a76[_0x180d('0x35')]);_0x4b5ea9[_0x180d('0x30')]=_[_0x180d('0x31')](_0x4b5ea9[_0x180d('0x32')],_0x4b5ea9[_0x180d('0x35')]);_0x10d360['attributes']=_['intersection'](_0x4b5ea9[_0x180d('0x32')],qs['fields'](_0x431a76[_0x180d('0x35')]['fields']));_0x10d360[_0x180d('0x33')]=_0x10d360['attributes'][_0x180d('0x43')]?_0x10d360[_0x180d('0x33')]:_0x4b5ea9['model'];_0x10d360[_0x180d('0x36')]=qs[_0x180d('0x37')](_0x431a76['query'][_0x180d('0x37')]);_0x10d360[_0x180d('0x38')]=qs[_0x180d('0x30')](_[_0x180d('0x39')](_0x431a76[_0x180d('0x35')],_0x4b5ea9[_0x180d('0x30')]));if(_0x431a76[_0x180d('0x35')][_0x180d('0x4a')]){_0x10d360[_0x180d('0x38')]=_[_0x180d('0x3a')](_0x10d360['where'],{'$or':_[_0x180d('0x2a')](_0x10d360[_0x180d('0x33')],function(_0x5f4c22){var _0x54fd3d={};_0x54fd3d[_0x5f4c22]={'$like':'%'+_0x431a76[_0x180d('0x35')][_0x180d('0x4a')]+'%'};return _0x54fd3d;})});}_0x10d360=_['merge']({},_0x10d360,_0x431a76[_0x180d('0x3c')]);return _0x17a832[_0x180d('0x4b')](_0x10d360);}})[_0x180d('0x24')](function(_0x300ed8){if(_0x300ed8){_0x203e6a=_0x300ed8['length'];if(!_0x431a76['query']['hasOwnProperty'](_0x180d('0x4c'))){_0x10d360[_0x180d('0x20')]=qs['limit'](_0x431a76[_0x180d('0x35')]['limit']);_0x10d360[_0x180d('0x1d')]=qs[_0x180d('0x1d')](_0x431a76[_0x180d('0x35')]['offset']);}return _0x17a832['getConfigurations'](_0x10d360);}})[_0x180d('0x24')](function(_0x1a5a62){if(_0x1a5a62){return _0x1a5a62?{'count':_0x203e6a,'rows':_0x1a5a62}:null;}})[_0x180d('0x24')](respondWithResult(_0x706ff0,null))[_0x180d('0x41')](handleError(_0x706ff0,null));};exports['addConfiguration']=function(_0x3a5fdb,_0x3a258c,_0x2514b0){if(_0x3a5fdb[_0x180d('0x45')]['id']){delete _0x3a5fdb['body']['id'];}return db['FreshsalesAccount'][_0x180d('0x4d')]({'where':{'id':_0x3a5fdb[_0x180d('0x47')]['id']}})['then'](handleEntityNotFound(_0x3a258c,null))['then'](function(_0x6d342f){if(_0x6d342f){_0x3a5fdb[_0x180d('0x45')][_0x180d('0x4e')]=_0x6d342f['id'];_0x3a5fdb[_0x180d('0x45')][_0x180d('0x4f')]=integrations[_0x180d('0x50')](_0x3a5fdb[_0x180d('0x45')][_0x180d('0x51')],_0x3a5fdb[_0x180d('0x45')]['type']);_0x3a5fdb[_0x180d('0x45')][_0x180d('0x52')]=integrations[_0x180d('0x53')](_0x3a5fdb[_0x180d('0x45')][_0x180d('0x51')],_0x3a5fdb['body'][_0x180d('0x2e')]);return db[_0x180d('0x49')]['create'](_0x3a5fdb['body'],{'include':[{'model':db['FreshsalesField'],'as':_0x180d('0x4f')},{'model':db[_0x180d('0x54')],'as':_0x180d('0x52')}]});}return null;})[_0x180d('0x24')](respondWithResult(_0x3a258c,null))['catch'](handleError(_0x3a258c,null));};exports['getFields']=function(_0x4aa8a7,_0x4ccb30,_0x5801ea){var _0x4fa6a9='';var _0x1feb1f='';return db[_0x180d('0x2b')][_0x180d('0x4d')]({'where':{'id':_0x4aa8a7['params']['id']},'attributes':['id',_0x180d('0x55'),'remoteUri',_0x180d('0x56')]})['then'](handleEntityNotFound(_0x4ccb30,null))[_0x180d('0x24')](function(_0x4c8455){if(_0x4c8455){_0x1feb1f=_0x4c8455[_0x180d('0x55')];_0x4fa6a9=_0x4c8455[_0x180d('0x57')];var _0x1fea38=_0x4c8455['remoteUri'][_0x180d('0x58')](-0x1);if(_0x1fea38==='/'){_0x4fa6a9=_0x4fa6a9[_0x180d('0x59')](0x0,_0x4fa6a9['lastIndexOf'](_0x1fea38));}return rp({'method':_0x180d('0x5a'),'uri':util[_0x180d('0x5b')](_0x180d('0x5c'),_0x4fa6a9,'/api/selector/owners'),'headers':{'Authorization':_0x180d('0x5d')+_0x4c8455['apiKey']},'json':!![]});}})['then'](function(_0x25309e){if(_0x25309e){var _0x4e18a5=_0x25309e[_0x180d('0x5e')];var _0x2c2094=![];var _0x489112=null;for(_0x489112=0x0;_0x489112<_0x4e18a5[_0x180d('0x43')];_0x489112++){if(_0x4e18a5[_0x489112]['email']===_0x1feb1f){_0x2c2094=!![];}}if(_0x2c2094){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x180d('0x5f')});}}})['then'](respondWithResult(_0x4ccb30,null))['catch'](function(_0x5f1654){var _0x25cda7=_0x4aa8a7[_0x180d('0x35')]['test']?0x1f4:_0x5f1654[_0x180d('0x60')]||0x1f4;logger[_0x180d('0x25')](_0x180d('0x61'),_0x180d('0x62'),_0x25cda7,JSON[_0x180d('0x63')](_0x5f1654));delete _0x5f1654[_0x180d('0x27')];if(_0x25cda7===0x191){_0x25cda7=0x190;}_0x4ccb30[_0x180d('0x1a')](_0x25cda7)[_0x180d('0x28')](_0x4aa8a7[_0x180d('0x35')][_0x180d('0x64')]?{'message':_0x180d('0x65'),'statusCode':_0x5f1654[_0x180d('0x60')]}:_0x5f1654);});}; \ No newline at end of file +var _0xd028=['type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','order','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','statusCode','error','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','FreshsalesAccount','rawAttributes','fieldName'];(function(_0x1095ad,_0x108bbf){var _0x263fa5=function(_0x29a574){while(--_0x29a574){_0x1095ad['push'](_0x1095ad['shift']());}};_0x263fa5(++_0x108bbf);}(_0xd028,0x105));var _0x8d02=function(_0x2123b9,_0x4e9d19){_0x2123b9=_0x2123b9-0x0;var _0x4d67e0=_0xd028[_0x2123b9];return _0x4d67e0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d02('0x0'));var zipdir=require(_0x8d02('0x1'));var jsonpatch=require(_0x8d02('0x2'));var rp=require('request-promise');var moment=require(_0x8d02('0x3'));var BPromise=require(_0x8d02('0x4'));var Mustache=require('mustache');var util=require(_0x8d02('0x5'));var path=require(_0x8d02('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d02('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8d02('0x8'));var deskjs=require(_0x8d02('0x9'));var toCsv=require(_0x8d02('0xa'));var querystring=require(_0x8d02('0xb'));var Papa=require(_0x8d02('0xc'));var Redis=require(_0x8d02('0xd'));var authService=require(_0x8d02('0xe'));var qs=require(_0x8d02('0xf'));var as=require(_0x8d02('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d02('0x11'))('api');var utils=require(_0x8d02('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x8d02('0x13'));var db=require(_0x8d02('0x14'))['db'];var integrations=require(_0x8d02('0x15'));function respondWithStatusCode(_0x1f4336,_0x538e66){_0x538e66=_0x538e66||0xcc;return function(_0x39b027){if(_0x39b027){return _0x1f4336['sendStatus'](_0x538e66);}return _0x1f4336[_0x8d02('0x16')](_0x538e66)[_0x8d02('0x17')]();};}function respondWithResult(_0x4e1f5b,_0x5ae7b7){_0x5ae7b7=_0x5ae7b7||0xc8;return function(_0xba750a){if(_0xba750a){return _0x4e1f5b[_0x8d02('0x16')](_0x5ae7b7)[_0x8d02('0x18')](_0xba750a);}};}function respondWithFilteredResult(_0x251cc2,_0x583866){return function(_0x53e9c7){if(_0x53e9c7){var _0x4acec9=typeof _0x583866[_0x8d02('0x19')]===_0x8d02('0x1a')&&typeof _0x583866[_0x8d02('0x1b')]===_0x8d02('0x1a');var _0x26c598=_0x53e9c7[_0x8d02('0x1c')];var _0x562477=_0x4acec9?0x0:_0x583866[_0x8d02('0x19')];var _0x412872=_0x4acec9?_0x53e9c7[_0x8d02('0x1c')]:_0x583866['offset']+_0x583866[_0x8d02('0x1b')];var _0x17b681;if(_0x412872>=_0x26c598){_0x412872=_0x26c598;_0x17b681=0xc8;}else{_0x17b681=0xce;}_0x251cc2[_0x8d02('0x16')](_0x17b681);return _0x251cc2[_0x8d02('0x1d')](_0x8d02('0x1e'),_0x562477+'-'+_0x412872+'/'+_0x26c598)[_0x8d02('0x18')](_0x53e9c7);}return null;};}function patchUpdates(_0x4e8e14){return function(_0x5c6c2f){try{jsonpatch[_0x8d02('0x1f')](_0x5c6c2f,_0x4e8e14,!![]);}catch(_0x2a17ef){return BPromise[_0x8d02('0x20')](_0x2a17ef);}return _0x5c6c2f[_0x8d02('0x21')]();};}function saveUpdates(_0x11e4a8,_0x3e0108){return function(_0xb29aa0){if(_0xb29aa0){return _0xb29aa0[_0x8d02('0x22')](_0x11e4a8)[_0x8d02('0x23')](function(_0x45782e){return _0x45782e;});}return null;};}function removeEntity(_0x18428b,_0x391302){return function(_0x25ceb0){if(_0x25ceb0){return _0x25ceb0[_0x8d02('0x24')]()['then'](function(){_0x18428b[_0x8d02('0x16')](0xcc)[_0x8d02('0x17')]();});}};}function handleEntityNotFound(_0x1fdfeb,_0x5cdba3){return function(_0x5b362c){if(!_0x5b362c){_0x1fdfeb[_0x8d02('0x25')](0x194);}return _0x5b362c;};}function handleError(_0x4c8c80,_0x137b7e){_0x137b7e=_0x137b7e||0x1f4;return function(_0x53ac38){logger['error'](_0x53ac38[_0x8d02('0x26')]);if(_0x53ac38[_0x8d02('0x27')]){delete _0x53ac38[_0x8d02('0x27')];}_0x4c8c80[_0x8d02('0x16')](_0x137b7e)[_0x8d02('0x28')](_0x53ac38);};}exports['index']=function(_0x18ffa3,_0x10edf5){var _0x35f4d2={},_0x4b4e43={},_0x13d0b3={'count':0x0,'rows':[]};var _0xc5ed8c=_[_0x8d02('0x29')](db[_0x8d02('0x2a')][_0x8d02('0x2b')],function(_0x1461c8){return{'name':_0x1461c8[_0x8d02('0x2c')],'type':_0x1461c8[_0x8d02('0x2d')][_0x8d02('0x2e')]};});_0x4b4e43[_0x8d02('0x2f')]=_[_0x8d02('0x29')](_0xc5ed8c,'name');_0x4b4e43[_0x8d02('0x30')]=_[_0x8d02('0x31')](_0x18ffa3[_0x8d02('0x30')]);_0x4b4e43['filters']=_[_0x8d02('0x32')](_0x4b4e43[_0x8d02('0x2f')],_0x4b4e43[_0x8d02('0x30')]);_0x35f4d2[_0x8d02('0x33')]=_[_0x8d02('0x32')](_0x4b4e43['model'],qs[_0x8d02('0x34')](_0x18ffa3[_0x8d02('0x30')]['fields']));_0x35f4d2['attributes']=_0x35f4d2[_0x8d02('0x33')][_0x8d02('0x35')]?_0x35f4d2[_0x8d02('0x33')]:_0x4b4e43[_0x8d02('0x2f')];if(!_0x18ffa3[_0x8d02('0x30')][_0x8d02('0x36')](_0x8d02('0x37'))){_0x35f4d2[_0x8d02('0x1b')]=qs['limit'](_0x18ffa3[_0x8d02('0x30')][_0x8d02('0x1b')]);_0x35f4d2[_0x8d02('0x19')]=qs[_0x8d02('0x19')](_0x18ffa3[_0x8d02('0x30')][_0x8d02('0x19')]);}_0x35f4d2['order']=qs['sort'](_0x18ffa3[_0x8d02('0x30')][_0x8d02('0x38')]);_0x35f4d2[_0x8d02('0x39')]=qs[_0x8d02('0x3a')](_[_0x8d02('0x3b')](_0x18ffa3[_0x8d02('0x30')],_0x4b4e43[_0x8d02('0x3a')]),_0xc5ed8c);if(_0x18ffa3[_0x8d02('0x30')][_0x8d02('0x3c')]){_0x35f4d2[_0x8d02('0x39')]=_['merge'](_0x35f4d2[_0x8d02('0x39')],{'$or':_[_0x8d02('0x29')](_0xc5ed8c,function(_0x97f02d){if(_0x97f02d[_0x8d02('0x2d')]!==_0x8d02('0x3d')){var _0x57d2c8={};_0x57d2c8[_0x97f02d[_0x8d02('0x27')]]={'$like':'%'+_0x18ffa3['query']['filter']+'%'};return _0x57d2c8;}})});}_0x35f4d2=_[_0x8d02('0x3e')]({},_0x35f4d2,_0x18ffa3[_0x8d02('0x3f')]);var _0x221f27={'where':_0x35f4d2[_0x8d02('0x39')]};return db[_0x8d02('0x2a')][_0x8d02('0x1c')](_0x221f27)[_0x8d02('0x23')](function(_0x3a254a){_0x13d0b3['count']=_0x3a254a;if(_0x18ffa3['query'][_0x8d02('0x40')]){_0x35f4d2[_0x8d02('0x41')]=[{'all':!![]}];}return db[_0x8d02('0x2a')][_0x8d02('0x42')](_0x35f4d2);})[_0x8d02('0x23')](function(_0xb4da58){_0x13d0b3[_0x8d02('0x43')]=_0xb4da58;return _0x13d0b3;})[_0x8d02('0x23')](respondWithFilteredResult(_0x10edf5,_0x35f4d2))[_0x8d02('0x44')](handleError(_0x10edf5,null));};exports['show']=function(_0x443a80,_0x3f2333){var _0x2dc164={'raw':![],'where':{'id':_0x443a80[_0x8d02('0x45')]['id']}},_0x2bc961={};_0x2bc961[_0x8d02('0x2f')]=_['keys'](db[_0x8d02('0x2a')]['rawAttributes']);_0x2bc961[_0x8d02('0x30')]=_[_0x8d02('0x31')](_0x443a80[_0x8d02('0x30')]);_0x2bc961[_0x8d02('0x3a')]=_['intersection'](_0x2bc961['model'],_0x2bc961[_0x8d02('0x30')]);_0x2dc164[_0x8d02('0x33')]=_[_0x8d02('0x32')](_0x2bc961[_0x8d02('0x2f')],qs[_0x8d02('0x34')](_0x443a80['query'][_0x8d02('0x34')]));_0x2dc164[_0x8d02('0x33')]=_0x2dc164[_0x8d02('0x33')][_0x8d02('0x35')]?_0x2dc164[_0x8d02('0x33')]:_0x2bc961[_0x8d02('0x2f')];if(_0x443a80[_0x8d02('0x30')][_0x8d02('0x40')]){_0x2dc164[_0x8d02('0x41')]=[{'all':!![]}];}_0x2dc164=_[_0x8d02('0x3e')]({},_0x2dc164,_0x443a80['options']);return db[_0x8d02('0x2a')][_0x8d02('0x46')](_0x2dc164)['then'](handleEntityNotFound(_0x3f2333,null))[_0x8d02('0x23')](respondWithResult(_0x3f2333,null))[_0x8d02('0x44')](handleError(_0x3f2333,null));};exports['create']=function(_0x2a1375,_0x2a72af){return db[_0x8d02('0x2a')][_0x8d02('0x47')](_0x2a1375[_0x8d02('0x48')],{})[_0x8d02('0x23')](respondWithResult(_0x2a72af,0xc9))[_0x8d02('0x44')](handleError(_0x2a72af,null));};exports[_0x8d02('0x22')]=function(_0x152122,_0x3d9f73){if(_0x152122['body']['id']){delete _0x152122['body']['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x152122['params']['id']}})[_0x8d02('0x23')](handleEntityNotFound(_0x3d9f73,null))[_0x8d02('0x23')](saveUpdates(_0x152122[_0x8d02('0x48')],null))[_0x8d02('0x23')](respondWithResult(_0x3d9f73,null))[_0x8d02('0x44')](handleError(_0x3d9f73,null));};exports[_0x8d02('0x24')]=function(_0x1c6ac6,_0x200935){return db['FreshsalesAccount']['find']({'where':{'id':_0x1c6ac6[_0x8d02('0x45')]['id']}})[_0x8d02('0x23')](handleEntityNotFound(_0x200935,null))[_0x8d02('0x23')](removeEntity(_0x200935,null))[_0x8d02('0x44')](handleError(_0x200935,null));};exports[_0x8d02('0x49')]=function(_0x300ea6,_0x10d705,_0x30c26f){var _0x402fb5={};var _0x512065={};var _0x11b7d;var _0x1e1032;return db['FreshsalesAccount'][_0x8d02('0x4a')]({'where':{'id':_0x300ea6[_0x8d02('0x45')]['id']}})['then'](handleEntityNotFound(_0x10d705,null))['then'](function(_0x245d2d){if(_0x245d2d){_0x11b7d=_0x245d2d;_0x512065[_0x8d02('0x2f')]=_[_0x8d02('0x31')](db[_0x8d02('0x4b')][_0x8d02('0x2b')]);_0x512065[_0x8d02('0x30')]=_[_0x8d02('0x31')](_0x300ea6[_0x8d02('0x30')]);_0x512065[_0x8d02('0x3a')]=_['intersection'](_0x512065[_0x8d02('0x2f')],_0x512065[_0x8d02('0x30')]);_0x402fb5[_0x8d02('0x33')]=_[_0x8d02('0x32')](_0x512065[_0x8d02('0x2f')],qs[_0x8d02('0x34')](_0x300ea6['query'][_0x8d02('0x34')]));_0x402fb5[_0x8d02('0x33')]=_0x402fb5[_0x8d02('0x33')]['length']?_0x402fb5[_0x8d02('0x33')]:_0x512065['model'];_0x402fb5[_0x8d02('0x4c')]=qs[_0x8d02('0x38')](_0x300ea6['query'][_0x8d02('0x38')]);_0x402fb5[_0x8d02('0x39')]=qs['filters'](_[_0x8d02('0x3b')](_0x300ea6[_0x8d02('0x30')],_0x512065[_0x8d02('0x3a')]));if(_0x300ea6['query']['filter']){_0x402fb5[_0x8d02('0x39')]=_[_0x8d02('0x3e')](_0x402fb5[_0x8d02('0x39')],{'$or':_[_0x8d02('0x29')](_0x402fb5[_0x8d02('0x33')],function(_0x3cf7f8){var _0x5c0270={};_0x5c0270[_0x3cf7f8]={'$like':'%'+_0x300ea6[_0x8d02('0x30')]['filter']+'%'};return _0x5c0270;})});}_0x402fb5=_['merge']({},_0x402fb5,_0x300ea6['options']);return _0x11b7d[_0x8d02('0x49')](_0x402fb5);}})['then'](function(_0x268496){if(_0x268496){_0x1e1032=_0x268496[_0x8d02('0x35')];if(!_0x300ea6['query'][_0x8d02('0x36')](_0x8d02('0x37'))){_0x402fb5['limit']=qs[_0x8d02('0x1b')](_0x300ea6[_0x8d02('0x30')]['limit']);_0x402fb5[_0x8d02('0x19')]=qs[_0x8d02('0x19')](_0x300ea6[_0x8d02('0x30')][_0x8d02('0x19')]);}return _0x11b7d[_0x8d02('0x49')](_0x402fb5);}})[_0x8d02('0x23')](function(_0x31da11){if(_0x31da11){return _0x31da11?{'count':_0x1e1032,'rows':_0x31da11}:null;}})['then'](respondWithResult(_0x10d705,null))['catch'](handleError(_0x10d705,null));};exports['addConfiguration']=function(_0x134a25,_0x456dcf,_0x3c4039){if(_0x134a25[_0x8d02('0x48')]['id']){delete _0x134a25['body']['id'];}return db[_0x8d02('0x2a')][_0x8d02('0x4a')]({'where':{'id':_0x134a25['params']['id']}})[_0x8d02('0x23')](handleEntityNotFound(_0x456dcf,null))['then'](function(_0x3cf8d2){if(_0x3cf8d2){_0x134a25['body'][_0x8d02('0x4d')]=_0x3cf8d2['id'];_0x134a25[_0x8d02('0x48')][_0x8d02('0x4e')]=integrations[_0x8d02('0x4f')](_0x134a25[_0x8d02('0x48')][_0x8d02('0x50')],_0x134a25['body'][_0x8d02('0x2d')]);_0x134a25['body'][_0x8d02('0x51')]=integrations[_0x8d02('0x52')](_0x134a25[_0x8d02('0x48')][_0x8d02('0x50')],_0x134a25['body']['type']);return db[_0x8d02('0x4b')][_0x8d02('0x47')](_0x134a25[_0x8d02('0x48')],{'include':[{'model':db['FreshsalesField'],'as':_0x8d02('0x4e')},{'model':db[_0x8d02('0x53')],'as':_0x8d02('0x51')}]});}return null;})[_0x8d02('0x23')](respondWithResult(_0x456dcf,null))[_0x8d02('0x44')](handleError(_0x456dcf,null));};exports[_0x8d02('0x54')]=function(_0x422bb4,_0x3f6080,_0x4e380e){var _0x461ed5='';var _0x43ac2f='';return db[_0x8d02('0x2a')][_0x8d02('0x4a')]({'where':{'id':_0x422bb4['params']['id']},'attributes':['id','username','remoteUri','apiKey']})[_0x8d02('0x23')](handleEntityNotFound(_0x3f6080,null))[_0x8d02('0x23')](function(_0x3236a3){if(_0x3236a3){_0x43ac2f=_0x3236a3[_0x8d02('0x55')];_0x461ed5=_0x3236a3[_0x8d02('0x56')];var _0x51495a=_0x3236a3[_0x8d02('0x56')][_0x8d02('0x57')](-0x1);if(_0x51495a==='/'){_0x461ed5=_0x461ed5[_0x8d02('0x58')](0x0,_0x461ed5[_0x8d02('0x59')](_0x51495a));}return rp({'method':_0x8d02('0x5a'),'uri':util[_0x8d02('0x5b')](_0x8d02('0x5c'),_0x461ed5,_0x8d02('0x5d')),'headers':{'Authorization':_0x8d02('0x5e')+_0x3236a3[_0x8d02('0x5f')]},'json':!![]});}})[_0x8d02('0x23')](function(_0x468764){if(_0x468764){var _0x11e0ac=_0x468764[_0x8d02('0x60')];var _0xbc9074=![];var _0x1adcef=null;for(_0x1adcef=0x0;_0x1adcef<_0x11e0ac[_0x8d02('0x35')];_0x1adcef++){if(_0x11e0ac[_0x1adcef][_0x8d02('0x61')]===_0x43ac2f){_0xbc9074=!![];}}if(_0xbc9074){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x8d02('0x62')});}}})[_0x8d02('0x23')](respondWithResult(_0x3f6080,null))[_0x8d02('0x44')](function(_0x1e89ad){var _0x564417=_0x422bb4['query']['test']?0x1f4:_0x1e89ad[_0x8d02('0x63')]||0x1f4;logger[_0x8d02('0x64')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x564417,JSON['stringify'](_0x1e89ad));delete _0x1e89ad[_0x8d02('0x27')];if(_0x564417===0x191){_0x564417=0x190;}_0x3f6080['status'](_0x564417)[_0x8d02('0x28')](_0x422bb4[_0x8d02('0x30')]['test']?{'message':_0x8d02('0x65'),'statusCode':_0x1e89ad['statusCode']}:_0x1e89ad);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 006778a..3a8004b 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 _0x7b84=['../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7b84,0x17c));var _0x47b8=function(_0x14a387,_0x3304a5){_0x14a387=_0x14a387-0x0;var _0x166393=_0x7b84[_0x14a387];return _0x166393;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var logger=require(_0x47b8('0x2'))(_0x47b8('0x3'));var moment=require(_0x47b8('0x4'));var BPromise=require(_0x47b8('0x5'));var rp=require(_0x47b8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var attributes=require(_0x47b8('0x9'));var integrations=require(_0x47b8('0xa'));module[_0x47b8('0xb')]=function(_0xafe88a,_0x53e656){return _0xafe88a[_0x47b8('0xc')](_0x47b8('0xd'),attributes,{'tableName':_0x47b8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32f4=['define','FreshsalesAccount','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x5d8ef9,_0x41efc3){var _0x5a69ee=function(_0x4351b5){while(--_0x4351b5){_0x5d8ef9['push'](_0x5d8ef9['shift']());}};_0x5a69ee(++_0x41efc3);}(_0x32f4,0x154));var _0x432f=function(_0x43c7a5,_0x553343){_0x43c7a5=_0x43c7a5-0x0;var _0x213f13=_0x32f4[_0x43c7a5];return _0x213f13;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var logger=require(_0x432f('0x2'))(_0x432f('0x3'));var moment=require('moment');var BPromise=require(_0x432f('0x4'));var rp=require(_0x432f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var attributes=require(_0x432f('0x8'));var integrations=require(_0x432f('0x9'));module[_0x432f('0xa')]=function(_0x5d8cc0,_0x5b5f08){return _0x5d8cc0[_0x432f('0xb')](_0x432f('0xc'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 881b272..06be1ce 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 _0x6343=['attributes','map','GetFreshsalesAccount','stringify','ShowFreshsalesAccount','find','where','debug','moment','bluebird','../../config/logger','rpc','jayson/promise','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','FreshsalesAccount','findAll','options','raw','limit','include','model'];(function(_0x5c3a26,_0x366605){var _0xdb283e=function(_0x3702df){while(--_0x3702df){_0x5c3a26['push'](_0x5c3a26['shift']());}};_0xdb283e(++_0x366605);}(_0x6343,0x168));var _0x3634=function(_0xace6e,_0x31e9fc){_0xace6e=_0xace6e-0x0;var _0x449103=_0x6343[_0xace6e];return _0x449103;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3634('0x0'));var BPromise=require(_0x3634('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3634('0x2'))(_0x3634('0x3'));var config=require('../../config/environment');var jayson=require(_0x3634('0x4'));var client=jayson[_0x3634('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x302828,_0xd40513,_0x4e6d71){return new BPromise(function(_0x5affba,_0x19170a){return client[_0x3634('0x6')](_0x302828,_0x4e6d71)[_0x3634('0x7')](function(_0x3c813b){logger[_0x3634('0x8')](_0x3634('0x9'),_0xd40513,'request\x20sent');logger['debug'](_0x3634('0xa'),_0xd40513,_0x3634('0xb'),JSON['stringify'](_0x3c813b));if(_0x3c813b[_0x3634('0xc')]){if(_0x3c813b[_0x3634('0xc')][_0x3634('0xd')]===0x1f4){logger[_0x3634('0xc')](_0x3634('0x9'),_0xd40513,_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);return _0x19170a(_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);}logger[_0x3634('0xc')](_0x3634('0x9'),_0xd40513,_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);return _0x5affba(_0x3c813b[_0x3634('0xc')]['message']);}else{logger[_0x3634('0x8')]('FreshsalesAccount,\x20%s,\x20%s',_0xd40513,_0x3634('0xb'));_0x5affba(_0x3c813b[_0x3634('0xf')][_0x3634('0xe')]);}})[_0x3634('0x10')](function(_0x91061e){logger['error'](_0x3634('0x9'),_0xd40513,_0x91061e);_0x19170a(_0x91061e);});});}exports['GetFreshsalesAccount']=function(_0x50350d){var _0x2aaac7=this;return new Promise(function(_0x4b2115,_0x2fac8b){return db[_0x3634('0x11')][_0x3634('0x12')]({'raw':_0x50350d['options']?_0x50350d[_0x3634('0x13')][_0x3634('0x14')]===undefined?!![]:![]:!![],'where':_0x50350d['options']?_0x50350d[_0x3634('0x13')]['where']||null:null,'attributes':_0x50350d[_0x3634('0x13')]?_0x50350d[_0x3634('0x13')]['attributes']||null:null,'limit':_0x50350d[_0x3634('0x13')]?_0x50350d[_0x3634('0x13')][_0x3634('0x15')]||null:null,'include':_0x50350d['options']?_0x50350d[_0x3634('0x13')][_0x3634('0x16')]?_['map'](_0x50350d[_0x3634('0x13')]['include'],function(_0x5e9188){return{'model':db[_0x5e9188[_0x3634('0x17')]],'as':_0x5e9188['as'],'attributes':_0x5e9188[_0x3634('0x18')],'include':_0x5e9188['include']?_[_0x3634('0x19')](_0x5e9188[_0x3634('0x16')],function(_0x17db44){return{'model':db[_0x17db44[_0x3634('0x17')]],'as':_0x17db44['as'],'attributes':_0x17db44[_0x3634('0x18')],'include':_0x17db44[_0x3634('0x16')]?_[_0x3634('0x19')](_0x17db44[_0x3634('0x16')],function(_0x22f1f1){return{'model':db[_0x22f1f1['model']],'as':_0x22f1f1['as'],'attributes':_0x22f1f1[_0x3634('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58841d){logger['info'](_0x3634('0x1a'),_0x50350d);logger['debug'](_0x3634('0x1a'),_0x50350d,JSON[_0x3634('0x1b')](_0x58841d));_0x4b2115(_0x58841d);})['catch'](function(_0x55a77f){logger[_0x3634('0xc')]('GetFreshsalesAccount',_0x55a77f[_0x3634('0xe')],_0x50350d);_0x2fac8b(_0x2aaac7['error'](0x1f4,_0x55a77f[_0x3634('0xe')]));});});};exports[_0x3634('0x1c')]=function(_0x1d88f7){var _0x17a0fd=this;return new Promise(function(_0x1f46d9,_0x20b062){return db[_0x3634('0x11')][_0x3634('0x1d')]({'raw':_0x1d88f7['options']?_0x1d88f7['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d88f7[_0x3634('0x13')]?_0x1d88f7['options'][_0x3634('0x1e')]||null:null,'attributes':_0x1d88f7[_0x3634('0x13')]?_0x1d88f7[_0x3634('0x13')][_0x3634('0x18')]||null:null,'include':_0x1d88f7[_0x3634('0x13')]?_0x1d88f7[_0x3634('0x13')]['include']?_[_0x3634('0x19')](_0x1d88f7[_0x3634('0x13')][_0x3634('0x16')],function(_0x1b686c){return{'model':db[_0x1b686c[_0x3634('0x17')]],'as':_0x1b686c['as'],'attributes':_0x1b686c[_0x3634('0x18')],'include':_0x1b686c[_0x3634('0x16')]?_[_0x3634('0x19')](_0x1b686c[_0x3634('0x16')],function(_0x598c7e){return{'model':db[_0x598c7e[_0x3634('0x17')]],'as':_0x598c7e['as'],'attributes':_0x598c7e[_0x3634('0x18')],'include':_0x598c7e[_0x3634('0x16')]?_[_0x3634('0x19')](_0x598c7e['include'],function(_0x149840){return{'model':db[_0x149840[_0x3634('0x17')]],'as':_0x149840['as'],'attributes':_0x149840[_0x3634('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5efd00){logger['info'](_0x3634('0x1c'),_0x1d88f7);logger[_0x3634('0x1f')]('ShowFreshsalesAccount',_0x1d88f7,JSON[_0x3634('0x1b')](_0x5efd00));_0x1f46d9(_0x5efd00);})[_0x3634('0x10')](function(_0x105507){logger[_0x3634('0xc')](_0x3634('0x1c'),_0x105507[_0x3634('0xe')],_0x1d88f7);_0x20b062(_0x17a0fd[_0x3634('0xc')](0x1f4,_0x105507['message']));});});}; \ No newline at end of file +var _0x7a54=['http','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','then','GetFreshsalesAccount','ShowFreshsalesAccount','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x344432,_0x249493){var _0x2ba780=function(_0x403614){while(--_0x403614){_0x344432['push'](_0x344432['shift']());}};_0x2ba780(++_0x249493);}(_0x7a54,0x106));var _0x47a5=function(_0x3272d4,_0x3b5d44){_0x3272d4=_0x3272d4-0x0;var _0x1d048a=_0x7a54[_0x3272d4];return _0x1d048a;};'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')]('FreshsalesAccount,\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['GetFreshsalesAccount']=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,'limit':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['limit']||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x5247fd['options'][_0x47a5('0x1b')],function(_0x385687){return{'model':db[_0x385687['model']],'as':_0x385687['as'],'attributes':_0x385687[_0x47a5('0x1a')],'include':_0x385687[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x385687[_0x47a5('0x1b')],function(_0x3abd6a){return{'model':db[_0x3abd6a['model']],'as':_0x3abd6a['as'],'attributes':_0x3abd6a['attributes'],'include':_0x3abd6a[_0x47a5('0x1b')]?_['map'](_0x3abd6a[_0x47a5('0x1b')],function(_0x5b6c4e){return{'model':db[_0x5b6c4e[_0x47a5('0x1d')]],'as':_0x5b6c4e['as'],'attributes':_0x5b6c4e[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x1dac65){logger[_0x47a5('0xb')](_0x47a5('0x1f'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1f'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1dac65));_0xaf70a6(_0x1dac65);})[_0x47a5('0x14')](function(_0x1127f8){logger[_0x47a5('0xf')](_0x47a5('0x1f'),_0x1127f8['message'],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x1127f8['message']));});});};exports[_0x47a5('0x20')]=function(_0x9ac908){var _0x16901f=this;return new Promise(function(_0x4d6b57,_0x256650){return db[_0x47a5('0x15')][_0x47a5('0x21')]({'raw':_0x9ac908[_0x47a5('0x17')]?_0x9ac908['options']['raw']===undefined?!![]:![]:!![],'where':_0x9ac908[_0x47a5('0x17')]?_0x9ac908[_0x47a5('0x17')]['where']||null:null,'attributes':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')][_0x47a5('0x1a')]||null:null,'include':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')]['include']?_[_0x47a5('0x1c')](_0x9ac908[_0x47a5('0x17')]['include'],function(_0x4843c0){return{'model':db[_0x4843c0[_0x47a5('0x1d')]],'as':_0x4843c0['as'],'attributes':_0x4843c0['attributes'],'include':_0x4843c0[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x4843c0[_0x47a5('0x1b')],function(_0x52749b){return{'model':db[_0x52749b[_0x47a5('0x1d')]],'as':_0x52749b['as'],'attributes':_0x52749b['attributes'],'include':_0x52749b['include']?_[_0x47a5('0x1c')](_0x52749b['include'],function(_0x25cce0){return{'model':db[_0x25cce0['model']],'as':_0x25cce0['as'],'attributes':_0x25cce0[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x38c8d4){logger[_0x47a5('0xb')](_0x47a5('0x20'),_0x9ac908);logger[_0x47a5('0xd')](_0x47a5('0x20'),_0x9ac908,JSON[_0x47a5('0xe')](_0x38c8d4));_0x4d6b57(_0x38c8d4);})[_0x47a5('0x14')](function(_0x4caed5){logger[_0x47a5('0xf')](_0x47a5('0x20'),_0x4caed5['message'],_0x9ac908);_0x256650(_0x16901f[_0x47a5('0xf')](0x1f4,_0x4caed5[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index d9f1f9d..ff4dc5c 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 _0x3cf0=['show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','put','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x57546c,_0x53c1ed){var _0x3452da=function(_0x1c59f4){while(--_0x1c59f4){_0x57546c['push'](_0x57546c['shift']());}};_0x3452da(++_0x53c1ed);}(_0x3cf0,0x73));var _0x03cf=function(_0x42abe3,_0x1c71d9){_0x42abe3=_0x42abe3-0x0;var _0x583b50=_0x3cf0[_0x42abe3];return _0x583b50;};'use strict';var multer=require(_0x03cf('0x0'));var util=require(_0x03cf('0x1'));var path=require(_0x03cf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x03cf('0x3')]();var fs_extra=require(_0x03cf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x03cf('0x5'));var config=require('../../config/environment');var controller=require(_0x03cf('0x6'));router[_0x03cf('0x7')]('/',auth[_0x03cf('0x8')](),controller[_0x03cf('0x9')]);router['get'](_0x03cf('0xa'),auth[_0x03cf('0x8')](),controller[_0x03cf('0xb')]);router[_0x03cf('0x7')](_0x03cf('0xc'),auth[_0x03cf('0x8')](),controller[_0x03cf('0xd')]);router['get'](_0x03cf('0xe'),auth[_0x03cf('0x8')](),controller[_0x03cf('0xf')]);router[_0x03cf('0x7')]('/:id/fields',auth[_0x03cf('0x8')](),controller[_0x03cf('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x03cf('0x11')](_0x03cf('0xa'),auth[_0x03cf('0x8')](),controller[_0x03cf('0x12')]);router['delete'](_0x03cf('0xa'),auth[_0x03cf('0x8')](),controller[_0x03cf('0x13')]);module[_0x03cf('0x14')]=router; \ No newline at end of file +var _0x3b05=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','/:id/fields','getFields','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x4ac743,_0x3fa20d){var _0x3e60a3=function(_0x197da0){while(--_0x197da0){_0x4ac743['push'](_0x4ac743['shift']());}};_0x3e60a3(++_0x3fa20d);}(_0x3b05,0x64));var _0x53b0=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x3b05[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x53b0('0x0'));var util=require(_0x53b0('0x1'));var path=require('path');var timeout=require(_0x53b0('0x2'));var express=require(_0x53b0('0x3'));var router=express[_0x53b0('0x4')]();var fs_extra=require(_0x53b0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x53b0('0x6'));var config=require(_0x53b0('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x53b0('0x8')]('/',auth[_0x53b0('0x9')](),controller['index']);router[_0x53b0('0x8')](_0x53b0('0xa'),auth[_0x53b0('0x9')](),controller[_0x53b0('0xb')]);router['get'](_0x53b0('0xc'),auth[_0x53b0('0x9')](),controller[_0x53b0('0xd')]);router[_0x53b0('0x8')]('/:id/descriptions',auth[_0x53b0('0x9')](),controller['getDescriptions']);router[_0x53b0('0x8')](_0x53b0('0xe'),auth['isAuthenticated'](),controller[_0x53b0('0xf')]);router['post']('/',auth[_0x53b0('0x9')](),controller['create']);router[_0x53b0('0x10')](_0x53b0('0xa'),auth['isAuthenticated'](),controller[_0x53b0('0x11')]);router[_0x53b0('0x12')](_0x53b0('0xa'),auth[_0x53b0('0x9')](),controller[_0x53b0('0x13')]);module[_0x53b0('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 41c5a8a..21f56b2 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 _0x4ca3=['STRING','exports'];(function(_0x220947,_0x398aa){var _0x99e702=function(_0x80c579){while(--_0x80c579){_0x220947['push'](_0x220947['shift']());}};_0x99e702(++_0x398aa);}(_0x4ca3,0x77));var _0x34ca=function(_0x3c4fac,_0x1ad496){_0x3c4fac=_0x3c4fac-0x0;var _0x5704d0=_0x4ca3[_0x3c4fac];return _0x5704d0;};'use strict';var Sequelize=require('sequelize');module[_0x34ca('0x0')]={'name':{'type':Sequelize[_0x34ca('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf726=['sequelize','STRING'];(function(_0x2da822,_0x6c5ae3){var _0x28e610=function(_0x2f2852){while(--_0x2f2852){_0x2da822['push'](_0x2da822['shift']());}};_0x28e610(++_0x6c5ae3);}(_0xf726,0xe6));var _0x6f72=function(_0x395945,_0x5a51a2){_0x395945=_0x395945-0x0;var _0x43dfef=_0xf726[_0x395945];return _0x43dfef;};'use strict';var Sequelize=require(_0x6f72('0x0'));module['exports']={'name':{'type':Sequelize[_0x6f72('0x1')]},'description':{'type':Sequelize[_0x6f72('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 297a4ae..3ccd3a0 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 _0x42d6=['includeAll','include','findAll','rows','catch','show','length','find','create','body','destroy','params','findOne','FreshsalesField','getSubjects','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','then','end','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x42d6,0x102));var _0x642d=function(_0x36fd0e,_0x15a6ca){_0x36fd0e=_0x36fd0e-0x0;var _0xcf0ad8=_0x42d6[_0x36fd0e];return _0xcf0ad8;};'use strict';var emlformat=require(_0x642d('0x0'));var rimraf=require(_0x642d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x642d('0x2'));var rp=require(_0x642d('0x3'));var moment=require('moment');var BPromise=require(_0x642d('0x4'));var Mustache=require('mustache');var util=require(_0x642d('0x5'));var path=require('path');var sox=require(_0x642d('0x6'));var csv=require(_0x642d('0x7'));var ejs=require(_0x642d('0x8'));var fs=require('fs');var fs_extra=require(_0x642d('0x9'));var _=require(_0x642d('0xa'));var squel=require('squel');var crypto=require(_0x642d('0xb'));var jsforce=require(_0x642d('0xc'));var deskjs=require(_0x642d('0xd'));var toCsv=require(_0x642d('0x7'));var querystring=require(_0x642d('0xe'));var Papa=require(_0x642d('0xf'));var Redis=require('ioredis');var authService=require(_0x642d('0x10'));var qs=require(_0x642d('0x11'));var as=require(_0x642d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x642d('0x13'))(_0x642d('0x14'));var utils=require('../../config/utils');var config=require(_0x642d('0x15'));var licenseUtil=require(_0x642d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3972f6,_0x2994ea){_0x2994ea=_0x2994ea||0xcc;return function(_0x403aad){if(_0x403aad){return _0x3972f6[_0x642d('0x17')](_0x2994ea);}return _0x3972f6[_0x642d('0x18')](_0x2994ea)['end']();};}function respondWithResult(_0x35804b,_0x1a95d0){_0x1a95d0=_0x1a95d0||0xc8;return function(_0x421b9c){if(_0x421b9c){return _0x35804b['status'](_0x1a95d0)[_0x642d('0x19')](_0x421b9c);}};}function respondWithFilteredResult(_0x270b2c,_0x591472){return function(_0x47e50b){if(_0x47e50b){var _0x2f246b=typeof _0x591472[_0x642d('0x1a')]===_0x642d('0x1b')&&typeof _0x591472['limit']===_0x642d('0x1b');var _0x218c99=_0x47e50b[_0x642d('0x1c')];var _0x205eab=_0x2f246b?0x0:_0x591472['offset'];var _0x9e734a=_0x2f246b?_0x47e50b[_0x642d('0x1c')]:_0x591472[_0x642d('0x1a')]+_0x591472[_0x642d('0x1d')];var _0x370375;if(_0x9e734a>=_0x218c99){_0x9e734a=_0x218c99;_0x370375=0xc8;}else{_0x370375=0xce;}_0x270b2c[_0x642d('0x18')](_0x370375);return _0x270b2c[_0x642d('0x1e')]('Content-Range',_0x205eab+'-'+_0x9e734a+'/'+_0x218c99)[_0x642d('0x19')](_0x47e50b);}return null;};}function patchUpdates(_0x12bfbf){return function(_0x39eaf9){try{jsonpatch[_0x642d('0x1f')](_0x39eaf9,_0x12bfbf,!![]);}catch(_0x2ab61a){return BPromise['reject'](_0x2ab61a);}return _0x39eaf9[_0x642d('0x20')]();};}function saveUpdates(_0x1158e1,_0x5c817e){return function(_0x4843e9){if(_0x4843e9){return _0x4843e9[_0x642d('0x21')](_0x1158e1)[_0x642d('0x22')](function(_0x37e799){return _0x37e799;});}return null;};}function removeEntity(_0x4714bb,_0x11a813){return function(_0x15be4e){if(_0x15be4e){return _0x15be4e['destroy']()['then'](function(){_0x4714bb[_0x642d('0x18')](0xcc)[_0x642d('0x23')]();});}};}function handleEntityNotFound(_0xf5f868,_0x8945f){return function(_0x30ba0b){if(!_0x30ba0b){_0xf5f868[_0x642d('0x17')](0x194);}return _0x30ba0b;};}function handleError(_0x3d30a4,_0x2e01f1){_0x2e01f1=_0x2e01f1||0x1f4;return function(_0x22a4ec){logger[_0x642d('0x24')](_0x22a4ec[_0x642d('0x25')]);if(_0x22a4ec[_0x642d('0x26')]){delete _0x22a4ec['name'];}_0x3d30a4[_0x642d('0x18')](_0x2e01f1)[_0x642d('0x27')](_0x22a4ec);};}exports[_0x642d('0x28')]=function(_0x2d33f3,_0x547e24){var _0x5cad43={},_0xbf48f5={},_0xba0b1b={'count':0x0,'rows':[]};var _0x2f4572=_[_0x642d('0x29')](db[_0x642d('0x2a')][_0x642d('0x2b')],function(_0x370c2f){return{'name':_0x370c2f['fieldName'],'type':_0x370c2f[_0x642d('0x2c')][_0x642d('0x2d')]};});_0xbf48f5[_0x642d('0x2e')]=_['map'](_0x2f4572,_0x642d('0x26'));_0xbf48f5[_0x642d('0x2f')]=_[_0x642d('0x30')](_0x2d33f3[_0x642d('0x2f')]);_0xbf48f5[_0x642d('0x31')]=_[_0x642d('0x32')](_0xbf48f5['model'],_0xbf48f5[_0x642d('0x2f')]);_0x5cad43[_0x642d('0x33')]=_[_0x642d('0x32')](_0xbf48f5[_0x642d('0x2e')],qs[_0x642d('0x34')](_0x2d33f3[_0x642d('0x2f')][_0x642d('0x34')]));_0x5cad43[_0x642d('0x33')]=_0x5cad43[_0x642d('0x33')]['length']?_0x5cad43['attributes']:_0xbf48f5['model'];if(!_0x2d33f3['query']['hasOwnProperty'](_0x642d('0x35'))){_0x5cad43[_0x642d('0x1d')]=qs[_0x642d('0x1d')](_0x2d33f3[_0x642d('0x2f')][_0x642d('0x1d')]);_0x5cad43[_0x642d('0x1a')]=qs['offset'](_0x2d33f3[_0x642d('0x2f')][_0x642d('0x1a')]);}_0x5cad43[_0x642d('0x36')]=qs['sort'](_0x2d33f3[_0x642d('0x2f')][_0x642d('0x37')]);_0x5cad43['where']=qs['filters'](_[_0x642d('0x38')](_0x2d33f3[_0x642d('0x2f')],_0xbf48f5[_0x642d('0x31')]),_0x2f4572);if(_0x2d33f3[_0x642d('0x2f')][_0x642d('0x39')]){_0x5cad43[_0x642d('0x3a')]=_[_0x642d('0x3b')](_0x5cad43['where'],{'$or':_[_0x642d('0x29')](_0x2f4572,function(_0x5638ee){if(_0x5638ee[_0x642d('0x2c')]!==_0x642d('0x3c')){var _0x54328a={};_0x54328a[_0x5638ee[_0x642d('0x26')]]={'$like':'%'+_0x2d33f3[_0x642d('0x2f')]['filter']+'%'};return _0x54328a;}})});}_0x5cad43=_['merge']({},_0x5cad43,_0x2d33f3[_0x642d('0x3d')]);var _0x4ff075={'where':_0x5cad43[_0x642d('0x3a')]};return db[_0x642d('0x2a')][_0x642d('0x1c')](_0x4ff075)[_0x642d('0x22')](function(_0x47f155){_0xba0b1b['count']=_0x47f155;if(_0x2d33f3[_0x642d('0x2f')][_0x642d('0x3e')]){_0x5cad43[_0x642d('0x3f')]=[{'all':!![]}];}return db[_0x642d('0x2a')][_0x642d('0x40')](_0x5cad43);})[_0x642d('0x22')](function(_0x5900a4){_0xba0b1b[_0x642d('0x41')]=_0x5900a4;return _0xba0b1b;})['then'](respondWithFilteredResult(_0x547e24,_0x5cad43))[_0x642d('0x42')](handleError(_0x547e24,null));};exports[_0x642d('0x43')]=function(_0x346744,_0x3d84e2){var _0x2cadb4={'raw':![],'where':{'id':_0x346744['params']['id']}},_0x549839={};_0x549839['model']=_[_0x642d('0x30')](db[_0x642d('0x2a')]['rawAttributes']);_0x549839[_0x642d('0x2f')]=_[_0x642d('0x30')](_0x346744['query']);_0x549839[_0x642d('0x31')]=_[_0x642d('0x32')](_0x549839[_0x642d('0x2e')],_0x549839[_0x642d('0x2f')]);_0x2cadb4[_0x642d('0x33')]=_[_0x642d('0x32')](_0x549839[_0x642d('0x2e')],qs[_0x642d('0x34')](_0x346744['query'][_0x642d('0x34')]));_0x2cadb4[_0x642d('0x33')]=_0x2cadb4[_0x642d('0x33')][_0x642d('0x44')]?_0x2cadb4[_0x642d('0x33')]:_0x549839[_0x642d('0x2e')];if(_0x346744[_0x642d('0x2f')][_0x642d('0x3e')]){_0x2cadb4[_0x642d('0x3f')]=[{'all':!![]}];}_0x2cadb4=_[_0x642d('0x3b')]({},_0x2cadb4,_0x346744[_0x642d('0x3d')]);return db[_0x642d('0x2a')][_0x642d('0x45')](_0x2cadb4)[_0x642d('0x22')](handleEntityNotFound(_0x3d84e2,null))[_0x642d('0x22')](respondWithResult(_0x3d84e2,null))[_0x642d('0x42')](handleError(_0x3d84e2,null));};exports[_0x642d('0x46')]=function(_0x24e733,_0x3bb5b0){return db['FreshsalesConfiguration'][_0x642d('0x46')](_0x24e733[_0x642d('0x47')],{})[_0x642d('0x22')](respondWithResult(_0x3bb5b0,0xc9))[_0x642d('0x42')](handleError(_0x3bb5b0,null));};exports[_0x642d('0x21')]=function(_0x49a2f3,_0xd5f499){if(_0x49a2f3[_0x642d('0x47')]['id']){delete _0x49a2f3[_0x642d('0x47')]['id'];}return db[_0x642d('0x2a')][_0x642d('0x45')]({'where':{'id':_0x49a2f3['params']['id']}})[_0x642d('0x22')](handleEntityNotFound(_0xd5f499,null))[_0x642d('0x22')](saveUpdates(_0x49a2f3[_0x642d('0x47')],null))[_0x642d('0x22')](respondWithResult(_0xd5f499,null))[_0x642d('0x42')](handleError(_0xd5f499,null));};exports[_0x642d('0x48')]=function(_0x594f46,_0x149600){return db[_0x642d('0x2a')]['find']({'where':{'id':_0x594f46[_0x642d('0x49')]['id']}})[_0x642d('0x22')](handleEntityNotFound(_0x149600,null))[_0x642d('0x22')](removeEntity(_0x149600,null))[_0x642d('0x42')](handleError(_0x149600,null));};exports['getSubjects']=function(_0x5e1234,_0x4bdb4d,_0x4ccb94){var _0xe339a1={};var _0x4d08af={};var _0x307916;var _0x405333;return db[_0x642d('0x2a')][_0x642d('0x4a')]({'where':{'id':_0x5e1234[_0x642d('0x49')]['id']}})[_0x642d('0x22')](handleEntityNotFound(_0x4bdb4d,null))[_0x642d('0x22')](function(_0x46c985){if(_0x46c985){_0x307916=_0x46c985;_0x4d08af[_0x642d('0x2e')]=_[_0x642d('0x30')](db[_0x642d('0x4b')]['rawAttributes']);_0x4d08af[_0x642d('0x2f')]=_[_0x642d('0x30')](_0x5e1234[_0x642d('0x2f')]);_0x4d08af[_0x642d('0x31')]=_[_0x642d('0x32')](_0x4d08af[_0x642d('0x2e')],_0x4d08af[_0x642d('0x2f')]);_0xe339a1[_0x642d('0x33')]=_[_0x642d('0x32')](_0x4d08af[_0x642d('0x2e')],qs['fields'](_0x5e1234[_0x642d('0x2f')][_0x642d('0x34')]));_0xe339a1[_0x642d('0x33')]=_0xe339a1[_0x642d('0x33')][_0x642d('0x44')]?_0xe339a1['attributes']:_0x4d08af['model'];_0xe339a1[_0x642d('0x36')]=qs[_0x642d('0x37')](_0x5e1234[_0x642d('0x2f')][_0x642d('0x37')]);_0xe339a1[_0x642d('0x3a')]=qs['filters'](_[_0x642d('0x38')](_0x5e1234[_0x642d('0x2f')],_0x4d08af['filters']));if(_0x5e1234['query'][_0x642d('0x39')]){_0xe339a1[_0x642d('0x3a')]=_[_0x642d('0x3b')](_0xe339a1['where'],{'$or':_['map'](_0xe339a1[_0x642d('0x33')],function(_0x106918){var _0x2d32e6={};_0x2d32e6[_0x106918]={'$like':'%'+_0x5e1234['query'][_0x642d('0x39')]+'%'};return _0x2d32e6;})});}_0xe339a1=_[_0x642d('0x3b')]({},_0xe339a1,_0x5e1234[_0x642d('0x3d')]);return _0x307916[_0x642d('0x4c')](_0xe339a1);}})['then'](function(_0x306e9f){if(_0x306e9f){_0x405333=_0x306e9f[_0x642d('0x44')];if(!_0x5e1234[_0x642d('0x2f')][_0x642d('0x4d')](_0x642d('0x35'))){_0xe339a1[_0x642d('0x1d')]=qs['limit'](_0x5e1234[_0x642d('0x2f')][_0x642d('0x1d')]);_0xe339a1[_0x642d('0x1a')]=qs['offset'](_0x5e1234[_0x642d('0x2f')][_0x642d('0x1a')]);}return _0x307916[_0x642d('0x4c')](_0xe339a1);}})[_0x642d('0x22')](function(_0x2c747a){if(_0x2c747a){return _0x2c747a?{'count':_0x405333,'rows':_0x2c747a}:null;}})['then'](respondWithResult(_0x4bdb4d,null))[_0x642d('0x42')](handleError(_0x4bdb4d,null));};exports[_0x642d('0x4e')]=function(_0x1f0f0b,_0x275c45,_0x5ba5bf){var _0x37234e={};var _0x2186ee={};var _0x5c2a65;var _0xb154f8;return db[_0x642d('0x2a')][_0x642d('0x4a')]({'where':{'id':_0x1f0f0b[_0x642d('0x49')]['id']}})['then'](handleEntityNotFound(_0x275c45,null))[_0x642d('0x22')](function(_0x3e9821){if(_0x3e9821){_0x5c2a65=_0x3e9821;_0x2186ee[_0x642d('0x2e')]=_[_0x642d('0x30')](db['FreshsalesField'][_0x642d('0x2b')]);_0x2186ee[_0x642d('0x2f')]=_[_0x642d('0x30')](_0x1f0f0b[_0x642d('0x2f')]);_0x2186ee[_0x642d('0x31')]=_['intersection'](_0x2186ee['model'],_0x2186ee[_0x642d('0x2f')]);_0x37234e[_0x642d('0x33')]=_['intersection'](_0x2186ee[_0x642d('0x2e')],qs['fields'](_0x1f0f0b[_0x642d('0x2f')][_0x642d('0x34')]));_0x37234e['attributes']=_0x37234e[_0x642d('0x33')][_0x642d('0x44')]?_0x37234e[_0x642d('0x33')]:_0x2186ee[_0x642d('0x2e')];_0x37234e[_0x642d('0x36')]=qs[_0x642d('0x37')](_0x1f0f0b[_0x642d('0x2f')]['sort']);_0x37234e[_0x642d('0x3a')]=qs[_0x642d('0x31')](_['pick'](_0x1f0f0b[_0x642d('0x2f')],_0x2186ee[_0x642d('0x31')]));if(_0x1f0f0b[_0x642d('0x2f')][_0x642d('0x39')]){_0x37234e[_0x642d('0x3a')]=_['merge'](_0x37234e[_0x642d('0x3a')],{'$or':_[_0x642d('0x29')](_0x37234e[_0x642d('0x33')],function(_0x1de563){var _0x342ce9={};_0x342ce9[_0x1de563]={'$like':'%'+_0x1f0f0b['query'][_0x642d('0x39')]+'%'};return _0x342ce9;})});}_0x37234e=_[_0x642d('0x3b')]({},_0x37234e,_0x1f0f0b[_0x642d('0x3d')]);return _0x5c2a65[_0x642d('0x4e')](_0x37234e);}})[_0x642d('0x22')](function(_0xe8e61d){if(_0xe8e61d){_0xb154f8=_0xe8e61d[_0x642d('0x44')];if(!_0x1f0f0b[_0x642d('0x2f')][_0x642d('0x4d')]('nolimit')){_0x37234e[_0x642d('0x1d')]=qs['limit'](_0x1f0f0b[_0x642d('0x2f')]['limit']);_0x37234e[_0x642d('0x1a')]=qs['offset'](_0x1f0f0b[_0x642d('0x2f')][_0x642d('0x1a')]);}return _0x5c2a65[_0x642d('0x4e')](_0x37234e);}})[_0x642d('0x22')](function(_0xa09983){if(_0xa09983){return _0xa09983?{'count':_0xb154f8,'rows':_0xa09983}:null;}})['then'](respondWithResult(_0x275c45,null))[_0x642d('0x42')](handleError(_0x275c45,null));};exports[_0x642d('0x4f')]=function(_0x989248,_0x298772,_0xe2c4e7){var _0x5086c6={};var _0x1d2f00={};var _0x1bd138;var _0x34124f;return db[_0x642d('0x2a')][_0x642d('0x4a')]({'where':{'id':_0x989248['params']['id']}})['then'](handleEntityNotFound(_0x298772,null))['then'](function(_0x442c2e){if(_0x442c2e){_0x1bd138=_0x442c2e;_0x1d2f00['model']=_['keys'](db[_0x642d('0x4b')][_0x642d('0x2b')]);_0x1d2f00['query']=_['keys'](_0x989248[_0x642d('0x2f')]);_0x1d2f00[_0x642d('0x31')]=_[_0x642d('0x32')](_0x1d2f00['model'],_0x1d2f00[_0x642d('0x2f')]);_0x5086c6[_0x642d('0x33')]=_[_0x642d('0x32')](_0x1d2f00['model'],qs[_0x642d('0x34')](_0x989248[_0x642d('0x2f')][_0x642d('0x34')]));_0x5086c6[_0x642d('0x33')]=_0x5086c6[_0x642d('0x33')][_0x642d('0x44')]?_0x5086c6['attributes']:_0x1d2f00['model'];_0x5086c6[_0x642d('0x36')]=qs['sort'](_0x989248['query']['sort']);_0x5086c6['where']=qs[_0x642d('0x31')](_[_0x642d('0x38')](_0x989248[_0x642d('0x2f')],_0x1d2f00[_0x642d('0x31')]));if(_0x989248[_0x642d('0x2f')][_0x642d('0x39')]){_0x5086c6['where']=_[_0x642d('0x3b')](_0x5086c6['where'],{'$or':_[_0x642d('0x29')](_0x5086c6[_0x642d('0x33')],function(_0x16d8c3){var _0x56597f={};_0x56597f[_0x16d8c3]={'$like':'%'+_0x989248[_0x642d('0x2f')][_0x642d('0x39')]+'%'};return _0x56597f;})});}_0x5086c6=_[_0x642d('0x3b')]({},_0x5086c6,_0x989248[_0x642d('0x3d')]);return _0x1bd138[_0x642d('0x4f')](_0x5086c6);}})['then'](function(_0x4c6a5e){if(_0x4c6a5e){_0x34124f=_0x4c6a5e['length'];if(!_0x989248['query'][_0x642d('0x4d')](_0x642d('0x35'))){_0x5086c6[_0x642d('0x1d')]=qs['limit'](_0x989248[_0x642d('0x2f')][_0x642d('0x1d')]);_0x5086c6[_0x642d('0x1a')]=qs[_0x642d('0x1a')](_0x989248[_0x642d('0x2f')]['offset']);}return _0x1bd138[_0x642d('0x4f')](_0x5086c6);}})['then'](function(_0x1be13f){if(_0x1be13f){return _0x1be13f?{'count':_0x34124f,'rows':_0x1be13f}:null;}})[_0x642d('0x22')](respondWithResult(_0x298772,null))['catch'](handleError(_0x298772,null));}; \ No newline at end of file +var _0x9842=['limit','undefined','count','set','Content-Range','json','save','update','then','destroy','error','stack','name','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','find','create','body','catch','findOne','FreshsalesField','pick','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9842,0x7e));var _0x2984=function(_0x12b892,_0x4f12ea){_0x12b892=_0x12b892-0x0;var _0x1cc118=_0x9842[_0x12b892];return _0x1cc118;};'use strict';var emlformat=require(_0x2984('0x0'));var rimraf=require(_0x2984('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2984('0x2'));var rp=require(_0x2984('0x3'));var moment=require(_0x2984('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2984('0x5'));var util=require(_0x2984('0x6'));var path=require(_0x2984('0x7'));var sox=require(_0x2984('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2984('0x9'));var _=require(_0x2984('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2984('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2984('0xc'));var querystring=require(_0x2984('0xd'));var Papa=require(_0x2984('0xe'));var Redis=require(_0x2984('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2984('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2984('0x11'));var logger=require(_0x2984('0x12'))(_0x2984('0x13'));var utils=require(_0x2984('0x14'));var config=require(_0x2984('0x15'));var licenseUtil=require(_0x2984('0x16'));var db=require(_0x2984('0x17'))['db'];function respondWithStatusCode(_0xce078,_0x365c17){_0x365c17=_0x365c17||0xcc;return function(_0x4af9de){if(_0x4af9de){return _0xce078[_0x2984('0x18')](_0x365c17);}return _0xce078['status'](_0x365c17)[_0x2984('0x19')]();};}function respondWithResult(_0x78dd22,_0x58831d){_0x58831d=_0x58831d||0xc8;return function(_0xb296a3){if(_0xb296a3){return _0x78dd22[_0x2984('0x1a')](_0x58831d)['json'](_0xb296a3);}};}function respondWithFilteredResult(_0x55844e,_0x38017d){return function(_0x199d9c){if(_0x199d9c){var _0x14c015=typeof _0x38017d[_0x2984('0x1b')]==='undefined'&&typeof _0x38017d[_0x2984('0x1c')]===_0x2984('0x1d');var _0x4aed87=_0x199d9c[_0x2984('0x1e')];var _0x24fe02=_0x14c015?0x0:_0x38017d['offset'];var _0x14415a=_0x14c015?_0x199d9c[_0x2984('0x1e')]:_0x38017d[_0x2984('0x1b')]+_0x38017d[_0x2984('0x1c')];var _0x37d040;if(_0x14415a>=_0x4aed87){_0x14415a=_0x4aed87;_0x37d040=0xc8;}else{_0x37d040=0xce;}_0x55844e[_0x2984('0x1a')](_0x37d040);return _0x55844e[_0x2984('0x1f')](_0x2984('0x20'),_0x24fe02+'-'+_0x14415a+'/'+_0x4aed87)[_0x2984('0x21')](_0x199d9c);}return null;};}function patchUpdates(_0x267cc){return function(_0x5c9d28){try{jsonpatch['apply'](_0x5c9d28,_0x267cc,!![]);}catch(_0x2f9924){return BPromise['reject'](_0x2f9924);}return _0x5c9d28[_0x2984('0x22')]();};}function saveUpdates(_0x59afa9,_0x1ca163){return function(_0x328717){if(_0x328717){return _0x328717[_0x2984('0x23')](_0x59afa9)[_0x2984('0x24')](function(_0x4492ef){return _0x4492ef;});}return null;};}function removeEntity(_0x34ff5a,_0x40b0f5){return function(_0x2e339f){if(_0x2e339f){return _0x2e339f[_0x2984('0x25')]()['then'](function(){_0x34ff5a[_0x2984('0x1a')](0xcc)[_0x2984('0x19')]();});}};}function handleEntityNotFound(_0x2ade5c,_0x54dc81){return function(_0x2c931a){if(!_0x2c931a){_0x2ade5c[_0x2984('0x18')](0x194);}return _0x2c931a;};}function handleError(_0x12b803,_0x35df79){_0x35df79=_0x35df79||0x1f4;return function(_0x502563){logger[_0x2984('0x26')](_0x502563[_0x2984('0x27')]);if(_0x502563[_0x2984('0x28')]){delete _0x502563[_0x2984('0x28')];}_0x12b803[_0x2984('0x1a')](_0x35df79)['send'](_0x502563);};}exports[_0x2984('0x29')]=function(_0x681173,_0xfb16e5){var _0x5882c1={},_0x35d8c9={},_0x44cbf9={'count':0x0,'rows':[]};var _0x3cab1c=_[_0x2984('0x2a')](db[_0x2984('0x2b')][_0x2984('0x2c')],function(_0x468d48){return{'name':_0x468d48[_0x2984('0x2d')],'type':_0x468d48[_0x2984('0x2e')]['key']};});_0x35d8c9[_0x2984('0x2f')]=_[_0x2984('0x2a')](_0x3cab1c,'name');_0x35d8c9[_0x2984('0x30')]=_[_0x2984('0x31')](_0x681173['query']);_0x35d8c9[_0x2984('0x32')]=_[_0x2984('0x33')](_0x35d8c9['model'],_0x35d8c9[_0x2984('0x30')]);_0x5882c1['attributes']=_[_0x2984('0x33')](_0x35d8c9[_0x2984('0x2f')],qs[_0x2984('0x34')](_0x681173[_0x2984('0x30')][_0x2984('0x34')]));_0x5882c1[_0x2984('0x35')]=_0x5882c1['attributes'][_0x2984('0x36')]?_0x5882c1['attributes']:_0x35d8c9[_0x2984('0x2f')];if(!_0x681173['query'][_0x2984('0x37')](_0x2984('0x38'))){_0x5882c1[_0x2984('0x1c')]=qs[_0x2984('0x1c')](_0x681173[_0x2984('0x30')][_0x2984('0x1c')]);_0x5882c1['offset']=qs['offset'](_0x681173[_0x2984('0x30')][_0x2984('0x1b')]);}_0x5882c1[_0x2984('0x39')]=qs[_0x2984('0x3a')](_0x681173[_0x2984('0x30')]['sort']);_0x5882c1[_0x2984('0x3b')]=qs[_0x2984('0x32')](_['pick'](_0x681173['query'],_0x35d8c9[_0x2984('0x32')]),_0x3cab1c);if(_0x681173[_0x2984('0x30')][_0x2984('0x3c')]){_0x5882c1[_0x2984('0x3b')]=_[_0x2984('0x3d')](_0x5882c1[_0x2984('0x3b')],{'$or':_[_0x2984('0x2a')](_0x3cab1c,function(_0x3cf883){if(_0x3cf883['type']!==_0x2984('0x3e')){var _0x1b51b6={};_0x1b51b6[_0x3cf883[_0x2984('0x28')]]={'$like':'%'+_0x681173[_0x2984('0x30')][_0x2984('0x3c')]+'%'};return _0x1b51b6;}})});}_0x5882c1=_[_0x2984('0x3d')]({},_0x5882c1,_0x681173[_0x2984('0x3f')]);var _0x575aeb={'where':_0x5882c1[_0x2984('0x3b')]};return db['FreshsalesConfiguration'][_0x2984('0x1e')](_0x575aeb)['then'](function(_0x27f40c){_0x44cbf9[_0x2984('0x1e')]=_0x27f40c;if(_0x681173[_0x2984('0x30')][_0x2984('0x40')]){_0x5882c1['include']=[{'all':!![]}];}return db[_0x2984('0x2b')][_0x2984('0x41')](_0x5882c1);})[_0x2984('0x24')](function(_0x1e1762){_0x44cbf9['rows']=_0x1e1762;return _0x44cbf9;})[_0x2984('0x24')](respondWithFilteredResult(_0xfb16e5,_0x5882c1))['catch'](handleError(_0xfb16e5,null));};exports[_0x2984('0x42')]=function(_0x3e6fca,_0x1078df){var _0x1232e2={'raw':![],'where':{'id':_0x3e6fca[_0x2984('0x43')]['id']}},_0x5ef602={};_0x5ef602[_0x2984('0x2f')]=_['keys'](db[_0x2984('0x2b')][_0x2984('0x2c')]);_0x5ef602[_0x2984('0x30')]=_['keys'](_0x3e6fca[_0x2984('0x30')]);_0x5ef602[_0x2984('0x32')]=_[_0x2984('0x33')](_0x5ef602[_0x2984('0x2f')],_0x5ef602[_0x2984('0x30')]);_0x1232e2[_0x2984('0x35')]=_[_0x2984('0x33')](_0x5ef602[_0x2984('0x2f')],qs[_0x2984('0x34')](_0x3e6fca['query'][_0x2984('0x34')]));_0x1232e2[_0x2984('0x35')]=_0x1232e2[_0x2984('0x35')]['length']?_0x1232e2[_0x2984('0x35')]:_0x5ef602['model'];if(_0x3e6fca[_0x2984('0x30')][_0x2984('0x40')]){_0x1232e2['include']=[{'all':!![]}];}_0x1232e2=_[_0x2984('0x3d')]({},_0x1232e2,_0x3e6fca['options']);return db['FreshsalesConfiguration'][_0x2984('0x44')](_0x1232e2)[_0x2984('0x24')](handleEntityNotFound(_0x1078df,null))[_0x2984('0x24')](respondWithResult(_0x1078df,null))['catch'](handleError(_0x1078df,null));};exports[_0x2984('0x45')]=function(_0x5874da,_0x331ae6){return db[_0x2984('0x2b')][_0x2984('0x45')](_0x5874da[_0x2984('0x46')],{})[_0x2984('0x24')](respondWithResult(_0x331ae6,0xc9))['catch'](handleError(_0x331ae6,null));};exports['update']=function(_0x688f05,_0x58b118){if(_0x688f05[_0x2984('0x46')]['id']){delete _0x688f05[_0x2984('0x46')]['id'];}return db[_0x2984('0x2b')]['find']({'where':{'id':_0x688f05['params']['id']}})[_0x2984('0x24')](handleEntityNotFound(_0x58b118,null))['then'](saveUpdates(_0x688f05[_0x2984('0x46')],null))[_0x2984('0x24')](respondWithResult(_0x58b118,null))[_0x2984('0x47')](handleError(_0x58b118,null));};exports[_0x2984('0x25')]=function(_0x8a7468,_0x11f467){return db[_0x2984('0x2b')]['find']({'where':{'id':_0x8a7468[_0x2984('0x43')]['id']}})[_0x2984('0x24')](handleEntityNotFound(_0x11f467,null))[_0x2984('0x24')](removeEntity(_0x11f467,null))[_0x2984('0x47')](handleError(_0x11f467,null));};exports['getSubjects']=function(_0x23475a,_0x21f2eb,_0x2928b7){var _0x471dbe={};var _0x434202={};var _0x44675b;var _0x5ba56a;return db[_0x2984('0x2b')][_0x2984('0x48')]({'where':{'id':_0x23475a['params']['id']}})[_0x2984('0x24')](handleEntityNotFound(_0x21f2eb,null))[_0x2984('0x24')](function(_0xddda1){if(_0xddda1){_0x44675b=_0xddda1;_0x434202[_0x2984('0x2f')]=_['keys'](db[_0x2984('0x49')][_0x2984('0x2c')]);_0x434202['query']=_[_0x2984('0x31')](_0x23475a['query']);_0x434202[_0x2984('0x32')]=_[_0x2984('0x33')](_0x434202[_0x2984('0x2f')],_0x434202[_0x2984('0x30')]);_0x471dbe[_0x2984('0x35')]=_['intersection'](_0x434202['model'],qs['fields'](_0x23475a[_0x2984('0x30')][_0x2984('0x34')]));_0x471dbe['attributes']=_0x471dbe['attributes'][_0x2984('0x36')]?_0x471dbe[_0x2984('0x35')]:_0x434202[_0x2984('0x2f')];_0x471dbe[_0x2984('0x39')]=qs[_0x2984('0x3a')](_0x23475a[_0x2984('0x30')][_0x2984('0x3a')]);_0x471dbe[_0x2984('0x3b')]=qs[_0x2984('0x32')](_[_0x2984('0x4a')](_0x23475a[_0x2984('0x30')],_0x434202['filters']));if(_0x23475a[_0x2984('0x30')][_0x2984('0x3c')]){_0x471dbe[_0x2984('0x3b')]=_['merge'](_0x471dbe['where'],{'$or':_[_0x2984('0x2a')](_0x471dbe['attributes'],function(_0xd0d81f){var _0x3c3ca8={};_0x3c3ca8[_0xd0d81f]={'$like':'%'+_0x23475a[_0x2984('0x30')][_0x2984('0x3c')]+'%'};return _0x3c3ca8;})});}_0x471dbe=_[_0x2984('0x3d')]({},_0x471dbe,_0x23475a[_0x2984('0x3f')]);return _0x44675b['getSubjects'](_0x471dbe);}})['then'](function(_0x202e03){if(_0x202e03){_0x5ba56a=_0x202e03[_0x2984('0x36')];if(!_0x23475a['query'][_0x2984('0x37')](_0x2984('0x38'))){_0x471dbe[_0x2984('0x1c')]=qs[_0x2984('0x1c')](_0x23475a[_0x2984('0x30')][_0x2984('0x1c')]);_0x471dbe['offset']=qs[_0x2984('0x1b')](_0x23475a[_0x2984('0x30')][_0x2984('0x1b')]);}return _0x44675b['getSubjects'](_0x471dbe);}})[_0x2984('0x24')](function(_0x592cd0){if(_0x592cd0){return _0x592cd0?{'count':_0x5ba56a,'rows':_0x592cd0}:null;}})[_0x2984('0x24')](respondWithResult(_0x21f2eb,null))['catch'](handleError(_0x21f2eb,null));};exports[_0x2984('0x4b')]=function(_0x363b67,_0x56d1e0,_0x1b560f){var _0x34bd71={};var _0x2c0680={};var _0x999ae;var _0x182b73;return db[_0x2984('0x2b')][_0x2984('0x48')]({'where':{'id':_0x363b67[_0x2984('0x43')]['id']}})[_0x2984('0x24')](handleEntityNotFound(_0x56d1e0,null))[_0x2984('0x24')](function(_0x1c1999){if(_0x1c1999){_0x999ae=_0x1c1999;_0x2c0680[_0x2984('0x2f')]=_[_0x2984('0x31')](db[_0x2984('0x49')][_0x2984('0x2c')]);_0x2c0680[_0x2984('0x30')]=_[_0x2984('0x31')](_0x363b67['query']);_0x2c0680[_0x2984('0x32')]=_[_0x2984('0x33')](_0x2c0680[_0x2984('0x2f')],_0x2c0680[_0x2984('0x30')]);_0x34bd71[_0x2984('0x35')]=_['intersection'](_0x2c0680['model'],qs['fields'](_0x363b67['query']['fields']));_0x34bd71[_0x2984('0x35')]=_0x34bd71[_0x2984('0x35')]['length']?_0x34bd71[_0x2984('0x35')]:_0x2c0680['model'];_0x34bd71[_0x2984('0x39')]=qs[_0x2984('0x3a')](_0x363b67[_0x2984('0x30')][_0x2984('0x3a')]);_0x34bd71[_0x2984('0x3b')]=qs[_0x2984('0x32')](_[_0x2984('0x4a')](_0x363b67[_0x2984('0x30')],_0x2c0680[_0x2984('0x32')]));if(_0x363b67[_0x2984('0x30')][_0x2984('0x3c')]){_0x34bd71[_0x2984('0x3b')]=_[_0x2984('0x3d')](_0x34bd71['where'],{'$or':_[_0x2984('0x2a')](_0x34bd71[_0x2984('0x35')],function(_0x40071a){var _0x4c1cd6={};_0x4c1cd6[_0x40071a]={'$like':'%'+_0x363b67[_0x2984('0x30')]['filter']+'%'};return _0x4c1cd6;})});}_0x34bd71=_[_0x2984('0x3d')]({},_0x34bd71,_0x363b67[_0x2984('0x3f')]);return _0x999ae[_0x2984('0x4b')](_0x34bd71);}})[_0x2984('0x24')](function(_0x1b0db2){if(_0x1b0db2){_0x182b73=_0x1b0db2['length'];if(!_0x363b67[_0x2984('0x30')][_0x2984('0x37')](_0x2984('0x38'))){_0x34bd71[_0x2984('0x1c')]=qs[_0x2984('0x1c')](_0x363b67[_0x2984('0x30')][_0x2984('0x1c')]);_0x34bd71[_0x2984('0x1b')]=qs[_0x2984('0x1b')](_0x363b67[_0x2984('0x30')]['offset']);}return _0x999ae['getDescriptions'](_0x34bd71);}})[_0x2984('0x24')](function(_0x439be0){if(_0x439be0){return _0x439be0?{'count':_0x182b73,'rows':_0x439be0}:null;}})[_0x2984('0x24')](respondWithResult(_0x56d1e0,null))['catch'](handleError(_0x56d1e0,null));};exports[_0x2984('0x4c')]=function(_0x1dcdae,_0x4273bc,_0x8260c2){var _0x130293={};var _0x5a68b5={};var _0x40e394;var _0x5cbd72;return db[_0x2984('0x2b')]['findOne']({'where':{'id':_0x1dcdae['params']['id']}})[_0x2984('0x24')](handleEntityNotFound(_0x4273bc,null))[_0x2984('0x24')](function(_0x366f41){if(_0x366f41){_0x40e394=_0x366f41;_0x5a68b5[_0x2984('0x2f')]=_['keys'](db[_0x2984('0x49')][_0x2984('0x2c')]);_0x5a68b5[_0x2984('0x30')]=_[_0x2984('0x31')](_0x1dcdae[_0x2984('0x30')]);_0x5a68b5[_0x2984('0x32')]=_[_0x2984('0x33')](_0x5a68b5[_0x2984('0x2f')],_0x5a68b5[_0x2984('0x30')]);_0x130293['attributes']=_[_0x2984('0x33')](_0x5a68b5[_0x2984('0x2f')],qs[_0x2984('0x34')](_0x1dcdae[_0x2984('0x30')][_0x2984('0x34')]));_0x130293[_0x2984('0x35')]=_0x130293['attributes'][_0x2984('0x36')]?_0x130293[_0x2984('0x35')]:_0x5a68b5[_0x2984('0x2f')];_0x130293[_0x2984('0x39')]=qs[_0x2984('0x3a')](_0x1dcdae[_0x2984('0x30')]['sort']);_0x130293[_0x2984('0x3b')]=qs[_0x2984('0x32')](_['pick'](_0x1dcdae[_0x2984('0x30')],_0x5a68b5[_0x2984('0x32')]));if(_0x1dcdae['query'][_0x2984('0x3c')]){_0x130293[_0x2984('0x3b')]=_[_0x2984('0x3d')](_0x130293['where'],{'$or':_[_0x2984('0x2a')](_0x130293[_0x2984('0x35')],function(_0x1fa68f){var _0x4d01ae={};_0x4d01ae[_0x1fa68f]={'$like':'%'+_0x1dcdae[_0x2984('0x30')][_0x2984('0x3c')]+'%'};return _0x4d01ae;})});}_0x130293=_[_0x2984('0x3d')]({},_0x130293,_0x1dcdae[_0x2984('0x3f')]);return _0x40e394[_0x2984('0x4c')](_0x130293);}})[_0x2984('0x24')](function(_0x1acd22){if(_0x1acd22){_0x5cbd72=_0x1acd22['length'];if(!_0x1dcdae[_0x2984('0x30')][_0x2984('0x37')](_0x2984('0x38'))){_0x130293[_0x2984('0x1c')]=qs[_0x2984('0x1c')](_0x1dcdae['query']['limit']);_0x130293['offset']=qs[_0x2984('0x1b')](_0x1dcdae[_0x2984('0x30')]['offset']);}return _0x40e394[_0x2984('0x4c')](_0x130293);}})[_0x2984('0x24')](function(_0x57a062){if(_0x57a062){return _0x57a062?{'count':_0x5cbd72,'rows':_0x57a062}:null;}})[_0x2984('0x24')](respondWithResult(_0x4273bc,null))[_0x2984('0x47')](handleError(_0x4273bc,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 1d76131..7ce8837 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 _0xafb5=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration'];(function(_0x4ab676,_0x136999){var _0x51f607=function(_0xe10db5){while(--_0xe10db5){_0x4ab676['push'](_0x4ab676['shift']());}};_0x51f607(++_0x136999);}(_0xafb5,0x1a0));var _0x5afb=function(_0x495d2c,_0x317ee1){_0x495d2c=_0x495d2c-0x0;var _0x1c25a6=_0xafb5[_0x495d2c];return _0x1c25a6;};'use strict';var _=require(_0x5afb('0x0'));var util=require(_0x5afb('0x1'));var logger=require(_0x5afb('0x2'))(_0x5afb('0x3'));var moment=require('moment');var BPromise=require(_0x5afb('0x4'));var rp=require(_0x5afb('0x5'));var fs=require('fs');var path=require(_0x5afb('0x6'));var rimraf=require(_0x5afb('0x7'));var config=require(_0x5afb('0x8'));var attributes=require(_0x5afb('0x9'));module[_0x5afb('0xa')]=function(_0x3ffad1,_0x4755c2){return _0x3ffad1[_0x5afb('0xb')](_0x5afb('0xc'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2f6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','lodash','util','../../config/logger'];(function(_0x43dcb8,_0x32cd78){var _0x52822e=function(_0x3e40ff){while(--_0x3e40ff){_0x43dcb8['push'](_0x43dcb8['shift']());}};_0x52822e(++_0x32cd78);}(_0xc2f6,0x1cb));var _0x6c2f=function(_0x2a75cd,_0x247962){_0x2a75cd=_0x2a75cd-0x0;var _0x2319bc=_0xc2f6[_0x2a75cd];return _0x2319bc;};'use strict';var _=require(_0x6c2f('0x0'));var util=require(_0x6c2f('0x1'));var logger=require(_0x6c2f('0x2'))('api');var moment=require(_0x6c2f('0x3'));var BPromise=require(_0x6c2f('0x4'));var rp=require(_0x6c2f('0x5'));var fs=require('fs');var path=require(_0x6c2f('0x6'));var rimraf=require(_0x6c2f('0x7'));var config=require(_0x6c2f('0x8'));var attributes=require(_0x6c2f('0x9'));module['exports']=function(_0x1a1b32,_0x462f61){return _0x1a1b32['define'](_0x6c2f('0xa'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index fa6a662..8dbfa70 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 _0x0a99=['FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4b4567,_0xf57538){var _0x3be3a4=function(_0x5a05c4){while(--_0x5a05c4){_0x4b4567['push'](_0x4b4567['shift']());}};_0x3be3a4(++_0xf57538);}(_0x0a99,0x182));var _0x90a9=function(_0x4cf577,_0x3488aa){_0x4cf577=_0x4cf577-0x0;var _0x13bd29=_0x0a99[_0x4cf577];return _0x13bd29;};'use strict';var _=require('lodash');var util=require(_0x90a9('0x0'));var moment=require(_0x90a9('0x1'));var BPromise=require(_0x90a9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90a9('0x3'))['db'];var utils=require(_0x90a9('0x4'));var logger=require(_0x90a9('0x5'))(_0x90a9('0x6'));var config=require('../../config/environment');var jayson=require(_0x90a9('0x7'));var client=jayson['client'][_0x90a9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5be5a6,_0x300f11,_0x44e426){return new BPromise(function(_0x1535e8,_0x392033){return client[_0x90a9('0x9')](_0x5be5a6,_0x44e426)['then'](function(_0x93e489){logger[_0x90a9('0xa')](_0x90a9('0xb'),_0x300f11,_0x90a9('0xc'));logger[_0x90a9('0xd')](_0x90a9('0xe'),_0x300f11,'request\x20sent',JSON[_0x90a9('0xf')](_0x93e489));if(_0x93e489[_0x90a9('0x10')]){if(_0x93e489[_0x90a9('0x10')]['code']===0x1f4){logger[_0x90a9('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x300f11,_0x93e489['error'][_0x90a9('0x11')]);return _0x392033(_0x93e489['error'][_0x90a9('0x11')]);}logger['error'](_0x90a9('0xb'),_0x300f11,_0x93e489[_0x90a9('0x10')]['message']);return _0x1535e8(_0x93e489['error'][_0x90a9('0x11')]);}else{logger[_0x90a9('0xa')](_0x90a9('0xb'),_0x300f11,_0x90a9('0xc'));_0x1535e8(_0x93e489[_0x90a9('0x12')][_0x90a9('0x11')]);}})[_0x90a9('0x13')](function(_0x2249eb){logger[_0x90a9('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x300f11,_0x2249eb);_0x392033(_0x2249eb);});});} \ No newline at end of file +var _0x6d23=['client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x53e8d3,_0x2f5644){var _0x12df02=function(_0x211ada){while(--_0x211ada){_0x53e8d3['push'](_0x53e8d3['shift']());}};_0x12df02(++_0x2f5644);}(_0x6d23,0x146));var _0x36d2=function(_0x2221fe,_0x35f322){_0x2221fe=_0x2221fe-0x0;var _0xe11292=_0x6d23[_0x2221fe];return _0xe11292;};'use strict';var _=require(_0x36d2('0x0'));var util=require('util');var moment=require(_0x36d2('0x1'));var BPromise=require(_0x36d2('0x2'));var rs=require(_0x36d2('0x3'));var fs=require('fs');var Redis=require(_0x36d2('0x4'));var db=require(_0x36d2('0x5'))['db'];var utils=require(_0x36d2('0x6'));var logger=require(_0x36d2('0x7'))(_0x36d2('0x8'));var config=require(_0x36d2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x36d2('0xa')][_0x36d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45756b,_0x27d364,_0x5896e3){return new BPromise(function(_0x3750fc,_0x281318){return client[_0x36d2('0xc')](_0x45756b,_0x5896e3)['then'](function(_0x44b30b){logger[_0x36d2('0xd')](_0x36d2('0xe'),_0x27d364,_0x36d2('0xf'));logger[_0x36d2('0x10')](_0x36d2('0x11'),_0x27d364,_0x36d2('0xf'),JSON[_0x36d2('0x12')](_0x44b30b));if(_0x44b30b[_0x36d2('0x13')]){if(_0x44b30b['error'][_0x36d2('0x14')]===0x1f4){logger[_0x36d2('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x27d364,_0x44b30b[_0x36d2('0x13')][_0x36d2('0x15')]);return _0x281318(_0x44b30b[_0x36d2('0x13')]['message']);}logger[_0x36d2('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x27d364,_0x44b30b[_0x36d2('0x13')]['message']);return _0x3750fc(_0x44b30b[_0x36d2('0x13')]['message']);}else{logger[_0x36d2('0xd')](_0x36d2('0xe'),_0x27d364,_0x36d2('0xf'));_0x3750fc(_0x44b30b[_0x36d2('0x16')][_0x36d2('0x15')]);}})[_0x36d2('0x17')](function(_0x4c13df){logger[_0x36d2('0x13')](_0x36d2('0xe'),_0x27d364,_0x4c13df);_0x281318(_0x4c13df);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 6e8ee1c..0e3f05c 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 _0xfa7c=['create','put','update','delete','/:id','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post'];(function(_0x54d164,_0x3be5ba){var _0xf58243=function(_0x58faf5){while(--_0x58faf5){_0x54d164['push'](_0x54d164['shift']());}};_0xf58243(++_0x3be5ba);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x499ff4,_0x56a20f){_0x499ff4=_0x499ff4-0x0;var _0x8ec104=_0xfa7c[_0x499ff4];return _0x8ec104;};'use strict';var multer=require(_0xcfa7('0x0'));var util=require('util');var path=require(_0xcfa7('0x1'));var timeout=require(_0xcfa7('0x2'));var express=require(_0xcfa7('0x3'));var router=express[_0xcfa7('0x4')]();var fs_extra=require(_0xcfa7('0x5'));var auth=require(_0xcfa7('0x6'));var interaction=require(_0xcfa7('0x7'));var config=require(_0xcfa7('0x8'));var controller=require('./intFreshsalesField.controller');router[_0xcfa7('0x9')]('/',auth[_0xcfa7('0xa')](),controller[_0xcfa7('0xb')]);router[_0xcfa7('0x9')]('/:id',auth[_0xcfa7('0xa')](),controller[_0xcfa7('0xc')]);router[_0xcfa7('0xd')]('/',auth[_0xcfa7('0xa')](),controller[_0xcfa7('0xe')]);router[_0xcfa7('0xf')]('/:id',auth[_0xcfa7('0xa')](),controller[_0xcfa7('0x10')]);router[_0xcfa7('0x11')](_0xcfa7('0x12'),auth[_0xcfa7('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfa2f=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','path','express'];(function(_0xb56e4f,_0x5206ec){var _0x4e25ba=function(_0x4832e8){while(--_0x4832e8){_0xb56e4f['push'](_0xb56e4f['shift']());}};_0x4e25ba(++_0x5206ec);}(_0xfa2f,0xe8));var _0xffa2=function(_0x41a5f2,_0x2aebb0){_0x41a5f2=_0x41a5f2-0x0;var _0x2028dc=_0xfa2f[_0x41a5f2];return _0x2028dc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xffa2('0x0'));var timeout=require('connect-timeout');var express=require(_0xffa2('0x1'));var router=express[_0xffa2('0x2')]();var fs_extra=require(_0xffa2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xffa2('0x4'));var config=require(_0xffa2('0x5'));var controller=require(_0xffa2('0x6'));router[_0xffa2('0x7')]('/',auth[_0xffa2('0x8')](),controller[_0xffa2('0x9')]);router[_0xffa2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xffa2('0xa')]);router[_0xffa2('0xb')]('/',auth[_0xffa2('0x8')](),controller[_0xffa2('0xc')]);router[_0xffa2('0xd')](_0xffa2('0xe'),auth[_0xffa2('0x8')](),controller['update']);router[_0xffa2('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xffa2('0x10')]);module[_0xffa2('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 08e6a2f..df9f7cc 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 _0xb99e=['ENUM','sequelize','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0xf544f3,_0x5d7650){var _0x480b97=function(_0x33316f){while(--_0x33316f){_0xf544f3['push'](_0xf544f3['shift']());}};_0x480b97(++_0x5d7650);}(_0xb99e,0x119));var _0xeb99=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xb99e[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xeb99('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xeb99('0x1'),_0xeb99('0x2'),_0xeb99('0x3'),_0xeb99('0x4'),_0xeb99('0x5')),'defaultValue':_0xeb99('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xeb99('0x6')]},'keyType':{'type':Sequelize[_0xeb99('0x7')](_0xeb99('0x1'),_0xeb99('0x2'),_0xeb99('0x3'))},'keyContent':{'type':Sequelize[_0xeb99('0x6')]},'idField':{'type':Sequelize[_0xeb99('0x6')]},'nameField':{'type':Sequelize[_0xeb99('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf847=['exports','variable','customVariable','picklist','string','STRING','ENUM','BOOLEAN','sequelize'];(function(_0xd02def,_0x144f25){var _0x2e8374=function(_0x5ceb35){while(--_0x5ceb35){_0xd02def['push'](_0xd02def['shift']());}};_0x2e8374(++_0x144f25);}(_0xf847,0x11f));var _0x7f84=function(_0x95ca75,_0x4448d9){_0x95ca75=_0x95ca75-0x0;var _0x366d52=_0xf847[_0x95ca75];return _0x366d52;};'use strict';var Sequelize=require(_0x7f84('0x0'));module[_0x7f84('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x7f84('0x2'),_0x7f84('0x3'),'keyValue',_0x7f84('0x4')),'defaultValue':_0x7f84('0x5')},'content':{'type':Sequelize[_0x7f84('0x6')]},'key':{'type':Sequelize[_0x7f84('0x6')]},'keyType':{'type':Sequelize[_0x7f84('0x7')](_0x7f84('0x5'),_0x7f84('0x2'),_0x7f84('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7f84('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7f84('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7f84('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 6ca4d53..0195047 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 _0xae98=['status','end','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FreshsalesField','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','includeAll','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x34b6f2,_0xd9b4e4){var _0x3eb885=function(_0x4657a0){while(--_0x4657a0){_0x34b6f2['push'](_0x34b6f2['shift']());}};_0x3eb885(++_0xd9b4e4);}(_0xae98,0xc4));var _0x8ae9=function(_0x45aaae,_0xaecc5){_0x45aaae=_0x45aaae-0x0;var _0x57434c=_0xae98[_0x45aaae];return _0x57434c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8ae9('0x0'));var jsonpatch=require(_0x8ae9('0x1'));var rp=require(_0x8ae9('0x2'));var moment=require(_0x8ae9('0x3'));var BPromise=require(_0x8ae9('0x4'));var Mustache=require(_0x8ae9('0x5'));var util=require(_0x8ae9('0x6'));var path=require(_0x8ae9('0x7'));var sox=require('sox');var csv=require(_0x8ae9('0x8'));var ejs=require(_0x8ae9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ae9('0xa'));var squel=require(_0x8ae9('0xb'));var crypto=require(_0x8ae9('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ae9('0x8'));var querystring=require(_0x8ae9('0xd'));var Papa=require(_0x8ae9('0xe'));var Redis=require(_0x8ae9('0xf'));var authService=require(_0x8ae9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8ae9('0x11'));var hardwareService=require(_0x8ae9('0x12'));var logger=require(_0x8ae9('0x13'))(_0x8ae9('0x14'));var utils=require(_0x8ae9('0x15'));var config=require(_0x8ae9('0x16'));var licenseUtil=require(_0x8ae9('0x17'));var db=require(_0x8ae9('0x18'))['db'];function respondWithStatusCode(_0x1a85ae,_0x3c885f){_0x3c885f=_0x3c885f||0xcc;return function(_0x1b0e52){if(_0x1b0e52){return _0x1a85ae[_0x8ae9('0x19')](_0x3c885f);}return _0x1a85ae[_0x8ae9('0x1a')](_0x3c885f)[_0x8ae9('0x1b')]();};}function respondWithResult(_0x277172,_0x5f1a77){_0x5f1a77=_0x5f1a77||0xc8;return function(_0x486627){if(_0x486627){return _0x277172['status'](_0x5f1a77)['json'](_0x486627);}};}function respondWithFilteredResult(_0x2983c2,_0x125bda){return function(_0x33051c){if(_0x33051c){var _0x3a2c44=typeof _0x125bda[_0x8ae9('0x1c')]===_0x8ae9('0x1d')&&typeof _0x125bda['limit']===_0x8ae9('0x1d');var _0x3d31f3=_0x33051c['count'];var _0x37832b=_0x3a2c44?0x0:_0x125bda[_0x8ae9('0x1c')];var _0x43765e=_0x3a2c44?_0x33051c['count']:_0x125bda[_0x8ae9('0x1c')]+_0x125bda[_0x8ae9('0x1e')];var _0x800330;if(_0x43765e>=_0x3d31f3){_0x43765e=_0x3d31f3;_0x800330=0xc8;}else{_0x800330=0xce;}_0x2983c2[_0x8ae9('0x1a')](_0x800330);return _0x2983c2[_0x8ae9('0x1f')](_0x8ae9('0x20'),_0x37832b+'-'+_0x43765e+'/'+_0x3d31f3)['json'](_0x33051c);}return null;};}function patchUpdates(_0x164cab){return function(_0x25df91){try{jsonpatch[_0x8ae9('0x21')](_0x25df91,_0x164cab,!![]);}catch(_0x4cd4e1){return BPromise[_0x8ae9('0x22')](_0x4cd4e1);}return _0x25df91[_0x8ae9('0x23')]();};}function saveUpdates(_0x3b82c5,_0x1dd4f9){return function(_0x2f493a){if(_0x2f493a){return _0x2f493a[_0x8ae9('0x24')](_0x3b82c5)[_0x8ae9('0x25')](function(_0xe4817c){return _0xe4817c;});}return null;};}function removeEntity(_0x459bcd,_0x6ce8e){return function(_0x4d7c96){if(_0x4d7c96){return _0x4d7c96[_0x8ae9('0x26')]()[_0x8ae9('0x25')](function(){_0x459bcd[_0x8ae9('0x1a')](0xcc)[_0x8ae9('0x1b')]();});}};}function handleEntityNotFound(_0x5a3b08,_0x48a43d){return function(_0x17273a){if(!_0x17273a){_0x5a3b08[_0x8ae9('0x19')](0x194);}return _0x17273a;};}function handleError(_0x3579f3,_0x2b1a54){_0x2b1a54=_0x2b1a54||0x1f4;return function(_0x24ffc3){logger[_0x8ae9('0x27')](_0x24ffc3[_0x8ae9('0x28')]);if(_0x24ffc3[_0x8ae9('0x29')]){delete _0x24ffc3[_0x8ae9('0x29')];}_0x3579f3[_0x8ae9('0x1a')](_0x2b1a54)['send'](_0x24ffc3);};}exports[_0x8ae9('0x2a')]=function(_0x107ea6,_0x4f6ab0){var _0x37890c={},_0x13efd6={},_0x25a11b={'count':0x0,'rows':[]};var _0xb4b9b3=_[_0x8ae9('0x2b')](db[_0x8ae9('0x2c')][_0x8ae9('0x2d')],function(_0x3fe0dd){return{'name':_0x3fe0dd['fieldName'],'type':_0x3fe0dd[_0x8ae9('0x2e')]['key']};});_0x13efd6[_0x8ae9('0x2f')]=_[_0x8ae9('0x2b')](_0xb4b9b3,_0x8ae9('0x29'));_0x13efd6[_0x8ae9('0x30')]=_[_0x8ae9('0x31')](_0x107ea6[_0x8ae9('0x30')]);_0x13efd6[_0x8ae9('0x32')]=_[_0x8ae9('0x33')](_0x13efd6[_0x8ae9('0x2f')],_0x13efd6['query']);_0x37890c[_0x8ae9('0x34')]=_[_0x8ae9('0x33')](_0x13efd6['model'],qs[_0x8ae9('0x35')](_0x107ea6[_0x8ae9('0x30')]['fields']));_0x37890c[_0x8ae9('0x34')]=_0x37890c[_0x8ae9('0x34')][_0x8ae9('0x36')]?_0x37890c[_0x8ae9('0x34')]:_0x13efd6[_0x8ae9('0x2f')];if(!_0x107ea6[_0x8ae9('0x30')]['hasOwnProperty'](_0x8ae9('0x37'))){_0x37890c[_0x8ae9('0x1e')]=qs[_0x8ae9('0x1e')](_0x107ea6[_0x8ae9('0x30')][_0x8ae9('0x1e')]);_0x37890c[_0x8ae9('0x1c')]=qs[_0x8ae9('0x1c')](_0x107ea6[_0x8ae9('0x30')][_0x8ae9('0x1c')]);}_0x37890c['order']=qs[_0x8ae9('0x38')](_0x107ea6['query'][_0x8ae9('0x38')]);_0x37890c[_0x8ae9('0x39')]=qs[_0x8ae9('0x32')](_[_0x8ae9('0x3a')](_0x107ea6[_0x8ae9('0x30')],_0x13efd6[_0x8ae9('0x32')]),_0xb4b9b3);if(_0x107ea6['query'][_0x8ae9('0x3b')]){_0x37890c[_0x8ae9('0x39')]=_[_0x8ae9('0x3c')](_0x37890c[_0x8ae9('0x39')],{'$or':_[_0x8ae9('0x2b')](_0xb4b9b3,function(_0x4b20e){if(_0x4b20e['type']!==_0x8ae9('0x3d')){var _0x5daedf={};_0x5daedf[_0x4b20e[_0x8ae9('0x29')]]={'$like':'%'+_0x107ea6[_0x8ae9('0x30')][_0x8ae9('0x3b')]+'%'};return _0x5daedf;}})});}_0x37890c=_[_0x8ae9('0x3c')]({},_0x37890c,_0x107ea6[_0x8ae9('0x3e')]);var _0x4367c4={'where':_0x37890c[_0x8ae9('0x39')]};return db['FreshsalesField'][_0x8ae9('0x3f')](_0x4367c4)[_0x8ae9('0x25')](function(_0x59007c){_0x25a11b[_0x8ae9('0x3f')]=_0x59007c;if(_0x107ea6[_0x8ae9('0x30')]['includeAll']){_0x37890c[_0x8ae9('0x40')]=[{'all':!![]}];}return db[_0x8ae9('0x2c')][_0x8ae9('0x41')](_0x37890c);})['then'](function(_0x7b9f1f){_0x25a11b[_0x8ae9('0x42')]=_0x7b9f1f;return _0x25a11b;})[_0x8ae9('0x25')](respondWithFilteredResult(_0x4f6ab0,_0x37890c))[_0x8ae9('0x43')](handleError(_0x4f6ab0,null));};exports[_0x8ae9('0x44')]=function(_0x5ce68b,_0x2fb3ff){var _0x3a4324={'raw':!![],'where':{'id':_0x5ce68b['params']['id']}},_0x296e6e={};_0x296e6e[_0x8ae9('0x2f')]=_[_0x8ae9('0x31')](db['FreshsalesField'][_0x8ae9('0x2d')]);_0x296e6e[_0x8ae9('0x30')]=_[_0x8ae9('0x31')](_0x5ce68b[_0x8ae9('0x30')]);_0x296e6e['filters']=_[_0x8ae9('0x33')](_0x296e6e[_0x8ae9('0x2f')],_0x296e6e['query']);_0x3a4324[_0x8ae9('0x34')]=_[_0x8ae9('0x33')](_0x296e6e[_0x8ae9('0x2f')],qs[_0x8ae9('0x35')](_0x5ce68b[_0x8ae9('0x30')][_0x8ae9('0x35')]));_0x3a4324[_0x8ae9('0x34')]=_0x3a4324[_0x8ae9('0x34')][_0x8ae9('0x36')]?_0x3a4324[_0x8ae9('0x34')]:_0x296e6e[_0x8ae9('0x2f')];if(_0x5ce68b[_0x8ae9('0x30')][_0x8ae9('0x45')]){_0x3a4324['include']=[{'all':!![]}];}_0x3a4324=_['merge']({},_0x3a4324,_0x5ce68b[_0x8ae9('0x3e')]);return db[_0x8ae9('0x2c')][_0x8ae9('0x46')](_0x3a4324)['then'](handleEntityNotFound(_0x2fb3ff,null))['then'](respondWithResult(_0x2fb3ff,null))[_0x8ae9('0x43')](handleError(_0x2fb3ff,null));};exports['create']=function(_0x48f2b6,_0xfba381){return db['FreshsalesField'][_0x8ae9('0x47')](_0x48f2b6[_0x8ae9('0x48')],{})[_0x8ae9('0x25')](respondWithResult(_0xfba381,0xc9))[_0x8ae9('0x43')](handleError(_0xfba381,null));};exports[_0x8ae9('0x24')]=function(_0x425efb,_0x13fcf0){if(_0x425efb[_0x8ae9('0x48')]['id']){delete _0x425efb['body']['id'];}return db[_0x8ae9('0x2c')][_0x8ae9('0x46')]({'where':{'id':_0x425efb[_0x8ae9('0x49')]['id']}})[_0x8ae9('0x25')](handleEntityNotFound(_0x13fcf0,null))[_0x8ae9('0x25')](saveUpdates(_0x425efb[_0x8ae9('0x48')],null))['then'](respondWithResult(_0x13fcf0,null))[_0x8ae9('0x43')](handleError(_0x13fcf0,null));};exports[_0x8ae9('0x26')]=function(_0x542a54,_0x1ebf02){return db[_0x8ae9('0x2c')][_0x8ae9('0x46')]({'where':{'id':_0x542a54[_0x8ae9('0x49')]['id']}})[_0x8ae9('0x25')](handleEntityNotFound(_0x1ebf02,null))[_0x8ae9('0x25')](removeEntity(_0x1ebf02,null))[_0x8ae9('0x43')](handleError(_0x1ebf02,null));}; \ No newline at end of file +var _0xbd30=['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','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','destroy','then','end','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x526154,_0xd0fef8){var _0x13f7c8=function(_0x21c226){while(--_0x21c226){_0x526154['push'](_0x526154['shift']());}};_0x13f7c8(++_0xd0fef8);}(_0xbd30,0x94));var _0x0bd3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xbd30[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x0bd3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0bd3('0x1'));var jsonpatch=require(_0x0bd3('0x2'));var rp=require(_0x0bd3('0x3'));var moment=require(_0x0bd3('0x4'));var BPromise=require(_0x0bd3('0x5'));var Mustache=require(_0x0bd3('0x6'));var util=require(_0x0bd3('0x7'));var path=require(_0x0bd3('0x8'));var sox=require(_0x0bd3('0x9'));var csv=require(_0x0bd3('0xa'));var ejs=require(_0x0bd3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0bd3('0xc'));var squel=require(_0x0bd3('0xd'));var crypto=require('crypto');var jsforce=require(_0x0bd3('0xe'));var deskjs=require(_0x0bd3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0bd3('0x10'));var Papa=require(_0x0bd3('0x11'));var Redis=require(_0x0bd3('0x12'));var authService=require(_0x0bd3('0x13'));var qs=require(_0x0bd3('0x14'));var as=require(_0x0bd3('0x15'));var hardwareService=require(_0x0bd3('0x16'));var logger=require(_0x0bd3('0x17'))(_0x0bd3('0x18'));var utils=require(_0x0bd3('0x19'));var config=require(_0x0bd3('0x1a'));var licenseUtil=require(_0x0bd3('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16131a,_0x4072b3){_0x4072b3=_0x4072b3||0xcc;return function(_0x4c879d){if(_0x4c879d){return _0x16131a[_0x0bd3('0x1c')](_0x4072b3);}return _0x16131a[_0x0bd3('0x1d')](_0x4072b3)['end']();};}function respondWithResult(_0xc14513,_0x38ebdc){_0x38ebdc=_0x38ebdc||0xc8;return function(_0x58aadb){if(_0x58aadb){return _0xc14513[_0x0bd3('0x1d')](_0x38ebdc)[_0x0bd3('0x1e')](_0x58aadb);}};}function respondWithFilteredResult(_0x2dbe76,_0x5686c6){return function(_0x3a96cb){if(_0x3a96cb){var _0x58eb23=typeof _0x5686c6[_0x0bd3('0x1f')]===_0x0bd3('0x20')&&typeof _0x5686c6['limit']===_0x0bd3('0x20');var _0xee533f=_0x3a96cb[_0x0bd3('0x21')];var _0x3a6dec=_0x58eb23?0x0:_0x5686c6[_0x0bd3('0x1f')];var _0x108f64=_0x58eb23?_0x3a96cb[_0x0bd3('0x21')]:_0x5686c6[_0x0bd3('0x1f')]+_0x5686c6[_0x0bd3('0x22')];var _0x5646e7;if(_0x108f64>=_0xee533f){_0x108f64=_0xee533f;_0x5646e7=0xc8;}else{_0x5646e7=0xce;}_0x2dbe76[_0x0bd3('0x1d')](_0x5646e7);return _0x2dbe76[_0x0bd3('0x23')]('Content-Range',_0x3a6dec+'-'+_0x108f64+'/'+_0xee533f)[_0x0bd3('0x1e')](_0x3a96cb);}return null;};}function patchUpdates(_0x5afb21){return function(_0x2eb2b4){try{jsonpatch[_0x0bd3('0x24')](_0x2eb2b4,_0x5afb21,!![]);}catch(_0x43e95a){return BPromise[_0x0bd3('0x25')](_0x43e95a);}return _0x2eb2b4[_0x0bd3('0x26')]();};}function saveUpdates(_0x3678a9,_0x2400d2){return function(_0x59997f){if(_0x59997f){return _0x59997f['update'](_0x3678a9)['then'](function(_0x34194a){return _0x34194a;});}return null;};}function removeEntity(_0x16e1e1,_0x11830c){return function(_0x1c2b2e){if(_0x1c2b2e){return _0x1c2b2e[_0x0bd3('0x27')]()[_0x0bd3('0x28')](function(){_0x16e1e1[_0x0bd3('0x1d')](0xcc)[_0x0bd3('0x29')]();});}};}function handleEntityNotFound(_0x43c9e6,_0x4de90a){return function(_0xb72d9c){if(!_0xb72d9c){_0x43c9e6[_0x0bd3('0x1c')](0x194);}return _0xb72d9c;};}function handleError(_0x35f600,_0x103075){_0x103075=_0x103075||0x1f4;return function(_0xaa0582){logger['error'](_0xaa0582[_0x0bd3('0x2a')]);if(_0xaa0582['name']){delete _0xaa0582[_0x0bd3('0x2b')];}_0x35f600[_0x0bd3('0x1d')](_0x103075)[_0x0bd3('0x2c')](_0xaa0582);};}exports[_0x0bd3('0x2d')]=function(_0x23ea94,_0x36f2c5){var _0x3815ba={},_0x1d7e6c={},_0x2170a8={'count':0x0,'rows':[]};var _0x192e9c=_[_0x0bd3('0x2e')](db[_0x0bd3('0x2f')][_0x0bd3('0x30')],function(_0x14a613){return{'name':_0x14a613[_0x0bd3('0x31')],'type':_0x14a613['type'][_0x0bd3('0x32')]};});_0x1d7e6c[_0x0bd3('0x33')]=_[_0x0bd3('0x2e')](_0x192e9c,_0x0bd3('0x2b'));_0x1d7e6c[_0x0bd3('0x34')]=_[_0x0bd3('0x35')](_0x23ea94[_0x0bd3('0x34')]);_0x1d7e6c['filters']=_[_0x0bd3('0x36')](_0x1d7e6c[_0x0bd3('0x33')],_0x1d7e6c[_0x0bd3('0x34')]);_0x3815ba[_0x0bd3('0x37')]=_[_0x0bd3('0x36')](_0x1d7e6c[_0x0bd3('0x33')],qs['fields'](_0x23ea94[_0x0bd3('0x34')][_0x0bd3('0x38')]));_0x3815ba['attributes']=_0x3815ba['attributes'][_0x0bd3('0x39')]?_0x3815ba[_0x0bd3('0x37')]:_0x1d7e6c['model'];if(!_0x23ea94['query'][_0x0bd3('0x3a')](_0x0bd3('0x3b'))){_0x3815ba['limit']=qs['limit'](_0x23ea94[_0x0bd3('0x34')]['limit']);_0x3815ba['offset']=qs[_0x0bd3('0x1f')](_0x23ea94[_0x0bd3('0x34')][_0x0bd3('0x1f')]);}_0x3815ba[_0x0bd3('0x3c')]=qs[_0x0bd3('0x3d')](_0x23ea94[_0x0bd3('0x34')][_0x0bd3('0x3d')]);_0x3815ba[_0x0bd3('0x3e')]=qs[_0x0bd3('0x3f')](_[_0x0bd3('0x40')](_0x23ea94[_0x0bd3('0x34')],_0x1d7e6c[_0x0bd3('0x3f')]),_0x192e9c);if(_0x23ea94[_0x0bd3('0x34')]['filter']){_0x3815ba['where']=_[_0x0bd3('0x41')](_0x3815ba['where'],{'$or':_[_0x0bd3('0x2e')](_0x192e9c,function(_0x2b0c91){if(_0x2b0c91[_0x0bd3('0x42')]!=='VIRTUAL'){var _0x765210={};_0x765210[_0x2b0c91[_0x0bd3('0x2b')]]={'$like':'%'+_0x23ea94[_0x0bd3('0x34')][_0x0bd3('0x43')]+'%'};return _0x765210;}})});}_0x3815ba=_[_0x0bd3('0x41')]({},_0x3815ba,_0x23ea94[_0x0bd3('0x44')]);var _0x5155a1={'where':_0x3815ba[_0x0bd3('0x3e')]};return db[_0x0bd3('0x2f')][_0x0bd3('0x21')](_0x5155a1)[_0x0bd3('0x28')](function(_0x380f18){_0x2170a8['count']=_0x380f18;if(_0x23ea94[_0x0bd3('0x34')][_0x0bd3('0x45')]){_0x3815ba['include']=[{'all':!![]}];}return db[_0x0bd3('0x2f')][_0x0bd3('0x46')](_0x3815ba);})['then'](function(_0xb88263){_0x2170a8[_0x0bd3('0x47')]=_0xb88263;return _0x2170a8;})[_0x0bd3('0x28')](respondWithFilteredResult(_0x36f2c5,_0x3815ba))[_0x0bd3('0x48')](handleError(_0x36f2c5,null));};exports[_0x0bd3('0x49')]=function(_0x294afb,_0xb7e4eb){var _0xd6d3bc={'raw':!![],'where':{'id':_0x294afb[_0x0bd3('0x4a')]['id']}},_0x397d81={};_0x397d81[_0x0bd3('0x33')]=_[_0x0bd3('0x35')](db[_0x0bd3('0x2f')]['rawAttributes']);_0x397d81[_0x0bd3('0x34')]=_[_0x0bd3('0x35')](_0x294afb[_0x0bd3('0x34')]);_0x397d81[_0x0bd3('0x3f')]=_[_0x0bd3('0x36')](_0x397d81['model'],_0x397d81[_0x0bd3('0x34')]);_0xd6d3bc[_0x0bd3('0x37')]=_[_0x0bd3('0x36')](_0x397d81[_0x0bd3('0x33')],qs['fields'](_0x294afb[_0x0bd3('0x34')]['fields']));_0xd6d3bc[_0x0bd3('0x37')]=_0xd6d3bc['attributes'][_0x0bd3('0x39')]?_0xd6d3bc[_0x0bd3('0x37')]:_0x397d81[_0x0bd3('0x33')];if(_0x294afb[_0x0bd3('0x34')][_0x0bd3('0x45')]){_0xd6d3bc[_0x0bd3('0x4b')]=[{'all':!![]}];}_0xd6d3bc=_[_0x0bd3('0x41')]({},_0xd6d3bc,_0x294afb[_0x0bd3('0x44')]);return db['FreshsalesField'][_0x0bd3('0x4c')](_0xd6d3bc)[_0x0bd3('0x28')](handleEntityNotFound(_0xb7e4eb,null))['then'](respondWithResult(_0xb7e4eb,null))[_0x0bd3('0x48')](handleError(_0xb7e4eb,null));};exports['create']=function(_0x4b604d,_0xf5bac6){return db[_0x0bd3('0x2f')][_0x0bd3('0x4d')](_0x4b604d[_0x0bd3('0x4e')],{})['then'](respondWithResult(_0xf5bac6,0xc9))[_0x0bd3('0x48')](handleError(_0xf5bac6,null));};exports[_0x0bd3('0x4f')]=function(_0x10b0e2,_0xdd9efd){if(_0x10b0e2[_0x0bd3('0x4e')]['id']){delete _0x10b0e2['body']['id'];}return db['FreshsalesField'][_0x0bd3('0x4c')]({'where':{'id':_0x10b0e2['params']['id']}})['then'](handleEntityNotFound(_0xdd9efd,null))[_0x0bd3('0x28')](saveUpdates(_0x10b0e2[_0x0bd3('0x4e')],null))[_0x0bd3('0x28')](respondWithResult(_0xdd9efd,null))[_0x0bd3('0x48')](handleError(_0xdd9efd,null));};exports['destroy']=function(_0x4716dc,_0x3bc695){return db[_0x0bd3('0x2f')][_0x0bd3('0x4c')]({'where':{'id':_0x4716dc[_0x0bd3('0x4a')]['id']}})[_0x0bd3('0x28')](handleEntityNotFound(_0x3bc695,null))[_0x0bd3('0x28')](removeEntity(_0x3bc695,null))[_0x0bd3('0x48')](handleError(_0x3bc695,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 7213b39..ce0838c 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 _0x1c01=['exports','define','int_freshsales_fields','idField','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./intFreshsalesField.attributes'];(function(_0x4ff9ac,_0xfb171c){var _0x41643e=function(_0x3f804c){while(--_0x3f804c){_0x4ff9ac['push'](_0x4ff9ac['shift']());}};_0x41643e(++_0xfb171c);}(_0x1c01,0x190));var _0x11c0=function(_0x32f830,_0x2dfa0a){_0x32f830=_0x32f830-0x0;var _0x126fa7=_0x1c01[_0x32f830];return _0x126fa7;};'use strict';var _=require(_0x11c0('0x0'));var util=require(_0x11c0('0x1'));var logger=require(_0x11c0('0x2'))(_0x11c0('0x3'));var moment=require('moment');var BPromise=require(_0x11c0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x11c0('0x5'));var config=require(_0x11c0('0x6'));var attributes=require(_0x11c0('0x7'));module[_0x11c0('0x8')]=function(_0x38c591,_0x5190a4){return _0x38c591[_0x11c0('0x9')]('FreshsalesField',attributes,{'tableName':_0x11c0('0xa'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x11c0('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1d21=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash'];(function(_0x4b9d29,_0x50fb98){var _0x317638=function(_0xb38080){while(--_0xb38080){_0x4b9d29['push'](_0x4b9d29['shift']());}};_0x317638(++_0x50fb98);}(_0x1d21,0x158));var _0x11d2=function(_0x21c601,_0x26f456){_0x21c601=_0x21c601-0x0;var _0xd423f=_0x1d21[_0x21c601];return _0xd423f;};'use strict';var _=require(_0x11d2('0x0'));var util=require(_0x11d2('0x1'));var logger=require(_0x11d2('0x2'))(_0x11d2('0x3'));var moment=require('moment');var BPromise=require(_0x11d2('0x4'));var rp=require(_0x11d2('0x5'));var fs=require('fs');var path=require(_0x11d2('0x6'));var rimraf=require(_0x11d2('0x7'));var config=require('../../config/environment');var attributes=require(_0x11d2('0x8'));module[_0x11d2('0x9')]=function(_0x16e99c,_0x21a2d3){return _0x16e99c[_0x11d2('0xa')](_0x11d2('0xb'),attributes,{'tableName':_0x11d2('0xc'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x11d2('0xd'),_0x11d2('0xe')],'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 fca8913..1cf2fc1 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 _0xd117=['request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','debug','stringify','code','error','message'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xd117,0x182));var _0x7d11=function(_0x43e4b3,_0x1444de){_0x43e4b3=_0x43e4b3-0x0;var _0x10c655=_0xd117[_0x43e4b3];return _0x10c655;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var moment=require(_0x7d11('0x2'));var BPromise=require(_0x7d11('0x3'));var rs=require(_0x7d11('0x4'));var fs=require('fs');var Redis=require(_0x7d11('0x5'));var db=require(_0x7d11('0x6'))['db'];var utils=require(_0x7d11('0x7'));var logger=require(_0x7d11('0x8'))(_0x7d11('0x9'));var config=require(_0x7d11('0xa'));var jayson=require(_0x7d11('0xb'));var client=jayson[_0x7d11('0xc')][_0x7d11('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x345602,_0x3c8d66,_0x47b5e6){return new BPromise(function(_0x3803b5,_0xffd020){return client[_0x7d11('0xe')](_0x345602,_0x47b5e6)['then'](function(_0x305eef){logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,'request\x20sent');logger[_0x7d11('0x11')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x3c8d66,'request\x20sent',JSON[_0x7d11('0x12')](_0x305eef));if(_0x305eef['error']){if(_0x305eef['error'][_0x7d11('0x13')]===0x1f4){logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')]['message']);return _0xffd020(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}logger['error'](_0x7d11('0x10'),_0x3c8d66,_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);return _0x3803b5(_0x305eef[_0x7d11('0x14')][_0x7d11('0x15')]);}else{logger[_0x7d11('0xf')](_0x7d11('0x10'),_0x3c8d66,_0x7d11('0x16'));_0x3803b5(_0x305eef['result'][_0x7d11('0x15')]);}})[_0x7d11('0x17')](function(_0x169733){logger[_0x7d11('0x14')](_0x7d11('0x10'),_0x3c8d66,_0x169733);_0xffd020(_0x169733);});});} \ No newline at end of file +var _0x71ab=['http','request','then','info','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshsalesField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1541a2,_0xaee8df){var _0xe8cae=function(_0x4a0617){while(--_0x4a0617){_0x1541a2['push'](_0x1541a2['shift']());}};_0xe8cae(++_0xaee8df);}(_0x71ab,0x64));var _0xb71a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x71ab[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var moment=require('moment');var BPromise=require(_0xb71a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb71a('0x2'));var db=require(_0xb71a('0x3'))['db'];var utils=require(_0xb71a('0x4'));var logger=require(_0xb71a('0x5'))(_0xb71a('0x6'));var config=require(_0xb71a('0x7'));var jayson=require(_0xb71a('0x8'));var client=jayson[_0xb71a('0x9')][_0xb71a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a84e,_0x4358ce,_0x2a4c86){return new BPromise(function(_0x43ca14,_0x471ab6){return client[_0xb71a('0xb')](_0x35a84e,_0x2a4c86)[_0xb71a('0xc')](function(_0x378c96){logger[_0xb71a('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0xb71a('0xe'));logger['debug'](_0xb71a('0xf'),_0x4358ce,_0xb71a('0xe'),JSON[_0xb71a('0x10')](_0x378c96));if(_0x378c96['error']){if(_0x378c96[_0xb71a('0x11')]['code']===0x1f4){logger[_0xb71a('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0x378c96['error'][_0xb71a('0x12')]);return _0x471ab6(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}logger[_0xb71a('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0x378c96['error']['message']);return _0x43ca14(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}else{logger[_0xb71a('0xd')](_0xb71a('0x13'),_0x4358ce,_0xb71a('0xe'));_0x43ca14(_0x378c96[_0xb71a('0x14')][_0xb71a('0x12')]);}})[_0xb71a('0x15')](function(_0x7710a8){logger['error'](_0xb71a('0x13'),_0x4358ce,_0x7710a8);_0x471ab6(_0x7710a8);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 7fc2d55..2d24a74 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x183d41,_0x1aebd7){var _0x4f0939=function(_0x3e7578){while(--_0x3e7578){_0x183d41['push'](_0x183d41['shift']());}};_0x4f0939(++_0x1aebd7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +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(_0x2fcddd,_0x2a4fa4){var _0x4afdc8=function(_0x37ba9f){while(--_0x37ba9f){_0x2fcddd['push'](_0x2fcddd['shift']());}};_0x4afdc8(++_0x2a4fa4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 c0adff4..9bcf70a 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 _0x2899=['sequelize','exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0xcc9b67,_0x5ccf11){var _0x23387c=function(_0x3ce3d3){while(--_0x3ce3d3){_0xcc9b67['push'](_0xcc9b67['shift']());}};_0x23387c(++_0x5ccf11);}(_0x2899,0x15e));var _0x9289=function(_0x114d61,_0x44af26){_0x114d61=_0x114d61-0x0;var _0x307a05=_0x2899[_0x114d61];return _0x307a05;};'use strict';var Sequelize=require(_0x9289('0x0'));module[_0x9289('0x1')]={'name':{'type':Sequelize[_0x9289('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9289('0x2')],'unique':_0x9289('0x3')},'remoteUri':{'type':Sequelize[_0x9289('0x2')]},'password':{'type':Sequelize[_0x9289('0x2')]},'clientId':{'type':Sequelize[_0x9289('0x2')]},'clientSecret':{'type':Sequelize[_0x9289('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x9289('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9289('0x4')](_0x9289('0x5'),_0x9289('0x6')),'defaultValue':_0x9289('0x5')}}; \ No newline at end of file +var _0xcf9f=['STRING','username','ENUM','integrationTab','newTab','exports'];(function(_0x1bc989,_0x4130ce){var _0x488ead=function(_0xf5c90c){while(--_0xf5c90c){_0x1bc989['push'](_0x1bc989['shift']());}};_0x488ead(++_0x4130ce);}(_0xcf9f,0x13d));var _0xfcf9=function(_0x4b2d65,_0x235972){_0x4b2d65=_0x4b2d65-0x0;var _0x3d6879=_0xcf9f[_0x4b2d65];return _0x3d6879;};'use strict';var Sequelize=require('sequelize');module[_0xfcf9('0x0')]={'name':{'type':Sequelize[_0xfcf9('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfcf9('0x1')],'unique':_0xfcf9('0x2')},'remoteUri':{'type':Sequelize[_0xfcf9('0x1')]},'password':{'type':Sequelize[_0xfcf9('0x1')]},'clientId':{'type':Sequelize[_0xfcf9('0x1')]},'clientSecret':{'type':Sequelize[_0xfcf9('0x1')]},'securityToken':{'type':Sequelize[_0xfcf9('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfcf9('0x3')](_0xfcf9('0x4'),_0xfcf9('0x5')),'defaultValue':_0xfcf9('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 8627ff7..3b8015f 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 _0x740c=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','filter','options','includeAll','include','SalesforceAccount','rows','show','params','find','catch','create','body','getConfigurations','findOne','SalesforceConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','SalesforceField','getFields','Task','remoteUri','clientId','password','securityToken','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','OwnerId','Subject','Description','string','int','picklist','boolean','textarea','remove','label','picklistValues','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x43857d,_0x4550e6){var _0x4b605=function(_0x41e2f1){while(--_0x41e2f1){_0x43857d['push'](_0x43857d['shift']());}};_0x4b605(++_0x4550e6);}(_0x740c,0xda));var _0xc740=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x740c[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc740('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc740('0x1'));var jsonpatch=require(_0xc740('0x2'));var rp=require(_0xc740('0x3'));var moment=require(_0xc740('0x4'));var BPromise=require(_0xc740('0x5'));var Mustache=require('mustache');var util=require(_0xc740('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc740('0x7'));var fs=require('fs');var fs_extra=require(_0xc740('0x8'));var _=require(_0xc740('0x9'));var squel=require(_0xc740('0xa'));var crypto=require('crypto');var jsforce=require(_0xc740('0xb'));var deskjs=require(_0xc740('0xc'));var toCsv=require(_0xc740('0xd'));var querystring=require('querystring');var Papa=require(_0xc740('0xe'));var Redis=require(_0xc740('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc740('0x10'));var as=require(_0xc740('0x11'));var hardwareService=require(_0xc740('0x12'));var logger=require(_0xc740('0x13'))(_0xc740('0x14'));var utils=require(_0xc740('0x15'));var config=require(_0xc740('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xc740('0x17'));function respondWithStatusCode(_0x4a5904,_0x580bd8){_0x580bd8=_0x580bd8||0xcc;return function(_0x2c4dda){if(_0x2c4dda){return _0x4a5904[_0xc740('0x18')](_0x580bd8);}return _0x4a5904['status'](_0x580bd8)[_0xc740('0x19')]();};}function respondWithResult(_0x1b6e4a,_0x3f88c7){_0x3f88c7=_0x3f88c7||0xc8;return function(_0xa43f88){if(_0xa43f88){return _0x1b6e4a[_0xc740('0x1a')](_0x3f88c7)['json'](_0xa43f88);}};}function respondWithFilteredResult(_0x556f67,_0x1e996a){return function(_0x32f1d4){if(_0x32f1d4){var _0x35834d=typeof _0x1e996a[_0xc740('0x1b')]===_0xc740('0x1c')&&typeof _0x1e996a[_0xc740('0x1d')]===_0xc740('0x1c');var _0x26af89=_0x32f1d4[_0xc740('0x1e')];var _0x29da56=_0x35834d?0x0:_0x1e996a[_0xc740('0x1b')];var _0x16b51c=_0x35834d?_0x32f1d4[_0xc740('0x1e')]:_0x1e996a[_0xc740('0x1b')]+_0x1e996a[_0xc740('0x1d')];var _0x1268ff;if(_0x16b51c>=_0x26af89){_0x16b51c=_0x26af89;_0x1268ff=0xc8;}else{_0x1268ff=0xce;}_0x556f67[_0xc740('0x1a')](_0x1268ff);return _0x556f67[_0xc740('0x1f')]('Content-Range',_0x29da56+'-'+_0x16b51c+'/'+_0x26af89)[_0xc740('0x20')](_0x32f1d4);}return null;};}function patchUpdates(_0x2a2e24){return function(_0x112ca0){try{jsonpatch[_0xc740('0x21')](_0x112ca0,_0x2a2e24,!![]);}catch(_0xbe6582){return BPromise['reject'](_0xbe6582);}return _0x112ca0[_0xc740('0x22')]();};}function saveUpdates(_0xb895b8,_0x3ea284){return function(_0x57fecd){if(_0x57fecd){return _0x57fecd[_0xc740('0x23')](_0xb895b8)[_0xc740('0x24')](function(_0x1b6f55){return _0x1b6f55;});}return null;};}function removeEntity(_0x3236a7,_0x5a8a6c){return function(_0x1d19cf){if(_0x1d19cf){return _0x1d19cf[_0xc740('0x25')]()[_0xc740('0x24')](function(){_0x3236a7[_0xc740('0x1a')](0xcc)[_0xc740('0x19')]();});}};}function handleEntityNotFound(_0x159116,_0x25194e){return function(_0x5ceff0){if(!_0x5ceff0){_0x159116['sendStatus'](0x194);}return _0x5ceff0;};}function handleError(_0x2a8d04,_0x22ffbc){_0x22ffbc=_0x22ffbc||0x1f4;return function(_0x528735){logger[_0xc740('0x26')](_0x528735[_0xc740('0x27')]);if(_0x528735[_0xc740('0x28')]){delete _0x528735[_0xc740('0x28')];}_0x2a8d04[_0xc740('0x1a')](_0x22ffbc)[_0xc740('0x29')](_0x528735);};}exports['index']=function(_0xc72b35,_0x197932){var _0x1ecfa0={},_0x3de6d5={},_0x5818a4={'count':0x0,'rows':[]};var _0x32d5df=_[_0xc740('0x2a')](db['SalesforceAccount'][_0xc740('0x2b')],function(_0x11dc2f){return{'name':_0x11dc2f[_0xc740('0x2c')],'type':_0x11dc2f['type'][_0xc740('0x2d')]};});_0x3de6d5[_0xc740('0x2e')]=_['map'](_0x32d5df,_0xc740('0x28'));_0x3de6d5[_0xc740('0x2f')]=_[_0xc740('0x30')](_0xc72b35[_0xc740('0x2f')]);_0x3de6d5['filters']=_[_0xc740('0x31')](_0x3de6d5[_0xc740('0x2e')],_0x3de6d5['query']);_0x1ecfa0[_0xc740('0x32')]=_[_0xc740('0x31')](_0x3de6d5['model'],qs[_0xc740('0x33')](_0xc72b35[_0xc740('0x2f')]['fields']));_0x1ecfa0[_0xc740('0x32')]=_0x1ecfa0['attributes'][_0xc740('0x34')]?_0x1ecfa0['attributes']:_0x3de6d5[_0xc740('0x2e')];if(!_0xc72b35[_0xc740('0x2f')][_0xc740('0x35')](_0xc740('0x36'))){_0x1ecfa0[_0xc740('0x1d')]=qs[_0xc740('0x1d')](_0xc72b35[_0xc740('0x2f')][_0xc740('0x1d')]);_0x1ecfa0[_0xc740('0x1b')]=qs[_0xc740('0x1b')](_0xc72b35['query'][_0xc740('0x1b')]);}_0x1ecfa0[_0xc740('0x37')]=qs[_0xc740('0x38')](_0xc72b35[_0xc740('0x2f')][_0xc740('0x38')]);_0x1ecfa0[_0xc740('0x39')]=qs['filters'](_['pick'](_0xc72b35[_0xc740('0x2f')],_0x3de6d5[_0xc740('0x3a')]),_0x32d5df);if(_0xc72b35[_0xc740('0x2f')]['filter']){_0x1ecfa0[_0xc740('0x39')]=_[_0xc740('0x3b')](_0x1ecfa0[_0xc740('0x39')],{'$or':_['map'](_0x32d5df,function(_0x5be811){if(_0x5be811[_0xc740('0x3c')]!=='VIRTUAL'){var _0x1e1450={};_0x1e1450[_0x5be811['name']]={'$like':'%'+_0xc72b35[_0xc740('0x2f')][_0xc740('0x3d')]+'%'};return _0x1e1450;}})});}_0x1ecfa0=_[_0xc740('0x3b')]({},_0x1ecfa0,_0xc72b35[_0xc740('0x3e')]);var _0x85205a={'where':_0x1ecfa0[_0xc740('0x39')]};return db['SalesforceAccount'][_0xc740('0x1e')](_0x85205a)[_0xc740('0x24')](function(_0x542983){_0x5818a4['count']=_0x542983;if(_0xc72b35[_0xc740('0x2f')][_0xc740('0x3f')]){_0x1ecfa0[_0xc740('0x40')]=[{'all':!![]}];}return db[_0xc740('0x41')]['findAll'](_0x1ecfa0);})[_0xc740('0x24')](function(_0x283bec){_0x5818a4[_0xc740('0x42')]=_0x283bec;return _0x5818a4;})[_0xc740('0x24')](respondWithFilteredResult(_0x197932,_0x1ecfa0))['catch'](handleError(_0x197932,null));};exports[_0xc740('0x43')]=function(_0x4144dc,_0x16b331){var _0x304ca7={'raw':![],'where':{'id':_0x4144dc[_0xc740('0x44')]['id']}},_0x162432={};_0x162432[_0xc740('0x2e')]=_[_0xc740('0x30')](db[_0xc740('0x41')][_0xc740('0x2b')]);_0x162432[_0xc740('0x2f')]=_[_0xc740('0x30')](_0x4144dc[_0xc740('0x2f')]);_0x162432[_0xc740('0x3a')]=_[_0xc740('0x31')](_0x162432[_0xc740('0x2e')],_0x162432[_0xc740('0x2f')]);_0x304ca7['attributes']=_[_0xc740('0x31')](_0x162432['model'],qs[_0xc740('0x33')](_0x4144dc[_0xc740('0x2f')][_0xc740('0x33')]));_0x304ca7[_0xc740('0x32')]=_0x304ca7[_0xc740('0x32')][_0xc740('0x34')]?_0x304ca7[_0xc740('0x32')]:_0x162432['model'];if(_0x4144dc[_0xc740('0x2f')][_0xc740('0x3f')]){_0x304ca7[_0xc740('0x40')]=[{'all':!![]}];}_0x304ca7=_['merge']({},_0x304ca7,_0x4144dc['options']);return db[_0xc740('0x41')][_0xc740('0x45')](_0x304ca7)['then'](handleEntityNotFound(_0x16b331,null))[_0xc740('0x24')](respondWithResult(_0x16b331,null))[_0xc740('0x46')](handleError(_0x16b331,null));};exports[_0xc740('0x47')]=function(_0x502b38,_0x411e82){return db[_0xc740('0x41')][_0xc740('0x47')](_0x502b38['body'],{})[_0xc740('0x24')](respondWithResult(_0x411e82,0xc9))[_0xc740('0x46')](handleError(_0x411e82,null));};exports['update']=function(_0x133726,_0x5060c1){if(_0x133726['body']['id']){delete _0x133726['body']['id'];}return db[_0xc740('0x41')]['find']({'where':{'id':_0x133726[_0xc740('0x44')]['id']}})[_0xc740('0x24')](handleEntityNotFound(_0x5060c1,null))['then'](saveUpdates(_0x133726[_0xc740('0x48')],null))[_0xc740('0x24')](respondWithResult(_0x5060c1,null))[_0xc740('0x46')](handleError(_0x5060c1,null));};exports[_0xc740('0x25')]=function(_0x283185,_0x49249b){return db[_0xc740('0x41')][_0xc740('0x45')]({'where':{'id':_0x283185[_0xc740('0x44')]['id']}})[_0xc740('0x24')](handleEntityNotFound(_0x49249b,null))['then'](removeEntity(_0x49249b,null))[_0xc740('0x46')](handleError(_0x49249b,null));};exports[_0xc740('0x49')]=function(_0x288a98,_0x37f21c,_0x5a4b54){var _0x489746={};var _0xa95104={};var _0x273409;var _0x3fc46c;return db[_0xc740('0x41')][_0xc740('0x4a')]({'where':{'id':_0x288a98[_0xc740('0x44')]['id']}})[_0xc740('0x24')](handleEntityNotFound(_0x37f21c,null))[_0xc740('0x24')](function(_0x77ec58){if(_0x77ec58){_0x273409=_0x77ec58;_0xa95104[_0xc740('0x2e')]=_[_0xc740('0x30')](db[_0xc740('0x4b')]['rawAttributes']);_0xa95104[_0xc740('0x2f')]=_[_0xc740('0x30')](_0x288a98['query']);_0xa95104[_0xc740('0x3a')]=_[_0xc740('0x31')](_0xa95104['model'],_0xa95104[_0xc740('0x2f')]);_0x489746[_0xc740('0x32')]=_['intersection'](_0xa95104[_0xc740('0x2e')],qs[_0xc740('0x33')](_0x288a98['query'][_0xc740('0x33')]));_0x489746['attributes']=_0x489746[_0xc740('0x32')][_0xc740('0x34')]?_0x489746[_0xc740('0x32')]:_0xa95104[_0xc740('0x2e')];_0x489746[_0xc740('0x37')]=qs[_0xc740('0x38')](_0x288a98[_0xc740('0x2f')]['sort']);_0x489746[_0xc740('0x39')]=qs[_0xc740('0x3a')](_[_0xc740('0x4c')](_0x288a98[_0xc740('0x2f')],_0xa95104[_0xc740('0x3a')]));if(_0x288a98[_0xc740('0x2f')][_0xc740('0x3d')]){_0x489746['where']=_[_0xc740('0x3b')](_0x489746[_0xc740('0x39')],{'$or':_['map'](_0x489746[_0xc740('0x32')],function(_0x4dc9b3){var _0x17dfe2={};_0x17dfe2[_0x4dc9b3]={'$like':'%'+_0x288a98[_0xc740('0x2f')][_0xc740('0x3d')]+'%'};return _0x17dfe2;})});}_0x489746=_[_0xc740('0x3b')]({},_0x489746,_0x288a98[_0xc740('0x3e')]);return _0x273409[_0xc740('0x49')](_0x489746);}})[_0xc740('0x24')](function(_0x906bff){if(_0x906bff){_0x3fc46c=_0x906bff[_0xc740('0x34')];if(!_0x288a98[_0xc740('0x2f')]['hasOwnProperty'](_0xc740('0x36'))){_0x489746[_0xc740('0x1d')]=qs[_0xc740('0x1d')](_0x288a98[_0xc740('0x2f')][_0xc740('0x1d')]);_0x489746['offset']=qs[_0xc740('0x1b')](_0x288a98[_0xc740('0x2f')][_0xc740('0x1b')]);}return _0x273409[_0xc740('0x49')](_0x489746);}})[_0xc740('0x24')](function(_0x419da7){if(_0x419da7){return _0x419da7?{'count':_0x3fc46c,'rows':_0x419da7}:null;}})['then'](respondWithResult(_0x37f21c,null))['catch'](handleError(_0x37f21c,null));};exports[_0xc740('0x4d')]=function(_0x12dbc3,_0x2bd4da,_0x5bbe4){if(_0x12dbc3[_0xc740('0x48')]['id']){delete _0x12dbc3[_0xc740('0x48')]['id'];}return db[_0xc740('0x41')][_0xc740('0x4a')]({'where':{'id':_0x12dbc3[_0xc740('0x44')]['id']}})[_0xc740('0x24')](handleEntityNotFound(_0x2bd4da,null))['then'](function(_0x1e30f5){if(_0x1e30f5){_0x12dbc3['body'][_0xc740('0x4e')]=_0x1e30f5['id'];_0x12dbc3[_0xc740('0x48')][_0xc740('0x4f')]=integrations[_0xc740('0x50')](_0x12dbc3[_0xc740('0x48')]['channel'],_0x12dbc3[_0xc740('0x48')][_0xc740('0x3c')]);_0x12dbc3['body'][_0xc740('0x51')]=integrations['getDescriptions'](_0x12dbc3[_0xc740('0x48')][_0xc740('0x52')],_0x12dbc3[_0xc740('0x48')][_0xc740('0x3c')]);return db[_0xc740('0x4b')][_0xc740('0x47')](_0x12dbc3['body'],{'include':[{'model':db[_0xc740('0x53')],'as':_0xc740('0x4f')},{'model':db['SalesforceField'],'as':_0xc740('0x51')}]});}return null;})['then'](respondWithResult(_0x2bd4da,null))[_0xc740('0x46')](handleError(_0x2bd4da,null));};exports[_0xc740('0x54')]=function(_0x3cd496,_0x5d0672,_0x14fe74){var _0x4a77f6;var _0x11d365='';var _0x19dbe2=_0xc740('0x55');return db[_0xc740('0x41')][_0xc740('0x4a')]({'where':{'id':_0x3cd496[_0xc740('0x44')]['id']},'attributes':['id',_0xc740('0x56'),_0xc740('0x57'),'clientSecret','username',_0xc740('0x58'),_0xc740('0x59')]})['then'](handleEntityNotFound(_0x5d0672,null))['then'](function(_0xe200eb){if(_0xe200eb){_0x11d365=_0xe200eb['remoteUri'];var _0x381d29=_0x11d365['slice'](-0x1);if(_0x381d29==='/'){_0x11d365=_0x11d365[_0xc740('0x5a')](0x0,_0x11d365[_0xc740('0x5b')](_0x381d29));}_0x4a77f6=new jsforce[(_0xc740('0x5c'))]({'oauth2':{'loginUrl':_0x11d365,'clientId':_0xe200eb['clientId'],'clientSecret':_0xe200eb['clientSecret']}});return _0x4a77f6[_0xc740('0x5d')](_0xe200eb['username'],_0xe200eb[_0xc740('0x58')][_0xc740('0x5e')](_0xe200eb[_0xc740('0x59')]));}})['then'](function(_0x27993b){if(_0x27993b){if(!_[_0xc740('0x5f')](_0x3cd496[_0xc740('0x2f')]['ticketType'])){_0x19dbe2=_0x3cd496['query'][_0xc740('0x60')];}return _0x4a77f6[_0xc740('0x61')](_0x19dbe2)['describe']();}})[_0xc740('0x24')](function(_0x1363ce){var _0x54039a=[_0xc740('0x62'),'ActivityDate','IsReminderSet','IsRecurrence',_0xc740('0x63'),_0xc740('0x64')];var _0x4f45c3=[_0xc740('0x65'),_0xc740('0x66'),_0xc740('0x67'),_0xc740('0x68'),'email',_0xc740('0x69'),'phone'];if(_0x1363ce){_[_0xc740('0x6a')](_0x1363ce[_0xc740('0x33')],function(_0x5009b4){return _0x54039a['includes'](_0x5009b4[_0xc740('0x28')])||!_0x4f45c3['includes'](_0x5009b4[_0xc740('0x3c')]);});return{'count':_0x1363ce[_0xc740('0x33')]['length'],'rows':_['map'](_0x1363ce[_0xc740('0x33')],function(_0x11480c){return{'id':_0x11480c[_0xc740('0x28')],'name':_0x11480c[_0xc740('0x6b')],'custom':_0x11480c['custom'],'options':_0x11480c[_0xc740('0x6c')]['length']>0x0?_[_0xc740('0x2a')](_0x11480c[_0xc740('0x6c')],function(_0x45b0cf){return{'name':_0x45b0cf[_0xc740('0x6b')],'value':_0x45b0cf['value']};}):_0x11480c[_0xc740('0x3c')]==_0xc740('0x68')?[{'name':_0xc740('0x6d'),'value':_0xc740('0x6e')},{'name':_0xc740('0x6f'),'value':_0xc740('0x70')}]:[]};})};}})['then'](respondWithResult(_0x5d0672,null))['catch'](function(_0x14256f){var _0x3a33dd=_0x3cd496['query'][_0xc740('0x71')]?0x1f4:_0x14256f[_0xc740('0x72')]||0x1f4;logger[_0xc740('0x26')](_0xc740('0x73'),'getFields',_0x3a33dd,JSON[_0xc740('0x74')](_0x14256f));delete _0x14256f[_0xc740('0x28')];if(_0x3a33dd===0x191){_0x3a33dd=0x190;}_0x5d0672['status'](_0x3a33dd)[_0xc740('0x29')](_0x3cd496[_0xc740('0x2f')][_0xc740('0x71')]?{'message':_0xc740('0x75'),'statusCode':_0x14256f[_0xc740('0x72')]}:_0x14256f);});}; \ No newline at end of file +var _0xbc8e=['intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','length','find','create','body','getConfigurations','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','SalesforceField','findOne','clientSecret','username','password','remoteUri','lastIndexOf','Connection','clientId','login','concat','isNil','ticketType','sobject','ActivityDate','IsRecurrence','Subject','string','int','picklist','email','textarea','phone','remove','includes','label','picklistValues','value','boolean','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','SalesforceAccount','rawAttributes','key','model','query','keys','filters'];(function(_0x117ece,_0x5ec451){var _0x516579=function(_0x261100){while(--_0x261100){_0x117ece['push'](_0x117ece['shift']());}};_0x516579(++_0x5ec451);}(_0xbc8e,0x1b0));var _0xebc8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xbc8e[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xebc8('0x0'));var rimraf=require(_0xebc8('0x1'));var zipdir=require(_0xebc8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xebc8('0x3'));var moment=require(_0xebc8('0x4'));var BPromise=require(_0xebc8('0x5'));var Mustache=require(_0xebc8('0x6'));var util=require(_0xebc8('0x7'));var path=require(_0xebc8('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xebc8('0x9'));var squel=require(_0xebc8('0xa'));var crypto=require(_0xebc8('0xb'));var jsforce=require(_0xebc8('0xc'));var deskjs=require(_0xebc8('0xd'));var toCsv=require(_0xebc8('0xe'));var querystring=require(_0xebc8('0xf'));var Papa=require(_0xebc8('0x10'));var Redis=require(_0xebc8('0x11'));var authService=require(_0xebc8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xebc8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xebc8('0x14'))(_0xebc8('0x15'));var utils=require(_0xebc8('0x16'));var config=require(_0xebc8('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xebc8('0x18'));function respondWithStatusCode(_0x3362ab,_0x98581b){_0x98581b=_0x98581b||0xcc;return function(_0x4dd4b7){if(_0x4dd4b7){return _0x3362ab[_0xebc8('0x19')](_0x98581b);}return _0x3362ab[_0xebc8('0x1a')](_0x98581b)[_0xebc8('0x1b')]();};}function respondWithResult(_0x323ed5,_0x506771){_0x506771=_0x506771||0xc8;return function(_0x50bbe6){if(_0x50bbe6){return _0x323ed5['status'](_0x506771)[_0xebc8('0x1c')](_0x50bbe6);}};}function respondWithFilteredResult(_0x47b9b0,_0x1b804f){return function(_0x3ab346){if(_0x3ab346){var _0x45802d=typeof _0x1b804f[_0xebc8('0x1d')]===_0xebc8('0x1e')&&typeof _0x1b804f['limit']===_0xebc8('0x1e');var _0x248810=_0x3ab346[_0xebc8('0x1f')];var _0x167bfa=_0x45802d?0x0:_0x1b804f[_0xebc8('0x1d')];var _0x54c65e=_0x45802d?_0x3ab346[_0xebc8('0x1f')]:_0x1b804f[_0xebc8('0x1d')]+_0x1b804f[_0xebc8('0x20')];var _0x328323;if(_0x54c65e>=_0x248810){_0x54c65e=_0x248810;_0x328323=0xc8;}else{_0x328323=0xce;}_0x47b9b0[_0xebc8('0x1a')](_0x328323);return _0x47b9b0[_0xebc8('0x21')](_0xebc8('0x22'),_0x167bfa+'-'+_0x54c65e+'/'+_0x248810)['json'](_0x3ab346);}return null;};}function patchUpdates(_0xa18314){return function(_0x5454aa){try{jsonpatch[_0xebc8('0x23')](_0x5454aa,_0xa18314,!![]);}catch(_0x54f3da){return BPromise[_0xebc8('0x24')](_0x54f3da);}return _0x5454aa[_0xebc8('0x25')]();};}function saveUpdates(_0x12c11d,_0x38536b){return function(_0x4461ac){if(_0x4461ac){return _0x4461ac[_0xebc8('0x26')](_0x12c11d)[_0xebc8('0x27')](function(_0x50c656){return _0x50c656;});}return null;};}function removeEntity(_0xeb416c,_0x14e243){return function(_0x957a8a){if(_0x957a8a){return _0x957a8a[_0xebc8('0x28')]()[_0xebc8('0x27')](function(){_0xeb416c['status'](0xcc)[_0xebc8('0x1b')]();});}};}function handleEntityNotFound(_0x4caa27,_0x254f5a){return function(_0x840ef4){if(!_0x840ef4){_0x4caa27['sendStatus'](0x194);}return _0x840ef4;};}function handleError(_0x389fc0,_0x4a0d4a){_0x4a0d4a=_0x4a0d4a||0x1f4;return function(_0x242563){logger[_0xebc8('0x29')](_0x242563[_0xebc8('0x2a')]);if(_0x242563[_0xebc8('0x2b')]){delete _0x242563[_0xebc8('0x2b')];}_0x389fc0[_0xebc8('0x1a')](_0x4a0d4a)['send'](_0x242563);};}exports['index']=function(_0x13fcfb,_0x254709){var _0x33cf51={},_0x21a28a={},_0x2b8e16={'count':0x0,'rows':[]};var _0x2a73a0=_[_0xebc8('0x2c')](db[_0xebc8('0x2d')][_0xebc8('0x2e')],function(_0x169c56){return{'name':_0x169c56['fieldName'],'type':_0x169c56['type'][_0xebc8('0x2f')]};});_0x21a28a[_0xebc8('0x30')]=_['map'](_0x2a73a0,_0xebc8('0x2b'));_0x21a28a[_0xebc8('0x31')]=_[_0xebc8('0x32')](_0x13fcfb[_0xebc8('0x31')]);_0x21a28a[_0xebc8('0x33')]=_[_0xebc8('0x34')](_0x21a28a[_0xebc8('0x30')],_0x21a28a['query']);_0x33cf51['attributes']=_[_0xebc8('0x34')](_0x21a28a['model'],qs[_0xebc8('0x35')](_0x13fcfb[_0xebc8('0x31')][_0xebc8('0x35')]));_0x33cf51['attributes']=_0x33cf51['attributes']['length']?_0x33cf51[_0xebc8('0x36')]:_0x21a28a[_0xebc8('0x30')];if(!_0x13fcfb[_0xebc8('0x31')][_0xebc8('0x37')](_0xebc8('0x38'))){_0x33cf51[_0xebc8('0x20')]=qs[_0xebc8('0x20')](_0x13fcfb[_0xebc8('0x31')][_0xebc8('0x20')]);_0x33cf51[_0xebc8('0x1d')]=qs['offset'](_0x13fcfb[_0xebc8('0x31')]['offset']);}_0x33cf51[_0xebc8('0x39')]=qs['sort'](_0x13fcfb['query'][_0xebc8('0x3a')]);_0x33cf51[_0xebc8('0x3b')]=qs[_0xebc8('0x33')](_[_0xebc8('0x3c')](_0x13fcfb['query'],_0x21a28a['filters']),_0x2a73a0);if(_0x13fcfb[_0xebc8('0x31')][_0xebc8('0x3d')]){_0x33cf51[_0xebc8('0x3b')]=_[_0xebc8('0x3e')](_0x33cf51[_0xebc8('0x3b')],{'$or':_['map'](_0x2a73a0,function(_0x1b58ba){if(_0x1b58ba['type']!=='VIRTUAL'){var _0x458d74={};_0x458d74[_0x1b58ba[_0xebc8('0x2b')]]={'$like':'%'+_0x13fcfb[_0xebc8('0x31')][_0xebc8('0x3d')]+'%'};return _0x458d74;}})});}_0x33cf51=_[_0xebc8('0x3e')]({},_0x33cf51,_0x13fcfb[_0xebc8('0x3f')]);var _0x3d051a={'where':_0x33cf51[_0xebc8('0x3b')]};return db[_0xebc8('0x2d')]['count'](_0x3d051a)['then'](function(_0x2f7f9f){_0x2b8e16['count']=_0x2f7f9f;if(_0x13fcfb[_0xebc8('0x31')][_0xebc8('0x40')]){_0x33cf51[_0xebc8('0x41')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xebc8('0x42')](_0x33cf51);})[_0xebc8('0x27')](function(_0x388d2d){_0x2b8e16['rows']=_0x388d2d;return _0x2b8e16;})[_0xebc8('0x27')](respondWithFilteredResult(_0x254709,_0x33cf51))[_0xebc8('0x43')](handleError(_0x254709,null));};exports['show']=function(_0x5d8ea6,_0x3548e9){var _0x1bca85={'raw':![],'where':{'id':_0x5d8ea6[_0xebc8('0x44')]['id']}},_0x3d1ca2={};_0x3d1ca2[_0xebc8('0x30')]=_[_0xebc8('0x32')](db[_0xebc8('0x2d')][_0xebc8('0x2e')]);_0x3d1ca2[_0xebc8('0x31')]=_['keys'](_0x5d8ea6[_0xebc8('0x31')]);_0x3d1ca2[_0xebc8('0x33')]=_[_0xebc8('0x34')](_0x3d1ca2[_0xebc8('0x30')],_0x3d1ca2[_0xebc8('0x31')]);_0x1bca85[_0xebc8('0x36')]=_['intersection'](_0x3d1ca2['model'],qs['fields'](_0x5d8ea6[_0xebc8('0x31')][_0xebc8('0x35')]));_0x1bca85[_0xebc8('0x36')]=_0x1bca85['attributes'][_0xebc8('0x45')]?_0x1bca85['attributes']:_0x3d1ca2[_0xebc8('0x30')];if(_0x5d8ea6[_0xebc8('0x31')][_0xebc8('0x40')]){_0x1bca85[_0xebc8('0x41')]=[{'all':!![]}];}_0x1bca85=_[_0xebc8('0x3e')]({},_0x1bca85,_0x5d8ea6[_0xebc8('0x3f')]);return db[_0xebc8('0x2d')][_0xebc8('0x46')](_0x1bca85)[_0xebc8('0x27')](handleEntityNotFound(_0x3548e9,null))['then'](respondWithResult(_0x3548e9,null))[_0xebc8('0x43')](handleError(_0x3548e9,null));};exports[_0xebc8('0x47')]=function(_0x347e89,_0x59668f){return db[_0xebc8('0x2d')][_0xebc8('0x47')](_0x347e89[_0xebc8('0x48')],{})['then'](respondWithResult(_0x59668f,0xc9))[_0xebc8('0x43')](handleError(_0x59668f,null));};exports['update']=function(_0x457d6b,_0x327902){if(_0x457d6b[_0xebc8('0x48')]['id']){delete _0x457d6b[_0xebc8('0x48')]['id'];}return db[_0xebc8('0x2d')][_0xebc8('0x46')]({'where':{'id':_0x457d6b['params']['id']}})[_0xebc8('0x27')](handleEntityNotFound(_0x327902,null))['then'](saveUpdates(_0x457d6b[_0xebc8('0x48')],null))[_0xebc8('0x27')](respondWithResult(_0x327902,null))[_0xebc8('0x43')](handleError(_0x327902,null));};exports[_0xebc8('0x28')]=function(_0x1e085e,_0x3c46be){return db[_0xebc8('0x2d')][_0xebc8('0x46')]({'where':{'id':_0x1e085e[_0xebc8('0x44')]['id']}})[_0xebc8('0x27')](handleEntityNotFound(_0x3c46be,null))[_0xebc8('0x27')](removeEntity(_0x3c46be,null))[_0xebc8('0x43')](handleError(_0x3c46be,null));};exports[_0xebc8('0x49')]=function(_0x42d028,_0x26f710,_0x4104be){var _0x27999b={};var _0x27d460={};var _0x39091a;var _0x59aa83;return db[_0xebc8('0x2d')]['findOne']({'where':{'id':_0x42d028[_0xebc8('0x44')]['id']}})[_0xebc8('0x27')](handleEntityNotFound(_0x26f710,null))['then'](function(_0xfc0734){if(_0xfc0734){_0x39091a=_0xfc0734;_0x27d460['model']=_[_0xebc8('0x32')](db[_0xebc8('0x4a')][_0xebc8('0x2e')]);_0x27d460[_0xebc8('0x31')]=_[_0xebc8('0x32')](_0x42d028[_0xebc8('0x31')]);_0x27d460[_0xebc8('0x33')]=_[_0xebc8('0x34')](_0x27d460[_0xebc8('0x30')],_0x27d460[_0xebc8('0x31')]);_0x27999b[_0xebc8('0x36')]=_['intersection'](_0x27d460[_0xebc8('0x30')],qs[_0xebc8('0x35')](_0x42d028[_0xebc8('0x31')][_0xebc8('0x35')]));_0x27999b['attributes']=_0x27999b['attributes'][_0xebc8('0x45')]?_0x27999b[_0xebc8('0x36')]:_0x27d460['model'];_0x27999b[_0xebc8('0x39')]=qs[_0xebc8('0x3a')](_0x42d028[_0xebc8('0x31')]['sort']);_0x27999b[_0xebc8('0x3b')]=qs[_0xebc8('0x33')](_[_0xebc8('0x3c')](_0x42d028[_0xebc8('0x31')],_0x27d460['filters']));if(_0x42d028[_0xebc8('0x31')]['filter']){_0x27999b[_0xebc8('0x3b')]=_['merge'](_0x27999b['where'],{'$or':_[_0xebc8('0x2c')](_0x27999b[_0xebc8('0x36')],function(_0xe24f6f){var _0x2f41e0={};_0x2f41e0[_0xe24f6f]={'$like':'%'+_0x42d028['query']['filter']+'%'};return _0x2f41e0;})});}_0x27999b=_[_0xebc8('0x3e')]({},_0x27999b,_0x42d028[_0xebc8('0x3f')]);return _0x39091a[_0xebc8('0x49')](_0x27999b);}})[_0xebc8('0x27')](function(_0x5be974){if(_0x5be974){_0x59aa83=_0x5be974[_0xebc8('0x45')];if(!_0x42d028[_0xebc8('0x31')][_0xebc8('0x37')](_0xebc8('0x38'))){_0x27999b['limit']=qs[_0xebc8('0x20')](_0x42d028[_0xebc8('0x31')][_0xebc8('0x20')]);_0x27999b[_0xebc8('0x1d')]=qs[_0xebc8('0x1d')](_0x42d028[_0xebc8('0x31')][_0xebc8('0x1d')]);}return _0x39091a[_0xebc8('0x49')](_0x27999b);}})[_0xebc8('0x27')](function(_0x4f6eba){if(_0x4f6eba){return _0x4f6eba?{'count':_0x59aa83,'rows':_0x4f6eba}:null;}})['then'](respondWithResult(_0x26f710,null))[_0xebc8('0x43')](handleError(_0x26f710,null));};exports[_0xebc8('0x4b')]=function(_0x54272a,_0xc01c7,_0x4fbdfe){if(_0x54272a['body']['id']){delete _0x54272a[_0xebc8('0x48')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x54272a[_0xebc8('0x44')]['id']}})['then'](handleEntityNotFound(_0xc01c7,null))['then'](function(_0x43fc7d){if(_0x43fc7d){_0x54272a[_0xebc8('0x48')][_0xebc8('0x4c')]=_0x43fc7d['id'];_0x54272a[_0xebc8('0x48')][_0xebc8('0x4d')]=integrations[_0xebc8('0x4e')](_0x54272a[_0xebc8('0x48')][_0xebc8('0x4f')],_0x54272a[_0xebc8('0x48')][_0xebc8('0x50')]);_0x54272a[_0xebc8('0x48')][_0xebc8('0x51')]=integrations[_0xebc8('0x52')](_0x54272a[_0xebc8('0x48')]['channel'],_0x54272a[_0xebc8('0x48')]['type']);return db[_0xebc8('0x4a')][_0xebc8('0x47')](_0x54272a[_0xebc8('0x48')],{'include':[{'model':db[_0xebc8('0x53')],'as':_0xebc8('0x4d')},{'model':db[_0xebc8('0x53')],'as':_0xebc8('0x51')}]});}return null;})['then'](respondWithResult(_0xc01c7,null))[_0xebc8('0x43')](handleError(_0xc01c7,null));};exports['getFields']=function(_0x307d3c,_0x3ebc9e,_0xe527af){var _0x3d6c67;var _0x4c9ad2='';var _0x4323ca='Task';return db[_0xebc8('0x2d')][_0xebc8('0x54')]({'where':{'id':_0x307d3c['params']['id']},'attributes':['id','remoteUri','clientId',_0xebc8('0x55'),_0xebc8('0x56'),_0xebc8('0x57'),'securityToken']})[_0xebc8('0x27')](handleEntityNotFound(_0x3ebc9e,null))[_0xebc8('0x27')](function(_0x586d5c){if(_0x586d5c){_0x4c9ad2=_0x586d5c[_0xebc8('0x58')];var _0x5bbf52=_0x4c9ad2['slice'](-0x1);if(_0x5bbf52==='/'){_0x4c9ad2=_0x4c9ad2['substring'](0x0,_0x4c9ad2[_0xebc8('0x59')](_0x5bbf52));}_0x3d6c67=new jsforce[(_0xebc8('0x5a'))]({'oauth2':{'loginUrl':_0x4c9ad2,'clientId':_0x586d5c[_0xebc8('0x5b')],'clientSecret':_0x586d5c[_0xebc8('0x55')]}});return _0x3d6c67[_0xebc8('0x5c')](_0x586d5c[_0xebc8('0x56')],_0x586d5c['password'][_0xebc8('0x5d')](_0x586d5c['securityToken']));}})['then'](function(_0x5d37e3){if(_0x5d37e3){if(!_[_0xebc8('0x5e')](_0x307d3c[_0xebc8('0x31')]['ticketType'])){_0x4323ca=_0x307d3c[_0xebc8('0x31')][_0xebc8('0x5f')];}return _0x3d6c67[_0xebc8('0x60')](_0x4323ca)['describe']();}})[_0xebc8('0x27')](function(_0x505747){var _0x2d8841=['OwnerId',_0xebc8('0x61'),'IsReminderSet',_0xebc8('0x62'),_0xebc8('0x63'),'Description'];var _0x3ed06f=[_0xebc8('0x64'),_0xebc8('0x65'),_0xebc8('0x66'),'boolean',_0xebc8('0x67'),_0xebc8('0x68'),_0xebc8('0x69')];if(_0x505747){_[_0xebc8('0x6a')](_0x505747['fields'],function(_0x3a5c72){return _0x2d8841[_0xebc8('0x6b')](_0x3a5c72[_0xebc8('0x2b')])||!_0x3ed06f['includes'](_0x3a5c72[_0xebc8('0x50')]);});return{'count':_0x505747[_0xebc8('0x35')][_0xebc8('0x45')],'rows':_[_0xebc8('0x2c')](_0x505747['fields'],function(_0x58dd68){return{'id':_0x58dd68[_0xebc8('0x2b')],'name':_0x58dd68[_0xebc8('0x6c')],'custom':_0x58dd68['custom'],'options':_0x58dd68['picklistValues']['length']>0x0?_[_0xebc8('0x2c')](_0x58dd68[_0xebc8('0x6d')],function(_0x344d61){return{'name':_0x344d61[_0xebc8('0x6c')],'value':_0x344d61[_0xebc8('0x6e')]};}):_0x58dd68[_0xebc8('0x50')]==_0xebc8('0x6f')?[{'name':_0xebc8('0x70'),'value':_0xebc8('0x71')},{'name':_0xebc8('0x72'),'value':_0xebc8('0x73')}]:[]};})};}})['then'](respondWithResult(_0x3ebc9e,null))[_0xebc8('0x43')](function(_0xebaed7){var _0xef0f71=_0x307d3c[_0xebc8('0x31')][_0xebc8('0x74')]?0x1f4:_0xebaed7[_0xebc8('0x75')]||0x1f4;logger[_0xebc8('0x29')](_0xebc8('0x76'),'getFields',_0xef0f71,JSON[_0xebc8('0x77')](_0xebaed7));delete _0xebaed7['name'];if(_0xef0f71===0x191){_0xef0f71=0x190;}_0x3ebc9e[_0xebc8('0x1a')](_0xef0f71)[_0xebc8('0x78')](_0x307d3c[_0xebc8('0x31')][_0xebc8('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0xebaed7['statusCode']}:_0xebaed7);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 0920755..acb8fd9 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 _0x5ed7=['rimraf','./intSalesforceAccount.attributes','exports','define','int_salesforce_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0x5ed7,0x119));var _0x75ed=function(_0x4733c0,_0x21388c){_0x4733c0=_0x4733c0-0x0;var _0xd73421=_0x5ed7[_0x4733c0];return _0xd73421;};'use strict';var _=require(_0x75ed('0x0'));var util=require(_0x75ed('0x1'));var logger=require(_0x75ed('0x2'))('api');var moment=require(_0x75ed('0x3'));var BPromise=require(_0x75ed('0x4'));var rp=require(_0x75ed('0x5'));var fs=require('fs');var path=require(_0x75ed('0x6'));var rimraf=require(_0x75ed('0x7'));var config=require('../../config/environment');var attributes=require(_0x75ed('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x75ed('0x9')]=function(_0x38c4e9,_0x1eb5f7){return _0x38c4e9[_0x75ed('0xa')]('SalesforceAccount',attributes,{'tableName':_0x75ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3512=['exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x48b160,_0x274f3b){var _0x17b3c0=function(_0x452f87){while(--_0x452f87){_0x48b160['push'](_0x48b160['shift']());}};_0x17b3c0(++_0x274f3b);}(_0x3512,0x9e));var _0x2351=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3512[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2351('0x0'));var util=require(_0x2351('0x1'));var logger=require(_0x2351('0x2'))(_0x2351('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2351('0x4'));var fs=require('fs');var path=require(_0x2351('0x5'));var rimraf=require(_0x2351('0x6'));var config=require(_0x2351('0x7'));var attributes=require(_0x2351('0x8'));var integrations=require(_0x2351('0x9'));module[_0x2351('0xa')]=function(_0x118f9b,_0x569ff4){return _0x118f9b[_0x2351('0xb')](_0x2351('0xc'),attributes,{'tableName':_0x2351('0xd'),'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 adda42c..8a7ca1a 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 _0x5d5c=['limit','map','include','model','info','SalesforceAccount','find','ShowSalesforceAccount','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','attributes'];(function(_0x79324e,_0x4af67e){var _0x555666=function(_0x15d9c2){while(--_0x15d9c2){_0x79324e['push'](_0x79324e['shift']());}};_0x555666(++_0x4af67e);}(_0x5d5c,0xe8));var _0xc5d5=function(_0x1a959a,_0x5ac87e){_0x1a959a=_0x1a959a-0x0;var _0x171656=_0x5d5c[_0x1a959a];return _0x171656;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc5d5('0x0'));var rs=require(_0xc5d5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5d5('0x2'))['db'];var utils=require(_0xc5d5('0x3'));var logger=require(_0xc5d5('0x4'))(_0xc5d5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc5d5('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2379ca,_0x3a72ba,_0x45873e){return new BPromise(function(_0x5cdd09,_0x9f4aa0){return client['request'](_0x2379ca,_0x45873e)[_0xc5d5('0x7')](function(_0x24a83b){logger['info'](_0xc5d5('0x8'),_0x3a72ba,'request\x20sent');logger[_0xc5d5('0x9')](_0xc5d5('0xa'),_0x3a72ba,_0xc5d5('0xb'),JSON[_0xc5d5('0xc')](_0x24a83b));if(_0x24a83b[_0xc5d5('0xd')]){if(_0x24a83b[_0xc5d5('0xd')][_0xc5d5('0xe')]===0x1f4){logger['error'](_0xc5d5('0x8'),_0x3a72ba,_0x24a83b[_0xc5d5('0xd')][_0xc5d5('0xf')]);return _0x9f4aa0(_0x24a83b[_0xc5d5('0xd')]['message']);}logger[_0xc5d5('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x3a72ba,_0x24a83b['error']['message']);return _0x5cdd09(_0x24a83b[_0xc5d5('0xd')]['message']);}else{logger['info'](_0xc5d5('0x8'),_0x3a72ba,'request\x20sent');_0x5cdd09(_0x24a83b[_0xc5d5('0x10')][_0xc5d5('0xf')]);}})[_0xc5d5('0x11')](function(_0x2cd58a){logger[_0xc5d5('0xd')](_0xc5d5('0x8'),_0x3a72ba,_0x2cd58a);_0x9f4aa0(_0x2cd58a);});});}exports[_0xc5d5('0x12')]=function(_0x448e4d){var _0x5f2e80=this;return new Promise(function(_0x19197f,_0x17535a){return db['SalesforceAccount'][_0xc5d5('0x13')]({'raw':_0x448e4d['options']?_0x448e4d[_0xc5d5('0x14')][_0xc5d5('0x15')]===undefined?!![]:![]:!![],'where':_0x448e4d[_0xc5d5('0x14')]?_0x448e4d[_0xc5d5('0x14')][_0xc5d5('0x16')]||null:null,'attributes':_0x448e4d['options']?_0x448e4d[_0xc5d5('0x14')][_0xc5d5('0x17')]||null:null,'limit':_0x448e4d[_0xc5d5('0x14')]?_0x448e4d[_0xc5d5('0x14')][_0xc5d5('0x18')]||null:null,'include':_0x448e4d['options']?_0x448e4d[_0xc5d5('0x14')]['include']?_[_0xc5d5('0x19')](_0x448e4d[_0xc5d5('0x14')][_0xc5d5('0x1a')],function(_0x1a0a4b){return{'model':db[_0x1a0a4b[_0xc5d5('0x1b')]],'as':_0x1a0a4b['as'],'attributes':_0x1a0a4b['attributes'],'include':_0x1a0a4b[_0xc5d5('0x1a')]?_['map'](_0x1a0a4b[_0xc5d5('0x1a')],function(_0x1cbcef){return{'model':db[_0x1cbcef[_0xc5d5('0x1b')]],'as':_0x1cbcef['as'],'attributes':_0x1cbcef['attributes'],'include':_0x1cbcef[_0xc5d5('0x1a')]?_['map'](_0x1cbcef[_0xc5d5('0x1a')],function(_0x2dba7b){return{'model':db[_0x2dba7b[_0xc5d5('0x1b')]],'as':_0x2dba7b['as'],'attributes':_0x2dba7b[_0xc5d5('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc5d5('0x7')](function(_0x4f3b5a){logger[_0xc5d5('0x1c')](_0xc5d5('0x12'),_0x448e4d);logger[_0xc5d5('0x9')](_0xc5d5('0x12'),_0x448e4d,JSON[_0xc5d5('0xc')](_0x4f3b5a));_0x19197f(_0x4f3b5a);})[_0xc5d5('0x11')](function(_0x5c39ec){logger[_0xc5d5('0xd')](_0xc5d5('0x12'),_0x5c39ec['message'],_0x448e4d);_0x17535a(_0x5f2e80['error'](0x1f4,_0x5c39ec[_0xc5d5('0xf')]));});});};exports['ShowSalesforceAccount']=function(_0x45e607){var _0x2b32bb=this;return new Promise(function(_0x276876,_0x501374){return db[_0xc5d5('0x1d')][_0xc5d5('0x1e')]({'raw':_0x45e607[_0xc5d5('0x14')]?_0x45e607[_0xc5d5('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x45e607[_0xc5d5('0x14')]?_0x45e607[_0xc5d5('0x14')][_0xc5d5('0x16')]||null:null,'attributes':_0x45e607[_0xc5d5('0x14')]?_0x45e607[_0xc5d5('0x14')][_0xc5d5('0x17')]||null:null,'include':_0x45e607[_0xc5d5('0x14')]?_0x45e607['options'][_0xc5d5('0x1a')]?_[_0xc5d5('0x19')](_0x45e607[_0xc5d5('0x14')]['include'],function(_0x4eb6f1){return{'model':db[_0x4eb6f1[_0xc5d5('0x1b')]],'as':_0x4eb6f1['as'],'attributes':_0x4eb6f1[_0xc5d5('0x17')],'include':_0x4eb6f1[_0xc5d5('0x1a')]?_[_0xc5d5('0x19')](_0x4eb6f1[_0xc5d5('0x1a')],function(_0x4c2b8d){return{'model':db[_0x4c2b8d[_0xc5d5('0x1b')]],'as':_0x4c2b8d['as'],'attributes':_0x4c2b8d[_0xc5d5('0x17')],'include':_0x4c2b8d['include']?_[_0xc5d5('0x19')](_0x4c2b8d[_0xc5d5('0x1a')],function(_0x49e4a6){return{'model':db[_0x49e4a6[_0xc5d5('0x1b')]],'as':_0x49e4a6['as'],'attributes':_0x49e4a6[_0xc5d5('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc5d5('0x7')](function(_0x1b054c){logger[_0xc5d5('0x1c')](_0xc5d5('0x1f'),_0x45e607);logger['debug'](_0xc5d5('0x1f'),_0x45e607,JSON[_0xc5d5('0xc')](_0x1b054c));_0x276876(_0x1b054c);})[_0xc5d5('0x11')](function(_0x239695){logger[_0xc5d5('0xd')](_0xc5d5('0x1f'),_0x239695[_0xc5d5('0xf')],_0x45e607);_0x501374(_0x2b32bb[_0xc5d5('0xd')](0x1f4,_0x239695[_0xc5d5('0xf')]));});});}; \ No newline at end of file +var _0xe228=['ShowSalesforceAccount','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','attributes','limit','map','include','model','find','raw','where'];(function(_0x34d66b,_0x4074d5){var _0x2d3d2d=function(_0x574bf1){while(--_0x574bf1){_0x34d66b['push'](_0x34d66b['shift']());}};_0x2d3d2d(++_0x4074d5);}(_0xe228,0x1f0));var _0x8e22=function(_0x470bb5,_0x231fd5){_0x470bb5=_0x470bb5-0x0;var _0x3ceeac=_0xe228[_0x470bb5];return _0x3ceeac;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8e22('0x0'));var rs=require(_0x8e22('0x1'));var fs=require('fs');var Redis=require(_0x8e22('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e22('0x3'))(_0x8e22('0x4'));var config=require(_0x8e22('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8e22('0x6')][_0x8e22('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ea51a,_0xde8a4b,_0x4410c9){return new BPromise(function(_0x1e28d3,_0x50fdc9){return client['request'](_0x1ea51a,_0x4410c9)[_0x8e22('0x8')](function(_0x100b4a){logger[_0x8e22('0x9')]('SalesforceAccount,\x20%s,\x20%s',_0xde8a4b,_0x8e22('0xa'));logger[_0x8e22('0xb')](_0x8e22('0xc'),_0xde8a4b,_0x8e22('0xa'),JSON[_0x8e22('0xd')](_0x100b4a));if(_0x100b4a[_0x8e22('0xe')]){if(_0x100b4a['error'][_0x8e22('0xf')]===0x1f4){logger[_0x8e22('0xe')](_0x8e22('0x10'),_0xde8a4b,_0x100b4a[_0x8e22('0xe')][_0x8e22('0x11')]);return _0x50fdc9(_0x100b4a['error']['message']);}logger[_0x8e22('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0xde8a4b,_0x100b4a['error'][_0x8e22('0x11')]);return _0x1e28d3(_0x100b4a[_0x8e22('0xe')][_0x8e22('0x11')]);}else{logger[_0x8e22('0x9')](_0x8e22('0x10'),_0xde8a4b,_0x8e22('0xa'));_0x1e28d3(_0x100b4a[_0x8e22('0x12')][_0x8e22('0x11')]);}})[_0x8e22('0x13')](function(_0x12747b){logger[_0x8e22('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0xde8a4b,_0x12747b);_0x50fdc9(_0x12747b);});});}exports[_0x8e22('0x14')]=function(_0x572ad2){var _0x2d1b90=this;return new Promise(function(_0x3ab2c1,_0x1621f2){return db[_0x8e22('0x15')][_0x8e22('0x16')]({'raw':_0x572ad2[_0x8e22('0x17')]?_0x572ad2[_0x8e22('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x572ad2['options']?_0x572ad2[_0x8e22('0x17')]['where']||null:null,'attributes':_0x572ad2[_0x8e22('0x17')]?_0x572ad2[_0x8e22('0x17')][_0x8e22('0x18')]||null:null,'limit':_0x572ad2[_0x8e22('0x17')]?_0x572ad2[_0x8e22('0x17')][_0x8e22('0x19')]||null:null,'include':_0x572ad2[_0x8e22('0x17')]?_0x572ad2[_0x8e22('0x17')]['include']?_[_0x8e22('0x1a')](_0x572ad2[_0x8e22('0x17')][_0x8e22('0x1b')],function(_0x4c26f6){return{'model':db[_0x4c26f6[_0x8e22('0x1c')]],'as':_0x4c26f6['as'],'attributes':_0x4c26f6[_0x8e22('0x18')],'include':_0x4c26f6['include']?_[_0x8e22('0x1a')](_0x4c26f6[_0x8e22('0x1b')],function(_0x481475){return{'model':db[_0x481475['model']],'as':_0x481475['as'],'attributes':_0x481475['attributes'],'include':_0x481475['include']?_[_0x8e22('0x1a')](_0x481475[_0x8e22('0x1b')],function(_0x27c915){return{'model':db[_0x27c915['model']],'as':_0x27c915['as'],'attributes':_0x27c915[_0x8e22('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8e22('0x8')](function(_0x3b2a29){logger[_0x8e22('0x9')](_0x8e22('0x14'),_0x572ad2);logger[_0x8e22('0xb')](_0x8e22('0x14'),_0x572ad2,JSON['stringify'](_0x3b2a29));_0x3ab2c1(_0x3b2a29);})['catch'](function(_0x11a944){logger[_0x8e22('0xe')](_0x8e22('0x14'),_0x11a944[_0x8e22('0x11')],_0x572ad2);_0x1621f2(_0x2d1b90[_0x8e22('0xe')](0x1f4,_0x11a944[_0x8e22('0x11')]));});});};exports['ShowSalesforceAccount']=function(_0x1ddec1){var _0x431a66=this;return new Promise(function(_0x32869d,_0x3b2016){return db['SalesforceAccount'][_0x8e22('0x1d')]({'raw':_0x1ddec1[_0x8e22('0x17')]?_0x1ddec1[_0x8e22('0x17')][_0x8e22('0x1e')]===undefined?!![]:![]:!![],'where':_0x1ddec1[_0x8e22('0x17')]?_0x1ddec1[_0x8e22('0x17')][_0x8e22('0x1f')]||null:null,'attributes':_0x1ddec1['options']?_0x1ddec1[_0x8e22('0x17')]['attributes']||null:null,'include':_0x1ddec1[_0x8e22('0x17')]?_0x1ddec1[_0x8e22('0x17')]['include']?_[_0x8e22('0x1a')](_0x1ddec1[_0x8e22('0x17')]['include'],function(_0x7d5273){return{'model':db[_0x7d5273[_0x8e22('0x1c')]],'as':_0x7d5273['as'],'attributes':_0x7d5273[_0x8e22('0x18')],'include':_0x7d5273[_0x8e22('0x1b')]?_[_0x8e22('0x1a')](_0x7d5273[_0x8e22('0x1b')],function(_0x51189d){return{'model':db[_0x51189d[_0x8e22('0x1c')]],'as':_0x51189d['as'],'attributes':_0x51189d[_0x8e22('0x18')],'include':_0x51189d[_0x8e22('0x1b')]?_[_0x8e22('0x1a')](_0x51189d['include'],function(_0x42850b){return{'model':db[_0x42850b[_0x8e22('0x1c')]],'as':_0x42850b['as'],'attributes':_0x42850b[_0x8e22('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8e22('0x8')](function(_0x4a9e2b){logger[_0x8e22('0x9')]('ShowSalesforceAccount',_0x1ddec1);logger[_0x8e22('0xb')](_0x8e22('0x20'),_0x1ddec1,JSON[_0x8e22('0xd')](_0x4a9e2b));_0x32869d(_0x4a9e2b);})['catch'](function(_0x36d713){logger[_0x8e22('0xe')](_0x8e22('0x20'),_0x36d713[_0x8e22('0x11')],_0x1ddec1);_0x3b2016(_0x431a66['error'](0x1f4,_0x36d713[_0x8e22('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 5044220..92b7f0d 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xdb28,0x106));var _0x8db2=function(_0x980b05,_0x3519c7){_0x980b05=_0x980b05-0x0;var _0x59ca8b=_0xdb28[_0x980b05];return _0x59ca8b;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0xeb1afb,_0x48294b){var _0xbd3688=function(_0x1d80fc){while(--_0x1d80fc){_0xeb1afb['push'](_0xeb1afb['shift']());}};_0xbd3688(++_0x48294b);}(_0x2ef3,0xba));var _0x32ef=function(_0x599fb0,_0x590758){_0x599fb0=_0x599fb0-0x0;var _0x244469=_0x2ef3[_0x599fb0];return _0x244469;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 45d84fb..c8ab109 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 _0xfd2d=['lead','exports','STRING','ENUM','Task','contact_lead','contact','account_contact_lead','account','nothing'];(function(_0x20868d,_0x36ddb3){var _0x25d839=function(_0x48dc08){while(--_0x48dc08){_0x20868d['push'](_0x20868d['shift']());}};_0x25d839(++_0x36ddb3);}(_0xfd2d,0x17d));var _0xdfd2=function(_0x4073e2,_0x4ca44a){_0x4073e2=_0x4073e2-0x0;var _0x2b08f8=_0xfd2d[_0x4073e2];return _0x2b08f8;};'use strict';var Sequelize=require('sequelize');module[_0xdfd2('0x0')]={'name':{'type':Sequelize[_0xdfd2('0x1')]},'description':{'type':Sequelize[_0xdfd2('0x1')]},'ticketType':{'type':Sequelize[_0xdfd2('0x2')](_0xdfd2('0x3'),'Case'),'defaultValue':_0xdfd2('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xdfd2('0x4'),_0xdfd2('0x5'),'lead',_0xdfd2('0x6'),_0xdfd2('0x7')),'defaultValue':_0xdfd2('0x4')},'moduleCreate':{'type':Sequelize[_0xdfd2('0x2')](_0xdfd2('0x8'),_0xdfd2('0x5'),_0xdfd2('0x9'),_0xdfd2('0x7')),'defaultValue':_0xdfd2('0x9')},'leadId':{'type':Sequelize[_0xdfd2('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xdfd2('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xdfd2('0x1')]}}; \ No newline at end of file +var _0xeb0b=['Task','Case','contact_lead','account_contact_lead','account','contact','lead','sequelize','exports','STRING','ENUM'];(function(_0x2300c7,_0x255f74){var _0x23f720=function(_0x3fea57){while(--_0x3fea57){_0x2300c7['push'](_0x2300c7['shift']());}};_0x23f720(++_0x255f74);}(_0xeb0b,0x1ca));var _0xbeb0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeb0b[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xbeb0('0x0'));module[_0xbeb0('0x1')]={'name':{'type':Sequelize[_0xbeb0('0x2')]},'description':{'type':Sequelize[_0xbeb0('0x2')]},'ticketType':{'type':Sequelize[_0xbeb0('0x3')](_0xbeb0('0x4'),_0xbeb0('0x5')),'defaultValue':_0xbeb0('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0xbeb0('0x6'),'contact','lead',_0xbeb0('0x7'),_0xbeb0('0x8')),'defaultValue':_0xbeb0('0x6')},'moduleCreate':{'type':Sequelize[_0xbeb0('0x3')]('nothing',_0xbeb0('0x9'),_0xbeb0('0xa'),_0xbeb0('0x8')),'defaultValue':_0xbeb0('0xa')},'leadId':{'type':Sequelize[_0xbeb0('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xbeb0('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xbeb0('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xbeb0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 8afb428..d73b621 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 _0xd5ec=['fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','include','find','catch','create','body','destroy','getFields','order','getSubjects','findOne','SalesforceField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','count','offset','Content-Range','json','reject','save','update','then','sendStatus','error','stack','name','map','SalesforceConfiguration','rawAttributes','key','model','keys','query','filters','attributes','intersection'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0xd5ec,0xb8));var _0xcd5e=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0xd5ec[_0x261b8a];return _0x3455e8;};'use strict';var emlformat=require(_0xcd5e('0x0'));var rimraf=require(_0xcd5e('0x1'));var zipdir=require(_0xcd5e('0x2'));var jsonpatch=require(_0xcd5e('0x3'));var rp=require('request-promise');var moment=require(_0xcd5e('0x4'));var BPromise=require(_0xcd5e('0x5'));var Mustache=require(_0xcd5e('0x6'));var util=require(_0xcd5e('0x7'));var path=require(_0xcd5e('0x8'));var sox=require(_0xcd5e('0x9'));var csv=require(_0xcd5e('0xa'));var ejs=require(_0xcd5e('0xb'));var fs=require('fs');var fs_extra=require(_0xcd5e('0xc'));var _=require(_0xcd5e('0xd'));var squel=require(_0xcd5e('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcd5e('0xf'));var toCsv=require(_0xcd5e('0xa'));var querystring=require(_0xcd5e('0x10'));var Papa=require('papaparse');var Redis=require(_0xcd5e('0x11'));var authService=require(_0xcd5e('0x12'));var qs=require(_0xcd5e('0x13'));var as=require(_0xcd5e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd5e('0x15'))('api');var utils=require(_0xcd5e('0x16'));var config=require(_0xcd5e('0x17'));var licenseUtil=require(_0xcd5e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x139fd5,_0x270376){_0x270376=_0x270376||0xcc;return function(_0x3656f2){if(_0x3656f2){return _0x139fd5['sendStatus'](_0x270376);}return _0x139fd5[_0xcd5e('0x19')](_0x270376)[_0xcd5e('0x1a')]();};}function respondWithResult(_0x25f0b8,_0x32f947){_0x32f947=_0x32f947||0xc8;return function(_0x4203a9){if(_0x4203a9){return _0x25f0b8[_0xcd5e('0x19')](_0x32f947)['json'](_0x4203a9);}};}function respondWithFilteredResult(_0x44749c,_0x40a6de){return function(_0x35205c){if(_0x35205c){var _0x4fdb02=typeof _0x40a6de['offset']===_0xcd5e('0x1b')&&typeof _0x40a6de['limit']===_0xcd5e('0x1b');var _0x341716=_0x35205c[_0xcd5e('0x1c')];var _0xea7a65=_0x4fdb02?0x0:_0x40a6de[_0xcd5e('0x1d')];var _0x341417=_0x4fdb02?_0x35205c[_0xcd5e('0x1c')]:_0x40a6de[_0xcd5e('0x1d')]+_0x40a6de['limit'];var _0x296b89;if(_0x341417>=_0x341716){_0x341417=_0x341716;_0x296b89=0xc8;}else{_0x296b89=0xce;}_0x44749c[_0xcd5e('0x19')](_0x296b89);return _0x44749c['set'](_0xcd5e('0x1e'),_0xea7a65+'-'+_0x341417+'/'+_0x341716)[_0xcd5e('0x1f')](_0x35205c);}return null;};}function patchUpdates(_0x4148c0){return function(_0x390ee9){try{jsonpatch['apply'](_0x390ee9,_0x4148c0,!![]);}catch(_0x38b9b4){return BPromise[_0xcd5e('0x20')](_0x38b9b4);}return _0x390ee9[_0xcd5e('0x21')]();};}function saveUpdates(_0x49305e,_0x5da31f){return function(_0x9fb738){if(_0x9fb738){return _0x9fb738[_0xcd5e('0x22')](_0x49305e)[_0xcd5e('0x23')](function(_0x1b6ae8){return _0x1b6ae8;});}return null;};}function removeEntity(_0x88e21d,_0x3f2f15){return function(_0x109209){if(_0x109209){return _0x109209['destroy']()[_0xcd5e('0x23')](function(){_0x88e21d[_0xcd5e('0x19')](0xcc)[_0xcd5e('0x1a')]();});}};}function handleEntityNotFound(_0x1b5a89,_0x57e339){return function(_0x3053cf){if(!_0x3053cf){_0x1b5a89[_0xcd5e('0x24')](0x194);}return _0x3053cf;};}function handleError(_0x2371b8,_0x4d4125){_0x4d4125=_0x4d4125||0x1f4;return function(_0x8930c7){logger[_0xcd5e('0x25')](_0x8930c7[_0xcd5e('0x26')]);if(_0x8930c7[_0xcd5e('0x27')]){delete _0x8930c7[_0xcd5e('0x27')];}_0x2371b8[_0xcd5e('0x19')](_0x4d4125)['send'](_0x8930c7);};}exports['index']=function(_0x44ac50,_0x297f7b){var _0x1d3752={},_0x37ee24={},_0x2d365f={'count':0x0,'rows':[]};var _0x242a6b=_[_0xcd5e('0x28')](db[_0xcd5e('0x29')][_0xcd5e('0x2a')],function(_0x5a16a1){return{'name':_0x5a16a1['fieldName'],'type':_0x5a16a1['type'][_0xcd5e('0x2b')]};});_0x37ee24[_0xcd5e('0x2c')]=_['map'](_0x242a6b,_0xcd5e('0x27'));_0x37ee24['query']=_[_0xcd5e('0x2d')](_0x44ac50[_0xcd5e('0x2e')]);_0x37ee24[_0xcd5e('0x2f')]=_['intersection'](_0x37ee24[_0xcd5e('0x2c')],_0x37ee24[_0xcd5e('0x2e')]);_0x1d3752[_0xcd5e('0x30')]=_[_0xcd5e('0x31')](_0x37ee24[_0xcd5e('0x2c')],qs['fields'](_0x44ac50[_0xcd5e('0x2e')][_0xcd5e('0x32')]));_0x1d3752[_0xcd5e('0x30')]=_0x1d3752[_0xcd5e('0x30')][_0xcd5e('0x33')]?_0x1d3752['attributes']:_0x37ee24[_0xcd5e('0x2c')];if(!_0x44ac50[_0xcd5e('0x2e')][_0xcd5e('0x34')](_0xcd5e('0x35'))){_0x1d3752[_0xcd5e('0x36')]=qs[_0xcd5e('0x36')](_0x44ac50[_0xcd5e('0x2e')][_0xcd5e('0x36')]);_0x1d3752[_0xcd5e('0x1d')]=qs[_0xcd5e('0x1d')](_0x44ac50[_0xcd5e('0x2e')][_0xcd5e('0x1d')]);}_0x1d3752['order']=qs[_0xcd5e('0x37')](_0x44ac50[_0xcd5e('0x2e')][_0xcd5e('0x37')]);_0x1d3752[_0xcd5e('0x38')]=qs[_0xcd5e('0x2f')](_[_0xcd5e('0x39')](_0x44ac50[_0xcd5e('0x2e')],_0x37ee24[_0xcd5e('0x2f')]),_0x242a6b);if(_0x44ac50[_0xcd5e('0x2e')][_0xcd5e('0x3a')]){_0x1d3752[_0xcd5e('0x38')]=_[_0xcd5e('0x3b')](_0x1d3752[_0xcd5e('0x38')],{'$or':_[_0xcd5e('0x28')](_0x242a6b,function(_0x48a1c9){if(_0x48a1c9['type']!==_0xcd5e('0x3c')){var _0xc40d69={};_0xc40d69[_0x48a1c9[_0xcd5e('0x27')]]={'$like':'%'+_0x44ac50[_0xcd5e('0x2e')][_0xcd5e('0x3a')]+'%'};return _0xc40d69;}})});}_0x1d3752=_[_0xcd5e('0x3b')]({},_0x1d3752,_0x44ac50[_0xcd5e('0x3d')]);var _0x461717={'where':_0x1d3752[_0xcd5e('0x38')]};return db[_0xcd5e('0x29')][_0xcd5e('0x1c')](_0x461717)[_0xcd5e('0x23')](function(_0x279344){_0x2d365f[_0xcd5e('0x1c')]=_0x279344;if(_0x44ac50[_0xcd5e('0x2e')]['includeAll']){_0x1d3752['include']=[{'all':!![]}];}return db[_0xcd5e('0x29')][_0xcd5e('0x3e')](_0x1d3752);})['then'](function(_0x139538){_0x2d365f[_0xcd5e('0x3f')]=_0x139538;return _0x2d365f;})['then'](respondWithFilteredResult(_0x297f7b,_0x1d3752))['catch'](handleError(_0x297f7b,null));};exports[_0xcd5e('0x40')]=function(_0x4356e5,_0x3327ee){var _0x3efd50={'raw':![],'where':{'id':_0x4356e5[_0xcd5e('0x41')]['id']}},_0x50c2e7={};_0x50c2e7[_0xcd5e('0x2c')]=_[_0xcd5e('0x2d')](db[_0xcd5e('0x29')][_0xcd5e('0x2a')]);_0x50c2e7[_0xcd5e('0x2e')]=_['keys'](_0x4356e5[_0xcd5e('0x2e')]);_0x50c2e7[_0xcd5e('0x2f')]=_[_0xcd5e('0x31')](_0x50c2e7[_0xcd5e('0x2c')],_0x50c2e7[_0xcd5e('0x2e')]);_0x3efd50['attributes']=_[_0xcd5e('0x31')](_0x50c2e7[_0xcd5e('0x2c')],qs['fields'](_0x4356e5[_0xcd5e('0x2e')][_0xcd5e('0x32')]));_0x3efd50[_0xcd5e('0x30')]=_0x3efd50[_0xcd5e('0x30')][_0xcd5e('0x33')]?_0x3efd50[_0xcd5e('0x30')]:_0x50c2e7[_0xcd5e('0x2c')];if(_0x4356e5['query']['includeAll']){_0x3efd50[_0xcd5e('0x42')]=[{'all':!![]}];}_0x3efd50=_[_0xcd5e('0x3b')]({},_0x3efd50,_0x4356e5['options']);return db[_0xcd5e('0x29')][_0xcd5e('0x43')](_0x3efd50)['then'](handleEntityNotFound(_0x3327ee,null))[_0xcd5e('0x23')](respondWithResult(_0x3327ee,null))[_0xcd5e('0x44')](handleError(_0x3327ee,null));};exports[_0xcd5e('0x45')]=function(_0x78e82a,_0x598503){return db['SalesforceConfiguration'][_0xcd5e('0x45')](_0x78e82a[_0xcd5e('0x46')],{})[_0xcd5e('0x23')](respondWithResult(_0x598503,0xc9))[_0xcd5e('0x44')](handleError(_0x598503,null));};exports[_0xcd5e('0x22')]=function(_0x18f89a,_0x1326a2){if(_0x18f89a['body']['id']){delete _0x18f89a[_0xcd5e('0x46')]['id'];}return db[_0xcd5e('0x29')][_0xcd5e('0x43')]({'where':{'id':_0x18f89a[_0xcd5e('0x41')]['id']}})[_0xcd5e('0x23')](handleEntityNotFound(_0x1326a2,null))[_0xcd5e('0x23')](saveUpdates(_0x18f89a[_0xcd5e('0x46')],null))['then'](respondWithResult(_0x1326a2,null))[_0xcd5e('0x44')](handleError(_0x1326a2,null));};exports[_0xcd5e('0x47')]=function(_0x57802f,_0x4c6453){return db[_0xcd5e('0x29')][_0xcd5e('0x43')]({'where':{'id':_0x57802f[_0xcd5e('0x41')]['id']}})[_0xcd5e('0x23')](handleEntityNotFound(_0x4c6453,null))[_0xcd5e('0x23')](removeEntity(_0x4c6453,null))[_0xcd5e('0x44')](handleError(_0x4c6453,null));};exports[_0xcd5e('0x48')]=function(_0x2b6746,_0x2c24a7,_0x424f8c){var _0x58a1cb={};var _0x1dfb1d={};var _0x1c0de6;var _0x5979b6;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x2b6746[_0xcd5e('0x41')]['id']}})[_0xcd5e('0x23')](handleEntityNotFound(_0x2c24a7,null))['then'](function(_0x2ea05a){if(_0x2ea05a){_0x1c0de6=_0x2ea05a;_0x1dfb1d[_0xcd5e('0x2c')]=_['keys'](db['SalesforceField'][_0xcd5e('0x2a')]);_0x1dfb1d['query']=_[_0xcd5e('0x2d')](_0x2b6746['query']);_0x1dfb1d[_0xcd5e('0x2f')]=_[_0xcd5e('0x31')](_0x1dfb1d[_0xcd5e('0x2c')],_0x1dfb1d['query']);_0x58a1cb[_0xcd5e('0x30')]=_['intersection'](_0x1dfb1d[_0xcd5e('0x2c')],qs['fields'](_0x2b6746[_0xcd5e('0x2e')][_0xcd5e('0x32')]));_0x58a1cb[_0xcd5e('0x30')]=_0x58a1cb['attributes'][_0xcd5e('0x33')]?_0x58a1cb[_0xcd5e('0x30')]:_0x1dfb1d[_0xcd5e('0x2c')];_0x58a1cb[_0xcd5e('0x49')]=qs[_0xcd5e('0x37')](_0x2b6746[_0xcd5e('0x2e')][_0xcd5e('0x37')]);_0x58a1cb[_0xcd5e('0x38')]=qs[_0xcd5e('0x2f')](_[_0xcd5e('0x39')](_0x2b6746[_0xcd5e('0x2e')],_0x1dfb1d[_0xcd5e('0x2f')]));if(_0x2b6746[_0xcd5e('0x2e')][_0xcd5e('0x3a')]){_0x58a1cb[_0xcd5e('0x38')]=_[_0xcd5e('0x3b')](_0x58a1cb[_0xcd5e('0x38')],{'$or':_[_0xcd5e('0x28')](_0x58a1cb['attributes'],function(_0x1bed6f){var _0x489aba={};_0x489aba[_0x1bed6f]={'$like':'%'+_0x2b6746[_0xcd5e('0x2e')][_0xcd5e('0x3a')]+'%'};return _0x489aba;})});}_0x58a1cb=_[_0xcd5e('0x3b')]({},_0x58a1cb,_0x2b6746['options']);return _0x1c0de6['getFields'](_0x58a1cb);}})[_0xcd5e('0x23')](function(_0x28ea2e){if(_0x28ea2e){_0x5979b6=_0x28ea2e[_0xcd5e('0x33')];if(!_0x2b6746[_0xcd5e('0x2e')]['hasOwnProperty']('nolimit')){_0x58a1cb[_0xcd5e('0x36')]=qs[_0xcd5e('0x36')](_0x2b6746[_0xcd5e('0x2e')][_0xcd5e('0x36')]);_0x58a1cb['offset']=qs['offset'](_0x2b6746['query'][_0xcd5e('0x1d')]);}return _0x1c0de6[_0xcd5e('0x48')](_0x58a1cb);}})['then'](function(_0x53fbd3){if(_0x53fbd3){return _0x53fbd3?{'count':_0x5979b6,'rows':_0x53fbd3}:null;}})[_0xcd5e('0x23')](respondWithResult(_0x2c24a7,null))[_0xcd5e('0x44')](handleError(_0x2c24a7,null));};exports[_0xcd5e('0x4a')]=function(_0x3e6482,_0xbde534,_0x57a4a6){var _0x3c1f7f={};var _0x225db5={};var _0x3d9e7a;var _0x4d05d6;return db[_0xcd5e('0x29')][_0xcd5e('0x4b')]({'where':{'id':_0x3e6482[_0xcd5e('0x41')]['id']}})[_0xcd5e('0x23')](handleEntityNotFound(_0xbde534,null))['then'](function(_0x29e04e){if(_0x29e04e){_0x3d9e7a=_0x29e04e;_0x225db5['model']=_[_0xcd5e('0x2d')](db[_0xcd5e('0x4c')][_0xcd5e('0x2a')]);_0x225db5[_0xcd5e('0x2e')]=_[_0xcd5e('0x2d')](_0x3e6482[_0xcd5e('0x2e')]);_0x225db5['filters']=_[_0xcd5e('0x31')](_0x225db5[_0xcd5e('0x2c')],_0x225db5[_0xcd5e('0x2e')]);_0x3c1f7f[_0xcd5e('0x30')]=_[_0xcd5e('0x31')](_0x225db5['model'],qs['fields'](_0x3e6482[_0xcd5e('0x2e')][_0xcd5e('0x32')]));_0x3c1f7f[_0xcd5e('0x30')]=_0x3c1f7f[_0xcd5e('0x30')][_0xcd5e('0x33')]?_0x3c1f7f[_0xcd5e('0x30')]:_0x225db5['model'];_0x3c1f7f[_0xcd5e('0x49')]=qs[_0xcd5e('0x37')](_0x3e6482[_0xcd5e('0x2e')][_0xcd5e('0x37')]);_0x3c1f7f['where']=qs[_0xcd5e('0x2f')](_[_0xcd5e('0x39')](_0x3e6482[_0xcd5e('0x2e')],_0x225db5['filters']));if(_0x3e6482[_0xcd5e('0x2e')][_0xcd5e('0x3a')]){_0x3c1f7f[_0xcd5e('0x38')]=_['merge'](_0x3c1f7f[_0xcd5e('0x38')],{'$or':_['map'](_0x3c1f7f[_0xcd5e('0x30')],function(_0x3fc81c){var _0xcbd97f={};_0xcbd97f[_0x3fc81c]={'$like':'%'+_0x3e6482[_0xcd5e('0x2e')][_0xcd5e('0x3a')]+'%'};return _0xcbd97f;})});}_0x3c1f7f=_[_0xcd5e('0x3b')]({},_0x3c1f7f,_0x3e6482[_0xcd5e('0x3d')]);return _0x3d9e7a['getSubjects'](_0x3c1f7f);}})[_0xcd5e('0x23')](function(_0x4a4212){if(_0x4a4212){_0x4d05d6=_0x4a4212[_0xcd5e('0x33')];if(!_0x3e6482[_0xcd5e('0x2e')]['hasOwnProperty'](_0xcd5e('0x35'))){_0x3c1f7f[_0xcd5e('0x36')]=qs[_0xcd5e('0x36')](_0x3e6482[_0xcd5e('0x2e')]['limit']);_0x3c1f7f[_0xcd5e('0x1d')]=qs[_0xcd5e('0x1d')](_0x3e6482[_0xcd5e('0x2e')][_0xcd5e('0x1d')]);}return _0x3d9e7a[_0xcd5e('0x4a')](_0x3c1f7f);}})[_0xcd5e('0x23')](function(_0x541e19){if(_0x541e19){return _0x541e19?{'count':_0x4d05d6,'rows':_0x541e19}:null;}})[_0xcd5e('0x23')](respondWithResult(_0xbde534,null))[_0xcd5e('0x44')](handleError(_0xbde534,null));};exports[_0xcd5e('0x4d')]=function(_0x1a941a,_0x3cc57b,_0x3702ca){var _0x3324c7={};var _0x180f65={};var _0x9825aa;var _0x232ea5;return db[_0xcd5e('0x29')][_0xcd5e('0x4b')]({'where':{'id':_0x1a941a['params']['id']}})[_0xcd5e('0x23')](handleEntityNotFound(_0x3cc57b,null))[_0xcd5e('0x23')](function(_0x51bcc7){if(_0x51bcc7){_0x9825aa=_0x51bcc7;_0x180f65[_0xcd5e('0x2c')]=_[_0xcd5e('0x2d')](db[_0xcd5e('0x4c')]['rawAttributes']);_0x180f65[_0xcd5e('0x2e')]=_[_0xcd5e('0x2d')](_0x1a941a[_0xcd5e('0x2e')]);_0x180f65[_0xcd5e('0x2f')]=_[_0xcd5e('0x31')](_0x180f65['model'],_0x180f65[_0xcd5e('0x2e')]);_0x3324c7['attributes']=_[_0xcd5e('0x31')](_0x180f65['model'],qs[_0xcd5e('0x32')](_0x1a941a['query'][_0xcd5e('0x32')]));_0x3324c7['attributes']=_0x3324c7['attributes'][_0xcd5e('0x33')]?_0x3324c7['attributes']:_0x180f65[_0xcd5e('0x2c')];_0x3324c7[_0xcd5e('0x49')]=qs[_0xcd5e('0x37')](_0x1a941a['query'][_0xcd5e('0x37')]);_0x3324c7[_0xcd5e('0x38')]=qs['filters'](_[_0xcd5e('0x39')](_0x1a941a['query'],_0x180f65[_0xcd5e('0x2f')]));if(_0x1a941a[_0xcd5e('0x2e')][_0xcd5e('0x3a')]){_0x3324c7[_0xcd5e('0x38')]=_[_0xcd5e('0x3b')](_0x3324c7[_0xcd5e('0x38')],{'$or':_['map'](_0x3324c7['attributes'],function(_0xc973fd){var _0x1c9f3e={};_0x1c9f3e[_0xc973fd]={'$like':'%'+_0x1a941a[_0xcd5e('0x2e')][_0xcd5e('0x3a')]+'%'};return _0x1c9f3e;})});}_0x3324c7=_[_0xcd5e('0x3b')]({},_0x3324c7,_0x1a941a['options']);return _0x9825aa[_0xcd5e('0x4d')](_0x3324c7);}})[_0xcd5e('0x23')](function(_0x8ae7c7){if(_0x8ae7c7){_0x232ea5=_0x8ae7c7[_0xcd5e('0x33')];if(!_0x1a941a['query']['hasOwnProperty'](_0xcd5e('0x35'))){_0x3324c7[_0xcd5e('0x36')]=qs['limit'](_0x1a941a['query'][_0xcd5e('0x36')]);_0x3324c7[_0xcd5e('0x1d')]=qs[_0xcd5e('0x1d')](_0x1a941a[_0xcd5e('0x2e')]['offset']);}return _0x9825aa[_0xcd5e('0x4d')](_0x3324c7);}})[_0xcd5e('0x23')](function(_0x5bda13){if(_0x5bda13){return _0x5bda13?{'count':_0x232ea5,'rows':_0x5bda13}:null;}})['then'](respondWithResult(_0x3cc57b,null))[_0xcd5e('0x44')](handleError(_0x3cc57b,null));}; \ No newline at end of file +var _0x791b=['fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','create','update','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','model','map','query','filters'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x791b,0xc3));var _0xb791=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x791b[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xb791('0x0'));var rimraf=require(_0xb791('0x1'));var zipdir=require(_0xb791('0x2'));var jsonpatch=require(_0xb791('0x3'));var rp=require(_0xb791('0x4'));var moment=require(_0xb791('0x5'));var BPromise=require(_0xb791('0x6'));var Mustache=require(_0xb791('0x7'));var util=require(_0xb791('0x8'));var path=require(_0xb791('0x9'));var sox=require(_0xb791('0xa'));var csv=require(_0xb791('0xb'));var ejs=require(_0xb791('0xc'));var fs=require('fs');var fs_extra=require(_0xb791('0xd'));var _=require(_0xb791('0xe'));var squel=require(_0xb791('0xf'));var crypto=require(_0xb791('0x10'));var jsforce=require(_0xb791('0x11'));var deskjs=require(_0xb791('0x12'));var toCsv=require(_0xb791('0xb'));var querystring=require(_0xb791('0x13'));var Papa=require(_0xb791('0x14'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb791('0x15'));var as=require(_0xb791('0x16'));var hardwareService=require(_0xb791('0x17'));var logger=require(_0xb791('0x18'))('api');var utils=require('../../config/utils');var config=require(_0xb791('0x19'));var licenseUtil=require(_0xb791('0x1a'));var db=require(_0xb791('0x1b'))['db'];function respondWithStatusCode(_0x2e12b3,_0x5a32da){_0x5a32da=_0x5a32da||0xcc;return function(_0x544302){if(_0x544302){return _0x2e12b3[_0xb791('0x1c')](_0x5a32da);}return _0x2e12b3['status'](_0x5a32da)[_0xb791('0x1d')]();};}function respondWithResult(_0x16f654,_0x524bd0){_0x524bd0=_0x524bd0||0xc8;return function(_0x21b8eb){if(_0x21b8eb){return _0x16f654[_0xb791('0x1e')](_0x524bd0)[_0xb791('0x1f')](_0x21b8eb);}};}function respondWithFilteredResult(_0x5b4a2b,_0x273196){return function(_0x2c88b6){if(_0x2c88b6){var _0x345abc=typeof _0x273196[_0xb791('0x20')]===_0xb791('0x21')&&typeof _0x273196[_0xb791('0x22')]===_0xb791('0x21');var _0x265f11=_0x2c88b6[_0xb791('0x23')];var _0x133fca=_0x345abc?0x0:_0x273196['offset'];var _0x4ff576=_0x345abc?_0x2c88b6['count']:_0x273196[_0xb791('0x20')]+_0x273196[_0xb791('0x22')];var _0x57251e;if(_0x4ff576>=_0x265f11){_0x4ff576=_0x265f11;_0x57251e=0xc8;}else{_0x57251e=0xce;}_0x5b4a2b['status'](_0x57251e);return _0x5b4a2b[_0xb791('0x24')]('Content-Range',_0x133fca+'-'+_0x4ff576+'/'+_0x265f11)[_0xb791('0x1f')](_0x2c88b6);}return null;};}function patchUpdates(_0x54243b){return function(_0xcbd52){try{jsonpatch['apply'](_0xcbd52,_0x54243b,!![]);}catch(_0x9daa00){return BPromise[_0xb791('0x25')](_0x9daa00);}return _0xcbd52[_0xb791('0x26')]();};}function saveUpdates(_0x3b98c1,_0x5a667b){return function(_0x37ff32){if(_0x37ff32){return _0x37ff32['update'](_0x3b98c1)[_0xb791('0x27')](function(_0x40317f){return _0x40317f;});}return null;};}function removeEntity(_0x57ba30,_0x2f49aa){return function(_0x466251){if(_0x466251){return _0x466251[_0xb791('0x28')]()[_0xb791('0x27')](function(){_0x57ba30[_0xb791('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21d9b9,_0x14c2c1){return function(_0x388a55){if(!_0x388a55){_0x21d9b9[_0xb791('0x1c')](0x194);}return _0x388a55;};}function handleError(_0x40970c,_0x41fb7b){_0x41fb7b=_0x41fb7b||0x1f4;return function(_0x16d987){logger[_0xb791('0x29')](_0x16d987[_0xb791('0x2a')]);if(_0x16d987[_0xb791('0x2b')]){delete _0x16d987[_0xb791('0x2b')];}_0x40970c[_0xb791('0x1e')](_0x41fb7b)[_0xb791('0x2c')](_0x16d987);};}exports[_0xb791('0x2d')]=function(_0x33c6be,_0x5cfb5b){var _0x1d15cc={},_0x37d252={},_0x712d8f={'count':0x0,'rows':[]};var _0x45b732=_['map'](db[_0xb791('0x2e')][_0xb791('0x2f')],function(_0xc38285){return{'name':_0xc38285[_0xb791('0x30')],'type':_0xc38285[_0xb791('0x31')]['key']};});_0x37d252[_0xb791('0x32')]=_[_0xb791('0x33')](_0x45b732,_0xb791('0x2b'));_0x37d252[_0xb791('0x34')]=_['keys'](_0x33c6be['query']);_0x37d252[_0xb791('0x35')]=_['intersection'](_0x37d252['model'],_0x37d252[_0xb791('0x34')]);_0x1d15cc['attributes']=_['intersection'](_0x37d252['model'],qs[_0xb791('0x36')](_0x33c6be[_0xb791('0x34')][_0xb791('0x36')]));_0x1d15cc['attributes']=_0x1d15cc[_0xb791('0x37')][_0xb791('0x38')]?_0x1d15cc[_0xb791('0x37')]:_0x37d252[_0xb791('0x32')];if(!_0x33c6be[_0xb791('0x34')]['hasOwnProperty'](_0xb791('0x39'))){_0x1d15cc[_0xb791('0x22')]=qs[_0xb791('0x22')](_0x33c6be['query'][_0xb791('0x22')]);_0x1d15cc[_0xb791('0x20')]=qs['offset'](_0x33c6be[_0xb791('0x34')][_0xb791('0x20')]);}_0x1d15cc[_0xb791('0x3a')]=qs[_0xb791('0x3b')](_0x33c6be[_0xb791('0x34')][_0xb791('0x3b')]);_0x1d15cc[_0xb791('0x3c')]=qs['filters'](_[_0xb791('0x3d')](_0x33c6be[_0xb791('0x34')],_0x37d252[_0xb791('0x35')]),_0x45b732);if(_0x33c6be[_0xb791('0x34')][_0xb791('0x3e')]){_0x1d15cc[_0xb791('0x3c')]=_['merge'](_0x1d15cc[_0xb791('0x3c')],{'$or':_[_0xb791('0x33')](_0x45b732,function(_0x5485f1){if(_0x5485f1['type']!==_0xb791('0x3f')){var _0x5c5e35={};_0x5c5e35[_0x5485f1[_0xb791('0x2b')]]={'$like':'%'+_0x33c6be[_0xb791('0x34')][_0xb791('0x3e')]+'%'};return _0x5c5e35;}})});}_0x1d15cc=_[_0xb791('0x40')]({},_0x1d15cc,_0x33c6be[_0xb791('0x41')]);var _0x4c366c={'where':_0x1d15cc[_0xb791('0x3c')]};return db[_0xb791('0x2e')][_0xb791('0x23')](_0x4c366c)[_0xb791('0x27')](function(_0x4ab4bc){_0x712d8f[_0xb791('0x23')]=_0x4ab4bc;if(_0x33c6be[_0xb791('0x34')][_0xb791('0x42')]){_0x1d15cc[_0xb791('0x43')]=[{'all':!![]}];}return db[_0xb791('0x2e')][_0xb791('0x44')](_0x1d15cc);})[_0xb791('0x27')](function(_0xda3946){_0x712d8f[_0xb791('0x45')]=_0xda3946;return _0x712d8f;})[_0xb791('0x27')](respondWithFilteredResult(_0x5cfb5b,_0x1d15cc))[_0xb791('0x46')](handleError(_0x5cfb5b,null));};exports[_0xb791('0x47')]=function(_0x297957,_0x45080e){var _0x42d601={'raw':![],'where':{'id':_0x297957[_0xb791('0x48')]['id']}},_0x1b6209={};_0x1b6209['model']=_[_0xb791('0x49')](db[_0xb791('0x2e')]['rawAttributes']);_0x1b6209[_0xb791('0x34')]=_[_0xb791('0x49')](_0x297957[_0xb791('0x34')]);_0x1b6209['filters']=_['intersection'](_0x1b6209[_0xb791('0x32')],_0x1b6209['query']);_0x42d601[_0xb791('0x37')]=_[_0xb791('0x4a')](_0x1b6209[_0xb791('0x32')],qs[_0xb791('0x36')](_0x297957[_0xb791('0x34')][_0xb791('0x36')]));_0x42d601[_0xb791('0x37')]=_0x42d601[_0xb791('0x37')][_0xb791('0x38')]?_0x42d601[_0xb791('0x37')]:_0x1b6209[_0xb791('0x32')];if(_0x297957[_0xb791('0x34')][_0xb791('0x42')]){_0x42d601[_0xb791('0x43')]=[{'all':!![]}];}_0x42d601=_[_0xb791('0x40')]({},_0x42d601,_0x297957[_0xb791('0x41')]);return db['SalesforceConfiguration']['find'](_0x42d601)[_0xb791('0x27')](handleEntityNotFound(_0x45080e,null))[_0xb791('0x27')](respondWithResult(_0x45080e,null))[_0xb791('0x46')](handleError(_0x45080e,null));};exports[_0xb791('0x4b')]=function(_0xab4ea8,_0xfd1edf){return db[_0xb791('0x2e')][_0xb791('0x4b')](_0xab4ea8['body'],{})[_0xb791('0x27')](respondWithResult(_0xfd1edf,0xc9))[_0xb791('0x46')](handleError(_0xfd1edf,null));};exports[_0xb791('0x4c')]=function(_0x245914,_0x2cdf6f){if(_0x245914[_0xb791('0x4d')]['id']){delete _0x245914['body']['id'];}return db[_0xb791('0x2e')]['find']({'where':{'id':_0x245914[_0xb791('0x48')]['id']}})[_0xb791('0x27')](handleEntityNotFound(_0x2cdf6f,null))['then'](saveUpdates(_0x245914[_0xb791('0x4d')],null))[_0xb791('0x27')](respondWithResult(_0x2cdf6f,null))[_0xb791('0x46')](handleError(_0x2cdf6f,null));};exports[_0xb791('0x28')]=function(_0x59b7d7,_0x55ca4b){return db[_0xb791('0x2e')]['find']({'where':{'id':_0x59b7d7['params']['id']}})[_0xb791('0x27')](handleEntityNotFound(_0x55ca4b,null))['then'](removeEntity(_0x55ca4b,null))[_0xb791('0x46')](handleError(_0x55ca4b,null));};exports[_0xb791('0x4e')]=function(_0x5830a6,_0x42fb89,_0x1ff207){var _0x40bc3f={};var _0x4983f8={};var _0x1b4dfc;var _0x152f56;return db['SalesforceConfiguration'][_0xb791('0x4f')]({'where':{'id':_0x5830a6[_0xb791('0x48')]['id']}})[_0xb791('0x27')](handleEntityNotFound(_0x42fb89,null))['then'](function(_0x443aa6){if(_0x443aa6){_0x1b4dfc=_0x443aa6;_0x4983f8['model']=_[_0xb791('0x49')](db[_0xb791('0x50')][_0xb791('0x2f')]);_0x4983f8[_0xb791('0x34')]=_['keys'](_0x5830a6[_0xb791('0x34')]);_0x4983f8['filters']=_[_0xb791('0x4a')](_0x4983f8['model'],_0x4983f8[_0xb791('0x34')]);_0x40bc3f[_0xb791('0x37')]=_['intersection'](_0x4983f8['model'],qs['fields'](_0x5830a6['query'][_0xb791('0x36')]));_0x40bc3f[_0xb791('0x37')]=_0x40bc3f[_0xb791('0x37')][_0xb791('0x38')]?_0x40bc3f[_0xb791('0x37')]:_0x4983f8['model'];_0x40bc3f[_0xb791('0x3a')]=qs['sort'](_0x5830a6[_0xb791('0x34')][_0xb791('0x3b')]);_0x40bc3f['where']=qs[_0xb791('0x35')](_['pick'](_0x5830a6[_0xb791('0x34')],_0x4983f8[_0xb791('0x35')]));if(_0x5830a6[_0xb791('0x34')][_0xb791('0x3e')]){_0x40bc3f[_0xb791('0x3c')]=_[_0xb791('0x40')](_0x40bc3f['where'],{'$or':_[_0xb791('0x33')](_0x40bc3f[_0xb791('0x37')],function(_0x516d5c){var _0x2748e7={};_0x2748e7[_0x516d5c]={'$like':'%'+_0x5830a6['query']['filter']+'%'};return _0x2748e7;})});}_0x40bc3f=_[_0xb791('0x40')]({},_0x40bc3f,_0x5830a6[_0xb791('0x41')]);return _0x1b4dfc[_0xb791('0x4e')](_0x40bc3f);}})[_0xb791('0x27')](function(_0x43c562){if(_0x43c562){_0x152f56=_0x43c562['length'];if(!_0x5830a6[_0xb791('0x34')]['hasOwnProperty'](_0xb791('0x39'))){_0x40bc3f[_0xb791('0x22')]=qs[_0xb791('0x22')](_0x5830a6[_0xb791('0x34')]['limit']);_0x40bc3f[_0xb791('0x20')]=qs[_0xb791('0x20')](_0x5830a6[_0xb791('0x34')]['offset']);}return _0x1b4dfc['getFields'](_0x40bc3f);}})[_0xb791('0x27')](function(_0xcfeee7){if(_0xcfeee7){return _0xcfeee7?{'count':_0x152f56,'rows':_0xcfeee7}:null;}})['then'](respondWithResult(_0x42fb89,null))['catch'](handleError(_0x42fb89,null));};exports[_0xb791('0x51')]=function(_0x4e89ab,_0x4d06f8,_0x9611e9){var _0x27ba71={};var _0x55b717={};var _0xb75afd;var _0x19f4ae;return db[_0xb791('0x2e')][_0xb791('0x4f')]({'where':{'id':_0x4e89ab[_0xb791('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d06f8,null))[_0xb791('0x27')](function(_0xb9acc7){if(_0xb9acc7){_0xb75afd=_0xb9acc7;_0x55b717['model']=_['keys'](db[_0xb791('0x50')][_0xb791('0x2f')]);_0x55b717['query']=_['keys'](_0x4e89ab[_0xb791('0x34')]);_0x55b717[_0xb791('0x35')]=_[_0xb791('0x4a')](_0x55b717[_0xb791('0x32')],_0x55b717[_0xb791('0x34')]);_0x27ba71[_0xb791('0x37')]=_[_0xb791('0x4a')](_0x55b717[_0xb791('0x32')],qs[_0xb791('0x36')](_0x4e89ab['query'][_0xb791('0x36')]));_0x27ba71[_0xb791('0x37')]=_0x27ba71[_0xb791('0x37')][_0xb791('0x38')]?_0x27ba71[_0xb791('0x37')]:_0x55b717[_0xb791('0x32')];_0x27ba71[_0xb791('0x3a')]=qs[_0xb791('0x3b')](_0x4e89ab[_0xb791('0x34')]['sort']);_0x27ba71[_0xb791('0x3c')]=qs[_0xb791('0x35')](_[_0xb791('0x3d')](_0x4e89ab['query'],_0x55b717[_0xb791('0x35')]));if(_0x4e89ab[_0xb791('0x34')][_0xb791('0x3e')]){_0x27ba71[_0xb791('0x3c')]=_['merge'](_0x27ba71[_0xb791('0x3c')],{'$or':_[_0xb791('0x33')](_0x27ba71[_0xb791('0x37')],function(_0x2f14e7){var _0xb8740b={};_0xb8740b[_0x2f14e7]={'$like':'%'+_0x4e89ab[_0xb791('0x34')][_0xb791('0x3e')]+'%'};return _0xb8740b;})});}_0x27ba71=_[_0xb791('0x40')]({},_0x27ba71,_0x4e89ab[_0xb791('0x41')]);return _0xb75afd['getSubjects'](_0x27ba71);}})['then'](function(_0x21566c){if(_0x21566c){_0x19f4ae=_0x21566c[_0xb791('0x38')];if(!_0x4e89ab[_0xb791('0x34')]['hasOwnProperty'](_0xb791('0x39'))){_0x27ba71[_0xb791('0x22')]=qs[_0xb791('0x22')](_0x4e89ab[_0xb791('0x34')][_0xb791('0x22')]);_0x27ba71[_0xb791('0x20')]=qs[_0xb791('0x20')](_0x4e89ab['query']['offset']);}return _0xb75afd[_0xb791('0x51')](_0x27ba71);}})[_0xb791('0x27')](function(_0x5ac147){if(_0x5ac147){return _0x5ac147?{'count':_0x19f4ae,'rows':_0x5ac147}:null;}})[_0xb791('0x27')](respondWithResult(_0x4d06f8,null))[_0xb791('0x46')](handleError(_0x4d06f8,null));};exports['getDescriptions']=function(_0x37335d,_0x3419f6,_0x24908c){var _0x2f1832={};var _0x4d59e6={};var _0x17aac5;var _0x250b99;return db[_0xb791('0x2e')]['findOne']({'where':{'id':_0x37335d[_0xb791('0x48')]['id']}})[_0xb791('0x27')](handleEntityNotFound(_0x3419f6,null))[_0xb791('0x27')](function(_0x10c639){if(_0x10c639){_0x17aac5=_0x10c639;_0x4d59e6['model']=_['keys'](db[_0xb791('0x50')][_0xb791('0x2f')]);_0x4d59e6[_0xb791('0x34')]=_['keys'](_0x37335d[_0xb791('0x34')]);_0x4d59e6[_0xb791('0x35')]=_[_0xb791('0x4a')](_0x4d59e6['model'],_0x4d59e6[_0xb791('0x34')]);_0x2f1832['attributes']=_[_0xb791('0x4a')](_0x4d59e6[_0xb791('0x32')],qs[_0xb791('0x36')](_0x37335d['query'][_0xb791('0x36')]));_0x2f1832[_0xb791('0x37')]=_0x2f1832['attributes']['length']?_0x2f1832[_0xb791('0x37')]:_0x4d59e6['model'];_0x2f1832[_0xb791('0x3a')]=qs['sort'](_0x37335d['query'][_0xb791('0x3b')]);_0x2f1832[_0xb791('0x3c')]=qs['filters'](_[_0xb791('0x3d')](_0x37335d[_0xb791('0x34')],_0x4d59e6[_0xb791('0x35')]));if(_0x37335d['query'][_0xb791('0x3e')]){_0x2f1832[_0xb791('0x3c')]=_[_0xb791('0x40')](_0x2f1832[_0xb791('0x3c')],{'$or':_[_0xb791('0x33')](_0x2f1832[_0xb791('0x37')],function(_0x6f68b0){var _0x2803e2={};_0x2803e2[_0x6f68b0]={'$like':'%'+_0x37335d[_0xb791('0x34')]['filter']+'%'};return _0x2803e2;})});}_0x2f1832=_[_0xb791('0x40')]({},_0x2f1832,_0x37335d['options']);return _0x17aac5[_0xb791('0x52')](_0x2f1832);}})[_0xb791('0x27')](function(_0x267551){if(_0x267551){_0x250b99=_0x267551[_0xb791('0x38')];if(!_0x37335d[_0xb791('0x34')]['hasOwnProperty'](_0xb791('0x39'))){_0x2f1832[_0xb791('0x22')]=qs['limit'](_0x37335d[_0xb791('0x34')]['limit']);_0x2f1832[_0xb791('0x20')]=qs['offset'](_0x37335d['query'][_0xb791('0x20')]);}return _0x17aac5[_0xb791('0x52')](_0x2f1832);}})[_0xb791('0x27')](function(_0x3efff0){if(_0x3efff0){return _0x3efff0?{'count':_0x250b99,'rows':_0x3efff0}:null;}})[_0xb791('0x27')](respondWithResult(_0x3419f6,null))[_0xb791('0x46')](handleError(_0x3419f6,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 644fa13..547c88a 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 _0x9cd7=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9cd7,0x1b9));var _0x79cd=function(_0x4f2039,_0x528e8e){_0x4f2039=_0x4f2039-0x0;var _0x9643db=_0x9cd7[_0x4f2039];return _0x9643db;};'use strict';var _=require(_0x79cd('0x0'));var util=require(_0x79cd('0x1'));var logger=require(_0x79cd('0x2'))(_0x79cd('0x3'));var moment=require(_0x79cd('0x4'));var BPromise=require(_0x79cd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x79cd('0x6'));var rimraf=require(_0x79cd('0x7'));var config=require(_0x79cd('0x8'));var attributes=require(_0x79cd('0x9'));module['exports']=function(_0xbf9065,_0x21bf75){return _0xbf9065[_0x79cd('0xa')](_0x79cd('0xb'),attributes,{'tableName':_0x79cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86e4=['rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x86e4,0x12d));var _0x486e=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x86e4[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0x486e('0x0'));var util=require(_0x486e('0x1'));var logger=require(_0x486e('0x2'))(_0x486e('0x3'));var moment=require(_0x486e('0x4'));var BPromise=require('bluebird');var rp=require(_0x486e('0x5'));var fs=require('fs');var path=require(_0x486e('0x6'));var rimraf=require(_0x486e('0x7'));var config=require(_0x486e('0x8'));var attributes=require(_0x486e('0x9'));module[_0x486e('0xa')]=function(_0x4e295c,_0x353c62){return _0x4e295c[_0x486e('0xb')](_0x486e('0xc'),attributes,{'tableName':_0x486e('0xd'),'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 5c21799..052c535 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 _0x5f84=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring'];(function(_0x13bf54,_0xadc752){var _0x268d8b=function(_0xbd7826){while(--_0xbd7826){_0x13bf54['push'](_0x13bf54['shift']());}};_0x268d8b(++_0xadc752);}(_0x5f84,0x165));var _0x45f8=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x5f84[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x45f8('0x0'));var BPromise=require(_0x45f8('0x1'));var rs=require(_0x45f8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x45f8('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x45f8('0x4'));var jayson=require(_0x45f8('0x5'));var client=jayson[_0x45f8('0x6')][_0x45f8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e2a97,_0xd16cb9,_0x15c5d4){return new BPromise(function(_0x200f2a,_0x2d0a76){return client[_0x45f8('0x8')](_0x5e2a97,_0x15c5d4)[_0x45f8('0x9')](function(_0x3be86a){logger[_0x45f8('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0xd16cb9,_0x45f8('0xb'));logger[_0x45f8('0xc')](_0x45f8('0xd'),_0xd16cb9,_0x45f8('0xb'),JSON[_0x45f8('0xe')](_0x3be86a));if(_0x3be86a[_0x45f8('0xf')]){if(_0x3be86a[_0x45f8('0xf')][_0x45f8('0x10')]===0x1f4){logger[_0x45f8('0xf')](_0x45f8('0x11'),_0xd16cb9,_0x3be86a['error'][_0x45f8('0x12')]);return _0x2d0a76(_0x3be86a['error'][_0x45f8('0x12')]);}logger[_0x45f8('0xf')](_0x45f8('0x11'),_0xd16cb9,_0x3be86a[_0x45f8('0xf')][_0x45f8('0x12')]);return _0x200f2a(_0x3be86a[_0x45f8('0xf')][_0x45f8('0x12')]);}else{logger[_0x45f8('0xa')](_0x45f8('0x11'),_0xd16cb9,_0x45f8('0xb'));_0x200f2a(_0x3be86a['result']['message']);}})[_0x45f8('0x13')](function(_0x525043){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0xd16cb9,_0x525043);_0x2d0a76(_0x525043);});});} \ No newline at end of file +var _0xa195=['debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x52e2de,_0x4ea3b7){var _0x92f597=function(_0x348d57){while(--_0x348d57){_0x52e2de['push'](_0x52e2de['shift']());}};_0x92f597(++_0x4ea3b7);}(_0xa195,0x118));var _0x5a19=function(_0x4445d3,_0x26026d){_0x4445d3=_0x4445d3-0x0;var _0x2ce0d0=_0xa195[_0x4445d3];return _0x2ce0d0;};'use strict';var _=require(_0x5a19('0x0'));var util=require(_0x5a19('0x1'));var moment=require('moment');var BPromise=require(_0x5a19('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a19('0x3'))['db'];var utils=require(_0x5a19('0x4'));var logger=require(_0x5a19('0x5'))(_0x5a19('0x6'));var config=require(_0x5a19('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5a19('0x8')][_0x5a19('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54bec2,_0x2a4013,_0x18145e){return new BPromise(function(_0x30e84c,_0x588166){return client[_0x5a19('0xa')](_0x54bec2,_0x18145e)[_0x5a19('0xb')](function(_0x43870f){logger[_0x5a19('0xc')](_0x5a19('0xd'),_0x2a4013,'request\x20sent');logger[_0x5a19('0xe')](_0x5a19('0xf'),_0x2a4013,_0x5a19('0x10'),JSON[_0x5a19('0x11')](_0x43870f));if(_0x43870f['error']){if(_0x43870f[_0x5a19('0x12')]['code']===0x1f4){logger[_0x5a19('0x12')](_0x5a19('0xd'),_0x2a4013,_0x43870f['error'][_0x5a19('0x13')]);return _0x588166(_0x43870f[_0x5a19('0x12')][_0x5a19('0x13')]);}logger[_0x5a19('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2a4013,_0x43870f[_0x5a19('0x12')][_0x5a19('0x13')]);return _0x30e84c(_0x43870f[_0x5a19('0x12')][_0x5a19('0x13')]);}else{logger[_0x5a19('0xc')](_0x5a19('0xd'),_0x2a4013,_0x5a19('0x10'));_0x30e84c(_0x43870f[_0x5a19('0x14')][_0x5a19('0x13')]);}})['catch'](function(_0x2c8e08){logger[_0x5a19('0x12')](_0x5a19('0xd'),_0x2a4013,_0x2c8e08);_0x588166(_0x2c8e08);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 684c65a..e5ae06a 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 _0xa58d=['connect-timeout','express','Router','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','create','put','destroy','multer','util','path'];(function(_0x33b520,_0x51bc9b){var _0x5598f3=function(_0x18ecc7){while(--_0x18ecc7){_0x33b520['push'](_0x33b520['shift']());}};_0x5598f3(++_0x51bc9b);}(_0xa58d,0xcd));var _0xda58=function(_0x31a718,_0x1a6668){_0x31a718=_0x31a718-0x0;var _0x357082=_0xa58d[_0x31a718];return _0x357082;};'use strict';var multer=require(_0xda58('0x0'));var util=require(_0xda58('0x1'));var path=require(_0xda58('0x2'));var timeout=require(_0xda58('0x3'));var express=require(_0xda58('0x4'));var router=express[_0xda58('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xda58('0x6'));var controller=require(_0xda58('0x7'));router[_0xda58('0x8')]('/',auth[_0xda58('0x9')](),controller['index']);router[_0xda58('0x8')](_0xda58('0xa'),auth['isAuthenticated'](),controller[_0xda58('0xb')]);router[_0xda58('0xc')]('/',auth[_0xda58('0x9')](),controller[_0xda58('0xd')]);router[_0xda58('0xe')](_0xda58('0xa'),auth[_0xda58('0x9')](),controller['update']);router['delete']('/:id',auth[_0xda58('0x9')](),controller[_0xda58('0xf')]);module['exports']=router; \ No newline at end of file +var _0xc93c=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intSalesforceField.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete'];(function(_0x42c8e0,_0x1c74f0){var _0x4b2aa6=function(_0x434445){while(--_0x434445){_0x42c8e0['push'](_0x42c8e0['shift']());}};_0x4b2aa6(++_0x1c74f0);}(_0xc93c,0x1a3));var _0xcc93=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc93c[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0xcc93('0x0'));var util=require(_0xcc93('0x1'));var path=require(_0xcc93('0x2'));var timeout=require(_0xcc93('0x3'));var express=require(_0xcc93('0x4'));var router=express[_0xcc93('0x5')]();var fs_extra=require(_0xcc93('0x6'));var auth=require(_0xcc93('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcc93('0x8'));router[_0xcc93('0x9')]('/',auth['isAuthenticated'](),controller[_0xcc93('0xa')]);router[_0xcc93('0x9')](_0xcc93('0xb'),auth[_0xcc93('0xc')](),controller[_0xcc93('0xd')]);router[_0xcc93('0xe')]('/',auth[_0xcc93('0xc')](),controller[_0xcc93('0xf')]);router[_0xcc93('0x10')](_0xcc93('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xcc93('0x11')]('/:id',auth[_0xcc93('0xc')](),controller['destroy']);module[_0xcc93('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 790cdbb..5597b80 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 _0x9c8c=['STRING','sequelize','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0xc4dbc9,_0x1aa6b6){var _0x531773=function(_0x5941d1){while(--_0x5941d1){_0xc4dbc9['push'](_0xc4dbc9['shift']());}};_0x531773(++_0x1aa6b6);}(_0x9c8c,0x1a1));var _0xc9c8=function(_0x29ec6f,_0x3d5304){_0x29ec6f=_0x29ec6f-0x0;var _0x44438c=_0x9c8c[_0x29ec6f];return _0x44438c;};'use strict';var Sequelize=require(_0xc9c8('0x0'));module[_0xc9c8('0x1')]={'type':{'type':Sequelize[_0xc9c8('0x2')](_0xc9c8('0x3'),'variable',_0xc9c8('0x4'),_0xc9c8('0x5'),_0xc9c8('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc9c8('0x7')]},'key':{'type':Sequelize[_0xc9c8('0x7')]},'keyType':{'type':Sequelize[_0xc9c8('0x2')](_0xc9c8('0x3'),'variable',_0xc9c8('0x4'))},'keyContent':{'type':Sequelize[_0xc9c8('0x7')]},'idField':{'type':Sequelize[_0xc9c8('0x7')]},'variableName':{'type':Sequelize[_0xc9c8('0x7')]}}; \ No newline at end of file +var _0x57ec=['string','variable','customVariable','picklist','STRING','exports','ENUM'];(function(_0xb64d0c,_0x4eed6b){var _0x39cf07=function(_0x1162a5){while(--_0x1162a5){_0xb64d0c['push'](_0xb64d0c['shift']());}};_0x39cf07(++_0x4eed6b);}(_0x57ec,0x124));var _0xc57e=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x57ec[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require('sequelize');module[_0xc57e('0x0')]={'type':{'type':Sequelize[_0xc57e('0x1')](_0xc57e('0x2'),_0xc57e('0x3'),_0xc57e('0x4'),'keyValue',_0xc57e('0x5')),'defaultValue':_0xc57e('0x2')},'content':{'type':Sequelize[_0xc57e('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc57e('0x1')](_0xc57e('0x2'),_0xc57e('0x3'),_0xc57e('0x4'))},'keyContent':{'type':Sequelize[_0xc57e('0x6')]},'idField':{'type':Sequelize[_0xc57e('0x6')]},'variableName':{'type':Sequelize[_0xc57e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index c2a1235..ecce237 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 _0x2ae9=['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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','SalesforceField','rows','catch','show','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0xb2628b,_0x2ddea2){var _0x2a353a=function(_0x2fba28){while(--_0x2fba28){_0xb2628b['push'](_0xb2628b['shift']());}};_0x2a353a(++_0x2ddea2);}(_0x2ae9,0x90));var _0x92ae=function(_0x421791,_0x3625d8){_0x421791=_0x421791-0x0;var _0x495838=_0x2ae9[_0x421791];return _0x495838;};'use strict';var emlformat=require(_0x92ae('0x0'));var rimraf=require(_0x92ae('0x1'));var zipdir=require(_0x92ae('0x2'));var jsonpatch=require(_0x92ae('0x3'));var rp=require('request-promise');var moment=require(_0x92ae('0x4'));var BPromise=require(_0x92ae('0x5'));var Mustache=require('mustache');var util=require(_0x92ae('0x6'));var path=require(_0x92ae('0x7'));var sox=require(_0x92ae('0x8'));var csv=require(_0x92ae('0x9'));var ejs=require(_0x92ae('0xa'));var fs=require('fs');var fs_extra=require(_0x92ae('0xb'));var _=require('lodash');var squel=require(_0x92ae('0xc'));var crypto=require(_0x92ae('0xd'));var jsforce=require(_0x92ae('0xe'));var deskjs=require(_0x92ae('0xf'));var toCsv=require(_0x92ae('0x9'));var querystring=require(_0x92ae('0x10'));var Papa=require(_0x92ae('0x11'));var Redis=require(_0x92ae('0x12'));var authService=require(_0x92ae('0x13'));var qs=require(_0x92ae('0x14'));var as=require(_0x92ae('0x15'));var hardwareService=require(_0x92ae('0x16'));var logger=require(_0x92ae('0x17'))(_0x92ae('0x18'));var utils=require(_0x92ae('0x19'));var config=require(_0x92ae('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x92ae('0x1b'))['db'];function respondWithStatusCode(_0x50787e,_0x279555){_0x279555=_0x279555||0xcc;return function(_0x2a2190){if(_0x2a2190){return _0x50787e[_0x92ae('0x1c')](_0x279555);}return _0x50787e[_0x92ae('0x1d')](_0x279555)[_0x92ae('0x1e')]();};}function respondWithResult(_0x3ab08d,_0x2325c4){_0x2325c4=_0x2325c4||0xc8;return function(_0xf222c8){if(_0xf222c8){return _0x3ab08d[_0x92ae('0x1d')](_0x2325c4)[_0x92ae('0x1f')](_0xf222c8);}};}function respondWithFilteredResult(_0x8ca101,_0x2d98d2){return function(_0x233fcf){if(_0x233fcf){var _0x51c0fa=typeof _0x2d98d2[_0x92ae('0x20')]===_0x92ae('0x21')&&typeof _0x2d98d2[_0x92ae('0x22')]===_0x92ae('0x21');var _0x2f2f1c=_0x233fcf[_0x92ae('0x23')];var _0x394e6d=_0x51c0fa?0x0:_0x2d98d2[_0x92ae('0x20')];var _0x1a935f=_0x51c0fa?_0x233fcf['count']:_0x2d98d2[_0x92ae('0x20')]+_0x2d98d2['limit'];var _0x5a7816;if(_0x1a935f>=_0x2f2f1c){_0x1a935f=_0x2f2f1c;_0x5a7816=0xc8;}else{_0x5a7816=0xce;}_0x8ca101[_0x92ae('0x1d')](_0x5a7816);return _0x8ca101[_0x92ae('0x24')](_0x92ae('0x25'),_0x394e6d+'-'+_0x1a935f+'/'+_0x2f2f1c)[_0x92ae('0x1f')](_0x233fcf);}return null;};}function patchUpdates(_0x1a4320){return function(_0x36c734){try{jsonpatch[_0x92ae('0x26')](_0x36c734,_0x1a4320,!![]);}catch(_0x3f95a6){return BPromise[_0x92ae('0x27')](_0x3f95a6);}return _0x36c734['save']();};}function saveUpdates(_0x5c895f,_0x182d50){return function(_0x588f4f){if(_0x588f4f){return _0x588f4f[_0x92ae('0x28')](_0x5c895f)[_0x92ae('0x29')](function(_0x8a193){return _0x8a193;});}return null;};}function removeEntity(_0x10b214,_0x18cb41){return function(_0x383131){if(_0x383131){return _0x383131['destroy']()[_0x92ae('0x29')](function(){_0x10b214[_0x92ae('0x1d')](0xcc)[_0x92ae('0x1e')]();});}};}function handleEntityNotFound(_0x41b8b9,_0x4825){return function(_0x57ea4e){if(!_0x57ea4e){_0x41b8b9[_0x92ae('0x1c')](0x194);}return _0x57ea4e;};}function handleError(_0x339e00,_0x47e74b){_0x47e74b=_0x47e74b||0x1f4;return function(_0x3f15c2){logger['error'](_0x3f15c2[_0x92ae('0x2a')]);if(_0x3f15c2[_0x92ae('0x2b')]){delete _0x3f15c2[_0x92ae('0x2b')];}_0x339e00['status'](_0x47e74b)[_0x92ae('0x2c')](_0x3f15c2);};}exports['index']=function(_0x40e5f3,_0x264c6b){var _0x42bc46={},_0x37b047={},_0x4cc856={'count':0x0,'rows':[]};var _0x3fd781=_[_0x92ae('0x2d')](db['SalesforceField'][_0x92ae('0x2e')],function(_0x3280ad){return{'name':_0x3280ad[_0x92ae('0x2f')],'type':_0x3280ad[_0x92ae('0x30')][_0x92ae('0x31')]};});_0x37b047[_0x92ae('0x32')]=_[_0x92ae('0x2d')](_0x3fd781,_0x92ae('0x2b'));_0x37b047[_0x92ae('0x33')]=_['keys'](_0x40e5f3[_0x92ae('0x33')]);_0x37b047[_0x92ae('0x34')]=_[_0x92ae('0x35')](_0x37b047[_0x92ae('0x32')],_0x37b047[_0x92ae('0x33')]);_0x42bc46[_0x92ae('0x36')]=_['intersection'](_0x37b047[_0x92ae('0x32')],qs[_0x92ae('0x37')](_0x40e5f3[_0x92ae('0x33')][_0x92ae('0x37')]));_0x42bc46['attributes']=_0x42bc46[_0x92ae('0x36')][_0x92ae('0x38')]?_0x42bc46['attributes']:_0x37b047['model'];if(!_0x40e5f3[_0x92ae('0x33')]['hasOwnProperty']('nolimit')){_0x42bc46['limit']=qs[_0x92ae('0x22')](_0x40e5f3['query'][_0x92ae('0x22')]);_0x42bc46[_0x92ae('0x20')]=qs[_0x92ae('0x20')](_0x40e5f3['query']['offset']);}_0x42bc46[_0x92ae('0x39')]=qs[_0x92ae('0x3a')](_0x40e5f3[_0x92ae('0x33')][_0x92ae('0x3a')]);_0x42bc46[_0x92ae('0x3b')]=qs[_0x92ae('0x34')](_['pick'](_0x40e5f3['query'],_0x37b047[_0x92ae('0x34')]),_0x3fd781);if(_0x40e5f3['query']['filter']){_0x42bc46[_0x92ae('0x3b')]=_[_0x92ae('0x3c')](_0x42bc46[_0x92ae('0x3b')],{'$or':_[_0x92ae('0x2d')](_0x3fd781,function(_0xe7991a){if(_0xe7991a[_0x92ae('0x30')]!==_0x92ae('0x3d')){var _0x5a219b={};_0x5a219b[_0xe7991a[_0x92ae('0x2b')]]={'$like':'%'+_0x40e5f3[_0x92ae('0x33')][_0x92ae('0x3e')]+'%'};return _0x5a219b;}})});}_0x42bc46=_['merge']({},_0x42bc46,_0x40e5f3[_0x92ae('0x3f')]);var _0x37a0f9={'where':_0x42bc46[_0x92ae('0x3b')]};return db['SalesforceField'][_0x92ae('0x23')](_0x37a0f9)[_0x92ae('0x29')](function(_0x40c7e9){_0x4cc856['count']=_0x40c7e9;if(_0x40e5f3[_0x92ae('0x33')][_0x92ae('0x40')]){_0x42bc46[_0x92ae('0x41')]=[{'all':!![]}];}return db[_0x92ae('0x42')]['findAll'](_0x42bc46);})['then'](function(_0x4bb926){_0x4cc856[_0x92ae('0x43')]=_0x4bb926;return _0x4cc856;})[_0x92ae('0x29')](respondWithFilteredResult(_0x264c6b,_0x42bc46))[_0x92ae('0x44')](handleError(_0x264c6b,null));};exports[_0x92ae('0x45')]=function(_0x310c8b,_0x3f1843){var _0x216911={'raw':!![],'where':{'id':_0x310c8b['params']['id']}},_0x3093a6={};_0x3093a6[_0x92ae('0x32')]=_[_0x92ae('0x46')](db['SalesforceField'][_0x92ae('0x2e')]);_0x3093a6[_0x92ae('0x33')]=_[_0x92ae('0x46')](_0x310c8b[_0x92ae('0x33')]);_0x3093a6[_0x92ae('0x34')]=_[_0x92ae('0x35')](_0x3093a6[_0x92ae('0x32')],_0x3093a6[_0x92ae('0x33')]);_0x216911['attributes']=_[_0x92ae('0x35')](_0x3093a6[_0x92ae('0x32')],qs[_0x92ae('0x37')](_0x310c8b[_0x92ae('0x33')]['fields']));_0x216911[_0x92ae('0x36')]=_0x216911['attributes']['length']?_0x216911['attributes']:_0x3093a6[_0x92ae('0x32')];if(_0x310c8b[_0x92ae('0x33')][_0x92ae('0x40')]){_0x216911['include']=[{'all':!![]}];}_0x216911=_[_0x92ae('0x3c')]({},_0x216911,_0x310c8b[_0x92ae('0x3f')]);return db[_0x92ae('0x42')]['find'](_0x216911)['then'](handleEntityNotFound(_0x3f1843,null))[_0x92ae('0x29')](respondWithResult(_0x3f1843,null))[_0x92ae('0x44')](handleError(_0x3f1843,null));};exports[_0x92ae('0x47')]=function(_0x7114c5,_0x244e6d){return db[_0x92ae('0x42')]['create'](_0x7114c5[_0x92ae('0x48')],{})[_0x92ae('0x29')](respondWithResult(_0x244e6d,0xc9))['catch'](handleError(_0x244e6d,null));};exports[_0x92ae('0x28')]=function(_0x4d8c8c,_0x458778){if(_0x4d8c8c[_0x92ae('0x48')]['id']){delete _0x4d8c8c[_0x92ae('0x48')]['id'];}return db[_0x92ae('0x42')][_0x92ae('0x49')]({'where':{'id':_0x4d8c8c['params']['id']}})[_0x92ae('0x29')](handleEntityNotFound(_0x458778,null))[_0x92ae('0x29')](saveUpdates(_0x4d8c8c['body'],null))[_0x92ae('0x29')](respondWithResult(_0x458778,null))[_0x92ae('0x44')](handleError(_0x458778,null));};exports[_0x92ae('0x4a')]=function(_0xfec8f4,_0x5bd439){return db[_0x92ae('0x42')]['find']({'where':{'id':_0xfec8f4['params']['id']}})[_0x92ae('0x29')](handleEntityNotFound(_0x5bd439,null))[_0x92ae('0x29')](removeEntity(_0x5bd439,null))['catch'](handleError(_0x5bd439,null));}; \ No newline at end of file +var _0xd00c=['query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','filters','pick','merge','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','index','SalesforceField','type','key','map'];(function(_0x19b744,_0xf5cf3f){var _0x47fdc4=function(_0x259933){while(--_0x259933){_0x19b744['push'](_0x19b744['shift']());}};_0x47fdc4(++_0xf5cf3f);}(_0xd00c,0x153));var _0xcd00=function(_0x3c1eae,_0x273ede){_0x3c1eae=_0x3c1eae-0x0;var _0x4d7831=_0xd00c[_0x3c1eae];return _0x4d7831;};'use strict';var emlformat=require(_0xcd00('0x0'));var rimraf=require(_0xcd00('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcd00('0x2'));var rp=require(_0xcd00('0x3'));var moment=require(_0xcd00('0x4'));var BPromise=require(_0xcd00('0x5'));var Mustache=require(_0xcd00('0x6'));var util=require(_0xcd00('0x7'));var path=require(_0xcd00('0x8'));var sox=require(_0xcd00('0x9'));var csv=require(_0xcd00('0xa'));var ejs=require(_0xcd00('0xb'));var fs=require('fs');var fs_extra=require(_0xcd00('0xc'));var _=require(_0xcd00('0xd'));var squel=require(_0xcd00('0xe'));var crypto=require(_0xcd00('0xf'));var jsforce=require(_0xcd00('0x10'));var deskjs=require(_0xcd00('0x11'));var toCsv=require(_0xcd00('0xa'));var querystring=require(_0xcd00('0x12'));var Papa=require(_0xcd00('0x13'));var Redis=require(_0xcd00('0x14'));var authService=require(_0xcd00('0x15'));var qs=require(_0xcd00('0x16'));var as=require(_0xcd00('0x17'));var hardwareService=require(_0xcd00('0x18'));var logger=require(_0xcd00('0x19'))(_0xcd00('0x1a'));var utils=require('../../config/utils');var config=require(_0xcd00('0x1b'));var licenseUtil=require(_0xcd00('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13f3f0,_0x27dbb8){_0x27dbb8=_0x27dbb8||0xcc;return function(_0x3718af){if(_0x3718af){return _0x13f3f0[_0xcd00('0x1d')](_0x27dbb8);}return _0x13f3f0[_0xcd00('0x1e')](_0x27dbb8)[_0xcd00('0x1f')]();};}function respondWithResult(_0x50b708,_0x598808){_0x598808=_0x598808||0xc8;return function(_0x585d60){if(_0x585d60){return _0x50b708[_0xcd00('0x1e')](_0x598808)[_0xcd00('0x20')](_0x585d60);}};}function respondWithFilteredResult(_0x11ff42,_0x1dc888){return function(_0x14bd86){if(_0x14bd86){var _0x1153f6=typeof _0x1dc888[_0xcd00('0x21')]===_0xcd00('0x22')&&typeof _0x1dc888['limit']===_0xcd00('0x22');var _0x238382=_0x14bd86[_0xcd00('0x23')];var _0x43f5ef=_0x1153f6?0x0:_0x1dc888[_0xcd00('0x21')];var _0x1ac8c8=_0x1153f6?_0x14bd86[_0xcd00('0x23')]:_0x1dc888[_0xcd00('0x21')]+_0x1dc888[_0xcd00('0x24')];var _0x354b8d;if(_0x1ac8c8>=_0x238382){_0x1ac8c8=_0x238382;_0x354b8d=0xc8;}else{_0x354b8d=0xce;}_0x11ff42['status'](_0x354b8d);return _0x11ff42[_0xcd00('0x25')](_0xcd00('0x26'),_0x43f5ef+'-'+_0x1ac8c8+'/'+_0x238382)[_0xcd00('0x20')](_0x14bd86);}return null;};}function patchUpdates(_0x1a5886){return function(_0x42e428){try{jsonpatch[_0xcd00('0x27')](_0x42e428,_0x1a5886,!![]);}catch(_0x686c98){return BPromise['reject'](_0x686c98);}return _0x42e428[_0xcd00('0x28')]();};}function saveUpdates(_0x2456dd,_0x5414af){return function(_0x4bc4ee){if(_0x4bc4ee){return _0x4bc4ee['update'](_0x2456dd)[_0xcd00('0x29')](function(_0x7f39c5){return _0x7f39c5;});}return null;};}function removeEntity(_0xeb8657,_0x4b55ff){return function(_0x424b8f){if(_0x424b8f){return _0x424b8f[_0xcd00('0x2a')]()[_0xcd00('0x29')](function(){_0xeb8657[_0xcd00('0x1e')](0xcc)[_0xcd00('0x1f')]();});}};}function handleEntityNotFound(_0x2da775,_0x21c1e0){return function(_0x3e978e){if(!_0x3e978e){_0x2da775[_0xcd00('0x1d')](0x194);}return _0x3e978e;};}function handleError(_0x5a17a7,_0x11e915){_0x11e915=_0x11e915||0x1f4;return function(_0x56c7e4){logger[_0xcd00('0x2b')](_0x56c7e4[_0xcd00('0x2c')]);if(_0x56c7e4['name']){delete _0x56c7e4[_0xcd00('0x2d')];}_0x5a17a7['status'](_0x11e915)['send'](_0x56c7e4);};}exports[_0xcd00('0x2e')]=function(_0x3273de,_0x564c84){var _0xcb263f={},_0x352001={},_0x587158={'count':0x0,'rows':[]};var _0x368186=_['map'](db[_0xcd00('0x2f')]['rawAttributes'],function(_0x327f84){return{'name':_0x327f84['fieldName'],'type':_0x327f84[_0xcd00('0x30')][_0xcd00('0x31')]};});_0x352001['model']=_[_0xcd00('0x32')](_0x368186,_0xcd00('0x2d'));_0x352001[_0xcd00('0x33')]=_['keys'](_0x3273de[_0xcd00('0x33')]);_0x352001['filters']=_[_0xcd00('0x34')](_0x352001['model'],_0x352001[_0xcd00('0x33')]);_0xcb263f[_0xcd00('0x35')]=_[_0xcd00('0x34')](_0x352001[_0xcd00('0x36')],qs[_0xcd00('0x37')](_0x3273de['query'][_0xcd00('0x37')]));_0xcb263f[_0xcd00('0x35')]=_0xcb263f[_0xcd00('0x35')][_0xcd00('0x38')]?_0xcb263f['attributes']:_0x352001[_0xcd00('0x36')];if(!_0x3273de[_0xcd00('0x33')][_0xcd00('0x39')](_0xcd00('0x3a'))){_0xcb263f['limit']=qs['limit'](_0x3273de[_0xcd00('0x33')][_0xcd00('0x24')]);_0xcb263f[_0xcd00('0x21')]=qs[_0xcd00('0x21')](_0x3273de[_0xcd00('0x33')][_0xcd00('0x21')]);}_0xcb263f['order']=qs['sort'](_0x3273de[_0xcd00('0x33')][_0xcd00('0x3b')]);_0xcb263f['where']=qs[_0xcd00('0x3c')](_[_0xcd00('0x3d')](_0x3273de[_0xcd00('0x33')],_0x352001[_0xcd00('0x3c')]),_0x368186);if(_0x3273de[_0xcd00('0x33')]['filter']){_0xcb263f['where']=_[_0xcd00('0x3e')](_0xcb263f[_0xcd00('0x3f')],{'$or':_[_0xcd00('0x32')](_0x368186,function(_0x23b186){if(_0x23b186['type']!==_0xcd00('0x40')){var _0x52a071={};_0x52a071[_0x23b186[_0xcd00('0x2d')]]={'$like':'%'+_0x3273de[_0xcd00('0x33')][_0xcd00('0x41')]+'%'};return _0x52a071;}})});}_0xcb263f=_['merge']({},_0xcb263f,_0x3273de['options']);var _0x244afe={'where':_0xcb263f[_0xcd00('0x3f')]};return db[_0xcd00('0x2f')][_0xcd00('0x23')](_0x244afe)[_0xcd00('0x29')](function(_0x584915){_0x587158[_0xcd00('0x23')]=_0x584915;if(_0x3273de[_0xcd00('0x33')][_0xcd00('0x42')]){_0xcb263f[_0xcd00('0x43')]=[{'all':!![]}];}return db[_0xcd00('0x2f')][_0xcd00('0x44')](_0xcb263f);})[_0xcd00('0x29')](function(_0x882d17){_0x587158[_0xcd00('0x45')]=_0x882d17;return _0x587158;})[_0xcd00('0x29')](respondWithFilteredResult(_0x564c84,_0xcb263f))[_0xcd00('0x46')](handleError(_0x564c84,null));};exports[_0xcd00('0x47')]=function(_0x4aba65,_0x2e9144){var _0x51723b={'raw':!![],'where':{'id':_0x4aba65[_0xcd00('0x48')]['id']}},_0x494cc8={};_0x494cc8[_0xcd00('0x36')]=_['keys'](db[_0xcd00('0x2f')][_0xcd00('0x49')]);_0x494cc8['query']=_['keys'](_0x4aba65[_0xcd00('0x33')]);_0x494cc8[_0xcd00('0x3c')]=_[_0xcd00('0x34')](_0x494cc8[_0xcd00('0x36')],_0x494cc8[_0xcd00('0x33')]);_0x51723b['attributes']=_[_0xcd00('0x34')](_0x494cc8[_0xcd00('0x36')],qs[_0xcd00('0x37')](_0x4aba65['query'][_0xcd00('0x37')]));_0x51723b['attributes']=_0x51723b[_0xcd00('0x35')][_0xcd00('0x38')]?_0x51723b[_0xcd00('0x35')]:_0x494cc8[_0xcd00('0x36')];if(_0x4aba65[_0xcd00('0x33')]['includeAll']){_0x51723b['include']=[{'all':!![]}];}_0x51723b=_[_0xcd00('0x3e')]({},_0x51723b,_0x4aba65['options']);return db[_0xcd00('0x2f')][_0xcd00('0x4a')](_0x51723b)['then'](handleEntityNotFound(_0x2e9144,null))[_0xcd00('0x29')](respondWithResult(_0x2e9144,null))[_0xcd00('0x46')](handleError(_0x2e9144,null));};exports[_0xcd00('0x4b')]=function(_0x36839e,_0x2ce371){return db[_0xcd00('0x2f')][_0xcd00('0x4b')](_0x36839e[_0xcd00('0x4c')],{})[_0xcd00('0x29')](respondWithResult(_0x2ce371,0xc9))[_0xcd00('0x46')](handleError(_0x2ce371,null));};exports[_0xcd00('0x4d')]=function(_0x24a1b6,_0x1d5998){if(_0x24a1b6[_0xcd00('0x4c')]['id']){delete _0x24a1b6['body']['id'];}return db[_0xcd00('0x2f')][_0xcd00('0x4a')]({'where':{'id':_0x24a1b6[_0xcd00('0x48')]['id']}})[_0xcd00('0x29')](handleEntityNotFound(_0x1d5998,null))[_0xcd00('0x29')](saveUpdates(_0x24a1b6[_0xcd00('0x4c')],null))[_0xcd00('0x29')](respondWithResult(_0x1d5998,null))[_0xcd00('0x46')](handleError(_0x1d5998,null));};exports[_0xcd00('0x2a')]=function(_0x40d123,_0x3c84ee){return db[_0xcd00('0x2f')][_0xcd00('0x4a')]({'where':{'id':_0x40d123[_0xcd00('0x48')]['id']}})[_0xcd00('0x29')](handleEntityNotFound(_0x3c84ee,null))[_0xcd00('0x29')](removeEntity(_0x3c84ee,null))['catch'](handleError(_0x3c84ee,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 7df2976..6689f29 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 _0x9065=['../../config/logger','api','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','FieldId','lodash'];(function(_0x56dcf5,_0x432938){var _0x15685d=function(_0x5155b5){while(--_0x5155b5){_0x56dcf5['push'](_0x56dcf5['shift']());}};_0x15685d(++_0x432938);}(_0x9065,0x9b));var _0x5906=function(_0x5369dd,_0x18e71a){_0x5369dd=_0x5369dd-0x0;var _0x262287=_0x9065[_0x5369dd];return _0x262287;};'use strict';var _=require(_0x5906('0x0'));var util=require('util');var logger=require(_0x5906('0x1'))(_0x5906('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5906('0x3'));var rimraf=require(_0x5906('0x4'));var config=require(_0x5906('0x5'));var attributes=require(_0x5906('0x6'));module[_0x5906('0x7')]=function(_0x59c104,_0x3919e1){return _0x59c104[_0x5906('0x8')](_0x5906('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x5906('0xa'),'fields':['idField',_0x5906('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa723=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','salesforce_unique_index','idField'];(function(_0x489663,_0xc2f438){var _0x5cff32=function(_0xcd16d8){while(--_0xcd16d8){_0x489663['push'](_0x489663['shift']());}};_0x5cff32(++_0xc2f438);}(_0xa723,0x101));var _0x3a72=function(_0x217ff6,_0x36f75d){_0x217ff6=_0x217ff6-0x0;var _0x417c93=_0xa723[_0x217ff6];return _0x417c93;};'use strict';var _=require(_0x3a72('0x0'));var util=require(_0x3a72('0x1'));var logger=require(_0x3a72('0x2'))(_0x3a72('0x3'));var moment=require(_0x3a72('0x4'));var BPromise=require(_0x3a72('0x5'));var rp=require(_0x3a72('0x6'));var fs=require('fs');var path=require(_0x3a72('0x7'));var rimraf=require(_0x3a72('0x8'));var config=require(_0x3a72('0x9'));var attributes=require(_0x3a72('0xa'));module[_0x3a72('0xb')]=function(_0x4e2d22,_0x48e6b4){return _0x4e2d22['define'](_0x3a72('0xc'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x3a72('0xd'),'fields':[_0x3a72('0xe'),_0x3a72('0xf')],'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 9605e09..b788b77 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 _0xa536=['info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x1d309d,_0x52081e){var _0x4bd62d=function(_0x4bba5e){while(--_0x4bba5e){_0x1d309d['push'](_0x1d309d['shift']());}};_0x4bd62d(++_0x52081e);}(_0xa536,0x1a3));var _0x6a53=function(_0x4f5ac2,_0x21cda9){_0x4f5ac2=_0x4f5ac2-0x0;var _0x168591=_0xa536[_0x4f5ac2];return _0x168591;};'use strict';var _=require(_0x6a53('0x0'));var util=require(_0x6a53('0x1'));var moment=require(_0x6a53('0x2'));var BPromise=require(_0x6a53('0x3'));var rs=require(_0x6a53('0x4'));var fs=require('fs');var Redis=require(_0x6a53('0x5'));var db=require(_0x6a53('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a53('0x7'))(_0x6a53('0x8'));var config=require('../../config/environment');var jayson=require(_0x6a53('0x9'));var client=jayson['client'][_0x6a53('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b39bd,_0x50f2a3,_0x110157){return new BPromise(function(_0x2863cd,_0x39a2f2){return client[_0x6a53('0xb')](_0x3b39bd,_0x110157)[_0x6a53('0xc')](function(_0x4037fb){logger[_0x6a53('0xd')](_0x6a53('0xe'),_0x50f2a3,_0x6a53('0xf'));logger[_0x6a53('0x10')](_0x6a53('0x11'),_0x50f2a3,'request\x20sent',JSON[_0x6a53('0x12')](_0x4037fb));if(_0x4037fb['error']){if(_0x4037fb[_0x6a53('0x13')][_0x6a53('0x14')]===0x1f4){logger[_0x6a53('0x13')]('SalesforceField,\x20%s,\x20%s',_0x50f2a3,_0x4037fb['error']['message']);return _0x39a2f2(_0x4037fb['error'][_0x6a53('0x15')]);}logger[_0x6a53('0x13')](_0x6a53('0xe'),_0x50f2a3,_0x4037fb[_0x6a53('0x13')][_0x6a53('0x15')]);return _0x2863cd(_0x4037fb[_0x6a53('0x13')][_0x6a53('0x15')]);}else{logger['info'](_0x6a53('0xe'),_0x50f2a3,_0x6a53('0xf'));_0x2863cd(_0x4037fb[_0x6a53('0x16')][_0x6a53('0x15')]);}})[_0x6a53('0x17')](function(_0x493606){logger[_0x6a53('0x13')](_0x6a53('0xe'),_0x50f2a3,_0x493606);_0x39a2f2(_0x493606);});});} \ No newline at end of file +var _0x7d58=['code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1c777b,_0x2f8213){var _0x40167e=function(_0x344d8a){while(--_0x344d8a){_0x1c777b['push'](_0x1c777b['shift']());}};_0x40167e(++_0x2f8213);}(_0x7d58,0x144));var _0x87d5=function(_0x26e780,_0x5465ba){_0x26e780=_0x26e780-0x0;var _0x2e9594=_0x7d58[_0x26e780];return _0x2e9594;};'use strict';var _=require('lodash');var util=require(_0x87d5('0x0'));var moment=require(_0x87d5('0x1'));var BPromise=require(_0x87d5('0x2'));var rs=require(_0x87d5('0x3'));var fs=require('fs');var Redis=require(_0x87d5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x87d5('0x5'));var logger=require(_0x87d5('0x6'))(_0x87d5('0x7'));var config=require('../../config/environment');var jayson=require(_0x87d5('0x8'));var client=jayson['client'][_0x87d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11eefe,_0x546542,_0x27c938){return new BPromise(function(_0x49f2d3,_0x4b1a4c){return client[_0x87d5('0xa')](_0x11eefe,_0x27c938)['then'](function(_0x2a9112){logger['info'](_0x87d5('0xb'),_0x546542,_0x87d5('0xc'));logger['debug'](_0x87d5('0xd'),_0x546542,_0x87d5('0xc'),JSON[_0x87d5('0xe')](_0x2a9112));if(_0x2a9112[_0x87d5('0xf')]){if(_0x2a9112[_0x87d5('0xf')][_0x87d5('0x10')]===0x1f4){logger[_0x87d5('0xf')](_0x87d5('0xb'),_0x546542,_0x2a9112[_0x87d5('0xf')][_0x87d5('0x11')]);return _0x4b1a4c(_0x2a9112[_0x87d5('0xf')][_0x87d5('0x11')]);}logger['error'](_0x87d5('0xb'),_0x546542,_0x2a9112['error'][_0x87d5('0x11')]);return _0x49f2d3(_0x2a9112[_0x87d5('0xf')][_0x87d5('0x11')]);}else{logger[_0x87d5('0x12')]('SalesforceField,\x20%s,\x20%s',_0x546542,_0x87d5('0xc'));_0x49f2d3(_0x2a9112['result'][_0x87d5('0x11')]);}})[_0x87d5('0x13')](function(_0x3455f8){logger[_0x87d5('0xf')](_0x87d5('0xb'),_0x546542,_0x3455f8);_0x4b1a4c(_0x3455f8);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 6df09ec..61615c5 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 _0x8ec1=['path','connect-timeout','express','Router','fs-extra','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','destroy','exports','util'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x8ec1,0x1e3));var _0x18ec=function(_0x98459f,_0x4dfb55){_0x98459f=_0x98459f-0x0;var _0x128f94=_0x8ec1[_0x98459f];return _0x128f94;};'use strict';var multer=require('multer');var util=require(_0x18ec('0x0'));var path=require(_0x18ec('0x1'));var timeout=require(_0x18ec('0x2'));var express=require(_0x18ec('0x3'));var router=express[_0x18ec('0x4')]();var fs_extra=require(_0x18ec('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x18ec('0x6'));var controller=require(_0x18ec('0x7'));router[_0x18ec('0x8')]('/',auth['isAuthenticated'](),controller[_0x18ec('0x9')]);router[_0x18ec('0x8')](_0x18ec('0xa'),auth[_0x18ec('0xb')](),controller[_0x18ec('0xc')]);router[_0x18ec('0x8')](_0x18ec('0xd'),auth['isAuthenticated'](),controller[_0x18ec('0xe')]);router[_0x18ec('0x8')](_0x18ec('0xf'),auth[_0x18ec('0xb')](),controller[_0x18ec('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x18ec('0x11')]);router[_0x18ec('0x12')](_0x18ec('0xd'),auth['isAuthenticated'](),controller[_0x18ec('0x13')]);router['put'](_0x18ec('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x18ec('0xa'),auth[_0x18ec('0xb')](),controller[_0x18ec('0x14')]);module[_0x18ec('0x15')]=router; \ No newline at end of file +var _0x23c5=['/:id/fields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations'];(function(_0x254c40,_0x35a145){var _0x363c96=function(_0x528954){while(--_0x528954){_0x254c40['push'](_0x254c40['shift']());}};_0x363c96(++_0x35a145);}(_0x23c5,0x128));var _0x523c=function(_0xd29ceb,_0x547c1d){_0xd29ceb=_0xd29ceb-0x0;var _0x13e480=_0x23c5[_0xd29ceb];return _0x13e480;};'use strict';var multer=require(_0x523c('0x0'));var util=require(_0x523c('0x1'));var path=require(_0x523c('0x2'));var timeout=require('connect-timeout');var express=require(_0x523c('0x3'));var router=express[_0x523c('0x4')]();var fs_extra=require(_0x523c('0x5'));var auth=require(_0x523c('0x6'));var interaction=require(_0x523c('0x7'));var config=require(_0x523c('0x8'));var controller=require(_0x523c('0x9'));router[_0x523c('0xa')]('/',auth['isAuthenticated'](),controller[_0x523c('0xb')]);router[_0x523c('0xa')](_0x523c('0xc'),auth[_0x523c('0xd')](),controller[_0x523c('0xe')]);router[_0x523c('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x523c('0xf')]);router[_0x523c('0xa')](_0x523c('0x10'),auth[_0x523c('0xd')](),controller['getFields']);router[_0x523c('0x11')]('/',auth[_0x523c('0xd')](),controller['create']);router[_0x523c('0x11')](_0x523c('0x12'),auth[_0x523c('0xd')](),controller[_0x523c('0x13')]);router[_0x523c('0x14')](_0x523c('0xc'),auth[_0x523c('0xd')](),controller[_0x523c('0x15')]);router[_0x523c('0x16')](_0x523c('0xc'),auth[_0x523c('0xd')](),controller[_0x523c('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 30d4e28..64ed593 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 _0xb610=['STRING','remoteUri'];(function(_0x131656,_0x254283){var _0x4afbe1=function(_0x19f247){while(--_0x19f247){_0x131656['push'](_0x131656['shift']());}};_0x4afbe1(++_0x254283);}(_0xb610,0x1e2));var _0x0b61=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xb610[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0b61('0x0')]},'description':{'type':Sequelize[_0x0b61('0x0')]},'username':{'type':Sequelize[_0x0b61('0x0')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0b61('0x0')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0b61('0x1')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x984b=['username','remoteUri','sequelize','exports','STRING'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x984b,0xc0));var _0xb984=function(_0x3f273c,_0x45717a){_0x3f273c=_0x3f273c-0x0;var _0x3cb5f7=_0x984b[_0x3f273c];return _0x3cb5f7;};'use strict';var Sequelize=require(_0xb984('0x0'));module[_0xb984('0x1')]={'name':{'type':Sequelize[_0xb984('0x2')]},'description':{'type':Sequelize[_0xb984('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xb984('0x3')},'password':{'type':Sequelize[_0xb984('0x2')]},'email':{'type':Sequelize[_0xb984('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xb984('0x4')},'serverUrl':{'type':Sequelize[_0xb984('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index dbd4ad0..c193c4d 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 _0xfd77=['sys_domain','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','closed_by','parent_incident','sys_id','contact_type','incident_state','problem_id','company','reassignment_count','activity_due','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','correlation_id','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','incident?sysparm_display_value=all','result','includes','forEach','internalType','label','push','all','assign','log','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','True','sys_choice?sysparm_query=name=incident^element=','false','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','params','filters','fields','includeAll','include','find','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','channel','getDescriptions','ServicenowField','Subjects','Descriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','resolved_by','sys_updated_by','opened_by','user_input'];(function(_0x575f8f,_0x562fb7){var _0x15d9ba=function(_0x1614f3){while(--_0x1614f3){_0x575f8f['push'](_0x575f8f['shift']());}};_0x15d9ba(++_0x562fb7);}(_0xfd77,0x1b6));var _0x7fd7=function(_0x1ad290,_0x578ec4){_0x1ad290=_0x1ad290-0x0;var _0x39668f=_0xfd77[_0x1ad290];return _0x39668f;};'use strict';var emlformat=require(_0x7fd7('0x0'));var rimraf=require(_0x7fd7('0x1'));var zipdir=require(_0x7fd7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7fd7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7fd7('0x4'));var util=require(_0x7fd7('0x5'));var path=require(_0x7fd7('0x6'));var sox=require(_0x7fd7('0x7'));var csv=require(_0x7fd7('0x8'));var ejs=require(_0x7fd7('0x9'));var fs=require('fs');var fs_extra=require(_0x7fd7('0xa'));var _=require(_0x7fd7('0xb'));var squel=require(_0x7fd7('0xc'));var crypto=require(_0x7fd7('0xd'));var jsforce=require(_0x7fd7('0xe'));var deskjs=require(_0x7fd7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7fd7('0x10'));var Papa=require(_0x7fd7('0x11'));var Redis=require(_0x7fd7('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7fd7('0x13'));var as=require(_0x7fd7('0x14'));var hardwareService=require(_0x7fd7('0x15'));var logger=require(_0x7fd7('0x16'))('api');var utils=require(_0x7fd7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7fd7('0x18'));var db=require(_0x7fd7('0x19'))['db'];var integrations=require(_0x7fd7('0x1a'));function respondWithStatusCode(_0x4cdcf4,_0x27f40a){_0x27f40a=_0x27f40a||0xcc;return function(_0x318013){if(_0x318013){return _0x4cdcf4[_0x7fd7('0x1b')](_0x27f40a);}return _0x4cdcf4[_0x7fd7('0x1c')](_0x27f40a)[_0x7fd7('0x1d')]();};}function respondWithResult(_0x1858e9,_0x120756){_0x120756=_0x120756||0xc8;return function(_0x114061){if(_0x114061){return _0x1858e9['status'](_0x120756)[_0x7fd7('0x1e')](_0x114061);}};}function respondWithFilteredResult(_0x3f387a,_0x5818b9){return function(_0x6f723){if(_0x6f723){var _0x48894b=typeof _0x5818b9[_0x7fd7('0x1f')]===_0x7fd7('0x20')&&typeof _0x5818b9[_0x7fd7('0x21')]==='undefined';var _0x2f8b21=_0x6f723[_0x7fd7('0x22')];var _0x198b16=_0x48894b?0x0:_0x5818b9['offset'];var _0x1b7425=_0x48894b?_0x6f723[_0x7fd7('0x22')]:_0x5818b9[_0x7fd7('0x1f')]+_0x5818b9[_0x7fd7('0x21')];var _0x1b053a;if(_0x1b7425>=_0x2f8b21){_0x1b7425=_0x2f8b21;_0x1b053a=0xc8;}else{_0x1b053a=0xce;}_0x3f387a[_0x7fd7('0x1c')](_0x1b053a);return _0x3f387a[_0x7fd7('0x23')](_0x7fd7('0x24'),_0x198b16+'-'+_0x1b7425+'/'+_0x2f8b21)[_0x7fd7('0x1e')](_0x6f723);}return null;};}function patchUpdates(_0x2db414){return function(_0x4dde54){try{jsonpatch['apply'](_0x4dde54,_0x2db414,!![]);}catch(_0x5d449e){return BPromise['reject'](_0x5d449e);}return _0x4dde54[_0x7fd7('0x25')]();};}function saveUpdates(_0x4c2822,_0x535603){return function(_0x5ede79){if(_0x5ede79){return _0x5ede79[_0x7fd7('0x26')](_0x4c2822)[_0x7fd7('0x27')](function(_0x11b6fc){return _0x11b6fc;});}return null;};}function removeEntity(_0x27e11b,_0x432461){return function(_0x1ef3dc){if(_0x1ef3dc){return _0x1ef3dc[_0x7fd7('0x28')]()['then'](function(){_0x27e11b[_0x7fd7('0x1c')](0xcc)[_0x7fd7('0x1d')]();});}};}function handleEntityNotFound(_0x3a7b45,_0x107398){return function(_0x4b9ae7){if(!_0x4b9ae7){_0x3a7b45['sendStatus'](0x194);}return _0x4b9ae7;};}function handleError(_0x438c1a,_0xa6d2e3){_0xa6d2e3=_0xa6d2e3||0x1f4;return function(_0xf280dc){logger[_0x7fd7('0x29')](_0xf280dc['stack']);if(_0xf280dc[_0x7fd7('0x2a')]){delete _0xf280dc[_0x7fd7('0x2a')];}_0x438c1a[_0x7fd7('0x1c')](_0xa6d2e3)[_0x7fd7('0x2b')](_0xf280dc);};}exports[_0x7fd7('0x2c')]=function(_0x2bc549,_0x1dcab4){var _0x299156={},_0x2e8a27={},_0xae0bda={'count':0x0,'rows':[]};var _0x5c1aab=_[_0x7fd7('0x2d')](db[_0x7fd7('0x2e')][_0x7fd7('0x2f')],function(_0x4e4674){return{'name':_0x4e4674[_0x7fd7('0x30')],'type':_0x4e4674[_0x7fd7('0x31')][_0x7fd7('0x32')]};});_0x2e8a27[_0x7fd7('0x33')]=_[_0x7fd7('0x2d')](_0x5c1aab,_0x7fd7('0x2a'));_0x2e8a27[_0x7fd7('0x34')]=_[_0x7fd7('0x35')](_0x2bc549['query']);_0x2e8a27['filters']=_[_0x7fd7('0x36')](_0x2e8a27['model'],_0x2e8a27[_0x7fd7('0x34')]);_0x299156[_0x7fd7('0x37')]=_[_0x7fd7('0x36')](_0x2e8a27[_0x7fd7('0x33')],qs['fields'](_0x2bc549['query']['fields']));_0x299156[_0x7fd7('0x37')]=_0x299156['attributes'][_0x7fd7('0x38')]?_0x299156[_0x7fd7('0x37')]:_0x2e8a27[_0x7fd7('0x33')];if(!_0x2bc549['query'][_0x7fd7('0x39')](_0x7fd7('0x3a'))){_0x299156[_0x7fd7('0x21')]=qs[_0x7fd7('0x21')](_0x2bc549[_0x7fd7('0x34')]['limit']);_0x299156[_0x7fd7('0x1f')]=qs['offset'](_0x2bc549[_0x7fd7('0x34')][_0x7fd7('0x1f')]);}_0x299156[_0x7fd7('0x3b')]=qs['sort'](_0x2bc549[_0x7fd7('0x34')][_0x7fd7('0x3c')]);_0x299156[_0x7fd7('0x3d')]=qs['filters'](_['pick'](_0x2bc549['query'],_0x2e8a27['filters']),_0x5c1aab);if(_0x2bc549['query'][_0x7fd7('0x3e')]){_0x299156[_0x7fd7('0x3d')]=_[_0x7fd7('0x3f')](_0x299156[_0x7fd7('0x3d')],{'$or':_[_0x7fd7('0x2d')](_0x5c1aab,function(_0x229e1e){if(_0x229e1e[_0x7fd7('0x31')]!==_0x7fd7('0x40')){var _0x40b009={};_0x40b009[_0x229e1e[_0x7fd7('0x2a')]]={'$like':'%'+_0x2bc549[_0x7fd7('0x34')][_0x7fd7('0x3e')]+'%'};return _0x40b009;}})});}_0x299156=_[_0x7fd7('0x3f')]({},_0x299156,_0x2bc549[_0x7fd7('0x41')]);var _0x5c6721={'where':_0x299156[_0x7fd7('0x3d')]};return db[_0x7fd7('0x2e')][_0x7fd7('0x22')](_0x5c6721)[_0x7fd7('0x27')](function(_0x5313b4){_0xae0bda[_0x7fd7('0x22')]=_0x5313b4;if(_0x2bc549[_0x7fd7('0x34')]['includeAll']){_0x299156['include']=[{'all':!![]}];}return db[_0x7fd7('0x2e')][_0x7fd7('0x42')](_0x299156);})[_0x7fd7('0x27')](function(_0x1ac86c){_0xae0bda[_0x7fd7('0x43')]=_0x1ac86c;return _0xae0bda;})[_0x7fd7('0x27')](respondWithFilteredResult(_0x1dcab4,_0x299156))[_0x7fd7('0x44')](handleError(_0x1dcab4,null));};exports['show']=function(_0x9fde7,_0x57a59a){var _0xacd8e2={'raw':![],'where':{'id':_0x9fde7[_0x7fd7('0x45')]['id']}},_0x50ec04={};_0x50ec04[_0x7fd7('0x33')]=_[_0x7fd7('0x35')](db[_0x7fd7('0x2e')]['rawAttributes']);_0x50ec04[_0x7fd7('0x34')]=_[_0x7fd7('0x35')](_0x9fde7[_0x7fd7('0x34')]);_0x50ec04[_0x7fd7('0x46')]=_[_0x7fd7('0x36')](_0x50ec04[_0x7fd7('0x33')],_0x50ec04[_0x7fd7('0x34')]);_0xacd8e2[_0x7fd7('0x37')]=_[_0x7fd7('0x36')](_0x50ec04[_0x7fd7('0x33')],qs[_0x7fd7('0x47')](_0x9fde7[_0x7fd7('0x34')][_0x7fd7('0x47')]));_0xacd8e2['attributes']=_0xacd8e2[_0x7fd7('0x37')][_0x7fd7('0x38')]?_0xacd8e2['attributes']:_0x50ec04[_0x7fd7('0x33')];if(_0x9fde7[_0x7fd7('0x34')][_0x7fd7('0x48')]){_0xacd8e2[_0x7fd7('0x49')]=[{'all':!![]}];}_0xacd8e2=_['merge']({},_0xacd8e2,_0x9fde7[_0x7fd7('0x41')]);return db[_0x7fd7('0x2e')][_0x7fd7('0x4a')](_0xacd8e2)[_0x7fd7('0x27')](handleEntityNotFound(_0x57a59a,null))[_0x7fd7('0x27')](respondWithResult(_0x57a59a,null))[_0x7fd7('0x44')](handleError(_0x57a59a,null));};exports[_0x7fd7('0x4b')]=function(_0x3a36fb,_0x463cd5){return db[_0x7fd7('0x2e')][_0x7fd7('0x4b')](_0x3a36fb['body'],{})[_0x7fd7('0x27')](respondWithResult(_0x463cd5,0xc9))[_0x7fd7('0x44')](handleError(_0x463cd5,null));};exports[_0x7fd7('0x26')]=function(_0x4a2ad,_0x2dfc01){if(_0x4a2ad['body']['id']){delete _0x4a2ad[_0x7fd7('0x4c')]['id'];}return db['ServicenowAccount'][_0x7fd7('0x4a')]({'where':{'id':_0x4a2ad[_0x7fd7('0x45')]['id']}})[_0x7fd7('0x27')](handleEntityNotFound(_0x2dfc01,null))[_0x7fd7('0x27')](saveUpdates(_0x4a2ad[_0x7fd7('0x4c')],null))[_0x7fd7('0x27')](respondWithResult(_0x2dfc01,null))[_0x7fd7('0x44')](handleError(_0x2dfc01,null));};exports[_0x7fd7('0x28')]=function(_0x2cbbc4,_0x448238){return db['ServicenowAccount'][_0x7fd7('0x4a')]({'where':{'id':_0x2cbbc4['params']['id']}})['then'](handleEntityNotFound(_0x448238,null))[_0x7fd7('0x27')](removeEntity(_0x448238,null))[_0x7fd7('0x44')](handleError(_0x448238,null));};exports[_0x7fd7('0x4d')]=function(_0x48f6ab,_0x3451b9,_0x3a0f3a){var _0x16f31b={};var _0x2a670f={};var _0x9c22e5;var _0x4d0e1e;return db[_0x7fd7('0x2e')][_0x7fd7('0x4e')]({'where':{'id':_0x48f6ab['params']['id']}})[_0x7fd7('0x27')](handleEntityNotFound(_0x3451b9,null))['then'](function(_0x598006){if(_0x598006){_0x9c22e5=_0x598006;_0x2a670f['model']=_[_0x7fd7('0x35')](db[_0x7fd7('0x4f')][_0x7fd7('0x2f')]);_0x2a670f[_0x7fd7('0x34')]=_[_0x7fd7('0x35')](_0x48f6ab[_0x7fd7('0x34')]);_0x2a670f[_0x7fd7('0x46')]=_[_0x7fd7('0x36')](_0x2a670f['model'],_0x2a670f[_0x7fd7('0x34')]);_0x16f31b[_0x7fd7('0x37')]=_[_0x7fd7('0x36')](_0x2a670f[_0x7fd7('0x33')],qs[_0x7fd7('0x47')](_0x48f6ab['query'][_0x7fd7('0x47')]));_0x16f31b['attributes']=_0x16f31b[_0x7fd7('0x37')]['length']?_0x16f31b[_0x7fd7('0x37')]:_0x2a670f['model'];_0x16f31b['order']=qs['sort'](_0x48f6ab['query'][_0x7fd7('0x3c')]);_0x16f31b[_0x7fd7('0x3d')]=qs[_0x7fd7('0x46')](_['pick'](_0x48f6ab[_0x7fd7('0x34')],_0x2a670f[_0x7fd7('0x46')]));if(_0x48f6ab[_0x7fd7('0x34')][_0x7fd7('0x3e')]){_0x16f31b[_0x7fd7('0x3d')]=_[_0x7fd7('0x3f')](_0x16f31b[_0x7fd7('0x3d')],{'$or':_[_0x7fd7('0x2d')](_0x16f31b[_0x7fd7('0x37')],function(_0x561c95){var _0xb75628={};_0xb75628[_0x561c95]={'$like':'%'+_0x48f6ab['query'][_0x7fd7('0x3e')]+'%'};return _0xb75628;})});}_0x16f31b=_[_0x7fd7('0x3f')]({},_0x16f31b,_0x48f6ab[_0x7fd7('0x41')]);return _0x9c22e5['getConfigurations'](_0x16f31b);}})['then'](function(_0x5d5d2c){if(_0x5d5d2c){_0x4d0e1e=_0x5d5d2c['length'];if(!_0x48f6ab['query'][_0x7fd7('0x39')](_0x7fd7('0x3a'))){_0x16f31b[_0x7fd7('0x21')]=qs[_0x7fd7('0x21')](_0x48f6ab[_0x7fd7('0x34')][_0x7fd7('0x21')]);_0x16f31b['offset']=qs[_0x7fd7('0x1f')](_0x48f6ab[_0x7fd7('0x34')][_0x7fd7('0x1f')]);}return _0x9c22e5[_0x7fd7('0x4d')](_0x16f31b);}})['then'](function(_0x52317d){if(_0x52317d){return _0x52317d?{'count':_0x4d0e1e,'rows':_0x52317d}:null;}})['then'](respondWithResult(_0x3451b9,null))[_0x7fd7('0x44')](handleError(_0x3451b9,null));};exports[_0x7fd7('0x50')]=function(_0xa9be92,_0x11e00c,_0x108b0c){if(_0xa9be92[_0x7fd7('0x4c')]['id']){delete _0xa9be92[_0x7fd7('0x4c')]['id'];}return db[_0x7fd7('0x2e')][_0x7fd7('0x4e')]({'where':{'id':_0xa9be92[_0x7fd7('0x45')]['id']}})[_0x7fd7('0x27')](handleEntityNotFound(_0x11e00c,null))['then'](function(_0x3be094){if(_0x3be094){_0xa9be92[_0x7fd7('0x4c')]['AccountId']=_0x3be094['id'];_0xa9be92[_0x7fd7('0x4c')]['Subjects']=integrations['getSubjects'](_0xa9be92[_0x7fd7('0x4c')][_0x7fd7('0x51')],_0xa9be92[_0x7fd7('0x4c')]['type']);_0xa9be92[_0x7fd7('0x4c')]['Descriptions']=integrations[_0x7fd7('0x52')](_0xa9be92[_0x7fd7('0x4c')][_0x7fd7('0x51')],_0xa9be92[_0x7fd7('0x4c')][_0x7fd7('0x31')]);return db[_0x7fd7('0x4f')][_0x7fd7('0x4b')](_0xa9be92['body'],{'include':[{'model':db[_0x7fd7('0x53')],'as':_0x7fd7('0x54')},{'model':db[_0x7fd7('0x53')],'as':_0x7fd7('0x55')}]});}return null;})[_0x7fd7('0x27')](respondWithResult(_0x11e00c,null))['catch'](handleError(_0x11e00c,null));};exports[_0x7fd7('0x56')]=function(_0x4a6970,_0x927316,_0x439baa){var _0x655df4=[_0x7fd7('0x57'),_0x7fd7('0x58'),_0x7fd7('0x59'),_0x7fd7('0x5a'),_0x7fd7('0x5b'),_0x7fd7('0x5c'),'incident_state',_0x7fd7('0x5d'),_0x7fd7('0x5e')];var _0x1a867e=[_0x7fd7('0x5f'),'made_sla',_0x7fd7('0x60'),_0x7fd7('0x61'),_0x7fd7('0x62'),_0x7fd7('0x63'),'child_incidents',_0x7fd7('0x58'),_0x7fd7('0x64'),'number',_0x7fd7('0x65'),_0x7fd7('0x66'),_0x7fd7('0x67'),_0x7fd7('0x68'),'sys_created_on',_0x7fd7('0x69'),_0x7fd7('0x6a'),_0x7fd7('0x6b'),_0x7fd7('0x59'),_0x7fd7('0x3b'),'calendar_stc',_0x7fd7('0x6c'),_0x7fd7('0x6d'),_0x7fd7('0x6e'),_0x7fd7('0x6f'),_0x7fd7('0x70'),_0x7fd7('0x71'),'business_service',_0x7fd7('0x72'),_0x7fd7('0x73'),_0x7fd7('0x74'),_0x7fd7('0x75'),_0x7fd7('0x76'),_0x7fd7('0x77'),_0x7fd7('0x78'),_0x7fd7('0x79'),'work_end',_0x7fd7('0x7a'),_0x7fd7('0x7b'),_0x7fd7('0x7c'),_0x7fd7('0x7d'),'subcategory','work_notes','short_description',_0x7fd7('0x5b'),_0x7fd7('0x7e'),_0x7fd7('0x7f'),_0x7fd7('0x80'),_0x7fd7('0x81'),_0x7fd7('0x82'),_0x7fd7('0x83'),'description',_0x7fd7('0x84'),'notify','sys_class_name','close_notes',_0x7fd7('0x85'),'follow_up',_0x7fd7('0x86'),_0x7fd7('0x87'),_0x7fd7('0x88'),'reopened_by',_0x7fd7('0x89'),'urgency',_0x7fd7('0x8a'),_0x7fd7('0x8b'),_0x7fd7('0x8c'),_0x7fd7('0x8d'),'assigned_to',_0x7fd7('0x5d'),'comments',_0x7fd7('0x8e'),_0x7fd7('0x8f'),_0x7fd7('0x90'),_0x7fd7('0x91'),_0x7fd7('0x92'),_0x7fd7('0x93'),_0x7fd7('0x94'),'escalation','upon_approval',_0x7fd7('0x95'),'location',_0x7fd7('0x5e')];var _0x46e111='';var _0x3b04cb='';var _0x280e8a=[];var _0xcde161='';var _0x2d9339='';var _0xe007a8=[];var _0x634fe2='';var _0xd476f9='';var _0x2d747b={};var _0x460b15='';return db[_0x7fd7('0x2e')][_0x7fd7('0x4e')]({'where':{'id':_0x4a6970[_0x7fd7('0x45')]['id']},'attributes':['id',_0x7fd7('0x96'),_0x7fd7('0x97'),_0x7fd7('0x98'),_0x7fd7('0x99'),_0x7fd7('0x9a')]})[_0x7fd7('0x27')](handleEntityNotFound(_0x927316,null))[_0x7fd7('0x27')](function(_0x2705c7){if(_0x2705c7){_0x460b15=_0x2705c7[_0x7fd7('0x99')];var _0x4d1b2c=_0x460b15[_0x7fd7('0x9b')](-0x1);if(_0x4d1b2c==='/'){_0x460b15=_0x460b15[_0x7fd7('0x9c')](0x0,_0x460b15[_0x7fd7('0x9d')](_0x4d1b2c));}_0xd476f9=util['format'](_0x7fd7('0x9e'),_0x460b15);_0x634fe2=util[_0x7fd7('0x9f')](_0x7fd7('0xa0'),_0x460b15);_0x2d747b={'user':_0x2705c7[_0x7fd7('0x96')],'pass':_0x2705c7[_0x7fd7('0x97')]};var _0x4e01b2={'method':'GET','uri':_0xd476f9+_0x7fd7('0xa1'),'auth':_0x2d747b,'json':!![]};return rp(_0x4e01b2);}})[_0x7fd7('0x27')](function(_0x5ccfe6){if(_0x5ccfe6[_0x7fd7('0xa2')]['length']>0x0){_0x46e111=_0x5ccfe6[_0x7fd7('0xa2')];}console['log']('incident\x20table\x20objects',_0x46e111);_0xe007a8=[];_0x3b04cb=Object['assign']([],_0x46e111);_['remove'](_0x3b04cb,function(_0x586502){return!_0x655df4[_0x7fd7('0xa3')](_0x586502[_0x7fd7('0x2a')]);});_0x3b04cb[_0x7fd7('0xa4')](function(_0xe5f156){var _0x50d4b7=createFieldObject(_0x634fe2,_0x2d747b,_0xe5f156[_0x7fd7('0xa5')],_0xe5f156['name'],_0xe5f156[_0x7fd7('0xa6')],![]);_0xe007a8[_0x7fd7('0xa7')](_0x50d4b7);});return Promise[_0x7fd7('0xa8')](_0xe007a8);})[_0x7fd7('0x27')](function(_0x49bd2f){_0x280e8a=_0x49bd2f;_0xcde161=Object[_0x7fd7('0xa9')]([],_0x46e111);console[_0x7fd7('0xaa')]('TCL:\x20_object',_0x46e111);_[_0x7fd7('0xab')](_0xcde161,function(_0x23277c){return _0x1a867e[_0x7fd7('0xa3')](_0x23277c[_0x7fd7('0x2a')]);});console[_0x7fd7('0xaa')](_0x7fd7('0xac'),_0xcde161);_0xe007a8=[];_0xcde161[_0x7fd7('0xa4')](function(_0x400758){var _0x360f32=createFieldObject(_0x634fe2,_0x2d747b,_0x400758[_0x7fd7('0xa5')],_0x400758['name'],_0x400758['label'],!![]);_0xe007a8[_0x7fd7('0xa7')](_0x360f32);});return Promise['all'](_0xe007a8);})[_0x7fd7('0x27')](function(_0x5f17ec){_0x2d9339=_0x5f17ec;var _0x32da2a=_0x280e8a[_0x7fd7('0xad')](_0x2d9339);return{'count':_0x32da2a[_0x7fd7('0x38')],'rows':_0x32da2a};})[_0x7fd7('0x27')](respondWithResult(_0x927316,null))['catch'](function(_0x25fc21){console['log'](_0x7fd7('0xae')+_0x25fc21);var _0x2951ee=_0x4a6970[_0x7fd7('0x34')][_0x7fd7('0xaf')]?0x1f4:_0x25fc21[_0x7fd7('0xb0')]||0x1f4;logger['error'](_0x25fc21['stack']);delete _0x25fc21['name'];if(_0x2951ee===0x191){_0x2951ee=0x190;}_0x927316[_0x7fd7('0x1c')](_0x2951ee)[_0x7fd7('0x2b')](_0x4a6970[_0x7fd7('0x34')][_0x7fd7('0xaf')]?{'message':_0x7fd7('0xb1'),'statusCode':_0x25fc21[_0x7fd7('0xb0')]}:_0x25fc21);});};function createFieldObject(_0xe91fe1,_0x53155d,_0xc19dc5,_0x3cba87,_0x326670,_0x2c338b){return new Promise(function(_0x1f4898,_0x5382ce){var _0x19ebf4={'id':_0x3cba87,'name':_0x326670,'custom':_0x2c338b};if(_0xc19dc5==='boolean'){_0x19ebf4[_0x7fd7('0x41')]=[{'name':_0x7fd7('0xb2'),'value':'true'},{'name':'False','value':'false'}];_0x1f4898(_0x19ebf4);}else{var _0xbaed4d={'method':'GET','uri':_0xe91fe1+_0x7fd7('0xb3')+_0x3cba87,'auth':_0x53155d,'json':!![]};return rp(_0xbaed4d)[_0x7fd7('0x27')](function(_0x44fb15){var _0x1573d3=[];if(_0x44fb15[_0x7fd7('0xa2')][_0x7fd7('0x38')]>0x0){_0x44fb15[_0x7fd7('0xa2')]['forEach'](function(_0x5237c1){if(_0x5237c1['inactive']===_0x7fd7('0xb4')){var _0x583dae={'name':_0x5237c1['label'],'value':_0x5237c1['value']};_0x1573d3['push'](_0x583dae);}});}_0x19ebf4['options']=_0x1573d3;if(_0x19ebf4[_0x7fd7('0x41')][_0x7fd7('0x38')]>0x0){_0x1f4898(_0x19ebf4);}else{if(_0x2c338b==![]){_0x1f4898();}else{_0x1f4898(_0x19ebf4);}}});}});} \ No newline at end of file +var _0xedec=['sys_created_by','closed_at','cmdb_ci','active','work_notes_list','business_service','priority','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','caller_id','approval_set','work_notes','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','reopen_count','sys_tags','escalation','upon_approval','correlation_id','category','username','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','push','all','assign','concat','statusCode','Wrong\x20credentials','boolean','True','False','false','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ServicenowAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','show','length','include','find','catch','create','params','body','findOne','ServicenowConfiguration','sort','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','parent','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','sys_domain','state'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xedec,0xfe));var _0xcede=function(_0x41249e,_0x275d84){_0x41249e=_0x41249e-0x0;var _0x2bff48=_0xedec[_0x41249e];return _0x2bff48;};'use strict';var emlformat=require(_0xcede('0x0'));var rimraf=require(_0xcede('0x1'));var zipdir=require(_0xcede('0x2'));var jsonpatch=require(_0xcede('0x3'));var rp=require(_0xcede('0x4'));var moment=require('moment');var BPromise=require(_0xcede('0x5'));var Mustache=require(_0xcede('0x6'));var util=require(_0xcede('0x7'));var path=require('path');var sox=require(_0xcede('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcede('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcede('0xa'));var jsforce=require(_0xcede('0xb'));var deskjs=require(_0xcede('0xc'));var toCsv=require(_0xcede('0xd'));var querystring=require(_0xcede('0xe'));var Papa=require(_0xcede('0xf'));var Redis=require('ioredis');var authService=require(_0xcede('0x10'));var qs=require(_0xcede('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcede('0x12'))(_0xcede('0x13'));var utils=require(_0xcede('0x14'));var config=require(_0xcede('0x15'));var licenseUtil=require(_0xcede('0x16'));var db=require(_0xcede('0x17'))['db'];var integrations=require(_0xcede('0x18'));function respondWithStatusCode(_0x39505a,_0x3d2817){_0x3d2817=_0x3d2817||0xcc;return function(_0x35b185){if(_0x35b185){return _0x39505a[_0xcede('0x19')](_0x3d2817);}return _0x39505a['status'](_0x3d2817)[_0xcede('0x1a')]();};}function respondWithResult(_0x4826a0,_0xfbf9fe){_0xfbf9fe=_0xfbf9fe||0xc8;return function(_0x50c0b1){if(_0x50c0b1){return _0x4826a0[_0xcede('0x1b')](_0xfbf9fe)[_0xcede('0x1c')](_0x50c0b1);}};}function respondWithFilteredResult(_0x2ea609,_0x4b9051){return function(_0x3a4e17){if(_0x3a4e17){var _0x4d9d4c=typeof _0x4b9051[_0xcede('0x1d')]==='undefined'&&typeof _0x4b9051[_0xcede('0x1e')]==='undefined';var _0x2f077c=_0x3a4e17[_0xcede('0x1f')];var _0x11083c=_0x4d9d4c?0x0:_0x4b9051[_0xcede('0x1d')];var _0x280abd=_0x4d9d4c?_0x3a4e17[_0xcede('0x1f')]:_0x4b9051[_0xcede('0x1d')]+_0x4b9051[_0xcede('0x1e')];var _0x249a23;if(_0x280abd>=_0x2f077c){_0x280abd=_0x2f077c;_0x249a23=0xc8;}else{_0x249a23=0xce;}_0x2ea609['status'](_0x249a23);return _0x2ea609[_0xcede('0x20')](_0xcede('0x21'),_0x11083c+'-'+_0x280abd+'/'+_0x2f077c)['json'](_0x3a4e17);}return null;};}function patchUpdates(_0x1fc792){return function(_0x3c4406){try{jsonpatch[_0xcede('0x22')](_0x3c4406,_0x1fc792,!![]);}catch(_0x2d82c9){return BPromise[_0xcede('0x23')](_0x2d82c9);}return _0x3c4406['save']();};}function saveUpdates(_0x2ebd27,_0x817f10){return function(_0x39e83d){if(_0x39e83d){return _0x39e83d[_0xcede('0x24')](_0x2ebd27)[_0xcede('0x25')](function(_0x212b57){return _0x212b57;});}return null;};}function removeEntity(_0xbafd7c,_0x3d57b6){return function(_0x90f795){if(_0x90f795){return _0x90f795[_0xcede('0x26')]()['then'](function(){_0xbafd7c['status'](0xcc)[_0xcede('0x1a')]();});}};}function handleEntityNotFound(_0x34e92c,_0x30071b){return function(_0x338a4d){if(!_0x338a4d){_0x34e92c[_0xcede('0x19')](0x194);}return _0x338a4d;};}function handleError(_0x28688c,_0x2bb7fc){_0x2bb7fc=_0x2bb7fc||0x1f4;return function(_0x24a60d){logger[_0xcede('0x27')](_0x24a60d[_0xcede('0x28')]);if(_0x24a60d[_0xcede('0x29')]){delete _0x24a60d['name'];}_0x28688c[_0xcede('0x1b')](_0x2bb7fc)[_0xcede('0x2a')](_0x24a60d);};}exports[_0xcede('0x2b')]=function(_0x23ccc3,_0x1f92b3){var _0x36b581={},_0x17fc8f={},_0x30a97b={'count':0x0,'rows':[]};var _0x54f65d=_['map'](db[_0xcede('0x2c')][_0xcede('0x2d')],function(_0xc4a817){return{'name':_0xc4a817['fieldName'],'type':_0xc4a817[_0xcede('0x2e')][_0xcede('0x2f')]};});_0x17fc8f[_0xcede('0x30')]=_[_0xcede('0x31')](_0x54f65d,_0xcede('0x29'));_0x17fc8f[_0xcede('0x32')]=_[_0xcede('0x33')](_0x23ccc3[_0xcede('0x32')]);_0x17fc8f[_0xcede('0x34')]=_[_0xcede('0x35')](_0x17fc8f[_0xcede('0x30')],_0x17fc8f[_0xcede('0x32')]);_0x36b581['attributes']=_[_0xcede('0x35')](_0x17fc8f[_0xcede('0x30')],qs[_0xcede('0x36')](_0x23ccc3[_0xcede('0x32')]['fields']));_0x36b581[_0xcede('0x37')]=_0x36b581[_0xcede('0x37')]['length']?_0x36b581[_0xcede('0x37')]:_0x17fc8f[_0xcede('0x30')];if(!_0x23ccc3['query'][_0xcede('0x38')](_0xcede('0x39'))){_0x36b581['limit']=qs['limit'](_0x23ccc3[_0xcede('0x32')][_0xcede('0x1e')]);_0x36b581[_0xcede('0x1d')]=qs[_0xcede('0x1d')](_0x23ccc3['query'][_0xcede('0x1d')]);}_0x36b581[_0xcede('0x3a')]=qs['sort'](_0x23ccc3[_0xcede('0x32')]['sort']);_0x36b581['where']=qs['filters'](_[_0xcede('0x3b')](_0x23ccc3['query'],_0x17fc8f[_0xcede('0x34')]),_0x54f65d);if(_0x23ccc3[_0xcede('0x32')][_0xcede('0x3c')]){_0x36b581[_0xcede('0x3d')]=_[_0xcede('0x3e')](_0x36b581['where'],{'$or':_[_0xcede('0x31')](_0x54f65d,function(_0x5ca14a){if(_0x5ca14a['type']!==_0xcede('0x3f')){var _0x30bc20={};_0x30bc20[_0x5ca14a[_0xcede('0x29')]]={'$like':'%'+_0x23ccc3[_0xcede('0x32')][_0xcede('0x3c')]+'%'};return _0x30bc20;}})});}_0x36b581=_[_0xcede('0x3e')]({},_0x36b581,_0x23ccc3[_0xcede('0x40')]);var _0x15b522={'where':_0x36b581[_0xcede('0x3d')]};return db[_0xcede('0x2c')]['count'](_0x15b522)[_0xcede('0x25')](function(_0x1251bf){_0x30a97b[_0xcede('0x1f')]=_0x1251bf;if(_0x23ccc3['query'][_0xcede('0x41')]){_0x36b581['include']=[{'all':!![]}];}return db[_0xcede('0x2c')]['findAll'](_0x36b581);})[_0xcede('0x25')](function(_0x68b087){_0x30a97b['rows']=_0x68b087;return _0x30a97b;})[_0xcede('0x25')](respondWithFilteredResult(_0x1f92b3,_0x36b581))['catch'](handleError(_0x1f92b3,null));};exports[_0xcede('0x42')]=function(_0x77b940,_0x411fa6){var _0x7f7167={'raw':![],'where':{'id':_0x77b940['params']['id']}},_0x580d8e={};_0x580d8e['model']=_[_0xcede('0x33')](db[_0xcede('0x2c')][_0xcede('0x2d')]);_0x580d8e['query']=_[_0xcede('0x33')](_0x77b940[_0xcede('0x32')]);_0x580d8e['filters']=_['intersection'](_0x580d8e[_0xcede('0x30')],_0x580d8e[_0xcede('0x32')]);_0x7f7167[_0xcede('0x37')]=_[_0xcede('0x35')](_0x580d8e[_0xcede('0x30')],qs['fields'](_0x77b940['query']['fields']));_0x7f7167[_0xcede('0x37')]=_0x7f7167[_0xcede('0x37')][_0xcede('0x43')]?_0x7f7167[_0xcede('0x37')]:_0x580d8e[_0xcede('0x30')];if(_0x77b940[_0xcede('0x32')]['includeAll']){_0x7f7167[_0xcede('0x44')]=[{'all':!![]}];}_0x7f7167=_[_0xcede('0x3e')]({},_0x7f7167,_0x77b940[_0xcede('0x40')]);return db[_0xcede('0x2c')][_0xcede('0x45')](_0x7f7167)[_0xcede('0x25')](handleEntityNotFound(_0x411fa6,null))['then'](respondWithResult(_0x411fa6,null))[_0xcede('0x46')](handleError(_0x411fa6,null));};exports[_0xcede('0x47')]=function(_0x2058b6,_0x70f820){return db[_0xcede('0x2c')]['create'](_0x2058b6['body'],{})[_0xcede('0x25')](respondWithResult(_0x70f820,0xc9))[_0xcede('0x46')](handleError(_0x70f820,null));};exports['update']=function(_0x383958,_0x38f51e){if(_0x383958['body']['id']){delete _0x383958['body']['id'];}return db['ServicenowAccount']['find']({'where':{'id':_0x383958[_0xcede('0x48')]['id']}})[_0xcede('0x25')](handleEntityNotFound(_0x38f51e,null))['then'](saveUpdates(_0x383958[_0xcede('0x49')],null))[_0xcede('0x25')](respondWithResult(_0x38f51e,null))['catch'](handleError(_0x38f51e,null));};exports['destroy']=function(_0x3a9ba6,_0x27661e){return db['ServicenowAccount'][_0xcede('0x45')]({'where':{'id':_0x3a9ba6[_0xcede('0x48')]['id']}})[_0xcede('0x25')](handleEntityNotFound(_0x27661e,null))[_0xcede('0x25')](removeEntity(_0x27661e,null))[_0xcede('0x46')](handleError(_0x27661e,null));};exports['getConfigurations']=function(_0x1aa855,_0x4e7727,_0x14cc2b){var _0x2c02a2={};var _0x11fae4={};var _0x339d64;var _0x363e90;return db[_0xcede('0x2c')][_0xcede('0x4a')]({'where':{'id':_0x1aa855[_0xcede('0x48')]['id']}})[_0xcede('0x25')](handleEntityNotFound(_0x4e7727,null))[_0xcede('0x25')](function(_0x54492f){if(_0x54492f){_0x339d64=_0x54492f;_0x11fae4[_0xcede('0x30')]=_['keys'](db[_0xcede('0x4b')][_0xcede('0x2d')]);_0x11fae4[_0xcede('0x32')]=_[_0xcede('0x33')](_0x1aa855[_0xcede('0x32')]);_0x11fae4[_0xcede('0x34')]=_[_0xcede('0x35')](_0x11fae4[_0xcede('0x30')],_0x11fae4['query']);_0x2c02a2['attributes']=_[_0xcede('0x35')](_0x11fae4[_0xcede('0x30')],qs[_0xcede('0x36')](_0x1aa855[_0xcede('0x32')]['fields']));_0x2c02a2[_0xcede('0x37')]=_0x2c02a2[_0xcede('0x37')][_0xcede('0x43')]?_0x2c02a2[_0xcede('0x37')]:_0x11fae4[_0xcede('0x30')];_0x2c02a2[_0xcede('0x3a')]=qs['sort'](_0x1aa855['query'][_0xcede('0x4c')]);_0x2c02a2[_0xcede('0x3d')]=qs[_0xcede('0x34')](_[_0xcede('0x3b')](_0x1aa855['query'],_0x11fae4['filters']));if(_0x1aa855[_0xcede('0x32')][_0xcede('0x3c')]){_0x2c02a2[_0xcede('0x3d')]=_[_0xcede('0x3e')](_0x2c02a2[_0xcede('0x3d')],{'$or':_[_0xcede('0x31')](_0x2c02a2[_0xcede('0x37')],function(_0x38fb7c){var _0x5eb765={};_0x5eb765[_0x38fb7c]={'$like':'%'+_0x1aa855[_0xcede('0x32')]['filter']+'%'};return _0x5eb765;})});}_0x2c02a2=_[_0xcede('0x3e')]({},_0x2c02a2,_0x1aa855[_0xcede('0x40')]);return _0x339d64[_0xcede('0x4d')](_0x2c02a2);}})['then'](function(_0x190feb){if(_0x190feb){_0x363e90=_0x190feb[_0xcede('0x43')];if(!_0x1aa855[_0xcede('0x32')][_0xcede('0x38')](_0xcede('0x39'))){_0x2c02a2[_0xcede('0x1e')]=qs[_0xcede('0x1e')](_0x1aa855['query'][_0xcede('0x1e')]);_0x2c02a2['offset']=qs['offset'](_0x1aa855[_0xcede('0x32')][_0xcede('0x1d')]);}return _0x339d64[_0xcede('0x4d')](_0x2c02a2);}})[_0xcede('0x25')](function(_0x9d597f){if(_0x9d597f){return _0x9d597f?{'count':_0x363e90,'rows':_0x9d597f}:null;}})[_0xcede('0x25')](respondWithResult(_0x4e7727,null))[_0xcede('0x46')](handleError(_0x4e7727,null));};exports['addConfiguration']=function(_0x25b9ec,_0x3f810f,_0x47155c){if(_0x25b9ec[_0xcede('0x49')]['id']){delete _0x25b9ec['body']['id'];}return db[_0xcede('0x2c')][_0xcede('0x4a')]({'where':{'id':_0x25b9ec['params']['id']}})[_0xcede('0x25')](handleEntityNotFound(_0x3f810f,null))[_0xcede('0x25')](function(_0x30d5a6){if(_0x30d5a6){_0x25b9ec[_0xcede('0x49')][_0xcede('0x4e')]=_0x30d5a6['id'];_0x25b9ec[_0xcede('0x49')][_0xcede('0x4f')]=integrations[_0xcede('0x50')](_0x25b9ec[_0xcede('0x49')][_0xcede('0x51')],_0x25b9ec[_0xcede('0x49')][_0xcede('0x2e')]);_0x25b9ec[_0xcede('0x49')][_0xcede('0x52')]=integrations[_0xcede('0x53')](_0x25b9ec[_0xcede('0x49')]['channel'],_0x25b9ec[_0xcede('0x49')][_0xcede('0x2e')]);return db[_0xcede('0x4b')]['create'](_0x25b9ec[_0xcede('0x49')],{'include':[{'model':db['ServicenowField'],'as':_0xcede('0x4f')},{'model':db[_0xcede('0x54')],'as':_0xcede('0x52')}]});}return null;})[_0xcede('0x25')](respondWithResult(_0x3f810f,null))[_0xcede('0x46')](handleError(_0x3f810f,null));};exports['getFields']=function(_0x219ee0,_0x4a2eea,_0x2c3ea1){var _0x4cd238=[_0xcede('0x55'),_0xcede('0x56'),_0xcede('0x57'),_0xcede('0x58'),_0xcede('0x59'),'notify',_0xcede('0x5a'),'severity','category'];var _0x10339=[_0xcede('0x5b'),_0xcede('0x55'),_0xcede('0x5c'),_0xcede('0x5d'),'upon_reject',_0xcede('0x5e'),_0xcede('0x5f'),_0xcede('0x56'),_0xcede('0x60'),_0xcede('0x61'),_0xcede('0x62'),'sys_updated_by',_0xcede('0x63'),'user_input','sys_created_on',_0xcede('0x64'),_0xcede('0x65'),_0xcede('0x66'),_0xcede('0x57'),_0xcede('0x3a'),'calendar_stc',_0xcede('0x67'),_0xcede('0x68'),'delivery_plan','impact',_0xcede('0x69'),_0xcede('0x6a'),_0xcede('0x6b'),_0xcede('0x6c'),'sys_domain_path',_0xcede('0x6d'),_0xcede('0x6e'),_0xcede('0x6f'),_0xcede('0x70'),_0xcede('0x71'),_0xcede('0x72'),_0xcede('0x73'),_0xcede('0x74'),'resolved_at',_0xcede('0x75'),_0xcede('0x76'),'subcategory',_0xcede('0x77'),'short_description',_0xcede('0x59'),_0xcede('0x78'),_0xcede('0x79'),_0xcede('0x7a'),_0xcede('0x7b'),'business_stc',_0xcede('0x7c'),_0xcede('0x7d'),_0xcede('0x7e'),_0xcede('0x7f'),_0xcede('0x80'),_0xcede('0x81'),_0xcede('0x82'),_0xcede('0x83'),'parent_incident',_0xcede('0x84'),_0xcede('0x85'),_0xcede('0x86'),_0xcede('0x5a'),'urgency','problem_id','company',_0xcede('0x87'),_0xcede('0x88'),'assigned_to','severity',_0xcede('0x89'),_0xcede('0x8a'),_0xcede('0x8b'),_0xcede('0x8c'),_0xcede('0x8d'),'sys_mod_count',_0xcede('0x8e'),_0xcede('0x8f'),_0xcede('0x90'),_0xcede('0x91'),_0xcede('0x92'),'location',_0xcede('0x93')];var _0x457283='';var _0xdbda6e='';var _0x3adbc6=[];var _0xd32303='';var _0x202a10='';var _0x2e8832=[];var _0x293f8f='';var _0x260da3='';var _0x558e8f={};var _0x93e20f='';return db[_0xcede('0x2c')][_0xcede('0x4a')]({'where':{'id':_0x219ee0['params']['id']},'attributes':['id',_0xcede('0x94'),'password',_0xcede('0x95'),_0xcede('0x96'),_0xcede('0x97')]})[_0xcede('0x25')](handleEntityNotFound(_0x4a2eea,null))[_0xcede('0x25')](function(_0x3cf8da){if(_0x3cf8da){_0x93e20f=_0x3cf8da['remoteUri'];var _0xf6aa26=_0x93e20f[_0xcede('0x98')](-0x1);if(_0xf6aa26==='/'){_0x93e20f=_0x93e20f[_0xcede('0x99')](0x0,_0x93e20f[_0xcede('0x9a')](_0xf6aa26));}_0x260da3=util[_0xcede('0x9b')]('%s/api/now/doc/table/schema/',_0x93e20f);_0x293f8f=util[_0xcede('0x9b')](_0xcede('0x9c'),_0x93e20f);_0x558e8f={'user':_0x3cf8da['username'],'pass':_0x3cf8da['password']};var _0xbfb1d2={'method':_0xcede('0x9d'),'uri':_0x260da3+_0xcede('0x9e'),'auth':_0x558e8f,'json':!![]};return rp(_0xbfb1d2);}})[_0xcede('0x25')](function(_0x22b9cb){if(_0x22b9cb[_0xcede('0x9f')][_0xcede('0x43')]>0x0){_0x457283=_0x22b9cb[_0xcede('0x9f')];}console[_0xcede('0xa0')](_0xcede('0xa1'),_0x457283);_0x2e8832=[];_0xdbda6e=Object['assign']([],_0x457283);_[_0xcede('0xa2')](_0xdbda6e,function(_0x5c5ddc){return!_0x4cd238[_0xcede('0xa3')](_0x5c5ddc['name']);});_0xdbda6e[_0xcede('0xa4')](function(_0x21c213){var _0x3a700d=createFieldObject(_0x293f8f,_0x558e8f,_0x21c213[_0xcede('0xa5')],_0x21c213[_0xcede('0x29')],_0x21c213[_0xcede('0xa6')],![]);_0x2e8832[_0xcede('0xa7')](_0x3a700d);});return Promise[_0xcede('0xa8')](_0x2e8832);})[_0xcede('0x25')](function(_0x1db38a){_0x3adbc6=_0x1db38a;_0xd32303=Object[_0xcede('0xa9')]([],_0x457283);console[_0xcede('0xa0')]('TCL:\x20_object',_0x457283);_[_0xcede('0xa2')](_0xd32303,function(_0x53d019){return _0x10339[_0xcede('0xa3')](_0x53d019[_0xcede('0x29')]);});console[_0xcede('0xa0')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0xd32303);_0x2e8832=[];_0xd32303[_0xcede('0xa4')](function(_0x34affe){var _0x2a4807=createFieldObject(_0x293f8f,_0x558e8f,_0x34affe[_0xcede('0xa5')],_0x34affe[_0xcede('0x29')],_0x34affe[_0xcede('0xa6')],!![]);_0x2e8832['push'](_0x2a4807);});return Promise['all'](_0x2e8832);})[_0xcede('0x25')](function(_0x4f8a17){_0x202a10=_0x4f8a17;var _0x26d9f9=_0x3adbc6[_0xcede('0xaa')](_0x202a10);return{'count':_0x26d9f9[_0xcede('0x43')],'rows':_0x26d9f9};})[_0xcede('0x25')](respondWithResult(_0x4a2eea,null))['catch'](function(_0x163f1c){console['log']('ServiceNow\x20error:\x20'+_0x163f1c);var _0x555b2e=_0x219ee0['query']['test']?0x1f4:_0x163f1c[_0xcede('0xab')]||0x1f4;logger[_0xcede('0x27')](_0x163f1c[_0xcede('0x28')]);delete _0x163f1c[_0xcede('0x29')];if(_0x555b2e===0x191){_0x555b2e=0x190;}_0x4a2eea[_0xcede('0x1b')](_0x555b2e)[_0xcede('0x2a')](_0x219ee0['query']['test']?{'message':_0xcede('0xac'),'statusCode':_0x163f1c[_0xcede('0xab')]}:_0x163f1c);});};function createFieldObject(_0x2c84da,_0x2cc23e,_0x2a38a3,_0x51217c,_0x4e744b,_0x338ea7){return new Promise(function(_0x5be5b4,_0x2abadf){var _0x52f6b1={'id':_0x51217c,'name':_0x4e744b,'custom':_0x338ea7};if(_0x2a38a3===_0xcede('0xad')){_0x52f6b1[_0xcede('0x40')]=[{'name':_0xcede('0xae'),'value':'true'},{'name':_0xcede('0xaf'),'value':'false'}];_0x5be5b4(_0x52f6b1);}else{var _0x469931={'method':_0xcede('0x9d'),'uri':_0x2c84da+'sys_choice?sysparm_query=name=incident^element='+_0x51217c,'auth':_0x2cc23e,'json':!![]};return rp(_0x469931)['then'](function(_0x860012){var _0x1ead88=[];if(_0x860012[_0xcede('0x9f')][_0xcede('0x43')]>0x0){_0x860012[_0xcede('0x9f')][_0xcede('0xa4')](function(_0x20adec){if(_0x20adec['inactive']===_0xcede('0xb0')){var _0x44a7a9={'name':_0x20adec[_0xcede('0xa6')],'value':_0x20adec[_0xcede('0xb1')]};_0x1ead88[_0xcede('0xa7')](_0x44a7a9);}});}_0x52f6b1[_0xcede('0x40')]=_0x1ead88;if(_0x52f6b1[_0xcede('0x40')][_0xcede('0x43')]>0x0){_0x5be5b4(_0x52f6b1);}else{if(_0x338ea7==![]){_0x5be5b4();}else{_0x5be5b4(_0x52f6b1);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 8c491a9..2b00d11 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 _0x2eb2=['request-promise','rimraf','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x116047,_0xa440e2){var _0xeb9ddc=function(_0x419d23){while(--_0x419d23){_0x116047['push'](_0x116047['shift']());}};_0xeb9ddc(++_0xa440e2);}(_0x2eb2,0x19f));var _0x22eb=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x2eb2[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x22eb('0x7'));module[_0x22eb('0x8')]=function(_0x35dd5b,_0x2a9850){return _0x35dd5b[_0x22eb('0x9')](_0x22eb('0xa'),attributes,{'tableName':_0x22eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71ab=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','api','bluebird','request-promise'];(function(_0x2b9c1c,_0x544757){var _0x44610b=function(_0x5191be){while(--_0x5191be){_0x2b9c1c['push'](_0x2b9c1c['shift']());}};_0x44610b(++_0x544757);}(_0x71ab,0x64));var _0xb71a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x71ab[_0x17d9e3];return _0x14192d;};'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'));var integrations=require(_0xb71a('0x8'));module[_0xb71a('0x9')]=function(_0x22c072,_0x35a84e){return _0x22c072[_0xb71a('0xa')](_0xb71a('0xb'),attributes,{'tableName':_0xb71a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index e4b8096..8f8004c 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 _0x63f4=['error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','options','where','attributes','limit','include','map','model','debug','ShowServicenowAccount','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x63f4,0xf0));var _0x463f=function(_0x1de900,_0x3f0834){_0x1de900=_0x1de900-0x0;var _0x2d1d47=_0x63f4[_0x1de900];return _0x2d1d47;};'use strict';var _=require(_0x463f('0x0'));var util=require(_0x463f('0x1'));var moment=require('moment');var BPromise=require(_0x463f('0x2'));var rs=require(_0x463f('0x3'));var fs=require('fs');var Redis=require(_0x463f('0x4'));var db=require(_0x463f('0x5'))['db'];var utils=require(_0x463f('0x6'));var logger=require(_0x463f('0x7'))(_0x463f('0x8'));var config=require(_0x463f('0x9'));var jayson=require(_0x463f('0xa'));var client=jayson[_0x463f('0xb')][_0x463f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1265dc,_0x575613,_0x3520e5){return new BPromise(function(_0x36a0a8,_0x5d1e31){return client['request'](_0x1265dc,_0x3520e5)[_0x463f('0xd')](function(_0x200776){logger[_0x463f('0xe')](_0x463f('0xf'),_0x575613,_0x463f('0x10'));logger['debug'](_0x463f('0x11'),_0x575613,_0x463f('0x10'),JSON[_0x463f('0x12')](_0x200776));if(_0x200776[_0x463f('0x13')]){if(_0x200776[_0x463f('0x13')][_0x463f('0x14')]===0x1f4){logger[_0x463f('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x575613,_0x200776['error'][_0x463f('0x15')]);return _0x5d1e31(_0x200776['error']['message']);}logger[_0x463f('0x13')](_0x463f('0xf'),_0x575613,_0x200776[_0x463f('0x13')]['message']);return _0x36a0a8(_0x200776[_0x463f('0x13')][_0x463f('0x15')]);}else{logger[_0x463f('0xe')](_0x463f('0xf'),_0x575613,'request\x20sent');_0x36a0a8(_0x200776[_0x463f('0x16')][_0x463f('0x15')]);}})[_0x463f('0x17')](function(_0x4143b0){logger['error'](_0x463f('0xf'),_0x575613,_0x4143b0);_0x5d1e31(_0x4143b0);});});}exports[_0x463f('0x18')]=function(_0x461d8e){var _0x96e5a6=this;return new Promise(function(_0x1ed9e5,_0x23e08c){return db[_0x463f('0x19')]['findAll']({'raw':_0x461d8e[_0x463f('0x1a')]?_0x461d8e[_0x463f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x461d8e[_0x463f('0x1a')]?_0x461d8e[_0x463f('0x1a')][_0x463f('0x1b')]||null:null,'attributes':_0x461d8e[_0x463f('0x1a')]?_0x461d8e[_0x463f('0x1a')][_0x463f('0x1c')]||null:null,'limit':_0x461d8e[_0x463f('0x1a')]?_0x461d8e[_0x463f('0x1a')][_0x463f('0x1d')]||null:null,'include':_0x461d8e[_0x463f('0x1a')]?_0x461d8e[_0x463f('0x1a')][_0x463f('0x1e')]?_['map'](_0x461d8e[_0x463f('0x1a')][_0x463f('0x1e')],function(_0x1699c1){return{'model':db[_0x1699c1['model']],'as':_0x1699c1['as'],'attributes':_0x1699c1['attributes'],'include':_0x1699c1[_0x463f('0x1e')]?_[_0x463f('0x1f')](_0x1699c1[_0x463f('0x1e')],function(_0x8c0379){return{'model':db[_0x8c0379[_0x463f('0x20')]],'as':_0x8c0379['as'],'attributes':_0x8c0379[_0x463f('0x1c')],'include':_0x8c0379[_0x463f('0x1e')]?_[_0x463f('0x1f')](_0x8c0379[_0x463f('0x1e')],function(_0x1012e5){return{'model':db[_0x1012e5['model']],'as':_0x1012e5['as'],'attributes':_0x1012e5[_0x463f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x463f('0xd')](function(_0x47df13){logger['info'](_0x463f('0x18'),_0x461d8e);logger[_0x463f('0x21')]('GetServicenowAccount',_0x461d8e,JSON['stringify'](_0x47df13));_0x1ed9e5(_0x47df13);})[_0x463f('0x17')](function(_0x46eeb2){logger[_0x463f('0x13')]('GetServicenowAccount',_0x46eeb2[_0x463f('0x15')],_0x461d8e);_0x23e08c(_0x96e5a6[_0x463f('0x13')](0x1f4,_0x46eeb2[_0x463f('0x15')]));});});};exports[_0x463f('0x22')]=function(_0x4721e8){var _0x2386cc=this;return new Promise(function(_0x5c3dda,_0x572389){return db[_0x463f('0x19')][_0x463f('0x23')]({'raw':_0x4721e8[_0x463f('0x1a')]?_0x4721e8['options'][_0x463f('0x24')]===undefined?!![]:![]:!![],'where':_0x4721e8[_0x463f('0x1a')]?_0x4721e8[_0x463f('0x1a')]['where']||null:null,'attributes':_0x4721e8[_0x463f('0x1a')]?_0x4721e8['options'][_0x463f('0x1c')]||null:null,'include':_0x4721e8[_0x463f('0x1a')]?_0x4721e8['options'][_0x463f('0x1e')]?_['map'](_0x4721e8[_0x463f('0x1a')][_0x463f('0x1e')],function(_0x5a545b){return{'model':db[_0x5a545b[_0x463f('0x20')]],'as':_0x5a545b['as'],'attributes':_0x5a545b[_0x463f('0x1c')],'include':_0x5a545b[_0x463f('0x1e')]?_[_0x463f('0x1f')](_0x5a545b[_0x463f('0x1e')],function(_0xc7c0f6){return{'model':db[_0xc7c0f6['model']],'as':_0xc7c0f6['as'],'attributes':_0xc7c0f6[_0x463f('0x1c')],'include':_0xc7c0f6[_0x463f('0x1e')]?_[_0x463f('0x1f')](_0xc7c0f6['include'],function(_0x3ac34b){return{'model':db[_0x3ac34b['model']],'as':_0x3ac34b['as'],'attributes':_0x3ac34b[_0x463f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b9e8c){logger[_0x463f('0xe')](_0x463f('0x22'),_0x4721e8);logger[_0x463f('0x21')]('ShowServicenowAccount',_0x4721e8,JSON[_0x463f('0x12')](_0x4b9e8c));_0x5c3dda(_0x4b9e8c);})[_0x463f('0x17')](function(_0x53fd3d){logger[_0x463f('0x13')](_0x463f('0x22'),_0x53fd3d['message'],_0x4721e8);_0x572389(_0x2386cc[_0x463f('0x13')](0x1f4,_0x53fd3d[_0x463f('0x15')]));});});}; \ No newline at end of file +var _0x4d18=['model','ShowServicenowAccount','find','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x231c4d,_0x514bfe){var _0x1458fe=function(_0x5c2668){while(--_0x5c2668){_0x231c4d['push'](_0x231c4d['shift']());}};_0x1458fe(++_0x514bfe);}(_0x4d18,0x135));var _0x84d1=function(_0x12472c,_0x5b9c12){_0x12472c=_0x12472c-0x0;var _0x52c35a=_0x4d18[_0x12472c];return _0x52c35a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x84d1('0x0'));var BPromise=require(_0x84d1('0x1'));var rs=require(_0x84d1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84d1('0x3'))['db'];var utils=require(_0x84d1('0x4'));var logger=require(_0x84d1('0x5'))('rpc');var config=require(_0x84d1('0x6'));var jayson=require(_0x84d1('0x7'));var client=jayson['client'][_0x84d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x116526,_0x1a398a,_0x5589bf){return new BPromise(function(_0x495741,_0x4a16d8){return client['request'](_0x116526,_0x5589bf)[_0x84d1('0x9')](function(_0x2719e6){logger[_0x84d1('0xa')](_0x84d1('0xb'),_0x1a398a,_0x84d1('0xc'));logger[_0x84d1('0xd')](_0x84d1('0xe'),_0x1a398a,'request\x20sent',JSON[_0x84d1('0xf')](_0x2719e6));if(_0x2719e6[_0x84d1('0x10')]){if(_0x2719e6['error'][_0x84d1('0x11')]===0x1f4){logger[_0x84d1('0x10')](_0x84d1('0xb'),_0x1a398a,_0x2719e6['error']['message']);return _0x4a16d8(_0x2719e6[_0x84d1('0x10')][_0x84d1('0x12')]);}logger[_0x84d1('0x10')](_0x84d1('0xb'),_0x1a398a,_0x2719e6[_0x84d1('0x10')][_0x84d1('0x12')]);return _0x495741(_0x2719e6[_0x84d1('0x10')][_0x84d1('0x12')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x1a398a,_0x84d1('0xc'));_0x495741(_0x2719e6[_0x84d1('0x13')]['message']);}})[_0x84d1('0x14')](function(_0x3efed4){logger[_0x84d1('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x1a398a,_0x3efed4);_0x4a16d8(_0x3efed4);});});}exports[_0x84d1('0x15')]=function(_0x4a6e78){var _0x3a2790=this;return new Promise(function(_0x18163b,_0x85c6aa){return db[_0x84d1('0x16')][_0x84d1('0x17')]({'raw':_0x4a6e78[_0x84d1('0x18')]?_0x4a6e78[_0x84d1('0x18')][_0x84d1('0x19')]===undefined?!![]:![]:!![],'where':_0x4a6e78[_0x84d1('0x18')]?_0x4a6e78[_0x84d1('0x18')][_0x84d1('0x1a')]||null:null,'attributes':_0x4a6e78[_0x84d1('0x18')]?_0x4a6e78[_0x84d1('0x18')][_0x84d1('0x1b')]||null:null,'limit':_0x4a6e78[_0x84d1('0x18')]?_0x4a6e78[_0x84d1('0x18')][_0x84d1('0x1c')]||null:null,'include':_0x4a6e78['options']?_0x4a6e78[_0x84d1('0x18')]['include']?_[_0x84d1('0x1d')](_0x4a6e78[_0x84d1('0x18')][_0x84d1('0x1e')],function(_0x3d3115){return{'model':db[_0x3d3115[_0x84d1('0x1f')]],'as':_0x3d3115['as'],'attributes':_0x3d3115['attributes'],'include':_0x3d3115['include']?_[_0x84d1('0x1d')](_0x3d3115[_0x84d1('0x1e')],function(_0x3cff54){return{'model':db[_0x3cff54[_0x84d1('0x1f')]],'as':_0x3cff54['as'],'attributes':_0x3cff54[_0x84d1('0x1b')],'include':_0x3cff54[_0x84d1('0x1e')]?_[_0x84d1('0x1d')](_0x3cff54[_0x84d1('0x1e')],function(_0x271127){return{'model':db[_0x271127[_0x84d1('0x1f')]],'as':_0x271127['as'],'attributes':_0x271127[_0x84d1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x84d1('0x9')](function(_0x10558b){logger['info'](_0x84d1('0x15'),_0x4a6e78);logger[_0x84d1('0xd')](_0x84d1('0x15'),_0x4a6e78,JSON['stringify'](_0x10558b));_0x18163b(_0x10558b);})[_0x84d1('0x14')](function(_0x701e7f){logger['error'](_0x84d1('0x15'),_0x701e7f['message'],_0x4a6e78);_0x85c6aa(_0x3a2790['error'](0x1f4,_0x701e7f[_0x84d1('0x12')]));});});};exports[_0x84d1('0x20')]=function(_0x496b01){var _0x1b7e6c=this;return new Promise(function(_0xefd33a,_0x2a222d){return db[_0x84d1('0x16')][_0x84d1('0x21')]({'raw':_0x496b01['options']?_0x496b01[_0x84d1('0x18')][_0x84d1('0x19')]===undefined?!![]:![]:!![],'where':_0x496b01['options']?_0x496b01['options']['where']||null:null,'attributes':_0x496b01[_0x84d1('0x18')]?_0x496b01[_0x84d1('0x18')][_0x84d1('0x1b')]||null:null,'include':_0x496b01[_0x84d1('0x18')]?_0x496b01[_0x84d1('0x18')][_0x84d1('0x1e')]?_[_0x84d1('0x1d')](_0x496b01[_0x84d1('0x18')][_0x84d1('0x1e')],function(_0x159014){return{'model':db[_0x159014['model']],'as':_0x159014['as'],'attributes':_0x159014[_0x84d1('0x1b')],'include':_0x159014[_0x84d1('0x1e')]?_[_0x84d1('0x1d')](_0x159014[_0x84d1('0x1e')],function(_0x234bc8){return{'model':db[_0x234bc8[_0x84d1('0x1f')]],'as':_0x234bc8['as'],'attributes':_0x234bc8['attributes'],'include':_0x234bc8[_0x84d1('0x1e')]?_[_0x84d1('0x1d')](_0x234bc8[_0x84d1('0x1e')],function(_0x4c654d){return{'model':db[_0x4c654d[_0x84d1('0x1f')]],'as':_0x4c654d['as'],'attributes':_0x4c654d[_0x84d1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x84d1('0x9')](function(_0xf7da5e){logger[_0x84d1('0xa')]('ShowServicenowAccount',_0x496b01);logger[_0x84d1('0xd')](_0x84d1('0x20'),_0x496b01,JSON[_0x84d1('0xf')](_0xf7da5e));_0xefd33a(_0xf7da5e);})[_0x84d1('0x14')](function(_0x316b48){logger[_0x84d1('0x10')](_0x84d1('0x20'),_0x316b48[_0x84d1('0x12')],_0x496b01);_0x2a222d(_0x1b7e6c[_0x84d1('0x10')](0x1f4,_0x316b48[_0x84d1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 7bcb562..a9e1859 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 _0x7755=['isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','index','get','/:id'];(function(_0x5671bb,_0x1f247e){var _0x40a5ec=function(_0x2def96){while(--_0x2def96){_0x5671bb['push'](_0x5671bb['shift']());}};_0x40a5ec(++_0x1f247e);}(_0x7755,0x109));var _0x5775=function(_0x16ca8e,_0x60f267){_0x16ca8e=_0x16ca8e-0x0;var _0x4c560e=_0x7755[_0x16ca8e];return _0x4c560e;};'use strict';var multer=require(_0x5775('0x0'));var util=require('util');var path=require(_0x5775('0x1'));var timeout=require('connect-timeout');var express=require(_0x5775('0x2'));var router=express['Router']();var fs_extra=require(_0x5775('0x3'));var auth=require(_0x5775('0x4'));var interaction=require(_0x5775('0x5'));var config=require(_0x5775('0x6'));var controller=require(_0x5775('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5775('0x8')]);router[_0x5775('0x9')](_0x5775('0xa'),auth[_0x5775('0xb')](),controller['show']);router['get'](_0x5775('0xc'),auth[_0x5775('0xb')](),controller[_0x5775('0xd')]);router[_0x5775('0x9')](_0x5775('0xe'),auth[_0x5775('0xb')](),controller[_0x5775('0xf')]);router[_0x5775('0x9')](_0x5775('0x10'),auth[_0x5775('0xb')](),controller[_0x5775('0x11')]);router[_0x5775('0x12')]('/',auth[_0x5775('0xb')](),controller[_0x5775('0x13')]);router[_0x5775('0x14')](_0x5775('0xa'),auth[_0x5775('0xb')](),controller[_0x5775('0x15')]);router['delete'](_0x5775('0xa'),auth['isAuthenticated'](),controller[_0x5775('0x16')]);module['exports']=router; \ No newline at end of file +var _0x8839=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x412945,_0xc93eeb){var _0x3b4f8c=function(_0x216b48){while(--_0x216b48){_0x412945['push'](_0x412945['shift']());}};_0x3b4f8c(++_0xc93eeb);}(_0x8839,0x162));var _0x9883=function(_0x141c5f,_0x3bf654){_0x141c5f=_0x141c5f-0x0;var _0x3e83c9=_0x8839[_0x141c5f];return _0x3e83c9;};'use strict';var multer=require(_0x9883('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9883('0x1'));var express=require(_0x9883('0x2'));var router=express[_0x9883('0x3')]();var fs_extra=require(_0x9883('0x4'));var auth=require(_0x9883('0x5'));var interaction=require(_0x9883('0x6'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0x9883('0x7')]('/',auth[_0x9883('0x8')](),controller[_0x9883('0x9')]);router[_0x9883('0x7')](_0x9883('0xa'),auth[_0x9883('0x8')](),controller[_0x9883('0xb')]);router['get'](_0x9883('0xc'),auth['isAuthenticated'](),controller[_0x9883('0xd')]);router[_0x9883('0x7')](_0x9883('0xe'),auth[_0x9883('0x8')](),controller[_0x9883('0xf')]);router[_0x9883('0x7')](_0x9883('0x10'),auth[_0x9883('0x8')](),controller[_0x9883('0x11')]);router[_0x9883('0x12')]('/',auth[_0x9883('0x8')](),controller[_0x9883('0x13')]);router[_0x9883('0x14')](_0x9883('0xa'),auth[_0x9883('0x8')](),controller['update']);router[_0x9883('0x15')]('/:id',auth[_0x9883('0x8')](),controller[_0x9883('0x16')]);module[_0x9883('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index dde57fd..53b9067 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 _0xce6b=['sequelize','exports','STRING'];(function(_0x50cc54,_0x54c15f){var _0x28ecca=function(_0x4eff92){while(--_0x4eff92){_0x50cc54['push'](_0x50cc54['shift']());}};_0x28ecca(++_0x54c15f);}(_0xce6b,0xc9));var _0xbce6=function(_0x34ce22,_0x36dd88){_0x34ce22=_0x34ce22-0x0;var _0x1874ff=_0xce6b[_0x34ce22];return _0x1874ff;};'use strict';var Sequelize=require(_0xbce6('0x0'));module[_0xbce6('0x1')]={'name':{'type':Sequelize[_0xbce6('0x2')]},'description':{'type':Sequelize[_0xbce6('0x2')]}}; \ No newline at end of file +var _0x6ba0=['STRING','sequelize'];(function(_0x2071e6,_0x20fd63){var _0x4d07c5=function(_0x4b8c5c){while(--_0x4b8c5c){_0x2071e6['push'](_0x2071e6['shift']());}};_0x4d07c5(++_0x20fd63);}(_0x6ba0,0xf7));var _0x06ba=function(_0x12dc5b,_0x1ec0ce){_0x12dc5b=_0x12dc5b-0x0;var _0x195263=_0x6ba0[_0x12dc5b];return _0x195263;};'use strict';var Sequelize=require(_0x06ba('0x0'));module['exports']={'name':{'type':Sequelize[_0x06ba('0x1')]},'description':{'type':Sequelize[_0x06ba('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index cad0371..5b04120 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 _0xf737=['Content-Range','apply','reject','save','then','error','stack','name','send','index','ServicenowConfiguration','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','options','includeAll','findAll','rows','show','params','keys','rawAttributes','length','include','find','catch','create','update','body','destroy','getFields','findOne','ServicenowField','order','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xf737,0x1c1));var _0x7f73=function(_0xeeb1bc,_0x2eb039){_0xeeb1bc=_0xeeb1bc-0x0;var _0x53320d=_0xf737[_0xeeb1bc];return _0x53320d;};'use strict';var emlformat=require(_0x7f73('0x0'));var rimraf=require(_0x7f73('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f73('0x2'));var rp=require(_0x7f73('0x3'));var moment=require(_0x7f73('0x4'));var BPromise=require(_0x7f73('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7f73('0x6'));var sox=require(_0x7f73('0x7'));var csv=require(_0x7f73('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f73('0x9'));var _=require('lodash');var squel=require(_0x7f73('0xa'));var crypto=require(_0x7f73('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7f73('0xc'));var toCsv=require(_0x7f73('0x8'));var querystring=require(_0x7f73('0xd'));var Papa=require('papaparse');var Redis=require(_0x7f73('0xe'));var authService=require(_0x7f73('0xf'));var qs=require(_0x7f73('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f73('0x11'));var logger=require(_0x7f73('0x12'))(_0x7f73('0x13'));var utils=require(_0x7f73('0x14'));var config=require(_0x7f73('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f73('0x16'))['db'];function respondWithStatusCode(_0x3d0e39,_0x2551c4){_0x2551c4=_0x2551c4||0xcc;return function(_0x1c4ce6){if(_0x1c4ce6){return _0x3d0e39['sendStatus'](_0x2551c4);}return _0x3d0e39[_0x7f73('0x17')](_0x2551c4)[_0x7f73('0x18')]();};}function respondWithResult(_0x46d2c5,_0x20ae24){_0x20ae24=_0x20ae24||0xc8;return function(_0x2fb6b7){if(_0x2fb6b7){return _0x46d2c5[_0x7f73('0x17')](_0x20ae24)[_0x7f73('0x19')](_0x2fb6b7);}};}function respondWithFilteredResult(_0x82ff6a,_0x44534a){return function(_0x4f2430){if(_0x4f2430){var _0x5d4c29=typeof _0x44534a[_0x7f73('0x1a')]===_0x7f73('0x1b')&&typeof _0x44534a[_0x7f73('0x1c')]==='undefined';var _0xd46c32=_0x4f2430[_0x7f73('0x1d')];var _0x3233e3=_0x5d4c29?0x0:_0x44534a[_0x7f73('0x1a')];var _0xd21817=_0x5d4c29?_0x4f2430[_0x7f73('0x1d')]:_0x44534a[_0x7f73('0x1a')]+_0x44534a[_0x7f73('0x1c')];var _0xbf44c5;if(_0xd21817>=_0xd46c32){_0xd21817=_0xd46c32;_0xbf44c5=0xc8;}else{_0xbf44c5=0xce;}_0x82ff6a[_0x7f73('0x17')](_0xbf44c5);return _0x82ff6a[_0x7f73('0x1e')](_0x7f73('0x1f'),_0x3233e3+'-'+_0xd21817+'/'+_0xd46c32)[_0x7f73('0x19')](_0x4f2430);}return null;};}function patchUpdates(_0x21cf6d){return function(_0x55a915){try{jsonpatch[_0x7f73('0x20')](_0x55a915,_0x21cf6d,!![]);}catch(_0x2a2032){return BPromise[_0x7f73('0x21')](_0x2a2032);}return _0x55a915[_0x7f73('0x22')]();};}function saveUpdates(_0x40eb21,_0x4b0107){return function(_0x578545){if(_0x578545){return _0x578545['update'](_0x40eb21)[_0x7f73('0x23')](function(_0x281840){return _0x281840;});}return null;};}function removeEntity(_0x3a1a38,_0x3d847d){return function(_0x1b60f0){if(_0x1b60f0){return _0x1b60f0['destroy']()[_0x7f73('0x23')](function(){_0x3a1a38[_0x7f73('0x17')](0xcc)[_0x7f73('0x18')]();});}};}function handleEntityNotFound(_0x45271a,_0x562010){return function(_0x47a4e3){if(!_0x47a4e3){_0x45271a['sendStatus'](0x194);}return _0x47a4e3;};}function handleError(_0x4903f2,_0x5bea29){_0x5bea29=_0x5bea29||0x1f4;return function(_0x5a21fc){logger[_0x7f73('0x24')](_0x5a21fc[_0x7f73('0x25')]);if(_0x5a21fc[_0x7f73('0x26')]){delete _0x5a21fc[_0x7f73('0x26')];}_0x4903f2[_0x7f73('0x17')](_0x5bea29)[_0x7f73('0x27')](_0x5a21fc);};}exports[_0x7f73('0x28')]=function(_0x197f46,_0x189e6b){var _0x2052e8={},_0x37b8fa={},_0x510f45={'count':0x0,'rows':[]};var _0x43c418=_['map'](db[_0x7f73('0x29')]['rawAttributes'],function(_0x2c490a){return{'name':_0x2c490a[_0x7f73('0x2a')],'type':_0x2c490a['type']['key']};});_0x37b8fa[_0x7f73('0x2b')]=_['map'](_0x43c418,_0x7f73('0x26'));_0x37b8fa[_0x7f73('0x2c')]=_['keys'](_0x197f46[_0x7f73('0x2c')]);_0x37b8fa[_0x7f73('0x2d')]=_[_0x7f73('0x2e')](_0x37b8fa[_0x7f73('0x2b')],_0x37b8fa[_0x7f73('0x2c')]);_0x2052e8[_0x7f73('0x2f')]=_['intersection'](_0x37b8fa[_0x7f73('0x2b')],qs[_0x7f73('0x30')](_0x197f46[_0x7f73('0x2c')][_0x7f73('0x30')]));_0x2052e8[_0x7f73('0x2f')]=_0x2052e8[_0x7f73('0x2f')]['length']?_0x2052e8[_0x7f73('0x2f')]:_0x37b8fa['model'];if(!_0x197f46[_0x7f73('0x2c')][_0x7f73('0x31')](_0x7f73('0x32'))){_0x2052e8['limit']=qs['limit'](_0x197f46[_0x7f73('0x2c')][_0x7f73('0x1c')]);_0x2052e8[_0x7f73('0x1a')]=qs[_0x7f73('0x1a')](_0x197f46['query'][_0x7f73('0x1a')]);}_0x2052e8['order']=qs[_0x7f73('0x33')](_0x197f46['query'][_0x7f73('0x33')]);_0x2052e8['where']=qs[_0x7f73('0x2d')](_[_0x7f73('0x34')](_0x197f46['query'],_0x37b8fa[_0x7f73('0x2d')]),_0x43c418);if(_0x197f46[_0x7f73('0x2c')][_0x7f73('0x35')]){_0x2052e8[_0x7f73('0x36')]=_[_0x7f73('0x37')](_0x2052e8[_0x7f73('0x36')],{'$or':_[_0x7f73('0x38')](_0x43c418,function(_0x17efd3){if(_0x17efd3[_0x7f73('0x39')]!=='VIRTUAL'){var _0x2df2a7={};_0x2df2a7[_0x17efd3[_0x7f73('0x26')]]={'$like':'%'+_0x197f46[_0x7f73('0x2c')][_0x7f73('0x35')]+'%'};return _0x2df2a7;}})});}_0x2052e8=_[_0x7f73('0x37')]({},_0x2052e8,_0x197f46[_0x7f73('0x3a')]);var _0x1c5f5b={'where':_0x2052e8[_0x7f73('0x36')]};return db[_0x7f73('0x29')][_0x7f73('0x1d')](_0x1c5f5b)[_0x7f73('0x23')](function(_0xb97bc4){_0x510f45['count']=_0xb97bc4;if(_0x197f46['query'][_0x7f73('0x3b')]){_0x2052e8['include']=[{'all':!![]}];}return db[_0x7f73('0x29')][_0x7f73('0x3c')](_0x2052e8);})[_0x7f73('0x23')](function(_0x3f1840){_0x510f45[_0x7f73('0x3d')]=_0x3f1840;return _0x510f45;})[_0x7f73('0x23')](respondWithFilteredResult(_0x189e6b,_0x2052e8))['catch'](handleError(_0x189e6b,null));};exports[_0x7f73('0x3e')]=function(_0x3892fa,_0x5d25f5){var _0x1f66a4={'raw':![],'where':{'id':_0x3892fa[_0x7f73('0x3f')]['id']}},_0x112728={};_0x112728[_0x7f73('0x2b')]=_[_0x7f73('0x40')](db[_0x7f73('0x29')][_0x7f73('0x41')]);_0x112728[_0x7f73('0x2c')]=_[_0x7f73('0x40')](_0x3892fa[_0x7f73('0x2c')]);_0x112728[_0x7f73('0x2d')]=_[_0x7f73('0x2e')](_0x112728['model'],_0x112728[_0x7f73('0x2c')]);_0x1f66a4[_0x7f73('0x2f')]=_['intersection'](_0x112728['model'],qs[_0x7f73('0x30')](_0x3892fa['query'][_0x7f73('0x30')]));_0x1f66a4[_0x7f73('0x2f')]=_0x1f66a4[_0x7f73('0x2f')][_0x7f73('0x42')]?_0x1f66a4['attributes']:_0x112728[_0x7f73('0x2b')];if(_0x3892fa[_0x7f73('0x2c')][_0x7f73('0x3b')]){_0x1f66a4[_0x7f73('0x43')]=[{'all':!![]}];}_0x1f66a4=_[_0x7f73('0x37')]({},_0x1f66a4,_0x3892fa[_0x7f73('0x3a')]);return db[_0x7f73('0x29')][_0x7f73('0x44')](_0x1f66a4)[_0x7f73('0x23')](handleEntityNotFound(_0x5d25f5,null))['then'](respondWithResult(_0x5d25f5,null))[_0x7f73('0x45')](handleError(_0x5d25f5,null));};exports[_0x7f73('0x46')]=function(_0x24bcd5,_0x486747){return db[_0x7f73('0x29')]['create'](_0x24bcd5['body'],{})[_0x7f73('0x23')](respondWithResult(_0x486747,0xc9))[_0x7f73('0x45')](handleError(_0x486747,null));};exports[_0x7f73('0x47')]=function(_0x3af659,_0x8ad04c){if(_0x3af659[_0x7f73('0x48')]['id']){delete _0x3af659[_0x7f73('0x48')]['id'];}return db[_0x7f73('0x29')][_0x7f73('0x44')]({'where':{'id':_0x3af659['params']['id']}})[_0x7f73('0x23')](handleEntityNotFound(_0x8ad04c,null))[_0x7f73('0x23')](saveUpdates(_0x3af659[_0x7f73('0x48')],null))[_0x7f73('0x23')](respondWithResult(_0x8ad04c,null))[_0x7f73('0x45')](handleError(_0x8ad04c,null));};exports[_0x7f73('0x49')]=function(_0x4b9026,_0x295805){return db[_0x7f73('0x29')][_0x7f73('0x44')]({'where':{'id':_0x4b9026[_0x7f73('0x3f')]['id']}})[_0x7f73('0x23')](handleEntityNotFound(_0x295805,null))[_0x7f73('0x23')](removeEntity(_0x295805,null))[_0x7f73('0x45')](handleError(_0x295805,null));};exports[_0x7f73('0x4a')]=function(_0x4e0592,_0x551847,_0x4a6b3a){var _0xac19c={};var _0x81daa9={};var _0x45075f;var _0x519519;return db['ServicenowConfiguration'][_0x7f73('0x4b')]({'where':{'id':_0x4e0592[_0x7f73('0x3f')]['id']}})[_0x7f73('0x23')](handleEntityNotFound(_0x551847,null))[_0x7f73('0x23')](function(_0x4d542d){if(_0x4d542d){_0x45075f=_0x4d542d;_0x81daa9[_0x7f73('0x2b')]=_[_0x7f73('0x40')](db[_0x7f73('0x4c')][_0x7f73('0x41')]);_0x81daa9[_0x7f73('0x2c')]=_[_0x7f73('0x40')](_0x4e0592[_0x7f73('0x2c')]);_0x81daa9['filters']=_[_0x7f73('0x2e')](_0x81daa9[_0x7f73('0x2b')],_0x81daa9[_0x7f73('0x2c')]);_0xac19c[_0x7f73('0x2f')]=_[_0x7f73('0x2e')](_0x81daa9[_0x7f73('0x2b')],qs[_0x7f73('0x30')](_0x4e0592[_0x7f73('0x2c')]['fields']));_0xac19c[_0x7f73('0x2f')]=_0xac19c[_0x7f73('0x2f')]['length']?_0xac19c['attributes']:_0x81daa9[_0x7f73('0x2b')];_0xac19c[_0x7f73('0x4d')]=qs[_0x7f73('0x33')](_0x4e0592[_0x7f73('0x2c')][_0x7f73('0x33')]);_0xac19c[_0x7f73('0x36')]=qs['filters'](_['pick'](_0x4e0592[_0x7f73('0x2c')],_0x81daa9[_0x7f73('0x2d')]));if(_0x4e0592[_0x7f73('0x2c')]['filter']){_0xac19c[_0x7f73('0x36')]=_[_0x7f73('0x37')](_0xac19c[_0x7f73('0x36')],{'$or':_[_0x7f73('0x38')](_0xac19c[_0x7f73('0x2f')],function(_0x5ed547){var _0x48ac36={};_0x48ac36[_0x5ed547]={'$like':'%'+_0x4e0592[_0x7f73('0x2c')][_0x7f73('0x35')]+'%'};return _0x48ac36;})});}_0xac19c=_['merge']({},_0xac19c,_0x4e0592[_0x7f73('0x3a')]);return _0x45075f['getFields'](_0xac19c);}})[_0x7f73('0x23')](function(_0x1289e7){if(_0x1289e7){_0x519519=_0x1289e7[_0x7f73('0x42')];if(!_0x4e0592['query'][_0x7f73('0x31')](_0x7f73('0x32'))){_0xac19c['limit']=qs[_0x7f73('0x1c')](_0x4e0592[_0x7f73('0x2c')][_0x7f73('0x1c')]);_0xac19c[_0x7f73('0x1a')]=qs[_0x7f73('0x1a')](_0x4e0592[_0x7f73('0x2c')][_0x7f73('0x1a')]);}return _0x45075f[_0x7f73('0x4a')](_0xac19c);}})[_0x7f73('0x23')](function(_0x36f4b8){if(_0x36f4b8){return _0x36f4b8?{'count':_0x519519,'rows':_0x36f4b8}:null;}})['then'](respondWithResult(_0x551847,null))['catch'](handleError(_0x551847,null));};exports[_0x7f73('0x4e')]=function(_0x158691,_0x283974,_0x5ad51b){var _0xdb1578={};var _0x456313={};var _0x15930b;var _0x3e83ab;return db[_0x7f73('0x29')]['findOne']({'where':{'id':_0x158691[_0x7f73('0x3f')]['id']}})[_0x7f73('0x23')](handleEntityNotFound(_0x283974,null))[_0x7f73('0x23')](function(_0x2f29fe){if(_0x2f29fe){_0x15930b=_0x2f29fe;_0x456313[_0x7f73('0x2b')]=_[_0x7f73('0x40')](db['ServicenowField']['rawAttributes']);_0x456313[_0x7f73('0x2c')]=_[_0x7f73('0x40')](_0x158691[_0x7f73('0x2c')]);_0x456313[_0x7f73('0x2d')]=_[_0x7f73('0x2e')](_0x456313[_0x7f73('0x2b')],_0x456313['query']);_0xdb1578[_0x7f73('0x2f')]=_[_0x7f73('0x2e')](_0x456313[_0x7f73('0x2b')],qs[_0x7f73('0x30')](_0x158691['query'][_0x7f73('0x30')]));_0xdb1578[_0x7f73('0x2f')]=_0xdb1578[_0x7f73('0x2f')][_0x7f73('0x42')]?_0xdb1578['attributes']:_0x456313[_0x7f73('0x2b')];_0xdb1578['order']=qs[_0x7f73('0x33')](_0x158691['query'][_0x7f73('0x33')]);_0xdb1578[_0x7f73('0x36')]=qs['filters'](_[_0x7f73('0x34')](_0x158691['query'],_0x456313[_0x7f73('0x2d')]));if(_0x158691['query'][_0x7f73('0x35')]){_0xdb1578[_0x7f73('0x36')]=_[_0x7f73('0x37')](_0xdb1578[_0x7f73('0x36')],{'$or':_[_0x7f73('0x38')](_0xdb1578[_0x7f73('0x2f')],function(_0x136dda){var _0x2dc6c0={};_0x2dc6c0[_0x136dda]={'$like':'%'+_0x158691[_0x7f73('0x2c')]['filter']+'%'};return _0x2dc6c0;})});}_0xdb1578=_[_0x7f73('0x37')]({},_0xdb1578,_0x158691[_0x7f73('0x3a')]);return _0x15930b[_0x7f73('0x4e')](_0xdb1578);}})[_0x7f73('0x23')](function(_0x2c0a51){if(_0x2c0a51){_0x3e83ab=_0x2c0a51[_0x7f73('0x42')];if(!_0x158691[_0x7f73('0x2c')][_0x7f73('0x31')](_0x7f73('0x32'))){_0xdb1578[_0x7f73('0x1c')]=qs['limit'](_0x158691[_0x7f73('0x2c')][_0x7f73('0x1c')]);_0xdb1578['offset']=qs[_0x7f73('0x1a')](_0x158691[_0x7f73('0x2c')][_0x7f73('0x1a')]);}return _0x15930b[_0x7f73('0x4e')](_0xdb1578);}})[_0x7f73('0x23')](function(_0xb8d17c){if(_0xb8d17c){return _0xb8d17c?{'count':_0x3e83ab,'rows':_0xb8d17c}:null;}})[_0x7f73('0x23')](respondWithResult(_0x283974,null))[_0x7f73('0x45')](handleError(_0x283974,null));};exports[_0x7f73('0x4f')]=function(_0xfd493d,_0x117ced,_0x314e07){var _0x166693={};var _0x49e912={};var _0x34aaab;var _0x154870;return db[_0x7f73('0x29')][_0x7f73('0x4b')]({'where':{'id':_0xfd493d[_0x7f73('0x3f')]['id']}})[_0x7f73('0x23')](handleEntityNotFound(_0x117ced,null))[_0x7f73('0x23')](function(_0x2f7b4b){if(_0x2f7b4b){_0x34aaab=_0x2f7b4b;_0x49e912[_0x7f73('0x2b')]=_['keys'](db[_0x7f73('0x4c')][_0x7f73('0x41')]);_0x49e912[_0x7f73('0x2c')]=_[_0x7f73('0x40')](_0xfd493d[_0x7f73('0x2c')]);_0x49e912[_0x7f73('0x2d')]=_['intersection'](_0x49e912[_0x7f73('0x2b')],_0x49e912[_0x7f73('0x2c')]);_0x166693[_0x7f73('0x2f')]=_[_0x7f73('0x2e')](_0x49e912[_0x7f73('0x2b')],qs['fields'](_0xfd493d[_0x7f73('0x2c')][_0x7f73('0x30')]));_0x166693[_0x7f73('0x2f')]=_0x166693['attributes'][_0x7f73('0x42')]?_0x166693['attributes']:_0x49e912[_0x7f73('0x2b')];_0x166693[_0x7f73('0x4d')]=qs['sort'](_0xfd493d[_0x7f73('0x2c')][_0x7f73('0x33')]);_0x166693[_0x7f73('0x36')]=qs[_0x7f73('0x2d')](_['pick'](_0xfd493d[_0x7f73('0x2c')],_0x49e912[_0x7f73('0x2d')]));if(_0xfd493d['query'][_0x7f73('0x35')]){_0x166693[_0x7f73('0x36')]=_[_0x7f73('0x37')](_0x166693[_0x7f73('0x36')],{'$or':_[_0x7f73('0x38')](_0x166693[_0x7f73('0x2f')],function(_0x142d55){var _0xf6664b={};_0xf6664b[_0x142d55]={'$like':'%'+_0xfd493d['query'][_0x7f73('0x35')]+'%'};return _0xf6664b;})});}_0x166693=_[_0x7f73('0x37')]({},_0x166693,_0xfd493d[_0x7f73('0x3a')]);return _0x34aaab['getDescriptions'](_0x166693);}})[_0x7f73('0x23')](function(_0x2499c1){if(_0x2499c1){_0x154870=_0x2499c1[_0x7f73('0x42')];if(!_0xfd493d['query'][_0x7f73('0x31')](_0x7f73('0x32'))){_0x166693[_0x7f73('0x1c')]=qs[_0x7f73('0x1c')](_0xfd493d[_0x7f73('0x2c')][_0x7f73('0x1c')]);_0x166693['offset']=qs[_0x7f73('0x1a')](_0xfd493d[_0x7f73('0x2c')][_0x7f73('0x1a')]);}return _0x34aaab[_0x7f73('0x4f')](_0x166693);}})[_0x7f73('0x23')](function(_0x50fc78){if(_0x50fc78){return _0x50fc78?{'count':_0x154870,'rows':_0x50fc78}:null;}})[_0x7f73('0x23')](respondWithResult(_0x117ced,null))['catch'](handleError(_0x117ced,null));}; \ No newline at end of file +var _0x3e52=['where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','attributes','options','find','create','body','getFields','findOne','ServicenowField','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv','fs-extra','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','send','map','ServicenowConfiguration','fieldName','type','model','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x21d8b0,_0x1a40aa){var _0x23169a=function(_0x5b4707){while(--_0x5b4707){_0x21d8b0['push'](_0x21d8b0['shift']());}};_0x23169a(++_0x1a40aa);}(_0x3e52,0xfd));var _0x23e5=function(_0x4dac82,_0x33afda){_0x4dac82=_0x4dac82-0x0;var _0x2a1f41=_0x3e52[_0x4dac82];return _0x2a1f41;};'use strict';var emlformat=require(_0x23e5('0x0'));var rimraf=require(_0x23e5('0x1'));var zipdir=require(_0x23e5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23e5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x23e5('0x4'));var util=require(_0x23e5('0x5'));var path=require(_0x23e5('0x6'));var sox=require('sox');var csv=require(_0x23e5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x23e5('0x8'));var _=require('lodash');var squel=require(_0x23e5('0x9'));var crypto=require(_0x23e5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x23e5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x23e5('0xc'));var Papa=require(_0x23e5('0xd'));var Redis=require(_0x23e5('0xe'));var authService=require(_0x23e5('0xf'));var qs=require(_0x23e5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x23e5('0x11'));var logger=require(_0x23e5('0x12'))(_0x23e5('0x13'));var utils=require(_0x23e5('0x14'));var config=require(_0x23e5('0x15'));var licenseUtil=require(_0x23e5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2153bc,_0x577d32){_0x577d32=_0x577d32||0xcc;return function(_0x1dc61a){if(_0x1dc61a){return _0x2153bc['sendStatus'](_0x577d32);}return _0x2153bc[_0x23e5('0x17')](_0x577d32)[_0x23e5('0x18')]();};}function respondWithResult(_0x321d0b,_0x3566f6){_0x3566f6=_0x3566f6||0xc8;return function(_0x2bc173){if(_0x2bc173){return _0x321d0b['status'](_0x3566f6)[_0x23e5('0x19')](_0x2bc173);}};}function respondWithFilteredResult(_0x338b39,_0x179f30){return function(_0x4c5df4){if(_0x4c5df4){var _0x2f05b0=typeof _0x179f30[_0x23e5('0x1a')]===_0x23e5('0x1b')&&typeof _0x179f30[_0x23e5('0x1c')]==='undefined';var _0x363db6=_0x4c5df4['count'];var _0x2e47fb=_0x2f05b0?0x0:_0x179f30['offset'];var _0x456274=_0x2f05b0?_0x4c5df4[_0x23e5('0x1d')]:_0x179f30['offset']+_0x179f30[_0x23e5('0x1c')];var _0x427ec4;if(_0x456274>=_0x363db6){_0x456274=_0x363db6;_0x427ec4=0xc8;}else{_0x427ec4=0xce;}_0x338b39[_0x23e5('0x17')](_0x427ec4);return _0x338b39[_0x23e5('0x1e')](_0x23e5('0x1f'),_0x2e47fb+'-'+_0x456274+'/'+_0x363db6)[_0x23e5('0x19')](_0x4c5df4);}return null;};}function patchUpdates(_0x245bd7){return function(_0x129085){try{jsonpatch[_0x23e5('0x20')](_0x129085,_0x245bd7,!![]);}catch(_0x36c321){return BPromise['reject'](_0x36c321);}return _0x129085[_0x23e5('0x21')]();};}function saveUpdates(_0x4f001c,_0x3f5161){return function(_0xc24fc3){if(_0xc24fc3){return _0xc24fc3[_0x23e5('0x22')](_0x4f001c)['then'](function(_0x26faf1){return _0x26faf1;});}return null;};}function removeEntity(_0x25f048,_0xb8d4af){return function(_0x676f97){if(_0x676f97){return _0x676f97[_0x23e5('0x23')]()[_0x23e5('0x24')](function(){_0x25f048[_0x23e5('0x17')](0xcc)[_0x23e5('0x18')]();});}};}function handleEntityNotFound(_0x366819,_0x4de346){return function(_0x30380c){if(!_0x30380c){_0x366819[_0x23e5('0x25')](0x194);}return _0x30380c;};}function handleError(_0x27a051,_0x3dac38){_0x3dac38=_0x3dac38||0x1f4;return function(_0x245b5f){logger['error'](_0x245b5f[_0x23e5('0x26')]);if(_0x245b5f[_0x23e5('0x27')]){delete _0x245b5f['name'];}_0x27a051[_0x23e5('0x17')](_0x3dac38)[_0x23e5('0x28')](_0x245b5f);};}exports['index']=function(_0x10576c,_0x5dc1ee){var _0xf11560={},_0x3f53a7={},_0x5ee4df={'count':0x0,'rows':[]};var _0x2504cb=_[_0x23e5('0x29')](db[_0x23e5('0x2a')]['rawAttributes'],function(_0x559c7c){return{'name':_0x559c7c[_0x23e5('0x2b')],'type':_0x559c7c[_0x23e5('0x2c')]['key']};});_0x3f53a7[_0x23e5('0x2d')]=_[_0x23e5('0x29')](_0x2504cb,'name');_0x3f53a7[_0x23e5('0x2e')]=_[_0x23e5('0x2f')](_0x10576c[_0x23e5('0x2e')]);_0x3f53a7[_0x23e5('0x30')]=_[_0x23e5('0x31')](_0x3f53a7['model'],_0x3f53a7[_0x23e5('0x2e')]);_0xf11560['attributes']=_[_0x23e5('0x31')](_0x3f53a7[_0x23e5('0x2d')],qs[_0x23e5('0x32')](_0x10576c[_0x23e5('0x2e')][_0x23e5('0x32')]));_0xf11560['attributes']=_0xf11560['attributes'][_0x23e5('0x33')]?_0xf11560['attributes']:_0x3f53a7[_0x23e5('0x2d')];if(!_0x10576c[_0x23e5('0x2e')][_0x23e5('0x34')](_0x23e5('0x35'))){_0xf11560[_0x23e5('0x1c')]=qs[_0x23e5('0x1c')](_0x10576c[_0x23e5('0x2e')][_0x23e5('0x1c')]);_0xf11560[_0x23e5('0x1a')]=qs['offset'](_0x10576c[_0x23e5('0x2e')][_0x23e5('0x1a')]);}_0xf11560['order']=qs[_0x23e5('0x36')](_0x10576c[_0x23e5('0x2e')][_0x23e5('0x36')]);_0xf11560[_0x23e5('0x37')]=qs[_0x23e5('0x30')](_[_0x23e5('0x38')](_0x10576c[_0x23e5('0x2e')],_0x3f53a7['filters']),_0x2504cb);if(_0x10576c[_0x23e5('0x2e')][_0x23e5('0x39')]){_0xf11560[_0x23e5('0x37')]=_[_0x23e5('0x3a')](_0xf11560[_0x23e5('0x37')],{'$or':_['map'](_0x2504cb,function(_0x2576a7){if(_0x2576a7[_0x23e5('0x2c')]!==_0x23e5('0x3b')){var _0x435489={};_0x435489[_0x2576a7[_0x23e5('0x27')]]={'$like':'%'+_0x10576c[_0x23e5('0x2e')][_0x23e5('0x39')]+'%'};return _0x435489;}})});}_0xf11560=_[_0x23e5('0x3a')]({},_0xf11560,_0x10576c['options']);var _0xe0614f={'where':_0xf11560[_0x23e5('0x37')]};return db[_0x23e5('0x2a')][_0x23e5('0x1d')](_0xe0614f)[_0x23e5('0x24')](function(_0x489310){_0x5ee4df[_0x23e5('0x1d')]=_0x489310;if(_0x10576c['query'][_0x23e5('0x3c')]){_0xf11560[_0x23e5('0x3d')]=[{'all':!![]}];}return db[_0x23e5('0x2a')]['findAll'](_0xf11560);})['then'](function(_0x1d9503){_0x5ee4df['rows']=_0x1d9503;return _0x5ee4df;})[_0x23e5('0x24')](respondWithFilteredResult(_0x5dc1ee,_0xf11560))[_0x23e5('0x3e')](handleError(_0x5dc1ee,null));};exports[_0x23e5('0x3f')]=function(_0x4f453b,_0x12e987){var _0x5593ab={'raw':![],'where':{'id':_0x4f453b[_0x23e5('0x40')]['id']}},_0x2ce83e={};_0x2ce83e[_0x23e5('0x2d')]=_[_0x23e5('0x2f')](db[_0x23e5('0x2a')][_0x23e5('0x41')]);_0x2ce83e[_0x23e5('0x2e')]=_[_0x23e5('0x2f')](_0x4f453b[_0x23e5('0x2e')]);_0x2ce83e[_0x23e5('0x30')]=_[_0x23e5('0x31')](_0x2ce83e['model'],_0x2ce83e['query']);_0x5593ab[_0x23e5('0x42')]=_['intersection'](_0x2ce83e['model'],qs[_0x23e5('0x32')](_0x4f453b['query'][_0x23e5('0x32')]));_0x5593ab[_0x23e5('0x42')]=_0x5593ab[_0x23e5('0x42')]['length']?_0x5593ab[_0x23e5('0x42')]:_0x2ce83e[_0x23e5('0x2d')];if(_0x4f453b[_0x23e5('0x2e')][_0x23e5('0x3c')]){_0x5593ab[_0x23e5('0x3d')]=[{'all':!![]}];}_0x5593ab=_['merge']({},_0x5593ab,_0x4f453b[_0x23e5('0x43')]);return db[_0x23e5('0x2a')][_0x23e5('0x44')](_0x5593ab)[_0x23e5('0x24')](handleEntityNotFound(_0x12e987,null))[_0x23e5('0x24')](respondWithResult(_0x12e987,null))[_0x23e5('0x3e')](handleError(_0x12e987,null));};exports[_0x23e5('0x45')]=function(_0x279892,_0x1d2a1){return db[_0x23e5('0x2a')][_0x23e5('0x45')](_0x279892['body'],{})[_0x23e5('0x24')](respondWithResult(_0x1d2a1,0xc9))[_0x23e5('0x3e')](handleError(_0x1d2a1,null));};exports[_0x23e5('0x22')]=function(_0x356e4a,_0x50d0a7){if(_0x356e4a[_0x23e5('0x46')]['id']){delete _0x356e4a[_0x23e5('0x46')]['id'];}return db[_0x23e5('0x2a')]['find']({'where':{'id':_0x356e4a[_0x23e5('0x40')]['id']}})['then'](handleEntityNotFound(_0x50d0a7,null))[_0x23e5('0x24')](saveUpdates(_0x356e4a['body'],null))[_0x23e5('0x24')](respondWithResult(_0x50d0a7,null))[_0x23e5('0x3e')](handleError(_0x50d0a7,null));};exports[_0x23e5('0x23')]=function(_0x3ac06b,_0x211629){return db['ServicenowConfiguration']['find']({'where':{'id':_0x3ac06b[_0x23e5('0x40')]['id']}})[_0x23e5('0x24')](handleEntityNotFound(_0x211629,null))[_0x23e5('0x24')](removeEntity(_0x211629,null))[_0x23e5('0x3e')](handleError(_0x211629,null));};exports[_0x23e5('0x47')]=function(_0x4964cb,_0x28a847,_0x52bdae){var _0x5e1630={};var _0x5087a1={};var _0x12c9d3;var _0x2e3b7c;return db[_0x23e5('0x2a')][_0x23e5('0x48')]({'where':{'id':_0x4964cb[_0x23e5('0x40')]['id']}})['then'](handleEntityNotFound(_0x28a847,null))[_0x23e5('0x24')](function(_0x595cc2){if(_0x595cc2){_0x12c9d3=_0x595cc2;_0x5087a1[_0x23e5('0x2d')]=_[_0x23e5('0x2f')](db['ServicenowField']['rawAttributes']);_0x5087a1[_0x23e5('0x2e')]=_[_0x23e5('0x2f')](_0x4964cb['query']);_0x5087a1[_0x23e5('0x30')]=_['intersection'](_0x5087a1['model'],_0x5087a1[_0x23e5('0x2e')]);_0x5e1630[_0x23e5('0x42')]=_['intersection'](_0x5087a1[_0x23e5('0x2d')],qs[_0x23e5('0x32')](_0x4964cb['query']['fields']));_0x5e1630[_0x23e5('0x42')]=_0x5e1630[_0x23e5('0x42')][_0x23e5('0x33')]?_0x5e1630[_0x23e5('0x42')]:_0x5087a1[_0x23e5('0x2d')];_0x5e1630['order']=qs[_0x23e5('0x36')](_0x4964cb[_0x23e5('0x2e')][_0x23e5('0x36')]);_0x5e1630[_0x23e5('0x37')]=qs[_0x23e5('0x30')](_[_0x23e5('0x38')](_0x4964cb[_0x23e5('0x2e')],_0x5087a1[_0x23e5('0x30')]));if(_0x4964cb[_0x23e5('0x2e')][_0x23e5('0x39')]){_0x5e1630['where']=_[_0x23e5('0x3a')](_0x5e1630[_0x23e5('0x37')],{'$or':_[_0x23e5('0x29')](_0x5e1630[_0x23e5('0x42')],function(_0x280dd5){var _0x8a6b48={};_0x8a6b48[_0x280dd5]={'$like':'%'+_0x4964cb[_0x23e5('0x2e')][_0x23e5('0x39')]+'%'};return _0x8a6b48;})});}_0x5e1630=_[_0x23e5('0x3a')]({},_0x5e1630,_0x4964cb[_0x23e5('0x43')]);return _0x12c9d3[_0x23e5('0x47')](_0x5e1630);}})[_0x23e5('0x24')](function(_0x53a303){if(_0x53a303){_0x2e3b7c=_0x53a303[_0x23e5('0x33')];if(!_0x4964cb['query'][_0x23e5('0x34')]('nolimit')){_0x5e1630[_0x23e5('0x1c')]=qs['limit'](_0x4964cb[_0x23e5('0x2e')][_0x23e5('0x1c')]);_0x5e1630[_0x23e5('0x1a')]=qs['offset'](_0x4964cb[_0x23e5('0x2e')][_0x23e5('0x1a')]);}return _0x12c9d3[_0x23e5('0x47')](_0x5e1630);}})[_0x23e5('0x24')](function(_0x1067a6){if(_0x1067a6){return _0x1067a6?{'count':_0x2e3b7c,'rows':_0x1067a6}:null;}})[_0x23e5('0x24')](respondWithResult(_0x28a847,null))[_0x23e5('0x3e')](handleError(_0x28a847,null));};exports['getSubjects']=function(_0x9f1780,_0x155348,_0x1a4997){var _0x21c6a4={};var _0x235d06={};var _0x4297e4;var _0x184db7;return db[_0x23e5('0x2a')][_0x23e5('0x48')]({'where':{'id':_0x9f1780[_0x23e5('0x40')]['id']}})[_0x23e5('0x24')](handleEntityNotFound(_0x155348,null))[_0x23e5('0x24')](function(_0x9c0852){if(_0x9c0852){_0x4297e4=_0x9c0852;_0x235d06[_0x23e5('0x2d')]=_[_0x23e5('0x2f')](db[_0x23e5('0x49')][_0x23e5('0x41')]);_0x235d06[_0x23e5('0x2e')]=_['keys'](_0x9f1780[_0x23e5('0x2e')]);_0x235d06[_0x23e5('0x30')]=_[_0x23e5('0x31')](_0x235d06[_0x23e5('0x2d')],_0x235d06[_0x23e5('0x2e')]);_0x21c6a4[_0x23e5('0x42')]=_[_0x23e5('0x31')](_0x235d06[_0x23e5('0x2d')],qs[_0x23e5('0x32')](_0x9f1780['query'][_0x23e5('0x32')]));_0x21c6a4[_0x23e5('0x42')]=_0x21c6a4[_0x23e5('0x42')][_0x23e5('0x33')]?_0x21c6a4[_0x23e5('0x42')]:_0x235d06[_0x23e5('0x2d')];_0x21c6a4[_0x23e5('0x4a')]=qs[_0x23e5('0x36')](_0x9f1780[_0x23e5('0x2e')][_0x23e5('0x36')]);_0x21c6a4[_0x23e5('0x37')]=qs[_0x23e5('0x30')](_[_0x23e5('0x38')](_0x9f1780['query'],_0x235d06['filters']));if(_0x9f1780[_0x23e5('0x2e')][_0x23e5('0x39')]){_0x21c6a4[_0x23e5('0x37')]=_['merge'](_0x21c6a4[_0x23e5('0x37')],{'$or':_[_0x23e5('0x29')](_0x21c6a4[_0x23e5('0x42')],function(_0x2016a7){var _0x91951a={};_0x91951a[_0x2016a7]={'$like':'%'+_0x9f1780['query'][_0x23e5('0x39')]+'%'};return _0x91951a;})});}_0x21c6a4=_['merge']({},_0x21c6a4,_0x9f1780[_0x23e5('0x43')]);return _0x4297e4[_0x23e5('0x4b')](_0x21c6a4);}})[_0x23e5('0x24')](function(_0x2b915c){if(_0x2b915c){_0x184db7=_0x2b915c[_0x23e5('0x33')];if(!_0x9f1780[_0x23e5('0x2e')][_0x23e5('0x34')](_0x23e5('0x35'))){_0x21c6a4[_0x23e5('0x1c')]=qs['limit'](_0x9f1780[_0x23e5('0x2e')][_0x23e5('0x1c')]);_0x21c6a4[_0x23e5('0x1a')]=qs['offset'](_0x9f1780[_0x23e5('0x2e')]['offset']);}return _0x4297e4['getSubjects'](_0x21c6a4);}})[_0x23e5('0x24')](function(_0x5f5c03){if(_0x5f5c03){return _0x5f5c03?{'count':_0x184db7,'rows':_0x5f5c03}:null;}})['then'](respondWithResult(_0x155348,null))['catch'](handleError(_0x155348,null));};exports[_0x23e5('0x4c')]=function(_0x2469a,_0xa157b7,_0x37c73c){var _0xa3dbc8={};var _0x2e4b4c={};var _0x34d77e;var _0x57a699;return db[_0x23e5('0x2a')][_0x23e5('0x48')]({'where':{'id':_0x2469a['params']['id']}})[_0x23e5('0x24')](handleEntityNotFound(_0xa157b7,null))[_0x23e5('0x24')](function(_0x570426){if(_0x570426){_0x34d77e=_0x570426;_0x2e4b4c[_0x23e5('0x2d')]=_[_0x23e5('0x2f')](db[_0x23e5('0x49')][_0x23e5('0x41')]);_0x2e4b4c[_0x23e5('0x2e')]=_['keys'](_0x2469a['query']);_0x2e4b4c[_0x23e5('0x30')]=_['intersection'](_0x2e4b4c[_0x23e5('0x2d')],_0x2e4b4c[_0x23e5('0x2e')]);_0xa3dbc8[_0x23e5('0x42')]=_['intersection'](_0x2e4b4c[_0x23e5('0x2d')],qs['fields'](_0x2469a[_0x23e5('0x2e')][_0x23e5('0x32')]));_0xa3dbc8[_0x23e5('0x42')]=_0xa3dbc8[_0x23e5('0x42')][_0x23e5('0x33')]?_0xa3dbc8[_0x23e5('0x42')]:_0x2e4b4c[_0x23e5('0x2d')];_0xa3dbc8['order']=qs[_0x23e5('0x36')](_0x2469a[_0x23e5('0x2e')][_0x23e5('0x36')]);_0xa3dbc8['where']=qs[_0x23e5('0x30')](_['pick'](_0x2469a[_0x23e5('0x2e')],_0x2e4b4c[_0x23e5('0x30')]));if(_0x2469a[_0x23e5('0x2e')][_0x23e5('0x39')]){_0xa3dbc8[_0x23e5('0x37')]=_[_0x23e5('0x3a')](_0xa3dbc8['where'],{'$or':_[_0x23e5('0x29')](_0xa3dbc8[_0x23e5('0x42')],function(_0x3eb554){var _0x529e23={};_0x529e23[_0x3eb554]={'$like':'%'+_0x2469a[_0x23e5('0x2e')]['filter']+'%'};return _0x529e23;})});}_0xa3dbc8=_[_0x23e5('0x3a')]({},_0xa3dbc8,_0x2469a['options']);return _0x34d77e[_0x23e5('0x4c')](_0xa3dbc8);}})['then'](function(_0x54a505){if(_0x54a505){_0x57a699=_0x54a505[_0x23e5('0x33')];if(!_0x2469a[_0x23e5('0x2e')][_0x23e5('0x34')](_0x23e5('0x35'))){_0xa3dbc8[_0x23e5('0x1c')]=qs[_0x23e5('0x1c')](_0x2469a['query']['limit']);_0xa3dbc8['offset']=qs[_0x23e5('0x1a')](_0x2469a[_0x23e5('0x2e')][_0x23e5('0x1a')]);}return _0x34d77e[_0x23e5('0x4c')](_0xa3dbc8);}})['then'](function(_0x3ff009){if(_0x3ff009){return _0x3ff009?{'count':_0x57a699,'rows':_0x3ff009}:null;}})[_0x23e5('0x24')](respondWithResult(_0xa157b7,null))[_0x23e5('0x3e')](handleError(_0xa157b7,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 462c415..1ef7429 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 _0xc4e1=['lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports','define','ServicenowConfiguration'];(function(_0x6e6963,_0x3498e7){var _0x4638e4=function(_0x2e3bbd){while(--_0x2e3bbd){_0x6e6963['push'](_0x6e6963['shift']());}};_0x4638e4(++_0x3498e7);}(_0xc4e1,0x172));var _0x1c4e=function(_0x4e83c6,_0x145e83){_0x4e83c6=_0x4e83c6-0x0;var _0x35d1a9=_0xc4e1[_0x4e83c6];return _0x35d1a9;};'use strict';var _=require(_0x1c4e('0x0'));var util=require(_0x1c4e('0x1'));var logger=require(_0x1c4e('0x2'))(_0x1c4e('0x3'));var moment=require('moment');var BPromise=require(_0x1c4e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c4e('0x5'));var rimraf=require('rimraf');var config=require(_0x1c4e('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x1c4e('0x7')]=function(_0x350c79,_0x47f7f1){return _0x350c79[_0x1c4e('0x8')](_0x1c4e('0x9'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6947=['./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0xbbdaba,_0x521c6f){var _0x2cdc06=function(_0x27b975){while(--_0x27b975){_0xbbdaba['push'](_0xbbdaba['shift']());}};_0x2cdc06(++_0x521c6f);}(_0x6947,0x72));var _0x7694=function(_0x3d5bfb,_0x58501e){_0x3d5bfb=_0x3d5bfb-0x0;var _0x520ddf=_0x6947[_0x3d5bfb];return _0x520ddf;};'use strict';var _=require('lodash');var util=require(_0x7694('0x0'));var logger=require('../../config/logger')(_0x7694('0x1'));var moment=require(_0x7694('0x2'));var BPromise=require(_0x7694('0x3'));var rp=require(_0x7694('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7694('0x5'));var attributes=require(_0x7694('0x6'));module[_0x7694('0x7')]=function(_0x5730,_0x36776b){return _0x5730[_0x7694('0x8')]('ServicenowConfiguration',attributes,{'tableName':_0x7694('0x9'),'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 7ddebf9..65d3a10 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 _0x41d9=['client','http','request','then','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x41d9,0x85));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x941d('0x0'));var util=require(_0x941d('0x1'));var moment=require(_0x941d('0x2'));var BPromise=require(_0x941d('0x3'));var rs=require(_0x941d('0x4'));var fs=require('fs');var Redis=require(_0x941d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x941d('0x6'));var logger=require(_0x941d('0x7'))(_0x941d('0x8'));var config=require(_0x941d('0x9'));var jayson=require(_0x941d('0xa'));var client=jayson[_0x941d('0xb')][_0x941d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c844e,_0xcf6226,_0x287bf0){return new BPromise(function(_0x5a5fdc,_0xf114d1){return client[_0x941d('0xd')](_0x1c844e,_0x287bf0)[_0x941d('0xe')](function(_0x501aa1){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0xcf6226,_0x941d('0xf'));logger[_0x941d('0x10')](_0x941d('0x11'),_0xcf6226,_0x941d('0xf'),JSON[_0x941d('0x12')](_0x501aa1));if(_0x501aa1[_0x941d('0x13')]){if(_0x501aa1[_0x941d('0x13')]['code']===0x1f4){logger['error'](_0x941d('0x14'),_0xcf6226,_0x501aa1[_0x941d('0x13')]['message']);return _0xf114d1(_0x501aa1[_0x941d('0x13')][_0x941d('0x15')]);}logger[_0x941d('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0xcf6226,_0x501aa1['error'][_0x941d('0x15')]);return _0x5a5fdc(_0x501aa1[_0x941d('0x13')][_0x941d('0x15')]);}else{logger[_0x941d('0x16')](_0x941d('0x14'),_0xcf6226,_0x941d('0xf'));_0x5a5fdc(_0x501aa1['result'][_0x941d('0x15')]);}})[_0x941d('0x17')](function(_0x171415){logger[_0x941d('0x13')](_0x941d('0x14'),_0xcf6226,_0x171415);_0xf114d1(_0x171415);});});} \ No newline at end of file +var _0xa46e=['request','then','request\x20sent','debug','stringify','error','code','message','ServicenowConfiguration,\x20%s,\x20%s','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http'];(function(_0x14914a,_0x3eae81){var _0x3766ec=function(_0x2d6c73){while(--_0x2d6c73){_0x14914a['push'](_0x14914a['shift']());}};_0x3766ec(++_0x3eae81);}(_0xa46e,0x8a));var _0xea46=function(_0x305c31,_0x466b17){_0x305c31=_0x305c31-0x0;var _0x17f39f=_0xa46e[_0x305c31];return _0x17f39f;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var moment=require('moment');var BPromise=require(_0xea46('0x2'));var rs=require(_0xea46('0x3'));var fs=require('fs');var Redis=require(_0xea46('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea46('0x5'));var logger=require('../../config/logger')(_0xea46('0x6'));var config=require('../../config/environment');var jayson=require(_0xea46('0x7'));var client=jayson['client'][_0xea46('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc26f,_0x5f1cd1,_0x2d1b30){return new BPromise(function(_0x42771a,_0xe7d428){return client[_0xea46('0x9')](_0x3dc26f,_0x2d1b30)[_0xea46('0xa')](function(_0x4cf206){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'));logger[_0xea46('0xc')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'),JSON[_0xea46('0xd')](_0x4cf206));if(_0x4cf206[_0xea46('0xe')]){if(_0x4cf206['error'][_0xea46('0xf')]===0x1f4){logger[_0xea46('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0xe7d428(_0x4cf206['error'][_0xea46('0x10')]);}logger['error'](_0xea46('0x11'),_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0x42771a(_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);}else{logger[_0xea46('0x12')](_0xea46('0x11'),_0x5f1cd1,_0xea46('0xb'));_0x42771a(_0x4cf206[_0xea46('0x13')]['message']);}})[_0xea46('0x14')](function(_0xbf225e){logger[_0xea46('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5f1cd1,_0xbf225e);_0xe7d428(_0xbf225e);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 8a6b71f..08a1e75 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 _0xc58b=['./intServicenowField.controller','get','index','show','post','isAuthenticated','put','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xeecb9e,_0x3acc52){var _0x463b1f=function(_0x818dae){while(--_0x818dae){_0xeecb9e['push'](_0xeecb9e['shift']());}};_0x463b1f(++_0x3acc52);}(_0xc58b,0x102));var _0xbc58=function(_0x40c905,_0x5a2e77){_0x40c905=_0x40c905-0x0;var _0x46e588=_0xc58b[_0x40c905];return _0x46e588;};'use strict';var multer=require(_0xbc58('0x0'));var util=require(_0xbc58('0x1'));var path=require(_0xbc58('0x2'));var timeout=require('connect-timeout');var express=require(_0xbc58('0x3'));var router=express[_0xbc58('0x4')]();var fs_extra=require(_0xbc58('0x5'));var auth=require(_0xbc58('0x6'));var interaction=require(_0xbc58('0x7'));var config=require('../../config/environment');var controller=require(_0xbc58('0x8'));router[_0xbc58('0x9')]('/',auth['isAuthenticated'](),controller[_0xbc58('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbc58('0xb')]);router[_0xbc58('0xc')]('/',auth[_0xbc58('0xd')](),controller['create']);router[_0xbc58('0xe')]('/:id',auth[_0xbc58('0xd')](),controller['update']);router[_0xbc58('0xf')](_0xbc58('0x10'),auth['isAuthenticated'](),controller[_0xbc58('0x11')]);module[_0xbc58('0x12')]=router; \ No newline at end of file +var _0xc2ed=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2ed,0x11b));var _0xdc2e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xc2ed[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0xdc2e('0x0'));var util=require(_0xdc2e('0x1'));var path=require(_0xdc2e('0x2'));var timeout=require(_0xdc2e('0x3'));var express=require(_0xdc2e('0x4'));var router=express['Router']();var fs_extra=require(_0xdc2e('0x5'));var auth=require(_0xdc2e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdc2e('0x7'));var controller=require(_0xdc2e('0x8'));router[_0xdc2e('0x9')]('/',auth[_0xdc2e('0xa')](),controller[_0xdc2e('0xb')]);router['get'](_0xdc2e('0xc'),auth[_0xdc2e('0xa')](),controller['show']);router[_0xdc2e('0xd')]('/',auth[_0xdc2e('0xa')](),controller[_0xdc2e('0xe')]);router['put']('/:id',auth[_0xdc2e('0xa')](),controller[_0xdc2e('0xf')]);router[_0xdc2e('0x10')](_0xdc2e('0xc'),auth[_0xdc2e('0xa')](),controller[_0xdc2e('0x11')]);module[_0xdc2e('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 4e1b18c..6e99de3 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 _0x63af=['exports','ENUM','variable','customVariable','keyValue','string','STRING','BOOLEAN','sequelize'];(function(_0x246b8d,_0x2ae345){var _0x5d4ad5=function(_0xbec604){while(--_0xbec604){_0x246b8d['push'](_0x246b8d['shift']());}};_0x5d4ad5(++_0x2ae345);}(_0x63af,0xaa));var _0xf63a=function(_0x12f7aa,_0x4930eb){_0x12f7aa=_0x12f7aa-0x0;var _0x1d844f=_0x63af[_0x12f7aa];return _0x1d844f;};'use strict';var Sequelize=require(_0xf63a('0x0'));module[_0xf63a('0x1')]={'type':{'type':Sequelize[_0xf63a('0x2')]('string',_0xf63a('0x3'),_0xf63a('0x4'),_0xf63a('0x5'),'picklist'),'defaultValue':_0xf63a('0x6')},'content':{'type':Sequelize[_0xf63a('0x7')]},'key':{'type':Sequelize[_0xf63a('0x7')]},'keyType':{'type':Sequelize[_0xf63a('0x2')](_0xf63a('0x6'),_0xf63a('0x3'),_0xf63a('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf63a('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf63a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf63a('0x7')]}}; \ No newline at end of file +var _0xf5f0=['sequelize','ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN'];(function(_0x366045,_0x47cd68){var _0x43c900=function(_0x4eab69){while(--_0x4eab69){_0x366045['push'](_0x366045['shift']());}};_0x43c900(++_0x47cd68);}(_0xf5f0,0x132));var _0x0f5f=function(_0x15e52e,_0x127ea8){_0x15e52e=_0x15e52e-0x0;var _0x2e5ddf=_0xf5f0[_0x15e52e];return _0x2e5ddf;};'use strict';var Sequelize=require(_0x0f5f('0x0'));module['exports']={'type':{'type':Sequelize[_0x0f5f('0x1')](_0x0f5f('0x2'),'variable',_0x0f5f('0x3'),_0x0f5f('0x4'),_0x0f5f('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0f5f('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x0f5f('0x2'),_0x0f5f('0x7'),_0x0f5f('0x3'))},'keyContent':{'type':Sequelize[_0x0f5f('0x6')]},'idField':{'type':Sequelize[_0x0f5f('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0f5f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0f5f('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index dab5ab7..49ffef2 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 _0x5b9a=['rows','catch','params','length','find','create','body','update','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll'];(function(_0x42e4d7,_0x4bd202){var _0x346cd8=function(_0x36c0f6){while(--_0x36c0f6){_0x42e4d7['push'](_0x42e4d7['shift']());}};_0x346cd8(++_0x4bd202);}(_0x5b9a,0x9c));var _0xa5b9=function(_0x4ccd0b,_0x2867bf){_0x4ccd0b=_0x4ccd0b-0x0;var _0x32bad4=_0x5b9a[_0x4ccd0b];return _0x32bad4;};'use strict';var emlformat=require(_0xa5b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5b9('0x1'));var jsonpatch=require(_0xa5b9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa5b9('0x3'));var util=require(_0xa5b9('0x4'));var path=require(_0xa5b9('0x5'));var sox=require(_0xa5b9('0x6'));var csv=require(_0xa5b9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5b9('0x8'));var _=require(_0xa5b9('0x9'));var squel=require(_0xa5b9('0xa'));var crypto=require(_0xa5b9('0xb'));var jsforce=require(_0xa5b9('0xc'));var deskjs=require(_0xa5b9('0xd'));var toCsv=require(_0xa5b9('0x7'));var querystring=require(_0xa5b9('0xe'));var Papa=require(_0xa5b9('0xf'));var Redis=require(_0xa5b9('0x10'));var authService=require(_0xa5b9('0x11'));var qs=require(_0xa5b9('0x12'));var as=require(_0xa5b9('0x13'));var hardwareService=require(_0xa5b9('0x14'));var logger=require('../../config/logger')(_0xa5b9('0x15'));var utils=require('../../config/utils');var config=require(_0xa5b9('0x16'));var licenseUtil=require(_0xa5b9('0x17'));var db=require(_0xa5b9('0x18'))['db'];function respondWithStatusCode(_0x4f1a90,_0x16fedb){_0x16fedb=_0x16fedb||0xcc;return function(_0x5ef8f9){if(_0x5ef8f9){return _0x4f1a90[_0xa5b9('0x19')](_0x16fedb);}return _0x4f1a90[_0xa5b9('0x1a')](_0x16fedb)[_0xa5b9('0x1b')]();};}function respondWithResult(_0x1c1acc,_0x13664d){_0x13664d=_0x13664d||0xc8;return function(_0x158c4c){if(_0x158c4c){return _0x1c1acc[_0xa5b9('0x1a')](_0x13664d)[_0xa5b9('0x1c')](_0x158c4c);}};}function respondWithFilteredResult(_0x31f1a7,_0x41e244){return function(_0x3de071){if(_0x3de071){var _0x4d9413=typeof _0x41e244[_0xa5b9('0x1d')]===_0xa5b9('0x1e')&&typeof _0x41e244[_0xa5b9('0x1f')]===_0xa5b9('0x1e');var _0x546fcd=_0x3de071[_0xa5b9('0x20')];var _0x1e752b=_0x4d9413?0x0:_0x41e244[_0xa5b9('0x1d')];var _0x218567=_0x4d9413?_0x3de071[_0xa5b9('0x20')]:_0x41e244[_0xa5b9('0x1d')]+_0x41e244[_0xa5b9('0x1f')];var _0x4cab17;if(_0x218567>=_0x546fcd){_0x218567=_0x546fcd;_0x4cab17=0xc8;}else{_0x4cab17=0xce;}_0x31f1a7[_0xa5b9('0x1a')](_0x4cab17);return _0x31f1a7['set'](_0xa5b9('0x21'),_0x1e752b+'-'+_0x218567+'/'+_0x546fcd)['json'](_0x3de071);}return null;};}function patchUpdates(_0x2e1b1c){return function(_0x3b7750){try{jsonpatch[_0xa5b9('0x22')](_0x3b7750,_0x2e1b1c,!![]);}catch(_0x182ac6){return BPromise[_0xa5b9('0x23')](_0x182ac6);}return _0x3b7750[_0xa5b9('0x24')]();};}function saveUpdates(_0x1395a2,_0x369821){return function(_0x2e002a){if(_0x2e002a){return _0x2e002a['update'](_0x1395a2)[_0xa5b9('0x25')](function(_0x546f13){return _0x546f13;});}return null;};}function removeEntity(_0x6bc7fb,_0x8ea7cc){return function(_0x539465){if(_0x539465){return _0x539465[_0xa5b9('0x26')]()[_0xa5b9('0x25')](function(){_0x6bc7fb[_0xa5b9('0x1a')](0xcc)[_0xa5b9('0x1b')]();});}};}function handleEntityNotFound(_0x4fa48f,_0x1b31b7){return function(_0x1154ed){if(!_0x1154ed){_0x4fa48f['sendStatus'](0x194);}return _0x1154ed;};}function handleError(_0x2d77e0,_0x1c3749){_0x1c3749=_0x1c3749||0x1f4;return function(_0x5093ec){logger['error'](_0x5093ec[_0xa5b9('0x27')]);if(_0x5093ec['name']){delete _0x5093ec[_0xa5b9('0x28')];}_0x2d77e0[_0xa5b9('0x1a')](_0x1c3749)[_0xa5b9('0x29')](_0x5093ec);};}exports[_0xa5b9('0x2a')]=function(_0x5df7e9,_0x471afa){var _0x3b6a37={},_0x3c5ed0={},_0x47c229={'count':0x0,'rows':[]};var _0x1d8630=_[_0xa5b9('0x2b')](db[_0xa5b9('0x2c')][_0xa5b9('0x2d')],function(_0x36f863){return{'name':_0x36f863[_0xa5b9('0x2e')],'type':_0x36f863[_0xa5b9('0x2f')][_0xa5b9('0x30')]};});_0x3c5ed0['model']=_['map'](_0x1d8630,_0xa5b9('0x28'));_0x3c5ed0['query']=_[_0xa5b9('0x31')](_0x5df7e9['query']);_0x3c5ed0[_0xa5b9('0x32')]=_[_0xa5b9('0x33')](_0x3c5ed0[_0xa5b9('0x34')],_0x3c5ed0[_0xa5b9('0x35')]);_0x3b6a37['attributes']=_[_0xa5b9('0x33')](_0x3c5ed0[_0xa5b9('0x34')],qs[_0xa5b9('0x36')](_0x5df7e9[_0xa5b9('0x35')][_0xa5b9('0x36')]));_0x3b6a37[_0xa5b9('0x37')]=_0x3b6a37['attributes']['length']?_0x3b6a37['attributes']:_0x3c5ed0[_0xa5b9('0x34')];if(!_0x5df7e9['query'][_0xa5b9('0x38')]('nolimit')){_0x3b6a37[_0xa5b9('0x1f')]=qs['limit'](_0x5df7e9[_0xa5b9('0x35')]['limit']);_0x3b6a37[_0xa5b9('0x1d')]=qs[_0xa5b9('0x1d')](_0x5df7e9['query'][_0xa5b9('0x1d')]);}_0x3b6a37['order']=qs[_0xa5b9('0x39')](_0x5df7e9[_0xa5b9('0x35')][_0xa5b9('0x39')]);_0x3b6a37[_0xa5b9('0x3a')]=qs['filters'](_[_0xa5b9('0x3b')](_0x5df7e9[_0xa5b9('0x35')],_0x3c5ed0[_0xa5b9('0x32')]),_0x1d8630);if(_0x5df7e9[_0xa5b9('0x35')][_0xa5b9('0x3c')]){_0x3b6a37[_0xa5b9('0x3a')]=_[_0xa5b9('0x3d')](_0x3b6a37[_0xa5b9('0x3a')],{'$or':_[_0xa5b9('0x2b')](_0x1d8630,function(_0xd30624){if(_0xd30624[_0xa5b9('0x2f')]!==_0xa5b9('0x3e')){var _0x59841c={};_0x59841c[_0xd30624[_0xa5b9('0x28')]]={'$like':'%'+_0x5df7e9['query'][_0xa5b9('0x3c')]+'%'};return _0x59841c;}})});}_0x3b6a37=_[_0xa5b9('0x3d')]({},_0x3b6a37,_0x5df7e9[_0xa5b9('0x3f')]);var _0x90d083={'where':_0x3b6a37[_0xa5b9('0x3a')]};return db['ServicenowField'][_0xa5b9('0x20')](_0x90d083)[_0xa5b9('0x25')](function(_0x1ea11d){_0x47c229[_0xa5b9('0x20')]=_0x1ea11d;if(_0x5df7e9['query']['includeAll']){_0x3b6a37[_0xa5b9('0x40')]=[{'all':!![]}];}return db[_0xa5b9('0x2c')][_0xa5b9('0x41')](_0x3b6a37);})[_0xa5b9('0x25')](function(_0x54f5d1){_0x47c229[_0xa5b9('0x42')]=_0x54f5d1;return _0x47c229;})[_0xa5b9('0x25')](respondWithFilteredResult(_0x471afa,_0x3b6a37))[_0xa5b9('0x43')](handleError(_0x471afa,null));};exports['show']=function(_0x1b5d08,_0x18a537){var _0x18b874={'raw':!![],'where':{'id':_0x1b5d08[_0xa5b9('0x44')]['id']}},_0x19c4fa={};_0x19c4fa['model']=_['keys'](db[_0xa5b9('0x2c')][_0xa5b9('0x2d')]);_0x19c4fa[_0xa5b9('0x35')]=_[_0xa5b9('0x31')](_0x1b5d08['query']);_0x19c4fa['filters']=_[_0xa5b9('0x33')](_0x19c4fa['model'],_0x19c4fa[_0xa5b9('0x35')]);_0x18b874['attributes']=_[_0xa5b9('0x33')](_0x19c4fa['model'],qs['fields'](_0x1b5d08[_0xa5b9('0x35')][_0xa5b9('0x36')]));_0x18b874[_0xa5b9('0x37')]=_0x18b874['attributes'][_0xa5b9('0x45')]?_0x18b874['attributes']:_0x19c4fa[_0xa5b9('0x34')];if(_0x1b5d08[_0xa5b9('0x35')]['includeAll']){_0x18b874[_0xa5b9('0x40')]=[{'all':!![]}];}_0x18b874=_[_0xa5b9('0x3d')]({},_0x18b874,_0x1b5d08[_0xa5b9('0x3f')]);return db['ServicenowField'][_0xa5b9('0x46')](_0x18b874)['then'](handleEntityNotFound(_0x18a537,null))['then'](respondWithResult(_0x18a537,null))[_0xa5b9('0x43')](handleError(_0x18a537,null));};exports[_0xa5b9('0x47')]=function(_0x25efd4,_0x473000){return db[_0xa5b9('0x2c')]['create'](_0x25efd4[_0xa5b9('0x48')],{})[_0xa5b9('0x25')](respondWithResult(_0x473000,0xc9))[_0xa5b9('0x43')](handleError(_0x473000,null));};exports[_0xa5b9('0x49')]=function(_0x476bf5,_0x837c84){if(_0x476bf5[_0xa5b9('0x48')]['id']){delete _0x476bf5[_0xa5b9('0x48')]['id'];}return db['ServicenowField'][_0xa5b9('0x46')]({'where':{'id':_0x476bf5[_0xa5b9('0x44')]['id']}})[_0xa5b9('0x25')](handleEntityNotFound(_0x837c84,null))[_0xa5b9('0x25')](saveUpdates(_0x476bf5[_0xa5b9('0x48')],null))['then'](respondWithResult(_0x837c84,null))[_0xa5b9('0x43')](handleError(_0x837c84,null));};exports[_0xa5b9('0x26')]=function(_0x15d0c5,_0x28a81f){return db[_0xa5b9('0x2c')][_0xa5b9('0x46')]({'where':{'id':_0x15d0c5[_0xa5b9('0x44')]['id']}})[_0xa5b9('0x25')](handleEntityNotFound(_0x28a81f,null))[_0xa5b9('0x25')](removeEntity(_0x28a81f,null))[_0xa5b9('0x43')](handleError(_0x28a81f,null));}; \ No newline at end of file +var _0x6f45=['save','then','destroy','error','stack','name','send','index','ServicenowField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','include','findAll','rows','show','keys','includeAll','catch','create','body','update','find','params','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/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x37dc88,_0x4ea261){var _0x5cfc4f=function(_0x341b59){while(--_0x341b59){_0x37dc88['push'](_0x37dc88['shift']());}};_0x5cfc4f(++_0x4ea261);}(_0x6f45,0xc7));var _0x56f4=function(_0x439637,_0x2ea223){_0x439637=_0x439637-0x0;var _0x4df3b8=_0x6f45[_0x439637];return _0x4df3b8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x56f4('0x0'));var jsonpatch=require(_0x56f4('0x1'));var rp=require(_0x56f4('0x2'));var moment=require(_0x56f4('0x3'));var BPromise=require(_0x56f4('0x4'));var Mustache=require(_0x56f4('0x5'));var util=require(_0x56f4('0x6'));var path=require('path');var sox=require(_0x56f4('0x7'));var csv=require(_0x56f4('0x8'));var ejs=require(_0x56f4('0x9'));var fs=require('fs');var fs_extra=require(_0x56f4('0xa'));var _=require(_0x56f4('0xb'));var squel=require(_0x56f4('0xc'));var crypto=require('crypto');var jsforce=require(_0x56f4('0xd'));var deskjs=require(_0x56f4('0xe'));var toCsv=require(_0x56f4('0x8'));var querystring=require(_0x56f4('0xf'));var Papa=require(_0x56f4('0x10'));var Redis=require(_0x56f4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x56f4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x56f4('0x13'));var logger=require(_0x56f4('0x14'))(_0x56f4('0x15'));var utils=require(_0x56f4('0x16'));var config=require(_0x56f4('0x17'));var licenseUtil=require(_0x56f4('0x18'));var db=require(_0x56f4('0x19'))['db'];function respondWithStatusCode(_0x5bef5c,_0x314039){_0x314039=_0x314039||0xcc;return function(_0x39c9ca){if(_0x39c9ca){return _0x5bef5c[_0x56f4('0x1a')](_0x314039);}return _0x5bef5c[_0x56f4('0x1b')](_0x314039)[_0x56f4('0x1c')]();};}function respondWithResult(_0x456528,_0x55ae19){_0x55ae19=_0x55ae19||0xc8;return function(_0x455f2c){if(_0x455f2c){return _0x456528['status'](_0x55ae19)[_0x56f4('0x1d')](_0x455f2c);}};}function respondWithFilteredResult(_0x1cc0b6,_0x16ff2e){return function(_0x4b364d){if(_0x4b364d){var _0x28b9c5=typeof _0x16ff2e[_0x56f4('0x1e')]===_0x56f4('0x1f')&&typeof _0x16ff2e[_0x56f4('0x20')]===_0x56f4('0x1f');var _0x343d80=_0x4b364d[_0x56f4('0x21')];var _0x5ae178=_0x28b9c5?0x0:_0x16ff2e['offset'];var _0x29763f=_0x28b9c5?_0x4b364d[_0x56f4('0x21')]:_0x16ff2e[_0x56f4('0x1e')]+_0x16ff2e[_0x56f4('0x20')];var _0x1b1732;if(_0x29763f>=_0x343d80){_0x29763f=_0x343d80;_0x1b1732=0xc8;}else{_0x1b1732=0xce;}_0x1cc0b6[_0x56f4('0x1b')](_0x1b1732);return _0x1cc0b6[_0x56f4('0x22')](_0x56f4('0x23'),_0x5ae178+'-'+_0x29763f+'/'+_0x343d80)[_0x56f4('0x1d')](_0x4b364d);}return null;};}function patchUpdates(_0x3a9bbc){return function(_0x1f9a0f){try{jsonpatch[_0x56f4('0x24')](_0x1f9a0f,_0x3a9bbc,!![]);}catch(_0x4e20b2){return BPromise[_0x56f4('0x25')](_0x4e20b2);}return _0x1f9a0f[_0x56f4('0x26')]();};}function saveUpdates(_0x2fec0a,_0x59c26c){return function(_0x11bc53){if(_0x11bc53){return _0x11bc53['update'](_0x2fec0a)[_0x56f4('0x27')](function(_0x5a802d){return _0x5a802d;});}return null;};}function removeEntity(_0x560216,_0x5b19a3){return function(_0x9efc6){if(_0x9efc6){return _0x9efc6[_0x56f4('0x28')]()[_0x56f4('0x27')](function(){_0x560216[_0x56f4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8b0bb,_0x1c58b8){return function(_0x33b8e0){if(!_0x33b8e0){_0xe8b0bb[_0x56f4('0x1a')](0x194);}return _0x33b8e0;};}function handleError(_0x2f20b9,_0x5dd190){_0x5dd190=_0x5dd190||0x1f4;return function(_0x47d808){logger[_0x56f4('0x29')](_0x47d808[_0x56f4('0x2a')]);if(_0x47d808['name']){delete _0x47d808[_0x56f4('0x2b')];}_0x2f20b9[_0x56f4('0x1b')](_0x5dd190)[_0x56f4('0x2c')](_0x47d808);};}exports[_0x56f4('0x2d')]=function(_0x55abc7,_0x43cec2){var _0x22e88d={},_0x39ad1c={},_0x44c914={'count':0x0,'rows':[]};var _0x5e129f=_['map'](db[_0x56f4('0x2e')][_0x56f4('0x2f')],function(_0x2ab47a){return{'name':_0x2ab47a[_0x56f4('0x30')],'type':_0x2ab47a[_0x56f4('0x31')][_0x56f4('0x32')]};});_0x39ad1c[_0x56f4('0x33')]=_['map'](_0x5e129f,_0x56f4('0x2b'));_0x39ad1c[_0x56f4('0x34')]=_['keys'](_0x55abc7[_0x56f4('0x34')]);_0x39ad1c[_0x56f4('0x35')]=_[_0x56f4('0x36')](_0x39ad1c['model'],_0x39ad1c[_0x56f4('0x34')]);_0x22e88d[_0x56f4('0x37')]=_[_0x56f4('0x36')](_0x39ad1c[_0x56f4('0x33')],qs[_0x56f4('0x38')](_0x55abc7[_0x56f4('0x34')][_0x56f4('0x38')]));_0x22e88d['attributes']=_0x22e88d[_0x56f4('0x37')][_0x56f4('0x39')]?_0x22e88d['attributes']:_0x39ad1c[_0x56f4('0x33')];if(!_0x55abc7[_0x56f4('0x34')][_0x56f4('0x3a')](_0x56f4('0x3b'))){_0x22e88d[_0x56f4('0x20')]=qs['limit'](_0x55abc7['query'][_0x56f4('0x20')]);_0x22e88d[_0x56f4('0x1e')]=qs[_0x56f4('0x1e')](_0x55abc7[_0x56f4('0x34')][_0x56f4('0x1e')]);}_0x22e88d[_0x56f4('0x3c')]=qs[_0x56f4('0x3d')](_0x55abc7[_0x56f4('0x34')][_0x56f4('0x3d')]);_0x22e88d[_0x56f4('0x3e')]=qs[_0x56f4('0x35')](_[_0x56f4('0x3f')](_0x55abc7[_0x56f4('0x34')],_0x39ad1c[_0x56f4('0x35')]),_0x5e129f);if(_0x55abc7['query']['filter']){_0x22e88d[_0x56f4('0x3e')]=_[_0x56f4('0x40')](_0x22e88d[_0x56f4('0x3e')],{'$or':_[_0x56f4('0x41')](_0x5e129f,function(_0x5c18e9){if(_0x5c18e9[_0x56f4('0x31')]!=='VIRTUAL'){var _0x5aa873={};_0x5aa873[_0x5c18e9['name']]={'$like':'%'+_0x55abc7[_0x56f4('0x34')][_0x56f4('0x42')]+'%'};return _0x5aa873;}})});}_0x22e88d=_['merge']({},_0x22e88d,_0x55abc7['options']);var _0x3f444f={'where':_0x22e88d[_0x56f4('0x3e')]};return db[_0x56f4('0x2e')][_0x56f4('0x21')](_0x3f444f)[_0x56f4('0x27')](function(_0x498679){_0x44c914['count']=_0x498679;if(_0x55abc7['query']['includeAll']){_0x22e88d[_0x56f4('0x43')]=[{'all':!![]}];}return db[_0x56f4('0x2e')][_0x56f4('0x44')](_0x22e88d);})['then'](function(_0x2fd3ca){_0x44c914[_0x56f4('0x45')]=_0x2fd3ca;return _0x44c914;})[_0x56f4('0x27')](respondWithFilteredResult(_0x43cec2,_0x22e88d))['catch'](handleError(_0x43cec2,null));};exports[_0x56f4('0x46')]=function(_0xd97890,_0x2268a9){var _0x55ed6b={'raw':!![],'where':{'id':_0xd97890['params']['id']}},_0x5ec8e2={};_0x5ec8e2[_0x56f4('0x33')]=_['keys'](db[_0x56f4('0x2e')][_0x56f4('0x2f')]);_0x5ec8e2[_0x56f4('0x34')]=_[_0x56f4('0x47')](_0xd97890[_0x56f4('0x34')]);_0x5ec8e2[_0x56f4('0x35')]=_[_0x56f4('0x36')](_0x5ec8e2[_0x56f4('0x33')],_0x5ec8e2[_0x56f4('0x34')]);_0x55ed6b[_0x56f4('0x37')]=_[_0x56f4('0x36')](_0x5ec8e2[_0x56f4('0x33')],qs[_0x56f4('0x38')](_0xd97890['query'][_0x56f4('0x38')]));_0x55ed6b[_0x56f4('0x37')]=_0x55ed6b['attributes'][_0x56f4('0x39')]?_0x55ed6b['attributes']:_0x5ec8e2[_0x56f4('0x33')];if(_0xd97890['query'][_0x56f4('0x48')]){_0x55ed6b[_0x56f4('0x43')]=[{'all':!![]}];}_0x55ed6b=_[_0x56f4('0x40')]({},_0x55ed6b,_0xd97890['options']);return db[_0x56f4('0x2e')]['find'](_0x55ed6b)['then'](handleEntityNotFound(_0x2268a9,null))['then'](respondWithResult(_0x2268a9,null))[_0x56f4('0x49')](handleError(_0x2268a9,null));};exports[_0x56f4('0x4a')]=function(_0x3193c4,_0x2b7e3a){return db[_0x56f4('0x2e')][_0x56f4('0x4a')](_0x3193c4[_0x56f4('0x4b')],{})['then'](respondWithResult(_0x2b7e3a,0xc9))[_0x56f4('0x49')](handleError(_0x2b7e3a,null));};exports[_0x56f4('0x4c')]=function(_0x40d306,_0x9aa7bb){if(_0x40d306[_0x56f4('0x4b')]['id']){delete _0x40d306[_0x56f4('0x4b')]['id'];}return db[_0x56f4('0x2e')][_0x56f4('0x4d')]({'where':{'id':_0x40d306[_0x56f4('0x4e')]['id']}})[_0x56f4('0x27')](handleEntityNotFound(_0x9aa7bb,null))['then'](saveUpdates(_0x40d306[_0x56f4('0x4b')],null))['then'](respondWithResult(_0x9aa7bb,null))[_0x56f4('0x49')](handleError(_0x9aa7bb,null));};exports['destroy']=function(_0x823e69,_0x46bc28){return db['ServicenowField'][_0x56f4('0x4d')]({'where':{'id':_0x823e69['params']['id']}})[_0x56f4('0x27')](handleEntityNotFound(_0x46bc28,null))[_0x56f4('0x27')](removeEntity(_0x46bc28,null))['catch'](handleError(_0x46bc28,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 2cae7e5..f8d12d8 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 _0x48f8=['int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x2577e5,_0x56188c){var _0x229cbd=function(_0x444019){while(--_0x444019){_0x2577e5['push'](_0x2577e5['shift']());}};_0x229cbd(++_0x56188c);}(_0x48f8,0x149));var _0x848f=function(_0xa7984c,_0x3b130c){_0xa7984c=_0xa7984c-0x0;var _0x3c6957=_0x48f8[_0xa7984c];return _0x3c6957;};'use strict';var _=require(_0x848f('0x0'));var util=require('util');var logger=require(_0x848f('0x1'))('api');var moment=require(_0x848f('0x2'));var BPromise=require(_0x848f('0x3'));var rp=require(_0x848f('0x4'));var fs=require('fs');var path=require(_0x848f('0x5'));var rimraf=require(_0x848f('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0x848f('0x7')]=function(_0x745205,_0x466941){return _0x745205[_0x848f('0x8')]('ServicenowField',attributes,{'tableName':_0x848f('0x9'),'paranoid':![],'indexes':[{'name':_0x848f('0xa'),'fields':[_0x848f('0xb'),_0x848f('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x767d=['define','ServicenowField','int_servicenow_fields','servicenow_unique_index','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x767d,0xc7));var _0xd767=function(_0x4905f8,_0x2378eb){_0x4905f8=_0x4905f8-0x0;var _0x2751b7=_0x767d[_0x4905f8];return _0x2751b7;};'use strict';var _=require(_0xd767('0x0'));var util=require(_0xd767('0x1'));var logger=require(_0xd767('0x2'))(_0xd767('0x3'));var moment=require(_0xd767('0x4'));var BPromise=require(_0xd767('0x5'));var rp=require(_0xd767('0x6'));var fs=require('fs');var path=require(_0xd767('0x7'));var rimraf=require(_0xd767('0x8'));var config=require(_0xd767('0x9'));var attributes=require('./intServicenowField.attributes');module[_0xd767('0xa')]=function(_0x210c4,_0x5921c1){return _0x210c4[_0xd767('0xb')](_0xd767('0xc'),attributes,{'tableName':_0xd767('0xd'),'paranoid':![],'indexes':[{'name':_0xd767('0xe'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index a49d63b..acb7ffc 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 _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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xac4a,0x13f));var _0xaac4=function(_0x1474f1,_0x10ae1a){_0x1474f1=_0x1474f1-0x0;var _0x598e4a=_0xac4a[_0x1474f1];return _0x598e4a;};'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 +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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xac4a,0x13f));var _0xaac4=function(_0x12dc42,_0x4f6f60){_0x12dc42=_0x12dc42-0x0;var _0x57371a=_0xac4a[_0x12dc42];return _0x57371a;};'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 f12e367..74ac836 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(_0x33e5eb,_0x182544){var _0x12437b=function(_0x5eb430){while(--_0x5eb430){_0x33e5eb['push'](_0x33e5eb['shift']());}};_0x12437b(++_0x182544);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5e5acd,_0x270a1d){var _0x5111b5=function(_0x4d1aff){while(--_0x4d1aff){_0x5e5acd['push'](_0x5e5acd['shift']());}};_0x5111b5(++_0x270a1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 87a9623..5ca453c 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(_0x5ed34f,_0x395f9b){var _0x1be1a4=function(_0x597300){while(--_0x597300){_0x5ed34f['push'](_0x5ed34f['shift']());}};_0x1be1a4(++_0x395f9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x3c6108,_0x2b82cc){var _0x30f85e=function(_0x35db54){while(--_0x35db54){_0x3c6108['push'](_0x3c6108['shift']());}};_0x30f85e(++_0x2b82cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 2574c7e..adf9e83 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 _0x293b=['count','set','apply','save','update','then','destroy','error','name','index','map','SugarcrmAccount','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','options','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','SugarcrmConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','username','password','remoteUri','slice','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','get_module_fields','Calls','values','module_fields','remove','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','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','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','offset'];(function(_0x5bf305,_0x3460a0){var _0x356014=function(_0x25d2ca){while(--_0x25d2ca){_0x5bf305['push'](_0x5bf305['shift']());}};_0x356014(++_0x3460a0);}(_0x293b,0x1c4));var _0xb293=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x293b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb293('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb293('0x1'));var jsonpatch=require(_0xb293('0x2'));var rp=require(_0xb293('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb293('0x4'));var path=require(_0xb293('0x5'));var sox=require(_0xb293('0x6'));var csv=require(_0xb293('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb293('0x8'));var _=require(_0xb293('0x9'));var squel=require('squel');var crypto=require(_0xb293('0xa'));var jsforce=require(_0xb293('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb293('0x7'));var querystring=require(_0xb293('0xc'));var Papa=require('papaparse');var Redis=require(_0xb293('0xd'));var authService=require(_0xb293('0xe'));var qs=require(_0xb293('0xf'));var as=require(_0xb293('0x10'));var hardwareService=require(_0xb293('0x11'));var logger=require(_0xb293('0x12'))(_0xb293('0x13'));var utils=require(_0xb293('0x14'));var config=require(_0xb293('0x15'));var licenseUtil=require(_0xb293('0x16'));var db=require(_0xb293('0x17'))['db'];var integrations=require(_0xb293('0x18'));function respondWithStatusCode(_0x4e6acf,_0x1e8e07){_0x1e8e07=_0x1e8e07||0xcc;return function(_0x5adb37){if(_0x5adb37){return _0x4e6acf[_0xb293('0x19')](_0x1e8e07);}return _0x4e6acf[_0xb293('0x1a')](_0x1e8e07)[_0xb293('0x1b')]();};}function respondWithResult(_0x12eb75,_0xa7c77f){_0xa7c77f=_0xa7c77f||0xc8;return function(_0x5e0b9c){if(_0x5e0b9c){return _0x12eb75['status'](_0xa7c77f)[_0xb293('0x1c')](_0x5e0b9c);}};}function respondWithFilteredResult(_0x4b2ea8,_0x585088){return function(_0x45748a){if(_0x45748a){var _0x579666=typeof _0x585088['offset']==='undefined'&&typeof _0x585088[_0xb293('0x1d')]===_0xb293('0x1e');var _0x4f764d=_0x45748a['count'];var _0x1d49f3=_0x579666?0x0:_0x585088[_0xb293('0x1f')];var _0x23407d=_0x579666?_0x45748a[_0xb293('0x20')]:_0x585088['offset']+_0x585088[_0xb293('0x1d')];var _0x103838;if(_0x23407d>=_0x4f764d){_0x23407d=_0x4f764d;_0x103838=0xc8;}else{_0x103838=0xce;}_0x4b2ea8[_0xb293('0x1a')](_0x103838);return _0x4b2ea8[_0xb293('0x21')]('Content-Range',_0x1d49f3+'-'+_0x23407d+'/'+_0x4f764d)['json'](_0x45748a);}return null;};}function patchUpdates(_0x25a783){return function(_0x4a9ecb){try{jsonpatch[_0xb293('0x22')](_0x4a9ecb,_0x25a783,!![]);}catch(_0x51a620){return BPromise['reject'](_0x51a620);}return _0x4a9ecb[_0xb293('0x23')]();};}function saveUpdates(_0x434460,_0x499048){return function(_0x2c992b){if(_0x2c992b){return _0x2c992b[_0xb293('0x24')](_0x434460)[_0xb293('0x25')](function(_0x5c300a){return _0x5c300a;});}return null;};}function removeEntity(_0xa95934,_0x4cff10){return function(_0x59a17b){if(_0x59a17b){return _0x59a17b[_0xb293('0x26')]()[_0xb293('0x25')](function(){_0xa95934['status'](0xcc)[_0xb293('0x1b')]();});}};}function handleEntityNotFound(_0x4f443c,_0x437e2c){return function(_0x366c6f){if(!_0x366c6f){_0x4f443c['sendStatus'](0x194);}return _0x366c6f;};}function handleError(_0x2f4db8,_0x194f21){_0x194f21=_0x194f21||0x1f4;return function(_0x2afc40){logger[_0xb293('0x27')](_0x2afc40['stack']);if(_0x2afc40[_0xb293('0x28')]){delete _0x2afc40['name'];}_0x2f4db8['status'](_0x194f21)['send'](_0x2afc40);};}exports[_0xb293('0x29')]=function(_0x535bb1,_0x7c6f21){var _0x4147ee={},_0x29e4e1={},_0x1ecd83={'count':0x0,'rows':[]};var _0x345c52=_[_0xb293('0x2a')](db[_0xb293('0x2b')][_0xb293('0x2c')],function(_0x1fe320){return{'name':_0x1fe320['fieldName'],'type':_0x1fe320[_0xb293('0x2d')][_0xb293('0x2e')]};});_0x29e4e1['model']=_[_0xb293('0x2a')](_0x345c52,_0xb293('0x28'));_0x29e4e1[_0xb293('0x2f')]=_[_0xb293('0x30')](_0x535bb1[_0xb293('0x2f')]);_0x29e4e1['filters']=_[_0xb293('0x31')](_0x29e4e1[_0xb293('0x32')],_0x29e4e1[_0xb293('0x2f')]);_0x4147ee[_0xb293('0x33')]=_[_0xb293('0x31')](_0x29e4e1[_0xb293('0x32')],qs[_0xb293('0x34')](_0x535bb1[_0xb293('0x2f')][_0xb293('0x34')]));_0x4147ee['attributes']=_0x4147ee[_0xb293('0x33')][_0xb293('0x35')]?_0x4147ee['attributes']:_0x29e4e1[_0xb293('0x32')];if(!_0x535bb1['query']['hasOwnProperty'](_0xb293('0x36'))){_0x4147ee[_0xb293('0x1d')]=qs[_0xb293('0x1d')](_0x535bb1[_0xb293('0x2f')]['limit']);_0x4147ee[_0xb293('0x1f')]=qs[_0xb293('0x1f')](_0x535bb1[_0xb293('0x2f')]['offset']);}_0x4147ee[_0xb293('0x37')]=qs[_0xb293('0x38')](_0x535bb1[_0xb293('0x2f')][_0xb293('0x38')]);_0x4147ee['where']=qs[_0xb293('0x39')](_[_0xb293('0x3a')](_0x535bb1[_0xb293('0x2f')],_0x29e4e1[_0xb293('0x39')]),_0x345c52);if(_0x535bb1[_0xb293('0x2f')][_0xb293('0x3b')]){_0x4147ee[_0xb293('0x3c')]=_['merge'](_0x4147ee[_0xb293('0x3c')],{'$or':_[_0xb293('0x2a')](_0x345c52,function(_0x4929a8){if(_0x4929a8['type']!=='VIRTUAL'){var _0x592f70={};_0x592f70[_0x4929a8[_0xb293('0x28')]]={'$like':'%'+_0x535bb1['query']['filter']+'%'};return _0x592f70;}})});}_0x4147ee=_[_0xb293('0x3d')]({},_0x4147ee,_0x535bb1[_0xb293('0x3e')]);var _0x56b110={'where':_0x4147ee[_0xb293('0x3c')]};return db['SugarcrmAccount'][_0xb293('0x20')](_0x56b110)[_0xb293('0x25')](function(_0x486bcf){_0x1ecd83[_0xb293('0x20')]=_0x486bcf;if(_0x535bb1[_0xb293('0x2f')]['includeAll']){_0x4147ee[_0xb293('0x3f')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xb293('0x40')](_0x4147ee);})['then'](function(_0x129527){_0x1ecd83[_0xb293('0x41')]=_0x129527;return _0x1ecd83;})[_0xb293('0x25')](respondWithFilteredResult(_0x7c6f21,_0x4147ee))[_0xb293('0x42')](handleError(_0x7c6f21,null));};exports[_0xb293('0x43')]=function(_0xa3bfb7,_0x871080){var _0x58a762={'raw':![],'where':{'id':_0xa3bfb7[_0xb293('0x44')]['id']}},_0x553750={};_0x553750[_0xb293('0x32')]=_[_0xb293('0x30')](db[_0xb293('0x2b')][_0xb293('0x2c')]);_0x553750[_0xb293('0x2f')]=_[_0xb293('0x30')](_0xa3bfb7[_0xb293('0x2f')]);_0x553750[_0xb293('0x39')]=_[_0xb293('0x31')](_0x553750[_0xb293('0x32')],_0x553750[_0xb293('0x2f')]);_0x58a762[_0xb293('0x33')]=_[_0xb293('0x31')](_0x553750['model'],qs[_0xb293('0x34')](_0xa3bfb7['query'][_0xb293('0x34')]));_0x58a762[_0xb293('0x33')]=_0x58a762[_0xb293('0x33')][_0xb293('0x35')]?_0x58a762[_0xb293('0x33')]:_0x553750[_0xb293('0x32')];if(_0xa3bfb7['query']['includeAll']){_0x58a762[_0xb293('0x3f')]=[{'all':!![]}];}_0x58a762=_[_0xb293('0x3d')]({},_0x58a762,_0xa3bfb7[_0xb293('0x3e')]);return db['SugarcrmAccount'][_0xb293('0x45')](_0x58a762)['then'](handleEntityNotFound(_0x871080,null))[_0xb293('0x25')](respondWithResult(_0x871080,null))[_0xb293('0x42')](handleError(_0x871080,null));};exports[_0xb293('0x46')]=function(_0x578ce2,_0x3fa6a1){return db[_0xb293('0x2b')]['create'](_0x578ce2[_0xb293('0x47')],{})[_0xb293('0x25')](respondWithResult(_0x3fa6a1,0xc9))[_0xb293('0x42')](handleError(_0x3fa6a1,null));};exports[_0xb293('0x24')]=function(_0x1e3f7b,_0x16796b){if(_0x1e3f7b[_0xb293('0x47')]['id']){delete _0x1e3f7b['body']['id'];}return db[_0xb293('0x2b')]['find']({'where':{'id':_0x1e3f7b[_0xb293('0x44')]['id']}})[_0xb293('0x25')](handleEntityNotFound(_0x16796b,null))['then'](saveUpdates(_0x1e3f7b[_0xb293('0x47')],null))[_0xb293('0x25')](respondWithResult(_0x16796b,null))[_0xb293('0x42')](handleError(_0x16796b,null));};exports[_0xb293('0x26')]=function(_0x55d66e,_0x540031){return db[_0xb293('0x2b')][_0xb293('0x45')]({'where':{'id':_0x55d66e[_0xb293('0x44')]['id']}})[_0xb293('0x25')](handleEntityNotFound(_0x540031,null))[_0xb293('0x25')](removeEntity(_0x540031,null))[_0xb293('0x42')](handleError(_0x540031,null));};exports[_0xb293('0x48')]=function(_0x29c300,_0x32cbda,_0x1860b8){var _0x4aa06e={};var _0x557a11={};var _0x3d1ba8;var _0x483004;return db[_0xb293('0x2b')]['findOne']({'where':{'id':_0x29c300['params']['id']}})[_0xb293('0x25')](handleEntityNotFound(_0x32cbda,null))[_0xb293('0x25')](function(_0x2f4aca){if(_0x2f4aca){_0x3d1ba8=_0x2f4aca;_0x557a11[_0xb293('0x32')]=_[_0xb293('0x30')](db[_0xb293('0x49')][_0xb293('0x2c')]);_0x557a11[_0xb293('0x2f')]=_[_0xb293('0x30')](_0x29c300[_0xb293('0x2f')]);_0x557a11[_0xb293('0x39')]=_[_0xb293('0x31')](_0x557a11[_0xb293('0x32')],_0x557a11['query']);_0x4aa06e['attributes']=_[_0xb293('0x31')](_0x557a11[_0xb293('0x32')],qs[_0xb293('0x34')](_0x29c300[_0xb293('0x2f')][_0xb293('0x34')]));_0x4aa06e[_0xb293('0x33')]=_0x4aa06e[_0xb293('0x33')][_0xb293('0x35')]?_0x4aa06e[_0xb293('0x33')]:_0x557a11['model'];_0x4aa06e[_0xb293('0x37')]=qs['sort'](_0x29c300[_0xb293('0x2f')][_0xb293('0x38')]);_0x4aa06e[_0xb293('0x3c')]=qs['filters'](_[_0xb293('0x3a')](_0x29c300[_0xb293('0x2f')],_0x557a11[_0xb293('0x39')]));if(_0x29c300['query'][_0xb293('0x3b')]){_0x4aa06e[_0xb293('0x3c')]=_[_0xb293('0x3d')](_0x4aa06e[_0xb293('0x3c')],{'$or':_['map'](_0x4aa06e[_0xb293('0x33')],function(_0xaa0908){var _0x488822={};_0x488822[_0xaa0908]={'$like':'%'+_0x29c300[_0xb293('0x2f')][_0xb293('0x3b')]+'%'};return _0x488822;})});}_0x4aa06e=_[_0xb293('0x3d')]({},_0x4aa06e,_0x29c300[_0xb293('0x3e')]);return _0x3d1ba8['getConfigurations'](_0x4aa06e);}})['then'](function(_0x4fd94e){if(_0x4fd94e){_0x483004=_0x4fd94e[_0xb293('0x35')];if(!_0x29c300[_0xb293('0x2f')][_0xb293('0x4a')]('nolimit')){_0x4aa06e[_0xb293('0x1d')]=qs['limit'](_0x29c300['query'][_0xb293('0x1d')]);_0x4aa06e[_0xb293('0x1f')]=qs[_0xb293('0x1f')](_0x29c300[_0xb293('0x2f')][_0xb293('0x1f')]);}return _0x3d1ba8[_0xb293('0x48')](_0x4aa06e);}})[_0xb293('0x25')](function(_0x597da4){if(_0x597da4){return _0x597da4?{'count':_0x483004,'rows':_0x597da4}:null;}})[_0xb293('0x25')](respondWithResult(_0x32cbda,null))[_0xb293('0x42')](handleError(_0x32cbda,null));};exports[_0xb293('0x4b')]=function(_0x3967af,_0x6b7f86,_0x8046af){if(_0x3967af['body']['id']){delete _0x3967af[_0xb293('0x47')]['id'];}return db[_0xb293('0x2b')][_0xb293('0x4c')]({'where':{'id':_0x3967af[_0xb293('0x44')]['id']}})['then'](handleEntityNotFound(_0x6b7f86,null))[_0xb293('0x25')](function(_0x53c694){if(_0x53c694){_0x3967af[_0xb293('0x47')][_0xb293('0x4d')]=_0x53c694['id'];_0x3967af[_0xb293('0x47')][_0xb293('0x4e')]=integrations[_0xb293('0x4f')](_0x3967af['body'][_0xb293('0x50')],_0x3967af[_0xb293('0x47')][_0xb293('0x2d')]);_0x3967af[_0xb293('0x47')][_0xb293('0x51')]=integrations[_0xb293('0x52')](_0x3967af[_0xb293('0x47')][_0xb293('0x50')],_0x3967af[_0xb293('0x47')][_0xb293('0x2d')]);return db['SugarcrmConfiguration']['create'](_0x3967af['body'],{'include':[{'model':db[_0xb293('0x53')],'as':_0xb293('0x4e')},{'model':db[_0xb293('0x53')],'as':'Descriptions'}]});}return null;})[_0xb293('0x25')](respondWithResult(_0x6b7f86,null))['catch'](handleError(_0x6b7f86,null));};exports[_0xb293('0x54')]=function(_0x11b753,_0x30669c,_0x4283aa){var _0xc8d5d0='';var _0x15500b=['id','name',_0xb293('0x55'),_0xb293('0x56'),_0xb293('0x57'),_0xb293('0x58'),_0xb293('0x59'),_0xb293('0x5a'),_0xb293('0x5b'),_0xb293('0x5c'),_0xb293('0x5d'),'direction'];return db[_0xb293('0x2b')][_0xb293('0x4c')]({'where':{'id':_0x11b753['params']['id']},'attributes':['id',_0xb293('0x5e'),_0xb293('0x5f'),_0xb293('0x60')]})[_0xb293('0x25')](handleEntityNotFound(_0x30669c,null))[_0xb293('0x25')](function(_0x4e7697){if(_0x4e7697){_0xc8d5d0=_0x4e7697[_0xb293('0x60')];var _0x2935ac=_0xc8d5d0[_0xb293('0x61')](-0x1);if(_0x2935ac==='/'){_0xc8d5d0=_0xc8d5d0['substring'](0x0,_0xc8d5d0['lastIndexOf'](_0x2935ac));}return rp({'method':_0xb293('0x62'),'uri':util[_0xb293('0x63')](_0xb293('0x64'),_0xc8d5d0,_0xb293('0x65')),'json':!![],'form':{'method':_0xb293('0x66'),'input_type':'JSON','response_type':_0xb293('0x67'),'rest_data':JSON[_0xb293('0x68')]({'user_auth':{'user_name':_0x4e7697[_0xb293('0x5e')],'password':_0x4e7697[_0xb293('0x5f')],'encryption':_0xb293('0x69')},'application':_0xb293('0x6a')})}});}})[_0xb293('0x25')](function(_0x55ee0c){if(_0x55ee0c&&_0x55ee0c[_0xb293('0x28')]!==_0xb293('0x6b')&&_0x55ee0c[_0xb293('0x28')]!=='Password\x20Expired'){return rp({'method':_0xb293('0x62'),'uri':util[_0xb293('0x63')]('%s%s',_0xc8d5d0,_0xb293('0x65')),'json':!![],'form':{'method':_0xb293('0x6c'),'input_type':_0xb293('0x67'),'response_type':'JSON','rest_data':JSON[_0xb293('0x68')]({'session':_0x55ee0c['id'],'module_name':_0xb293('0x6d')})}})[_0xb293('0x25')](function(_0x53ad31){if(_0x53ad31){var _0x53fd45=_[_0xb293('0x6e')](_0x53ad31[_0xb293('0x6f')]);_[_0xb293('0x70')](_0x53fd45,function(_0x366ac6){return _0x15500b['includes'](_0x366ac6[_0xb293('0x28')]);});return{'count':_0x53fd45[_0xb293('0x35')],'rows':_[_0xb293('0x2a')](_0x53fd45,function(_0x27bbe2){return{'id':_0x27bbe2[_0xb293('0x28')],'name':_0x27bbe2[_0xb293('0x71')],'custom':_[_0xb293('0x72')](_0x27bbe2[_0xb293('0x28')],'_c')?!![]:![],'options':_0x27bbe2[_0xb293('0x3e')]?_[_0xb293('0x2a')](_[_0xb293('0x6e')](_0x27bbe2[_0xb293('0x3e')]),function(_0x33551a){return{'name':_0x33551a[_0xb293('0x73')],'value':_0x33551a[_0xb293('0x28')]};}):[]};})};}})[_0xb293('0x25')](respondWithResult(_0x30669c,null))[_0xb293('0x42')](function(_0x2dba9b){var _0x2a3cb0=_0x11b753[_0xb293('0x2f')][_0xb293('0x74')]?0x1f4:_0x2dba9b[_0xb293('0x75')]||0x1f4;logger[_0xb293('0x27')](_0xb293('0x76'),_0xb293('0x54'),_0x2a3cb0,JSON['stringify'](_0x2dba9b));delete _0x2dba9b['name'];if(_0x2a3cb0===0x191){_0x2a3cb0=0x190;}_0x30669c[_0xb293('0x1a')](_0x2a3cb0)[_0xb293('0x77')](_0x11b753[_0xb293('0x2f')]['test']?{'message':_0xb293('0x78'),'statusCode':_0x2dba9b[_0xb293('0x75')]}:_0x2dba9b);});}else{var _0x2a8891=0x1f4;_0x30669c['status'](_0x2a8891)[_0xb293('0x77')]({'message':_0xb293('0x78'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xb7fb=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','sendStatus','stack','name','send','map','SugarcrmAccount','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','find','create','body','update','getConfigurations','findOne','addConfiguration','getSubjects','channel','type','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','Subjects','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls','module_fields','remove','includes','label','values','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x513670,_0xde3096){var _0x4361f4=function(_0x4e6dc1){while(--_0x4e6dc1){_0x513670['push'](_0x513670['shift']());}};_0x4361f4(++_0xde3096);}(_0xb7fb,0x76));var _0xbb7f=function(_0x121ef6,_0x1e723b){_0x121ef6=_0x121ef6-0x0;var _0xdd351c=_0xb7fb[_0x121ef6];return _0xdd351c;};'use strict';var emlformat=require(_0xbb7f('0x0'));var rimraf=require(_0xbb7f('0x1'));var zipdir=require(_0xbb7f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb7f('0x3'));var moment=require(_0xbb7f('0x4'));var BPromise=require(_0xbb7f('0x5'));var Mustache=require(_0xbb7f('0x6'));var util=require(_0xbb7f('0x7'));var path=require(_0xbb7f('0x8'));var sox=require(_0xbb7f('0x9'));var csv=require(_0xbb7f('0xa'));var ejs=require(_0xbb7f('0xb'));var fs=require('fs');var fs_extra=require(_0xbb7f('0xc'));var _=require(_0xbb7f('0xd'));var squel=require(_0xbb7f('0xe'));var crypto=require(_0xbb7f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xbb7f('0x10'));var toCsv=require(_0xbb7f('0xa'));var querystring=require('querystring');var Papa=require(_0xbb7f('0x11'));var Redis=require('ioredis');var authService=require(_0xbb7f('0x12'));var qs=require(_0xbb7f('0x13'));var as=require(_0xbb7f('0x14'));var hardwareService=require(_0xbb7f('0x15'));var logger=require(_0xbb7f('0x16'))('api');var utils=require(_0xbb7f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbb7f('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbb7f('0x19'));function respondWithStatusCode(_0x2409c4,_0x7e1f27){_0x7e1f27=_0x7e1f27||0xcc;return function(_0x6139b0){if(_0x6139b0){return _0x2409c4['sendStatus'](_0x7e1f27);}return _0x2409c4['status'](_0x7e1f27)[_0xbb7f('0x1a')]();};}function respondWithResult(_0x4221ca,_0x138527){_0x138527=_0x138527||0xc8;return function(_0x20be18){if(_0x20be18){return _0x4221ca[_0xbb7f('0x1b')](_0x138527)[_0xbb7f('0x1c')](_0x20be18);}};}function respondWithFilteredResult(_0x128b4,_0x2318f5){return function(_0x558580){if(_0x558580){var _0x3cf8f3=typeof _0x2318f5[_0xbb7f('0x1d')]===_0xbb7f('0x1e')&&typeof _0x2318f5[_0xbb7f('0x1f')]===_0xbb7f('0x1e');var _0x208b06=_0x558580[_0xbb7f('0x20')];var _0xd8913a=_0x3cf8f3?0x0:_0x2318f5[_0xbb7f('0x1d')];var _0x2ccb77=_0x3cf8f3?_0x558580['count']:_0x2318f5[_0xbb7f('0x1d')]+_0x2318f5[_0xbb7f('0x1f')];var _0x134bfa;if(_0x2ccb77>=_0x208b06){_0x2ccb77=_0x208b06;_0x134bfa=0xc8;}else{_0x134bfa=0xce;}_0x128b4[_0xbb7f('0x1b')](_0x134bfa);return _0x128b4[_0xbb7f('0x21')]('Content-Range',_0xd8913a+'-'+_0x2ccb77+'/'+_0x208b06)[_0xbb7f('0x1c')](_0x558580);}return null;};}function patchUpdates(_0xfecf51){return function(_0x5af7f2){try{jsonpatch[_0xbb7f('0x22')](_0x5af7f2,_0xfecf51,!![]);}catch(_0x204681){return BPromise[_0xbb7f('0x23')](_0x204681);}return _0x5af7f2['save']();};}function saveUpdates(_0x45e7fe,_0x381500){return function(_0x319c33){if(_0x319c33){return _0x319c33['update'](_0x45e7fe)[_0xbb7f('0x24')](function(_0x2c836b){return _0x2c836b;});}return null;};}function removeEntity(_0x4e7599,_0x499387){return function(_0x87c24){if(_0x87c24){return _0x87c24[_0xbb7f('0x25')]()[_0xbb7f('0x24')](function(){_0x4e7599[_0xbb7f('0x1b')](0xcc)[_0xbb7f('0x1a')]();});}};}function handleEntityNotFound(_0x1e3f6e,_0x30a347){return function(_0x16a108){if(!_0x16a108){_0x1e3f6e[_0xbb7f('0x26')](0x194);}return _0x16a108;};}function handleError(_0x293bac,_0x59486a){_0x59486a=_0x59486a||0x1f4;return function(_0x1d49ed){logger['error'](_0x1d49ed[_0xbb7f('0x27')]);if(_0x1d49ed[_0xbb7f('0x28')]){delete _0x1d49ed[_0xbb7f('0x28')];}_0x293bac[_0xbb7f('0x1b')](_0x59486a)[_0xbb7f('0x29')](_0x1d49ed);};}exports['index']=function(_0x3cfa29,_0x46681c){var _0x114503={},_0x2d1c8b={},_0x4eed0d={'count':0x0,'rows':[]};var _0xc36354=_[_0xbb7f('0x2a')](db[_0xbb7f('0x2b')]['rawAttributes'],function(_0x777c7c){return{'name':_0x777c7c[_0xbb7f('0x2c')],'type':_0x777c7c['type'][_0xbb7f('0x2d')]};});_0x2d1c8b[_0xbb7f('0x2e')]=_[_0xbb7f('0x2a')](_0xc36354,_0xbb7f('0x28'));_0x2d1c8b[_0xbb7f('0x2f')]=_['keys'](_0x3cfa29[_0xbb7f('0x2f')]);_0x2d1c8b[_0xbb7f('0x30')]=_[_0xbb7f('0x31')](_0x2d1c8b[_0xbb7f('0x2e')],_0x2d1c8b['query']);_0x114503[_0xbb7f('0x32')]=_[_0xbb7f('0x31')](_0x2d1c8b[_0xbb7f('0x2e')],qs[_0xbb7f('0x33')](_0x3cfa29[_0xbb7f('0x2f')][_0xbb7f('0x33')]));_0x114503[_0xbb7f('0x32')]=_0x114503[_0xbb7f('0x32')][_0xbb7f('0x34')]?_0x114503[_0xbb7f('0x32')]:_0x2d1c8b[_0xbb7f('0x2e')];if(!_0x3cfa29[_0xbb7f('0x2f')]['hasOwnProperty'](_0xbb7f('0x35'))){_0x114503['limit']=qs['limit'](_0x3cfa29[_0xbb7f('0x2f')][_0xbb7f('0x1f')]);_0x114503['offset']=qs['offset'](_0x3cfa29['query'][_0xbb7f('0x1d')]);}_0x114503[_0xbb7f('0x36')]=qs['sort'](_0x3cfa29[_0xbb7f('0x2f')][_0xbb7f('0x37')]);_0x114503[_0xbb7f('0x38')]=qs['filters'](_[_0xbb7f('0x39')](_0x3cfa29[_0xbb7f('0x2f')],_0x2d1c8b[_0xbb7f('0x30')]),_0xc36354);if(_0x3cfa29[_0xbb7f('0x2f')][_0xbb7f('0x3a')]){_0x114503[_0xbb7f('0x38')]=_[_0xbb7f('0x3b')](_0x114503[_0xbb7f('0x38')],{'$or':_[_0xbb7f('0x2a')](_0xc36354,function(_0x52fc9f){if(_0x52fc9f['type']!==_0xbb7f('0x3c')){var _0x2103a1={};_0x2103a1[_0x52fc9f[_0xbb7f('0x28')]]={'$like':'%'+_0x3cfa29[_0xbb7f('0x2f')]['filter']+'%'};return _0x2103a1;}})});}_0x114503=_[_0xbb7f('0x3b')]({},_0x114503,_0x3cfa29[_0xbb7f('0x3d')]);var _0x11116f={'where':_0x114503[_0xbb7f('0x38')]};return db['SugarcrmAccount'][_0xbb7f('0x20')](_0x11116f)[_0xbb7f('0x24')](function(_0x5aad69){_0x4eed0d[_0xbb7f('0x20')]=_0x5aad69;if(_0x3cfa29[_0xbb7f('0x2f')][_0xbb7f('0x3e')]){_0x114503[_0xbb7f('0x3f')]=[{'all':!![]}];}return db[_0xbb7f('0x2b')][_0xbb7f('0x40')](_0x114503);})['then'](function(_0x40906b){_0x4eed0d[_0xbb7f('0x41')]=_0x40906b;return _0x4eed0d;})['then'](respondWithFilteredResult(_0x46681c,_0x114503))[_0xbb7f('0x42')](handleError(_0x46681c,null));};exports[_0xbb7f('0x43')]=function(_0x11f2db,_0x2e8e85){var _0x31f776={'raw':![],'where':{'id':_0x11f2db[_0xbb7f('0x44')]['id']}},_0x45143d={};_0x45143d[_0xbb7f('0x2e')]=_['keys'](db[_0xbb7f('0x2b')][_0xbb7f('0x45')]);_0x45143d[_0xbb7f('0x2f')]=_[_0xbb7f('0x46')](_0x11f2db[_0xbb7f('0x2f')]);_0x45143d['filters']=_[_0xbb7f('0x31')](_0x45143d['model'],_0x45143d[_0xbb7f('0x2f')]);_0x31f776[_0xbb7f('0x32')]=_[_0xbb7f('0x31')](_0x45143d[_0xbb7f('0x2e')],qs[_0xbb7f('0x33')](_0x11f2db[_0xbb7f('0x2f')][_0xbb7f('0x33')]));_0x31f776['attributes']=_0x31f776[_0xbb7f('0x32')][_0xbb7f('0x34')]?_0x31f776[_0xbb7f('0x32')]:_0x45143d[_0xbb7f('0x2e')];if(_0x11f2db['query'][_0xbb7f('0x3e')]){_0x31f776['include']=[{'all':!![]}];}_0x31f776=_[_0xbb7f('0x3b')]({},_0x31f776,_0x11f2db[_0xbb7f('0x3d')]);return db[_0xbb7f('0x2b')][_0xbb7f('0x47')](_0x31f776)[_0xbb7f('0x24')](handleEntityNotFound(_0x2e8e85,null))['then'](respondWithResult(_0x2e8e85,null))[_0xbb7f('0x42')](handleError(_0x2e8e85,null));};exports[_0xbb7f('0x48')]=function(_0x54443e,_0x5896f2){return db['SugarcrmAccount'][_0xbb7f('0x48')](_0x54443e[_0xbb7f('0x49')],{})[_0xbb7f('0x24')](respondWithResult(_0x5896f2,0xc9))[_0xbb7f('0x42')](handleError(_0x5896f2,null));};exports[_0xbb7f('0x4a')]=function(_0x3c990f,_0x22ccd6){if(_0x3c990f['body']['id']){delete _0x3c990f[_0xbb7f('0x49')]['id'];}return db[_0xbb7f('0x2b')][_0xbb7f('0x47')]({'where':{'id':_0x3c990f[_0xbb7f('0x44')]['id']}})[_0xbb7f('0x24')](handleEntityNotFound(_0x22ccd6,null))[_0xbb7f('0x24')](saveUpdates(_0x3c990f['body'],null))[_0xbb7f('0x24')](respondWithResult(_0x22ccd6,null))[_0xbb7f('0x42')](handleError(_0x22ccd6,null));};exports['destroy']=function(_0xd52348,_0x36e1d4){return db[_0xbb7f('0x2b')]['find']({'where':{'id':_0xd52348[_0xbb7f('0x44')]['id']}})[_0xbb7f('0x24')](handleEntityNotFound(_0x36e1d4,null))[_0xbb7f('0x24')](removeEntity(_0x36e1d4,null))[_0xbb7f('0x42')](handleError(_0x36e1d4,null));};exports[_0xbb7f('0x4b')]=function(_0x5aadc8,_0x48d35a,_0xeb36df){var _0x5eb0b1={};var _0xefd87c={};var _0x26a12e;var _0x2759be;return db[_0xbb7f('0x2b')][_0xbb7f('0x4c')]({'where':{'id':_0x5aadc8[_0xbb7f('0x44')]['id']}})[_0xbb7f('0x24')](handleEntityNotFound(_0x48d35a,null))[_0xbb7f('0x24')](function(_0x22ec48){if(_0x22ec48){_0x26a12e=_0x22ec48;_0xefd87c['model']=_[_0xbb7f('0x46')](db['SugarcrmConfiguration'][_0xbb7f('0x45')]);_0xefd87c['query']=_[_0xbb7f('0x46')](_0x5aadc8[_0xbb7f('0x2f')]);_0xefd87c['filters']=_[_0xbb7f('0x31')](_0xefd87c['model'],_0xefd87c['query']);_0x5eb0b1['attributes']=_[_0xbb7f('0x31')](_0xefd87c['model'],qs[_0xbb7f('0x33')](_0x5aadc8[_0xbb7f('0x2f')][_0xbb7f('0x33')]));_0x5eb0b1[_0xbb7f('0x32')]=_0x5eb0b1['attributes'][_0xbb7f('0x34')]?_0x5eb0b1['attributes']:_0xefd87c['model'];_0x5eb0b1[_0xbb7f('0x36')]=qs[_0xbb7f('0x37')](_0x5aadc8[_0xbb7f('0x2f')][_0xbb7f('0x37')]);_0x5eb0b1['where']=qs[_0xbb7f('0x30')](_[_0xbb7f('0x39')](_0x5aadc8[_0xbb7f('0x2f')],_0xefd87c[_0xbb7f('0x30')]));if(_0x5aadc8[_0xbb7f('0x2f')][_0xbb7f('0x3a')]){_0x5eb0b1[_0xbb7f('0x38')]=_[_0xbb7f('0x3b')](_0x5eb0b1[_0xbb7f('0x38')],{'$or':_[_0xbb7f('0x2a')](_0x5eb0b1[_0xbb7f('0x32')],function(_0x5bb221){var _0x500fd9={};_0x500fd9[_0x5bb221]={'$like':'%'+_0x5aadc8[_0xbb7f('0x2f')][_0xbb7f('0x3a')]+'%'};return _0x500fd9;})});}_0x5eb0b1=_[_0xbb7f('0x3b')]({},_0x5eb0b1,_0x5aadc8['options']);return _0x26a12e[_0xbb7f('0x4b')](_0x5eb0b1);}})[_0xbb7f('0x24')](function(_0x384215){if(_0x384215){_0x2759be=_0x384215['length'];if(!_0x5aadc8[_0xbb7f('0x2f')]['hasOwnProperty'](_0xbb7f('0x35'))){_0x5eb0b1['limit']=qs[_0xbb7f('0x1f')](_0x5aadc8['query'][_0xbb7f('0x1f')]);_0x5eb0b1[_0xbb7f('0x1d')]=qs[_0xbb7f('0x1d')](_0x5aadc8[_0xbb7f('0x2f')][_0xbb7f('0x1d')]);}return _0x26a12e['getConfigurations'](_0x5eb0b1);}})[_0xbb7f('0x24')](function(_0xf09c7a){if(_0xf09c7a){return _0xf09c7a?{'count':_0x2759be,'rows':_0xf09c7a}:null;}})[_0xbb7f('0x24')](respondWithResult(_0x48d35a,null))[_0xbb7f('0x42')](handleError(_0x48d35a,null));};exports[_0xbb7f('0x4d')]=function(_0x468b27,_0x53e8d9,_0x234d9c){if(_0x468b27[_0xbb7f('0x49')]['id']){delete _0x468b27[_0xbb7f('0x49')]['id'];}return db['SugarcrmAccount'][_0xbb7f('0x4c')]({'where':{'id':_0x468b27[_0xbb7f('0x44')]['id']}})[_0xbb7f('0x24')](handleEntityNotFound(_0x53e8d9,null))['then'](function(_0x4eafa6){if(_0x4eafa6){_0x468b27[_0xbb7f('0x49')]['AccountId']=_0x4eafa6['id'];_0x468b27[_0xbb7f('0x49')]['Subjects']=integrations[_0xbb7f('0x4e')](_0x468b27['body'][_0xbb7f('0x4f')],_0x468b27['body'][_0xbb7f('0x50')]);_0x468b27[_0xbb7f('0x49')][_0xbb7f('0x51')]=integrations[_0xbb7f('0x52')](_0x468b27[_0xbb7f('0x49')][_0xbb7f('0x4f')],_0x468b27[_0xbb7f('0x49')][_0xbb7f('0x50')]);return db[_0xbb7f('0x53')]['create'](_0x468b27['body'],{'include':[{'model':db[_0xbb7f('0x54')],'as':_0xbb7f('0x55')},{'model':db['SugarcrmField'],'as':_0xbb7f('0x51')}]});}return null;})[_0xbb7f('0x24')](respondWithResult(_0x53e8d9,null))['catch'](handleError(_0x53e8d9,null));};exports[_0xbb7f('0x56')]=function(_0x1b513a,_0x554ac3,_0x47f9db){var _0x556a96='';var _0x31eb3d=['id',_0xbb7f('0x28'),_0xbb7f('0x57'),_0xbb7f('0x58'),_0xbb7f('0x59'),_0xbb7f('0x5a'),_0xbb7f('0x5b'),_0xbb7f('0x5c'),_0xbb7f('0x5d'),_0xbb7f('0x5e'),_0xbb7f('0x5f'),_0xbb7f('0x60')];return db[_0xbb7f('0x2b')][_0xbb7f('0x4c')]({'where':{'id':_0x1b513a[_0xbb7f('0x44')]['id']},'attributes':['id','username',_0xbb7f('0x61'),_0xbb7f('0x62')]})['then'](handleEntityNotFound(_0x554ac3,null))[_0xbb7f('0x24')](function(_0x21263f){if(_0x21263f){_0x556a96=_0x21263f[_0xbb7f('0x62')];var _0x647551=_0x556a96[_0xbb7f('0x63')](-0x1);if(_0x647551==='/'){_0x556a96=_0x556a96['substring'](0x0,_0x556a96[_0xbb7f('0x64')](_0x647551));}return rp({'method':_0xbb7f('0x65'),'uri':util[_0xbb7f('0x66')](_0xbb7f('0x67'),_0x556a96,_0xbb7f('0x68')),'json':!![],'form':{'method':_0xbb7f('0x69'),'input_type':_0xbb7f('0x6a'),'response_type':_0xbb7f('0x6a'),'rest_data':JSON[_0xbb7f('0x6b')]({'user_auth':{'user_name':_0x21263f[_0xbb7f('0x6c')],'password':_0x21263f[_0xbb7f('0x61')],'encryption':_0xbb7f('0x6d')},'application':_0xbb7f('0x6e')})}});}})['then'](function(_0x197160){if(_0x197160&&_0x197160[_0xbb7f('0x28')]!=='Invalid\x20Login'&&_0x197160[_0xbb7f('0x28')]!==_0xbb7f('0x6f')){return rp({'method':_0xbb7f('0x65'),'uri':util['format'](_0xbb7f('0x67'),_0x556a96,_0xbb7f('0x68')),'json':!![],'form':{'method':_0xbb7f('0x70'),'input_type':_0xbb7f('0x6a'),'response_type':_0xbb7f('0x6a'),'rest_data':JSON[_0xbb7f('0x6b')]({'session':_0x197160['id'],'module_name':_0xbb7f('0x71')})}})['then'](function(_0x46402d){if(_0x46402d){var _0x547609=_['values'](_0x46402d[_0xbb7f('0x72')]);_[_0xbb7f('0x73')](_0x547609,function(_0x5b3edd){return _0x31eb3d[_0xbb7f('0x74')](_0x5b3edd['name']);});return{'count':_0x547609[_0xbb7f('0x34')],'rows':_[_0xbb7f('0x2a')](_0x547609,function(_0x3b6924){return{'id':_0x3b6924[_0xbb7f('0x28')],'name':_0x3b6924[_0xbb7f('0x75')],'custom':_['endsWith'](_0x3b6924['name'],'_c')?!![]:![],'options':_0x3b6924[_0xbb7f('0x3d')]?_['map'](_[_0xbb7f('0x76')](_0x3b6924[_0xbb7f('0x3d')]),function(_0x2596b6){return{'name':_0x2596b6[_0xbb7f('0x77')],'value':_0x2596b6['name']};}):[]};})};}})['then'](respondWithResult(_0x554ac3,null))['catch'](function(_0x246447){var _0x2a5d50=_0x1b513a[_0xbb7f('0x2f')][_0xbb7f('0x78')]?0x1f4:_0x246447[_0xbb7f('0x79')]||0x1f4;logger['error'](_0xbb7f('0x7a'),_0xbb7f('0x56'),_0x2a5d50,JSON['stringify'](_0x246447));delete _0x246447[_0xbb7f('0x28')];if(_0x2a5d50===0x191){_0x2a5d50=0x190;}_0x554ac3[_0xbb7f('0x1b')](_0x2a5d50)[_0xbb7f('0x29')](_0x1b513a[_0xbb7f('0x2f')][_0xbb7f('0x78')]?{'message':'Wrong\x20credentials','statusCode':_0x246447[_0xbb7f('0x79')]}:_0x246447);});}else{var _0x38ad07=0x1f4;_0x554ac3[_0xbb7f('0x1b')](_0x38ad07)['send']({'message':_0xbb7f('0x7b'),'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 73d40f3..2e291ae 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 _0xe127=['moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','int_sugarcrm_accounts','util','../../config/logger'];(function(_0x31a16a,_0x1d60e3){var _0x21c892=function(_0x5b25f6){while(--_0x5b25f6){_0x31a16a['push'](_0x31a16a['shift']());}};_0x21c892(++_0x1d60e3);}(_0xe127,0x1e2));var _0x7e12=function(_0x34facb,_0x2ee3c7){_0x34facb=_0x34facb-0x0;var _0x11c9f7=_0xe127[_0x34facb];return _0x11c9f7;};'use strict';var _=require('lodash');var util=require(_0x7e12('0x0'));var logger=require(_0x7e12('0x1'))('api');var moment=require(_0x7e12('0x2'));var BPromise=require(_0x7e12('0x3'));var rp=require(_0x7e12('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e12('0x5'));var config=require(_0x7e12('0x6'));var attributes=require(_0x7e12('0x7'));var integrations=require(_0x7e12('0x8'));module['exports']=function(_0x4ca85b,_0x42c26f){return _0x4ca85b[_0x7e12('0x9')]('SugarcrmAccount',attributes,{'tableName':_0x7e12('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbcc=['path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x543219,_0x350a13){var _0x4df73f=function(_0x5807e9){while(--_0x5807e9){_0x543219['push'](_0x543219['shift']());}};_0x4df73f(++_0x350a13);}(_0xbbcc,0xf8));var _0xcbbc=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xbbcc[_0x46f1a6];return _0x38429a;};'use strict';var _=require(_0xcbbc('0x0'));var util=require(_0xcbbc('0x1'));var logger=require(_0xcbbc('0x2'))(_0xcbbc('0x3'));var moment=require(_0xcbbc('0x4'));var BPromise=require(_0xcbbc('0x5'));var rp=require(_0xcbbc('0x6'));var fs=require('fs');var path=require(_0xcbbc('0x7'));var rimraf=require('rimraf');var config=require(_0xcbbc('0x8'));var attributes=require(_0xcbbc('0x9'));var integrations=require(_0xcbbc('0xa'));module[_0xcbbc('0xb')]=function(_0x3edfe5,_0x28a38b){return _0x3edfe5[_0xcbbc('0xc')](_0xcbbc('0xd'),attributes,{'tableName':_0xcbbc('0xe'),'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 e38ba8a..260ad6d 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 _0x7bf9=['jayson/promise','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','limit','include','model','map','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x25fa5c,_0x421141){var _0x1bade2=function(_0x3faf20){while(--_0x3faf20){_0x25fa5c['push'](_0x25fa5c['shift']());}};_0x1bade2(++_0x421141);}(_0x7bf9,0x198));var _0x97bf=function(_0x54bace,_0x38bf3e){_0x54bace=_0x54bace-0x0;var _0x15f6ad=_0x7bf9[_0x54bace];return _0x15f6ad;};'use strict';var _=require(_0x97bf('0x0'));var util=require(_0x97bf('0x1'));var moment=require(_0x97bf('0x2'));var BPromise=require(_0x97bf('0x3'));var rs=require(_0x97bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x97bf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x97bf('0x6'))('rpc');var config=require(_0x97bf('0x7'));var jayson=require(_0x97bf('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8d4f,_0x2e1adc,_0x423507){return new BPromise(function(_0x53fd50,_0x35410f){return client[_0x97bf('0x9')](_0x5a8d4f,_0x423507)[_0x97bf('0xa')](function(_0x561427){logger['info'](_0x97bf('0xb'),_0x2e1adc,_0x97bf('0xc'));logger[_0x97bf('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x2e1adc,_0x97bf('0xc'),JSON[_0x97bf('0xe')](_0x561427));if(_0x561427['error']){if(_0x561427['error']['code']===0x1f4){logger[_0x97bf('0xf')](_0x97bf('0xb'),_0x2e1adc,_0x561427[_0x97bf('0xf')][_0x97bf('0x10')]);return _0x35410f(_0x561427[_0x97bf('0xf')][_0x97bf('0x10')]);}logger[_0x97bf('0xf')](_0x97bf('0xb'),_0x2e1adc,_0x561427['error'][_0x97bf('0x10')]);return _0x53fd50(_0x561427[_0x97bf('0xf')][_0x97bf('0x10')]);}else{logger[_0x97bf('0x11')](_0x97bf('0xb'),_0x2e1adc,_0x97bf('0xc'));_0x53fd50(_0x561427[_0x97bf('0x12')][_0x97bf('0x10')]);}})[_0x97bf('0x13')](function(_0x1261a5){logger[_0x97bf('0xf')](_0x97bf('0xb'),_0x2e1adc,_0x1261a5);_0x35410f(_0x1261a5);});});}exports[_0x97bf('0x14')]=function(_0x23f4ca){var _0x84bf81=this;return new Promise(function(_0x3819d7,_0x1e38e3){return db[_0x97bf('0x15')][_0x97bf('0x16')]({'raw':_0x23f4ca[_0x97bf('0x17')]?_0x23f4ca[_0x97bf('0x17')][_0x97bf('0x18')]===undefined?!![]:![]:!![],'where':_0x23f4ca[_0x97bf('0x17')]?_0x23f4ca['options']['where']||null:null,'attributes':_0x23f4ca[_0x97bf('0x17')]?_0x23f4ca[_0x97bf('0x17')][_0x97bf('0x19')]||null:null,'limit':_0x23f4ca['options']?_0x23f4ca[_0x97bf('0x17')][_0x97bf('0x1a')]||null:null,'include':_0x23f4ca[_0x97bf('0x17')]?_0x23f4ca['options']['include']?_['map'](_0x23f4ca['options'][_0x97bf('0x1b')],function(_0x4650fb){return{'model':db[_0x4650fb[_0x97bf('0x1c')]],'as':_0x4650fb['as'],'attributes':_0x4650fb[_0x97bf('0x19')],'include':_0x4650fb[_0x97bf('0x1b')]?_[_0x97bf('0x1d')](_0x4650fb[_0x97bf('0x1b')],function(_0x2f424e){return{'model':db[_0x2f424e['model']],'as':_0x2f424e['as'],'attributes':_0x2f424e['attributes'],'include':_0x2f424e[_0x97bf('0x1b')]?_['map'](_0x2f424e[_0x97bf('0x1b')],function(_0x23de6a){return{'model':db[_0x23de6a[_0x97bf('0x1c')]],'as':_0x23de6a['as'],'attributes':_0x23de6a[_0x97bf('0x19')]};}):[]};}):[]};}):[]:[]})[_0x97bf('0xa')](function(_0x316b90){logger[_0x97bf('0x11')](_0x97bf('0x14'),_0x23f4ca);logger[_0x97bf('0xd')](_0x97bf('0x14'),_0x23f4ca,JSON[_0x97bf('0xe')](_0x316b90));_0x3819d7(_0x316b90);})[_0x97bf('0x13')](function(_0x15f51f){logger[_0x97bf('0xf')](_0x97bf('0x14'),_0x15f51f[_0x97bf('0x10')],_0x23f4ca);_0x1e38e3(_0x84bf81[_0x97bf('0xf')](0x1f4,_0x15f51f[_0x97bf('0x10')]));});});};exports[_0x97bf('0x1e')]=function(_0x431447){var _0x15a0d9=this;return new Promise(function(_0x149451,_0x5bfbf1){return db[_0x97bf('0x15')][_0x97bf('0x1f')]({'raw':_0x431447[_0x97bf('0x17')]?_0x431447[_0x97bf('0x17')][_0x97bf('0x18')]===undefined?!![]:![]:!![],'where':_0x431447[_0x97bf('0x17')]?_0x431447[_0x97bf('0x17')]['where']||null:null,'attributes':_0x431447[_0x97bf('0x17')]?_0x431447[_0x97bf('0x17')][_0x97bf('0x19')]||null:null,'include':_0x431447[_0x97bf('0x17')]?_0x431447[_0x97bf('0x17')]['include']?_[_0x97bf('0x1d')](_0x431447[_0x97bf('0x17')][_0x97bf('0x1b')],function(_0x58dba8){return{'model':db[_0x58dba8[_0x97bf('0x1c')]],'as':_0x58dba8['as'],'attributes':_0x58dba8['attributes'],'include':_0x58dba8[_0x97bf('0x1b')]?_['map'](_0x58dba8[_0x97bf('0x1b')],function(_0x41856e){return{'model':db[_0x41856e[_0x97bf('0x1c')]],'as':_0x41856e['as'],'attributes':_0x41856e[_0x97bf('0x19')],'include':_0x41856e[_0x97bf('0x1b')]?_[_0x97bf('0x1d')](_0x41856e[_0x97bf('0x1b')],function(_0x5b103b){return{'model':db[_0x5b103b[_0x97bf('0x1c')]],'as':_0x5b103b['as'],'attributes':_0x5b103b['attributes']};}):[]};}):[]};}):[]:[]})[_0x97bf('0xa')](function(_0x36ddc7){logger[_0x97bf('0x11')](_0x97bf('0x1e'),_0x431447);logger['debug'](_0x97bf('0x1e'),_0x431447,JSON[_0x97bf('0xe')](_0x36ddc7));_0x149451(_0x36ddc7);})[_0x97bf('0x13')](function(_0x588120){logger[_0x97bf('0xf')](_0x97bf('0x1e'),_0x588120[_0x97bf('0x10')],_0x431447);_0x5bfbf1(_0x15a0d9[_0x97bf('0xf')](0x1f4,_0x588120['message']));});});}; \ No newline at end of file +var _0x2036=['request\x20sent','error','code','message','result','catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','model','map','include','info','GetSugarcrmAccount','debug','stringify','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','SugarcrmAccount,\x20%s,\x20%s'];(function(_0x15805f,_0x1f1676){var _0x1c136f=function(_0x691fa5){while(--_0x691fa5){_0x15805f['push'](_0x15805f['shift']());}};_0x1c136f(++_0x1f1676);}(_0x2036,0xca));var _0x6203=function(_0x571729,_0x5d03e2){_0x571729=_0x571729-0x0;var _0x38820e=_0x2036[_0x571729];return _0x38820e;};'use strict';var _=require(_0x6203('0x0'));var util=require(_0x6203('0x1'));var moment=require(_0x6203('0x2'));var BPromise=require(_0x6203('0x3'));var rs=require(_0x6203('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6203('0x5'))['db'];var utils=require(_0x6203('0x6'));var logger=require(_0x6203('0x7'))(_0x6203('0x8'));var config=require(_0x6203('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6203('0xa')][_0x6203('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40a710,_0x2769b6,_0x20d826){return new BPromise(function(_0x3362c0,_0x374049){return client['request'](_0x40a710,_0x20d826)[_0x6203('0xc')](function(_0x4e8d42){logger['info'](_0x6203('0xd'),_0x2769b6,'request\x20sent');logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x2769b6,_0x6203('0xe'),JSON['stringify'](_0x4e8d42));if(_0x4e8d42[_0x6203('0xf')]){if(_0x4e8d42['error'][_0x6203('0x10')]===0x1f4){logger[_0x6203('0xf')](_0x6203('0xd'),_0x2769b6,_0x4e8d42[_0x6203('0xf')]['message']);return _0x374049(_0x4e8d42[_0x6203('0xf')][_0x6203('0x11')]);}logger[_0x6203('0xf')](_0x6203('0xd'),_0x2769b6,_0x4e8d42[_0x6203('0xf')]['message']);return _0x3362c0(_0x4e8d42[_0x6203('0xf')][_0x6203('0x11')]);}else{logger['info'](_0x6203('0xd'),_0x2769b6,_0x6203('0xe'));_0x3362c0(_0x4e8d42[_0x6203('0x12')]['message']);}})[_0x6203('0x13')](function(_0x562958){logger['error'](_0x6203('0xd'),_0x2769b6,_0x562958);_0x374049(_0x562958);});});}exports['GetSugarcrmAccount']=function(_0x1c1c01){var _0x5c0690=this;return new Promise(function(_0x447b5c,_0x374a88){return db[_0x6203('0x14')][_0x6203('0x15')]({'raw':_0x1c1c01[_0x6203('0x16')]?_0x1c1c01['options'][_0x6203('0x17')]===undefined?!![]:![]:!![],'where':_0x1c1c01['options']?_0x1c1c01[_0x6203('0x16')][_0x6203('0x18')]||null:null,'attributes':_0x1c1c01[_0x6203('0x16')]?_0x1c1c01[_0x6203('0x16')][_0x6203('0x19')]||null:null,'limit':_0x1c1c01[_0x6203('0x16')]?_0x1c1c01[_0x6203('0x16')][_0x6203('0x1a')]||null:null,'include':_0x1c1c01[_0x6203('0x16')]?_0x1c1c01[_0x6203('0x16')]['include']?_['map'](_0x1c1c01[_0x6203('0x16')]['include'],function(_0x697c80){return{'model':db[_0x697c80[_0x6203('0x1b')]],'as':_0x697c80['as'],'attributes':_0x697c80['attributes'],'include':_0x697c80['include']?_[_0x6203('0x1c')](_0x697c80[_0x6203('0x1d')],function(_0x56ae01){return{'model':db[_0x56ae01[_0x6203('0x1b')]],'as':_0x56ae01['as'],'attributes':_0x56ae01[_0x6203('0x19')],'include':_0x56ae01[_0x6203('0x1d')]?_[_0x6203('0x1c')](_0x56ae01[_0x6203('0x1d')],function(_0x2eb152){return{'model':db[_0x2eb152[_0x6203('0x1b')]],'as':_0x2eb152['as'],'attributes':_0x2eb152['attributes']};}):[]};}):[]};}):[]:[]})[_0x6203('0xc')](function(_0x5b0ab3){logger[_0x6203('0x1e')](_0x6203('0x1f'),_0x1c1c01);logger[_0x6203('0x20')](_0x6203('0x1f'),_0x1c1c01,JSON[_0x6203('0x21')](_0x5b0ab3));_0x447b5c(_0x5b0ab3);})[_0x6203('0x13')](function(_0x3cbbc4){logger[_0x6203('0xf')](_0x6203('0x1f'),_0x3cbbc4['message'],_0x1c1c01);_0x374a88(_0x5c0690['error'](0x1f4,_0x3cbbc4[_0x6203('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x50933b){var _0x3bf7bd=this;return new Promise(function(_0x1c1fdc,_0x32d7c6){return db[_0x6203('0x14')][_0x6203('0x22')]({'raw':_0x50933b[_0x6203('0x16')]?_0x50933b[_0x6203('0x16')][_0x6203('0x17')]===undefined?!![]:![]:!![],'where':_0x50933b[_0x6203('0x16')]?_0x50933b[_0x6203('0x16')][_0x6203('0x18')]||null:null,'attributes':_0x50933b[_0x6203('0x16')]?_0x50933b[_0x6203('0x16')][_0x6203('0x19')]||null:null,'include':_0x50933b[_0x6203('0x16')]?_0x50933b[_0x6203('0x16')][_0x6203('0x1d')]?_['map'](_0x50933b[_0x6203('0x16')][_0x6203('0x1d')],function(_0x1f1a8c){return{'model':db[_0x1f1a8c[_0x6203('0x1b')]],'as':_0x1f1a8c['as'],'attributes':_0x1f1a8c['attributes'],'include':_0x1f1a8c['include']?_['map'](_0x1f1a8c[_0x6203('0x1d')],function(_0x80560a){return{'model':db[_0x80560a[_0x6203('0x1b')]],'as':_0x80560a['as'],'attributes':_0x80560a[_0x6203('0x19')],'include':_0x80560a[_0x6203('0x1d')]?_[_0x6203('0x1c')](_0x80560a[_0x6203('0x1d')],function(_0x7839a0){return{'model':db[_0x7839a0[_0x6203('0x1b')]],'as':_0x7839a0['as'],'attributes':_0x7839a0[_0x6203('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x415117){logger['info'](_0x6203('0x23'),_0x50933b);logger[_0x6203('0x20')](_0x6203('0x23'),_0x50933b,JSON[_0x6203('0x21')](_0x415117));_0x1c1fdc(_0x415117);})[_0x6203('0x13')](function(_0x947e16){logger[_0x6203('0xf')](_0x6203('0x23'),_0x947e16['message'],_0x50933b);_0x32d7c6(_0x3bf7bd[_0x6203('0xf')](0x1f4,_0x947e16['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index e5fc896..58032ed 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 _0xf952=['get','/:id/fields','getFields','/:id/subjects','getSubjects','post','create','/:id','update','delete','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','index','isAuthenticated'];(function(_0x41c728,_0x45d573){var _0x5a18dc=function(_0x296154){while(--_0x296154){_0x41c728['push'](_0x41c728['shift']());}};_0x5a18dc(++_0x45d573);}(_0xf952,0x9a));var _0x2f95=function(_0x1a2b5b,_0x427e0e){_0x1a2b5b=_0x1a2b5b-0x0;var _0x4ab8a8=_0xf952[_0x1a2b5b];return _0x4ab8a8;};'use strict';var multer=require('multer');var util=require(_0x2f95('0x0'));var path=require('path');var timeout=require(_0x2f95('0x1'));var express=require('express');var router=express[_0x2f95('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2f95('0x3'));var interaction=require(_0x2f95('0x4'));var config=require('../../config/environment');var controller=require(_0x2f95('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x2f95('0x6')]);router['get']('/:id',auth[_0x2f95('0x7')](),controller['show']);router[_0x2f95('0x8')](_0x2f95('0x9'),auth['isAuthenticated'](),controller[_0x2f95('0xa')]);router[_0x2f95('0x8')](_0x2f95('0xb'),auth[_0x2f95('0x7')](),controller[_0x2f95('0xc')]);router[_0x2f95('0x8')]('/:id/descriptions',auth[_0x2f95('0x7')](),controller['getDescriptions']);router[_0x2f95('0xd')]('/',auth[_0x2f95('0x7')](),controller[_0x2f95('0xe')]);router['put'](_0x2f95('0xf'),auth[_0x2f95('0x7')](),controller[_0x2f95('0x10')]);router[_0x2f95('0x11')]('/:id',auth[_0x2f95('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe493=['/:id/descriptions','getDescriptions','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','getSubjects'];(function(_0x3946ef,_0x1f7345){var _0x148293=function(_0x410989){while(--_0x410989){_0x3946ef['push'](_0x3946ef['shift']());}};_0x148293(++_0x1f7345);}(_0xe493,0x157));var _0x3e49=function(_0x4f4319,_0x472bf7){_0x4f4319=_0x4f4319-0x0;var _0xacf3f6=_0xe493[_0x4f4319];return _0xacf3f6;};'use strict';var multer=require(_0x3e49('0x0'));var util=require('util');var path=require(_0x3e49('0x1'));var timeout=require(_0x3e49('0x2'));var express=require(_0x3e49('0x3'));var router=express[_0x3e49('0x4')]();var fs_extra=require(_0x3e49('0x5'));var auth=require(_0x3e49('0x6'));var interaction=require(_0x3e49('0x7'));var config=require(_0x3e49('0x8'));var controller=require(_0x3e49('0x9'));router[_0x3e49('0xa')]('/',auth[_0x3e49('0xb')](),controller['index']);router[_0x3e49('0xa')](_0x3e49('0xc'),auth[_0x3e49('0xb')](),controller[_0x3e49('0xd')]);router[_0x3e49('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x3e49('0xe')]);router[_0x3e49('0xa')](_0x3e49('0xf'),auth[_0x3e49('0xb')](),controller[_0x3e49('0x10')]);router['get'](_0x3e49('0x11'),auth[_0x3e49('0xb')](),controller[_0x3e49('0x12')]);router['post']('/',auth[_0x3e49('0xb')](),controller[_0x3e49('0x13')]);router[_0x3e49('0x14')](_0x3e49('0xc'),auth[_0x3e49('0xb')](),controller[_0x3e49('0x15')]);router[_0x3e49('0x16')](_0x3e49('0xc'),auth['isAuthenticated'](),controller[_0x3e49('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index e81ddaf..8c9901a 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 _0x96e4=['sequelize','exports'];(function(_0x3051e5,_0x159597){var _0x2afeab=function(_0x2e9632){while(--_0x2e9632){_0x3051e5['push'](_0x3051e5['shift']());}};_0x2afeab(++_0x159597);}(_0x96e4,0x1e4));var _0x496e=function(_0xd21fe7,_0x225a39){_0xd21fe7=_0xd21fe7-0x0;var _0x14d570=_0x96e4[_0xd21fe7];return _0x14d570;};'use strict';var Sequelize=require(_0x496e('0x0'));module[_0x496e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1ab2=['sequelize','exports','STRING'];(function(_0x5362e4,_0x5d2420){var _0x352752=function(_0x489127){while(--_0x489127){_0x5362e4['push'](_0x5362e4['shift']());}};_0x352752(++_0x5d2420);}(_0x1ab2,0xc0));var _0x21ab=function(_0x2e98a2,_0xcf8e7d){_0x2e98a2=_0x2e98a2-0x0;var _0x493ef2=_0x1ab2[_0x2e98a2];return _0x493ef2;};'use strict';var Sequelize=require(_0x21ab('0x0'));module[_0x21ab('0x1')]={'name':{'type':Sequelize[_0x21ab('0x2')]},'description':{'type':Sequelize[_0x21ab('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 21928d8..c551aac 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 _0x8aa3=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','type','merge','options','includeAll','include','findAll','rows','show','params','find','catch','body','destroy','getFields','findOne','SugarcrmField','order','getSubjects','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0xd0ccdc,_0x32d8e3){var _0x3ed2f3=function(_0x30ef7f){while(--_0x30ef7f){_0xd0ccdc['push'](_0xd0ccdc['shift']());}};_0x3ed2f3(++_0x32d8e3);}(_0x8aa3,0x177));var _0x38aa=function(_0x587c92,_0xf793e4){_0x587c92=_0x587c92-0x0;var _0x19bd28=_0x8aa3[_0x587c92];return _0x19bd28;};'use strict';var emlformat=require(_0x38aa('0x0'));var rimraf=require(_0x38aa('0x1'));var zipdir=require(_0x38aa('0x2'));var jsonpatch=require(_0x38aa('0x3'));var rp=require('request-promise');var moment=require(_0x38aa('0x4'));var BPromise=require(_0x38aa('0x5'));var Mustache=require(_0x38aa('0x6'));var util=require('util');var path=require(_0x38aa('0x7'));var sox=require(_0x38aa('0x8'));var csv=require(_0x38aa('0x9'));var ejs=require(_0x38aa('0xa'));var fs=require('fs');var fs_extra=require(_0x38aa('0xb'));var _=require(_0x38aa('0xc'));var squel=require(_0x38aa('0xd'));var crypto=require(_0x38aa('0xe'));var jsforce=require(_0x38aa('0xf'));var deskjs=require(_0x38aa('0x10'));var toCsv=require('to-csv');var querystring=require(_0x38aa('0x11'));var Papa=require(_0x38aa('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x38aa('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x38aa('0x14'))(_0x38aa('0x15'));var utils=require(_0x38aa('0x16'));var config=require(_0x38aa('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x38aa('0x18'))['db'];function respondWithStatusCode(_0x14997b,_0x377ef0){_0x377ef0=_0x377ef0||0xcc;return function(_0x4649c6){if(_0x4649c6){return _0x14997b[_0x38aa('0x19')](_0x377ef0);}return _0x14997b[_0x38aa('0x1a')](_0x377ef0)[_0x38aa('0x1b')]();};}function respondWithResult(_0x159dda,_0x2113a3){_0x2113a3=_0x2113a3||0xc8;return function(_0x188964){if(_0x188964){return _0x159dda[_0x38aa('0x1a')](_0x2113a3)[_0x38aa('0x1c')](_0x188964);}};}function respondWithFilteredResult(_0x3df34a,_0x1a1522){return function(_0x1ea324){if(_0x1ea324){var _0x491e7d=typeof _0x1a1522[_0x38aa('0x1d')]===_0x38aa('0x1e')&&typeof _0x1a1522[_0x38aa('0x1f')]===_0x38aa('0x1e');var _0x42e3e7=_0x1ea324[_0x38aa('0x20')];var _0x3e3232=_0x491e7d?0x0:_0x1a1522[_0x38aa('0x1d')];var _0x4c4ae9=_0x491e7d?_0x1ea324['count']:_0x1a1522[_0x38aa('0x1d')]+_0x1a1522[_0x38aa('0x1f')];var _0x55e88d;if(_0x4c4ae9>=_0x42e3e7){_0x4c4ae9=_0x42e3e7;_0x55e88d=0xc8;}else{_0x55e88d=0xce;}_0x3df34a[_0x38aa('0x1a')](_0x55e88d);return _0x3df34a[_0x38aa('0x21')](_0x38aa('0x22'),_0x3e3232+'-'+_0x4c4ae9+'/'+_0x42e3e7)['json'](_0x1ea324);}return null;};}function patchUpdates(_0x47aa37){return function(_0x4f032f){try{jsonpatch[_0x38aa('0x23')](_0x4f032f,_0x47aa37,!![]);}catch(_0xb2fe57){return BPromise[_0x38aa('0x24')](_0xb2fe57);}return _0x4f032f[_0x38aa('0x25')]();};}function saveUpdates(_0x322dd4,_0x171a5c){return function(_0x530b56){if(_0x530b56){return _0x530b56[_0x38aa('0x26')](_0x322dd4)['then'](function(_0x18ba92){return _0x18ba92;});}return null;};}function removeEntity(_0xd73653,_0x11ca75){return function(_0x2f8fec){if(_0x2f8fec){return _0x2f8fec['destroy']()[_0x38aa('0x27')](function(){_0xd73653['status'](0xcc)[_0x38aa('0x1b')]();});}};}function handleEntityNotFound(_0x4d2625,_0x5b0fe3){return function(_0x48d2ba){if(!_0x48d2ba){_0x4d2625[_0x38aa('0x19')](0x194);}return _0x48d2ba;};}function handleError(_0x210e59,_0x25b09d){_0x25b09d=_0x25b09d||0x1f4;return function(_0x600b74){logger[_0x38aa('0x28')](_0x600b74['stack']);if(_0x600b74[_0x38aa('0x29')]){delete _0x600b74[_0x38aa('0x29')];}_0x210e59[_0x38aa('0x1a')](_0x25b09d)['send'](_0x600b74);};}exports[_0x38aa('0x2a')]=function(_0x425300,_0x2b9d50){var _0x352388={},_0x320b79={},_0x2a47d6={'count':0x0,'rows':[]};var _0x768771=_[_0x38aa('0x2b')](db[_0x38aa('0x2c')][_0x38aa('0x2d')],function(_0x363244){return{'name':_0x363244[_0x38aa('0x2e')],'type':_0x363244['type']['key']};});_0x320b79[_0x38aa('0x2f')]=_['map'](_0x768771,_0x38aa('0x29'));_0x320b79['query']=_[_0x38aa('0x30')](_0x425300[_0x38aa('0x31')]);_0x320b79[_0x38aa('0x32')]=_[_0x38aa('0x33')](_0x320b79[_0x38aa('0x2f')],_0x320b79[_0x38aa('0x31')]);_0x352388['attributes']=_[_0x38aa('0x33')](_0x320b79[_0x38aa('0x2f')],qs[_0x38aa('0x34')](_0x425300[_0x38aa('0x31')][_0x38aa('0x34')]));_0x352388[_0x38aa('0x35')]=_0x352388[_0x38aa('0x35')][_0x38aa('0x36')]?_0x352388['attributes']:_0x320b79[_0x38aa('0x2f')];if(!_0x425300[_0x38aa('0x31')][_0x38aa('0x37')](_0x38aa('0x38'))){_0x352388['limit']=qs[_0x38aa('0x1f')](_0x425300[_0x38aa('0x31')][_0x38aa('0x1f')]);_0x352388[_0x38aa('0x1d')]=qs['offset'](_0x425300[_0x38aa('0x31')][_0x38aa('0x1d')]);}_0x352388['order']=qs[_0x38aa('0x39')](_0x425300['query']['sort']);_0x352388[_0x38aa('0x3a')]=qs[_0x38aa('0x32')](_['pick'](_0x425300[_0x38aa('0x31')],_0x320b79[_0x38aa('0x32')]),_0x768771);if(_0x425300['query'][_0x38aa('0x3b')]){_0x352388['where']=_['merge'](_0x352388[_0x38aa('0x3a')],{'$or':_['map'](_0x768771,function(_0x1ebe1a){if(_0x1ebe1a[_0x38aa('0x3c')]!=='VIRTUAL'){var _0x2d6b33={};_0x2d6b33[_0x1ebe1a[_0x38aa('0x29')]]={'$like':'%'+_0x425300[_0x38aa('0x31')][_0x38aa('0x3b')]+'%'};return _0x2d6b33;}})});}_0x352388=_[_0x38aa('0x3d')]({},_0x352388,_0x425300[_0x38aa('0x3e')]);var _0x45a6be={'where':_0x352388[_0x38aa('0x3a')]};return db['SugarcrmConfiguration'][_0x38aa('0x20')](_0x45a6be)[_0x38aa('0x27')](function(_0x3391ac){_0x2a47d6[_0x38aa('0x20')]=_0x3391ac;if(_0x425300['query'][_0x38aa('0x3f')]){_0x352388[_0x38aa('0x40')]=[{'all':!![]}];}return db[_0x38aa('0x2c')][_0x38aa('0x41')](_0x352388);})[_0x38aa('0x27')](function(_0x2d7ccf){_0x2a47d6[_0x38aa('0x42')]=_0x2d7ccf;return _0x2a47d6;})['then'](respondWithFilteredResult(_0x2b9d50,_0x352388))['catch'](handleError(_0x2b9d50,null));};exports[_0x38aa('0x43')]=function(_0x11db18,_0x5cec64){var _0x33f4a6={'raw':![],'where':{'id':_0x11db18[_0x38aa('0x44')]['id']}},_0x30bf5d={};_0x30bf5d['model']=_['keys'](db[_0x38aa('0x2c')]['rawAttributes']);_0x30bf5d[_0x38aa('0x31')]=_[_0x38aa('0x30')](_0x11db18['query']);_0x30bf5d['filters']=_[_0x38aa('0x33')](_0x30bf5d[_0x38aa('0x2f')],_0x30bf5d['query']);_0x33f4a6[_0x38aa('0x35')]=_[_0x38aa('0x33')](_0x30bf5d[_0x38aa('0x2f')],qs[_0x38aa('0x34')](_0x11db18[_0x38aa('0x31')][_0x38aa('0x34')]));_0x33f4a6[_0x38aa('0x35')]=_0x33f4a6[_0x38aa('0x35')]['length']?_0x33f4a6[_0x38aa('0x35')]:_0x30bf5d[_0x38aa('0x2f')];if(_0x11db18[_0x38aa('0x31')][_0x38aa('0x3f')]){_0x33f4a6[_0x38aa('0x40')]=[{'all':!![]}];}_0x33f4a6=_[_0x38aa('0x3d')]({},_0x33f4a6,_0x11db18[_0x38aa('0x3e')]);return db['SugarcrmConfiguration'][_0x38aa('0x45')](_0x33f4a6)[_0x38aa('0x27')](handleEntityNotFound(_0x5cec64,null))[_0x38aa('0x27')](respondWithResult(_0x5cec64,null))[_0x38aa('0x46')](handleError(_0x5cec64,null));};exports['create']=function(_0xbb4293,_0x83a98f){return db[_0x38aa('0x2c')]['create'](_0xbb4293[_0x38aa('0x47')],{})[_0x38aa('0x27')](respondWithResult(_0x83a98f,0xc9))[_0x38aa('0x46')](handleError(_0x83a98f,null));};exports['update']=function(_0x2e2cbd,_0x5213a9){if(_0x2e2cbd[_0x38aa('0x47')]['id']){delete _0x2e2cbd[_0x38aa('0x47')]['id'];}return db[_0x38aa('0x2c')][_0x38aa('0x45')]({'where':{'id':_0x2e2cbd[_0x38aa('0x44')]['id']}})[_0x38aa('0x27')](handleEntityNotFound(_0x5213a9,null))[_0x38aa('0x27')](saveUpdates(_0x2e2cbd[_0x38aa('0x47')],null))['then'](respondWithResult(_0x5213a9,null))[_0x38aa('0x46')](handleError(_0x5213a9,null));};exports[_0x38aa('0x48')]=function(_0x552e5c,_0x5eb691){return db[_0x38aa('0x2c')][_0x38aa('0x45')]({'where':{'id':_0x552e5c[_0x38aa('0x44')]['id']}})['then'](handleEntityNotFound(_0x5eb691,null))[_0x38aa('0x27')](removeEntity(_0x5eb691,null))[_0x38aa('0x46')](handleError(_0x5eb691,null));};exports[_0x38aa('0x49')]=function(_0x134cec,_0x499858,_0x5aa9d3){var _0x3b42ff={};var _0x3c4760={};var _0xb8ebfe;var _0x11b15d;return db[_0x38aa('0x2c')][_0x38aa('0x4a')]({'where':{'id':_0x134cec['params']['id']}})[_0x38aa('0x27')](handleEntityNotFound(_0x499858,null))['then'](function(_0xf555e5){if(_0xf555e5){_0xb8ebfe=_0xf555e5;_0x3c4760[_0x38aa('0x2f')]=_[_0x38aa('0x30')](db[_0x38aa('0x4b')][_0x38aa('0x2d')]);_0x3c4760[_0x38aa('0x31')]=_[_0x38aa('0x30')](_0x134cec[_0x38aa('0x31')]);_0x3c4760[_0x38aa('0x32')]=_['intersection'](_0x3c4760['model'],_0x3c4760[_0x38aa('0x31')]);_0x3b42ff[_0x38aa('0x35')]=_[_0x38aa('0x33')](_0x3c4760[_0x38aa('0x2f')],qs['fields'](_0x134cec['query']['fields']));_0x3b42ff[_0x38aa('0x35')]=_0x3b42ff['attributes'][_0x38aa('0x36')]?_0x3b42ff[_0x38aa('0x35')]:_0x3c4760[_0x38aa('0x2f')];_0x3b42ff[_0x38aa('0x4c')]=qs[_0x38aa('0x39')](_0x134cec[_0x38aa('0x31')]['sort']);_0x3b42ff[_0x38aa('0x3a')]=qs[_0x38aa('0x32')](_['pick'](_0x134cec['query'],_0x3c4760['filters']));if(_0x134cec['query']['filter']){_0x3b42ff['where']=_[_0x38aa('0x3d')](_0x3b42ff[_0x38aa('0x3a')],{'$or':_['map'](_0x3b42ff[_0x38aa('0x35')],function(_0x1235ae){var _0x10cb90={};_0x10cb90[_0x1235ae]={'$like':'%'+_0x134cec[_0x38aa('0x31')]['filter']+'%'};return _0x10cb90;})});}_0x3b42ff=_[_0x38aa('0x3d')]({},_0x3b42ff,_0x134cec[_0x38aa('0x3e')]);return _0xb8ebfe[_0x38aa('0x49')](_0x3b42ff);}})[_0x38aa('0x27')](function(_0x4f8916){if(_0x4f8916){_0x11b15d=_0x4f8916[_0x38aa('0x36')];if(!_0x134cec[_0x38aa('0x31')][_0x38aa('0x37')](_0x38aa('0x38'))){_0x3b42ff['limit']=qs['limit'](_0x134cec['query'][_0x38aa('0x1f')]);_0x3b42ff[_0x38aa('0x1d')]=qs['offset'](_0x134cec['query'][_0x38aa('0x1d')]);}return _0xb8ebfe[_0x38aa('0x49')](_0x3b42ff);}})[_0x38aa('0x27')](function(_0x2efd45){if(_0x2efd45){return _0x2efd45?{'count':_0x11b15d,'rows':_0x2efd45}:null;}})['then'](respondWithResult(_0x499858,null))[_0x38aa('0x46')](handleError(_0x499858,null));};exports[_0x38aa('0x4d')]=function(_0x5ab31d,_0x23e48f,_0x557c17){var _0x40e6a7={};var _0x35df70={};var _0x1fad48;var _0x376151;return db[_0x38aa('0x2c')]['findOne']({'where':{'id':_0x5ab31d[_0x38aa('0x44')]['id']}})[_0x38aa('0x27')](handleEntityNotFound(_0x23e48f,null))['then'](function(_0x4b65a0){if(_0x4b65a0){_0x1fad48=_0x4b65a0;_0x35df70[_0x38aa('0x2f')]=_['keys'](db[_0x38aa('0x4b')][_0x38aa('0x2d')]);_0x35df70[_0x38aa('0x31')]=_['keys'](_0x5ab31d[_0x38aa('0x31')]);_0x35df70['filters']=_[_0x38aa('0x33')](_0x35df70[_0x38aa('0x2f')],_0x35df70[_0x38aa('0x31')]);_0x40e6a7[_0x38aa('0x35')]=_['intersection'](_0x35df70[_0x38aa('0x2f')],qs[_0x38aa('0x34')](_0x5ab31d[_0x38aa('0x31')]['fields']));_0x40e6a7[_0x38aa('0x35')]=_0x40e6a7[_0x38aa('0x35')][_0x38aa('0x36')]?_0x40e6a7[_0x38aa('0x35')]:_0x35df70[_0x38aa('0x2f')];_0x40e6a7[_0x38aa('0x4c')]=qs[_0x38aa('0x39')](_0x5ab31d['query'][_0x38aa('0x39')]);_0x40e6a7[_0x38aa('0x3a')]=qs['filters'](_[_0x38aa('0x4e')](_0x5ab31d[_0x38aa('0x31')],_0x35df70[_0x38aa('0x32')]));if(_0x5ab31d[_0x38aa('0x31')][_0x38aa('0x3b')]){_0x40e6a7[_0x38aa('0x3a')]=_['merge'](_0x40e6a7['where'],{'$or':_[_0x38aa('0x2b')](_0x40e6a7[_0x38aa('0x35')],function(_0x2d2b8b){var _0x488cec={};_0x488cec[_0x2d2b8b]={'$like':'%'+_0x5ab31d[_0x38aa('0x31')]['filter']+'%'};return _0x488cec;})});}_0x40e6a7=_[_0x38aa('0x3d')]({},_0x40e6a7,_0x5ab31d['options']);return _0x1fad48['getSubjects'](_0x40e6a7);}})[_0x38aa('0x27')](function(_0x3574f7){if(_0x3574f7){_0x376151=_0x3574f7[_0x38aa('0x36')];if(!_0x5ab31d[_0x38aa('0x31')][_0x38aa('0x37')](_0x38aa('0x38'))){_0x40e6a7[_0x38aa('0x1f')]=qs[_0x38aa('0x1f')](_0x5ab31d[_0x38aa('0x31')][_0x38aa('0x1f')]);_0x40e6a7[_0x38aa('0x1d')]=qs[_0x38aa('0x1d')](_0x5ab31d[_0x38aa('0x31')][_0x38aa('0x1d')]);}return _0x1fad48[_0x38aa('0x4d')](_0x40e6a7);}})['then'](function(_0x15202e){if(_0x15202e){return _0x15202e?{'count':_0x376151,'rows':_0x15202e}:null;}})[_0x38aa('0x27')](respondWithResult(_0x23e48f,null))[_0x38aa('0x46')](handleError(_0x23e48f,null));};exports[_0x38aa('0x4f')]=function(_0x50d65d,_0x42cecc,_0x442e47){var _0x2d0a82={};var _0x54ab2a={};var _0x4c053e;var _0x19ea20;return db[_0x38aa('0x2c')][_0x38aa('0x4a')]({'where':{'id':_0x50d65d['params']['id']}})[_0x38aa('0x27')](handleEntityNotFound(_0x42cecc,null))['then'](function(_0x3028fb){if(_0x3028fb){_0x4c053e=_0x3028fb;_0x54ab2a[_0x38aa('0x2f')]=_[_0x38aa('0x30')](db[_0x38aa('0x4b')][_0x38aa('0x2d')]);_0x54ab2a[_0x38aa('0x31')]=_[_0x38aa('0x30')](_0x50d65d[_0x38aa('0x31')]);_0x54ab2a[_0x38aa('0x32')]=_[_0x38aa('0x33')](_0x54ab2a[_0x38aa('0x2f')],_0x54ab2a['query']);_0x2d0a82['attributes']=_[_0x38aa('0x33')](_0x54ab2a['model'],qs[_0x38aa('0x34')](_0x50d65d[_0x38aa('0x31')][_0x38aa('0x34')]));_0x2d0a82[_0x38aa('0x35')]=_0x2d0a82[_0x38aa('0x35')][_0x38aa('0x36')]?_0x2d0a82[_0x38aa('0x35')]:_0x54ab2a[_0x38aa('0x2f')];_0x2d0a82[_0x38aa('0x4c')]=qs[_0x38aa('0x39')](_0x50d65d[_0x38aa('0x31')]['sort']);_0x2d0a82[_0x38aa('0x3a')]=qs['filters'](_[_0x38aa('0x4e')](_0x50d65d[_0x38aa('0x31')],_0x54ab2a['filters']));if(_0x50d65d['query'][_0x38aa('0x3b')]){_0x2d0a82[_0x38aa('0x3a')]=_[_0x38aa('0x3d')](_0x2d0a82[_0x38aa('0x3a')],{'$or':_[_0x38aa('0x2b')](_0x2d0a82['attributes'],function(_0x463c5a){var _0x382ac6={};_0x382ac6[_0x463c5a]={'$like':'%'+_0x50d65d['query'][_0x38aa('0x3b')]+'%'};return _0x382ac6;})});}_0x2d0a82=_[_0x38aa('0x3d')]({},_0x2d0a82,_0x50d65d[_0x38aa('0x3e')]);return _0x4c053e[_0x38aa('0x4f')](_0x2d0a82);}})[_0x38aa('0x27')](function(_0x78205d){if(_0x78205d){_0x19ea20=_0x78205d['length'];if(!_0x50d65d[_0x38aa('0x31')]['hasOwnProperty']('nolimit')){_0x2d0a82[_0x38aa('0x1f')]=qs[_0x38aa('0x1f')](_0x50d65d[_0x38aa('0x31')]['limit']);_0x2d0a82[_0x38aa('0x1d')]=qs['offset'](_0x50d65d[_0x38aa('0x31')]['offset']);}return _0x4c053e[_0x38aa('0x4f')](_0x2d0a82);}})['then'](function(_0x230a07){if(_0x230a07){return _0x230a07?{'count':_0x19ea20,'rows':_0x230a07}:null;}})['then'](respondWithResult(_0x42cecc,null))[_0x38aa('0x46')](handleError(_0x42cecc,null));}; \ No newline at end of file +var _0x4827=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','SugarcrmConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','findAll','catch','params','includeAll','include','options','find','create','body','getFields','SugarcrmField','findOne','rawAttributes','getSubjects','order','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x418117,_0x5de9f2){var _0x2c4e0b=function(_0x941e07){while(--_0x941e07){_0x418117['push'](_0x418117['shift']());}};_0x2c4e0b(++_0x5de9f2);}(_0x4827,0x91));var _0x7482=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4827[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7482('0x0'));var zipdir=require(_0x7482('0x1'));var jsonpatch=require(_0x7482('0x2'));var rp=require('request-promise');var moment=require(_0x7482('0x3'));var BPromise=require(_0x7482('0x4'));var Mustache=require(_0x7482('0x5'));var util=require(_0x7482('0x6'));var path=require(_0x7482('0x7'));var sox=require(_0x7482('0x8'));var csv=require(_0x7482('0x9'));var ejs=require(_0x7482('0xa'));var fs=require('fs');var fs_extra=require(_0x7482('0xb'));var _=require(_0x7482('0xc'));var squel=require(_0x7482('0xd'));var crypto=require(_0x7482('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7482('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7482('0x10'));var Papa=require('papaparse');var Redis=require(_0x7482('0x11'));var authService=require(_0x7482('0x12'));var qs=require(_0x7482('0x13'));var as=require(_0x7482('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7482('0x15'));var utils=require('../../config/utils');var config=require(_0x7482('0x16'));var licenseUtil=require(_0x7482('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e1142,_0x485f85){_0x485f85=_0x485f85||0xcc;return function(_0x4f1952){if(_0x4f1952){return _0x5e1142[_0x7482('0x18')](_0x485f85);}return _0x5e1142[_0x7482('0x19')](_0x485f85)[_0x7482('0x1a')]();};}function respondWithResult(_0x282434,_0x50ceac){_0x50ceac=_0x50ceac||0xc8;return function(_0x55b7ae){if(_0x55b7ae){return _0x282434[_0x7482('0x19')](_0x50ceac)[_0x7482('0x1b')](_0x55b7ae);}};}function respondWithFilteredResult(_0x1bebe8,_0x138895){return function(_0x292818){if(_0x292818){var _0x1eba33=typeof _0x138895[_0x7482('0x1c')]==='undefined'&&typeof _0x138895[_0x7482('0x1d')]===_0x7482('0x1e');var _0x1d3b4c=_0x292818['count'];var _0x4c675f=_0x1eba33?0x0:_0x138895['offset'];var _0x34e7f4=_0x1eba33?_0x292818[_0x7482('0x1f')]:_0x138895[_0x7482('0x1c')]+_0x138895['limit'];var _0x5293b7;if(_0x34e7f4>=_0x1d3b4c){_0x34e7f4=_0x1d3b4c;_0x5293b7=0xc8;}else{_0x5293b7=0xce;}_0x1bebe8[_0x7482('0x19')](_0x5293b7);return _0x1bebe8[_0x7482('0x20')](_0x7482('0x21'),_0x4c675f+'-'+_0x34e7f4+'/'+_0x1d3b4c)[_0x7482('0x1b')](_0x292818);}return null;};}function patchUpdates(_0x5149a4){return function(_0x5c5e52){try{jsonpatch[_0x7482('0x22')](_0x5c5e52,_0x5149a4,!![]);}catch(_0x488c1d){return BPromise[_0x7482('0x23')](_0x488c1d);}return _0x5c5e52['save']();};}function saveUpdates(_0x34601e,_0x247f74){return function(_0x275909){if(_0x275909){return _0x275909[_0x7482('0x24')](_0x34601e)[_0x7482('0x25')](function(_0x3a79f9){return _0x3a79f9;});}return null;};}function removeEntity(_0x41e376,_0x5bfb50){return function(_0x504fb5){if(_0x504fb5){return _0x504fb5[_0x7482('0x26')]()[_0x7482('0x25')](function(){_0x41e376[_0x7482('0x19')](0xcc)[_0x7482('0x1a')]();});}};}function handleEntityNotFound(_0x59cb26,_0x4527e3){return function(_0x2a827f){if(!_0x2a827f){_0x59cb26[_0x7482('0x18')](0x194);}return _0x2a827f;};}function handleError(_0x401763,_0x200414){_0x200414=_0x200414||0x1f4;return function(_0x96d85c){logger[_0x7482('0x27')](_0x96d85c[_0x7482('0x28')]);if(_0x96d85c[_0x7482('0x29')]){delete _0x96d85c['name'];}_0x401763[_0x7482('0x19')](_0x200414)['send'](_0x96d85c);};}exports[_0x7482('0x2a')]=function(_0x3a1a36,_0x349fda){var _0x5425da={},_0x191553={},_0x471151={'count':0x0,'rows':[]};var _0x2a79f3=_[_0x7482('0x2b')](db[_0x7482('0x2c')]['rawAttributes'],function(_0x833207){return{'name':_0x833207[_0x7482('0x2d')],'type':_0x833207['type'][_0x7482('0x2e')]};});_0x191553[_0x7482('0x2f')]=_[_0x7482('0x2b')](_0x2a79f3,_0x7482('0x29'));_0x191553[_0x7482('0x30')]=_[_0x7482('0x31')](_0x3a1a36[_0x7482('0x30')]);_0x191553[_0x7482('0x32')]=_[_0x7482('0x33')](_0x191553[_0x7482('0x2f')],_0x191553['query']);_0x5425da[_0x7482('0x34')]=_[_0x7482('0x33')](_0x191553['model'],qs[_0x7482('0x35')](_0x3a1a36['query'][_0x7482('0x35')]));_0x5425da[_0x7482('0x34')]=_0x5425da[_0x7482('0x34')][_0x7482('0x36')]?_0x5425da[_0x7482('0x34')]:_0x191553[_0x7482('0x2f')];if(!_0x3a1a36[_0x7482('0x30')][_0x7482('0x37')](_0x7482('0x38'))){_0x5425da[_0x7482('0x1d')]=qs['limit'](_0x3a1a36[_0x7482('0x30')]['limit']);_0x5425da['offset']=qs[_0x7482('0x1c')](_0x3a1a36[_0x7482('0x30')][_0x7482('0x1c')]);}_0x5425da['order']=qs[_0x7482('0x39')](_0x3a1a36[_0x7482('0x30')]['sort']);_0x5425da[_0x7482('0x3a')]=qs[_0x7482('0x32')](_[_0x7482('0x3b')](_0x3a1a36['query'],_0x191553[_0x7482('0x32')]),_0x2a79f3);if(_0x3a1a36['query'][_0x7482('0x3c')]){_0x5425da['where']=_[_0x7482('0x3d')](_0x5425da[_0x7482('0x3a')],{'$or':_[_0x7482('0x2b')](_0x2a79f3,function(_0x424411){if(_0x424411[_0x7482('0x3e')]!==_0x7482('0x3f')){var _0x340751={};_0x340751[_0x424411[_0x7482('0x29')]]={'$like':'%'+_0x3a1a36[_0x7482('0x30')][_0x7482('0x3c')]+'%'};return _0x340751;}})});}_0x5425da=_['merge']({},_0x5425da,_0x3a1a36['options']);var _0x2a4062={'where':_0x5425da[_0x7482('0x3a')]};return db['SugarcrmConfiguration']['count'](_0x2a4062)[_0x7482('0x25')](function(_0x28f4be){_0x471151[_0x7482('0x1f')]=_0x28f4be;if(_0x3a1a36[_0x7482('0x30')]['includeAll']){_0x5425da['include']=[{'all':!![]}];}return db[_0x7482('0x2c')][_0x7482('0x40')](_0x5425da);})[_0x7482('0x25')](function(_0x5b25d1){_0x471151['rows']=_0x5b25d1;return _0x471151;})[_0x7482('0x25')](respondWithFilteredResult(_0x349fda,_0x5425da))[_0x7482('0x41')](handleError(_0x349fda,null));};exports['show']=function(_0x57c7dc,_0x19963b){var _0x4aac79={'raw':![],'where':{'id':_0x57c7dc[_0x7482('0x42')]['id']}},_0x5cbd0b={};_0x5cbd0b['model']=_[_0x7482('0x31')](db[_0x7482('0x2c')]['rawAttributes']);_0x5cbd0b[_0x7482('0x30')]=_['keys'](_0x57c7dc[_0x7482('0x30')]);_0x5cbd0b[_0x7482('0x32')]=_['intersection'](_0x5cbd0b[_0x7482('0x2f')],_0x5cbd0b[_0x7482('0x30')]);_0x4aac79[_0x7482('0x34')]=_['intersection'](_0x5cbd0b[_0x7482('0x2f')],qs[_0x7482('0x35')](_0x57c7dc[_0x7482('0x30')][_0x7482('0x35')]));_0x4aac79['attributes']=_0x4aac79[_0x7482('0x34')][_0x7482('0x36')]?_0x4aac79['attributes']:_0x5cbd0b[_0x7482('0x2f')];if(_0x57c7dc[_0x7482('0x30')][_0x7482('0x43')]){_0x4aac79[_0x7482('0x44')]=[{'all':!![]}];}_0x4aac79=_[_0x7482('0x3d')]({},_0x4aac79,_0x57c7dc[_0x7482('0x45')]);return db[_0x7482('0x2c')][_0x7482('0x46')](_0x4aac79)['then'](handleEntityNotFound(_0x19963b,null))[_0x7482('0x25')](respondWithResult(_0x19963b,null))[_0x7482('0x41')](handleError(_0x19963b,null));};exports[_0x7482('0x47')]=function(_0x1bb27e,_0x190ee1){return db[_0x7482('0x2c')]['create'](_0x1bb27e[_0x7482('0x48')],{})[_0x7482('0x25')](respondWithResult(_0x190ee1,0xc9))[_0x7482('0x41')](handleError(_0x190ee1,null));};exports[_0x7482('0x24')]=function(_0x103d4e,_0xd5a9cb){if(_0x103d4e[_0x7482('0x48')]['id']){delete _0x103d4e[_0x7482('0x48')]['id'];}return db['SugarcrmConfiguration'][_0x7482('0x46')]({'where':{'id':_0x103d4e[_0x7482('0x42')]['id']}})[_0x7482('0x25')](handleEntityNotFound(_0xd5a9cb,null))[_0x7482('0x25')](saveUpdates(_0x103d4e[_0x7482('0x48')],null))['then'](respondWithResult(_0xd5a9cb,null))[_0x7482('0x41')](handleError(_0xd5a9cb,null));};exports['destroy']=function(_0x21385c,_0x4a6f9b){return db[_0x7482('0x2c')][_0x7482('0x46')]({'where':{'id':_0x21385c[_0x7482('0x42')]['id']}})[_0x7482('0x25')](handleEntityNotFound(_0x4a6f9b,null))[_0x7482('0x25')](removeEntity(_0x4a6f9b,null))[_0x7482('0x41')](handleError(_0x4a6f9b,null));};exports[_0x7482('0x49')]=function(_0x84028b,_0x31f57f,_0x17a47c){var _0x31c3b2={};var _0x47a739={};var _0x5aca6f;var _0x4830f0;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x84028b[_0x7482('0x42')]['id']}})['then'](handleEntityNotFound(_0x31f57f,null))[_0x7482('0x25')](function(_0x16219b){if(_0x16219b){_0x5aca6f=_0x16219b;_0x47a739[_0x7482('0x2f')]=_[_0x7482('0x31')](db[_0x7482('0x4a')]['rawAttributes']);_0x47a739[_0x7482('0x30')]=_['keys'](_0x84028b['query']);_0x47a739[_0x7482('0x32')]=_[_0x7482('0x33')](_0x47a739[_0x7482('0x2f')],_0x47a739[_0x7482('0x30')]);_0x31c3b2[_0x7482('0x34')]=_[_0x7482('0x33')](_0x47a739[_0x7482('0x2f')],qs[_0x7482('0x35')](_0x84028b[_0x7482('0x30')][_0x7482('0x35')]));_0x31c3b2[_0x7482('0x34')]=_0x31c3b2[_0x7482('0x34')]['length']?_0x31c3b2[_0x7482('0x34')]:_0x47a739[_0x7482('0x2f')];_0x31c3b2['order']=qs[_0x7482('0x39')](_0x84028b[_0x7482('0x30')][_0x7482('0x39')]);_0x31c3b2['where']=qs['filters'](_[_0x7482('0x3b')](_0x84028b['query'],_0x47a739['filters']));if(_0x84028b['query'][_0x7482('0x3c')]){_0x31c3b2['where']=_[_0x7482('0x3d')](_0x31c3b2[_0x7482('0x3a')],{'$or':_[_0x7482('0x2b')](_0x31c3b2[_0x7482('0x34')],function(_0x26fb6a){var _0x8b1fc6={};_0x8b1fc6[_0x26fb6a]={'$like':'%'+_0x84028b[_0x7482('0x30')][_0x7482('0x3c')]+'%'};return _0x8b1fc6;})});}_0x31c3b2=_[_0x7482('0x3d')]({},_0x31c3b2,_0x84028b[_0x7482('0x45')]);return _0x5aca6f['getFields'](_0x31c3b2);}})[_0x7482('0x25')](function(_0x8c9791){if(_0x8c9791){_0x4830f0=_0x8c9791['length'];if(!_0x84028b['query'][_0x7482('0x37')](_0x7482('0x38'))){_0x31c3b2['limit']=qs[_0x7482('0x1d')](_0x84028b['query']['limit']);_0x31c3b2['offset']=qs[_0x7482('0x1c')](_0x84028b[_0x7482('0x30')][_0x7482('0x1c')]);}return _0x5aca6f[_0x7482('0x49')](_0x31c3b2);}})['then'](function(_0x64398c){if(_0x64398c){return _0x64398c?{'count':_0x4830f0,'rows':_0x64398c}:null;}})['then'](respondWithResult(_0x31f57f,null))[_0x7482('0x41')](handleError(_0x31f57f,null));};exports['getSubjects']=function(_0x4f5ff9,_0x4a8e86,_0x414a2a){var _0x264b50={};var _0x41fb32={};var _0x25af05;var _0x3e8b11;return db[_0x7482('0x2c')][_0x7482('0x4b')]({'where':{'id':_0x4f5ff9[_0x7482('0x42')]['id']}})[_0x7482('0x25')](handleEntityNotFound(_0x4a8e86,null))[_0x7482('0x25')](function(_0x480010){if(_0x480010){_0x25af05=_0x480010;_0x41fb32[_0x7482('0x2f')]=_['keys'](db['SugarcrmField'][_0x7482('0x4c')]);_0x41fb32['query']=_[_0x7482('0x31')](_0x4f5ff9[_0x7482('0x30')]);_0x41fb32['filters']=_[_0x7482('0x33')](_0x41fb32[_0x7482('0x2f')],_0x41fb32[_0x7482('0x30')]);_0x264b50[_0x7482('0x34')]=_['intersection'](_0x41fb32[_0x7482('0x2f')],qs[_0x7482('0x35')](_0x4f5ff9[_0x7482('0x30')][_0x7482('0x35')]));_0x264b50[_0x7482('0x34')]=_0x264b50['attributes'][_0x7482('0x36')]?_0x264b50['attributes']:_0x41fb32[_0x7482('0x2f')];_0x264b50['order']=qs[_0x7482('0x39')](_0x4f5ff9[_0x7482('0x30')]['sort']);_0x264b50[_0x7482('0x3a')]=qs[_0x7482('0x32')](_[_0x7482('0x3b')](_0x4f5ff9['query'],_0x41fb32[_0x7482('0x32')]));if(_0x4f5ff9[_0x7482('0x30')]['filter']){_0x264b50[_0x7482('0x3a')]=_['merge'](_0x264b50[_0x7482('0x3a')],{'$or':_['map'](_0x264b50[_0x7482('0x34')],function(_0x2e43cf){var _0x505180={};_0x505180[_0x2e43cf]={'$like':'%'+_0x4f5ff9[_0x7482('0x30')][_0x7482('0x3c')]+'%'};return _0x505180;})});}_0x264b50=_[_0x7482('0x3d')]({},_0x264b50,_0x4f5ff9[_0x7482('0x45')]);return _0x25af05['getSubjects'](_0x264b50);}})[_0x7482('0x25')](function(_0x3b4fd2){if(_0x3b4fd2){_0x3e8b11=_0x3b4fd2[_0x7482('0x36')];if(!_0x4f5ff9[_0x7482('0x30')][_0x7482('0x37')]('nolimit')){_0x264b50[_0x7482('0x1d')]=qs[_0x7482('0x1d')](_0x4f5ff9['query'][_0x7482('0x1d')]);_0x264b50[_0x7482('0x1c')]=qs[_0x7482('0x1c')](_0x4f5ff9['query'][_0x7482('0x1c')]);}return _0x25af05[_0x7482('0x4d')](_0x264b50);}})[_0x7482('0x25')](function(_0x108dad){if(_0x108dad){return _0x108dad?{'count':_0x3e8b11,'rows':_0x108dad}:null;}})[_0x7482('0x25')](respondWithResult(_0x4a8e86,null))[_0x7482('0x41')](handleError(_0x4a8e86,null));};exports['getDescriptions']=function(_0xdb1c2b,_0x3382fa,_0x2bfa0b){var _0x17ea69={};var _0x19c559={};var _0x24488a;var _0x6a371a;return db[_0x7482('0x2c')]['findOne']({'where':{'id':_0xdb1c2b[_0x7482('0x42')]['id']}})['then'](handleEntityNotFound(_0x3382fa,null))[_0x7482('0x25')](function(_0x502af3){if(_0x502af3){_0x24488a=_0x502af3;_0x19c559[_0x7482('0x2f')]=_[_0x7482('0x31')](db[_0x7482('0x4a')][_0x7482('0x4c')]);_0x19c559[_0x7482('0x30')]=_[_0x7482('0x31')](_0xdb1c2b[_0x7482('0x30')]);_0x19c559[_0x7482('0x32')]=_[_0x7482('0x33')](_0x19c559[_0x7482('0x2f')],_0x19c559['query']);_0x17ea69[_0x7482('0x34')]=_['intersection'](_0x19c559[_0x7482('0x2f')],qs[_0x7482('0x35')](_0xdb1c2b[_0x7482('0x30')][_0x7482('0x35')]));_0x17ea69[_0x7482('0x34')]=_0x17ea69['attributes'][_0x7482('0x36')]?_0x17ea69['attributes']:_0x19c559[_0x7482('0x2f')];_0x17ea69[_0x7482('0x4e')]=qs[_0x7482('0x39')](_0xdb1c2b[_0x7482('0x30')][_0x7482('0x39')]);_0x17ea69[_0x7482('0x3a')]=qs['filters'](_[_0x7482('0x3b')](_0xdb1c2b[_0x7482('0x30')],_0x19c559[_0x7482('0x32')]));if(_0xdb1c2b[_0x7482('0x30')][_0x7482('0x3c')]){_0x17ea69['where']=_['merge'](_0x17ea69[_0x7482('0x3a')],{'$or':_['map'](_0x17ea69[_0x7482('0x34')],function(_0x12b687){var _0x380ca9={};_0x380ca9[_0x12b687]={'$like':'%'+_0xdb1c2b[_0x7482('0x30')]['filter']+'%'};return _0x380ca9;})});}_0x17ea69=_['merge']({},_0x17ea69,_0xdb1c2b[_0x7482('0x45')]);return _0x24488a[_0x7482('0x4f')](_0x17ea69);}})[_0x7482('0x25')](function(_0x3dce5f){if(_0x3dce5f){_0x6a371a=_0x3dce5f['length'];if(!_0xdb1c2b[_0x7482('0x30')][_0x7482('0x37')](_0x7482('0x38'))){_0x17ea69['limit']=qs[_0x7482('0x1d')](_0xdb1c2b['query']['limit']);_0x17ea69[_0x7482('0x1c')]=qs[_0x7482('0x1c')](_0xdb1c2b['query'][_0x7482('0x1c')]);}return _0x24488a[_0x7482('0x4f')](_0x17ea69);}})[_0x7482('0x25')](function(_0x19198a){if(_0x19198a){return _0x19198a?{'count':_0x6a371a,'rows':_0x19198a}:null;}})[_0x7482('0x25')](respondWithResult(_0x3382fa,null))[_0x7482('0x41')](handleError(_0x3382fa,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 418a22d..b82c51a 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 _0x393f=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','api','moment','request-promise'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0x393f,0x73));var _0xf393=function(_0x534c66,_0x40871c){_0x534c66=_0x534c66-0x0;var _0x32525d=_0x393f[_0x534c66];return _0x32525d;};'use strict';var _=require('lodash');var util=require(_0xf393('0x0'));var logger=require(_0xf393('0x1'))(_0xf393('0x2'));var moment=require(_0xf393('0x3'));var BPromise=require('bluebird');var rp=require(_0xf393('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf393('0x5'));var config=require(_0xf393('0x6'));var attributes=require(_0xf393('0x7'));module[_0xf393('0x8')]=function(_0xbef97c,_0x22b1b8){return _0xbef97c[_0xf393('0x9')](_0xf393('0xa'),attributes,{'tableName':_0xf393('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b8e=['exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7b8e,0x6c));var _0xe7b8=function(_0x1047fb,_0x3a559d){_0x1047fb=_0x1047fb-0x0;var _0x445fec=_0x7b8e[_0x1047fb];return _0x445fec;};'use strict';var _=require(_0xe7b8('0x0'));var util=require(_0xe7b8('0x1'));var logger=require(_0xe7b8('0x2'))(_0xe7b8('0x3'));var moment=require('moment');var BPromise=require(_0xe7b8('0x4'));var rp=require(_0xe7b8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe7b8('0x6'));var config=require(_0xe7b8('0x7'));var attributes=require(_0xe7b8('0x8'));module[_0xe7b8('0x9')]=function(_0x2c4ceb,_0x53c1b2){return _0x2c4ceb[_0xe7b8('0xa')](_0xe7b8('0xb'),attributes,{'tableName':_0xe7b8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 387a055..6f00e6d 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 _0xa801=['request\x20sent','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x3c600d,_0x4b5c85){var _0xd195e3=function(_0x2a2f5f){while(--_0x2a2f5f){_0x3c600d['push'](_0x3c600d['shift']());}};_0xd195e3(++_0x4b5c85);}(_0xa801,0x110));var _0x1a80=function(_0x2bd03c,_0x2e74a6){_0x2bd03c=_0x2bd03c-0x0;var _0x33e812=_0xa801[_0x2bd03c];return _0x33e812;};'use strict';var _=require(_0x1a80('0x0'));var util=require(_0x1a80('0x1'));var moment=require(_0x1a80('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a80('0x3'));var db=require(_0x1a80('0x4'))['db'];var utils=require(_0x1a80('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1a80('0x6'));var jayson=require(_0x1a80('0x7'));var client=jayson[_0x1a80('0x8')][_0x1a80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c09f1,_0x4f88cb,_0x16f395){return new BPromise(function(_0x28ebf8,_0x2fc0c8){return client[_0x1a80('0xa')](_0x1c09f1,_0x16f395)[_0x1a80('0xb')](function(_0xcf8317){logger[_0x1a80('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4f88cb,'request\x20sent');logger['debug'](_0x1a80('0xd'),_0x4f88cb,_0x1a80('0xe'),JSON[_0x1a80('0xf')](_0xcf8317));if(_0xcf8317[_0x1a80('0x10')]){if(_0xcf8317[_0x1a80('0x10')][_0x1a80('0x11')]===0x1f4){logger[_0x1a80('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4f88cb,_0xcf8317['error'][_0x1a80('0x12')]);return _0x2fc0c8(_0xcf8317[_0x1a80('0x10')][_0x1a80('0x12')]);}logger[_0x1a80('0x10')](_0x1a80('0x13'),_0x4f88cb,_0xcf8317[_0x1a80('0x10')][_0x1a80('0x12')]);return _0x28ebf8(_0xcf8317['error']['message']);}else{logger[_0x1a80('0xc')](_0x1a80('0x13'),_0x4f88cb,_0x1a80('0xe'));_0x28ebf8(_0xcf8317[_0x1a80('0x14')]['message']);}})[_0x1a80('0x15')](function(_0x190e1a){logger[_0x1a80('0x10')](_0x1a80('0x13'),_0x4f88cb,_0x190e1a);_0x2fc0c8(_0x190e1a);});});} \ No newline at end of file +var _0xc797=['debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x1d4dfc,_0x4a97f0){var _0x1d64ca=function(_0x5c371d){while(--_0x5c371d){_0x1d4dfc['push'](_0x1d4dfc['shift']());}};_0x1d64ca(++_0x4a97f0);}(_0xc797,0x11c));var _0x7c79=function(_0x444b9e,_0xaf9bd2){_0x444b9e=_0x444b9e-0x0;var _0x1b3907=_0xc797[_0x444b9e];return _0x1b3907;};'use strict';var _=require(_0x7c79('0x0'));var util=require(_0x7c79('0x1'));var moment=require('moment');var BPromise=require(_0x7c79('0x2'));var rs=require(_0x7c79('0x3'));var fs=require('fs');var Redis=require(_0x7c79('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c79('0x5'));var logger=require(_0x7c79('0x6'))(_0x7c79('0x7'));var config=require(_0x7c79('0x8'));var jayson=require(_0x7c79('0x9'));var client=jayson[_0x7c79('0xa')][_0x7c79('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x173bf4,_0x2e0b4a,_0x1e35a3){return new BPromise(function(_0x4d91a3,_0x12efad){return client[_0x7c79('0xc')](_0x173bf4,_0x1e35a3)[_0x7c79('0xd')](function(_0x5ba364){logger['info'](_0x7c79('0xe'),_0x2e0b4a,_0x7c79('0xf'));logger[_0x7c79('0x10')](_0x7c79('0x11'),_0x2e0b4a,_0x7c79('0xf'),JSON[_0x7c79('0x12')](_0x5ba364));if(_0x5ba364[_0x7c79('0x13')]){if(_0x5ba364[_0x7c79('0x13')][_0x7c79('0x14')]===0x1f4){logger[_0x7c79('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2e0b4a,_0x5ba364['error'][_0x7c79('0x15')]);return _0x12efad(_0x5ba364['error'][_0x7c79('0x15')]);}logger[_0x7c79('0x13')](_0x7c79('0xe'),_0x2e0b4a,_0x5ba364[_0x7c79('0x13')][_0x7c79('0x15')]);return _0x4d91a3(_0x5ba364[_0x7c79('0x13')][_0x7c79('0x15')]);}else{logger[_0x7c79('0x16')](_0x7c79('0xe'),_0x2e0b4a,_0x7c79('0xf'));_0x4d91a3(_0x5ba364[_0x7c79('0x17')][_0x7c79('0x15')]);}})[_0x7c79('0x18')](function(_0x5bc23f){logger[_0x7c79('0x13')](_0x7c79('0xe'),_0x2e0b4a,_0x5bc23f);_0x12efad(_0x5bc23f);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 4ef2f92..4fb5ff2 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 _0x52dd=['update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x12dd11,_0x52b882){var _0x3a502b=function(_0x1a660d){while(--_0x1a660d){_0x12dd11['push'](_0x12dd11['shift']());}};_0x3a502b(++_0x52b882);}(_0x52dd,0x136));var _0xd52d=function(_0x26b4b6,_0x29b33b){_0x26b4b6=_0x26b4b6-0x0;var _0x16e838=_0x52dd[_0x26b4b6];return _0x16e838;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd52d('0x0'));var timeout=require(_0xd52d('0x1'));var express=require(_0xd52d('0x2'));var router=express[_0xd52d('0x3')]();var fs_extra=require(_0xd52d('0x4'));var auth=require(_0xd52d('0x5'));var interaction=require(_0xd52d('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0xd52d('0x7')]('/',auth[_0xd52d('0x8')](),controller[_0xd52d('0x9')]);router['get'](_0xd52d('0xa'),auth['isAuthenticated'](),controller[_0xd52d('0xb')]);router[_0xd52d('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd52d('0xd')]('/:id',auth[_0xd52d('0x8')](),controller[_0xd52d('0xe')]);router[_0xd52d('0xf')](_0xd52d('0xa'),auth['isAuthenticated'](),controller[_0xd52d('0x10')]);module[_0xd52d('0x11')]=router; \ No newline at end of file +var _0x9c6b=['post','create','put','update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x1af2dc,_0x42fdb1){var _0x13e703=function(_0xc8e04f){while(--_0xc8e04f){_0x1af2dc['push'](_0x1af2dc['shift']());}};_0x13e703(++_0x42fdb1);}(_0x9c6b,0x1d1));var _0xb9c6=function(_0x26a706,_0x25cc80){_0x26a706=_0x26a706-0x0;var _0x1bcd7c=_0x9c6b[_0x26a706];return _0x1bcd7c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb9c6('0x0'));var express=require(_0xb9c6('0x1'));var router=express[_0xb9c6('0x2')]();var fs_extra=require(_0xb9c6('0x3'));var auth=require(_0xb9c6('0x4'));var interaction=require(_0xb9c6('0x5'));var config=require(_0xb9c6('0x6'));var controller=require('./intSugarcrmField.controller');router[_0xb9c6('0x7')]('/',auth[_0xb9c6('0x8')](),controller['index']);router[_0xb9c6('0x7')](_0xb9c6('0x9'),auth[_0xb9c6('0x8')](),controller[_0xb9c6('0xa')]);router[_0xb9c6('0xb')]('/',auth[_0xb9c6('0x8')](),controller[_0xb9c6('0xc')]);router[_0xb9c6('0xd')](_0xb9c6('0x9'),auth[_0xb9c6('0x8')](),controller[_0xb9c6('0xe')]);router[_0xb9c6('0xf')]('/:id',auth[_0xb9c6('0x8')](),controller[_0xb9c6('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 1a07439..1f74c8c 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 _0xe1fe=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x43be32,_0x1a01ed){var _0x13fe61=function(_0x252e34){while(--_0x252e34){_0x43be32['push'](_0x43be32['shift']());}};_0x13fe61(++_0x1a01ed);}(_0xe1fe,0xd4));var _0xee1f=function(_0x34f02e,_0x6cde07){_0x34f02e=_0x34f02e-0x0;var _0x60e0e4=_0xe1fe[_0x34f02e];return _0x60e0e4;};'use strict';var Sequelize=require(_0xee1f('0x0'));module[_0xee1f('0x1')]={'type':{'type':Sequelize[_0xee1f('0x2')](_0xee1f('0x3'),'variable',_0xee1f('0x4'),_0xee1f('0x5'),_0xee1f('0x6')),'defaultValue':_0xee1f('0x3')},'content':{'type':Sequelize[_0xee1f('0x7')]},'key':{'type':Sequelize[_0xee1f('0x7')]},'keyType':{'type':Sequelize[_0xee1f('0x2')]('string',_0xee1f('0x8'),_0xee1f('0x4'))},'keyContent':{'type':Sequelize[_0xee1f('0x7')]},'idField':{'type':Sequelize[_0xee1f('0x7')]},'nameField':{'type':Sequelize[_0xee1f('0x7')]},'customField':{'type':Sequelize[_0xee1f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x79a7=['string','customVariable','keyValue','picklist','STRING','ENUM','variable','sequelize','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x79a7,0x1ed));var _0x779a=function(_0x527d55,_0x2304ae){_0x527d55=_0x527d55-0x0;var _0x563e8a=_0x79a7[_0x527d55];return _0x563e8a;};'use strict';var Sequelize=require(_0x779a('0x0'));module[_0x779a('0x1')]={'type':{'type':Sequelize['ENUM'](_0x779a('0x2'),'variable',_0x779a('0x3'),_0x779a('0x4'),_0x779a('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x779a('0x6')]},'key':{'type':Sequelize[_0x779a('0x6')]},'keyType':{'type':Sequelize[_0x779a('0x7')](_0x779a('0x2'),_0x779a('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x779a('0x6')]},'idField':{'type':Sequelize[_0x779a('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x779a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 6da4185..528b2bc 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 _0x59b3=['map','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','params','find','catch','create','body','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','error','name','send','SugarcrmField','rawAttributes','fieldName','type','key'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x59b3,0x168));var _0x359b=function(_0x38325,_0x262d3c){_0x38325=_0x38325-0x0;var _0x2994d6=_0x59b3[_0x38325];return _0x2994d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x359b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x359b('0x1'));var rp=require('request-promise');var moment=require(_0x359b('0x2'));var BPromise=require(_0x359b('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x359b('0x4'));var sox=require(_0x359b('0x5'));var csv=require(_0x359b('0x6'));var ejs=require(_0x359b('0x7'));var fs=require('fs');var fs_extra=require(_0x359b('0x8'));var _=require(_0x359b('0x9'));var squel=require(_0x359b('0xa'));var crypto=require('crypto');var jsforce=require(_0x359b('0xb'));var deskjs=require(_0x359b('0xc'));var toCsv=require(_0x359b('0x6'));var querystring=require('querystring');var Papa=require(_0x359b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x359b('0xe'));var as=require(_0x359b('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x359b('0x10'))(_0x359b('0x11'));var utils=require(_0x359b('0x12'));var config=require(_0x359b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x359b('0x14'))['db'];function respondWithStatusCode(_0x405de1,_0x192110){_0x192110=_0x192110||0xcc;return function(_0x5b85f3){if(_0x5b85f3){return _0x405de1[_0x359b('0x15')](_0x192110);}return _0x405de1[_0x359b('0x16')](_0x192110)[_0x359b('0x17')]();};}function respondWithResult(_0x258586,_0x3bb5ac){_0x3bb5ac=_0x3bb5ac||0xc8;return function(_0x4a1e81){if(_0x4a1e81){return _0x258586[_0x359b('0x16')](_0x3bb5ac)[_0x359b('0x18')](_0x4a1e81);}};}function respondWithFilteredResult(_0x51a1b3,_0x5b3fd2){return function(_0x359f1c){if(_0x359f1c){var _0x2dfb4f=typeof _0x5b3fd2[_0x359b('0x19')]===_0x359b('0x1a')&&typeof _0x5b3fd2['limit']==='undefined';var _0x759d09=_0x359f1c['count'];var _0x46f59c=_0x2dfb4f?0x0:_0x5b3fd2[_0x359b('0x19')];var _0x33c89b=_0x2dfb4f?_0x359f1c[_0x359b('0x1b')]:_0x5b3fd2[_0x359b('0x19')]+_0x5b3fd2[_0x359b('0x1c')];var _0x2bce80;if(_0x33c89b>=_0x759d09){_0x33c89b=_0x759d09;_0x2bce80=0xc8;}else{_0x2bce80=0xce;}_0x51a1b3['status'](_0x2bce80);return _0x51a1b3['set'](_0x359b('0x1d'),_0x46f59c+'-'+_0x33c89b+'/'+_0x759d09)[_0x359b('0x18')](_0x359f1c);}return null;};}function patchUpdates(_0x4527cf){return function(_0x365996){try{jsonpatch['apply'](_0x365996,_0x4527cf,!![]);}catch(_0x3c7152){return BPromise[_0x359b('0x1e')](_0x3c7152);}return _0x365996[_0x359b('0x1f')]();};}function saveUpdates(_0x34d6df,_0x517a0f){return function(_0x4235b9){if(_0x4235b9){return _0x4235b9['update'](_0x34d6df)[_0x359b('0x20')](function(_0x2af434){return _0x2af434;});}return null;};}function removeEntity(_0x50debc,_0x26a32e){return function(_0x47bc2a){if(_0x47bc2a){return _0x47bc2a[_0x359b('0x21')]()[_0x359b('0x20')](function(){_0x50debc[_0x359b('0x16')](0xcc)[_0x359b('0x17')]();});}};}function handleEntityNotFound(_0x3773dc,_0x2db645){return function(_0x54eaf9){if(!_0x54eaf9){_0x3773dc['sendStatus'](0x194);}return _0x54eaf9;};}function handleError(_0x1c3abc,_0x178812){_0x178812=_0x178812||0x1f4;return function(_0x4c6a3e){logger[_0x359b('0x22')](_0x4c6a3e['stack']);if(_0x4c6a3e[_0x359b('0x23')]){delete _0x4c6a3e[_0x359b('0x23')];}_0x1c3abc[_0x359b('0x16')](_0x178812)[_0x359b('0x24')](_0x4c6a3e);};}exports['index']=function(_0x55c20a,_0x32dbe1){var _0xe98126={},_0x596095={},_0x11e90f={'count':0x0,'rows':[]};var _0x288097=_['map'](db[_0x359b('0x25')][_0x359b('0x26')],function(_0x511191){return{'name':_0x511191[_0x359b('0x27')],'type':_0x511191[_0x359b('0x28')][_0x359b('0x29')]};});_0x596095['model']=_[_0x359b('0x2a')](_0x288097,_0x359b('0x23'));_0x596095[_0x359b('0x2b')]=_[_0x359b('0x2c')](_0x55c20a[_0x359b('0x2b')]);_0x596095['filters']=_[_0x359b('0x2d')](_0x596095['model'],_0x596095['query']);_0xe98126[_0x359b('0x2e')]=_[_0x359b('0x2d')](_0x596095[_0x359b('0x2f')],qs[_0x359b('0x30')](_0x55c20a['query']['fields']));_0xe98126[_0x359b('0x2e')]=_0xe98126[_0x359b('0x2e')][_0x359b('0x31')]?_0xe98126[_0x359b('0x2e')]:_0x596095[_0x359b('0x2f')];if(!_0x55c20a['query'][_0x359b('0x32')]('nolimit')){_0xe98126[_0x359b('0x1c')]=qs[_0x359b('0x1c')](_0x55c20a['query'][_0x359b('0x1c')]);_0xe98126[_0x359b('0x19')]=qs[_0x359b('0x19')](_0x55c20a[_0x359b('0x2b')][_0x359b('0x19')]);}_0xe98126[_0x359b('0x33')]=qs[_0x359b('0x34')](_0x55c20a[_0x359b('0x2b')][_0x359b('0x34')]);_0xe98126[_0x359b('0x35')]=qs[_0x359b('0x36')](_[_0x359b('0x37')](_0x55c20a[_0x359b('0x2b')],_0x596095[_0x359b('0x36')]),_0x288097);if(_0x55c20a[_0x359b('0x2b')][_0x359b('0x38')]){_0xe98126['where']=_[_0x359b('0x39')](_0xe98126[_0x359b('0x35')],{'$or':_[_0x359b('0x2a')](_0x288097,function(_0x48304d){if(_0x48304d[_0x359b('0x28')]!==_0x359b('0x3a')){var _0x16e6b4={};_0x16e6b4[_0x48304d['name']]={'$like':'%'+_0x55c20a[_0x359b('0x2b')][_0x359b('0x38')]+'%'};return _0x16e6b4;}})});}_0xe98126=_[_0x359b('0x39')]({},_0xe98126,_0x55c20a[_0x359b('0x3b')]);var _0x18b4af={'where':_0xe98126[_0x359b('0x35')]};return db[_0x359b('0x25')][_0x359b('0x1b')](_0x18b4af)[_0x359b('0x20')](function(_0x13bba1){_0x11e90f[_0x359b('0x1b')]=_0x13bba1;if(_0x55c20a[_0x359b('0x2b')]['includeAll']){_0xe98126[_0x359b('0x3c')]=[{'all':!![]}];}return db[_0x359b('0x25')]['findAll'](_0xe98126);})['then'](function(_0x5479ce){_0x11e90f[_0x359b('0x3d')]=_0x5479ce;return _0x11e90f;})[_0x359b('0x20')](respondWithFilteredResult(_0x32dbe1,_0xe98126))['catch'](handleError(_0x32dbe1,null));};exports['show']=function(_0x1e4bc2,_0x229347){var _0x4da5c4={'raw':!![],'where':{'id':_0x1e4bc2[_0x359b('0x3e')]['id']}},_0x51c2ae={};_0x51c2ae[_0x359b('0x2f')]=_[_0x359b('0x2c')](db[_0x359b('0x25')][_0x359b('0x26')]);_0x51c2ae[_0x359b('0x2b')]=_[_0x359b('0x2c')](_0x1e4bc2['query']);_0x51c2ae['filters']=_[_0x359b('0x2d')](_0x51c2ae[_0x359b('0x2f')],_0x51c2ae[_0x359b('0x2b')]);_0x4da5c4['attributes']=_[_0x359b('0x2d')](_0x51c2ae['model'],qs[_0x359b('0x30')](_0x1e4bc2[_0x359b('0x2b')]['fields']));_0x4da5c4[_0x359b('0x2e')]=_0x4da5c4[_0x359b('0x2e')]['length']?_0x4da5c4[_0x359b('0x2e')]:_0x51c2ae[_0x359b('0x2f')];if(_0x1e4bc2[_0x359b('0x2b')]['includeAll']){_0x4da5c4[_0x359b('0x3c')]=[{'all':!![]}];}_0x4da5c4=_[_0x359b('0x39')]({},_0x4da5c4,_0x1e4bc2[_0x359b('0x3b')]);return db['SugarcrmField'][_0x359b('0x3f')](_0x4da5c4)[_0x359b('0x20')](handleEntityNotFound(_0x229347,null))['then'](respondWithResult(_0x229347,null))[_0x359b('0x40')](handleError(_0x229347,null));};exports[_0x359b('0x41')]=function(_0x6ce751,_0x5e9510){return db[_0x359b('0x25')][_0x359b('0x41')](_0x6ce751[_0x359b('0x42')],{})[_0x359b('0x20')](respondWithResult(_0x5e9510,0xc9))[_0x359b('0x40')](handleError(_0x5e9510,null));};exports['update']=function(_0x1406c2,_0x2aae12){if(_0x1406c2[_0x359b('0x42')]['id']){delete _0x1406c2[_0x359b('0x42')]['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x1406c2[_0x359b('0x3e')]['id']}})[_0x359b('0x20')](handleEntityNotFound(_0x2aae12,null))[_0x359b('0x20')](saveUpdates(_0x1406c2[_0x359b('0x42')],null))['then'](respondWithResult(_0x2aae12,null))[_0x359b('0x40')](handleError(_0x2aae12,null));};exports[_0x359b('0x21')]=function(_0x51dabf,_0x267371){return db['SugarcrmField']['find']({'where':{'id':_0x51dabf['params']['id']}})[_0x359b('0x20')](handleEntityNotFound(_0x267371,null))[_0x359b('0x20')](removeEntity(_0x267371,null))[_0x359b('0x40')](handleError(_0x267371,null));}; \ No newline at end of file +var _0xa1a9=['hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','update','then','destroy','stack','name','send','map','SugarcrmField','rawAttributes','fieldName','key','query','keys','filters','model','intersection','fields','attributes'];(function(_0x117129,_0x1dd2f8){var _0x36f786=function(_0x4a3d27){while(--_0x4a3d27){_0x117129['push'](_0x117129['shift']());}};_0x36f786(++_0x1dd2f8);}(_0xa1a9,0xeb));var _0x9a1a=function(_0xbb3107,_0x3b328c){_0xbb3107=_0xbb3107-0x0;var _0x73d03=_0xa1a9[_0xbb3107];return _0x73d03;};'use strict';var emlformat=require(_0x9a1a('0x0'));var rimraf=require(_0x9a1a('0x1'));var zipdir=require(_0x9a1a('0x2'));var jsonpatch=require(_0x9a1a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9a1a('0x4'));var Mustache=require(_0x9a1a('0x5'));var util=require('util');var path=require(_0x9a1a('0x6'));var sox=require(_0x9a1a('0x7'));var csv=require(_0x9a1a('0x8'));var ejs=require(_0x9a1a('0x9'));var fs=require('fs');var fs_extra=require(_0x9a1a('0xa'));var _=require('lodash');var squel=require(_0x9a1a('0xb'));var crypto=require(_0x9a1a('0xc'));var jsforce=require(_0x9a1a('0xd'));var deskjs=require(_0x9a1a('0xe'));var toCsv=require(_0x9a1a('0x8'));var querystring=require(_0x9a1a('0xf'));var Papa=require('papaparse');var Redis=require(_0x9a1a('0x10'));var authService=require(_0x9a1a('0x11'));var qs=require(_0x9a1a('0x12'));var as=require(_0x9a1a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a1a('0x14'))(_0x9a1a('0x15'));var utils=require('../../config/utils');var config=require(_0x9a1a('0x16'));var licenseUtil=require(_0x9a1a('0x17'));var db=require(_0x9a1a('0x18'))['db'];function respondWithStatusCode(_0x2c4b9c,_0x355edb){_0x355edb=_0x355edb||0xcc;return function(_0x55b324){if(_0x55b324){return _0x2c4b9c[_0x9a1a('0x19')](_0x355edb);}return _0x2c4b9c[_0x9a1a('0x1a')](_0x355edb)[_0x9a1a('0x1b')]();};}function respondWithResult(_0x1c509d,_0x6ba0bf){_0x6ba0bf=_0x6ba0bf||0xc8;return function(_0x3a5dde){if(_0x3a5dde){return _0x1c509d[_0x9a1a('0x1a')](_0x6ba0bf)[_0x9a1a('0x1c')](_0x3a5dde);}};}function respondWithFilteredResult(_0x4e9101,_0x8686a3){return function(_0xaebb20){if(_0xaebb20){var _0x43612f=typeof _0x8686a3[_0x9a1a('0x1d')]==='undefined'&&typeof _0x8686a3[_0x9a1a('0x1e')]==='undefined';var _0x40126e=_0xaebb20[_0x9a1a('0x1f')];var _0x36f1c3=_0x43612f?0x0:_0x8686a3[_0x9a1a('0x1d')];var _0x384b6b=_0x43612f?_0xaebb20['count']:_0x8686a3[_0x9a1a('0x1d')]+_0x8686a3[_0x9a1a('0x1e')];var _0x931c13;if(_0x384b6b>=_0x40126e){_0x384b6b=_0x40126e;_0x931c13=0xc8;}else{_0x931c13=0xce;}_0x4e9101[_0x9a1a('0x1a')](_0x931c13);return _0x4e9101[_0x9a1a('0x20')](_0x9a1a('0x21'),_0x36f1c3+'-'+_0x384b6b+'/'+_0x40126e)[_0x9a1a('0x1c')](_0xaebb20);}return null;};}function patchUpdates(_0x5bc771){return function(_0x2d637d){try{jsonpatch['apply'](_0x2d637d,_0x5bc771,!![]);}catch(_0x4bdb49){return BPromise[_0x9a1a('0x22')](_0x4bdb49);}return _0x2d637d['save']();};}function saveUpdates(_0x1bc08a,_0x119ed7){return function(_0x36779d){if(_0x36779d){return _0x36779d[_0x9a1a('0x23')](_0x1bc08a)[_0x9a1a('0x24')](function(_0x2adfdd){return _0x2adfdd;});}return null;};}function removeEntity(_0x446312,_0x4f5866){return function(_0x416efd){if(_0x416efd){return _0x416efd[_0x9a1a('0x25')]()[_0x9a1a('0x24')](function(){_0x446312[_0x9a1a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44e2aa,_0x33675a){return function(_0x4b3b31){if(!_0x4b3b31){_0x44e2aa['sendStatus'](0x194);}return _0x4b3b31;};}function handleError(_0x5b884f,_0x11a9a8){_0x11a9a8=_0x11a9a8||0x1f4;return function(_0x588105){logger['error'](_0x588105[_0x9a1a('0x26')]);if(_0x588105['name']){delete _0x588105[_0x9a1a('0x27')];}_0x5b884f[_0x9a1a('0x1a')](_0x11a9a8)[_0x9a1a('0x28')](_0x588105);};}exports['index']=function(_0x471992,_0xee88f3){var _0x513463={},_0x549baf={},_0x51a094={'count':0x0,'rows':[]};var _0x3647d4=_[_0x9a1a('0x29')](db[_0x9a1a('0x2a')][_0x9a1a('0x2b')],function(_0xb40bda){return{'name':_0xb40bda[_0x9a1a('0x2c')],'type':_0xb40bda['type'][_0x9a1a('0x2d')]};});_0x549baf['model']=_[_0x9a1a('0x29')](_0x3647d4,_0x9a1a('0x27'));_0x549baf[_0x9a1a('0x2e')]=_[_0x9a1a('0x2f')](_0x471992[_0x9a1a('0x2e')]);_0x549baf[_0x9a1a('0x30')]=_['intersection'](_0x549baf[_0x9a1a('0x31')],_0x549baf[_0x9a1a('0x2e')]);_0x513463['attributes']=_[_0x9a1a('0x32')](_0x549baf['model'],qs[_0x9a1a('0x33')](_0x471992[_0x9a1a('0x2e')][_0x9a1a('0x33')]));_0x513463[_0x9a1a('0x34')]=_0x513463[_0x9a1a('0x34')]['length']?_0x513463['attributes']:_0x549baf['model'];if(!_0x471992['query'][_0x9a1a('0x35')]('nolimit')){_0x513463[_0x9a1a('0x1e')]=qs[_0x9a1a('0x1e')](_0x471992[_0x9a1a('0x2e')]['limit']);_0x513463[_0x9a1a('0x1d')]=qs['offset'](_0x471992[_0x9a1a('0x2e')][_0x9a1a('0x1d')]);}_0x513463[_0x9a1a('0x36')]=qs[_0x9a1a('0x37')](_0x471992[_0x9a1a('0x2e')][_0x9a1a('0x37')]);_0x513463['where']=qs[_0x9a1a('0x30')](_['pick'](_0x471992[_0x9a1a('0x2e')],_0x549baf[_0x9a1a('0x30')]),_0x3647d4);if(_0x471992[_0x9a1a('0x2e')][_0x9a1a('0x38')]){_0x513463[_0x9a1a('0x39')]=_[_0x9a1a('0x3a')](_0x513463['where'],{'$or':_[_0x9a1a('0x29')](_0x3647d4,function(_0x28d210){if(_0x28d210[_0x9a1a('0x3b')]!==_0x9a1a('0x3c')){var _0x5e84ad={};_0x5e84ad[_0x28d210['name']]={'$like':'%'+_0x471992[_0x9a1a('0x2e')][_0x9a1a('0x38')]+'%'};return _0x5e84ad;}})});}_0x513463=_[_0x9a1a('0x3a')]({},_0x513463,_0x471992['options']);var _0x47e231={'where':_0x513463['where']};return db[_0x9a1a('0x2a')][_0x9a1a('0x1f')](_0x47e231)[_0x9a1a('0x24')](function(_0x1f6775){_0x51a094[_0x9a1a('0x1f')]=_0x1f6775;if(_0x471992[_0x9a1a('0x2e')][_0x9a1a('0x3d')]){_0x513463[_0x9a1a('0x3e')]=[{'all':!![]}];}return db[_0x9a1a('0x2a')][_0x9a1a('0x3f')](_0x513463);})['then'](function(_0x3dc1b4){_0x51a094[_0x9a1a('0x40')]=_0x3dc1b4;return _0x51a094;})['then'](respondWithFilteredResult(_0xee88f3,_0x513463))[_0x9a1a('0x41')](handleError(_0xee88f3,null));};exports[_0x9a1a('0x42')]=function(_0x1d908f,_0x53655a){var _0x14ad56={'raw':!![],'where':{'id':_0x1d908f[_0x9a1a('0x43')]['id']}},_0x224ed6={};_0x224ed6[_0x9a1a('0x31')]=_[_0x9a1a('0x2f')](db[_0x9a1a('0x2a')][_0x9a1a('0x2b')]);_0x224ed6['query']=_[_0x9a1a('0x2f')](_0x1d908f[_0x9a1a('0x2e')]);_0x224ed6[_0x9a1a('0x30')]=_['intersection'](_0x224ed6['model'],_0x224ed6[_0x9a1a('0x2e')]);_0x14ad56['attributes']=_['intersection'](_0x224ed6['model'],qs[_0x9a1a('0x33')](_0x1d908f[_0x9a1a('0x2e')]['fields']));_0x14ad56['attributes']=_0x14ad56[_0x9a1a('0x34')]['length']?_0x14ad56[_0x9a1a('0x34')]:_0x224ed6[_0x9a1a('0x31')];if(_0x1d908f['query']['includeAll']){_0x14ad56[_0x9a1a('0x3e')]=[{'all':!![]}];}_0x14ad56=_[_0x9a1a('0x3a')]({},_0x14ad56,_0x1d908f[_0x9a1a('0x44')]);return db[_0x9a1a('0x2a')][_0x9a1a('0x45')](_0x14ad56)[_0x9a1a('0x24')](handleEntityNotFound(_0x53655a,null))[_0x9a1a('0x24')](respondWithResult(_0x53655a,null))[_0x9a1a('0x41')](handleError(_0x53655a,null));};exports[_0x9a1a('0x46')]=function(_0x1559f2,_0x572652){return db[_0x9a1a('0x2a')][_0x9a1a('0x46')](_0x1559f2[_0x9a1a('0x47')],{})[_0x9a1a('0x24')](respondWithResult(_0x572652,0xc9))[_0x9a1a('0x41')](handleError(_0x572652,null));};exports[_0x9a1a('0x23')]=function(_0x25b263,_0x2b7032){if(_0x25b263['body']['id']){delete _0x25b263[_0x9a1a('0x47')]['id'];}return db[_0x9a1a('0x2a')][_0x9a1a('0x45')]({'where':{'id':_0x25b263['params']['id']}})[_0x9a1a('0x24')](handleEntityNotFound(_0x2b7032,null))[_0x9a1a('0x24')](saveUpdates(_0x25b263[_0x9a1a('0x47')],null))[_0x9a1a('0x24')](respondWithResult(_0x2b7032,null))[_0x9a1a('0x41')](handleError(_0x2b7032,null));};exports['destroy']=function(_0x5decc3,_0x94fdb3){return db[_0x9a1a('0x2a')][_0x9a1a('0x45')]({'where':{'id':_0x5decc3[_0x9a1a('0x43')]['id']}})[_0x9a1a('0x24')](handleEntityNotFound(_0x94fdb3,null))[_0x9a1a('0x24')](removeEntity(_0x94fdb3,null))[_0x9a1a('0x41')](handleError(_0x94fdb3,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index ac3132d..1db3d6d 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 _0x2845=['request-promise','path','rimraf','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','api','moment'];(function(_0x4fe894,_0xa84087){var _0x23d5c6=function(_0x32c714){while(--_0x32c714){_0x4fe894['push'](_0x4fe894['shift']());}};_0x23d5c6(++_0xa84087);}(_0x2845,0x101));var _0x5284=function(_0x2138fa,_0x499c32){_0x2138fa=_0x2138fa-0x0;var _0x49a18b=_0x2845[_0x2138fa];return _0x49a18b;};'use strict';var _=require('lodash');var util=require(_0x5284('0x0'));var logger=require('../../config/logger')(_0x5284('0x1'));var moment=require(_0x5284('0x2'));var BPromise=require('bluebird');var rp=require(_0x5284('0x3'));var fs=require('fs');var path=require(_0x5284('0x4'));var rimraf=require(_0x5284('0x5'));var config=require('../../config/environment');var attributes=require(_0x5284('0x6'));module[_0x5284('0x7')]=function(_0x117580,_0x3f8cd0){return _0x117580['define'](_0x5284('0x8'),attributes,{'tableName':_0x5284('0x9'),'paranoid':![],'indexes':[{'name':_0x5284('0xa'),'fields':[_0x5284('0xb'),_0x5284('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x78f3=['rimraf','../../config/environment','./intSugarcrmField.attributes','define','int_sugarcrm_fields','sugarcrm_unique_index','lodash','api','moment','bluebird','request-promise','path'];(function(_0x289797,_0x2c62d9){var _0x5780fc=function(_0x21efac){while(--_0x21efac){_0x289797['push'](_0x289797['shift']());}};_0x5780fc(++_0x2c62d9);}(_0x78f3,0x162));var _0x378f=function(_0x24efcb,_0x148664){_0x24efcb=_0x24efcb-0x0;var _0x935efb=_0x78f3[_0x24efcb];return _0x935efb;};'use strict';var _=require(_0x378f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x378f('0x1'));var moment=require(_0x378f('0x2'));var BPromise=require(_0x378f('0x3'));var rp=require(_0x378f('0x4'));var fs=require('fs');var path=require(_0x378f('0x5'));var rimraf=require(_0x378f('0x6'));var config=require(_0x378f('0x7'));var attributes=require(_0x378f('0x8'));module['exports']=function(_0x177035,_0x5b333f){return _0x177035[_0x378f('0x9')]('SugarcrmField',attributes,{'tableName':_0x378f('0xa'),'paranoid':![],'indexes':[{'name':_0x378f('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index a3fbf73..d7830b6 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 _0xa2f3=['request\x20sent','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','then','info','SugarcrmField,\x20%s,\x20%s'];(function(_0xdaa1ec,_0x764af2){var _0x45498d=function(_0x5e1b11){while(--_0x5e1b11){_0xdaa1ec['push'](_0xdaa1ec['shift']());}};_0x45498d(++_0x764af2);}(_0xa2f3,0x1af));var _0x3a2f=function(_0x44b0a1,_0x2b99ca){_0x44b0a1=_0x44b0a1-0x0;var _0x2ba53e=_0xa2f3[_0x44b0a1];return _0x2ba53e;};'use strict';var _=require(_0x3a2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3a2f('0x1'));var rs=require(_0x3a2f('0x2'));var fs=require('fs');var Redis=require(_0x3a2f('0x3'));var db=require(_0x3a2f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3a2f('0x5'));var client=jayson[_0x3a2f('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x185acc,_0x3cfae6,_0x32a15f){return new BPromise(function(_0x5476e4,_0x4489e8){return client[_0x3a2f('0x7')](_0x185acc,_0x32a15f)[_0x3a2f('0x8')](function(_0x1fd4dd){logger[_0x3a2f('0x9')](_0x3a2f('0xa'),_0x3cfae6,_0x3a2f('0xb'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x3cfae6,_0x3a2f('0xb'),JSON[_0x3a2f('0xc')](_0x1fd4dd));if(_0x1fd4dd[_0x3a2f('0xd')]){if(_0x1fd4dd[_0x3a2f('0xd')][_0x3a2f('0xe')]===0x1f4){logger[_0x3a2f('0xd')](_0x3a2f('0xa'),_0x3cfae6,_0x1fd4dd[_0x3a2f('0xd')][_0x3a2f('0xf')]);return _0x4489e8(_0x1fd4dd['error']['message']);}logger[_0x3a2f('0xd')](_0x3a2f('0xa'),_0x3cfae6,_0x1fd4dd[_0x3a2f('0xd')]['message']);return _0x5476e4(_0x1fd4dd['error']['message']);}else{logger[_0x3a2f('0x9')]('SugarcrmField,\x20%s,\x20%s',_0x3cfae6,_0x3a2f('0xb'));_0x5476e4(_0x1fd4dd[_0x3a2f('0x10')][_0x3a2f('0xf')]);}})['catch'](function(_0x59e463){logger[_0x3a2f('0xd')](_0x3a2f('0xa'),_0x3cfae6,_0x59e463);_0x4489e8(_0x59e463);});});} \ No newline at end of file +var _0x549b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x5777e5,_0x24c824){var _0x44673a=function(_0x6fb16c){while(--_0x6fb16c){_0x5777e5['push'](_0x5777e5['shift']());}};_0x44673a(++_0x24c824);}(_0x549b,0x1c0));var _0xb549=function(_0x1db29a,_0x5263e6){_0x1db29a=_0x1db29a-0x0;var _0x53525b=_0x549b[_0x1db29a];return _0x53525b;};'use strict';var _=require(_0xb549('0x0'));var util=require(_0xb549('0x1'));var moment=require(_0xb549('0x2'));var BPromise=require(_0xb549('0x3'));var rs=require(_0xb549('0x4'));var fs=require('fs');var Redis=require(_0xb549('0x5'));var db=require(_0xb549('0x6'))['db'];var utils=require(_0xb549('0x7'));var logger=require(_0xb549('0x8'))('rpc');var config=require(_0xb549('0x9'));var jayson=require(_0xb549('0xa'));var client=jayson[_0xb549('0xb')][_0xb549('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x107532,_0x2bad69,_0x7a126b){return new BPromise(function(_0x80e807,_0x5ef3e3){return client['request'](_0x107532,_0x7a126b)[_0xb549('0xd')](function(_0x35b6b8){logger['info'](_0xb549('0xe'),_0x2bad69,'request\x20sent');logger[_0xb549('0xf')](_0xb549('0x10'),_0x2bad69,_0xb549('0x11'),JSON[_0xb549('0x12')](_0x35b6b8));if(_0x35b6b8[_0xb549('0x13')]){if(_0x35b6b8[_0xb549('0x13')][_0xb549('0x14')]===0x1f4){logger[_0xb549('0x13')](_0xb549('0xe'),_0x2bad69,_0x35b6b8[_0xb549('0x13')][_0xb549('0x15')]);return _0x5ef3e3(_0x35b6b8[_0xb549('0x13')]['message']);}logger[_0xb549('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x2bad69,_0x35b6b8[_0xb549('0x13')][_0xb549('0x15')]);return _0x80e807(_0x35b6b8[_0xb549('0x13')]['message']);}else{logger[_0xb549('0x16')](_0xb549('0xe'),_0x2bad69,_0xb549('0x11'));_0x80e807(_0x35b6b8[_0xb549('0x17')]['message']);}})[_0xb549('0x18')](function(_0x29b405){logger[_0xb549('0x13')](_0xb549('0xe'),_0x2bad69,_0x29b405);_0x5ef3e3(_0x29b405);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 8c3f5cf..d776359 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 _0xda65=['update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put'];(function(_0x596085,_0x4b8c8b){var _0x1ea990=function(_0x3e285c){while(--_0x3e285c){_0x596085['push'](_0x596085['shift']());}};_0x1ea990(++_0x4b8c8b);}(_0xda65,0x1d0));var _0x5da6=function(_0x3316a9,_0x4977d4){_0x3316a9=_0x3316a9-0x0;var _0x10f42d=_0xda65[_0x3316a9];return _0x10f42d;};'use strict';var multer=require(_0x5da6('0x0'));var util=require(_0x5da6('0x1'));var path=require(_0x5da6('0x2'));var timeout=require('connect-timeout');var express=require(_0x5da6('0x3'));var router=express[_0x5da6('0x4')]();var fs_extra=require(_0x5da6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5da6('0x6'));var controller=require(_0x5da6('0x7'));router[_0x5da6('0x8')]('/',auth[_0x5da6('0x9')](),controller[_0x5da6('0xa')]);router['get'](_0x5da6('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x5da6('0x8')]('/:id/configurations',auth[_0x5da6('0x9')](),controller[_0x5da6('0xc')]);router[_0x5da6('0x8')](_0x5da6('0xd'),auth[_0x5da6('0x9')](),controller[_0x5da6('0xe')]);router[_0x5da6('0xf')]('/',auth[_0x5da6('0x9')](),controller['create']);router[_0x5da6('0xf')](_0x5da6('0x10'),auth[_0x5da6('0x9')](),controller[_0x5da6('0x11')]);router[_0x5da6('0x12')](_0x5da6('0xb'),auth[_0x5da6('0x9')](),controller[_0x5da6('0x13')]);router[_0x5da6('0x14')]('/:id',auth[_0x5da6('0x9')](),controller[_0x5da6('0x15')]);module[_0x5da6('0x16')]=router; \ No newline at end of file +var _0xccef=['show','getConfigurations','/:id/fields','getFields','create','/:id/configurations','addConfiguration','put','/:id','delete','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','index','isAuthenticated'];(function(_0x30676e,_0x13b803){var _0x27245a=function(_0x920db3){while(--_0x920db3){_0x30676e['push'](_0x30676e['shift']());}};_0x27245a(++_0x13b803);}(_0xccef,0x1ee));var _0xfcce=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xccef[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require(_0xfcce('0x0'));var path=require('path');var timeout=require(_0xfcce('0x1'));var express=require(_0xfcce('0x2'));var router=express['Router']();var fs_extra=require(_0xfcce('0x3'));var auth=require(_0xfcce('0x4'));var interaction=require(_0xfcce('0x5'));var config=require('../../config/environment');var controller=require(_0xfcce('0x6'));router[_0xfcce('0x7')]('/',auth['isAuthenticated'](),controller[_0xfcce('0x8')]);router[_0xfcce('0x7')]('/:id',auth[_0xfcce('0x9')](),controller[_0xfcce('0xa')]);router['get']('/:id/configurations',auth[_0xfcce('0x9')](),controller[_0xfcce('0xb')]);router[_0xfcce('0x7')](_0xfcce('0xc'),auth['isAuthenticated'](),controller[_0xfcce('0xd')]);router['post']('/',auth[_0xfcce('0x9')](),controller[_0xfcce('0xe')]);router['post'](_0xfcce('0xf'),auth['isAuthenticated'](),controller[_0xfcce('0x10')]);router[_0xfcce('0x11')](_0xfcce('0x12'),auth[_0xfcce('0x9')](),controller['update']);router[_0xfcce('0x13')](_0xfcce('0x12'),auth[_0xfcce('0x9')](),controller[_0xfcce('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 c91d0fa..79bc776 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 _0x6243=['HelpDesk','exports','STRING'];(function(_0x37b0ba,_0xe3601e){var _0x20586f=function(_0x44a43e){while(--_0x44a43e){_0x37b0ba['push'](_0x37b0ba['shift']());}};_0x20586f(++_0xe3601e);}(_0x6243,0x166));var _0x3624=function(_0x43814d,_0x27113e){_0x43814d=_0x43814d-0x0;var _0x161979=_0x6243[_0x43814d];return _0x161979;};'use strict';var Sequelize=require('sequelize');module[_0x3624('0x0')]={'name':{'type':Sequelize[_0x3624('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3624('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x3624('0x1')],'allowNull':![],'defaultValue':_0x3624('0x2')},'remoteUri':{'type':Sequelize[_0x3624('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x3624('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x6735=['sequelize','exports','STRING'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x6735,0x11d));var _0x5673=function(_0x2d715f,_0x28ce82){_0x2d715f=_0x2d715f-0x0;var _0x53ab85=_0x6735[_0x2d715f];return _0x53ab85;};'use strict';var Sequelize=require(_0x5673('0x0'));module[_0x5673('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5673('0x2')]},'username':{'type':Sequelize[_0x5673('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x5673('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x5673('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index db6178e..c737266 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 _0xc021=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','VtigerAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','description','remoteUri','username','accessKey','slice','substring','lastIndexOf','%s/webservice.php','getchallenge','success','login','result','token','describe','autogenerated','owner','remove','editable','false','label','startsWith','cf_','value','log','vTiger\x20error:\x20','test','getFields','send','Wrong\x20credentials','eml-format','rimraf','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','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','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc021,0xc0));var _0x1c02=function(_0x5c3601,_0x5a5225){_0x5c3601=_0x5c3601-0x0;var _0x528fd8=_0xc021[_0x5c3601];return _0x528fd8;};'use strict';var emlformat=require(_0x1c02('0x0'));var rimraf=require(_0x1c02('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1c02('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1c02('0x3'));var path=require('path');var sox=require(_0x1c02('0x4'));var csv=require(_0x1c02('0x5'));var ejs=require(_0x1c02('0x6'));var fs=require('fs');var fs_extra=require(_0x1c02('0x7'));var _=require(_0x1c02('0x8'));var squel=require(_0x1c02('0x9'));var crypto=require('crypto');var jsforce=require(_0x1c02('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1c02('0x5'));var querystring=require(_0x1c02('0xb'));var Papa=require(_0x1c02('0xc'));var Redis=require(_0x1c02('0xd'));var authService=require(_0x1c02('0xe'));var qs=require(_0x1c02('0xf'));var as=require(_0x1c02('0x10'));var hardwareService=require(_0x1c02('0x11'));var logger=require(_0x1c02('0x12'))(_0x1c02('0x13'));var utils=require(_0x1c02('0x14'));var config=require(_0x1c02('0x15'));var licenseUtil=require(_0x1c02('0x16'));var db=require(_0x1c02('0x17'))['db'];var integrations=require(_0x1c02('0x18'));function respondWithStatusCode(_0x36290f,_0x3f099c){_0x3f099c=_0x3f099c||0xcc;return function(_0x151fbc){if(_0x151fbc){return _0x36290f[_0x1c02('0x19')](_0x3f099c);}return _0x36290f['status'](_0x3f099c)[_0x1c02('0x1a')]();};}function respondWithResult(_0x45506a,_0x2b4ff3){_0x2b4ff3=_0x2b4ff3||0xc8;return function(_0x522121){if(_0x522121){return _0x45506a[_0x1c02('0x1b')](_0x2b4ff3)[_0x1c02('0x1c')](_0x522121);}};}function respondWithFilteredResult(_0x2385a3,_0x5dc948){return function(_0x34074f){if(_0x34074f){var _0x35e592=typeof _0x5dc948[_0x1c02('0x1d')]===_0x1c02('0x1e')&&typeof _0x5dc948[_0x1c02('0x1f')]===_0x1c02('0x1e');var _0x1ca1aa=_0x34074f['count'];var _0x4d9dac=_0x35e592?0x0:_0x5dc948[_0x1c02('0x1d')];var _0x4087e7=_0x35e592?_0x34074f[_0x1c02('0x20')]:_0x5dc948[_0x1c02('0x1d')]+_0x5dc948[_0x1c02('0x1f')];var _0x1e724b;if(_0x4087e7>=_0x1ca1aa){_0x4087e7=_0x1ca1aa;_0x1e724b=0xc8;}else{_0x1e724b=0xce;}_0x2385a3[_0x1c02('0x1b')](_0x1e724b);return _0x2385a3[_0x1c02('0x21')](_0x1c02('0x22'),_0x4d9dac+'-'+_0x4087e7+'/'+_0x1ca1aa)[_0x1c02('0x1c')](_0x34074f);}return null;};}function patchUpdates(_0x337d60){return function(_0x163c0d){try{jsonpatch[_0x1c02('0x23')](_0x163c0d,_0x337d60,!![]);}catch(_0x2b8421){return BPromise[_0x1c02('0x24')](_0x2b8421);}return _0x163c0d[_0x1c02('0x25')]();};}function saveUpdates(_0x362c14,_0x10e328){return function(_0x2a2114){if(_0x2a2114){return _0x2a2114[_0x1c02('0x26')](_0x362c14)[_0x1c02('0x27')](function(_0x4c4b2c){return _0x4c4b2c;});}return null;};}function removeEntity(_0x179aa8,_0x2032fd){return function(_0x2351ec){if(_0x2351ec){return _0x2351ec[_0x1c02('0x28')]()[_0x1c02('0x27')](function(){_0x179aa8['status'](0xcc)[_0x1c02('0x1a')]();});}};}function handleEntityNotFound(_0x265b7b,_0x1a9ce7){return function(_0x3d7444){if(!_0x3d7444){_0x265b7b[_0x1c02('0x19')](0x194);}return _0x3d7444;};}function handleError(_0x1f7e57,_0x416ee0){_0x416ee0=_0x416ee0||0x1f4;return function(_0x52392d){logger[_0x1c02('0x29')](_0x52392d[_0x1c02('0x2a')]);if(_0x52392d[_0x1c02('0x2b')]){delete _0x52392d[_0x1c02('0x2b')];}_0x1f7e57[_0x1c02('0x1b')](_0x416ee0)['send'](_0x52392d);};}exports['index']=function(_0x343b02,_0xff9979){var _0x17f8df={},_0x4dade7={},_0x128bb2={'count':0x0,'rows':[]};var _0x2d51a2=_['map'](db[_0x1c02('0x2c')][_0x1c02('0x2d')],function(_0x5dfc21){return{'name':_0x5dfc21[_0x1c02('0x2e')],'type':_0x5dfc21[_0x1c02('0x2f')]['key']};});_0x4dade7[_0x1c02('0x30')]=_['map'](_0x2d51a2,_0x1c02('0x2b'));_0x4dade7[_0x1c02('0x31')]=_[_0x1c02('0x32')](_0x343b02[_0x1c02('0x31')]);_0x4dade7[_0x1c02('0x33')]=_[_0x1c02('0x34')](_0x4dade7[_0x1c02('0x30')],_0x4dade7[_0x1c02('0x31')]);_0x17f8df[_0x1c02('0x35')]=_[_0x1c02('0x34')](_0x4dade7['model'],qs[_0x1c02('0x36')](_0x343b02['query']['fields']));_0x17f8df[_0x1c02('0x35')]=_0x17f8df['attributes'][_0x1c02('0x37')]?_0x17f8df['attributes']:_0x4dade7[_0x1c02('0x30')];if(!_0x343b02[_0x1c02('0x31')][_0x1c02('0x38')](_0x1c02('0x39'))){_0x17f8df[_0x1c02('0x1f')]=qs[_0x1c02('0x1f')](_0x343b02[_0x1c02('0x31')]['limit']);_0x17f8df[_0x1c02('0x1d')]=qs['offset'](_0x343b02[_0x1c02('0x31')][_0x1c02('0x1d')]);}_0x17f8df[_0x1c02('0x3a')]=qs[_0x1c02('0x3b')](_0x343b02['query'][_0x1c02('0x3b')]);_0x17f8df[_0x1c02('0x3c')]=qs[_0x1c02('0x33')](_[_0x1c02('0x3d')](_0x343b02[_0x1c02('0x31')],_0x4dade7['filters']),_0x2d51a2);if(_0x343b02[_0x1c02('0x31')][_0x1c02('0x3e')]){_0x17f8df[_0x1c02('0x3c')]=_[_0x1c02('0x3f')](_0x17f8df[_0x1c02('0x3c')],{'$or':_[_0x1c02('0x40')](_0x2d51a2,function(_0x462b9e){if(_0x462b9e[_0x1c02('0x2f')]!=='VIRTUAL'){var _0x3dec56={};_0x3dec56[_0x462b9e['name']]={'$like':'%'+_0x343b02[_0x1c02('0x31')][_0x1c02('0x3e')]+'%'};return _0x3dec56;}})});}_0x17f8df=_[_0x1c02('0x3f')]({},_0x17f8df,_0x343b02[_0x1c02('0x41')]);var _0x15574a={'where':_0x17f8df[_0x1c02('0x3c')]};return db[_0x1c02('0x2c')][_0x1c02('0x20')](_0x15574a)['then'](function(_0x4f26de){_0x128bb2[_0x1c02('0x20')]=_0x4f26de;if(_0x343b02[_0x1c02('0x31')][_0x1c02('0x42')]){_0x17f8df['include']=[{'all':!![]}];}return db['VtigerAccount'][_0x1c02('0x43')](_0x17f8df);})[_0x1c02('0x27')](function(_0x13d38b){_0x128bb2[_0x1c02('0x44')]=_0x13d38b;return _0x128bb2;})[_0x1c02('0x27')](respondWithFilteredResult(_0xff9979,_0x17f8df))[_0x1c02('0x45')](handleError(_0xff9979,null));};exports[_0x1c02('0x46')]=function(_0x167d6a,_0x3f35c1){var _0x2075d3={'raw':![],'where':{'id':_0x167d6a[_0x1c02('0x47')]['id']}},_0x56492b={};_0x56492b[_0x1c02('0x30')]=_['keys'](db['VtigerAccount'][_0x1c02('0x2d')]);_0x56492b['query']=_[_0x1c02('0x32')](_0x167d6a[_0x1c02('0x31')]);_0x56492b[_0x1c02('0x33')]=_[_0x1c02('0x34')](_0x56492b[_0x1c02('0x30')],_0x56492b[_0x1c02('0x31')]);_0x2075d3[_0x1c02('0x35')]=_['intersection'](_0x56492b[_0x1c02('0x30')],qs['fields'](_0x167d6a['query'][_0x1c02('0x36')]));_0x2075d3['attributes']=_0x2075d3[_0x1c02('0x35')][_0x1c02('0x37')]?_0x2075d3[_0x1c02('0x35')]:_0x56492b[_0x1c02('0x30')];if(_0x167d6a[_0x1c02('0x31')][_0x1c02('0x42')]){_0x2075d3[_0x1c02('0x48')]=[{'all':!![]}];}_0x2075d3=_[_0x1c02('0x3f')]({},_0x2075d3,_0x167d6a[_0x1c02('0x41')]);return db[_0x1c02('0x2c')][_0x1c02('0x49')](_0x2075d3)[_0x1c02('0x27')](handleEntityNotFound(_0x3f35c1,null))[_0x1c02('0x27')](respondWithResult(_0x3f35c1,null))[_0x1c02('0x45')](handleError(_0x3f35c1,null));};exports[_0x1c02('0x4a')]=function(_0x1a1999,_0x553dc9){return db['VtigerAccount'][_0x1c02('0x4a')](_0x1a1999[_0x1c02('0x4b')],{})[_0x1c02('0x27')](respondWithResult(_0x553dc9,0xc9))[_0x1c02('0x45')](handleError(_0x553dc9,null));};exports[_0x1c02('0x26')]=function(_0x3686bb,_0x3b783d){if(_0x3686bb['body']['id']){delete _0x3686bb['body']['id'];}return db[_0x1c02('0x2c')][_0x1c02('0x49')]({'where':{'id':_0x3686bb['params']['id']}})[_0x1c02('0x27')](handleEntityNotFound(_0x3b783d,null))[_0x1c02('0x27')](saveUpdates(_0x3686bb['body'],null))[_0x1c02('0x27')](respondWithResult(_0x3b783d,null))[_0x1c02('0x45')](handleError(_0x3b783d,null));};exports[_0x1c02('0x28')]=function(_0x231e09,_0x2bb961){return db['VtigerAccount'][_0x1c02('0x49')]({'where':{'id':_0x231e09[_0x1c02('0x47')]['id']}})[_0x1c02('0x27')](handleEntityNotFound(_0x2bb961,null))['then'](removeEntity(_0x2bb961,null))[_0x1c02('0x45')](handleError(_0x2bb961,null));};exports[_0x1c02('0x4c')]=function(_0xb65ec1,_0x56eea7,_0x4e7dc7){var _0x487b40={};var _0x1ae858={};var _0x54bdac;var _0x3b8b9b;return db['VtigerAccount'][_0x1c02('0x4d')]({'where':{'id':_0xb65ec1[_0x1c02('0x47')]['id']}})[_0x1c02('0x27')](handleEntityNotFound(_0x56eea7,null))['then'](function(_0x17f609){if(_0x17f609){_0x54bdac=_0x17f609;_0x1ae858[_0x1c02('0x30')]=_[_0x1c02('0x32')](db[_0x1c02('0x4e')][_0x1c02('0x2d')]);_0x1ae858[_0x1c02('0x31')]=_[_0x1c02('0x32')](_0xb65ec1[_0x1c02('0x31')]);_0x1ae858[_0x1c02('0x33')]=_[_0x1c02('0x34')](_0x1ae858[_0x1c02('0x30')],_0x1ae858['query']);_0x487b40[_0x1c02('0x35')]=_[_0x1c02('0x34')](_0x1ae858[_0x1c02('0x30')],qs[_0x1c02('0x36')](_0xb65ec1[_0x1c02('0x31')][_0x1c02('0x36')]));_0x487b40[_0x1c02('0x35')]=_0x487b40[_0x1c02('0x35')][_0x1c02('0x37')]?_0x487b40['attributes']:_0x1ae858[_0x1c02('0x30')];_0x487b40[_0x1c02('0x3a')]=qs[_0x1c02('0x3b')](_0xb65ec1['query'][_0x1c02('0x3b')]);_0x487b40[_0x1c02('0x3c')]=qs[_0x1c02('0x33')](_['pick'](_0xb65ec1[_0x1c02('0x31')],_0x1ae858[_0x1c02('0x33')]));if(_0xb65ec1['query'][_0x1c02('0x3e')]){_0x487b40[_0x1c02('0x3c')]=_[_0x1c02('0x3f')](_0x487b40[_0x1c02('0x3c')],{'$or':_[_0x1c02('0x40')](_0x487b40[_0x1c02('0x35')],function(_0x3fe9b6){var _0x5779ba={};_0x5779ba[_0x3fe9b6]={'$like':'%'+_0xb65ec1[_0x1c02('0x31')][_0x1c02('0x3e')]+'%'};return _0x5779ba;})});}_0x487b40=_['merge']({},_0x487b40,_0xb65ec1[_0x1c02('0x41')]);return _0x54bdac[_0x1c02('0x4c')](_0x487b40);}})[_0x1c02('0x27')](function(_0x3b8de2){if(_0x3b8de2){_0x3b8b9b=_0x3b8de2[_0x1c02('0x37')];if(!_0xb65ec1[_0x1c02('0x31')]['hasOwnProperty'](_0x1c02('0x39'))){_0x487b40[_0x1c02('0x1f')]=qs[_0x1c02('0x1f')](_0xb65ec1[_0x1c02('0x31')][_0x1c02('0x1f')]);_0x487b40[_0x1c02('0x1d')]=qs[_0x1c02('0x1d')](_0xb65ec1[_0x1c02('0x31')][_0x1c02('0x1d')]);}return _0x54bdac[_0x1c02('0x4c')](_0x487b40);}})[_0x1c02('0x27')](function(_0x547252){if(_0x547252){return _0x547252?{'count':_0x3b8b9b,'rows':_0x547252}:null;}})['then'](respondWithResult(_0x56eea7,null))['catch'](handleError(_0x56eea7,null));};exports[_0x1c02('0x4f')]=function(_0x1e569f,_0x3ba7d2,_0x324ae5){if(_0x1e569f[_0x1c02('0x4b')]['id']){delete _0x1e569f[_0x1c02('0x4b')]['id'];}return db[_0x1c02('0x2c')][_0x1c02('0x4d')]({'where':{'id':_0x1e569f[_0x1c02('0x47')]['id']}})[_0x1c02('0x27')](handleEntityNotFound(_0x3ba7d2,null))['then'](function(_0x2ccad9){if(_0x2ccad9){_0x1e569f['body'][_0x1c02('0x50')]=_0x2ccad9['id'];_0x1e569f[_0x1c02('0x4b')][_0x1c02('0x51')]=integrations['getSubjects'](_0x1e569f[_0x1c02('0x4b')][_0x1c02('0x52')],_0x1e569f[_0x1c02('0x4b')][_0x1c02('0x2f')]);_0x1e569f[_0x1c02('0x4b')][_0x1c02('0x53')]=integrations['getDescriptions'](_0x1e569f[_0x1c02('0x4b')][_0x1c02('0x52')],_0x1e569f[_0x1c02('0x4b')]['type']);return db[_0x1c02('0x4e')][_0x1c02('0x4a')](_0x1e569f[_0x1c02('0x4b')],{'include':[{'model':db['VtigerField'],'as':_0x1c02('0x51')},{'model':db['VtigerField'],'as':_0x1c02('0x53')}]});}return null;})[_0x1c02('0x27')](respondWithResult(_0x3ba7d2,null))[_0x1c02('0x45')](handleError(_0x3ba7d2,null));};var md5=require('md5');exports['getFields']=function(_0x328980,_0xb3671e,_0x5dc032){var _0x50cd37=null;var _0x3dc630=null;var _0x34f4e4=null;var _0x121ccd=null;var _0x18db28='';return db[_0x1c02('0x2c')][_0x1c02('0x4d')]({'where':{'id':_0x328980[_0x1c02('0x47')]['id']},'attributes':['id','name','username',_0x1c02('0x54'),'moduleName',_0x1c02('0x55'),'serverUrl','accessKey']})[_0x1c02('0x27')](handleEntityNotFound(_0xb3671e,null))[_0x1c02('0x27')](function(_0x183787){if(_0x183787){_0x50cd37=_0x183787[_0x1c02('0x56')];_0x3dc630=_0x183787[_0x1c02('0x57')];_0x34f4e4=_0x183787['moduleName'];_0x18db28=_0x183787[_0x1c02('0x55')];var _0x5e5afd=_0x18db28[_0x1c02('0x58')](-0x1);if(_0x5e5afd==='/'){_0x18db28=_0x18db28[_0x1c02('0x59')](0x0,_0x18db28[_0x1c02('0x5a')](_0x5e5afd));}_0x121ccd=util['format'](_0x1c02('0x5b'),_0x18db28);var _0x1a6483={'method':'GET','uri':_0x121ccd,'qs':{'operation':_0x1c02('0x5c'),'username':_0x183787['username']},'json':!![]};return rp(_0x1a6483);}})['then'](function(_0x7708a4){if(_0x7708a4[_0x1c02('0x5d')]){var _0x5113e8={'method':'POST','uri':_0x121ccd,'form':{'operation':_0x1c02('0x5e'),'username':_0x50cd37,'accessKey':md5(_0x7708a4[_0x1c02('0x5f')][_0x1c02('0x60')]+_0x3dc630)},'json':!![]};return rp(_0x5113e8);}})['then'](function(_0x1bf0b6){if(_0x1bf0b6[_0x1c02('0x5d')]){var _0x3bb0e6={'method':'GET','uri':_0x121ccd,'qs':{'operation':_0x1c02('0x61'),'username':_0x50cd37,'sessionName':_0x1bf0b6[_0x1c02('0x5f')]['sessionName'],'elementType':_0x34f4e4},'json':!![]};return rp(_0x3bb0e6);}})[_0x1c02('0x27')](function(_0x4d4f6a){if(_0x4d4f6a['success']){var _0x57fbf6=[_0x1c02('0x62'),'reference',_0x1c02('0x63')];_[_0x1c02('0x64')](_0x4d4f6a[_0x1c02('0x5f')][_0x1c02('0x36')],function(_0x5117e0){return _0x57fbf6['includes'](_0x5117e0[_0x1c02('0x2f')][_0x1c02('0x2b')]);});_['remove'](_0x4d4f6a['result'][_0x1c02('0x36')],function(_0x2f67fa){return _0x2f67fa[_0x1c02('0x65')]===_0x1c02('0x66');});return{'count':_0x4d4f6a[_0x1c02('0x5f')][_0x1c02('0x36')][_0x1c02('0x37')],'rows':_[_0x1c02('0x40')](_0x4d4f6a[_0x1c02('0x5f')][_0x1c02('0x36')],function(_0x29f3ed){return{'id':_0x29f3ed[_0x1c02('0x2b')],'name':_0x29f3ed[_0x1c02('0x67')],'custom':_[_0x1c02('0x68')](_0x29f3ed[_0x1c02('0x2b')],_0x1c02('0x69'))?!![]:![],'options':_0x29f3ed[_0x1c02('0x2f')][_0x1c02('0x2b')]==='picklist'&&_0x29f3ed[_0x1c02('0x2f')]['picklistValues'][_0x1c02('0x37')]>0x0?_[_0x1c02('0x40')](_0x29f3ed[_0x1c02('0x2f')]['picklistValues'],function(_0x1c48ae){return{'name':_0x1c48ae[_0x1c02('0x67')],'value':_0x1c48ae[_0x1c02('0x6a')]};}):[]};})};}})[_0x1c02('0x27')](respondWithResult(_0xb3671e,null))[_0x1c02('0x45')](function(_0x498c01){console[_0x1c02('0x6b')](_0x1c02('0x6c')+_0x498c01);var _0x2d373b=_0x328980[_0x1c02('0x31')][_0x1c02('0x6d')]?0x1f4:_0x498c01['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x1c02('0x6e'),_0x2d373b,JSON['stringify'](_0x498c01));delete _0x498c01[_0x1c02('0x2b')];if(_0x2d373b===0x191){_0x2d373b=0x190;}_0xb3671e['status'](_0x2d373b)[_0x1c02('0x6f')](_0x328980[_0x1c02('0x31')][_0x1c02('0x6d')]?{'message':_0x1c02('0x70'),'statusCode':_0x498c01['statusCode']}:_0x498c01);});}; \ No newline at end of file +var _0xc545=['lastIndexOf','format','%s/webservice.php','success','POST','login','GET','describe','sessionName','autogenerated','reference','owner','includes','editable','false','result','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/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','end','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','key','map','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','VtigerAccount','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','getFields','description','moduleName','serverUrl','accessKey','username','remoteUri','slice'];(function(_0x2f4e68,_0xe9bc3d){var _0xc70c7a=function(_0x14af32){while(--_0x14af32){_0x2f4e68['push'](_0x2f4e68['shift']());}};_0xc70c7a(++_0xe9bc3d);}(_0xc545,0x9b));var _0x5c54=function(_0x1f30e6,_0x3fce47){_0x1f30e6=_0x1f30e6-0x0;var _0x3e862a=_0xc545[_0x1f30e6];return _0x3e862a;};'use strict';var emlformat=require(_0x5c54('0x0'));var rimraf=require(_0x5c54('0x1'));var zipdir=require(_0x5c54('0x2'));var jsonpatch=require(_0x5c54('0x3'));var rp=require(_0x5c54('0x4'));var moment=require('moment');var BPromise=require(_0x5c54('0x5'));var Mustache=require(_0x5c54('0x6'));var util=require(_0x5c54('0x7'));var path=require(_0x5c54('0x8'));var sox=require(_0x5c54('0x9'));var csv=require(_0x5c54('0xa'));var ejs=require(_0x5c54('0xb'));var fs=require('fs');var fs_extra=require(_0x5c54('0xc'));var _=require(_0x5c54('0xd'));var squel=require(_0x5c54('0xe'));var crypto=require(_0x5c54('0xf'));var jsforce=require(_0x5c54('0x10'));var deskjs=require(_0x5c54('0x11'));var toCsv=require(_0x5c54('0xa'));var querystring=require(_0x5c54('0x12'));var Papa=require(_0x5c54('0x13'));var Redis=require(_0x5c54('0x14'));var authService=require(_0x5c54('0x15'));var qs=require(_0x5c54('0x16'));var as=require(_0x5c54('0x17'));var hardwareService=require(_0x5c54('0x18'));var logger=require(_0x5c54('0x19'))(_0x5c54('0x1a'));var utils=require(_0x5c54('0x1b'));var config=require(_0x5c54('0x1c'));var licenseUtil=require(_0x5c54('0x1d'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5c54('0x1e'));function respondWithStatusCode(_0x586c29,_0x5dbdd0){_0x5dbdd0=_0x5dbdd0||0xcc;return function(_0x3f87da){if(_0x3f87da){return _0x586c29[_0x5c54('0x1f')](_0x5dbdd0);}return _0x586c29['status'](_0x5dbdd0)[_0x5c54('0x20')]();};}function respondWithResult(_0x323982,_0xbdd0a4){_0xbdd0a4=_0xbdd0a4||0xc8;return function(_0x2adc48){if(_0x2adc48){return _0x323982[_0x5c54('0x21')](_0xbdd0a4)[_0x5c54('0x22')](_0x2adc48);}};}function respondWithFilteredResult(_0x26a7d3,_0x1fe659){return function(_0x513fa0){if(_0x513fa0){var _0x2735f6=typeof _0x1fe659[_0x5c54('0x23')]===_0x5c54('0x24')&&typeof _0x1fe659[_0x5c54('0x25')]==='undefined';var _0x976d3a=_0x513fa0[_0x5c54('0x26')];var _0x21bb77=_0x2735f6?0x0:_0x1fe659[_0x5c54('0x23')];var _0x4fd659=_0x2735f6?_0x513fa0[_0x5c54('0x26')]:_0x1fe659['offset']+_0x1fe659[_0x5c54('0x25')];var _0x5d4289;if(_0x4fd659>=_0x976d3a){_0x4fd659=_0x976d3a;_0x5d4289=0xc8;}else{_0x5d4289=0xce;}_0x26a7d3[_0x5c54('0x21')](_0x5d4289);return _0x26a7d3['set']('Content-Range',_0x21bb77+'-'+_0x4fd659+'/'+_0x976d3a)[_0x5c54('0x22')](_0x513fa0);}return null;};}function patchUpdates(_0x1e24e7){return function(_0x35c8eb){try{jsonpatch[_0x5c54('0x27')](_0x35c8eb,_0x1e24e7,!![]);}catch(_0x171285){return BPromise['reject'](_0x171285);}return _0x35c8eb[_0x5c54('0x28')]();};}function saveUpdates(_0x34f11e,_0x650d5){return function(_0x2c051f){if(_0x2c051f){return _0x2c051f[_0x5c54('0x29')](_0x34f11e)[_0x5c54('0x2a')](function(_0x4fcad6){return _0x4fcad6;});}return null;};}function removeEntity(_0x236569,_0x41bad1){return function(_0x2f171e){if(_0x2f171e){return _0x2f171e[_0x5c54('0x2b')]()[_0x5c54('0x2a')](function(){_0x236569[_0x5c54('0x21')](0xcc)[_0x5c54('0x20')]();});}};}function handleEntityNotFound(_0x37a5e1,_0x4eba6c){return function(_0x18d515){if(!_0x18d515){_0x37a5e1[_0x5c54('0x1f')](0x194);}return _0x18d515;};}function handleError(_0x5e3639,_0x4a3d4a){_0x4a3d4a=_0x4a3d4a||0x1f4;return function(_0x47323c){logger[_0x5c54('0x2c')](_0x47323c[_0x5c54('0x2d')]);if(_0x47323c[_0x5c54('0x2e')]){delete _0x47323c[_0x5c54('0x2e')];}_0x5e3639[_0x5c54('0x21')](_0x4a3d4a)['send'](_0x47323c);};}exports[_0x5c54('0x2f')]=function(_0x5f10bd,_0x5cc711){var _0x48ffbd={},_0x4d228b={},_0x8530d9={'count':0x0,'rows':[]};var _0x1b32d3=_['map'](db['VtigerAccount'][_0x5c54('0x30')],function(_0x118175){return{'name':_0x118175[_0x5c54('0x31')],'type':_0x118175['type'][_0x5c54('0x32')]};});_0x4d228b['model']=_[_0x5c54('0x33')](_0x1b32d3,_0x5c54('0x2e'));_0x4d228b['query']=_[_0x5c54('0x34')](_0x5f10bd[_0x5c54('0x35')]);_0x4d228b['filters']=_['intersection'](_0x4d228b[_0x5c54('0x36')],_0x4d228b[_0x5c54('0x35')]);_0x48ffbd[_0x5c54('0x37')]=_[_0x5c54('0x38')](_0x4d228b[_0x5c54('0x36')],qs[_0x5c54('0x39')](_0x5f10bd[_0x5c54('0x35')][_0x5c54('0x39')]));_0x48ffbd[_0x5c54('0x37')]=_0x48ffbd[_0x5c54('0x37')][_0x5c54('0x3a')]?_0x48ffbd['attributes']:_0x4d228b['model'];if(!_0x5f10bd[_0x5c54('0x35')][_0x5c54('0x3b')](_0x5c54('0x3c'))){_0x48ffbd[_0x5c54('0x25')]=qs[_0x5c54('0x25')](_0x5f10bd[_0x5c54('0x35')][_0x5c54('0x25')]);_0x48ffbd[_0x5c54('0x23')]=qs[_0x5c54('0x23')](_0x5f10bd[_0x5c54('0x35')][_0x5c54('0x23')]);}_0x48ffbd[_0x5c54('0x3d')]=qs[_0x5c54('0x3e')](_0x5f10bd[_0x5c54('0x35')][_0x5c54('0x3e')]);_0x48ffbd[_0x5c54('0x3f')]=qs[_0x5c54('0x40')](_[_0x5c54('0x41')](_0x5f10bd[_0x5c54('0x35')],_0x4d228b[_0x5c54('0x40')]),_0x1b32d3);if(_0x5f10bd['query'][_0x5c54('0x42')]){_0x48ffbd[_0x5c54('0x3f')]=_[_0x5c54('0x43')](_0x48ffbd[_0x5c54('0x3f')],{'$or':_[_0x5c54('0x33')](_0x1b32d3,function(_0x2691c3){if(_0x2691c3[_0x5c54('0x44')]!==_0x5c54('0x45')){var _0xb2df34={};_0xb2df34[_0x2691c3[_0x5c54('0x2e')]]={'$like':'%'+_0x5f10bd[_0x5c54('0x35')][_0x5c54('0x42')]+'%'};return _0xb2df34;}})});}_0x48ffbd=_[_0x5c54('0x43')]({},_0x48ffbd,_0x5f10bd[_0x5c54('0x46')]);var _0x4c62a2={'where':_0x48ffbd['where']};return db['VtigerAccount'][_0x5c54('0x26')](_0x4c62a2)['then'](function(_0x4f44c3){_0x8530d9[_0x5c54('0x26')]=_0x4f44c3;if(_0x5f10bd[_0x5c54('0x35')][_0x5c54('0x47')]){_0x48ffbd[_0x5c54('0x48')]=[{'all':!![]}];}return db['VtigerAccount'][_0x5c54('0x49')](_0x48ffbd);})[_0x5c54('0x2a')](function(_0x30b6f0){_0x8530d9[_0x5c54('0x4a')]=_0x30b6f0;return _0x8530d9;})[_0x5c54('0x2a')](respondWithFilteredResult(_0x5cc711,_0x48ffbd))[_0x5c54('0x4b')](handleError(_0x5cc711,null));};exports[_0x5c54('0x4c')]=function(_0x515f1a,_0xdbe3d){var _0x245448={'raw':![],'where':{'id':_0x515f1a[_0x5c54('0x4d')]['id']}},_0x4936c7={};_0x4936c7[_0x5c54('0x36')]=_[_0x5c54('0x34')](db['VtigerAccount'][_0x5c54('0x30')]);_0x4936c7[_0x5c54('0x35')]=_['keys'](_0x515f1a[_0x5c54('0x35')]);_0x4936c7[_0x5c54('0x40')]=_[_0x5c54('0x38')](_0x4936c7['model'],_0x4936c7[_0x5c54('0x35')]);_0x245448[_0x5c54('0x37')]=_[_0x5c54('0x38')](_0x4936c7[_0x5c54('0x36')],qs['fields'](_0x515f1a['query'][_0x5c54('0x39')]));_0x245448['attributes']=_0x245448['attributes'][_0x5c54('0x3a')]?_0x245448[_0x5c54('0x37')]:_0x4936c7[_0x5c54('0x36')];if(_0x515f1a[_0x5c54('0x35')][_0x5c54('0x47')]){_0x245448[_0x5c54('0x48')]=[{'all':!![]}];}_0x245448=_['merge']({},_0x245448,_0x515f1a['options']);return db['VtigerAccount'][_0x5c54('0x4e')](_0x245448)[_0x5c54('0x2a')](handleEntityNotFound(_0xdbe3d,null))[_0x5c54('0x2a')](respondWithResult(_0xdbe3d,null))[_0x5c54('0x4b')](handleError(_0xdbe3d,null));};exports[_0x5c54('0x4f')]=function(_0x3d09eb,_0x11b52b){return db['VtigerAccount'][_0x5c54('0x4f')](_0x3d09eb[_0x5c54('0x50')],{})['then'](respondWithResult(_0x11b52b,0xc9))[_0x5c54('0x4b')](handleError(_0x11b52b,null));};exports['update']=function(_0x1c0487,_0x51f97b){if(_0x1c0487['body']['id']){delete _0x1c0487[_0x5c54('0x50')]['id'];}return db[_0x5c54('0x51')][_0x5c54('0x4e')]({'where':{'id':_0x1c0487[_0x5c54('0x4d')]['id']}})[_0x5c54('0x2a')](handleEntityNotFound(_0x51f97b,null))[_0x5c54('0x2a')](saveUpdates(_0x1c0487['body'],null))['then'](respondWithResult(_0x51f97b,null))[_0x5c54('0x4b')](handleError(_0x51f97b,null));};exports['destroy']=function(_0x39b56f,_0x2748ca){return db[_0x5c54('0x51')]['find']({'where':{'id':_0x39b56f['params']['id']}})['then'](handleEntityNotFound(_0x2748ca,null))[_0x5c54('0x2a')](removeEntity(_0x2748ca,null))[_0x5c54('0x4b')](handleError(_0x2748ca,null));};exports[_0x5c54('0x52')]=function(_0x1ded5e,_0x13a49d,_0x50e6f9){var _0x36e7f6={};var _0x5e1eaa={};var _0x267dc7;var _0x30e922;return db[_0x5c54('0x51')][_0x5c54('0x53')]({'where':{'id':_0x1ded5e['params']['id']}})[_0x5c54('0x2a')](handleEntityNotFound(_0x13a49d,null))[_0x5c54('0x2a')](function(_0x4d18ea){if(_0x4d18ea){_0x267dc7=_0x4d18ea;_0x5e1eaa['model']=_[_0x5c54('0x34')](db['VtigerConfiguration'][_0x5c54('0x30')]);_0x5e1eaa[_0x5c54('0x35')]=_[_0x5c54('0x34')](_0x1ded5e[_0x5c54('0x35')]);_0x5e1eaa[_0x5c54('0x40')]=_['intersection'](_0x5e1eaa[_0x5c54('0x36')],_0x5e1eaa[_0x5c54('0x35')]);_0x36e7f6[_0x5c54('0x37')]=_[_0x5c54('0x38')](_0x5e1eaa[_0x5c54('0x36')],qs[_0x5c54('0x39')](_0x1ded5e[_0x5c54('0x35')][_0x5c54('0x39')]));_0x36e7f6['attributes']=_0x36e7f6['attributes']['length']?_0x36e7f6[_0x5c54('0x37')]:_0x5e1eaa['model'];_0x36e7f6[_0x5c54('0x3d')]=qs[_0x5c54('0x3e')](_0x1ded5e['query'][_0x5c54('0x3e')]);_0x36e7f6[_0x5c54('0x3f')]=qs[_0x5c54('0x40')](_['pick'](_0x1ded5e[_0x5c54('0x35')],_0x5e1eaa[_0x5c54('0x40')]));if(_0x1ded5e[_0x5c54('0x35')][_0x5c54('0x42')]){_0x36e7f6['where']=_[_0x5c54('0x43')](_0x36e7f6['where'],{'$or':_['map'](_0x36e7f6[_0x5c54('0x37')],function(_0x3b036e){var _0x7ed36b={};_0x7ed36b[_0x3b036e]={'$like':'%'+_0x1ded5e['query'][_0x5c54('0x42')]+'%'};return _0x7ed36b;})});}_0x36e7f6=_['merge']({},_0x36e7f6,_0x1ded5e['options']);return _0x267dc7[_0x5c54('0x52')](_0x36e7f6);}})[_0x5c54('0x2a')](function(_0x194679){if(_0x194679){_0x30e922=_0x194679[_0x5c54('0x3a')];if(!_0x1ded5e[_0x5c54('0x35')]['hasOwnProperty'](_0x5c54('0x3c'))){_0x36e7f6[_0x5c54('0x25')]=qs[_0x5c54('0x25')](_0x1ded5e[_0x5c54('0x35')][_0x5c54('0x25')]);_0x36e7f6[_0x5c54('0x23')]=qs[_0x5c54('0x23')](_0x1ded5e['query'][_0x5c54('0x23')]);}return _0x267dc7[_0x5c54('0x52')](_0x36e7f6);}})[_0x5c54('0x2a')](function(_0x4eafad){if(_0x4eafad){return _0x4eafad?{'count':_0x30e922,'rows':_0x4eafad}:null;}})[_0x5c54('0x2a')](respondWithResult(_0x13a49d,null))[_0x5c54('0x4b')](handleError(_0x13a49d,null));};exports[_0x5c54('0x54')]=function(_0x4088b4,_0x5d9be6,_0x1cb34d){if(_0x4088b4[_0x5c54('0x50')]['id']){delete _0x4088b4[_0x5c54('0x50')]['id'];}return db[_0x5c54('0x51')]['findOne']({'where':{'id':_0x4088b4[_0x5c54('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5d9be6,null))[_0x5c54('0x2a')](function(_0x4c4448){if(_0x4c4448){_0x4088b4[_0x5c54('0x50')]['AccountId']=_0x4c4448['id'];_0x4088b4['body'][_0x5c54('0x55')]=integrations[_0x5c54('0x56')](_0x4088b4['body'][_0x5c54('0x57')],_0x4088b4[_0x5c54('0x50')][_0x5c54('0x44')]);_0x4088b4[_0x5c54('0x50')][_0x5c54('0x58')]=integrations['getDescriptions'](_0x4088b4['body'][_0x5c54('0x57')],_0x4088b4['body'][_0x5c54('0x44')]);return db['VtigerConfiguration'][_0x5c54('0x4f')](_0x4088b4[_0x5c54('0x50')],{'include':[{'model':db[_0x5c54('0x59')],'as':_0x5c54('0x55')},{'model':db['VtigerField'],'as':_0x5c54('0x58')}]});}return null;})['then'](respondWithResult(_0x5d9be6,null))[_0x5c54('0x4b')](handleError(_0x5d9be6,null));};var md5=require(_0x5c54('0x5a'));exports[_0x5c54('0x5b')]=function(_0x309c6b,_0x4e0e6b,_0x50ab2e){var _0x56f5de=null;var _0xde8a62=null;var _0x8addbb=null;var _0x261202=null;var _0x13492a='';return db['VtigerAccount'][_0x5c54('0x53')]({'where':{'id':_0x309c6b[_0x5c54('0x4d')]['id']},'attributes':['id',_0x5c54('0x2e'),'username',_0x5c54('0x5c'),_0x5c54('0x5d'),'remoteUri',_0x5c54('0x5e'),_0x5c54('0x5f')]})[_0x5c54('0x2a')](handleEntityNotFound(_0x4e0e6b,null))[_0x5c54('0x2a')](function(_0xc13608){if(_0xc13608){_0x56f5de=_0xc13608[_0x5c54('0x60')];_0xde8a62=_0xc13608[_0x5c54('0x5f')];_0x8addbb=_0xc13608[_0x5c54('0x5d')];_0x13492a=_0xc13608[_0x5c54('0x61')];var _0x106a89=_0x13492a[_0x5c54('0x62')](-0x1);if(_0x106a89==='/'){_0x13492a=_0x13492a['substring'](0x0,_0x13492a[_0x5c54('0x63')](_0x106a89));}_0x261202=util[_0x5c54('0x64')](_0x5c54('0x65'),_0x13492a);var _0xc351e3={'method':'GET','uri':_0x261202,'qs':{'operation':'getchallenge','username':_0xc13608['username']},'json':!![]};return rp(_0xc351e3);}})[_0x5c54('0x2a')](function(_0x1f3103){if(_0x1f3103[_0x5c54('0x66')]){var _0x2313bd={'method':_0x5c54('0x67'),'uri':_0x261202,'form':{'operation':_0x5c54('0x68'),'username':_0x56f5de,'accessKey':md5(_0x1f3103['result']['token']+_0xde8a62)},'json':!![]};return rp(_0x2313bd);}})[_0x5c54('0x2a')](function(_0x4c5e37){if(_0x4c5e37['success']){var _0x1f5815={'method':_0x5c54('0x69'),'uri':_0x261202,'qs':{'operation':_0x5c54('0x6a'),'username':_0x56f5de,'sessionName':_0x4c5e37['result'][_0x5c54('0x6b')],'elementType':_0x8addbb},'json':!![]};return rp(_0x1f5815);}})[_0x5c54('0x2a')](function(_0x397a4f){if(_0x397a4f[_0x5c54('0x66')]){var _0x16f829=[_0x5c54('0x6c'),_0x5c54('0x6d'),_0x5c54('0x6e')];_['remove'](_0x397a4f['result'][_0x5c54('0x39')],function(_0x3c8ea1){return _0x16f829[_0x5c54('0x6f')](_0x3c8ea1[_0x5c54('0x44')][_0x5c54('0x2e')]);});_['remove'](_0x397a4f['result'][_0x5c54('0x39')],function(_0x362bbb){return _0x362bbb[_0x5c54('0x70')]===_0x5c54('0x71');});return{'count':_0x397a4f['result']['fields'][_0x5c54('0x3a')],'rows':_[_0x5c54('0x33')](_0x397a4f[_0x5c54('0x72')][_0x5c54('0x39')],function(_0x569ba1){return{'id':_0x569ba1[_0x5c54('0x2e')],'name':_0x569ba1[_0x5c54('0x73')],'custom':_[_0x5c54('0x74')](_0x569ba1[_0x5c54('0x2e')],_0x5c54('0x75'))?!![]:![],'options':_0x569ba1[_0x5c54('0x44')][_0x5c54('0x2e')]===_0x5c54('0x76')&&_0x569ba1['type'][_0x5c54('0x77')][_0x5c54('0x3a')]>0x0?_[_0x5c54('0x33')](_0x569ba1[_0x5c54('0x44')]['picklistValues'],function(_0x14cfd6){return{'name':_0x14cfd6[_0x5c54('0x73')],'value':_0x14cfd6[_0x5c54('0x78')]};}):[]};})};}})[_0x5c54('0x2a')](respondWithResult(_0x4e0e6b,null))[_0x5c54('0x4b')](function(_0x20f59c){console[_0x5c54('0x79')](_0x5c54('0x7a')+_0x20f59c);var _0x14ee15=_0x309c6b[_0x5c54('0x35')][_0x5c54('0x7b')]?0x1f4:_0x20f59c['statusCode']||0x1f4;logger[_0x5c54('0x2c')](_0x5c54('0x7c'),'getFields',_0x14ee15,JSON[_0x5c54('0x7d')](_0x20f59c));delete _0x20f59c[_0x5c54('0x2e')];if(_0x14ee15===0x191){_0x14ee15=0x190;}_0x4e0e6b['status'](_0x14ee15)[_0x5c54('0x7e')](_0x309c6b[_0x5c54('0x35')][_0x5c54('0x7b')]?{'message':'Wrong\x20credentials','statusCode':_0x20f59c['statusCode']}:_0x20f59c);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index afccf1a..fe3a719 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 _0xae2c=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','util','../../config/logger','api','moment','request-promise'];(function(_0x235964,_0x7e3a0d){var _0x139d9d=function(_0x3edc55){while(--_0x3edc55){_0x235964['push'](_0x235964['shift']());}};_0x139d9d(++_0x7e3a0d);}(_0xae2c,0x7f));var _0xcae2=function(_0x263499,_0x364d7e){_0x263499=_0x263499-0x0;var _0x4229c6=_0xae2c[_0x263499];return _0x4229c6;};'use strict';var _=require('lodash');var util=require(_0xcae2('0x0'));var logger=require(_0xcae2('0x1'))(_0xcae2('0x2'));var moment=require(_0xcae2('0x3'));var BPromise=require('bluebird');var rp=require(_0xcae2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcae2('0x5'));var attributes=require(_0xcae2('0x6'));var integrations=require(_0xcae2('0x7'));module[_0xcae2('0x8')]=function(_0x50b535,_0x511d48){return _0x50b535[_0xcae2('0x9')](_0xcae2('0xa'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd41f=['exports','define','int_vtiger_accounts','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration'];(function(_0x1f83a5,_0x59843f){var _0x45edf0=function(_0x431e25){while(--_0x431e25){_0x1f83a5['push'](_0x1f83a5['shift']());}};_0x45edf0(++_0x59843f);}(_0xd41f,0x7b));var _0xfd41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd41f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xfd41('0x0'));var logger=require(_0xfd41('0x1'))('api');var moment=require(_0xfd41('0x2'));var BPromise=require('bluebird');var rp=require(_0xfd41('0x3'));var fs=require('fs');var path=require(_0xfd41('0x4'));var rimraf=require(_0xfd41('0x5'));var config=require(_0xfd41('0x6'));var attributes=require(_0xfd41('0x7'));var integrations=require(_0xfd41('0x8'));module[_0xfd41('0x9')]=function(_0x438107,_0x1da21c){return _0x438107[_0xfd41('0xa')]('VtigerAccount',attributes,{'tableName':_0xfd41('0xb'),'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 a97d85e..27047d4 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 _0x6b20=['../../config/environment','jayson/promise','client','http','request','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','map','attributes','include','model','then','debug','stringify','catch','ShowVtigerAccount','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x6b20,0xd1));var _0x06b2=function(_0x31ef9f,_0x4a6c1e){_0x31ef9f=_0x31ef9f-0x0;var _0x39c86a=_0x6b20[_0x31ef9f];return _0x39c86a;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b825,_0x26a325,_0x4e6d3b){return new BPromise(function(_0x21cd31,_0x1828e4){return client[_0x06b2('0xb')](_0x37b825,_0x4e6d3b)['then'](function(_0x37ace0){logger['info'](_0x06b2('0xc'),_0x26a325,'request\x20sent');logger['debug'](_0x06b2('0xd'),_0x26a325,_0x06b2('0xe'),JSON['stringify'](_0x37ace0));if(_0x37ace0[_0x06b2('0xf')]){if(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x10')]===0x1f4){logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x1828e4(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);}logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x21cd31(_0x37ace0['error'][_0x06b2('0x11')]);}else{logger[_0x06b2('0x12')](_0x06b2('0xc'),_0x26a325,_0x06b2('0xe'));_0x21cd31(_0x37ace0[_0x06b2('0x13')][_0x06b2('0x11')]);}})['catch'](function(_0x17e69b){logger[_0x06b2('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x26a325,_0x17e69b);_0x1828e4(_0x17e69b);});});}exports[_0x06b2('0x14')]=function(_0x594b48){var _0x4c9cae=this;return new Promise(function(_0x192270,_0x1b4ab0){return db[_0x06b2('0x15')][_0x06b2('0x16')]({'raw':_0x594b48['options']?_0x594b48[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![],'where':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')][_0x06b2('0x19')]||null:null,'attributes':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')]['attributes']||null:null,'limit':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')][_0x06b2('0x1a')]||null:null,'include':_0x594b48[_0x06b2('0x17')]?_0x594b48['options']['include']?_[_0x06b2('0x1b')](_0x594b48[_0x06b2('0x17')]['include'],function(_0x39659f){return{'model':db[_0x39659f['model']],'as':_0x39659f['as'],'attributes':_0x39659f[_0x06b2('0x1c')],'include':_0x39659f[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x39659f['include'],function(_0x4382ce){return{'model':db[_0x4382ce[_0x06b2('0x1e')]],'as':_0x4382ce['as'],'attributes':_0x4382ce[_0x06b2('0x1c')],'include':_0x4382ce[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x4382ce['include'],function(_0xbb00ea){return{'model':db[_0xbb00ea[_0x06b2('0x1e')]],'as':_0xbb00ea['as'],'attributes':_0xbb00ea[_0x06b2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0x1f')](function(_0x1976ac){logger[_0x06b2('0x12')]('GetVtigerAccount',_0x594b48);logger[_0x06b2('0x20')](_0x06b2('0x14'),_0x594b48,JSON[_0x06b2('0x21')](_0x1976ac));_0x192270(_0x1976ac);})[_0x06b2('0x22')](function(_0x1f02d8){logger[_0x06b2('0xf')](_0x06b2('0x14'),_0x1f02d8['message'],_0x594b48);_0x1b4ab0(_0x4c9cae[_0x06b2('0xf')](0x1f4,_0x1f02d8[_0x06b2('0x11')]));});});};exports[_0x06b2('0x23')]=function(_0x15a78b){var _0x1cc725=this;return new Promise(function(_0x37d391,_0x401551){return db[_0x06b2('0x15')]['find']({'raw':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![],'where':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x19')]||null:null,'attributes':_0x15a78b[_0x06b2('0x17')]?_0x15a78b['options']['attributes']||null:null,'include':_0x15a78b[_0x06b2('0x17')]?_0x15a78b[_0x06b2('0x17')][_0x06b2('0x1d')]?_['map'](_0x15a78b[_0x06b2('0x17')][_0x06b2('0x1d')],function(_0x37bfb5){return{'model':db[_0x37bfb5[_0x06b2('0x1e')]],'as':_0x37bfb5['as'],'attributes':_0x37bfb5[_0x06b2('0x1c')],'include':_0x37bfb5[_0x06b2('0x1d')]?_['map'](_0x37bfb5[_0x06b2('0x1d')],function(_0x1e66f1){return{'model':db[_0x1e66f1[_0x06b2('0x1e')]],'as':_0x1e66f1['as'],'attributes':_0x1e66f1['attributes'],'include':_0x1e66f1[_0x06b2('0x1d')]?_[_0x06b2('0x1b')](_0x1e66f1['include'],function(_0x45ea67){return{'model':db[_0x45ea67[_0x06b2('0x1e')]],'as':_0x45ea67['as'],'attributes':_0x45ea67[_0x06b2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x06b2('0x1f')](function(_0x2e49df){logger[_0x06b2('0x12')](_0x06b2('0x23'),_0x15a78b);logger[_0x06b2('0x20')](_0x06b2('0x23'),_0x15a78b,JSON[_0x06b2('0x21')](_0x2e49df));_0x37d391(_0x2e49df);})[_0x06b2('0x22')](function(_0x1cc7b6){logger['error'](_0x06b2('0x23'),_0x1cc7b6['message'],_0x15a78b);_0x401551(_0x1cc725['error'](0x1f4,_0x1cc7b6[_0x06b2('0x11')]));});});}; \ No newline at end of file +var _0x2e54=['error','message','result','catch','GetVtigerAccount','VtigerAccount','options','raw','where','attributes','map','include','model','ShowVtigerAccount','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2e78f2,_0x44c025){var _0x5310b7=function(_0x185f39){while(--_0x185f39){_0x2e78f2['push'](_0x2e78f2['shift']());}};_0x5310b7(++_0x44c025);}(_0x2e54,0x1dd));var _0x42e5=function(_0x354663,_0x23e994){_0x354663=_0x354663-0x0;var _0x5bbba1=_0x2e54[_0x354663];return _0x5bbba1;};'use strict';var _=require(_0x42e5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x42e5('0x1'));var rs=require(_0x42e5('0x2'));var fs=require('fs');var Redis=require(_0x42e5('0x3'));var db=require(_0x42e5('0x4'))['db'];var utils=require(_0x42e5('0x5'));var logger=require(_0x42e5('0x6'))(_0x42e5('0x7'));var config=require('../../config/environment');var jayson=require(_0x42e5('0x8'));var client=jayson[_0x42e5('0x9')][_0x42e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bed10,_0x2af5bb,_0x56be20){return new BPromise(function(_0x335b92,_0x490b99){return client[_0x42e5('0xb')](_0x4bed10,_0x56be20)[_0x42e5('0xc')](function(_0x10ee5a){logger[_0x42e5('0xd')](_0x42e5('0xe'),_0x2af5bb,_0x42e5('0xf'));logger[_0x42e5('0x10')](_0x42e5('0x11'),_0x2af5bb,_0x42e5('0xf'),JSON['stringify'](_0x10ee5a));if(_0x10ee5a[_0x42e5('0x12')]){if(_0x10ee5a[_0x42e5('0x12')]['code']===0x1f4){logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);return _0x490b99(_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);}logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);return _0x335b92(_0x10ee5a['error'][_0x42e5('0x13')]);}else{logger[_0x42e5('0xd')](_0x42e5('0xe'),_0x2af5bb,_0x42e5('0xf'));_0x335b92(_0x10ee5a[_0x42e5('0x14')][_0x42e5('0x13')]);}})[_0x42e5('0x15')](function(_0x3abe3d){logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x3abe3d);_0x490b99(_0x3abe3d);});});}exports[_0x42e5('0x16')]=function(_0x38282d){var _0x11550e=this;return new Promise(function(_0x23fe09,_0x54fcfc){return db[_0x42e5('0x17')]['findAll']({'raw':_0x38282d['options']?_0x38282d[_0x42e5('0x18')][_0x42e5('0x19')]===undefined?!![]:![]:!![],'where':_0x38282d['options']?_0x38282d[_0x42e5('0x18')][_0x42e5('0x1a')]||null:null,'attributes':_0x38282d[_0x42e5('0x18')]?_0x38282d[_0x42e5('0x18')][_0x42e5('0x1b')]||null:null,'limit':_0x38282d[_0x42e5('0x18')]?_0x38282d[_0x42e5('0x18')]['limit']||null:null,'include':_0x38282d['options']?_0x38282d[_0x42e5('0x18')]['include']?_[_0x42e5('0x1c')](_0x38282d[_0x42e5('0x18')][_0x42e5('0x1d')],function(_0x49490f){return{'model':db[_0x49490f[_0x42e5('0x1e')]],'as':_0x49490f['as'],'attributes':_0x49490f['attributes'],'include':_0x49490f[_0x42e5('0x1d')]?_[_0x42e5('0x1c')](_0x49490f[_0x42e5('0x1d')],function(_0x275c80){return{'model':db[_0x275c80[_0x42e5('0x1e')]],'as':_0x275c80['as'],'attributes':_0x275c80['attributes'],'include':_0x275c80['include']?_[_0x42e5('0x1c')](_0x275c80['include'],function(_0x56f812){return{'model':db[_0x56f812[_0x42e5('0x1e')]],'as':_0x56f812['as'],'attributes':_0x56f812['attributes']};}):[]};}):[]};}):[]:[]})[_0x42e5('0xc')](function(_0x2d9e65){logger[_0x42e5('0xd')](_0x42e5('0x16'),_0x38282d);logger[_0x42e5('0x10')](_0x42e5('0x16'),_0x38282d,JSON['stringify'](_0x2d9e65));_0x23fe09(_0x2d9e65);})[_0x42e5('0x15')](function(_0x201d9e){logger[_0x42e5('0x12')](_0x42e5('0x16'),_0x201d9e[_0x42e5('0x13')],_0x38282d);_0x54fcfc(_0x11550e[_0x42e5('0x12')](0x1f4,_0x201d9e[_0x42e5('0x13')]));});});};exports[_0x42e5('0x1f')]=function(_0x5a4930){var _0x2ba9ef=this;return new Promise(function(_0x2c7542,_0x3d9e8b){return db[_0x42e5('0x17')]['find']({'raw':_0x5a4930[_0x42e5('0x18')]?_0x5a4930[_0x42e5('0x18')][_0x42e5('0x19')]===undefined?!![]:![]:!![],'where':_0x5a4930[_0x42e5('0x18')]?_0x5a4930['options']['where']||null:null,'attributes':_0x5a4930[_0x42e5('0x18')]?_0x5a4930['options'][_0x42e5('0x1b')]||null:null,'include':_0x5a4930['options']?_0x5a4930[_0x42e5('0x18')][_0x42e5('0x1d')]?_[_0x42e5('0x1c')](_0x5a4930['options'][_0x42e5('0x1d')],function(_0x3a8d1c){return{'model':db[_0x3a8d1c['model']],'as':_0x3a8d1c['as'],'attributes':_0x3a8d1c[_0x42e5('0x1b')],'include':_0x3a8d1c['include']?_[_0x42e5('0x1c')](_0x3a8d1c[_0x42e5('0x1d')],function(_0x25a040){return{'model':db[_0x25a040[_0x42e5('0x1e')]],'as':_0x25a040['as'],'attributes':_0x25a040[_0x42e5('0x1b')],'include':_0x25a040[_0x42e5('0x1d')]?_[_0x42e5('0x1c')](_0x25a040['include'],function(_0x5a18cc){return{'model':db[_0x5a18cc[_0x42e5('0x1e')]],'as':_0x5a18cc['as'],'attributes':_0x5a18cc[_0x42e5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x42e5('0xc')](function(_0x4a1a8a){logger['info']('ShowVtigerAccount',_0x5a4930);logger['debug'](_0x42e5('0x1f'),_0x5a4930,JSON[_0x42e5('0x20')](_0x4a1a8a));_0x2c7542(_0x4a1a8a);})[_0x42e5('0x15')](function(_0xedb7bc){logger[_0x42e5('0x12')](_0x42e5('0x1f'),_0xedb7bc[_0x42e5('0x13')],_0x5a4930);_0x3d9e8b(_0x2ba9ef[_0x42e5('0x12')](0x1f4,_0xedb7bc['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 425de72..98b7702 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 _0xae3a=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x1719a2,_0x357eda){var _0x4295a0=function(_0x4e53dd){while(--_0x4e53dd){_0x1719a2['push'](_0x1719a2['shift']());}};_0x4295a0(++_0x357eda);}(_0xae3a,0x120));var _0xaae3=function(_0x5d9c37,_0x518b93){_0x5d9c37=_0x5d9c37-0x0;var _0x1ba9eb=_0xae3a[_0x5d9c37];return _0x1ba9eb;};'use strict';var multer=require(_0xaae3('0x0'));var util=require('util');var path=require(_0xaae3('0x1'));var timeout=require(_0xaae3('0x2'));var express=require(_0xaae3('0x3'));var router=express[_0xaae3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaae3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaae3('0x6'));var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth[_0xaae3('0x7')](),controller[_0xaae3('0x8')]);router[_0xaae3('0x9')](_0xaae3('0xa'),auth[_0xaae3('0x7')](),controller[_0xaae3('0xb')]);router[_0xaae3('0x9')](_0xaae3('0xc'),auth[_0xaae3('0x7')](),controller[_0xaae3('0xd')]);router[_0xaae3('0x9')]('/:id/subjects',auth[_0xaae3('0x7')](),controller[_0xaae3('0xe')]);router[_0xaae3('0x9')](_0xaae3('0xf'),auth[_0xaae3('0x7')](),controller[_0xaae3('0x10')]);router[_0xaae3('0x11')]('/',auth[_0xaae3('0x7')](),controller['create']);router[_0xaae3('0x12')](_0xaae3('0xa'),auth[_0xaae3('0x7')](),controller[_0xaae3('0x13')]);router[_0xaae3('0x14')](_0xaae3('0xa'),auth['isAuthenticated'](),controller[_0xaae3('0x15')]);module[_0xaae3('0x16')]=router; \ No newline at end of file +var _0xa77d=['post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x53f648,_0x164d4d){var _0xd3ee15=function(_0x595067){while(--_0x595067){_0x53f648['push'](_0x53f648['shift']());}};_0xd3ee15(++_0x164d4d);}(_0xa77d,0x103));var _0xda77=function(_0x9c22da,_0xd059c3){_0x9c22da=_0x9c22da-0x0;var _0x386c9a=_0xa77d[_0x9c22da];return _0x386c9a;};'use strict';var multer=require(_0xda77('0x0'));var util=require(_0xda77('0x1'));var path=require(_0xda77('0x2'));var timeout=require('connect-timeout');var express=require(_0xda77('0x3'));var router=express[_0xda77('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xda77('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xda77('0x6'));var controller=require(_0xda77('0x7'));router[_0xda77('0x8')]('/',auth[_0xda77('0x9')](),controller[_0xda77('0xa')]);router[_0xda77('0x8')](_0xda77('0xb'),auth[_0xda77('0x9')](),controller['show']);router[_0xda77('0x8')](_0xda77('0xc'),auth[_0xda77('0x9')](),controller[_0xda77('0xd')]);router[_0xda77('0x8')](_0xda77('0xe'),auth['isAuthenticated'](),controller[_0xda77('0xf')]);router['get'](_0xda77('0x10'),auth[_0xda77('0x9')](),controller['getDescriptions']);router[_0xda77('0x11')]('/',auth['isAuthenticated'](),controller[_0xda77('0x12')]);router['put'](_0xda77('0xb'),auth[_0xda77('0x9')](),controller[_0xda77('0x13')]);router[_0xda77('0x14')]('/:id',auth[_0xda77('0x9')](),controller[_0xda77('0x15')]);module[_0xda77('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 4866671..5783898 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 _0x8e98=['STRING','exports'];(function(_0x2cb0fd,_0x55132c){var _0x4e1062=function(_0x48e064){while(--_0x48e064){_0x2cb0fd['push'](_0x2cb0fd['shift']());}};_0x4e1062(++_0x55132c);}(_0x8e98,0x10b));var _0x88e9=function(_0x2873e4,_0x5a16be){_0x2873e4=_0x2873e4-0x0;var _0x42f070=_0x8e98[_0x2873e4];return _0x42f070;};'use strict';var Sequelize=require('sequelize');module[_0x88e9('0x0')]={'name':{'type':Sequelize[_0x88e9('0x1')]},'description':{'type':Sequelize[_0x88e9('0x1')]}}; \ No newline at end of file +var _0xbe16=['STRING','sequelize'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xbe16,0x15b));var _0x6be1=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xbe16[_0x4ed520];return _0x4415a6;};'use strict';var Sequelize=require(_0x6be1('0x0'));module['exports']={'name':{'type':Sequelize[_0x6be1('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 144dedb..753e2d5 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 _0xb63f=['getFields','findOne','sort','getSubjects','VtigerField','nolimit','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body'];(function(_0xd75b98,_0x15ad99){var _0xdd720e=function(_0x326b38){while(--_0x326b38){_0xd75b98['push'](_0xd75b98['shift']());}};_0xdd720e(++_0x15ad99);}(_0xb63f,0xa3));var _0xfb63=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0xb63f[_0x21cb7f];return _0x5a079a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfb63('0x0'));var jsonpatch=require(_0xfb63('0x1'));var rp=require(_0xfb63('0x2'));var moment=require(_0xfb63('0x3'));var BPromise=require(_0xfb63('0x4'));var Mustache=require(_0xfb63('0x5'));var util=require(_0xfb63('0x6'));var path=require(_0xfb63('0x7'));var sox=require(_0xfb63('0x8'));var csv=require('to-csv');var ejs=require(_0xfb63('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb63('0xa'));var squel=require(_0xfb63('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfb63('0xc'));var querystring=require(_0xfb63('0xd'));var Papa=require(_0xfb63('0xe'));var Redis=require('ioredis');var authService=require(_0xfb63('0xf'));var qs=require(_0xfb63('0x10'));var as=require(_0xfb63('0x11'));var hardwareService=require(_0xfb63('0x12'));var logger=require(_0xfb63('0x13'))(_0xfb63('0x14'));var utils=require(_0xfb63('0x15'));var config=require(_0xfb63('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xee69d,_0x233ec3){_0x233ec3=_0x233ec3||0xcc;return function(_0xa2f034){if(_0xa2f034){return _0xee69d['sendStatus'](_0x233ec3);}return _0xee69d[_0xfb63('0x17')](_0x233ec3)[_0xfb63('0x18')]();};}function respondWithResult(_0x48a22c,_0x4575b6){_0x4575b6=_0x4575b6||0xc8;return function(_0x377d1e){if(_0x377d1e){return _0x48a22c[_0xfb63('0x17')](_0x4575b6)[_0xfb63('0x19')](_0x377d1e);}};}function respondWithFilteredResult(_0x51e7ef,_0x44619e){return function(_0x48e2c0){if(_0x48e2c0){var _0x19f196=typeof _0x44619e[_0xfb63('0x1a')]===_0xfb63('0x1b')&&typeof _0x44619e[_0xfb63('0x1c')]===_0xfb63('0x1b');var _0x49081d=_0x48e2c0[_0xfb63('0x1d')];var _0x5dfd32=_0x19f196?0x0:_0x44619e[_0xfb63('0x1a')];var _0x4f7508=_0x19f196?_0x48e2c0[_0xfb63('0x1d')]:_0x44619e[_0xfb63('0x1a')]+_0x44619e[_0xfb63('0x1c')];var _0x452f1e;if(_0x4f7508>=_0x49081d){_0x4f7508=_0x49081d;_0x452f1e=0xc8;}else{_0x452f1e=0xce;}_0x51e7ef['status'](_0x452f1e);return _0x51e7ef[_0xfb63('0x1e')]('Content-Range',_0x5dfd32+'-'+_0x4f7508+'/'+_0x49081d)[_0xfb63('0x19')](_0x48e2c0);}return null;};}function patchUpdates(_0x3ef0cf){return function(_0x564052){try{jsonpatch[_0xfb63('0x1f')](_0x564052,_0x3ef0cf,!![]);}catch(_0x23c4fb){return BPromise['reject'](_0x23c4fb);}return _0x564052[_0xfb63('0x20')]();};}function saveUpdates(_0x43bf68,_0x267953){return function(_0x34e22c){if(_0x34e22c){return _0x34e22c[_0xfb63('0x21')](_0x43bf68)[_0xfb63('0x22')](function(_0x17f81e){return _0x17f81e;});}return null;};}function removeEntity(_0x1bbedc,_0x43c245){return function(_0xa7612f){if(_0xa7612f){return _0xa7612f[_0xfb63('0x23')]()[_0xfb63('0x22')](function(){_0x1bbedc[_0xfb63('0x17')](0xcc)[_0xfb63('0x18')]();});}};}function handleEntityNotFound(_0x26036d,_0x19ea95){return function(_0x1b8f0a){if(!_0x1b8f0a){_0x26036d[_0xfb63('0x24')](0x194);}return _0x1b8f0a;};}function handleError(_0x49482f,_0x2bbe9a){_0x2bbe9a=_0x2bbe9a||0x1f4;return function(_0x4c80c1){logger['error'](_0x4c80c1[_0xfb63('0x25')]);if(_0x4c80c1[_0xfb63('0x26')]){delete _0x4c80c1[_0xfb63('0x26')];}_0x49482f[_0xfb63('0x17')](_0x2bbe9a)[_0xfb63('0x27')](_0x4c80c1);};}exports[_0xfb63('0x28')]=function(_0x594962,_0x45e231){var _0x2a008e={},_0x441dd7={},_0x188501={'count':0x0,'rows':[]};var _0x3c910b=_[_0xfb63('0x29')](db[_0xfb63('0x2a')][_0xfb63('0x2b')],function(_0x293909){return{'name':_0x293909[_0xfb63('0x2c')],'type':_0x293909[_0xfb63('0x2d')]['key']};});_0x441dd7[_0xfb63('0x2e')]=_['map'](_0x3c910b,_0xfb63('0x26'));_0x441dd7[_0xfb63('0x2f')]=_[_0xfb63('0x30')](_0x594962['query']);_0x441dd7['filters']=_[_0xfb63('0x31')](_0x441dd7['model'],_0x441dd7['query']);_0x2a008e[_0xfb63('0x32')]=_['intersection'](_0x441dd7[_0xfb63('0x2e')],qs[_0xfb63('0x33')](_0x594962[_0xfb63('0x2f')][_0xfb63('0x33')]));_0x2a008e[_0xfb63('0x32')]=_0x2a008e[_0xfb63('0x32')][_0xfb63('0x34')]?_0x2a008e[_0xfb63('0x32')]:_0x441dd7['model'];if(!_0x594962['query'][_0xfb63('0x35')]('nolimit')){_0x2a008e[_0xfb63('0x1c')]=qs[_0xfb63('0x1c')](_0x594962[_0xfb63('0x2f')][_0xfb63('0x1c')]);_0x2a008e[_0xfb63('0x1a')]=qs['offset'](_0x594962['query'][_0xfb63('0x1a')]);}_0x2a008e[_0xfb63('0x36')]=qs['sort'](_0x594962['query']['sort']);_0x2a008e[_0xfb63('0x37')]=qs[_0xfb63('0x38')](_[_0xfb63('0x39')](_0x594962['query'],_0x441dd7[_0xfb63('0x38')]),_0x3c910b);if(_0x594962[_0xfb63('0x2f')][_0xfb63('0x3a')]){_0x2a008e[_0xfb63('0x37')]=_[_0xfb63('0x3b')](_0x2a008e[_0xfb63('0x37')],{'$or':_[_0xfb63('0x29')](_0x3c910b,function(_0x579ca5){if(_0x579ca5['type']!==_0xfb63('0x3c')){var _0x4fb080={};_0x4fb080[_0x579ca5[_0xfb63('0x26')]]={'$like':'%'+_0x594962[_0xfb63('0x2f')][_0xfb63('0x3a')]+'%'};return _0x4fb080;}})});}_0x2a008e=_[_0xfb63('0x3b')]({},_0x2a008e,_0x594962[_0xfb63('0x3d')]);var _0x38ecc3={'where':_0x2a008e[_0xfb63('0x37')]};return db[_0xfb63('0x2a')][_0xfb63('0x1d')](_0x38ecc3)[_0xfb63('0x22')](function(_0x3d745a){_0x188501[_0xfb63('0x1d')]=_0x3d745a;if(_0x594962[_0xfb63('0x2f')][_0xfb63('0x3e')]){_0x2a008e[_0xfb63('0x3f')]=[{'all':!![]}];}return db[_0xfb63('0x2a')][_0xfb63('0x40')](_0x2a008e);})[_0xfb63('0x22')](function(_0x3f0d52){_0x188501[_0xfb63('0x41')]=_0x3f0d52;return _0x188501;})[_0xfb63('0x22')](respondWithFilteredResult(_0x45e231,_0x2a008e))['catch'](handleError(_0x45e231,null));};exports['show']=function(_0x29786a,_0x54346d){var _0x3bdc62={'raw':![],'where':{'id':_0x29786a[_0xfb63('0x42')]['id']}},_0x1fc68b={};_0x1fc68b[_0xfb63('0x2e')]=_[_0xfb63('0x30')](db[_0xfb63('0x2a')][_0xfb63('0x2b')]);_0x1fc68b[_0xfb63('0x2f')]=_[_0xfb63('0x30')](_0x29786a[_0xfb63('0x2f')]);_0x1fc68b[_0xfb63('0x38')]=_[_0xfb63('0x31')](_0x1fc68b['model'],_0x1fc68b[_0xfb63('0x2f')]);_0x3bdc62[_0xfb63('0x32')]=_[_0xfb63('0x31')](_0x1fc68b[_0xfb63('0x2e')],qs[_0xfb63('0x33')](_0x29786a[_0xfb63('0x2f')][_0xfb63('0x33')]));_0x3bdc62[_0xfb63('0x32')]=_0x3bdc62[_0xfb63('0x32')]['length']?_0x3bdc62[_0xfb63('0x32')]:_0x1fc68b[_0xfb63('0x2e')];if(_0x29786a[_0xfb63('0x2f')][_0xfb63('0x3e')]){_0x3bdc62[_0xfb63('0x3f')]=[{'all':!![]}];}_0x3bdc62=_[_0xfb63('0x3b')]({},_0x3bdc62,_0x29786a['options']);return db[_0xfb63('0x2a')][_0xfb63('0x43')](_0x3bdc62)[_0xfb63('0x22')](handleEntityNotFound(_0x54346d,null))[_0xfb63('0x22')](respondWithResult(_0x54346d,null))[_0xfb63('0x44')](handleError(_0x54346d,null));};exports[_0xfb63('0x45')]=function(_0x2cf398,_0x13030c){return db[_0xfb63('0x2a')]['create'](_0x2cf398[_0xfb63('0x46')],{})[_0xfb63('0x22')](respondWithResult(_0x13030c,0xc9))[_0xfb63('0x44')](handleError(_0x13030c,null));};exports[_0xfb63('0x21')]=function(_0x27a179,_0x1f0478){if(_0x27a179[_0xfb63('0x46')]['id']){delete _0x27a179[_0xfb63('0x46')]['id'];}return db[_0xfb63('0x2a')]['find']({'where':{'id':_0x27a179[_0xfb63('0x42')]['id']}})[_0xfb63('0x22')](handleEntityNotFound(_0x1f0478,null))[_0xfb63('0x22')](saveUpdates(_0x27a179[_0xfb63('0x46')],null))[_0xfb63('0x22')](respondWithResult(_0x1f0478,null))[_0xfb63('0x44')](handleError(_0x1f0478,null));};exports['destroy']=function(_0x39d921,_0x24aa62){return db['VtigerConfiguration'][_0xfb63('0x43')]({'where':{'id':_0x39d921[_0xfb63('0x42')]['id']}})[_0xfb63('0x22')](handleEntityNotFound(_0x24aa62,null))[_0xfb63('0x22')](removeEntity(_0x24aa62,null))[_0xfb63('0x44')](handleError(_0x24aa62,null));};exports[_0xfb63('0x47')]=function(_0xf95110,_0x43c1a8,_0x10aa68){var _0x1ccb6a={};var _0x69a7eb={};var _0x577412;var _0x17aad5;return db[_0xfb63('0x2a')][_0xfb63('0x48')]({'where':{'id':_0xf95110['params']['id']}})['then'](handleEntityNotFound(_0x43c1a8,null))[_0xfb63('0x22')](function(_0x284773){if(_0x284773){_0x577412=_0x284773;_0x69a7eb[_0xfb63('0x2e')]=_[_0xfb63('0x30')](db['VtigerField'][_0xfb63('0x2b')]);_0x69a7eb[_0xfb63('0x2f')]=_[_0xfb63('0x30')](_0xf95110[_0xfb63('0x2f')]);_0x69a7eb[_0xfb63('0x38')]=_[_0xfb63('0x31')](_0x69a7eb[_0xfb63('0x2e')],_0x69a7eb[_0xfb63('0x2f')]);_0x1ccb6a['attributes']=_[_0xfb63('0x31')](_0x69a7eb[_0xfb63('0x2e')],qs[_0xfb63('0x33')](_0xf95110[_0xfb63('0x2f')]['fields']));_0x1ccb6a[_0xfb63('0x32')]=_0x1ccb6a[_0xfb63('0x32')][_0xfb63('0x34')]?_0x1ccb6a[_0xfb63('0x32')]:_0x69a7eb[_0xfb63('0x2e')];_0x1ccb6a['order']=qs['sort'](_0xf95110[_0xfb63('0x2f')][_0xfb63('0x49')]);_0x1ccb6a[_0xfb63('0x37')]=qs[_0xfb63('0x38')](_[_0xfb63('0x39')](_0xf95110['query'],_0x69a7eb[_0xfb63('0x38')]));if(_0xf95110['query'][_0xfb63('0x3a')]){_0x1ccb6a[_0xfb63('0x37')]=_[_0xfb63('0x3b')](_0x1ccb6a[_0xfb63('0x37')],{'$or':_[_0xfb63('0x29')](_0x1ccb6a[_0xfb63('0x32')],function(_0x396094){var _0x4c5267={};_0x4c5267[_0x396094]={'$like':'%'+_0xf95110[_0xfb63('0x2f')][_0xfb63('0x3a')]+'%'};return _0x4c5267;})});}_0x1ccb6a=_[_0xfb63('0x3b')]({},_0x1ccb6a,_0xf95110['options']);return _0x577412[_0xfb63('0x47')](_0x1ccb6a);}})[_0xfb63('0x22')](function(_0x17ab6d){if(_0x17ab6d){_0x17aad5=_0x17ab6d[_0xfb63('0x34')];if(!_0xf95110['query']['hasOwnProperty']('nolimit')){_0x1ccb6a['limit']=qs[_0xfb63('0x1c')](_0xf95110['query'][_0xfb63('0x1c')]);_0x1ccb6a[_0xfb63('0x1a')]=qs[_0xfb63('0x1a')](_0xf95110['query'][_0xfb63('0x1a')]);}return _0x577412[_0xfb63('0x47')](_0x1ccb6a);}})[_0xfb63('0x22')](function(_0x2b1c8f){if(_0x2b1c8f){return _0x2b1c8f?{'count':_0x17aad5,'rows':_0x2b1c8f}:null;}})[_0xfb63('0x22')](respondWithResult(_0x43c1a8,null))['catch'](handleError(_0x43c1a8,null));};exports[_0xfb63('0x4a')]=function(_0x2d7d7c,_0x4accab,_0x593e1e){var _0x2efe73={};var _0x3e4505={};var _0x31357b;var _0x4838ef;return db[_0xfb63('0x2a')][_0xfb63('0x48')]({'where':{'id':_0x2d7d7c[_0xfb63('0x42')]['id']}})[_0xfb63('0x22')](handleEntityNotFound(_0x4accab,null))[_0xfb63('0x22')](function(_0x530ede){if(_0x530ede){_0x31357b=_0x530ede;_0x3e4505['model']=_[_0xfb63('0x30')](db[_0xfb63('0x4b')][_0xfb63('0x2b')]);_0x3e4505[_0xfb63('0x2f')]=_[_0xfb63('0x30')](_0x2d7d7c[_0xfb63('0x2f')]);_0x3e4505['filters']=_[_0xfb63('0x31')](_0x3e4505[_0xfb63('0x2e')],_0x3e4505[_0xfb63('0x2f')]);_0x2efe73[_0xfb63('0x32')]=_[_0xfb63('0x31')](_0x3e4505[_0xfb63('0x2e')],qs[_0xfb63('0x33')](_0x2d7d7c[_0xfb63('0x2f')]['fields']));_0x2efe73['attributes']=_0x2efe73['attributes'][_0xfb63('0x34')]?_0x2efe73[_0xfb63('0x32')]:_0x3e4505[_0xfb63('0x2e')];_0x2efe73[_0xfb63('0x36')]=qs[_0xfb63('0x49')](_0x2d7d7c[_0xfb63('0x2f')]['sort']);_0x2efe73['where']=qs[_0xfb63('0x38')](_[_0xfb63('0x39')](_0x2d7d7c['query'],_0x3e4505['filters']));if(_0x2d7d7c[_0xfb63('0x2f')]['filter']){_0x2efe73[_0xfb63('0x37')]=_[_0xfb63('0x3b')](_0x2efe73[_0xfb63('0x37')],{'$or':_['map'](_0x2efe73[_0xfb63('0x32')],function(_0x351788){var _0x35b732={};_0x35b732[_0x351788]={'$like':'%'+_0x2d7d7c[_0xfb63('0x2f')][_0xfb63('0x3a')]+'%'};return _0x35b732;})});}_0x2efe73=_[_0xfb63('0x3b')]({},_0x2efe73,_0x2d7d7c['options']);return _0x31357b[_0xfb63('0x4a')](_0x2efe73);}})[_0xfb63('0x22')](function(_0x3f3c75){if(_0x3f3c75){_0x4838ef=_0x3f3c75['length'];if(!_0x2d7d7c['query'][_0xfb63('0x35')](_0xfb63('0x4c'))){_0x2efe73[_0xfb63('0x1c')]=qs[_0xfb63('0x1c')](_0x2d7d7c[_0xfb63('0x2f')][_0xfb63('0x1c')]);_0x2efe73[_0xfb63('0x1a')]=qs['offset'](_0x2d7d7c['query'][_0xfb63('0x1a')]);}return _0x31357b[_0xfb63('0x4a')](_0x2efe73);}})[_0xfb63('0x22')](function(_0x27f15d){if(_0x27f15d){return _0x27f15d?{'count':_0x4838ef,'rows':_0x27f15d}:null;}})[_0xfb63('0x22')](respondWithResult(_0x4accab,null))['catch'](handleError(_0x4accab,null));};exports[_0xfb63('0x4d')]=function(_0x2637c9,_0x113d26,_0x488cd2){var _0x18aac4={};var _0x17c766={};var _0x274cf2;var _0x492bfa;return db[_0xfb63('0x2a')]['findOne']({'where':{'id':_0x2637c9[_0xfb63('0x42')]['id']}})[_0xfb63('0x22')](handleEntityNotFound(_0x113d26,null))[_0xfb63('0x22')](function(_0x10e4ad){if(_0x10e4ad){_0x274cf2=_0x10e4ad;_0x17c766[_0xfb63('0x2e')]=_['keys'](db[_0xfb63('0x4b')][_0xfb63('0x2b')]);_0x17c766['query']=_[_0xfb63('0x30')](_0x2637c9[_0xfb63('0x2f')]);_0x17c766[_0xfb63('0x38')]=_[_0xfb63('0x31')](_0x17c766[_0xfb63('0x2e')],_0x17c766[_0xfb63('0x2f')]);_0x18aac4[_0xfb63('0x32')]=_[_0xfb63('0x31')](_0x17c766['model'],qs[_0xfb63('0x33')](_0x2637c9[_0xfb63('0x2f')][_0xfb63('0x33')]));_0x18aac4[_0xfb63('0x32')]=_0x18aac4[_0xfb63('0x32')]['length']?_0x18aac4[_0xfb63('0x32')]:_0x17c766[_0xfb63('0x2e')];_0x18aac4[_0xfb63('0x36')]=qs[_0xfb63('0x49')](_0x2637c9['query'][_0xfb63('0x49')]);_0x18aac4[_0xfb63('0x37')]=qs[_0xfb63('0x38')](_['pick'](_0x2637c9[_0xfb63('0x2f')],_0x17c766[_0xfb63('0x38')]));if(_0x2637c9['query'][_0xfb63('0x3a')]){_0x18aac4[_0xfb63('0x37')]=_[_0xfb63('0x3b')](_0x18aac4[_0xfb63('0x37')],{'$or':_['map'](_0x18aac4[_0xfb63('0x32')],function(_0x29b7fb){var _0x371eda={};_0x371eda[_0x29b7fb]={'$like':'%'+_0x2637c9[_0xfb63('0x2f')][_0xfb63('0x3a')]+'%'};return _0x371eda;})});}_0x18aac4=_['merge']({},_0x18aac4,_0x2637c9[_0xfb63('0x3d')]);return _0x274cf2[_0xfb63('0x4d')](_0x18aac4);}})[_0xfb63('0x22')](function(_0x313a2f){if(_0x313a2f){_0x492bfa=_0x313a2f[_0xfb63('0x34')];if(!_0x2637c9[_0xfb63('0x2f')][_0xfb63('0x35')]('nolimit')){_0x18aac4['limit']=qs['limit'](_0x2637c9[_0xfb63('0x2f')][_0xfb63('0x1c')]);_0x18aac4[_0xfb63('0x1a')]=qs[_0xfb63('0x1a')](_0x2637c9[_0xfb63('0x2f')][_0xfb63('0x1a')]);}return _0x274cf2[_0xfb63('0x4d')](_0x18aac4);}})['then'](function(_0x35d033){if(_0x35d033){return _0x35d033?{'count':_0x492bfa,'rows':_0x35d033}:null;}})[_0xfb63('0x22')](respondWithResult(_0x113d26,null))[_0xfb63('0x44')](handleError(_0x113d26,null));}; \ No newline at end of file +var _0x279c=['ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','update','destroy','then','end','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','VtigerConfiguration','includeAll','include','findAll','catch','show','params','find','create','body','findOne','getFields','getSubjects','VtigerField','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x16ac3a,_0x5d4714){var _0xc0fb60=function(_0x22022e){while(--_0x22022e){_0x16ac3a['push'](_0x16ac3a['shift']());}};_0xc0fb60(++_0x5d4714);}(_0x279c,0x193));var _0xc279=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x279c[_0x487b0c];return _0x1adbdc;};'use strict';var emlformat=require(_0xc279('0x0'));var rimraf=require(_0xc279('0x1'));var zipdir=require(_0xc279('0x2'));var jsonpatch=require(_0xc279('0x3'));var rp=require(_0xc279('0x4'));var moment=require(_0xc279('0x5'));var BPromise=require(_0xc279('0x6'));var Mustache=require(_0xc279('0x7'));var util=require(_0xc279('0x8'));var path=require(_0xc279('0x9'));var sox=require(_0xc279('0xa'));var csv=require(_0xc279('0xb'));var ejs=require(_0xc279('0xc'));var fs=require('fs');var fs_extra=require(_0xc279('0xd'));var _=require('lodash');var squel=require(_0xc279('0xe'));var crypto=require(_0xc279('0xf'));var jsforce=require(_0xc279('0x10'));var deskjs=require(_0xc279('0x11'));var toCsv=require(_0xc279('0xb'));var querystring=require(_0xc279('0x12'));var Papa=require(_0xc279('0x13'));var Redis=require('ioredis');var authService=require(_0xc279('0x14'));var qs=require(_0xc279('0x15'));var as=require(_0xc279('0x16'));var hardwareService=require(_0xc279('0x17'));var logger=require('../../config/logger')(_0xc279('0x18'));var utils=require(_0xc279('0x19'));var config=require(_0xc279('0x1a'));var licenseUtil=require(_0xc279('0x1b'));var db=require(_0xc279('0x1c'))['db'];function respondWithStatusCode(_0x5086e1,_0xc949f0){_0xc949f0=_0xc949f0||0xcc;return function(_0x299945){if(_0x299945){return _0x5086e1[_0xc279('0x1d')](_0xc949f0);}return _0x5086e1[_0xc279('0x1e')](_0xc949f0)['end']();};}function respondWithResult(_0x53c399,_0x33aafe){_0x33aafe=_0x33aafe||0xc8;return function(_0x57c8f3){if(_0x57c8f3){return _0x53c399[_0xc279('0x1e')](_0x33aafe)[_0xc279('0x1f')](_0x57c8f3);}};}function respondWithFilteredResult(_0x242d55,_0x156df0){return function(_0x267410){if(_0x267410){var _0x1819ca=typeof _0x156df0[_0xc279('0x20')]===_0xc279('0x21')&&typeof _0x156df0[_0xc279('0x22')]==='undefined';var _0xc757b9=_0x267410['count'];var _0x1fa834=_0x1819ca?0x0:_0x156df0[_0xc279('0x20')];var _0x3d392f=_0x1819ca?_0x267410[_0xc279('0x23')]:_0x156df0[_0xc279('0x20')]+_0x156df0[_0xc279('0x22')];var _0x320fba;if(_0x3d392f>=_0xc757b9){_0x3d392f=_0xc757b9;_0x320fba=0xc8;}else{_0x320fba=0xce;}_0x242d55[_0xc279('0x1e')](_0x320fba);return _0x242d55['set'](_0xc279('0x24'),_0x1fa834+'-'+_0x3d392f+'/'+_0xc757b9)[_0xc279('0x1f')](_0x267410);}return null;};}function patchUpdates(_0x24a647){return function(_0x22e845){try{jsonpatch['apply'](_0x22e845,_0x24a647,!![]);}catch(_0x3c19cc){return BPromise[_0xc279('0x25')](_0x3c19cc);}return _0x22e845['save']();};}function saveUpdates(_0x432a8a,_0x3499a0){return function(_0x1ad9a6){if(_0x1ad9a6){return _0x1ad9a6[_0xc279('0x26')](_0x432a8a)['then'](function(_0x5b5640){return _0x5b5640;});}return null;};}function removeEntity(_0x1334b8,_0x5512be){return function(_0x1bb0f0){if(_0x1bb0f0){return _0x1bb0f0[_0xc279('0x27')]()[_0xc279('0x28')](function(){_0x1334b8[_0xc279('0x1e')](0xcc)[_0xc279('0x29')]();});}};}function handleEntityNotFound(_0x3360cc,_0x38ad0a){return function(_0x27ff0e){if(!_0x27ff0e){_0x3360cc[_0xc279('0x1d')](0x194);}return _0x27ff0e;};}function handleError(_0xf45d84,_0x122449){_0x122449=_0x122449||0x1f4;return function(_0x17a36e){logger[_0xc279('0x2a')](_0x17a36e[_0xc279('0x2b')]);if(_0x17a36e['name']){delete _0x17a36e[_0xc279('0x2c')];}_0xf45d84[_0xc279('0x1e')](_0x122449)[_0xc279('0x2d')](_0x17a36e);};}exports[_0xc279('0x2e')]=function(_0x1dd48b,_0xf05400){var _0x1d7920={},_0x11b186={},_0x474038={'count':0x0,'rows':[]};var _0x34a47a=_[_0xc279('0x2f')](db['VtigerConfiguration'][_0xc279('0x30')],function(_0x2913e0){return{'name':_0x2913e0['fieldName'],'type':_0x2913e0[_0xc279('0x31')]['key']};});_0x11b186[_0xc279('0x32')]=_[_0xc279('0x2f')](_0x34a47a,_0xc279('0x2c'));_0x11b186[_0xc279('0x33')]=_[_0xc279('0x34')](_0x1dd48b[_0xc279('0x33')]);_0x11b186['filters']=_['intersection'](_0x11b186[_0xc279('0x32')],_0x11b186[_0xc279('0x33')]);_0x1d7920[_0xc279('0x35')]=_[_0xc279('0x36')](_0x11b186[_0xc279('0x32')],qs[_0xc279('0x37')](_0x1dd48b[_0xc279('0x33')][_0xc279('0x37')]));_0x1d7920[_0xc279('0x35')]=_0x1d7920['attributes'][_0xc279('0x38')]?_0x1d7920[_0xc279('0x35')]:_0x11b186[_0xc279('0x32')];if(!_0x1dd48b['query'][_0xc279('0x39')](_0xc279('0x3a'))){_0x1d7920[_0xc279('0x22')]=qs['limit'](_0x1dd48b[_0xc279('0x33')][_0xc279('0x22')]);_0x1d7920[_0xc279('0x20')]=qs['offset'](_0x1dd48b[_0xc279('0x33')][_0xc279('0x20')]);}_0x1d7920['order']=qs[_0xc279('0x3b')](_0x1dd48b['query']['sort']);_0x1d7920[_0xc279('0x3c')]=qs['filters'](_[_0xc279('0x3d')](_0x1dd48b[_0xc279('0x33')],_0x11b186[_0xc279('0x3e')]),_0x34a47a);if(_0x1dd48b[_0xc279('0x33')][_0xc279('0x3f')]){_0x1d7920[_0xc279('0x3c')]=_[_0xc279('0x40')](_0x1d7920[_0xc279('0x3c')],{'$or':_['map'](_0x34a47a,function(_0x249fbd){if(_0x249fbd['type']!==_0xc279('0x41')){var _0x4c4d13={};_0x4c4d13[_0x249fbd['name']]={'$like':'%'+_0x1dd48b[_0xc279('0x33')][_0xc279('0x3f')]+'%'};return _0x4c4d13;}})});}_0x1d7920=_[_0xc279('0x40')]({},_0x1d7920,_0x1dd48b[_0xc279('0x42')]);var _0x481cc5={'where':_0x1d7920[_0xc279('0x3c')]};return db[_0xc279('0x43')][_0xc279('0x23')](_0x481cc5)['then'](function(_0x3cf173){_0x474038[_0xc279('0x23')]=_0x3cf173;if(_0x1dd48b[_0xc279('0x33')][_0xc279('0x44')]){_0x1d7920[_0xc279('0x45')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xc279('0x46')](_0x1d7920);})[_0xc279('0x28')](function(_0x171a59){_0x474038['rows']=_0x171a59;return _0x474038;})['then'](respondWithFilteredResult(_0xf05400,_0x1d7920))[_0xc279('0x47')](handleError(_0xf05400,null));};exports[_0xc279('0x48')]=function(_0x3021e4,_0x3381fe){var _0x24cf9c={'raw':![],'where':{'id':_0x3021e4[_0xc279('0x49')]['id']}},_0x56b6c4={};_0x56b6c4[_0xc279('0x32')]=_[_0xc279('0x34')](db['VtigerConfiguration'][_0xc279('0x30')]);_0x56b6c4[_0xc279('0x33')]=_[_0xc279('0x34')](_0x3021e4[_0xc279('0x33')]);_0x56b6c4['filters']=_[_0xc279('0x36')](_0x56b6c4[_0xc279('0x32')],_0x56b6c4[_0xc279('0x33')]);_0x24cf9c['attributes']=_[_0xc279('0x36')](_0x56b6c4['model'],qs[_0xc279('0x37')](_0x3021e4['query'][_0xc279('0x37')]));_0x24cf9c[_0xc279('0x35')]=_0x24cf9c[_0xc279('0x35')][_0xc279('0x38')]?_0x24cf9c[_0xc279('0x35')]:_0x56b6c4[_0xc279('0x32')];if(_0x3021e4[_0xc279('0x33')]['includeAll']){_0x24cf9c[_0xc279('0x45')]=[{'all':!![]}];}_0x24cf9c=_[_0xc279('0x40')]({},_0x24cf9c,_0x3021e4[_0xc279('0x42')]);return db[_0xc279('0x43')][_0xc279('0x4a')](_0x24cf9c)[_0xc279('0x28')](handleEntityNotFound(_0x3381fe,null))[_0xc279('0x28')](respondWithResult(_0x3381fe,null))['catch'](handleError(_0x3381fe,null));};exports[_0xc279('0x4b')]=function(_0x3331a0,_0x11c714){return db[_0xc279('0x43')][_0xc279('0x4b')](_0x3331a0[_0xc279('0x4c')],{})[_0xc279('0x28')](respondWithResult(_0x11c714,0xc9))[_0xc279('0x47')](handleError(_0x11c714,null));};exports[_0xc279('0x26')]=function(_0x221766,_0x20d23e){if(_0x221766[_0xc279('0x4c')]['id']){delete _0x221766[_0xc279('0x4c')]['id'];}return db['VtigerConfiguration'][_0xc279('0x4a')]({'where':{'id':_0x221766['params']['id']}})[_0xc279('0x28')](handleEntityNotFound(_0x20d23e,null))['then'](saveUpdates(_0x221766[_0xc279('0x4c')],null))[_0xc279('0x28')](respondWithResult(_0x20d23e,null))[_0xc279('0x47')](handleError(_0x20d23e,null));};exports[_0xc279('0x27')]=function(_0x1340b6,_0x110f49){return db[_0xc279('0x43')][_0xc279('0x4a')]({'where':{'id':_0x1340b6[_0xc279('0x49')]['id']}})[_0xc279('0x28')](handleEntityNotFound(_0x110f49,null))[_0xc279('0x28')](removeEntity(_0x110f49,null))[_0xc279('0x47')](handleError(_0x110f49,null));};exports['getFields']=function(_0x4fbaaa,_0x432aec,_0x2a4227){var _0x9744c={};var _0x13dd7f={};var _0x3d3790;var _0xe80e91;return db[_0xc279('0x43')][_0xc279('0x4d')]({'where':{'id':_0x4fbaaa['params']['id']}})[_0xc279('0x28')](handleEntityNotFound(_0x432aec,null))[_0xc279('0x28')](function(_0x37185b){if(_0x37185b){_0x3d3790=_0x37185b;_0x13dd7f[_0xc279('0x32')]=_[_0xc279('0x34')](db['VtigerField'][_0xc279('0x30')]);_0x13dd7f['query']=_['keys'](_0x4fbaaa['query']);_0x13dd7f[_0xc279('0x3e')]=_[_0xc279('0x36')](_0x13dd7f['model'],_0x13dd7f[_0xc279('0x33')]);_0x9744c[_0xc279('0x35')]=_['intersection'](_0x13dd7f[_0xc279('0x32')],qs[_0xc279('0x37')](_0x4fbaaa[_0xc279('0x33')][_0xc279('0x37')]));_0x9744c[_0xc279('0x35')]=_0x9744c['attributes'][_0xc279('0x38')]?_0x9744c[_0xc279('0x35')]:_0x13dd7f[_0xc279('0x32')];_0x9744c['order']=qs[_0xc279('0x3b')](_0x4fbaaa[_0xc279('0x33')][_0xc279('0x3b')]);_0x9744c[_0xc279('0x3c')]=qs[_0xc279('0x3e')](_[_0xc279('0x3d')](_0x4fbaaa['query'],_0x13dd7f[_0xc279('0x3e')]));if(_0x4fbaaa[_0xc279('0x33')][_0xc279('0x3f')]){_0x9744c['where']=_[_0xc279('0x40')](_0x9744c[_0xc279('0x3c')],{'$or':_['map'](_0x9744c[_0xc279('0x35')],function(_0x47191e){var _0x56d156={};_0x56d156[_0x47191e]={'$like':'%'+_0x4fbaaa['query'][_0xc279('0x3f')]+'%'};return _0x56d156;})});}_0x9744c=_[_0xc279('0x40')]({},_0x9744c,_0x4fbaaa[_0xc279('0x42')]);return _0x3d3790[_0xc279('0x4e')](_0x9744c);}})['then'](function(_0x1a09b1){if(_0x1a09b1){_0xe80e91=_0x1a09b1[_0xc279('0x38')];if(!_0x4fbaaa[_0xc279('0x33')][_0xc279('0x39')]('nolimit')){_0x9744c['limit']=qs[_0xc279('0x22')](_0x4fbaaa[_0xc279('0x33')]['limit']);_0x9744c[_0xc279('0x20')]=qs['offset'](_0x4fbaaa[_0xc279('0x33')][_0xc279('0x20')]);}return _0x3d3790[_0xc279('0x4e')](_0x9744c);}})['then'](function(_0x4c09a2){if(_0x4c09a2){return _0x4c09a2?{'count':_0xe80e91,'rows':_0x4c09a2}:null;}})['then'](respondWithResult(_0x432aec,null))[_0xc279('0x47')](handleError(_0x432aec,null));};exports[_0xc279('0x4f')]=function(_0x53051a,_0x18663b,_0x1f3db2){var _0x36796b={};var _0xc9203c={};var _0x349df3;var _0x3d27f0;return db[_0xc279('0x43')]['findOne']({'where':{'id':_0x53051a[_0xc279('0x49')]['id']}})['then'](handleEntityNotFound(_0x18663b,null))[_0xc279('0x28')](function(_0x60d630){if(_0x60d630){_0x349df3=_0x60d630;_0xc9203c[_0xc279('0x32')]=_[_0xc279('0x34')](db[_0xc279('0x50')][_0xc279('0x30')]);_0xc9203c['query']=_[_0xc279('0x34')](_0x53051a[_0xc279('0x33')]);_0xc9203c['filters']=_['intersection'](_0xc9203c['model'],_0xc9203c['query']);_0x36796b['attributes']=_[_0xc279('0x36')](_0xc9203c['model'],qs[_0xc279('0x37')](_0x53051a[_0xc279('0x33')][_0xc279('0x37')]));_0x36796b[_0xc279('0x35')]=_0x36796b[_0xc279('0x35')][_0xc279('0x38')]?_0x36796b['attributes']:_0xc9203c[_0xc279('0x32')];_0x36796b[_0xc279('0x51')]=qs[_0xc279('0x3b')](_0x53051a['query']['sort']);_0x36796b[_0xc279('0x3c')]=qs[_0xc279('0x3e')](_['pick'](_0x53051a[_0xc279('0x33')],_0xc9203c[_0xc279('0x3e')]));if(_0x53051a[_0xc279('0x33')]['filter']){_0x36796b[_0xc279('0x3c')]=_[_0xc279('0x40')](_0x36796b[_0xc279('0x3c')],{'$or':_[_0xc279('0x2f')](_0x36796b[_0xc279('0x35')],function(_0x437eed){var _0x393b39={};_0x393b39[_0x437eed]={'$like':'%'+_0x53051a[_0xc279('0x33')][_0xc279('0x3f')]+'%'};return _0x393b39;})});}_0x36796b=_['merge']({},_0x36796b,_0x53051a[_0xc279('0x42')]);return _0x349df3[_0xc279('0x4f')](_0x36796b);}})[_0xc279('0x28')](function(_0x2dce57){if(_0x2dce57){_0x3d27f0=_0x2dce57[_0xc279('0x38')];if(!_0x53051a['query']['hasOwnProperty'](_0xc279('0x3a'))){_0x36796b[_0xc279('0x22')]=qs['limit'](_0x53051a[_0xc279('0x33')][_0xc279('0x22')]);_0x36796b[_0xc279('0x20')]=qs[_0xc279('0x20')](_0x53051a['query'][_0xc279('0x20')]);}return _0x349df3[_0xc279('0x4f')](_0x36796b);}})[_0xc279('0x28')](function(_0x638e21){if(_0x638e21){return _0x638e21?{'count':_0x3d27f0,'rows':_0x638e21}:null;}})[_0xc279('0x28')](respondWithResult(_0x18663b,null))[_0xc279('0x47')](handleError(_0x18663b,null));};exports['getDescriptions']=function(_0xadb600,_0x3685fa,_0x5439da){var _0x2037fb={};var _0x49f836={};var _0x5b9040;var _0x4898a1;return db[_0xc279('0x43')][_0xc279('0x4d')]({'where':{'id':_0xadb600[_0xc279('0x49')]['id']}})['then'](handleEntityNotFound(_0x3685fa,null))[_0xc279('0x28')](function(_0x20d3dc){if(_0x20d3dc){_0x5b9040=_0x20d3dc;_0x49f836[_0xc279('0x32')]=_[_0xc279('0x34')](db[_0xc279('0x50')][_0xc279('0x30')]);_0x49f836[_0xc279('0x33')]=_[_0xc279('0x34')](_0xadb600[_0xc279('0x33')]);_0x49f836['filters']=_[_0xc279('0x36')](_0x49f836[_0xc279('0x32')],_0x49f836['query']);_0x2037fb[_0xc279('0x35')]=_[_0xc279('0x36')](_0x49f836[_0xc279('0x32')],qs[_0xc279('0x37')](_0xadb600['query'][_0xc279('0x37')]));_0x2037fb[_0xc279('0x35')]=_0x2037fb[_0xc279('0x35')][_0xc279('0x38')]?_0x2037fb['attributes']:_0x49f836[_0xc279('0x32')];_0x2037fb[_0xc279('0x51')]=qs[_0xc279('0x3b')](_0xadb600[_0xc279('0x33')]['sort']);_0x2037fb['where']=qs[_0xc279('0x3e')](_[_0xc279('0x3d')](_0xadb600[_0xc279('0x33')],_0x49f836['filters']));if(_0xadb600['query'][_0xc279('0x3f')]){_0x2037fb['where']=_[_0xc279('0x40')](_0x2037fb['where'],{'$or':_[_0xc279('0x2f')](_0x2037fb[_0xc279('0x35')],function(_0x53cd5b){var _0x518f30={};_0x518f30[_0x53cd5b]={'$like':'%'+_0xadb600[_0xc279('0x33')][_0xc279('0x3f')]+'%'};return _0x518f30;})});}_0x2037fb=_[_0xc279('0x40')]({},_0x2037fb,_0xadb600[_0xc279('0x42')]);return _0x5b9040[_0xc279('0x52')](_0x2037fb);}})[_0xc279('0x28')](function(_0x14823e){if(_0x14823e){_0x4898a1=_0x14823e['length'];if(!_0xadb600[_0xc279('0x33')]['hasOwnProperty'](_0xc279('0x3a'))){_0x2037fb['limit']=qs[_0xc279('0x22')](_0xadb600[_0xc279('0x33')][_0xc279('0x22')]);_0x2037fb[_0xc279('0x20')]=qs[_0xc279('0x20')](_0xadb600[_0xc279('0x33')]['offset']);}return _0x5b9040[_0xc279('0x52')](_0x2037fb);}})[_0xc279('0x28')](function(_0x7de8fe){if(_0x7de8fe){return _0x7de8fe?{'count':_0x4898a1,'rows':_0x7de8fe}:null;}})[_0xc279('0x28')](respondWithResult(_0x3685fa,null))[_0xc279('0x47')](handleError(_0x3685fa,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index e75c444..148a175 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 _0x6d7a=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x12b2fb,_0x192fcc){var _0x5cca5f=function(_0x455b1a){while(--_0x455b1a){_0x12b2fb['push'](_0x12b2fb['shift']());}};_0x5cca5f(++_0x192fcc);}(_0x6d7a,0x1e0));var _0xa6d7=function(_0x107d8a,_0x2dc961){_0x107d8a=_0x107d8a-0x0;var _0x330bf0=_0x6d7a[_0x107d8a];return _0x330bf0;};'use strict';var _=require(_0xa6d7('0x0'));var util=require(_0xa6d7('0x1'));var logger=require(_0xa6d7('0x2'))(_0xa6d7('0x3'));var moment=require('moment');var BPromise=require(_0xa6d7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6d7('0x5'));var rimraf=require(_0xa6d7('0x6'));var config=require(_0xa6d7('0x7'));var attributes=require(_0xa6d7('0x8'));module['exports']=function(_0x524265,_0x37fbea){return _0x524265[_0xa6d7('0x9')](_0xa6d7('0xa'),attributes,{'tableName':_0xa6d7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd958=['bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xd958,0x12a));var _0x8d95=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xd958[_0x11005e];return _0x29338f;};'use strict';var _=require(_0x8d95('0x0'));var util=require(_0x8d95('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8d95('0x2'));var rp=require(_0x8d95('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d95('0x4'));var config=require(_0x8d95('0x5'));var attributes=require(_0x8d95('0x6'));module[_0x8d95('0x7')]=function(_0x4be963,_0x5baf0a){return _0x4be963[_0x8d95('0x8')](_0x8d95('0x9'),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 367826e..8bc9b1f 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 _0xd49f=['then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xd49f,0xcc));var _0xfd49=function(_0x2d8f6c,_0x44db4c){_0x2d8f6c=_0x2d8f6c-0x0;var _0x3a00f6=_0xd49f[_0x2d8f6c];return _0x3a00f6;};'use strict';var _=require(_0xfd49('0x0'));var util=require(_0xfd49('0x1'));var moment=require(_0xfd49('0x2'));var BPromise=require(_0xfd49('0x3'));var rs=require(_0xfd49('0x4'));var fs=require('fs');var Redis=require(_0xfd49('0x5'));var db=require(_0xfd49('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd49('0x7'))(_0xfd49('0x8'));var config=require(_0xfd49('0x9'));var jayson=require(_0xfd49('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14dbdd,_0x36f54b,_0x5771e7){return new BPromise(function(_0x4cbea1,_0x3581d5){return client[_0xfd49('0xb')](_0x14dbdd,_0x5771e7)[_0xfd49('0xc')](function(_0x59354b){logger[_0xfd49('0xd')](_0xfd49('0xe'),_0x36f54b,'request\x20sent');logger[_0xfd49('0xf')](_0xfd49('0x10'),_0x36f54b,_0xfd49('0x11'),JSON[_0xfd49('0x12')](_0x59354b));if(_0x59354b['error']){if(_0x59354b[_0xfd49('0x13')][_0xfd49('0x14')]===0x1f4){logger[_0xfd49('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x36f54b,_0x59354b[_0xfd49('0x13')]['message']);return _0x3581d5(_0x59354b[_0xfd49('0x13')]['message']);}logger[_0xfd49('0x13')](_0xfd49('0xe'),_0x36f54b,_0x59354b[_0xfd49('0x13')][_0xfd49('0x15')]);return _0x4cbea1(_0x59354b[_0xfd49('0x13')][_0xfd49('0x15')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x36f54b,_0xfd49('0x11'));_0x4cbea1(_0x59354b[_0xfd49('0x16')][_0xfd49('0x15')]);}})[_0xfd49('0x17')](function(_0x3f7908){logger[_0xfd49('0x13')](_0xfd49('0xe'),_0x36f54b,_0x3f7908);_0x3581d5(_0x3f7908);});});} \ No newline at end of file +var _0x59c2=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/environment','client','http','request','then','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','VtigerConfiguration,\x20%s,\x20%s'];(function(_0x3490ca,_0x24c3c7){var _0x54b63a=function(_0x2b8988){while(--_0x2b8988){_0x3490ca['push'](_0x3490ca['shift']());}};_0x54b63a(++_0x24c3c7);}(_0x59c2,0x1c9));var _0x259c=function(_0x16f77c,_0x5256b1){_0x16f77c=_0x16f77c-0x0;var _0x78986e=_0x59c2[_0x16f77c];return _0x78986e;};'use strict';var _=require(_0x259c('0x0'));var util=require('util');var moment=require(_0x259c('0x1'));var BPromise=require(_0x259c('0x2'));var rs=require(_0x259c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x259c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x259c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x259c('0x6')][_0x259c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x51d156,_0x14ecc3,_0x489f1d){return new BPromise(function(_0x220fbe,_0x331215){return client[_0x259c('0x8')](_0x51d156,_0x489f1d)[_0x259c('0x9')](function(_0xfbf2f9){logger[_0x259c('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x14ecc3,'request\x20sent');logger[_0x259c('0xb')](_0x259c('0xc'),_0x14ecc3,_0x259c('0xd'),JSON['stringify'](_0xfbf2f9));if(_0xfbf2f9[_0x259c('0xe')]){if(_0xfbf2f9[_0x259c('0xe')][_0x259c('0xf')]===0x1f4){logger[_0x259c('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x14ecc3,_0xfbf2f9[_0x259c('0xe')][_0x259c('0x10')]);return _0x331215(_0xfbf2f9[_0x259c('0xe')][_0x259c('0x10')]);}logger[_0x259c('0xe')](_0x259c('0x11'),_0x14ecc3,_0xfbf2f9[_0x259c('0xe')]['message']);return _0x220fbe(_0xfbf2f9[_0x259c('0xe')][_0x259c('0x10')]);}else{logger[_0x259c('0xa')](_0x259c('0x11'),_0x14ecc3,'request\x20sent');_0x220fbe(_0xfbf2f9['result'][_0x259c('0x10')]);}})[_0x259c('0x12')](function(_0x4d3017){logger['error'](_0x259c('0x11'),_0x14ecc3,_0x4d3017);_0x331215(_0x4d3017);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 63f3704..2324888 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 _0x0d35=['post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intVtigerField.controller','isAuthenticated','index','get','/:id'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0d35,0xfd));var _0x50d3=function(_0x21b1d1,_0x3a8680){_0x21b1d1=_0x21b1d1-0x0;var _0x3e6228=_0x0d35[_0x21b1d1];return _0x3e6228;};'use strict';var multer=require(_0x50d3('0x0'));var util=require(_0x50d3('0x1'));var path=require(_0x50d3('0x2'));var timeout=require(_0x50d3('0x3'));var express=require(_0x50d3('0x4'));var router=express[_0x50d3('0x5')]();var fs_extra=require(_0x50d3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x50d3('0x7'));var config=require('../../config/environment');var controller=require(_0x50d3('0x8'));router['get']('/',auth[_0x50d3('0x9')](),controller[_0x50d3('0xa')]);router[_0x50d3('0xb')](_0x50d3('0xc'),auth[_0x50d3('0x9')](),controller['show']);router[_0x50d3('0xd')]('/',auth[_0x50d3('0x9')](),controller[_0x50d3('0xe')]);router[_0x50d3('0xf')](_0x50d3('0xc'),auth[_0x50d3('0x9')](),controller[_0x50d3('0x10')]);router[_0x50d3('0x11')](_0x50d3('0xc'),auth[_0x50d3('0x9')](),controller[_0x50d3('0x12')]);module['exports']=router; \ No newline at end of file +var _0x1319=['isAuthenticated','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get'];(function(_0x4a99d2,_0x535ec6){var _0xf38164=function(_0x28834b){while(--_0x28834b){_0x4a99d2['push'](_0x4a99d2['shift']());}};_0xf38164(++_0x535ec6);}(_0x1319,0x86));var _0x9131=function(_0xc3b08e,_0x427235){_0xc3b08e=_0xc3b08e-0x0;var _0x4c5e08=_0x1319[_0xc3b08e];return _0x4c5e08;};'use strict';var multer=require(_0x9131('0x0'));var util=require(_0x9131('0x1'));var path=require(_0x9131('0x2'));var timeout=require(_0x9131('0x3'));var express=require(_0x9131('0x4'));var router=express['Router']();var fs_extra=require(_0x9131('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9131('0x6'));var config=require(_0x9131('0x7'));var controller=require(_0x9131('0x8'));router[_0x9131('0x9')]('/',auth[_0x9131('0xa')](),controller['index']);router[_0x9131('0x9')](_0x9131('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9131('0xc')]('/',auth[_0x9131('0xa')](),controller[_0x9131('0xd')]);router[_0x9131('0xe')](_0x9131('0xb'),auth[_0x9131('0xa')](),controller[_0x9131('0xf')]);router[_0x9131('0x10')](_0x9131('0xb'),auth[_0x9131('0xa')](),controller['destroy']);module[_0x9131('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 034b8f2..dedca40 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 _0xef93=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x48cc17,_0x5fcd9b){var _0x1dbada=function(_0x44c33b){while(--_0x44c33b){_0x48cc17['push'](_0x48cc17['shift']());}};_0x1dbada(++_0x5fcd9b);}(_0xef93,0x78));var _0x3ef9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xef93[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3ef9('0x0'));module[_0x3ef9('0x1')]={'type':{'type':Sequelize[_0x3ef9('0x2')](_0x3ef9('0x3'),_0x3ef9('0x4'),_0x3ef9('0x5'),_0x3ef9('0x6'),_0x3ef9('0x7')),'defaultValue':_0x3ef9('0x3')},'content':{'type':Sequelize[_0x3ef9('0x8')]},'key':{'type':Sequelize[_0x3ef9('0x8')]},'keyType':{'type':Sequelize[_0x3ef9('0x2')]('string',_0x3ef9('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x3ef9('0x8')]},'idField':{'type':Sequelize[_0x3ef9('0x8')]},'nameField':{'type':Sequelize[_0x3ef9('0x8')]},'customField':{'type':Sequelize[_0x3ef9('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3ef9('0x8')]}}; \ No newline at end of file +var _0x7ed7=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x44f42e,_0x4207cd){var _0x1486e0=function(_0x1c912a){while(--_0x1c912a){_0x44f42e['push'](_0x44f42e['shift']());}};_0x1486e0(++_0x4207cd);}(_0x7ed7,0x144));var _0x77ed=function(_0x216f98,_0x470c7f){_0x216f98=_0x216f98-0x0;var _0xea6b36=_0x7ed7[_0x216f98];return _0xea6b36;};'use strict';var Sequelize=require(_0x77ed('0x0'));module[_0x77ed('0x1')]={'type':{'type':Sequelize[_0x77ed('0x2')](_0x77ed('0x3'),_0x77ed('0x4'),'customVariable',_0x77ed('0x5'),_0x77ed('0x6')),'defaultValue':_0x77ed('0x3')},'content':{'type':Sequelize[_0x77ed('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x77ed('0x2')](_0x77ed('0x3'),_0x77ed('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x77ed('0x7')]},'idField':{'type':Sequelize[_0x77ed('0x7')]},'nameField':{'type':Sequelize[_0x77ed('0x7')]},'customField':{'type':Sequelize[_0x77ed('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x77ed('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 2cf895f..3bc4885 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 _0x2e33=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','name','send','map','VtigerField','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','filter','includeAll','findAll','rows','catch','show','params','rawAttributes','create','body','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x27d2bf,_0x27ec74){var _0x5498a=function(_0x128d58){while(--_0x128d58){_0x27d2bf['push'](_0x27d2bf['shift']());}};_0x5498a(++_0x27ec74);}(_0x2e33,0x75));var _0x32e3=function(_0x561c70,_0x6fdf5a){_0x561c70=_0x561c70-0x0;var _0x63fa05=_0x2e33[_0x561c70];return _0x63fa05;};'use strict';var emlformat=require(_0x32e3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32e3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32e3('0x2'));var moment=require(_0x32e3('0x3'));var BPromise=require(_0x32e3('0x4'));var Mustache=require(_0x32e3('0x5'));var util=require(_0x32e3('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x32e3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x32e3('0x8'));var crypto=require('crypto');var jsforce=require(_0x32e3('0x9'));var deskjs=require(_0x32e3('0xa'));var toCsv=require(_0x32e3('0x7'));var querystring=require(_0x32e3('0xb'));var Papa=require(_0x32e3('0xc'));var Redis=require(_0x32e3('0xd'));var authService=require(_0x32e3('0xe'));var qs=require(_0x32e3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32e3('0x10'));var logger=require(_0x32e3('0x11'))(_0x32e3('0x12'));var utils=require(_0x32e3('0x13'));var config=require(_0x32e3('0x14'));var licenseUtil=require(_0x32e3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ee030,_0x45f2d4){_0x45f2d4=_0x45f2d4||0xcc;return function(_0xdd4c50){if(_0xdd4c50){return _0x5ee030[_0x32e3('0x16')](_0x45f2d4);}return _0x5ee030['status'](_0x45f2d4)['end']();};}function respondWithResult(_0x522dd7,_0xd4465d){_0xd4465d=_0xd4465d||0xc8;return function(_0x31dfa1){if(_0x31dfa1){return _0x522dd7[_0x32e3('0x17')](_0xd4465d)[_0x32e3('0x18')](_0x31dfa1);}};}function respondWithFilteredResult(_0x4f4271,_0x4dd24f){return function(_0x10e38f){if(_0x10e38f){var _0x4b6831=typeof _0x4dd24f[_0x32e3('0x19')]===_0x32e3('0x1a')&&typeof _0x4dd24f[_0x32e3('0x1b')]===_0x32e3('0x1a');var _0x5e731e=_0x10e38f[_0x32e3('0x1c')];var _0x26db41=_0x4b6831?0x0:_0x4dd24f['offset'];var _0x430ef7=_0x4b6831?_0x10e38f[_0x32e3('0x1c')]:_0x4dd24f[_0x32e3('0x19')]+_0x4dd24f[_0x32e3('0x1b')];var _0xa55c03;if(_0x430ef7>=_0x5e731e){_0x430ef7=_0x5e731e;_0xa55c03=0xc8;}else{_0xa55c03=0xce;}_0x4f4271[_0x32e3('0x17')](_0xa55c03);return _0x4f4271['set'](_0x32e3('0x1d'),_0x26db41+'-'+_0x430ef7+'/'+_0x5e731e)[_0x32e3('0x18')](_0x10e38f);}return null;};}function patchUpdates(_0x5f5b58){return function(_0x1672a2){try{jsonpatch[_0x32e3('0x1e')](_0x1672a2,_0x5f5b58,!![]);}catch(_0xf68a7f){return BPromise['reject'](_0xf68a7f);}return _0x1672a2[_0x32e3('0x1f')]();};}function saveUpdates(_0x16859e,_0x240323){return function(_0x383fa8){if(_0x383fa8){return _0x383fa8[_0x32e3('0x20')](_0x16859e)[_0x32e3('0x21')](function(_0xd929a7){return _0xd929a7;});}return null;};}function removeEntity(_0x4caa64,_0x340551){return function(_0x536888){if(_0x536888){return _0x536888['destroy']()['then'](function(){_0x4caa64['status'](0xcc)[_0x32e3('0x22')]();});}};}function handleEntityNotFound(_0x52477f,_0x383e63){return function(_0x352c28){if(!_0x352c28){_0x52477f['sendStatus'](0x194);}return _0x352c28;};}function handleError(_0x4f4810,_0x441a38){_0x441a38=_0x441a38||0x1f4;return function(_0x3213a2){logger[_0x32e3('0x23')](_0x3213a2['stack']);if(_0x3213a2[_0x32e3('0x24')]){delete _0x3213a2['name'];}_0x4f4810['status'](_0x441a38)[_0x32e3('0x25')](_0x3213a2);};}exports['index']=function(_0x5a808d,_0xaf4f44){var _0x4caf80={},_0x146b4b={},_0x26cffe={'count':0x0,'rows':[]};var _0x3d457a=_[_0x32e3('0x26')](db[_0x32e3('0x27')]['rawAttributes'],function(_0x33af21){return{'name':_0x33af21[_0x32e3('0x28')],'type':_0x33af21['type'][_0x32e3('0x29')]};});_0x146b4b[_0x32e3('0x2a')]=_[_0x32e3('0x26')](_0x3d457a,_0x32e3('0x24'));_0x146b4b[_0x32e3('0x2b')]=_[_0x32e3('0x2c')](_0x5a808d[_0x32e3('0x2b')]);_0x146b4b['filters']=_['intersection'](_0x146b4b[_0x32e3('0x2a')],_0x146b4b['query']);_0x4caf80['attributes']=_[_0x32e3('0x2d')](_0x146b4b[_0x32e3('0x2a')],qs[_0x32e3('0x2e')](_0x5a808d[_0x32e3('0x2b')][_0x32e3('0x2e')]));_0x4caf80['attributes']=_0x4caf80[_0x32e3('0x2f')][_0x32e3('0x30')]?_0x4caf80[_0x32e3('0x2f')]:_0x146b4b[_0x32e3('0x2a')];if(!_0x5a808d[_0x32e3('0x2b')][_0x32e3('0x31')](_0x32e3('0x32'))){_0x4caf80[_0x32e3('0x1b')]=qs[_0x32e3('0x1b')](_0x5a808d[_0x32e3('0x2b')][_0x32e3('0x1b')]);_0x4caf80[_0x32e3('0x19')]=qs[_0x32e3('0x19')](_0x5a808d[_0x32e3('0x2b')][_0x32e3('0x19')]);}_0x4caf80['order']=qs[_0x32e3('0x33')](_0x5a808d[_0x32e3('0x2b')][_0x32e3('0x33')]);_0x4caf80['where']=qs[_0x32e3('0x34')](_[_0x32e3('0x35')](_0x5a808d[_0x32e3('0x2b')],_0x146b4b['filters']),_0x3d457a);if(_0x5a808d['query']['filter']){_0x4caf80[_0x32e3('0x36')]=_[_0x32e3('0x37')](_0x4caf80['where'],{'$or':_[_0x32e3('0x26')](_0x3d457a,function(_0x51a68f){if(_0x51a68f['type']!=='VIRTUAL'){var _0x286442={};_0x286442[_0x51a68f[_0x32e3('0x24')]]={'$like':'%'+_0x5a808d[_0x32e3('0x2b')][_0x32e3('0x38')]+'%'};return _0x286442;}})});}_0x4caf80=_['merge']({},_0x4caf80,_0x5a808d['options']);var _0x1419c6={'where':_0x4caf80['where']};return db['VtigerField']['count'](_0x1419c6)[_0x32e3('0x21')](function(_0x27b5ba){_0x26cffe[_0x32e3('0x1c')]=_0x27b5ba;if(_0x5a808d[_0x32e3('0x2b')][_0x32e3('0x39')]){_0x4caf80['include']=[{'all':!![]}];}return db[_0x32e3('0x27')][_0x32e3('0x3a')](_0x4caf80);})[_0x32e3('0x21')](function(_0x45320c){_0x26cffe[_0x32e3('0x3b')]=_0x45320c;return _0x26cffe;})['then'](respondWithFilteredResult(_0xaf4f44,_0x4caf80))[_0x32e3('0x3c')](handleError(_0xaf4f44,null));};exports[_0x32e3('0x3d')]=function(_0x7577b9,_0x39a7d2){var _0x2e6b53={'raw':!![],'where':{'id':_0x7577b9[_0x32e3('0x3e')]['id']}},_0xc77262={};_0xc77262[_0x32e3('0x2a')]=_[_0x32e3('0x2c')](db[_0x32e3('0x27')][_0x32e3('0x3f')]);_0xc77262[_0x32e3('0x2b')]=_[_0x32e3('0x2c')](_0x7577b9[_0x32e3('0x2b')]);_0xc77262[_0x32e3('0x34')]=_[_0x32e3('0x2d')](_0xc77262[_0x32e3('0x2a')],_0xc77262[_0x32e3('0x2b')]);_0x2e6b53[_0x32e3('0x2f')]=_[_0x32e3('0x2d')](_0xc77262[_0x32e3('0x2a')],qs[_0x32e3('0x2e')](_0x7577b9[_0x32e3('0x2b')]['fields']));_0x2e6b53[_0x32e3('0x2f')]=_0x2e6b53['attributes'][_0x32e3('0x30')]?_0x2e6b53[_0x32e3('0x2f')]:_0xc77262[_0x32e3('0x2a')];if(_0x7577b9[_0x32e3('0x2b')][_0x32e3('0x39')]){_0x2e6b53['include']=[{'all':!![]}];}_0x2e6b53=_[_0x32e3('0x37')]({},_0x2e6b53,_0x7577b9['options']);return db[_0x32e3('0x27')]['find'](_0x2e6b53)[_0x32e3('0x21')](handleEntityNotFound(_0x39a7d2,null))[_0x32e3('0x21')](respondWithResult(_0x39a7d2,null))[_0x32e3('0x3c')](handleError(_0x39a7d2,null));};exports['create']=function(_0x53bee6,_0x47114d){return db[_0x32e3('0x27')][_0x32e3('0x40')](_0x53bee6[_0x32e3('0x41')],{})[_0x32e3('0x21')](respondWithResult(_0x47114d,0xc9))[_0x32e3('0x3c')](handleError(_0x47114d,null));};exports[_0x32e3('0x20')]=function(_0x4b5bbb,_0x430468){if(_0x4b5bbb[_0x32e3('0x41')]['id']){delete _0x4b5bbb[_0x32e3('0x41')]['id'];}return db[_0x32e3('0x27')]['find']({'where':{'id':_0x4b5bbb['params']['id']}})[_0x32e3('0x21')](handleEntityNotFound(_0x430468,null))[_0x32e3('0x21')](saveUpdates(_0x4b5bbb[_0x32e3('0x41')],null))[_0x32e3('0x21')](respondWithResult(_0x430468,null))[_0x32e3('0x3c')](handleError(_0x430468,null));};exports[_0x32e3('0x42')]=function(_0x339811,_0x2d11d1){return db[_0x32e3('0x27')]['find']({'where':{'id':_0x339811[_0x32e3('0x3e')]['id']}})[_0x32e3('0x21')](handleEntityNotFound(_0x2d11d1,null))[_0x32e3('0x21')](removeEntity(_0x2d11d1,null))[_0x32e3('0x3c')](handleError(_0x2d11d1,null));}; \ No newline at end of file +var _0x951f=['bluebird','mustache','path','sox','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','limit','undefined','count','set','json','apply','reject','save','update','destroy','then','stack','name','send','index','map','VtigerField','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','params','length','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x4da356,_0x5235e1){var _0x321b07=function(_0x2bc6f4){while(--_0x2bc6f4){_0x4da356['push'](_0x4da356['shift']());}};_0x321b07(++_0x5235e1);}(_0x951f,0x117));var _0xf951=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x951f[_0x4ae6ef];return _0x3cbb4e;};'use strict';var emlformat=require(_0xf951('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf951('0x1'));var jsonpatch=require(_0xf951('0x2'));var rp=require(_0xf951('0x3'));var moment=require(_0xf951('0x4'));var BPromise=require(_0xf951('0x5'));var Mustache=require(_0xf951('0x6'));var util=require('util');var path=require(_0xf951('0x7'));var sox=require(_0xf951('0x8'));var csv=require('to-csv');var ejs=require(_0xf951('0x9'));var fs=require('fs');var fs_extra=require(_0xf951('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf951('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf951('0xc'));var Papa=require(_0xf951('0xd'));var Redis=require(_0xf951('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf951('0xf'));var as=require(_0xf951('0x10'));var hardwareService=require(_0xf951('0x11'));var logger=require(_0xf951('0x12'))(_0xf951('0x13'));var utils=require(_0xf951('0x14'));var config=require(_0xf951('0x15'));var licenseUtil=require(_0xf951('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x218552,_0x1e58bc){_0x1e58bc=_0x1e58bc||0xcc;return function(_0x5e8748){if(_0x5e8748){return _0x218552[_0xf951('0x17')](_0x1e58bc);}return _0x218552['status'](_0x1e58bc)[_0xf951('0x18')]();};}function respondWithResult(_0x141d68,_0x13a0da){_0x13a0da=_0x13a0da||0xc8;return function(_0x5a134b){if(_0x5a134b){return _0x141d68[_0xf951('0x19')](_0x13a0da)['json'](_0x5a134b);}};}function respondWithFilteredResult(_0x1321a7,_0xcf8fc7){return function(_0x504065){if(_0x504065){var _0x36f7bf=typeof _0xcf8fc7[_0xf951('0x1a')]==='undefined'&&typeof _0xcf8fc7[_0xf951('0x1b')]===_0xf951('0x1c');var _0x2a4755=_0x504065[_0xf951('0x1d')];var _0x15e9fb=_0x36f7bf?0x0:_0xcf8fc7['offset'];var _0x4fea2c=_0x36f7bf?_0x504065[_0xf951('0x1d')]:_0xcf8fc7['offset']+_0xcf8fc7[_0xf951('0x1b')];var _0xdc8143;if(_0x4fea2c>=_0x2a4755){_0x4fea2c=_0x2a4755;_0xdc8143=0xc8;}else{_0xdc8143=0xce;}_0x1321a7[_0xf951('0x19')](_0xdc8143);return _0x1321a7[_0xf951('0x1e')]('Content-Range',_0x15e9fb+'-'+_0x4fea2c+'/'+_0x2a4755)[_0xf951('0x1f')](_0x504065);}return null;};}function patchUpdates(_0x56528a){return function(_0x7f5b9a){try{jsonpatch[_0xf951('0x20')](_0x7f5b9a,_0x56528a,!![]);}catch(_0x3f1f86){return BPromise[_0xf951('0x21')](_0x3f1f86);}return _0x7f5b9a[_0xf951('0x22')]();};}function saveUpdates(_0x4e6a61,_0x43e540){return function(_0x9f3336){if(_0x9f3336){return _0x9f3336[_0xf951('0x23')](_0x4e6a61)['then'](function(_0x14e70c){return _0x14e70c;});}return null;};}function removeEntity(_0x4065ad,_0x4dd7a4){return function(_0x500da7){if(_0x500da7){return _0x500da7[_0xf951('0x24')]()[_0xf951('0x25')](function(){_0x4065ad[_0xf951('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44fc99,_0xe855e0){return function(_0x3dd0ae){if(!_0x3dd0ae){_0x44fc99[_0xf951('0x17')](0x194);}return _0x3dd0ae;};}function handleError(_0x2367ea,_0x152eee){_0x152eee=_0x152eee||0x1f4;return function(_0x12563a){logger['error'](_0x12563a[_0xf951('0x26')]);if(_0x12563a['name']){delete _0x12563a[_0xf951('0x27')];}_0x2367ea[_0xf951('0x19')](_0x152eee)[_0xf951('0x28')](_0x12563a);};}exports[_0xf951('0x29')]=function(_0x2eba10,_0x55c5cd){var _0x5c7ddb={},_0x227d1e={},_0x41d35b={'count':0x0,'rows':[]};var _0x5f35f6=_[_0xf951('0x2a')](db[_0xf951('0x2b')][_0xf951('0x2c')],function(_0x421f3f){return{'name':_0x421f3f['fieldName'],'type':_0x421f3f[_0xf951('0x2d')][_0xf951('0x2e')]};});_0x227d1e[_0xf951('0x2f')]=_['map'](_0x5f35f6,_0xf951('0x27'));_0x227d1e[_0xf951('0x30')]=_[_0xf951('0x31')](_0x2eba10[_0xf951('0x30')]);_0x227d1e[_0xf951('0x32')]=_[_0xf951('0x33')](_0x227d1e[_0xf951('0x2f')],_0x227d1e[_0xf951('0x30')]);_0x5c7ddb['attributes']=_[_0xf951('0x33')](_0x227d1e[_0xf951('0x2f')],qs[_0xf951('0x34')](_0x2eba10[_0xf951('0x30')]['fields']));_0x5c7ddb[_0xf951('0x35')]=_0x5c7ddb[_0xf951('0x35')]['length']?_0x5c7ddb[_0xf951('0x35')]:_0x227d1e['model'];if(!_0x2eba10['query'][_0xf951('0x36')]('nolimit')){_0x5c7ddb[_0xf951('0x1b')]=qs['limit'](_0x2eba10[_0xf951('0x30')]['limit']);_0x5c7ddb[_0xf951('0x1a')]=qs[_0xf951('0x1a')](_0x2eba10['query'][_0xf951('0x1a')]);}_0x5c7ddb[_0xf951('0x37')]=qs['sort'](_0x2eba10[_0xf951('0x30')][_0xf951('0x38')]);_0x5c7ddb[_0xf951('0x39')]=qs[_0xf951('0x32')](_[_0xf951('0x3a')](_0x2eba10[_0xf951('0x30')],_0x227d1e[_0xf951('0x32')]),_0x5f35f6);if(_0x2eba10[_0xf951('0x30')][_0xf951('0x3b')]){_0x5c7ddb[_0xf951('0x39')]=_[_0xf951('0x3c')](_0x5c7ddb['where'],{'$or':_[_0xf951('0x2a')](_0x5f35f6,function(_0x1fee16){if(_0x1fee16[_0xf951('0x2d')]!==_0xf951('0x3d')){var _0x2e55d7={};_0x2e55d7[_0x1fee16[_0xf951('0x27')]]={'$like':'%'+_0x2eba10[_0xf951('0x30')][_0xf951('0x3b')]+'%'};return _0x2e55d7;}})});}_0x5c7ddb=_['merge']({},_0x5c7ddb,_0x2eba10[_0xf951('0x3e')]);var _0x5330cf={'where':_0x5c7ddb['where']};return db[_0xf951('0x2b')][_0xf951('0x1d')](_0x5330cf)[_0xf951('0x25')](function(_0x3a09c4){_0x41d35b[_0xf951('0x1d')]=_0x3a09c4;if(_0x2eba10[_0xf951('0x30')]['includeAll']){_0x5c7ddb[_0xf951('0x3f')]=[{'all':!![]}];}return db[_0xf951('0x2b')]['findAll'](_0x5c7ddb);})['then'](function(_0x4b3302){_0x41d35b['rows']=_0x4b3302;return _0x41d35b;})['then'](respondWithFilteredResult(_0x55c5cd,_0x5c7ddb))[_0xf951('0x40')](handleError(_0x55c5cd,null));};exports[_0xf951('0x41')]=function(_0x38d06b,_0x4c5369){var _0x3e76ae={'raw':!![],'where':{'id':_0x38d06b[_0xf951('0x42')]['id']}},_0x3e0117={};_0x3e0117[_0xf951('0x2f')]=_[_0xf951('0x31')](db[_0xf951('0x2b')][_0xf951('0x2c')]);_0x3e0117['query']=_[_0xf951('0x31')](_0x38d06b[_0xf951('0x30')]);_0x3e0117['filters']=_[_0xf951('0x33')](_0x3e0117['model'],_0x3e0117['query']);_0x3e76ae['attributes']=_['intersection'](_0x3e0117[_0xf951('0x2f')],qs['fields'](_0x38d06b[_0xf951('0x30')][_0xf951('0x34')]));_0x3e76ae[_0xf951('0x35')]=_0x3e76ae[_0xf951('0x35')][_0xf951('0x43')]?_0x3e76ae[_0xf951('0x35')]:_0x3e0117['model'];if(_0x38d06b[_0xf951('0x30')]['includeAll']){_0x3e76ae['include']=[{'all':!![]}];}_0x3e76ae=_[_0xf951('0x3c')]({},_0x3e76ae,_0x38d06b[_0xf951('0x3e')]);return db[_0xf951('0x2b')][_0xf951('0x44')](_0x3e76ae)[_0xf951('0x25')](handleEntityNotFound(_0x4c5369,null))[_0xf951('0x25')](respondWithResult(_0x4c5369,null))[_0xf951('0x40')](handleError(_0x4c5369,null));};exports[_0xf951('0x45')]=function(_0x31ec81,_0x2b37a3){return db[_0xf951('0x2b')][_0xf951('0x45')](_0x31ec81['body'],{})['then'](respondWithResult(_0x2b37a3,0xc9))[_0xf951('0x40')](handleError(_0x2b37a3,null));};exports[_0xf951('0x23')]=function(_0x5bce15,_0x60d737){if(_0x5bce15[_0xf951('0x46')]['id']){delete _0x5bce15['body']['id'];}return db['VtigerField'][_0xf951('0x44')]({'where':{'id':_0x5bce15['params']['id']}})[_0xf951('0x25')](handleEntityNotFound(_0x60d737,null))[_0xf951('0x25')](saveUpdates(_0x5bce15['body'],null))[_0xf951('0x25')](respondWithResult(_0x60d737,null))[_0xf951('0x40')](handleError(_0x60d737,null));};exports[_0xf951('0x24')]=function(_0x432aba,_0x7bb776){return db[_0xf951('0x2b')][_0xf951('0x44')]({'where':{'id':_0x432aba['params']['id']}})[_0xf951('0x25')](handleEntityNotFound(_0x7bb776,null))['then'](removeEntity(_0x7bb776,null))[_0xf951('0x40')](handleError(_0x7bb776,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 3da37d6..17f4930 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 _0xa8d1=['moment','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x336a7e,_0x4af2ca){var _0x587ba1=function(_0x1a17db){while(--_0x1a17db){_0x336a7e['push'](_0x336a7e['shift']());}};_0x587ba1(++_0x4af2ca);}(_0xa8d1,0x173));var _0x1a8d=function(_0x56c2d5,_0x3908fe){_0x56c2d5=_0x56c2d5-0x0;var _0x2e2133=_0xa8d1[_0x56c2d5];return _0x2e2133;};'use strict';var _=require(_0x1a8d('0x0'));var util=require(_0x1a8d('0x1'));var logger=require(_0x1a8d('0x2'))(_0x1a8d('0x3'));var moment=require(_0x1a8d('0x4'));var BPromise=require('bluebird');var rp=require(_0x1a8d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a8d('0x6'));var config=require(_0x1a8d('0x7'));var attributes=require(_0x1a8d('0x8'));module[_0x1a8d('0x9')]=function(_0x16fa43,_0x57130b){return _0x16fa43['define'](_0x1a8d('0xa'),attributes,{'tableName':_0x1a8d('0xb'),'paranoid':![],'indexes':[{'name':_0x1a8d('0xc'),'fields':[_0x1a8d('0xd'),_0x1a8d('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc6cf=['vtiger_unique_index','idField','FieldId','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VtigerField','int_vtiger_fields'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0xc6cf,0x1b5));var _0xfc6c=function(_0x4292b1,_0x39dac5){_0x4292b1=_0x4292b1-0x0;var _0x342485=_0xc6cf[_0x4292b1];return _0x342485;};'use strict';var _=require('lodash');var util=require(_0xfc6c('0x0'));var logger=require('../../config/logger')(_0xfc6c('0x1'));var moment=require(_0xfc6c('0x2'));var BPromise=require(_0xfc6c('0x3'));var rp=require(_0xfc6c('0x4'));var fs=require('fs');var path=require(_0xfc6c('0x5'));var rimraf=require(_0xfc6c('0x6'));var config=require(_0xfc6c('0x7'));var attributes=require('./intVtigerField.attributes');module[_0xfc6c('0x8')]=function(_0x320c84,_0x18b55b){return _0x320c84['define'](_0xfc6c('0x9'),attributes,{'tableName':_0xfc6c('0xa'),'paranoid':![],'indexes':[{'name':_0xfc6c('0xb'),'fields':[_0xfc6c('0xc'),_0xfc6c('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 545819f..67b2255 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 _0xf8a3=['http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf8a3,0x1b1));var _0x3f8a=function(_0x5733cf,_0x38689b){_0x5733cf=_0x5733cf-0x0;var _0x3c7cdd=_0xf8a3[_0x5733cf];return _0x3c7cdd;};'use strict';var _=require('lodash');var util=require(_0x3f8a('0x0'));var moment=require('moment');var BPromise=require(_0x3f8a('0x1'));var rs=require(_0x3f8a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3f8a('0x3'));var logger=require('../../config/logger')(_0x3f8a('0x4'));var config=require(_0x3f8a('0x5'));var jayson=require(_0x3f8a('0x6'));var client=jayson[_0x3f8a('0x7')][_0x3f8a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e180a,_0x536cf2,_0x1e6169){return new BPromise(function(_0x1ed961,_0xb15578){return client[_0x3f8a('0x9')](_0x3e180a,_0x1e6169)[_0x3f8a('0xa')](function(_0x41f1da){logger[_0x3f8a('0xb')](_0x3f8a('0xc'),_0x536cf2,_0x3f8a('0xd'));logger[_0x3f8a('0xe')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x536cf2,_0x3f8a('0xd'),JSON[_0x3f8a('0xf')](_0x41f1da));if(_0x41f1da[_0x3f8a('0x10')]){if(_0x41f1da[_0x3f8a('0x10')][_0x3f8a('0x11')]===0x1f4){logger[_0x3f8a('0x10')](_0x3f8a('0xc'),_0x536cf2,_0x41f1da[_0x3f8a('0x10')][_0x3f8a('0x12')]);return _0xb15578(_0x41f1da['error'][_0x3f8a('0x12')]);}logger[_0x3f8a('0x10')](_0x3f8a('0xc'),_0x536cf2,_0x41f1da['error'][_0x3f8a('0x12')]);return _0x1ed961(_0x41f1da['error'][_0x3f8a('0x12')]);}else{logger['info'](_0x3f8a('0xc'),_0x536cf2,_0x3f8a('0xd'));_0x1ed961(_0x41f1da[_0x3f8a('0x13')][_0x3f8a('0x12')]);}})[_0x3f8a('0x14')](function(_0x2cebfd){logger[_0x3f8a('0x10')](_0x3f8a('0xc'),_0x536cf2,_0x2cebfd);_0xb15578(_0x2cebfd);});});} \ No newline at end of file +var _0xb5b6=['stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x54ba5a,_0x3847e7){var _0x3f1582=function(_0x1a199e){while(--_0x1a199e){_0x54ba5a['push'](_0x54ba5a['shift']());}};_0x3f1582(++_0x3847e7);}(_0xb5b6,0x10f));var _0x6b5b=function(_0x9c364e,_0x3172e2){_0x9c364e=_0x9c364e-0x0;var _0x2bf2b2=_0xb5b6[_0x9c364e];return _0x2bf2b2;};'use strict';var _=require(_0x6b5b('0x0'));var util=require(_0x6b5b('0x1'));var moment=require(_0x6b5b('0x2'));var BPromise=require(_0x6b5b('0x3'));var rs=require(_0x6b5b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b5b('0x5'))['db'];var utils=require(_0x6b5b('0x6'));var logger=require(_0x6b5b('0x7'))(_0x6b5b('0x8'));var config=require('../../config/environment');var jayson=require(_0x6b5b('0x9'));var client=jayson[_0x6b5b('0xa')][_0x6b5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x124818,_0x52cb9b,_0x15bc57){return new BPromise(function(_0x50cb58,_0x215b9b){return client[_0x6b5b('0xc')](_0x124818,_0x15bc57)[_0x6b5b('0xd')](function(_0x14167){logger[_0x6b5b('0xe')]('VtigerField,\x20%s,\x20%s',_0x52cb9b,_0x6b5b('0xf'));logger[_0x6b5b('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x52cb9b,_0x6b5b('0xf'),JSON[_0x6b5b('0x11')](_0x14167));if(_0x14167[_0x6b5b('0x12')]){if(_0x14167['error'][_0x6b5b('0x13')]===0x1f4){logger['error'](_0x6b5b('0x14'),_0x52cb9b,_0x14167[_0x6b5b('0x12')][_0x6b5b('0x15')]);return _0x215b9b(_0x14167['error']['message']);}logger[_0x6b5b('0x12')](_0x6b5b('0x14'),_0x52cb9b,_0x14167[_0x6b5b('0x12')][_0x6b5b('0x15')]);return _0x50cb58(_0x14167['error']['message']);}else{logger[_0x6b5b('0xe')](_0x6b5b('0x14'),_0x52cb9b,_0x6b5b('0xf'));_0x50cb58(_0x14167[_0x6b5b('0x16')][_0x6b5b('0x15')]);}})[_0x6b5b('0x17')](function(_0x68dd27){logger['error'](_0x6b5b('0x14'),_0x52cb9b,_0x68dd27);_0x215b9b(_0x68dd27);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 894e8fa..be4498d 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 _0xb7b3=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','post','create','update','delete','exports','multer'];(function(_0xc35e79,_0x37df8f){var _0x2f2750=function(_0x33ab91){while(--_0x33ab91){_0xc35e79['push'](_0xc35e79['shift']());}};_0x2f2750(++_0x37df8f);}(_0xb7b3,0xa1));var _0x3b7b=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0xb7b3[_0x5466ab];return _0x40751a;};'use strict';var multer=require(_0x3b7b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3b7b('0x1'));var router=express[_0x3b7b('0x2')]();var fs_extra=require(_0x3b7b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3b7b('0x4'));var config=require(_0x3b7b('0x5'));var controller=require(_0x3b7b('0x6'));router[_0x3b7b('0x7')]('/',auth['isAuthenticated'](),controller[_0x3b7b('0x8')]);router[_0x3b7b('0x7')](_0x3b7b('0x9'),auth[_0x3b7b('0xa')](),controller[_0x3b7b('0xb')]);router['get'](_0x3b7b('0xc'),auth[_0x3b7b('0xa')](),controller['getConfigurations']);router[_0x3b7b('0x7')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x3b7b('0xd')]('/',auth[_0x3b7b('0xa')](),controller[_0x3b7b('0xe')]);router['post'](_0x3b7b('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x3b7b('0x9'),auth['isAuthenticated'](),controller[_0x3b7b('0xf')]);router[_0x3b7b('0x10')]('/:id',auth[_0x3b7b('0xa')](),controller['destroy']);module[_0x3b7b('0x11')]=router; \ No newline at end of file +var _0x5d0a=['/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5d0a,0x173));var _0xa5d0=function(_0x254e75,_0x531dfe){_0x254e75=_0x254e75-0x0;var _0x26104d=_0x5d0a[_0x254e75];return _0x26104d;};'use strict';var multer=require(_0xa5d0('0x0'));var util=require(_0xa5d0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa5d0('0x2')]();var fs_extra=require(_0xa5d0('0x3'));var auth=require(_0xa5d0('0x4'));var interaction=require(_0xa5d0('0x5'));var config=require(_0xa5d0('0x6'));var controller=require(_0xa5d0('0x7'));router[_0xa5d0('0x8')]('/',auth[_0xa5d0('0x9')](),controller['index']);router[_0xa5d0('0x8')]('/:id',auth[_0xa5d0('0x9')](),controller[_0xa5d0('0xa')]);router[_0xa5d0('0x8')](_0xa5d0('0xb'),auth[_0xa5d0('0x9')](),controller[_0xa5d0('0xc')]);router[_0xa5d0('0x8')](_0xa5d0('0xd'),auth[_0xa5d0('0x9')](),controller[_0xa5d0('0xe')]);router[_0xa5d0('0xf')]('/',auth[_0xa5d0('0x9')](),controller[_0xa5d0('0x10')]);router[_0xa5d0('0xf')]('/:id/configurations',auth[_0xa5d0('0x9')](),controller[_0xa5d0('0x11')]);router[_0xa5d0('0x12')](_0xa5d0('0x13'),auth[_0xa5d0('0x9')](),controller[_0xa5d0('0x14')]);router[_0xa5d0('0x15')](_0xa5d0('0x13'),auth['isAuthenticated'](),controller[_0xa5d0('0x16')]);module[_0xa5d0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 28083c5..88004eb 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 _0xa423=['password','token','integrationTab','newTab','sequelize','exports','STRING','remoteUri','ENUM'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xa423,0x16c));var _0x3a42=function(_0x2398d6,_0x2e04a9){_0x2398d6=_0x2398d6-0x0;var _0x32b942=_0xa423[_0x2398d6];return _0x32b942;};'use strict';var Sequelize=require(_0x3a42('0x0'));module[_0x3a42('0x1')]={'name':{'type':Sequelize[_0x3a42('0x2')]},'description':{'type':Sequelize[_0x3a42('0x2')]},'username':{'type':Sequelize[_0x3a42('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x3a42('0x2')]},'token':{'type':Sequelize[_0x3a42('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3a42('0x3')},'authType':{'type':Sequelize[_0x3a42('0x4')](_0x3a42('0x5'),_0x3a42('0x6')),'defaultValue':_0x3a42('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3a42('0x4')](_0x3a42('0x7'),_0x3a42('0x8')),'defaultValue':_0x3a42('0x7')}}; \ No newline at end of file +var _0xd117=['remoteUri','ENUM','password','token','newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0x31e738,_0x107f00){var _0x3a4f11=function(_0x3e49fc){while(--_0x3e49fc){_0x31e738['push'](_0x31e738['shift']());}};_0x3a4f11(++_0x107f00);}(_0xd117,0x182));var _0x7d11=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0xd117[_0x4358f5];return _0x4d8104;};'use strict';var Sequelize=require(_0x7d11('0x0'));module[_0x7d11('0x1')]={'name':{'type':Sequelize[_0x7d11('0x2')]},'description':{'type':Sequelize[_0x7d11('0x2')]},'username':{'type':Sequelize[_0x7d11('0x2')],'unique':_0x7d11('0x3')},'password':{'type':Sequelize[_0x7d11('0x2')]},'token':{'type':Sequelize[_0x7d11('0x2')]},'remoteUri':{'type':Sequelize[_0x7d11('0x2')],'unique':_0x7d11('0x4')},'authType':{'type':Sequelize[_0x7d11('0x5')](_0x7d11('0x6'),_0x7d11('0x7')),'defaultValue':_0x7d11('0x6')},'serverUrl':{'type':Sequelize[_0x7d11('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7d11('0x5')]('integrationTab',_0x7d11('0x8')),'defaultValue':_0x7d11('0x9')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 3c9b8f2..ca15d37 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 _0xa478=['ZendeskAccount','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','destroy','ZendeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','channel','type','Descriptions','getDescriptions','ZendeskField','password','token','authType','remoteUri','slice','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','username','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','sendStatus','stack','name','index','map'];(function(_0x406425,_0x54f8d5){var _0x1005d6=function(_0x3fafd2){while(--_0x3fafd2){_0x406425['push'](_0x406425['shift']());}};_0x1005d6(++_0x54f8d5);}(_0xa478,0x136));var _0x8a47=function(_0x3d5f84,_0x569548){_0x3d5f84=_0x3d5f84-0x0;var _0x1981b8=_0xa478[_0x3d5f84];return _0x1981b8;};'use strict';var emlformat=require(_0x8a47('0x0'));var rimraf=require(_0x8a47('0x1'));var zipdir=require(_0x8a47('0x2'));var jsonpatch=require(_0x8a47('0x3'));var rp=require(_0x8a47('0x4'));var moment=require(_0x8a47('0x5'));var BPromise=require(_0x8a47('0x6'));var Mustache=require(_0x8a47('0x7'));var util=require(_0x8a47('0x8'));var path=require(_0x8a47('0x9'));var sox=require(_0x8a47('0xa'));var csv=require(_0x8a47('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a47('0xc'));var _=require(_0x8a47('0xd'));var squel=require(_0x8a47('0xe'));var crypto=require(_0x8a47('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8a47('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8a47('0x11'));var Papa=require(_0x8a47('0x12'));var Redis=require(_0x8a47('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8a47('0x14'));var as=require(_0x8a47('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a47('0x16'))('api');var utils=require(_0x8a47('0x17'));var config=require(_0x8a47('0x18'));var licenseUtil=require(_0x8a47('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x59efc7,_0x36941a){_0x36941a=_0x36941a||0xcc;return function(_0x12539c){if(_0x12539c){return _0x59efc7['sendStatus'](_0x36941a);}return _0x59efc7[_0x8a47('0x1a')](_0x36941a)[_0x8a47('0x1b')]();};}function respondWithResult(_0x1a9a6f,_0x55985c){_0x55985c=_0x55985c||0xc8;return function(_0x1c23e3){if(_0x1c23e3){return _0x1a9a6f[_0x8a47('0x1a')](_0x55985c)[_0x8a47('0x1c')](_0x1c23e3);}};}function respondWithFilteredResult(_0x1c8488,_0x41bdaf){return function(_0x18f2be){if(_0x18f2be){var _0x26fd48=typeof _0x41bdaf[_0x8a47('0x1d')]===_0x8a47('0x1e')&&typeof _0x41bdaf['limit']===_0x8a47('0x1e');var _0x1d0b04=_0x18f2be[_0x8a47('0x1f')];var _0x5f5884=_0x26fd48?0x0:_0x41bdaf[_0x8a47('0x1d')];var _0x5c62eb=_0x26fd48?_0x18f2be['count']:_0x41bdaf[_0x8a47('0x1d')]+_0x41bdaf[_0x8a47('0x20')];var _0x158e0c;if(_0x5c62eb>=_0x1d0b04){_0x5c62eb=_0x1d0b04;_0x158e0c=0xc8;}else{_0x158e0c=0xce;}_0x1c8488[_0x8a47('0x1a')](_0x158e0c);return _0x1c8488[_0x8a47('0x21')](_0x8a47('0x22'),_0x5f5884+'-'+_0x5c62eb+'/'+_0x1d0b04)[_0x8a47('0x1c')](_0x18f2be);}return null;};}function patchUpdates(_0x1bbed6){return function(_0x2b88a7){try{jsonpatch[_0x8a47('0x23')](_0x2b88a7,_0x1bbed6,!![]);}catch(_0x54ce6a){return BPromise[_0x8a47('0x24')](_0x54ce6a);}return _0x2b88a7['save']();};}function saveUpdates(_0x289f28,_0x3d7993){return function(_0x36908d){if(_0x36908d){return _0x36908d[_0x8a47('0x25')](_0x289f28)['then'](function(_0x116b5e){return _0x116b5e;});}return null;};}function removeEntity(_0x5ae186,_0x50f6ba){return function(_0x4d71f4){if(_0x4d71f4){return _0x4d71f4['destroy']()[_0x8a47('0x26')](function(){_0x5ae186[_0x8a47('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bb0d4,_0xb4590d){return function(_0x42dae1){if(!_0x42dae1){_0x2bb0d4[_0x8a47('0x27')](0x194);}return _0x42dae1;};}function handleError(_0x44cf20,_0xd06be6){_0xd06be6=_0xd06be6||0x1f4;return function(_0x24a20b){logger['error'](_0x24a20b[_0x8a47('0x28')]);if(_0x24a20b['name']){delete _0x24a20b[_0x8a47('0x29')];}_0x44cf20[_0x8a47('0x1a')](_0xd06be6)['send'](_0x24a20b);};}exports[_0x8a47('0x2a')]=function(_0x526571,_0x4d5d32){var _0x12470a={},_0x9b51b8={},_0x1ddbcf={'count':0x0,'rows':[]};var _0x12f0b7=_[_0x8a47('0x2b')](db[_0x8a47('0x2c')]['rawAttributes'],function(_0x353576){return{'name':_0x353576['fieldName'],'type':_0x353576['type'][_0x8a47('0x2d')]};});_0x9b51b8[_0x8a47('0x2e')]=_[_0x8a47('0x2b')](_0x12f0b7,_0x8a47('0x29'));_0x9b51b8[_0x8a47('0x2f')]=_[_0x8a47('0x30')](_0x526571[_0x8a47('0x2f')]);_0x9b51b8[_0x8a47('0x31')]=_[_0x8a47('0x32')](_0x9b51b8[_0x8a47('0x2e')],_0x9b51b8['query']);_0x12470a[_0x8a47('0x33')]=_[_0x8a47('0x32')](_0x9b51b8[_0x8a47('0x2e')],qs['fields'](_0x526571[_0x8a47('0x2f')][_0x8a47('0x34')]));_0x12470a['attributes']=_0x12470a[_0x8a47('0x33')][_0x8a47('0x35')]?_0x12470a[_0x8a47('0x33')]:_0x9b51b8[_0x8a47('0x2e')];if(!_0x526571['query']['hasOwnProperty'](_0x8a47('0x36'))){_0x12470a[_0x8a47('0x20')]=qs[_0x8a47('0x20')](_0x526571[_0x8a47('0x2f')][_0x8a47('0x20')]);_0x12470a[_0x8a47('0x1d')]=qs[_0x8a47('0x1d')](_0x526571['query']['offset']);}_0x12470a[_0x8a47('0x37')]=qs[_0x8a47('0x38')](_0x526571[_0x8a47('0x2f')][_0x8a47('0x38')]);_0x12470a[_0x8a47('0x39')]=qs[_0x8a47('0x31')](_[_0x8a47('0x3a')](_0x526571[_0x8a47('0x2f')],_0x9b51b8[_0x8a47('0x31')]),_0x12f0b7);if(_0x526571[_0x8a47('0x2f')][_0x8a47('0x3b')]){_0x12470a['where']=_[_0x8a47('0x3c')](_0x12470a['where'],{'$or':_['map'](_0x12f0b7,function(_0x544fe2){if(_0x544fe2['type']!=='VIRTUAL'){var _0x3edb2e={};_0x3edb2e[_0x544fe2[_0x8a47('0x29')]]={'$like':'%'+_0x526571[_0x8a47('0x2f')][_0x8a47('0x3b')]+'%'};return _0x3edb2e;}})});}_0x12470a=_[_0x8a47('0x3c')]({},_0x12470a,_0x526571[_0x8a47('0x3d')]);var _0x25c45b={'where':_0x12470a[_0x8a47('0x39')]};return db['ZendeskAccount']['count'](_0x25c45b)[_0x8a47('0x26')](function(_0x437b86){_0x1ddbcf[_0x8a47('0x1f')]=_0x437b86;if(_0x526571[_0x8a47('0x2f')]['includeAll']){_0x12470a[_0x8a47('0x3e')]=[{'all':!![]}];}return db[_0x8a47('0x2c')][_0x8a47('0x3f')](_0x12470a);})[_0x8a47('0x26')](function(_0x1ef057){_0x1ddbcf['rows']=_0x1ef057;return _0x1ddbcf;})[_0x8a47('0x26')](respondWithFilteredResult(_0x4d5d32,_0x12470a))[_0x8a47('0x40')](handleError(_0x4d5d32,null));};exports[_0x8a47('0x41')]=function(_0x5d23ed,_0x2b3874){var _0x2c70ea={'raw':![],'where':{'id':_0x5d23ed[_0x8a47('0x42')]['id']}},_0xf313ec={};_0xf313ec['model']=_[_0x8a47('0x30')](db[_0x8a47('0x2c')][_0x8a47('0x43')]);_0xf313ec[_0x8a47('0x2f')]=_[_0x8a47('0x30')](_0x5d23ed[_0x8a47('0x2f')]);_0xf313ec['filters']=_['intersection'](_0xf313ec[_0x8a47('0x2e')],_0xf313ec[_0x8a47('0x2f')]);_0x2c70ea[_0x8a47('0x33')]=_['intersection'](_0xf313ec[_0x8a47('0x2e')],qs[_0x8a47('0x34')](_0x5d23ed['query']['fields']));_0x2c70ea[_0x8a47('0x33')]=_0x2c70ea['attributes'][_0x8a47('0x35')]?_0x2c70ea[_0x8a47('0x33')]:_0xf313ec[_0x8a47('0x2e')];if(_0x5d23ed[_0x8a47('0x2f')][_0x8a47('0x44')]){_0x2c70ea[_0x8a47('0x3e')]=[{'all':!![]}];}_0x2c70ea=_['merge']({},_0x2c70ea,_0x5d23ed['options']);return db[_0x8a47('0x2c')][_0x8a47('0x45')](_0x2c70ea)[_0x8a47('0x26')](handleEntityNotFound(_0x2b3874,null))[_0x8a47('0x26')](respondWithResult(_0x2b3874,null))[_0x8a47('0x40')](handleError(_0x2b3874,null));};exports['create']=function(_0x4898d0,_0x17a755){return db['ZendeskAccount'][_0x8a47('0x46')](_0x4898d0[_0x8a47('0x47')],{})['then'](respondWithResult(_0x17a755,0xc9))[_0x8a47('0x40')](handleError(_0x17a755,null));};exports[_0x8a47('0x25')]=function(_0x14e22c,_0x108c7f){if(_0x14e22c[_0x8a47('0x47')]['id']){delete _0x14e22c[_0x8a47('0x47')]['id'];}return db[_0x8a47('0x2c')][_0x8a47('0x45')]({'where':{'id':_0x14e22c['params']['id']}})[_0x8a47('0x26')](handleEntityNotFound(_0x108c7f,null))[_0x8a47('0x26')](saveUpdates(_0x14e22c[_0x8a47('0x47')],null))[_0x8a47('0x26')](respondWithResult(_0x108c7f,null))['catch'](handleError(_0x108c7f,null));};exports[_0x8a47('0x48')]=function(_0xa428dd,_0x24e123){return db[_0x8a47('0x2c')][_0x8a47('0x45')]({'where':{'id':_0xa428dd[_0x8a47('0x42')]['id']}})['then'](handleEntityNotFound(_0x24e123,null))['then'](removeEntity(_0x24e123,null))[_0x8a47('0x40')](handleError(_0x24e123,null));};exports['getConfigurations']=function(_0x1da8b7,_0x175023,_0x5a1b29){var _0xb05ed1={};var _0x4bf9a8={};var _0x315111;var _0x5c5577;return db[_0x8a47('0x2c')]['findOne']({'where':{'id':_0x1da8b7[_0x8a47('0x42')]['id']}})[_0x8a47('0x26')](handleEntityNotFound(_0x175023,null))[_0x8a47('0x26')](function(_0x144ce6){if(_0x144ce6){_0x315111=_0x144ce6;_0x4bf9a8[_0x8a47('0x2e')]=_[_0x8a47('0x30')](db[_0x8a47('0x49')][_0x8a47('0x43')]);_0x4bf9a8[_0x8a47('0x2f')]=_[_0x8a47('0x30')](_0x1da8b7[_0x8a47('0x2f')]);_0x4bf9a8['filters']=_[_0x8a47('0x32')](_0x4bf9a8[_0x8a47('0x2e')],_0x4bf9a8['query']);_0xb05ed1[_0x8a47('0x33')]=_[_0x8a47('0x32')](_0x4bf9a8[_0x8a47('0x2e')],qs[_0x8a47('0x34')](_0x1da8b7[_0x8a47('0x2f')][_0x8a47('0x34')]));_0xb05ed1[_0x8a47('0x33')]=_0xb05ed1[_0x8a47('0x33')][_0x8a47('0x35')]?_0xb05ed1[_0x8a47('0x33')]:_0x4bf9a8[_0x8a47('0x2e')];_0xb05ed1[_0x8a47('0x37')]=qs['sort'](_0x1da8b7[_0x8a47('0x2f')][_0x8a47('0x38')]);_0xb05ed1[_0x8a47('0x39')]=qs[_0x8a47('0x31')](_[_0x8a47('0x3a')](_0x1da8b7[_0x8a47('0x2f')],_0x4bf9a8[_0x8a47('0x31')]));if(_0x1da8b7[_0x8a47('0x2f')][_0x8a47('0x3b')]){_0xb05ed1[_0x8a47('0x39')]=_[_0x8a47('0x3c')](_0xb05ed1[_0x8a47('0x39')],{'$or':_[_0x8a47('0x2b')](_0xb05ed1[_0x8a47('0x33')],function(_0x2edcaf){var _0x7664a8={};_0x7664a8[_0x2edcaf]={'$like':'%'+_0x1da8b7['query'][_0x8a47('0x3b')]+'%'};return _0x7664a8;})});}_0xb05ed1=_['merge']({},_0xb05ed1,_0x1da8b7[_0x8a47('0x3d')]);return _0x315111[_0x8a47('0x4a')](_0xb05ed1);}})[_0x8a47('0x26')](function(_0x21fdb5){if(_0x21fdb5){_0x5c5577=_0x21fdb5[_0x8a47('0x35')];if(!_0x1da8b7[_0x8a47('0x2f')]['hasOwnProperty'](_0x8a47('0x36'))){_0xb05ed1[_0x8a47('0x20')]=qs[_0x8a47('0x20')](_0x1da8b7['query']['limit']);_0xb05ed1[_0x8a47('0x1d')]=qs[_0x8a47('0x1d')](_0x1da8b7['query'][_0x8a47('0x1d')]);}return _0x315111[_0x8a47('0x4a')](_0xb05ed1);}})[_0x8a47('0x26')](function(_0x17f20f){if(_0x17f20f){return _0x17f20f?{'count':_0x5c5577,'rows':_0x17f20f}:null;}})[_0x8a47('0x26')](respondWithResult(_0x175023,null))[_0x8a47('0x40')](handleError(_0x175023,null));};exports[_0x8a47('0x4b')]=function(_0x2932f1,_0x99848c,_0x1b834a){if(_0x2932f1[_0x8a47('0x47')]['id']){delete _0x2932f1[_0x8a47('0x47')]['id'];}return db[_0x8a47('0x2c')]['findOne']({'where':{'id':_0x2932f1[_0x8a47('0x42')]['id']}})[_0x8a47('0x26')](handleEntityNotFound(_0x99848c,null))[_0x8a47('0x26')](function(_0x13a002){if(_0x13a002){_0x2932f1[_0x8a47('0x47')][_0x8a47('0x4c')]=_0x13a002['id'];_0x2932f1['body'][_0x8a47('0x4d')]=integrations['getSubjects'](_0x2932f1['body'][_0x8a47('0x4e')],_0x2932f1[_0x8a47('0x47')][_0x8a47('0x4f')]);_0x2932f1[_0x8a47('0x47')][_0x8a47('0x50')]=integrations[_0x8a47('0x51')](_0x2932f1['body']['channel'],_0x2932f1[_0x8a47('0x47')]['type']);return db[_0x8a47('0x49')][_0x8a47('0x46')](_0x2932f1[_0x8a47('0x47')],{'include':[{'model':db[_0x8a47('0x52')],'as':_0x8a47('0x4d')},{'model':db[_0x8a47('0x52')],'as':_0x8a47('0x50')}]});}return null;})[_0x8a47('0x26')](respondWithResult(_0x99848c,null))['catch'](handleError(_0x99848c,null));};exports['getFields']=function(_0x435039,_0x131176,_0x2761bf){var _0x5d6ebc='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x435039[_0x8a47('0x42')]['id']},'attributes':['id','username',_0x8a47('0x53'),_0x8a47('0x54'),_0x8a47('0x55'),_0x8a47('0x56')]})['then'](handleEntityNotFound(_0x131176,null))[_0x8a47('0x26')](function(_0x55c590){if(_0x55c590){_0x5d6ebc=_0x55c590[_0x8a47('0x56')];var _0x430ee2=_0x5d6ebc[_0x8a47('0x57')](-0x1);if(_0x430ee2==='/'){_0x5d6ebc=_0x5d6ebc['substring'](0x0,_0x5d6ebc[_0x8a47('0x58')](_0x430ee2));}var _0x3f53ba={'method':'GET','uri':util[_0x8a47('0x59')](_0x8a47('0x5a'),_0x5d6ebc,_0x8a47('0x5b')),'json':!![]};switch(_0x55c590[_0x8a47('0x55')]){case _0x8a47('0x53'):_0x3f53ba[_0x8a47('0x5c')]={'Authorization':util[_0x8a47('0x59')](_0x8a47('0x5d'),new Buffer(util['format'](_0x8a47('0x5e'),_0x55c590[_0x8a47('0x5f')],_0x55c590['password']))[_0x8a47('0x60')](_0x8a47('0x61')))};break;case'token':_0x3f53ba[_0x8a47('0x5c')]={'Authorization':util[_0x8a47('0x59')](_0x8a47('0x5d'),new Buffer(util[_0x8a47('0x59')](_0x8a47('0x62'),_0x55c590['username'],_0x55c590['token']))[_0x8a47('0x60')](_0x8a47('0x61')))};break;default:throw new db[(_0x8a47('0x63'))][(_0x8a47('0x64'))](_0x8a47('0x65'));}return rp(_0x3f53ba);}})[_0x8a47('0x26')](function(_0x34bb61){if(_0x34bb61){var _0x4845fa=[_0x8a47('0x66'),_0x8a47('0x67'),_0x8a47('0x68'),'assignee'];_[_0x8a47('0x69')](_0x34bb61[_0x8a47('0x5b')],function(_0xa2ea5c){return _0x4845fa[_0x8a47('0x6a')](_0xa2ea5c[_0x8a47('0x4f')]);});return{'count':_0x34bb61[_0x8a47('0x5b')][_0x8a47('0x35')],'rows':_[_0x8a47('0x2b')](_0x34bb61['ticket_fields'],function(_0x509e91){return{'id':_0x509e91['id'],'name':_0x509e91[_0x8a47('0x6b')]>0x7?_0x509e91[_0x8a47('0x6c')]:_0x509e91[_0x8a47('0x4f')],'custom':_0x509e91['position']>0x7?!![]:![],'options':_0x509e91[_0x8a47('0x6d')]?_0x509e91[_0x8a47('0x6d')]:_0x509e91[_0x8a47('0x6e')]?_0x509e91[_0x8a47('0x6e')]:[]};})};}})[_0x8a47('0x26')](respondWithResult(_0x131176,null))[_0x8a47('0x40')](function(_0x18def4){var _0x2a2379=_0x435039[_0x8a47('0x2f')][_0x8a47('0x6f')]?0x1f4:_0x18def4[_0x8a47('0x70')]||0x1f4;logger[_0x8a47('0x71')]('getFields,\x20%s,\x20%s,\x20%s',_0x8a47('0x72'),_0x2a2379,JSON[_0x8a47('0x73')](_0x18def4));delete _0x18def4[_0x8a47('0x29')];if(_0x2a2379===0x191){_0x2a2379=0x190;}_0x131176[_0x8a47('0x1a')](_0x2a2379)[_0x8a47('0x74')](_0x435039[_0x8a47('0x2f')][_0x8a47('0x6f')]?{'message':_0x8a47('0x75'),'statusCode':_0x18def4[_0x8a47('0x70')]}:_0x18def4);});}; \ No newline at end of file +var _0x5eb8=['sort','where','filter','merge','type','options','includeAll','findAll','catch','show','params','keys','length','include','find','create','body','update','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','remove','includes','title','position','system_field_options','custom_field_options','send','Wrong\x20credentials','statusCode','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','sendStatus','error','stack','name','map','ZendeskAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3a7db0,_0xe93c50){_0x3a7db0=_0x3a7db0-0x0;var _0x17cbba=_0x5eb8[_0x3a7db0];return _0x17cbba;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];var integrations=require(_0x85eb('0x19'));function respondWithStatusCode(_0x2f42ba,_0x259f72){_0x259f72=_0x259f72||0xcc;return function(_0x4db167){if(_0x4db167){return _0x2f42ba['sendStatus'](_0x259f72);}return _0x2f42ba[_0x85eb('0x1a')](_0x259f72)['end']();};}function respondWithResult(_0x18ca53,_0x23a82a){_0x23a82a=_0x23a82a||0xc8;return function(_0x600a7f){if(_0x600a7f){return _0x18ca53[_0x85eb('0x1a')](_0x23a82a)[_0x85eb('0x1b')](_0x600a7f);}};}function respondWithFilteredResult(_0x49efdf,_0x2e5c0a){return function(_0x59237b){if(_0x59237b){var _0x17140b=typeof _0x2e5c0a[_0x85eb('0x1c')]===_0x85eb('0x1d')&&typeof _0x2e5c0a[_0x85eb('0x1e')]==='undefined';var _0x5c5cbb=_0x59237b['count'];var _0xe198ca=_0x17140b?0x0:_0x2e5c0a[_0x85eb('0x1c')];var _0x10cf2f=_0x17140b?_0x59237b[_0x85eb('0x1f')]:_0x2e5c0a[_0x85eb('0x1c')]+_0x2e5c0a[_0x85eb('0x1e')];var _0x5acd3d;if(_0x10cf2f>=_0x5c5cbb){_0x10cf2f=_0x5c5cbb;_0x5acd3d=0xc8;}else{_0x5acd3d=0xce;}_0x49efdf[_0x85eb('0x1a')](_0x5acd3d);return _0x49efdf[_0x85eb('0x20')](_0x85eb('0x21'),_0xe198ca+'-'+_0x10cf2f+'/'+_0x5c5cbb)['json'](_0x59237b);}return null;};}function patchUpdates(_0x4b4b38){return function(_0x48bd86){try{jsonpatch['apply'](_0x48bd86,_0x4b4b38,!![]);}catch(_0x244667){return BPromise[_0x85eb('0x22')](_0x244667);}return _0x48bd86[_0x85eb('0x23')]();};}function saveUpdates(_0x255ca7,_0x465c74){return function(_0x3fc6da){if(_0x3fc6da){return _0x3fc6da['update'](_0x255ca7)['then'](function(_0x5b48d9){return _0x5b48d9;});}return null;};}function removeEntity(_0x298e84,_0x1426c8){return function(_0x3f7a4d){if(_0x3f7a4d){return _0x3f7a4d[_0x85eb('0x24')]()[_0x85eb('0x25')](function(){_0x298e84[_0x85eb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39d3fe,_0x3453cd){return function(_0x4709ad){if(!_0x4709ad){_0x39d3fe[_0x85eb('0x26')](0x194);}return _0x4709ad;};}function handleError(_0x3e2326,_0x57a03c){_0x57a03c=_0x57a03c||0x1f4;return function(_0x2e5aa3){logger[_0x85eb('0x27')](_0x2e5aa3[_0x85eb('0x28')]);if(_0x2e5aa3[_0x85eb('0x29')]){delete _0x2e5aa3[_0x85eb('0x29')];}_0x3e2326[_0x85eb('0x1a')](_0x57a03c)['send'](_0x2e5aa3);};}exports['index']=function(_0x37515c,_0x585f2a){var _0xa9b14f={},_0x5255eb={},_0x4229e9={'count':0x0,'rows':[]};var _0x3570f7=_[_0x85eb('0x2a')](db[_0x85eb('0x2b')][_0x85eb('0x2c')],function(_0xf4ac13){return{'name':_0xf4ac13[_0x85eb('0x2d')],'type':_0xf4ac13['type'][_0x85eb('0x2e')]};});_0x5255eb[_0x85eb('0x2f')]=_['map'](_0x3570f7,_0x85eb('0x29'));_0x5255eb['query']=_['keys'](_0x37515c[_0x85eb('0x30')]);_0x5255eb[_0x85eb('0x31')]=_[_0x85eb('0x32')](_0x5255eb[_0x85eb('0x2f')],_0x5255eb[_0x85eb('0x30')]);_0xa9b14f[_0x85eb('0x33')]=_[_0x85eb('0x32')](_0x5255eb[_0x85eb('0x2f')],qs[_0x85eb('0x34')](_0x37515c[_0x85eb('0x30')]['fields']));_0xa9b14f[_0x85eb('0x33')]=_0xa9b14f[_0x85eb('0x33')]['length']?_0xa9b14f['attributes']:_0x5255eb[_0x85eb('0x2f')];if(!_0x37515c[_0x85eb('0x30')][_0x85eb('0x35')](_0x85eb('0x36'))){_0xa9b14f[_0x85eb('0x1e')]=qs[_0x85eb('0x1e')](_0x37515c[_0x85eb('0x30')][_0x85eb('0x1e')]);_0xa9b14f[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x37515c[_0x85eb('0x30')][_0x85eb('0x1c')]);}_0xa9b14f[_0x85eb('0x37')]=qs[_0x85eb('0x38')](_0x37515c['query'][_0x85eb('0x38')]);_0xa9b14f[_0x85eb('0x39')]=qs['filters'](_['pick'](_0x37515c[_0x85eb('0x30')],_0x5255eb[_0x85eb('0x31')]),_0x3570f7);if(_0x37515c['query'][_0x85eb('0x3a')]){_0xa9b14f['where']=_[_0x85eb('0x3b')](_0xa9b14f['where'],{'$or':_[_0x85eb('0x2a')](_0x3570f7,function(_0x5ce7e4){if(_0x5ce7e4[_0x85eb('0x3c')]!=='VIRTUAL'){var _0x38ab0f={};_0x38ab0f[_0x5ce7e4[_0x85eb('0x29')]]={'$like':'%'+_0x37515c['query'][_0x85eb('0x3a')]+'%'};return _0x38ab0f;}})});}_0xa9b14f=_['merge']({},_0xa9b14f,_0x37515c[_0x85eb('0x3d')]);var _0x331260={'where':_0xa9b14f['where']};return db[_0x85eb('0x2b')]['count'](_0x331260)['then'](function(_0x1b8a71){_0x4229e9['count']=_0x1b8a71;if(_0x37515c[_0x85eb('0x30')][_0x85eb('0x3e')]){_0xa9b14f['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x85eb('0x3f')](_0xa9b14f);})[_0x85eb('0x25')](function(_0x48160e){_0x4229e9['rows']=_0x48160e;return _0x4229e9;})[_0x85eb('0x25')](respondWithFilteredResult(_0x585f2a,_0xa9b14f))[_0x85eb('0x40')](handleError(_0x585f2a,null));};exports[_0x85eb('0x41')]=function(_0x202681,_0x3be961){var _0x5b7411={'raw':![],'where':{'id':_0x202681[_0x85eb('0x42')]['id']}},_0x5ccf8a={};_0x5ccf8a[_0x85eb('0x2f')]=_[_0x85eb('0x43')](db[_0x85eb('0x2b')][_0x85eb('0x2c')]);_0x5ccf8a[_0x85eb('0x30')]=_[_0x85eb('0x43')](_0x202681[_0x85eb('0x30')]);_0x5ccf8a['filters']=_[_0x85eb('0x32')](_0x5ccf8a[_0x85eb('0x2f')],_0x5ccf8a['query']);_0x5b7411[_0x85eb('0x33')]=_[_0x85eb('0x32')](_0x5ccf8a[_0x85eb('0x2f')],qs[_0x85eb('0x34')](_0x202681[_0x85eb('0x30')][_0x85eb('0x34')]));_0x5b7411['attributes']=_0x5b7411[_0x85eb('0x33')][_0x85eb('0x44')]?_0x5b7411[_0x85eb('0x33')]:_0x5ccf8a[_0x85eb('0x2f')];if(_0x202681[_0x85eb('0x30')][_0x85eb('0x3e')]){_0x5b7411[_0x85eb('0x45')]=[{'all':!![]}];}_0x5b7411=_[_0x85eb('0x3b')]({},_0x5b7411,_0x202681['options']);return db[_0x85eb('0x2b')][_0x85eb('0x46')](_0x5b7411)[_0x85eb('0x25')](handleEntityNotFound(_0x3be961,null))[_0x85eb('0x25')](respondWithResult(_0x3be961,null))[_0x85eb('0x40')](handleError(_0x3be961,null));};exports[_0x85eb('0x47')]=function(_0x3c387a,_0x77fdc4){return db[_0x85eb('0x2b')][_0x85eb('0x47')](_0x3c387a[_0x85eb('0x48')],{})[_0x85eb('0x25')](respondWithResult(_0x77fdc4,0xc9))['catch'](handleError(_0x77fdc4,null));};exports[_0x85eb('0x49')]=function(_0x2c951b,_0x22d9d6){if(_0x2c951b['body']['id']){delete _0x2c951b[_0x85eb('0x48')]['id'];}return db[_0x85eb('0x2b')][_0x85eb('0x46')]({'where':{'id':_0x2c951b[_0x85eb('0x42')]['id']}})[_0x85eb('0x25')](handleEntityNotFound(_0x22d9d6,null))['then'](saveUpdates(_0x2c951b[_0x85eb('0x48')],null))[_0x85eb('0x25')](respondWithResult(_0x22d9d6,null))[_0x85eb('0x40')](handleError(_0x22d9d6,null));};exports['destroy']=function(_0xc5cb43,_0x4550fd){return db[_0x85eb('0x2b')]['find']({'where':{'id':_0xc5cb43['params']['id']}})[_0x85eb('0x25')](handleEntityNotFound(_0x4550fd,null))['then'](removeEntity(_0x4550fd,null))['catch'](handleError(_0x4550fd,null));};exports[_0x85eb('0x4a')]=function(_0x593723,_0x39316d,_0xfb0ac){var _0x4e3d96={};var _0x4abe5e={};var _0x27ce2a;var _0x249511;return db[_0x85eb('0x2b')][_0x85eb('0x4b')]({'where':{'id':_0x593723[_0x85eb('0x42')]['id']}})['then'](handleEntityNotFound(_0x39316d,null))[_0x85eb('0x25')](function(_0x30062e){if(_0x30062e){_0x27ce2a=_0x30062e;_0x4abe5e[_0x85eb('0x2f')]=_[_0x85eb('0x43')](db[_0x85eb('0x4c')]['rawAttributes']);_0x4abe5e[_0x85eb('0x30')]=_['keys'](_0x593723[_0x85eb('0x30')]);_0x4abe5e[_0x85eb('0x31')]=_['intersection'](_0x4abe5e[_0x85eb('0x2f')],_0x4abe5e[_0x85eb('0x30')]);_0x4e3d96[_0x85eb('0x33')]=_[_0x85eb('0x32')](_0x4abe5e[_0x85eb('0x2f')],qs[_0x85eb('0x34')](_0x593723['query'][_0x85eb('0x34')]));_0x4e3d96['attributes']=_0x4e3d96[_0x85eb('0x33')][_0x85eb('0x44')]?_0x4e3d96['attributes']:_0x4abe5e[_0x85eb('0x2f')];_0x4e3d96[_0x85eb('0x37')]=qs['sort'](_0x593723[_0x85eb('0x30')]['sort']);_0x4e3d96[_0x85eb('0x39')]=qs[_0x85eb('0x31')](_[_0x85eb('0x4d')](_0x593723[_0x85eb('0x30')],_0x4abe5e[_0x85eb('0x31')]));if(_0x593723[_0x85eb('0x30')]['filter']){_0x4e3d96[_0x85eb('0x39')]=_[_0x85eb('0x3b')](_0x4e3d96[_0x85eb('0x39')],{'$or':_[_0x85eb('0x2a')](_0x4e3d96[_0x85eb('0x33')],function(_0x1529dd){var _0x2024df={};_0x2024df[_0x1529dd]={'$like':'%'+_0x593723[_0x85eb('0x30')][_0x85eb('0x3a')]+'%'};return _0x2024df;})});}_0x4e3d96=_[_0x85eb('0x3b')]({},_0x4e3d96,_0x593723[_0x85eb('0x3d')]);return _0x27ce2a['getConfigurations'](_0x4e3d96);}})[_0x85eb('0x25')](function(_0x21b873){if(_0x21b873){_0x249511=_0x21b873[_0x85eb('0x44')];if(!_0x593723[_0x85eb('0x30')][_0x85eb('0x35')](_0x85eb('0x36'))){_0x4e3d96['limit']=qs[_0x85eb('0x1e')](_0x593723['query'][_0x85eb('0x1e')]);_0x4e3d96[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x593723[_0x85eb('0x30')][_0x85eb('0x1c')]);}return _0x27ce2a['getConfigurations'](_0x4e3d96);}})[_0x85eb('0x25')](function(_0x143d65){if(_0x143d65){return _0x143d65?{'count':_0x249511,'rows':_0x143d65}:null;}})[_0x85eb('0x25')](respondWithResult(_0x39316d,null))[_0x85eb('0x40')](handleError(_0x39316d,null));};exports[_0x85eb('0x4e')]=function(_0x14cab8,_0x23fcf9,_0x5de716){if(_0x14cab8['body']['id']){delete _0x14cab8[_0x85eb('0x48')]['id'];}return db['ZendeskAccount'][_0x85eb('0x4b')]({'where':{'id':_0x14cab8[_0x85eb('0x42')]['id']}})[_0x85eb('0x25')](handleEntityNotFound(_0x23fcf9,null))[_0x85eb('0x25')](function(_0x259ee3){if(_0x259ee3){_0x14cab8['body'][_0x85eb('0x4f')]=_0x259ee3['id'];_0x14cab8[_0x85eb('0x48')][_0x85eb('0x50')]=integrations[_0x85eb('0x51')](_0x14cab8[_0x85eb('0x48')][_0x85eb('0x52')],_0x14cab8['body']['type']);_0x14cab8[_0x85eb('0x48')]['Descriptions']=integrations[_0x85eb('0x53')](_0x14cab8[_0x85eb('0x48')][_0x85eb('0x52')],_0x14cab8[_0x85eb('0x48')][_0x85eb('0x3c')]);return db[_0x85eb('0x4c')]['create'](_0x14cab8[_0x85eb('0x48')],{'include':[{'model':db[_0x85eb('0x54')],'as':_0x85eb('0x50')},{'model':db[_0x85eb('0x54')],'as':'Descriptions'}]});}return null;})[_0x85eb('0x25')](respondWithResult(_0x23fcf9,null))[_0x85eb('0x40')](handleError(_0x23fcf9,null));};exports[_0x85eb('0x55')]=function(_0x14bf0e,_0x5037c7,_0x459317){var _0x2e6734='';return db[_0x85eb('0x2b')][_0x85eb('0x4b')]({'where':{'id':_0x14bf0e[_0x85eb('0x42')]['id']},'attributes':['id',_0x85eb('0x56'),_0x85eb('0x57'),_0x85eb('0x58'),_0x85eb('0x59'),_0x85eb('0x5a')]})[_0x85eb('0x25')](handleEntityNotFound(_0x5037c7,null))[_0x85eb('0x25')](function(_0x1d9d3a){if(_0x1d9d3a){_0x2e6734=_0x1d9d3a[_0x85eb('0x5a')];var _0x2f2464=_0x2e6734[_0x85eb('0x5b')](-0x1);if(_0x2f2464==='/'){_0x2e6734=_0x2e6734[_0x85eb('0x5c')](0x0,_0x2e6734[_0x85eb('0x5d')](_0x2f2464));}var _0x106caa={'method':'GET','uri':util[_0x85eb('0x5e')]('%s/%s',_0x2e6734,_0x85eb('0x5f')),'json':!![]};switch(_0x1d9d3a[_0x85eb('0x59')]){case _0x85eb('0x57'):_0x106caa[_0x85eb('0x60')]={'Authorization':util[_0x85eb('0x5e')](_0x85eb('0x61'),new Buffer(util[_0x85eb('0x5e')](_0x85eb('0x62'),_0x1d9d3a[_0x85eb('0x56')],_0x1d9d3a['password']))[_0x85eb('0x63')](_0x85eb('0x64')))};break;case _0x85eb('0x58'):_0x106caa[_0x85eb('0x60')]={'Authorization':util[_0x85eb('0x5e')]('Basic\x20%s',new Buffer(util[_0x85eb('0x5e')]('%s/token:%s',_0x1d9d3a[_0x85eb('0x56')],_0x1d9d3a[_0x85eb('0x58')]))[_0x85eb('0x63')]('base64'))};break;default:throw new db[(_0x85eb('0x65'))][(_0x85eb('0x66'))](_0x85eb('0x67'));}return rp(_0x106caa);}})['then'](function(_0x588c72){if(_0x588c72){var _0x45a1ef=[_0x85eb('0x68'),_0x85eb('0x69'),_0x85eb('0x6a'),'assignee'];_[_0x85eb('0x6b')](_0x588c72['ticket_fields'],function(_0x11a3bd){return _0x45a1ef[_0x85eb('0x6c')](_0x11a3bd[_0x85eb('0x3c')]);});return{'count':_0x588c72[_0x85eb('0x5f')][_0x85eb('0x44')],'rows':_[_0x85eb('0x2a')](_0x588c72['ticket_fields'],function(_0x9a80a1){return{'id':_0x9a80a1['id'],'name':_0x9a80a1['position']>0x7?_0x9a80a1[_0x85eb('0x6d')]:_0x9a80a1[_0x85eb('0x3c')],'custom':_0x9a80a1[_0x85eb('0x6e')]>0x7?!![]:![],'options':_0x9a80a1[_0x85eb('0x6f')]?_0x9a80a1[_0x85eb('0x6f')]:_0x9a80a1[_0x85eb('0x70')]?_0x9a80a1[_0x85eb('0x70')]:[]};})};}})[_0x85eb('0x25')](respondWithResult(_0x5037c7,null))[_0x85eb('0x40')](function(_0x543146){var _0x3358c8=_0x14bf0e[_0x85eb('0x30')]['test']?0x1f4:_0x543146['statusCode']||0x1f4;logger[_0x85eb('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x85eb('0x55'),_0x3358c8,JSON['stringify'](_0x543146));delete _0x543146[_0x85eb('0x29')];if(_0x3358c8===0x191){_0x3358c8=0x190;}_0x5037c7['status'](_0x3358c8)[_0x85eb('0x71')](_0x14bf0e[_0x85eb('0x30')]['test']?{'message':_0x85eb('0x72'),'statusCode':_0x543146[_0x85eb('0x73')]}:_0x543146);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index b03186c..5ec1d5f 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 _0x2096=['lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x2096,0x144));var _0x6209=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x2096[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x6209('0x0'));var util=require(_0x6209('0x1'));var logger=require(_0x6209('0x2'))(_0x6209('0x3'));var moment=require(_0x6209('0x4'));var BPromise=require('bluebird');var rp=require(_0x6209('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6209('0x6'));var attributes=require(_0x6209('0x7'));var integrations=require(_0x6209('0x8'));module['exports']=function(_0x140258,_0x5bcf33){return _0x140258[_0x6209('0x9')](_0x6209('0xa'),attributes,{'tableName':_0x6209('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd169=['./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','util','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x507aff,_0x5426ba){var _0x5734f4=function(_0x19bfb9){while(--_0x19bfb9){_0x507aff['push'](_0x507aff['shift']());}};_0x5734f4(++_0x5426ba);}(_0xd169,0x73));var _0x9d16=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xd169[_0x68ee8b];return _0x5148f7;};'use strict';var _=require('lodash');var util=require(_0x9d16('0x0'));var logger=require('../../config/logger')(_0x9d16('0x1'));var moment=require(_0x9d16('0x2'));var BPromise=require(_0x9d16('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9d16('0x4'));var config=require(_0x9d16('0x5'));var attributes=require(_0x9d16('0x6'));var integrations=require(_0x9d16('0x7'));module['exports']=function(_0x4501b8,_0x5d8c39){return _0x4501b8[_0x9d16('0x8')](_0x9d16('0x9'),attributes,{'tableName':_0x9d16('0xa'),'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 85eb1e8..eec2c66 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 _0x41d9=['map','model','ShowZendeskAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZendeskAccount,\x20%s,\x20%s','info','result','catch','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','include'];(function(_0x1f9288,_0x96f5ad){var _0x25a400=function(_0x3b3ae4){while(--_0x3b3ae4){_0x1f9288['push'](_0x1f9288['shift']());}};_0x25a400(++_0x96f5ad);}(_0x41d9,0xf2));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x941d('0x0'));var util=require(_0x941d('0x1'));var moment=require(_0x941d('0x2'));var BPromise=require('bluebird');var rs=require(_0x941d('0x3'));var fs=require('fs');var Redis=require(_0x941d('0x4'));var db=require(_0x941d('0x5'))['db'];var utils=require(_0x941d('0x6'));var logger=require(_0x941d('0x7'))('rpc');var config=require(_0x941d('0x8'));var jayson=require(_0x941d('0x9'));var client=jayson[_0x941d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ba1b3,_0x32c72f,_0x164468){return new BPromise(function(_0x43f866,_0xa09aa){return client['request'](_0x1ba1b3,_0x164468)[_0x941d('0xb')](function(_0x3972a3){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x32c72f,_0x941d('0xc'));logger[_0x941d('0xd')](_0x941d('0xe'),_0x32c72f,_0x941d('0xc'),JSON[_0x941d('0xf')](_0x3972a3));if(_0x3972a3[_0x941d('0x10')]){if(_0x3972a3['error'][_0x941d('0x11')]===0x1f4){logger[_0x941d('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x32c72f,_0x3972a3[_0x941d('0x10')][_0x941d('0x12')]);return _0xa09aa(_0x3972a3[_0x941d('0x10')][_0x941d('0x12')]);}logger[_0x941d('0x10')](_0x941d('0x13'),_0x32c72f,_0x3972a3[_0x941d('0x10')][_0x941d('0x12')]);return _0x43f866(_0x3972a3['error'][_0x941d('0x12')]);}else{logger[_0x941d('0x14')](_0x941d('0x13'),_0x32c72f,_0x941d('0xc'));_0x43f866(_0x3972a3[_0x941d('0x15')][_0x941d('0x12')]);}})[_0x941d('0x16')](function(_0x181721){logger[_0x941d('0x10')](_0x941d('0x13'),_0x32c72f,_0x181721);_0xa09aa(_0x181721);});});}exports[_0x941d('0x17')]=function(_0x1da839){var _0x42b84e=this;return new Promise(function(_0x1cf3f1,_0x48cd07){return db[_0x941d('0x18')]['findAll']({'raw':_0x1da839[_0x941d('0x19')]?_0x1da839[_0x941d('0x19')][_0x941d('0x1a')]===undefined?!![]:![]:!![],'where':_0x1da839[_0x941d('0x19')]?_0x1da839[_0x941d('0x19')][_0x941d('0x1b')]||null:null,'attributes':_0x1da839['options']?_0x1da839[_0x941d('0x19')][_0x941d('0x1c')]||null:null,'limit':_0x1da839['options']?_0x1da839[_0x941d('0x19')]['limit']||null:null,'include':_0x1da839[_0x941d('0x19')]?_0x1da839[_0x941d('0x19')][_0x941d('0x1d')]?_[_0x941d('0x1e')](_0x1da839[_0x941d('0x19')][_0x941d('0x1d')],function(_0x5dee89){return{'model':db[_0x5dee89[_0x941d('0x1f')]],'as':_0x5dee89['as'],'attributes':_0x5dee89[_0x941d('0x1c')],'include':_0x5dee89[_0x941d('0x1d')]?_['map'](_0x5dee89['include'],function(_0x3459f0){return{'model':db[_0x3459f0[_0x941d('0x1f')]],'as':_0x3459f0['as'],'attributes':_0x3459f0[_0x941d('0x1c')],'include':_0x3459f0[_0x941d('0x1d')]?_[_0x941d('0x1e')](_0x3459f0[_0x941d('0x1d')],function(_0x76ec04){return{'model':db[_0x76ec04[_0x941d('0x1f')]],'as':_0x76ec04['as'],'attributes':_0x76ec04[_0x941d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x941d('0xb')](function(_0x271b66){logger[_0x941d('0x14')](_0x941d('0x17'),_0x1da839);logger[_0x941d('0xd')](_0x941d('0x17'),_0x1da839,JSON[_0x941d('0xf')](_0x271b66));_0x1cf3f1(_0x271b66);})['catch'](function(_0x589804){logger[_0x941d('0x10')](_0x941d('0x17'),_0x589804[_0x941d('0x12')],_0x1da839);_0x48cd07(_0x42b84e[_0x941d('0x10')](0x1f4,_0x589804[_0x941d('0x12')]));});});};exports[_0x941d('0x20')]=function(_0x2801d6){var _0x1aeb92=this;return new Promise(function(_0x5be0f7,_0x1d1b1d){return db['ZendeskAccount'][_0x941d('0x21')]({'raw':_0x2801d6['options']?_0x2801d6['options'][_0x941d('0x1a')]===undefined?!![]:![]:!![],'where':_0x2801d6['options']?_0x2801d6[_0x941d('0x19')][_0x941d('0x1b')]||null:null,'attributes':_0x2801d6[_0x941d('0x19')]?_0x2801d6[_0x941d('0x19')]['attributes']||null:null,'include':_0x2801d6[_0x941d('0x19')]?_0x2801d6['options'][_0x941d('0x1d')]?_[_0x941d('0x1e')](_0x2801d6[_0x941d('0x19')][_0x941d('0x1d')],function(_0x2cc861){return{'model':db[_0x2cc861[_0x941d('0x1f')]],'as':_0x2cc861['as'],'attributes':_0x2cc861[_0x941d('0x1c')],'include':_0x2cc861[_0x941d('0x1d')]?_[_0x941d('0x1e')](_0x2cc861[_0x941d('0x1d')],function(_0x168cb6){return{'model':db[_0x168cb6[_0x941d('0x1f')]],'as':_0x168cb6['as'],'attributes':_0x168cb6[_0x941d('0x1c')],'include':_0x168cb6['include']?_[_0x941d('0x1e')](_0x168cb6[_0x941d('0x1d')],function(_0x1ee44a){return{'model':db[_0x1ee44a[_0x941d('0x1f')]],'as':_0x1ee44a['as'],'attributes':_0x1ee44a[_0x941d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x941d('0xb')](function(_0x238a20){logger[_0x941d('0x14')](_0x941d('0x20'),_0x2801d6);logger[_0x941d('0xd')]('ShowZendeskAccount',_0x2801d6,JSON['stringify'](_0x238a20));_0x5be0f7(_0x238a20);})[_0x941d('0x16')](function(_0x271cdc){logger[_0x941d('0x10')](_0x941d('0x20'),_0x271cdc[_0x941d('0x12')],_0x2801d6);_0x1d1b1d(_0x1aeb92[_0x941d('0x10')](0x1f4,_0x271cdc[_0x941d('0x12')]));});});}; \ No newline at end of file +var _0x0b16=['attributes','find','ShowZendeskAccount','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetZendeskAccount','ZendeskAccount','options','raw','where','limit','include','map','model'];(function(_0x130544,_0xe17ab0){var _0x4aa8ce=function(_0x34818c){while(--_0x34818c){_0x130544['push'](_0x130544['shift']());}};_0x4aa8ce(++_0xe17ab0);}(_0x0b16,0x8f));var _0x60b1=function(_0x50d6da,_0x272005){_0x50d6da=_0x50d6da-0x0;var _0x42b20e=_0x0b16[_0x50d6da];return _0x42b20e;};'use strict';var _=require(_0x60b1('0x0'));var util=require('util');var moment=require(_0x60b1('0x1'));var BPromise=require(_0x60b1('0x2'));var rs=require(_0x60b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x60b1('0x4'));var logger=require(_0x60b1('0x5'))(_0x60b1('0x6'));var config=require(_0x60b1('0x7'));var jayson=require(_0x60b1('0x8'));var client=jayson['client'][_0x60b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x283276,_0x2d4f73,_0x2785b2){return new BPromise(function(_0x4ca70b,_0x2de0c9){return client[_0x60b1('0xa')](_0x283276,_0x2785b2)[_0x60b1('0xb')](function(_0x2b1d49){logger[_0x60b1('0xc')](_0x60b1('0xd'),_0x2d4f73,'request\x20sent');logger[_0x60b1('0xe')](_0x60b1('0xf'),_0x2d4f73,'request\x20sent',JSON[_0x60b1('0x10')](_0x2b1d49));if(_0x2b1d49[_0x60b1('0x11')]){if(_0x2b1d49['error'][_0x60b1('0x12')]===0x1f4){logger[_0x60b1('0x11')](_0x60b1('0xd'),_0x2d4f73,_0x2b1d49[_0x60b1('0x11')][_0x60b1('0x13')]);return _0x2de0c9(_0x2b1d49[_0x60b1('0x11')][_0x60b1('0x13')]);}logger[_0x60b1('0x11')](_0x60b1('0xd'),_0x2d4f73,_0x2b1d49[_0x60b1('0x11')]['message']);return _0x4ca70b(_0x2b1d49[_0x60b1('0x11')][_0x60b1('0x13')]);}else{logger[_0x60b1('0xc')](_0x60b1('0xd'),_0x2d4f73,_0x60b1('0x14'));_0x4ca70b(_0x2b1d49[_0x60b1('0x15')][_0x60b1('0x13')]);}})[_0x60b1('0x16')](function(_0x559d80){logger[_0x60b1('0x11')](_0x60b1('0xd'),_0x2d4f73,_0x559d80);_0x2de0c9(_0x559d80);});});}exports[_0x60b1('0x17')]=function(_0x2d38bc){var _0x314fbf=this;return new Promise(function(_0x2b9f01,_0x4b918b){return db[_0x60b1('0x18')]['findAll']({'raw':_0x2d38bc[_0x60b1('0x19')]?_0x2d38bc[_0x60b1('0x19')][_0x60b1('0x1a')]===undefined?!![]:![]:!![],'where':_0x2d38bc[_0x60b1('0x19')]?_0x2d38bc[_0x60b1('0x19')][_0x60b1('0x1b')]||null:null,'attributes':_0x2d38bc[_0x60b1('0x19')]?_0x2d38bc['options']['attributes']||null:null,'limit':_0x2d38bc['options']?_0x2d38bc[_0x60b1('0x19')][_0x60b1('0x1c')]||null:null,'include':_0x2d38bc[_0x60b1('0x19')]?_0x2d38bc[_0x60b1('0x19')][_0x60b1('0x1d')]?_[_0x60b1('0x1e')](_0x2d38bc[_0x60b1('0x19')]['include'],function(_0x262eb5){return{'model':db[_0x262eb5[_0x60b1('0x1f')]],'as':_0x262eb5['as'],'attributes':_0x262eb5[_0x60b1('0x20')],'include':_0x262eb5['include']?_[_0x60b1('0x1e')](_0x262eb5[_0x60b1('0x1d')],function(_0x221ebc){return{'model':db[_0x221ebc['model']],'as':_0x221ebc['as'],'attributes':_0x221ebc['attributes'],'include':_0x221ebc[_0x60b1('0x1d')]?_[_0x60b1('0x1e')](_0x221ebc[_0x60b1('0x1d')],function(_0x505724){return{'model':db[_0x505724[_0x60b1('0x1f')]],'as':_0x505724['as'],'attributes':_0x505724[_0x60b1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x60b1('0xb')](function(_0x1ef7a1){logger[_0x60b1('0xc')](_0x60b1('0x17'),_0x2d38bc);logger[_0x60b1('0xe')](_0x60b1('0x17'),_0x2d38bc,JSON[_0x60b1('0x10')](_0x1ef7a1));_0x2b9f01(_0x1ef7a1);})[_0x60b1('0x16')](function(_0x7765d2){logger[_0x60b1('0x11')](_0x60b1('0x17'),_0x7765d2['message'],_0x2d38bc);_0x4b918b(_0x314fbf['error'](0x1f4,_0x7765d2[_0x60b1('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x31877f){var _0x1e787b=this;return new Promise(function(_0x29813f,_0x53b807){return db[_0x60b1('0x18')][_0x60b1('0x21')]({'raw':_0x31877f[_0x60b1('0x19')]?_0x31877f[_0x60b1('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x31877f[_0x60b1('0x19')]?_0x31877f[_0x60b1('0x19')][_0x60b1('0x1b')]||null:null,'attributes':_0x31877f[_0x60b1('0x19')]?_0x31877f['options'][_0x60b1('0x20')]||null:null,'include':_0x31877f[_0x60b1('0x19')]?_0x31877f['options']['include']?_[_0x60b1('0x1e')](_0x31877f[_0x60b1('0x19')]['include'],function(_0x521e84){return{'model':db[_0x521e84[_0x60b1('0x1f')]],'as':_0x521e84['as'],'attributes':_0x521e84[_0x60b1('0x20')],'include':_0x521e84[_0x60b1('0x1d')]?_[_0x60b1('0x1e')](_0x521e84['include'],function(_0x20d345){return{'model':db[_0x20d345[_0x60b1('0x1f')]],'as':_0x20d345['as'],'attributes':_0x20d345[_0x60b1('0x20')],'include':_0x20d345[_0x60b1('0x1d')]?_['map'](_0x20d345[_0x60b1('0x1d')],function(_0x202284){return{'model':db[_0x202284[_0x60b1('0x1f')]],'as':_0x202284['as'],'attributes':_0x202284['attributes']};}):[]};}):[]};}):[]:[]})[_0x60b1('0xb')](function(_0x4a2f3c){logger['info']('ShowZendeskAccount',_0x31877f);logger[_0x60b1('0xe')](_0x60b1('0x22'),_0x31877f,JSON[_0x60b1('0x10')](_0x4a2f3c));_0x29813f(_0x4a2f3c);})[_0x60b1('0x16')](function(_0x7bf265){logger[_0x60b1('0x11')](_0x60b1('0x22'),_0x7bf265['message'],_0x31877f);_0x53b807(_0x1e787b[_0x60b1('0x11')](0x1f4,_0x7bf265[_0x60b1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index a75651a..0cfed94 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 _0x750a=['getTags','post','setTags','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/tags'];(function(_0x27f6e9,_0x122d0d){var _0x3e6914=function(_0xfdba77){while(--_0xfdba77){_0x27f6e9['push'](_0x27f6e9['shift']());}};_0x3e6914(++_0x122d0d);}(_0x750a,0x140));var _0xa750=function(_0x4082b3,_0x3c0799){_0x4082b3=_0x4082b3-0x0;var _0x21de29=_0x750a[_0x4082b3];return _0x21de29;};'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/subjects',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['get']('/:id/descriptions',auth[_0xa750('0x9')](),controller['getDescriptions']);router[_0xa750('0x8')](_0xa750('0xf'),auth['isAuthenticated'](),controller[_0xa750('0x10')]);router[_0xa750('0x11')]('/',auth[_0xa750('0x9')](),controller['create']);router[_0xa750('0x11')](_0xa750('0xf'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);router[_0xa750('0x13')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x14')]);router[_0xa750('0x15')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x16')]);module[_0xa750('0x17')]=router; \ No newline at end of file +var _0xe5b5=['../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xa0b885,_0x3dd58c){var _0x95c44a=function(_0x190dc6){while(--_0x190dc6){_0xa0b885['push'](_0xa0b885['shift']());}};_0x95c44a(++_0x3dd58c);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0xe5b5[_0x575a38];return _0x5a7bdd;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/subjects',auth[_0x5e5b('0xc')](),controller['getSubjects']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x5e5b('0x14')]);router[_0x5e5b('0x15')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x15')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),controller['setTags']);router[_0x5e5b('0x18')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x19')]);router['delete']('/:id',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x1a')]);module[_0x5e5b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 45bf522..b874184 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 _0xb8bb=['exports','STRING','sequelize'];(function(_0x597a73,_0x2bc496){var _0x233ea6=function(_0x5e8384){while(--_0x5e8384){_0x597a73['push'](_0x597a73['shift']());}};_0x233ea6(++_0x2bc496);}(_0xb8bb,0xec));var _0xbb8b=function(_0x55a0e6,_0x391e9d){_0x55a0e6=_0x55a0e6-0x0;var _0x36e35b=_0xb8bb[_0x55a0e6];return _0x36e35b;};'use strict';var Sequelize=require(_0xbb8b('0x0'));module[_0xbb8b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbb8b('0x2')]}}; \ No newline at end of file +var _0x4031=['STRING'];(function(_0x5a884f,_0x10d7c8){var _0x210d28=function(_0x376657){while(--_0x376657){_0x5a884f['push'](_0x5a884f['shift']());}};_0x210d28(++_0x10d7c8);}(_0x4031,0xdf));var _0x1403=function(_0x1911d8,_0x45ce58){_0x1911d8=_0x1911d8-0x0;var _0x86914d=_0x4031[_0x1911d8];return _0x86914d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1403('0x0')]},'description':{'type':Sequelize[_0x1403('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index cae7ed4..0569386 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 _0xfb5e=['then','include','rows','show','keys','includeAll','find','catch','create','body','update','params','getFields','findOne','ZendeskField','order','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','save','destroy','end','sendStatus','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options'];(function(_0x635589,_0x54ea94){var _0x14d71e=function(_0x145302){while(--_0x145302){_0x635589['push'](_0x635589['shift']());}};_0x14d71e(++_0x54ea94);}(_0xfb5e,0x1bb));var _0xefb5=function(_0x329421,_0xd2822d){_0x329421=_0x329421-0x0;var _0x499643=_0xfb5e[_0x329421];return _0x499643;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefb5('0x0'));var zipdir=require(_0xefb5('0x1'));var jsonpatch=require(_0xefb5('0x2'));var rp=require(_0xefb5('0x3'));var moment=require(_0xefb5('0x4'));var BPromise=require(_0xefb5('0x5'));var Mustache=require(_0xefb5('0x6'));var util=require(_0xefb5('0x7'));var path=require(_0xefb5('0x8'));var sox=require('sox');var csv=require(_0xefb5('0x9'));var ejs=require(_0xefb5('0xa'));var fs=require('fs');var fs_extra=require(_0xefb5('0xb'));var _=require(_0xefb5('0xc'));var squel=require(_0xefb5('0xd'));var crypto=require('crypto');var jsforce=require(_0xefb5('0xe'));var deskjs=require(_0xefb5('0xf'));var toCsv=require(_0xefb5('0x9'));var querystring=require(_0xefb5('0x10'));var Papa=require(_0xefb5('0x11'));var Redis=require(_0xefb5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xefb5('0x13'));var as=require(_0xefb5('0x14'));var hardwareService=require(_0xefb5('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xefb5('0x16'));var licenseUtil=require(_0xefb5('0x17'));var db=require(_0xefb5('0x18'))['db'];function respondWithStatusCode(_0x480dc8,_0x564893){_0x564893=_0x564893||0xcc;return function(_0xea5924){if(_0xea5924){return _0x480dc8['sendStatus'](_0x564893);}return _0x480dc8['status'](_0x564893)['end']();};}function respondWithResult(_0x318279,_0x470128){_0x470128=_0x470128||0xc8;return function(_0x3ca32d){if(_0x3ca32d){return _0x318279[_0xefb5('0x19')](_0x470128)[_0xefb5('0x1a')](_0x3ca32d);}};}function respondWithFilteredResult(_0x8d11b3,_0x4e09fc){return function(_0x5306de){if(_0x5306de){var _0x5ae195=typeof _0x4e09fc[_0xefb5('0x1b')]===_0xefb5('0x1c')&&typeof _0x4e09fc[_0xefb5('0x1d')]===_0xefb5('0x1c');var _0x28b80a=_0x5306de[_0xefb5('0x1e')];var _0x10202a=_0x5ae195?0x0:_0x4e09fc[_0xefb5('0x1b')];var _0x4faa44=_0x5ae195?_0x5306de[_0xefb5('0x1e')]:_0x4e09fc[_0xefb5('0x1b')]+_0x4e09fc[_0xefb5('0x1d')];var _0x3f943d;if(_0x4faa44>=_0x28b80a){_0x4faa44=_0x28b80a;_0x3f943d=0xc8;}else{_0x3f943d=0xce;}_0x8d11b3['status'](_0x3f943d);return _0x8d11b3['set'](_0xefb5('0x1f'),_0x10202a+'-'+_0x4faa44+'/'+_0x28b80a)[_0xefb5('0x1a')](_0x5306de);}return null;};}function patchUpdates(_0x1880da){return function(_0x13fe60){try{jsonpatch['apply'](_0x13fe60,_0x1880da,!![]);}catch(_0x3dcbca){return BPromise['reject'](_0x3dcbca);}return _0x13fe60[_0xefb5('0x20')]();};}function saveUpdates(_0x318f26,_0x52b955){return function(_0x5b8627){if(_0x5b8627){return _0x5b8627['update'](_0x318f26)['then'](function(_0x251531){return _0x251531;});}return null;};}function removeEntity(_0x5b0da8,_0x54c4d6){return function(_0x2c6db9){if(_0x2c6db9){return _0x2c6db9[_0xefb5('0x21')]()['then'](function(){_0x5b0da8[_0xefb5('0x19')](0xcc)[_0xefb5('0x22')]();});}};}function handleEntityNotFound(_0x5ccea7,_0x1b15c9){return function(_0x3f94ba){if(!_0x3f94ba){_0x5ccea7[_0xefb5('0x23')](0x194);}return _0x3f94ba;};}function handleError(_0xb52ce3,_0x31d6b6){_0x31d6b6=_0x31d6b6||0x1f4;return function(_0x5dcbf6){logger[_0xefb5('0x24')](_0x5dcbf6[_0xefb5('0x25')]);if(_0x5dcbf6[_0xefb5('0x26')]){delete _0x5dcbf6[_0xefb5('0x26')];}_0xb52ce3[_0xefb5('0x19')](_0x31d6b6)[_0xefb5('0x27')](_0x5dcbf6);};}exports[_0xefb5('0x28')]=function(_0x5c294c,_0x2ff9c7){var _0x4075dc={},_0x293a33={},_0x307d34={'count':0x0,'rows':[]};var _0x231419=_[_0xefb5('0x29')](db[_0xefb5('0x2a')][_0xefb5('0x2b')],function(_0x43d73a){return{'name':_0x43d73a[_0xefb5('0x2c')],'type':_0x43d73a[_0xefb5('0x2d')][_0xefb5('0x2e')]};});_0x293a33['model']=_[_0xefb5('0x29')](_0x231419,_0xefb5('0x26'));_0x293a33[_0xefb5('0x2f')]=_['keys'](_0x5c294c[_0xefb5('0x2f')]);_0x293a33[_0xefb5('0x30')]=_[_0xefb5('0x31')](_0x293a33[_0xefb5('0x32')],_0x293a33[_0xefb5('0x2f')]);_0x4075dc[_0xefb5('0x33')]=_['intersection'](_0x293a33[_0xefb5('0x32')],qs[_0xefb5('0x34')](_0x5c294c['query']['fields']));_0x4075dc[_0xefb5('0x33')]=_0x4075dc[_0xefb5('0x33')][_0xefb5('0x35')]?_0x4075dc[_0xefb5('0x33')]:_0x293a33[_0xefb5('0x32')];if(!_0x5c294c['query']['hasOwnProperty'](_0xefb5('0x36'))){_0x4075dc[_0xefb5('0x1d')]=qs['limit'](_0x5c294c['query'][_0xefb5('0x1d')]);_0x4075dc[_0xefb5('0x1b')]=qs[_0xefb5('0x1b')](_0x5c294c[_0xefb5('0x2f')][_0xefb5('0x1b')]);}_0x4075dc['order']=qs[_0xefb5('0x37')](_0x5c294c[_0xefb5('0x2f')][_0xefb5('0x37')]);_0x4075dc[_0xefb5('0x38')]=qs[_0xefb5('0x30')](_[_0xefb5('0x39')](_0x5c294c['query'],_0x293a33[_0xefb5('0x30')]),_0x231419);if(_0x5c294c[_0xefb5('0x2f')][_0xefb5('0x3a')]){_0x4075dc[_0xefb5('0x38')]=_['merge'](_0x4075dc[_0xefb5('0x38')],{'$or':_[_0xefb5('0x29')](_0x231419,function(_0x7cabd9){if(_0x7cabd9[_0xefb5('0x2d')]!=='VIRTUAL'){var _0x5e2394={};_0x5e2394[_0x7cabd9[_0xefb5('0x26')]]={'$like':'%'+_0x5c294c[_0xefb5('0x2f')][_0xefb5('0x3a')]+'%'};return _0x5e2394;}})});}_0x4075dc=_[_0xefb5('0x3b')]({},_0x4075dc,_0x5c294c[_0xefb5('0x3c')]);var _0x1b11be={'where':_0x4075dc[_0xefb5('0x38')]};return db[_0xefb5('0x2a')][_0xefb5('0x1e')](_0x1b11be)[_0xefb5('0x3d')](function(_0x33dbd1){_0x307d34[_0xefb5('0x1e')]=_0x33dbd1;if(_0x5c294c['query']['includeAll']){_0x4075dc[_0xefb5('0x3e')]=[{'all':!![]}];}return db[_0xefb5('0x2a')]['findAll'](_0x4075dc);})[_0xefb5('0x3d')](function(_0x5a18ce){_0x307d34[_0xefb5('0x3f')]=_0x5a18ce;return _0x307d34;})[_0xefb5('0x3d')](respondWithFilteredResult(_0x2ff9c7,_0x4075dc))['catch'](handleError(_0x2ff9c7,null));};exports[_0xefb5('0x40')]=function(_0x2cb7bc,_0x3fdcd7){var _0x1f5f95={'raw':![],'where':{'id':_0x2cb7bc['params']['id']}},_0x221ae1={};_0x221ae1[_0xefb5('0x32')]=_[_0xefb5('0x41')](db[_0xefb5('0x2a')]['rawAttributes']);_0x221ae1[_0xefb5('0x2f')]=_['keys'](_0x2cb7bc['query']);_0x221ae1['filters']=_['intersection'](_0x221ae1[_0xefb5('0x32')],_0x221ae1['query']);_0x1f5f95[_0xefb5('0x33')]=_[_0xefb5('0x31')](_0x221ae1[_0xefb5('0x32')],qs[_0xefb5('0x34')](_0x2cb7bc[_0xefb5('0x2f')][_0xefb5('0x34')]));_0x1f5f95['attributes']=_0x1f5f95[_0xefb5('0x33')][_0xefb5('0x35')]?_0x1f5f95[_0xefb5('0x33')]:_0x221ae1[_0xefb5('0x32')];if(_0x2cb7bc['query'][_0xefb5('0x42')]){_0x1f5f95[_0xefb5('0x3e')]=[{'all':!![]}];}_0x1f5f95=_[_0xefb5('0x3b')]({},_0x1f5f95,_0x2cb7bc[_0xefb5('0x3c')]);return db[_0xefb5('0x2a')][_0xefb5('0x43')](_0x1f5f95)['then'](handleEntityNotFound(_0x3fdcd7,null))[_0xefb5('0x3d')](respondWithResult(_0x3fdcd7,null))[_0xefb5('0x44')](handleError(_0x3fdcd7,null));};exports[_0xefb5('0x45')]=function(_0x1f743f,_0x496317){return db[_0xefb5('0x2a')][_0xefb5('0x45')](_0x1f743f[_0xefb5('0x46')],{})['then'](respondWithResult(_0x496317,0xc9))[_0xefb5('0x44')](handleError(_0x496317,null));};exports[_0xefb5('0x47')]=function(_0x52303f,_0x3bd43b){if(_0x52303f[_0xefb5('0x46')]['id']){delete _0x52303f[_0xefb5('0x46')]['id'];}return db[_0xefb5('0x2a')]['find']({'where':{'id':_0x52303f[_0xefb5('0x48')]['id']}})[_0xefb5('0x3d')](handleEntityNotFound(_0x3bd43b,null))[_0xefb5('0x3d')](saveUpdates(_0x52303f[_0xefb5('0x46')],null))[_0xefb5('0x3d')](respondWithResult(_0x3bd43b,null))[_0xefb5('0x44')](handleError(_0x3bd43b,null));};exports['destroy']=function(_0x66d9d8,_0x4debeb){return db[_0xefb5('0x2a')][_0xefb5('0x43')]({'where':{'id':_0x66d9d8[_0xefb5('0x48')]['id']}})[_0xefb5('0x3d')](handleEntityNotFound(_0x4debeb,null))[_0xefb5('0x3d')](removeEntity(_0x4debeb,null))['catch'](handleError(_0x4debeb,null));};exports[_0xefb5('0x49')]=function(_0x3137ea,_0x3e5ac3,_0x10b98c){var _0x34e0bd={};var _0x1652b4={};var _0x1e3315;var _0x3c7764;return db[_0xefb5('0x2a')][_0xefb5('0x4a')]({'where':{'id':_0x3137ea[_0xefb5('0x48')]['id']}})[_0xefb5('0x3d')](handleEntityNotFound(_0x3e5ac3,null))[_0xefb5('0x3d')](function(_0x3c9125){if(_0x3c9125){_0x1e3315=_0x3c9125;_0x1652b4[_0xefb5('0x32')]=_[_0xefb5('0x41')](db[_0xefb5('0x4b')][_0xefb5('0x2b')]);_0x1652b4['query']=_['keys'](_0x3137ea[_0xefb5('0x2f')]);_0x1652b4[_0xefb5('0x30')]=_[_0xefb5('0x31')](_0x1652b4[_0xefb5('0x32')],_0x1652b4['query']);_0x34e0bd[_0xefb5('0x33')]=_['intersection'](_0x1652b4[_0xefb5('0x32')],qs[_0xefb5('0x34')](_0x3137ea['query'][_0xefb5('0x34')]));_0x34e0bd[_0xefb5('0x33')]=_0x34e0bd[_0xefb5('0x33')][_0xefb5('0x35')]?_0x34e0bd[_0xefb5('0x33')]:_0x1652b4['model'];_0x34e0bd[_0xefb5('0x4c')]=qs[_0xefb5('0x37')](_0x3137ea[_0xefb5('0x2f')]['sort']);_0x34e0bd[_0xefb5('0x38')]=qs[_0xefb5('0x30')](_['pick'](_0x3137ea[_0xefb5('0x2f')],_0x1652b4[_0xefb5('0x30')]));if(_0x3137ea['query'][_0xefb5('0x3a')]){_0x34e0bd[_0xefb5('0x38')]=_[_0xefb5('0x3b')](_0x34e0bd[_0xefb5('0x38')],{'$or':_[_0xefb5('0x29')](_0x34e0bd[_0xefb5('0x33')],function(_0x129960){var _0x3bdfd2={};_0x3bdfd2[_0x129960]={'$like':'%'+_0x3137ea['query'][_0xefb5('0x3a')]+'%'};return _0x3bdfd2;})});}_0x34e0bd=_[_0xefb5('0x3b')]({},_0x34e0bd,_0x3137ea[_0xefb5('0x3c')]);return _0x1e3315[_0xefb5('0x49')](_0x34e0bd);}})['then'](function(_0x2fcdb0){if(_0x2fcdb0){_0x3c7764=_0x2fcdb0['length'];if(!_0x3137ea[_0xefb5('0x2f')][_0xefb5('0x4d')]('nolimit')){_0x34e0bd[_0xefb5('0x1d')]=qs[_0xefb5('0x1d')](_0x3137ea['query']['limit']);_0x34e0bd['offset']=qs[_0xefb5('0x1b')](_0x3137ea[_0xefb5('0x2f')][_0xefb5('0x1b')]);}return _0x1e3315[_0xefb5('0x49')](_0x34e0bd);}})[_0xefb5('0x3d')](function(_0x3c3b88){if(_0x3c3b88){return _0x3c3b88?{'count':_0x3c7764,'rows':_0x3c3b88}:null;}})['then'](respondWithResult(_0x3e5ac3,null))[_0xefb5('0x44')](handleError(_0x3e5ac3,null));};exports[_0xefb5('0x4e')]=function(_0x478f01,_0x40e0a4,_0x7f40b6){var _0x33cc07={};var _0x2a3f44={};var _0xb0abe6;var _0x1dcdca;return db[_0xefb5('0x2a')][_0xefb5('0x4a')]({'where':{'id':_0x478f01[_0xefb5('0x48')]['id']}})[_0xefb5('0x3d')](handleEntityNotFound(_0x40e0a4,null))[_0xefb5('0x3d')](function(_0x21666f){if(_0x21666f){_0xb0abe6=_0x21666f;_0x2a3f44[_0xefb5('0x32')]=_['keys'](db[_0xefb5('0x4b')]['rawAttributes']);_0x2a3f44[_0xefb5('0x2f')]=_[_0xefb5('0x41')](_0x478f01['query']);_0x2a3f44[_0xefb5('0x30')]=_[_0xefb5('0x31')](_0x2a3f44['model'],_0x2a3f44[_0xefb5('0x2f')]);_0x33cc07['attributes']=_['intersection'](_0x2a3f44[_0xefb5('0x32')],qs['fields'](_0x478f01['query'][_0xefb5('0x34')]));_0x33cc07[_0xefb5('0x33')]=_0x33cc07[_0xefb5('0x33')][_0xefb5('0x35')]?_0x33cc07['attributes']:_0x2a3f44[_0xefb5('0x32')];_0x33cc07[_0xefb5('0x4c')]=qs[_0xefb5('0x37')](_0x478f01[_0xefb5('0x2f')][_0xefb5('0x37')]);_0x33cc07[_0xefb5('0x38')]=qs[_0xefb5('0x30')](_[_0xefb5('0x39')](_0x478f01[_0xefb5('0x2f')],_0x2a3f44['filters']));if(_0x478f01[_0xefb5('0x2f')]['filter']){_0x33cc07[_0xefb5('0x38')]=_['merge'](_0x33cc07[_0xefb5('0x38')],{'$or':_[_0xefb5('0x29')](_0x33cc07[_0xefb5('0x33')],function(_0x328148){var _0x15b2c0={};_0x15b2c0[_0x328148]={'$like':'%'+_0x478f01[_0xefb5('0x2f')][_0xefb5('0x3a')]+'%'};return _0x15b2c0;})});}_0x33cc07=_[_0xefb5('0x3b')]({},_0x33cc07,_0x478f01[_0xefb5('0x3c')]);return _0xb0abe6[_0xefb5('0x4e')](_0x33cc07);}})[_0xefb5('0x3d')](function(_0x3119cb){if(_0x3119cb){_0x1dcdca=_0x3119cb['length'];if(!_0x478f01[_0xefb5('0x2f')][_0xefb5('0x4d')](_0xefb5('0x36'))){_0x33cc07['limit']=qs[_0xefb5('0x1d')](_0x478f01[_0xefb5('0x2f')]['limit']);_0x33cc07['offset']=qs[_0xefb5('0x1b')](_0x478f01[_0xefb5('0x2f')][_0xefb5('0x1b')]);}return _0xb0abe6[_0xefb5('0x4e')](_0x33cc07);}})['then'](function(_0x810974){if(_0x810974){return _0x810974?{'count':_0x1dcdca,'rows':_0x810974}:null;}})[_0xefb5('0x3d')](respondWithResult(_0x40e0a4,null))[_0xefb5('0x44')](handleError(_0x40e0a4,null));};exports[_0xefb5('0x4f')]=function(_0x13a6da,_0x5bef47,_0xf72714){var _0x305dcf={};var _0x39b30a={};var _0x4af038;var _0x1ef319;return db[_0xefb5('0x2a')][_0xefb5('0x4a')]({'where':{'id':_0x13a6da[_0xefb5('0x48')]['id']}})['then'](handleEntityNotFound(_0x5bef47,null))[_0xefb5('0x3d')](function(_0x46cda9){if(_0x46cda9){_0x4af038=_0x46cda9;_0x39b30a[_0xefb5('0x32')]=_[_0xefb5('0x41')](db[_0xefb5('0x4b')]['rawAttributes']);_0x39b30a[_0xefb5('0x2f')]=_[_0xefb5('0x41')](_0x13a6da['query']);_0x39b30a[_0xefb5('0x30')]=_[_0xefb5('0x31')](_0x39b30a[_0xefb5('0x32')],_0x39b30a[_0xefb5('0x2f')]);_0x305dcf[_0xefb5('0x33')]=_[_0xefb5('0x31')](_0x39b30a[_0xefb5('0x32')],qs[_0xefb5('0x34')](_0x13a6da['query'][_0xefb5('0x34')]));_0x305dcf[_0xefb5('0x33')]=_0x305dcf['attributes'][_0xefb5('0x35')]?_0x305dcf[_0xefb5('0x33')]:_0x39b30a[_0xefb5('0x32')];_0x305dcf[_0xefb5('0x4c')]=qs['sort'](_0x13a6da[_0xefb5('0x2f')][_0xefb5('0x37')]);_0x305dcf[_0xefb5('0x38')]=qs[_0xefb5('0x30')](_['pick'](_0x13a6da[_0xefb5('0x2f')],_0x39b30a[_0xefb5('0x30')]));if(_0x13a6da['query'][_0xefb5('0x3a')]){_0x305dcf['where']=_['merge'](_0x305dcf[_0xefb5('0x38')],{'$or':_['map'](_0x305dcf[_0xefb5('0x33')],function(_0xf11f81){var _0x54fcb5={};_0x54fcb5[_0xf11f81]={'$like':'%'+_0x13a6da[_0xefb5('0x2f')]['filter']+'%'};return _0x54fcb5;})});}_0x305dcf=_[_0xefb5('0x3b')]({},_0x305dcf,_0x13a6da['options']);return _0x4af038[_0xefb5('0x4f')](_0x305dcf);}})['then'](function(_0x57bb72){if(_0x57bb72){_0x1ef319=_0x57bb72['length'];if(!_0x13a6da['query'][_0xefb5('0x4d')](_0xefb5('0x36'))){_0x305dcf['limit']=qs[_0xefb5('0x1d')](_0x13a6da[_0xefb5('0x2f')][_0xefb5('0x1d')]);_0x305dcf['offset']=qs[_0xefb5('0x1b')](_0x13a6da['query'][_0xefb5('0x1b')]);}return _0x4af038[_0xefb5('0x4f')](_0x305dcf);}})[_0xefb5('0x3d')](function(_0x251a55){if(_0x251a55){return _0x251a55?{'count':_0x1ef319,'rows':_0x251a55}:null;}})[_0xefb5('0x3d')](respondWithResult(_0x5bef47,null))[_0xefb5('0x44')](handleError(_0x5bef47,null));};exports[_0xefb5('0x50')]=function(_0x58c206,_0x3e43c5,_0x476aea){var _0x136262={};var _0x5e1ca1={};var _0x3cc214;var _0x20dbd8;return db[_0xefb5('0x2a')][_0xefb5('0x4a')]({'where':{'id':_0x58c206[_0xefb5('0x48')]['id']}})['then'](handleEntityNotFound(_0x3e43c5,null))[_0xefb5('0x3d')](function(_0x51e726){if(_0x51e726){_0x3cc214=_0x51e726;_0x5e1ca1[_0xefb5('0x32')]=_[_0xefb5('0x41')](db[_0xefb5('0x51')][_0xefb5('0x2b')]);_0x5e1ca1['query']=_[_0xefb5('0x41')](_0x58c206['query']);_0x5e1ca1[_0xefb5('0x30')]=_[_0xefb5('0x31')](_0x5e1ca1[_0xefb5('0x32')],_0x5e1ca1[_0xefb5('0x2f')]);_0x136262['attributes']=_[_0xefb5('0x31')](_0x5e1ca1[_0xefb5('0x32')],qs[_0xefb5('0x34')](_0x58c206['query'][_0xefb5('0x34')]));_0x136262[_0xefb5('0x33')]=_0x136262[_0xefb5('0x33')][_0xefb5('0x35')]?_0x136262[_0xefb5('0x33')]:_0x5e1ca1[_0xefb5('0x32')];_0x136262[_0xefb5('0x4c')]=qs[_0xefb5('0x37')](_0x58c206[_0xefb5('0x2f')][_0xefb5('0x37')]);_0x136262['where']=qs['filters'](_[_0xefb5('0x39')](_0x58c206['query'],_0x5e1ca1[_0xefb5('0x30')]));if(_0x58c206['query']['filter']){_0x136262['where']=_[_0xefb5('0x3b')](_0x136262[_0xefb5('0x38')],{'$or':_[_0xefb5('0x29')](_0x136262[_0xefb5('0x33')],function(_0x324792){var _0x274ff3={};_0x274ff3[_0x324792]={'$like':'%'+_0x58c206[_0xefb5('0x2f')][_0xefb5('0x3a')]+'%'};return _0x274ff3;})});}_0x136262=_[_0xefb5('0x3b')]({},_0x136262,_0x58c206[_0xefb5('0x3c')]);return _0x3cc214['getTags'](_0x136262);}})[_0xefb5('0x3d')](function(_0x43d7d1){if(_0x43d7d1){_0x20dbd8=_0x43d7d1[_0xefb5('0x35')];if(!_0x58c206[_0xefb5('0x2f')]['hasOwnProperty'](_0xefb5('0x36'))){_0x136262[_0xefb5('0x1d')]=qs[_0xefb5('0x1d')](_0x58c206[_0xefb5('0x2f')][_0xefb5('0x1d')]);_0x136262[_0xefb5('0x1b')]=qs[_0xefb5('0x1b')](_0x58c206[_0xefb5('0x2f')][_0xefb5('0x1b')]);}return _0x3cc214[_0xefb5('0x50')](_0x136262);}})[_0xefb5('0x3d')](function(_0x4662b3){if(_0x4662b3){return _0x4662b3?{'count':_0x20dbd8,'rows':_0x4662b3}:null;}})['then'](respondWithResult(_0x3e43c5,null))[_0xefb5('0x44')](handleError(_0x3e43c5,null));};exports[_0xefb5('0x52')]=function(_0x2cdc0e,_0x31de31,_0xeedaf5){if(_0x2cdc0e[_0xefb5('0x46')]['id']){delete _0x2cdc0e[_0xefb5('0x46')]['id'];}return db[_0xefb5('0x2a')][_0xefb5('0x4a')]({'where':{'id':_0x2cdc0e[_0xefb5('0x48')]['id']}})[_0xefb5('0x3d')](handleEntityNotFound(_0x31de31,null))[_0xefb5('0x3d')](function(_0x4bc786){if(_0x4bc786){return _0x4bc786[_0xefb5('0x52')](_0x2cdc0e[_0xefb5('0x46')][_0xefb5('0x53')]||[]);}return null;})['then'](respondWithResult(_0x31de31,null))[_0xefb5('0x44')](handleError(_0x31de31,null));}; \ No newline at end of file +var _0xee3c=['then','destroy','end','error','stack','name','send','ZendeskConfiguration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','include','rows','catch','keys','includeAll','find','create','body','params','getFields','findOne','ZendeskField','rawAttributes','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update'];(function(_0x5e909d,_0xcb0787){var _0x4cf7b5=function(_0x4581c6){while(--_0x4581c6){_0x5e909d['push'](_0x5e909d['shift']());}};_0x4cf7b5(++_0xcb0787);}(_0xee3c,0x138));var _0xcee3=function(_0x4af857,_0x16d3a3){_0x4af857=_0x4af857-0x0;var _0xd29c71=_0xee3c[_0x4af857];return _0xd29c71;};'use strict';var emlformat=require(_0xcee3('0x0'));var rimraf=require(_0xcee3('0x1'));var zipdir=require(_0xcee3('0x2'));var jsonpatch=require(_0xcee3('0x3'));var rp=require(_0xcee3('0x4'));var moment=require(_0xcee3('0x5'));var BPromise=require(_0xcee3('0x6'));var Mustache=require(_0xcee3('0x7'));var util=require('util');var path=require(_0xcee3('0x8'));var sox=require(_0xcee3('0x9'));var csv=require('to-csv');var ejs=require(_0xcee3('0xa'));var fs=require('fs');var fs_extra=require(_0xcee3('0xb'));var _=require(_0xcee3('0xc'));var squel=require(_0xcee3('0xd'));var crypto=require(_0xcee3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcee3('0xf'));var toCsv=require(_0xcee3('0x10'));var querystring=require(_0xcee3('0x11'));var Papa=require(_0xcee3('0x12'));var Redis=require(_0xcee3('0x13'));var authService=require(_0xcee3('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcee3('0x15'));var hardwareService=require(_0xcee3('0x16'));var logger=require(_0xcee3('0x17'))(_0xcee3('0x18'));var utils=require(_0xcee3('0x19'));var config=require(_0xcee3('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xcee3('0x1b'))['db'];function respondWithStatusCode(_0x3c5b12,_0x18a077){_0x18a077=_0x18a077||0xcc;return function(_0x359161){if(_0x359161){return _0x3c5b12[_0xcee3('0x1c')](_0x18a077);}return _0x3c5b12[_0xcee3('0x1d')](_0x18a077)['end']();};}function respondWithResult(_0x372b97,_0x37908e){_0x37908e=_0x37908e||0xc8;return function(_0x2fa2b8){if(_0x2fa2b8){return _0x372b97[_0xcee3('0x1d')](_0x37908e)['json'](_0x2fa2b8);}};}function respondWithFilteredResult(_0x369d3c,_0x74bedd){return function(_0x511954){if(_0x511954){var _0x48f044=typeof _0x74bedd['offset']===_0xcee3('0x1e')&&typeof _0x74bedd['limit']===_0xcee3('0x1e');var _0x494e1c=_0x511954[_0xcee3('0x1f')];var _0x48aa24=_0x48f044?0x0:_0x74bedd['offset'];var _0x9f50fa=_0x48f044?_0x511954[_0xcee3('0x1f')]:_0x74bedd[_0xcee3('0x20')]+_0x74bedd[_0xcee3('0x21')];var _0x3df0a5;if(_0x9f50fa>=_0x494e1c){_0x9f50fa=_0x494e1c;_0x3df0a5=0xc8;}else{_0x3df0a5=0xce;}_0x369d3c[_0xcee3('0x1d')](_0x3df0a5);return _0x369d3c['set'](_0xcee3('0x22'),_0x48aa24+'-'+_0x9f50fa+'/'+_0x494e1c)[_0xcee3('0x23')](_0x511954);}return null;};}function patchUpdates(_0x1b80f6){return function(_0x5e4eed){try{jsonpatch[_0xcee3('0x24')](_0x5e4eed,_0x1b80f6,!![]);}catch(_0x3621f8){return BPromise[_0xcee3('0x25')](_0x3621f8);}return _0x5e4eed[_0xcee3('0x26')]();};}function saveUpdates(_0x5a39d1,_0x85c5dc){return function(_0x1e7845){if(_0x1e7845){return _0x1e7845[_0xcee3('0x27')](_0x5a39d1)[_0xcee3('0x28')](function(_0x3c02e0){return _0x3c02e0;});}return null;};}function removeEntity(_0x19e854,_0xb15580){return function(_0x1c6709){if(_0x1c6709){return _0x1c6709[_0xcee3('0x29')]()[_0xcee3('0x28')](function(){_0x19e854[_0xcee3('0x1d')](0xcc)[_0xcee3('0x2a')]();});}};}function handleEntityNotFound(_0x2c07e8,_0x5e89c3){return function(_0x3614cb){if(!_0x3614cb){_0x2c07e8['sendStatus'](0x194);}return _0x3614cb;};}function handleError(_0x478573,_0x144be4){_0x144be4=_0x144be4||0x1f4;return function(_0x110b11){logger[_0xcee3('0x2b')](_0x110b11[_0xcee3('0x2c')]);if(_0x110b11[_0xcee3('0x2d')]){delete _0x110b11[_0xcee3('0x2d')];}_0x478573[_0xcee3('0x1d')](_0x144be4)[_0xcee3('0x2e')](_0x110b11);};}exports['index']=function(_0x1d8b2f,_0x5a74f1){var _0x18f55b={},_0x5639c6={},_0x190eaf={'count':0x0,'rows':[]};var _0x1ee8fc=_['map'](db[_0xcee3('0x2f')]['rawAttributes'],function(_0x558229){return{'name':_0x558229[_0xcee3('0x30')],'type':_0x558229[_0xcee3('0x31')][_0xcee3('0x32')]};});_0x5639c6[_0xcee3('0x33')]=_['map'](_0x1ee8fc,_0xcee3('0x2d'));_0x5639c6[_0xcee3('0x34')]=_['keys'](_0x1d8b2f[_0xcee3('0x34')]);_0x5639c6[_0xcee3('0x35')]=_[_0xcee3('0x36')](_0x5639c6['model'],_0x5639c6[_0xcee3('0x34')]);_0x18f55b[_0xcee3('0x37')]=_['intersection'](_0x5639c6['model'],qs[_0xcee3('0x38')](_0x1d8b2f[_0xcee3('0x34')][_0xcee3('0x38')]));_0x18f55b['attributes']=_0x18f55b['attributes'][_0xcee3('0x39')]?_0x18f55b[_0xcee3('0x37')]:_0x5639c6[_0xcee3('0x33')];if(!_0x1d8b2f['query'][_0xcee3('0x3a')](_0xcee3('0x3b'))){_0x18f55b[_0xcee3('0x21')]=qs[_0xcee3('0x21')](_0x1d8b2f[_0xcee3('0x34')][_0xcee3('0x21')]);_0x18f55b[_0xcee3('0x20')]=qs[_0xcee3('0x20')](_0x1d8b2f[_0xcee3('0x34')][_0xcee3('0x20')]);}_0x18f55b[_0xcee3('0x3c')]=qs[_0xcee3('0x3d')](_0x1d8b2f[_0xcee3('0x34')][_0xcee3('0x3d')]);_0x18f55b[_0xcee3('0x3e')]=qs['filters'](_[_0xcee3('0x3f')](_0x1d8b2f[_0xcee3('0x34')],_0x5639c6[_0xcee3('0x35')]),_0x1ee8fc);if(_0x1d8b2f['query'][_0xcee3('0x40')]){_0x18f55b['where']=_['merge'](_0x18f55b[_0xcee3('0x3e')],{'$or':_[_0xcee3('0x41')](_0x1ee8fc,function(_0x25d701){if(_0x25d701[_0xcee3('0x31')]!==_0xcee3('0x42')){var _0x356d30={};_0x356d30[_0x25d701[_0xcee3('0x2d')]]={'$like':'%'+_0x1d8b2f[_0xcee3('0x34')][_0xcee3('0x40')]+'%'};return _0x356d30;}})});}_0x18f55b=_[_0xcee3('0x43')]({},_0x18f55b,_0x1d8b2f[_0xcee3('0x44')]);var _0x8dfdc9={'where':_0x18f55b[_0xcee3('0x3e')]};return db[_0xcee3('0x2f')][_0xcee3('0x1f')](_0x8dfdc9)['then'](function(_0x4d28bc){_0x190eaf['count']=_0x4d28bc;if(_0x1d8b2f[_0xcee3('0x34')]['includeAll']){_0x18f55b[_0xcee3('0x45')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x18f55b);})['then'](function(_0x46d1f0){_0x190eaf[_0xcee3('0x46')]=_0x46d1f0;return _0x190eaf;})['then'](respondWithFilteredResult(_0x5a74f1,_0x18f55b))[_0xcee3('0x47')](handleError(_0x5a74f1,null));};exports['show']=function(_0x14143e,_0x27f5f6){var _0x2e36ff={'raw':![],'where':{'id':_0x14143e['params']['id']}},_0x22e53d={};_0x22e53d[_0xcee3('0x33')]=_[_0xcee3('0x48')](db[_0xcee3('0x2f')]['rawAttributes']);_0x22e53d[_0xcee3('0x34')]=_[_0xcee3('0x48')](_0x14143e[_0xcee3('0x34')]);_0x22e53d[_0xcee3('0x35')]=_['intersection'](_0x22e53d[_0xcee3('0x33')],_0x22e53d[_0xcee3('0x34')]);_0x2e36ff[_0xcee3('0x37')]=_['intersection'](_0x22e53d['model'],qs[_0xcee3('0x38')](_0x14143e['query'][_0xcee3('0x38')]));_0x2e36ff[_0xcee3('0x37')]=_0x2e36ff[_0xcee3('0x37')][_0xcee3('0x39')]?_0x2e36ff[_0xcee3('0x37')]:_0x22e53d[_0xcee3('0x33')];if(_0x14143e[_0xcee3('0x34')][_0xcee3('0x49')]){_0x2e36ff['include']=[{'all':!![]}];}_0x2e36ff=_[_0xcee3('0x43')]({},_0x2e36ff,_0x14143e[_0xcee3('0x44')]);return db[_0xcee3('0x2f')][_0xcee3('0x4a')](_0x2e36ff)[_0xcee3('0x28')](handleEntityNotFound(_0x27f5f6,null))['then'](respondWithResult(_0x27f5f6,null))[_0xcee3('0x47')](handleError(_0x27f5f6,null));};exports[_0xcee3('0x4b')]=function(_0x30d344,_0x11e091){return db['ZendeskConfiguration'][_0xcee3('0x4b')](_0x30d344[_0xcee3('0x4c')],{})['then'](respondWithResult(_0x11e091,0xc9))['catch'](handleError(_0x11e091,null));};exports[_0xcee3('0x27')]=function(_0x3ab09c,_0x5a69be){if(_0x3ab09c['body']['id']){delete _0x3ab09c['body']['id'];}return db[_0xcee3('0x2f')][_0xcee3('0x4a')]({'where':{'id':_0x3ab09c[_0xcee3('0x4d')]['id']}})[_0xcee3('0x28')](handleEntityNotFound(_0x5a69be,null))[_0xcee3('0x28')](saveUpdates(_0x3ab09c[_0xcee3('0x4c')],null))[_0xcee3('0x28')](respondWithResult(_0x5a69be,null))[_0xcee3('0x47')](handleError(_0x5a69be,null));};exports[_0xcee3('0x29')]=function(_0x9f9023,_0x19e145){return db[_0xcee3('0x2f')]['find']({'where':{'id':_0x9f9023['params']['id']}})[_0xcee3('0x28')](handleEntityNotFound(_0x19e145,null))['then'](removeEntity(_0x19e145,null))[_0xcee3('0x47')](handleError(_0x19e145,null));};exports[_0xcee3('0x4e')]=function(_0x48781f,_0x40fada,_0x3ed8b2){var _0x46e120={};var _0x56925c={};var _0x5a4e0a;var _0x30f19a;return db['ZendeskConfiguration'][_0xcee3('0x4f')]({'where':{'id':_0x48781f[_0xcee3('0x4d')]['id']}})[_0xcee3('0x28')](handleEntityNotFound(_0x40fada,null))[_0xcee3('0x28')](function(_0x5e1006){if(_0x5e1006){_0x5a4e0a=_0x5e1006;_0x56925c[_0xcee3('0x33')]=_[_0xcee3('0x48')](db[_0xcee3('0x50')][_0xcee3('0x51')]);_0x56925c['query']=_['keys'](_0x48781f['query']);_0x56925c[_0xcee3('0x35')]=_['intersection'](_0x56925c[_0xcee3('0x33')],_0x56925c[_0xcee3('0x34')]);_0x46e120[_0xcee3('0x37')]=_[_0xcee3('0x36')](_0x56925c[_0xcee3('0x33')],qs['fields'](_0x48781f[_0xcee3('0x34')]['fields']));_0x46e120[_0xcee3('0x37')]=_0x46e120[_0xcee3('0x37')][_0xcee3('0x39')]?_0x46e120['attributes']:_0x56925c[_0xcee3('0x33')];_0x46e120['order']=qs['sort'](_0x48781f[_0xcee3('0x34')]['sort']);_0x46e120[_0xcee3('0x3e')]=qs['filters'](_[_0xcee3('0x3f')](_0x48781f['query'],_0x56925c[_0xcee3('0x35')]));if(_0x48781f[_0xcee3('0x34')][_0xcee3('0x40')]){_0x46e120[_0xcee3('0x3e')]=_[_0xcee3('0x43')](_0x46e120[_0xcee3('0x3e')],{'$or':_[_0xcee3('0x41')](_0x46e120[_0xcee3('0x37')],function(_0x33ffc5){var _0x4f8efc={};_0x4f8efc[_0x33ffc5]={'$like':'%'+_0x48781f['query'][_0xcee3('0x40')]+'%'};return _0x4f8efc;})});}_0x46e120=_[_0xcee3('0x43')]({},_0x46e120,_0x48781f[_0xcee3('0x44')]);return _0x5a4e0a['getFields'](_0x46e120);}})[_0xcee3('0x28')](function(_0x571592){if(_0x571592){_0x30f19a=_0x571592['length'];if(!_0x48781f[_0xcee3('0x34')][_0xcee3('0x3a')](_0xcee3('0x3b'))){_0x46e120[_0xcee3('0x21')]=qs[_0xcee3('0x21')](_0x48781f[_0xcee3('0x34')][_0xcee3('0x21')]);_0x46e120[_0xcee3('0x20')]=qs[_0xcee3('0x20')](_0x48781f['query'][_0xcee3('0x20')]);}return _0x5a4e0a[_0xcee3('0x4e')](_0x46e120);}})['then'](function(_0x2a2e6b){if(_0x2a2e6b){return _0x2a2e6b?{'count':_0x30f19a,'rows':_0x2a2e6b}:null;}})[_0xcee3('0x28')](respondWithResult(_0x40fada,null))[_0xcee3('0x47')](handleError(_0x40fada,null));};exports[_0xcee3('0x52')]=function(_0x4a2f91,_0x33543a,_0x1e7898){var _0xdb3306={};var _0x3da5a1={};var _0x38ab57;var _0x478c5b;return db['ZendeskConfiguration'][_0xcee3('0x4f')]({'where':{'id':_0x4a2f91[_0xcee3('0x4d')]['id']}})[_0xcee3('0x28')](handleEntityNotFound(_0x33543a,null))[_0xcee3('0x28')](function(_0x21e2a5){if(_0x21e2a5){_0x38ab57=_0x21e2a5;_0x3da5a1[_0xcee3('0x33')]=_[_0xcee3('0x48')](db[_0xcee3('0x50')][_0xcee3('0x51')]);_0x3da5a1[_0xcee3('0x34')]=_['keys'](_0x4a2f91['query']);_0x3da5a1['filters']=_[_0xcee3('0x36')](_0x3da5a1[_0xcee3('0x33')],_0x3da5a1['query']);_0xdb3306[_0xcee3('0x37')]=_['intersection'](_0x3da5a1[_0xcee3('0x33')],qs[_0xcee3('0x38')](_0x4a2f91[_0xcee3('0x34')][_0xcee3('0x38')]));_0xdb3306['attributes']=_0xdb3306['attributes'][_0xcee3('0x39')]?_0xdb3306[_0xcee3('0x37')]:_0x3da5a1[_0xcee3('0x33')];_0xdb3306[_0xcee3('0x3c')]=qs['sort'](_0x4a2f91['query'][_0xcee3('0x3d')]);_0xdb3306[_0xcee3('0x3e')]=qs[_0xcee3('0x35')](_[_0xcee3('0x3f')](_0x4a2f91[_0xcee3('0x34')],_0x3da5a1['filters']));if(_0x4a2f91['query'][_0xcee3('0x40')]){_0xdb3306[_0xcee3('0x3e')]=_['merge'](_0xdb3306['where'],{'$or':_[_0xcee3('0x41')](_0xdb3306[_0xcee3('0x37')],function(_0x32abe2){var _0xb04dbe={};_0xb04dbe[_0x32abe2]={'$like':'%'+_0x4a2f91[_0xcee3('0x34')][_0xcee3('0x40')]+'%'};return _0xb04dbe;})});}_0xdb3306=_[_0xcee3('0x43')]({},_0xdb3306,_0x4a2f91[_0xcee3('0x44')]);return _0x38ab57[_0xcee3('0x52')](_0xdb3306);}})['then'](function(_0x379251){if(_0x379251){_0x478c5b=_0x379251[_0xcee3('0x39')];if(!_0x4a2f91['query']['hasOwnProperty'](_0xcee3('0x3b'))){_0xdb3306[_0xcee3('0x21')]=qs[_0xcee3('0x21')](_0x4a2f91[_0xcee3('0x34')][_0xcee3('0x21')]);_0xdb3306[_0xcee3('0x20')]=qs[_0xcee3('0x20')](_0x4a2f91[_0xcee3('0x34')][_0xcee3('0x20')]);}return _0x38ab57['getSubjects'](_0xdb3306);}})[_0xcee3('0x28')](function(_0x278e43){if(_0x278e43){return _0x278e43?{'count':_0x478c5b,'rows':_0x278e43}:null;}})[_0xcee3('0x28')](respondWithResult(_0x33543a,null))[_0xcee3('0x47')](handleError(_0x33543a,null));};exports[_0xcee3('0x53')]=function(_0x582b41,_0x23f5fe,_0x4b65b0){var _0xb663b9={};var _0x3f3143={};var _0x2d8871;var _0x26bac9;return db[_0xcee3('0x2f')][_0xcee3('0x4f')]({'where':{'id':_0x582b41[_0xcee3('0x4d')]['id']}})[_0xcee3('0x28')](handleEntityNotFound(_0x23f5fe,null))[_0xcee3('0x28')](function(_0x3c3b60){if(_0x3c3b60){_0x2d8871=_0x3c3b60;_0x3f3143['model']=_[_0xcee3('0x48')](db[_0xcee3('0x50')][_0xcee3('0x51')]);_0x3f3143[_0xcee3('0x34')]=_['keys'](_0x582b41[_0xcee3('0x34')]);_0x3f3143[_0xcee3('0x35')]=_[_0xcee3('0x36')](_0x3f3143[_0xcee3('0x33')],_0x3f3143[_0xcee3('0x34')]);_0xb663b9['attributes']=_[_0xcee3('0x36')](_0x3f3143[_0xcee3('0x33')],qs[_0xcee3('0x38')](_0x582b41[_0xcee3('0x34')][_0xcee3('0x38')]));_0xb663b9[_0xcee3('0x37')]=_0xb663b9[_0xcee3('0x37')][_0xcee3('0x39')]?_0xb663b9['attributes']:_0x3f3143['model'];_0xb663b9['order']=qs[_0xcee3('0x3d')](_0x582b41['query'][_0xcee3('0x3d')]);_0xb663b9[_0xcee3('0x3e')]=qs[_0xcee3('0x35')](_[_0xcee3('0x3f')](_0x582b41[_0xcee3('0x34')],_0x3f3143['filters']));if(_0x582b41[_0xcee3('0x34')][_0xcee3('0x40')]){_0xb663b9[_0xcee3('0x3e')]=_['merge'](_0xb663b9['where'],{'$or':_[_0xcee3('0x41')](_0xb663b9[_0xcee3('0x37')],function(_0x429244){var _0x38108c={};_0x38108c[_0x429244]={'$like':'%'+_0x582b41[_0xcee3('0x34')][_0xcee3('0x40')]+'%'};return _0x38108c;})});}_0xb663b9=_[_0xcee3('0x43')]({},_0xb663b9,_0x582b41[_0xcee3('0x44')]);return _0x2d8871[_0xcee3('0x53')](_0xb663b9);}})['then'](function(_0x5edbda){if(_0x5edbda){_0x26bac9=_0x5edbda[_0xcee3('0x39')];if(!_0x582b41[_0xcee3('0x34')][_0xcee3('0x3a')](_0xcee3('0x3b'))){_0xb663b9[_0xcee3('0x21')]=qs[_0xcee3('0x21')](_0x582b41[_0xcee3('0x34')][_0xcee3('0x21')]);_0xb663b9[_0xcee3('0x20')]=qs[_0xcee3('0x20')](_0x582b41[_0xcee3('0x34')][_0xcee3('0x20')]);}return _0x2d8871[_0xcee3('0x53')](_0xb663b9);}})[_0xcee3('0x28')](function(_0x4d3edc){if(_0x4d3edc){return _0x4d3edc?{'count':_0x26bac9,'rows':_0x4d3edc}:null;}})['then'](respondWithResult(_0x23f5fe,null))[_0xcee3('0x47')](handleError(_0x23f5fe,null));};exports[_0xcee3('0x54')]=function(_0x5680da,_0x323ba0,_0x315434){var _0xb6b4e5={};var _0x5d14b9={};var _0x37d726;var _0xf9bf4d;return db[_0xcee3('0x2f')][_0xcee3('0x4f')]({'where':{'id':_0x5680da[_0xcee3('0x4d')]['id']}})[_0xcee3('0x28')](handleEntityNotFound(_0x323ba0,null))['then'](function(_0x3c0e6a){if(_0x3c0e6a){_0x37d726=_0x3c0e6a;_0x5d14b9[_0xcee3('0x33')]=_[_0xcee3('0x48')](db[_0xcee3('0x55')][_0xcee3('0x51')]);_0x5d14b9[_0xcee3('0x34')]=_[_0xcee3('0x48')](_0x5680da['query']);_0x5d14b9[_0xcee3('0x35')]=_['intersection'](_0x5d14b9[_0xcee3('0x33')],_0x5d14b9[_0xcee3('0x34')]);_0xb6b4e5[_0xcee3('0x37')]=_['intersection'](_0x5d14b9[_0xcee3('0x33')],qs[_0xcee3('0x38')](_0x5680da['query'][_0xcee3('0x38')]));_0xb6b4e5['attributes']=_0xb6b4e5[_0xcee3('0x37')][_0xcee3('0x39')]?_0xb6b4e5[_0xcee3('0x37')]:_0x5d14b9['model'];_0xb6b4e5[_0xcee3('0x3c')]=qs[_0xcee3('0x3d')](_0x5680da['query'][_0xcee3('0x3d')]);_0xb6b4e5['where']=qs[_0xcee3('0x35')](_['pick'](_0x5680da['query'],_0x5d14b9[_0xcee3('0x35')]));if(_0x5680da['query'][_0xcee3('0x40')]){_0xb6b4e5[_0xcee3('0x3e')]=_[_0xcee3('0x43')](_0xb6b4e5[_0xcee3('0x3e')],{'$or':_[_0xcee3('0x41')](_0xb6b4e5[_0xcee3('0x37')],function(_0x423efd){var _0x277ee5={};_0x277ee5[_0x423efd]={'$like':'%'+_0x5680da[_0xcee3('0x34')][_0xcee3('0x40')]+'%'};return _0x277ee5;})});}_0xb6b4e5=_[_0xcee3('0x43')]({},_0xb6b4e5,_0x5680da[_0xcee3('0x44')]);return _0x37d726['getTags'](_0xb6b4e5);}})['then'](function(_0x1c1bcf){if(_0x1c1bcf){_0xf9bf4d=_0x1c1bcf[_0xcee3('0x39')];if(!_0x5680da['query'][_0xcee3('0x3a')](_0xcee3('0x3b'))){_0xb6b4e5[_0xcee3('0x21')]=qs[_0xcee3('0x21')](_0x5680da[_0xcee3('0x34')]['limit']);_0xb6b4e5['offset']=qs[_0xcee3('0x20')](_0x5680da[_0xcee3('0x34')][_0xcee3('0x20')]);}return _0x37d726[_0xcee3('0x54')](_0xb6b4e5);}})[_0xcee3('0x28')](function(_0x3da053){if(_0x3da053){return _0x3da053?{'count':_0xf9bf4d,'rows':_0x3da053}:null;}})[_0xcee3('0x28')](respondWithResult(_0x323ba0,null))[_0xcee3('0x47')](handleError(_0x323ba0,null));};exports[_0xcee3('0x56')]=function(_0x27554c,_0xc1efb0,_0x1a8b02){if(_0x27554c[_0xcee3('0x4c')]['id']){delete _0x27554c[_0xcee3('0x4c')]['id'];}return db[_0xcee3('0x2f')][_0xcee3('0x4f')]({'where':{'id':_0x27554c[_0xcee3('0x4d')]['id']}})[_0xcee3('0x28')](handleEntityNotFound(_0xc1efb0,null))[_0xcee3('0x28')](function(_0x6bd5d6){if(_0x6bd5d6){return _0x6bd5d6[_0xcee3('0x56')](_0x27554c[_0xcee3('0x4c')][_0xcee3('0x57')]||[]);}return null;})[_0xcee3('0x28')](respondWithResult(_0xc1efb0,null))[_0xcee3('0x47')](handleError(_0xc1efb0,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index e54e3b3..4a02d57 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 _0x5423=['request-promise','path','rimraf','../../config/environment','exports','define','ZendeskConfiguration','lodash','util','api','moment'];(function(_0x1640d7,_0x18e0fb){var _0x22db1a=function(_0x495bfb){while(--_0x495bfb){_0x1640d7['push'](_0x1640d7['shift']());}};_0x22db1a(++_0x18e0fb);}(_0x5423,0xe3));var _0x3542=function(_0x2754c3,_0xc1da22){_0x2754c3=_0x2754c3-0x0;var _0x394a0c=_0x5423[_0x2754c3];return _0x394a0c;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var logger=require('../../config/logger')(_0x3542('0x2'));var moment=require(_0x3542('0x3'));var BPromise=require('bluebird');var rp=require(_0x3542('0x4'));var fs=require('fs');var path=require(_0x3542('0x5'));var rimraf=require(_0x3542('0x6'));var config=require(_0x3542('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x3542('0x8')]=function(_0x2d2ae9,_0x15ee3b){return _0x2d2ae9[_0x3542('0x9')](_0x3542('0xa'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7b4=['path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','api','moment'];(function(_0x45a9b4,_0xa23dfe){var _0x4427e2=function(_0x3e5787){while(--_0x3e5787){_0x45a9b4['push'](_0x45a9b4['shift']());}};_0x4427e2(++_0xa23dfe);}(_0xf7b4,0x152));var _0x4f7b=function(_0x3c4034,_0x50e2f7){_0x3c4034=_0x3c4034-0x0;var _0xac9930=_0xf7b4[_0x3c4034];return _0xac9930;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4f7b('0x1'));var moment=require(_0x4f7b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f7b('0x3'));var rimraf=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var attributes=require(_0x4f7b('0x6'));module[_0x4f7b('0x7')]=function(_0x2637f0,_0x427f8b){return _0x2637f0[_0x4f7b('0x8')](_0x4f7b('0x9'),attributes,{'tableName':_0x4f7b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 5053cad..e260a7a 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 _0x9d73=['stringify','code','ZendeskConfiguration,\x20%s,\x20%s','message','error','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4fc9dd,_0x2187a7){var _0x4661e2=function(_0x19a855){while(--_0x19a855){_0x4fc9dd['push'](_0x4fc9dd['shift']());}};_0x4661e2(++_0x2187a7);}(_0x9d73,0x1d3));var _0x39d7=function(_0x46daf2,_0x55da55){_0x46daf2=_0x46daf2-0x0;var _0x4e0632=_0x9d73[_0x46daf2];return _0x4e0632;};'use strict';var _=require(_0x39d7('0x0'));var util=require(_0x39d7('0x1'));var moment=require(_0x39d7('0x2'));var BPromise=require(_0x39d7('0x3'));var rs=require(_0x39d7('0x4'));var fs=require('fs');var Redis=require(_0x39d7('0x5'));var db=require(_0x39d7('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x39d7('0x7'));var jayson=require(_0x39d7('0x8'));var client=jayson[_0x39d7('0x9')][_0x39d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x165803,_0x4d3e20,_0xa63d){return new BPromise(function(_0x2659b5,_0x29c480){return client[_0x39d7('0xb')](_0x165803,_0xa63d)[_0x39d7('0xc')](function(_0x48d7dc){logger[_0x39d7('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4d3e20,'request\x20sent');logger['debug'](_0x39d7('0xe'),_0x4d3e20,_0x39d7('0xf'),JSON[_0x39d7('0x10')](_0x48d7dc));if(_0x48d7dc['error']){if(_0x48d7dc['error'][_0x39d7('0x11')]===0x1f4){logger['error'](_0x39d7('0x12'),_0x4d3e20,_0x48d7dc['error'][_0x39d7('0x13')]);return _0x29c480(_0x48d7dc[_0x39d7('0x14')][_0x39d7('0x13')]);}logger[_0x39d7('0x14')](_0x39d7('0x12'),_0x4d3e20,_0x48d7dc[_0x39d7('0x14')][_0x39d7('0x13')]);return _0x2659b5(_0x48d7dc[_0x39d7('0x14')][_0x39d7('0x13')]);}else{logger['info'](_0x39d7('0x12'),_0x4d3e20,'request\x20sent');_0x2659b5(_0x48d7dc[_0x39d7('0x15')]['message']);}})[_0x39d7('0x16')](function(_0xcb203e){logger[_0x39d7('0x14')](_0x39d7('0x12'),_0x4d3e20,_0xcb203e);_0x29c480(_0xcb203e);});});} \ No newline at end of file +var _0x4fba=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','request\x20sent'];(function(_0x39428c,_0x34b23a){var _0x52d069=function(_0x394962){while(--_0x394962){_0x39428c['push'](_0x39428c['shift']());}};_0x52d069(++_0x34b23a);}(_0x4fba,0xe4));var _0xa4fb=function(_0x1edbe0,_0x5d0656){_0x1edbe0=_0x1edbe0-0x0;var _0x52f2ca=_0x4fba[_0x1edbe0];return _0x52f2ca;};'use strict';var _=require(_0xa4fb('0x0'));var util=require(_0xa4fb('0x1'));var moment=require(_0xa4fb('0x2'));var BPromise=require(_0xa4fb('0x3'));var rs=require(_0xa4fb('0x4'));var fs=require('fs');var Redis=require(_0xa4fb('0x5'));var db=require(_0xa4fb('0x6'))['db'];var utils=require(_0xa4fb('0x7'));var logger=require(_0xa4fb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa4fb('0x9'));var client=jayson[_0xa4fb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb8bab3,_0x3381c7,_0x597dd9){return new BPromise(function(_0x438947,_0x3d3ec7){return client['request'](_0xb8bab3,_0x597dd9)[_0xa4fb('0xb')](function(_0x2900db){logger[_0xa4fb('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3381c7,_0xa4fb('0xd'));logger[_0xa4fb('0xe')](_0xa4fb('0xf'),_0x3381c7,'request\x20sent',JSON['stringify'](_0x2900db));if(_0x2900db[_0xa4fb('0x10')]){if(_0x2900db[_0xa4fb('0x10')][_0xa4fb('0x11')]===0x1f4){logger[_0xa4fb('0x10')](_0xa4fb('0x12'),_0x3381c7,_0x2900db['error'][_0xa4fb('0x13')]);return _0x3d3ec7(_0x2900db[_0xa4fb('0x10')]['message']);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x3381c7,_0x2900db[_0xa4fb('0x10')][_0xa4fb('0x13')]);return _0x438947(_0x2900db[_0xa4fb('0x10')][_0xa4fb('0x13')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x3381c7,_0xa4fb('0xd'));_0x438947(_0x2900db[_0xa4fb('0x14')][_0xa4fb('0x13')]);}})[_0xa4fb('0x15')](function(_0x2d425b){logger[_0xa4fb('0x10')](_0xa4fb('0x12'),_0x3381c7,_0x2d425b);_0x3d3ec7(_0x2d425b);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 2e67c07..1792476 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 _0xa8e9=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','post','create','put'];(function(_0x22b1d5,_0x9efc67){var _0x5b3003=function(_0x1f77ab){while(--_0x1f77ab){_0x22b1d5['push'](_0x22b1d5['shift']());}};_0x5b3003(++_0x9efc67);}(_0xa8e9,0xce));var _0x9a8e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa8e9[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x9a8e('0x0'));var util=require(_0x9a8e('0x1'));var path=require(_0x9a8e('0x2'));var timeout=require(_0x9a8e('0x3'));var express=require(_0x9a8e('0x4'));var router=express[_0x9a8e('0x5')]();var fs_extra=require(_0x9a8e('0x6'));var auth=require(_0x9a8e('0x7'));var interaction=require(_0x9a8e('0x8'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router[_0x9a8e('0x9')]('/',auth[_0x9a8e('0xa')](),controller['index']);router[_0x9a8e('0x9')](_0x9a8e('0xb'),auth[_0x9a8e('0xa')](),controller['show']);router[_0x9a8e('0xc')]('/',auth[_0x9a8e('0xa')](),controller[_0x9a8e('0xd')]);router[_0x9a8e('0xe')](_0x9a8e('0xb'),auth[_0x9a8e('0xa')](),controller['update']);router['delete'](_0x9a8e('0xb'),auth['isAuthenticated'](),controller[_0x9a8e('0xf')]);module[_0x9a8e('0x10')]=router; \ No newline at end of file +var _0x15c1=['get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./intZendeskField.controller'];(function(_0x67f304,_0x4fe3ab){var _0x3f794c=function(_0x217bf8){while(--_0x217bf8){_0x67f304['push'](_0x67f304['shift']());}};_0x3f794c(++_0x4fe3ab);}(_0x15c1,0x1d5));var _0x115c=function(_0x32fda2,_0x4a38b4){_0x32fda2=_0x32fda2-0x0;var _0x33f8cf=_0x15c1[_0x32fda2];return _0x33f8cf;};'use strict';var multer=require(_0x115c('0x0'));var util=require(_0x115c('0x1'));var path=require('path');var timeout=require(_0x115c('0x2'));var express=require(_0x115c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x115c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x115c('0x5'));var controller=require(_0x115c('0x6'));router[_0x115c('0x7')]('/',auth['isAuthenticated'](),controller[_0x115c('0x8')]);router['get'](_0x115c('0x9'),auth[_0x115c('0xa')](),controller[_0x115c('0xb')]);router[_0x115c('0xc')]('/',auth['isAuthenticated'](),controller[_0x115c('0xd')]);router[_0x115c('0xe')](_0x115c('0x9'),auth[_0x115c('0xa')](),controller['update']);router[_0x115c('0xf')](_0x115c('0x9'),auth['isAuthenticated'](),controller[_0x115c('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 0df4db2..256132c 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 _0x175f=['customVariable','keyValue','string','STRING','ENUM','variable','sequelize','exports'];(function(_0x1e7274,_0x276150){var _0x4f03cc=function(_0x125bc4){while(--_0x125bc4){_0x1e7274['push'](_0x1e7274['shift']());}};_0x4f03cc(++_0x276150);}(_0x175f,0x7e));var _0xf175=function(_0x17b83c,_0x3e3186){_0x17b83c=_0x17b83c-0x0;var _0x5202ab=_0x175f[_0x17b83c];return _0x5202ab;};'use strict';var Sequelize=require(_0xf175('0x0'));module[_0xf175('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xf175('0x2'),_0xf175('0x3'),'picklist'),'defaultValue':_0xf175('0x4')},'content':{'type':Sequelize[_0xf175('0x5')]},'key':{'type':Sequelize[_0xf175('0x5')]},'keyType':{'type':Sequelize[_0xf175('0x6')](_0xf175('0x4'),_0xf175('0x7'),_0xf175('0x2'))},'keyContent':{'type':Sequelize[_0xf175('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf175('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf175('0x5')]}}; \ No newline at end of file +var _0xf855=['picklist','STRING','variable','BOOLEAN','sequelize','ENUM','string','customVariable'];(function(_0x2190ba,_0x51077b){var _0x59a06f=function(_0x4ea69e){while(--_0x4ea69e){_0x2190ba['push'](_0x2190ba['shift']());}};_0x59a06f(++_0x51077b);}(_0xf855,0x18c));var _0x5f85=function(_0x5e76b8,_0x1bee9a){_0x5e76b8=_0x5e76b8-0x0;var _0x3ed461=_0xf855[_0x5e76b8];return _0x3ed461;};'use strict';var Sequelize=require(_0x5f85('0x0'));module['exports']={'type':{'type':Sequelize[_0x5f85('0x1')](_0x5f85('0x2'),'variable',_0x5f85('0x3'),'keyValue',_0x5f85('0x4')),'defaultValue':_0x5f85('0x2')},'content':{'type':Sequelize[_0x5f85('0x5')]},'key':{'type':Sequelize[_0x5f85('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x5f85('0x6'),_0x5f85('0x3'))},'keyContent':{'type':Sequelize[_0x5f85('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5f85('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 073f8ad..7f12f5c 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 _0xc9b7=['../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','count','limit','Content-Range','json','reject','save','update','then','destroy','stack','index','map','ZendeskField','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','show','keys','rawAttributes','include','find','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x470651,_0x2774a5){var _0x4c3597=function(_0x4b9914){while(--_0x4b9914){_0x470651['push'](_0x470651['shift']());}};_0x4c3597(++_0x2774a5);}(_0xc9b7,0x1ab));var _0x7c9b=function(_0x3e04c4,_0x48101b){_0x3e04c4=_0x3e04c4-0x0;var _0x543e0f=_0xc9b7[_0x3e04c4];return _0x543e0f;};'use strict';var emlformat=require(_0x7c9b('0x0'));var rimraf=require(_0x7c9b('0x1'));var zipdir=require(_0x7c9b('0x2'));var jsonpatch=require(_0x7c9b('0x3'));var rp=require('request-promise');var moment=require(_0x7c9b('0x4'));var BPromise=require(_0x7c9b('0x5'));var Mustache=require('mustache');var util=require(_0x7c9b('0x6'));var path=require(_0x7c9b('0x7'));var sox=require(_0x7c9b('0x8'));var csv=require(_0x7c9b('0x9'));var ejs=require(_0x7c9b('0xa'));var fs=require('fs');var fs_extra=require(_0x7c9b('0xb'));var _=require(_0x7c9b('0xc'));var squel=require(_0x7c9b('0xd'));var crypto=require(_0x7c9b('0xe'));var jsforce=require(_0x7c9b('0xf'));var deskjs=require(_0x7c9b('0x10'));var toCsv=require(_0x7c9b('0x9'));var querystring=require(_0x7c9b('0x11'));var Papa=require(_0x7c9b('0x12'));var Redis=require(_0x7c9b('0x13'));var authService=require(_0x7c9b('0x14'));var qs=require(_0x7c9b('0x15'));var as=require(_0x7c9b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c9b('0x17'))(_0x7c9b('0x18'));var utils=require(_0x7c9b('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x7c9b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e6b13,_0x42362a){_0x42362a=_0x42362a||0xcc;return function(_0x4cdc09){if(_0x4cdc09){return _0x1e6b13[_0x7c9b('0x1b')](_0x42362a);}return _0x1e6b13[_0x7c9b('0x1c')](_0x42362a)[_0x7c9b('0x1d')]();};}function respondWithResult(_0x2e8001,_0x56f49d){_0x56f49d=_0x56f49d||0xc8;return function(_0x1ec7dd){if(_0x1ec7dd){return _0x2e8001[_0x7c9b('0x1c')](_0x56f49d)['json'](_0x1ec7dd);}};}function respondWithFilteredResult(_0x2f1ecb,_0x482e81){return function(_0x86a9ca){if(_0x86a9ca){var _0x2f1967=typeof _0x482e81[_0x7c9b('0x1e')]==='undefined'&&typeof _0x482e81['limit']==='undefined';var _0x3206b7=_0x86a9ca[_0x7c9b('0x1f')];var _0x2bb448=_0x2f1967?0x0:_0x482e81[_0x7c9b('0x1e')];var _0x18d6d5=_0x2f1967?_0x86a9ca[_0x7c9b('0x1f')]:_0x482e81['offset']+_0x482e81[_0x7c9b('0x20')];var _0x132dbe;if(_0x18d6d5>=_0x3206b7){_0x18d6d5=_0x3206b7;_0x132dbe=0xc8;}else{_0x132dbe=0xce;}_0x2f1ecb[_0x7c9b('0x1c')](_0x132dbe);return _0x2f1ecb['set'](_0x7c9b('0x21'),_0x2bb448+'-'+_0x18d6d5+'/'+_0x3206b7)[_0x7c9b('0x22')](_0x86a9ca);}return null;};}function patchUpdates(_0xb7c53e){return function(_0x456f81){try{jsonpatch['apply'](_0x456f81,_0xb7c53e,!![]);}catch(_0x4321c3){return BPromise[_0x7c9b('0x23')](_0x4321c3);}return _0x456f81[_0x7c9b('0x24')]();};}function saveUpdates(_0x4ca682,_0x1583ab){return function(_0x4d68be){if(_0x4d68be){return _0x4d68be[_0x7c9b('0x25')](_0x4ca682)[_0x7c9b('0x26')](function(_0x1f8b22){return _0x1f8b22;});}return null;};}function removeEntity(_0x3e4282,_0x1be41b){return function(_0x4c080c){if(_0x4c080c){return _0x4c080c[_0x7c9b('0x27')]()[_0x7c9b('0x26')](function(){_0x3e4282[_0x7c9b('0x1c')](0xcc)[_0x7c9b('0x1d')]();});}};}function handleEntityNotFound(_0x23be90,_0x17b63c){return function(_0x816979){if(!_0x816979){_0x23be90[_0x7c9b('0x1b')](0x194);}return _0x816979;};}function handleError(_0x269b60,_0x3750ce){_0x3750ce=_0x3750ce||0x1f4;return function(_0x47d843){logger['error'](_0x47d843[_0x7c9b('0x28')]);if(_0x47d843['name']){delete _0x47d843['name'];}_0x269b60[_0x7c9b('0x1c')](_0x3750ce)['send'](_0x47d843);};}exports[_0x7c9b('0x29')]=function(_0x17b477,_0x722b0d){var _0x17cf3c={},_0x2a7afe={},_0x2cbe6f={'count':0x0,'rows':[]};var _0x1bd094=_[_0x7c9b('0x2a')](db[_0x7c9b('0x2b')]['rawAttributes'],function(_0x405709){return{'name':_0x405709[_0x7c9b('0x2c')],'type':_0x405709[_0x7c9b('0x2d')][_0x7c9b('0x2e')]};});_0x2a7afe[_0x7c9b('0x2f')]=_[_0x7c9b('0x2a')](_0x1bd094,_0x7c9b('0x30'));_0x2a7afe[_0x7c9b('0x31')]=_['keys'](_0x17b477['query']);_0x2a7afe[_0x7c9b('0x32')]=_[_0x7c9b('0x33')](_0x2a7afe[_0x7c9b('0x2f')],_0x2a7afe[_0x7c9b('0x31')]);_0x17cf3c[_0x7c9b('0x34')]=_[_0x7c9b('0x33')](_0x2a7afe[_0x7c9b('0x2f')],qs[_0x7c9b('0x35')](_0x17b477[_0x7c9b('0x31')][_0x7c9b('0x35')]));_0x17cf3c[_0x7c9b('0x34')]=_0x17cf3c[_0x7c9b('0x34')]['length']?_0x17cf3c[_0x7c9b('0x34')]:_0x2a7afe[_0x7c9b('0x2f')];if(!_0x17b477['query'][_0x7c9b('0x36')](_0x7c9b('0x37'))){_0x17cf3c[_0x7c9b('0x20')]=qs[_0x7c9b('0x20')](_0x17b477['query'][_0x7c9b('0x20')]);_0x17cf3c[_0x7c9b('0x1e')]=qs[_0x7c9b('0x1e')](_0x17b477[_0x7c9b('0x31')][_0x7c9b('0x1e')]);}_0x17cf3c[_0x7c9b('0x38')]=qs[_0x7c9b('0x39')](_0x17b477['query'][_0x7c9b('0x39')]);_0x17cf3c['where']=qs['filters'](_[_0x7c9b('0x3a')](_0x17b477[_0x7c9b('0x31')],_0x2a7afe[_0x7c9b('0x32')]),_0x1bd094);if(_0x17b477[_0x7c9b('0x31')][_0x7c9b('0x3b')]){_0x17cf3c[_0x7c9b('0x3c')]=_[_0x7c9b('0x3d')](_0x17cf3c[_0x7c9b('0x3c')],{'$or':_['map'](_0x1bd094,function(_0x559d99){if(_0x559d99[_0x7c9b('0x2d')]!==_0x7c9b('0x3e')){var _0x2a5fc4={};_0x2a5fc4[_0x559d99[_0x7c9b('0x30')]]={'$like':'%'+_0x17b477[_0x7c9b('0x31')][_0x7c9b('0x3b')]+'%'};return _0x2a5fc4;}})});}_0x17cf3c=_[_0x7c9b('0x3d')]({},_0x17cf3c,_0x17b477[_0x7c9b('0x3f')]);var _0x1a21e2={'where':_0x17cf3c[_0x7c9b('0x3c')]};return db[_0x7c9b('0x2b')][_0x7c9b('0x1f')](_0x1a21e2)['then'](function(_0x21c04c){_0x2cbe6f[_0x7c9b('0x1f')]=_0x21c04c;if(_0x17b477[_0x7c9b('0x31')]['includeAll']){_0x17cf3c['include']=[{'all':!![]}];}return db[_0x7c9b('0x2b')][_0x7c9b('0x40')](_0x17cf3c);})[_0x7c9b('0x26')](function(_0x560bc3){_0x2cbe6f[_0x7c9b('0x41')]=_0x560bc3;return _0x2cbe6f;})['then'](respondWithFilteredResult(_0x722b0d,_0x17cf3c))['catch'](handleError(_0x722b0d,null));};exports[_0x7c9b('0x42')]=function(_0x4d070e,_0x36a4c8){var _0x1a4817={'raw':!![],'where':{'id':_0x4d070e['params']['id']}},_0xc2cae5={};_0xc2cae5[_0x7c9b('0x2f')]=_[_0x7c9b('0x43')](db[_0x7c9b('0x2b')][_0x7c9b('0x44')]);_0xc2cae5['query']=_[_0x7c9b('0x43')](_0x4d070e[_0x7c9b('0x31')]);_0xc2cae5[_0x7c9b('0x32')]=_[_0x7c9b('0x33')](_0xc2cae5[_0x7c9b('0x2f')],_0xc2cae5[_0x7c9b('0x31')]);_0x1a4817[_0x7c9b('0x34')]=_[_0x7c9b('0x33')](_0xc2cae5[_0x7c9b('0x2f')],qs[_0x7c9b('0x35')](_0x4d070e['query'][_0x7c9b('0x35')]));_0x1a4817['attributes']=_0x1a4817[_0x7c9b('0x34')]['length']?_0x1a4817[_0x7c9b('0x34')]:_0xc2cae5[_0x7c9b('0x2f')];if(_0x4d070e[_0x7c9b('0x31')]['includeAll']){_0x1a4817[_0x7c9b('0x45')]=[{'all':!![]}];}_0x1a4817=_['merge']({},_0x1a4817,_0x4d070e[_0x7c9b('0x3f')]);return db[_0x7c9b('0x2b')][_0x7c9b('0x46')](_0x1a4817)[_0x7c9b('0x26')](handleEntityNotFound(_0x36a4c8,null))[_0x7c9b('0x26')](respondWithResult(_0x36a4c8,null))['catch'](handleError(_0x36a4c8,null));};exports[_0x7c9b('0x47')]=function(_0x162537,_0x2ce1ce){return db[_0x7c9b('0x2b')][_0x7c9b('0x47')](_0x162537[_0x7c9b('0x48')],{})[_0x7c9b('0x26')](respondWithResult(_0x2ce1ce,0xc9))[_0x7c9b('0x49')](handleError(_0x2ce1ce,null));};exports['update']=function(_0x37428b,_0x4ab845){if(_0x37428b[_0x7c9b('0x48')]['id']){delete _0x37428b[_0x7c9b('0x48')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x37428b[_0x7c9b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ab845,null))['then'](saveUpdates(_0x37428b[_0x7c9b('0x48')],null))[_0x7c9b('0x26')](respondWithResult(_0x4ab845,null))[_0x7c9b('0x49')](handleError(_0x4ab845,null));};exports[_0x7c9b('0x27')]=function(_0x36131c,_0x2bfca0){return db[_0x7c9b('0x2b')]['find']({'where':{'id':_0x36131c[_0x7c9b('0x4a')]['id']}})[_0x7c9b('0x26')](handleEntityNotFound(_0x2bfca0,null))[_0x7c9b('0x26')](removeEntity(_0x2bfca0,null))[_0x7c9b('0x49')](handleError(_0x2bfca0,null));}; \ No newline at end of file +var _0x20b4=['query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','findAll','rows','catch','show','fields','includeAll','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ZendeskField','rawAttributes','model','map'];(function(_0xc84838,_0x47e144){var _0x5d14f9=function(_0xe4a36d){while(--_0xe4a36d){_0xc84838['push'](_0xc84838['shift']());}};_0x5d14f9(++_0x47e144);}(_0x20b4,0x146));var _0x420b=function(_0x2d98f1,_0x21174b){_0x2d98f1=_0x2d98f1-0x0;var _0x701cc7=_0x20b4[_0x2d98f1];return _0x701cc7;};'use strict';var emlformat=require(_0x420b('0x0'));var rimraf=require(_0x420b('0x1'));var zipdir=require(_0x420b('0x2'));var jsonpatch=require(_0x420b('0x3'));var rp=require('request-promise');var moment=require(_0x420b('0x4'));var BPromise=require(_0x420b('0x5'));var Mustache=require('mustache');var util=require(_0x420b('0x6'));var path=require(_0x420b('0x7'));var sox=require('sox');var csv=require(_0x420b('0x8'));var ejs=require(_0x420b('0x9'));var fs=require('fs');var fs_extra=require(_0x420b('0xa'));var _=require(_0x420b('0xb'));var squel=require(_0x420b('0xc'));var crypto=require(_0x420b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x420b('0xe'));var toCsv=require(_0x420b('0x8'));var querystring=require(_0x420b('0xf'));var Papa=require('papaparse');var Redis=require(_0x420b('0x10'));var authService=require(_0x420b('0x11'));var qs=require(_0x420b('0x12'));var as=require(_0x420b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x420b('0x14'))(_0x420b('0x15'));var utils=require(_0x420b('0x16'));var config=require(_0x420b('0x17'));var licenseUtil=require(_0x420b('0x18'));var db=require(_0x420b('0x19'))['db'];function respondWithStatusCode(_0x3f5a79,_0x1212b){_0x1212b=_0x1212b||0xcc;return function(_0x126c44){if(_0x126c44){return _0x3f5a79[_0x420b('0x1a')](_0x1212b);}return _0x3f5a79[_0x420b('0x1b')](_0x1212b)[_0x420b('0x1c')]();};}function respondWithResult(_0x52ac67,_0x61e789){_0x61e789=_0x61e789||0xc8;return function(_0x102b93){if(_0x102b93){return _0x52ac67[_0x420b('0x1b')](_0x61e789)[_0x420b('0x1d')](_0x102b93);}};}function respondWithFilteredResult(_0x520cbb,_0x975896){return function(_0x47e4ed){if(_0x47e4ed){var _0x54413e=typeof _0x975896[_0x420b('0x1e')]==='undefined'&&typeof _0x975896[_0x420b('0x1f')]==='undefined';var _0x32bd9a=_0x47e4ed['count'];var _0x454be6=_0x54413e?0x0:_0x975896[_0x420b('0x1e')];var _0x1f50cf=_0x54413e?_0x47e4ed[_0x420b('0x20')]:_0x975896[_0x420b('0x1e')]+_0x975896[_0x420b('0x1f')];var _0x41a89d;if(_0x1f50cf>=_0x32bd9a){_0x1f50cf=_0x32bd9a;_0x41a89d=0xc8;}else{_0x41a89d=0xce;}_0x520cbb['status'](_0x41a89d);return _0x520cbb['set'](_0x420b('0x21'),_0x454be6+'-'+_0x1f50cf+'/'+_0x32bd9a)[_0x420b('0x1d')](_0x47e4ed);}return null;};}function patchUpdates(_0x112ab0){return function(_0x1a8f45){try{jsonpatch[_0x420b('0x22')](_0x1a8f45,_0x112ab0,!![]);}catch(_0x435592){return BPromise[_0x420b('0x23')](_0x435592);}return _0x1a8f45[_0x420b('0x24')]();};}function saveUpdates(_0x537680,_0x359b67){return function(_0x4909c1){if(_0x4909c1){return _0x4909c1[_0x420b('0x25')](_0x537680)[_0x420b('0x26')](function(_0x465401){return _0x465401;});}return null;};}function removeEntity(_0x3fe6c6,_0x3bc06a){return function(_0x42cdf3){if(_0x42cdf3){return _0x42cdf3[_0x420b('0x27')]()[_0x420b('0x26')](function(){_0x3fe6c6['status'](0xcc)[_0x420b('0x1c')]();});}};}function handleEntityNotFound(_0x58cfc3,_0x5189eb){return function(_0x3d8cfe){if(!_0x3d8cfe){_0x58cfc3[_0x420b('0x1a')](0x194);}return _0x3d8cfe;};}function handleError(_0xfd3f0b,_0x3dd74e){_0x3dd74e=_0x3dd74e||0x1f4;return function(_0x4597a8){logger[_0x420b('0x28')](_0x4597a8[_0x420b('0x29')]);if(_0x4597a8[_0x420b('0x2a')]){delete _0x4597a8[_0x420b('0x2a')];}_0xfd3f0b['status'](_0x3dd74e)[_0x420b('0x2b')](_0x4597a8);};}exports[_0x420b('0x2c')]=function(_0x42aeb3,_0x38a9b9){var _0xa48374={},_0x3b009e={},_0x49588c={'count':0x0,'rows':[]};var _0xb5a8aa=_['map'](db[_0x420b('0x2d')][_0x420b('0x2e')],function(_0x1d1b99){return{'name':_0x1d1b99['fieldName'],'type':_0x1d1b99['type']['key']};});_0x3b009e[_0x420b('0x2f')]=_[_0x420b('0x30')](_0xb5a8aa,_0x420b('0x2a'));_0x3b009e[_0x420b('0x31')]=_[_0x420b('0x32')](_0x42aeb3[_0x420b('0x31')]);_0x3b009e[_0x420b('0x33')]=_[_0x420b('0x34')](_0x3b009e[_0x420b('0x2f')],_0x3b009e[_0x420b('0x31')]);_0xa48374['attributes']=_[_0x420b('0x34')](_0x3b009e[_0x420b('0x2f')],qs['fields'](_0x42aeb3[_0x420b('0x31')]['fields']));_0xa48374[_0x420b('0x35')]=_0xa48374[_0x420b('0x35')][_0x420b('0x36')]?_0xa48374['attributes']:_0x3b009e[_0x420b('0x2f')];if(!_0x42aeb3[_0x420b('0x31')][_0x420b('0x37')](_0x420b('0x38'))){_0xa48374['limit']=qs[_0x420b('0x1f')](_0x42aeb3[_0x420b('0x31')][_0x420b('0x1f')]);_0xa48374[_0x420b('0x1e')]=qs['offset'](_0x42aeb3['query']['offset']);}_0xa48374[_0x420b('0x39')]=qs[_0x420b('0x3a')](_0x42aeb3[_0x420b('0x31')][_0x420b('0x3a')]);_0xa48374['where']=qs[_0x420b('0x33')](_[_0x420b('0x3b')](_0x42aeb3[_0x420b('0x31')],_0x3b009e['filters']),_0xb5a8aa);if(_0x42aeb3[_0x420b('0x31')][_0x420b('0x3c')]){_0xa48374[_0x420b('0x3d')]=_[_0x420b('0x3e')](_0xa48374[_0x420b('0x3d')],{'$or':_[_0x420b('0x30')](_0xb5a8aa,function(_0x14731e){if(_0x14731e[_0x420b('0x3f')]!=='VIRTUAL'){var _0x4c5649={};_0x4c5649[_0x14731e[_0x420b('0x2a')]]={'$like':'%'+_0x42aeb3[_0x420b('0x31')]['filter']+'%'};return _0x4c5649;}})});}_0xa48374=_[_0x420b('0x3e')]({},_0xa48374,_0x42aeb3['options']);var _0x37242a={'where':_0xa48374[_0x420b('0x3d')]};return db[_0x420b('0x2d')]['count'](_0x37242a)[_0x420b('0x26')](function(_0x16b8ca){_0x49588c['count']=_0x16b8ca;if(_0x42aeb3[_0x420b('0x31')]['includeAll']){_0xa48374['include']=[{'all':!![]}];}return db['ZendeskField'][_0x420b('0x40')](_0xa48374);})[_0x420b('0x26')](function(_0x25ac0b){_0x49588c[_0x420b('0x41')]=_0x25ac0b;return _0x49588c;})['then'](respondWithFilteredResult(_0x38a9b9,_0xa48374))[_0x420b('0x42')](handleError(_0x38a9b9,null));};exports[_0x420b('0x43')]=function(_0x50fcf9,_0x219748){var _0x754e1={'raw':!![],'where':{'id':_0x50fcf9['params']['id']}},_0x56f83f={};_0x56f83f['model']=_[_0x420b('0x32')](db[_0x420b('0x2d')][_0x420b('0x2e')]);_0x56f83f['query']=_[_0x420b('0x32')](_0x50fcf9[_0x420b('0x31')]);_0x56f83f[_0x420b('0x33')]=_[_0x420b('0x34')](_0x56f83f[_0x420b('0x2f')],_0x56f83f[_0x420b('0x31')]);_0x754e1[_0x420b('0x35')]=_['intersection'](_0x56f83f['model'],qs[_0x420b('0x44')](_0x50fcf9[_0x420b('0x31')]['fields']));_0x754e1[_0x420b('0x35')]=_0x754e1[_0x420b('0x35')][_0x420b('0x36')]?_0x754e1[_0x420b('0x35')]:_0x56f83f[_0x420b('0x2f')];if(_0x50fcf9[_0x420b('0x31')][_0x420b('0x45')]){_0x754e1[_0x420b('0x46')]=[{'all':!![]}];}_0x754e1=_[_0x420b('0x3e')]({},_0x754e1,_0x50fcf9[_0x420b('0x47')]);return db['ZendeskField'][_0x420b('0x48')](_0x754e1)['then'](handleEntityNotFound(_0x219748,null))[_0x420b('0x26')](respondWithResult(_0x219748,null))[_0x420b('0x42')](handleError(_0x219748,null));};exports[_0x420b('0x49')]=function(_0x1fe868,_0x2babe4){return db[_0x420b('0x2d')][_0x420b('0x49')](_0x1fe868[_0x420b('0x4a')],{})[_0x420b('0x26')](respondWithResult(_0x2babe4,0xc9))['catch'](handleError(_0x2babe4,null));};exports[_0x420b('0x25')]=function(_0x19741d,_0x27331f){if(_0x19741d[_0x420b('0x4a')]['id']){delete _0x19741d[_0x420b('0x4a')]['id'];}return db[_0x420b('0x2d')][_0x420b('0x48')]({'where':{'id':_0x19741d['params']['id']}})[_0x420b('0x26')](handleEntityNotFound(_0x27331f,null))['then'](saveUpdates(_0x19741d[_0x420b('0x4a')],null))[_0x420b('0x26')](respondWithResult(_0x27331f,null))[_0x420b('0x42')](handleError(_0x27331f,null));};exports['destroy']=function(_0x2ec086,_0x5617b4){return db[_0x420b('0x2d')][_0x420b('0x48')]({'where':{'id':_0x2ec086['params']['id']}})[_0x420b('0x26')](handleEntityNotFound(_0x5617b4,null))['then'](removeEntity(_0x5617b4,null))[_0x420b('0x42')](handleError(_0x5617b4,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 1149893..9a52fa5 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 _0x9b86=['../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x154bdc,_0x1b2ee7){var _0x485d2d=function(_0x3555f8){while(--_0x3555f8){_0x154bdc['push'](_0x154bdc['shift']());}};_0x485d2d(++_0x1b2ee7);}(_0x9b86,0x107));var _0x69b8=function(_0x51882a,_0x586e5e){_0x51882a=_0x51882a-0x0;var _0x5a0209=_0x9b86[_0x51882a];return _0x5a0209;};'use strict';var _=require(_0x69b8('0x0'));var util=require(_0x69b8('0x1'));var logger=require(_0x69b8('0x2'))(_0x69b8('0x3'));var moment=require(_0x69b8('0x4'));var BPromise=require(_0x69b8('0x5'));var rp=require(_0x69b8('0x6'));var fs=require('fs');var path=require(_0x69b8('0x7'));var rimraf=require(_0x69b8('0x8'));var config=require(_0x69b8('0x9'));var attributes=require(_0x69b8('0xa'));module['exports']=function(_0x530683,_0x4a01f4){return _0x530683[_0x69b8('0xb')](_0x69b8('0xc'),attributes,{'tableName':_0x69b8('0xd'),'paranoid':![],'indexes':[{'name':_0x69b8('0xe'),'fields':[_0x69b8('0xf'),_0x69b8('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ce4=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index'];(function(_0x5e9d1f,_0x37c578){var _0x895bea=function(_0x4e10bc){while(--_0x4e10bc){_0x5e9d1f['push'](_0x5e9d1f['shift']());}};_0x895bea(++_0x37c578);}(_0x2ce4,0xd0));var _0x42ce=function(_0xdf8100,_0x33609a){_0xdf8100=_0xdf8100-0x0;var _0x133554=_0x2ce4[_0xdf8100];return _0x133554;};'use strict';var _=require('lodash');var util=require(_0x42ce('0x0'));var logger=require(_0x42ce('0x1'))(_0x42ce('0x2'));var moment=require('moment');var BPromise=require(_0x42ce('0x3'));var rp=require(_0x42ce('0x4'));var fs=require('fs');var path=require(_0x42ce('0x5'));var rimraf=require(_0x42ce('0x6'));var config=require(_0x42ce('0x7'));var attributes=require(_0x42ce('0x8'));module['exports']=function(_0x467bc1,_0x3822e2){return _0x467bc1[_0x42ce('0x9')](_0x42ce('0xa'),attributes,{'tableName':_0x42ce('0xb'),'paranoid':![],'indexes':[{'name':_0x42ce('0xc'),'fields':['idField','FieldId'],'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 14e6236..ce1b28a 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 _0x7e28=['jayson/promise','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x51aef5,_0x1e9134){var _0x3f6385=function(_0x5e8503){while(--_0x5e8503){_0x51aef5['push'](_0x51aef5['shift']());}};_0x3f6385(++_0x1e9134);}(_0x7e28,0x109));var _0x87e2=function(_0x4d1716,_0x50b0e8){_0x4d1716=_0x4d1716-0x0;var _0x25ae73=_0x7e28[_0x4d1716];return _0x25ae73;};'use strict';var _=require(_0x87e2('0x0'));var util=require(_0x87e2('0x1'));var moment=require(_0x87e2('0x2'));var BPromise=require(_0x87e2('0x3'));var rs=require(_0x87e2('0x4'));var fs=require('fs');var Redis=require(_0x87e2('0x5'));var db=require(_0x87e2('0x6'))['db'];var utils=require(_0x87e2('0x7'));var logger=require(_0x87e2('0x8'))(_0x87e2('0x9'));var config=require(_0x87e2('0xa'));var jayson=require(_0x87e2('0xb'));var client=jayson['client'][_0x87e2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d6ef8,_0x2362ce,_0x4291d5){return new BPromise(function(_0x38059f,_0x4d6f7c){return client[_0x87e2('0xd')](_0x2d6ef8,_0x4291d5)['then'](function(_0x3f3fc8){logger[_0x87e2('0xe')](_0x87e2('0xf'),_0x2362ce,_0x87e2('0x10'));logger['debug'](_0x87e2('0x11'),_0x2362ce,_0x87e2('0x10'),JSON['stringify'](_0x3f3fc8));if(_0x3f3fc8[_0x87e2('0x12')]){if(_0x3f3fc8[_0x87e2('0x12')][_0x87e2('0x13')]===0x1f4){logger['error'](_0x87e2('0xf'),_0x2362ce,_0x3f3fc8[_0x87e2('0x12')][_0x87e2('0x14')]);return _0x4d6f7c(_0x3f3fc8['error'][_0x87e2('0x14')]);}logger[_0x87e2('0x12')](_0x87e2('0xf'),_0x2362ce,_0x3f3fc8['error']['message']);return _0x38059f(_0x3f3fc8['error'][_0x87e2('0x14')]);}else{logger['info'](_0x87e2('0xf'),_0x2362ce,'request\x20sent');_0x38059f(_0x3f3fc8[_0x87e2('0x15')][_0x87e2('0x14')]);}})[_0x87e2('0x16')](function(_0x57c959){logger['error'](_0x87e2('0xf'),_0x2362ce,_0x57c959);_0x4d6f7c(_0x57c959);});});} \ No newline at end of file +var _0x879e=['request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x22053b,_0x159706){var _0x3a0e8b=function(_0x4e1b91){while(--_0x4e1b91){_0x22053b['push'](_0x22053b['shift']());}};_0x3a0e8b(++_0x159706);}(_0x879e,0x14a));var _0xe879=function(_0x33b259,_0x2036be){_0x33b259=_0x33b259-0x0;var _0xf95548=_0x879e[_0x33b259];return _0xf95548;};'use strict';var _=require(_0xe879('0x0'));var util=require(_0xe879('0x1'));var moment=require('moment');var BPromise=require(_0xe879('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe879('0x3'));var db=require(_0xe879('0x4'))['db'];var utils=require(_0xe879('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe879('0x6'));var jayson=require(_0xe879('0x7'));var client=jayson[_0xe879('0x8')][_0xe879('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33421e,_0x55dc0a,_0x1d9598){return new BPromise(function(_0x52df2b,_0x3ad09b){return client[_0xe879('0xa')](_0x33421e,_0x1d9598)[_0xe879('0xb')](function(_0x5cfdbc){logger['info'](_0xe879('0xc'),_0x55dc0a,_0xe879('0xd'));logger[_0xe879('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x55dc0a,_0xe879('0xd'),JSON['stringify'](_0x5cfdbc));if(_0x5cfdbc[_0xe879('0xf')]){if(_0x5cfdbc[_0xe879('0xf')]['code']===0x1f4){logger[_0xe879('0xf')](_0xe879('0xc'),_0x55dc0a,_0x5cfdbc[_0xe879('0xf')][_0xe879('0x10')]);return _0x3ad09b(_0x5cfdbc[_0xe879('0xf')]['message']);}logger[_0xe879('0xf')](_0xe879('0xc'),_0x55dc0a,_0x5cfdbc[_0xe879('0xf')][_0xe879('0x10')]);return _0x52df2b(_0x5cfdbc['error'][_0xe879('0x10')]);}else{logger[_0xe879('0x11')]('ZendeskField,\x20%s,\x20%s',_0x55dc0a,_0xe879('0xd'));_0x52df2b(_0x5cfdbc[_0xe879('0x12')][_0xe879('0x10')]);}})[_0xe879('0x13')](function(_0x4afdcc){logger[_0xe879('0xf')](_0xe879('0xc'),_0x55dc0a,_0x4afdcc);_0x3ad09b(_0x4afdcc);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 599f18e..6c667f8 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 _0x2124=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','get','/:id/configurations','/:id/fields','post','create','addConfiguration','put','/:id','update','destroy','exports','multer','connect-timeout','express'];(function(_0x2d259a,_0x31068e){var _0x16f9d5=function(_0xfdf4af){while(--_0xfdf4af){_0x2d259a['push'](_0x2d259a['shift']());}};_0x16f9d5(++_0x31068e);}(_0x2124,0x151));var _0x4212=function(_0x528339,_0x3dfa45){_0x528339=_0x528339-0x0;var _0x12b270=_0x2124[_0x528339];return _0x12b270;};'use strict';var multer=require(_0x4212('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4212('0x1'));var express=require(_0x4212('0x2'));var router=express['Router']();var fs_extra=require(_0x4212('0x3'));var auth=require(_0x4212('0x4'));var interaction=require(_0x4212('0x5'));var config=require(_0x4212('0x6'));var controller=require(_0x4212('0x7'));router['get']('/',auth[_0x4212('0x8')](),controller['index']);router['get']('/:id',auth[_0x4212('0x8')](),controller['show']);router[_0x4212('0x9')](_0x4212('0xa'),auth[_0x4212('0x8')](),controller['getConfigurations']);router[_0x4212('0x9')](_0x4212('0xb'),auth[_0x4212('0x8')](),controller['getFields']);router[_0x4212('0xc')]('/',auth[_0x4212('0x8')](),controller[_0x4212('0xd')]);router[_0x4212('0xc')](_0x4212('0xa'),auth[_0x4212('0x8')](),controller[_0x4212('0xe')]);router[_0x4212('0xf')](_0x4212('0x10'),auth[_0x4212('0x8')](),controller[_0x4212('0x11')]);router['delete'](_0x4212('0x10'),auth['isAuthenticated'](),controller[_0x4212('0x12')]);module[_0x4212('0x13')]=router; \ No newline at end of file +var _0x19c0=['/:id/configurations','getConfigurations','/:id/fields','getFields','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','index','isAuthenticated','show'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x19c0,0x1e6));var _0x019c=function(_0x4fcf35,_0x5270be){_0x4fcf35=_0x4fcf35-0x0;var _0x105023=_0x19c0[_0x4fcf35];return _0x105023;};'use strict';var multer=require(_0x019c('0x0'));var util=require(_0x019c('0x1'));var path=require(_0x019c('0x2'));var timeout=require(_0x019c('0x3'));var express=require(_0x019c('0x4'));var router=express[_0x019c('0x5')]();var fs_extra=require(_0x019c('0x6'));var auth=require(_0x019c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x019c('0x8'));var controller=require(_0x019c('0x9'));router[_0x019c('0xa')]('/',auth['isAuthenticated'](),controller[_0x019c('0xb')]);router[_0x019c('0xa')]('/:id',auth[_0x019c('0xc')](),controller[_0x019c('0xd')]);router[_0x019c('0xa')](_0x019c('0xe'),auth[_0x019c('0xc')](),controller[_0x019c('0xf')]);router[_0x019c('0xa')](_0x019c('0x10'),auth[_0x019c('0xc')](),controller[_0x019c('0x11')]);router['post']('/',auth[_0x019c('0xc')](),controller[_0x019c('0x12')]);router['post'](_0x019c('0xe'),auth[_0x019c('0xc')](),controller['addConfiguration']);router[_0x019c('0x13')](_0x019c('0x14'),auth['isAuthenticated'](),controller[_0x019c('0x15')]);router[_0x019c('0x16')](_0x019c('0x14'),auth[_0x019c('0xc')](),controller[_0x019c('0x17')]);module[_0x019c('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 1de0b97..45089fc 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['STRING','sequelize','exports'];(function(_0x128955,_0x3c556d){var _0xc8f4fb=function(_0x47f8f5){while(--_0x47f8f5){_0x128955['push'](_0x128955['shift']());}};_0xc8f4fb(++_0x3c556d);}(_0x70e0,0x17b));var _0x070e=function(_0x51c85a,_0x2e8fec){_0x51c85a=_0x51c85a-0x0;var _0x2e6d1d=_0x70e0[_0x51c85a];return _0x2e6d1d;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'name':{'type':Sequelize[_0x070e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x070e('0x2')]},'clientId':{'type':Sequelize[_0x070e('0x2')]},'clientSecret':{'type':Sequelize[_0x070e('0x2')]},'serverUrl':{'type':Sequelize[_0x070e('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x070e('0x2')]}}; \ No newline at end of file +var _0x153f=['exports','STRING','sequelize'];(function(_0x1b5a5a,_0x1c3b75){var _0x42b32d=function(_0x3d35ab){while(--_0x3d35ab){_0x1b5a5a['push'](_0x1b5a5a['shift']());}};_0x42b32d(++_0x1c3b75);}(_0x153f,0x15b));var _0xf153=function(_0xc44e3b,_0x482dbe){_0xc44e3b=_0xc44e3b-0x0;var _0x686598=_0x153f[_0xc44e3b];return _0x686598;};'use strict';var Sequelize=require(_0xf153('0x0'));module[_0xf153('0x1')]={'name':{'type':Sequelize[_0xf153('0x2')]},'description':{'type':Sequelize[_0xf153('0x2')]},'host':{'type':Sequelize[_0xf153('0x2')]},'zone':{'type':Sequelize[_0xf153('0x2')]},'clientId':{'type':Sequelize[_0xf153('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf153('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xf153('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 325639f..58ab4b4 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 _0xd1dd=['statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','fieldName','key','map','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ZohoAccount','rows','show','find','create','catch','body','params','getConfigurations','ZohoConfiguration','order','addConfiguration','findOne','AccountId','Subjects','channel','type','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','com','slice','substring','lastIndexOf','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','error','message','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','custom_field','picklist','pick_list_values','test'];(function(_0x255c48,_0x2a4449){var _0xaebda3=function(_0x12a04e){while(--_0x12a04e){_0x255c48['push'](_0x255c48['shift']());}};_0xaebda3(++_0x2a4449);}(_0xd1dd,0x86));var _0xdd1d=function(_0x1c3c34,_0xabe69a){_0x1c3c34=_0x1c3c34-0x0;var _0x5aea77=_0xd1dd[_0x1c3c34];return _0x5aea77;};'use strict';var emlformat=require(_0xdd1d('0x0'));var rimraf=require(_0xdd1d('0x1'));var zipdir=require(_0xdd1d('0x2'));var jsonpatch=require(_0xdd1d('0x3'));var rp=require(_0xdd1d('0x4'));var moment=require('moment');var BPromise=require(_0xdd1d('0x5'));var Mustache=require(_0xdd1d('0x6'));var util=require(_0xdd1d('0x7'));var path=require(_0xdd1d('0x8'));var sox=require(_0xdd1d('0x9'));var csv=require(_0xdd1d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd1d('0xb'));var _=require(_0xdd1d('0xc'));var squel=require(_0xdd1d('0xd'));var crypto=require(_0xdd1d('0xe'));var jsforce=require(_0xdd1d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdd1d('0xa'));var querystring=require(_0xdd1d('0x10'));var Papa=require(_0xdd1d('0x11'));var Redis=require(_0xdd1d('0x12'));var authService=require(_0xdd1d('0x13'));var qs=require(_0xdd1d('0x14'));var as=require(_0xdd1d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd1d('0x16'))(_0xdd1d('0x17'));var utils=require('../../config/utils');var config=require(_0xdd1d('0x18'));var licenseUtil=require(_0xdd1d('0x19'));var db=require(_0xdd1d('0x1a'))['db'];var integrations=require(_0xdd1d('0x1b'));function respondWithStatusCode(_0x364813,_0x1a464b){_0x1a464b=_0x1a464b||0xcc;return function(_0x7b3a88){if(_0x7b3a88){return _0x364813[_0xdd1d('0x1c')](_0x1a464b);}return _0x364813[_0xdd1d('0x1d')](_0x1a464b)['end']();};}function respondWithResult(_0x58aac7,_0x2ce857){_0x2ce857=_0x2ce857||0xc8;return function(_0x4e56d4){if(_0x4e56d4){return _0x58aac7[_0xdd1d('0x1d')](_0x2ce857)[_0xdd1d('0x1e')](_0x4e56d4);}};}function respondWithFilteredResult(_0x21bcb6,_0x2ee3ad){return function(_0x44c7f3){if(_0x44c7f3){var _0x4fc7fd=typeof _0x2ee3ad['offset']==='undefined'&&typeof _0x2ee3ad[_0xdd1d('0x1f')]===_0xdd1d('0x20');var _0xcd967c=_0x44c7f3[_0xdd1d('0x21')];var _0x201040=_0x4fc7fd?0x0:_0x2ee3ad['offset'];var _0x3754bb=_0x4fc7fd?_0x44c7f3[_0xdd1d('0x21')]:_0x2ee3ad[_0xdd1d('0x22')]+_0x2ee3ad[_0xdd1d('0x1f')];var _0x18f1fd;if(_0x3754bb>=_0xcd967c){_0x3754bb=_0xcd967c;_0x18f1fd=0xc8;}else{_0x18f1fd=0xce;}_0x21bcb6[_0xdd1d('0x1d')](_0x18f1fd);return _0x21bcb6[_0xdd1d('0x23')](_0xdd1d('0x24'),_0x201040+'-'+_0x3754bb+'/'+_0xcd967c)[_0xdd1d('0x1e')](_0x44c7f3);}return null;};}function patchUpdates(_0x409f75){return function(_0x359a85){try{jsonpatch[_0xdd1d('0x25')](_0x359a85,_0x409f75,!![]);}catch(_0x19186d){return BPromise[_0xdd1d('0x26')](_0x19186d);}return _0x359a85[_0xdd1d('0x27')]();};}function saveUpdates(_0xf26915,_0x197862){return function(_0x212f86){if(_0x212f86){return _0x212f86[_0xdd1d('0x28')](_0xf26915)[_0xdd1d('0x29')](function(_0x442142){return _0x442142;});}return null;};}function removeEntity(_0xc7725f,_0x18e4c9){return function(_0x5746bb){if(_0x5746bb){return _0x5746bb[_0xdd1d('0x2a')]()[_0xdd1d('0x29')](function(){_0xc7725f[_0xdd1d('0x1d')](0xcc)[_0xdd1d('0x2b')]();});}};}function handleEntityNotFound(_0x11a8e1,_0x1788fd){return function(_0x120d34){if(!_0x120d34){_0x11a8e1['sendStatus'](0x194);}return _0x120d34;};}function handleError(_0x336ab6,_0x36e066){_0x36e066=_0x36e066||0x1f4;return function(_0xc9b317){logger['error'](_0xc9b317['stack']);if(_0xc9b317[_0xdd1d('0x2c')]){delete _0xc9b317[_0xdd1d('0x2c')];}_0x336ab6[_0xdd1d('0x1d')](_0x36e066)[_0xdd1d('0x2d')](_0xc9b317);};}exports[_0xdd1d('0x2e')]=function(_0x15c7cc,_0x5306aa){var _0x5ef343={},_0x598aab={},_0x4dea53={'count':0x0,'rows':[]};var _0x4e5e81=_['map'](db['ZohoAccount']['rawAttributes'],function(_0x9df4f0){return{'name':_0x9df4f0[_0xdd1d('0x2f')],'type':_0x9df4f0['type'][_0xdd1d('0x30')]};});_0x598aab['model']=_[_0xdd1d('0x31')](_0x4e5e81,_0xdd1d('0x2c'));_0x598aab['query']=_[_0xdd1d('0x32')](_0x15c7cc[_0xdd1d('0x33')]);_0x598aab[_0xdd1d('0x34')]=_['intersection'](_0x598aab[_0xdd1d('0x35')],_0x598aab['query']);_0x5ef343[_0xdd1d('0x36')]=_[_0xdd1d('0x37')](_0x598aab[_0xdd1d('0x35')],qs['fields'](_0x15c7cc[_0xdd1d('0x33')][_0xdd1d('0x38')]));_0x5ef343[_0xdd1d('0x36')]=_0x5ef343[_0xdd1d('0x36')][_0xdd1d('0x39')]?_0x5ef343[_0xdd1d('0x36')]:_0x598aab['model'];if(!_0x15c7cc[_0xdd1d('0x33')][_0xdd1d('0x3a')](_0xdd1d('0x3b'))){_0x5ef343['limit']=qs[_0xdd1d('0x1f')](_0x15c7cc['query']['limit']);_0x5ef343['offset']=qs[_0xdd1d('0x22')](_0x15c7cc[_0xdd1d('0x33')][_0xdd1d('0x22')]);}_0x5ef343['order']=qs[_0xdd1d('0x3c')](_0x15c7cc['query'][_0xdd1d('0x3c')]);_0x5ef343[_0xdd1d('0x3d')]=qs[_0xdd1d('0x34')](_[_0xdd1d('0x3e')](_0x15c7cc[_0xdd1d('0x33')],_0x598aab['filters']),_0x4e5e81);if(_0x15c7cc[_0xdd1d('0x33')][_0xdd1d('0x3f')]){_0x5ef343[_0xdd1d('0x3d')]=_[_0xdd1d('0x40')](_0x5ef343[_0xdd1d('0x3d')],{'$or':_[_0xdd1d('0x31')](_0x4e5e81,function(_0x1e1e41){if(_0x1e1e41['type']!==_0xdd1d('0x41')){var _0x521032={};_0x521032[_0x1e1e41[_0xdd1d('0x2c')]]={'$like':'%'+_0x15c7cc[_0xdd1d('0x33')][_0xdd1d('0x3f')]+'%'};return _0x521032;}})});}_0x5ef343=_[_0xdd1d('0x40')]({},_0x5ef343,_0x15c7cc[_0xdd1d('0x42')]);var _0x3e4edc={'where':_0x5ef343[_0xdd1d('0x3d')]};return db['ZohoAccount'][_0xdd1d('0x21')](_0x3e4edc)[_0xdd1d('0x29')](function(_0x45fef4){_0x4dea53[_0xdd1d('0x21')]=_0x45fef4;if(_0x15c7cc[_0xdd1d('0x33')][_0xdd1d('0x43')]){_0x5ef343[_0xdd1d('0x44')]=[{'all':!![]}];}return db[_0xdd1d('0x45')]['findAll'](_0x5ef343);})['then'](function(_0x125638){_0x4dea53[_0xdd1d('0x46')]=_0x125638;return _0x4dea53;})[_0xdd1d('0x29')](respondWithFilteredResult(_0x5306aa,_0x5ef343))['catch'](handleError(_0x5306aa,null));};exports[_0xdd1d('0x47')]=function(_0x4f26b3,_0x3c4de1){var _0xbe8c9f={'raw':![],'where':{'id':_0x4f26b3['params']['id']}},_0xa728c1={};_0xa728c1['model']=_[_0xdd1d('0x32')](db['ZohoAccount']['rawAttributes']);_0xa728c1[_0xdd1d('0x33')]=_[_0xdd1d('0x32')](_0x4f26b3[_0xdd1d('0x33')]);_0xa728c1[_0xdd1d('0x34')]=_[_0xdd1d('0x37')](_0xa728c1[_0xdd1d('0x35')],_0xa728c1['query']);_0xbe8c9f[_0xdd1d('0x36')]=_['intersection'](_0xa728c1[_0xdd1d('0x35')],qs[_0xdd1d('0x38')](_0x4f26b3[_0xdd1d('0x33')][_0xdd1d('0x38')]));_0xbe8c9f[_0xdd1d('0x36')]=_0xbe8c9f[_0xdd1d('0x36')]['length']?_0xbe8c9f[_0xdd1d('0x36')]:_0xa728c1[_0xdd1d('0x35')];if(_0x4f26b3[_0xdd1d('0x33')]['includeAll']){_0xbe8c9f[_0xdd1d('0x44')]=[{'all':!![]}];}_0xbe8c9f=_[_0xdd1d('0x40')]({},_0xbe8c9f,_0x4f26b3[_0xdd1d('0x42')]);return db['ZohoAccount'][_0xdd1d('0x48')](_0xbe8c9f)[_0xdd1d('0x29')](handleEntityNotFound(_0x3c4de1,null))['then'](respondWithResult(_0x3c4de1,null))['catch'](handleError(_0x3c4de1,null));};exports[_0xdd1d('0x49')]=function(_0x5c97f2,_0x338e6c){return db[_0xdd1d('0x45')][_0xdd1d('0x49')](_0x5c97f2['body'],{})[_0xdd1d('0x29')](respondWithResult(_0x338e6c,0xc9))[_0xdd1d('0x4a')](handleError(_0x338e6c,null));};exports[_0xdd1d('0x28')]=function(_0x2ca057,_0x3ba205){if(_0x2ca057['body']['id']){delete _0x2ca057[_0xdd1d('0x4b')]['id'];}return db['ZohoAccount'][_0xdd1d('0x48')]({'where':{'id':_0x2ca057[_0xdd1d('0x4c')]['id']}})[_0xdd1d('0x29')](handleEntityNotFound(_0x3ba205,null))['then'](saveUpdates(_0x2ca057[_0xdd1d('0x4b')],null))[_0xdd1d('0x29')](respondWithResult(_0x3ba205,null))[_0xdd1d('0x4a')](handleError(_0x3ba205,null));};exports[_0xdd1d('0x2a')]=function(_0x3e1e2b,_0x28eaa3){return db[_0xdd1d('0x45')]['find']({'where':{'id':_0x3e1e2b[_0xdd1d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x28eaa3,null))[_0xdd1d('0x29')](removeEntity(_0x28eaa3,null))[_0xdd1d('0x4a')](handleError(_0x28eaa3,null));};exports[_0xdd1d('0x4d')]=function(_0x1cfc7e,_0x214990,_0x26f333){var _0x549ac5={};var _0x250b5a={};var _0x27e8ba;var _0x200666;return db[_0xdd1d('0x45')]['findOne']({'where':{'id':_0x1cfc7e[_0xdd1d('0x4c')]['id']}})[_0xdd1d('0x29')](handleEntityNotFound(_0x214990,null))['then'](function(_0x247642){if(_0x247642){_0x27e8ba=_0x247642;_0x250b5a[_0xdd1d('0x35')]=_[_0xdd1d('0x32')](db[_0xdd1d('0x4e')]['rawAttributes']);_0x250b5a[_0xdd1d('0x33')]=_[_0xdd1d('0x32')](_0x1cfc7e[_0xdd1d('0x33')]);_0x250b5a[_0xdd1d('0x34')]=_[_0xdd1d('0x37')](_0x250b5a[_0xdd1d('0x35')],_0x250b5a[_0xdd1d('0x33')]);_0x549ac5['attributes']=_[_0xdd1d('0x37')](_0x250b5a[_0xdd1d('0x35')],qs[_0xdd1d('0x38')](_0x1cfc7e[_0xdd1d('0x33')][_0xdd1d('0x38')]));_0x549ac5[_0xdd1d('0x36')]=_0x549ac5['attributes']['length']?_0x549ac5[_0xdd1d('0x36')]:_0x250b5a['model'];_0x549ac5[_0xdd1d('0x4f')]=qs['sort'](_0x1cfc7e['query']['sort']);_0x549ac5[_0xdd1d('0x3d')]=qs[_0xdd1d('0x34')](_['pick'](_0x1cfc7e[_0xdd1d('0x33')],_0x250b5a[_0xdd1d('0x34')]));if(_0x1cfc7e['query'][_0xdd1d('0x3f')]){_0x549ac5[_0xdd1d('0x3d')]=_['merge'](_0x549ac5['where'],{'$or':_[_0xdd1d('0x31')](_0x549ac5[_0xdd1d('0x36')],function(_0x32c180){var _0x35482f={};_0x35482f[_0x32c180]={'$like':'%'+_0x1cfc7e['query'][_0xdd1d('0x3f')]+'%'};return _0x35482f;})});}_0x549ac5=_[_0xdd1d('0x40')]({},_0x549ac5,_0x1cfc7e['options']);return _0x27e8ba['getConfigurations'](_0x549ac5);}})[_0xdd1d('0x29')](function(_0x4b6892){if(_0x4b6892){_0x200666=_0x4b6892[_0xdd1d('0x39')];if(!_0x1cfc7e[_0xdd1d('0x33')][_0xdd1d('0x3a')]('nolimit')){_0x549ac5[_0xdd1d('0x1f')]=qs[_0xdd1d('0x1f')](_0x1cfc7e[_0xdd1d('0x33')][_0xdd1d('0x1f')]);_0x549ac5['offset']=qs['offset'](_0x1cfc7e['query']['offset']);}return _0x27e8ba['getConfigurations'](_0x549ac5);}})[_0xdd1d('0x29')](function(_0xcc4c26){if(_0xcc4c26){return _0xcc4c26?{'count':_0x200666,'rows':_0xcc4c26}:null;}})[_0xdd1d('0x29')](respondWithResult(_0x214990,null))[_0xdd1d('0x4a')](handleError(_0x214990,null));};exports[_0xdd1d('0x50')]=function(_0x2b126d,_0x283ab7,_0xd32463){if(_0x2b126d['body']['id']){delete _0x2b126d['body']['id'];}return db['ZohoAccount'][_0xdd1d('0x51')]({'where':{'id':_0x2b126d['params']['id']}})[_0xdd1d('0x29')](handleEntityNotFound(_0x283ab7,null))[_0xdd1d('0x29')](function(_0xa53cdc){if(_0xa53cdc){_0x2b126d[_0xdd1d('0x4b')][_0xdd1d('0x52')]=_0xa53cdc['id'];_0x2b126d[_0xdd1d('0x4b')][_0xdd1d('0x53')]=integrations['getSubjects'](_0x2b126d[_0xdd1d('0x4b')][_0xdd1d('0x54')],_0x2b126d[_0xdd1d('0x4b')][_0xdd1d('0x55')]);_0x2b126d[_0xdd1d('0x4b')][_0xdd1d('0x56')]=integrations[_0xdd1d('0x57')](_0x2b126d['body'][_0xdd1d('0x54')],_0x2b126d[_0xdd1d('0x4b')][_0xdd1d('0x55')]);return db[_0xdd1d('0x4e')][_0xdd1d('0x49')](_0x2b126d[_0xdd1d('0x4b')],{'include':[{'model':db[_0xdd1d('0x58')],'as':'Subjects'},{'model':db[_0xdd1d('0x58')],'as':_0xdd1d('0x56')}]});}return null;})[_0xdd1d('0x29')](respondWithResult(_0x283ab7,null))[_0xdd1d('0x4a')](handleError(_0x283ab7,null));};function getAccessToken(_0x26c754){return new Promise(function(_0x3b3c55,_0x14a8fc){var _0x2b7167;switch(_0x26c754[_0xdd1d('0x59')]){case'US':_0x2b7167=_0xdd1d('0x5a');break;case'AU':_0x2b7167='https://accounts.zoho.com.au';break;case'EU':_0x2b7167=_0xdd1d('0x5b');break;case'IN':_0x2b7167=_0xdd1d('0x5c');break;case'CN':_0x2b7167='https://accounts.zoho.com.cn';break;default:_0x2b7167=_0xdd1d('0x5b');break;}var _0x4c2900={'method':_0xdd1d('0x5d'),'uri':_0x2b7167+'/oauth/v2/token','qs':{'refresh_token':_0x26c754[_0xdd1d('0x5e')],'client_id':_0x26c754[_0xdd1d('0x5f')],'client_secret':_0x26c754[_0xdd1d('0x60')],'grant_type':_0xdd1d('0x61')},'json':!![]};return rp(_0x4c2900)[_0xdd1d('0x29')](function(_0x489ed4){if(_0x489ed4[_0xdd1d('0x62')]){_0x3b3c55(_0x489ed4['access_token']);}else{_0x14a8fc(_0xdd1d('0x63'));}})[_0xdd1d('0x4a')](function(_0x2a4786){_0x14a8fc(_0x2a4786);});});}exports['getFields']=function(_0x50e924,_0x588e7f,_0x547eff){var _0x4f19b1,_0x40772b,_0x3bd9c3,_0xa5e525,_0x43a403;return db[_0xdd1d('0x45')][_0xdd1d('0x51')]({'where':{'id':_0x50e924['params']['id']},'attributes':['id',_0xdd1d('0x64'),_0xdd1d('0x59'),_0xdd1d('0x5f'),'clientSecret',_0xdd1d('0x65'),'code',_0xdd1d('0x5e')]})[_0xdd1d('0x29')](handleEntityNotFound(_0x588e7f,null))['then'](function(_0x275a1b){_0x43a403=_0x275a1b;_0x4f19b1=_0x43a403[_0xdd1d('0x64')];_0x40772b=_0x4f19b1==='zoho.eu'?'eu':_0xdd1d('0x66');_0x3bd9c3=_0x43a403[_0xdd1d('0x65')];var _0x3b2155=_0x3bd9c3[_0xdd1d('0x67')](-0x1);if(_0x3b2155==='/'||_0x3b2155==='\x5c'||_0x3b2155===':'){_0x3bd9c3=_0x3bd9c3[_0xdd1d('0x68')](0x0,_0x3bd9c3[_0xdd1d('0x69')](_0x3b2155));}if(!_0x43a403[_0xdd1d('0x5e')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x43a403);})[_0xdd1d('0x29')](function(_0x1840ed){if(_0x1840ed){return rp({'method':'GET','uri':util[_0xdd1d('0x6a')](_0xdd1d('0x6b'),_0x40772b),'qs':{'module':'Calls'},'headers':{'Authorization':_0xdd1d('0x6c')+_0x1840ed},'json':!![]});}})[_0xdd1d('0x29')](function(_0x3e8726){if(_0x3e8726){if(_0x3e8726['response']&&_0x3e8726[_0xdd1d('0x6d')]['error']){throw new Error(_0x3e8726[_0xdd1d('0x6d')][_0xdd1d('0x6e')][_0xdd1d('0x6f')]);}var _0x120df3=[];var _0x1630c5=[];var _0x4a96f4=['Owner',_0xdd1d('0x70'),_0xdd1d('0x71'),'WhoId',_0xdd1d('0x72'),_0xdd1d('0x73'),_0xdd1d('0x74'),_0xdd1d('0x75')];_0x1630c5=_[_0xdd1d('0x76')](_0x3e8726[_0xdd1d('0x38')],function(_0xb87ff){return _0x4a96f4[_0xdd1d('0x77')](_0xb87ff['api_name']);});for(var _0x35a1aa=0x0;_0x35a1aa<_0x1630c5[_0xdd1d('0x39')];_0x35a1aa++){if(_0x1630c5[_0x35a1aa][_0xdd1d('0x78')]===![]){_0x120df3[_0xdd1d('0x79')]({'id':_0x1630c5[_0x35a1aa]['id'],'name':_0x1630c5[_0x35a1aa]['display_label'],'custom':_0x1630c5[_0x35a1aa][_0xdd1d('0x7a')],'options':_0x1630c5[_0x35a1aa]['data_type']===_0xdd1d('0x7b')&&_0x1630c5[_0x35a1aa][_0xdd1d('0x7c')][_0xdd1d('0x39')]>-0x1?_[_0xdd1d('0x31')](_0x1630c5[_0x35a1aa]['pick_list_values'],function(_0x3f6012){return{'name':_0x3f6012,'value':_0x3f6012};}):[]});}}return{'count':_0x120df3[_0xdd1d('0x39')],'rows':_0x120df3};}else{return{'count':0x0,'rows':[]};}})[_0xdd1d('0x29')](respondWithResult(_0x588e7f,null))['catch'](function(_0x3bf72b){var _0x12d8b8=_0x50e924[_0xdd1d('0x33')][_0xdd1d('0x7d')]?0x1f4:_0x3bf72b[_0xdd1d('0x7e')]||0x1f4;logger[_0xdd1d('0x6e')](_0xdd1d('0x7f'),_0xdd1d('0x80'),_0x12d8b8,JSON[_0xdd1d('0x81')](_0x3bf72b));delete _0x3bf72b[_0xdd1d('0x2c')];if(_0x12d8b8===0x191){_0x12d8b8=0x190;}_0x588e7f[_0xdd1d('0x1d')](_0x12d8b8)[_0xdd1d('0x2d')](_0x50e924[_0xdd1d('0x33')][_0xdd1d('0x7d')]?{'message':'Wrong\x20credentials','statusCode':_0x3bf72b[_0xdd1d('0x7e')]}:_0x3bf72b);});}; \ No newline at end of file +var _0x043a=['serverUrl','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Owner','Description','WhoId','Call_Result','Call_Type','system_mandatory','push','display_label','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','find','create','body','destroy','getConfigurations','order','addConfiguration','findOne','AccountId','getSubjects','channel','getDescriptions','Subjects','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','code','host','zoho.eu','com'];(function(_0x1233d2,_0x5416f4){var _0x22759e=function(_0xb516aa){while(--_0xb516aa){_0x1233d2['push'](_0x1233d2['shift']());}};_0x22759e(++_0x5416f4);}(_0x043a,0x192));var _0xa043=function(_0x117926,_0x5dd229){_0x117926=_0x117926-0x0;var _0x3582c1=_0x043a[_0x117926];return _0x3582c1;};'use strict';var emlformat=require(_0xa043('0x0'));var rimraf=require(_0xa043('0x1'));var zipdir=require(_0xa043('0x2'));var jsonpatch=require(_0xa043('0x3'));var rp=require(_0xa043('0x4'));var moment=require(_0xa043('0x5'));var BPromise=require(_0xa043('0x6'));var Mustache=require('mustache');var util=require(_0xa043('0x7'));var path=require(_0xa043('0x8'));var sox=require(_0xa043('0x9'));var csv=require(_0xa043('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa043('0xb'));var _=require('lodash');var squel=require(_0xa043('0xc'));var crypto=require(_0xa043('0xd'));var jsforce=require(_0xa043('0xe'));var deskjs=require(_0xa043('0xf'));var toCsv=require(_0xa043('0xa'));var querystring=require('querystring');var Papa=require(_0xa043('0x10'));var Redis=require('ioredis');var authService=require(_0xa043('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa043('0x12'));var hardwareService=require(_0xa043('0x13'));var logger=require(_0xa043('0x14'))(_0xa043('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa043('0x16'));var db=require(_0xa043('0x17'))['db'];var integrations=require(_0xa043('0x18'));function respondWithStatusCode(_0x3ec180,_0x4171dd){_0x4171dd=_0x4171dd||0xcc;return function(_0x4238c1){if(_0x4238c1){return _0x3ec180['sendStatus'](_0x4171dd);}return _0x3ec180[_0xa043('0x19')](_0x4171dd)[_0xa043('0x1a')]();};}function respondWithResult(_0x561900,_0x3514a8){_0x3514a8=_0x3514a8||0xc8;return function(_0x3665bf){if(_0x3665bf){return _0x561900[_0xa043('0x19')](_0x3514a8)[_0xa043('0x1b')](_0x3665bf);}};}function respondWithFilteredResult(_0x5c39b0,_0x11e79e){return function(_0x18469a){if(_0x18469a){var _0x4080ec=typeof _0x11e79e[_0xa043('0x1c')]==='undefined'&&typeof _0x11e79e[_0xa043('0x1d')]===_0xa043('0x1e');var _0x5399f7=_0x18469a[_0xa043('0x1f')];var _0x495e66=_0x4080ec?0x0:_0x11e79e[_0xa043('0x1c')];var _0xebbf17=_0x4080ec?_0x18469a['count']:_0x11e79e['offset']+_0x11e79e['limit'];var _0x4eef2f;if(_0xebbf17>=_0x5399f7){_0xebbf17=_0x5399f7;_0x4eef2f=0xc8;}else{_0x4eef2f=0xce;}_0x5c39b0[_0xa043('0x19')](_0x4eef2f);return _0x5c39b0[_0xa043('0x20')]('Content-Range',_0x495e66+'-'+_0xebbf17+'/'+_0x5399f7)['json'](_0x18469a);}return null;};}function patchUpdates(_0x344562){return function(_0x5995b9){try{jsonpatch[_0xa043('0x21')](_0x5995b9,_0x344562,!![]);}catch(_0x28a440){return BPromise[_0xa043('0x22')](_0x28a440);}return _0x5995b9[_0xa043('0x23')]();};}function saveUpdates(_0x3d78a5,_0x576b3b){return function(_0x54867c){if(_0x54867c){return _0x54867c[_0xa043('0x24')](_0x3d78a5)[_0xa043('0x25')](function(_0x4b0820){return _0x4b0820;});}return null;};}function removeEntity(_0x1ff479,_0x35c8f0){return function(_0x296239){if(_0x296239){return _0x296239['destroy']()[_0xa043('0x25')](function(){_0x1ff479['status'](0xcc)[_0xa043('0x1a')]();});}};}function handleEntityNotFound(_0x295483,_0x364ac2){return function(_0x5807e3){if(!_0x5807e3){_0x295483[_0xa043('0x26')](0x194);}return _0x5807e3;};}function handleError(_0x596195,_0x4265b8){_0x4265b8=_0x4265b8||0x1f4;return function(_0x5d54a2){logger[_0xa043('0x27')](_0x5d54a2[_0xa043('0x28')]);if(_0x5d54a2['name']){delete _0x5d54a2[_0xa043('0x29')];}_0x596195['status'](_0x4265b8)[_0xa043('0x2a')](_0x5d54a2);};}exports[_0xa043('0x2b')]=function(_0x55644f,_0x182720){var _0x5a38e0={},_0x42bc92={},_0x22dddd={'count':0x0,'rows':[]};var _0xcffc82=_[_0xa043('0x2c')](db[_0xa043('0x2d')][_0xa043('0x2e')],function(_0x16a2d){return{'name':_0x16a2d[_0xa043('0x2f')],'type':_0x16a2d[_0xa043('0x30')]['key']};});_0x42bc92[_0xa043('0x31')]=_['map'](_0xcffc82,_0xa043('0x29'));_0x42bc92[_0xa043('0x32')]=_[_0xa043('0x33')](_0x55644f[_0xa043('0x32')]);_0x42bc92['filters']=_[_0xa043('0x34')](_0x42bc92[_0xa043('0x31')],_0x42bc92['query']);_0x5a38e0[_0xa043('0x35')]=_['intersection'](_0x42bc92[_0xa043('0x31')],qs[_0xa043('0x36')](_0x55644f[_0xa043('0x32')]['fields']));_0x5a38e0[_0xa043('0x35')]=_0x5a38e0[_0xa043('0x35')][_0xa043('0x37')]?_0x5a38e0['attributes']:_0x42bc92['model'];if(!_0x55644f[_0xa043('0x32')][_0xa043('0x38')](_0xa043('0x39'))){_0x5a38e0[_0xa043('0x1d')]=qs['limit'](_0x55644f['query']['limit']);_0x5a38e0[_0xa043('0x1c')]=qs[_0xa043('0x1c')](_0x55644f['query']['offset']);}_0x5a38e0['order']=qs[_0xa043('0x3a')](_0x55644f['query']['sort']);_0x5a38e0[_0xa043('0x3b')]=qs[_0xa043('0x3c')](_[_0xa043('0x3d')](_0x55644f[_0xa043('0x32')],_0x42bc92[_0xa043('0x3c')]),_0xcffc82);if(_0x55644f[_0xa043('0x32')][_0xa043('0x3e')]){_0x5a38e0[_0xa043('0x3b')]=_['merge'](_0x5a38e0['where'],{'$or':_[_0xa043('0x2c')](_0xcffc82,function(_0xad3609){if(_0xad3609[_0xa043('0x30')]!==_0xa043('0x3f')){var _0x488d07={};_0x488d07[_0xad3609['name']]={'$like':'%'+_0x55644f[_0xa043('0x32')][_0xa043('0x3e')]+'%'};return _0x488d07;}})});}_0x5a38e0=_['merge']({},_0x5a38e0,_0x55644f[_0xa043('0x40')]);var _0x1b9605={'where':_0x5a38e0['where']};return db['ZohoAccount']['count'](_0x1b9605)[_0xa043('0x25')](function(_0x3bf361){_0x22dddd[_0xa043('0x1f')]=_0x3bf361;if(_0x55644f[_0xa043('0x32')][_0xa043('0x41')]){_0x5a38e0[_0xa043('0x42')]=[{'all':!![]}];}return db[_0xa043('0x2d')]['findAll'](_0x5a38e0);})[_0xa043('0x25')](function(_0x490586){_0x22dddd[_0xa043('0x43')]=_0x490586;return _0x22dddd;})[_0xa043('0x25')](respondWithFilteredResult(_0x182720,_0x5a38e0))[_0xa043('0x44')](handleError(_0x182720,null));};exports[_0xa043('0x45')]=function(_0x5ed28d,_0x12aa8d){var _0x343f8f={'raw':![],'where':{'id':_0x5ed28d[_0xa043('0x46')]['id']}},_0x4f38e7={};_0x4f38e7[_0xa043('0x31')]=_[_0xa043('0x33')](db[_0xa043('0x2d')][_0xa043('0x2e')]);_0x4f38e7[_0xa043('0x32')]=_[_0xa043('0x33')](_0x5ed28d[_0xa043('0x32')]);_0x4f38e7[_0xa043('0x3c')]=_[_0xa043('0x34')](_0x4f38e7[_0xa043('0x31')],_0x4f38e7[_0xa043('0x32')]);_0x343f8f[_0xa043('0x35')]=_['intersection'](_0x4f38e7[_0xa043('0x31')],qs[_0xa043('0x36')](_0x5ed28d[_0xa043('0x32')]['fields']));_0x343f8f[_0xa043('0x35')]=_0x343f8f[_0xa043('0x35')][_0xa043('0x37')]?_0x343f8f['attributes']:_0x4f38e7['model'];if(_0x5ed28d['query'][_0xa043('0x41')]){_0x343f8f[_0xa043('0x42')]=[{'all':!![]}];}_0x343f8f=_[_0xa043('0x47')]({},_0x343f8f,_0x5ed28d[_0xa043('0x40')]);return db[_0xa043('0x2d')][_0xa043('0x48')](_0x343f8f)['then'](handleEntityNotFound(_0x12aa8d,null))[_0xa043('0x25')](respondWithResult(_0x12aa8d,null))[_0xa043('0x44')](handleError(_0x12aa8d,null));};exports[_0xa043('0x49')]=function(_0x3d4dad,_0x1dac37){return db['ZohoAccount'][_0xa043('0x49')](_0x3d4dad[_0xa043('0x4a')],{})[_0xa043('0x25')](respondWithResult(_0x1dac37,0xc9))[_0xa043('0x44')](handleError(_0x1dac37,null));};exports[_0xa043('0x24')]=function(_0x174f79,_0x470889){if(_0x174f79[_0xa043('0x4a')]['id']){delete _0x174f79[_0xa043('0x4a')]['id'];}return db[_0xa043('0x2d')][_0xa043('0x48')]({'where':{'id':_0x174f79[_0xa043('0x46')]['id']}})[_0xa043('0x25')](handleEntityNotFound(_0x470889,null))[_0xa043('0x25')](saveUpdates(_0x174f79[_0xa043('0x4a')],null))['then'](respondWithResult(_0x470889,null))[_0xa043('0x44')](handleError(_0x470889,null));};exports[_0xa043('0x4b')]=function(_0x5f3765,_0xe0adfe){return db[_0xa043('0x2d')]['find']({'where':{'id':_0x5f3765[_0xa043('0x46')]['id']}})[_0xa043('0x25')](handleEntityNotFound(_0xe0adfe,null))['then'](removeEntity(_0xe0adfe,null))['catch'](handleError(_0xe0adfe,null));};exports[_0xa043('0x4c')]=function(_0x183a08,_0x274555,_0x542408){var _0x34e04c={};var _0x1fd302={};var _0x519eda;var _0x48515a;return db[_0xa043('0x2d')]['findOne']({'where':{'id':_0x183a08[_0xa043('0x46')]['id']}})[_0xa043('0x25')](handleEntityNotFound(_0x274555,null))['then'](function(_0x2f8862){if(_0x2f8862){_0x519eda=_0x2f8862;_0x1fd302[_0xa043('0x31')]=_[_0xa043('0x33')](db['ZohoConfiguration'][_0xa043('0x2e')]);_0x1fd302[_0xa043('0x32')]=_[_0xa043('0x33')](_0x183a08[_0xa043('0x32')]);_0x1fd302[_0xa043('0x3c')]=_[_0xa043('0x34')](_0x1fd302[_0xa043('0x31')],_0x1fd302['query']);_0x34e04c['attributes']=_[_0xa043('0x34')](_0x1fd302[_0xa043('0x31')],qs['fields'](_0x183a08[_0xa043('0x32')][_0xa043('0x36')]));_0x34e04c[_0xa043('0x35')]=_0x34e04c[_0xa043('0x35')][_0xa043('0x37')]?_0x34e04c[_0xa043('0x35')]:_0x1fd302[_0xa043('0x31')];_0x34e04c[_0xa043('0x4d')]=qs[_0xa043('0x3a')](_0x183a08[_0xa043('0x32')]['sort']);_0x34e04c[_0xa043('0x3b')]=qs['filters'](_['pick'](_0x183a08[_0xa043('0x32')],_0x1fd302['filters']));if(_0x183a08['query'][_0xa043('0x3e')]){_0x34e04c[_0xa043('0x3b')]=_[_0xa043('0x47')](_0x34e04c[_0xa043('0x3b')],{'$or':_[_0xa043('0x2c')](_0x34e04c[_0xa043('0x35')],function(_0x32659c){var _0x1b479e={};_0x1b479e[_0x32659c]={'$like':'%'+_0x183a08[_0xa043('0x32')]['filter']+'%'};return _0x1b479e;})});}_0x34e04c=_[_0xa043('0x47')]({},_0x34e04c,_0x183a08['options']);return _0x519eda['getConfigurations'](_0x34e04c);}})[_0xa043('0x25')](function(_0x4fea21){if(_0x4fea21){_0x48515a=_0x4fea21[_0xa043('0x37')];if(!_0x183a08[_0xa043('0x32')]['hasOwnProperty'](_0xa043('0x39'))){_0x34e04c['limit']=qs[_0xa043('0x1d')](_0x183a08[_0xa043('0x32')][_0xa043('0x1d')]);_0x34e04c[_0xa043('0x1c')]=qs[_0xa043('0x1c')](_0x183a08[_0xa043('0x32')]['offset']);}return _0x519eda[_0xa043('0x4c')](_0x34e04c);}})['then'](function(_0x2e990c){if(_0x2e990c){return _0x2e990c?{'count':_0x48515a,'rows':_0x2e990c}:null;}})[_0xa043('0x25')](respondWithResult(_0x274555,null))[_0xa043('0x44')](handleError(_0x274555,null));};exports[_0xa043('0x4e')]=function(_0x40aa6a,_0x5bed80,_0x2e4e5d){if(_0x40aa6a[_0xa043('0x4a')]['id']){delete _0x40aa6a[_0xa043('0x4a')]['id'];}return db['ZohoAccount'][_0xa043('0x4f')]({'where':{'id':_0x40aa6a[_0xa043('0x46')]['id']}})['then'](handleEntityNotFound(_0x5bed80,null))[_0xa043('0x25')](function(_0x2cbf98){if(_0x2cbf98){_0x40aa6a[_0xa043('0x4a')][_0xa043('0x50')]=_0x2cbf98['id'];_0x40aa6a['body']['Subjects']=integrations[_0xa043('0x51')](_0x40aa6a[_0xa043('0x4a')][_0xa043('0x52')],_0x40aa6a[_0xa043('0x4a')][_0xa043('0x30')]);_0x40aa6a[_0xa043('0x4a')]['Descriptions']=integrations[_0xa043('0x53')](_0x40aa6a[_0xa043('0x4a')][_0xa043('0x52')],_0x40aa6a['body'][_0xa043('0x30')]);return db['ZohoConfiguration'][_0xa043('0x49')](_0x40aa6a[_0xa043('0x4a')],{'include':[{'model':db['ZohoField'],'as':_0xa043('0x54')},{'model':db['ZohoField'],'as':_0xa043('0x55')}]});}return null;})[_0xa043('0x25')](respondWithResult(_0x5bed80,null))[_0xa043('0x44')](handleError(_0x5bed80,null));};function getAccessToken(_0x48d034){return new Promise(function(_0x232fcf,_0x2d3fc6){var _0xd18f1d;switch(_0x48d034[_0xa043('0x56')]){case'US':_0xd18f1d=_0xa043('0x57');break;case'AU':_0xd18f1d=_0xa043('0x58');break;case'EU':_0xd18f1d=_0xa043('0x59');break;case'IN':_0xd18f1d='https://accounts.zoho.in';break;case'CN':_0xd18f1d=_0xa043('0x5a');break;default:_0xd18f1d='https://accounts.zoho.eu';break;}var _0x1d950f={'method':_0xa043('0x5b'),'uri':_0xd18f1d+_0xa043('0x5c'),'qs':{'refresh_token':_0x48d034[_0xa043('0x5d')],'client_id':_0x48d034[_0xa043('0x5e')],'client_secret':_0x48d034[_0xa043('0x5f')],'grant_type':_0xa043('0x60')},'json':!![]};return rp(_0x1d950f)[_0xa043('0x25')](function(_0x16501c){if(_0x16501c[_0xa043('0x61')]){_0x232fcf(_0x16501c[_0xa043('0x61')]);}else{_0x2d3fc6('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x14bce4){_0x2d3fc6(_0x14bce4);});});}exports['getFields']=function(_0x381041,_0x2cea09,_0x1294ec){var _0x5a640f,_0x57ea22,_0x4593ad,_0x26eecb,_0x13f766;return db[_0xa043('0x2d')]['findOne']({'where':{'id':_0x381041[_0xa043('0x46')]['id']},'attributes':['id','host',_0xa043('0x56'),_0xa043('0x5e'),_0xa043('0x5f'),'serverUrl',_0xa043('0x62'),_0xa043('0x5d')]})[_0xa043('0x25')](handleEntityNotFound(_0x2cea09,null))['then'](function(_0x921412){_0x13f766=_0x921412;_0x5a640f=_0x13f766[_0xa043('0x63')];_0x57ea22=_0x5a640f===_0xa043('0x64')?'eu':_0xa043('0x65');_0x4593ad=_0x13f766[_0xa043('0x66')];var _0x21a755=_0x4593ad[_0xa043('0x67')](-0x1);if(_0x21a755==='/'||_0x21a755==='\x5c'||_0x21a755===':'){_0x4593ad=_0x4593ad['substring'](0x0,_0x4593ad[_0xa043('0x68')](_0x21a755));}if(!_0x13f766[_0xa043('0x5d')]){throw new Error(_0xa043('0x69'));}return getAccessToken(_0x13f766);})['then'](function(_0x276fa2){if(_0x276fa2){return rp({'method':'GET','uri':util[_0xa043('0x6a')](_0xa043('0x6b'),_0x57ea22),'qs':{'module':_0xa043('0x6c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x276fa2},'json':!![]});}})['then'](function(_0x2460c8){if(_0x2460c8){if(_0x2460c8[_0xa043('0x6d')]&&_0x2460c8[_0xa043('0x6d')][_0xa043('0x27')]){throw new Error(_0x2460c8[_0xa043('0x6d')][_0xa043('0x27')]['message']);}var _0x33ccd2=[];var _0x2cee3b=[];var _0x3533bd=[_0xa043('0x6e'),'Subject',_0xa043('0x6f'),_0xa043('0x70'),'Call_Duration',_0xa043('0x71'),'Call_Start_Time',_0xa043('0x72')];_0x2cee3b=_['remove'](_0x2460c8['fields'],function(_0x5d8e9e){return _0x3533bd['includes'](_0x5d8e9e['api_name']);});for(var _0xda7bd9=0x0;_0xda7bd9<_0x2cee3b[_0xa043('0x37')];_0xda7bd9++){if(_0x2cee3b[_0xda7bd9][_0xa043('0x73')]===![]){_0x33ccd2[_0xa043('0x74')]({'id':_0x2cee3b[_0xda7bd9]['id'],'name':_0x2cee3b[_0xda7bd9][_0xa043('0x75')],'custom':_0x2cee3b[_0xda7bd9]['custom_field'],'options':_0x2cee3b[_0xda7bd9]['data_type']===_0xa043('0x76')&&_0x2cee3b[_0xda7bd9]['pick_list_values']['length']>-0x1?_['map'](_0x2cee3b[_0xda7bd9][_0xa043('0x77')],function(_0xd54e5a){return{'name':_0xd54e5a,'value':_0xd54e5a};}):[]});}}return{'count':_0x33ccd2[_0xa043('0x37')],'rows':_0x33ccd2};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x2cea09,null))[_0xa043('0x44')](function(_0x32a34d){var _0xc2c2d2=_0x381041[_0xa043('0x32')][_0xa043('0x78')]?0x1f4:_0x32a34d[_0xa043('0x79')]||0x1f4;logger[_0xa043('0x27')](_0xa043('0x7a'),_0xa043('0x7b'),_0xc2c2d2,JSON[_0xa043('0x7c')](_0x32a34d));delete _0x32a34d['name'];if(_0xc2c2d2===0x191){_0xc2c2d2=0x190;}_0x2cea09[_0xa043('0x19')](_0xc2c2d2)['send'](_0x381041[_0xa043('0x32')][_0xa043('0x78')]?{'message':_0xa043('0x7d'),'statusCode':_0x32a34d[_0xa043('0x79')]}:_0x32a34d);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index dbf316c..6f4d8b5 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 _0x052e=['application/x-www-form-urlencoded','then','parse','refresh_token','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','exports','define','ZohoAccount','changed','serverUrl','clientId','clientSecret','code','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','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','error','lastIndexOf','zone','https://accounts.zoho.in','POST'];(function(_0x343b09,_0x2c8aac){var _0x1215d9=function(_0x189201){while(--_0x189201){_0x343b09['push'](_0x343b09['shift']());}};_0x1215d9(++_0x2c8aac);}(_0x052e,0x14c));var _0xe052=function(_0x5cb9fb,_0x2d5c2d){_0x5cb9fb=_0x5cb9fb-0x0;var _0x414c1f=_0x052e[_0x5cb9fb];return _0x414c1f;};'use strict';var _=require('lodash');var util=require(_0xe052('0x0'));var logger=require(_0xe052('0x1'))(_0xe052('0x2'));var moment=require('moment');var BPromise=require(_0xe052('0x3'));var rp=require(_0xe052('0x4'));var fs=require('fs');var path=require(_0xe052('0x5'));var rimraf=require(_0xe052('0x6'));var config=require('../../config/environment');var attributes=require(_0xe052('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xe052('0x8')]=function(_0x4e0f08,_0x379550){return _0x4e0f08[_0xe052('0x9')](_0xe052('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5325f4,_0x4e1392,_0x2e0ba6){if(_0x5325f4[_0xe052('0xb')]('zone')||_0x5325f4[_0xe052('0xb')](_0xe052('0xc'))||_0x5325f4[_0xe052('0xb')](_0xe052('0xd'))||_0x5325f4[_0xe052('0xb')](_0xe052('0xe'))||_0x5325f4[_0xe052('0xb')](_0xe052('0xf'))||_0x5325f4[_0xe052('0xb')](_0xe052('0x10'))){var _0xbd5b56,_0x2f2fff;_0xbd5b56=_0x5325f4['serverUrl'];var _0x38b800=_0xbd5b56[_0xe052('0x11')](-0x1);if(_0x38b800==='/'||_0x38b800==='\x5c'||_0x38b800===':'){_0xbd5b56=_0xbd5b56[_0xe052('0x12')](0x0,_0xbd5b56['lastIndexOf'](_0x38b800));}switch(_0x5325f4['zone']){case'US':_0x2f2fff=_0xe052('0x13');break;case'AU':_0x2f2fff=_0xe052('0x14');break;case'IN':_0x2f2fff='https://accounts.zoho.in';break;case'CN':_0x2f2fff=_0xe052('0x15');break;default:_0x2f2fff=_0xe052('0x16');break;}var _0x4abde4={'method':'POST','uri':_0x2f2fff+_0xe052('0x17'),'form':{'grant_type':_0xe052('0x18'),'client_id':_0x5325f4[_0xe052('0xd')],'client_secret':_0x5325f4[_0xe052('0xe')],'redirect_uri':_0x5325f4['serverUrl'],'code':_0x5325f4[_0xe052('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4abde4)['then'](function(_0x3b62c2){var _0x167ac3=JSON['parse'](_0x3b62c2);if(_0x167ac3['refresh_token']){_0x5325f4[_0xe052('0x19')]=_0x167ac3['refresh_token'];logger[_0xe052('0x1a')](util[_0xe052('0x1b')](_0xe052('0x1c'),_0x5325f4[_0xe052('0x1d')],_0x5325f4['id']));}else{logger['error'](util['format'](_0xe052('0x1e'),_0x5325f4[_0xe052('0x1d')],_0x5325f4['id']),util[_0xe052('0x1f')](_0x167ac3,{'showHidden':![],'depth':null}));}return _0x2e0ba6(null,_0x4e1392);})['catch'](function(_0x5c903b){logger[_0xe052('0x20')](util[_0xe052('0x1b')](_0xe052('0x1e'),_0x5325f4['name'],_0x5325f4['id']),util[_0xe052('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0x2e0ba6(_0x5c903b);});}else{return _0x2e0ba6(null,_0x4e1392);}},'beforeUpdate':function(_0x340f84,_0x122c78,_0x39e015){if(_0x340f84['changed']('zone')||_0x340f84[_0xe052('0xb')](_0xe052('0xc'))||_0x340f84[_0xe052('0xb')](_0xe052('0xd'))||_0x340f84[_0xe052('0xb')](_0xe052('0xe'))||_0x340f84[_0xe052('0xb')]('code')||_0x340f84[_0xe052('0xb')](_0xe052('0x10'))){var _0x2d1b7a,_0x80e723;_0x2d1b7a=_0x340f84[_0xe052('0xc')];var _0x23ddc3=_0x2d1b7a['slice'](-0x1);if(_0x23ddc3==='/'||_0x23ddc3==='\x5c'||_0x23ddc3===':'){_0x2d1b7a=_0x2d1b7a[_0xe052('0x12')](0x0,_0x2d1b7a[_0xe052('0x21')](_0x23ddc3));}switch(_0x340f84[_0xe052('0x22')]){case'US':_0x80e723=_0xe052('0x13');break;case'AU':_0x80e723=_0xe052('0x14');break;case'IN':_0x80e723=_0xe052('0x23');break;case'CN':_0x80e723='https://accounts.zoho.com.cn';break;default:_0x80e723=_0xe052('0x16');break;}var _0x8151f8={'method':_0xe052('0x24'),'uri':_0x80e723+_0xe052('0x17'),'form':{'grant_type':_0xe052('0x18'),'client_id':_0x340f84[_0xe052('0xd')],'client_secret':_0x340f84[_0xe052('0xe')],'redirect_uri':_0x340f84['serverUrl'],'code':_0x340f84[_0xe052('0xf')]},'headers':{'Content-Type':_0xe052('0x25')}};return rp(_0x8151f8)[_0xe052('0x26')](function(_0x1a6cde){var _0x22d761=JSON[_0xe052('0x27')](_0x1a6cde);if(_0x22d761[_0xe052('0x28')]){_0x340f84['refreshToken']=_0x22d761[_0xe052('0x28')];logger[_0xe052('0x1a')](util[_0xe052('0x1b')](_0xe052('0x1c'),_0x340f84['name'],_0x340f84['id']));}else{logger[_0xe052('0x20')](util[_0xe052('0x1b')](_0xe052('0x1e'),_0x340f84[_0xe052('0x1d')],_0x340f84['id']),util[_0xe052('0x1f')](_0x22d761,{'showHidden':![],'depth':null}));}return _0x39e015(null,_0x122c78);})['catch'](function(_0x10f170){logger['error'](util['format'](_0xe052('0x1e'),_0x340f84[_0xe052('0x1d')],_0x340f84['id']),util[_0xe052('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0x39e015(_0x10f170);});}else{return _0x39e015(null,_0x122c78);}}}});}; \ No newline at end of file +var _0xd0ea=['code','slice','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','application/x-www-form-urlencoded','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','error','host','substring','https://accounts.zoho.com','https://accounts.zoho.in','authorization_code','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','changed','zone','serverUrl','clientId','clientSecret'];(function(_0x57c6d4,_0x3b0c72){var _0x3243de=function(_0x487dd6){while(--_0x487dd6){_0x57c6d4['push'](_0x57c6d4['shift']());}};_0x3243de(++_0x3b0c72);}(_0xd0ea,0x6d));var _0xad0e=function(_0x6f24f9,_0x14049c){_0x6f24f9=_0x6f24f9-0x0;var _0x3d36d7=_0xd0ea[_0x6f24f9];return _0x3d36d7;};'use strict';var _=require(_0xad0e('0x0'));var util=require(_0xad0e('0x1'));var logger=require('../../config/logger')(_0xad0e('0x2'));var moment=require(_0xad0e('0x3'));var BPromise=require(_0xad0e('0x4'));var rp=require(_0xad0e('0x5'));var fs=require('fs');var path=require(_0xad0e('0x6'));var rimraf=require(_0xad0e('0x7'));var config=require(_0xad0e('0x8'));var attributes=require(_0xad0e('0x9'));var integrations=require(_0xad0e('0xa'));module[_0xad0e('0xb')]=function(_0x91eb2c,_0x55f389){return _0x91eb2c['define']('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x52a8b0,_0x38f71e,_0x25db0e){if(_0x52a8b0[_0xad0e('0xc')](_0xad0e('0xd'))||_0x52a8b0[_0xad0e('0xc')](_0xad0e('0xe'))||_0x52a8b0[_0xad0e('0xc')](_0xad0e('0xf'))||_0x52a8b0[_0xad0e('0xc')](_0xad0e('0x10'))||_0x52a8b0['changed'](_0xad0e('0x11'))||_0x52a8b0['changed']('host')){var _0x504111,_0x266e16;_0x504111=_0x52a8b0[_0xad0e('0xe')];var _0xcc70e=_0x504111[_0xad0e('0x12')](-0x1);if(_0xcc70e==='/'||_0xcc70e==='\x5c'||_0xcc70e===':'){_0x504111=_0x504111['substring'](0x0,_0x504111[_0xad0e('0x13')](_0xcc70e));}switch(_0x52a8b0['zone']){case'US':_0x266e16='https://accounts.zoho.com';break;case'AU':_0x266e16=_0xad0e('0x14');break;case'IN':_0x266e16='https://accounts.zoho.in';break;case'CN':_0x266e16=_0xad0e('0x15');break;default:_0x266e16=_0xad0e('0x16');break;}var _0x4d3f65={'method':_0xad0e('0x17'),'uri':_0x266e16+_0xad0e('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x52a8b0['clientId'],'client_secret':_0x52a8b0[_0xad0e('0x10')],'redirect_uri':_0x52a8b0['serverUrl'],'code':_0x52a8b0[_0xad0e('0x11')]},'headers':{'Content-Type':_0xad0e('0x19')}};return rp(_0x4d3f65)['then'](function(_0x3538fc){var _0x26ba0d=JSON[_0xad0e('0x1a')](_0x3538fc);if(_0x26ba0d[_0xad0e('0x1b')]){_0x52a8b0[_0xad0e('0x1c')]=_0x26ba0d[_0xad0e('0x1b')];logger[_0xad0e('0x1d')](util[_0xad0e('0x1e')](_0xad0e('0x1f'),_0x52a8b0[_0xad0e('0x20')],_0x52a8b0['id']));}else{logger['error'](util[_0xad0e('0x1e')](_0xad0e('0x21'),_0x52a8b0['name'],_0x52a8b0['id']),util[_0xad0e('0x22')](_0x26ba0d,{'showHidden':![],'depth':null}));}return _0x25db0e(null,_0x38f71e);})[_0xad0e('0x23')](function(_0x5c8724){logger[_0xad0e('0x24')](util[_0xad0e('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x52a8b0[_0xad0e('0x20')],_0x52a8b0['id']),util[_0xad0e('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x25db0e(_0x5c8724);});}else{return _0x25db0e(null,_0x38f71e);}},'beforeUpdate':function(_0x1f4fd9,_0x571aaa,_0x279ead){if(_0x1f4fd9[_0xad0e('0xc')]('zone')||_0x1f4fd9[_0xad0e('0xc')](_0xad0e('0xe'))||_0x1f4fd9[_0xad0e('0xc')](_0xad0e('0xf'))||_0x1f4fd9['changed'](_0xad0e('0x10'))||_0x1f4fd9[_0xad0e('0xc')]('code')||_0x1f4fd9[_0xad0e('0xc')](_0xad0e('0x25'))){var _0x2b2e6f,_0x2f4afa;_0x2b2e6f=_0x1f4fd9['serverUrl'];var _0x595234=_0x2b2e6f['slice'](-0x1);if(_0x595234==='/'||_0x595234==='\x5c'||_0x595234===':'){_0x2b2e6f=_0x2b2e6f[_0xad0e('0x26')](0x0,_0x2b2e6f[_0xad0e('0x13')](_0x595234));}switch(_0x1f4fd9[_0xad0e('0xd')]){case'US':_0x2f4afa=_0xad0e('0x27');break;case'AU':_0x2f4afa=_0xad0e('0x14');break;case'IN':_0x2f4afa=_0xad0e('0x28');break;case'CN':_0x2f4afa=_0xad0e('0x15');break;default:_0x2f4afa=_0xad0e('0x16');break;}var _0x36f484={'method':_0xad0e('0x17'),'uri':_0x2f4afa+_0xad0e('0x18'),'form':{'grant_type':_0xad0e('0x29'),'client_id':_0x1f4fd9[_0xad0e('0xf')],'client_secret':_0x1f4fd9[_0xad0e('0x10')],'redirect_uri':_0x1f4fd9[_0xad0e('0xe')],'code':_0x1f4fd9['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x36f484)['then'](function(_0x3516bf){var _0x4ca8dc=JSON[_0xad0e('0x1a')](_0x3516bf);if(_0x4ca8dc[_0xad0e('0x1b')]){_0x1f4fd9[_0xad0e('0x1c')]=_0x4ca8dc[_0xad0e('0x1b')];logger[_0xad0e('0x1d')](util[_0xad0e('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1f4fd9[_0xad0e('0x20')],_0x1f4fd9['id']));}else{logger[_0xad0e('0x24')](util[_0xad0e('0x1e')](_0xad0e('0x21'),_0x1f4fd9[_0xad0e('0x20')],_0x1f4fd9['id']),util['inspect'](_0x4ca8dc,{'showHidden':![],'depth':null}));}return _0x279ead(null,_0x571aaa);})['catch'](function(_0x592072){logger[_0xad0e('0x24')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1f4fd9['name'],_0x1f4fd9['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x279ead(_0x592072);});}else{return _0x279ead(null,_0x571aaa);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 8979172..15371ef 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 _0xe2ab=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','options','attributes','limit','include','map','model','then','ShowZohoAccount','find','raw','lodash','util'];(function(_0x49bdc4,_0x1e2507){var _0x1f7437=function(_0x25a9f9){while(--_0x25a9f9){_0x49bdc4['push'](_0x49bdc4['shift']());}};_0x1f7437(++_0x1e2507);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x2cfeff,_0x49afb3){_0x2cfeff=_0x2cfeff-0x0;var _0x325d72=_0xe2ab[_0x2cfeff];return _0x325d72;};'use strict';var _=require(_0xbe2a('0x0'));var util=require(_0xbe2a('0x1'));var moment=require(_0xbe2a('0x2'));var BPromise=require(_0xbe2a('0x3'));var rs=require(_0xbe2a('0x4'));var fs=require('fs');var Redis=require(_0xbe2a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe2a('0x6'));var logger=require(_0xbe2a('0x7'))(_0xbe2a('0x8'));var config=require(_0xbe2a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbe2a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f504b,_0x58b8f1,_0x5a8a5d){return new BPromise(function(_0xfccbff,_0x232194){return client['request'](_0x2f504b,_0x5a8a5d)['then'](function(_0x83d775){logger[_0xbe2a('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x58b8f1,_0xbe2a('0xc'));logger[_0xbe2a('0xd')](_0xbe2a('0xe'),_0x58b8f1,_0xbe2a('0xc'),JSON[_0xbe2a('0xf')](_0x83d775));if(_0x83d775['error']){if(_0x83d775['error']['code']===0x1f4){logger[_0xbe2a('0x10')](_0xbe2a('0x11'),_0x58b8f1,_0x83d775[_0xbe2a('0x10')][_0xbe2a('0x12')]);return _0x232194(_0x83d775[_0xbe2a('0x10')]['message']);}logger[_0xbe2a('0x10')](_0xbe2a('0x11'),_0x58b8f1,_0x83d775[_0xbe2a('0x10')]['message']);return _0xfccbff(_0x83d775[_0xbe2a('0x10')][_0xbe2a('0x12')]);}else{logger[_0xbe2a('0xb')](_0xbe2a('0x11'),_0x58b8f1,_0xbe2a('0xc'));_0xfccbff(_0x83d775[_0xbe2a('0x13')][_0xbe2a('0x12')]);}})[_0xbe2a('0x14')](function(_0x4395fe){logger['error'](_0xbe2a('0x11'),_0x58b8f1,_0x4395fe);_0x232194(_0x4395fe);});});}exports[_0xbe2a('0x15')]=function(_0x39117c){var _0x330274=this;return new Promise(function(_0x54e6fb,_0xea5332){return db[_0xbe2a('0x16')]['findAll']({'raw':_0x39117c['options']?_0x39117c[_0xbe2a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x39117c[_0xbe2a('0x17')]?_0x39117c[_0xbe2a('0x17')]['where']||null:null,'attributes':_0x39117c[_0xbe2a('0x17')]?_0x39117c['options'][_0xbe2a('0x18')]||null:null,'limit':_0x39117c[_0xbe2a('0x17')]?_0x39117c[_0xbe2a('0x17')][_0xbe2a('0x19')]||null:null,'include':_0x39117c['options']?_0x39117c[_0xbe2a('0x17')][_0xbe2a('0x1a')]?_[_0xbe2a('0x1b')](_0x39117c['options'][_0xbe2a('0x1a')],function(_0x2c63c9){return{'model':db[_0x2c63c9[_0xbe2a('0x1c')]],'as':_0x2c63c9['as'],'attributes':_0x2c63c9[_0xbe2a('0x18')],'include':_0x2c63c9[_0xbe2a('0x1a')]?_['map'](_0x2c63c9['include'],function(_0x330d65){return{'model':db[_0x330d65[_0xbe2a('0x1c')]],'as':_0x330d65['as'],'attributes':_0x330d65[_0xbe2a('0x18')],'include':_0x330d65[_0xbe2a('0x1a')]?_['map'](_0x330d65[_0xbe2a('0x1a')],function(_0x5a6442){return{'model':db[_0x5a6442[_0xbe2a('0x1c')]],'as':_0x5a6442['as'],'attributes':_0x5a6442['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe2a('0x1d')](function(_0x488baa){logger[_0xbe2a('0xb')](_0xbe2a('0x15'),_0x39117c);logger[_0xbe2a('0xd')](_0xbe2a('0x15'),_0x39117c,JSON[_0xbe2a('0xf')](_0x488baa));_0x54e6fb(_0x488baa);})[_0xbe2a('0x14')](function(_0x34b7df){logger[_0xbe2a('0x10')](_0xbe2a('0x15'),_0x34b7df['message'],_0x39117c);_0xea5332(_0x330274[_0xbe2a('0x10')](0x1f4,_0x34b7df['message']));});});};exports[_0xbe2a('0x1e')]=function(_0xc15a2a){var _0x309bfc=this;return new Promise(function(_0x1b38bf,_0x5838a4){return db[_0xbe2a('0x16')][_0xbe2a('0x1f')]({'raw':_0xc15a2a[_0xbe2a('0x17')]?_0xc15a2a[_0xbe2a('0x17')][_0xbe2a('0x20')]===undefined?!![]:![]:!![],'where':_0xc15a2a[_0xbe2a('0x17')]?_0xc15a2a['options']['where']||null:null,'attributes':_0xc15a2a['options']?_0xc15a2a['options'][_0xbe2a('0x18')]||null:null,'include':_0xc15a2a[_0xbe2a('0x17')]?_0xc15a2a[_0xbe2a('0x17')][_0xbe2a('0x1a')]?_['map'](_0xc15a2a['options']['include'],function(_0x37fb15){return{'model':db[_0x37fb15[_0xbe2a('0x1c')]],'as':_0x37fb15['as'],'attributes':_0x37fb15[_0xbe2a('0x18')],'include':_0x37fb15['include']?_[_0xbe2a('0x1b')](_0x37fb15[_0xbe2a('0x1a')],function(_0x41b302){return{'model':db[_0x41b302[_0xbe2a('0x1c')]],'as':_0x41b302['as'],'attributes':_0x41b302[_0xbe2a('0x18')],'include':_0x41b302[_0xbe2a('0x1a')]?_[_0xbe2a('0x1b')](_0x41b302[_0xbe2a('0x1a')],function(_0x494bd1){return{'model':db[_0x494bd1[_0xbe2a('0x1c')]],'as':_0x494bd1['as'],'attributes':_0x494bd1[_0xbe2a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xbe2a('0x1d')](function(_0x4836c6){logger[_0xbe2a('0xb')]('ShowZohoAccount',_0xc15a2a);logger[_0xbe2a('0xd')](_0xbe2a('0x1e'),_0xc15a2a,JSON[_0xbe2a('0xf')](_0x4836c6));_0x1b38bf(_0x4836c6);})[_0xbe2a('0x14')](function(_0x284131){logger[_0xbe2a('0x10')](_0xbe2a('0x1e'),_0x284131[_0xbe2a('0x12')],_0xc15a2a);_0x5838a4(_0x309bfc['error'](0x1f4,_0x284131[_0xbe2a('0x12')]));});});}; \ No newline at end of file +var _0xfcbb=['info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then'];(function(_0xb3c85f,_0x421ec0){var _0x5f1fde=function(_0xbe8343){while(--_0xbe8343){_0xb3c85f['push'](_0xb3c85f['shift']());}};_0x5f1fde(++_0x421ec0);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x197944,_0x33c6b7){_0x197944=_0x197944-0x0;var _0x3764c1=_0xfcbb[_0x197944];return _0x3764c1;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});}exports[_0xbfcb('0x16')]=function(_0xba1d6){var _0x38689e=this;return new Promise(function(_0x3404aa,_0x46b8d2){return db[_0xbfcb('0x17')][_0xbfcb('0x18')]({'raw':_0xba1d6['options']?_0xba1d6[_0xbfcb('0x19')][_0xbfcb('0x1a')]===undefined?!![]:![]:!![],'where':_0xba1d6['options']?_0xba1d6[_0xbfcb('0x19')][_0xbfcb('0x1b')]||null:null,'attributes':_0xba1d6['options']?_0xba1d6['options'][_0xbfcb('0x1c')]||null:null,'limit':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')][_0xbfcb('0x1d')]||null:null,'include':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6['options'][_0xbfcb('0x1e')]?_[_0xbfcb('0x1f')](_0xba1d6[_0xbfcb('0x19')][_0xbfcb('0x1e')],function(_0x1651e5){return{'model':db[_0x1651e5[_0xbfcb('0x20')]],'as':_0x1651e5['as'],'attributes':_0x1651e5[_0xbfcb('0x1c')],'include':_0x1651e5[_0xbfcb('0x1e')]?_[_0xbfcb('0x1f')](_0x1651e5[_0xbfcb('0x1e')],function(_0x1ca8c3){return{'model':db[_0x1ca8c3[_0xbfcb('0x20')]],'as':_0x1ca8c3['as'],'attributes':_0x1ca8c3[_0xbfcb('0x1c')],'include':_0x1ca8c3[_0xbfcb('0x1e')]?_[_0xbfcb('0x1f')](_0x1ca8c3[_0xbfcb('0x1e')],function(_0x5cd703){return{'model':db[_0x5cd703[_0xbfcb('0x20')]],'as':_0x5cd703['as'],'attributes':_0x5cd703[_0xbfcb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x64a69){logger[_0xbfcb('0xb')](_0xbfcb('0x16'),_0xba1d6);logger[_0xbfcb('0xd')](_0xbfcb('0x16'),_0xba1d6,JSON[_0xbfcb('0xf')](_0x64a69));_0x3404aa(_0x64a69);})[_0xbfcb('0x15')](function(_0x1a5db2){logger[_0xbfcb('0x10')](_0xbfcb('0x16'),_0x1a5db2['message'],_0xba1d6);_0x46b8d2(_0x38689e[_0xbfcb('0x10')](0x1f4,_0x1a5db2[_0xbfcb('0x13')]));});});};exports[_0xbfcb('0x21')]=function(_0x43de3c){var _0x1f45fc=this;return new Promise(function(_0x14f6f5,_0x286fb7){return db[_0xbfcb('0x17')][_0xbfcb('0x22')]({'raw':_0x43de3c['options']?_0x43de3c[_0xbfcb('0x19')][_0xbfcb('0x1a')]===undefined?!![]:![]:!![],'where':_0x43de3c[_0xbfcb('0x19')]?_0x43de3c[_0xbfcb('0x19')]['where']||null:null,'attributes':_0x43de3c['options']?_0x43de3c[_0xbfcb('0x19')][_0xbfcb('0x1c')]||null:null,'include':_0x43de3c[_0xbfcb('0x19')]?_0x43de3c[_0xbfcb('0x19')][_0xbfcb('0x1e')]?_[_0xbfcb('0x1f')](_0x43de3c[_0xbfcb('0x19')]['include'],function(_0x504d81){return{'model':db[_0x504d81['model']],'as':_0x504d81['as'],'attributes':_0x504d81[_0xbfcb('0x1c')],'include':_0x504d81['include']?_[_0xbfcb('0x1f')](_0x504d81[_0xbfcb('0x1e')],function(_0x505b0d){return{'model':db[_0x505b0d['model']],'as':_0x505b0d['as'],'attributes':_0x505b0d[_0xbfcb('0x1c')],'include':_0x505b0d[_0xbfcb('0x1e')]?_[_0xbfcb('0x1f')](_0x505b0d[_0xbfcb('0x1e')],function(_0x530208){return{'model':db[_0x530208[_0xbfcb('0x20')]],'as':_0x530208['as'],'attributes':_0x530208[_0xbfcb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47ac13){logger[_0xbfcb('0xb')]('ShowZohoAccount',_0x43de3c);logger['debug'](_0xbfcb('0x21'),_0x43de3c,JSON[_0xbfcb('0xf')](_0x47ac13));_0x14f6f5(_0x47ac13);})[_0xbfcb('0x15')](function(_0x42ad5d){logger['error'](_0xbfcb('0x21'),_0x42ad5d[_0xbfcb('0x13')],_0x43de3c);_0x286fb7(_0x1f45fc[_0xbfcb('0x10')](0x1f4,_0x42ad5d[_0xbfcb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 63a683b..e24d27d 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 _0xaccf=['fs-extra','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','multer','util','express'];(function(_0x433ae0,_0x209a59){var _0x7b57dc=function(_0x10ad47){while(--_0x10ad47){_0x433ae0['push'](_0x433ae0['shift']());}};_0x7b57dc(++_0x209a59);}(_0xaccf,0xb1));var _0xfacc=function(_0x1c7860,_0x3af082){_0x1c7860=_0x1c7860-0x0;var _0xf230b4=_0xaccf[_0x1c7860];return _0xf230b4;};'use strict';var multer=require(_0xfacc('0x0'));var util=require(_0xfacc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfacc('0x2'));var router=express['Router']();var fs_extra=require(_0xfacc('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfacc('0x4'));router[_0xfacc('0x5')]('/',auth[_0xfacc('0x6')](),controller[_0xfacc('0x7')]);router[_0xfacc('0x5')](_0xfacc('0x8'),auth[_0xfacc('0x6')](),controller[_0xfacc('0x9')]);router[_0xfacc('0x5')]('/:id/fields',auth[_0xfacc('0x6')](),controller[_0xfacc('0xa')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xfacc('0xb')]);router['get'](_0xfacc('0xc'),auth[_0xfacc('0x6')](),controller['getDescriptions']);router[_0xfacc('0xd')]('/',auth[_0xfacc('0x6')](),controller[_0xfacc('0xe')]);router[_0xfacc('0xf')](_0xfacc('0x8'),auth[_0xfacc('0x6')](),controller[_0xfacc('0x10')]);router[_0xfacc('0x11')](_0xfacc('0x8'),auth['isAuthenticated'](),controller[_0xfacc('0x12')]);module[_0xfacc('0x13')]=router; \ No newline at end of file +var _0x7404=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x30f670,_0x161d04){var _0x14accd=function(_0x53b65e){while(--_0x53b65e){_0x30f670['push'](_0x30f670['shift']());}};_0x14accd(++_0x161d04);}(_0x7404,0x6c));var _0x4740=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7404[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x4740('0x0'));var util=require(_0x4740('0x1'));var path=require(_0x4740('0x2'));var timeout=require(_0x4740('0x3'));var express=require(_0x4740('0x4'));var router=express[_0x4740('0x5')]();var fs_extra=require(_0x4740('0x6'));var auth=require(_0x4740('0x7'));var interaction=require(_0x4740('0x8'));var config=require(_0x4740('0x9'));var controller=require(_0x4740('0xa'));router[_0x4740('0xb')]('/',auth[_0x4740('0xc')](),controller['index']);router[_0x4740('0xb')](_0x4740('0xd'),auth[_0x4740('0xc')](),controller['show']);router['get'](_0x4740('0xe'),auth[_0x4740('0xc')](),controller[_0x4740('0xf')]);router[_0x4740('0xb')](_0x4740('0x10'),auth[_0x4740('0xc')](),controller['getSubjects']);router[_0x4740('0xb')]('/:id/descriptions',auth[_0x4740('0xc')](),controller['getDescriptions']);router[_0x4740('0x11')]('/',auth['isAuthenticated'](),controller[_0x4740('0x12')]);router['put'](_0x4740('0xd'),auth['isAuthenticated'](),controller[_0x4740('0x13')]);router[_0x4740('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x4740('0x15')]);module[_0x4740('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 5564a23..b3d16ed 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 _0xf30a=['contact','contact_lead','sequelize','exports','STRING','lead','nothing','ENUM'];(function(_0xbf4919,_0x5d652e){var _0x1b074a=function(_0x4c95da){while(--_0x4c95da){_0xbf4919['push'](_0xbf4919['shift']());}};_0x1b074a(++_0x5d652e);}(_0xf30a,0xca));var _0xaf30=function(_0x357209,_0x1d14af){_0x357209=_0x357209-0x0;var _0x5a5f83=_0xf30a[_0x357209];return _0x5a5f83;};'use strict';var Sequelize=require(_0xaf30('0x0'));module[_0xaf30('0x1')]={'name':{'type':Sequelize[_0xaf30('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xaf30('0x3'),'contact',_0xaf30('0x4')),'defaultValue':_0xaf30('0x3')},'moduleSearch':{'type':Sequelize[_0xaf30('0x5')]('contact_lead',_0xaf30('0x6'),_0xaf30('0x3')),'defaultValue':_0xaf30('0x7')},'description':{'type':Sequelize[_0xaf30('0x2')]}}; \ No newline at end of file +var _0xab0a=['sequelize','exports','STRING','ENUM','lead','contact','nothing','contact_lead'];(function(_0x29b929,_0x2a4b10){var _0x3a8ce6=function(_0x1e2759){while(--_0x1e2759){_0x29b929['push'](_0x29b929['shift']());}};_0x3a8ce6(++_0x2a4b10);}(_0xab0a,0x1f0));var _0xaab0=function(_0x428c74,_0x229dee){_0x428c74=_0x428c74-0x0;var _0x3a73f9=_0xab0a[_0x428c74];return _0x3a73f9;};'use strict';var Sequelize=require(_0xaab0('0x0'));module[_0xaab0('0x1')]={'name':{'type':Sequelize[_0xaab0('0x2')]},'moduleCreate':{'type':Sequelize[_0xaab0('0x3')](_0xaab0('0x4'),_0xaab0('0x5'),_0xaab0('0x6')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xaab0('0x3')](_0xaab0('0x7'),_0xaab0('0x5'),_0xaab0('0x4')),'defaultValue':_0xaab0('0x7')},'description':{'type':Sequelize[_0xaab0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 3bd796c..bb4edec 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 _0x0ebf=['order','getDescriptions','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ZohoConfiguration','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','catch','params','find','create','body','findOne','ZohoField','pick','getFields','getSubjects','rawAttributes'];(function(_0x53fded,_0x14c554){var _0x53a143=function(_0x559e59){while(--_0x559e59){_0x53fded['push'](_0x53fded['shift']());}};_0x53a143(++_0x14c554);}(_0x0ebf,0xe6));var _0xf0eb=function(_0x46a671,_0x758e9a){_0x46a671=_0x46a671-0x0;var _0x526d75=_0x0ebf[_0x46a671];return _0x526d75;};'use strict';var emlformat=require(_0xf0eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0eb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf0eb('0x2'));var BPromise=require(_0xf0eb('0x3'));var Mustache=require(_0xf0eb('0x4'));var util=require(_0xf0eb('0x5'));var path=require(_0xf0eb('0x6'));var sox=require(_0xf0eb('0x7'));var csv=require(_0xf0eb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf0eb('0x9'));var _=require(_0xf0eb('0xa'));var squel=require(_0xf0eb('0xb'));var crypto=require(_0xf0eb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf0eb('0xd'));var toCsv=require(_0xf0eb('0x8'));var querystring=require(_0xf0eb('0xe'));var Papa=require(_0xf0eb('0xf'));var Redis=require(_0xf0eb('0x10'));var authService=require(_0xf0eb('0x11'));var qs=require(_0xf0eb('0x12'));var as=require(_0xf0eb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf0eb('0x14'));var config=require(_0xf0eb('0x15'));var licenseUtil=require(_0xf0eb('0x16'));var db=require(_0xf0eb('0x17'))['db'];function respondWithStatusCode(_0x1380b0,_0x193585){_0x193585=_0x193585||0xcc;return function(_0x95b093){if(_0x95b093){return _0x1380b0['sendStatus'](_0x193585);}return _0x1380b0[_0xf0eb('0x18')](_0x193585)[_0xf0eb('0x19')]();};}function respondWithResult(_0x25ee6d,_0x957bcf){_0x957bcf=_0x957bcf||0xc8;return function(_0x519657){if(_0x519657){return _0x25ee6d[_0xf0eb('0x18')](_0x957bcf)[_0xf0eb('0x1a')](_0x519657);}};}function respondWithFilteredResult(_0x2f40be,_0x3b957c){return function(_0x341099){if(_0x341099){var _0x3aab0a=typeof _0x3b957c[_0xf0eb('0x1b')]==='undefined'&&typeof _0x3b957c['limit']===_0xf0eb('0x1c');var _0x101f1b=_0x341099[_0xf0eb('0x1d')];var _0x18c01c=_0x3aab0a?0x0:_0x3b957c['offset'];var _0x62a6e2=_0x3aab0a?_0x341099[_0xf0eb('0x1d')]:_0x3b957c[_0xf0eb('0x1b')]+_0x3b957c['limit'];var _0x34b9bf;if(_0x62a6e2>=_0x101f1b){_0x62a6e2=_0x101f1b;_0x34b9bf=0xc8;}else{_0x34b9bf=0xce;}_0x2f40be[_0xf0eb('0x18')](_0x34b9bf);return _0x2f40be['set']('Content-Range',_0x18c01c+'-'+_0x62a6e2+'/'+_0x101f1b)[_0xf0eb('0x1a')](_0x341099);}return null;};}function patchUpdates(_0xd8d838){return function(_0x34b002){try{jsonpatch[_0xf0eb('0x1e')](_0x34b002,_0xd8d838,!![]);}catch(_0x1b4f7c){return BPromise[_0xf0eb('0x1f')](_0x1b4f7c);}return _0x34b002[_0xf0eb('0x20')]();};}function saveUpdates(_0xa3f22a,_0x258db7){return function(_0x42364b){if(_0x42364b){return _0x42364b[_0xf0eb('0x21')](_0xa3f22a)['then'](function(_0x3d2063){return _0x3d2063;});}return null;};}function removeEntity(_0xf42ab4,_0x1310c1){return function(_0x49fa79){if(_0x49fa79){return _0x49fa79[_0xf0eb('0x22')]()[_0xf0eb('0x23')](function(){_0xf42ab4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cdc8e,_0x1ccf61){return function(_0x1e9886){if(!_0x1e9886){_0x5cdc8e['sendStatus'](0x194);}return _0x1e9886;};}function handleError(_0x128b3c,_0x259e0a){_0x259e0a=_0x259e0a||0x1f4;return function(_0x11f932){logger[_0xf0eb('0x24')](_0x11f932[_0xf0eb('0x25')]);if(_0x11f932[_0xf0eb('0x26')]){delete _0x11f932['name'];}_0x128b3c[_0xf0eb('0x18')](_0x259e0a)[_0xf0eb('0x27')](_0x11f932);};}exports[_0xf0eb('0x28')]=function(_0x58c299,_0x2f7b57){var _0x1bc6f5={},_0x508dfd={},_0x40f03f={'count':0x0,'rows':[]};var _0x3516fe=_[_0xf0eb('0x29')](db[_0xf0eb('0x2a')]['rawAttributes'],function(_0x220630){return{'name':_0x220630['fieldName'],'type':_0x220630[_0xf0eb('0x2b')]['key']};});_0x508dfd[_0xf0eb('0x2c')]=_[_0xf0eb('0x29')](_0x3516fe,_0xf0eb('0x26'));_0x508dfd['query']=_[_0xf0eb('0x2d')](_0x58c299[_0xf0eb('0x2e')]);_0x508dfd[_0xf0eb('0x2f')]=_[_0xf0eb('0x30')](_0x508dfd[_0xf0eb('0x2c')],_0x508dfd['query']);_0x1bc6f5[_0xf0eb('0x31')]=_[_0xf0eb('0x30')](_0x508dfd[_0xf0eb('0x2c')],qs[_0xf0eb('0x32')](_0x58c299['query'][_0xf0eb('0x32')]));_0x1bc6f5[_0xf0eb('0x31')]=_0x1bc6f5[_0xf0eb('0x31')][_0xf0eb('0x33')]?_0x1bc6f5['attributes']:_0x508dfd['model'];if(!_0x58c299[_0xf0eb('0x2e')][_0xf0eb('0x34')](_0xf0eb('0x35'))){_0x1bc6f5[_0xf0eb('0x36')]=qs[_0xf0eb('0x36')](_0x58c299[_0xf0eb('0x2e')][_0xf0eb('0x36')]);_0x1bc6f5[_0xf0eb('0x1b')]=qs[_0xf0eb('0x1b')](_0x58c299[_0xf0eb('0x2e')][_0xf0eb('0x1b')]);}_0x1bc6f5['order']=qs[_0xf0eb('0x37')](_0x58c299['query']['sort']);_0x1bc6f5['where']=qs['filters'](_['pick'](_0x58c299['query'],_0x508dfd[_0xf0eb('0x2f')]),_0x3516fe);if(_0x58c299[_0xf0eb('0x2e')][_0xf0eb('0x38')]){_0x1bc6f5[_0xf0eb('0x39')]=_[_0xf0eb('0x3a')](_0x1bc6f5['where'],{'$or':_['map'](_0x3516fe,function(_0x51a91b){if(_0x51a91b[_0xf0eb('0x2b')]!==_0xf0eb('0x3b')){var _0x54abc8={};_0x54abc8[_0x51a91b[_0xf0eb('0x26')]]={'$like':'%'+_0x58c299['query'][_0xf0eb('0x38')]+'%'};return _0x54abc8;}})});}_0x1bc6f5=_[_0xf0eb('0x3a')]({},_0x1bc6f5,_0x58c299[_0xf0eb('0x3c')]);var _0x1ab3a9={'where':_0x1bc6f5[_0xf0eb('0x39')]};return db[_0xf0eb('0x2a')][_0xf0eb('0x1d')](_0x1ab3a9)[_0xf0eb('0x23')](function(_0x3919f1){_0x40f03f['count']=_0x3919f1;if(_0x58c299[_0xf0eb('0x2e')][_0xf0eb('0x3d')]){_0x1bc6f5[_0xf0eb('0x3e')]=[{'all':!![]}];}return db[_0xf0eb('0x2a')]['findAll'](_0x1bc6f5);})[_0xf0eb('0x23')](function(_0x4fce0f){_0x40f03f['rows']=_0x4fce0f;return _0x40f03f;})['then'](respondWithFilteredResult(_0x2f7b57,_0x1bc6f5))[_0xf0eb('0x3f')](handleError(_0x2f7b57,null));};exports['show']=function(_0x2f6982,_0x56b113){var _0x778d01={'raw':![],'where':{'id':_0x2f6982[_0xf0eb('0x40')]['id']}},_0x3b7a30={};_0x3b7a30[_0xf0eb('0x2c')]=_[_0xf0eb('0x2d')](db[_0xf0eb('0x2a')]['rawAttributes']);_0x3b7a30[_0xf0eb('0x2e')]=_[_0xf0eb('0x2d')](_0x2f6982[_0xf0eb('0x2e')]);_0x3b7a30[_0xf0eb('0x2f')]=_[_0xf0eb('0x30')](_0x3b7a30[_0xf0eb('0x2c')],_0x3b7a30['query']);_0x778d01[_0xf0eb('0x31')]=_[_0xf0eb('0x30')](_0x3b7a30[_0xf0eb('0x2c')],qs[_0xf0eb('0x32')](_0x2f6982['query'][_0xf0eb('0x32')]));_0x778d01['attributes']=_0x778d01[_0xf0eb('0x31')][_0xf0eb('0x33')]?_0x778d01[_0xf0eb('0x31')]:_0x3b7a30[_0xf0eb('0x2c')];if(_0x2f6982[_0xf0eb('0x2e')][_0xf0eb('0x3d')]){_0x778d01[_0xf0eb('0x3e')]=[{'all':!![]}];}_0x778d01=_['merge']({},_0x778d01,_0x2f6982[_0xf0eb('0x3c')]);return db['ZohoConfiguration'][_0xf0eb('0x41')](_0x778d01)[_0xf0eb('0x23')](handleEntityNotFound(_0x56b113,null))[_0xf0eb('0x23')](respondWithResult(_0x56b113,null))[_0xf0eb('0x3f')](handleError(_0x56b113,null));};exports[_0xf0eb('0x42')]=function(_0x3d0068,_0x15abe6){return db['ZohoConfiguration'][_0xf0eb('0x42')](_0x3d0068[_0xf0eb('0x43')],{})['then'](respondWithResult(_0x15abe6,0xc9))[_0xf0eb('0x3f')](handleError(_0x15abe6,null));};exports[_0xf0eb('0x21')]=function(_0x47c9ae,_0x749fdc){if(_0x47c9ae[_0xf0eb('0x43')]['id']){delete _0x47c9ae[_0xf0eb('0x43')]['id'];}return db[_0xf0eb('0x2a')][_0xf0eb('0x41')]({'where':{'id':_0x47c9ae[_0xf0eb('0x40')]['id']}})[_0xf0eb('0x23')](handleEntityNotFound(_0x749fdc,null))[_0xf0eb('0x23')](saveUpdates(_0x47c9ae[_0xf0eb('0x43')],null))[_0xf0eb('0x23')](respondWithResult(_0x749fdc,null))[_0xf0eb('0x3f')](handleError(_0x749fdc,null));};exports['destroy']=function(_0x2b80e1,_0x2d3baf){return db[_0xf0eb('0x2a')][_0xf0eb('0x41')]({'where':{'id':_0x2b80e1[_0xf0eb('0x40')]['id']}})[_0xf0eb('0x23')](handleEntityNotFound(_0x2d3baf,null))[_0xf0eb('0x23')](removeEntity(_0x2d3baf,null))['catch'](handleError(_0x2d3baf,null));};exports['getFields']=function(_0x2ab5f8,_0x4afebb,_0x305ed5){var _0x87d8b0={};var _0x451891={};var _0x587300;var _0x2506e0;return db[_0xf0eb('0x2a')][_0xf0eb('0x44')]({'where':{'id':_0x2ab5f8[_0xf0eb('0x40')]['id']}})[_0xf0eb('0x23')](handleEntityNotFound(_0x4afebb,null))[_0xf0eb('0x23')](function(_0xb506ab){if(_0xb506ab){_0x587300=_0xb506ab;_0x451891[_0xf0eb('0x2c')]=_[_0xf0eb('0x2d')](db[_0xf0eb('0x45')]['rawAttributes']);_0x451891[_0xf0eb('0x2e')]=_[_0xf0eb('0x2d')](_0x2ab5f8[_0xf0eb('0x2e')]);_0x451891[_0xf0eb('0x2f')]=_['intersection'](_0x451891[_0xf0eb('0x2c')],_0x451891[_0xf0eb('0x2e')]);_0x87d8b0[_0xf0eb('0x31')]=_[_0xf0eb('0x30')](_0x451891['model'],qs['fields'](_0x2ab5f8['query'][_0xf0eb('0x32')]));_0x87d8b0[_0xf0eb('0x31')]=_0x87d8b0[_0xf0eb('0x31')][_0xf0eb('0x33')]?_0x87d8b0[_0xf0eb('0x31')]:_0x451891[_0xf0eb('0x2c')];_0x87d8b0['order']=qs[_0xf0eb('0x37')](_0x2ab5f8['query'][_0xf0eb('0x37')]);_0x87d8b0['where']=qs[_0xf0eb('0x2f')](_[_0xf0eb('0x46')](_0x2ab5f8[_0xf0eb('0x2e')],_0x451891[_0xf0eb('0x2f')]));if(_0x2ab5f8[_0xf0eb('0x2e')][_0xf0eb('0x38')]){_0x87d8b0[_0xf0eb('0x39')]=_['merge'](_0x87d8b0['where'],{'$or':_[_0xf0eb('0x29')](_0x87d8b0[_0xf0eb('0x31')],function(_0x3eb571){var _0x4428f6={};_0x4428f6[_0x3eb571]={'$like':'%'+_0x2ab5f8['query'][_0xf0eb('0x38')]+'%'};return _0x4428f6;})});}_0x87d8b0=_['merge']({},_0x87d8b0,_0x2ab5f8[_0xf0eb('0x3c')]);return _0x587300[_0xf0eb('0x47')](_0x87d8b0);}})[_0xf0eb('0x23')](function(_0x41c91c){if(_0x41c91c){_0x2506e0=_0x41c91c[_0xf0eb('0x33')];if(!_0x2ab5f8[_0xf0eb('0x2e')][_0xf0eb('0x34')](_0xf0eb('0x35'))){_0x87d8b0[_0xf0eb('0x36')]=qs[_0xf0eb('0x36')](_0x2ab5f8[_0xf0eb('0x2e')][_0xf0eb('0x36')]);_0x87d8b0[_0xf0eb('0x1b')]=qs[_0xf0eb('0x1b')](_0x2ab5f8[_0xf0eb('0x2e')][_0xf0eb('0x1b')]);}return _0x587300[_0xf0eb('0x47')](_0x87d8b0);}})[_0xf0eb('0x23')](function(_0x4db6c3){if(_0x4db6c3){return _0x4db6c3?{'count':_0x2506e0,'rows':_0x4db6c3}:null;}})[_0xf0eb('0x23')](respondWithResult(_0x4afebb,null))['catch'](handleError(_0x4afebb,null));};exports[_0xf0eb('0x48')]=function(_0x3bc6c8,_0x22864f,_0x50b116){var _0x414fac={};var _0x3ec95a={};var _0x4cb71f;var _0x1757bb;return db[_0xf0eb('0x2a')][_0xf0eb('0x44')]({'where':{'id':_0x3bc6c8[_0xf0eb('0x40')]['id']}})[_0xf0eb('0x23')](handleEntityNotFound(_0x22864f,null))[_0xf0eb('0x23')](function(_0x3138e3){if(_0x3138e3){_0x4cb71f=_0x3138e3;_0x3ec95a[_0xf0eb('0x2c')]=_[_0xf0eb('0x2d')](db[_0xf0eb('0x45')][_0xf0eb('0x49')]);_0x3ec95a[_0xf0eb('0x2e')]=_[_0xf0eb('0x2d')](_0x3bc6c8['query']);_0x3ec95a['filters']=_[_0xf0eb('0x30')](_0x3ec95a['model'],_0x3ec95a[_0xf0eb('0x2e')]);_0x414fac[_0xf0eb('0x31')]=_['intersection'](_0x3ec95a[_0xf0eb('0x2c')],qs['fields'](_0x3bc6c8[_0xf0eb('0x2e')][_0xf0eb('0x32')]));_0x414fac[_0xf0eb('0x31')]=_0x414fac[_0xf0eb('0x31')][_0xf0eb('0x33')]?_0x414fac[_0xf0eb('0x31')]:_0x3ec95a[_0xf0eb('0x2c')];_0x414fac[_0xf0eb('0x4a')]=qs[_0xf0eb('0x37')](_0x3bc6c8[_0xf0eb('0x2e')][_0xf0eb('0x37')]);_0x414fac[_0xf0eb('0x39')]=qs[_0xf0eb('0x2f')](_['pick'](_0x3bc6c8[_0xf0eb('0x2e')],_0x3ec95a['filters']));if(_0x3bc6c8[_0xf0eb('0x2e')]['filter']){_0x414fac['where']=_[_0xf0eb('0x3a')](_0x414fac[_0xf0eb('0x39')],{'$or':_['map'](_0x414fac['attributes'],function(_0x4e37cd){var _0x34804b={};_0x34804b[_0x4e37cd]={'$like':'%'+_0x3bc6c8[_0xf0eb('0x2e')][_0xf0eb('0x38')]+'%'};return _0x34804b;})});}_0x414fac=_[_0xf0eb('0x3a')]({},_0x414fac,_0x3bc6c8['options']);return _0x4cb71f['getSubjects'](_0x414fac);}})[_0xf0eb('0x23')](function(_0x4f6df2){if(_0x4f6df2){_0x1757bb=_0x4f6df2[_0xf0eb('0x33')];if(!_0x3bc6c8[_0xf0eb('0x2e')]['hasOwnProperty'](_0xf0eb('0x35'))){_0x414fac[_0xf0eb('0x36')]=qs['limit'](_0x3bc6c8[_0xf0eb('0x2e')]['limit']);_0x414fac['offset']=qs[_0xf0eb('0x1b')](_0x3bc6c8['query'][_0xf0eb('0x1b')]);}return _0x4cb71f[_0xf0eb('0x48')](_0x414fac);}})[_0xf0eb('0x23')](function(_0x31c7f1){if(_0x31c7f1){return _0x31c7f1?{'count':_0x1757bb,'rows':_0x31c7f1}:null;}})[_0xf0eb('0x23')](respondWithResult(_0x22864f,null))[_0xf0eb('0x3f')](handleError(_0x22864f,null));};exports['getDescriptions']=function(_0x1db5d1,_0x20eb15,_0x391e5e){var _0xd5007b={};var _0x478aae={};var _0x499ec5;var _0x53e245;return db[_0xf0eb('0x2a')]['findOne']({'where':{'id':_0x1db5d1[_0xf0eb('0x40')]['id']}})[_0xf0eb('0x23')](handleEntityNotFound(_0x20eb15,null))['then'](function(_0x375630){if(_0x375630){_0x499ec5=_0x375630;_0x478aae[_0xf0eb('0x2c')]=_['keys'](db['ZohoField']['rawAttributes']);_0x478aae[_0xf0eb('0x2e')]=_[_0xf0eb('0x2d')](_0x1db5d1[_0xf0eb('0x2e')]);_0x478aae[_0xf0eb('0x2f')]=_[_0xf0eb('0x30')](_0x478aae[_0xf0eb('0x2c')],_0x478aae['query']);_0xd5007b[_0xf0eb('0x31')]=_['intersection'](_0x478aae[_0xf0eb('0x2c')],qs['fields'](_0x1db5d1['query'][_0xf0eb('0x32')]));_0xd5007b[_0xf0eb('0x31')]=_0xd5007b[_0xf0eb('0x31')][_0xf0eb('0x33')]?_0xd5007b['attributes']:_0x478aae[_0xf0eb('0x2c')];_0xd5007b['order']=qs[_0xf0eb('0x37')](_0x1db5d1[_0xf0eb('0x2e')][_0xf0eb('0x37')]);_0xd5007b[_0xf0eb('0x39')]=qs[_0xf0eb('0x2f')](_[_0xf0eb('0x46')](_0x1db5d1['query'],_0x478aae[_0xf0eb('0x2f')]));if(_0x1db5d1[_0xf0eb('0x2e')][_0xf0eb('0x38')]){_0xd5007b[_0xf0eb('0x39')]=_['merge'](_0xd5007b[_0xf0eb('0x39')],{'$or':_[_0xf0eb('0x29')](_0xd5007b[_0xf0eb('0x31')],function(_0x44ce2d){var _0x3748b3={};_0x3748b3[_0x44ce2d]={'$like':'%'+_0x1db5d1[_0xf0eb('0x2e')]['filter']+'%'};return _0x3748b3;})});}_0xd5007b=_[_0xf0eb('0x3a')]({},_0xd5007b,_0x1db5d1[_0xf0eb('0x3c')]);return _0x499ec5['getDescriptions'](_0xd5007b);}})[_0xf0eb('0x23')](function(_0x48ad90){if(_0x48ad90){_0x53e245=_0x48ad90['length'];if(!_0x1db5d1[_0xf0eb('0x2e')][_0xf0eb('0x34')](_0xf0eb('0x35'))){_0xd5007b['limit']=qs[_0xf0eb('0x36')](_0x1db5d1[_0xf0eb('0x2e')][_0xf0eb('0x36')]);_0xd5007b[_0xf0eb('0x1b')]=qs['offset'](_0x1db5d1[_0xf0eb('0x2e')][_0xf0eb('0x1b')]);}return _0x499ec5[_0xf0eb('0x4b')](_0xd5007b);}})[_0xf0eb('0x23')](function(_0xd443a2){if(_0xd443a2){return _0xd443a2?{'count':_0x53e245,'rows':_0xd443a2}:null;}})[_0xf0eb('0x23')](respondWithResult(_0x20eb15,null))[_0xf0eb('0x3f')](handleError(_0x20eb15,null));}; \ No newline at end of file +var _0x3de5=['apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','ZohoConfiguration','includeAll','include','show','params','find','catch','create','body','destroy','findOne','ZohoField','length','getFields','getSubjects','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set'];(function(_0xc1d0f0,_0xbea429){var _0x4bc573=function(_0x4b0ba4){while(--_0x4b0ba4){_0xc1d0f0['push'](_0xc1d0f0['shift']());}};_0x4bc573(++_0xbea429);}(_0x3de5,0x125));var _0x53de=function(_0x165a01,_0x2c0d26){_0x165a01=_0x165a01-0x0;var _0x75de69=_0x3de5[_0x165a01];return _0x75de69;};'use strict';var emlformat=require(_0x53de('0x0'));var rimraf=require(_0x53de('0x1'));var zipdir=require(_0x53de('0x2'));var jsonpatch=require(_0x53de('0x3'));var rp=require(_0x53de('0x4'));var moment=require('moment');var BPromise=require(_0x53de('0x5'));var Mustache=require('mustache');var util=require(_0x53de('0x6'));var path=require('path');var sox=require(_0x53de('0x7'));var csv=require(_0x53de('0x8'));var ejs=require(_0x53de('0x9'));var fs=require('fs');var fs_extra=require(_0x53de('0xa'));var _=require(_0x53de('0xb'));var squel=require(_0x53de('0xc'));var crypto=require(_0x53de('0xd'));var jsforce=require(_0x53de('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x53de('0x8'));var querystring=require(_0x53de('0xf'));var Papa=require(_0x53de('0x10'));var Redis=require(_0x53de('0x11'));var authService=require(_0x53de('0x12'));var qs=require(_0x53de('0x13'));var as=require(_0x53de('0x14'));var hardwareService=require(_0x53de('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x53de('0x16'));var config=require(_0x53de('0x17'));var licenseUtil=require(_0x53de('0x18'));var db=require(_0x53de('0x19'))['db'];function respondWithStatusCode(_0x568407,_0x43c372){_0x43c372=_0x43c372||0xcc;return function(_0x31c50e){if(_0x31c50e){return _0x568407[_0x53de('0x1a')](_0x43c372);}return _0x568407[_0x53de('0x1b')](_0x43c372)[_0x53de('0x1c')]();};}function respondWithResult(_0x500730,_0x2732e1){_0x2732e1=_0x2732e1||0xc8;return function(_0x5ace28){if(_0x5ace28){return _0x500730[_0x53de('0x1b')](_0x2732e1)[_0x53de('0x1d')](_0x5ace28);}};}function respondWithFilteredResult(_0x2becd8,_0x4a0446){return function(_0x4fd008){if(_0x4fd008){var _0x108697=typeof _0x4a0446[_0x53de('0x1e')]===_0x53de('0x1f')&&typeof _0x4a0446['limit']===_0x53de('0x1f');var _0x28a977=_0x4fd008[_0x53de('0x20')];var _0x513115=_0x108697?0x0:_0x4a0446[_0x53de('0x1e')];var _0x2f7fdf=_0x108697?_0x4fd008[_0x53de('0x20')]:_0x4a0446[_0x53de('0x1e')]+_0x4a0446[_0x53de('0x21')];var _0x5c7e9c;if(_0x2f7fdf>=_0x28a977){_0x2f7fdf=_0x28a977;_0x5c7e9c=0xc8;}else{_0x5c7e9c=0xce;}_0x2becd8['status'](_0x5c7e9c);return _0x2becd8[_0x53de('0x22')]('Content-Range',_0x513115+'-'+_0x2f7fdf+'/'+_0x28a977)[_0x53de('0x1d')](_0x4fd008);}return null;};}function patchUpdates(_0x5beb42){return function(_0x157088){try{jsonpatch[_0x53de('0x23')](_0x157088,_0x5beb42,!![]);}catch(_0x483e70){return BPromise[_0x53de('0x24')](_0x483e70);}return _0x157088[_0x53de('0x25')]();};}function saveUpdates(_0x5f2578,_0x24cc75){return function(_0x3be278){if(_0x3be278){return _0x3be278[_0x53de('0x26')](_0x5f2578)[_0x53de('0x27')](function(_0x33b1e0){return _0x33b1e0;});}return null;};}function removeEntity(_0x30afe7,_0x1ba57c){return function(_0x3179db){if(_0x3179db){return _0x3179db['destroy']()[_0x53de('0x27')](function(){_0x30afe7['status'](0xcc)[_0x53de('0x1c')]();});}};}function handleEntityNotFound(_0x53e002,_0x1c2173){return function(_0x293335){if(!_0x293335){_0x53e002[_0x53de('0x1a')](0x194);}return _0x293335;};}function handleError(_0x4f49f5,_0x2546cf){_0x2546cf=_0x2546cf||0x1f4;return function(_0x360927){logger['error'](_0x360927[_0x53de('0x28')]);if(_0x360927[_0x53de('0x29')]){delete _0x360927['name'];}_0x4f49f5[_0x53de('0x1b')](_0x2546cf)[_0x53de('0x2a')](_0x360927);};}exports[_0x53de('0x2b')]=function(_0x52e337,_0x59cad5){var _0x137dcd={},_0x8f39fb={},_0x11c374={'count':0x0,'rows':[]};var _0x47c326=_[_0x53de('0x2c')](db['ZohoConfiguration'][_0x53de('0x2d')],function(_0x89947e){return{'name':_0x89947e[_0x53de('0x2e')],'type':_0x89947e[_0x53de('0x2f')][_0x53de('0x30')]};});_0x8f39fb[_0x53de('0x31')]=_[_0x53de('0x2c')](_0x47c326,_0x53de('0x29'));_0x8f39fb[_0x53de('0x32')]=_[_0x53de('0x33')](_0x52e337[_0x53de('0x32')]);_0x8f39fb[_0x53de('0x34')]=_[_0x53de('0x35')](_0x8f39fb[_0x53de('0x31')],_0x8f39fb[_0x53de('0x32')]);_0x137dcd[_0x53de('0x36')]=_[_0x53de('0x35')](_0x8f39fb[_0x53de('0x31')],qs[_0x53de('0x37')](_0x52e337['query'][_0x53de('0x37')]));_0x137dcd[_0x53de('0x36')]=_0x137dcd[_0x53de('0x36')]['length']?_0x137dcd[_0x53de('0x36')]:_0x8f39fb['model'];if(!_0x52e337['query'][_0x53de('0x38')](_0x53de('0x39'))){_0x137dcd[_0x53de('0x21')]=qs[_0x53de('0x21')](_0x52e337['query'][_0x53de('0x21')]);_0x137dcd['offset']=qs[_0x53de('0x1e')](_0x52e337[_0x53de('0x32')]['offset']);}_0x137dcd[_0x53de('0x3a')]=qs['sort'](_0x52e337[_0x53de('0x32')][_0x53de('0x3b')]);_0x137dcd[_0x53de('0x3c')]=qs[_0x53de('0x34')](_['pick'](_0x52e337[_0x53de('0x32')],_0x8f39fb[_0x53de('0x34')]),_0x47c326);if(_0x52e337[_0x53de('0x32')]['filter']){_0x137dcd[_0x53de('0x3c')]=_['merge'](_0x137dcd[_0x53de('0x3c')],{'$or':_[_0x53de('0x2c')](_0x47c326,function(_0x431e89){if(_0x431e89[_0x53de('0x2f')]!==_0x53de('0x3d')){var _0xbc49a9={};_0xbc49a9[_0x431e89[_0x53de('0x29')]]={'$like':'%'+_0x52e337[_0x53de('0x32')][_0x53de('0x3e')]+'%'};return _0xbc49a9;}})});}_0x137dcd=_[_0x53de('0x3f')]({},_0x137dcd,_0x52e337[_0x53de('0x40')]);var _0x4d742b={'where':_0x137dcd['where']};return db[_0x53de('0x41')][_0x53de('0x20')](_0x4d742b)['then'](function(_0x88f7b8){_0x11c374[_0x53de('0x20')]=_0x88f7b8;if(_0x52e337['query'][_0x53de('0x42')]){_0x137dcd[_0x53de('0x43')]=[{'all':!![]}];}return db[_0x53de('0x41')]['findAll'](_0x137dcd);})[_0x53de('0x27')](function(_0x2c1e8c){_0x11c374['rows']=_0x2c1e8c;return _0x11c374;})[_0x53de('0x27')](respondWithFilteredResult(_0x59cad5,_0x137dcd))['catch'](handleError(_0x59cad5,null));};exports[_0x53de('0x44')]=function(_0xfc491c,_0x42174f){var _0x11268b={'raw':![],'where':{'id':_0xfc491c[_0x53de('0x45')]['id']}},_0x56fbee={};_0x56fbee[_0x53de('0x31')]=_[_0x53de('0x33')](db['ZohoConfiguration'][_0x53de('0x2d')]);_0x56fbee[_0x53de('0x32')]=_[_0x53de('0x33')](_0xfc491c[_0x53de('0x32')]);_0x56fbee[_0x53de('0x34')]=_[_0x53de('0x35')](_0x56fbee['model'],_0x56fbee[_0x53de('0x32')]);_0x11268b[_0x53de('0x36')]=_[_0x53de('0x35')](_0x56fbee[_0x53de('0x31')],qs[_0x53de('0x37')](_0xfc491c['query'][_0x53de('0x37')]));_0x11268b[_0x53de('0x36')]=_0x11268b[_0x53de('0x36')]['length']?_0x11268b[_0x53de('0x36')]:_0x56fbee[_0x53de('0x31')];if(_0xfc491c[_0x53de('0x32')][_0x53de('0x42')]){_0x11268b[_0x53de('0x43')]=[{'all':!![]}];}_0x11268b=_[_0x53de('0x3f')]({},_0x11268b,_0xfc491c[_0x53de('0x40')]);return db[_0x53de('0x41')][_0x53de('0x46')](_0x11268b)[_0x53de('0x27')](handleEntityNotFound(_0x42174f,null))[_0x53de('0x27')](respondWithResult(_0x42174f,null))[_0x53de('0x47')](handleError(_0x42174f,null));};exports['create']=function(_0x5693ca,_0x4d0ae3){return db[_0x53de('0x41')][_0x53de('0x48')](_0x5693ca[_0x53de('0x49')],{})[_0x53de('0x27')](respondWithResult(_0x4d0ae3,0xc9))[_0x53de('0x47')](handleError(_0x4d0ae3,null));};exports[_0x53de('0x26')]=function(_0x3f5862,_0x536024){if(_0x3f5862[_0x53de('0x49')]['id']){delete _0x3f5862[_0x53de('0x49')]['id'];}return db[_0x53de('0x41')][_0x53de('0x46')]({'where':{'id':_0x3f5862[_0x53de('0x45')]['id']}})[_0x53de('0x27')](handleEntityNotFound(_0x536024,null))[_0x53de('0x27')](saveUpdates(_0x3f5862[_0x53de('0x49')],null))[_0x53de('0x27')](respondWithResult(_0x536024,null))['catch'](handleError(_0x536024,null));};exports[_0x53de('0x4a')]=function(_0x440d33,_0x3afa39){return db[_0x53de('0x41')][_0x53de('0x46')]({'where':{'id':_0x440d33[_0x53de('0x45')]['id']}})['then'](handleEntityNotFound(_0x3afa39,null))[_0x53de('0x27')](removeEntity(_0x3afa39,null))[_0x53de('0x47')](handleError(_0x3afa39,null));};exports['getFields']=function(_0x4b8a25,_0xf4a673,_0x29b417){var _0x1edbc8={};var _0x43e6b9={};var _0x311a3f;var _0x35d933;return db[_0x53de('0x41')][_0x53de('0x4b')]({'where':{'id':_0x4b8a25[_0x53de('0x45')]['id']}})['then'](handleEntityNotFound(_0xf4a673,null))[_0x53de('0x27')](function(_0x342041){if(_0x342041){_0x311a3f=_0x342041;_0x43e6b9[_0x53de('0x31')]=_[_0x53de('0x33')](db[_0x53de('0x4c')][_0x53de('0x2d')]);_0x43e6b9[_0x53de('0x32')]=_[_0x53de('0x33')](_0x4b8a25['query']);_0x43e6b9['filters']=_[_0x53de('0x35')](_0x43e6b9['model'],_0x43e6b9[_0x53de('0x32')]);_0x1edbc8[_0x53de('0x36')]=_['intersection'](_0x43e6b9['model'],qs['fields'](_0x4b8a25[_0x53de('0x32')][_0x53de('0x37')]));_0x1edbc8[_0x53de('0x36')]=_0x1edbc8[_0x53de('0x36')][_0x53de('0x4d')]?_0x1edbc8[_0x53de('0x36')]:_0x43e6b9[_0x53de('0x31')];_0x1edbc8[_0x53de('0x3a')]=qs['sort'](_0x4b8a25['query'][_0x53de('0x3b')]);_0x1edbc8[_0x53de('0x3c')]=qs['filters'](_['pick'](_0x4b8a25['query'],_0x43e6b9[_0x53de('0x34')]));if(_0x4b8a25[_0x53de('0x32')][_0x53de('0x3e')]){_0x1edbc8[_0x53de('0x3c')]=_[_0x53de('0x3f')](_0x1edbc8[_0x53de('0x3c')],{'$or':_['map'](_0x1edbc8[_0x53de('0x36')],function(_0x545418){var _0x567605={};_0x567605[_0x545418]={'$like':'%'+_0x4b8a25[_0x53de('0x32')][_0x53de('0x3e')]+'%'};return _0x567605;})});}_0x1edbc8=_[_0x53de('0x3f')]({},_0x1edbc8,_0x4b8a25['options']);return _0x311a3f[_0x53de('0x4e')](_0x1edbc8);}})['then'](function(_0x4e0262){if(_0x4e0262){_0x35d933=_0x4e0262[_0x53de('0x4d')];if(!_0x4b8a25[_0x53de('0x32')][_0x53de('0x38')](_0x53de('0x39'))){_0x1edbc8[_0x53de('0x21')]=qs[_0x53de('0x21')](_0x4b8a25[_0x53de('0x32')]['limit']);_0x1edbc8[_0x53de('0x1e')]=qs[_0x53de('0x1e')](_0x4b8a25[_0x53de('0x32')][_0x53de('0x1e')]);}return _0x311a3f[_0x53de('0x4e')](_0x1edbc8);}})[_0x53de('0x27')](function(_0x34ba5a){if(_0x34ba5a){return _0x34ba5a?{'count':_0x35d933,'rows':_0x34ba5a}:null;}})[_0x53de('0x27')](respondWithResult(_0xf4a673,null))[_0x53de('0x47')](handleError(_0xf4a673,null));};exports[_0x53de('0x4f')]=function(_0x2b9661,_0xa53512,_0x515cc7){var _0x49ac39={};var _0x5196f3={};var _0x4dc5a1;var _0x817491;return db[_0x53de('0x41')][_0x53de('0x4b')]({'where':{'id':_0x2b9661[_0x53de('0x45')]['id']}})[_0x53de('0x27')](handleEntityNotFound(_0xa53512,null))['then'](function(_0x4bfe09){if(_0x4bfe09){_0x4dc5a1=_0x4bfe09;_0x5196f3['model']=_[_0x53de('0x33')](db[_0x53de('0x4c')][_0x53de('0x2d')]);_0x5196f3[_0x53de('0x32')]=_[_0x53de('0x33')](_0x2b9661[_0x53de('0x32')]);_0x5196f3[_0x53de('0x34')]=_['intersection'](_0x5196f3[_0x53de('0x31')],_0x5196f3[_0x53de('0x32')]);_0x49ac39[_0x53de('0x36')]=_[_0x53de('0x35')](_0x5196f3['model'],qs[_0x53de('0x37')](_0x2b9661[_0x53de('0x32')]['fields']));_0x49ac39[_0x53de('0x36')]=_0x49ac39[_0x53de('0x36')][_0x53de('0x4d')]?_0x49ac39[_0x53de('0x36')]:_0x5196f3[_0x53de('0x31')];_0x49ac39[_0x53de('0x3a')]=qs[_0x53de('0x3b')](_0x2b9661['query'][_0x53de('0x3b')]);_0x49ac39[_0x53de('0x3c')]=qs[_0x53de('0x34')](_[_0x53de('0x50')](_0x2b9661[_0x53de('0x32')],_0x5196f3[_0x53de('0x34')]));if(_0x2b9661['query'][_0x53de('0x3e')]){_0x49ac39[_0x53de('0x3c')]=_[_0x53de('0x3f')](_0x49ac39[_0x53de('0x3c')],{'$or':_[_0x53de('0x2c')](_0x49ac39[_0x53de('0x36')],function(_0x30f3b8){var _0x24a0dd={};_0x24a0dd[_0x30f3b8]={'$like':'%'+_0x2b9661[_0x53de('0x32')][_0x53de('0x3e')]+'%'};return _0x24a0dd;})});}_0x49ac39=_[_0x53de('0x3f')]({},_0x49ac39,_0x2b9661[_0x53de('0x40')]);return _0x4dc5a1['getSubjects'](_0x49ac39);}})[_0x53de('0x27')](function(_0x206f30){if(_0x206f30){_0x817491=_0x206f30[_0x53de('0x4d')];if(!_0x2b9661[_0x53de('0x32')][_0x53de('0x38')](_0x53de('0x39'))){_0x49ac39[_0x53de('0x21')]=qs[_0x53de('0x21')](_0x2b9661[_0x53de('0x32')]['limit']);_0x49ac39[_0x53de('0x1e')]=qs[_0x53de('0x1e')](_0x2b9661[_0x53de('0x32')][_0x53de('0x1e')]);}return _0x4dc5a1[_0x53de('0x4f')](_0x49ac39);}})[_0x53de('0x27')](function(_0x344b30){if(_0x344b30){return _0x344b30?{'count':_0x817491,'rows':_0x344b30}:null;}})[_0x53de('0x27')](respondWithResult(_0xa53512,null))['catch'](handleError(_0xa53512,null));};exports['getDescriptions']=function(_0x53709b,_0x419574,_0x2739f5){var _0x2cd1ce={};var _0xf5f315={};var _0x5cfde2;var _0xbc20b5;return db[_0x53de('0x41')][_0x53de('0x4b')]({'where':{'id':_0x53709b['params']['id']}})[_0x53de('0x27')](handleEntityNotFound(_0x419574,null))[_0x53de('0x27')](function(_0x20d615){if(_0x20d615){_0x5cfde2=_0x20d615;_0xf5f315[_0x53de('0x31')]=_[_0x53de('0x33')](db[_0x53de('0x4c')]['rawAttributes']);_0xf5f315[_0x53de('0x32')]=_[_0x53de('0x33')](_0x53709b[_0x53de('0x32')]);_0xf5f315[_0x53de('0x34')]=_[_0x53de('0x35')](_0xf5f315[_0x53de('0x31')],_0xf5f315[_0x53de('0x32')]);_0x2cd1ce[_0x53de('0x36')]=_[_0x53de('0x35')](_0xf5f315[_0x53de('0x31')],qs[_0x53de('0x37')](_0x53709b[_0x53de('0x32')]['fields']));_0x2cd1ce[_0x53de('0x36')]=_0x2cd1ce['attributes'][_0x53de('0x4d')]?_0x2cd1ce[_0x53de('0x36')]:_0xf5f315[_0x53de('0x31')];_0x2cd1ce[_0x53de('0x3a')]=qs[_0x53de('0x3b')](_0x53709b[_0x53de('0x32')][_0x53de('0x3b')]);_0x2cd1ce[_0x53de('0x3c')]=qs[_0x53de('0x34')](_[_0x53de('0x50')](_0x53709b[_0x53de('0x32')],_0xf5f315['filters']));if(_0x53709b[_0x53de('0x32')]['filter']){_0x2cd1ce[_0x53de('0x3c')]=_['merge'](_0x2cd1ce[_0x53de('0x3c')],{'$or':_[_0x53de('0x2c')](_0x2cd1ce['attributes'],function(_0xebe2c2){var _0x350c56={};_0x350c56[_0xebe2c2]={'$like':'%'+_0x53709b['query'][_0x53de('0x3e')]+'%'};return _0x350c56;})});}_0x2cd1ce=_[_0x53de('0x3f')]({},_0x2cd1ce,_0x53709b[_0x53de('0x40')]);return _0x5cfde2['getDescriptions'](_0x2cd1ce);}})[_0x53de('0x27')](function(_0x511478){if(_0x511478){_0xbc20b5=_0x511478[_0x53de('0x4d')];if(!_0x53709b[_0x53de('0x32')][_0x53de('0x38')](_0x53de('0x39'))){_0x2cd1ce[_0x53de('0x21')]=qs[_0x53de('0x21')](_0x53709b[_0x53de('0x32')][_0x53de('0x21')]);_0x2cd1ce[_0x53de('0x1e')]=qs['offset'](_0x53709b[_0x53de('0x32')][_0x53de('0x1e')]);}return _0x5cfde2[_0x53de('0x51')](_0x2cd1ce);}})[_0x53de('0x27')](function(_0x512b6a){if(_0x512b6a){return _0x512b6a?{'count':_0xbc20b5,'rows':_0x512b6a}:null;}})['then'](respondWithResult(_0x419574,null))[_0x53de('0x47')](handleError(_0x419574,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 0394215..e93a8f6 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 _0x6860=['exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes'];(function(_0x2af22f,_0x2f8bd7){var _0xadc129=function(_0x3342f3){while(--_0x3342f3){_0x2af22f['push'](_0x2af22f['shift']());}};_0xadc129(++_0x2f8bd7);}(_0x6860,0x1f2));var _0x0686=function(_0x54a6be,_0x5b45fd){_0x54a6be=_0x54a6be-0x0;var _0xcafdf=_0x6860[_0x54a6be];return _0xcafdf;};'use strict';var _=require(_0x0686('0x0'));var util=require(_0x0686('0x1'));var logger=require('../../config/logger')(_0x0686('0x2'));var moment=require(_0x0686('0x3'));var BPromise=require(_0x0686('0x4'));var rp=require(_0x0686('0x5'));var fs=require('fs');var path=require(_0x0686('0x6'));var rimraf=require('rimraf');var config=require(_0x0686('0x7'));var attributes=require(_0x0686('0x8'));module[_0x0686('0x9')]=function(_0x36657a,_0x3d19d9){return _0x36657a[_0x0686('0xa')](_0x0686('0xb'),attributes,{'tableName':_0x0686('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfac6=['path','../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1fd302,_0x48bc1c){var _0x2614f4=function(_0x5a005c){while(--_0x5a005c){_0x1fd302['push'](_0x1fd302['shift']());}};_0x2614f4(++_0x48bc1c);}(_0xfac6,0x1f2));var _0x6fac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfac6[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x6fac('0x0'));var logger=require(_0x6fac('0x1'))(_0x6fac('0x2'));var moment=require(_0x6fac('0x3'));var BPromise=require(_0x6fac('0x4'));var rp=require(_0x6fac('0x5'));var fs=require('fs');var path=require(_0x6fac('0x6'));var rimraf=require('rimraf');var config=require(_0x6fac('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0x6fac('0x8')]=function(_0x4e7576,_0x3f7954){return _0x4e7576[_0x6fac('0x9')](_0x6fac('0xa'),attributes,{'tableName':_0x6fac('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 cb11d39..c8596b3 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 _0xed3d=['client','http','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0xb1465,_0x3ef240){var _0x5a3777=function(_0x522f63){while(--_0x522f63){_0xb1465['push'](_0xb1465['shift']());}};_0x5a3777(++_0x3ef240);}(_0xed3d,0x19a));var _0xded3=function(_0xab7545,_0x4bfa41){_0xab7545=_0xab7545-0x0;var _0x346f75=_0xed3d[_0xab7545];return _0x346f75;};'use strict';var _=require(_0xded3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xded3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xded3('0x2'));var db=require(_0xded3('0x3'))['db'];var utils=require(_0xded3('0x4'));var logger=require('../../config/logger')(_0xded3('0x5'));var config=require(_0xded3('0x6'));var jayson=require(_0xded3('0x7'));var client=jayson[_0xded3('0x8')][_0xded3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d04d4,_0x126948,_0x1af4db){return new BPromise(function(_0x3481a4,_0x292a8d){return client['request'](_0x4d04d4,_0x1af4db)['then'](function(_0x3d62f7){logger[_0xded3('0xa')](_0xded3('0xb'),_0x126948,_0xded3('0xc'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x126948,_0xded3('0xc'),JSON[_0xded3('0xd')](_0x3d62f7));if(_0x3d62f7['error']){if(_0x3d62f7['error'][_0xded3('0xe')]===0x1f4){logger[_0xded3('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x126948,_0x3d62f7[_0xded3('0xf')][_0xded3('0x10')]);return _0x292a8d(_0x3d62f7['error']['message']);}logger[_0xded3('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x126948,_0x3d62f7['error']['message']);return _0x3481a4(_0x3d62f7[_0xded3('0xf')][_0xded3('0x10')]);}else{logger[_0xded3('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x126948,'request\x20sent');_0x3481a4(_0x3d62f7[_0xded3('0x11')]['message']);}})[_0xded3('0x12')](function(_0x2234ea){logger[_0xded3('0xf')](_0xded3('0xb'),_0x126948,_0x2234ea);_0x292a8d(_0x2234ea);});});} \ No newline at end of file +var _0x8a0b=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x8a0b,0x178));var _0xb8a0=function(_0x3ff5bf,_0x5094d8){_0x3ff5bf=_0x3ff5bf-0x0;var _0x141569=_0x8a0b[_0x3ff5bf];return _0x141569;};'use strict';var _=require(_0xb8a0('0x0'));var util=require(_0xb8a0('0x1'));var moment=require(_0xb8a0('0x2'));var BPromise=require(_0xb8a0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb8a0('0x4'));var db=require(_0xb8a0('0x5'))['db'];var utils=require(_0xb8a0('0x6'));var logger=require(_0xb8a0('0x7'))(_0xb8a0('0x8'));var config=require(_0xb8a0('0x9'));var jayson=require(_0xb8a0('0xa'));var client=jayson[_0xb8a0('0xb')][_0xb8a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x37e24c,_0x5ad313,_0x3e3d29){return new BPromise(function(_0x444d57,_0xc15dd2){return client[_0xb8a0('0xd')](_0x37e24c,_0x3e3d29)['then'](function(_0x4f061c){logger[_0xb8a0('0xe')](_0xb8a0('0xf'),_0x5ad313,_0xb8a0('0x10'));logger['debug'](_0xb8a0('0x11'),_0x5ad313,_0xb8a0('0x10'),JSON[_0xb8a0('0x12')](_0x4f061c));if(_0x4f061c[_0xb8a0('0x13')]){if(_0x4f061c[_0xb8a0('0x13')][_0xb8a0('0x14')]===0x1f4){logger['error'](_0xb8a0('0xf'),_0x5ad313,_0x4f061c['error']['message']);return _0xc15dd2(_0x4f061c['error'][_0xb8a0('0x15')]);}logger[_0xb8a0('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x5ad313,_0x4f061c[_0xb8a0('0x13')][_0xb8a0('0x15')]);return _0x444d57(_0x4f061c['error'][_0xb8a0('0x15')]);}else{logger[_0xb8a0('0xe')](_0xb8a0('0xf'),_0x5ad313,_0xb8a0('0x10'));_0x444d57(_0x4f061c['result'][_0xb8a0('0x15')]);}})[_0xb8a0('0x16')](function(_0x41c889){logger[_0xb8a0('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x5ad313,_0x41c889);_0xc15dd2(_0x41c889);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 763e09a..29b73a3 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 _0x7223=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','index','isAuthenticated','put','update','delete','/:id','exports'];(function(_0x439e8b,_0x2084ff){var _0x393b1b=function(_0x9c9348){while(--_0x9c9348){_0x439e8b['push'](_0x439e8b['shift']());}};_0x393b1b(++_0x2084ff);}(_0x7223,0x1e6));var _0x3722=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x7223[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0x3722('0x0'));var util=require(_0x3722('0x1'));var path=require(_0x3722('0x2'));var timeout=require(_0x3722('0x3'));var express=require(_0x3722('0x4'));var router=express[_0x3722('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3722('0x6'));var interaction=require(_0x3722('0x7'));var config=require(_0x3722('0x8'));var controller=require(_0x3722('0x9'));router[_0x3722('0xa')]('/',auth['isAuthenticated'](),controller[_0x3722('0xb')]);router['get']('/:id',auth[_0x3722('0xc')](),controller['show']);router['post']('/',auth[_0x3722('0xc')](),controller['create']);router[_0x3722('0xd')]('/:id',auth[_0x3722('0xc')](),controller[_0x3722('0xe')]);router[_0x3722('0xf')](_0x3722('0x10'),auth[_0x3722('0xc')](),controller['destroy']);module[_0x3722('0x11')]=router; \ No newline at end of file +var _0x767f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','post','create','put','destroy','exports','multer'];(function(_0x4ca9aa,_0x1ff656){var _0x2a83f1=function(_0x352c7a){while(--_0x352c7a){_0x4ca9aa['push'](_0x4ca9aa['shift']());}};_0x2a83f1(++_0x1ff656);}(_0x767f,0xe3));var _0xf767=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x767f[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require(_0xf767('0x0'));var util=require('util');var path=require(_0xf767('0x1'));var timeout=require(_0xf767('0x2'));var express=require(_0xf767('0x3'));var router=express[_0xf767('0x4')]();var fs_extra=require(_0xf767('0x5'));var auth=require(_0xf767('0x6'));var interaction=require(_0xf767('0x7'));var config=require(_0xf767('0x8'));var controller=require(_0xf767('0x9'));router[_0xf767('0xa')]('/',auth[_0xf767('0xb')](),controller[_0xf767('0xc')]);router[_0xf767('0xa')](_0xf767('0xd'),auth[_0xf767('0xb')](),controller['show']);router[_0xf767('0xe')]('/',auth[_0xf767('0xb')](),controller[_0xf767('0xf')]);router[_0xf767('0x10')]('/:id',auth[_0xf767('0xb')](),controller['update']);router['delete'](_0xf767('0xd'),auth['isAuthenticated'](),controller[_0xf767('0x11')]);module[_0xf767('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 5abd37a..fbccc48 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 _0x5e64=['sequelize','exports','ENUM','string','variable','customVariable','STRING','BOOLEAN'];(function(_0x14c032,_0x47198a){var _0x2baf92=function(_0x19cc48){while(--_0x19cc48){_0x14c032['push'](_0x14c032['shift']());}};_0x2baf92(++_0x47198a);}(_0x5e64,0x108));var _0x45e6=function(_0x2c74fd,_0x44f249){_0x2c74fd=_0x2c74fd-0x0;var _0x4c3033=_0x5e64[_0x2c74fd];return _0x4c3033;};'use strict';var Sequelize=require(_0x45e6('0x0'));module[_0x45e6('0x1')]={'type':{'type':Sequelize[_0x45e6('0x2')](_0x45e6('0x3'),_0x45e6('0x4'),_0x45e6('0x5'),'keyValue','picklist'),'defaultValue':_0x45e6('0x3')},'content':{'type':Sequelize[_0x45e6('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x45e6('0x4'),_0x45e6('0x5'))},'keyContent':{'type':Sequelize[_0x45e6('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x45e6('0x6')]},'customField':{'type':Sequelize[_0x45e6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x45e6('0x6')]}}; \ No newline at end of file +var _0x783c=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x4ae961,_0x55a0ed){var _0x3f4dd6=function(_0x49adb1){while(--_0x49adb1){_0x4ae961['push'](_0x4ae961['shift']());}};_0x3f4dd6(++_0x55a0ed);}(_0x783c,0xac));var _0xc783=function(_0x3aa433,_0x5a28fa){_0x3aa433=_0x3aa433-0x0;var _0x21c1b1=_0x783c[_0x3aa433];return _0x21c1b1;};'use strict';var Sequelize=require(_0xc783('0x0'));module[_0xc783('0x1')]={'type':{'type':Sequelize[_0xc783('0x2')](_0xc783('0x3'),_0xc783('0x4'),_0xc783('0x5'),_0xc783('0x6'),_0xc783('0x7')),'defaultValue':_0xc783('0x3')},'content':{'type':Sequelize[_0xc783('0x8')]},'key':{'type':Sequelize[_0xc783('0x8')]},'keyType':{'type':Sequelize[_0xc783('0x2')]('string','variable',_0xc783('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc783('0x8')]},'nameField':{'type':Sequelize[_0xc783('0x8')]},'customField':{'type':Sequelize[_0xc783('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc783('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index a20e837..2d09c86 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 _0x6bd5=['destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','ZohoField','includeAll','findAll','rows','catch','show','keys','include','create','body','update','params','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../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','undefined','count','offset','limit','set','Content-Range','save','then'];(function(_0x3eb5ec,_0x1dd98a){var _0x6527e5=function(_0x2e8924){while(--_0x2e8924){_0x3eb5ec['push'](_0x3eb5ec['shift']());}};_0x6527e5(++_0x1dd98a);}(_0x6bd5,0x114));var _0x56bd=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x6bd5[_0x40a825];return _0x273a54;};'use strict';var emlformat=require(_0x56bd('0x0'));var rimraf=require(_0x56bd('0x1'));var zipdir=require(_0x56bd('0x2'));var jsonpatch=require(_0x56bd('0x3'));var rp=require('request-promise');var moment=require(_0x56bd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x56bd('0x5'));var util=require(_0x56bd('0x6'));var path=require(_0x56bd('0x7'));var sox=require(_0x56bd('0x8'));var csv=require('to-csv');var ejs=require(_0x56bd('0x9'));var fs=require('fs');var fs_extra=require(_0x56bd('0xa'));var _=require(_0x56bd('0xb'));var squel=require(_0x56bd('0xc'));var crypto=require(_0x56bd('0xd'));var jsforce=require(_0x56bd('0xe'));var deskjs=require(_0x56bd('0xf'));var toCsv=require(_0x56bd('0x10'));var querystring=require(_0x56bd('0x11'));var Papa=require(_0x56bd('0x12'));var Redis=require('ioredis');var authService=require(_0x56bd('0x13'));var qs=require(_0x56bd('0x14'));var as=require(_0x56bd('0x15'));var hardwareService=require(_0x56bd('0x16'));var logger=require(_0x56bd('0x17'))(_0x56bd('0x18'));var utils=require(_0x56bd('0x19'));var config=require(_0x56bd('0x1a'));var licenseUtil=require(_0x56bd('0x1b'));var db=require(_0x56bd('0x1c'))['db'];function respondWithStatusCode(_0x22902f,_0x22c3c7){_0x22c3c7=_0x22c3c7||0xcc;return function(_0x4fe88f){if(_0x4fe88f){return _0x22902f[_0x56bd('0x1d')](_0x22c3c7);}return _0x22902f[_0x56bd('0x1e')](_0x22c3c7)[_0x56bd('0x1f')]();};}function respondWithResult(_0x5dd74b,_0x2635ed){_0x2635ed=_0x2635ed||0xc8;return function(_0x27a629){if(_0x27a629){return _0x5dd74b[_0x56bd('0x1e')](_0x2635ed)['json'](_0x27a629);}};}function respondWithFilteredResult(_0x3f82c0,_0x56a295){return function(_0x4f8d18){if(_0x4f8d18){var _0x3e2e89=typeof _0x56a295['offset']===_0x56bd('0x20')&&typeof _0x56a295['limit']===_0x56bd('0x20');var _0x35105d=_0x4f8d18[_0x56bd('0x21')];var _0x5abac4=_0x3e2e89?0x0:_0x56a295[_0x56bd('0x22')];var _0x4c1e56=_0x3e2e89?_0x4f8d18[_0x56bd('0x21')]:_0x56a295[_0x56bd('0x22')]+_0x56a295[_0x56bd('0x23')];var _0x4c9686;if(_0x4c1e56>=_0x35105d){_0x4c1e56=_0x35105d;_0x4c9686=0xc8;}else{_0x4c9686=0xce;}_0x3f82c0[_0x56bd('0x1e')](_0x4c9686);return _0x3f82c0[_0x56bd('0x24')](_0x56bd('0x25'),_0x5abac4+'-'+_0x4c1e56+'/'+_0x35105d)['json'](_0x4f8d18);}return null;};}function patchUpdates(_0x45980f){return function(_0x255ae8){try{jsonpatch['apply'](_0x255ae8,_0x45980f,!![]);}catch(_0x56d94d){return BPromise['reject'](_0x56d94d);}return _0x255ae8[_0x56bd('0x26')]();};}function saveUpdates(_0x9b705e,_0x5a5065){return function(_0x1912d5){if(_0x1912d5){return _0x1912d5['update'](_0x9b705e)[_0x56bd('0x27')](function(_0x33155a){return _0x33155a;});}return null;};}function removeEntity(_0x2ef992,_0x359572){return function(_0x3dbdb5){if(_0x3dbdb5){return _0x3dbdb5[_0x56bd('0x28')]()[_0x56bd('0x27')](function(){_0x2ef992[_0x56bd('0x1e')](0xcc)[_0x56bd('0x1f')]();});}};}function handleEntityNotFound(_0x3c3e13,_0x18b579){return function(_0x1b7f9f){if(!_0x1b7f9f){_0x3c3e13[_0x56bd('0x1d')](0x194);}return _0x1b7f9f;};}function handleError(_0x14bbdb,_0x4c98b3){_0x4c98b3=_0x4c98b3||0x1f4;return function(_0x508d74){logger[_0x56bd('0x29')](_0x508d74[_0x56bd('0x2a')]);if(_0x508d74[_0x56bd('0x2b')]){delete _0x508d74[_0x56bd('0x2b')];}_0x14bbdb[_0x56bd('0x1e')](_0x4c98b3)[_0x56bd('0x2c')](_0x508d74);};}exports[_0x56bd('0x2d')]=function(_0x3443e3,_0x3b8864){var _0x4c382f={},_0x46d91a={},_0xa14704={'count':0x0,'rows':[]};var _0x2459ed=_[_0x56bd('0x2e')](db['ZohoField'][_0x56bd('0x2f')],function(_0x5d7e0a){return{'name':_0x5d7e0a[_0x56bd('0x30')],'type':_0x5d7e0a[_0x56bd('0x31')][_0x56bd('0x32')]};});_0x46d91a[_0x56bd('0x33')]=_[_0x56bd('0x2e')](_0x2459ed,_0x56bd('0x2b'));_0x46d91a[_0x56bd('0x34')]=_['keys'](_0x3443e3[_0x56bd('0x34')]);_0x46d91a[_0x56bd('0x35')]=_[_0x56bd('0x36')](_0x46d91a['model'],_0x46d91a[_0x56bd('0x34')]);_0x4c382f[_0x56bd('0x37')]=_[_0x56bd('0x36')](_0x46d91a['model'],qs['fields'](_0x3443e3[_0x56bd('0x34')][_0x56bd('0x38')]));_0x4c382f[_0x56bd('0x37')]=_0x4c382f[_0x56bd('0x37')][_0x56bd('0x39')]?_0x4c382f[_0x56bd('0x37')]:_0x46d91a['model'];if(!_0x3443e3[_0x56bd('0x34')][_0x56bd('0x3a')](_0x56bd('0x3b'))){_0x4c382f[_0x56bd('0x23')]=qs[_0x56bd('0x23')](_0x3443e3[_0x56bd('0x34')][_0x56bd('0x23')]);_0x4c382f['offset']=qs[_0x56bd('0x22')](_0x3443e3['query'][_0x56bd('0x22')]);}_0x4c382f[_0x56bd('0x3c')]=qs[_0x56bd('0x3d')](_0x3443e3[_0x56bd('0x34')][_0x56bd('0x3d')]);_0x4c382f[_0x56bd('0x3e')]=qs[_0x56bd('0x35')](_['pick'](_0x3443e3[_0x56bd('0x34')],_0x46d91a[_0x56bd('0x35')]),_0x2459ed);if(_0x3443e3[_0x56bd('0x34')][_0x56bd('0x3f')]){_0x4c382f['where']=_[_0x56bd('0x40')](_0x4c382f['where'],{'$or':_[_0x56bd('0x2e')](_0x2459ed,function(_0x5c330c){if(_0x5c330c['type']!=='VIRTUAL'){var _0x4d375e={};_0x4d375e[_0x5c330c[_0x56bd('0x2b')]]={'$like':'%'+_0x3443e3['query'][_0x56bd('0x3f')]+'%'};return _0x4d375e;}})});}_0x4c382f=_[_0x56bd('0x40')]({},_0x4c382f,_0x3443e3[_0x56bd('0x41')]);var _0x3f4d47={'where':_0x4c382f[_0x56bd('0x3e')]};return db[_0x56bd('0x42')][_0x56bd('0x21')](_0x3f4d47)['then'](function(_0x32f78a){_0xa14704[_0x56bd('0x21')]=_0x32f78a;if(_0x3443e3[_0x56bd('0x34')][_0x56bd('0x43')]){_0x4c382f['include']=[{'all':!![]}];}return db[_0x56bd('0x42')][_0x56bd('0x44')](_0x4c382f);})['then'](function(_0x44ceec){_0xa14704[_0x56bd('0x45')]=_0x44ceec;return _0xa14704;})[_0x56bd('0x27')](respondWithFilteredResult(_0x3b8864,_0x4c382f))[_0x56bd('0x46')](handleError(_0x3b8864,null));};exports[_0x56bd('0x47')]=function(_0xb97a63,_0x311488){var _0x490ccf={'raw':!![],'where':{'id':_0xb97a63['params']['id']}},_0x28b055={};_0x28b055['model']=_[_0x56bd('0x48')](db[_0x56bd('0x42')][_0x56bd('0x2f')]);_0x28b055[_0x56bd('0x34')]=_[_0x56bd('0x48')](_0xb97a63['query']);_0x28b055['filters']=_['intersection'](_0x28b055[_0x56bd('0x33')],_0x28b055[_0x56bd('0x34')]);_0x490ccf['attributes']=_[_0x56bd('0x36')](_0x28b055[_0x56bd('0x33')],qs[_0x56bd('0x38')](_0xb97a63[_0x56bd('0x34')][_0x56bd('0x38')]));_0x490ccf[_0x56bd('0x37')]=_0x490ccf[_0x56bd('0x37')][_0x56bd('0x39')]?_0x490ccf[_0x56bd('0x37')]:_0x28b055[_0x56bd('0x33')];if(_0xb97a63[_0x56bd('0x34')]['includeAll']){_0x490ccf[_0x56bd('0x49')]=[{'all':!![]}];}_0x490ccf=_[_0x56bd('0x40')]({},_0x490ccf,_0xb97a63['options']);return db[_0x56bd('0x42')]['find'](_0x490ccf)[_0x56bd('0x27')](handleEntityNotFound(_0x311488,null))[_0x56bd('0x27')](respondWithResult(_0x311488,null))[_0x56bd('0x46')](handleError(_0x311488,null));};exports[_0x56bd('0x4a')]=function(_0x4d8538,_0xbc133a){return db[_0x56bd('0x42')][_0x56bd('0x4a')](_0x4d8538[_0x56bd('0x4b')],{})['then'](respondWithResult(_0xbc133a,0xc9))[_0x56bd('0x46')](handleError(_0xbc133a,null));};exports[_0x56bd('0x4c')]=function(_0x46b276,_0x3b6588){if(_0x46b276[_0x56bd('0x4b')]['id']){delete _0x46b276[_0x56bd('0x4b')]['id'];}return db['ZohoField']['find']({'where':{'id':_0x46b276[_0x56bd('0x4d')]['id']}})[_0x56bd('0x27')](handleEntityNotFound(_0x3b6588,null))[_0x56bd('0x27')](saveUpdates(_0x46b276[_0x56bd('0x4b')],null))[_0x56bd('0x27')](respondWithResult(_0x3b6588,null))[_0x56bd('0x46')](handleError(_0x3b6588,null));};exports[_0x56bd('0x28')]=function(_0x899ae1,_0x4d56b8){return db['ZohoField'][_0x56bd('0x4e')]({'where':{'id':_0x899ae1['params']['id']}})[_0x56bd('0x27')](handleEntityNotFound(_0x4d56b8,null))['then'](removeEntity(_0x4d56b8,null))[_0x56bd('0x46')](handleError(_0x4d56b8,null));}; \ No newline at end of file +var _0xfaa6=['json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','error','stack','name','map','ZohoField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x4eb389,_0x20c29f){var _0x5576ad=function(_0xa049dd){while(--_0xa049dd){_0x4eb389['push'](_0x4eb389['shift']());}};_0x5576ad(++_0x20c29f);}(_0xfaa6,0xbd));var _0x6faa=function(_0x20aadb,_0x5a607a){_0x20aadb=_0x20aadb-0x0;var _0x520018=_0xfaa6[_0x20aadb];return _0x520018;};'use strict';var emlformat=require(_0x6faa('0x0'));var rimraf=require(_0x6faa('0x1'));var zipdir=require(_0x6faa('0x2'));var jsonpatch=require(_0x6faa('0x3'));var rp=require(_0x6faa('0x4'));var moment=require(_0x6faa('0x5'));var BPromise=require(_0x6faa('0x6'));var Mustache=require(_0x6faa('0x7'));var util=require(_0x6faa('0x8'));var path=require(_0x6faa('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6faa('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6faa('0xb'));var squel=require(_0x6faa('0xc'));var crypto=require(_0x6faa('0xd'));var jsforce=require(_0x6faa('0xe'));var deskjs=require(_0x6faa('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6faa('0x10'));var Papa=require(_0x6faa('0x11'));var Redis=require(_0x6faa('0x12'));var authService=require(_0x6faa('0x13'));var qs=require(_0x6faa('0x14'));var as=require(_0x6faa('0x15'));var hardwareService=require(_0x6faa('0x16'));var logger=require('../../config/logger')(_0x6faa('0x17'));var utils=require(_0x6faa('0x18'));var config=require(_0x6faa('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6faa('0x1a'))['db'];function respondWithStatusCode(_0x2d06c1,_0x17913c){_0x17913c=_0x17913c||0xcc;return function(_0x147a10){if(_0x147a10){return _0x2d06c1[_0x6faa('0x1b')](_0x17913c);}return _0x2d06c1[_0x6faa('0x1c')](_0x17913c)[_0x6faa('0x1d')]();};}function respondWithResult(_0x317746,_0x215c6f){_0x215c6f=_0x215c6f||0xc8;return function(_0x4b4cb0){if(_0x4b4cb0){return _0x317746['status'](_0x215c6f)[_0x6faa('0x1e')](_0x4b4cb0);}};}function respondWithFilteredResult(_0xe102e8,_0x2779b8){return function(_0x12b4e1){if(_0x12b4e1){var _0x38b5f9=typeof _0x2779b8[_0x6faa('0x1f')]===_0x6faa('0x20')&&typeof _0x2779b8['limit']==='undefined';var _0x4f3dd0=_0x12b4e1['count'];var _0x4b9320=_0x38b5f9?0x0:_0x2779b8[_0x6faa('0x1f')];var _0x4026ae=_0x38b5f9?_0x12b4e1[_0x6faa('0x21')]:_0x2779b8['offset']+_0x2779b8[_0x6faa('0x22')];var _0x42cc1e;if(_0x4026ae>=_0x4f3dd0){_0x4026ae=_0x4f3dd0;_0x42cc1e=0xc8;}else{_0x42cc1e=0xce;}_0xe102e8[_0x6faa('0x1c')](_0x42cc1e);return _0xe102e8['set']('Content-Range',_0x4b9320+'-'+_0x4026ae+'/'+_0x4f3dd0)[_0x6faa('0x1e')](_0x12b4e1);}return null;};}function patchUpdates(_0x35531e){return function(_0x199ed9){try{jsonpatch[_0x6faa('0x23')](_0x199ed9,_0x35531e,!![]);}catch(_0x3adaf5){return BPromise[_0x6faa('0x24')](_0x3adaf5);}return _0x199ed9[_0x6faa('0x25')]();};}function saveUpdates(_0x4511ed,_0x96ff25){return function(_0x2db505){if(_0x2db505){return _0x2db505[_0x6faa('0x26')](_0x4511ed)[_0x6faa('0x27')](function(_0x28386e){return _0x28386e;});}return null;};}function removeEntity(_0x470cd6,_0x18686a){return function(_0x151bb4){if(_0x151bb4){return _0x151bb4[_0x6faa('0x28')]()[_0x6faa('0x27')](function(){_0x470cd6[_0x6faa('0x1c')](0xcc)[_0x6faa('0x1d')]();});}};}function handleEntityNotFound(_0x22965f,_0x46cd9a){return function(_0x1104ba){if(!_0x1104ba){_0x22965f[_0x6faa('0x1b')](0x194);}return _0x1104ba;};}function handleError(_0x594519,_0x17f698){_0x17f698=_0x17f698||0x1f4;return function(_0x48aad8){logger[_0x6faa('0x29')](_0x48aad8[_0x6faa('0x2a')]);if(_0x48aad8[_0x6faa('0x2b')]){delete _0x48aad8[_0x6faa('0x2b')];}_0x594519[_0x6faa('0x1c')](_0x17f698)['send'](_0x48aad8);};}exports['index']=function(_0x2355e4,_0xf20193){var _0x2fc98e={},_0x2cf427={},_0x19f768={'count':0x0,'rows':[]};var _0x3a7b08=_[_0x6faa('0x2c')](db[_0x6faa('0x2d')]['rawAttributes'],function(_0xc0e956){return{'name':_0xc0e956[_0x6faa('0x2e')],'type':_0xc0e956[_0x6faa('0x2f')]['key']};});_0x2cf427[_0x6faa('0x30')]=_[_0x6faa('0x2c')](_0x3a7b08,_0x6faa('0x2b'));_0x2cf427[_0x6faa('0x31')]=_[_0x6faa('0x32')](_0x2355e4[_0x6faa('0x31')]);_0x2cf427[_0x6faa('0x33')]=_[_0x6faa('0x34')](_0x2cf427['model'],_0x2cf427[_0x6faa('0x31')]);_0x2fc98e[_0x6faa('0x35')]=_[_0x6faa('0x34')](_0x2cf427['model'],qs[_0x6faa('0x36')](_0x2355e4[_0x6faa('0x31')][_0x6faa('0x36')]));_0x2fc98e['attributes']=_0x2fc98e[_0x6faa('0x35')]['length']?_0x2fc98e[_0x6faa('0x35')]:_0x2cf427[_0x6faa('0x30')];if(!_0x2355e4['query'][_0x6faa('0x37')]('nolimit')){_0x2fc98e[_0x6faa('0x22')]=qs[_0x6faa('0x22')](_0x2355e4[_0x6faa('0x31')][_0x6faa('0x22')]);_0x2fc98e[_0x6faa('0x1f')]=qs[_0x6faa('0x1f')](_0x2355e4[_0x6faa('0x31')][_0x6faa('0x1f')]);}_0x2fc98e[_0x6faa('0x38')]=qs[_0x6faa('0x39')](_0x2355e4['query']['sort']);_0x2fc98e[_0x6faa('0x3a')]=qs[_0x6faa('0x33')](_[_0x6faa('0x3b')](_0x2355e4['query'],_0x2cf427[_0x6faa('0x33')]),_0x3a7b08);if(_0x2355e4[_0x6faa('0x31')][_0x6faa('0x3c')]){_0x2fc98e[_0x6faa('0x3a')]=_[_0x6faa('0x3d')](_0x2fc98e['where'],{'$or':_[_0x6faa('0x2c')](_0x3a7b08,function(_0x5ce797){if(_0x5ce797[_0x6faa('0x2f')]!==_0x6faa('0x3e')){var _0x14a14a={};_0x14a14a[_0x5ce797[_0x6faa('0x2b')]]={'$like':'%'+_0x2355e4[_0x6faa('0x31')]['filter']+'%'};return _0x14a14a;}})});}_0x2fc98e=_[_0x6faa('0x3d')]({},_0x2fc98e,_0x2355e4['options']);var _0x3d888d={'where':_0x2fc98e[_0x6faa('0x3a')]};return db[_0x6faa('0x2d')][_0x6faa('0x21')](_0x3d888d)[_0x6faa('0x27')](function(_0x3a45b1){_0x19f768['count']=_0x3a45b1;if(_0x2355e4[_0x6faa('0x31')][_0x6faa('0x3f')]){_0x2fc98e[_0x6faa('0x40')]=[{'all':!![]}];}return db[_0x6faa('0x2d')][_0x6faa('0x41')](_0x2fc98e);})['then'](function(_0x102271){_0x19f768[_0x6faa('0x42')]=_0x102271;return _0x19f768;})[_0x6faa('0x27')](respondWithFilteredResult(_0xf20193,_0x2fc98e))[_0x6faa('0x43')](handleError(_0xf20193,null));};exports['show']=function(_0x161da6,_0x4cafe1){var _0x520b27={'raw':!![],'where':{'id':_0x161da6[_0x6faa('0x44')]['id']}},_0x1d5101={};_0x1d5101['model']=_[_0x6faa('0x32')](db[_0x6faa('0x2d')][_0x6faa('0x45')]);_0x1d5101[_0x6faa('0x31')]=_['keys'](_0x161da6['query']);_0x1d5101['filters']=_[_0x6faa('0x34')](_0x1d5101[_0x6faa('0x30')],_0x1d5101[_0x6faa('0x31')]);_0x520b27['attributes']=_[_0x6faa('0x34')](_0x1d5101['model'],qs[_0x6faa('0x36')](_0x161da6[_0x6faa('0x31')][_0x6faa('0x36')]));_0x520b27[_0x6faa('0x35')]=_0x520b27['attributes']['length']?_0x520b27[_0x6faa('0x35')]:_0x1d5101[_0x6faa('0x30')];if(_0x161da6[_0x6faa('0x31')][_0x6faa('0x3f')]){_0x520b27['include']=[{'all':!![]}];}_0x520b27=_[_0x6faa('0x3d')]({},_0x520b27,_0x161da6['options']);return db[_0x6faa('0x2d')][_0x6faa('0x46')](_0x520b27)[_0x6faa('0x27')](handleEntityNotFound(_0x4cafe1,null))[_0x6faa('0x27')](respondWithResult(_0x4cafe1,null))['catch'](handleError(_0x4cafe1,null));};exports[_0x6faa('0x47')]=function(_0x258e30,_0x1442a3){return db[_0x6faa('0x2d')]['create'](_0x258e30[_0x6faa('0x48')],{})['then'](respondWithResult(_0x1442a3,0xc9))[_0x6faa('0x43')](handleError(_0x1442a3,null));};exports['update']=function(_0x5be4d3,_0x4fe82a){if(_0x5be4d3[_0x6faa('0x48')]['id']){delete _0x5be4d3['body']['id'];}return db['ZohoField'][_0x6faa('0x46')]({'where':{'id':_0x5be4d3['params']['id']}})[_0x6faa('0x27')](handleEntityNotFound(_0x4fe82a,null))[_0x6faa('0x27')](saveUpdates(_0x5be4d3['body'],null))[_0x6faa('0x27')](respondWithResult(_0x4fe82a,null))[_0x6faa('0x43')](handleError(_0x4fe82a,null));};exports[_0x6faa('0x28')]=function(_0x19127c,_0x343dd7){return db[_0x6faa('0x2d')][_0x6faa('0x46')]({'where':{'id':_0x19127c['params']['id']}})[_0x6faa('0x27')](handleEntityNotFound(_0x343dd7,null))[_0x6faa('0x27')](removeEntity(_0x343dd7,null))[_0x6faa('0x43')](handleError(_0x343dd7,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 9817132..2cdd2a7 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 _0x958a=['moment','bluebird','request-promise','path','../../config/environment','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','lodash','util','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x958a,0x128));var _0xa958=function(_0x564fd0,_0x4a4921){_0x564fd0=_0x564fd0-0x0;var _0x2e60ee=_0x958a[_0x564fd0];return _0x2e60ee;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var logger=require('../../config/logger')(_0xa958('0x2'));var moment=require(_0xa958('0x3'));var BPromise=require(_0xa958('0x4'));var rp=require(_0xa958('0x5'));var fs=require('fs');var path=require(_0xa958('0x6'));var rimraf=require('rimraf');var config=require(_0xa958('0x7'));var attributes=require('./intZohoField.attributes');module[_0xa958('0x8')]=function(_0x9b7d9e,_0x2692d6){return _0x9b7d9e[_0xa958('0x9')](_0xa958('0xa'),attributes,{'tableName':_0xa958('0xb'),'paranoid':![],'indexes':[{'name':_0xa958('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbff5=['request-promise','rimraf','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1f211b,_0x94927f){var _0x8923ae=function(_0x495497){while(--_0x495497){_0x1f211b['push'](_0x1f211b['shift']());}};_0x8923ae(++_0x94927f);}(_0xbff5,0x1bc));var _0x5bff=function(_0x31769c,_0xbb3be2){_0x31769c=_0x31769c-0x0;var _0x577651=_0xbff5[_0x31769c];return _0x577651;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var logger=require(_0x5bff('0x2'))(_0x5bff('0x3'));var moment=require(_0x5bff('0x4'));var BPromise=require(_0x5bff('0x5'));var rp=require(_0x5bff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5bff('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x5bff('0x8')]=function(_0x1d8650,_0x151add){return _0x1d8650[_0x5bff('0x9')](_0x5bff('0xa'),attributes,{'tableName':_0x5bff('0xb'),'paranoid':![],'indexes':[{'name':_0x5bff('0xc'),'fields':[_0x5bff('0xd'),_0x5bff('0xe')],'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 d1c321e..f30464e 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 _0x1b41=['stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4c1eb9,_0x3ff461){var _0x58d541=function(_0x4d0215){while(--_0x4d0215){_0x4c1eb9['push'](_0x4c1eb9['shift']());}};_0x58d541(++_0x3ff461);}(_0x1b41,0xf8));var _0x11b4=function(_0x4e8e68,_0x52a7b8){_0x4e8e68=_0x4e8e68-0x0;var _0x3c1398=_0x1b41[_0x4e8e68];return _0x3c1398;};'use strict';var _=require(_0x11b4('0x0'));var util=require(_0x11b4('0x1'));var moment=require(_0x11b4('0x2'));var BPromise=require('bluebird');var rs=require(_0x11b4('0x3'));var fs=require('fs');var Redis=require(_0x11b4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x11b4('0x5'))(_0x11b4('0x6'));var config=require(_0x11b4('0x7'));var jayson=require(_0x11b4('0x8'));var client=jayson['client'][_0x11b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cf61c,_0xaf7f64,_0x5755cc){return new BPromise(function(_0x26e7b2,_0x2f781f){return client[_0x11b4('0xa')](_0x5cf61c,_0x5755cc)[_0x11b4('0xb')](function(_0x2a4727){logger['info'](_0x11b4('0xc'),_0xaf7f64,'request\x20sent');logger[_0x11b4('0xd')](_0x11b4('0xe'),_0xaf7f64,_0x11b4('0xf'),JSON[_0x11b4('0x10')](_0x2a4727));if(_0x2a4727[_0x11b4('0x11')]){if(_0x2a4727[_0x11b4('0x11')][_0x11b4('0x12')]===0x1f4){logger[_0x11b4('0x11')](_0x11b4('0xc'),_0xaf7f64,_0x2a4727[_0x11b4('0x11')][_0x11b4('0x13')]);return _0x2f781f(_0x2a4727[_0x11b4('0x11')][_0x11b4('0x13')]);}logger[_0x11b4('0x11')](_0x11b4('0xc'),_0xaf7f64,_0x2a4727[_0x11b4('0x11')][_0x11b4('0x13')]);return _0x26e7b2(_0x2a4727[_0x11b4('0x11')][_0x11b4('0x13')]);}else{logger[_0x11b4('0x14')](_0x11b4('0xc'),_0xaf7f64,'request\x20sent');_0x26e7b2(_0x2a4727['result']['message']);}})[_0x11b4('0x15')](function(_0xd57b7){logger['error'](_0x11b4('0xc'),_0xaf7f64,_0xd57b7);_0x2f781f(_0xd57b7);});});} \ No newline at end of file +var _0x4d24=['client','http','request','then','info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x542445,_0x22443d){var _0x50eb92=function(_0x160e36){while(--_0x160e36){_0x542445['push'](_0x542445['shift']());}};_0x50eb92(++_0x22443d);}(_0x4d24,0x1c5));var _0x44d2=function(_0x4b721a,_0x1ea950){_0x4b721a=_0x4b721a-0x0;var _0x8e8d20=_0x4d24[_0x4b721a];return _0x8e8d20;};'use strict';var _=require(_0x44d2('0x0'));var util=require(_0x44d2('0x1'));var moment=require(_0x44d2('0x2'));var BPromise=require('bluebird');var rs=require(_0x44d2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44d2('0x4'));var logger=require(_0x44d2('0x5'))(_0x44d2('0x6'));var config=require(_0x44d2('0x7'));var jayson=require(_0x44d2('0x8'));var client=jayson[_0x44d2('0x9')][_0x44d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42f705,_0x44d90b,_0x13e6d0){return new BPromise(function(_0x5d65d5,_0x1eac2d){return client[_0x44d2('0xb')](_0x42f705,_0x13e6d0)[_0x44d2('0xc')](function(_0x2909a6){logger[_0x44d2('0xd')](_0x44d2('0xe'),_0x44d90b,'request\x20sent');logger['debug'](_0x44d2('0xf'),_0x44d90b,_0x44d2('0x10'),JSON[_0x44d2('0x11')](_0x2909a6));if(_0x2909a6[_0x44d2('0x12')]){if(_0x2909a6[_0x44d2('0x12')][_0x44d2('0x13')]===0x1f4){logger[_0x44d2('0x12')]('ZohoField,\x20%s,\x20%s',_0x44d90b,_0x2909a6[_0x44d2('0x12')]['message']);return _0x1eac2d(_0x2909a6['error'][_0x44d2('0x14')]);}logger['error'](_0x44d2('0xe'),_0x44d90b,_0x2909a6['error']['message']);return _0x5d65d5(_0x2909a6['error'][_0x44d2('0x14')]);}else{logger[_0x44d2('0xd')]('ZohoField,\x20%s,\x20%s',_0x44d90b,_0x44d2('0x10'));_0x5d65d5(_0x2909a6['result'][_0x44d2('0x14')]);}})[_0x44d2('0x15')](function(_0x632f26){logger['error']('ZohoField,\x20%s,\x20%s',_0x44d90b,_0x632f26);_0x1eac2d(_0x632f26);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 3eba246..ef9d2da 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5af1c8,_0x1b359f){var _0x5163d6=function(_0xf411ec){while(--_0xf411ec){_0x5af1c8['push'](_0x5af1c8['shift']());}};_0x5163d6(++_0x1b359f);}(_0x70e0,0x17b));var _0x070e=function(_0x483c06,_0x3d51e1){_0x483c06=_0x483c06-0x0;var _0x26dc79=_0x70e0[_0x483c06];return _0x26dc79;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x301755,_0xd69dc3){var _0x2dac9a=function(_0x29e089){while(--_0x29e089){_0x301755['push'](_0x301755['shift']());}};_0x2dac9a(++_0xd69dc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index b012ed8..20dd534 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 _0x34ec=['app.js','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x34d509,_0x315f64){var _0x20a5bb=function(_0x55b1c7){while(--_0x55b1c7){_0x34d509['push'](_0x34d509['shift']());}};_0x20a5bb(++_0x315f64);}(_0x34ec,0x129));var _0xc34e=function(_0x2ea98d,_0x2db302){_0x2ea98d=_0x2ea98d-0x0;var _0x3d4c08=_0x34ec[_0x2ea98d];return _0x3d4c08;};'use strict';var Sequelize=require(_0xc34e('0x0'));module[_0xc34e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xc34e('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xc34e('0x2')],'defaultValue':_0xc34e('0x3')},'filename':{'type':Sequelize[_0xc34e('0x2')]},'path':{'type':Sequelize[_0xc34e('0x2')]},'type':{'type':Sequelize[_0xc34e('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xc34e('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xc34e('0x2')]},'logo':{'type':Sequelize[_0xc34e('0x2')]},'state':{'type':Sequelize[_0xc34e('0x2')],'unique':_0xc34e('0x5')},'description':{'type':Sequelize[_0xc34e('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc34e('0x2')]},'link':{'type':Sequelize[_0xc34e('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xf4eb=['BOOLEAN','state','sequelize','unique_name_and_version','STRING','INTEGER'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf4eb,0xec));var _0xbf4e=function(_0x475911,_0x50065b){_0x475911=_0x475911-0x0;var _0x25144e=_0xf4eb[_0x475911];return _0x25144e;};'use strict';var Sequelize=require(_0xbf4e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbf4e('0x1')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xbf4e('0x2')]},'path':{'type':Sequelize[_0xbf4e('0x2')]},'type':{'type':Sequelize[_0xbf4e('0x2')]},'size':{'type':Sequelize[_0xbf4e('0x3')]},'active':{'type':Sequelize[_0xbf4e('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xbf4e('0x2')]},'logo':{'type':Sequelize[_0xbf4e('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0xbf4e('0x5')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbf4e('0x2')]},'link':{'type':Sequelize[_0xbf4e('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 89c3bc2..4844524 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 _0x5496=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','Integration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x5496,0x175));var _0x6549=function(_0x2a875a,_0xafea39){_0x2a875a=_0x2a875a-0x0;var _0xf33685=_0x5496[_0x2a875a];return _0xf33685;};'use strict';var emlformat=require(_0x6549('0x0'));var rimraf=require(_0x6549('0x1'));var zipdir=require(_0x6549('0x2'));var jsonpatch=require(_0x6549('0x3'));var rp=require(_0x6549('0x4'));var moment=require('moment');var BPromise=require(_0x6549('0x5'));var Mustache=require('mustache');var util=require(_0x6549('0x6'));var path=require(_0x6549('0x7'));var sox=require(_0x6549('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6549('0x9'));var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var licenseUtil=require(_0x6549('0x17'));var db=require(_0x6549('0x18'))['db'];function respondWithStatusCode(_0x5bc018,_0x4dfb06){_0x4dfb06=_0x4dfb06||0xcc;return function(_0x3f844f){if(_0x3f844f){return _0x5bc018[_0x6549('0x19')](_0x4dfb06);}return _0x5bc018['status'](_0x4dfb06)[_0x6549('0x1a')]();};}function respondWithResult(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xc8;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25)[_0x6549('0x1c')](_0x12b068);}};}function respondWithFilteredResult(_0x55c112,_0x5db86d){return function(_0x384f75){if(_0x384f75){var _0x25da29=typeof _0x5db86d['offset']===_0x6549('0x1d')&&typeof _0x5db86d[_0x6549('0x1e')]===_0x6549('0x1d');var _0x387e60=_0x384f75[_0x6549('0x1f')];var _0x53b12b=_0x25da29?0x0:_0x5db86d['offset'];var _0x26a212=_0x25da29?_0x384f75['count']:_0x5db86d['offset']+_0x5db86d[_0x6549('0x1e')];var _0x1e5079;if(_0x26a212>=_0x387e60){_0x26a212=_0x387e60;_0x1e5079=0xc8;}else{_0x1e5079=0xce;}_0x55c112[_0x6549('0x1b')](_0x1e5079);return _0x55c112[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x26a212+'/'+_0x387e60)['json'](_0x384f75);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1b')](_0xfb51a1)['send'](_0x14de1f);};}exports[_0x6549('0x2a')]=function(_0x136518,_0x17fdfb){var _0x4c605c={},_0x3f1502={},_0x4acaf5={'count':0x0,'rows':[]};var _0x4f0ad1=_['map'](db[_0x6549('0x2b')][_0x6549('0x2c')],function(_0x4f3069){return{'name':_0x4f3069[_0x6549('0x2d')],'type':_0x4f3069[_0x6549('0x2e')][_0x6549('0x2f')]};});_0x3f1502[_0x6549('0x30')]=_[_0x6549('0x31')](_0x4f0ad1,_0x6549('0x29'));_0x3f1502[_0x6549('0x32')]=_['keys'](_0x136518[_0x6549('0x32')]);_0x3f1502[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3f1502[_0x6549('0x30')],_0x3f1502[_0x6549('0x32')]);_0x4c605c[_0x6549('0x35')]=_['intersection'](_0x3f1502[_0x6549('0x30')],qs['fields'](_0x136518[_0x6549('0x32')]['fields']));_0x4c605c[_0x6549('0x35')]=_0x4c605c[_0x6549('0x35')][_0x6549('0x36')]?_0x4c605c['attributes']:_0x3f1502[_0x6549('0x30')];if(!_0x136518[_0x6549('0x32')][_0x6549('0x37')](_0x6549('0x38'))){_0x4c605c['limit']=qs['limit'](_0x136518['query'][_0x6549('0x1e')]);_0x4c605c[_0x6549('0x39')]=qs['offset'](_0x136518[_0x6549('0x32')][_0x6549('0x39')]);}_0x4c605c[_0x6549('0x3a')]=qs[_0x6549('0x3b')](_0x136518[_0x6549('0x32')]['sort']);_0x4c605c['where']=qs[_0x6549('0x33')](_[_0x6549('0x3c')](_0x136518[_0x6549('0x32')],_0x3f1502[_0x6549('0x33')]),_0x4f0ad1);if(_0x136518[_0x6549('0x32')][_0x6549('0x3d')]){_0x4c605c[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x4c605c[_0x6549('0x3e')],{'$or':_[_0x6549('0x31')](_0x4f0ad1,function(_0x525f82){if(_0x525f82[_0x6549('0x2e')]!==_0x6549('0x40')){var _0x2ea977={};_0x2ea977[_0x525f82[_0x6549('0x29')]]={'$like':'%'+_0x136518[_0x6549('0x32')]['filter']+'%'};return _0x2ea977;}})});}_0x4c605c=_['merge']({},_0x4c605c,_0x136518['options']);var _0x22b919={'where':_0x4c605c[_0x6549('0x3e')]};return db[_0x6549('0x2b')][_0x6549('0x1f')](_0x22b919)['then'](function(_0x56ce9f){_0x4acaf5[_0x6549('0x1f')]=_0x56ce9f;if(_0x136518[_0x6549('0x32')][_0x6549('0x41')]){_0x4c605c['include']=[{'all':!![]}];}return db[_0x6549('0x2b')]['findAll'](_0x4c605c);})[_0x6549('0x26')](function(_0x2ec614){_0x4acaf5[_0x6549('0x42')]=_0x2ec614;return _0x4acaf5;})[_0x6549('0x26')](respondWithFilteredResult(_0x17fdfb,_0x4c605c))[_0x6549('0x43')](handleError(_0x17fdfb,null));};exports[_0x6549('0x44')]=function(_0xbbfdc9,_0x4deaab){var _0x132625={'raw':![],'where':{'id':_0xbbfdc9[_0x6549('0x45')]['id']}},_0x309f45={};_0x309f45[_0x6549('0x30')]=_[_0x6549('0x46')](db[_0x6549('0x2b')][_0x6549('0x2c')]);_0x309f45[_0x6549('0x32')]=_[_0x6549('0x46')](_0xbbfdc9[_0x6549('0x32')]);_0x309f45[_0x6549('0x33')]=_[_0x6549('0x34')](_0x309f45[_0x6549('0x30')],_0x309f45[_0x6549('0x32')]);_0x132625[_0x6549('0x35')]=_[_0x6549('0x34')](_0x309f45['model'],qs[_0x6549('0x47')](_0xbbfdc9[_0x6549('0x32')][_0x6549('0x47')]));_0x132625[_0x6549('0x35')]=_0x132625['attributes'][_0x6549('0x36')]?_0x132625['attributes']:_0x309f45[_0x6549('0x30')];if(_0xbbfdc9[_0x6549('0x32')]['includeAll']){_0x132625[_0x6549('0x48')]=[{'all':!![]}];}_0x132625=_[_0x6549('0x3f')]({},_0x132625,_0xbbfdc9[_0x6549('0x49')]);return db[_0x6549('0x2b')][_0x6549('0x4a')](_0x132625)['then'](handleEntityNotFound(_0x4deaab,null))['then'](respondWithResult(_0x4deaab,null))[_0x6549('0x43')](handleError(_0x4deaab,null));};exports[_0x6549('0x4b')]=function(_0x41d675,_0x1712f3){return db[_0x6549('0x2b')]['create'](_0x41d675[_0x6549('0x4c')],{})[_0x6549('0x26')](respondWithResult(_0x1712f3,0xc9))[_0x6549('0x43')](handleError(_0x1712f3,null));};exports[_0x6549('0x25')]=function(_0xa4c650,_0x25a6ee){if(_0xa4c650[_0x6549('0x4c')]['id']){delete _0xa4c650[_0x6549('0x4c')]['id'];}return db['Integration'][_0x6549('0x4a')]({'where':{'id':_0xa4c650['params']['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x25a6ee,null))[_0x6549('0x26')](saveUpdates(_0xa4c650[_0x6549('0x4c')],null))['then'](respondWithResult(_0x25a6ee,null))[_0x6549('0x43')](handleError(_0x25a6ee,null));};exports[_0x6549('0x4d')]=function(_0x2ef4d2,_0x5300c8){return db[_0x6549('0x2b')][_0x6549('0x4a')]({'where':{'id':_0x2ef4d2[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x5300c8,null))[_0x6549('0x26')](removeEntity(_0x5300c8,null))[_0x6549('0x43')](handleError(_0x5300c8,null));}; \ No newline at end of file +var _0x4c60=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','Integration','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4c60,0xc1));var _0x04c6=function(_0x2702df,_0x54b459){_0x2702df=_0x2702df-0x0;var _0x38fbc5=_0x4c60[_0x2702df];return _0x38fbc5;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['Integration'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['Integration'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['Integration'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['Integration'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['Integration'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 6ecdc90..6d9130c 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 _0x63fb=['Integration','integrations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xc1bdf3,_0x2b7fb3){var _0x182ae8=function(_0x1fdcd){while(--_0x1fdcd){_0xc1bdf3['push'](_0xc1bdf3['shift']());}};_0x182ae8(++_0x2b7fb3);}(_0x63fb,0x16e));var _0xb63f=function(_0x8b2cc7,_0x3f492b){_0x8b2cc7=_0x8b2cc7-0x0;var _0x2a4a45=_0x63fb[_0x8b2cc7];return _0x2a4a45;};'use strict';var _=require(_0xb63f('0x0'));var util=require('util');var logger=require(_0xb63f('0x1'))(_0xb63f('0x2'));var moment=require(_0xb63f('0x3'));var BPromise=require(_0xb63f('0x4'));var rp=require(_0xb63f('0x5'));var fs=require('fs');var path=require(_0xb63f('0x6'));var rimraf=require(_0xb63f('0x7'));var config=require(_0xb63f('0x8'));var attributes=require('./integration.attributes');module[_0xb63f('0x9')]=function(_0x1336af,_0x4b6be1){return _0x1336af[_0xb63f('0xa')](_0xb63f('0xb'),attributes,{'tableName':_0xb63f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x355c=['integrations','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./integration.attributes','exports','define','Integration'];(function(_0x27fedb,_0x31c693){var _0x58ab78=function(_0x532732){while(--_0x532732){_0x27fedb['push'](_0x27fedb['shift']());}};_0x58ab78(++_0x31c693);}(_0x355c,0xb5));var _0xc355=function(_0x1faa61,_0x1bd7e2){_0x1faa61=_0x1faa61-0x0;var _0x3f0e58=_0x355c[_0x1faa61];return _0x3f0e58;};'use strict';var _=require(_0xc355('0x0'));var util=require('util');var logger=require(_0xc355('0x1'))('api');var moment=require(_0xc355('0x2'));var BPromise=require(_0xc355('0x3'));var rp=require(_0xc355('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc355('0x5'));var config=require(_0xc355('0x6'));var attributes=require(_0xc355('0x7'));module[_0xc355('0x8')]=function(_0x304ebe,_0x4fdaf8){return _0x304ebe[_0xc355('0x9')](_0xc355('0xa'),attributes,{'tableName':_0xc355('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 2de249e..3a01265 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 _0x0b0e=['Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','debug'];(function(_0x1cc961,_0x2c42ee){var _0x471d86=function(_0x44e422){while(--_0x44e422){_0x1cc961['push'](_0x1cc961['shift']());}};_0x471d86(++_0x2c42ee);}(_0x0b0e,0x187));var _0xe0b0=function(_0xcdac34,_0x43f665){_0xcdac34=_0xcdac34-0x0;var _0x269d23=_0x0b0e[_0xcdac34];return _0x269d23;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Integration,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0x524e,0x15e));var _0xe524=function(_0x33a345,_0x11c58b){_0x33a345=_0x33a345-0x0;var _0x242b1d=_0x524e[_0x33a345];return _0x242b1d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 0b84987..19ea2d7 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 _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x218681,_0x16971b){var _0x56c5de=function(_0x34b75a){while(--_0x34b75a){_0x218681['push'](_0x218681['shift']());}};_0x56c5de(++_0x16971b);}(_0x66fa,0x117));var _0xa66f=function(_0x43904c,_0x45b1d8){_0x43904c=_0x43904c-0x0;var _0x56dc2e=_0x66fa[_0x43904c];return _0x56dc2e;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router; \ No newline at end of file +var _0xdb28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','put','update'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xdb28,0x106));var _0x8db2=function(_0x3c3a20,_0x3c2b13){_0x3c3a20=_0x3c3a20-0x0;var _0xb909f=_0xdb28[_0x3c3a20];return _0xb909f;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./integrationReport.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post']('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x11')]);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x12')]);module[_0x8db2('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 11c79bd..b9c8ea2 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 _0xdf22=['BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED','exports','STRING','DATE','INTEGER'];(function(_0x821e2e,_0x3e0be9){var _0x43b098=function(_0x20f76e){while(--_0x20f76e){_0x821e2e['push'](_0x821e2e['shift']());}};_0x43b098(++_0x3e0be9);}(_0xdf22,0x74));var _0x2df2=function(_0x55060d,_0x481134){_0x55060d=_0x55060d-0x0;var _0x40996c=_0xdf22[_0x55060d];return _0x40996c;};'use strict';var Sequelize=require('sequelize');module[_0x2df2('0x0')]={'integration':{'type':Sequelize[_0x2df2('0x1')]},'eventChannel':{'type':Sequelize[_0x2df2('0x1')]},'exitStatus':{'type':Sequelize[_0x2df2('0x1')]},'ticketId':{'type':Sequelize[_0x2df2('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x2df2('0x1')]},'uniqueid':{'type':Sequelize[_0x2df2('0x1')]},'calleridnum':{'type':Sequelize[_0x2df2('0x1')]},'calleridname':{'type':Sequelize[_0x2df2('0x1')]},'queue':{'type':Sequelize[_0x2df2('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x2df2('0x1')]},'agentcalledAt':{'type':Sequelize[_0x2df2('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x2df2('0x3')]},'agentcomplete':{'type':Sequelize[_0x2df2('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x2df2('0x2')]},'talktime':{'type':Sequelize[_0x2df2('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2df2('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x2df2('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x2df2('0x2')]},'lastevent':{'type':Sequelize[_0x2df2('0x1')]},'channel':{'type':Sequelize[_0x2df2('0x1')]},'channelstate':{'type':Sequelize[_0x2df2('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x2df2('0x1')]},'connectedlinename':{'type':Sequelize[_0x2df2('0x1')]},'language':{'type':Sequelize[_0x2df2('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2df2('0x1')]},'exten':{'type':Sequelize[_0x2df2('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x2df2('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x2df2('0x1')]},'destcalleridnum':{'type':Sequelize[_0x2df2('0x1')]},'destcalleridname':{'type':Sequelize[_0x2df2('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x2df2('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x2df2('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x2df2('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x2df2('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x2df2('0x1')]},'inReplyTo':{'type':Sequelize[_0x2df2('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x2df2('0x1')]},'to':{'type':Sequelize[_0x2df2('0x1')]},'cc':{'type':Sequelize[_0x2df2('0x1')]},'attachment':{'type':Sequelize[_0x2df2('0x5')]},'html':{'type':Sequelize[_0x2df2('0x5')]},'text':{'type':Sequelize[_0x2df2('0x5')]},'status':{'type':Sequelize['ENUM'](_0x2df2('0x6'),_0x2df2('0x7'),_0x2df2('0x8'),_0x2df2('0x9'))},'url':{'type':Sequelize[_0x2df2('0x1')]},'app':{'type':Sequelize[_0x2df2('0x1')]},'appdata':{'type':Sequelize[_0x2df2('0x1')]},'projectId':{'type':Sequelize[_0x2df2('0x3')]}}; \ No newline at end of file +var _0xf82f=['TEXT','SENT','SENDING','sequelize','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x52ce8e,_0x4dacf5){var _0x489cf9=function(_0x374ab2){while(--_0x374ab2){_0x52ce8e['push'](_0x52ce8e['shift']());}};_0x489cf9(++_0x4dacf5);}(_0xf82f,0xd3));var _0xff82=function(_0x320627,_0x425b64){_0x320627=_0x320627-0x0;var _0x185d38=_0xf82f[_0x320627];return _0x185d38;};'use strict';var Sequelize=require(_0xff82('0x0'));module['exports']={'integration':{'type':Sequelize[_0xff82('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xff82('0x1')]},'integrationId':{'type':Sequelize[_0xff82('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xff82('0x1')]},'calleridnum':{'type':Sequelize[_0xff82('0x1')]},'calleridname':{'type':Sequelize[_0xff82('0x1')]},'queue':{'type':Sequelize[_0xff82('0x1')]},'interface':{'type':Sequelize[_0xff82('0x1')]},'membername':{'type':Sequelize[_0xff82('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xff82('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xff82('0x2')]},'agentacw':{'type':Sequelize[_0xff82('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xff82('0x2')]},'reason':{'type':Sequelize[_0xff82('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xff82('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xff82('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xff82('0x3')]},'lastevent':{'type':Sequelize[_0xff82('0x1')]},'channel':{'type':Sequelize[_0xff82('0x1')]},'channelstate':{'type':Sequelize[_0xff82('0x2')]},'channelstatedesc':{'type':Sequelize[_0xff82('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xff82('0x1')]},'accountcode':{'type':Sequelize[_0xff82('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xff82('0x1')]},'priority':{'type':Sequelize[_0xff82('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xff82('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xff82('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xff82('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xff82('0x1')]},'destlanguage':{'type':Sequelize[_0xff82('0x1')]},'destaccountcode':{'type':Sequelize[_0xff82('0x1')]},'destcontext':{'type':Sequelize[_0xff82('0x1')]},'destexten':{'type':Sequelize[_0xff82('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xff82('0x1')]},'messageId':{'type':Sequelize[_0xff82('0x1')]},'inReplyTo':{'type':Sequelize[_0xff82('0x1')]},'subject':{'type':Sequelize[_0xff82('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xff82('0x1')]},'cc':{'type':Sequelize[_0xff82('0x1')]},'attachment':{'type':Sequelize[_0xff82('0x5')]},'html':{'type':Sequelize[_0xff82('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0xff82('0x6'),_0xff82('0x7'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0xff82('0x1')]},'app':{'type':Sequelize[_0xff82('0x1')]},'appdata':{'type':Sequelize[_0xff82('0x1')]},'projectId':{'type':Sequelize[_0xff82('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 08ef370..78f2edc 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 _0x31fd=['destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','then','findAll','rows','params','keys','include','options','find','catch','create','body','describe','rimraf','zip-dir','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x31fd,0x71));var _0xd31f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x31fd[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd31f('0x0'));var zipdir=require(_0xd31f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd31f('0x2'));var Mustache=require('mustache');var util=require(_0xd31f('0x3'));var path=require(_0xd31f('0x4'));var sox=require(_0xd31f('0x5'));var csv=require(_0xd31f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd31f('0x7'));var _=require(_0xd31f('0x8'));var squel=require(_0xd31f('0x9'));var crypto=require(_0xd31f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd31f('0xb'));var toCsv=require(_0xd31f('0x6'));var querystring=require(_0xd31f('0xc'));var Papa=require(_0xd31f('0xd'));var Redis=require(_0xd31f('0xe'));var authService=require(_0xd31f('0xf'));var qs=require(_0xd31f('0x10'));var as=require(_0xd31f('0x11'));var hardwareService=require(_0xd31f('0x12'));var logger=require(_0xd31f('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd31f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd31f('0x15'))['db'];function respondWithStatusCode(_0x3cb453,_0x4a9c45){_0x4a9c45=_0x4a9c45||0xcc;return function(_0x54c9ef){if(_0x54c9ef){return _0x3cb453[_0xd31f('0x16')](_0x4a9c45);}return _0x3cb453[_0xd31f('0x17')](_0x4a9c45)['end']();};}function respondWithResult(_0x5cfedc,_0xa5f41a){_0xa5f41a=_0xa5f41a||0xc8;return function(_0x1c8411){if(_0x1c8411){return _0x5cfedc[_0xd31f('0x17')](_0xa5f41a)['json'](_0x1c8411);}};}function respondWithFilteredResult(_0x5e4d6b,_0x2ac858){return function(_0x2232e9){if(_0x2232e9){var _0x5bfda6=typeof _0x2ac858[_0xd31f('0x18')]===_0xd31f('0x19')&&typeof _0x2ac858[_0xd31f('0x1a')]===_0xd31f('0x19');var _0xfb7e0b=_0x2232e9[_0xd31f('0x1b')];var _0x4f833f=_0x5bfda6?0x0:_0x2ac858['offset'];var _0x5f9c74=_0x5bfda6?_0x2232e9[_0xd31f('0x1b')]:_0x2ac858[_0xd31f('0x18')]+_0x2ac858[_0xd31f('0x1a')];var _0x8d9db3;if(_0x5f9c74>=_0xfb7e0b){_0x5f9c74=_0xfb7e0b;_0x8d9db3=0xc8;}else{_0x8d9db3=0xce;}_0x5e4d6b[_0xd31f('0x17')](_0x8d9db3);return _0x5e4d6b['set'](_0xd31f('0x1c'),_0x4f833f+'-'+_0x5f9c74+'/'+_0xfb7e0b)[_0xd31f('0x1d')](_0x2232e9);}return null;};}function patchUpdates(_0xc05bfb){return function(_0x3d5911){try{jsonpatch[_0xd31f('0x1e')](_0x3d5911,_0xc05bfb,!![]);}catch(_0x289fcc){return BPromise[_0xd31f('0x1f')](_0x289fcc);}return _0x3d5911['save']();};}function saveUpdates(_0x5685c2,_0x5df67b){return function(_0x16679e){if(_0x16679e){return _0x16679e[_0xd31f('0x20')](_0x5685c2)['then'](function(_0x327a52){return _0x327a52;});}return null;};}function removeEntity(_0xc9ea84,_0x41749a){return function(_0x2a5253){if(_0x2a5253){return _0x2a5253[_0xd31f('0x21')]()['then'](function(){_0xc9ea84[_0xd31f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b88db,_0x59b61f){return function(_0xf3ad11){if(!_0xf3ad11){_0x5b88db['sendStatus'](0x194);}return _0xf3ad11;};}function handleError(_0xeca09a,_0x209d89){_0x209d89=_0x209d89||0x1f4;return function(_0x589be6){logger[_0xd31f('0x22')](_0x589be6[_0xd31f('0x23')]);if(_0x589be6[_0xd31f('0x24')]){delete _0x589be6['name'];}_0xeca09a[_0xd31f('0x17')](_0x209d89)[_0xd31f('0x25')](_0x589be6);};}exports[_0xd31f('0x26')]=function(_0x4cbe1d,_0x16ccb8){var _0x37d82b={},_0x15c04a={},_0x1b0e5a={'count':0x0,'rows':[]};var _0x3ac69=_[_0xd31f('0x27')](db[_0xd31f('0x28')][_0xd31f('0x29')],function(_0x566aaf){return{'name':_0x566aaf[_0xd31f('0x2a')],'type':_0x566aaf['type'][_0xd31f('0x2b')]};});_0x15c04a[_0xd31f('0x2c')]=_[_0xd31f('0x27')](_0x3ac69,_0xd31f('0x24'));_0x15c04a[_0xd31f('0x2d')]=_['keys'](_0x4cbe1d[_0xd31f('0x2d')]);_0x15c04a['filters']=_['intersection'](_0x15c04a['model'],_0x15c04a['query']);_0x37d82b[_0xd31f('0x2e')]=_[_0xd31f('0x2f')](_0x15c04a[_0xd31f('0x2c')],qs[_0xd31f('0x30')](_0x4cbe1d['query'][_0xd31f('0x30')]));_0x37d82b['attributes']=_0x37d82b[_0xd31f('0x2e')][_0xd31f('0x31')]?_0x37d82b[_0xd31f('0x2e')]:_0x15c04a[_0xd31f('0x2c')];if(!_0x4cbe1d[_0xd31f('0x2d')][_0xd31f('0x32')](_0xd31f('0x33'))){_0x37d82b[_0xd31f('0x1a')]=qs[_0xd31f('0x1a')](_0x4cbe1d[_0xd31f('0x2d')]['limit']);_0x37d82b[_0xd31f('0x18')]=qs[_0xd31f('0x18')](_0x4cbe1d['query'][_0xd31f('0x18')]);}_0x37d82b[_0xd31f('0x34')]=qs['sort'](_0x4cbe1d[_0xd31f('0x2d')][_0xd31f('0x35')]);_0x37d82b[_0xd31f('0x36')]=qs[_0xd31f('0x37')](_[_0xd31f('0x38')](_0x4cbe1d[_0xd31f('0x2d')],_0x15c04a[_0xd31f('0x37')]),_0x3ac69);if(_0x4cbe1d[_0xd31f('0x2d')][_0xd31f('0x39')]){_0x37d82b[_0xd31f('0x36')]=_['merge'](_0x37d82b[_0xd31f('0x36')],{'$or':_[_0xd31f('0x27')](_0x3ac69,function(_0x580031){if(_0x580031[_0xd31f('0x3a')]!==_0xd31f('0x3b')){var _0x208f07={};_0x208f07[_0x580031[_0xd31f('0x24')]]={'$like':'%'+_0x4cbe1d[_0xd31f('0x2d')][_0xd31f('0x39')]+'%'};return _0x208f07;}})});}_0x37d82b=_[_0xd31f('0x3c')]({},_0x37d82b,_0x4cbe1d['options']);var _0x2d4628={'where':_0x37d82b['where']};return db[_0xd31f('0x28')][_0xd31f('0x1b')](_0x2d4628)[_0xd31f('0x3d')](function(_0xf29e8b){_0x1b0e5a[_0xd31f('0x1b')]=_0xf29e8b;if(_0x4cbe1d[_0xd31f('0x2d')]['includeAll']){_0x37d82b['include']=[{'all':!![]}];}return db[_0xd31f('0x28')][_0xd31f('0x3e')](_0x37d82b);})[_0xd31f('0x3d')](function(_0x5b5a1f){_0x1b0e5a[_0xd31f('0x3f')]=_0x5b5a1f;return _0x1b0e5a;})[_0xd31f('0x3d')](respondWithFilteredResult(_0x16ccb8,_0x37d82b))['catch'](handleError(_0x16ccb8,null));};exports['show']=function(_0x341764,_0x3e5aa1){var _0x54cfd4={'raw':![],'where':{'id':_0x341764[_0xd31f('0x40')]['id']}},_0x18948f={};_0x18948f[_0xd31f('0x2c')]=_[_0xd31f('0x41')](db[_0xd31f('0x28')]['rawAttributes']);_0x18948f[_0xd31f('0x2d')]=_[_0xd31f('0x41')](_0x341764[_0xd31f('0x2d')]);_0x18948f[_0xd31f('0x37')]=_[_0xd31f('0x2f')](_0x18948f[_0xd31f('0x2c')],_0x18948f['query']);_0x54cfd4[_0xd31f('0x2e')]=_[_0xd31f('0x2f')](_0x18948f['model'],qs[_0xd31f('0x30')](_0x341764[_0xd31f('0x2d')]['fields']));_0x54cfd4['attributes']=_0x54cfd4[_0xd31f('0x2e')][_0xd31f('0x31')]?_0x54cfd4[_0xd31f('0x2e')]:_0x18948f[_0xd31f('0x2c')];if(_0x341764[_0xd31f('0x2d')]['includeAll']){_0x54cfd4[_0xd31f('0x42')]=[{'all':!![]}];}_0x54cfd4=_[_0xd31f('0x3c')]({},_0x54cfd4,_0x341764[_0xd31f('0x43')]);return db[_0xd31f('0x28')][_0xd31f('0x44')](_0x54cfd4)['then'](handleEntityNotFound(_0x3e5aa1,null))[_0xd31f('0x3d')](respondWithResult(_0x3e5aa1,null))[_0xd31f('0x45')](handleError(_0x3e5aa1,null));};exports[_0xd31f('0x46')]=function(_0x4f2c59,_0x29caa0){return db[_0xd31f('0x28')][_0xd31f('0x46')](_0x4f2c59[_0xd31f('0x47')],{})[_0xd31f('0x3d')](respondWithResult(_0x29caa0,0xc9))[_0xd31f('0x45')](handleError(_0x29caa0,null));};exports[_0xd31f('0x20')]=function(_0x5e561b,_0x3817ab){if(_0x5e561b[_0xd31f('0x47')]['id']){delete _0x5e561b[_0xd31f('0x47')]['id'];}return db[_0xd31f('0x28')][_0xd31f('0x44')]({'where':{'id':_0x5e561b[_0xd31f('0x40')]['id']}})['then'](handleEntityNotFound(_0x3817ab,null))[_0xd31f('0x3d')](saveUpdates(_0x5e561b[_0xd31f('0x47')],null))[_0xd31f('0x3d')](respondWithResult(_0x3817ab,null))['catch'](handleError(_0x3817ab,null));};exports[_0xd31f('0x21')]=function(_0x4c52b7,_0x1c457b){return db[_0xd31f('0x28')][_0xd31f('0x44')]({'where':{'id':_0x4c52b7[_0xd31f('0x40')]['id']}})['then'](handleEntityNotFound(_0x1c457b,null))['then'](removeEntity(_0x1c457b,null))['catch'](handleError(_0x1c457b,null));};exports['describe']=function(_0x399ee2,_0x5808b6){return db['IntegrationReport'][_0xd31f('0x48')]()['then'](respondWithResult(_0x5808b6,null))['catch'](handleError(_0x5808b6,null));}; \ No newline at end of file +var _0x92bc=['desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','offset','Content-Range','apply','reject','update','then','sendStatus','error','name','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','order','sort','where','filter','merge','VIRTUAL','IntegrationReport','includeAll','include','findAll','rows','catch','params','create','body','find','destroy','describe','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x3de931,_0x4cef4d){var _0x36f5f=function(_0x319034){while(--_0x319034){_0x3de931['push'](_0x3de931['shift']());}};_0x36f5f(++_0x4cef4d);}(_0x92bc,0x79));var _0xc92b=function(_0x50eda8,_0x297d2d){_0x50eda8=_0x50eda8-0x0;var _0x56f172=_0x92bc[_0x50eda8];return _0x56f172;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc92b('0x0'));var rp=require(_0xc92b('0x1'));var moment=require('moment');var BPromise=require(_0xc92b('0x2'));var Mustache=require(_0xc92b('0x3'));var util=require(_0xc92b('0x4'));var path=require(_0xc92b('0x5'));var sox=require(_0xc92b('0x6'));var csv=require(_0xc92b('0x7'));var ejs=require(_0xc92b('0x8'));var fs=require('fs');var fs_extra=require(_0xc92b('0x9'));var _=require(_0xc92b('0xa'));var squel=require('squel');var crypto=require(_0xc92b('0xb'));var jsforce=require(_0xc92b('0xc'));var deskjs=require(_0xc92b('0xd'));var toCsv=require(_0xc92b('0x7'));var querystring=require(_0xc92b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc92b('0xf'));var hardwareService=require(_0xc92b('0x10'));var logger=require(_0xc92b('0x11'))(_0xc92b('0x12'));var utils=require(_0xc92b('0x13'));var config=require(_0xc92b('0x14'));var licenseUtil=require(_0xc92b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a63cd,_0x32eef5){_0x32eef5=_0x32eef5||0xcc;return function(_0x1c6127){if(_0x1c6127){return _0x4a63cd['sendStatus'](_0x32eef5);}return _0x4a63cd[_0xc92b('0x16')](_0x32eef5)[_0xc92b('0x17')]();};}function respondWithResult(_0x2974a5,_0x2a1538){_0x2a1538=_0x2a1538||0xc8;return function(_0x3b8b84){if(_0x3b8b84){return _0x2974a5[_0xc92b('0x16')](_0x2a1538)[_0xc92b('0x18')](_0x3b8b84);}};}function respondWithFilteredResult(_0x235b9d,_0x5a0681){return function(_0x20a601){if(_0x20a601){var _0x138f71=typeof _0x5a0681['offset']===_0xc92b('0x19')&&typeof _0x5a0681[_0xc92b('0x1a')]===_0xc92b('0x19');var _0x1752e6=_0x20a601['count'];var _0x5805fa=_0x138f71?0x0:_0x5a0681[_0xc92b('0x1b')];var _0x237754=_0x138f71?_0x20a601['count']:_0x5a0681[_0xc92b('0x1b')]+_0x5a0681[_0xc92b('0x1a')];var _0xb1164d;if(_0x237754>=_0x1752e6){_0x237754=_0x1752e6;_0xb1164d=0xc8;}else{_0xb1164d=0xce;}_0x235b9d[_0xc92b('0x16')](_0xb1164d);return _0x235b9d['set'](_0xc92b('0x1c'),_0x5805fa+'-'+_0x237754+'/'+_0x1752e6)[_0xc92b('0x18')](_0x20a601);}return null;};}function patchUpdates(_0x2769c0){return function(_0x4399f9){try{jsonpatch[_0xc92b('0x1d')](_0x4399f9,_0x2769c0,!![]);}catch(_0x23201a){return BPromise[_0xc92b('0x1e')](_0x23201a);}return _0x4399f9['save']();};}function saveUpdates(_0x3d8db5,_0x34b330){return function(_0x3ca174){if(_0x3ca174){return _0x3ca174[_0xc92b('0x1f')](_0x3d8db5)[_0xc92b('0x20')](function(_0x1b3443){return _0x1b3443;});}return null;};}function removeEntity(_0x3c5e28,_0x5e8e4b){return function(_0x44a84d){if(_0x44a84d){return _0x44a84d['destroy']()['then'](function(){_0x3c5e28[_0xc92b('0x16')](0xcc)[_0xc92b('0x17')]();});}};}function handleEntityNotFound(_0xfa9d24,_0x4f40ae){return function(_0xf0215d){if(!_0xf0215d){_0xfa9d24[_0xc92b('0x21')](0x194);}return _0xf0215d;};}function handleError(_0x13e53a,_0x47c462){_0x47c462=_0x47c462||0x1f4;return function(_0x390914){logger[_0xc92b('0x22')](_0x390914['stack']);if(_0x390914[_0xc92b('0x23')]){delete _0x390914[_0xc92b('0x23')];}_0x13e53a[_0xc92b('0x16')](_0x47c462)['send'](_0x390914);};}exports[_0xc92b('0x24')]=function(_0x179cbe,_0x2d58ab){var _0x4a2e66={},_0x4bea5d={},_0xcce688={'count':0x0,'rows':[]};var _0x5e8333=_[_0xc92b('0x25')](db['IntegrationReport'][_0xc92b('0x26')],function(_0x28f16b){return{'name':_0x28f16b[_0xc92b('0x27')],'type':_0x28f16b[_0xc92b('0x28')]['key']};});_0x4bea5d['model']=_[_0xc92b('0x25')](_0x5e8333,_0xc92b('0x23'));_0x4bea5d[_0xc92b('0x29')]=_[_0xc92b('0x2a')](_0x179cbe[_0xc92b('0x29')]);_0x4bea5d[_0xc92b('0x2b')]=_[_0xc92b('0x2c')](_0x4bea5d['model'],_0x4bea5d[_0xc92b('0x29')]);_0x4a2e66[_0xc92b('0x2d')]=_[_0xc92b('0x2c')](_0x4bea5d[_0xc92b('0x2e')],qs[_0xc92b('0x2f')](_0x179cbe[_0xc92b('0x29')]['fields']));_0x4a2e66[_0xc92b('0x2d')]=_0x4a2e66[_0xc92b('0x2d')][_0xc92b('0x30')]?_0x4a2e66[_0xc92b('0x2d')]:_0x4bea5d[_0xc92b('0x2e')];if(!_0x179cbe[_0xc92b('0x29')]['hasOwnProperty']('nolimit')){_0x4a2e66[_0xc92b('0x1a')]=qs[_0xc92b('0x1a')](_0x179cbe[_0xc92b('0x29')]['limit']);_0x4a2e66[_0xc92b('0x1b')]=qs[_0xc92b('0x1b')](_0x179cbe[_0xc92b('0x29')][_0xc92b('0x1b')]);}_0x4a2e66[_0xc92b('0x31')]=qs[_0xc92b('0x32')](_0x179cbe['query'][_0xc92b('0x32')]);_0x4a2e66[_0xc92b('0x33')]=qs[_0xc92b('0x2b')](_['pick'](_0x179cbe[_0xc92b('0x29')],_0x4bea5d[_0xc92b('0x2b')]),_0x5e8333);if(_0x179cbe[_0xc92b('0x29')][_0xc92b('0x34')]){_0x4a2e66['where']=_[_0xc92b('0x35')](_0x4a2e66[_0xc92b('0x33')],{'$or':_['map'](_0x5e8333,function(_0x1e4c4c){if(_0x1e4c4c[_0xc92b('0x28')]!==_0xc92b('0x36')){var _0x5c6f45={};_0x5c6f45[_0x1e4c4c[_0xc92b('0x23')]]={'$like':'%'+_0x179cbe[_0xc92b('0x29')][_0xc92b('0x34')]+'%'};return _0x5c6f45;}})});}_0x4a2e66=_[_0xc92b('0x35')]({},_0x4a2e66,_0x179cbe['options']);var _0x357d32={'where':_0x4a2e66[_0xc92b('0x33')]};return db[_0xc92b('0x37')]['count'](_0x357d32)['then'](function(_0x406690){_0xcce688['count']=_0x406690;if(_0x179cbe['query'][_0xc92b('0x38')]){_0x4a2e66[_0xc92b('0x39')]=[{'all':!![]}];}return db['IntegrationReport'][_0xc92b('0x3a')](_0x4a2e66);})['then'](function(_0x206a56){_0xcce688[_0xc92b('0x3b')]=_0x206a56;return _0xcce688;})[_0xc92b('0x20')](respondWithFilteredResult(_0x2d58ab,_0x4a2e66))[_0xc92b('0x3c')](handleError(_0x2d58ab,null));};exports['show']=function(_0x4e654d,_0x2ac150){var _0x19bd04={'raw':![],'where':{'id':_0x4e654d[_0xc92b('0x3d')]['id']}},_0x15490a={};_0x15490a[_0xc92b('0x2e')]=_[_0xc92b('0x2a')](db[_0xc92b('0x37')][_0xc92b('0x26')]);_0x15490a[_0xc92b('0x29')]=_[_0xc92b('0x2a')](_0x4e654d[_0xc92b('0x29')]);_0x15490a['filters']=_['intersection'](_0x15490a[_0xc92b('0x2e')],_0x15490a[_0xc92b('0x29')]);_0x19bd04[_0xc92b('0x2d')]=_[_0xc92b('0x2c')](_0x15490a['model'],qs[_0xc92b('0x2f')](_0x4e654d['query']['fields']));_0x19bd04[_0xc92b('0x2d')]=_0x19bd04[_0xc92b('0x2d')][_0xc92b('0x30')]?_0x19bd04[_0xc92b('0x2d')]:_0x15490a[_0xc92b('0x2e')];if(_0x4e654d[_0xc92b('0x29')][_0xc92b('0x38')]){_0x19bd04[_0xc92b('0x39')]=[{'all':!![]}];}_0x19bd04=_['merge']({},_0x19bd04,_0x4e654d['options']);return db['IntegrationReport']['find'](_0x19bd04)['then'](handleEntityNotFound(_0x2ac150,null))[_0xc92b('0x20')](respondWithResult(_0x2ac150,null))[_0xc92b('0x3c')](handleError(_0x2ac150,null));};exports[_0xc92b('0x3e')]=function(_0x3b0ef3,_0x883685){return db[_0xc92b('0x37')]['create'](_0x3b0ef3['body'],{})[_0xc92b('0x20')](respondWithResult(_0x883685,0xc9))[_0xc92b('0x3c')](handleError(_0x883685,null));};exports[_0xc92b('0x1f')]=function(_0xe707ec,_0x45ea06){if(_0xe707ec[_0xc92b('0x3f')]['id']){delete _0xe707ec[_0xc92b('0x3f')]['id'];}return db[_0xc92b('0x37')][_0xc92b('0x40')]({'where':{'id':_0xe707ec[_0xc92b('0x3d')]['id']}})[_0xc92b('0x20')](handleEntityNotFound(_0x45ea06,null))[_0xc92b('0x20')](saveUpdates(_0xe707ec[_0xc92b('0x3f')],null))[_0xc92b('0x20')](respondWithResult(_0x45ea06,null))[_0xc92b('0x3c')](handleError(_0x45ea06,null));};exports[_0xc92b('0x41')]=function(_0x593f5f,_0x3c1af5){return db[_0xc92b('0x37')][_0xc92b('0x40')]({'where':{'id':_0x593f5f['params']['id']}})['then'](handleEntityNotFound(_0x3c1af5,null))[_0xc92b('0x20')](removeEntity(_0x3c1af5,null))['catch'](handleError(_0x3c1af5,null));};exports[_0xc92b('0x42')]=function(_0x4d59c1,_0x41189d){return db['IntegrationReport'][_0xc92b('0x42')]()[_0xc92b('0x20')](respondWithResult(_0x41189d,null))[_0xc92b('0x3c')](handleError(_0x41189d,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index f0812c3..6bf979d 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 _0x3a50=['IntegrationReport','report_integration','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3a50,0x138));var _0x03a5=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x3a50[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x03a5('0x0'))('api');var moment=require('moment');var BPromise=require(_0x03a5('0x1'));var rp=require(_0x03a5('0x2'));var fs=require('fs');var path=require(_0x03a5('0x3'));var rimraf=require(_0x03a5('0x4'));var config=require(_0x03a5('0x5'));var attributes=require(_0x03a5('0x6'));module[_0x03a5('0x7')]=function(_0x2425f4,_0x7e9672){return _0x2425f4['define'](_0x03a5('0x8'),attributes,{'tableName':_0x03a5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x469c=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x469c,0x137));var _0xc469=function(_0x59c765,_0x1b14cb){_0x59c765=_0x59c765-0x0;var _0x731b6d=_0x469c[_0x59c765];return _0x731b6d;};'use strict';var _=require(_0xc469('0x0'));var util=require(_0xc469('0x1'));var logger=require(_0xc469('0x2'))(_0xc469('0x3'));var moment=require('moment');var BPromise=require(_0xc469('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc469('0x5'));var config=require(_0xc469('0x6'));var attributes=require(_0xc469('0x7'));module[_0xc469('0x8')]=function(_0x497c84,_0x2f682f){return _0x497c84[_0xc469('0x9')](_0xc469('0xa'),attributes,{'tableName':_0xc469('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 73446e0..17d4e1c 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 _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xc2c7,0x134));var _0x7c2c=function(_0x2bd354,_0x4ade9c){_0x2bd354=_0x2bd354-0x0;var _0x2b0385=_0xc2c7[_0x2bd354];return _0x2b0385;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file +var _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x93312b,_0x2dce84){var _0x5d86af=function(_0x28e301){while(--_0x28e301){_0x93312b['push'](_0x93312b['shift']());}};_0x5d86af(++_0x2dce84);}(_0x187d,0x93));var _0xd187=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x187d[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index dff09e0..9517874 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 _0x44ff=['getIntervals','post','create','/:id/sub_intervals','addInterval','addIntervals','put','/:id','update','delete','destroy','util','path','connect-timeout','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show'];(function(_0x2f1c42,_0x482ce3){var _0x2f5f64=function(_0x37fd99){while(--_0x37fd99){_0x2f1c42['push'](_0x2f1c42['shift']());}};_0x2f5f64(++_0x482ce3);}(_0x44ff,0x1c3));var _0xf44f=function(_0x1cab4d,_0x5824c9){_0x1cab4d=_0x1cab4d-0x0;var _0x368a67=_0x44ff[_0x1cab4d];return _0x368a67;};'use strict';var multer=require('multer');var util=require(_0xf44f('0x0'));var path=require(_0xf44f('0x1'));var timeout=require(_0xf44f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf44f('0x3'));var config=require(_0xf44f('0x4'));var controller=require('./interval.controller');router['get']('/',auth[_0xf44f('0x5')](),controller[_0xf44f('0x6')]);router[_0xf44f('0x7')]('/:id',auth[_0xf44f('0x5')](),controller[_0xf44f('0x8')]);router[_0xf44f('0x7')]('/:id/sub_intervals',auth[_0xf44f('0x5')](),controller[_0xf44f('0x9')]);router[_0xf44f('0xa')]('/',auth[_0xf44f('0x5')](),controller[_0xf44f('0xb')]);router[_0xf44f('0xa')](_0xf44f('0xc'),auth[_0xf44f('0x5')](),controller[_0xf44f('0xd')]);router[_0xf44f('0xa')]('/:id/sub_intervals/create_many',auth[_0xf44f('0x5')](),controller[_0xf44f('0xe')]);router[_0xf44f('0xf')](_0xf44f('0x10'),auth[_0xf44f('0x5')](),controller[_0xf44f('0x11')]);router[_0xf44f('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xf44f('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4667=['post','/:id/sub_intervals/create_many','update','delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals'];(function(_0x26f6bc,_0x540927){var _0x21e9fd=function(_0x326139){while(--_0x326139){_0x26f6bc['push'](_0x26f6bc['shift']());}};_0x21e9fd(++_0x540927);}(_0x4667,0x10f));var _0x7466=function(_0x4cc9d5,_0x4fd790){_0x4cc9d5=_0x4cc9d5-0x0;var _0x287fcf=_0x4667[_0x4cc9d5];return _0x287fcf;};'use strict';var multer=require(_0x7466('0x0'));var util=require(_0x7466('0x1'));var path=require('path');var timeout=require(_0x7466('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7466('0x3'));var auth=require(_0x7466('0x4'));var interaction=require(_0x7466('0x5'));var config=require('../../config/environment');var controller=require(_0x7466('0x6'));router[_0x7466('0x7')]('/',auth[_0x7466('0x8')](),controller[_0x7466('0x9')]);router[_0x7466('0x7')](_0x7466('0xa'),auth[_0x7466('0x8')](),controller[_0x7466('0xb')]);router[_0x7466('0x7')](_0x7466('0xc'),auth['isAuthenticated'](),controller[_0x7466('0xd')]);router[_0x7466('0xe')]('/',auth[_0x7466('0x8')](),controller['create']);router[_0x7466('0xe')](_0x7466('0xc'),auth[_0x7466('0x8')](),controller['addInterval']);router['post'](_0x7466('0xf'),auth[_0x7466('0x8')](),controller['addIntervals']);router['put'](_0x7466('0xa'),auth[_0x7466('0x8')](),controller[_0x7466('0x10')]);router[_0x7466('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7466('0x12')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index adc25bc..46fbf9b 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 _0x620e=['sequelize','exports','STRING'];(function(_0x23a2c3,_0x2f2b57){var _0x5f48b7=function(_0x4ad893){while(--_0x4ad893){_0x23a2c3['push'](_0x23a2c3['shift']());}};_0x5f48b7(++_0x2f2b57);}(_0x620e,0xf9));var _0xe620=function(_0x19267f,_0x116d2f){_0x19267f=_0x19267f-0x0;var _0xb29df4=_0x620e[_0x19267f];return _0xb29df4;};'use strict';var Sequelize=require(_0xe620('0x0'));module[_0xe620('0x1')]={'name':{'type':Sequelize[_0xe620('0x2')]},'description':{'type':Sequelize[_0xe620('0x2')]},'interval':{'type':Sequelize[_0xe620('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xe50a=['STRING','sequelize','exports'];(function(_0x5a50f6,_0x322886){var _0x32f078=function(_0xd05498){while(--_0xd05498){_0x5a50f6['push'](_0x5a50f6['shift']());}};_0x32f078(++_0x322886);}(_0xe50a,0xa6));var _0xae50=function(_0xb725be,_0x45bd01){_0xb725be=_0xb725be-0x0;var _0x2f2424=_0xe50a[_0xb725be];return _0x2f2424;};'use strict';var Sequelize=require(_0xae50('0x0'));module[_0xae50('0x1')]={'name':{'type':Sequelize[_0xae50('0x2')]},'description':{'type':Sequelize[_0xae50('0x2')]},'interval':{'type':Sequelize[_0xae50('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 7ce2d3e..ad1a541 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 _0xb2dc=['send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','Interval','includeAll','include','findAll','rows','catch','show','keys','filters','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Intervals','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','offset','undefined','count','status','set','Content-Range','json','apply','reject','save','update','then','UserProfileResource','destroy','error','stack','name'];(function(_0x430203,_0x4d5d11){var _0x1808c2=function(_0x301587){while(--_0x301587){_0x430203['push'](_0x430203['shift']());}};_0x1808c2(++_0x4d5d11);}(_0xb2dc,0x1b3));var _0xcb2d=function(_0x574082,_0x3e3329){_0x574082=_0x574082-0x0;var _0x280234=_0xb2dc[_0x574082];return _0x280234;};'use strict';var emlformat=require(_0xcb2d('0x0'));var rimraf=require(_0xcb2d('0x1'));var zipdir=require(_0xcb2d('0x2'));var jsonpatch=require(_0xcb2d('0x3'));var rp=require(_0xcb2d('0x4'));var moment=require(_0xcb2d('0x5'));var BPromise=require(_0xcb2d('0x6'));var Mustache=require(_0xcb2d('0x7'));var util=require(_0xcb2d('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xcb2d('0x9'));var ejs=require(_0xcb2d('0xa'));var fs=require('fs');var fs_extra=require(_0xcb2d('0xb'));var _=require(_0xcb2d('0xc'));var squel=require(_0xcb2d('0xd'));var crypto=require('crypto');var jsforce=require(_0xcb2d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcb2d('0x9'));var querystring=require(_0xcb2d('0xf'));var Papa=require(_0xcb2d('0x10'));var Redis=require('ioredis');var authService=require(_0xcb2d('0x11'));var qs=require(_0xcb2d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb2d('0x13'));var logger=require(_0xcb2d('0x14'))(_0xcb2d('0x15'));var utils=require(_0xcb2d('0x16'));var config=require(_0xcb2d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb2d('0x18'))['db'];var extensions=require(_0xcb2d('0x19'));function respondWithStatusCode(_0x3e5de2,_0x153f46){_0x153f46=_0x153f46||0xcc;return function(_0x1f0781){if(_0x1f0781){return _0x3e5de2[_0xcb2d('0x1a')](_0x153f46);}return _0x3e5de2['status'](_0x153f46)[_0xcb2d('0x1b')]();};}function respondWithResult(_0x86d912,_0x287167){_0x287167=_0x287167||0xc8;return function(_0x49e1e8){if(_0x49e1e8){return _0x86d912['status'](_0x287167)['json'](_0x49e1e8);}};}function respondWithFilteredResult(_0x2b2251,_0x19412b){return function(_0x17fa3f){if(_0x17fa3f){var _0x4a5229=typeof _0x19412b[_0xcb2d('0x1c')]===_0xcb2d('0x1d')&&typeof _0x19412b['limit']==='undefined';var _0x3e609d=_0x17fa3f[_0xcb2d('0x1e')];var _0x2a317d=_0x4a5229?0x0:_0x19412b['offset'];var _0x34e3d5=_0x4a5229?_0x17fa3f[_0xcb2d('0x1e')]:_0x19412b[_0xcb2d('0x1c')]+_0x19412b['limit'];var _0x3f7f66;if(_0x34e3d5>=_0x3e609d){_0x34e3d5=_0x3e609d;_0x3f7f66=0xc8;}else{_0x3f7f66=0xce;}_0x2b2251[_0xcb2d('0x1f')](_0x3f7f66);return _0x2b2251[_0xcb2d('0x20')](_0xcb2d('0x21'),_0x2a317d+'-'+_0x34e3d5+'/'+_0x3e609d)[_0xcb2d('0x22')](_0x17fa3f);}return null;};}function patchUpdates(_0x5ef25b){return function(_0x2681a3){try{jsonpatch[_0xcb2d('0x23')](_0x2681a3,_0x5ef25b,!![]);}catch(_0x46334f){return BPromise[_0xcb2d('0x24')](_0x46334f);}return _0x2681a3[_0xcb2d('0x25')]();};}function saveUpdates(_0x216c55,_0x512ce7){return function(_0x1c2c73){if(_0x1c2c73){return _0x1c2c73[_0xcb2d('0x26')](_0x216c55)['then'](function(_0x384163){return _0x384163;});}return null;};}function removeEntity(_0x2199a0,_0x58d176){return function(_0x55fb97){if(_0x55fb97){return _0x55fb97['destroy']()[_0xcb2d('0x27')](function(){var _0x141028=_0x55fb97['get']({'plain':!![]});var _0x147dbe='Intervals';return db[_0xcb2d('0x28')][_0xcb2d('0x29')]({'where':{'type':_0x147dbe,'resourceId':_0x141028['id']}})[_0xcb2d('0x27')](function(){return _0x55fb97;});})[_0xcb2d('0x27')](function(){_0x2199a0[_0xcb2d('0x1f')](0xcc)[_0xcb2d('0x1b')]();});}};}function handleEntityNotFound(_0x40b546,_0x5be64e){return function(_0x16ef30){if(!_0x16ef30){_0x40b546[_0xcb2d('0x1a')](0x194);}return _0x16ef30;};}function handleError(_0x627c52,_0x526bda){_0x526bda=_0x526bda||0x1f4;return function(_0x31c114){logger[_0xcb2d('0x2a')](_0x31c114[_0xcb2d('0x2b')]);if(_0x31c114[_0xcb2d('0x2c')]){delete _0x31c114[_0xcb2d('0x2c')];}_0x627c52[_0xcb2d('0x1f')](_0x526bda)[_0xcb2d('0x2d')](_0x31c114);};}exports[_0xcb2d('0x2e')]=function(_0x496575,_0x3f96cd){var _0x14b4f3={},_0x3b93e9={},_0xdb3393={'count':0x0,'rows':[]};var _0x47044d=_[_0xcb2d('0x2f')](db['Interval'][_0xcb2d('0x30')],function(_0x561087){return{'name':_0x561087[_0xcb2d('0x31')],'type':_0x561087[_0xcb2d('0x32')][_0xcb2d('0x33')]};});_0x3b93e9[_0xcb2d('0x34')]=_[_0xcb2d('0x2f')](_0x47044d,'name');_0x3b93e9[_0xcb2d('0x35')]=_['keys'](_0x496575['query']);_0x3b93e9['filters']=_['intersection'](_0x3b93e9[_0xcb2d('0x34')],_0x3b93e9['query']);_0x14b4f3['attributes']=_[_0xcb2d('0x36')](_0x3b93e9['model'],qs[_0xcb2d('0x37')](_0x496575['query']['fields']));_0x14b4f3[_0xcb2d('0x38')]=_0x14b4f3[_0xcb2d('0x38')][_0xcb2d('0x39')]?_0x14b4f3['attributes']:_0x3b93e9[_0xcb2d('0x34')];if(!_0x496575[_0xcb2d('0x35')][_0xcb2d('0x3a')](_0xcb2d('0x3b'))){_0x14b4f3['limit']=qs['limit'](_0x496575[_0xcb2d('0x35')][_0xcb2d('0x3c')]);_0x14b4f3[_0xcb2d('0x1c')]=qs[_0xcb2d('0x1c')](_0x496575['query'][_0xcb2d('0x1c')]);}_0x14b4f3[_0xcb2d('0x3d')]=qs[_0xcb2d('0x3e')](_0x496575['query'][_0xcb2d('0x3e')]);_0x14b4f3['where']=qs['filters'](_[_0xcb2d('0x3f')](_0x496575[_0xcb2d('0x35')],_0x3b93e9['filters']),_0x47044d);if(_0x496575[_0xcb2d('0x35')][_0xcb2d('0x40')]){_0x14b4f3['where']=_[_0xcb2d('0x41')](_0x14b4f3[_0xcb2d('0x42')],{'$or':_[_0xcb2d('0x2f')](_0x47044d,function(_0x5e07fb){if(_0x5e07fb[_0xcb2d('0x32')]!=='VIRTUAL'){var _0x59d2b0={};_0x59d2b0[_0x5e07fb[_0xcb2d('0x2c')]]={'$like':'%'+_0x496575[_0xcb2d('0x35')][_0xcb2d('0x40')]+'%'};return _0x59d2b0;}})});}_0x14b4f3=_['merge']({},_0x14b4f3,_0x496575['options']);var _0x2a27e8={'where':_0x14b4f3[_0xcb2d('0x42')]};return db[_0xcb2d('0x43')]['count'](_0x2a27e8)[_0xcb2d('0x27')](function(_0xde406c){_0xdb3393['count']=_0xde406c;if(_0x496575[_0xcb2d('0x35')][_0xcb2d('0x44')]){_0x14b4f3[_0xcb2d('0x45')]=[{'all':!![]}];}return db[_0xcb2d('0x43')][_0xcb2d('0x46')](_0x14b4f3);})[_0xcb2d('0x27')](function(_0x59f243){_0xdb3393[_0xcb2d('0x47')]=_0x59f243;return _0xdb3393;})[_0xcb2d('0x27')](respondWithFilteredResult(_0x3f96cd,_0x14b4f3))[_0xcb2d('0x48')](handleError(_0x3f96cd,null));};exports[_0xcb2d('0x49')]=function(_0x24ac02,_0xe3a807){var _0x5133bd={'raw':!![],'where':{'id':_0x24ac02['params']['id']}},_0x3ed596={};_0x3ed596[_0xcb2d('0x34')]=_[_0xcb2d('0x4a')](db[_0xcb2d('0x43')][_0xcb2d('0x30')]);_0x3ed596[_0xcb2d('0x35')]=_[_0xcb2d('0x4a')](_0x24ac02['query']);_0x3ed596[_0xcb2d('0x4b')]=_[_0xcb2d('0x36')](_0x3ed596[_0xcb2d('0x34')],_0x3ed596['query']);_0x5133bd['attributes']=_[_0xcb2d('0x36')](_0x3ed596['model'],qs[_0xcb2d('0x37')](_0x24ac02[_0xcb2d('0x35')][_0xcb2d('0x37')]));_0x5133bd['attributes']=_0x5133bd[_0xcb2d('0x38')][_0xcb2d('0x39')]?_0x5133bd[_0xcb2d('0x38')]:_0x3ed596[_0xcb2d('0x34')];if(_0x24ac02['query'][_0xcb2d('0x44')]){_0x5133bd['include']=[{'all':!![]}];}_0x5133bd=_['merge']({},_0x5133bd,_0x24ac02[_0xcb2d('0x4c')]);return db[_0xcb2d('0x43')][_0xcb2d('0x4d')](_0x5133bd)[_0xcb2d('0x27')](handleEntityNotFound(_0xe3a807,null))[_0xcb2d('0x27')](respondWithResult(_0xe3a807,null))[_0xcb2d('0x48')](handleError(_0xe3a807,null));};exports[_0xcb2d('0x4e')]=function(_0x51bb78,_0x16ad3f){return db['Interval']['create'](_0x51bb78[_0xcb2d('0x4f')],{})[_0xcb2d('0x27')](function(_0x466527){var _0x4fb4fb=_0x51bb78['user'][_0xcb2d('0x50')]({'plain':!![]});if(!_0x4fb4fb)throw new Error(_0xcb2d('0x51'));if(_0x4fb4fb[_0xcb2d('0x52')]===_0xcb2d('0x53')){var _0x277be1=_0x466527[_0xcb2d('0x50')]({'plain':!![]});var _0x3e15d7=_0xcb2d('0x54');return db[_0xcb2d('0x55')][_0xcb2d('0x4d')]({'where':{'name':_0x3e15d7,'userProfileId':_0x4fb4fb['userProfileId']},'raw':!![]})[_0xcb2d('0x27')](function(_0x238431){if(_0x238431&&_0x238431[_0xcb2d('0x56')]===0x0){return db[_0xcb2d('0x28')][_0xcb2d('0x4e')]({'name':_0x277be1[_0xcb2d('0x2c')],'resourceId':_0x277be1['id'],'type':_0x238431[_0xcb2d('0x2c')],'sectionId':_0x238431['id']},{})[_0xcb2d('0x27')](function(){return _0x466527;});}else{return _0x466527;}})[_0xcb2d('0x48')](function(_0x2af284){logger[_0xcb2d('0x2a')](_0xcb2d('0x57'),_0x2af284);throw _0x2af284;});}return _0x466527;})[_0xcb2d('0x27')](respondWithResult(_0x16ad3f,0xc9))['catch'](handleError(_0x16ad3f,null));};exports[_0xcb2d('0x26')]=function(_0x267f26,_0x44fafd){if(_0x267f26[_0xcb2d('0x4f')]['id']){delete _0x267f26[_0xcb2d('0x4f')]['id'];}return db[_0xcb2d('0x43')][_0xcb2d('0x4d')]({'where':{'id':_0x267f26[_0xcb2d('0x58')]['id']}})[_0xcb2d('0x27')](handleEntityNotFound(_0x44fafd,null))[_0xcb2d('0x27')](saveUpdates(_0x267f26[_0xcb2d('0x4f')],null))[_0xcb2d('0x27')](respondWithResult(_0x44fafd,null))['catch'](handleError(_0x44fafd,null));};exports[_0xcb2d('0x29')]=function(_0x3bddf4,_0x279e19){return db[_0xcb2d('0x43')]['find']({'where':{'id':_0x3bddf4[_0xcb2d('0x58')]['id']}})[_0xcb2d('0x27')](handleEntityNotFound(_0x279e19,null))[_0xcb2d('0x27')](removeEntity(_0x279e19,null))[_0xcb2d('0x48')](handleError(_0x279e19,null));};exports[_0xcb2d('0x59')]=function(_0x4c393c,_0x1b18af,_0x35c1fa){if(_0x4c393c[_0xcb2d('0x4f')]['id']){delete _0x4c393c[_0xcb2d('0x4f')]['id'];}return db['Interval']['find']({'where':{'id':_0x4c393c[_0xcb2d('0x58')]['id']}})['then'](handleEntityNotFound(_0x1b18af,null))[_0xcb2d('0x27')](function(_0x48b69f){if(_0x48b69f){_0x4c393c[_0xcb2d('0x4f')][_0xcb2d('0x5a')]=_0x48b69f['id'];return db[_0xcb2d('0x43')][_0xcb2d('0x4e')](_0x4c393c[_0xcb2d('0x4f')]);}})[_0xcb2d('0x27')](respondWithResult(_0x1b18af,null))['catch'](handleError(_0x1b18af,null));};exports[_0xcb2d('0x5b')]=function(_0x3baeaf,_0x209524,_0x49878f){var _0x48160a={};var _0x1f908e={};var _0x3400fc;var _0x119710;return db[_0xcb2d('0x43')][_0xcb2d('0x5c')]({'where':{'id':_0x3baeaf[_0xcb2d('0x58')]['id']}})['then'](handleEntityNotFound(_0x209524,null))[_0xcb2d('0x27')](function(_0x47169f){if(_0x47169f){_0x3400fc=_0x47169f;_0x1f908e[_0xcb2d('0x34')]=_[_0xcb2d('0x4a')](db[_0xcb2d('0x43')][_0xcb2d('0x30')]);_0x1f908e[_0xcb2d('0x35')]=_[_0xcb2d('0x4a')](_0x3baeaf['query']);_0x1f908e[_0xcb2d('0x4b')]=_[_0xcb2d('0x36')](_0x1f908e['model'],_0x1f908e[_0xcb2d('0x35')]);_0x48160a[_0xcb2d('0x38')]=_[_0xcb2d('0x36')](_0x1f908e[_0xcb2d('0x34')],qs[_0xcb2d('0x37')](_0x3baeaf['query'][_0xcb2d('0x37')]));_0x48160a[_0xcb2d('0x38')]=_0x48160a['attributes'][_0xcb2d('0x39')]?_0x48160a['attributes']:_0x1f908e['model'];_0x48160a[_0xcb2d('0x3d')]=qs['sort'](_0x3baeaf[_0xcb2d('0x35')][_0xcb2d('0x3e')]);_0x48160a[_0xcb2d('0x42')]=qs['filters'](_[_0xcb2d('0x3f')](_0x3baeaf['query'],_0x1f908e[_0xcb2d('0x4b')]));if(_0x3baeaf['query'][_0xcb2d('0x40')]){_0x48160a[_0xcb2d('0x42')]=_[_0xcb2d('0x41')](_0x48160a[_0xcb2d('0x42')],{'$or':_['map'](_0x48160a[_0xcb2d('0x38')],function(_0x4f4d8c){var _0x1dbb34={};_0x1dbb34[_0x4f4d8c]={'$like':'%'+_0x3baeaf[_0xcb2d('0x35')]['filter']+'%'};return _0x1dbb34;})});}_0x48160a=_[_0xcb2d('0x41')]({},_0x48160a,_0x3baeaf[_0xcb2d('0x4c')]);return _0x3400fc[_0xcb2d('0x5b')](_0x48160a);}})[_0xcb2d('0x27')](function(_0x52d5d8){if(_0x52d5d8){_0x119710=_0x52d5d8[_0xcb2d('0x39')];if(!_0x3baeaf[_0xcb2d('0x35')]['hasOwnProperty'](_0xcb2d('0x3b'))){_0x48160a[_0xcb2d('0x3c')]=qs[_0xcb2d('0x3c')](_0x3baeaf['query'][_0xcb2d('0x3c')]);_0x48160a['offset']=qs[_0xcb2d('0x1c')](_0x3baeaf[_0xcb2d('0x35')][_0xcb2d('0x1c')]);}return _0x3400fc[_0xcb2d('0x5b')](_0x48160a);}})[_0xcb2d('0x27')](function(_0x310465){if(_0x310465){return _0x310465?{'count':_0x119710,'rows':_0x310465}:null;}})[_0xcb2d('0x27')](respondWithResult(_0x209524,null))[_0xcb2d('0x48')](handleError(_0x209524,null));};exports[_0xcb2d('0x5d')]=function(_0x1745b2,_0x513451,_0x207844){return db[_0xcb2d('0x43')][_0xcb2d('0x5c')]({'where':{'id':_0x1745b2['params']['id']}})[_0xcb2d('0x27')](handleEntityNotFound(_0x513451,null))[_0xcb2d('0x27')](function(_0x2e5e63){if(_0x2e5e63){return db[_0xcb2d('0x5e')][_0xcb2d('0x5f')](function(_0x251904){return db[_0xcb2d('0x43')]['destroy']({'where':{'IntervalId':_0x1745b2[_0xcb2d('0x58')]['id']},'transaction':_0x251904})[_0xcb2d('0x27')](function(_0x1a404f){var _0x3b48b2=_[_0xcb2d('0x2f')](_0x1745b2[_0xcb2d('0x4f')],function(_0x2c29f0){delete _0x2c29f0['id'];_0x2c29f0['IntervalId']=_0x1745b2[_0xcb2d('0x58')]['id'];return _0x2c29f0;});return db[_0xcb2d('0x43')]['bulkCreate'](_0x3b48b2,{'transaction':_0x251904});});})['then'](function(){return db[_0xcb2d('0x43')][_0xcb2d('0x46')]({'where':{'IntervalId':_0x1745b2['params']['id']}});});}})[_0xcb2d('0x27')](respondWithResult(_0x513451,null))[_0xcb2d('0x48')](handleError(_0x513451,null));}; \ No newline at end of file +var _0xbf79=['show','params','keys','rawAttributes','create','body','user','role','UserProfileSection','find','addInterval','IntervalId','getIntervals','findOne','order','addIntervals','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','index','map','Interval','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x1a73aa,_0x14decd){var _0x14b82b=function(_0x47c1d7){while(--_0x47c1d7){_0x1a73aa['push'](_0x1a73aa['shift']());}};_0x14b82b(++_0x14decd);}(_0xbf79,0xc2));var _0x9bf7=function(_0x37e77a,_0x439b8b){_0x37e77a=_0x37e77a-0x0;var _0x42d6cc=_0xbf79[_0x37e77a];return _0x42d6cc;};'use strict';var emlformat=require(_0x9bf7('0x0'));var rimraf=require(_0x9bf7('0x1'));var zipdir=require(_0x9bf7('0x2'));var jsonpatch=require(_0x9bf7('0x3'));var rp=require('request-promise');var moment=require(_0x9bf7('0x4'));var BPromise=require(_0x9bf7('0x5'));var Mustache=require(_0x9bf7('0x6'));var util=require('util');var path=require(_0x9bf7('0x7'));var sox=require('sox');var csv=require(_0x9bf7('0x8'));var ejs=require(_0x9bf7('0x9'));var fs=require('fs');var fs_extra=require(_0x9bf7('0xa'));var _=require(_0x9bf7('0xb'));var squel=require(_0x9bf7('0xc'));var crypto=require(_0x9bf7('0xd'));var jsforce=require(_0x9bf7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9bf7('0xf'));var Redis=require(_0x9bf7('0x10'));var authService=require(_0x9bf7('0x11'));var qs=require(_0x9bf7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9bf7('0x13'));var logger=require(_0x9bf7('0x14'))(_0x9bf7('0x15'));var utils=require('../../config/utils');var config=require(_0x9bf7('0x16'));var licenseUtil=require(_0x9bf7('0x17'));var db=require(_0x9bf7('0x18'))['db'];var extensions=require(_0x9bf7('0x19'));function respondWithStatusCode(_0x20dadb,_0x296eaf){_0x296eaf=_0x296eaf||0xcc;return function(_0x3e57d1){if(_0x3e57d1){return _0x20dadb[_0x9bf7('0x1a')](_0x296eaf);}return _0x20dadb[_0x9bf7('0x1b')](_0x296eaf)[_0x9bf7('0x1c')]();};}function respondWithResult(_0x593c5e,_0x51c3a1){_0x51c3a1=_0x51c3a1||0xc8;return function(_0x29534b){if(_0x29534b){return _0x593c5e[_0x9bf7('0x1b')](_0x51c3a1)['json'](_0x29534b);}};}function respondWithFilteredResult(_0x405d1c,_0x1d59fe){return function(_0x7fb78d){if(_0x7fb78d){var _0x476c97=typeof _0x1d59fe[_0x9bf7('0x1d')]===_0x9bf7('0x1e')&&typeof _0x1d59fe[_0x9bf7('0x1f')]===_0x9bf7('0x1e');var _0x3d5499=_0x7fb78d['count'];var _0x10d992=_0x476c97?0x0:_0x1d59fe['offset'];var _0x128c97=_0x476c97?_0x7fb78d[_0x9bf7('0x20')]:_0x1d59fe[_0x9bf7('0x1d')]+_0x1d59fe[_0x9bf7('0x1f')];var _0x21acc3;if(_0x128c97>=_0x3d5499){_0x128c97=_0x3d5499;_0x21acc3=0xc8;}else{_0x21acc3=0xce;}_0x405d1c[_0x9bf7('0x1b')](_0x21acc3);return _0x405d1c[_0x9bf7('0x21')](_0x9bf7('0x22'),_0x10d992+'-'+_0x128c97+'/'+_0x3d5499)[_0x9bf7('0x23')](_0x7fb78d);}return null;};}function patchUpdates(_0x5dfe56){return function(_0x4db043){try{jsonpatch[_0x9bf7('0x24')](_0x4db043,_0x5dfe56,!![]);}catch(_0x9e711b){return BPromise[_0x9bf7('0x25')](_0x9e711b);}return _0x4db043[_0x9bf7('0x26')]();};}function saveUpdates(_0x188f4f,_0xd0fbe0){return function(_0x186042){if(_0x186042){return _0x186042[_0x9bf7('0x27')](_0x188f4f)[_0x9bf7('0x28')](function(_0x14ad4a){return _0x14ad4a;});}return null;};}function removeEntity(_0x42edf4,_0x574d81){return function(_0x6dd66d){if(_0x6dd66d){return _0x6dd66d[_0x9bf7('0x29')]()['then'](function(){var _0x436aa2=_0x6dd66d[_0x9bf7('0x2a')]({'plain':!![]});var _0x27a9c7='Intervals';return db[_0x9bf7('0x2b')][_0x9bf7('0x29')]({'where':{'type':_0x27a9c7,'resourceId':_0x436aa2['id']}})[_0x9bf7('0x28')](function(){return _0x6dd66d;});})[_0x9bf7('0x28')](function(){_0x42edf4[_0x9bf7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a1c1a,_0x1bd356){return function(_0x4c0c27){if(!_0x4c0c27){_0x3a1c1a['sendStatus'](0x194);}return _0x4c0c27;};}function handleError(_0x30f753,_0x107c8f){_0x107c8f=_0x107c8f||0x1f4;return function(_0x509ecb){logger[_0x9bf7('0x2c')](_0x509ecb['stack']);if(_0x509ecb['name']){delete _0x509ecb[_0x9bf7('0x2d')];}_0x30f753['status'](_0x107c8f)[_0x9bf7('0x2e')](_0x509ecb);};}exports[_0x9bf7('0x2f')]=function(_0x399a32,_0x22e53d){var _0x4ed9ee={},_0x28e702={},_0xb2117b={'count':0x0,'rows':[]};var _0x25c5fd=_[_0x9bf7('0x30')](db[_0x9bf7('0x31')]['rawAttributes'],function(_0xa79d79){return{'name':_0xa79d79[_0x9bf7('0x32')],'type':_0xa79d79['type']['key']};});_0x28e702[_0x9bf7('0x33')]=_[_0x9bf7('0x30')](_0x25c5fd,'name');_0x28e702[_0x9bf7('0x34')]=_['keys'](_0x399a32[_0x9bf7('0x34')]);_0x28e702[_0x9bf7('0x35')]=_[_0x9bf7('0x36')](_0x28e702[_0x9bf7('0x33')],_0x28e702[_0x9bf7('0x34')]);_0x4ed9ee['attributes']=_[_0x9bf7('0x36')](_0x28e702[_0x9bf7('0x33')],qs[_0x9bf7('0x37')](_0x399a32[_0x9bf7('0x34')][_0x9bf7('0x37')]));_0x4ed9ee[_0x9bf7('0x38')]=_0x4ed9ee[_0x9bf7('0x38')][_0x9bf7('0x39')]?_0x4ed9ee['attributes']:_0x28e702[_0x9bf7('0x33')];if(!_0x399a32[_0x9bf7('0x34')][_0x9bf7('0x3a')](_0x9bf7('0x3b'))){_0x4ed9ee[_0x9bf7('0x1f')]=qs[_0x9bf7('0x1f')](_0x399a32[_0x9bf7('0x34')][_0x9bf7('0x1f')]);_0x4ed9ee[_0x9bf7('0x1d')]=qs[_0x9bf7('0x1d')](_0x399a32[_0x9bf7('0x34')][_0x9bf7('0x1d')]);}_0x4ed9ee['order']=qs[_0x9bf7('0x3c')](_0x399a32['query'][_0x9bf7('0x3c')]);_0x4ed9ee[_0x9bf7('0x3d')]=qs[_0x9bf7('0x35')](_[_0x9bf7('0x3e')](_0x399a32['query'],_0x28e702[_0x9bf7('0x35')]),_0x25c5fd);if(_0x399a32[_0x9bf7('0x34')][_0x9bf7('0x3f')]){_0x4ed9ee[_0x9bf7('0x3d')]=_[_0x9bf7('0x40')](_0x4ed9ee[_0x9bf7('0x3d')],{'$or':_[_0x9bf7('0x30')](_0x25c5fd,function(_0x743761){if(_0x743761[_0x9bf7('0x41')]!==_0x9bf7('0x42')){var _0x4b7cfc={};_0x4b7cfc[_0x743761[_0x9bf7('0x2d')]]={'$like':'%'+_0x399a32[_0x9bf7('0x34')][_0x9bf7('0x3f')]+'%'};return _0x4b7cfc;}})});}_0x4ed9ee=_[_0x9bf7('0x40')]({},_0x4ed9ee,_0x399a32[_0x9bf7('0x43')]);var _0x1bc9f1={'where':_0x4ed9ee[_0x9bf7('0x3d')]};return db[_0x9bf7('0x31')][_0x9bf7('0x20')](_0x1bc9f1)['then'](function(_0x133013){_0xb2117b[_0x9bf7('0x20')]=_0x133013;if(_0x399a32[_0x9bf7('0x34')][_0x9bf7('0x44')]){_0x4ed9ee[_0x9bf7('0x45')]=[{'all':!![]}];}return db[_0x9bf7('0x31')][_0x9bf7('0x46')](_0x4ed9ee);})[_0x9bf7('0x28')](function(_0x4b06ce){_0xb2117b[_0x9bf7('0x47')]=_0x4b06ce;return _0xb2117b;})[_0x9bf7('0x28')](respondWithFilteredResult(_0x22e53d,_0x4ed9ee))[_0x9bf7('0x48')](handleError(_0x22e53d,null));};exports[_0x9bf7('0x49')]=function(_0x220e58,_0xb22055){var _0x55ddaa={'raw':!![],'where':{'id':_0x220e58[_0x9bf7('0x4a')]['id']}},_0x525e7e={};_0x525e7e[_0x9bf7('0x33')]=_[_0x9bf7('0x4b')](db['Interval'][_0x9bf7('0x4c')]);_0x525e7e[_0x9bf7('0x34')]=_['keys'](_0x220e58['query']);_0x525e7e[_0x9bf7('0x35')]=_[_0x9bf7('0x36')](_0x525e7e[_0x9bf7('0x33')],_0x525e7e['query']);_0x55ddaa[_0x9bf7('0x38')]=_[_0x9bf7('0x36')](_0x525e7e[_0x9bf7('0x33')],qs['fields'](_0x220e58['query'][_0x9bf7('0x37')]));_0x55ddaa[_0x9bf7('0x38')]=_0x55ddaa[_0x9bf7('0x38')][_0x9bf7('0x39')]?_0x55ddaa[_0x9bf7('0x38')]:_0x525e7e['model'];if(_0x220e58['query']['includeAll']){_0x55ddaa[_0x9bf7('0x45')]=[{'all':!![]}];}_0x55ddaa=_[_0x9bf7('0x40')]({},_0x55ddaa,_0x220e58[_0x9bf7('0x43')]);return db[_0x9bf7('0x31')]['find'](_0x55ddaa)['then'](handleEntityNotFound(_0xb22055,null))['then'](respondWithResult(_0xb22055,null))[_0x9bf7('0x48')](handleError(_0xb22055,null));};exports[_0x9bf7('0x4d')]=function(_0x18a6c8,_0x4135d6){return db['Interval'][_0x9bf7('0x4d')](_0x18a6c8[_0x9bf7('0x4e')],{})[_0x9bf7('0x28')](function(_0x153fa8){var _0x22e468=_0x18a6c8[_0x9bf7('0x4f')][_0x9bf7('0x2a')]({'plain':!![]});if(!_0x22e468)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22e468[_0x9bf7('0x50')]===_0x9bf7('0x4f')){var _0x1486da=_0x153fa8['get']({'plain':!![]});var _0x2b5acf='Intervals';return db[_0x9bf7('0x51')][_0x9bf7('0x52')]({'where':{'name':_0x2b5acf,'userProfileId':_0x22e468['userProfileId']},'raw':!![]})['then'](function(_0x7fedf7){if(_0x7fedf7&&_0x7fedf7['autoAssociation']===0x0){return db[_0x9bf7('0x2b')][_0x9bf7('0x4d')]({'name':_0x1486da[_0x9bf7('0x2d')],'resourceId':_0x1486da['id'],'type':_0x7fedf7[_0x9bf7('0x2d')],'sectionId':_0x7fedf7['id']},{})[_0x9bf7('0x28')](function(){return _0x153fa8;});}else{return _0x153fa8;}})[_0x9bf7('0x48')](function(_0x123d8a){logger[_0x9bf7('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x123d8a);throw _0x123d8a;});}return _0x153fa8;})['then'](respondWithResult(_0x4135d6,0xc9))[_0x9bf7('0x48')](handleError(_0x4135d6,null));};exports[_0x9bf7('0x27')]=function(_0x52961e,_0x4115ae){if(_0x52961e[_0x9bf7('0x4e')]['id']){delete _0x52961e[_0x9bf7('0x4e')]['id'];}return db['Interval']['find']({'where':{'id':_0x52961e[_0x9bf7('0x4a')]['id']}})[_0x9bf7('0x28')](handleEntityNotFound(_0x4115ae,null))[_0x9bf7('0x28')](saveUpdates(_0x52961e[_0x9bf7('0x4e')],null))[_0x9bf7('0x28')](respondWithResult(_0x4115ae,null))['catch'](handleError(_0x4115ae,null));};exports[_0x9bf7('0x29')]=function(_0x543889,_0x20ce13){return db[_0x9bf7('0x31')][_0x9bf7('0x52')]({'where':{'id':_0x543889[_0x9bf7('0x4a')]['id']}})[_0x9bf7('0x28')](handleEntityNotFound(_0x20ce13,null))['then'](removeEntity(_0x20ce13,null))['catch'](handleError(_0x20ce13,null));};exports[_0x9bf7('0x53')]=function(_0x13c601,_0x48959a,_0x2cfb31){if(_0x13c601[_0x9bf7('0x4e')]['id']){delete _0x13c601[_0x9bf7('0x4e')]['id'];}return db[_0x9bf7('0x31')][_0x9bf7('0x52')]({'where':{'id':_0x13c601[_0x9bf7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x48959a,null))[_0x9bf7('0x28')](function(_0x4b2200){if(_0x4b2200){_0x13c601[_0x9bf7('0x4e')][_0x9bf7('0x54')]=_0x4b2200['id'];return db[_0x9bf7('0x31')][_0x9bf7('0x4d')](_0x13c601[_0x9bf7('0x4e')]);}})[_0x9bf7('0x28')](respondWithResult(_0x48959a,null))[_0x9bf7('0x48')](handleError(_0x48959a,null));};exports[_0x9bf7('0x55')]=function(_0x2435d3,_0x14e1c9,_0x22d5de){var _0x47245b={};var _0x481a50={};var _0x7df86f;var _0x30ad0f;return db['Interval'][_0x9bf7('0x56')]({'where':{'id':_0x2435d3[_0x9bf7('0x4a')]['id']}})[_0x9bf7('0x28')](handleEntityNotFound(_0x14e1c9,null))['then'](function(_0xde1451){if(_0xde1451){_0x7df86f=_0xde1451;_0x481a50[_0x9bf7('0x33')]=_[_0x9bf7('0x4b')](db['Interval'][_0x9bf7('0x4c')]);_0x481a50['query']=_[_0x9bf7('0x4b')](_0x2435d3['query']);_0x481a50[_0x9bf7('0x35')]=_['intersection'](_0x481a50[_0x9bf7('0x33')],_0x481a50[_0x9bf7('0x34')]);_0x47245b[_0x9bf7('0x38')]=_[_0x9bf7('0x36')](_0x481a50[_0x9bf7('0x33')],qs['fields'](_0x2435d3[_0x9bf7('0x34')]['fields']));_0x47245b['attributes']=_0x47245b[_0x9bf7('0x38')][_0x9bf7('0x39')]?_0x47245b[_0x9bf7('0x38')]:_0x481a50[_0x9bf7('0x33')];_0x47245b[_0x9bf7('0x57')]=qs[_0x9bf7('0x3c')](_0x2435d3[_0x9bf7('0x34')][_0x9bf7('0x3c')]);_0x47245b[_0x9bf7('0x3d')]=qs[_0x9bf7('0x35')](_[_0x9bf7('0x3e')](_0x2435d3['query'],_0x481a50[_0x9bf7('0x35')]));if(_0x2435d3[_0x9bf7('0x34')]['filter']){_0x47245b[_0x9bf7('0x3d')]=_[_0x9bf7('0x40')](_0x47245b['where'],{'$or':_[_0x9bf7('0x30')](_0x47245b[_0x9bf7('0x38')],function(_0x36fc17){var _0x356aa1={};_0x356aa1[_0x36fc17]={'$like':'%'+_0x2435d3[_0x9bf7('0x34')][_0x9bf7('0x3f')]+'%'};return _0x356aa1;})});}_0x47245b=_[_0x9bf7('0x40')]({},_0x47245b,_0x2435d3['options']);return _0x7df86f[_0x9bf7('0x55')](_0x47245b);}})[_0x9bf7('0x28')](function(_0x16dc9a){if(_0x16dc9a){_0x30ad0f=_0x16dc9a[_0x9bf7('0x39')];if(!_0x2435d3[_0x9bf7('0x34')]['hasOwnProperty'](_0x9bf7('0x3b'))){_0x47245b[_0x9bf7('0x1f')]=qs['limit'](_0x2435d3[_0x9bf7('0x34')][_0x9bf7('0x1f')]);_0x47245b['offset']=qs['offset'](_0x2435d3[_0x9bf7('0x34')][_0x9bf7('0x1d')]);}return _0x7df86f[_0x9bf7('0x55')](_0x47245b);}})[_0x9bf7('0x28')](function(_0x38a972){if(_0x38a972){return _0x38a972?{'count':_0x30ad0f,'rows':_0x38a972}:null;}})[_0x9bf7('0x28')](respondWithResult(_0x14e1c9,null))[_0x9bf7('0x48')](handleError(_0x14e1c9,null));};exports[_0x9bf7('0x58')]=function(_0x3ce429,_0x34d393,_0x159359){return db[_0x9bf7('0x31')]['findOne']({'where':{'id':_0x3ce429['params']['id']}})[_0x9bf7('0x28')](handleEntityNotFound(_0x34d393,null))[_0x9bf7('0x28')](function(_0x532df2){if(_0x532df2){return db['sequelize']['transaction'](function(_0x2901bc){return db[_0x9bf7('0x31')][_0x9bf7('0x29')]({'where':{'IntervalId':_0x3ce429['params']['id']},'transaction':_0x2901bc})[_0x9bf7('0x28')](function(_0x477e86){var _0x1cc311=_[_0x9bf7('0x30')](_0x3ce429[_0x9bf7('0x4e')],function(_0x1a9ded){delete _0x1a9ded['id'];_0x1a9ded[_0x9bf7('0x54')]=_0x3ce429[_0x9bf7('0x4a')]['id'];return _0x1a9ded;});return db[_0x9bf7('0x31')]['bulkCreate'](_0x1cc311,{'transaction':_0x2901bc});});})[_0x9bf7('0x28')](function(){return db['Interval'][_0x9bf7('0x46')]({'where':{'IntervalId':_0x3ce429[_0x9bf7('0x4a')]['id']}});});}})[_0x9bf7('0x28')](respondWithResult(_0x34d393,null))[_0x9bf7('0x48')](handleError(_0x34d393,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index cf82876..826b10c 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 _0x40a0=['request-promise','path','rimraf','./interval.attributes','../../components/extensions/rewrite','define','Interval','rewrite','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xc28fb5,_0x5d30f2){var _0x2fb026=function(_0x3f0118){while(--_0x3f0118){_0xc28fb5['push'](_0xc28fb5['shift']());}};_0x2fb026(++_0x5d30f2);}(_0x40a0,0x1ba));var _0x040a=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x40a0[_0x456fb1];return _0x4083d6;};'use strict';var _=require(_0x040a('0x0'));var util=require(_0x040a('0x1'));var logger=require(_0x040a('0x2'))(_0x040a('0x3'));var moment=require(_0x040a('0x4'));var BPromise=require(_0x040a('0x5'));var rp=require(_0x040a('0x6'));var fs=require('fs');var path=require(_0x040a('0x7'));var rimraf=require(_0x040a('0x8'));var config=require('../../config/environment');var attributes=require(_0x040a('0x9'));var extensions=require(_0x040a('0xa'));module['exports']=function(_0x31c66e,_0x23a682){return _0x31c66e[_0x040a('0xb')](_0x040a('0xc'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x48d659,_0x38ae86){extensions[_0x040a('0xd')](_0x31c66e,_0x48d659);},'afterBulkCreate':function(_0x147161,_0x4ce53a,_0x467ca7){_0x467ca7();extensions['rewrite'](_0x31c66e,_0x147161[0x0]);},'afterUpdate':function(_0x582d72,_0x3d596c){extensions['rewrite'](_0x31c66e,_0x582d72);},'afterDestroy':function(_0x2a6aa6,_0x1246f2){extensions[_0x040a('0xd')](_0x31c66e,_0x2a6aa6);}}});}; \ No newline at end of file +var _0xacfb=['path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','util','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xacfb,0x95));var _0xbacf=function(_0x1de2de,_0x2c06b5){_0x1de2de=_0x1de2de-0x0;var _0x53edf4=_0xacfb[_0x1de2de];return _0x53edf4;};'use strict';var _=require('lodash');var util=require(_0xbacf('0x0'));var logger=require('../../config/logger')(_0xbacf('0x1'));var moment=require(_0xbacf('0x2'));var BPromise=require(_0xbacf('0x3'));var rp=require(_0xbacf('0x4'));var fs=require('fs');var path=require(_0xbacf('0x5'));var rimraf=require(_0xbacf('0x6'));var config=require(_0xbacf('0x7'));var attributes=require(_0xbacf('0x8'));var extensions=require(_0xbacf('0x9'));module[_0xbacf('0xa')]=function(_0x49e45b,_0x1a2535){return _0x49e45b[_0xbacf('0xb')]('Interval',attributes,{'tableName':_0xbacf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f4cc2,_0x564428){extensions['rewrite'](_0x49e45b,_0x3f4cc2);},'afterBulkCreate':function(_0x1c2478,_0x5e7b14,_0x517b97){_0x517b97();extensions[_0xbacf('0xd')](_0x49e45b,_0x1c2478[0x0]);},'afterUpdate':function(_0x468526,_0x44159f){extensions[_0xbacf('0xd')](_0x49e45b,_0x468526);},'afterDestroy':function(_0x103e75,_0x54c49b){extensions[_0xbacf('0xd')](_0x49e45b,_0x103e75);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index fa267fa..cf95e67 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x47df54,_0x1aeb61){var _0x261b87=function(_0x54bc77){while(--_0x54bc77){_0x47df54['push'](_0x47df54['shift']());}};_0x261b87(++_0x1aeb61);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x8afdd0,_0x548ad1){var _0x3de7ac=function(_0x2dc2c4){while(--_0x2dc2c4){_0x8afdd0['push'](_0x8afdd0['shift']());}};_0x3de7ac(++_0x548ad1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index aa2e039..7771d96 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 _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a397d,_0x5bab1f){_0x4a397d=_0x4a397d-0x0;var _0x316571=_0xb10b[_0x4a397d];return _0x316571;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file +var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x5a50d8,_0x313b1c){var _0x1b5263=function(_0x30d00d){while(--_0x30d00d){_0x5a50d8['push'](_0x5a50d8['shift']());}};_0x1b5263(++_0x313b1c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x58b6f8,_0xa174cd){_0x58b6f8=_0x58b6f8-0x0;var _0xc1d891=_0x5f2f[_0x58b6f8];return _0xc1d891;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 1d50e3b..de514a1 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 _0x5eee=['summary','Report','\x20from\x20','description','stringify','Bug','customfield_11500','customfield_11501','oldToken','fields','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64','request','setEncoding','end','status','statusCode','json','parse','error','api.jira','openIssue','send','body','x-forwarded-for','remoteAddress','socket','bluebird','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI'];(function(_0x13dcf8,_0x162ca6){var _0x445a14=function(_0x3fffe6){while(--_0x3fffe6){_0x13dcf8['push'](_0x13dcf8['shift']());}};_0x445a14(++_0x162ca6);}(_0x5eee,0x159));var _0xe5ee=function(_0x152be3,_0x4ed893){_0x152be3=_0x152be3-0x0;var _0x508133=_0x5eee[_0x152be3];return _0x508133;};'use strict';var BPromise=require(_0xe5ee('0x0'));var https=require('https');var logger=require(_0xe5ee('0x1'))(_0xe5ee('0x2'));var USERNAME=_0xe5ee('0x3');var PASSWORD=_0xe5ee('0x4');function openIssue(_0x3a7470,_0x1b8cae){var _0x1cb0b3={'fields':{'project':{'key':_0x3a7470[_0xe5ee('0x5')]||_0xe5ee('0x6')},'summary':(_0x3a7470[_0xe5ee('0x7')]||_0xe5ee('0x8'))+_0xe5ee('0x9')+_0x3a7470['ip'],'description':_0x3a7470[_0xe5ee('0xa')]||JSON[_0xe5ee('0xb')](_0x3a7470),'issuetype':{'name':_0x3a7470['issuetype']||_0xe5ee('0xc')}}};_0x1cb0b3['fields'][_0xe5ee('0xd')]=_0x3a7470['email'];_0x1cb0b3['fields'][_0xe5ee('0xe')]=_0x3a7470[_0xe5ee('0xf')];_0x1cb0b3[_0xe5ee('0x10')][_0xe5ee('0x11')]=_0x3a7470[_0xe5ee('0x12')];_0x1cb0b3[_0xe5ee('0x10')][_0xe5ee('0x13')]=_0x3a7470[_0xe5ee('0x14')];_0x1cb0b3[_0xe5ee('0x10')]['customfield_11504']=_0x3a7470[_0xe5ee('0x15')];_0x1cb0b3['fields'][_0xe5ee('0x16')]=_0x3a7470['ip'];var _0x6b9b3={'host':_0xe5ee('0x17'),'port':0x1bb,'path':_0xe5ee('0x18'),'method':_0xe5ee('0x19'),'timeout':0x4e20,'headers':{'Content-Type':_0xe5ee('0x1a'),'Authorization':_0xe5ee('0x1b')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xe5ee('0x1c'))}};var _0x56699c=JSON['stringify'](_0x1cb0b3);var _0x4718a6=https[_0xe5ee('0x1d')](_0x6b9b3,function(_0x30965b){_0x30965b[_0xe5ee('0x1e')]('utf8');var _0x44fcf8='';_0x30965b['on']('data',function(_0x487c61){_0x44fcf8+=_0x487c61;});_0x30965b['on'](_0xe5ee('0x1f'),function(){if(_0x1b8cae){return _0x1b8cae[_0xe5ee('0x20')](_0x30965b[_0xe5ee('0x21')])[_0xe5ee('0x22')](JSON[_0xe5ee('0x23')](_0x44fcf8));}});});_0x4718a6['on'](_0xe5ee('0x24'),function(_0x7f781d){if(_0x1b8cae){return _0x1b8cae[_0xe5ee('0x20')](0x1f4)[_0xe5ee('0x22')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xe5ee('0x25')}]});}});_0x4718a6['write'](_0x56699c);_0x4718a6['end']();}exports[_0xe5ee('0x26')]=openIssue;exports[_0xe5ee('0x27')]=function(_0x4b5d8b,_0x53295a){_0x4b5d8b[_0xe5ee('0x28')]['ip']=_0x4b5d8b['headers'][_0xe5ee('0x29')]||_0x4b5d8b['connection'][_0xe5ee('0x2a')]||_0x4b5d8b[_0xe5ee('0x2b')][_0xe5ee('0x2a')]||_0x4b5d8b['connection'][_0xe5ee('0x2b')][_0xe5ee('0x2a')];return openIssue(_0x4b5d8b['body'],_0x53295a);}; \ No newline at end of file +var _0xecee=['status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','api','support','3eAmWpBVP0','key','summary','\x20from\x20','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','reason','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','request','utf8','data','end'];(function(_0x465db2,_0x1778ec){var _0x3d9a00=function(_0x2482bd){while(--_0x2482bd){_0x465db2['push'](_0x465db2['shift']());}};_0x3d9a00(++_0x1778ec);}(_0xecee,0xf0));var _0xeece=function(_0x21562d,_0x269e9b){_0x21562d=_0x21562d-0x0;var _0x5c9084=_0xecee[_0x21562d];return _0x5c9084;};'use strict';var BPromise=require('bluebird');var https=require(_0xeece('0x0'));var logger=require(_0xeece('0x1'))(_0xeece('0x2'));var USERNAME=_0xeece('0x3');var PASSWORD=_0xeece('0x4');function openIssue(_0x19a9ce,_0x4b3516){var _0x3f52ce={'fields':{'project':{'key':_0x19a9ce[_0xeece('0x5')]||'MOTGUI'},'summary':(_0x19a9ce[_0xeece('0x6')]||'Report')+_0xeece('0x7')+_0x19a9ce['ip'],'description':_0x19a9ce['description']||JSON[_0xeece('0x8')](_0x19a9ce),'issuetype':{'name':_0x19a9ce['issuetype']||_0xeece('0x9')}}};_0x3f52ce[_0xeece('0xa')][_0xeece('0xb')]=_0x19a9ce[_0xeece('0xc')];_0x3f52ce[_0xeece('0xa')][_0xeece('0xd')]=_0x19a9ce[_0xeece('0xe')];_0x3f52ce[_0xeece('0xa')][_0xeece('0xf')]=_0x19a9ce[_0xeece('0x10')];_0x3f52ce[_0xeece('0xa')][_0xeece('0x11')]=_0x19a9ce[_0xeece('0x12')];_0x3f52ce[_0xeece('0xa')]['customfield_11504']=_0x19a9ce[_0xeece('0x13')];_0x3f52ce['fields']['customfield_10102']=_0x19a9ce['ip'];var _0x4dab0c={'host':_0xeece('0x14'),'port':0x1bb,'path':_0xeece('0x15'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xeece('0x16'),'Authorization':_0xeece('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0xeece('0x18')](_0xeece('0x19'))}};var _0xa892e3=JSON[_0xeece('0x8')](_0x3f52ce);var _0x171788=https[_0xeece('0x1a')](_0x4dab0c,function(_0x31bf81){_0x31bf81['setEncoding'](_0xeece('0x1b'));var _0x37949c='';_0x31bf81['on'](_0xeece('0x1c'),function(_0x43d31e){_0x37949c+=_0x43d31e;});_0x31bf81['on'](_0xeece('0x1d'),function(){if(_0x4b3516){return _0x4b3516[_0xeece('0x1e')](_0x31bf81[_0xeece('0x1f')])[_0xeece('0x20')](JSON[_0xeece('0x21')](_0x37949c));}});});_0x171788['on'](_0xeece('0x22'),function(_0x538df4){if(_0x4b3516){return _0x4b3516[_0xeece('0x1e')](0x1f4)['json']({'errors':[{'message':_0xeece('0x23'),'type':_0xeece('0x24')}]});}});_0x171788[_0xeece('0x25')](_0xa892e3);_0x171788[_0xeece('0x1d')]();}exports[_0xeece('0x26')]=openIssue;exports[_0xeece('0x27')]=function(_0x92fe8f,_0x306cb2){_0x92fe8f[_0xeece('0x28')]['ip']=_0x92fe8f['headers'][_0xeece('0x29')]||_0x92fe8f[_0xeece('0x2a')][_0xeece('0x2b')]||_0x92fe8f[_0xeece('0x2c')][_0xeece('0x2b')]||_0x92fe8f['connection']['socket'][_0xeece('0x2b')];return openIssue(_0x92fe8f[_0xeece('0x28')],_0x306cb2);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 23fb02d..20f73ef 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 _0xa8a8=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x1e28a1,_0x4fb2e0){var _0x408d2d=function(_0x4f2120){while(--_0x4f2120){_0x1e28a1['push'](_0x1e28a1['shift']());}};_0x408d2d(++_0x4fb2e0);}(_0xa8a8,0xec));var _0x8a8a=function(_0x4739f6,_0x1fc6e1){_0x4739f6=_0x4739f6-0x0;var _0x287e30=_0xa8a8[_0x4739f6];return _0x287e30;};'use strict';var multer=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var timeout=require(_0x8a8a('0x3'));var express=require('express');var router=express[_0x8a8a('0x4')]();var fs_extra=require(_0x8a8a('0x5'));var auth=require(_0x8a8a('0x6'));var interaction=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var controller=require(_0x8a8a('0x9'));router[_0x8a8a('0xa')]('/',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xc')]);router[_0x8a8a('0xa')](_0x8a8a('0xd'),auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xe')]);router[_0x8a8a('0xa')](_0x8a8a('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x8a8a('0x10')]('/',auth['isAuthenticated'](),controller[_0x8a8a('0x11')]);router[_0x8a8a('0x12')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x13')]);router[_0x8a8a('0x14')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x15')]);module[_0x8a8a('0x16')]=router; \ No newline at end of file +var _0xbec5=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated'];(function(_0x12d8be,_0x244184){var _0xbcbff4=function(_0x2b25cf){while(--_0x2b25cf){_0x12d8be['push'](_0x12d8be['shift']());}};_0xbcbff4(++_0x244184);}(_0xbec5,0xe5));var _0x5bec=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0xbec5[_0x44afa4];return _0xcad289;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),auth[_0x5bec('0xc')](),controller[_0x5bec('0xd')]);router[_0x5bec('0x9')](_0x5bec('0xe'),auth[_0x5bec('0xc')](),controller['show']);router[_0x5bec('0xf')]('/',auth['isAuthenticated'](),controller[_0x5bec('0x10')]);router[_0x5bec('0x11')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x12')]);router[_0x5bec('0x13')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x14')]);module[_0x5bec('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index a8dcef3..397e69b 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(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7a54,0x106));var _0x47a5=function(_0x57d830,_0x183f48){_0x57d830=_0x57d830-0x0;var _0x10390b=_0x7a54[_0x57d830];return _0x10390b;};'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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x23dd9f,_0x50d1a5){_0x23dd9f=_0x23dd9f-0x0;var _0x2f8252=_0x7a54[_0x23dd9f];return _0x2f8252;};'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 c5bc288..3f78c07 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 _0xdb70=['catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','key','map','query','filters','attributes','intersection','fields','length','model','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find'];(function(_0x112d63,_0x922c48){var _0x5a6bdf=function(_0x3815d6){while(--_0x3815d6){_0x112d63['push'](_0x112d63['shift']());}};_0x5a6bdf(++_0x922c48);}(_0xdb70,0xa0));var _0x0db7=function(_0x11b95b,_0x46741a){_0x11b95b=_0x11b95b-0x0;var _0x26beba=_0xdb70[_0x11b95b];return _0x26beba;};'use strict';var emlformat=require(_0x0db7('0x0'));var rimraf=require(_0x0db7('0x1'));var zipdir=require(_0x0db7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0db7('0x3'));var moment=require(_0x0db7('0x4'));var BPromise=require(_0x0db7('0x5'));var Mustache=require(_0x0db7('0x6'));var util=require(_0x0db7('0x7'));var path=require(_0x0db7('0x8'));var sox=require(_0x0db7('0x9'));var csv=require(_0x0db7('0xa'));var ejs=require(_0x0db7('0xb'));var fs=require('fs');var fs_extra=require(_0x0db7('0xc'));var _=require(_0x0db7('0xd'));var squel=require('squel');var crypto=require(_0x0db7('0xe'));var jsforce=require(_0x0db7('0xf'));var deskjs=require(_0x0db7('0x10'));var toCsv=require(_0x0db7('0xa'));var querystring=require(_0x0db7('0x11'));var Papa=require(_0x0db7('0x12'));var Redis=require('ioredis');var authService=require(_0x0db7('0x13'));var qs=require(_0x0db7('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0db7('0x15'));var logger=require(_0x0db7('0x16'))(_0x0db7('0x17'));var utils=require(_0x0db7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0db7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9aed4f,_0x2959a2){_0x2959a2=_0x2959a2||0xcc;return function(_0x33ec07){if(_0x33ec07){return _0x9aed4f[_0x0db7('0x1a')](_0x2959a2);}return _0x9aed4f[_0x0db7('0x1b')](_0x2959a2)['end']();};}function respondWithResult(_0x76c036,_0x195556){_0x195556=_0x195556||0xc8;return function(_0x45f594){if(_0x45f594){return _0x76c036[_0x0db7('0x1b')](_0x195556)[_0x0db7('0x1c')](_0x45f594);}};}function respondWithFilteredResult(_0x446448,_0x41b2b3){return function(_0x2edbe9){if(_0x2edbe9){var _0xb9127d=typeof _0x41b2b3[_0x0db7('0x1d')]==='undefined'&&typeof _0x41b2b3[_0x0db7('0x1e')]===_0x0db7('0x1f');var _0x18cf37=_0x2edbe9[_0x0db7('0x20')];var _0x31082b=_0xb9127d?0x0:_0x41b2b3[_0x0db7('0x1d')];var _0x52e95e=_0xb9127d?_0x2edbe9['count']:_0x41b2b3[_0x0db7('0x1d')]+_0x41b2b3[_0x0db7('0x1e')];var _0xe9a55d;if(_0x52e95e>=_0x18cf37){_0x52e95e=_0x18cf37;_0xe9a55d=0xc8;}else{_0xe9a55d=0xce;}_0x446448['status'](_0xe9a55d);return _0x446448[_0x0db7('0x21')](_0x0db7('0x22'),_0x31082b+'-'+_0x52e95e+'/'+_0x18cf37)[_0x0db7('0x1c')](_0x2edbe9);}return null;};}function patchUpdates(_0x211fc0){return function(_0x5a0b04){try{jsonpatch[_0x0db7('0x23')](_0x5a0b04,_0x211fc0,!![]);}catch(_0x48feb2){return BPromise[_0x0db7('0x24')](_0x48feb2);}return _0x5a0b04['save']();};}function saveUpdates(_0x59b7e4,_0x135429){return function(_0x156aaa){if(_0x156aaa){return _0x156aaa[_0x0db7('0x25')](_0x59b7e4)[_0x0db7('0x26')](function(_0x18fc1c){return _0x18fc1c;});}return null;};}function removeEntity(_0x368243,_0xc05009){return function(_0x274bf1){if(_0x274bf1){return _0x274bf1[_0x0db7('0x27')]()[_0x0db7('0x26')](function(){_0x368243[_0x0db7('0x1b')](0xcc)[_0x0db7('0x28')]();});}};}function handleEntityNotFound(_0x299c22,_0x55f339){return function(_0x521565){if(!_0x521565){_0x299c22['sendStatus'](0x194);}return _0x521565;};}function handleError(_0x594e6a,_0x568e60){_0x568e60=_0x568e60||0x1f4;return function(_0x5d2e46){logger[_0x0db7('0x29')](_0x5d2e46[_0x0db7('0x2a')]);if(_0x5d2e46[_0x0db7('0x2b')]){delete _0x5d2e46['name'];}_0x594e6a['status'](_0x568e60)[_0x0db7('0x2c')](_0x5d2e46);};}exports[_0x0db7('0x2d')]=function(_0x3f2169,_0x37ade4){var _0x29ed0a={},_0xfc7311={},_0x4ca418={'count':0x0,'rows':[]};var _0x2de626=_['map'](db[_0x0db7('0x2e')][_0x0db7('0x2f')],function(_0x1481aa){return{'name':_0x1481aa[_0x0db7('0x30')],'type':_0x1481aa['type'][_0x0db7('0x31')]};});_0xfc7311['model']=_[_0x0db7('0x32')](_0x2de626,_0x0db7('0x2b'));_0xfc7311[_0x0db7('0x33')]=_['keys'](_0x3f2169[_0x0db7('0x33')]);_0xfc7311[_0x0db7('0x34')]=_['intersection'](_0xfc7311['model'],_0xfc7311[_0x0db7('0x33')]);_0x29ed0a[_0x0db7('0x35')]=_[_0x0db7('0x36')](_0xfc7311['model'],qs['fields'](_0x3f2169[_0x0db7('0x33')][_0x0db7('0x37')]));_0x29ed0a[_0x0db7('0x35')]=_0x29ed0a['attributes'][_0x0db7('0x38')]?_0x29ed0a[_0x0db7('0x35')]:_0xfc7311[_0x0db7('0x39')];if(!_0x3f2169[_0x0db7('0x33')]['hasOwnProperty'](_0x0db7('0x3a'))){_0x29ed0a['limit']=qs[_0x0db7('0x1e')](_0x3f2169['query'][_0x0db7('0x1e')]);_0x29ed0a[_0x0db7('0x1d')]=qs[_0x0db7('0x1d')](_0x3f2169['query']['offset']);}_0x29ed0a[_0x0db7('0x3b')]=qs[_0x0db7('0x3c')](_0x3f2169[_0x0db7('0x33')][_0x0db7('0x3c')]);_0x29ed0a[_0x0db7('0x3d')]=qs[_0x0db7('0x34')](_['pick'](_0x3f2169[_0x0db7('0x33')],_0xfc7311[_0x0db7('0x34')]),_0x2de626);if(_0x3f2169['query'][_0x0db7('0x3e')]){_0x29ed0a['where']=_[_0x0db7('0x3f')](_0x29ed0a['where'],{'$or':_[_0x0db7('0x32')](_0x2de626,function(_0x27ed23){if(_0x27ed23['type']!==_0x0db7('0x40')){var _0x100ef9={};_0x100ef9[_0x27ed23['name']]={'$like':'%'+_0x3f2169[_0x0db7('0x33')]['filter']+'%'};return _0x100ef9;}})});}_0x29ed0a=_[_0x0db7('0x3f')]({},_0x29ed0a,_0x3f2169[_0x0db7('0x41')]);var _0x32c295={'where':_0x29ed0a[_0x0db7('0x3d')]};return db[_0x0db7('0x2e')]['count'](_0x32c295)[_0x0db7('0x26')](function(_0x2545bf){_0x4ca418[_0x0db7('0x20')]=_0x2545bf;if(_0x3f2169[_0x0db7('0x33')][_0x0db7('0x42')]){_0x29ed0a[_0x0db7('0x43')]=[{'all':!![]}];}return db[_0x0db7('0x2e')][_0x0db7('0x44')](_0x29ed0a);})[_0x0db7('0x26')](function(_0x4591fe){_0x4ca418[_0x0db7('0x45')]=_0x4591fe;return _0x4ca418;})[_0x0db7('0x26')](respondWithFilteredResult(_0x37ade4,_0x29ed0a))['catch'](handleError(_0x37ade4,null));};exports[_0x0db7('0x46')]=function(_0x4a9066,_0x23558a){var _0x150936={'raw':!![],'where':{'id':_0x4a9066[_0x0db7('0x47')]['id']}},_0x55732f={};_0x55732f['model']=_[_0x0db7('0x48')](db[_0x0db7('0x2e')][_0x0db7('0x2f')]);_0x55732f[_0x0db7('0x33')]=_[_0x0db7('0x48')](_0x4a9066[_0x0db7('0x33')]);_0x55732f[_0x0db7('0x34')]=_[_0x0db7('0x36')](_0x55732f[_0x0db7('0x39')],_0x55732f['query']);_0x150936['attributes']=_['intersection'](_0x55732f[_0x0db7('0x39')],qs[_0x0db7('0x37')](_0x4a9066[_0x0db7('0x33')][_0x0db7('0x37')]));_0x150936[_0x0db7('0x35')]=_0x150936[_0x0db7('0x35')]['length']?_0x150936[_0x0db7('0x35')]:_0x55732f[_0x0db7('0x39')];if(_0x4a9066['query'][_0x0db7('0x42')]){_0x150936[_0x0db7('0x43')]=[{'all':!![]}];}_0x150936=_[_0x0db7('0x3f')]({},_0x150936,_0x4a9066['options']);return db[_0x0db7('0x2e')][_0x0db7('0x49')](_0x150936)[_0x0db7('0x26')](handleEntityNotFound(_0x23558a,null))[_0x0db7('0x26')](respondWithResult(_0x23558a,null))[_0x0db7('0x4a')](handleError(_0x23558a,null));};exports['create']=function(_0x23d9b3,_0x2388fa){return db[_0x0db7('0x2e')][_0x0db7('0x4b')](_0x23d9b3['body'],{})['then'](respondWithResult(_0x2388fa,0xc9))[_0x0db7('0x4a')](handleError(_0x2388fa,null));};exports['update']=function(_0x534daa,_0x3281bd){if(_0x534daa[_0x0db7('0x4c')]['id']){delete _0x534daa['body']['id'];}return db[_0x0db7('0x2e')][_0x0db7('0x49')]({'where':{'id':_0x534daa[_0x0db7('0x47')]['id']}})[_0x0db7('0x26')](handleEntityNotFound(_0x3281bd,null))['then'](saveUpdates(_0x534daa['body'],null))['then'](respondWithResult(_0x3281bd,null))[_0x0db7('0x4a')](handleError(_0x3281bd,null));};exports[_0x0db7('0x27')]=function(_0x1ac5df,_0x10863b){return db['JscriptyAnswerReport'][_0x0db7('0x49')]({'where':{'id':_0x1ac5df['params']['id']}})['then'](handleEntityNotFound(_0x10863b,null))['then'](removeEntity(_0x10863b,null))[_0x0db7('0x4a')](handleError(_0x10863b,null));};exports[_0x0db7('0x4d')]=function(_0x12bfda,_0x31f2a7){return db[_0x0db7('0x2e')]['describe']()[_0x0db7('0x26')](respondWithResult(_0x31f2a7,null))[_0x0db7('0x4a')](handleError(_0x31f2a7,null));}; \ No newline at end of file +var _0xa23f=['../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','sendStatus','stack','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','map','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filters','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','length','find','create','body','params','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0xa23f,0x7c));var _0xfa23=function(_0x9ae374,_0x5719e9){_0x9ae374=_0x9ae374-0x0;var _0x377d56=_0xa23f[_0x9ae374];return _0x377d56;};'use strict';var emlformat=require(_0xfa23('0x0'));var rimraf=require(_0xfa23('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfa23('0x2'));var moment=require(_0xfa23('0x3'));var BPromise=require(_0xfa23('0x4'));var Mustache=require(_0xfa23('0x5'));var util=require('util');var path=require(_0xfa23('0x6'));var sox=require('sox');var csv=require(_0xfa23('0x7'));var ejs=require(_0xfa23('0x8'));var fs=require('fs');var fs_extra=require(_0xfa23('0x9'));var _=require(_0xfa23('0xa'));var squel=require('squel');var crypto=require(_0xfa23('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfa23('0xc'));var toCsv=require(_0xfa23('0x7'));var querystring=require(_0xfa23('0xd'));var Papa=require(_0xfa23('0xe'));var Redis=require(_0xfa23('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfa23('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa23('0x11'))('api');var utils=require(_0xfa23('0x12'));var config=require(_0xfa23('0x13'));var licenseUtil=require(_0xfa23('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e5ffe,_0x42380){_0x42380=_0x42380||0xcc;return function(_0x46f991){if(_0x46f991){return _0x1e5ffe['sendStatus'](_0x42380);}return _0x1e5ffe['status'](_0x42380)[_0xfa23('0x15')]();};}function respondWithResult(_0x23712b,_0x3f50f0){_0x3f50f0=_0x3f50f0||0xc8;return function(_0x36252c){if(_0x36252c){return _0x23712b['status'](_0x3f50f0)[_0xfa23('0x16')](_0x36252c);}};}function respondWithFilteredResult(_0xb7d11a,_0x2095a5){return function(_0x9611e0){if(_0x9611e0){var _0x542d9a=typeof _0x2095a5[_0xfa23('0x17')]===_0xfa23('0x18')&&typeof _0x2095a5[_0xfa23('0x19')]===_0xfa23('0x18');var _0x3fa5f6=_0x9611e0['count'];var _0x59610c=_0x542d9a?0x0:_0x2095a5['offset'];var _0x445bd0=_0x542d9a?_0x9611e0[_0xfa23('0x1a')]:_0x2095a5['offset']+_0x2095a5[_0xfa23('0x19')];var _0x2c456b;if(_0x445bd0>=_0x3fa5f6){_0x445bd0=_0x3fa5f6;_0x2c456b=0xc8;}else{_0x2c456b=0xce;}_0xb7d11a[_0xfa23('0x1b')](_0x2c456b);return _0xb7d11a['set'](_0xfa23('0x1c'),_0x59610c+'-'+_0x445bd0+'/'+_0x3fa5f6)[_0xfa23('0x16')](_0x9611e0);}return null;};}function patchUpdates(_0x47c323){return function(_0x16e4f9){try{jsonpatch[_0xfa23('0x1d')](_0x16e4f9,_0x47c323,!![]);}catch(_0x148f3b){return BPromise[_0xfa23('0x1e')](_0x148f3b);}return _0x16e4f9[_0xfa23('0x1f')]();};}function saveUpdates(_0x10ef95,_0x31eedb){return function(_0x485838){if(_0x485838){return _0x485838[_0xfa23('0x20')](_0x10ef95)[_0xfa23('0x21')](function(_0x34a2ce){return _0x34a2ce;});}return null;};}function removeEntity(_0xe4680f,_0x542cde){return function(_0x4500a2){if(_0x4500a2){return _0x4500a2['destroy']()[_0xfa23('0x21')](function(){_0xe4680f[_0xfa23('0x1b')](0xcc)[_0xfa23('0x15')]();});}};}function handleEntityNotFound(_0x26bdce,_0x3362f3){return function(_0x1340d9){if(!_0x1340d9){_0x26bdce[_0xfa23('0x22')](0x194);}return _0x1340d9;};}function handleError(_0x499407,_0x5e1780){_0x5e1780=_0x5e1780||0x1f4;return function(_0x2ae826){logger['error'](_0x2ae826[_0xfa23('0x23')]);if(_0x2ae826['name']){delete _0x2ae826['name'];}_0x499407[_0xfa23('0x1b')](_0x5e1780)[_0xfa23('0x24')](_0x2ae826);};}exports[_0xfa23('0x25')]=function(_0x3b00a8,_0x374169){var _0x24da31={},_0x3c9d9d={},_0x4c1ab0={'count':0x0,'rows':[]};var _0x591797=_['map'](db[_0xfa23('0x26')][_0xfa23('0x27')],function(_0x5df1f9){return{'name':_0x5df1f9[_0xfa23('0x28')],'type':_0x5df1f9[_0xfa23('0x29')][_0xfa23('0x2a')]};});_0x3c9d9d[_0xfa23('0x2b')]=_[_0xfa23('0x2c')](_0x591797,_0xfa23('0x2d'));_0x3c9d9d[_0xfa23('0x2e')]=_[_0xfa23('0x2f')](_0x3b00a8[_0xfa23('0x2e')]);_0x3c9d9d['filters']=_[_0xfa23('0x30')](_0x3c9d9d['model'],_0x3c9d9d[_0xfa23('0x2e')]);_0x24da31[_0xfa23('0x31')]=_[_0xfa23('0x30')](_0x3c9d9d[_0xfa23('0x2b')],qs[_0xfa23('0x32')](_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x32')]));_0x24da31[_0xfa23('0x31')]=_0x24da31[_0xfa23('0x31')]['length']?_0x24da31[_0xfa23('0x31')]:_0x3c9d9d['model'];if(!_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x33')](_0xfa23('0x34'))){_0x24da31[_0xfa23('0x19')]=qs[_0xfa23('0x19')](_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x19')]);_0x24da31['offset']=qs[_0xfa23('0x17')](_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x17')]);}_0x24da31[_0xfa23('0x35')]=qs['sort'](_0x3b00a8['query']['sort']);_0x24da31[_0xfa23('0x36')]=qs[_0xfa23('0x37')](_['pick'](_0x3b00a8[_0xfa23('0x2e')],_0x3c9d9d[_0xfa23('0x37')]),_0x591797);if(_0x3b00a8[_0xfa23('0x2e')]['filter']){_0x24da31[_0xfa23('0x36')]=_['merge'](_0x24da31[_0xfa23('0x36')],{'$or':_[_0xfa23('0x2c')](_0x591797,function(_0x329985){if(_0x329985[_0xfa23('0x29')]!==_0xfa23('0x38')){var _0x80827f={};_0x80827f[_0x329985['name']]={'$like':'%'+_0x3b00a8[_0xfa23('0x2e')][_0xfa23('0x39')]+'%'};return _0x80827f;}})});}_0x24da31=_[_0xfa23('0x3a')]({},_0x24da31,_0x3b00a8[_0xfa23('0x3b')]);var _0x48c3a4={'where':_0x24da31[_0xfa23('0x36')]};return db[_0xfa23('0x26')][_0xfa23('0x1a')](_0x48c3a4)[_0xfa23('0x21')](function(_0x113552){_0x4c1ab0[_0xfa23('0x1a')]=_0x113552;if(_0x3b00a8['query'][_0xfa23('0x3c')]){_0x24da31['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xfa23('0x3d')](_0x24da31);})[_0xfa23('0x21')](function(_0x5937e0){_0x4c1ab0[_0xfa23('0x3e')]=_0x5937e0;return _0x4c1ab0;})[_0xfa23('0x21')](respondWithFilteredResult(_0x374169,_0x24da31))[_0xfa23('0x3f')](handleError(_0x374169,null));};exports['show']=function(_0x3de346,_0x37f4c5){var _0xb73ed9={'raw':!![],'where':{'id':_0x3de346['params']['id']}},_0x539271={};_0x539271[_0xfa23('0x2b')]=_['keys'](db[_0xfa23('0x26')][_0xfa23('0x27')]);_0x539271[_0xfa23('0x2e')]=_['keys'](_0x3de346[_0xfa23('0x2e')]);_0x539271[_0xfa23('0x37')]=_[_0xfa23('0x30')](_0x539271[_0xfa23('0x2b')],_0x539271['query']);_0xb73ed9[_0xfa23('0x31')]=_[_0xfa23('0x30')](_0x539271[_0xfa23('0x2b')],qs['fields'](_0x3de346['query'][_0xfa23('0x32')]));_0xb73ed9['attributes']=_0xb73ed9[_0xfa23('0x31')][_0xfa23('0x40')]?_0xb73ed9[_0xfa23('0x31')]:_0x539271[_0xfa23('0x2b')];if(_0x3de346[_0xfa23('0x2e')][_0xfa23('0x3c')]){_0xb73ed9['include']=[{'all':!![]}];}_0xb73ed9=_[_0xfa23('0x3a')]({},_0xb73ed9,_0x3de346[_0xfa23('0x3b')]);return db[_0xfa23('0x26')][_0xfa23('0x41')](_0xb73ed9)[_0xfa23('0x21')](handleEntityNotFound(_0x37f4c5,null))[_0xfa23('0x21')](respondWithResult(_0x37f4c5,null))['catch'](handleError(_0x37f4c5,null));};exports[_0xfa23('0x42')]=function(_0x36a02c,_0x6ba64c){return db[_0xfa23('0x26')][_0xfa23('0x42')](_0x36a02c['body'],{})[_0xfa23('0x21')](respondWithResult(_0x6ba64c,0xc9))[_0xfa23('0x3f')](handleError(_0x6ba64c,null));};exports[_0xfa23('0x20')]=function(_0x5e4633,_0x253faf){if(_0x5e4633[_0xfa23('0x43')]['id']){delete _0x5e4633[_0xfa23('0x43')]['id'];}return db[_0xfa23('0x26')][_0xfa23('0x41')]({'where':{'id':_0x5e4633[_0xfa23('0x44')]['id']}})[_0xfa23('0x21')](handleEntityNotFound(_0x253faf,null))['then'](saveUpdates(_0x5e4633[_0xfa23('0x43')],null))['then'](respondWithResult(_0x253faf,null))[_0xfa23('0x3f')](handleError(_0x253faf,null));};exports[_0xfa23('0x45')]=function(_0x3824a9,_0xf24dd5){return db[_0xfa23('0x26')][_0xfa23('0x41')]({'where':{'id':_0x3824a9['params']['id']}})[_0xfa23('0x21')](handleEntityNotFound(_0xf24dd5,null))[_0xfa23('0x21')](removeEntity(_0xf24dd5,null))[_0xfa23('0x3f')](handleError(_0xf24dd5,null));};exports[_0xfa23('0x46')]=function(_0x13c37d,_0x22be14){return db[_0xfa23('0x26')]['describe']()[_0xfa23('0x21')](respondWithResult(_0x22be14,null))[_0xfa23('0x3f')](handleError(_0x22be14,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 4658ef5..3828c08 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 _0xa0ca=['define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x4f71cb,_0x39d98e){var _0x3f9435=function(_0x380395){while(--_0x380395){_0x4f71cb['push'](_0x4f71cb['shift']());}};_0x3f9435(++_0x39d98e);}(_0xa0ca,0x147));var _0xaa0c=function(_0x5df414,_0x2b54f4){_0x5df414=_0x5df414-0x0;var _0x5b2952=_0xa0ca[_0x5df414];return _0x5b2952;};'use strict';var _=require(_0xaa0c('0x0'));var util=require(_0xaa0c('0x1'));var logger=require('../../config/logger')(_0xaa0c('0x2'));var moment=require('moment');var BPromise=require(_0xaa0c('0x3'));var rp=require(_0xaa0c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa0c('0x5'));var config=require(_0xaa0c('0x6'));var attributes=require(_0xaa0c('0x7'));module[_0xaa0c('0x8')]=function(_0x430fa1,_0x31a121){return _0x430fa1[_0xaa0c('0x9')](_0xaa0c('0xa'),attributes,{'tableName':_0xaa0c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea94=['./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5a589a,_0x3d38d2){var _0x32624a=function(_0x344454){while(--_0x344454){_0x5a589a['push'](_0x5a589a['shift']());}};_0x32624a(++_0x3d38d2);}(_0xea94,0x1d8));var _0x4ea9=function(_0xf166de,_0x335fa7){_0xf166de=_0xf166de-0x0;var _0x4434f7=_0xea94[_0xf166de];return _0x4434f7;};'use strict';var _=require(_0x4ea9('0x0'));var util=require('util');var logger=require(_0x4ea9('0x1'))(_0x4ea9('0x2'));var moment=require(_0x4ea9('0x3'));var BPromise=require(_0x4ea9('0x4'));var rp=require(_0x4ea9('0x5'));var fs=require('fs');var path=require(_0x4ea9('0x6'));var rimraf=require(_0x4ea9('0x7'));var config=require(_0x4ea9('0x8'));var attributes=require(_0x4ea9('0x9'));module[_0x4ea9('0xa')]=function(_0x446033,_0x1c55f7){return _0x446033[_0x4ea9('0xb')](_0x4ea9('0xc'),attributes,{'tableName':'report_jscripty_answers','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 3537d28..3d0df9e 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 _0x496d=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2738bc,_0x56f4b8){var _0x3946b3=function(_0x2d1bf3){while(--_0x2d1bf3){_0x2738bc['push'](_0x2738bc['shift']());}};_0x3946b3(++_0x56f4b8);}(_0x496d,0x10d));var _0xd496=function(_0x196543,_0x200ccd){_0x196543=_0x196543-0x0;var _0x3526c7=_0x496d[_0x196543];return _0x3526c7;};'use strict';var _=require(_0xd496('0x0'));var util=require(_0xd496('0x1'));var moment=require(_0xd496('0x2'));var BPromise=require(_0xd496('0x3'));var rs=require(_0xd496('0x4'));var fs=require('fs');var Redis=require(_0xd496('0x5'));var db=require(_0xd496('0x6'))['db'];var utils=require(_0xd496('0x7'));var logger=require(_0xd496('0x8'))('rpc');var config=require(_0xd496('0x9'));var jayson=require(_0xd496('0xa'));var client=jayson[_0xd496('0xb')][_0xd496('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ff18b,_0x36962c,_0x11c7cc){return new BPromise(function(_0x45e2f3,_0x3955c7){return client[_0xd496('0xd')](_0x2ff18b,_0x11c7cc)[_0xd496('0xe')](function(_0xc4b4e5){logger[_0xd496('0xf')](_0xd496('0x10'),_0x36962c,_0xd496('0x11'));logger[_0xd496('0x12')](_0xd496('0x13'),_0x36962c,_0xd496('0x11'),JSON[_0xd496('0x14')](_0xc4b4e5));if(_0xc4b4e5['error']){if(_0xc4b4e5[_0xd496('0x15')][_0xd496('0x16')]===0x1f4){logger['error'](_0xd496('0x10'),_0x36962c,_0xc4b4e5[_0xd496('0x15')][_0xd496('0x17')]);return _0x3955c7(_0xc4b4e5[_0xd496('0x15')]['message']);}logger['error'](_0xd496('0x10'),_0x36962c,_0xc4b4e5['error'][_0xd496('0x17')]);return _0x45e2f3(_0xc4b4e5[_0xd496('0x15')][_0xd496('0x17')]);}else{logger['info'](_0xd496('0x10'),_0x36962c,'request\x20sent');_0x45e2f3(_0xc4b4e5['result'][_0xd496('0x17')]);}})[_0xd496('0x18')](function(_0x4324d8){logger[_0xd496('0x15')](_0xd496('0x10'),_0x36962c,_0x4324d8);_0x3955c7(_0x4324d8);});});} \ No newline at end of file +var _0xc094=['request','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x90b38f,_0x47fbd5){var _0x5f3d64=function(_0x67a7c0){while(--_0x67a7c0){_0x90b38f['push'](_0x90b38f['shift']());}};_0x5f3d64(++_0x47fbd5);}(_0xc094,0x131));var _0x4c09=function(_0x3e036f,_0x361755){_0x3e036f=_0x3e036f-0x0;var _0x5f278e=_0xc094[_0x3e036f];return _0x5f278e;};'use strict';var _=require('lodash');var util=require(_0x4c09('0x0'));var moment=require(_0x4c09('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c09('0x2'));var fs=require('fs');var Redis=require(_0x4c09('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c09('0x4'));var logger=require(_0x4c09('0x5'))(_0x4c09('0x6'));var config=require(_0x4c09('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4c09('0x8')][_0x4c09('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd9fc42,_0x15236f,_0x11e85f){return new BPromise(function(_0x35da9f,_0xd8005){return client[_0x4c09('0xa')](_0xd9fc42,_0x11e85f)['then'](function(_0x10a004){logger['info'](_0x4c09('0xb'),_0x15236f,_0x4c09('0xc'));logger[_0x4c09('0xd')](_0x4c09('0xe'),_0x15236f,_0x4c09('0xc'),JSON[_0x4c09('0xf')](_0x10a004));if(_0x10a004['error']){if(_0x10a004[_0x4c09('0x10')][_0x4c09('0x11')]===0x1f4){logger[_0x4c09('0x10')](_0x4c09('0xb'),_0x15236f,_0x10a004[_0x4c09('0x10')][_0x4c09('0x12')]);return _0xd8005(_0x10a004[_0x4c09('0x10')]['message']);}logger[_0x4c09('0x10')](_0x4c09('0xb'),_0x15236f,_0x10a004[_0x4c09('0x10')]['message']);return _0x35da9f(_0x10a004[_0x4c09('0x10')][_0x4c09('0x12')]);}else{logger[_0x4c09('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x15236f,'request\x20sent');_0x35da9f(_0x10a004[_0x4c09('0x14')][_0x4c09('0x12')]);}})['catch'](function(_0x5d79b9){logger[_0x4c09('0x10')](_0x4c09('0xb'),_0x15236f,_0x5d79b9);_0xd8005(_0x5d79b9);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 4a083b3..ca7f061 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 _0x6a85=['get','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','30s','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller'];(function(_0x2aab8e,_0x440d3b){var _0x2a67=function(_0x1503d2){while(--_0x1503d2){_0x2aab8e['push'](_0x2aab8e['shift']());}};_0x2a67(++_0x440d3b);}(_0x6a85,0x7a));var _0x56a8=function(_0x2351c4,_0x1dca54){_0x2351c4=_0x2351c4-0x0;var _0x1dd3f8=_0x6a85[_0x2351c4];return _0x1dd3f8;};'use strict';var multer=require(_0x56a8('0x0'));var util=require(_0x56a8('0x1'));var path=require(_0x56a8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x56a8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x56a8('0x4'));var interaction=require(_0x56a8('0x5'));var config=require(_0x56a8('0x6'));var controller=require(_0x56a8('0x7'));router[_0x56a8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x56a8('0x8')](_0x56a8('0x9'),auth[_0x56a8('0xa')](),controller[_0x56a8('0xb')]);router[_0x56a8('0x8')](_0x56a8('0xc'),auth[_0x56a8('0xa')](),controller[_0x56a8('0xd')]);router[_0x56a8('0x8')](_0x56a8('0xe'),auth[_0x56a8('0xa')](),controller['getAnswers']);router[_0x56a8('0x8')]('/:id/summary',auth[_0x56a8('0xa')](),timeout(_0x56a8('0xf')),controller[_0x56a8('0x10')]);router[_0x56a8('0x11')]('/',auth['isAuthenticated'](),controller[_0x56a8('0x12')]);router[_0x56a8('0x11')](_0x56a8('0x13'),auth[_0x56a8('0xa')](),controller[_0x56a8('0x14')]);router[_0x56a8('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x56a8('0x16')]);router[_0x56a8('0x17')](_0x56a8('0x9'),auth[_0x56a8('0xa')](),controller[_0x56a8('0x18')]);module[_0x56a8('0x19')]=router; \ No newline at end of file +var _0x1f9c=['./jscriptyProject.controller','get','isAuthenticated','/:id/sessions','/:id/answers','/:id/summary','30s','post','create','/:id/clone','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x107b37,_0x39d2e2){var _0x3b0dbe=function(_0x41cd91){while(--_0x41cd91){_0x107b37['push'](_0x107b37['shift']());}};_0x3b0dbe(++_0x39d2e2);}(_0x1f9c,0x1dd));var _0xc1f9=function(_0x3e79c8,_0x40e942){_0x3e79c8=_0x3e79c8-0x0;var _0x9287a9=_0x1f9c[_0x3e79c8];return _0x9287a9;};'use strict';var multer=require(_0xc1f9('0x0'));var util=require(_0xc1f9('0x1'));var path=require(_0xc1f9('0x2'));var timeout=require(_0xc1f9('0x3'));var express=require(_0xc1f9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc1f9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc1f9('0x6'));var controller=require(_0xc1f9('0x7'));router[_0xc1f9('0x8')]('/',auth[_0xc1f9('0x9')](),controller['index']);router[_0xc1f9('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xc1f9('0xa'),auth[_0xc1f9('0x9')](),controller['getSessions']);router[_0xc1f9('0x8')](_0xc1f9('0xb'),auth[_0xc1f9('0x9')](),controller['getAnswers']);router[_0xc1f9('0x8')](_0xc1f9('0xc'),auth['isAuthenticated'](),timeout(_0xc1f9('0xd')),controller['getSummary']);router[_0xc1f9('0xe')]('/',auth['isAuthenticated'](),controller[_0xc1f9('0xf')]);router[_0xc1f9('0xe')](_0xc1f9('0x10'),auth[_0xc1f9('0x9')](),controller['clone']);router[_0xc1f9('0x11')]('/:id',auth[_0xc1f9('0x9')](),controller[_0xc1f9('0x12')]);router[_0xc1f9('0x13')](_0xc1f9('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0xc1f9('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 2acc815..9a17b93 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 _0x965e=['setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name'];(function(_0x40291f,_0x5f4157){var _0x4a5b69=function(_0x565d8a){while(--_0x565d8a){_0x40291f['push'](_0x40291f['shift']());}};_0x4a5b69(++_0x5f4157);}(_0x965e,0xe8));var _0xe965=function(_0x4acfd2,_0x5b9374){_0x4acfd2=_0x4acfd2-0x0;var _0x12afbe=_0x965e[_0x4acfd2];return _0x12afbe;};'use strict';var Sequelize=require(_0xe965('0x0'));var _=require(_0xe965('0x1'));var util=require(_0xe965('0x2'));module[_0xe965('0x3')]={'name':{'type':Sequelize[_0xe965('0x4')],'unique':_0xe965('0x5')},'description':{'type':Sequelize[_0xe965('0x4')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x8dcec8){if(_['isObjectLike'](_0x8dcec8)){this[_0xe965('0x6')](_0xe965('0x7'),JSON[_0xe965('0x8')](_0x8dcec8));}else if(_['isString'](_0x8dcec8)){this['setDataValue'](_0xe965('0x7'),_0x8dcec8);}else{this['setDataValue']('formData',util[_0xe965('0x9')](_0xe965('0xa'),this[_0xe965('0xb')]('name')||'',this['getDataValue'](_0xe965('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xe965('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0xa612=['lodash','STRING','name','isObjectLike','setDataValue','formData','stringify','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize'];(function(_0x5a619b,_0x2edb27){var _0x394db6=function(_0x31554e){while(--_0x31554e){_0x5a619b['push'](_0x5a619b['shift']());}};_0x394db6(++_0x2edb27);}(_0xa612,0x15e));var _0x2a61=function(_0x1f335d,_0x552f5e){_0x1f335d=_0x1f335d-0x0;var _0x5e373c=_0xa612[_0x1f335d];return _0x5e373c;};'use strict';var Sequelize=require(_0x2a61('0x0'));var _=require(_0x2a61('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0x2a61('0x2')],'unique':_0x2a61('0x3')},'description':{'type':Sequelize[_0x2a61('0x2')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x4149e9){if(_[_0x2a61('0x4')](_0x4149e9)){this[_0x2a61('0x5')](_0x2a61('0x6'),JSON[_0x2a61('0x7')](_0x4149e9));}else if(_['isString'](_0x4149e9)){this[_0x2a61('0x5')]('formData',_0x4149e9);}else{this[_0x2a61('0x5')](_0x2a61('0x6'),util[_0x2a61('0x8')](_0x2a61('0x9'),this['getDataValue'](_0x2a61('0x3'))||'',this[_0x2a61('0xa')](_0x2a61('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x2a61('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 560d8bc..58cc4e7 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 _0xbd8e=['Content-Range','json','apply','save','update','then','destroy','UserProfileResource','name','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','JscriptyProject','includeAll','include','findAll','show','rawAttributes','length','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Projects','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','autoAssociation','findOne','ProjectId','JscriptySessionReport','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','indexOf','toString','replace','startTime','JscriptyQuestionReport','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x4bbf9e,_0x1bd993){var _0x3bf450=function(_0x4f765b){while(--_0x4f765b){_0x4bbf9e['push'](_0x4bbf9e['shift']());}};_0x3bf450(++_0x1bd993);}(_0xbd8e,0x1b5));var _0xebd8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbd8e[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xebd8('0x0'));var rimraf=require(_0xebd8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xebd8('0x2'));var moment=require('moment');var BPromise=require(_0xebd8('0x3'));var Mustache=require(_0xebd8('0x4'));var util=require(_0xebd8('0x5'));var path=require(_0xebd8('0x6'));var sox=require(_0xebd8('0x7'));var csv=require('to-csv');var ejs=require(_0xebd8('0x8'));var fs=require('fs');var fs_extra=require(_0xebd8('0x9'));var _=require(_0xebd8('0xa'));var squel=require(_0xebd8('0xb'));var crypto=require(_0xebd8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xebd8('0xd'));var toCsv=require(_0xebd8('0xe'));var querystring=require(_0xebd8('0xf'));var Papa=require(_0xebd8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xebd8('0x11'));var hardwareService=require(_0xebd8('0x12'));var logger=require(_0xebd8('0x13'))(_0xebd8('0x14'));var utils=require(_0xebd8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xebd8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x247d34,_0x1d13c8){_0x1d13c8=_0x1d13c8||0xcc;return function(_0x4c3293){if(_0x4c3293){return _0x247d34[_0xebd8('0x17')](_0x1d13c8);}return _0x247d34[_0xebd8('0x18')](_0x1d13c8)[_0xebd8('0x19')]();};}function respondWithResult(_0x5cc357,_0x12b5cd){_0x12b5cd=_0x12b5cd||0xc8;return function(_0x5ca45c){if(_0x5ca45c){return _0x5cc357[_0xebd8('0x18')](_0x12b5cd)['json'](_0x5ca45c);}};}function respondWithFilteredResult(_0x598f71,_0x3e50e0){return function(_0x10d4eb){if(_0x10d4eb){var _0x2162ad=typeof _0x3e50e0[_0xebd8('0x1a')]===_0xebd8('0x1b')&&typeof _0x3e50e0[_0xebd8('0x1c')]===_0xebd8('0x1b');var _0x33ceac=_0x10d4eb[_0xebd8('0x1d')];var _0x3e0293=_0x2162ad?0x0:_0x3e50e0[_0xebd8('0x1a')];var _0x46a956=_0x2162ad?_0x10d4eb[_0xebd8('0x1d')]:_0x3e50e0[_0xebd8('0x1a')]+_0x3e50e0['limit'];var _0x158940;if(_0x46a956>=_0x33ceac){_0x46a956=_0x33ceac;_0x158940=0xc8;}else{_0x158940=0xce;}_0x598f71[_0xebd8('0x18')](_0x158940);return _0x598f71[_0xebd8('0x1e')](_0xebd8('0x1f'),_0x3e0293+'-'+_0x46a956+'/'+_0x33ceac)[_0xebd8('0x20')](_0x10d4eb);}return null;};}function patchUpdates(_0x24be02){return function(_0x1c8e6a){try{jsonpatch[_0xebd8('0x21')](_0x1c8e6a,_0x24be02,!![]);}catch(_0x56f1f6){return BPromise['reject'](_0x56f1f6);}return _0x1c8e6a[_0xebd8('0x22')]();};}function saveUpdates(_0x9b52cf,_0x26aff8){return function(_0x2a27a6){if(_0x2a27a6){return _0x2a27a6[_0xebd8('0x23')](_0x9b52cf)[_0xebd8('0x24')](function(_0x12c460){return _0x12c460;});}return null;};}function removeEntity(_0x44493c,_0x43903b){return function(_0x228411){if(_0x228411){return _0x228411[_0xebd8('0x25')]()[_0xebd8('0x24')](function(){var _0xa64ff5=_0x228411['get']({'plain':!![]});var _0x3e1654='Projects';return db[_0xebd8('0x26')][_0xebd8('0x25')]({'where':{'type':_0x3e1654,'resourceId':_0xa64ff5['id']}})[_0xebd8('0x24')](function(){return _0x228411;});})[_0xebd8('0x24')](function(){_0x44493c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x842923,_0xe177c3){return function(_0x1fd2b3){if(!_0x1fd2b3){_0x842923[_0xebd8('0x17')](0x194);}return _0x1fd2b3;};}function handleError(_0x29bb48,_0xcd698e){_0xcd698e=_0xcd698e||0x1f4;return function(_0x427709){logger['error'](_0x427709['stack']);if(_0x427709[_0xebd8('0x27')]){delete _0x427709['name'];}_0x29bb48[_0xebd8('0x18')](_0xcd698e)['send'](_0x427709);};}exports[_0xebd8('0x28')]=function(_0x2830fe,_0x51e28e){var _0x197a05={},_0x51200a={},_0x1dc147={'count':0x0,'rows':[]};var _0x30d364=_[_0xebd8('0x29')](db['JscriptyProject']['rawAttributes'],function(_0x136bde){return{'name':_0x136bde[_0xebd8('0x2a')],'type':_0x136bde[_0xebd8('0x2b')]['key']};});_0x51200a[_0xebd8('0x2c')]=_[_0xebd8('0x29')](_0x30d364,_0xebd8('0x27'));_0x51200a[_0xebd8('0x2d')]=_[_0xebd8('0x2e')](_0x2830fe[_0xebd8('0x2d')]);_0x51200a[_0xebd8('0x2f')]=_[_0xebd8('0x30')](_0x51200a[_0xebd8('0x2c')],_0x51200a[_0xebd8('0x2d')]);_0x197a05[_0xebd8('0x31')]=_[_0xebd8('0x30')](_0x51200a[_0xebd8('0x2c')],qs[_0xebd8('0x32')](_0x2830fe[_0xebd8('0x2d')][_0xebd8('0x32')]));_0x197a05[_0xebd8('0x31')]=_0x197a05[_0xebd8('0x31')]['length']?_0x197a05[_0xebd8('0x31')]:_0x51200a[_0xebd8('0x2c')];if(!_0x2830fe['query'][_0xebd8('0x33')](_0xebd8('0x34'))){_0x197a05[_0xebd8('0x1c')]=qs[_0xebd8('0x1c')](_0x2830fe[_0xebd8('0x2d')]['limit']);_0x197a05[_0xebd8('0x1a')]=qs[_0xebd8('0x1a')](_0x2830fe[_0xebd8('0x2d')][_0xebd8('0x1a')]);}_0x197a05[_0xebd8('0x35')]=qs[_0xebd8('0x36')](_0x2830fe[_0xebd8('0x2d')][_0xebd8('0x36')]);_0x197a05['where']=qs[_0xebd8('0x2f')](_[_0xebd8('0x37')](_0x2830fe['query'],_0x51200a[_0xebd8('0x2f')]),_0x30d364);if(_0x2830fe['query'][_0xebd8('0x38')]){_0x197a05[_0xebd8('0x39')]=_[_0xebd8('0x3a')](_0x197a05[_0xebd8('0x39')],{'$or':_['map'](_0x30d364,function(_0x46f826){if(_0x46f826[_0xebd8('0x2b')]!==_0xebd8('0x3b')){var _0x57718b={};_0x57718b[_0x46f826[_0xebd8('0x27')]]={'$like':'%'+_0x2830fe[_0xebd8('0x2d')][_0xebd8('0x38')]+'%'};return _0x57718b;}})});}_0x197a05=_[_0xebd8('0x3a')]({},_0x197a05,_0x2830fe[_0xebd8('0x3c')]);var _0x38091a={'where':_0x197a05[_0xebd8('0x39')]};return db[_0xebd8('0x3d')][_0xebd8('0x1d')](_0x38091a)[_0xebd8('0x24')](function(_0x36d021){_0x1dc147[_0xebd8('0x1d')]=_0x36d021;if(_0x2830fe['query'][_0xebd8('0x3e')]){_0x197a05[_0xebd8('0x3f')]=[{'all':!![]}];}return db['JscriptyProject'][_0xebd8('0x40')](_0x197a05);})[_0xebd8('0x24')](function(_0x354283){_0x1dc147['rows']=_0x354283;return _0x1dc147;})['then'](respondWithFilteredResult(_0x51e28e,_0x197a05))['catch'](handleError(_0x51e28e,null));};exports[_0xebd8('0x41')]=function(_0x2d0e9b,_0x3b205a){var _0x2c6f08={'raw':![],'where':{'id':_0x2d0e9b['params']['id']}},_0x53dfe2={};_0x53dfe2[_0xebd8('0x2c')]=_['keys'](db['JscriptyProject'][_0xebd8('0x42')]);_0x53dfe2[_0xebd8('0x2d')]=_[_0xebd8('0x2e')](_0x2d0e9b['query']);_0x53dfe2[_0xebd8('0x2f')]=_[_0xebd8('0x30')](_0x53dfe2[_0xebd8('0x2c')],_0x53dfe2[_0xebd8('0x2d')]);_0x2c6f08[_0xebd8('0x31')]=_['intersection'](_0x53dfe2['model'],qs['fields'](_0x2d0e9b[_0xebd8('0x2d')][_0xebd8('0x32')]));_0x2c6f08['attributes']=_0x2c6f08[_0xebd8('0x31')][_0xebd8('0x43')]?_0x2c6f08[_0xebd8('0x31')]:_0x53dfe2[_0xebd8('0x2c')];if(_0x2d0e9b['query'][_0xebd8('0x3e')]){_0x2c6f08['include']=[{'all':!![]}];}_0x2c6f08=_[_0xebd8('0x3a')]({},_0x2c6f08,_0x2d0e9b[_0xebd8('0x3c')]);return db[_0xebd8('0x3d')][_0xebd8('0x44')](_0x2c6f08)[_0xebd8('0x24')](handleEntityNotFound(_0x3b205a,null))[_0xebd8('0x24')](respondWithResult(_0x3b205a,null))[_0xebd8('0x45')](handleError(_0x3b205a,null));};exports['create']=function(_0x2d57e7,_0x479140){return db[_0xebd8('0x3d')][_0xebd8('0x46')](_0x2d57e7[_0xebd8('0x47')],{})['then'](function(_0x38a6ef){var _0x2adca7=_0x2d57e7[_0xebd8('0x48')][_0xebd8('0x49')]({'plain':!![]});if(!_0x2adca7)throw new Error(_0xebd8('0x4a'));if(_0x2adca7['role']===_0xebd8('0x48')){var _0x16d43a=_0x38a6ef[_0xebd8('0x49')]({'plain':!![]});var _0xdaeea7=_0xebd8('0x4b');return db[_0xebd8('0x4c')][_0xebd8('0x44')]({'where':{'name':_0xdaeea7,'userProfileId':_0x2adca7[_0xebd8('0x4d')]},'raw':!![]})[_0xebd8('0x24')](function(_0x52b481){if(_0x52b481&&_0x52b481['autoAssociation']===0x0){return db[_0xebd8('0x26')][_0xebd8('0x46')]({'name':_0x16d43a[_0xebd8('0x27')],'resourceId':_0x16d43a['id'],'type':_0x52b481[_0xebd8('0x27')],'sectionId':_0x52b481['id']},{})['then'](function(){return _0x38a6ef;});}else{return _0x38a6ef;}})['catch'](function(_0x17b9b2){logger[_0xebd8('0x4e')](_0xebd8('0x4f'),_0x17b9b2);throw _0x17b9b2;});}return _0x38a6ef;})['then'](respondWithResult(_0x479140,0xc9))['catch'](handleError(_0x479140,null));};exports[_0xebd8('0x50')]=function(_0x28a1ad,_0x485033){var _0x3f491d={'where':{'id':_0x28a1ad[_0xebd8('0x51')]['id']}},_0x4a3d67={};_0x4a3d67[_0xebd8('0x2c')]=_[_0xebd8('0x2e')](db[_0xebd8('0x3d')][_0xebd8('0x42')]);_0x3f491d['attributes']=_[_0xebd8('0x30')](_0x4a3d67[_0xebd8('0x2c')],qs[_0xebd8('0x32')](_0x28a1ad[_0xebd8('0x2d')][_0xebd8('0x32')]));_0x3f491d['attributes']=_0x3f491d[_0xebd8('0x31')]['length']?_0x3f491d[_0xebd8('0x31')]:_0x4a3d67[_0xebd8('0x2c')];if(_0x28a1ad['query'][_0xebd8('0x3e')]){_0x3f491d[_0xebd8('0x3f')]=[{'all':!![]}];}_0x3f491d=_[_0xebd8('0x3a')]({},_0x3f491d,_0x28a1ad['options']);return db[_0xebd8('0x3d')][_0xebd8('0x44')](_0x3f491d)[_0xebd8('0x24')](handleEntityNotFound(_0x485033,null))[_0xebd8('0x24')](function(_0x2fbc4d){if(_0x2fbc4d){var _0x92cb7f=_0x2fbc4d[_0xebd8('0x49')]({'plain':!![]});_0x92cb7f=qs['omit'](_0x92cb7f,['id',_0xebd8('0x52'),_0xebd8('0x53')]);_0x28a1ad['body']=_[_0xebd8('0x54')](_0x28a1ad[_0xebd8('0x47')],['id',_0xebd8('0x52'),_0xebd8('0x53')]);return db[_0xebd8('0x3d')][_0xebd8('0x46')](_[_0xebd8('0x3a')](_0x92cb7f,_0x28a1ad[_0xebd8('0x47')]),{'include':_0x28a1ad[_0xebd8('0x2d')][_0xebd8('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0x35c706){var _0x13c4e3=_0x28a1ad[_0xebd8('0x48')][_0xebd8('0x49')]({'plain':!![]});if(!_0x13c4e3)throw new Error(_0xebd8('0x4a'));if(_0x13c4e3['role']===_0xebd8('0x48')){var _0x4ac20c=_0x35c706[_0xebd8('0x49')]({'plain':!![]});var _0x3d4759='Projects';return db[_0xebd8('0x4c')][_0xebd8('0x44')]({'where':{'name':_0x3d4759,'userProfileId':_0x13c4e3[_0xebd8('0x4d')]},'raw':!![]})[_0xebd8('0x24')](function(_0x35ced3){if(_0x35ced3&&_0x35ced3[_0xebd8('0x55')]===0x0){return db[_0xebd8('0x26')][_0xebd8('0x46')]({'name':_0x4ac20c[_0xebd8('0x27')],'resourceId':_0x4ac20c['id'],'type':_0x35ced3[_0xebd8('0x27')],'sectionId':_0x35ced3['id']},{})[_0xebd8('0x24')](function(){return _0x35c706;});}else{return _0x35c706;}})[_0xebd8('0x45')](function(_0x17ec1c){logger['error'](_0xebd8('0x4f'),_0x17ec1c);throw _0x17ec1c;});}return _0x35c706;});}})['then'](respondWithResult(_0x485033,0xc9))[_0xebd8('0x45')](handleError(_0x485033,null));};exports[_0xebd8('0x23')]=function(_0x4a1a38,_0x50b64f){if(_0x4a1a38[_0xebd8('0x47')]['id']){delete _0x4a1a38['body']['id'];}return db['JscriptyProject'][_0xebd8('0x44')]({'where':{'id':_0x4a1a38[_0xebd8('0x51')]['id']}})[_0xebd8('0x24')](handleEntityNotFound(_0x50b64f,null))[_0xebd8('0x24')](saveUpdates(_0x4a1a38[_0xebd8('0x47')],null))[_0xebd8('0x24')](respondWithResult(_0x50b64f,null))[_0xebd8('0x45')](handleError(_0x50b64f,null));};exports[_0xebd8('0x25')]=function(_0x3b7ee4,_0x4f20be){return db[_0xebd8('0x3d')][_0xebd8('0x44')]({'where':{'id':_0x3b7ee4['params']['id']}})[_0xebd8('0x24')](handleEntityNotFound(_0x4f20be,null))[_0xebd8('0x24')](removeEntity(_0x4f20be,null))[_0xebd8('0x45')](handleError(_0x4f20be,null));};exports['getSessions']=function(_0x16b3bc,_0x5e2db8,_0x27ba25){var _0x5fb38f={'raw':!![],'where':{}};var _0x5f042a={};var _0x459e90={'count':0x0,'rows':[]};return db[_0xebd8('0x3d')][_0xebd8('0x56')]({'where':{'id':_0x16b3bc['params']['id']}})[_0xebd8('0x24')](handleEntityNotFound(_0x5e2db8,null))[_0xebd8('0x24')](function(_0x9608a4){if(_0x9608a4){_0x5f042a[_0xebd8('0x2c')]=_['keys'](db['JscriptySessionReport'][_0xebd8('0x42')]);_0x5f042a['query']=_[_0xebd8('0x2e')](_0x16b3bc[_0xebd8('0x2d')]);_0x5f042a['filters']=_[_0xebd8('0x30')](_0x5f042a['model'],_0x5f042a['query']);_0x5fb38f[_0xebd8('0x31')]=_['intersection'](_0x5f042a[_0xebd8('0x2c')],qs[_0xebd8('0x32')](_0x16b3bc['query'][_0xebd8('0x32')]));_0x5fb38f[_0xebd8('0x31')]=_0x5fb38f[_0xebd8('0x31')][_0xebd8('0x43')]?_0x5fb38f[_0xebd8('0x31')]:_0x5f042a['model'];if(!_0x16b3bc['query'][_0xebd8('0x33')](_0xebd8('0x34'))){_0x5fb38f[_0xebd8('0x1c')]=qs['limit'](_0x16b3bc['query'][_0xebd8('0x1c')]);_0x5fb38f[_0xebd8('0x1a')]=qs['offset'](_0x16b3bc[_0xebd8('0x2d')][_0xebd8('0x1a')]);}_0x5fb38f[_0xebd8('0x35')]=qs[_0xebd8('0x36')](_0x16b3bc[_0xebd8('0x2d')][_0xebd8('0x36')]);_0x5fb38f[_0xebd8('0x39')]=qs[_0xebd8('0x2f')](_[_0xebd8('0x37')](_0x16b3bc[_0xebd8('0x2d')],_0x5f042a[_0xebd8('0x2f')]));_0x5fb38f[_0xebd8('0x39')][_0xebd8('0x57')]=_0x9608a4['id'];if(_0x16b3bc[_0xebd8('0x2d')][_0xebd8('0x38')]){_0x5fb38f[_0xebd8('0x39')]=_[_0xebd8('0x3a')](_0x5fb38f['where'],{'$or':_['map'](_0x5fb38f[_0xebd8('0x31')],function(_0x17ddd8){var _0x5b58d8={};_0x5b58d8[_0x17ddd8]={'$like':'%'+_0x16b3bc['query'][_0xebd8('0x38')]+'%'};return _0x5b58d8;})});}_0x5fb38f=_[_0xebd8('0x3a')]({},_0x5fb38f,_0x16b3bc[_0xebd8('0x3c')]);return db[_0xebd8('0x58')]['count']({'where':_0x5fb38f[_0xebd8('0x39')]})[_0xebd8('0x24')](function(_0x583b1b){_0x459e90[_0xebd8('0x1d')]=_0x583b1b;if(_0x16b3bc[_0xebd8('0x2d')][_0xebd8('0x3e')]){_0x5fb38f[_0xebd8('0x3f')]=[{'all':!![]}];}return db[_0xebd8('0x58')]['findAll'](_0x5fb38f);})[_0xebd8('0x24')](function(_0x4924c1){_0x459e90[_0xebd8('0x59')]=_0x4924c1;return _0x459e90;});}})[_0xebd8('0x24')](respondWithFilteredResult(_0x5e2db8,_0x5fb38f))[_0xebd8('0x45')](handleError(_0x5e2db8,null));};exports[_0xebd8('0x5a')]=function(_0x3d38c9,_0x48be29,_0x3e1f14){var _0x10df77={'raw':!![],'where':{}};var _0x1cc9cb={};var _0x339d67={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xebd8('0x56')]({'where':{'id':_0x3d38c9['params']['id']}})[_0xebd8('0x24')](handleEntityNotFound(_0x48be29,null))[_0xebd8('0x24')](function(_0x151a01){if(_0x151a01){_0x1cc9cb[_0xebd8('0x2c')]=_[_0xebd8('0x2e')](db[_0xebd8('0x5b')][_0xebd8('0x42')]);_0x1cc9cb['query']=_[_0xebd8('0x2e')](_0x3d38c9['query']);_0x1cc9cb[_0xebd8('0x2f')]=_[_0xebd8('0x30')](_0x1cc9cb[_0xebd8('0x2c')],_0x1cc9cb[_0xebd8('0x2d')]);_0x10df77['attributes']=_[_0xebd8('0x30')](_0x1cc9cb[_0xebd8('0x2c')],qs[_0xebd8('0x32')](_0x3d38c9[_0xebd8('0x2d')][_0xebd8('0x32')]));_0x10df77[_0xebd8('0x31')]=_0x10df77[_0xebd8('0x31')][_0xebd8('0x43')]?_0x10df77[_0xebd8('0x31')]:_0x1cc9cb['model'];if(!_0x3d38c9[_0xebd8('0x2d')]['hasOwnProperty'](_0xebd8('0x34'))){_0x10df77[_0xebd8('0x1c')]=qs[_0xebd8('0x1c')](_0x3d38c9['query'][_0xebd8('0x1c')]);_0x10df77[_0xebd8('0x1a')]=qs['offset'](_0x3d38c9[_0xebd8('0x2d')][_0xebd8('0x1a')]);}_0x10df77['order']=qs['sort'](_0x3d38c9['query'][_0xebd8('0x36')]);_0x10df77['where']=qs[_0xebd8('0x2f')](_['pick'](_0x3d38c9[_0xebd8('0x2d')],_0x1cc9cb[_0xebd8('0x2f')]));_0x10df77[_0xebd8('0x39')]['ProjectId']=_0x151a01['id'];if(_0x3d38c9[_0xebd8('0x2d')]['filter']){_0x10df77[_0xebd8('0x39')]=_[_0xebd8('0x3a')](_0x10df77[_0xebd8('0x39')],{'$or':_[_0xebd8('0x29')](_0x10df77[_0xebd8('0x31')],function(_0x331045){var _0x3f88fd={};_0x3f88fd[_0x331045]={'$like':'%'+_0x3d38c9[_0xebd8('0x2d')][_0xebd8('0x38')]+'%'};return _0x3f88fd;})});}_0x10df77=_[_0xebd8('0x3a')]({},_0x10df77,_0x3d38c9[_0xebd8('0x3c')]);return db[_0xebd8('0x5b')][_0xebd8('0x1d')]({'where':_0x10df77[_0xebd8('0x39')]})[_0xebd8('0x24')](function(_0x6bd1ba){_0x339d67[_0xebd8('0x1d')]=_0x6bd1ba;if(_0x3d38c9[_0xebd8('0x2d')][_0xebd8('0x3e')]){_0x10df77[_0xebd8('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xebd8('0x40')](_0x10df77);})[_0xebd8('0x24')](function(_0x3ea149){_0x339d67[_0xebd8('0x59')]=_0x3ea149;return _0x339d67;});}})['then'](respondWithFilteredResult(_0x48be29,_0x10df77))['catch'](handleError(_0x48be29,null));};function char(_0x7a4651){return _0xebd8('0x5c')===typeof _0x7a4651?String[_0xebd8('0x5d')]['apply'](null,arguments):_0x7a4651;}function needsEncapsulation(_0x2b5838){return!!_0x2b5838&&(_0x2b5838['toString']()[_0xebd8('0x5e')](char(0xd))>=0x0||_0x2b5838[_0xebd8('0x5f')]()[_0xebd8('0x5e')](char(0xa))>=0x0||_0x2b5838[_0xebd8('0x5f')]()[_0xebd8('0x5e')](char(0x2c))>=0x0||_0x2b5838[_0xebd8('0x5f')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x51af30){var _0x5da0e7=char(0x22),_0x557e8e='\x5c'+char(0x22),_0x338307=_0x51af30[_0xebd8('0x5f')]()[_0xebd8('0x60')](new RegExp(_0x5da0e7,'g'),_0x557e8e);return _0x5da0e7+_0x338307+_0x5da0e7;}exports['getSummary']=function(_0x9817f0,_0x5c7011,_0x518887){var _0xc27363,_0x3f9eda;var _0xbc809f={'where':{'ProjectId':_0x9817f0[_0xebd8('0x51')]['id']}};if(_0x9817f0[_0xebd8('0x2d')][_0xebd8('0x61')]){_0xbc809f[_0xebd8('0x39')]['starttime']=JSON['parse'](_0x9817f0[_0xebd8('0x2d')]['startTime']);}return db[_0xebd8('0x58')][_0xebd8('0x40')](_0xbc809f)[_0xebd8('0x24')](handleEntityNotFound(_0x5c7011,null))[_0xebd8('0x24')](function(_0x4779c4){if(_0x4779c4){_0xc27363=_0x4779c4;return db[_0xebd8('0x62')][_0xebd8('0x40')]({'where':{'SessionId':{'$in':_['map'](_0xc27363,'id')},'ProjectId':_0x9817f0[_0xebd8('0x51')]['id']},'order':'-createdAt'});}})[_0xebd8('0x24')](handleEntityNotFound(_0x5c7011,null))['then'](function(_0x20c15e){if(_0x20c15e){_0x3f9eda=_0x20c15e;var _0x410e22={};for(var _0x3c4f05=0x0,_0x13d2d1=_0x3f9eda[_0xebd8('0x43')];_0x3c4f05<_0x13d2d1;_0x3c4f05++){if(!_0x410e22[_0xebd8('0x33')](_0x3f9eda[_0x3c4f05]['questionId'])){_0x410e22[_0x3f9eda[_0x3c4f05][_0xebd8('0x63')]]=needsEncapsulation(_0x3f9eda[_0x3c4f05]['question'])?encapsulate(_0x3f9eda[_0x3c4f05][_0xebd8('0x64')]):_0x3f9eda[_0x3c4f05][_0xebd8('0x64')];}}var _0x5335ef=[],_0x5a4166={};for(var _0x2398bd=0x0,_0x16c1f1=_0xc27363['length'];_0x2398bd<_0x16c1f1;_0x2398bd++){_0x5a4166={'ProjectId':_0x9817f0['params']['id'],'SessionId':_0xc27363[_0x2398bd]['id'],'StartTime':moment(_0xc27363[_0x2398bd][_0xebd8('0x65')])[_0xebd8('0x66')](_0xebd8('0x67'))};for(var _0x2cbbaa=0x0,_0x4b0612=_0x3f9eda[_0xebd8('0x43')];_0x2cbbaa<_0x4b0612;_0x2cbbaa++){if(_0x3f9eda[_0x2cbbaa][_0xebd8('0x68')]==_0xc27363[_0x2398bd]['id']&&_0x410e22[_0xebd8('0x33')](_0x3f9eda[_0x2cbbaa]['questionId'])){_0x5a4166[_0x410e22[_0x3f9eda[_0x2cbbaa]['questionId']]]=_0x3f9eda[_0x2cbbaa]['answer'];}}for(var _0x44d6a9 in _0x410e22){if(!_0x5a4166[_0xebd8('0x33')](_0x410e22[_0x44d6a9])){_0x5a4166[_0x410e22[_0x44d6a9]]=null;}}_0x5335ef[_0xebd8('0x69')](_0x5a4166);}return _0x5335ef;}})[_0xebd8('0x24')](function(_0x1e05a0){if(!_[_0xebd8('0x6a')](_0x1e05a0)){var _0xa2eb72=toCsv(_0x1e05a0);var _0x50b6a9=Date[_0xebd8('0x6b')]();fs[_0xebd8('0x6c')](util['format'](_0xebd8('0x6d'),_0x9817f0[_0xebd8('0x51')]['id'],_0x50b6a9),_0xa2eb72);_0x5c7011[_0xebd8('0x6e')](_0xebd8('0x6f'),_0xebd8('0x70')+util[_0xebd8('0x66')](_0xebd8('0x71'),_0x9817f0[_0xebd8('0x51')]['id'],_0x50b6a9));_0x5c7011[_0xebd8('0x6e')](_0xebd8('0x72'),_0xebd8('0x73'));return _0x5c7011[_0xebd8('0x74')](util[_0xebd8('0x66')](_0xebd8('0x6d'),_0x9817f0[_0xebd8('0x51')]['id'],_0x50b6a9));}else{return _0x5c7011['sendStatus'](0xcc);}})[_0xebd8('0x45')](handleError(_0x5c7011,null));}; \ No newline at end of file +var _0x3eaf=['include','rows','catch','show','find','create','get','role','user','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','updatedAt','body','userProfileId','autoAssociation','findOne','JscriptySessionReport','nolimit','order','ProjectId','JscriptyAnswerReport','findAll','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','Projects','destroy','error','stack','name','index','map','JscriptyProject','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll'];(function(_0x2e5d16,_0x46d89f){var _0x43b77b=function(_0x545945){while(--_0x545945){_0x2e5d16['push'](_0x2e5d16['shift']());}};_0x43b77b(++_0x46d89f);}(_0x3eaf,0x190));var _0xf3ea=function(_0x5808a3,_0x486ebe){_0x5808a3=_0x5808a3-0x0;var _0x4c709d=_0x3eaf[_0x5808a3];return _0x4c709d;};'use strict';var emlformat=require(_0xf3ea('0x0'));var rimraf=require(_0xf3ea('0x1'));var zipdir=require(_0xf3ea('0x2'));var jsonpatch=require(_0xf3ea('0x3'));var rp=require(_0xf3ea('0x4'));var moment=require(_0xf3ea('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf3ea('0x6'));var util=require(_0xf3ea('0x7'));var path=require(_0xf3ea('0x8'));var sox=require('sox');var csv=require(_0xf3ea('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3ea('0xa'));var _=require(_0xf3ea('0xb'));var squel=require(_0xf3ea('0xc'));var crypto=require('crypto');var jsforce=require(_0xf3ea('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf3ea('0x9'));var querystring=require(_0xf3ea('0xe'));var Papa=require('papaparse');var Redis=require(_0xf3ea('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf3ea('0x10'));var as=require(_0xf3ea('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf3ea('0x12'));var utils=require(_0xf3ea('0x13'));var config=require(_0xf3ea('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3ea('0x15'))['db'];function respondWithStatusCode(_0x174c19,_0x146c8a){_0x146c8a=_0x146c8a||0xcc;return function(_0x4c3801){if(_0x4c3801){return _0x174c19[_0xf3ea('0x16')](_0x146c8a);}return _0x174c19[_0xf3ea('0x17')](_0x146c8a)[_0xf3ea('0x18')]();};}function respondWithResult(_0x462567,_0x25e16a){_0x25e16a=_0x25e16a||0xc8;return function(_0x212521){if(_0x212521){return _0x462567[_0xf3ea('0x17')](_0x25e16a)[_0xf3ea('0x19')](_0x212521);}};}function respondWithFilteredResult(_0x56fa75,_0x46f3c4){return function(_0x5a560b){if(_0x5a560b){var _0x56d00f=typeof _0x46f3c4[_0xf3ea('0x1a')]==='undefined'&&typeof _0x46f3c4[_0xf3ea('0x1b')]===_0xf3ea('0x1c');var _0x24f0ac=_0x5a560b[_0xf3ea('0x1d')];var _0x4806fb=_0x56d00f?0x0:_0x46f3c4[_0xf3ea('0x1a')];var _0x1806ec=_0x56d00f?_0x5a560b[_0xf3ea('0x1d')]:_0x46f3c4[_0xf3ea('0x1a')]+_0x46f3c4[_0xf3ea('0x1b')];var _0x4fb6c0;if(_0x1806ec>=_0x24f0ac){_0x1806ec=_0x24f0ac;_0x4fb6c0=0xc8;}else{_0x4fb6c0=0xce;}_0x56fa75['status'](_0x4fb6c0);return _0x56fa75[_0xf3ea('0x1e')](_0xf3ea('0x1f'),_0x4806fb+'-'+_0x1806ec+'/'+_0x24f0ac)['json'](_0x5a560b);}return null;};}function patchUpdates(_0x2c7419){return function(_0x42f13c){try{jsonpatch[_0xf3ea('0x20')](_0x42f13c,_0x2c7419,!![]);}catch(_0xc85489){return BPromise[_0xf3ea('0x21')](_0xc85489);}return _0x42f13c[_0xf3ea('0x22')]();};}function saveUpdates(_0x134b7d,_0x27d607){return function(_0x34ec8f){if(_0x34ec8f){return _0x34ec8f[_0xf3ea('0x23')](_0x134b7d)[_0xf3ea('0x24')](function(_0x591fca){return _0x591fca;});}return null;};}function removeEntity(_0x2aee66,_0x23ed4a){return function(_0x5931e1){if(_0x5931e1){return _0x5931e1['destroy']()['then'](function(){var _0x1e96bd=_0x5931e1['get']({'plain':!![]});var _0x2e089a=_0xf3ea('0x25');return db['UserProfileResource'][_0xf3ea('0x26')]({'where':{'type':_0x2e089a,'resourceId':_0x1e96bd['id']}})[_0xf3ea('0x24')](function(){return _0x5931e1;});})[_0xf3ea('0x24')](function(){_0x2aee66[_0xf3ea('0x17')](0xcc)[_0xf3ea('0x18')]();});}};}function handleEntityNotFound(_0x5b91e9,_0x5338ae){return function(_0x4a7c07){if(!_0x4a7c07){_0x5b91e9['sendStatus'](0x194);}return _0x4a7c07;};}function handleError(_0x89086,_0x199c76){_0x199c76=_0x199c76||0x1f4;return function(_0x120232){logger[_0xf3ea('0x27')](_0x120232[_0xf3ea('0x28')]);if(_0x120232[_0xf3ea('0x29')]){delete _0x120232[_0xf3ea('0x29')];}_0x89086[_0xf3ea('0x17')](_0x199c76)['send'](_0x120232);};}exports[_0xf3ea('0x2a')]=function(_0x98bf71,_0x246103){var _0x2e623a={},_0x9c5d48={},_0x35abd3={'count':0x0,'rows':[]};var _0x7508d7=_[_0xf3ea('0x2b')](db[_0xf3ea('0x2c')][_0xf3ea('0x2d')],function(_0x5aa84d){return{'name':_0x5aa84d['fieldName'],'type':_0x5aa84d[_0xf3ea('0x2e')][_0xf3ea('0x2f')]};});_0x9c5d48[_0xf3ea('0x30')]=_[_0xf3ea('0x2b')](_0x7508d7,_0xf3ea('0x29'));_0x9c5d48[_0xf3ea('0x31')]=_[_0xf3ea('0x32')](_0x98bf71[_0xf3ea('0x31')]);_0x9c5d48[_0xf3ea('0x33')]=_['intersection'](_0x9c5d48[_0xf3ea('0x30')],_0x9c5d48[_0xf3ea('0x31')]);_0x2e623a[_0xf3ea('0x34')]=_[_0xf3ea('0x35')](_0x9c5d48[_0xf3ea('0x30')],qs[_0xf3ea('0x36')](_0x98bf71[_0xf3ea('0x31')][_0xf3ea('0x36')]));_0x2e623a[_0xf3ea('0x34')]=_0x2e623a[_0xf3ea('0x34')][_0xf3ea('0x37')]?_0x2e623a[_0xf3ea('0x34')]:_0x9c5d48[_0xf3ea('0x30')];if(!_0x98bf71[_0xf3ea('0x31')][_0xf3ea('0x38')]('nolimit')){_0x2e623a['limit']=qs[_0xf3ea('0x1b')](_0x98bf71[_0xf3ea('0x31')][_0xf3ea('0x1b')]);_0x2e623a['offset']=qs[_0xf3ea('0x1a')](_0x98bf71['query'][_0xf3ea('0x1a')]);}_0x2e623a['order']=qs[_0xf3ea('0x39')](_0x98bf71['query'][_0xf3ea('0x39')]);_0x2e623a[_0xf3ea('0x3a')]=qs[_0xf3ea('0x33')](_[_0xf3ea('0x3b')](_0x98bf71[_0xf3ea('0x31')],_0x9c5d48[_0xf3ea('0x33')]),_0x7508d7);if(_0x98bf71[_0xf3ea('0x31')][_0xf3ea('0x3c')]){_0x2e623a[_0xf3ea('0x3a')]=_[_0xf3ea('0x3d')](_0x2e623a[_0xf3ea('0x3a')],{'$or':_['map'](_0x7508d7,function(_0x2920be){if(_0x2920be['type']!=='VIRTUAL'){var _0x620a9b={};_0x620a9b[_0x2920be[_0xf3ea('0x29')]]={'$like':'%'+_0x98bf71[_0xf3ea('0x31')]['filter']+'%'};return _0x620a9b;}})});}_0x2e623a=_[_0xf3ea('0x3d')]({},_0x2e623a,_0x98bf71[_0xf3ea('0x3e')]);var _0x50dfec={'where':_0x2e623a[_0xf3ea('0x3a')]};return db[_0xf3ea('0x2c')][_0xf3ea('0x1d')](_0x50dfec)[_0xf3ea('0x24')](function(_0x4adffc){_0x35abd3[_0xf3ea('0x1d')]=_0x4adffc;if(_0x98bf71[_0xf3ea('0x31')][_0xf3ea('0x3f')]){_0x2e623a[_0xf3ea('0x40')]=[{'all':!![]}];}return db[_0xf3ea('0x2c')]['findAll'](_0x2e623a);})[_0xf3ea('0x24')](function(_0xe09c97){_0x35abd3[_0xf3ea('0x41')]=_0xe09c97;return _0x35abd3;})[_0xf3ea('0x24')](respondWithFilteredResult(_0x246103,_0x2e623a))[_0xf3ea('0x42')](handleError(_0x246103,null));};exports[_0xf3ea('0x43')]=function(_0x3106cd,_0x46c8ec){var _0x132ece={'raw':![],'where':{'id':_0x3106cd['params']['id']}},_0x22b81f={};_0x22b81f[_0xf3ea('0x30')]=_[_0xf3ea('0x32')](db['JscriptyProject'][_0xf3ea('0x2d')]);_0x22b81f['query']=_[_0xf3ea('0x32')](_0x3106cd['query']);_0x22b81f['filters']=_[_0xf3ea('0x35')](_0x22b81f[_0xf3ea('0x30')],_0x22b81f[_0xf3ea('0x31')]);_0x132ece[_0xf3ea('0x34')]=_[_0xf3ea('0x35')](_0x22b81f[_0xf3ea('0x30')],qs['fields'](_0x3106cd[_0xf3ea('0x31')][_0xf3ea('0x36')]));_0x132ece[_0xf3ea('0x34')]=_0x132ece[_0xf3ea('0x34')]['length']?_0x132ece[_0xf3ea('0x34')]:_0x22b81f['model'];if(_0x3106cd[_0xf3ea('0x31')]['includeAll']){_0x132ece[_0xf3ea('0x40')]=[{'all':!![]}];}_0x132ece=_[_0xf3ea('0x3d')]({},_0x132ece,_0x3106cd['options']);return db[_0xf3ea('0x2c')][_0xf3ea('0x44')](_0x132ece)[_0xf3ea('0x24')](handleEntityNotFound(_0x46c8ec,null))['then'](respondWithResult(_0x46c8ec,null))['catch'](handleError(_0x46c8ec,null));};exports[_0xf3ea('0x45')]=function(_0xea830e,_0x34dcdc){return db[_0xf3ea('0x2c')]['create'](_0xea830e['body'],{})[_0xf3ea('0x24')](function(_0x3dd7e5){var _0x3f3217=_0xea830e['user'][_0xf3ea('0x46')]({'plain':!![]});if(!_0x3f3217)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f3217[_0xf3ea('0x47')]===_0xf3ea('0x48')){var _0x366202=_0x3dd7e5[_0xf3ea('0x46')]({'plain':!![]});var _0x5aa381=_0xf3ea('0x25');return db['UserProfileSection'][_0xf3ea('0x44')]({'where':{'name':_0x5aa381,'userProfileId':_0x3f3217['userProfileId']},'raw':!![]})[_0xf3ea('0x24')](function(_0x24f3ae){if(_0x24f3ae&&_0x24f3ae['autoAssociation']===0x0){return db[_0xf3ea('0x49')][_0xf3ea('0x45')]({'name':_0x366202[_0xf3ea('0x29')],'resourceId':_0x366202['id'],'type':_0x24f3ae[_0xf3ea('0x29')],'sectionId':_0x24f3ae['id']},{})['then'](function(){return _0x3dd7e5;});}else{return _0x3dd7e5;}})[_0xf3ea('0x42')](function(_0x5b71d6){logger['error'](_0xf3ea('0x4a'),_0x5b71d6);throw _0x5b71d6;});}return _0x3dd7e5;})[_0xf3ea('0x24')](respondWithResult(_0x34dcdc,0xc9))[_0xf3ea('0x42')](handleError(_0x34dcdc,null));};exports[_0xf3ea('0x4b')]=function(_0x58e9b2,_0x360836){var _0xa3e103={'where':{'id':_0x58e9b2[_0xf3ea('0x4c')]['id']}},_0x487af2={};_0x487af2[_0xf3ea('0x30')]=_[_0xf3ea('0x32')](db[_0xf3ea('0x2c')][_0xf3ea('0x2d')]);_0xa3e103[_0xf3ea('0x34')]=_[_0xf3ea('0x35')](_0x487af2[_0xf3ea('0x30')],qs['fields'](_0x58e9b2['query'][_0xf3ea('0x36')]));_0xa3e103[_0xf3ea('0x34')]=_0xa3e103[_0xf3ea('0x34')]['length']?_0xa3e103[_0xf3ea('0x34')]:_0x487af2[_0xf3ea('0x30')];if(_0x58e9b2[_0xf3ea('0x31')][_0xf3ea('0x3f')]){_0xa3e103['include']=[{'all':!![]}];}_0xa3e103=_[_0xf3ea('0x3d')]({},_0xa3e103,_0x58e9b2['options']);return db[_0xf3ea('0x2c')][_0xf3ea('0x44')](_0xa3e103)[_0xf3ea('0x24')](handleEntityNotFound(_0x360836,null))['then'](function(_0x3cb8ec){if(_0x3cb8ec){var _0x5c28d6=_0x3cb8ec[_0xf3ea('0x46')]({'plain':!![]});_0x5c28d6=qs['omit'](_0x5c28d6,['id','createdAt',_0xf3ea('0x4d')]);_0x58e9b2[_0xf3ea('0x4e')]=_['omit'](_0x58e9b2[_0xf3ea('0x4e')],['id','createdAt',_0xf3ea('0x4d')]);return db['JscriptyProject'][_0xf3ea('0x45')](_[_0xf3ea('0x3d')](_0x5c28d6,_0x58e9b2['body']),{'include':_0x58e9b2['query'][_0xf3ea('0x3f')]?[{'all':!![]}]:undefined})[_0xf3ea('0x24')](function(_0x93c9f5){var _0x40775a=_0x58e9b2['user']['get']({'plain':!![]});if(!_0x40775a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40775a[_0xf3ea('0x47')]===_0xf3ea('0x48')){var _0x5d820e=_0x93c9f5[_0xf3ea('0x46')]({'plain':!![]});var _0x123779=_0xf3ea('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x123779,'userProfileId':_0x40775a[_0xf3ea('0x4f')]},'raw':!![]})[_0xf3ea('0x24')](function(_0x367a62){if(_0x367a62&&_0x367a62[_0xf3ea('0x50')]===0x0){return db[_0xf3ea('0x49')][_0xf3ea('0x45')]({'name':_0x5d820e[_0xf3ea('0x29')],'resourceId':_0x5d820e['id'],'type':_0x367a62[_0xf3ea('0x29')],'sectionId':_0x367a62['id']},{})[_0xf3ea('0x24')](function(){return _0x93c9f5;});}else{return _0x93c9f5;}})[_0xf3ea('0x42')](function(_0x3cbe1c){logger[_0xf3ea('0x27')](_0xf3ea('0x4a'),_0x3cbe1c);throw _0x3cbe1c;});}return _0x93c9f5;});}})[_0xf3ea('0x24')](respondWithResult(_0x360836,0xc9))['catch'](handleError(_0x360836,null));};exports[_0xf3ea('0x23')]=function(_0xf18ba0,_0x373d45){if(_0xf18ba0[_0xf3ea('0x4e')]['id']){delete _0xf18ba0[_0xf3ea('0x4e')]['id'];}return db[_0xf3ea('0x2c')]['find']({'where':{'id':_0xf18ba0[_0xf3ea('0x4c')]['id']}})[_0xf3ea('0x24')](handleEntityNotFound(_0x373d45,null))[_0xf3ea('0x24')](saveUpdates(_0xf18ba0[_0xf3ea('0x4e')],null))[_0xf3ea('0x24')](respondWithResult(_0x373d45,null))[_0xf3ea('0x42')](handleError(_0x373d45,null));};exports[_0xf3ea('0x26')]=function(_0x1cc791,_0x400735){return db[_0xf3ea('0x2c')]['find']({'where':{'id':_0x1cc791[_0xf3ea('0x4c')]['id']}})[_0xf3ea('0x24')](handleEntityNotFound(_0x400735,null))[_0xf3ea('0x24')](removeEntity(_0x400735,null))[_0xf3ea('0x42')](handleError(_0x400735,null));};exports['getSessions']=function(_0x36ec7f,_0x275a75,_0x198cbb){var _0x10ac96={'raw':!![],'where':{}};var _0x1cc231={};var _0x468add={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xf3ea('0x51')]({'where':{'id':_0x36ec7f[_0xf3ea('0x4c')]['id']}})[_0xf3ea('0x24')](handleEntityNotFound(_0x275a75,null))[_0xf3ea('0x24')](function(_0x546c41){if(_0x546c41){_0x1cc231['model']=_['keys'](db[_0xf3ea('0x52')][_0xf3ea('0x2d')]);_0x1cc231[_0xf3ea('0x31')]=_[_0xf3ea('0x32')](_0x36ec7f[_0xf3ea('0x31')]);_0x1cc231['filters']=_['intersection'](_0x1cc231[_0xf3ea('0x30')],_0x1cc231['query']);_0x10ac96[_0xf3ea('0x34')]=_[_0xf3ea('0x35')](_0x1cc231[_0xf3ea('0x30')],qs[_0xf3ea('0x36')](_0x36ec7f[_0xf3ea('0x31')][_0xf3ea('0x36')]));_0x10ac96[_0xf3ea('0x34')]=_0x10ac96[_0xf3ea('0x34')][_0xf3ea('0x37')]?_0x10ac96['attributes']:_0x1cc231['model'];if(!_0x36ec7f['query'][_0xf3ea('0x38')](_0xf3ea('0x53'))){_0x10ac96[_0xf3ea('0x1b')]=qs['limit'](_0x36ec7f[_0xf3ea('0x31')][_0xf3ea('0x1b')]);_0x10ac96['offset']=qs[_0xf3ea('0x1a')](_0x36ec7f[_0xf3ea('0x31')][_0xf3ea('0x1a')]);}_0x10ac96[_0xf3ea('0x54')]=qs[_0xf3ea('0x39')](_0x36ec7f[_0xf3ea('0x31')][_0xf3ea('0x39')]);_0x10ac96[_0xf3ea('0x3a')]=qs['filters'](_[_0xf3ea('0x3b')](_0x36ec7f[_0xf3ea('0x31')],_0x1cc231[_0xf3ea('0x33')]));_0x10ac96[_0xf3ea('0x3a')][_0xf3ea('0x55')]=_0x546c41['id'];if(_0x36ec7f['query'][_0xf3ea('0x3c')]){_0x10ac96[_0xf3ea('0x3a')]=_[_0xf3ea('0x3d')](_0x10ac96[_0xf3ea('0x3a')],{'$or':_[_0xf3ea('0x2b')](_0x10ac96['attributes'],function(_0x1f9ac0){var _0x3d5f18={};_0x3d5f18[_0x1f9ac0]={'$like':'%'+_0x36ec7f[_0xf3ea('0x31')][_0xf3ea('0x3c')]+'%'};return _0x3d5f18;})});}_0x10ac96=_[_0xf3ea('0x3d')]({},_0x10ac96,_0x36ec7f['options']);return db['JscriptySessionReport'][_0xf3ea('0x1d')]({'where':_0x10ac96[_0xf3ea('0x3a')]})[_0xf3ea('0x24')](function(_0x47c8c0){_0x468add['count']=_0x47c8c0;if(_0x36ec7f[_0xf3ea('0x31')][_0xf3ea('0x3f')]){_0x10ac96['include']=[{'all':!![]}];}return db[_0xf3ea('0x52')]['findAll'](_0x10ac96);})[_0xf3ea('0x24')](function(_0x8d6a58){_0x468add[_0xf3ea('0x41')]=_0x8d6a58;return _0x468add;});}})[_0xf3ea('0x24')](respondWithFilteredResult(_0x275a75,_0x10ac96))[_0xf3ea('0x42')](handleError(_0x275a75,null));};exports['getAnswers']=function(_0x3c3803,_0x2c8f48,_0x46129a){var _0x24b75e={'raw':!![],'where':{}};var _0x43de2c={};var _0x17b500={'count':0x0,'rows':[]};return db[_0xf3ea('0x2c')]['findOne']({'where':{'id':_0x3c3803[_0xf3ea('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2c8f48,null))['then'](function(_0x249a6b){if(_0x249a6b){_0x43de2c[_0xf3ea('0x30')]=_[_0xf3ea('0x32')](db[_0xf3ea('0x56')][_0xf3ea('0x2d')]);_0x43de2c[_0xf3ea('0x31')]=_[_0xf3ea('0x32')](_0x3c3803[_0xf3ea('0x31')]);_0x43de2c['filters']=_[_0xf3ea('0x35')](_0x43de2c[_0xf3ea('0x30')],_0x43de2c['query']);_0x24b75e['attributes']=_[_0xf3ea('0x35')](_0x43de2c['model'],qs[_0xf3ea('0x36')](_0x3c3803[_0xf3ea('0x31')][_0xf3ea('0x36')]));_0x24b75e['attributes']=_0x24b75e['attributes'][_0xf3ea('0x37')]?_0x24b75e[_0xf3ea('0x34')]:_0x43de2c[_0xf3ea('0x30')];if(!_0x3c3803[_0xf3ea('0x31')][_0xf3ea('0x38')](_0xf3ea('0x53'))){_0x24b75e[_0xf3ea('0x1b')]=qs[_0xf3ea('0x1b')](_0x3c3803[_0xf3ea('0x31')]['limit']);_0x24b75e['offset']=qs[_0xf3ea('0x1a')](_0x3c3803[_0xf3ea('0x31')]['offset']);}_0x24b75e[_0xf3ea('0x54')]=qs['sort'](_0x3c3803[_0xf3ea('0x31')][_0xf3ea('0x39')]);_0x24b75e[_0xf3ea('0x3a')]=qs[_0xf3ea('0x33')](_[_0xf3ea('0x3b')](_0x3c3803['query'],_0x43de2c[_0xf3ea('0x33')]));_0x24b75e['where'][_0xf3ea('0x55')]=_0x249a6b['id'];if(_0x3c3803[_0xf3ea('0x31')]['filter']){_0x24b75e[_0xf3ea('0x3a')]=_['merge'](_0x24b75e['where'],{'$or':_[_0xf3ea('0x2b')](_0x24b75e[_0xf3ea('0x34')],function(_0x152a31){var _0x528ee4={};_0x528ee4[_0x152a31]={'$like':'%'+_0x3c3803[_0xf3ea('0x31')]['filter']+'%'};return _0x528ee4;})});}_0x24b75e=_[_0xf3ea('0x3d')]({},_0x24b75e,_0x3c3803[_0xf3ea('0x3e')]);return db[_0xf3ea('0x56')][_0xf3ea('0x1d')]({'where':_0x24b75e[_0xf3ea('0x3a')]})[_0xf3ea('0x24')](function(_0x1a3dec){_0x17b500[_0xf3ea('0x1d')]=_0x1a3dec;if(_0x3c3803['query'][_0xf3ea('0x3f')]){_0x24b75e[_0xf3ea('0x40')]=[{'all':!![]}];}return db[_0xf3ea('0x56')][_0xf3ea('0x57')](_0x24b75e);})[_0xf3ea('0x24')](function(_0x1d33b6){_0x17b500[_0xf3ea('0x41')]=_0x1d33b6;return _0x17b500;});}})[_0xf3ea('0x24')](respondWithFilteredResult(_0x2c8f48,_0x24b75e))[_0xf3ea('0x42')](handleError(_0x2c8f48,null));};function char(_0x569330){return _0xf3ea('0x58')===typeof _0x569330?String[_0xf3ea('0x59')][_0xf3ea('0x20')](null,arguments):_0x569330;}function needsEncapsulation(_0x4217b0){return!!_0x4217b0&&(_0x4217b0[_0xf3ea('0x5a')]()[_0xf3ea('0x5b')](char(0xd))>=0x0||_0x4217b0[_0xf3ea('0x5a')]()['indexOf'](char(0xa))>=0x0||_0x4217b0[_0xf3ea('0x5a')]()[_0xf3ea('0x5b')](char(0x2c))>=0x0||_0x4217b0[_0xf3ea('0x5a')]()[_0xf3ea('0x5b')](char(0x22))>=0x0);}function encapsulate(_0x165fd4){var _0x3770ee=char(0x22),_0x191f66='\x5c'+char(0x22),_0x3009fa=_0x165fd4[_0xf3ea('0x5a')]()[_0xf3ea('0x5c')](new RegExp(_0x3770ee,'g'),_0x191f66);return _0x3770ee+_0x3009fa+_0x3770ee;}exports[_0xf3ea('0x5d')]=function(_0x5e6768,_0xf6c7d,_0x36029f){var _0xea103,_0x74c76d;var _0x76aa08={'where':{'ProjectId':_0x5e6768[_0xf3ea('0x4c')]['id']}};if(_0x5e6768[_0xf3ea('0x31')][_0xf3ea('0x5e')]){_0x76aa08[_0xf3ea('0x3a')]['starttime']=JSON[_0xf3ea('0x5f')](_0x5e6768[_0xf3ea('0x31')]['startTime']);}return db['JscriptySessionReport'][_0xf3ea('0x57')](_0x76aa08)[_0xf3ea('0x24')](handleEntityNotFound(_0xf6c7d,null))['then'](function(_0x369781){if(_0x369781){_0xea103=_0x369781;return db[_0xf3ea('0x60')]['findAll']({'where':{'SessionId':{'$in':_[_0xf3ea('0x2b')](_0xea103,'id')},'ProjectId':_0x5e6768[_0xf3ea('0x4c')]['id']},'order':_0xf3ea('0x61')});}})[_0xf3ea('0x24')](handleEntityNotFound(_0xf6c7d,null))[_0xf3ea('0x24')](function(_0x25fac6){if(_0x25fac6){_0x74c76d=_0x25fac6;var _0x2ec297={};for(var _0x34f7dd=0x0,_0x2d94d9=_0x74c76d[_0xf3ea('0x37')];_0x34f7dd<_0x2d94d9;_0x34f7dd++){if(!_0x2ec297[_0xf3ea('0x38')](_0x74c76d[_0x34f7dd][_0xf3ea('0x62')])){_0x2ec297[_0x74c76d[_0x34f7dd][_0xf3ea('0x62')]]=needsEncapsulation(_0x74c76d[_0x34f7dd][_0xf3ea('0x63')])?encapsulate(_0x74c76d[_0x34f7dd][_0xf3ea('0x63')]):_0x74c76d[_0x34f7dd][_0xf3ea('0x63')];}}var _0x309ffb=[],_0x142196={};for(var _0x5b0fbb=0x0,_0xcca54c=_0xea103['length'];_0x5b0fbb<_0xcca54c;_0x5b0fbb++){_0x142196={'ProjectId':_0x5e6768[_0xf3ea('0x4c')]['id'],'SessionId':_0xea103[_0x5b0fbb]['id'],'StartTime':moment(_0xea103[_0x5b0fbb][_0xf3ea('0x64')])[_0xf3ea('0x65')](_0xf3ea('0x66'))};for(var _0xcb8804=0x0,_0x513d01=_0x74c76d[_0xf3ea('0x37')];_0xcb8804<_0x513d01;_0xcb8804++){if(_0x74c76d[_0xcb8804][_0xf3ea('0x67')]==_0xea103[_0x5b0fbb]['id']&&_0x2ec297[_0xf3ea('0x38')](_0x74c76d[_0xcb8804]['questionId'])){_0x142196[_0x2ec297[_0x74c76d[_0xcb8804]['questionId']]]=_0x74c76d[_0xcb8804][_0xf3ea('0x68')];}}for(var _0xc43017 in _0x2ec297){if(!_0x142196[_0xf3ea('0x38')](_0x2ec297[_0xc43017])){_0x142196[_0x2ec297[_0xc43017]]=null;}}_0x309ffb[_0xf3ea('0x69')](_0x142196);}return _0x309ffb;}})[_0xf3ea('0x24')](function(_0x2775d2){if(!_[_0xf3ea('0x6a')](_0x2775d2)){var _0x2ef37b=toCsv(_0x2775d2);var _0x1441c5=Date[_0xf3ea('0x6b')]();fs['writeFileSync'](util[_0xf3ea('0x65')](_0xf3ea('0x6c'),_0x5e6768[_0xf3ea('0x4c')]['id'],_0x1441c5),_0x2ef37b);_0xf6c7d[_0xf3ea('0x6d')](_0xf3ea('0x6e'),_0xf3ea('0x6f')+util[_0xf3ea('0x65')](_0xf3ea('0x70'),_0x5e6768['params']['id'],_0x1441c5));_0xf6c7d[_0xf3ea('0x6d')](_0xf3ea('0x71'),_0xf3ea('0x72'));return _0xf6c7d[_0xf3ea('0x73')](util[_0xf3ea('0x65')](_0xf3ea('0x6c'),_0x5e6768[_0xf3ea('0x4c')]['id'],_0x1441c5));}else{return _0xf6c7d['sendStatus'](0xcc);}})[_0xf3ea('0x42')](handleError(_0xf6c7d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 06b56c7..4a61812 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 _0xd846=['../../config/environment','exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','bluebird','rimraf'];(function(_0x1472ff,_0x5aef21){var _0x2dde9f=function(_0xc53176){while(--_0xc53176){_0x1472ff['push'](_0x1472ff['shift']());}};_0x2dde9f(++_0x5aef21);}(_0xd846,0x195));var _0x6d84=function(_0x126d55,_0x1c8636){_0x126d55=_0x126d55-0x0;var _0x1dfc85=_0xd846[_0x126d55];return _0x1dfc85;};'use strict';var _=require(_0x6d84('0x0'));var util=require(_0x6d84('0x1'));var logger=require(_0x6d84('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6d84('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d84('0x4'));var config=require(_0x6d84('0x5'));var attributes=require('./jscriptyProject.attributes');module[_0x6d84('0x6')]=function(_0x4a909d,_0x4a7c2d){return _0x4a909d[_0x6d84('0x7')](_0x6d84('0x8'),attributes,{'tableName':_0x6d84('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a9f=['util','../../config/logger','bluebird','path','JscriptyProject'];(function(_0x540004,_0x18cc8b){var _0xa8da32=function(_0x1d858d){while(--_0x1d858d){_0x540004['push'](_0x540004['shift']());}};_0xa8da32(++_0x18cc8b);}(_0x0a9f,0x64));var _0xf0a9=function(_0x3cc81e,_0x435f44){_0x3cc81e=_0x3cc81e-0x0;var _0x5b15e3=_0x0a9f[_0x3cc81e];return _0x5b15e3;};'use strict';var _=require('lodash');var util=require(_0xf0a9('0x0'));var logger=require(_0xf0a9('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf0a9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0a9('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x5343c2,_0x2502a2){return _0x5343c2['define'](_0xf0a9('0x4'),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 d3de3d1..8dda5d3 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x9f994d,_0x19e27e){var _0x452b87=function(_0x551c7e){while(--_0x551c7e){_0x9f994d['push'](_0x9f994d['shift']());}};_0x452b87(++_0x19e27e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x2f85d6,_0x3df5b7){var _0xb4942f=function(_0x7ad4f2){while(--_0x7ad4f2){_0x2f85d6['push'](_0x2f85d6['shift']());}};_0xb4942f(++_0x3df5b7);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 921d1cf..5b9a8dc 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 _0xd31a=['express','fs-extra','../../components/interaction/service','./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','multer','util','path'];(function(_0x8fb1c0,_0x2e47a9){var _0x5742eb=function(_0x3167b1){while(--_0x3167b1){_0x8fb1c0['push'](_0x8fb1c0['shift']());}};_0x5742eb(++_0x2e47a9);}(_0xd31a,0x177));var _0xad31=function(_0xa90f56,_0x8343e2){_0xa90f56=_0xa90f56-0x0;var _0x1a1d02=_0xd31a[_0xa90f56];return _0x1a1d02;};'use strict';var multer=require(_0xad31('0x0'));var util=require(_0xad31('0x1'));var path=require(_0xad31('0x2'));var timeout=require('connect-timeout');var express=require(_0xad31('0x3'));var router=express['Router']();var fs_extra=require(_0xad31('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xad31('0x5'));var config=require('../../config/environment');var controller=require(_0xad31('0x6'));router[_0xad31('0x7')]('/',auth['isAuthenticated'](),controller[_0xad31('0x8')]);router[_0xad31('0x7')](_0xad31('0x9'),auth[_0xad31('0xa')](),controller[_0xad31('0xb')]);router['get'](_0xad31('0xc'),auth[_0xad31('0xa')](),controller[_0xad31('0xd')]);router[_0xad31('0xe')]('/',auth[_0xad31('0xa')](),controller[_0xad31('0xf')]);router[_0xad31('0x10')]('/:id',auth[_0xad31('0xa')](),controller[_0xad31('0x11')]);router['delete'](_0xad31('0xc'),auth[_0xad31('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x72c6=['index','/describe','isAuthenticated','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get'];(function(_0x29fd4f,_0x32e48b){var _0x5ec578=function(_0x305310){while(--_0x305310){_0x29fd4f['push'](_0x29fd4f['shift']());}};_0x5ec578(++_0x32e48b);}(_0x72c6,0x11b));var _0x672c=function(_0x11a20e,_0x2ec94c){_0x11a20e=_0x11a20e-0x0;var _0x19287c=_0x72c6[_0x11a20e];return _0x19287c;};'use strict';var multer=require(_0x672c('0x0'));var util=require(_0x672c('0x1'));var path=require(_0x672c('0x2'));var timeout=require(_0x672c('0x3'));var express=require('express');var router=express[_0x672c('0x4')]();var fs_extra=require(_0x672c('0x5'));var auth=require(_0x672c('0x6'));var interaction=require(_0x672c('0x7'));var config=require(_0x672c('0x8'));var controller=require(_0x672c('0x9'));router[_0x672c('0xa')]('/',auth['isAuthenticated'](),controller[_0x672c('0xb')]);router[_0x672c('0xa')](_0x672c('0xc'),auth[_0x672c('0xd')](),controller['describe']);router[_0x672c('0xa')](_0x672c('0xe'),auth[_0x672c('0xd')](),controller[_0x672c('0xf')]);router[_0x672c('0x10')]('/',auth['isAuthenticated'](),controller[_0x672c('0x11')]);router[_0x672c('0x12')]('/:id',auth[_0x672c('0xd')](),controller[_0x672c('0x13')]);router['delete']('/:id',auth[_0x672c('0xd')](),controller['destroy']);module[_0x672c('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 390f708..bf344a2 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x31ce08,_0x3d4407){_0x31ce08=_0x31ce08-0x0;var _0x529f79=_0x7a54[_0x31ce08];return _0x529f79;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x5d3067,_0x27ed9c){_0x5d3067=_0x5d3067-0x0;var _0x2e501e=_0x7a54[_0x5d3067];return _0x2e501e;};'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 c5b9aea..2041c63 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 _0x4155=['params','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','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','undefined','limit','count','offset','set','apply','update','then','error','stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch'];(function(_0x4f4769,_0x1920d0){var _0x359bd5=function(_0x31bb6c){while(--_0x31bb6c){_0x4f4769['push'](_0x4f4769['shift']());}};_0x359bd5(++_0x1920d0);}(_0x4155,0xa5));var _0x5415=function(_0x43b9fe,_0x22f9fc){_0x43b9fe=_0x43b9fe-0x0;var _0x35ee8f=_0x4155[_0x43b9fe];return _0x35ee8f;};'use strict';var emlformat=require(_0x5415('0x0'));var rimraf=require(_0x5415('0x1'));var zipdir=require(_0x5415('0x2'));var jsonpatch=require(_0x5415('0x3'));var rp=require('request-promise');var moment=require(_0x5415('0x4'));var BPromise=require(_0x5415('0x5'));var Mustache=require(_0x5415('0x6'));var util=require(_0x5415('0x7'));var path=require(_0x5415('0x8'));var sox=require(_0x5415('0x9'));var csv=require(_0x5415('0xa'));var ejs=require(_0x5415('0xb'));var fs=require('fs');var fs_extra=require(_0x5415('0xc'));var _=require(_0x5415('0xd'));var squel=require(_0x5415('0xe'));var crypto=require(_0x5415('0xf'));var jsforce=require(_0x5415('0x10'));var deskjs=require(_0x5415('0x11'));var toCsv=require('to-csv');var querystring=require(_0x5415('0x12'));var Papa=require(_0x5415('0x13'));var Redis=require(_0x5415('0x14'));var authService=require(_0x5415('0x15'));var qs=require(_0x5415('0x16'));var as=require(_0x5415('0x17'));var hardwareService=require(_0x5415('0x18'));var logger=require(_0x5415('0x19'))('api');var utils=require(_0x5415('0x1a'));var config=require(_0x5415('0x1b'));var licenseUtil=require(_0x5415('0x1c'));var db=require(_0x5415('0x1d'))['db'];function respondWithStatusCode(_0x25d375,_0x16de1b){_0x16de1b=_0x16de1b||0xcc;return function(_0x4303db){if(_0x4303db){return _0x25d375[_0x5415('0x1e')](_0x16de1b);}return _0x25d375[_0x5415('0x1f')](_0x16de1b)[_0x5415('0x20')]();};}function respondWithResult(_0x4e1593,_0xcb21e5){_0xcb21e5=_0xcb21e5||0xc8;return function(_0x173112){if(_0x173112){return _0x4e1593[_0x5415('0x1f')](_0xcb21e5)[_0x5415('0x21')](_0x173112);}};}function respondWithFilteredResult(_0x4d5dc7,_0x40ba42){return function(_0x437171){if(_0x437171){var _0x2555c8=typeof _0x40ba42['offset']===_0x5415('0x22')&&typeof _0x40ba42[_0x5415('0x23')]===_0x5415('0x22');var _0x9a786f=_0x437171[_0x5415('0x24')];var _0x54b236=_0x2555c8?0x0:_0x40ba42[_0x5415('0x25')];var _0x21cce3=_0x2555c8?_0x437171[_0x5415('0x24')]:_0x40ba42[_0x5415('0x25')]+_0x40ba42[_0x5415('0x23')];var _0x3944e7;if(_0x21cce3>=_0x9a786f){_0x21cce3=_0x9a786f;_0x3944e7=0xc8;}else{_0x3944e7=0xce;}_0x4d5dc7[_0x5415('0x1f')](_0x3944e7);return _0x4d5dc7[_0x5415('0x26')]('Content-Range',_0x54b236+'-'+_0x21cce3+'/'+_0x9a786f)[_0x5415('0x21')](_0x437171);}return null;};}function patchUpdates(_0x5b045c){return function(_0x428d52){try{jsonpatch[_0x5415('0x27')](_0x428d52,_0x5b045c,!![]);}catch(_0x413819){return BPromise['reject'](_0x413819);}return _0x428d52['save']();};}function saveUpdates(_0x1ac2f3,_0x1c414a){return function(_0x12be97){if(_0x12be97){return _0x12be97[_0x5415('0x28')](_0x1ac2f3)[_0x5415('0x29')](function(_0x43a919){return _0x43a919;});}return null;};}function removeEntity(_0x9ffbd6,_0x2e638b){return function(_0x424ed4){if(_0x424ed4){return _0x424ed4['destroy']()[_0x5415('0x29')](function(){_0x9ffbd6[_0x5415('0x1f')](0xcc)[_0x5415('0x20')]();});}};}function handleEntityNotFound(_0x2285c8,_0x29bc3f){return function(_0x384509){if(!_0x384509){_0x2285c8['sendStatus'](0x194);}return _0x384509;};}function handleError(_0x2ebad8,_0x54fe4b){_0x54fe4b=_0x54fe4b||0x1f4;return function(_0x57ba0d){logger[_0x5415('0x2a')](_0x57ba0d[_0x5415('0x2b')]);if(_0x57ba0d[_0x5415('0x2c')]){delete _0x57ba0d[_0x5415('0x2c')];}_0x2ebad8[_0x5415('0x1f')](_0x54fe4b)[_0x5415('0x2d')](_0x57ba0d);};}exports['index']=function(_0x622876,_0x2dd894){var _0x487944={},_0x25b202={},_0x16b72f={'count':0x0,'rows':[]};var _0x38dcd3=_[_0x5415('0x2e')](db[_0x5415('0x2f')][_0x5415('0x30')],function(_0x456ada){return{'name':_0x456ada[_0x5415('0x31')],'type':_0x456ada[_0x5415('0x32')][_0x5415('0x33')]};});_0x25b202[_0x5415('0x34')]=_[_0x5415('0x2e')](_0x38dcd3,'name');_0x25b202[_0x5415('0x35')]=_[_0x5415('0x36')](_0x622876[_0x5415('0x35')]);_0x25b202[_0x5415('0x37')]=_[_0x5415('0x38')](_0x25b202['model'],_0x25b202[_0x5415('0x35')]);_0x487944[_0x5415('0x39')]=_[_0x5415('0x38')](_0x25b202[_0x5415('0x34')],qs[_0x5415('0x3a')](_0x622876[_0x5415('0x35')][_0x5415('0x3a')]));_0x487944[_0x5415('0x39')]=_0x487944[_0x5415('0x39')]['length']?_0x487944['attributes']:_0x25b202['model'];if(!_0x622876[_0x5415('0x35')][_0x5415('0x3b')](_0x5415('0x3c'))){_0x487944['limit']=qs[_0x5415('0x23')](_0x622876['query']['limit']);_0x487944[_0x5415('0x25')]=qs['offset'](_0x622876[_0x5415('0x35')][_0x5415('0x25')]);}_0x487944[_0x5415('0x3d')]=qs['sort'](_0x622876[_0x5415('0x35')][_0x5415('0x3e')]);_0x487944[_0x5415('0x3f')]=qs[_0x5415('0x37')](_[_0x5415('0x40')](_0x622876[_0x5415('0x35')],_0x25b202[_0x5415('0x37')]),_0x38dcd3);if(_0x622876[_0x5415('0x35')]['filter']){_0x487944[_0x5415('0x3f')]=_[_0x5415('0x41')](_0x487944[_0x5415('0x3f')],{'$or':_[_0x5415('0x2e')](_0x38dcd3,function(_0x531545){if(_0x531545['type']!==_0x5415('0x42')){var _0x3cac09={};_0x3cac09[_0x531545[_0x5415('0x2c')]]={'$like':'%'+_0x622876[_0x5415('0x35')][_0x5415('0x43')]+'%'};return _0x3cac09;}})});}_0x487944=_[_0x5415('0x41')]({},_0x487944,_0x622876['options']);var _0x33636a={'where':_0x487944[_0x5415('0x3f')]};return db[_0x5415('0x2f')][_0x5415('0x24')](_0x33636a)[_0x5415('0x29')](function(_0x58b68c){_0x16b72f[_0x5415('0x24')]=_0x58b68c;if(_0x622876[_0x5415('0x35')][_0x5415('0x44')]){_0x487944[_0x5415('0x45')]=[{'all':!![]}];}return db[_0x5415('0x2f')]['findAll'](_0x487944);})[_0x5415('0x29')](function(_0x16c08c){_0x16b72f[_0x5415('0x46')]=_0x16c08c;return _0x16b72f;})[_0x5415('0x29')](respondWithFilteredResult(_0x2dd894,_0x487944))[_0x5415('0x47')](handleError(_0x2dd894,null));};exports['show']=function(_0x294966,_0x37626b){var _0x510176={'raw':!![],'where':{'id':_0x294966[_0x5415('0x48')]['id']}},_0x542338={};_0x542338['model']=_[_0x5415('0x36')](db[_0x5415('0x2f')][_0x5415('0x30')]);_0x542338[_0x5415('0x35')]=_[_0x5415('0x36')](_0x294966[_0x5415('0x35')]);_0x542338[_0x5415('0x37')]=_['intersection'](_0x542338[_0x5415('0x34')],_0x542338[_0x5415('0x35')]);_0x510176['attributes']=_['intersection'](_0x542338[_0x5415('0x34')],qs[_0x5415('0x3a')](_0x294966[_0x5415('0x35')][_0x5415('0x3a')]));_0x510176[_0x5415('0x39')]=_0x510176[_0x5415('0x39')][_0x5415('0x49')]?_0x510176[_0x5415('0x39')]:_0x542338[_0x5415('0x34')];if(_0x294966[_0x5415('0x35')]['includeAll']){_0x510176[_0x5415('0x45')]=[{'all':!![]}];}_0x510176=_[_0x5415('0x41')]({},_0x510176,_0x294966[_0x5415('0x4a')]);return db[_0x5415('0x2f')][_0x5415('0x4b')](_0x510176)[_0x5415('0x29')](handleEntityNotFound(_0x37626b,null))[_0x5415('0x29')](respondWithResult(_0x37626b,null))[_0x5415('0x47')](handleError(_0x37626b,null));};exports[_0x5415('0x4c')]=function(_0x44fae8,_0x5d1d9e){return db[_0x5415('0x2f')][_0x5415('0x4c')](_0x44fae8[_0x5415('0x4d')],{})[_0x5415('0x29')](respondWithResult(_0x5d1d9e,0xc9))[_0x5415('0x47')](handleError(_0x5d1d9e,null));};exports['update']=function(_0x4ab517,_0x15a8e1){if(_0x4ab517[_0x5415('0x4d')]['id']){delete _0x4ab517['body']['id'];}return db[_0x5415('0x2f')]['find']({'where':{'id':_0x4ab517[_0x5415('0x48')]['id']}})['then'](handleEntityNotFound(_0x15a8e1,null))[_0x5415('0x29')](saveUpdates(_0x4ab517[_0x5415('0x4d')],null))['then'](respondWithResult(_0x15a8e1,null))[_0x5415('0x47')](handleError(_0x15a8e1,null));};exports['destroy']=function(_0x55bb63,_0x4af57f){return db[_0x5415('0x2f')][_0x5415('0x4b')]({'where':{'id':_0x55bb63['params']['id']}})[_0x5415('0x29')](handleEntityNotFound(_0x4af57f,null))[_0x5415('0x29')](removeEntity(_0x4af57f,null))[_0x5415('0x47')](handleError(_0x4af57f,null));};exports[_0x5415('0x4e')]=function(_0xbca962,_0x443e93){return db[_0x5415('0x2f')][_0x5415('0x4e')]()[_0x5415('0x29')](respondWithResult(_0x443e93,null))[_0x5415('0x47')](handleError(_0x443e93,null));}; \ No newline at end of file +var _0x2b4b=['name','index','JscriptyQuestionReport','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','rawAttributes','create','body','find','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','stack'];(function(_0x53bfcf,_0x24937a){var _0x2825e4=function(_0x2ffd0a){while(--_0x2ffd0a){_0x53bfcf['push'](_0x53bfcf['shift']());}};_0x2825e4(++_0x24937a);}(_0x2b4b,0x187));var _0xb2b4=function(_0x4e18a,_0x2d220a){_0x4e18a=_0x4e18a-0x0;var _0x56cc08=_0x2b4b[_0x4e18a];return _0x56cc08;};'use strict';var emlformat=require(_0xb2b4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb2b4('0x1'));var jsonpatch=require(_0xb2b4('0x2'));var rp=require('request-promise');var moment=require(_0xb2b4('0x3'));var BPromise=require(_0xb2b4('0x4'));var Mustache=require(_0xb2b4('0x5'));var util=require(_0xb2b4('0x6'));var path=require(_0xb2b4('0x7'));var sox=require(_0xb2b4('0x8'));var csv=require(_0xb2b4('0x9'));var ejs=require(_0xb2b4('0xa'));var fs=require('fs');var fs_extra=require(_0xb2b4('0xb'));var _=require(_0xb2b4('0xc'));var squel=require(_0xb2b4('0xd'));var crypto=require('crypto');var jsforce=require(_0xb2b4('0xe'));var deskjs=require(_0xb2b4('0xf'));var toCsv=require(_0xb2b4('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb2b4('0x10'));var qs=require(_0xb2b4('0x11'));var as=require(_0xb2b4('0x12'));var hardwareService=require(_0xb2b4('0x13'));var logger=require('../../config/logger')(_0xb2b4('0x14'));var utils=require(_0xb2b4('0x15'));var config=require(_0xb2b4('0x16'));var licenseUtil=require(_0xb2b4('0x17'));var db=require(_0xb2b4('0x18'))['db'];function respondWithStatusCode(_0x463a67,_0x3e2dd4){_0x3e2dd4=_0x3e2dd4||0xcc;return function(_0x410bf1){if(_0x410bf1){return _0x463a67[_0xb2b4('0x19')](_0x3e2dd4);}return _0x463a67[_0xb2b4('0x1a')](_0x3e2dd4)['end']();};}function respondWithResult(_0x519c9b,_0xd8aff5){_0xd8aff5=_0xd8aff5||0xc8;return function(_0x48482b){if(_0x48482b){return _0x519c9b[_0xb2b4('0x1a')](_0xd8aff5)[_0xb2b4('0x1b')](_0x48482b);}};}function respondWithFilteredResult(_0xcbadb1,_0x4a1428){return function(_0x24eae5){if(_0x24eae5){var _0x36987b=typeof _0x4a1428[_0xb2b4('0x1c')]===_0xb2b4('0x1d')&&typeof _0x4a1428[_0xb2b4('0x1e')]===_0xb2b4('0x1d');var _0x10afaf=_0x24eae5[_0xb2b4('0x1f')];var _0x29504a=_0x36987b?0x0:_0x4a1428[_0xb2b4('0x1c')];var _0x18c785=_0x36987b?_0x24eae5['count']:_0x4a1428[_0xb2b4('0x1c')]+_0x4a1428[_0xb2b4('0x1e')];var _0x27d696;if(_0x18c785>=_0x10afaf){_0x18c785=_0x10afaf;_0x27d696=0xc8;}else{_0x27d696=0xce;}_0xcbadb1[_0xb2b4('0x1a')](_0x27d696);return _0xcbadb1[_0xb2b4('0x20')](_0xb2b4('0x21'),_0x29504a+'-'+_0x18c785+'/'+_0x10afaf)[_0xb2b4('0x1b')](_0x24eae5);}return null;};}function patchUpdates(_0x295f2c){return function(_0x352051){try{jsonpatch[_0xb2b4('0x22')](_0x352051,_0x295f2c,!![]);}catch(_0xeee695){return BPromise[_0xb2b4('0x23')](_0xeee695);}return _0x352051['save']();};}function saveUpdates(_0x297afe,_0x2a4eaf){return function(_0x2fb7ee){if(_0x2fb7ee){return _0x2fb7ee[_0xb2b4('0x24')](_0x297afe)[_0xb2b4('0x25')](function(_0x64ae79){return _0x64ae79;});}return null;};}function removeEntity(_0x465f67,_0x16f4bf){return function(_0x21bf39){if(_0x21bf39){return _0x21bf39[_0xb2b4('0x26')]()[_0xb2b4('0x25')](function(){_0x465f67[_0xb2b4('0x1a')](0xcc)[_0xb2b4('0x27')]();});}};}function handleEntityNotFound(_0x20c631,_0x43915c){return function(_0x50468e){if(!_0x50468e){_0x20c631[_0xb2b4('0x19')](0x194);}return _0x50468e;};}function handleError(_0xc4187a,_0x4dd35b){_0x4dd35b=_0x4dd35b||0x1f4;return function(_0x596128){logger['error'](_0x596128[_0xb2b4('0x28')]);if(_0x596128['name']){delete _0x596128[_0xb2b4('0x29')];}_0xc4187a[_0xb2b4('0x1a')](_0x4dd35b)['send'](_0x596128);};}exports[_0xb2b4('0x2a')]=function(_0x3c1825,_0x10f0a2){var _0x1b3bef={},_0x1e3265={},_0x155e01={'count':0x0,'rows':[]};var _0x2e4a87=_['map'](db[_0xb2b4('0x2b')]['rawAttributes'],function(_0x227e6b){return{'name':_0x227e6b[_0xb2b4('0x2c')],'type':_0x227e6b[_0xb2b4('0x2d')]['key']};});_0x1e3265[_0xb2b4('0x2e')]=_[_0xb2b4('0x2f')](_0x2e4a87,_0xb2b4('0x29'));_0x1e3265['query']=_[_0xb2b4('0x30')](_0x3c1825[_0xb2b4('0x31')]);_0x1e3265[_0xb2b4('0x32')]=_[_0xb2b4('0x33')](_0x1e3265['model'],_0x1e3265[_0xb2b4('0x31')]);_0x1b3bef[_0xb2b4('0x34')]=_[_0xb2b4('0x33')](_0x1e3265[_0xb2b4('0x2e')],qs[_0xb2b4('0x35')](_0x3c1825[_0xb2b4('0x31')][_0xb2b4('0x35')]));_0x1b3bef[_0xb2b4('0x34')]=_0x1b3bef['attributes'][_0xb2b4('0x36')]?_0x1b3bef[_0xb2b4('0x34')]:_0x1e3265[_0xb2b4('0x2e')];if(!_0x3c1825[_0xb2b4('0x31')][_0xb2b4('0x37')]('nolimit')){_0x1b3bef['limit']=qs[_0xb2b4('0x1e')](_0x3c1825[_0xb2b4('0x31')][_0xb2b4('0x1e')]);_0x1b3bef['offset']=qs[_0xb2b4('0x1c')](_0x3c1825['query'][_0xb2b4('0x1c')]);}_0x1b3bef['order']=qs[_0xb2b4('0x38')](_0x3c1825[_0xb2b4('0x31')][_0xb2b4('0x38')]);_0x1b3bef[_0xb2b4('0x39')]=qs[_0xb2b4('0x32')](_[_0xb2b4('0x3a')](_0x3c1825['query'],_0x1e3265[_0xb2b4('0x32')]),_0x2e4a87);if(_0x3c1825[_0xb2b4('0x31')][_0xb2b4('0x3b')]){_0x1b3bef[_0xb2b4('0x39')]=_[_0xb2b4('0x3c')](_0x1b3bef['where'],{'$or':_[_0xb2b4('0x2f')](_0x2e4a87,function(_0x8c23f8){if(_0x8c23f8[_0xb2b4('0x2d')]!==_0xb2b4('0x3d')){var _0x56bd14={};_0x56bd14[_0x8c23f8[_0xb2b4('0x29')]]={'$like':'%'+_0x3c1825[_0xb2b4('0x31')][_0xb2b4('0x3b')]+'%'};return _0x56bd14;}})});}_0x1b3bef=_[_0xb2b4('0x3c')]({},_0x1b3bef,_0x3c1825['options']);var _0x2e7712={'where':_0x1b3bef[_0xb2b4('0x39')]};return db[_0xb2b4('0x2b')][_0xb2b4('0x1f')](_0x2e7712)[_0xb2b4('0x25')](function(_0x4a0684){_0x155e01[_0xb2b4('0x1f')]=_0x4a0684;if(_0x3c1825[_0xb2b4('0x31')][_0xb2b4('0x3e')]){_0x1b3bef[_0xb2b4('0x3f')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xb2b4('0x40')](_0x1b3bef);})[_0xb2b4('0x25')](function(_0x20f350){_0x155e01['rows']=_0x20f350;return _0x155e01;})[_0xb2b4('0x25')](respondWithFilteredResult(_0x10f0a2,_0x1b3bef))[_0xb2b4('0x41')](handleError(_0x10f0a2,null));};exports['show']=function(_0x30debc,_0x59e966){var _0x5b3962={'raw':!![],'where':{'id':_0x30debc[_0xb2b4('0x42')]['id']}},_0x1c7b88={};_0x1c7b88[_0xb2b4('0x2e')]=_[_0xb2b4('0x30')](db[_0xb2b4('0x2b')][_0xb2b4('0x43')]);_0x1c7b88[_0xb2b4('0x31')]=_[_0xb2b4('0x30')](_0x30debc[_0xb2b4('0x31')]);_0x1c7b88[_0xb2b4('0x32')]=_[_0xb2b4('0x33')](_0x1c7b88['model'],_0x1c7b88[_0xb2b4('0x31')]);_0x5b3962['attributes']=_[_0xb2b4('0x33')](_0x1c7b88[_0xb2b4('0x2e')],qs[_0xb2b4('0x35')](_0x30debc[_0xb2b4('0x31')][_0xb2b4('0x35')]));_0x5b3962['attributes']=_0x5b3962[_0xb2b4('0x34')]['length']?_0x5b3962[_0xb2b4('0x34')]:_0x1c7b88[_0xb2b4('0x2e')];if(_0x30debc['query'][_0xb2b4('0x3e')]){_0x5b3962[_0xb2b4('0x3f')]=[{'all':!![]}];}_0x5b3962=_[_0xb2b4('0x3c')]({},_0x5b3962,_0x30debc['options']);return db[_0xb2b4('0x2b')]['find'](_0x5b3962)[_0xb2b4('0x25')](handleEntityNotFound(_0x59e966,null))[_0xb2b4('0x25')](respondWithResult(_0x59e966,null))[_0xb2b4('0x41')](handleError(_0x59e966,null));};exports[_0xb2b4('0x44')]=function(_0x38b910,_0x9c9c7b){return db[_0xb2b4('0x2b')][_0xb2b4('0x44')](_0x38b910[_0xb2b4('0x45')],{})[_0xb2b4('0x25')](respondWithResult(_0x9c9c7b,0xc9))['catch'](handleError(_0x9c9c7b,null));};exports[_0xb2b4('0x24')]=function(_0x445b79,_0x210401){if(_0x445b79['body']['id']){delete _0x445b79[_0xb2b4('0x45')]['id'];}return db[_0xb2b4('0x2b')][_0xb2b4('0x46')]({'where':{'id':_0x445b79['params']['id']}})[_0xb2b4('0x25')](handleEntityNotFound(_0x210401,null))['then'](saveUpdates(_0x445b79[_0xb2b4('0x45')],null))['then'](respondWithResult(_0x210401,null))[_0xb2b4('0x41')](handleError(_0x210401,null));};exports['destroy']=function(_0x15a589,_0x1d31fc){return db['JscriptyQuestionReport'][_0xb2b4('0x46')]({'where':{'id':_0x15a589[_0xb2b4('0x42')]['id']}})[_0xb2b4('0x25')](handleEntityNotFound(_0x1d31fc,null))[_0xb2b4('0x25')](removeEntity(_0x1d31fc,null))[_0xb2b4('0x41')](handleError(_0x1d31fc,null));};exports[_0xb2b4('0x47')]=function(_0x59375b,_0x263522){return db[_0xb2b4('0x2b')][_0xb2b4('0x47')]()[_0xb2b4('0x25')](respondWithResult(_0x263522,null))[_0xb2b4('0x41')](handleError(_0x263522,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 7d5cfcf..90f3a90 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 _0x958f=['report_jscripty_questions','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport'];(function(_0x1c7d39,_0x5d362b){var _0x467063=function(_0x951cd6){while(--_0x951cd6){_0x1c7d39['push'](_0x1c7d39['shift']());}};_0x467063(++_0x5d362b);}(_0x958f,0x115));var _0xf958=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x958f[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xf958('0x0'));var util=require(_0xf958('0x1'));var logger=require('../../config/logger')(_0xf958('0x2'));var moment=require('moment');var BPromise=require(_0xf958('0x3'));var rp=require(_0xf958('0x4'));var fs=require('fs');var path=require(_0xf958('0x5'));var rimraf=require(_0xf958('0x6'));var config=require(_0xf958('0x7'));var attributes=require(_0xf958('0x8'));module['exports']=function(_0x290a7b,_0x216760){return _0x290a7b[_0xf958('0x9')](_0xf958('0xa'),attributes,{'tableName':_0xf958('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cfd=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x2a9789,_0x4eb19e){var _0x5b69ef=function(_0x11d151){while(--_0x11d151){_0x2a9789['push'](_0x2a9789['shift']());}};_0x5b69ef(++_0x4eb19e);}(_0x2cfd,0x9f));var _0xd2cf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2cfd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xd2cf('0x0'));var util=require(_0xd2cf('0x1'));var logger=require(_0xd2cf('0x2'))(_0xd2cf('0x3'));var moment=require('moment');var BPromise=require(_0xd2cf('0x4'));var rp=require(_0xd2cf('0x5'));var fs=require('fs');var path=require(_0xd2cf('0x6'));var rimraf=require(_0xd2cf('0x7'));var config=require(_0xd2cf('0x8'));var attributes=require(_0xd2cf('0x9'));module['exports']=function(_0x1fe461,_0x4ed987){return _0x1fe461[_0xd2cf('0xa')](_0xd2cf('0xb'),attributes,{'tableName':_0xd2cf('0xc'),'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 d837f8f..093bd70 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 _0xfc60=['catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x4b820f,_0x34646a){var _0xeba73e=function(_0xd557a){while(--_0xd557a){_0x4b820f['push'](_0x4b820f['shift']());}};_0xeba73e(++_0x34646a);}(_0xfc60,0x177));var _0x0fc6=function(_0x15c618,_0x5c5af3){_0x15c618=_0x15c618-0x0;var _0x25f38d=_0xfc60[_0x15c618];return _0x25f38d;};'use strict';var _=require('lodash');var util=require(_0x0fc6('0x0'));var moment=require('moment');var BPromise=require(_0x0fc6('0x1'));var rs=require(_0x0fc6('0x2'));var fs=require('fs');var Redis=require(_0x0fc6('0x3'));var db=require(_0x0fc6('0x4'))['db'];var utils=require(_0x0fc6('0x5'));var logger=require('../../config/logger')(_0x0fc6('0x6'));var config=require(_0x0fc6('0x7'));var jayson=require(_0x0fc6('0x8'));var client=jayson[_0x0fc6('0x9')][_0x0fc6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a77e1,_0x266d13,_0x51bfe4){return new BPromise(function(_0x1bcae1,_0x3c5d48){return client['request'](_0x1a77e1,_0x51bfe4)[_0x0fc6('0xb')](function(_0x49fb32){logger['info'](_0x0fc6('0xc'),_0x266d13,_0x0fc6('0xd'));logger[_0x0fc6('0xe')](_0x0fc6('0xf'),_0x266d13,_0x0fc6('0xd'),JSON[_0x0fc6('0x10')](_0x49fb32));if(_0x49fb32['error']){if(_0x49fb32[_0x0fc6('0x11')]['code']===0x1f4){logger[_0x0fc6('0x11')](_0x0fc6('0xc'),_0x266d13,_0x49fb32['error'][_0x0fc6('0x12')]);return _0x3c5d48(_0x49fb32[_0x0fc6('0x11')][_0x0fc6('0x12')]);}logger[_0x0fc6('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x266d13,_0x49fb32[_0x0fc6('0x11')][_0x0fc6('0x12')]);return _0x1bcae1(_0x49fb32[_0x0fc6('0x11')]['message']);}else{logger[_0x0fc6('0x13')](_0x0fc6('0xc'),_0x266d13,_0x0fc6('0xd'));_0x1bcae1(_0x49fb32[_0x0fc6('0x14')][_0x0fc6('0x12')]);}})[_0x0fc6('0x15')](function(_0xd4b370){logger['error'](_0x0fc6('0xc'),_0x266d13,_0xd4b370);_0x3c5d48(_0xd4b370);});});} \ No newline at end of file +var _0xfa6b=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x1a54d6,_0x25f6e5){var _0x3dbd92=function(_0x42c200){while(--_0x42c200){_0x1a54d6['push'](_0x1a54d6['shift']());}};_0x3dbd92(++_0x25f6e5);}(_0xfa6b,0xfa));var _0xbfa6=function(_0x322069,_0x3baae8){_0x322069=_0x322069-0x0;var _0xd4c42f=_0xfa6b[_0x322069];return _0xd4c42f;};'use strict';var _=require(_0xbfa6('0x0'));var util=require(_0xbfa6('0x1'));var moment=require(_0xbfa6('0x2'));var BPromise=require('bluebird');var rs=require(_0xbfa6('0x3'));var fs=require('fs');var Redis=require(_0xbfa6('0x4'));var db=require(_0xbfa6('0x5'))['db'];var utils=require(_0xbfa6('0x6'));var logger=require('../../config/logger')(_0xbfa6('0x7'));var config=require('../../config/environment');var jayson=require(_0xbfa6('0x8'));var client=jayson[_0xbfa6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aa399,_0x388863,_0x16bf1e){return new BPromise(function(_0x506ce5,_0xb27b02){return client[_0xbfa6('0xa')](_0x4aa399,_0x16bf1e)[_0xbfa6('0xb')](function(_0x2f0d52){logger['info'](_0xbfa6('0xc'),_0x388863,_0xbfa6('0xd'));logger[_0xbfa6('0xe')](_0xbfa6('0xf'),_0x388863,_0xbfa6('0xd'),JSON[_0xbfa6('0x10')](_0x2f0d52));if(_0x2f0d52['error']){if(_0x2f0d52[_0xbfa6('0x11')][_0xbfa6('0x12')]===0x1f4){logger[_0xbfa6('0x11')](_0xbfa6('0xc'),_0x388863,_0x2f0d52[_0xbfa6('0x11')][_0xbfa6('0x13')]);return _0xb27b02(_0x2f0d52[_0xbfa6('0x11')][_0xbfa6('0x13')]);}logger[_0xbfa6('0x11')](_0xbfa6('0xc'),_0x388863,_0x2f0d52[_0xbfa6('0x11')][_0xbfa6('0x13')]);return _0x506ce5(_0x2f0d52[_0xbfa6('0x11')][_0xbfa6('0x13')]);}else{logger[_0xbfa6('0x14')](_0xbfa6('0xc'),_0x388863,_0xbfa6('0xd'));_0x506ce5(_0x2f0d52[_0xbfa6('0x15')][_0xbfa6('0x13')]);}})[_0xbfa6('0x16')](function(_0x418a00){logger[_0xbfa6('0x11')](_0xbfa6('0xc'),_0x388863,_0x418a00);_0xb27b02(_0x418a00);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 69809c8..4ba2da4 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 _0xe5d5=['../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','/describe','isAuthenticated','/:id/questions','getQuestions','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router'];(function(_0x5e7514,_0x30c2e1){var _0x12f472=function(_0x33ddb6){while(--_0x33ddb6){_0x5e7514['push'](_0x5e7514['shift']());}};_0x12f472(++_0x30c2e1);}(_0xe5d5,0x1f0));var _0x5e5d=function(_0x1761a9,_0x38b400){_0x1761a9=_0x1761a9-0x0;var _0x1c36d8=_0xe5d5[_0x1761a9];return _0x1c36d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5e5d('0x0'));var timeout=require(_0x5e5d('0x1'));var express=require(_0x5e5d('0x2'));var router=express[_0x5e5d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5e5d('0x4'));var interaction=require(_0x5e5d('0x5'));var config=require('../../config/environment');var controller=require(_0x5e5d('0x6'));router[_0x5e5d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5e5d('0x7')](_0x5e5d('0x8'),auth[_0x5e5d('0x9')](),controller['describe']);router[_0x5e5d('0x7')]('/:id',auth[_0x5e5d('0x9')](),controller['show']);router[_0x5e5d('0x7')](_0x5e5d('0xa'),auth[_0x5e5d('0x9')](),controller[_0x5e5d('0xb')]);router[_0x5e5d('0xc')]('/',auth[_0x5e5d('0x9')](),controller[_0x5e5d('0xd')]);router[_0x5e5d('0xe')](_0x5e5d('0xf'),auth[_0x5e5d('0x9')](),controller[_0x5e5d('0x10')]);router[_0x5e5d('0x11')](_0x5e5d('0xf'),auth[_0x5e5d('0x9')](),controller[_0x5e5d('0x12')]);module[_0x5e5d('0x13')]=router; \ No newline at end of file +var _0x5489=['describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','isAuthenticated'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x5489,0x1bc));var _0x9548=function(_0x378edc,_0x2163e6){_0x378edc=_0x378edc-0x0;var _0xc0a9b8=_0x5489[_0x378edc];return _0xc0a9b8;};'use strict';var multer=require(_0x9548('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9548('0x1'));var express=require(_0x9548('0x2'));var router=express['Router']();var fs_extra=require(_0x9548('0x3'));var auth=require(_0x9548('0x4'));var interaction=require(_0x9548('0x5'));var config=require(_0x9548('0x6'));var controller=require(_0x9548('0x7'));router[_0x9548('0x8')]('/',auth['isAuthenticated'](),controller[_0x9548('0x9')]);router[_0x9548('0x8')](_0x9548('0xa'),auth[_0x9548('0xb')](),controller[_0x9548('0xc')]);router[_0x9548('0x8')](_0x9548('0xd'),auth['isAuthenticated'](),controller[_0x9548('0xe')]);router[_0x9548('0x8')](_0x9548('0xf'),auth[_0x9548('0xb')](),controller[_0x9548('0x10')]);router[_0x9548('0x11')]('/',auth[_0x9548('0xb')](),controller[_0x9548('0x12')]);router[_0x9548('0x13')]('/:id',auth[_0x9548('0xb')](),controller[_0x9548('0x14')]);router[_0x9548('0x15')](_0x9548('0xd'),auth[_0x9548('0xb')](),controller[_0x9548('0x16')]);module[_0x9548('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 28e5e1f..68e2b4d 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 _0xee81=['STRING','BOOLEAN','moment','sequelize','exports','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xee81,0x17c));var _0x1ee8=function(_0x5349ca,_0x10b5ac){_0x5349ca=_0x5349ca-0x0;var _0x8dedd5=_0xee81[_0x5349ca];return _0x8dedd5;};'use strict';var moment=require(_0x1ee8('0x0'));var Sequelize=require(_0x1ee8('0x1'));module[_0x1ee8('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x3ded67){this['setDataValue'](_0x1ee8('0x3'),_0x3ded67);this['setDataValue'](_0x1ee8('0x4'),moment()[_0x1ee8('0x5')](_0x1ee8('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x1ee8('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x1ee8('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1ee8('0x7')]},'completed':{'type':Sequelize[_0x1ee8('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x3118=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports','DATE','starttime','setDataValue'];(function(_0x298395,_0xbbf7ad){var _0x581a78=function(_0x40aa07){while(--_0x40aa07){_0x298395['push'](_0x298395['shift']());}};_0x581a78(++_0xbbf7ad);}(_0x3118,0x1da));var _0x8311=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x3118[_0x487b0c];return _0x1adbdc;};'use strict';var moment=require(_0x8311('0x0'));var Sequelize=require(_0x8311('0x1'));module[_0x8311('0x2')]={'starttime':{'type':Sequelize[_0x8311('0x3')],'set':function(_0x3a119d){this['setDataValue'](_0x8311('0x4'),_0x3a119d);this[_0x8311('0x5')](_0x8311('0x6'),moment()[_0x8311('0x7')](_0x8311('0x8')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x8311('0x9')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8311('0x9')]},'calleridname':{'type':Sequelize[_0x8311('0x9')]},'calleridnum':{'type':Sequelize[_0x8311('0x9')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 160c535..0ba7040 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 _0xb9be=['apply','update','then','destroy','error','stack','name','send','index','JscriptySessionReport','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','type','VIRTUAL','merge','options','include','rows','catch','params','length','includeAll','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','findAll','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/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range'];(function(_0x56e2a0,_0x13b891){var _0x1b3b78=function(_0x79e8b1){while(--_0x79e8b1){_0x56e2a0['push'](_0x56e2a0['shift']());}};_0x1b3b78(++_0x13b891);}(_0xb9be,0x171));var _0xeb9b=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0xb9be[_0x2132a3];return _0x21890c;};'use strict';var emlformat=require(_0xeb9b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeb9b('0x1'));var jsonpatch=require(_0xeb9b('0x2'));var rp=require(_0xeb9b('0x3'));var moment=require(_0xeb9b('0x4'));var BPromise=require(_0xeb9b('0x5'));var Mustache=require(_0xeb9b('0x6'));var util=require(_0xeb9b('0x7'));var path=require(_0xeb9b('0x8'));var sox=require(_0xeb9b('0x9'));var csv=require(_0xeb9b('0xa'));var ejs=require(_0xeb9b('0xb'));var fs=require('fs');var fs_extra=require(_0xeb9b('0xc'));var _=require(_0xeb9b('0xd'));var squel=require(_0xeb9b('0xe'));var crypto=require('crypto');var jsforce=require(_0xeb9b('0xf'));var deskjs=require(_0xeb9b('0x10'));var toCsv=require(_0xeb9b('0xa'));var querystring=require(_0xeb9b('0x11'));var Papa=require(_0xeb9b('0x12'));var Redis=require(_0xeb9b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xeb9b('0x14'));var as=require(_0xeb9b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb9b('0x16'))(_0xeb9b('0x17'));var utils=require('../../config/utils');var config=require(_0xeb9b('0x18'));var licenseUtil=require(_0xeb9b('0x19'));var db=require(_0xeb9b('0x1a'))['db'];function respondWithStatusCode(_0x549739,_0x1f8d70){_0x1f8d70=_0x1f8d70||0xcc;return function(_0x37e23e){if(_0x37e23e){return _0x549739[_0xeb9b('0x1b')](_0x1f8d70);}return _0x549739[_0xeb9b('0x1c')](_0x1f8d70)[_0xeb9b('0x1d')]();};}function respondWithResult(_0x2ff435,_0x4d095e){_0x4d095e=_0x4d095e||0xc8;return function(_0x290b84){if(_0x290b84){return _0x2ff435[_0xeb9b('0x1c')](_0x4d095e)[_0xeb9b('0x1e')](_0x290b84);}};}function respondWithFilteredResult(_0x505315,_0x197987){return function(_0x1b713c){if(_0x1b713c){var _0x347184=typeof _0x197987[_0xeb9b('0x1f')]==='undefined'&&typeof _0x197987[_0xeb9b('0x20')]==='undefined';var _0x709d61=_0x1b713c[_0xeb9b('0x21')];var _0x5557b0=_0x347184?0x0:_0x197987[_0xeb9b('0x1f')];var _0x375b3c=_0x347184?_0x1b713c[_0xeb9b('0x21')]:_0x197987[_0xeb9b('0x1f')]+_0x197987[_0xeb9b('0x20')];var _0x40d6e9;if(_0x375b3c>=_0x709d61){_0x375b3c=_0x709d61;_0x40d6e9=0xc8;}else{_0x40d6e9=0xce;}_0x505315[_0xeb9b('0x1c')](_0x40d6e9);return _0x505315[_0xeb9b('0x22')](_0xeb9b('0x23'),_0x5557b0+'-'+_0x375b3c+'/'+_0x709d61)[_0xeb9b('0x1e')](_0x1b713c);}return null;};}function patchUpdates(_0x27a198){return function(_0x1ecafe){try{jsonpatch[_0xeb9b('0x24')](_0x1ecafe,_0x27a198,!![]);}catch(_0x24cde1){return BPromise['reject'](_0x24cde1);}return _0x1ecafe['save']();};}function saveUpdates(_0x5d8295,_0x4e3257){return function(_0x1c149b){if(_0x1c149b){return _0x1c149b[_0xeb9b('0x25')](_0x5d8295)[_0xeb9b('0x26')](function(_0x303ce9){return _0x303ce9;});}return null;};}function removeEntity(_0xe5dba8,_0x474968){return function(_0x2c8ff4){if(_0x2c8ff4){return _0x2c8ff4[_0xeb9b('0x27')]()[_0xeb9b('0x26')](function(){_0xe5dba8[_0xeb9b('0x1c')](0xcc)[_0xeb9b('0x1d')]();});}};}function handleEntityNotFound(_0xe96745,_0x30587e){return function(_0x19ee5b){if(!_0x19ee5b){_0xe96745[_0xeb9b('0x1b')](0x194);}return _0x19ee5b;};}function handleError(_0xfad3c1,_0x5546b1){_0x5546b1=_0x5546b1||0x1f4;return function(_0x43a022){logger[_0xeb9b('0x28')](_0x43a022[_0xeb9b('0x29')]);if(_0x43a022[_0xeb9b('0x2a')]){delete _0x43a022[_0xeb9b('0x2a')];}_0xfad3c1[_0xeb9b('0x1c')](_0x5546b1)[_0xeb9b('0x2b')](_0x43a022);};}exports[_0xeb9b('0x2c')]=function(_0x3b097b,_0xc6595c){var _0x3d78f5={},_0x484ff5={},_0x5a0966={'count':0x0,'rows':[]};var _0x233c5a=_['map'](db[_0xeb9b('0x2d')][_0xeb9b('0x2e')],function(_0xa12c63){return{'name':_0xa12c63[_0xeb9b('0x2f')],'type':_0xa12c63['type']['key']};});_0x484ff5[_0xeb9b('0x30')]=_['map'](_0x233c5a,'name');_0x484ff5[_0xeb9b('0x31')]=_[_0xeb9b('0x32')](_0x3b097b['query']);_0x484ff5['filters']=_[_0xeb9b('0x33')](_0x484ff5['model'],_0x484ff5['query']);_0x3d78f5['attributes']=_['intersection'](_0x484ff5[_0xeb9b('0x30')],qs[_0xeb9b('0x34')](_0x3b097b['query'][_0xeb9b('0x34')]));_0x3d78f5[_0xeb9b('0x35')]=_0x3d78f5['attributes']['length']?_0x3d78f5[_0xeb9b('0x35')]:_0x484ff5[_0xeb9b('0x30')];if(!_0x3b097b[_0xeb9b('0x31')][_0xeb9b('0x36')](_0xeb9b('0x37'))){_0x3d78f5[_0xeb9b('0x20')]=qs['limit'](_0x3b097b['query'][_0xeb9b('0x20')]);_0x3d78f5[_0xeb9b('0x1f')]=qs[_0xeb9b('0x1f')](_0x3b097b[_0xeb9b('0x31')][_0xeb9b('0x1f')]);}_0x3d78f5[_0xeb9b('0x38')]=qs[_0xeb9b('0x39')](_0x3b097b[_0xeb9b('0x31')][_0xeb9b('0x39')]);_0x3d78f5['where']=qs[_0xeb9b('0x3a')](_[_0xeb9b('0x3b')](_0x3b097b[_0xeb9b('0x31')],_0x484ff5[_0xeb9b('0x3a')]),_0x233c5a);if(_0x3b097b[_0xeb9b('0x31')][_0xeb9b('0x3c')]){_0x3d78f5['where']=_['merge'](_0x3d78f5[_0xeb9b('0x3d')],{'$or':_[_0xeb9b('0x3e')](_0x233c5a,function(_0x382a73){if(_0x382a73[_0xeb9b('0x3f')]!==_0xeb9b('0x40')){var _0x41cb82={};_0x41cb82[_0x382a73[_0xeb9b('0x2a')]]={'$like':'%'+_0x3b097b[_0xeb9b('0x31')][_0xeb9b('0x3c')]+'%'};return _0x41cb82;}})});}_0x3d78f5=_[_0xeb9b('0x41')]({},_0x3d78f5,_0x3b097b[_0xeb9b('0x42')]);var _0x562c19={'where':_0x3d78f5[_0xeb9b('0x3d')]};return db[_0xeb9b('0x2d')][_0xeb9b('0x21')](_0x562c19)[_0xeb9b('0x26')](function(_0x276821){_0x5a0966[_0xeb9b('0x21')]=_0x276821;if(_0x3b097b[_0xeb9b('0x31')]['includeAll']){_0x3d78f5[_0xeb9b('0x43')]=[{'all':!![]}];}return db[_0xeb9b('0x2d')]['findAll'](_0x3d78f5);})[_0xeb9b('0x26')](function(_0x5a1508){_0x5a0966[_0xeb9b('0x44')]=_0x5a1508;return _0x5a0966;})[_0xeb9b('0x26')](respondWithFilteredResult(_0xc6595c,_0x3d78f5))[_0xeb9b('0x45')](handleError(_0xc6595c,null));};exports['show']=function(_0x388fe6,_0x11821b){var _0x554b6d={'raw':!![],'where':{'id':_0x388fe6[_0xeb9b('0x46')]['id']}},_0x6be9dd={};_0x6be9dd[_0xeb9b('0x30')]=_[_0xeb9b('0x32')](db[_0xeb9b('0x2d')][_0xeb9b('0x2e')]);_0x6be9dd['query']=_['keys'](_0x388fe6[_0xeb9b('0x31')]);_0x6be9dd['filters']=_['intersection'](_0x6be9dd[_0xeb9b('0x30')],_0x6be9dd['query']);_0x554b6d['attributes']=_[_0xeb9b('0x33')](_0x6be9dd['model'],qs['fields'](_0x388fe6[_0xeb9b('0x31')][_0xeb9b('0x34')]));_0x554b6d[_0xeb9b('0x35')]=_0x554b6d[_0xeb9b('0x35')][_0xeb9b('0x47')]?_0x554b6d['attributes']:_0x6be9dd[_0xeb9b('0x30')];if(_0x388fe6[_0xeb9b('0x31')][_0xeb9b('0x48')]){_0x554b6d['include']=[{'all':!![]}];}_0x554b6d=_[_0xeb9b('0x41')]({},_0x554b6d,_0x388fe6[_0xeb9b('0x42')]);return db[_0xeb9b('0x2d')]['find'](_0x554b6d)[_0xeb9b('0x26')](handleEntityNotFound(_0x11821b,null))['then'](respondWithResult(_0x11821b,null))['catch'](handleError(_0x11821b,null));};exports['create']=function(_0x14343a,_0x4e8c81){return db[_0xeb9b('0x2d')][_0xeb9b('0x49')](_0x14343a[_0xeb9b('0x4a')],{})[_0xeb9b('0x26')](respondWithResult(_0x4e8c81,0xc9))[_0xeb9b('0x45')](handleError(_0x4e8c81,null));};exports[_0xeb9b('0x25')]=function(_0x592f93,_0x1087b3){if(_0x592f93[_0xeb9b('0x4a')]['id']){delete _0x592f93[_0xeb9b('0x4a')]['id'];}return db[_0xeb9b('0x2d')][_0xeb9b('0x4b')]({'where':{'id':_0x592f93[_0xeb9b('0x46')]['id']}})[_0xeb9b('0x26')](handleEntityNotFound(_0x1087b3,null))['then'](saveUpdates(_0x592f93['body'],null))['then'](respondWithResult(_0x1087b3,null))[_0xeb9b('0x45')](handleError(_0x1087b3,null));};exports[_0xeb9b('0x27')]=function(_0x57f6ab,_0x366e70){return db[_0xeb9b('0x2d')][_0xeb9b('0x4b')]({'where':{'id':_0x57f6ab[_0xeb9b('0x46')]['id']}})[_0xeb9b('0x26')](handleEntityNotFound(_0x366e70,null))[_0xeb9b('0x26')](removeEntity(_0x366e70,null))[_0xeb9b('0x45')](handleError(_0x366e70,null));};exports[_0xeb9b('0x4c')]=function(_0x10d566,_0x13ea7e){return db['JscriptySessionReport'][_0xeb9b('0x4c')]()[_0xeb9b('0x26')](respondWithResult(_0x13ea7e,null))[_0xeb9b('0x45')](handleError(_0x13ea7e,null));};exports[_0xeb9b('0x4d')]=function(_0x454e55,_0x4b1528,_0xc47606){var _0x4799f9={'raw':!![],'where':{}};var _0x495100={};var _0x14a3a7={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xeb9b('0x4e')]({'where':{'id':_0x454e55[_0xeb9b('0x46')]['id']}})[_0xeb9b('0x26')](handleEntityNotFound(_0x4b1528,null))[_0xeb9b('0x26')](function(_0xcfc2c){if(_0xcfc2c){_0x495100[_0xeb9b('0x30')]=_[_0xeb9b('0x32')](db[_0xeb9b('0x4f')]['rawAttributes']);_0x495100[_0xeb9b('0x31')]=_[_0xeb9b('0x32')](_0x454e55[_0xeb9b('0x31')]);_0x495100[_0xeb9b('0x3a')]=_[_0xeb9b('0x33')](_0x495100[_0xeb9b('0x30')],_0x495100[_0xeb9b('0x31')]);_0x4799f9['attributes']=_[_0xeb9b('0x33')](_0x495100[_0xeb9b('0x30')],qs['fields'](_0x454e55[_0xeb9b('0x31')][_0xeb9b('0x34')]));_0x4799f9[_0xeb9b('0x35')]=_0x4799f9[_0xeb9b('0x35')][_0xeb9b('0x47')]?_0x4799f9[_0xeb9b('0x35')]:_0x495100[_0xeb9b('0x30')];if(!_0x454e55['query']['hasOwnProperty'](_0xeb9b('0x37'))){_0x4799f9[_0xeb9b('0x20')]=qs[_0xeb9b('0x20')](_0x454e55[_0xeb9b('0x31')][_0xeb9b('0x20')]);_0x4799f9[_0xeb9b('0x1f')]=qs['offset'](_0x454e55['query'][_0xeb9b('0x1f')]);}_0x4799f9['order']=qs[_0xeb9b('0x39')](_0x454e55['query'][_0xeb9b('0x39')]);_0x4799f9[_0xeb9b('0x3d')]=qs['filters'](_[_0xeb9b('0x3b')](_0x454e55[_0xeb9b('0x31')],_0x495100[_0xeb9b('0x3a')]));_0x4799f9[_0xeb9b('0x3d')]['SessionId']=_0xcfc2c['id'];if(_0x454e55[_0xeb9b('0x31')][_0xeb9b('0x3c')]){_0x4799f9['where']=_[_0xeb9b('0x41')](_0x4799f9[_0xeb9b('0x3d')],{'$or':_['map'](_0x4799f9['attributes'],function(_0x35d2e0){var _0x570d54={};_0x570d54[_0x35d2e0]={'$like':'%'+_0x454e55[_0xeb9b('0x31')]['filter']+'%'};return _0x570d54;})});}_0x4799f9=_[_0xeb9b('0x41')]({},_0x4799f9,_0x454e55[_0xeb9b('0x42')]);return db['JscriptyQuestionReport'][_0xeb9b('0x21')]({'where':_0x4799f9['where']})[_0xeb9b('0x26')](function(_0x5a8c03){_0x14a3a7['count']=_0x5a8c03;if(_0x454e55['query']['includeAll']){_0x4799f9[_0xeb9b('0x43')]=[{'all':!![]}];}return db[_0xeb9b('0x4f')][_0xeb9b('0x50')](_0x4799f9);})[_0xeb9b('0x26')](function(_0x27e3e1){_0x14a3a7[_0xeb9b('0x44')]=_0x27e3e1;return _0x14a3a7;});}})[_0xeb9b('0x26')](respondWithFilteredResult(_0x4b1528,_0x4799f9))['catch'](handleError(_0x4b1528,null));}; \ No newline at end of file +var _0xcf6a=['model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','set','apply','reject','save','then','stack','name','send','map','JscriptySessionReport','rawAttributes','fieldName','key','query','filters','intersection'];(function(_0x1c6596,_0x59c8cb){var _0x4c1af1=function(_0x1af815){while(--_0x1af815){_0x1c6596['push'](_0x1c6596['shift']());}};_0x4c1af1(++_0x59c8cb);}(_0xcf6a,0xb8));var _0xacf6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xcf6a[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xacf6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xacf6('0x1'));var jsonpatch=require(_0xacf6('0x2'));var rp=require(_0xacf6('0x3'));var moment=require(_0xacf6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xacf6('0x5'));var util=require(_0xacf6('0x6'));var path=require('path');var sox=require(_0xacf6('0x7'));var csv=require('to-csv');var ejs=require(_0xacf6('0x8'));var fs=require('fs');var fs_extra=require(_0xacf6('0x9'));var _=require(_0xacf6('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xacf6('0xb'));var toCsv=require(_0xacf6('0xc'));var querystring=require('querystring');var Papa=require(_0xacf6('0xd'));var Redis=require('ioredis');var authService=require(_0xacf6('0xe'));var qs=require(_0xacf6('0xf'));var as=require(_0xacf6('0x10'));var hardwareService=require(_0xacf6('0x11'));var logger=require(_0xacf6('0x12'))(_0xacf6('0x13'));var utils=require(_0xacf6('0x14'));var config=require(_0xacf6('0x15'));var licenseUtil=require(_0xacf6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45c38e,_0x4985b3){_0x4985b3=_0x4985b3||0xcc;return function(_0x427cdd){if(_0x427cdd){return _0x45c38e[_0xacf6('0x17')](_0x4985b3);}return _0x45c38e['status'](_0x4985b3)[_0xacf6('0x18')]();};}function respondWithResult(_0x35a504,_0x3d9526){_0x3d9526=_0x3d9526||0xc8;return function(_0x3f7841){if(_0x3f7841){return _0x35a504[_0xacf6('0x19')](_0x3d9526)[_0xacf6('0x1a')](_0x3f7841);}};}function respondWithFilteredResult(_0x4c7bc4,_0x1e78fa){return function(_0x515fcb){if(_0x515fcb){var _0x5b2f90=typeof _0x1e78fa['offset']===_0xacf6('0x1b')&&typeof _0x1e78fa['limit']==='undefined';var _0x29a3a2=_0x515fcb[_0xacf6('0x1c')];var _0x3c7791=_0x5b2f90?0x0:_0x1e78fa[_0xacf6('0x1d')];var _0x1accf8=_0x5b2f90?_0x515fcb[_0xacf6('0x1c')]:_0x1e78fa[_0xacf6('0x1d')]+_0x1e78fa[_0xacf6('0x1e')];var _0x3f4b27;if(_0x1accf8>=_0x29a3a2){_0x1accf8=_0x29a3a2;_0x3f4b27=0xc8;}else{_0x3f4b27=0xce;}_0x4c7bc4['status'](_0x3f4b27);return _0x4c7bc4[_0xacf6('0x1f')]('Content-Range',_0x3c7791+'-'+_0x1accf8+'/'+_0x29a3a2)[_0xacf6('0x1a')](_0x515fcb);}return null;};}function patchUpdates(_0x2d6b01){return function(_0x1e17d0){try{jsonpatch[_0xacf6('0x20')](_0x1e17d0,_0x2d6b01,!![]);}catch(_0x298e1f){return BPromise[_0xacf6('0x21')](_0x298e1f);}return _0x1e17d0[_0xacf6('0x22')]();};}function saveUpdates(_0x30c9f9,_0xc01b8e){return function(_0x40c230){if(_0x40c230){return _0x40c230['update'](_0x30c9f9)[_0xacf6('0x23')](function(_0x26db28){return _0x26db28;});}return null;};}function removeEntity(_0x1d95f1,_0x2ff114){return function(_0x39092e){if(_0x39092e){return _0x39092e['destroy']()['then'](function(){_0x1d95f1[_0xacf6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26551c,_0x21a138){return function(_0x54eaaa){if(!_0x54eaaa){_0x26551c['sendStatus'](0x194);}return _0x54eaaa;};}function handleError(_0xf9ab6f,_0x483a95){_0x483a95=_0x483a95||0x1f4;return function(_0x1ae84e){logger['error'](_0x1ae84e[_0xacf6('0x24')]);if(_0x1ae84e[_0xacf6('0x25')]){delete _0x1ae84e[_0xacf6('0x25')];}_0xf9ab6f[_0xacf6('0x19')](_0x483a95)[_0xacf6('0x26')](_0x1ae84e);};}exports['index']=function(_0xbce028,_0x18ebd6){var _0x29f8c0={},_0x1e1f85={},_0x43e393={'count':0x0,'rows':[]};var _0x1549d8=_[_0xacf6('0x27')](db[_0xacf6('0x28')][_0xacf6('0x29')],function(_0x47f653){return{'name':_0x47f653[_0xacf6('0x2a')],'type':_0x47f653['type'][_0xacf6('0x2b')]};});_0x1e1f85['model']=_[_0xacf6('0x27')](_0x1549d8,_0xacf6('0x25'));_0x1e1f85[_0xacf6('0x2c')]=_['keys'](_0xbce028['query']);_0x1e1f85[_0xacf6('0x2d')]=_[_0xacf6('0x2e')](_0x1e1f85[_0xacf6('0x2f')],_0x1e1f85[_0xacf6('0x2c')]);_0x29f8c0[_0xacf6('0x30')]=_['intersection'](_0x1e1f85[_0xacf6('0x2f')],qs[_0xacf6('0x31')](_0xbce028[_0xacf6('0x2c')]['fields']));_0x29f8c0['attributes']=_0x29f8c0[_0xacf6('0x30')][_0xacf6('0x32')]?_0x29f8c0[_0xacf6('0x30')]:_0x1e1f85[_0xacf6('0x2f')];if(!_0xbce028[_0xacf6('0x2c')][_0xacf6('0x33')](_0xacf6('0x34'))){_0x29f8c0[_0xacf6('0x1e')]=qs[_0xacf6('0x1e')](_0xbce028[_0xacf6('0x2c')][_0xacf6('0x1e')]);_0x29f8c0[_0xacf6('0x1d')]=qs[_0xacf6('0x1d')](_0xbce028[_0xacf6('0x2c')][_0xacf6('0x1d')]);}_0x29f8c0[_0xacf6('0x35')]=qs['sort'](_0xbce028['query'][_0xacf6('0x36')]);_0x29f8c0[_0xacf6('0x37')]=qs[_0xacf6('0x2d')](_['pick'](_0xbce028[_0xacf6('0x2c')],_0x1e1f85[_0xacf6('0x2d')]),_0x1549d8);if(_0xbce028[_0xacf6('0x2c')][_0xacf6('0x38')]){_0x29f8c0[_0xacf6('0x37')]=_[_0xacf6('0x39')](_0x29f8c0[_0xacf6('0x37')],{'$or':_[_0xacf6('0x27')](_0x1549d8,function(_0x596a12){if(_0x596a12[_0xacf6('0x3a')]!==_0xacf6('0x3b')){var _0x26991a={};_0x26991a[_0x596a12[_0xacf6('0x25')]]={'$like':'%'+_0xbce028[_0xacf6('0x2c')][_0xacf6('0x38')]+'%'};return _0x26991a;}})});}_0x29f8c0=_['merge']({},_0x29f8c0,_0xbce028[_0xacf6('0x3c')]);var _0x11ea98={'where':_0x29f8c0[_0xacf6('0x37')]};return db['JscriptySessionReport'][_0xacf6('0x1c')](_0x11ea98)['then'](function(_0x4f65d6){_0x43e393[_0xacf6('0x1c')]=_0x4f65d6;if(_0xbce028[_0xacf6('0x2c')][_0xacf6('0x3d')]){_0x29f8c0[_0xacf6('0x3e')]=[{'all':!![]}];}return db[_0xacf6('0x28')][_0xacf6('0x3f')](_0x29f8c0);})[_0xacf6('0x23')](function(_0x4e2d73){_0x43e393[_0xacf6('0x40')]=_0x4e2d73;return _0x43e393;})[_0xacf6('0x23')](respondWithFilteredResult(_0x18ebd6,_0x29f8c0))[_0xacf6('0x41')](handleError(_0x18ebd6,null));};exports[_0xacf6('0x42')]=function(_0x2db746,_0x30a664){var _0x34226a={'raw':!![],'where':{'id':_0x2db746[_0xacf6('0x43')]['id']}},_0x4790b5={};_0x4790b5[_0xacf6('0x2f')]=_['keys'](db[_0xacf6('0x28')][_0xacf6('0x29')]);_0x4790b5[_0xacf6('0x2c')]=_[_0xacf6('0x44')](_0x2db746[_0xacf6('0x2c')]);_0x4790b5[_0xacf6('0x2d')]=_['intersection'](_0x4790b5[_0xacf6('0x2f')],_0x4790b5[_0xacf6('0x2c')]);_0x34226a[_0xacf6('0x30')]=_[_0xacf6('0x2e')](_0x4790b5[_0xacf6('0x2f')],qs['fields'](_0x2db746[_0xacf6('0x2c')][_0xacf6('0x31')]));_0x34226a['attributes']=_0x34226a[_0xacf6('0x30')][_0xacf6('0x32')]?_0x34226a[_0xacf6('0x30')]:_0x4790b5[_0xacf6('0x2f')];if(_0x2db746['query'][_0xacf6('0x3d')]){_0x34226a[_0xacf6('0x3e')]=[{'all':!![]}];}_0x34226a=_['merge']({},_0x34226a,_0x2db746[_0xacf6('0x3c')]);return db['JscriptySessionReport']['find'](_0x34226a)[_0xacf6('0x23')](handleEntityNotFound(_0x30a664,null))[_0xacf6('0x23')](respondWithResult(_0x30a664,null))['catch'](handleError(_0x30a664,null));};exports[_0xacf6('0x45')]=function(_0xa53567,_0x123ae6){return db['JscriptySessionReport'][_0xacf6('0x45')](_0xa53567['body'],{})[_0xacf6('0x23')](respondWithResult(_0x123ae6,0xc9))[_0xacf6('0x41')](handleError(_0x123ae6,null));};exports['update']=function(_0x4a0db0,_0x43bff5){if(_0x4a0db0[_0xacf6('0x46')]['id']){delete _0x4a0db0[_0xacf6('0x46')]['id'];}return db[_0xacf6('0x28')][_0xacf6('0x47')]({'where':{'id':_0x4a0db0[_0xacf6('0x43')]['id']}})[_0xacf6('0x23')](handleEntityNotFound(_0x43bff5,null))[_0xacf6('0x23')](saveUpdates(_0x4a0db0['body'],null))[_0xacf6('0x23')](respondWithResult(_0x43bff5,null))[_0xacf6('0x41')](handleError(_0x43bff5,null));};exports['destroy']=function(_0xffb33e,_0x1ed46d){return db[_0xacf6('0x28')][_0xacf6('0x47')]({'where':{'id':_0xffb33e['params']['id']}})['then'](handleEntityNotFound(_0x1ed46d,null))['then'](removeEntity(_0x1ed46d,null))['catch'](handleError(_0x1ed46d,null));};exports[_0xacf6('0x48')]=function(_0x56b74c,_0x5ab3e6){return db[_0xacf6('0x28')]['describe']()[_0xacf6('0x23')](respondWithResult(_0x5ab3e6,null))[_0xacf6('0x41')](handleError(_0x5ab3e6,null));};exports[_0xacf6('0x49')]=function(_0x374815,_0x44284c,_0xb222de){var _0x2b1f21={'raw':!![],'where':{}};var _0x5deb8c={};var _0x10400b={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xacf6('0x4a')]({'where':{'id':_0x374815[_0xacf6('0x43')]['id']}})['then'](handleEntityNotFound(_0x44284c,null))[_0xacf6('0x23')](function(_0x60c482){if(_0x60c482){_0x5deb8c[_0xacf6('0x2f')]=_['keys'](db[_0xacf6('0x4b')]['rawAttributes']);_0x5deb8c['query']=_[_0xacf6('0x44')](_0x374815[_0xacf6('0x2c')]);_0x5deb8c[_0xacf6('0x2d')]=_[_0xacf6('0x2e')](_0x5deb8c['model'],_0x5deb8c['query']);_0x2b1f21[_0xacf6('0x30')]=_[_0xacf6('0x2e')](_0x5deb8c[_0xacf6('0x2f')],qs[_0xacf6('0x31')](_0x374815[_0xacf6('0x2c')]['fields']));_0x2b1f21[_0xacf6('0x30')]=_0x2b1f21[_0xacf6('0x30')][_0xacf6('0x32')]?_0x2b1f21[_0xacf6('0x30')]:_0x5deb8c[_0xacf6('0x2f')];if(!_0x374815['query'][_0xacf6('0x33')]('nolimit')){_0x2b1f21[_0xacf6('0x1e')]=qs[_0xacf6('0x1e')](_0x374815[_0xacf6('0x2c')]['limit']);_0x2b1f21['offset']=qs['offset'](_0x374815[_0xacf6('0x2c')][_0xacf6('0x1d')]);}_0x2b1f21[_0xacf6('0x35')]=qs[_0xacf6('0x36')](_0x374815[_0xacf6('0x2c')][_0xacf6('0x36')]);_0x2b1f21[_0xacf6('0x37')]=qs[_0xacf6('0x2d')](_['pick'](_0x374815[_0xacf6('0x2c')],_0x5deb8c['filters']));_0x2b1f21[_0xacf6('0x37')][_0xacf6('0x4c')]=_0x60c482['id'];if(_0x374815['query']['filter']){_0x2b1f21[_0xacf6('0x37')]=_[_0xacf6('0x39')](_0x2b1f21['where'],{'$or':_['map'](_0x2b1f21[_0xacf6('0x30')],function(_0x337661){var _0x41b8c5={};_0x41b8c5[_0x337661]={'$like':'%'+_0x374815[_0xacf6('0x2c')]['filter']+'%'};return _0x41b8c5;})});}_0x2b1f21=_[_0xacf6('0x39')]({},_0x2b1f21,_0x374815[_0xacf6('0x3c')]);return db[_0xacf6('0x4b')][_0xacf6('0x1c')]({'where':_0x2b1f21[_0xacf6('0x37')]})['then'](function(_0x15d27b){_0x10400b[_0xacf6('0x1c')]=_0x15d27b;if(_0x374815[_0xacf6('0x2c')][_0xacf6('0x3d')]){_0x2b1f21[_0xacf6('0x3e')]=[{'all':!![]}];}return db[_0xacf6('0x4b')][_0xacf6('0x3f')](_0x2b1f21);})[_0xacf6('0x23')](function(_0x3244dc){_0x10400b['rows']=_0x3244dc;return _0x10400b;});}})[_0xacf6('0x23')](respondWithFilteredResult(_0x44284c,_0x2b1f21))['catch'](handleError(_0x44284c,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 05c2c20..efba630 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 _0xafc4=['path','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xafc4,0x69));var _0x4afc=function(_0x450dcb,_0x4554e9){_0x450dcb=_0x450dcb-0x0;var _0x319cea=_0xafc4[_0x450dcb];return _0x319cea;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','lodash','util','../../config/logger','api','moment'];(function(_0x22a939,_0xc74452){var _0x1173f7=function(_0x2ae5f6){while(--_0x2ae5f6){_0x22a939['push'](_0x22a939['shift']());}};_0x1173f7(++_0xc74452);}(_0x53ec,0x192));var _0xc53e=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0x53ec[_0x15cdcb];return _0x37b069;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_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 bee85d3..975b5eb 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 _0x9582=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x25f357,_0x39b78e){var _0x225c2e=function(_0x2038c1){while(--_0x2038c1){_0x25f357['push'](_0x25f357['shift']());}};_0x225c2e(++_0x39b78e);}(_0x9582,0x95));var _0x2958=function(_0x145a01,_0x328a06){_0x145a01=_0x145a01-0x0;var _0x5157f7=_0x9582[_0x145a01];return _0x5157f7;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309525,_0xa385ec,_0x2e571b){return new BPromise(function(_0x56ca85,_0x5ec1b3){return client[_0x2958('0xd')](_0x309525,_0x2e571b)['then'](function(_0x10db1e){logger['info'](_0x2958('0xe'),_0xa385ec,'request\x20sent');logger[_0x2958('0xf')](_0x2958('0x10'),_0xa385ec,_0x2958('0x11'),JSON[_0x2958('0x12')](_0x10db1e));if(_0x10db1e[_0x2958('0x13')]){if(_0x10db1e['error'][_0x2958('0x14')]===0x1f4){logger[_0x2958('0x13')](_0x2958('0xe'),_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x5ec1b3(_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);}logger[_0x2958('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x56ca85(_0x10db1e['error']['message']);}else{logger[_0x2958('0x16')](_0x2958('0xe'),_0xa385ec,'request\x20sent');_0x56ca85(_0x10db1e[_0x2958('0x17')]['message']);}})['catch'](function(_0x429d42){logger[_0x2958('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0xa385ec,_0x429d42);_0x5ec1b3(_0x429d42);});});} \ No newline at end of file +var _0x9536=['request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','JscriptySessionReport,\x20%s,\x20%s'];(function(_0xc11899,_0x2376ce){var _0x1ad8fa=function(_0x347f0f){while(--_0x347f0f){_0xc11899['push'](_0xc11899['shift']());}};_0x1ad8fa(++_0x2376ce);}(_0x9536,0x179));var _0x6953=function(_0x548200,_0x3241b8){_0x548200=_0x548200-0x0;var _0x1a6d74=_0x9536[_0x548200];return _0x1a6d74;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var moment=require(_0x6953('0x2'));var BPromise=require(_0x6953('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6953('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6953('0x5'));var logger=require(_0x6953('0x6'))(_0x6953('0x7'));var config=require(_0x6953('0x8'));var jayson=require(_0x6953('0x9'));var client=jayson['client'][_0x6953('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bb026,_0x385f2d,_0x3e1aff){return new BPromise(function(_0x1c8225,_0x58ac30){return client[_0x6953('0xb')](_0x2bb026,_0x3e1aff)[_0x6953('0xc')](function(_0x449acb){logger['info'](_0x6953('0xd'),_0x385f2d,_0x6953('0xe'));logger[_0x6953('0xf')](_0x6953('0x10'),_0x385f2d,_0x6953('0xe'),JSON[_0x6953('0x11')](_0x449acb));if(_0x449acb[_0x6953('0x12')]){if(_0x449acb[_0x6953('0x12')][_0x6953('0x13')]===0x1f4){logger['error'](_0x6953('0xd'),_0x385f2d,_0x449acb['error'][_0x6953('0x14')]);return _0x58ac30(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}logger[_0x6953('0x12')](_0x6953('0xd'),_0x385f2d,_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);return _0x1c8225(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}else{logger[_0x6953('0x15')](_0x6953('0xd'),_0x385f2d,'request\x20sent');_0x1c8225(_0x449acb['result'][_0x6953('0x14')]);}})[_0x6953('0x16')](function(_0x16b79b){logger[_0x6953('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x385f2d,_0x16b79b);_0x58ac30(_0x16b79b);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 9343361..acfd906 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 _0x3067=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','/download_log_file','isAuthenticated','downloadLogFile','exports','multer','util','path'];(function(_0x2609ad,_0x23f9ef){var _0x58275f=function(_0x54d850){while(--_0x54d850){_0x2609ad['push'](_0x2609ad['shift']());}};_0x58275f(++_0x23f9ef);}(_0x3067,0xb8));var _0x7306=function(_0x1bc9fb,_0x48ab27){_0x1bc9fb=_0x1bc9fb-0x0;var _0x20aedc=_0x3067[_0x1bc9fb];return _0x20aedc;};'use strict';var multer=require(_0x7306('0x0'));var util=require(_0x7306('0x1'));var path=require(_0x7306('0x2'));var timeout=require('connect-timeout');var express=require(_0x7306('0x3'));var router=express[_0x7306('0x4')]();var fs_extra=require(_0x7306('0x5'));var auth=require(_0x7306('0x6'));var interaction=require(_0x7306('0x7'));var config=require(_0x7306('0x8'));var controller=require(_0x7306('0x9'));router[_0x7306('0xa')]('/',controller[_0x7306('0xb')]);router['put'](_0x7306('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x7306('0xa')](_0x7306('0xd'),auth[_0x7306('0xe')](),controller[_0x7306('0xf')]);module[_0x7306('0x10')]=router; \ No newline at end of file +var _0x5a49=['Router','fs-extra','../../config/environment','./license.controller','get','/:id','/download_log_file','isAuthenticated','downloadLogFile','util','path','connect-timeout','express'];(function(_0x256104,_0x333d7e){var _0x2c1152=function(_0x5e0775){while(--_0x5e0775){_0x256104['push'](_0x256104['shift']());}};_0x2c1152(++_0x333d7e);}(_0x5a49,0x1a9));var _0x95a4=function(_0x4153de,_0x25e26d){_0x4153de=_0x4153de-0x0;var _0x3d379b=_0x5a49[_0x4153de];return _0x3d379b;};'use strict';var multer=require('multer');var util=require(_0x95a4('0x0'));var path=require(_0x95a4('0x1'));var timeout=require(_0x95a4('0x2'));var express=require(_0x95a4('0x3'));var router=express[_0x95a4('0x4')]();var fs_extra=require(_0x95a4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x95a4('0x6'));var controller=require(_0x95a4('0x7'));router[_0x95a4('0x8')]('/',controller['index']);router['put'](_0x95a4('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x95a4('0x8')](_0x95a4('0xa'),auth[_0x95a4('0xb')](),controller[_0x95a4('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index e845625..2b0be27 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 _0xfdcb=['sequelize','exports','STRING'];(function(_0x4753c5,_0x5ade3c){var _0x38c364=function(_0x5f468e){while(--_0x5f468e){_0x4753c5['push'](_0x4753c5['shift']());}};_0x38c364(++_0x5ade3c);}(_0xfdcb,0x1b9));var _0xbfdc=function(_0x217372,_0x1822ce){_0x217372=_0x217372-0x0;var _0x2715a1=_0xfdcb[_0x217372];return _0x2715a1;};'use strict';var Sequelize=require(_0xbfdc('0x0'));module[_0xbfdc('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xbfdc('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x670b=['sequelize','exports','TEXT','STRING'];(function(_0x410c4c,_0x5a4b5b){var _0x33c763=function(_0x648d29){while(--_0x648d29){_0x410c4c['push'](_0x410c4c['shift']());}};_0x33c763(++_0x5a4b5b);}(_0x670b,0x184));var _0xb670=function(_0x5a7de2,_0x27221f){_0x5a7de2=_0x5a7de2-0x0;var _0x390322=_0x670b[_0x5a7de2];return _0x390322;};'use strict';var Sequelize=require(_0xb670('0x0'));module[_0xb670('0x1')]={'license':{'type':Sequelize[_0xb670('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xb670('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 89dca8f..d54bffe 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 _0xacdb=['util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','model','keys','License','rawAttributes','query','attributes','intersection','fields','length','merge','options','getLicense','catch','body','find','params','get','key','demo','downloadLogFile','join','/var','log','setHeader','Content-disposition','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x324b04,_0x1bdc6e){var _0x123b5e=function(_0x6ec089){while(--_0x6ec089){_0x324b04['push'](_0x324b04['shift']());}};_0x123b5e(++_0x1bdc6e);}(_0xacdb,0x11a));var _0xbacd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xacdb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbacd('0x0'));var zipdir=require(_0xbacd('0x1'));var jsonpatch=require(_0xbacd('0x2'));var rp=require(_0xbacd('0x3'));var moment=require(_0xbacd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbacd('0x5'));var util=require(_0xbacd('0x6'));var path=require('path');var sox=require(_0xbacd('0x7'));var csv=require('to-csv');var ejs=require(_0xbacd('0x8'));var fs=require('fs');var fs_extra=require(_0xbacd('0x9'));var _=require(_0xbacd('0xa'));var squel=require(_0xbacd('0xb'));var crypto=require('crypto');var jsforce=require(_0xbacd('0xc'));var deskjs=require(_0xbacd('0xd'));var toCsv=require(_0xbacd('0xe'));var querystring=require(_0xbacd('0xf'));var Papa=require(_0xbacd('0x10'));var Redis=require(_0xbacd('0x11'));var authService=require(_0xbacd('0x12'));var qs=require(_0xbacd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbacd('0x14'));var logger=require(_0xbacd('0x15'))(_0xbacd('0x16'));var utils=require(_0xbacd('0x17'));var config=require(_0xbacd('0x18'));var licenseUtil=require(_0xbacd('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42a6df,_0x2d40ca){_0x2d40ca=_0x2d40ca||0xcc;return function(_0x57820d){if(_0x57820d){return _0x42a6df[_0xbacd('0x1a')](_0x2d40ca);}return _0x42a6df[_0xbacd('0x1b')](_0x2d40ca)[_0xbacd('0x1c')]();};}function respondWithResult(_0x4b38a8,_0x47b50d){_0x47b50d=_0x47b50d||0xc8;return function(_0x28ce22){if(_0x28ce22){return _0x4b38a8[_0xbacd('0x1b')](_0x47b50d)[_0xbacd('0x1d')](_0x28ce22);}};}function respondWithFilteredResult(_0x4f3d72,_0x53d235){return function(_0x34122a){if(_0x34122a){var _0x40b101=typeof _0x53d235[_0xbacd('0x1e')]===_0xbacd('0x1f')&&typeof _0x53d235[_0xbacd('0x20')]===_0xbacd('0x1f');var _0x517313=_0x34122a[_0xbacd('0x21')];var _0x2340d9=_0x40b101?0x0:_0x53d235[_0xbacd('0x1e')];var _0x2e0e47=_0x40b101?_0x34122a[_0xbacd('0x21')]:_0x53d235['offset']+_0x53d235[_0xbacd('0x20')];var _0x390d65;if(_0x2e0e47>=_0x517313){_0x2e0e47=_0x517313;_0x390d65=0xc8;}else{_0x390d65=0xce;}_0x4f3d72[_0xbacd('0x1b')](_0x390d65);return _0x4f3d72[_0xbacd('0x22')](_0xbacd('0x23'),_0x2340d9+'-'+_0x2e0e47+'/'+_0x517313)[_0xbacd('0x1d')](_0x34122a);}return null;};}function patchUpdates(_0x148034){return function(_0x4c7269){try{jsonpatch['apply'](_0x4c7269,_0x148034,!![]);}catch(_0x59d530){return BPromise[_0xbacd('0x24')](_0x59d530);}return _0x4c7269[_0xbacd('0x25')]();};}function saveUpdates(_0x4e5e27,_0xd117d1){return function(_0x2c17b5){if(_0x2c17b5){return _0x2c17b5[_0xbacd('0x26')](_0x4e5e27)['then'](function(_0x5dfbf5){return _0x5dfbf5;});}return null;};}function removeEntity(_0x4d7af6,_0x44c256){return function(_0x38c20f){if(_0x38c20f){return _0x38c20f[_0xbacd('0x27')]()[_0xbacd('0x28')](function(){_0x4d7af6['status'](0xcc)[_0xbacd('0x1c')]();});}};}function handleEntityNotFound(_0x5b1431,_0x169555){return function(_0x4073f5){if(!_0x4073f5){_0x5b1431['sendStatus'](0x194);}return _0x4073f5;};}function handleError(_0x3bc3a0,_0x2e9524){_0x2e9524=_0x2e9524||0x1f4;return function(_0x3a341f){logger[_0xbacd('0x29')](_0x3a341f[_0xbacd('0x2a')]);if(_0x3a341f['name']){delete _0x3a341f[_0xbacd('0x2b')];}_0x3bc3a0[_0xbacd('0x1b')](_0x2e9524)[_0xbacd('0x2c')](_0x3a341f);};}var utilLicense=require(_0xbacd('0x19'));exports[_0xbacd('0x2d')]=function(_0xdc5e2e,_0x1f6ef3){var _0x1f3713={'raw':!![],'where':{'id':0x1}},_0x140730={};_0x140730[_0xbacd('0x2e')]=_[_0xbacd('0x2f')](db[_0xbacd('0x30')][_0xbacd('0x31')]);_0x140730[_0xbacd('0x32')]=_['keys'](_0xdc5e2e[_0xbacd('0x32')]);_0x140730['filters']=_['intersection'](_0x140730[_0xbacd('0x2e')],_0x140730[_0xbacd('0x32')]);_0x1f3713[_0xbacd('0x33')]=_[_0xbacd('0x34')](_0x140730[_0xbacd('0x2e')],qs[_0xbacd('0x35')](_0xdc5e2e['query'][_0xbacd('0x35')]));_0x1f3713['attributes']=_0x1f3713[_0xbacd('0x33')][_0xbacd('0x36')]?_0x1f3713['attributes']:_0x140730[_0xbacd('0x2e')];_0x1f3713=_[_0xbacd('0x37')]({},_0x1f3713,_0xdc5e2e[_0xbacd('0x38')]);return utilLicense[_0xbacd('0x39')](_0x1f3713)[_0xbacd('0x28')](respondWithResult(_0x1f6ef3,null))[_0xbacd('0x3a')](handleError(_0x1f6ef3,null));};exports['update']=function(_0x1f7979,_0x135bad){if(_0x1f7979['body']['id']){delete _0x1f7979[_0xbacd('0x3b')]['id'];}return db[_0xbacd('0x30')][_0xbacd('0x3c')]({'where':{'id':_0x1f7979[_0xbacd('0x3d')]['id']}})[_0xbacd('0x28')](handleEntityNotFound(_0x135bad,null))[_0xbacd('0x28')](function(_0x1780b1){var _0x81b708=_0x1780b1[_0xbacd('0x3e')]({'plain':!![]});return utilLicense['checkLicense'](_0x81b708,_0x1f7979[_0xbacd('0x3b')][_0xbacd('0x3f')]);})[_0xbacd('0x28')](function(_0x5a8f52){if(!_0x5a8f52[_0xbacd('0x40')]){return saveUpdates(_0x1f7979[_0xbacd('0x3b')],null);}return _0x5a8f52;})[_0xbacd('0x28')](respondWithResult(_0x135bad,null))[_0xbacd('0x3a')](handleError(_0x135bad,null));};exports[_0xbacd('0x41')]=function(_0x33353d,_0x37a7f5){var _0x5d4093='license-info.log';var _0x1060ad=path[_0xbacd('0x42')](_0xbacd('0x43'),_0xbacd('0x44'),'xcally',_0x5d4093);_0x37a7f5[_0xbacd('0x45')](_0xbacd('0x46'),'attachment;\x20filename='+_0x5d4093);_0x37a7f5['set']('Content-Type','text/plain');_0x37a7f5[_0xbacd('0x47')](_0x1060ad);}; \ No newline at end of file +var _0x438e=['fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','index','model','keys','License','rawAttributes','query','intersection','fields','attributes','length','options','getLicense','catch','body','find','get','checkLicense','key','license-info.log','join','/var','log','setHeader','Content-disposition','attachment;\x20filename=','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs'];(function(_0x3c62d1,_0xfa3805){var _0x6b5488=function(_0x26246c){while(--_0x26246c){_0x3c62d1['push'](_0x3c62d1['shift']());}};_0x6b5488(++_0xfa3805);}(_0x438e,0x12d));var _0xe438=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0x438e[_0x4df6f9];return _0x4b1a73;};'use strict';var emlformat=require(_0xe438('0x0'));var rimraf=require(_0xe438('0x1'));var zipdir=require(_0xe438('0x2'));var jsonpatch=require(_0xe438('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe438('0x4'));var util=require(_0xe438('0x5'));var path=require(_0xe438('0x6'));var sox=require('sox');var csv=require(_0xe438('0x7'));var ejs=require(_0xe438('0x8'));var fs=require('fs');var fs_extra=require(_0xe438('0x9'));var _=require(_0xe438('0xa'));var squel=require('squel');var crypto=require(_0xe438('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe438('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe438('0xd'));var Papa=require('papaparse');var Redis=require(_0xe438('0xe'));var authService=require(_0xe438('0xf'));var qs=require(_0xe438('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe438('0x11'));var logger=require(_0xe438('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xe438('0x13'));var licenseUtil=require(_0xe438('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fc25c,_0xed3e17){_0xed3e17=_0xed3e17||0xcc;return function(_0xbee2e8){if(_0xbee2e8){return _0x1fc25c[_0xe438('0x15')](_0xed3e17);}return _0x1fc25c['status'](_0xed3e17)[_0xe438('0x16')]();};}function respondWithResult(_0x51eda1,_0x7046b5){_0x7046b5=_0x7046b5||0xc8;return function(_0x405d1a){if(_0x405d1a){return _0x51eda1[_0xe438('0x17')](_0x7046b5)[_0xe438('0x18')](_0x405d1a);}};}function respondWithFilteredResult(_0x397df5,_0x395185){return function(_0x5eeb8a){if(_0x5eeb8a){var _0xb84b1c=typeof _0x395185[_0xe438('0x19')]===_0xe438('0x1a')&&typeof _0x395185[_0xe438('0x1b')]===_0xe438('0x1a');var _0x32e8b1=_0x5eeb8a[_0xe438('0x1c')];var _0x3cbb6b=_0xb84b1c?0x0:_0x395185[_0xe438('0x19')];var _0x360223=_0xb84b1c?_0x5eeb8a[_0xe438('0x1c')]:_0x395185['offset']+_0x395185[_0xe438('0x1b')];var _0x1c2f6d;if(_0x360223>=_0x32e8b1){_0x360223=_0x32e8b1;_0x1c2f6d=0xc8;}else{_0x1c2f6d=0xce;}_0x397df5[_0xe438('0x17')](_0x1c2f6d);return _0x397df5[_0xe438('0x1d')]('Content-Range',_0x3cbb6b+'-'+_0x360223+'/'+_0x32e8b1)['json'](_0x5eeb8a);}return null;};}function patchUpdates(_0x4b686f){return function(_0x2d4e0d){try{jsonpatch['apply'](_0x2d4e0d,_0x4b686f,!![]);}catch(_0x1e48e6){return BPromise[_0xe438('0x1e')](_0x1e48e6);}return _0x2d4e0d['save']();};}function saveUpdates(_0xf0818c,_0x25e114){return function(_0x5daa02){if(_0x5daa02){return _0x5daa02[_0xe438('0x1f')](_0xf0818c)[_0xe438('0x20')](function(_0x3b5670){return _0x3b5670;});}return null;};}function removeEntity(_0x454162,_0x3fb530){return function(_0x15cc70){if(_0x15cc70){return _0x15cc70[_0xe438('0x21')]()[_0xe438('0x20')](function(){_0x454162['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4798f4,_0x43e030){return function(_0x1167bc){if(!_0x1167bc){_0x4798f4[_0xe438('0x15')](0x194);}return _0x1167bc;};}function handleError(_0x21e4eb,_0x269392){_0x269392=_0x269392||0x1f4;return function(_0x5bb0ba){logger[_0xe438('0x22')](_0x5bb0ba[_0xe438('0x23')]);if(_0x5bb0ba[_0xe438('0x24')]){delete _0x5bb0ba[_0xe438('0x24')];}_0x21e4eb['status'](_0x269392)['send'](_0x5bb0ba);};}var utilLicense=require(_0xe438('0x14'));exports[_0xe438('0x25')]=function(_0x51ec6b,_0x173601){var _0x2365fb={'raw':!![],'where':{'id':0x1}},_0x86456={};_0x86456[_0xe438('0x26')]=_[_0xe438('0x27')](db[_0xe438('0x28')][_0xe438('0x29')]);_0x86456[_0xe438('0x2a')]=_[_0xe438('0x27')](_0x51ec6b[_0xe438('0x2a')]);_0x86456['filters']=_['intersection'](_0x86456[_0xe438('0x26')],_0x86456['query']);_0x2365fb['attributes']=_[_0xe438('0x2b')](_0x86456[_0xe438('0x26')],qs[_0xe438('0x2c')](_0x51ec6b[_0xe438('0x2a')]['fields']));_0x2365fb[_0xe438('0x2d')]=_0x2365fb['attributes'][_0xe438('0x2e')]?_0x2365fb[_0xe438('0x2d')]:_0x86456['model'];_0x2365fb=_['merge']({},_0x2365fb,_0x51ec6b[_0xe438('0x2f')]);return utilLicense[_0xe438('0x30')](_0x2365fb)[_0xe438('0x20')](respondWithResult(_0x173601,null))[_0xe438('0x31')](handleError(_0x173601,null));};exports[_0xe438('0x1f')]=function(_0x541cc8,_0xde41ae){if(_0x541cc8['body']['id']){delete _0x541cc8[_0xe438('0x32')]['id'];}return db[_0xe438('0x28')][_0xe438('0x33')]({'where':{'id':_0x541cc8['params']['id']}})[_0xe438('0x20')](handleEntityNotFound(_0xde41ae,null))[_0xe438('0x20')](function(_0x51cb67){var _0x28b57b=_0x51cb67[_0xe438('0x34')]({'plain':!![]});return utilLicense[_0xe438('0x35')](_0x28b57b,_0x541cc8['body'][_0xe438('0x36')]);})['then'](function(_0x27016f){if(!_0x27016f['demo']){return saveUpdates(_0x541cc8[_0xe438('0x32')],null);}return _0x27016f;})['then'](respondWithResult(_0xde41ae,null))[_0xe438('0x31')](handleError(_0xde41ae,null));};exports['downloadLogFile']=function(_0x27136c,_0x14de75){var _0x53c7a2=_0xe438('0x37');var _0x36aaed=path[_0xe438('0x38')](_0xe438('0x39'),_0xe438('0x3a'),'xcally',_0x53c7a2);_0x14de75[_0xe438('0x3b')](_0xe438('0x3c'),_0xe438('0x3d')+_0x53c7a2);_0x14de75[_0xe438('0x1d')]('Content-Type','text/plain');_0x14de75['download'](_0x36aaed);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 7fe4d39..e64db91 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 _0xbd1e=['path','rimraf','../../config/environment','./license.attributes','exports','define','License','license','lodash','api','moment'];(function(_0xca5e02,_0x4ae9dd){var _0xdcd2be=function(_0x172400){while(--_0x172400){_0xca5e02['push'](_0xca5e02['shift']());}};_0xdcd2be(++_0x4ae9dd);}(_0xbd1e,0x105));var _0xebd1=function(_0x119ded,_0x497e72){_0x119ded=_0x119ded-0x0;var _0x22108b=_0xbd1e[_0x119ded];return _0x22108b;};'use strict';var _=require(_0xebd1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xebd1('0x1'));var moment=require(_0xebd1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xebd1('0x3'));var rimraf=require(_0xebd1('0x4'));var config=require(_0xebd1('0x5'));var attributes=require(_0xebd1('0x6'));module[_0xebd1('0x7')]=function(_0x156b68,_0x37718c){return _0x156b68[_0xebd1('0x8')](_0xebd1('0x9'),attributes,{'tableName':_0xebd1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b68=['License','lodash','util','moment','bluebird','rimraf','../../config/environment','define'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4b68,0x179));var _0x84b6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4b68[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x84b6('0x0'));var util=require(_0x84b6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x84b6('0x2'));var BPromise=require(_0x84b6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x84b6('0x4'));var config=require(_0x84b6('0x5'));var attributes=require('./license.attributes');module['exports']=function(_0x317165,_0x4cda2f){return _0x317165[_0x84b6('0x6')](_0x84b6('0x7'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 2141b32..d305808 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 _0x9240=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','code','error','License,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1b3240,_0x5fe7eb){var _0x3872c6=function(_0x30d395){while(--_0x30d395){_0x1b3240['push'](_0x1b3240['shift']());}};_0x3872c6(++_0x5fe7eb);}(_0x9240,0x1e9));var _0x0924=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x9240[_0x2dadb9];return _0x2f0097;};'use strict';var _=require('lodash');var util=require(_0x0924('0x0'));var moment=require(_0x0924('0x1'));var BPromise=require(_0x0924('0x2'));var rs=require(_0x0924('0x3'));var fs=require('fs');var Redis=require(_0x0924('0x4'));var db=require(_0x0924('0x5'))['db'];var utils=require(_0x0924('0x6'));var logger=require(_0x0924('0x7'))(_0x0924('0x8'));var config=require(_0x0924('0x9'));var jayson=require(_0x0924('0xa'));var client=jayson[_0x0924('0xb')][_0x0924('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b8825,_0x111c7b,_0x1013f5){return new BPromise(function(_0x2c060d,_0x16f1ad){return client[_0x0924('0xd')](_0x1b8825,_0x1013f5)[_0x0924('0xe')](function(_0x1249a9){logger[_0x0924('0xf')]('License,\x20%s,\x20%s',_0x111c7b,_0x0924('0x10'));logger[_0x0924('0x11')](_0x0924('0x12'),_0x111c7b,_0x0924('0x10'),JSON[_0x0924('0x13')](_0x1249a9));if(_0x1249a9['error']){if(_0x1249a9['error'][_0x0924('0x14')]===0x1f4){logger[_0x0924('0x15')](_0x0924('0x16'),_0x111c7b,_0x1249a9[_0x0924('0x15')][_0x0924('0x17')]);return _0x16f1ad(_0x1249a9[_0x0924('0x15')][_0x0924('0x17')]);}logger[_0x0924('0x15')](_0x0924('0x16'),_0x111c7b,_0x1249a9['error'][_0x0924('0x17')]);return _0x2c060d(_0x1249a9[_0x0924('0x15')][_0x0924('0x17')]);}else{logger[_0x0924('0xf')](_0x0924('0x16'),_0x111c7b,_0x0924('0x10'));_0x2c060d(_0x1249a9[_0x0924('0x18')][_0x0924('0x17')]);}})[_0x0924('0x19')](function(_0x4610a8){logger[_0x0924('0x15')](_0x0924('0x16'),_0x111c7b,_0x4610a8);_0x16f1ad(_0x4610a8);});});} \ No newline at end of file +var _0x38f6=['jayson/promise','client','request','then','info','License,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x21671e,_0x1f9bce){var _0x1ba067=function(_0x380401){while(--_0x380401){_0x21671e['push'](_0x21671e['shift']());}};_0x1ba067(++_0x1f9bce);}(_0x38f6,0x164));var _0x638f=function(_0x36bb5e,_0x1f635b){_0x36bb5e=_0x36bb5e-0x0;var _0x317677=_0x38f6[_0x36bb5e];return _0x317677;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x638f('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x638f('0x1'));var db=require(_0x638f('0x2'))['db'];var utils=require(_0x638f('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x638f('0x4'));var jayson=require(_0x638f('0x5'));var client=jayson[_0x638f('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cc378,_0x242068,_0x6eeda3){return new BPromise(function(_0x4e6aac,_0x3e4677){return client[_0x638f('0x7')](_0x4cc378,_0x6eeda3)[_0x638f('0x8')](function(_0x304504){logger[_0x638f('0x9')](_0x638f('0xa'),_0x242068,'request\x20sent');logger[_0x638f('0xb')]('License,\x20%s,\x20%s,\x20%s',_0x242068,_0x638f('0xc'),JSON[_0x638f('0xd')](_0x304504));if(_0x304504[_0x638f('0xe')]){if(_0x304504[_0x638f('0xe')][_0x638f('0xf')]===0x1f4){logger[_0x638f('0xe')]('License,\x20%s,\x20%s',_0x242068,_0x304504[_0x638f('0xe')][_0x638f('0x10')]);return _0x3e4677(_0x304504[_0x638f('0xe')][_0x638f('0x10')]);}logger[_0x638f('0xe')](_0x638f('0xa'),_0x242068,_0x304504['error']['message']);return _0x4e6aac(_0x304504[_0x638f('0xe')][_0x638f('0x10')]);}else{logger[_0x638f('0x9')](_0x638f('0xa'),_0x242068,_0x638f('0xc'));_0x4e6aac(_0x304504[_0x638f('0x11')][_0x638f('0x10')]);}})[_0x638f('0x12')](function(_0x1e2404){logger[_0x638f('0xe')](_0x638f('0xa'),_0x242068,_0x1e2404);_0x3e4677(_0x1e2404);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index e30a78e..8ab6b5c 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 _0xbae5=['update','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','/:id/applications','getApplications','/:id/messages','/:id/verify','/:id/users','getAgents','post','addDisposition','addAnswer','create','addSmtp','addInteraction','addApplications','/:id/send','addAgents'];(function(_0x281d47,_0x3aef47){var _0x396c51=function(_0x4b70ce){while(--_0x4b70ce){_0x281d47['push'](_0x281d47['shift']());}};_0x396c51(++_0x3aef47);}(_0xbae5,0x188));var _0x5bae=function(_0xe52d37,_0x407061){_0xe52d37=_0xe52d37-0x0;var _0x53e2cc=_0xbae5[_0xe52d37];return _0x53e2cc;};'use strict';var multer=require(_0x5bae('0x0'));var util=require(_0x5bae('0x1'));var path=require(_0x5bae('0x2'));var timeout=require(_0x5bae('0x3'));var express=require(_0x5bae('0x4'));var router=express[_0x5bae('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5bae('0x6'));var interaction=require(_0x5bae('0x7'));var config=require(_0x5bae('0x8'));var controller=require(_0x5bae('0x9'));router[_0x5bae('0xa')]('/',auth[_0x5bae('0xb')](),controller[_0x5bae('0xc')]);router['get'](_0x5bae('0xd'),auth[_0x5bae('0xb')](),controller[_0x5bae('0xe')]);router[_0x5bae('0xa')](_0x5bae('0xf'),auth[_0x5bae('0xb')](),controller[_0x5bae('0x10')]);router['get'](_0x5bae('0x11'),auth[_0x5bae('0xb')](),controller[_0x5bae('0x12')]);router['get'](_0x5bae('0x13'),auth[_0x5bae('0xb')](),controller[_0x5bae('0x14')]);router['get'](_0x5bae('0x15'),auth['isAuthenticated'](),controller[_0x5bae('0x16')]);router[_0x5bae('0xa')](_0x5bae('0x17'),auth[_0x5bae('0xb')](),controller['getSmtp']);router['get'](_0x5bae('0x18'),auth[_0x5bae('0xb')](),controller['getInteractions']);router[_0x5bae('0xa')](_0x5bae('0x19'),auth[_0x5bae('0xb')](),controller[_0x5bae('0x1a')]);router[_0x5bae('0xa')](_0x5bae('0x1b'),auth[_0x5bae('0xb')](),controller['getMessages']);router[_0x5bae('0xa')](_0x5bae('0x1c'),auth[_0x5bae('0xb')](),controller['verifySmtp']);router[_0x5bae('0xa')](_0x5bae('0x1d'),auth[_0x5bae('0xb')](),controller[_0x5bae('0x1e')]);router[_0x5bae('0x1f')](_0x5bae('0x11'),auth[_0x5bae('0xb')](),controller[_0x5bae('0x20')]);router[_0x5bae('0x1f')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x5bae('0x21')]);router[_0x5bae('0x1f')]('/',auth[_0x5bae('0xb')](),controller[_0x5bae('0x22')]);router[_0x5bae('0x1f')]('/:id/in_servers',auth['isAuthenticated'](),controller['addImap']);router[_0x5bae('0x1f')](_0x5bae('0x17'),auth[_0x5bae('0xb')](),controller[_0x5bae('0x23')]);router[_0x5bae('0x1f')](_0x5bae('0x18'),auth[_0x5bae('0xb')](),controller[_0x5bae('0x24')]);router['post'](_0x5bae('0x19'),auth[_0x5bae('0xb')](),controller[_0x5bae('0x25')]);router['post'](_0x5bae('0x26'),auth[_0x5bae('0xb')](),controller['send']);router[_0x5bae('0x1f')](_0x5bae('0x1d'),auth['isAuthenticated'](),controller[_0x5bae('0x27')]);router['put']('/:id',auth[_0x5bae('0xb')](),controller[_0x5bae('0x28')]);router[_0x5bae('0x29')]('/:id/dispositions',auth[_0x5bae('0xb')](),controller[_0x5bae('0x2a')]);router[_0x5bae('0x29')](_0x5bae('0x13'),auth[_0x5bae('0xb')](),controller['removeAnswers']);router[_0x5bae('0x29')](_0x5bae('0x15'),auth[_0x5bae('0xb')](),controller[_0x5bae('0x2b')]);router[_0x5bae('0x29')]('/:id/out_servers',auth[_0x5bae('0xb')](),controller[_0x5bae('0x2c')]);router[_0x5bae('0x29')](_0x5bae('0xf'),auth[_0x5bae('0xb')](),controller[_0x5bae('0x2d')]);router[_0x5bae('0x29')](_0x5bae('0x1d'),auth['isAuthenticated'](),controller[_0x5bae('0x2e')]);module[_0x5bae('0x2f')]=router; \ No newline at end of file +var _0xc4ab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','isAuthenticated','index','/describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','addDisposition','post','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','send','addAgents','put','removeDispositions','delete','removeAnswers','removeImap','removeSmtp','destroy','exports','path','connect-timeout'];(function(_0x2b981f,_0x151344){var _0x67314=function(_0x2661b6){while(--_0x2661b6){_0x2b981f['push'](_0x2b981f['shift']());}};_0x67314(++_0x151344);}(_0xc4ab,0x91));var _0xbc4a=function(_0x545621,_0x2f7d25){_0x545621=_0x545621-0x0;var _0x5d4c97=_0xc4ab[_0x545621];return _0x5d4c97;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc4a('0x0'));var timeout=require(_0xbc4a('0x1'));var express=require(_0xbc4a('0x2'));var router=express[_0xbc4a('0x3')]();var fs_extra=require(_0xbc4a('0x4'));var auth=require(_0xbc4a('0x5'));var interaction=require(_0xbc4a('0x6'));var config=require('../../config/environment');var controller=require(_0xbc4a('0x7'));router['get']('/',auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x9')]);router['get'](_0xbc4a('0xa'),auth[_0xbc4a('0x8')](),controller['describe']);router[_0xbc4a('0xb')](_0xbc4a('0xc'),auth['isAuthenticated'](),controller[_0xbc4a('0xd')]);router['get'](_0xbc4a('0xe'),auth[_0xbc4a('0x8')](),controller[_0xbc4a('0xf')]);router[_0xbc4a('0xb')](_0xbc4a('0x10'),auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x11')]);router[_0xbc4a('0xb')](_0xbc4a('0x12'),auth[_0xbc4a('0x8')](),controller['getImap']);router['get'](_0xbc4a('0x13'),auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x14')]);router[_0xbc4a('0xb')](_0xbc4a('0x15'),auth['isAuthenticated'](),controller[_0xbc4a('0x16')]);router['get'](_0xbc4a('0x17'),auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x18')]);router['get'](_0xbc4a('0x19'),auth['isAuthenticated'](),controller[_0xbc4a('0x1a')]);router['get'](_0xbc4a('0x1b'),auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x1c')]);router[_0xbc4a('0xb')](_0xbc4a('0x1d'),auth['isAuthenticated'](),controller[_0xbc4a('0x1e')]);router['post'](_0xbc4a('0xe'),auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x1f')]);router[_0xbc4a('0x20')](_0xbc4a('0x10'),auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x21')]);router[_0xbc4a('0x20')]('/',auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x22')]);router[_0xbc4a('0x20')](_0xbc4a('0x12'),auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x23')]);router[_0xbc4a('0x20')](_0xbc4a('0x13'),auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x24')]);router[_0xbc4a('0x20')](_0xbc4a('0x15'),auth['isAuthenticated'](),controller[_0xbc4a('0x25')]);router[_0xbc4a('0x20')]('/:id/applications',auth['isAuthenticated'](),controller[_0xbc4a('0x26')]);router[_0xbc4a('0x20')]('/:id/send',auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x27')]);router[_0xbc4a('0x20')](_0xbc4a('0x1d'),auth['isAuthenticated'](),controller[_0xbc4a('0x28')]);router[_0xbc4a('0x29')](_0xbc4a('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbc4a('0xe'),auth['isAuthenticated'](),controller[_0xbc4a('0x2a')]);router[_0xbc4a('0x2b')](_0xbc4a('0x10'),auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x2c')]);router[_0xbc4a('0x2b')](_0xbc4a('0x12'),auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x2d')]);router[_0xbc4a('0x2b')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0xbc4a('0x2e')]);router[_0xbc4a('0x2b')]('/:id',auth[_0xbc4a('0x8')](),controller[_0xbc4a('0x2f')]);router[_0xbc4a('0x2b')](_0xbc4a('0x1d'),auth[_0xbc4a('0x8')](),controller['removeAgents']);module[_0xbc4a('0x30')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index cee565c..af71723 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 _0x9b70=['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','ENUM','gmail','hotmail','yahoo','custom','provider','sequelize','exports','STRING','TEXT','BOOLEAN','INTEGER','UNSIGNED'];(function(_0x21d3c4,_0x48d915){var _0x341584=function(_0x35aaa7){while(--_0x35aaa7){_0x21d3c4['push'](_0x21d3c4['shift']());}};_0x341584(++_0x48d915);}(_0x9b70,0xe7));var _0x09b7=function(_0x51160c,_0x374b59){_0x51160c=_0x51160c-0x0;var _0x15a3fb=_0x9b70[_0x51160c];return _0x15a3fb;};'use strict';var Sequelize=require(_0x09b7('0x0'));module[_0x09b7('0x1')]={'description':{'type':Sequelize[_0x09b7('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x09b7('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x09b7('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x09b7('0x3')]},'markAsUnread':{'type':Sequelize[_0x09b7('0x4')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x09b7('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x09b7('0x5')](0x2)[_0x09b7('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x09b7('0x3')],'defaultValue':function(){return _0x09b7('0x7');}},'notificationSound':{'type':Sequelize[_0x09b7('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x09b7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x09b7('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x09b7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x09b7('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x09b7('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x09b7('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x09b7('0x4')],'defaultValue':![],'comment':_0x09b7('0x9'),'set':function(_0x2162ec){if(!_0x2162ec)this[_0x09b7('0xa')]('mandatoryDispositionPauseId',null);this[_0x09b7('0xa')]('mandatoryDisposition',_0x2162ec);}},'provider':{'type':Sequelize[_0x09b7('0xb')](_0x09b7('0xc'),_0x09b7('0xd'),_0x09b7('0xe'),'outlook365'),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return _0x09b7('0xf');return this['getDataValue']('provider');},'set':function(_0x3b1574){if(_0x3b1574===_0x09b7('0xf'))_0x3b1574=null;return this[_0x09b7('0xa')](_0x09b7('0x10'),_0x3b1574);}}}; \ No newline at end of file +var _0x9b38=['gmail','hotmail','yahoo','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','setDataValue','mandatoryDisposition'];(function(_0x3c3eca,_0x4bec3d){var _0x388a21=function(_0x22021f){while(--_0x22021f){_0x3c3eca['push'](_0x3c3eca['shift']());}};_0x388a21(++_0x4bec3d);}(_0x9b38,0x111));var _0x89b3=function(_0x5760cd,_0x199827){_0x5760cd=_0x5760cd-0x0;var _0x20e496=_0x9b38[_0x5760cd];return _0x20e496;};'use strict';var Sequelize=require(_0x89b3('0x0'));module[_0x89b3('0x1')]={'description':{'type':Sequelize[_0x89b3('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x89b3('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x89b3('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x89b3('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x89b3('0x4')]},'markAsUnread':{'type':Sequelize[_0x89b3('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x89b3('0x2')],'allowNull':![],'defaultValue':_0x89b3('0x5')},'fontSize':{'type':Sequelize[_0x89b3('0x6')](0x2)[_0x89b3('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x89b3('0x4')],'defaultValue':function(){return _0x89b3('0x8');}},'notificationSound':{'type':Sequelize[_0x89b3('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x89b3('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x89b3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x89b3('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x89b3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x89b3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x89b3('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x89b3('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x89b3('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x137eb8){if(!_0x137eb8)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x89b3('0xa')](_0x89b3('0xb'),_0x137eb8);}},'provider':{'type':Sequelize['ENUM'](_0x89b3('0xc'),_0x89b3('0xd'),_0x89b3('0xe'),_0x89b3('0xf')),'defaultValue':null,'get':function(){if(!this[_0x89b3('0x10')](_0x89b3('0x11')))return _0x89b3('0x12');return this['getDataValue'](_0x89b3('0x11'));},'set':function(_0xc42b74){if(_0xc42b74===_0x89b3('0x12'))_0xc42b74=null;return this['setDataValue']('provider',_0xc42b74);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 5d04f7d..a840153 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 _0x79a3=['request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','Content-Range','json','update','get','MailAccounts','UserProfileResource','destroy','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','count','include','rows','show','MailServerIn','includeAll','options','body','provider','custom','params','describe','addDisposition','find','MailAccountId','Disposition','create','getDispositions','findOne','nolimit','findAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','setImap','addSmtp','addInteraction','MailInteraction','omit','CmContact','User','Tag','addApplications','sequelize','Transaction','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','attachments','join','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','out','Interaction','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','util','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','http'];(function(_0x4e7056,_0x52891c){var _0x147b00=function(_0x2f93a4){while(--_0x2f93a4){_0x4e7056['push'](_0x4e7056['shift']());}};_0x147b00(++_0x52891c);}(_0x79a3,0xa9));var _0x379a=function(_0xfb61f0,_0x69e563){_0xfb61f0=_0xfb61f0-0x0;var _0x482683=_0x79a3[_0xfb61f0];return _0x482683;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x379a('0x0'));var path=require(_0x379a('0x1'));var _=require(_0x379a('0x2'));var juice=require(_0x379a('0x3'));var Redis=require(_0x379a('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x379a('0x5'))(_0x379a('0x6'));var config=require(_0x379a('0x7'));var db=require(_0x379a('0x8'))['db'];config[_0x379a('0x9')]=_[_0x379a('0xa')](config['redis'],{'host':_0x379a('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x379a('0x9')]));require('./mailAccount.socket')[_0x379a('0xc')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x379a('0xd')]({'port':0x232b});function respondWithRpcPromise(_0x58f073,_0x40a3a1,_0x3b5c3e,_0x5c8ed9){return new BPromise(function(_0x44f56c,_0xbf9270){var _0x53782c=_0x5c8ed9||client;return _0x53782c[_0x379a('0xe')](_0x58f073,_0x3b5c3e)[_0x379a('0xf')](function(_0x492fec){logger[_0x379a('0x10')](_0x379a('0x11'),_0x40a3a1,_0x379a('0x12'));logger[_0x379a('0x13')](_0x379a('0x14'),_0x40a3a1,_0x379a('0x12'),JSON[_0x379a('0x15')](_0x492fec));if(_0x492fec[_0x379a('0x16')]){if(_0x492fec[_0x379a('0x16')][_0x379a('0x17')]===0x1f4){logger[_0x379a('0x16')]('MailAccount,\x20%s,\x20%s',_0x40a3a1,_0x492fec[_0x379a('0x16')][_0x379a('0x18')]);return _0xbf9270(_0x492fec['error']['message']);}logger[_0x379a('0x16')]('MailAccount,\x20%s,\x20%s',_0x40a3a1,_0x492fec[_0x379a('0x16')][_0x379a('0x18')]);return _0x44f56c(_0x492fec[_0x379a('0x16')][_0x379a('0x18')]);}else{logger[_0x379a('0x10')](_0x379a('0x11'),_0x40a3a1,_0x379a('0x12'));_0x44f56c(_0x492fec[_0x379a('0x19')][_0x379a('0x18')]);}})[_0x379a('0x1a')](function(_0x4f7f5e){logger[_0x379a('0x16')](_0x379a('0x11'),_0x40a3a1,_0x4f7f5e);_0xbf9270(_0x4f7f5e);});});}function respondWithStatusCode(_0x4f359f,_0x3c383d){_0x3c383d=_0x3c383d||0xcc;return function(_0x2cbe38){if(_0x2cbe38){return _0x4f359f[_0x379a('0x1b')](_0x3c383d);}return _0x4f359f[_0x379a('0x1c')](_0x3c383d)[_0x379a('0x1d')]();};}function respondWithResult(_0x405d6e,_0x3fac54){_0x3fac54=_0x3fac54||0xc8;return function(_0x42dadb){if(_0x42dadb){return _0x405d6e['status'](_0x3fac54)['json'](_0x42dadb);}};}function respondWithFilteredResult(_0x2fe9ca,_0x5408b1){return function(_0x89db32){if(_0x89db32){var _0xa3ed5d=typeof _0x5408b1[_0x379a('0x1e')]==='undefined'&&typeof _0x5408b1[_0x379a('0x1f')]==='undefined';var _0x35e0c9=_0x89db32['count'];var _0x3935b7=_0xa3ed5d?0x0:_0x5408b1[_0x379a('0x1e')];var _0x58862c=_0xa3ed5d?_0x89db32['count']:_0x5408b1['offset']+_0x5408b1['limit'];var _0x28df1d;if(_0x58862c>=_0x35e0c9){_0x58862c=_0x35e0c9;_0x28df1d=0xc8;}else{_0x28df1d=0xce;}_0x2fe9ca['status'](_0x28df1d);return _0x2fe9ca['set'](_0x379a('0x20'),_0x3935b7+'-'+_0x58862c+'/'+_0x35e0c9)[_0x379a('0x21')](_0x89db32);}return null;};}function saveUpdates(_0x55162c){return function(_0x3e10b5){if(_0x3e10b5){return _0x3e10b5[_0x379a('0x22')](_0x55162c)[_0x379a('0xf')](function(_0x5f0985){return _0x5f0985;});}return null;};}function removeEntity(_0x40713c){return function(_0x359b10){if(_0x359b10){return _0x359b10['destroy']()[_0x379a('0xf')](function(){var _0x2d435d=_0x359b10[_0x379a('0x23')]({'plain':!![]});var _0x80c25=_0x379a('0x24');return db[_0x379a('0x25')][_0x379a('0x26')]({'where':{'type':_0x80c25,'resourceId':_0x2d435d['id']}})[_0x379a('0xf')](function(){return _0x359b10;});})['then'](function(){_0x40713c[_0x379a('0x1c')](0xcc)[_0x379a('0x1d')]();});}};}function handleEntityNotFound(_0x169d54){return function(_0x3d8ec8){if(!_0x3d8ec8){_0x169d54[_0x379a('0x1b')](0x194);}return _0x3d8ec8;};}function handleError(_0x58d2c3,_0x43bd41){_0x43bd41=_0x43bd41||0x1f4;return function(_0x5f1f75){logger[_0x379a('0x16')](_0x5f1f75[_0x379a('0x27')]);if(_0x5f1f75[_0x379a('0x28')]){delete _0x5f1f75[_0x379a('0x28')];}_0x58d2c3['status'](_0x43bd41)[_0x379a('0x29')](_0x5f1f75);};}function getImapHost(_0x5e2251){switch(_0x5e2251){case _0x379a('0x2a'):return _0x379a('0x2b');case _0x379a('0x2c'):return _0x379a('0x2d');case _0x379a('0x2e'):return _0x379a('0x2f');case _0x379a('0x30'):return'outlook.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x5e2251);}function getSmtpHost(_0x56d829){switch(_0x56d829){case'gmail':return _0x379a('0x31');case _0x379a('0x2c'):return _0x379a('0x32');case _0x379a('0x2e'):return _0x379a('0x33');case _0x379a('0x30'):return _0x379a('0x34');}throw new Error(_0x379a('0x35'),_0x56d829);}function getAuthenticationOptions(_0x4e99c4,_0x19e119){var _0x539fcf={};var _0x5803eb={};if(_0x4e99c4){_0x539fcf[_0x379a('0x36')]=_0x5803eb[_0x379a('0x36')]=_0x19e119['username'];_0x539fcf[_0x379a('0x37')]=_0x5803eb[_0x379a('0x38')]=_0x19e119[_0x379a('0x37')];if(_0x19e119[_0x379a('0x39')]){_0x539fcf['modernAuthentication']=_0x5803eb[_0x379a('0x39')]=!![];_0x539fcf[_0x379a('0x3a')]=_0x5803eb[_0x379a('0x3a')]=_0x19e119[_0x379a('0x3a')];_0x539fcf[_0x379a('0x37')]=_0x5803eb[_0x379a('0x38')]=null;}else{_0x539fcf[_0x379a('0x3a')]=_0x5803eb[_0x379a('0x3a')]=null;}_0x539fcf[_0x379a('0x3b')]=getImapHost(_0x4e99c4);_0x539fcf[_0x379a('0x3c')]=0x3e1;_0x5803eb['host']=getSmtpHost(_0x4e99c4);_0x5803eb[_0x379a('0x3c')]=0x24b;_0x5803eb[_0x379a('0x3d')]=![];_0x539fcf[_0x379a('0x3e')]=_0x5803eb[_0x379a('0x3e')]=null;}else{if(_0x19e119[_0x379a('0x3f')]){_0x539fcf[_0x379a('0x36')]=_0x5803eb[_0x379a('0x36')]=_0x19e119['username'];_0x539fcf[_0x379a('0x37')]=_0x5803eb[_0x379a('0x38')]=_0x19e119[_0x379a('0x37')];}else{_0x539fcf[_0x379a('0x3f')]=_0x5803eb[_0x379a('0x3f')]=![];_0x539fcf[_0x379a('0x36')]=_0x5803eb[_0x379a('0x36')]=null;_0x539fcf[_0x379a('0x37')]=_0x5803eb[_0x379a('0x38')]=null;}_0x539fcf[_0x379a('0x3b')]=_0x19e119[_0x379a('0x40')]['host'];_0x539fcf[_0x379a('0x3c')]=_0x19e119[_0x379a('0x40')][_0x379a('0x3c')];_0x5803eb[_0x379a('0x3b')]=_0x19e119[_0x379a('0x41')][_0x379a('0x3b')];_0x5803eb[_0x379a('0x3c')]=_0x19e119[_0x379a('0x41')][_0x379a('0x3c')];}return{'Imap':_0x539fcf,'Smtp':_0x5803eb};}exports[_0x379a('0x42')]=function(_0x561d09,_0x2a6af5){var _0x1a221f={'include':[{'model':db['MailServerIn'],'as':_0x379a('0x40')},{'model':db[_0x379a('0x43')],'as':_0x379a('0x41')},{'model':db[_0x379a('0x44')],'as':_0x379a('0x45')}]},_0x572a09={},_0x2022ee={'count':0x0,'rows':[]};var _0xdd6200=_[_0x379a('0x46')](db[_0x379a('0x47')][_0x379a('0x48')],function(_0x43761f){return{'name':_0x43761f[_0x379a('0x49')],'type':_0x43761f[_0x379a('0x4a')][_0x379a('0x4b')]};});_0x572a09[_0x379a('0x4c')]=_[_0x379a('0x46')](_0xdd6200,_0x379a('0x28'));_0x572a09[_0x379a('0x4d')]=_[_0x379a('0x4e')](_0x561d09[_0x379a('0x4d')]);_0x572a09[_0x379a('0x4f')]=_[_0x379a('0x50')](_0x572a09[_0x379a('0x4c')],_0x572a09['query']);_0x1a221f['attributes']=_[_0x379a('0x50')](_0x572a09[_0x379a('0x4c')],qs[_0x379a('0x51')](_0x561d09['query'][_0x379a('0x51')]));_0x1a221f[_0x379a('0x52')]=_0x1a221f[_0x379a('0x52')][_0x379a('0x53')]?_0x1a221f[_0x379a('0x52')]:_0x572a09[_0x379a('0x4c')];if(!_0x561d09[_0x379a('0x4d')][_0x379a('0x54')]('nolimit')){_0x1a221f[_0x379a('0x1f')]=qs['limit'](_0x561d09[_0x379a('0x4d')][_0x379a('0x1f')]);_0x1a221f[_0x379a('0x1e')]=qs[_0x379a('0x1e')](_0x561d09[_0x379a('0x4d')][_0x379a('0x1e')]);}_0x1a221f[_0x379a('0x55')]=qs[_0x379a('0x56')](_0x561d09[_0x379a('0x4d')]['sort']);_0x1a221f['where']=qs[_0x379a('0x4f')](_[_0x379a('0x57')](_0x561d09['query'],_0x572a09[_0x379a('0x4f')]),_0xdd6200);if(_0x561d09[_0x379a('0x4d')][_0x379a('0x58')]){_0x1a221f[_0x379a('0x59')]=_[_0x379a('0x5a')](_0x1a221f[_0x379a('0x59')],{'$or':_[_0x379a('0x46')](_0xdd6200,function(_0xcd3822){if(_0xcd3822[_0x379a('0x4a')]!==_0x379a('0x5b')){var _0x33d52f={};_0x33d52f[_0xcd3822['name']]={'$like':'%'+_0x561d09['query'][_0x379a('0x58')]+'%'};return _0x33d52f;}})});}_0x1a221f=_['merge']({},_0x1a221f,_0x561d09['options']);var _0xeba3b0={'where':_0x1a221f[_0x379a('0x59')]};return db['MailAccount'][_0x379a('0x5c')](_0xeba3b0)[_0x379a('0xf')](function(_0x1f0e89){_0x2022ee[_0x379a('0x5c')]=_0x1f0e89;if(_0x561d09[_0x379a('0x4d')]['includeAll']){_0x1a221f[_0x379a('0x5d')]=[{'all':!![]}];}return db[_0x379a('0x47')]['findAll'](_0x1a221f);})[_0x379a('0xf')](function(_0x29fcf5){_0x2022ee[_0x379a('0x5e')]=_0x29fcf5;return _0x2022ee;})[_0x379a('0xf')](respondWithFilteredResult(_0x2a6af5,_0x1a221f))['catch'](handleError(_0x2a6af5,null));};exports[_0x379a('0x5f')]=function(_0x3eae5d,_0x2127ad){var _0x363ee5={'raw':![],'where':{'id':_0x3eae5d['params']['id']},'include':[{'model':db[_0x379a('0x60')],'as':_0x379a('0x40')},{'model':db['MailServerOut'],'as':_0x379a('0x41')},{'model':db[_0x379a('0x44')],'as':_0x379a('0x45')}]},_0x406487={};_0x406487[_0x379a('0x4c')]=_[_0x379a('0x4e')](db[_0x379a('0x47')][_0x379a('0x48')]);_0x406487[_0x379a('0x4d')]=_[_0x379a('0x4e')](_0x3eae5d[_0x379a('0x4d')]);_0x406487[_0x379a('0x4f')]=_[_0x379a('0x50')](_0x406487['model'],_0x406487[_0x379a('0x4d')]);_0x363ee5[_0x379a('0x52')]=_[_0x379a('0x50')](_0x406487[_0x379a('0x4c')],qs[_0x379a('0x51')](_0x3eae5d['query']['fields']));_0x363ee5[_0x379a('0x52')]=_0x363ee5['attributes'][_0x379a('0x53')]?_0x363ee5[_0x379a('0x52')]:_0x406487[_0x379a('0x4c')];if(_0x3eae5d[_0x379a('0x4d')][_0x379a('0x61')]){_0x363ee5['include']=[{'all':!![]}];}_0x363ee5=_[_0x379a('0x5a')]({},_0x363ee5,_0x3eae5d[_0x379a('0x62')]);return db[_0x379a('0x47')]['find'](_0x363ee5)[_0x379a('0xf')](handleEntityNotFound(_0x2127ad,null))['then'](respondWithResult(_0x2127ad,null))[_0x379a('0x1a')](handleError(_0x2127ad,null));};exports[_0x379a('0x22')]=function(_0x319d39,_0x37e2c3){if(_0x319d39['body']['id']){delete _0x319d39[_0x379a('0x63')]['id'];}var _0x9cd4b4=_0x319d39[_0x379a('0x63')][_0x379a('0x64')]===_0x379a('0x65')?null:_0x319d39[_0x379a('0x63')][_0x379a('0x64')];var _0x405a9d=_0x319d39[_0x379a('0x63')][_0x379a('0x40')]||{};var _0x3f9105=_0x319d39['body'][_0x379a('0x41')]||{};if(_0x9cd4b4){_0x405a9d[_0x379a('0x3b')]=getImapHost(_0x9cd4b4);_0x405a9d['port']=0x3e1;_0x3f9105['host']=getSmtpHost(_0x9cd4b4);_0x3f9105[_0x379a('0x3c')]=0x24b;_0x3f9105['secure']=![];}if(_0x3f9105['modernAuthentication']){_0x3f9105['secure']=![];}else{_0x3f9105[_0x379a('0x3a')]=null;}if(!_0x405a9d[_0x379a('0x39')])_0x405a9d[_0x379a('0x3a')]=null;_0x319d39['body'][_0x379a('0x40')]=_0x405a9d;_0x319d39[_0x379a('0x63')][_0x379a('0x41')]=_0x3f9105;return db['MailAccount']['find']({'where':{'id':_0x319d39[_0x379a('0x66')]['id']},'include':[{'model':db[_0x379a('0x60')],'as':_0x379a('0x40')},{'model':db[_0x379a('0x43')],'as':_0x379a('0x41')},{'model':db[_0x379a('0x44')],'as':_0x379a('0x45')}]})[_0x379a('0xf')](handleEntityNotFound(_0x37e2c3,null))[_0x379a('0xf')](function(_0x3039ab){if(!_0x3039ab)throw new Error('Mail\x20Account\x20not\x20found');if(_0x3039ab['service'])delete _0x319d39[_0x379a('0x63')][_0x379a('0x40')];return _0x3039ab;})[_0x379a('0xf')](saveUpdates(_0x319d39['body'],null))[_0x379a('0xf')](function(_0x307df4){if(!_0x319d39['body'][_0x379a('0x40')])return _0x307df4;return db['MailServerIn'][_0x379a('0x22')](_0x319d39[_0x379a('0x63')]['Imap'],{'where':{'MailAccountId':_0x307df4['id']}})[_0x379a('0xf')](function(){return _0x307df4;});})[_0x379a('0xf')](function(_0x4c34de){if(!_0x319d39[_0x379a('0x63')][_0x379a('0x41')])return _0x4c34de;return db['MailServerOut']['update'](_0x319d39[_0x379a('0x63')]['Smtp'],{'where':{'MailAccountId':_0x4c34de['id']}})['then'](function(){return _0x4c34de;});})['then'](respondWithResult(_0x37e2c3,null))[_0x379a('0x1a')](handleError(_0x37e2c3,null));};exports[_0x379a('0x67')]=function(_0x1b0e8e,_0x3d66a3){return db[_0x379a('0x47')][_0x379a('0x67')]()[_0x379a('0xf')](respondWithResult(_0x3d66a3,null))['catch'](handleError(_0x3d66a3,null));};exports[_0x379a('0x68')]=function(_0x74dbf1,_0x247f92){if(_0x74dbf1[_0x379a('0x63')]['id']){delete _0x74dbf1[_0x379a('0x63')]['id'];}return db['MailAccount'][_0x379a('0x69')]({'where':{'id':_0x74dbf1[_0x379a('0x66')]['id']}})['then'](handleEntityNotFound(_0x247f92,null))['then'](function(_0x43ce94){if(_0x43ce94){_0x74dbf1['body'][_0x379a('0x6a')]=_0x43ce94['id'];return db[_0x379a('0x6b')][_0x379a('0x6c')](_0x74dbf1[_0x379a('0x63')]);}})[_0x379a('0xf')](respondWithResult(_0x247f92,null))[_0x379a('0x1a')](handleError(_0x247f92,null));};exports[_0x379a('0x6d')]=function(_0x178f56,_0x14f845){var _0x2ab51f={'raw':![],'where':{}};var _0x1570ce={};var _0x24f5ae={'count':0x0,'rows':[]};return db['MailAccount'][_0x379a('0x6e')]({'where':{'id':_0x178f56[_0x379a('0x66')]['id']}})[_0x379a('0xf')](handleEntityNotFound(_0x14f845,null))[_0x379a('0xf')](function(_0x592b81){if(_0x592b81){_0x1570ce[_0x379a('0x4c')]=_[_0x379a('0x4e')](db[_0x379a('0x6b')][_0x379a('0x48')]);_0x1570ce[_0x379a('0x4d')]=_[_0x379a('0x4e')](_0x178f56['query']);_0x1570ce['filters']=_['intersection'](_0x1570ce[_0x379a('0x4c')],_0x1570ce['query']);_0x2ab51f[_0x379a('0x52')]=_[_0x379a('0x50')](_0x1570ce['model'],qs['fields'](_0x178f56[_0x379a('0x4d')][_0x379a('0x51')]));_0x2ab51f['attributes']=_0x2ab51f[_0x379a('0x52')][_0x379a('0x53')]?_0x2ab51f[_0x379a('0x52')]:_0x1570ce[_0x379a('0x4c')];if(!_0x178f56['query'][_0x379a('0x54')](_0x379a('0x6f'))){_0x2ab51f[_0x379a('0x1f')]=qs[_0x379a('0x1f')](_0x178f56[_0x379a('0x4d')]['limit']);_0x2ab51f[_0x379a('0x1e')]=qs[_0x379a('0x1e')](_0x178f56[_0x379a('0x4d')][_0x379a('0x1e')]);}_0x2ab51f[_0x379a('0x55')]=qs[_0x379a('0x56')](_0x178f56['query'][_0x379a('0x56')]);_0x2ab51f[_0x379a('0x59')]=qs[_0x379a('0x4f')](_['pick'](_0x178f56[_0x379a('0x4d')],_0x1570ce[_0x379a('0x4f')]));_0x2ab51f[_0x379a('0x59')][_0x379a('0x6a')]=_0x592b81['id'];if(_0x178f56[_0x379a('0x4d')][_0x379a('0x58')]){_0x2ab51f['where']=_[_0x379a('0x5a')](_0x2ab51f[_0x379a('0x59')],{'$or':_[_0x379a('0x46')](_0x2ab51f[_0x379a('0x52')],function(_0x400c9d){var _0x3a414a={};_0x3a414a[_0x400c9d]={'$like':'%'+_0x178f56[_0x379a('0x4d')][_0x379a('0x58')]+'%'};return _0x3a414a;})});}_0x2ab51f=_[_0x379a('0x5a')]({},_0x2ab51f,_0x178f56[_0x379a('0x62')]);return db[_0x379a('0x6b')]['count']({'where':_0x2ab51f['where']})[_0x379a('0xf')](function(_0x6c083){_0x24f5ae[_0x379a('0x5c')]=_0x6c083;if(_0x178f56['query']['includeAll']){_0x2ab51f[_0x379a('0x5d')]=[{'all':!![]}];}return db[_0x379a('0x6b')][_0x379a('0x70')](_0x2ab51f);})[_0x379a('0xf')](function(_0x4e0f7f){_0x24f5ae[_0x379a('0x5e')]=_0x4e0f7f;return _0x24f5ae;});}})[_0x379a('0xf')](respondWithFilteredResult(_0x14f845,_0x2ab51f))[_0x379a('0x1a')](handleError(_0x14f845,null));};exports[_0x379a('0x71')]=function(_0x5cfb57,_0x184180){return db[_0x379a('0x47')][_0x379a('0x69')]({'where':{'id':_0x5cfb57[_0x379a('0x66')]['id']}})['then'](handleEntityNotFound(_0x184180,null))[_0x379a('0xf')](function(_0xf360f1){if(_0xf360f1){return _0xf360f1['removeDispositions'](_0x5cfb57[_0x379a('0x4d')][_0x379a('0x72')]);}})['then'](respondWithStatusCode(_0x184180,null))[_0x379a('0x1a')](handleError(_0x184180,null));};exports['addAnswer']=function(_0x36b914,_0x4375cd){if(_0x36b914[_0x379a('0x63')]['id']){delete _0x36b914['body']['id'];}return db['MailAccount'][_0x379a('0x69')]({'where':{'id':_0x36b914[_0x379a('0x66')]['id']}})['then'](handleEntityNotFound(_0x4375cd,null))[_0x379a('0xf')](function(_0xae14a9){if(_0xae14a9){_0x36b914['body'][_0x379a('0x6a')]=_0xae14a9['id'];return db[_0x379a('0x73')][_0x379a('0x6c')](_0x36b914['body']);}})[_0x379a('0xf')](respondWithResult(_0x4375cd,null))[_0x379a('0x1a')](handleError(_0x4375cd,null));};exports[_0x379a('0x74')]=function(_0x24c90a,_0x228173){var _0x2223d2={'raw':![],'where':{}};var _0x2e6dfc={};var _0x34304b={'count':0x0,'rows':[]};return db[_0x379a('0x47')][_0x379a('0x6e')]({'where':{'id':_0x24c90a['params']['id']}})[_0x379a('0xf')](handleEntityNotFound(_0x228173,null))['then'](function(_0x6d999d){if(_0x6d999d){_0x2e6dfc[_0x379a('0x4c')]=_['keys'](db[_0x379a('0x73')]['rawAttributes']);_0x2e6dfc[_0x379a('0x4d')]=_[_0x379a('0x4e')](_0x24c90a[_0x379a('0x4d')]);_0x2e6dfc[_0x379a('0x4f')]=_[_0x379a('0x50')](_0x2e6dfc[_0x379a('0x4c')],_0x2e6dfc['query']);_0x2223d2[_0x379a('0x52')]=_[_0x379a('0x50')](_0x2e6dfc['model'],qs[_0x379a('0x51')](_0x24c90a[_0x379a('0x4d')][_0x379a('0x51')]));_0x2223d2[_0x379a('0x52')]=_0x2223d2[_0x379a('0x52')][_0x379a('0x53')]?_0x2223d2[_0x379a('0x52')]:_0x2e6dfc[_0x379a('0x4c')];if(!_0x24c90a[_0x379a('0x4d')][_0x379a('0x54')](_0x379a('0x6f'))){_0x2223d2['limit']=qs[_0x379a('0x1f')](_0x24c90a[_0x379a('0x4d')][_0x379a('0x1f')]);_0x2223d2[_0x379a('0x1e')]=qs['offset'](_0x24c90a[_0x379a('0x4d')][_0x379a('0x1e')]);}_0x2223d2[_0x379a('0x55')]=qs[_0x379a('0x56')](_0x24c90a['query'][_0x379a('0x56')]);_0x2223d2[_0x379a('0x59')]=qs['filters'](_['pick'](_0x24c90a[_0x379a('0x4d')],_0x2e6dfc[_0x379a('0x4f')]));_0x2223d2[_0x379a('0x59')][_0x379a('0x6a')]=_0x6d999d['id'];if(_0x24c90a['query'][_0x379a('0x58')]){_0x2223d2['where']=_[_0x379a('0x5a')](_0x2223d2[_0x379a('0x59')],{'$or':_['map'](_0x2223d2['attributes'],function(_0x3231b2){var _0x481f97={};_0x481f97[_0x3231b2]={'$like':'%'+_0x24c90a['query'][_0x379a('0x58')]+'%'};return _0x481f97;})});}_0x2223d2=_[_0x379a('0x5a')]({},_0x2223d2,_0x24c90a[_0x379a('0x62')]);return db[_0x379a('0x73')][_0x379a('0x5c')]({'where':_0x2223d2[_0x379a('0x59')]})[_0x379a('0xf')](function(_0x13bc9d){_0x34304b[_0x379a('0x5c')]=_0x13bc9d;if(_0x24c90a[_0x379a('0x4d')][_0x379a('0x61')]){_0x2223d2['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2223d2);})[_0x379a('0xf')](function(_0x4a57c6){_0x34304b[_0x379a('0x5e')]=_0x4a57c6;return _0x34304b;});}})[_0x379a('0xf')](respondWithFilteredResult(_0x228173,_0x2223d2))[_0x379a('0x1a')](handleError(_0x228173,null));};exports[_0x379a('0x75')]=function(_0x1f0901,_0x1400b1){return db[_0x379a('0x47')]['find']({'where':{'id':_0x1f0901[_0x379a('0x66')]['id']}})[_0x379a('0xf')](handleEntityNotFound(_0x1400b1,null))[_0x379a('0xf')](function(_0x51cc67){if(_0x51cc67){return _0x51cc67[_0x379a('0x75')](_0x1f0901[_0x379a('0x4d')][_0x379a('0x72')]);}})[_0x379a('0xf')](respondWithStatusCode(_0x1400b1,null))[_0x379a('0x1a')](handleError(_0x1400b1,null));};exports[_0x379a('0x6c')]=function(_0x105e37,_0x52d32e){var _0xb3e89a={'name':_0x105e37[_0x379a('0x63')]['name'],'key':_0x105e37[_0x379a('0x63')][_0x379a('0x4b')],'provider':_0x105e37[_0x379a('0x63')][_0x379a('0x64')]===_0x379a('0x65')?null:_0x105e37['body']['provider'],'email':_0x105e37[_0x379a('0x63')][_0x379a('0x76')],'ListId':_0x105e37[_0x379a('0x63')][_0x379a('0x77')],'active':!_[_0x379a('0x78')](_0x105e37[_0x379a('0x63')][_0x379a('0x79')])?_0x105e37['body']['active']:!![],'description':_0x105e37[_0x379a('0x63')][_0x379a('0x7a')]||null};var _0x143efb=getAuthenticationOptions(_0xb3e89a[_0x379a('0x64')],_0x105e37[_0x379a('0x63')]);_0xb3e89a['Imap']=_0x143efb['Imap'];_0xb3e89a[_0x379a('0x41')]=_0x143efb[_0x379a('0x41')];return db[_0x379a('0x47')][_0x379a('0x6c')](_0xb3e89a,{'include':[{'model':db[_0x379a('0x43')],'as':_0x379a('0x41')},{'model':db['MailServerIn'],'as':_0x379a('0x40')}]})[_0x379a('0xf')](function(_0x35c7fb){var _0x3e003d=_0x105e37[_0x379a('0x36')][_0x379a('0x23')]({'plain':!![]});if(!_0x3e003d)throw new Error(_0x379a('0x7b'));if(_0x3e003d[_0x379a('0x7c')]===_0x379a('0x36')){var _0x5abd12=_0x35c7fb[_0x379a('0x23')]({'plain':!![]});return db[_0x379a('0x7d')][_0x379a('0x69')]({'where':{'name':_0x379a('0x24'),'userProfileId':_0x3e003d['userProfileId']},'raw':!![]})['then'](function(_0xbc7511){if(_0xbc7511&&_0xbc7511['autoAssociation']===0x0){return db['UserProfileResource'][_0x379a('0x6c')]({'name':_0x5abd12[_0x379a('0x28')],'resourceId':_0x5abd12['id'],'type':_0xbc7511['name'],'sectionId':_0xbc7511['id']},{})[_0x379a('0xf')](function(){return _0x35c7fb;});}else{return _0x35c7fb;}})[_0x379a('0x1a')](function(_0x5f08a1){logger['error'](_0x379a('0x7e'),_0x5f08a1);throw _0x5f08a1;});}return _0x35c7fb;})[_0x379a('0xf')](respondWithResult(_0x52d32e,0xc9))[_0x379a('0x1a')](handleError(_0x52d32e,null));};exports[_0x379a('0x7f')]=function(_0x5b1ce6,_0x1a3b4b){return db[_0x379a('0x47')][_0x379a('0x6e')]({'where':{'id':_0x5b1ce6[_0x379a('0x66')]['id']}})[_0x379a('0xf')](handleEntityNotFound(_0x1a3b4b,null))['then'](function(_0x5a9b68){if(_0x5a9b68){return _0x5a9b68[_0x379a('0x7f')]();}return null;})['then'](respondWithResult(_0x1a3b4b,null))['catch'](handleError(_0x1a3b4b,null));};exports['addImap']=function(_0x4e812e,_0x1ae3d4){if(_0x4e812e[_0x379a('0x63')]['id']){delete _0x4e812e[_0x379a('0x63')]['id'];}return db[_0x379a('0x47')][_0x379a('0x69')]({'where':{'id':_0x4e812e['params']['id']}})['then'](handleEntityNotFound(_0x1ae3d4,null))[_0x379a('0xf')](function(_0x5e1fdd){if(_0x5e1fdd){_0x4e812e[_0x379a('0x63')][_0x379a('0x6a')]=_0x5e1fdd['id'];return db[_0x379a('0x60')][_0x379a('0x6c')](_0x4e812e['body']);}})[_0x379a('0xf')](respondWithResult(_0x1ae3d4,null))[_0x379a('0x1a')](handleError(_0x1ae3d4,null));};exports['removeImap']=function(_0x3503c4,_0x4d0e7d){return db[_0x379a('0x47')][_0x379a('0x6e')]({'where':{'id':_0x3503c4[_0x379a('0x66')]['id']}})[_0x379a('0xf')](handleEntityNotFound(_0x4d0e7d,null))[_0x379a('0xf')](function(_0x33282c){if(_0x33282c){return _0x33282c[_0x379a('0x80')](null);}return null;})[_0x379a('0xf')](respondWithStatusCode(_0x4d0e7d,null))['catch'](handleError(_0x4d0e7d,null));};exports['getSmtp']=function(_0x385805,_0x5c77b2){return db[_0x379a('0x47')][_0x379a('0x6e')]({'where':{'id':_0x385805[_0x379a('0x66')]['id']}})[_0x379a('0xf')](handleEntityNotFound(_0x5c77b2,null))[_0x379a('0xf')](function(_0x564bfc){if(_0x564bfc){return _0x564bfc['getSmtp']();}return null;})[_0x379a('0xf')](respondWithResult(_0x5c77b2,null))['catch'](handleError(_0x5c77b2,null));};exports[_0x379a('0x81')]=function(_0x2e55ac,_0x178338){if(_0x2e55ac['body']['id']){delete _0x2e55ac[_0x379a('0x63')]['id'];}return db[_0x379a('0x47')][_0x379a('0x69')]({'where':{'id':_0x2e55ac[_0x379a('0x66')]['id']}})[_0x379a('0xf')](handleEntityNotFound(_0x178338,null))[_0x379a('0xf')](function(_0x48589d){if(_0x48589d){_0x2e55ac[_0x379a('0x63')]['MailAccountId']=_0x48589d['id'];return db[_0x379a('0x43')][_0x379a('0x6c')](_0x2e55ac[_0x379a('0x63')]);}})['then'](respondWithResult(_0x178338,null))[_0x379a('0x1a')](handleError(_0x178338,null));};exports['removeSmtp']=function(_0x10d94b,_0xc27d31){return db[_0x379a('0x47')][_0x379a('0x6e')]({'where':{'id':_0x10d94b[_0x379a('0x66')]['id']}})[_0x379a('0xf')](handleEntityNotFound(_0xc27d31,null))[_0x379a('0xf')](function(_0x12ff82){if(_0x12ff82){return _0x12ff82['setSmtp'](null);}return null;})[_0x379a('0xf')](respondWithStatusCode(_0xc27d31,null))[_0x379a('0x1a')](handleError(_0xc27d31,null));};exports[_0x379a('0x82')]=function(_0x7a0751,_0x11993a){return db[_0x379a('0x83')][_0x379a('0x69')]({'where':{'id':_0x7a0751[_0x379a('0x66')]['id']}})['then'](handleEntityNotFound(_0x11993a,null))[_0x379a('0xf')](function(_0x371149){if(_0x371149){return _0x371149['addInteraction'](_0x7a0751[_0x379a('0x63')][_0x379a('0x72')],_[_0x379a('0x84')](_0x7a0751[_0x379a('0x63')],[_0x379a('0x72'),'id'])||{});}})[_0x379a('0xf')](respondWithResult(_0x11993a,null))[_0x379a('0x1a')](handleError(_0x11993a,null));};exports['getInteractions']=function(_0x580e7b,_0x1494f3){var _0x57b604={'raw':![],'where':{}};var _0xed7b8d={};var _0x17b767={'count':0x0,'rows':[]};return db[_0x379a('0x47')][_0x379a('0x6e')]({'where':{'id':_0x580e7b[_0x379a('0x66')]['id']}})['then'](handleEntityNotFound(_0x1494f3,null))[_0x379a('0xf')](function(_0xaaa416){if(_0xaaa416){_0xed7b8d[_0x379a('0x4c')]=_[_0x379a('0x4e')](db['MailInteraction']['rawAttributes']);_0xed7b8d[_0x379a('0x4d')]=_['keys'](_0x580e7b[_0x379a('0x4d')]);_0xed7b8d[_0x379a('0x4f')]=_[_0x379a('0x50')](_0xed7b8d[_0x379a('0x4c')],_0xed7b8d['query']);_0x57b604[_0x379a('0x52')]=_[_0x379a('0x50')](_0xed7b8d[_0x379a('0x4c')],qs['fields'](_0x580e7b[_0x379a('0x4d')][_0x379a('0x51')]));_0x57b604[_0x379a('0x52')]=_0x57b604[_0x379a('0x52')][_0x379a('0x53')]?_0x57b604['attributes']:_0xed7b8d['model'];if(!_0x580e7b[_0x379a('0x4d')][_0x379a('0x54')](_0x379a('0x6f'))){_0x57b604['limit']=qs[_0x379a('0x1f')](_0x580e7b[_0x379a('0x4d')]['limit']);_0x57b604['offset']=qs[_0x379a('0x1e')](_0x580e7b[_0x379a('0x4d')][_0x379a('0x1e')]);}_0x57b604[_0x379a('0x55')]=qs['sort'](_0x580e7b['query'][_0x379a('0x56')]);_0x57b604[_0x379a('0x59')]=qs[_0x379a('0x4f')](_['pick'](_0x580e7b[_0x379a('0x4d')],_0xed7b8d['filters']));_0x57b604[_0x379a('0x59')][_0x379a('0x6a')]=_0xaaa416['id'];if(_0x580e7b['query']['filter']){_0x57b604[_0x379a('0x59')]=_[_0x379a('0x5a')](_0x57b604['where'],{'$or':_['map'](_0x57b604[_0x379a('0x52')],function(_0x46bd62){var _0x12cfa7={};_0x12cfa7[_0x46bd62]={'$like':'%'+_0x580e7b[_0x379a('0x4d')]['filter']+'%'};return _0x12cfa7;})});}_0x57b604=_[_0x379a('0x5a')]({},_0x57b604,_0x580e7b['options']);return db['MailInteraction'][_0x379a('0x5c')]({'where':_0x57b604[_0x379a('0x59')]})[_0x379a('0xf')](function(_0x501182){_0x17b767[_0x379a('0x5c')]=_0x501182;if(_0x580e7b['query'][_0x379a('0x61')]){_0x57b604[_0x379a('0x5d')]=[{'model':db[_0x379a('0x85')],'as':'Contact','required':![]},{'model':db[_0x379a('0x86')],'as':'Owner','attributes':[_0x379a('0x28'),'fullname','internal'],'required':![]},{'model':db[_0x379a('0x87')],'as':'Tags','attributes':['id','name','color'],'where':_0x580e7b[_0x379a('0x4d')]['tag']?{'id':_0x580e7b['query']['tag']}:undefined,'required':_0x580e7b[_0x379a('0x4d')]['tag']?!![]:![]}];}return db['MailInteraction'][_0x379a('0x70')](_0x57b604);})[_0x379a('0xf')](function(_0xa75fdf){_0x17b767[_0x379a('0x5e')]=_0xa75fdf;return _0x17b767;});}})[_0x379a('0xf')](respondWithFilteredResult(_0x1494f3,_0x57b604))['catch'](handleError(_0x1494f3,null));};exports[_0x379a('0x88')]=function addApplications(_0x5eb1d7,_0x4d251e){var _0x4e5f77=_0x5eb1d7[_0x379a('0x66')]['id'];var _0x47e313=_0x5eb1d7[_0x379a('0x63')];var _0x390ce2=0xc8;var _0x16e4fb=null;return db[_0x379a('0x89')]['transaction']({'isolationLevel':db[_0x379a('0x89')][_0x379a('0x8a')]['ISOLATION_LEVELS'][_0x379a('0x8b')]},function(_0x1a0871){return db[_0x379a('0x47')]['findOne']({'where':{'id':_0x4e5f77},'transaction':_0x1a0871})[_0x379a('0xf')](function(_0x2a1423){if(_0x2a1423){return db[_0x379a('0x8c')][_0x379a('0x26')]({'where':{'MailAccountId':_0x4e5f77},'transaction':_0x1a0871})[_0x379a('0xf')](function(){var _0x2139bc=_[_0x379a('0x46')](_0x47e313,function(_0x24dabf){_0x24dabf[_0x379a('0x6a')]=_0x4e5f77;return _0x24dabf;});return db[_0x379a('0x8c')]['bulkCreate'](_0x2139bc,{'transaction':_0x1a0871});});}else{_0x390ce2=0x194;_0x16e4fb=[];}});})[_0x379a('0xf')](function(){if(_0x390ce2!==0x194){return db[_0x379a('0x8c')][_0x379a('0x8d')]({'where':{'MailAccountId':_0x4e5f77},'order':_0x379a('0x8e')})[_0x379a('0xf')](function(_0x2e49dc){_0x16e4fb=_0x2e49dc;});}})[_0x379a('0x1a')](function(_0x30d346){_0x390ce2=0x1f4;logger['error'](_0x30d346['stack']);if(_0x30d346['name']){delete _0x30d346['name'];}_0x16e4fb=_0x30d346;})[_0x379a('0x8f')](function(){if(_0x16e4fb===null){_0x4d251e[_0x379a('0x1b')](_0x390ce2);}else{if(_0x390ce2===0x1f4){_0x4d251e[_0x379a('0x1c')](_0x390ce2)['send'](_0x16e4fb);}else{_0x4d251e[_0x379a('0x1c')](_0x390ce2)[_0x379a('0x21')](_0x16e4fb);}}});};exports[_0x379a('0x90')]=function(_0x5e6e07,_0x52898d){var _0x49616c={};var _0x363ad6={};var _0x57e429;var _0x3c46d0;return db[_0x379a('0x47')][_0x379a('0x6e')]({'where':{'id':_0x5e6e07[_0x379a('0x66')]['id']}})[_0x379a('0xf')](handleEntityNotFound(_0x52898d,null))[_0x379a('0xf')](function(_0x14caaa){if(_0x14caaa){_0x57e429=_0x14caaa;_0x363ad6[_0x379a('0x4c')]=_[_0x379a('0x4e')](db[_0x379a('0x8c')]['rawAttributes']);_0x363ad6['query']=_[_0x379a('0x4e')](_0x5e6e07[_0x379a('0x4d')]);_0x363ad6[_0x379a('0x4f')]=_[_0x379a('0x50')](_0x363ad6['model'],_0x363ad6[_0x379a('0x4d')]);_0x49616c['attributes']=_[_0x379a('0x50')](_0x363ad6[_0x379a('0x4c')],qs[_0x379a('0x51')](_0x5e6e07[_0x379a('0x4d')][_0x379a('0x51')]));_0x49616c[_0x379a('0x52')]=_0x49616c['attributes'][_0x379a('0x53')]?_0x49616c[_0x379a('0x52')]:_0x363ad6[_0x379a('0x4c')];_0x49616c[_0x379a('0x55')]=qs[_0x379a('0x56')](_0x5e6e07[_0x379a('0x4d')][_0x379a('0x56')]);_0x49616c['where']=qs[_0x379a('0x4f')](_[_0x379a('0x57')](_0x5e6e07[_0x379a('0x4d')],_0x363ad6[_0x379a('0x4f')]));if(_0x5e6e07[_0x379a('0x4d')][_0x379a('0x58')]){_0x49616c['where']=_[_0x379a('0x5a')](_0x49616c[_0x379a('0x59')],{'$or':_[_0x379a('0x46')](_0x49616c[_0x379a('0x52')],function(_0x25a7c7){var _0xfa58d2={};_0xfa58d2[_0x25a7c7]={'$like':'%'+_0x5e6e07['query'][_0x379a('0x58')]+'%'};return _0xfa58d2;})});}_0x49616c=_[_0x379a('0x5a')]({},_0x49616c,_0x5e6e07['options']);return _0x57e429[_0x379a('0x90')](_0x49616c);}})[_0x379a('0xf')](function(_0x279213){if(_0x279213){_0x3c46d0=_0x279213[_0x379a('0x53')];if(!_0x5e6e07[_0x379a('0x4d')][_0x379a('0x54')]('nolimit')){_0x49616c[_0x379a('0x1f')]=qs['limit'](_0x5e6e07[_0x379a('0x4d')][_0x379a('0x1f')]);_0x49616c[_0x379a('0x1e')]=qs[_0x379a('0x1e')](_0x5e6e07['query'][_0x379a('0x1e')]);}return _0x57e429[_0x379a('0x90')](_0x49616c);}})[_0x379a('0xf')](function(_0x2f76c3){if(_0x2f76c3){return _0x2f76c3?{'count':_0x3c46d0,'rows':_0x2f76c3}:null;}})['then'](respondWithResult(_0x52898d,null))['catch'](handleError(_0x52898d,null));};exports[_0x379a('0x91')]=function(_0x576e69,_0x41cb58){var _0x3b48e8={'raw':!![],'where':{}};var _0x44c81a={};var _0x4c98eb={'count':0x0,'rows':[]};return db[_0x379a('0x47')]['findOne']({'where':{'id':_0x576e69['params']['id']}})['then'](handleEntityNotFound(_0x41cb58,null))[_0x379a('0xf')](function(_0x3b1850){if(_0x3b1850){_0x44c81a[_0x379a('0x4c')]=_[_0x379a('0x4e')](db[_0x379a('0x92')][_0x379a('0x48')]);_0x44c81a[_0x379a('0x4d')]=_[_0x379a('0x4e')](_0x576e69[_0x379a('0x4d')]);_0x44c81a[_0x379a('0x4f')]=_[_0x379a('0x50')](_0x44c81a['model'],_0x44c81a[_0x379a('0x4d')]);_0x3b48e8[_0x379a('0x52')]=_[_0x379a('0x50')](_0x44c81a['model'],qs[_0x379a('0x51')](_0x576e69['query'][_0x379a('0x51')]));_0x3b48e8[_0x379a('0x52')]=_0x3b48e8[_0x379a('0x52')][_0x379a('0x53')]?_0x3b48e8[_0x379a('0x52')]:_0x44c81a[_0x379a('0x4c')];if(!_0x576e69[_0x379a('0x4d')][_0x379a('0x54')](_0x379a('0x6f'))){_0x3b48e8[_0x379a('0x1f')]=qs[_0x379a('0x1f')](_0x576e69[_0x379a('0x4d')]['limit']);_0x3b48e8[_0x379a('0x1e')]=qs['offset'](_0x576e69[_0x379a('0x4d')][_0x379a('0x1e')]);}_0x3b48e8[_0x379a('0x55')]=qs[_0x379a('0x56')](_0x576e69[_0x379a('0x4d')]['sort']);_0x3b48e8[_0x379a('0x59')]=qs['filters'](_['pick'](_0x576e69[_0x379a('0x4d')],_0x44c81a[_0x379a('0x4f')]));_0x3b48e8[_0x379a('0x59')][_0x379a('0x6a')]=_0x3b1850['id'];if(_0x576e69[_0x379a('0x4d')]['filter']){_0x3b48e8[_0x379a('0x59')]=_[_0x379a('0x5a')](_0x3b48e8['where'],{'$or':_[_0x379a('0x46')](_0x3b48e8['attributes'],function(_0x329b9f){var _0x1eac7c={};_0x1eac7c[_0x329b9f]={'$like':'%'+_0x576e69[_0x379a('0x4d')][_0x379a('0x58')]+'%'};return _0x1eac7c;})});}if(_0x576e69['query'][_0x379a('0x93')]){var _0x17ca31=_0x576e69[_0x379a('0x4d')][_0x379a('0x93')]['split'](',');var _0x47fdbe={};_0x47fdbe[_0x17ca31[0x0]]={'$gte':moment(_0x17ca31[0x1])[_0x379a('0x94')](_0x379a('0x95'))};_0x3b48e8[_0x379a('0x59')]=_[_0x379a('0x5a')](_0x3b48e8[_0x379a('0x59')],_0x47fdbe);}_0x3b48e8=_[_0x379a('0x5a')]({},_0x3b48e8,_0x576e69[_0x379a('0x62')]);return db['MailMessage']['count']({'where':_0x3b48e8['where']})[_0x379a('0xf')](function(_0x5664c0){_0x4c98eb[_0x379a('0x5c')]=_0x5664c0;if(_0x576e69[_0x379a('0x4d')][_0x379a('0x61')]){_0x3b48e8[_0x379a('0x5d')]=[{'all':!![]}];}return db[_0x379a('0x92')][_0x379a('0x70')](_0x3b48e8);})[_0x379a('0xf')](function(_0x1953b0){if(_0x576e69[_0x379a('0x4d')][_0x379a('0x96')]===_0x379a('0x97')){for(var _0x56179e=0x0;_0x56179e<_0x1953b0['length'];_0x56179e++){_0x1953b0[_0x56179e][_0x379a('0x63')]=juice(_0x1953b0[_0x56179e][_0x379a('0x63')]);}}_0x4c98eb[_0x379a('0x5e')]=_0x1953b0;return _0x4c98eb;});}})[_0x379a('0xf')](respondWithFilteredResult(_0x41cb58,_0x3b48e8))[_0x379a('0x1a')](handleError(_0x41cb58,null));};exports['send']=function(_0x52f6ab,_0x512143){var _0x182d91,_0x10a098={},_0x507961;if(_0x52f6ab[_0x379a('0x63')]['to']){_0x507961=_0x52f6ab[_0x379a('0x63')]['to'][_0x379a('0x98')](',')[0x0];}return db[_0x379a('0x47')][_0x379a('0x69')]({'where':{'id':_0x52f6ab['params']['id']},'include':[{'model':db[_0x379a('0x99')],'as':_0x379a('0x9a'),'include':[{'model':db['CmContact'],'as':_0x379a('0x9b'),'where':{'email':_0x507961},'limit':0x1,'order':[[_0x379a('0x9c'),_0x379a('0x9d')]]}]},{'model':db[_0x379a('0x43')],'as':_0x379a('0x41'),'raw':!![],'include':[{'model':db[_0x379a('0x9e')],'as':_0x379a('0x9e'),'raw':!![]}]}]})[_0x379a('0xf')](handleEntityNotFound(_0x512143,null))['then'](function(_0x12877e){if(!_0x12877e)return;_0x182d91=_0x12877e;if(!_0x12877e['Smtp'])throw new Error(_0x379a('0x9f'));if(_[_0x379a('0x78')](_0x52f6ab[_0x379a('0x63')][_0x379a('0xa0')])){_0x52f6ab['body'][_0x379a('0xa0')]=util[_0x379a('0x94')]('%s\x20<%s>',_0x12877e[_0x379a('0x28')],_0x12877e[_0x379a('0x76')]||_0x12877e[_0x379a('0x41')][_0x379a('0x36')]);}if(_0x52f6ab[_0x379a('0x63')][_0x379a('0xa1')]&&_0x52f6ab[_0x379a('0x63')][_0x379a('0xa1')][_0x379a('0x53')]){for(var _0x1c2140=0x0;_0x1c2140<_0x52f6ab[_0x379a('0x63')][_0x379a('0xa1')][_0x379a('0x53')];_0x1c2140+=0x1){_0x52f6ab[_0x379a('0x63')][_0x379a('0xa1')][_0x1c2140]={'filename':_0x52f6ab['body'][_0x379a('0xa1')][_0x1c2140][_0x379a('0x28')],'path':path[_0x379a('0xa2')](config['root'],'server/files/attachments',_0x52f6ab['body']['attachments'][_0x1c2140][_0x379a('0xa3')])};}}var _0x1874ea=_0x12877e[_0x379a('0xa4')]();return respondWithRpcPromise(_0x379a('0xa5'),_0x379a('0xa6'),{'account':_0x1874ea,'message':_0x52f6ab[_0x379a('0x63')]});})[_0x379a('0xf')](function(_0x2c2cc1){if(!_0x2c2cc1)return;_0x10a098=_0x2c2cc1;if(!_0x182d91[_0x379a('0x9a')])throw new Error(_0x379a('0xa7'));if(_0x182d91[_0x379a('0x9a')][_0x379a('0x9b')][_0x379a('0x53')])return _0x182d91['List'][_0x379a('0x9b')][0x0];return db[_0x379a('0x85')][_0x379a('0x6c')](_[_0x379a('0xa')](_0x52f6ab[_0x379a('0x63')],{'firstName':_0x52f6ab[_0x379a('0x63')]['to'],'email':_0x52f6ab[_0x379a('0x63')]['to'],'phone':_0x52f6ab[_0x379a('0x63')]['to'],'ListId':_0x182d91[_0x379a('0x77')]}));})[_0x379a('0xf')](function(_0x1ad230){if(!_0x1ad230)return;var _0x4f432d={'UserId':_0x52f6ab[_0x379a('0x36')]['id'],'ContactId':_0x1ad230['id'],'MailAccountId':_0x182d91['id'],'inReplyTo':_0x10a098[_0x379a('0xa8')],'to':_0x52f6ab['body'][_0x379a('0xa0')],'cc':_0x52f6ab[_0x379a('0x63')]['cc'],'subject':_0x52f6ab[_0x379a('0x63')]['subject'],'attach':_0x52f6ab[_0x379a('0x63')]['attach'],'firstMsgDirection':_0x379a('0xa9'),'lastMsgAt':moment()[_0x379a('0x94')](_0x379a('0x95')),'lastMsgDirection':_0x379a('0xa9'),'Messages':[_[_0x379a('0x5a')](_0x52f6ab['body'],{'messageId':_0x10a098[_0x379a('0xa8')],'sentAt':moment()[_0x379a('0x94')](_0x379a('0x95')),'read':!![],'MailAccountId':_0x182d91['id'],'UserId':_0x52f6ab['user']['id'],'ContactId':_0x1ad230['id']})]};if(_0x52f6ab[_0x379a('0x63')][_0x379a('0xaa')]){_0x4f432d=_['merge'](_0x4f432d,_0x52f6ab[_0x379a('0x63')]['Interaction']);}return db[_0x379a('0x83')][_0x379a('0x6c')](_0x4f432d,{'include':[{'model':db[_0x379a('0x92')],'as':'Messages'}]});})[_0x379a('0xf')](respondWithResult(_0x512143,null))[_0x379a('0x1a')](handleError(_0x512143,null));};exports[_0x379a('0xab')]=function(_0x231a4b,_0x23dfbd){return db[_0x379a('0x47')]['find']({'where':{'id':_0x231a4b[_0x379a('0x66')]['id']},'include':[{'model':db[_0x379a('0x43')],'as':_0x379a('0x41'),'raw':!![],'include':[{'model':db[_0x379a('0x9e')],'as':'CloudProvider','raw':!![]}]}]})[_0x379a('0xf')](handleEntityNotFound(_0x23dfbd,null))[_0x379a('0xf')](function(_0x1d3f36){if(!_0x1d3f36[_0x379a('0x41')])return;var _0x3150ea=_0x1d3f36[_0x379a('0xa4')]();return respondWithRpcPromise('VerifySmtp',_0x379a('0xab'),{'account':_0x3150ea});})[_0x379a('0xf')](respondWithResult(_0x23dfbd,null))[_0x379a('0x1a')](handleError(_0x23dfbd,null));};exports[_0x379a('0x26')]=function(_0x46ee64,_0x456260){return db[_0x379a('0x47')][_0x379a('0x69')]({'where':{'id':_0x46ee64['params']['id']}})[_0x379a('0xf')](handleEntityNotFound(_0x456260,null))['then'](function(_0x2ee5c3){if(_0x2ee5c3&&_0x2ee5c3[_0x379a('0x3e')]){throw new db[(_0x379a('0xac'))][(_0x379a('0xad'))](_0x379a('0xae'));}return _0x2ee5c3;})[_0x379a('0xf')](removeEntity(_0x456260,null))['catch'](handleError(_0x456260,null));};exports[_0x379a('0xaf')]=function(_0x5cc82c,_0x2044ee){return db[_0x379a('0x47')][_0x379a('0x69')]({'where':{'id':_0x5cc82c['params']['id']}})[_0x379a('0xf')](handleEntityNotFound(_0x2044ee,null))[_0x379a('0xf')](function(_0x211d8f){if(_0x211d8f){return _0x211d8f['addAgents'](_0x5cc82c[_0x379a('0x63')][_0x379a('0x72')],_[_0x379a('0x84')](_0x5cc82c['body'],[_0x379a('0x72'),'id'])||{})[_0x379a('0xb0')](function(_0x445f11){for(var _0x4befc5=0x0;_0x4befc5<_0x5cc82c[_0x379a('0x63')][_0x379a('0x72')][_0x379a('0x53')];_0x4befc5+=0x1){socket['emit'](_0x379a('0xb1'),{'UserId':Number(_0x5cc82c[_0x379a('0x63')][_0x379a('0x72')][_0x4befc5]),'MailAccountId':Number(_0x5cc82c['params']['id'])});}return _0x445f11;});}})[_0x379a('0xf')](respondWithResult(_0x2044ee,null))[_0x379a('0x1a')](handleError(_0x2044ee,null));};exports[_0x379a('0xb2')]=function(_0x4df729,_0x10c709){return db[_0x379a('0x47')][_0x379a('0x69')]({'where':{'id':_0x4df729[_0x379a('0x66')]['id']}})['then'](handleEntityNotFound(_0x10c709,null))[_0x379a('0xf')](function(_0x44f4f6){if(_0x44f4f6){return _0x44f4f6[_0x379a('0xb2')](_0x4df729[_0x379a('0x4d')]['ids'])['then'](function(){if(_[_0x379a('0xb3')](_0x4df729['query'][_0x379a('0x72')])){for(var _0x303b90=0x0;_0x303b90<_0x4df729[_0x379a('0x4d')]['ids'][_0x379a('0x53')];_0x303b90+=0x1){socket[_0x379a('0xb4')](_0x379a('0xb5'),{'UserId':Number(_0x4df729[_0x379a('0x4d')][_0x379a('0x72')][_0x303b90]),'MailAccountId':Number(_0x4df729[_0x379a('0x66')]['id'])});}}else{socket[_0x379a('0xb4')]('userMailAccount:remove',{'UserId':Number(_0x4df729[_0x379a('0x4d')][_0x379a('0x72')]),'MailAccountId':Number(_0x4df729[_0x379a('0x66')]['id'])});}});}})[_0x379a('0xf')](respondWithStatusCode(_0x10c709,null))['catch'](handleError(_0x10c709,null));};exports[_0x379a('0xb6')]=function(_0x1adde2,_0x34ff55){var _0x7c92d6={};var _0x24cb0e={};var _0x58418d;var _0x59ecee;return db['MailAccount'][_0x379a('0x6e')]({'where':{'id':_0x1adde2['params']['id']}})[_0x379a('0xf')](handleEntityNotFound(_0x34ff55,null))[_0x379a('0xf')](function(_0x2070ed){if(_0x2070ed){_0x58418d=_0x2070ed;_0x24cb0e[_0x379a('0x4c')]=_[_0x379a('0x4e')](db['User'][_0x379a('0x48')]);_0x24cb0e[_0x379a('0x4d')]=_[_0x379a('0x4e')](_0x1adde2[_0x379a('0x4d')]);_0x24cb0e['filters']=_[_0x379a('0x50')](_0x24cb0e['model'],_0x24cb0e[_0x379a('0x4d')]);_0x7c92d6['attributes']=_[_0x379a('0x50')](_0x24cb0e[_0x379a('0x4c')],qs[_0x379a('0x51')](_0x1adde2[_0x379a('0x4d')][_0x379a('0x51')]));_0x7c92d6[_0x379a('0x52')]=_0x7c92d6[_0x379a('0x52')]['length']?_0x7c92d6['attributes']:_0x24cb0e[_0x379a('0x4c')];_0x7c92d6[_0x379a('0x55')]=qs[_0x379a('0x56')](_0x1adde2[_0x379a('0x4d')][_0x379a('0x56')]);_0x7c92d6[_0x379a('0x59')]=qs['filters'](_[_0x379a('0x57')](_0x1adde2[_0x379a('0x4d')],_0x24cb0e[_0x379a('0x4f')]));if(_0x1adde2[_0x379a('0x4d')][_0x379a('0x58')]){_0x7c92d6[_0x379a('0x59')]=_[_0x379a('0x5a')](_0x7c92d6[_0x379a('0x59')],{'$or':_[_0x379a('0x46')](_0x7c92d6[_0x379a('0x52')],function(_0x10b23e){var _0x39b93e={};_0x39b93e[_0x10b23e]={'$like':'%'+_0x1adde2[_0x379a('0x4d')][_0x379a('0x58')]+'%'};return _0x39b93e;})});}_0x7c92d6=_[_0x379a('0x5a')]({},_0x7c92d6,_0x1adde2[_0x379a('0x62')]);return _0x58418d[_0x379a('0xb6')](_0x7c92d6);}})[_0x379a('0xf')](function(_0x70bf17){if(_0x70bf17){_0x59ecee=_0x70bf17[_0x379a('0x53')];if(!_0x1adde2[_0x379a('0x4d')][_0x379a('0x54')](_0x379a('0x6f'))){_0x7c92d6[_0x379a('0x1f')]=qs[_0x379a('0x1f')](_0x1adde2['query'][_0x379a('0x1f')]);_0x7c92d6[_0x379a('0x1e')]=qs['offset'](_0x1adde2[_0x379a('0x4d')]['offset']);}return _0x58418d[_0x379a('0xb6')](_0x7c92d6);}})[_0x379a('0xf')](function(_0x424b3d){if(_0x424b3d){return _0x424b3d?{'count':_0x59ecee,'rows':_0x424b3d}:null;}})['then'](respondWithResult(_0x34ff55,null))['catch'](handleError(_0x34ff55,null));}; \ No newline at end of file +var _0x227a=['Disposition','create','getDispositions','findOne','hasOwnProperty','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','email','ListId','isNil','active','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','omit','getInteractions','CmContact','Contact','User','internal','color','tag','transaction','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','getMessages','$gte','split','MailMessage','inlineCss','true','CmList','List','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','defaults','messageId','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','moment','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','stack','name','imap.gmail.com','yahoo','hotmail','outlook365','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','pass','password','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerOut','Pause','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailAccount','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','fields','find','body','provider','custom','MailServerIn','Mail\x20Account\x20not\x20found','describe','MailAccountId'];(function(_0x35ad98,_0x2b421e){var _0x2e21bd=function(_0x10f090){while(--_0x10f090){_0x35ad98['push'](_0x35ad98['shift']());}};_0x2e21bd(++_0x2b421e);}(_0x227a,0x115));var _0xa227=function(_0x2b3e4a,_0x1c2da2){_0x2b3e4a=_0x2b3e4a-0x0;var _0x469cbd=_0x227a[_0x2b3e4a];return _0x469cbd;};'use strict';var moment=require(_0xa227('0x0'));var BPromise=require(_0xa227('0x1'));var util=require('util');var path=require(_0xa227('0x2'));var _=require(_0xa227('0x3'));var juice=require(_0xa227('0x4'));var Redis=require(_0xa227('0x5'));var qs=require(_0xa227('0x6'));var logger=require(_0xa227('0x7'))('api');var config=require(_0xa227('0x8'));var db=require(_0xa227('0x9'))['db'];config[_0xa227('0xa')]=_['defaults'](config[_0xa227('0xa')],{'host':_0xa227('0xb'),'port':0x18eb});var socket=require(_0xa227('0xc'))(new Redis(config[_0xa227('0xa')]));require(_0xa227('0xd'))['register'](socket);var jayson=require(_0xa227('0xe'));var client=jayson[_0xa227('0xf')][_0xa227('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x293150,_0x16980c,_0xf7a150,_0x2d3e31){return new BPromise(function(_0x1af03f,_0x2e9b10){var _0x57f0b2=_0x2d3e31||client;return _0x57f0b2[_0xa227('0x11')](_0x293150,_0xf7a150)[_0xa227('0x12')](function(_0xc7f1de){logger[_0xa227('0x13')](_0xa227('0x14'),_0x16980c,_0xa227('0x15'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x16980c,_0xa227('0x15'),JSON[_0xa227('0x16')](_0xc7f1de));if(_0xc7f1de[_0xa227('0x17')]){if(_0xc7f1de['error']['code']===0x1f4){logger[_0xa227('0x17')]('MailAccount,\x20%s,\x20%s',_0x16980c,_0xc7f1de[_0xa227('0x17')][_0xa227('0x18')]);return _0x2e9b10(_0xc7f1de['error']['message']);}logger[_0xa227('0x17')](_0xa227('0x14'),_0x16980c,_0xc7f1de[_0xa227('0x17')][_0xa227('0x18')]);return _0x1af03f(_0xc7f1de[_0xa227('0x17')][_0xa227('0x18')]);}else{logger['info'](_0xa227('0x14'),_0x16980c,_0xa227('0x15'));_0x1af03f(_0xc7f1de[_0xa227('0x19')][_0xa227('0x18')]);}})[_0xa227('0x1a')](function(_0x362229){logger[_0xa227('0x17')](_0xa227('0x14'),_0x16980c,_0x362229);_0x2e9b10(_0x362229);});});}function respondWithStatusCode(_0x510397,_0x3ee89e){_0x3ee89e=_0x3ee89e||0xcc;return function(_0x192044){if(_0x192044){return _0x510397[_0xa227('0x1b')](_0x3ee89e);}return _0x510397['status'](_0x3ee89e)[_0xa227('0x1c')]();};}function respondWithResult(_0xf2790b,_0x590d67){_0x590d67=_0x590d67||0xc8;return function(_0x5a6a83){if(_0x5a6a83){return _0xf2790b[_0xa227('0x1d')](_0x590d67)[_0xa227('0x1e')](_0x5a6a83);}};}function respondWithFilteredResult(_0x2e742e,_0x2a5fd3){return function(_0x58f154){if(_0x58f154){var _0x34f54e=typeof _0x2a5fd3['offset']===_0xa227('0x1f')&&typeof _0x2a5fd3[_0xa227('0x20')]===_0xa227('0x1f');var _0x505b83=_0x58f154['count'];var _0x1f989f=_0x34f54e?0x0:_0x2a5fd3[_0xa227('0x21')];var _0x1bdcdd=_0x34f54e?_0x58f154[_0xa227('0x22')]:_0x2a5fd3[_0xa227('0x21')]+_0x2a5fd3[_0xa227('0x20')];var _0x328190;if(_0x1bdcdd>=_0x505b83){_0x1bdcdd=_0x505b83;_0x328190=0xc8;}else{_0x328190=0xce;}_0x2e742e[_0xa227('0x1d')](_0x328190);return _0x2e742e['set'](_0xa227('0x23'),_0x1f989f+'-'+_0x1bdcdd+'/'+_0x505b83)[_0xa227('0x1e')](_0x58f154);}return null;};}function saveUpdates(_0x1ce8db){return function(_0x4f0fd7){if(_0x4f0fd7){return _0x4f0fd7[_0xa227('0x24')](_0x1ce8db)[_0xa227('0x12')](function(_0x130e48){return _0x130e48;});}return null;};}function removeEntity(_0x5cd73f){return function(_0x1d53b7){if(_0x1d53b7){return _0x1d53b7[_0xa227('0x25')]()[_0xa227('0x12')](function(){var _0x3aa4c4=_0x1d53b7[_0xa227('0x26')]({'plain':!![]});var _0x5b58ec=_0xa227('0x27');return db[_0xa227('0x28')][_0xa227('0x25')]({'where':{'type':_0x5b58ec,'resourceId':_0x3aa4c4['id']}})[_0xa227('0x12')](function(){return _0x1d53b7;});})['then'](function(){_0x5cd73f['status'](0xcc)[_0xa227('0x1c')]();});}};}function handleEntityNotFound(_0xeb7f36){return function(_0x3e1ce9){if(!_0x3e1ce9){_0xeb7f36[_0xa227('0x1b')](0x194);}return _0x3e1ce9;};}function handleError(_0x23e641,_0x5eaac6){_0x5eaac6=_0x5eaac6||0x1f4;return function(_0x203cc8){logger[_0xa227('0x17')](_0x203cc8[_0xa227('0x29')]);if(_0x203cc8[_0xa227('0x2a')]){delete _0x203cc8[_0xa227('0x2a')];}_0x23e641['status'](_0x5eaac6)['send'](_0x203cc8);};}function getImapHost(_0x335879){switch(_0x335879){case'gmail':return _0xa227('0x2b');case _0xa227('0x2c'):return'imap.mail.yahoo.com';case _0xa227('0x2d'):return'imap-mail.outlook.com';case _0xa227('0x2e'):return'outlook.office365.com';}throw new Error(_0xa227('0x2f'),_0x335879);}function getSmtpHost(_0x290f4c){switch(_0x290f4c){case'gmail':return'smtp.gmail.com';case _0xa227('0x2c'):return _0xa227('0x30');case _0xa227('0x2d'):return _0xa227('0x31');case _0xa227('0x2e'):return _0xa227('0x32');}throw new Error(_0xa227('0x2f'),_0x290f4c);}function getAuthenticationOptions(_0x4b761b,_0x4573be){var _0x3e1eb5={};var _0x247951={};if(_0x4b761b){_0x3e1eb5[_0xa227('0x33')]=_0x247951[_0xa227('0x33')]=_0x4573be[_0xa227('0x34')];_0x3e1eb5['password']=_0x247951[_0xa227('0x35')]=_0x4573be[_0xa227('0x36')];if(_0x4573be['modernAuthentication']){_0x3e1eb5[_0xa227('0x37')]=_0x247951[_0xa227('0x37')]=!![];_0x3e1eb5[_0xa227('0x38')]=_0x247951[_0xa227('0x38')]=_0x4573be['CloudProviderId'];_0x3e1eb5['password']=_0x247951['pass']=null;}else{_0x3e1eb5[_0xa227('0x38')]=_0x247951[_0xa227('0x38')]=null;}_0x3e1eb5[_0xa227('0x39')]=getImapHost(_0x4b761b);_0x3e1eb5[_0xa227('0x3a')]=0x3e1;_0x247951[_0xa227('0x39')]=getSmtpHost(_0x4b761b);_0x247951[_0xa227('0x3a')]=0x24b;_0x247951[_0xa227('0x3b')]=![];_0x3e1eb5[_0xa227('0x3c')]=_0x247951[_0xa227('0x3c')]=null;}else{if(_0x4573be[_0xa227('0x3d')]){_0x3e1eb5[_0xa227('0x33')]=_0x247951[_0xa227('0x33')]=_0x4573be[_0xa227('0x34')];_0x3e1eb5['password']=_0x247951[_0xa227('0x35')]=_0x4573be[_0xa227('0x36')];}else{_0x3e1eb5['authentication']=_0x247951[_0xa227('0x3d')]=![];_0x3e1eb5[_0xa227('0x33')]=_0x247951[_0xa227('0x33')]=null;_0x3e1eb5[_0xa227('0x36')]=_0x247951['pass']=null;}_0x3e1eb5[_0xa227('0x39')]=_0x4573be[_0xa227('0x3e')][_0xa227('0x39')];_0x3e1eb5[_0xa227('0x3a')]=_0x4573be[_0xa227('0x3e')][_0xa227('0x3a')];_0x247951[_0xa227('0x39')]=_0x4573be[_0xa227('0x3f')]['host'];_0x247951[_0xa227('0x3a')]=_0x4573be[_0xa227('0x3f')][_0xa227('0x3a')];}return{'Imap':_0x3e1eb5,'Smtp':_0x247951};}exports[_0xa227('0x40')]=function(_0x2a80ba,_0x49ad5f){var _0x276da8={'include':[{'model':db['MailServerIn'],'as':_0xa227('0x3e')},{'model':db[_0xa227('0x41')],'as':'Smtp'},{'model':db[_0xa227('0x42')],'as':'mandatoryDispositionPause'}]},_0x494326={},_0x14b111={'count':0x0,'rows':[]};var _0x1a5ecf=_['map'](db['MailAccount'][_0xa227('0x43')],function(_0x12853b){return{'name':_0x12853b[_0xa227('0x44')],'type':_0x12853b[_0xa227('0x45')][_0xa227('0x46')]};});_0x494326[_0xa227('0x47')]=_[_0xa227('0x48')](_0x1a5ecf,_0xa227('0x2a'));_0x494326[_0xa227('0x49')]=_[_0xa227('0x4a')](_0x2a80ba['query']);_0x494326[_0xa227('0x4b')]=_[_0xa227('0x4c')](_0x494326[_0xa227('0x47')],_0x494326[_0xa227('0x49')]);_0x276da8[_0xa227('0x4d')]=_[_0xa227('0x4c')](_0x494326[_0xa227('0x47')],qs['fields'](_0x2a80ba[_0xa227('0x49')]['fields']));_0x276da8[_0xa227('0x4d')]=_0x276da8[_0xa227('0x4d')][_0xa227('0x4e')]?_0x276da8[_0xa227('0x4d')]:_0x494326[_0xa227('0x47')];if(!_0x2a80ba[_0xa227('0x49')]['hasOwnProperty'](_0xa227('0x4f'))){_0x276da8[_0xa227('0x20')]=qs['limit'](_0x2a80ba['query']['limit']);_0x276da8['offset']=qs[_0xa227('0x21')](_0x2a80ba['query'][_0xa227('0x21')]);}_0x276da8[_0xa227('0x50')]=qs['sort'](_0x2a80ba['query'][_0xa227('0x51')]);_0x276da8[_0xa227('0x52')]=qs[_0xa227('0x4b')](_[_0xa227('0x53')](_0x2a80ba['query'],_0x494326[_0xa227('0x4b')]),_0x1a5ecf);if(_0x2a80ba[_0xa227('0x49')][_0xa227('0x54')]){_0x276da8['where']=_[_0xa227('0x55')](_0x276da8[_0xa227('0x52')],{'$or':_[_0xa227('0x48')](_0x1a5ecf,function(_0x155432){if(_0x155432[_0xa227('0x45')]!==_0xa227('0x56')){var _0x48cccb={};_0x48cccb[_0x155432['name']]={'$like':'%'+_0x2a80ba[_0xa227('0x49')][_0xa227('0x54')]+'%'};return _0x48cccb;}})});}_0x276da8=_[_0xa227('0x55')]({},_0x276da8,_0x2a80ba[_0xa227('0x57')]);var _0x3b2ac0={'where':_0x276da8[_0xa227('0x52')]};return db[_0xa227('0x58')][_0xa227('0x22')](_0x3b2ac0)[_0xa227('0x12')](function(_0x3e1b5e){_0x14b111[_0xa227('0x22')]=_0x3e1b5e;if(_0x2a80ba[_0xa227('0x49')][_0xa227('0x59')]){_0x276da8[_0xa227('0x5a')]=[{'all':!![]}];}return db['MailAccount'][_0xa227('0x5b')](_0x276da8);})['then'](function(_0x344e3e){_0x14b111[_0xa227('0x5c')]=_0x344e3e;return _0x14b111;})[_0xa227('0x12')](respondWithFilteredResult(_0x49ad5f,_0x276da8))['catch'](handleError(_0x49ad5f,null));};exports[_0xa227('0x5d')]=function(_0x212e5a,_0x28d329){var _0x12dccf={'raw':![],'where':{'id':_0x212e5a[_0xa227('0x5e')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xa227('0x3e')},{'model':db[_0xa227('0x41')],'as':_0xa227('0x3f')},{'model':db['Pause'],'as':_0xa227('0x5f')}]},_0x24a3f9={};_0x24a3f9[_0xa227('0x47')]=_[_0xa227('0x4a')](db[_0xa227('0x58')]['rawAttributes']);_0x24a3f9['query']=_[_0xa227('0x4a')](_0x212e5a[_0xa227('0x49')]);_0x24a3f9['filters']=_[_0xa227('0x4c')](_0x24a3f9[_0xa227('0x47')],_0x24a3f9['query']);_0x12dccf[_0xa227('0x4d')]=_[_0xa227('0x4c')](_0x24a3f9['model'],qs[_0xa227('0x60')](_0x212e5a[_0xa227('0x49')]['fields']));_0x12dccf[_0xa227('0x4d')]=_0x12dccf['attributes']['length']?_0x12dccf[_0xa227('0x4d')]:_0x24a3f9[_0xa227('0x47')];if(_0x212e5a[_0xa227('0x49')][_0xa227('0x59')]){_0x12dccf[_0xa227('0x5a')]=[{'all':!![]}];}_0x12dccf=_[_0xa227('0x55')]({},_0x12dccf,_0x212e5a[_0xa227('0x57')]);return db[_0xa227('0x58')][_0xa227('0x61')](_0x12dccf)[_0xa227('0x12')](handleEntityNotFound(_0x28d329,null))[_0xa227('0x12')](respondWithResult(_0x28d329,null))['catch'](handleError(_0x28d329,null));};exports['update']=function(_0x232ffd,_0x617dde){if(_0x232ffd['body']['id']){delete _0x232ffd[_0xa227('0x62')]['id'];}var _0x57e773=_0x232ffd[_0xa227('0x62')][_0xa227('0x63')]===_0xa227('0x64')?null:_0x232ffd[_0xa227('0x62')]['provider'];var _0x225540=_0x232ffd[_0xa227('0x62')][_0xa227('0x3e')]||{};var _0x55d6d4=_0x232ffd['body']['Smtp']||{};if(_0x57e773){_0x225540[_0xa227('0x39')]=getImapHost(_0x57e773);_0x225540[_0xa227('0x3a')]=0x3e1;_0x55d6d4[_0xa227('0x39')]=getSmtpHost(_0x57e773);_0x55d6d4['port']=0x24b;_0x55d6d4[_0xa227('0x3b')]=![];}if(_0x55d6d4[_0xa227('0x37')]){_0x55d6d4[_0xa227('0x3b')]=![];}else{_0x55d6d4[_0xa227('0x38')]=null;}if(!_0x225540[_0xa227('0x37')])_0x225540[_0xa227('0x38')]=null;_0x232ffd[_0xa227('0x62')][_0xa227('0x3e')]=_0x225540;_0x232ffd[_0xa227('0x62')]['Smtp']=_0x55d6d4;return db[_0xa227('0x58')][_0xa227('0x61')]({'where':{'id':_0x232ffd['params']['id']},'include':[{'model':db[_0xa227('0x65')],'as':_0xa227('0x3e')},{'model':db[_0xa227('0x41')],'as':'Smtp'},{'model':db[_0xa227('0x42')],'as':_0xa227('0x5f')}]})[_0xa227('0x12')](handleEntityNotFound(_0x617dde,null))[_0xa227('0x12')](function(_0x5b80ae){if(!_0x5b80ae)throw new Error(_0xa227('0x66'));if(_0x5b80ae[_0xa227('0x3c')])delete _0x232ffd[_0xa227('0x62')][_0xa227('0x3e')];return _0x5b80ae;})[_0xa227('0x12')](saveUpdates(_0x232ffd[_0xa227('0x62')],null))[_0xa227('0x12')](function(_0x2d37d1){if(!_0x232ffd[_0xa227('0x62')][_0xa227('0x3e')])return _0x2d37d1;return db['MailServerIn'][_0xa227('0x24')](_0x232ffd[_0xa227('0x62')]['Imap'],{'where':{'MailAccountId':_0x2d37d1['id']}})[_0xa227('0x12')](function(){return _0x2d37d1;});})[_0xa227('0x12')](function(_0x421fb6){if(!_0x232ffd['body']['Smtp'])return _0x421fb6;return db[_0xa227('0x41')][_0xa227('0x24')](_0x232ffd[_0xa227('0x62')][_0xa227('0x3f')],{'where':{'MailAccountId':_0x421fb6['id']}})[_0xa227('0x12')](function(){return _0x421fb6;});})[_0xa227('0x12')](respondWithResult(_0x617dde,null))['catch'](handleError(_0x617dde,null));};exports[_0xa227('0x67')]=function(_0xfede3b,_0x5b918a){return db[_0xa227('0x58')][_0xa227('0x67')]()[_0xa227('0x12')](respondWithResult(_0x5b918a,null))[_0xa227('0x1a')](handleError(_0x5b918a,null));};exports['addDisposition']=function(_0x5caead,_0x472c86){if(_0x5caead[_0xa227('0x62')]['id']){delete _0x5caead[_0xa227('0x62')]['id'];}return db[_0xa227('0x58')][_0xa227('0x61')]({'where':{'id':_0x5caead['params']['id']}})['then'](handleEntityNotFound(_0x472c86,null))[_0xa227('0x12')](function(_0x1f3888){if(_0x1f3888){_0x5caead[_0xa227('0x62')][_0xa227('0x68')]=_0x1f3888['id'];return db[_0xa227('0x69')][_0xa227('0x6a')](_0x5caead['body']);}})[_0xa227('0x12')](respondWithResult(_0x472c86,null))[_0xa227('0x1a')](handleError(_0x472c86,null));};exports[_0xa227('0x6b')]=function(_0x1b8b59,_0x18dd21){var _0x191773={'raw':![],'where':{}};var _0x49ad01={};var _0x354e00={'count':0x0,'rows':[]};return db[_0xa227('0x58')][_0xa227('0x6c')]({'where':{'id':_0x1b8b59[_0xa227('0x5e')]['id']}})[_0xa227('0x12')](handleEntityNotFound(_0x18dd21,null))[_0xa227('0x12')](function(_0x3bce21){if(_0x3bce21){_0x49ad01[_0xa227('0x47')]=_[_0xa227('0x4a')](db[_0xa227('0x69')][_0xa227('0x43')]);_0x49ad01[_0xa227('0x49')]=_['keys'](_0x1b8b59['query']);_0x49ad01['filters']=_['intersection'](_0x49ad01['model'],_0x49ad01[_0xa227('0x49')]);_0x191773[_0xa227('0x4d')]=_[_0xa227('0x4c')](_0x49ad01[_0xa227('0x47')],qs[_0xa227('0x60')](_0x1b8b59['query'][_0xa227('0x60')]));_0x191773[_0xa227('0x4d')]=_0x191773[_0xa227('0x4d')]['length']?_0x191773[_0xa227('0x4d')]:_0x49ad01['model'];if(!_0x1b8b59[_0xa227('0x49')][_0xa227('0x6d')](_0xa227('0x4f'))){_0x191773['limit']=qs[_0xa227('0x20')](_0x1b8b59[_0xa227('0x49')]['limit']);_0x191773[_0xa227('0x21')]=qs[_0xa227('0x21')](_0x1b8b59[_0xa227('0x49')][_0xa227('0x21')]);}_0x191773['order']=qs['sort'](_0x1b8b59[_0xa227('0x49')][_0xa227('0x51')]);_0x191773[_0xa227('0x52')]=qs['filters'](_['pick'](_0x1b8b59[_0xa227('0x49')],_0x49ad01[_0xa227('0x4b')]));_0x191773[_0xa227('0x52')][_0xa227('0x68')]=_0x3bce21['id'];if(_0x1b8b59[_0xa227('0x49')][_0xa227('0x54')]){_0x191773['where']=_[_0xa227('0x55')](_0x191773[_0xa227('0x52')],{'$or':_[_0xa227('0x48')](_0x191773[_0xa227('0x4d')],function(_0x5728b7){var _0x39df57={};_0x39df57[_0x5728b7]={'$like':'%'+_0x1b8b59[_0xa227('0x49')][_0xa227('0x54')]+'%'};return _0x39df57;})});}_0x191773=_[_0xa227('0x55')]({},_0x191773,_0x1b8b59['options']);return db[_0xa227('0x69')][_0xa227('0x22')]({'where':_0x191773[_0xa227('0x52')]})[_0xa227('0x12')](function(_0x3d7f41){_0x354e00[_0xa227('0x22')]=_0x3d7f41;if(_0x1b8b59['query'][_0xa227('0x59')]){_0x191773['include']=[{'all':!![]}];}return db[_0xa227('0x69')][_0xa227('0x5b')](_0x191773);})[_0xa227('0x12')](function(_0x2202e3){_0x354e00[_0xa227('0x5c')]=_0x2202e3;return _0x354e00;});}})[_0xa227('0x12')](respondWithFilteredResult(_0x18dd21,_0x191773))[_0xa227('0x1a')](handleError(_0x18dd21,null));};exports[_0xa227('0x6e')]=function(_0x36b008,_0x1d6d5b){return db[_0xa227('0x58')]['find']({'where':{'id':_0x36b008['params']['id']}})[_0xa227('0x12')](handleEntityNotFound(_0x1d6d5b,null))[_0xa227('0x12')](function(_0x231c9a){if(_0x231c9a){return _0x231c9a[_0xa227('0x6e')](_0x36b008['query']['ids']);}})[_0xa227('0x12')](respondWithStatusCode(_0x1d6d5b,null))[_0xa227('0x1a')](handleError(_0x1d6d5b,null));};exports['addAnswer']=function(_0x24a9a2,_0x52d2fe){if(_0x24a9a2['body']['id']){delete _0x24a9a2[_0xa227('0x62')]['id'];}return db[_0xa227('0x58')]['find']({'where':{'id':_0x24a9a2[_0xa227('0x5e')]['id']}})[_0xa227('0x12')](handleEntityNotFound(_0x52d2fe,null))[_0xa227('0x12')](function(_0x141f2d){if(_0x141f2d){_0x24a9a2[_0xa227('0x62')][_0xa227('0x68')]=_0x141f2d['id'];return db[_0xa227('0x6f')][_0xa227('0x6a')](_0x24a9a2[_0xa227('0x62')]);}})['then'](respondWithResult(_0x52d2fe,null))[_0xa227('0x1a')](handleError(_0x52d2fe,null));};exports[_0xa227('0x70')]=function(_0x3daf24,_0x3d181f){var _0x6aaf57={'raw':![],'where':{}};var _0x1341ae={};var _0x5563dd={'count':0x0,'rows':[]};return db[_0xa227('0x58')][_0xa227('0x6c')]({'where':{'id':_0x3daf24[_0xa227('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3d181f,null))['then'](function(_0x3775f4){if(_0x3775f4){_0x1341ae[_0xa227('0x47')]=_[_0xa227('0x4a')](db[_0xa227('0x6f')]['rawAttributes']);_0x1341ae[_0xa227('0x49')]=_['keys'](_0x3daf24[_0xa227('0x49')]);_0x1341ae[_0xa227('0x4b')]=_[_0xa227('0x4c')](_0x1341ae[_0xa227('0x47')],_0x1341ae[_0xa227('0x49')]);_0x6aaf57[_0xa227('0x4d')]=_[_0xa227('0x4c')](_0x1341ae[_0xa227('0x47')],qs[_0xa227('0x60')](_0x3daf24[_0xa227('0x49')]['fields']));_0x6aaf57['attributes']=_0x6aaf57[_0xa227('0x4d')][_0xa227('0x4e')]?_0x6aaf57[_0xa227('0x4d')]:_0x1341ae['model'];if(!_0x3daf24['query'][_0xa227('0x6d')](_0xa227('0x4f'))){_0x6aaf57[_0xa227('0x20')]=qs[_0xa227('0x20')](_0x3daf24[_0xa227('0x49')][_0xa227('0x20')]);_0x6aaf57['offset']=qs['offset'](_0x3daf24[_0xa227('0x49')]['offset']);}_0x6aaf57[_0xa227('0x50')]=qs[_0xa227('0x51')](_0x3daf24[_0xa227('0x49')][_0xa227('0x51')]);_0x6aaf57[_0xa227('0x52')]=qs[_0xa227('0x4b')](_[_0xa227('0x53')](_0x3daf24[_0xa227('0x49')],_0x1341ae[_0xa227('0x4b')]));_0x6aaf57[_0xa227('0x52')][_0xa227('0x68')]=_0x3775f4['id'];if(_0x3daf24[_0xa227('0x49')][_0xa227('0x54')]){_0x6aaf57[_0xa227('0x52')]=_['merge'](_0x6aaf57['where'],{'$or':_['map'](_0x6aaf57['attributes'],function(_0x4db55b){var _0x67025c={};_0x67025c[_0x4db55b]={'$like':'%'+_0x3daf24[_0xa227('0x49')][_0xa227('0x54')]+'%'};return _0x67025c;})});}_0x6aaf57=_['merge']({},_0x6aaf57,_0x3daf24['options']);return db['CannedAnswer']['count']({'where':_0x6aaf57[_0xa227('0x52')]})['then'](function(_0x2a8855){_0x5563dd[_0xa227('0x22')]=_0x2a8855;if(_0x3daf24['query']['includeAll']){_0x6aaf57[_0xa227('0x5a')]=[{'all':!![]}];}return db[_0xa227('0x6f')][_0xa227('0x5b')](_0x6aaf57);})['then'](function(_0x4d1ff3){_0x5563dd[_0xa227('0x5c')]=_0x4d1ff3;return _0x5563dd;});}})[_0xa227('0x12')](respondWithFilteredResult(_0x3d181f,_0x6aaf57))[_0xa227('0x1a')](handleError(_0x3d181f,null));};exports[_0xa227('0x71')]=function(_0xf9b569,_0xa36265){return db[_0xa227('0x58')][_0xa227('0x61')]({'where':{'id':_0xf9b569[_0xa227('0x5e')]['id']}})[_0xa227('0x12')](handleEntityNotFound(_0xa36265,null))['then'](function(_0x318726){if(_0x318726){return _0x318726[_0xa227('0x71')](_0xf9b569['query'][_0xa227('0x72')]);}})['then'](respondWithStatusCode(_0xa36265,null))[_0xa227('0x1a')](handleError(_0xa36265,null));};exports[_0xa227('0x6a')]=function(_0x3d0993,_0x386ca2){var _0x26b942={'name':_0x3d0993[_0xa227('0x62')][_0xa227('0x2a')],'key':_0x3d0993[_0xa227('0x62')][_0xa227('0x46')],'provider':_0x3d0993[_0xa227('0x62')]['provider']===_0xa227('0x64')?null:_0x3d0993[_0xa227('0x62')][_0xa227('0x63')],'email':_0x3d0993[_0xa227('0x62')][_0xa227('0x73')],'ListId':_0x3d0993[_0xa227('0x62')][_0xa227('0x74')],'active':!_[_0xa227('0x75')](_0x3d0993[_0xa227('0x62')][_0xa227('0x76')])?_0x3d0993['body'][_0xa227('0x76')]:!![],'description':_0x3d0993['body']['description']||null};var _0x225a3f=getAuthenticationOptions(_0x26b942['provider'],_0x3d0993[_0xa227('0x62')]);_0x26b942[_0xa227('0x3e')]=_0x225a3f[_0xa227('0x3e')];_0x26b942[_0xa227('0x3f')]=_0x225a3f['Smtp'];return db[_0xa227('0x58')]['create'](_0x26b942,{'include':[{'model':db['MailServerOut'],'as':_0xa227('0x3f')},{'model':db['MailServerIn'],'as':_0xa227('0x3e')}]})['then'](function(_0x153803){var _0x858fcc=_0x3d0993['user']['get']({'plain':!![]});if(!_0x858fcc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x858fcc[_0xa227('0x77')]==='user'){var _0x5c47b4=_0x153803[_0xa227('0x26')]({'plain':!![]});return db[_0xa227('0x78')]['find']({'where':{'name':_0xa227('0x27'),'userProfileId':_0x858fcc[_0xa227('0x79')]},'raw':!![]})[_0xa227('0x12')](function(_0x240441){if(_0x240441&&_0x240441[_0xa227('0x7a')]===0x0){return db[_0xa227('0x28')][_0xa227('0x6a')]({'name':_0x5c47b4[_0xa227('0x2a')],'resourceId':_0x5c47b4['id'],'type':_0x240441[_0xa227('0x2a')],'sectionId':_0x240441['id']},{})[_0xa227('0x12')](function(){return _0x153803;});}else{return _0x153803;}})[_0xa227('0x1a')](function(_0x18515a){logger[_0xa227('0x17')](_0xa227('0x7b'),_0x18515a);throw _0x18515a;});}return _0x153803;})[_0xa227('0x12')](respondWithResult(_0x386ca2,0xc9))[_0xa227('0x1a')](handleError(_0x386ca2,null));};exports[_0xa227('0x7c')]=function(_0x18fa68,_0x5ef5a3){return db[_0xa227('0x58')][_0xa227('0x6c')]({'where':{'id':_0x18fa68[_0xa227('0x5e')]['id']}})[_0xa227('0x12')](handleEntityNotFound(_0x5ef5a3,null))[_0xa227('0x12')](function(_0x2f730c){if(_0x2f730c){return _0x2f730c[_0xa227('0x7c')]();}return null;})[_0xa227('0x12')](respondWithResult(_0x5ef5a3,null))[_0xa227('0x1a')](handleError(_0x5ef5a3,null));};exports['addImap']=function(_0x2ef229,_0x4205a6){if(_0x2ef229[_0xa227('0x62')]['id']){delete _0x2ef229[_0xa227('0x62')]['id'];}return db[_0xa227('0x58')][_0xa227('0x61')]({'where':{'id':_0x2ef229['params']['id']}})['then'](handleEntityNotFound(_0x4205a6,null))[_0xa227('0x12')](function(_0x3ec95b){if(_0x3ec95b){_0x2ef229[_0xa227('0x62')][_0xa227('0x68')]=_0x3ec95b['id'];return db['MailServerIn'][_0xa227('0x6a')](_0x2ef229['body']);}})[_0xa227('0x12')](respondWithResult(_0x4205a6,null))[_0xa227('0x1a')](handleError(_0x4205a6,null));};exports[_0xa227('0x7d')]=function(_0x1e299c,_0x271e95){return db[_0xa227('0x58')]['findOne']({'where':{'id':_0x1e299c[_0xa227('0x5e')]['id']}})[_0xa227('0x12')](handleEntityNotFound(_0x271e95,null))[_0xa227('0x12')](function(_0x343a85){if(_0x343a85){return _0x343a85[_0xa227('0x7e')](null);}return null;})[_0xa227('0x12')](respondWithStatusCode(_0x271e95,null))['catch'](handleError(_0x271e95,null));};exports[_0xa227('0x7f')]=function(_0x357c17,_0x4a0c2a){return db[_0xa227('0x58')][_0xa227('0x6c')]({'where':{'id':_0x357c17[_0xa227('0x5e')]['id']}})[_0xa227('0x12')](handleEntityNotFound(_0x4a0c2a,null))[_0xa227('0x12')](function(_0x24ef08){if(_0x24ef08){return _0x24ef08[_0xa227('0x7f')]();}return null;})['then'](respondWithResult(_0x4a0c2a,null))[_0xa227('0x1a')](handleError(_0x4a0c2a,null));};exports[_0xa227('0x80')]=function(_0x120488,_0x2a59fd){if(_0x120488[_0xa227('0x62')]['id']){delete _0x120488[_0xa227('0x62')]['id'];}return db['MailAccount'][_0xa227('0x61')]({'where':{'id':_0x120488['params']['id']}})['then'](handleEntityNotFound(_0x2a59fd,null))[_0xa227('0x12')](function(_0x4cf793){if(_0x4cf793){_0x120488[_0xa227('0x62')][_0xa227('0x68')]=_0x4cf793['id'];return db[_0xa227('0x41')][_0xa227('0x6a')](_0x120488['body']);}})[_0xa227('0x12')](respondWithResult(_0x2a59fd,null))[_0xa227('0x1a')](handleError(_0x2a59fd,null));};exports[_0xa227('0x81')]=function(_0x3c415f,_0x5661bc){return db[_0xa227('0x58')][_0xa227('0x6c')]({'where':{'id':_0x3c415f[_0xa227('0x5e')]['id']}})[_0xa227('0x12')](handleEntityNotFound(_0x5661bc,null))[_0xa227('0x12')](function(_0x1365ec){if(_0x1365ec){return _0x1365ec[_0xa227('0x82')](null);}return null;})[_0xa227('0x12')](respondWithStatusCode(_0x5661bc,null))[_0xa227('0x1a')](handleError(_0x5661bc,null));};exports['addInteraction']=function(_0x37fff0,_0x347d72){return db[_0xa227('0x83')]['find']({'where':{'id':_0x37fff0[_0xa227('0x5e')]['id']}})['then'](handleEntityNotFound(_0x347d72,null))[_0xa227('0x12')](function(_0x46f166){if(_0x46f166){return _0x46f166['addInteraction'](_0x37fff0[_0xa227('0x62')][_0xa227('0x72')],_[_0xa227('0x84')](_0x37fff0[_0xa227('0x62')],['ids','id'])||{});}})[_0xa227('0x12')](respondWithResult(_0x347d72,null))[_0xa227('0x1a')](handleError(_0x347d72,null));};exports[_0xa227('0x85')]=function(_0x51bcdf,_0x56dec2){var _0x1eed3e={'raw':![],'where':{}};var _0x5004f4={};var _0x849227={'count':0x0,'rows':[]};return db[_0xa227('0x58')][_0xa227('0x6c')]({'where':{'id':_0x51bcdf[_0xa227('0x5e')]['id']}})[_0xa227('0x12')](handleEntityNotFound(_0x56dec2,null))[_0xa227('0x12')](function(_0x3643e3){if(_0x3643e3){_0x5004f4['model']=_[_0xa227('0x4a')](db[_0xa227('0x83')]['rawAttributes']);_0x5004f4[_0xa227('0x49')]=_[_0xa227('0x4a')](_0x51bcdf[_0xa227('0x49')]);_0x5004f4[_0xa227('0x4b')]=_[_0xa227('0x4c')](_0x5004f4[_0xa227('0x47')],_0x5004f4[_0xa227('0x49')]);_0x1eed3e[_0xa227('0x4d')]=_[_0xa227('0x4c')](_0x5004f4['model'],qs[_0xa227('0x60')](_0x51bcdf['query'][_0xa227('0x60')]));_0x1eed3e['attributes']=_0x1eed3e['attributes']['length']?_0x1eed3e[_0xa227('0x4d')]:_0x5004f4['model'];if(!_0x51bcdf[_0xa227('0x49')][_0xa227('0x6d')](_0xa227('0x4f'))){_0x1eed3e['limit']=qs['limit'](_0x51bcdf[_0xa227('0x49')][_0xa227('0x20')]);_0x1eed3e[_0xa227('0x21')]=qs['offset'](_0x51bcdf[_0xa227('0x49')][_0xa227('0x21')]);}_0x1eed3e['order']=qs[_0xa227('0x51')](_0x51bcdf[_0xa227('0x49')][_0xa227('0x51')]);_0x1eed3e[_0xa227('0x52')]=qs[_0xa227('0x4b')](_[_0xa227('0x53')](_0x51bcdf[_0xa227('0x49')],_0x5004f4[_0xa227('0x4b')]));_0x1eed3e[_0xa227('0x52')][_0xa227('0x68')]=_0x3643e3['id'];if(_0x51bcdf[_0xa227('0x49')]['filter']){_0x1eed3e[_0xa227('0x52')]=_['merge'](_0x1eed3e[_0xa227('0x52')],{'$or':_[_0xa227('0x48')](_0x1eed3e['attributes'],function(_0x2c90fe){var _0x3fd033={};_0x3fd033[_0x2c90fe]={'$like':'%'+_0x51bcdf[_0xa227('0x49')][_0xa227('0x54')]+'%'};return _0x3fd033;})});}_0x1eed3e=_[_0xa227('0x55')]({},_0x1eed3e,_0x51bcdf[_0xa227('0x57')]);return db[_0xa227('0x83')][_0xa227('0x22')]({'where':_0x1eed3e['where']})[_0xa227('0x12')](function(_0x26c604){_0x849227[_0xa227('0x22')]=_0x26c604;if(_0x51bcdf[_0xa227('0x49')][_0xa227('0x59')]){_0x1eed3e[_0xa227('0x5a')]=[{'model':db[_0xa227('0x86')],'as':_0xa227('0x87'),'required':![]},{'model':db[_0xa227('0x88')],'as':'Owner','attributes':['name','fullname',_0xa227('0x89')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xa227('0x2a'),_0xa227('0x8a')],'where':_0x51bcdf['query'][_0xa227('0x8b')]?{'id':_0x51bcdf[_0xa227('0x49')][_0xa227('0x8b')]}:undefined,'required':_0x51bcdf['query'][_0xa227('0x8b')]?!![]:![]}];}return db['MailInteraction'][_0xa227('0x5b')](_0x1eed3e);})[_0xa227('0x12')](function(_0x2db3b9){_0x849227[_0xa227('0x5c')]=_0x2db3b9;return _0x849227;});}})[_0xa227('0x12')](respondWithFilteredResult(_0x56dec2,_0x1eed3e))[_0xa227('0x1a')](handleError(_0x56dec2,null));};exports['addApplications']=function addApplications(_0x24470c,_0x2931ca){var _0x3dae5b=_0x24470c[_0xa227('0x5e')]['id'];var _0x5df6fb=_0x24470c[_0xa227('0x62')];var _0x56fcbe=0xc8;var _0x2dc106=null;return db['sequelize'][_0xa227('0x8c')]({'isolationLevel':db[_0xa227('0x8d')][_0xa227('0x8e')]['ISOLATION_LEVELS'][_0xa227('0x8f')]},function(_0x5672d3){return db[_0xa227('0x58')][_0xa227('0x6c')]({'where':{'id':_0x3dae5b},'transaction':_0x5672d3})[_0xa227('0x12')](function(_0x17d99f){if(_0x17d99f){return db[_0xa227('0x90')][_0xa227('0x25')]({'where':{'MailAccountId':_0x3dae5b},'transaction':_0x5672d3})['then'](function(){var _0x558464=_[_0xa227('0x48')](_0x5df6fb,function(_0xadc330){_0xadc330[_0xa227('0x68')]=_0x3dae5b;return _0xadc330;});return db[_0xa227('0x90')][_0xa227('0x91')](_0x558464,{'transaction':_0x5672d3});});}else{_0x56fcbe=0x194;_0x2dc106=[];}});})['then'](function(){if(_0x56fcbe!==0x194){return db[_0xa227('0x90')][_0xa227('0x92')]({'where':{'MailAccountId':_0x3dae5b},'order':_0xa227('0x93')})[_0xa227('0x12')](function(_0x10279f){_0x2dc106=_0x10279f;});}})['catch'](function(_0x235521){_0x56fcbe=0x1f4;logger[_0xa227('0x17')](_0x235521[_0xa227('0x29')]);if(_0x235521[_0xa227('0x2a')]){delete _0x235521[_0xa227('0x2a')];}_0x2dc106=_0x235521;})[_0xa227('0x94')](function(){if(_0x2dc106===null){_0x2931ca['sendStatus'](_0x56fcbe);}else{if(_0x56fcbe===0x1f4){_0x2931ca[_0xa227('0x1d')](_0x56fcbe)[_0xa227('0x95')](_0x2dc106);}else{_0x2931ca[_0xa227('0x1d')](_0x56fcbe)['json'](_0x2dc106);}}});};exports[_0xa227('0x96')]=function(_0x5c5461,_0x53e641){var _0x139e01={};var _0x42ee5c={};var _0x374463;var _0x58eeba;return db['MailAccount'][_0xa227('0x6c')]({'where':{'id':_0x5c5461[_0xa227('0x5e')]['id']}})['then'](handleEntityNotFound(_0x53e641,null))[_0xa227('0x12')](function(_0x1df2e4){if(_0x1df2e4){_0x374463=_0x1df2e4;_0x42ee5c[_0xa227('0x47')]=_[_0xa227('0x4a')](db[_0xa227('0x90')][_0xa227('0x43')]);_0x42ee5c['query']=_[_0xa227('0x4a')](_0x5c5461[_0xa227('0x49')]);_0x42ee5c[_0xa227('0x4b')]=_[_0xa227('0x4c')](_0x42ee5c[_0xa227('0x47')],_0x42ee5c['query']);_0x139e01['attributes']=_['intersection'](_0x42ee5c[_0xa227('0x47')],qs[_0xa227('0x60')](_0x5c5461['query']['fields']));_0x139e01[_0xa227('0x4d')]=_0x139e01[_0xa227('0x4d')][_0xa227('0x4e')]?_0x139e01[_0xa227('0x4d')]:_0x42ee5c[_0xa227('0x47')];_0x139e01[_0xa227('0x50')]=qs['sort'](_0x5c5461[_0xa227('0x49')][_0xa227('0x51')]);_0x139e01[_0xa227('0x52')]=qs['filters'](_[_0xa227('0x53')](_0x5c5461[_0xa227('0x49')],_0x42ee5c['filters']));if(_0x5c5461['query'][_0xa227('0x54')]){_0x139e01['where']=_[_0xa227('0x55')](_0x139e01[_0xa227('0x52')],{'$or':_[_0xa227('0x48')](_0x139e01[_0xa227('0x4d')],function(_0x35d0bf){var _0x51100b={};_0x51100b[_0x35d0bf]={'$like':'%'+_0x5c5461[_0xa227('0x49')][_0xa227('0x54')]+'%'};return _0x51100b;})});}_0x139e01=_[_0xa227('0x55')]({},_0x139e01,_0x5c5461[_0xa227('0x57')]);return _0x374463['getApplications'](_0x139e01);}})[_0xa227('0x12')](function(_0x527bf4){if(_0x527bf4){_0x58eeba=_0x527bf4[_0xa227('0x4e')];if(!_0x5c5461[_0xa227('0x49')][_0xa227('0x6d')](_0xa227('0x4f'))){_0x139e01['limit']=qs['limit'](_0x5c5461['query'][_0xa227('0x20')]);_0x139e01[_0xa227('0x21')]=qs['offset'](_0x5c5461[_0xa227('0x49')][_0xa227('0x21')]);}return _0x374463[_0xa227('0x96')](_0x139e01);}})[_0xa227('0x12')](function(_0x562e8d){if(_0x562e8d){return _0x562e8d?{'count':_0x58eeba,'rows':_0x562e8d}:null;}})[_0xa227('0x12')](respondWithResult(_0x53e641,null))['catch'](handleError(_0x53e641,null));};exports[_0xa227('0x97')]=function(_0x546d0c,_0x5b1c9c){var _0x2335a2={'raw':!![],'where':{}};var _0x2da019={};var _0x41b438={'count':0x0,'rows':[]};return db[_0xa227('0x58')]['findOne']({'where':{'id':_0x546d0c['params']['id']}})[_0xa227('0x12')](handleEntityNotFound(_0x5b1c9c,null))[_0xa227('0x12')](function(_0x5259e8){if(_0x5259e8){_0x2da019['model']=_[_0xa227('0x4a')](db['MailMessage'][_0xa227('0x43')]);_0x2da019[_0xa227('0x49')]=_[_0xa227('0x4a')](_0x546d0c[_0xa227('0x49')]);_0x2da019[_0xa227('0x4b')]=_['intersection'](_0x2da019[_0xa227('0x47')],_0x2da019[_0xa227('0x49')]);_0x2335a2['attributes']=_[_0xa227('0x4c')](_0x2da019[_0xa227('0x47')],qs[_0xa227('0x60')](_0x546d0c[_0xa227('0x49')][_0xa227('0x60')]));_0x2335a2[_0xa227('0x4d')]=_0x2335a2['attributes'][_0xa227('0x4e')]?_0x2335a2[_0xa227('0x4d')]:_0x2da019[_0xa227('0x47')];if(!_0x546d0c[_0xa227('0x49')][_0xa227('0x6d')](_0xa227('0x4f'))){_0x2335a2[_0xa227('0x20')]=qs['limit'](_0x546d0c[_0xa227('0x49')][_0xa227('0x20')]);_0x2335a2['offset']=qs[_0xa227('0x21')](_0x546d0c[_0xa227('0x49')][_0xa227('0x21')]);}_0x2335a2[_0xa227('0x50')]=qs[_0xa227('0x51')](_0x546d0c[_0xa227('0x49')][_0xa227('0x51')]);_0x2335a2['where']=qs['filters'](_[_0xa227('0x53')](_0x546d0c[_0xa227('0x49')],_0x2da019['filters']));_0x2335a2[_0xa227('0x52')][_0xa227('0x68')]=_0x5259e8['id'];if(_0x546d0c[_0xa227('0x49')][_0xa227('0x54')]){_0x2335a2[_0xa227('0x52')]=_[_0xa227('0x55')](_0x2335a2[_0xa227('0x52')],{'$or':_[_0xa227('0x48')](_0x2335a2[_0xa227('0x4d')],function(_0x14adcd){var _0x5871d8={};_0x5871d8[_0x14adcd]={'$like':'%'+_0x546d0c[_0xa227('0x49')]['filter']+'%'};return _0x5871d8;})});}if(_0x546d0c[_0xa227('0x49')][_0xa227('0x98')]){var _0x36bfe2=_0x546d0c[_0xa227('0x49')][_0xa227('0x98')][_0xa227('0x99')](',');var _0x9abf7f={};_0x9abf7f[_0x36bfe2[0x0]]={'$gte':moment(_0x36bfe2[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2335a2['where']=_[_0xa227('0x55')](_0x2335a2[_0xa227('0x52')],_0x9abf7f);}_0x2335a2=_['merge']({},_0x2335a2,_0x546d0c['options']);return db[_0xa227('0x9a')]['count']({'where':_0x2335a2[_0xa227('0x52')]})[_0xa227('0x12')](function(_0x1592ff){_0x41b438[_0xa227('0x22')]=_0x1592ff;if(_0x546d0c['query'][_0xa227('0x59')]){_0x2335a2[_0xa227('0x5a')]=[{'all':!![]}];}return db[_0xa227('0x9a')][_0xa227('0x5b')](_0x2335a2);})['then'](function(_0x24aa3d){if(_0x546d0c[_0xa227('0x49')][_0xa227('0x9b')]===_0xa227('0x9c')){for(var _0x369991=0x0;_0x369991<_0x24aa3d[_0xa227('0x4e')];_0x369991++){_0x24aa3d[_0x369991][_0xa227('0x62')]=juice(_0x24aa3d[_0x369991]['body']);}}_0x41b438[_0xa227('0x5c')]=_0x24aa3d;return _0x41b438;});}})[_0xa227('0x12')](respondWithFilteredResult(_0x5b1c9c,_0x2335a2))[_0xa227('0x1a')](handleError(_0x5b1c9c,null));};exports['send']=function(_0x46b8d1,_0x5b72e0){var _0x5c03d1,_0xcdba9d={},_0x5879d0;if(_0x46b8d1[_0xa227('0x62')]['to']){_0x5879d0=_0x46b8d1[_0xa227('0x62')]['to'][_0xa227('0x99')](',')[0x0];}return db['MailAccount'][_0xa227('0x61')]({'where':{'id':_0x46b8d1[_0xa227('0x5e')]['id']},'include':[{'model':db[_0xa227('0x9d')],'as':_0xa227('0x9e'),'include':[{'model':db[_0xa227('0x86')],'as':_0xa227('0x9f'),'where':{'email':_0x5879d0},'limit':0x1,'order':[[_0xa227('0xa0'),'DESC']]}]},{'model':db[_0xa227('0x41')],'as':_0xa227('0x3f'),'raw':!![],'include':[{'model':db[_0xa227('0xa1')],'as':_0xa227('0xa1'),'raw':!![]}]}]})[_0xa227('0x12')](handleEntityNotFound(_0x5b72e0,null))[_0xa227('0x12')](function(_0x4de349){if(!_0x4de349)return;_0x5c03d1=_0x4de349;if(!_0x4de349[_0xa227('0x3f')])throw new Error(_0xa227('0xa2'));if(_[_0xa227('0x75')](_0x46b8d1[_0xa227('0x62')][_0xa227('0xa3')])){_0x46b8d1[_0xa227('0x62')][_0xa227('0xa3')]=util[_0xa227('0xa4')](_0xa227('0xa5'),_0x4de349[_0xa227('0x2a')],_0x4de349[_0xa227('0x73')]||_0x4de349[_0xa227('0x3f')][_0xa227('0x33')]);}if(_0x46b8d1[_0xa227('0x62')]['attachments']&&_0x46b8d1['body'][_0xa227('0xa6')][_0xa227('0x4e')]){for(var _0x118487=0x0;_0x118487<_0x46b8d1['body'][_0xa227('0xa6')]['length'];_0x118487+=0x1){_0x46b8d1[_0xa227('0x62')]['attachments'][_0x118487]={'filename':_0x46b8d1[_0xa227('0x62')][_0xa227('0xa6')][_0x118487]['name'],'path':path[_0xa227('0xa7')](config[_0xa227('0xa8')],_0xa227('0xa9'),_0x46b8d1[_0xa227('0x62')][_0xa227('0xa6')][_0x118487][_0xa227('0xaa')])};}}var _0x18784e=_0x4de349[_0xa227('0xab')]();return respondWithRpcPromise(_0xa227('0xac'),_0xa227('0xad'),{'account':_0x18784e,'message':_0x46b8d1[_0xa227('0x62')]});})[_0xa227('0x12')](function(_0x23fa7d){if(!_0x23fa7d)return;_0xcdba9d=_0x23fa7d;if(!_0x5c03d1[_0xa227('0x9e')])throw new Error(_0xa227('0xae'));if(_0x5c03d1[_0xa227('0x9e')][_0xa227('0x9f')][_0xa227('0x4e')])return _0x5c03d1[_0xa227('0x9e')][_0xa227('0x9f')][0x0];return db[_0xa227('0x86')][_0xa227('0x6a')](_[_0xa227('0xaf')](_0x46b8d1[_0xa227('0x62')],{'firstName':_0x46b8d1[_0xa227('0x62')]['to'],'email':_0x46b8d1['body']['to'],'phone':_0x46b8d1[_0xa227('0x62')]['to'],'ListId':_0x5c03d1[_0xa227('0x74')]}));})[_0xa227('0x12')](function(_0x4ac12c){if(!_0x4ac12c)return;var _0x7391c9={'UserId':_0x46b8d1['user']['id'],'ContactId':_0x4ac12c['id'],'MailAccountId':_0x5c03d1['id'],'inReplyTo':_0xcdba9d[_0xa227('0xb0')],'to':_0x46b8d1[_0xa227('0x62')][_0xa227('0xa3')],'cc':_0x46b8d1[_0xa227('0x62')]['cc'],'subject':_0x46b8d1['body']['subject'],'attach':_0x46b8d1['body'][_0xa227('0xb1')],'firstMsgDirection':_0xa227('0xb2'),'lastMsgAt':moment()['format'](_0xa227('0xb3')),'lastMsgDirection':_0xa227('0xb2'),'Messages':[_[_0xa227('0x55')](_0x46b8d1['body'],{'messageId':_0xcdba9d[_0xa227('0xb0')],'sentAt':moment()[_0xa227('0xa4')](_0xa227('0xb3')),'read':!![],'MailAccountId':_0x5c03d1['id'],'UserId':_0x46b8d1[_0xa227('0x33')]['id'],'ContactId':_0x4ac12c['id']})]};if(_0x46b8d1[_0xa227('0x62')][_0xa227('0xb4')]){_0x7391c9=_[_0xa227('0x55')](_0x7391c9,_0x46b8d1[_0xa227('0x62')][_0xa227('0xb4')]);}return db[_0xa227('0x83')][_0xa227('0x6a')](_0x7391c9,{'include':[{'model':db[_0xa227('0x9a')],'as':_0xa227('0xb5')}]});})[_0xa227('0x12')](respondWithResult(_0x5b72e0,null))[_0xa227('0x1a')](handleError(_0x5b72e0,null));};exports[_0xa227('0xb6')]=function(_0x5d2a7a,_0x16db62){return db[_0xa227('0x58')][_0xa227('0x61')]({'where':{'id':_0x5d2a7a[_0xa227('0x5e')]['id']},'include':[{'model':db[_0xa227('0x41')],'as':_0xa227('0x3f'),'raw':!![],'include':[{'model':db[_0xa227('0xa1')],'as':_0xa227('0xa1'),'raw':!![]}]}]})[_0xa227('0x12')](handleEntityNotFound(_0x16db62,null))[_0xa227('0x12')](function(_0xf9370e){if(!_0xf9370e[_0xa227('0x3f')])return;var _0x3be118=_0xf9370e['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp',_0xa227('0xb6'),{'account':_0x3be118});})[_0xa227('0x12')](respondWithResult(_0x16db62,null))[_0xa227('0x1a')](handleError(_0x16db62,null));};exports['destroy']=function(_0x5962bd,_0x479d51){return db[_0xa227('0x58')][_0xa227('0x61')]({'where':{'id':_0x5962bd[_0xa227('0x5e')]['id']}})['then'](handleEntityNotFound(_0x479d51,null))[_0xa227('0x12')](function(_0x35ffaa){if(_0x35ffaa&&_0x35ffaa[_0xa227('0x3c')]){throw new db[(_0xa227('0xb7'))][(_0xa227('0xb8'))](_0xa227('0xb9'));}return _0x35ffaa;})[_0xa227('0x12')](removeEntity(_0x479d51,null))[_0xa227('0x1a')](handleError(_0x479d51,null));};exports['addAgents']=function(_0xab724,_0x1aeefe){return db[_0xa227('0x58')][_0xa227('0x61')]({'where':{'id':_0xab724[_0xa227('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1aeefe,null))[_0xa227('0x12')](function(_0x110b23){if(_0x110b23){return _0x110b23['addAgents'](_0xab724[_0xa227('0x62')]['ids'],_[_0xa227('0x84')](_0xab724[_0xa227('0x62')],[_0xa227('0x72'),'id'])||{})[_0xa227('0xba')](function(_0x4fce8b){for(var _0x35877a=0x0;_0x35877a<_0xab724[_0xa227('0x62')][_0xa227('0x72')][_0xa227('0x4e')];_0x35877a+=0x1){socket[_0xa227('0xbb')](_0xa227('0xbc'),{'UserId':Number(_0xab724[_0xa227('0x62')]['ids'][_0x35877a]),'MailAccountId':Number(_0xab724[_0xa227('0x5e')]['id'])});}return _0x4fce8b;});}})['then'](respondWithResult(_0x1aeefe,null))['catch'](handleError(_0x1aeefe,null));};exports[_0xa227('0xbd')]=function(_0x2b3986,_0x335649){return db[_0xa227('0x58')][_0xa227('0x61')]({'where':{'id':_0x2b3986[_0xa227('0x5e')]['id']}})[_0xa227('0x12')](handleEntityNotFound(_0x335649,null))[_0xa227('0x12')](function(_0x18a6fc){if(_0x18a6fc){return _0x18a6fc['removeAgents'](_0x2b3986['query'][_0xa227('0x72')])['then'](function(){if(_['isArray'](_0x2b3986[_0xa227('0x49')][_0xa227('0x72')])){for(var _0x474023=0x0;_0x474023<_0x2b3986[_0xa227('0x49')][_0xa227('0x72')][_0xa227('0x4e')];_0x474023+=0x1){socket[_0xa227('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x2b3986[_0xa227('0x49')][_0xa227('0x72')][_0x474023]),'MailAccountId':Number(_0x2b3986[_0xa227('0x5e')]['id'])});}}else{socket[_0xa227('0xbb')](_0xa227('0xbe'),{'UserId':Number(_0x2b3986['query'][_0xa227('0x72')]),'MailAccountId':Number(_0x2b3986['params']['id'])});}});}})[_0xa227('0x12')](respondWithStatusCode(_0x335649,null))['catch'](handleError(_0x335649,null));};exports['getAgents']=function(_0x54aec8,_0x23a5c5){var _0x38e4f4={};var _0x3e409b={};var _0x460123;var _0x265662;return db[_0xa227('0x58')]['findOne']({'where':{'id':_0x54aec8[_0xa227('0x5e')]['id']}})[_0xa227('0x12')](handleEntityNotFound(_0x23a5c5,null))[_0xa227('0x12')](function(_0xc83dc0){if(_0xc83dc0){_0x460123=_0xc83dc0;_0x3e409b[_0xa227('0x47')]=_[_0xa227('0x4a')](db['User'][_0xa227('0x43')]);_0x3e409b['query']=_[_0xa227('0x4a')](_0x54aec8[_0xa227('0x49')]);_0x3e409b[_0xa227('0x4b')]=_['intersection'](_0x3e409b['model'],_0x3e409b[_0xa227('0x49')]);_0x38e4f4[_0xa227('0x4d')]=_[_0xa227('0x4c')](_0x3e409b[_0xa227('0x47')],qs[_0xa227('0x60')](_0x54aec8[_0xa227('0x49')][_0xa227('0x60')]));_0x38e4f4[_0xa227('0x4d')]=_0x38e4f4[_0xa227('0x4d')][_0xa227('0x4e')]?_0x38e4f4[_0xa227('0x4d')]:_0x3e409b[_0xa227('0x47')];_0x38e4f4[_0xa227('0x50')]=qs[_0xa227('0x51')](_0x54aec8['query'][_0xa227('0x51')]);_0x38e4f4[_0xa227('0x52')]=qs[_0xa227('0x4b')](_['pick'](_0x54aec8[_0xa227('0x49')],_0x3e409b[_0xa227('0x4b')]));if(_0x54aec8['query'][_0xa227('0x54')]){_0x38e4f4[_0xa227('0x52')]=_['merge'](_0x38e4f4[_0xa227('0x52')],{'$or':_[_0xa227('0x48')](_0x38e4f4['attributes'],function(_0x5d5adc){var _0x4476f2={};_0x4476f2[_0x5d5adc]={'$like':'%'+_0x54aec8['query']['filter']+'%'};return _0x4476f2;})});}_0x38e4f4=_['merge']({},_0x38e4f4,_0x54aec8[_0xa227('0x57')]);return _0x460123['getAgents'](_0x38e4f4);}})['then'](function(_0x2297fc){if(_0x2297fc){_0x265662=_0x2297fc['length'];if(!_0x54aec8['query']['hasOwnProperty'](_0xa227('0x4f'))){_0x38e4f4[_0xa227('0x20')]=qs[_0xa227('0x20')](_0x54aec8[_0xa227('0x49')][_0xa227('0x20')]);_0x38e4f4[_0xa227('0x21')]=qs[_0xa227('0x21')](_0x54aec8[_0xa227('0x49')][_0xa227('0x21')]);}return _0x460123['getAgents'](_0x38e4f4);}})[_0xa227('0x12')](function(_0x169250){if(_0x169250){return _0x169250?{'count':_0x265662,'rows':_0x169250}:null;}})[_0xa227('0x12')](respondWithResult(_0x23a5c5,null))[_0xa227('0x1a')](handleError(_0x23a5c5,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 465affd..812171f 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 _0x5324=['update','emit','hasOwnProperty','hook','events','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x170c68,_0xed27db){var _0x299b81=function(_0x339602){while(--_0x339602){_0x170c68['push'](_0x170c68['shift']());}};_0x299b81(++_0xed27db);}(_0x5324,0x154));var _0x4532=function(_0x504b15,_0x140137){_0x504b15=_0x504b15-0x0;var _0x67817d=_0x5324[_0x504b15];return _0x67817d;};'use strict';var EventEmitter=require(_0x4532('0x0'));var MailAccount=require(_0x4532('0x1'))['db'][_0x4532('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x4532('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4532('0x4'),'afterDestroy':'remove'};function emitEvent(_0x41b813){return function(_0x2752ef,_0x22f0cc,_0x16b937){MailAccountEvents[_0x4532('0x5')](_0x41b813+':'+_0x2752ef['id'],_0x2752ef);MailAccountEvents[_0x4532('0x5')](_0x41b813,_0x2752ef);_0x16b937(null);};}for(var e in events){if(events[_0x4532('0x6')](e)){var event=events[e];MailAccount[_0x4532('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0xee9c=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','../../mysqldb','MailAccount'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xee9c,0x1e6));var _0xcee9=function(_0x2bfe52,_0x43946e){_0x2bfe52=_0x2bfe52-0x0;var _0x1cf649=_0xee9c[_0x2bfe52];return _0x1cf649;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xcee9('0x0'))['db'][_0xcee9('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xcee9('0x2')](0x0);var events={'afterCreate':_0xcee9('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5e56ca){return function(_0x192063,_0x54d95f,_0x4cf614){MailAccountEvents[_0xcee9('0x4')](_0x5e56ca+':'+_0x192063['id'],_0x192063);MailAccountEvents['emit'](_0x5e56ca,_0x192063);_0x4cf614(null);};}for(var e in events){if(events[_0xcee9('0x5')](e)){var event=events[e];MailAccount[_0xcee9('0x6')](e,emitEvent(event));}}module[_0xcee9('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 78b8afd..3b1dcc3 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 _0xa511=['host','secure','Smtp','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','data5','user','MailAccount','mail_accounts','provider','custom','service'];(function(_0x225896,_0x2375e6){var _0xc9e16b=function(_0x4b9071){while(--_0x4b9071){_0x225896['push'](_0x225896['shift']());}};_0xc9e16b(++_0x2375e6);}(_0xa511,0x1ae));var _0x1a51=function(_0x51669d,_0x120c0a){_0x51669d=_0x51669d-0x0;var _0x5aac23=_0xa511[_0x51669d];return _0x5aac23;};'use strict';var attributes=require('./mailAccount.attributes');module['exports']=function(_0x3d9ee4){return _0x3d9ee4['define'](_0x1a51('0x0'),attributes,{'tableName':_0x1a51('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3beb13=this;var _0x57adb6={'id':_0x3beb13['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3beb13[_0x1a51('0x2')]!==_0x1a51('0x3')){_0x57adb6[_0x1a51('0x4')]=_0x3beb13[_0x1a51('0x2')];}else{_0x57adb6[_0x1a51('0x5')]=_0x3beb13['Smtp'][_0x1a51('0x5')];_0x57adb6['port']=_0x3beb13['Smtp']['port'];_0x57adb6[_0x1a51('0x6')]=_0x3beb13[_0x1a51('0x7')][_0x1a51('0x6')];}if(_0x3beb13[_0x1a51('0x7')][_0x1a51('0x8')]){if(_0x3beb13[_0x1a51('0x7')]['modernAuthentication']){if(!_0x3beb13[_0x1a51('0x7')][_0x1a51('0x9')])throw new Error(_0x1a51('0xa'));_0x57adb6[_0x1a51('0xb')]={'type':_0x1a51('0xc'),'user':_0x3beb13[_0x1a51('0x7')]['user'],'accessToken':_0x3beb13[_0x1a51('0x7')][_0x1a51('0x9')][_0x1a51('0xd')]};}else{_0x57adb6[_0x1a51('0xb')]={'user':_0x3beb13[_0x1a51('0x7')][_0x1a51('0xe')],'pass':_0x3beb13[_0x1a51('0x7')]['pass']};}}return _0x57adb6;}}});}; \ No newline at end of file +var _0x3b92=['data5','pass','./mailAccount.attributes','define','custom','service','provider','host','Smtp','port','secure','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user'];(function(_0xc84e3,_0xd631b){var _0x437a90=function(_0x584223){while(--_0x584223){_0xc84e3['push'](_0xc84e3['shift']());}};_0x437a90(++_0xd631b);}(_0x3b92,0x19a));var _0x23b9=function(_0x45ffc0,_0x4f090b){_0x45ffc0=_0x45ffc0-0x0;var _0x1f0074=_0x3b92[_0x45ffc0];return _0x1f0074;};'use strict';var attributes=require(_0x23b9('0x0'));module['exports']=function(_0x127ec3){return _0x127ec3[_0x23b9('0x1')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2610dd=this;var _0x4f868e={'id':_0x2610dd['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2610dd['provider']!==_0x23b9('0x2')){_0x4f868e[_0x23b9('0x3')]=_0x2610dd[_0x23b9('0x4')];}else{_0x4f868e[_0x23b9('0x5')]=_0x2610dd[_0x23b9('0x6')][_0x23b9('0x5')];_0x4f868e[_0x23b9('0x7')]=_0x2610dd[_0x23b9('0x6')][_0x23b9('0x7')];_0x4f868e[_0x23b9('0x8')]=_0x2610dd['Smtp'][_0x23b9('0x8')];}if(_0x2610dd[_0x23b9('0x6')][_0x23b9('0x9')]){if(_0x2610dd[_0x23b9('0x6')]['modernAuthentication']){if(!_0x2610dd['Smtp'][_0x23b9('0xa')])throw new Error(_0x23b9('0xb'));_0x4f868e[_0x23b9('0xc')]={'type':_0x23b9('0xd'),'user':_0x2610dd[_0x23b9('0x6')][_0x23b9('0xe')],'accessToken':_0x2610dd[_0x23b9('0x6')][_0x23b9('0xa')][_0x23b9('0xf')]};}else{_0x4f868e[_0x23b9('0xc')]={'user':_0x2610dd[_0x23b9('0x6')]['user'],'pass':_0x2610dd[_0x23b9('0x6')][_0x23b9('0x10')]};}}return _0x4f868e;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index a5e727b..d86a80c 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 _0x5fab=['DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','omit','smtpOptions','getSmtpOptions','applications','orderBy','priority','push','length','close','autoclose','*,*,*,*','defaults','ListId','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','spread','interaction','get','created','create','attachments','originTo','originCc','bcc','originChannel','Email','Attachment','Attachments','UserId','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','findAll','options','attributes','limit','include','model','map','ShowMailAccount','find','where','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','account','CmList','List','Contacts','updatedAt'];(function(_0x2d9535,_0x4bc592){var _0xb4e710=function(_0x50b9a9){while(--_0x50b9a9){_0x2d9535['push'](_0x2d9535['shift']());}};_0xb4e710(++_0x4bc592);}(_0x5fab,0x177));var _0xb5fa=function(_0x103ff9,_0x576a4d){_0x103ff9=_0x103ff9-0x0;var _0x40693e=_0x5fab[_0x103ff9];return _0x40693e;};'use strict';var _=require(_0xb5fa('0x0'));var moment=require(_0xb5fa('0x1'));var BPromise=require('bluebird');var rs=require(_0xb5fa('0x2'));var Redis=require(_0xb5fa('0x3'));var db=require(_0xb5fa('0x4'))['db'];var logger=require(_0xb5fa('0x5'))(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var jayson=require(_0xb5fa('0x8'));var client=jayson[_0xb5fa('0x9')][_0xb5fa('0xa')]({'port':0x232c});config[_0xb5fa('0xb')]=_['defaults'](config['redis'],{'host':_0xb5fa('0xc'),'port':0x18eb});var socket=require(_0xb5fa('0xd'))(new Redis(config[_0xb5fa('0xb')]));require('./mailAccount.socket')[_0xb5fa('0xe')](socket);function respondWithRpcPromise(_0x38d9a3,_0x2cf4a5,_0x54c7eb){return new BPromise(function(_0x5b5ea8,_0x3a8e1b){return client[_0xb5fa('0xf')](_0x38d9a3,_0x54c7eb)[_0xb5fa('0x10')](function(_0x44e6c8){logger[_0xb5fa('0x11')](_0xb5fa('0x12'),_0x2cf4a5,_0xb5fa('0x13'));logger[_0xb5fa('0x14')](_0xb5fa('0x15'),_0x2cf4a5,'request\x20sent',JSON[_0xb5fa('0x16')](_0x44e6c8));if(_0x44e6c8[_0xb5fa('0x17')]){if(_0x44e6c8['error'][_0xb5fa('0x18')]===0x1f4){logger['error'](_0xb5fa('0x12'),_0x2cf4a5,_0x44e6c8[_0xb5fa('0x17')][_0xb5fa('0x19')]);return _0x3a8e1b(_0x44e6c8[_0xb5fa('0x17')][_0xb5fa('0x19')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x2cf4a5,_0x44e6c8[_0xb5fa('0x17')][_0xb5fa('0x19')]);return _0x5b5ea8(_0x44e6c8[_0xb5fa('0x17')][_0xb5fa('0x19')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x2cf4a5,_0xb5fa('0x13'));_0x5b5ea8(_0x44e6c8[_0xb5fa('0x1a')][_0xb5fa('0x19')]);}})[_0xb5fa('0x1b')](function(_0x324ba5){logger[_0xb5fa('0x17')](_0xb5fa('0x12'),_0x2cf4a5,_0x324ba5);_0x3a8e1b(_0x324ba5);});});}exports[_0xb5fa('0x1c')]=function(_0xc14dc4){var _0x368cb1=this;return new Promise(function(_0x3c8d53,_0x1f5064){return db['MailAccount'][_0xb5fa('0x1d')]({'raw':_0xc14dc4['options']?_0xc14dc4[_0xb5fa('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xc14dc4[_0xb5fa('0x1e')]?_0xc14dc4[_0xb5fa('0x1e')]['where']||null:null,'attributes':_0xc14dc4[_0xb5fa('0x1e')]?_0xc14dc4[_0xb5fa('0x1e')][_0xb5fa('0x1f')]||null:null,'limit':_0xc14dc4['options']?_0xc14dc4[_0xb5fa('0x1e')][_0xb5fa('0x20')]||null:null,'include':_0xc14dc4[_0xb5fa('0x1e')]?_0xc14dc4['options'][_0xb5fa('0x21')]?_['map'](_0xc14dc4[_0xb5fa('0x1e')][_0xb5fa('0x21')],function(_0x11053a){return{'model':db[_0x11053a[_0xb5fa('0x22')]],'as':_0x11053a['as'],'attributes':_0x11053a[_0xb5fa('0x1f')],'include':_0x11053a[_0xb5fa('0x21')]?_[_0xb5fa('0x23')](_0x11053a[_0xb5fa('0x21')],function(_0x568870){return{'model':db[_0x568870['model']],'as':_0x568870['as'],'attributes':_0x568870['attributes'],'include':_0x568870['include']?_[_0xb5fa('0x23')](_0x568870[_0xb5fa('0x21')],function(_0x12c0d4){return{'model':db[_0x12c0d4[_0xb5fa('0x22')]],'as':_0x12c0d4['as'],'attributes':_0x12c0d4[_0xb5fa('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb5fa('0x10')](function(_0x358549){logger[_0xb5fa('0x11')](_0xb5fa('0x1c'),_0xc14dc4);logger[_0xb5fa('0x14')](_0xb5fa('0x1c'),_0xc14dc4,JSON[_0xb5fa('0x16')](_0x358549));_0x3c8d53(_0x358549);})[_0xb5fa('0x1b')](function(_0x1f4380){logger[_0xb5fa('0x17')](_0xb5fa('0x1c'),_0x1f4380[_0xb5fa('0x19')],_0xc14dc4);_0x1f5064(_0x368cb1[_0xb5fa('0x17')](0x1f4,_0x1f4380[_0xb5fa('0x19')]));});});};exports[_0xb5fa('0x24')]=function(_0x291938){var _0x370d95=this;return new Promise(function(_0x10fb43,_0x25fc7c){return db['MailAccount'][_0xb5fa('0x25')]({'raw':_0x291938['options']?_0x291938['options']['raw']===undefined?!![]:![]:!![],'where':_0x291938[_0xb5fa('0x1e')]?_0x291938['options'][_0xb5fa('0x26')]||null:null,'attributes':_0x291938['options']?_0x291938['options'][_0xb5fa('0x1f')]||null:null,'include':_0x291938[_0xb5fa('0x1e')]?_0x291938['options']['include']?_[_0xb5fa('0x23')](_0x291938[_0xb5fa('0x1e')][_0xb5fa('0x21')],function(_0x560b53){return{'model':db[_0x560b53[_0xb5fa('0x22')]],'as':_0x560b53['as'],'attributes':_0x560b53[_0xb5fa('0x1f')],'include':_0x560b53['include']?_[_0xb5fa('0x23')](_0x560b53[_0xb5fa('0x21')],function(_0x204d6b){return{'model':db[_0x204d6b['model']],'as':_0x204d6b['as'],'attributes':_0x204d6b[_0xb5fa('0x1f')],'include':_0x204d6b[_0xb5fa('0x21')]?_[_0xb5fa('0x23')](_0x204d6b['include'],function(_0x117694){return{'model':db[_0x117694[_0xb5fa('0x22')]],'as':_0x117694['as'],'attributes':_0x117694[_0xb5fa('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb5fa('0x10')](function(_0x5e7770){if(_0x291938['options']['smtp']===!![])_0x5e7770['setDataValue']('smtpOptions',_0x5e7770['getSmtpOptions']());logger[_0xb5fa('0x11')]('ShowMailAccount',_0x291938);logger[_0xb5fa('0x14')](_0xb5fa('0x24'),_0x291938,JSON[_0xb5fa('0x16')](_0x5e7770));_0x10fb43(_0x5e7770);})[_0xb5fa('0x1b')](function(_0x40c1c0){logger[_0xb5fa('0x17')]('ShowMailAccount',_0x40c1c0['message'],_0x291938);_0x25fc7c(_0x370d95['error'](0x1f4,_0x40c1c0[_0xb5fa('0x19')]));});});};exports['NotifyMailAccount']=function(_0x73d425){var _0x5addd5=this;return new Promise(function(_0x58aa97,_0x3cdf63){var _0x42d331={'body':_0x73d425[_0xb5fa('0x27')],'channel':_0xb5fa('0x28')};var _0x5bc93f=_[_0xb5fa('0x29')](_[_0xb5fa('0x2a')](db[_0xb5fa('0x2b')][_0xb5fa('0x2c')]),[_0xb5fa('0x2d'),'updatedAt',_0xb5fa('0x2e'),'ListId']);var _0x233f90=![];if(_0x73d425[_0xb5fa('0x27')]['id']){delete _0x73d425[_0xb5fa('0x27')]['id'];}if(_[_0xb5fa('0x2f')](_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x30')])){return _0x3cdf63(_0x5addd5[_0xb5fa('0x17')](0x1f4,_0xb5fa('0x31')));}if(_['isNil'](_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x27')])||_0x73d425['body'][_0xb5fa('0x27')]===''){return _0x3cdf63(_0x5addd5['error'](0x1f4,_0xb5fa('0x32')));}if(_[_0xb5fa('0x2f')](_0x73d425['body']['mapKey'])){return _0x3cdf63(_0x5addd5[_0xb5fa('0x17')](0x1f4,_0xb5fa('0x33')+_0x5bc93f));}if(!_[_0xb5fa('0x34')](_0x5bc93f,_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x35')])){return _0x3cdf63(_0x5addd5[_0xb5fa('0x17')](0x1f4,_0xb5fa('0x36')+_0x5bc93f));}var _0x125a5c={};_0x125a5c[_0x73d425['body'][_0xb5fa('0x35')]]=_0x73d425[_0xb5fa('0x27')]['from'];return db[_0xb5fa('0x37')][_0xb5fa('0x25')]({'where':{'id':_0x73d425[_0xb5fa('0x38')]['id']},'include':[{'model':db[_0xb5fa('0x39')],'as':_0xb5fa('0x3a'),'include':[{'model':db[_0xb5fa('0x2b')],'as':_0xb5fa('0x3b'),'where':_0x125a5c,'limit':0x1,'order':[[_0xb5fa('0x3c'),_0xb5fa('0x3d')]]}]},{'model':db[_0xb5fa('0x3e')],'as':_0xb5fa('0x3f')},{'model':db[_0xb5fa('0x40')],'as':_0xb5fa('0x41'),'include':[{'model':db[_0xb5fa('0x42')],'as':_0xb5fa('0x42')}]}]})[_0xb5fa('0x10')](function(_0x52f5d8){if(_0x52f5d8&&_0x52f5d8['List']){var _0x46194d=_0x52f5d8['get']({'plain':!![]});_0x42d331[_0xb5fa('0x38')]=_[_0xb5fa('0x43')](_0x46194d,['Applications',_0xb5fa('0x3a')]);_0x42d331[_0xb5fa('0x38')][_0xb5fa('0x44')]=_0x52f5d8[_0xb5fa('0x45')]();_0x42d331[_0xb5fa('0x46')]=_0x46194d[_0xb5fa('0x3f')];_0x42d331['list']=_0x46194d[_0xb5fa('0x3a')];_0x42d331['applications']=_[_0xb5fa('0x47')](_0x42d331[_0xb5fa('0x46')],[_0xb5fa('0x48')],['asc']);if(_0x42d331[_0xb5fa('0x38')]&&_0x42d331[_0xb5fa('0x38')]['autoclose']){_0x42d331['applications'][_0xb5fa('0x49')]({'id':0x0,'priority':_0x42d331[_0xb5fa('0x46')][_0xb5fa('0x4a')]+0x1,'app':_0xb5fa('0x4b'),'appdata':_0xb5fa('0x4c'),'interval':_0xb5fa('0x4d')});}if(_0x42d331[_0xb5fa('0x38')][_0xb5fa('0x3f')]){delete _0x42d331[_0xb5fa('0x38')][_0xb5fa('0x3f')];}if(_0x42d331[_0xb5fa('0x38')][_0xb5fa('0x3a')]){delete _0x42d331[_0xb5fa('0x38')][_0xb5fa('0x3a')];}if(_0x46194d[_0xb5fa('0x3a')][_0xb5fa('0x3b')][_0xb5fa('0x4a')]){return _0x46194d[_0xb5fa('0x3a')]['Contacts'][0x0];}var _0x1900a5=_[_0xb5fa('0x4e')](_0x73d425[_0xb5fa('0x27')],{'firstName':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x30')],'ListId':_0x46194d[_0xb5fa('0x4f')]});_0x1900a5[_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x35')]]=_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x30')];return db['CmContact']['create'](_0x1900a5);}else{throw new Error(_0xb5fa('0x50'));}})[_0xb5fa('0x10')](function(_0x1e78cb){_0x42d331['contact']=_0x1e78cb;if(_0x1e78cb){if(!_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x51')]){_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x51')]=rs[_0xb5fa('0x52')]()+'\x20'+_0x73d425['body'][_0xb5fa('0x19')][_0xb5fa('0x30')];}var _0x4afc02={'ContactId':_0x1e78cb['id'],'MailAccountId':_0x73d425[_0xb5fa('0x38')]['id'],'inReplyTo':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x51')],'to':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x30')],'cc':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')]['cc'],'subject':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x53')],'attach':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x54')],'lastMsgAt':moment()[_0xb5fa('0x55')](_0xb5fa('0x56')),'lastMsgDirection':'in'};return db[_0xb5fa('0x57')][_0xb5fa('0x25')]({'where':{'closed':![],'MailAccountId':_0x73d425[_0xb5fa('0x38')]['id']},'include':[{'model':db[_0xb5fa('0x58')],'as':_0xb5fa('0x59'),'attributes':[_0xb5fa('0x51')],'where':{'messageId':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')]['inReplyTo']}}]})[_0xb5fa('0x10')](function(_0x34ebd0){if(_0x34ebd0){return[_0x34ebd0,![]];}return db[_0xb5fa('0x57')]['create'](_0x4afc02)[_0xb5fa('0x10')](function(_0x2d786e){return[_0x2d786e,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb5fa('0x5a')](function(_0xb535c3,_0x5c25f6){if(_0xb535c3){_0x233f90=_0x5c25f6;if(!_0x5c25f6){return _0xb535c3['update']({'inReplyTo':_0x73d425['body'][_0xb5fa('0x19')][_0xb5fa('0x51')],'to':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x30')],'cc':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')]['cc'],'subject':_0x73d425[_0xb5fa('0x27')]['message']['subject'],'attach':_0xb535c3['attach']?_0xb535c3[_0xb5fa('0x54')]:_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')]['attach'],'substatus':null,'substatusAt':moment()[_0xb5fa('0x55')](_0xb5fa('0x56')),'lastMsgAt':moment()[_0xb5fa('0x55')](_0xb5fa('0x56')),'lastMsgDirection':'in'});}else{return _0xb535c3;}}})[_0xb5fa('0x10')](function(_0x36b709){_0x42d331[_0xb5fa('0x5b')]=_0x36b709[_0xb5fa('0x5c')]({'plain':!![]});_0x42d331[_0xb5fa('0x5b')][_0xb5fa('0x5d')]=_0x233f90;return db[_0xb5fa('0x58')][_0xb5fa('0x5e')]({'body':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x27')],'MailAccountId':_0x73d425[_0xb5fa('0x38')]['id'],'MailInteractionId':_0x36b709['id'],'direction':'in','ContactId':_0x42d331['contact']['id'],'messageId':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x51')],'from':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x30')],'to':_0x73d425[_0xb5fa('0x27')]['message']['to'],'cc':_0x73d425[_0xb5fa('0x27')]['message']['cc'],'subject':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x53')],'attach':_0x73d425[_0xb5fa('0x27')]['message']['attach'],'Attachments':_0x73d425['body'][_0xb5fa('0x19')][_0xb5fa('0x5f')],'originTo':_0x73d425[_0xb5fa('0x27')][_0xb5fa('0x19')][_0xb5fa('0x60')],'originCc':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x61')],'bcc':_0x73d425['body']['message'][_0xb5fa('0x62')],'ChatWebsiteId':_0x73d425['body']['message']['ChatWebsiteId']||null,'originChannel':_0x73d425[_0xb5fa('0x27')]['message'][_0xb5fa('0x63')]||_0xb5fa('0x64'),'ChatOfflineMessageId':_0x73d425[_0xb5fa('0x27')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb5fa('0x65')],'as':_0xb5fa('0x66')}]});})['then'](function(_0x2d0c95){_0x42d331[_0xb5fa('0x19')]=_0x2d0c95;if(_0x42d331[_0xb5fa('0x5b')][_0xb5fa('0x67')]){return db['User'][_0xb5fa('0x25')]({'attributes':['id',_0xb5fa('0x68')],'where':{'id':_0x42d331[_0xb5fa('0x5b')][_0xb5fa('0x67')]}})[_0xb5fa('0x10')](function(_0x3348f7){if(_0x3348f7){_0x42d331[_0xb5fa('0x46')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb5fa('0x69'),'appdata':_0x3348f7['name']+','+(_0x42d331[_0xb5fa('0x38')][_0xb5fa('0x6a')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb5fa('0x6b'),_0xb5fa('0x6c'),_0x42d331);});}return respondWithRpcPromise(_0xb5fa('0x6b'),_0xb5fa('0x6c'),_0x42d331);})[_0xb5fa('0x10')](function(_0x8ce5b8){_0x58aa97(_0x8ce5b8);})[_0xb5fa('0x1b')](function(_0x1bac54){_0x3cdf63(_0x5addd5['error'](0x1f4,_0x1bac54[_0xb5fa('0x19')]));});});}; \ No newline at end of file +var _0x66fa=['ShowMailAccount','smtp','getSmtpOptions','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','Applications','MailServerOut','Smtp','List','get','omit','smtpOptions','applications','list','orderBy','priority','asc','autoclose','push','close','*,*,*,*','create','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','attach','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','map','model','catch'];(function(_0x1ae172,_0x42d633){var _0x31c160=function(_0x38310d){while(--_0x38310d){_0x1ae172['push'](_0x1ae172['shift']());}};_0x31c160(++_0x42d633);}(_0x66fa,0x117));var _0xa66f=function(_0x58e872,_0x138bdf){_0x58e872=_0x58e872-0x0;var _0x3f51fc=_0x66fa[_0x58e872];return _0x3f51fc;};'use strict';var _=require(_0xa66f('0x0'));var moment=require(_0xa66f('0x1'));var BPromise=require('bluebird');var rs=require(_0xa66f('0x2'));var Redis=require(_0xa66f('0x3'));var db=require(_0xa66f('0x4'))['db'];var logger=require(_0xa66f('0x5'))(_0xa66f('0x6'));var config=require(_0xa66f('0x7'));var jayson=require(_0xa66f('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0xa66f('0x9')]=_[_0xa66f('0xa')](config[_0xa66f('0x9')],{'host':_0xa66f('0xb'),'port':0x18eb});var socket=require(_0xa66f('0xc'))(new Redis(config['redis']));require(_0xa66f('0xd'))['register'](socket);function respondWithRpcPromise(_0x46c788,_0x597c7c,_0x101e10){return new BPromise(function(_0x53ca76,_0x52d802){return client['request'](_0x46c788,_0x101e10)[_0xa66f('0xe')](function(_0x825868){logger['info'](_0xa66f('0xf'),_0x597c7c,'request\x20sent');logger[_0xa66f('0x10')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x597c7c,_0xa66f('0x11'),JSON[_0xa66f('0x12')](_0x825868));if(_0x825868[_0xa66f('0x13')]){if(_0x825868['error']['code']===0x1f4){logger[_0xa66f('0x13')]('MailAccount,\x20%s,\x20%s',_0x597c7c,_0x825868['error']['message']);return _0x52d802(_0x825868[_0xa66f('0x13')][_0xa66f('0x14')]);}logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x597c7c,_0x825868[_0xa66f('0x13')]['message']);return _0x53ca76(_0x825868['error'][_0xa66f('0x14')]);}else{logger[_0xa66f('0x15')](_0xa66f('0xf'),_0x597c7c,_0xa66f('0x11'));_0x53ca76(_0x825868['result'][_0xa66f('0x14')]);}})['catch'](function(_0x4a28d4){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x597c7c,_0x4a28d4);_0x52d802(_0x4a28d4);});});}exports[_0xa66f('0x16')]=function(_0x355ddc){var _0x2c5b76=this;return new Promise(function(_0x408bc7,_0x251f60){return db[_0xa66f('0x17')][_0xa66f('0x18')]({'raw':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1a')]===undefined?!![]:![]:!![],'where':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1b')]||null:null,'attributes':_0x355ddc['options']?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1c')]||null:null,'limit':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')]['limit']||null:null,'include':_0x355ddc[_0xa66f('0x19')]?_0x355ddc[_0xa66f('0x19')][_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x355ddc['options']['include'],function(_0xed98b9){return{'model':db[_0xed98b9['model']],'as':_0xed98b9['as'],'attributes':_0xed98b9[_0xa66f('0x1c')],'include':_0xed98b9[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0xed98b9['include'],function(_0x4683c7){return{'model':db[_0x4683c7[_0xa66f('0x1f')]],'as':_0x4683c7['as'],'attributes':_0x4683c7[_0xa66f('0x1c')],'include':_0x4683c7[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x4683c7[_0xa66f('0x1d')],function(_0x1eb86a){return{'model':db[_0x1eb86a[_0xa66f('0x1f')]],'as':_0x1eb86a['as'],'attributes':_0x1eb86a[_0xa66f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa66f('0xe')](function(_0x45f71c){logger[_0xa66f('0x15')](_0xa66f('0x16'),_0x355ddc);logger[_0xa66f('0x10')]('GetMailAccount',_0x355ddc,JSON['stringify'](_0x45f71c));_0x408bc7(_0x45f71c);})[_0xa66f('0x20')](function(_0x27ceae){logger['error'](_0xa66f('0x16'),_0x27ceae[_0xa66f('0x14')],_0x355ddc);_0x251f60(_0x2c5b76['error'](0x1f4,_0x27ceae[_0xa66f('0x14')]));});});};exports[_0xa66f('0x21')]=function(_0x9d78d5){var _0x2c2ace=this;return new Promise(function(_0x395623,_0x548add){return db[_0xa66f('0x17')]['find']({'raw':_0x9d78d5[_0xa66f('0x19')]?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1a')]===undefined?!![]:![]:!![],'where':_0x9d78d5['options']?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1b')]||null:null,'attributes':_0x9d78d5['options']?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1c')]||null:null,'include':_0x9d78d5[_0xa66f('0x19')]?_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x1d')],function(_0x35ef27){return{'model':db[_0x35ef27[_0xa66f('0x1f')]],'as':_0x35ef27['as'],'attributes':_0x35ef27['attributes'],'include':_0x35ef27[_0xa66f('0x1d')]?_['map'](_0x35ef27[_0xa66f('0x1d')],function(_0x46f6cc){return{'model':db[_0x46f6cc[_0xa66f('0x1f')]],'as':_0x46f6cc['as'],'attributes':_0x46f6cc[_0xa66f('0x1c')],'include':_0x46f6cc[_0xa66f('0x1d')]?_[_0xa66f('0x1e')](_0x46f6cc[_0xa66f('0x1d')],function(_0xcee582){return{'model':db[_0xcee582['model']],'as':_0xcee582['as'],'attributes':_0xcee582[_0xa66f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4477cf){if(_0x9d78d5[_0xa66f('0x19')][_0xa66f('0x22')]===!![])_0x4477cf['setDataValue']('smtpOptions',_0x4477cf[_0xa66f('0x23')]());logger[_0xa66f('0x15')](_0xa66f('0x21'),_0x9d78d5);logger[_0xa66f('0x10')](_0xa66f('0x21'),_0x9d78d5,JSON['stringify'](_0x4477cf));_0x395623(_0x4477cf);})['catch'](function(_0x49b869){logger[_0xa66f('0x13')]('ShowMailAccount',_0x49b869['message'],_0x9d78d5);_0x548add(_0x2c2ace['error'](0x1f4,_0x49b869[_0xa66f('0x14')]));});});};exports['NotifyMailAccount']=function(_0x8965d3){var _0x17d942=this;return new Promise(function(_0x23a546,_0x1647a0){var _0xd65c5d={'body':_0x8965d3[_0xa66f('0x24')],'channel':_0xa66f('0x25')};var _0x261089=_[_0xa66f('0x26')](_[_0xa66f('0x27')](db[_0xa66f('0x28')][_0xa66f('0x29')]),[_0xa66f('0x2a'),_0xa66f('0x2b'),'CompanyId',_0xa66f('0x2c')]);var _0x25c2cb=![];if(_0x8965d3['body']['id']){delete _0x8965d3[_0xa66f('0x24')]['id'];}if(_['isNil'](_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')])){return _0x1647a0(_0x17d942['error'](0x1f4,_0xa66f('0x2e')));}if(_[_0xa66f('0x2f')](_0x8965d3[_0xa66f('0x24')]['body'])||_0x8965d3[_0xa66f('0x24')]['body']===''){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x30')));}if(_[_0xa66f('0x2f')](_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')])){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x32')+_0x261089));}if(!_['includes'](_0x261089,_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')])){return _0x1647a0(_0x17d942[_0xa66f('0x13')](0x1f4,_0xa66f('0x33')+_0x261089));}var _0x374e53={};_0x374e53[_0x8965d3['body']['mapKey']]=_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')];return db[_0xa66f('0x17')][_0xa66f('0x34')]({'where':{'id':_0x8965d3[_0xa66f('0x35')]['id']},'include':[{'model':db[_0xa66f('0x36')],'as':'List','include':[{'model':db[_0xa66f('0x28')],'as':_0xa66f('0x37'),'where':_0x374e53,'limit':0x1,'order':[[_0xa66f('0x2b'),'DESC']]}]},{'model':db['MailApplication'],'as':_0xa66f('0x38')},{'model':db[_0xa66f('0x39')],'as':_0xa66f('0x3a'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})['then'](function(_0x19e7ce){if(_0x19e7ce&&_0x19e7ce[_0xa66f('0x3b')]){var _0x40d3b6=_0x19e7ce[_0xa66f('0x3c')]({'plain':!![]});_0xd65c5d[_0xa66f('0x35')]=_[_0xa66f('0x3d')](_0x40d3b6,[_0xa66f('0x38'),_0xa66f('0x3b')]);_0xd65c5d['account'][_0xa66f('0x3e')]=_0x19e7ce[_0xa66f('0x23')]();_0xd65c5d[_0xa66f('0x3f')]=_0x40d3b6[_0xa66f('0x38')];_0xd65c5d[_0xa66f('0x40')]=_0x40d3b6[_0xa66f('0x3b')];_0xd65c5d['applications']=_[_0xa66f('0x41')](_0xd65c5d[_0xa66f('0x3f')],[_0xa66f('0x42')],[_0xa66f('0x43')]);if(_0xd65c5d[_0xa66f('0x35')]&&_0xd65c5d['account'][_0xa66f('0x44')]){_0xd65c5d['applications'][_0xa66f('0x45')]({'id':0x0,'priority':_0xd65c5d['applications']['length']+0x1,'app':_0xa66f('0x46'),'appdata':_0xa66f('0x44'),'interval':_0xa66f('0x47')});}if(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x38')]){delete _0xd65c5d[_0xa66f('0x35')]['Applications'];}if(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x3b')]){delete _0xd65c5d[_0xa66f('0x35')][_0xa66f('0x3b')];}if(_0x40d3b6['List'][_0xa66f('0x37')]['length']){return _0x40d3b6[_0xa66f('0x3b')][_0xa66f('0x37')][0x0];}var _0x21482f=_[_0xa66f('0xa')](_0x8965d3[_0xa66f('0x24')],{'firstName':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')],'ListId':_0x40d3b6['ListId']});_0x21482f[_0x8965d3[_0xa66f('0x24')][_0xa66f('0x31')]]=_0x8965d3[_0xa66f('0x24')][_0xa66f('0x2d')];return db[_0xa66f('0x28')][_0xa66f('0x48')](_0x21482f);}else{throw new Error(_0xa66f('0x49'));}})[_0xa66f('0xe')](function(_0x350fce){_0xd65c5d['contact']=_0x350fce;if(_0x350fce){if(!_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4a')]){_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x4a')]=rs[_0xa66f('0x4b')]()+'\x20'+_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x2d')];}var _0x11c89e={'ContactId':_0x350fce['id'],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id'],'inReplyTo':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x4a')],'to':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x2d')],'cc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['cc'],'subject':_0x8965d3['body']['message'][_0xa66f('0x4c')],'attach':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['attach'],'lastMsgAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgDirection':'in'};return db[_0xa66f('0x4f')][_0xa66f('0x34')]({'where':{'closed':![],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id']},'include':[{'model':db[_0xa66f('0x50')],'as':_0xa66f('0x51'),'attributes':[_0xa66f('0x4a')],'where':{'messageId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x52')]}}]})[_0xa66f('0xe')](function(_0x235e4f){if(_0x235e4f){return[_0x235e4f,![]];}return db[_0xa66f('0x4f')][_0xa66f('0x48')](_0x11c89e)[_0xa66f('0xe')](function(_0x41ffa7){return[_0x41ffa7,!![]];});});}else{throw new Error(_0xa66f('0x53'));}})['spread'](function(_0x52f22d,_0x46327d){if(_0x52f22d){_0x25c2cb=_0x46327d;if(!_0x46327d){return _0x52f22d[_0xa66f('0x54')]({'inReplyTo':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x4a')],'to':_0x8965d3['body'][_0xa66f('0x14')]['from'],'cc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['cc'],'subject':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['subject'],'attach':_0x52f22d[_0xa66f('0x55')]?_0x52f22d[_0xa66f('0x55')]:_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x55')],'substatus':null,'substatusAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgAt':moment()[_0xa66f('0x4d')](_0xa66f('0x4e')),'lastMsgDirection':'in'});}else{return _0x52f22d;}}})[_0xa66f('0xe')](function(_0x290323){_0xd65c5d[_0xa66f('0x56')]=_0x290323['get']({'plain':!![]});_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x57')]=_0x25c2cb;return db[_0xa66f('0x50')][_0xa66f('0x48')]({'body':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x24')],'MailAccountId':_0x8965d3[_0xa66f('0x35')]['id'],'MailInteractionId':_0x290323['id'],'direction':'in','ContactId':_0xd65c5d[_0xa66f('0x58')]['id'],'messageId':_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4a')],'from':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x2d')],'to':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')]['to'],'cc':_0x8965d3[_0xa66f('0x24')]['message']['cc'],'subject':_0x8965d3['body'][_0xa66f('0x14')][_0xa66f('0x4c')],'attach':_0x8965d3[_0xa66f('0x24')]['message']['attach'],'Attachments':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x59')],'originTo':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5a')],'originCc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x5b')],'bcc':_0x8965d3[_0xa66f('0x24')][_0xa66f('0x14')][_0xa66f('0x5c')],'ChatWebsiteId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5d')]||null,'originChannel':_0x8965d3[_0xa66f('0x24')]['message']['originChannel']||_0xa66f('0x5e'),'ChatOfflineMessageId':_0x8965d3[_0xa66f('0x24')]['message'][_0xa66f('0x5f')]||null},{'include':[{'model':db['Attachment'],'as':_0xa66f('0x60')}]});})['then'](function(_0x4feda0){_0xd65c5d['message']=_0x4feda0;if(_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x61')]){return db[_0xa66f('0x62')][_0xa66f('0x34')]({'attributes':['id',_0xa66f('0x63')],'where':{'id':_0xd65c5d[_0xa66f('0x56')][_0xa66f('0x61')]}})[_0xa66f('0xe')](function(_0x1ee6e0){if(_0x1ee6e0){_0xd65c5d[_0xa66f('0x3f')][_0xa66f('0x64')]({'id':0x0,'priority':0x0,'app':_0xa66f('0x65'),'appdata':_0x1ee6e0[_0xa66f('0x63')]+','+(_0xd65c5d[_0xa66f('0x35')][_0xa66f('0x66')]||0xa),'interval':_0xa66f('0x47')});}return respondWithRpcPromise('Start',_0xa66f('0x67'),_0xd65c5d);});}return respondWithRpcPromise('Start',_0xa66f('0x67'),_0xd65c5d);})['then'](function(_0xc4b32b){_0x23a546(_0xc4b32b);})[_0xa66f('0x20')](function(_0x2bb4e5){_0x1647a0(_0x17d942['error'](0x1f4,_0x2bb4e5['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index a6ed56f..cf32425 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 _0x9551=['remove','update','emit','register','length','mailAccount:','./mailAccount.events'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x9551,0x11e));var _0x1955=function(_0x75267d,_0x5d286c){_0x75267d=_0x75267d-0x0;var _0x21ccec=_0x9551[_0x75267d];return _0x21ccec;};'use strict';var MailAccountEvents=require(_0x1955('0x0'));var events=['save',_0x1955('0x1'),_0x1955('0x2')];function createListener(_0x4ef1e0,_0x270907){return function(_0xbb23f6){_0x270907[_0x1955('0x3')](_0x4ef1e0,_0xbb23f6);};}function removeListener(_0x274762,_0x14b974){return function(){MailAccountEvents['removeListener'](_0x274762,_0x14b974);};}exports[_0x1955('0x4')]=function(_0x20bb95){for(var _0x5e3f9e=0x0,_0xd58a63=events[_0x1955('0x5')];_0x5e3f9e<_0xd58a63;_0x5e3f9e++){var _0x24c4a2=events[_0x5e3f9e];var _0x193f3e=createListener(_0x1955('0x6')+_0x24c4a2,_0x20bb95);MailAccountEvents['on'](_0x24c4a2,_0x193f3e);}}; \ No newline at end of file +var _0xa5d1=['./mailAccount.events','save','update','emit','removeListener','length','mailAccount:'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0xa5d1,0xa1));var _0x1a5d=function(_0x1d91a3,_0x218a99){_0x1d91a3=_0x1d91a3-0x0;var _0x17be3e=_0xa5d1[_0x1d91a3];return _0x17be3e;};'use strict';var MailAccountEvents=require(_0x1a5d('0x0'));var events=[_0x1a5d('0x1'),'remove',_0x1a5d('0x2')];function createListener(_0x158987,_0x5c95b8){return function(_0x11acb9){_0x5c95b8[_0x1a5d('0x3')](_0x158987,_0x11acb9);};}function removeListener(_0x23c206,_0x158d84){return function(){MailAccountEvents[_0x1a5d('0x4')](_0x23c206,_0x158d84);};}exports['register']=function(_0x254c9a){for(var _0x2501d3=0x0,_0x2db94f=events[_0x1a5d('0x5')];_0x2501d3<_0x2db94f;_0x2501d3++){var _0x4302e1=events[_0x2501d3];var _0x45f93d=createListener(_0x1a5d('0x6')+_0x4302e1,_0x254c9a);MailAccountEvents['on'](_0x4302e1,_0x45f93d);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 3177fef..63fad92 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 _0x5d9e=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','show','put','update','delete','exports','multer','util','path'];(function(_0x5a393b,_0x12d776){var _0x229c98=function(_0x30d8e6){while(--_0x30d8e6){_0x5a393b['push'](_0x5a393b['shift']());}};_0x229c98(++_0x12d776);}(_0x5d9e,0x1ea));var _0xe5d9=function(_0x2ec577,_0x563c1c){_0x2ec577=_0x2ec577-0x0;var _0x45caa2=_0x5d9e[_0x2ec577];return _0x45caa2;};'use strict';var multer=require(_0xe5d9('0x0'));var util=require(_0xe5d9('0x1'));var path=require(_0xe5d9('0x2'));var timeout=require(_0xe5d9('0x3'));var express=require(_0xe5d9('0x4'));var router=express['Router']();var fs_extra=require(_0xe5d9('0x5'));var auth=require(_0xe5d9('0x6'));var interaction=require(_0xe5d9('0x7'));var config=require(_0xe5d9('0x8'));var controller=require(_0xe5d9('0x9'));router[_0xe5d9('0xa')]('/:id',auth[_0xe5d9('0xb')](),controller[_0xe5d9('0xc')]);router[_0xe5d9('0xd')]('/:id',auth[_0xe5d9('0xb')](),controller[_0xe5d9('0xe')]);router[_0xe5d9('0xf')]('/:id',auth[_0xe5d9('0xb')](),controller['destroy']);module[_0xe5d9('0x10')]=router; \ No newline at end of file +var _0x880d=['isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','/:id'];(function(_0x1982cc,_0x53d70f){var _0x3dd1c6=function(_0x465f88){while(--_0x465f88){_0x1982cc['push'](_0x1982cc['shift']());}};_0x3dd1c6(++_0x53d70f);}(_0x880d,0x187));var _0xd880=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0x880d[_0x55821d];return _0x58ea8a;};'use strict';var multer=require(_0xd880('0x0'));var util=require(_0xd880('0x1'));var path=require(_0xd880('0x2'));var timeout=require('connect-timeout');var express=require(_0xd880('0x3'));var router=express[_0xd880('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd880('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd880('0x6'));var controller=require('./mailApplication.controller');router[_0xd880('0x7')](_0xd880('0x8'),auth[_0xd880('0x9')](),controller[_0xd880('0xa')]);router[_0xd880('0xb')]('/:id',auth[_0xd880('0x9')](),controller[_0xd880('0xc')]);router[_0xd880('0xd')](_0xd880('0x8'),auth[_0xd880('0x9')](),controller[_0xd880('0xe')]);module[_0xd880('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 9713faf..25665a0 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 _0x87f8=['TEXT','exports','INTEGER','STRING','noop'];(function(_0x38b2d9,_0x19fd42){var _0x23a3e1=function(_0xd8192f){while(--_0xd8192f){_0x38b2d9['push'](_0x38b2d9['shift']());}};_0x23a3e1(++_0x19fd42);}(_0x87f8,0x1c3));var _0x887f=function(_0x2a3e0a,_0x2b41b0){_0x2a3e0a=_0x2a3e0a-0x0;var _0x25ad63=_0x87f8[_0x2a3e0a];return _0x25ad63;};'use strict';var Sequelize=require('sequelize');module[_0x887f('0x0')]={'priority':{'type':Sequelize[_0x887f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x887f('0x2')],'allowNull':![],'defaultValue':_0x887f('0x3')},'appdata':{'type':Sequelize[_0x887f('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x887f('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xca99=['noop','INTEGER','STRING'];(function(_0x41ab68,_0x3e806f){var _0x134b6c=function(_0x4c3a80){while(--_0x4c3a80){_0x41ab68['push'](_0x41ab68['shift']());}};_0x134b6c(++_0x3e806f);}(_0xca99,0x1ba));var _0x9ca9=function(_0x47b262,_0x45a382){_0x47b262=_0x47b262-0x0;var _0x223475=_0xca99[_0x47b262];return _0x223475;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x9ca9('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x9ca9('0x1')],'allowNull':![],'defaultValue':_0x9ca9('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9ca9('0x1')]},'interval':{'type':Sequelize[_0x9ca9('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 10fa220..5db3e5b 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xaa88[_0x13b8f3];return _0x1a6d06;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file +var _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','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'];(function(_0x1a57cb,_0x5ec459){var _0x4d59c8=function(_0x2afc92){while(--_0x2afc92){_0x1a57cb['push'](_0x1a57cb['shift']());}};_0x4d59c8(++_0x5ec459);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'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={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index bce75da..d8b459c 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 _0x9788=['../../config/environment','./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x9788,0xf4));var _0x8978=function(_0x11ca62,_0x4afa06){_0x11ca62=_0x11ca62-0x0;var _0x1e580f=_0x9788[_0x11ca62];return _0x1e580f;};'use strict';var _=require(_0x8978('0x0'));var util=require(_0x8978('0x1'));var logger=require('../../config/logger')(_0x8978('0x2'));var moment=require(_0x8978('0x3'));var BPromise=require(_0x8978('0x4'));var rp=require(_0x8978('0x5'));var fs=require('fs');var path=require(_0x8978('0x6'));var rimraf=require(_0x8978('0x7'));var config=require(_0x8978('0x8'));var attributes=require(_0x8978('0x9'));module[_0x8978('0xa')]=function(_0x41bf4b,_0x34a900){return _0x41bf4b['define'](_0x8978('0xb'),attributes,{'tableName':_0x8978('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8978('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9316=['../../config/environment','exports','define','MailApplication','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xf03d8c,_0x572404){var _0x1f6df9=function(_0x44e49c){while(--_0x44e49c){_0xf03d8c['push'](_0xf03d8c['shift']());}};_0x1f6df9(++_0x572404);}(_0x9316,0x1b1));var _0x6931=function(_0x486931,_0x1e962a){_0x486931=_0x486931-0x0;var _0x4e46f4=_0x9316[_0x486931];return _0x4e46f4;};'use strict';var _=require(_0x6931('0x0'));var util=require(_0x6931('0x1'));var logger=require(_0x6931('0x2'))(_0x6931('0x3'));var moment=require('moment');var BPromise=require(_0x6931('0x4'));var rp=require(_0x6931('0x5'));var fs=require('fs');var path=require(_0x6931('0x6'));var rimraf=require('rimraf');var config=require(_0x6931('0x7'));var attributes=require('./mailApplication.attributes');module[_0x6931('0x8')]=function(_0x21e8b6,_0x4f3aaa){return _0x21e8b6[_0x6931('0x9')](_0x6931('0xa'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 51272ed..8ab5b66 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 _0x85e9=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','MailApplication,\x20%s,\x20%s','message','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','moment'];(function(_0x25fa5c,_0x421141){var _0x1bade2=function(_0x3faf20){while(--_0x3faf20){_0x25fa5c['push'](_0x25fa5c['shift']());}};_0x1bade2(++_0x421141);}(_0x85e9,0x121));var _0x985e=function(_0x187f87,_0x4e3be5){_0x187f87=_0x187f87-0x0;var _0x279f2a=_0x85e9[_0x187f87];return _0x279f2a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x985e('0x0'));var BPromise=require(_0x985e('0x1'));var rs=require(_0x985e('0x2'));var fs=require('fs');var Redis=require(_0x985e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x985e('0x4'));var logger=require('../../config/logger')(_0x985e('0x5'));var config=require(_0x985e('0x6'));var jayson=require(_0x985e('0x7'));var client=jayson[_0x985e('0x8')][_0x985e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x200f8f,_0x3bc661,_0x35cf7a){return new BPromise(function(_0x99d085,_0x176eb1){return client[_0x985e('0xa')](_0x200f8f,_0x35cf7a)[_0x985e('0xb')](function(_0x2e3d5c){logger[_0x985e('0xc')]('MailApplication,\x20%s,\x20%s',_0x3bc661,_0x985e('0xd'));logger[_0x985e('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x3bc661,'request\x20sent',JSON[_0x985e('0xf')](_0x2e3d5c));if(_0x2e3d5c[_0x985e('0x10')]){if(_0x2e3d5c[_0x985e('0x10')]['code']===0x1f4){logger[_0x985e('0x10')](_0x985e('0x11'),_0x3bc661,_0x2e3d5c[_0x985e('0x10')]['message']);return _0x176eb1(_0x2e3d5c['error'][_0x985e('0x12')]);}logger[_0x985e('0x10')](_0x985e('0x11'),_0x3bc661,_0x2e3d5c['error'][_0x985e('0x12')]);return _0x99d085(_0x2e3d5c[_0x985e('0x10')][_0x985e('0x12')]);}else{logger[_0x985e('0xc')](_0x985e('0x11'),_0x3bc661,'request\x20sent');_0x99d085(_0x2e3d5c['result'][_0x985e('0x12')]);}})[_0x985e('0x13')](function(_0x35b3ed){logger[_0x985e('0x10')](_0x985e('0x11'),_0x3bc661,_0x35b3ed);_0x176eb1(_0x35b3ed);});});}exports[_0x985e('0x14')]=function(_0x21d9b3){var _0x55d5c6=this;return new Promise(function(_0x4b3811,_0x20d09e){return db[_0x985e('0x15')][_0x985e('0x16')](_0x21d9b3[_0x985e('0x17')],{'raw':_0x21d9b3[_0x985e('0x18')]?_0x21d9b3[_0x985e('0x18')][_0x985e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21d9b3['options']?_0x21d9b3['options'][_0x985e('0x1a')]||null:null,'attributes':_0x21d9b3[_0x985e('0x18')]?_0x21d9b3[_0x985e('0x18')][_0x985e('0x1b')]||null:null,'limit':_0x21d9b3[_0x985e('0x18')]?_0x21d9b3[_0x985e('0x18')][_0x985e('0x1c')]||null:null})[_0x985e('0xb')](function(_0x234ea1){logger[_0x985e('0xc')](_0x985e('0x14'),_0x21d9b3);logger[_0x985e('0xe')](_0x985e('0x14'),_0x21d9b3,JSON[_0x985e('0xf')](_0x234ea1));_0x4b3811(_0x234ea1);})[_0x985e('0x13')](function(_0x33c9d5){logger['error']('UpdateMailApplication',_0x33c9d5['message'],_0x21d9b3);_0x20d09e(_0x55d5c6[_0x985e('0x10')](0x1f4,_0x33c9d5[_0x985e('0x12')]));});});}; \ No newline at end of file +var _0x1d96=['error','message','result','catch','MailApplication','update','options','raw','where','attributes','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','MailApplication,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1d96,0x9c));var _0x61d9=function(_0x41f267,_0x161967){_0x41f267=_0x41f267-0x0;var _0x1cefea=_0x1d96[_0x41f267];return _0x1cefea;};'use strict';var _=require(_0x61d9('0x0'));var util=require(_0x61d9('0x1'));var moment=require(_0x61d9('0x2'));var BPromise=require('bluebird');var rs=require(_0x61d9('0x3'));var fs=require('fs');var Redis=require(_0x61d9('0x4'));var db=require(_0x61d9('0x5'))['db'];var utils=require(_0x61d9('0x6'));var logger=require(_0x61d9('0x7'))(_0x61d9('0x8'));var config=require(_0x61d9('0x9'));var jayson=require(_0x61d9('0xa'));var client=jayson['client'][_0x61d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b1399,_0x256267,_0x4efedf){return new BPromise(function(_0x5dc4cb,_0x40b7dd){return client['request'](_0x3b1399,_0x4efedf)[_0x61d9('0xc')](function(_0x1fd7fd){logger[_0x61d9('0xd')](_0x61d9('0xe'),_0x256267,'request\x20sent');logger[_0x61d9('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x256267,_0x61d9('0x10'),JSON[_0x61d9('0x11')](_0x1fd7fd));if(_0x1fd7fd[_0x61d9('0x12')]){if(_0x1fd7fd[_0x61d9('0x12')]['code']===0x1f4){logger['error'](_0x61d9('0xe'),_0x256267,_0x1fd7fd['error'][_0x61d9('0x13')]);return _0x40b7dd(_0x1fd7fd[_0x61d9('0x12')][_0x61d9('0x13')]);}logger[_0x61d9('0x12')](_0x61d9('0xe'),_0x256267,_0x1fd7fd[_0x61d9('0x12')][_0x61d9('0x13')]);return _0x5dc4cb(_0x1fd7fd['error'][_0x61d9('0x13')]);}else{logger[_0x61d9('0xd')](_0x61d9('0xe'),_0x256267,_0x61d9('0x10'));_0x5dc4cb(_0x1fd7fd[_0x61d9('0x14')][_0x61d9('0x13')]);}})[_0x61d9('0x15')](function(_0x236751){logger[_0x61d9('0x12')](_0x61d9('0xe'),_0x256267,_0x236751);_0x40b7dd(_0x236751);});});}exports['UpdateMailApplication']=function(_0x2907ee){var _0x5e41a8=this;return new Promise(function(_0x3b5271,_0x5eb067){return db[_0x61d9('0x16')][_0x61d9('0x17')](_0x2907ee['body'],{'raw':_0x2907ee['options']?_0x2907ee[_0x61d9('0x18')][_0x61d9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2907ee[_0x61d9('0x18')]?_0x2907ee[_0x61d9('0x18')][_0x61d9('0x1a')]||null:null,'attributes':_0x2907ee[_0x61d9('0x18')]?_0x2907ee[_0x61d9('0x18')][_0x61d9('0x1b')]||null:null,'limit':_0x2907ee[_0x61d9('0x18')]?_0x2907ee[_0x61d9('0x18')]['limit']||null:null})[_0x61d9('0xc')](function(_0x15b11e){logger[_0x61d9('0xd')]('UpdateMailApplication',_0x2907ee);logger[_0x61d9('0xf')](_0x61d9('0x1c'),_0x2907ee,JSON[_0x61d9('0x11')](_0x15b11e));_0x3b5271(_0x15b11e);})['catch'](function(_0x86ea6f){logger['error'](_0x61d9('0x1c'),_0x86ea6f[_0x61d9('0x13')],_0x2907ee);_0x5eb067(_0x5e41a8['error'](0x1f4,_0x86ea6f[_0x61d9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index a058b3e..2fc3ad5 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 _0xa98c=['/:id/tags','tracked','mail','mailinteraction:addtags','update','delete','/:id','mailinteraction:destroy','destroy','removeTags','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','post','create','addMessage'];(function(_0x8fd359,_0x4d0665){var _0x2b0be1=function(_0x587877){while(--_0x587877){_0x8fd359['push'](_0x8fd359['shift']());}};_0x2b0be1(++_0x4d0665);}(_0xa98c,0x14f));var _0xca98=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0xa98c[_0x5f3905];return _0x2923b1;};'use strict';var express=require(_0xca98('0x0'));var router=express[_0xca98('0x1')]();var auth=require(_0xca98('0x2'));var interaction=require(_0xca98('0x3'));var controller=require('./mailInteraction.controller');router[_0xca98('0x4')]('/',auth['isAuthenticated'](),controller[_0xca98('0x5')]);router[_0xca98('0x4')](_0xca98('0x6'),auth[_0xca98('0x7')](),controller[_0xca98('0x8')]);router[_0xca98('0x4')]('/:id',auth[_0xca98('0x7')](),controller['show']);router[_0xca98('0x4')](_0xca98('0x9'),auth[_0xca98('0x7')](),controller[_0xca98('0xa')]);router[_0xca98('0x4')](_0xca98('0xb'),auth['isAuthenticated'](),controller['download']);router[_0xca98('0xc')]('/',auth['isAuthenticated'](),controller[_0xca98('0xd')]);router[_0xca98('0xc')](_0xca98('0x9'),auth[_0xca98('0x7')](),controller[_0xca98('0xe')]);router[_0xca98('0xc')](_0xca98('0xf'),auth['isAuthenticated'](),interaction[_0xca98('0x10')](_0xca98('0x11'),_0xca98('0x12')),controller['addTags']);router['put']('/:id',auth[_0xca98('0x7')](),interaction[_0xca98('0x10')]('mail','mailinteraction:update'),controller[_0xca98('0x13')]);router[_0xca98('0x14')](_0xca98('0x15'),auth[_0xca98('0x7')](),interaction[_0xca98('0x10')](_0xca98('0x11'),_0xca98('0x16')),controller[_0xca98('0x17')]);router['delete'](_0xca98('0xf'),auth[_0xca98('0x7')](),controller[_0xca98('0x18')]);module['exports']=router; \ No newline at end of file +var _0x2608=['destroy','removeTags','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','put','mail','mailinteraction:update','update','delete','mailinteraction:destroy'];(function(_0x2bacb2,_0x5b2442){var _0x44d2c6=function(_0x99cd0d){while(--_0x99cd0d){_0x2bacb2['push'](_0x2bacb2['shift']());}};_0x44d2c6(++_0x5b2442);}(_0x2608,0x93));var _0x8260=function(_0x334914,_0x1e4340){_0x334914=_0x334914-0x0;var _0x505160=_0x2608[_0x334914];return _0x505160;};'use strict';var express=require(_0x8260('0x0'));var router=express[_0x8260('0x1')]();var auth=require(_0x8260('0x2'));var interaction=require(_0x8260('0x3'));var controller=require('./mailInteraction.controller');router[_0x8260('0x4')]('/',auth[_0x8260('0x5')](),controller['index']);router['get'](_0x8260('0x6'),auth[_0x8260('0x5')](),controller[_0x8260('0x7')]);router['get'](_0x8260('0x8'),auth['isAuthenticated'](),controller[_0x8260('0x9')]);router[_0x8260('0x4')]('/:id/messages',auth[_0x8260('0x5')](),controller[_0x8260('0xa')]);router[_0x8260('0x4')](_0x8260('0xb'),auth[_0x8260('0x5')](),controller[_0x8260('0xc')]);router[_0x8260('0xd')]('/',auth[_0x8260('0x5')](),controller[_0x8260('0xe')]);router[_0x8260('0xd')](_0x8260('0xf'),auth['isAuthenticated'](),controller[_0x8260('0x10')]);router['post'](_0x8260('0x11'),auth[_0x8260('0x5')](),interaction[_0x8260('0x12')]('mail',_0x8260('0x13')),controller[_0x8260('0x14')]);router[_0x8260('0x15')]('/:id',auth[_0x8260('0x5')](),interaction[_0x8260('0x12')](_0x8260('0x16'),_0x8260('0x17')),controller[_0x8260('0x18')]);router[_0x8260('0x19')](_0x8260('0x8'),auth['isAuthenticated'](),interaction[_0x8260('0x12')](_0x8260('0x16'),_0x8260('0x1a')),controller[_0x8260('0x1b')]);router[_0x8260('0x19')](_0x8260('0x11'),auth[_0x8260('0x5')](),controller[_0x8260('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 9a69260..df73a8f 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 _0x01f7=['STRING','long','TEXT','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x5551f3,_0x29c8b0){var _0x1bf9d6=function(_0x50ea0a){while(--_0x50ea0a){_0x5551f3['push'](_0x5551f3['shift']());}};_0x1bf9d6(++_0x29c8b0);}(_0x01f7,0x194));var _0x701f=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0x01f7[_0x597484];return _0x218e64;};'use strict';var Sequelize=require(_0x701f('0x0'));var iconv=require('iconv');module[_0x701f('0x1')]={'closed':{'type':Sequelize[_0x701f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x701f('0x3')]},'disposition':{'type':Sequelize[_0x701f('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x701f('0x4')]},'inReplyTo':{'type':Sequelize[_0x701f('0x4')](0x1fe)},'to':{'type':Sequelize[_0x701f('0x4')]},'cc':{'type':Sequelize['TEXT'](_0x701f('0x5'))},'subject':{'type':Sequelize[_0x701f('0x6')]()},'attach':{'type':Sequelize[_0x701f('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x701f('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x701f('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x701f('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x701f('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x701f('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5acd=['ENUM','out','sequelize','iconv','exports','BOOLEAN','STRING','long','DATE'];(function(_0x436370,_0x4cf155){var _0x455a4c=function(_0xc595be){while(--_0xc595be){_0x436370['push'](_0x436370['shift']());}};_0x455a4c(++_0x4cf155);}(_0x5acd,0x1f1));var _0xd5ac=function(_0x5771bb,_0x424402){_0x5771bb=_0x5771bb-0x0;var _0x384005=_0x5acd[_0x5771bb];return _0x384005;};'use strict';var Sequelize=require(_0xd5ac('0x0'));var iconv=require(_0xd5ac('0x1'));module[_0xd5ac('0x2')]={'closed':{'type':Sequelize[_0xd5ac('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd5ac('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd5ac('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xd5ac('0x4')]},'cc':{'type':Sequelize['TEXT'](_0xd5ac('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xd5ac('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xd5ac('0x6')]},'substatus':{'type':Sequelize[_0xd5ac('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xd5ac('0x6')]},'firstMsgDirection':{'type':Sequelize[_0xd5ac('0x7')]('in',_0xd5ac('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd5ac('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xd5ac('0x7')]('in',_0xd5ac('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd5ac('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 086c20b..2656d4f 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 _0x3050=['createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','util','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','stack','name','send','index','map','fieldName','type','key','getOptions','mail','user','catch','show','params','model','keys','MailInteraction','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','body','describe','addMessage','MailMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','where','MailInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','join','root','files','server','format','attachments','Attachment','Attachments','Messages','from','bcc','subject','mkdirSync','each','missing.recipient@your.company.com','decode'];(function(_0x4516ea,_0x306b91){var _0x18befd=function(_0x3ef0d1){while(--_0x3ef0d1){_0x4516ea['push'](_0x4516ea['shift']());}};_0x18befd(++_0x306b91);}(_0x3050,0x1d0));var _0x0305=function(_0x3614a1,_0xb3d34c){_0x3614a1=_0x3614a1-0x0;var _0x324954=_0x3050[_0x3614a1];return _0x324954;};'use strict';var emlformat=require(_0x0305('0x0'));var rimraf=require(_0x0305('0x1'));var zipdir=require(_0x0305('0x2'));var moment=require(_0x0305('0x3'));var BPromise=require('bluebird');var util=require(_0x0305('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x0305('0x5'));var juice=require('juice');var Redis=require(_0x0305('0x6'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0x0305('0x7'))(_0x0305('0x8'));var config=require(_0x0305('0x9'));var db=require(_0x0305('0xa'))['db'];var htmlEntities=require(_0x0305('0xb'));config[_0x0305('0xc')]=_[_0x0305('0xd')](config[_0x0305('0xc')],{'host':_0x0305('0xe'),'port':0x18eb});var socket=require(_0x0305('0xf'))(new Redis(config[_0x0305('0xc')]));require('./mailInteraction.socket')[_0x0305('0x10')](socket);function respondWithStatusCode(_0x54373e,_0x417f72){_0x417f72=_0x417f72||0xcc;return function(_0x3a7ce2){if(_0x3a7ce2){return _0x54373e['sendStatus'](_0x417f72);}return _0x54373e[_0x0305('0x11')](_0x417f72)[_0x0305('0x12')]();};}function respondWithResult(_0x474fb1,_0x59df09){_0x59df09=_0x59df09||0xc8;return function(_0x5cdde6){if(_0x5cdde6){return _0x474fb1[_0x0305('0x11')](_0x59df09)[_0x0305('0x13')](_0x5cdde6);}};}function respondWithFilteredResult(_0x490808,_0x4dfa8a){return function(_0x350d04){if(_0x350d04){var _0x326a4a=typeof _0x4dfa8a[_0x0305('0x14')]===_0x0305('0x15')&&typeof _0x4dfa8a[_0x0305('0x16')]===_0x0305('0x15');var _0x539766=_0x350d04['count'];var _0x16f497=_0x326a4a?0x0:_0x4dfa8a[_0x0305('0x14')];var _0x38e834=_0x326a4a?_0x350d04[_0x0305('0x17')]:_0x4dfa8a[_0x0305('0x14')]+_0x4dfa8a[_0x0305('0x16')];var _0x5d3d8d;if(_0x38e834>=_0x539766){_0x38e834=_0x539766;_0x5d3d8d=0xc8;}else{_0x5d3d8d=0xce;}_0x490808[_0x0305('0x11')](_0x5d3d8d);return _0x490808[_0x0305('0x18')](_0x0305('0x19'),_0x16f497+'-'+_0x38e834+'/'+_0x539766)[_0x0305('0x13')](_0x350d04);}return null;};}function saveUpdates(_0x18ae6a){return function(_0x15013b){if(_0x15013b){return _0x15013b[_0x0305('0x1a')](_0x18ae6a)[_0x0305('0x1b')](function(_0x34bb0e){return _0x34bb0e;});}return null;};}function removeEntity(_0x3b9705){return function(_0x89db3d){if(_0x89db3d){return _0x89db3d[_0x0305('0x1c')]()['then'](function(){_0x3b9705[_0x0305('0x11')](0xcc)[_0x0305('0x12')]();});}};}function handleEntityNotFound(_0x2d5e1f){return function(_0x3e89e5){if(!_0x3e89e5){_0x2d5e1f[_0x0305('0x1d')](0x194);}return _0x3e89e5;};}function handleError(_0x21cb71,_0x4694d8){_0x4694d8=_0x4694d8||0x1f4;return function(_0x56a600){logger['error'](_0x56a600[_0x0305('0x1e')]);if(_0x56a600[_0x0305('0x1f')]){delete _0x56a600[_0x0305('0x1f')];}_0x21cb71[_0x0305('0x11')](_0x4694d8)[_0x0305('0x20')](_0x56a600);};}exports[_0x0305('0x21')]=function(_0x58cf4b,_0x4d2ae6){var _0x4ce7c0={};var _0xbb5236=_[_0x0305('0x22')](db['MailInteraction']['rawAttributes'],function(_0x2f9ab2){return{'name':_0x2f9ab2[_0x0305('0x23')],'type':_0x2f9ab2[_0x0305('0x24')][_0x0305('0x25')]};});_0x4ce7c0=qs[_0x0305('0x26')](_0xbb5236,_0x58cf4b);return interaction['findAll'](_0x0305('0x27'),_0x58cf4b['query'],_0x58cf4b[_0x0305('0x28')],_0x4ce7c0,_0xbb5236)[_0x0305('0x1b')](respondWithFilteredResult(_0x4d2ae6,_0x4ce7c0))[_0x0305('0x29')](handleError(_0x4d2ae6,null));};exports[_0x0305('0x2a')]=function(_0x2019db,_0x3c1c27){var _0x3a05e7={'raw':![],'where':{'id':_0x2019db[_0x0305('0x2b')]['id']}},_0x508c18={};_0x508c18[_0x0305('0x2c')]=_[_0x0305('0x2d')](db[_0x0305('0x2e')][_0x0305('0x2f')]);_0x508c18[_0x0305('0x30')]=_[_0x0305('0x2d')](_0x2019db[_0x0305('0x30')]);_0x508c18[_0x0305('0x31')]=_[_0x0305('0x32')](_0x508c18['model'],_0x508c18['query']);_0x3a05e7['attributes']=_['intersection'](_0x508c18['model'],qs[_0x0305('0x33')](_0x2019db['query']['fields']));_0x3a05e7[_0x0305('0x34')]=_0x3a05e7[_0x0305('0x34')][_0x0305('0x35')]?_0x3a05e7[_0x0305('0x34')]:_0x508c18[_0x0305('0x2c')];if(_0x2019db[_0x0305('0x30')][_0x0305('0x36')]){_0x3a05e7[_0x0305('0x37')]=[{'all':!![]}];}_0x3a05e7=_[_0x0305('0x38')]({},_0x3a05e7,_0x2019db[_0x0305('0x39')]);return db[_0x0305('0x2e')][_0x0305('0x3a')](_0x3a05e7)[_0x0305('0x1b')](handleEntityNotFound(_0x3c1c27,null))[_0x0305('0x1b')](respondWithResult(_0x3c1c27,null))['catch'](handleError(_0x3c1c27,null));};exports[_0x0305('0x3b')]=function(_0x1427cb,_0x4cf3bd){return db['MailInteraction'][_0x0305('0x3b')](_0x1427cb['body'],{})['then'](respondWithResult(_0x4cf3bd,0xc9))[_0x0305('0x29')](handleError(_0x4cf3bd,null));};exports[_0x0305('0x1a')]=function(_0x51869b,_0xcd41ff){if(_0x51869b[_0x0305('0x3c')]['id']){delete _0x51869b[_0x0305('0x3c')]['id'];}return db[_0x0305('0x2e')][_0x0305('0x3a')]({'where':{'id':_0x51869b['params']['id']}})[_0x0305('0x1b')](handleEntityNotFound(_0xcd41ff,null))[_0x0305('0x1b')](saveUpdates(_0x51869b[_0x0305('0x3c')],null))[_0x0305('0x1b')](respondWithResult(_0xcd41ff,null))[_0x0305('0x29')](handleError(_0xcd41ff,null));};exports[_0x0305('0x1c')]=function(_0x51b435,_0x2b69cd){return db[_0x0305('0x2e')][_0x0305('0x3a')]({'where':{'id':_0x51b435[_0x0305('0x2b')]['id']}})[_0x0305('0x1b')](handleEntityNotFound(_0x2b69cd,null))[_0x0305('0x1b')](removeEntity(_0x2b69cd,null))['catch'](handleError(_0x2b69cd,null));};exports['describe']=function(_0x72e0a5,_0x40c6c6){return db[_0x0305('0x2e')][_0x0305('0x3d')]()[_0x0305('0x1b')](respondWithResult(_0x40c6c6,null))[_0x0305('0x29')](handleError(_0x40c6c6,null));};exports[_0x0305('0x3e')]=function(_0x374a9c,_0x124c82){return db[_0x0305('0x3f')][_0x0305('0x3a')]({'where':{'id':_0x374a9c[_0x0305('0x2b')]['id']}})[_0x0305('0x1b')](handleEntityNotFound(_0x124c82,null))[_0x0305('0x1b')](function(_0x5d642e){if(_0x5d642e){return _0x5d642e['addMessage'](_0x374a9c[_0x0305('0x3c')][_0x0305('0x40')],_[_0x0305('0x41')](_0x374a9c['body'],[_0x0305('0x40'),'id'])||{});}})[_0x0305('0x1b')](respondWithResult(_0x124c82,null))[_0x0305('0x29')](handleError(_0x124c82,null));};exports['getMessages']=function(_0x3f44e8,_0x106e69){var _0x387116={'raw':![],'where':{}};var _0x2ac0d1={};var _0x493610={'count':0x0,'rows':[]};return db[_0x0305('0x2e')][_0x0305('0x42')]({'where':{'id':_0x3f44e8[_0x0305('0x2b')]['id']}})['then'](handleEntityNotFound(_0x106e69,null))['then'](function(_0x470aec){if(_0x470aec){_0x2ac0d1[_0x0305('0x2c')]=_[_0x0305('0x2d')](db[_0x0305('0x3f')]['rawAttributes']);_0x2ac0d1[_0x0305('0x30')]=_[_0x0305('0x2d')](_0x3f44e8['query']);_0x2ac0d1[_0x0305('0x31')]=_[_0x0305('0x32')](_0x2ac0d1['model'],_0x2ac0d1[_0x0305('0x30')]);_0x387116[_0x0305('0x34')]=_[_0x0305('0x32')](_0x2ac0d1['model'],qs['fields'](_0x3f44e8[_0x0305('0x30')][_0x0305('0x33')]));_0x387116[_0x0305('0x34')]=_0x387116[_0x0305('0x34')][_0x0305('0x35')]?_0x387116[_0x0305('0x34')]:_0x2ac0d1[_0x0305('0x2c')];if(!_0x3f44e8['query'][_0x0305('0x43')](_0x0305('0x44'))){_0x387116['limit']=qs[_0x0305('0x16')](_0x3f44e8[_0x0305('0x30')][_0x0305('0x16')]);_0x387116[_0x0305('0x14')]=qs['offset'](_0x3f44e8['query'][_0x0305('0x14')]);}_0x387116[_0x0305('0x45')]=qs[_0x0305('0x46')](_0x3f44e8['query'][_0x0305('0x46')]);_0x387116[_0x0305('0x47')]=qs['filters'](_['pick'](_0x3f44e8[_0x0305('0x30')],_0x2ac0d1[_0x0305('0x31')]));_0x387116[_0x0305('0x47')][_0x0305('0x48')]=_0x470aec['id'];if(_0x3f44e8[_0x0305('0x30')][_0x0305('0x49')]){_0x387116[_0x0305('0x47')]=_[_0x0305('0x38')](_0x387116[_0x0305('0x47')],{'$or':_[_0x0305('0x22')](_0x387116[_0x0305('0x34')],function(_0x269c6d){var _0x26be1e={};_0x26be1e[_0x269c6d]={'$like':'%'+_0x3f44e8[_0x0305('0x30')]['filter']+'%'};return _0x26be1e;})});}if(_0x3f44e8[_0x0305('0x30')][_0x0305('0x4a')]){var _0x2b8155=_0x3f44e8[_0x0305('0x30')][_0x0305('0x4a')][_0x0305('0x4b')](',');var _0x43d705={};_0x43d705[_0x2b8155[0x0]]={'$gte':moment(_0x2b8155[0x1])['format'](_0x0305('0x4c'))};_0x387116[_0x0305('0x47')]=_[_0x0305('0x38')](_0x387116['where'],_0x43d705);}_0x387116=_[_0x0305('0x38')]({},_0x387116,_0x3f44e8[_0x0305('0x39')]);return db[_0x0305('0x3f')][_0x0305('0x17')]({'where':_0x387116['where']})[_0x0305('0x1b')](function(_0x5f21ec){_0x493610[_0x0305('0x17')]=_0x5f21ec;if(_0x3f44e8[_0x0305('0x30')]['includeAll']){_0x387116[_0x0305('0x37')]=[{'all':!![]}];}return db[_0x0305('0x3f')][_0x0305('0x4d')](_0x387116);})['then'](function(_0x1411aa){if(_0x3f44e8[_0x0305('0x30')][_0x0305('0x4e')]===_0x0305('0x4f')){for(var _0x41782a=0x0;_0x41782a<_0x1411aa[_0x0305('0x35')];_0x41782a++){_0x1411aa[_0x41782a][_0x0305('0x3c')]=juice(_0x1411aa[_0x41782a][_0x0305('0x3c')]);}}_0x493610['rows']=_0x1411aa;return _0x493610;});}})[_0x0305('0x1b')](respondWithFilteredResult(_0x106e69,_0x387116))[_0x0305('0x29')](handleError(_0x106e69,null));};exports[_0x0305('0x50')]=function(_0x4701f8,_0x55b10f){return db['MailInteraction'][_0x0305('0x3a')]({'where':{'id':_0x4701f8['params']['id']}})[_0x0305('0x1b')](handleEntityNotFound(_0x55b10f,null))['then'](function(_0x4dd8f5){if(_0x4dd8f5){return _0x4dd8f5[_0x0305('0x51')](_0x4701f8['body'][_0x0305('0x40')],_[_0x0305('0x41')](_0x4701f8['body'],['ids','id'])||{})[_0x0305('0x52')](function(){return db[_0x0305('0x53')]['findAll']({'attributes':['id',_0x0305('0x1f'),_0x0305('0x54')],'where':{'id':_0x4701f8['body'][_0x0305('0x40')]}});})[_0x0305('0x1b')](function(_0x1f6c6c){socket[_0x0305('0x55')](_0x0305('0x56'),{'id':Number(_0x4701f8[_0x0305('0x2b')]['id']),'tags':_0x1f6c6c||[]});return{'id':Number(_0x4701f8['params']['id']),'tags':_0x1f6c6c||[]};});}})[_0x0305('0x1b')](respondWithResult(_0x55b10f,null))['catch'](handleError(_0x55b10f,null));};exports[_0x0305('0x57')]=function(_0x268ecf,_0x54d98e){return db[_0x0305('0x2e')][_0x0305('0x3a')]({'where':{'id':_0x268ecf[_0x0305('0x2b')]['id']}})[_0x0305('0x1b')](handleEntityNotFound(_0x54d98e,null))['then'](function(_0x3fe358){if(_0x3fe358){return _0x3fe358[_0x0305('0x57')](_0x268ecf[_0x0305('0x30')][_0x0305('0x40')]);}})[_0x0305('0x1b')](respondWithStatusCode(_0x54d98e,null))['catch'](handleError(_0x54d98e,null));};exports[_0x0305('0x58')]=function(_0x15eae2,_0x3e3aaf){var _0x5902d5=moment()[_0x0305('0x59')]()['toString']();var _0x5ef274=path[_0x0305('0x5a')](config[_0x0305('0x5b')],'server',_0x0305('0x5c'),'tmp');var _0x4b9fd9=path[_0x0305('0x5a')](config[_0x0305('0x5b')],_0x0305('0x5d'),_0x0305('0x5c'),'attachments');var _0x46d5d8=path['join'](_0x5ef274,_0x5902d5);var _0x1fdb59=util[_0x0305('0x5e')]('transcript-%d-%s.zip',_0x15eae2[_0x0305('0x2b')]['id'],_0x5902d5);var _0x36736a=path['join'](_0x5ef274,_0x1fdb59);var _0x1e4066=[];if(_0x15eae2[_0x0305('0x30')][_0x0305('0x5f')]){_0x1e4066['push']({'model':db[_0x0305('0x60')],'as':_0x0305('0x61'),'raw':!![]});}var _0x990e3b=[{'model':db[_0x0305('0x3f')],'as':_0x0305('0x62'),'attributes':['id',_0x0305('0x3c'),_0x0305('0x63'),'to','cc',_0x0305('0x64'),_0x0305('0x65'),'createdAt'],'where':{'secret':![]},'order':qs[_0x0305('0x46')]('id'),'include':_0x1e4066}];return db[_0x0305('0x2e')][_0x0305('0x3a')]({'where':{'id':_0x15eae2[_0x0305('0x2b')]['id']},'include':_0x990e3b})[_0x0305('0x1b')](handleEntityNotFound(_0x3e3aaf,null))[_0x0305('0x1b')](function(_0x35347b){if(_0x35347b&&_0x35347b[_0x0305('0x62')]){var _0x3093f5=_0x35347b['get']({'plain':!![]});fs[_0x0305('0x66')](_0x46d5d8);return BPromise[_0x0305('0x67')](_0x3093f5['Messages'],function(_0x7a71db,_0x237016){var _0x16e7ee={'from':_0x7a71db[_0x0305('0x63')],'to':_0x7a71db['to']||_0x0305('0x68'),'subject':_0x7a71db[_0x0305('0x65')],'html':htmlEntities[_0x0305('0x69')](_0x7a71db[_0x0305('0x3c')]),'headers':{'Date':moment(_0x7a71db[_0x0305('0x6a')])['format'](_0x0305('0x6b'))},'attachments':[]};if(_0x7a71db['cc']){_0x16e7ee[_0x0305('0x6c')]['Cc']=_0x7a71db['cc'];}if(_0x7a71db[_0x0305('0x64')]){_0x16e7ee[_0x0305('0x6c')]['Bcc']=_0x7a71db['bcc'];}return new BPromise(function(_0x2fdccd,_0x1a2200){if(_0x7a71db['Attachments']){for(var _0xdbf03b=0x0;_0xdbf03b<_0x7a71db[_0x0305('0x61')][_0x0305('0x35')];_0xdbf03b++){var _0x4424f6=_0x7a71db[_0x0305('0x61')][_0xdbf03b];var _0x45d4f8=path[_0x0305('0x5a')](_0x4b9fd9,_0x4424f6['basename']);if(fs[_0x0305('0x6d')](_0x45d4f8)){_0x16e7ee[_0x0305('0x5f')]['push']({'name':_0x4424f6['name'],'contentType':_0x4424f6[_0x0305('0x24')],'data':fs[_0x0305('0x6e')](_0x45d4f8)});}}}emlformat[_0x0305('0x6f')](_0x16e7ee,function(_0x5f5c53,_0x334050){if(_0x5f5c53)return _0x1a2200(_0x5f5c53);fs['writeFileSync'](path[_0x0305('0x5a')](_0x46d5d8,util[_0x0305('0x5e')](_0x0305('0x70'),_0x237016)),_0x334050);return _0x2fdccd(_0x334050);});});})[_0x0305('0x1b')](function(){return new BPromise(function(_0x258daf,_0x25ebb5){zipdir(_0x46d5d8,{'saveTo':_0x36736a},function(_0x128e86,_0x5a5336){if(_0x128e86)return _0x25ebb5(_0x128e86);return _0x258daf(_0x5a5336);});})[_0x0305('0x1b')](function(){return new BPromise(function(_0x4f20e4,_0x4553a2){rimraf(_0x46d5d8,function(_0x48b867){if(_0x48b867)_0x4553a2(_0x48b867);return _0x4f20e4();});});})[_0x0305('0x1b')](function(){return _0x3e3aaf[_0x0305('0x58')](_0x36736a,_0x1fdb59,function(_0x42f43b){if(!_0x42f43b)fs[_0x0305('0x71')](_0x36736a);});});});}else{return _0x3e3aaf['sendStatus'](0xc8);}})[_0x0305('0x29')](handleError(_0x3e3aaf,null));}; \ No newline at end of file +var _0x4b3e=['rawAttributes','fieldName','type','key','getOptions','findAll','user','show','params','model','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','create','body','catch','find','describe','addMessage','MailMessage','ids','omit','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','addTags','setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','files','attachments','transcript-%d-%s.zip','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','get','each','missing.recipient@your.company.com','decode','headers','Bcc','readFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash','juice','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','html-entities','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','then','destroy','error','stack','name','send','index','MailInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b3e,0xbb));var _0xe4b3=function(_0x2a0350,_0x249319){_0x2a0350=_0x2a0350-0x0;var _0x425220=_0x4b3e[_0x2a0350];return _0x425220;};'use strict';var emlformat=require(_0xe4b3('0x0'));var rimraf=require(_0xe4b3('0x1'));var zipdir=require(_0xe4b3('0x2'));var moment=require(_0xe4b3('0x3'));var BPromise=require(_0xe4b3('0x4'));var util=require(_0xe4b3('0x5'));var path=require(_0xe4b3('0x6'));var fs=require('fs');var _=require(_0xe4b3('0x7'));var juice=require(_0xe4b3('0x8'));var Redis=require('ioredis');var interaction=require(_0xe4b3('0x9'));var qs=require(_0xe4b3('0xa'));var logger=require('../../config/logger')(_0xe4b3('0xb'));var config=require(_0xe4b3('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xe4b3('0xd'));config[_0xe4b3('0xe')]=_[_0xe4b3('0xf')](config['redis'],{'host':_0xe4b3('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe4b3('0xe')]));require(_0xe4b3('0x11'))[_0xe4b3('0x12')](socket);function respondWithStatusCode(_0x3800ec,_0x1288da){_0x1288da=_0x1288da||0xcc;return function(_0x5f0ab6){if(_0x5f0ab6){return _0x3800ec[_0xe4b3('0x13')](_0x1288da);}return _0x3800ec[_0xe4b3('0x14')](_0x1288da)[_0xe4b3('0x15')]();};}function respondWithResult(_0x34ceb9,_0x334384){_0x334384=_0x334384||0xc8;return function(_0x439772){if(_0x439772){return _0x34ceb9['status'](_0x334384)[_0xe4b3('0x16')](_0x439772);}};}function respondWithFilteredResult(_0x40e26f,_0x3694e3){return function(_0x54fddf){if(_0x54fddf){var _0xa293e0=typeof _0x3694e3[_0xe4b3('0x17')]==='undefined'&&typeof _0x3694e3[_0xe4b3('0x18')]===_0xe4b3('0x19');var _0x4164e9=_0x54fddf[_0xe4b3('0x1a')];var _0x3e8c2e=_0xa293e0?0x0:_0x3694e3[_0xe4b3('0x17')];var _0x1aaf8e=_0xa293e0?_0x54fddf[_0xe4b3('0x1a')]:_0x3694e3[_0xe4b3('0x17')]+_0x3694e3[_0xe4b3('0x18')];var _0x53d2f9;if(_0x1aaf8e>=_0x4164e9){_0x1aaf8e=_0x4164e9;_0x53d2f9=0xc8;}else{_0x53d2f9=0xce;}_0x40e26f['status'](_0x53d2f9);return _0x40e26f['set'](_0xe4b3('0x1b'),_0x3e8c2e+'-'+_0x1aaf8e+'/'+_0x4164e9)[_0xe4b3('0x16')](_0x54fddf);}return null;};}function saveUpdates(_0x3ea401){return function(_0x58b036){if(_0x58b036){return _0x58b036[_0xe4b3('0x1c')](_0x3ea401)[_0xe4b3('0x1d')](function(_0x2adc2b){return _0x2adc2b;});}return null;};}function removeEntity(_0x15d830){return function(_0x262826){if(_0x262826){return _0x262826[_0xe4b3('0x1e')]()[_0xe4b3('0x1d')](function(){_0x15d830['status'](0xcc)[_0xe4b3('0x15')]();});}};}function handleEntityNotFound(_0x5cbdc6){return function(_0x3ce327){if(!_0x3ce327){_0x5cbdc6[_0xe4b3('0x13')](0x194);}return _0x3ce327;};}function handleError(_0xa94ea,_0x3f6350){_0x3f6350=_0x3f6350||0x1f4;return function(_0x4b18b6){logger[_0xe4b3('0x1f')](_0x4b18b6[_0xe4b3('0x20')]);if(_0x4b18b6[_0xe4b3('0x21')]){delete _0x4b18b6[_0xe4b3('0x21')];}_0xa94ea[_0xe4b3('0x14')](_0x3f6350)[_0xe4b3('0x22')](_0x4b18b6);};}exports[_0xe4b3('0x23')]=function(_0xf41a94,_0x266374){var _0x1bf97c={};var _0x5521a7=_['map'](db[_0xe4b3('0x24')][_0xe4b3('0x25')],function(_0xc7df89){return{'name':_0xc7df89[_0xe4b3('0x26')],'type':_0xc7df89[_0xe4b3('0x27')][_0xe4b3('0x28')]};});_0x1bf97c=qs[_0xe4b3('0x29')](_0x5521a7,_0xf41a94);return interaction[_0xe4b3('0x2a')]('mail',_0xf41a94['query'],_0xf41a94[_0xe4b3('0x2b')],_0x1bf97c,_0x5521a7)[_0xe4b3('0x1d')](respondWithFilteredResult(_0x266374,_0x1bf97c))['catch'](handleError(_0x266374,null));};exports[_0xe4b3('0x2c')]=function(_0x794915,_0x281779){var _0x587774={'raw':![],'where':{'id':_0x794915[_0xe4b3('0x2d')]['id']}},_0x654607={};_0x654607[_0xe4b3('0x2e')]=_['keys'](db[_0xe4b3('0x24')][_0xe4b3('0x25')]);_0x654607[_0xe4b3('0x2f')]=_[_0xe4b3('0x30')](_0x794915[_0xe4b3('0x2f')]);_0x654607[_0xe4b3('0x31')]=_[_0xe4b3('0x32')](_0x654607[_0xe4b3('0x2e')],_0x654607[_0xe4b3('0x2f')]);_0x587774[_0xe4b3('0x33')]=_[_0xe4b3('0x32')](_0x654607[_0xe4b3('0x2e')],qs['fields'](_0x794915[_0xe4b3('0x2f')][_0xe4b3('0x34')]));_0x587774[_0xe4b3('0x33')]=_0x587774['attributes'][_0xe4b3('0x35')]?_0x587774[_0xe4b3('0x33')]:_0x654607[_0xe4b3('0x2e')];if(_0x794915['query'][_0xe4b3('0x36')]){_0x587774[_0xe4b3('0x37')]=[{'all':!![]}];}_0x587774=_[_0xe4b3('0x38')]({},_0x587774,_0x794915[_0xe4b3('0x39')]);return db[_0xe4b3('0x24')]['find'](_0x587774)[_0xe4b3('0x1d')](handleEntityNotFound(_0x281779,null))['then'](respondWithResult(_0x281779,null))['catch'](handleError(_0x281779,null));};exports[_0xe4b3('0x3a')]=function(_0xa9597f,_0x3dc17a){return db[_0xe4b3('0x24')]['create'](_0xa9597f[_0xe4b3('0x3b')],{})['then'](respondWithResult(_0x3dc17a,0xc9))[_0xe4b3('0x3c')](handleError(_0x3dc17a,null));};exports[_0xe4b3('0x1c')]=function(_0x2a9066,_0x3fd839){if(_0x2a9066[_0xe4b3('0x3b')]['id']){delete _0x2a9066[_0xe4b3('0x3b')]['id'];}return db[_0xe4b3('0x24')][_0xe4b3('0x3d')]({'where':{'id':_0x2a9066[_0xe4b3('0x2d')]['id']}})[_0xe4b3('0x1d')](handleEntityNotFound(_0x3fd839,null))[_0xe4b3('0x1d')](saveUpdates(_0x2a9066[_0xe4b3('0x3b')],null))[_0xe4b3('0x1d')](respondWithResult(_0x3fd839,null))[_0xe4b3('0x3c')](handleError(_0x3fd839,null));};exports[_0xe4b3('0x1e')]=function(_0x5958b7,_0x364475){return db[_0xe4b3('0x24')]['find']({'where':{'id':_0x5958b7[_0xe4b3('0x2d')]['id']}})['then'](handleEntityNotFound(_0x364475,null))['then'](removeEntity(_0x364475,null))['catch'](handleError(_0x364475,null));};exports['describe']=function(_0x12f89b,_0x2a91c6){return db[_0xe4b3('0x24')][_0xe4b3('0x3e')]()[_0xe4b3('0x1d')](respondWithResult(_0x2a91c6,null))['catch'](handleError(_0x2a91c6,null));};exports[_0xe4b3('0x3f')]=function(_0x3de724,_0x35da81){return db[_0xe4b3('0x40')]['find']({'where':{'id':_0x3de724['params']['id']}})[_0xe4b3('0x1d')](handleEntityNotFound(_0x35da81,null))[_0xe4b3('0x1d')](function(_0x319e38){if(_0x319e38){return _0x319e38[_0xe4b3('0x3f')](_0x3de724[_0xe4b3('0x3b')][_0xe4b3('0x41')],_[_0xe4b3('0x42')](_0x3de724['body'],[_0xe4b3('0x41'),'id'])||{});}})[_0xe4b3('0x1d')](respondWithResult(_0x35da81,null))[_0xe4b3('0x3c')](handleError(_0x35da81,null));};exports['getMessages']=function(_0x11b254,_0x426351){var _0x2e8dfe={'raw':![],'where':{}};var _0x357d9d={};var _0x45fe01={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x11b254[_0xe4b3('0x2d')]['id']}})[_0xe4b3('0x1d')](handleEntityNotFound(_0x426351,null))[_0xe4b3('0x1d')](function(_0x45d9f4){if(_0x45d9f4){_0x357d9d[_0xe4b3('0x2e')]=_[_0xe4b3('0x30')](db[_0xe4b3('0x40')]['rawAttributes']);_0x357d9d[_0xe4b3('0x2f')]=_['keys'](_0x11b254[_0xe4b3('0x2f')]);_0x357d9d['filters']=_[_0xe4b3('0x32')](_0x357d9d[_0xe4b3('0x2e')],_0x357d9d[_0xe4b3('0x2f')]);_0x2e8dfe[_0xe4b3('0x33')]=_[_0xe4b3('0x32')](_0x357d9d['model'],qs[_0xe4b3('0x34')](_0x11b254[_0xe4b3('0x2f')][_0xe4b3('0x34')]));_0x2e8dfe[_0xe4b3('0x33')]=_0x2e8dfe['attributes'][_0xe4b3('0x35')]?_0x2e8dfe['attributes']:_0x357d9d[_0xe4b3('0x2e')];if(!_0x11b254['query'][_0xe4b3('0x43')](_0xe4b3('0x44'))){_0x2e8dfe['limit']=qs['limit'](_0x11b254['query'][_0xe4b3('0x18')]);_0x2e8dfe[_0xe4b3('0x17')]=qs[_0xe4b3('0x17')](_0x11b254[_0xe4b3('0x2f')][_0xe4b3('0x17')]);}_0x2e8dfe[_0xe4b3('0x45')]=qs[_0xe4b3('0x46')](_0x11b254[_0xe4b3('0x2f')][_0xe4b3('0x46')]);_0x2e8dfe[_0xe4b3('0x47')]=qs[_0xe4b3('0x31')](_[_0xe4b3('0x48')](_0x11b254[_0xe4b3('0x2f')],_0x357d9d[_0xe4b3('0x31')]));_0x2e8dfe[_0xe4b3('0x47')]['MailInteractionId']=_0x45d9f4['id'];if(_0x11b254[_0xe4b3('0x2f')][_0xe4b3('0x49')]){_0x2e8dfe[_0xe4b3('0x47')]=_[_0xe4b3('0x38')](_0x2e8dfe['where'],{'$or':_[_0xe4b3('0x4a')](_0x2e8dfe['attributes'],function(_0xa54526){var _0x2904a6={};_0x2904a6[_0xa54526]={'$like':'%'+_0x11b254[_0xe4b3('0x2f')][_0xe4b3('0x49')]+'%'};return _0x2904a6;})});}if(_0x11b254[_0xe4b3('0x2f')][_0xe4b3('0x4b')]){var _0x219fde=_0x11b254[_0xe4b3('0x2f')][_0xe4b3('0x4b')][_0xe4b3('0x4c')](',');var _0x235f6e={};_0x235f6e[_0x219fde[0x0]]={'$gte':moment(_0x219fde[0x1])[_0xe4b3('0x4d')](_0xe4b3('0x4e'))};_0x2e8dfe[_0xe4b3('0x47')]=_['merge'](_0x2e8dfe[_0xe4b3('0x47')],_0x235f6e);}_0x2e8dfe=_[_0xe4b3('0x38')]({},_0x2e8dfe,_0x11b254[_0xe4b3('0x39')]);return db[_0xe4b3('0x40')][_0xe4b3('0x1a')]({'where':_0x2e8dfe[_0xe4b3('0x47')]})['then'](function(_0x212ef7){_0x45fe01[_0xe4b3('0x1a')]=_0x212ef7;if(_0x11b254[_0xe4b3('0x2f')][_0xe4b3('0x36')]){_0x2e8dfe['include']=[{'all':!![]}];}return db['MailMessage'][_0xe4b3('0x2a')](_0x2e8dfe);})['then'](function(_0x22ea70){if(_0x11b254[_0xe4b3('0x2f')][_0xe4b3('0x4f')]==='true'){for(var _0x406b5f=0x0;_0x406b5f<_0x22ea70['length'];_0x406b5f++){_0x22ea70[_0x406b5f][_0xe4b3('0x3b')]=juice(_0x22ea70[_0x406b5f][_0xe4b3('0x3b')]);}}_0x45fe01['rows']=_0x22ea70;return _0x45fe01;});}})['then'](respondWithFilteredResult(_0x426351,_0x2e8dfe))[_0xe4b3('0x3c')](handleError(_0x426351,null));};exports[_0xe4b3('0x50')]=function(_0x13dbac,_0x326d06){return db['MailInteraction'][_0xe4b3('0x3d')]({'where':{'id':_0x13dbac[_0xe4b3('0x2d')]['id']}})['then'](handleEntityNotFound(_0x326d06,null))['then'](function(_0x561818){if(_0x561818){return _0x561818[_0xe4b3('0x51')](_0x13dbac[_0xe4b3('0x3b')]['ids'],_['omit'](_0x13dbac['body'],['ids','id'])||{})[_0xe4b3('0x52')](function(){return db[_0xe4b3('0x53')][_0xe4b3('0x2a')]({'attributes':['id',_0xe4b3('0x21'),'color'],'where':{'id':_0x13dbac[_0xe4b3('0x3b')][_0xe4b3('0x41')]}});})['then'](function(_0xa057d0){socket[_0xe4b3('0x54')](_0xe4b3('0x55'),{'id':Number(_0x13dbac[_0xe4b3('0x2d')]['id']),'tags':_0xa057d0||[]});return{'id':Number(_0x13dbac[_0xe4b3('0x2d')]['id']),'tags':_0xa057d0||[]};});}})[_0xe4b3('0x1d')](respondWithResult(_0x326d06,null))[_0xe4b3('0x3c')](handleError(_0x326d06,null));};exports[_0xe4b3('0x56')]=function(_0x104e5d,_0x3b63e5){return db['MailInteraction'][_0xe4b3('0x3d')]({'where':{'id':_0x104e5d[_0xe4b3('0x2d')]['id']}})[_0xe4b3('0x1d')](handleEntityNotFound(_0x3b63e5,null))[_0xe4b3('0x1d')](function(_0x37a34b){if(_0x37a34b){return _0x37a34b[_0xe4b3('0x56')](_0x104e5d['query'][_0xe4b3('0x41')]);}})['then'](respondWithStatusCode(_0x3b63e5,null))[_0xe4b3('0x3c')](handleError(_0x3b63e5,null));};exports[_0xe4b3('0x57')]=function(_0x4b0ba3,_0x44f5c1){var _0x3c2d29=moment()[_0xe4b3('0x58')]()[_0xe4b3('0x59')]();var _0xbd87d1=path[_0xe4b3('0x5a')](config[_0xe4b3('0x5b')],'server',_0xe4b3('0x5c'),'tmp');var _0x9640b9=path[_0xe4b3('0x5a')](config[_0xe4b3('0x5b')],'server','files',_0xe4b3('0x5d'));var _0x20c10d=path[_0xe4b3('0x5a')](_0xbd87d1,_0x3c2d29);var _0x3a0561=util[_0xe4b3('0x4d')](_0xe4b3('0x5e'),_0x4b0ba3[_0xe4b3('0x2d')]['id'],_0x3c2d29);var _0x2f4ae7=path['join'](_0xbd87d1,_0x3a0561);var _0x4f5593=[];if(_0x4b0ba3[_0xe4b3('0x2f')][_0xe4b3('0x5d')]){_0x4f5593[_0xe4b3('0x5f')]({'model':db[_0xe4b3('0x60')],'as':_0xe4b3('0x61'),'raw':!![]});}var _0x435418=[{'model':db['MailMessage'],'as':_0xe4b3('0x62'),'attributes':['id',_0xe4b3('0x3b'),_0xe4b3('0x63'),'to','cc',_0xe4b3('0x64'),_0xe4b3('0x65'),_0xe4b3('0x66')],'where':{'secret':![]},'order':qs[_0xe4b3('0x46')]('id'),'include':_0x4f5593}];return db['MailInteraction']['find']({'where':{'id':_0x4b0ba3[_0xe4b3('0x2d')]['id']},'include':_0x435418})['then'](handleEntityNotFound(_0x44f5c1,null))[_0xe4b3('0x1d')](function(_0x6e647c){if(_0x6e647c&&_0x6e647c['Messages']){var _0x3e69ae=_0x6e647c[_0xe4b3('0x67')]({'plain':!![]});fs['mkdirSync'](_0x20c10d);return BPromise[_0xe4b3('0x68')](_0x3e69ae[_0xe4b3('0x62')],function(_0x551c7f,_0x356a3d){var _0x1176de={'from':_0x551c7f['from'],'to':_0x551c7f['to']||_0xe4b3('0x69'),'subject':_0x551c7f[_0xe4b3('0x65')],'html':htmlEntities[_0xe4b3('0x6a')](_0x551c7f[_0xe4b3('0x3b')]),'headers':{'Date':moment(_0x551c7f['createdAt'])[_0xe4b3('0x4d')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x551c7f['cc']){_0x1176de[_0xe4b3('0x6b')]['Cc']=_0x551c7f['cc'];}if(_0x551c7f[_0xe4b3('0x64')]){_0x1176de['headers'][_0xe4b3('0x6c')]=_0x551c7f[_0xe4b3('0x64')];}return new BPromise(function(_0x5a5335,_0x5e720d){if(_0x551c7f[_0xe4b3('0x61')]){for(var _0x53d8ca=0x0;_0x53d8ca<_0x551c7f[_0xe4b3('0x61')][_0xe4b3('0x35')];_0x53d8ca++){var _0x346d57=_0x551c7f[_0xe4b3('0x61')][_0x53d8ca];var _0x54986e=path[_0xe4b3('0x5a')](_0x9640b9,_0x346d57['basename']);if(fs['existsSync'](_0x54986e)){_0x1176de['attachments'][_0xe4b3('0x5f')]({'name':_0x346d57['name'],'contentType':_0x346d57[_0xe4b3('0x27')],'data':fs[_0xe4b3('0x6d')](_0x54986e)});}}}emlformat['build'](_0x1176de,function(_0x236108,_0x2c48e6){if(_0x236108)return _0x5e720d(_0x236108);fs['writeFileSync'](path[_0xe4b3('0x5a')](_0x20c10d,util[_0xe4b3('0x4d')](_0xe4b3('0x6e'),_0x356a3d)),_0x2c48e6);return _0x5a5335(_0x2c48e6);});});})[_0xe4b3('0x1d')](function(){return new BPromise(function(_0x4cfd58,_0x15cd30){zipdir(_0x20c10d,{'saveTo':_0x2f4ae7},function(_0x1d6030,_0x352906){if(_0x1d6030)return _0x15cd30(_0x1d6030);return _0x4cfd58(_0x352906);});})[_0xe4b3('0x1d')](function(){return new BPromise(function(_0x35f042,_0x553d50){rimraf(_0x20c10d,function(_0x28a9c1){if(_0x28a9c1)_0x553d50(_0x28a9c1);return _0x35f042();});});})['then'](function(){return _0x44f5c1[_0xe4b3('0x57')](_0x2f4ae7,_0x3a0561,function(_0x449872){if(!_0x449872)fs[_0xe4b3('0x6f')](_0x2f4ae7);});});});}else{return _0x44f5c1[_0xe4b3('0x13')](0xc8);}})[_0xe4b3('0x3c')](handleError(_0x44f5c1,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index a1dd0c1..86be79e 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 _0xf2c5=['remove','getUsers','setDataValue','Users','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','MailInteraction','MailMessage','save','update'];(function(_0x2e97bf,_0x569e2b){var _0x3b2110=function(_0x558783){while(--_0x558783){_0x2e97bf['push'](_0x2e97bf['shift']());}};_0x3b2110(++_0x569e2b);}(_0xf2c5,0x1aa));var _0x5f2c=function(_0x3ee245,_0x23230b){_0x3ee245=_0x3ee245-0x0;var _0x445bf0=_0xf2c5[_0x3ee245];return _0x445bf0;};'use strict';var EventEmitter=require(_0x5f2c('0x0'));var MailInteraction=require(_0x5f2c('0x1'))['db'][_0x5f2c('0x2')];var MailMessage=require(_0x5f2c('0x1'))['db'][_0x5f2c('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5f2c('0x4'),'afterUpdate':_0x5f2c('0x5'),'afterDestroy':_0x5f2c('0x6')};function emitEvent(_0x2ac01b){return function(_0x47cf8a,_0x4a45e4,_0x2d415f){_0x47cf8a[_0x5f2c('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x7c2e18){_0x47cf8a[_0x5f2c('0x8')](_0x5f2c('0x9'),_0x7c2e18['map'](function(_0x4e239f){return{'id':_0x4e239f['id']};}));return MailMessage[_0x5f2c('0xa')]({'where':{'MailInteractionId':_0x47cf8a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5f2c('0xb')](function(_0x308dea){_0x47cf8a[_0x5f2c('0x8')](_0x5f2c('0xc'),_0x308dea[_0x5f2c('0xd')]);MailInteractionEvents[_0x5f2c('0xe')](_0x2ac01b+':'+_0x47cf8a['id'],_0x47cf8a);MailInteractionEvents[_0x5f2c('0xe')](_0x2ac01b,_0x47cf8a);_0x2d415f(null);})[_0x5f2c('0xf')](_0x2d415f(null));};}for(var e in events){if(events[_0x5f2c('0x10')](e)){var event=events[e];MailInteraction[_0x5f2c('0x11')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0xb894=['hook','exports','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','save','update','getUsers','then','map','findAll','setDataValue','length','emit','catch'];(function(_0x551959,_0xee87da){var _0x58955e=function(_0x5e8320){while(--_0x5e8320){_0x551959['push'](_0x551959['shift']());}};_0x58955e(++_0xee87da);}(_0xb894,0xf0));var _0x4b89=function(_0x3d2a3f,_0x542524){_0x3d2a3f=_0x3d2a3f-0x0;var _0x78d0ac=_0xb894[_0x3d2a3f];return _0x78d0ac;};'use strict';var EventEmitter=require(_0x4b89('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x4b89('0x1')];var MailMessage=require(_0x4b89('0x2'))['db'][_0x4b89('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4b89('0x4')](0x0);var events={'afterCreate':_0x4b89('0x5'),'afterUpdate':_0x4b89('0x6'),'afterDestroy':'remove'};function emitEvent(_0x51e683){return function(_0xc7f3e9,_0x310158,_0x5f9b02){_0xc7f3e9[_0x4b89('0x7')]({'attributes':['id'],'raw':!![]})[_0x4b89('0x8')](function(_0x1d5385){_0xc7f3e9['setDataValue']('Users',_0x1d5385[_0x4b89('0x9')](function(_0x1aebbb){return{'id':_0x1aebbb['id']};}));return MailMessage[_0x4b89('0xa')]({'where':{'MailInteractionId':_0xc7f3e9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4b89('0x8')](function(_0x4fd67e){_0xc7f3e9[_0x4b89('0xb')]('unreadMessages',_0x4fd67e[_0x4b89('0xc')]);MailInteractionEvents['emit'](_0x51e683+':'+_0xc7f3e9['id'],_0xc7f3e9);MailInteractionEvents[_0x4b89('0xd')](_0x51e683,_0xc7f3e9);_0x5f9b02(null);})[_0x4b89('0xe')](_0x5f9b02(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x4b89('0xf')](e,emitEvent(event));}}module[_0x4b89('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 7cbbfa1..b9dcabf 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 _0x5fbf=['get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./mailInteraction.attributes','exports','define','mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','models'];(function(_0x13524d,_0x505b49){var _0x9918b4=function(_0xef1f0a){while(--_0xef1f0a){_0x13524d['push'](_0x13524d['shift']());}};_0x9918b4(++_0x505b49);}(_0x5fbf,0xa9));var _0xf5fb=function(_0x45e0c5,_0x4b99e6){_0x45e0c5=_0x45e0c5-0x0;var _0x55a6ac=_0x5fbf[_0x45e0c5];return _0x55a6ac;};'use strict';var _=require(_0xf5fb('0x0'));var util=require(_0xf5fb('0x1'));var logger=require(_0xf5fb('0x2'))(_0xf5fb('0x3'));var moment=require('moment');var BPromise=require(_0xf5fb('0x4'));var rp=require(_0xf5fb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5fb('0x6'));var config=require('../../config/environment');var attributes=require(_0xf5fb('0x7'));module[_0xf5fb('0x8')]=function(_0xb829c2,_0x2d6fc2){return _0xb829c2[_0xf5fb('0x9')]('MailInteraction',attributes,{'tableName':_0xf5fb('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xf5fb('0xb'),'to'],'type':_0xf5fb('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2c62f2,_0x52d9f1,_0x429802){if(_0x2c62f2[_0xf5fb('0xd')]){_0x2c62f2[_0xf5fb('0xe')]=moment()['format'](_0xf5fb('0xf'));}if(_0x2c62f2[_0xf5fb('0x10')]){_0x2c62f2[_0xf5fb('0x11')]=moment()[_0xf5fb('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}_0x429802(null,_0x52d9f1);},'beforeUpdate':function(_0x4d8c23,_0x504a44,_0x4d111d){if(_0x4d8c23['changed'](_0xf5fb('0xd'))){_0x4d8c23[_0xf5fb('0xe')]=_0x4d8c23[_0xf5fb('0xd')]?moment()[_0xf5fb('0x12')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x4d8c23['changed']('closed')){_0x4d8c23[_0xf5fb('0x11')]=moment()[_0xf5fb('0x12')](_0xf5fb('0xf'));_0x4d8c23[_0xf5fb('0xd')]=null;_0x4d8c23[_0xf5fb('0xe')]=null;}_0x4d111d(null,_0x4d8c23);},'afterUpdate':function(_0x1da857,_0x39a263,_0x25680e){var _0x505f4a=_0xb829c2[_0xf5fb('0x13')];var _0x5bb05f=_0x1da857[_0xf5fb('0x14')]({'plain':!![]});if(_0x5bb05f[_0xf5fb('0x10')]){return _0x505f4a[_0xf5fb('0x15')][_0xf5fb('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x5bb05f['id']}})[_0xf5fb('0x17')](function(){_0x25680e();})[_0xf5fb('0x18')](function(_0x5b2c21){_0x25680e(_0x5b2c21);});}else{_0x25680e();}}},'charset':_0xf5fb('0x19'),'collate':_0xf5fb('0x1a')});}; \ No newline at end of file +var _0x03fb=['MailInteraction','fti_mail_interactions','subject','substatus','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','models','get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','path','rimraf','./mailInteraction.attributes','exports'];(function(_0x2074db,_0x10b81b){var _0x27324c=function(_0x5c3d5c){while(--_0x5c3d5c){_0x2074db['push'](_0x2074db['shift']());}};_0x27324c(++_0x10b81b);}(_0x03fb,0x1a1));var _0xb03f=function(_0x24fadb,_0x1ec5c7){_0x24fadb=_0x24fadb-0x0;var _0x4b6abc=_0x03fb[_0x24fadb];return _0x4b6abc;};'use strict';var _=require(_0xb03f('0x0'));var util=require(_0xb03f('0x1'));var logger=require('../../config/logger')(_0xb03f('0x2'));var moment=require(_0xb03f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb03f('0x4'));var rimraf=require(_0xb03f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb03f('0x6'));module[_0xb03f('0x7')]=function(_0xbf3a44,_0x1ff130){return _0xbf3a44['define'](_0xb03f('0x8'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xb03f('0x9'),'fields':[_0xb03f('0xa'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x225e1f,_0x2a2445,_0x547dca){if(_0x225e1f[_0xb03f('0xb')]){_0x225e1f[_0xb03f('0xc')]=moment()[_0xb03f('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x225e1f[_0xb03f('0xe')]){_0x225e1f[_0xb03f('0xf')]=moment()['format'](_0xb03f('0x10'));}_0x547dca(null,_0x2a2445);},'beforeUpdate':function(_0x3046d6,_0x58d947,_0x4a4177){if(_0x3046d6[_0xb03f('0x11')](_0xb03f('0xb'))){_0x3046d6[_0xb03f('0xc')]=_0x3046d6[_0xb03f('0xb')]?moment()[_0xb03f('0xd')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x3046d6[_0xb03f('0x11')](_0xb03f('0xe'))){_0x3046d6[_0xb03f('0xf')]=moment()[_0xb03f('0xd')](_0xb03f('0x10'));_0x3046d6[_0xb03f('0xb')]=null;_0x3046d6[_0xb03f('0xc')]=null;}_0x4a4177(null,_0x3046d6);},'afterUpdate':function(_0x570f8d,_0x5c1693,_0x408e6d){var _0x596b4f=_0xbf3a44[_0xb03f('0x12')];var _0x22f90d=_0x570f8d[_0xb03f('0x13')]({'plain':!![]});if(_0x22f90d['closed']){return _0x596b4f[_0xb03f('0x14')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x22f90d['id']}})[_0xb03f('0x15')](function(){_0x408e6d();})[_0xb03f('0x16')](function(_0x3b2770){_0x408e6d(_0x3b2770);});}else{_0x408e6d();}}},'charset':_0xb03f('0x17'),'collate':_0xb03f('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 4ce3e00..5033ffd 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 _0x8b43=['ids','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateMailInteraction','update','body','options','raw','where','attributes','AddTagsToMailInteraction','MailInteraction','find'];(function(_0x56653b,_0x50e97f){var _0x5944d8=function(_0x12dd99){while(--_0x12dd99){_0x56653b['push'](_0x56653b['shift']());}};_0x5944d8(++_0x50e97f);}(_0x8b43,0x7e));var _0x38b4=function(_0x38e17f,_0x1d343e){_0x38e17f=_0x38e17f-0x0;var _0x40ba46=_0x8b43[_0x38e17f];return _0x40ba46;};'use strict';var _=require(_0x38b4('0x0'));var util=require(_0x38b4('0x1'));var moment=require(_0x38b4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x38b4('0x3'));var db=require(_0x38b4('0x4'))['db'];var utils=require(_0x38b4('0x5'));var logger=require('../../config/logger')(_0x38b4('0x6'));var config=require(_0x38b4('0x7'));var jayson=require(_0x38b4('0x8'));var client=jayson[_0x38b4('0x9')][_0x38b4('0xa')]({'port':0x232a});config[_0x38b4('0xb')]=_[_0x38b4('0xc')](config['redis'],{'host':_0x38b4('0xd'),'port':0x18eb});var socket=require(_0x38b4('0xe'))(new Redis(config[_0x38b4('0xb')]));require(_0x38b4('0xf'))[_0x38b4('0x10')](socket);function respondWithRpcPromise(_0x13e304,_0x5827dd,_0x3f16dd){return new BPromise(function(_0x2d3fe4,_0x27bb11){return client['request'](_0x13e304,_0x3f16dd)[_0x38b4('0x11')](function(_0x256969){logger[_0x38b4('0x12')](_0x38b4('0x13'),_0x5827dd,'request\x20sent');logger[_0x38b4('0x14')](_0x38b4('0x15'),_0x5827dd,_0x38b4('0x16'),JSON[_0x38b4('0x17')](_0x256969));if(_0x256969[_0x38b4('0x18')]){if(_0x256969[_0x38b4('0x18')][_0x38b4('0x19')]===0x1f4){logger[_0x38b4('0x18')](_0x38b4('0x13'),_0x5827dd,_0x256969[_0x38b4('0x18')][_0x38b4('0x1a')]);return _0x27bb11(_0x256969['error'][_0x38b4('0x1a')]);}logger[_0x38b4('0x18')](_0x38b4('0x13'),_0x5827dd,_0x256969['error']['message']);return _0x2d3fe4(_0x256969[_0x38b4('0x18')][_0x38b4('0x1a')]);}else{logger['info'](_0x38b4('0x13'),_0x5827dd,_0x38b4('0x16'));_0x2d3fe4(_0x256969['result']['message']);}})[_0x38b4('0x1b')](function(_0x355362){logger[_0x38b4('0x18')](_0x38b4('0x13'),_0x5827dd,_0x355362);_0x27bb11(_0x355362);});});}exports[_0x38b4('0x1c')]=function(_0x2aa103){var _0x5e5514=this;return new Promise(function(_0x73a686,_0x59a99f){return db['MailInteraction'][_0x38b4('0x1d')](_0x2aa103[_0x38b4('0x1e')],{'raw':_0x2aa103[_0x38b4('0x1f')]?_0x2aa103[_0x38b4('0x1f')][_0x38b4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2aa103[_0x38b4('0x1f')]?_0x2aa103[_0x38b4('0x1f')][_0x38b4('0x21')]||null:null,'attributes':_0x2aa103[_0x38b4('0x1f')]?_0x2aa103[_0x38b4('0x1f')][_0x38b4('0x22')]||null:null,'limit':_0x2aa103[_0x38b4('0x1f')]?_0x2aa103[_0x38b4('0x1f')]['limit']||null:null})[_0x38b4('0x11')](function(_0x236f24){logger[_0x38b4('0x12')](_0x38b4('0x1c'),_0x2aa103);logger['debug']('UpdateMailInteraction',_0x2aa103,JSON[_0x38b4('0x17')](_0x236f24));_0x73a686(_0x236f24);})['catch'](function(_0x2006c4){logger[_0x38b4('0x18')](_0x38b4('0x1c'),_0x2006c4[_0x38b4('0x1a')],_0x2aa103);_0x59a99f(_0x5e5514['error'](0x1f4,_0x2006c4[_0x38b4('0x1a')]));});});};exports[_0x38b4('0x23')]=function(_0x35b9c1){return new Promise(function(_0x5c77ae,_0x360e60){return db[_0x38b4('0x24')][_0x38b4('0x25')]({'where':_0x35b9c1[_0x38b4('0x1f')]?_0x35b9c1[_0x38b4('0x1f')]['where']||null:null})[_0x38b4('0x11')](function(_0x444840){if(_0x444840){return _0x444840['addTags'](_0x35b9c1[_0x38b4('0x1e')][_0x38b4('0x26')],_['omit'](_0x35b9c1['body'],[_0x38b4('0x26'),'id'])||{});}})[_0x38b4('0x27')](function(_0x3bb787){logger[_0x38b4('0x12')]('AddTags',_0x35b9c1);logger[_0x38b4('0x14')](_0x38b4('0x28'),_0x35b9c1,JSON[_0x38b4('0x17')](_0x3bb787));_0x5c77ae(_0x3bb787);})['catch'](function(_0x429b03){logger['error'](_0x38b4('0x28'),_0x429b03['message'],_0x35b9c1);_0x360e60(_this[_0x38b4('0x18')](0x1f4,_0x429b03['message']));});});}; \ No newline at end of file +var _0x3d49=['where','attributes','limit','find','addTags','body','ids','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','socket.io-emitter','redis','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateMailInteraction','MailInteraction','update','options','raw'];(function(_0x5a3d49,_0x1ed604){var _0x311f30=function(_0x5d6535){while(--_0x5d6535){_0x5a3d49['push'](_0x5a3d49['shift']());}};_0x311f30(++_0x1ed604);}(_0x3d49,0x151));var _0x93d4=function(_0x4178af,_0x388652){_0x4178af=_0x4178af-0x0;var _0x20f4b1=_0x3d49[_0x4178af];return _0x20f4b1;};'use strict';var _=require('lodash');var util=require(_0x93d4('0x0'));var moment=require(_0x93d4('0x1'));var BPromise=require(_0x93d4('0x2'));var rs=require(_0x93d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93d4('0x4'))['db'];var utils=require(_0x93d4('0x5'));var logger=require(_0x93d4('0x6'))(_0x93d4('0x7'));var config=require(_0x93d4('0x8'));var jayson=require(_0x93d4('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x93d4('0xa'))(new Redis(config[_0x93d4('0xb')]));require(_0x93d4('0xc'))[_0x93d4('0xd')](socket);function respondWithRpcPromise(_0x15f0c2,_0x174c6d,_0x1fcdd0){return new BPromise(function(_0x2db63a,_0x39d3a6){return client[_0x93d4('0xe')](_0x15f0c2,_0x1fcdd0)[_0x93d4('0xf')](function(_0xeabf99){logger['info'](_0x93d4('0x10'),_0x174c6d,'request\x20sent');logger[_0x93d4('0x11')](_0x93d4('0x12'),_0x174c6d,_0x93d4('0x13'),JSON[_0x93d4('0x14')](_0xeabf99));if(_0xeabf99['error']){if(_0xeabf99[_0x93d4('0x15')][_0x93d4('0x16')]===0x1f4){logger['error'](_0x93d4('0x10'),_0x174c6d,_0xeabf99[_0x93d4('0x15')][_0x93d4('0x17')]);return _0x39d3a6(_0xeabf99[_0x93d4('0x15')][_0x93d4('0x17')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x174c6d,_0xeabf99[_0x93d4('0x15')]['message']);return _0x2db63a(_0xeabf99[_0x93d4('0x15')][_0x93d4('0x17')]);}else{logger[_0x93d4('0x18')](_0x93d4('0x10'),_0x174c6d,_0x93d4('0x13'));_0x2db63a(_0xeabf99[_0x93d4('0x19')]['message']);}})[_0x93d4('0x1a')](function(_0x58410f){logger[_0x93d4('0x15')]('MailInteraction,\x20%s,\x20%s',_0x174c6d,_0x58410f);_0x39d3a6(_0x58410f);});});}exports[_0x93d4('0x1b')]=function(_0x5a58ec){var _0x37c776=this;return new Promise(function(_0x115eb6,_0x2c185c){return db[_0x93d4('0x1c')][_0x93d4('0x1d')](_0x5a58ec['body'],{'raw':_0x5a58ec[_0x93d4('0x1e')]?_0x5a58ec[_0x93d4('0x1e')][_0x93d4('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a58ec[_0x93d4('0x1e')]?_0x5a58ec[_0x93d4('0x1e')][_0x93d4('0x20')]||null:null,'attributes':_0x5a58ec['options']?_0x5a58ec[_0x93d4('0x1e')][_0x93d4('0x21')]||null:null,'limit':_0x5a58ec[_0x93d4('0x1e')]?_0x5a58ec['options'][_0x93d4('0x22')]||null:null})['then'](function(_0x38a9af){logger[_0x93d4('0x18')]('UpdateMailInteraction',_0x5a58ec);logger[_0x93d4('0x11')](_0x93d4('0x1b'),_0x5a58ec,JSON[_0x93d4('0x14')](_0x38a9af));_0x115eb6(_0x38a9af);})['catch'](function(_0x572c52){logger[_0x93d4('0x15')]('UpdateMailInteraction',_0x572c52[_0x93d4('0x17')],_0x5a58ec);_0x2c185c(_0x37c776[_0x93d4('0x15')](0x1f4,_0x572c52['message']));});});};exports['AddTagsToMailInteraction']=function(_0x28379a){return new Promise(function(_0x3b7df9,_0x8ed25e){return db[_0x93d4('0x1c')][_0x93d4('0x23')]({'where':_0x28379a[_0x93d4('0x1e')]?_0x28379a[_0x93d4('0x1e')][_0x93d4('0x20')]||null:null})[_0x93d4('0xf')](function(_0x57b7f6){if(_0x57b7f6){return _0x57b7f6[_0x93d4('0x24')](_0x28379a[_0x93d4('0x25')][_0x93d4('0x26')],_['omit'](_0x28379a[_0x93d4('0x25')],[_0x93d4('0x26'),'id'])||{});}})[_0x93d4('0x27')](function(_0x3192ca){logger[_0x93d4('0x18')]('AddTags',_0x28379a);logger[_0x93d4('0x11')](_0x93d4('0x28'),_0x28379a,JSON[_0x93d4('0x14')](_0x3192ca));_0x3b7df9(_0x3192ca);})['catch'](function(_0x9306fc){logger[_0x93d4('0x15')](_0x93d4('0x28'),_0x9306fc[_0x93d4('0x17')],_0x28379a);_0x8ed25e(_this[_0x93d4('0x15')](0x1f4,_0x9306fc['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 205fc6e..24a25a6 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 _0x211f=['removeListener','length','mailInteraction:','save','remove','update'];(function(_0x464994,_0xbaffbd){var _0x25c167=function(_0x3012c2){while(--_0x3012c2){_0x464994['push'](_0x464994['shift']());}};_0x25c167(++_0xbaffbd);}(_0x211f,0x1c5));var _0xf211=function(_0x16a14c,_0x2dbe5c){_0x16a14c=_0x16a14c-0x0;var _0x12d727=_0x211f[_0x16a14c];return _0x12d727;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xf211('0x0'),_0xf211('0x1'),_0xf211('0x2')];function createListener(_0x13ee08,_0x422789){return function(_0x437c35){_0x422789['emit'](_0x13ee08,_0x437c35);};}function removeListener(_0x43d9d5,_0x467791){return function(){MailInteractionEvents[_0xf211('0x3')](_0x43d9d5,_0x467791);};}exports['register']=function(_0x783feb){for(var _0x1fdfc2=0x0,_0x17ef29=events[_0xf211('0x4')];_0x1fdfc2<_0x17ef29;_0x1fdfc2++){var _0x44dd0d=events[_0x1fdfc2];var _0x220cc5=createListener(_0xf211('0x5')+_0x44dd0d,_0x783feb);MailInteractionEvents['on'](_0x44dd0d,_0x220cc5);}}; \ No newline at end of file +var _0x6403=['update','emit','removeListener','register','mailInteraction:','./mailInteraction.events'];(function(_0x170d16,_0x443724){var _0x1bf864=function(_0x2be80e){while(--_0x2be80e){_0x170d16['push'](_0x170d16['shift']());}};_0x1bf864(++_0x443724);}(_0x6403,0x1f1));var _0x3640=function(_0x45a8e5,_0x289725){_0x45a8e5=_0x45a8e5-0x0;var _0x51bcb5=_0x6403[_0x45a8e5];return _0x51bcb5;};'use strict';var MailInteractionEvents=require(_0x3640('0x0'));var events=['save','remove',_0x3640('0x1')];function createListener(_0x3a3700,_0x5c3061){return function(_0x30c814){_0x5c3061[_0x3640('0x2')](_0x3a3700,_0x30c814);};}function removeListener(_0x10115b,_0x38256d){return function(){MailInteractionEvents[_0x3640('0x3')](_0x10115b,_0x38256d);};}exports[_0x3640('0x4')]=function(_0x3ff778){for(var _0x4524b0=0x0,_0x239c44=events['length'];_0x4524b0<_0x239c44;_0x4524b0++){var _0x258466=events[_0x4524b0];var _0xae3568=createListener(_0x3640('0x5')+_0x258466,_0x3ff778);MailInteractionEvents['on'](_0x258466,_0xae3568);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index ee4911b..5f8376f 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 _0x7af2=['/:id/reject','reject','delete','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','describe','show','mailmessage:create','put','update','/:id/accept','accept'];(function(_0x4156b0,_0x223852){var _0x2a7ca9=function(_0x388757){while(--_0x388757){_0x4156b0['push'](_0x4156b0['shift']());}};_0x2a7ca9(++_0x223852);}(_0x7af2,0x119));var _0x27af=function(_0x3e8c15,_0x506214){_0x3e8c15=_0x3e8c15-0x0;var _0x55129d=_0x7af2[_0x3e8c15];return _0x55129d;};'use strict';var multer=require('multer');var util=require(_0x27af('0x0'));var path=require(_0x27af('0x1'));var timeout=require(_0x27af('0x2'));var express=require(_0x27af('0x3'));var router=express['Router']();var fs_extra=require(_0x27af('0x4'));var auth=require(_0x27af('0x5'));var interaction=require(_0x27af('0x6'));var config=require(_0x27af('0x7'));var controller=require(_0x27af('0x8'));router[_0x27af('0x9')]('/',auth[_0x27af('0xa')](),controller[_0x27af('0xb')]);router[_0x27af('0x9')]('/describe',auth[_0x27af('0xa')](),controller[_0x27af('0xc')]);router[_0x27af('0x9')]('/:id',auth[_0x27af('0xa')](),controller[_0x27af('0xd')]);router[_0x27af('0x9')]('/:id/download',auth[_0x27af('0xa')](),controller['download']);router['post']('/',auth[_0x27af('0xa')](),interaction['tracked']('mail',_0x27af('0xe')),controller['create']);router[_0x27af('0xf')]('/:id',auth[_0x27af('0xa')](),controller[_0x27af('0x10')]);router[_0x27af('0xf')](_0x27af('0x11'),auth[_0x27af('0xa')](),controller[_0x27af('0x12')]);router[_0x27af('0xf')](_0x27af('0x13'),auth[_0x27af('0xa')](),controller[_0x27af('0x14')]);router[_0x27af('0x15')](_0x27af('0x16'),auth[_0x27af('0xa')](),controller[_0x27af('0x17')]);module[_0x27af('0x18')]=router; \ No newline at end of file +var _0x9d11=['describe','get','show','download','post','mailmessage:create','create','put','/:id','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','/describe'];(function(_0xa2216,_0x23317c){var _0x175ebb=function(_0x58cc3a){while(--_0x58cc3a){_0xa2216['push'](_0xa2216['shift']());}};_0x175ebb(++_0x23317c);}(_0x9d11,0xb7));var _0x19d1=function(_0x99facc,_0x548cd6){_0x99facc=_0x99facc-0x0;var _0xd39ed0=_0x9d11[_0x99facc];return _0xd39ed0;};'use strict';var multer=require(_0x19d1('0x0'));var util=require(_0x19d1('0x1'));var path=require(_0x19d1('0x2'));var timeout=require(_0x19d1('0x3'));var express=require('express');var router=express[_0x19d1('0x4')]();var fs_extra=require(_0x19d1('0x5'));var auth=require(_0x19d1('0x6'));var interaction=require(_0x19d1('0x7'));var config=require(_0x19d1('0x8'));var controller=require(_0x19d1('0x9'));router['get']('/',auth[_0x19d1('0xa')](),controller[_0x19d1('0xb')]);router['get'](_0x19d1('0xc'),auth[_0x19d1('0xa')](),controller[_0x19d1('0xd')]);router[_0x19d1('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x19d1('0xf')]);router[_0x19d1('0xe')]('/:id/download',auth[_0x19d1('0xa')](),controller[_0x19d1('0x10')]);router[_0x19d1('0x11')]('/',auth['isAuthenticated'](),interaction['tracked']('mail',_0x19d1('0x12')),controller[_0x19d1('0x13')]);router[_0x19d1('0x14')](_0x19d1('0x15'),auth['isAuthenticated'](),controller['update']);router[_0x19d1('0x14')]('/:id/accept',auth['isAuthenticated'](),controller[_0x19d1('0x16')]);router[_0x19d1('0x14')](_0x19d1('0x17'),auth[_0x19d1('0xa')](),controller[_0x19d1('0x18')]);router[_0x19d1('0x19')](_0x19d1('0x15'),auth['isAuthenticated'](),controller[_0x19d1('0x1a')]);module[_0x19d1('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 038aef6..aca4d92 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 _0x18a1=['Email','Chat','exports','TEXT','long','medium','BOOLEAN','out','STRING','INTEGER','DATE','ENUM'];(function(_0x698020,_0x1babec){var _0x3d7cdb=function(_0x17f6f0){while(--_0x17f6f0){_0x698020['push'](_0x698020['shift']());}};_0x3d7cdb(++_0x1babec);}(_0x18a1,0x15e));var _0x118a=function(_0x3c797d,_0x313fd2){_0x3c797d=_0x3c797d-0x0;var _0x3bfa85=_0x18a1[_0x3c797d];return _0x3bfa85;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x118a('0x0')]={'body':{'type':Sequelize[_0x118a('0x1')](_0x118a('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x118a('0x1')](_0x118a('0x3'))},'read':{'type':Sequelize[_0x118a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x118a('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x118a('0x6')](0x1fe)},'from':{'type':Sequelize[_0x118a('0x6')]},'to':{'type':Sequelize[_0x118a('0x1')](_0x118a('0x2'))},'cc':{'type':Sequelize[_0x118a('0x1')](_0x118a('0x2'))},'bcc':{'type':Sequelize[_0x118a('0x1')](_0x118a('0x2'))},'subject':{'type':Sequelize[_0x118a('0x1')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x118a('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x118a('0x8')]},'originTo':{'type':Sequelize[_0x118a('0x1')](_0x118a('0x2'))},'originCc':{'type':Sequelize[_0x118a('0x1')](_0x118a('0x2'))},'originChannel':{'type':Sequelize[_0x118a('0x9')](_0x118a('0xa'),_0x118a('0xb')),'defaultValue':_0x118a('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0xd76b=['medium','BOOLEAN','STRING','DATE','INTEGER','Email','Chat','sequelize','lodash','TEXT','long'];(function(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0xd76b,0x11a));var _0xbd76=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd76b[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xbd76('0x0'));var _=require(_0xbd76('0x1'));module['exports']={'body':{'type':Sequelize[_0xbd76('0x2')](_0xbd76('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xbd76('0x4'))},'read':{'type':Sequelize[_0xbd76('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xbd76('0x6')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xbd76('0x2')](_0xbd76('0x3'))},'cc':{'type':Sequelize[_0xbd76('0x2')](_0xbd76('0x3'))},'bcc':{'type':Sequelize[_0xbd76('0x2')]('long')},'subject':{'type':Sequelize[_0xbd76('0x2')]},'sentAt':{'type':Sequelize[_0xbd76('0x7')]},'attach':{'type':Sequelize[_0xbd76('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xbd76('0x7')]},'originTo':{'type':Sequelize[_0xbd76('0x2')](_0xbd76('0x3'))},'originCc':{'type':Sequelize[_0xbd76('0x2')](_0xbd76('0x3'))},'originChannel':{'type':Sequelize['ENUM'](_0xbd76('0x9'),_0xbd76('0xa')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 26d3f4d..1c9ab78 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 _0x4e1f=['fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','fromString','EventManager','reject','MailInteraction','role','rejectMessage','Sequelize','SELECT','User','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','headers','basename','existsSync','push','readFileSync','build','writeFileSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','limit','undefined','count','offset','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','MailMessage','rawAttributes','fieldName','type','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','body','describe','create','direction','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','updatedAt','DESC','MailServerOut','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','Contacts','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','UserId','user','agent','get','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact'];(function(_0x584b7b,_0x5bd8fb){var _0x2e4b0e=function(_0x586613){while(--_0x586613){_0x584b7b['push'](_0x584b7b['shift']());}};_0x2e4b0e(++_0x5bd8fb);}(_0x4e1f,0xcb));var _0xf4e1=function(_0x27d4cc,_0x16df4c){_0x27d4cc=_0x27d4cc-0x0;var _0x309d8a=_0x4e1f[_0x27d4cc];return _0x309d8a;};'use strict';var emlformat=require(_0xf4e1('0x0'));var moment=require(_0xf4e1('0x1'));var BPromise=require(_0xf4e1('0x2'));var util=require(_0xf4e1('0x3'));var path=require(_0xf4e1('0x4'));var fs=require('fs');var _=require(_0xf4e1('0x5'));var Redis=require(_0xf4e1('0x6'));var htmlToText=require(_0xf4e1('0x7'));var qs=require(_0xf4e1('0x8'));var logger=require(_0xf4e1('0x9'))('api');var interaction_log=require('../../config/logger')(_0xf4e1('0xa'));var config=require(_0xf4e1('0xb'));var db=require(_0xf4e1('0xc'))['db'];config[_0xf4e1('0xd')]=_[_0xf4e1('0xe')](config[_0xf4e1('0xd')],{'host':_0xf4e1('0xf'),'port':0x18eb});var socket=require(_0xf4e1('0x10'))(new Redis(config['redis']));var htmlEntities=require(_0xf4e1('0x11'));require(_0xf4e1('0x12'))[_0xf4e1('0x13')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf4e1('0x14')][_0xf4e1('0x15')]({'port':0x232c});var client9003=jayson[_0xf4e1('0x14')][_0xf4e1('0x15')]({'port':0x232b});var client9002=jayson['client'][_0xf4e1('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x3df46f,_0x44d875,_0x12ffcc,_0x51c341){return new BPromise(function(_0x3a82f6,_0x3eaee1){var _0x3f747e=_0x51c341||client;return _0x3f747e[_0xf4e1('0x16')](_0x3df46f,_0x12ffcc)[_0xf4e1('0x17')](function(_0x2684b4){logger[_0xf4e1('0x18')](_0xf4e1('0x19'),_0x44d875,_0xf4e1('0x1a'));logger['debug'](_0xf4e1('0x1b'),_0x44d875,_0xf4e1('0x1a'),JSON[_0xf4e1('0x1c')](_0x2684b4));if(_0x2684b4[_0xf4e1('0x1d')]){if(_0x2684b4[_0xf4e1('0x1d')][_0xf4e1('0x1e')]===0x1f4){logger[_0xf4e1('0x1d')](_0xf4e1('0x19'),_0x44d875,_0x2684b4[_0xf4e1('0x1d')][_0xf4e1('0x1f')]);return _0x3eaee1(_0x2684b4[_0xf4e1('0x1d')][_0xf4e1('0x1f')]);}logger[_0xf4e1('0x1d')](_0xf4e1('0x19'),_0x44d875,_0x2684b4[_0xf4e1('0x1d')]['message']);return _0x3a82f6(_0x2684b4[_0xf4e1('0x1d')][_0xf4e1('0x1f')]);}else{logger[_0xf4e1('0x18')](_0xf4e1('0x19'),_0x44d875,_0xf4e1('0x1a'));_0x3a82f6(_0x2684b4['result'][_0xf4e1('0x1f')]);}})[_0xf4e1('0x20')](function(_0x40aea7){logger['error'](_0xf4e1('0x19'),_0x44d875,_0x40aea7);_0x3eaee1(_0x40aea7);});});}function respondWithResult(_0x5dd24e,_0x56e714){_0x56e714=_0x56e714||0xc8;return function(_0x404462){if(_0x404462){return _0x5dd24e[_0xf4e1('0x21')](_0x56e714)[_0xf4e1('0x22')](_0x404462);}};}function respondWithFilteredResult(_0x10a5c7,_0x4884d2){return function(_0x378c91){if(_0x378c91){var _0xfe602a=typeof _0x4884d2['offset']==='undefined'&&typeof _0x4884d2[_0xf4e1('0x23')]===_0xf4e1('0x24');var _0x2b6de0=_0x378c91[_0xf4e1('0x25')];var _0x1d601c=_0xfe602a?0x0:_0x4884d2[_0xf4e1('0x26')];var _0x24ad62=_0xfe602a?_0x378c91[_0xf4e1('0x25')]:_0x4884d2[_0xf4e1('0x26')]+_0x4884d2[_0xf4e1('0x23')];var _0x383293;if(_0x24ad62>=_0x2b6de0){_0x24ad62=_0x2b6de0;_0x383293=0xc8;}else{_0x383293=0xce;}_0x10a5c7[_0xf4e1('0x21')](_0x383293);return _0x10a5c7[_0xf4e1('0x27')](_0xf4e1('0x28'),_0x1d601c+'-'+_0x24ad62+'/'+_0x2b6de0)[_0xf4e1('0x22')](_0x378c91);}return null;};}function saveUpdates(_0x1ec7af){return function(_0x48cd52){if(_0x48cd52){return _0x48cd52[_0xf4e1('0x29')](_0x1ec7af)['then'](function(_0x35bbff){return _0x35bbff;});}return null;};}function removeEntity(_0x5572f5){return function(_0x4aa34e){if(_0x4aa34e){return _0x4aa34e[_0xf4e1('0x2a')]()[_0xf4e1('0x17')](function(){_0x5572f5[_0xf4e1('0x21')](0xcc)[_0xf4e1('0x2b')]();});}};}function handleEntityNotFound(_0x49c86a){return function(_0x4106fe){if(!_0x4106fe){_0x49c86a[_0xf4e1('0x2c')](0x194);}return _0x4106fe;};}function handleError(_0xd15989,_0x97e991){_0x97e991=_0x97e991||0x1f4;return function(_0x5d77b1){logger[_0xf4e1('0x1d')](_0x5d77b1[_0xf4e1('0x2d')]);if(_0x5d77b1['name']){delete _0x5d77b1[_0xf4e1('0x2e')];}_0xd15989[_0xf4e1('0x21')](_0x97e991)[_0xf4e1('0x2f')](_0x5d77b1);};}exports[_0xf4e1('0x30')]=function(_0x456540,_0x50b3de){var _0x1dbc96={},_0x58a8df={},_0x3e75e1={'count':0x0,'rows':[]};var _0x45fd50=_['map'](db[_0xf4e1('0x31')][_0xf4e1('0x32')],function(_0x1241b8){return{'name':_0x1241b8[_0xf4e1('0x33')],'type':_0x1241b8[_0xf4e1('0x34')]['key']};});_0x58a8df[_0xf4e1('0x35')]=_[_0xf4e1('0x36')](_0x45fd50,'name');_0x58a8df['query']=_[_0xf4e1('0x37')](_0x456540[_0xf4e1('0x38')]);_0x58a8df['filters']=_['intersection'](_0x58a8df[_0xf4e1('0x35')],_0x58a8df[_0xf4e1('0x38')]);_0x1dbc96[_0xf4e1('0x39')]=_[_0xf4e1('0x3a')](_0x58a8df[_0xf4e1('0x35')],qs['fields'](_0x456540['query'][_0xf4e1('0x3b')]));_0x1dbc96['attributes']=_0x1dbc96[_0xf4e1('0x39')][_0xf4e1('0x3c')]?_0x1dbc96[_0xf4e1('0x39')]:_0x58a8df[_0xf4e1('0x35')];if(!_0x456540[_0xf4e1('0x38')][_0xf4e1('0x3d')]('nolimit')){_0x1dbc96[_0xf4e1('0x23')]=qs[_0xf4e1('0x23')](_0x456540[_0xf4e1('0x38')][_0xf4e1('0x23')]);_0x1dbc96[_0xf4e1('0x26')]=qs[_0xf4e1('0x26')](_0x456540[_0xf4e1('0x38')][_0xf4e1('0x26')]);}_0x1dbc96[_0xf4e1('0x3e')]=qs[_0xf4e1('0x3f')](_0x456540['query'][_0xf4e1('0x3f')]);_0x1dbc96['where']=qs['filters'](_[_0xf4e1('0x40')](_0x456540[_0xf4e1('0x38')],_0x58a8df[_0xf4e1('0x41')]),_0x45fd50);if(_0x456540[_0xf4e1('0x38')][_0xf4e1('0x42')]){_0x1dbc96[_0xf4e1('0x43')]=_[_0xf4e1('0x44')](_0x1dbc96[_0xf4e1('0x43')],{'$or':_[_0xf4e1('0x36')](_0x45fd50,function(_0x35956e){if(_0x35956e[_0xf4e1('0x34')]!==_0xf4e1('0x45')){var _0x12003d={};_0x12003d[_0x35956e[_0xf4e1('0x2e')]]={'$like':'%'+_0x456540[_0xf4e1('0x38')][_0xf4e1('0x42')]+'%'};return _0x12003d;}})});}_0x1dbc96=_[_0xf4e1('0x44')]({},_0x1dbc96,_0x456540['options']);var _0x4d9c34={'where':_0x1dbc96[_0xf4e1('0x43')]};return db[_0xf4e1('0x31')][_0xf4e1('0x25')](_0x4d9c34)[_0xf4e1('0x17')](function(_0x19a09d){_0x3e75e1[_0xf4e1('0x25')]=_0x19a09d;if(_0x456540[_0xf4e1('0x38')][_0xf4e1('0x46')]){_0x1dbc96[_0xf4e1('0x47')]=[{'all':!![]}];}return db[_0xf4e1('0x31')][_0xf4e1('0x48')](_0x1dbc96);})[_0xf4e1('0x17')](function(_0x373eea){_0x3e75e1[_0xf4e1('0x49')]=_0x373eea;return _0x3e75e1;})[_0xf4e1('0x17')](respondWithFilteredResult(_0x50b3de,_0x1dbc96))[_0xf4e1('0x20')](handleError(_0x50b3de,null));};exports[_0xf4e1('0x4a')]=function(_0x4cee46,_0x54017f){var _0x577ccc={'raw':!![],'where':{'id':_0x4cee46[_0xf4e1('0x4b')]['id']}},_0x55242e={};_0x55242e[_0xf4e1('0x35')]=_['keys'](db[_0xf4e1('0x31')][_0xf4e1('0x32')]);_0x55242e[_0xf4e1('0x38')]=_['keys'](_0x4cee46['query']);_0x55242e[_0xf4e1('0x41')]=_['intersection'](_0x55242e['model'],_0x55242e[_0xf4e1('0x38')]);_0x577ccc[_0xf4e1('0x39')]=_[_0xf4e1('0x3a')](_0x55242e[_0xf4e1('0x35')],qs[_0xf4e1('0x3b')](_0x4cee46[_0xf4e1('0x38')][_0xf4e1('0x3b')]));_0x577ccc[_0xf4e1('0x39')]=_0x577ccc[_0xf4e1('0x39')][_0xf4e1('0x3c')]?_0x577ccc[_0xf4e1('0x39')]:_0x55242e[_0xf4e1('0x35')];if(_0x4cee46[_0xf4e1('0x38')][_0xf4e1('0x46')]){_0x577ccc[_0xf4e1('0x47')]=[{'all':!![]}];}_0x577ccc=_['merge']({},_0x577ccc,_0x4cee46[_0xf4e1('0x4c')]);return db[_0xf4e1('0x31')][_0xf4e1('0x4d')](_0x577ccc)['then'](handleEntityNotFound(_0x54017f,null))['then'](respondWithResult(_0x54017f,null))[_0xf4e1('0x20')](handleError(_0x54017f,null));};exports[_0xf4e1('0x29')]=function(_0x597d4e,_0x92d457){if(_0x597d4e['body']['id']){delete _0x597d4e[_0xf4e1('0x4e')]['id'];}return db['MailMessage'][_0xf4e1('0x4d')]({'where':{'id':_0x597d4e['params']['id']}})['then'](handleEntityNotFound(_0x92d457,null))[_0xf4e1('0x17')](saveUpdates(_0x597d4e[_0xf4e1('0x4e')],null))[_0xf4e1('0x17')](respondWithResult(_0x92d457,null))[_0xf4e1('0x20')](handleError(_0x92d457,null));};exports[_0xf4e1('0x2a')]=function(_0x23a953,_0x58e020){return db[_0xf4e1('0x31')][_0xf4e1('0x4d')]({'where':{'id':_0x23a953[_0xf4e1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x58e020,null))[_0xf4e1('0x17')](removeEntity(_0x58e020,null))['catch'](handleError(_0x58e020,null));};exports['describe']=function(_0x2d9e50,_0x4d0d85){return db['MailMessage'][_0xf4e1('0x4f')]()[_0xf4e1('0x17')](respondWithResult(_0x4d0d85,null))['catch'](handleError(_0x4d0d85,null));};exports[_0xf4e1('0x50')]=function(_0x2187b7,_0x314c7d){return db['MailMessage'][_0xf4e1('0x50')](_0x2187b7['body'])[_0xf4e1('0x17')](function(_0x464989){if(_0x464989){if(_0x464989[_0xf4e1('0x51')]==='out'&&!_0x464989[_0xf4e1('0x52')]){var _0x386980,_0x30fa8f,_0x29b950;if(_0x2187b7[_0xf4e1('0x4e')]['to']){_0x30fa8f=_0x2187b7[_0xf4e1('0x4e')]['to'][_0xf4e1('0x53')](',')[0x0];}return db[_0xf4e1('0x54')][_0xf4e1('0x55')]({'where':{'id':_0x464989[_0xf4e1('0x56')]},'include':[{'model':db[_0xf4e1('0x57')],'as':_0xf4e1('0x58'),'include':[{'model':db[_0xf4e1('0x59')],'as':'Contacts','where':{'email':_0x30fa8f},'limit':0x1,'order':[[_0xf4e1('0x5a'),_0xf4e1('0x5b')]]}]},{'model':db[_0xf4e1('0x5c')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xf4e1('0x5d'),'raw':!![]}]}]})[_0xf4e1('0x17')](function(_0x54ff2a){_0x386980=_0x54ff2a;if(!_0x386980||!_0x386980['Smtp'])return;var _0x541210=_0x386980[_0xf4e1('0x5e')]();if(_0x2187b7[_0xf4e1('0x4e')][_0xf4e1('0x5f')]&&_0x2187b7['body'][_0xf4e1('0x5f')]['length']){for(var _0x48790f=0x0;_0x48790f<_0x2187b7[_0xf4e1('0x4e')][_0xf4e1('0x5f')]['length'];_0x48790f+=0x1){_0x2187b7[_0xf4e1('0x4e')]['attachments'][_0x48790f]={'filename':_0x2187b7[_0xf4e1('0x4e')][_0xf4e1('0x5f')][_0x48790f][_0xf4e1('0x2e')],'path':path[_0xf4e1('0x60')](config[_0xf4e1('0x61')],_0xf4e1('0x62'),_0x2187b7[_0xf4e1('0x4e')][_0xf4e1('0x5f')][_0x48790f]['basename'])};}}_0x29b950={'account':_0x541210,'message':_0x2187b7['body']};return;})[_0xf4e1('0x17')](function(){if(_0x386980[_0xf4e1('0x58')]){if(_0x386980[_0xf4e1('0x58')][_0xf4e1('0x63')][_0xf4e1('0x3c')]){return _0x386980['List']['Contacts'][0x0];}else{return db[_0xf4e1('0x59')][_0xf4e1('0x50')](_[_0xf4e1('0xe')](_0x2187b7[_0xf4e1('0x4e')],{'firstName':_0x2187b7[_0xf4e1('0x4e')]['to'],'email':_0x2187b7[_0xf4e1('0x4e')]['to'],'phone':_0x2187b7['body']['to'],'ListId':_0x386980[_0xf4e1('0x64')]}));}}else{throw new Error(_0xf4e1('0x65'));}})[_0xf4e1('0x17')](function(){if(_0x29b950){return respondWithRpcPromise('SendMail',_0xf4e1('0x66'),_0x29b950,client9003)[_0xf4e1('0x17')](function(_0x1c3ce9){return _0x464989[_0xf4e1('0x29')]({'read':!![],'messageId':_0x1c3ce9[_0xf4e1('0x67')],'sentAt':moment()[_0xf4e1('0x68')](_0xf4e1('0x69'))});})['catch'](function(_0x1b5fae){logger[_0xf4e1('0x1d')]('%s',JSON[_0xf4e1('0x1c')](_0x1b5fae));return _0x464989;});}return _0x464989;});}return _0x464989;}})['then'](respondWithResult(_0x314c7d,0xc9))['catch'](handleError(_0x314c7d,null));};exports['accept']=function(_0x3dffed,_0x2bc107){var _0x31b514={'agent':{},'channel':_0xf4e1('0x6a')};if(_0x3dffed['body']['id']){delete _0x3dffed[_0xf4e1('0x4e')]['id'];}_0x3dffed[_0xf4e1('0x4e')]['read']=!![];_0x3dffed[_0xf4e1('0x4e')]['readAt']=moment()[_0xf4e1('0x68')](_0xf4e1('0x69'));_0x3dffed[_0xf4e1('0x4e')][_0xf4e1('0x6b')]=_0x3dffed[_0xf4e1('0x4e')][_0xf4e1('0x6b')]||_0x3dffed[_0xf4e1('0x6c')]['id'];_0x31b514[_0xf4e1('0x6d')]['id']=_0x3dffed[_0xf4e1('0x4e')][_0xf4e1('0x6b')];return db['MailMessage']['find']({'where':{'id':_0x3dffed[_0xf4e1('0x4b')]['id'],'UserId':null}})[_0xf4e1('0x17')](handleEntityNotFound(_0x2bc107,null))[_0xf4e1('0x17')](saveUpdates(_0x3dffed[_0xf4e1('0x4e')],null))[_0xf4e1('0x17')](function(_0x47db05){if(_0x47db05){_0x31b514['message']=_0x47db05[_0xf4e1('0x6e')]({'plain':!![]});return db['MailInteraction'][_0xf4e1('0x4d')]({'where':{'id':_0x47db05[_0xf4e1('0x6f')]}});}return null;})[_0xf4e1('0x17')](handleEntityNotFound(_0x2bc107,null))['then'](function(_0x2da5d8){if(_0x2da5d8){return _0x2da5d8[_0xf4e1('0x29')]({'UserId':_0x3dffed[_0xf4e1('0x4e')][_0xf4e1('0x6b')],'read1stAt':_[_0xf4e1('0x70')](_0x2da5d8[_0xf4e1('0x71')])?moment()[_0xf4e1('0x68')](_0xf4e1('0x69')):undefined});}return null;})[_0xf4e1('0x17')](function(_0x1ca825){if(_0x1ca825){_0x31b514['interaction']=_0x1ca825[_0xf4e1('0x6e')]({'plain':!![]});interaction_log[_0xf4e1('0x18')](_0xf4e1('0x72'),_0x3dffed[_0xf4e1('0x6c')]['id'],_0x3dffed['user'][_0xf4e1('0x2e')],_0x3dffed[_0xf4e1('0x6c')]['role'],_0x31b514[_0xf4e1('0x73')]['id'],_0x3dffed[_0xf4e1('0x4e')]?JSON[_0xf4e1('0x1c')](_0x3dffed[_0xf4e1('0x4e')]):_0xf4e1('0x74'));return respondWithRpcPromise(_0xf4e1('0x75'),'acceptMessage',_0x31b514);}return null;})['then'](function(_0x31dd73){var _0x50960b=_0xf4e1('0x76')+_0x31dd73[_0xf4e1('0x1f')][_0xf4e1('0x77')];return db[_0xf4e1('0x78')][_0xf4e1('0x38')](_0x50960b,{'type':db['Sequelize'][_0xf4e1('0x79')]['SELECT'],'raw':!![]})['then'](function(_0x1f3407){return _0x1f3407;});})[_0xf4e1('0x17')](function(_0x5dea3a){if(_0x5dea3a){_0x31b514[_0xf4e1('0x1f')][_0xf4e1('0x7a')]=_0x5dea3a[0x0];if(!_0x3dffed[_0xf4e1('0x4e')][_0xf4e1('0x6b')])return;return db['User'][_0xf4e1('0x4d')]({'where':{'id':_0x3dffed['body'][_0xf4e1('0x6b')],'role':_0xf4e1('0x6d')},'attributes':['id','name',_0xf4e1('0x7b'),_0xf4e1('0x7c'),_0xf4e1('0x7d')],'raw':!![]});}return null;})[_0xf4e1('0x17')](function(_0x34c095){if(!_0x34c095)return null;_0x31b514[_0xf4e1('0x1f')][_0xf4e1('0x6d')]=_0x34c095;return _0x31b514;})[_0xf4e1('0x17')](function(_0x2c5188){if(_0x2c5188){if(_0x3dffed['body']['manual']){_0x31b514['message'][_0xf4e1('0x7e')]=util[_0xf4e1('0x68')](_0xf4e1('0x7f'),_0x3dffed['user'][_0xf4e1('0x2e')]);_0x31b514['message'][_0xf4e1('0x80')]=_0x31b514['channel'];_0x31b514[_0xf4e1('0x1f')][_0xf4e1('0x81')]=_0x31b514['channel'];_0x31b514[_0xf4e1('0x1f')][_0xf4e1('0x82')]=_0xf4e1('0x83');_0x31b514[_0xf4e1('0x1f')][_0xf4e1('0x4e')]=htmlToText[_0xf4e1('0x84')](_0x31b514[_0xf4e1('0x1f')][_0xf4e1('0x4e')]);return respondWithRpcPromise(_0xf4e1('0x85'),_0xf4e1('0x85'),{'event':'acceptmessage','message':_0x31b514['message']},client9002)['then'](function(){return _0x31b514;});}return _0x31b514;}return null;})[_0xf4e1('0x17')](respondWithResult(_0x2bc107,null))[_0xf4e1('0x20')](handleError(_0x2bc107,null));};exports[_0xf4e1('0x86')]=function(_0x48162c,_0x92e53b){var _0xdf6287={'agent':{},'channel':_0xf4e1('0x6a')};if(_0x48162c[_0xf4e1('0x4e')]['id']){delete _0x48162c[_0xf4e1('0x4e')]['id'];}_0x48162c[_0xf4e1('0x4e')][_0xf4e1('0x6b')]=_0x48162c[_0xf4e1('0x4e')][_0xf4e1('0x6b')]||_0x48162c[_0xf4e1('0x6c')]['id'];_0xdf6287[_0xf4e1('0x6d')]['id']=_0x48162c[_0xf4e1('0x4e')][_0xf4e1('0x6b')];return db[_0xf4e1('0x31')]['find']({'where':{'id':_0x48162c[_0xf4e1('0x4b')]['id'],'UserId':null}})[_0xf4e1('0x17')](handleEntityNotFound(_0x92e53b,null))[_0xf4e1('0x17')](function(_0x11e162){if(_0x11e162){_0xdf6287[_0xf4e1('0x1f')]=_0x11e162[_0xf4e1('0x6e')]({'plain':!![]});return db[_0xf4e1('0x87')]['find']({'where':{'id':_0x11e162['MailInteractionId']}});}return null;})[_0xf4e1('0x17')](handleEntityNotFound(_0x92e53b,null))[_0xf4e1('0x17')](function(_0x3ac5f8){if(_0x3ac5f8){_0xdf6287['interaction']=_0x3ac5f8['get']({'plain':!![]});interaction_log[_0xf4e1('0x18')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x48162c[_0xf4e1('0x6c')]['id'],_0x48162c['user'][_0xf4e1('0x2e')],_0x48162c['user'][_0xf4e1('0x88')],_0xdf6287[_0xf4e1('0x73')]['id'],_0x48162c[_0xf4e1('0x4e')]?JSON[_0xf4e1('0x1c')](_0x48162c[_0xf4e1('0x4e')]):'null');return respondWithRpcPromise('RejectMessage',_0xf4e1('0x89'),_0xdf6287);}return null;})['then'](function(_0x28e799){var _0x40fe71='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x28e799[_0xf4e1('0x1f')][_0xf4e1('0x77')];return db[_0xf4e1('0x78')][_0xf4e1('0x38')](_0x40fe71,{'type':db[_0xf4e1('0x8a')][_0xf4e1('0x79')][_0xf4e1('0x8b')],'raw':!![]})[_0xf4e1('0x17')](function(_0x7ab7c0){return _0x7ab7c0;});})[_0xf4e1('0x17')](function(_0x551050){if(_0x551050){_0xdf6287['message'][_0xf4e1('0x7a')]=_0x551050[0x0];if(!_0x48162c[_0xf4e1('0x4e')][_0xf4e1('0x6b')])return;return db[_0xf4e1('0x8c')][_0xf4e1('0x4d')]({'where':{'id':_0x48162c[_0xf4e1('0x4e')][_0xf4e1('0x6b')],'role':_0xf4e1('0x6d')},'attributes':['id',_0xf4e1('0x2e'),_0xf4e1('0x7b'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x3cb7c1){if(!_0x3cb7c1)return null;_0xdf6287['message'][_0xf4e1('0x6d')]=_0x3cb7c1;return _0xdf6287;})[_0xf4e1('0x17')](function(_0x18725d){if(_0x18725d){_0x18725d[_0xf4e1('0x1f')][_0xf4e1('0x7e')]=util['format'](_0xf4e1('0x7f'),_0x48162c[_0xf4e1('0x6c')][_0xf4e1('0x2e')]);_0x18725d[_0xf4e1('0x1f')][_0xf4e1('0x80')]=_0xdf6287[_0xf4e1('0x80')];_0x18725d[_0xf4e1('0x1f')]['motionChannel']=_0xdf6287[_0xf4e1('0x80')];_0x18725d[_0xf4e1('0x1f')][_0xf4e1('0x82')]='reject';_0x18725d[_0xf4e1('0x1f')]['body']=htmlToText[_0xf4e1('0x84')](_0xdf6287[_0xf4e1('0x1f')]['body']);respondWithRpcPromise(_0xf4e1('0x85'),_0xf4e1('0x85'),{'event':_0xf4e1('0x8d'),'message':_0x18725d[_0xf4e1('0x1f')]},client9002);return _0xdf6287;}return null;})[_0xf4e1('0x17')](respondWithResult(_0x92e53b,null))[_0xf4e1('0x20')](handleError(_0x92e53b,null));};exports[_0xf4e1('0x8e')]=function(_0x215159,_0x4a07f5){var _0x4018e8=moment()[_0xf4e1('0x8f')]()[_0xf4e1('0x90')]();var _0x24163b=path['join'](config['root'],_0xf4e1('0x91'),_0xf4e1('0x92'),_0xf4e1('0x93'));var _0x5a0651=path[_0xf4e1('0x60')](config[_0xf4e1('0x61')],_0xf4e1('0x91'),_0xf4e1('0x92'),_0xf4e1('0x5f'));var _0x50cec0=util[_0xf4e1('0x68')](_0xf4e1('0x94'),_0x4018e8);return db[_0xf4e1('0x31')]['find']({'where':{'id':_0x215159[_0xf4e1('0x4b')]['id']},'attributes':['id',_0xf4e1('0x4e'),_0xf4e1('0x95'),'to','cc',_0xf4e1('0x96'),_0xf4e1('0x97'),_0xf4e1('0x98')],'include':_0x215159['query']['attachments']?[{'model':db[_0xf4e1('0x99')],'as':_0xf4e1('0x9a')}]:undefined})[_0xf4e1('0x17')](handleEntityNotFound(_0x4a07f5,null))[_0xf4e1('0x17')](function(_0x11d0e2){if(_0x11d0e2){var _0x2b688e=_0x11d0e2;var _0xbc8980={'from':_0x2b688e[_0xf4e1('0x95')],'to':_0x2b688e['to'],'subject':_0x2b688e[_0xf4e1('0x97')],'html':htmlEntities[_0xf4e1('0x9b')](_0x2b688e[_0xf4e1('0x4e')]),'headers':{'Date':moment(_0x2b688e[_0xf4e1('0x98')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x11d0e2['cc']){_0xbc8980[_0xf4e1('0x9c')]['Cc']=_0x11d0e2['cc'];}if(_0x11d0e2[_0xf4e1('0x96')]){_0xbc8980[_0xf4e1('0x9c')]['Bcc']=_0x11d0e2[_0xf4e1('0x96')];}return new BPromise(function(_0x329809,_0x56ace5){if(_0x11d0e2[_0xf4e1('0x9a')]){for(var _0x5d4ca6=0x0;_0x5d4ca6<_0x11d0e2['Attachments'][_0xf4e1('0x3c')];_0x5d4ca6++){var _0x5c2d08=_0x11d0e2['Attachments'][_0x5d4ca6];var _0x2d0e28=path[_0xf4e1('0x60')](_0x5a0651,_0x5c2d08[_0xf4e1('0x9d')]);if(fs[_0xf4e1('0x9e')](_0x2d0e28)){_0xbc8980[_0xf4e1('0x5f')][_0xf4e1('0x9f')]({'name':_0x5c2d08[_0xf4e1('0x2e')],'contentType':_0x5c2d08[_0xf4e1('0x34')],'data':fs[_0xf4e1('0xa0')](_0x2d0e28)});}}}emlformat[_0xf4e1('0xa1')](_0xbc8980,function(_0x210218,_0x46d246){if(_0x210218)return _0x56ace5(_0x210218);fs[_0xf4e1('0xa2')](path['join'](_0x24163b,_0x50cec0),_0x46d246);return _0x329809(_0x46d246);});});}})[_0xf4e1('0x17')](function(_0x2caf37){if(_0x2caf37){return _0x4a07f5[_0xf4e1('0x8e')](path[_0xf4e1('0x60')](_0x24163b,_0x50cec0),_0x50cec0,function(_0x3936d3){if(!_0x3936d3)fs['unlinkSync'](path[_0xf4e1('0x60')](_0x24163b,_0x50cec0));});}})[_0xf4e1('0x20')](handleError(_0x4a07f5,null));}; \ No newline at end of file +var _0x5866=['sort','where','filter','includeAll','include','params','rawAttributes','options','body','find','describe','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','basename','defaults','ListId','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','role','AcceptMessage','ContactId','QueryTypes','SELECT','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','reject','null','rejectMessage','Sequelize','contact','User','email','fromString','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','headers','type','readFileSync','build','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','redis','localhost','socket.io-emitter','html-entities','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','Content-Range','update','destroy','sendStatus','stack','name','send','map','MailMessage','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x5cba78,_0x3e1e1c){var _0x3af348=function(_0x593f90){while(--_0x593f90){_0x5cba78['push'](_0x5cba78['shift']());}};_0x3af348(++_0x3e1e1c);}(_0x5866,0x183));var _0x6586=function(_0x5a946d,_0x12fc59){_0x5a946d=_0x5a946d-0x0;var _0x2f2e70=_0x5866[_0x5a946d];return _0x2f2e70;};'use strict';var emlformat=require(_0x6586('0x0'));var moment=require(_0x6586('0x1'));var BPromise=require('bluebird');var util=require(_0x6586('0x2'));var path=require(_0x6586('0x3'));var fs=require('fs');var _=require(_0x6586('0x4'));var Redis=require(_0x6586('0x5'));var htmlToText=require(_0x6586('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x6586('0x7'))(_0x6586('0x8'));var interaction_log=require(_0x6586('0x7'))(_0x6586('0x9'));var config=require(_0x6586('0xa'));var db=require('../../mysqldb')['db'];config[_0x6586('0xb')]=_['defaults'](config[_0x6586('0xb')],{'host':_0x6586('0xc'),'port':0x18eb});var socket=require(_0x6586('0xd'))(new Redis(config[_0x6586('0xb')]));var htmlEntities=require(_0x6586('0xe'));require('./mailMessage.socket')['register'](socket);var jayson=require(_0x6586('0xf'));var client=jayson[_0x6586('0x10')][_0x6586('0x11')]({'port':0x232c});var client9003=jayson[_0x6586('0x10')]['http']({'port':0x232b});var client9002=jayson[_0x6586('0x10')][_0x6586('0x11')]({'port':0x232a});function respondWithRpcPromise(_0xc5d7e7,_0x3b9370,_0x5aae71,_0x50c14f){return new BPromise(function(_0x44f953,_0x492593){var _0xfda206=_0x50c14f||client;return _0xfda206[_0x6586('0x12')](_0xc5d7e7,_0x5aae71)[_0x6586('0x13')](function(_0x21255c){logger[_0x6586('0x14')](_0x6586('0x15'),_0x3b9370,_0x6586('0x16'));logger[_0x6586('0x17')](_0x6586('0x18'),_0x3b9370,_0x6586('0x16'),JSON[_0x6586('0x19')](_0x21255c));if(_0x21255c[_0x6586('0x1a')]){if(_0x21255c[_0x6586('0x1a')][_0x6586('0x1b')]===0x1f4){logger[_0x6586('0x1a')](_0x6586('0x15'),_0x3b9370,_0x21255c[_0x6586('0x1a')][_0x6586('0x1c')]);return _0x492593(_0x21255c[_0x6586('0x1a')][_0x6586('0x1c')]);}logger['error'](_0x6586('0x15'),_0x3b9370,_0x21255c[_0x6586('0x1a')][_0x6586('0x1c')]);return _0x44f953(_0x21255c[_0x6586('0x1a')][_0x6586('0x1c')]);}else{logger['info'](_0x6586('0x15'),_0x3b9370,_0x6586('0x16'));_0x44f953(_0x21255c[_0x6586('0x1d')][_0x6586('0x1c')]);}})[_0x6586('0x1e')](function(_0x524150){logger[_0x6586('0x1a')](_0x6586('0x15'),_0x3b9370,_0x524150);_0x492593(_0x524150);});});}function respondWithResult(_0x5854bd,_0x450ae0){_0x450ae0=_0x450ae0||0xc8;return function(_0x5598e5){if(_0x5598e5){return _0x5854bd[_0x6586('0x1f')](_0x450ae0)[_0x6586('0x20')](_0x5598e5);}};}function respondWithFilteredResult(_0x254880,_0x37e7ee){return function(_0x4eea5b){if(_0x4eea5b){var _0x51c294=typeof _0x37e7ee[_0x6586('0x21')]===_0x6586('0x22')&&typeof _0x37e7ee[_0x6586('0x23')]==='undefined';var _0x2c0b75=_0x4eea5b['count'];var _0x1640bb=_0x51c294?0x0:_0x37e7ee[_0x6586('0x21')];var _0x41d722=_0x51c294?_0x4eea5b[_0x6586('0x24')]:_0x37e7ee[_0x6586('0x21')]+_0x37e7ee['limit'];var _0xa6a920;if(_0x41d722>=_0x2c0b75){_0x41d722=_0x2c0b75;_0xa6a920=0xc8;}else{_0xa6a920=0xce;}_0x254880['status'](_0xa6a920);return _0x254880['set'](_0x6586('0x25'),_0x1640bb+'-'+_0x41d722+'/'+_0x2c0b75)['json'](_0x4eea5b);}return null;};}function saveUpdates(_0x2e988e){return function(_0x312fca){if(_0x312fca){return _0x312fca[_0x6586('0x26')](_0x2e988e)[_0x6586('0x13')](function(_0x5c9c4a){return _0x5c9c4a;});}return null;};}function removeEntity(_0x539108){return function(_0x3e5ce0){if(_0x3e5ce0){return _0x3e5ce0[_0x6586('0x27')]()[_0x6586('0x13')](function(){_0x539108[_0x6586('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x396928){return function(_0x1b4b9e){if(!_0x1b4b9e){_0x396928[_0x6586('0x28')](0x194);}return _0x1b4b9e;};}function handleError(_0x414210,_0x4a08a7){_0x4a08a7=_0x4a08a7||0x1f4;return function(_0x53a9b0){logger['error'](_0x53a9b0[_0x6586('0x29')]);if(_0x53a9b0['name']){delete _0x53a9b0[_0x6586('0x2a')];}_0x414210[_0x6586('0x1f')](_0x4a08a7)[_0x6586('0x2b')](_0x53a9b0);};}exports['index']=function(_0x429a33,_0x1b6eaf){var _0x5888f1={},_0x3918ff={},_0x3785e8={'count':0x0,'rows':[]};var _0x25ed66=_[_0x6586('0x2c')](db[_0x6586('0x2d')]['rawAttributes'],function(_0x289a5f){return{'name':_0x289a5f['fieldName'],'type':_0x289a5f['type']['key']};});_0x3918ff[_0x6586('0x2e')]=_[_0x6586('0x2c')](_0x25ed66,'name');_0x3918ff[_0x6586('0x2f')]=_[_0x6586('0x30')](_0x429a33[_0x6586('0x2f')]);_0x3918ff[_0x6586('0x31')]=_[_0x6586('0x32')](_0x3918ff['model'],_0x3918ff[_0x6586('0x2f')]);_0x5888f1['attributes']=_[_0x6586('0x32')](_0x3918ff[_0x6586('0x2e')],qs[_0x6586('0x33')](_0x429a33[_0x6586('0x2f')]['fields']));_0x5888f1[_0x6586('0x34')]=_0x5888f1['attributes'][_0x6586('0x35')]?_0x5888f1[_0x6586('0x34')]:_0x3918ff[_0x6586('0x2e')];if(!_0x429a33[_0x6586('0x2f')][_0x6586('0x36')](_0x6586('0x37'))){_0x5888f1[_0x6586('0x23')]=qs[_0x6586('0x23')](_0x429a33[_0x6586('0x2f')][_0x6586('0x23')]);_0x5888f1[_0x6586('0x21')]=qs['offset'](_0x429a33[_0x6586('0x2f')][_0x6586('0x21')]);}_0x5888f1[_0x6586('0x38')]=qs[_0x6586('0x39')](_0x429a33[_0x6586('0x2f')][_0x6586('0x39')]);_0x5888f1[_0x6586('0x3a')]=qs[_0x6586('0x31')](_['pick'](_0x429a33[_0x6586('0x2f')],_0x3918ff[_0x6586('0x31')]),_0x25ed66);if(_0x429a33[_0x6586('0x2f')]['filter']){_0x5888f1['where']=_['merge'](_0x5888f1[_0x6586('0x3a')],{'$or':_[_0x6586('0x2c')](_0x25ed66,function(_0x5a972a){if(_0x5a972a['type']!=='VIRTUAL'){var _0x3dd83e={};_0x3dd83e[_0x5a972a['name']]={'$like':'%'+_0x429a33['query'][_0x6586('0x3b')]+'%'};return _0x3dd83e;}})});}_0x5888f1=_['merge']({},_0x5888f1,_0x429a33['options']);var _0x167c06={'where':_0x5888f1[_0x6586('0x3a')]};return db[_0x6586('0x2d')][_0x6586('0x24')](_0x167c06)[_0x6586('0x13')](function(_0x1ad87f){_0x3785e8[_0x6586('0x24')]=_0x1ad87f;if(_0x429a33[_0x6586('0x2f')][_0x6586('0x3c')]){_0x5888f1[_0x6586('0x3d')]=[{'all':!![]}];}return db[_0x6586('0x2d')]['findAll'](_0x5888f1);})[_0x6586('0x13')](function(_0x2bf55e){_0x3785e8['rows']=_0x2bf55e;return _0x3785e8;})['then'](respondWithFilteredResult(_0x1b6eaf,_0x5888f1))[_0x6586('0x1e')](handleError(_0x1b6eaf,null));};exports['show']=function(_0xb9b2fa,_0x3b0b5a){var _0x549c52={'raw':!![],'where':{'id':_0xb9b2fa[_0x6586('0x3e')]['id']}},_0x2006d4={};_0x2006d4[_0x6586('0x2e')]=_[_0x6586('0x30')](db[_0x6586('0x2d')][_0x6586('0x3f')]);_0x2006d4[_0x6586('0x2f')]=_[_0x6586('0x30')](_0xb9b2fa[_0x6586('0x2f')]);_0x2006d4[_0x6586('0x31')]=_[_0x6586('0x32')](_0x2006d4[_0x6586('0x2e')],_0x2006d4[_0x6586('0x2f')]);_0x549c52[_0x6586('0x34')]=_[_0x6586('0x32')](_0x2006d4[_0x6586('0x2e')],qs[_0x6586('0x33')](_0xb9b2fa[_0x6586('0x2f')]['fields']));_0x549c52[_0x6586('0x34')]=_0x549c52['attributes'][_0x6586('0x35')]?_0x549c52[_0x6586('0x34')]:_0x2006d4[_0x6586('0x2e')];if(_0xb9b2fa[_0x6586('0x2f')][_0x6586('0x3c')]){_0x549c52[_0x6586('0x3d')]=[{'all':!![]}];}_0x549c52=_['merge']({},_0x549c52,_0xb9b2fa[_0x6586('0x40')]);return db[_0x6586('0x2d')]['find'](_0x549c52)[_0x6586('0x13')](handleEntityNotFound(_0x3b0b5a,null))[_0x6586('0x13')](respondWithResult(_0x3b0b5a,null))[_0x6586('0x1e')](handleError(_0x3b0b5a,null));};exports['update']=function(_0x52c14d,_0x2eb68c){if(_0x52c14d[_0x6586('0x41')]['id']){delete _0x52c14d[_0x6586('0x41')]['id'];}return db[_0x6586('0x2d')]['find']({'where':{'id':_0x52c14d['params']['id']}})['then'](handleEntityNotFound(_0x2eb68c,null))[_0x6586('0x13')](saveUpdates(_0x52c14d[_0x6586('0x41')],null))['then'](respondWithResult(_0x2eb68c,null))[_0x6586('0x1e')](handleError(_0x2eb68c,null));};exports[_0x6586('0x27')]=function(_0x1212d5,_0x3fd976){return db['MailMessage'][_0x6586('0x42')]({'where':{'id':_0x1212d5[_0x6586('0x3e')]['id']}})[_0x6586('0x13')](handleEntityNotFound(_0x3fd976,null))[_0x6586('0x13')](removeEntity(_0x3fd976,null))[_0x6586('0x1e')](handleError(_0x3fd976,null));};exports[_0x6586('0x43')]=function(_0x2cfe78,_0x2a8355){return db[_0x6586('0x2d')][_0x6586('0x43')]()[_0x6586('0x13')](respondWithResult(_0x2a8355,null))['catch'](handleError(_0x2a8355,null));};exports[_0x6586('0x44')]=function(_0x45acb7,_0x335b49){return db[_0x6586('0x2d')]['create'](_0x45acb7[_0x6586('0x41')])[_0x6586('0x13')](function(_0x20046a){if(_0x20046a){if(_0x20046a[_0x6586('0x45')]===_0x6586('0x46')&&!_0x20046a[_0x6586('0x47')]){var _0xc70e1,_0x162161,_0x4af25f;if(_0x45acb7[_0x6586('0x41')]['to']){_0x162161=_0x45acb7[_0x6586('0x41')]['to']['split'](',')[0x0];}return db[_0x6586('0x48')][_0x6586('0x49')]({'where':{'id':_0x20046a[_0x6586('0x4a')]},'include':[{'model':db[_0x6586('0x4b')],'as':_0x6586('0x4c'),'include':[{'model':db[_0x6586('0x4d')],'as':_0x6586('0x4e'),'where':{'email':_0x162161},'limit':0x1,'order':[[_0x6586('0x4f'),'DESC']]}]},{'model':db[_0x6586('0x50')],'as':_0x6586('0x51'),'raw':!![],'include':[{'model':db[_0x6586('0x52')],'as':_0x6586('0x52'),'raw':!![]}]}]})[_0x6586('0x13')](function(_0x31d2c2){_0xc70e1=_0x31d2c2;if(!_0xc70e1||!_0xc70e1['Smtp'])return;var _0x54b683=_0xc70e1[_0x6586('0x53')]();if(_0x45acb7[_0x6586('0x41')][_0x6586('0x54')]&&_0x45acb7['body'][_0x6586('0x54')][_0x6586('0x35')]){for(var _0xaa9fa7=0x0;_0xaa9fa7<_0x45acb7[_0x6586('0x41')][_0x6586('0x54')][_0x6586('0x35')];_0xaa9fa7+=0x1){_0x45acb7['body'][_0x6586('0x54')][_0xaa9fa7]={'filename':_0x45acb7[_0x6586('0x41')][_0x6586('0x54')][_0xaa9fa7][_0x6586('0x2a')],'path':path[_0x6586('0x55')](config[_0x6586('0x56')],'server/files/attachments',_0x45acb7[_0x6586('0x41')]['attachments'][_0xaa9fa7][_0x6586('0x57')])};}}_0x4af25f={'account':_0x54b683,'message':_0x45acb7['body']};return;})[_0x6586('0x13')](function(){if(_0xc70e1[_0x6586('0x4c')]){if(_0xc70e1['List'][_0x6586('0x4e')][_0x6586('0x35')]){return _0xc70e1[_0x6586('0x4c')][_0x6586('0x4e')][0x0];}else{return db[_0x6586('0x4d')][_0x6586('0x44')](_[_0x6586('0x58')](_0x45acb7[_0x6586('0x41')],{'firstName':_0x45acb7[_0x6586('0x41')]['to'],'email':_0x45acb7[_0x6586('0x41')]['to'],'phone':_0x45acb7[_0x6586('0x41')]['to'],'ListId':_0xc70e1[_0x6586('0x59')]}));}}else{throw new Error(_0x6586('0x5a'));}})[_0x6586('0x13')](function(){if(_0x4af25f){return respondWithRpcPromise(_0x6586('0x5b'),_0x6586('0x5c'),_0x4af25f,client9003)[_0x6586('0x13')](function(_0x2a9716){return _0x20046a[_0x6586('0x26')]({'read':!![],'messageId':_0x2a9716['messageId'],'sentAt':moment()[_0x6586('0x5d')](_0x6586('0x5e'))});})[_0x6586('0x1e')](function(_0x393a3c){logger['error']('%s',JSON[_0x6586('0x19')](_0x393a3c));return _0x20046a;});}return _0x20046a;});}return _0x20046a;}})[_0x6586('0x13')](respondWithResult(_0x335b49,0xc9))[_0x6586('0x1e')](handleError(_0x335b49,null));};exports['accept']=function(_0x58fae4,_0x1c1c44){var _0x37963f={'agent':{},'channel':_0x6586('0x5f')};if(_0x58fae4[_0x6586('0x41')]['id']){delete _0x58fae4[_0x6586('0x41')]['id'];}_0x58fae4[_0x6586('0x41')][_0x6586('0x60')]=!![];_0x58fae4['body'][_0x6586('0x61')]=moment()['format'](_0x6586('0x5e'));_0x58fae4[_0x6586('0x41')]['UserId']=_0x58fae4[_0x6586('0x41')][_0x6586('0x62')]||_0x58fae4[_0x6586('0x63')]['id'];_0x37963f[_0x6586('0x64')]['id']=_0x58fae4[_0x6586('0x41')][_0x6586('0x62')];return db[_0x6586('0x2d')]['find']({'where':{'id':_0x58fae4['params']['id'],'UserId':null}})[_0x6586('0x13')](handleEntityNotFound(_0x1c1c44,null))[_0x6586('0x13')](saveUpdates(_0x58fae4['body'],null))['then'](function(_0x26370c){if(_0x26370c){_0x37963f[_0x6586('0x1c')]=_0x26370c[_0x6586('0x65')]({'plain':!![]});return db[_0x6586('0x66')][_0x6586('0x42')]({'where':{'id':_0x26370c[_0x6586('0x67')]}});}return null;})[_0x6586('0x13')](handleEntityNotFound(_0x1c1c44,null))['then'](function(_0x249e12){if(_0x249e12){return _0x249e12[_0x6586('0x26')]({'UserId':_0x58fae4[_0x6586('0x41')]['UserId'],'read1stAt':_['isNil'](_0x249e12[_0x6586('0x68')])?moment()[_0x6586('0x5d')](_0x6586('0x5e')):undefined});}return null;})['then'](function(_0x188302){if(_0x188302){_0x37963f[_0x6586('0x69')]=_0x188302[_0x6586('0x65')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x58fae4['user']['id'],_0x58fae4[_0x6586('0x63')][_0x6586('0x2a')],_0x58fae4['user'][_0x6586('0x6a')],_0x37963f[_0x6586('0x69')]['id'],_0x58fae4['body']?JSON['stringify'](_0x58fae4[_0x6586('0x41')]):'null');return respondWithRpcPromise(_0x6586('0x6b'),'acceptMessage',_0x37963f);}return null;})[_0x6586('0x13')](function(_0x58ec0f){var _0x45fc51='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x58ec0f[_0x6586('0x1c')][_0x6586('0x6c')];return db['sequelize'][_0x6586('0x2f')](_0x45fc51,{'type':db['Sequelize'][_0x6586('0x6d')][_0x6586('0x6e')],'raw':!![]})['then'](function(_0x480955){return _0x480955;});})[_0x6586('0x13')](function(_0x5a0968){if(_0x5a0968){_0x37963f[_0x6586('0x1c')]['contact']=_0x5a0968[0x0];if(!_0x58fae4[_0x6586('0x41')][_0x6586('0x62')])return;return db['User'][_0x6586('0x42')]({'where':{'id':_0x58fae4[_0x6586('0x41')][_0x6586('0x62')],'role':_0x6586('0x64')},'attributes':['id',_0x6586('0x2a'),'fullname','email',_0x6586('0x6f')],'raw':!![]});}return null;})[_0x6586('0x13')](function(_0x30907c){if(!_0x30907c)return null;_0x37963f[_0x6586('0x1c')][_0x6586('0x64')]=_0x30907c;return _0x37963f;})[_0x6586('0x13')](function(_0x24b851){if(_0x24b851){if(_0x58fae4[_0x6586('0x41')]['manual']){_0x37963f['message'][_0x6586('0x70')]=util[_0x6586('0x5d')](_0x6586('0x71'),_0x58fae4['user'][_0x6586('0x2a')]);_0x37963f[_0x6586('0x1c')][_0x6586('0x72')]=_0x37963f[_0x6586('0x72')];_0x37963f[_0x6586('0x1c')][_0x6586('0x73')]=_0x37963f[_0x6586('0x72')];_0x37963f[_0x6586('0x1c')][_0x6586('0x74')]=_0x6586('0x75');_0x37963f[_0x6586('0x1c')][_0x6586('0x41')]=htmlToText['fromString'](_0x37963f[_0x6586('0x1c')]['body']);return respondWithRpcPromise('EventManager',_0x6586('0x76'),{'event':_0x6586('0x77'),'message':_0x37963f['message']},client9002)[_0x6586('0x13')](function(){return _0x37963f;});}return _0x37963f;}return null;})['then'](respondWithResult(_0x1c1c44,null))[_0x6586('0x1e')](handleError(_0x1c1c44,null));};exports[_0x6586('0x78')]=function(_0x4ff7f5,_0x3d90c5){var _0x11b3a0={'agent':{},'channel':_0x6586('0x5f')};if(_0x4ff7f5[_0x6586('0x41')]['id']){delete _0x4ff7f5[_0x6586('0x41')]['id'];}_0x4ff7f5[_0x6586('0x41')][_0x6586('0x62')]=_0x4ff7f5[_0x6586('0x41')][_0x6586('0x62')]||_0x4ff7f5['user']['id'];_0x11b3a0[_0x6586('0x64')]['id']=_0x4ff7f5[_0x6586('0x41')]['UserId'];return db[_0x6586('0x2d')][_0x6586('0x42')]({'where':{'id':_0x4ff7f5['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3d90c5,null))[_0x6586('0x13')](function(_0x518f20){if(_0x518f20){_0x11b3a0[_0x6586('0x1c')]=_0x518f20[_0x6586('0x65')]({'plain':!![]});return db[_0x6586('0x66')]['find']({'where':{'id':_0x518f20[_0x6586('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x3d90c5,null))[_0x6586('0x13')](function(_0x2f4581){if(_0x2f4581){_0x11b3a0[_0x6586('0x69')]=_0x2f4581[_0x6586('0x65')]({'plain':!![]});interaction_log[_0x6586('0x14')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ff7f5[_0x6586('0x63')]['id'],_0x4ff7f5['user'][_0x6586('0x2a')],_0x4ff7f5['user']['role'],_0x11b3a0[_0x6586('0x69')]['id'],_0x4ff7f5['body']?JSON[_0x6586('0x19')](_0x4ff7f5[_0x6586('0x41')]):_0x6586('0x79'));return respondWithRpcPromise('RejectMessage',_0x6586('0x7a'),_0x11b3a0);}return null;})[_0x6586('0x13')](function(_0x35823c){var _0x217147='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x35823c['message'][_0x6586('0x6c')];return db['sequelize']['query'](_0x217147,{'type':db[_0x6586('0x7b')][_0x6586('0x6d')][_0x6586('0x6e')],'raw':!![]})[_0x6586('0x13')](function(_0x40b7dd){return _0x40b7dd;});})[_0x6586('0x13')](function(_0x563079){if(_0x563079){_0x11b3a0[_0x6586('0x1c')][_0x6586('0x7c')]=_0x563079[0x0];if(!_0x4ff7f5['body']['UserId'])return;return db[_0x6586('0x7d')][_0x6586('0x42')]({'where':{'id':_0x4ff7f5[_0x6586('0x41')][_0x6586('0x62')],'role':_0x6586('0x64')},'attributes':['id',_0x6586('0x2a'),'fullname',_0x6586('0x7e'),'internal'],'raw':!![]});}return null;})['then'](function(_0x2bc64b){if(!_0x2bc64b)return null;_0x11b3a0[_0x6586('0x1c')][_0x6586('0x64')]=_0x2bc64b;return _0x11b3a0;})[_0x6586('0x13')](function(_0x41f76f){if(_0x41f76f){_0x41f76f[_0x6586('0x1c')][_0x6586('0x70')]=util[_0x6586('0x5d')](_0x6586('0x71'),_0x4ff7f5[_0x6586('0x63')][_0x6586('0x2a')]);_0x41f76f[_0x6586('0x1c')]['channel']=_0x11b3a0['channel'];_0x41f76f['message'][_0x6586('0x73')]=_0x11b3a0[_0x6586('0x72')];_0x41f76f[_0x6586('0x1c')]['event']='reject';_0x41f76f[_0x6586('0x1c')][_0x6586('0x41')]=htmlToText[_0x6586('0x7f')](_0x11b3a0[_0x6586('0x1c')][_0x6586('0x41')]);respondWithRpcPromise(_0x6586('0x76'),_0x6586('0x76'),{'event':_0x6586('0x80'),'message':_0x41f76f[_0x6586('0x1c')]},client9002);return _0x11b3a0;}return null;})[_0x6586('0x13')](respondWithResult(_0x3d90c5,null))[_0x6586('0x1e')](handleError(_0x3d90c5,null));};exports[_0x6586('0x81')]=function(_0x3ffe01,_0x1da010){var _0x273436=moment()[_0x6586('0x82')]()[_0x6586('0x83')]();var _0x3e5921=path[_0x6586('0x55')](config[_0x6586('0x56')],_0x6586('0x84'),_0x6586('0x85'),_0x6586('0x86'));var _0x56739a=path[_0x6586('0x55')](config[_0x6586('0x56')],_0x6586('0x84'),'files',_0x6586('0x54'));var _0x4857bd=util[_0x6586('0x5d')](_0x6586('0x87'),_0x273436);return db[_0x6586('0x2d')][_0x6586('0x42')]({'where':{'id':_0x3ffe01[_0x6586('0x3e')]['id']},'attributes':['id',_0x6586('0x41'),_0x6586('0x88'),'to','cc',_0x6586('0x89'),_0x6586('0x8a'),_0x6586('0x8b')],'include':_0x3ffe01[_0x6586('0x2f')][_0x6586('0x54')]?[{'model':db[_0x6586('0x8c')],'as':_0x6586('0x8d')}]:undefined})[_0x6586('0x13')](handleEntityNotFound(_0x1da010,null))['then'](function(_0x2b73f2){if(_0x2b73f2){var _0x215dd6=_0x2b73f2;var _0x5c3435={'from':_0x215dd6['from'],'to':_0x215dd6['to'],'subject':_0x215dd6[_0x6586('0x8a')],'html':htmlEntities[_0x6586('0x8e')](_0x215dd6[_0x6586('0x41')]),'headers':{'Date':moment(_0x215dd6[_0x6586('0x8b')])[_0x6586('0x5d')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2b73f2['cc']){_0x5c3435[_0x6586('0x8f')]['Cc']=_0x2b73f2['cc'];}if(_0x2b73f2[_0x6586('0x89')]){_0x5c3435[_0x6586('0x8f')]['Bcc']=_0x2b73f2[_0x6586('0x89')];}return new BPromise(function(_0x4094a5,_0x189fd4){if(_0x2b73f2[_0x6586('0x8d')]){for(var _0x134cf3=0x0;_0x134cf3<_0x2b73f2[_0x6586('0x8d')]['length'];_0x134cf3++){var _0x16057a=_0x2b73f2[_0x6586('0x8d')][_0x134cf3];var _0x583a27=path[_0x6586('0x55')](_0x56739a,_0x16057a[_0x6586('0x57')]);if(fs['existsSync'](_0x583a27)){_0x5c3435[_0x6586('0x54')]['push']({'name':_0x16057a['name'],'contentType':_0x16057a[_0x6586('0x90')],'data':fs[_0x6586('0x91')](_0x583a27)});}}}emlformat[_0x6586('0x92')](_0x5c3435,function(_0x31d43b,_0x485bf9){if(_0x31d43b)return _0x189fd4(_0x31d43b);fs['writeFileSync'](path[_0x6586('0x55')](_0x3e5921,_0x4857bd),_0x485bf9);return _0x4094a5(_0x485bf9);});});}})[_0x6586('0x13')](function(_0x47b8e3){if(_0x47b8e3){return _0x1da010[_0x6586('0x81')](path['join'](_0x3e5921,_0x4857bd),_0x4857bd,function(_0x12bada){if(!_0x12bada)fs[_0x6586('0x93')](path[_0x6586('0x55')](_0x3e5921,_0x4857bd));});}})[_0x6586('0x1e')](handleError(_0x1da010,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index b3a3661..e0e655e 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 _0x8721=['emit','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x291674,_0x5654aa){var _0x250b6f=function(_0x48be8e){while(--_0x48be8e){_0x291674['push'](_0x291674['shift']());}};_0x250b6f(++_0x5654aa);}(_0x8721,0x95));var _0x1872=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x8721[_0x513aa5];return _0x1a1a7c;};'use strict';var EventEmitter=require(_0x1872('0x0'));var MailMessage=require(_0x1872('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x1872('0x2')](0x0);var events={'afterCreate':_0x1872('0x3'),'afterUpdate':_0x1872('0x4'),'afterDestroy':'remove'};function emitEvent(_0x47dada){return function(_0x5c0bd5,_0x5f4fa5,_0x472870){MailMessageEvents[_0x1872('0x5')](_0x47dada+':'+_0x5c0bd5['id'],_0x5c0bd5);MailMessageEvents['emit'](_0x47dada,_0x5c0bd5);_0x472870(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x1872('0x6')]=MailMessageEvents; \ No newline at end of file +var _0xd1ec=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','update'];(function(_0x1a4979,_0x524bcf){var _0x2f6fec=function(_0x2ece47){while(--_0x2ece47){_0x1a4979['push'](_0x1a4979['shift']());}};_0x2f6fec(++_0x524bcf);}(_0xd1ec,0x19d));var _0xcd1e=function(_0x4b4b93,_0x5c2ad5){_0x4b4b93=_0x4b4b93-0x0;var _0x25ebd5=_0xd1ec[_0x4b4b93];return _0x25ebd5;};'use strict';var EventEmitter=require(_0xcd1e('0x0'));var MailMessage=require(_0xcd1e('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xcd1e('0x2'),'afterDestroy':_0xcd1e('0x3')};function emitEvent(_0xd90318){return function(_0x162207,_0x19c8ac,_0x3f83f7){MailMessageEvents[_0xcd1e('0x4')](_0xd90318+':'+_0x162207['id'],_0x162207);MailMessageEvents['emit'](_0xd90318,_0x162207);_0x3f83f7(null);};}for(var e in events){if(events[_0xcd1e('0x5')](e)){var event=events[e];MailMessage[_0xcd1e('0x6')](e,emitEvent(event));}}module[_0xcd1e('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index edb2eec..077f16a 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 _0xa42c=['../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','get','direction','toLowerCase','out','secret','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','html-to-text','path','rimraf'];(function(_0x7bc177,_0x7869fe){var _0x2e3702=function(_0x2c05c9){while(--_0x2c05c9){_0x7bc177['push'](_0x7bc177['shift']());}};_0x2e3702(++_0x7869fe);}(_0xa42c,0x12a));var _0xca42=function(_0x4f9e31,_0x19881c){_0x4f9e31=_0x4f9e31-0x0;var _0x2f9fc7=_0xa42c[_0x4f9e31];return _0x2f9fc7;};'use strict';var _=require(_0xca42('0x0'));var util=require(_0xca42('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xca42('0x2'));var BPromise=require(_0xca42('0x3'));var rp=require(_0xca42('0x4'));var htmlToText=require(_0xca42('0x5'));var fs=require('fs');var path=require(_0xca42('0x6'));var rimraf=require(_0xca42('0x7'));var config=require(_0xca42('0x8'));var attributes=require(_0xca42('0x9'));module[_0xca42('0xa')]=function(_0x1f6656,_0x3cac85){return _0x1f6656[_0xca42('0xb')](_0xca42('0xc'),attributes,{'tableName':_0xca42('0xd'),'paranoid':![],'indexes':[{'name':_0xca42('0xe'),'fields':[_0xca42('0xe')]},{'name':_0xca42('0xf'),'fields':[_0xca42('0x10'),'subject'],'type':_0xca42('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2f494a,_0x510997,_0xcea1b2){if(_0x2f494a[_0xca42('0x12')]){_0x2f494a[_0xca42('0x10')]=htmlToText[_0xca42('0x13')](_0x2f494a['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xcea1b2(null,_0x510997);},'afterCreate':function(_0x4078ad,_0x30ea22,_0x6a38d){var _0x361450=_0x1f6656['models'];var _0x10067c=_0x4078ad[_0xca42('0x14')]({'plain':!![]});if(_0x10067c[_0xca42('0x15')]['toLowerCase']()==='in'||_0x10067c['direction'][_0xca42('0x16')]()===_0xca42('0x17')&&!_0x10067c[_0xca42('0x18')]&&!_['isNil'](_0x10067c[_0xca42('0x19')])){_0x361450[_0xca42('0x1a')][_0xca42('0x1b')]({'where':{'id':_0x10067c[_0xca42('0x1c')]}})[_0xca42('0x1d')](function(_0x2b3b7f){if(_0x2b3b7f){_0x2b3b7f[_0xca42('0x1e')]({'lastMsgAt':_0x10067c[_0xca42('0x1f')],'lastMsgDirection':_0x10067c[_0xca42('0x15')][_0xca42('0x16')]()});}})[_0xca42('0x20')](function(_0xf5a9fd){console['error'](_0xf5a9fd);});}_0x6a38d();}},'charset':'utf8mb4','collate':_0xca42('0x21')});}; \ No newline at end of file +var _0xc0c8=['messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','direction','catch','utf8mb4','lodash','util','api','moment','request-promise','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages'];(function(_0x3efa7d,_0x58768d){var _0x26402f=function(_0x3cea43){while(--_0x3cea43){_0x3efa7d['push'](_0x3efa7d['shift']());}};_0x26402f(++_0x58768d);}(_0xc0c8,0x1c5));var _0x8c0c=function(_0x31c787,_0x14bbff){_0x31c787=_0x31c787-0x0;var _0xa2367c=_0xc0c8[_0x31c787];return _0xa2367c;};'use strict';var _=require(_0x8c0c('0x0'));var util=require(_0x8c0c('0x1'));var logger=require('../../config/logger')(_0x8c0c('0x2'));var moment=require(_0x8c0c('0x3'));var BPromise=require('bluebird');var rp=require(_0x8c0c('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x8c0c('0x5'));var rimraf=require(_0x8c0c('0x6'));var config=require('../../config/environment');var attributes=require(_0x8c0c('0x7'));module[_0x8c0c('0x8')]=function(_0x25da1f,_0x484986){return _0x25da1f[_0x8c0c('0x9')](_0x8c0c('0xa'),attributes,{'tableName':_0x8c0c('0xb'),'paranoid':![],'indexes':[{'name':_0x8c0c('0xc'),'fields':[_0x8c0c('0xc')]},{'name':_0x8c0c('0xd'),'fields':[_0x8c0c('0xe'),_0x8c0c('0xf')],'type':_0x8c0c('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x52c6d3,_0x4128d2,_0x1c85ca){if(_0x52c6d3[_0x8c0c('0x11')]){_0x52c6d3['plainBody']=htmlToText[_0x8c0c('0x12')](_0x52c6d3['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1c85ca(null,_0x4128d2);},'afterCreate':function(_0x57cd30,_0xf5fbac,_0xcbc2e7){var _0x1b8e37=_0x25da1f[_0x8c0c('0x13')];var _0x35bfba=_0x57cd30[_0x8c0c('0x14')]({'plain':!![]});if(_0x35bfba['direction'][_0x8c0c('0x15')]()==='in'||_0x35bfba['direction']['toLowerCase']()===_0x8c0c('0x16')&&!_0x35bfba[_0x8c0c('0x17')]&&!_[_0x8c0c('0x18')](_0x35bfba[_0x8c0c('0x19')])){_0x1b8e37[_0x8c0c('0x1a')][_0x8c0c('0x1b')]({'where':{'id':_0x35bfba['MailInteractionId']}})['then'](function(_0x411acb){if(_0x411acb){_0x411acb['update']({'lastMsgAt':_0x35bfba['createdAt'],'lastMsgDirection':_0x35bfba[_0x8c0c('0x1c')]['toLowerCase']()});}})[_0x8c0c('0x1d')](function(_0x4a618b){console['error'](_0x4a618b);});}_0xcbc2e7();}},'charset':_0x8c0c('0x1e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 5a6d51b..5abe1b2 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 _0xdd4f=['request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x55084b,_0x27a605){_0x55084b=_0x55084b-0x0;var _0x5b67bd=_0xdd4f[_0x55084b];return _0x5b67bd;};'use strict';var _=require(_0xfdd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfdd4('0x1'));var fs=require('fs');var Redis=require(_0xfdd4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xfdd4('0x6'));var client=jayson[_0xfdd4('0x7')][_0xfdd4('0x8')]({'port':0x232a});config[_0xfdd4('0x9')]=_[_0xfdd4('0xa')](config['redis'],{'host':_0xfdd4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfdd4('0x9')]));require(_0xfdd4('0xc'))[_0xfdd4('0xd')](socket);function respondWithRpcPromise(_0x4ee02f,_0x3d06c9,_0x4b4f1d){return new BPromise(function(_0x27a9f3,_0x3ce77a){return client[_0xfdd4('0xe')](_0x4ee02f,_0x4b4f1d)[_0xfdd4('0xf')](function(_0x35e22d){logger[_0xfdd4('0x10')](_0xfdd4('0x11'),_0x3d06c9,_0xfdd4('0x12'));logger[_0xfdd4('0x13')](_0xfdd4('0x14'),_0x3d06c9,_0xfdd4('0x12'),JSON['stringify'](_0x35e22d));if(_0x35e22d[_0xfdd4('0x15')]){if(_0x35e22d[_0xfdd4('0x15')][_0xfdd4('0x16')]===0x1f4){logger['error'](_0xfdd4('0x11'),_0x3d06c9,_0x35e22d['error'][_0xfdd4('0x17')]);return _0x3ce77a(_0x35e22d[_0xfdd4('0x15')][_0xfdd4('0x17')]);}logger[_0xfdd4('0x15')](_0xfdd4('0x11'),_0x3d06c9,_0x35e22d['error']['message']);return _0x27a9f3(_0x35e22d['error'][_0xfdd4('0x17')]);}else{logger[_0xfdd4('0x10')](_0xfdd4('0x11'),_0x3d06c9,_0xfdd4('0x12'));_0x27a9f3(_0x35e22d[_0xfdd4('0x18')][_0xfdd4('0x17')]);}})[_0xfdd4('0x19')](function(_0x2ffd5f){logger[_0xfdd4('0x15')]('MailMessage,\x20%s,\x20%s',_0x3d06c9,_0x2ffd5f);_0x3ce77a(_0x2ffd5f);});});}exports[_0xfdd4('0x1a')]=function(_0x3e8eac){var _0x2dc51c=this;return new Promise(function(_0x36e611,_0x1454f1){return db[_0xfdd4('0x1b')][_0xfdd4('0x1c')](_0x3e8eac[_0xfdd4('0x1d')],{'raw':_0x3e8eac['options']?_0x3e8eac[_0xfdd4('0x1e')][_0xfdd4('0x1f')]===undefined?!![]:![]:!![]})[_0xfdd4('0xf')](function(_0x16e81b){logger[_0xfdd4('0x10')](_0xfdd4('0x1a'),_0x3e8eac);logger[_0xfdd4('0x13')](_0xfdd4('0x1a'),_0x3e8eac,JSON['stringify'](_0x16e81b));_0x36e611(_0x16e81b);})[_0xfdd4('0x19')](function(_0x1112e8){logger[_0xfdd4('0x15')]('CreateMailMessage',_0x1112e8[_0xfdd4('0x17')],_0x3e8eac);_0x1454f1(_0x2dc51c[_0xfdd4('0x15')](0x1f4,_0x1112e8[_0xfdd4('0x17')]));});});}; \ No newline at end of file +var _0xe5af=['result','MailMessage','create','body','options','CreateMailMessage','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe5af,0x9c));var _0xfe5a=function(_0xb76a7,_0x1161ef){_0xb76a7=_0xb76a7-0x0;var _0x152fac=_0xe5af[_0xb76a7];return _0x152fac;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var moment=require(_0xfe5a('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe5a('0x2'));var fs=require('fs');var Redis=require(_0xfe5a('0x3'));var db=require(_0xfe5a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe5a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe5a('0x6'));var client=jayson[_0xfe5a('0x7')]['http']({'port':0x232a});config['redis']=_[_0xfe5a('0x8')](config[_0xfe5a('0x9')],{'host':_0xfe5a('0xa'),'port':0x18eb});var socket=require(_0xfe5a('0xb'))(new Redis(config['redis']));require(_0xfe5a('0xc'))['register'](socket);function respondWithRpcPromise(_0x51718e,_0x259e8a,_0x2cb946){return new BPromise(function(_0x543619,_0xb51e47){return client[_0xfe5a('0xd')](_0x51718e,_0x2cb946)[_0xfe5a('0xe')](function(_0x50024c){logger[_0xfe5a('0xf')]('MailMessage,\x20%s,\x20%s',_0x259e8a,_0xfe5a('0x10'));logger[_0xfe5a('0x11')](_0xfe5a('0x12'),_0x259e8a,_0xfe5a('0x10'),JSON[_0xfe5a('0x13')](_0x50024c));if(_0x50024c['error']){if(_0x50024c[_0xfe5a('0x14')][_0xfe5a('0x15')]===0x1f4){logger[_0xfe5a('0x14')](_0xfe5a('0x16'),_0x259e8a,_0x50024c[_0xfe5a('0x14')][_0xfe5a('0x17')]);return _0xb51e47(_0x50024c[_0xfe5a('0x14')][_0xfe5a('0x17')]);}logger[_0xfe5a('0x14')](_0xfe5a('0x16'),_0x259e8a,_0x50024c[_0xfe5a('0x14')][_0xfe5a('0x17')]);return _0x543619(_0x50024c[_0xfe5a('0x14')][_0xfe5a('0x17')]);}else{logger[_0xfe5a('0xf')](_0xfe5a('0x16'),_0x259e8a,'request\x20sent');_0x543619(_0x50024c[_0xfe5a('0x18')][_0xfe5a('0x17')]);}})['catch'](function(_0x3b0101){logger[_0xfe5a('0x14')](_0xfe5a('0x16'),_0x259e8a,_0x3b0101);_0xb51e47(_0x3b0101);});});}exports['CreateMailMessage']=function(_0x485c15){var _0x3e11ad=this;return new Promise(function(_0x1c6ba7,_0xded538){return db[_0xfe5a('0x19')][_0xfe5a('0x1a')](_0x485c15[_0xfe5a('0x1b')],{'raw':_0x485c15['options']?_0x485c15[_0xfe5a('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xfe5a('0xe')](function(_0x39d825){logger[_0xfe5a('0xf')]('CreateMailMessage',_0x485c15);logger['debug'](_0xfe5a('0x1d'),_0x485c15,JSON[_0xfe5a('0x13')](_0x39d825));_0x1c6ba7(_0x39d825);})['catch'](function(_0x44a0bd){logger[_0xfe5a('0x14')]('CreateMailMessage',_0x44a0bd[_0xfe5a('0x17')],_0x485c15);_0xded538(_0x3e11ad[_0xfe5a('0x14')](0x1f4,_0x44a0bd[_0xfe5a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index ee67e44..63cb781 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 _0xee6e=['./mailMessage.events','remove','update','emit','removeListener','register','length','mailMessage:'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xee6e,0x128));var _0xeee6=function(_0x27936c,_0x10b06c){_0x27936c=_0x27936c-0x0;var _0x58685d=_0xee6e[_0x27936c];return _0x58685d;};'use strict';var MailMessageEvents=require(_0xeee6('0x0'));var events=['save',_0xeee6('0x1'),_0xeee6('0x2')];function createListener(_0x328257,_0x700e0f){return function(_0x5583e7){_0x700e0f[_0xeee6('0x3')](_0x328257,_0x5583e7);};}function removeListener(_0x472978,_0x4705dc){return function(){MailMessageEvents[_0xeee6('0x4')](_0x472978,_0x4705dc);};}exports[_0xeee6('0x5')]=function(_0x484868){for(var _0x459573=0x0,_0x121049=events[_0xeee6('0x6')];_0x459573<_0x121049;_0x459573++){var _0x118a66=events[_0x459573];var _0x2a8227=createListener(_0xeee6('0x7')+_0x118a66,_0x484868);MailMessageEvents['on'](_0x118a66,_0x2a8227);}}; \ No newline at end of file +var _0xda04=['length','mailMessage:','./mailMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x2228e4,_0x268d15){var _0x164e19=function(_0x42af9a){while(--_0x42af9a){_0x2228e4['push'](_0x2228e4['shift']());}};_0x164e19(++_0x268d15);}(_0xda04,0x161));var _0x4da0=function(_0x31cc0e,_0x24ba4c){_0x31cc0e=_0x31cc0e-0x0;var _0x144862=_0xda04[_0x31cc0e];return _0x144862;};'use strict';var MailMessageEvents=require(_0x4da0('0x0'));var events=[_0x4da0('0x1'),_0x4da0('0x2'),_0x4da0('0x3')];function createListener(_0x5a7bcb,_0x581ac0){return function(_0x46b35c){_0x581ac0[_0x4da0('0x4')](_0x5a7bcb,_0x46b35c);};}function removeListener(_0xcaaa50,_0x1ee8af){return function(){MailMessageEvents[_0x4da0('0x5')](_0xcaaa50,_0x1ee8af);};}exports[_0x4da0('0x6')]=function(_0x2b4237){for(var _0x413da8=0x0,_0x2708b6=events[_0x4da0('0x7')];_0x413da8<_0x2708b6;_0x413da8++){var _0x105aff=events[_0x413da8];var _0x378913=createListener(_0x4da0('0x8')+_0x105aff,_0x2b4237);MailMessageEvents['on'](_0x105aff,_0x378913);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 8aa8184..a13169b 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 _0x7bd4=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','create','post','/:id/teams','addTeams','/:id/users','addAgents','update','delete','destroy'];(function(_0x3aea4e,_0x3da357){var _0x2e9db0=function(_0x577203){while(--_0x577203){_0x3aea4e['push'](_0x3aea4e['shift']());}};_0x2e9db0(++_0x3da357);}(_0x7bd4,0x75));var _0x47bd=function(_0x32cd43,_0x2f1a7a){_0x32cd43=_0x32cd43-0x0;var _0x624f11=_0x7bd4[_0x32cd43];return _0x624f11;};'use strict';var multer=require(_0x47bd('0x0'));var util=require(_0x47bd('0x1'));var path=require(_0x47bd('0x2'));var timeout=require(_0x47bd('0x3'));var express=require(_0x47bd('0x4'));var router=express[_0x47bd('0x5')]();var fs_extra=require(_0x47bd('0x6'));var auth=require(_0x47bd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x47bd('0x8'));var controller=require('./mailQueue.controller');router[_0x47bd('0x9')]('/',auth[_0x47bd('0xa')](),controller[_0x47bd('0xb')]);router[_0x47bd('0x9')](_0x47bd('0xc'),auth[_0x47bd('0xa')](),controller[_0x47bd('0xd')]);router[_0x47bd('0x9')](_0x47bd('0xe'),auth['isAuthenticated'](),controller[_0x47bd('0xf')]);router[_0x47bd('0x9')](_0x47bd('0x10'),auth['isAuthenticated'](),controller[_0x47bd('0x11')]);router[_0x47bd('0x9')]('/:id/teams',auth[_0x47bd('0xa')](),controller[_0x47bd('0x12')]);router[_0x47bd('0x9')]('/:id/users',auth[_0x47bd('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x47bd('0x13')]);router[_0x47bd('0x14')](_0x47bd('0x15'),auth[_0x47bd('0xa')](),controller[_0x47bd('0x16')]);router[_0x47bd('0x14')](_0x47bd('0x17'),auth[_0x47bd('0xa')](),controller[_0x47bd('0x18')]);router['put'](_0x47bd('0xe'),auth['isAuthenticated'](),controller[_0x47bd('0x19')]);router[_0x47bd('0x1a')](_0x47bd('0xe'),auth[_0x47bd('0xa')](),controller[_0x47bd('0x1b')]);router[_0x47bd('0x1a')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x47bd('0xa')](),controller['removeAgents']);module[_0x47bd('0x1c')]=router; \ No newline at end of file +var _0xca39=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','/:id/users','create','post','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util'];(function(_0x3d59d3,_0xeb7e85){var _0x207613=function(_0x4a34f1){while(--_0x4a34f1){_0x3d59d3['push'](_0x3d59d3['shift']());}};_0x207613(++_0xeb7e85);}(_0xca39,0x1da));var _0x9ca3=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xca39[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x9ca3('0x0'));var util=require(_0x9ca3('0x1'));var path=require(_0x9ca3('0x2'));var timeout=require(_0x9ca3('0x3'));var express=require(_0x9ca3('0x4'));var router=express[_0x9ca3('0x5')]();var fs_extra=require(_0x9ca3('0x6'));var auth=require(_0x9ca3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9ca3('0x8'));var controller=require(_0x9ca3('0x9'));router[_0x9ca3('0xa')]('/',auth[_0x9ca3('0xb')](),controller[_0x9ca3('0xc')]);router[_0x9ca3('0xa')]('/describe',auth[_0x9ca3('0xb')](),controller[_0x9ca3('0xd')]);router['get'](_0x9ca3('0xe'),auth[_0x9ca3('0xb')](),controller[_0x9ca3('0xf')]);router['get'](_0x9ca3('0x10'),auth[_0x9ca3('0xb')](),controller['getMembers']);router[_0x9ca3('0xa')](_0x9ca3('0x11'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0x9ca3('0x12'),auth[_0x9ca3('0xb')](),controller['getAgents']);router['post']('/',auth[_0x9ca3('0xb')](),controller[_0x9ca3('0x13')]);router[_0x9ca3('0x14')](_0x9ca3('0x11'),auth[_0x9ca3('0xb')](),controller[_0x9ca3('0x15')]);router[_0x9ca3('0x14')](_0x9ca3('0x12'),auth[_0x9ca3('0xb')](),controller[_0x9ca3('0x16')]);router[_0x9ca3('0x17')](_0x9ca3('0xe'),auth[_0x9ca3('0xb')](),controller['update']);router[_0x9ca3('0x18')]('/:id',auth[_0x9ca3('0xb')](),controller['destroy']);router[_0x9ca3('0x18')](_0x9ca3('0x11'),auth[_0x9ca3('0xb')](),controller[_0x9ca3('0x19')]);router['delete'](_0x9ca3('0x12'),auth[_0x9ca3('0xb')](),controller[_0x9ca3('0x1a')]);module[_0x9ca3('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 8cd870b..5d291f8 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 _0x0bd8=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x0bd8,0x1b6));var _0x80bd=function(_0x447ef1,_0x374cd2){_0x447ef1=_0x447ef1-0x0;var _0x3d72ec=_0x0bd8[_0x447ef1];return _0x3d72ec;};'use strict';var Sequelize=require(_0x80bd('0x0'));module[_0x80bd('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x80bd('0x2')]},'timeout':{'type':Sequelize[_0x80bd('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x80bd('0x4')](_0x80bd('0x5'),_0x80bd('0x6'),_0x80bd('0x7'))}}; \ No newline at end of file +var _0x78b8=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x3b9f2a,_0x4d5f64){var _0x3e62c8=function(_0x2fe554){while(--_0x2fe554){_0x3b9f2a['push'](_0x3b9f2a['shift']());}};_0x3e62c8(++_0x4d5f64);}(_0x78b8,0x1a6));var _0x878b=function(_0x1731e1,_0x2d53a7){_0x1731e1=_0x1731e1-0x0;var _0x2070dc=_0x78b8[_0x1731e1];return _0x2070dc;};'use strict';var Sequelize=require(_0x878b('0x0'));module[_0x878b('0x1')]={'name':{'type':Sequelize[_0x878b('0x2')],'unique':_0x878b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x878b('0x2')]},'timeout':{'type':Sequelize[_0x878b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x878b('0x5'),'beepall',_0x878b('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 95c1529..1c139c5 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 _0x5694=['UserMailQueue','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','order','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','value','isEmpty','removeAgents','addAgents','omit','spread','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','index','MailQueue','rawAttributes','fieldName','key','map','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','fields','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne'];(function(_0x529173,_0x2bc9ce){var _0x295bb4=function(_0x178ace){while(--_0x178ace){_0x529173['push'](_0x529173['shift']());}};_0x295bb4(++_0x2bc9ce);}(_0x5694,0x1ca));var _0x4569=function(_0x5a97c0,_0x3fff6c){_0x5a97c0=_0x5a97c0-0x0;var _0x173c00=_0x5694[_0x5a97c0];return _0x173c00;};'use strict';var emlformat=require(_0x4569('0x0'));var rimraf=require(_0x4569('0x1'));var zipdir=require(_0x4569('0x2'));var jsonpatch=require(_0x4569('0x3'));var rp=require('request-promise');var moment=require(_0x4569('0x4'));var BPromise=require(_0x4569('0x5'));var Mustache=require(_0x4569('0x6'));var util=require('util');var path=require(_0x4569('0x7'));var sox=require('sox');var csv=require(_0x4569('0x8'));var ejs=require(_0x4569('0x9'));var fs=require('fs');var fs_extra=require(_0x4569('0xa'));var _=require(_0x4569('0xb'));var squel=require(_0x4569('0xc'));var crypto=require(_0x4569('0xd'));var jsforce=require(_0x4569('0xe'));var deskjs=require(_0x4569('0xf'));var toCsv=require(_0x4569('0x8'));var querystring=require(_0x4569('0x10'));var Papa=require('papaparse');var Redis=require(_0x4569('0x11'));var authService=require(_0x4569('0x12'));var qs=require(_0x4569('0x13'));var as=require(_0x4569('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4569('0x15'));var utils=require(_0x4569('0x16'));var config=require(_0x4569('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4569('0x18'))['db'];config[_0x4569('0x19')]=_['defaults'](config[_0x4569('0x19')],{'host':_0x4569('0x1a'),'port':0x18eb});var socket=require(_0x4569('0x1b'))(new Redis(config[_0x4569('0x19')]));require('./mailQueue.socket')[_0x4569('0x1c')](socket);function respondWithStatusCode(_0x2aa86c,_0x12750a){_0x12750a=_0x12750a||0xcc;return function(_0xaf7037){if(_0xaf7037){return _0x2aa86c['sendStatus'](_0x12750a);}return _0x2aa86c[_0x4569('0x1d')](_0x12750a)['end']();};}function respondWithResult(_0xc94f95,_0x1c4766){_0x1c4766=_0x1c4766||0xc8;return function(_0x43843d){if(_0x43843d){return _0xc94f95['status'](_0x1c4766)[_0x4569('0x1e')](_0x43843d);}};}function respondWithFilteredResult(_0x7ce33e,_0x1e4107){return function(_0x5c8c6b){if(_0x5c8c6b){var _0x3b8cf8=typeof _0x1e4107[_0x4569('0x1f')]===_0x4569('0x20')&&typeof _0x1e4107['limit']===_0x4569('0x20');var _0x1e31a2=_0x5c8c6b[_0x4569('0x21')];var _0x128f67=_0x3b8cf8?0x0:_0x1e4107[_0x4569('0x1f')];var _0x5e649f=_0x3b8cf8?_0x5c8c6b[_0x4569('0x21')]:_0x1e4107[_0x4569('0x1f')]+_0x1e4107[_0x4569('0x22')];var _0x2df1f1;if(_0x5e649f>=_0x1e31a2){_0x5e649f=_0x1e31a2;_0x2df1f1=0xc8;}else{_0x2df1f1=0xce;}_0x7ce33e['status'](_0x2df1f1);return _0x7ce33e[_0x4569('0x23')]('Content-Range',_0x128f67+'-'+_0x5e649f+'/'+_0x1e31a2)[_0x4569('0x1e')](_0x5c8c6b);}return null;};}function patchUpdates(_0x33625d){return function(_0x1b181d){try{jsonpatch[_0x4569('0x24')](_0x1b181d,_0x33625d,!![]);}catch(_0x3100fd){return BPromise[_0x4569('0x25')](_0x3100fd);}return _0x1b181d[_0x4569('0x26')]();};}function saveUpdates(_0x69c082,_0x409e3e){return function(_0x6a139f){if(_0x6a139f){return _0x6a139f[_0x4569('0x27')](_0x69c082)[_0x4569('0x28')](function(_0x3663f3){return _0x3663f3;});}return null;};}function removeEntity(_0x527492,_0x3231d2){return function(_0xb92ce1){if(_0xb92ce1){return _0xb92ce1[_0x4569('0x29')]()['then'](function(){var _0x510df6=_0xb92ce1[_0x4569('0x2a')]({'plain':!![]});var _0x3b3af9='MailQueues';return db[_0x4569('0x2b')]['destroy']({'where':{'type':_0x3b3af9,'resourceId':_0x510df6['id']}})[_0x4569('0x28')](function(){return _0xb92ce1;});})['then'](function(){_0x527492[_0x4569('0x1d')](0xcc)[_0x4569('0x2c')]();});}};}function handleEntityNotFound(_0x3768c0,_0xb5a26c){return function(_0x75e04c){if(!_0x75e04c){_0x3768c0[_0x4569('0x2d')](0x194);}return _0x75e04c;};}function handleError(_0x16bd59,_0x4c5e0e){_0x4c5e0e=_0x4c5e0e||0x1f4;return function(_0x3661d8){logger[_0x4569('0x2e')](_0x3661d8[_0x4569('0x2f')]);if(_0x3661d8[_0x4569('0x30')]){delete _0x3661d8[_0x4569('0x30')];}_0x16bd59[_0x4569('0x1d')](_0x4c5e0e)['send'](_0x3661d8);};}exports[_0x4569('0x31')]=function(_0x5e8450,_0x566ca7){var _0x2c2d6b={},_0x4a2a8c={},_0xfd0e4b={'count':0x0,'rows':[]};var _0x1d2123=_['map'](db[_0x4569('0x32')][_0x4569('0x33')],function(_0x1d2c44){return{'name':_0x1d2c44[_0x4569('0x34')],'type':_0x1d2c44['type'][_0x4569('0x35')]};});_0x4a2a8c['model']=_[_0x4569('0x36')](_0x1d2123,_0x4569('0x30'));_0x4a2a8c[_0x4569('0x37')]=_[_0x4569('0x38')](_0x5e8450[_0x4569('0x37')]);_0x4a2a8c['filters']=_[_0x4569('0x39')](_0x4a2a8c['model'],_0x4a2a8c['query']);_0x2c2d6b['attributes']=_[_0x4569('0x39')](_0x4a2a8c[_0x4569('0x3a')],qs['fields'](_0x5e8450[_0x4569('0x37')]['fields']));_0x2c2d6b['attributes']=_0x2c2d6b[_0x4569('0x3b')][_0x4569('0x3c')]?_0x2c2d6b[_0x4569('0x3b')]:_0x4a2a8c['model'];if(!_0x5e8450[_0x4569('0x37')][_0x4569('0x3d')](_0x4569('0x3e'))){_0x2c2d6b[_0x4569('0x22')]=qs[_0x4569('0x22')](_0x5e8450[_0x4569('0x37')]['limit']);_0x2c2d6b[_0x4569('0x1f')]=qs[_0x4569('0x1f')](_0x5e8450[_0x4569('0x37')][_0x4569('0x1f')]);}_0x2c2d6b['order']=qs[_0x4569('0x3f')](_0x5e8450['query']['sort']);_0x2c2d6b['where']=qs[_0x4569('0x40')](_[_0x4569('0x41')](_0x5e8450[_0x4569('0x37')],_0x4a2a8c[_0x4569('0x40')]),_0x1d2123);if(_0x5e8450['query'][_0x4569('0x42')]){_0x2c2d6b[_0x4569('0x43')]=_[_0x4569('0x44')](_0x2c2d6b[_0x4569('0x43')],{'$or':_['map'](_0x1d2123,function(_0x43e9de){if(_0x43e9de['type']!==_0x4569('0x45')){var _0x76d5e7={};_0x76d5e7[_0x43e9de[_0x4569('0x30')]]={'$like':'%'+_0x5e8450[_0x4569('0x37')][_0x4569('0x42')]+'%'};return _0x76d5e7;}})});}_0x2c2d6b=_[_0x4569('0x44')]({},_0x2c2d6b,_0x5e8450[_0x4569('0x46')]);var _0x388387={'where':_0x2c2d6b[_0x4569('0x43')]};return db[_0x4569('0x32')]['count'](_0x388387)[_0x4569('0x28')](function(_0x477979){_0xfd0e4b[_0x4569('0x21')]=_0x477979;if(_0x5e8450[_0x4569('0x37')]['includeAll']){_0x2c2d6b[_0x4569('0x47')]=[{'all':!![]}];}return db[_0x4569('0x32')][_0x4569('0x48')](_0x2c2d6b);})['then'](function(_0x43625e){_0xfd0e4b[_0x4569('0x49')]=_0x43625e;return _0xfd0e4b;})[_0x4569('0x28')](respondWithFilteredResult(_0x566ca7,_0x2c2d6b))[_0x4569('0x4a')](handleError(_0x566ca7,null));};exports[_0x4569('0x4b')]=function(_0xea30af,_0x309067){var _0x315eb6={'raw':!![],'where':{'id':_0xea30af[_0x4569('0x4c')]['id']}},_0x3c32c2={};_0x3c32c2[_0x4569('0x3a')]=_['keys'](db[_0x4569('0x32')][_0x4569('0x33')]);_0x3c32c2[_0x4569('0x37')]=_[_0x4569('0x38')](_0xea30af[_0x4569('0x37')]);_0x3c32c2[_0x4569('0x40')]=_[_0x4569('0x39')](_0x3c32c2[_0x4569('0x3a')],_0x3c32c2['query']);_0x315eb6[_0x4569('0x3b')]=_[_0x4569('0x39')](_0x3c32c2[_0x4569('0x3a')],qs[_0x4569('0x4d')](_0xea30af[_0x4569('0x37')][_0x4569('0x4d')]));_0x315eb6['attributes']=_0x315eb6[_0x4569('0x3b')][_0x4569('0x3c')]?_0x315eb6[_0x4569('0x3b')]:_0x3c32c2[_0x4569('0x3a')];if(_0xea30af['query']['includeAll']){_0x315eb6[_0x4569('0x47')]=[{'all':!![]}];}_0x315eb6=_[_0x4569('0x44')]({},_0x315eb6,_0xea30af[_0x4569('0x46')]);return db[_0x4569('0x32')]['find'](_0x315eb6)[_0x4569('0x28')](handleEntityNotFound(_0x309067,null))[_0x4569('0x28')](respondWithResult(_0x309067,null))[_0x4569('0x4a')](handleError(_0x309067,null));};exports['create']=function(_0x17d89d,_0x28957d){return db[_0x4569('0x32')][_0x4569('0x4e')](_0x17d89d['body'],{})[_0x4569('0x28')](function(_0x57b2c9){var _0x1885c6=_0x17d89d[_0x4569('0x4f')][_0x4569('0x2a')]({'plain':!![]});if(!_0x1885c6)throw new Error(_0x4569('0x50'));if(_0x1885c6[_0x4569('0x51')]===_0x4569('0x4f')){var _0x303f6e=_0x57b2c9[_0x4569('0x2a')]({'plain':!![]});var _0xf6aa41=_0x4569('0x52');return db['UserProfileSection'][_0x4569('0x53')]({'where':{'name':_0xf6aa41,'userProfileId':_0x1885c6[_0x4569('0x54')]},'raw':!![]})[_0x4569('0x28')](function(_0x40ece5){if(_0x40ece5&&_0x40ece5['autoAssociation']===0x0){return db[_0x4569('0x2b')]['create']({'name':_0x303f6e[_0x4569('0x30')],'resourceId':_0x303f6e['id'],'type':_0x40ece5[_0x4569('0x30')],'sectionId':_0x40ece5['id']},{})['then'](function(){return _0x57b2c9;});}else{return _0x57b2c9;}})[_0x4569('0x4a')](function(_0x40a394){logger[_0x4569('0x2e')](_0x4569('0x55'),_0x40a394);throw _0x40a394;});}return _0x57b2c9;})[_0x4569('0x28')](respondWithResult(_0x28957d,0xc9))[_0x4569('0x4a')](handleError(_0x28957d,null));};exports[_0x4569('0x27')]=function(_0x2a3f9f,_0x36fad9){if(_0x2a3f9f[_0x4569('0x56')]['id']){delete _0x2a3f9f[_0x4569('0x56')]['id'];}return db[_0x4569('0x32')][_0x4569('0x53')]({'where':{'id':_0x2a3f9f[_0x4569('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36fad9,null))[_0x4569('0x28')](saveUpdates(_0x2a3f9f[_0x4569('0x56')],null))[_0x4569('0x28')](respondWithResult(_0x36fad9,null))[_0x4569('0x4a')](handleError(_0x36fad9,null));};exports[_0x4569('0x29')]=function(_0x6237c9,_0x3423f6){return db['MailQueue'][_0x4569('0x53')]({'where':{'id':_0x6237c9[_0x4569('0x4c')]['id']}})[_0x4569('0x28')](handleEntityNotFound(_0x3423f6,null))[_0x4569('0x28')](removeEntity(_0x3423f6,null))[_0x4569('0x4a')](handleError(_0x3423f6,null));};exports['describe']=function(_0x147d15,_0x33b871){return db[_0x4569('0x32')][_0x4569('0x57')]()['then'](respondWithResult(_0x33b871,null))[_0x4569('0x4a')](handleError(_0x33b871,null));};exports[_0x4569('0x58')]=function(_0x55f1de,_0x8a790f,_0x5dd4d2){var _0x278ed2={'raw':!![],'where':{}},_0x188065={},_0x308247;return db[_0x4569('0x32')][_0x4569('0x59')]({'where':{'id':_0x55f1de[_0x4569('0x4c')]['id']}})[_0x4569('0x28')](handleEntityNotFound(_0x8a790f,null))[_0x4569('0x28')](function(_0x5998c6){if(_0x5998c6){_0x308247=_0x5998c6[_0x4569('0x2a')]({'plain':!![]});_0x188065['model']=_[_0x4569('0x38')](db[_0x4569('0x5a')][_0x4569('0x33')]);_0x188065[_0x4569('0x37')]=_[_0x4569('0x38')](_0x55f1de['query']);_0x188065[_0x4569('0x40')]=_[_0x4569('0x39')](_0x188065[_0x4569('0x3a')],_0x188065[_0x4569('0x37')]);_0x278ed2[_0x4569('0x3b')]=_[_0x4569('0x39')](_0x188065[_0x4569('0x3a')],qs[_0x4569('0x4d')](_0x55f1de[_0x4569('0x37')][_0x4569('0x4d')]));_0x278ed2[_0x4569('0x3b')]=_0x278ed2['attributes'][_0x4569('0x3c')]?_0x278ed2[_0x4569('0x3b')]:_0x188065[_0x4569('0x3a')];if(!_0x55f1de[_0x4569('0x37')][_0x4569('0x3d')](_0x4569('0x3e'))){_0x278ed2['limit']=qs['limit'](_0x55f1de[_0x4569('0x37')][_0x4569('0x22')]);_0x278ed2[_0x4569('0x1f')]=qs['offset'](_0x55f1de[_0x4569('0x37')][_0x4569('0x1f')]);}_0x278ed2['order']=qs[_0x4569('0x3f')](_0x55f1de[_0x4569('0x37')][_0x4569('0x3f')]);_0x278ed2['where']=qs[_0x4569('0x40')](_['pick'](_0x55f1de['query'],_0x188065[_0x4569('0x40')]));_0x278ed2['where']['MailQueueId']=_0x5998c6['id'];if(_0x55f1de['query']['filter']){_0x278ed2[_0x4569('0x43')]=_[_0x4569('0x44')](_0x278ed2[_0x4569('0x43')],{'$or':_['map'](_0x278ed2[_0x4569('0x3b')],function(_0x51d179){var _0x4571f3={};_0x4571f3[_0x51d179]={'$like':'%'+_0x55f1de[_0x4569('0x37')]['filter']+'%'};return _0x4571f3;})});}_0x278ed2=_[_0x4569('0x44')]({},_0x278ed2,_0x55f1de['options']);return db[_0x4569('0x5a')]['findAll'](_0x278ed2);}})['then'](function(_0x4d1256){if(_0x4d1256){return db['User'][_0x4569('0x5b')]({'where':{'id':_[_0x4569('0x36')](_0x4d1256,_0x4569('0x5c')),'role':_0x4569('0x5d')},'attributes':['id','name',_0x4569('0x5e'),_0x4569('0x5f'),_0x4569('0x60')]});}})[_0x4569('0x28')](function(_0x370d71){if(_0x370d71){return{'count':_0x370d71['count'],'rows':_['map'](_0x370d71[_0x4569('0x49')],function(_0x51df0c){return{'membername':_0x51df0c[_0x4569('0x30')],'UserId':_0x51df0c['id'],'queue_name':_0x308247[_0x4569('0x30')],'MailQueueId':_0x308247['id'],'interface':util[_0x4569('0x61')](_0x4569('0x62'),_0x4569('0x63'),_0x51df0c[_0x4569('0x30')]),'penalty':0x0,'paused':_0x51df0c[_0x4569('0x5e')],'createdAt':_0x51df0c[_0x4569('0x60')],'updatedAt':_0x51df0c[_0x4569('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4569('0x28')](respondWithFilteredResult(_0x8a790f,_0x278ed2))['catch'](handleError(_0x8a790f,null));};exports[_0x4569('0x64')]=function(_0xcdb000,_0xd89330,_0xd350d3){var _0x47d358={};var _0x12262f={};var _0x2186d0;var _0x35da80;return db[_0x4569('0x32')][_0x4569('0x59')]({'where':{'id':_0xcdb000['params']['id']}})[_0x4569('0x28')](handleEntityNotFound(_0xd89330,null))[_0x4569('0x28')](function(_0x47729f){if(_0x47729f){_0x2186d0=_0x47729f;_0x12262f[_0x4569('0x3a')]=_['keys'](db[_0x4569('0x65')][_0x4569('0x33')]);_0x12262f[_0x4569('0x37')]=_[_0x4569('0x38')](_0xcdb000[_0x4569('0x37')]);_0x12262f[_0x4569('0x40')]=_[_0x4569('0x39')](_0x12262f[_0x4569('0x3a')],_0x12262f[_0x4569('0x37')]);_0x47d358[_0x4569('0x3b')]=_[_0x4569('0x39')](_0x12262f[_0x4569('0x3a')],qs[_0x4569('0x4d')](_0xcdb000[_0x4569('0x37')][_0x4569('0x4d')]));_0x47d358['attributes']=_0x47d358[_0x4569('0x3b')][_0x4569('0x3c')]?_0x47d358[_0x4569('0x3b')]:_0x12262f['model'];_0x47d358[_0x4569('0x66')]=qs[_0x4569('0x3f')](_0xcdb000[_0x4569('0x37')][_0x4569('0x3f')]);_0x47d358[_0x4569('0x43')]=qs[_0x4569('0x40')](_[_0x4569('0x41')](_0xcdb000[_0x4569('0x37')],_0x12262f[_0x4569('0x40')]));if(_0xcdb000['query'][_0x4569('0x42')]){_0x47d358[_0x4569('0x43')]=_[_0x4569('0x44')](_0x47d358[_0x4569('0x43')],{'$or':_[_0x4569('0x36')](_0x47d358[_0x4569('0x3b')],function(_0x4707f6){var _0x956cf8={};_0x956cf8[_0x4707f6]={'$like':'%'+_0xcdb000['query']['filter']+'%'};return _0x956cf8;})});}_0x47d358=_[_0x4569('0x44')]({},_0x47d358,_0xcdb000[_0x4569('0x46')]);return _0x2186d0['getTeams'](_0x47d358);}})[_0x4569('0x28')](function(_0x11cb74){if(_0x11cb74){_0x35da80=_0x11cb74['length'];if(!_0xcdb000[_0x4569('0x37')]['hasOwnProperty'](_0x4569('0x3e'))){_0x47d358[_0x4569('0x22')]=qs[_0x4569('0x22')](_0xcdb000[_0x4569('0x37')][_0x4569('0x22')]);_0x47d358[_0x4569('0x1f')]=qs['offset'](_0xcdb000['query'][_0x4569('0x1f')]);}return _0x2186d0[_0x4569('0x64')](_0x47d358);}})[_0x4569('0x28')](function(_0x2c5fc9){if(_0x2c5fc9){return _0x2c5fc9?{'count':_0x35da80,'rows':_0x2c5fc9}:null;}})[_0x4569('0x28')](respondWithResult(_0xd89330,null))['catch'](handleError(_0xd89330,null));};exports['addTeams']=function(_0x5952da,_0x262f83,_0x4b14c2){var _0x58dd09=_0x5952da['body']['ids'];return db['Team'][_0x4569('0x48')]({'where':{'id':_0x58dd09},'attributes':['id'],'include':[{'model':db[_0x4569('0x67')],'as':_0x4569('0x68'),'attributes':['id',_0x4569('0x30'),_0x4569('0x69'),_0x4569('0x6a'),'interface'],'raw':!![]}]})[_0x4569('0x28')](function(_0x1b7b0b){if(_0x1b7b0b){var _0x2b5895=_[_0x4569('0x6b')](_0x1b7b0b,function(_0x5cf3e5){var _0x430791=_0x5cf3e5[_0x4569('0x2a')]({'plain':!![]});return _0x430791[_0x4569('0x68')];});return db[_0x4569('0x32')][_0x4569('0x53')]({'where':{'id':_0x5952da[_0x4569('0x4c')]['id']}})[_0x4569('0x28')](function(_0x5477b8){return db[_0x4569('0x6c')][_0x4569('0x6d')](function(_0x35a592){return _0x5477b8['addTeams'](_0x58dd09,{'transaction':_0x35a592})['then'](function(){return BPromise[_0x4569('0x6e')](_0x2b5895,function(_0x13d9a4){return db[_0x4569('0x5a')][_0x4569('0x6f')]({'where':{'UserId':_0x13d9a4['id'],'MailQueueId':_0x5952da[_0x4569('0x4c')]['id']},'transaction':_0x35a592});});})[_0x4569('0x28')](function(){_0x2b5895[_0x4569('0x70')](function(_0x641ebc){socket[_0x4569('0x71')]('userMailQueue:save',{'UserId':_0x641ebc['id'],'MailQueueId':_0x5477b8['id']});});});});});}})[_0x4569('0x28')](respondWithStatusCode(_0x262f83,null))[_0x4569('0x4a')](handleError(_0x262f83,null));};exports[_0x4569('0x72')]=function(_0x489213,_0x2f71f3,_0x8c8e8a){return db['Team'][_0x4569('0x48')]({'where':{'id':_0x489213[_0x4569('0x37')][_0x4569('0x73')]},'attributes':['id'],'include':[{'model':db[_0x4569('0x67')],'as':_0x4569('0x68'),'attributes':['id'],'raw':!![]}]})[_0x4569('0x28')](handleEntityNotFound(_0x2f71f3,null))['then'](function(_0x268de9){var _0x3dd4b3=_[_0x4569('0x36')](_0x268de9,'id');var _0x30dc67=[];var _0xf8988d=[];var _0x3403e7=squel['select']();_0x3403e7['field']('tq.TeamId')[_0x4569('0x74')](_0x4569('0x75'),'tq')[_0x4569('0x76')](_0x4569('0x77'),'ut',_0x4569('0x78'))['where'](_0x4569('0x79'),_0x489213[_0x4569('0x4c')]['id']);for(var _0x3cde01=0x0;_0x3cde01<_0x268de9['length'];_0x3cde01+=0x1){let _0x39eec1=_0x268de9[_0x3cde01];for(var _0x46121b=0x0;_0x46121b<_0x39eec1['Agents'][_0x4569('0x3c')];_0x46121b+=0x1){let _0x22d86f=_0x39eec1[_0x4569('0x68')][_0x46121b];var _0x139697=_0x3403e7['clone']();_0x139697[_0x4569('0x43')](_0x4569('0x7a'),_0x22d86f['id']);_0xf8988d[_0x4569('0x7b')](db[_0x4569('0x6c')][_0x4569('0x37')](_0x139697[_0x4569('0x7c')](),{'type':db['sequelize']['QueryTypes'][_0x4569('0x7d')]})['then'](function(_0x1b0629){if(_0x1b0629['length']===0x1){return _0x22d86f['id'];}else{var _0x45d712=_[_0x4569('0x7e')](_['map'](_0x1b0629,_0x4569('0x7f')),function(_0x3577bd){return _[_0x4569('0x80')](_0x3dd4b3,_0x3577bd);});if(_0x45d712){return _0x22d86f['id'];}}}));}}return BPromise['all'](_0xf8988d)[_0x4569('0x28')](function(_0x4e54d2){_0x30dc67=_(_0x30dc67)['union'](_0x4e54d2)['compact']()[_0x4569('0x81')]();return db['MailQueue'][_0x4569('0x53')]({'where':{'id':_0x489213[_0x4569('0x4c')]['id']}})[_0x4569('0x28')](function(_0x59213b){return db[_0x4569('0x6c')][_0x4569('0x6d')](function(_0x5cd112){return _0x59213b['removeTeams'](_0x489213[_0x4569('0x37')]['ids'],{'transaction':_0x5cd112})[_0x4569('0x28')](function(){if(!_[_0x4569('0x82')](_0x30dc67)){return _0x59213b[_0x4569('0x83')](_0x30dc67,{'transaction':_0x5cd112});}})['then'](function(){_0x30dc67[_0x4569('0x70')](function(_0x47d6bb){socket['emit']('userMailQueue:remove',{'UserId':_0x47d6bb,'MailQueueId':_0x59213b['id']});});});});});});})[_0x4569('0x28')](respondWithStatusCode(_0x2f71f3,null))[_0x4569('0x4a')](handleError(_0x2f71f3,null));};exports[_0x4569('0x84')]=function(_0x12c975,_0x32f7fa,_0x4dee34){return db[_0x4569('0x32')][_0x4569('0x53')]({'where':{'id':_0x12c975['params']['id']}})['then'](handleEntityNotFound(_0x32f7fa,null))[_0x4569('0x28')](function(_0x42ede4){if(_0x42ede4){return _0x42ede4[_0x4569('0x84')](_0x12c975[_0x4569('0x56')][_0x4569('0x73')],_[_0x4569('0x85')](_0x12c975[_0x4569('0x56')],[_0x4569('0x73'),'id'])||{})[_0x4569('0x86')](function(_0x33e4bc){for(var _0x42a6be=0x0;_0x42a6be<_0x12c975['body'][_0x4569('0x73')][_0x4569('0x3c')];_0x42a6be+=0x1){socket[_0x4569('0x71')]('userMailQueue:save',{'UserId':Number(_0x12c975[_0x4569('0x56')][_0x4569('0x73')][_0x42a6be]),'MailQueueId':Number(_0x12c975[_0x4569('0x4c')]['id'])});}return _0x33e4bc;});}})[_0x4569('0x28')](respondWithResult(_0x32f7fa,null))[_0x4569('0x4a')](handleError(_0x32f7fa,null));};exports['removeAgents']=function(_0x414f17,_0x29c9a3,_0x17f6b0){return db[_0x4569('0x32')][_0x4569('0x53')]({'where':{'id':_0x414f17[_0x4569('0x4c')]['id']}})[_0x4569('0x28')](handleEntityNotFound(_0x29c9a3,null))[_0x4569('0x28')](function(_0x1513d0){if(_0x1513d0){return _0x1513d0[_0x4569('0x83')](_0x414f17[_0x4569('0x37')][_0x4569('0x73')])[_0x4569('0x28')](function(){if(_['isArray'](_0x414f17[_0x4569('0x37')][_0x4569('0x73')])){for(var _0x4a8f2d=0x0;_0x4a8f2d<_0x414f17[_0x4569('0x37')][_0x4569('0x73')][_0x4569('0x3c')];_0x4a8f2d+=0x1){socket['emit'](_0x4569('0x87'),{'UserId':Number(_0x414f17['query'][_0x4569('0x73')][_0x4a8f2d]),'MailQueueId':Number(_0x414f17[_0x4569('0x4c')]['id'])});}}else{socket[_0x4569('0x71')](_0x4569('0x87'),{'UserId':Number(_0x414f17[_0x4569('0x37')][_0x4569('0x73')]),'MailQueueId':Number(_0x414f17[_0x4569('0x4c')]['id'])});}});}})[_0x4569('0x28')](respondWithStatusCode(_0x29c9a3,null))[_0x4569('0x4a')](handleError(_0x29c9a3,null));};exports['getAgents']=function(_0xf7c29b,_0x527e44,_0x4dafad){var _0x4b8b0a={};var _0x5f4839={};var _0x473b70;var _0x30c679;return db[_0x4569('0x32')][_0x4569('0x59')]({'where':{'id':_0xf7c29b[_0x4569('0x4c')]['id']}})[_0x4569('0x28')](handleEntityNotFound(_0x527e44,null))['then'](function(_0x1e750e){if(_0x1e750e){_0x473b70=_0x1e750e;_0x5f4839[_0x4569('0x3a')]=_[_0x4569('0x38')](db[_0x4569('0x67')][_0x4569('0x33')]);_0x5f4839[_0x4569('0x37')]=_[_0x4569('0x38')](_0xf7c29b[_0x4569('0x37')]);_0x5f4839[_0x4569('0x40')]=_['intersection'](_0x5f4839['model'],_0x5f4839[_0x4569('0x37')]);_0x4b8b0a['attributes']=_['intersection'](_0x5f4839['model'],qs[_0x4569('0x4d')](_0xf7c29b[_0x4569('0x37')][_0x4569('0x4d')]));_0x4b8b0a[_0x4569('0x3b')]=_0x4b8b0a[_0x4569('0x3b')][_0x4569('0x3c')]?_0x4b8b0a['attributes']:_0x5f4839[_0x4569('0x3a')];_0x4b8b0a[_0x4569('0x66')]=qs[_0x4569('0x3f')](_0xf7c29b[_0x4569('0x37')][_0x4569('0x3f')]);_0x4b8b0a[_0x4569('0x43')]=qs[_0x4569('0x40')](_['pick'](_0xf7c29b[_0x4569('0x37')],_0x5f4839['filters']));if(_0xf7c29b['query'][_0x4569('0x42')]){_0x4b8b0a[_0x4569('0x43')]=_[_0x4569('0x44')](_0x4b8b0a['where'],{'$or':_['map'](_0x4b8b0a[_0x4569('0x3b')],function(_0x2b2710){var _0x19894f={};_0x19894f[_0x2b2710]={'$like':'%'+_0xf7c29b[_0x4569('0x37')][_0x4569('0x42')]+'%'};return _0x19894f;})});}_0x4b8b0a=_[_0x4569('0x44')]({},_0x4b8b0a,_0xf7c29b['options']);return _0x473b70[_0x4569('0x88')](_0x4b8b0a);}})[_0x4569('0x28')](function(_0x331269){if(_0x331269){_0x30c679=_0x331269['length'];if(!_0xf7c29b[_0x4569('0x37')]['hasOwnProperty'](_0x4569('0x3e'))){_0x4b8b0a[_0x4569('0x22')]=qs['limit'](_0xf7c29b[_0x4569('0x37')][_0x4569('0x22')]);_0x4b8b0a[_0x4569('0x1f')]=qs['offset'](_0xf7c29b[_0x4569('0x37')][_0x4569('0x1f')]);}return _0x473b70[_0x4569('0x88')](_0x4b8b0a);}})[_0x4569('0x28')](function(_0x5e13f6){if(_0x5e13f6){return _0x5e13f6?{'count':_0x30c679,'rows':_0x5e13f6}:null;}})[_0x4569('0x28')](respondWithResult(_0x527e44,null))[_0x4569('0x4a')](handleError(_0x527e44,null));}; \ No newline at end of file +var _0xb5ed=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','get','UserProfileResource','destroy','then','error','name','send','index','map','MailQueue','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','length','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1559a3,_0x1e4f51){var _0x3a4b87=function(_0x5212d2){while(--_0x5212d2){_0x1559a3['push'](_0x1559a3['shift']());}};_0x3a4b87(++_0x1e4f51);}(_0xb5ed,0x1a4));var _0xdb5e=function(_0x20c804,_0x299f81){_0x20c804=_0x20c804-0x0;var _0x3d60c0=_0xb5ed[_0x20c804];return _0x3d60c0;};'use strict';var emlformat=require(_0xdb5e('0x0'));var rimraf=require(_0xdb5e('0x1'));var zipdir=require(_0xdb5e('0x2'));var jsonpatch=require(_0xdb5e('0x3'));var rp=require('request-promise');var moment=require(_0xdb5e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdb5e('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdb5e('0x6'));var ejs=require(_0xdb5e('0x7'));var fs=require('fs');var fs_extra=require(_0xdb5e('0x8'));var _=require(_0xdb5e('0x9'));var squel=require(_0xdb5e('0xa'));var crypto=require(_0xdb5e('0xb'));var jsforce=require(_0xdb5e('0xc'));var deskjs=require(_0xdb5e('0xd'));var toCsv=require(_0xdb5e('0x6'));var querystring=require(_0xdb5e('0xe'));var Papa=require(_0xdb5e('0xf'));var Redis=require(_0xdb5e('0x10'));var authService=require(_0xdb5e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdb5e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdb5e('0x13'));var utils=require(_0xdb5e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xdb5e('0x15')]=_[_0xdb5e('0x16')](config['redis'],{'host':_0xdb5e('0x17'),'port':0x18eb});var socket=require(_0xdb5e('0x18'))(new Redis(config[_0xdb5e('0x15')]));require(_0xdb5e('0x19'))['register'](socket);function respondWithStatusCode(_0x415387,_0x3a63db){_0x3a63db=_0x3a63db||0xcc;return function(_0x552d59){if(_0x552d59){return _0x415387[_0xdb5e('0x1a')](_0x3a63db);}return _0x415387['status'](_0x3a63db)[_0xdb5e('0x1b')]();};}function respondWithResult(_0x5d1588,_0x252bfa){_0x252bfa=_0x252bfa||0xc8;return function(_0x5caa2a){if(_0x5caa2a){return _0x5d1588[_0xdb5e('0x1c')](_0x252bfa)[_0xdb5e('0x1d')](_0x5caa2a);}};}function respondWithFilteredResult(_0x33c9bb,_0x4571f5){return function(_0x117dda){if(_0x117dda){var _0x65c30a=typeof _0x4571f5[_0xdb5e('0x1e')]===_0xdb5e('0x1f')&&typeof _0x4571f5['limit']===_0xdb5e('0x1f');var _0x3cf173=_0x117dda['count'];var _0x58d15a=_0x65c30a?0x0:_0x4571f5[_0xdb5e('0x1e')];var _0x570a39=_0x65c30a?_0x117dda['count']:_0x4571f5['offset']+_0x4571f5[_0xdb5e('0x20')];var _0x1fc4fb;if(_0x570a39>=_0x3cf173){_0x570a39=_0x3cf173;_0x1fc4fb=0xc8;}else{_0x1fc4fb=0xce;}_0x33c9bb[_0xdb5e('0x1c')](_0x1fc4fb);return _0x33c9bb[_0xdb5e('0x21')](_0xdb5e('0x22'),_0x58d15a+'-'+_0x570a39+'/'+_0x3cf173)[_0xdb5e('0x1d')](_0x117dda);}return null;};}function patchUpdates(_0x2f7a57){return function(_0x3af1b9){try{jsonpatch[_0xdb5e('0x23')](_0x3af1b9,_0x2f7a57,!![]);}catch(_0x478954){return BPromise[_0xdb5e('0x24')](_0x478954);}return _0x3af1b9[_0xdb5e('0x25')]();};}function saveUpdates(_0x56b123,_0x5bf591){return function(_0x41639c){if(_0x41639c){return _0x41639c[_0xdb5e('0x26')](_0x56b123)['then'](function(_0x58ce6c){return _0x58ce6c;});}return null;};}function removeEntity(_0x488819,_0x362ddd){return function(_0x47dda0){if(_0x47dda0){return _0x47dda0['destroy']()['then'](function(){var _0x4f9f03=_0x47dda0[_0xdb5e('0x27')]({'plain':!![]});var _0x1e79df='MailQueues';return db[_0xdb5e('0x28')][_0xdb5e('0x29')]({'where':{'type':_0x1e79df,'resourceId':_0x4f9f03['id']}})[_0xdb5e('0x2a')](function(){return _0x47dda0;});})[_0xdb5e('0x2a')](function(){_0x488819[_0xdb5e('0x1c')](0xcc)[_0xdb5e('0x1b')]();});}};}function handleEntityNotFound(_0x465b76,_0x145076){return function(_0xf7695c){if(!_0xf7695c){_0x465b76[_0xdb5e('0x1a')](0x194);}return _0xf7695c;};}function handleError(_0x6b4001,_0x48e0b3){_0x48e0b3=_0x48e0b3||0x1f4;return function(_0x265f4c){logger[_0xdb5e('0x2b')](_0x265f4c['stack']);if(_0x265f4c['name']){delete _0x265f4c[_0xdb5e('0x2c')];}_0x6b4001[_0xdb5e('0x1c')](_0x48e0b3)[_0xdb5e('0x2d')](_0x265f4c);};}exports[_0xdb5e('0x2e')]=function(_0xe5d7bb,_0x43e712){var _0x3ec438={},_0x1f36ca={},_0x5e5728={'count':0x0,'rows':[]};var _0x192184=_[_0xdb5e('0x2f')](db[_0xdb5e('0x30')][_0xdb5e('0x31')],function(_0x1887dc){return{'name':_0x1887dc['fieldName'],'type':_0x1887dc[_0xdb5e('0x32')]['key']};});_0x1f36ca[_0xdb5e('0x33')]=_[_0xdb5e('0x2f')](_0x192184,_0xdb5e('0x2c'));_0x1f36ca[_0xdb5e('0x34')]=_[_0xdb5e('0x35')](_0xe5d7bb[_0xdb5e('0x34')]);_0x1f36ca[_0xdb5e('0x36')]=_[_0xdb5e('0x37')](_0x1f36ca[_0xdb5e('0x33')],_0x1f36ca['query']);_0x3ec438['attributes']=_['intersection'](_0x1f36ca[_0xdb5e('0x33')],qs[_0xdb5e('0x38')](_0xe5d7bb[_0xdb5e('0x34')][_0xdb5e('0x38')]));_0x3ec438[_0xdb5e('0x39')]=_0x3ec438[_0xdb5e('0x39')]['length']?_0x3ec438['attributes']:_0x1f36ca['model'];if(!_0xe5d7bb[_0xdb5e('0x34')][_0xdb5e('0x3a')](_0xdb5e('0x3b'))){_0x3ec438[_0xdb5e('0x20')]=qs[_0xdb5e('0x20')](_0xe5d7bb[_0xdb5e('0x34')][_0xdb5e('0x20')]);_0x3ec438['offset']=qs['offset'](_0xe5d7bb[_0xdb5e('0x34')]['offset']);}_0x3ec438[_0xdb5e('0x3c')]=qs[_0xdb5e('0x3d')](_0xe5d7bb[_0xdb5e('0x34')]['sort']);_0x3ec438[_0xdb5e('0x3e')]=qs['filters'](_[_0xdb5e('0x3f')](_0xe5d7bb[_0xdb5e('0x34')],_0x1f36ca['filters']),_0x192184);if(_0xe5d7bb[_0xdb5e('0x34')]['filter']){_0x3ec438[_0xdb5e('0x3e')]=_[_0xdb5e('0x40')](_0x3ec438['where'],{'$or':_['map'](_0x192184,function(_0x47c223){if(_0x47c223[_0xdb5e('0x32')]!==_0xdb5e('0x41')){var _0x76db4d={};_0x76db4d[_0x47c223[_0xdb5e('0x2c')]]={'$like':'%'+_0xe5d7bb['query'][_0xdb5e('0x42')]+'%'};return _0x76db4d;}})});}_0x3ec438=_[_0xdb5e('0x40')]({},_0x3ec438,_0xe5d7bb[_0xdb5e('0x43')]);var _0x5b56a3={'where':_0x3ec438[_0xdb5e('0x3e')]};return db['MailQueue']['count'](_0x5b56a3)[_0xdb5e('0x2a')](function(_0x1176c5){_0x5e5728[_0xdb5e('0x44')]=_0x1176c5;if(_0xe5d7bb[_0xdb5e('0x34')][_0xdb5e('0x45')]){_0x3ec438[_0xdb5e('0x46')]=[{'all':!![]}];}return db[_0xdb5e('0x30')][_0xdb5e('0x47')](_0x3ec438);})['then'](function(_0x2c85e1){_0x5e5728[_0xdb5e('0x48')]=_0x2c85e1;return _0x5e5728;})[_0xdb5e('0x2a')](respondWithFilteredResult(_0x43e712,_0x3ec438))[_0xdb5e('0x49')](handleError(_0x43e712,null));};exports[_0xdb5e('0x4a')]=function(_0x107ff7,_0x2120cd){var _0x356a4d={'raw':!![],'where':{'id':_0x107ff7[_0xdb5e('0x4b')]['id']}},_0x39ae82={};_0x39ae82['model']=_[_0xdb5e('0x35')](db[_0xdb5e('0x30')]['rawAttributes']);_0x39ae82['query']=_['keys'](_0x107ff7[_0xdb5e('0x34')]);_0x39ae82[_0xdb5e('0x36')]=_[_0xdb5e('0x37')](_0x39ae82[_0xdb5e('0x33')],_0x39ae82[_0xdb5e('0x34')]);_0x356a4d[_0xdb5e('0x39')]=_['intersection'](_0x39ae82[_0xdb5e('0x33')],qs[_0xdb5e('0x38')](_0x107ff7[_0xdb5e('0x34')][_0xdb5e('0x38')]));_0x356a4d[_0xdb5e('0x39')]=_0x356a4d[_0xdb5e('0x39')]['length']?_0x356a4d[_0xdb5e('0x39')]:_0x39ae82[_0xdb5e('0x33')];if(_0x107ff7[_0xdb5e('0x34')]['includeAll']){_0x356a4d['include']=[{'all':!![]}];}_0x356a4d=_[_0xdb5e('0x40')]({},_0x356a4d,_0x107ff7[_0xdb5e('0x43')]);return db[_0xdb5e('0x30')][_0xdb5e('0x4c')](_0x356a4d)[_0xdb5e('0x2a')](handleEntityNotFound(_0x2120cd,null))[_0xdb5e('0x2a')](respondWithResult(_0x2120cd,null))[_0xdb5e('0x49')](handleError(_0x2120cd,null));};exports[_0xdb5e('0x4d')]=function(_0x169246,_0x19e016){return db[_0xdb5e('0x30')]['create'](_0x169246['body'],{})[_0xdb5e('0x2a')](function(_0x17a33c){var _0x2fb35b=_0x169246[_0xdb5e('0x4e')][_0xdb5e('0x27')]({'plain':!![]});if(!_0x2fb35b)throw new Error(_0xdb5e('0x4f'));if(_0x2fb35b[_0xdb5e('0x50')]===_0xdb5e('0x4e')){var _0x308c04=_0x17a33c[_0xdb5e('0x27')]({'plain':!![]});var _0x5eeee2=_0xdb5e('0x51');return db[_0xdb5e('0x52')]['find']({'where':{'name':_0x5eeee2,'userProfileId':_0x2fb35b[_0xdb5e('0x53')]},'raw':!![]})[_0xdb5e('0x2a')](function(_0x3bac8e){if(_0x3bac8e&&_0x3bac8e[_0xdb5e('0x54')]===0x0){return db[_0xdb5e('0x28')][_0xdb5e('0x4d')]({'name':_0x308c04[_0xdb5e('0x2c')],'resourceId':_0x308c04['id'],'type':_0x3bac8e[_0xdb5e('0x2c')],'sectionId':_0x3bac8e['id']},{})[_0xdb5e('0x2a')](function(){return _0x17a33c;});}else{return _0x17a33c;}})[_0xdb5e('0x49')](function(_0x5c34b4){logger[_0xdb5e('0x2b')](_0xdb5e('0x55'),_0x5c34b4);throw _0x5c34b4;});}return _0x17a33c;})[_0xdb5e('0x2a')](respondWithResult(_0x19e016,0xc9))[_0xdb5e('0x49')](handleError(_0x19e016,null));};exports[_0xdb5e('0x26')]=function(_0x4f2581,_0x1409cf){if(_0x4f2581[_0xdb5e('0x56')]['id']){delete _0x4f2581[_0xdb5e('0x56')]['id'];}return db[_0xdb5e('0x30')][_0xdb5e('0x4c')]({'where':{'id':_0x4f2581[_0xdb5e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1409cf,null))['then'](saveUpdates(_0x4f2581['body'],null))[_0xdb5e('0x2a')](respondWithResult(_0x1409cf,null))[_0xdb5e('0x49')](handleError(_0x1409cf,null));};exports[_0xdb5e('0x29')]=function(_0x2cff0a,_0x15dfa4){return db[_0xdb5e('0x30')][_0xdb5e('0x4c')]({'where':{'id':_0x2cff0a['params']['id']}})['then'](handleEntityNotFound(_0x15dfa4,null))[_0xdb5e('0x2a')](removeEntity(_0x15dfa4,null))[_0xdb5e('0x49')](handleError(_0x15dfa4,null));};exports[_0xdb5e('0x57')]=function(_0x4ad721,_0x39727a){return db[_0xdb5e('0x30')][_0xdb5e('0x57')]()[_0xdb5e('0x2a')](respondWithResult(_0x39727a,null))[_0xdb5e('0x49')](handleError(_0x39727a,null));};exports[_0xdb5e('0x58')]=function(_0x492e14,_0x4a32c0,_0x84ec96){var _0x3b9476={'raw':!![],'where':{}},_0xc1288e={},_0x263be8;return db[_0xdb5e('0x30')]['findOne']({'where':{'id':_0x492e14[_0xdb5e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4a32c0,null))[_0xdb5e('0x2a')](function(_0x3fe724){if(_0x3fe724){_0x263be8=_0x3fe724[_0xdb5e('0x27')]({'plain':!![]});_0xc1288e[_0xdb5e('0x33')]=_['keys'](db['UserMailQueue']['rawAttributes']);_0xc1288e[_0xdb5e('0x34')]=_[_0xdb5e('0x35')](_0x492e14['query']);_0xc1288e[_0xdb5e('0x36')]=_[_0xdb5e('0x37')](_0xc1288e[_0xdb5e('0x33')],_0xc1288e[_0xdb5e('0x34')]);_0x3b9476[_0xdb5e('0x39')]=_[_0xdb5e('0x37')](_0xc1288e[_0xdb5e('0x33')],qs['fields'](_0x492e14[_0xdb5e('0x34')][_0xdb5e('0x38')]));_0x3b9476[_0xdb5e('0x39')]=_0x3b9476[_0xdb5e('0x39')][_0xdb5e('0x59')]?_0x3b9476[_0xdb5e('0x39')]:_0xc1288e[_0xdb5e('0x33')];if(!_0x492e14['query'][_0xdb5e('0x3a')]('nolimit')){_0x3b9476[_0xdb5e('0x20')]=qs[_0xdb5e('0x20')](_0x492e14[_0xdb5e('0x34')][_0xdb5e('0x20')]);_0x3b9476['offset']=qs['offset'](_0x492e14[_0xdb5e('0x34')]['offset']);}_0x3b9476['order']=qs[_0xdb5e('0x3d')](_0x492e14[_0xdb5e('0x34')]['sort']);_0x3b9476[_0xdb5e('0x3e')]=qs[_0xdb5e('0x36')](_[_0xdb5e('0x3f')](_0x492e14[_0xdb5e('0x34')],_0xc1288e['filters']));_0x3b9476['where'][_0xdb5e('0x5a')]=_0x3fe724['id'];if(_0x492e14[_0xdb5e('0x34')][_0xdb5e('0x42')]){_0x3b9476[_0xdb5e('0x3e')]=_[_0xdb5e('0x40')](_0x3b9476[_0xdb5e('0x3e')],{'$or':_[_0xdb5e('0x2f')](_0x3b9476[_0xdb5e('0x39')],function(_0x52f52b){var _0xed9e16={};_0xed9e16[_0x52f52b]={'$like':'%'+_0x492e14[_0xdb5e('0x34')][_0xdb5e('0x42')]+'%'};return _0xed9e16;})});}_0x3b9476=_[_0xdb5e('0x40')]({},_0x3b9476,_0x492e14[_0xdb5e('0x43')]);return db[_0xdb5e('0x5b')][_0xdb5e('0x47')](_0x3b9476);}})[_0xdb5e('0x2a')](function(_0x46f1f1){if(_0x46f1f1){return db[_0xdb5e('0x5c')][_0xdb5e('0x5d')]({'where':{'id':_['map'](_0x46f1f1,_0xdb5e('0x5e')),'role':_0xdb5e('0x5f')},'attributes':['id',_0xdb5e('0x2c'),_0xdb5e('0x60'),_0xdb5e('0x61'),_0xdb5e('0x62')]});}})[_0xdb5e('0x2a')](function(_0x3a65d9){if(_0x3a65d9){return{'count':_0x3a65d9[_0xdb5e('0x44')],'rows':_['map'](_0x3a65d9[_0xdb5e('0x48')],function(_0x38ee64){return{'membername':_0x38ee64[_0xdb5e('0x2c')],'UserId':_0x38ee64['id'],'queue_name':_0x263be8[_0xdb5e('0x2c')],'MailQueueId':_0x263be8['id'],'interface':util['format'](_0xdb5e('0x63'),_0xdb5e('0x64'),_0x38ee64[_0xdb5e('0x2c')]),'penalty':0x0,'paused':_0x38ee64['mailPause'],'createdAt':_0x38ee64[_0xdb5e('0x62')],'updatedAt':_0x38ee64[_0xdb5e('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4a32c0,_0x3b9476))[_0xdb5e('0x49')](handleError(_0x4a32c0,null));};exports[_0xdb5e('0x65')]=function(_0x1d6675,_0x40ec4d,_0x554134){var _0x13e49e={};var _0x3127ec={};var _0x55a133;var _0x1511c6;return db[_0xdb5e('0x30')][_0xdb5e('0x66')]({'where':{'id':_0x1d6675[_0xdb5e('0x4b')]['id']}})[_0xdb5e('0x2a')](handleEntityNotFound(_0x40ec4d,null))[_0xdb5e('0x2a')](function(_0x10d009){if(_0x10d009){_0x55a133=_0x10d009;_0x3127ec['model']=_[_0xdb5e('0x35')](db[_0xdb5e('0x67')][_0xdb5e('0x31')]);_0x3127ec[_0xdb5e('0x34')]=_[_0xdb5e('0x35')](_0x1d6675[_0xdb5e('0x34')]);_0x3127ec['filters']=_['intersection'](_0x3127ec[_0xdb5e('0x33')],_0x3127ec[_0xdb5e('0x34')]);_0x13e49e[_0xdb5e('0x39')]=_[_0xdb5e('0x37')](_0x3127ec[_0xdb5e('0x33')],qs[_0xdb5e('0x38')](_0x1d6675[_0xdb5e('0x34')][_0xdb5e('0x38')]));_0x13e49e[_0xdb5e('0x39')]=_0x13e49e['attributes'][_0xdb5e('0x59')]?_0x13e49e[_0xdb5e('0x39')]:_0x3127ec[_0xdb5e('0x33')];_0x13e49e[_0xdb5e('0x3c')]=qs[_0xdb5e('0x3d')](_0x1d6675[_0xdb5e('0x34')][_0xdb5e('0x3d')]);_0x13e49e[_0xdb5e('0x3e')]=qs['filters'](_[_0xdb5e('0x3f')](_0x1d6675[_0xdb5e('0x34')],_0x3127ec[_0xdb5e('0x36')]));if(_0x1d6675[_0xdb5e('0x34')][_0xdb5e('0x42')]){_0x13e49e['where']=_[_0xdb5e('0x40')](_0x13e49e['where'],{'$or':_[_0xdb5e('0x2f')](_0x13e49e[_0xdb5e('0x39')],function(_0x1dacf4){var _0x5c4fe4={};_0x5c4fe4[_0x1dacf4]={'$like':'%'+_0x1d6675['query'][_0xdb5e('0x42')]+'%'};return _0x5c4fe4;})});}_0x13e49e=_[_0xdb5e('0x40')]({},_0x13e49e,_0x1d6675[_0xdb5e('0x43')]);return _0x55a133[_0xdb5e('0x65')](_0x13e49e);}})[_0xdb5e('0x2a')](function(_0x2c1ae3){if(_0x2c1ae3){_0x1511c6=_0x2c1ae3[_0xdb5e('0x59')];if(!_0x1d6675[_0xdb5e('0x34')][_0xdb5e('0x3a')](_0xdb5e('0x3b'))){_0x13e49e[_0xdb5e('0x20')]=qs['limit'](_0x1d6675['query'][_0xdb5e('0x20')]);_0x13e49e[_0xdb5e('0x1e')]=qs['offset'](_0x1d6675[_0xdb5e('0x34')][_0xdb5e('0x1e')]);}return _0x55a133[_0xdb5e('0x65')](_0x13e49e);}})['then'](function(_0x22a84c){if(_0x22a84c){return _0x22a84c?{'count':_0x1511c6,'rows':_0x22a84c}:null;}})[_0xdb5e('0x2a')](respondWithResult(_0x40ec4d,null))[_0xdb5e('0x49')](handleError(_0x40ec4d,null));};exports[_0xdb5e('0x68')]=function(_0x5479a8,_0x5dabd5,_0x3785bf){var _0x214753=_0x5479a8[_0xdb5e('0x56')][_0xdb5e('0x69')];return db['Team'][_0xdb5e('0x47')]({'where':{'id':_0x214753},'attributes':['id'],'include':[{'model':db[_0xdb5e('0x5c')],'as':_0xdb5e('0x6a'),'attributes':['id',_0xdb5e('0x2c'),_0xdb5e('0x6b'),_0xdb5e('0x6c'),_0xdb5e('0x6d')],'raw':!![]}]})['then'](function(_0x376d82){if(_0x376d82){var _0x5a58a6=_['flatMap'](_0x376d82,function(_0x2ae39f){var _0x5d3ea4=_0x2ae39f[_0xdb5e('0x27')]({'plain':!![]});return _0x5d3ea4[_0xdb5e('0x6a')];});return db[_0xdb5e('0x30')][_0xdb5e('0x4c')]({'where':{'id':_0x5479a8[_0xdb5e('0x4b')]['id']}})['then'](function(_0x50d352){return db['sequelize'][_0xdb5e('0x6e')](function(_0x23ad60){return _0x50d352[_0xdb5e('0x68')](_0x214753,{'transaction':_0x23ad60})[_0xdb5e('0x2a')](function(){return BPromise[_0xdb5e('0x6f')](_0x5a58a6,function(_0x1f392e){return db['UserMailQueue'][_0xdb5e('0x70')]({'where':{'UserId':_0x1f392e['id'],'MailQueueId':_0x5479a8[_0xdb5e('0x4b')]['id']},'transaction':_0x23ad60});});})[_0xdb5e('0x2a')](function(){_0x5a58a6[_0xdb5e('0x71')](function(_0x2d47bc){socket[_0xdb5e('0x72')](_0xdb5e('0x73'),{'UserId':_0x2d47bc['id'],'MailQueueId':_0x50d352['id']});});});});});}})[_0xdb5e('0x2a')](respondWithStatusCode(_0x5dabd5,null))[_0xdb5e('0x49')](handleError(_0x5dabd5,null));};exports[_0xdb5e('0x74')]=function(_0x2db791,_0x4dffcf,_0x342097){return db[_0xdb5e('0x67')][_0xdb5e('0x47')]({'where':{'id':_0x2db791[_0xdb5e('0x34')][_0xdb5e('0x69')]},'attributes':['id'],'include':[{'model':db[_0xdb5e('0x5c')],'as':_0xdb5e('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xdb5e('0x2a')](handleEntityNotFound(_0x4dffcf,null))[_0xdb5e('0x2a')](function(_0x6b03c5){var _0xc6c730=_[_0xdb5e('0x2f')](_0x6b03c5,'id');var _0x582e0a=[];var _0x4a7700=[];var _0xaba9c=squel[_0xdb5e('0x75')]();_0xaba9c[_0xdb5e('0x76')](_0xdb5e('0x77'))['from'](_0xdb5e('0x78'),'tq')['join'](_0xdb5e('0x79'),'ut',_0xdb5e('0x7a'))['where'](_0xdb5e('0x7b'),_0x2db791[_0xdb5e('0x4b')]['id']);for(var _0x4e3d99=0x0;_0x4e3d99<_0x6b03c5[_0xdb5e('0x59')];_0x4e3d99+=0x1){let _0x19bd66=_0x6b03c5[_0x4e3d99];for(var _0x35dca4=0x0;_0x35dca4<_0x19bd66['Agents']['length'];_0x35dca4+=0x1){let _0x51c592=_0x19bd66[_0xdb5e('0x6a')][_0x35dca4];var _0x101129=_0xaba9c[_0xdb5e('0x7c')]();_0x101129[_0xdb5e('0x3e')](_0xdb5e('0x7d'),_0x51c592['id']);_0x4a7700[_0xdb5e('0x7e')](db['sequelize'][_0xdb5e('0x34')](_0x101129['toString'](),{'type':db[_0xdb5e('0x7f')][_0xdb5e('0x80')][_0xdb5e('0x81')]})[_0xdb5e('0x2a')](function(_0x5abd2f){if(_0x5abd2f[_0xdb5e('0x59')]===0x1){return _0x51c592['id'];}else{var _0x36016d=_[_0xdb5e('0x82')](_[_0xdb5e('0x2f')](_0x5abd2f,_0xdb5e('0x83')),function(_0x42507e){return _[_0xdb5e('0x84')](_0xc6c730,_0x42507e);});if(_0x36016d){return _0x51c592['id'];}}}));}}return BPromise[_0xdb5e('0x85')](_0x4a7700)[_0xdb5e('0x2a')](function(_0x115cf1){_0x582e0a=_(_0x582e0a)[_0xdb5e('0x86')](_0x115cf1)[_0xdb5e('0x87')]()[_0xdb5e('0x88')]();return db[_0xdb5e('0x30')]['find']({'where':{'id':_0x2db791[_0xdb5e('0x4b')]['id']}})[_0xdb5e('0x2a')](function(_0x576117){return db[_0xdb5e('0x7f')]['transaction'](function(_0x5d5e98){return _0x576117[_0xdb5e('0x74')](_0x2db791[_0xdb5e('0x34')][_0xdb5e('0x69')],{'transaction':_0x5d5e98})[_0xdb5e('0x2a')](function(){if(!_[_0xdb5e('0x89')](_0x582e0a)){return _0x576117[_0xdb5e('0x8a')](_0x582e0a,{'transaction':_0x5d5e98});}})[_0xdb5e('0x2a')](function(){_0x582e0a[_0xdb5e('0x71')](function(_0x53dcdf){socket['emit']('userMailQueue:remove',{'UserId':_0x53dcdf,'MailQueueId':_0x576117['id']});});});});});});})['then'](respondWithStatusCode(_0x4dffcf,null))['catch'](handleError(_0x4dffcf,null));};exports[_0xdb5e('0x8b')]=function(_0x31568e,_0x18f458,_0x4b2a60){return db[_0xdb5e('0x30')]['find']({'where':{'id':_0x31568e[_0xdb5e('0x4b')]['id']}})[_0xdb5e('0x2a')](handleEntityNotFound(_0x18f458,null))[_0xdb5e('0x2a')](function(_0x571f0b){if(_0x571f0b){return _0x571f0b[_0xdb5e('0x8b')](_0x31568e[_0xdb5e('0x56')][_0xdb5e('0x69')],_[_0xdb5e('0x8c')](_0x31568e[_0xdb5e('0x56')],[_0xdb5e('0x69'),'id'])||{})[_0xdb5e('0x8d')](function(_0x465d94){for(var _0x53248d=0x0;_0x53248d<_0x31568e[_0xdb5e('0x56')][_0xdb5e('0x69')][_0xdb5e('0x59')];_0x53248d+=0x1){socket['emit'](_0xdb5e('0x73'),{'UserId':Number(_0x31568e[_0xdb5e('0x56')][_0xdb5e('0x69')][_0x53248d]),'MailQueueId':Number(_0x31568e[_0xdb5e('0x4b')]['id'])});}return _0x465d94;});}})['then'](respondWithResult(_0x18f458,null))['catch'](handleError(_0x18f458,null));};exports[_0xdb5e('0x8a')]=function(_0x2af38d,_0x37a2da,_0x40a818){return db[_0xdb5e('0x30')][_0xdb5e('0x4c')]({'where':{'id':_0x2af38d[_0xdb5e('0x4b')]['id']}})[_0xdb5e('0x2a')](handleEntityNotFound(_0x37a2da,null))[_0xdb5e('0x2a')](function(_0x3a8e2b){if(_0x3a8e2b){return _0x3a8e2b[_0xdb5e('0x8a')](_0x2af38d[_0xdb5e('0x34')][_0xdb5e('0x69')])[_0xdb5e('0x2a')](function(){if(_['isArray'](_0x2af38d[_0xdb5e('0x34')][_0xdb5e('0x69')])){for(var _0x12da85=0x0;_0x12da85<_0x2af38d[_0xdb5e('0x34')]['ids']['length'];_0x12da85+=0x1){socket['emit'](_0xdb5e('0x8e'),{'UserId':Number(_0x2af38d['query'][_0xdb5e('0x69')][_0x12da85]),'MailQueueId':Number(_0x2af38d[_0xdb5e('0x4b')]['id'])});}}else{socket[_0xdb5e('0x72')](_0xdb5e('0x8e'),{'UserId':Number(_0x2af38d['query'][_0xdb5e('0x69')]),'MailQueueId':Number(_0x2af38d[_0xdb5e('0x4b')]['id'])});}});}})[_0xdb5e('0x2a')](respondWithStatusCode(_0x37a2da,null))[_0xdb5e('0x49')](handleError(_0x37a2da,null));};exports[_0xdb5e('0x8f')]=function(_0x372feb,_0x14b736,_0x488f79){var _0xaf0f78={};var _0x465c14={};var _0x4a5079;var _0x4d6e4a;return db[_0xdb5e('0x30')][_0xdb5e('0x66')]({'where':{'id':_0x372feb[_0xdb5e('0x4b')]['id']}})[_0xdb5e('0x2a')](handleEntityNotFound(_0x14b736,null))[_0xdb5e('0x2a')](function(_0x229af8){if(_0x229af8){_0x4a5079=_0x229af8;_0x465c14['model']=_[_0xdb5e('0x35')](db['User'][_0xdb5e('0x31')]);_0x465c14[_0xdb5e('0x34')]=_[_0xdb5e('0x35')](_0x372feb[_0xdb5e('0x34')]);_0x465c14[_0xdb5e('0x36')]=_[_0xdb5e('0x37')](_0x465c14['model'],_0x465c14[_0xdb5e('0x34')]);_0xaf0f78[_0xdb5e('0x39')]=_[_0xdb5e('0x37')](_0x465c14['model'],qs[_0xdb5e('0x38')](_0x372feb[_0xdb5e('0x34')][_0xdb5e('0x38')]));_0xaf0f78['attributes']=_0xaf0f78['attributes'][_0xdb5e('0x59')]?_0xaf0f78[_0xdb5e('0x39')]:_0x465c14[_0xdb5e('0x33')];_0xaf0f78[_0xdb5e('0x3c')]=qs['sort'](_0x372feb[_0xdb5e('0x34')][_0xdb5e('0x3d')]);_0xaf0f78[_0xdb5e('0x3e')]=qs['filters'](_[_0xdb5e('0x3f')](_0x372feb[_0xdb5e('0x34')],_0x465c14[_0xdb5e('0x36')]));if(_0x372feb[_0xdb5e('0x34')][_0xdb5e('0x42')]){_0xaf0f78['where']=_[_0xdb5e('0x40')](_0xaf0f78['where'],{'$or':_[_0xdb5e('0x2f')](_0xaf0f78[_0xdb5e('0x39')],function(_0x531fd6){var _0x2b8085={};_0x2b8085[_0x531fd6]={'$like':'%'+_0x372feb[_0xdb5e('0x34')][_0xdb5e('0x42')]+'%'};return _0x2b8085;})});}_0xaf0f78=_['merge']({},_0xaf0f78,_0x372feb['options']);return _0x4a5079['getAgents'](_0xaf0f78);}})['then'](function(_0x51d34b){if(_0x51d34b){_0x4d6e4a=_0x51d34b[_0xdb5e('0x59')];if(!_0x372feb[_0xdb5e('0x34')][_0xdb5e('0x3a')]('nolimit')){_0xaf0f78[_0xdb5e('0x20')]=qs[_0xdb5e('0x20')](_0x372feb[_0xdb5e('0x34')]['limit']);_0xaf0f78[_0xdb5e('0x1e')]=qs['offset'](_0x372feb[_0xdb5e('0x34')]['offset']);}return _0x4a5079['getAgents'](_0xaf0f78);}})[_0xdb5e('0x2a')](function(_0x133f39){if(_0x133f39){return _0x133f39?{'count':_0x4d6e4a,'rows':_0x133f39}:null;}})[_0xdb5e('0x2a')](respondWithResult(_0x14b736,null))[_0xdb5e('0x49')](handleError(_0x14b736,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 08734b5..7b9f53f 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 _0xc1f7=['MailQueue','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1f7,0x187));var _0x7c1f=function(_0x5a201b,_0x23582d){_0x5a201b=_0x5a201b-0x0;var _0x42f4e0=_0xc1f7[_0x5a201b];return _0x42f4e0;};'use strict';var EventEmitter=require(_0x7c1f('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x7c1f('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x7c1f('0x2')](0x0);var events={'afterCreate':_0x7c1f('0x3'),'afterUpdate':_0x7c1f('0x4'),'afterDestroy':_0x7c1f('0x5')};function emitEvent(_0x3a8108){return function(_0x5145d0,_0x5738b6,_0x57a01b){MailQueueEvents[_0x7c1f('0x6')](_0x3a8108+':'+_0x5145d0['id'],_0x5145d0);MailQueueEvents[_0x7c1f('0x6')](_0x3a8108,_0x5145d0);_0x57a01b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x7c1f('0x7')]=MailQueueEvents; \ No newline at end of file +var _0xe941=['../../mysqldb','MailQueue','setMaxListeners','save','remove','hasOwnProperty','hook','exports','events'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0xe941,0x86));var _0x1e94=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xe941[_0x2b4411];return _0x8e41ef;};'use strict';var EventEmitter=require(_0x1e94('0x0'));var MailQueue=require(_0x1e94('0x1'))['db'][_0x1e94('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x1e94('0x3')](0x0);var events={'afterCreate':_0x1e94('0x4'),'afterUpdate':'update','afterDestroy':_0x1e94('0x5')};function emitEvent(_0x357054){return function(_0x90ab12,_0x3cf62b,_0xf7d2c8){MailQueueEvents['emit'](_0x357054+':'+_0x90ab12['id'],_0x90ab12);MailQueueEvents['emit'](_0x357054,_0x90ab12);_0xf7d2c8(null);};}for(var e in events){if(events[_0x1e94('0x6')](e)){var event=events[e];MailQueue[_0x1e94('0x7')](e,emitEvent(event));}}module[_0x1e94('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 208ca47..2f493b0 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 _0xe0c4=['moment','bluebird','request-promise','path','rimraf','./mailQueue.attributes','define','MailQueue','mail_queues','api'];(function(_0x413b4d,_0xa3459c){var _0x8b810a=function(_0x22d441){while(--_0x22d441){_0x413b4d['push'](_0x413b4d['shift']());}};_0x8b810a(++_0xa3459c);}(_0xe0c4,0x117));var _0x4e0c=function(_0x46de08,_0x350a03){_0x46de08=_0x46de08-0x0;var _0x11dcff=_0xe0c4[_0x46de08];return _0x11dcff;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4e0c('0x0'));var moment=require(_0x4e0c('0x1'));var BPromise=require(_0x4e0c('0x2'));var rp=require(_0x4e0c('0x3'));var fs=require('fs');var path=require(_0x4e0c('0x4'));var rimraf=require(_0x4e0c('0x5'));var config=require('../../config/environment');var attributes=require(_0x4e0c('0x6'));module['exports']=function(_0x33c139,_0xf2e0cc){return _0x33c139[_0x4e0c('0x7')](_0x4e0c('0x8'),attributes,{'tableName':_0x4e0c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcbd9=['../../config/logger','api','moment','request-promise','path','rimraf','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util'];(function(_0x326c54,_0x219c01){var _0x5516f5=function(_0x14e78){while(--_0x14e78){_0x326c54['push'](_0x326c54['shift']());}};_0x5516f5(++_0x219c01);}(_0xcbd9,0xe8));var _0x9cbd=function(_0x4b2dae,_0x4dcc89){_0x4b2dae=_0x4b2dae-0x0;var _0x51e716=_0xcbd9[_0x4b2dae];return _0x51e716;};'use strict';var _=require(_0x9cbd('0x0'));var util=require(_0x9cbd('0x1'));var logger=require(_0x9cbd('0x2'))(_0x9cbd('0x3'));var moment=require(_0x9cbd('0x4'));var BPromise=require('bluebird');var rp=require(_0x9cbd('0x5'));var fs=require('fs');var path=require(_0x9cbd('0x6'));var rimraf=require(_0x9cbd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9cbd('0x8'));module[_0x9cbd('0x9')]=function(_0x2f372f,_0x3f4c35){return _0x2f372f[_0x9cbd('0xa')](_0x9cbd('0xb'),attributes,{'tableName':_0x9cbd('0xc'),'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 30ecc98..98456ab 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 _0xaa9c=['code','message','catch','GetMailQueue','MailQueue','options','limit','include','model','attributes','map','ShowMailQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1c4d53,_0x40522d){var _0x377bc2=function(_0x5aecae){while(--_0x5aecae){_0x1c4d53['push'](_0x1c4d53['shift']());}};_0x377bc2(++_0x40522d);}(_0xaa9c,0x1e2));var _0xcaa9=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xaa9c[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xcaa9('0x0'));var util=require(_0xcaa9('0x1'));var moment=require(_0xcaa9('0x2'));var BPromise=require(_0xcaa9('0x3'));var rs=require(_0xcaa9('0x4'));var fs=require('fs');var Redis=require(_0xcaa9('0x5'));var db=require(_0xcaa9('0x6'))['db'];var utils=require(_0xcaa9('0x7'));var logger=require(_0xcaa9('0x8'))(_0xcaa9('0x9'));var config=require(_0xcaa9('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xcaa9('0xb')](config[_0xcaa9('0xc')],{'host':_0xcaa9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcaa9('0xc')]));require(_0xcaa9('0xe'))[_0xcaa9('0xf')](socket);function respondWithRpcPromise(_0x5a3e8a,_0x1e14f9,_0x35615a){return new BPromise(function(_0x4302a7,_0xe3017f){return client[_0xcaa9('0x10')](_0x5a3e8a,_0x35615a)[_0xcaa9('0x11')](function(_0x183d78){logger[_0xcaa9('0x12')](_0xcaa9('0x13'),_0x1e14f9,_0xcaa9('0x14'));logger[_0xcaa9('0x15')](_0xcaa9('0x16'),_0x1e14f9,_0xcaa9('0x14'),JSON[_0xcaa9('0x17')](_0x183d78));if(_0x183d78[_0xcaa9('0x18')]){if(_0x183d78[_0xcaa9('0x18')][_0xcaa9('0x19')]===0x1f4){logger[_0xcaa9('0x18')]('MailQueue,\x20%s,\x20%s',_0x1e14f9,_0x183d78['error'][_0xcaa9('0x1a')]);return _0xe3017f(_0x183d78[_0xcaa9('0x18')][_0xcaa9('0x1a')]);}logger[_0xcaa9('0x18')](_0xcaa9('0x13'),_0x1e14f9,_0x183d78[_0xcaa9('0x18')][_0xcaa9('0x1a')]);return _0x4302a7(_0x183d78[_0xcaa9('0x18')][_0xcaa9('0x1a')]);}else{logger[_0xcaa9('0x12')]('MailQueue,\x20%s,\x20%s',_0x1e14f9,_0xcaa9('0x14'));_0x4302a7(_0x183d78['result'][_0xcaa9('0x1a')]);}})[_0xcaa9('0x1b')](function(_0x5b1426){logger['error'](_0xcaa9('0x13'),_0x1e14f9,_0x5b1426);_0xe3017f(_0x5b1426);});});}exports[_0xcaa9('0x1c')]=function(_0x5e4c9a){var _0x33d892=this;return new Promise(function(_0x4eaaa3,_0x352ca2){return db[_0xcaa9('0x1d')]['findAll']({'raw':_0x5e4c9a[_0xcaa9('0x1e')]?_0x5e4c9a[_0xcaa9('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x5e4c9a[_0xcaa9('0x1e')]?_0x5e4c9a['options']['where']||null:null,'attributes':_0x5e4c9a[_0xcaa9('0x1e')]?_0x5e4c9a['options']['attributes']||null:null,'limit':_0x5e4c9a[_0xcaa9('0x1e')]?_0x5e4c9a[_0xcaa9('0x1e')][_0xcaa9('0x1f')]||null:null,'include':_0x5e4c9a[_0xcaa9('0x1e')]?_0x5e4c9a['options'][_0xcaa9('0x20')]?_['map'](_0x5e4c9a[_0xcaa9('0x1e')][_0xcaa9('0x20')],function(_0x15e6ed){return{'model':db[_0x15e6ed[_0xcaa9('0x21')]],'as':_0x15e6ed['as'],'attributes':_0x15e6ed[_0xcaa9('0x22')],'include':_0x15e6ed['include']?_['map'](_0x15e6ed['include'],function(_0x34c88e){return{'model':db[_0x34c88e[_0xcaa9('0x21')]],'as':_0x34c88e['as'],'attributes':_0x34c88e[_0xcaa9('0x22')],'include':_0x34c88e[_0xcaa9('0x20')]?_[_0xcaa9('0x23')](_0x34c88e[_0xcaa9('0x20')],function(_0x13be38){return{'model':db[_0x13be38[_0xcaa9('0x21')]],'as':_0x13be38['as'],'attributes':_0x13be38[_0xcaa9('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf817fe){logger['info'](_0xcaa9('0x1c'),_0x5e4c9a);logger[_0xcaa9('0x15')](_0xcaa9('0x1c'),_0x5e4c9a,JSON['stringify'](_0xf817fe));_0x4eaaa3(_0xf817fe);})[_0xcaa9('0x1b')](function(_0xdc5c04){logger['error'](_0xcaa9('0x1c'),_0xdc5c04['message'],_0x5e4c9a);_0x352ca2(_0x33d892[_0xcaa9('0x18')](0x1f4,_0xdc5c04[_0xcaa9('0x1a')]));});});};exports[_0xcaa9('0x24')]=function(_0x355601){var _0x1bb829=this;return new Promise(function(_0x540615,_0x571f0c){return db[_0xcaa9('0x1d')][_0xcaa9('0x25')]({'raw':_0x355601[_0xcaa9('0x1e')]?_0x355601[_0xcaa9('0x1e')][_0xcaa9('0x26')]===undefined?!![]:![]:!![],'where':_0x355601[_0xcaa9('0x1e')]?_0x355601[_0xcaa9('0x1e')]['where']||null:null,'attributes':_0x355601[_0xcaa9('0x1e')]?_0x355601[_0xcaa9('0x1e')][_0xcaa9('0x22')]||null:null,'include':_0x355601[_0xcaa9('0x1e')]?_0x355601[_0xcaa9('0x1e')][_0xcaa9('0x20')]?_[_0xcaa9('0x23')](_0x355601[_0xcaa9('0x1e')][_0xcaa9('0x20')],function(_0x29e7aa){return{'model':db[_0x29e7aa[_0xcaa9('0x21')]],'as':_0x29e7aa['as'],'attributes':_0x29e7aa['attributes'],'include':_0x29e7aa[_0xcaa9('0x20')]?_['map'](_0x29e7aa['include'],function(_0x2586e1){return{'model':db[_0x2586e1[_0xcaa9('0x21')]],'as':_0x2586e1['as'],'attributes':_0x2586e1[_0xcaa9('0x22')],'include':_0x2586e1['include']?_['map'](_0x2586e1[_0xcaa9('0x20')],function(_0x8aa5d3){return{'model':db[_0x8aa5d3[_0xcaa9('0x21')]],'as':_0x8aa5d3['as'],'attributes':_0x8aa5d3['attributes']};}):[]};}):[]};}):[]:[]})[_0xcaa9('0x11')](function(_0x460d4f){logger['info'](_0xcaa9('0x24'),_0x355601);logger[_0xcaa9('0x15')](_0xcaa9('0x24'),_0x355601,JSON[_0xcaa9('0x17')](_0x460d4f));_0x540615(_0x460d4f);})['catch'](function(_0x4ade8b){logger[_0xcaa9('0x18')](_0xcaa9('0x24'),_0x4ade8b[_0xcaa9('0x1a')],_0x355601);_0x571f0c(_0x1bb829['error'](0x1f4,_0x4ade8b[_0xcaa9('0x1a')]));});});}; \ No newline at end of file +var _0x0306=['include','map','model','ShowMailQueue','find','raw','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','limit'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0x0306,0x13e));var _0x6030=function(_0x2f1753,_0x58ca9b){_0x2f1753=_0x2f1753-0x0;var _0x4fb12d=_0x0306[_0x2f1753];return _0x4fb12d;};'use strict';var _=require(_0x6030('0x0'));var util=require(_0x6030('0x1'));var moment=require(_0x6030('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6030('0x3'))['db'];var utils=require(_0x6030('0x4'));var logger=require(_0x6030('0x5'))(_0x6030('0x6'));var config=require(_0x6030('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6030('0x8')][_0x6030('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6030('0xa')],{'host':_0x6030('0xb'),'port':0x18eb});var socket=require(_0x6030('0xc'))(new Redis(config[_0x6030('0xa')]));require('./mailQueue.socket')[_0x6030('0xd')](socket);function respondWithRpcPromise(_0x2a3d0f,_0x9d902b,_0x57b38a){return new BPromise(function(_0x3a7e5b,_0x6cefe8){return client['request'](_0x2a3d0f,_0x57b38a)[_0x6030('0xe')](function(_0x504a34){logger['info'](_0x6030('0xf'),_0x9d902b,_0x6030('0x10'));logger[_0x6030('0x11')](_0x6030('0x12'),_0x9d902b,'request\x20sent',JSON[_0x6030('0x13')](_0x504a34));if(_0x504a34[_0x6030('0x14')]){if(_0x504a34[_0x6030('0x14')][_0x6030('0x15')]===0x1f4){logger['error'](_0x6030('0xf'),_0x9d902b,_0x504a34[_0x6030('0x14')][_0x6030('0x16')]);return _0x6cefe8(_0x504a34[_0x6030('0x14')][_0x6030('0x16')]);}logger[_0x6030('0x14')]('MailQueue,\x20%s,\x20%s',_0x9d902b,_0x504a34[_0x6030('0x14')][_0x6030('0x16')]);return _0x3a7e5b(_0x504a34['error']['message']);}else{logger[_0x6030('0x17')](_0x6030('0xf'),_0x9d902b,_0x6030('0x10'));_0x3a7e5b(_0x504a34[_0x6030('0x18')][_0x6030('0x16')]);}})[_0x6030('0x19')](function(_0x160108){logger['error'](_0x6030('0xf'),_0x9d902b,_0x160108);_0x6cefe8(_0x160108);});});}exports[_0x6030('0x1a')]=function(_0x1fc6ca){var _0x36725d=this;return new Promise(function(_0x7c1f1c,_0x170e90){return db[_0x6030('0x1b')][_0x6030('0x1c')]({'raw':_0x1fc6ca['options']?_0x1fc6ca[_0x6030('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1fc6ca[_0x6030('0x1d')]?_0x1fc6ca[_0x6030('0x1d')][_0x6030('0x1e')]||null:null,'attributes':_0x1fc6ca[_0x6030('0x1d')]?_0x1fc6ca['options'][_0x6030('0x1f')]||null:null,'limit':_0x1fc6ca[_0x6030('0x1d')]?_0x1fc6ca[_0x6030('0x1d')][_0x6030('0x20')]||null:null,'include':_0x1fc6ca[_0x6030('0x1d')]?_0x1fc6ca[_0x6030('0x1d')][_0x6030('0x21')]?_[_0x6030('0x22')](_0x1fc6ca[_0x6030('0x1d')]['include'],function(_0x143d52){return{'model':db[_0x143d52[_0x6030('0x23')]],'as':_0x143d52['as'],'attributes':_0x143d52[_0x6030('0x1f')],'include':_0x143d52[_0x6030('0x21')]?_[_0x6030('0x22')](_0x143d52[_0x6030('0x21')],function(_0x3e8684){return{'model':db[_0x3e8684[_0x6030('0x23')]],'as':_0x3e8684['as'],'attributes':_0x3e8684['attributes'],'include':_0x3e8684[_0x6030('0x21')]?_[_0x6030('0x22')](_0x3e8684['include'],function(_0x18aa63){return{'model':db[_0x18aa63[_0x6030('0x23')]],'as':_0x18aa63['as'],'attributes':_0x18aa63[_0x6030('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6030('0xe')](function(_0x398441){logger[_0x6030('0x17')](_0x6030('0x1a'),_0x1fc6ca);logger[_0x6030('0x11')](_0x6030('0x1a'),_0x1fc6ca,JSON[_0x6030('0x13')](_0x398441));_0x7c1f1c(_0x398441);})['catch'](function(_0x5d8565){logger[_0x6030('0x14')](_0x6030('0x1a'),_0x5d8565[_0x6030('0x16')],_0x1fc6ca);_0x170e90(_0x36725d['error'](0x1f4,_0x5d8565['message']));});});};exports[_0x6030('0x24')]=function(_0x41811d){var _0x5ef5c8=this;return new Promise(function(_0x48dab1,_0x28aa03){return db[_0x6030('0x1b')][_0x6030('0x25')]({'raw':_0x41811d[_0x6030('0x1d')]?_0x41811d[_0x6030('0x1d')][_0x6030('0x26')]===undefined?!![]:![]:!![],'where':_0x41811d['options']?_0x41811d[_0x6030('0x1d')]['where']||null:null,'attributes':_0x41811d[_0x6030('0x1d')]?_0x41811d[_0x6030('0x1d')][_0x6030('0x1f')]||null:null,'include':_0x41811d[_0x6030('0x1d')]?_0x41811d[_0x6030('0x1d')]['include']?_[_0x6030('0x22')](_0x41811d[_0x6030('0x1d')][_0x6030('0x21')],function(_0x37f566){return{'model':db[_0x37f566[_0x6030('0x23')]],'as':_0x37f566['as'],'attributes':_0x37f566[_0x6030('0x1f')],'include':_0x37f566['include']?_[_0x6030('0x22')](_0x37f566[_0x6030('0x21')],function(_0x4977e6){return{'model':db[_0x4977e6[_0x6030('0x23')]],'as':_0x4977e6['as'],'attributes':_0x4977e6[_0x6030('0x1f')],'include':_0x4977e6[_0x6030('0x21')]?_[_0x6030('0x22')](_0x4977e6[_0x6030('0x21')],function(_0x29fa48){return{'model':db[_0x29fa48[_0x6030('0x23')]],'as':_0x29fa48['as'],'attributes':_0x29fa48[_0x6030('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6030('0xe')](function(_0x332f9f){logger[_0x6030('0x17')]('ShowMailQueue',_0x41811d);logger[_0x6030('0x11')](_0x6030('0x24'),_0x41811d,JSON[_0x6030('0x13')](_0x332f9f));_0x48dab1(_0x332f9f);})['catch'](function(_0x27fe46){logger[_0x6030('0x14')](_0x6030('0x24'),_0x27fe46[_0x6030('0x16')],_0x41811d);_0x28aa03(_0x5ef5c8[_0x6030('0x14')](0x1f4,_0x27fe46[_0x6030('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 80dea55..f15b863 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 _0xcd6e=['update','removeListener','register','length','mailQueue:','./mailQueue.events','save'];(function(_0x56ad5b,_0x565ab9){var _0x3c0dbd=function(_0x2d4a6b){while(--_0x2d4a6b){_0x56ad5b['push'](_0x56ad5b['shift']());}};_0x3c0dbd(++_0x565ab9);}(_0xcd6e,0x11d));var _0xecd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd6e[_0x3dd15e];return _0x231fd0;};'use strict';var MailQueueEvents=require(_0xecd6('0x0'));var events=[_0xecd6('0x1'),'remove',_0xecd6('0x2')];function createListener(_0x4aeab0,_0x3883c4){return function(_0x5a9877){_0x3883c4['emit'](_0x4aeab0,_0x5a9877);};}function removeListener(_0x3382c0,_0xa99a73){return function(){MailQueueEvents[_0xecd6('0x3')](_0x3382c0,_0xa99a73);};}exports[_0xecd6('0x4')]=function(_0x1e7f1a){for(var _0x25463a=0x0,_0x2f0d84=events[_0xecd6('0x5')];_0x25463a<_0x2f0d84;_0x25463a++){var _0x1708b2=events[_0x25463a];var _0xbd63e5=createListener(_0xecd6('0x6')+_0x1708b2,_0x1e7f1a);MailQueueEvents['on'](_0x1708b2,_0xbd63e5);}}; \ No newline at end of file +var _0x56c8=['register','length','./mailQueue.events','save','remove','update','emit'];(function(_0x29bb9c,_0x206eb1){var _0x438c7a=function(_0x3f6726){while(--_0x3f6726){_0x29bb9c['push'](_0x29bb9c['shift']());}};_0x438c7a(++_0x206eb1);}(_0x56c8,0x12f));var _0x856c=function(_0x5ef59e,_0x196f94){_0x5ef59e=_0x5ef59e-0x0;var _0x572cda=_0x56c8[_0x5ef59e];return _0x572cda;};'use strict';var MailQueueEvents=require(_0x856c('0x0'));var events=[_0x856c('0x1'),_0x856c('0x2'),_0x856c('0x3')];function createListener(_0x51518f,_0x14fe45){return function(_0x30df82){_0x14fe45[_0x856c('0x4')](_0x51518f,_0x30df82);};}function removeListener(_0xd0f4b3,_0x2a1b07){return function(){MailQueueEvents['removeListener'](_0xd0f4b3,_0x2a1b07);};}exports[_0x856c('0x5')]=function(_0x1922f4){for(var _0x413964=0x0,_0x15a17c=events[_0x856c('0x6')];_0x413964<_0x15a17c;_0x413964++){var _0x456bdb=events[_0x413964];var _0x48d81b=createListener('mailQueue:'+_0x456bdb,_0x1922f4);MailQueueEvents['on'](_0x456bdb,_0x48d81b);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index b606413..841d4ac 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 _0xcebd=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','put','delete','exports','multer','util','connect-timeout'];(function(_0x3d2ca1,_0x39c06d){var _0x1127bb=function(_0x5ca739){while(--_0x5ca739){_0x3d2ca1['push'](_0x3d2ca1['shift']());}};_0x1127bb(++_0x39c06d);}(_0xcebd,0xf4));var _0xdceb=function(_0x2ab886,_0x3c65df){_0x2ab886=_0x2ab886-0x0;var _0x5ebec8=_0xcebd[_0x2ab886];return _0x5ebec8;};'use strict';var multer=require(_0xdceb('0x0'));var util=require(_0xdceb('0x1'));var path=require('path');var timeout=require(_0xdceb('0x2'));var express=require(_0xdceb('0x3'));var router=express[_0xdceb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdceb('0x5'));var interaction=require(_0xdceb('0x6'));var config=require(_0xdceb('0x7'));var controller=require(_0xdceb('0x8'));router['get']('/',auth[_0xdceb('0x9')](),controller['index']);router[_0xdceb('0xa')](_0xdceb('0xb'),auth[_0xdceb('0x9')](),controller[_0xdceb('0xc')]);router[_0xdceb('0xa')](_0xdceb('0xd'),auth[_0xdceb('0x9')](),controller[_0xdceb('0xe')]);router[_0xdceb('0xf')]('/',auth[_0xdceb('0x9')](),controller['create']);router[_0xdceb('0x10')](_0xdceb('0xd'),auth[_0xdceb('0x9')](),controller['update']);router[_0xdceb('0x11')](_0xdceb('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xdceb('0x12')]=router; \ No newline at end of file +var _0xb292=['/:id','show','post','put','update','delete','destroy','exports','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index'];(function(_0x36301e,_0x970c42){var _0x586b6c=function(_0x7818d5){while(--_0x7818d5){_0x36301e['push'](_0x36301e['shift']());}};_0x586b6c(++_0x970c42);}(_0xb292,0xe5));var _0x2b29=function(_0x400766,_0x368660){_0x400766=_0x400766-0x0;var _0x3ae58b=_0xb292[_0x400766];return _0x3ae58b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2b29('0x0'));var express=require('express');var router=express[_0x2b29('0x1')]();var fs_extra=require(_0x2b29('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x2b29('0x3'));var config=require(_0x2b29('0x4'));var controller=require(_0x2b29('0x5'));router[_0x2b29('0x6')]('/',auth[_0x2b29('0x7')](),controller[_0x2b29('0x8')]);router[_0x2b29('0x6')]('/describe',auth[_0x2b29('0x7')](),controller['describe']);router[_0x2b29('0x6')](_0x2b29('0x9'),auth[_0x2b29('0x7')](),controller[_0x2b29('0xa')]);router[_0x2b29('0xb')]('/',auth[_0x2b29('0x7')](),controller['create']);router[_0x2b29('0xc')](_0x2b29('0x9'),auth[_0x2b29('0x7')](),controller[_0x2b29('0xd')]);router[_0x2b29('0xe')](_0x2b29('0x9'),auth[_0x2b29('0x7')](),controller[_0x2b29('0xf')]);module[_0x2b29('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 7dbc241..6d1d4e5 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 _0x0bec=['DATE','moment','sequelize','exports','STRING'];(function(_0x408cb6,_0x24ed7d){var _0x432758=function(_0x16e090){while(--_0x16e090){_0x408cb6['push'](_0x408cb6['shift']());}};_0x432758(++_0x24ed7d);}(_0x0bec,0x173));var _0xc0be=function(_0x355b66,_0x3b7cea){_0x355b66=_0x355b66-0x0;var _0x45246d=_0x0bec[_0x355b66];return _0x45246d;};'use strict';var moment=require(_0xc0be('0x0'));var Sequelize=require(_0xc0be('0x1'));module[_0xc0be('0x2')]={'uniqueid':{'type':Sequelize[_0xc0be('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xc0be('0x3')]},'joinAt':{'type':Sequelize[_0xc0be('0x4')]},'leaveAt':{'type':Sequelize[_0xc0be('0x4')]},'acceptAt':{'type':Sequelize[_0xc0be('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7172=['exports','STRING','DATE'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7172,0x1ef));var _0x2717=function(_0x4f3fb2,_0xbfa63d){_0x4f3fb2=_0x4f3fb2-0x0;var _0x2652d2=_0x7172[_0x4f3fb2];return _0x2652d2;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x2717('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x2717('0x1')]},'joinAt':{'type':Sequelize[_0x2717('0x2')]},'leaveAt':{'type':Sequelize[_0x2717('0x2')]},'acceptAt':{'type':Sequelize[_0x2717('0x2')]},'exitAt':{'type':Sequelize[_0x2717('0x2')]},'reason':{'type':Sequelize[_0x2717('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index c0ded64..a2157cd 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 _0x6343=['VIRTUAL','options','MailQueueReport','then','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0xf2f332,_0x299fbf){var _0x56cce3=function(_0x5f37e0){while(--_0x5f37e0){_0xf2f332['push'](_0xf2f332['shift']());}};_0x56cce3(++_0x299fbf);}(_0x6343,0x168));var _0x3634=function(_0x403d35,_0x104503){_0x403d35=_0x403d35-0x0;var _0x3b408f=_0x6343[_0x403d35];return _0x3b408f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['MailQueueReport'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':!![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));};exports[_0x3634('0x44')]=function(_0x1943a5,_0x1834a3){return db['MailQueueReport'][_0x3634('0x44')]()[_0x3634('0x39')](respondWithResult(_0x1834a3,null))[_0x3634('0x3b')](handleError(_0x1834a3,null));}; \ No newline at end of file +var _0xadb5=['intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','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','MailQueueReport','fieldName','type','key','model','query','keys'];(function(_0x14c00f,_0x11b192){var _0x19fbda=function(_0xf9caa4){while(--_0xf9caa4){_0x14c00f['push'](_0x14c00f['shift']());}};_0x19fbda(++_0x11b192);}(_0xadb5,0xad));var _0x5adb=function(_0x49d3ad,_0x1adf7f){_0x49d3ad=_0x49d3ad-0x0;var _0x28531f=_0xadb5[_0x49d3ad];return _0x28531f;};'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['MailQueueReport']['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['MailQueueReport'][_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['MailQueueReport'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};exports['describe']=function(_0x36b847,_0x3a5703){return db[_0x5adb('0x2a')][_0x5adb('0x49')]()['then'](respondWithResult(_0x3a5703,null))[_0x5adb('0x42')](handleError(_0x3a5703,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index a71282c..9b93866 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 _0xb052=['define','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2280ff,_0x45b5b2){var _0x657217=function(_0x13ed6f){while(--_0x13ed6f){_0x2280ff['push'](_0x2280ff['shift']());}};_0x657217(++_0x45b5b2);}(_0xb052,0x1bd));var _0x2b05=function(_0x3c6b7d,_0x5f0d90){_0x3c6b7d=_0x3c6b7d-0x0;var _0x1d3ed2=_0xb052[_0x3c6b7d];return _0x1d3ed2;};'use strict';var _=require(_0x2b05('0x0'));var util=require(_0x2b05('0x1'));var logger=require(_0x2b05('0x2'))(_0x2b05('0x3'));var moment=require(_0x2b05('0x4'));var BPromise=require(_0x2b05('0x5'));var rp=require(_0x2b05('0x6'));var fs=require('fs');var path=require(_0x2b05('0x7'));var rimraf=require(_0x2b05('0x8'));var config=require(_0x2b05('0x9'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x1322e0,_0x7e041a){return _0x1322e0[_0x2b05('0xa')]('MailQueueReport',attributes,{'tableName':_0x2b05('0xb'),'paranoid':![],'indexes':[{'name':_0x2b05('0xc'),'fields':[_0x2b05('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6be5=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue'];(function(_0x2bf5f8,_0x24b456){var _0x323370=function(_0x300ce2){while(--_0x300ce2){_0x2bf5f8['push'](_0x2bf5f8['shift']());}};_0x323370(++_0x24b456);}(_0x6be5,0x193));var _0x56be=function(_0x2bc08f,_0x459946){_0x2bc08f=_0x2bc08f-0x0;var _0x3b0f98=_0x6be5[_0x2bc08f];return _0x3b0f98;};'use strict';var _=require(_0x56be('0x0'));var util=require(_0x56be('0x1'));var logger=require('../../config/logger')(_0x56be('0x2'));var moment=require(_0x56be('0x3'));var BPromise=require(_0x56be('0x4'));var rp=require(_0x56be('0x5'));var fs=require('fs');var path=require(_0x56be('0x6'));var rimraf=require(_0x56be('0x7'));var config=require(_0x56be('0x8'));var attributes=require('./mailQueueReport.attributes');module[_0x56be('0x9')]=function(_0x48fd54,_0x3a29f5){return _0x48fd54[_0x56be('0xa')](_0x56be('0xb'),attributes,{'tableName':_0x56be('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 78b8124..368c35f 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 _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4ac015,_0xdf913a){var _0x2c0db6=function(_0x379d10){while(--_0x379d10){_0x4ac015['push'](_0x4ac015['shift']());}};_0x2c0db6(++_0xdf913a);}(_0x326f,0xd1));var _0xf326=function(_0x435ed4,_0x23c613){_0x435ed4=_0x435ed4-0x0;var _0x22c1b3=_0x326f[_0x435ed4];return _0x22c1b3;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xf6869d,_0x18fc7a){var _0x440c06=function(_0x3457bf){while(--_0x3457bf){_0xf6869d['push'](_0xf6869d['shift']());}};_0x440c06(++_0x18fc7a);}(_0x326f,0xd1));var _0xf326=function(_0x3abaa7,_0x583464){_0x3abaa7=_0x3abaa7-0x0;var _0x12387d=_0x326f[_0x3abaa7];return _0x12387d;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index f376b37..1cda0b1 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x52a7b6,_0x566eeb){var _0x40392c=function(_0x232684){while(--_0x232684){_0x52a7b6['push'](_0x52a7b6['shift']());}};_0x40392c(++_0x566eeb);}(_0x70e0,0x17b));var _0x070e=function(_0x26809f,_0x5439d3){_0x26809f=_0x26809f-0x0;var _0x12d057=_0x70e0[_0x26809f];return _0x12d057;};'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(_0x269310,_0x3235cf){var _0x398b8b=function(_0x1d4ac6){while(--_0x1d4ac6){_0x269310['push'](_0x269310['shift']());}};_0x398b8b(++_0x3235cf);}(_0x70e0,0x17b));var _0x070e=function(_0xd2c08c,_0x4b12a7){_0xd2c08c=_0xd2c08c-0x0;var _0x5cd432=_0x70e0[_0xd2c08c];return _0x5cd432;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 38426b7..83a3322 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 _0xcdb3=['BOOLEAN','STRING','INBOX','INTEGER','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xcdb3,0x153));var _0x3cdb=function(_0x3fed07,_0x39738b){_0x3fed07=_0x3fed07-0x0;var _0x220874=_0xcdb3[_0x3fed07];return _0x220874;};'use strict';var Sequelize=require(_0x3cdb('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x3cdb('0x1')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x3cdb('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3cdb('0x2')],'defaultValue':_0x3cdb('0x3')},'connTimeout':{'type':Sequelize[_0x3cdb('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x3cdb('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6b7b=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x5ff517,_0x3e4ee0){var _0x19a245=function(_0x4c00ac){while(--_0x4c00ac){_0x5ff517['push'](_0x5ff517['shift']());}};_0x19a245(++_0x3e4ee0);}(_0x6b7b,0xdc));var _0xb6b7=function(_0x23adc4,_0x1c601c){_0x23adc4=_0x23adc4-0x0;var _0x3fd968=_0x6b7b[_0x23adc4];return _0x3fd968;};'use strict';var Sequelize=require('sequelize');module[_0xb6b7('0x0')]={'description':{'type':Sequelize[_0xb6b7('0x1')]},'host':{'type':Sequelize[_0xb6b7('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xb6b7('0x2')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xb6b7('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xb6b7('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xb6b7('0x1')]},'modernAuthentication':{'type':Sequelize[_0xb6b7('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 9a166b2..0ff0123 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 _0x9fb7=['request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','lodash','util','../../config/logger','moment','bluebird'];(function(_0xc1fac2,_0x725358){var _0x1a31f8=function(_0x22e4f3){while(--_0x22e4f3){_0xc1fac2['push'](_0xc1fac2['shift']());}};_0x1a31f8(++_0x725358);}(_0x9fb7,0x1e9));var _0x79fb=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x9fb7[_0x20a558];return _0x53d3f7;};'use strict';var _=require(_0x79fb('0x0'));var util=require(_0x79fb('0x1'));var logger=require(_0x79fb('0x2'))('api');var moment=require(_0x79fb('0x3'));var BPromise=require(_0x79fb('0x4'));var rp=require(_0x79fb('0x5'));var fs=require('fs');var path=require(_0x79fb('0x6'));var rimraf=require(_0x79fb('0x7'));var config=require(_0x79fb('0x8'));var attributes=require(_0x79fb('0x9'));module[_0x79fb('0xa')]=function(_0x43df8f,_0x2bea4f){return _0x43df8f[_0x79fb('0xb')](_0x79fb('0xc'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c8a=['api','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes','exports','define','mail_servers_in','lodash','util','../../config/logger'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x1c8a,0x1e9));var _0xa1c8=function(_0x231cf9,_0x3ccff8){_0x231cf9=_0x231cf9-0x0;var _0x27de09=_0x1c8a[_0x231cf9];return _0x27de09;};'use strict';var _=require(_0xa1c8('0x0'));var util=require(_0xa1c8('0x1'));var logger=require(_0xa1c8('0x2'))(_0xa1c8('0x3'));var moment=require('moment');var BPromise=require(_0xa1c8('0x4'));var rp=require(_0xa1c8('0x5'));var fs=require('fs');var path=require(_0xa1c8('0x6'));var rimraf=require('rimraf');var config=require(_0xa1c8('0x7'));var attributes=require(_0xa1c8('0x8'));module[_0xa1c8('0x9')]=function(_0x372087,_0x645185){return _0x372087[_0xa1c8('0xa')]('MailServerIn',attributes,{'tableName':_0xa1c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 252ad1a..6bcded7 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 _0x5bb7=['result','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','include','map','model','debug','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x24b043,_0x32b734){var _0x1e3cc8=function(_0x14c5d4){while(--_0x14c5d4){_0x24b043['push'](_0x24b043['shift']());}};_0x1e3cc8(++_0x32b734);}(_0x5bb7,0x104));var _0x75bb=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x5bb7[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require(_0x75bb('0x0'));var util=require('util');var moment=require(_0x75bb('0x1'));var BPromise=require(_0x75bb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75bb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x75bb('0x4'))(_0x75bb('0x5'));var config=require(_0x75bb('0x6'));var jayson=require(_0x75bb('0x7'));var client=jayson[_0x75bb('0x8')][_0x75bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4144d6,_0x4a1030,_0xa8897b){return new BPromise(function(_0x674de,_0x104bf0){return client[_0x75bb('0xa')](_0x4144d6,_0xa8897b)[_0x75bb('0xb')](function(_0x2887b2){logger[_0x75bb('0xc')](_0x75bb('0xd'),_0x4a1030,_0x75bb('0xe'));logger['debug'](_0x75bb('0xf'),_0x4a1030,_0x75bb('0xe'),JSON['stringify'](_0x2887b2));if(_0x2887b2[_0x75bb('0x10')]){if(_0x2887b2[_0x75bb('0x10')][_0x75bb('0x11')]===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x4a1030,_0x2887b2[_0x75bb('0x10')][_0x75bb('0x12')]);return _0x104bf0(_0x2887b2[_0x75bb('0x10')][_0x75bb('0x12')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x4a1030,_0x2887b2[_0x75bb('0x10')][_0x75bb('0x12')]);return _0x674de(_0x2887b2['error'][_0x75bb('0x12')]);}else{logger['info'](_0x75bb('0xd'),_0x4a1030,'request\x20sent');_0x674de(_0x2887b2[_0x75bb('0x13')][_0x75bb('0x12')]);}})['catch'](function(_0x1b56e1){logger[_0x75bb('0x10')](_0x75bb('0xd'),_0x4a1030,_0x1b56e1);_0x104bf0(_0x1b56e1);});});}exports[_0x75bb('0x14')]=function(_0x2f9499){var _0x2aa895=this;return new Promise(function(_0x1f9658,_0x3d5de5){return db[_0x75bb('0x15')][_0x75bb('0x16')]({'raw':_0x2f9499[_0x75bb('0x17')]?_0x2f9499[_0x75bb('0x17')][_0x75bb('0x18')]===undefined?!![]:![]:!![],'where':_0x2f9499['options']?_0x2f9499[_0x75bb('0x17')]['where']||null:null,'attributes':_0x2f9499['options']?_0x2f9499['options'][_0x75bb('0x19')]||null:null,'limit':_0x2f9499['options']?_0x2f9499[_0x75bb('0x17')]['limit']||null:null,'include':_0x2f9499[_0x75bb('0x17')]?_0x2f9499['options'][_0x75bb('0x1a')]?_[_0x75bb('0x1b')](_0x2f9499[_0x75bb('0x17')][_0x75bb('0x1a')],function(_0x36cb3a){return{'model':db[_0x36cb3a['model']],'as':_0x36cb3a['as'],'attributes':_0x36cb3a[_0x75bb('0x19')],'include':_0x36cb3a['include']?_[_0x75bb('0x1b')](_0x36cb3a[_0x75bb('0x1a')],function(_0x4b5fc7){return{'model':db[_0x4b5fc7[_0x75bb('0x1c')]],'as':_0x4b5fc7['as'],'attributes':_0x4b5fc7[_0x75bb('0x19')],'include':_0x4b5fc7[_0x75bb('0x1a')]?_[_0x75bb('0x1b')](_0x4b5fc7['include'],function(_0x18cf38){return{'model':db[_0x18cf38['model']],'as':_0x18cf38['as'],'attributes':_0x18cf38['attributes']};}):[]};}):[]};}):[]:[]})[_0x75bb('0xb')](function(_0x46edee){logger['info'](_0x75bb('0x14'),_0x2f9499);logger[_0x75bb('0x1d')]('GetMailServerIn',_0x2f9499,JSON['stringify'](_0x46edee));_0x1f9658(_0x46edee);})[_0x75bb('0x1e')](function(_0x4e21d8){logger['error'](_0x75bb('0x14'),_0x4e21d8[_0x75bb('0x12')],_0x2f9499);_0x3d5de5(_0x2aa895['error'](0x1f4,_0x4e21d8['message']));});});}; \ No newline at end of file +var _0xc632=['GetMailServerIn','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailServerIn','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0x272812,_0x49861b){var _0x5cce9d=function(_0x13f934){while(--_0x13f934){_0x272812['push'](_0x272812['shift']());}};_0x5cce9d(++_0x49861b);}(_0xc632,0xf0));var _0x2c63=function(_0x541ade,_0x1ef8b7){_0x541ade=_0x541ade-0x0;var _0x27cbbc=_0xc632[_0x541ade];return _0x27cbbc;};'use strict';var _=require(_0x2c63('0x0'));var util=require(_0x2c63('0x1'));var moment=require(_0x2c63('0x2'));var BPromise=require(_0x2c63('0x3'));var rs=require(_0x2c63('0x4'));var fs=require('fs');var Redis=require(_0x2c63('0x5'));var db=require(_0x2c63('0x6'))['db'];var utils=require(_0x2c63('0x7'));var logger=require(_0x2c63('0x8'))(_0x2c63('0x9'));var config=require(_0x2c63('0xa'));var jayson=require(_0x2c63('0xb'));var client=jayson[_0x2c63('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13b049,_0x16f1d3,_0xfe4e1c){return new BPromise(function(_0x3cb763,_0x387be9){return client['request'](_0x13b049,_0xfe4e1c)['then'](function(_0x1ae757){logger[_0x2c63('0xd')](_0x2c63('0xe'),_0x16f1d3,_0x2c63('0xf'));logger['debug'](_0x2c63('0x10'),_0x16f1d3,'request\x20sent',JSON[_0x2c63('0x11')](_0x1ae757));if(_0x1ae757[_0x2c63('0x12')]){if(_0x1ae757[_0x2c63('0x12')][_0x2c63('0x13')]===0x1f4){logger[_0x2c63('0x12')]('MailServerIn,\x20%s,\x20%s',_0x16f1d3,_0x1ae757[_0x2c63('0x12')][_0x2c63('0x14')]);return _0x387be9(_0x1ae757[_0x2c63('0x12')]['message']);}logger['error'](_0x2c63('0xe'),_0x16f1d3,_0x1ae757['error'][_0x2c63('0x14')]);return _0x3cb763(_0x1ae757[_0x2c63('0x12')]['message']);}else{logger[_0x2c63('0xd')](_0x2c63('0xe'),_0x16f1d3,_0x2c63('0xf'));_0x3cb763(_0x1ae757['result'][_0x2c63('0x14')]);}})[_0x2c63('0x15')](function(_0x4efdd4){logger[_0x2c63('0x12')]('MailServerIn,\x20%s,\x20%s',_0x16f1d3,_0x4efdd4);_0x387be9(_0x4efdd4);});});}exports['GetMailServerIn']=function(_0xd0a60f){var _0x45d59d=this;return new Promise(function(_0x4c7fc7,_0x1a5d1b){return db[_0x2c63('0x16')][_0x2c63('0x17')]({'raw':_0xd0a60f['options']?_0xd0a60f[_0x2c63('0x18')][_0x2c63('0x19')]===undefined?!![]:![]:!![],'where':_0xd0a60f[_0x2c63('0x18')]?_0xd0a60f['options'][_0x2c63('0x1a')]||null:null,'attributes':_0xd0a60f['options']?_0xd0a60f[_0x2c63('0x18')][_0x2c63('0x1b')]||null:null,'limit':_0xd0a60f[_0x2c63('0x18')]?_0xd0a60f[_0x2c63('0x18')][_0x2c63('0x1c')]||null:null,'include':_0xd0a60f[_0x2c63('0x18')]?_0xd0a60f[_0x2c63('0x18')][_0x2c63('0x1d')]?_['map'](_0xd0a60f[_0x2c63('0x18')][_0x2c63('0x1d')],function(_0xd7e904){return{'model':db[_0xd7e904[_0x2c63('0x1e')]],'as':_0xd7e904['as'],'attributes':_0xd7e904[_0x2c63('0x1b')],'include':_0xd7e904['include']?_['map'](_0xd7e904[_0x2c63('0x1d')],function(_0x281a9f){return{'model':db[_0x281a9f['model']],'as':_0x281a9f['as'],'attributes':_0x281a9f[_0x2c63('0x1b')],'include':_0x281a9f[_0x2c63('0x1d')]?_[_0x2c63('0x1f')](_0x281a9f[_0x2c63('0x1d')],function(_0x1b0bde){return{'model':db[_0x1b0bde[_0x2c63('0x1e')]],'as':_0x1b0bde['as'],'attributes':_0x1b0bde[_0x2c63('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b9c05){logger[_0x2c63('0xd')](_0x2c63('0x20'),_0xd0a60f);logger[_0x2c63('0x21')](_0x2c63('0x20'),_0xd0a60f,JSON['stringify'](_0x4b9c05));_0x4c7fc7(_0x4b9c05);})['catch'](function(_0x184098){logger[_0x2c63('0x12')]('GetMailServerIn',_0x184098[_0x2c63('0x14')],_0xd0a60f);_0x1a5d1b(_0x45d59d['error'](0x1f4,_0x184098[_0x2c63('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 400b74f..09141dc 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7a54,0x106));var _0x47a5=function(_0x4669b7,_0x4f1b2d){_0x4669b7=_0x4669b7-0x0;var _0x44623c=_0x7a54[_0x4669b7];return _0x44623c;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x7a54,0x106));var _0x47a5=function(_0x11ac29,_0x48d89a){_0x11ac29=_0x11ac29-0x0;var _0x271c3c=_0x7a54[_0x11ac29];return _0x271c3c;};'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 0ad07cb..cde9fbd 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 _0x80ed=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x3c57c7,_0x18e494){var _0x9c2cbb=function(_0x4195d0){while(--_0x4195d0){_0x3c57c7['push'](_0x3c57c7['shift']());}};_0x9c2cbb(++_0x18e494);}(_0x80ed,0x11c));var _0xd80e=function(_0x2c41e0,_0x35f461){_0x2c41e0=_0x2c41e0-0x0;var _0x3bccb6=_0x80ed[_0x2c41e0];return _0x3bccb6;};'use strict';var Sequelize=require(_0xd80e('0x0'));module['exports']={'description':{'type':Sequelize[_0xd80e('0x1')]},'host':{'type':Sequelize[_0xd80e('0x1')]},'user':{'type':Sequelize[_0xd80e('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd80e('0x2')]},'secure':{'type':Sequelize[_0xd80e('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xd80e('0x1')]},'authentication':{'type':Sequelize[_0xd80e('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xd914=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x826fae,_0x7a32ce){var _0x53ed77=function(_0x2eb328){while(--_0x2eb328){_0x826fae['push'](_0x826fae['shift']());}};_0x53ed77(++_0x7a32ce);}(_0xd914,0x17f));var _0x4d91=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0xd914[_0x9d1e6b];return _0x2b3070;};'use strict';var Sequelize=require(_0x4d91('0x0'));module[_0x4d91('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x4d91('0x2')]},'user':{'type':Sequelize[_0x4d91('0x2')]},'pass':{'type':Sequelize[_0x4d91('0x2')]},'port':{'type':Sequelize[_0x4d91('0x3')]},'secure':{'type':Sequelize[_0x4d91('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x4d91('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x4d91('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 1f1f927..217e521 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 _0x1062=['rows','show','params','keys','rawAttributes','create','body','catch','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','MailServerOut','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include'];(function(_0x592809,_0x3fb2de){var _0x33128d=function(_0x3107c2){while(--_0x3107c2){_0x592809['push'](_0x592809['shift']());}};_0x33128d(++_0x3fb2de);}(_0x1062,0x185));var _0x2106=function(_0x13a67c,_0x25ec0f){_0x13a67c=_0x13a67c-0x0;var _0x329eaf=_0x1062[_0x13a67c];return _0x329eaf;};'use strict';var emlformat=require(_0x2106('0x0'));var rimraf=require(_0x2106('0x1'));var zipdir=require(_0x2106('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2106('0x3'));var moment=require(_0x2106('0x4'));var BPromise=require(_0x2106('0x5'));var Mustache=require(_0x2106('0x6'));var util=require(_0x2106('0x7'));var path=require(_0x2106('0x8'));var sox=require(_0x2106('0x9'));var csv=require(_0x2106('0xa'));var ejs=require(_0x2106('0xb'));var fs=require('fs');var fs_extra=require(_0x2106('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2106('0xd'));var jsforce=require(_0x2106('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2106('0xa'));var querystring=require(_0x2106('0xf'));var Papa=require(_0x2106('0x10'));var Redis=require(_0x2106('0x11'));var authService=require(_0x2106('0x12'));var qs=require(_0x2106('0x13'));var as=require(_0x2106('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2106('0x15'));var utils=require('../../config/utils');var config=require(_0x2106('0x16'));var licenseUtil=require(_0x2106('0x17'));var db=require(_0x2106('0x18'))['db'];function respondWithStatusCode(_0x205406,_0x555a1a){_0x555a1a=_0x555a1a||0xcc;return function(_0x1e2278){if(_0x1e2278){return _0x205406[_0x2106('0x19')](_0x555a1a);}return _0x205406[_0x2106('0x1a')](_0x555a1a)['end']();};}function respondWithResult(_0x314ffe,_0x5b4940){_0x5b4940=_0x5b4940||0xc8;return function(_0x4935aa){if(_0x4935aa){return _0x314ffe[_0x2106('0x1a')](_0x5b4940)[_0x2106('0x1b')](_0x4935aa);}};}function respondWithFilteredResult(_0x1ea444,_0xd562f5){return function(_0x37ee4e){if(_0x37ee4e){var _0x501bc8=typeof _0xd562f5[_0x2106('0x1c')]==='undefined'&&typeof _0xd562f5[_0x2106('0x1d')]==='undefined';var _0x21de9c=_0x37ee4e[_0x2106('0x1e')];var _0x3fea63=_0x501bc8?0x0:_0xd562f5[_0x2106('0x1c')];var _0x9574ef=_0x501bc8?_0x37ee4e[_0x2106('0x1e')]:_0xd562f5['offset']+_0xd562f5[_0x2106('0x1d')];var _0x42646b;if(_0x9574ef>=_0x21de9c){_0x9574ef=_0x21de9c;_0x42646b=0xc8;}else{_0x42646b=0xce;}_0x1ea444[_0x2106('0x1a')](_0x42646b);return _0x1ea444[_0x2106('0x1f')](_0x2106('0x20'),_0x3fea63+'-'+_0x9574ef+'/'+_0x21de9c)['json'](_0x37ee4e);}return null;};}function patchUpdates(_0x1812c1){return function(_0x1c6160){try{jsonpatch[_0x2106('0x21')](_0x1c6160,_0x1812c1,!![]);}catch(_0x480467){return BPromise[_0x2106('0x22')](_0x480467);}return _0x1c6160[_0x2106('0x23')]();};}function saveUpdates(_0x5a0c27,_0xe5f785){return function(_0x12a634){if(_0x12a634){return _0x12a634[_0x2106('0x24')](_0x5a0c27)[_0x2106('0x25')](function(_0x5c8649){return _0x5c8649;});}return null;};}function removeEntity(_0x5a7009,_0x5c5291){return function(_0x295ee5){if(_0x295ee5){return _0x295ee5[_0x2106('0x26')]()[_0x2106('0x25')](function(){_0x5a7009[_0x2106('0x1a')](0xcc)[_0x2106('0x27')]();});}};}function handleEntityNotFound(_0x56189f,_0x1bf4d3){return function(_0x1e72dc){if(!_0x1e72dc){_0x56189f[_0x2106('0x19')](0x194);}return _0x1e72dc;};}function handleError(_0x3c996c,_0x19097f){_0x19097f=_0x19097f||0x1f4;return function(_0x35dbe6){logger[_0x2106('0x28')](_0x35dbe6[_0x2106('0x29')]);if(_0x35dbe6[_0x2106('0x2a')]){delete _0x35dbe6[_0x2106('0x2a')];}_0x3c996c[_0x2106('0x1a')](_0x19097f)['send'](_0x35dbe6);};}exports[_0x2106('0x2b')]=function(_0x3a0c2b,_0xdefc4c){var _0x2d1f80={},_0x5d424e={},_0x50bd7c={'count':0x0,'rows':[]};var _0xa13a9b=_[_0x2106('0x2c')](db[_0x2106('0x2d')]['rawAttributes'],function(_0xf582ba){return{'name':_0xf582ba[_0x2106('0x2e')],'type':_0xf582ba[_0x2106('0x2f')][_0x2106('0x30')]};});_0x5d424e[_0x2106('0x31')]=_[_0x2106('0x2c')](_0xa13a9b,_0x2106('0x2a'));_0x5d424e['query']=_['keys'](_0x3a0c2b[_0x2106('0x32')]);_0x5d424e['filters']=_[_0x2106('0x33')](_0x5d424e[_0x2106('0x31')],_0x5d424e[_0x2106('0x32')]);_0x2d1f80[_0x2106('0x34')]=_[_0x2106('0x33')](_0x5d424e[_0x2106('0x31')],qs[_0x2106('0x35')](_0x3a0c2b[_0x2106('0x32')][_0x2106('0x35')]));_0x2d1f80[_0x2106('0x34')]=_0x2d1f80[_0x2106('0x34')][_0x2106('0x36')]?_0x2d1f80['attributes']:_0x5d424e[_0x2106('0x31')];if(!_0x3a0c2b['query'][_0x2106('0x37')](_0x2106('0x38'))){_0x2d1f80[_0x2106('0x1d')]=qs[_0x2106('0x1d')](_0x3a0c2b['query'][_0x2106('0x1d')]);_0x2d1f80[_0x2106('0x1c')]=qs[_0x2106('0x1c')](_0x3a0c2b[_0x2106('0x32')]['offset']);}_0x2d1f80[_0x2106('0x39')]=qs['sort'](_0x3a0c2b['query'][_0x2106('0x3a')]);_0x2d1f80[_0x2106('0x3b')]=qs[_0x2106('0x3c')](_[_0x2106('0x3d')](_0x3a0c2b[_0x2106('0x32')],_0x5d424e['filters']),_0xa13a9b);if(_0x3a0c2b['query']['filter']){_0x2d1f80[_0x2106('0x3b')]=_[_0x2106('0x3e')](_0x2d1f80[_0x2106('0x3b')],{'$or':_['map'](_0xa13a9b,function(_0x5c4df8){if(_0x5c4df8['type']!=='VIRTUAL'){var _0x2f338e={};_0x2f338e[_0x5c4df8['name']]={'$like':'%'+_0x3a0c2b[_0x2106('0x32')][_0x2106('0x3f')]+'%'};return _0x2f338e;}})});}_0x2d1f80=_[_0x2106('0x3e')]({},_0x2d1f80,_0x3a0c2b[_0x2106('0x40')]);var _0x289bed={'where':_0x2d1f80[_0x2106('0x3b')]};return db['MailServerOut'][_0x2106('0x1e')](_0x289bed)[_0x2106('0x25')](function(_0x69bca3){_0x50bd7c[_0x2106('0x1e')]=_0x69bca3;if(_0x3a0c2b['query'][_0x2106('0x41')]){_0x2d1f80[_0x2106('0x42')]=[{'all':!![]}];}return db[_0x2106('0x2d')]['findAll'](_0x2d1f80);})[_0x2106('0x25')](function(_0x566976){_0x50bd7c[_0x2106('0x43')]=_0x566976;return _0x50bd7c;})[_0x2106('0x25')](respondWithFilteredResult(_0xdefc4c,_0x2d1f80))['catch'](handleError(_0xdefc4c,null));};exports[_0x2106('0x44')]=function(_0x46af16,_0x44240f){var _0x1abe51={'raw':!![],'where':{'id':_0x46af16[_0x2106('0x45')]['id']}},_0x9adbe6={};_0x9adbe6['model']=_[_0x2106('0x46')](db['MailServerOut'][_0x2106('0x47')]);_0x9adbe6[_0x2106('0x32')]=_[_0x2106('0x46')](_0x46af16[_0x2106('0x32')]);_0x9adbe6[_0x2106('0x3c')]=_[_0x2106('0x33')](_0x9adbe6[_0x2106('0x31')],_0x9adbe6['query']);_0x1abe51[_0x2106('0x34')]=_['intersection'](_0x9adbe6['model'],qs[_0x2106('0x35')](_0x46af16[_0x2106('0x32')]['fields']));_0x1abe51[_0x2106('0x34')]=_0x1abe51[_0x2106('0x34')]['length']?_0x1abe51[_0x2106('0x34')]:_0x9adbe6[_0x2106('0x31')];if(_0x46af16['query']['includeAll']){_0x1abe51['include']=[{'all':!![]}];}_0x1abe51=_['merge']({},_0x1abe51,_0x46af16[_0x2106('0x40')]);return db[_0x2106('0x2d')]['find'](_0x1abe51)['then'](handleEntityNotFound(_0x44240f,null))[_0x2106('0x25')](respondWithResult(_0x44240f,null))['catch'](handleError(_0x44240f,null));};exports[_0x2106('0x48')]=function(_0x26c351,_0x4f35f0){return db[_0x2106('0x2d')]['create'](_0x26c351[_0x2106('0x49')],{})[_0x2106('0x25')](respondWithResult(_0x4f35f0,0xc9))[_0x2106('0x4a')](handleError(_0x4f35f0,null));};exports[_0x2106('0x24')]=function(_0x43c09f,_0x4f083c){if(_0x43c09f[_0x2106('0x49')]['id']){delete _0x43c09f[_0x2106('0x49')]['id'];}return db['MailServerOut'][_0x2106('0x4b')]({'where':{'id':_0x43c09f[_0x2106('0x45')]['id']}})[_0x2106('0x25')](handleEntityNotFound(_0x4f083c,null))[_0x2106('0x25')](saveUpdates(_0x43c09f[_0x2106('0x49')],null))[_0x2106('0x25')](respondWithResult(_0x4f083c,null))[_0x2106('0x4a')](handleError(_0x4f083c,null));};exports['destroy']=function(_0x40f66f,_0x2dbfd6){return db[_0x2106('0x2d')][_0x2106('0x4b')]({'where':{'id':_0x40f66f['params']['id']}})[_0x2106('0x25')](handleEntityNotFound(_0x2dbfd6,null))['then'](removeEntity(_0x2dbfd6,null))[_0x2106('0x4a')](handleError(_0x2dbfd6,null));}; \ No newline at end of file +var _0xe188=['includeAll','include','findAll','rows','params','merge','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','map','MailServerOut','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options'];(function(_0x441f7a,_0x576321){var _0x4821da=function(_0x5c5b52){while(--_0x5c5b52){_0x441f7a['push'](_0x441f7a['shift']());}};_0x4821da(++_0x576321);}(_0xe188,0x1df));var _0x8e18=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xe188[_0x4dc7b9];return _0x3ab114;};'use strict';var emlformat=require(_0x8e18('0x0'));var rimraf=require(_0x8e18('0x1'));var zipdir=require(_0x8e18('0x2'));var jsonpatch=require(_0x8e18('0x3'));var rp=require('request-promise');var moment=require(_0x8e18('0x4'));var BPromise=require(_0x8e18('0x5'));var Mustache=require(_0x8e18('0x6'));var util=require(_0x8e18('0x7'));var path=require('path');var sox=require(_0x8e18('0x8'));var csv=require(_0x8e18('0x9'));var ejs=require(_0x8e18('0xa'));var fs=require('fs');var fs_extra=require(_0x8e18('0xb'));var _=require(_0x8e18('0xc'));var squel=require('squel');var crypto=require(_0x8e18('0xd'));var jsforce=require(_0x8e18('0xe'));var deskjs=require(_0x8e18('0xf'));var toCsv=require(_0x8e18('0x9'));var querystring=require(_0x8e18('0x10'));var Papa=require(_0x8e18('0x11'));var Redis=require(_0x8e18('0x12'));var authService=require(_0x8e18('0x13'));var qs=require(_0x8e18('0x14'));var as=require(_0x8e18('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8e18('0x16'));var config=require(_0x8e18('0x17'));var licenseUtil=require(_0x8e18('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ccd39,_0x41ef3f){_0x41ef3f=_0x41ef3f||0xcc;return function(_0x31d267){if(_0x31d267){return _0x4ccd39[_0x8e18('0x19')](_0x41ef3f);}return _0x4ccd39[_0x8e18('0x1a')](_0x41ef3f)['end']();};}function respondWithResult(_0x2706cb,_0x20e2af){_0x20e2af=_0x20e2af||0xc8;return function(_0x3e2776){if(_0x3e2776){return _0x2706cb[_0x8e18('0x1a')](_0x20e2af)[_0x8e18('0x1b')](_0x3e2776);}};}function respondWithFilteredResult(_0x5ec6b3,_0x5a4aed){return function(_0x1986cc){if(_0x1986cc){var _0x54be29=typeof _0x5a4aed[_0x8e18('0x1c')]===_0x8e18('0x1d')&&typeof _0x5a4aed[_0x8e18('0x1e')]===_0x8e18('0x1d');var _0x48dd33=_0x1986cc[_0x8e18('0x1f')];var _0x34a1d1=_0x54be29?0x0:_0x5a4aed[_0x8e18('0x1c')];var _0x2cbb9c=_0x54be29?_0x1986cc[_0x8e18('0x1f')]:_0x5a4aed[_0x8e18('0x1c')]+_0x5a4aed[_0x8e18('0x1e')];var _0x2cd01c;if(_0x2cbb9c>=_0x48dd33){_0x2cbb9c=_0x48dd33;_0x2cd01c=0xc8;}else{_0x2cd01c=0xce;}_0x5ec6b3[_0x8e18('0x1a')](_0x2cd01c);return _0x5ec6b3[_0x8e18('0x20')](_0x8e18('0x21'),_0x34a1d1+'-'+_0x2cbb9c+'/'+_0x48dd33)['json'](_0x1986cc);}return null;};}function patchUpdates(_0x2d080b){return function(_0x877435){try{jsonpatch[_0x8e18('0x22')](_0x877435,_0x2d080b,!![]);}catch(_0x37a308){return BPromise[_0x8e18('0x23')](_0x37a308);}return _0x877435[_0x8e18('0x24')]();};}function saveUpdates(_0x36d784,_0xc3471f){return function(_0xab6b8c){if(_0xab6b8c){return _0xab6b8c['update'](_0x36d784)[_0x8e18('0x25')](function(_0x5e13de){return _0x5e13de;});}return null;};}function removeEntity(_0x516728,_0x285ce2){return function(_0x537be2){if(_0x537be2){return _0x537be2[_0x8e18('0x26')]()['then'](function(){_0x516728[_0x8e18('0x1a')](0xcc)[_0x8e18('0x27')]();});}};}function handleEntityNotFound(_0x313674,_0x7b9a03){return function(_0x53b270){if(!_0x53b270){_0x313674[_0x8e18('0x19')](0x194);}return _0x53b270;};}function handleError(_0x1c753c,_0x43c2cb){_0x43c2cb=_0x43c2cb||0x1f4;return function(_0x35ee19){logger[_0x8e18('0x28')](_0x35ee19[_0x8e18('0x29')]);if(_0x35ee19[_0x8e18('0x2a')]){delete _0x35ee19[_0x8e18('0x2a')];}_0x1c753c[_0x8e18('0x1a')](_0x43c2cb)[_0x8e18('0x2b')](_0x35ee19);};}exports['index']=function(_0x3f8c9e,_0x2141d4){var _0x1c263f={},_0x385bdb={},_0x1d78ff={'count':0x0,'rows':[]};var _0x2ab72a=_[_0x8e18('0x2c')](db[_0x8e18('0x2d')][_0x8e18('0x2e')],function(_0x35c2fb){return{'name':_0x35c2fb[_0x8e18('0x2f')],'type':_0x35c2fb[_0x8e18('0x30')][_0x8e18('0x31')]};});_0x385bdb['model']=_[_0x8e18('0x2c')](_0x2ab72a,_0x8e18('0x2a'));_0x385bdb[_0x8e18('0x32')]=_[_0x8e18('0x33')](_0x3f8c9e[_0x8e18('0x32')]);_0x385bdb[_0x8e18('0x34')]=_[_0x8e18('0x35')](_0x385bdb['model'],_0x385bdb[_0x8e18('0x32')]);_0x1c263f['attributes']=_[_0x8e18('0x35')](_0x385bdb['model'],qs['fields'](_0x3f8c9e[_0x8e18('0x32')][_0x8e18('0x36')]));_0x1c263f['attributes']=_0x1c263f[_0x8e18('0x37')][_0x8e18('0x38')]?_0x1c263f[_0x8e18('0x37')]:_0x385bdb[_0x8e18('0x39')];if(!_0x3f8c9e['query'][_0x8e18('0x3a')](_0x8e18('0x3b'))){_0x1c263f[_0x8e18('0x1e')]=qs[_0x8e18('0x1e')](_0x3f8c9e[_0x8e18('0x32')][_0x8e18('0x1e')]);_0x1c263f[_0x8e18('0x1c')]=qs[_0x8e18('0x1c')](_0x3f8c9e['query'][_0x8e18('0x1c')]);}_0x1c263f[_0x8e18('0x3c')]=qs[_0x8e18('0x3d')](_0x3f8c9e[_0x8e18('0x32')][_0x8e18('0x3d')]);_0x1c263f[_0x8e18('0x3e')]=qs[_0x8e18('0x34')](_[_0x8e18('0x3f')](_0x3f8c9e['query'],_0x385bdb['filters']),_0x2ab72a);if(_0x3f8c9e[_0x8e18('0x32')][_0x8e18('0x40')]){_0x1c263f[_0x8e18('0x3e')]=_['merge'](_0x1c263f['where'],{'$or':_[_0x8e18('0x2c')](_0x2ab72a,function(_0x5b4d4e){if(_0x5b4d4e[_0x8e18('0x30')]!==_0x8e18('0x41')){var _0x33e29f={};_0x33e29f[_0x5b4d4e[_0x8e18('0x2a')]]={'$like':'%'+_0x3f8c9e['query'][_0x8e18('0x40')]+'%'};return _0x33e29f;}})});}_0x1c263f=_['merge']({},_0x1c263f,_0x3f8c9e[_0x8e18('0x42')]);var _0x76f7b9={'where':_0x1c263f[_0x8e18('0x3e')]};return db[_0x8e18('0x2d')][_0x8e18('0x1f')](_0x76f7b9)[_0x8e18('0x25')](function(_0x31b756){_0x1d78ff[_0x8e18('0x1f')]=_0x31b756;if(_0x3f8c9e[_0x8e18('0x32')][_0x8e18('0x43')]){_0x1c263f[_0x8e18('0x44')]=[{'all':!![]}];}return db[_0x8e18('0x2d')][_0x8e18('0x45')](_0x1c263f);})[_0x8e18('0x25')](function(_0x4f3dcc){_0x1d78ff[_0x8e18('0x46')]=_0x4f3dcc;return _0x1d78ff;})[_0x8e18('0x25')](respondWithFilteredResult(_0x2141d4,_0x1c263f))['catch'](handleError(_0x2141d4,null));};exports['show']=function(_0x36e759,_0x1f6f6e){var _0x368b25={'raw':!![],'where':{'id':_0x36e759[_0x8e18('0x47')]['id']}},_0x37b8a9={};_0x37b8a9[_0x8e18('0x39')]=_[_0x8e18('0x33')](db[_0x8e18('0x2d')][_0x8e18('0x2e')]);_0x37b8a9[_0x8e18('0x32')]=_[_0x8e18('0x33')](_0x36e759[_0x8e18('0x32')]);_0x37b8a9['filters']=_[_0x8e18('0x35')](_0x37b8a9[_0x8e18('0x39')],_0x37b8a9[_0x8e18('0x32')]);_0x368b25[_0x8e18('0x37')]=_[_0x8e18('0x35')](_0x37b8a9[_0x8e18('0x39')],qs[_0x8e18('0x36')](_0x36e759['query'][_0x8e18('0x36')]));_0x368b25[_0x8e18('0x37')]=_0x368b25[_0x8e18('0x37')][_0x8e18('0x38')]?_0x368b25[_0x8e18('0x37')]:_0x37b8a9[_0x8e18('0x39')];if(_0x36e759[_0x8e18('0x32')][_0x8e18('0x43')]){_0x368b25['include']=[{'all':!![]}];}_0x368b25=_[_0x8e18('0x48')]({},_0x368b25,_0x36e759[_0x8e18('0x42')]);return db[_0x8e18('0x2d')][_0x8e18('0x49')](_0x368b25)['then'](handleEntityNotFound(_0x1f6f6e,null))[_0x8e18('0x25')](respondWithResult(_0x1f6f6e,null))[_0x8e18('0x4a')](handleError(_0x1f6f6e,null));};exports[_0x8e18('0x4b')]=function(_0x3144f5,_0x2bc68d){return db[_0x8e18('0x2d')][_0x8e18('0x4b')](_0x3144f5[_0x8e18('0x4c')],{})['then'](respondWithResult(_0x2bc68d,0xc9))[_0x8e18('0x4a')](handleError(_0x2bc68d,null));};exports[_0x8e18('0x4d')]=function(_0x65f48a,_0x3dca98){if(_0x65f48a[_0x8e18('0x4c')]['id']){delete _0x65f48a[_0x8e18('0x4c')]['id'];}return db[_0x8e18('0x2d')][_0x8e18('0x49')]({'where':{'id':_0x65f48a[_0x8e18('0x47')]['id']}})[_0x8e18('0x25')](handleEntityNotFound(_0x3dca98,null))[_0x8e18('0x25')](saveUpdates(_0x65f48a['body'],null))[_0x8e18('0x25')](respondWithResult(_0x3dca98,null))[_0x8e18('0x4a')](handleError(_0x3dca98,null));};exports[_0x8e18('0x26')]=function(_0x18113a,_0x472cde){return db[_0x8e18('0x2d')]['find']({'where':{'id':_0x18113a[_0x8e18('0x47')]['id']}})[_0x8e18('0x25')](handleEntityNotFound(_0x472cde,null))[_0x8e18('0x25')](removeEntity(_0x472cde,null))[_0x8e18('0x4a')](handleError(_0x472cde,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index fe6ebc5..b579f94 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 _0xcf9a=['define','MailServerOut','lodash','util','api','moment','request-promise','path','../../config/environment','./mailServerOut.attributes'];(function(_0x23f1d2,_0x3b3334){var _0x5ca5a4=function(_0xec62fc){while(--_0xec62fc){_0x23f1d2['push'](_0x23f1d2['shift']());}};_0x5ca5a4(++_0x3b3334);}(_0xcf9a,0xde));var _0xacf9=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xcf9a[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xacf9('0x0'));var util=require(_0xacf9('0x1'));var logger=require('../../config/logger')(_0xacf9('0x2'));var moment=require(_0xacf9('0x3'));var BPromise=require('bluebird');var rp=require(_0xacf9('0x4'));var fs=require('fs');var path=require(_0xacf9('0x5'));var rimraf=require('rimraf');var config=require(_0xacf9('0x6'));var attributes=require(_0xacf9('0x7'));module['exports']=function(_0x27e748,_0x242a77){return _0x27e748[_0xacf9('0x8')](_0xacf9('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c88=['MailServerOut','mail_servers_out','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define'];(function(_0x169641,_0x2ac75e){var _0x26c7b7=function(_0x24dbae){while(--_0x24dbae){_0x169641['push'](_0x169641['shift']());}};_0x26c7b7(++_0x2ac75e);}(_0x4c88,0xab));var _0x84c8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4c88[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x84c8('0x0'));var logger=require(_0x84c8('0x1'))(_0x84c8('0x2'));var moment=require(_0x84c8('0x3'));var BPromise=require(_0x84c8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84c8('0x5'));var rimraf=require(_0x84c8('0x6'));var config=require(_0x84c8('0x7'));var attributes=require(_0x84c8('0x8'));module[_0x84c8('0x9')]=function(_0x2226c6,_0x361665){return _0x2226c6[_0x84c8('0xa')](_0x84c8('0xb'),attributes,{'tableName':_0x84c8('0xc'),'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 0d3c2b3..991b0de 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x5ca50a,_0x43eae3){var _0x537308=function(_0x48048c){while(--_0x48048c){_0x5ca50a['push'](_0x5ca50a['shift']());}};_0x537308(++_0x43eae3);}(_0xdb28,0x106));var _0x8db2=function(_0x5a60b4,_0xe26600){_0x5a60b4=_0x5a60b4-0x0;var _0x1fb9a6=_0xdb28[_0x5a60b4];return _0x1fb9a6;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\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(_0x9e76d2,_0xa625a){var _0x1f4df7=function(_0x2341db){while(--_0x2341db){_0x9e76d2['push'](_0x9e76d2['shift']());}};_0x1f4df7(++_0xa625a);}(_0x1261,0x144));var _0x1126=function(_0x32be62,_0x22e6fd){_0x32be62=_0x32be62-0x0;var _0x1a37e9=_0x1261[_0x32be62];return _0x1a37e9;};'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')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index da88c9c..5a1b0e7 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 _0x82af=['get','isAuthenticated','index','describe','show','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller'];(function(_0x495976,_0x5e2260){var _0x256f29=function(_0x2314cc){while(--_0x2314cc){_0x495976['push'](_0x495976['shift']());}};_0x256f29(++_0x5e2260);}(_0x82af,0x115));var _0xf82a=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x82af[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require(_0xf82a('0x0'));var util=require(_0xf82a('0x1'));var path=require('path');var timeout=require(_0xf82a('0x2'));var express=require(_0xf82a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf82a('0x4'));var interaction=require(_0xf82a('0x5'));var config=require(_0xf82a('0x6'));var controller=require(_0xf82a('0x7'));router[_0xf82a('0x8')]('/',auth[_0xf82a('0x9')](),controller[_0xf82a('0xa')]);router[_0xf82a('0x8')]('/describe',auth[_0xf82a('0x9')](),controller[_0xf82a('0xb')]);router[_0xf82a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf82a('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf82a('0xd')]);router[_0xf82a('0xe')](_0xf82a('0xf'),auth[_0xf82a('0x9')](),controller['update']);router[_0xf82a('0x10')](_0xf82a('0xf'),auth[_0xf82a('0x9')](),controller[_0xf82a('0x11')]);module[_0xf82a('0x12')]=router; \ No newline at end of file +var _0x460e=['create','put','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','/:id','show','post'];(function(_0x1e1c8a,_0xd1d956){var _0x3ede0f=function(_0x29abb6){while(--_0x29abb6){_0x1e1c8a['push'](_0x1e1c8a['shift']());}};_0x3ede0f(++_0xd1d956);}(_0x460e,0xd5));var _0xe460=function(_0x53f37f,_0xfb0b18){_0x53f37f=_0x53f37f-0x0;var _0x2fe5f8=_0x460e[_0x53f37f];return _0x2fe5f8;};'use strict';var multer=require(_0xe460('0x0'));var util=require(_0xe460('0x1'));var path=require(_0xe460('0x2'));var timeout=require(_0xe460('0x3'));var express=require('express');var router=express[_0xe460('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe460('0x5'));var interaction=require(_0xe460('0x6'));var config=require(_0xe460('0x7'));var controller=require(_0xe460('0x8'));router[_0xe460('0x9')]('/',auth[_0xe460('0xa')](),controller['index']);router[_0xe460('0x9')](_0xe460('0xb'),auth[_0xe460('0xa')](),controller['describe']);router[_0xe460('0x9')](_0xe460('0xc'),auth[_0xe460('0xa')](),controller[_0xe460('0xd')]);router[_0xe460('0xe')]('/',auth[_0xe460('0xa')](),controller[_0xe460('0xf')]);router[_0xe460('0x10')](_0xe460('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe460('0x11')]('/:id',auth[_0xe460('0xa')](),controller['destroy']);module[_0xe460('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 0065a04..537075f 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 _0x3831=['STRING','name','sequelize'];(function(_0x388b3,_0x1a7f47){var _0x15d7d6=function(_0x4a22a5){while(--_0x4a22a5){_0x388b3['push'](_0x388b3['shift']());}};_0x15d7d6(++_0x1a7f47);}(_0x3831,0x14c));var _0x1383=function(_0x20c6f1,_0x21fa65){_0x20c6f1=_0x20c6f1-0x0;var _0x43c3bf=_0x3831[_0x20c6f1];return _0x43c3bf;};'use strict';var Sequelize=require(_0x1383('0x0'));module['exports']={'name':{'type':Sequelize[_0x1383('0x1')],'unique':_0x1383('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1383('0x1')]}}; \ No newline at end of file +var _0x27a0=['STRING','name','exports'];(function(_0x72f2a,_0x5c709a){var _0x4e76f0=function(_0x23e10c){while(--_0x23e10c){_0x72f2a['push'](_0x72f2a['shift']());}};_0x4e76f0(++_0x5c709a);}(_0x27a0,0xbf));var _0x027a=function(_0x3484d9,_0x4ec117){_0x3484d9=_0x3484d9-0x0;var _0x2b5aad=_0x27a0[_0x3484d9];return _0x2b5aad;};'use strict';var Sequelize=require('sequelize');module[_0x027a('0x0')]={'name':{'type':Sequelize[_0x027a('0x1')],'unique':_0x027a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x027a('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 0376b58..79786ac 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 _0x44d7=['keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','update','find','params','describe','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','MailSubstatus','type','key','query'];(function(_0x2d5492,_0x56475d){var _0x5e944f=function(_0x8a209d){while(--_0x8a209d){_0x2d5492['push'](_0x2d5492['shift']());}};_0x5e944f(++_0x56475d);}(_0x44d7,0xac));var _0x744d=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x44d7[_0x543084];return _0x306a57;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x744d('0x0'));var rp=require(_0x744d('0x1'));var moment=require(_0x744d('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x744d('0x3'));var path=require(_0x744d('0x4'));var sox=require(_0x744d('0x5'));var csv=require(_0x744d('0x6'));var ejs=require(_0x744d('0x7'));var fs=require('fs');var fs_extra=require(_0x744d('0x8'));var _=require(_0x744d('0x9'));var squel=require('squel');var crypto=require(_0x744d('0xa'));var jsforce=require(_0x744d('0xb'));var deskjs=require(_0x744d('0xc'));var toCsv=require(_0x744d('0x6'));var querystring=require(_0x744d('0xd'));var Papa=require(_0x744d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x744d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x744d('0x10'))(_0x744d('0x11'));var utils=require(_0x744d('0x12'));var config=require(_0x744d('0x13'));var licenseUtil=require(_0x744d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47863c,_0x47df90){_0x47df90=_0x47df90||0xcc;return function(_0x6d8522){if(_0x6d8522){return _0x47863c[_0x744d('0x15')](_0x47df90);}return _0x47863c[_0x744d('0x16')](_0x47df90)[_0x744d('0x17')]();};}function respondWithResult(_0x2c602b,_0x460683){_0x460683=_0x460683||0xc8;return function(_0x5f14bb){if(_0x5f14bb){return _0x2c602b[_0x744d('0x16')](_0x460683)[_0x744d('0x18')](_0x5f14bb);}};}function respondWithFilteredResult(_0x2ca6a0,_0x365510){return function(_0x4a51dd){if(_0x4a51dd){var _0x3b772b=typeof _0x365510[_0x744d('0x19')]===_0x744d('0x1a')&&typeof _0x365510[_0x744d('0x1b')]==='undefined';var _0x229500=_0x4a51dd['count'];var _0x529d9c=_0x3b772b?0x0:_0x365510[_0x744d('0x19')];var _0x5d59cb=_0x3b772b?_0x4a51dd['count']:_0x365510['offset']+_0x365510[_0x744d('0x1b')];var _0x102b75;if(_0x5d59cb>=_0x229500){_0x5d59cb=_0x229500;_0x102b75=0xc8;}else{_0x102b75=0xce;}_0x2ca6a0[_0x744d('0x16')](_0x102b75);return _0x2ca6a0[_0x744d('0x1c')](_0x744d('0x1d'),_0x529d9c+'-'+_0x5d59cb+'/'+_0x229500)['json'](_0x4a51dd);}return null;};}function patchUpdates(_0x2685b0){return function(_0x1bc8b0){try{jsonpatch[_0x744d('0x1e')](_0x1bc8b0,_0x2685b0,!![]);}catch(_0x8a16de){return BPromise[_0x744d('0x1f')](_0x8a16de);}return _0x1bc8b0['save']();};}function saveUpdates(_0xc272bf,_0x4dd98a){return function(_0x107025){if(_0x107025){return _0x107025['update'](_0xc272bf)[_0x744d('0x20')](function(_0x14f137){return _0x14f137;});}return null;};}function removeEntity(_0x589dc3,_0x2aa102){return function(_0x53a0bb){if(_0x53a0bb){return _0x53a0bb[_0x744d('0x21')]()[_0x744d('0x20')](function(){_0x589dc3[_0x744d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a679e,_0x15244e){return function(_0x305101){if(!_0x305101){_0x5a679e['sendStatus'](0x194);}return _0x305101;};}function handleError(_0x5b9934,_0x1ca887){_0x1ca887=_0x1ca887||0x1f4;return function(_0x36a6e2){logger[_0x744d('0x22')](_0x36a6e2[_0x744d('0x23')]);if(_0x36a6e2[_0x744d('0x24')]){delete _0x36a6e2[_0x744d('0x24')];}_0x5b9934[_0x744d('0x16')](_0x1ca887)[_0x744d('0x25')](_0x36a6e2);};}exports[_0x744d('0x26')]=function(_0xc9490e,_0x12a42a){var _0x2f7a06={},_0xe47157={},_0x124fbb={'count':0x0,'rows':[]};var _0x5f40ee=_[_0x744d('0x27')](db[_0x744d('0x28')]['rawAttributes'],function(_0x1b0dc0){return{'name':_0x1b0dc0['fieldName'],'type':_0x1b0dc0[_0x744d('0x29')][_0x744d('0x2a')]};});_0xe47157['model']=_[_0x744d('0x27')](_0x5f40ee,_0x744d('0x24'));_0xe47157[_0x744d('0x2b')]=_[_0x744d('0x2c')](_0xc9490e[_0x744d('0x2b')]);_0xe47157['filters']=_[_0x744d('0x2d')](_0xe47157[_0x744d('0x2e')],_0xe47157[_0x744d('0x2b')]);_0x2f7a06[_0x744d('0x2f')]=_['intersection'](_0xe47157[_0x744d('0x2e')],qs[_0x744d('0x30')](_0xc9490e[_0x744d('0x2b')][_0x744d('0x30')]));_0x2f7a06[_0x744d('0x2f')]=_0x2f7a06[_0x744d('0x2f')][_0x744d('0x31')]?_0x2f7a06['attributes']:_0xe47157['model'];if(!_0xc9490e[_0x744d('0x2b')][_0x744d('0x32')]('nolimit')){_0x2f7a06[_0x744d('0x1b')]=qs[_0x744d('0x1b')](_0xc9490e[_0x744d('0x2b')][_0x744d('0x1b')]);_0x2f7a06[_0x744d('0x19')]=qs[_0x744d('0x19')](_0xc9490e['query'][_0x744d('0x19')]);}_0x2f7a06['order']=qs[_0x744d('0x33')](_0xc9490e['query'][_0x744d('0x33')]);_0x2f7a06[_0x744d('0x34')]=qs[_0x744d('0x35')](_[_0x744d('0x36')](_0xc9490e['query'],_0xe47157[_0x744d('0x35')]),_0x5f40ee);if(_0xc9490e[_0x744d('0x2b')][_0x744d('0x37')]){_0x2f7a06[_0x744d('0x34')]=_[_0x744d('0x38')](_0x2f7a06[_0x744d('0x34')],{'$or':_[_0x744d('0x27')](_0x5f40ee,function(_0xbf5081){if(_0xbf5081[_0x744d('0x29')]!=='VIRTUAL'){var _0x5333c1={};_0x5333c1[_0xbf5081[_0x744d('0x24')]]={'$like':'%'+_0xc9490e[_0x744d('0x2b')][_0x744d('0x37')]+'%'};return _0x5333c1;}})});}_0x2f7a06=_['merge']({},_0x2f7a06,_0xc9490e[_0x744d('0x39')]);var _0x595d1a={'where':_0x2f7a06[_0x744d('0x34')]};return db[_0x744d('0x28')][_0x744d('0x3a')](_0x595d1a)['then'](function(_0x578cb8){_0x124fbb[_0x744d('0x3a')]=_0x578cb8;if(_0xc9490e[_0x744d('0x2b')][_0x744d('0x3b')]){_0x2f7a06[_0x744d('0x3c')]=[{'all':!![]}];}return db[_0x744d('0x28')][_0x744d('0x3d')](_0x2f7a06);})['then'](function(_0x3172e2){_0x124fbb[_0x744d('0x3e')]=_0x3172e2;return _0x124fbb;})[_0x744d('0x20')](respondWithFilteredResult(_0x12a42a,_0x2f7a06))[_0x744d('0x3f')](handleError(_0x12a42a,null));};exports[_0x744d('0x40')]=function(_0x252665,_0x29880b){var _0x2aa780={'raw':!![],'where':{'id':_0x252665['params']['id']}},_0x319ff7={};_0x319ff7[_0x744d('0x2e')]=_[_0x744d('0x2c')](db[_0x744d('0x28')][_0x744d('0x41')]);_0x319ff7[_0x744d('0x2b')]=_[_0x744d('0x2c')](_0x252665[_0x744d('0x2b')]);_0x319ff7['filters']=_[_0x744d('0x2d')](_0x319ff7['model'],_0x319ff7[_0x744d('0x2b')]);_0x2aa780[_0x744d('0x2f')]=_[_0x744d('0x2d')](_0x319ff7[_0x744d('0x2e')],qs[_0x744d('0x30')](_0x252665[_0x744d('0x2b')][_0x744d('0x30')]));_0x2aa780['attributes']=_0x2aa780[_0x744d('0x2f')][_0x744d('0x31')]?_0x2aa780[_0x744d('0x2f')]:_0x319ff7[_0x744d('0x2e')];if(_0x252665[_0x744d('0x2b')][_0x744d('0x3b')]){_0x2aa780[_0x744d('0x3c')]=[{'all':!![]}];}_0x2aa780=_[_0x744d('0x38')]({},_0x2aa780,_0x252665[_0x744d('0x39')]);return db[_0x744d('0x28')]['find'](_0x2aa780)[_0x744d('0x20')](handleEntityNotFound(_0x29880b,null))[_0x744d('0x20')](respondWithResult(_0x29880b,null))[_0x744d('0x3f')](handleError(_0x29880b,null));};exports[_0x744d('0x42')]=function(_0x2fa392,_0x1e964b){return db[_0x744d('0x28')]['create'](_0x2fa392[_0x744d('0x43')],{})[_0x744d('0x20')](respondWithResult(_0x1e964b,0xc9))[_0x744d('0x3f')](handleError(_0x1e964b,null));};exports[_0x744d('0x44')]=function(_0x327955,_0x462583){if(_0x327955[_0x744d('0x43')]['id']){delete _0x327955[_0x744d('0x43')]['id'];}return db['MailSubstatus'][_0x744d('0x45')]({'where':{'id':_0x327955[_0x744d('0x46')]['id']}})[_0x744d('0x20')](handleEntityNotFound(_0x462583,null))['then'](saveUpdates(_0x327955[_0x744d('0x43')],null))[_0x744d('0x20')](respondWithResult(_0x462583,null))[_0x744d('0x3f')](handleError(_0x462583,null));};exports[_0x744d('0x21')]=function(_0x5b75c0,_0xb41359){return db[_0x744d('0x28')][_0x744d('0x45')]({'where':{'id':_0x5b75c0['params']['id']}})[_0x744d('0x20')](handleEntityNotFound(_0xb41359,null))['then'](removeEntity(_0xb41359,null))[_0x744d('0x3f')](handleError(_0xb41359,null));};exports[_0x744d('0x47')]=function(_0x33a0c9,_0x3b5b76){return db[_0x744d('0x28')][_0x744d('0x47')]()[_0x744d('0x20')](respondWithResult(_0x3b5b76,null))[_0x744d('0x3f')](handleError(_0x3b5b76,null));}; \ No newline at end of file +var _0x15cb=['options','MailSubstatus','includeAll','include','catch','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','filter','where','merge','VIRTUAL'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x15cb,0x180));var _0xb15c=function(_0x48dc34,_0x421018){_0x48dc34=_0x48dc34-0x0;var _0xafd08a=_0x15cb[_0x48dc34];return _0xafd08a;};'use strict';var emlformat=require(_0xb15c('0x0'));var rimraf=require(_0xb15c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb15c('0x2'));var Mustache=require(_0xb15c('0x3'));var util=require(_0xb15c('0x4'));var path=require(_0xb15c('0x5'));var sox=require(_0xb15c('0x6'));var csv=require(_0xb15c('0x7'));var ejs=require(_0xb15c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb15c('0x9'));var squel=require(_0xb15c('0xa'));var crypto=require(_0xb15c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb15c('0xc'));var toCsv=require(_0xb15c('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb15c('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xb15c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb15c('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb15c('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec0b4d,_0x1f06e0){_0x1f06e0=_0x1f06e0||0xcc;return function(_0x5b2a30){if(_0x5b2a30){return _0xec0b4d['sendStatus'](_0x1f06e0);}return _0xec0b4d[_0xb15c('0x11')](_0x1f06e0)['end']();};}function respondWithResult(_0x35c4cf,_0x5be28b){_0x5be28b=_0x5be28b||0xc8;return function(_0x149de1){if(_0x149de1){return _0x35c4cf['status'](_0x5be28b)[_0xb15c('0x12')](_0x149de1);}};}function respondWithFilteredResult(_0x55eaaf,_0xb9c89b){return function(_0x51e0fb){if(_0x51e0fb){var _0x21e353=typeof _0xb9c89b['offset']===_0xb15c('0x13')&&typeof _0xb9c89b['limit']===_0xb15c('0x13');var _0x2d1d0f=_0x51e0fb[_0xb15c('0x14')];var _0x40ce6c=_0x21e353?0x0:_0xb9c89b[_0xb15c('0x15')];var _0x4bdd59=_0x21e353?_0x51e0fb['count']:_0xb9c89b[_0xb15c('0x15')]+_0xb9c89b['limit'];var _0x4499ca;if(_0x4bdd59>=_0x2d1d0f){_0x4bdd59=_0x2d1d0f;_0x4499ca=0xc8;}else{_0x4499ca=0xce;}_0x55eaaf[_0xb15c('0x11')](_0x4499ca);return _0x55eaaf['set'](_0xb15c('0x16'),_0x40ce6c+'-'+_0x4bdd59+'/'+_0x2d1d0f)[_0xb15c('0x12')](_0x51e0fb);}return null;};}function patchUpdates(_0x57392b){return function(_0x310399){try{jsonpatch[_0xb15c('0x17')](_0x310399,_0x57392b,!![]);}catch(_0x2217a2){return BPromise[_0xb15c('0x18')](_0x2217a2);}return _0x310399[_0xb15c('0x19')]();};}function saveUpdates(_0x5d9bd2,_0x5e4253){return function(_0x345025){if(_0x345025){return _0x345025[_0xb15c('0x1a')](_0x5d9bd2)[_0xb15c('0x1b')](function(_0x1a2ef1){return _0x1a2ef1;});}return null;};}function removeEntity(_0x490823,_0x4819da){return function(_0x2cab96){if(_0x2cab96){return _0x2cab96['destroy']()[_0xb15c('0x1b')](function(){_0x490823['status'](0xcc)[_0xb15c('0x1c')]();});}};}function handleEntityNotFound(_0x145961,_0x2a9468){return function(_0x2cf0c9){if(!_0x2cf0c9){_0x145961[_0xb15c('0x1d')](0x194);}return _0x2cf0c9;};}function handleError(_0x567ad7,_0x1d8c7c){_0x1d8c7c=_0x1d8c7c||0x1f4;return function(_0x2dd83a){logger[_0xb15c('0x1e')](_0x2dd83a[_0xb15c('0x1f')]);if(_0x2dd83a['name']){delete _0x2dd83a[_0xb15c('0x20')];}_0x567ad7[_0xb15c('0x11')](_0x1d8c7c)['send'](_0x2dd83a);};}exports['index']=function(_0x77725f,_0x3ef03d){var _0x335da2={},_0x4c88ac={},_0x23db30={'count':0x0,'rows':[]};var _0x214880=_[_0xb15c('0x21')](db['MailSubstatus']['rawAttributes'],function(_0x4d3980){return{'name':_0x4d3980[_0xb15c('0x22')],'type':_0x4d3980[_0xb15c('0x23')][_0xb15c('0x24')]};});_0x4c88ac[_0xb15c('0x25')]=_[_0xb15c('0x21')](_0x214880,_0xb15c('0x20'));_0x4c88ac[_0xb15c('0x26')]=_[_0xb15c('0x27')](_0x77725f[_0xb15c('0x26')]);_0x4c88ac[_0xb15c('0x28')]=_[_0xb15c('0x29')](_0x4c88ac[_0xb15c('0x25')],_0x4c88ac['query']);_0x335da2[_0xb15c('0x2a')]=_[_0xb15c('0x29')](_0x4c88ac['model'],qs['fields'](_0x77725f['query'][_0xb15c('0x2b')]));_0x335da2['attributes']=_0x335da2[_0xb15c('0x2a')]['length']?_0x335da2[_0xb15c('0x2a')]:_0x4c88ac[_0xb15c('0x25')];if(!_0x77725f[_0xb15c('0x26')][_0xb15c('0x2c')]('nolimit')){_0x335da2[_0xb15c('0x2d')]=qs[_0xb15c('0x2d')](_0x77725f['query']['limit']);_0x335da2[_0xb15c('0x15')]=qs['offset'](_0x77725f[_0xb15c('0x26')][_0xb15c('0x15')]);}_0x335da2['order']=qs['sort'](_0x77725f[_0xb15c('0x26')]['sort']);_0x335da2['where']=qs[_0xb15c('0x28')](_['pick'](_0x77725f[_0xb15c('0x26')],_0x4c88ac[_0xb15c('0x28')]),_0x214880);if(_0x77725f[_0xb15c('0x26')][_0xb15c('0x2e')]){_0x335da2[_0xb15c('0x2f')]=_[_0xb15c('0x30')](_0x335da2[_0xb15c('0x2f')],{'$or':_[_0xb15c('0x21')](_0x214880,function(_0x62530a){if(_0x62530a['type']!==_0xb15c('0x31')){var _0x561168={};_0x561168[_0x62530a[_0xb15c('0x20')]]={'$like':'%'+_0x77725f[_0xb15c('0x26')][_0xb15c('0x2e')]+'%'};return _0x561168;}})});}_0x335da2=_[_0xb15c('0x30')]({},_0x335da2,_0x77725f[_0xb15c('0x32')]);var _0x3597bd={'where':_0x335da2[_0xb15c('0x2f')]};return db[_0xb15c('0x33')][_0xb15c('0x14')](_0x3597bd)[_0xb15c('0x1b')](function(_0x355528){_0x23db30[_0xb15c('0x14')]=_0x355528;if(_0x77725f[_0xb15c('0x26')][_0xb15c('0x34')]){_0x335da2[_0xb15c('0x35')]=[{'all':!![]}];}return db[_0xb15c('0x33')]['findAll'](_0x335da2);})[_0xb15c('0x1b')](function(_0x16ed71){_0x23db30['rows']=_0x16ed71;return _0x23db30;})[_0xb15c('0x1b')](respondWithFilteredResult(_0x3ef03d,_0x335da2))[_0xb15c('0x36')](handleError(_0x3ef03d,null));};exports['show']=function(_0x586ef9,_0x352077){var _0x202931={'raw':!![],'where':{'id':_0x586ef9[_0xb15c('0x37')]['id']}},_0x4c8127={};_0x4c8127[_0xb15c('0x25')]=_[_0xb15c('0x27')](db[_0xb15c('0x33')][_0xb15c('0x38')]);_0x4c8127[_0xb15c('0x26')]=_['keys'](_0x586ef9[_0xb15c('0x26')]);_0x4c8127[_0xb15c('0x28')]=_['intersection'](_0x4c8127['model'],_0x4c8127[_0xb15c('0x26')]);_0x202931[_0xb15c('0x2a')]=_['intersection'](_0x4c8127['model'],qs[_0xb15c('0x2b')](_0x586ef9['query'][_0xb15c('0x2b')]));_0x202931[_0xb15c('0x2a')]=_0x202931[_0xb15c('0x2a')][_0xb15c('0x39')]?_0x202931['attributes']:_0x4c8127[_0xb15c('0x25')];if(_0x586ef9[_0xb15c('0x26')]['includeAll']){_0x202931['include']=[{'all':!![]}];}_0x202931=_['merge']({},_0x202931,_0x586ef9[_0xb15c('0x32')]);return db[_0xb15c('0x33')][_0xb15c('0x3a')](_0x202931)['then'](handleEntityNotFound(_0x352077,null))[_0xb15c('0x1b')](respondWithResult(_0x352077,null))[_0xb15c('0x36')](handleError(_0x352077,null));};exports[_0xb15c('0x3b')]=function(_0xd3ebb9,_0x3d543a){return db['MailSubstatus'][_0xb15c('0x3b')](_0xd3ebb9[_0xb15c('0x3c')],{})[_0xb15c('0x1b')](respondWithResult(_0x3d543a,0xc9))[_0xb15c('0x36')](handleError(_0x3d543a,null));};exports[_0xb15c('0x1a')]=function(_0x5ba21c,_0x1bed3b){if(_0x5ba21c[_0xb15c('0x3c')]['id']){delete _0x5ba21c[_0xb15c('0x3c')]['id'];}return db[_0xb15c('0x33')][_0xb15c('0x3a')]({'where':{'id':_0x5ba21c[_0xb15c('0x37')]['id']}})[_0xb15c('0x1b')](handleEntityNotFound(_0x1bed3b,null))[_0xb15c('0x1b')](saveUpdates(_0x5ba21c[_0xb15c('0x3c')],null))[_0xb15c('0x1b')](respondWithResult(_0x1bed3b,null))[_0xb15c('0x36')](handleError(_0x1bed3b,null));};exports['destroy']=function(_0x12cb58,_0x36777b){return db[_0xb15c('0x33')][_0xb15c('0x3a')]({'where':{'id':_0x12cb58[_0xb15c('0x37')]['id']}})['then'](handleEntityNotFound(_0x36777b,null))[_0xb15c('0x1b')](removeEntity(_0x36777b,null))[_0xb15c('0x36')](handleError(_0x36777b,null));};exports['describe']=function(_0x2e2ab6,_0xcbf180){return db[_0xb15c('0x33')][_0xb15c('0x3d')]()[_0xb15c('0x1b')](respondWithResult(_0xcbf180,null))[_0xb15c('0x36')](handleError(_0xcbf180,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index d8184ed..1d20576 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 _0xb1cb=['MailSubstatus','setMaxListeners','update','emit','hook','events','../../mysqldb'];(function(_0x2dfc8d,_0x22e36a){var _0xfa39=function(_0x35a7dd){while(--_0x35a7dd){_0x2dfc8d['push'](_0x2dfc8d['shift']());}};_0xfa39(++_0x22e36a);}(_0xb1cb,0x7c));var _0xbb1c=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xb1cb[_0x5f09c5];return _0x426ad9;};'use strict';var EventEmitter=require(_0xbb1c('0x0'));var MailSubstatus=require(_0xbb1c('0x1'))['db'][_0xbb1c('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xbb1c('0x3')](0x0);var events={'afterUpdate':_0xbb1c('0x4')};function emitEvent(_0x37c1cd){return function(_0x205798,_0x418495,_0x5b9cdb){MailSubstatusEvents[_0xbb1c('0x5')](_0x37c1cd+':'+_0x205798['id'],_0x205798);MailSubstatusEvents[_0xbb1c('0x5')](_0x37c1cd,_0x205798);_0x5b9cdb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xbb1c('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0xb2be=['../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','events'];(function(_0x183e3c,_0x1b150b){var _0xfe23c7=function(_0x1576e3){while(--_0x1576e3){_0x183e3c['push'](_0x183e3c['shift']());}};_0xfe23c7(++_0x1b150b);}(_0xb2be,0x11f));var _0xeb2b=function(_0x42f270,_0x452dec){_0x42f270=_0x42f270-0x0;var _0x57bc5b=_0xb2be[_0x42f270];return _0x57bc5b;};'use strict';var EventEmitter=require(_0xeb2b('0x0'));var MailSubstatus=require(_0xeb2b('0x1'))['db'][_0xeb2b('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xeb2b('0x3')](0x0);var events={'afterUpdate':_0xeb2b('0x4')};function emitEvent(_0x2e0e30){return function(_0x47a25c,_0x1d6b56,_0x25c5d9){MailSubstatusEvents['emit'](_0x2e0e30+':'+_0x47a25c['id'],_0x47a25c);MailSubstatusEvents[_0xeb2b('0x5')](_0x2e0e30,_0x47a25c);_0x25c5d9(null);};}for(var e in events){if(events[_0xeb2b('0x6')](e)){var event=events[e];MailSubstatus[_0xeb2b('0x7')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index ec3473b..152467c 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 _0x0c0d=['MailSubstatus','mail_substatuses','Condition','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models','define'];(function(_0x4fae30,_0x219485){var _0x2554ce=function(_0x2efa28){while(--_0x2efa28){_0x4fae30['push'](_0x4fae30['shift']());}};_0x2554ce(++_0x219485);}(_0x0c0d,0x104));var _0xd0c0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0c0d[_0x14add3];return _0x4a174f;};'use strict';var attributes=require(_0xd0c0('0x0'));module[_0xd0c0('0x1')]=function(_0x239375){var _0x49637d=_0x239375[_0xd0c0('0x2')];return _0x239375[_0xd0c0('0x3')](_0xd0c0('0x4'),attributes,{'tableName':_0xd0c0('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x17c06e,_0x500f90,_0x3d5c2f){return _0x49637d[_0xd0c0('0x6')]['update']({'value':_0x17c06e['name']},{'where':{'field':_0xd0c0('0x7'),'value':_0x17c06e[_0xd0c0('0x8')]['name']}})[_0xd0c0('0x9')](function(){_0x3d5c2f();})[_0xd0c0('0xa')](function(_0x5ac333){_0x3d5c2f(_0x5ac333);});}}});}; \ No newline at end of file +var _0x6aba=['Condition','update','name','mailSubstatus','_previousDataValues','exports','models','MailSubstatus','mail_substatuses'];(function(_0x2b4d58,_0x4d2cc1){var _0x415305=function(_0x414bd9){while(--_0x414bd9){_0x2b4d58['push'](_0x2b4d58['shift']());}};_0x415305(++_0x4d2cc1);}(_0x6aba,0x83));var _0xa6ab=function(_0x405b7a,_0x46a78b){_0x405b7a=_0x405b7a-0x0;var _0x4b48b5=_0x6aba[_0x405b7a];return _0x4b48b5;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0xa6ab('0x0')]=function(_0x1f3508){var _0x9f2ac8=_0x1f3508[_0xa6ab('0x1')];return _0x1f3508['define'](_0xa6ab('0x2'),attributes,{'tableName':_0xa6ab('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3b7aaa,_0x3664f6,_0x196dbf){return _0x9f2ac8[_0xa6ab('0x4')][_0xa6ab('0x5')]({'value':_0x3b7aaa[_0xa6ab('0x6')]},{'where':{'field':_0xa6ab('0x7'),'value':_0x3b7aaa[_0xa6ab('0x8')]['name']}})['then'](function(){_0x196dbf();})['catch'](function(_0x56b8b3){_0x196dbf(_0x56b8b3);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index ea0901f..959936d 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 _0xb1a8=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment'];(function(_0x81c3c1,_0x5814d8){var _0x2b5746=function(_0x586df8){while(--_0x586df8){_0x81c3c1['push'](_0x81c3c1['shift']());}};_0x2b5746(++_0x5814d8);}(_0xb1a8,0x1a2));var _0x8b1a=function(_0x127b52,_0x5ef4e4){_0x127b52=_0x127b52-0x0;var _0x49025b=_0xb1a8[_0x127b52];return _0x49025b;};'use strict';var _=require(_0x8b1a('0x0'));var util=require('util');var moment=require(_0x8b1a('0x1'));var BPromise=require(_0x8b1a('0x2'));var rs=require(_0x8b1a('0x3'));var fs=require('fs');var Redis=require(_0x8b1a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b1a('0x5'));var logger=require(_0x8b1a('0x6'))('rpc');var config=require(_0x8b1a('0x7'));var jayson=require(_0x8b1a('0x8'));var client=jayson[_0x8b1a('0x9')][_0x8b1a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc47c84,_0x3366c8,_0x3e0f77){return new BPromise(function(_0x109dea,_0x20c719){return client['request'](_0xc47c84,_0x3e0f77)['then'](function(_0xdfaf57){logger[_0x8b1a('0xb')](_0x8b1a('0xc'),_0x3366c8,_0x8b1a('0xd'));logger[_0x8b1a('0xe')](_0x8b1a('0xf'),_0x3366c8,_0x8b1a('0xd'),JSON['stringify'](_0xdfaf57));if(_0xdfaf57[_0x8b1a('0x10')]){if(_0xdfaf57[_0x8b1a('0x10')][_0x8b1a('0x11')]===0x1f4){logger[_0x8b1a('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x3366c8,_0xdfaf57[_0x8b1a('0x10')][_0x8b1a('0x12')]);return _0x20c719(_0xdfaf57[_0x8b1a('0x10')][_0x8b1a('0x12')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x3366c8,_0xdfaf57[_0x8b1a('0x10')][_0x8b1a('0x12')]);return _0x109dea(_0xdfaf57['error'][_0x8b1a('0x12')]);}else{logger[_0x8b1a('0xb')](_0x8b1a('0xc'),_0x3366c8,_0x8b1a('0xd'));_0x109dea(_0xdfaf57['result']['message']);}})[_0x8b1a('0x13')](function(_0x28bae0){logger[_0x8b1a('0x10')](_0x8b1a('0xc'),_0x3366c8,_0x28bae0);_0x20c719(_0x28bae0);});});} \ No newline at end of file +var _0x61de=['error','code','message','MailSubstatus,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x395c1d,_0x1a4d75){var _0x1d4372=function(_0x46f3c5){while(--_0x46f3c5){_0x395c1d['push'](_0x395c1d['shift']());}};_0x1d4372(++_0x1a4d75);}(_0x61de,0x18c));var _0xe61d=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x61de[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0xe61d('0x0'));var util=require(_0xe61d('0x1'));var moment=require(_0xe61d('0x2'));var BPromise=require(_0xe61d('0x3'));var rs=require(_0xe61d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe61d('0x5'));var logger=require(_0xe61d('0x6'))(_0xe61d('0x7'));var config=require(_0xe61d('0x8'));var jayson=require(_0xe61d('0x9'));var client=jayson[_0xe61d('0xa')][_0xe61d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x388d3d,_0x2e5708,_0x15315c){return new BPromise(function(_0x293a84,_0x4da4ac){return client['request'](_0x388d3d,_0x15315c)[_0xe61d('0xc')](function(_0x439f6c){logger[_0xe61d('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x2e5708,_0xe61d('0xe'));logger[_0xe61d('0xf')](_0xe61d('0x10'),_0x2e5708,_0xe61d('0xe'),JSON[_0xe61d('0x11')](_0x439f6c));if(_0x439f6c['error']){if(_0x439f6c[_0xe61d('0x12')][_0xe61d('0x13')]===0x1f4){logger[_0xe61d('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x2e5708,_0x439f6c[_0xe61d('0x12')][_0xe61d('0x14')]);return _0x4da4ac(_0x439f6c[_0xe61d('0x12')][_0xe61d('0x14')]);}logger['error'](_0xe61d('0x15'),_0x2e5708,_0x439f6c[_0xe61d('0x12')][_0xe61d('0x14')]);return _0x293a84(_0x439f6c[_0xe61d('0x12')][_0xe61d('0x14')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x2e5708,_0xe61d('0xe'));_0x293a84(_0x439f6c['result']['message']);}})[_0xe61d('0x16')](function(_0x288d20){logger[_0xe61d('0x12')](_0xe61d('0x15'),_0x2e5708,_0x288d20);_0x4da4ac(_0x288d20);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index f96b3ea..4d40703 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 _0xf3ef=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./mailTransferReport.controller','get','index','/:id','show','post','create','put','isAuthenticated','update'];(function(_0x5d6270,_0x83b57a){var _0x168f26=function(_0x258a27){while(--_0x258a27){_0x5d6270['push'](_0x5d6270['shift']());}};_0x168f26(++_0x83b57a);}(_0xf3ef,0x11b));var _0xff3e=function(_0x2b37b5,_0x4f677b){_0x2b37b5=_0x2b37b5-0x0;var _0x36df6d=_0xf3ef[_0x2b37b5];return _0x36df6d;};'use strict';var multer=require(_0xff3e('0x0'));var util=require(_0xff3e('0x1'));var path=require('path');var timeout=require(_0xff3e('0x2'));var express=require(_0xff3e('0x3'));var router=express[_0xff3e('0x4')]();var fs_extra=require(_0xff3e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xff3e('0x6'));var controller=require(_0xff3e('0x7'));router[_0xff3e('0x8')]('/',auth['isAuthenticated'](),controller[_0xff3e('0x9')]);router[_0xff3e('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xff3e('0x8')](_0xff3e('0xa'),auth['isAuthenticated'](),controller[_0xff3e('0xb')]);router[_0xff3e('0xc')]('/',auth['isAuthenticated'](),controller[_0xff3e('0xd')]);router[_0xff3e('0xe')](_0xff3e('0xa'),auth[_0xff3e('0xf')](),controller[_0xff3e('0x10')]);router[_0xff3e('0x11')](_0xff3e('0xa'),auth[_0xff3e('0xf')](),controller[_0xff3e('0x12')]);module[_0xff3e('0x13')]=router; \ No newline at end of file +var _0x7527=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0x16c808,_0x6ff35e){var _0x280ae5=function(_0x465529){while(--_0x465529){_0x16c808['push'](_0x16c808['shift']());}};_0x280ae5(++_0x6ff35e);}(_0x7527,0x14d));var _0x7752=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7527[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7752('0x0'));var util=require(_0x7752('0x1'));var path=require(_0x7752('0x2'));var timeout=require(_0x7752('0x3'));var express=require(_0x7752('0x4'));var router=express[_0x7752('0x5')]();var fs_extra=require(_0x7752('0x6'));var auth=require(_0x7752('0x7'));var interaction=require(_0x7752('0x8'));var config=require(_0x7752('0x9'));var controller=require(_0x7752('0xa'));router[_0x7752('0xb')]('/',auth['isAuthenticated'](),controller[_0x7752('0xc')]);router['get'](_0x7752('0xd'),auth[_0x7752('0xe')](),controller[_0x7752('0xf')]);router['get'](_0x7752('0x10'),auth['isAuthenticated'](),controller[_0x7752('0x11')]);router[_0x7752('0x12')]('/',auth[_0x7752('0xe')](),controller[_0x7752('0x13')]);router[_0x7752('0x14')](_0x7752('0x10'),auth[_0x7752('0xe')](),controller[_0x7752('0x15')]);router[_0x7752('0x16')]('/:id',auth[_0x7752('0xe')](),controller['destroy']);module[_0x7752('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index d5eb899..cb351b3 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x4347ec,_0x41c4b8){var _0x4c8314=function(_0x583acd){while(--_0x583acd){_0x4347ec['push'](_0x4347ec['shift']());}};_0x4c8314(++_0x41c4b8);}(_0x9bde,0xe1));var _0xe9bd=function(_0x58fa57,_0x345627){_0x58fa57=_0x58fa57-0x0;var _0x542229=_0x9bde[_0x58fa57];return _0x542229;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x122959,_0x5bdf97){_0x122959=_0x122959-0x0;var _0x2ac167=_0xb43b[_0x122959];return _0x2ac167;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index e8c1cc4..39ca3dd 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 _0x0098=['key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type'];(function(_0x1596c1,_0x3463f2){var _0x293209=function(_0x57bdb9){while(--_0x57bdb9){_0x1596c1['push'](_0x1596c1['shift']());}};_0x293209(++_0x3463f2);}(_0x0098,0x6b));var _0x8009=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0098[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x8009('0x0'));var rimraf=require(_0x8009('0x1'));var zipdir=require(_0x8009('0x2'));var jsonpatch=require(_0x8009('0x3'));var rp=require(_0x8009('0x4'));var moment=require(_0x8009('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8009('0x6'));var util=require(_0x8009('0x7'));var path=require(_0x8009('0x8'));var sox=require(_0x8009('0x9'));var csv=require(_0x8009('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8009('0xb'));var _=require(_0x8009('0xc'));var squel=require(_0x8009('0xd'));var crypto=require('crypto');var jsforce=require(_0x8009('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8009('0xa'));var querystring=require(_0x8009('0xf'));var Papa=require('papaparse');var Redis=require(_0x8009('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8009('0x11'));var as=require(_0x8009('0x12'));var hardwareService=require(_0x8009('0x13'));var logger=require(_0x8009('0x14'))(_0x8009('0x15'));var utils=require(_0x8009('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8009('0x17'));var db=require(_0x8009('0x18'))['db'];function respondWithStatusCode(_0x10c86f,_0x7ccb1){_0x7ccb1=_0x7ccb1||0xcc;return function(_0x5a028c){if(_0x5a028c){return _0x10c86f[_0x8009('0x19')](_0x7ccb1);}return _0x10c86f[_0x8009('0x1a')](_0x7ccb1)[_0x8009('0x1b')]();};}function respondWithResult(_0x20f812,_0x3271f3){_0x3271f3=_0x3271f3||0xc8;return function(_0x22a458){if(_0x22a458){return _0x20f812[_0x8009('0x1a')](_0x3271f3)[_0x8009('0x1c')](_0x22a458);}};}function respondWithFilteredResult(_0x4abc8b,_0x4292b6){return function(_0x437aaf){if(_0x437aaf){var _0x60ec80=typeof _0x4292b6[_0x8009('0x1d')]===_0x8009('0x1e')&&typeof _0x4292b6[_0x8009('0x1f')]===_0x8009('0x1e');var _0x1ccd34=_0x437aaf['count'];var _0x55f890=_0x60ec80?0x0:_0x4292b6[_0x8009('0x1d')];var _0x3ade69=_0x60ec80?_0x437aaf[_0x8009('0x20')]:_0x4292b6[_0x8009('0x1d')]+_0x4292b6['limit'];var _0xe045bb;if(_0x3ade69>=_0x1ccd34){_0x3ade69=_0x1ccd34;_0xe045bb=0xc8;}else{_0xe045bb=0xce;}_0x4abc8b['status'](_0xe045bb);return _0x4abc8b[_0x8009('0x21')](_0x8009('0x22'),_0x55f890+'-'+_0x3ade69+'/'+_0x1ccd34)[_0x8009('0x1c')](_0x437aaf);}return null;};}function patchUpdates(_0x38ee83){return function(_0x33d694){try{jsonpatch[_0x8009('0x23')](_0x33d694,_0x38ee83,!![]);}catch(_0x4f7322){return BPromise['reject'](_0x4f7322);}return _0x33d694[_0x8009('0x24')]();};}function saveUpdates(_0x715e83,_0x91771a){return function(_0x29491c){if(_0x29491c){return _0x29491c['update'](_0x715e83)[_0x8009('0x25')](function(_0x1690d5){return _0x1690d5;});}return null;};}function removeEntity(_0x3124d1,_0x5a579a){return function(_0x3546d4){if(_0x3546d4){return _0x3546d4[_0x8009('0x26')]()['then'](function(){_0x3124d1[_0x8009('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6fce9f,_0x524287){return function(_0x2d0b72){if(!_0x2d0b72){_0x6fce9f[_0x8009('0x19')](0x194);}return _0x2d0b72;};}function handleError(_0x42f3df,_0x1f34eb){_0x1f34eb=_0x1f34eb||0x1f4;return function(_0x265b1e){logger[_0x8009('0x27')](_0x265b1e[_0x8009('0x28')]);if(_0x265b1e[_0x8009('0x29')]){delete _0x265b1e[_0x8009('0x29')];}_0x42f3df['status'](_0x1f34eb)[_0x8009('0x2a')](_0x265b1e);};}exports[_0x8009('0x2b')]=function(_0x2da6cc,_0x5eb513){var _0x4da926={},_0x37d50e={},_0x2d788c={'count':0x0,'rows':[]};var _0xbb74b3=_[_0x8009('0x2c')](db[_0x8009('0x2d')][_0x8009('0x2e')],function(_0x806ba6){return{'name':_0x806ba6[_0x8009('0x2f')],'type':_0x806ba6[_0x8009('0x30')][_0x8009('0x31')]};});_0x37d50e[_0x8009('0x32')]=_[_0x8009('0x2c')](_0xbb74b3,'name');_0x37d50e[_0x8009('0x33')]=_['keys'](_0x2da6cc[_0x8009('0x33')]);_0x37d50e[_0x8009('0x34')]=_[_0x8009('0x35')](_0x37d50e[_0x8009('0x32')],_0x37d50e[_0x8009('0x33')]);_0x4da926['attributes']=_['intersection'](_0x37d50e[_0x8009('0x32')],qs[_0x8009('0x36')](_0x2da6cc[_0x8009('0x33')][_0x8009('0x36')]));_0x4da926[_0x8009('0x37')]=_0x4da926[_0x8009('0x37')][_0x8009('0x38')]?_0x4da926['attributes']:_0x37d50e[_0x8009('0x32')];if(!_0x2da6cc['query'][_0x8009('0x39')](_0x8009('0x3a'))){_0x4da926[_0x8009('0x1f')]=qs[_0x8009('0x1f')](_0x2da6cc[_0x8009('0x33')][_0x8009('0x1f')]);_0x4da926['offset']=qs['offset'](_0x2da6cc[_0x8009('0x33')]['offset']);}_0x4da926[_0x8009('0x3b')]=qs[_0x8009('0x3c')](_0x2da6cc[_0x8009('0x33')][_0x8009('0x3c')]);_0x4da926[_0x8009('0x3d')]=qs['filters'](_[_0x8009('0x3e')](_0x2da6cc[_0x8009('0x33')],_0x37d50e[_0x8009('0x34')]),_0xbb74b3);if(_0x2da6cc[_0x8009('0x33')][_0x8009('0x3f')]){_0x4da926[_0x8009('0x3d')]=_[_0x8009('0x40')](_0x4da926['where'],{'$or':_[_0x8009('0x2c')](_0xbb74b3,function(_0x109da5){if(_0x109da5[_0x8009('0x30')]!==_0x8009('0x41')){var _0x2788a6={};_0x2788a6[_0x109da5[_0x8009('0x29')]]={'$like':'%'+_0x2da6cc[_0x8009('0x33')][_0x8009('0x3f')]+'%'};return _0x2788a6;}})});}_0x4da926=_['merge']({},_0x4da926,_0x2da6cc['options']);var _0x79ea0e={'where':_0x4da926[_0x8009('0x3d')]};return db[_0x8009('0x2d')][_0x8009('0x20')](_0x79ea0e)[_0x8009('0x25')](function(_0x5d0846){_0x2d788c['count']=_0x5d0846;if(_0x2da6cc[_0x8009('0x33')][_0x8009('0x42')]){_0x4da926['include']=[{'all':!![]}];}return db[_0x8009('0x2d')]['findAll'](_0x4da926);})['then'](function(_0x5c5759){_0x2d788c[_0x8009('0x43')]=_0x5c5759;return _0x2d788c;})['then'](respondWithFilteredResult(_0x5eb513,_0x4da926))[_0x8009('0x44')](handleError(_0x5eb513,null));};exports[_0x8009('0x45')]=function(_0x48298a,_0x57d598){var _0x3cb713={'raw':!![],'where':{'id':_0x48298a[_0x8009('0x46')]['id']}},_0x29eb9a={};_0x29eb9a['model']=_['keys'](db[_0x8009('0x2d')][_0x8009('0x2e')]);_0x29eb9a['query']=_['keys'](_0x48298a['query']);_0x29eb9a['filters']=_['intersection'](_0x29eb9a['model'],_0x29eb9a['query']);_0x3cb713[_0x8009('0x37')]=_[_0x8009('0x35')](_0x29eb9a['model'],qs['fields'](_0x48298a['query'][_0x8009('0x36')]));_0x3cb713['attributes']=_0x3cb713[_0x8009('0x37')][_0x8009('0x38')]?_0x3cb713[_0x8009('0x37')]:_0x29eb9a[_0x8009('0x32')];if(_0x48298a[_0x8009('0x33')][_0x8009('0x42')]){_0x3cb713[_0x8009('0x47')]=[{'all':!![]}];}_0x3cb713=_[_0x8009('0x40')]({},_0x3cb713,_0x48298a[_0x8009('0x48')]);return db['MailTransferReport'][_0x8009('0x49')](_0x3cb713)[_0x8009('0x25')](handleEntityNotFound(_0x57d598,null))[_0x8009('0x25')](respondWithResult(_0x57d598,null))[_0x8009('0x44')](handleError(_0x57d598,null));};exports[_0x8009('0x4a')]=function(_0x26ddcb,_0x559a6e){return db[_0x8009('0x2d')][_0x8009('0x4a')](_0x26ddcb[_0x8009('0x4b')],{})[_0x8009('0x25')](respondWithResult(_0x559a6e,0xc9))['catch'](handleError(_0x559a6e,null));};exports[_0x8009('0x4c')]=function(_0x1212f3,_0x553cf3){if(_0x1212f3[_0x8009('0x4b')]['id']){delete _0x1212f3[_0x8009('0x4b')]['id'];}return db['MailTransferReport'][_0x8009('0x49')]({'where':{'id':_0x1212f3['params']['id']}})[_0x8009('0x25')](handleEntityNotFound(_0x553cf3,null))[_0x8009('0x25')](saveUpdates(_0x1212f3[_0x8009('0x4b')],null))[_0x8009('0x25')](respondWithResult(_0x553cf3,null))[_0x8009('0x44')](handleError(_0x553cf3,null));};exports[_0x8009('0x26')]=function(_0x2e878e,_0x47922a){return db[_0x8009('0x2d')][_0x8009('0x49')]({'where':{'id':_0x2e878e[_0x8009('0x46')]['id']}})[_0x8009('0x25')](handleEntityNotFound(_0x47922a,null))[_0x8009('0x25')](removeEntity(_0x47922a,null))[_0x8009('0x44')](handleError(_0x47922a,null));};exports[_0x8009('0x4d')]=function(_0x29b486,_0x20a904){return db[_0x8009('0x2d')][_0x8009('0x4d')]()[_0x8009('0x25')](respondWithResult(_0x20a904,null))[_0x8009('0x44')](handleError(_0x20a904,null));}; \ No newline at end of file +var _0x8e10=['eml-format','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','catch','params','keys','find','create','body'];(function(_0x3b2244,_0x54873f){var _0x2dcc14=function(_0x53d73f){while(--_0x53d73f){_0x3b2244['push'](_0x3b2244['shift']());}};_0x2dcc14(++_0x54873f);}(_0x8e10,0x1dc));var _0x08e1=function(_0x42f3a5,_0x3a4470){_0x42f3a5=_0x42f3a5-0x0;var _0x1a7d74=_0x8e10[_0x42f3a5];return _0x1a7d74;};'use strict';var emlformat=require(_0x08e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x08e1('0x1'));var jsonpatch=require(_0x08e1('0x2'));var rp=require(_0x08e1('0x3'));var moment=require(_0x08e1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x08e1('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x08e1('0x6'));var ejs=require(_0x08e1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x08e1('0x8'));var squel=require(_0x08e1('0x9'));var crypto=require(_0x08e1('0xa'));var jsforce=require(_0x08e1('0xb'));var deskjs=require(_0x08e1('0xc'));var toCsv=require(_0x08e1('0x6'));var querystring=require(_0x08e1('0xd'));var Papa=require(_0x08e1('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x08e1('0xf'));var hardwareService=require(_0x08e1('0x10'));var logger=require(_0x08e1('0x11'))(_0x08e1('0x12'));var utils=require(_0x08e1('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x08e1('0x14'))['db'];function respondWithStatusCode(_0x3e1a8d,_0x22f009){_0x22f009=_0x22f009||0xcc;return function(_0x4c09d1){if(_0x4c09d1){return _0x3e1a8d['sendStatus'](_0x22f009);}return _0x3e1a8d[_0x08e1('0x15')](_0x22f009)[_0x08e1('0x16')]();};}function respondWithResult(_0x582ec9,_0x8434f5){_0x8434f5=_0x8434f5||0xc8;return function(_0x3e0a84){if(_0x3e0a84){return _0x582ec9[_0x08e1('0x15')](_0x8434f5)[_0x08e1('0x17')](_0x3e0a84);}};}function respondWithFilteredResult(_0x512d7a,_0x4163a9){return function(_0x2d48fe){if(_0x2d48fe){var _0x3533bd=typeof _0x4163a9[_0x08e1('0x18')]===_0x08e1('0x19')&&typeof _0x4163a9['limit']==='undefined';var _0x4a18e6=_0x2d48fe[_0x08e1('0x1a')];var _0x2c2dd6=_0x3533bd?0x0:_0x4163a9['offset'];var _0x3692da=_0x3533bd?_0x2d48fe[_0x08e1('0x1a')]:_0x4163a9[_0x08e1('0x18')]+_0x4163a9[_0x08e1('0x1b')];var _0x2a21a4;if(_0x3692da>=_0x4a18e6){_0x3692da=_0x4a18e6;_0x2a21a4=0xc8;}else{_0x2a21a4=0xce;}_0x512d7a['status'](_0x2a21a4);return _0x512d7a[_0x08e1('0x1c')](_0x08e1('0x1d'),_0x2c2dd6+'-'+_0x3692da+'/'+_0x4a18e6)['json'](_0x2d48fe);}return null;};}function patchUpdates(_0x2091a0){return function(_0x21734f){try{jsonpatch[_0x08e1('0x1e')](_0x21734f,_0x2091a0,!![]);}catch(_0x4d165d){return BPromise[_0x08e1('0x1f')](_0x4d165d);}return _0x21734f['save']();};}function saveUpdates(_0x3621a8,_0x2c2f91){return function(_0x32c84c){if(_0x32c84c){return _0x32c84c[_0x08e1('0x20')](_0x3621a8)['then'](function(_0x48cd6d){return _0x48cd6d;});}return null;};}function removeEntity(_0x14eabf,_0x5b8c1f){return function(_0x1265ad){if(_0x1265ad){return _0x1265ad[_0x08e1('0x21')]()[_0x08e1('0x22')](function(){_0x14eabf[_0x08e1('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b1271,_0x4f9bb3){return function(_0x56fe09){if(!_0x56fe09){_0x2b1271['sendStatus'](0x194);}return _0x56fe09;};}function handleError(_0x1dcd4c,_0x43b231){_0x43b231=_0x43b231||0x1f4;return function(_0x2c24c1){logger[_0x08e1('0x23')](_0x2c24c1['stack']);if(_0x2c24c1[_0x08e1('0x24')]){delete _0x2c24c1[_0x08e1('0x24')];}_0x1dcd4c['status'](_0x43b231)[_0x08e1('0x25')](_0x2c24c1);};}exports[_0x08e1('0x26')]=function(_0x35ec3f,_0x20e3af){var _0x1a9bef={},_0x43c196={},_0x2e1bd2={'count':0x0,'rows':[]};var _0x4dc249=_[_0x08e1('0x27')](db[_0x08e1('0x28')][_0x08e1('0x29')],function(_0xff1dc7){return{'name':_0xff1dc7[_0x08e1('0x2a')],'type':_0xff1dc7[_0x08e1('0x2b')]['key']};});_0x43c196[_0x08e1('0x2c')]=_['map'](_0x4dc249,_0x08e1('0x24'));_0x43c196[_0x08e1('0x2d')]=_['keys'](_0x35ec3f['query']);_0x43c196['filters']=_[_0x08e1('0x2e')](_0x43c196[_0x08e1('0x2c')],_0x43c196['query']);_0x1a9bef['attributes']=_[_0x08e1('0x2e')](_0x43c196[_0x08e1('0x2c')],qs[_0x08e1('0x2f')](_0x35ec3f[_0x08e1('0x2d')][_0x08e1('0x2f')]));_0x1a9bef['attributes']=_0x1a9bef['attributes'][_0x08e1('0x30')]?_0x1a9bef[_0x08e1('0x31')]:_0x43c196[_0x08e1('0x2c')];if(!_0x35ec3f[_0x08e1('0x2d')][_0x08e1('0x32')](_0x08e1('0x33'))){_0x1a9bef[_0x08e1('0x1b')]=qs['limit'](_0x35ec3f[_0x08e1('0x2d')]['limit']);_0x1a9bef[_0x08e1('0x18')]=qs[_0x08e1('0x18')](_0x35ec3f[_0x08e1('0x2d')][_0x08e1('0x18')]);}_0x1a9bef['order']=qs[_0x08e1('0x34')](_0x35ec3f[_0x08e1('0x2d')]['sort']);_0x1a9bef['where']=qs['filters'](_[_0x08e1('0x35')](_0x35ec3f[_0x08e1('0x2d')],_0x43c196[_0x08e1('0x36')]),_0x4dc249);if(_0x35ec3f[_0x08e1('0x2d')][_0x08e1('0x37')]){_0x1a9bef[_0x08e1('0x38')]=_[_0x08e1('0x39')](_0x1a9bef[_0x08e1('0x38')],{'$or':_['map'](_0x4dc249,function(_0x3e9f31){if(_0x3e9f31['type']!==_0x08e1('0x3a')){var _0x2f9708={};_0x2f9708[_0x3e9f31[_0x08e1('0x24')]]={'$like':'%'+_0x35ec3f[_0x08e1('0x2d')][_0x08e1('0x37')]+'%'};return _0x2f9708;}})});}_0x1a9bef=_['merge']({},_0x1a9bef,_0x35ec3f[_0x08e1('0x3b')]);var _0x1abb2a={'where':_0x1a9bef['where']};return db['MailTransferReport']['count'](_0x1abb2a)[_0x08e1('0x22')](function(_0x5032d1){_0x2e1bd2['count']=_0x5032d1;if(_0x35ec3f['query'][_0x08e1('0x3c')]){_0x1a9bef[_0x08e1('0x3d')]=[{'all':!![]}];}return db[_0x08e1('0x28')]['findAll'](_0x1a9bef);})['then'](function(_0x37c1fe){_0x2e1bd2['rows']=_0x37c1fe;return _0x2e1bd2;})[_0x08e1('0x22')](respondWithFilteredResult(_0x20e3af,_0x1a9bef))[_0x08e1('0x3e')](handleError(_0x20e3af,null));};exports['show']=function(_0x398156,_0x15dbce){var _0x24d3bd={'raw':!![],'where':{'id':_0x398156[_0x08e1('0x3f')]['id']}},_0x374eee={};_0x374eee[_0x08e1('0x2c')]=_[_0x08e1('0x40')](db['MailTransferReport'][_0x08e1('0x29')]);_0x374eee['query']=_[_0x08e1('0x40')](_0x398156['query']);_0x374eee['filters']=_[_0x08e1('0x2e')](_0x374eee[_0x08e1('0x2c')],_0x374eee['query']);_0x24d3bd['attributes']=_[_0x08e1('0x2e')](_0x374eee[_0x08e1('0x2c')],qs[_0x08e1('0x2f')](_0x398156['query'][_0x08e1('0x2f')]));_0x24d3bd[_0x08e1('0x31')]=_0x24d3bd[_0x08e1('0x31')][_0x08e1('0x30')]?_0x24d3bd[_0x08e1('0x31')]:_0x374eee[_0x08e1('0x2c')];if(_0x398156[_0x08e1('0x2d')][_0x08e1('0x3c')]){_0x24d3bd[_0x08e1('0x3d')]=[{'all':!![]}];}_0x24d3bd=_[_0x08e1('0x39')]({},_0x24d3bd,_0x398156[_0x08e1('0x3b')]);return db[_0x08e1('0x28')][_0x08e1('0x41')](_0x24d3bd)[_0x08e1('0x22')](handleEntityNotFound(_0x15dbce,null))[_0x08e1('0x22')](respondWithResult(_0x15dbce,null))[_0x08e1('0x3e')](handleError(_0x15dbce,null));};exports[_0x08e1('0x42')]=function(_0x1597f2,_0x57c74d){return db['MailTransferReport'][_0x08e1('0x42')](_0x1597f2[_0x08e1('0x43')],{})['then'](respondWithResult(_0x57c74d,0xc9))['catch'](handleError(_0x57c74d,null));};exports[_0x08e1('0x20')]=function(_0x5d9cec,_0x58cf2a){if(_0x5d9cec[_0x08e1('0x43')]['id']){delete _0x5d9cec['body']['id'];}return db[_0x08e1('0x28')][_0x08e1('0x41')]({'where':{'id':_0x5d9cec[_0x08e1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x58cf2a,null))[_0x08e1('0x22')](saveUpdates(_0x5d9cec[_0x08e1('0x43')],null))['then'](respondWithResult(_0x58cf2a,null))['catch'](handleError(_0x58cf2a,null));};exports[_0x08e1('0x21')]=function(_0x31994a,_0x2708af){return db[_0x08e1('0x28')][_0x08e1('0x41')]({'where':{'id':_0x31994a['params']['id']}})[_0x08e1('0x22')](handleEntityNotFound(_0x2708af,null))[_0x08e1('0x22')](removeEntity(_0x2708af,null))[_0x08e1('0x3e')](handleError(_0x2708af,null));};exports['describe']=function(_0x4f672d,_0x4ee34c){return db[_0x08e1('0x28')]['describe']()[_0x08e1('0x22')](respondWithResult(_0x4ee34c,null))[_0x08e1('0x3e')](handleError(_0x4ee34c,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index de0e348..7f4ceff 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 _0x693d=['request-promise','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x27bd2c,_0x24bd98){var _0x3784ea=function(_0x4ca802){while(--_0x4ca802){_0x27bd2c['push'](_0x27bd2c['shift']());}};_0x3784ea(++_0x24bd98);}(_0x693d,0x153));var _0xd693=function(_0x543628,_0x17a06){_0x543628=_0x543628-0x0;var _0x1475f9=_0x693d[_0x543628];return _0x1475f9;};'use strict';var _=require(_0xd693('0x0'));var util=require(_0xd693('0x1'));var logger=require(_0xd693('0x2'))(_0xd693('0x3'));var moment=require(_0xd693('0x4'));var BPromise=require(_0xd693('0x5'));var rp=require(_0xd693('0x6'));var fs=require('fs');var path=require(_0xd693('0x7'));var rimraf=require(_0xd693('0x8'));var config=require('../../config/environment');var attributes=require(_0xd693('0x9'));module[_0xd693('0xa')]=function(_0x49e710,_0x4cf777){return _0x49e710[_0xd693('0xb')](_0xd693('0xc'),attributes,{'tableName':_0xd693('0xd'),'paranoid':![],'indexes':[{'name':_0xd693('0xe'),'fields':[_0xd693('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x34e7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x6f62d,_0x163623){var _0xb18fb=function(_0x35a31f){while(--_0x35a31f){_0x6f62d['push'](_0x6f62d['shift']());}};_0xb18fb(++_0x163623);}(_0x34e7,0x164));var _0x734e=function(_0x7da6e8,_0x4756af){_0x7da6e8=_0x7da6e8-0x0;var _0x3e1217=_0x34e7[_0x7da6e8];return _0x3e1217;};'use strict';var _=require(_0x734e('0x0'));var util=require(_0x734e('0x1'));var logger=require(_0x734e('0x2'))(_0x734e('0x3'));var moment=require(_0x734e('0x4'));var BPromise=require(_0x734e('0x5'));var rp=require(_0x734e('0x6'));var fs=require('fs');var path=require(_0x734e('0x7'));var rimraf=require(_0x734e('0x8'));var config=require(_0x734e('0x9'));var attributes=require(_0x734e('0xa'));module[_0x734e('0xb')]=function(_0x3405b1,_0x192562){return _0x3405b1['define'](_0x734e('0xc'),attributes,{'tableName':_0x734e('0xd'),'paranoid':![],'indexes':[{'name':_0x734e('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index dcb60f0..85c9e36 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 _0xe832=['jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','util','moment','bluebird','ioredis','rpc'];(function(_0x3e5147,_0x33eef9){var _0x18c779=function(_0x2a143c){while(--_0x2a143c){_0x3e5147['push'](_0x3e5147['shift']());}};_0x18c779(++_0x33eef9);}(_0xe832,0xb5));var _0x2e83=function(_0xc78d1e,_0x34b0ee){_0xc78d1e=_0xc78d1e-0x0;var _0x2b9af0=_0xe832[_0xc78d1e];return _0x2b9af0;};'use strict';var _=require(_0x2e83('0x0'));var util=require(_0x2e83('0x1'));var moment=require(_0x2e83('0x2'));var BPromise=require(_0x2e83('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e83('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2e83('0x5'));var config=require('../../config/environment');var jayson=require(_0x2e83('0x6'));var client=jayson[_0x2e83('0x7')][_0x2e83('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32072c,_0x322b69,_0x4e45e6){return new BPromise(function(_0x7af2eb,_0x523338){return client['request'](_0x32072c,_0x4e45e6)[_0x2e83('0x9')](function(_0x106468){logger[_0x2e83('0xa')](_0x2e83('0xb'),_0x322b69,_0x2e83('0xc'));logger[_0x2e83('0xd')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x322b69,'request\x20sent',JSON[_0x2e83('0xe')](_0x106468));if(_0x106468['error']){if(_0x106468[_0x2e83('0xf')]['code']===0x1f4){logger[_0x2e83('0xf')](_0x2e83('0xb'),_0x322b69,_0x106468[_0x2e83('0xf')][_0x2e83('0x10')]);return _0x523338(_0x106468[_0x2e83('0xf')][_0x2e83('0x10')]);}logger[_0x2e83('0xf')](_0x2e83('0xb'),_0x322b69,_0x106468[_0x2e83('0xf')]['message']);return _0x7af2eb(_0x106468[_0x2e83('0xf')][_0x2e83('0x10')]);}else{logger['info'](_0x2e83('0xb'),_0x322b69,_0x2e83('0xc'));_0x7af2eb(_0x106468['result'][_0x2e83('0x10')]);}})['catch'](function(_0x5d34bb){logger[_0x2e83('0xf')](_0x2e83('0xb'),_0x322b69,_0x5d34bb);_0x523338(_0x5d34bb);});});} \ No newline at end of file +var _0xae30=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash'];(function(_0x6f479f,_0x287747){var _0x1306ab=function(_0x45a45f){while(--_0x45a45f){_0x6f479f['push'](_0x6f479f['shift']());}};_0x1306ab(++_0x287747);}(_0xae30,0x107));var _0x0ae3=function(_0x3ff9bc,_0x51778d){_0x3ff9bc=_0x3ff9bc-0x0;var _0x4017d6=_0xae30[_0x3ff9bc];return _0x4017d6;};'use strict';var _=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var moment=require('moment');var BPromise=require(_0x0ae3('0x2'));var rs=require(_0x0ae3('0x3'));var fs=require('fs');var Redis=require(_0x0ae3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ae3('0x5'));var logger=require(_0x0ae3('0x6'))(_0x0ae3('0x7'));var config=require(_0x0ae3('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0ae3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b5c4e,_0x426bcc,_0x3db8b2){return new BPromise(function(_0x3722cd,_0x345171){return client[_0x0ae3('0xa')](_0x3b5c4e,_0x3db8b2)[_0x0ae3('0xb')](function(_0x3ce9ae){logger['info'](_0x0ae3('0xc'),_0x426bcc,_0x0ae3('0xd'));logger[_0x0ae3('0xe')](_0x0ae3('0xf'),_0x426bcc,_0x0ae3('0xd'),JSON[_0x0ae3('0x10')](_0x3ce9ae));if(_0x3ce9ae[_0x0ae3('0x11')]){if(_0x3ce9ae[_0x0ae3('0x11')][_0x0ae3('0x12')]===0x1f4){logger[_0x0ae3('0x11')](_0x0ae3('0xc'),_0x426bcc,_0x3ce9ae[_0x0ae3('0x11')][_0x0ae3('0x13')]);return _0x345171(_0x3ce9ae[_0x0ae3('0x11')][_0x0ae3('0x13')]);}logger[_0x0ae3('0x11')](_0x0ae3('0xc'),_0x426bcc,_0x3ce9ae['error'][_0x0ae3('0x13')]);return _0x3722cd(_0x3ce9ae[_0x0ae3('0x11')][_0x0ae3('0x13')]);}else{logger[_0x0ae3('0x14')](_0x0ae3('0xc'),_0x426bcc,_0x0ae3('0xd'));_0x3722cd(_0x3ce9ae['result'][_0x0ae3('0x13')]);}})[_0x0ae3('0x15')](function(_0x5a8bf0){logger[_0x0ae3('0x11')](_0x0ae3('0xc'),_0x426bcc,_0x5a8bf0);_0x345171(_0x5a8bf0);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index bd84646..c9231ab 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 _0xcbd5=['/:id','show','create','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','get','/describe','isAuthenticated','describe'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0xcbd5,0xde));var _0x5cbd=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xcbd5[_0x4ae829];return _0x256b31;};'use strict';var multer=require('multer');var util=require(_0x5cbd('0x0'));var path=require(_0x5cbd('0x1'));var timeout=require(_0x5cbd('0x2'));var express=require('express');var router=express[_0x5cbd('0x3')]();var fs_extra=require(_0x5cbd('0x4'));var auth=require(_0x5cbd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5cbd('0x6'));var controller=require(_0x5cbd('0x7'));router[_0x5cbd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5cbd('0x8')](_0x5cbd('0x9'),auth[_0x5cbd('0xa')](),controller[_0x5cbd('0xb')]);router['get'](_0x5cbd('0xc'),auth['isAuthenticated'](),controller[_0x5cbd('0xd')]);router['post']('/',auth[_0x5cbd('0xa')](),controller[_0x5cbd('0xe')]);router['put'](_0x5cbd('0xc'),auth[_0x5cbd('0xa')](),controller[_0x5cbd('0xf')]);router[_0x5cbd('0x10')](_0x5cbd('0xc'),auth[_0x5cbd('0xa')](),controller['destroy']);module[_0x5cbd('0x11')]=router; \ No newline at end of file +var _0xa65a=['/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','index','get'];(function(_0x1e367c,_0x475959){var _0x10ce30=function(_0x50e1f3){while(--_0x50e1f3){_0x1e367c['push'](_0x1e367c['shift']());}};_0x10ce30(++_0x475959);}(_0xa65a,0x197));var _0xaa65=function(_0x5b92b7,_0xe20e03){_0x5b92b7=_0x5b92b7-0x0;var _0x52553f=_0xa65a[_0x5b92b7];return _0x52553f;};'use strict';var multer=require(_0xaa65('0x0'));var util=require('util');var path=require(_0xaa65('0x1'));var timeout=require('connect-timeout');var express=require(_0xaa65('0x2'));var router=express[_0xaa65('0x3')]();var fs_extra=require(_0xaa65('0x4'));var auth=require(_0xaa65('0x5'));var interaction=require(_0xaa65('0x6'));var config=require(_0xaa65('0x7'));var controller=require(_0xaa65('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xaa65('0x9')]);router[_0xaa65('0xa')](_0xaa65('0xb'),auth[_0xaa65('0xc')](),controller[_0xaa65('0xd')]);router[_0xaa65('0xa')](_0xaa65('0xe'),auth[_0xaa65('0xc')](),controller['show']);router[_0xaa65('0xf')]('/',auth['isAuthenticated'](),controller[_0xaa65('0x10')]);router[_0xaa65('0x11')](_0xaa65('0xe'),auth[_0xaa65('0xc')](),controller[_0xaa65('0x12')]);router[_0xaa65('0x13')](_0xaa65('0xe'),auth[_0xaa65('0xc')](),controller[_0xaa65('0x14')]);module[_0xaa65('0x15')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index a8e370a..a0b68c3 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 _0x7963=['enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','DATE','getDataValue'];(function(_0x92713a,_0x68f8b0){var _0x1893e1=function(_0xe49768){while(--_0xe49768){_0x92713a['push'](_0x92713a['shift']());}};_0x1893e1(++_0x68f8b0);}(_0x7963,0x92));var _0x3796=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x7963[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require(_0x3796('0x0'));var moment=require(_0x3796('0x1'));module[_0x3796('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x3796('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x3796('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x3796('0x5')]},'exitAt':{'type':Sequelize[_0x3796('0x5')],'set':function(_0x19ed04){var _0x6a4358=moment(_0x19ed04);var _0x1b42cd=moment(this[_0x3796('0x6')](_0x3796('0x7')));var _0x209f52=_0x6a4358[_0x3796('0x8')](_0x1b42cd,_0x3796('0x9'));this[_0x3796('0xa')]('exitAt',_0x19ed04);this[_0x3796('0xa')](_0x3796('0xb'),_0x209f52>=0x0?_0x209f52:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x3796('0xc')},'data2':{'type':Sequelize[_0x3796('0x3')],'comment':_0x3796('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0x3796('0xe')},'data4':{'type':Sequelize[_0x3796('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x3796('0x3')],'comment':_0x3796('0xf')},'role':{'type':Sequelize[_0x3796('0x3')]},'internal':{'type':Sequelize[_0x3796('0x10')]},'uniqueid':{'type':Sequelize[_0x3796('0x3')]}}; \ No newline at end of file +var _0xcafd=['DATE','enterAt','diff','setDataValue','duration','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER'];(function(_0x398890,_0x9d1f64){var _0x11e091=function(_0x4391c4){while(--_0x4391c4){_0x398890['push'](_0x398890['shift']());}};_0x11e091(++_0x9d1f64);}(_0xcafd,0xcb));var _0xdcaf=function(_0x298c88,_0x3d4f2d){_0x298c88=_0x298c88-0x0;var _0x259c96=_0xcafd[_0x298c88];return _0x259c96;};'use strict';var Sequelize=require(_0xdcaf('0x0'));var moment=require(_0xdcaf('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xdcaf('0x2')]},'type':{'type':Sequelize[_0xdcaf('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xdcaf('0x3')},'duration':{'type':Sequelize[_0xdcaf('0x4')]},'enterAt':{'type':Sequelize[_0xdcaf('0x5')]},'exitAt':{'type':Sequelize[_0xdcaf('0x5')],'set':function(_0x56bae3){var _0x1deb48=moment(_0x56bae3);var _0x32aafc=moment(this['getDataValue'](_0xdcaf('0x6')));var _0x21cf9a=_0x1deb48[_0xdcaf('0x7')](_0x32aafc,'seconds');this[_0xdcaf('0x8')]('exitAt',_0x56bae3);this[_0xdcaf('0x8')](_0xdcaf('0x9'),_0x21cf9a>=0x0?_0x21cf9a:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xdcaf('0x2')],'comment':_0xdcaf('0xa')},'data3':{'type':Sequelize[_0xdcaf('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0xdcaf('0xb')},'data5':{'type':Sequelize['STRING'],'comment':_0xdcaf('0xc')},'role':{'type':Sequelize[_0xdcaf('0x2')]},'internal':{'type':Sequelize[_0xdcaf('0x4')]},'uniqueid':{'type':Sequelize[_0xdcaf('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index b45fd50..6bf4a2f 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 _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MemberReport','fieldName','type','model','name','keys'];(function(_0x5103cd,_0x53dbee){var _0x323afd=function(_0x2a3002){while(--_0x2a3002){_0x5103cd['push'](_0x5103cd['shift']());}};_0x323afd(++_0x53dbee);}(_0x7217,0x19e));var _0x7721=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7217[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));}; \ No newline at end of file +var _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MemberReport','fieldName','type','model','name','keys'];(function(_0x4194a5,_0x1d0430){var _0x4cdab2=function(_0x3fe5e1){while(--_0x3fe5e1){_0x4194a5['push'](_0x4194a5['shift']());}};_0x4cdab2(++_0x1d0430);}(_0x7217,0x19e));var _0x7721=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x7217[_0x4c7fb5];return _0x2e10ac;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index c109b9c..2cac237 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 _0xe74c=['membername_interface','membername','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xe74c,0x1d3));var _0xce74=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xe74c[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xce74('0x0'));var util=require(_0xce74('0x1'));var logger=require(_0xce74('0x2'))(_0xce74('0x3'));var moment=require('moment');var BPromise=require(_0xce74('0x4'));var rp=require(_0xce74('0x5'));var fs=require('fs');var path=require(_0xce74('0x6'));var rimraf=require(_0xce74('0x7'));var config=require(_0xce74('0x8'));var attributes=require(_0xce74('0x9'));module[_0xce74('0xa')]=function(_0x2d2737,_0x5b0e6d){return _0x2d2737[_0xce74('0xb')](_0xce74('0xc'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xce74('0xd'),'fields':[_0xce74('0xe'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x59cd=['../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x59cd,0x108));var _0xd59c=function(_0x5db313,_0x3c8f0c){_0x5db313=_0x5db313-0x0;var _0x36d503=_0x59cd[_0x5db313];return _0x36d503;};'use strict';var _=require(_0xd59c('0x0'));var util=require(_0xd59c('0x1'));var logger=require(_0xd59c('0x2'))(_0xd59c('0x3'));var moment=require(_0xd59c('0x4'));var BPromise=require(_0xd59c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd59c('0x6'));var rimraf=require(_0xd59c('0x7'));var config=require(_0xd59c('0x8'));var attributes=require(_0xd59c('0x9'));module[_0xd59c('0xa')]=function(_0x29580e,_0x4b7c4d){return _0x29580e[_0xd59c('0xb')](_0xd59c('0xc'),attributes,{'tableName':_0xd59c('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xd59c('0xe'),_0xd59c('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 5602c81..b7eb868 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 _0x510e=['then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','body','CreateMemberReport','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x9b3efc,_0x577a0d){var _0x200f05=function(_0x15ad7c){while(--_0x15ad7c){_0x9b3efc['push'](_0x9b3efc['shift']());}};_0x200f05(++_0x577a0d);}(_0x510e,0x1ed));var _0xe510=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x510e[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0xe510('0x0'));var util=require(_0xe510('0x1'));var moment=require(_0xe510('0x2'));var BPromise=require(_0xe510('0x3'));var rs=require(_0xe510('0x4'));var fs=require('fs');var Redis=require(_0xe510('0x5'));var db=require(_0xe510('0x6'))['db'];var utils=require(_0xe510('0x7'));var logger=require(_0xe510('0x8'))('rpc');var config=require(_0xe510('0x9'));var jayson=require(_0xe510('0xa'));var client=jayson[_0xe510('0xb')][_0xe510('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26cffc,_0x18ec55,_0x27ca15){return new BPromise(function(_0x42b48c,_0x2f5db7){return client[_0xe510('0xd')](_0x26cffc,_0x27ca15)[_0xe510('0xe')](function(_0xf2a94b){logger[_0xe510('0xf')](_0xe510('0x10'),_0x18ec55,'request\x20sent');logger[_0xe510('0x11')](_0xe510('0x12'),_0x18ec55,_0xe510('0x13'),JSON[_0xe510('0x14')](_0xf2a94b));if(_0xf2a94b[_0xe510('0x15')]){if(_0xf2a94b[_0xe510('0x15')]['code']===0x1f4){logger[_0xe510('0x15')](_0xe510('0x10'),_0x18ec55,_0xf2a94b[_0xe510('0x15')][_0xe510('0x16')]);return _0x2f5db7(_0xf2a94b[_0xe510('0x15')][_0xe510('0x16')]);}logger[_0xe510('0x15')](_0xe510('0x10'),_0x18ec55,_0xf2a94b[_0xe510('0x15')][_0xe510('0x16')]);return _0x42b48c(_0xf2a94b[_0xe510('0x15')][_0xe510('0x16')]);}else{logger['info'](_0xe510('0x10'),_0x18ec55,'request\x20sent');_0x42b48c(_0xf2a94b['result'][_0xe510('0x16')]);}})[_0xe510('0x17')](function(_0x2684b4){logger[_0xe510('0x15')](_0xe510('0x10'),_0x18ec55,_0x2684b4);_0x2f5db7(_0x2684b4);});});}exports[_0xe510('0x18')]=function(_0x268736){var _0x3831f4=this;return new Promise(function(_0x48e676,_0x34697){return db[_0xe510('0x19')][_0xe510('0x1a')]({'raw':_0x268736[_0xe510('0x1b')]?_0x268736[_0xe510('0x1b')][_0xe510('0x1c')]===undefined?!![]:![]:!![],'where':_0x268736[_0xe510('0x1b')]?_0x268736['options'][_0xe510('0x1d')]||null:null,'attributes':_0x268736[_0xe510('0x1b')]?_0x268736['options'][_0xe510('0x1e')]||null:null,'limit':_0x268736[_0xe510('0x1b')]?_0x268736['options'][_0xe510('0x1f')]||null:null,'include':_0x268736[_0xe510('0x1b')]?_0x268736['options'][_0xe510('0x20')]?_[_0xe510('0x21')](_0x268736[_0xe510('0x1b')][_0xe510('0x20')],function(_0xc6ffae){return{'model':db[_0xc6ffae['model']],'as':_0xc6ffae['as'],'attributes':_0xc6ffae[_0xe510('0x1e')],'include':_0xc6ffae['include']?_['map'](_0xc6ffae['include'],function(_0x4425ee){return{'model':db[_0x4425ee[_0xe510('0x22')]],'as':_0x4425ee['as'],'attributes':_0x4425ee['attributes'],'include':_0x4425ee[_0xe510('0x20')]?_['map'](_0x4425ee[_0xe510('0x20')],function(_0x45ea1e){return{'model':db[_0x45ea1e[_0xe510('0x22')]],'as':_0x45ea1e['as'],'attributes':_0x45ea1e[_0xe510('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe510('0xe')](function(_0xb260e0){logger[_0xe510('0xf')](_0xe510('0x18'),_0x268736);logger[_0xe510('0x11')](_0xe510('0x18'),_0x268736,JSON[_0xe510('0x14')](_0xb260e0));_0x48e676(_0xb260e0);})['catch'](function(_0xf5a2fb){logger[_0xe510('0x15')]('GetMemberReport',_0xf5a2fb['message'],_0x268736);_0x34697(_0x3831f4[_0xe510('0x15')](0x1f4,_0xf5a2fb[_0xe510('0x16')]));});});};exports['CreateMemberReport']=function(_0xb7096){var _0x40008f=this;return new Promise(function(_0x99cd01,_0x12416c){return db[_0xe510('0x19')]['create'](_0xb7096[_0xe510('0x23')],{'raw':_0xb7096[_0xe510('0x1b')]?_0xb7096[_0xe510('0x1b')][_0xe510('0x1c')]===undefined?!![]:![]:!![]})[_0xe510('0xe')](function(_0x30fa1e){logger[_0xe510('0xf')](_0xe510('0x24'),_0xb7096);logger[_0xe510('0x11')](_0xe510('0x24'),_0xb7096,JSON['stringify'](_0x30fa1e));_0x99cd01(_0x30fa1e);})[_0xe510('0x17')](function(_0x8bfeed){logger[_0xe510('0x15')](_0xe510('0x24'),_0x8bfeed[_0xe510('0x16')],_0xb7096);_0x12416c(_0x40008f[_0xe510('0x15')](0x1f4,_0x8bfeed[_0xe510('0x16')]));});});};exports[_0xe510('0x25')]=function(_0x3b8009){var _0x2f971a=this;return new Promise(function(_0x22b714,_0x21fef0){return db[_0xe510('0x19')][_0xe510('0x26')](_0x3b8009[_0xe510('0x23')],{'raw':_0x3b8009[_0xe510('0x1b')]?_0x3b8009[_0xe510('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b8009[_0xe510('0x1b')]?_0x3b8009[_0xe510('0x1b')]['where']||null:null,'attributes':_0x3b8009[_0xe510('0x1b')]?_0x3b8009[_0xe510('0x1b')]['attributes']||null:null,'limit':_0x3b8009['options']?_0x3b8009[_0xe510('0x1b')][_0xe510('0x1f')]||null:null})[_0xe510('0xe')](function(_0x730c27){logger['info'](_0xe510('0x25'),_0x3b8009);logger['debug'](_0xe510('0x25'),_0x3b8009,JSON[_0xe510('0x14')](_0x730c27));_0x22b714(_0x730c27);})[_0xe510('0x17')](function(_0x55cff5){logger[_0xe510('0x15')](_0xe510('0x25'),_0x55cff5[_0xe510('0x16')],_0x3b8009);_0x21fef0(_0x2f971a[_0xe510('0x15')](0x1f4,_0x55cff5[_0xe510('0x16')]));});});}; \ No newline at end of file +var _0xc21e=['raw','UpdateMemberReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetMemberReport','MemberReport','findAll','options','where','attributes','include','model','map','CreateMemberReport','create','body'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xc21e,0x1ca));var _0xec21=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc21e[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xec21('0x0'));var moment=require(_0xec21('0x1'));var BPromise=require(_0xec21('0x2'));var rs=require(_0xec21('0x3'));var fs=require('fs');var Redis=require(_0xec21('0x4'));var db=require(_0xec21('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec21('0x6'))(_0xec21('0x7'));var config=require(_0xec21('0x8'));var jayson=require(_0xec21('0x9'));var client=jayson[_0xec21('0xa')][_0xec21('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x406b66,_0x2f15e7,_0x51f6dc){return new BPromise(function(_0x2b1396,_0x3d74a2){return client[_0xec21('0xc')](_0x406b66,_0x51f6dc)[_0xec21('0xd')](function(_0x4d478){logger['info'](_0xec21('0xe'),_0x2f15e7,_0xec21('0xf'));logger[_0xec21('0x10')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x2f15e7,'request\x20sent',JSON[_0xec21('0x11')](_0x4d478));if(_0x4d478[_0xec21('0x12')]){if(_0x4d478['error'][_0xec21('0x13')]===0x1f4){logger[_0xec21('0x12')](_0xec21('0xe'),_0x2f15e7,_0x4d478[_0xec21('0x12')][_0xec21('0x14')]);return _0x3d74a2(_0x4d478['error'][_0xec21('0x14')]);}logger['error'](_0xec21('0xe'),_0x2f15e7,_0x4d478[_0xec21('0x12')][_0xec21('0x14')]);return _0x2b1396(_0x4d478['error'][_0xec21('0x14')]);}else{logger[_0xec21('0x15')](_0xec21('0xe'),_0x2f15e7,_0xec21('0xf'));_0x2b1396(_0x4d478[_0xec21('0x16')][_0xec21('0x14')]);}})[_0xec21('0x17')](function(_0x350a53){logger['error'](_0xec21('0xe'),_0x2f15e7,_0x350a53);_0x3d74a2(_0x350a53);});});}exports[_0xec21('0x18')]=function(_0x2fcbcc){var _0x121624=this;return new Promise(function(_0x3ab226,_0x1d901e){return db[_0xec21('0x19')][_0xec21('0x1a')]({'raw':_0x2fcbcc[_0xec21('0x1b')]?_0x2fcbcc[_0xec21('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2fcbcc['options']?_0x2fcbcc[_0xec21('0x1b')][_0xec21('0x1c')]||null:null,'attributes':_0x2fcbcc['options']?_0x2fcbcc['options'][_0xec21('0x1d')]||null:null,'limit':_0x2fcbcc[_0xec21('0x1b')]?_0x2fcbcc[_0xec21('0x1b')]['limit']||null:null,'include':_0x2fcbcc[_0xec21('0x1b')]?_0x2fcbcc[_0xec21('0x1b')][_0xec21('0x1e')]?_['map'](_0x2fcbcc[_0xec21('0x1b')][_0xec21('0x1e')],function(_0x2d521a){return{'model':db[_0x2d521a[_0xec21('0x1f')]],'as':_0x2d521a['as'],'attributes':_0x2d521a[_0xec21('0x1d')],'include':_0x2d521a[_0xec21('0x1e')]?_['map'](_0x2d521a[_0xec21('0x1e')],function(_0x26cdae){return{'model':db[_0x26cdae['model']],'as':_0x26cdae['as'],'attributes':_0x26cdae[_0xec21('0x1d')],'include':_0x26cdae['include']?_[_0xec21('0x20')](_0x26cdae['include'],function(_0x4ef840){return{'model':db[_0x4ef840[_0xec21('0x1f')]],'as':_0x4ef840['as'],'attributes':_0x4ef840[_0xec21('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xec21('0xd')](function(_0x10bd67){logger[_0xec21('0x15')]('GetMemberReport',_0x2fcbcc);logger[_0xec21('0x10')]('GetMemberReport',_0x2fcbcc,JSON[_0xec21('0x11')](_0x10bd67));_0x3ab226(_0x10bd67);})[_0xec21('0x17')](function(_0x116a23){logger[_0xec21('0x12')]('GetMemberReport',_0x116a23[_0xec21('0x14')],_0x2fcbcc);_0x1d901e(_0x121624[_0xec21('0x12')](0x1f4,_0x116a23[_0xec21('0x14')]));});});};exports[_0xec21('0x21')]=function(_0xa0dea2){var _0x1d1afc=this;return new Promise(function(_0x361b28,_0x375ec1){return db[_0xec21('0x19')][_0xec21('0x22')](_0xa0dea2[_0xec21('0x23')],{'raw':_0xa0dea2['options']?_0xa0dea2[_0xec21('0x1b')][_0xec21('0x24')]===undefined?!![]:![]:!![]})[_0xec21('0xd')](function(_0x3b099f){logger[_0xec21('0x15')]('CreateMemberReport',_0xa0dea2);logger[_0xec21('0x10')]('CreateMemberReport',_0xa0dea2,JSON['stringify'](_0x3b099f));_0x361b28(_0x3b099f);})['catch'](function(_0x3c6bd5){logger[_0xec21('0x12')](_0xec21('0x21'),_0x3c6bd5[_0xec21('0x14')],_0xa0dea2);_0x375ec1(_0x1d1afc[_0xec21('0x12')](0x1f4,_0x3c6bd5[_0xec21('0x14')]));});});};exports[_0xec21('0x25')]=function(_0xf45c9b){var _0xaac2cc=this;return new Promise(function(_0x1a7586,_0x8a7e00){return db[_0xec21('0x19')]['update'](_0xf45c9b[_0xec21('0x23')],{'raw':_0xf45c9b[_0xec21('0x1b')]?_0xf45c9b['options'][_0xec21('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf45c9b['options']?_0xf45c9b['options'][_0xec21('0x1c')]||null:null,'attributes':_0xf45c9b['options']?_0xf45c9b[_0xec21('0x1b')]['attributes']||null:null,'limit':_0xf45c9b[_0xec21('0x1b')]?_0xf45c9b[_0xec21('0x1b')]['limit']||null:null})[_0xec21('0xd')](function(_0x14fa33){logger[_0xec21('0x15')]('UpdateMemberReport',_0xf45c9b);logger[_0xec21('0x10')](_0xec21('0x25'),_0xf45c9b,JSON[_0xec21('0x11')](_0x14fa33));_0x1a7586(_0x14fa33);})['catch'](function(_0x192354){logger[_0xec21('0x12')](_0xec21('0x25'),_0x192354[_0xec21('0x14')],_0xf45c9b);_0x8a7e00(_0xaac2cc[_0xec21('0x12')](0x1f4,_0x192354['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index d85ccf9..3f82c39 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 _0x5590=['index','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x5590,0x11a));var _0x0559=function(_0x52ebdd,_0x3d7f53){_0x52ebdd=_0x52ebdd-0x0;var _0x214d27=_0x5590[_0x52ebdd];return _0x214d27;};'use strict';var multer=require(_0x0559('0x0'));var util=require(_0x0559('0x1'));var path=require(_0x0559('0x2'));var timeout=require(_0x0559('0x3'));var express=require(_0x0559('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0559('0x5'));var interaction=require(_0x0559('0x6'));var config=require('../../config/environment');var controller=require('./migration.controller');router[_0x0559('0x7')]('/',controller[_0x0559('0x8')]);module[_0x0559('0x9')]=router; \ No newline at end of file +var _0x722e=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','exports','multer','util'];(function(_0xf44477,_0xb51ab6){var _0x2e450f=function(_0x1e9127){while(--_0x1e9127){_0xf44477['push'](_0xf44477['shift']());}};_0x2e450f(++_0xb51ab6);}(_0x722e,0x14e));var _0xe722=function(_0xb71676,_0x38a540){_0xb71676=_0xb71676-0x0;var _0x97e296=_0x722e[_0xb71676];return _0x97e296;};'use strict';var multer=require(_0xe722('0x0'));var util=require(_0xe722('0x1'));var path=require('path');var timeout=require(_0xe722('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe722('0x3'));var interaction=require(_0xe722('0x4'));var config=require(_0xe722('0x5'));var controller=require('./migration.controller');router[_0xe722('0x6')]('/',controller['index']);module[_0xe722('0x7')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 68e6b72..4f72c51 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 _0x7c8f=['version','sequelize','exports','STRING'];(function(_0x2c8883,_0x44042a){var _0x3c8ae4=function(_0x594bd1){while(--_0x594bd1){_0x2c8883['push'](_0x2c8883['shift']());}};_0x3c8ae4(++_0x44042a);}(_0x7c8f,0x1b9));var _0xf7c8=function(_0xfe0638,_0x332d23){_0xfe0638=_0xfe0638-0x0;var _0x310289=_0x7c8f[_0xfe0638];return _0x310289;};'use strict';var Sequelize=require(_0xf7c8('0x0'));module[_0xf7c8('0x1')]={'version':{'type':Sequelize[_0xf7c8('0x2')],'unique':_0xf7c8('0x3')}}; \ No newline at end of file +var _0x019c=['exports','STRING','version','sequelize'];(function(_0x1d664a,_0x149a34){var _0x335345=function(_0x461fac){while(--_0x461fac){_0x1d664a['push'](_0x1d664a['shift']());}};_0x335345(++_0x149a34);}(_0x019c,0x197));var _0xc019=function(_0x2faf6e,_0x4499f0){_0x2faf6e=_0x2faf6e-0x0;var _0x44319f=_0x019c[_0x2faf6e];return _0x44319f;};'use strict';var Sequelize=require(_0xc019('0x0'));module[_0xc019('0x1')]={'version':{'type':Sequelize[_0xc019('0x2')],'unique':_0xc019('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 929f1eb..27b537d 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 _0x667c=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','error','name','send','index','Migration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','options','then','includeAll','include','findAll','catch','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra'];(function(_0x6122a7,_0x114ac4){var _0x58300f=function(_0xa8e7c5){while(--_0xa8e7c5){_0x6122a7['push'](_0x6122a7['shift']());}};_0x58300f(++_0x114ac4);}(_0x667c,0x82));var _0xc667=function(_0x8640b9,_0x1a1c7f){_0x8640b9=_0x8640b9-0x0;var _0x556632=_0x667c[_0x8640b9];return _0x556632;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc667('0x0'));var zipdir=require(_0xc667('0x1'));var jsonpatch=require(_0xc667('0x2'));var rp=require(_0xc667('0x3'));var moment=require('moment');var BPromise=require(_0xc667('0x4'));var Mustache=require(_0xc667('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc667('0x6'));var csv=require(_0xc667('0x7'));var ejs=require(_0xc667('0x8'));var fs=require('fs');var fs_extra=require(_0xc667('0x9'));var _=require(_0xc667('0xa'));var squel=require(_0xc667('0xb'));var crypto=require(_0xc667('0xc'));var jsforce=require(_0xc667('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc667('0x7'));var querystring=require(_0xc667('0xe'));var Papa=require(_0xc667('0xf'));var Redis=require(_0xc667('0x10'));var authService=require(_0xc667('0x11'));var qs=require(_0xc667('0x12'));var as=require(_0xc667('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc667('0x14'))(_0xc667('0x15'));var utils=require('../../config/utils');var config=require(_0xc667('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc667('0x17'))['db'];function respondWithStatusCode(_0x410431,_0x3aaa60){_0x3aaa60=_0x3aaa60||0xcc;return function(_0x202955){if(_0x202955){return _0x410431[_0xc667('0x18')](_0x3aaa60);}return _0x410431[_0xc667('0x19')](_0x3aaa60)['end']();};}function respondWithResult(_0x5cd29b,_0x282bc5){_0x282bc5=_0x282bc5||0xc8;return function(_0x103201){if(_0x103201){return _0x5cd29b[_0xc667('0x19')](_0x282bc5)[_0xc667('0x1a')](_0x103201);}};}function respondWithFilteredResult(_0x1f9f5b,_0x5d4e20){return function(_0x7cb3de){if(_0x7cb3de){var _0x2f2a68=typeof _0x5d4e20['offset']===_0xc667('0x1b')&&typeof _0x5d4e20[_0xc667('0x1c')]===_0xc667('0x1b');var _0x1282d9=_0x7cb3de[_0xc667('0x1d')];var _0x3e96fd=_0x2f2a68?0x0:_0x5d4e20['offset'];var _0x38caa3=_0x2f2a68?_0x7cb3de[_0xc667('0x1d')]:_0x5d4e20[_0xc667('0x1e')]+_0x5d4e20[_0xc667('0x1c')];var _0x298394;if(_0x38caa3>=_0x1282d9){_0x38caa3=_0x1282d9;_0x298394=0xc8;}else{_0x298394=0xce;}_0x1f9f5b[_0xc667('0x19')](_0x298394);return _0x1f9f5b[_0xc667('0x1f')](_0xc667('0x20'),_0x3e96fd+'-'+_0x38caa3+'/'+_0x1282d9)['json'](_0x7cb3de);}return null;};}function patchUpdates(_0x1070c7){return function(_0x314f8e){try{jsonpatch[_0xc667('0x21')](_0x314f8e,_0x1070c7,!![]);}catch(_0x477776){return BPromise[_0xc667('0x22')](_0x477776);}return _0x314f8e[_0xc667('0x23')]();};}function saveUpdates(_0x163de7,_0x323fb3){return function(_0x486b19){if(_0x486b19){return _0x486b19[_0xc667('0x24')](_0x163de7)['then'](function(_0x11cbed){return _0x11cbed;});}return null;};}function removeEntity(_0xf0b68c,_0x4c250f){return function(_0x3ec535){if(_0x3ec535){return _0x3ec535[_0xc667('0x25')]()['then'](function(){_0xf0b68c[_0xc667('0x19')](0xcc)[_0xc667('0x26')]();});}};}function handleEntityNotFound(_0x2e5128,_0x33993c){return function(_0x133ed7){if(!_0x133ed7){_0x2e5128[_0xc667('0x18')](0x194);}return _0x133ed7;};}function handleError(_0x4064a3,_0x371db8){_0x371db8=_0x371db8||0x1f4;return function(_0x5c4f4f){logger[_0xc667('0x27')](_0x5c4f4f['stack']);if(_0x5c4f4f[_0xc667('0x28')]){delete _0x5c4f4f[_0xc667('0x28')];}_0x4064a3[_0xc667('0x19')](_0x371db8)[_0xc667('0x29')](_0x5c4f4f);};}exports[_0xc667('0x2a')]=function(_0x2e7917,_0x22203b){var _0x1aa158={},_0x3dccde={},_0x2c257f={'count':0x0,'rows':[]};var _0x15fbad=_['map'](db[_0xc667('0x2b')][_0xc667('0x2c')],function(_0x4ee38f){return{'name':_0x4ee38f[_0xc667('0x2d')],'type':_0x4ee38f[_0xc667('0x2e')][_0xc667('0x2f')]};});_0x3dccde['model']=_['map'](_0x15fbad,'name');_0x3dccde[_0xc667('0x30')]=_[_0xc667('0x31')](_0x2e7917['query']);_0x3dccde[_0xc667('0x32')]=_[_0xc667('0x33')](_0x3dccde[_0xc667('0x34')],_0x3dccde['query']);_0x1aa158[_0xc667('0x35')]=_[_0xc667('0x33')](_0x3dccde[_0xc667('0x34')],qs[_0xc667('0x36')](_0x2e7917[_0xc667('0x30')]['fields']));_0x1aa158[_0xc667('0x35')]=_0x1aa158['attributes'][_0xc667('0x37')]?_0x1aa158[_0xc667('0x35')]:_0x3dccde[_0xc667('0x34')];if(!_0x2e7917[_0xc667('0x30')][_0xc667('0x38')](_0xc667('0x39'))){_0x1aa158[_0xc667('0x1c')]=qs[_0xc667('0x1c')](_0x2e7917[_0xc667('0x30')]['limit']);_0x1aa158[_0xc667('0x1e')]=qs[_0xc667('0x1e')](_0x2e7917[_0xc667('0x30')][_0xc667('0x1e')]);}_0x1aa158['order']=qs[_0xc667('0x3a')](_0x2e7917[_0xc667('0x30')][_0xc667('0x3a')]);_0x1aa158[_0xc667('0x3b')]=qs[_0xc667('0x32')](_[_0xc667('0x3c')](_0x2e7917[_0xc667('0x30')],_0x3dccde[_0xc667('0x32')]),_0x15fbad);if(_0x2e7917[_0xc667('0x30')][_0xc667('0x3d')]){_0x1aa158[_0xc667('0x3b')]=_[_0xc667('0x3e')](_0x1aa158[_0xc667('0x3b')],{'$or':_[_0xc667('0x3f')](_0x15fbad,function(_0x15f019){if(_0x15f019['type']!=='VIRTUAL'){var _0xec64b5={};_0xec64b5[_0x15f019[_0xc667('0x28')]]={'$like':'%'+_0x2e7917[_0xc667('0x30')][_0xc667('0x3d')]+'%'};return _0xec64b5;}})});}_0x1aa158=_[_0xc667('0x3e')]({},_0x1aa158,_0x2e7917[_0xc667('0x40')]);var _0x1f5636={'where':_0x1aa158['where']};return db[_0xc667('0x2b')]['count'](_0x1f5636)[_0xc667('0x41')](function(_0x5705e0){_0x2c257f[_0xc667('0x1d')]=_0x5705e0;if(_0x2e7917[_0xc667('0x30')][_0xc667('0x42')]){_0x1aa158[_0xc667('0x43')]=[{'all':!![]}];}return db[_0xc667('0x2b')][_0xc667('0x44')](_0x1aa158);})[_0xc667('0x41')](function(_0x2479e7){_0x2c257f['rows']=_0x2479e7;return _0x2c257f;})[_0xc667('0x41')](respondWithFilteredResult(_0x22203b,_0x1aa158))[_0xc667('0x45')](handleError(_0x22203b,null));}; \ No newline at end of file +var _0xa4cd=['model','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','Migration','findAll','rows','catch','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','end','error','name','send','index','map','rawAttributes','type','keys','query','filters','intersection'];(function(_0x1e0e5b,_0x50a13d){var _0x108b05=function(_0x4c71e6){while(--_0x4c71e6){_0x1e0e5b['push'](_0x1e0e5b['shift']());}};_0x108b05(++_0x50a13d);}(_0xa4cd,0x17b));var _0xda4c=function(_0x13a6be,_0x87bf0a){_0x13a6be=_0x13a6be-0x0;var _0x343477=_0xa4cd[_0x13a6be];return _0x343477;};'use strict';var emlformat=require(_0xda4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda4c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda4c('0x2'));var moment=require('moment');var BPromise=require(_0xda4c('0x3'));var Mustache=require(_0xda4c('0x4'));var util=require(_0xda4c('0x5'));var path=require(_0xda4c('0x6'));var sox=require(_0xda4c('0x7'));var csv=require(_0xda4c('0x8'));var ejs=require(_0xda4c('0x9'));var fs=require('fs');var fs_extra=require(_0xda4c('0xa'));var _=require(_0xda4c('0xb'));var squel=require(_0xda4c('0xc'));var crypto=require(_0xda4c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xda4c('0xe'));var toCsv=require(_0xda4c('0x8'));var querystring=require(_0xda4c('0xf'));var Papa=require(_0xda4c('0x10'));var Redis=require('ioredis');var authService=require(_0xda4c('0x11'));var qs=require(_0xda4c('0x12'));var as=require(_0xda4c('0x13'));var hardwareService=require(_0xda4c('0x14'));var logger=require(_0xda4c('0x15'))(_0xda4c('0x16'));var utils=require(_0xda4c('0x17'));var config=require(_0xda4c('0x18'));var licenseUtil=require(_0xda4c('0x19'));var db=require(_0xda4c('0x1a'))['db'];function respondWithStatusCode(_0x29d362,_0x4191bc){_0x4191bc=_0x4191bc||0xcc;return function(_0x139d53){if(_0x139d53){return _0x29d362[_0xda4c('0x1b')](_0x4191bc);}return _0x29d362['status'](_0x4191bc)['end']();};}function respondWithResult(_0x588559,_0x7e099a){_0x7e099a=_0x7e099a||0xc8;return function(_0x1f4b35){if(_0x1f4b35){return _0x588559[_0xda4c('0x1c')](_0x7e099a)[_0xda4c('0x1d')](_0x1f4b35);}};}function respondWithFilteredResult(_0x36a867,_0x1ec070){return function(_0x5d857c){if(_0x5d857c){var _0x492540=typeof _0x1ec070[_0xda4c('0x1e')]==='undefined'&&typeof _0x1ec070[_0xda4c('0x1f')]===_0xda4c('0x20');var _0x1b48bf=_0x5d857c['count'];var _0x1f9b08=_0x492540?0x0:_0x1ec070[_0xda4c('0x1e')];var _0x5950f9=_0x492540?_0x5d857c[_0xda4c('0x21')]:_0x1ec070['offset']+_0x1ec070[_0xda4c('0x1f')];var _0x4ca02a;if(_0x5950f9>=_0x1b48bf){_0x5950f9=_0x1b48bf;_0x4ca02a=0xc8;}else{_0x4ca02a=0xce;}_0x36a867[_0xda4c('0x1c')](_0x4ca02a);return _0x36a867[_0xda4c('0x22')](_0xda4c('0x23'),_0x1f9b08+'-'+_0x5950f9+'/'+_0x1b48bf)[_0xda4c('0x1d')](_0x5d857c);}return null;};}function patchUpdates(_0x10ac4e){return function(_0x5733d5){try{jsonpatch[_0xda4c('0x24')](_0x5733d5,_0x10ac4e,!![]);}catch(_0x262698){return BPromise[_0xda4c('0x25')](_0x262698);}return _0x5733d5[_0xda4c('0x26')]();};}function saveUpdates(_0x429394,_0x1371cd){return function(_0x537cc2){if(_0x537cc2){return _0x537cc2[_0xda4c('0x27')](_0x429394)['then'](function(_0x49b3c3){return _0x49b3c3;});}return null;};}function removeEntity(_0x10bb27,_0x51057d){return function(_0x2faf46){if(_0x2faf46){return _0x2faf46[_0xda4c('0x28')]()['then'](function(){_0x10bb27[_0xda4c('0x1c')](0xcc)[_0xda4c('0x29')]();});}};}function handleEntityNotFound(_0x5d3310,_0x310891){return function(_0x59a57a){if(!_0x59a57a){_0x5d3310[_0xda4c('0x1b')](0x194);}return _0x59a57a;};}function handleError(_0x4af23d,_0x162a31){_0x162a31=_0x162a31||0x1f4;return function(_0x4d8cf5){logger[_0xda4c('0x2a')](_0x4d8cf5['stack']);if(_0x4d8cf5[_0xda4c('0x2b')]){delete _0x4d8cf5[_0xda4c('0x2b')];}_0x4af23d['status'](_0x162a31)[_0xda4c('0x2c')](_0x4d8cf5);};}exports[_0xda4c('0x2d')]=function(_0x38fc99,_0xa78fa1){var _0xac8c21={},_0x1bb26b={},_0x51ac30={'count':0x0,'rows':[]};var _0x186f0e=_[_0xda4c('0x2e')](db['Migration'][_0xda4c('0x2f')],function(_0x1df84e){return{'name':_0x1df84e['fieldName'],'type':_0x1df84e[_0xda4c('0x30')]['key']};});_0x1bb26b['model']=_['map'](_0x186f0e,'name');_0x1bb26b['query']=_[_0xda4c('0x31')](_0x38fc99[_0xda4c('0x32')]);_0x1bb26b[_0xda4c('0x33')]=_[_0xda4c('0x34')](_0x1bb26b[_0xda4c('0x35')],_0x1bb26b[_0xda4c('0x32')]);_0xac8c21[_0xda4c('0x36')]=_['intersection'](_0x1bb26b[_0xda4c('0x35')],qs[_0xda4c('0x37')](_0x38fc99[_0xda4c('0x32')][_0xda4c('0x37')]));_0xac8c21[_0xda4c('0x36')]=_0xac8c21[_0xda4c('0x36')]['length']?_0xac8c21[_0xda4c('0x36')]:_0x1bb26b[_0xda4c('0x35')];if(!_0x38fc99[_0xda4c('0x32')][_0xda4c('0x38')](_0xda4c('0x39'))){_0xac8c21[_0xda4c('0x1f')]=qs[_0xda4c('0x1f')](_0x38fc99['query'][_0xda4c('0x1f')]);_0xac8c21[_0xda4c('0x1e')]=qs[_0xda4c('0x1e')](_0x38fc99[_0xda4c('0x32')][_0xda4c('0x1e')]);}_0xac8c21['order']=qs[_0xda4c('0x3a')](_0x38fc99[_0xda4c('0x32')][_0xda4c('0x3a')]);_0xac8c21['where']=qs[_0xda4c('0x33')](_[_0xda4c('0x3b')](_0x38fc99['query'],_0x1bb26b[_0xda4c('0x33')]),_0x186f0e);if(_0x38fc99[_0xda4c('0x32')][_0xda4c('0x3c')]){_0xac8c21[_0xda4c('0x3d')]=_[_0xda4c('0x3e')](_0xac8c21[_0xda4c('0x3d')],{'$or':_['map'](_0x186f0e,function(_0x54ea03){if(_0x54ea03[_0xda4c('0x30')]!==_0xda4c('0x3f')){var _0x4343b9={};_0x4343b9[_0x54ea03[_0xda4c('0x2b')]]={'$like':'%'+_0x38fc99[_0xda4c('0x32')][_0xda4c('0x3c')]+'%'};return _0x4343b9;}})});}_0xac8c21=_['merge']({},_0xac8c21,_0x38fc99[_0xda4c('0x40')]);var _0x3cfbc0={'where':_0xac8c21[_0xda4c('0x3d')]};return db['Migration']['count'](_0x3cfbc0)[_0xda4c('0x41')](function(_0x87a9aa){_0x51ac30[_0xda4c('0x21')]=_0x87a9aa;if(_0x38fc99[_0xda4c('0x32')][_0xda4c('0x42')]){_0xac8c21[_0xda4c('0x43')]=[{'all':!![]}];}return db[_0xda4c('0x44')][_0xda4c('0x45')](_0xac8c21);})[_0xda4c('0x41')](function(_0x1a10cd){_0x51ac30[_0xda4c('0x46')]=_0x1a10cd;return _0x51ac30;})[_0xda4c('0x41')](respondWithFilteredResult(_0xa78fa1,_0xac8c21))[_0xda4c('0x47')](handleError(_0xa78fa1,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index ffb4f17..9d487c8 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 _0xad30=['rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2b0623,_0x1c40e5){var _0x1f74c5=function(_0x52f8f1){while(--_0x52f8f1){_0x2b0623['push'](_0x2b0623['shift']());}};_0x1f74c5(++_0x1c40e5);}(_0xad30,0x1f1));var _0x0ad3=function(_0x439abd,_0x2d3355){_0x439abd=_0x439abd-0x0;var _0xa1effc=_0xad30[_0x439abd];return _0xa1effc;};'use strict';var _=require(_0x0ad3('0x0'));var util=require(_0x0ad3('0x1'));var logger=require(_0x0ad3('0x2'))(_0x0ad3('0x3'));var moment=require('moment');var BPromise=require(_0x0ad3('0x4'));var rp=require(_0x0ad3('0x5'));var fs=require('fs');var path=require(_0x0ad3('0x6'));var rimraf=require(_0x0ad3('0x7'));var config=require(_0x0ad3('0x8'));var attributes=require(_0x0ad3('0x9'));module[_0x0ad3('0xa')]=function(_0x2b03b6,_0x49d590){return _0x2b03b6[_0x0ad3('0xb')](_0x0ad3('0xc'),attributes,{'tableName':_0x0ad3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c16=['../../config/environment','./migration.attributes','exports','define','Migration','migrations','api','moment','bluebird','request-promise','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9c16,0x187));var _0x69c1=function(_0xeeb0d5,_0x2eaf94){_0xeeb0d5=_0xeeb0d5-0x0;var _0x299d5d=_0x9c16[_0xeeb0d5];return _0x299d5d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x69c1('0x0'));var moment=require(_0x69c1('0x1'));var BPromise=require(_0x69c1('0x2'));var rp=require(_0x69c1('0x3'));var fs=require('fs');var path=require(_0x69c1('0x4'));var rimraf=require('rimraf');var config=require(_0x69c1('0x5'));var attributes=require(_0x69c1('0x6'));module[_0x69c1('0x7')]=function(_0x3e1186,_0x42fed2){return _0x3e1186[_0x69c1('0x8')](_0x69c1('0x9'),attributes,{'tableName':_0x69c1('0xa'),'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 7a9248a..c129a0e 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 _0x132f=['jayson/promise','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2e9fde,_0x2f7f9c){var _0xa561b=function(_0x4b3295){while(--_0x4b3295){_0x2e9fde['push'](_0x2e9fde['shift']());}};_0xa561b(++_0x2f7f9c);}(_0x132f,0x182));var _0xf132=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x132f[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0xf132('0x0'));var util=require(_0xf132('0x1'));var moment=require(_0xf132('0x2'));var BPromise=require(_0xf132('0x3'));var rs=require(_0xf132('0x4'));var fs=require('fs');var Redis=require(_0xf132('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf132('0x6'));var logger=require(_0xf132('0x7'))(_0xf132('0x8'));var config=require(_0xf132('0x9'));var jayson=require(_0xf132('0xa'));var client=jayson['client'][_0xf132('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x280c1f,_0x533464,_0xbbfdc7){return new BPromise(function(_0x58cdf9,_0x3eed92){return client[_0xf132('0xc')](_0x280c1f,_0xbbfdc7)[_0xf132('0xd')](function(_0xa89a67){logger[_0xf132('0xe')](_0xf132('0xf'),_0x533464,_0xf132('0x10'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x533464,_0xf132('0x10'),JSON[_0xf132('0x11')](_0xa89a67));if(_0xa89a67[_0xf132('0x12')]){if(_0xa89a67[_0xf132('0x12')][_0xf132('0x13')]===0x1f4){logger[_0xf132('0x12')](_0xf132('0xf'),_0x533464,_0xa89a67[_0xf132('0x12')][_0xf132('0x14')]);return _0x3eed92(_0xa89a67[_0xf132('0x12')][_0xf132('0x14')]);}logger[_0xf132('0x12')]('Migration,\x20%s,\x20%s',_0x533464,_0xa89a67[_0xf132('0x12')][_0xf132('0x14')]);return _0x58cdf9(_0xa89a67['error'][_0xf132('0x14')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x533464,_0xf132('0x10'));_0x58cdf9(_0xa89a67[_0xf132('0x15')][_0xf132('0x14')]);}})['catch'](function(_0x48686e){logger[_0xf132('0x12')](_0xf132('0xf'),_0x533464,_0x48686e);_0x3eed92(_0x48686e);});});} \ No newline at end of file +var _0x4584=['result','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4a5635,_0x443b90){var _0x18d602=function(_0x1ddd38){while(--_0x1ddd38){_0x4a5635['push'](_0x4a5635['shift']());}};_0x18d602(++_0x443b90);}(_0x4584,0x1cf));var _0x4458=function(_0xdc56ad,_0x3af055){_0xdc56ad=_0xdc56ad-0x0;var _0x52a819=_0x4584[_0xdc56ad];return _0x52a819;};'use strict';var _=require(_0x4458('0x0'));var util=require('util');var moment=require(_0x4458('0x1'));var BPromise=require(_0x4458('0x2'));var rs=require(_0x4458('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4458('0x4'));var logger=require(_0x4458('0x5'))(_0x4458('0x6'));var config=require(_0x4458('0x7'));var jayson=require(_0x4458('0x8'));var client=jayson[_0x4458('0x9')][_0x4458('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x215b2d,_0x102b5f,_0x51da14){return new BPromise(function(_0x14bb0f,_0x83fb96){return client[_0x4458('0xb')](_0x215b2d,_0x51da14)[_0x4458('0xc')](function(_0x1ab8c3){logger[_0x4458('0xd')](_0x4458('0xe'),_0x102b5f,_0x4458('0xf'));logger[_0x4458('0x10')]('Migration,\x20%s,\x20%s,\x20%s',_0x102b5f,_0x4458('0xf'),JSON[_0x4458('0x11')](_0x1ab8c3));if(_0x1ab8c3[_0x4458('0x12')]){if(_0x1ab8c3[_0x4458('0x12')][_0x4458('0x13')]===0x1f4){logger['error'](_0x4458('0xe'),_0x102b5f,_0x1ab8c3['error'][_0x4458('0x14')]);return _0x83fb96(_0x1ab8c3['error'][_0x4458('0x14')]);}logger[_0x4458('0x12')]('Migration,\x20%s,\x20%s',_0x102b5f,_0x1ab8c3['error'][_0x4458('0x14')]);return _0x14bb0f(_0x1ab8c3[_0x4458('0x12')][_0x4458('0x14')]);}else{logger[_0x4458('0xd')](_0x4458('0xe'),_0x102b5f,_0x4458('0xf'));_0x14bb0f(_0x1ab8c3[_0x4458('0x15')][_0x4458('0x14')]);}})['catch'](function(_0x31e500){logger['error'](_0x4458('0xe'),_0x102b5f,_0x31e500);_0x83fb96(_0x31e500);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index e3188be..b24863d 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 _0x3557=['post','create','put','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','get','/:id','show'];(function(_0x3f07ea,_0x3918b7){var _0x5eb15f=function(_0x2cf499){while(--_0x2cf499){_0x3f07ea['push'](_0x3f07ea['shift']());}};_0x5eb15f(++_0x3918b7);}(_0x3557,0x137));var _0x7355=function(_0x34c4e1,_0x310387){_0x34c4e1=_0x34c4e1-0x0;var _0x5a11ef=_0x3557[_0x34c4e1];return _0x5a11ef;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7355('0x0'));var timeout=require(_0x7355('0x1'));var express=require(_0x7355('0x2'));var router=express[_0x7355('0x3')]();var fs_extra=require(_0x7355('0x4'));var auth=require(_0x7355('0x5'));var interaction=require(_0x7355('0x6'));var config=require(_0x7355('0x7'));var controller=require(_0x7355('0x8'));router['get']('/',auth[_0x7355('0x9')](),controller['index']);router[_0x7355('0xa')](_0x7355('0xb'),auth[_0x7355('0x9')](),controller[_0x7355('0xc')]);router[_0x7355('0xd')]('/',auth[_0x7355('0x9')](),controller[_0x7355('0xe')]);router[_0x7355('0xf')]('/:id',auth[_0x7355('0x9')](),controller[_0x7355('0x10')]);router['delete'](_0x7355('0xb'),auth[_0x7355('0x9')](),controller['destroy']);module[_0x7355('0x11')]=router; \ No newline at end of file +var _0xe978=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x10b2d5,_0x309bdb){var _0x538aa9=function(_0x5c939c){while(--_0x5c939c){_0x10b2d5['push'](_0x10b2d5['shift']());}};_0x538aa9(++_0x309bdb);}(_0xe978,0x70));var _0x8e97=function(_0xb77ba6,_0xbda207){_0xb77ba6=_0xb77ba6-0x0;var _0x147f99=_0xe978[_0xb77ba6];return _0x147f99;};'use strict';var multer=require(_0x8e97('0x0'));var util=require(_0x8e97('0x1'));var path=require(_0x8e97('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8e97('0x3')]();var fs_extra=require(_0x8e97('0x4'));var auth=require(_0x8e97('0x5'));var interaction=require(_0x8e97('0x6'));var config=require(_0x8e97('0x7'));var controller=require('./network.controller');router[_0x8e97('0x8')]('/',auth[_0x8e97('0x9')](),controller[_0x8e97('0xa')]);router[_0x8e97('0x8')](_0x8e97('0xb'),auth['isAuthenticated'](),controller[_0x8e97('0xc')]);router['post']('/',auth[_0x8e97('0x9')](),controller[_0x8e97('0xd')]);router[_0x8e97('0xe')]('/:id',auth[_0x8e97('0x9')](),controller[_0x8e97('0xf')]);router[_0x8e97('0x10')](_0x8e97('0xb'),auth[_0x8e97('0x9')](),controller[_0x8e97('0x11')]);module[_0x8e97('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index ddbc9f4..e2b2634 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 _0x5758=['ENUM','localnet','externip','turn','STRING','sequelize','exports'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x5758,0x17f));var _0x8575=function(_0x3ae734,_0x490bac){_0x3ae734=_0x3ae734-0x0;var _0x2da6cf=_0x5758[_0x3ae734];return _0x2da6cf;};'use strict';var Sequelize=require(_0x8575('0x0'));module[_0x8575('0x1')]={'type':{'type':Sequelize[_0x8575('0x2')](_0x8575('0x3'),_0x8575('0x4'),'stun',_0x8575('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8575('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb9aa=['stun','turn','STRING','exports','ENUM','localnet','externip'];(function(_0xd307d9,_0x50e8e0){var _0x209bf8=function(_0x335069){while(--_0x335069){_0xd307d9['push'](_0xd307d9['shift']());}};_0x209bf8(++_0x50e8e0);}(_0xb9aa,0x18b));var _0xab9a=function(_0x30d4eb,_0x377d52){_0x30d4eb=_0x30d4eb-0x0;var _0x1356e5=_0xb9aa[_0x30d4eb];return _0x1356e5;};'use strict';var Sequelize=require('sequelize');module[_0xab9a('0x0')]={'type':{'type':Sequelize[_0xab9a('0x1')](_0xab9a('0x2'),_0xab9a('0x3'),_0xab9a('0x4'),_0xab9a('0x5'))},'value':{'type':Sequelize[_0xab9a('0x6')]},'username':{'type':Sequelize[_0xab9a('0x6')]},'password':{'type':Sequelize[_0xab9a('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 47b6bf2..3ff96f3 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 _0xf9ce=['Content-Range','update','then','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','count','includeAll','include','Network','findAll','rows','show','params','options','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','/etc/asterisk/sip_xcally_%s.conf','util','path','ejs','lodash','../../config/logger','api','../../config/environment','../../mysqldb','http','request','info','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','json','offset','undefined','limit','status','set'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xf9ce,0x140));var _0xef9c=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0xf9ce[_0x3b231a];return _0x18d67a;};'use strict';var util=require(_0xef9c('0x0'));var path=require(_0xef9c('0x1'));var ejs=require(_0xef9c('0x2'));var fs=require('fs');var _=require(_0xef9c('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xef9c('0x4'))(_0xef9c('0x5'));var config=require(_0xef9c('0x6'));var db=require(_0xef9c('0x7'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xef9c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38d41b,_0x344044,_0x29482b,_0x511383){return new Promise(function(_0xdb2d89,_0x22f067){var _0x436d3e=_0x511383||client;return _0x436d3e[_0xef9c('0x9')](_0x38d41b,_0x29482b)['then'](function(_0x5b94dd){logger[_0xef9c('0xa')](_0xef9c('0xb'),_0x344044,'request\x20sent');logger['debug'](_0xef9c('0xc'),_0x344044,_0xef9c('0xd'),JSON['stringify'](_0x5b94dd));if(_0x5b94dd['error']){if(_0x5b94dd[_0xef9c('0xe')][_0xef9c('0xf')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x344044,_0x5b94dd[_0xef9c('0xe')][_0xef9c('0x10')]);return _0x22f067(_0x5b94dd['error'][_0xef9c('0x10')]);}logger[_0xef9c('0xe')](_0xef9c('0xb'),_0x344044,_0x5b94dd[_0xef9c('0xe')]['message']);return _0xdb2d89(_0x5b94dd[_0xef9c('0xe')][_0xef9c('0x10')]);}else{logger[_0xef9c('0xa')](_0xef9c('0xb'),_0x344044,'request\x20sent');_0xdb2d89(_0x5b94dd['result'][_0xef9c('0x10')]);}})[_0xef9c('0x11')](function(_0x4555b7){logger[_0xef9c('0xe')]('Network,\x20%s,\x20%s',_0x344044,_0x4555b7);_0x22f067(_0x4555b7);});});}function respondWithResult(_0x402bb,_0x494dd6){_0x494dd6=_0x494dd6||0xc8;return function(_0x31ca1a){if(_0x31ca1a){return _0x402bb['status'](_0x494dd6)[_0xef9c('0x12')](_0x31ca1a);}};}function respondWithFilteredResult(_0x13a43a,_0x1ae860){return function(_0x100114){if(_0x100114){var _0x5dbfa2=typeof _0x1ae860[_0xef9c('0x13')]==='undefined'&&typeof _0x1ae860['limit']===_0xef9c('0x14');var _0x2309d0=_0x100114['count'];var _0xf5a1e5=_0x5dbfa2?0x0:_0x1ae860['offset'];var _0x4ccdff=_0x5dbfa2?_0x100114['count']:_0x1ae860[_0xef9c('0x13')]+_0x1ae860[_0xef9c('0x15')];var _0x2ba673;if(_0x4ccdff>=_0x2309d0){_0x4ccdff=_0x2309d0;_0x2ba673=0xc8;}else{_0x2ba673=0xce;}_0x13a43a[_0xef9c('0x16')](_0x2ba673);return _0x13a43a[_0xef9c('0x17')](_0xef9c('0x18'),_0xf5a1e5+'-'+_0x4ccdff+'/'+_0x2309d0)[_0xef9c('0x12')](_0x100114);}return null;};}function saveUpdates(_0x59a5d0){return function(_0x36c832){if(_0x36c832){return _0x36c832[_0xef9c('0x19')](_0x59a5d0)[_0xef9c('0x1a')](function(_0x398e99){return _0x398e99;});}return null;};}function removeEntity(_0x2d65f8){return function(_0x49ae35){if(_0x49ae35){return _0x49ae35[_0xef9c('0x1b')]()[_0xef9c('0x1a')](function(){_0x2d65f8[_0xef9c('0x16')](0xcc)[_0xef9c('0x1c')]();});}};}function handleEntityNotFound(_0x500c1c){return function(_0x12d0e0){if(!_0x12d0e0){_0x500c1c[_0xef9c('0x1d')](0x194);}return _0x12d0e0;};}function handleError(_0x60c033,_0x19b49c){_0x19b49c=_0x19b49c||0x1f4;return function(_0x12e1d6){logger[_0xef9c('0xe')](_0x12e1d6[_0xef9c('0x1e')]);if(_0x12e1d6[_0xef9c('0x1f')]){delete _0x12e1d6[_0xef9c('0x1f')];}_0x60c033[_0xef9c('0x16')](_0x19b49c)[_0xef9c('0x20')](_0x12e1d6);};}exports[_0xef9c('0x21')]=function(_0x5160a2,_0x83296d){var _0x105eb7={},_0x7b2b08={},_0x59ef5d={'count':0x0,'rows':[]};var _0x3cbe42=_[_0xef9c('0x22')](db['Network'][_0xef9c('0x23')],function(_0x14b908){return{'name':_0x14b908[_0xef9c('0x24')],'type':_0x14b908[_0xef9c('0x25')]['key']};});_0x7b2b08[_0xef9c('0x26')]=_[_0xef9c('0x22')](_0x3cbe42,_0xef9c('0x1f'));_0x7b2b08[_0xef9c('0x27')]=_[_0xef9c('0x28')](_0x5160a2[_0xef9c('0x27')]);_0x7b2b08[_0xef9c('0x29')]=_[_0xef9c('0x2a')](_0x7b2b08['model'],_0x7b2b08['query']);_0x105eb7[_0xef9c('0x2b')]=_['intersection'](_0x7b2b08[_0xef9c('0x26')],qs[_0xef9c('0x2c')](_0x5160a2[_0xef9c('0x27')][_0xef9c('0x2c')]));_0x105eb7[_0xef9c('0x2b')]=_0x105eb7[_0xef9c('0x2b')][_0xef9c('0x2d')]?_0x105eb7['attributes']:_0x7b2b08['model'];if(!_0x5160a2[_0xef9c('0x27')][_0xef9c('0x2e')](_0xef9c('0x2f'))){_0x105eb7[_0xef9c('0x15')]=qs[_0xef9c('0x15')](_0x5160a2['query'][_0xef9c('0x15')]);_0x105eb7['offset']=qs[_0xef9c('0x13')](_0x5160a2[_0xef9c('0x27')]['offset']);}_0x105eb7[_0xef9c('0x30')]=qs['sort'](_0x5160a2[_0xef9c('0x27')][_0xef9c('0x31')]);_0x105eb7[_0xef9c('0x32')]=qs[_0xef9c('0x29')](_['pick'](_0x5160a2[_0xef9c('0x27')],_0x7b2b08[_0xef9c('0x29')]),_0x3cbe42);if(_0x5160a2[_0xef9c('0x27')]['filter']){_0x105eb7[_0xef9c('0x32')]=_[_0xef9c('0x33')](_0x105eb7[_0xef9c('0x32')],{'$or':_[_0xef9c('0x22')](_0x3cbe42,function(_0x3ed80a){if(_0x3ed80a[_0xef9c('0x25')]!==_0xef9c('0x34')){var _0x1742cf={};_0x1742cf[_0x3ed80a[_0xef9c('0x1f')]]={'$like':'%'+_0x5160a2[_0xef9c('0x27')][_0xef9c('0x35')]+'%'};return _0x1742cf;}})});}_0x105eb7=_['merge']({},_0x105eb7,_0x5160a2['options']);var _0x476434={'where':_0x105eb7[_0xef9c('0x32')]};return db['Network'][_0xef9c('0x36')](_0x476434)[_0xef9c('0x1a')](function(_0x2188e8){_0x59ef5d[_0xef9c('0x36')]=_0x2188e8;if(_0x5160a2[_0xef9c('0x27')][_0xef9c('0x37')]){_0x105eb7[_0xef9c('0x38')]=[{'all':!![]}];}return db[_0xef9c('0x39')][_0xef9c('0x3a')](_0x105eb7);})[_0xef9c('0x1a')](function(_0x414039){_0x59ef5d[_0xef9c('0x3b')]=_0x414039;return _0x59ef5d;})[_0xef9c('0x1a')](respondWithFilteredResult(_0x83296d,_0x105eb7))[_0xef9c('0x11')](handleError(_0x83296d,null));};exports[_0xef9c('0x3c')]=function(_0x5e7790,_0xfc0ec3){var _0x557036={'raw':!![],'where':{'id':_0x5e7790[_0xef9c('0x3d')]['id']}},_0xc94c0d={};_0xc94c0d['model']=_['keys'](db[_0xef9c('0x39')][_0xef9c('0x23')]);_0xc94c0d[_0xef9c('0x27')]=_[_0xef9c('0x28')](_0x5e7790[_0xef9c('0x27')]);_0xc94c0d[_0xef9c('0x29')]=_[_0xef9c('0x2a')](_0xc94c0d[_0xef9c('0x26')],_0xc94c0d[_0xef9c('0x27')]);_0x557036[_0xef9c('0x2b')]=_[_0xef9c('0x2a')](_0xc94c0d[_0xef9c('0x26')],qs[_0xef9c('0x2c')](_0x5e7790[_0xef9c('0x27')][_0xef9c('0x2c')]));_0x557036[_0xef9c('0x2b')]=_0x557036[_0xef9c('0x2b')][_0xef9c('0x2d')]?_0x557036[_0xef9c('0x2b')]:_0xc94c0d[_0xef9c('0x26')];if(_0x5e7790[_0xef9c('0x27')][_0xef9c('0x37')]){_0x557036[_0xef9c('0x38')]=[{'all':!![]}];}_0x557036=_[_0xef9c('0x33')]({},_0x557036,_0x5e7790[_0xef9c('0x3e')]);return db[_0xef9c('0x39')][_0xef9c('0x3f')](_0x557036)[_0xef9c('0x1a')](handleEntityNotFound(_0xfc0ec3,null))[_0xef9c('0x1a')](respondWithResult(_0xfc0ec3,null))['catch'](handleError(_0xfc0ec3,null));};exports[_0xef9c('0x40')]=function(_0x2a1f4f,_0x37d620){var _0x5deec9;return db[_0xef9c('0x39')][_0xef9c('0x40')](_0x2a1f4f[_0xef9c('0x41')],{'raw':!![]})[_0xef9c('0x1a')](function(_0x545a5b){_0x5deec9=_0x545a5b;return db[_0xef9c('0x39')][_0xef9c('0x3a')]({'where':{'type':_0x2a1f4f[_0xef9c('0x41')][_0xef9c('0x25')]},'raw':!![]});})[_0xef9c('0x1a')](function(_0x1c73ed){if(_0x5deec9[_0xef9c('0x25')][_0xef9c('0x42')]()==_0xef9c('0x43')){var _0x294754=fs[_0xef9c('0x44')](path[_0xef9c('0x45')](config[_0xef9c('0x46')],_0xef9c('0x47')),_0xef9c('0x48'));var _0x370b48=ejs['render'](_0x294754,{'networks':_0x1c73ed||[]});fs[_0xef9c('0x49')](_0xef9c('0x4a'),_0x370b48);return respondWithRpcPromise(_0xef9c('0x4b'),_0xef9c('0x40'),{'module':_0xef9c('0x4c')});}else if(_0x5deec9[_0xef9c('0x25')][_0xef9c('0x42')]()==_0xef9c('0x4d')){var _0x2eff94=fs[_0xef9c('0x44')](path[_0xef9c('0x45')](config['root'],_0xef9c('0x4e')),_0xef9c('0x48'));var _0x469947=ejs[_0xef9c('0x4f')](_0x2eff94,{'networks':_0x1c73ed||[]});fs[_0xef9c('0x49')](_0xef9c('0x50'),_0x469947);return respondWithRpcPromise('Reload',_0xef9c('0x40'),{'module':_0xef9c('0x4c')});}else{var _0x1e2f79=fs[_0xef9c('0x44')](path[_0xef9c('0x45')](config['root'],_0xef9c('0x51')),_0xef9c('0x48'));var _0x10e710=ejs['render'](_0x1e2f79,{'networks':_0x1c73ed||[]});fs['writeFileSync'](util[_0xef9c('0x52')]('/etc/asterisk/sip_xcally_%s.conf',_0x2a1f4f[_0xef9c('0x41')]['type'][_0xef9c('0x53')]()),_0x10e710);return respondWithRpcPromise(_0xef9c('0x4b'),_0xef9c('0x40'),{'module':_0xef9c('0x54')});}})[_0xef9c('0x1a')](function(){return _0x5deec9;})[_0xef9c('0x1a')](respondWithResult(_0x37d620,0xc9))[_0xef9c('0x11')](handleError(_0x37d620,null));};exports['update']=function(_0x4786ed,_0x8488e8){var _0x1d1bc3;return db[_0xef9c('0x39')][_0xef9c('0x3f')]({'where':{'id':_0x4786ed['params']['id']}})[_0xef9c('0x1a')](handleEntityNotFound(_0x8488e8,null))[_0xef9c('0x1a')](saveUpdates(_0x4786ed['body'],null))[_0xef9c('0x1a')](function(_0x5be0b8){if(_0x5be0b8){_0x1d1bc3=_0x5be0b8;return db[_0xef9c('0x39')][_0xef9c('0x3a')]({'where':{'type':_0x1d1bc3[_0xef9c('0x25')]},'raw':!![]});}return null;})[_0xef9c('0x1a')](function(_0x4f395f){if(_0x1d1bc3[_0xef9c('0x25')]['toUpperCase']()==_0xef9c('0x43')){var _0x527a7c=fs[_0xef9c('0x44')](path[_0xef9c('0x45')](config['root'],'server/files/templates/stun_multiple.ejs'),_0xef9c('0x48'));var _0x4466df=ejs['render'](_0x527a7c,{'networks':_0x4f395f||[]});fs[_0xef9c('0x49')](_0xef9c('0x4a'),_0x4466df);return respondWithRpcPromise(_0xef9c('0x4b'),_0xef9c('0x19'),{'module':'res_stun_monitor.so'});}else if(_0x1d1bc3[_0xef9c('0x25')][_0xef9c('0x42')]()==_0xef9c('0x4d')){var _0x23a1f8=fs[_0xef9c('0x44')](path[_0xef9c('0x45')](config[_0xef9c('0x46')],_0xef9c('0x4e')),_0xef9c('0x48'));var _0x2330e2=ejs[_0xef9c('0x4f')](_0x23a1f8,{'networks':_0x4f395f||[]});fs[_0xef9c('0x49')](_0xef9c('0x50'),_0x2330e2);return respondWithRpcPromise('Reload',_0xef9c('0x19'),{'module':'res_stun_monitor.so'});}else{var _0xf2a915=fs[_0xef9c('0x44')](path['join'](config[_0xef9c('0x46')],'server/files/templates/network.ejs'),_0xef9c('0x48'));var _0x520566=ejs[_0xef9c('0x4f')](_0xf2a915,{'networks':_0x4f395f||[]});fs['writeFileSync'](util[_0xef9c('0x52')](_0xef9c('0x55'),_0x4786ed[_0xef9c('0x41')][_0xef9c('0x25')][_0xef9c('0x53')]()),_0x520566);return respondWithRpcPromise(_0xef9c('0x4b'),_0xef9c('0x19'),{'module':'chan_sip.so'});}})['then'](function(_0x79a999){if(_0x79a999){return _0x1d1bc3;}return null;})[_0xef9c('0x1a')](respondWithResult(_0x8488e8,null))[_0xef9c('0x11')](handleError(_0x8488e8,null));};exports['destroy']=function(_0x1d36ed,_0x40dced){var _0x5224ea;return db[_0xef9c('0x39')][_0xef9c('0x3f')]({'where':{'id':_0x1d36ed[_0xef9c('0x3d')]['id']}})[_0xef9c('0x1a')](function(_0x12488d){_0x5224ea=_0x12488d;return _0x12488d;})['then'](handleEntityNotFound(_0x40dced,null))[_0xef9c('0x1a')](removeEntity(_0x40dced,null))[_0xef9c('0x1a')](function(){if(_0x5224ea){return db['Network']['findAll']({'where':{'type':_0x5224ea['type']},'raw':!![]});}})[_0xef9c('0x1a')](function(_0x44c276){if(_0x5224ea[_0xef9c('0x25')][_0xef9c('0x42')]()=='STUN'){var _0x100008=fs[_0xef9c('0x44')](path['join'](config[_0xef9c('0x46')],_0xef9c('0x47')),_0xef9c('0x48'));var _0x23c07c=ejs[_0xef9c('0x4f')](_0x100008,{'networks':_0x44c276||[]});fs[_0xef9c('0x49')](_0xef9c('0x4a'),_0x23c07c);return respondWithRpcPromise(_0xef9c('0x4b'),_0xef9c('0x1b'),{'module':_0xef9c('0x4c')});}else if(_0x5224ea[_0xef9c('0x25')]['toUpperCase']()=='TURN'){var _0x10fc27=fs[_0xef9c('0x44')](path[_0xef9c('0x45')](config[_0xef9c('0x46')],_0xef9c('0x4e')),'utf8');var _0x15270d=ejs[_0xef9c('0x4f')](_0x10fc27,{'networks':_0x44c276||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x15270d);return respondWithRpcPromise(_0xef9c('0x4b'),_0xef9c('0x1b'),{'module':_0xef9c('0x4c')});}else{var _0x2244cb=fs['readFileSync'](path[_0xef9c('0x45')](config[_0xef9c('0x46')],_0xef9c('0x51')),_0xef9c('0x48'));var _0x144e76=ejs[_0xef9c('0x4f')](_0x2244cb,{'networks':_0x44c276||[]});fs[_0xef9c('0x49')](util[_0xef9c('0x52')](_0xef9c('0x55'),_0x5224ea['type'][_0xef9c('0x53')]()),_0x144e76);return respondWithRpcPromise(_0xef9c('0x4b'),_0xef9c('0x1b'),{'module':_0xef9c('0x54')});}})[_0xef9c('0x11')](handleError(_0x40dced,null));}; \ No newline at end of file +var _0xa80b=['Network,\x20%s,\x20%s','message','result','status','json','offset','undefined','count','limit','Content-Range','end','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','length','includeAll','create','body','toUpperCase','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','res_stun_monitor.so','TURN','render','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','toLowerCase','chan_sip.so','update','find','params','join','server/files/templates/turn_multiple.ejs','format','/etc/asterisk/sip_xcally_%s.conf','STUN','destroy','util','path','ejs','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','client','http','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa80b,0x1aa));var _0xba80=function(_0x394798,_0x14af05){_0x394798=_0x394798-0x0;var _0x80638c=_0xa80b[_0x394798];return _0x80638c;};'use strict';var util=require(_0xba80('0x0'));var path=require(_0xba80('0x1'));var ejs=require(_0xba80('0x2'));var fs=require('fs');var _=require(_0xba80('0x3'));var qs=require(_0xba80('0x4'));var logger=require('../../config/logger')(_0xba80('0x5'));var config=require(_0xba80('0x6'));var db=require(_0xba80('0x7'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xba80('0x8')][_0xba80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49db8c,_0xf44041,_0x5ba2c5,_0x4f23cc){return new Promise(function(_0xb07f04,_0x442b29){var _0x5ee1a6=_0x4f23cc||client;return _0x5ee1a6[_0xba80('0xa')](_0x49db8c,_0x5ba2c5)[_0xba80('0xb')](function(_0x398c0b){logger[_0xba80('0xc')]('Network,\x20%s,\x20%s',_0xf44041,_0xba80('0xd'));logger[_0xba80('0xe')](_0xba80('0xf'),_0xf44041,_0xba80('0xd'),JSON[_0xba80('0x10')](_0x398c0b));if(_0x398c0b[_0xba80('0x11')]){if(_0x398c0b[_0xba80('0x11')][_0xba80('0x12')]===0x1f4){logger[_0xba80('0x11')](_0xba80('0x13'),_0xf44041,_0x398c0b[_0xba80('0x11')][_0xba80('0x14')]);return _0x442b29(_0x398c0b[_0xba80('0x11')][_0xba80('0x14')]);}logger['error'](_0xba80('0x13'),_0xf44041,_0x398c0b['error']['message']);return _0xb07f04(_0x398c0b[_0xba80('0x11')][_0xba80('0x14')]);}else{logger['info'](_0xba80('0x13'),_0xf44041,'request\x20sent');_0xb07f04(_0x398c0b[_0xba80('0x15')]['message']);}})['catch'](function(_0x54288e){logger[_0xba80('0x11')](_0xba80('0x13'),_0xf44041,_0x54288e);_0x442b29(_0x54288e);});});}function respondWithResult(_0x1df00a,_0x53bb39){_0x53bb39=_0x53bb39||0xc8;return function(_0xd3b52e){if(_0xd3b52e){return _0x1df00a[_0xba80('0x16')](_0x53bb39)[_0xba80('0x17')](_0xd3b52e);}};}function respondWithFilteredResult(_0x183514,_0x3579a6){return function(_0x24705c){if(_0x24705c){var _0x211f8b=typeof _0x3579a6[_0xba80('0x18')]===_0xba80('0x19')&&typeof _0x3579a6['limit']===_0xba80('0x19');var _0x1da0c1=_0x24705c[_0xba80('0x1a')];var _0x27daef=_0x211f8b?0x0:_0x3579a6[_0xba80('0x18')];var _0x21ac62=_0x211f8b?_0x24705c[_0xba80('0x1a')]:_0x3579a6[_0xba80('0x18')]+_0x3579a6[_0xba80('0x1b')];var _0x392031;if(_0x21ac62>=_0x1da0c1){_0x21ac62=_0x1da0c1;_0x392031=0xc8;}else{_0x392031=0xce;}_0x183514[_0xba80('0x16')](_0x392031);return _0x183514['set'](_0xba80('0x1c'),_0x27daef+'-'+_0x21ac62+'/'+_0x1da0c1)[_0xba80('0x17')](_0x24705c);}return null;};}function saveUpdates(_0x55e36d){return function(_0x5db35e){if(_0x5db35e){return _0x5db35e['update'](_0x55e36d)[_0xba80('0xb')](function(_0x467457){return _0x467457;});}return null;};}function removeEntity(_0x52f49d){return function(_0x36dfd7){if(_0x36dfd7){return _0x36dfd7['destroy']()[_0xba80('0xb')](function(){_0x52f49d[_0xba80('0x16')](0xcc)[_0xba80('0x1d')]();});}};}function handleEntityNotFound(_0x1715dd){return function(_0x46661c){if(!_0x46661c){_0x1715dd[_0xba80('0x1e')](0x194);}return _0x46661c;};}function handleError(_0x47e6e1,_0x5c6305){_0x5c6305=_0x5c6305||0x1f4;return function(_0x26e2a7){logger['error'](_0x26e2a7[_0xba80('0x1f')]);if(_0x26e2a7[_0xba80('0x20')]){delete _0x26e2a7['name'];}_0x47e6e1[_0xba80('0x16')](_0x5c6305)[_0xba80('0x21')](_0x26e2a7);};}exports[_0xba80('0x22')]=function(_0x20eafc,_0x4320d2){var _0x52e9f0={},_0xe2fcb4={},_0x292f62={'count':0x0,'rows':[]};var _0x127d05=_[_0xba80('0x23')](db[_0xba80('0x24')][_0xba80('0x25')],function(_0x4a2cea){return{'name':_0x4a2cea[_0xba80('0x26')],'type':_0x4a2cea[_0xba80('0x27')][_0xba80('0x28')]};});_0xe2fcb4[_0xba80('0x29')]=_[_0xba80('0x23')](_0x127d05,_0xba80('0x20'));_0xe2fcb4[_0xba80('0x2a')]=_[_0xba80('0x2b')](_0x20eafc['query']);_0xe2fcb4['filters']=_[_0xba80('0x2c')](_0xe2fcb4[_0xba80('0x29')],_0xe2fcb4['query']);_0x52e9f0[_0xba80('0x2d')]=_[_0xba80('0x2c')](_0xe2fcb4[_0xba80('0x29')],qs[_0xba80('0x2e')](_0x20eafc['query'][_0xba80('0x2e')]));_0x52e9f0[_0xba80('0x2d')]=_0x52e9f0[_0xba80('0x2d')]['length']?_0x52e9f0[_0xba80('0x2d')]:_0xe2fcb4[_0xba80('0x29')];if(!_0x20eafc['query'][_0xba80('0x2f')](_0xba80('0x30'))){_0x52e9f0[_0xba80('0x1b')]=qs[_0xba80('0x1b')](_0x20eafc['query']['limit']);_0x52e9f0['offset']=qs[_0xba80('0x18')](_0x20eafc[_0xba80('0x2a')]['offset']);}_0x52e9f0[_0xba80('0x31')]=qs[_0xba80('0x32')](_0x20eafc[_0xba80('0x2a')]['sort']);_0x52e9f0[_0xba80('0x33')]=qs[_0xba80('0x34')](_[_0xba80('0x35')](_0x20eafc[_0xba80('0x2a')],_0xe2fcb4['filters']),_0x127d05);if(_0x20eafc[_0xba80('0x2a')][_0xba80('0x36')]){_0x52e9f0[_0xba80('0x33')]=_[_0xba80('0x37')](_0x52e9f0['where'],{'$or':_[_0xba80('0x23')](_0x127d05,function(_0x3c01ed){if(_0x3c01ed[_0xba80('0x27')]!=='VIRTUAL'){var _0x3c7e3a={};_0x3c7e3a[_0x3c01ed['name']]={'$like':'%'+_0x20eafc[_0xba80('0x2a')][_0xba80('0x36')]+'%'};return _0x3c7e3a;}})});}_0x52e9f0=_['merge']({},_0x52e9f0,_0x20eafc[_0xba80('0x38')]);var _0x9769ca={'where':_0x52e9f0[_0xba80('0x33')]};return db[_0xba80('0x24')]['count'](_0x9769ca)[_0xba80('0xb')](function(_0x3766d1){_0x292f62['count']=_0x3766d1;if(_0x20eafc[_0xba80('0x2a')]['includeAll']){_0x52e9f0[_0xba80('0x39')]=[{'all':!![]}];}return db[_0xba80('0x24')][_0xba80('0x3a')](_0x52e9f0);})[_0xba80('0xb')](function(_0x5816f8){_0x292f62[_0xba80('0x3b')]=_0x5816f8;return _0x292f62;})[_0xba80('0xb')](respondWithFilteredResult(_0x4320d2,_0x52e9f0))[_0xba80('0x3c')](handleError(_0x4320d2,null));};exports[_0xba80('0x3d')]=function(_0x3bc6e1,_0x393d45){var _0x2c0de6={'raw':!![],'where':{'id':_0x3bc6e1['params']['id']}},_0x1a53dd={};_0x1a53dd[_0xba80('0x29')]=_[_0xba80('0x2b')](db[_0xba80('0x24')][_0xba80('0x25')]);_0x1a53dd['query']=_[_0xba80('0x2b')](_0x3bc6e1[_0xba80('0x2a')]);_0x1a53dd[_0xba80('0x34')]=_[_0xba80('0x2c')](_0x1a53dd[_0xba80('0x29')],_0x1a53dd[_0xba80('0x2a')]);_0x2c0de6[_0xba80('0x2d')]=_[_0xba80('0x2c')](_0x1a53dd[_0xba80('0x29')],qs['fields'](_0x3bc6e1['query']['fields']));_0x2c0de6[_0xba80('0x2d')]=_0x2c0de6[_0xba80('0x2d')][_0xba80('0x3e')]?_0x2c0de6[_0xba80('0x2d')]:_0x1a53dd[_0xba80('0x29')];if(_0x3bc6e1['query'][_0xba80('0x3f')]){_0x2c0de6['include']=[{'all':!![]}];}_0x2c0de6=_['merge']({},_0x2c0de6,_0x3bc6e1[_0xba80('0x38')]);return db[_0xba80('0x24')]['find'](_0x2c0de6)[_0xba80('0xb')](handleEntityNotFound(_0x393d45,null))[_0xba80('0xb')](respondWithResult(_0x393d45,null))[_0xba80('0x3c')](handleError(_0x393d45,null));};exports[_0xba80('0x40')]=function(_0x31cd60,_0x3c7496){var _0x280077;return db['Network']['create'](_0x31cd60[_0xba80('0x41')],{'raw':!![]})[_0xba80('0xb')](function(_0x79b289){_0x280077=_0x79b289;return db[_0xba80('0x24')][_0xba80('0x3a')]({'where':{'type':_0x31cd60[_0xba80('0x41')]['type']},'raw':!![]});})[_0xba80('0xb')](function(_0x107c89){if(_0x280077['type'][_0xba80('0x42')]()=='STUN'){var _0x4dfa75=fs[_0xba80('0x43')](path['join'](config[_0xba80('0x44')],_0xba80('0x45')),_0xba80('0x46'));var _0x28e23b=ejs['render'](_0x4dfa75,{'networks':_0x107c89||[]});fs[_0xba80('0x47')]('/etc/asterisk/stun_xcally.conf',_0x28e23b);return respondWithRpcPromise(_0xba80('0x48'),_0xba80('0x40'),{'module':_0xba80('0x49')});}else if(_0x280077['type'][_0xba80('0x42')]()==_0xba80('0x4a')){var _0xb72237=fs[_0xba80('0x43')](path['join'](config[_0xba80('0x44')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x47c801=ejs[_0xba80('0x4b')](_0xb72237,{'networks':_0x107c89||[]});fs[_0xba80('0x47')](_0xba80('0x4c'),_0x47c801);return respondWithRpcPromise('Reload','create',{'module':_0xba80('0x49')});}else{var _0x4ca144=fs['readFileSync'](path['join'](config['root'],_0xba80('0x4d')),_0xba80('0x46'));var _0x26ac91=ejs['render'](_0x4ca144,{'networks':_0x107c89||[]});fs[_0xba80('0x47')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x31cd60[_0xba80('0x41')][_0xba80('0x27')][_0xba80('0x4e')]()),_0x26ac91);return respondWithRpcPromise(_0xba80('0x48'),_0xba80('0x40'),{'module':_0xba80('0x4f')});}})[_0xba80('0xb')](function(){return _0x280077;})[_0xba80('0xb')](respondWithResult(_0x3c7496,0xc9))['catch'](handleError(_0x3c7496,null));};exports[_0xba80('0x50')]=function(_0x542f3d,_0x441999){var _0x1b94e4;return db[_0xba80('0x24')][_0xba80('0x51')]({'where':{'id':_0x542f3d[_0xba80('0x52')]['id']}})[_0xba80('0xb')](handleEntityNotFound(_0x441999,null))[_0xba80('0xb')](saveUpdates(_0x542f3d[_0xba80('0x41')],null))[_0xba80('0xb')](function(_0x253dab){if(_0x253dab){_0x1b94e4=_0x253dab;return db[_0xba80('0x24')]['findAll']({'where':{'type':_0x1b94e4[_0xba80('0x27')]},'raw':!![]});}return null;})[_0xba80('0xb')](function(_0xd1545a){if(_0x1b94e4[_0xba80('0x27')][_0xba80('0x42')]()=='STUN'){var _0x5bfe25=fs['readFileSync'](path[_0xba80('0x53')](config[_0xba80('0x44')],_0xba80('0x45')),_0xba80('0x46'));var _0x215dc4=ejs[_0xba80('0x4b')](_0x5bfe25,{'networks':_0xd1545a||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x215dc4);return respondWithRpcPromise(_0xba80('0x48'),_0xba80('0x50'),{'module':_0xba80('0x49')});}else if(_0x1b94e4[_0xba80('0x27')][_0xba80('0x42')]()==_0xba80('0x4a')){var _0x10cf06=fs[_0xba80('0x43')](path['join'](config[_0xba80('0x44')],_0xba80('0x54')),'utf8');var _0x312b7f=ejs[_0xba80('0x4b')](_0x10cf06,{'networks':_0xd1545a||[]});fs[_0xba80('0x47')](_0xba80('0x4c'),_0x312b7f);return respondWithRpcPromise('Reload',_0xba80('0x50'),{'module':_0xba80('0x49')});}else{var _0x15cf8a=fs[_0xba80('0x43')](path['join'](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x4f67ca=ejs[_0xba80('0x4b')](_0x15cf8a,{'networks':_0xd1545a||[]});fs[_0xba80('0x47')](util[_0xba80('0x55')](_0xba80('0x56'),_0x542f3d[_0xba80('0x41')][_0xba80('0x27')][_0xba80('0x4e')]()),_0x4f67ca);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}})[_0xba80('0xb')](function(_0xd722bf){if(_0xd722bf){return _0x1b94e4;}return null;})['then'](respondWithResult(_0x441999,null))[_0xba80('0x3c')](handleError(_0x441999,null));};exports['destroy']=function(_0x54b078,_0x1e59de){var _0x4a5a56;return db[_0xba80('0x24')][_0xba80('0x51')]({'where':{'id':_0x54b078[_0xba80('0x52')]['id']}})['then'](function(_0x1ba2e3){_0x4a5a56=_0x1ba2e3;return _0x1ba2e3;})[_0xba80('0xb')](handleEntityNotFound(_0x1e59de,null))[_0xba80('0xb')](removeEntity(_0x1e59de,null))['then'](function(){if(_0x4a5a56){return db[_0xba80('0x24')][_0xba80('0x3a')]({'where':{'type':_0x4a5a56[_0xba80('0x27')]},'raw':!![]});}})[_0xba80('0xb')](function(_0x1753e7){if(_0x4a5a56['type'][_0xba80('0x42')]()==_0xba80('0x57')){var _0x541ba5=fs[_0xba80('0x43')](path['join'](config['root'],_0xba80('0x45')),'utf8');var _0x1060c4=ejs[_0xba80('0x4b')](_0x541ba5,{'networks':_0x1753e7||[]});fs[_0xba80('0x47')]('/etc/asterisk/stun_xcally.conf',_0x1060c4);return respondWithRpcPromise('Reload','destroy',{'module':'res_stun_monitor.so'});}else if(_0x4a5a56[_0xba80('0x27')]['toUpperCase']()=='TURN'){var _0x16122b=fs['readFileSync'](path['join'](config['root'],_0xba80('0x54')),'utf8');var _0x496b7a=ejs[_0xba80('0x4b')](_0x16122b,{'networks':_0x1753e7||[]});fs[_0xba80('0x47')](_0xba80('0x4c'),_0x496b7a);return respondWithRpcPromise(_0xba80('0x48'),_0xba80('0x58'),{'module':_0xba80('0x49')});}else{var _0xe1afd0=fs[_0xba80('0x43')](path[_0xba80('0x53')](config[_0xba80('0x44')],'server/files/templates/network.ejs'),'utf8');var _0x184fc2=ejs[_0xba80('0x4b')](_0xe1afd0,{'networks':_0x1753e7||[]});fs[_0xba80('0x47')](util[_0xba80('0x55')](_0xba80('0x56'),_0x4a5a56[_0xba80('0x27')][_0xba80('0x4e')]()),_0x184fc2);return respondWithRpcPromise(_0xba80('0x48'),_0xba80('0x58'),{'module':_0xba80('0x4f')});}})[_0xba80('0x3c')](handleError(_0x1e59de,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 5e0ea73..21420f5 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 _0xfc03=['./network.attributes','exports','define','network','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x2d3ec4,_0x119362){var _0x6d0b5=function(_0xd6d7da){while(--_0xd6d7da){_0x2d3ec4['push'](_0x2d3ec4['shift']());}};_0x6d0b5(++_0x119362);}(_0xfc03,0x16f));var _0x3fc0=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xfc03[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0x3fc0('0x0'));var util=require('util');var logger=require(_0x3fc0('0x1'))(_0x3fc0('0x2'));var moment=require('moment');var BPromise=require(_0x3fc0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fc0('0x4'));var rimraf=require(_0x3fc0('0x5'));var config=require(_0x3fc0('0x6'));var attributes=require(_0x3fc0('0x7'));module[_0x3fc0('0x8')]=function(_0x389bfb,_0x2b4ef6){return _0x389bfb[_0x3fc0('0x9')]('Network',attributes,{'tableName':_0x3fc0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9567=['lodash','util','../../config/logger','api','moment','path','rimraf','./network.attributes','define','Network'];(function(_0x4b452c,_0x490c60){var _0x430787=function(_0xc33fdd){while(--_0xc33fdd){_0x4b452c['push'](_0x4b452c['shift']());}};_0x430787(++_0x490c60);}(_0x9567,0xdc));var _0x7956=function(_0x26f195,_0x15391e){_0x26f195=_0x26f195-0x0;var _0x1552ff=_0x9567[_0x26f195];return _0x1552ff;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var logger=require(_0x7956('0x2'))(_0x7956('0x3'));var moment=require(_0x7956('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7956('0x5'));var rimraf=require(_0x7956('0x6'));var config=require('../../config/environment');var attributes=require(_0x7956('0x7'));module['exports']=function(_0x12c09e,_0x48c4b6){return _0x12c09e[_0x7956('0x8')](_0x7956('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index c251413..b5447f5 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x451339,_0x331a14){_0x451339=_0x451339-0x0;var _0x1e9148=_0x7a54[_0x451339];return _0x1e9148;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x12c311,_0xb94ffb){_0x12c311=_0x12c311-0x0;var _0x184985=_0x7a54[_0x12c311];return _0x184985;};'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 cec13a5..4a1402a 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 _0x182c=['addApplications','addAgents','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','addAnswer','/:id/notify'];(function(_0x245307,_0x12cbb9){var _0x4cf712=function(_0x1ee4af){while(--_0x1ee4af){_0x245307['push'](_0x245307['shift']());}};_0x4cf712(++_0x12cbb9);}(_0x182c,0x1df));var _0xc182=function(_0x3b83ad,_0x51290d){_0x3b83ad=_0x3b83ad-0x0;var _0x20e6fd=_0x182c[_0x3b83ad];return _0x20e6fd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc182('0x0'));var timeout=require(_0xc182('0x1'));var express=require(_0xc182('0x2'));var router=express['Router']();var fs_extra=require(_0xc182('0x3'));var auth=require(_0xc182('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc182('0x5'));var controller=require(_0xc182('0x6'));router[_0xc182('0x7')]('/',auth[_0xc182('0x8')](),controller[_0xc182('0x9')]);router['get']('/describe',auth[_0xc182('0x8')](),controller[_0xc182('0xa')]);router['get']('/:id',auth[_0xc182('0x8')](),controller['show']);router[_0xc182('0x7')](_0xc182('0xb'),auth['isAuthenticated'](),controller[_0xc182('0xc')]);router[_0xc182('0x7')](_0xc182('0xd'),auth[_0xc182('0x8')](),controller[_0xc182('0xe')]);router[_0xc182('0x7')](_0xc182('0xf'),auth[_0xc182('0x8')](),controller[_0xc182('0x10')]);router[_0xc182('0x7')](_0xc182('0x11'),auth[_0xc182('0x8')](),controller[_0xc182('0x12')]);router[_0xc182('0x7')](_0xc182('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0xc182('0x14')]('/',auth['isAuthenticated'](),controller[_0xc182('0x15')]);router[_0xc182('0x14')](_0xc182('0xb'),auth[_0xc182('0x8')](),controller[_0xc182('0x16')]);router[_0xc182('0x14')](_0xc182('0xd'),auth[_0xc182('0x8')](),controller[_0xc182('0x17')]);router[_0xc182('0x14')](_0xc182('0x18'),controller['notify']);router[_0xc182('0x14')]('/:id/applications',auth[_0xc182('0x8')](),controller[_0xc182('0x19')]);router[_0xc182('0x14')](_0xc182('0x13'),auth[_0xc182('0x8')](),controller[_0xc182('0x1a')]);router[_0xc182('0x14')](_0xc182('0x1b'),auth['isAuthenticated'](),controller[_0xc182('0x1c')]);router[_0xc182('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xc182('0x1e')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc182('0x1f')]);router[_0xc182('0x20')](_0xc182('0xb'),auth[_0xc182('0x8')](),controller[_0xc182('0x21')]);router[_0xc182('0x20')](_0xc182('0xd'),auth['isAuthenticated'](),controller[_0xc182('0x22')]);router[_0xc182('0x20')](_0xc182('0x13'),auth[_0xc182('0x8')](),controller['removeAgents']);module[_0xc182('0x23')]=router; \ No newline at end of file +var _0x4d03=['destroy','delete','removeDispositions','removeAnswers','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/notify','notify','addAgents','/:id/send','send','put','/:id','update'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x4d03,0x16d));var _0x34d0=function(_0x362a54,_0x53a0f2){_0x362a54=_0x362a54-0x0;var _0x288849=_0x4d03[_0x362a54];return _0x288849;};'use strict';var multer=require('multer');var util=require(_0x34d0('0x0'));var path=require(_0x34d0('0x1'));var timeout=require(_0x34d0('0x2'));var express=require(_0x34d0('0x3'));var router=express[_0x34d0('0x4')]();var fs_extra=require(_0x34d0('0x5'));var auth=require(_0x34d0('0x6'));var interaction=require(_0x34d0('0x7'));var config=require(_0x34d0('0x8'));var controller=require(_0x34d0('0x9'));router[_0x34d0('0xa')]('/',auth[_0x34d0('0xb')](),controller['index']);router[_0x34d0('0xa')]('/describe',auth[_0x34d0('0xb')](),controller[_0x34d0('0xc')]);router[_0x34d0('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x34d0('0xd')]);router[_0x34d0('0xa')](_0x34d0('0xe'),auth[_0x34d0('0xb')](),controller[_0x34d0('0xf')]);router['get'](_0x34d0('0x10'),auth[_0x34d0('0xb')](),controller[_0x34d0('0x11')]);router['get'](_0x34d0('0x12'),auth[_0x34d0('0xb')](),controller[_0x34d0('0x13')]);router['get'](_0x34d0('0x14'),auth[_0x34d0('0xb')](),controller[_0x34d0('0x15')]);router[_0x34d0('0xa')](_0x34d0('0x16'),auth[_0x34d0('0xb')](),controller[_0x34d0('0x17')]);router['post']('/',auth[_0x34d0('0xb')](),controller['create']);router[_0x34d0('0x18')]('/:id/dispositions',auth[_0x34d0('0xb')](),controller[_0x34d0('0x19')]);router[_0x34d0('0x18')]('/:id/canned_answers',auth[_0x34d0('0xb')](),controller[_0x34d0('0x1a')]);router[_0x34d0('0x18')](_0x34d0('0x1b'),controller[_0x34d0('0x1c')]);router[_0x34d0('0x18')](_0x34d0('0x12'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x34d0('0x16'),auth[_0x34d0('0xb')](),controller[_0x34d0('0x1d')]);router[_0x34d0('0x18')](_0x34d0('0x1e'),auth['isAuthenticated'](),controller[_0x34d0('0x1f')]);router[_0x34d0('0x20')](_0x34d0('0x21'),auth[_0x34d0('0xb')](),controller[_0x34d0('0x22')]);router['delete'](_0x34d0('0x21'),auth['isAuthenticated'](),controller[_0x34d0('0x23')]);router[_0x34d0('0x24')](_0x34d0('0xe'),auth['isAuthenticated'](),controller[_0x34d0('0x25')]);router[_0x34d0('0x24')](_0x34d0('0x10'),auth['isAuthenticated'](),controller[_0x34d0('0x26')]);router['delete']('/:id/users',auth[_0x34d0('0xb')](),controller[_0x34d0('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index c3dfd99..8a19b88 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 _0x80c2=['mandatoryDisposition','sequelize','randomstring','STRING','generate','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0x509c0b,_0x4d4553){var _0x5f0415=function(_0x4f9d10){while(--_0x4f9d10){_0x509c0b['push'](_0x509c0b['shift']());}};_0x5f0415(++_0x4d4553);}(_0x80c2,0x14e));var _0x280c=function(_0x3f431c,_0x4ab8b7){_0x3f431c=_0x3f431c-0x0;var _0x49264d=_0x80c2[_0x3f431c];return _0x49264d;};'use strict';var Sequelize=require(_0x280c('0x0'));var rs=require(_0x280c('0x1'));module['exports']={'name':{'type':Sequelize[_0x280c('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x280c('0x2')],'defaultValue':function(){return rs[_0x280c('0x3')]();}},'replyUri':{'type':Sequelize[_0x280c('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x280c('0x4')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x280c('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x280c('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x280c('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x280c('0x6')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x15e760){if(!_0x15e760)this[_0x280c('0x7')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x280c('0x8'),_0x15e760);}}}; \ No newline at end of file +var _0x26a5=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0x26a5,0x93));var _0x526a=function(_0x54370b,_0x37c5f0){_0x54370b=_0x54370b-0x0;var _0x39323a=_0x26a5[_0x54370b];return _0x39323a;};'use strict';var Sequelize=require(_0x526a('0x0'));var rs=require(_0x526a('0x1'));module[_0x526a('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x526a('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x526a('0x4')]},'token':{'type':Sequelize[_0x526a('0x4')],'defaultValue':function(){return rs[_0x526a('0x5')]();}},'replyUri':{'type':Sequelize[_0x526a('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x526a('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x526a('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x526a('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x526a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x526a('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x526a('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x526a('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x526a('0x6')],'defaultValue':![],'comment':_0x526a('0x9'),'set':function(_0x36ec48){if(!_0x36ec48)this[_0x526a('0xa')](_0x526a('0xb'),null);this[_0x526a('0xa')](_0x526a('0xc'),_0x36ec48);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index e45ad02..4962ddc 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 _0x14f8=['bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','out','Messages','spread','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','catch','sendStatus','status','end','json','offset','count','limit','set','Content-Range','reject','save','update','destroy','OpenchannelAccounts','UserProfileResource','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','show','params','Pause','find','create','get','role','user','UserProfileSection','userProfileId','body','mandatoryDispositionPause','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','pick','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','from','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','firstName','messageId','created','interaction','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','notify','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','map'];(function(_0x56acd3,_0x52fcc5){var _0x920a32=function(_0x16dc60){while(--_0x16dc60){_0x56acd3['push'](_0x56acd3['shift']());}};_0x920a32(++_0x52fcc5);}(_0x14f8,0x193));var _0x814f=function(_0x383435,_0x38ad33){_0x383435=_0x383435-0x0;var _0x1dc581=_0x14f8[_0x383435];return _0x1dc581;};'use strict';var emlformat=require(_0x814f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x814f('0x1'));var jsonpatch=require(_0x814f('0x2'));var rp=require(_0x814f('0x3'));var moment=require('moment');var BPromise=require(_0x814f('0x4'));var Mustache=require(_0x814f('0x5'));var util=require(_0x814f('0x6'));var path=require(_0x814f('0x7'));var sox=require('sox');var csv=require(_0x814f('0x8'));var ejs=require(_0x814f('0x9'));var fs=require('fs');var fs_extra=require(_0x814f('0xa'));var _=require(_0x814f('0xb'));var squel=require('squel');var crypto=require(_0x814f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x814f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x814f('0xe'));var Papa=require('papaparse');var Redis=require(_0x814f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x814f('0x10'));var as=require(_0x814f('0x11'));var hardwareService=require(_0x814f('0x12'));var logger=require(_0x814f('0x13'))(_0x814f('0x14'));var utils=require(_0x814f('0x15'));var config=require(_0x814f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x814f('0x17'))['db'];config[_0x814f('0x18')]=_[_0x814f('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x814f('0x1a'))(new Redis(config[_0x814f('0x18')]));require(_0x814f('0x1b'))[_0x814f('0x1c')](socket);var jayson=require(_0x814f('0x1d'));var client=jayson[_0x814f('0x1e')][_0x814f('0x1f')]({'port':0x232c});var client9002=jayson[_0x814f('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x171ab4,_0x10b981,_0x39e15f,_0x7814d0){return new BPromise(function(_0x1767fb,_0x1b3633){var _0x41179a=_0x7814d0||client;return _0x41179a['request'](_0x171ab4,_0x39e15f)[_0x814f('0x20')](function(_0x5db7b8){logger[_0x814f('0x21')](_0x814f('0x22'),_0x10b981,'request\x20sent');logger['debug'](_0x814f('0x23'),_0x10b981,'request\x20sent',JSON['stringify'](_0x5db7b8));if(_0x5db7b8['error']){if(_0x5db7b8['error'][_0x814f('0x24')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x10b981,_0x5db7b8[_0x814f('0x25')][_0x814f('0x26')]);return _0x1b3633(_0x5db7b8[_0x814f('0x25')]['message']);}logger[_0x814f('0x25')](_0x814f('0x22'),_0x10b981,_0x5db7b8[_0x814f('0x25')]['message']);return _0x1767fb(_0x5db7b8[_0x814f('0x25')][_0x814f('0x26')]);}else{logger['info'](_0x814f('0x22'),_0x10b981,_0x814f('0x27'));_0x1767fb(_0x5db7b8['result'][_0x814f('0x26')]);}})[_0x814f('0x28')](function(_0xc162af){logger[_0x814f('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x10b981,_0xc162af);_0x1b3633(_0xc162af);});});}function respondWithStatusCode(_0x54798f,_0x5d7582){_0x5d7582=_0x5d7582||0xcc;return function(_0x2f6693){if(_0x2f6693){return _0x54798f[_0x814f('0x29')](_0x5d7582);}return _0x54798f[_0x814f('0x2a')](_0x5d7582)[_0x814f('0x2b')]();};}function respondWithResult(_0x425890,_0xd4a47c){_0xd4a47c=_0xd4a47c||0xc8;return function(_0x3cfd60){if(_0x3cfd60){return _0x425890[_0x814f('0x2a')](_0xd4a47c)[_0x814f('0x2c')](_0x3cfd60);}};}function respondWithFilteredResult(_0x555aa0,_0x4cb3d9){return function(_0x583ad8){if(_0x583ad8){var _0x1e3bc6=typeof _0x4cb3d9[_0x814f('0x2d')]==='undefined'&&typeof _0x4cb3d9['limit']==='undefined';var _0x2c1110=_0x583ad8[_0x814f('0x2e')];var _0x3350ff=_0x1e3bc6?0x0:_0x4cb3d9[_0x814f('0x2d')];var _0x252c0d=_0x1e3bc6?_0x583ad8[_0x814f('0x2e')]:_0x4cb3d9['offset']+_0x4cb3d9[_0x814f('0x2f')];var _0x468ac2;if(_0x252c0d>=_0x2c1110){_0x252c0d=_0x2c1110;_0x468ac2=0xc8;}else{_0x468ac2=0xce;}_0x555aa0[_0x814f('0x2a')](_0x468ac2);return _0x555aa0[_0x814f('0x30')](_0x814f('0x31'),_0x3350ff+'-'+_0x252c0d+'/'+_0x2c1110)[_0x814f('0x2c')](_0x583ad8);}return null;};}function patchUpdates(_0x3971f0){return function(_0x5570cf){try{jsonpatch['apply'](_0x5570cf,_0x3971f0,!![]);}catch(_0x1159f1){return BPromise[_0x814f('0x32')](_0x1159f1);}return _0x5570cf[_0x814f('0x33')]();};}function saveUpdates(_0x233622,_0x1cc746){return function(_0x425923){if(_0x425923){return _0x425923[_0x814f('0x34')](_0x233622)[_0x814f('0x20')](function(_0x281110){return _0x281110;});}return null;};}function removeEntity(_0x4af210,_0x3e1f85){return function(_0x2ced4d){if(_0x2ced4d){return _0x2ced4d[_0x814f('0x35')]()['then'](function(){var _0x40d84e=_0x2ced4d['get']({'plain':!![]});var _0x23c574=_0x814f('0x36');return db[_0x814f('0x37')]['destroy']({'where':{'type':_0x23c574,'resourceId':_0x40d84e['id']}})['then'](function(){return _0x2ced4d;});})['then'](function(){_0x4af210[_0x814f('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x246b6a,_0x48e82e){return function(_0x5ed22c){if(!_0x5ed22c){_0x246b6a[_0x814f('0x29')](0x194);}return _0x5ed22c;};}function handleError(_0x9389ef,_0x6cd7aa){_0x6cd7aa=_0x6cd7aa||0x1f4;return function(_0x2067aa){logger[_0x814f('0x25')](_0x2067aa['stack']);if(_0x2067aa['name']){delete _0x2067aa[_0x814f('0x38')];}_0x9389ef['status'](_0x6cd7aa)[_0x814f('0x39')](_0x2067aa);};}exports[_0x814f('0x3a')]=function(_0x3c905e,_0x26aa08){var _0x35ba6d={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2f15b0={},_0x3aa4dc={'count':0x0,'rows':[]};var _0x330b11=_['map'](db['OpenchannelAccount'][_0x814f('0x3b')],function(_0x2b15d6){return{'name':_0x2b15d6[_0x814f('0x3c')],'type':_0x2b15d6[_0x814f('0x3d')][_0x814f('0x3e')]};});_0x2f15b0[_0x814f('0x3f')]=_['map'](_0x330b11,'name');_0x2f15b0[_0x814f('0x40')]=_[_0x814f('0x41')](_0x3c905e[_0x814f('0x40')]);_0x2f15b0[_0x814f('0x42')]=_[_0x814f('0x43')](_0x2f15b0[_0x814f('0x3f')],_0x2f15b0['query']);_0x35ba6d[_0x814f('0x44')]=_[_0x814f('0x43')](_0x2f15b0[_0x814f('0x3f')],qs[_0x814f('0x45')](_0x3c905e[_0x814f('0x40')][_0x814f('0x45')]));_0x35ba6d[_0x814f('0x44')]=_0x35ba6d[_0x814f('0x44')][_0x814f('0x46')]?_0x35ba6d[_0x814f('0x44')]:_0x2f15b0[_0x814f('0x3f')];if(!_0x3c905e[_0x814f('0x40')][_0x814f('0x47')](_0x814f('0x48'))){_0x35ba6d[_0x814f('0x2f')]=qs[_0x814f('0x2f')](_0x3c905e[_0x814f('0x40')][_0x814f('0x2f')]);_0x35ba6d[_0x814f('0x2d')]=qs[_0x814f('0x2d')](_0x3c905e[_0x814f('0x40')][_0x814f('0x2d')]);}_0x35ba6d[_0x814f('0x49')]=qs['sort'](_0x3c905e['query'][_0x814f('0x4a')]);_0x35ba6d[_0x814f('0x4b')]=qs[_0x814f('0x42')](_['pick'](_0x3c905e[_0x814f('0x40')],_0x2f15b0[_0x814f('0x42')]),_0x330b11);if(_0x3c905e['query'][_0x814f('0x4c')]){_0x35ba6d[_0x814f('0x4b')]=_[_0x814f('0x4d')](_0x35ba6d['where'],{'$or':_['map'](_0x330b11,function(_0x35522f){if(_0x35522f[_0x814f('0x3d')]!==_0x814f('0x4e')){var _0x164b76={};_0x164b76[_0x35522f[_0x814f('0x38')]]={'$like':'%'+_0x3c905e[_0x814f('0x40')][_0x814f('0x4c')]+'%'};return _0x164b76;}})});}_0x35ba6d=_[_0x814f('0x4d')]({},_0x35ba6d,_0x3c905e[_0x814f('0x4f')]);var _0x376d25={'where':_0x35ba6d[_0x814f('0x4b')]};return db[_0x814f('0x50')][_0x814f('0x2e')](_0x376d25)[_0x814f('0x20')](function(_0xc97768){_0x3aa4dc[_0x814f('0x2e')]=_0xc97768;if(_0x3c905e[_0x814f('0x40')][_0x814f('0x51')]){_0x35ba6d[_0x814f('0x52')]=[{'all':!![]}];}return db[_0x814f('0x50')][_0x814f('0x53')](_0x35ba6d);})[_0x814f('0x20')](function(_0x261f23){_0x3aa4dc['rows']=_0x261f23;return _0x3aa4dc;})['then'](respondWithFilteredResult(_0x26aa08,_0x35ba6d))[_0x814f('0x28')](handleError(_0x26aa08,null));};exports[_0x814f('0x54')]=function(_0x16818d,_0x25852a){var _0x5b8e00={'raw':![],'where':{'id':_0x16818d[_0x814f('0x55')]['id']},'include':[{'model':db[_0x814f('0x56')],'as':'mandatoryDispositionPause'}]},_0x4df88a={};_0x4df88a[_0x814f('0x3f')]=_[_0x814f('0x41')](db[_0x814f('0x50')][_0x814f('0x3b')]);_0x4df88a[_0x814f('0x40')]=_['keys'](_0x16818d[_0x814f('0x40')]);_0x4df88a[_0x814f('0x42')]=_[_0x814f('0x43')](_0x4df88a[_0x814f('0x3f')],_0x4df88a['query']);_0x5b8e00['attributes']=_['intersection'](_0x4df88a[_0x814f('0x3f')],qs['fields'](_0x16818d[_0x814f('0x40')][_0x814f('0x45')]));_0x5b8e00[_0x814f('0x44')]=_0x5b8e00['attributes'][_0x814f('0x46')]?_0x5b8e00[_0x814f('0x44')]:_0x4df88a[_0x814f('0x3f')];if(_0x16818d[_0x814f('0x40')]['includeAll']){_0x5b8e00[_0x814f('0x52')]=[{'all':!![]}];}_0x5b8e00=_['merge']({},_0x5b8e00,_0x16818d[_0x814f('0x4f')]);return db[_0x814f('0x50')][_0x814f('0x57')](_0x5b8e00)[_0x814f('0x20')](handleEntityNotFound(_0x25852a,null))[_0x814f('0x20')](respondWithResult(_0x25852a,null))[_0x814f('0x28')](handleError(_0x25852a,null));};exports[_0x814f('0x58')]=function(_0x3838a1,_0x1b33c4){return db[_0x814f('0x50')][_0x814f('0x58')](_0x3838a1['body'],{})['then'](function(_0x725c13){var _0x59843b=_0x3838a1['user'][_0x814f('0x59')]({'plain':!![]});if(!_0x59843b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59843b[_0x814f('0x5a')]===_0x814f('0x5b')){var _0x164b07=_0x725c13['get']({'plain':!![]});var _0x13b7ed=_0x814f('0x36');return db[_0x814f('0x5c')][_0x814f('0x57')]({'where':{'name':_0x13b7ed,'userProfileId':_0x59843b[_0x814f('0x5d')]},'raw':!![]})['then'](function(_0x10f36f){if(_0x10f36f&&_0x10f36f['autoAssociation']===0x0){return db[_0x814f('0x37')][_0x814f('0x58')]({'name':_0x164b07[_0x814f('0x38')],'resourceId':_0x164b07['id'],'type':_0x10f36f[_0x814f('0x38')],'sectionId':_0x10f36f['id']},{})[_0x814f('0x20')](function(){return _0x725c13;});}else{return _0x725c13;}})[_0x814f('0x28')](function(_0x23bed5){logger[_0x814f('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23bed5);throw _0x23bed5;});}return _0x725c13;})[_0x814f('0x20')](respondWithResult(_0x1b33c4,0xc9))[_0x814f('0x28')](handleError(_0x1b33c4,null));};exports[_0x814f('0x34')]=function(_0xa26ffb,_0x4c90da){if(_0xa26ffb[_0x814f('0x5e')]['id']){delete _0xa26ffb[_0x814f('0x5e')]['id'];}return db[_0x814f('0x50')][_0x814f('0x57')]({'where':{'id':_0xa26ffb['params']['id']},'include':[{'model':db[_0x814f('0x56')],'as':_0x814f('0x5f')}]})[_0x814f('0x20')](handleEntityNotFound(_0x4c90da,null))['then'](saveUpdates(_0xa26ffb[_0x814f('0x5e')],null))['then'](respondWithResult(_0x4c90da,null))[_0x814f('0x28')](handleError(_0x4c90da,null));};exports[_0x814f('0x35')]=function(_0x1ff0ef,_0x1cf7fd){return db[_0x814f('0x50')]['find']({'where':{'id':_0x1ff0ef[_0x814f('0x55')]['id']}})[_0x814f('0x20')](handleEntityNotFound(_0x1cf7fd,null))[_0x814f('0x20')](removeEntity(_0x1cf7fd,null))['catch'](handleError(_0x1cf7fd,null));};exports[_0x814f('0x60')]=function(_0x55a8ef,_0x236569){return db[_0x814f('0x50')][_0x814f('0x60')]()['then'](respondWithResult(_0x236569,null))['catch'](handleError(_0x236569,null));};exports[_0x814f('0x61')]=function(_0x492a2c,_0x5cdd84,_0x3eaa33){if(_0x492a2c[_0x814f('0x5e')]['id']){delete _0x492a2c[_0x814f('0x5e')]['id'];}return db[_0x814f('0x50')][_0x814f('0x57')]({'where':{'id':_0x492a2c[_0x814f('0x55')]['id']}})[_0x814f('0x20')](handleEntityNotFound(_0x5cdd84,null))[_0x814f('0x20')](function(_0x915a35){if(_0x915a35){_0x492a2c[_0x814f('0x5e')][_0x814f('0x62')]=_0x915a35['id'];return db[_0x814f('0x63')][_0x814f('0x58')](_0x492a2c[_0x814f('0x5e')]);}})[_0x814f('0x20')](respondWithResult(_0x5cdd84,null))['catch'](handleError(_0x5cdd84,null));};exports[_0x814f('0x64')]=function(_0x2d9719,_0x5c0806,_0x1d840e){var _0x489383={'raw':![],'where':{}};var _0x443cda={};var _0x49664c={'count':0x0,'rows':[]};return db[_0x814f('0x50')][_0x814f('0x65')]({'where':{'id':_0x2d9719[_0x814f('0x55')]['id']}})['then'](handleEntityNotFound(_0x5c0806,null))[_0x814f('0x20')](function(_0x404500){if(_0x404500){_0x443cda['model']=_['keys'](db[_0x814f('0x63')][_0x814f('0x3b')]);_0x443cda[_0x814f('0x40')]=_['keys'](_0x2d9719[_0x814f('0x40')]);_0x443cda[_0x814f('0x42')]=_['intersection'](_0x443cda[_0x814f('0x3f')],_0x443cda[_0x814f('0x40')]);_0x489383[_0x814f('0x44')]=_[_0x814f('0x43')](_0x443cda[_0x814f('0x3f')],qs[_0x814f('0x45')](_0x2d9719['query']['fields']));_0x489383[_0x814f('0x44')]=_0x489383[_0x814f('0x44')]['length']?_0x489383[_0x814f('0x44')]:_0x443cda[_0x814f('0x3f')];if(!_0x2d9719[_0x814f('0x40')][_0x814f('0x47')](_0x814f('0x48'))){_0x489383[_0x814f('0x2f')]=qs[_0x814f('0x2f')](_0x2d9719[_0x814f('0x40')]['limit']);_0x489383[_0x814f('0x2d')]=qs['offset'](_0x2d9719[_0x814f('0x40')]['offset']);}_0x489383[_0x814f('0x49')]=qs[_0x814f('0x4a')](_0x2d9719['query'][_0x814f('0x4a')]);_0x489383[_0x814f('0x4b')]=qs[_0x814f('0x42')](_[_0x814f('0x66')](_0x2d9719[_0x814f('0x40')],_0x443cda[_0x814f('0x42')]));_0x489383[_0x814f('0x4b')]['OpenchannelAccountId']=_0x404500['id'];if(_0x2d9719[_0x814f('0x40')][_0x814f('0x4c')]){_0x489383[_0x814f('0x4b')]=_[_0x814f('0x4d')](_0x489383[_0x814f('0x4b')],{'$or':_['map'](_0x489383[_0x814f('0x44')],function(_0x4ff4a1){var _0x34b019={};_0x34b019[_0x4ff4a1]={'$like':'%'+_0x2d9719[_0x814f('0x40')]['filter']+'%'};return _0x34b019;})});}_0x489383=_[_0x814f('0x4d')]({},_0x489383,_0x2d9719[_0x814f('0x4f')]);return db['Disposition'][_0x814f('0x2e')]({'where':_0x489383[_0x814f('0x4b')]})[_0x814f('0x20')](function(_0x351318){_0x49664c[_0x814f('0x2e')]=_0x351318;if(_0x2d9719[_0x814f('0x40')][_0x814f('0x51')]){_0x489383['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x489383);})['then'](function(_0x1faf4e){_0x49664c[_0x814f('0x67')]=_0x1faf4e;return _0x49664c;});}})[_0x814f('0x20')](respondWithFilteredResult(_0x5c0806,_0x489383))['catch'](handleError(_0x5c0806,null));};exports[_0x814f('0x68')]=function(_0x284aff,_0x1575b2,_0x47be4e){return db[_0x814f('0x50')][_0x814f('0x57')]({'where':{'id':_0x284aff[_0x814f('0x55')]['id']}})[_0x814f('0x20')](handleEntityNotFound(_0x1575b2,null))[_0x814f('0x20')](function(_0x6b49b0){if(_0x6b49b0){return _0x6b49b0[_0x814f('0x68')](_0x284aff[_0x814f('0x40')]['ids']);}})[_0x814f('0x20')](respondWithStatusCode(_0x1575b2,null))[_0x814f('0x28')](handleError(_0x1575b2,null));};exports[_0x814f('0x69')]=function(_0x4f90c3,_0x3dab20,_0x1bb9c2){if(_0x4f90c3[_0x814f('0x5e')]['id']){delete _0x4f90c3[_0x814f('0x5e')]['id'];}return db['OpenchannelAccount'][_0x814f('0x57')]({'where':{'id':_0x4f90c3[_0x814f('0x55')]['id']}})['then'](handleEntityNotFound(_0x3dab20,null))[_0x814f('0x20')](function(_0x15a848){if(_0x15a848){_0x4f90c3[_0x814f('0x5e')]['OpenchannelAccountId']=_0x15a848['id'];return db[_0x814f('0x6a')][_0x814f('0x58')](_0x4f90c3['body']);}})[_0x814f('0x20')](respondWithResult(_0x3dab20,null))[_0x814f('0x28')](handleError(_0x3dab20,null));};exports[_0x814f('0x6b')]=function(_0xcc5cf0,_0x4eadfc,_0x507d00){var _0x224047={'raw':![],'where':{}};var _0x4f4299={};var _0x105012={'count':0x0,'rows':[]};return db[_0x814f('0x50')][_0x814f('0x65')]({'where':{'id':_0xcc5cf0[_0x814f('0x55')]['id']}})[_0x814f('0x20')](handleEntityNotFound(_0x4eadfc,null))['then'](function(_0x5b81e1){if(_0x5b81e1){_0x4f4299[_0x814f('0x3f')]=_['keys'](db[_0x814f('0x6a')][_0x814f('0x3b')]);_0x4f4299[_0x814f('0x40')]=_[_0x814f('0x41')](_0xcc5cf0[_0x814f('0x40')]);_0x4f4299[_0x814f('0x42')]=_['intersection'](_0x4f4299[_0x814f('0x3f')],_0x4f4299[_0x814f('0x40')]);_0x224047[_0x814f('0x44')]=_[_0x814f('0x43')](_0x4f4299[_0x814f('0x3f')],qs[_0x814f('0x45')](_0xcc5cf0['query'][_0x814f('0x45')]));_0x224047[_0x814f('0x44')]=_0x224047[_0x814f('0x44')][_0x814f('0x46')]?_0x224047['attributes']:_0x4f4299[_0x814f('0x3f')];if(!_0xcc5cf0[_0x814f('0x40')][_0x814f('0x47')](_0x814f('0x48'))){_0x224047['limit']=qs[_0x814f('0x2f')](_0xcc5cf0[_0x814f('0x40')]['limit']);_0x224047[_0x814f('0x2d')]=qs[_0x814f('0x2d')](_0xcc5cf0['query'][_0x814f('0x2d')]);}_0x224047[_0x814f('0x49')]=qs['sort'](_0xcc5cf0[_0x814f('0x40')][_0x814f('0x4a')]);_0x224047[_0x814f('0x4b')]=qs[_0x814f('0x42')](_[_0x814f('0x66')](_0xcc5cf0[_0x814f('0x40')],_0x4f4299['filters']));_0x224047[_0x814f('0x4b')]['OpenchannelAccountId']=_0x5b81e1['id'];if(_0xcc5cf0[_0x814f('0x40')][_0x814f('0x4c')]){_0x224047[_0x814f('0x4b')]=_[_0x814f('0x4d')](_0x224047[_0x814f('0x4b')],{'$or':_['map'](_0x224047[_0x814f('0x44')],function(_0x5c4eac){var _0x143c36={};_0x143c36[_0x5c4eac]={'$like':'%'+_0xcc5cf0[_0x814f('0x40')][_0x814f('0x4c')]+'%'};return _0x143c36;})});}_0x224047=_['merge']({},_0x224047,_0xcc5cf0[_0x814f('0x4f')]);return db[_0x814f('0x6a')][_0x814f('0x2e')]({'where':_0x224047[_0x814f('0x4b')]})[_0x814f('0x20')](function(_0xff26ff){_0x105012[_0x814f('0x2e')]=_0xff26ff;if(_0xcc5cf0[_0x814f('0x40')]['includeAll']){_0x224047['include']=[{'all':!![]}];}return db[_0x814f('0x6a')][_0x814f('0x53')](_0x224047);})[_0x814f('0x20')](function(_0x2c9c49){_0x105012['rows']=_0x2c9c49;return _0x105012;});}})[_0x814f('0x20')](respondWithFilteredResult(_0x4eadfc,_0x224047))[_0x814f('0x28')](handleError(_0x4eadfc,null));};exports['removeAnswers']=function(_0x5a1c2b,_0x5a6350,_0x5693ab){return db[_0x814f('0x50')][_0x814f('0x57')]({'where':{'id':_0x5a1c2b['params']['id']}})['then'](handleEntityNotFound(_0x5a6350,null))['then'](function(_0x8619f7){if(_0x8619f7){return _0x8619f7[_0x814f('0x6c')](_0x5a1c2b['query'][_0x814f('0x6d')]);}})[_0x814f('0x20')](respondWithStatusCode(_0x5a6350,null))['catch'](handleError(_0x5a6350,null));};exports['notify']=function(_0x3b6d65,_0x2c0864,_0x3168e6){var _0xa48ade={'body':_0x3b6d65[_0x814f('0x5e')],'channel':'openchannel'};var _0x38bd8c=[];var _0x5aae5f=[];var _0x5da00a={};var _0x496468=![];return db[_0x814f('0x6e')][_0x814f('0x60')]()[_0x814f('0x20')](function(_0x36a780){if(!_0x36a780){throw new db[(_0x814f('0x6f'))]['ValidationError'](_0x814f('0x70'));}_0x38bd8c=_[_0x814f('0x71')](_[_0x814f('0x41')](_0x36a780),[_0x814f('0x72'),_0x814f('0x73')]);_0x5aae5f=_[_0x814f('0x71')](_['keys'](_0x36a780),[_0x814f('0x72'),_0x814f('0x73'),'CompanyId',_0x814f('0x74')]);if(_0x3b6d65[_0x814f('0x5e')]['id']){delete _0x3b6d65[_0x814f('0x5e')]['id'];}if(_['isNil'](_0x3b6d65[_0x814f('0x5e')]['from'])){throw new db[(_0x814f('0x6f'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x814f('0x75')](_0x3b6d65[_0x814f('0x5e')]['body'])||_0x3b6d65['body'][_0x814f('0x5e')]===''){throw new db[(_0x814f('0x6f'))][(_0x814f('0x76'))](_0x814f('0x77'));}if(_['isNil'](_0x3b6d65[_0x814f('0x5e')][_0x814f('0x78')])){throw new db['Sequelize'][(_0x814f('0x76'))](_0x814f('0x79')+_0x5aae5f);}if(!_[_0x814f('0x7a')](_0x5aae5f,_0x3b6d65[_0x814f('0x5e')]['mapKey'])){throw new db[(_0x814f('0x6f'))][(_0x814f('0x76'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5aae5f);}_0x5da00a[_0x3b6d65[_0x814f('0x5e')][_0x814f('0x78')]]=_0x3b6d65[_0x814f('0x5e')]['from'];})['then'](function(){return db[_0x814f('0x50')][_0x814f('0x57')]({'where':{'id':_0x3b6d65[_0x814f('0x55')]['id']},'include':[{'model':db[_0x814f('0x7b')],'as':_0x814f('0x7c'),'include':[{'model':db['CmContact'],'as':_0x814f('0x7d'),'where':_0x5da00a,'limit':0x1,'order':[['updatedAt',_0x814f('0x7e')]]}]},{'model':db[_0x814f('0x7f')],'as':'Applications'}]});})[_0x814f('0x20')](handleEntityNotFound(_0x2c0864,null))['then'](function(_0x3243ba){if(_0x3243ba&&_0x3243ba[_0x814f('0x7c')]){_0xa48ade[_0x814f('0x80')]=_0x3243ba;_0xa48ade[_0x814f('0x81')]=_0x3243ba[_0x814f('0x82')];_0xa48ade[_0x814f('0x83')]=_0x3243ba[_0x814f('0x7c')];_0xa48ade[_0x814f('0x81')]=_[_0x814f('0x84')](_0xa48ade['applications'],[_0x814f('0x85')],['asc']);if(_0xa48ade[_0x814f('0x80')][_0x814f('0x82')]){delete _0xa48ade['account'][_0x814f('0x82')];}if(_0xa48ade['account'][_0x814f('0x7c')]&&_0xa48ade[_0x814f('0x80')][_0x814f('0x7c')]['Contacts'][_0x814f('0x46')]){return _0xa48ade[_0x814f('0x80')]['List']['Contacts'][0x0];}var _0x34939f=_['defaults'](_0x3b6d65[_0x814f('0x5e')],{'firstName':_0x3b6d65[_0x814f('0x5e')]['from'],'ListId':_0x3243ba[_0x814f('0x74')]});_0x34939f[_0x3b6d65[_0x814f('0x5e')]['mapKey']]=_0x3b6d65[_0x814f('0x5e')][_0x814f('0x86')];return db[_0x814f('0x6e')][_0x814f('0x58')](_0x34939f,{'fields':_0x38bd8c,'raw':!![]});}})[_0x814f('0x20')](handleEntityNotFound(_0x2c0864,null))[_0x814f('0x20')](function(_0x4d0ff5){_0xa48ade[_0x814f('0x87')]=_0x4d0ff5;if(_0x4d0ff5){var _0xc745f4={'ContactId':_0x4d0ff5['id'],'OpenchannelAccountId':_0x3b6d65['params']['id'],'from':(_0x4d0ff5['firstName']||'')+'\x20'+(_0x4d0ff5[_0x814f('0x88')]||'')};var _0x12e04d={'OpenchannelAccountId':_0x3b6d65[_0x814f('0x55')]['id'],'closed':![]};if(_0x3b6d65[_0x814f('0x5e')][_0x814f('0x89')]){_0x12e04d['threadId']=_0x3b6d65[_0x814f('0x5e')][_0x814f('0x89')];return db[_0x814f('0x8a')][_0x814f('0x57')]({'where':_0x12e04d})[_0x814f('0x20')](function(_0x163a5b){if(_0x163a5b){return[_0x163a5b,![]];}_0xc745f4[_0x814f('0x89')]=_0x3b6d65[_0x814f('0x5e')][_0x814f('0x89')];_0xc745f4[_0x814f('0x8b')]=_0x3b6d65[_0x814f('0x5e')]['externalUrl'];return db[_0x814f('0x8a')][_0x814f('0x58')](_0xc745f4)[_0x814f('0x20')](function(_0x365228){return[_0x365228,!![]];});});}else{_0x12e04d[_0x814f('0x89')]=null;}_0x12e04d[_0x814f('0x8c')]=_0x4d0ff5['id'];return db['OpenchannelInteraction']['find']({'where':_0x12e04d})['then'](function(_0x1c2cab){if(_0x1c2cab){return[_0x1c2cab,![]];}return db['OpenchannelInteraction'][_0x814f('0x58')](_0xc745f4)[_0x814f('0x20')](function(_0x4ba3e2){return[_0x4ba3e2,!![]];});});}})['spread'](function(_0x52d640,_0x392327){if(_0x52d640){_0x496468=_0x392327;if(!_0x392327){var _0x1a1304={'from':(_0xa48ade[_0x814f('0x87')][_0x814f('0x8d')]||'')+'\x20'+(_0xa48ade[_0x814f('0x87')][_0x814f('0x88')]||'')};if(_0x3b6d65[_0x814f('0x5e')][_0x814f('0x89')]&&_0x3b6d65[_0x814f('0x5e')][_0x814f('0x8e')]&&_0x3b6d65[_0x814f('0x5e')][_0x814f('0x89')]!=_0x3b6d65[_0x814f('0x5e')][_0x814f('0x8e')]){_0x1a1304['threadId']=_0x3b6d65[_0x814f('0x5e')]['messageId'];}return _0x52d640[_0x814f('0x34')](_0x1a1304);}else{return _0x52d640;}}})[_0x814f('0x20')](function(_0x154cd4){_0xa48ade['interaction']=_0x154cd4[_0x814f('0x59')]({'plain':!![]});_0xa48ade['interaction'][_0x814f('0x8f')]=_0x496468;if(_0xa48ade[_0x814f('0x90')][_0x814f('0x8f')]){if(_0xa48ade[_0x814f('0x80')][_0x814f('0x91')]){_0xa48ade[_0x814f('0x81')][_0x814f('0x92')]({'id':0x0,'priority':_0xa48ade['applications']['length']+0x1,'app':_0x814f('0x93'),'appdata':'unmanaged','interval':_0x814f('0x94')});}}return db[_0x814f('0x95')][_0x814f('0x58')]({'body':_0x3b6d65[_0x814f('0x5e')][_0x814f('0x5e')],'OpenchannelAccountId':_0x3b6d65[_0x814f('0x55')]['id'],'OpenchannelInteractionId':_0x154cd4['id'],'direction':'in','ContactId':_0xa48ade[_0x814f('0x87')]['id'],'AttachmentId':_0x3b6d65[_0x814f('0x5e')][_0x814f('0x96')]});})[_0x814f('0x20')](function(_0x2fc1cb){_0xa48ade[_0x814f('0x26')]=_0x2fc1cb;if(_0xa48ade[_0x814f('0x90')][_0x814f('0x97')]){return db[_0x814f('0x98')][_0x814f('0x57')]({'attributes':['id','name'],'where':{'id':_0xa48ade['interaction'][_0x814f('0x97')]}})[_0x814f('0x20')](function(_0x3c5945){if(_0x3c5945){_0xa48ade[_0x814f('0x81')]['unshift']({'id':0x0,'priority':0x0,'app':_0x814f('0x99'),'appdata':_0x3c5945['name']+','+(_0xa48ade[_0x814f('0x80')][_0x814f('0x9a')]||0xa),'interval':_0x814f('0x94')});_0xa48ade[_0x814f('0x9b')]=![];}return respondWithRpcPromise('Start',_0x814f('0x9c'),_0xa48ade);});}return respondWithRpcPromise(_0x814f('0x9d'),_0x814f('0x9c'),_0xa48ade);})[_0x814f('0x20')](function(_0x514462){respondWithRpcPromise(_0x814f('0x9e'),_0x814f('0x9e'),{'event':_0x814f('0x9f'),'message':_0x514462},client9002);return _0x514462;})['then'](respondWithResult(_0x2c0864,null))[_0x814f('0x28')](handleError(_0x2c0864,null));};exports[_0x814f('0xa0')]=function(_0x1fab06,_0xb7d53d){var _0x53bd21=_0x1fab06[_0x814f('0x55')]['id'];var _0x301429=_0x1fab06[_0x814f('0x5e')];var _0x180537=0xc8;var _0xc9b500=null;return db['sequelize'][_0x814f('0xa1')]({'isolationLevel':db[_0x814f('0xa2')][_0x814f('0xa3')][_0x814f('0xa4')][_0x814f('0xa5')]},function(_0x1ed938){return db[_0x814f('0x50')][_0x814f('0x65')]({'where':{'id':_0x53bd21},'transaction':_0x1ed938})[_0x814f('0x20')](function(_0x254577){if(_0x254577){return db[_0x814f('0x7f')][_0x814f('0x35')]({'where':{'OpenchannelAccountId':_0x53bd21},'transaction':_0x1ed938})[_0x814f('0x20')](function(){var _0x261406=_[_0x814f('0xa6')](_0x301429,function(_0x477d35){_0x477d35[_0x814f('0x62')]=_0x53bd21;return _0x477d35;});return db[_0x814f('0x7f')][_0x814f('0xa7')](_0x261406,{'transaction':_0x1ed938});});}else{_0x180537=0x194;_0xc9b500=[];}});})[_0x814f('0x20')](function(){if(_0x180537!==0x194){return db[_0x814f('0x7f')][_0x814f('0xa8')]({'where':{'OpenchannelAccountId':_0x53bd21},'order':_0x814f('0x85')})[_0x814f('0x20')](function(_0x3ddc39){_0xc9b500=_0x3ddc39;});}})['catch'](function(_0x3a99ec){_0x180537=0x1f4;logger['error'](_0x3a99ec['stack']);if(_0x3a99ec[_0x814f('0x38')]){delete _0x3a99ec[_0x814f('0x38')];}_0xc9b500=_0x3a99ec;})[_0x814f('0xa9')](function(){if(_0xc9b500===null){_0xb7d53d[_0x814f('0x29')](_0x180537);}else{if(_0x180537===0x1f4){_0xb7d53d[_0x814f('0x2a')](_0x180537)[_0x814f('0x39')](_0xc9b500);}else{_0xb7d53d[_0x814f('0x2a')](_0x180537)['json'](_0xc9b500);}}});};exports[_0x814f('0xaa')]=function(_0x2f2f2e,_0xcba123,_0x1d13fc){var _0x1d8739={};var _0x30ed4f={};var _0xa48c14;var _0x3197d1;return db[_0x814f('0x50')][_0x814f('0x65')]({'where':{'id':_0x2f2f2e[_0x814f('0x55')]['id']}})[_0x814f('0x20')](handleEntityNotFound(_0xcba123,null))[_0x814f('0x20')](function(_0x28d92f){if(_0x28d92f){_0xa48c14=_0x28d92f;_0x30ed4f[_0x814f('0x3f')]=_[_0x814f('0x41')](db['OpenchannelApplication'][_0x814f('0x3b')]);_0x30ed4f[_0x814f('0x40')]=_['keys'](_0x2f2f2e[_0x814f('0x40')]);_0x30ed4f[_0x814f('0x42')]=_[_0x814f('0x43')](_0x30ed4f[_0x814f('0x3f')],_0x30ed4f['query']);_0x1d8739[_0x814f('0x44')]=_[_0x814f('0x43')](_0x30ed4f[_0x814f('0x3f')],qs['fields'](_0x2f2f2e[_0x814f('0x40')]['fields']));_0x1d8739['attributes']=_0x1d8739['attributes']['length']?_0x1d8739[_0x814f('0x44')]:_0x30ed4f[_0x814f('0x3f')];_0x1d8739[_0x814f('0x49')]=qs[_0x814f('0x4a')](_0x2f2f2e[_0x814f('0x40')][_0x814f('0x4a')]);_0x1d8739[_0x814f('0x4b')]=qs[_0x814f('0x42')](_[_0x814f('0x66')](_0x2f2f2e['query'],_0x30ed4f[_0x814f('0x42')]));if(_0x2f2f2e[_0x814f('0x40')][_0x814f('0x4c')]){_0x1d8739['where']=_[_0x814f('0x4d')](_0x1d8739[_0x814f('0x4b')],{'$or':_[_0x814f('0xa6')](_0x1d8739[_0x814f('0x44')],function(_0x4f8150){var _0x710c19={};_0x710c19[_0x4f8150]={'$like':'%'+_0x2f2f2e[_0x814f('0x40')][_0x814f('0x4c')]+'%'};return _0x710c19;})});}_0x1d8739=_[_0x814f('0x4d')]({},_0x1d8739,_0x2f2f2e[_0x814f('0x4f')]);return _0xa48c14[_0x814f('0xaa')](_0x1d8739);}})[_0x814f('0x20')](function(_0x46fdc8){if(_0x46fdc8){_0x3197d1=_0x46fdc8['length'];if(!_0x2f2f2e[_0x814f('0x40')]['hasOwnProperty'](_0x814f('0x48'))){_0x1d8739[_0x814f('0x2f')]=qs['limit'](_0x2f2f2e[_0x814f('0x40')]['limit']);_0x1d8739[_0x814f('0x2d')]=qs[_0x814f('0x2d')](_0x2f2f2e[_0x814f('0x40')]['offset']);}return _0xa48c14[_0x814f('0xaa')](_0x1d8739);}})[_0x814f('0x20')](function(_0x84240c){if(_0x84240c){return _0x84240c?{'count':_0x3197d1,'rows':_0x84240c}:null;}})[_0x814f('0x20')](respondWithResult(_0xcba123,null))[_0x814f('0x28')](handleError(_0xcba123,null));};exports[_0x814f('0xab')]=function(_0x534da2,_0xd78650,_0x1108ac){var _0x3fc63e={'raw':![],'where':{}};var _0x53d21b={};var _0x4540e5={'count':0x0,'rows':[]};return db[_0x814f('0x50')][_0x814f('0x65')]({'where':{'id':_0x534da2[_0x814f('0x55')]['id']}})[_0x814f('0x20')](handleEntityNotFound(_0xd78650,null))[_0x814f('0x20')](function(_0x29e49f){if(_0x29e49f){_0x53d21b[_0x814f('0x3f')]=_['keys'](db['OpenchannelInteraction'][_0x814f('0x3b')]);_0x53d21b[_0x814f('0x40')]=_[_0x814f('0x41')](_0x534da2[_0x814f('0x40')]);_0x53d21b[_0x814f('0x42')]=_[_0x814f('0x43')](_0x53d21b['model'],_0x53d21b[_0x814f('0x40')]);_0x3fc63e['attributes']=_[_0x814f('0x43')](_0x53d21b['model'],qs[_0x814f('0x45')](_0x534da2[_0x814f('0x40')][_0x814f('0x45')]));_0x3fc63e['attributes']=_0x3fc63e[_0x814f('0x44')][_0x814f('0x46')]?_0x3fc63e[_0x814f('0x44')]:_0x53d21b['model'];if(!_0x534da2[_0x814f('0x40')][_0x814f('0x47')](_0x814f('0x48'))){_0x3fc63e[_0x814f('0x2f')]=qs[_0x814f('0x2f')](_0x534da2[_0x814f('0x40')]['limit']);_0x3fc63e[_0x814f('0x2d')]=qs[_0x814f('0x2d')](_0x534da2[_0x814f('0x40')][_0x814f('0x2d')]);}_0x3fc63e[_0x814f('0x49')]=qs[_0x814f('0x4a')](_0x534da2[_0x814f('0x40')][_0x814f('0x4a')]);_0x3fc63e[_0x814f('0x4b')]=qs[_0x814f('0x42')](_[_0x814f('0x66')](_0x534da2[_0x814f('0x40')],_0x53d21b[_0x814f('0x42')]));_0x3fc63e[_0x814f('0x4b')][_0x814f('0x62')]=_0x29e49f['id'];if(_0x534da2[_0x814f('0x40')][_0x814f('0x4c')]){_0x3fc63e[_0x814f('0x4b')]=_[_0x814f('0x4d')](_0x3fc63e[_0x814f('0x4b')],{'$or':_[_0x814f('0xa6')](_0x3fc63e[_0x814f('0x44')],function(_0x250302){var _0x11316f={};_0x11316f[_0x250302]={'$like':'%'+_0x534da2[_0x814f('0x40')][_0x814f('0x4c')]+'%'};return _0x11316f;})});}_0x3fc63e=_[_0x814f('0x4d')]({},_0x3fc63e,_0x534da2[_0x814f('0x4f')]);return db[_0x814f('0x8a')]['count']({'where':_0x3fc63e[_0x814f('0x4b')]})[_0x814f('0x20')](function(_0x47ed95){_0x4540e5['count']=_0x47ed95;if(_0x534da2['query'][_0x814f('0x51')]){_0x3fc63e[_0x814f('0x52')]=[{'model':db[_0x814f('0x6e')],'as':_0x814f('0xac'),'required':![]},{'model':db[_0x814f('0x98')],'as':_0x814f('0xad'),'attributes':[_0x814f('0x38'),_0x814f('0xae'),'internal'],'required':![]},{'model':db[_0x814f('0xaf')],'as':_0x814f('0xb0'),'attributes':['id','name',_0x814f('0xb1')],'where':_0x534da2[_0x814f('0x40')][_0x814f('0xb2')]?{'id':_0x534da2['query'][_0x814f('0xb2')]}:undefined,'required':_0x534da2[_0x814f('0x40')]['tag']?!![]:![]}];}return db[_0x814f('0x8a')][_0x814f('0x53')](_0x3fc63e);})[_0x814f('0x20')](function(_0x5dceef){_0x4540e5[_0x814f('0x67')]=_0x5dceef;return _0x4540e5;});}})[_0x814f('0x20')](respondWithFilteredResult(_0xd78650,_0x3fc63e))['catch'](handleError(_0xd78650,null));};exports[_0x814f('0xb3')]=function(_0x4b294d,_0x2b3cdd,_0x4e3416){return db[_0x814f('0x50')][_0x814f('0x57')]({'where':{'id':_0x4b294d['params']['id']}})[_0x814f('0x20')](handleEntityNotFound(_0x2b3cdd,null))[_0x814f('0x20')](function(_0x455365){if(_0x455365){return _0x455365['addAgents'](_0x4b294d['body']['ids'],_[_0x814f('0xb4')](_0x4b294d['body'],['ids','id'])||{})['spread'](function(_0x431d58){for(var _0x4ddefd=0x0;_0x4ddefd<_0x4b294d[_0x814f('0x5e')][_0x814f('0x6d')]['length'];_0x4ddefd+=0x1){socket[_0x814f('0xb5')](_0x814f('0xb6'),{'UserId':Number(_0x4b294d['body']['ids'][_0x4ddefd]),'OpenchannelAccountId':Number(_0x4b294d['params']['id'])});}return _0x431d58;});}})[_0x814f('0x20')](respondWithResult(_0x2b3cdd,null))[_0x814f('0x28')](handleError(_0x2b3cdd,null));};exports[_0x814f('0xb7')]=function(_0x1dd3f4,_0x1ad7cc,_0x15ba71){return db['OpenchannelAccount'][_0x814f('0x57')]({'where':{'id':_0x1dd3f4['params']['id']}})['then'](handleEntityNotFound(_0x1ad7cc,null))[_0x814f('0x20')](function(_0x387bdd){if(_0x387bdd){return _0x387bdd[_0x814f('0xb7')](_0x1dd3f4[_0x814f('0x40')][_0x814f('0x6d')])['then'](function(){if(_['isArray'](_0x1dd3f4[_0x814f('0x40')][_0x814f('0x6d')])){for(var _0x357766=0x0;_0x357766<_0x1dd3f4['query'][_0x814f('0x6d')]['length'];_0x357766+=0x1){socket[_0x814f('0xb5')](_0x814f('0xb8'),{'UserId':Number(_0x1dd3f4[_0x814f('0x40')]['ids'][_0x357766]),'OpenchannelAccountId':Number(_0x1dd3f4[_0x814f('0x55')]['id'])});}}else{socket[_0x814f('0xb5')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1dd3f4[_0x814f('0x40')][_0x814f('0x6d')]),'OpenchannelAccountId':Number(_0x1dd3f4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1ad7cc,null))[_0x814f('0x28')](handleError(_0x1ad7cc,null));};exports[_0x814f('0xb9')]=function(_0xfa5e03,_0x3e055f,_0x3957c7){var _0x18fdf7={};var _0x475824={};var _0x35e0a2;var _0x34051a;return db[_0x814f('0x50')][_0x814f('0x65')]({'where':{'id':_0xfa5e03['params']['id']}})[_0x814f('0x20')](handleEntityNotFound(_0x3e055f,null))[_0x814f('0x20')](function(_0x3e662a){if(_0x3e662a){_0x35e0a2=_0x3e662a;_0x475824['model']=_[_0x814f('0x41')](db['User'][_0x814f('0x3b')]);_0x475824['query']=_[_0x814f('0x41')](_0xfa5e03[_0x814f('0x40')]);_0x475824[_0x814f('0x42')]=_[_0x814f('0x43')](_0x475824['model'],_0x475824[_0x814f('0x40')]);_0x18fdf7[_0x814f('0x44')]=_[_0x814f('0x43')](_0x475824[_0x814f('0x3f')],qs[_0x814f('0x45')](_0xfa5e03[_0x814f('0x40')]['fields']));_0x18fdf7['attributes']=_0x18fdf7[_0x814f('0x44')][_0x814f('0x46')]?_0x18fdf7[_0x814f('0x44')]:_0x475824[_0x814f('0x3f')];_0x18fdf7[_0x814f('0x49')]=qs[_0x814f('0x4a')](_0xfa5e03['query'][_0x814f('0x4a')]);_0x18fdf7[_0x814f('0x4b')]=qs['filters'](_[_0x814f('0x66')](_0xfa5e03[_0x814f('0x40')],_0x475824[_0x814f('0x42')]));if(_0xfa5e03[_0x814f('0x40')][_0x814f('0x4c')]){_0x18fdf7[_0x814f('0x4b')]=_[_0x814f('0x4d')](_0x18fdf7[_0x814f('0x4b')],{'$or':_[_0x814f('0xa6')](_0x18fdf7[_0x814f('0x44')],function(_0x573314){var _0x36379f={};_0x36379f[_0x573314]={'$like':'%'+_0xfa5e03[_0x814f('0x40')][_0x814f('0x4c')]+'%'};return _0x36379f;})});}_0x18fdf7=_[_0x814f('0x4d')]({},_0x18fdf7,_0xfa5e03[_0x814f('0x4f')]);return _0x35e0a2[_0x814f('0xb9')](_0x18fdf7);}})[_0x814f('0x20')](function(_0x37f06e){if(_0x37f06e){_0x34051a=_0x37f06e[_0x814f('0x46')];if(!_0xfa5e03[_0x814f('0x40')][_0x814f('0x47')](_0x814f('0x48'))){_0x18fdf7[_0x814f('0x2f')]=qs[_0x814f('0x2f')](_0xfa5e03[_0x814f('0x40')][_0x814f('0x2f')]);_0x18fdf7[_0x814f('0x2d')]=qs[_0x814f('0x2d')](_0xfa5e03['query']['offset']);}return _0x35e0a2[_0x814f('0xb9')](_0x18fdf7);}})['then'](function(_0x595bae){if(_0x595bae){return _0x595bae?{'count':_0x34051a,'rows':_0x595bae}:null;}})[_0x814f('0x20')](respondWithResult(_0x3e055f,null))[_0x814f('0x28')](handleError(_0x3e055f,null));};exports[_0x814f('0x39')]=function(_0x214057,_0x29e20f,_0x12193b){var _0x3b7831,_0x3ad622,_0x481146;if(_[_0x814f('0x75')](_0x214057[_0x814f('0x5e')][_0x814f('0x5e')])||_0x214057[_0x814f('0x5e')][_0x814f('0x5e')]===''){throw new db[(_0x814f('0x6f'))][(_0x814f('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x214057[_0x814f('0x5e')]['to'])){}_0x3b7831=_0x214057[_0x814f('0x5e')]['to'];return db[_0x814f('0x50')]['findOne']({'where':{'id':_0x214057['params']['id']}})['then'](handleEntityNotFound(_0x29e20f,null))[_0x814f('0x20')](function(_0x20920b){if(_0x20920b){return db[_0x814f('0x50')][_0x814f('0x57')]({'where':{'id':_0x20920b['id']},'include':[{'model':db['CmList'],'as':_0x814f('0x7c'),'include':[{'model':db['CmContact'],'as':_0x814f('0x7d'),'where':{[_0x20920b[_0x814f('0x78')]]:_0x3b7831},'limit':0x1,'order':[[_0x814f('0x73'),_0x814f('0x7e')]]}]}]})['then'](handleEntityNotFound(_0x29e20f,null))[_0x814f('0x20')](function(_0x29ddbc){if(_0x29ddbc&&_0x29ddbc[_0x814f('0x7c')]){_0x3ad622=_0x29ddbc[_0x814f('0x59')]({'plain':!![]});if(_0x3ad622[_0x814f('0x7c')]&&_0x3ad622[_0x814f('0x7c')][_0x814f('0x7d')][_0x814f('0x46')]){return _0x3ad622[_0x814f('0x7c')][_0x814f('0x7d')][0x0];}return db[_0x814f('0x6e')][_0x814f('0x58')](_['defaults'](_0x214057[_0x814f('0x5e')],{'firstName':_0x3b7831,[_0x29ddbc[_0x814f('0x78')]]:_0x3b7831,'phone':_0x3b7831,'ListId':_0x3ad622[_0x814f('0x74')]}));}})[_0x814f('0x20')](handleEntityNotFound(_0x29e20f,null))['then'](function(_0x26b725){if(_0x26b725){_0x481146=_0x26b725;return db['OpenchannelInteraction'][_0x814f('0x57')]({'where':{'ContactId':_0x481146['id'],'closed':![],'OpenchannelAccountId':_0x3ad622['id']}})[_0x814f('0x20')](function(_0x1bba70){if(_0x1bba70){return[_0x1bba70,![]];}return db[_0x814f('0x8a')][_0x814f('0x58')]({'UserId':_0x214057['user']['id'],'ContactId':_0x481146['id'],'OpenchannelAccountId':_0x3ad622['id'],'lastMsgDirection':'out','firstMsgDirection':_0x814f('0xba'),'Messages':[_[_0x814f('0x4d')](_0x214057['body'],{'read':![],'body':_0x214057['body'][_0x814f('0x5e')],'OpenchannelAccountId':_0x3ad622['id'],'UserId':_0x214057[_0x814f('0x5b')]['id'],'ContactId':_0x481146['id']})]},{'include':[{'model':db[_0x814f('0x95')],'as':_0x814f('0xbb')}]})['then'](function(_0x401218){return[_0x401218,!![]];});});}})[_0x814f('0xbc')](function(_0x44329c,_0x18e37c){if(_0x18e37c){return _0x44329c;}return db[_0x814f('0x95')]['create'](_[_0x814f('0x4d')](_0x214057['body'],{'read':![],'body':_0x214057[_0x814f('0x5e')]['body'],'OpenchannelAccountId':_0x3ad622['id'],'OpenchannelInteractionId':_0x44329c['id'],'UserId':_0x214057[_0x814f('0x5b')]['id'],'ContactId':_0x481146['id']}))[_0x814f('0x20')](function(_0x5561d1){_0x44329c['dataValues'][_0x814f('0xbb')]=[];_0x44329c[_0x814f('0xbd')]['Messages']['push'](_0x5561d1['dataValues']);return _0x44329c;});});}})[_0x814f('0x20')](respondWithResult(_0x29e20f,null))[_0x814f('0x28')](handleError(_0x29e20f,null));}; \ No newline at end of file +var _0xa6b3=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','find','create','body','user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','OpenchannelAccountId','getDispositions','Disposition','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','includes','CmList','List','Contacts','DESC','OpenchannelApplication','account','Applications','list','orderBy','applications','priority','asc','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','internal','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','request','then','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','destroy','get','OpenchannelAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x198382,_0x3ecab6){var _0x507be2=function(_0x2c6db5){while(--_0x2c6db5){_0x198382['push'](_0x198382['shift']());}};_0x507be2(++_0x3ecab6);}(_0xa6b3,0x72));var _0x3a6b=function(_0x13a9c5,_0x2619fd){_0x13a9c5=_0x13a9c5-0x0;var _0xfd2536=_0xa6b3[_0x13a9c5];return _0xfd2536;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a6b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a6b('0x1'));var rp=require('request-promise');var moment=require(_0x3a6b('0x2'));var BPromise=require(_0x3a6b('0x3'));var Mustache=require('mustache');var util=require(_0x3a6b('0x4'));var path=require(_0x3a6b('0x5'));var sox=require(_0x3a6b('0x6'));var csv=require(_0x3a6b('0x7'));var ejs=require(_0x3a6b('0x8'));var fs=require('fs');var fs_extra=require(_0x3a6b('0x9'));var _=require('lodash');var squel=require(_0x3a6b('0xa'));var crypto=require(_0x3a6b('0xb'));var jsforce=require(_0x3a6b('0xc'));var deskjs=require(_0x3a6b('0xd'));var toCsv=require(_0x3a6b('0x7'));var querystring=require('querystring');var Papa=require(_0x3a6b('0xe'));var Redis=require(_0x3a6b('0xf'));var authService=require(_0x3a6b('0x10'));var qs=require(_0x3a6b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a6b('0x12'));var logger=require('../../config/logger')(_0x3a6b('0x13'));var utils=require(_0x3a6b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3a6b('0x15'));var db=require(_0x3a6b('0x16'))['db'];config[_0x3a6b('0x17')]=_[_0x3a6b('0x18')](config[_0x3a6b('0x17')],{'host':_0x3a6b('0x19'),'port':0x18eb});var socket=require(_0x3a6b('0x1a'))(new Redis(config[_0x3a6b('0x17')]));require(_0x3a6b('0x1b'))[_0x3a6b('0x1c')](socket);var jayson=require(_0x3a6b('0x1d'));var client=jayson['client'][_0x3a6b('0x1e')]({'port':0x232c});var client9002=jayson[_0x3a6b('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x243014,_0x20af8a,_0x76583b,_0x5e5865){return new BPromise(function(_0x264acd,_0x1311ca){var _0x58808c=_0x5e5865||client;return _0x58808c[_0x3a6b('0x20')](_0x243014,_0x76583b)[_0x3a6b('0x21')](function(_0xf0f504){logger[_0x3a6b('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x20af8a,_0x3a6b('0x23'));logger['debug'](_0x3a6b('0x24'),_0x20af8a,_0x3a6b('0x23'),JSON[_0x3a6b('0x25')](_0xf0f504));if(_0xf0f504[_0x3a6b('0x26')]){if(_0xf0f504[_0x3a6b('0x26')]['code']===0x1f4){logger[_0x3a6b('0x26')](_0x3a6b('0x27'),_0x20af8a,_0xf0f504[_0x3a6b('0x26')][_0x3a6b('0x28')]);return _0x1311ca(_0xf0f504['error'][_0x3a6b('0x28')]);}logger[_0x3a6b('0x26')](_0x3a6b('0x27'),_0x20af8a,_0xf0f504['error'][_0x3a6b('0x28')]);return _0x264acd(_0xf0f504['error'][_0x3a6b('0x28')]);}else{logger[_0x3a6b('0x22')](_0x3a6b('0x27'),_0x20af8a,_0x3a6b('0x23'));_0x264acd(_0xf0f504['result']['message']);}})[_0x3a6b('0x29')](function(_0x175165){logger['error'](_0x3a6b('0x27'),_0x20af8a,_0x175165);_0x1311ca(_0x175165);});});}function respondWithStatusCode(_0x42bed5,_0x229cd1){_0x229cd1=_0x229cd1||0xcc;return function(_0x49f0a8){if(_0x49f0a8){return _0x42bed5[_0x3a6b('0x2a')](_0x229cd1);}return _0x42bed5[_0x3a6b('0x2b')](_0x229cd1)[_0x3a6b('0x2c')]();};}function respondWithResult(_0x54757e,_0x49f5da){_0x49f5da=_0x49f5da||0xc8;return function(_0x2a5010){if(_0x2a5010){return _0x54757e['status'](_0x49f5da)[_0x3a6b('0x2d')](_0x2a5010);}};}function respondWithFilteredResult(_0x38a937,_0x56203b){return function(_0x19537d){if(_0x19537d){var _0x59cc75=typeof _0x56203b[_0x3a6b('0x2e')]==='undefined'&&typeof _0x56203b['limit']===_0x3a6b('0x2f');var _0x44e752=_0x19537d[_0x3a6b('0x30')];var _0x282719=_0x59cc75?0x0:_0x56203b[_0x3a6b('0x2e')];var _0x10aa02=_0x59cc75?_0x19537d[_0x3a6b('0x30')]:_0x56203b[_0x3a6b('0x2e')]+_0x56203b[_0x3a6b('0x31')];var _0x27b485;if(_0x10aa02>=_0x44e752){_0x10aa02=_0x44e752;_0x27b485=0xc8;}else{_0x27b485=0xce;}_0x38a937[_0x3a6b('0x2b')](_0x27b485);return _0x38a937['set'](_0x3a6b('0x32'),_0x282719+'-'+_0x10aa02+'/'+_0x44e752)[_0x3a6b('0x2d')](_0x19537d);}return null;};}function patchUpdates(_0x52fb62){return function(_0xa6b0c0){try{jsonpatch[_0x3a6b('0x33')](_0xa6b0c0,_0x52fb62,!![]);}catch(_0x285614){return BPromise[_0x3a6b('0x34')](_0x285614);}return _0xa6b0c0['save']();};}function saveUpdates(_0x178806,_0x4bc2d6){return function(_0x18e408){if(_0x18e408){return _0x18e408['update'](_0x178806)[_0x3a6b('0x21')](function(_0x478d24){return _0x478d24;});}return null;};}function removeEntity(_0x11365e,_0x1e6d71){return function(_0x5c8015){if(_0x5c8015){return _0x5c8015[_0x3a6b('0x35')]()[_0x3a6b('0x21')](function(){var _0x440316=_0x5c8015[_0x3a6b('0x36')]({'plain':!![]});var _0x2dddd1=_0x3a6b('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x2dddd1,'resourceId':_0x440316['id']}})[_0x3a6b('0x21')](function(){return _0x5c8015;});})['then'](function(){_0x11365e[_0x3a6b('0x2b')](0xcc)[_0x3a6b('0x2c')]();});}};}function handleEntityNotFound(_0xef72e2,_0x129b5e){return function(_0x174849){if(!_0x174849){_0xef72e2[_0x3a6b('0x2a')](0x194);}return _0x174849;};}function handleError(_0x3a0d55,_0x944759){_0x944759=_0x944759||0x1f4;return function(_0x24d149){logger[_0x3a6b('0x26')](_0x24d149[_0x3a6b('0x38')]);if(_0x24d149[_0x3a6b('0x39')]){delete _0x24d149[_0x3a6b('0x39')];}_0x3a0d55[_0x3a6b('0x2b')](_0x944759)[_0x3a6b('0x3a')](_0x24d149);};}exports[_0x3a6b('0x3b')]=function(_0x3f5ac5,_0x36ed00){var _0x241884={'include':[{'model':db[_0x3a6b('0x3c')],'as':_0x3a6b('0x3d')}]},_0x209097={},_0x20aa58={'count':0x0,'rows':[]};var _0x3f792c=_[_0x3a6b('0x3e')](db[_0x3a6b('0x3f')]['rawAttributes'],function(_0x686922){return{'name':_0x686922[_0x3a6b('0x40')],'type':_0x686922[_0x3a6b('0x41')][_0x3a6b('0x42')]};});_0x209097['model']=_[_0x3a6b('0x3e')](_0x3f792c,_0x3a6b('0x39'));_0x209097[_0x3a6b('0x43')]=_[_0x3a6b('0x44')](_0x3f5ac5[_0x3a6b('0x43')]);_0x209097[_0x3a6b('0x45')]=_['intersection'](_0x209097[_0x3a6b('0x46')],_0x209097['query']);_0x241884[_0x3a6b('0x47')]=_[_0x3a6b('0x48')](_0x209097['model'],qs[_0x3a6b('0x49')](_0x3f5ac5[_0x3a6b('0x43')][_0x3a6b('0x49')]));_0x241884['attributes']=_0x241884[_0x3a6b('0x47')][_0x3a6b('0x4a')]?_0x241884[_0x3a6b('0x47')]:_0x209097[_0x3a6b('0x46')];if(!_0x3f5ac5[_0x3a6b('0x43')][_0x3a6b('0x4b')](_0x3a6b('0x4c'))){_0x241884[_0x3a6b('0x31')]=qs[_0x3a6b('0x31')](_0x3f5ac5[_0x3a6b('0x43')][_0x3a6b('0x31')]);_0x241884[_0x3a6b('0x2e')]=qs[_0x3a6b('0x2e')](_0x3f5ac5[_0x3a6b('0x43')]['offset']);}_0x241884[_0x3a6b('0x4d')]=qs[_0x3a6b('0x4e')](_0x3f5ac5[_0x3a6b('0x43')]['sort']);_0x241884[_0x3a6b('0x4f')]=qs['filters'](_[_0x3a6b('0x50')](_0x3f5ac5['query'],_0x209097[_0x3a6b('0x45')]),_0x3f792c);if(_0x3f5ac5[_0x3a6b('0x43')][_0x3a6b('0x51')]){_0x241884[_0x3a6b('0x4f')]=_[_0x3a6b('0x52')](_0x241884[_0x3a6b('0x4f')],{'$or':_[_0x3a6b('0x3e')](_0x3f792c,function(_0x85839b){if(_0x85839b['type']!==_0x3a6b('0x53')){var _0x27e449={};_0x27e449[_0x85839b[_0x3a6b('0x39')]]={'$like':'%'+_0x3f5ac5['query'][_0x3a6b('0x51')]+'%'};return _0x27e449;}})});}_0x241884=_[_0x3a6b('0x52')]({},_0x241884,_0x3f5ac5[_0x3a6b('0x54')]);var _0x15925a={'where':_0x241884[_0x3a6b('0x4f')]};return db['OpenchannelAccount'][_0x3a6b('0x30')](_0x15925a)[_0x3a6b('0x21')](function(_0x352d1a){_0x20aa58[_0x3a6b('0x30')]=_0x352d1a;if(_0x3f5ac5[_0x3a6b('0x43')][_0x3a6b('0x55')]){_0x241884['include']=[{'all':!![]}];}return db[_0x3a6b('0x3f')][_0x3a6b('0x56')](_0x241884);})[_0x3a6b('0x21')](function(_0xbfc5fa){_0x20aa58[_0x3a6b('0x57')]=_0xbfc5fa;return _0x20aa58;})['then'](respondWithFilteredResult(_0x36ed00,_0x241884))[_0x3a6b('0x29')](handleError(_0x36ed00,null));};exports[_0x3a6b('0x58')]=function(_0x52b799,_0x1c57d5){var _0x2530a0={'raw':![],'where':{'id':_0x52b799[_0x3a6b('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x3a6b('0x3d')}]},_0x2b4ac6={};_0x2b4ac6[_0x3a6b('0x46')]=_[_0x3a6b('0x44')](db[_0x3a6b('0x3f')][_0x3a6b('0x5a')]);_0x2b4ac6[_0x3a6b('0x43')]=_[_0x3a6b('0x44')](_0x52b799['query']);_0x2b4ac6[_0x3a6b('0x45')]=_[_0x3a6b('0x48')](_0x2b4ac6[_0x3a6b('0x46')],_0x2b4ac6[_0x3a6b('0x43')]);_0x2530a0[_0x3a6b('0x47')]=_[_0x3a6b('0x48')](_0x2b4ac6[_0x3a6b('0x46')],qs[_0x3a6b('0x49')](_0x52b799[_0x3a6b('0x43')][_0x3a6b('0x49')]));_0x2530a0[_0x3a6b('0x47')]=_0x2530a0[_0x3a6b('0x47')][_0x3a6b('0x4a')]?_0x2530a0['attributes']:_0x2b4ac6[_0x3a6b('0x46')];if(_0x52b799[_0x3a6b('0x43')][_0x3a6b('0x55')]){_0x2530a0['include']=[{'all':!![]}];}_0x2530a0=_[_0x3a6b('0x52')]({},_0x2530a0,_0x52b799['options']);return db['OpenchannelAccount'][_0x3a6b('0x5b')](_0x2530a0)[_0x3a6b('0x21')](handleEntityNotFound(_0x1c57d5,null))['then'](respondWithResult(_0x1c57d5,null))[_0x3a6b('0x29')](handleError(_0x1c57d5,null));};exports[_0x3a6b('0x5c')]=function(_0x5207f7,_0x5bb2ce){return db[_0x3a6b('0x3f')]['create'](_0x5207f7[_0x3a6b('0x5d')],{})[_0x3a6b('0x21')](function(_0x3ad28f){var _0x56f37f=_0x5207f7[_0x3a6b('0x5e')][_0x3a6b('0x36')]({'plain':!![]});if(!_0x56f37f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56f37f[_0x3a6b('0x5f')]===_0x3a6b('0x5e')){var _0x2af3bc=_0x3ad28f['get']({'plain':!![]});var _0x1ce3ad=_0x3a6b('0x37');return db['UserProfileSection'][_0x3a6b('0x5b')]({'where':{'name':_0x1ce3ad,'userProfileId':_0x56f37f['userProfileId']},'raw':!![]})['then'](function(_0x5cbbd0){if(_0x5cbbd0&&_0x5cbbd0[_0x3a6b('0x60')]===0x0){return db[_0x3a6b('0x61')][_0x3a6b('0x5c')]({'name':_0x2af3bc[_0x3a6b('0x39')],'resourceId':_0x2af3bc['id'],'type':_0x5cbbd0[_0x3a6b('0x39')],'sectionId':_0x5cbbd0['id']},{})[_0x3a6b('0x21')](function(){return _0x3ad28f;});}else{return _0x3ad28f;}})[_0x3a6b('0x29')](function(_0x3d8161){logger[_0x3a6b('0x26')](_0x3a6b('0x62'),_0x3d8161);throw _0x3d8161;});}return _0x3ad28f;})[_0x3a6b('0x21')](respondWithResult(_0x5bb2ce,0xc9))[_0x3a6b('0x29')](handleError(_0x5bb2ce,null));};exports[_0x3a6b('0x63')]=function(_0x33ca93,_0x17854e){if(_0x33ca93['body']['id']){delete _0x33ca93[_0x3a6b('0x5d')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x33ca93['params']['id']},'include':[{'model':db[_0x3a6b('0x3c')],'as':_0x3a6b('0x3d')}]})['then'](handleEntityNotFound(_0x17854e,null))['then'](saveUpdates(_0x33ca93[_0x3a6b('0x5d')],null))[_0x3a6b('0x21')](respondWithResult(_0x17854e,null))[_0x3a6b('0x29')](handleError(_0x17854e,null));};exports['destroy']=function(_0x98f0d7,_0x454873){return db[_0x3a6b('0x3f')][_0x3a6b('0x5b')]({'where':{'id':_0x98f0d7[_0x3a6b('0x59')]['id']}})['then'](handleEntityNotFound(_0x454873,null))[_0x3a6b('0x21')](removeEntity(_0x454873,null))[_0x3a6b('0x29')](handleError(_0x454873,null));};exports[_0x3a6b('0x64')]=function(_0x2b044a,_0x269e90){return db[_0x3a6b('0x3f')]['describe']()['then'](respondWithResult(_0x269e90,null))[_0x3a6b('0x29')](handleError(_0x269e90,null));};exports[_0x3a6b('0x65')]=function(_0x5f3ba4,_0x1bd7b6,_0x4ee5de){if(_0x5f3ba4[_0x3a6b('0x5d')]['id']){delete _0x5f3ba4[_0x3a6b('0x5d')]['id'];}return db[_0x3a6b('0x3f')][_0x3a6b('0x5b')]({'where':{'id':_0x5f3ba4[_0x3a6b('0x59')]['id']}})['then'](handleEntityNotFound(_0x1bd7b6,null))[_0x3a6b('0x21')](function(_0x4081bb){if(_0x4081bb){_0x5f3ba4[_0x3a6b('0x5d')][_0x3a6b('0x66')]=_0x4081bb['id'];return db['Disposition'][_0x3a6b('0x5c')](_0x5f3ba4[_0x3a6b('0x5d')]);}})['then'](respondWithResult(_0x1bd7b6,null))[_0x3a6b('0x29')](handleError(_0x1bd7b6,null));};exports[_0x3a6b('0x67')]=function(_0x1c7f7c,_0xa366df,_0x4033cf){var _0x3d8506={'raw':![],'where':{}};var _0x1c6dd2={};var _0x2989ec={'count':0x0,'rows':[]};return db[_0x3a6b('0x3f')]['findOne']({'where':{'id':_0x1c7f7c[_0x3a6b('0x59')]['id']}})[_0x3a6b('0x21')](handleEntityNotFound(_0xa366df,null))[_0x3a6b('0x21')](function(_0x2d0e87){if(_0x2d0e87){_0x1c6dd2['model']=_[_0x3a6b('0x44')](db['Disposition'][_0x3a6b('0x5a')]);_0x1c6dd2[_0x3a6b('0x43')]=_[_0x3a6b('0x44')](_0x1c7f7c[_0x3a6b('0x43')]);_0x1c6dd2[_0x3a6b('0x45')]=_[_0x3a6b('0x48')](_0x1c6dd2[_0x3a6b('0x46')],_0x1c6dd2[_0x3a6b('0x43')]);_0x3d8506[_0x3a6b('0x47')]=_[_0x3a6b('0x48')](_0x1c6dd2[_0x3a6b('0x46')],qs[_0x3a6b('0x49')](_0x1c7f7c[_0x3a6b('0x43')]['fields']));_0x3d8506['attributes']=_0x3d8506[_0x3a6b('0x47')][_0x3a6b('0x4a')]?_0x3d8506['attributes']:_0x1c6dd2[_0x3a6b('0x46')];if(!_0x1c7f7c[_0x3a6b('0x43')][_0x3a6b('0x4b')](_0x3a6b('0x4c'))){_0x3d8506[_0x3a6b('0x31')]=qs['limit'](_0x1c7f7c[_0x3a6b('0x43')][_0x3a6b('0x31')]);_0x3d8506[_0x3a6b('0x2e')]=qs['offset'](_0x1c7f7c[_0x3a6b('0x43')][_0x3a6b('0x2e')]);}_0x3d8506[_0x3a6b('0x4d')]=qs[_0x3a6b('0x4e')](_0x1c7f7c[_0x3a6b('0x43')][_0x3a6b('0x4e')]);_0x3d8506[_0x3a6b('0x4f')]=qs[_0x3a6b('0x45')](_[_0x3a6b('0x50')](_0x1c7f7c[_0x3a6b('0x43')],_0x1c6dd2['filters']));_0x3d8506[_0x3a6b('0x4f')][_0x3a6b('0x66')]=_0x2d0e87['id'];if(_0x1c7f7c[_0x3a6b('0x43')][_0x3a6b('0x51')]){_0x3d8506[_0x3a6b('0x4f')]=_[_0x3a6b('0x52')](_0x3d8506[_0x3a6b('0x4f')],{'$or':_[_0x3a6b('0x3e')](_0x3d8506['attributes'],function(_0x441d83){var _0x68e45a={};_0x68e45a[_0x441d83]={'$like':'%'+_0x1c7f7c[_0x3a6b('0x43')][_0x3a6b('0x51')]+'%'};return _0x68e45a;})});}_0x3d8506=_['merge']({},_0x3d8506,_0x1c7f7c['options']);return db[_0x3a6b('0x68')][_0x3a6b('0x30')]({'where':_0x3d8506[_0x3a6b('0x4f')]})[_0x3a6b('0x21')](function(_0x46555e){_0x2989ec['count']=_0x46555e;if(_0x1c7f7c[_0x3a6b('0x43')][_0x3a6b('0x55')]){_0x3d8506[_0x3a6b('0x69')]=[{'all':!![]}];}return db[_0x3a6b('0x68')][_0x3a6b('0x56')](_0x3d8506);})['then'](function(_0x16105f){_0x2989ec['rows']=_0x16105f;return _0x2989ec;});}})[_0x3a6b('0x21')](respondWithFilteredResult(_0xa366df,_0x3d8506))['catch'](handleError(_0xa366df,null));};exports[_0x3a6b('0x6a')]=function(_0x59d903,_0x71d36d,_0x2c94df){return db[_0x3a6b('0x3f')][_0x3a6b('0x5b')]({'where':{'id':_0x59d903[_0x3a6b('0x59')]['id']}})[_0x3a6b('0x21')](handleEntityNotFound(_0x71d36d,null))[_0x3a6b('0x21')](function(_0x35d4bd){if(_0x35d4bd){return _0x35d4bd['removeDispositions'](_0x59d903[_0x3a6b('0x43')][_0x3a6b('0x6b')]);}})[_0x3a6b('0x21')](respondWithStatusCode(_0x71d36d,null))[_0x3a6b('0x29')](handleError(_0x71d36d,null));};exports[_0x3a6b('0x6c')]=function(_0x4d733c,_0x21af81,_0x43a92f){if(_0x4d733c[_0x3a6b('0x5d')]['id']){delete _0x4d733c[_0x3a6b('0x5d')]['id'];}return db['OpenchannelAccount'][_0x3a6b('0x5b')]({'where':{'id':_0x4d733c[_0x3a6b('0x59')]['id']}})['then'](handleEntityNotFound(_0x21af81,null))[_0x3a6b('0x21')](function(_0xf52eac){if(_0xf52eac){_0x4d733c[_0x3a6b('0x5d')]['OpenchannelAccountId']=_0xf52eac['id'];return db[_0x3a6b('0x6d')][_0x3a6b('0x5c')](_0x4d733c[_0x3a6b('0x5d')]);}})[_0x3a6b('0x21')](respondWithResult(_0x21af81,null))[_0x3a6b('0x29')](handleError(_0x21af81,null));};exports[_0x3a6b('0x6e')]=function(_0xa6c5c9,_0x5b308a,_0x2c70e4){var _0x32be49={'raw':![],'where':{}};var _0x25c9c3={};var _0x4007de={'count':0x0,'rows':[]};return db[_0x3a6b('0x3f')]['findOne']({'where':{'id':_0xa6c5c9[_0x3a6b('0x59')]['id']}})[_0x3a6b('0x21')](handleEntityNotFound(_0x5b308a,null))[_0x3a6b('0x21')](function(_0x53bcb8){if(_0x53bcb8){_0x25c9c3[_0x3a6b('0x46')]=_[_0x3a6b('0x44')](db[_0x3a6b('0x6d')]['rawAttributes']);_0x25c9c3[_0x3a6b('0x43')]=_[_0x3a6b('0x44')](_0xa6c5c9[_0x3a6b('0x43')]);_0x25c9c3[_0x3a6b('0x45')]=_[_0x3a6b('0x48')](_0x25c9c3[_0x3a6b('0x46')],_0x25c9c3[_0x3a6b('0x43')]);_0x32be49[_0x3a6b('0x47')]=_[_0x3a6b('0x48')](_0x25c9c3[_0x3a6b('0x46')],qs[_0x3a6b('0x49')](_0xa6c5c9['query'][_0x3a6b('0x49')]));_0x32be49['attributes']=_0x32be49[_0x3a6b('0x47')]['length']?_0x32be49['attributes']:_0x25c9c3[_0x3a6b('0x46')];if(!_0xa6c5c9['query'][_0x3a6b('0x4b')](_0x3a6b('0x4c'))){_0x32be49[_0x3a6b('0x31')]=qs[_0x3a6b('0x31')](_0xa6c5c9[_0x3a6b('0x43')][_0x3a6b('0x31')]);_0x32be49['offset']=qs[_0x3a6b('0x2e')](_0xa6c5c9[_0x3a6b('0x43')][_0x3a6b('0x2e')]);}_0x32be49[_0x3a6b('0x4d')]=qs[_0x3a6b('0x4e')](_0xa6c5c9['query'][_0x3a6b('0x4e')]);_0x32be49[_0x3a6b('0x4f')]=qs[_0x3a6b('0x45')](_[_0x3a6b('0x50')](_0xa6c5c9[_0x3a6b('0x43')],_0x25c9c3[_0x3a6b('0x45')]));_0x32be49[_0x3a6b('0x4f')][_0x3a6b('0x66')]=_0x53bcb8['id'];if(_0xa6c5c9[_0x3a6b('0x43')]['filter']){_0x32be49['where']=_['merge'](_0x32be49[_0x3a6b('0x4f')],{'$or':_[_0x3a6b('0x3e')](_0x32be49[_0x3a6b('0x47')],function(_0x4c5838){var _0x5f226b={};_0x5f226b[_0x4c5838]={'$like':'%'+_0xa6c5c9['query'][_0x3a6b('0x51')]+'%'};return _0x5f226b;})});}_0x32be49=_[_0x3a6b('0x52')]({},_0x32be49,_0xa6c5c9[_0x3a6b('0x54')]);return db[_0x3a6b('0x6d')][_0x3a6b('0x30')]({'where':_0x32be49['where']})[_0x3a6b('0x21')](function(_0x1afb36){_0x4007de[_0x3a6b('0x30')]=_0x1afb36;if(_0xa6c5c9[_0x3a6b('0x43')][_0x3a6b('0x55')]){_0x32be49[_0x3a6b('0x69')]=[{'all':!![]}];}return db[_0x3a6b('0x6d')][_0x3a6b('0x56')](_0x32be49);})[_0x3a6b('0x21')](function(_0x517741){_0x4007de[_0x3a6b('0x57')]=_0x517741;return _0x4007de;});}})['then'](respondWithFilteredResult(_0x5b308a,_0x32be49))[_0x3a6b('0x29')](handleError(_0x5b308a,null));};exports[_0x3a6b('0x6f')]=function(_0x67cfb5,_0x2299b6,_0x19bf4d){return db[_0x3a6b('0x3f')]['find']({'where':{'id':_0x67cfb5['params']['id']}})[_0x3a6b('0x21')](handleEntityNotFound(_0x2299b6,null))[_0x3a6b('0x21')](function(_0x3597fa){if(_0x3597fa){return _0x3597fa[_0x3a6b('0x6f')](_0x67cfb5['query']['ids']);}})[_0x3a6b('0x21')](respondWithStatusCode(_0x2299b6,null))['catch'](handleError(_0x2299b6,null));};exports[_0x3a6b('0x70')]=function(_0x1fbb2e,_0x52f056,_0x3c93b4){var _0xe3c690={'body':_0x1fbb2e[_0x3a6b('0x5d')],'channel':_0x3a6b('0x71')};var _0x23db21=[];var _0x1d8f9d=[];var _0x59fc9c={};var _0x570d7c=![];return db[_0x3a6b('0x72')][_0x3a6b('0x64')]()[_0x3a6b('0x21')](function(_0x3fa73c){if(!_0x3fa73c){throw new db[(_0x3a6b('0x73'))][(_0x3a6b('0x74'))](_0x3a6b('0x75'));}_0x23db21=_[_0x3a6b('0x76')](_[_0x3a6b('0x44')](_0x3fa73c),['createdAt',_0x3a6b('0x77')]);_0x1d8f9d=_[_0x3a6b('0x76')](_[_0x3a6b('0x44')](_0x3fa73c),[_0x3a6b('0x78'),_0x3a6b('0x77'),'CompanyId',_0x3a6b('0x79')]);if(_0x1fbb2e[_0x3a6b('0x5d')]['id']){delete _0x1fbb2e[_0x3a6b('0x5d')]['id'];}if(_['isNil'](_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x7a')])){throw new db[(_0x3a6b('0x73'))][(_0x3a6b('0x74'))](_0x3a6b('0x7b'));}if(_['isNil'](_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x5d')])||_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x5d')]===''){throw new db['Sequelize'][(_0x3a6b('0x74'))](_0x3a6b('0x7c'));}if(_[_0x3a6b('0x7d')](_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x7e')])){throw new db[(_0x3a6b('0x73'))][(_0x3a6b('0x74'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1d8f9d);}if(!_[_0x3a6b('0x7f')](_0x1d8f9d,_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x7e')])){throw new db['Sequelize'][(_0x3a6b('0x74'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1d8f9d);}_0x59fc9c[_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x7e')]]=_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x7a')];})[_0x3a6b('0x21')](function(){return db[_0x3a6b('0x3f')][_0x3a6b('0x5b')]({'where':{'id':_0x1fbb2e[_0x3a6b('0x59')]['id']},'include':[{'model':db[_0x3a6b('0x80')],'as':_0x3a6b('0x81'),'include':[{'model':db[_0x3a6b('0x72')],'as':_0x3a6b('0x82'),'where':_0x59fc9c,'limit':0x1,'order':[['updatedAt',_0x3a6b('0x83')]]}]},{'model':db[_0x3a6b('0x84')],'as':'Applications'}]});})[_0x3a6b('0x21')](handleEntityNotFound(_0x52f056,null))['then'](function(_0x871294){if(_0x871294&&_0x871294[_0x3a6b('0x81')]){_0xe3c690[_0x3a6b('0x85')]=_0x871294;_0xe3c690['applications']=_0x871294[_0x3a6b('0x86')];_0xe3c690[_0x3a6b('0x87')]=_0x871294[_0x3a6b('0x81')];_0xe3c690['applications']=_[_0x3a6b('0x88')](_0xe3c690[_0x3a6b('0x89')],[_0x3a6b('0x8a')],[_0x3a6b('0x8b')]);if(_0xe3c690[_0x3a6b('0x85')][_0x3a6b('0x86')]){delete _0xe3c690[_0x3a6b('0x85')][_0x3a6b('0x86')];}if(_0xe3c690[_0x3a6b('0x85')][_0x3a6b('0x81')]&&_0xe3c690[_0x3a6b('0x85')][_0x3a6b('0x81')][_0x3a6b('0x82')]['length']){return _0xe3c690[_0x3a6b('0x85')][_0x3a6b('0x81')][_0x3a6b('0x82')][0x0];}var _0x48c776=_['defaults'](_0x1fbb2e[_0x3a6b('0x5d')],{'firstName':_0x1fbb2e['body'][_0x3a6b('0x7a')],'ListId':_0x871294[_0x3a6b('0x79')]});_0x48c776[_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x7e')]]=_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x7a')];return db[_0x3a6b('0x72')][_0x3a6b('0x5c')](_0x48c776,{'fields':_0x23db21,'raw':!![]});}})['then'](handleEntityNotFound(_0x52f056,null))[_0x3a6b('0x21')](function(_0x5394ce){_0xe3c690[_0x3a6b('0x8c')]=_0x5394ce;if(_0x5394ce){var _0x466c4c={'ContactId':_0x5394ce['id'],'OpenchannelAccountId':_0x1fbb2e['params']['id'],'from':(_0x5394ce[_0x3a6b('0x8d')]||'')+'\x20'+(_0x5394ce[_0x3a6b('0x8e')]||'')};var _0x3a7116={'OpenchannelAccountId':_0x1fbb2e[_0x3a6b('0x59')]['id'],'closed':![]};if(_0x1fbb2e['body'][_0x3a6b('0x8f')]){_0x3a7116[_0x3a6b('0x8f')]=_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x8f')];return db['OpenchannelInteraction']['find']({'where':_0x3a7116})[_0x3a6b('0x21')](function(_0x44294f){if(_0x44294f){return[_0x44294f,![]];}_0x466c4c[_0x3a6b('0x8f')]=_0x1fbb2e['body'][_0x3a6b('0x8f')];_0x466c4c['externalUrl']=_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x90')];return db[_0x3a6b('0x91')]['create'](_0x466c4c)[_0x3a6b('0x21')](function(_0x14d76f){return[_0x14d76f,!![]];});});}else{_0x3a7116[_0x3a6b('0x8f')]=null;}_0x3a7116[_0x3a6b('0x92')]=_0x5394ce['id'];return db[_0x3a6b('0x91')][_0x3a6b('0x5b')]({'where':_0x3a7116})[_0x3a6b('0x21')](function(_0x51ac00){if(_0x51ac00){return[_0x51ac00,![]];}return db['OpenchannelInteraction'][_0x3a6b('0x5c')](_0x466c4c)[_0x3a6b('0x21')](function(_0x3fdf2a){return[_0x3fdf2a,!![]];});});}})[_0x3a6b('0x93')](function(_0x47f586,_0x4c772b){if(_0x47f586){_0x570d7c=_0x4c772b;if(!_0x4c772b){var _0x3dd5e6={'from':(_0xe3c690[_0x3a6b('0x8c')][_0x3a6b('0x8d')]||'')+'\x20'+(_0xe3c690['contact'][_0x3a6b('0x8e')]||'')};if(_0x1fbb2e[_0x3a6b('0x5d')]['threadId']&&_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x94')]&&_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x8f')]!=_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x94')]){_0x3dd5e6['threadId']=_0x1fbb2e[_0x3a6b('0x5d')]['messageId'];}return _0x47f586[_0x3a6b('0x63')](_0x3dd5e6);}else{return _0x47f586;}}})[_0x3a6b('0x21')](function(_0x2b0c07){_0xe3c690[_0x3a6b('0x95')]=_0x2b0c07['get']({'plain':!![]});_0xe3c690[_0x3a6b('0x95')][_0x3a6b('0x96')]=_0x570d7c;if(_0xe3c690['interaction'][_0x3a6b('0x96')]){if(_0xe3c690[_0x3a6b('0x85')][_0x3a6b('0x97')]){_0xe3c690['applications']['push']({'id':0x0,'priority':_0xe3c690['applications'][_0x3a6b('0x4a')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x3a6b('0x98')});}}return db[_0x3a6b('0x99')][_0x3a6b('0x5c')]({'body':_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x5d')],'OpenchannelAccountId':_0x1fbb2e['params']['id'],'OpenchannelInteractionId':_0x2b0c07['id'],'direction':'in','ContactId':_0xe3c690[_0x3a6b('0x8c')]['id'],'AttachmentId':_0x1fbb2e[_0x3a6b('0x5d')][_0x3a6b('0x9a')]});})[_0x3a6b('0x21')](function(_0x3191be){_0xe3c690[_0x3a6b('0x28')]=_0x3191be;if(_0xe3c690['interaction'][_0x3a6b('0x9b')]){return db[_0x3a6b('0x9c')][_0x3a6b('0x5b')]({'attributes':['id',_0x3a6b('0x39')],'where':{'id':_0xe3c690['interaction'][_0x3a6b('0x9b')]}})[_0x3a6b('0x21')](function(_0x51c9be){if(_0x51c9be){_0xe3c690['applications'][_0x3a6b('0x9d')]({'id':0x0,'priority':0x0,'app':_0x3a6b('0x9e'),'appdata':_0x51c9be[_0x3a6b('0x39')]+','+(_0xe3c690['account'][_0x3a6b('0x9f')]||0xa),'interval':_0x3a6b('0x98')});_0xe3c690[_0x3a6b('0xa0')]=![];}return respondWithRpcPromise(_0x3a6b('0xa1'),_0x3a6b('0xa2'),_0xe3c690);});}return respondWithRpcPromise('Start','startRouting',_0xe3c690);})[_0x3a6b('0x21')](function(_0x364b9f){respondWithRpcPromise('EventManager',_0x3a6b('0xa3'),{'event':_0x3a6b('0x70'),'message':_0x364b9f},client9002);return _0x364b9f;})[_0x3a6b('0x21')](respondWithResult(_0x52f056,null))[_0x3a6b('0x29')](handleError(_0x52f056,null));};exports['addApplications']=function(_0xfd8fe2,_0x14fab6){var _0x42e14d=_0xfd8fe2['params']['id'];var _0x3fb809=_0xfd8fe2[_0x3a6b('0x5d')];var _0x56573f=0xc8;var _0x3feb48=null;return db[_0x3a6b('0xa4')][_0x3a6b('0xa5')]({'isolationLevel':db[_0x3a6b('0xa4')][_0x3a6b('0xa6')][_0x3a6b('0xa7')][_0x3a6b('0xa8')]},function(_0x21333d){return db[_0x3a6b('0x3f')][_0x3a6b('0xa9')]({'where':{'id':_0x42e14d},'transaction':_0x21333d})[_0x3a6b('0x21')](function(_0xfee149){if(_0xfee149){return db['OpenchannelApplication'][_0x3a6b('0x35')]({'where':{'OpenchannelAccountId':_0x42e14d},'transaction':_0x21333d})['then'](function(){var _0x40e87c=_[_0x3a6b('0x3e')](_0x3fb809,function(_0x501e77){_0x501e77['OpenchannelAccountId']=_0x42e14d;return _0x501e77;});return db[_0x3a6b('0x84')][_0x3a6b('0xaa')](_0x40e87c,{'transaction':_0x21333d});});}else{_0x56573f=0x194;_0x3feb48=[];}});})[_0x3a6b('0x21')](function(){if(_0x56573f!==0x194){return db[_0x3a6b('0x84')][_0x3a6b('0xab')]({'where':{'OpenchannelAccountId':_0x42e14d},'order':_0x3a6b('0x8a')})[_0x3a6b('0x21')](function(_0x1a484e){_0x3feb48=_0x1a484e;});}})[_0x3a6b('0x29')](function(_0x30ff4c){_0x56573f=0x1f4;logger[_0x3a6b('0x26')](_0x30ff4c[_0x3a6b('0x38')]);if(_0x30ff4c['name']){delete _0x30ff4c[_0x3a6b('0x39')];}_0x3feb48=_0x30ff4c;})[_0x3a6b('0xac')](function(){if(_0x3feb48===null){_0x14fab6[_0x3a6b('0x2a')](_0x56573f);}else{if(_0x56573f===0x1f4){_0x14fab6[_0x3a6b('0x2b')](_0x56573f)[_0x3a6b('0x3a')](_0x3feb48);}else{_0x14fab6[_0x3a6b('0x2b')](_0x56573f)[_0x3a6b('0x2d')](_0x3feb48);}}});};exports[_0x3a6b('0xad')]=function(_0xd0a234,_0x5c0a9b,_0x1ce7f1){var _0x376226={};var _0x40ed12={};var _0x5c984b;var _0x322c7e;return db[_0x3a6b('0x3f')][_0x3a6b('0xa9')]({'where':{'id':_0xd0a234[_0x3a6b('0x59')]['id']}})['then'](handleEntityNotFound(_0x5c0a9b,null))['then'](function(_0x3f9fbc){if(_0x3f9fbc){_0x5c984b=_0x3f9fbc;_0x40ed12[_0x3a6b('0x46')]=_[_0x3a6b('0x44')](db[_0x3a6b('0x84')][_0x3a6b('0x5a')]);_0x40ed12[_0x3a6b('0x43')]=_[_0x3a6b('0x44')](_0xd0a234[_0x3a6b('0x43')]);_0x40ed12[_0x3a6b('0x45')]=_[_0x3a6b('0x48')](_0x40ed12['model'],_0x40ed12[_0x3a6b('0x43')]);_0x376226[_0x3a6b('0x47')]=_[_0x3a6b('0x48')](_0x40ed12[_0x3a6b('0x46')],qs[_0x3a6b('0x49')](_0xd0a234['query'][_0x3a6b('0x49')]));_0x376226[_0x3a6b('0x47')]=_0x376226[_0x3a6b('0x47')]['length']?_0x376226[_0x3a6b('0x47')]:_0x40ed12[_0x3a6b('0x46')];_0x376226[_0x3a6b('0x4d')]=qs[_0x3a6b('0x4e')](_0xd0a234['query']['sort']);_0x376226[_0x3a6b('0x4f')]=qs[_0x3a6b('0x45')](_[_0x3a6b('0x50')](_0xd0a234[_0x3a6b('0x43')],_0x40ed12[_0x3a6b('0x45')]));if(_0xd0a234[_0x3a6b('0x43')][_0x3a6b('0x51')]){_0x376226[_0x3a6b('0x4f')]=_['merge'](_0x376226[_0x3a6b('0x4f')],{'$or':_[_0x3a6b('0x3e')](_0x376226[_0x3a6b('0x47')],function(_0x54c3cd){var _0x4f34af={};_0x4f34af[_0x54c3cd]={'$like':'%'+_0xd0a234[_0x3a6b('0x43')][_0x3a6b('0x51')]+'%'};return _0x4f34af;})});}_0x376226=_[_0x3a6b('0x52')]({},_0x376226,_0xd0a234['options']);return _0x5c984b['getApplications'](_0x376226);}})[_0x3a6b('0x21')](function(_0x4c0d9b){if(_0x4c0d9b){_0x322c7e=_0x4c0d9b[_0x3a6b('0x4a')];if(!_0xd0a234['query'][_0x3a6b('0x4b')](_0x3a6b('0x4c'))){_0x376226[_0x3a6b('0x31')]=qs['limit'](_0xd0a234[_0x3a6b('0x43')]['limit']);_0x376226['offset']=qs[_0x3a6b('0x2e')](_0xd0a234['query'][_0x3a6b('0x2e')]);}return _0x5c984b[_0x3a6b('0xad')](_0x376226);}})['then'](function(_0x5879de){if(_0x5879de){return _0x5879de?{'count':_0x322c7e,'rows':_0x5879de}:null;}})['then'](respondWithResult(_0x5c0a9b,null))['catch'](handleError(_0x5c0a9b,null));};exports[_0x3a6b('0xae')]=function(_0x10077a,_0x32ea1c,_0x13c6ff){var _0xab3d93={'raw':![],'where':{}};var _0x51a314={};var _0x2ad6b6={'count':0x0,'rows':[]};return db[_0x3a6b('0x3f')][_0x3a6b('0xa9')]({'where':{'id':_0x10077a[_0x3a6b('0x59')]['id']}})[_0x3a6b('0x21')](handleEntityNotFound(_0x32ea1c,null))[_0x3a6b('0x21')](function(_0x444f2b){if(_0x444f2b){_0x51a314[_0x3a6b('0x46')]=_['keys'](db[_0x3a6b('0x91')][_0x3a6b('0x5a')]);_0x51a314['query']=_['keys'](_0x10077a[_0x3a6b('0x43')]);_0x51a314[_0x3a6b('0x45')]=_[_0x3a6b('0x48')](_0x51a314[_0x3a6b('0x46')],_0x51a314[_0x3a6b('0x43')]);_0xab3d93[_0x3a6b('0x47')]=_[_0x3a6b('0x48')](_0x51a314['model'],qs[_0x3a6b('0x49')](_0x10077a['query'][_0x3a6b('0x49')]));_0xab3d93[_0x3a6b('0x47')]=_0xab3d93['attributes'][_0x3a6b('0x4a')]?_0xab3d93['attributes']:_0x51a314[_0x3a6b('0x46')];if(!_0x10077a['query'][_0x3a6b('0x4b')](_0x3a6b('0x4c'))){_0xab3d93['limit']=qs['limit'](_0x10077a[_0x3a6b('0x43')][_0x3a6b('0x31')]);_0xab3d93[_0x3a6b('0x2e')]=qs[_0x3a6b('0x2e')](_0x10077a[_0x3a6b('0x43')]['offset']);}_0xab3d93[_0x3a6b('0x4d')]=qs['sort'](_0x10077a['query'][_0x3a6b('0x4e')]);_0xab3d93[_0x3a6b('0x4f')]=qs[_0x3a6b('0x45')](_[_0x3a6b('0x50')](_0x10077a[_0x3a6b('0x43')],_0x51a314[_0x3a6b('0x45')]));_0xab3d93[_0x3a6b('0x4f')]['OpenchannelAccountId']=_0x444f2b['id'];if(_0x10077a[_0x3a6b('0x43')][_0x3a6b('0x51')]){_0xab3d93['where']=_['merge'](_0xab3d93[_0x3a6b('0x4f')],{'$or':_[_0x3a6b('0x3e')](_0xab3d93[_0x3a6b('0x47')],function(_0x36d957){var _0x4574f9={};_0x4574f9[_0x36d957]={'$like':'%'+_0x10077a[_0x3a6b('0x43')]['filter']+'%'};return _0x4574f9;})});}_0xab3d93=_[_0x3a6b('0x52')]({},_0xab3d93,_0x10077a[_0x3a6b('0x54')]);return db[_0x3a6b('0x91')][_0x3a6b('0x30')]({'where':_0xab3d93[_0x3a6b('0x4f')]})[_0x3a6b('0x21')](function(_0xd6c502){_0x2ad6b6[_0x3a6b('0x30')]=_0xd6c502;if(_0x10077a['query'][_0x3a6b('0x55')]){_0xab3d93['include']=[{'model':db[_0x3a6b('0x72')],'as':_0x3a6b('0xaf'),'required':![]},{'model':db[_0x3a6b('0x9c')],'as':'Owner','attributes':[_0x3a6b('0x39'),'fullname',_0x3a6b('0xb0')],'required':![]},{'model':db[_0x3a6b('0xb1')],'as':'Tags','attributes':['id',_0x3a6b('0x39'),_0x3a6b('0xb2')],'where':_0x10077a[_0x3a6b('0x43')][_0x3a6b('0xb3')]?{'id':_0x10077a[_0x3a6b('0x43')]['tag']}:undefined,'required':_0x10077a[_0x3a6b('0x43')][_0x3a6b('0xb3')]?!![]:![]}];}return db[_0x3a6b('0x91')][_0x3a6b('0x56')](_0xab3d93);})['then'](function(_0x1ea375){_0x2ad6b6[_0x3a6b('0x57')]=_0x1ea375;return _0x2ad6b6;});}})[_0x3a6b('0x21')](respondWithFilteredResult(_0x32ea1c,_0xab3d93))[_0x3a6b('0x29')](handleError(_0x32ea1c,null));};exports[_0x3a6b('0xb4')]=function(_0x5025a4,_0x4a6e2c,_0x4ab0a9){return db['OpenchannelAccount']['find']({'where':{'id':_0x5025a4[_0x3a6b('0x59')]['id']}})['then'](handleEntityNotFound(_0x4a6e2c,null))[_0x3a6b('0x21')](function(_0x133056){if(_0x133056){return _0x133056[_0x3a6b('0xb4')](_0x5025a4[_0x3a6b('0x5d')][_0x3a6b('0x6b')],_[_0x3a6b('0xb5')](_0x5025a4['body'],['ids','id'])||{})[_0x3a6b('0x93')](function(_0xee9441){for(var _0x1a9ed0=0x0;_0x1a9ed0<_0x5025a4[_0x3a6b('0x5d')]['ids'][_0x3a6b('0x4a')];_0x1a9ed0+=0x1){socket[_0x3a6b('0xb6')](_0x3a6b('0xb7'),{'UserId':Number(_0x5025a4[_0x3a6b('0x5d')][_0x3a6b('0x6b')][_0x1a9ed0]),'OpenchannelAccountId':Number(_0x5025a4[_0x3a6b('0x59')]['id'])});}return _0xee9441;});}})['then'](respondWithResult(_0x4a6e2c,null))['catch'](handleError(_0x4a6e2c,null));};exports[_0x3a6b('0xb8')]=function(_0xd8ad0e,_0x443b8c,_0x35fa5c){return db[_0x3a6b('0x3f')][_0x3a6b('0x5b')]({'where':{'id':_0xd8ad0e['params']['id']}})['then'](handleEntityNotFound(_0x443b8c,null))['then'](function(_0x385d9f){if(_0x385d9f){return _0x385d9f[_0x3a6b('0xb8')](_0xd8ad0e[_0x3a6b('0x43')][_0x3a6b('0x6b')])['then'](function(){if(_['isArray'](_0xd8ad0e[_0x3a6b('0x43')][_0x3a6b('0x6b')])){for(var _0x5e84a5=0x0;_0x5e84a5<_0xd8ad0e['query'][_0x3a6b('0x6b')][_0x3a6b('0x4a')];_0x5e84a5+=0x1){socket['emit'](_0x3a6b('0xb9'),{'UserId':Number(_0xd8ad0e[_0x3a6b('0x43')][_0x3a6b('0x6b')][_0x5e84a5]),'OpenchannelAccountId':Number(_0xd8ad0e['params']['id'])});}}else{socket[_0x3a6b('0xb6')](_0x3a6b('0xb9'),{'UserId':Number(_0xd8ad0e['query'][_0x3a6b('0x6b')]),'OpenchannelAccountId':Number(_0xd8ad0e['params']['id'])});}});}})[_0x3a6b('0x21')](respondWithStatusCode(_0x443b8c,null))['catch'](handleError(_0x443b8c,null));};exports[_0x3a6b('0xba')]=function(_0x26a9f4,_0x4ed358,_0x1081b1){var _0x2755f6={};var _0x26f9d8={};var _0xa0aeac;var _0x333dda;return db[_0x3a6b('0x3f')][_0x3a6b('0xa9')]({'where':{'id':_0x26a9f4[_0x3a6b('0x59')]['id']}})['then'](handleEntityNotFound(_0x4ed358,null))[_0x3a6b('0x21')](function(_0x26e382){if(_0x26e382){_0xa0aeac=_0x26e382;_0x26f9d8[_0x3a6b('0x46')]=_['keys'](db[_0x3a6b('0x9c')][_0x3a6b('0x5a')]);_0x26f9d8[_0x3a6b('0x43')]=_[_0x3a6b('0x44')](_0x26a9f4[_0x3a6b('0x43')]);_0x26f9d8['filters']=_[_0x3a6b('0x48')](_0x26f9d8['model'],_0x26f9d8['query']);_0x2755f6['attributes']=_[_0x3a6b('0x48')](_0x26f9d8[_0x3a6b('0x46')],qs['fields'](_0x26a9f4[_0x3a6b('0x43')]['fields']));_0x2755f6[_0x3a6b('0x47')]=_0x2755f6[_0x3a6b('0x47')][_0x3a6b('0x4a')]?_0x2755f6[_0x3a6b('0x47')]:_0x26f9d8[_0x3a6b('0x46')];_0x2755f6[_0x3a6b('0x4d')]=qs[_0x3a6b('0x4e')](_0x26a9f4[_0x3a6b('0x43')][_0x3a6b('0x4e')]);_0x2755f6[_0x3a6b('0x4f')]=qs[_0x3a6b('0x45')](_[_0x3a6b('0x50')](_0x26a9f4['query'],_0x26f9d8[_0x3a6b('0x45')]));if(_0x26a9f4[_0x3a6b('0x43')][_0x3a6b('0x51')]){_0x2755f6[_0x3a6b('0x4f')]=_['merge'](_0x2755f6[_0x3a6b('0x4f')],{'$or':_['map'](_0x2755f6[_0x3a6b('0x47')],function(_0x291292){var _0x3a4b4b={};_0x3a4b4b[_0x291292]={'$like':'%'+_0x26a9f4[_0x3a6b('0x43')]['filter']+'%'};return _0x3a4b4b;})});}_0x2755f6=_['merge']({},_0x2755f6,_0x26a9f4['options']);return _0xa0aeac['getAgents'](_0x2755f6);}})[_0x3a6b('0x21')](function(_0x58f9ea){if(_0x58f9ea){_0x333dda=_0x58f9ea[_0x3a6b('0x4a')];if(!_0x26a9f4[_0x3a6b('0x43')][_0x3a6b('0x4b')](_0x3a6b('0x4c'))){_0x2755f6[_0x3a6b('0x31')]=qs[_0x3a6b('0x31')](_0x26a9f4[_0x3a6b('0x43')][_0x3a6b('0x31')]);_0x2755f6['offset']=qs[_0x3a6b('0x2e')](_0x26a9f4[_0x3a6b('0x43')]['offset']);}return _0xa0aeac[_0x3a6b('0xba')](_0x2755f6);}})[_0x3a6b('0x21')](function(_0x1b1b50){if(_0x1b1b50){return _0x1b1b50?{'count':_0x333dda,'rows':_0x1b1b50}:null;}})['then'](respondWithResult(_0x4ed358,null))[_0x3a6b('0x29')](handleError(_0x4ed358,null));};exports[_0x3a6b('0x3a')]=function(_0x42fb20,_0x1f57b7,_0x4f6ce8){var _0xe4bbc1,_0x38fc2a,_0x2de2bd;if(_[_0x3a6b('0x7d')](_0x42fb20[_0x3a6b('0x5d')][_0x3a6b('0x5d')])||_0x42fb20['body'][_0x3a6b('0x5d')]===''){throw new db[(_0x3a6b('0x73'))][(_0x3a6b('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3a6b('0x7d')](_0x42fb20[_0x3a6b('0x5d')]['to'])){}_0xe4bbc1=_0x42fb20[_0x3a6b('0x5d')]['to'];return db[_0x3a6b('0x3f')][_0x3a6b('0xa9')]({'where':{'id':_0x42fb20['params']['id']}})['then'](handleEntityNotFound(_0x1f57b7,null))[_0x3a6b('0x21')](function(_0x37824d){if(_0x37824d){return db[_0x3a6b('0x3f')]['find']({'where':{'id':_0x37824d['id']},'include':[{'model':db[_0x3a6b('0x80')],'as':_0x3a6b('0x81'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x37824d[_0x3a6b('0x7e')]]:_0xe4bbc1},'limit':0x1,'order':[[_0x3a6b('0x77'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x1f57b7,null))[_0x3a6b('0x21')](function(_0x4c9999){if(_0x4c9999&&_0x4c9999[_0x3a6b('0x81')]){_0x38fc2a=_0x4c9999[_0x3a6b('0x36')]({'plain':!![]});if(_0x38fc2a[_0x3a6b('0x81')]&&_0x38fc2a['List'][_0x3a6b('0x82')][_0x3a6b('0x4a')]){return _0x38fc2a[_0x3a6b('0x81')][_0x3a6b('0x82')][0x0];}return db[_0x3a6b('0x72')][_0x3a6b('0x5c')](_[_0x3a6b('0x18')](_0x42fb20[_0x3a6b('0x5d')],{'firstName':_0xe4bbc1,[_0x4c9999[_0x3a6b('0x7e')]]:_0xe4bbc1,'phone':_0xe4bbc1,'ListId':_0x38fc2a[_0x3a6b('0x79')]}));}})[_0x3a6b('0x21')](handleEntityNotFound(_0x1f57b7,null))[_0x3a6b('0x21')](function(_0x1473b7){if(_0x1473b7){_0x2de2bd=_0x1473b7;return db[_0x3a6b('0x91')]['find']({'where':{'ContactId':_0x2de2bd['id'],'closed':![],'OpenchannelAccountId':_0x38fc2a['id']}})[_0x3a6b('0x21')](function(_0x20f40a){if(_0x20f40a){return[_0x20f40a,![]];}return db[_0x3a6b('0x91')]['create']({'UserId':_0x42fb20[_0x3a6b('0x5e')]['id'],'ContactId':_0x2de2bd['id'],'OpenchannelAccountId':_0x38fc2a['id'],'lastMsgDirection':'out','firstMsgDirection':_0x3a6b('0xbb'),'Messages':[_['merge'](_0x42fb20[_0x3a6b('0x5d')],{'read':![],'body':_0x42fb20['body'][_0x3a6b('0x5d')],'OpenchannelAccountId':_0x38fc2a['id'],'UserId':_0x42fb20[_0x3a6b('0x5e')]['id'],'ContactId':_0x2de2bd['id']})]},{'include':[{'model':db[_0x3a6b('0x99')],'as':_0x3a6b('0xbc')}]})[_0x3a6b('0x21')](function(_0x5d1cd3){return[_0x5d1cd3,!![]];});});}})[_0x3a6b('0x93')](function(_0x10531f,_0x1aa0e1){if(_0x1aa0e1){return _0x10531f;}return db[_0x3a6b('0x99')]['create'](_[_0x3a6b('0x52')](_0x42fb20[_0x3a6b('0x5d')],{'read':![],'body':_0x42fb20[_0x3a6b('0x5d')][_0x3a6b('0x5d')],'OpenchannelAccountId':_0x38fc2a['id'],'OpenchannelInteractionId':_0x10531f['id'],'UserId':_0x42fb20[_0x3a6b('0x5e')]['id'],'ContactId':_0x2de2bd['id']}))[_0x3a6b('0x21')](function(_0x2d25a4){_0x10531f[_0x3a6b('0xbd')][_0x3a6b('0xbc')]=[];_0x10531f[_0x3a6b('0xbd')][_0x3a6b('0xbc')][_0x3a6b('0xbe')](_0x2d25a4[_0x3a6b('0xbd')]);return _0x10531f;});});}})['then'](respondWithResult(_0x1f57b7,null))[_0x3a6b('0x29')](handleError(_0x1f57b7,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index f861712..bdde48a 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 _0x702d=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount'];(function(_0x44ffdd,_0x2d0eef){var _0x3afeac=function(_0x554134){while(--_0x554134){_0x44ffdd['push'](_0x44ffdd['shift']());}};_0x3afeac(++_0x2d0eef);}(_0x702d,0x147));var _0xd702=function(_0x56e651,_0x20f7fa){_0x56e651=_0x56e651-0x0;var _0x59ae49=_0x702d[_0x56e651];return _0x59ae49;};'use strict';var EventEmitter=require(_0xd702('0x0'));var OpenchannelAccount=require(_0xd702('0x1'))['db'][_0xd702('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xd702('0x3')](0x0);var events={'afterCreate':_0xd702('0x4'),'afterUpdate':'update','afterDestroy':_0xd702('0x5')};function emitEvent(_0xebbd7c){return function(_0x27b260,_0x1c5a32,_0x481ee0){OpenchannelAccountEvents[_0xd702('0x6')](_0xebbd7c+':'+_0x27b260['id'],_0x27b260);OpenchannelAccountEvents['emit'](_0xebbd7c,_0x27b260);_0x481ee0(null);};}for(var e in events){if(events[_0xd702('0x7')](e)){var event=events[e];OpenchannelAccount[_0xd702('0x8')](e,emitEvent(event));}}module[_0xd702('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xb43b=['events','../../mysqldb','setMaxListeners','save','update','hasOwnProperty','exports'];(function(_0x156339,_0x1226ef){var _0x6e39e8=function(_0x98e8c0){while(--_0x98e8c0){_0x156339['push'](_0x156339['shift']());}};_0x6e39e8(++_0x1226ef);}(_0xb43b,0x1b2));var _0xbb43=function(_0x49a0d6,_0x93173){_0x49a0d6=_0x49a0d6-0x0;var _0x21075f=_0xb43b[_0x49a0d6];return _0x21075f;};'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 111ae7c..ea46e4a 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(_0x2963a0,_0x1e11dd){var _0x51691c=function(_0x2f9e4f){while(--_0x2f9e4f){_0x2963a0['push'](_0x2963a0['shift']());}};_0x51691c(++_0x1e11dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x439ce0,_0x3dfcab){var _0x49f105=function(_0x3c08ff){while(--_0x3c08ff){_0x439ce0['push'](_0x439ce0['shift']());}};_0x49f105(++_0x3dfcab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 68bcf21..501e06f 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 _0xb7e7=['socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost'];(function(_0x4e784a,_0x3164b9){var _0x509b5f=function(_0x168d1a){while(--_0x168d1a){_0x4e784a['push'](_0x4e784a['shift']());}};_0x509b5f(++_0x3164b9);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xb7e7[_0x39d544];return _0x5a5ff2;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});config[_0x7b7e('0x8')]=_[_0x7b7e('0x9')](config['redis'],{'host':_0x7b7e('0xa'),'port':0x18eb});var socket=require(_0x7b7e('0xb'))(new Redis(config[_0x7b7e('0x8')]));require(_0x7b7e('0xc'))[_0x7b7e('0xd')](socket);function respondWithRpcPromise(_0x26bb8d,_0x242e70,_0x52de3b){return new BPromise(function(_0x299519,_0x1eef0a){return client[_0x7b7e('0xe')](_0x26bb8d,_0x52de3b)[_0x7b7e('0xf')](function(_0xd581fb){logger[_0x7b7e('0x10')](_0x7b7e('0x11'),_0x242e70,_0x7b7e('0x12'));logger[_0x7b7e('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x242e70,_0x7b7e('0x12'),JSON[_0x7b7e('0x14')](_0xd581fb));if(_0xd581fb['error']){if(_0xd581fb[_0x7b7e('0x15')]['code']===0x1f4){logger['error'](_0x7b7e('0x11'),_0x242e70,_0xd581fb[_0x7b7e('0x15')][_0x7b7e('0x16')]);return _0x1eef0a(_0xd581fb[_0x7b7e('0x15')][_0x7b7e('0x16')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x242e70,_0xd581fb[_0x7b7e('0x15')][_0x7b7e('0x16')]);return _0x299519(_0xd581fb[_0x7b7e('0x15')][_0x7b7e('0x16')]);}else{logger[_0x7b7e('0x10')](_0x7b7e('0x11'),_0x242e70,_0x7b7e('0x12'));_0x299519(_0xd581fb[_0x7b7e('0x17')][_0x7b7e('0x16')]);}})[_0x7b7e('0x18')](function(_0x12e8e9){logger[_0x7b7e('0x15')](_0x7b7e('0x11'),_0x242e70,_0x12e8e9);_0x1eef0a(_0x12e8e9);});});} \ No newline at end of file +var _0x1b32=['http','redis','defaults','localhost','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5869e2,_0x5321f9){var _0xd78a7f=function(_0x1f74e1){while(--_0x1f74e1){_0x5869e2['push'](_0x5869e2['shift']());}};_0xd78a7f(++_0x5321f9);}(_0x1b32,0x85));var _0x21b3=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x1b32[_0x38537f];return _0x141e23;};'use strict';var _=require('lodash');var util=require(_0x21b3('0x0'));var moment=require(_0x21b3('0x1'));var BPromise=require(_0x21b3('0x2'));var rs=require(_0x21b3('0x3'));var fs=require('fs');var Redis=require(_0x21b3('0x4'));var db=require(_0x21b3('0x5'))['db'];var utils=require(_0x21b3('0x6'));var logger=require(_0x21b3('0x7'))(_0x21b3('0x8'));var config=require(_0x21b3('0x9'));var jayson=require(_0x21b3('0xa'));var client=jayson[_0x21b3('0xb')][_0x21b3('0xc')]({'port':0x232a});config[_0x21b3('0xd')]=_[_0x21b3('0xe')](config['redis'],{'host':_0x21b3('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x21b3('0x10')](socket);function respondWithRpcPromise(_0x36b2a1,_0x56009d,_0x4aa0d7){return new BPromise(function(_0x253f2b,_0x270969){return client[_0x21b3('0x11')](_0x36b2a1,_0x4aa0d7)['then'](function(_0x370338){logger[_0x21b3('0x12')](_0x21b3('0x13'),_0x56009d,_0x21b3('0x14'));logger[_0x21b3('0x15')](_0x21b3('0x16'),_0x56009d,_0x21b3('0x14'),JSON[_0x21b3('0x17')](_0x370338));if(_0x370338[_0x21b3('0x18')]){if(_0x370338['error'][_0x21b3('0x19')]===0x1f4){logger[_0x21b3('0x18')](_0x21b3('0x13'),_0x56009d,_0x370338['error'][_0x21b3('0x1a')]);return _0x270969(_0x370338['error'][_0x21b3('0x1a')]);}logger['error'](_0x21b3('0x13'),_0x56009d,_0x370338[_0x21b3('0x18')][_0x21b3('0x1a')]);return _0x253f2b(_0x370338[_0x21b3('0x18')]['message']);}else{logger[_0x21b3('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x56009d,_0x21b3('0x14'));_0x253f2b(_0x370338[_0x21b3('0x1b')][_0x21b3('0x1a')]);}})[_0x21b3('0x1c')](function(_0x513c32){logger[_0x21b3('0x18')](_0x21b3('0x13'),_0x56009d,_0x513c32);_0x270969(_0x513c32);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index a1d08a9..1320eae 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 _0x851a=['update','emit','register','length','openchannelAccount:','./openchannelAccount.events','remove'];(function(_0xd6be05,_0x463f35){var _0x3cbabe=function(_0x87e40b){while(--_0x87e40b){_0xd6be05['push'](_0xd6be05['shift']());}};_0x3cbabe(++_0x463f35);}(_0x851a,0x19b));var _0xa851=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x851a[_0x599f41];return _0x2e4d58;};'use strict';var OpenchannelAccountEvents=require(_0xa851('0x0'));var events=['save',_0xa851('0x1'),_0xa851('0x2')];function createListener(_0x38707a,_0x52489c){return function(_0xd7442b){_0x52489c[_0xa851('0x3')](_0x38707a,_0xd7442b);};}function removeListener(_0x1b30dc,_0x3f317d){return function(){OpenchannelAccountEvents['removeListener'](_0x1b30dc,_0x3f317d);};}exports[_0xa851('0x4')]=function(_0x57a7c4){for(var _0x1cba67=0x0,_0x2fc0e0=events[_0xa851('0x5')];_0x1cba67<_0x2fc0e0;_0x1cba67++){var _0x551e16=events[_0x1cba67];var _0x3e1e9d=createListener(_0xa851('0x6')+_0x551e16,_0x57a7c4);OpenchannelAccountEvents['on'](_0x551e16,_0x3e1e9d);}}; \ No newline at end of file +var _0x2c54=['length','openchannelAccount:','./openchannelAccount.events','save','remove','emit','register'];(function(_0xec2b23,_0x4bd5fc){var _0xf0046e=function(_0x41b56b){while(--_0x41b56b){_0xec2b23['push'](_0xec2b23['shift']());}};_0xf0046e(++_0x4bd5fc);}(_0x2c54,0x136));var _0x42c5=function(_0x5c8a9f,_0x93df11){_0x5c8a9f=_0x5c8a9f-0x0;var _0x182548=_0x2c54[_0x5c8a9f];return _0x182548;};'use strict';var OpenchannelAccountEvents=require(_0x42c5('0x0'));var events=[_0x42c5('0x1'),_0x42c5('0x2'),'update'];function createListener(_0xbe3529,_0x46bcc4){return function(_0x3d5e1d){_0x46bcc4[_0x42c5('0x3')](_0xbe3529,_0x3d5e1d);};}function removeListener(_0x2407d0,_0x17924f){return function(){OpenchannelAccountEvents['removeListener'](_0x2407d0,_0x17924f);};}exports[_0x42c5('0x4')]=function(_0x551181){for(var _0x4d9ed4=0x0,_0x1959c1=events[_0x42c5('0x5')];_0x4d9ed4<_0x1959c1;_0x4d9ed4++){var _0x38d528=events[_0x4d9ed4];var _0x134cb6=createListener(_0x42c5('0x6')+_0x38d528,_0x551181);OpenchannelAccountEvents['on'](_0x38d528,_0x134cb6);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 27753a1..64816bf 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 _0xd756=['path','express','Router','fs-extra','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util'];(function(_0x302830,_0x30b107){var _0x3ab169=function(_0x180642){while(--_0x180642){_0x302830['push'](_0x302830['shift']());}};_0x3ab169(++_0x30b107);}(_0xd756,0x1ec));var _0x6d75=function(_0x28d601,_0x19b8f7){_0x28d601=_0x28d601-0x0;var _0x279228=_0xd756[_0x28d601];return _0x279228;};'use strict';var multer=require(_0x6d75('0x0'));var util=require(_0x6d75('0x1'));var path=require(_0x6d75('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d75('0x3'));var router=express[_0x6d75('0x4')]();var fs_extra=require(_0x6d75('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6d75('0x6'));var config=require('../../config/environment');var controller=require(_0x6d75('0x7'));router[_0x6d75('0x8')]('/',auth[_0x6d75('0x9')](),controller[_0x6d75('0xa')]);router[_0x6d75('0x8')]('/:id',auth[_0x6d75('0x9')](),controller[_0x6d75('0xb')]);router[_0x6d75('0xc')]('/',auth[_0x6d75('0x9')](),controller[_0x6d75('0xd')]);router[_0x6d75('0xe')](_0x6d75('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x6d75('0x10')]('/:id',auth[_0x6d75('0x9')](),controller[_0x6d75('0x11')]);module[_0x6d75('0x12')]=router; \ No newline at end of file +var _0x2fc2=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','connect-timeout'];(function(_0x429cc7,_0x29eea3){var _0x357783=function(_0x4e335b){while(--_0x4e335b){_0x429cc7['push'](_0x429cc7['shift']());}};_0x357783(++_0x29eea3);}(_0x2fc2,0x142));var _0x22fc=function(_0x46d2a8,_0x3f511d){_0x46d2a8=_0x46d2a8-0x0;var _0x1b5642=_0x2fc2[_0x46d2a8];return _0x1b5642;};'use strict';var multer=require('multer');var util=require(_0x22fc('0x0'));var path=require('path');var timeout=require(_0x22fc('0x1'));var express=require('express');var router=express[_0x22fc('0x2')]();var fs_extra=require(_0x22fc('0x3'));var auth=require(_0x22fc('0x4'));var interaction=require(_0x22fc('0x5'));var config=require(_0x22fc('0x6'));var controller=require(_0x22fc('0x7'));router['get']('/',auth[_0x22fc('0x8')](),controller[_0x22fc('0x9')]);router['get'](_0x22fc('0xa'),auth[_0x22fc('0x8')](),controller[_0x22fc('0xb')]);router[_0x22fc('0xc')]('/',auth[_0x22fc('0x8')](),controller[_0x22fc('0xd')]);router['put'](_0x22fc('0xa'),auth['isAuthenticated'](),controller[_0x22fc('0xe')]);router[_0x22fc('0xf')]('/:id',auth[_0x22fc('0x8')](),controller[_0x22fc('0x10')]);module[_0x22fc('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index bba16e1..9f47eec 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 _0x1fd2=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x1fd2,0x11d));var _0x21fd=function(_0x217687,_0x13a09a){_0x217687=_0x217687-0x0;var _0x26410d=_0x1fd2[_0x217687];return _0x26410d;};'use strict';var Sequelize=require(_0x21fd('0x0'));module[_0x21fd('0x1')]={'priority':{'type':Sequelize[_0x21fd('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x21fd('0x3')],'allowNull':![],'defaultValue':_0x21fd('0x4')},'appdata':{'type':Sequelize[_0x21fd('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x21fd('0x3')],'defaultValue':_0x21fd('0x6')}}; \ No newline at end of file +var _0x81bc=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x4d6624,_0x78b606){var _0x5dbb01=function(_0x54356e){while(--_0x54356e){_0x4d6624['push'](_0x4d6624['shift']());}};_0x5dbb01(++_0x78b606);}(_0x81bc,0x122));var _0xc81b=function(_0x5db96a,_0x60039){_0x5db96a=_0x5db96a-0x0;var _0x13fdb0=_0x81bc[_0x5db96a];return _0x13fdb0;};'use strict';var Sequelize=require(_0xc81b('0x0'));module[_0xc81b('0x1')]={'priority':{'type':Sequelize[_0xc81b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc81b('0x3')],'allowNull':![],'defaultValue':_0xc81b('0x4')},'appdata':{'type':Sequelize[_0xc81b('0x5')]()},'description':{'type':Sequelize[_0xc81b('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 335e000..cbb7e15 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 _0x1044=['count','set','Content-Range','json','apply','reject','then','destroy','stack','name','send','index','map','OpenchannelApplication','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','merge','options','find','create','body','update','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit'];(function(_0x5677f8,_0x5c1715){var _0x556a0b=function(_0x432dd6){while(--_0x432dd6){_0x5677f8['push'](_0x5677f8['shift']());}};_0x556a0b(++_0x5c1715);}(_0x1044,0x106));var _0x4104=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x1044[_0x68ee8b];return _0x5148f7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4104('0x0'));var jsonpatch=require(_0x4104('0x1'));var rp=require(_0x4104('0x2'));var moment=require(_0x4104('0x3'));var BPromise=require(_0x4104('0x4'));var Mustache=require(_0x4104('0x5'));var util=require(_0x4104('0x6'));var path=require(_0x4104('0x7'));var sox=require(_0x4104('0x8'));var csv=require(_0x4104('0x9'));var ejs=require(_0x4104('0xa'));var fs=require('fs');var fs_extra=require(_0x4104('0xb'));var _=require(_0x4104('0xc'));var squel=require('squel');var crypto=require(_0x4104('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4104('0xe'));var toCsv=require(_0x4104('0x9'));var querystring=require(_0x4104('0xf'));var Papa=require(_0x4104('0x10'));var Redis=require(_0x4104('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4104('0x12'));var as=require(_0x4104('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4104('0x14'));var utils=require(_0x4104('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4104('0x16'));var db=require(_0x4104('0x17'))['db'];function respondWithStatusCode(_0x40fc35,_0x167b08){_0x167b08=_0x167b08||0xcc;return function(_0x48d5f1){if(_0x48d5f1){return _0x40fc35[_0x4104('0x18')](_0x167b08);}return _0x40fc35['status'](_0x167b08)[_0x4104('0x19')]();};}function respondWithResult(_0x38e9f6,_0x24d1b7){_0x24d1b7=_0x24d1b7||0xc8;return function(_0x76ea7e){if(_0x76ea7e){return _0x38e9f6[_0x4104('0x1a')](_0x24d1b7)['json'](_0x76ea7e);}};}function respondWithFilteredResult(_0x109ee4,_0x33cfb1){return function(_0x49a845){if(_0x49a845){var _0x5a3044=typeof _0x33cfb1[_0x4104('0x1b')]===_0x4104('0x1c')&&typeof _0x33cfb1[_0x4104('0x1d')]===_0x4104('0x1c');var _0x347069=_0x49a845[_0x4104('0x1e')];var _0x11b318=_0x5a3044?0x0:_0x33cfb1[_0x4104('0x1b')];var _0x3f4a15=_0x5a3044?_0x49a845['count']:_0x33cfb1['offset']+_0x33cfb1[_0x4104('0x1d')];var _0x3c0235;if(_0x3f4a15>=_0x347069){_0x3f4a15=_0x347069;_0x3c0235=0xc8;}else{_0x3c0235=0xce;}_0x109ee4['status'](_0x3c0235);return _0x109ee4[_0x4104('0x1f')](_0x4104('0x20'),_0x11b318+'-'+_0x3f4a15+'/'+_0x347069)[_0x4104('0x21')](_0x49a845);}return null;};}function patchUpdates(_0x302e2b){return function(_0x417824){try{jsonpatch[_0x4104('0x22')](_0x417824,_0x302e2b,!![]);}catch(_0x26aa61){return BPromise[_0x4104('0x23')](_0x26aa61);}return _0x417824['save']();};}function saveUpdates(_0x8fdfdb,_0x3d1eec){return function(_0x35c00e){if(_0x35c00e){return _0x35c00e['update'](_0x8fdfdb)[_0x4104('0x24')](function(_0x27376a){return _0x27376a;});}return null;};}function removeEntity(_0x14f0b4,_0x584487){return function(_0x421d1c){if(_0x421d1c){return _0x421d1c[_0x4104('0x25')]()[_0x4104('0x24')](function(){_0x14f0b4[_0x4104('0x1a')](0xcc)[_0x4104('0x19')]();});}};}function handleEntityNotFound(_0x171e51,_0x457d52){return function(_0x3a48f5){if(!_0x3a48f5){_0x171e51[_0x4104('0x18')](0x194);}return _0x3a48f5;};}function handleError(_0x3a9e62,_0x115dcc){_0x115dcc=_0x115dcc||0x1f4;return function(_0x6ab8e7){logger['error'](_0x6ab8e7[_0x4104('0x26')]);if(_0x6ab8e7[_0x4104('0x27')]){delete _0x6ab8e7[_0x4104('0x27')];}_0x3a9e62[_0x4104('0x1a')](_0x115dcc)[_0x4104('0x28')](_0x6ab8e7);};}exports[_0x4104('0x29')]=function(_0x50adf9,_0x4d393a){var _0xfc55d0={},_0x45b5ca={},_0x362f74={'count':0x0,'rows':[]};var _0xacdff0=_[_0x4104('0x2a')](db[_0x4104('0x2b')]['rawAttributes'],function(_0x58e9e4){return{'name':_0x58e9e4['fieldName'],'type':_0x58e9e4[_0x4104('0x2c')]['key']};});_0x45b5ca[_0x4104('0x2d')]=_[_0x4104('0x2a')](_0xacdff0,_0x4104('0x27'));_0x45b5ca[_0x4104('0x2e')]=_[_0x4104('0x2f')](_0x50adf9['query']);_0x45b5ca[_0x4104('0x30')]=_[_0x4104('0x31')](_0x45b5ca[_0x4104('0x2d')],_0x45b5ca[_0x4104('0x2e')]);_0xfc55d0[_0x4104('0x32')]=_['intersection'](_0x45b5ca[_0x4104('0x2d')],qs[_0x4104('0x33')](_0x50adf9[_0x4104('0x2e')][_0x4104('0x33')]));_0xfc55d0['attributes']=_0xfc55d0[_0x4104('0x32')][_0x4104('0x34')]?_0xfc55d0[_0x4104('0x32')]:_0x45b5ca[_0x4104('0x2d')];if(!_0x50adf9[_0x4104('0x2e')][_0x4104('0x35')](_0x4104('0x36'))){_0xfc55d0[_0x4104('0x1d')]=qs[_0x4104('0x1d')](_0x50adf9[_0x4104('0x2e')][_0x4104('0x1d')]);_0xfc55d0[_0x4104('0x1b')]=qs['offset'](_0x50adf9['query'][_0x4104('0x1b')]);}_0xfc55d0[_0x4104('0x37')]=qs[_0x4104('0x38')](_0x50adf9[_0x4104('0x2e')][_0x4104('0x38')]);_0xfc55d0[_0x4104('0x39')]=qs[_0x4104('0x30')](_[_0x4104('0x3a')](_0x50adf9[_0x4104('0x2e')],_0x45b5ca[_0x4104('0x30')]),_0xacdff0);if(_0x50adf9['query'][_0x4104('0x3b')]){_0xfc55d0['where']=_['merge'](_0xfc55d0[_0x4104('0x39')],{'$or':_[_0x4104('0x2a')](_0xacdff0,function(_0x4d25fc){if(_0x4d25fc[_0x4104('0x2c')]!==_0x4104('0x3c')){var _0x1de850={};_0x1de850[_0x4d25fc['name']]={'$like':'%'+_0x50adf9[_0x4104('0x2e')][_0x4104('0x3b')]+'%'};return _0x1de850;}})});}_0xfc55d0=_['merge']({},_0xfc55d0,_0x50adf9['options']);var _0x4c4af9={'where':_0xfc55d0['where']};return db['OpenchannelApplication'][_0x4104('0x1e')](_0x4c4af9)[_0x4104('0x24')](function(_0x4bf19c){_0x362f74['count']=_0x4bf19c;if(_0x50adf9[_0x4104('0x2e')][_0x4104('0x3d')]){_0xfc55d0[_0x4104('0x3e')]=[{'all':!![]}];}return db[_0x4104('0x2b')]['findAll'](_0xfc55d0);})[_0x4104('0x24')](function(_0x338aa4){_0x362f74['rows']=_0x338aa4;return _0x362f74;})['then'](respondWithFilteredResult(_0x4d393a,_0xfc55d0))[_0x4104('0x3f')](handleError(_0x4d393a,null));};exports[_0x4104('0x40')]=function(_0x289884,_0x50c02c){var _0x472e5c={'raw':!![],'where':{'id':_0x289884[_0x4104('0x41')]['id']}},_0x31ee6c={};_0x31ee6c[_0x4104('0x2d')]=_[_0x4104('0x2f')](db[_0x4104('0x2b')][_0x4104('0x42')]);_0x31ee6c[_0x4104('0x2e')]=_[_0x4104('0x2f')](_0x289884['query']);_0x31ee6c['filters']=_['intersection'](_0x31ee6c[_0x4104('0x2d')],_0x31ee6c[_0x4104('0x2e')]);_0x472e5c[_0x4104('0x32')]=_[_0x4104('0x31')](_0x31ee6c[_0x4104('0x2d')],qs[_0x4104('0x33')](_0x289884[_0x4104('0x2e')]['fields']));_0x472e5c[_0x4104('0x32')]=_0x472e5c[_0x4104('0x32')]['length']?_0x472e5c[_0x4104('0x32')]:_0x31ee6c[_0x4104('0x2d')];if(_0x289884[_0x4104('0x2e')][_0x4104('0x3d')]){_0x472e5c[_0x4104('0x3e')]=[{'all':!![]}];}_0x472e5c=_[_0x4104('0x43')]({},_0x472e5c,_0x289884[_0x4104('0x44')]);return db[_0x4104('0x2b')][_0x4104('0x45')](_0x472e5c)['then'](handleEntityNotFound(_0x50c02c,null))['then'](respondWithResult(_0x50c02c,null))[_0x4104('0x3f')](handleError(_0x50c02c,null));};exports['create']=function(_0x371390,_0x451d23){return db[_0x4104('0x2b')][_0x4104('0x46')](_0x371390[_0x4104('0x47')],{})[_0x4104('0x24')](respondWithResult(_0x451d23,0xc9))[_0x4104('0x3f')](handleError(_0x451d23,null));};exports[_0x4104('0x48')]=function(_0x59b78b,_0x4ad9fa){if(_0x59b78b[_0x4104('0x47')]['id']){delete _0x59b78b[_0x4104('0x47')]['id'];}return db[_0x4104('0x2b')][_0x4104('0x45')]({'where':{'id':_0x59b78b[_0x4104('0x41')]['id']}})['then'](handleEntityNotFound(_0x4ad9fa,null))[_0x4104('0x24')](saveUpdates(_0x59b78b[_0x4104('0x47')],null))[_0x4104('0x24')](respondWithResult(_0x4ad9fa,null))[_0x4104('0x3f')](handleError(_0x4ad9fa,null));};exports['destroy']=function(_0x2fda98,_0x34379e){return db[_0x4104('0x2b')]['find']({'where':{'id':_0x2fda98['params']['id']}})[_0x4104('0x24')](handleEntityNotFound(_0x34379e,null))[_0x4104('0x24')](removeEntity(_0x34379e,null))[_0x4104('0x3f')](handleError(_0x34379e,null));}; \ No newline at end of file +var _0x154b=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','set','apply','save','then','destroy','sendStatus','error','stack','name','map','OpenchannelApplication','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','catch','create','update','body','find','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x282384,_0x43c59e){var _0x338397=function(_0x332a2f){while(--_0x332a2f){_0x282384['push'](_0x282384['shift']());}};_0x338397(++_0x43c59e);}(_0x154b,0x113));var _0xb154=function(_0x2b6b03,_0xb65a6a){_0x2b6b03=_0x2b6b03-0x0;var _0x545de6=_0x154b[_0x2b6b03];return _0x545de6;};'use strict';var emlformat=require(_0xb154('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb154('0x1'));var jsonpatch=require(_0xb154('0x2'));var rp=require(_0xb154('0x3'));var moment=require('moment');var BPromise=require(_0xb154('0x4'));var Mustache=require('mustache');var util=require(_0xb154('0x5'));var path=require(_0xb154('0x6'));var sox=require(_0xb154('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb154('0x8'));var _=require('lodash');var squel=require(_0xb154('0x9'));var crypto=require('crypto');var jsforce=require(_0xb154('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb154('0xb'));var querystring=require('querystring');var Papa=require(_0xb154('0xc'));var Redis=require(_0xb154('0xd'));var authService=require(_0xb154('0xe'));var qs=require(_0xb154('0xf'));var as=require(_0xb154('0x10'));var hardwareService=require(_0xb154('0x11'));var logger=require(_0xb154('0x12'))(_0xb154('0x13'));var utils=require(_0xb154('0x14'));var config=require(_0xb154('0x15'));var licenseUtil=require(_0xb154('0x16'));var db=require(_0xb154('0x17'))['db'];function respondWithStatusCode(_0x1fd3ce,_0x3998e6){_0x3998e6=_0x3998e6||0xcc;return function(_0x3f4903){if(_0x3f4903){return _0x1fd3ce['sendStatus'](_0x3998e6);}return _0x1fd3ce['status'](_0x3998e6)[_0xb154('0x18')]();};}function respondWithResult(_0x3ec6b1,_0x4ac2af){_0x4ac2af=_0x4ac2af||0xc8;return function(_0x2cb2a5){if(_0x2cb2a5){return _0x3ec6b1[_0xb154('0x19')](_0x4ac2af)[_0xb154('0x1a')](_0x2cb2a5);}};}function respondWithFilteredResult(_0x37f314,_0x5b3c95){return function(_0x10f2e8){if(_0x10f2e8){var _0x489c70=typeof _0x5b3c95['offset']==='undefined'&&typeof _0x5b3c95['limit']===_0xb154('0x1b');var _0x490486=_0x10f2e8[_0xb154('0x1c')];var _0xe6c835=_0x489c70?0x0:_0x5b3c95[_0xb154('0x1d')];var _0x37322c=_0x489c70?_0x10f2e8[_0xb154('0x1c')]:_0x5b3c95[_0xb154('0x1d')]+_0x5b3c95['limit'];var _0x576f5d;if(_0x37322c>=_0x490486){_0x37322c=_0x490486;_0x576f5d=0xc8;}else{_0x576f5d=0xce;}_0x37f314[_0xb154('0x19')](_0x576f5d);return _0x37f314[_0xb154('0x1e')]('Content-Range',_0xe6c835+'-'+_0x37322c+'/'+_0x490486)[_0xb154('0x1a')](_0x10f2e8);}return null;};}function patchUpdates(_0x4ff4de){return function(_0x337808){try{jsonpatch[_0xb154('0x1f')](_0x337808,_0x4ff4de,!![]);}catch(_0x265e2e){return BPromise['reject'](_0x265e2e);}return _0x337808[_0xb154('0x20')]();};}function saveUpdates(_0x53b928,_0x1577b1){return function(_0x552b31){if(_0x552b31){return _0x552b31['update'](_0x53b928)[_0xb154('0x21')](function(_0x2e7378){return _0x2e7378;});}return null;};}function removeEntity(_0x15e0a6,_0x156d19){return function(_0x2dc4df){if(_0x2dc4df){return _0x2dc4df[_0xb154('0x22')]()[_0xb154('0x21')](function(){_0x15e0a6[_0xb154('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x328cb1,_0x5b8cdd){return function(_0x3625c9){if(!_0x3625c9){_0x328cb1[_0xb154('0x23')](0x194);}return _0x3625c9;};}function handleError(_0x2ea271,_0x4c103d){_0x4c103d=_0x4c103d||0x1f4;return function(_0x4028fc){logger[_0xb154('0x24')](_0x4028fc[_0xb154('0x25')]);if(_0x4028fc[_0xb154('0x26')]){delete _0x4028fc[_0xb154('0x26')];}_0x2ea271[_0xb154('0x19')](_0x4c103d)['send'](_0x4028fc);};}exports['index']=function(_0x2f561e,_0x371d69){var _0xfdccc5={},_0xd4a7ea={},_0x16add4={'count':0x0,'rows':[]};var _0x4f3de7=_[_0xb154('0x27')](db[_0xb154('0x28')][_0xb154('0x29')],function(_0x3a5aec){return{'name':_0x3a5aec['fieldName'],'type':_0x3a5aec[_0xb154('0x2a')][_0xb154('0x2b')]};});_0xd4a7ea[_0xb154('0x2c')]=_[_0xb154('0x27')](_0x4f3de7,_0xb154('0x26'));_0xd4a7ea['query']=_[_0xb154('0x2d')](_0x2f561e['query']);_0xd4a7ea[_0xb154('0x2e')]=_[_0xb154('0x2f')](_0xd4a7ea[_0xb154('0x2c')],_0xd4a7ea[_0xb154('0x30')]);_0xfdccc5[_0xb154('0x31')]=_['intersection'](_0xd4a7ea[_0xb154('0x2c')],qs[_0xb154('0x32')](_0x2f561e[_0xb154('0x30')][_0xb154('0x32')]));_0xfdccc5[_0xb154('0x31')]=_0xfdccc5['attributes'][_0xb154('0x33')]?_0xfdccc5[_0xb154('0x31')]:_0xd4a7ea[_0xb154('0x2c')];if(!_0x2f561e[_0xb154('0x30')][_0xb154('0x34')](_0xb154('0x35'))){_0xfdccc5[_0xb154('0x36')]=qs[_0xb154('0x36')](_0x2f561e[_0xb154('0x30')][_0xb154('0x36')]);_0xfdccc5[_0xb154('0x1d')]=qs[_0xb154('0x1d')](_0x2f561e[_0xb154('0x30')]['offset']);}_0xfdccc5[_0xb154('0x37')]=qs[_0xb154('0x38')](_0x2f561e[_0xb154('0x30')][_0xb154('0x38')]);_0xfdccc5[_0xb154('0x39')]=qs['filters'](_[_0xb154('0x3a')](_0x2f561e[_0xb154('0x30')],_0xd4a7ea[_0xb154('0x2e')]),_0x4f3de7);if(_0x2f561e[_0xb154('0x30')]['filter']){_0xfdccc5['where']=_[_0xb154('0x3b')](_0xfdccc5[_0xb154('0x39')],{'$or':_[_0xb154('0x27')](_0x4f3de7,function(_0x5ab162){if(_0x5ab162['type']!==_0xb154('0x3c')){var _0x478f74={};_0x478f74[_0x5ab162['name']]={'$like':'%'+_0x2f561e[_0xb154('0x30')]['filter']+'%'};return _0x478f74;}})});}_0xfdccc5=_[_0xb154('0x3b')]({},_0xfdccc5,_0x2f561e[_0xb154('0x3d')]);var _0x2298da={'where':_0xfdccc5['where']};return db[_0xb154('0x28')][_0xb154('0x1c')](_0x2298da)[_0xb154('0x21')](function(_0xb6a2d1){_0x16add4['count']=_0xb6a2d1;if(_0x2f561e[_0xb154('0x30')][_0xb154('0x3e')]){_0xfdccc5['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0xb154('0x3f')](_0xfdccc5);})['then'](function(_0x60cddf){_0x16add4[_0xb154('0x40')]=_0x60cddf;return _0x16add4;})[_0xb154('0x21')](respondWithFilteredResult(_0x371d69,_0xfdccc5))['catch'](handleError(_0x371d69,null));};exports[_0xb154('0x41')]=function(_0xcf889d,_0x234463){var _0x40c3d3={'raw':!![],'where':{'id':_0xcf889d['params']['id']}},_0x40950e={};_0x40950e[_0xb154('0x2c')]=_['keys'](db[_0xb154('0x28')][_0xb154('0x29')]);_0x40950e['query']=_[_0xb154('0x2d')](_0xcf889d['query']);_0x40950e[_0xb154('0x2e')]=_[_0xb154('0x2f')](_0x40950e['model'],_0x40950e[_0xb154('0x30')]);_0x40c3d3['attributes']=_[_0xb154('0x2f')](_0x40950e[_0xb154('0x2c')],qs[_0xb154('0x32')](_0xcf889d[_0xb154('0x30')][_0xb154('0x32')]));_0x40c3d3[_0xb154('0x31')]=_0x40c3d3[_0xb154('0x31')]['length']?_0x40c3d3['attributes']:_0x40950e[_0xb154('0x2c')];if(_0xcf889d[_0xb154('0x30')]['includeAll']){_0x40c3d3[_0xb154('0x42')]=[{'all':!![]}];}_0x40c3d3=_[_0xb154('0x3b')]({},_0x40c3d3,_0xcf889d[_0xb154('0x3d')]);return db[_0xb154('0x28')]['find'](_0x40c3d3)[_0xb154('0x21')](handleEntityNotFound(_0x234463,null))['then'](respondWithResult(_0x234463,null))[_0xb154('0x43')](handleError(_0x234463,null));};exports['create']=function(_0x4db699,_0x3a9e48){return db[_0xb154('0x28')][_0xb154('0x44')](_0x4db699['body'],{})[_0xb154('0x21')](respondWithResult(_0x3a9e48,0xc9))[_0xb154('0x43')](handleError(_0x3a9e48,null));};exports[_0xb154('0x45')]=function(_0x5b1cda,_0x212401){if(_0x5b1cda[_0xb154('0x46')]['id']){delete _0x5b1cda[_0xb154('0x46')]['id'];}return db[_0xb154('0x28')][_0xb154('0x47')]({'where':{'id':_0x5b1cda[_0xb154('0x48')]['id']}})['then'](handleEntityNotFound(_0x212401,null))['then'](saveUpdates(_0x5b1cda[_0xb154('0x46')],null))[_0xb154('0x21')](respondWithResult(_0x212401,null))[_0xb154('0x43')](handleError(_0x212401,null));};exports[_0xb154('0x22')]=function(_0x5ca6ea,_0x1dc20c){return db['OpenchannelApplication'][_0xb154('0x47')]({'where':{'id':_0x5ca6ea[_0xb154('0x48')]['id']}})['then'](handleEntityNotFound(_0x1dc20c,null))[_0xb154('0x21')](removeEntity(_0x1dc20c,null))['catch'](handleError(_0x1dc20c,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index e292a08..d6f5cb8 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 _0xbe63=['moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','util','api'];(function(_0x3c31ca,_0x11d3b6){var _0x1f7e3b=function(_0x5f0ad1){while(--_0x5f0ad1){_0x3c31ca['push'](_0x3c31ca['shift']());}};_0x1f7e3b(++_0x11d3b6);}(_0xbe63,0x15c));var _0x3be6=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xbe63[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0x3be6('0x0'));var util=require(_0x3be6('0x1'));var logger=require('../../config/logger')(_0x3be6('0x2'));var moment=require(_0x3be6('0x3'));var BPromise=require('bluebird');var rp=require(_0x3be6('0x4'));var fs=require('fs');var path=require(_0x3be6('0x5'));var rimraf=require(_0x3be6('0x6'));var config=require(_0x3be6('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0x3be6('0x8')]=function(_0x14a85b,_0x17859f){return _0x14a85b[_0x3be6('0x9')](_0x3be6('0xa'),attributes,{'tableName':_0x3be6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3be6('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe646=['exports','OpenchannelApplication','openchannel_applications','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x8c6eee,_0x21f601){var _0x5a03b5=function(_0x55599d){while(--_0x55599d){_0x8c6eee['push'](_0x8c6eee['shift']());}};_0x5a03b5(++_0x21f601);}(_0xe646,0x125));var _0x6e64=function(_0x2ea624,_0x179c43){_0x2ea624=_0x2ea624-0x0;var _0xb052b6=_0xe646[_0x2ea624];return _0xb052b6;};'use strict';var _=require(_0x6e64('0x0'));var util=require(_0x6e64('0x1'));var logger=require(_0x6e64('0x2'))('api');var moment=require(_0x6e64('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e64('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e64('0x5'));var config=require(_0x6e64('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0x6e64('0x7')]=function(_0x2e0c08,_0x22dfa6){return _0x2e0c08['define'](_0x6e64('0x8'),attributes,{'tableName':_0x6e64('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 2a1dfb6..3992fe7 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 _0xfb72=['catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','limit','then','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb72,0x12c));var _0x2fb7=function(_0x22665a,_0x1668e5){_0x22665a=_0x22665a-0x0;var _0xa1acb3=_0xfb72[_0x22665a];return _0xa1acb3;};'use strict';var _=require('lodash');var util=require(_0x2fb7('0x0'));var moment=require(_0x2fb7('0x1'));var BPromise=require(_0x2fb7('0x2'));var rs=require(_0x2fb7('0x3'));var fs=require('fs');var Redis=require(_0x2fb7('0x4'));var db=require(_0x2fb7('0x5'))['db'];var utils=require(_0x2fb7('0x6'));var logger=require(_0x2fb7('0x7'))(_0x2fb7('0x8'));var config=require(_0x2fb7('0x9'));var jayson=require(_0x2fb7('0xa'));var client=jayson[_0x2fb7('0xb')][_0x2fb7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xff5dd7,_0x24dace,_0x177d1f){return new BPromise(function(_0x4e7cdf,_0x587732){return client['request'](_0xff5dd7,_0x177d1f)['then'](function(_0x24cf5c){logger[_0x2fb7('0xd')](_0x2fb7('0xe'),_0x24dace,'request\x20sent');logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x24dace,_0x2fb7('0xf'),JSON['stringify'](_0x24cf5c));if(_0x24cf5c['error']){if(_0x24cf5c[_0x2fb7('0x10')][_0x2fb7('0x11')]===0x1f4){logger[_0x2fb7('0x10')](_0x2fb7('0xe'),_0x24dace,_0x24cf5c['error'][_0x2fb7('0x12')]);return _0x587732(_0x24cf5c['error'][_0x2fb7('0x12')]);}logger[_0x2fb7('0x10')](_0x2fb7('0xe'),_0x24dace,_0x24cf5c[_0x2fb7('0x10')][_0x2fb7('0x12')]);return _0x4e7cdf(_0x24cf5c['error']['message']);}else{logger['info'](_0x2fb7('0xe'),_0x24dace,'request\x20sent');_0x4e7cdf(_0x24cf5c['result'][_0x2fb7('0x12')]);}})[_0x2fb7('0x13')](function(_0x1c7f38){logger[_0x2fb7('0x10')](_0x2fb7('0xe'),_0x24dace,_0x1c7f38);_0x587732(_0x1c7f38);});});}exports[_0x2fb7('0x14')]=function(_0x543db5){var _0x35a046=this;return new Promise(function(_0x52798e,_0x2e6786){return db[_0x2fb7('0x15')][_0x2fb7('0x16')](_0x543db5[_0x2fb7('0x17')],{'raw':_0x543db5[_0x2fb7('0x18')]?_0x543db5[_0x2fb7('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x543db5[_0x2fb7('0x18')]?_0x543db5[_0x2fb7('0x18')][_0x2fb7('0x19')]||null:null,'attributes':_0x543db5['options']?_0x543db5[_0x2fb7('0x18')]['attributes']||null:null,'limit':_0x543db5[_0x2fb7('0x18')]?_0x543db5[_0x2fb7('0x18')][_0x2fb7('0x1a')]||null:null})[_0x2fb7('0x1b')](function(_0x16172e){logger['info'](_0x2fb7('0x14'),_0x543db5);logger['debug']('UpdateOpenchannelApplication',_0x543db5,JSON[_0x2fb7('0x1c')](_0x16172e));_0x52798e(_0x16172e);})['catch'](function(_0x5b1ad3){logger[_0x2fb7('0x10')]('UpdateOpenchannelApplication',_0x5b1ad3[_0x2fb7('0x12')],_0x543db5);_0x2e6786(_0x35a046[_0x2fb7('0x10')](0x1f4,_0x5b1ad3[_0x2fb7('0x12')]));});});}; \ No newline at end of file +var _0xf36e=['info','OpenchannelApplication,\x20%s,\x20%s','debug','stringify','error','message','result','catch','UpdateOpenchannelApplication','update','options','raw','where','attributes','limit','then','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0xb61c,_0x4b5693){var _0xb0bb56=function(_0x9b1314){while(--_0x9b1314){_0xb61c['push'](_0xb61c['shift']());}};_0xb0bb56(++_0x4b5693);}(_0xf36e,0x139));var _0xef36=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf36e[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xef36('0x0'));var util=require('util');var moment=require(_0xef36('0x1'));var BPromise=require(_0xef36('0x2'));var rs=require(_0xef36('0x3'));var fs=require('fs');var Redis=require(_0xef36('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xef36('0x5'))('rpc');var config=require(_0xef36('0x6'));var jayson=require(_0xef36('0x7'));var client=jayson[_0xef36('0x8')][_0xef36('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2af9bc,_0xc6be50,_0x3b5e0e){return new BPromise(function(_0x524762,_0x18cdd8){return client[_0xef36('0xa')](_0x2af9bc,_0x3b5e0e)['then'](function(_0x1d33ce){logger[_0xef36('0xb')](_0xef36('0xc'),_0xc6be50,'request\x20sent');logger[_0xef36('0xd')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0xc6be50,'request\x20sent',JSON[_0xef36('0xe')](_0x1d33ce));if(_0x1d33ce[_0xef36('0xf')]){if(_0x1d33ce[_0xef36('0xf')]['code']===0x1f4){logger[_0xef36('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0xc6be50,_0x1d33ce[_0xef36('0xf')]['message']);return _0x18cdd8(_0x1d33ce[_0xef36('0xf')][_0xef36('0x10')]);}logger[_0xef36('0xf')](_0xef36('0xc'),_0xc6be50,_0x1d33ce[_0xef36('0xf')][_0xef36('0x10')]);return _0x524762(_0x1d33ce[_0xef36('0xf')][_0xef36('0x10')]);}else{logger[_0xef36('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0xc6be50,'request\x20sent');_0x524762(_0x1d33ce[_0xef36('0x11')][_0xef36('0x10')]);}})[_0xef36('0x12')](function(_0x5a7ebd){logger[_0xef36('0xf')](_0xef36('0xc'),_0xc6be50,_0x5a7ebd);_0x18cdd8(_0x5a7ebd);});});}exports[_0xef36('0x13')]=function(_0x54a220){var _0x559bdb=this;return new Promise(function(_0x3a42c3,_0x4e6103){return db['OpenchannelApplication'][_0xef36('0x14')](_0x54a220['body'],{'raw':_0x54a220[_0xef36('0x15')]?_0x54a220[_0xef36('0x15')][_0xef36('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54a220[_0xef36('0x15')]?_0x54a220[_0xef36('0x15')][_0xef36('0x17')]||null:null,'attributes':_0x54a220[_0xef36('0x15')]?_0x54a220[_0xef36('0x15')][_0xef36('0x18')]||null:null,'limit':_0x54a220[_0xef36('0x15')]?_0x54a220['options'][_0xef36('0x19')]||null:null})[_0xef36('0x1a')](function(_0x5e4922){logger['info'](_0xef36('0x13'),_0x54a220);logger[_0xef36('0xd')]('UpdateOpenchannelApplication',_0x54a220,JSON[_0xef36('0xe')](_0x5e4922));_0x3a42c3(_0x5e4922);})[_0xef36('0x12')](function(_0x29c2e7){logger[_0xef36('0xf')](_0xef36('0x13'),_0x29c2e7[_0xef36('0x10')],_0x54a220);_0x4e6103(_0x559bdb[_0xef36('0xf')](0x1f4,_0x29c2e7[_0xef36('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 8b5dfdc..fc524c9 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 _0x4976=['../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','/describe','/:id','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','path','express','Router','fs-extra'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4976,0x74));var _0x6497=function(_0x5db7b9,_0x2690ec){_0x5db7b9=_0x5db7b9-0x0;var _0x239bb7=_0x4976[_0x5db7b9];return _0x239bb7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6497('0x0'));var timeout=require('connect-timeout');var express=require(_0x6497('0x1'));var router=express[_0x6497('0x2')]();var fs_extra=require(_0x6497('0x3'));var auth=require(_0x6497('0x4'));var interaction=require(_0x6497('0x5'));var config=require('../../config/environment');var controller=require(_0x6497('0x6'));router[_0x6497('0x7')]('/',auth[_0x6497('0x8')](),controller['index']);router[_0x6497('0x7')](_0x6497('0x9'),auth[_0x6497('0x8')](),controller['describe']);router[_0x6497('0x7')](_0x6497('0xa'),auth[_0x6497('0x8')](),controller['show']);router['get'](_0x6497('0xb'),auth['isAuthenticated'](),controller[_0x6497('0xc')]);router[_0x6497('0x7')](_0x6497('0xd'),auth[_0x6497('0x8')](),controller[_0x6497('0xe')]);router['post']('/',auth[_0x6497('0x8')](),controller[_0x6497('0xf')]);router['post'](_0x6497('0xb'),auth[_0x6497('0x8')](),controller[_0x6497('0x10')]);router[_0x6497('0x11')](_0x6497('0x12'),auth['isAuthenticated'](),interaction[_0x6497('0x13')](_0x6497('0x14'),_0x6497('0x15')),controller[_0x6497('0x16')]);router[_0x6497('0x17')](_0x6497('0xa'),auth[_0x6497('0x8')](),interaction['tracked']('openchannel',_0x6497('0x18')),controller[_0x6497('0x19')]);router[_0x6497('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x6497('0x13')](_0x6497('0x14'),_0x6497('0x1b')),controller[_0x6497('0x1c')]);router[_0x6497('0x1a')](_0x6497('0x12'),auth[_0x6497('0x8')](),controller[_0x6497('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xb5d9=['put','openchannelinteraction:update','delete','removeTags','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','show','getMessages','/:id/download','download','create','post','/:id/messages','tracked','openchannel','openchannelinteraction:addtags','addTags'];(function(_0x19ca5c,_0x4d2f1e){var _0x24441b=function(_0x1f8123){while(--_0x1f8123){_0x19ca5c['push'](_0x19ca5c['shift']());}};_0x24441b(++_0x4d2f1e);}(_0xb5d9,0xb9));var _0x9b5d=function(_0x67cb33,_0xe0ae0e){_0x67cb33=_0x67cb33-0x0;var _0x34be41=_0xb5d9[_0x67cb33];return _0x34be41;};'use strict';var multer=require(_0x9b5d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9b5d('0x1'));var express=require('express');var router=express[_0x9b5d('0x2')]();var fs_extra=require(_0x9b5d('0x3'));var auth=require(_0x9b5d('0x4'));var interaction=require(_0x9b5d('0x5'));var config=require(_0x9b5d('0x6'));var controller=require(_0x9b5d('0x7'));router['get']('/',auth[_0x9b5d('0x8')](),controller[_0x9b5d('0x9')]);router['get'](_0x9b5d('0xa'),auth[_0x9b5d('0x8')](),controller[_0x9b5d('0xb')]);router[_0x9b5d('0xc')](_0x9b5d('0xd'),auth[_0x9b5d('0x8')](),controller[_0x9b5d('0xe')]);router['get']('/:id/messages',auth[_0x9b5d('0x8')](),controller[_0x9b5d('0xf')]);router['get'](_0x9b5d('0x10'),auth[_0x9b5d('0x8')](),controller[_0x9b5d('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9b5d('0x12')]);router[_0x9b5d('0x13')](_0x9b5d('0x14'),auth[_0x9b5d('0x8')](),controller['addMessage']);router[_0x9b5d('0x13')]('/:id/tags',auth[_0x9b5d('0x8')](),interaction[_0x9b5d('0x15')](_0x9b5d('0x16'),_0x9b5d('0x17')),controller[_0x9b5d('0x18')]);router[_0x9b5d('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x9b5d('0x15')](_0x9b5d('0x16'),_0x9b5d('0x1a')),controller['update']);router[_0x9b5d('0x1b')](_0x9b5d('0xd'),auth[_0x9b5d('0x8')](),interaction[_0x9b5d('0x15')](_0x9b5d('0x16'),'openchannelinteraction:destroy'),controller['destroy']);router[_0x9b5d('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller[_0x9b5d('0x1c')]);module[_0x9b5d('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 9ee4795..6e6ad1a 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 _0xa25c=['BOOLEAN','DATE','STRING','out','exports'];(function(_0x2353fe,_0x4b0bca){var _0x4d43f6=function(_0x5d0bd9){while(--_0x5d0bd9){_0x2353fe['push'](_0x2353fe['shift']());}};_0x4d43f6(++_0x4b0bca);}(_0xa25c,0x13f));var _0xca25=function(_0x92ad86,_0x3c09c3){_0x92ad86=_0x92ad86-0x0;var _0x188fbb=_0xa25c[_0x92ad86];return _0x188fbb;};'use strict';var Sequelize=require('sequelize');module[_0xca25('0x0')]={'closed':{'type':Sequelize[_0xca25('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xca25('0x2')]},'disposition':{'type':Sequelize[_0xca25('0x3')]},'secondDisposition':{'type':Sequelize[_0xca25('0x3')]},'thirdDisposition':{'type':Sequelize[_0xca25('0x3')]},'note':{'type':Sequelize[_0xca25('0x3')]},'read1stAt':{'type':Sequelize[_0xca25('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xca25('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xca25('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xca25('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xca25('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xca25('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x3613=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x3b9413,_0x49f42d){var _0x241115=function(_0x4c7363){while(--_0x4c7363){_0x3b9413['push'](_0x3b9413['shift']());}};_0x241115(++_0x49f42d);}(_0x3613,0x198));var _0x3361=function(_0x5643c7,_0x2d38df){_0x5643c7=_0x5643c7-0x0;var _0xe13763=_0x3613[_0x5643c7];return _0xe13763;};'use strict';var Sequelize=require(_0x3361('0x0'));module[_0x3361('0x1')]={'closed':{'type':Sequelize[_0x3361('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3361('0x3')]},'disposition':{'type':Sequelize[_0x3361('0x4')]},'secondDisposition':{'type':Sequelize[_0x3361('0x4')]},'thirdDisposition':{'type':Sequelize[_0x3361('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3361('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x3361('0x4')]},'lastMsgAt':{'type':Sequelize[_0x3361('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x3361('0x5')]('in',_0x3361('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x3361('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x3361('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index cfaae29..c23ad23 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 _0xe649=['pipe','createWriteStream','out','System','Contact','read','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','end','offset','undefined','limit','count','json','then','destroy','sendStatus','error','stack','name','send','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','findAll','openchannel','query','catch','from','params','model','keys','filters','attributes','intersection','fields','includeAll','include','options','find','create','body','update','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','order','sort','where','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','merge','rows','addTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','lastName','Attachment','Messages','createdAt','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','closedAt','disposition','threadId','Public','filter','basename','existsSync'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe649,0x18a));var _0x9e64=function(_0x249005,_0x5047ac){_0x249005=_0x249005-0x0;var _0x21b286=_0xe649[_0x249005];return _0x21b286;};'use strict';var rimraf=require(_0x9e64('0x0'));var zipdir=require(_0x9e64('0x1'));var moment=require(_0x9e64('0x2'));var util=require(_0x9e64('0x3'));var path=require(_0x9e64('0x4'));var ejs=require(_0x9e64('0x5'));var fs=require('fs');var _=require(_0x9e64('0x6'));var Redis=require('ioredis');var interaction=require(_0x9e64('0x7'));var qs=require(_0x9e64('0x8'));var pdf=require(_0x9e64('0x9'));var logger=require(_0x9e64('0xa'))(_0x9e64('0xb'));var config=require(_0x9e64('0xc'));var db=require(_0x9e64('0xd'))['db'];config['redis']=_[_0x9e64('0xe')](config[_0x9e64('0xf')],{'host':_0x9e64('0x10'),'port':0x18eb});var socket=require(_0x9e64('0x11'))(new Redis(config[_0x9e64('0xf')]));require('./openchannelInteraction.socket')[_0x9e64('0x12')](socket);function respondWithStatusCode(_0x4b9839,_0x32c710){_0x32c710=_0x32c710||0xcc;return function(_0x3c52e6){if(_0x3c52e6){return _0x4b9839['sendStatus'](_0x32c710);}return _0x4b9839[_0x9e64('0x13')](_0x32c710)[_0x9e64('0x14')]();};}function respondWithResult(_0x53c311,_0x3f85eb){_0x3f85eb=_0x3f85eb||0xc8;return function(_0x375901){if(_0x375901){return _0x53c311[_0x9e64('0x13')](_0x3f85eb)['json'](_0x375901);}};}function respondWithFilteredResult(_0x412316,_0x32dacc){return function(_0x11243f){if(_0x11243f){var _0x53198c=typeof _0x32dacc[_0x9e64('0x15')]===_0x9e64('0x16')&&typeof _0x32dacc[_0x9e64('0x17')]==='undefined';var _0x43ca38=_0x11243f[_0x9e64('0x18')];var _0x4dc875=_0x53198c?0x0:_0x32dacc[_0x9e64('0x15')];var _0x345287=_0x53198c?_0x11243f['count']:_0x32dacc[_0x9e64('0x15')]+_0x32dacc[_0x9e64('0x17')];var _0x3c2b73;if(_0x345287>=_0x43ca38){_0x345287=_0x43ca38;_0x3c2b73=0xc8;}else{_0x3c2b73=0xce;}_0x412316[_0x9e64('0x13')](_0x3c2b73);return _0x412316['set']('Content-Range',_0x4dc875+'-'+_0x345287+'/'+_0x43ca38)[_0x9e64('0x19')](_0x11243f);}return null;};}function saveUpdates(_0x189bb0){return function(_0x392a12){if(_0x392a12){return _0x392a12['update'](_0x189bb0)[_0x9e64('0x1a')](function(_0x416aae){return _0x416aae;});}return null;};}function removeEntity(_0x5d17c5){return function(_0x55cdf4){if(_0x55cdf4){return _0x55cdf4[_0x9e64('0x1b')]()[_0x9e64('0x1a')](function(){_0x5d17c5[_0x9e64('0x13')](0xcc)[_0x9e64('0x14')]();});}};}function handleEntityNotFound(_0x5615b0){return function(_0x41dfd0){if(!_0x41dfd0){_0x5615b0[_0x9e64('0x1c')](0x194);}return _0x41dfd0;};}function handleError(_0x1e0210,_0x199d77){_0x199d77=_0x199d77||0x1f4;return function(_0x3c1ebc){logger[_0x9e64('0x1d')](_0x3c1ebc[_0x9e64('0x1e')]);if(_0x3c1ebc[_0x9e64('0x1f')]){delete _0x3c1ebc[_0x9e64('0x1f')];}_0x1e0210[_0x9e64('0x13')](_0x199d77)[_0x9e64('0x20')](_0x3c1ebc);};}exports[_0x9e64('0x21')]=function(_0x30ce53,_0x453bcb){var _0x1e6c04={};var _0x566bfa=_['map'](db[_0x9e64('0x22')][_0x9e64('0x23')],function(_0x38066d){return{'name':_0x38066d[_0x9e64('0x24')],'type':_0x38066d[_0x9e64('0x25')][_0x9e64('0x26')]};});_0x1e6c04=qs['getOptions'](_0x566bfa,_0x30ce53);return interaction[_0x9e64('0x27')](_0x9e64('0x28'),_0x30ce53[_0x9e64('0x29')],_0x30ce53['user'],_0x1e6c04,_0x566bfa)[_0x9e64('0x1a')](respondWithFilteredResult(_0x453bcb,_0x1e6c04))[_0x9e64('0x2a')](handleError(_0x453bcb,null));};exports['show']=function(_0x5df9c0,_0x4a45dd){var _0x7d0a56={};if(_0x5df9c0[_0x9e64('0x29')]['type']&&_0x5df9c0[_0x9e64('0x29')]['type']===_0x9e64('0x2b')){_0x7d0a56[_0x9e64('0x2b')]=_0x5df9c0[_0x9e64('0x2c')]['id'];}else{_0x7d0a56['id']=_0x5df9c0[_0x9e64('0x2c')]['id'];}var _0x392d1c={'raw':![],'where':_0x7d0a56},_0x22f34c={};_0x22f34c[_0x9e64('0x2d')]=_['keys'](db[_0x9e64('0x22')][_0x9e64('0x23')]);_0x22f34c[_0x9e64('0x29')]=_[_0x9e64('0x2e')](_0x5df9c0[_0x9e64('0x29')]);_0x22f34c[_0x9e64('0x2f')]=_['intersection'](_0x22f34c[_0x9e64('0x2d')],_0x22f34c[_0x9e64('0x29')]);_0x392d1c[_0x9e64('0x30')]=_[_0x9e64('0x31')](_0x22f34c[_0x9e64('0x2d')],qs[_0x9e64('0x32')](_0x5df9c0[_0x9e64('0x29')][_0x9e64('0x32')]));_0x392d1c[_0x9e64('0x30')]=_0x392d1c[_0x9e64('0x30')]['length']?_0x392d1c[_0x9e64('0x30')]:_0x22f34c[_0x9e64('0x2d')];if(_0x5df9c0[_0x9e64('0x29')][_0x9e64('0x33')]){_0x392d1c[_0x9e64('0x34')]=[{'all':!![]}];}_0x392d1c=_['merge']({},_0x392d1c,_0x5df9c0[_0x9e64('0x35')]);return db[_0x9e64('0x22')][_0x9e64('0x36')](_0x392d1c)[_0x9e64('0x1a')](handleEntityNotFound(_0x4a45dd,null))[_0x9e64('0x1a')](respondWithResult(_0x4a45dd,null))['catch'](handleError(_0x4a45dd,null));};exports[_0x9e64('0x37')]=function(_0x40d5d4,_0x9ce725){return db[_0x9e64('0x22')][_0x9e64('0x37')](_0x40d5d4[_0x9e64('0x38')],{})[_0x9e64('0x1a')](respondWithResult(_0x9ce725,0xc9))[_0x9e64('0x2a')](handleError(_0x9ce725,null));};exports[_0x9e64('0x39')]=function(_0xa11a1f,_0x133461){if(_0xa11a1f[_0x9e64('0x38')]['id']){delete _0xa11a1f[_0x9e64('0x38')]['id'];}return db[_0x9e64('0x22')]['find']({'where':{'id':_0xa11a1f['params']['id']}})[_0x9e64('0x1a')](handleEntityNotFound(_0x133461,null))[_0x9e64('0x1a')](saveUpdates(_0xa11a1f[_0x9e64('0x38')],null))[_0x9e64('0x1a')](respondWithResult(_0x133461,null))[_0x9e64('0x2a')](handleError(_0x133461,null));};exports[_0x9e64('0x1b')]=function(_0x2a9bec,_0x4ffc33){return db['OpenchannelInteraction']['find']({'where':{'id':_0x2a9bec[_0x9e64('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4ffc33,null))[_0x9e64('0x1a')](removeEntity(_0x4ffc33,null))[_0x9e64('0x2a')](handleError(_0x4ffc33,null));};exports[_0x9e64('0x3a')]=function(_0x3dfd07,_0x64eb71){return db[_0x9e64('0x22')][_0x9e64('0x3a')]()[_0x9e64('0x1a')](respondWithResult(_0x64eb71,null))[_0x9e64('0x2a')](handleError(_0x64eb71,null));};exports['addMessage']=function(_0x7400dd,_0x3424a0){return db[_0x9e64('0x3b')]['find']({'where':{'id':_0x7400dd[_0x9e64('0x2c')]['id']}})[_0x9e64('0x1a')](handleEntityNotFound(_0x3424a0,null))[_0x9e64('0x1a')](function(_0x53710c){if(_0x53710c){return _0x53710c[_0x9e64('0x3c')](_0x7400dd[_0x9e64('0x38')][_0x9e64('0x3d')],_[_0x9e64('0x3e')](_0x7400dd['body'],['ids','id'])||{});}})[_0x9e64('0x1a')](respondWithResult(_0x3424a0,null))[_0x9e64('0x2a')](handleError(_0x3424a0,null));};exports[_0x9e64('0x3f')]=function(_0x36b694,_0xeacd34){var _0x5cf660={'raw':![],'where':{}};var _0x27b28a={};var _0x516343={'count':0x0,'rows':[]};return db[_0x9e64('0x22')][_0x9e64('0x40')]({'where':{'id':_0x36b694[_0x9e64('0x2c')]['id']}})[_0x9e64('0x1a')](handleEntityNotFound(_0xeacd34,null))[_0x9e64('0x1a')](function(_0xa363c7){if(_0xa363c7){_0x27b28a['model']=_[_0x9e64('0x2e')](db[_0x9e64('0x3b')][_0x9e64('0x23')]);_0x27b28a[_0x9e64('0x29')]=_[_0x9e64('0x2e')](_0x36b694[_0x9e64('0x29')]);_0x27b28a['filters']=_[_0x9e64('0x31')](_0x27b28a[_0x9e64('0x2d')],_0x27b28a[_0x9e64('0x29')]);_0x5cf660[_0x9e64('0x30')]=_['intersection'](_0x27b28a[_0x9e64('0x2d')],qs[_0x9e64('0x32')](_0x36b694[_0x9e64('0x29')]['fields']));_0x5cf660[_0x9e64('0x30')]=_0x5cf660[_0x9e64('0x30')]['length']?_0x5cf660[_0x9e64('0x30')]:_0x27b28a[_0x9e64('0x2d')];if(!_0x36b694['query'][_0x9e64('0x41')]('nolimit')){_0x5cf660[_0x9e64('0x17')]=qs['limit'](_0x36b694[_0x9e64('0x29')]['limit']);_0x5cf660['offset']=qs[_0x9e64('0x15')](_0x36b694[_0x9e64('0x29')][_0x9e64('0x15')]);}_0x5cf660[_0x9e64('0x42')]=qs[_0x9e64('0x43')](_0x36b694[_0x9e64('0x29')]['sort']);_0x5cf660[_0x9e64('0x44')]=qs[_0x9e64('0x2f')](_['pick'](_0x36b694['query'],_0x27b28a[_0x9e64('0x2f')]));_0x5cf660[_0x9e64('0x44')]['OpenchannelInteractionId']=_0xa363c7['id'];if(_0x36b694[_0x9e64('0x29')]['filter']){_0x5cf660[_0x9e64('0x44')]=_['merge'](_0x5cf660[_0x9e64('0x44')],{'$or':_[_0x9e64('0x45')](_0x5cf660['attributes'],function(_0x25f3cb){var _0x54413d={};_0x54413d[_0x25f3cb]={'$like':'%'+_0x36b694[_0x9e64('0x29')]['filter']+'%'};return _0x54413d;})});}if(_0x36b694[_0x9e64('0x29')][_0x9e64('0x46')]){var _0x1638fd=_0x36b694[_0x9e64('0x29')][_0x9e64('0x46')]['split'](',');var _0x343672={};_0x343672[_0x1638fd[0x0]]={'$gte':moment(_0x1638fd[0x1])[_0x9e64('0x47')](_0x9e64('0x48'))};_0x5cf660[_0x9e64('0x44')]=_[_0x9e64('0x49')](_0x5cf660[_0x9e64('0x44')],_0x343672);}_0x5cf660=_[_0x9e64('0x49')]({},_0x5cf660,_0x36b694[_0x9e64('0x35')]);return db['OpenchannelMessage'][_0x9e64('0x18')]({'where':_0x5cf660[_0x9e64('0x44')]})[_0x9e64('0x1a')](function(_0x319ea9){_0x516343[_0x9e64('0x18')]=_0x319ea9;if(_0x36b694['query'][_0x9e64('0x33')]){_0x5cf660['include']=[{'all':!![]}];}return db[_0x9e64('0x3b')][_0x9e64('0x27')](_0x5cf660);})[_0x9e64('0x1a')](function(_0x2200cc){_0x516343[_0x9e64('0x4a')]=_0x2200cc;return _0x516343;});}})[_0x9e64('0x1a')](respondWithFilteredResult(_0xeacd34,_0x5cf660))['catch'](handleError(_0xeacd34,null));};exports[_0x9e64('0x4b')]=function(_0x3fc0e9,_0x4d86e4){return db[_0x9e64('0x22')]['find']({'where':{'id':_0x3fc0e9[_0x9e64('0x2c')]['id']}})[_0x9e64('0x1a')](handleEntityNotFound(_0x4d86e4,null))[_0x9e64('0x1a')](function(_0x402975){if(_0x402975){return _0x402975['setTags'](_0x3fc0e9['body']['ids'],_[_0x9e64('0x3e')](_0x3fc0e9['body'],[_0x9e64('0x3d'),'id'])||{})['spread'](function(){return db[_0x9e64('0x4c')][_0x9e64('0x27')]({'attributes':['id',_0x9e64('0x1f'),_0x9e64('0x4d')],'where':{'id':_0x3fc0e9[_0x9e64('0x38')][_0x9e64('0x3d')]}});})[_0x9e64('0x1a')](function(_0x17e7ab){socket[_0x9e64('0x4e')](_0x9e64('0x4f'),{'id':Number(_0x3fc0e9['params']['id']),'tags':_0x17e7ab||[]});return{'id':Number(_0x3fc0e9['params']['id']),'tags':_0x17e7ab||[]};});}})[_0x9e64('0x1a')](respondWithResult(_0x4d86e4,null))[_0x9e64('0x2a')](handleError(_0x4d86e4,null));};exports['removeTags']=function(_0x48bef4,_0x22f4f4){return db[_0x9e64('0x22')]['find']({'where':{'id':_0x48bef4[_0x9e64('0x2c')]['id']}})[_0x9e64('0x1a')](handleEntityNotFound(_0x22f4f4,null))[_0x9e64('0x1a')](function(_0x5316a5){if(_0x5316a5){return _0x5316a5[_0x9e64('0x50')](_0x48bef4['query'][_0x9e64('0x3d')]);}})[_0x9e64('0x1a')](respondWithStatusCode(_0x22f4f4,null))[_0x9e64('0x2a')](handleError(_0x22f4f4,null));};exports[_0x9e64('0x51')]=function(_0x473b2b,_0x2632d2){var _0x5b1149=moment()[_0x9e64('0x52')]()[_0x9e64('0x53')]();var _0x12811d=path[_0x9e64('0x54')](config[_0x9e64('0x55')],'server',_0x9e64('0x56'),_0x9e64('0x57'));var _0x7195a1=path[_0x9e64('0x54')](config[_0x9e64('0x55')],_0x9e64('0x58'),_0x9e64('0x56'),_0x9e64('0x59'));var _0x518a71=path[_0x9e64('0x54')](_0x12811d,_0x5b1149);var _0x5ac678=util[_0x9e64('0x47')](_0x9e64('0x5a'),_0x473b2b['params']['id'],_0x5b1149);var _0x46aa93=path['join'](_0x12811d,_0x5ac678);var _0x51b3e3=[];_0x51b3e3[_0x9e64('0x5b')]({'model':db[_0x9e64('0x5c')],'as':_0x9e64('0x5c'),'attributes':['id',_0x9e64('0x5d')],'raw':!![]});_0x51b3e3[_0x9e64('0x5b')]({'model':db[_0x9e64('0x5e')],'as':'Contact','attributes':['id','firstName',_0x9e64('0x5f')],'raw':!![]});if(_0x473b2b[_0x9e64('0x29')]['attachments']){_0x51b3e3[_0x9e64('0x5b')]({'model':db[_0x9e64('0x60')],'as':_0x9e64('0x60'),'raw':!![]});}var _0x58040c=[{'model':db[_0x9e64('0x3b')],'as':_0x9e64('0x61'),'attributes':['id','body',_0x9e64('0x62'),_0x9e64('0x63'),_0x9e64('0x64'),'read'],'include':_0x51b3e3}];_0x58040c[_0x9e64('0x5b')]({'model':db[_0x9e64('0x65')],'as':_0x9e64('0x66'),'attributes':['id',_0x9e64('0x1f')]});_0x58040c[_0x9e64('0x5b')]({'model':db[_0x9e64('0x5c')],'as':_0x9e64('0x67'),'attributes':['id',_0x9e64('0x5d')]});return db[_0x9e64('0x22')]['find']({'where':{'id':_0x473b2b[_0x9e64('0x2c')]['id']},'include':_0x58040c})[_0x9e64('0x1a')](handleEntityNotFound(_0x2632d2,null))[_0x9e64('0x1a')](function(_0x2e5032){if(_0x2e5032){var _0x35d8fc=_0x2e5032[_0x9e64('0x68')]({'plain':!![]});fs[_0x9e64('0x69')](_0x518a71);var _0xe99d40={'channel':_0x9e64('0x6a'),'account':_0x35d8fc[_0x9e64('0x66')][_0x9e64('0x1f')],'agent':_0x35d8fc['Owner']?_0x35d8fc[_0x9e64('0x67')][_0x9e64('0x5d')]:'N.A.','createdAt':moment(_0x35d8fc['createdAt'])[_0x9e64('0x47')](_0x9e64('0x48'))[_0x9e64('0x53')](),'closedAt':_0x35d8fc['closed']?moment(_0x35d8fc[_0x9e64('0x6b')])[_0x9e64('0x47')](_0x9e64('0x48'))['toString']():'','disposition':_0x35d8fc[_0x9e64('0x6c')],'visibility':_0x35d8fc[_0x9e64('0x6d')]?_0x9e64('0x6e'):'Private','messages':_(_0x35d8fc[_0x9e64('0x61')])[_0x9e64('0x6f')]({'secret':![]})[_0x9e64('0x45')](function(_0x527286){if(_0x527286[_0x9e64('0x60')]){var _0x6413ec=path[_0x9e64('0x54')](_0x7195a1,_0x527286[_0x9e64('0x60')][_0x9e64('0x70')]);if(fs[_0x9e64('0x71')](_0x6413ec)){fs['createReadStream'](_0x6413ec)[_0x9e64('0x72')](fs[_0x9e64('0x73')](path[_0x9e64('0x54')](_0x518a71,_0x527286[_0x9e64('0x60')]['basename'])));}}return{'date':moment(_0x527286[_0x9e64('0x62')])['format'](_0x9e64('0x48'))[_0x9e64('0x53')](),'sender':_0x527286['direction']===_0x9e64('0x74')?_0x527286['User']?_0x527286['User'][_0x9e64('0x5d')]:_0x9e64('0x75'):_0x527286[_0x9e64('0x76')]['firstName']+(_0x527286[_0x9e64('0x76')]['lastName']?'\x20'+_0x527286['Contact']['lastName']:''),'body':_0x527286[_0x9e64('0x60')]?_0x527286['Attachment'][_0x9e64('0x70')]:_0x527286[_0x9e64('0x38')],'direction':_0x527286[_0x9e64('0x63')]===_0x9e64('0x74')?'A':'C','secret':_0x527286[_0x9e64('0x64')],'read':_0x527286[_0x9e64('0x77')],'attachment':_0x527286[_0x9e64('0x60')]};})[_0x9e64('0x78')]()};return ejs[_0x9e64('0x79')](path[_0x9e64('0x54')](config[_0x9e64('0x55')],_0x9e64('0x58'),'views',_0x9e64('0x7a')),{'interaction':_0xe99d40})[_0x9e64('0x1a')](function(_0x5ee1e6){var _0x1a1882=path[_0x9e64('0x54')](_0x518a71,_0x9e64('0x7b')+_0x35d8fc['id']+'-'+_0x5b1149+_0x9e64('0x7c'));var _0x3e086a={'path':_0x1a1882,'channel':'Openchannel','interactionId':_0x35d8fc['id']};return pdf[_0x9e64('0x7d')](_0x5ee1e6,_0x3e086a);})[_0x9e64('0x1a')](function(){return new Promise(function(_0x5ab91d,_0x446e69){zipdir(_0x518a71,{'saveTo':_0x46aa93},function(_0x599bd3,_0x24c297){if(_0x599bd3)return _0x446e69(_0x599bd3);return _0x5ab91d(_0x24c297);});})[_0x9e64('0x1a')](function(){return new Promise(function(_0x3df97c,_0xe22301){rimraf(_0x518a71,function(_0x506d69){if(_0x506d69)_0xe22301(_0x506d69);return _0x3df97c();});});})[_0x9e64('0x1a')](function(){return _0x2632d2['download'](_0x46aa93,_0x5ac678,function(_0x46850d){if(_0x46850d){logger[_0x9e64('0x1d')]('Unable\x20to\x20delete\x20zip\x20file',_0x46850d);}else{fs[_0x9e64('0x7e')](_0x46aa93);}});});});}else{return _0x2632d2[_0x9e64('0x1c')](0xc8);}})[_0x9e64('0x2a')](handleError(_0x2632d2,null));}; \ No newline at end of file +var _0x3f76=['where','pick','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','Tag','color','openchannelInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','read','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','out','System','secret','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','rimraf','zip-dir','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','update','then','error','name','send','map','fieldName','type','key','findAll','openchannel','user','catch','show','query','from','params','model','keys','OpenchannelInteraction','rawAttributes','filters','intersection','attributes','fields','includeAll','merge','options','find','create','body','destroy','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','length','hasOwnProperty','nolimit','sort'];(function(_0x58f776,_0x548e89){var _0x538c43=function(_0x381c6c){while(--_0x381c6c){_0x58f776['push'](_0x58f776['shift']());}};_0x538c43(++_0x548e89);}(_0x3f76,0x13c));var _0x63f7=function(_0x21314a,_0x42a02f){_0x21314a=_0x21314a-0x0;var _0x5c4fd6=_0x3f76[_0x21314a];return _0x5c4fd6;};'use strict';var rimraf=require(_0x63f7('0x0'));var zipdir=require(_0x63f7('0x1'));var moment=require('moment');var util=require(_0x63f7('0x2'));var path=require(_0x63f7('0x3'));var ejs=require(_0x63f7('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x63f7('0x5'));var qs=require(_0x63f7('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x63f7('0x7'))(_0x63f7('0x8'));var config=require(_0x63f7('0x9'));var db=require(_0x63f7('0xa'))['db'];config['redis']=_['defaults'](config[_0x63f7('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x63f7('0xc'))(new Redis(config['redis']));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x323070,_0x2a609c){_0x2a609c=_0x2a609c||0xcc;return function(_0x57425b){if(_0x57425b){return _0x323070[_0x63f7('0xd')](_0x2a609c);}return _0x323070['status'](_0x2a609c)['end']();};}function respondWithResult(_0x336af7,_0x265473){_0x265473=_0x265473||0xc8;return function(_0xede2c0){if(_0xede2c0){return _0x336af7[_0x63f7('0xe')](_0x265473)[_0x63f7('0xf')](_0xede2c0);}};}function respondWithFilteredResult(_0xffaf07,_0x5a1cce){return function(_0x3eb819){if(_0x3eb819){var _0x25e495=typeof _0x5a1cce['offset']==='undefined'&&typeof _0x5a1cce[_0x63f7('0x10')]===_0x63f7('0x11');var _0x46a673=_0x3eb819[_0x63f7('0x12')];var _0x13439a=_0x25e495?0x0:_0x5a1cce[_0x63f7('0x13')];var _0x18d718=_0x25e495?_0x3eb819[_0x63f7('0x12')]:_0x5a1cce[_0x63f7('0x13')]+_0x5a1cce['limit'];var _0x5665cf;if(_0x18d718>=_0x46a673){_0x18d718=_0x46a673;_0x5665cf=0xc8;}else{_0x5665cf=0xce;}_0xffaf07['status'](_0x5665cf);return _0xffaf07[_0x63f7('0x14')](_0x63f7('0x15'),_0x13439a+'-'+_0x18d718+'/'+_0x46a673)[_0x63f7('0xf')](_0x3eb819);}return null;};}function saveUpdates(_0x1df2a4){return function(_0x1923e9){if(_0x1923e9){return _0x1923e9[_0x63f7('0x16')](_0x1df2a4)[_0x63f7('0x17')](function(_0x56c926){return _0x56c926;});}return null;};}function removeEntity(_0x155b70){return function(_0x2f2b61){if(_0x2f2b61){return _0x2f2b61['destroy']()['then'](function(){_0x155b70[_0x63f7('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20bb29){return function(_0x72c8f0){if(!_0x72c8f0){_0x20bb29['sendStatus'](0x194);}return _0x72c8f0;};}function handleError(_0x29b2d8,_0x3a8181){_0x3a8181=_0x3a8181||0x1f4;return function(_0x3049a9){logger[_0x63f7('0x18')](_0x3049a9['stack']);if(_0x3049a9[_0x63f7('0x19')]){delete _0x3049a9[_0x63f7('0x19')];}_0x29b2d8[_0x63f7('0xe')](_0x3a8181)[_0x63f7('0x1a')](_0x3049a9);};}exports['index']=function(_0xdf77b9,_0x552dd8){var _0x4c6513={};var _0x3681d7=_[_0x63f7('0x1b')](db['OpenchannelInteraction']['rawAttributes'],function(_0x5ec2b5){return{'name':_0x5ec2b5[_0x63f7('0x1c')],'type':_0x5ec2b5[_0x63f7('0x1d')][_0x63f7('0x1e')]};});_0x4c6513=qs['getOptions'](_0x3681d7,_0xdf77b9);return interaction[_0x63f7('0x1f')](_0x63f7('0x20'),_0xdf77b9['query'],_0xdf77b9[_0x63f7('0x21')],_0x4c6513,_0x3681d7)[_0x63f7('0x17')](respondWithFilteredResult(_0x552dd8,_0x4c6513))[_0x63f7('0x22')](handleError(_0x552dd8,null));};exports[_0x63f7('0x23')]=function(_0x3d3323,_0x13899a){var _0x3d4786={};if(_0x3d3323[_0x63f7('0x24')][_0x63f7('0x1d')]&&_0x3d3323[_0x63f7('0x24')][_0x63f7('0x1d')]===_0x63f7('0x25')){_0x3d4786[_0x63f7('0x25')]=_0x3d3323['params']['id'];}else{_0x3d4786['id']=_0x3d3323[_0x63f7('0x26')]['id'];}var _0x5ec016={'raw':![],'where':_0x3d4786},_0x3b24b4={};_0x3b24b4[_0x63f7('0x27')]=_[_0x63f7('0x28')](db[_0x63f7('0x29')][_0x63f7('0x2a')]);_0x3b24b4['query']=_['keys'](_0x3d3323['query']);_0x3b24b4[_0x63f7('0x2b')]=_[_0x63f7('0x2c')](_0x3b24b4[_0x63f7('0x27')],_0x3b24b4[_0x63f7('0x24')]);_0x5ec016[_0x63f7('0x2d')]=_['intersection'](_0x3b24b4[_0x63f7('0x27')],qs[_0x63f7('0x2e')](_0x3d3323[_0x63f7('0x24')][_0x63f7('0x2e')]));_0x5ec016[_0x63f7('0x2d')]=_0x5ec016[_0x63f7('0x2d')]['length']?_0x5ec016[_0x63f7('0x2d')]:_0x3b24b4[_0x63f7('0x27')];if(_0x3d3323[_0x63f7('0x24')][_0x63f7('0x2f')]){_0x5ec016['include']=[{'all':!![]}];}_0x5ec016=_[_0x63f7('0x30')]({},_0x5ec016,_0x3d3323[_0x63f7('0x31')]);return db[_0x63f7('0x29')][_0x63f7('0x32')](_0x5ec016)[_0x63f7('0x17')](handleEntityNotFound(_0x13899a,null))[_0x63f7('0x17')](respondWithResult(_0x13899a,null))[_0x63f7('0x22')](handleError(_0x13899a,null));};exports['create']=function(_0x2bd4e4,_0xbd5efc){return db[_0x63f7('0x29')][_0x63f7('0x33')](_0x2bd4e4['body'],{})[_0x63f7('0x17')](respondWithResult(_0xbd5efc,0xc9))[_0x63f7('0x22')](handleError(_0xbd5efc,null));};exports[_0x63f7('0x16')]=function(_0x2a0eed,_0x173598){if(_0x2a0eed['body']['id']){delete _0x2a0eed['body']['id'];}return db[_0x63f7('0x29')][_0x63f7('0x32')]({'where':{'id':_0x2a0eed[_0x63f7('0x26')]['id']}})['then'](handleEntityNotFound(_0x173598,null))['then'](saveUpdates(_0x2a0eed[_0x63f7('0x34')],null))['then'](respondWithResult(_0x173598,null))[_0x63f7('0x22')](handleError(_0x173598,null));};exports[_0x63f7('0x35')]=function(_0x775265,_0x5311f0){return db[_0x63f7('0x29')]['find']({'where':{'id':_0x775265[_0x63f7('0x26')]['id']}})['then'](handleEntityNotFound(_0x5311f0,null))[_0x63f7('0x17')](removeEntity(_0x5311f0,null))[_0x63f7('0x22')](handleError(_0x5311f0,null));};exports[_0x63f7('0x36')]=function(_0xeb1a66,_0x428ed6){return db[_0x63f7('0x29')][_0x63f7('0x36')]()[_0x63f7('0x17')](respondWithResult(_0x428ed6,null))[_0x63f7('0x22')](handleError(_0x428ed6,null));};exports[_0x63f7('0x37')]=function(_0x34bb0d,_0x42b33f){return db['OpenchannelMessage'][_0x63f7('0x32')]({'where':{'id':_0x34bb0d[_0x63f7('0x26')]['id']}})[_0x63f7('0x17')](handleEntityNotFound(_0x42b33f,null))[_0x63f7('0x17')](function(_0x418579){if(_0x418579){return _0x418579['addMessage'](_0x34bb0d['body'][_0x63f7('0x38')],_[_0x63f7('0x39')](_0x34bb0d[_0x63f7('0x34')],[_0x63f7('0x38'),'id'])||{});}})[_0x63f7('0x17')](respondWithResult(_0x42b33f,null))['catch'](handleError(_0x42b33f,null));};exports[_0x63f7('0x3a')]=function(_0x4a850a,_0x33c354){var _0x178b24={'raw':![],'where':{}};var _0x519a4c={};var _0x37c2de={'count':0x0,'rows':[]};return db[_0x63f7('0x29')][_0x63f7('0x3b')]({'where':{'id':_0x4a850a[_0x63f7('0x26')]['id']}})['then'](handleEntityNotFound(_0x33c354,null))[_0x63f7('0x17')](function(_0xd637fb){if(_0xd637fb){_0x519a4c['model']=_['keys'](db[_0x63f7('0x3c')]['rawAttributes']);_0x519a4c[_0x63f7('0x24')]=_[_0x63f7('0x28')](_0x4a850a['query']);_0x519a4c[_0x63f7('0x2b')]=_[_0x63f7('0x2c')](_0x519a4c['model'],_0x519a4c[_0x63f7('0x24')]);_0x178b24[_0x63f7('0x2d')]=_['intersection'](_0x519a4c[_0x63f7('0x27')],qs[_0x63f7('0x2e')](_0x4a850a[_0x63f7('0x24')]['fields']));_0x178b24[_0x63f7('0x2d')]=_0x178b24[_0x63f7('0x2d')][_0x63f7('0x3d')]?_0x178b24[_0x63f7('0x2d')]:_0x519a4c[_0x63f7('0x27')];if(!_0x4a850a['query'][_0x63f7('0x3e')](_0x63f7('0x3f'))){_0x178b24['limit']=qs[_0x63f7('0x10')](_0x4a850a[_0x63f7('0x24')][_0x63f7('0x10')]);_0x178b24[_0x63f7('0x13')]=qs[_0x63f7('0x13')](_0x4a850a[_0x63f7('0x24')][_0x63f7('0x13')]);}_0x178b24['order']=qs[_0x63f7('0x40')](_0x4a850a[_0x63f7('0x24')][_0x63f7('0x40')]);_0x178b24[_0x63f7('0x41')]=qs['filters'](_[_0x63f7('0x42')](_0x4a850a[_0x63f7('0x24')],_0x519a4c[_0x63f7('0x2b')]));_0x178b24[_0x63f7('0x41')]['OpenchannelInteractionId']=_0xd637fb['id'];if(_0x4a850a[_0x63f7('0x24')]['filter']){_0x178b24[_0x63f7('0x41')]=_[_0x63f7('0x30')](_0x178b24['where'],{'$or':_['map'](_0x178b24[_0x63f7('0x2d')],function(_0x3d0cb3){var _0x302fe3={};_0x302fe3[_0x3d0cb3]={'$like':'%'+_0x4a850a[_0x63f7('0x24')][_0x63f7('0x43')]+'%'};return _0x302fe3;})});}if(_0x4a850a[_0x63f7('0x24')]['$gte']){var _0x5adea8=_0x4a850a[_0x63f7('0x24')][_0x63f7('0x44')]['split'](',');var _0x3f6eb5={};_0x3f6eb5[_0x5adea8[0x0]]={'$gte':moment(_0x5adea8[0x1])[_0x63f7('0x45')](_0x63f7('0x46'))};_0x178b24[_0x63f7('0x41')]=_[_0x63f7('0x30')](_0x178b24['where'],_0x3f6eb5);}_0x178b24=_['merge']({},_0x178b24,_0x4a850a[_0x63f7('0x31')]);return db['OpenchannelMessage'][_0x63f7('0x12')]({'where':_0x178b24['where']})[_0x63f7('0x17')](function(_0x40d32c){_0x37c2de['count']=_0x40d32c;if(_0x4a850a['query'][_0x63f7('0x2f')]){_0x178b24[_0x63f7('0x47')]=[{'all':!![]}];}return db[_0x63f7('0x3c')][_0x63f7('0x1f')](_0x178b24);})[_0x63f7('0x17')](function(_0x21c56b){_0x37c2de[_0x63f7('0x48')]=_0x21c56b;return _0x37c2de;});}})[_0x63f7('0x17')](respondWithFilteredResult(_0x33c354,_0x178b24))[_0x63f7('0x22')](handleError(_0x33c354,null));};exports[_0x63f7('0x49')]=function(_0x1f8f54,_0x4ade3){return db[_0x63f7('0x29')][_0x63f7('0x32')]({'where':{'id':_0x1f8f54[_0x63f7('0x26')]['id']}})[_0x63f7('0x17')](handleEntityNotFound(_0x4ade3,null))['then'](function(_0x44deee){if(_0x44deee){return _0x44deee[_0x63f7('0x4a')](_0x1f8f54['body'][_0x63f7('0x38')],_['omit'](_0x1f8f54[_0x63f7('0x34')],['ids','id'])||{})[_0x63f7('0x4b')](function(){return db[_0x63f7('0x4c')][_0x63f7('0x1f')]({'attributes':['id','name',_0x63f7('0x4d')],'where':{'id':_0x1f8f54[_0x63f7('0x34')][_0x63f7('0x38')]}});})[_0x63f7('0x17')](function(_0x3acd6f){socket['emit'](_0x63f7('0x4e'),{'id':Number(_0x1f8f54[_0x63f7('0x26')]['id']),'tags':_0x3acd6f||[]});return{'id':Number(_0x1f8f54[_0x63f7('0x26')]['id']),'tags':_0x3acd6f||[]};});}})[_0x63f7('0x17')](respondWithResult(_0x4ade3,null))[_0x63f7('0x22')](handleError(_0x4ade3,null));};exports[_0x63f7('0x4f')]=function(_0x2f6f86,_0x55c8a7){return db['OpenchannelInteraction']['find']({'where':{'id':_0x2f6f86[_0x63f7('0x26')]['id']}})[_0x63f7('0x17')](handleEntityNotFound(_0x55c8a7,null))['then'](function(_0x4f4f64){if(_0x4f4f64){return _0x4f4f64['removeTags'](_0x2f6f86['query'][_0x63f7('0x38')]);}})[_0x63f7('0x17')](respondWithStatusCode(_0x55c8a7,null))['catch'](handleError(_0x55c8a7,null));};exports[_0x63f7('0x50')]=function(_0x53754c,_0x195a26){var _0x5c1eba=moment()[_0x63f7('0x51')]()[_0x63f7('0x52')]();var _0x45e23f=path[_0x63f7('0x53')](config['root'],_0x63f7('0x54'),_0x63f7('0x55'),_0x63f7('0x56'));var _0x22019c=path[_0x63f7('0x53')](config[_0x63f7('0x57')],_0x63f7('0x54'),_0x63f7('0x55'),_0x63f7('0x58'));var _0x1d350b=path['join'](_0x45e23f,_0x5c1eba);var _0x214215=util[_0x63f7('0x45')](_0x63f7('0x59'),_0x53754c[_0x63f7('0x26')]['id'],_0x5c1eba);var _0x44db8b=path['join'](_0x45e23f,_0x214215);var _0x155c71=[];_0x155c71[_0x63f7('0x5a')]({'model':db['User'],'as':_0x63f7('0x5b'),'attributes':['id',_0x63f7('0x5c')],'raw':!![]});_0x155c71['push']({'model':db['CmContact'],'as':_0x63f7('0x5d'),'attributes':['id',_0x63f7('0x5e'),_0x63f7('0x5f')],'raw':!![]});if(_0x53754c[_0x63f7('0x24')][_0x63f7('0x58')]){_0x155c71[_0x63f7('0x5a')]({'model':db[_0x63f7('0x60')],'as':'Attachment','raw':!![]});}var _0x27298d=[{'model':db['OpenchannelMessage'],'as':_0x63f7('0x61'),'attributes':['id',_0x63f7('0x34'),_0x63f7('0x62'),_0x63f7('0x63'),'secret',_0x63f7('0x64')],'include':_0x155c71}];_0x27298d[_0x63f7('0x5a')]({'model':db[_0x63f7('0x65')],'as':_0x63f7('0x66'),'attributes':['id',_0x63f7('0x19')]});_0x27298d[_0x63f7('0x5a')]({'model':db[_0x63f7('0x5b')],'as':_0x63f7('0x67'),'attributes':['id',_0x63f7('0x5c')]});return db[_0x63f7('0x29')][_0x63f7('0x32')]({'where':{'id':_0x53754c[_0x63f7('0x26')]['id']},'include':_0x27298d})[_0x63f7('0x17')](handleEntityNotFound(_0x195a26,null))[_0x63f7('0x17')](function(_0x50c686){if(_0x50c686){var _0x33e206=_0x50c686[_0x63f7('0x68')]({'plain':!![]});fs[_0x63f7('0x69')](_0x1d350b);var _0x48e5d5={'channel':_0x63f7('0x6a'),'account':_0x33e206[_0x63f7('0x66')][_0x63f7('0x19')],'agent':_0x33e206['Owner']?_0x33e206[_0x63f7('0x67')]['fullname']:_0x63f7('0x6b'),'createdAt':moment(_0x33e206['createdAt'])[_0x63f7('0x45')](_0x63f7('0x46'))[_0x63f7('0x52')](),'closedAt':_0x33e206[_0x63f7('0x6c')]?moment(_0x33e206[_0x63f7('0x6d')])['format'](_0x63f7('0x46'))[_0x63f7('0x52')]():'','disposition':_0x33e206[_0x63f7('0x6e')],'visibility':_0x33e206[_0x63f7('0x6f')]?_0x63f7('0x70'):_0x63f7('0x71'),'messages':_(_0x33e206[_0x63f7('0x61')])['filter']({'secret':![]})[_0x63f7('0x1b')](function(_0x5bf474){if(_0x5bf474[_0x63f7('0x60')]){var _0x22a8ab=path[_0x63f7('0x53')](_0x22019c,_0x5bf474['Attachment'][_0x63f7('0x72')]);if(fs[_0x63f7('0x73')](_0x22a8ab)){fs[_0x63f7('0x74')](_0x22a8ab)[_0x63f7('0x75')](fs['createWriteStream'](path[_0x63f7('0x53')](_0x1d350b,_0x5bf474['Attachment'][_0x63f7('0x72')])));}}return{'date':moment(_0x5bf474[_0x63f7('0x62')])[_0x63f7('0x45')](_0x63f7('0x46'))[_0x63f7('0x52')](),'sender':_0x5bf474[_0x63f7('0x63')]===_0x63f7('0x76')?_0x5bf474[_0x63f7('0x5b')]?_0x5bf474[_0x63f7('0x5b')][_0x63f7('0x5c')]:_0x63f7('0x77'):_0x5bf474[_0x63f7('0x5d')][_0x63f7('0x5e')]+(_0x5bf474[_0x63f7('0x5d')]['lastName']?'\x20'+_0x5bf474[_0x63f7('0x5d')]['lastName']:''),'body':_0x5bf474[_0x63f7('0x60')]?_0x5bf474['Attachment'][_0x63f7('0x72')]:_0x5bf474[_0x63f7('0x34')],'direction':_0x5bf474[_0x63f7('0x63')]===_0x63f7('0x76')?'A':'C','secret':_0x5bf474[_0x63f7('0x78')],'read':_0x5bf474['read'],'attachment':_0x5bf474['Attachment']};})['value']()};return ejs[_0x63f7('0x79')](path[_0x63f7('0x53')](config[_0x63f7('0x57')],'server',_0x63f7('0x7a'),_0x63f7('0x7b')),{'interaction':_0x48e5d5})['then'](function(_0x3ffeea){var _0x57d7ed=path[_0x63f7('0x53')](_0x1d350b,'transcript-'+_0x33e206['id']+'-'+_0x5c1eba+_0x63f7('0x7c'));var _0x2aaca5={'path':_0x57d7ed,'channel':_0x63f7('0x6a'),'interactionId':_0x33e206['id']};return pdf[_0x63f7('0x7d')](_0x3ffeea,_0x2aaca5);})[_0x63f7('0x17')](function(){return new Promise(function(_0x1a80db,_0x5e7b1b){zipdir(_0x1d350b,{'saveTo':_0x44db8b},function(_0x164a21,_0x22029f){if(_0x164a21)return _0x5e7b1b(_0x164a21);return _0x1a80db(_0x22029f);});})[_0x63f7('0x17')](function(){return new Promise(function(_0x47800f,_0x5f1aee){rimraf(_0x1d350b,function(_0x9d71c6){if(_0x9d71c6)_0x5f1aee(_0x9d71c6);return _0x47800f();});});})[_0x63f7('0x17')](function(){return _0x195a26[_0x63f7('0x50')](_0x44db8b,_0x214215,function(_0x1a76d8){if(_0x1a76d8){logger[_0x63f7('0x18')](_0x63f7('0x7e'),_0x1a76d8);}else{fs['unlinkSync'](_0x44db8b);}});});});}else{return _0x195a26['sendStatus'](0xc8);}})[_0x63f7('0x22')](handleError(_0x195a26,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 07ced25..5ee22df 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 _0x189d=['OpenchannelMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb'];(function(_0x3f3ad5,_0x560022){var _0x1f008e=function(_0x441daa){while(--_0x441daa){_0x3f3ad5['push'](_0x3f3ad5['shift']());}};_0x1f008e(++_0x560022);}(_0x189d,0x12f));var _0xd189=function(_0x372ee1,_0x45c637){_0x372ee1=_0x372ee1-0x0;var _0x31ea06=_0x189d[_0x372ee1];return _0x31ea06;};'use strict';var EventEmitter=require(_0xd189('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xd189('0x1')];var OpenchannelMessage=require(_0xd189('0x2'))['db'][_0xd189('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xd189('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd189('0x5'),'afterDestroy':_0xd189('0x6')};function emitEvent(_0x49cbbf){return function(_0xe06861,_0x3c8e1e,_0x10665b){_0xe06861[_0xd189('0x7')]({'attributes':['id'],'raw':!![]})[_0xd189('0x8')](function(_0xa98909){_0xe06861[_0xd189('0x9')](_0xd189('0xa'),_0xa98909[_0xd189('0xb')](function(_0xdb4cd0){return{'id':_0xdb4cd0['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0xe06861['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1b69f3){_0xe06861[_0xd189('0x9')]('unreadMessages',_0x1b69f3[_0xd189('0xc')]);OpenchannelInteractionEvents[_0xd189('0xd')](_0x49cbbf+':'+_0xe06861['id'],_0xe06861);OpenchannelInteractionEvents[_0xd189('0xd')](_0x49cbbf,_0xe06861);_0x10665b(null);})[_0xd189('0xe')](_0x10665b(null));};}for(var e in events){if(events[_0xd189('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xd189('0x10')](e,emitEvent(event));}}module[_0xd189('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x83e5=['save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','catch','hook','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners'];(function(_0x33d915,_0x308c13){var _0x4184c9=function(_0x3266b7){while(--_0x3266b7){_0x33d915['push'](_0x33d915['shift']());}};_0x4184c9(++_0x308c13);}(_0x83e5,0x1e2));var _0x583e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x83e5[_0x2763f2];return _0x3ef471;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x583e('0x0'))['db'][_0x583e('0x1')];var OpenchannelMessage=require(_0x583e('0x0'))['db'][_0x583e('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x583e('0x3')](0x0);var events={'afterCreate':_0x583e('0x4'),'afterUpdate':_0x583e('0x5'),'afterDestroy':_0x583e('0x6')};function emitEvent(_0x147cdd){return function(_0x1019fc,_0x4218e6,_0x4be9a5){_0x1019fc[_0x583e('0x7')]({'attributes':['id'],'raw':!![]})[_0x583e('0x8')](function(_0x33da4f){_0x1019fc[_0x583e('0x9')](_0x583e('0xa'),_0x33da4f[_0x583e('0xb')](function(_0x27d260){return{'id':_0x27d260['id']};}));return OpenchannelMessage[_0x583e('0xc')]({'where':{'OpenchannelInteractionId':_0x1019fc['id'],'direction':'in','read':![]},'raw':!![]});})[_0x583e('0x8')](function(_0x4c9f20){_0x1019fc[_0x583e('0x9')](_0x583e('0xd'),_0x4c9f20[_0x583e('0xe')]);OpenchannelInteractionEvents['emit'](_0x147cdd+':'+_0x1019fc['id'],_0x1019fc);OpenchannelInteractionEvents['emit'](_0x147cdd,_0x1019fc);_0x4be9a5(null);})[_0x583e('0xf')](_0x4be9a5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x583e('0x10')](e,emitEvent(event));}}module[_0x583e('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 5e8cac9..62a3908 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 _0x29ef=['../../config/environment','./openchannelInteraction.attributes','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x172378,_0x5698e1){var _0x14cbe2=function(_0x101a9a){while(--_0x101a9a){_0x172378['push'](_0x172378['shift']());}};_0x14cbe2(++_0x5698e1);}(_0x29ef,0x196));var _0xf29e=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x29ef[_0x2aea9e];return _0x430b92;};'use strict';var _=require(_0xf29e('0x0'));var util=require(_0xf29e('0x1'));var logger=require(_0xf29e('0x2'))(_0xf29e('0x3'));var moment=require('moment');var BPromise=require(_0xf29e('0x4'));var rp=require(_0xf29e('0x5'));var fs=require('fs');var path=require(_0xf29e('0x6'));var rimraf=require(_0xf29e('0x7'));var config=require(_0xf29e('0x8'));var attributes=require(_0xf29e('0x9'));module['exports']=function(_0x52df07,_0x36c4f4){return _0x52df07['define']('OpenchannelInteraction',attributes,{'tableName':_0xf29e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf29e('0xb'),'collate':_0xf29e('0xc'),'hooks':{'beforeUpdate':function(_0x556232,_0x98b8b1,_0x2252b3){if(_0x556232[_0xf29e('0xd')](_0xf29e('0xe'))){_0x556232[_0xf29e('0xf')]=moment()[_0xf29e('0x10')](_0xf29e('0x11'));}_0x2252b3(null,_0x556232);}}});}; \ No newline at end of file +var _0xf742=['request-promise','path','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf742,0x18a));var _0x2f74=function(_0x5b5b2c,_0x19a06a){_0x5b5b2c=_0x5b5b2c-0x0;var _0x4e2fcd=_0xf742[_0x5b5b2c];return _0x4e2fcd;};'use strict';var _=require(_0x2f74('0x0'));var util=require(_0x2f74('0x1'));var logger=require(_0x2f74('0x2'))(_0x2f74('0x3'));var moment=require(_0x2f74('0x4'));var BPromise=require(_0x2f74('0x5'));var rp=require(_0x2f74('0x6'));var fs=require('fs');var path=require(_0x2f74('0x7'));var rimraf=require(_0x2f74('0x8'));var config=require('../../config/environment');var attributes=require(_0x2f74('0x9'));module[_0x2f74('0xa')]=function(_0xe1433d,_0x4e5c7e){return _0xe1433d[_0x2f74('0xb')](_0x2f74('0xc'),attributes,{'tableName':_0x2f74('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2f74('0xe'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x23e123,_0x558c75,_0x2cd737){if(_0x23e123[_0x2f74('0xf')](_0x2f74('0x10'))){_0x23e123[_0x2f74('0x11')]=moment()[_0x2f74('0x12')](_0x2f74('0x13'));}_0x2cd737(null,_0x23e123);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index f1308dc..35fd016 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 _0xf218=['./openchannelInteraction.socket','register','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','OpenchannelInteraction','update','body','options','raw','attributes','limit','UpdateOpenchannelInteraction','debug','stringify','AddTagsToOpenchannelInteraction','where','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xf218,0x14a));var _0x8f21=function(_0x29ecbc,_0x2929d9){_0x29ecbc=_0x29ecbc-0x0;var _0x5709b0=_0xf218[_0x29ecbc];return _0x5709b0;};'use strict';var _=require(_0x8f21('0x0'));var util=require(_0x8f21('0x1'));var moment=require('moment');var BPromise=require(_0x8f21('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f21('0x3'));var db=require(_0x8f21('0x4'))['db'];var utils=require(_0x8f21('0x5'));var logger=require('../../config/logger')(_0x8f21('0x6'));var config=require('../../config/environment');var jayson=require(_0x8f21('0x7'));var client=jayson[_0x8f21('0x8')][_0x8f21('0x9')]({'port':0x232a});config[_0x8f21('0xa')]=_[_0x8f21('0xb')](config[_0x8f21('0xa')],{'host':_0x8f21('0xc'),'port':0x18eb});var socket=require(_0x8f21('0xd'))(new Redis(config[_0x8f21('0xa')]));require(_0x8f21('0xe'))[_0x8f21('0xf')](socket);function respondWithRpcPromise(_0x320f96,_0x23a2ca,_0x303c76){return new BPromise(function(_0x3d60e0,_0x2bc445){return client['request'](_0x320f96,_0x303c76)[_0x8f21('0x10')](function(_0x4623f7){logger['info'](_0x8f21('0x11'),_0x23a2ca,_0x8f21('0x12'));logger['debug'](_0x8f21('0x13'),_0x23a2ca,_0x8f21('0x12'),JSON['stringify'](_0x4623f7));if(_0x4623f7[_0x8f21('0x14')]){if(_0x4623f7[_0x8f21('0x14')][_0x8f21('0x15')]===0x1f4){logger[_0x8f21('0x14')](_0x8f21('0x11'),_0x23a2ca,_0x4623f7[_0x8f21('0x14')]['message']);return _0x2bc445(_0x4623f7['error'][_0x8f21('0x16')]);}logger['error'](_0x8f21('0x11'),_0x23a2ca,_0x4623f7['error'][_0x8f21('0x16')]);return _0x3d60e0(_0x4623f7[_0x8f21('0x14')][_0x8f21('0x16')]);}else{logger[_0x8f21('0x17')](_0x8f21('0x11'),_0x23a2ca,'request\x20sent');_0x3d60e0(_0x4623f7[_0x8f21('0x18')][_0x8f21('0x16')]);}})[_0x8f21('0x19')](function(_0x4aab56){logger[_0x8f21('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x23a2ca,_0x4aab56);_0x2bc445(_0x4aab56);});});}exports['UpdateOpenchannelInteraction']=function(_0x1ac2db){var _0x54c3f7=this;return new Promise(function(_0x14d26a,_0x5f1819){return db[_0x8f21('0x1a')][_0x8f21('0x1b')](_0x1ac2db[_0x8f21('0x1c')],{'raw':_0x1ac2db[_0x8f21('0x1d')]?_0x1ac2db[_0x8f21('0x1d')][_0x8f21('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ac2db[_0x8f21('0x1d')]?_0x1ac2db[_0x8f21('0x1d')]['where']||null:null,'attributes':_0x1ac2db['options']?_0x1ac2db['options'][_0x8f21('0x1f')]||null:null,'limit':_0x1ac2db[_0x8f21('0x1d')]?_0x1ac2db[_0x8f21('0x1d')][_0x8f21('0x20')]||null:null})[_0x8f21('0x10')](function(_0x47f855){logger[_0x8f21('0x17')](_0x8f21('0x21'),_0x1ac2db);logger[_0x8f21('0x22')](_0x8f21('0x21'),_0x1ac2db,JSON[_0x8f21('0x23')](_0x47f855));_0x14d26a(_0x47f855);})[_0x8f21('0x19')](function(_0x405a40){logger[_0x8f21('0x14')](_0x8f21('0x21'),_0x405a40[_0x8f21('0x16')],_0x1ac2db);_0x5f1819(_0x54c3f7['error'](0x1f4,_0x405a40['message']));});});};exports[_0x8f21('0x24')]=function(_0x4ab64f){return new Promise(function(_0x444541,_0x113fb7){return db['OpenchannelInteraction']['find']({'where':_0x4ab64f['options']?_0x4ab64f['options'][_0x8f21('0x25')]||null:null})[_0x8f21('0x10')](function(_0x43661a){if(_0x43661a){return _0x43661a[_0x8f21('0x26')](_0x4ab64f['body'][_0x8f21('0x27')],_[_0x8f21('0x28')](_0x4ab64f[_0x8f21('0x1c')],['ids','id'])||{});}})[_0x8f21('0x29')](function(_0x18b37f){logger[_0x8f21('0x17')](_0x8f21('0x2a'),_0x4ab64f);logger[_0x8f21('0x22')](_0x8f21('0x2a'),_0x4ab64f,JSON['stringify'](_0x18b37f));_0x444541(_0x18b37f);})[_0x8f21('0x19')](function(_0x19df7e){logger[_0x8f21('0x14')](_0x8f21('0x2a'),_0x19df7e['message'],_0x4ab64f);_0x113fb7(_this[_0x8f21('0x14')](0x1f4,_0x19df7e[_0x8f21('0x16')]));});});}; \ No newline at end of file +var _0x97e8=['../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','find','addTags','ids','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x97e8,0x14b));var _0x897e=function(_0x1e88b2,_0x4a17ed){_0x1e88b2=_0x1e88b2-0x0;var _0x5aebe0=_0x97e8[_0x1e88b2];return _0x5aebe0;};'use strict';var _=require(_0x897e('0x0'));var util=require(_0x897e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x897e('0x2'));var fs=require('fs');var Redis=require(_0x897e('0x3'));var db=require(_0x897e('0x4'))['db'];var utils=require(_0x897e('0x5'));var logger=require('../../config/logger')(_0x897e('0x6'));var config=require('../../config/environment');var jayson=require(_0x897e('0x7'));var client=jayson[_0x897e('0x8')][_0x897e('0x9')]({'port':0x232a});config[_0x897e('0xa')]=_['defaults'](config[_0x897e('0xa')],{'host':_0x897e('0xb'),'port':0x18eb});var socket=require(_0x897e('0xc'))(new Redis(config[_0x897e('0xa')]));require('./openchannelInteraction.socket')[_0x897e('0xd')](socket);function respondWithRpcPromise(_0x391cce,_0x651723,_0x52c27f){return new BPromise(function(_0x3e8e88,_0x3a1019){return client[_0x897e('0xe')](_0x391cce,_0x52c27f)[_0x897e('0xf')](function(_0x3cf486){logger[_0x897e('0x10')](_0x897e('0x11'),_0x651723,_0x897e('0x12'));logger[_0x897e('0x13')](_0x897e('0x14'),_0x651723,_0x897e('0x12'),JSON[_0x897e('0x15')](_0x3cf486));if(_0x3cf486[_0x897e('0x16')]){if(_0x3cf486[_0x897e('0x16')][_0x897e('0x17')]===0x1f4){logger['error'](_0x897e('0x11'),_0x651723,_0x3cf486['error']['message']);return _0x3a1019(_0x3cf486['error'][_0x897e('0x18')]);}logger[_0x897e('0x16')](_0x897e('0x11'),_0x651723,_0x3cf486[_0x897e('0x16')][_0x897e('0x18')]);return _0x3e8e88(_0x3cf486[_0x897e('0x16')][_0x897e('0x18')]);}else{logger[_0x897e('0x10')](_0x897e('0x11'),_0x651723,_0x897e('0x12'));_0x3e8e88(_0x3cf486[_0x897e('0x19')][_0x897e('0x18')]);}})[_0x897e('0x1a')](function(_0x49ce40){logger['error'](_0x897e('0x11'),_0x651723,_0x49ce40);_0x3a1019(_0x49ce40);});});}exports[_0x897e('0x1b')]=function(_0x426cf1){var _0x5d83b3=this;return new Promise(function(_0xaaf344,_0x3ce316){return db[_0x897e('0x1c')][_0x897e('0x1d')](_0x426cf1[_0x897e('0x1e')],{'raw':_0x426cf1[_0x897e('0x1f')]?_0x426cf1['options'][_0x897e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x426cf1[_0x897e('0x1f')]?_0x426cf1[_0x897e('0x1f')][_0x897e('0x21')]||null:null,'attributes':_0x426cf1['options']?_0x426cf1['options'][_0x897e('0x22')]||null:null,'limit':_0x426cf1[_0x897e('0x1f')]?_0x426cf1[_0x897e('0x1f')][_0x897e('0x23')]||null:null})[_0x897e('0xf')](function(_0xdd314){logger[_0x897e('0x10')](_0x897e('0x1b'),_0x426cf1);logger['debug']('UpdateOpenchannelInteraction',_0x426cf1,JSON[_0x897e('0x15')](_0xdd314));_0xaaf344(_0xdd314);})[_0x897e('0x1a')](function(_0x2517a3){logger[_0x897e('0x16')]('UpdateOpenchannelInteraction',_0x2517a3[_0x897e('0x18')],_0x426cf1);_0x3ce316(_0x5d83b3['error'](0x1f4,_0x2517a3[_0x897e('0x18')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x5027c7){return new Promise(function(_0x6bae1a,_0x3716fc){return db['OpenchannelInteraction'][_0x897e('0x24')]({'where':_0x5027c7[_0x897e('0x1f')]?_0x5027c7['options']['where']||null:null})[_0x897e('0xf')](function(_0x17d7e5){if(_0x17d7e5){return _0x17d7e5[_0x897e('0x25')](_0x5027c7[_0x897e('0x1e')][_0x897e('0x26')],_[_0x897e('0x27')](_0x5027c7['body'],[_0x897e('0x26'),'id'])||{});}})[_0x897e('0x28')](function(_0x346fb5){logger[_0x897e('0x10')]('AddTags',_0x5027c7);logger[_0x897e('0x13')](_0x897e('0x29'),_0x5027c7,JSON[_0x897e('0x15')](_0x346fb5));_0x6bae1a(_0x346fb5);})[_0x897e('0x1a')](function(_0x3c516a){logger[_0x897e('0x16')]('AddTags',_0x3c516a['message'],_0x5027c7);_0x3716fc(_this[_0x897e('0x16')](0x1f4,_0x3c516a[_0x897e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a1ea5e2..aa628d8 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 _0x52fd=['openchannelInteraction:','./openchannelInteraction.events','remove','update','emit','removeListener','register'];(function(_0xb41cf,_0x45b86b){var _0x1781e3=function(_0x321758){while(--_0x321758){_0xb41cf['push'](_0xb41cf['shift']());}};_0x1781e3(++_0x45b86b);}(_0x52fd,0x1c8));var _0xd52f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x52fd[_0xfae23b];return _0x200640;};'use strict';var OpenchannelInteractionEvents=require(_0xd52f('0x0'));var events=['save',_0xd52f('0x1'),_0xd52f('0x2')];function createListener(_0x4583b1,_0xaf9691){return function(_0x13b01c){_0xaf9691[_0xd52f('0x3')](_0x4583b1,_0x13b01c);};}function removeListener(_0x81d839,_0x2638ed){return function(){OpenchannelInteractionEvents[_0xd52f('0x4')](_0x81d839,_0x2638ed);};}exports[_0xd52f('0x5')]=function(_0x5fdf95){for(var _0x726434=0x0,_0x256d0b=events['length'];_0x726434<_0x256d0b;_0x726434++){var _0x305c94=events[_0x726434];var _0x567e40=createListener(_0xd52f('0x6')+_0x305c94,_0x5fdf95);OpenchannelInteractionEvents['on'](_0x305c94,_0x567e40);}}; \ No newline at end of file +var _0x3ab2=['./openchannelInteraction.events','save','remove','update','emit','removeListener','register','length','openchannelInteraction:'];(function(_0x14915a,_0x222f6b){var _0x2f683c=function(_0x28e694){while(--_0x28e694){_0x14915a['push'](_0x14915a['shift']());}};_0x2f683c(++_0x222f6b);}(_0x3ab2,0xf3));var _0x23ab=function(_0x203cf5,_0x8421e0){_0x203cf5=_0x203cf5-0x0;var _0x17a51d=_0x3ab2[_0x203cf5];return _0x17a51d;};'use strict';var OpenchannelInteractionEvents=require(_0x23ab('0x0'));var events=[_0x23ab('0x1'),_0x23ab('0x2'),_0x23ab('0x3')];function createListener(_0x178d42,_0x242d8d){return function(_0x9e3e52){_0x242d8d[_0x23ab('0x4')](_0x178d42,_0x9e3e52);};}function removeListener(_0x4e447c,_0x324698){return function(){OpenchannelInteractionEvents[_0x23ab('0x5')](_0x4e447c,_0x324698);};}exports[_0x23ab('0x6')]=function(_0x5395a5){for(var _0x55c992=0x0,_0x1194b6=events[_0x23ab('0x7')];_0x55c992<_0x1194b6;_0x55c992++){var _0x20e31b=events[_0x55c992];var _0x5421a=createListener(_0x23ab('0x8')+_0x20e31b,_0x5395a5);OpenchannelInteractionEvents['on'](_0x20e31b,_0x5421a);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 1f36019..cb50915 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(_0x15bb92,_0x250a1b){var _0x35b094=function(_0x2875b3){while(--_0x2875b3){_0x15bb92['push'](_0x15bb92['shift']());}};_0x35b094(++_0x250a1b);}(_0xe706,0xa3));var _0x6e70=function(_0x1eebe4,_0x27f7b4){_0x1eebe4=_0x1eebe4-0x0;var _0x46f639=_0xe706[_0x1eebe4];return _0x46f639;};'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 _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x330e77,_0x2dd3c0){var _0xdbadea=function(_0x2453e9){while(--_0x2453e9){_0x330e77['push'](_0x330e77['shift']());}};_0xdbadea(++_0x2dd3c0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x23be51,_0xc02a1b){_0x23be51=_0x23be51-0x0;var _0x47a26d=_0xcb91[_0x23be51];return _0x47a26d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 2e42ee4..83a97e0 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 _0x00ea=['TEXT','BOOLEAN','ENUM','out','DATE','exports'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x00ea,0x19d));var _0xa00e=function(_0x7d85ec,_0x122ef1){_0x7d85ec=_0x7d85ec-0x0;var _0x551f5e=_0x00ea[_0x7d85ec];return _0x551f5e;};'use strict';var Sequelize=require('sequelize');module[_0xa00e('0x0')]={'body':{'type':Sequelize[_0xa00e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa00e('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xa00e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa00e('0x3')]('in',_0xa00e('0x4')),'defaultValue':_0xa00e('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa00e('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xa00e('0x1')]}}; \ No newline at end of file +var _0x1219=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x1219,0x17c));var _0x9121=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1219[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9121('0x0'));module[_0x9121('0x1')]={'body':{'type':Sequelize[_0x9121('0x2')](_0x9121('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9121('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9121('0x5')]('in','out'),'defaultValue':_0x9121('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9121('0x7')]},'providerName':{'type':Sequelize[_0x9121('0x8')]},'providerResponse':{'type':Sequelize[_0x9121('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 563ef48..2586ac6 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 _0x25e1=['limit','undefined','count','offset','set','Content-Range','save','update','destroy','stack','name','send','map','OpenchannelMessage','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','include','findAll','params','includeAll','options','find','create','body','describe','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','role','null','rejectMessage','contact','fullname','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelMessage.socket','client','http','then','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','sendStatus','status','end','json'];(function(_0x1c388e,_0x31f2de){var _0x4e2966=function(_0x21688c){while(--_0x21688c){_0x1c388e['push'](_0x1c388e['shift']());}};_0x4e2966(++_0x31f2de);}(_0x25e1,0x146));var _0x125e=function(_0x32dc20,_0x2cf33e){_0x32dc20=_0x32dc20-0x0;var _0x5c1b28=_0x25e1[_0x32dc20];return _0x5c1b28;};'use strict';var emlformat=require(_0x125e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x125e('0x1'));var jsonpatch=require(_0x125e('0x2'));var rp=require(_0x125e('0x3'));var moment=require(_0x125e('0x4'));var BPromise=require(_0x125e('0x5'));var Mustache=require(_0x125e('0x6'));var util=require(_0x125e('0x7'));var path=require('path');var sox=require(_0x125e('0x8'));var csv=require(_0x125e('0x9'));var ejs=require(_0x125e('0xa'));var fs=require('fs');var fs_extra=require(_0x125e('0xb'));var _=require('lodash');var squel=require(_0x125e('0xc'));var crypto=require(_0x125e('0xd'));var jsforce=require(_0x125e('0xe'));var deskjs=require(_0x125e('0xf'));var toCsv=require(_0x125e('0x9'));var querystring=require(_0x125e('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x125e('0x11'));var as=require(_0x125e('0x12'));var hardwareService=require(_0x125e('0x13'));var logger=require('../../config/logger')(_0x125e('0x14'));var utils=require(_0x125e('0x15'));var config=require(_0x125e('0x16'));var licenseUtil=require(_0x125e('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x125e('0x18')],{'host':_0x125e('0x19'),'port':0x18eb});var socket=require(_0x125e('0x1a'))(new Redis(config[_0x125e('0x18')]));require(_0x125e('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x125e('0x1c')][_0x125e('0x1d')]({'port':0x232c});var client9002=jayson[_0x125e('0x1c')][_0x125e('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x21208f,_0x18191e,_0x3f090f,_0x53ad34){return new BPromise(function(_0x5afa75,_0x1cb98b){var _0x5a63a7=_0x53ad34||client;return _0x5a63a7['request'](_0x21208f,_0x3f090f)[_0x125e('0x1e')](function(_0x591814){logger['info'](_0x125e('0x1f'),_0x18191e,'request\x20sent');logger[_0x125e('0x20')](_0x125e('0x21'),_0x18191e,'request\x20sent',JSON[_0x125e('0x22')](_0x591814));if(_0x591814[_0x125e('0x23')]){if(_0x591814['error'][_0x125e('0x24')]===0x1f4){logger[_0x125e('0x23')](_0x125e('0x1f'),_0x18191e,_0x591814['error'][_0x125e('0x25')]);return _0x1cb98b(_0x591814[_0x125e('0x23')]['message']);}logger[_0x125e('0x23')](_0x125e('0x1f'),_0x18191e,_0x591814['error'][_0x125e('0x25')]);return _0x5afa75(_0x591814[_0x125e('0x23')][_0x125e('0x25')]);}else{logger[_0x125e('0x26')](_0x125e('0x1f'),_0x18191e,_0x125e('0x27'));_0x5afa75(_0x591814[_0x125e('0x28')][_0x125e('0x25')]);}})[_0x125e('0x29')](function(_0x13c10d){logger[_0x125e('0x23')](_0x125e('0x1f'),_0x18191e,_0x13c10d);_0x1cb98b(_0x13c10d);});});}function respondWithStatusCode(_0x4af7ed,_0x328716){_0x328716=_0x328716||0xcc;return function(_0x4ecb5d){if(_0x4ecb5d){return _0x4af7ed[_0x125e('0x2a')](_0x328716);}return _0x4af7ed[_0x125e('0x2b')](_0x328716)[_0x125e('0x2c')]();};}function respondWithResult(_0x241f0e,_0xd598f4){_0xd598f4=_0xd598f4||0xc8;return function(_0x5ed561){if(_0x5ed561){return _0x241f0e[_0x125e('0x2b')](_0xd598f4)[_0x125e('0x2d')](_0x5ed561);}};}function respondWithFilteredResult(_0x475508,_0x25d298){return function(_0x4eed01){if(_0x4eed01){var _0x10e2da=typeof _0x25d298['offset']==='undefined'&&typeof _0x25d298[_0x125e('0x2e')]===_0x125e('0x2f');var _0x23a4b5=_0x4eed01[_0x125e('0x30')];var _0x1df30c=_0x10e2da?0x0:_0x25d298[_0x125e('0x31')];var _0x54bfc8=_0x10e2da?_0x4eed01['count']:_0x25d298[_0x125e('0x31')]+_0x25d298[_0x125e('0x2e')];var _0x19468c;if(_0x54bfc8>=_0x23a4b5){_0x54bfc8=_0x23a4b5;_0x19468c=0xc8;}else{_0x19468c=0xce;}_0x475508[_0x125e('0x2b')](_0x19468c);return _0x475508[_0x125e('0x32')](_0x125e('0x33'),_0x1df30c+'-'+_0x54bfc8+'/'+_0x23a4b5)[_0x125e('0x2d')](_0x4eed01);}return null;};}function patchUpdates(_0x165454){return function(_0x1c67d3){try{jsonpatch['apply'](_0x1c67d3,_0x165454,!![]);}catch(_0x15ad4d){return BPromise['reject'](_0x15ad4d);}return _0x1c67d3[_0x125e('0x34')]();};}function saveUpdates(_0x5350e9,_0x476dd6){return function(_0x3ddd48){if(_0x3ddd48){return _0x3ddd48[_0x125e('0x35')](_0x5350e9)[_0x125e('0x1e')](function(_0x78354d){return _0x78354d;});}return null;};}function removeEntity(_0x5eaaf5,_0x2315a8){return function(_0x26a2b7){if(_0x26a2b7){return _0x26a2b7[_0x125e('0x36')]()[_0x125e('0x1e')](function(){_0x5eaaf5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17dae5,_0x43abc0){return function(_0x2b99cc){if(!_0x2b99cc){_0x17dae5[_0x125e('0x2a')](0x194);}return _0x2b99cc;};}function handleError(_0x52062d,_0x181919){_0x181919=_0x181919||0x1f4;return function(_0x452335){logger[_0x125e('0x23')](_0x452335[_0x125e('0x37')]);if(_0x452335[_0x125e('0x38')]){delete _0x452335[_0x125e('0x38')];}_0x52062d[_0x125e('0x2b')](_0x181919)[_0x125e('0x39')](_0x452335);};}exports['index']=function(_0x21ed6b,_0x2bb1aa){var _0x49bf99={},_0x3dceeb={},_0x3bbf99={'count':0x0,'rows':[]};var _0x5bc8ff=_[_0x125e('0x3a')](db[_0x125e('0x3b')][_0x125e('0x3c')],function(_0x12fdfa){return{'name':_0x12fdfa['fieldName'],'type':_0x12fdfa[_0x125e('0x3d')][_0x125e('0x3e')]};});_0x3dceeb[_0x125e('0x3f')]=_[_0x125e('0x3a')](_0x5bc8ff,'name');_0x3dceeb[_0x125e('0x40')]=_[_0x125e('0x41')](_0x21ed6b['query']);_0x3dceeb[_0x125e('0x42')]=_['intersection'](_0x3dceeb[_0x125e('0x3f')],_0x3dceeb[_0x125e('0x40')]);_0x49bf99[_0x125e('0x43')]=_[_0x125e('0x44')](_0x3dceeb[_0x125e('0x3f')],qs['fields'](_0x21ed6b['query'][_0x125e('0x45')]));_0x49bf99['attributes']=_0x49bf99['attributes'][_0x125e('0x46')]?_0x49bf99[_0x125e('0x43')]:_0x3dceeb[_0x125e('0x3f')];if(!_0x21ed6b[_0x125e('0x40')][_0x125e('0x47')]('nolimit')){_0x49bf99[_0x125e('0x2e')]=qs[_0x125e('0x2e')](_0x21ed6b[_0x125e('0x40')][_0x125e('0x2e')]);_0x49bf99[_0x125e('0x31')]=qs[_0x125e('0x31')](_0x21ed6b['query']['offset']);}_0x49bf99['order']=qs[_0x125e('0x48')](_0x21ed6b[_0x125e('0x40')][_0x125e('0x48')]);_0x49bf99[_0x125e('0x49')]=qs[_0x125e('0x42')](_[_0x125e('0x4a')](_0x21ed6b[_0x125e('0x40')],_0x3dceeb[_0x125e('0x42')]),_0x5bc8ff);if(_0x21ed6b[_0x125e('0x40')][_0x125e('0x4b')]){_0x49bf99[_0x125e('0x49')]=_[_0x125e('0x4c')](_0x49bf99[_0x125e('0x49')],{'$or':_[_0x125e('0x3a')](_0x5bc8ff,function(_0x552d9e){if(_0x552d9e[_0x125e('0x3d')]!==_0x125e('0x4d')){var _0x2bb1b0={};_0x2bb1b0[_0x552d9e[_0x125e('0x38')]]={'$like':'%'+_0x21ed6b[_0x125e('0x40')][_0x125e('0x4b')]+'%'};return _0x2bb1b0;}})});}_0x49bf99=_['merge']({},_0x49bf99,_0x21ed6b['options']);var _0x68680f={'where':_0x49bf99['where']};return db[_0x125e('0x3b')][_0x125e('0x30')](_0x68680f)[_0x125e('0x1e')](function(_0x1794ca){_0x3bbf99[_0x125e('0x30')]=_0x1794ca;if(_0x21ed6b[_0x125e('0x40')]['includeAll']){_0x49bf99[_0x125e('0x4e')]=[{'all':!![]}];}return db[_0x125e('0x3b')][_0x125e('0x4f')](_0x49bf99);})[_0x125e('0x1e')](function(_0x3cd8d){_0x3bbf99['rows']=_0x3cd8d;return _0x3bbf99;})[_0x125e('0x1e')](respondWithFilteredResult(_0x2bb1aa,_0x49bf99))[_0x125e('0x29')](handleError(_0x2bb1aa,null));};exports['show']=function(_0x2a6e0d,_0x406e4f){var _0x2ea129={'raw':!![],'where':{'id':_0x2a6e0d[_0x125e('0x50')]['id']}},_0x155107={};_0x155107[_0x125e('0x3f')]=_[_0x125e('0x41')](db[_0x125e('0x3b')][_0x125e('0x3c')]);_0x155107[_0x125e('0x40')]=_[_0x125e('0x41')](_0x2a6e0d[_0x125e('0x40')]);_0x155107[_0x125e('0x42')]=_[_0x125e('0x44')](_0x155107[_0x125e('0x3f')],_0x155107[_0x125e('0x40')]);_0x2ea129[_0x125e('0x43')]=_[_0x125e('0x44')](_0x155107['model'],qs[_0x125e('0x45')](_0x2a6e0d[_0x125e('0x40')][_0x125e('0x45')]));_0x2ea129['attributes']=_0x2ea129['attributes']['length']?_0x2ea129['attributes']:_0x155107[_0x125e('0x3f')];if(_0x2a6e0d[_0x125e('0x40')][_0x125e('0x51')]){_0x2ea129[_0x125e('0x4e')]=[{'all':!![]}];}_0x2ea129=_[_0x125e('0x4c')]({},_0x2ea129,_0x2a6e0d[_0x125e('0x52')]);return db[_0x125e('0x3b')][_0x125e('0x53')](_0x2ea129)[_0x125e('0x1e')](handleEntityNotFound(_0x406e4f,null))[_0x125e('0x1e')](respondWithResult(_0x406e4f,null))['catch'](handleError(_0x406e4f,null));};exports[_0x125e('0x54')]=function(_0x151fd2,_0x587f7d){return db[_0x125e('0x3b')][_0x125e('0x54')](_0x151fd2[_0x125e('0x55')],{})[_0x125e('0x1e')](respondWithResult(_0x587f7d,0xc9))['catch'](handleError(_0x587f7d,null));};exports[_0x125e('0x35')]=function(_0x22d232,_0x4a17ef){if(_0x22d232['body']['id']){delete _0x22d232[_0x125e('0x55')]['id'];}return db[_0x125e('0x3b')][_0x125e('0x53')]({'where':{'id':_0x22d232[_0x125e('0x50')]['id']}})['then'](handleEntityNotFound(_0x4a17ef,null))[_0x125e('0x1e')](saveUpdates(_0x22d232[_0x125e('0x55')],null))['then'](respondWithResult(_0x4a17ef,null))['catch'](handleError(_0x4a17ef,null));};exports[_0x125e('0x36')]=function(_0x4cb7a1,_0x10cdcf){return db[_0x125e('0x3b')][_0x125e('0x53')]({'where':{'id':_0x4cb7a1[_0x125e('0x50')]['id']}})['then'](handleEntityNotFound(_0x10cdcf,null))[_0x125e('0x1e')](removeEntity(_0x10cdcf,null))[_0x125e('0x29')](handleError(_0x10cdcf,null));};exports[_0x125e('0x56')]=function(_0x7544c1,_0x4428c1){return db['OpenchannelMessage'][_0x125e('0x56')]()[_0x125e('0x1e')](respondWithResult(_0x4428c1,null))['catch'](handleError(_0x4428c1,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x125e('0x57')]=function(_0x2910c9,_0x12d1d1,_0x1d3adc){var _0x131999={'agent':{},'channel':_0x125e('0x58')};if(_0x2910c9[_0x125e('0x55')]['id']){delete _0x2910c9[_0x125e('0x55')]['id'];}_0x2910c9[_0x125e('0x55')][_0x125e('0x59')]=!![];_0x2910c9[_0x125e('0x55')][_0x125e('0x5a')]=moment()[_0x125e('0x5b')](_0x125e('0x5c'));_0x2910c9[_0x125e('0x55')][_0x125e('0x5d')]=_0x2910c9[_0x125e('0x55')][_0x125e('0x5d')]||_0x2910c9[_0x125e('0x5e')]['id'];_0x131999[_0x125e('0x5f')]['id']=_0x2910c9[_0x125e('0x55')][_0x125e('0x5d')];return db[_0x125e('0x3b')]['find']({'where':{'id':_0x2910c9[_0x125e('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x12d1d1,null))[_0x125e('0x1e')](saveUpdates(_0x2910c9[_0x125e('0x55')],null))[_0x125e('0x1e')](function(_0x325ae9){if(_0x325ae9){_0x131999['message']=_0x325ae9[_0x125e('0x60')]({'plain':!![]});return db[_0x125e('0x61')][_0x125e('0x53')]({'where':{'id':_0x325ae9[_0x125e('0x62')]}});}return null;})[_0x125e('0x1e')](handleEntityNotFound(_0x12d1d1,null))[_0x125e('0x1e')](function(_0x45c2a8){if(_0x45c2a8){return _0x45c2a8[_0x125e('0x35')]({'UserId':_0x2910c9['body'][_0x125e('0x5d')],'read1stAt':_[_0x125e('0x63')](_0x45c2a8['read1stAt'])?moment()['format'](_0x125e('0x5c')):undefined});}return null;})[_0x125e('0x1e')](function(_0x440a88){if(_0x440a88){_0x131999[_0x125e('0x64')]=_0x440a88[_0x125e('0x60')]({'plain':!![]});interaction_log[_0x125e('0x26')](_0x125e('0x65'),_0x2910c9[_0x125e('0x5e')]['id'],_0x2910c9[_0x125e('0x5e')][_0x125e('0x38')],_0x2910c9[_0x125e('0x5e')]['role'],_0x131999['interaction']['id'],_0x2910c9[_0x125e('0x55')]?JSON[_0x125e('0x22')](_0x2910c9['body']):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x131999);}return null;})['then'](function(_0x5abb7f){var _0xe66dfb=_0x125e('0x66')+_0x5abb7f[_0x125e('0x25')][_0x125e('0x67')];return db[_0x125e('0x68')]['query'](_0xe66dfb,{'type':db[_0x125e('0x69')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x3d10ea){return _0x3d10ea;});})[_0x125e('0x1e')](function(_0x3eeb72){if(_0x3eeb72){_0x131999[_0x125e('0x25')]['contact']=_0x3eeb72[0x0];if(!_0x2910c9['body']['UserId'])return;return db[_0x125e('0x6a')][_0x125e('0x53')]({'where':{'id':_0x2910c9[_0x125e('0x55')][_0x125e('0x5d')],'role':_0x125e('0x5f')},'attributes':['id','name','fullname',_0x125e('0x6b'),_0x125e('0x6c')],'raw':!![]});}return null;})[_0x125e('0x1e')](function(_0x56bf1b){if(!_0x56bf1b)return null;_0x131999[_0x125e('0x25')][_0x125e('0x5f')]=_0x56bf1b;return _0x131999;})['then'](function(_0x3558e2){if(_0x3558e2){if(_0x2910c9['body'][_0x125e('0x6d')]){_0x131999[_0x125e('0x25')][_0x125e('0x6e')]=util[_0x125e('0x5b')](_0x125e('0x6f'),_0x2910c9[_0x125e('0x5e')]['name']);_0x131999['message'][_0x125e('0x70')]=_0x131999[_0x125e('0x70')];_0x131999[_0x125e('0x25')][_0x125e('0x71')]=_0x131999[_0x125e('0x70')];_0x131999[_0x125e('0x25')][_0x125e('0x72')]=_0x125e('0x57');return respondWithRpcPromise(_0x125e('0x73'),_0x125e('0x73'),{'event':_0x125e('0x74'),'message':_0x131999[_0x125e('0x25')]},client9002)[_0x125e('0x1e')](function(){return _0x131999;});}return _0x131999;}return null;})['then'](respondWithResult(_0x12d1d1,null))['catch'](handleError(_0x12d1d1,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x125e('0x75')]=function(_0x3c6271,_0x544677,_0x50a485){var _0x2bba49={'agent':{},'channel':_0x125e('0x58')};if(_0x3c6271[_0x125e('0x55')]['id']){delete _0x3c6271[_0x125e('0x55')]['id'];}_0x3c6271[_0x125e('0x55')][_0x125e('0x5d')]=_0x3c6271[_0x125e('0x55')]['UserId']||_0x3c6271[_0x125e('0x5e')]['id'];_0x2bba49['agent']['id']=_0x3c6271[_0x125e('0x55')][_0x125e('0x5d')];return db['OpenchannelMessage'][_0x125e('0x53')]({'where':{'id':_0x3c6271[_0x125e('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x544677,null))[_0x125e('0x1e')](function(_0x4492d7){if(_0x4492d7){_0x2bba49[_0x125e('0x25')]=_0x4492d7[_0x125e('0x60')]({'plain':!![]});return db[_0x125e('0x61')][_0x125e('0x53')]({'where':{'id':_0x4492d7['OpenchannelInteractionId']}});}return null;})[_0x125e('0x1e')](handleEntityNotFound(_0x544677,null))[_0x125e('0x1e')](function(_0x260a05){if(_0x260a05){_0x2bba49['interaction']=_0x260a05[_0x125e('0x60')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3c6271[_0x125e('0x5e')]['id'],_0x3c6271['user'][_0x125e('0x38')],_0x3c6271[_0x125e('0x5e')][_0x125e('0x76')],_0x2bba49[_0x125e('0x64')]['id'],_0x3c6271[_0x125e('0x55')]?JSON['stringify'](_0x3c6271[_0x125e('0x55')]):_0x125e('0x77'));return respondWithRpcPromise('RejectMessage',_0x125e('0x78'),_0x2bba49);}return null;})[_0x125e('0x1e')](function(_0x5ebbd2){var _0x8713f=_0x125e('0x66')+_0x5ebbd2[_0x125e('0x25')]['ContactId'];return db[_0x125e('0x68')][_0x125e('0x40')](_0x8713f,{'type':db[_0x125e('0x69')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x536ba8){return _0x536ba8;});})[_0x125e('0x1e')](function(_0x1bc96f){if(_0x1bc96f){_0x2bba49[_0x125e('0x25')][_0x125e('0x79')]=_0x1bc96f[0x0];if(!_0x3c6271[_0x125e('0x55')][_0x125e('0x5d')])return;return db[_0x125e('0x6a')][_0x125e('0x53')]({'where':{'id':_0x3c6271[_0x125e('0x55')]['UserId'],'role':_0x125e('0x5f')},'attributes':['id','name',_0x125e('0x7a'),_0x125e('0x6b'),_0x125e('0x6c')],'raw':!![]});}return null;})[_0x125e('0x1e')](function(_0x4de133){if(!_0x4de133)return null;_0x2bba49[_0x125e('0x25')][_0x125e('0x5f')]=_0x4de133;return _0x2bba49;})['then'](function(_0x36b235){if(_0x36b235){_0x36b235['message'][_0x125e('0x6e')]=util['format'](_0x125e('0x6f'),_0x3c6271[_0x125e('0x5e')][_0x125e('0x38')]);_0x36b235['message'][_0x125e('0x70')]=_0x2bba49[_0x125e('0x70')];_0x36b235['message'][_0x125e('0x71')]=_0x2bba49[_0x125e('0x70')];_0x36b235[_0x125e('0x25')][_0x125e('0x72')]=_0x125e('0x75');respondWithRpcPromise(_0x125e('0x73'),'EventManager',{'event':_0x125e('0x7b'),'message':_0x36b235[_0x125e('0x25')]},client9002);return _0x2bba49;}return null;})[_0x125e('0x1e')](respondWithResult(_0x544677,null))[_0x125e('0x29')](handleError(_0x544677,null));}; \ No newline at end of file +var _0x165a=['offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','send','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','filter','options','includeAll','include','OpenchannelMessage','rows','catch','show','params','find','create','body','describe','accept','openchannel','read','readAt','format','UserId','user','agent','get','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel-interactions','OpenchannelInteraction','rejectMessage','ContactId','SELECT','motionChannel','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelMessage.socket','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','count'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x165a,0xd8));var _0xa165=function(_0x42b199,_0x41d223){_0x42b199=_0x42b199-0x0;var _0x59228f=_0x165a[_0x42b199];return _0x59228f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa165('0x0'));var jsonpatch=require(_0xa165('0x1'));var rp=require(_0xa165('0x2'));var moment=require(_0xa165('0x3'));var BPromise=require(_0xa165('0x4'));var Mustache=require(_0xa165('0x5'));var util=require(_0xa165('0x6'));var path=require(_0xa165('0x7'));var sox=require('sox');var csv=require(_0xa165('0x8'));var ejs=require(_0xa165('0x9'));var fs=require('fs');var fs_extra=require(_0xa165('0xa'));var _=require(_0xa165('0xb'));var squel=require(_0xa165('0xc'));var crypto=require('crypto');var jsforce=require(_0xa165('0xd'));var deskjs=require(_0xa165('0xe'));var toCsv=require(_0xa165('0x8'));var querystring=require(_0xa165('0xf'));var Papa=require(_0xa165('0x10'));var Redis=require('ioredis');var authService=require(_0xa165('0x11'));var qs=require(_0xa165('0x12'));var as=require(_0xa165('0x13'));var hardwareService=require(_0xa165('0x14'));var logger=require(_0xa165('0x15'))(_0xa165('0x16'));var utils=require(_0xa165('0x17'));var config=require(_0xa165('0x18'));var licenseUtil=require(_0xa165('0x19'));var db=require(_0xa165('0x1a'))['db'];config[_0xa165('0x1b')]=_[_0xa165('0x1c')](config['redis'],{'host':_0xa165('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa165('0x1e'))['register'](socket);var jayson=require(_0xa165('0x1f'));var client=jayson[_0xa165('0x20')][_0xa165('0x21')]({'port':0x232c});var client9002=jayson[_0xa165('0x20')][_0xa165('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x41f59e,_0x4f2531,_0x4e13ad,_0x4a8b7d){return new BPromise(function(_0x35cffb,_0x4d26c9){var _0x1292c8=_0x4a8b7d||client;return _0x1292c8[_0xa165('0x22')](_0x41f59e,_0x4e13ad)['then'](function(_0x18ae91){logger[_0xa165('0x23')](_0xa165('0x24'),_0x4f2531,_0xa165('0x25'));logger[_0xa165('0x26')](_0xa165('0x27'),_0x4f2531,_0xa165('0x25'),JSON[_0xa165('0x28')](_0x18ae91));if(_0x18ae91[_0xa165('0x29')]){if(_0x18ae91[_0xa165('0x29')][_0xa165('0x2a')]===0x1f4){logger[_0xa165('0x29')](_0xa165('0x24'),_0x4f2531,_0x18ae91[_0xa165('0x29')][_0xa165('0x2b')]);return _0x4d26c9(_0x18ae91[_0xa165('0x29')][_0xa165('0x2b')]);}logger[_0xa165('0x29')](_0xa165('0x24'),_0x4f2531,_0x18ae91[_0xa165('0x29')][_0xa165('0x2b')]);return _0x35cffb(_0x18ae91[_0xa165('0x29')][_0xa165('0x2b')]);}else{logger['info'](_0xa165('0x24'),_0x4f2531,_0xa165('0x25'));_0x35cffb(_0x18ae91[_0xa165('0x2c')][_0xa165('0x2b')]);}})['catch'](function(_0x4dcade){logger[_0xa165('0x29')](_0xa165('0x24'),_0x4f2531,_0x4dcade);_0x4d26c9(_0x4dcade);});});}function respondWithStatusCode(_0x468143,_0x14577d){_0x14577d=_0x14577d||0xcc;return function(_0x473aa3){if(_0x473aa3){return _0x468143[_0xa165('0x2d')](_0x14577d);}return _0x468143['status'](_0x14577d)[_0xa165('0x2e')]();};}function respondWithResult(_0xe17a9a,_0x434b67){_0x434b67=_0x434b67||0xc8;return function(_0x573794){if(_0x573794){return _0xe17a9a[_0xa165('0x2f')](_0x434b67)[_0xa165('0x30')](_0x573794);}};}function respondWithFilteredResult(_0x30802b,_0xfd3877){return function(_0x5da2bb){if(_0x5da2bb){var _0x4f979d=typeof _0xfd3877['offset']==='undefined'&&typeof _0xfd3877['limit']==='undefined';var _0x250f91=_0x5da2bb[_0xa165('0x31')];var _0x1e2163=_0x4f979d?0x0:_0xfd3877[_0xa165('0x32')];var _0x10dca7=_0x4f979d?_0x5da2bb[_0xa165('0x31')]:_0xfd3877['offset']+_0xfd3877[_0xa165('0x33')];var _0x1c552d;if(_0x10dca7>=_0x250f91){_0x10dca7=_0x250f91;_0x1c552d=0xc8;}else{_0x1c552d=0xce;}_0x30802b['status'](_0x1c552d);return _0x30802b[_0xa165('0x34')](_0xa165('0x35'),_0x1e2163+'-'+_0x10dca7+'/'+_0x250f91)['json'](_0x5da2bb);}return null;};}function patchUpdates(_0x2b5cff){return function(_0x1bbe47){try{jsonpatch['apply'](_0x1bbe47,_0x2b5cff,!![]);}catch(_0x57bdaa){return BPromise[_0xa165('0x36')](_0x57bdaa);}return _0x1bbe47[_0xa165('0x37')]();};}function saveUpdates(_0x229c4a,_0x29c7d1){return function(_0x62bcdb){if(_0x62bcdb){return _0x62bcdb[_0xa165('0x38')](_0x229c4a)[_0xa165('0x39')](function(_0x4be124){return _0x4be124;});}return null;};}function removeEntity(_0x10f05d,_0x35b4ea){return function(_0x2c219d){if(_0x2c219d){return _0x2c219d[_0xa165('0x3a')]()[_0xa165('0x39')](function(){_0x10f05d['status'](0xcc)[_0xa165('0x2e')]();});}};}function handleEntityNotFound(_0x467869,_0x11ec41){return function(_0x533133){if(!_0x533133){_0x467869[_0xa165('0x2d')](0x194);}return _0x533133;};}function handleError(_0xa82885,_0xbfd8a3){_0xbfd8a3=_0xbfd8a3||0x1f4;return function(_0x2501bd){logger[_0xa165('0x29')](_0x2501bd[_0xa165('0x3b')]);if(_0x2501bd['name']){delete _0x2501bd['name'];}_0xa82885[_0xa165('0x2f')](_0xbfd8a3)[_0xa165('0x3c')](_0x2501bd);};}exports['index']=function(_0x353db0,_0x28b31a){var _0x19bea5={},_0x27729f={},_0x44e797={'count':0x0,'rows':[]};var _0x3bc708=_['map'](db['OpenchannelMessage'][_0xa165('0x3d')],function(_0x46efdb){return{'name':_0x46efdb[_0xa165('0x3e')],'type':_0x46efdb['type'][_0xa165('0x3f')]};});_0x27729f[_0xa165('0x40')]=_['map'](_0x3bc708,_0xa165('0x41'));_0x27729f[_0xa165('0x42')]=_[_0xa165('0x43')](_0x353db0[_0xa165('0x42')]);_0x27729f[_0xa165('0x44')]=_[_0xa165('0x45')](_0x27729f[_0xa165('0x40')],_0x27729f['query']);_0x19bea5['attributes']=_['intersection'](_0x27729f[_0xa165('0x40')],qs[_0xa165('0x46')](_0x353db0[_0xa165('0x42')][_0xa165('0x46')]));_0x19bea5['attributes']=_0x19bea5[_0xa165('0x47')][_0xa165('0x48')]?_0x19bea5['attributes']:_0x27729f[_0xa165('0x40')];if(!_0x353db0[_0xa165('0x42')][_0xa165('0x49')](_0xa165('0x4a'))){_0x19bea5[_0xa165('0x33')]=qs[_0xa165('0x33')](_0x353db0[_0xa165('0x42')][_0xa165('0x33')]);_0x19bea5[_0xa165('0x32')]=qs[_0xa165('0x32')](_0x353db0['query'][_0xa165('0x32')]);}_0x19bea5[_0xa165('0x4b')]=qs['sort'](_0x353db0['query'][_0xa165('0x4c')]);_0x19bea5['where']=qs[_0xa165('0x44')](_[_0xa165('0x4d')](_0x353db0[_0xa165('0x42')],_0x27729f[_0xa165('0x44')]),_0x3bc708);if(_0x353db0[_0xa165('0x42')]['filter']){_0x19bea5[_0xa165('0x4e')]=_[_0xa165('0x4f')](_0x19bea5['where'],{'$or':_['map'](_0x3bc708,function(_0x16c553){if(_0x16c553[_0xa165('0x50')]!=='VIRTUAL'){var _0x184194={};_0x184194[_0x16c553[_0xa165('0x41')]]={'$like':'%'+_0x353db0[_0xa165('0x42')][_0xa165('0x51')]+'%'};return _0x184194;}})});}_0x19bea5=_[_0xa165('0x4f')]({},_0x19bea5,_0x353db0[_0xa165('0x52')]);var _0x1060a2={'where':_0x19bea5[_0xa165('0x4e')]};return db['OpenchannelMessage'][_0xa165('0x31')](_0x1060a2)[_0xa165('0x39')](function(_0x22ec5a){_0x44e797[_0xa165('0x31')]=_0x22ec5a;if(_0x353db0[_0xa165('0x42')][_0xa165('0x53')]){_0x19bea5[_0xa165('0x54')]=[{'all':!![]}];}return db[_0xa165('0x55')]['findAll'](_0x19bea5);})[_0xa165('0x39')](function(_0x1bd04b){_0x44e797[_0xa165('0x56')]=_0x1bd04b;return _0x44e797;})[_0xa165('0x39')](respondWithFilteredResult(_0x28b31a,_0x19bea5))[_0xa165('0x57')](handleError(_0x28b31a,null));};exports[_0xa165('0x58')]=function(_0x33990b,_0x5c7c8a){var _0x54dd03={'raw':!![],'where':{'id':_0x33990b[_0xa165('0x59')]['id']}},_0x3f9d8a={};_0x3f9d8a['model']=_['keys'](db[_0xa165('0x55')][_0xa165('0x3d')]);_0x3f9d8a['query']=_[_0xa165('0x43')](_0x33990b[_0xa165('0x42')]);_0x3f9d8a['filters']=_[_0xa165('0x45')](_0x3f9d8a[_0xa165('0x40')],_0x3f9d8a[_0xa165('0x42')]);_0x54dd03[_0xa165('0x47')]=_[_0xa165('0x45')](_0x3f9d8a['model'],qs[_0xa165('0x46')](_0x33990b[_0xa165('0x42')]['fields']));_0x54dd03[_0xa165('0x47')]=_0x54dd03[_0xa165('0x47')][_0xa165('0x48')]?_0x54dd03['attributes']:_0x3f9d8a[_0xa165('0x40')];if(_0x33990b['query'][_0xa165('0x53')]){_0x54dd03[_0xa165('0x54')]=[{'all':!![]}];}_0x54dd03=_[_0xa165('0x4f')]({},_0x54dd03,_0x33990b[_0xa165('0x52')]);return db[_0xa165('0x55')][_0xa165('0x5a')](_0x54dd03)[_0xa165('0x39')](handleEntityNotFound(_0x5c7c8a,null))[_0xa165('0x39')](respondWithResult(_0x5c7c8a,null))[_0xa165('0x57')](handleError(_0x5c7c8a,null));};exports['create']=function(_0x4502f7,_0x1e7d12){return db[_0xa165('0x55')][_0xa165('0x5b')](_0x4502f7[_0xa165('0x5c')],{})[_0xa165('0x39')](respondWithResult(_0x1e7d12,0xc9))[_0xa165('0x57')](handleError(_0x1e7d12,null));};exports[_0xa165('0x38')]=function(_0x3d74b2,_0x576745){if(_0x3d74b2['body']['id']){delete _0x3d74b2[_0xa165('0x5c')]['id'];}return db[_0xa165('0x55')][_0xa165('0x5a')]({'where':{'id':_0x3d74b2['params']['id']}})[_0xa165('0x39')](handleEntityNotFound(_0x576745,null))[_0xa165('0x39')](saveUpdates(_0x3d74b2[_0xa165('0x5c')],null))[_0xa165('0x39')](respondWithResult(_0x576745,null))['catch'](handleError(_0x576745,null));};exports[_0xa165('0x3a')]=function(_0x3d35e5,_0x1f5591){return db[_0xa165('0x55')]['find']({'where':{'id':_0x3d35e5[_0xa165('0x59')]['id']}})[_0xa165('0x39')](handleEntityNotFound(_0x1f5591,null))[_0xa165('0x39')](removeEntity(_0x1f5591,null))[_0xa165('0x57')](handleError(_0x1f5591,null));};exports['describe']=function(_0x1635e5,_0x10071a){return db[_0xa165('0x55')][_0xa165('0x5d')]()[_0xa165('0x39')](respondWithResult(_0x10071a,null))[_0xa165('0x57')](handleError(_0x10071a,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xa165('0x5e')]=function(_0x8092a9,_0x15518b,_0x36c9d9){var _0x785334={'agent':{},'channel':_0xa165('0x5f')};if(_0x8092a9[_0xa165('0x5c')]['id']){delete _0x8092a9[_0xa165('0x5c')]['id'];}_0x8092a9[_0xa165('0x5c')][_0xa165('0x60')]=!![];_0x8092a9[_0xa165('0x5c')][_0xa165('0x61')]=moment()[_0xa165('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x8092a9[_0xa165('0x5c')]['UserId']=_0x8092a9[_0xa165('0x5c')][_0xa165('0x63')]||_0x8092a9[_0xa165('0x64')]['id'];_0x785334[_0xa165('0x65')]['id']=_0x8092a9[_0xa165('0x5c')][_0xa165('0x63')];return db[_0xa165('0x55')]['find']({'where':{'id':_0x8092a9[_0xa165('0x59')]['id'],'UserId':null}})[_0xa165('0x39')](handleEntityNotFound(_0x15518b,null))[_0xa165('0x39')](saveUpdates(_0x8092a9[_0xa165('0x5c')],null))[_0xa165('0x39')](function(_0x589347){if(_0x589347){_0x785334[_0xa165('0x2b')]=_0x589347[_0xa165('0x66')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x589347[_0xa165('0x67')]}});}return null;})[_0xa165('0x39')](handleEntityNotFound(_0x15518b,null))[_0xa165('0x39')](function(_0x5a9b23){if(_0x5a9b23){return _0x5a9b23[_0xa165('0x38')]({'UserId':_0x8092a9[_0xa165('0x5c')][_0xa165('0x63')],'read1stAt':_['isNil'](_0x5a9b23[_0xa165('0x68')])?moment()[_0xa165('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x18d7b4){if(_0x18d7b4){_0x785334[_0xa165('0x69')]=_0x18d7b4[_0xa165('0x66')]({'plain':!![]});interaction_log[_0xa165('0x23')](_0xa165('0x6a'),_0x8092a9[_0xa165('0x64')]['id'],_0x8092a9[_0xa165('0x64')][_0xa165('0x41')],_0x8092a9[_0xa165('0x64')][_0xa165('0x6b')],_0x785334[_0xa165('0x69')]['id'],_0x8092a9[_0xa165('0x5c')]?JSON[_0xa165('0x28')](_0x8092a9[_0xa165('0x5c')]):_0xa165('0x6c'));return respondWithRpcPromise('AcceptMessage',_0xa165('0x6d'),_0x785334);}return null;})[_0xa165('0x39')](function(_0xd84b06){var _0x3c8584=_0xa165('0x6e')+_0xd84b06[_0xa165('0x2b')]['ContactId'];return db[_0xa165('0x6f')][_0xa165('0x42')](_0x3c8584,{'type':db[_0xa165('0x70')][_0xa165('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x5c5ac8){return _0x5c5ac8;});})[_0xa165('0x39')](function(_0xa0551){if(_0xa0551){_0x785334[_0xa165('0x2b')][_0xa165('0x72')]=_0xa0551[0x0];if(!_0x8092a9[_0xa165('0x5c')][_0xa165('0x63')])return;return db[_0xa165('0x73')][_0xa165('0x5a')]({'where':{'id':_0x8092a9['body']['UserId'],'role':'agent'},'attributes':['id',_0xa165('0x41'),_0xa165('0x74'),_0xa165('0x75'),_0xa165('0x76')],'raw':!![]});}return null;})[_0xa165('0x39')](function(_0x36e26a){if(!_0x36e26a)return null;_0x785334[_0xa165('0x2b')][_0xa165('0x65')]=_0x36e26a;return _0x785334;})[_0xa165('0x39')](function(_0x2e94b0){if(_0x2e94b0){if(_0x8092a9['body'][_0xa165('0x77')]){_0x785334[_0xa165('0x2b')][_0xa165('0x78')]=util[_0xa165('0x62')](_0xa165('0x79'),_0x8092a9['user']['name']);_0x785334['message'][_0xa165('0x7a')]=_0x785334['channel'];_0x785334[_0xa165('0x2b')]['motionChannel']=_0x785334[_0xa165('0x7a')];_0x785334[_0xa165('0x2b')][_0xa165('0x7b')]='accept';return respondWithRpcPromise(_0xa165('0x7c'),'EventManager',{'event':_0xa165('0x7d'),'message':_0x785334[_0xa165('0x2b')]},client9002)[_0xa165('0x39')](function(){return _0x785334;});}return _0x785334;}return null;})[_0xa165('0x39')](respondWithResult(_0x15518b,null))[_0xa165('0x57')](handleError(_0x15518b,null));};var interaction_log=require('../../config/logger')(_0xa165('0x7e'));exports[_0xa165('0x36')]=function(_0x4071ac,_0x4e2708,_0x5e4e15){var _0x3cb0d5={'agent':{},'channel':'openchannel'};if(_0x4071ac[_0xa165('0x5c')]['id']){delete _0x4071ac[_0xa165('0x5c')]['id'];}_0x4071ac[_0xa165('0x5c')][_0xa165('0x63')]=_0x4071ac[_0xa165('0x5c')][_0xa165('0x63')]||_0x4071ac['user']['id'];_0x3cb0d5['agent']['id']=_0x4071ac['body'][_0xa165('0x63')];return db['OpenchannelMessage'][_0xa165('0x5a')]({'where':{'id':_0x4071ac[_0xa165('0x59')]['id'],'UserId':null}})[_0xa165('0x39')](handleEntityNotFound(_0x4e2708,null))[_0xa165('0x39')](function(_0x33894f){if(_0x33894f){_0x3cb0d5['message']=_0x33894f[_0xa165('0x66')]({'plain':!![]});return db[_0xa165('0x7f')][_0xa165('0x5a')]({'where':{'id':_0x33894f['OpenchannelInteractionId']}});}return null;})[_0xa165('0x39')](handleEntityNotFound(_0x4e2708,null))[_0xa165('0x39')](function(_0x573910){if(_0x573910){_0x3cb0d5[_0xa165('0x69')]=_0x573910[_0xa165('0x66')]({'plain':!![]});interaction_log[_0xa165('0x23')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4071ac[_0xa165('0x64')]['id'],_0x4071ac[_0xa165('0x64')][_0xa165('0x41')],_0x4071ac[_0xa165('0x64')][_0xa165('0x6b')],_0x3cb0d5['interaction']['id'],_0x4071ac[_0xa165('0x5c')]?JSON[_0xa165('0x28')](_0x4071ac['body']):'null');return respondWithRpcPromise('RejectMessage',_0xa165('0x80'),_0x3cb0d5);}return null;})[_0xa165('0x39')](function(_0x5363cd){var _0x25cfbd=_0xa165('0x6e')+_0x5363cd[_0xa165('0x2b')][_0xa165('0x81')];return db[_0xa165('0x6f')][_0xa165('0x42')](_0x25cfbd,{'type':db[_0xa165('0x70')][_0xa165('0x71')][_0xa165('0x82')],'raw':!![]})[_0xa165('0x39')](function(_0x4bc580){return _0x4bc580;});})['then'](function(_0x4d193f){if(_0x4d193f){_0x3cb0d5['message'][_0xa165('0x72')]=_0x4d193f[0x0];if(!_0x4071ac[_0xa165('0x5c')][_0xa165('0x63')])return;return db[_0xa165('0x73')]['find']({'where':{'id':_0x4071ac['body']['UserId'],'role':_0xa165('0x65')},'attributes':['id',_0xa165('0x41'),_0xa165('0x74'),_0xa165('0x75'),_0xa165('0x76')],'raw':!![]});}return null;})[_0xa165('0x39')](function(_0x4538cd){if(!_0x4538cd)return null;_0x3cb0d5[_0xa165('0x2b')][_0xa165('0x65')]=_0x4538cd;return _0x3cb0d5;})[_0xa165('0x39')](function(_0x510126){if(_0x510126){_0x510126['message'][_0xa165('0x78')]=util['format'](_0xa165('0x79'),_0x4071ac[_0xa165('0x64')]['name']);_0x510126[_0xa165('0x2b')][_0xa165('0x7a')]=_0x3cb0d5[_0xa165('0x7a')];_0x510126['message'][_0xa165('0x83')]=_0x3cb0d5[_0xa165('0x7a')];_0x510126[_0xa165('0x2b')][_0xa165('0x7b')]=_0xa165('0x36');respondWithRpcPromise(_0xa165('0x7c'),_0xa165('0x7c'),{'event':_0xa165('0x84'),'message':_0x510126[_0xa165('0x2b')]},client9002);return _0x3cb0d5;}return null;})[_0xa165('0x39')](respondWithResult(_0x4e2708,null))[_0xa165('0x57')](handleError(_0x4e2708,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 8e9dc61..ac55454 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 _0x30c5=['exports','events','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3a9e7f,_0x476ae3){var _0x2a6023=function(_0x45a92d){while(--_0x45a92d){_0x3a9e7f['push'](_0x3a9e7f['shift']());}};_0x2a6023(++_0x476ae3);}(_0x30c5,0x1d6));var _0x530c=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x30c5[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x530c('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x530c('0x1')](0x0);var events={'afterCreate':_0x530c('0x2'),'afterUpdate':_0x530c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1099db){return function(_0x240d56,_0x1e10e1,_0x5839fa){OpenchannelMessageEvents[_0x530c('0x4')](_0x1099db+':'+_0x240d56['id'],_0x240d56);OpenchannelMessageEvents[_0x530c('0x4')](_0x1099db,_0x240d56);_0x5839fa(null);};}for(var e in events){if(events[_0x530c('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x530c('0x6')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x22e9=['emit','hasOwnProperty','exports','events','OpenchannelMessage','setMaxListeners','save','update','remove'];(function(_0x39b213,_0x4fe3c8){var _0xe7f3a0=function(_0x2d1dad){while(--_0x2d1dad){_0x39b213['push'](_0x39b213['shift']());}};_0xe7f3a0(++_0x4fe3c8);}(_0x22e9,0x1d7));var _0x922e=function(_0x395667,_0x45593a){_0x395667=_0x395667-0x0;var _0x5cdb8f=_0x22e9[_0x395667];return _0x5cdb8f;};'use strict';var EventEmitter=require(_0x922e('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x922e('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x922e('0x2')](0x0);var events={'afterCreate':_0x922e('0x3'),'afterUpdate':_0x922e('0x4'),'afterDestroy':_0x922e('0x5')};function emitEvent(_0x294416){return function(_0x571812,_0x43992c,_0x26ce41){OpenchannelMessageEvents['emit'](_0x294416+':'+_0x571812['id'],_0x571812);OpenchannelMessageEvents[_0x922e('0x6')](_0x294416,_0x571812);_0x26ce41(null);};}for(var e in events){if(events[_0x922e('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x922e('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index d9976c6..bf9a122 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 _0x41d2=['OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','out','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','Contact','keys','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','POST','method','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','OpenchannelMessage','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil'];(function(_0xaff1d2,_0x423d2a){var _0x32f4ed=function(_0xb3d115){while(--_0xb3d115){_0xaff1d2['push'](_0xaff1d2['shift']());}};_0x32f4ed(++_0x423d2a);}(_0x41d2,0x11a));var _0x241d=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x41d2[_0x1ed116];return _0x574066;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x241d('0x0'))(_0x241d('0x1'));var moment=require(_0x241d('0x2'));var BPromise=require(_0x241d('0x3'));var rp=require(_0x241d('0x4'));var fs=require('fs');var path=require(_0x241d('0x5'));var rimraf=require('rimraf');var config=require(_0x241d('0x6'));var attributes=require('./openchannelMessage.attributes');module[_0x241d('0x7')]=function(_0x40cbe9,_0x5bc284){return _0x40cbe9[_0x241d('0x8')](_0x241d('0x9'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x241d('0xa')],'type':_0x241d('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4851a8,_0x8e04c2,_0x175d17){var _0x208fee=_0x40cbe9[_0x241d('0xc')];var _0x5493c8=_0x4851a8[_0x241d('0xd')]({'plain':!![]});if(_0x5493c8[_0x241d('0xe')]['toLowerCase']()==='in'||_0x5493c8[_0x241d('0xe')][_0x241d('0xf')]()==='out'&&!_0x5493c8[_0x241d('0x10')]&&!_[_0x241d('0x11')](_0x5493c8['UserId'])){_0x208fee[_0x241d('0x12')][_0x241d('0x13')]({'where':{'id':_0x5493c8[_0x241d('0x14')]}})[_0x241d('0x15')](function(_0x2e186d){if(_0x2e186d){_0x2e186d[_0x241d('0x16')]({'lastMsgAt':_0x5493c8[_0x241d('0x17')],'lastMsgDirection':_0x5493c8[_0x241d('0xe')]['toLowerCase']()});}})[_0x241d('0x18')](function(_0x4da088){console['error'](_0x4da088);});}if(_0x5493c8[_0x241d('0xe')]===_0x241d('0x19')&&!_0x5493c8[_0x241d('0x10')]){var _0x526cef;_0x208fee[_0x241d('0x1a')][_0x241d('0x1b')]()['then'](function(_0x3f1189){return _0x208fee[_0x241d('0x1c')]['find']({'where':{'id':_0x5493c8[_0x241d('0x1d')]},'include':[{'model':_0x208fee[_0x241d('0x12')],'as':_0x241d('0x1e'),'where':{'id':_0x5493c8[_0x241d('0x14')]},'limit':0x1,'include':[{'model':_0x208fee[_0x241d('0x1a')],'as':_0x241d('0x1f'),'attributes':_[_0x241d('0x20')](_0x3f1189)}]}]});})[_0x241d('0x15')](function(_0x6aadb2){_0x526cef=_0x6aadb2[_0x241d('0xd')]({'plain':!![]});if(_0x526cef&&_0x526cef['replyUri']){logger['info'](_0x241d('0x21'),_0x241d('0x22'),util['format'](_0x241d('0x23'),_0x5493c8['id'],_0x526cef[_0x241d('0x24')]));if(_0x526cef[_0x241d('0x1e')]&&_0x526cef[_0x241d('0x1e')][_0x241d('0x25')]){_0x5493c8[_0x241d('0x26')]=_[_0x241d('0x27')](_0x526cef[_0x241d('0x1e')][0x0],_0x241d('0x1f'));_0x5493c8[_0x241d('0x1f')]=_0x526cef[_0x241d('0x1e')][0x0]['Contact'];}var _0x8e04c2={'method':_0x241d('0x28'),'uri':encodeURI(_0x526cef[_0x241d('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x8e04c2[_0x241d('0x29')]){case'GET':_0x8e04c2['qs']=_0x5493c8;break;case _0x241d('0x28'):_0x8e04c2[_0x241d('0xa')]=_0x5493c8;break;}return rp(_0x8e04c2)[_0x241d('0x15')](function(_0x15ccf4){logger[_0x241d('0x2a')]('OpenchannelMessage,\x20%s,\x20%s',_0x241d('0x22'),util['format'](_0x241d('0x2b'),_0x5493c8['id'],_0x526cef[_0x241d('0x24')]));if(_0x15ccf4['body']['threadId']&&_0x15ccf4[_0x241d('0xa')][_0x241d('0x2c')]!=_0x5493c8[_0x241d('0x26')][_0x241d('0x2c')]){return _0x208fee[_0x241d('0x12')][_0x241d('0x16')]({'threadId':_0x15ccf4[_0x241d('0xa')][_0x241d('0x2c')]},{'where':{'id':_0x5493c8['Interaction']['id']}});}else{return;}})[_0x241d('0x15')](function(){return _0x4851a8['update']({'read':!![]});})['catch'](function(_0x367fcb){logger[_0x241d('0x2d')](_0x241d('0x21'),_0x241d('0x22'),util[_0x241d('0x2e')](_0x367fcb,{'showHidden':![],'depth':null}));_0x175d17();});}else{_0x175d17();}})[_0x241d('0x2f')](function(){_0x175d17();});}else{_0x175d17();}}},'charset':_0x241d('0x30'),'collate':_0x241d('0x31')});}; \ No newline at end of file +var _0xa856=['./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','update','createdAt','catch','error','CmContact','then','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','GET','body','threadId','inspect','finally','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1cac97,_0x14901b){var _0xc47a1=function(_0xd30b64){while(--_0xd30b64){_0x1cac97['push'](_0x1cac97['shift']());}};_0xc47a1(++_0x14901b);}(_0xa856,0x130));var _0x6a85=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa856[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6a85('0x0'));var util=require('util');var logger=require(_0x6a85('0x1'))('api');var moment=require(_0x6a85('0x2'));var BPromise=require(_0x6a85('0x3'));var rp=require(_0x6a85('0x4'));var fs=require('fs');var path=require(_0x6a85('0x5'));var rimraf=require(_0x6a85('0x6'));var config=require(_0x6a85('0x7'));var attributes=require(_0x6a85('0x8'));module[_0x6a85('0x9')]=function(_0x3d5b32,_0x1e14b0){return _0x3d5b32['define'](_0x6a85('0xa'),attributes,{'tableName':_0x6a85('0xb'),'paranoid':![],'indexes':[{'name':_0x6a85('0xc'),'fields':['body'],'type':_0x6a85('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f8a6e,_0x1e9d66,_0x39a2db){var _0x1f1cb1=_0x3d5b32[_0x6a85('0xe')];var _0x55d1f1=_0x3f8a6e[_0x6a85('0xf')]({'plain':!![]});if(_0x55d1f1[_0x6a85('0x10')]['toLowerCase']()==='in'||_0x55d1f1[_0x6a85('0x10')][_0x6a85('0x11')]()===_0x6a85('0x12')&&!_0x55d1f1[_0x6a85('0x13')]&&!_[_0x6a85('0x14')](_0x55d1f1[_0x6a85('0x15')])){_0x1f1cb1[_0x6a85('0x16')]['findOne']({'where':{'id':_0x55d1f1[_0x6a85('0x17')]}})['then'](function(_0x4bf348){if(_0x4bf348){_0x4bf348[_0x6a85('0x18')]({'lastMsgAt':_0x55d1f1[_0x6a85('0x19')],'lastMsgDirection':_0x55d1f1[_0x6a85('0x10')]['toLowerCase']()});}})[_0x6a85('0x1a')](function(_0x269621){console[_0x6a85('0x1b')](_0x269621);});}if(_0x55d1f1[_0x6a85('0x10')]===_0x6a85('0x12')&&!_0x55d1f1[_0x6a85('0x13')]){var _0x42d11f;_0x1f1cb1[_0x6a85('0x1c')]['describe']()[_0x6a85('0x1d')](function(_0x3421c1){return _0x1f1cb1[_0x6a85('0x1e')][_0x6a85('0x1f')]({'where':{'id':_0x55d1f1[_0x6a85('0x20')]},'include':[{'model':_0x1f1cb1[_0x6a85('0x16')],'as':_0x6a85('0x21'),'where':{'id':_0x55d1f1[_0x6a85('0x17')]},'limit':0x1,'include':[{'model':_0x1f1cb1['CmContact'],'as':_0x6a85('0x22'),'attributes':_[_0x6a85('0x23')](_0x3421c1)}]}]});})[_0x6a85('0x1d')](function(_0x5ee6a8){_0x42d11f=_0x5ee6a8[_0x6a85('0xf')]({'plain':!![]});if(_0x42d11f&&_0x42d11f[_0x6a85('0x24')]){logger[_0x6a85('0x25')](_0x6a85('0x26'),_0x6a85('0x27'),util[_0x6a85('0x28')](_0x6a85('0x29'),_0x55d1f1['id'],_0x42d11f['replyUri']));if(_0x42d11f[_0x6a85('0x21')]&&_0x42d11f[_0x6a85('0x21')][_0x6a85('0x2a')]){_0x55d1f1[_0x6a85('0x2b')]=_[_0x6a85('0x2c')](_0x42d11f['Interactions'][0x0],'Contact');_0x55d1f1[_0x6a85('0x22')]=_0x42d11f[_0x6a85('0x21')][0x0]['Contact'];}var _0x1e9d66={'method':'POST','uri':encodeURI(_0x42d11f[_0x6a85('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1e9d66[_0x6a85('0x2d')]){case _0x6a85('0x2e'):_0x1e9d66['qs']=_0x55d1f1;break;case'POST':_0x1e9d66[_0x6a85('0x2f')]=_0x55d1f1;break;}return rp(_0x1e9d66)['then'](function(_0x39b776){logger[_0x6a85('0x25')](_0x6a85('0x26'),_0x6a85('0x27'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x55d1f1['id'],_0x42d11f[_0x6a85('0x24')]));if(_0x39b776[_0x6a85('0x2f')][_0x6a85('0x30')]&&_0x39b776['body'][_0x6a85('0x30')]!=_0x55d1f1[_0x6a85('0x2b')]['threadId']){return _0x1f1cb1[_0x6a85('0x16')][_0x6a85('0x18')]({'threadId':_0x39b776['body'][_0x6a85('0x30')]},{'where':{'id':_0x55d1f1[_0x6a85('0x2b')]['id']}});}else{return;}})[_0x6a85('0x1d')](function(){return _0x3f8a6e[_0x6a85('0x18')]({'read':!![]});})[_0x6a85('0x1a')](function(_0x48aafc){logger['error'](_0x6a85('0x26'),_0x6a85('0x27'),util[_0x6a85('0x31')](_0x48aafc,{'showHidden':![],'depth':null}));_0x39a2db();});}else{_0x39a2db();}})[_0x6a85('0x32')](function(){_0x39a2db();});}else{_0x39a2db();}}},'charset':'utf8mb4','collate':_0x6a85('0x33')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 6e670e3..9028344 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 _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x1e4cc4,_0xc6ffa7){var _0xfaa999=function(_0x1b3143){while(--_0x1b3143){_0x1e4cc4['push'](_0x1e4cc4['shift']());}};_0xfaa999(++_0xc6ffa7);}(_0xadb5,0xad));var _0x5adb=function(_0x2979d5,_0x6abe3b){_0x2979d5=_0x2979d5-0x0;var _0x15dcb8=_0xadb5[_0x2979d5];return _0x15dcb8;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3cee53,_0x4533b4){var _0x26d214=function(_0x515d41){while(--_0x515d41){_0x3cee53['push'](_0x3cee53['shift']());}};_0x26d214(++_0x4533b4);}(_0x7a54,0x106));var _0x47a5=function(_0x53f410,_0x465aed){_0x53f410=_0x53f410-0x0;var _0x4657ed=_0x7a54[_0x53f410];return _0x4657ed;};'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});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 0de6792..3602daf 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 _0x79dd=['length','./openchannelMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x468761,_0x337f30){var _0x434ac2=function(_0x4894c9){while(--_0x4894c9){_0x468761['push'](_0x468761['shift']());}};_0x434ac2(++_0x337f30);}(_0x79dd,0x1f1));var _0xd79d=function(_0x45f6cb,_0x531af6){_0x45f6cb=_0x45f6cb-0x0;var _0x5b7f93=_0x79dd[_0x45f6cb];return _0x5b7f93;};'use strict';var OpenchannelMessageEvents=require(_0xd79d('0x0'));var events=[_0xd79d('0x1'),_0xd79d('0x2'),_0xd79d('0x3')];function createListener(_0x5eb8f3,_0x1c278d){return function(_0x413a9d){_0x1c278d[_0xd79d('0x4')](_0x5eb8f3,_0x413a9d);};}function removeListener(_0x3dcf5d,_0x14559d){return function(){OpenchannelMessageEvents[_0xd79d('0x5')](_0x3dcf5d,_0x14559d);};}exports[_0xd79d('0x6')]=function(_0x3a969c){for(var _0xd9c417=0x0,_0x501982=events[_0xd79d('0x7')];_0xd9c417<_0x501982;_0xd9c417++){var _0x2ec1ad=events[_0xd9c417];var _0xbc8c4c=createListener('openchannelMessage:'+_0x2ec1ad,_0x3a969c);OpenchannelMessageEvents['on'](_0x2ec1ad,_0xbc8c4c);}}; \ No newline at end of file +var _0x2a56=['save','update','emit','removeListener','register','length','openchannelMessage:'];(function(_0x3540eb,_0x8ab7ca){var _0x2c5278=function(_0x1b97b5){while(--_0x1b97b5){_0x3540eb['push'](_0x3540eb['shift']());}};_0x2c5278(++_0x8ab7ca);}(_0x2a56,0xaf));var _0x62a5=function(_0x8678c8,_0x3488e1){_0x8678c8=_0x8678c8-0x0;var _0x107da4=_0x2a56[_0x8678c8];return _0x107da4;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x62a5('0x0'),'remove',_0x62a5('0x1')];function createListener(_0x236dfe,_0x6ce1ef){return function(_0x315f00){_0x6ce1ef[_0x62a5('0x2')](_0x236dfe,_0x315f00);};}function removeListener(_0x4d2fa7,_0x280fad){return function(){OpenchannelMessageEvents[_0x62a5('0x3')](_0x4d2fa7,_0x280fad);};}exports[_0x62a5('0x4')]=function(_0x40bd58){for(var _0x19444d=0x0,_0x206ee4=events[_0x62a5('0x5')];_0x19444d<_0x206ee4;_0x19444d++){var _0x22ae0d=events[_0x19444d];var _0x4b376d=createListener(_0x62a5('0x6')+_0x22ae0d,_0x40bd58);OpenchannelMessageEvents['on'](_0x22ae0d,_0x4b376d);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 5bbb11b..2593e0e 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 _0xe937=['getTeams','/:id/users','getAgents','post','addAgents','put','delete','/:id','destroy','removeAgents','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','show','/:id/members','getMembers','/:id/teams'];(function(_0x316441,_0x3309b4){var _0x38a3ba=function(_0x661be1){while(--_0x661be1){_0x316441['push'](_0x316441['shift']());}};_0x38a3ba(++_0x3309b4);}(_0xe937,0xe2));var _0x7e93=function(_0xa04cde,_0x108919){_0xa04cde=_0xa04cde-0x0;var _0x27ae1f=_0xe937[_0xa04cde];return _0x27ae1f;};'use strict';var multer=require('multer');var util=require(_0x7e93('0x0'));var path=require(_0x7e93('0x1'));var timeout=require(_0x7e93('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7e93('0x3'));var auth=require(_0x7e93('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7e93('0x5'));var controller=require('./openchannelQueue.controller');router[_0x7e93('0x6')]('/',auth[_0x7e93('0x7')](),controller[_0x7e93('0x8')]);router[_0x7e93('0x6')](_0x7e93('0x9'),auth[_0x7e93('0x7')](),controller['describe']);router[_0x7e93('0x6')]('/:id',auth[_0x7e93('0x7')](),controller[_0x7e93('0xa')]);router[_0x7e93('0x6')](_0x7e93('0xb'),auth[_0x7e93('0x7')](),controller[_0x7e93('0xc')]);router[_0x7e93('0x6')](_0x7e93('0xd'),auth[_0x7e93('0x7')](),controller[_0x7e93('0xe')]);router[_0x7e93('0x6')](_0x7e93('0xf'),auth['isAuthenticated'](),controller[_0x7e93('0x10')]);router[_0x7e93('0x11')]('/',auth[_0x7e93('0x7')](),controller['create']);router[_0x7e93('0x11')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x7e93('0x11')](_0x7e93('0xf'),auth[_0x7e93('0x7')](),controller[_0x7e93('0x12')]);router[_0x7e93('0x13')]('/:id',auth[_0x7e93('0x7')](),controller['update']);router[_0x7e93('0x14')](_0x7e93('0x15'),auth[_0x7e93('0x7')](),controller[_0x7e93('0x16')]);router[_0x7e93('0x14')]('/:id/teams',auth[_0x7e93('0x7')](),controller['removeTeams']);router['delete'](_0x7e93('0xf'),auth[_0x7e93('0x7')](),controller[_0x7e93('0x17')]);module['exports']=router; \ No newline at end of file +var _0x709b=['removeTeams','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','isAuthenticated','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete'];(function(_0x1f47ff,_0x2043a9){var _0x40e7de=function(_0x1deb15){while(--_0x1deb15){_0x1f47ff['push'](_0x1f47ff['shift']());}};_0x40e7de(++_0x2043a9);}(_0x709b,0x18a));var _0xb709=function(_0x70f1b2,_0x400e15){_0x70f1b2=_0x70f1b2-0x0;var _0x55ac09=_0x709b[_0x70f1b2];return _0x55ac09;};'use strict';var multer=require(_0xb709('0x0'));var util=require(_0xb709('0x1'));var path=require(_0xb709('0x2'));var timeout=require(_0xb709('0x3'));var express=require(_0xb709('0x4'));var router=express['Router']();var fs_extra=require(_0xb709('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb709('0x6'));var config=require(_0xb709('0x7'));var controller=require(_0xb709('0x8'));router[_0xb709('0x9')]('/',auth['isAuthenticated'](),controller[_0xb709('0xa')]);router[_0xb709('0x9')]('/describe',auth[_0xb709('0xb')](),controller[_0xb709('0xc')]);router['get'](_0xb709('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xb709('0x9')](_0xb709('0xe'),auth[_0xb709('0xb')](),controller['getMembers']);router[_0xb709('0x9')](_0xb709('0xf'),auth[_0xb709('0xb')](),controller[_0xb709('0x10')]);router[_0xb709('0x9')](_0xb709('0x11'),auth['isAuthenticated'](),controller[_0xb709('0x12')]);router['post']('/',auth[_0xb709('0xb')](),controller[_0xb709('0x13')]);router[_0xb709('0x14')](_0xb709('0xf'),auth['isAuthenticated'](),controller[_0xb709('0x15')]);router['post'](_0xb709('0x11'),auth[_0xb709('0xb')](),controller[_0xb709('0x16')]);router[_0xb709('0x17')](_0xb709('0xd'),auth['isAuthenticated'](),controller[_0xb709('0x18')]);router['delete'](_0xb709('0xd'),auth[_0xb709('0xb')](),controller['destroy']);router[_0xb709('0x19')](_0xb709('0xf'),auth[_0xb709('0xb')](),controller[_0xb709('0x1a')]);router[_0xb709('0x19')](_0xb709('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xb709('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 4180b0d..c087e0a 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 _0x9dc0=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x5ecce5,_0x45f8fb){var _0xc2f006=function(_0x57a2e2){while(--_0x57a2e2){_0x5ecce5['push'](_0x5ecce5['shift']());}};_0xc2f006(++_0x45f8fb);}(_0x9dc0,0x198));var _0x09dc=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x9dc0[_0x4c440b];return _0x2d48cf;};'use strict';var Sequelize=require(_0x09dc('0x0'));module[_0x09dc('0x1')]={'name':{'type':Sequelize[_0x09dc('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x09dc('0x2')]},'timeout':{'type':Sequelize[_0x09dc('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x09dc('0x4')](_0x09dc('0x5'),_0x09dc('0x6'),_0x09dc('0x7'))}}; \ No newline at end of file +var _0xbf22=['exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x4056ee,_0x2a104a){var _0x26991d=function(_0x19b692){while(--_0x19b692){_0x4056ee['push'](_0x4056ee['shift']());}};_0x26991d(++_0x2a104a);}(_0xbf22,0xef));var _0x2bf2=function(_0x1e33ac,_0x486d32){_0x1e33ac=_0x1e33ac-0x0;var _0x460470=_0xbf22[_0x1e33ac];return _0x460470;};'use strict';var Sequelize=require(_0x2bf2('0x0'));module[_0x2bf2('0x1')]={'name':{'type':Sequelize[_0x2bf2('0x2')],'unique':_0x2bf2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2bf2('0x2')]},'timeout':{'type':Sequelize[_0x2bf2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2bf2('0x5')](_0x2bf2('0x6'),'beepall',_0x2bf2('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 7c5674b..f9a554e 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 _0xd6d4=['addAgents','omit','spread','removeAgents','getAgents','order','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','OpenchannelQueues','error','stack','name','send','index','rawAttributes','type','key','model','query','keys','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','intersection','fields','find','OpenchannelQueue','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserOpenchannelQueue','findAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','Team','pick','getTeams','ids','User','Agents','online','voicePause','flatMap','transaction','addTeams','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','includes','all','union','compact','isEmpty','userOpenchannelQueue:remove'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0xd6d4,0x8c));var _0x4d6d=function(_0x50759b,_0x1a2557){_0x50759b=_0x50759b-0x0;var _0x3a3167=_0xd6d4[_0x50759b];return _0x3a3167;};'use strict';var emlformat=require(_0x4d6d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4d6d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4d6d('0x2'));var moment=require(_0x4d6d('0x3'));var BPromise=require(_0x4d6d('0x4'));var Mustache=require('mustache');var util=require(_0x4d6d('0x5'));var path=require(_0x4d6d('0x6'));var sox=require(_0x4d6d('0x7'));var csv=require(_0x4d6d('0x8'));var ejs=require(_0x4d6d('0x9'));var fs=require('fs');var fs_extra=require(_0x4d6d('0xa'));var _=require(_0x4d6d('0xb'));var squel=require(_0x4d6d('0xc'));var crypto=require('crypto');var jsforce=require(_0x4d6d('0xd'));var deskjs=require(_0x4d6d('0xe'));var toCsv=require(_0x4d6d('0x8'));var querystring=require(_0x4d6d('0xf'));var Papa=require(_0x4d6d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d6d('0x11'))(_0x4d6d('0x12'));var utils=require('../../config/utils');var config=require(_0x4d6d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x4d6d('0x14'))['db'];config[_0x4d6d('0x15')]=_['defaults'](config[_0x4d6d('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x4d6d('0x16'))(new Redis(config['redis']));require(_0x4d6d('0x17'))[_0x4d6d('0x18')](socket);function respondWithStatusCode(_0xa6760a,_0x5e5882){_0x5e5882=_0x5e5882||0xcc;return function(_0x1259bd){if(_0x1259bd){return _0xa6760a[_0x4d6d('0x19')](_0x5e5882);}return _0xa6760a[_0x4d6d('0x1a')](_0x5e5882)[_0x4d6d('0x1b')]();};}function respondWithResult(_0x42eb61,_0x4067d0){_0x4067d0=_0x4067d0||0xc8;return function(_0x10a43c){if(_0x10a43c){return _0x42eb61[_0x4d6d('0x1a')](_0x4067d0)[_0x4d6d('0x1c')](_0x10a43c);}};}function respondWithFilteredResult(_0xccdda1,_0x4dffc0){return function(_0x10adce){if(_0x10adce){var _0x31ba4d=typeof _0x4dffc0[_0x4d6d('0x1d')]===_0x4d6d('0x1e')&&typeof _0x4dffc0[_0x4d6d('0x1f')]===_0x4d6d('0x1e');var _0xf16491=_0x10adce[_0x4d6d('0x20')];var _0x247856=_0x31ba4d?0x0:_0x4dffc0[_0x4d6d('0x1d')];var _0x1394ff=_0x31ba4d?_0x10adce[_0x4d6d('0x20')]:_0x4dffc0[_0x4d6d('0x1d')]+_0x4dffc0[_0x4d6d('0x1f')];var _0x1f5558;if(_0x1394ff>=_0xf16491){_0x1394ff=_0xf16491;_0x1f5558=0xc8;}else{_0x1f5558=0xce;}_0xccdda1[_0x4d6d('0x1a')](_0x1f5558);return _0xccdda1[_0x4d6d('0x21')](_0x4d6d('0x22'),_0x247856+'-'+_0x1394ff+'/'+_0xf16491)['json'](_0x10adce);}return null;};}function patchUpdates(_0x2b8dd7){return function(_0xd0c0a1){try{jsonpatch[_0x4d6d('0x23')](_0xd0c0a1,_0x2b8dd7,!![]);}catch(_0x26cf93){return BPromise[_0x4d6d('0x24')](_0x26cf93);}return _0xd0c0a1[_0x4d6d('0x25')]();};}function saveUpdates(_0x1a3fdc,_0x21f9b0){return function(_0x56801c){if(_0x56801c){return _0x56801c['update'](_0x1a3fdc)[_0x4d6d('0x26')](function(_0x4a9b91){return _0x4a9b91;});}return null;};}function removeEntity(_0x37ecde,_0x5ee5ad){return function(_0x5699e9){if(_0x5699e9){return _0x5699e9['destroy']()[_0x4d6d('0x26')](function(){var _0x47ecd3=_0x5699e9[_0x4d6d('0x27')]({'plain':!![]});var _0x3d9efb=_0x4d6d('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x3d9efb,'resourceId':_0x47ecd3['id']}})[_0x4d6d('0x26')](function(){return _0x5699e9;});})[_0x4d6d('0x26')](function(){_0x37ecde['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f3e82,_0xc05359){return function(_0x41a339){if(!_0x41a339){_0x3f3e82[_0x4d6d('0x19')](0x194);}return _0x41a339;};}function handleError(_0x304ddf,_0x444407){_0x444407=_0x444407||0x1f4;return function(_0x1d1206){logger[_0x4d6d('0x29')](_0x1d1206[_0x4d6d('0x2a')]);if(_0x1d1206[_0x4d6d('0x2b')]){delete _0x1d1206['name'];}_0x304ddf[_0x4d6d('0x1a')](_0x444407)[_0x4d6d('0x2c')](_0x1d1206);};}exports[_0x4d6d('0x2d')]=function(_0x572882,_0x1f7b7a){var _0x5e5861={},_0x4bafa6={},_0xe3333e={'count':0x0,'rows':[]};var _0x476407=_['map'](db['OpenchannelQueue'][_0x4d6d('0x2e')],function(_0x40485c){return{'name':_0x40485c['fieldName'],'type':_0x40485c[_0x4d6d('0x2f')][_0x4d6d('0x30')]};});_0x4bafa6[_0x4d6d('0x31')]=_['map'](_0x476407,_0x4d6d('0x2b'));_0x4bafa6[_0x4d6d('0x32')]=_[_0x4d6d('0x33')](_0x572882[_0x4d6d('0x32')]);_0x4bafa6['filters']=_['intersection'](_0x4bafa6[_0x4d6d('0x31')],_0x4bafa6[_0x4d6d('0x32')]);_0x5e5861[_0x4d6d('0x34')]=_['intersection'](_0x4bafa6[_0x4d6d('0x31')],qs['fields'](_0x572882[_0x4d6d('0x32')]['fields']));_0x5e5861[_0x4d6d('0x34')]=_0x5e5861[_0x4d6d('0x34')][_0x4d6d('0x35')]?_0x5e5861[_0x4d6d('0x34')]:_0x4bafa6[_0x4d6d('0x31')];if(!_0x572882[_0x4d6d('0x32')][_0x4d6d('0x36')](_0x4d6d('0x37'))){_0x5e5861['limit']=qs[_0x4d6d('0x1f')](_0x572882[_0x4d6d('0x32')][_0x4d6d('0x1f')]);_0x5e5861[_0x4d6d('0x1d')]=qs[_0x4d6d('0x1d')](_0x572882['query'][_0x4d6d('0x1d')]);}_0x5e5861['order']=qs[_0x4d6d('0x38')](_0x572882[_0x4d6d('0x32')]['sort']);_0x5e5861[_0x4d6d('0x39')]=qs[_0x4d6d('0x3a')](_['pick'](_0x572882[_0x4d6d('0x32')],_0x4bafa6[_0x4d6d('0x3a')]),_0x476407);if(_0x572882['query'][_0x4d6d('0x3b')]){_0x5e5861[_0x4d6d('0x39')]=_[_0x4d6d('0x3c')](_0x5e5861[_0x4d6d('0x39')],{'$or':_[_0x4d6d('0x3d')](_0x476407,function(_0xcb01f){if(_0xcb01f[_0x4d6d('0x2f')]!==_0x4d6d('0x3e')){var _0x101b52={};_0x101b52[_0xcb01f[_0x4d6d('0x2b')]]={'$like':'%'+_0x572882[_0x4d6d('0x32')][_0x4d6d('0x3b')]+'%'};return _0x101b52;}})});}_0x5e5861=_['merge']({},_0x5e5861,_0x572882[_0x4d6d('0x3f')]);var _0x3cf96f={'where':_0x5e5861[_0x4d6d('0x39')]};return db['OpenchannelQueue'][_0x4d6d('0x20')](_0x3cf96f)['then'](function(_0x5e12a0){_0xe3333e[_0x4d6d('0x20')]=_0x5e12a0;if(_0x572882['query'][_0x4d6d('0x40')]){_0x5e5861[_0x4d6d('0x41')]=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x5e5861);})[_0x4d6d('0x26')](function(_0xc15e8c){_0xe3333e[_0x4d6d('0x42')]=_0xc15e8c;return _0xe3333e;})[_0x4d6d('0x26')](respondWithFilteredResult(_0x1f7b7a,_0x5e5861))[_0x4d6d('0x43')](handleError(_0x1f7b7a,null));};exports[_0x4d6d('0x44')]=function(_0xbb56b5,_0x9ee25b){var _0x5d2549={'raw':!![],'where':{'id':_0xbb56b5[_0x4d6d('0x45')]['id']}},_0x5d7f09={};_0x5d7f09[_0x4d6d('0x31')]=_[_0x4d6d('0x33')](db['OpenchannelQueue']['rawAttributes']);_0x5d7f09['query']=_[_0x4d6d('0x33')](_0xbb56b5[_0x4d6d('0x32')]);_0x5d7f09[_0x4d6d('0x3a')]=_[_0x4d6d('0x46')](_0x5d7f09['model'],_0x5d7f09[_0x4d6d('0x32')]);_0x5d2549['attributes']=_[_0x4d6d('0x46')](_0x5d7f09[_0x4d6d('0x31')],qs[_0x4d6d('0x47')](_0xbb56b5[_0x4d6d('0x32')][_0x4d6d('0x47')]));_0x5d2549[_0x4d6d('0x34')]=_0x5d2549['attributes'][_0x4d6d('0x35')]?_0x5d2549[_0x4d6d('0x34')]:_0x5d7f09[_0x4d6d('0x31')];if(_0xbb56b5[_0x4d6d('0x32')]['includeAll']){_0x5d2549['include']=[{'all':!![]}];}_0x5d2549=_['merge']({},_0x5d2549,_0xbb56b5['options']);return db['OpenchannelQueue'][_0x4d6d('0x48')](_0x5d2549)[_0x4d6d('0x26')](handleEntityNotFound(_0x9ee25b,null))[_0x4d6d('0x26')](respondWithResult(_0x9ee25b,null))[_0x4d6d('0x43')](handleError(_0x9ee25b,null));};exports['create']=function(_0x427b9a,_0x32308f){return db[_0x4d6d('0x49')]['create'](_0x427b9a[_0x4d6d('0x4a')],{})[_0x4d6d('0x26')](function(_0xc74a56){var _0x187553=_0x427b9a[_0x4d6d('0x4b')][_0x4d6d('0x27')]({'plain':!![]});if(!_0x187553)throw new Error(_0x4d6d('0x4c'));if(_0x187553[_0x4d6d('0x4d')]===_0x4d6d('0x4b')){var _0x573dd0=_0xc74a56[_0x4d6d('0x27')]({'plain':!![]});var _0x46803e=_0x4d6d('0x28');return db[_0x4d6d('0x4e')][_0x4d6d('0x48')]({'where':{'name':_0x46803e,'userProfileId':_0x187553[_0x4d6d('0x4f')]},'raw':!![]})[_0x4d6d('0x26')](function(_0x85fd90){if(_0x85fd90&&_0x85fd90[_0x4d6d('0x50')]===0x0){return db['UserProfileResource'][_0x4d6d('0x51')]({'name':_0x573dd0[_0x4d6d('0x2b')],'resourceId':_0x573dd0['id'],'type':_0x85fd90[_0x4d6d('0x2b')],'sectionId':_0x85fd90['id']},{})[_0x4d6d('0x26')](function(){return _0xc74a56;});}else{return _0xc74a56;}})[_0x4d6d('0x43')](function(_0x334977){logger[_0x4d6d('0x29')](_0x4d6d('0x52'),_0x334977);throw _0x334977;});}return _0xc74a56;})[_0x4d6d('0x26')](respondWithResult(_0x32308f,0xc9))['catch'](handleError(_0x32308f,null));};exports[_0x4d6d('0x53')]=function(_0x536be8,_0x221e7d){if(_0x536be8[_0x4d6d('0x4a')]['id']){delete _0x536be8['body']['id'];}return db[_0x4d6d('0x49')]['find']({'where':{'id':_0x536be8['params']['id']}})[_0x4d6d('0x26')](handleEntityNotFound(_0x221e7d,null))[_0x4d6d('0x26')](saveUpdates(_0x536be8[_0x4d6d('0x4a')],null))['then'](respondWithResult(_0x221e7d,null))[_0x4d6d('0x43')](handleError(_0x221e7d,null));};exports['destroy']=function(_0xb915e9,_0x585e24){return db[_0x4d6d('0x49')][_0x4d6d('0x48')]({'where':{'id':_0xb915e9[_0x4d6d('0x45')]['id']}})[_0x4d6d('0x26')](handleEntityNotFound(_0x585e24,null))[_0x4d6d('0x26')](removeEntity(_0x585e24,null))[_0x4d6d('0x43')](handleError(_0x585e24,null));};exports[_0x4d6d('0x54')]=function(_0x452fd3,_0x18c141){return db[_0x4d6d('0x49')][_0x4d6d('0x54')]()[_0x4d6d('0x26')](respondWithResult(_0x18c141,null))[_0x4d6d('0x43')](handleError(_0x18c141,null));};exports['getMembers']=function(_0x4e359e,_0x100de7,_0x121d79){var _0x3a847f={'raw':!![],'where':{}},_0x2d0724={},_0x185f3a;return db['OpenchannelQueue'][_0x4d6d('0x55')]({'where':{'id':_0x4e359e[_0x4d6d('0x45')]['id']}})[_0x4d6d('0x26')](handleEntityNotFound(_0x100de7,null))[_0x4d6d('0x26')](function(_0xf7f3c3){if(_0xf7f3c3){_0x185f3a=_0xf7f3c3['get']({'plain':!![]});_0x2d0724[_0x4d6d('0x31')]=_[_0x4d6d('0x33')](db[_0x4d6d('0x56')][_0x4d6d('0x2e')]);_0x2d0724[_0x4d6d('0x32')]=_[_0x4d6d('0x33')](_0x4e359e['query']);_0x2d0724[_0x4d6d('0x3a')]=_['intersection'](_0x2d0724[_0x4d6d('0x31')],_0x2d0724[_0x4d6d('0x32')]);_0x3a847f['attributes']=_[_0x4d6d('0x46')](_0x2d0724[_0x4d6d('0x31')],qs[_0x4d6d('0x47')](_0x4e359e[_0x4d6d('0x32')][_0x4d6d('0x47')]));_0x3a847f[_0x4d6d('0x34')]=_0x3a847f[_0x4d6d('0x34')][_0x4d6d('0x35')]?_0x3a847f[_0x4d6d('0x34')]:_0x2d0724[_0x4d6d('0x31')];if(!_0x4e359e[_0x4d6d('0x32')][_0x4d6d('0x36')](_0x4d6d('0x37'))){_0x3a847f[_0x4d6d('0x1f')]=qs[_0x4d6d('0x1f')](_0x4e359e[_0x4d6d('0x32')]['limit']);_0x3a847f['offset']=qs[_0x4d6d('0x1d')](_0x4e359e[_0x4d6d('0x32')][_0x4d6d('0x1d')]);}_0x3a847f['order']=qs['sort'](_0x4e359e[_0x4d6d('0x32')][_0x4d6d('0x38')]);_0x3a847f['where']=qs[_0x4d6d('0x3a')](_['pick'](_0x4e359e['query'],_0x2d0724[_0x4d6d('0x3a')]));_0x3a847f['where']['OpenchannelQueueId']=_0xf7f3c3['id'];if(_0x4e359e[_0x4d6d('0x32')][_0x4d6d('0x3b')]){_0x3a847f[_0x4d6d('0x39')]=_['merge'](_0x3a847f['where'],{'$or':_[_0x4d6d('0x3d')](_0x3a847f['attributes'],function(_0x487038){var _0xc9e360={};_0xc9e360[_0x487038]={'$like':'%'+_0x4e359e[_0x4d6d('0x32')][_0x4d6d('0x3b')]+'%'};return _0xc9e360;})});}_0x3a847f=_[_0x4d6d('0x3c')]({},_0x3a847f,_0x4e359e[_0x4d6d('0x3f')]);return db['UserOpenchannelQueue'][_0x4d6d('0x57')](_0x3a847f);}})['then'](function(_0x457136){if(_0x457136){return db['User']['findAndCountAll']({'where':{'id':_[_0x4d6d('0x3d')](_0x457136,_0x4d6d('0x58')),'role':_0x4d6d('0x59')},'attributes':['id',_0x4d6d('0x2b'),_0x4d6d('0x5a'),_0x4d6d('0x5b'),_0x4d6d('0x5c')]});}})[_0x4d6d('0x26')](function(_0x2f21b1){if(_0x2f21b1){return{'count':_0x2f21b1[_0x4d6d('0x20')],'rows':_[_0x4d6d('0x3d')](_0x2f21b1['rows'],function(_0xf5b6b0){return{'membername':_0xf5b6b0[_0x4d6d('0x2b')],'UserId':_0xf5b6b0['id'],'queue_name':_0x185f3a['name'],'OpenchannelQueueId':_0x185f3a['id'],'interface':util[_0x4d6d('0x5d')](_0x4d6d('0x5e'),'SIP',_0xf5b6b0['name']),'penalty':0x0,'paused':_0xf5b6b0[_0x4d6d('0x5a')],'createdAt':_0xf5b6b0[_0x4d6d('0x5c')],'updatedAt':_0xf5b6b0[_0x4d6d('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4d6d('0x26')](respondWithFilteredResult(_0x100de7,_0x3a847f))[_0x4d6d('0x43')](handleError(_0x100de7,null));};exports['getTeams']=function(_0x43785e,_0x2110db,_0x283766){var _0x1d3421={};var _0x56805a={};var _0x111df0;var _0xa72342;return db[_0x4d6d('0x49')][_0x4d6d('0x55')]({'where':{'id':_0x43785e[_0x4d6d('0x45')]['id']}})[_0x4d6d('0x26')](handleEntityNotFound(_0x2110db,null))[_0x4d6d('0x26')](function(_0x89439d){if(_0x89439d){_0x111df0=_0x89439d;_0x56805a[_0x4d6d('0x31')]=_['keys'](db[_0x4d6d('0x5f')][_0x4d6d('0x2e')]);_0x56805a[_0x4d6d('0x32')]=_[_0x4d6d('0x33')](_0x43785e[_0x4d6d('0x32')]);_0x56805a[_0x4d6d('0x3a')]=_[_0x4d6d('0x46')](_0x56805a[_0x4d6d('0x31')],_0x56805a[_0x4d6d('0x32')]);_0x1d3421[_0x4d6d('0x34')]=_[_0x4d6d('0x46')](_0x56805a['model'],qs[_0x4d6d('0x47')](_0x43785e[_0x4d6d('0x32')][_0x4d6d('0x47')]));_0x1d3421[_0x4d6d('0x34')]=_0x1d3421[_0x4d6d('0x34')][_0x4d6d('0x35')]?_0x1d3421['attributes']:_0x56805a['model'];_0x1d3421['order']=qs[_0x4d6d('0x38')](_0x43785e[_0x4d6d('0x32')]['sort']);_0x1d3421[_0x4d6d('0x39')]=qs['filters'](_[_0x4d6d('0x60')](_0x43785e['query'],_0x56805a['filters']));if(_0x43785e[_0x4d6d('0x32')][_0x4d6d('0x3b')]){_0x1d3421['where']=_['merge'](_0x1d3421[_0x4d6d('0x39')],{'$or':_[_0x4d6d('0x3d')](_0x1d3421['attributes'],function(_0x2abf73){var _0x471ad0={};_0x471ad0[_0x2abf73]={'$like':'%'+_0x43785e[_0x4d6d('0x32')][_0x4d6d('0x3b')]+'%'};return _0x471ad0;})});}_0x1d3421=_[_0x4d6d('0x3c')]({},_0x1d3421,_0x43785e[_0x4d6d('0x3f')]);return _0x111df0[_0x4d6d('0x61')](_0x1d3421);}})[_0x4d6d('0x26')](function(_0x1317c8){if(_0x1317c8){_0xa72342=_0x1317c8['length'];if(!_0x43785e['query'][_0x4d6d('0x36')](_0x4d6d('0x37'))){_0x1d3421[_0x4d6d('0x1f')]=qs[_0x4d6d('0x1f')](_0x43785e[_0x4d6d('0x32')][_0x4d6d('0x1f')]);_0x1d3421[_0x4d6d('0x1d')]=qs[_0x4d6d('0x1d')](_0x43785e[_0x4d6d('0x32')]['offset']);}return _0x111df0['getTeams'](_0x1d3421);}})['then'](function(_0x36a431){if(_0x36a431){return _0x36a431?{'count':_0xa72342,'rows':_0x36a431}:null;}})[_0x4d6d('0x26')](respondWithResult(_0x2110db,null))[_0x4d6d('0x43')](handleError(_0x2110db,null));};exports['addTeams']=function(_0x44f2da,_0x59c9bd,_0x150d9a){var _0x4b69ad=_0x44f2da[_0x4d6d('0x4a')][_0x4d6d('0x62')];return db[_0x4d6d('0x5f')]['findAll']({'where':{'id':_0x4b69ad},'attributes':['id'],'include':[{'model':db[_0x4d6d('0x63')],'as':_0x4d6d('0x64'),'attributes':['id',_0x4d6d('0x2b'),_0x4d6d('0x65'),_0x4d6d('0x66'),'interface'],'raw':!![]}]})[_0x4d6d('0x26')](function(_0x2d4758){if(_0x2d4758){var _0x22cf2d=_[_0x4d6d('0x67')](_0x2d4758,function(_0x557319){var _0x2de6c4=_0x557319['get']({'plain':!![]});return _0x2de6c4[_0x4d6d('0x64')];});return db[_0x4d6d('0x49')][_0x4d6d('0x48')]({'where':{'id':_0x44f2da['params']['id']}})[_0x4d6d('0x26')](function(_0x3cef33){return db['sequelize'][_0x4d6d('0x68')](function(_0x566a69){return _0x3cef33[_0x4d6d('0x69')](_0x4b69ad,{'transaction':_0x566a69})[_0x4d6d('0x26')](function(){return BPromise['each'](_0x22cf2d,function(_0x45c9b1){return db['UserOpenchannelQueue'][_0x4d6d('0x6a')]({'where':{'UserId':_0x45c9b1['id'],'OpenchannelQueueId':_0x44f2da[_0x4d6d('0x45')]['id']},'transaction':_0x566a69});});})[_0x4d6d('0x26')](function(){_0x22cf2d[_0x4d6d('0x6b')](function(_0x31cfd5){socket[_0x4d6d('0x6c')](_0x4d6d('0x6d'),{'UserId':_0x31cfd5['id'],'OpenchannelQueueId':_0x3cef33['id']});});});});});}})[_0x4d6d('0x26')](respondWithStatusCode(_0x59c9bd,null))[_0x4d6d('0x43')](handleError(_0x59c9bd,null));};exports['removeTeams']=function(_0x5cef73,_0xb49ac3,_0x41584d){return db[_0x4d6d('0x5f')][_0x4d6d('0x57')]({'where':{'id':_0x5cef73[_0x4d6d('0x32')][_0x4d6d('0x62')]},'attributes':['id'],'include':[{'model':db[_0x4d6d('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xb49ac3,null))[_0x4d6d('0x26')](function(_0x20b896){var _0x1a88d2=_[_0x4d6d('0x3d')](_0x20b896,'id');var _0x1f9c39=[];var _0x108b1b=[];var _0x3c1793=squel[_0x4d6d('0x6e')]();_0x3c1793[_0x4d6d('0x6f')](_0x4d6d('0x70'))['from'](_0x4d6d('0x71'),'tq')['join'](_0x4d6d('0x72'),'ut',_0x4d6d('0x73'))['where']('OpenchannelQueueId\x20=\x20?',_0x5cef73[_0x4d6d('0x45')]['id']);for(var _0x5f0044=0x0;_0x5f0044<_0x20b896['length'];_0x5f0044+=0x1){let _0x16d5d7=_0x20b896[_0x5f0044];for(var _0x21cfaa=0x0;_0x21cfaa<_0x16d5d7[_0x4d6d('0x64')]['length'];_0x21cfaa+=0x1){let _0x39c752=_0x16d5d7[_0x4d6d('0x64')][_0x21cfaa];var _0x197399=_0x3c1793[_0x4d6d('0x74')]();_0x197399['where'](_0x4d6d('0x75'),_0x39c752['id']);_0x108b1b[_0x4d6d('0x76')](db[_0x4d6d('0x77')][_0x4d6d('0x32')](_0x197399['toString'](),{'type':db[_0x4d6d('0x77')]['QueryTypes'][_0x4d6d('0x78')]})[_0x4d6d('0x26')](function(_0x7370fd){if(_0x7370fd[_0x4d6d('0x35')]===0x1){return _0x39c752['id'];}else{var _0x473331=_[_0x4d6d('0x79')](_[_0x4d6d('0x3d')](_0x7370fd,'TeamId'),function(_0x45252d){return _[_0x4d6d('0x7a')](_0x1a88d2,_0x45252d);});if(_0x473331){return _0x39c752['id'];}}}));}}return BPromise[_0x4d6d('0x7b')](_0x108b1b)[_0x4d6d('0x26')](function(_0x50d161){_0x1f9c39=_(_0x1f9c39)[_0x4d6d('0x7c')](_0x50d161)[_0x4d6d('0x7d')]()['value']();return db[_0x4d6d('0x49')][_0x4d6d('0x48')]({'where':{'id':_0x5cef73[_0x4d6d('0x45')]['id']}})[_0x4d6d('0x26')](function(_0x355746){return db[_0x4d6d('0x77')][_0x4d6d('0x68')](function(_0x5382ba){return _0x355746['removeTeams'](_0x5cef73['query']['ids'],{'transaction':_0x5382ba})[_0x4d6d('0x26')](function(){if(!_[_0x4d6d('0x7e')](_0x1f9c39)){return _0x355746['removeAgents'](_0x1f9c39,{'transaction':_0x5382ba});}})[_0x4d6d('0x26')](function(){_0x1f9c39['forEach'](function(_0x5ba826){socket[_0x4d6d('0x6c')](_0x4d6d('0x7f'),{'UserId':_0x5ba826,'OpenchannelQueueId':_0x355746['id']});});});});});});})[_0x4d6d('0x26')](respondWithStatusCode(_0xb49ac3,null))[_0x4d6d('0x43')](handleError(_0xb49ac3,null));};exports[_0x4d6d('0x80')]=function(_0x5975e0,_0x565550,_0x34df13){return db[_0x4d6d('0x49')][_0x4d6d('0x48')]({'where':{'id':_0x5975e0['params']['id']}})[_0x4d6d('0x26')](handleEntityNotFound(_0x565550,null))[_0x4d6d('0x26')](function(_0x57e80c){if(_0x57e80c){return _0x57e80c[_0x4d6d('0x80')](_0x5975e0[_0x4d6d('0x4a')][_0x4d6d('0x62')],_[_0x4d6d('0x81')](_0x5975e0['body'],['ids','id'])||{})[_0x4d6d('0x82')](function(_0x11554b){for(var _0x208133=0x0;_0x208133<_0x5975e0['body'][_0x4d6d('0x62')][_0x4d6d('0x35')];_0x208133+=0x1){socket[_0x4d6d('0x6c')](_0x4d6d('0x6d'),{'UserId':Number(_0x5975e0[_0x4d6d('0x4a')]['ids'][_0x208133]),'OpenchannelQueueId':Number(_0x5975e0['params']['id'])});}return _0x11554b;});}})[_0x4d6d('0x26')](respondWithResult(_0x565550,null))[_0x4d6d('0x43')](handleError(_0x565550,null));};exports[_0x4d6d('0x83')]=function(_0x2ca459,_0x88a789,_0x4d6d1d){return db['OpenchannelQueue']['find']({'where':{'id':_0x2ca459[_0x4d6d('0x45')]['id']}})[_0x4d6d('0x26')](handleEntityNotFound(_0x88a789,null))[_0x4d6d('0x26')](function(_0x4a173f){if(_0x4a173f){return _0x4a173f[_0x4d6d('0x83')](_0x2ca459[_0x4d6d('0x32')][_0x4d6d('0x62')])[_0x4d6d('0x26')](function(){if(_['isArray'](_0x2ca459['query'][_0x4d6d('0x62')])){for(var _0x597cbf=0x0;_0x597cbf<_0x2ca459[_0x4d6d('0x32')]['ids'][_0x4d6d('0x35')];_0x597cbf+=0x1){socket[_0x4d6d('0x6c')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2ca459[_0x4d6d('0x32')]['ids'][_0x597cbf]),'OpenchannelQueueId':Number(_0x2ca459[_0x4d6d('0x45')]['id'])});}}else{socket[_0x4d6d('0x6c')](_0x4d6d('0x7f'),{'UserId':Number(_0x2ca459['query'][_0x4d6d('0x62')]),'OpenchannelQueueId':Number(_0x2ca459[_0x4d6d('0x45')]['id'])});}});}})['then'](respondWithStatusCode(_0x88a789,null))['catch'](handleError(_0x88a789,null));};exports[_0x4d6d('0x84')]=function(_0x43cc4f,_0x5107e7,_0x5e58e5){var _0x5c5858={};var _0x280728={};var _0x22270b;var _0x5cb5f0;return db['OpenchannelQueue'][_0x4d6d('0x55')]({'where':{'id':_0x43cc4f[_0x4d6d('0x45')]['id']}})[_0x4d6d('0x26')](handleEntityNotFound(_0x5107e7,null))[_0x4d6d('0x26')](function(_0x1abd11){if(_0x1abd11){_0x22270b=_0x1abd11;_0x280728['model']=_[_0x4d6d('0x33')](db['User'][_0x4d6d('0x2e')]);_0x280728[_0x4d6d('0x32')]=_['keys'](_0x43cc4f[_0x4d6d('0x32')]);_0x280728['filters']=_[_0x4d6d('0x46')](_0x280728['model'],_0x280728[_0x4d6d('0x32')]);_0x5c5858['attributes']=_['intersection'](_0x280728[_0x4d6d('0x31')],qs[_0x4d6d('0x47')](_0x43cc4f[_0x4d6d('0x32')][_0x4d6d('0x47')]));_0x5c5858[_0x4d6d('0x34')]=_0x5c5858[_0x4d6d('0x34')]['length']?_0x5c5858[_0x4d6d('0x34')]:_0x280728[_0x4d6d('0x31')];_0x5c5858[_0x4d6d('0x85')]=qs[_0x4d6d('0x38')](_0x43cc4f[_0x4d6d('0x32')][_0x4d6d('0x38')]);_0x5c5858['where']=qs[_0x4d6d('0x3a')](_[_0x4d6d('0x60')](_0x43cc4f[_0x4d6d('0x32')],_0x280728[_0x4d6d('0x3a')]));if(_0x43cc4f[_0x4d6d('0x32')][_0x4d6d('0x3b')]){_0x5c5858[_0x4d6d('0x39')]=_[_0x4d6d('0x3c')](_0x5c5858[_0x4d6d('0x39')],{'$or':_['map'](_0x5c5858['attributes'],function(_0x5775a7){var _0x43bf19={};_0x43bf19[_0x5775a7]={'$like':'%'+_0x43cc4f['query'][_0x4d6d('0x3b')]+'%'};return _0x43bf19;})});}_0x5c5858=_[_0x4d6d('0x3c')]({},_0x5c5858,_0x43cc4f[_0x4d6d('0x3f')]);return _0x22270b[_0x4d6d('0x84')](_0x5c5858);}})[_0x4d6d('0x26')](function(_0x452b47){if(_0x452b47){_0x5cb5f0=_0x452b47['length'];if(!_0x43cc4f[_0x4d6d('0x32')][_0x4d6d('0x36')](_0x4d6d('0x37'))){_0x5c5858[_0x4d6d('0x1f')]=qs['limit'](_0x43cc4f[_0x4d6d('0x32')][_0x4d6d('0x1f')]);_0x5c5858[_0x4d6d('0x1d')]=qs[_0x4d6d('0x1d')](_0x43cc4f[_0x4d6d('0x32')][_0x4d6d('0x1d')]);}return _0x22270b[_0x4d6d('0x84')](_0x5c5858);}})[_0x4d6d('0x26')](function(_0x5dc10a){if(_0x5dc10a){return _0x5dc10a?{'count':_0x5cb5f0,'rows':_0x5dc10a}:null;}})[_0x4d6d('0x26')](respondWithResult(_0x5107e7,null))[_0x4d6d('0x43')](handleError(_0x5107e7,null));}; \ No newline at end of file +var _0x8d07=['user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','ids','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','emit','getAgents','pick','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','UserOpenchannelQueue','hasOwnProperty','OpenchannelQueueId','User','UserId','openchannelPause','updatedAt','format','SIP','createdAt','getTeams','findOne','Team','length','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','userOpenchannelQueue:save','select','from','team_has_openchannel_queues','join'];(function(_0x507d01,_0x494ba5){var _0x49f80a=function(_0x2cf4fa){while(--_0x2cf4fa){_0x507d01['push'](_0x507d01['shift']());}};_0x49f80a(++_0x494ba5);}(_0x8d07,0x1cf));var _0x78d0=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x8d07[_0x5e36d1];return _0x950b9e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x78d0('0x0'));var jsonpatch=require(_0x78d0('0x1'));var rp=require(_0x78d0('0x2'));var moment=require(_0x78d0('0x3'));var BPromise=require(_0x78d0('0x4'));var Mustache=require('mustache');var util=require(_0x78d0('0x5'));var path=require('path');var sox=require(_0x78d0('0x6'));var csv=require(_0x78d0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78d0('0x8'));var _=require(_0x78d0('0x9'));var squel=require(_0x78d0('0xa'));var crypto=require(_0x78d0('0xb'));var jsforce=require(_0x78d0('0xc'));var deskjs=require(_0x78d0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x78d0('0xe'));var Papa=require('papaparse');var Redis=require(_0x78d0('0xf'));var authService=require(_0x78d0('0x10'));var qs=require(_0x78d0('0x11'));var as=require(_0x78d0('0x12'));var hardwareService=require(_0x78d0('0x13'));var logger=require(_0x78d0('0x14'))(_0x78d0('0x15'));var utils=require(_0x78d0('0x16'));var config=require(_0x78d0('0x17'));var licenseUtil=require(_0x78d0('0x18'));var db=require(_0x78d0('0x19'))['db'];config[_0x78d0('0x1a')]=_[_0x78d0('0x1b')](config[_0x78d0('0x1a')],{'host':_0x78d0('0x1c'),'port':0x18eb});var socket=require(_0x78d0('0x1d'))(new Redis(config['redis']));require(_0x78d0('0x1e'))[_0x78d0('0x1f')](socket);function respondWithStatusCode(_0x41b420,_0x224863){_0x224863=_0x224863||0xcc;return function(_0x36c6eb){if(_0x36c6eb){return _0x41b420[_0x78d0('0x20')](_0x224863);}return _0x41b420[_0x78d0('0x21')](_0x224863)[_0x78d0('0x22')]();};}function respondWithResult(_0x8728d1,_0x3c0c2c){_0x3c0c2c=_0x3c0c2c||0xc8;return function(_0x297ef9){if(_0x297ef9){return _0x8728d1[_0x78d0('0x21')](_0x3c0c2c)[_0x78d0('0x23')](_0x297ef9);}};}function respondWithFilteredResult(_0x3f8538,_0x1defd8){return function(_0xbcede7){if(_0xbcede7){var _0x35c25d=typeof _0x1defd8[_0x78d0('0x24')]==='undefined'&&typeof _0x1defd8[_0x78d0('0x25')]===_0x78d0('0x26');var _0x3faf3c=_0xbcede7[_0x78d0('0x27')];var _0x208c98=_0x35c25d?0x0:_0x1defd8['offset'];var _0xe5a69b=_0x35c25d?_0xbcede7['count']:_0x1defd8['offset']+_0x1defd8[_0x78d0('0x25')];var _0x48b53c;if(_0xe5a69b>=_0x3faf3c){_0xe5a69b=_0x3faf3c;_0x48b53c=0xc8;}else{_0x48b53c=0xce;}_0x3f8538[_0x78d0('0x21')](_0x48b53c);return _0x3f8538[_0x78d0('0x28')](_0x78d0('0x29'),_0x208c98+'-'+_0xe5a69b+'/'+_0x3faf3c)['json'](_0xbcede7);}return null;};}function patchUpdates(_0x1bdd59){return function(_0x22709a){try{jsonpatch[_0x78d0('0x2a')](_0x22709a,_0x1bdd59,!![]);}catch(_0x35e8a3){return BPromise[_0x78d0('0x2b')](_0x35e8a3);}return _0x22709a['save']();};}function saveUpdates(_0x23c7a1,_0x1fc9c6){return function(_0x293aca){if(_0x293aca){return _0x293aca[_0x78d0('0x2c')](_0x23c7a1)[_0x78d0('0x2d')](function(_0x2ed7cf){return _0x2ed7cf;});}return null;};}function removeEntity(_0x44da26,_0x529345){return function(_0x15b35e){if(_0x15b35e){return _0x15b35e[_0x78d0('0x2e')]()[_0x78d0('0x2d')](function(){var _0x35bd41=_0x15b35e[_0x78d0('0x2f')]({'plain':!![]});var _0x562cc8=_0x78d0('0x30');return db[_0x78d0('0x31')][_0x78d0('0x2e')]({'where':{'type':_0x562cc8,'resourceId':_0x35bd41['id']}})[_0x78d0('0x2d')](function(){return _0x15b35e;});})[_0x78d0('0x2d')](function(){_0x44da26['status'](0xcc)[_0x78d0('0x22')]();});}};}function handleEntityNotFound(_0x545adf,_0x3da3c5){return function(_0x235ed6){if(!_0x235ed6){_0x545adf[_0x78d0('0x20')](0x194);}return _0x235ed6;};}function handleError(_0x1190f2,_0x279bd8){_0x279bd8=_0x279bd8||0x1f4;return function(_0x5d2588){logger[_0x78d0('0x32')](_0x5d2588[_0x78d0('0x33')]);if(_0x5d2588['name']){delete _0x5d2588[_0x78d0('0x34')];}_0x1190f2[_0x78d0('0x21')](_0x279bd8)[_0x78d0('0x35')](_0x5d2588);};}exports[_0x78d0('0x36')]=function(_0xb59864,_0x457681){var _0x214386={},_0x5de901={},_0x146872={'count':0x0,'rows':[]};var _0x3f0608=_[_0x78d0('0x37')](db[_0x78d0('0x38')][_0x78d0('0x39')],function(_0x51abc7){return{'name':_0x51abc7['fieldName'],'type':_0x51abc7[_0x78d0('0x3a')][_0x78d0('0x3b')]};});_0x5de901[_0x78d0('0x3c')]=_['map'](_0x3f0608,_0x78d0('0x34'));_0x5de901[_0x78d0('0x3d')]=_[_0x78d0('0x3e')](_0xb59864['query']);_0x5de901[_0x78d0('0x3f')]=_[_0x78d0('0x40')](_0x5de901['model'],_0x5de901['query']);_0x214386[_0x78d0('0x41')]=_[_0x78d0('0x40')](_0x5de901[_0x78d0('0x3c')],qs[_0x78d0('0x42')](_0xb59864[_0x78d0('0x3d')][_0x78d0('0x42')]));_0x214386[_0x78d0('0x41')]=_0x214386[_0x78d0('0x41')]['length']?_0x214386[_0x78d0('0x41')]:_0x5de901['model'];if(!_0xb59864[_0x78d0('0x3d')]['hasOwnProperty'](_0x78d0('0x43'))){_0x214386['limit']=qs[_0x78d0('0x25')](_0xb59864[_0x78d0('0x3d')]['limit']);_0x214386[_0x78d0('0x24')]=qs[_0x78d0('0x24')](_0xb59864[_0x78d0('0x3d')][_0x78d0('0x24')]);}_0x214386[_0x78d0('0x44')]=qs[_0x78d0('0x45')](_0xb59864[_0x78d0('0x3d')][_0x78d0('0x45')]);_0x214386[_0x78d0('0x46')]=qs[_0x78d0('0x3f')](_['pick'](_0xb59864[_0x78d0('0x3d')],_0x5de901['filters']),_0x3f0608);if(_0xb59864[_0x78d0('0x3d')][_0x78d0('0x47')]){_0x214386[_0x78d0('0x46')]=_['merge'](_0x214386[_0x78d0('0x46')],{'$or':_[_0x78d0('0x37')](_0x3f0608,function(_0x484ec7){if(_0x484ec7['type']!==_0x78d0('0x48')){var _0x6f7f5e={};_0x6f7f5e[_0x484ec7[_0x78d0('0x34')]]={'$like':'%'+_0xb59864[_0x78d0('0x3d')][_0x78d0('0x47')]+'%'};return _0x6f7f5e;}})});}_0x214386=_[_0x78d0('0x49')]({},_0x214386,_0xb59864[_0x78d0('0x4a')]);var _0x4806ac={'where':_0x214386[_0x78d0('0x46')]};return db[_0x78d0('0x38')]['count'](_0x4806ac)[_0x78d0('0x2d')](function(_0x5284a3){_0x146872[_0x78d0('0x27')]=_0x5284a3;if(_0xb59864[_0x78d0('0x3d')]['includeAll']){_0x214386['include']=[{'all':!![]}];}return db[_0x78d0('0x38')][_0x78d0('0x4b')](_0x214386);})[_0x78d0('0x2d')](function(_0x17149f){_0x146872[_0x78d0('0x4c')]=_0x17149f;return _0x146872;})[_0x78d0('0x2d')](respondWithFilteredResult(_0x457681,_0x214386))[_0x78d0('0x4d')](handleError(_0x457681,null));};exports[_0x78d0('0x4e')]=function(_0x2a78ff,_0x576533){var _0x4ea852={'raw':!![],'where':{'id':_0x2a78ff[_0x78d0('0x4f')]['id']}},_0x1ebb2c={};_0x1ebb2c[_0x78d0('0x3c')]=_[_0x78d0('0x3e')](db[_0x78d0('0x38')][_0x78d0('0x39')]);_0x1ebb2c[_0x78d0('0x3d')]=_[_0x78d0('0x3e')](_0x2a78ff[_0x78d0('0x3d')]);_0x1ebb2c[_0x78d0('0x3f')]=_[_0x78d0('0x40')](_0x1ebb2c[_0x78d0('0x3c')],_0x1ebb2c[_0x78d0('0x3d')]);_0x4ea852['attributes']=_['intersection'](_0x1ebb2c['model'],qs[_0x78d0('0x42')](_0x2a78ff[_0x78d0('0x3d')][_0x78d0('0x42')]));_0x4ea852[_0x78d0('0x41')]=_0x4ea852[_0x78d0('0x41')]['length']?_0x4ea852[_0x78d0('0x41')]:_0x1ebb2c[_0x78d0('0x3c')];if(_0x2a78ff[_0x78d0('0x3d')][_0x78d0('0x50')]){_0x4ea852[_0x78d0('0x51')]=[{'all':!![]}];}_0x4ea852=_[_0x78d0('0x49')]({},_0x4ea852,_0x2a78ff[_0x78d0('0x4a')]);return db[_0x78d0('0x38')][_0x78d0('0x52')](_0x4ea852)[_0x78d0('0x2d')](handleEntityNotFound(_0x576533,null))['then'](respondWithResult(_0x576533,null))[_0x78d0('0x4d')](handleError(_0x576533,null));};exports['create']=function(_0x53ede1,_0x81be69){return db[_0x78d0('0x38')][_0x78d0('0x53')](_0x53ede1['body'],{})[_0x78d0('0x2d')](function(_0x42aada){var _0x513249=_0x53ede1[_0x78d0('0x54')][_0x78d0('0x2f')]({'plain':!![]});if(!_0x513249)throw new Error(_0x78d0('0x55'));if(_0x513249['role']===_0x78d0('0x54')){var _0x5919fb=_0x42aada[_0x78d0('0x2f')]({'plain':!![]});var _0x511c68='OpenchannelQueues';return db[_0x78d0('0x56')]['find']({'where':{'name':_0x511c68,'userProfileId':_0x513249[_0x78d0('0x57')]},'raw':!![]})[_0x78d0('0x2d')](function(_0x274930){if(_0x274930&&_0x274930[_0x78d0('0x58')]===0x0){return db['UserProfileResource'][_0x78d0('0x53')]({'name':_0x5919fb[_0x78d0('0x34')],'resourceId':_0x5919fb['id'],'type':_0x274930[_0x78d0('0x34')],'sectionId':_0x274930['id']},{})[_0x78d0('0x2d')](function(){return _0x42aada;});}else{return _0x42aada;}})[_0x78d0('0x4d')](function(_0xc0cf1){logger['error'](_0x78d0('0x59'),_0xc0cf1);throw _0xc0cf1;});}return _0x42aada;})[_0x78d0('0x2d')](respondWithResult(_0x81be69,0xc9))[_0x78d0('0x4d')](handleError(_0x81be69,null));};exports[_0x78d0('0x2c')]=function(_0x58dce2,_0x2418ef){if(_0x58dce2[_0x78d0('0x5a')]['id']){delete _0x58dce2[_0x78d0('0x5a')]['id'];}return db[_0x78d0('0x38')][_0x78d0('0x52')]({'where':{'id':_0x58dce2[_0x78d0('0x4f')]['id']}})[_0x78d0('0x2d')](handleEntityNotFound(_0x2418ef,null))[_0x78d0('0x2d')](saveUpdates(_0x58dce2['body'],null))[_0x78d0('0x2d')](respondWithResult(_0x2418ef,null))['catch'](handleError(_0x2418ef,null));};exports[_0x78d0('0x2e')]=function(_0x1ed056,_0x5745d7){return db[_0x78d0('0x38')][_0x78d0('0x52')]({'where':{'id':_0x1ed056[_0x78d0('0x4f')]['id']}})[_0x78d0('0x2d')](handleEntityNotFound(_0x5745d7,null))[_0x78d0('0x2d')](removeEntity(_0x5745d7,null))[_0x78d0('0x4d')](handleError(_0x5745d7,null));};exports[_0x78d0('0x5b')]=function(_0x2cf9d9,_0x27a5d4){return db[_0x78d0('0x38')][_0x78d0('0x5b')]()[_0x78d0('0x2d')](respondWithResult(_0x27a5d4,null))[_0x78d0('0x4d')](handleError(_0x27a5d4,null));};exports['getMembers']=function(_0xd7deee,_0x41d599,_0x349df9){var _0x312b98={'raw':!![],'where':{}},_0x444987={},_0x520d0c;return db[_0x78d0('0x38')]['findOne']({'where':{'id':_0xd7deee[_0x78d0('0x4f')]['id']}})[_0x78d0('0x2d')](handleEntityNotFound(_0x41d599,null))[_0x78d0('0x2d')](function(_0x592fe0){if(_0x592fe0){_0x520d0c=_0x592fe0['get']({'plain':!![]});_0x444987[_0x78d0('0x3c')]=_[_0x78d0('0x3e')](db[_0x78d0('0x5c')][_0x78d0('0x39')]);_0x444987[_0x78d0('0x3d')]=_[_0x78d0('0x3e')](_0xd7deee[_0x78d0('0x3d')]);_0x444987['filters']=_['intersection'](_0x444987[_0x78d0('0x3c')],_0x444987[_0x78d0('0x3d')]);_0x312b98['attributes']=_[_0x78d0('0x40')](_0x444987['model'],qs[_0x78d0('0x42')](_0xd7deee['query'][_0x78d0('0x42')]));_0x312b98[_0x78d0('0x41')]=_0x312b98['attributes']['length']?_0x312b98[_0x78d0('0x41')]:_0x444987['model'];if(!_0xd7deee[_0x78d0('0x3d')][_0x78d0('0x5d')](_0x78d0('0x43'))){_0x312b98[_0x78d0('0x25')]=qs[_0x78d0('0x25')](_0xd7deee['query'][_0x78d0('0x25')]);_0x312b98[_0x78d0('0x24')]=qs[_0x78d0('0x24')](_0xd7deee[_0x78d0('0x3d')][_0x78d0('0x24')]);}_0x312b98[_0x78d0('0x44')]=qs['sort'](_0xd7deee[_0x78d0('0x3d')][_0x78d0('0x45')]);_0x312b98[_0x78d0('0x46')]=qs[_0x78d0('0x3f')](_['pick'](_0xd7deee['query'],_0x444987['filters']));_0x312b98[_0x78d0('0x46')][_0x78d0('0x5e')]=_0x592fe0['id'];if(_0xd7deee[_0x78d0('0x3d')][_0x78d0('0x47')]){_0x312b98[_0x78d0('0x46')]=_[_0x78d0('0x49')](_0x312b98['where'],{'$or':_['map'](_0x312b98[_0x78d0('0x41')],function(_0x28d42c){var _0x3d2812={};_0x3d2812[_0x28d42c]={'$like':'%'+_0xd7deee['query'][_0x78d0('0x47')]+'%'};return _0x3d2812;})});}_0x312b98=_[_0x78d0('0x49')]({},_0x312b98,_0xd7deee[_0x78d0('0x4a')]);return db[_0x78d0('0x5c')][_0x78d0('0x4b')](_0x312b98);}})['then'](function(_0x3433a8){if(_0x3433a8){return db[_0x78d0('0x5f')]['findAndCountAll']({'where':{'id':_[_0x78d0('0x37')](_0x3433a8,_0x78d0('0x60')),'role':'agent'},'attributes':['id',_0x78d0('0x34'),_0x78d0('0x61'),_0x78d0('0x62'),'createdAt']});}})['then'](function(_0x280c37){if(_0x280c37){return{'count':_0x280c37[_0x78d0('0x27')],'rows':_[_0x78d0('0x37')](_0x280c37['rows'],function(_0x21133b){return{'membername':_0x21133b[_0x78d0('0x34')],'UserId':_0x21133b['id'],'queue_name':_0x520d0c[_0x78d0('0x34')],'OpenchannelQueueId':_0x520d0c['id'],'interface':util[_0x78d0('0x63')]('%s/%s',_0x78d0('0x64'),_0x21133b[_0x78d0('0x34')]),'penalty':0x0,'paused':_0x21133b[_0x78d0('0x61')],'createdAt':_0x21133b[_0x78d0('0x65')],'updatedAt':_0x21133b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x78d0('0x2d')](respondWithFilteredResult(_0x41d599,_0x312b98))[_0x78d0('0x4d')](handleError(_0x41d599,null));};exports[_0x78d0('0x66')]=function(_0x1769f2,_0x279425,_0x3e321b){var _0xd0bc8d={};var _0x5188ee={};var _0x315f9e;var _0x395502;return db['OpenchannelQueue'][_0x78d0('0x67')]({'where':{'id':_0x1769f2[_0x78d0('0x4f')]['id']}})[_0x78d0('0x2d')](handleEntityNotFound(_0x279425,null))['then'](function(_0xb5a302){if(_0xb5a302){_0x315f9e=_0xb5a302;_0x5188ee[_0x78d0('0x3c')]=_[_0x78d0('0x3e')](db[_0x78d0('0x68')][_0x78d0('0x39')]);_0x5188ee[_0x78d0('0x3d')]=_[_0x78d0('0x3e')](_0x1769f2[_0x78d0('0x3d')]);_0x5188ee[_0x78d0('0x3f')]=_[_0x78d0('0x40')](_0x5188ee[_0x78d0('0x3c')],_0x5188ee['query']);_0xd0bc8d['attributes']=_['intersection'](_0x5188ee['model'],qs[_0x78d0('0x42')](_0x1769f2[_0x78d0('0x3d')][_0x78d0('0x42')]));_0xd0bc8d[_0x78d0('0x41')]=_0xd0bc8d['attributes']['length']?_0xd0bc8d['attributes']:_0x5188ee[_0x78d0('0x3c')];_0xd0bc8d[_0x78d0('0x44')]=qs[_0x78d0('0x45')](_0x1769f2[_0x78d0('0x3d')][_0x78d0('0x45')]);_0xd0bc8d['where']=qs[_0x78d0('0x3f')](_['pick'](_0x1769f2[_0x78d0('0x3d')],_0x5188ee['filters']));if(_0x1769f2[_0x78d0('0x3d')]['filter']){_0xd0bc8d[_0x78d0('0x46')]=_[_0x78d0('0x49')](_0xd0bc8d[_0x78d0('0x46')],{'$or':_[_0x78d0('0x37')](_0xd0bc8d[_0x78d0('0x41')],function(_0x412dcb){var _0xd12b06={};_0xd12b06[_0x412dcb]={'$like':'%'+_0x1769f2[_0x78d0('0x3d')][_0x78d0('0x47')]+'%'};return _0xd12b06;})});}_0xd0bc8d=_[_0x78d0('0x49')]({},_0xd0bc8d,_0x1769f2[_0x78d0('0x4a')]);return _0x315f9e[_0x78d0('0x66')](_0xd0bc8d);}})[_0x78d0('0x2d')](function(_0x575953){if(_0x575953){_0x395502=_0x575953[_0x78d0('0x69')];if(!_0x1769f2['query'][_0x78d0('0x5d')]('nolimit')){_0xd0bc8d[_0x78d0('0x25')]=qs[_0x78d0('0x25')](_0x1769f2[_0x78d0('0x3d')]['limit']);_0xd0bc8d[_0x78d0('0x24')]=qs[_0x78d0('0x24')](_0x1769f2[_0x78d0('0x3d')][_0x78d0('0x24')]);}return _0x315f9e['getTeams'](_0xd0bc8d);}})['then'](function(_0x20fd15){if(_0x20fd15){return _0x20fd15?{'count':_0x395502,'rows':_0x20fd15}:null;}})[_0x78d0('0x2d')](respondWithResult(_0x279425,null))[_0x78d0('0x4d')](handleError(_0x279425,null));};exports[_0x78d0('0x6a')]=function(_0x26fa8b,_0x5e871,_0x32a1d6){var _0x2c7ef3=_0x26fa8b['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x2c7ef3},'attributes':['id'],'include':[{'model':db[_0x78d0('0x5f')],'as':_0x78d0('0x6b'),'attributes':['id','name',_0x78d0('0x6c'),_0x78d0('0x6d'),_0x78d0('0x6e')],'raw':!![]}]})[_0x78d0('0x2d')](function(_0x939116){if(_0x939116){var _0x2701f2=_[_0x78d0('0x6f')](_0x939116,function(_0x1bbcb5){var _0x1f0326=_0x1bbcb5[_0x78d0('0x2f')]({'plain':!![]});return _0x1f0326[_0x78d0('0x6b')];});return db['OpenchannelQueue'][_0x78d0('0x52')]({'where':{'id':_0x26fa8b[_0x78d0('0x4f')]['id']}})[_0x78d0('0x2d')](function(_0xcfbb3d){return db[_0x78d0('0x70')][_0x78d0('0x71')](function(_0x10d6c7){return _0xcfbb3d[_0x78d0('0x6a')](_0x2c7ef3,{'transaction':_0x10d6c7})[_0x78d0('0x2d')](function(){return BPromise[_0x78d0('0x72')](_0x2701f2,function(_0xdfd19e){return db[_0x78d0('0x5c')][_0x78d0('0x73')]({'where':{'UserId':_0xdfd19e['id'],'OpenchannelQueueId':_0x26fa8b[_0x78d0('0x4f')]['id']},'transaction':_0x10d6c7});});})[_0x78d0('0x2d')](function(){_0x2701f2['forEach'](function(_0x1e52d4){socket['emit'](_0x78d0('0x74'),{'UserId':_0x1e52d4['id'],'OpenchannelQueueId':_0xcfbb3d['id']});});});});});}})[_0x78d0('0x2d')](respondWithStatusCode(_0x5e871,null))[_0x78d0('0x4d')](handleError(_0x5e871,null));};exports['removeTeams']=function(_0x1dc3f9,_0x48ed1f,_0x21ee2a){return db[_0x78d0('0x68')]['findAll']({'where':{'id':_0x1dc3f9[_0x78d0('0x3d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x78d0('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x48ed1f,null))['then'](function(_0x8a7491){var _0x2faaf7=_[_0x78d0('0x37')](_0x8a7491,'id');var _0x55978d=[];var _0x3de4dd=[];var _0x39bf9c=squel[_0x78d0('0x75')]();_0x39bf9c['field']('tq.TeamId')[_0x78d0('0x76')](_0x78d0('0x77'),'tq')[_0x78d0('0x78')](_0x78d0('0x79'),'ut',_0x78d0('0x7a'))[_0x78d0('0x46')]('OpenchannelQueueId\x20=\x20?',_0x1dc3f9['params']['id']);for(var _0x595e3d=0x0;_0x595e3d<_0x8a7491[_0x78d0('0x69')];_0x595e3d+=0x1){let _0x597105=_0x8a7491[_0x595e3d];for(var _0x39e72f=0x0;_0x39e72f<_0x597105[_0x78d0('0x6b')][_0x78d0('0x69')];_0x39e72f+=0x1){let _0x163dac=_0x597105[_0x78d0('0x6b')][_0x39e72f];var _0x2956ba=_0x39bf9c['clone']();_0x2956ba[_0x78d0('0x46')](_0x78d0('0x7b'),_0x163dac['id']);_0x3de4dd[_0x78d0('0x7c')](db[_0x78d0('0x70')]['query'](_0x2956ba['toString'](),{'type':db[_0x78d0('0x70')][_0x78d0('0x7d')][_0x78d0('0x7e')]})[_0x78d0('0x2d')](function(_0x562a9a){if(_0x562a9a[_0x78d0('0x69')]===0x1){return _0x163dac['id'];}else{var _0x57ed9e=_[_0x78d0('0x7f')](_[_0x78d0('0x37')](_0x562a9a,_0x78d0('0x80')),function(_0x14b4d7){return _[_0x78d0('0x81')](_0x2faaf7,_0x14b4d7);});if(_0x57ed9e){return _0x163dac['id'];}}}));}}return BPromise[_0x78d0('0x82')](_0x3de4dd)[_0x78d0('0x2d')](function(_0xbb60cd){_0x55978d=_(_0x55978d)[_0x78d0('0x83')](_0xbb60cd)[_0x78d0('0x84')]()[_0x78d0('0x85')]();return db[_0x78d0('0x38')][_0x78d0('0x52')]({'where':{'id':_0x1dc3f9[_0x78d0('0x4f')]['id']}})['then'](function(_0x372ec4){return db['sequelize'][_0x78d0('0x71')](function(_0x54bc78){return _0x372ec4[_0x78d0('0x86')](_0x1dc3f9[_0x78d0('0x3d')][_0x78d0('0x87')],{'transaction':_0x54bc78})[_0x78d0('0x2d')](function(){if(!_['isEmpty'](_0x55978d)){return _0x372ec4[_0x78d0('0x88')](_0x55978d,{'transaction':_0x54bc78});}})['then'](function(){_0x55978d[_0x78d0('0x89')](function(_0x2b142c){socket['emit'](_0x78d0('0x8a'),{'UserId':_0x2b142c,'OpenchannelQueueId':_0x372ec4['id']});});});});});});})[_0x78d0('0x2d')](respondWithStatusCode(_0x48ed1f,null))[_0x78d0('0x4d')](handleError(_0x48ed1f,null));};exports['addAgents']=function(_0x4b1e21,_0x3ef934,_0x4add04){return db[_0x78d0('0x38')]['find']({'where':{'id':_0x4b1e21[_0x78d0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3ef934,null))[_0x78d0('0x2d')](function(_0x51e558){if(_0x51e558){return _0x51e558[_0x78d0('0x8b')](_0x4b1e21[_0x78d0('0x5a')]['ids'],_[_0x78d0('0x8c')](_0x4b1e21[_0x78d0('0x5a')],[_0x78d0('0x87'),'id'])||{})[_0x78d0('0x8d')](function(_0x387a62){for(var _0x13e15f=0x0;_0x13e15f<_0x4b1e21[_0x78d0('0x5a')][_0x78d0('0x87')][_0x78d0('0x69')];_0x13e15f+=0x1){socket['emit'](_0x78d0('0x74'),{'UserId':Number(_0x4b1e21[_0x78d0('0x5a')]['ids'][_0x13e15f]),'OpenchannelQueueId':Number(_0x4b1e21['params']['id'])});}return _0x387a62;});}})[_0x78d0('0x2d')](respondWithResult(_0x3ef934,null))[_0x78d0('0x4d')](handleError(_0x3ef934,null));};exports['removeAgents']=function(_0x500816,_0x3fb475,_0x3ad97d){return db[_0x78d0('0x38')][_0x78d0('0x52')]({'where':{'id':_0x500816[_0x78d0('0x4f')]['id']}})[_0x78d0('0x2d')](handleEntityNotFound(_0x3fb475,null))[_0x78d0('0x2d')](function(_0x50f31c){if(_0x50f31c){return _0x50f31c[_0x78d0('0x88')](_0x500816[_0x78d0('0x3d')][_0x78d0('0x87')])[_0x78d0('0x2d')](function(){if(_[_0x78d0('0x8e')](_0x500816[_0x78d0('0x3d')][_0x78d0('0x87')])){for(var _0x4cfa2e=0x0;_0x4cfa2e<_0x500816['query'][_0x78d0('0x87')][_0x78d0('0x69')];_0x4cfa2e+=0x1){socket[_0x78d0('0x8f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x500816['query']['ids'][_0x4cfa2e]),'OpenchannelQueueId':Number(_0x500816[_0x78d0('0x4f')]['id'])});}}else{socket['emit'](_0x78d0('0x8a'),{'UserId':Number(_0x500816[_0x78d0('0x3d')]['ids']),'OpenchannelQueueId':Number(_0x500816[_0x78d0('0x4f')]['id'])});}});}})[_0x78d0('0x2d')](respondWithStatusCode(_0x3fb475,null))['catch'](handleError(_0x3fb475,null));};exports[_0x78d0('0x90')]=function(_0x3b7c37,_0x4a2837,_0x5b3425){var _0x57e24b={};var _0x2a35a1={};var _0x59aaf3;var _0x20c3fe;return db['OpenchannelQueue'][_0x78d0('0x67')]({'where':{'id':_0x3b7c37[_0x78d0('0x4f')]['id']}})[_0x78d0('0x2d')](handleEntityNotFound(_0x4a2837,null))[_0x78d0('0x2d')](function(_0x8b8b67){if(_0x8b8b67){_0x59aaf3=_0x8b8b67;_0x2a35a1[_0x78d0('0x3c')]=_[_0x78d0('0x3e')](db[_0x78d0('0x5f')][_0x78d0('0x39')]);_0x2a35a1['query']=_['keys'](_0x3b7c37[_0x78d0('0x3d')]);_0x2a35a1[_0x78d0('0x3f')]=_[_0x78d0('0x40')](_0x2a35a1[_0x78d0('0x3c')],_0x2a35a1[_0x78d0('0x3d')]);_0x57e24b[_0x78d0('0x41')]=_['intersection'](_0x2a35a1['model'],qs[_0x78d0('0x42')](_0x3b7c37[_0x78d0('0x3d')][_0x78d0('0x42')]));_0x57e24b['attributes']=_0x57e24b['attributes'][_0x78d0('0x69')]?_0x57e24b[_0x78d0('0x41')]:_0x2a35a1['model'];_0x57e24b[_0x78d0('0x44')]=qs['sort'](_0x3b7c37[_0x78d0('0x3d')][_0x78d0('0x45')]);_0x57e24b[_0x78d0('0x46')]=qs[_0x78d0('0x3f')](_[_0x78d0('0x91')](_0x3b7c37[_0x78d0('0x3d')],_0x2a35a1[_0x78d0('0x3f')]));if(_0x3b7c37[_0x78d0('0x3d')]['filter']){_0x57e24b[_0x78d0('0x46')]=_[_0x78d0('0x49')](_0x57e24b[_0x78d0('0x46')],{'$or':_[_0x78d0('0x37')](_0x57e24b[_0x78d0('0x41')],function(_0x596f25){var _0x5546eb={};_0x5546eb[_0x596f25]={'$like':'%'+_0x3b7c37[_0x78d0('0x3d')][_0x78d0('0x47')]+'%'};return _0x5546eb;})});}_0x57e24b=_[_0x78d0('0x49')]({},_0x57e24b,_0x3b7c37['options']);return _0x59aaf3[_0x78d0('0x90')](_0x57e24b);}})[_0x78d0('0x2d')](function(_0x320cbd){if(_0x320cbd){_0x20c3fe=_0x320cbd[_0x78d0('0x69')];if(!_0x3b7c37[_0x78d0('0x3d')]['hasOwnProperty'](_0x78d0('0x43'))){_0x57e24b[_0x78d0('0x25')]=qs[_0x78d0('0x25')](_0x3b7c37[_0x78d0('0x3d')]['limit']);_0x57e24b['offset']=qs[_0x78d0('0x24')](_0x3b7c37[_0x78d0('0x3d')][_0x78d0('0x24')]);}return _0x59aaf3[_0x78d0('0x90')](_0x57e24b);}})[_0x78d0('0x2d')](function(_0x3e19f){if(_0x3e19f){return _0x3e19f?{'count':_0x20c3fe,'rows':_0x3e19f}:null;}})[_0x78d0('0x2d')](respondWithResult(_0x4a2837,null))['catch'](handleError(_0x4a2837,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 1b716aa..edf9a32 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 _0x804b=['../../mysqldb','OpenchannelQueue','setMaxListeners','remove','emit','hasOwnProperty','hook','events'];(function(_0x2a5167,_0x4ac282){var _0x45c09f=function(_0xf40c50){while(--_0xf40c50){_0x2a5167['push'](_0x2a5167['shift']());}};_0x45c09f(++_0x4ac282);}(_0x804b,0xc7));var _0xb804=function(_0x18bb6e,_0x41eb45){_0x18bb6e=_0x18bb6e-0x0;var _0x33e58c=_0x804b[_0x18bb6e];return _0x33e58c;};'use strict';var EventEmitter=require(_0xb804('0x0'));var OpenchannelQueue=require(_0xb804('0x1'))['db'][_0xb804('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xb804('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb804('0x4')};function emitEvent(_0x1acf2d){return function(_0x5aa6a3,_0x1c99ee,_0x1d5436){OpenchannelQueueEvents[_0xb804('0x5')](_0x1acf2d+':'+_0x5aa6a3['id'],_0x5aa6a3);OpenchannelQueueEvents[_0xb804('0x5')](_0x1acf2d,_0x5aa6a3);_0x1d5436(null);};}for(var e in events){if(events[_0xb804('0x6')](e)){var event=events[e];OpenchannelQueue[_0xb804('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xd197=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x4e18a,_0x2d220a){var _0x56cc08=function(_0x1a5e7e){while(--_0x1a5e7e){_0x4e18a['push'](_0x4e18a['shift']());}};_0x56cc08(++_0x2d220a);}(_0xd197,0x18b));var _0x7d19=function(_0x40dbe5,_0x21dd45){_0x40dbe5=_0x40dbe5-0x0;var _0x3038a5=_0xd197[_0x40dbe5];return _0x3038a5;};'use strict';var EventEmitter=require(_0x7d19('0x0'));var OpenchannelQueue=require(_0x7d19('0x1'))['db'][_0x7d19('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x7d19('0x3')](0x0);var events={'afterCreate':_0x7d19('0x4'),'afterUpdate':_0x7d19('0x5'),'afterDestroy':_0x7d19('0x6')};function emitEvent(_0x56bff2){return function(_0x3728b9,_0x437a8c,_0x1741c9){OpenchannelQueueEvents[_0x7d19('0x7')](_0x56bff2+':'+_0x3728b9['id'],_0x3728b9);OpenchannelQueueEvents[_0x7d19('0x7')](_0x56bff2,_0x3728b9);_0x1741c9(null);};}for(var e in events){if(events[_0x7d19('0x8')](e)){var event=events[e];OpenchannelQueue[_0x7d19('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index d0a5448..40ba4c1 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 _0x6355=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','lodash'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x6355,0xdb));var _0x5635=function(_0x4bc2ba,_0x537506){_0x4bc2ba=_0x4bc2ba-0x0;var _0xae9c9b=_0x6355[_0x4bc2ba];return _0xae9c9b;};'use strict';var _=require(_0x5635('0x0'));var util=require(_0x5635('0x1'));var logger=require('../../config/logger')(_0x5635('0x2'));var moment=require(_0x5635('0x3'));var BPromise=require(_0x5635('0x4'));var rp=require(_0x5635('0x5'));var fs=require('fs');var path=require(_0x5635('0x6'));var rimraf=require('rimraf');var config=require(_0x5635('0x7'));var attributes=require(_0x5635('0x8'));module[_0x5635('0x9')]=function(_0x81e605,_0x59cec7){return _0x81e605['define'](_0x5635('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c46=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','OpenchannelQueue','openchannel_queues','lodash','util'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x3c46,0xfa));var _0x63c4=function(_0x386ed8,_0x2e6ae9){_0x386ed8=_0x386ed8-0x0;var _0x1fbe5e=_0x3c46[_0x386ed8];return _0x1fbe5e;};'use strict';var _=require(_0x63c4('0x0'));var util=require(_0x63c4('0x1'));var logger=require('../../config/logger')(_0x63c4('0x2'));var moment=require(_0x63c4('0x3'));var BPromise=require(_0x63c4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63c4('0x5'));var rimraf=require(_0x63c4('0x6'));var config=require(_0x63c4('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0x63c4('0x8')]=function(_0x2a9c7b,_0x5ddec0){return _0x2a9c7b[_0x63c4('0x9')](_0x63c4('0xa'),attributes,{'tableName':_0x63c4('0xb'),'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 4739599..bc282cb 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 _0x7ac4=['info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowOpenchannelQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x59795e,_0x8b5bc2){var _0x386fc4=function(_0x2bb55c){while(--_0x2bb55c){_0x59795e['push'](_0x59795e['shift']());}};_0x386fc4(++_0x8b5bc2);}(_0x7ac4,0xe9));var _0x47ac=function(_0x7d5872,_0x37123a){_0x7d5872=_0x7d5872-0x0;var _0x45661c=_0x7ac4[_0x7d5872];return _0x45661c;};'use strict';var _=require('lodash');var util=require(_0x47ac('0x0'));var moment=require(_0x47ac('0x1'));var BPromise=require(_0x47ac('0x2'));var rs=require(_0x47ac('0x3'));var fs=require('fs');var Redis=require(_0x47ac('0x4'));var db=require(_0x47ac('0x5'))['db'];var utils=require(_0x47ac('0x6'));var logger=require(_0x47ac('0x7'))(_0x47ac('0x8'));var config=require(_0x47ac('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x47ac('0xa')][_0x47ac('0xb')]({'port':0x232a});config[_0x47ac('0xc')]=_[_0x47ac('0xd')](config[_0x47ac('0xc')],{'host':_0x47ac('0xe'),'port':0x18eb});var socket=require(_0x47ac('0xf'))(new Redis(config[_0x47ac('0xc')]));require('./openchannelQueue.socket')[_0x47ac('0x10')](socket);function respondWithRpcPromise(_0x445614,_0x417eb0,_0x35514d){return new BPromise(function(_0x405a95,_0x43c3d8){return client[_0x47ac('0x11')](_0x445614,_0x35514d)[_0x47ac('0x12')](function(_0x24633d){logger[_0x47ac('0x13')](_0x47ac('0x14'),_0x417eb0,_0x47ac('0x15'));logger[_0x47ac('0x16')](_0x47ac('0x17'),_0x417eb0,_0x47ac('0x15'),JSON[_0x47ac('0x18')](_0x24633d));if(_0x24633d[_0x47ac('0x19')]){if(_0x24633d[_0x47ac('0x19')][_0x47ac('0x1a')]===0x1f4){logger[_0x47ac('0x19')](_0x47ac('0x14'),_0x417eb0,_0x24633d[_0x47ac('0x19')][_0x47ac('0x1b')]);return _0x43c3d8(_0x24633d[_0x47ac('0x19')][_0x47ac('0x1b')]);}logger[_0x47ac('0x19')](_0x47ac('0x14'),_0x417eb0,_0x24633d[_0x47ac('0x19')][_0x47ac('0x1b')]);return _0x405a95(_0x24633d[_0x47ac('0x19')][_0x47ac('0x1b')]);}else{logger[_0x47ac('0x13')](_0x47ac('0x14'),_0x417eb0,_0x47ac('0x15'));_0x405a95(_0x24633d['result'][_0x47ac('0x1b')]);}})[_0x47ac('0x1c')](function(_0x3fb682){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x417eb0,_0x3fb682);_0x43c3d8(_0x3fb682);});});}exports[_0x47ac('0x1d')]=function(_0x513ab0){var _0x16ce1a=this;return new Promise(function(_0x2b8866,_0xcd417d){return db[_0x47ac('0x1e')][_0x47ac('0x1f')]({'raw':_0x513ab0[_0x47ac('0x20')]?_0x513ab0[_0x47ac('0x20')][_0x47ac('0x21')]===undefined?!![]:![]:!![],'where':_0x513ab0[_0x47ac('0x20')]?_0x513ab0[_0x47ac('0x20')][_0x47ac('0x22')]||null:null,'attributes':_0x513ab0[_0x47ac('0x20')]?_0x513ab0['options']['attributes']||null:null,'limit':_0x513ab0[_0x47ac('0x20')]?_0x513ab0['options'][_0x47ac('0x23')]||null:null,'include':_0x513ab0[_0x47ac('0x20')]?_0x513ab0['options'][_0x47ac('0x24')]?_[_0x47ac('0x25')](_0x513ab0[_0x47ac('0x20')]['include'],function(_0x17335e){return{'model':db[_0x17335e[_0x47ac('0x26')]],'as':_0x17335e['as'],'attributes':_0x17335e[_0x47ac('0x27')],'include':_0x17335e['include']?_[_0x47ac('0x25')](_0x17335e[_0x47ac('0x24')],function(_0x5e1d22){return{'model':db[_0x5e1d22[_0x47ac('0x26')]],'as':_0x5e1d22['as'],'attributes':_0x5e1d22[_0x47ac('0x27')],'include':_0x5e1d22[_0x47ac('0x24')]?_[_0x47ac('0x25')](_0x5e1d22['include'],function(_0x9c4c64){return{'model':db[_0x9c4c64['model']],'as':_0x9c4c64['as'],'attributes':_0x9c4c64[_0x47ac('0x27')]};}):[]};}):[]};}):[]:[]})[_0x47ac('0x12')](function(_0x48db3e){logger[_0x47ac('0x13')](_0x47ac('0x1d'),_0x513ab0);logger[_0x47ac('0x16')]('GetOpenchannelQueue',_0x513ab0,JSON[_0x47ac('0x18')](_0x48db3e));_0x2b8866(_0x48db3e);})[_0x47ac('0x1c')](function(_0x548041){logger[_0x47ac('0x19')]('GetOpenchannelQueue',_0x548041['message'],_0x513ab0);_0xcd417d(_0x16ce1a['error'](0x1f4,_0x548041[_0x47ac('0x1b')]));});});};exports[_0x47ac('0x28')]=function(_0x5b268b){var _0x4248f7=this;return new Promise(function(_0x497731,_0x259c80){return db[_0x47ac('0x1e')][_0x47ac('0x29')]({'raw':_0x5b268b[_0x47ac('0x20')]?_0x5b268b[_0x47ac('0x20')][_0x47ac('0x21')]===undefined?!![]:![]:!![],'where':_0x5b268b[_0x47ac('0x20')]?_0x5b268b['options'][_0x47ac('0x22')]||null:null,'attributes':_0x5b268b[_0x47ac('0x20')]?_0x5b268b['options'][_0x47ac('0x27')]||null:null,'include':_0x5b268b['options']?_0x5b268b[_0x47ac('0x20')]['include']?_['map'](_0x5b268b[_0x47ac('0x20')]['include'],function(_0x396dcf){return{'model':db[_0x396dcf[_0x47ac('0x26')]],'as':_0x396dcf['as'],'attributes':_0x396dcf[_0x47ac('0x27')],'include':_0x396dcf[_0x47ac('0x24')]?_[_0x47ac('0x25')](_0x396dcf[_0x47ac('0x24')],function(_0x57d0ff){return{'model':db[_0x57d0ff['model']],'as':_0x57d0ff['as'],'attributes':_0x57d0ff[_0x47ac('0x27')],'include':_0x57d0ff[_0x47ac('0x24')]?_['map'](_0x57d0ff['include'],function(_0x13a8b5){return{'model':db[_0x13a8b5[_0x47ac('0x26')]],'as':_0x13a8b5['as'],'attributes':_0x13a8b5[_0x47ac('0x27')]};}):[]};}):[]};}):[]:[]})[_0x47ac('0x12')](function(_0x3e92a9){logger[_0x47ac('0x13')]('ShowOpenchannelQueue',_0x5b268b);logger[_0x47ac('0x16')](_0x47ac('0x28'),_0x5b268b,JSON['stringify'](_0x3e92a9));_0x497731(_0x3e92a9);})[_0x47ac('0x1c')](function(_0x54a3c8){logger[_0x47ac('0x19')](_0x47ac('0x28'),_0x54a3c8[_0x47ac('0x1b')],_0x5b268b);_0x259c80(_0x4248f7[_0x47ac('0x19')](0x1f4,_0x54a3c8['message']));});});}; \ No newline at end of file +var _0x29c8=['stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','include','map','model','attributes','ShowOpenchannelQueue','find','lodash','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x29c8,0xd0));var _0x829c=function(_0xfcedf2,_0xfe4de2){_0xfcedf2=_0xfcedf2-0x0;var _0x416d2e=_0x29c8[_0xfcedf2];return _0x416d2e;};'use strict';var _=require(_0x829c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x829c('0x1'));var fs=require('fs');var Redis=require(_0x829c('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x829c('0x3'))('rpc');var config=require(_0x829c('0x4'));var jayson=require(_0x829c('0x5'));var client=jayson['client'][_0x829c('0x6')]({'port':0x232a});config['redis']=_[_0x829c('0x7')](config[_0x829c('0x8')],{'host':_0x829c('0x9'),'port':0x18eb});var socket=require(_0x829c('0xa'))(new Redis(config['redis']));require(_0x829c('0xb'))[_0x829c('0xc')](socket);function respondWithRpcPromise(_0x4c1b25,_0x39239b,_0x278879){return new BPromise(function(_0x4f8c90,_0x191571){return client[_0x829c('0xd')](_0x4c1b25,_0x278879)[_0x829c('0xe')](function(_0x13bd50){logger[_0x829c('0xf')](_0x829c('0x10'),_0x39239b,'request\x20sent');logger[_0x829c('0x11')](_0x829c('0x12'),_0x39239b,_0x829c('0x13'),JSON[_0x829c('0x14')](_0x13bd50));if(_0x13bd50[_0x829c('0x15')]){if(_0x13bd50[_0x829c('0x15')][_0x829c('0x16')]===0x1f4){logger[_0x829c('0x15')](_0x829c('0x10'),_0x39239b,_0x13bd50['error'][_0x829c('0x17')]);return _0x191571(_0x13bd50[_0x829c('0x15')]['message']);}logger[_0x829c('0x15')](_0x829c('0x10'),_0x39239b,_0x13bd50[_0x829c('0x15')]['message']);return _0x4f8c90(_0x13bd50[_0x829c('0x15')][_0x829c('0x17')]);}else{logger[_0x829c('0xf')](_0x829c('0x10'),_0x39239b,_0x829c('0x13'));_0x4f8c90(_0x13bd50[_0x829c('0x18')][_0x829c('0x17')]);}})[_0x829c('0x19')](function(_0xa14a1b){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x39239b,_0xa14a1b);_0x191571(_0xa14a1b);});});}exports[_0x829c('0x1a')]=function(_0x1baabf){var _0x2cf583=this;return new Promise(function(_0x396b96,_0x1ae32d){return db[_0x829c('0x1b')][_0x829c('0x1c')]({'raw':_0x1baabf[_0x829c('0x1d')]?_0x1baabf[_0x829c('0x1d')][_0x829c('0x1e')]===undefined?!![]:![]:!![],'where':_0x1baabf['options']?_0x1baabf['options'][_0x829c('0x1f')]||null:null,'attributes':_0x1baabf[_0x829c('0x1d')]?_0x1baabf['options']['attributes']||null:null,'limit':_0x1baabf[_0x829c('0x1d')]?_0x1baabf[_0x829c('0x1d')]['limit']||null:null,'include':_0x1baabf[_0x829c('0x1d')]?_0x1baabf[_0x829c('0x1d')][_0x829c('0x20')]?_[_0x829c('0x21')](_0x1baabf['options'][_0x829c('0x20')],function(_0x4276ad){return{'model':db[_0x4276ad[_0x829c('0x22')]],'as':_0x4276ad['as'],'attributes':_0x4276ad[_0x829c('0x23')],'include':_0x4276ad[_0x829c('0x20')]?_[_0x829c('0x21')](_0x4276ad[_0x829c('0x20')],function(_0x1f9024){return{'model':db[_0x1f9024['model']],'as':_0x1f9024['as'],'attributes':_0x1f9024[_0x829c('0x23')],'include':_0x1f9024[_0x829c('0x20')]?_['map'](_0x1f9024[_0x829c('0x20')],function(_0x33632c){return{'model':db[_0x33632c[_0x829c('0x22')]],'as':_0x33632c['as'],'attributes':_0x33632c[_0x829c('0x23')]};}):[]};}):[]};}):[]:[]})[_0x829c('0xe')](function(_0x4704c2){logger[_0x829c('0xf')](_0x829c('0x1a'),_0x1baabf);logger[_0x829c('0x11')](_0x829c('0x1a'),_0x1baabf,JSON[_0x829c('0x14')](_0x4704c2));_0x396b96(_0x4704c2);})[_0x829c('0x19')](function(_0x460381){logger[_0x829c('0x15')](_0x829c('0x1a'),_0x460381[_0x829c('0x17')],_0x1baabf);_0x1ae32d(_0x2cf583[_0x829c('0x15')](0x1f4,_0x460381[_0x829c('0x17')]));});});};exports[_0x829c('0x24')]=function(_0x1e9f50){var _0x4891e7=this;return new Promise(function(_0x23003e,_0x55ab51){return db[_0x829c('0x1b')][_0x829c('0x25')]({'raw':_0x1e9f50[_0x829c('0x1d')]?_0x1e9f50['options']['raw']===undefined?!![]:![]:!![],'where':_0x1e9f50[_0x829c('0x1d')]?_0x1e9f50[_0x829c('0x1d')]['where']||null:null,'attributes':_0x1e9f50[_0x829c('0x1d')]?_0x1e9f50[_0x829c('0x1d')][_0x829c('0x23')]||null:null,'include':_0x1e9f50[_0x829c('0x1d')]?_0x1e9f50[_0x829c('0x1d')][_0x829c('0x20')]?_['map'](_0x1e9f50[_0x829c('0x1d')][_0x829c('0x20')],function(_0x128f88){return{'model':db[_0x128f88['model']],'as':_0x128f88['as'],'attributes':_0x128f88[_0x829c('0x23')],'include':_0x128f88[_0x829c('0x20')]?_['map'](_0x128f88[_0x829c('0x20')],function(_0x14b3f9){return{'model':db[_0x14b3f9[_0x829c('0x22')]],'as':_0x14b3f9['as'],'attributes':_0x14b3f9['attributes'],'include':_0x14b3f9[_0x829c('0x20')]?_[_0x829c('0x21')](_0x14b3f9[_0x829c('0x20')],function(_0x540fa0){return{'model':db[_0x540fa0[_0x829c('0x22')]],'as':_0x540fa0['as'],'attributes':_0x540fa0[_0x829c('0x23')]};}):[]};}):[]};}):[]:[]})[_0x829c('0xe')](function(_0x523bb3){logger[_0x829c('0xf')](_0x829c('0x24'),_0x1e9f50);logger['debug'](_0x829c('0x24'),_0x1e9f50,JSON[_0x829c('0x14')](_0x523bb3));_0x23003e(_0x523bb3);})[_0x829c('0x19')](function(_0x24682b){logger['error']('ShowOpenchannelQueue',_0x24682b[_0x829c('0x17')],_0x1e9f50);_0x55ab51(_0x4891e7['error'](0x1f4,_0x24682b[_0x829c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index f6154fe..e2ef042 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 _0xb774=['removeListener','register','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit'];(function(_0x2f7ae3,_0x223602){var _0x3fcce6=function(_0x1313e5){while(--_0x1313e5){_0x2f7ae3['push'](_0x2f7ae3['shift']());}};_0x3fcce6(++_0x223602);}(_0xb774,0x1d3));var _0x4b77=function(_0x59713a,_0x446808){_0x59713a=_0x59713a-0x0;var _0x3ba098=_0xb774[_0x59713a];return _0x3ba098;};'use strict';var OpenchannelQueueEvents=require(_0x4b77('0x0'));var events=[_0x4b77('0x1'),_0x4b77('0x2'),_0x4b77('0x3')];function createListener(_0x2903d4,_0x337a8b){return function(_0x235aed){_0x337a8b[_0x4b77('0x4')](_0x2903d4,_0x235aed);};}function removeListener(_0x46b2ee,_0x496606){return function(){OpenchannelQueueEvents[_0x4b77('0x5')](_0x46b2ee,_0x496606);};}exports[_0x4b77('0x6')]=function(_0x19e511){for(var _0x47cd2a=0x0,_0x44bebf=events['length'];_0x47cd2a<_0x44bebf;_0x47cd2a++){var _0x278b54=events[_0x47cd2a];var _0x18fe2c=createListener(_0x4b77('0x7')+_0x278b54,_0x19e511);OpenchannelQueueEvents['on'](_0x278b54,_0x18fe2c);}}; \ No newline at end of file +var _0x4a0c=['length','save','update','emit','removeListener','register'];(function(_0x42127d,_0x319f25){var _0x338b8c=function(_0x2360c5){while(--_0x2360c5){_0x42127d['push'](_0x42127d['shift']());}};_0x338b8c(++_0x319f25);}(_0x4a0c,0x145));var _0xc4a0=function(_0x26d48e,_0x54c15e){_0x26d48e=_0x26d48e-0x0;var _0x20484d=_0x4a0c[_0x26d48e];return _0x20484d;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xc4a0('0x0'),'remove',_0xc4a0('0x1')];function createListener(_0x3cf9a6,_0x48ae5c){return function(_0x1fb2ad){_0x48ae5c[_0xc4a0('0x2')](_0x3cf9a6,_0x1fb2ad);};}function removeListener(_0x57493c,_0x36bad0){return function(){OpenchannelQueueEvents[_0xc4a0('0x3')](_0x57493c,_0x36bad0);};}exports[_0xc4a0('0x4')]=function(_0x20b8a0){for(var _0x3fb097=0x0,_0x41c71f=events[_0xc4a0('0x5')];_0x3fb097<_0x41c71f;_0x3fb097++){var _0x5e3c65=events[_0x3fb097];var _0x4b51bd=createListener('openchannelQueue:'+_0x5e3c65,_0x20b8a0);OpenchannelQueueEvents['on'](_0x5e3c65,_0x4b51bd);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index cdb19de..64f3662 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 _0x2a54=['util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','delete','destroy','exports','multer'];(function(_0xe9d0b6,_0x594ff3){var _0x5eb165=function(_0x4c2294){while(--_0x4c2294){_0xe9d0b6['push'](_0xe9d0b6['shift']());}};_0x5eb165(++_0x594ff3);}(_0x2a54,0xc5));var _0x42a5=function(_0x142a7b,_0xcefdd8){_0x142a7b=_0x142a7b-0x0;var _0x3fbfad=_0x2a54[_0x142a7b];return _0x3fbfad;};'use strict';var multer=require(_0x42a5('0x0'));var util=require(_0x42a5('0x1'));var path=require(_0x42a5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x42a5('0x3')]();var fs_extra=require(_0x42a5('0x4'));var auth=require(_0x42a5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x42a5('0x6'));var controller=require(_0x42a5('0x7'));router[_0x42a5('0x8')]('/',auth[_0x42a5('0x9')](),controller[_0x42a5('0xa')]);router[_0x42a5('0x8')]('/describe',auth[_0x42a5('0x9')](),controller[_0x42a5('0xb')]);router['get'](_0x42a5('0xc'),auth[_0x42a5('0x9')](),controller[_0x42a5('0xd')]);router[_0x42a5('0xe')]('/',auth[_0x42a5('0x9')](),controller['create']);router['put'](_0x42a5('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x42a5('0xf')](_0x42a5('0xc'),auth['isAuthenticated'](),controller[_0x42a5('0x10')]);module[_0x42a5('0x11')]=router; \ No newline at end of file +var _0xaed2=['create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x43a860,_0x8ce5f1){var _0x3916c5=function(_0x817d93){while(--_0x817d93){_0x43a860['push'](_0x43a860['shift']());}};_0x3916c5(++_0x8ce5f1);}(_0xaed2,0x6e));var _0x2aed=function(_0x1e00d0,_0x380c3b){_0x1e00d0=_0x1e00d0-0x0;var _0x35d81c=_0xaed2[_0x1e00d0];return _0x35d81c;};'use strict';var multer=require(_0x2aed('0x0'));var util=require(_0x2aed('0x1'));var path=require(_0x2aed('0x2'));var timeout=require('connect-timeout');var express=require(_0x2aed('0x3'));var router=express[_0x2aed('0x4')]();var fs_extra=require(_0x2aed('0x5'));var auth=require(_0x2aed('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2aed('0x7'));var controller=require(_0x2aed('0x8'));router[_0x2aed('0x9')]('/',auth[_0x2aed('0xa')](),controller[_0x2aed('0xb')]);router[_0x2aed('0x9')](_0x2aed('0xc'),auth[_0x2aed('0xa')](),controller['describe']);router['get'](_0x2aed('0xd'),auth[_0x2aed('0xa')](),controller[_0x2aed('0xe')]);router[_0x2aed('0xf')]('/',auth[_0x2aed('0xa')](),controller[_0x2aed('0x10')]);router[_0x2aed('0x11')](_0x2aed('0xd'),auth[_0x2aed('0xa')](),controller[_0x2aed('0x12')]);router[_0x2aed('0x13')](_0x2aed('0xd'),auth[_0x2aed('0xa')](),controller[_0x2aed('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 9a8b6c9..1868a13 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 _0x9ee6=['DATE','sequelize','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9ee6,0x94));var _0x69ee=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0x9ee6[_0x146a97];return _0x259d5c;};'use strict';var moment=require('moment');var Sequelize=require(_0x69ee('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x69ee('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x69ee('0x2')]},'acceptAt':{'type':Sequelize[_0x69ee('0x2')]},'exitAt':{'type':Sequelize[_0x69ee('0x2')]},'reason':{'type':Sequelize[_0x69ee('0x1')]}}; \ No newline at end of file +var _0x6c8e=['DATE','sequelize','exports','STRING'];(function(_0xcef710,_0x167e90){var _0x4d369f=function(_0x376c51){while(--_0x376c51){_0xcef710['push'](_0xcef710['shift']());}};_0x4d369f(++_0x167e90);}(_0x6c8e,0x139));var _0xe6c8=function(_0x159d48,_0x4e5b7f){_0x159d48=_0x159d48-0x0;var _0x26e335=_0x6c8e[_0x159d48];return _0x26e335;};'use strict';var moment=require('moment');var Sequelize=require(_0xe6c8('0x0'));module[_0xe6c8('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe6c8('0x2')]},'joinAt':{'type':Sequelize[_0xe6c8('0x3')]},'leaveAt':{'type':Sequelize[_0xe6c8('0x3')]},'acceptAt':{'type':Sequelize[_0xe6c8('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xe6c8('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 001ac03..2179a1a 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 _0xb500=['sort','where','filters','pick','filter','merge','VIRTUAL','OpenchannelQueueReport','includeAll','rows','show','params','fields','options','find','catch','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','end','error','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x13ed90,_0x2a0242){var _0x2a5e0a=function(_0x471c26){while(--_0x471c26){_0x13ed90['push'](_0x13ed90['shift']());}};_0x2a5e0a(++_0x2a0242);}(_0xb500,0x1d0));var _0x0b50=function(_0x2657ee,_0x2751ef){_0x2657ee=_0x2657ee-0x0;var _0x501804=_0xb500[_0x2657ee];return _0x501804;};'use strict';var emlformat=require(_0x0b50('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0b50('0x1'));var jsonpatch=require(_0x0b50('0x2'));var rp=require(_0x0b50('0x3'));var moment=require(_0x0b50('0x4'));var BPromise=require(_0x0b50('0x5'));var Mustache=require('mustache');var util=require(_0x0b50('0x6'));var path=require(_0x0b50('0x7'));var sox=require(_0x0b50('0x8'));var csv=require(_0x0b50('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b50('0xa'));var _=require(_0x0b50('0xb'));var squel=require(_0x0b50('0xc'));var crypto=require(_0x0b50('0xd'));var jsforce=require(_0x0b50('0xe'));var deskjs=require(_0x0b50('0xf'));var toCsv=require(_0x0b50('0x9'));var querystring=require('querystring');var Papa=require(_0x0b50('0x10'));var Redis=require(_0x0b50('0x11'));var authService=require(_0x0b50('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b50('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x0b50('0x14'));var config=require(_0x0b50('0x15'));var licenseUtil=require(_0x0b50('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ef4cd,_0x58f727){_0x58f727=_0x58f727||0xcc;return function(_0x3ad36c){if(_0x3ad36c){return _0x1ef4cd[_0x0b50('0x17')](_0x58f727);}return _0x1ef4cd[_0x0b50('0x18')](_0x58f727)['end']();};}function respondWithResult(_0x23de25,_0x100f84){_0x100f84=_0x100f84||0xc8;return function(_0x290211){if(_0x290211){return _0x23de25['status'](_0x100f84)[_0x0b50('0x19')](_0x290211);}};}function respondWithFilteredResult(_0x4918f7,_0x32c25d){return function(_0x4dda96){if(_0x4dda96){var _0x3f436c=typeof _0x32c25d[_0x0b50('0x1a')]===_0x0b50('0x1b')&&typeof _0x32c25d['limit']===_0x0b50('0x1b');var _0x42a748=_0x4dda96['count'];var _0x4504dc=_0x3f436c?0x0:_0x32c25d[_0x0b50('0x1a')];var _0x9ea20c=_0x3f436c?_0x4dda96[_0x0b50('0x1c')]:_0x32c25d[_0x0b50('0x1a')]+_0x32c25d[_0x0b50('0x1d')];var _0x46eb66;if(_0x9ea20c>=_0x42a748){_0x9ea20c=_0x42a748;_0x46eb66=0xc8;}else{_0x46eb66=0xce;}_0x4918f7['status'](_0x46eb66);return _0x4918f7[_0x0b50('0x1e')](_0x0b50('0x1f'),_0x4504dc+'-'+_0x9ea20c+'/'+_0x42a748)[_0x0b50('0x19')](_0x4dda96);}return null;};}function patchUpdates(_0x2ef005){return function(_0x5a8672){try{jsonpatch[_0x0b50('0x20')](_0x5a8672,_0x2ef005,!![]);}catch(_0x421833){return BPromise['reject'](_0x421833);}return _0x5a8672[_0x0b50('0x21')]();};}function saveUpdates(_0x980eb8,_0x37959c){return function(_0x34c5cf){if(_0x34c5cf){return _0x34c5cf['update'](_0x980eb8)[_0x0b50('0x22')](function(_0x55c98d){return _0x55c98d;});}return null;};}function removeEntity(_0xf572d3,_0xe6fccd){return function(_0x1af316){if(_0x1af316){return _0x1af316[_0x0b50('0x23')]()[_0x0b50('0x22')](function(){_0xf572d3[_0x0b50('0x18')](0xcc)[_0x0b50('0x24')]();});}};}function handleEntityNotFound(_0x129a4f,_0x4c6935){return function(_0x1dd43a){if(!_0x1dd43a){_0x129a4f[_0x0b50('0x17')](0x194);}return _0x1dd43a;};}function handleError(_0xa65099,_0x49adfd){_0x49adfd=_0x49adfd||0x1f4;return function(_0x4ccb1e){logger[_0x0b50('0x25')](_0x4ccb1e['stack']);if(_0x4ccb1e['name']){delete _0x4ccb1e[_0x0b50('0x26')];}_0xa65099[_0x0b50('0x18')](_0x49adfd)[_0x0b50('0x27')](_0x4ccb1e);};}exports[_0x0b50('0x28')]=function(_0x4afbc3,_0x57d231){var _0x197d70={},_0x42b984={},_0x32b5ab={'count':0x0,'rows':[]};var _0x4b0de1=_[_0x0b50('0x29')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x2c0a9b){return{'name':_0x2c0a9b[_0x0b50('0x2a')],'type':_0x2c0a9b[_0x0b50('0x2b')][_0x0b50('0x2c')]};});_0x42b984[_0x0b50('0x2d')]=_[_0x0b50('0x29')](_0x4b0de1,'name');_0x42b984[_0x0b50('0x2e')]=_[_0x0b50('0x2f')](_0x4afbc3[_0x0b50('0x2e')]);_0x42b984['filters']=_[_0x0b50('0x30')](_0x42b984[_0x0b50('0x2d')],_0x42b984[_0x0b50('0x2e')]);_0x197d70[_0x0b50('0x31')]=_[_0x0b50('0x30')](_0x42b984[_0x0b50('0x2d')],qs['fields'](_0x4afbc3[_0x0b50('0x2e')]['fields']));_0x197d70[_0x0b50('0x31')]=_0x197d70[_0x0b50('0x31')][_0x0b50('0x32')]?_0x197d70[_0x0b50('0x31')]:_0x42b984[_0x0b50('0x2d')];if(!_0x4afbc3[_0x0b50('0x2e')][_0x0b50('0x33')](_0x0b50('0x34'))){_0x197d70[_0x0b50('0x1d')]=qs[_0x0b50('0x1d')](_0x4afbc3['query'][_0x0b50('0x1d')]);_0x197d70['offset']=qs[_0x0b50('0x1a')](_0x4afbc3['query'][_0x0b50('0x1a')]);}_0x197d70[_0x0b50('0x35')]=qs[_0x0b50('0x36')](_0x4afbc3[_0x0b50('0x2e')][_0x0b50('0x36')]);_0x197d70[_0x0b50('0x37')]=qs[_0x0b50('0x38')](_[_0x0b50('0x39')](_0x4afbc3[_0x0b50('0x2e')],_0x42b984[_0x0b50('0x38')]),_0x4b0de1);if(_0x4afbc3[_0x0b50('0x2e')][_0x0b50('0x3a')]){_0x197d70[_0x0b50('0x37')]=_[_0x0b50('0x3b')](_0x197d70['where'],{'$or':_[_0x0b50('0x29')](_0x4b0de1,function(_0x1a665f){if(_0x1a665f[_0x0b50('0x2b')]!==_0x0b50('0x3c')){var _0x39908b={};_0x39908b[_0x1a665f[_0x0b50('0x26')]]={'$like':'%'+_0x4afbc3[_0x0b50('0x2e')]['filter']+'%'};return _0x39908b;}})});}_0x197d70=_[_0x0b50('0x3b')]({},_0x197d70,_0x4afbc3['options']);var _0x54d37f={'where':_0x197d70[_0x0b50('0x37')]};return db[_0x0b50('0x3d')]['count'](_0x54d37f)[_0x0b50('0x22')](function(_0x1f6ddc){_0x32b5ab[_0x0b50('0x1c')]=_0x1f6ddc;if(_0x4afbc3[_0x0b50('0x2e')][_0x0b50('0x3e')]){_0x197d70['include']=[{'all':!![]}];}return db[_0x0b50('0x3d')]['findAll'](_0x197d70);})['then'](function(_0x36fa37){_0x32b5ab[_0x0b50('0x3f')]=_0x36fa37;return _0x32b5ab;})['then'](respondWithFilteredResult(_0x57d231,_0x197d70))['catch'](handleError(_0x57d231,null));};exports[_0x0b50('0x40')]=function(_0xf13ec5,_0x306e7d){var _0x589690={'raw':!![],'where':{'id':_0xf13ec5[_0x0b50('0x41')]['id']}},_0x4b923c={};_0x4b923c[_0x0b50('0x2d')]=_[_0x0b50('0x2f')](db['OpenchannelQueueReport']['rawAttributes']);_0x4b923c[_0x0b50('0x2e')]=_[_0x0b50('0x2f')](_0xf13ec5['query']);_0x4b923c['filters']=_[_0x0b50('0x30')](_0x4b923c['model'],_0x4b923c['query']);_0x589690[_0x0b50('0x31')]=_[_0x0b50('0x30')](_0x4b923c[_0x0b50('0x2d')],qs[_0x0b50('0x42')](_0xf13ec5['query']['fields']));_0x589690[_0x0b50('0x31')]=_0x589690['attributes'][_0x0b50('0x32')]?_0x589690[_0x0b50('0x31')]:_0x4b923c[_0x0b50('0x2d')];if(_0xf13ec5[_0x0b50('0x2e')][_0x0b50('0x3e')]){_0x589690['include']=[{'all':!![]}];}_0x589690=_[_0x0b50('0x3b')]({},_0x589690,_0xf13ec5[_0x0b50('0x43')]);return db[_0x0b50('0x3d')][_0x0b50('0x44')](_0x589690)[_0x0b50('0x22')](handleEntityNotFound(_0x306e7d,null))[_0x0b50('0x22')](respondWithResult(_0x306e7d,null))[_0x0b50('0x45')](handleError(_0x306e7d,null));};exports[_0x0b50('0x46')]=function(_0x52f83f,_0x34cceb){return db[_0x0b50('0x3d')][_0x0b50('0x46')](_0x52f83f[_0x0b50('0x47')],{})[_0x0b50('0x22')](respondWithResult(_0x34cceb,0xc9))[_0x0b50('0x45')](handleError(_0x34cceb,null));};exports[_0x0b50('0x48')]=function(_0x16090e,_0x522eb7){if(_0x16090e[_0x0b50('0x47')]['id']){delete _0x16090e[_0x0b50('0x47')]['id'];}return db[_0x0b50('0x3d')]['find']({'where':{'id':_0x16090e[_0x0b50('0x41')]['id']}})[_0x0b50('0x22')](handleEntityNotFound(_0x522eb7,null))['then'](saveUpdates(_0x16090e[_0x0b50('0x47')],null))[_0x0b50('0x22')](respondWithResult(_0x522eb7,null))[_0x0b50('0x45')](handleError(_0x522eb7,null));};exports['destroy']=function(_0x32bf06,_0x2be343){return db[_0x0b50('0x3d')][_0x0b50('0x44')]({'where':{'id':_0x32bf06['params']['id']}})['then'](handleEntityNotFound(_0x2be343,null))[_0x0b50('0x22')](removeEntity(_0x2be343,null))[_0x0b50('0x45')](handleError(_0x2be343,null));};exports[_0x0b50('0x49')]=function(_0x2971ff,_0x2e51b9){return db[_0x0b50('0x3d')]['describe']()[_0x0b50('0x22')](respondWithResult(_0x2e51b9,null))['catch'](handleError(_0x2e51b9,null));}; \ No newline at end of file +var _0x3feb=['rimraf','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','sort','where','filter','merge','VIRTUAL','options','then','findAll','rows','catch','show','includeAll','find','create','update','body','params','describe','eml-format'];(function(_0x390c73,_0x2f9c9d){var _0x41413d=function(_0x529908){while(--_0x529908){_0x390c73['push'](_0x390c73['shift']());}};_0x41413d(++_0x2f9c9d);}(_0x3feb,0x10f));var _0xb3fe=function(_0xc72c28,_0x2c9936){_0xc72c28=_0xc72c28-0x0;var _0x5ed0f6=_0x3feb[_0xc72c28];return _0x5ed0f6;};'use strict';var emlformat=require(_0xb3fe('0x0'));var rimraf=require(_0xb3fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb3fe('0x2'));var moment=require(_0xb3fe('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb3fe('0x4'));var util=require(_0xb3fe('0x5'));var path=require(_0xb3fe('0x6'));var sox=require(_0xb3fe('0x7'));var csv=require(_0xb3fe('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb3fe('0x9'));var _=require(_0xb3fe('0xa'));var squel=require('squel');var crypto=require(_0xb3fe('0xb'));var jsforce=require(_0xb3fe('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb3fe('0x8'));var querystring=require(_0xb3fe('0xd'));var Papa=require(_0xb3fe('0xe'));var Redis=require(_0xb3fe('0xf'));var authService=require(_0xb3fe('0x10'));var qs=require(_0xb3fe('0x11'));var as=require(_0xb3fe('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb3fe('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb3fe('0x14'))['db'];function respondWithStatusCode(_0x36987f,_0x34710e){_0x34710e=_0x34710e||0xcc;return function(_0x3ef81c){if(_0x3ef81c){return _0x36987f[_0xb3fe('0x15')](_0x34710e);}return _0x36987f[_0xb3fe('0x16')](_0x34710e)[_0xb3fe('0x17')]();};}function respondWithResult(_0x2b2ace,_0x197a26){_0x197a26=_0x197a26||0xc8;return function(_0x121019){if(_0x121019){return _0x2b2ace['status'](_0x197a26)[_0xb3fe('0x18')](_0x121019);}};}function respondWithFilteredResult(_0x19d4d5,_0x2c9760){return function(_0x7d629){if(_0x7d629){var _0x39f2b8=typeof _0x2c9760['offset']===_0xb3fe('0x19')&&typeof _0x2c9760[_0xb3fe('0x1a')]===_0xb3fe('0x19');var _0x5d9fdf=_0x7d629[_0xb3fe('0x1b')];var _0x409c75=_0x39f2b8?0x0:_0x2c9760[_0xb3fe('0x1c')];var _0x3d9ce8=_0x39f2b8?_0x7d629[_0xb3fe('0x1b')]:_0x2c9760['offset']+_0x2c9760[_0xb3fe('0x1a')];var _0x3e4a70;if(_0x3d9ce8>=_0x5d9fdf){_0x3d9ce8=_0x5d9fdf;_0x3e4a70=0xc8;}else{_0x3e4a70=0xce;}_0x19d4d5[_0xb3fe('0x16')](_0x3e4a70);return _0x19d4d5['set']('Content-Range',_0x409c75+'-'+_0x3d9ce8+'/'+_0x5d9fdf)[_0xb3fe('0x18')](_0x7d629);}return null;};}function patchUpdates(_0x2c10ac){return function(_0x3cf882){try{jsonpatch[_0xb3fe('0x1d')](_0x3cf882,_0x2c10ac,!![]);}catch(_0x27d8b9){return BPromise[_0xb3fe('0x1e')](_0x27d8b9);}return _0x3cf882[_0xb3fe('0x1f')]();};}function saveUpdates(_0x4f9977,_0x4c7fe9){return function(_0x368fb8){if(_0x368fb8){return _0x368fb8['update'](_0x4f9977)['then'](function(_0x5e9002){return _0x5e9002;});}return null;};}function removeEntity(_0x345626,_0x4a3608){return function(_0x25240f){if(_0x25240f){return _0x25240f['destroy']()['then'](function(){_0x345626['status'](0xcc)[_0xb3fe('0x17')]();});}};}function handleEntityNotFound(_0x1e88bb,_0x5b48b6){return function(_0x387907){if(!_0x387907){_0x1e88bb['sendStatus'](0x194);}return _0x387907;};}function handleError(_0xcc6799,_0x1ff71c){_0x1ff71c=_0x1ff71c||0x1f4;return function(_0x3b5bac){logger[_0xb3fe('0x20')](_0x3b5bac[_0xb3fe('0x21')]);if(_0x3b5bac[_0xb3fe('0x22')]){delete _0x3b5bac['name'];}_0xcc6799[_0xb3fe('0x16')](_0x1ff71c)[_0xb3fe('0x23')](_0x3b5bac);};}exports[_0xb3fe('0x24')]=function(_0x439e56,_0x32e0df){var _0x42a17c={},_0x2e2632={},_0xc60928={'count':0x0,'rows':[]};var _0x42e08c=_[_0xb3fe('0x25')](db[_0xb3fe('0x26')][_0xb3fe('0x27')],function(_0x417a18){return{'name':_0x417a18[_0xb3fe('0x28')],'type':_0x417a18['type'][_0xb3fe('0x29')]};});_0x2e2632[_0xb3fe('0x2a')]=_[_0xb3fe('0x25')](_0x42e08c,_0xb3fe('0x22'));_0x2e2632['query']=_[_0xb3fe('0x2b')](_0x439e56[_0xb3fe('0x2c')]);_0x2e2632[_0xb3fe('0x2d')]=_[_0xb3fe('0x2e')](_0x2e2632[_0xb3fe('0x2a')],_0x2e2632[_0xb3fe('0x2c')]);_0x42a17c['attributes']=_[_0xb3fe('0x2e')](_0x2e2632[_0xb3fe('0x2a')],qs[_0xb3fe('0x2f')](_0x439e56[_0xb3fe('0x2c')][_0xb3fe('0x2f')]));_0x42a17c[_0xb3fe('0x30')]=_0x42a17c[_0xb3fe('0x30')][_0xb3fe('0x31')]?_0x42a17c['attributes']:_0x2e2632[_0xb3fe('0x2a')];if(!_0x439e56[_0xb3fe('0x2c')]['hasOwnProperty']('nolimit')){_0x42a17c[_0xb3fe('0x1a')]=qs[_0xb3fe('0x1a')](_0x439e56[_0xb3fe('0x2c')]['limit']);_0x42a17c[_0xb3fe('0x1c')]=qs['offset'](_0x439e56[_0xb3fe('0x2c')]['offset']);}_0x42a17c['order']=qs[_0xb3fe('0x32')](_0x439e56[_0xb3fe('0x2c')][_0xb3fe('0x32')]);_0x42a17c[_0xb3fe('0x33')]=qs[_0xb3fe('0x2d')](_['pick'](_0x439e56[_0xb3fe('0x2c')],_0x2e2632[_0xb3fe('0x2d')]),_0x42e08c);if(_0x439e56[_0xb3fe('0x2c')][_0xb3fe('0x34')]){_0x42a17c['where']=_[_0xb3fe('0x35')](_0x42a17c[_0xb3fe('0x33')],{'$or':_[_0xb3fe('0x25')](_0x42e08c,function(_0x463410){if(_0x463410['type']!==_0xb3fe('0x36')){var _0x2f72ef={};_0x2f72ef[_0x463410[_0xb3fe('0x22')]]={'$like':'%'+_0x439e56[_0xb3fe('0x2c')][_0xb3fe('0x34')]+'%'};return _0x2f72ef;}})});}_0x42a17c=_[_0xb3fe('0x35')]({},_0x42a17c,_0x439e56[_0xb3fe('0x37')]);var _0x16e912={'where':_0x42a17c[_0xb3fe('0x33')]};return db[_0xb3fe('0x26')]['count'](_0x16e912)[_0xb3fe('0x38')](function(_0x58cd49){_0xc60928['count']=_0x58cd49;if(_0x439e56[_0xb3fe('0x2c')]['includeAll']){_0x42a17c['include']=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xb3fe('0x39')](_0x42a17c);})[_0xb3fe('0x38')](function(_0x5ec8ed){_0xc60928[_0xb3fe('0x3a')]=_0x5ec8ed;return _0xc60928;})[_0xb3fe('0x38')](respondWithFilteredResult(_0x32e0df,_0x42a17c))[_0xb3fe('0x3b')](handleError(_0x32e0df,null));};exports[_0xb3fe('0x3c')]=function(_0x4e4113,_0x4a5df3){var _0x365a19={'raw':!![],'where':{'id':_0x4e4113['params']['id']}},_0x200247={};_0x200247['model']=_[_0xb3fe('0x2b')](db[_0xb3fe('0x26')][_0xb3fe('0x27')]);_0x200247[_0xb3fe('0x2c')]=_[_0xb3fe('0x2b')](_0x4e4113[_0xb3fe('0x2c')]);_0x200247['filters']=_['intersection'](_0x200247[_0xb3fe('0x2a')],_0x200247[_0xb3fe('0x2c')]);_0x365a19['attributes']=_[_0xb3fe('0x2e')](_0x200247[_0xb3fe('0x2a')],qs[_0xb3fe('0x2f')](_0x4e4113[_0xb3fe('0x2c')]['fields']));_0x365a19[_0xb3fe('0x30')]=_0x365a19[_0xb3fe('0x30')]['length']?_0x365a19[_0xb3fe('0x30')]:_0x200247[_0xb3fe('0x2a')];if(_0x4e4113['query'][_0xb3fe('0x3d')]){_0x365a19['include']=[{'all':!![]}];}_0x365a19=_[_0xb3fe('0x35')]({},_0x365a19,_0x4e4113[_0xb3fe('0x37')]);return db[_0xb3fe('0x26')][_0xb3fe('0x3e')](_0x365a19)[_0xb3fe('0x38')](handleEntityNotFound(_0x4a5df3,null))[_0xb3fe('0x38')](respondWithResult(_0x4a5df3,null))[_0xb3fe('0x3b')](handleError(_0x4a5df3,null));};exports[_0xb3fe('0x3f')]=function(_0x4a42f9,_0x2c48b0){return db[_0xb3fe('0x26')]['create'](_0x4a42f9['body'],{})[_0xb3fe('0x38')](respondWithResult(_0x2c48b0,0xc9))[_0xb3fe('0x3b')](handleError(_0x2c48b0,null));};exports[_0xb3fe('0x40')]=function(_0x5c0654,_0x3f3875){if(_0x5c0654['body']['id']){delete _0x5c0654[_0xb3fe('0x41')]['id'];}return db[_0xb3fe('0x26')][_0xb3fe('0x3e')]({'where':{'id':_0x5c0654[_0xb3fe('0x42')]['id']}})['then'](handleEntityNotFound(_0x3f3875,null))['then'](saveUpdates(_0x5c0654['body'],null))[_0xb3fe('0x38')](respondWithResult(_0x3f3875,null))['catch'](handleError(_0x3f3875,null));};exports['destroy']=function(_0x2db04c,_0x3828ac){return db[_0xb3fe('0x26')][_0xb3fe('0x3e')]({'where':{'id':_0x2db04c[_0xb3fe('0x42')]['id']}})['then'](handleEntityNotFound(_0x3828ac,null))[_0xb3fe('0x38')](removeEntity(_0x3828ac,null))[_0xb3fe('0x3b')](handleError(_0x3828ac,null));};exports[_0xb3fe('0x43')]=function(_0x1f7e1a,_0x4576b0){return db[_0xb3fe('0x26')][_0xb3fe('0x43')]()[_0xb3fe('0x38')](respondWithResult(_0x4576b0,null))[_0xb3fe('0x3b')](handleError(_0x4576b0,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index f11f32f..3021883 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(_0x13d5cb,_0x1e9595){var _0x34844d=function(_0x3837cd){while(--_0x3837cd){_0x13d5cb['push'](_0x13d5cb['shift']());}};_0x34844d(++_0x1e9595);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'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 _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x2123ea,_0x909b6){var _0x2f8af5=function(_0x48be3e){while(--_0x48be3e){_0x2123ea['push'](_0x2123ea['shift']());}};_0x2f8af5(++_0x909b6);}(_0x7a54,0x106));var _0x47a5=function(_0x5a690e,_0x5a76f9){_0x5a690e=_0x5a690e-0x0;var _0x39ff2c=_0x7a54[_0x5a690e];return _0x39ff2c;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 8cca0df..a44b8c0 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 _0x9ffd=['raw','UpdateOpenchannelQueueReport','update','where','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelQueueReport,\x20%s,\x20%s','info','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x490089,_0x4688ad){_0x490089=_0x490089-0x0;var _0x5d5faf=_0x9ffd[_0x490089];return _0x5d5faf;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});}exports[_0xd9ff('0x17')]=function(_0x3afd19){var _0x5f45c4=this;return new Promise(function(_0x2d4df1,_0x3ccf15){return db[_0xd9ff('0x18')][_0xd9ff('0x19')](_0x3afd19[_0xd9ff('0x1a')],{'raw':_0x3afd19[_0xd9ff('0x1b')]?_0x3afd19[_0xd9ff('0x1b')][_0xd9ff('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4cf8ec){logger[_0xd9ff('0x15')](_0xd9ff('0x17'),_0x3afd19);logger['debug']('CreateOpenchannelQueueReport',_0x3afd19,JSON['stringify'](_0x4cf8ec));_0x2d4df1(_0x4cf8ec);})['catch'](function(_0x1f4d9e){logger['error'](_0xd9ff('0x17'),_0x1f4d9e[_0xd9ff('0x13')],_0x3afd19);_0x3ccf15(_0x5f45c4[_0xd9ff('0x11')](0x1f4,_0x1f4d9e[_0xd9ff('0x13')]));});});};exports[_0xd9ff('0x1d')]=function(_0x42a828){var _0x4b058a=this;return new Promise(function(_0x4fada1,_0x1136e9){return db['OpenchannelQueueReport'][_0xd9ff('0x1e')](_0x42a828['body'],{'raw':_0x42a828[_0xd9ff('0x1b')]?_0x42a828['options'][_0xd9ff('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42a828[_0xd9ff('0x1b')]?_0x42a828[_0xd9ff('0x1b')][_0xd9ff('0x1f')]||null:null,'attributes':_0x42a828['options']?_0x42a828[_0xd9ff('0x1b')][_0xd9ff('0x20')]||null:null,'limit':_0x42a828[_0xd9ff('0x1b')]?_0x42a828[_0xd9ff('0x1b')]['limit']||null:null})[_0xd9ff('0xc')](function(_0x3792d9){logger[_0xd9ff('0x15')](_0xd9ff('0x1d'),_0x42a828);logger[_0xd9ff('0xd')](_0xd9ff('0x1d'),_0x42a828,JSON[_0xd9ff('0x10')](_0x3792d9));_0x4fada1(_0x3792d9);})[_0xd9ff('0x16')](function(_0x3dc443){logger['error'](_0xd9ff('0x1d'),_0x3dc443['message'],_0x42a828);_0x1136e9(_0x4b058a[_0xd9ff('0x11')](0x1f4,_0x3dc443[_0xd9ff('0x13')]));});});}; \ No newline at end of file +var _0x958a=['http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x48b5e5,_0x317015){var _0x3af640=function(_0x2d5aa3){while(--_0x2d5aa3){_0x48b5e5['push'](_0x48b5e5['shift']());}};_0x3af640(++_0x317015);}(_0x958a,0x128));var _0xa958=function(_0x20797a,_0x3e8aea){_0x20797a=_0x20797a-0x0;var _0x542861=_0x958a[_0x20797a];return _0x542861;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddaa9,_0x3ca01f,_0x3b2693){return new BPromise(function(_0x1895da,_0x54c0e0){return client['request'](_0x3ddaa9,_0x3b2693)[_0xa958('0xb')](function(_0x249764){logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));logger[_0xa958('0xf')](_0xa958('0x10'),_0x3ca01f,_0xa958('0xe'),JSON[_0xa958('0x11')](_0x249764));if(_0x249764[_0xa958('0x12')]){if(_0x249764[_0xa958('0x12')][_0xa958('0x13')]===0x1f4){logger[_0xa958('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ca01f,_0x249764['error']['message']);return _0x54c0e0(_0x249764[_0xa958('0x12')][_0xa958('0x14')]);}logger[_0xa958('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ca01f,_0x249764[_0xa958('0x12')]['message']);return _0x1895da(_0x249764['error']['message']);}else{logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));_0x1895da(_0x249764[_0xa958('0x15')][_0xa958('0x14')]);}})[_0xa958('0x16')](function(_0x23736f){logger[_0xa958('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ca01f,_0x23736f);_0x54c0e0(_0x23736f);});});}exports[_0xa958('0x17')]=function(_0x4eadc9){var _0x3a053f=this;return new Promise(function(_0x70d13e,_0x52a184){return db[_0xa958('0x18')][_0xa958('0x19')](_0x4eadc9[_0xa958('0x1a')],{'raw':_0x4eadc9[_0xa958('0x1b')]?_0x4eadc9[_0xa958('0x1b')][_0xa958('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4a90c2){logger[_0xa958('0xc')](_0xa958('0x17'),_0x4eadc9);logger[_0xa958('0xf')]('CreateOpenchannelQueueReport',_0x4eadc9,JSON[_0xa958('0x11')](_0x4a90c2));_0x70d13e(_0x4a90c2);})[_0xa958('0x16')](function(_0x5c091a){logger[_0xa958('0x12')](_0xa958('0x17'),_0x5c091a['message'],_0x4eadc9);_0x52a184(_0x3a053f['error'](0x1f4,_0x5c091a[_0xa958('0x14')]));});});};exports[_0xa958('0x1d')]=function(_0x50b3c3){var _0x25f461=this;return new Promise(function(_0x27097a,_0x2f03df){return db[_0xa958('0x18')][_0xa958('0x1e')](_0x50b3c3[_0xa958('0x1a')],{'raw':_0x50b3c3['options']?_0x50b3c3[_0xa958('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50b3c3[_0xa958('0x1b')]?_0x50b3c3[_0xa958('0x1b')][_0xa958('0x1f')]||null:null,'attributes':_0x50b3c3[_0xa958('0x1b')]?_0x50b3c3[_0xa958('0x1b')][_0xa958('0x20')]||null:null,'limit':_0x50b3c3[_0xa958('0x1b')]?_0x50b3c3[_0xa958('0x1b')][_0xa958('0x21')]||null:null})[_0xa958('0xb')](function(_0x4c4c37){logger['info'](_0xa958('0x1d'),_0x50b3c3);logger['debug'](_0xa958('0x1d'),_0x50b3c3,JSON[_0xa958('0x11')](_0x4c4c37));_0x27097a(_0x4c4c37);})['catch'](function(_0x23bdbf){logger[_0xa958('0x12')](_0xa958('0x1d'),_0x23bdbf[_0xa958('0x14')],_0x50b3c3);_0x2f03df(_0x25f461[_0xa958('0x12')](0x1f4,_0x23bdbf['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 1adad3a..1d13f86 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 _0xe5a0=['delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update'];(function(_0x23925a,_0x168a91){var _0x26577e=function(_0x349029){while(--_0x349029){_0x23925a['push'](_0x23925a['shift']());}};_0x26577e(++_0x168a91);}(_0xe5a0,0x142));var _0x0e5a=function(_0x20ee13,_0x1beae1){_0x20ee13=_0x20ee13-0x0;var _0x2affab=_0xe5a0[_0x20ee13];return _0x2affab;};'use strict';var multer=require(_0x0e5a('0x0'));var util=require(_0x0e5a('0x1'));var path=require(_0x0e5a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0e5a('0x3')]();var fs_extra=require(_0x0e5a('0x4'));var auth=require(_0x0e5a('0x5'));var interaction=require(_0x0e5a('0x6'));var config=require(_0x0e5a('0x7'));var controller=require(_0x0e5a('0x8'));router[_0x0e5a('0x9')]('/',auth[_0x0e5a('0xa')](),controller['index']);router[_0x0e5a('0x9')](_0x0e5a('0xb'),auth[_0x0e5a('0xa')](),controller['describe']);router['get'](_0x0e5a('0xc'),auth[_0x0e5a('0xa')](),controller[_0x0e5a('0xd')]);router[_0x0e5a('0xe')]('/',auth[_0x0e5a('0xa')](),controller[_0x0e5a('0xf')]);router[_0x0e5a('0x10')]('/:id',auth[_0x0e5a('0xa')](),controller[_0x0e5a('0x11')]);router[_0x0e5a('0x12')]('/:id',auth[_0x0e5a('0xa')](),controller['destroy']);module[_0x0e5a('0x13')]=router; \ No newline at end of file +var _0x59ec=['update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','create','put'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x59ec,0xff));var _0xc59e=function(_0xf174a1,_0x37bad4){_0xf174a1=_0xf174a1-0x0;var _0x6f75eb=_0x59ec[_0xf174a1];return _0x6f75eb;};'use strict';var multer=require(_0xc59e('0x0'));var util=require('util');var path=require(_0xc59e('0x1'));var timeout=require(_0xc59e('0x2'));var express=require(_0xc59e('0x3'));var router=express[_0xc59e('0x4')]();var fs_extra=require(_0xc59e('0x5'));var auth=require(_0xc59e('0x6'));var interaction=require(_0xc59e('0x7'));var config=require(_0xc59e('0x8'));var controller=require(_0xc59e('0x9'));router[_0xc59e('0xa')]('/',auth['isAuthenticated'](),controller[_0xc59e('0xb')]);router[_0xc59e('0xa')]('/describe',auth[_0xc59e('0xc')](),controller[_0xc59e('0xd')]);router[_0xc59e('0xa')](_0xc59e('0xe'),auth[_0xc59e('0xc')](),controller[_0xc59e('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc59e('0x10')]);router[_0xc59e('0x11')](_0xc59e('0xe'),auth[_0xc59e('0xc')](),controller[_0xc59e('0x12')]);router[_0xc59e('0x13')](_0xc59e('0xe'),auth['isAuthenticated'](),controller[_0xc59e('0x14')]);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 ede28fe..5cb2f5c 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(_0xa91bb6,_0x436b4c){var _0x5e3e02=function(_0x422a71){while(--_0x422a71){_0xa91bb6['push'](_0xa91bb6['shift']());}};_0x5e3e02(++_0x436b4c);}(_0x54ef,0x112));var _0xf54e=function(_0x57b9c6,_0x4d6049){_0x57b9c6=_0x57b9c6-0x0;var _0x4623a0=_0x54ef[_0x57b9c6];return _0x4623a0;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x536ec5,_0x4b7e66){var _0x209b27=function(_0x2ae2fa){while(--_0x2ae2fa){_0x536ec5['push'](_0x536ec5['shift']());}};_0x209b27(++_0x4b7e66);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5459b0,_0x4d2ef8){_0x5459b0=_0x5459b0-0x0;var _0x675a35=_0xf3cd[_0x5459b0];return _0x675a35;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index a208aee..cb8565d 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 _0x727e=['key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','map','VIRTUAL','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type'];(function(_0x276acf,_0x2ba93f){var _0x3d3990=function(_0x493db9){while(--_0x493db9){_0x276acf['push'](_0x276acf['shift']());}};_0x3d3990(++_0x2ba93f);}(_0x727e,0x148));var _0xe727=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x727e[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require(_0xe727('0x0'));var rimraf=require(_0xe727('0x1'));var zipdir=require(_0xe727('0x2'));var jsonpatch=require(_0xe727('0x3'));var rp=require(_0xe727('0x4'));var moment=require('moment');var BPromise=require(_0xe727('0x5'));var Mustache=require(_0xe727('0x6'));var util=require(_0xe727('0x7'));var path=require(_0xe727('0x8'));var sox=require(_0xe727('0x9'));var csv=require(_0xe727('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe727('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe727('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe727('0xa'));var querystring=require('querystring');var Papa=require(_0xe727('0xd'));var Redis=require(_0xe727('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe727('0xf'));var as=require(_0xe727('0x10'));var hardwareService=require(_0xe727('0x11'));var logger=require(_0xe727('0x12'))(_0xe727('0x13'));var utils=require(_0xe727('0x14'));var config=require(_0xe727('0x15'));var licenseUtil=require(_0xe727('0x16'));var db=require(_0xe727('0x17'))['db'];function respondWithStatusCode(_0xd11750,_0x217735){_0x217735=_0x217735||0xcc;return function(_0x4ba2fb){if(_0x4ba2fb){return _0xd11750[_0xe727('0x18')](_0x217735);}return _0xd11750['status'](_0x217735)['end']();};}function respondWithResult(_0x3726ab,_0x44d9fd){_0x44d9fd=_0x44d9fd||0xc8;return function(_0x2dab78){if(_0x2dab78){return _0x3726ab[_0xe727('0x19')](_0x44d9fd)[_0xe727('0x1a')](_0x2dab78);}};}function respondWithFilteredResult(_0x51a484,_0x4f32cb){return function(_0x40a9d8){if(_0x40a9d8){var _0x4ced96=typeof _0x4f32cb[_0xe727('0x1b')]===_0xe727('0x1c')&&typeof _0x4f32cb['limit']===_0xe727('0x1c');var _0x54d5e9=_0x40a9d8[_0xe727('0x1d')];var _0x1364cf=_0x4ced96?0x0:_0x4f32cb[_0xe727('0x1b')];var _0xd61418=_0x4ced96?_0x40a9d8[_0xe727('0x1d')]:_0x4f32cb[_0xe727('0x1b')]+_0x4f32cb[_0xe727('0x1e')];var _0x3b8a5b;if(_0xd61418>=_0x54d5e9){_0xd61418=_0x54d5e9;_0x3b8a5b=0xc8;}else{_0x3b8a5b=0xce;}_0x51a484[_0xe727('0x19')](_0x3b8a5b);return _0x51a484['set'](_0xe727('0x1f'),_0x1364cf+'-'+_0xd61418+'/'+_0x54d5e9)['json'](_0x40a9d8);}return null;};}function patchUpdates(_0x382d67){return function(_0x2d8592){try{jsonpatch[_0xe727('0x20')](_0x2d8592,_0x382d67,!![]);}catch(_0x29dae9){return BPromise['reject'](_0x29dae9);}return _0x2d8592[_0xe727('0x21')]();};}function saveUpdates(_0x17d512,_0x17f3b0){return function(_0x1d09f4){if(_0x1d09f4){return _0x1d09f4[_0xe727('0x22')](_0x17d512)[_0xe727('0x23')](function(_0x43d97b){return _0x43d97b;});}return null;};}function removeEntity(_0x47f0b7,_0x3826c8){return function(_0x3fd6d6){if(_0x3fd6d6){return _0x3fd6d6[_0xe727('0x24')]()[_0xe727('0x23')](function(){_0x47f0b7['status'](0xcc)[_0xe727('0x25')]();});}};}function handleEntityNotFound(_0x1a74e0,_0x2534c5){return function(_0xdb3277){if(!_0xdb3277){_0x1a74e0[_0xe727('0x18')](0x194);}return _0xdb3277;};}function handleError(_0x1c68e8,_0x122ef5){_0x122ef5=_0x122ef5||0x1f4;return function(_0x49abd5){logger[_0xe727('0x26')](_0x49abd5[_0xe727('0x27')]);if(_0x49abd5[_0xe727('0x28')]){delete _0x49abd5[_0xe727('0x28')];}_0x1c68e8[_0xe727('0x19')](_0x122ef5)[_0xe727('0x29')](_0x49abd5);};}exports[_0xe727('0x2a')]=function(_0x69a16a,_0x389db6){var _0x1446b1={},_0x2cf930={},_0x41daf2={'count':0x0,'rows':[]};var _0x239b5d=_['map'](db[_0xe727('0x2b')][_0xe727('0x2c')],function(_0x56eb82){return{'name':_0x56eb82[_0xe727('0x2d')],'type':_0x56eb82[_0xe727('0x2e')][_0xe727('0x2f')]};});_0x2cf930[_0xe727('0x30')]=_['map'](_0x239b5d,_0xe727('0x28'));_0x2cf930[_0xe727('0x31')]=_[_0xe727('0x32')](_0x69a16a[_0xe727('0x31')]);_0x2cf930[_0xe727('0x33')]=_[_0xe727('0x34')](_0x2cf930[_0xe727('0x30')],_0x2cf930[_0xe727('0x31')]);_0x1446b1[_0xe727('0x35')]=_[_0xe727('0x34')](_0x2cf930[_0xe727('0x30')],qs['fields'](_0x69a16a[_0xe727('0x31')]['fields']));_0x1446b1[_0xe727('0x35')]=_0x1446b1[_0xe727('0x35')][_0xe727('0x36')]?_0x1446b1[_0xe727('0x35')]:_0x2cf930[_0xe727('0x30')];if(!_0x69a16a[_0xe727('0x31')][_0xe727('0x37')]('nolimit')){_0x1446b1['limit']=qs[_0xe727('0x1e')](_0x69a16a['query'][_0xe727('0x1e')]);_0x1446b1[_0xe727('0x1b')]=qs['offset'](_0x69a16a['query'][_0xe727('0x1b')]);}_0x1446b1[_0xe727('0x38')]=qs[_0xe727('0x39')](_0x69a16a['query'][_0xe727('0x39')]);_0x1446b1[_0xe727('0x3a')]=qs['filters'](_[_0xe727('0x3b')](_0x69a16a['query'],_0x2cf930[_0xe727('0x33')]),_0x239b5d);if(_0x69a16a[_0xe727('0x31')][_0xe727('0x3c')]){_0x1446b1[_0xe727('0x3a')]=_['merge'](_0x1446b1[_0xe727('0x3a')],{'$or':_[_0xe727('0x3d')](_0x239b5d,function(_0xec1c91){if(_0xec1c91['type']!==_0xe727('0x3e')){var _0x2b466a={};_0x2b466a[_0xec1c91['name']]={'$like':'%'+_0x69a16a['query']['filter']+'%'};return _0x2b466a;}})});}_0x1446b1=_['merge']({},_0x1446b1,_0x69a16a['options']);var _0x2a2518={'where':_0x1446b1[_0xe727('0x3a')]};return db[_0xe727('0x2b')][_0xe727('0x1d')](_0x2a2518)[_0xe727('0x23')](function(_0x15e094){_0x41daf2[_0xe727('0x1d')]=_0x15e094;if(_0x69a16a[_0xe727('0x31')][_0xe727('0x3f')]){_0x1446b1[_0xe727('0x40')]=[{'all':!![]}];}return db[_0xe727('0x2b')][_0xe727('0x41')](_0x1446b1);})[_0xe727('0x23')](function(_0x15b808){_0x41daf2['rows']=_0x15b808;return _0x41daf2;})[_0xe727('0x23')](respondWithFilteredResult(_0x389db6,_0x1446b1))[_0xe727('0x42')](handleError(_0x389db6,null));};exports[_0xe727('0x43')]=function(_0x1cc1e5,_0xe609f5){var _0x2614ca={'raw':!![],'where':{'id':_0x1cc1e5[_0xe727('0x44')]['id']}},_0xbd901={};_0xbd901[_0xe727('0x30')]=_['keys'](db['OpenchannelTransferReport']['rawAttributes']);_0xbd901[_0xe727('0x31')]=_[_0xe727('0x32')](_0x1cc1e5[_0xe727('0x31')]);_0xbd901[_0xe727('0x33')]=_[_0xe727('0x34')](_0xbd901[_0xe727('0x30')],_0xbd901[_0xe727('0x31')]);_0x2614ca[_0xe727('0x35')]=_[_0xe727('0x34')](_0xbd901['model'],qs[_0xe727('0x45')](_0x1cc1e5[_0xe727('0x31')][_0xe727('0x45')]));_0x2614ca[_0xe727('0x35')]=_0x2614ca[_0xe727('0x35')]['length']?_0x2614ca['attributes']:_0xbd901['model'];if(_0x1cc1e5[_0xe727('0x31')][_0xe727('0x3f')]){_0x2614ca[_0xe727('0x40')]=[{'all':!![]}];}_0x2614ca=_['merge']({},_0x2614ca,_0x1cc1e5[_0xe727('0x46')]);return db[_0xe727('0x2b')][_0xe727('0x47')](_0x2614ca)[_0xe727('0x23')](handleEntityNotFound(_0xe609f5,null))[_0xe727('0x23')](respondWithResult(_0xe609f5,null))[_0xe727('0x42')](handleError(_0xe609f5,null));};exports[_0xe727('0x48')]=function(_0x104f6f,_0x51de1c){return db[_0xe727('0x2b')][_0xe727('0x48')](_0x104f6f[_0xe727('0x49')],{})[_0xe727('0x23')](respondWithResult(_0x51de1c,0xc9))[_0xe727('0x42')](handleError(_0x51de1c,null));};exports[_0xe727('0x22')]=function(_0x49e4fa,_0x3a0b62){if(_0x49e4fa['body']['id']){delete _0x49e4fa[_0xe727('0x49')]['id'];}return db[_0xe727('0x2b')][_0xe727('0x47')]({'where':{'id':_0x49e4fa[_0xe727('0x44')]['id']}})[_0xe727('0x23')](handleEntityNotFound(_0x3a0b62,null))[_0xe727('0x23')](saveUpdates(_0x49e4fa[_0xe727('0x49')],null))[_0xe727('0x23')](respondWithResult(_0x3a0b62,null))[_0xe727('0x42')](handleError(_0x3a0b62,null));};exports[_0xe727('0x24')]=function(_0x1765cf,_0x429a17){return db[_0xe727('0x2b')][_0xe727('0x47')]({'where':{'id':_0x1765cf[_0xe727('0x44')]['id']}})['then'](handleEntityNotFound(_0x429a17,null))[_0xe727('0x23')](removeEntity(_0x429a17,null))[_0xe727('0x42')](handleError(_0x429a17,null));};exports['describe']=function(_0x295d8e,_0x5520fb){return db['OpenchannelTransferReport'][_0xe727('0x4a')]()[_0xe727('0x23')](respondWithResult(_0x5520fb,null))[_0xe727('0x42')](handleError(_0x5520fb,null));}; \ No newline at end of file +var _0xd63b=['map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','OpenchannelTransferReport','include','findAll','catch','params','includeAll','find','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name'];(function(_0x4f40a6,_0x3b8725){var _0xadae5=function(_0x42bef3){while(--_0x42bef3){_0x4f40a6['push'](_0x4f40a6['shift']());}};_0xadae5(++_0x3b8725);}(_0xd63b,0xf9));var _0xbd63=function(_0x45c856,_0x5e6a1e){_0x45c856=_0x45c856-0x0;var _0x4961aa=_0xd63b[_0x45c856];return _0x4961aa;};'use strict';var emlformat=require(_0xbd63('0x0'));var rimraf=require(_0xbd63('0x1'));var zipdir=require(_0xbd63('0x2'));var jsonpatch=require(_0xbd63('0x3'));var rp=require(_0xbd63('0x4'));var moment=require(_0xbd63('0x5'));var BPromise=require(_0xbd63('0x6'));var Mustache=require(_0xbd63('0x7'));var util=require(_0xbd63('0x8'));var path=require(_0xbd63('0x9'));var sox=require('sox');var csv=require(_0xbd63('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd63('0xb'));var _=require(_0xbd63('0xc'));var squel=require(_0xbd63('0xd'));var crypto=require(_0xbd63('0xe'));var jsforce=require(_0xbd63('0xf'));var deskjs=require(_0xbd63('0x10'));var toCsv=require(_0xbd63('0xa'));var querystring=require(_0xbd63('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbd63('0x12'));var qs=require(_0xbd63('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd63('0x14'));var logger=require(_0xbd63('0x15'))('api');var utils=require(_0xbd63('0x16'));var config=require(_0xbd63('0x17'));var licenseUtil=require(_0xbd63('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cb5af,_0x4f86d1){_0x4f86d1=_0x4f86d1||0xcc;return function(_0x9cccf1){if(_0x9cccf1){return _0x4cb5af['sendStatus'](_0x4f86d1);}return _0x4cb5af['status'](_0x4f86d1)[_0xbd63('0x19')]();};}function respondWithResult(_0xb66e83,_0x6620c2){_0x6620c2=_0x6620c2||0xc8;return function(_0x2691f1){if(_0x2691f1){return _0xb66e83[_0xbd63('0x1a')](_0x6620c2)['json'](_0x2691f1);}};}function respondWithFilteredResult(_0x28c4c5,_0x28ec27){return function(_0x1254cd){if(_0x1254cd){var _0x3cadc3=typeof _0x28ec27[_0xbd63('0x1b')]===_0xbd63('0x1c')&&typeof _0x28ec27['limit']===_0xbd63('0x1c');var _0x554ea0=_0x1254cd['count'];var _0x2267ca=_0x3cadc3?0x0:_0x28ec27[_0xbd63('0x1b')];var _0x382aa7=_0x3cadc3?_0x1254cd[_0xbd63('0x1d')]:_0x28ec27[_0xbd63('0x1b')]+_0x28ec27[_0xbd63('0x1e')];var _0x465526;if(_0x382aa7>=_0x554ea0){_0x382aa7=_0x554ea0;_0x465526=0xc8;}else{_0x465526=0xce;}_0x28c4c5['status'](_0x465526);return _0x28c4c5[_0xbd63('0x1f')](_0xbd63('0x20'),_0x2267ca+'-'+_0x382aa7+'/'+_0x554ea0)[_0xbd63('0x21')](_0x1254cd);}return null;};}function patchUpdates(_0x2ce414){return function(_0x23e1e9){try{jsonpatch[_0xbd63('0x22')](_0x23e1e9,_0x2ce414,!![]);}catch(_0x507a08){return BPromise[_0xbd63('0x23')](_0x507a08);}return _0x23e1e9[_0xbd63('0x24')]();};}function saveUpdates(_0xc8339a,_0x39de05){return function(_0xa16d4b){if(_0xa16d4b){return _0xa16d4b['update'](_0xc8339a)[_0xbd63('0x25')](function(_0x85e551){return _0x85e551;});}return null;};}function removeEntity(_0xd038a3,_0x2e61c8){return function(_0x3bd3b6){if(_0x3bd3b6){return _0x3bd3b6[_0xbd63('0x26')]()['then'](function(){_0xd038a3['status'](0xcc)[_0xbd63('0x19')]();});}};}function handleEntityNotFound(_0xa5f22a,_0x2da3a4){return function(_0x58628a){if(!_0x58628a){_0xa5f22a[_0xbd63('0x27')](0x194);}return _0x58628a;};}function handleError(_0x12744b,_0x36115b){_0x36115b=_0x36115b||0x1f4;return function(_0x12e471){logger[_0xbd63('0x28')](_0x12e471[_0xbd63('0x29')]);if(_0x12e471[_0xbd63('0x2a')]){delete _0x12e471[_0xbd63('0x2a')];}_0x12744b[_0xbd63('0x1a')](_0x36115b)['send'](_0x12e471);};}exports['index']=function(_0xba131f,_0x18ec54){var _0x3c5d4e={},_0x3bac39={},_0x5d749f={'count':0x0,'rows':[]};var _0x46e980=_[_0xbd63('0x2b')](db['OpenchannelTransferReport']['rawAttributes'],function(_0xf0c39c){return{'name':_0xf0c39c[_0xbd63('0x2c')],'type':_0xf0c39c[_0xbd63('0x2d')][_0xbd63('0x2e')]};});_0x3bac39[_0xbd63('0x2f')]=_['map'](_0x46e980,_0xbd63('0x2a'));_0x3bac39[_0xbd63('0x30')]=_[_0xbd63('0x31')](_0xba131f['query']);_0x3bac39[_0xbd63('0x32')]=_[_0xbd63('0x33')](_0x3bac39[_0xbd63('0x2f')],_0x3bac39['query']);_0x3c5d4e[_0xbd63('0x34')]=_[_0xbd63('0x33')](_0x3bac39[_0xbd63('0x2f')],qs['fields'](_0xba131f[_0xbd63('0x30')][_0xbd63('0x35')]));_0x3c5d4e[_0xbd63('0x34')]=_0x3c5d4e['attributes'][_0xbd63('0x36')]?_0x3c5d4e[_0xbd63('0x34')]:_0x3bac39[_0xbd63('0x2f')];if(!_0xba131f['query'][_0xbd63('0x37')](_0xbd63('0x38'))){_0x3c5d4e[_0xbd63('0x1e')]=qs[_0xbd63('0x1e')](_0xba131f['query']['limit']);_0x3c5d4e[_0xbd63('0x1b')]=qs[_0xbd63('0x1b')](_0xba131f[_0xbd63('0x30')][_0xbd63('0x1b')]);}_0x3c5d4e[_0xbd63('0x39')]=qs['sort'](_0xba131f['query'][_0xbd63('0x3a')]);_0x3c5d4e['where']=qs['filters'](_['pick'](_0xba131f[_0xbd63('0x30')],_0x3bac39[_0xbd63('0x32')]),_0x46e980);if(_0xba131f[_0xbd63('0x30')][_0xbd63('0x3b')]){_0x3c5d4e[_0xbd63('0x3c')]=_[_0xbd63('0x3d')](_0x3c5d4e[_0xbd63('0x3c')],{'$or':_[_0xbd63('0x2b')](_0x46e980,function(_0x335b66){if(_0x335b66['type']!==_0xbd63('0x3e')){var _0x4e5b23={};_0x4e5b23[_0x335b66[_0xbd63('0x2a')]]={'$like':'%'+_0xba131f[_0xbd63('0x30')][_0xbd63('0x3b')]+'%'};return _0x4e5b23;}})});}_0x3c5d4e=_[_0xbd63('0x3d')]({},_0x3c5d4e,_0xba131f[_0xbd63('0x3f')]);var _0x4a367f={'where':_0x3c5d4e[_0xbd63('0x3c')]};return db[_0xbd63('0x40')]['count'](_0x4a367f)[_0xbd63('0x25')](function(_0x4d3de0){_0x5d749f['count']=_0x4d3de0;if(_0xba131f[_0xbd63('0x30')]['includeAll']){_0x3c5d4e[_0xbd63('0x41')]=[{'all':!![]}];}return db[_0xbd63('0x40')][_0xbd63('0x42')](_0x3c5d4e);})[_0xbd63('0x25')](function(_0x5484ef){_0x5d749f['rows']=_0x5484ef;return _0x5d749f;})[_0xbd63('0x25')](respondWithFilteredResult(_0x18ec54,_0x3c5d4e))[_0xbd63('0x43')](handleError(_0x18ec54,null));};exports['show']=function(_0x34434c,_0x31d11b){var _0x501c2f={'raw':!![],'where':{'id':_0x34434c[_0xbd63('0x44')]['id']}},_0x557343={};_0x557343[_0xbd63('0x2f')]=_[_0xbd63('0x31')](db['OpenchannelTransferReport']['rawAttributes']);_0x557343[_0xbd63('0x30')]=_['keys'](_0x34434c[_0xbd63('0x30')]);_0x557343['filters']=_['intersection'](_0x557343['model'],_0x557343[_0xbd63('0x30')]);_0x501c2f['attributes']=_['intersection'](_0x557343[_0xbd63('0x2f')],qs[_0xbd63('0x35')](_0x34434c[_0xbd63('0x30')][_0xbd63('0x35')]));_0x501c2f[_0xbd63('0x34')]=_0x501c2f[_0xbd63('0x34')][_0xbd63('0x36')]?_0x501c2f[_0xbd63('0x34')]:_0x557343['model'];if(_0x34434c[_0xbd63('0x30')][_0xbd63('0x45')]){_0x501c2f[_0xbd63('0x41')]=[{'all':!![]}];}_0x501c2f=_['merge']({},_0x501c2f,_0x34434c[_0xbd63('0x3f')]);return db[_0xbd63('0x40')][_0xbd63('0x46')](_0x501c2f)['then'](handleEntityNotFound(_0x31d11b,null))['then'](respondWithResult(_0x31d11b,null))[_0xbd63('0x43')](handleError(_0x31d11b,null));};exports['create']=function(_0x31ac83,_0x23ae65){return db[_0xbd63('0x40')]['create'](_0x31ac83[_0xbd63('0x47')],{})[_0xbd63('0x25')](respondWithResult(_0x23ae65,0xc9))[_0xbd63('0x43')](handleError(_0x23ae65,null));};exports[_0xbd63('0x48')]=function(_0xcb5579,_0xe28aca){if(_0xcb5579['body']['id']){delete _0xcb5579[_0xbd63('0x47')]['id'];}return db['OpenchannelTransferReport'][_0xbd63('0x46')]({'where':{'id':_0xcb5579[_0xbd63('0x44')]['id']}})['then'](handleEntityNotFound(_0xe28aca,null))[_0xbd63('0x25')](saveUpdates(_0xcb5579[_0xbd63('0x47')],null))[_0xbd63('0x25')](respondWithResult(_0xe28aca,null))[_0xbd63('0x43')](handleError(_0xe28aca,null));};exports[_0xbd63('0x26')]=function(_0x4ff3f5,_0xa887da){return db[_0xbd63('0x40')][_0xbd63('0x46')]({'where':{'id':_0x4ff3f5[_0xbd63('0x44')]['id']}})[_0xbd63('0x25')](handleEntityNotFound(_0xa887da,null))[_0xbd63('0x25')](removeEntity(_0xa887da,null))[_0xbd63('0x43')](handleError(_0xa887da,null));};exports['describe']=function(_0x43b00b,_0x5aaee0){return db[_0xbd63('0x40')]['describe']()[_0xbd63('0x25')](respondWithResult(_0x5aaee0,null))[_0xbd63('0x43')](handleError(_0x5aaee0,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index b3a364a..cf64f50 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 _0x9204=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','OpenchannelTransferReport','report_openchannel_transfer','lodash','util'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9204,0x174));var _0x4920=function(_0xe05306,_0x4bbb92){_0xe05306=_0xe05306-0x0;var _0x269f84=_0x9204[_0xe05306];return _0x269f84;};'use strict';var _=require(_0x4920('0x0'));var util=require(_0x4920('0x1'));var logger=require(_0x4920('0x2'))('api');var moment=require(_0x4920('0x3'));var BPromise=require(_0x4920('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4920('0x5'));var rimraf=require(_0x4920('0x6'));var config=require(_0x4920('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0x4920('0x8')]=function(_0x203584,_0x11d47a){return _0x203584['define'](_0x4920('0x9'),attributes,{'tableName':_0x4920('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2311=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x19cfac,_0x3745dc){var _0x25d2a5=function(_0x2bad78){while(--_0x2bad78){_0x19cfac['push'](_0x19cfac['shift']());}};_0x25d2a5(++_0x3745dc);}(_0x2311,0x1dd));var _0x1231=function(_0x36bfce,_0x3e5d1e){_0x36bfce=_0x36bfce-0x0;var _0x3404bc=_0x2311[_0x36bfce];return _0x3404bc;};'use strict';var _=require(_0x1231('0x0'));var util=require(_0x1231('0x1'));var logger=require(_0x1231('0x2'))(_0x1231('0x3'));var moment=require(_0x1231('0x4'));var BPromise=require(_0x1231('0x5'));var rp=require(_0x1231('0x6'));var fs=require('fs');var path=require(_0x1231('0x7'));var rimraf=require(_0x1231('0x8'));var config=require(_0x1231('0x9'));var attributes=require(_0x1231('0xa'));module['exports']=function(_0x2f0981,_0x180753){return _0x2f0981['define'](_0x1231('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x1231('0xc'),'fields':[_0x1231('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index d724541..2d888bb 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 _0xae30=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info'];(function(_0x4660e3,_0x2b51c0){var _0x4cdbee=function(_0x263938){while(--_0x263938){_0x4660e3['push'](_0x4660e3['shift']());}};_0x4cdbee(++_0x2b51c0);}(_0xae30,0x10a));var _0x0ae3=function(_0x250669,_0xb15e88){_0x250669=_0x250669-0x0;var _0x131447=_0xae30[_0x250669];return _0x131447;};'use strict';var _=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var moment=require(_0x0ae3('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae3('0x3'));var fs=require('fs');var Redis=require(_0x0ae3('0x4'));var db=require(_0x0ae3('0x5'))['db'];var utils=require(_0x0ae3('0x6'));var logger=require('../../config/logger')(_0x0ae3('0x7'));var config=require(_0x0ae3('0x8'));var jayson=require(_0x0ae3('0x9'));var client=jayson[_0x0ae3('0xa')][_0x0ae3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xda3853,_0x2b81f4,_0x15b7e2){return new BPromise(function(_0x32ea6e,_0x34e783){return client[_0x0ae3('0xc')](_0xda3853,_0x15b7e2)[_0x0ae3('0xd')](function(_0x32ca2c){logger['info'](_0x0ae3('0xe'),_0x2b81f4,_0x0ae3('0xf'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2b81f4,_0x0ae3('0xf'),JSON[_0x0ae3('0x10')](_0x32ca2c));if(_0x32ca2c[_0x0ae3('0x11')]){if(_0x32ca2c[_0x0ae3('0x11')]['code']===0x1f4){logger['error'](_0x0ae3('0xe'),_0x2b81f4,_0x32ca2c[_0x0ae3('0x11')]['message']);return _0x34e783(_0x32ca2c['error'][_0x0ae3('0x12')]);}logger['error'](_0x0ae3('0xe'),_0x2b81f4,_0x32ca2c[_0x0ae3('0x11')][_0x0ae3('0x12')]);return _0x32ea6e(_0x32ca2c[_0x0ae3('0x11')][_0x0ae3('0x12')]);}else{logger[_0x0ae3('0x13')](_0x0ae3('0xe'),_0x2b81f4,'request\x20sent');_0x32ea6e(_0x32ca2c[_0x0ae3('0x14')]['message']);}})[_0x0ae3('0x15')](function(_0x254a0f){logger[_0x0ae3('0x11')](_0x0ae3('0xe'),_0x2b81f4,_0x254a0f);_0x34e783(_0x254a0f);});});} \ No newline at end of file +var _0x7fbe=['request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x12024d,_0x59d39f){var _0x1f247c=function(_0xfc6c07){while(--_0xfc6c07){_0x12024d['push'](_0x12024d['shift']());}};_0x1f247c(++_0x59d39f);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3ab0ac,_0x1ea9cf){_0x3ab0ac=_0x3ab0ac-0x0;var _0x1f743d=_0x7fbe[_0x3ab0ac];return _0x1f743d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index ad7faa8..3f8b912 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 _0xd35f=['post','create','put','update','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show'];(function(_0x224a7f,_0x4dfe0c){var _0x569b6a=function(_0x3d5dc7){while(--_0x3d5dc7){_0x224a7f['push'](_0x224a7f['shift']());}};_0x569b6a(++_0x4dfe0c);}(_0xd35f,0xd2));var _0xfd35=function(_0x350aeb,_0x3d265a){_0x350aeb=_0x350aeb-0x0;var _0x3c5273=_0xd35f[_0x350aeb];return _0x3c5273;};'use strict';var multer=require(_0xfd35('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfd35('0x1'));var express=require('express');var router=express[_0xfd35('0x2')]();var fs_extra=require(_0xfd35('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfd35('0x4'));var config=require(_0xfd35('0x5'));var controller=require(_0xfd35('0x6'));router[_0xfd35('0x7')]('/',auth[_0xfd35('0x8')](),controller['index']);router[_0xfd35('0x7')](_0xfd35('0x9'),auth[_0xfd35('0x8')](),controller[_0xfd35('0xa')]);router[_0xfd35('0xb')]('/',auth['isAuthenticated'](),controller[_0xfd35('0xc')]);router[_0xfd35('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xfd35('0xe')]);router[_0xfd35('0xf')](_0xfd35('0x9'),auth[_0xfd35('0x8')](),controller[_0xfd35('0x10')]);module['exports']=router; \ No newline at end of file +var _0x277b=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','update','destroy','exports','multer'];(function(_0x25deb6,_0xe4405d){var _0x39700b=function(_0xb077e2){while(--_0xb077e2){_0x25deb6['push'](_0x25deb6['shift']());}};_0x39700b(++_0xe4405d);}(_0x277b,0x10d));var _0xb277=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x277b[_0x1b2ff7];return _0x31656a;};'use strict';var multer=require(_0xb277('0x0'));var util=require(_0xb277('0x1'));var path=require(_0xb277('0x2'));var timeout=require(_0xb277('0x3'));var express=require(_0xb277('0x4'));var router=express[_0xb277('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb277('0x6'));var config=require(_0xb277('0x7'));var controller=require(_0xb277('0x8'));router[_0xb277('0x9')]('/',auth[_0xb277('0xa')](),controller[_0xb277('0xb')]);router[_0xb277('0x9')](_0xb277('0xc'),auth[_0xb277('0xa')](),controller[_0xb277('0xd')]);router[_0xb277('0xe')]('/',auth[_0xb277('0xa')](),controller['create']);router['put'](_0xb277('0xc'),auth[_0xb277('0xa')](),controller[_0xb277('0xf')]);router['delete'](_0xb277('0xc'),auth['isAuthenticated'](),controller[_0xb277('0x10')]);module[_0xb277('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 69cace2..2fe9e8c 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 _0x98ab=['exports','STRING','sequelize'];(function(_0x2e9794,_0x39323c){var _0x79d4a5=function(_0x35e2fc){while(--_0x35e2fc){_0x2e9794['push'](_0x2e9794['shift']());}};_0x79d4a5(++_0x39323c);}(_0x98ab,0xf8));var _0xb98a=function(_0x40890c,_0x3625f5){_0x40890c=_0x40890c-0x0;var _0x4be5fc=_0x98ab[_0x40890c];return _0x4be5fc;};'use strict';var Sequelize=require(_0xb98a('0x0'));module[_0xb98a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xb98a('0x2')]}}; \ No newline at end of file +var _0x7430=['exports','STRING','name','sequelize'];(function(_0x457d43,_0x4263a8){var _0x4f3dc4=function(_0x348a81){while(--_0x348a81){_0x457d43['push'](_0x457d43['shift']());}};_0x4f3dc4(++_0x4263a8);}(_0x7430,0x1eb));var _0x0743=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7430[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0743('0x0'));module[_0x0743('0x1')]={'name':{'type':Sequelize[_0x0743('0x2')],'unique':_0x0743('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0743('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index d9c0f9f..4c9cecc 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 _0x59a8=['count','offset','status','set','Content-Range','save','update','then','Pauses','destroy','error','stack','name','send','Pause','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','limit','undefined'];(function(_0xb2fa85,_0x5a0e61){var _0x36e2f3=function(_0xbca869){while(--_0xbca869){_0xb2fa85['push'](_0xb2fa85['shift']());}};_0x36e2f3(++_0x5a0e61);}(_0x59a8,0x1cf));var _0x859a=function(_0x2af0ab,_0xfefb5b){_0x2af0ab=_0x2af0ab-0x0;var _0xb921bd=_0x59a8[_0x2af0ab];return _0xb921bd;};'use strict';var emlformat=require(_0x859a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x859a('0x1'));var rp=require(_0x859a('0x2'));var moment=require(_0x859a('0x3'));var BPromise=require(_0x859a('0x4'));var Mustache=require(_0x859a('0x5'));var util=require('util');var path=require(_0x859a('0x6'));var sox=require(_0x859a('0x7'));var csv=require(_0x859a('0x8'));var ejs=require(_0x859a('0x9'));var fs=require('fs');var fs_extra=require(_0x859a('0xa'));var _=require('lodash');var squel=require(_0x859a('0xb'));var crypto=require(_0x859a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x859a('0xd'));var toCsv=require(_0x859a('0x8'));var querystring=require(_0x859a('0xe'));var Papa=require(_0x859a('0xf'));var Redis=require('ioredis');var authService=require(_0x859a('0x10'));var qs=require(_0x859a('0x11'));var as=require(_0x859a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x859a('0x13'))(_0x859a('0x14'));var utils=require(_0x859a('0x15'));var config=require(_0x859a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x859a('0x17'))['db'];function respondWithStatusCode(_0x91513a,_0x44bc95){_0x44bc95=_0x44bc95||0xcc;return function(_0x3a4a51){if(_0x3a4a51){return _0x91513a[_0x859a('0x18')](_0x44bc95);}return _0x91513a['status'](_0x44bc95)[_0x859a('0x19')]();};}function respondWithResult(_0x16d117,_0xee1777){_0xee1777=_0xee1777||0xc8;return function(_0xa018d9){if(_0xa018d9){return _0x16d117['status'](_0xee1777)[_0x859a('0x1a')](_0xa018d9);}};}function respondWithFilteredResult(_0x154aed,_0x11aec6){return function(_0x55c84b){if(_0x55c84b){var _0x18390=typeof _0x11aec6['offset']==='undefined'&&typeof _0x11aec6[_0x859a('0x1b')]===_0x859a('0x1c');var _0x4183e8=_0x55c84b[_0x859a('0x1d')];var _0x42098b=_0x18390?0x0:_0x11aec6[_0x859a('0x1e')];var _0x1ab921=_0x18390?_0x55c84b[_0x859a('0x1d')]:_0x11aec6['offset']+_0x11aec6['limit'];var _0xa05c2d;if(_0x1ab921>=_0x4183e8){_0x1ab921=_0x4183e8;_0xa05c2d=0xc8;}else{_0xa05c2d=0xce;}_0x154aed[_0x859a('0x1f')](_0xa05c2d);return _0x154aed[_0x859a('0x20')](_0x859a('0x21'),_0x42098b+'-'+_0x1ab921+'/'+_0x4183e8)[_0x859a('0x1a')](_0x55c84b);}return null;};}function patchUpdates(_0x36dcb9){return function(_0xa8e767){try{jsonpatch['apply'](_0xa8e767,_0x36dcb9,!![]);}catch(_0x2dc320){return BPromise['reject'](_0x2dc320);}return _0xa8e767[_0x859a('0x22')]();};}function saveUpdates(_0x331261,_0x3e7b51){return function(_0x32918a){if(_0x32918a){return _0x32918a[_0x859a('0x23')](_0x331261)['then'](function(_0x5ce6d5){return _0x5ce6d5;});}return null;};}function removeEntity(_0x3bad3b,_0x5d7d2c){return function(_0x575723){if(_0x575723){return _0x575723['destroy']()[_0x859a('0x24')](function(){var _0x127621=_0x575723['get']({'plain':!![]});var _0x22e2ea=_0x859a('0x25');return db['UserProfileResource'][_0x859a('0x26')]({'where':{'type':_0x22e2ea,'resourceId':_0x127621['id']}})[_0x859a('0x24')](function(){return _0x575723;});})[_0x859a('0x24')](function(){_0x3bad3b[_0x859a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50f186,_0x1a8f30){return function(_0x4e0245){if(!_0x4e0245){_0x50f186['sendStatus'](0x194);}return _0x4e0245;};}function handleError(_0x2445e4,_0x50e2b1){_0x50e2b1=_0x50e2b1||0x1f4;return function(_0x540be3){logger[_0x859a('0x27')](_0x540be3[_0x859a('0x28')]);if(_0x540be3[_0x859a('0x29')]){delete _0x540be3['name'];}_0x2445e4[_0x859a('0x1f')](_0x50e2b1)[_0x859a('0x2a')](_0x540be3);};}exports['index']=function(_0x3e3980,_0x545bc7){var _0x2ea114={},_0x4a2476={},_0x544140={'count':0x0,'rows':[]};var _0x204d89=_['map'](db[_0x859a('0x2b')][_0x859a('0x2c')],function(_0x122067){return{'name':_0x122067[_0x859a('0x2d')],'type':_0x122067[_0x859a('0x2e')][_0x859a('0x2f')]};});_0x4a2476[_0x859a('0x30')]=_[_0x859a('0x31')](_0x204d89,_0x859a('0x29'));_0x4a2476['query']=_[_0x859a('0x32')](_0x3e3980[_0x859a('0x33')]);_0x4a2476['filters']=_[_0x859a('0x34')](_0x4a2476[_0x859a('0x30')],_0x4a2476[_0x859a('0x33')]);_0x2ea114[_0x859a('0x35')]=_['intersection'](_0x4a2476[_0x859a('0x30')],qs['fields'](_0x3e3980[_0x859a('0x33')][_0x859a('0x36')]));_0x2ea114[_0x859a('0x35')]=_0x2ea114['attributes'][_0x859a('0x37')]?_0x2ea114[_0x859a('0x35')]:_0x4a2476[_0x859a('0x30')];if(!_0x3e3980['query']['hasOwnProperty'](_0x859a('0x38'))){_0x2ea114[_0x859a('0x1b')]=qs[_0x859a('0x1b')](_0x3e3980[_0x859a('0x33')]['limit']);_0x2ea114[_0x859a('0x1e')]=qs['offset'](_0x3e3980['query'][_0x859a('0x1e')]);}_0x2ea114[_0x859a('0x39')]=qs[_0x859a('0x3a')](_0x3e3980['query'][_0x859a('0x3a')]);_0x2ea114[_0x859a('0x3b')]=qs[_0x859a('0x3c')](_['pick'](_0x3e3980[_0x859a('0x33')],_0x4a2476[_0x859a('0x3c')]),_0x204d89);if(_0x3e3980[_0x859a('0x33')][_0x859a('0x3d')]){_0x2ea114[_0x859a('0x3b')]=_[_0x859a('0x3e')](_0x2ea114[_0x859a('0x3b')],{'$or':_[_0x859a('0x31')](_0x204d89,function(_0x12f7ac){if(_0x12f7ac[_0x859a('0x2e')]!=='VIRTUAL'){var _0x4e8192={};_0x4e8192[_0x12f7ac['name']]={'$like':'%'+_0x3e3980[_0x859a('0x33')][_0x859a('0x3d')]+'%'};return _0x4e8192;}})});}_0x2ea114=_[_0x859a('0x3e')]({},_0x2ea114,_0x3e3980[_0x859a('0x3f')]);var _0x41aaf0={'where':_0x2ea114[_0x859a('0x3b')]};return db[_0x859a('0x2b')][_0x859a('0x1d')](_0x41aaf0)[_0x859a('0x24')](function(_0x35a01e){_0x544140['count']=_0x35a01e;if(_0x3e3980[_0x859a('0x33')][_0x859a('0x40')]){_0x2ea114[_0x859a('0x41')]=[{'all':!![]}];}return db['Pause'][_0x859a('0x42')](_0x2ea114);})[_0x859a('0x24')](function(_0x1c0760){_0x544140[_0x859a('0x43')]=_0x1c0760;return _0x544140;})[_0x859a('0x24')](respondWithFilteredResult(_0x545bc7,_0x2ea114))[_0x859a('0x44')](handleError(_0x545bc7,null));};exports[_0x859a('0x45')]=function(_0x544622,_0x1575ee){var _0x104b4c={'raw':!![],'where':{'id':_0x544622[_0x859a('0x46')]['id']}},_0x19f31b={};_0x19f31b['model']=_[_0x859a('0x32')](db[_0x859a('0x2b')]['rawAttributes']);_0x19f31b['query']=_[_0x859a('0x32')](_0x544622['query']);_0x19f31b[_0x859a('0x3c')]=_[_0x859a('0x34')](_0x19f31b[_0x859a('0x30')],_0x19f31b[_0x859a('0x33')]);_0x104b4c[_0x859a('0x35')]=_[_0x859a('0x34')](_0x19f31b[_0x859a('0x30')],qs[_0x859a('0x36')](_0x544622[_0x859a('0x33')][_0x859a('0x36')]));_0x104b4c[_0x859a('0x35')]=_0x104b4c[_0x859a('0x35')][_0x859a('0x37')]?_0x104b4c[_0x859a('0x35')]:_0x19f31b[_0x859a('0x30')];if(_0x544622['query'][_0x859a('0x40')]){_0x104b4c[_0x859a('0x41')]=[{'all':!![]}];}_0x104b4c=_['merge']({},_0x104b4c,_0x544622[_0x859a('0x3f')]);return db['Pause'][_0x859a('0x47')](_0x104b4c)[_0x859a('0x24')](handleEntityNotFound(_0x1575ee,null))['then'](respondWithResult(_0x1575ee,null))[_0x859a('0x44')](handleError(_0x1575ee,null));};exports['create']=function(_0x21a06c,_0x42fce){return db[_0x859a('0x2b')][_0x859a('0x48')](_0x21a06c[_0x859a('0x49')],{})[_0x859a('0x24')](function(_0x2ceaab){var _0x2a43b8=_0x21a06c[_0x859a('0x4a')][_0x859a('0x4b')]({'plain':!![]});if(!_0x2a43b8)throw new Error(_0x859a('0x4c'));if(_0x2a43b8[_0x859a('0x4d')]===_0x859a('0x4a')){var _0x192539=_0x2ceaab['get']({'plain':!![]});var _0x561ae4=_0x859a('0x25');return db[_0x859a('0x4e')][_0x859a('0x47')]({'where':{'name':_0x561ae4,'userProfileId':_0x2a43b8['userProfileId']},'raw':!![]})[_0x859a('0x24')](function(_0x2b37bd){if(_0x2b37bd&&_0x2b37bd[_0x859a('0x4f')]===0x0){return db[_0x859a('0x50')][_0x859a('0x48')]({'name':_0x192539[_0x859a('0x29')],'resourceId':_0x192539['id'],'type':_0x2b37bd[_0x859a('0x29')],'sectionId':_0x2b37bd['id']},{})['then'](function(){return _0x2ceaab;});}else{return _0x2ceaab;}})[_0x859a('0x44')](function(_0x3e9bb7){logger[_0x859a('0x27')](_0x859a('0x51'),_0x3e9bb7);throw _0x3e9bb7;});}return _0x2ceaab;})['then'](respondWithResult(_0x42fce,0xc9))[_0x859a('0x44')](handleError(_0x42fce,null));};exports['update']=function(_0x21330b,_0x44ba73){if(_0x21330b[_0x859a('0x49')]['id']){delete _0x21330b['body']['id'];}return db['Pause'][_0x859a('0x47')]({'where':{'id':_0x21330b[_0x859a('0x46')]['id']}})[_0x859a('0x24')](handleEntityNotFound(_0x44ba73,null))[_0x859a('0x24')](saveUpdates(_0x21330b[_0x859a('0x49')],null))[_0x859a('0x24')](respondWithResult(_0x44ba73,null))[_0x859a('0x44')](handleError(_0x44ba73,null));};exports['destroy']=function(_0x15767b,_0xdda1db){return db[_0x859a('0x2b')]['find']({'where':{'id':_0x15767b[_0x859a('0x46')]['id']}})[_0x859a('0x24')](handleEntityNotFound(_0xdda1db,null))[_0x859a('0x24')](removeEntity(_0xdda1db,null))[_0x859a('0x44')](handleError(_0xdda1db,null));}; \ No newline at end of file +var _0xf1b3=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','apply','reject','save','then','get','Pauses','UserProfileResource','destroy','end','sendStatus','error','name','send','index','map','Pause','type','key','model','keys','query','filters','intersection','fields','attributes'];(function(_0xb83ec2,_0x18e73b){var _0x4d2fbf=function(_0x16538a){while(--_0x16538a){_0xb83ec2['push'](_0xb83ec2['shift']());}};_0x4d2fbf(++_0x18e73b);}(_0xf1b3,0xc8));var _0x3f1b=function(_0x3e29fa,_0x511f0f){_0x3e29fa=_0x3e29fa-0x0;var _0x584c28=_0xf1b3[_0x3e29fa];return _0x584c28;};'use strict';var emlformat=require(_0x3f1b('0x0'));var rimraf=require(_0x3f1b('0x1'));var zipdir=require(_0x3f1b('0x2'));var jsonpatch=require(_0x3f1b('0x3'));var rp=require(_0x3f1b('0x4'));var moment=require(_0x3f1b('0x5'));var BPromise=require(_0x3f1b('0x6'));var Mustache=require(_0x3f1b('0x7'));var util=require(_0x3f1b('0x8'));var path=require(_0x3f1b('0x9'));var sox=require(_0x3f1b('0xa'));var csv=require(_0x3f1b('0xb'));var ejs=require(_0x3f1b('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3f1b('0xd'));var crypto=require(_0x3f1b('0xe'));var jsforce=require(_0x3f1b('0xf'));var deskjs=require(_0x3f1b('0x10'));var toCsv=require(_0x3f1b('0xb'));var querystring=require(_0x3f1b('0x11'));var Papa=require('papaparse');var Redis=require(_0x3f1b('0x12'));var authService=require(_0x3f1b('0x13'));var qs=require(_0x3f1b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f1b('0x15'));var logger=require(_0x3f1b('0x16'))(_0x3f1b('0x17'));var utils=require(_0x3f1b('0x18'));var config=require(_0x3f1b('0x19'));var licenseUtil=require(_0x3f1b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb48b7f,_0x1be65f){_0x1be65f=_0x1be65f||0xcc;return function(_0x20b1a1){if(_0x20b1a1){return _0xb48b7f['sendStatus'](_0x1be65f);}return _0xb48b7f[_0x3f1b('0x1b')](_0x1be65f)['end']();};}function respondWithResult(_0x231c9c,_0x18d8a9){_0x18d8a9=_0x18d8a9||0xc8;return function(_0x4920a0){if(_0x4920a0){return _0x231c9c[_0x3f1b('0x1b')](_0x18d8a9)[_0x3f1b('0x1c')](_0x4920a0);}};}function respondWithFilteredResult(_0x41711f,_0x66df37){return function(_0x11a889){if(_0x11a889){var _0xe95a01=typeof _0x66df37[_0x3f1b('0x1d')]===_0x3f1b('0x1e')&&typeof _0x66df37[_0x3f1b('0x1f')]==='undefined';var _0x14b2b1=_0x11a889[_0x3f1b('0x20')];var _0x5b782f=_0xe95a01?0x0:_0x66df37[_0x3f1b('0x1d')];var _0xc87531=_0xe95a01?_0x11a889[_0x3f1b('0x20')]:_0x66df37[_0x3f1b('0x1d')]+_0x66df37[_0x3f1b('0x1f')];var _0x13db86;if(_0xc87531>=_0x14b2b1){_0xc87531=_0x14b2b1;_0x13db86=0xc8;}else{_0x13db86=0xce;}_0x41711f[_0x3f1b('0x1b')](_0x13db86);return _0x41711f['set']('Content-Range',_0x5b782f+'-'+_0xc87531+'/'+_0x14b2b1)[_0x3f1b('0x1c')](_0x11a889);}return null;};}function patchUpdates(_0x470b41){return function(_0x49da02){try{jsonpatch[_0x3f1b('0x21')](_0x49da02,_0x470b41,!![]);}catch(_0x3af3f0){return BPromise[_0x3f1b('0x22')](_0x3af3f0);}return _0x49da02[_0x3f1b('0x23')]();};}function saveUpdates(_0x3c984c,_0x7c7131){return function(_0x1f11ec){if(_0x1f11ec){return _0x1f11ec['update'](_0x3c984c)[_0x3f1b('0x24')](function(_0xf8210d){return _0xf8210d;});}return null;};}function removeEntity(_0x28ba3d,_0xb57d76){return function(_0x2a81ff){if(_0x2a81ff){return _0x2a81ff['destroy']()[_0x3f1b('0x24')](function(){var _0x3e79de=_0x2a81ff[_0x3f1b('0x25')]({'plain':!![]});var _0x376169=_0x3f1b('0x26');return db[_0x3f1b('0x27')][_0x3f1b('0x28')]({'where':{'type':_0x376169,'resourceId':_0x3e79de['id']}})[_0x3f1b('0x24')](function(){return _0x2a81ff;});})[_0x3f1b('0x24')](function(){_0x28ba3d[_0x3f1b('0x1b')](0xcc)[_0x3f1b('0x29')]();});}};}function handleEntityNotFound(_0x563c2a,_0x8a07c0){return function(_0x2765cb){if(!_0x2765cb){_0x563c2a[_0x3f1b('0x2a')](0x194);}return _0x2765cb;};}function handleError(_0x7b9bdc,_0x56d550){_0x56d550=_0x56d550||0x1f4;return function(_0x312927){logger[_0x3f1b('0x2b')](_0x312927['stack']);if(_0x312927[_0x3f1b('0x2c')]){delete _0x312927[_0x3f1b('0x2c')];}_0x7b9bdc[_0x3f1b('0x1b')](_0x56d550)[_0x3f1b('0x2d')](_0x312927);};}exports[_0x3f1b('0x2e')]=function(_0x47a811,_0xe3f7c6){var _0x393f88={},_0x14ddb4={},_0x1fed1e={'count':0x0,'rows':[]};var _0x55a2c2=_[_0x3f1b('0x2f')](db[_0x3f1b('0x30')]['rawAttributes'],function(_0x47c3d5){return{'name':_0x47c3d5['fieldName'],'type':_0x47c3d5[_0x3f1b('0x31')][_0x3f1b('0x32')]};});_0x14ddb4[_0x3f1b('0x33')]=_[_0x3f1b('0x2f')](_0x55a2c2,_0x3f1b('0x2c'));_0x14ddb4['query']=_[_0x3f1b('0x34')](_0x47a811[_0x3f1b('0x35')]);_0x14ddb4[_0x3f1b('0x36')]=_['intersection'](_0x14ddb4[_0x3f1b('0x33')],_0x14ddb4[_0x3f1b('0x35')]);_0x393f88['attributes']=_[_0x3f1b('0x37')](_0x14ddb4[_0x3f1b('0x33')],qs[_0x3f1b('0x38')](_0x47a811[_0x3f1b('0x35')][_0x3f1b('0x38')]));_0x393f88[_0x3f1b('0x39')]=_0x393f88[_0x3f1b('0x39')][_0x3f1b('0x3a')]?_0x393f88[_0x3f1b('0x39')]:_0x14ddb4[_0x3f1b('0x33')];if(!_0x47a811[_0x3f1b('0x35')][_0x3f1b('0x3b')](_0x3f1b('0x3c'))){_0x393f88[_0x3f1b('0x1f')]=qs[_0x3f1b('0x1f')](_0x47a811[_0x3f1b('0x35')][_0x3f1b('0x1f')]);_0x393f88[_0x3f1b('0x1d')]=qs[_0x3f1b('0x1d')](_0x47a811[_0x3f1b('0x35')][_0x3f1b('0x1d')]);}_0x393f88[_0x3f1b('0x3d')]=qs[_0x3f1b('0x3e')](_0x47a811[_0x3f1b('0x35')]['sort']);_0x393f88[_0x3f1b('0x3f')]=qs[_0x3f1b('0x36')](_[_0x3f1b('0x40')](_0x47a811[_0x3f1b('0x35')],_0x14ddb4[_0x3f1b('0x36')]),_0x55a2c2);if(_0x47a811[_0x3f1b('0x35')][_0x3f1b('0x41')]){_0x393f88[_0x3f1b('0x3f')]=_[_0x3f1b('0x42')](_0x393f88[_0x3f1b('0x3f')],{'$or':_[_0x3f1b('0x2f')](_0x55a2c2,function(_0x1cc42b){if(_0x1cc42b[_0x3f1b('0x31')]!==_0x3f1b('0x43')){var _0x2745e={};_0x2745e[_0x1cc42b[_0x3f1b('0x2c')]]={'$like':'%'+_0x47a811[_0x3f1b('0x35')][_0x3f1b('0x41')]+'%'};return _0x2745e;}})});}_0x393f88=_[_0x3f1b('0x42')]({},_0x393f88,_0x47a811[_0x3f1b('0x44')]);var _0x270e05={'where':_0x393f88[_0x3f1b('0x3f')]};return db[_0x3f1b('0x30')][_0x3f1b('0x20')](_0x270e05)[_0x3f1b('0x24')](function(_0x25ed1f){_0x1fed1e[_0x3f1b('0x20')]=_0x25ed1f;if(_0x47a811[_0x3f1b('0x35')][_0x3f1b('0x45')]){_0x393f88['include']=[{'all':!![]}];}return db[_0x3f1b('0x30')]['findAll'](_0x393f88);})['then'](function(_0x4ccd87){_0x1fed1e[_0x3f1b('0x46')]=_0x4ccd87;return _0x1fed1e;})['then'](respondWithFilteredResult(_0xe3f7c6,_0x393f88))['catch'](handleError(_0xe3f7c6,null));};exports[_0x3f1b('0x47')]=function(_0x21a60b,_0x537b70){var _0x280b31={'raw':!![],'where':{'id':_0x21a60b[_0x3f1b('0x48')]['id']}},_0x473511={};_0x473511[_0x3f1b('0x33')]=_[_0x3f1b('0x34')](db['Pause'][_0x3f1b('0x49')]);_0x473511[_0x3f1b('0x35')]=_[_0x3f1b('0x34')](_0x21a60b[_0x3f1b('0x35')]);_0x473511[_0x3f1b('0x36')]=_[_0x3f1b('0x37')](_0x473511[_0x3f1b('0x33')],_0x473511[_0x3f1b('0x35')]);_0x280b31[_0x3f1b('0x39')]=_[_0x3f1b('0x37')](_0x473511[_0x3f1b('0x33')],qs[_0x3f1b('0x38')](_0x21a60b['query'][_0x3f1b('0x38')]));_0x280b31[_0x3f1b('0x39')]=_0x280b31[_0x3f1b('0x39')]['length']?_0x280b31[_0x3f1b('0x39')]:_0x473511[_0x3f1b('0x33')];if(_0x21a60b[_0x3f1b('0x35')][_0x3f1b('0x45')]){_0x280b31['include']=[{'all':!![]}];}_0x280b31=_[_0x3f1b('0x42')]({},_0x280b31,_0x21a60b[_0x3f1b('0x44')]);return db[_0x3f1b('0x30')][_0x3f1b('0x4a')](_0x280b31)['then'](handleEntityNotFound(_0x537b70,null))['then'](respondWithResult(_0x537b70,null))['catch'](handleError(_0x537b70,null));};exports[_0x3f1b('0x4b')]=function(_0x179281,_0x883f65){return db['Pause'][_0x3f1b('0x4b')](_0x179281[_0x3f1b('0x4c')],{})['then'](function(_0x61172){var _0x2de037=_0x179281[_0x3f1b('0x4d')][_0x3f1b('0x25')]({'plain':!![]});if(!_0x2de037)throw new Error(_0x3f1b('0x4e'));if(_0x2de037[_0x3f1b('0x4f')]===_0x3f1b('0x4d')){var _0x549760=_0x61172[_0x3f1b('0x25')]({'plain':!![]});var _0x3c1215=_0x3f1b('0x26');return db[_0x3f1b('0x50')][_0x3f1b('0x4a')]({'where':{'name':_0x3c1215,'userProfileId':_0x2de037[_0x3f1b('0x51')]},'raw':!![]})[_0x3f1b('0x24')](function(_0x15e279){if(_0x15e279&&_0x15e279[_0x3f1b('0x52')]===0x0){return db[_0x3f1b('0x27')][_0x3f1b('0x4b')]({'name':_0x549760[_0x3f1b('0x2c')],'resourceId':_0x549760['id'],'type':_0x15e279['name'],'sectionId':_0x15e279['id']},{})[_0x3f1b('0x24')](function(){return _0x61172;});}else{return _0x61172;}})[_0x3f1b('0x53')](function(_0xfa1e77){logger[_0x3f1b('0x2b')](_0x3f1b('0x54'),_0xfa1e77);throw _0xfa1e77;});}return _0x61172;})[_0x3f1b('0x24')](respondWithResult(_0x883f65,0xc9))['catch'](handleError(_0x883f65,null));};exports[_0x3f1b('0x55')]=function(_0x19d490,_0x23952a){if(_0x19d490[_0x3f1b('0x4c')]['id']){delete _0x19d490[_0x3f1b('0x4c')]['id'];}return db[_0x3f1b('0x30')]['find']({'where':{'id':_0x19d490[_0x3f1b('0x48')]['id']}})[_0x3f1b('0x24')](handleEntityNotFound(_0x23952a,null))[_0x3f1b('0x24')](saveUpdates(_0x19d490[_0x3f1b('0x4c')],null))[_0x3f1b('0x24')](respondWithResult(_0x23952a,null))[_0x3f1b('0x53')](handleError(_0x23952a,null));};exports[_0x3f1b('0x28')]=function(_0x190abf,_0x36724a){return db[_0x3f1b('0x30')]['find']({'where':{'id':_0x190abf[_0x3f1b('0x48')]['id']}})[_0x3f1b('0x24')](handleEntityNotFound(_0x36724a,null))[_0x3f1b('0x24')](removeEntity(_0x36724a,null))[_0x3f1b('0x53')](handleError(_0x36724a,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 4ca8ae0..9b1c372 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 _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x1e896c,_0x3f9948){var _0xd149d9=function(_0x3281e5){while(--_0x3281e5){_0x1e896c['push'](_0x1e896c['shift']());}};_0xd149d9(++_0x3f9948);}(_0x8ef6,0xf2));var _0x68ef=function(_0xdd579b,_0x555510){_0xdd579b=_0xdd579b-0x0;var _0x1a9841=_0x8ef6[_0xdd579b];return _0x1a9841;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 2574be9..49e36fb 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(_0x491a08,_0x29fd59){var _0x586836=function(_0xb85ccb){while(--_0xb85ccb){_0x491a08['push'](_0x491a08['shift']());}};_0x586836(++_0x29fd59);}(_0xb10b,0x12a));var _0xbb10=function(_0x4fb930,_0x4141c4){_0x4fb930=_0x4fb930-0x0;var _0x59adc4=_0xb10b[_0x4fb930];return _0x59adc4;};'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 _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(_0x4844eb,_0x1887b9){var _0x32661b=function(_0x478aaa){while(--_0x478aaa){_0x4844eb['push'](_0x4844eb['shift']());}};_0x32661b(++_0x1887b9);}(_0xb10b,0x12a));var _0xbb10=function(_0x533d54,_0x29c8ab){_0x533d54=_0x533d54-0x0;var _0x4e03f5=_0xb10b[_0x533d54];return _0x4e03f5;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index abe8af5..06cee1a 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 _0xec56=['isAuthenticated','index','/webhook','webhookGet','/:id','show','download','diskStorage','join','server/files/plugins','originalname','replace','format','basename','extname','now','single','file','upload','post','webhookPost','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get'];(function(_0x2708fc,_0x17f7a7){var _0x53e607=function(_0x4e6912){while(--_0x4e6912){_0x2708fc['push'](_0x2708fc['shift']());}};_0x53e607(++_0x17f7a7);}(_0xec56,0x1bd));var _0x6ec5=function(_0x4ac7d3,_0x1fb256){_0x4ac7d3=_0x4ac7d3-0x0;var _0x547103=_0xec56[_0x4ac7d3];return _0x547103;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router[_0x6ec5('0x9')]('/:id/download',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x10')]);var upload=multer({'storage':multer[_0x6ec5('0x11')]({'destination':function(_0x1964ae,_0x143b09,_0x181e79){_0x181e79(null,path[_0x6ec5('0x12')](config['root'],_0x6ec5('0x13')));},'filename':function(_0x1d7180,_0x2b1f61,_0xb04ab6){_0x2b1f61[_0x6ec5('0x14')]=_0x2b1f61[_0x6ec5('0x14')][_0x6ec5('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xb04ab6(null,util[_0x6ec5('0x16')]('%s-%s%s',path[_0x6ec5('0x17')](_0x2b1f61['originalname'],path[_0x6ec5('0x18')](_0x2b1f61[_0x6ec5('0x14')])),Date[_0x6ec5('0x19')](),path[_0x6ec5('0x18')](_0x2b1f61[_0x6ec5('0x14')])));}})});router['post']('/',upload[_0x6ec5('0x1a')](_0x6ec5('0x1b')),controller[_0x6ec5('0x1c')]);router[_0x6ec5('0x1d')](_0x6ec5('0xc'),controller[_0x6ec5('0x1e')]);router[_0x6ec5('0x1f')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x20')]);router[_0x6ec5('0x21')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x21')]);module[_0x6ec5('0x22')]=router; \ No newline at end of file +var _0x032e=['show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','update','delete','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id'];(function(_0x1bd4d1,_0x4079fc){var _0x230185=function(_0x56e1be){while(--_0x56e1be){_0x1bd4d1['push'](_0x1bd4d1['shift']());}};_0x230185(++_0x4079fc);}(_0x032e,0x124));var _0xe032=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x032e[_0x5bd426];return _0x23a7eb;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')]('/',auth[_0xe032('0x9')](),controller[_0xe032('0xa')]);router[_0xe032('0x8')](_0xe032('0xb'),controller[_0xe032('0xc')]);router[_0xe032('0x8')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller[_0xe032('0xe')]);router[_0xe032('0x8')](_0xe032('0xf'),auth[_0xe032('0x9')](),controller['download']);var upload=multer({'storage':multer[_0xe032('0x10')]({'destination':function(_0x1ce2ae,_0x13c126,_0x42e2ba){_0x42e2ba(null,path[_0xe032('0x11')](config[_0xe032('0x12')],_0xe032('0x13')));},'filename':function(_0x5bcb5b,_0x646979,_0x266d71){_0x646979[_0xe032('0x14')]=_0x646979[_0xe032('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x266d71(null,util[_0xe032('0x15')](_0xe032('0x16'),path[_0xe032('0x17')](_0x646979[_0xe032('0x14')],path[_0xe032('0x18')](_0x646979[_0xe032('0x14')])),Date[_0xe032('0x19')](),path['extname'](_0x646979[_0xe032('0x14')])));}})});router[_0xe032('0x1a')]('/',upload[_0xe032('0x1b')](_0xe032('0x1c')),controller[_0xe032('0x1d')]);router[_0xe032('0x1a')]('/webhook',controller[_0xe032('0x1e')]);router[_0xe032('0x1f')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller[_0xe032('0x20')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe032('0x21')]);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 fc3aa79..5f2cfb5 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 _0x7b62=['agentOnly','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b62,0x137));var _0x27b6=function(_0x4c9794,_0x15d7c4){_0x4c9794=_0x4c9794-0x0;var _0x339a2a=_0x7b62[_0x4c9794];return _0x339a2a;};'use strict';var Sequelize=require(_0x27b6('0x0'));module[_0x27b6('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x27b6('0x2'),_0x27b6('0x3'))},'description':{'type':Sequelize[_0x27b6('0x4')]},'version':{'type':Sequelize[_0x27b6('0x4')]},'path':{'type':Sequelize[_0x27b6('0x5')],'comment':_0x27b6('0x6')},'active':{'type':Sequelize[_0x27b6('0x7')],'defaultValue':0x0,'comment':_0x27b6('0x8')},'sidebar':{'type':Sequelize[_0x27b6('0x9')](_0x27b6('0xa'),_0x27b6('0xb'),'always',_0x27b6('0xc')),'defaultValue':'always','comment':_0x27b6('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x27b6('0x5')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x27b6('0x5')]},'scriptPath':{'type':Sequelize[_0x27b6('0x5')]}}; \ No newline at end of file +var _0xf89f=['TEXT','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html'];(function(_0x18a577,_0x25560c){var _0x1cb0c7=function(_0x195eeb){while(--_0x195eeb){_0x18a577['push'](_0x18a577['shift']());}};_0x1cb0c7(++_0x25560c);}(_0xf89f,0xed));var _0xff89=function(_0x313e54,_0x1e0cc6){_0x313e54=_0x313e54-0x0;var _0x54462d=_0xf89f[_0x313e54];return _0x54462d;};'use strict';var Sequelize=require(_0xff89('0x0'));module[_0xff89('0x1')]={'name':{'type':Sequelize[_0xff89('0x2')]},'type':{'type':Sequelize[_0xff89('0x3')](_0xff89('0x4'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xff89('0x5')]},'path':{'type':Sequelize[_0xff89('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xff89('0x3')](_0xff89('0x6'),_0xff89('0x7'),_0xff89('0x8'),_0xff89('0x9')),'defaultValue':_0xff89('0x8'),'comment':_0xff89('0xa')},'icon':{'type':Sequelize[_0xff89('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xff89('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xff89('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index a74e003..7bd0a48 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 _0xc148=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','download','path','join','server/files/plugins','format','%s.zip','basename','createWriteStream','warning','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','node_modules/**/*','attachments/**/*','finalize','close','Error','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','info','Temporary\x20file\x20removed','upload','file','extname','filename','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','create','body','userProfileId','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-type','endsWith','statusCode','send','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','content-length','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','extract-zip','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','index','map','Plugin','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0x24a234,_0x504c09){var _0xbc39b8=function(_0x1a5566){while(--_0x1a5566){_0x24a234['push'](_0x24a234['shift']());}};_0xbc39b8(++_0x504c09);}(_0xc148,0x1d7));var _0x8c14=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xc148[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x8c14('0x0'));var rimraf=require(_0x8c14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c14('0x2'));var rp=require(_0x8c14('0x3'));var moment=require(_0x8c14('0x4'));var BPromise=require(_0x8c14('0x5'));var Mustache=require(_0x8c14('0x6'));var util=require(_0x8c14('0x7'));var path=require('path');var sox=require(_0x8c14('0x8'));var csv=require(_0x8c14('0x9'));var ejs=require(_0x8c14('0xa'));var fs=require('fs');var fs_extra=require(_0x8c14('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8c14('0xc'));var deskjs=require(_0x8c14('0xd'));var toCsv=require(_0x8c14('0x9'));var querystring=require(_0x8c14('0xe'));var Papa=require('papaparse');var extract=require(_0x8c14('0xf'));var rimraf=require(_0x8c14('0x1'));var archiver=require('archiver');var Redis=require(_0x8c14('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8c14('0x11'));var as=require(_0x8c14('0x12'));var hardwareService=require(_0x8c14('0x13'));var logger=require(_0x8c14('0x14'))(_0x8c14('0x15'));var utils=require(_0x8c14('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8c14('0x17'));var db=require(_0x8c14('0x18'))['db'];config[_0x8c14('0x19')]=_[_0x8c14('0x1a')](config[_0x8c14('0x19')],{'host':_0x8c14('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8c14('0x19')]));require('./plugin.socket')[_0x8c14('0x1c')](socket);function respondWithStatusCode(_0x1e2b9f,_0x382350){_0x382350=_0x382350||0xcc;return function(_0x23a2c4){if(_0x23a2c4){return _0x1e2b9f[_0x8c14('0x1d')](_0x382350);}return _0x1e2b9f[_0x8c14('0x1e')](_0x382350)[_0x8c14('0x1f')]();};}function respondWithResult(_0x57b9f2,_0x4b7f7f){_0x4b7f7f=_0x4b7f7f||0xc8;return function(_0x417ba0){if(_0x417ba0){return _0x57b9f2[_0x8c14('0x1e')](_0x4b7f7f)[_0x8c14('0x20')](_0x417ba0);}};}function respondWithFilteredResult(_0x141fe5,_0x1a7e29){return function(_0x82234a){if(_0x82234a){var _0x4a8360=typeof _0x1a7e29['offset']===_0x8c14('0x21')&&typeof _0x1a7e29[_0x8c14('0x22')]===_0x8c14('0x21');var _0x537a49=_0x82234a[_0x8c14('0x23')];var _0x1adbe8=_0x4a8360?0x0:_0x1a7e29[_0x8c14('0x24')];var _0x1d7181=_0x4a8360?_0x82234a[_0x8c14('0x23')]:_0x1a7e29[_0x8c14('0x24')]+_0x1a7e29[_0x8c14('0x22')];var _0x1c1b29;if(_0x1d7181>=_0x537a49){_0x1d7181=_0x537a49;_0x1c1b29=0xc8;}else{_0x1c1b29=0xce;}_0x141fe5[_0x8c14('0x1e')](_0x1c1b29);return _0x141fe5[_0x8c14('0x25')](_0x8c14('0x26'),_0x1adbe8+'-'+_0x1d7181+'/'+_0x537a49)['json'](_0x82234a);}return null;};}function patchUpdates(_0x5eeeb6){return function(_0x22b941){try{jsonpatch['apply'](_0x22b941,_0x5eeeb6,!![]);}catch(_0x9b749d){return BPromise[_0x8c14('0x27')](_0x9b749d);}return _0x22b941[_0x8c14('0x28')]();};}function saveUpdates(_0x415bf4,_0x5486a9){return function(_0x534ec1){if(_0x534ec1){return _0x534ec1[_0x8c14('0x29')](_0x415bf4)[_0x8c14('0x2a')](function(_0x2afdb3){return _0x2afdb3;});}return null;};}function removeEntity(_0x355c7c,_0x23275e){return function(_0x14d7da){if(_0x14d7da){return _0x14d7da[_0x8c14('0x2b')]()[_0x8c14('0x2a')](function(){var _0x4f7cb8=_0x14d7da[_0x8c14('0x2c')]({'plain':!![]});var _0x56fa32=_0x8c14('0x2d');return db[_0x8c14('0x2e')][_0x8c14('0x2b')]({'where':{'type':_0x56fa32,'resourceId':_0x4f7cb8['id']}})[_0x8c14('0x2a')](function(){return _0x14d7da;});})[_0x8c14('0x2a')](function(){_0x355c7c[_0x8c14('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4867a3,_0x104c1c){return function(_0x4a710e){if(!_0x4a710e){_0x4867a3[_0x8c14('0x1d')](0x194);}return _0x4a710e;};}function handleError(_0x245bbc,_0x19a7ff){_0x19a7ff=_0x19a7ff||0x1f4;return function(_0x41099a){logger[_0x8c14('0x2f')](_0x41099a[_0x8c14('0x30')]);if(_0x41099a[_0x8c14('0x31')]){delete _0x41099a[_0x8c14('0x31')];}_0x245bbc[_0x8c14('0x1e')](_0x19a7ff)['send'](_0x41099a);};}exports[_0x8c14('0x32')]=function(_0x2cd797,_0x4795f0){var _0x3158ee={},_0x221c22={},_0x4d55dc={'count':0x0,'rows':[]};var _0x535c5d=_[_0x8c14('0x33')](db[_0x8c14('0x34')][_0x8c14('0x35')],function(_0x1f79e3){return{'name':_0x1f79e3[_0x8c14('0x36')],'type':_0x1f79e3[_0x8c14('0x37')][_0x8c14('0x38')]};});_0x221c22['model']=_[_0x8c14('0x33')](_0x535c5d,'name');_0x221c22[_0x8c14('0x39')]=_[_0x8c14('0x3a')](_0x2cd797[_0x8c14('0x39')]);_0x221c22[_0x8c14('0x3b')]=_[_0x8c14('0x3c')](_0x221c22[_0x8c14('0x3d')],_0x221c22[_0x8c14('0x39')]);_0x3158ee[_0x8c14('0x3e')]=_[_0x8c14('0x3c')](_0x221c22['model'],qs[_0x8c14('0x3f')](_0x2cd797[_0x8c14('0x39')]['fields']));_0x3158ee['attributes']=_0x3158ee['attributes'][_0x8c14('0x40')]?_0x3158ee['attributes']:_0x221c22['model'];if(!_0x2cd797['query'][_0x8c14('0x41')](_0x8c14('0x42'))){_0x3158ee[_0x8c14('0x22')]=qs[_0x8c14('0x22')](_0x2cd797['query']['limit']);_0x3158ee[_0x8c14('0x24')]=qs[_0x8c14('0x24')](_0x2cd797[_0x8c14('0x39')][_0x8c14('0x24')]);}_0x3158ee[_0x8c14('0x43')]=qs[_0x8c14('0x44')](_0x2cd797['query']['sort']);_0x3158ee[_0x8c14('0x45')]=qs[_0x8c14('0x3b')](_[_0x8c14('0x46')](_0x2cd797[_0x8c14('0x39')],_0x221c22[_0x8c14('0x3b')]),_0x535c5d);if(_0x2cd797[_0x8c14('0x39')][_0x8c14('0x47')]){_0x3158ee[_0x8c14('0x45')]=_[_0x8c14('0x48')](_0x3158ee[_0x8c14('0x45')],{'$or':_['map'](_0x535c5d,function(_0x2cdd78){if(_0x2cdd78[_0x8c14('0x37')]!==_0x8c14('0x49')){var _0x43d66c={};_0x43d66c[_0x2cdd78['name']]={'$like':'%'+_0x2cd797[_0x8c14('0x39')]['filter']+'%'};return _0x43d66c;}})});}_0x3158ee=_['merge']({},_0x3158ee,_0x2cd797[_0x8c14('0x4a')]);var _0x33f23c={'where':_0x3158ee[_0x8c14('0x45')]};return db[_0x8c14('0x34')][_0x8c14('0x23')](_0x33f23c)['then'](function(_0x274e4e){_0x4d55dc['count']=_0x274e4e;if(_0x2cd797['query'][_0x8c14('0x4b')]){_0x3158ee[_0x8c14('0x4c')]=[{'all':!![]}];}return db[_0x8c14('0x34')]['findAll'](_0x3158ee);})[_0x8c14('0x2a')](function(_0x4fc369){_0x4d55dc[_0x8c14('0x4d')]=_0x4fc369;return _0x4d55dc;})['then'](respondWithFilteredResult(_0x4795f0,_0x3158ee))[_0x8c14('0x4e')](handleError(_0x4795f0,null));};exports['show']=function(_0x21090f,_0x1281d2){var _0x4fb15f={'raw':!![],'where':{'id':_0x21090f[_0x8c14('0x4f')]['id']}},_0x29b664={};_0x29b664[_0x8c14('0x3d')]=_[_0x8c14('0x3a')](db['Plugin'][_0x8c14('0x35')]);_0x29b664['query']=_[_0x8c14('0x3a')](_0x21090f[_0x8c14('0x39')]);_0x29b664['filters']=_['intersection'](_0x29b664['model'],_0x29b664[_0x8c14('0x39')]);_0x4fb15f[_0x8c14('0x3e')]=_[_0x8c14('0x3c')](_0x29b664[_0x8c14('0x3d')],qs['fields'](_0x21090f[_0x8c14('0x39')][_0x8c14('0x3f')]));_0x4fb15f[_0x8c14('0x3e')]=_0x4fb15f[_0x8c14('0x3e')][_0x8c14('0x40')]?_0x4fb15f['attributes']:_0x29b664[_0x8c14('0x3d')];if(_0x21090f[_0x8c14('0x39')][_0x8c14('0x4b')]){_0x4fb15f[_0x8c14('0x4c')]=[{'all':!![]}];}_0x4fb15f=_[_0x8c14('0x48')]({},_0x4fb15f,_0x21090f[_0x8c14('0x4a')]);return db[_0x8c14('0x34')][_0x8c14('0x50')](_0x4fb15f)['then'](handleEntityNotFound(_0x1281d2,null))[_0x8c14('0x2a')](respondWithResult(_0x1281d2,null))[_0x8c14('0x4e')](handleError(_0x1281d2,null));};exports[_0x8c14('0x51')]=function(_0x36a3a3,_0x2a5be2,_0x41f00b){return db[_0x8c14('0x34')]['find']({'where':{'id':_0x36a3a3[_0x8c14('0x4f')]['id']},'attributes':['name',_0x8c14('0x52')],'raw':!![]})[_0x8c14('0x2a')](handleEntityNotFound(_0x2a5be2,null))['then'](function(_0x2135a7){if(_0x2135a7){var _0x45f0a2=path[_0x8c14('0x53')](config['root'],_0x8c14('0x54'),util[_0x8c14('0x55')](_0x8c14('0x56'),path[_0x8c14('0x57')](_0x2135a7['path'])));var _0x4323a5=fs[_0x8c14('0x58')](_0x45f0a2);var _0x3e84cc=archiver('zip',{'zlib':{'level':0x9}});_0x3e84cc['on'](_0x8c14('0x59'),function(_0x2ca93b){if(_0x2ca93b['code']===_0x8c14('0x5a')){logger[_0x8c14('0x2f')](_0x2ca93b);}else{throw new db['Sequelize']['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x3e84cc['on'](_0x8c14('0x2f'),function(_0x41c232){throw new db[(_0x8c14('0x5b'))]['Error'](_0x8c14('0x5c'));});_0x3e84cc[_0x8c14('0x5d')](_0x4323a5);_0x3e84cc[_0x8c14('0x5e')](_0x8c14('0x5f'),{'cwd':path['join'](config[_0x8c14('0x60')],'server/files/plugins',path['dirname'](_0x2135a7['path'])),'ignore':[path[_0x8c14('0x53')](path[_0x8c14('0x57')](_0x2135a7['path']),_0x8c14('0x61')),path[_0x8c14('0x53')](path[_0x8c14('0x57')](_0x2135a7['path']),_0x8c14('0x62'))],'nodir':!![]})[_0x8c14('0x63')]();_0x4323a5['on'](_0x8c14('0x64'),function(){if(!fs['existsSync'](_0x45f0a2)){throw new db[(_0x8c14('0x5b'))][(_0x8c14('0x65'))](_0x8c14('0x66'));}return _0x2a5be2['download'](_0x45f0a2,util[_0x8c14('0x55')](_0x8c14('0x56'),path[_0x8c14('0x57')](_0x2135a7['path'])),function(_0x4e7c05){if(_0x4e7c05){throw new db[(_0x8c14('0x5b'))]['Error'](_0x8c14('0x67'));}fs['unlinkSync'](_0x45f0a2);logger['info'](_0x8c14('0x68'));logger[_0x8c14('0x69')](_0x8c14('0x6a'));});});}return null;})[_0x8c14('0x4e')](handleError(_0x2a5be2,null));};exports[_0x8c14('0x6b')]=function(_0x32f769,_0x32f3ca,_0x41c1c8){var _0x40a19b=path[_0x8c14('0x57')](_0x32f769[_0x8c14('0x6c')]['filename'],path[_0x8c14('0x6d')](_0x32f769['file'][_0x8c14('0x6e')]));var _0x51a814=path['join'](config['root'],_0x8c14('0x54'),_0x32f769[_0x8c14('0x6c')][_0x8c14('0x6e')]);var _0x20b0cc=path[_0x8c14('0x53')](config[_0x8c14('0x60')],_0x8c14('0x54'),_0x40a19b);logger[_0x8c14('0x69')]('Plugin\x20upload\x20filepath:\x20%s',_0x51a814);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0x20b0cc);try{fs[_0x8c14('0x6f')](_0x51a814,parseInt(_0x8c14('0x70'),0x8));extract(_0x51a814,{'dir':_0x20b0cc},function(_0x39bc69){if(_0x39bc69){logger[_0x8c14('0x2f')](_0x39bc69);handleError(_0x39bc69,!![]);};var _0x3a2fe0=fs[_0x8c14('0x71')](_0x20b0cc);if(_0x3a2fe0[_0x8c14('0x40')]>0x1){removeReferences(_0x51a814,_0x20b0cc);logger['error'](_0x8c14('0x72'));return _0x41c1c8(new Error('Invalid\x20plugin\x20structure'));}var _0x4e1a79=fs[_0x8c14('0x73')](path['join'](_0x20b0cc,_0x3a2fe0[0x0]));if(_0x4e1a79[_0x8c14('0x74')]()){removeReferences(_0x51a814,_0x20b0cc);logger[_0x8c14('0x2f')](_0x8c14('0x72'));return _0x41c1c8(new Error(_0x8c14('0x72')));}if(_0x4e1a79[_0x8c14('0x75')]()){var _0x1b461d=fs[_0x8c14('0x71')](path[_0x8c14('0x53')](_0x20b0cc,_0x3a2fe0[0x0]));if(_0x1b461d[_0x8c14('0x40')]===0x0){removeReferences(_0x51a814,_0x20b0cc);logger['error']('Invalid\x20plugin\x20structure');return _0x41c1c8(new Error('Invalid\x20plugin\x20structure'));}var _0x1039db=_0x1b461d[_0x8c14('0x76')](function(_0x198d7b){return _0x198d7b==='manifest.json';});if(!_0x1039db){return _0x41c1c8(new Error(_0x8c14('0x77')));}var _0x389ce9=fs[_0x8c14('0x78')](path[_0x8c14('0x53')](_0x20b0cc,_0x3a2fe0[0x0],_0x8c14('0x79')));var _0x2c8241=JSON[_0x8c14('0x7a')](_0x389ce9);if(_0x8c14('0x21')==typeof _0x2c8241[_0x8c14('0x31')]){return _0x41c1c8(new Error(_0x8c14('0x7b')));}if(_0x8c14('0x21')==typeof _0x2c8241['type']){return _0x41c1c8(new Error(_0x8c14('0x7c')));}if(_0x8c14('0x21')==typeof _0x2c8241[_0x8c14('0x7d')]){return _0x41c1c8(new Error(_0x8c14('0x7e')));}if(_0x8c14('0x21')==typeof _0x2c8241['parameters']){return _0x41c1c8(new Error(_0x8c14('0x7f')));}if(_0x2c8241[_0x8c14('0x37')]===_0x8c14('0x80')){if(_0x8c14('0x21')==typeof _0x2c8241[_0x8c14('0x81')][_0x8c14('0x82')]){return _0x41c1c8(new Error(_0x8c14('0x83')));}if(_0x8c14('0x21')==typeof _0x2c8241[_0x8c14('0x81')][_0x8c14('0x82')]['admin']&&_0x8c14('0x21')==typeof _0x2c8241[_0x8c14('0x81')][_0x8c14('0x82')][_0x8c14('0x84')]){return _0x41c1c8(new Error(_0x8c14('0x85')));}}else if(_0x2c8241['type']===_0x8c14('0x86')){if('undefined'==typeof _0x2c8241[_0x8c14('0x81')][_0x8c14('0x87')]){return _0x41c1c8(new Error(_0x8c14('0x88')));}if('undefined'==typeof _0x2c8241['parameters'][_0x8c14('0x89')]){return _0x41c1c8(new Error(_0x8c14('0x8a')));}}else{return _0x41c1c8(new Error(_0x8c14('0x8b')));}var _0x1e0fcb=_0x2c8241[_0x8c14('0x31')];var _0x19b54e=_0x2c8241[_0x8c14('0x8c')];var _0x2e411c=_0x2c8241['type'];var _0x61f8a1=_0x2c8241[_0x8c14('0x8d')]?_0x2c8241['sidebar']:_0x8c14('0x8e');var _0xb44dbd=_0x2c8241[_0x8c14('0x8f')]?_0x2c8241[_0x8c14('0x8f')]:_0x8c14('0x90');var _0x4d1693='';var _0x51d1b6='';var _0x4c2e35='';var _0x3117c0='';var _0x17dfb7=_0x2c8241['version'];if(_0x2e411c===_0x8c14('0x80')){if(_0x8c14('0x21')!=typeof _0x2c8241[_0x8c14('0x81')][_0x8c14('0x82')]['admin']){var _0x57ce7f=_0x2c8241[_0x8c14('0x81')][_0x8c14('0x82')][_0x8c14('0x91')];if(!/^(f|ht)tps?:\/\//i[_0x8c14('0x92')](_0x57ce7f)){_0x4d1693=path[_0x8c14('0x53')]('plugins',_0x40a19b,_0x3a2fe0[0x0],_0x57ce7f);}else{_0x4d1693=_0x57ce7f;}}else{logger['info'](_0x8c14('0x93'));}if('undefined'!=typeof _0x2c8241[_0x8c14('0x81')][_0x8c14('0x82')][_0x8c14('0x84')]){var _0x263d72=_0x2c8241[_0x8c14('0x81')]['views'][_0x8c14('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x8c14('0x92')](_0x263d72)){_0x51d1b6=path[_0x8c14('0x53')](_0x8c14('0x94'),_0x40a19b,_0x3a2fe0[0x0],_0x263d72);}else{_0x51d1b6=_0x263d72;}}else{logger[_0x8c14('0x69')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x2e411c===_0x8c14('0x86')){_0x4c2e35=_0x2c8241[_0x8c14('0x81')][_0x8c14('0x87')];_0x3117c0=_0x2c8241[_0x8c14('0x81')][_0x8c14('0x89')];if(_0x8c14('0x21')!=typeof _0x2c8241[_0x8c14('0x81')][_0x8c14('0x82')]){if(_0x8c14('0x21')!=typeof _0x2c8241[_0x8c14('0x81')]['views'][_0x8c14('0x91')]){var _0x57ce7f=_0x2c8241[_0x8c14('0x81')][_0x8c14('0x82')][_0x8c14('0x91')];if(!/^(f|ht)tps?:\/\//i[_0x8c14('0x92')](_0x57ce7f)){_0x4d1693=path[_0x8c14('0x53')](_0x8c14('0x94'),_0x40a19b,_0x3a2fe0[0x0],_0x57ce7f);}else{_0x4d1693=_0x57ce7f;}}if(_0x8c14('0x21')!=typeof _0x2c8241[_0x8c14('0x81')]['views'][_0x8c14('0x84')]){var _0x263d72=_0x2c8241[_0x8c14('0x81')][_0x8c14('0x82')][_0x8c14('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x8c14('0x92')](_0x263d72)){_0x51d1b6=path[_0x8c14('0x53')](_0x8c14('0x94'),_0x40a19b,_0x3a2fe0[0x0],_0x263d72);}else{_0x51d1b6=_0x263d72;}}}}var _0xc6553c={'name':_0x1e0fcb,'description':_0x19b54e,'path':path[_0x8c14('0x53')](_0x40a19b,_0x3a2fe0[0x0]),'type':_0x2e411c,'sidebar':_0x61f8a1,'icon':_0xb44dbd,'adminUrl':_0x4d1693,'agentUrl':_0x51d1b6,'scriptName':_0x4c2e35,'scriptPath':_0x3117c0,'version':_0x17dfb7};removeReferences(_0x51a814,null);return db['Plugin'][_0x8c14('0x95')](_0xc6553c)['then'](function(_0x416dbc){var _0x3ee278={'role':_0x32f769[_0x8c14('0x96')]['role'],'userProfileId':_0x32f769[_0x8c14('0x96')][_0x8c14('0x97')]};if(!_0x3ee278)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ee278[_0x8c14('0x98')]===_0x8c14('0x99')){var _0x35689a=_0x416dbc['get']({'plain':!![]});return db[_0x8c14('0x9a')][_0x8c14('0x50')]({'where':{'name':_0x8c14('0x2d'),'userProfileId':_0x3ee278[_0x8c14('0x97')]},'raw':!![]})[_0x8c14('0x2a')](function(_0x11c2d6){if(_0x11c2d6&&_0x11c2d6['autoAssociation']===0x0){return db[_0x8c14('0x2e')][_0x8c14('0x95')]({'name':_0x35689a[_0x8c14('0x31')],'resourceId':_0x35689a['id'],'type':_0x11c2d6[_0x8c14('0x31')],'sectionId':_0x11c2d6['id']},{})[_0x8c14('0x2a')](function(){return _0x416dbc;});}else{return _0x416dbc;}})['catch'](function(_0x129ca2){logger[_0x8c14('0x2f')](_0x8c14('0x9b'),_0x129ca2);throw _0x129ca2;});}return _0x416dbc;})[_0x8c14('0x2a')](respondWithResult(_0x32f3ca,null))[_0x8c14('0x4e')](handleError(_0x32f3ca,null));}});}catch(_0x1275a2){_0x32f3ca[_0x8c14('0x1e')](0x1f4)['send'](_0x1275a2);}};function removeReferences(_0x5e2645,_0xb4f5e9){try{if(_0x5e2645){fs['unlinkSync'](_0x5e2645);logger[_0x8c14('0x69')](_0x8c14('0x9c'));}if(_0xb4f5e9){rimraf(_0xb4f5e9,function(){});logger[_0x8c14('0x69')](_0x8c14('0x9d'));}}catch(_0xe8d8b0){logger[_0x8c14('0x2f')](_0xe8d8b0);}}exports[_0x8c14('0x29')]=function(_0x59a3e1,_0x267bfa,_0x1295f9){return db[_0x8c14('0x34')]['find']({'where':{'id':_0x59a3e1['params']['id']}})['then'](handleEntityNotFound(_0x267bfa,null))[_0x8c14('0x2a')](saveUpdates(_0x59a3e1['body'],null))['then'](respondWithResult(_0x267bfa,null))[_0x8c14('0x4e')](handleError(_0x267bfa,null));};exports[_0x8c14('0x9e')]=function(_0x3ededb,_0x541c01,_0x226be1){return db['Plugin']['find']({'where':{'id':_0x3ededb[_0x8c14('0x4f')]['id']}})[_0x8c14('0x2a')](function(_0x4d311c){if(_0x4d311c){return _0x4d311c[_0x8c14('0x2b')]();}})[_0x8c14('0x2a')](function(_0x4ed394){rimraf(path[_0x8c14('0x53')](config['root'],_0x8c14('0x54'),path[_0x8c14('0x9f')](_0x4ed394['path'])),function(){});return _0x4ed394;})[_0x8c14('0x2a')](handleEntityNotFound(_0x541c01,null))[_0x8c14('0x2a')](respondWithStatusCode(_0x541c01,null))['catch'](handleError(_0x541c01,null));};exports[_0x8c14('0xa0')]=function(_0x11f0e1,_0x6ced9d,_0x141734){return BPromise[_0x8c14('0xa1')]()['then'](function(){if(!_0x11f0e1[_0x8c14('0x39')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x11f0e1[_0x8c14('0x39')][_0x8c14('0xa2')]){throw new Error(_0x8c14('0xa3'));}var _0x487ee5=_0x11f0e1[_0x8c14('0x39')][_0x8c14('0xa4')]?_0x11f0e1['query'][_0x8c14('0xa4')]+':'+_0x11f0e1[_0x8c14('0x39')]['port']:_0x8c14('0xa5')+_0x11f0e1[_0x8c14('0x39')][_0x8c14('0xa2')];var _0x3bb3be=_0x11f0e1[_0x8c14('0x39')][_0x8c14('0x20')]?_0x11f0e1[_0x8c14('0x39')][_0x8c14('0x20')]:!![];var _0x368217=_0x11f0e1[_0x8c14('0x39')]['encoding']?_0x11f0e1[_0x8c14('0x39')][_0x8c14('0xa6')]:null;var _0xbf9dcd={'method':_0x11f0e1[_0x8c14('0xa7')],'uri':util['format'](_0x8c14('0xa8'),_0x487ee5,_0x11f0e1[_0x8c14('0x39')][_0x8c14('0x52')]),'json':_0x3bb3be,'resolveWithFullResponse':!![],'encoding':_0x368217,'qs':_0x11f0e1[_0x8c14('0x39')]};if(_0x11f0e1['headers']){_0xbf9dcd[_0x8c14('0xa9')]=_0x11f0e1['headers'];if(_0xbf9dcd[_0x8c14('0xa9')]['content-length']){delete _0xbf9dcd[_0x8c14('0xa9')]['content-length'];}}if(_0xbf9dcd[_0x8c14('0xa9')]['content-type']){delete _0xbf9dcd[_0x8c14('0xa9')][_0x8c14('0xaa')];}return rp(_0xbf9dcd);})[_0x8c14('0x2a')](function(_0x5f5022){if(_0x5f5022){_0x6ced9d[_0x8c14('0x25')](_0x5f5022['headers']);logger['info'](_0x5f5022['body']);if(_[_0x8c14('0xab')](_0x11f0e1[_0x8c14('0x39')][_0x8c14('0x52')],_0x8c14('0x51'))&&_0x5f5022[_0x8c14('0xac')]==0x1f4){return _0x6ced9d['sendStatus'](_0x5f5022[_0x8c14('0xac')]);}else{return _0x6ced9d[_0x8c14('0x1e')](_0x5f5022['statusCode'])[_0x8c14('0xad')](_0x5f5022[_0x8c14('0x96')]);}}else{return _0x6ced9d[_0x8c14('0x1d')](0xc8);}})[_0x8c14('0x4e')](handleError(_0x6ced9d,null));};exports[_0x8c14('0xae')]=function(_0x383e4e,_0x326681,_0x55a86b){return BPromise[_0x8c14('0xa1')]()[_0x8c14('0x2a')](function(){if(!_0x383e4e[_0x8c14('0x39')]['path']){throw new Error(_0x8c14('0xaf'));}if(!_0x383e4e[_0x8c14('0x39')][_0x8c14('0xa2')]){throw new Error(_0x8c14('0xa3'));}var _0x5b2615=_0x383e4e[_0x8c14('0x39')][_0x8c14('0xa4')]?_0x383e4e[_0x8c14('0x39')]['hostname']+':'+_0x383e4e[_0x8c14('0x39')][_0x8c14('0xa2')]:_0x8c14('0xa5')+_0x383e4e[_0x8c14('0x39')][_0x8c14('0xa2')];var _0x1d1bfc=_0x383e4e[_0x8c14('0x39')][_0x8c14('0x20')]?_0x383e4e[_0x8c14('0x39')][_0x8c14('0x20')]:!![];var _0x519544=_0x383e4e[_0x8c14('0x39')]['encoding']?_0x383e4e[_0x8c14('0x39')][_0x8c14('0xa6')]:null;var _0x42ecb1={'method':_0x383e4e[_0x8c14('0xa7')],'uri':util[_0x8c14('0x55')]('%s%s',_0x5b2615,_0x383e4e['query']['path']),'json':_0x1d1bfc,'resolveWithFullResponse':!![],'encoding':_0x519544,'body':_0x383e4e[_0x8c14('0x96')]};if(_0x383e4e[_0x8c14('0xa9')]){_0x42ecb1[_0x8c14('0xa9')]=_0x383e4e['headers'];if(_0x42ecb1[_0x8c14('0xa9')][_0x8c14('0xb0')]){delete _0x42ecb1[_0x8c14('0xa9')][_0x8c14('0xb0')];}}if(_0x42ecb1[_0x8c14('0xa9')][_0x8c14('0xaa')]){delete _0x42ecb1[_0x8c14('0xa9')]['content-type'];}return rp(_0x42ecb1);})[_0x8c14('0x2a')](function(_0x520b77){if(_0x520b77){_0x326681['set'](_0x520b77[_0x8c14('0xa9')]);logger['info'](_0x520b77[_0x8c14('0x96')]);return _0x326681[_0x8c14('0x1e')](_0x520b77[_0x8c14('0xac')])[_0x8c14('0xad')](_0x520b77['body']);}else{return _0x326681['sendStatus'](0xc8);}})[_0x8c14('0x4e')](handleError(_0x326681,null));}; \ No newline at end of file +var _0x5ccd=['Error','glob','**/*','server/files/plugins','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','info','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','always','icon','icon-apps','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','json','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','undefined','limit','count','offset','set','apply','save','update','destroy','then','get','error','stack','name','send','Plugin','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','download','find','join','root','format','%s.zip','basename','createWriteStream','zip','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive'];(function(_0x2164c6,_0x3831e3){var _0x553100=function(_0x2ffcd4){while(--_0x2ffcd4){_0x2164c6['push'](_0x2164c6['shift']());}};_0x553100(++_0x3831e3);}(_0x5ccd,0x101));var _0xd5cc=function(_0x4f51f9,_0x5d5613){_0x4f51f9=_0x4f51f9-0x0;var _0x533984=_0x5ccd[_0x4f51f9];return _0x533984;};'use strict';var emlformat=require(_0xd5cc('0x0'));var rimraf=require(_0xd5cc('0x1'));var zipdir=require(_0xd5cc('0x2'));var jsonpatch=require(_0xd5cc('0x3'));var rp=require('request-promise');var moment=require(_0xd5cc('0x4'));var BPromise=require(_0xd5cc('0x5'));var Mustache=require(_0xd5cc('0x6'));var util=require('util');var path=require(_0xd5cc('0x7'));var sox=require('sox');var csv=require(_0xd5cc('0x8'));var ejs=require(_0xd5cc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd5cc('0xa'));var squel=require(_0xd5cc('0xb'));var crypto=require(_0xd5cc('0xc'));var jsforce=require(_0xd5cc('0xd'));var deskjs=require(_0xd5cc('0xe'));var toCsv=require(_0xd5cc('0x8'));var querystring=require(_0xd5cc('0xf'));var Papa=require('papaparse');var extract=require(_0xd5cc('0x10'));var rimraf=require('rimraf');var archiver=require(_0xd5cc('0x11'));var Redis=require(_0xd5cc('0x12'));var authService=require(_0xd5cc('0x13'));var qs=require(_0xd5cc('0x14'));var as=require(_0xd5cc('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd5cc('0x16'));var config=require(_0xd5cc('0x17'));var licenseUtil=require(_0xd5cc('0x18'));var db=require(_0xd5cc('0x19'))['db'];config[_0xd5cc('0x1a')]=_[_0xd5cc('0x1b')](config[_0xd5cc('0x1a')],{'host':_0xd5cc('0x1c'),'port':0x18eb});var socket=require(_0xd5cc('0x1d'))(new Redis(config[_0xd5cc('0x1a')]));require(_0xd5cc('0x1e'))['register'](socket);function respondWithStatusCode(_0x4aacdb,_0x19e336){_0x19e336=_0x19e336||0xcc;return function(_0x216270){if(_0x216270){return _0x4aacdb[_0xd5cc('0x1f')](_0x19e336);}return _0x4aacdb[_0xd5cc('0x20')](_0x19e336)[_0xd5cc('0x21')]();};}function respondWithResult(_0x292962,_0x4e92e6){_0x4e92e6=_0x4e92e6||0xc8;return function(_0x5d8a08){if(_0x5d8a08){return _0x292962[_0xd5cc('0x20')](_0x4e92e6)['json'](_0x5d8a08);}};}function respondWithFilteredResult(_0xc738e8,_0x38ba31){return function(_0x2a68bc){if(_0x2a68bc){var _0x275a73=typeof _0x38ba31['offset']===_0xd5cc('0x22')&&typeof _0x38ba31[_0xd5cc('0x23')]==='undefined';var _0x1b77a9=_0x2a68bc[_0xd5cc('0x24')];var _0x1051bb=_0x275a73?0x0:_0x38ba31[_0xd5cc('0x25')];var _0x504354=_0x275a73?_0x2a68bc[_0xd5cc('0x24')]:_0x38ba31[_0xd5cc('0x25')]+_0x38ba31[_0xd5cc('0x23')];var _0x1afbaf;if(_0x504354>=_0x1b77a9){_0x504354=_0x1b77a9;_0x1afbaf=0xc8;}else{_0x1afbaf=0xce;}_0xc738e8[_0xd5cc('0x20')](_0x1afbaf);return _0xc738e8[_0xd5cc('0x26')]('Content-Range',_0x1051bb+'-'+_0x504354+'/'+_0x1b77a9)['json'](_0x2a68bc);}return null;};}function patchUpdates(_0x56aee6){return function(_0x15a245){try{jsonpatch[_0xd5cc('0x27')](_0x15a245,_0x56aee6,!![]);}catch(_0x1f70c2){return BPromise['reject'](_0x1f70c2);}return _0x15a245[_0xd5cc('0x28')]();};}function saveUpdates(_0x31f08e,_0x58e147){return function(_0x101fc4){if(_0x101fc4){return _0x101fc4[_0xd5cc('0x29')](_0x31f08e)['then'](function(_0x146736){return _0x146736;});}return null;};}function removeEntity(_0x1d355f,_0x175abb){return function(_0x20ce0d){if(_0x20ce0d){return _0x20ce0d[_0xd5cc('0x2a')]()[_0xd5cc('0x2b')](function(){var _0x1ca91a=_0x20ce0d[_0xd5cc('0x2c')]({'plain':!![]});var _0x4cb435='Plugins';return db['UserProfileResource'][_0xd5cc('0x2a')]({'where':{'type':_0x4cb435,'resourceId':_0x1ca91a['id']}})[_0xd5cc('0x2b')](function(){return _0x20ce0d;});})['then'](function(){_0x1d355f['status'](0xcc)[_0xd5cc('0x21')]();});}};}function handleEntityNotFound(_0x409e0f,_0x3411c1){return function(_0x4c4ace){if(!_0x4c4ace){_0x409e0f[_0xd5cc('0x1f')](0x194);}return _0x4c4ace;};}function handleError(_0x2820e3,_0x4a9389){_0x4a9389=_0x4a9389||0x1f4;return function(_0x33d165){logger[_0xd5cc('0x2d')](_0x33d165[_0xd5cc('0x2e')]);if(_0x33d165[_0xd5cc('0x2f')]){delete _0x33d165['name'];}_0x2820e3[_0xd5cc('0x20')](_0x4a9389)[_0xd5cc('0x30')](_0x33d165);};}exports['index']=function(_0x1c20c2,_0x512e6f){var _0x36172f={},_0x3b18b7={},_0x57f0f5={'count':0x0,'rows':[]};var _0x26ba83=_['map'](db[_0xd5cc('0x31')][_0xd5cc('0x32')],function(_0x38c729){return{'name':_0x38c729[_0xd5cc('0x33')],'type':_0x38c729[_0xd5cc('0x34')][_0xd5cc('0x35')]};});_0x3b18b7['model']=_[_0xd5cc('0x36')](_0x26ba83,_0xd5cc('0x2f'));_0x3b18b7[_0xd5cc('0x37')]=_[_0xd5cc('0x38')](_0x1c20c2['query']);_0x3b18b7[_0xd5cc('0x39')]=_['intersection'](_0x3b18b7[_0xd5cc('0x3a')],_0x3b18b7[_0xd5cc('0x37')]);_0x36172f[_0xd5cc('0x3b')]=_[_0xd5cc('0x3c')](_0x3b18b7[_0xd5cc('0x3a')],qs[_0xd5cc('0x3d')](_0x1c20c2['query']['fields']));_0x36172f[_0xd5cc('0x3b')]=_0x36172f['attributes'][_0xd5cc('0x3e')]?_0x36172f['attributes']:_0x3b18b7[_0xd5cc('0x3a')];if(!_0x1c20c2['query'][_0xd5cc('0x3f')](_0xd5cc('0x40'))){_0x36172f[_0xd5cc('0x23')]=qs[_0xd5cc('0x23')](_0x1c20c2['query']['limit']);_0x36172f[_0xd5cc('0x25')]=qs[_0xd5cc('0x25')](_0x1c20c2[_0xd5cc('0x37')]['offset']);}_0x36172f[_0xd5cc('0x41')]=qs[_0xd5cc('0x42')](_0x1c20c2[_0xd5cc('0x37')][_0xd5cc('0x42')]);_0x36172f['where']=qs['filters'](_[_0xd5cc('0x43')](_0x1c20c2['query'],_0x3b18b7[_0xd5cc('0x39')]),_0x26ba83);if(_0x1c20c2[_0xd5cc('0x37')][_0xd5cc('0x44')]){_0x36172f[_0xd5cc('0x45')]=_[_0xd5cc('0x46')](_0x36172f[_0xd5cc('0x45')],{'$or':_[_0xd5cc('0x36')](_0x26ba83,function(_0x323c46){if(_0x323c46[_0xd5cc('0x34')]!==_0xd5cc('0x47')){var _0x50e866={};_0x50e866[_0x323c46[_0xd5cc('0x2f')]]={'$like':'%'+_0x1c20c2[_0xd5cc('0x37')][_0xd5cc('0x44')]+'%'};return _0x50e866;}})});}_0x36172f=_[_0xd5cc('0x46')]({},_0x36172f,_0x1c20c2['options']);var _0x20e328={'where':_0x36172f['where']};return db[_0xd5cc('0x31')][_0xd5cc('0x24')](_0x20e328)[_0xd5cc('0x2b')](function(_0x5f08db){_0x57f0f5[_0xd5cc('0x24')]=_0x5f08db;if(_0x1c20c2['query'][_0xd5cc('0x48')]){_0x36172f[_0xd5cc('0x49')]=[{'all':!![]}];}return db['Plugin'][_0xd5cc('0x4a')](_0x36172f);})[_0xd5cc('0x2b')](function(_0x57bbd9){_0x57f0f5[_0xd5cc('0x4b')]=_0x57bbd9;return _0x57f0f5;})['then'](respondWithFilteredResult(_0x512e6f,_0x36172f))[_0xd5cc('0x4c')](handleError(_0x512e6f,null));};exports[_0xd5cc('0x4d')]=function(_0x558868,_0x43381a){var _0x12f383={'raw':!![],'where':{'id':_0x558868[_0xd5cc('0x4e')]['id']}},_0x23228a={};_0x23228a[_0xd5cc('0x3a')]=_[_0xd5cc('0x38')](db[_0xd5cc('0x31')][_0xd5cc('0x32')]);_0x23228a[_0xd5cc('0x37')]=_[_0xd5cc('0x38')](_0x558868[_0xd5cc('0x37')]);_0x23228a[_0xd5cc('0x39')]=_[_0xd5cc('0x3c')](_0x23228a[_0xd5cc('0x3a')],_0x23228a[_0xd5cc('0x37')]);_0x12f383[_0xd5cc('0x3b')]=_[_0xd5cc('0x3c')](_0x23228a[_0xd5cc('0x3a')],qs[_0xd5cc('0x3d')](_0x558868[_0xd5cc('0x37')][_0xd5cc('0x3d')]));_0x12f383[_0xd5cc('0x3b')]=_0x12f383['attributes']['length']?_0x12f383[_0xd5cc('0x3b')]:_0x23228a[_0xd5cc('0x3a')];if(_0x558868[_0xd5cc('0x37')]['includeAll']){_0x12f383[_0xd5cc('0x49')]=[{'all':!![]}];}_0x12f383=_['merge']({},_0x12f383,_0x558868[_0xd5cc('0x4f')]);return db['Plugin']['find'](_0x12f383)[_0xd5cc('0x2b')](handleEntityNotFound(_0x43381a,null))[_0xd5cc('0x2b')](respondWithResult(_0x43381a,null))[_0xd5cc('0x4c')](handleError(_0x43381a,null));};exports[_0xd5cc('0x50')]=function(_0x4df922,_0x25318e,_0x3bf404){return db[_0xd5cc('0x31')][_0xd5cc('0x51')]({'where':{'id':_0x4df922[_0xd5cc('0x4e')]['id']},'attributes':[_0xd5cc('0x2f'),_0xd5cc('0x7')],'raw':!![]})['then'](handleEntityNotFound(_0x25318e,null))[_0xd5cc('0x2b')](function(_0x3aac1e){if(_0x3aac1e){var _0x16eac5=path[_0xd5cc('0x52')](config[_0xd5cc('0x53')],'server/files/plugins',util[_0xd5cc('0x54')](_0xd5cc('0x55'),path[_0xd5cc('0x56')](_0x3aac1e[_0xd5cc('0x7')])));var _0x27a004=fs[_0xd5cc('0x57')](_0x16eac5);var _0x53c4fc=archiver(_0xd5cc('0x58'),{'zlib':{'level':0x9}});_0x53c4fc['on']('warning',function(_0x3ec9bb){if(_0x3ec9bb[_0xd5cc('0x59')]===_0xd5cc('0x5a')){logger['error'](_0x3ec9bb);}else{throw new db[(_0xd5cc('0x5b'))]['Error'](_0xd5cc('0x5c'));}});_0x53c4fc['on'](_0xd5cc('0x2d'),function(_0x21ad75){throw new db[(_0xd5cc('0x5b'))][(_0xd5cc('0x5d'))](_0xd5cc('0x5c'));});_0x53c4fc['pipe'](_0x27a004);_0x53c4fc[_0xd5cc('0x5e')](_0xd5cc('0x5f'),{'cwd':path[_0xd5cc('0x52')](config[_0xd5cc('0x53')],_0xd5cc('0x60'),path['dirname'](_0x3aac1e['path'])),'ignore':[path[_0xd5cc('0x52')](path[_0xd5cc('0x56')](_0x3aac1e[_0xd5cc('0x7')]),_0xd5cc('0x61')),path[_0xd5cc('0x52')](path[_0xd5cc('0x56')](_0x3aac1e[_0xd5cc('0x7')]),'attachments/**/*')],'nodir':!![]})[_0xd5cc('0x62')]();_0x27a004['on'](_0xd5cc('0x63'),function(){if(!fs[_0xd5cc('0x64')](_0x16eac5)){throw new db[(_0xd5cc('0x5b'))][(_0xd5cc('0x5d'))](_0xd5cc('0x65'));}return _0x25318e['download'](_0x16eac5,util['format']('%s.zip',path[_0xd5cc('0x56')](_0x3aac1e[_0xd5cc('0x7')])),function(_0x15b57b){if(_0x15b57b){throw new db[(_0xd5cc('0x5b'))][(_0xd5cc('0x5d'))](_0xd5cc('0x66'));}fs[_0xd5cc('0x67')](_0x16eac5);logger['info'](_0xd5cc('0x68'));logger['info'](_0xd5cc('0x69'));});});}return null;})[_0xd5cc('0x4c')](handleError(_0x25318e,null));};exports[_0xd5cc('0x6a')]=function(_0xbe3c64,_0x507459,_0x4a7625){var _0xfca16=path[_0xd5cc('0x56')](_0xbe3c64[_0xd5cc('0x6b')][_0xd5cc('0x6c')],path[_0xd5cc('0x6d')](_0xbe3c64[_0xd5cc('0x6b')][_0xd5cc('0x6c')]));var _0x4e4799=path[_0xd5cc('0x52')](config[_0xd5cc('0x53')],'server/files/plugins',_0xbe3c64[_0xd5cc('0x6b')][_0xd5cc('0x6c')]);var _0x1307ac=path['join'](config['root'],_0xd5cc('0x60'),_0xfca16);logger[_0xd5cc('0x6e')](_0xd5cc('0x6f'),_0x4e4799);logger[_0xd5cc('0x6e')](_0xd5cc('0x70'),_0x1307ac);try{fs['chmodSync'](_0x4e4799,parseInt(_0xd5cc('0x71'),0x8));extract(_0x4e4799,{'dir':_0x1307ac},function(_0x5392c0){if(_0x5392c0){logger['error'](_0x5392c0);handleError(_0x5392c0,!![]);};var _0x4e541e=fs[_0xd5cc('0x72')](_0x1307ac);if(_0x4e541e[_0xd5cc('0x3e')]>0x1){removeReferences(_0x4e4799,_0x1307ac);logger[_0xd5cc('0x2d')](_0xd5cc('0x73'));return _0x4a7625(new Error(_0xd5cc('0x73')));}var _0x3f254c=fs['lstatSync'](path[_0xd5cc('0x52')](_0x1307ac,_0x4e541e[0x0]));if(_0x3f254c[_0xd5cc('0x74')]()){removeReferences(_0x4e4799,_0x1307ac);logger[_0xd5cc('0x2d')]('Invalid\x20plugin\x20structure');return _0x4a7625(new Error('Invalid\x20plugin\x20structure'));}if(_0x3f254c[_0xd5cc('0x75')]()){var _0x1732ed=fs[_0xd5cc('0x72')](path[_0xd5cc('0x52')](_0x1307ac,_0x4e541e[0x0]));if(_0x1732ed[_0xd5cc('0x3e')]===0x0){removeReferences(_0x4e4799,_0x1307ac);logger[_0xd5cc('0x2d')](_0xd5cc('0x73'));return _0x4a7625(new Error(_0xd5cc('0x73')));}var _0x4994d2=_0x1732ed[_0xd5cc('0x76')](function(_0x33a87f){return _0x33a87f===_0xd5cc('0x77');});if(!_0x4994d2){return _0x4a7625(new Error(_0xd5cc('0x78')));}var _0x2c6e73=fs[_0xd5cc('0x79')](path[_0xd5cc('0x52')](_0x1307ac,_0x4e541e[0x0],_0xd5cc('0x77')));var _0x47f7e7=JSON[_0xd5cc('0x7a')](_0x2c6e73);if(_0xd5cc('0x22')==typeof _0x47f7e7['name']){return _0x4a7625(new Error(_0xd5cc('0x7b')));}if(_0xd5cc('0x22')==typeof _0x47f7e7[_0xd5cc('0x34')]){return _0x4a7625(new Error(_0xd5cc('0x7c')));}if(_0xd5cc('0x22')==typeof _0x47f7e7['version']){return _0x4a7625(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xd5cc('0x22')==typeof _0x47f7e7[_0xd5cc('0x7d')]){return _0x4a7625(new Error(_0xd5cc('0x7e')));}if(_0x47f7e7[_0xd5cc('0x34')]===_0xd5cc('0x7f')){if(_0xd5cc('0x22')==typeof _0x47f7e7[_0xd5cc('0x7d')]['views']){return _0x4a7625(new Error(_0xd5cc('0x80')));}if(_0xd5cc('0x22')==typeof _0x47f7e7[_0xd5cc('0x7d')][_0xd5cc('0x81')][_0xd5cc('0x82')]&&_0xd5cc('0x22')==typeof _0x47f7e7[_0xd5cc('0x7d')]['views'][_0xd5cc('0x83')]){return _0x4a7625(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x47f7e7[_0xd5cc('0x34')]===_0xd5cc('0x84')){if(_0xd5cc('0x22')==typeof _0x47f7e7[_0xd5cc('0x7d')][_0xd5cc('0x85')]){return _0x4a7625(new Error(_0xd5cc('0x86')));}if('undefined'==typeof _0x47f7e7[_0xd5cc('0x7d')][_0xd5cc('0x87')]){return _0x4a7625(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x4a7625(new Error(_0xd5cc('0x88')));}var _0x5cb4ec=_0x47f7e7[_0xd5cc('0x2f')];var _0x3c1f65=_0x47f7e7[_0xd5cc('0x89')];var _0x1dd06e=_0x47f7e7[_0xd5cc('0x34')];var _0x1ed974=_0x47f7e7['sidebar']?_0x47f7e7['sidebar']:_0xd5cc('0x8a');var _0x2b0bbb=_0x47f7e7[_0xd5cc('0x8b')]?_0x47f7e7[_0xd5cc('0x8b')]:_0xd5cc('0x8c');var _0x3ff8a6='';var _0x3faadf='';var _0x4c82fd='';var _0x550f64='';var _0x44ae2c=_0x47f7e7[_0xd5cc('0x8d')];if(_0x1dd06e==='html'){if(_0xd5cc('0x22')!=typeof _0x47f7e7[_0xd5cc('0x7d')][_0xd5cc('0x81')][_0xd5cc('0x82')]){var _0x11d4ba=_0x47f7e7['parameters'][_0xd5cc('0x81')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xd5cc('0x8e')](_0x11d4ba)){_0x3ff8a6=path[_0xd5cc('0x52')](_0xd5cc('0x8f'),_0xfca16,_0x4e541e[0x0],_0x11d4ba);}else{_0x3ff8a6=_0x11d4ba;}}else{logger[_0xd5cc('0x6e')](_0xd5cc('0x90'));}if('undefined'!=typeof _0x47f7e7['parameters'][_0xd5cc('0x81')][_0xd5cc('0x83')]){var _0xfeca04=_0x47f7e7[_0xd5cc('0x7d')][_0xd5cc('0x81')][_0xd5cc('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xd5cc('0x8e')](_0xfeca04)){_0x3faadf=path[_0xd5cc('0x52')]('plugins',_0xfca16,_0x4e541e[0x0],_0xfeca04);}else{_0x3faadf=_0xfeca04;}}else{logger[_0xd5cc('0x6e')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x1dd06e===_0xd5cc('0x84')){_0x4c82fd=_0x47f7e7[_0xd5cc('0x7d')]['scriptName'];_0x550f64=_0x47f7e7[_0xd5cc('0x7d')][_0xd5cc('0x87')];if(_0xd5cc('0x22')!=typeof _0x47f7e7[_0xd5cc('0x7d')][_0xd5cc('0x81')]){if(_0xd5cc('0x22')!=typeof _0x47f7e7[_0xd5cc('0x7d')]['views'][_0xd5cc('0x82')]){var _0x11d4ba=_0x47f7e7[_0xd5cc('0x7d')]['views'][_0xd5cc('0x82')];if(!/^(f|ht)tps?:\/\//i[_0xd5cc('0x8e')](_0x11d4ba)){_0x3ff8a6=path[_0xd5cc('0x52')]('plugins',_0xfca16,_0x4e541e[0x0],_0x11d4ba);}else{_0x3ff8a6=_0x11d4ba;}}if(_0xd5cc('0x22')!=typeof _0x47f7e7['parameters'][_0xd5cc('0x81')][_0xd5cc('0x83')]){var _0xfeca04=_0x47f7e7[_0xd5cc('0x7d')][_0xd5cc('0x81')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xd5cc('0x8e')](_0xfeca04)){_0x3faadf=path['join'](_0xd5cc('0x8f'),_0xfca16,_0x4e541e[0x0],_0xfeca04);}else{_0x3faadf=_0xfeca04;}}}}var _0xf18c14={'name':_0x5cb4ec,'description':_0x3c1f65,'path':path[_0xd5cc('0x52')](_0xfca16,_0x4e541e[0x0]),'type':_0x1dd06e,'sidebar':_0x1ed974,'icon':_0x2b0bbb,'adminUrl':_0x3ff8a6,'agentUrl':_0x3faadf,'scriptName':_0x4c82fd,'scriptPath':_0x550f64,'version':_0x44ae2c};removeReferences(_0x4e4799,null);return db['Plugin'][_0xd5cc('0x91')](_0xf18c14)[_0xd5cc('0x2b')](function(_0x51f743){var _0x392553={'role':_0xbe3c64[_0xd5cc('0x92')][_0xd5cc('0x93')],'userProfileId':_0xbe3c64[_0xd5cc('0x92')]['userProfileId']};if(!_0x392553)throw new Error(_0xd5cc('0x94'));if(_0x392553['role']===_0xd5cc('0x95')){var _0x449b3f=_0x51f743['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Plugins','userProfileId':_0x392553[_0xd5cc('0x96')]},'raw':!![]})[_0xd5cc('0x2b')](function(_0x5e8554){if(_0x5e8554&&_0x5e8554[_0xd5cc('0x97')]===0x0){return db[_0xd5cc('0x98')][_0xd5cc('0x91')]({'name':_0x449b3f['name'],'resourceId':_0x449b3f['id'],'type':_0x5e8554[_0xd5cc('0x2f')],'sectionId':_0x5e8554['id']},{})['then'](function(){return _0x51f743;});}else{return _0x51f743;}})['catch'](function(_0x101b49){logger[_0xd5cc('0x2d')](_0xd5cc('0x99'),_0x101b49);throw _0x101b49;});}return _0x51f743;})[_0xd5cc('0x2b')](respondWithResult(_0x507459,null))['catch'](handleError(_0x507459,null));}});}catch(_0x3a9209){_0x507459['status'](0x1f4)[_0xd5cc('0x30')](_0x3a9209);}};function removeReferences(_0x3f452c,_0x20457c){try{if(_0x3f452c){fs[_0xd5cc('0x67')](_0x3f452c);logger[_0xd5cc('0x6e')](_0xd5cc('0x9a'));}if(_0x20457c){rimraf(_0x20457c,function(){});logger['info'](_0xd5cc('0x9b'));}}catch(_0x3ddec6){logger[_0xd5cc('0x2d')](_0x3ddec6);}}exports[_0xd5cc('0x29')]=function(_0x16c59c,_0x4f8734,_0x357f8a){return db[_0xd5cc('0x31')][_0xd5cc('0x51')]({'where':{'id':_0x16c59c[_0xd5cc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4f8734,null))['then'](saveUpdates(_0x16c59c[_0xd5cc('0x92')],null))[_0xd5cc('0x2b')](respondWithResult(_0x4f8734,null))[_0xd5cc('0x4c')](handleError(_0x4f8734,null));};exports[_0xd5cc('0x9c')]=function(_0x1c2e98,_0x5852ca,_0x2b5474){return db[_0xd5cc('0x31')][_0xd5cc('0x51')]({'where':{'id':_0x1c2e98[_0xd5cc('0x4e')]['id']}})[_0xd5cc('0x2b')](function(_0x5e88f7){if(_0x5e88f7){return _0x5e88f7['destroy']();}})['then'](function(_0x9c0245){rimraf(path[_0xd5cc('0x52')](config[_0xd5cc('0x53')],'server/files/plugins',path[_0xd5cc('0x9d')](_0x9c0245[_0xd5cc('0x7')])),function(){});return _0x9c0245;})[_0xd5cc('0x2b')](handleEntityNotFound(_0x5852ca,null))[_0xd5cc('0x2b')](respondWithStatusCode(_0x5852ca,null))['catch'](handleError(_0x5852ca,null));};exports[_0xd5cc('0x9e')]=function(_0x52ffa9,_0x403ef1,_0x93acd7){return BPromise[_0xd5cc('0x9f')]()[_0xd5cc('0x2b')](function(){if(!_0x52ffa9[_0xd5cc('0x37')]['path']){throw new Error(_0xd5cc('0xa0'));}if(!_0x52ffa9[_0xd5cc('0x37')][_0xd5cc('0xa1')]){throw new Error(_0xd5cc('0xa2'));}var _0x1fd42f=_0x52ffa9['query'][_0xd5cc('0xa3')]?_0x52ffa9[_0xd5cc('0x37')][_0xd5cc('0xa3')]+':'+_0x52ffa9[_0xd5cc('0x37')][_0xd5cc('0xa1')]:_0xd5cc('0xa4')+_0x52ffa9['query'][_0xd5cc('0xa1')];var _0x2027ea=_0x52ffa9[_0xd5cc('0x37')][_0xd5cc('0xa5')]?_0x52ffa9[_0xd5cc('0x37')][_0xd5cc('0xa5')]:!![];var _0x594d36=_0x52ffa9[_0xd5cc('0x37')][_0xd5cc('0xa6')]?_0x52ffa9['query']['encoding']:null;var _0x177a9d={'method':_0x52ffa9[_0xd5cc('0xa7')],'uri':util[_0xd5cc('0x54')](_0xd5cc('0xa8'),_0x1fd42f,_0x52ffa9[_0xd5cc('0x37')]['path']),'json':_0x2027ea,'resolveWithFullResponse':!![],'encoding':_0x594d36,'qs':_0x52ffa9[_0xd5cc('0x37')]};if(_0x52ffa9[_0xd5cc('0xa9')]){_0x177a9d['headers']=_0x52ffa9[_0xd5cc('0xa9')];if(_0x177a9d[_0xd5cc('0xa9')][_0xd5cc('0xaa')]){delete _0x177a9d[_0xd5cc('0xa9')]['content-length'];}}if(_0x177a9d[_0xd5cc('0xa9')][_0xd5cc('0xab')]){delete _0x177a9d[_0xd5cc('0xa9')]['content-type'];}return rp(_0x177a9d);})[_0xd5cc('0x2b')](function(_0x4c1391){if(_0x4c1391){_0x403ef1[_0xd5cc('0x26')](_0x4c1391['headers']);logger[_0xd5cc('0x6e')](_0x4c1391[_0xd5cc('0x92')]);if(_[_0xd5cc('0xac')](_0x52ffa9['query']['path'],'download')&&_0x4c1391[_0xd5cc('0xad')]==0x1f4){return _0x403ef1[_0xd5cc('0x1f')](_0x4c1391[_0xd5cc('0xad')]);}else{return _0x403ef1[_0xd5cc('0x20')](_0x4c1391[_0xd5cc('0xad')])[_0xd5cc('0x30')](_0x4c1391[_0xd5cc('0x92')]);}}else{return _0x403ef1[_0xd5cc('0x1f')](0xc8);}})[_0xd5cc('0x4c')](handleError(_0x403ef1,null));};exports[_0xd5cc('0xae')]=function(_0x228068,_0x276840,_0x2b22b5){return BPromise[_0xd5cc('0x9f')]()[_0xd5cc('0x2b')](function(){if(!_0x228068['query']['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x228068[_0xd5cc('0x37')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3c90ea=_0x228068[_0xd5cc('0x37')][_0xd5cc('0xa3')]?_0x228068[_0xd5cc('0x37')][_0xd5cc('0xa3')]+':'+_0x228068[_0xd5cc('0x37')][_0xd5cc('0xa1')]:_0xd5cc('0xa4')+_0x228068['query'][_0xd5cc('0xa1')];var _0x5d7e17=_0x228068['query']['json']?_0x228068[_0xd5cc('0x37')][_0xd5cc('0xa5')]:!![];var _0x5aff7e=_0x228068[_0xd5cc('0x37')][_0xd5cc('0xa6')]?_0x228068[_0xd5cc('0x37')]['encoding']:null;var _0x521b73={'method':_0x228068[_0xd5cc('0xa7')],'uri':util['format']('%s%s',_0x3c90ea,_0x228068[_0xd5cc('0x37')][_0xd5cc('0x7')]),'json':_0x5d7e17,'resolveWithFullResponse':!![],'encoding':_0x5aff7e,'body':_0x228068[_0xd5cc('0x92')]};if(_0x228068[_0xd5cc('0xa9')]){_0x521b73['headers']=_0x228068[_0xd5cc('0xa9')];if(_0x521b73[_0xd5cc('0xa9')][_0xd5cc('0xaa')]){delete _0x521b73[_0xd5cc('0xa9')][_0xd5cc('0xaa')];}}if(_0x521b73[_0xd5cc('0xa9')]['content-type']){delete _0x521b73['headers'][_0xd5cc('0xab')];}return rp(_0x521b73);})[_0xd5cc('0x2b')](function(_0xd40e92){if(_0xd40e92){_0x276840[_0xd5cc('0x26')](_0xd40e92['headers']);logger[_0xd5cc('0x6e')](_0xd40e92[_0xd5cc('0x92')]);return _0x276840[_0xd5cc('0x20')](_0xd40e92[_0xd5cc('0xad')])[_0xd5cc('0x30')](_0xd40e92[_0xd5cc('0x92')]);}else{return _0x276840[_0xd5cc('0x1f')](0xc8);}})[_0xd5cc('0x4c')](handleError(_0x276840,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 0b32f3b..1dc806d 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 _0x1883=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x2f8802,_0x3b6bf2){var _0xa52100=function(_0x17b408){while(--_0x17b408){_0x2f8802['push'](_0x2f8802['shift']());}};_0xa52100(++_0x3b6bf2);}(_0x1883,0xab));var _0x3188=function(_0x24a3b2,_0x30b370){_0x24a3b2=_0x24a3b2-0x0;var _0x1ecf2e=_0x1883[_0x24a3b2];return _0x1ecf2e;};'use strict';var EventEmitter=require(_0x3188('0x0'));var Plugin=require(_0x3188('0x1'))['db'][_0x3188('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x3188('0x3')](0x0);var events={'afterCreate':_0x3188('0x4'),'afterUpdate':_0x3188('0x5'),'afterDestroy':_0x3188('0x6')};function emitEvent(_0x408500){return function(_0x1c7c86,_0x44afb8,_0x46216d){PluginEvents[_0x3188('0x7')](_0x408500+':'+_0x1c7c86['id'],_0x1c7c86);PluginEvents[_0x3188('0x7')](_0x408500,_0x1c7c86);_0x46216d(null);};}for(var e in events){if(events[_0x3188('0x8')](e)){var event=events[e];Plugin[_0x3188('0x9')](e,emitEvent(event));}}module[_0x3188('0xa')]=PluginEvents; \ No newline at end of file +var _0xd5da=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x9ff206,_0xff7b97){var _0x24f4f7=function(_0x5f4bc1){while(--_0x5f4bc1){_0x9ff206['push'](_0x9ff206['shift']());}};_0x24f4f7(++_0xff7b97);}(_0xd5da,0x9f));var _0xad5d=function(_0x39257b,_0x474003){_0x39257b=_0x39257b-0x0;var _0x24cc6b=_0xd5da[_0x39257b];return _0x24cc6b;};'use strict';var EventEmitter=require(_0xad5d('0x0'));var Plugin=require(_0xad5d('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xad5d('0x2')](0x0);var events={'afterCreate':_0xad5d('0x3'),'afterUpdate':_0xad5d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x43a7d5){return function(_0x57a1ae,_0xfb6438,_0x442479){PluginEvents[_0xad5d('0x5')](_0x43a7d5+':'+_0x57a1ae['id'],_0x57a1ae);PluginEvents[_0xad5d('0x5')](_0x43a7d5,_0x57a1ae);_0x442479(null);};}for(var e in events){if(events[_0xad5d('0x6')](e)){var event=events[e];Plugin[_0xad5d('0x7')](e,emitEvent(event));}}module[_0xad5d('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index c41f703..3c4227d 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 _0x90d2=['plugins','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./plugin.attributes','Plugin'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90d2,0x64));var _0x290d=function(_0x574de6,_0x558a28){_0x574de6=_0x574de6-0x0;var _0x4008d9=_0x90d2[_0x574de6];return _0x4008d9;};'use strict';var _=require(_0x290d('0x0'));var util=require(_0x290d('0x1'));var logger=require(_0x290d('0x2'))(_0x290d('0x3'));var moment=require('moment');var BPromise=require(_0x290d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x290d('0x5'));var rimraf=require(_0x290d('0x6'));var config=require(_0x290d('0x7'));var attributes=require(_0x290d('0x8'));module['exports']=function(_0x9f8a74,_0x248a88){return _0x9f8a74['define'](_0x290d('0x9'),attributes,{'tableName':_0x290d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb57=['exports','define','Plugin','plugins','util','api','moment','../../config/environment','./plugin.attributes'];(function(_0x4365e5,_0x241429){var _0x3f2983=function(_0x49877){while(--_0x49877){_0x4365e5['push'](_0x4365e5['shift']());}};_0x3f2983(++_0x241429);}(_0xdb57,0x148));var _0x7db5=function(_0x3111a7,_0x5cca48){_0x3111a7=_0x3111a7-0x0;var _0x1ac4c8=_0xdb57[_0x3111a7];return _0x1ac4c8;};'use strict';var _=require('lodash');var util=require(_0x7db5('0x0'));var logger=require('../../config/logger')(_0x7db5('0x1'));var moment=require(_0x7db5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7db5('0x3'));var attributes=require(_0x7db5('0x4'));module[_0x7db5('0x5')]=function(_0x469607,_0x2831a4){return _0x469607[_0x7db5('0x6')](_0x7db5('0x7'),attributes,{'tableName':_0x7db5('0x8'),'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 2399080..6c396ef 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 _0x237d=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','localhost','redis','./plugin.socket','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','stringify','lodash','util','moment'];(function(_0x108915,_0x479eca){var _0x14d1ed=function(_0x3d206c){while(--_0x3d206c){_0x108915['push'](_0x108915['shift']());}};_0x14d1ed(++_0x479eca);}(_0x237d,0x1d9));var _0xd237=function(_0x248be7,_0x30bf9e){_0x248be7=_0x248be7-0x0;var _0x4f2be9=_0x237d[_0x248be7];return _0x4f2be9;};'use strict';var _=require(_0xd237('0x0'));var util=require(_0xd237('0x1'));var moment=require(_0xd237('0x2'));var BPromise=require(_0xd237('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd237('0x4'));var db=require(_0xd237('0x5'))['db'];var utils=require(_0xd237('0x6'));var logger=require(_0xd237('0x7'))(_0xd237('0x8'));var config=require(_0xd237('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd237('0xa')][_0xd237('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xd237('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd237('0xd')]));require(_0xd237('0xe'))['register'](socket);function respondWithRpcPromise(_0x3dd81f,_0x1475fb,_0x6f2928){return new BPromise(function(_0x3c8135,_0x2111ee){return client[_0xd237('0xf')](_0x3dd81f,_0x6f2928)[_0xd237('0x10')](function(_0x247450){logger[_0xd237('0x11')]('Plugin,\x20%s,\x20%s',_0x1475fb,_0xd237('0x12'));logger[_0xd237('0x13')](_0xd237('0x14'),_0x1475fb,_0xd237('0x12'),JSON['stringify'](_0x247450));if(_0x247450[_0xd237('0x15')]){if(_0x247450[_0xd237('0x15')][_0xd237('0x16')]===0x1f4){logger[_0xd237('0x15')](_0xd237('0x17'),_0x1475fb,_0x247450[_0xd237('0x15')][_0xd237('0x18')]);return _0x2111ee(_0x247450[_0xd237('0x15')][_0xd237('0x18')]);}logger[_0xd237('0x15')](_0xd237('0x17'),_0x1475fb,_0x247450[_0xd237('0x15')][_0xd237('0x18')]);return _0x3c8135(_0x247450['error'][_0xd237('0x18')]);}else{logger[_0xd237('0x11')](_0xd237('0x17'),_0x1475fb,_0xd237('0x12'));_0x3c8135(_0x247450[_0xd237('0x19')][_0xd237('0x18')]);}})[_0xd237('0x1a')](function(_0x3f29e2){logger['error'](_0xd237('0x17'),_0x1475fb,_0x3f29e2);_0x2111ee(_0x3f29e2);});});}exports[_0xd237('0x1b')]=function(_0x6b3c0b){var _0x3265ab=this;return new Promise(function(_0x27d7d3,_0x19bfb8){return db[_0xd237('0x1c')][_0xd237('0x1d')](_0x6b3c0b[_0xd237('0x1e')],{'raw':_0x6b3c0b[_0xd237('0x1f')]?_0x6b3c0b[_0xd237('0x1f')][_0xd237('0x20')]===undefined?!![]:![]:!![]})[_0xd237('0x10')](function(_0x343ea1){logger[_0xd237('0x11')]('CreatePlugin',_0x6b3c0b);logger[_0xd237('0x13')]('CreatePlugin',_0x6b3c0b,JSON[_0xd237('0x21')](_0x343ea1));_0x27d7d3(_0x343ea1);})[_0xd237('0x1a')](function(_0x203aac){logger[_0xd237('0x15')]('CreatePlugin',_0x203aac[_0xd237('0x18')],_0x6b3c0b);_0x19bfb8(_0x3265ab[_0xd237('0x15')](0x1f4,_0x203aac[_0xd237('0x18')]));});});}; \ No newline at end of file +var _0x4e4a=['message','result','catch','Plugin','body','options','raw','info','CreatePlugin','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./plugin.socket','register','request','then','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','code','error','Plugin,\x20%s,\x20%s'];(function(_0x56e813,_0x2f7fe0){var _0x2ae2a4=function(_0x526bfd){while(--_0x526bfd){_0x56e813['push'](_0x56e813['shift']());}};_0x2ae2a4(++_0x2f7fe0);}(_0x4e4a,0x15d));var _0xa4e4=function(_0x633b45,_0x587877){_0x633b45=_0x633b45-0x0;var _0x4fb2ff=_0x4e4a[_0x633b45];return _0x4fb2ff;};'use strict';var _=require(_0xa4e4('0x0'));var util=require(_0xa4e4('0x1'));var moment=require(_0xa4e4('0x2'));var BPromise=require(_0xa4e4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4e4('0x4'));var db=require(_0xa4e4('0x5'))['db'];var utils=require(_0xa4e4('0x6'));var logger=require(_0xa4e4('0x7'))(_0xa4e4('0x8'));var config=require(_0xa4e4('0x9'));var jayson=require(_0xa4e4('0xa'));var client=jayson['client'][_0xa4e4('0xb')]({'port':0x232a});config['redis']=_[_0xa4e4('0xc')](config[_0xa4e4('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa4e4('0xe'))(new Redis(config[_0xa4e4('0xd')]));require(_0xa4e4('0xf'))[_0xa4e4('0x10')](socket);function respondWithRpcPromise(_0x2fbe3a,_0x5926e9,_0x36cfda){return new BPromise(function(_0x37f60d,_0x2a7a91){return client[_0xa4e4('0x11')](_0x2fbe3a,_0x36cfda)[_0xa4e4('0x12')](function(_0x1b4eb6){logger['info']('Plugin,\x20%s,\x20%s',_0x5926e9,_0xa4e4('0x13'));logger[_0xa4e4('0x14')](_0xa4e4('0x15'),_0x5926e9,_0xa4e4('0x13'),JSON['stringify'](_0x1b4eb6));if(_0x1b4eb6['error']){if(_0x1b4eb6['error'][_0xa4e4('0x16')]===0x1f4){logger[_0xa4e4('0x17')](_0xa4e4('0x18'),_0x5926e9,_0x1b4eb6[_0xa4e4('0x17')][_0xa4e4('0x19')]);return _0x2a7a91(_0x1b4eb6['error'][_0xa4e4('0x19')]);}logger[_0xa4e4('0x17')](_0xa4e4('0x18'),_0x5926e9,_0x1b4eb6[_0xa4e4('0x17')][_0xa4e4('0x19')]);return _0x37f60d(_0x1b4eb6[_0xa4e4('0x17')][_0xa4e4('0x19')]);}else{logger['info'](_0xa4e4('0x18'),_0x5926e9,_0xa4e4('0x13'));_0x37f60d(_0x1b4eb6[_0xa4e4('0x1a')][_0xa4e4('0x19')]);}})[_0xa4e4('0x1b')](function(_0x80f7d7){logger[_0xa4e4('0x17')](_0xa4e4('0x18'),_0x5926e9,_0x80f7d7);_0x2a7a91(_0x80f7d7);});});}exports['CreatePlugin']=function(_0x3057e5){var _0x542d94=this;return new Promise(function(_0x5962d4,_0x2f4e86){return db[_0xa4e4('0x1c')]['create'](_0x3057e5[_0xa4e4('0x1d')],{'raw':_0x3057e5[_0xa4e4('0x1e')]?_0x3057e5[_0xa4e4('0x1e')][_0xa4e4('0x1f')]===undefined?!![]:![]:!![]})[_0xa4e4('0x12')](function(_0x1b2332){logger[_0xa4e4('0x20')](_0xa4e4('0x21'),_0x3057e5);logger[_0xa4e4('0x14')]('CreatePlugin',_0x3057e5,JSON['stringify'](_0x1b2332));_0x5962d4(_0x1b2332);})[_0xa4e4('0x1b')](function(_0x27a5f4){logger[_0xa4e4('0x17')](_0xa4e4('0x21'),_0x27a5f4[_0xa4e4('0x19')],_0x3057e5);_0x2f4e86(_0x542d94[_0xa4e4('0x17')](0x1f4,_0x27a5f4[_0xa4e4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index f5e6ef3..eb0c313 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 _0xbcf6=['update','removeListener','register','length','plugin:','./plugin.events','save','remove'];(function(_0x593080,_0x916de1){var _0x4fde56=function(_0x1631f1){while(--_0x1631f1){_0x593080['push'](_0x593080['shift']());}};_0x4fde56(++_0x916de1);}(_0xbcf6,0x13d));var _0x6bcf=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0xbcf6[_0x4521e3];return _0x46a272;};'use strict';var PluginEvents=require(_0x6bcf('0x0'));var events=[_0x6bcf('0x1'),_0x6bcf('0x2'),_0x6bcf('0x3')];function createListener(_0x1bcb5d,_0x1bea1d){return function(_0x416ea2){_0x1bea1d['emit'](_0x1bcb5d,_0x416ea2);};}function removeListener(_0x40f885,_0x43e233){return function(){PluginEvents[_0x6bcf('0x4')](_0x40f885,_0x43e233);};}exports[_0x6bcf('0x5')]=function(_0x3bdbea){for(var _0xded714=0x0,_0x3b57f9=events[_0x6bcf('0x6')];_0xded714<_0x3b57f9;_0xded714++){var _0x39dab1=events[_0xded714];var _0x530929=createListener(_0x6bcf('0x7')+_0x39dab1,_0x3bdbea);PluginEvents['on'](_0x39dab1,_0x530929);}}; \ No newline at end of file +var _0x885b=['update','emit','length','./plugin.events','save','remove'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x885b,0x105));var _0xb885=function(_0x106f9e,_0x12edc6){_0x106f9e=_0x106f9e-0x0;var _0x5b0204=_0x885b[_0x106f9e];return _0x5b0204;};'use strict';var PluginEvents=require(_0xb885('0x0'));var events=[_0xb885('0x1'),_0xb885('0x2'),_0xb885('0x3')];function createListener(_0x1a1f02,_0x33d08b){return function(_0x18a74f){_0x33d08b[_0xb885('0x4')](_0x1a1f02,_0x18a74f);};}function removeListener(_0x4eb2ba,_0x3f1fb5){return function(){PluginEvents['removeListener'](_0x4eb2ba,_0x3f1fb5);};}exports['register']=function(_0x4b80c3){for(var _0x5bb128=0x0,_0x3787f7=events[_0xb885('0x5')];_0x5bb128<_0x3787f7;_0x5bb128++){var _0x17f061=events[_0x5bb128];var _0x20fc99=createListener('plugin:'+_0x17f061,_0x4b80c3);PluginEvents['on'](_0x17f061,_0x20fc99);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 0d68620..2bb7203 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(_0x358f9e,_0x13de6c){var _0x2038b9=function(_0x5b6844){while(--_0x5b6844){_0x358f9e['push'](_0x358f9e['shift']());}};_0x2038b9(++_0x13de6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x30aaf8,_0x45433d){var _0x5d735f=function(_0x5a6d6a){while(--_0x5a6d6a){_0x30aaf8['push'](_0x30aaf8['shift']());}};_0x5d735f(++_0x45433d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 9e2bc4a..c405183 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 _0xb469=['motion2','show','create','body','join','../../files/plugins','chdir','dirname','start','dump','catch','status','update','restart','hasOwnProperty','params','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','sendStatus','error','stack','name','send','info','index','list','then','reject','express'];(function(_0x5d3dab,_0x266f2a){var _0x1c6002=function(_0x1b3e92){while(--_0x1b3e92){_0x5d3dab['push'](_0x5d3dab['shift']());}};_0x1c6002(++_0x266f2a);}(_0xb469,0x13b));var _0x9b46=function(_0x383dcb,_0x44d367){_0x383dcb=_0x383dcb-0x0;var _0x2f454d=_0xb469[_0x383dcb];return _0x2f454d;};'use strict';var _=require(_0x9b46('0x0'));var pm2=require(_0x9b46('0x1'));var logger=require(_0x9b46('0x2'))(_0x9b46('0x3'));var path=require(_0x9b46('0x4'));var exec=require(_0x9b46('0x5'))[_0x9b46('0x6')];var BPromise=require('bluebird');function handleEntityNotFound(_0x31f853,_0x45322f){return function(_0x538fc4){if(!_0x538fc4){_0x31f853[_0x9b46('0x7')](0x194);;}return _0x538fc4;};}function respondWithResult(_0x405d1c,_0x50b49e){_0x50b49e=_0x50b49e||0xc8;return function(_0x1b2dd3){if(_0x1b2dd3){return _0x405d1c['status'](_0x50b49e)['json'](_0x1b2dd3);}return null;};}function handleError(_0x34c0de,_0x545b6c){_0x545b6c=_0x545b6c||0x1f4;return function(_0x402595){logger[_0x9b46('0x8')](_0x402595[_0x9b46('0x9')]);if(_0x402595['name']){delete _0x402595[_0x9b46('0xa')];}_0x34c0de['status'](_0x545b6c)[_0x9b46('0xb')](_0x402595);};}function execChildProcess(){return new BPromise(function(_0x568d9a,_0x2c29a7){exec('npm\x20install',function(_0x672157,_0x233b6b,_0x563de4){logger[_0x9b46('0xc')](_0x233b6b);logger[_0x9b46('0xc')](_0x563de4);if(_0x672157){logger['error'](_0x672157);return _0x2c29a7(_0x672157);}return _0x568d9a(_0x233b6b);});});}exports[_0x9b46('0xd')]=function(_0x2cfb35,_0x3d9618){return pm2[_0x9b46('0xe')]()[_0x9b46('0xf')](function(_0x35c5c1){if(_0x35c5c1){var _0x2136bc=_[_0x9b46('0x10')](_0x35c5c1,function(_0x3f2b28){return _0x3f2b28[_0x9b46('0xa')]===_0x9b46('0x11')||_0x3f2b28[_0x9b46('0xa')]===_0x9b46('0x12');});return{'rows':_0x2136bc,'count':_0x2136bc['length']};}return null;})['then'](respondWithResult(_0x3d9618,null))['catch'](handleError(_0x3d9618,null));};exports[_0x9b46('0x13')]=function(_0x5a380c,_0x29fec9){return pm2['describe'](_0x5a380c['params']['id'])[_0x9b46('0xf')](respondWithResult(_0x29fec9,null))['then'](handleEntityNotFound(_0x29fec9,null))['catch'](handleError(_0x29fec9,null));};exports[_0x9b46('0x14')]=function(_0x3a15cc,_0x5a0d25){if(_0x3a15cc[_0x9b46('0x15')][_0x9b46('0xa')]&&_0x3a15cc['body']['script']){var _0xbec2ea=path[_0x9b46('0x16')](__dirname,_0x9b46('0x17'),_0x3a15cc['body']['script']);var _0x2b3440=process['cwd']();process[_0x9b46('0x18')](path[_0x9b46('0x19')](_0xbec2ea));return execChildProcess()['then'](function(_0xadff19){process['chdir'](_0x2b3440);return pm2[_0x9b46('0x1a')]({'name':_0x3a15cc[_0x9b46('0x15')]['name'],'script':_0xbec2ea});})[_0x9b46('0xf')](function(_0x31ca63){pm2[_0x9b46('0x1b')]();return _0x31ca63[0x0];})[_0x9b46('0xf')](respondWithResult(_0x5a0d25,0xc9))[_0x9b46('0x1c')](handleError(_0x5a0d25,null));}else{return _0x5a0d25[_0x9b46('0x1d')](0x1f4)[_0x9b46('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x9b46('0x1e')]=function(_0x3ac37e,_0x478105){if(_0x3ac37e[_0x9b46('0x15')]['id']){delete _0x3ac37e[_0x9b46('0x15')]['id'];}var _0x2a79a5={'online':_0x9b46('0x1f'),'stopped':'stop'};if(_0x2a79a5[_0x9b46('0x20')](_0x3ac37e[_0x9b46('0x15')][_0x9b46('0x1d')])){return pm2[_0x2a79a5[_0x3ac37e[_0x9b46('0x15')][_0x9b46('0x1d')]]](_0x3ac37e[_0x9b46('0x21')]['id'])[_0x9b46('0xf')](respondWithResult(_0x478105,0xc8))[_0x9b46('0x1c')](handleError(_0x478105,null));}else{return _0x478105[_0x9b46('0x1d')](0x1f4)[_0x9b46('0xb')]({'message':_0x9b46('0x22')});}};exports['destroy']=function(_0x1f722d,_0x27f326){if(_0x1f722d[_0x9b46('0x15')]['id']){delete _0x1f722d[_0x9b46('0x15')]['id'];}if(_0x1f722d[_0x9b46('0x21')]['id']){return pm2[_0x9b46('0x23')](_0x1f722d[_0x9b46('0x21')]['id'])[_0x9b46('0xf')](function(_0x3ab49a){pm2[_0x9b46('0x1b')]();return _0x3ab49a[0x0];})[_0x9b46('0xf')](respondWithResult(_0x27f326,null))['catch'](handleError(_0x27f326,null));}else{return _0x27f326[_0x9b46('0x1d')](0x1f4)['send']({'message':_0x9b46('0x24')});}}; \ No newline at end of file +var _0xf290=['reject','express','length','catch','show','params','create','body','script','join','cwd','chdir','start','dump','Missing\x20name\x20and/or\x20path','stop','hasOwnProperty','Unknown\x20id','../../config/pm2','api','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','send','info','index','list','then'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xf290,0xde));var _0x0f29=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xf290[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var pm2=require(_0x0f29('0x0'));var logger=require('../../config/logger')(_0x0f29('0x1'));var path=require('path');var exec=require(_0x0f29('0x2'))[_0x0f29('0x3')];var BPromise=require(_0x0f29('0x4'));function handleEntityNotFound(_0x28b644,_0xfdab92){return function(_0x5984ba){if(!_0x5984ba){_0x28b644[_0x0f29('0x5')](0x194);;}return _0x5984ba;};}function respondWithResult(_0x4911fb,_0x2d5350){_0x2d5350=_0x2d5350||0xc8;return function(_0x1c45ec){if(_0x1c45ec){return _0x4911fb[_0x0f29('0x6')](_0x2d5350)[_0x0f29('0x7')](_0x1c45ec);}return null;};}function handleError(_0xc78ca2,_0x45350b){_0x45350b=_0x45350b||0x1f4;return function(_0x2be26e){logger[_0x0f29('0x8')](_0x2be26e[_0x0f29('0x9')]);if(_0x2be26e[_0x0f29('0xa')]){delete _0x2be26e[_0x0f29('0xa')];}_0xc78ca2[_0x0f29('0x6')](_0x45350b)[_0x0f29('0xb')](_0x2be26e);};}function execChildProcess(){return new BPromise(function(_0xbcdea8,_0x5cc052){exec('npm\x20install',function(_0x38eb8f,_0x5f4796,_0xc11f21){logger[_0x0f29('0xc')](_0x5f4796);logger[_0x0f29('0xc')](_0xc11f21);if(_0x38eb8f){logger[_0x0f29('0x8')](_0x38eb8f);return _0x5cc052(_0x38eb8f);}return _0xbcdea8(_0x5f4796);});});}exports[_0x0f29('0xd')]=function(_0x2d2573,_0x5519cf){return pm2[_0x0f29('0xe')]()[_0x0f29('0xf')](function(_0x2bb7b8){if(_0x2bb7b8){var _0x368984=_[_0x0f29('0x10')](_0x2bb7b8,function(_0x2ed9c5){return _0x2ed9c5[_0x0f29('0xa')]===_0x0f29('0x11')||_0x2ed9c5['name']==='motion2';});return{'rows':_0x368984,'count':_0x368984[_0x0f29('0x12')]};}return null;})[_0x0f29('0xf')](respondWithResult(_0x5519cf,null))[_0x0f29('0x13')](handleError(_0x5519cf,null));};exports[_0x0f29('0x14')]=function(_0x4b3f0b,_0x122bfa){return pm2['describe'](_0x4b3f0b[_0x0f29('0x15')]['id'])['then'](respondWithResult(_0x122bfa,null))['then'](handleEntityNotFound(_0x122bfa,null))['catch'](handleError(_0x122bfa,null));};exports[_0x0f29('0x16')]=function(_0x8fc03f,_0x13e8ff){if(_0x8fc03f[_0x0f29('0x17')][_0x0f29('0xa')]&&_0x8fc03f[_0x0f29('0x17')][_0x0f29('0x18')]){var _0x4888b6=path[_0x0f29('0x19')](__dirname,'../../files/plugins',_0x8fc03f['body']['script']);var _0x5d94b9=process[_0x0f29('0x1a')]();process[_0x0f29('0x1b')](path['dirname'](_0x4888b6));return execChildProcess()[_0x0f29('0xf')](function(_0x1840e0){process[_0x0f29('0x1b')](_0x5d94b9);return pm2[_0x0f29('0x1c')]({'name':_0x8fc03f[_0x0f29('0x17')]['name'],'script':_0x4888b6});})[_0x0f29('0xf')](function(_0x5a440f){pm2[_0x0f29('0x1d')]();return _0x5a440f[0x0];})[_0x0f29('0xf')](respondWithResult(_0x13e8ff,0xc9))[_0x0f29('0x13')](handleError(_0x13e8ff,null));}else{return _0x13e8ff[_0x0f29('0x6')](0x1f4)['send']({'message':_0x0f29('0x1e')});}};exports['update']=function(_0x58b201,_0x92876){if(_0x58b201['body']['id']){delete _0x58b201['body']['id'];}var _0x57dcc7={'online':'restart','stopped':_0x0f29('0x1f')};if(_0x57dcc7[_0x0f29('0x20')](_0x58b201['body'][_0x0f29('0x6')])){return pm2[_0x57dcc7[_0x58b201[_0x0f29('0x17')][_0x0f29('0x6')]]](_0x58b201['params']['id'])['then'](respondWithResult(_0x92876,0xc8))[_0x0f29('0x13')](handleError(_0x92876,null));}else{return _0x92876['status'](0x1f4)[_0x0f29('0xb')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x7b10f,_0x409b19){if(_0x7b10f[_0x0f29('0x17')]['id']){delete _0x7b10f[_0x0f29('0x17')]['id'];}if(_0x7b10f['params']['id']){return pm2['delete'](_0x7b10f[_0x0f29('0x15')]['id'])['then'](function(_0x4a4cf2){pm2[_0x0f29('0x1d')]();return _0x4a4cf2[0x0];})['then'](respondWithResult(_0x409b19,null))[_0x0f29('0x13')](handleError(_0x409b19,null));}else{return _0x409b19['status'](0x1f4)['send']({'message':_0x0f29('0x21')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 1b257c5..3c2b7d7 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 _0xe0f5=['../../components/auth/service','./realtime.controller','get','/agents','getAgents','/queues','getQueues','Router'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe0f5,0x177));var _0x5e0f=function(_0xfeee3,_0x273c02){_0xfeee3=_0xfeee3-0x0;var _0x419008=_0xe0f5[_0xfeee3];return _0x419008;};'use strict';var express=require('express');var router=express[_0x5e0f('0x0')]();var auth=require(_0x5e0f('0x1'));var controller=require(_0x5e0f('0x2'));router[_0x5e0f('0x3')](_0x5e0f('0x4'),auth['isAuthenticated'](),controller[_0x5e0f('0x5')]);router['get'](_0x5e0f('0x6'),auth['isAuthenticated'](),controller[_0x5e0f('0x7')]);module['exports']=router; \ No newline at end of file +var _0xc144=['getAgents','/queues','isAuthenticated','getQueues','exports','express','Router','./realtime.controller','get','/agents'];(function(_0xd2f4ac,_0x5aa8e5){var _0x9757b2=function(_0x442ced){while(--_0x442ced){_0xd2f4ac['push'](_0xd2f4ac['shift']());}};_0x9757b2(++_0x5aa8e5);}(_0xc144,0x145));var _0x4c14=function(_0x2c48ff,_0x3b7b12){_0x2c48ff=_0x2c48ff-0x0;var _0x141cb7=_0xc144[_0x2c48ff];return _0x141cb7;};'use strict';var express=require(_0x4c14('0x0'));var router=express[_0x4c14('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x4c14('0x2'));router[_0x4c14('0x3')](_0x4c14('0x4'),auth['isAuthenticated'](),controller[_0x4c14('0x5')]);router['get'](_0x4c14('0x6'),auth[_0x4c14('0x7')](),controller[_0x4c14('0x8')]);module[_0x4c14('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 2f06aee..9703828 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 _0x3d92=['sort','globalStatus','validateSortParameter','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','rawAttributes','fieldName','type','role','agent','getOptions','raw','sequelize','literal','FIELD(id,','forEach','where','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','getResources','filterAgentAttributes','getAgentStatus','Status','sortAgentsByStatus','Queue','key','QueueCampaigns','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','client','http','offset','undefined','limit','count','set','Content-Range','json','error','stack','name','status','request','startCase','Queues','then','result','catch','available','waiting','talking','paused','voice','outbound','push','pTalking','originated','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','agents','loggedInDb','loggedIn','find','merge','length','busy','connectedlinenum','internal','toString','UserId','accountcode','online','voiceStatus','User','Pause','findAll','includes','toLowerCase','Invalid\x20channel','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','channel'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3d92,0x109));var _0x23d9=function(_0x1e7701,_0x13fd0f){_0x1e7701=_0x1e7701-0x0;var _0x3ab707=_0x3d92[_0x1e7701];return _0x3ab707;};'use strict';var util=require('util');var _=require('lodash');var jayson=require(_0x23d9('0x0'));var rta=require(_0x23d9('0x1'));var qs=require(_0x23d9('0x2'));var utils=require('../../config/utils');var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x23d9('0x3')][_0x23d9('0x4')]({'port':0x232a});var routingClient=jayson[_0x23d9('0x3')][_0x23d9('0x4')]({'port':0x232c});function respondWithFilteredResult(_0x446d62,_0x29461e){return function(_0x6cee1e){if(_0x6cee1e){var _0x4ccd32=typeof _0x29461e[_0x23d9('0x5')]===_0x23d9('0x6')&&typeof _0x29461e[_0x23d9('0x7')]==='undefined';var _0x451057=_0x6cee1e[_0x23d9('0x8')];var _0x46565b=_0x4ccd32?0x0:_0x29461e[_0x23d9('0x5')];var _0x2934df=_0x4ccd32?_0x6cee1e[_0x23d9('0x8')]:_0x29461e['offset']+_0x29461e['limit'];var _0x3e7b53;if(_0x2934df>=_0x451057){_0x2934df=_0x451057;_0x3e7b53=0xc8;}else{_0x3e7b53=0xce;}_0x446d62['status'](_0x3e7b53);return _0x446d62[_0x23d9('0x9')](_0x23d9('0xa'),_0x46565b+'-'+_0x2934df+'/'+_0x451057)[_0x23d9('0xb')](_0x6cee1e);}return null;};}function handleError(_0xc7f77c,_0x385738){_0x385738=_0x385738||0x1f4;return function(_0x1a56b4){logger[_0x23d9('0xc')](_0x1a56b4[_0x23d9('0xd')]);if(_0x1a56b4[_0x23d9('0xe')]){delete _0x1a56b4[_0x23d9('0xe')];}_0xc7f77c[_0x23d9('0xf')](_0x385738)['send'](_0x1a56b4);};}function getRealtimeQueues(_0x1e4470,_0x1adec1){return new Promise(function(_0x174820,_0x59231f){var _0x34e672=_0x1adec1==='voice'?amiClient:routingClient;return _0x34e672[_0x23d9('0x10')](_[_0x23d9('0x11')](_0x1adec1)+_0x23d9('0x12'),_0x1e4470)[_0x23d9('0x13')](function(_0x384c54){if(_0x384c54[_0x23d9('0xc')])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x1adec1));return _0x174820(_0x384c54[_0x23d9('0x14')]);})[_0x23d9('0x15')](function(_0x2d0b04){_0x59231f(_0x2d0b04);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x148469,_0x5a04f0){return amiClient[_0x23d9('0x10')]('VoiceQueuesChannels',{})[_0x23d9('0x13')](function(_0x1abae8){if(_0x1abae8[_0x23d9('0xc')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x148469(_0x1abae8[_0x23d9('0x14')]);})[_0x23d9('0x15')](function(_0x27a9ca){_0x5a04f0(_0x27a9ca);});});}function initializeQueues(_0x390e6d,_0x55e613,_0x48fa08,_0x56ba43){var _0x4d42d2=['loggedIn',_0x23d9('0x16'),_0x23d9('0x17'),_0x23d9('0x18'),_0x23d9('0x19')];if(_0x48fa08===_0x23d9('0x1a')&&_0x56ba43===_0x23d9('0x1b')){_0x4d42d2[_0x23d9('0x1c')](_0x23d9('0x1d'),_0x23d9('0x1e'),'message',_0x23d9('0x1f'),_0x23d9('0x20'),_0x23d9('0x21'),_0x23d9('0x22'),_0x23d9('0x23'),_0x23d9('0x24'),_0x23d9('0x25'),_0x23d9('0x26'),_0x23d9('0x27'),'dialPredictiveInterval',_0x23d9('0x28'),_0x23d9('0x29'),'predictiveIntervalAvailable','predictiveIntervalTotalCalls',_0x23d9('0x2a'),_0x23d9('0x2b'),_0x23d9('0x2c'),_0x23d9('0x2d'),_0x23d9('0x2e'));}return _0x390e6d[_0x23d9('0x2f')](function(_0xe531c3){var _0x579b76=_0xe531c3['get']({'plain':!![]});_0x579b76[_0x23d9('0x30')]=[];_0x579b76[_0x23d9('0x19')]=0x0;_0x579b76[_0x23d9('0x31')]=0x0;_0x579b76[_0x23d9('0x32')]=0x0;_0x579b76[_0x23d9('0x16')]=0x0;_0x579b76[_0x23d9('0x17')]=0x0;if(_0x48fa08==='voice'){_0x579b76[_0x23d9('0x18')]=0x0;_0x579b76['busy']=0x0;if(_0x56ba43===_0x23d9('0x1b')){_0x579b76[_0x23d9('0x1d')]=0x0;_0x579b76['originated']=0x0;}}var _0x3bdcc6=_[_0x23d9('0x33')](_0x55e613,['id',_0x579b76['id']]);if(_0x3bdcc6)_[_0x23d9('0x34')](_0x579b76,_['pick'](_0x3bdcc6,_0x4d42d2));return _0x579b76;});}function updateAgentVoiceStatus(_0x359a6b,_0x54be2c,_0xe81b5b){var _0x3a4dbd=_['filter'](_0xe81b5b,['queue',_0x54be2c['name']]);if(_0x3a4dbd[_0x23d9('0x35')]===0x0)return _0x359a6b[_0x23d9('0x36')]=!![];if(_['some'](_0x3a4dbd,[_0x23d9('0x37'),_0x359a6b[_0x23d9('0x38')][_0x23d9('0x39')]()]))return _0x359a6b['talking']=!![];if(!_0x359a6b['talking'])return _0x359a6b[_0x23d9('0x36')]=!![];}function getVoiceQueueAgents(_0x24e742,_0x5133ca,_0x2932a7,_0x48cd8a){var _0x35338f=_[_0x23d9('0x33')](_0x5133ca,['id',_0x24e742['id']]);if(!_0x35338f)return _0x24e742;return _0x35338f['getMembers']({'raw':!![]})[_0x23d9('0x13')](function(_0x7a00c9){for(var _0x4ab27d=0x0;_0x4ab27d<_0x7a00c9[_0x23d9('0x35')];_0x4ab27d++){var _0x3fb9fc=_[_0x23d9('0x33')](_0x2932a7,['id',_0x7a00c9[_0x4ab27d]['UserId']]);if(!_0x3fb9fc){_0x3fb9fc={'id':_0x7a00c9[_0x4ab27d][_0x23d9('0x3a')],'name':_0x7a00c9[_0x4ab27d]['UserId'],'accountcode':'','online':![]};}var _0x300cd3={'id':_0x3fb9fc['id'],'name':_0x3fb9fc[_0x23d9('0xe')],'internal':_0x3fb9fc[_0x23d9('0x3b')],'online':Boolean(_0x3fb9fc[_0x23d9('0x3c')]),'paused':Boolean(_0x7a00c9[_0x4ab27d]['paused'])};if(_0x3fb9fc[_0x23d9('0x3d')]===_0x23d9('0x18'))updateAgentVoiceStatus(_0x300cd3,_0x24e742,_0x48cd8a);if(_0x300cd3[_0x23d9('0x3c')])_0x24e742[_0x23d9('0x31')]++;if(_0x300cd3[_0x23d9('0x36')])_0x24e742[_0x23d9('0x36')]++;if(_0x300cd3[_0x23d9('0x19')]&&!_0x300cd3['busy']&&!_0x300cd3['talking'])_0x24e742[_0x23d9('0x19')]++;_0x24e742['agents'][_0x23d9('0x1c')](_0x300cd3);}return _0x24e742;});}function getQueueAgents(_0x38da13,_0x595e6a,_0xc65e53){var _0x2dc04e=_0x23d9('0x3e')+_['startCase'](_0xc65e53)+'Queue';var _0x5c6868=_0xc65e53+_0x23d9('0x3f');return db[_0x2dc04e][_0x23d9('0x40')]({'where':{[_[_0x23d9('0x11')](_0xc65e53)+'QueueId']:_0x38da13['id']},'raw':!![]})['then'](function(_0x22ff76){for(var _0x4748d9=0x0;_0x4748d9<_0x22ff76[_0x23d9('0x35')];_0x4748d9++){var _0x2115aa=_[_0x23d9('0x33')](_0x595e6a,['id',_0x22ff76[_0x4748d9][_0x23d9('0x3a')]]);if(!_0x2115aa){_0x2115aa={'id':_0x22ff76[_0x4748d9]['UserId'],'name':_0x22ff76[_0x4748d9]['UserId'],'online':![],['pauseField']:![]};}var _0x2ba1b5={'id':_0x2115aa['id'],'name':_0x2115aa['name'],'online':Boolean(_0x2115aa[_0x23d9('0x3c')]),'paused':Boolean(_0x2115aa[_0x5c6868])};if(_0x2ba1b5[_0x23d9('0x3c')])_0x38da13[_0x23d9('0x31')]++;_0x38da13[_0x23d9('0x30')][_0x23d9('0x1c')](_0x2ba1b5);}return _0x38da13;});}function validateChannel(_0x23fccc){var _0x49e526=utils['getChannels']();if(!_[_0x23d9('0x41')](_0x49e526,_0x23fccc[_0x23d9('0x42')]()))throw new Error(_0x23d9('0x43'));return _0x23fccc[_0x23d9('0x42')]();}exports['getAgents']=function(_0x22736e,_0x139851){var _0xae6ad7={'count':0x0,'rows':[]};var _0x3e7512={};var _0x782a0b;var _0x10482a;var _0x11fd63;var _0x3f3f36;var _0x23959a=utils[_0x23d9('0x44')]();var _0x583faa=_0x22736e[_0x23d9('0x45')][_0x23d9('0x46')];var _0xb4404d=_0x22736e[_0x23d9('0x45')][_0x23d9('0x47')];var _0x48e334=_0x22736e[_0x23d9('0x45')][_0x23d9('0x48')];var _0x2005dc=_0xb4404d===_0x23d9('0x49')||_0xb4404d===_0x23d9('0x4a')?!![]:![];var _0x46fee2=[];var _0x97b58a;Promise[_0x23d9('0x4b')]()[_0x23d9('0x13')](function(){if(_0x22736e['query'][_0x23d9('0x4c')]){_0x782a0b=validateChannel(_0x22736e['query'][_0x23d9('0x4c')]);}if(!_0x22736e[_0x23d9('0x45')][_0x23d9('0x4d')]||!_0x22736e[_0x23d9('0x45')][_0x23d9('0x4d')]['includes'](_0x23d9('0x4e'))){_0x22736e[_0x23d9('0x45')][_0x23d9('0x4d')]=rta[_0x23d9('0x4f')](_0x22736e[_0x23d9('0x45')][_0x23d9('0x4d')]);return;}var _0x25c196=rta['getUpdatedSortOptions'](_0x22736e[_0x23d9('0x45')][_0x23d9('0x4d')]);_0x22736e[_0x23d9('0x45')][_0x23d9('0x4d')]=_0x25c196[_0x23d9('0x50')][_0x23d9('0x51')](',');_0x10482a=_0x25c196[_0x23d9('0x52')];})[_0x23d9('0x13')](function(){if(!_0x583faa){return[];}return rta[_0x23d9('0x53')](_0x583faa,_0x782a0b);})[_0x23d9('0x13')](function(_0x4868ca){_0x46fee2=_0x4868ca;return rta[_0x23d9('0x54')]();})[_0x23d9('0x13')](function(_0x2bd959){_0x3f3f36=_0x2bd959[_0x23d9('0x55')];if((!_0xb4404d||_0x2005dc)&&!_0x10482a){return _0x46fee2;}if(_0x10482a&&!_0xb4404d){return rta[_0x23d9('0x56')](_0x3f3f36,_0x46fee2,_0x10482a);}else{return rta[_0x23d9('0x57')](_0x3f3f36,_0x46fee2,_0xb4404d);}})[_0x23d9('0x13')](function(_0x46e1ee){_0x46fee2=_0x46e1ee;var _0x2931c4=![];if(_0x46fee2[_0x23d9('0x35')]===0x0){if(_0x583faa||_0xb4404d){_0x2931c4=!![];}if(_0x2005dc){_0x2931c4=![];}}if(_0x2931c4){return _0xae6ad7;}var _0x30fb8d=_[_0x23d9('0x2f')](db[_0x23d9('0x3e')][_0x23d9('0x58')],function(_0x846c7e){return{'name':_0x846c7e[_0x23d9('0x59')],'type':_0x846c7e[_0x23d9('0x5a')]['key']};});_0x22736e[_0x23d9('0x45')][_0x23d9('0x5b')]=_0x23d9('0x5c');_0x22736e['query'][_0x23d9('0x3c')]=!![];_0x3e7512=qs[_0x23d9('0x5d')](_0x30fb8d,_0x22736e);_0x3e7512[_0x23d9('0x5e')]=!![];var _0x3f8332=[];if(_0x46fee2['length']>0x0){_0x3f8332[_0x23d9('0x1c')]({'id':{'$in':_0x46fee2}});if(_0x10482a&&!_0xb4404d){_0x97b58a=[db[_0x23d9('0x5f')][_0x23d9('0x60')](_0x23d9('0x61')+_0x46fee2+')')];_0x3e7512[_0x23d9('0x52')]=_0x97b58a;}}if(_0x2005dc){_0x23959a[_0x23d9('0x62')](function(_0x15d524){var _0x3fd8f6=!![];if(_0xb4404d===_0x23d9('0x4a')&&_0x782a0b!==_0x15d524){_0x3fd8f6=![];}_0x3f8332[_0x23d9('0x1c')]({[_0x15d524+_0x23d9('0x3f')]:_0x3fd8f6});});if(_0x48e334){_0x3f8332['push']({'pauseType':_0x48e334});}}else if(_0xb4404d){_0x23959a[_0x23d9('0x62')](function(_0x840839){_0x3f8332['push']({[_0x840839+_0x23d9('0x3f')]:![]});});}_0x3e7512[_0x23d9('0x63')]=_[_0x23d9('0x34')](_0x3e7512[_0x23d9('0x63')],{'$and':_0x3f8332});if(_0x22736e['user'][_0x23d9('0x5b')]===_0x23d9('0x64')){var _0x555c0d={'params':{'id':_0x22736e[_0x23d9('0x64')][_0x23d9('0x65')]},'query':{'section':_0x23d9('0x66'),'role':_0x23d9('0x5c'),'online':!![],'raw':!![],'ids':_0x46fee2,'customSorting':_0x97b58a}};if(_0x2005dc){_0x555c0d[_0x23d9('0x45')][_0x23d9('0x67')]=_0x3f8332;}_0x555c0d[_0x23d9('0x45')]=Object[_0x23d9('0x68')](_0x555c0d['query'],_0x22736e[_0x23d9('0x45')]);delete _0x555c0d[_0x23d9('0x45')]['id'];return db[_0x23d9('0x69')][_0x23d9('0x6a')](_0x555c0d);}return db['User']['findAndCountAll'](_0x3e7512);})['then'](function(_0x2c3348){_0xae6ad7[_0x23d9('0x8')]=_0x2c3348[_0x23d9('0x8')];_0x11fd63=_0x2c3348[_0x23d9('0x55')];return _0x11fd63['map'](function(_0x2edc6f){var _0x5026e4=_[_0x23d9('0x33')](_0x3f3f36,['id',_0x2edc6f['id']]);if(_0x5026e4){var _0x4bce0a=rta[_0x23d9('0x6b')](_0x5026e4);_['merge'](_0x2edc6f,_0x4bce0a);}_0x2edc6f[_0x23d9('0x4e')]=rta[_0x23d9('0x6c')](_0x2edc6f);if(_0x2edc6f['globalStatus'][_0x23d9('0x41')](_0x23d9('0x49'))){_0x23959a['forEach'](function(_0x58bc30){if(_0x2edc6f[_0x58bc30+_0x23d9('0x3f')]){_0x2edc6f[_0x58bc30+_0x23d9('0x6d')]=_0x23d9('0x49');}});}return _0x2edc6f;});})[_0x23d9('0x13')](function(_0x494fac){if(!_0x10482a||_0x97b58a){return _0x494fac;}return rta[_0x23d9('0x6e')](_0x494fac,_0x10482a);})['then'](function(_0x5ae62e){_0xae6ad7[_0x23d9('0x55')]=_0x5ae62e;return _0xae6ad7;})['then'](respondWithFilteredResult(_0x139851,_0x3e7512))[_0x23d9('0x15')](handleError(_0x139851,null));};exports['getQueues']=function(_0x33e1a1,_0x2645c4){var _0xe27fef={'count':0x0,'rows':[]},_0x2377a9={},_0xa8f14e,_0x1bb5b6,_0x13fb74,_0x21c054,_0x358a14;Promise[_0x23d9('0x4b')]()[_0x23d9('0x13')](function(){if(_0x33e1a1[_0x23d9('0x45')]['channel'])_0xa8f14e=validateChannel(_0x33e1a1[_0x23d9('0x45')]['channel']);var _0x2e53c4=_[_0x23d9('0x11')](_0xa8f14e)+_0x23d9('0x6f');var _0x35b865=_['map'](db[_0x2e53c4][_0x23d9('0x58')],function(_0xa54c1d){return{'name':_0xa54c1d[_0x23d9('0x59')],'type':_0xa54c1d['type'][_0x23d9('0x70')]};});_0x2377a9=qs[_0x23d9('0x5d')](_0x35b865,_0x33e1a1);if(_0x33e1a1[_0x23d9('0x64')][_0x23d9('0x5b')]==='user'){var _0xcbe8f6={'params':{'id':_0x33e1a1[_0x23d9('0x64')][_0x23d9('0x65')]},'query':{'section':_0xa8f14e===_0x23d9('0x1a')&&_0x33e1a1['query']['type']===_0x23d9('0x1b')?_0x23d9('0x71'):_[_0x23d9('0x11')](_0xa8f14e)+_0x23d9('0x12'),'type':_0x33e1a1[_0x23d9('0x45')]['type'],'nolimit':!![],'sort':_0x23d9('0xe'),'filter':_0x33e1a1[_0x23d9('0x45')]['filter']}};return db[_0x23d9('0x69')][_0x23d9('0x6a')](_0xcbe8f6);}return db[_0x2e53c4]['findAndCountAll'](_0x2377a9);})[_0x23d9('0x13')](function(_0x4b860d){_0xe27fef[_0x23d9('0x8')]=_0x4b860d[_0x23d9('0x8')];_0x1bb5b6=_0x4b860d[_0x23d9('0x55')];return getRealtimeQueues(_0x33e1a1,_0xa8f14e);})[_0x23d9('0x13')](function(_0x3a4b8d){_0x21c054=_0x3a4b8d['rows'];return rta[_0x23d9('0x54')]();})[_0x23d9('0x13')](function(_0x1706c8){_0x13fb74=_0x1706c8['rows'];if(_0xa8f14e!='voice')return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x557319){_0x358a14=_0x557319?_0x557319['rows']:[];return initializeQueues(_0x1bb5b6,_0x21c054,_0xa8f14e,_0x33e1a1['query'][_0x23d9('0x5a')]);})['then'](function(_0x17de27){var _0x417834=_0x17de27[_0x23d9('0x2f')](function(_0x28cff8){if(_0xa8f14e==='voice')return getVoiceQueueAgents(_0x28cff8,_0x1bb5b6,_0x13fb74,_0x358a14);else return getQueueAgents(_0x28cff8,_0x13fb74,_0xa8f14e);});return Promise['all'](_0x417834);})['then'](function(_0x5151ef){_0xe27fef['rows']=_0x5151ef;return _0xe27fef;})['then'](respondWithFilteredResult(_0x2645c4,_0x2377a9))[_0x23d9('0x15')](handleError(_0x2645c4,null));}; \ No newline at end of file +var _0x34b5=['startCase','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','result','waiting','talking','paused','voice','push','pTalking','originated','dialActive','Trunk','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','agents','loggedInDb','loggedIn','busy','outbound','find','pick','length','some','internal','getMembers','UserId','accountcode','online','Queue','Pause','findAll','QueueId','getChannels','includes','toLowerCase','Invalid\x20channel','getAgents','query','globalQueueFilter','pauseTypeFilter','pause','resolve','channel','sort','globalStatus','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getAgentIdsByStatus','type','key','role','agent','getOptions','raw','sequelize','FIELD(id,','forEach','where','merge','user','userProfileId','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','filterAgentAttributes','getAgentStatus','Status','sortAgentsByStatus','getQueues','fieldName','QueueCampaigns','Queues','filter','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/utils','api','../../mysqldb','client','http','offset','undefined','count','status','set','Content-Range','json','error','stack','name','send','request'];(function(_0x2e9f2c,_0x39460c){var _0x5a023f=function(_0x14a64e){while(--_0x14a64e){_0x2e9f2c['push'](_0x2e9f2c['shift']());}};_0x5a023f(++_0x39460c);}(_0x34b5,0xd7));var _0x534b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34b5[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x534b('0x0'));var _=require(_0x534b('0x1'));var jayson=require(_0x534b('0x2'));var rta=require('../../components/realtime/agents');var qs=require(_0x534b('0x3'));var utils=require(_0x534b('0x4'));var logger=require('../../config/logger')(_0x534b('0x5'));var db=require(_0x534b('0x6'))['db'];var amiClient=jayson[_0x534b('0x7')][_0x534b('0x8')]({'port':0x232a});var routingClient=jayson[_0x534b('0x7')][_0x534b('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x1d5fd4,_0x165600){return function(_0x404355){if(_0x404355){var _0xdbaf96=typeof _0x165600[_0x534b('0x9')]===_0x534b('0xa')&&typeof _0x165600['limit']===_0x534b('0xa');var _0x33fc13=_0x404355[_0x534b('0xb')];var _0x4cd14b=_0xdbaf96?0x0:_0x165600[_0x534b('0x9')];var _0x4d7ec3=_0xdbaf96?_0x404355[_0x534b('0xb')]:_0x165600['offset']+_0x165600['limit'];var _0x77a307;if(_0x4d7ec3>=_0x33fc13){_0x4d7ec3=_0x33fc13;_0x77a307=0xc8;}else{_0x77a307=0xce;}_0x1d5fd4[_0x534b('0xc')](_0x77a307);return _0x1d5fd4[_0x534b('0xd')](_0x534b('0xe'),_0x4cd14b+'-'+_0x4d7ec3+'/'+_0x33fc13)[_0x534b('0xf')](_0x404355);}return null;};}function handleError(_0x9b950d,_0x2e4184){_0x2e4184=_0x2e4184||0x1f4;return function(_0xacb110){logger[_0x534b('0x10')](_0xacb110[_0x534b('0x11')]);if(_0xacb110[_0x534b('0x12')]){delete _0xacb110[_0x534b('0x12')];}_0x9b950d[_0x534b('0xc')](_0x2e4184)[_0x534b('0x13')](_0xacb110);};}function getRealtimeQueues(_0xb01044,_0x496e41){return new Promise(function(_0x3182cd,_0x308d80){var _0x3d1bee=_0x496e41==='voice'?amiClient:routingClient;return _0x3d1bee[_0x534b('0x14')](_[_0x534b('0x15')](_0x496e41)+'Queues',_0xb01044)[_0x534b('0x16')](function(_0xa47a90){if(_0xa47a90[_0x534b('0x10')])throw new Error(util[_0x534b('0x17')](_0x534b('0x18'),_0x496e41));return _0x3182cd(_0xa47a90['result']);})[_0x534b('0x19')](function(_0x2b48a0){_0x308d80(_0x2b48a0);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x5bb597,_0xb7f0e9){return amiClient[_0x534b('0x14')](_0x534b('0x1a'),{})[_0x534b('0x16')](function(_0xc27622){if(_0xc27622[_0x534b('0x10')])throw new Error(_0x534b('0x1b'));return _0x5bb597(_0xc27622[_0x534b('0x1c')]);})['catch'](function(_0x15e79b){_0xb7f0e9(_0x15e79b);});});}function initializeQueues(_0x27c8a9,_0x2ffa7d,_0x53ec97,_0x555be8){var _0x24c63d=['loggedIn','available',_0x534b('0x1d'),_0x534b('0x1e'),_0x534b('0x1f')];if(_0x53ec97===_0x534b('0x20')&&_0x555be8==='outbound'){_0x24c63d[_0x534b('0x21')](_0x534b('0x22'),_0x534b('0x23'),'message',_0x534b('0x24'),'dialMethod',_0x534b('0x25'),'startPredictive',_0x534b('0x26'),'erlangCalls',_0x534b('0x27'),_0x534b('0x28'),_0x534b('0x29'),_0x534b('0x2a'),_0x534b('0x2b'),'dialPredictiveIntervalMinThreshold',_0x534b('0x2c'),_0x534b('0x2d'),_0x534b('0x2e'),'predictiveIntervalDroppedCallsTimeout',_0x534b('0x2f'),_0x534b('0x30'),_0x534b('0x31'));}return _0x27c8a9[_0x534b('0x32')](function(_0x5f569a){var _0x4ad26d=_0x5f569a['get']({'plain':!![]});_0x4ad26d[_0x534b('0x33')]=[];_0x4ad26d['paused']=0x0;_0x4ad26d[_0x534b('0x34')]=0x0;_0x4ad26d[_0x534b('0x35')]=0x0;_0x4ad26d['available']=0x0;_0x4ad26d[_0x534b('0x1d')]=0x0;if(_0x53ec97===_0x534b('0x20')){_0x4ad26d['talking']=0x0;_0x4ad26d[_0x534b('0x36')]=0x0;if(_0x555be8===_0x534b('0x37')){_0x4ad26d['pTalking']=0x0;_0x4ad26d[_0x534b('0x23')]=0x0;}}var _0x204631=_[_0x534b('0x38')](_0x2ffa7d,['id',_0x4ad26d['id']]);if(_0x204631)_['merge'](_0x4ad26d,_[_0x534b('0x39')](_0x204631,_0x24c63d));return _0x4ad26d;});}function updateAgentVoiceStatus(_0x443e1a,_0x232ef6,_0x336050){var _0x2f2865=_['filter'](_0x336050,['queue',_0x232ef6[_0x534b('0x12')]]);if(_0x2f2865[_0x534b('0x3a')]===0x0)return _0x443e1a[_0x534b('0x36')]=!![];if(_[_0x534b('0x3b')](_0x2f2865,['connectedlinenum',_0x443e1a[_0x534b('0x3c')]['toString']()]))return _0x443e1a[_0x534b('0x1e')]=!![];if(!_0x443e1a[_0x534b('0x1e')])return _0x443e1a['busy']=!![];}function getVoiceQueueAgents(_0x495846,_0x4709b4,_0x5d7fa3,_0x33d16f){var _0x554736=_['find'](_0x4709b4,['id',_0x495846['id']]);if(!_0x554736)return _0x495846;return _0x554736[_0x534b('0x3d')]({'raw':!![]})[_0x534b('0x16')](function(_0x25482c){for(var _0x228a39=0x0;_0x228a39<_0x25482c['length'];_0x228a39++){var _0x4736b9=_[_0x534b('0x38')](_0x5d7fa3,['id',_0x25482c[_0x228a39][_0x534b('0x3e')]]);if(!_0x4736b9){_0x4736b9={'id':_0x25482c[_0x228a39][_0x534b('0x3e')],'name':_0x25482c[_0x228a39][_0x534b('0x3e')],'accountcode':'','online':![]};}var _0xd18a50={'id':_0x4736b9['id'],'name':_0x4736b9[_0x534b('0x12')],'internal':_0x4736b9[_0x534b('0x3f')],'online':Boolean(_0x4736b9[_0x534b('0x40')]),'paused':Boolean(_0x25482c[_0x228a39][_0x534b('0x1f')])};if(_0x4736b9['voiceStatus']==='talking')updateAgentVoiceStatus(_0xd18a50,_0x495846,_0x33d16f);if(_0xd18a50[_0x534b('0x40')])_0x495846['loggedInDb']++;if(_0xd18a50[_0x534b('0x36')])_0x495846['busy']++;if(_0xd18a50['paused']&&!_0xd18a50[_0x534b('0x36')]&&!_0xd18a50['talking'])_0x495846[_0x534b('0x1f')]++;_0x495846['agents'][_0x534b('0x21')](_0xd18a50);}return _0x495846;});}function getQueueAgents(_0x166141,_0x423674,_0x54febe){var _0x484820='User'+_[_0x534b('0x15')](_0x54febe)+_0x534b('0x41');var _0x5ad008=_0x54febe+_0x534b('0x42');return db[_0x484820][_0x534b('0x43')]({'where':{[_[_0x534b('0x15')](_0x54febe)+_0x534b('0x44')]:_0x166141['id']},'raw':!![]})[_0x534b('0x16')](function(_0x168371){for(var _0x2ebbf4=0x0;_0x2ebbf4<_0x168371[_0x534b('0x3a')];_0x2ebbf4++){var _0x113874=_[_0x534b('0x38')](_0x423674,['id',_0x168371[_0x2ebbf4][_0x534b('0x3e')]]);if(!_0x113874){_0x113874={'id':_0x168371[_0x2ebbf4][_0x534b('0x3e')],'name':_0x168371[_0x2ebbf4][_0x534b('0x3e')],'online':![],['pauseField']:![]};}var _0x1b69af={'id':_0x113874['id'],'name':_0x113874['name'],'online':Boolean(_0x113874[_0x534b('0x40')]),'paused':Boolean(_0x113874[_0x5ad008])};if(_0x1b69af[_0x534b('0x40')])_0x166141['loggedInDb']++;_0x166141[_0x534b('0x33')][_0x534b('0x21')](_0x1b69af);}return _0x166141;});}function validateChannel(_0xcee605){var _0x586244=utils[_0x534b('0x45')]();if(!_[_0x534b('0x46')](_0x586244,_0xcee605[_0x534b('0x47')]()))throw new Error(_0x534b('0x48'));return _0xcee605['toLowerCase']();}exports[_0x534b('0x49')]=function(_0x7abd08,_0xe70b5a){var _0x14646e={'count':0x0,'rows':[]};var _0x51eee1={};var _0x45555b;var _0x5c7354;var _0x31b67d;var _0x1b48b0;var _0x1ff755=utils[_0x534b('0x45')]();var _0x37b746=_0x7abd08[_0x534b('0x4a')][_0x534b('0x4b')];var _0x2b7f61=_0x7abd08[_0x534b('0x4a')]['globalStatusFilter'];var _0x499073=_0x7abd08[_0x534b('0x4a')][_0x534b('0x4c')];var _0x5864e6=_0x2b7f61===_0x534b('0x4d')||_0x2b7f61==='*pause'?!![]:![];var _0x24051b=[];var _0x5d4032;Promise[_0x534b('0x4e')]()[_0x534b('0x16')](function(){if(_0x7abd08[_0x534b('0x4a')][_0x534b('0x4f')]){_0x45555b=validateChannel(_0x7abd08[_0x534b('0x4a')][_0x534b('0x4f')]);}if(!_0x7abd08[_0x534b('0x4a')][_0x534b('0x50')]||!_0x7abd08[_0x534b('0x4a')][_0x534b('0x50')][_0x534b('0x46')](_0x534b('0x51'))){_0x7abd08[_0x534b('0x4a')][_0x534b('0x50')]=rta['validateSortParameter'](_0x7abd08[_0x534b('0x4a')][_0x534b('0x50')]);return;}var _0x22f1be=rta[_0x534b('0x52')](_0x7abd08[_0x534b('0x4a')][_0x534b('0x50')]);_0x7abd08[_0x534b('0x4a')][_0x534b('0x50')]=_0x22f1be[_0x534b('0x53')][_0x534b('0x54')](',');_0x5c7354=_0x22f1be[_0x534b('0x55')];})[_0x534b('0x16')](function(){if(!_0x37b746){return[];}return rta[_0x534b('0x56')](_0x37b746,_0x45555b);})[_0x534b('0x16')](function(_0x1d76bd){_0x24051b=_0x1d76bd;return rta[_0x534b('0x57')]();})[_0x534b('0x16')](function(_0x1b41b6){_0x1b48b0=_0x1b41b6[_0x534b('0x58')];if((!_0x2b7f61||_0x5864e6)&&!_0x5c7354){return _0x24051b;}if(_0x5c7354&&!_0x2b7f61){return rta['getSortedAgentsIdsByStatus'](_0x1b48b0,_0x24051b,_0x5c7354);}else{return rta[_0x534b('0x59')](_0x1b48b0,_0x24051b,_0x2b7f61);}})[_0x534b('0x16')](function(_0x3c17bd){_0x24051b=_0x3c17bd;var _0x3294da=![];if(_0x24051b['length']===0x0){if(_0x37b746||_0x2b7f61){_0x3294da=!![];}if(_0x5864e6){_0x3294da=![];}}if(_0x3294da){return _0x14646e;}var _0x41fa6b=_[_0x534b('0x32')](db['User']['rawAttributes'],function(_0x4ef32f){return{'name':_0x4ef32f['fieldName'],'type':_0x4ef32f[_0x534b('0x5a')][_0x534b('0x5b')]};});_0x7abd08['query'][_0x534b('0x5c')]=_0x534b('0x5d');_0x7abd08[_0x534b('0x4a')][_0x534b('0x40')]=!![];_0x51eee1=qs[_0x534b('0x5e')](_0x41fa6b,_0x7abd08);_0x51eee1[_0x534b('0x5f')]=!![];var _0x565151=[];if(_0x24051b[_0x534b('0x3a')]>0x0){_0x565151[_0x534b('0x21')]({'id':{'$in':_0x24051b}});if(_0x5c7354&&!_0x2b7f61){_0x5d4032=[db[_0x534b('0x60')]['literal'](_0x534b('0x61')+_0x24051b+')')];_0x51eee1[_0x534b('0x55')]=_0x5d4032;}}if(_0x5864e6){_0x1ff755['forEach'](function(_0x16d0b4){var _0x106dd2=!![];if(_0x2b7f61==='*pause'&&_0x45555b!==_0x16d0b4){_0x106dd2=![];}_0x565151[_0x534b('0x21')]({[_0x16d0b4+_0x534b('0x42')]:_0x106dd2});});if(_0x499073){_0x565151[_0x534b('0x21')]({'pauseType':_0x499073});}}else if(_0x2b7f61){_0x1ff755[_0x534b('0x62')](function(_0x350090){_0x565151[_0x534b('0x21')]({[_0x350090+_0x534b('0x42')]:![]});});}_0x51eee1[_0x534b('0x63')]=_[_0x534b('0x64')](_0x51eee1[_0x534b('0x63')],{'$and':_0x565151});if(_0x7abd08[_0x534b('0x65')][_0x534b('0x5c')]===_0x534b('0x65')){var _0x39eff2={'params':{'id':_0x7abd08[_0x534b('0x65')][_0x534b('0x66')]},'query':{'section':'Agents','role':_0x534b('0x5d'),'online':!![],'raw':!![],'ids':_0x24051b,'customSorting':_0x5d4032}};if(_0x5864e6){_0x39eff2['query'][_0x534b('0x67')]=_0x565151;}_0x39eff2[_0x534b('0x4a')]=Object[_0x534b('0x68')](_0x39eff2['query'],_0x7abd08[_0x534b('0x4a')]);delete _0x39eff2[_0x534b('0x4a')]['id'];return db[_0x534b('0x69')][_0x534b('0x6a')](_0x39eff2);}return db['User'][_0x534b('0x6b')](_0x51eee1);})[_0x534b('0x16')](function(_0x4f4a72){_0x14646e[_0x534b('0xb')]=_0x4f4a72[_0x534b('0xb')];_0x31b67d=_0x4f4a72[_0x534b('0x58')];return _0x31b67d['map'](function(_0x2ef6bb){var _0x59d468=_[_0x534b('0x38')](_0x1b48b0,['id',_0x2ef6bb['id']]);if(_0x59d468){var _0x4374f5=rta[_0x534b('0x6c')](_0x59d468);_['merge'](_0x2ef6bb,_0x4374f5);}_0x2ef6bb[_0x534b('0x51')]=rta[_0x534b('0x6d')](_0x2ef6bb);if(_0x2ef6bb[_0x534b('0x51')][_0x534b('0x46')]('pause')){_0x1ff755[_0x534b('0x62')](function(_0x26ded4){if(_0x2ef6bb[_0x26ded4+_0x534b('0x42')]){_0x2ef6bb[_0x26ded4+_0x534b('0x6e')]=_0x534b('0x4d');}});}return _0x2ef6bb;});})[_0x534b('0x16')](function(_0x1b9246){if(!_0x5c7354||_0x5d4032){return _0x1b9246;}return rta[_0x534b('0x6f')](_0x1b9246,_0x5c7354);})[_0x534b('0x16')](function(_0x28842c){_0x14646e[_0x534b('0x58')]=_0x28842c;return _0x14646e;})[_0x534b('0x16')](respondWithFilteredResult(_0xe70b5a,_0x51eee1))[_0x534b('0x19')](handleError(_0xe70b5a,null));};exports[_0x534b('0x70')]=function(_0x15cd38,_0x34dc29){var _0x286b88={'count':0x0,'rows':[]},_0xb63bcd={},_0x482a0f,_0x354149,_0x2794b9,_0x17442a,_0x5dff9b;Promise['resolve']()['then'](function(){if(_0x15cd38[_0x534b('0x4a')][_0x534b('0x4f')])_0x482a0f=validateChannel(_0x15cd38[_0x534b('0x4a')][_0x534b('0x4f')]);var _0x25e952=_[_0x534b('0x15')](_0x482a0f)+_0x534b('0x41');var _0x40e654=_[_0x534b('0x32')](db[_0x25e952]['rawAttributes'],function(_0x2e0c74){return{'name':_0x2e0c74[_0x534b('0x71')],'type':_0x2e0c74[_0x534b('0x5a')][_0x534b('0x5b')]};});_0xb63bcd=qs['getOptions'](_0x40e654,_0x15cd38);if(_0x15cd38[_0x534b('0x65')]['role']===_0x534b('0x65')){var _0x1c16f0={'params':{'id':_0x15cd38[_0x534b('0x65')][_0x534b('0x66')]},'query':{'section':_0x482a0f===_0x534b('0x20')&&_0x15cd38['query'][_0x534b('0x5a')]===_0x534b('0x37')?_0x534b('0x72'):_['startCase'](_0x482a0f)+_0x534b('0x73'),'type':_0x15cd38['query']['type'],'nolimit':!![],'sort':'name','filter':_0x15cd38[_0x534b('0x4a')][_0x534b('0x74')]}};return db[_0x534b('0x69')]['getResources'](_0x1c16f0);}return db[_0x25e952][_0x534b('0x6b')](_0xb63bcd);})[_0x534b('0x16')](function(_0x51b34c){_0x286b88[_0x534b('0xb')]=_0x51b34c[_0x534b('0xb')];_0x354149=_0x51b34c[_0x534b('0x58')];return getRealtimeQueues(_0x15cd38,_0x482a0f);})[_0x534b('0x16')](function(_0x2452ea){_0x17442a=_0x2452ea[_0x534b('0x58')];return rta[_0x534b('0x57')]();})['then'](function(_0x1b4664){_0x2794b9=_0x1b4664[_0x534b('0x58')];if(_0x482a0f!=_0x534b('0x20'))return;return getRealtimeVoiceQueueChannels();})[_0x534b('0x16')](function(_0x236015){_0x5dff9b=_0x236015?_0x236015[_0x534b('0x58')]:[];return initializeQueues(_0x354149,_0x17442a,_0x482a0f,_0x15cd38[_0x534b('0x4a')][_0x534b('0x5a')]);})[_0x534b('0x16')](function(_0x185bc2){var _0x33125a=_0x185bc2[_0x534b('0x32')](function(_0xd1e2a7){if(_0x482a0f===_0x534b('0x20'))return getVoiceQueueAgents(_0xd1e2a7,_0x354149,_0x2794b9,_0x5dff9b);else return getQueueAgents(_0xd1e2a7,_0x2794b9,_0x482a0f);});return Promise[_0x534b('0x75')](_0x33125a);})[_0x534b('0x16')](function(_0x571854){_0x286b88[_0x534b('0x58')]=_0x571854;return _0x286b88;})[_0x534b('0x16')](respondWithFilteredResult(_0x34dc29,_0xb63bcd))[_0x534b('0x19')](handleError(_0x34dc29,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index c1487de..94658ee 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5ef0ee,_0x257a2a){var _0x4832ce=function(_0x5b792c){while(--_0x5b792c){_0x5ef0ee['push'](_0x5ef0ee['shift']());}};_0x4832ce(++_0x257a2a);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1d4868,_0x2b2406){var _0x5eaabe=function(_0x3c4c44){while(--_0x3c4c44){_0x1d4868['push'](_0x1d4868['shift']());}};_0x5eaabe(++_0x2b2406);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0xcb91[_0x16539a];return _0x200796;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index e41ccef..83ec262 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 _0xa6bb=['exports','INTEGER','STRING','DATE'];(function(_0x430c41,_0x2d1c1e){var _0x23e795=function(_0xe299f2){while(--_0xe299f2){_0x430c41['push'](_0x430c41['shift']());}};_0x23e795(++_0x2d1c1e);}(_0xa6bb,0x12c));var _0xba6b=function(_0x517375,_0xb28cbc){_0x517375=_0x517375-0x0;var _0x36128d=_0xa6bb[_0x517375];return _0x36128d;};'use strict';var Sequelize=require('sequelize');module[_0xba6b('0x0')]={'state':{'type':Sequelize[_0xba6b('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xba6b('0x2')]},'scheduledat':{'type':Sequelize[_0xba6b('0x3')]},'uniqueid':{'type':Sequelize[_0xba6b('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xba6b('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xba6b('0x2')]},'campaigntype':{'type':Sequelize[_0xba6b('0x2')]},'membername':{'type':Sequelize[_0xba6b('0x2')]}}; \ No newline at end of file +var _0xc4f5=['DATE','exports','INTEGER','STRING'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xc4f5,0xa5));var _0x5c4f=function(_0xf0ab7c,_0x23bbc2){_0xf0ab7c=_0xf0ab7c-0x0;var _0x198144=_0xc4f5[_0xf0ab7c];return _0x198144;};'use strict';var Sequelize=require('sequelize');module[_0x5c4f('0x0')]={'state':{'type':Sequelize[_0x5c4f('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x5c4f('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x5c4f('0x2')]},'starttime':{'type':Sequelize[_0x5c4f('0x3')]},'responsetime':{'type':Sequelize[_0x5c4f('0x3')]},'ringtime':{'type':Sequelize[_0x5c4f('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x5c4f('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5c4f('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index bd6e380..c408ffc 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 _0xcf56=['path','rimraf','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util','api','moment'];(function(_0x50bad0,_0x152a45){var _0x443fdc=function(_0x2e802b){while(--_0x2e802b){_0x50bad0['push'](_0x50bad0['shift']());}};_0x443fdc(++_0x152a45);}(_0xcf56,0x132));var _0x6cf5=function(_0x1667ba,_0xf399a){_0x1667ba=_0x1667ba-0x0;var _0x2e9232=_0xcf56[_0x1667ba];return _0x2e9232;};'use strict';var _=require(_0x6cf5('0x0'));var util=require(_0x6cf5('0x1'));var logger=require('../../config/logger')(_0x6cf5('0x2'));var moment=require(_0x6cf5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6cf5('0x4'));var rimraf=require(_0x6cf5('0x5'));var config=require('../../config/environment');var attributes=require(_0x6cf5('0x6'));module[_0x6cf5('0x7')]=function(_0x5a41f5,_0xa71d40){return _0x5a41f5[_0x6cf5('0x8')](_0x6cf5('0x9'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f35=['path','rimraf','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','util','../../config/logger','api','bluebird','request-promise'];(function(_0x16f667,_0x46bc24){var _0x38cadb=function(_0x31a064){while(--_0x31a064){_0x16f667['push'](_0x16f667['shift']());}};_0x38cadb(++_0x46bc24);}(_0x3f35,0xf7));var _0x53f3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x3f35[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0x53f3('0x0'));var logger=require(_0x53f3('0x1'))(_0x53f3('0x2'));var moment=require('moment');var BPromise=require(_0x53f3('0x3'));var rp=require(_0x53f3('0x4'));var fs=require('fs');var path=require(_0x53f3('0x5'));var rimraf=require(_0x53f3('0x6'));var config=require('../../config/environment');var attributes=require(_0x53f3('0x7'));module[_0x53f3('0x8')]=function(_0x31db2d,_0x7aedec){return _0x31db2d[_0x53f3('0x9')](_0x53f3('0xa'),attributes,{'tableName':_0x53f3('0xb'),'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 3193e30..59a32e2 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 _0x5908=['jayson/promise','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x20e4a9,_0x4ae4d1){var _0x6497f8=function(_0x54725d){while(--_0x54725d){_0x20e4a9['push'](_0x20e4a9['shift']());}};_0x6497f8(++_0x4ae4d1);}(_0x5908,0x84));var _0x8590=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5908[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8590('0x0'));var util=require(_0x8590('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8590('0x2'));var fs=require('fs');var Redis=require(_0x8590('0x3'));var db=require(_0x8590('0x4'))['db'];var utils=require(_0x8590('0x5'));var logger=require(_0x8590('0x6'))(_0x8590('0x7'));var config=require('../../config/environment');var jayson=require(_0x8590('0x8'));var client=jayson[_0x8590('0x9')][_0x8590('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xab5c79,_0x181e99,_0x673e1c){return new BPromise(function(_0x1bdc4a,_0x2779ec){return client[_0x8590('0xb')](_0xab5c79,_0x673e1c)['then'](function(_0x434ddd){logger[_0x8590('0xc')](_0x8590('0xd'),_0x181e99,'request\x20sent');logger[_0x8590('0xe')](_0x8590('0xf'),_0x181e99,_0x8590('0x10'),JSON[_0x8590('0x11')](_0x434ddd));if(_0x434ddd[_0x8590('0x12')]){if(_0x434ddd[_0x8590('0x12')][_0x8590('0x13')]===0x1f4){logger['error'](_0x8590('0xd'),_0x181e99,_0x434ddd['error'][_0x8590('0x14')]);return _0x2779ec(_0x434ddd[_0x8590('0x12')][_0x8590('0x14')]);}logger[_0x8590('0x12')](_0x8590('0xd'),_0x181e99,_0x434ddd[_0x8590('0x12')][_0x8590('0x14')]);return _0x1bdc4a(_0x434ddd[_0x8590('0x12')][_0x8590('0x14')]);}else{logger[_0x8590('0xc')](_0x8590('0xd'),_0x181e99,_0x8590('0x10'));_0x1bdc4a(_0x434ddd['result'][_0x8590('0x14')]);}})[_0x8590('0x15')](function(_0x5e2f4c){logger[_0x8590('0x12')](_0x8590('0xd'),_0x181e99,_0x5e2f4c);_0x2779ec(_0x5e2f4c);});});}exports[_0x8590('0x16')]=function(_0x2f1e99){var _0x3acb4d=this;return new Promise(function(_0x3b6dab,_0xeca465){return db[_0x8590('0x17')][_0x8590('0x18')](_0x2f1e99[_0x8590('0x19')],{'raw':_0x2f1e99['options']?_0x2f1e99[_0x8590('0x1a')][_0x8590('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x16cc42){logger[_0x8590('0xc')]('CreateReportAgentPreview',_0x2f1e99);logger[_0x8590('0xe')](_0x8590('0x16'),_0x2f1e99,JSON[_0x8590('0x11')](_0x16cc42));_0x3b6dab(_0x16cc42);})['catch'](function(_0x189836){logger[_0x8590('0x12')](_0x8590('0x16'),_0x189836['message'],_0x2f1e99);_0xeca465(_0x3acb4d[_0x8590('0x12')](0x1f4,_0x189836[_0x8590('0x14')]));});});}; \ No newline at end of file +var _0xf5a1=['result','catch','CreateReportAgentPreview','ReportAgentPreview','create','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x44c200,_0x2cb0ce){var _0x48d35f=function(_0x5b7aa4){while(--_0x5b7aa4){_0x44c200['push'](_0x44c200['shift']());}};_0x48d35f(++_0x2cb0ce);}(_0xf5a1,0x129));var _0x1f5a=function(_0x25c6d,_0x452c8f){_0x25c6d=_0x25c6d-0x0;var _0xe54ba0=_0xf5a1[_0x25c6d];return _0xe54ba0;};'use strict';var _=require(_0x1f5a('0x0'));var util=require(_0x1f5a('0x1'));var moment=require(_0x1f5a('0x2'));var BPromise=require(_0x1f5a('0x3'));var rs=require(_0x1f5a('0x4'));var fs=require('fs');var Redis=require(_0x1f5a('0x5'));var db=require(_0x1f5a('0x6'))['db'];var utils=require(_0x1f5a('0x7'));var logger=require('../../config/logger')(_0x1f5a('0x8'));var config=require(_0x1f5a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1f5a('0xa')][_0x1f5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26efb2,_0x4b5592,_0x2ef4ea){return new BPromise(function(_0x25a59c,_0x1315df){return client[_0x1f5a('0xc')](_0x26efb2,_0x2ef4ea)['then'](function(_0x48c4d1){logger['info'](_0x1f5a('0xd'),_0x4b5592,'request\x20sent');logger[_0x1f5a('0xe')](_0x1f5a('0xf'),_0x4b5592,_0x1f5a('0x10'),JSON[_0x1f5a('0x11')](_0x48c4d1));if(_0x48c4d1[_0x1f5a('0x12')]){if(_0x48c4d1['error'][_0x1f5a('0x13')]===0x1f4){logger[_0x1f5a('0x12')](_0x1f5a('0xd'),_0x4b5592,_0x48c4d1[_0x1f5a('0x12')][_0x1f5a('0x14')]);return _0x1315df(_0x48c4d1[_0x1f5a('0x12')]['message']);}logger[_0x1f5a('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x4b5592,_0x48c4d1['error'][_0x1f5a('0x14')]);return _0x25a59c(_0x48c4d1[_0x1f5a('0x12')][_0x1f5a('0x14')]);}else{logger[_0x1f5a('0x15')](_0x1f5a('0xd'),_0x4b5592,_0x1f5a('0x10'));_0x25a59c(_0x48c4d1[_0x1f5a('0x16')][_0x1f5a('0x14')]);}})[_0x1f5a('0x17')](function(_0x80615e){logger['error'](_0x1f5a('0xd'),_0x4b5592,_0x80615e);_0x1315df(_0x80615e);});});}exports[_0x1f5a('0x18')]=function(_0x1156fd){var _0x2b0c48=this;return new Promise(function(_0x5d8820,_0x2efad0){return db[_0x1f5a('0x19')][_0x1f5a('0x1a')](_0x1156fd['body'],{'raw':_0x1156fd['options']?_0x1156fd['options'][_0x1f5a('0x1b')]===undefined?!![]:![]:!![]})[_0x1f5a('0x1c')](function(_0x4eeefb){logger[_0x1f5a('0x15')](_0x1f5a('0x18'),_0x1156fd);logger[_0x1f5a('0xe')](_0x1f5a('0x18'),_0x1156fd,JSON[_0x1f5a('0x11')](_0x4eeefb));_0x5d8820(_0x4eeefb);})[_0x1f5a('0x17')](function(_0x41a60c){logger[_0x1f5a('0x12')](_0x1f5a('0x18'),_0x41a60c[_0x1f5a('0x14')],_0x1156fd);_0x2efad0(_0x2b0c48['error'](0x1f4,_0x41a60c[_0x1f5a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 9240941..d52ffc2 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 _0xeaef=['put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues'];(function(_0x174076,_0x1a072f){var _0x1dadf3=function(_0x2dbbb7){while(--_0x2dbbb7){_0x174076['push'](_0x174076['shift']());}};_0x1dadf3(++_0x1a072f);}(_0xeaef,0x131));var _0xfeae=function(_0x711fbe,_0x549a53){_0x711fbe=_0x711fbe-0x0;var _0x263be2=_0xeaef[_0x711fbe];return _0x263be2;};'use strict';var multer=require(_0xfeae('0x0'));var util=require(_0xfeae('0x1'));var path=require(_0xfeae('0x2'));var express=require('express');var router=express[_0xfeae('0x3')]();var auth=require(_0xfeae('0x4'));var controller=require(_0xfeae('0x5'));router[_0xfeae('0x6')](_0xfeae('0x7'),auth['isAuthenticated'](),controller['voiceChannels']);router[_0xfeae('0x6')](_0xfeae('0x8'),auth[_0xfeae('0x9')](),controller[_0xfeae('0xa')]);router[_0xfeae('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xfeae('0x9')](),controller['voiceChannelStopMixMonitor']);router[_0xfeae('0x6')](_0xfeae('0xb'),auth[_0xfeae('0x9')](),controller[_0xfeae('0xc')]);router[_0xfeae('0x6')](_0xfeae('0xd'),auth['isAuthenticated'](),controller[_0xfeae('0xe')]);router[_0xfeae('0x6')]('/mail/queues',auth[_0xfeae('0x9')](),controller[_0xfeae('0xf')]);router['get'](_0xfeae('0x10'),auth['isAuthenticated'](),controller[_0xfeae('0x11')]);router[_0xfeae('0x6')](_0xfeae('0x12'),auth['isAuthenticated'](),controller[_0xfeae('0x13')]);router[_0xfeae('0x6')](_0xfeae('0x14'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x15')]);router[_0xfeae('0x6')](_0xfeae('0x16'),auth['isAuthenticated'](),controller[_0xfeae('0x17')]);router[_0xfeae('0x6')](_0xfeae('0x18'),auth['isAuthenticated'](),controller['faxQueues']);router[_0xfeae('0x6')](_0xfeae('0x19'),auth[_0xfeae('0x9')](),controller['voiceQueuesPreview']);router[_0xfeae('0x6')](_0xfeae('0x1a'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x1b')]);router[_0xfeae('0x6')](_0xfeae('0x1c'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x1d')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0xfeae('0x9')](),controller[_0xfeae('0x1e')]);router[_0xfeae('0x6')](_0xfeae('0x1f'),auth['isAuthenticated'](),controller[_0xfeae('0x20')]);router['get'](_0xfeae('0x21'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x22')]);router[_0xfeae('0x23')](_0xfeae('0x21'),auth['isAuthenticated'](),controller[_0xfeae('0x24')]);router[_0xfeae('0x6')](_0xfeae('0x25'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x26')]);router[_0xfeae('0x6')](_0xfeae('0x27'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x28')]);router['get']('/agents',auth[_0xfeae('0x9')](),controller['agents']);router['put'](_0xfeae('0x29'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x2a')]);router[_0xfeae('0x6')](_0xfeae('0x2b'),auth[_0xfeae('0x9')](),controller['telephones']);router[_0xfeae('0x6')](_0xfeae('0x2c'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x2d')]);router[_0xfeae('0x6')](_0xfeae('0x2e'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x2f')]);router['get'](_0xfeae('0x30'),auth[_0xfeae('0x9')](),controller['faxAccounts']);router[_0xfeae('0x6')](_0xfeae('0x31'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x32')]);router[_0xfeae('0x6')](_0xfeae('0x33'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x34')]);router['get'](_0xfeae('0x35'),auth[_0xfeae('0x9')](),controller['openchannelQueuesWaitingInteractions']);router[_0xfeae('0x6')]('/openchannel/queues/:id/waitinginteractions',auth[_0xfeae('0x9')](),controller[_0xfeae('0x36')]);router['get'](_0xfeae('0x37'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x38')]);router[_0xfeae('0x6')](_0xfeae('0x39'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0xfeae('0x6')](_0xfeae('0x3a'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x3b')]);router[_0xfeae('0x3c')](_0xfeae('0x3d'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x3e')]('mail'));router['get'](_0xfeae('0x3f'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0xfeae('0x3c')](_0xfeae('0x40'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x3e')](_0xfeae('0x41')));router['get'](_0xfeae('0x42'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x43')]);router['post'](_0xfeae('0x44'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x3e')](_0xfeae('0x45')));router[_0xfeae('0x6')](_0xfeae('0x46'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x47')]);router['post'](_0xfeae('0x48'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x3e')]('openchannel'));router['get'](_0xfeae('0x49'),auth[_0xfeae('0x9')](),controller['showOpenchannelQueues']);router[_0xfeae('0x3c')](_0xfeae('0x4a'),auth[_0xfeae('0x9')](),controller['queueNotify'](_0xfeae('0x4b')));router['post'](_0xfeae('0x4c'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x3e')](_0xfeae('0x4d')));router[_0xfeae('0x6')](_0xfeae('0x4e'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x4f')]);router['get'](_0xfeae('0x50'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x51')]);router[_0xfeae('0x3c')](_0xfeae('0x52'),auth[_0xfeae('0x9')](),controller[_0xfeae('0x53')]);module[_0xfeae('0x54')]=router; \ No newline at end of file +var _0xbe4a=['util','path','express','Router','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/trunks','trunks','/campaigns','campaigns','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer'];(function(_0x2ac64f,_0x5ef0fa){var _0x30c30f=function(_0x58dd65){while(--_0x58dd65){_0x2ac64f['push'](_0x2ac64f['shift']());}};_0x30c30f(++_0x5ef0fa);}(_0xbe4a,0xf5));var _0xabe4=function(_0xaf2427,_0x504859){_0xaf2427=_0xaf2427-0x0;var _0x67addb=_0xbe4a[_0xaf2427];return _0x67addb;};'use strict';var multer=require(_0xabe4('0x0'));var util=require(_0xabe4('0x1'));var path=require(_0xabe4('0x2'));var express=require(_0xabe4('0x3'));var router=express[_0xabe4('0x4')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router['get'](_0xabe4('0x5'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x7')]);router[_0xabe4('0x8')](_0xabe4('0x9'),auth[_0xabe4('0x6')](),controller[_0xabe4('0xa')]);router[_0xabe4('0x8')](_0xabe4('0xb'),auth[_0xabe4('0x6')](),controller['voiceChannelStopMixMonitor']);router[_0xabe4('0x8')](_0xabe4('0xc'),auth[_0xabe4('0x6')](),controller[_0xabe4('0xd')]);router[_0xabe4('0x8')](_0xabe4('0xe'),auth[_0xabe4('0x6')](),controller[_0xabe4('0xf')]);router[_0xabe4('0x8')](_0xabe4('0x10'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x11')]);router[_0xabe4('0x8')](_0xabe4('0x12'),auth[_0xabe4('0x6')](),controller['mailAccounts']);router[_0xabe4('0x8')](_0xabe4('0x13'),auth[_0xabe4('0x6')](),controller['openchannelQueues']);router[_0xabe4('0x8')](_0xabe4('0x14'),auth[_0xabe4('0x6')](),controller['smsQueues']);router[_0xabe4('0x8')](_0xabe4('0x15'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x16')]);router['get'](_0xabe4('0x17'),auth['isAuthenticated'](),controller[_0xabe4('0x18')]);router[_0xabe4('0x8')]('/voice/queues/preview/:id',auth[_0xabe4('0x6')](),controller[_0xabe4('0x19')]);router[_0xabe4('0x8')](_0xabe4('0x1a'),auth[_0xabe4('0x6')](),controller['voiceQueuesChannels']);router[_0xabe4('0x8')](_0xabe4('0x1b'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x1c')]);router['get'](_0xabe4('0x1d'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x1e')]);router[_0xabe4('0x8')](_0xabe4('0x1f'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x20')]);router[_0xabe4('0x8')](_0xabe4('0x21'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x22')]);router['put'](_0xabe4('0x21'),auth[_0xabe4('0x6')](),controller['updateVoiceQueue']);router['get']('/outbound',auth['isAuthenticated'](),controller[_0xabe4('0x23')]);router[_0xabe4('0x8')](_0xabe4('0x24'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x25')]);router[_0xabe4('0x8')](_0xabe4('0x26'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x27')]);router[_0xabe4('0x28')](_0xabe4('0x29'),auth['isAuthenticated'](),controller[_0xabe4('0x2a')]);router[_0xabe4('0x8')]('/telephones',auth['isAuthenticated'](),controller['telephones']);router[_0xabe4('0x8')](_0xabe4('0x2b'),auth['isAuthenticated'](),controller[_0xabe4('0x2c')]);router[_0xabe4('0x8')](_0xabe4('0x2d'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x2e')]);router[_0xabe4('0x8')]('/fax/accounts',auth['isAuthenticated'](),controller['faxAccounts']);router[_0xabe4('0x8')](_0xabe4('0x2f'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x30')]);router[_0xabe4('0x8')](_0xabe4('0x31'),auth[_0xabe4('0x6')](),controller['mailQueuesWaitingInteractions']);router[_0xabe4('0x8')](_0xabe4('0x32'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x33')]);router['get'](_0xabe4('0x34'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x35')]);router[_0xabe4('0x8')]('/sms/queues/waitinginteractions',auth[_0xabe4('0x6')](),controller[_0xabe4('0x36')]);router[_0xabe4('0x8')](_0xabe4('0x37'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x38')]);router[_0xabe4('0x8')](_0xabe4('0x39'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x3a')]);router[_0xabe4('0x3b')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0xabe4('0x3c')](_0xabe4('0x3d')));router[_0xabe4('0x8')](_0xabe4('0x3e'),auth['isAuthenticated'](),controller[_0xabe4('0x3f')]);router[_0xabe4('0x3b')](_0xabe4('0x40'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x3c')]('chat'));router[_0xabe4('0x8')](_0xabe4('0x41'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x42')]);router[_0xabe4('0x3b')](_0xabe4('0x43'),auth[_0xabe4('0x6')](),controller['queueNotify'](_0xabe4('0x44')));router['get']('/fax/queues/:id',auth[_0xabe4('0x6')](),controller[_0xabe4('0x45')]);router[_0xabe4('0x3b')](_0xabe4('0x46'),auth['isAuthenticated'](),controller['queueNotify'](_0xabe4('0x47')));router[_0xabe4('0x8')](_0xabe4('0x48'),auth['isAuthenticated'](),controller[_0xabe4('0x49')]);router[_0xabe4('0x3b')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0xabe4('0x3c')](_0xabe4('0x4a')));router['post']('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0xabe4('0x4b')));router['get'](_0xabe4('0x4c'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x4d')]);router[_0xabe4('0x8')](_0xabe4('0x4e'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x4f')]);router[_0xabe4('0x3b')](_0xabe4('0x50'),auth[_0xabe4('0x6')](),controller[_0xabe4('0x51')]);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 b08f151..1623fb7 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 _0xee14=['telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','channel','Website','User','agent','Agent\x20not\x20found','\x20Message\x20not\x20found','*,*,*,*','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','VoiceChannels','query','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','user','interaction','hasOwnProperty','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','MemberReport','findOrCreate','INTERACTION','SIP/%s','AgentCapacity'];(function(_0xe5b55e,_0x3744f2){var _0xee6d73=function(_0x676e1){while(--_0x676e1){_0xe5b55e['push'](_0xe5b55e['shift']());}};_0xee6d73(++_0x3744f2);}(_0xee14,0x13a));var _0x4ee1=function(_0x45e793,_0x124d5c){_0x45e793=_0x45e793-0x0;var _0x436e14=_0xee14[_0x45e793];return _0x436e14;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0x4ee1('0x0'));var util=require(_0x4ee1('0x1'));var db=require(_0x4ee1('0x2'))['db'];var logger=require(_0x4ee1('0x3'))(_0x4ee1('0x4'));var jayson=require(_0x4ee1('0x5'));var amiClient=jayson[_0x4ee1('0x6')][_0x4ee1('0x7')]({'port':0x232a});var mailClient=jayson[_0x4ee1('0x6')]['http']({'port':0x232b});var routingClient=jayson[_0x4ee1('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x327c18,_0x3a45a3,_0x187656){return new BPromise(function(_0x293d5f,_0xdfe9c1){var _0x1fd8c8=_0x187656?_0x187656:amiClient;return _0x1fd8c8['request'](_0x327c18,_0x3a45a3)[_0x4ee1('0x8')](function(_0x38be25){if(_0x38be25['error']){if(_0x38be25[_0x4ee1('0x9')][_0x4ee1('0xa')]===0x1f4){return _0xdfe9c1(_0x38be25[_0x4ee1('0x9')][_0x4ee1('0xb')]);}return _0x293d5f(_0x38be25['error'][_0x4ee1('0xb')]);}else{_0x293d5f(_0x38be25[_0x4ee1('0xc')]);}})[_0x4ee1('0xd')](function(_0x2d5d3c){_0xdfe9c1(_0x2d5d3c);});});}function respondWithResult(_0x2f864e,_0x174427){_0x174427=_0x174427||0xc8;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0xe')](_0x174427)[_0x4ee1('0xf')](_0x5616d6);}return _0x2f864e[_0x4ee1('0x10')](0x194);};}function handleError(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0x1f4;return function(_0x1c342a){logger[_0x4ee1('0x9')](_0x1c342a[_0x4ee1('0x11')]);if(_0x1c342a[_0x4ee1('0x12')]){delete _0x1c342a['name'];}_0x24a915[_0x4ee1('0xe')](_0x46d2c2)[_0x4ee1('0x13')](_0x1c342a);};}function findById(_0x34651b){return function(_0x1b1e0e){if(!_[_0x4ee1('0x14')](_0x34651b)&&!_[_0x4ee1('0x14')](_0x1b1e0e)&&!_[_0x4ee1('0x14')](_0x1b1e0e[_0x4ee1('0x15')])){return _[_0x4ee1('0x16')](_0x1b1e0e[_0x4ee1('0x15')],function(_0x274de5){return _0x274de5['id']==_0x34651b;});}return null;};}exports['voiceChannels']=function(_0x236215,_0x3db827){return respondWithRpcPromise(_0x4ee1('0x17'),_0x236215[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x3db827,null))[_0x4ee1('0xd')](handleError(_0x3db827,null));};exports['voiceChannelMixMonitor']=function(_0x8a631f,_0x333e96){return respondWithRpcPromise(_0x4ee1('0x19'),_[_0x4ee1('0x1a')](_0x8a631f[_0x4ee1('0x18')],_0x8a631f[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x333e96,null))[_0x4ee1('0xd')](handleError(_0x333e96,null));};exports[_0x4ee1('0x1c')]=function(_0x3e5038,_0x4faaf6){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x4ee1('0x1a')](_0x3e5038[_0x4ee1('0x18')],_0x3e5038[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x4faaf6,null))[_0x4ee1('0xd')](handleError(_0x4faaf6,null));};exports[_0x4ee1('0x1d')]=function(_0x57d45d,_0x5cc0b5){return respondWithRpcPromise(_0x4ee1('0x1e'),_0x57d45d[_0x4ee1('0x18')])['then'](respondWithResult(_0x5cc0b5,null))[_0x4ee1('0xd')](handleError(_0x5cc0b5,null));};exports[_0x4ee1('0x1f')]=function(_0x36654c,_0x215949){return respondWithRpcPromise(_0x4ee1('0x1e'),_0x36654c[_0x4ee1('0x18')])[_0x4ee1('0x8')](findById(_0x36654c['params']['id']))[_0x4ee1('0x8')](respondWithResult(_0x215949,null))['catch'](handleError(_0x215949,null));};exports[_0x4ee1('0x20')]=function(_0x4ec408,_0x3dc870){return respondWithRpcPromise(_0x4ee1('0x21'),_[_0x4ee1('0x1a')](_0x4ec408[_0x4ee1('0x22')],_0x4ec408[_0x4ee1('0x1b')]))['then'](respondWithResult(_0x3dc870,null))[_0x4ee1('0xd')](handleError(_0x3dc870,null));};exports['voiceQueuesPreview']=function(_0x121301,_0x3d5e6c){return respondWithRpcPromise(_0x4ee1('0x23'),_[_0x4ee1('0x1a')](_0x121301[_0x4ee1('0x18')],_0x121301['params']))[_0x4ee1('0x8')](respondWithResult(_0x3d5e6c,null))[_0x4ee1('0xd')](handleError(_0x3d5e6c,null));};exports[_0x4ee1('0x24')]=function(_0x2e37a3,_0x79f87c){return respondWithRpcPromise(_0x4ee1('0x25'),_0x2e37a3['query'])['then'](respondWithResult(_0x79f87c,null))[_0x4ee1('0xd')](handleError(_0x79f87c,null));};exports[_0x4ee1('0x26')]=function(_0x41ab60,_0x5a2f6f){return respondWithRpcPromise(_0x4ee1('0x27'),_[_0x4ee1('0x1a')](_0x41ab60[_0x4ee1('0x18')],_0x41ab60[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x5a2f6f,null))[_0x4ee1('0xd')](handleError(_0x5a2f6f,null));};exports[_0x4ee1('0x28')]=function(_0x199e11,_0x36898c){return respondWithRpcPromise(_0x4ee1('0x29'),_[_0x4ee1('0x1a')](_0x199e11[_0x4ee1('0x18')],_0x199e11[_0x4ee1('0x1b')]))['then'](respondWithResult(_0x36898c,null))[_0x4ee1('0xd')](handleError(_0x36898c,null));};exports[_0x4ee1('0x2a')]=function(_0x882468,_0x50539f){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x4ee1('0x1a')](_0x882468[_0x4ee1('0x18')],_0x882468[_0x4ee1('0x1b')]))[_0x4ee1('0x8')](respondWithResult(_0x50539f,null))['catch'](handleError(_0x50539f,null));};exports[_0x4ee1('0x2b')]=function(_0x2ed16f,_0x11721a){return respondWithRpcPromise(_0x4ee1('0x2c'),_0x2ed16f[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x11721a,null))[_0x4ee1('0xd')](handleError(_0x11721a,null));};exports[_0x4ee1('0x2d')]=function(_0x59b5cc,_0x3b346e){return respondWithRpcPromise(_0x4ee1('0x2e'),_0x59b5cc[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x3b346e,null))[_0x4ee1('0xd')](handleError(_0x3b346e,null));};exports[_0x4ee1('0x2f')]=function(_0x543b2e,_0x3e2ca7){var _0x37176a;return respondWithRpcPromise(_0x4ee1('0x30'),_0x543b2e[_0x4ee1('0x18')])[_0x4ee1('0x8')](function(_0x352dc5){_0x37176a=_0x352dc5;return respondWithRpcPromise(_0x4ee1('0x30'),_0x543b2e[_0x4ee1('0x18')],routingClient);})[_0x4ee1('0x8')](function(_0x29493d){return _[_0x4ee1('0x1a')]({},_0x29493d,_0x37176a);})[_0x4ee1('0x8')](respondWithResult(_0x3e2ca7,null))[_0x4ee1('0xd')](handleError(_0x3e2ca7,null));};exports['agentCapacity']=function(_0x3b3bed,_0x40a3e3){if(_0x3b3bed['body']&&_0x3b3bed[_0x4ee1('0x22')]['interaction']&&_0x3b3bed[_0x4ee1('0x31')]&&_0x3b3bed['user'][_0x4ee1('0x12')]){for(var _0xc7580c in _0x3b3bed['body'][_0x4ee1('0x32')]){if(_0x3b3bed[_0x4ee1('0x22')][_0x4ee1('0x32')][_0x4ee1('0x33')](_0xc7580c)){db['MemberReport'][_0x4ee1('0x34')]({'where':{'channel':_0xc7580c,'membername':_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3b3bed['body'][_0x4ee1('0x32')][_0xc7580c]&&_0x3b3bed[_0x4ee1('0x22')][_0x4ee1('0x32')][_0xc7580c][_0x4ee1('0x35')]?{'$notIn':_0x3b3bed[_0x4ee1('0x22')]['interaction'][_0xc7580c]}:{'$ne':null}}})['then'](function(_0xaa71d5){var _0x266add=moment()[_0x4ee1('0x36')](_0x4ee1('0x37'));for(var _0x5c5862=0x0,_0x3d6bf4=_0xaa71d5[_0x4ee1('0x35')];_0x5c5862<_0x3d6bf4;_0x5c5862+=0x1){_0xaa71d5[_0x5c5862]['updateAttributes']({'exitAt':_0x266add});}});for(var _0x21ebb8=0x0;_0x21ebb8<_0x3b3bed[_0x4ee1('0x22')][_0x4ee1('0x32')][_0xc7580c][_0x4ee1('0x35')];_0x21ebb8+=0x1){db[_0x4ee1('0x38')][_0x4ee1('0x39')]({'where':{'channel':_0xc7580c,'membername':_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')],'type':_0x4ee1('0x3a'),'uniqueid':_0x3b3bed['body']['interaction'][_0xc7580c][_0x21ebb8],'exitAt':null},'defaults':{'channel':_0xc7580c,'membername':_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')],'interface':_[_0x4ee1('0x14')](_0x3b3bed[_0x4ee1('0x31')]['interface'])?util[_0x4ee1('0x36')](_0x4ee1('0x3b'),_0x3b3bed[_0x4ee1('0x31')][_0x4ee1('0x12')]):_0x3b3bed[_0x4ee1('0x31')]['interface'],'type':_0x4ee1('0x3a'),'enterAt':moment()[_0x4ee1('0x36')](_0x4ee1('0x37')),'role':'agent','internal':_0x3b3bed[_0x4ee1('0x31')]['internal'],'uniqueid':_0x3b3bed[_0x4ee1('0x22')]['interaction'][_0xc7580c][_0x21ebb8]}});}}}}return respondWithRpcPromise(_0x4ee1('0x3c'),{'id':_0x3b3bed['params']['id'],'capacity':_0x3b3bed[_0x4ee1('0x22')]['capacity']},routingClient)[_0x4ee1('0x8')](respondWithResult(_0x40a3e3,null))[_0x4ee1('0xd')](handleError(_0x40a3e3,null));};exports[_0x4ee1('0x3d')]=function(_0x5f4f78,_0x3368ed){return respondWithRpcPromise(_0x4ee1('0x3e'),_0x5f4f78[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x3368ed,null))[_0x4ee1('0xd')](handleError(_0x3368ed,null));};exports[_0x4ee1('0x3f')]=function(_0x3f1c32,_0x517729){return respondWithRpcPromise('Trunks',_0x3f1c32[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x517729,null))[_0x4ee1('0xd')](handleError(_0x517729,null));};exports[_0x4ee1('0x40')]=function(_0x44e65f,_0x31e82d){return respondWithRpcPromise(_0x4ee1('0x41'),_0x44e65f[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x31e82d,null))[_0x4ee1('0xd')](handleError(_0x31e82d,null));};exports[_0x4ee1('0x42')]=function(_0x2453ac,_0x3c2e42){return respondWithRpcPromise('ChatQueues',_0x2453ac[_0x4ee1('0x18')],routingClient)['then'](respondWithResult(_0x3c2e42,null))[_0x4ee1('0xd')](handleError(_0x3c2e42,null));};exports[_0x4ee1('0x43')]=function(_0x59bbca,_0x1e0aac){return respondWithRpcPromise(_0x4ee1('0x44'),_0x59bbca['query'],routingClient)['then'](findById(_0x59bbca[_0x4ee1('0x1b')]['id']))['then'](respondWithResult(_0x1e0aac,null))[_0x4ee1('0xd')](handleError(_0x1e0aac,null));};exports[_0x4ee1('0x45')]=function(_0x59ba70,_0x43489c){return respondWithRpcPromise(_0x4ee1('0x46'),_0x59ba70[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x43489c,null))[_0x4ee1('0xd')](handleError(_0x43489c,null));};exports[_0x4ee1('0x47')]=function(_0x11f619,_0x5f5694){return respondWithRpcPromise('MailQueues',_0x11f619[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x11f619['params']['id']))[_0x4ee1('0x8')](respondWithResult(_0x5f5694,null))[_0x4ee1('0xd')](handleError(_0x5f5694,null));};exports[_0x4ee1('0x48')]=function(_0x51e341,_0x1ad933){return respondWithRpcPromise('MailAccounts',_0x51e341[_0x4ee1('0x18')],mailClient)['then'](respondWithResult(_0x1ad933,null))['catch'](handleError(_0x1ad933,null));};exports[_0x4ee1('0x49')]=function(_0x16fcd0,_0x290451){return respondWithRpcPromise(_0x4ee1('0x4a'),_0x16fcd0[_0x4ee1('0x18')],routingClient)['then'](respondWithResult(_0x290451,null))[_0x4ee1('0xd')](handleError(_0x290451,null));};exports[_0x4ee1('0x4b')]=function(_0x10f4e,_0x58eb1d){return respondWithRpcPromise(_0x4ee1('0x4a'),_0x10f4e[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x10f4e[_0x4ee1('0x1b')]['id']))[_0x4ee1('0x8')](respondWithResult(_0x58eb1d,null))[_0x4ee1('0xd')](handleError(_0x58eb1d,null));};exports[_0x4ee1('0x4c')]=function(_0x20ca0b,_0x19fa31){return respondWithRpcPromise(_0x4ee1('0x4d'),_0x20ca0b[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x19fa31,null))['catch'](handleError(_0x19fa31,null));};exports[_0x4ee1('0x4e')]=function(_0x5bf5e9,_0x25cfc3){return respondWithRpcPromise('SmsQueues',_0x5bf5e9[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x5bf5e9[_0x4ee1('0x1b')]['id']))[_0x4ee1('0x8')](respondWithResult(_0x25cfc3,null))[_0x4ee1('0xd')](handleError(_0x25cfc3,null));};exports[_0x4ee1('0x4f')]=function(_0x342aa1,_0x447060){return respondWithRpcPromise(_0x4ee1('0x50'),_0x342aa1[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x447060,null))[_0x4ee1('0xd')](handleError(_0x447060,null));};exports['showWhatsappQueues']=function(_0x759888,_0x24308c){return respondWithRpcPromise(_0x4ee1('0x50'),_0x759888['query'],routingClient)['then'](findById(_0x759888[_0x4ee1('0x1b')]['id']))[_0x4ee1('0x8')](respondWithResult(_0x24308c,null))['catch'](handleError(_0x24308c,null));};exports[_0x4ee1('0x51')]=function(_0x431dfa,_0x3f8f94){return respondWithRpcPromise(_0x4ee1('0x52'),_0x431dfa[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x3f8f94,null))[_0x4ee1('0xd')](handleError(_0x3f8f94,null));};exports[_0x4ee1('0x53')]=function(_0x28e11c,_0x3824bf){return respondWithRpcPromise('FaxQueues',_0x28e11c[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](findById(_0x28e11c['params']['id']))['then'](respondWithResult(_0x3824bf,null))[_0x4ee1('0xd')](handleError(_0x3824bf,null));};exports[_0x4ee1('0x54')]=function(_0x19e095,_0x38e06){return respondWithRpcPromise(_0x4ee1('0x55'),_0x19e095[_0x4ee1('0x18')])[_0x4ee1('0x8')](respondWithResult(_0x38e06,null))['catch'](handleError(_0x38e06,null));};exports[_0x4ee1('0x56')]=function(_0x39583b,_0x44af66){return respondWithRpcPromise(_0x4ee1('0x57'),_0x39583b[_0x4ee1('0x18')],routingClient)['then'](respondWithResult(_0x44af66,null))[_0x4ee1('0xd')](handleError(_0x44af66,null));};exports['mailQueuesWaitingInteractions']=function(_0x1d360f,_0x29371c){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x1d360f['query'],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x29371c,null))[_0x4ee1('0xd')](handleError(_0x29371c,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x2beb82,_0x5aacf1){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x2beb82[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x5aacf1,null))[_0x4ee1('0xd')](handleError(_0x5aacf1,null));};exports[_0x4ee1('0x58')]=function(_0x37fa42,_0x38698a){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x37fa42[_0x4ee1('0x18')],routingClient)['then'](function(_0x57f66c){if(_0x37fa42[_0x4ee1('0x18')][_0x4ee1('0x59')]!==undefined){var _0x411c99=_(_0x57f66c[_0x4ee1('0x15')])[_0x4ee1('0x5a')]([_0x37fa42[_0x4ee1('0x18')][_0x4ee1('0x59')],_0x37fa42[_0x4ee1('0x1b')]['id']])['map'](_0x4ee1('0x5b'))[_0x4ee1('0x5c')]()['value']();return _0x57f66c[_0x4ee1('0x15')][_0x4ee1('0x5a')](function(_0xcd0dd9){return _0x411c99[_0x4ee1('0x5d')](_0xcd0dd9[_0x4ee1('0x5b')])>-0x1;});}else{return _0x57f66c[_0x4ee1('0x15')][_0x4ee1('0x5a')](function(_0x4dee3a){return _0x4dee3a[_0x4ee1('0x5b')]===parseInt(_0x37fa42['params']['id']);});}})[_0x4ee1('0x8')](respondWithResult(_0x38698a,null))[_0x4ee1('0xd')](handleError(_0x38698a,null));};exports[_0x4ee1('0x5e')]=function(_0x35a719,_0x48c51c){return respondWithRpcPromise(_0x4ee1('0x5f'),_0x35a719[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x48c51c,null))['catch'](handleError(_0x48c51c,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2ef7c9,_0x4b4ad5){return respondWithRpcPromise(_0x4ee1('0x60'),_0x2ef7c9[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x4b4ad5,null))['catch'](handleError(_0x4b4ad5,null));};exports['faxQueuesWaitingInteractions']=function(_0x27fd3b,_0x1e2360){return respondWithRpcPromise(_0x4ee1('0x61'),_0x27fd3b[_0x4ee1('0x18')],routingClient)[_0x4ee1('0x8')](respondWithResult(_0x1e2360,null))[_0x4ee1('0xd')](handleError(_0x1e2360,null));};exports[_0x4ee1('0x62')]=function(_0x5727ef){return function(_0x4a3201,_0x50645b){var _0x3fba19,_0x3a75a7;var _0x33f5af=_[_0x4ee1('0x63')](_0x5727ef);var _0x4db801=_0x5727ef===_0x4ee1('0x64')?'Website':_0x4ee1('0x65');return db[_0x33f5af+_0x4ee1('0x66')][_0x4ee1('0x67')]({'raw':!![],'where':{'id':_0x4a3201[_0x4ee1('0x1b')]['id']}})[_0x4ee1('0x8')](function(_0x190f59){if(_['isNil'](_0x190f59)){throw new Error(_0x33f5af+_0x4ee1('0x68'));}_0x3fba19=_0x190f59;return db[_0x33f5af+_0x4ee1('0x69')][_0x4ee1('0x67')]({'where':{'id':_0x4a3201[_0x4ee1('0x22')][_0x4ee1('0x6a')]},'include':[{'model':db[_0x33f5af+_0x4ee1('0x6b')],'as':_0x4ee1('0x6b')},{'model':db[_0x33f5af+_0x4db801],'as':_0x4ee1('0x65')}]});})[_0x4ee1('0x8')](function(_0x207758){if(_[_0x4ee1('0x14')](_0x207758)){throw new Error(_0x33f5af+'\x20Message\x20not\x20found');}_0x3a75a7=_0x207758;return _0x207758[_0x4ee1('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0x4ee1('0x8')](function(){var _0x646878={'uniqueid':_0x5727ef+'.'+_0x3a75a7['id']+'.'+_0x3a75a7[_0x4ee1('0x6b')]['id'],'FromUserId':_0x4a3201[_0x4ee1('0x31')]['id'],'type':_0x4ee1('0x6d')};_0x646878[_0x33f5af+_0x4ee1('0x6e')]=_0x3a75a7['id'];_0x646878[_0x33f5af+_0x4ee1('0x6f')]=_0x3a75a7[_0x4ee1('0x6b')]['id'];_0x646878[_0x4ee1('0x70')+_0x33f5af+_0x4db801+'Id']=_0x3a75a7[_0x4ee1('0x65')]['id'];_0x646878['To'+_0x33f5af+_0x4ee1('0x71')]=_0x3fba19['id'];return db[_0x33f5af+_0x4ee1('0x72')][_0x4ee1('0x73')](_0x646878);})[_0x4ee1('0x8')](function(){return respondWithRpcPromise(_0x4ee1('0x74'),{'channel':_0x5727ef,'interaction':_0x3a75a7['Interaction'],'message':_0x3a75a7,'account':_0x3a75a7[_0x4ee1('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ee1('0x6d'),'appdata':_0x3fba19['name']+','+(_0x3a75a7[_0x4ee1('0x65')][_0x4ee1('0x75')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x50645b,null))[_0x4ee1('0xd')](handleError(_0x50645b,null));};};exports['agentNotify']=function(_0x13a755,_0x1a00a4){var _0x47b854,_0x1700c6;if(_[_0x4ee1('0x14')](_0x13a755[_0x4ee1('0x22')][_0x4ee1('0x76')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x2bc05a=_0x13a755[_0x4ee1('0x22')][_0x4ee1('0x76')];var _0xc07f75=_[_0x4ee1('0x63')](_0x2bc05a);var _0x4315e9=_0x2bc05a===_0x4ee1('0x64')?_0x4ee1('0x77'):'Account';return db[_0x4ee1('0x78')][_0x4ee1('0x67')]({'raw':!![],'where':{'id':_0x13a755['params']['id'],'role':_0x4ee1('0x79')}})['then'](function(_0x5cf7fb){if(_[_0x4ee1('0x14')](_0x5cf7fb)){throw new Error(_0x4ee1('0x7a'));}_0x47b854=_0x5cf7fb;return db[_0xc07f75+_0x4ee1('0x69')][_0x4ee1('0x67')]({'where':{'id':_0x13a755[_0x4ee1('0x22')][_0x4ee1('0x6a')]},'include':[{'model':db[_0xc07f75+'Interaction'],'as':_0x4ee1('0x6b')},{'model':db[_0xc07f75+_0x4315e9],'as':_0x4ee1('0x65')}]});})[_0x4ee1('0x8')](function(_0x17ae2d){if(_[_0x4ee1('0x14')](_0x17ae2d)){throw new Error(_0xc07f75+_0x4ee1('0x7b'));}_0x1700c6=_0x17ae2d;return _0x17ae2d[_0x4ee1('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0x4ee1('0x8')](function(){var _0x5076c6={'uniqueid':_0x2bc05a+'.'+_0x1700c6['id']+'.'+_0x1700c6[_0x4ee1('0x6b')]['id'],'FromUserId':_0x13a755[_0x4ee1('0x31')]['id'],'type':_0x4ee1('0x6d'),'ToUserId':_0x47b854['id']};_0x5076c6[_0xc07f75+_0x4ee1('0x6e')]=_0x1700c6['id'];_0x5076c6[_0xc07f75+_0x4ee1('0x6f')]=_0x1700c6['Interaction']['id'];_0x5076c6[_0x4ee1('0x70')+_0xc07f75+_0x4315e9+'Id']=_0x1700c6['Account']['id'];return db[_0xc07f75+_0x4ee1('0x72')][_0x4ee1('0x73')](_0x5076c6);})[_0x4ee1('0x8')](function(){return respondWithRpcPromise(_0x4ee1('0x74'),{'channel':_0x2bc05a,'interaction':_0x1700c6['Interaction'],'message':_0x1700c6,'account':_0x1700c6[_0x4ee1('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4ee1('0x79'),'appdata':_0x47b854['name']+','+(_0x1700c6[_0x4ee1('0x65')]['agentTransferTimeout']||0x12c),'interval':_0x4ee1('0x7c')}]},routingClient);})[_0x4ee1('0x8')](respondWithResult(_0x1a00a4,null))['catch'](handleError(_0x1a00a4,null));}; \ No newline at end of file +var _0xd6d6=['capacity','Telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','indexOf','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','QueueId','create','Start','*,*,*,*','agentNotify','channel','capitalize','User','Agent\x20not\x20found','TransferReport','agentTransferTimeout','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','error','code','message','status','json','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','agent','internal'];(function(_0x516f4f,_0x29f1c6){var _0x10851d=function(_0x2e6dc8){while(--_0x2e6dc8){_0x516f4f['push'](_0x516f4f['shift']());}};_0x10851d(++_0x29f1c6);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x4042f6,_0x59987b){_0x4042f6=_0x4042f6-0x0;var _0x5285ca=_0xd6d6[_0x4042f6];return _0x5285ca;};'use strict';var BPromise=require(_0x6d6d('0x0'));var moment=require(_0x6d6d('0x1'));var _=require(_0x6d6d('0x2'));var util=require(_0x6d6d('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x6d6d('0x4'))(_0x6d6d('0x5'));var jayson=require(_0x6d6d('0x6'));var amiClient=jayson[_0x6d6d('0x7')][_0x6d6d('0x8')]({'port':0x232a});var mailClient=jayson[_0x6d6d('0x7')][_0x6d6d('0x8')]({'port':0x232b});var routingClient=jayson['client'][_0x6d6d('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x1bf731,_0x44f83d,_0x18f824){return new BPromise(function(_0xd49f57,_0x408f88){var _0x3e69a4=_0x18f824?_0x18f824:amiClient;return _0x3e69a4['request'](_0x1bf731,_0x44f83d)['then'](function(_0x404c88){if(_0x404c88[_0x6d6d('0x9')]){if(_0x404c88[_0x6d6d('0x9')][_0x6d6d('0xa')]===0x1f4){return _0x408f88(_0x404c88[_0x6d6d('0x9')]['message']);}return _0xd49f57(_0x404c88[_0x6d6d('0x9')][_0x6d6d('0xb')]);}else{_0xd49f57(_0x404c88['result']);}})['catch'](function(_0x176618){_0x408f88(_0x176618);});});}function respondWithResult(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xc8;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0xc')](_0xe61c36)[_0x6d6d('0xd')](_0x3f8542);}return _0x32146d[_0x6d6d('0xe')](0x194);};}function handleError(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0x1f4;return function(_0xd09ea7){logger[_0x6d6d('0x9')](_0xd09ea7[_0x6d6d('0xf')]);if(_0xd09ea7[_0x6d6d('0x10')]){delete _0xd09ea7[_0x6d6d('0x10')];}_0x2cb2dd['status'](_0x5f4154)[_0x6d6d('0x11')](_0xd09ea7);};}function findById(_0x587338){return function(_0x27830d){if(!_[_0x6d6d('0x12')](_0x587338)&&!_[_0x6d6d('0x12')](_0x27830d)&&!_['isNil'](_0x27830d['rows'])){return _[_0x6d6d('0x13')](_0x27830d[_0x6d6d('0x14')],function(_0x2b59d4){return _0x2b59d4['id']==_0x587338;});}return null;};}exports[_0x6d6d('0x15')]=function(_0x51fff6,_0x554392){return respondWithRpcPromise(_0x6d6d('0x16'),_0x51fff6['query'])[_0x6d6d('0x17')](respondWithResult(_0x554392,null))[_0x6d6d('0x18')](handleError(_0x554392,null));};exports[_0x6d6d('0x19')]=function(_0x450352,_0x40d35b){return respondWithRpcPromise(_0x6d6d('0x1a'),_[_0x6d6d('0x1b')](_0x450352[_0x6d6d('0x1c')],_0x450352[_0x6d6d('0x1d')]))[_0x6d6d('0x17')](respondWithResult(_0x40d35b,null))[_0x6d6d('0x18')](handleError(_0x40d35b,null));};exports[_0x6d6d('0x1e')]=function(_0x466a29,_0x21b95d){return respondWithRpcPromise(_0x6d6d('0x1f'),_[_0x6d6d('0x1b')](_0x466a29[_0x6d6d('0x1c')],_0x466a29['params']))[_0x6d6d('0x17')](respondWithResult(_0x21b95d,null))[_0x6d6d('0x18')](handleError(_0x21b95d,null));};exports[_0x6d6d('0x20')]=function(_0x97ec9e,_0xf0df7f){return respondWithRpcPromise(_0x6d6d('0x21'),_0x97ec9e['query'])[_0x6d6d('0x17')](respondWithResult(_0xf0df7f,null))[_0x6d6d('0x18')](handleError(_0xf0df7f,null));};exports[_0x6d6d('0x22')]=function(_0x126ac8,_0x25c121){return respondWithRpcPromise(_0x6d6d('0x21'),_0x126ac8[_0x6d6d('0x1c')])['then'](findById(_0x126ac8[_0x6d6d('0x1d')]['id']))[_0x6d6d('0x17')](respondWithResult(_0x25c121,null))['catch'](handleError(_0x25c121,null));};exports['updateVoiceQueue']=function(_0x3edcce,_0x5273cd){return respondWithRpcPromise(_0x6d6d('0x23'),_['merge'](_0x3edcce[_0x6d6d('0x24')],_0x3edcce[_0x6d6d('0x1d')]))[_0x6d6d('0x17')](respondWithResult(_0x5273cd,null))[_0x6d6d('0x18')](handleError(_0x5273cd,null));};exports[_0x6d6d('0x25')]=function(_0x428c17,_0xdda3f2){return respondWithRpcPromise(_0x6d6d('0x26'),_[_0x6d6d('0x1b')](_0x428c17[_0x6d6d('0x1c')],_0x428c17['params']))[_0x6d6d('0x17')](respondWithResult(_0xdda3f2,null))['catch'](handleError(_0xdda3f2,null));};exports[_0x6d6d('0x27')]=function(_0x1ea9b2,_0xf527da){return respondWithRpcPromise(_0x6d6d('0x28'),_0x1ea9b2['query'])[_0x6d6d('0x17')](respondWithResult(_0xf527da,null))['catch'](handleError(_0xf527da,null));};exports[_0x6d6d('0x29')]=function(_0x219fd4,_0x5be8da){return respondWithRpcPromise(_0x6d6d('0x2a'),_[_0x6d6d('0x1b')](_0x219fd4[_0x6d6d('0x1c')],_0x219fd4[_0x6d6d('0x1d')]))[_0x6d6d('0x17')](respondWithResult(_0x5be8da,null))[_0x6d6d('0x18')](handleError(_0x5be8da,null));};exports[_0x6d6d('0x2b')]=function(_0x2d524d,_0x243555){return respondWithRpcPromise(_0x6d6d('0x2c'),_[_0x6d6d('0x1b')](_0x2d524d[_0x6d6d('0x1c')],_0x2d524d[_0x6d6d('0x1d')]))[_0x6d6d('0x17')](respondWithResult(_0x243555,null))['catch'](handleError(_0x243555,null));};exports[_0x6d6d('0x2d')]=function(_0xf98bfa,_0x3e2415){return respondWithRpcPromise(_0x6d6d('0x2e'),_['merge'](_0xf98bfa['query'],_0xf98bfa[_0x6d6d('0x1d')]))[_0x6d6d('0x17')](respondWithResult(_0x3e2415,null))[_0x6d6d('0x18')](handleError(_0x3e2415,null));};exports['outbound']=function(_0x2a3f67,_0x2607c1){return respondWithRpcPromise(_0x6d6d('0x2f'),_0x2a3f67[_0x6d6d('0x1c')])['then'](respondWithResult(_0x2607c1,null))['catch'](handleError(_0x2607c1,null));};exports['outboundChannels']=function(_0x62620d,_0x4196f0){return respondWithRpcPromise(_0x6d6d('0x30'),_0x62620d[_0x6d6d('0x1c')])['then'](respondWithResult(_0x4196f0,null))[_0x6d6d('0x18')](handleError(_0x4196f0,null));};exports[_0x6d6d('0x31')]=function(_0x344f6f,_0x3c6d23){var _0x3d632c;return respondWithRpcPromise(_0x6d6d('0x32'),_0x344f6f['query'])[_0x6d6d('0x17')](function(_0x3c7292){_0x3d632c=_0x3c7292;return respondWithRpcPromise(_0x6d6d('0x32'),_0x344f6f[_0x6d6d('0x1c')],routingClient);})[_0x6d6d('0x17')](function(_0x3e27b7){return _[_0x6d6d('0x1b')]({},_0x3e27b7,_0x3d632c);})['then'](respondWithResult(_0x3c6d23,null))[_0x6d6d('0x18')](handleError(_0x3c6d23,null));};exports[_0x6d6d('0x33')]=function(_0x16e177,_0x2107e0){if(_0x16e177[_0x6d6d('0x24')]&&_0x16e177['body'][_0x6d6d('0x34')]&&_0x16e177[_0x6d6d('0x35')]&&_0x16e177['user'][_0x6d6d('0x10')]){for(var _0x50dc17 in _0x16e177[_0x6d6d('0x24')][_0x6d6d('0x34')]){if(_0x16e177['body'][_0x6d6d('0x34')][_0x6d6d('0x36')](_0x50dc17)){db[_0x6d6d('0x37')][_0x6d6d('0x38')]({'where':{'channel':_0x50dc17,'membername':_0x16e177[_0x6d6d('0x35')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x16e177[_0x6d6d('0x24')]['interaction'][_0x50dc17]&&_0x16e177['body'][_0x6d6d('0x34')][_0x50dc17][_0x6d6d('0x39')]?{'$notIn':_0x16e177[_0x6d6d('0x24')]['interaction'][_0x50dc17]}:{'$ne':null}}})[_0x6d6d('0x17')](function(_0x4cff80){var _0x1a2d4c=moment()[_0x6d6d('0x3a')](_0x6d6d('0x3b'));for(var _0x4606eb=0x0,_0x75f298=_0x4cff80[_0x6d6d('0x39')];_0x4606eb<_0x75f298;_0x4606eb+=0x1){_0x4cff80[_0x4606eb][_0x6d6d('0x3c')]({'exitAt':_0x1a2d4c});}});for(var _0x5c0495=0x0;_0x5c0495<_0x16e177[_0x6d6d('0x24')][_0x6d6d('0x34')][_0x50dc17][_0x6d6d('0x39')];_0x5c0495+=0x1){db[_0x6d6d('0x37')][_0x6d6d('0x3d')]({'where':{'channel':_0x50dc17,'membername':_0x16e177[_0x6d6d('0x35')][_0x6d6d('0x10')],'type':_0x6d6d('0x3e'),'uniqueid':_0x16e177[_0x6d6d('0x24')]['interaction'][_0x50dc17][_0x5c0495],'exitAt':null},'defaults':{'channel':_0x50dc17,'membername':_0x16e177['user'][_0x6d6d('0x10')],'interface':_[_0x6d6d('0x12')](_0x16e177[_0x6d6d('0x35')][_0x6d6d('0x3f')])?util[_0x6d6d('0x3a')]('SIP/%s',_0x16e177[_0x6d6d('0x35')][_0x6d6d('0x10')]):_0x16e177[_0x6d6d('0x35')][_0x6d6d('0x3f')],'type':_0x6d6d('0x3e'),'enterAt':moment()[_0x6d6d('0x3a')](_0x6d6d('0x3b')),'role':_0x6d6d('0x40'),'internal':_0x16e177[_0x6d6d('0x35')][_0x6d6d('0x41')],'uniqueid':_0x16e177[_0x6d6d('0x24')][_0x6d6d('0x34')][_0x50dc17][_0x5c0495]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x16e177[_0x6d6d('0x1d')]['id'],'capacity':_0x16e177[_0x6d6d('0x24')][_0x6d6d('0x42')]},routingClient)[_0x6d6d('0x17')](respondWithResult(_0x2107e0,null))[_0x6d6d('0x18')](handleError(_0x2107e0,null));};exports['telephones']=function(_0x38c307,_0x36bc5a){return respondWithRpcPromise(_0x6d6d('0x43'),_0x38c307['query'])['then'](respondWithResult(_0x36bc5a,null))[_0x6d6d('0x18')](handleError(_0x36bc5a,null));};exports['trunks']=function(_0x3ea57e,_0x995fe2){return respondWithRpcPromise(_0x6d6d('0x44'),_0x3ea57e[_0x6d6d('0x1c')])[_0x6d6d('0x17')](respondWithResult(_0x995fe2,null))[_0x6d6d('0x18')](handleError(_0x995fe2,null));};exports[_0x6d6d('0x45')]=function(_0x26c23a,_0x1a8f33){return respondWithRpcPromise(_0x6d6d('0x46'),_0x26c23a['query'])[_0x6d6d('0x17')](respondWithResult(_0x1a8f33,null))[_0x6d6d('0x18')](handleError(_0x1a8f33,null));};exports[_0x6d6d('0x47')]=function(_0x8000b6,_0x1f98d4){return respondWithRpcPromise(_0x6d6d('0x48'),_0x8000b6[_0x6d6d('0x1c')],routingClient)['then'](respondWithResult(_0x1f98d4,null))['catch'](handleError(_0x1f98d4,null));};exports[_0x6d6d('0x49')]=function(_0x122865,_0x5cc644){return respondWithRpcPromise(_0x6d6d('0x48'),_0x122865[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](findById(_0x122865[_0x6d6d('0x1d')]['id']))[_0x6d6d('0x17')](respondWithResult(_0x5cc644,null))[_0x6d6d('0x18')](handleError(_0x5cc644,null));};exports[_0x6d6d('0x4a')]=function(_0x1ef7fb,_0x2abd8c){return respondWithRpcPromise(_0x6d6d('0x4b'),_0x1ef7fb[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](respondWithResult(_0x2abd8c,null))[_0x6d6d('0x18')](handleError(_0x2abd8c,null));};exports[_0x6d6d('0x4c')]=function(_0x3065ea,_0x50d8dd){return respondWithRpcPromise(_0x6d6d('0x4b'),_0x3065ea[_0x6d6d('0x1c')],routingClient)['then'](findById(_0x3065ea[_0x6d6d('0x1d')]['id']))[_0x6d6d('0x17')](respondWithResult(_0x50d8dd,null))[_0x6d6d('0x18')](handleError(_0x50d8dd,null));};exports[_0x6d6d('0x4d')]=function(_0x2d61cc,_0xd0a573){return respondWithRpcPromise(_0x6d6d('0x4e'),_0x2d61cc[_0x6d6d('0x1c')],mailClient)[_0x6d6d('0x17')](respondWithResult(_0xd0a573,null))['catch'](handleError(_0xd0a573,null));};exports['openchannelQueues']=function(_0x22c3a1,_0x325fe2){return respondWithRpcPromise(_0x6d6d('0x4f'),_0x22c3a1['query'],routingClient)['then'](respondWithResult(_0x325fe2,null))[_0x6d6d('0x18')](handleError(_0x325fe2,null));};exports['showOpenchannelQueues']=function(_0x30badc,_0x5b6f58){return respondWithRpcPromise(_0x6d6d('0x4f'),_0x30badc[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](findById(_0x30badc[_0x6d6d('0x1d')]['id']))[_0x6d6d('0x17')](respondWithResult(_0x5b6f58,null))[_0x6d6d('0x18')](handleError(_0x5b6f58,null));};exports['smsQueues']=function(_0x41e576,_0x5eb78f){return respondWithRpcPromise(_0x6d6d('0x50'),_0x41e576['query'],routingClient)[_0x6d6d('0x17')](respondWithResult(_0x5eb78f,null))[_0x6d6d('0x18')](handleError(_0x5eb78f,null));};exports[_0x6d6d('0x51')]=function(_0xa71db1,_0x29b68b){return respondWithRpcPromise(_0x6d6d('0x50'),_0xa71db1[_0x6d6d('0x1c')],routingClient)['then'](findById(_0xa71db1['params']['id']))[_0x6d6d('0x17')](respondWithResult(_0x29b68b,null))['catch'](handleError(_0x29b68b,null));};exports[_0x6d6d('0x52')]=function(_0x53b77a,_0xe19d23){return respondWithRpcPromise(_0x6d6d('0x53'),_0x53b77a[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](respondWithResult(_0xe19d23,null))[_0x6d6d('0x18')](handleError(_0xe19d23,null));};exports[_0x6d6d('0x54')]=function(_0x5dd3b0,_0x3cedc0){return respondWithRpcPromise(_0x6d6d('0x53'),_0x5dd3b0[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](findById(_0x5dd3b0[_0x6d6d('0x1d')]['id']))[_0x6d6d('0x17')](respondWithResult(_0x3cedc0,null))[_0x6d6d('0x18')](handleError(_0x3cedc0,null));};exports['faxQueues']=function(_0x3fa820,_0x4ec43e){return respondWithRpcPromise(_0x6d6d('0x55'),_0x3fa820[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](respondWithResult(_0x4ec43e,null))[_0x6d6d('0x18')](handleError(_0x4ec43e,null));};exports[_0x6d6d('0x56')]=function(_0x1d1d1d,_0x56feda){return respondWithRpcPromise(_0x6d6d('0x55'),_0x1d1d1d[_0x6d6d('0x1c')],routingClient)['then'](findById(_0x1d1d1d['params']['id']))[_0x6d6d('0x17')](respondWithResult(_0x56feda,null))['catch'](handleError(_0x56feda,null));};exports['faxAccounts']=function(_0x5b6ca7,_0x1e3b17){return respondWithRpcPromise(_0x6d6d('0x57'),_0x5b6ca7[_0x6d6d('0x1c')])[_0x6d6d('0x17')](respondWithResult(_0x1e3b17,null))[_0x6d6d('0x18')](handleError(_0x1e3b17,null));};exports[_0x6d6d('0x58')]=function(_0x4d4083,_0x48472d){return respondWithRpcPromise(_0x6d6d('0x59'),_0x4d4083['query'],routingClient)['then'](respondWithResult(_0x48472d,null))['catch'](handleError(_0x48472d,null));};exports[_0x6d6d('0x5a')]=function(_0x5cd494,_0x45a374){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x5cd494[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](respondWithResult(_0x45a374,null))['catch'](handleError(_0x45a374,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x167d0c,_0x202bf6){return respondWithRpcPromise(_0x6d6d('0x5b'),_0x167d0c[_0x6d6d('0x1c')],routingClient)['then'](respondWithResult(_0x202bf6,null))[_0x6d6d('0x18')](handleError(_0x202bf6,null));};exports[_0x6d6d('0x5c')]=function(_0x1fb21d,_0x2b53eb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1fb21d[_0x6d6d('0x1c')],routingClient)['then'](function(_0x4b6594){if(_0x1fb21d['query'][_0x6d6d('0x5d')]!==undefined){var _0x5bcfbd=_(_0x4b6594[_0x6d6d('0x14')])[_0x6d6d('0x5e')]([_0x1fb21d[_0x6d6d('0x1c')]['type'],_0x1fb21d['params']['id']])[_0x6d6d('0x5f')](_0x6d6d('0x60'))['uniq']()['value']();return _0x4b6594[_0x6d6d('0x14')][_0x6d6d('0x5e')](function(_0x14feba){return _0x5bcfbd[_0x6d6d('0x61')](_0x14feba[_0x6d6d('0x60')])>-0x1;});}else{return _0x4b6594[_0x6d6d('0x14')][_0x6d6d('0x5e')](function(_0x52f758){return _0x52f758['queue_id']===parseInt(_0x1fb21d['params']['id']);});}})['then'](respondWithResult(_0x2b53eb,null))['catch'](handleError(_0x2b53eb,null));};exports['smsQueuesWaitingInteractions']=function(_0x87dd34,_0x21e5a8){return respondWithRpcPromise(_0x6d6d('0x62'),_0x87dd34[_0x6d6d('0x1c')],routingClient)['then'](respondWithResult(_0x21e5a8,null))['catch'](handleError(_0x21e5a8,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x39b34e,_0xfbad7a){return respondWithRpcPromise(_0x6d6d('0x63'),_0x39b34e[_0x6d6d('0x1c')],routingClient)['then'](respondWithResult(_0xfbad7a,null))['catch'](handleError(_0xfbad7a,null));};exports[_0x6d6d('0x64')]=function(_0x1e1c4e,_0x478ed4){return respondWithRpcPromise(_0x6d6d('0x65'),_0x1e1c4e[_0x6d6d('0x1c')],routingClient)[_0x6d6d('0x17')](respondWithResult(_0x478ed4,null))[_0x6d6d('0x18')](handleError(_0x478ed4,null));};exports[_0x6d6d('0x66')]=function(_0x581027){return function(_0xf5586f,_0x50eea6){var _0x39f986,_0x5885c5;var _0x108108=_['capitalize'](_0x581027);var _0x445196=_0x581027===_0x6d6d('0x67')?_0x6d6d('0x68'):_0x6d6d('0x69');return db[_0x108108+_0x6d6d('0x6a')][_0x6d6d('0x6b')]({'raw':!![],'where':{'id':_0xf5586f[_0x6d6d('0x1d')]['id']}})[_0x6d6d('0x17')](function(_0x139a7){if(_[_0x6d6d('0x12')](_0x139a7)){throw new Error(_0x108108+_0x6d6d('0x6c'));}_0x39f986=_0x139a7;return db[_0x108108+_0x6d6d('0x6d')][_0x6d6d('0x6b')]({'where':{'id':_0xf5586f[_0x6d6d('0x24')][_0x6d6d('0x6e')]},'include':[{'model':db[_0x108108+_0x6d6d('0x6f')],'as':'Interaction'},{'model':db[_0x108108+_0x445196],'as':'Account'}]});})[_0x6d6d('0x17')](function(_0x5a7b23){if(_[_0x6d6d('0x12')](_0x5a7b23)){throw new Error(_0x108108+_0x6d6d('0x70'));}_0x5885c5=_0x5a7b23;return _0x5a7b23['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x1d2668={'uniqueid':_0x581027+'.'+_0x5885c5['id']+'.'+_0x5885c5['Interaction']['id'],'FromUserId':_0xf5586f[_0x6d6d('0x35')]['id'],'type':_0x6d6d('0x71')};_0x1d2668[_0x108108+_0x6d6d('0x72')]=_0x5885c5['id'];_0x1d2668[_0x108108+_0x6d6d('0x73')]=_0x5885c5[_0x6d6d('0x6f')]['id'];_0x1d2668[_0x6d6d('0x74')+_0x108108+_0x445196+'Id']=_0x5885c5[_0x6d6d('0x69')]['id'];_0x1d2668['To'+_0x108108+_0x6d6d('0x75')]=_0x39f986['id'];return db[_0x108108+'TransferReport'][_0x6d6d('0x76')](_0x1d2668);})[_0x6d6d('0x17')](function(){return respondWithRpcPromise(_0x6d6d('0x77'),{'channel':_0x581027,'interaction':_0x5885c5['Interaction'],'message':_0x5885c5,'account':_0x5885c5['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x6d6d('0x71'),'appdata':_0x39f986[_0x6d6d('0x10')]+','+(_0x5885c5[_0x6d6d('0x69')]['queueTransferTimeout']||0x12c),'interval':_0x6d6d('0x78')}]},routingClient);})[_0x6d6d('0x17')](respondWithResult(_0x50eea6,null))['catch'](handleError(_0x50eea6,null));};};exports[_0x6d6d('0x79')]=function(_0x721d98,_0xa8ec98){var _0x155edb,_0x21057d;if(_['isNil'](_0x721d98[_0x6d6d('0x24')][_0x6d6d('0x7a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x56825d=_0x721d98[_0x6d6d('0x24')][_0x6d6d('0x7a')];var _0xe80727=_[_0x6d6d('0x7b')](_0x56825d);var _0x5a8974=_0x56825d===_0x6d6d('0x67')?'Website':_0x6d6d('0x69');return db[_0x6d6d('0x7c')][_0x6d6d('0x6b')]({'raw':!![],'where':{'id':_0x721d98[_0x6d6d('0x1d')]['id'],'role':_0x6d6d('0x40')}})[_0x6d6d('0x17')](function(_0x39c1a5){if(_[_0x6d6d('0x12')](_0x39c1a5)){throw new Error(_0x6d6d('0x7d'));}_0x155edb=_0x39c1a5;return db[_0xe80727+_0x6d6d('0x6d')][_0x6d6d('0x6b')]({'where':{'id':_0x721d98[_0x6d6d('0x24')][_0x6d6d('0x6e')]},'include':[{'model':db[_0xe80727+_0x6d6d('0x6f')],'as':_0x6d6d('0x6f')},{'model':db[_0xe80727+_0x5a8974],'as':_0x6d6d('0x69')}]});})[_0x6d6d('0x17')](function(_0xccbc07){if(_[_0x6d6d('0x12')](_0xccbc07)){throw new Error(_0xe80727+_0x6d6d('0x70'));}_0x21057d=_0xccbc07;return _0xccbc07['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3445f5={'uniqueid':_0x56825d+'.'+_0x21057d['id']+'.'+_0x21057d[_0x6d6d('0x6f')]['id'],'FromUserId':_0x721d98[_0x6d6d('0x35')]['id'],'type':_0x6d6d('0x71'),'ToUserId':_0x155edb['id']};_0x3445f5[_0xe80727+_0x6d6d('0x72')]=_0x21057d['id'];_0x3445f5[_0xe80727+_0x6d6d('0x73')]=_0x21057d[_0x6d6d('0x6f')]['id'];_0x3445f5[_0x6d6d('0x74')+_0xe80727+_0x5a8974+'Id']=_0x21057d[_0x6d6d('0x69')]['id'];return db[_0xe80727+_0x6d6d('0x7e')][_0x6d6d('0x76')](_0x3445f5);})[_0x6d6d('0x17')](function(){return respondWithRpcPromise(_0x6d6d('0x77'),{'channel':_0x56825d,'interaction':_0x21057d[_0x6d6d('0x6f')],'message':_0x21057d,'account':_0x21057d[_0x6d6d('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x155edb[_0x6d6d('0x10')]+','+(_0x21057d[_0x6d6d('0x69')][_0x6d6d('0x7f')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0xa8ec98,null))['catch'](handleError(_0xa8ec98,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 1ec404b..f94ff8b 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 _0x2461=['/:id','run','post','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get'];(function(_0x57a65e,_0x33a406){var _0x3cfaf8=function(_0x5095cd){while(--_0x5095cd){_0x57a65e['push'](_0x57a65e['shift']());}};_0x3cfaf8(++_0x33a406);}(_0x2461,0x1f3));var _0x1246=function(_0x1d21fe,_0x40e827){_0x1d21fe=_0x1d21fe-0x0;var _0xf0eda7=_0x2461[_0x1d21fe];return _0xf0eda7;};'use strict';var multer=require('multer');var util=require(_0x1246('0x0'));var path=require(_0x1246('0x1'));var timeout=require(_0x1246('0x2'));var express=require(_0x1246('0x3'));var router=express[_0x1246('0x4')]();var fs_extra=require(_0x1246('0x5'));var auth=require(_0x1246('0x6'));var interaction=require(_0x1246('0x7'));var config=require('../../config/environment');var controller=require('./schedule.controller');router['get']('/',auth[_0x1246('0x8')](),controller[_0x1246('0x9')]);router[_0x1246('0xa')](_0x1246('0xb'),auth[_0x1246('0x8')](),controller['show']);router[_0x1246('0xa')]('/:id/run',auth[_0x1246('0x8')](),controller[_0x1246('0xc')]);router[_0x1246('0xd')]('/',auth[_0x1246('0x8')](),controller['create']);router[_0x1246('0xe')](_0x1246('0xb'),auth['isAuthenticated'](),controller[_0x1246('0xf')]);router[_0x1246('0x10')](_0x1246('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x06e2=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/run','post','put','update','delete','destroy','express'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x06e2,0x176));var _0x206e=function(_0xc9094d,_0xeb60aa){_0xc9094d=_0xc9094d-0x0;var _0x15c344=_0x06e2[_0xc9094d];return _0x15c344;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x206e('0x0'));var router=express[_0x206e('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x206e('0x2'));var interaction=require(_0x206e('0x3'));var config=require(_0x206e('0x4'));var controller=require('./schedule.controller');router[_0x206e('0x5')]('/',auth[_0x206e('0x6')](),controller[_0x206e('0x7')]);router[_0x206e('0x5')](_0x206e('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x206e('0x5')](_0x206e('0x9'),auth[_0x206e('0x6')](),controller['run']);router[_0x206e('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x206e('0xb')](_0x206e('0x8'),auth[_0x206e('0x6')](),controller[_0x206e('0xc')]);router[_0x206e('0xd')](_0x206e('0x8'),auth[_0x206e('0x6')](),controller[_0x206e('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index a3cfabb..7e2a42e 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 _0xa52f=['days','minutes','ENUM','csv','xlsx','default','custom','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','quarters','months','weeks'];(function(_0x50b541,_0x1a00ed){var _0x52ec9c=function(_0x1fe110){while(--_0x1fe110){_0x50b541['push'](_0x50b541['shift']());}};_0x52ec9c(++_0x1a00ed);}(_0xa52f,0x1dc));var _0xfa52=function(_0x3dd69b,_0xed6a1c){_0x3dd69b=_0x3dd69b-0x0;var _0x49991b=_0xa52f[_0x3dd69b];return _0x49991b;};'use strict';var Sequelize=require('sequelize');module[_0xfa52('0x0')]={'name':{'type':Sequelize[_0xfa52('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xfa52('0x1')]},'active':{'type':Sequelize[_0xfa52('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfa52('0x3')},'startAt':{'type':Sequelize[_0xfa52('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xfa52('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xfa52('0x6'),_0xfa52('0x7'),_0xfa52('0x8'),_0xfa52('0x9'),_0xfa52('0xa'),'hours',_0xfa52('0xb')),'allowNull':![],'defaultValue':_0xfa52('0xa')},'output':{'type':Sequelize[_0xfa52('0xc')](_0xfa52('0xd'),'pdf',_0xfa52('0xe')),'allowNull':![],'defaultValue':_0xfa52('0xd')},'type':{'type':Sequelize['ENUM']('custom',_0xfa52('0xf')),'allowNull':![],'defaultValue':_0xfa52('0x10')},'sendMail':{'type':Sequelize[_0xfa52('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xfa52('0x11')]},'bcc':{'type':Sequelize[_0xfa52('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x6bf9=['sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','days','hours','minutes','pdf','xlsx','custom','default','TEXT'];(function(_0x4ef155,_0x528c1a){var _0x31f196=function(_0x17ad04){while(--_0x17ad04){_0x4ef155['push'](_0x4ef155['shift']());}};_0x31f196(++_0x528c1a);}(_0x6bf9,0x77));var _0x96bf=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0x6bf9[_0x547456];return _0xc1fd7b;};'use strict';var Sequelize=require(_0x96bf('0x0'));module[_0x96bf('0x1')]={'name':{'type':Sequelize[_0x96bf('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x96bf('0x2')]},'active':{'type':Sequelize[_0x96bf('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x96bf('0x4')},'startAt':{'type':Sequelize[_0x96bf('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x96bf('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x96bf('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x96bf('0x7')](_0x96bf('0x8'),'quarters','months','weeks',_0x96bf('0x9'),_0x96bf('0xa'),_0x96bf('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x96bf('0x7')]('csv',_0x96bf('0xc'),_0x96bf('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x96bf('0x7')](_0x96bf('0xe'),_0x96bf('0xf')),'allowNull':![],'defaultValue':_0x96bf('0xe')},'sendMail':{'type':Sequelize[_0x96bf('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x96bf('0x10')]},'bcc':{'type':Sequelize[_0x96bf('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x96bf('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 760501b..1c6b269 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 _0xb8ce=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','reject','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','map','Schedule','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','merge','VIRTUAL','filter','options','count','findAll','rows','catch','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','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','papaparse','ioredis','../../components/auth/service'];(function(_0x3a34b5,_0x59fca5){var _0x3f064e=function(_0x1b0b71){while(--_0x1b0b71){_0x3a34b5['push'](_0x3a34b5['shift']());}};_0x3f064e(++_0x59fca5);}(_0xb8ce,0xe8));var _0xeb8c=function(_0x37dfe9,_0x105b58){_0x37dfe9=_0x37dfe9-0x0;var _0x21cc87=_0xb8ce[_0x37dfe9];return _0x21cc87;};'use strict';var emlformat=require(_0xeb8c('0x0'));var rimraf=require(_0xeb8c('0x1'));var zipdir=require(_0xeb8c('0x2'));var jsonpatch=require(_0xeb8c('0x3'));var rp=require(_0xeb8c('0x4'));var moment=require(_0xeb8c('0x5'));var BPromise=require(_0xeb8c('0x6'));var Mustache=require(_0xeb8c('0x7'));var util=require(_0xeb8c('0x8'));var path=require(_0xeb8c('0x9'));var sox=require(_0xeb8c('0xa'));var csv=require(_0xeb8c('0xb'));var ejs=require(_0xeb8c('0xc'));var fs=require('fs');var fs_extra=require(_0xeb8c('0xd'));var _=require(_0xeb8c('0xe'));var squel=require(_0xeb8c('0xf'));var crypto=require(_0xeb8c('0x10'));var jsforce=require(_0xeb8c('0x11'));var deskjs=require(_0xeb8c('0x12'));var toCsv=require(_0xeb8c('0xb'));var querystring=require(_0xeb8c('0x13'));var Papa=require(_0xeb8c('0x14'));var Redis=require(_0xeb8c('0x15'));var authService=require(_0xeb8c('0x16'));var qs=require(_0xeb8c('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb8c('0x18'));var logger=require(_0xeb8c('0x19'))('api');var utils=require(_0xeb8c('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xeb8c('0x1b'));var db=require(_0xeb8c('0x1c'))['db'];function respondWithStatusCode(_0x98980c,_0x59a6d8){_0x59a6d8=_0x59a6d8||0xcc;return function(_0x36d327){if(_0x36d327){return _0x98980c[_0xeb8c('0x1d')](_0x59a6d8);}return _0x98980c['status'](_0x59a6d8)[_0xeb8c('0x1e')]();};}function respondWithResult(_0x363cae,_0x3689b5){_0x3689b5=_0x3689b5||0xc8;return function(_0x54c115){if(_0x54c115){return _0x363cae[_0xeb8c('0x1f')](_0x3689b5)[_0xeb8c('0x20')](_0x54c115);}};}function respondWithFilteredResult(_0x3126bb,_0x4cbd46){return function(_0x58b047){if(_0x58b047){var _0x39f533=typeof _0x4cbd46[_0xeb8c('0x21')]===_0xeb8c('0x22')&&typeof _0x4cbd46[_0xeb8c('0x23')]===_0xeb8c('0x22');var _0x4c2679=_0x58b047['count'];var _0x47aec3=_0x39f533?0x0:_0x4cbd46[_0xeb8c('0x21')];var _0x4296d9=_0x39f533?_0x58b047['count']:_0x4cbd46[_0xeb8c('0x21')]+_0x4cbd46[_0xeb8c('0x23')];var _0x8e434c;if(_0x4296d9>=_0x4c2679){_0x4296d9=_0x4c2679;_0x8e434c=0xc8;}else{_0x8e434c=0xce;}_0x3126bb[_0xeb8c('0x1f')](_0x8e434c);return _0x3126bb[_0xeb8c('0x24')]('Content-Range',_0x47aec3+'-'+_0x4296d9+'/'+_0x4c2679)[_0xeb8c('0x20')](_0x58b047);}return null;};}function patchUpdates(_0x3b8025){return function(_0x18b1e3){try{jsonpatch['apply'](_0x18b1e3,_0x3b8025,!![]);}catch(_0x3457c0){return BPromise[_0xeb8c('0x25')](_0x3457c0);}return _0x18b1e3['save']();};}function saveUpdates(_0xf972d0,_0x19958e){return function(_0x3dbce3){if(_0x3dbce3){return _0x3dbce3[_0xeb8c('0x26')](_0xf972d0)[_0xeb8c('0x27')](function(_0x48746c){return _0x48746c;});}return null;};}function removeEntity(_0x12d21c,_0x18d17f){return function(_0x4f3f8b){if(_0x4f3f8b){return _0x4f3f8b[_0xeb8c('0x28')]()[_0xeb8c('0x27')](function(){var _0x1a0e49=_0x4f3f8b[_0xeb8c('0x29')]({'plain':!![]});var _0x4ff0c7=_0xeb8c('0x2a');return db[_0xeb8c('0x2b')][_0xeb8c('0x28')]({'where':{'type':_0x4ff0c7,'resourceId':_0x1a0e49['id']}})[_0xeb8c('0x27')](function(){return _0x4f3f8b;});})['then'](function(){_0x12d21c[_0xeb8c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x534aef,_0x5e2503){return function(_0x44158e){if(!_0x44158e){_0x534aef[_0xeb8c('0x1d')](0x194);}return _0x44158e;};}function handleError(_0x4172a1,_0x4edebf){_0x4edebf=_0x4edebf||0x1f4;return function(_0x3d0681){logger[_0xeb8c('0x2c')](_0x3d0681[_0xeb8c('0x2d')]);if(_0x3d0681[_0xeb8c('0x2e')]){delete _0x3d0681['name'];}_0x4172a1[_0xeb8c('0x1f')](_0x4edebf)[_0xeb8c('0x2f')](_0x3d0681);};}exports['index']=function(_0x2b921b,_0x2b9236){var _0x30f2c7={},_0x2f7fce={},_0x55c09c={'count':0x0,'rows':[]};var _0x6d4948=_[_0xeb8c('0x30')](db[_0xeb8c('0x31')]['rawAttributes'],function(_0x48b850){return{'name':_0x48b850['fieldName'],'type':_0x48b850[_0xeb8c('0x32')][_0xeb8c('0x33')]};});_0x2f7fce[_0xeb8c('0x34')]=_[_0xeb8c('0x30')](_0x6d4948,_0xeb8c('0x2e'));_0x2f7fce[_0xeb8c('0x35')]=_[_0xeb8c('0x36')](_0x2b921b['query']);_0x2f7fce[_0xeb8c('0x37')]=_[_0xeb8c('0x38')](_0x2f7fce['model'],_0x2f7fce[_0xeb8c('0x35')]);_0x30f2c7['attributes']=_['intersection'](_0x2f7fce['model'],qs[_0xeb8c('0x39')](_0x2b921b[_0xeb8c('0x35')]['fields']));_0x30f2c7[_0xeb8c('0x3a')]=_0x30f2c7['attributes'][_0xeb8c('0x3b')]?_0x30f2c7[_0xeb8c('0x3a')]:_0x2f7fce[_0xeb8c('0x34')];if(!_0x2b921b[_0xeb8c('0x35')]['hasOwnProperty']('nolimit')){_0x30f2c7[_0xeb8c('0x23')]=qs['limit'](_0x2b921b[_0xeb8c('0x35')][_0xeb8c('0x23')]);_0x30f2c7['offset']=qs[_0xeb8c('0x21')](_0x2b921b[_0xeb8c('0x35')][_0xeb8c('0x21')]);}_0x30f2c7[_0xeb8c('0x3c')]=qs['sort'](_0x2b921b[_0xeb8c('0x35')][_0xeb8c('0x3d')]);_0x30f2c7[_0xeb8c('0x3e')]=qs['filters'](_['pick'](_0x2b921b['query'],_0x2f7fce[_0xeb8c('0x37')]),_0x6d4948);if(_0x2b921b[_0xeb8c('0x35')]['filter']){_0x30f2c7[_0xeb8c('0x3e')]=_[_0xeb8c('0x3f')](_0x30f2c7['where'],{'$or':_['map'](_0x6d4948,function(_0x2c2dbe){if(_0x2c2dbe[_0xeb8c('0x32')]!==_0xeb8c('0x40')){var _0x2d6277={};_0x2d6277[_0x2c2dbe[_0xeb8c('0x2e')]]={'$like':'%'+_0x2b921b['query'][_0xeb8c('0x41')]+'%'};return _0x2d6277;}})});}_0x30f2c7=_[_0xeb8c('0x3f')]({},_0x30f2c7,_0x2b921b[_0xeb8c('0x42')]);var _0xdda2f4={'where':_0x30f2c7[_0xeb8c('0x3e')]};return db['Schedule'][_0xeb8c('0x43')](_0xdda2f4)[_0xeb8c('0x27')](function(_0x2a103f){_0x55c09c[_0xeb8c('0x43')]=_0x2a103f;if(_0x2b921b[_0xeb8c('0x35')]['includeAll']){_0x30f2c7['include']=[{'all':!![]}];}return db[_0xeb8c('0x31')][_0xeb8c('0x44')](_0x30f2c7);})['then'](function(_0x35c96c){_0x55c09c[_0xeb8c('0x45')]=_0x35c96c;return _0x55c09c;})[_0xeb8c('0x27')](respondWithFilteredResult(_0x2b9236,_0x30f2c7))[_0xeb8c('0x46')](handleError(_0x2b9236,null));};exports['show']=function(_0x5ab0d9,_0x308eab){var _0x32f9d7={'raw':![],'where':{'id':_0x5ab0d9['params']['id']}},_0x59b95b={};_0x59b95b[_0xeb8c('0x34')]=_[_0xeb8c('0x36')](db['Schedule'][_0xeb8c('0x47')]);_0x59b95b[_0xeb8c('0x35')]=_[_0xeb8c('0x36')](_0x5ab0d9[_0xeb8c('0x35')]);_0x59b95b['filters']=_[_0xeb8c('0x38')](_0x59b95b[_0xeb8c('0x34')],_0x59b95b[_0xeb8c('0x35')]);_0x32f9d7[_0xeb8c('0x3a')]=_['intersection'](_0x59b95b[_0xeb8c('0x34')],qs[_0xeb8c('0x39')](_0x5ab0d9[_0xeb8c('0x35')]['fields']));_0x32f9d7[_0xeb8c('0x3a')]=_0x32f9d7[_0xeb8c('0x3a')]['length']?_0x32f9d7[_0xeb8c('0x3a')]:_0x59b95b['model'];if(_0x5ab0d9[_0xeb8c('0x35')][_0xeb8c('0x48')]){_0x32f9d7[_0xeb8c('0x49')]=[{'all':!![]}];}_0x32f9d7=_['merge']({},_0x32f9d7,_0x5ab0d9[_0xeb8c('0x42')]);return db[_0xeb8c('0x31')][_0xeb8c('0x4a')](_0x32f9d7)[_0xeb8c('0x27')](handleEntityNotFound(_0x308eab,null))[_0xeb8c('0x27')](respondWithResult(_0x308eab,null))[_0xeb8c('0x46')](handleError(_0x308eab,null));};exports[_0xeb8c('0x4b')]=function(_0x554c3b,_0x1047fa){return db[_0xeb8c('0x31')]['create'](_0x554c3b[_0xeb8c('0x4c')],{})[_0xeb8c('0x27')](function(_0x1839fb){var _0x42d52d=_0x554c3b[_0xeb8c('0x4d')][_0xeb8c('0x29')]({'plain':!![]});if(!_0x42d52d)throw new Error(_0xeb8c('0x4e'));if(_0x42d52d[_0xeb8c('0x4f')]==='user'){var _0x3bad44=_0x1839fb[_0xeb8c('0x29')]({'plain':!![]});var _0x508cfa=_0xeb8c('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x508cfa,'userProfileId':_0x42d52d[_0xeb8c('0x50')]},'raw':!![]})[_0xeb8c('0x27')](function(_0x503ceb){if(_0x503ceb&&_0x503ceb[_0xeb8c('0x51')]===0x0){return db[_0xeb8c('0x2b')]['create']({'name':_0x3bad44[_0xeb8c('0x2e')],'resourceId':_0x3bad44['id'],'type':_0x503ceb[_0xeb8c('0x2e')],'sectionId':_0x503ceb['id']},{})[_0xeb8c('0x27')](function(){return _0x1839fb;});}else{return _0x1839fb;}})[_0xeb8c('0x46')](function(_0x2049b8){logger[_0xeb8c('0x2c')](_0xeb8c('0x52'),_0x2049b8);throw _0x2049b8;});}return _0x1839fb;})['then'](respondWithResult(_0x1047fa,0xc9))['catch'](handleError(_0x1047fa,null));};exports['update']=function(_0x184577,_0x145022){if(_0x184577[_0xeb8c('0x4c')]['id']){delete _0x184577[_0xeb8c('0x4c')]['id'];}return db[_0xeb8c('0x31')]['find']({'where':{'id':_0x184577['params']['id']}})['then'](handleEntityNotFound(_0x145022,null))[_0xeb8c('0x27')](saveUpdates(_0x184577[_0xeb8c('0x4c')],null))['then'](respondWithResult(_0x145022,null))[_0xeb8c('0x46')](handleError(_0x145022,null));};exports[_0xeb8c('0x28')]=function(_0x519c90,_0x33d390){return db[_0xeb8c('0x31')]['find']({'where':{'id':_0x519c90['params']['id']}})['then'](handleEntityNotFound(_0x33d390,null))[_0xeb8c('0x27')](removeEntity(_0x33d390,null))[_0xeb8c('0x46')](handleError(_0x33d390,null));};exports[_0xeb8c('0x53')]=function(_0x5302f5,_0x1c2bf9,_0x36d912){var _0x1754a1=require('../../config/schedule');return db[_0xeb8c('0x31')][_0xeb8c('0x4a')]({'where':{'id':_0x5302f5[_0xeb8c('0x54')]['id']},'raw':!![]})[_0xeb8c('0x27')](handleEntityNotFound(_0x1c2bf9,null))['then'](function(){_0x1754a1[_0xeb8c('0x53')](_0x5302f5[_0xeb8c('0x54')]['id']);})[_0xeb8c('0x27')](respondWithStatusCode(_0x1c2bf9,null))['catch'](handleError(_0x1c2bf9,null));}; \ No newline at end of file +var _0xde06=['rawAttributes','keys','merge','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','UserProfileResource','end','stack','name','send','map','Schedule','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x5ebb05,_0x3d6d91){var _0x47b01c=function(_0xb7239d){while(--_0xb7239d){_0x5ebb05['push'](_0x5ebb05['shift']());}};_0x47b01c(++_0x3d6d91);}(_0xde06,0x1be));var _0x6de0=function(_0x4c6664,_0x1cea29){_0x4c6664=_0x4c6664-0x0;var _0x5230cf=_0xde06[_0x4c6664];return _0x5230cf;};'use strict';var emlformat=require(_0x6de0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6de0('0x1'));var rp=require(_0x6de0('0x2'));var moment=require(_0x6de0('0x3'));var BPromise=require(_0x6de0('0x4'));var Mustache=require(_0x6de0('0x5'));var util=require(_0x6de0('0x6'));var path=require('path');var sox=require(_0x6de0('0x7'));var csv=require(_0x6de0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6de0('0x9'));var _=require(_0x6de0('0xa'));var squel=require(_0x6de0('0xb'));var crypto=require(_0x6de0('0xc'));var jsforce=require(_0x6de0('0xd'));var deskjs=require(_0x6de0('0xe'));var toCsv=require(_0x6de0('0x8'));var querystring=require(_0x6de0('0xf'));var Papa=require(_0x6de0('0x10'));var Redis=require('ioredis');var authService=require(_0x6de0('0x11'));var qs=require(_0x6de0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6de0('0x13'))(_0x6de0('0x14'));var utils=require(_0x6de0('0x15'));var config=require(_0x6de0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6de0('0x17'))['db'];function respondWithStatusCode(_0x3c2750,_0x3ea646){_0x3ea646=_0x3ea646||0xcc;return function(_0x456bfe){if(_0x456bfe){return _0x3c2750[_0x6de0('0x18')](_0x3ea646);}return _0x3c2750['status'](_0x3ea646)['end']();};}function respondWithResult(_0x22fe4e,_0x4483c9){_0x4483c9=_0x4483c9||0xc8;return function(_0x4a8919){if(_0x4a8919){return _0x22fe4e[_0x6de0('0x19')](_0x4483c9)[_0x6de0('0x1a')](_0x4a8919);}};}function respondWithFilteredResult(_0x2cd558,_0x101d5a){return function(_0x59f507){if(_0x59f507){var _0x5da41a=typeof _0x101d5a[_0x6de0('0x1b')]===_0x6de0('0x1c')&&typeof _0x101d5a[_0x6de0('0x1d')]===_0x6de0('0x1c');var _0x29194e=_0x59f507[_0x6de0('0x1e')];var _0x2701bb=_0x5da41a?0x0:_0x101d5a[_0x6de0('0x1b')];var _0x2a17e1=_0x5da41a?_0x59f507[_0x6de0('0x1e')]:_0x101d5a[_0x6de0('0x1b')]+_0x101d5a[_0x6de0('0x1d')];var _0x1dec79;if(_0x2a17e1>=_0x29194e){_0x2a17e1=_0x29194e;_0x1dec79=0xc8;}else{_0x1dec79=0xce;}_0x2cd558['status'](_0x1dec79);return _0x2cd558[_0x6de0('0x1f')]('Content-Range',_0x2701bb+'-'+_0x2a17e1+'/'+_0x29194e)['json'](_0x59f507);}return null;};}function patchUpdates(_0x339da4){return function(_0x3ecd3a){try{jsonpatch[_0x6de0('0x20')](_0x3ecd3a,_0x339da4,!![]);}catch(_0x5c63ea){return BPromise[_0x6de0('0x21')](_0x5c63ea);}return _0x3ecd3a[_0x6de0('0x22')]();};}function saveUpdates(_0x7be445,_0x6ad0d1){return function(_0xf089cf){if(_0xf089cf){return _0xf089cf[_0x6de0('0x23')](_0x7be445)[_0x6de0('0x24')](function(_0x2502bb){return _0x2502bb;});}return null;};}function removeEntity(_0x4c8bd7,_0x1b1b93){return function(_0x2ec61f){if(_0x2ec61f){return _0x2ec61f[_0x6de0('0x25')]()['then'](function(){var _0x3ff497=_0x2ec61f['get']({'plain':!![]});var _0x393322='Scheduler';return db[_0x6de0('0x26')][_0x6de0('0x25')]({'where':{'type':_0x393322,'resourceId':_0x3ff497['id']}})[_0x6de0('0x24')](function(){return _0x2ec61f;});})[_0x6de0('0x24')](function(){_0x4c8bd7[_0x6de0('0x19')](0xcc)[_0x6de0('0x27')]();});}};}function handleEntityNotFound(_0x4da526,_0xc711db){return function(_0x585547){if(!_0x585547){_0x4da526[_0x6de0('0x18')](0x194);}return _0x585547;};}function handleError(_0x52f8a8,_0x529532){_0x529532=_0x529532||0x1f4;return function(_0xafa16b){logger['error'](_0xafa16b[_0x6de0('0x28')]);if(_0xafa16b[_0x6de0('0x29')]){delete _0xafa16b['name'];}_0x52f8a8[_0x6de0('0x19')](_0x529532)[_0x6de0('0x2a')](_0xafa16b);};}exports['index']=function(_0x7b8f02,_0x46c17c){var _0x5b2e76={},_0x1e9608={},_0x1f0907={'count':0x0,'rows':[]};var _0x260af2=_[_0x6de0('0x2b')](db[_0x6de0('0x2c')]['rawAttributes'],function(_0x13f34e){return{'name':_0x13f34e[_0x6de0('0x2d')],'type':_0x13f34e[_0x6de0('0x2e')][_0x6de0('0x2f')]};});_0x1e9608[_0x6de0('0x30')]=_[_0x6de0('0x2b')](_0x260af2,_0x6de0('0x29'));_0x1e9608[_0x6de0('0x31')]=_['keys'](_0x7b8f02[_0x6de0('0x31')]);_0x1e9608[_0x6de0('0x32')]=_[_0x6de0('0x33')](_0x1e9608[_0x6de0('0x30')],_0x1e9608[_0x6de0('0x31')]);_0x5b2e76[_0x6de0('0x34')]=_[_0x6de0('0x33')](_0x1e9608[_0x6de0('0x30')],qs[_0x6de0('0x35')](_0x7b8f02[_0x6de0('0x31')][_0x6de0('0x35')]));_0x5b2e76[_0x6de0('0x34')]=_0x5b2e76[_0x6de0('0x34')][_0x6de0('0x36')]?_0x5b2e76['attributes']:_0x1e9608[_0x6de0('0x30')];if(!_0x7b8f02['query'][_0x6de0('0x37')](_0x6de0('0x38'))){_0x5b2e76[_0x6de0('0x1d')]=qs[_0x6de0('0x1d')](_0x7b8f02[_0x6de0('0x31')]['limit']);_0x5b2e76[_0x6de0('0x1b')]=qs['offset'](_0x7b8f02['query'][_0x6de0('0x1b')]);}_0x5b2e76[_0x6de0('0x39')]=qs[_0x6de0('0x3a')](_0x7b8f02['query'][_0x6de0('0x3a')]);_0x5b2e76[_0x6de0('0x3b')]=qs[_0x6de0('0x32')](_[_0x6de0('0x3c')](_0x7b8f02[_0x6de0('0x31')],_0x1e9608[_0x6de0('0x32')]),_0x260af2);if(_0x7b8f02['query'][_0x6de0('0x3d')]){_0x5b2e76['where']=_['merge'](_0x5b2e76[_0x6de0('0x3b')],{'$or':_['map'](_0x260af2,function(_0x384ec8){if(_0x384ec8[_0x6de0('0x2e')]!=='VIRTUAL'){var _0x1c2ccd={};_0x1c2ccd[_0x384ec8['name']]={'$like':'%'+_0x7b8f02[_0x6de0('0x31')]['filter']+'%'};return _0x1c2ccd;}})});}_0x5b2e76=_['merge']({},_0x5b2e76,_0x7b8f02[_0x6de0('0x3e')]);var _0x1e4151={'where':_0x5b2e76[_0x6de0('0x3b')]};return db[_0x6de0('0x2c')][_0x6de0('0x1e')](_0x1e4151)[_0x6de0('0x24')](function(_0x2765a9){_0x1f0907[_0x6de0('0x1e')]=_0x2765a9;if(_0x7b8f02[_0x6de0('0x31')][_0x6de0('0x3f')]){_0x5b2e76[_0x6de0('0x40')]=[{'all':!![]}];}return db[_0x6de0('0x2c')][_0x6de0('0x41')](_0x5b2e76);})[_0x6de0('0x24')](function(_0x375592){_0x1f0907[_0x6de0('0x42')]=_0x375592;return _0x1f0907;})['then'](respondWithFilteredResult(_0x46c17c,_0x5b2e76))[_0x6de0('0x43')](handleError(_0x46c17c,null));};exports[_0x6de0('0x44')]=function(_0x4610e4,_0x431e3f){var _0x4510d0={'raw':![],'where':{'id':_0x4610e4[_0x6de0('0x45')]['id']}},_0x30fbff={};_0x30fbff[_0x6de0('0x30')]=_['keys'](db['Schedule'][_0x6de0('0x46')]);_0x30fbff[_0x6de0('0x31')]=_[_0x6de0('0x47')](_0x4610e4[_0x6de0('0x31')]);_0x30fbff[_0x6de0('0x32')]=_['intersection'](_0x30fbff[_0x6de0('0x30')],_0x30fbff[_0x6de0('0x31')]);_0x4510d0[_0x6de0('0x34')]=_[_0x6de0('0x33')](_0x30fbff[_0x6de0('0x30')],qs['fields'](_0x4610e4[_0x6de0('0x31')]['fields']));_0x4510d0['attributes']=_0x4510d0['attributes'][_0x6de0('0x36')]?_0x4510d0[_0x6de0('0x34')]:_0x30fbff[_0x6de0('0x30')];if(_0x4610e4[_0x6de0('0x31')]['includeAll']){_0x4510d0['include']=[{'all':!![]}];}_0x4510d0=_[_0x6de0('0x48')]({},_0x4510d0,_0x4610e4[_0x6de0('0x3e')]);return db[_0x6de0('0x2c')][_0x6de0('0x49')](_0x4510d0)['then'](handleEntityNotFound(_0x431e3f,null))['then'](respondWithResult(_0x431e3f,null))[_0x6de0('0x43')](handleError(_0x431e3f,null));};exports['create']=function(_0x50ac4d,_0x4ea699){return db[_0x6de0('0x2c')]['create'](_0x50ac4d[_0x6de0('0x4a')],{})[_0x6de0('0x24')](function(_0x398d68){var _0x3c66fb=_0x50ac4d[_0x6de0('0x4b')][_0x6de0('0x4c')]({'plain':!![]});if(!_0x3c66fb)throw new Error(_0x6de0('0x4d'));if(_0x3c66fb[_0x6de0('0x4e')]===_0x6de0('0x4b')){var _0xfa60b8=_0x398d68[_0x6de0('0x4c')]({'plain':!![]});var _0x4bc3bc=_0x6de0('0x4f');return db[_0x6de0('0x50')][_0x6de0('0x49')]({'where':{'name':_0x4bc3bc,'userProfileId':_0x3c66fb[_0x6de0('0x51')]},'raw':!![]})[_0x6de0('0x24')](function(_0x59047e){if(_0x59047e&&_0x59047e[_0x6de0('0x52')]===0x0){return db[_0x6de0('0x26')][_0x6de0('0x53')]({'name':_0xfa60b8[_0x6de0('0x29')],'resourceId':_0xfa60b8['id'],'type':_0x59047e['name'],'sectionId':_0x59047e['id']},{})[_0x6de0('0x24')](function(){return _0x398d68;});}else{return _0x398d68;}})[_0x6de0('0x43')](function(_0x2960dd){logger['error'](_0x6de0('0x54'),_0x2960dd);throw _0x2960dd;});}return _0x398d68;})[_0x6de0('0x24')](respondWithResult(_0x4ea699,0xc9))['catch'](handleError(_0x4ea699,null));};exports['update']=function(_0xce9484,_0x38d2a1){if(_0xce9484[_0x6de0('0x4a')]['id']){delete _0xce9484[_0x6de0('0x4a')]['id'];}return db[_0x6de0('0x2c')][_0x6de0('0x49')]({'where':{'id':_0xce9484['params']['id']}})[_0x6de0('0x24')](handleEntityNotFound(_0x38d2a1,null))[_0x6de0('0x24')](saveUpdates(_0xce9484['body'],null))[_0x6de0('0x24')](respondWithResult(_0x38d2a1,null))[_0x6de0('0x43')](handleError(_0x38d2a1,null));};exports[_0x6de0('0x25')]=function(_0x46c24c,_0x409266){return db['Schedule'][_0x6de0('0x49')]({'where':{'id':_0x46c24c['params']['id']}})[_0x6de0('0x24')](handleEntityNotFound(_0x409266,null))[_0x6de0('0x24')](removeEntity(_0x409266,null))[_0x6de0('0x43')](handleError(_0x409266,null));};exports[_0x6de0('0x55')]=function(_0xa62b07,_0x262bd9,_0x428f1d){var _0x23b2c3=require('../../config/schedule');return db[_0x6de0('0x2c')][_0x6de0('0x49')]({'where':{'id':_0xa62b07[_0x6de0('0x45')]['id']},'raw':!![]})[_0x6de0('0x24')](handleEntityNotFound(_0x262bd9,null))[_0x6de0('0x24')](function(){_0x23b2c3[_0x6de0('0x55')](_0xa62b07[_0x6de0('0x45')]['id']);})[_0x6de0('0x24')](respondWithStatusCode(_0x262bd9,null))[_0x6de0('0x43')](handleError(_0x262bd9,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 2ea9a32..d3a9d1e 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 _0xc629=['bluebird','request-promise','path','rimraf','./schedule.attributes','exports','tools_schedules','lodash','../../config/logger','moment'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xc629,0x18d));var _0x9c62=function(_0x1b8359,_0x58a90d){_0x1b8359=_0x1b8359-0x0;var _0x4fb6ac=_0xc629[_0x1b8359];return _0x4fb6ac;};'use strict';var _=require(_0x9c62('0x0'));var util=require('util');var logger=require(_0x9c62('0x1'))('api');var moment=require(_0x9c62('0x2'));var BPromise=require(_0x9c62('0x3'));var rp=require(_0x9c62('0x4'));var fs=require('fs');var path=require(_0x9c62('0x5'));var rimraf=require(_0x9c62('0x6'));var config=require('../../config/environment');var attributes=require(_0x9c62('0x7'));module[_0x9c62('0x8')]=function(_0x1d5bd8,_0x55d894){return _0x1d5bd8['define']('Schedule',attributes,{'tableName':_0x9c62('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a28=['moment','request-promise','path','rimraf','../../config/environment','exports','lodash'];(function(_0x42a278,_0x31d5b7){var _0x38f992=function(_0x228608){while(--_0x228608){_0x42a278['push'](_0x42a278['shift']());}};_0x38f992(++_0x31d5b7);}(_0x3a28,0x1f0));var _0x83a2=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x3a28[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x83a2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x83a2('0x1'));var BPromise=require('bluebird');var rp=require(_0x83a2('0x2'));var fs=require('fs');var path=require(_0x83a2('0x3'));var rimraf=require(_0x83a2('0x4'));var config=require(_0x83a2('0x5'));var attributes=require('./schedule.attributes');module[_0x83a2('0x6')]=function(_0x415bd7,_0x4c69d2){return _0x415bd7['define']('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index c371cbe..323a68b 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 _0x3325=['Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x3325,0xef));var _0x5332=function(_0x2a829f,_0x1b0c15){_0x2a829f=_0x2a829f-0x0;var _0x5737c3=_0x3325[_0x2a829f];return _0x5737c3;};'use strict';var _=require('lodash');var util=require(_0x5332('0x0'));var moment=require(_0x5332('0x1'));var BPromise=require(_0x5332('0x2'));var rs=require(_0x5332('0x3'));var fs=require('fs');var Redis=require(_0x5332('0x4'));var db=require(_0x5332('0x5'))['db'];var utils=require(_0x5332('0x6'));var logger=require(_0x5332('0x7'))(_0x5332('0x8'));var config=require('../../config/environment');var jayson=require(_0x5332('0x9'));var client=jayson[_0x5332('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f967e,_0x30d03d,_0x461646){return new BPromise(function(_0xaad308,_0x289a07){return client[_0x5332('0xb')](_0x3f967e,_0x461646)[_0x5332('0xc')](function(_0x26c4ad){logger[_0x5332('0xd')](_0x5332('0xe'),_0x30d03d,_0x5332('0xf'));logger[_0x5332('0x10')](_0x5332('0x11'),_0x30d03d,_0x5332('0xf'),JSON['stringify'](_0x26c4ad));if(_0x26c4ad['error']){if(_0x26c4ad['error'][_0x5332('0x12')]===0x1f4){logger[_0x5332('0x13')](_0x5332('0xe'),_0x30d03d,_0x26c4ad[_0x5332('0x13')]['message']);return _0x289a07(_0x26c4ad[_0x5332('0x13')]['message']);}logger[_0x5332('0x13')](_0x5332('0xe'),_0x30d03d,_0x26c4ad[_0x5332('0x13')][_0x5332('0x14')]);return _0xaad308(_0x26c4ad['error'][_0x5332('0x14')]);}else{logger['info'](_0x5332('0xe'),_0x30d03d,'request\x20sent');_0xaad308(_0x26c4ad[_0x5332('0x15')][_0x5332('0x14')]);}})[_0x5332('0x16')](function(_0x5a4337){logger[_0x5332('0x13')]('Schedule,\x20%s,\x20%s',_0x30d03d,_0x5a4337);_0x289a07(_0x5a4337);});});} \ No newline at end of file +var _0x8392=['then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x384c03,_0x31d8ba){var _0xad7640=function(_0x1c67c0){while(--_0x1c67c0){_0x384c03['push'](_0x384c03['shift']());}};_0xad7640(++_0x31d8ba);}(_0x8392,0x1ed));var _0x2839=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8392[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x2839('0x0'));var util=require(_0x2839('0x1'));var moment=require('moment');var BPromise=require(_0x2839('0x2'));var rs=require(_0x2839('0x3'));var fs=require('fs');var Redis=require(_0x2839('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2839('0x5'));var logger=require(_0x2839('0x6'))(_0x2839('0x7'));var config=require('../../config/environment');var jayson=require(_0x2839('0x8'));var client=jayson[_0x2839('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e46c7,_0x5a86fa,_0x50c7b9){return new BPromise(function(_0x4b96da,_0x339a50){return client[_0x2839('0xa')](_0x5e46c7,_0x50c7b9)[_0x2839('0xb')](function(_0x555d78){logger[_0x2839('0xc')](_0x2839('0xd'),_0x5a86fa,_0x2839('0xe'));logger['debug'](_0x2839('0xf'),_0x5a86fa,_0x2839('0xe'),JSON[_0x2839('0x10')](_0x555d78));if(_0x555d78[_0x2839('0x11')]){if(_0x555d78[_0x2839('0x11')][_0x2839('0x12')]===0x1f4){logger[_0x2839('0x11')](_0x2839('0xd'),_0x5a86fa,_0x555d78[_0x2839('0x11')][_0x2839('0x13')]);return _0x339a50(_0x555d78[_0x2839('0x11')][_0x2839('0x13')]);}logger[_0x2839('0x11')](_0x2839('0xd'),_0x5a86fa,_0x555d78['error'][_0x2839('0x13')]);return _0x4b96da(_0x555d78[_0x2839('0x11')][_0x2839('0x13')]);}else{logger[_0x2839('0xc')](_0x2839('0xd'),_0x5a86fa,'request\x20sent');_0x4b96da(_0x555d78[_0x2839('0x14')][_0x2839('0x13')]);}})['catch'](function(_0x586c9c){logger[_0x2839('0x11')](_0x2839('0xd'),_0x5a86fa,_0x586c9c);_0x339a50(_0x586c9c);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 9667667..f20190c 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 _0x4681=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/:id','/:id/download','create','put','update'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0x4681,0xd5));var _0x1468=function(_0x3abb24,_0x17b07e){_0x3abb24=_0x3abb24-0x0;var _0x9ad833=_0x4681[_0x3abb24];return _0x9ad833;};'use strict';var multer=require(_0x1468('0x0'));var util=require(_0x1468('0x1'));var path=require('path');var timeout=require(_0x1468('0x2'));var express=require(_0x1468('0x3'));var router=express[_0x1468('0x4')]();var fs_extra=require(_0x1468('0x5'));var auth=require(_0x1468('0x6'));var interaction=require(_0x1468('0x7'));var config=require(_0x1468('0x8'));var controller=require(_0x1468('0x9'));router[_0x1468('0xa')]('/',auth[_0x1468('0xb')](),controller[_0x1468('0xc')]);router[_0x1468('0xa')]('/describe',auth[_0x1468('0xb')](),controller['describe']);router[_0x1468('0xa')](_0x1468('0xd'),auth[_0x1468('0xb')](),controller['show']);router[_0x1468('0xa')](_0x1468('0xe'),auth[_0x1468('0xb')](),controller['download']);router['post']('/',auth[_0x1468('0xb')](),controller[_0x1468('0xf')]);router[_0x1468('0x10')](_0x1468('0xd'),auth[_0x1468('0xb')](),controller[_0x1468('0x11')]);router[_0x1468('0x12')](_0x1468('0xd'),auth['isAuthenticated'](),controller[_0x1468('0x13')]);module[_0x1468('0x14')]=router; \ No newline at end of file +var _0x2b23=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/download','download','post','create','put','/:id','update','delete'];(function(_0xacd3d,_0x168242){var _0x15c3e5=function(_0x526614){while(--_0x526614){_0xacd3d['push'](_0xacd3d['shift']());}};_0x15c3e5(++_0x168242);}(_0x2b23,0x1e3));var _0x32b2=function(_0x493b05,_0x848e39){_0x493b05=_0x493b05-0x0;var _0x37c778=_0x2b23[_0x493b05];return _0x37c778;};'use strict';var multer=require(_0x32b2('0x0'));var util=require(_0x32b2('0x1'));var path=require(_0x32b2('0x2'));var timeout=require(_0x32b2('0x3'));var express=require(_0x32b2('0x4'));var router=express[_0x32b2('0x5')]();var fs_extra=require(_0x32b2('0x6'));var auth=require(_0x32b2('0x7'));var interaction=require(_0x32b2('0x8'));var config=require(_0x32b2('0x9'));var controller=require('./screenRecording.controller');router[_0x32b2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32b2('0xa')]('/describe',auth[_0x32b2('0xb')](),controller['describe']);router[_0x32b2('0xa')]('/:id',auth[_0x32b2('0xb')](),controller[_0x32b2('0xc')]);router['get'](_0x32b2('0xd'),auth['isAuthenticated'](),controller[_0x32b2('0xe')]);router[_0x32b2('0xf')]('/',auth['isAuthenticated'](),controller[_0x32b2('0x10')]);router[_0x32b2('0x11')](_0x32b2('0x12'),auth['isAuthenticated'](),controller[_0x32b2('0x13')]);router[_0x32b2('0x14')](_0x32b2('0x12'),auth[_0x32b2('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 2cee853..fa64afb 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 _0x3fc6=['exports','VIRTUAL','value','extname','getDataValue','STRING','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','../../config/environment'];(function(_0x4c7b20,_0x361515){var _0x4872bd=function(_0x358e19){while(--_0x358e19){_0x4c7b20['push'](_0x4c7b20['shift']());}};_0x4872bd(++_0x361515);}(_0x3fc6,0x115));var _0x63fc=function(_0x4739a4,_0x13ddd8){_0x4739a4=_0x4739a4-0x0;var _0x410c38=_0x3fc6[_0x4739a4];return _0x410c38;};'use strict';var Sequelize=require(_0x63fc('0x0'));var moment=require('moment');var path=require(_0x63fc('0x1'));var config=require(_0x63fc('0x2'));module[_0x63fc('0x3')]={'format':{'type':Sequelize[_0x63fc('0x4')],'get':function(){return this['getDataValue'](_0x63fc('0x5'))?path[_0x63fc('0x6')](this[_0x63fc('0x7')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x63fc('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x63fc('0x8')],'set':function(_0x1c7f72){var _0x3e8157=_0x1c7f72['replace'](/\\/g,'/');this[_0x63fc('0x9')](_0x63fc('0x5'),_0x3e8157);}},'rating':{'type':Sequelize[_0x63fc('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x63fc('0xa')],'set':function(_0x32749b){this['setDataValue'](_0x63fc('0xb'),moment()['subtract'](_0x32749b,'ms'));this['setDataValue'](_0x63fc('0xc'),moment());this[_0x63fc('0x9')](_0x63fc('0xd'),_0x32749b);}},'startedAt':{'type':Sequelize[_0x63fc('0xe')],'get':function(){return moment(this[_0x63fc('0x7')](_0x63fc('0xb')))[_0x63fc('0xf')](_0x63fc('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0x63fc('0xe')],'get':function(){return moment(this[_0x63fc('0x7')](_0x63fc('0xc')))['format'](_0x63fc('0x10'))[_0x63fc('0x11')]();}},'createdAt':{'type':Sequelize[_0x63fc('0xe')],'get':function(){return moment(this['getDataValue'](_0x63fc('0x12')))[_0x63fc('0xf')](_0x63fc('0x10'))[_0x63fc('0x11')]();}},'updatedAt':{'type':Sequelize[_0x63fc('0xe')],'get':function(){return moment(this[_0x63fc('0x7')](_0x63fc('0x13')))[_0x63fc('0xf')](_0x63fc('0x10'))[_0x63fc('0x11')]();}}}; \ No newline at end of file +var _0xf4c9=['DATE','toString','createdAt','MM-DD-YYYY\x20HH:mm','updatedAt','format','sequelize','moment','path','exports','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xf4c9[_0x178e48];return _0x440d7e;};'use strict';var Sequelize=require(_0x9f4c('0x0'));var moment=require(_0x9f4c('0x1'));var path=require(_0x9f4c('0x2'));var config=require('../../config/environment');module[_0x9f4c('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9f4c('0x4')](_0x9f4c('0x5'))?path[_0x9f4c('0x6')](this['getDataValue'](_0x9f4c('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9f4c('0x7')]},'value':{'type':Sequelize['STRING'],'set':function(_0x5cf322){var _0x498795=_0x5cf322[_0x9f4c('0x8')](/\\/g,'/');this[_0x9f4c('0x9')](_0x9f4c('0x5'),_0x498795);}},'rating':{'type':Sequelize[_0x9f4c('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x9f4c('0xa')],'set':function(_0x37b693){this['setDataValue'](_0x9f4c('0xb'),moment()[_0x9f4c('0xc')](_0x37b693,'ms'));this[_0x9f4c('0x9')](_0x9f4c('0xd'),moment());this[_0x9f4c('0x9')](_0x9f4c('0xe'),_0x37b693);}},'startedAt':{'type':Sequelize[_0x9f4c('0xf')],'get':function(){return moment(this[_0x9f4c('0x4')]('startedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0x9f4c('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x9f4c('0xd')))['format']('MM-DD-YYYY\x20HH:mm')[_0x9f4c('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x9f4c('0x11')))['format'](_0x9f4c('0x12'))[_0x9f4c('0x10')]();}},'updatedAt':{'type':Sequelize[_0x9f4c('0xf')],'get':function(){return moment(this[_0x9f4c('0x4')](_0x9f4c('0x13')))[_0x9f4c('0x14')]('MM-DD-YYYY\x20HH:mm')[_0x9f4c('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index b02e70f..20f7a0b 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 _0x2bd8=['unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','ScreenRecording','rawAttributes','type','model','differenceBy','map','name','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','rows','catch','show','params','find','create','body','duration','createdAt','closedAt','value','../../components/encryptor','uniqueid','%s.cypher','secrets','recording','join','root','server/files/screen_recordings','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname'];(function(_0x58e2b2,_0x48d744){var _0x3d7cee=function(_0x34efc2){while(--_0x34efc2){_0x58e2b2['push'](_0x58e2b2['shift']());}};_0x3d7cee(++_0x48d744);}(_0x2bd8,0x130));var _0x82bd=function(_0x4e41a8,_0x24d5f7){_0x4e41a8=_0x4e41a8-0x0;var _0x5250ba=_0x2bd8[_0x4e41a8];return _0x5250ba;};'use strict';var emlformat=require(_0x82bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82bd('0x1'));var jsonpatch=require(_0x82bd('0x2'));var rp=require(_0x82bd('0x3'));var moment=require(_0x82bd('0x4'));var BPromise=require(_0x82bd('0x5'));var Mustache=require(_0x82bd('0x6'));var util=require(_0x82bd('0x7'));var path=require('path');var sox=require(_0x82bd('0x8'));var csv=require(_0x82bd('0x9'));var ejs=require(_0x82bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x82bd('0x13'))['db'];function respondWithStatusCode(_0x5f1ab9,_0xfaccf7){_0xfaccf7=_0xfaccf7||0xcc;return function(_0x51e17e){if(_0x51e17e){return _0x5f1ab9[_0x82bd('0x14')](_0xfaccf7);}return _0x5f1ab9[_0x82bd('0x15')](_0xfaccf7)[_0x82bd('0x16')]();};}function respondWithResult(_0x2ca530,_0x58d82b){_0x58d82b=_0x58d82b||0xc8;return function(_0x446ffc){if(_0x446ffc){return _0x2ca530[_0x82bd('0x15')](_0x58d82b)['json'](_0x446ffc);}};}function respondWithFilteredResult(_0x3667ef,_0x4db39d){return function(_0x35dd09){if(_0x35dd09){var _0x433e7d=typeof _0x4db39d[_0x82bd('0x17')]===_0x82bd('0x18')&&typeof _0x4db39d[_0x82bd('0x19')]===_0x82bd('0x18');var _0x387d21=_0x35dd09[_0x82bd('0x1a')];var _0x31a350=_0x433e7d?0x0:_0x4db39d[_0x82bd('0x17')];var _0x390107=_0x433e7d?_0x35dd09[_0x82bd('0x1a')]:_0x4db39d[_0x82bd('0x17')]+_0x4db39d[_0x82bd('0x19')];var _0x4a1e62;if(_0x390107>=_0x387d21){_0x390107=_0x387d21;_0x4a1e62=0xc8;}else{_0x4a1e62=0xce;}_0x3667ef['status'](_0x4a1e62);return _0x3667ef[_0x82bd('0x1b')](_0x82bd('0x1c'),_0x31a350+'-'+_0x390107+'/'+_0x387d21)[_0x82bd('0x1d')](_0x35dd09);}return null;};}function patchUpdates(_0xc9fcdf){return function(_0x34899b){try{jsonpatch[_0x82bd('0x1e')](_0x34899b,_0xc9fcdf,!![]);}catch(_0x2c1810){return BPromise[_0x82bd('0x1f')](_0x2c1810);}return _0x34899b[_0x82bd('0x20')]();};}function saveUpdates(_0x3291cd,_0x2caa29){return function(_0x177025){if(_0x177025){return _0x177025[_0x82bd('0x21')](_0x3291cd)[_0x82bd('0x22')](function(_0x3d9f03){return _0x3d9f03;});}return null;};}function removeEntity(_0x2d9d95,_0x13a42a){return function(_0x3b6b93){if(_0x3b6b93){return _0x3b6b93[_0x82bd('0x23')]()['then'](function(){_0x2d9d95['status'](0xcc)[_0x82bd('0x16')]();});}};}function handleEntityNotFound(_0x436ecd,_0x1cb292){return function(_0x3eb6a5){if(!_0x3eb6a5){_0x436ecd[_0x82bd('0x14')](0x194);}return _0x3eb6a5;};}function handleError(_0x10d101,_0x3c7751){_0x3c7751=_0x3c7751||0x1f4;return function(_0xbef23b){logger[_0x82bd('0x24')](_0xbef23b[_0x82bd('0x25')]);if(_0xbef23b['name']){delete _0xbef23b['name'];}_0x10d101['status'](_0x3c7751)['send'](_0xbef23b);};}exports[_0x82bd('0x26')]=function(_0x52bcd8,_0x351d3d){var _0x190bca={},_0x363ef9={},_0x50585e={'count':0x0,'rows':[]};var _0x516c6d=_['map'](db[_0x82bd('0x27')][_0x82bd('0x28')],function(_0x40884f){return{'name':_0x40884f['fieldName'],'type':_0x40884f[_0x82bd('0x29')]['key']};});_0x363ef9[_0x82bd('0x2a')]=_[_0x82bd('0x2b')](_[_0x82bd('0x2c')](_0x516c6d,_0x82bd('0x2d')),[_0x82bd('0x2e')]);_0x363ef9[_0x82bd('0x2f')]=_['keys'](_0x52bcd8[_0x82bd('0x2f')]);_0x363ef9[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x363ef9['model'],_0x363ef9[_0x82bd('0x2f')]);_0x190bca['attributes']=_['intersection'](_0x363ef9[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x32')]));_0x190bca[_0x82bd('0x33')]=_0x190bca[_0x82bd('0x33')][_0x82bd('0x34')]?_0x190bca[_0x82bd('0x33')]:_0x363ef9[_0x82bd('0x2a')];if(!_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x35')](_0x82bd('0x36'))){_0x190bca[_0x82bd('0x19')]=qs[_0x82bd('0x19')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x19')]);_0x190bca[_0x82bd('0x17')]=qs['offset'](_0x52bcd8['query']['offset']);}_0x190bca[_0x82bd('0x37')]=qs[_0x82bd('0x38')](_0x52bcd8['query'][_0x82bd('0x38')]);_0x190bca['where']=qs['filters'](_['pick'](_0x52bcd8[_0x82bd('0x2f')],_0x363ef9[_0x82bd('0x30')]),_0x516c6d);if(_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]){_0x190bca[_0x82bd('0x3a')]=_['merge'](_0x190bca['where'],{'$or':_['map'](_0x516c6d,function(_0x64bc54){if(_0x64bc54['type']!=='VIRTUAL'){var _0xba38a4={};_0xba38a4[_0x64bc54[_0x82bd('0x2d')]]={'$like':'%'+_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]+'%'};return _0xba38a4;}})});}_0x190bca=_[_0x82bd('0x3b')]({},_0x190bca,_0x52bcd8[_0x82bd('0x3c')]);var _0x65335b={'where':_0x190bca[_0x82bd('0x3a')]};return db[_0x82bd('0x27')]['count'](_0x65335b)['then'](function(_0xe210f4){_0x50585e[_0x82bd('0x1a')]=_0xe210f4;if(_0x52bcd8['query']['includeAll']){_0x190bca[_0x82bd('0x3d')]=[{'all':!![]}];}return db[_0x82bd('0x27')]['findAll'](_0x190bca);})[_0x82bd('0x22')](function(_0x21868d){_0x50585e[_0x82bd('0x3e')]=_0x21868d;return _0x50585e;})[_0x82bd('0x22')](respondWithFilteredResult(_0x351d3d,_0x190bca))[_0x82bd('0x3f')](handleError(_0x351d3d,null));};exports[_0x82bd('0x40')]=function(_0x2a18c3,_0x2c429d){var _0x21d7d4={'raw':![],'where':{'id':_0x2a18c3[_0x82bd('0x41')]['id']}},_0x239d48={};_0x239d48[_0x82bd('0x2a')]=_['keys'](db[_0x82bd('0x27')][_0x82bd('0x28')]);_0x239d48['query']=_['keys'](_0x2a18c3[_0x82bd('0x2f')]);_0x239d48[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x239d48[_0x82bd('0x2a')],_0x239d48[_0x82bd('0x2f')]);_0x21d7d4['attributes']=_['intersection'](_0x239d48[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x2a18c3['query'][_0x82bd('0x32')]));_0x21d7d4['attributes']=_0x21d7d4[_0x82bd('0x33')][_0x82bd('0x34')]?_0x21d7d4['attributes']:_0x239d48[_0x82bd('0x2a')];if(_0x2a18c3[_0x82bd('0x2f')]['includeAll']){_0x21d7d4['include']=[{'all':!![]}];}_0x21d7d4=_[_0x82bd('0x3b')]({},_0x21d7d4,_0x2a18c3['options']);return db[_0x82bd('0x27')][_0x82bd('0x42')](_0x21d7d4)[_0x82bd('0x22')](handleEntityNotFound(_0x2c429d,null))[_0x82bd('0x22')](respondWithResult(_0x2c429d,null))['catch'](handleError(_0x2c429d,null));};exports['create']=function(_0x1852f2,_0x5a0ca6){return db['ScreenRecording'][_0x82bd('0x43')](_0x1852f2[_0x82bd('0x44')],{})[_0x82bd('0x22')](respondWithResult(_0x5a0ca6,0xc9))['catch'](handleError(_0x5a0ca6,null));};exports[_0x82bd('0x21')]=function(_0x92ba88,_0x1db61b){if(_0x92ba88[_0x82bd('0x44')]['id']){delete _0x92ba88[_0x82bd('0x44')]['id'];}delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x45')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x46')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x47')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x48')];return db['ScreenRecording'][_0x82bd('0x42')]({'where':{'id':_0x92ba88[_0x82bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x1db61b,null))[_0x82bd('0x22')](saveUpdates(_0x92ba88[_0x82bd('0x44')],null))[_0x82bd('0x22')](respondWithResult(_0x1db61b,null))[_0x82bd('0x3f')](handleError(_0x1db61b,null));};exports['describe']=function(_0x5b4fd2,_0x37d1f0){return db['ScreenRecording']['describe']()[_0x82bd('0x22')](respondWithResult(_0x37d1f0,null))['catch'](handleError(_0x37d1f0,null));};exports['download']=function(_0x31b41d,_0x3f94f3,_0x3dbee7){var _0xcfb5ef=require(_0x82bd('0x49'));var _0x1a7402=![];var _0x417c29={};if(_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]&&_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]===_0x82bd('0x4a')){_0x417c29[_0x82bd('0x4a')]=_0x31b41d[_0x82bd('0x41')]['id'];}else{_0x417c29['id']=_0x31b41d[_0x82bd('0x41')]['id'];}return db['ScreenRecording'][_0x82bd('0x42')]({'where':_0x417c29,'attributes':['id',_0x82bd('0x48')],'raw':!![]})[_0x82bd('0x22')](handleEntityNotFound(_0x3f94f3,null))[_0x82bd('0x22')](function(_0x9bf8fa){if(_0x9bf8fa){var _0x5466d9=path['join'](config['root'],'server/files/screen_recordings',_0x9bf8fa[_0x82bd('0x48')]);var _0x2cc6ea=util[_0x82bd('0x2e')](_0x82bd('0x4b'),_0x5466d9);if(fs['existsSync'](_0x2cc6ea)){_0x1a7402=!![];return _0xcfb5ef['decryptFile'](_0x2cc6ea,_0x5466d9,config[_0x82bd('0x4c')][_0x82bd('0x4d')])[_0x82bd('0x22')](function(){return _0x9bf8fa;});}return _0x9bf8fa;}})['then'](function(_0x2657bc){if(_0x2657bc){var _0x2252ef=path[_0x82bd('0x4e')](config[_0x82bd('0x4f')],_0x82bd('0x50'),_0x2657bc[_0x82bd('0x48')]);if(!fs[_0x82bd('0x51')](_0x2252ef)){throw new db[(_0x82bd('0x52'))][(_0x82bd('0x53'))](_0x82bd('0x54'));}if(_0x2657bc[_0x82bd('0x55')]){return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,_0x2657bc[_0x82bd('0x55')]+path[_0x82bd('0x57')](_0x2252ef),function(){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}else{return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,function(_0x124ca4){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}}})['catch'](function(_0x566b01){if(_0x566b01['message']==='ScreenRecording\x20not\x20found'){_0x3f94f3[_0x82bd('0x15')](0x194)['send'](_0x82bd('0x59'));}else{return handleError(_0x3f94f3,null);}});};exports[_0x82bd('0x23')]=function(_0x3ee7c7,_0x409b06){return db[_0x82bd('0x27')][_0x82bd('0x42')]({'where':{'id':_0x3ee7c7[_0x82bd('0x41')]['id']}})[_0x82bd('0x22')](function(_0x40d6cf){if(_[_0x82bd('0x5a')](_0x40d6cf)){throw new ReferenceError(_0x82bd('0x5b'));}return _0x40d6cf;})['then'](function(_0x4c54f0){var _0x419965=path[_0x82bd('0x4e')](config['root'],'server/files/screen_recordings',_0x4c54f0[_0x82bd('0x48')]);logger[_0x82bd('0x5c')](_0x82bd('0x5d'),_0x419965);if(!_[_0x82bd('0x5a')](_0x4c54f0['value'])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs['unlinkSync'](_0x419965);}_0x419965=_0x419965+_0x82bd('0x60');if(!_[_0x82bd('0x5a')](_0x4c54f0[_0x82bd('0x48')])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs[_0x82bd('0x61')](_0x419965);}return _0x4c54f0;})[_0x82bd('0x22')](function(_0x243fba){if(!_0x243fba)throw new InternalError();return _0x243fba[_0x82bd('0x23')]();})[_0x82bd('0x22')](function(){_0x409b06[_0x82bd('0x15')](0xcc)[_0x82bd('0x16')]();})['catch'](handleError(_0x409b06,null));}; \ No newline at end of file +var _0x9a19=['limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','map','ScreenRecording','fieldName','type','key','model','differenceBy','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','duration','value','find','describe','download','../../components/encryptor','uniqueid','join','root','format','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','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','sendStatus','status','end','offset','undefined'];(function(_0x438578,_0xeccb24){var _0x55f90b=function(_0x2ef1fd){while(--_0x2ef1fd){_0x438578['push'](_0x438578['shift']());}};_0x55f90b(++_0xeccb24);}(_0x9a19,0x114));var _0x99a1=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x9a19[_0x31ced5];return _0x10d9e5;};'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'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0x3c813,_0x491341){return function(_0x4fe7f7){if(!_0x4fe7f7){_0x3c813[_0x99a1('0x19')](0x194);}return _0x4fe7f7;};}function handleError(_0x5dabd9,_0x5dc733){_0x5dc733=_0x5dc733||0x1f4;return function(_0xafea84){logger[_0x99a1('0x25')](_0xafea84[_0x99a1('0x26')]);if(_0xafea84[_0x99a1('0x27')]){delete _0xafea84[_0x99a1('0x27')];}_0x5dabd9[_0x99a1('0x1a')](_0x5dc733)[_0x99a1('0x28')](_0xafea84);};}exports['index']=function(_0xf41b0d,_0x499eef){var _0x255197={},_0x1137f2={},_0x26fbae={'count':0x0,'rows':[]};var _0x523668=_[_0x99a1('0x29')](db[_0x99a1('0x2a')]['rawAttributes'],function(_0x37514e){return{'name':_0x37514e[_0x99a1('0x2b')],'type':_0x37514e[_0x99a1('0x2c')][_0x99a1('0x2d')]};});_0x1137f2[_0x99a1('0x2e')]=_[_0x99a1('0x2f')](_[_0x99a1('0x29')](_0x523668,_0x99a1('0x27')),['format']);_0x1137f2['query']=_[_0x99a1('0x30')](_0xf41b0d['query']);_0x1137f2[_0x99a1('0x31')]=_[_0x99a1('0x32')](_0x1137f2['model'],_0x1137f2[_0x99a1('0x33')]);_0x255197[_0x99a1('0x34')]=_[_0x99a1('0x32')](_0x1137f2[_0x99a1('0x2e')],qs[_0x99a1('0x35')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x35')]));_0x255197[_0x99a1('0x34')]=_0x255197[_0x99a1('0x34')][_0x99a1('0x36')]?_0x255197[_0x99a1('0x34')]:_0x1137f2[_0x99a1('0x2e')];if(!_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x37')]('nolimit')){_0x255197['limit']=qs[_0x99a1('0x1e')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x1e')]);_0x255197[_0x99a1('0x1c')]=qs[_0x99a1('0x1c')](_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x1c')]);}_0x255197['order']=qs[_0x99a1('0x38')](_0xf41b0d[_0x99a1('0x33')]['sort']);_0x255197[_0x99a1('0x39')]=qs[_0x99a1('0x31')](_[_0x99a1('0x3a')](_0xf41b0d[_0x99a1('0x33')],_0x1137f2[_0x99a1('0x31')]),_0x523668);if(_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3b')]){_0x255197[_0x99a1('0x39')]=_[_0x99a1('0x3c')](_0x255197[_0x99a1('0x39')],{'$or':_[_0x99a1('0x29')](_0x523668,function(_0x152969){if(_0x152969[_0x99a1('0x2c')]!=='VIRTUAL'){var _0x5553e4={};_0x5553e4[_0x152969['name']]={'$like':'%'+_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3b')]+'%'};return _0x5553e4;}})});}_0x255197=_[_0x99a1('0x3c')]({},_0x255197,_0xf41b0d[_0x99a1('0x3d')]);var _0x40613a={'where':_0x255197['where']};return db[_0x99a1('0x2a')][_0x99a1('0x1f')](_0x40613a)[_0x99a1('0x23')](function(_0x51efe5){_0x26fbae['count']=_0x51efe5;if(_0xf41b0d[_0x99a1('0x33')][_0x99a1('0x3e')]){_0x255197[_0x99a1('0x3f')]=[{'all':!![]}];}return db['ScreenRecording'][_0x99a1('0x40')](_0x255197);})[_0x99a1('0x23')](function(_0x1b5d2d){_0x26fbae[_0x99a1('0x41')]=_0x1b5d2d;return _0x26fbae;})[_0x99a1('0x23')](respondWithFilteredResult(_0x499eef,_0x255197))[_0x99a1('0x42')](handleError(_0x499eef,null));};exports[_0x99a1('0x43')]=function(_0x29d0a0,_0x1c4ce4){var _0x2be9e3={'raw':![],'where':{'id':_0x29d0a0[_0x99a1('0x44')]['id']}},_0x4b40e1={};_0x4b40e1[_0x99a1('0x2e')]=_[_0x99a1('0x30')](db['ScreenRecording'][_0x99a1('0x45')]);_0x4b40e1['query']=_[_0x99a1('0x30')](_0x29d0a0[_0x99a1('0x33')]);_0x4b40e1[_0x99a1('0x31')]=_[_0x99a1('0x32')](_0x4b40e1[_0x99a1('0x2e')],_0x4b40e1[_0x99a1('0x33')]);_0x2be9e3['attributes']=_[_0x99a1('0x32')](_0x4b40e1['model'],qs[_0x99a1('0x35')](_0x29d0a0[_0x99a1('0x33')][_0x99a1('0x35')]));_0x2be9e3[_0x99a1('0x34')]=_0x2be9e3[_0x99a1('0x34')][_0x99a1('0x36')]?_0x2be9e3[_0x99a1('0x34')]:_0x4b40e1[_0x99a1('0x2e')];if(_0x29d0a0[_0x99a1('0x33')][_0x99a1('0x3e')]){_0x2be9e3[_0x99a1('0x3f')]=[{'all':!![]}];}_0x2be9e3=_['merge']({},_0x2be9e3,_0x29d0a0[_0x99a1('0x3d')]);return db[_0x99a1('0x2a')]['find'](_0x2be9e3)[_0x99a1('0x23')](handleEntityNotFound(_0x1c4ce4,null))[_0x99a1('0x23')](respondWithResult(_0x1c4ce4,null))[_0x99a1('0x42')](handleError(_0x1c4ce4,null));};exports[_0x99a1('0x46')]=function(_0x113dd9,_0x254c41){return db[_0x99a1('0x2a')]['create'](_0x113dd9[_0x99a1('0x47')],{})['then'](respondWithResult(_0x254c41,0xc9))[_0x99a1('0x42')](handleError(_0x254c41,null));};exports[_0x99a1('0x48')]=function(_0x566442,_0x5433f2){if(_0x566442[_0x99a1('0x47')]['id']){delete _0x566442[_0x99a1('0x47')]['id'];}delete _0x566442[_0x99a1('0x47')][_0x99a1('0x49')];delete _0x566442[_0x99a1('0x47')]['createdAt'];delete _0x566442['body']['closedAt'];delete _0x566442[_0x99a1('0x47')][_0x99a1('0x4a')];return db[_0x99a1('0x2a')][_0x99a1('0x4b')]({'where':{'id':_0x566442[_0x99a1('0x44')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x5433f2,null))[_0x99a1('0x23')](saveUpdates(_0x566442['body'],null))[_0x99a1('0x23')](respondWithResult(_0x5433f2,null))[_0x99a1('0x42')](handleError(_0x5433f2,null));};exports[_0x99a1('0x4c')]=function(_0x5e877f,_0x81e218){return db['ScreenRecording']['describe']()[_0x99a1('0x23')](respondWithResult(_0x81e218,null))[_0x99a1('0x42')](handleError(_0x81e218,null));};exports[_0x99a1('0x4d')]=function(_0x175f6d,_0x11632d,_0xf8208a){var _0x240d2e=require(_0x99a1('0x4e'));var _0x16641e=![];var _0x53e9eb={};if(_0x175f6d[_0x99a1('0x33')]['type']&&_0x175f6d[_0x99a1('0x33')][_0x99a1('0x2c')]==='uniqueid'){_0x53e9eb[_0x99a1('0x4f')]=_0x175f6d[_0x99a1('0x44')]['id'];}else{_0x53e9eb['id']=_0x175f6d[_0x99a1('0x44')]['id'];}return db[_0x99a1('0x2a')][_0x99a1('0x4b')]({'where':_0x53e9eb,'attributes':['id',_0x99a1('0x4a')],'raw':!![]})[_0x99a1('0x23')](handleEntityNotFound(_0x11632d,null))[_0x99a1('0x23')](function(_0x28ba8f){if(_0x28ba8f){var _0x1c2926=path[_0x99a1('0x50')](config[_0x99a1('0x51')],'server/files/screen_recordings',_0x28ba8f['value']);var _0x2e3e08=util[_0x99a1('0x52')](_0x99a1('0x53'),_0x1c2926);if(fs[_0x99a1('0x54')](_0x2e3e08)){_0x16641e=!![];return _0x240d2e[_0x99a1('0x55')](_0x2e3e08,_0x1c2926,config['secrets'][_0x99a1('0x56')])[_0x99a1('0x23')](function(){return _0x28ba8f;});}return _0x28ba8f;}})['then'](function(_0x6107cd){if(_0x6107cd){var _0x95f20a=path[_0x99a1('0x50')](config[_0x99a1('0x51')],_0x99a1('0x57'),_0x6107cd['value']);if(!fs[_0x99a1('0x54')](_0x95f20a)){throw new db[(_0x99a1('0x58'))][(_0x99a1('0x59'))](_0x99a1('0x5a'));}if(_0x6107cd[_0x99a1('0x5b')]){return _0x11632d[_0x99a1('0x4d')](_0x95f20a,_0x6107cd['filename']+path[_0x99a1('0x5c')](_0x95f20a),function(){if(_0x16641e){fs[_0x99a1('0x5d')](_0x95f20a);}});}else{return _0x11632d['download'](_0x95f20a,function(_0x33feb9){if(_0x16641e){fs[_0x99a1('0x5d')](_0x95f20a);}});}}})[_0x99a1('0x42')](function(_0xb126dd){if(_0xb126dd[_0x99a1('0x5e')]==='ScreenRecording\x20not\x20found'){_0x11632d[_0x99a1('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x11632d,null);}});};exports['destroy']=function(_0x38ce3c,_0x3f7c16){return db['ScreenRecording']['find']({'where':{'id':_0x38ce3c[_0x99a1('0x44')]['id']}})['then'](function(_0x21a5f6){if(_[_0x99a1('0x5f')](_0x21a5f6)){throw new ReferenceError(_0x99a1('0x60'));}return _0x21a5f6;})[_0x99a1('0x23')](function(_0x56d6cf){var _0x18f74b=path[_0x99a1('0x50')](config[_0x99a1('0x51')],'server/files/screen_recordings',_0x56d6cf[_0x99a1('0x4a')]);logger['info'](_0x99a1('0x61'),_0x18f74b);if(!_[_0x99a1('0x5f')](_0x56d6cf[_0x99a1('0x4a')])&&fs[_0x99a1('0x54')](_0x18f74b)){logger[_0x99a1('0x62')]('File:\x20\x22'+_0x18f74b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x18f74b);}_0x18f74b=_0x18f74b+_0x99a1('0x63');if(!_[_0x99a1('0x5f')](_0x56d6cf['value'])&&fs['existsSync'](_0x18f74b)){logger[_0x99a1('0x62')](_0x99a1('0x64')+_0x18f74b+_0x99a1('0x65'));fs['unlinkSync'](_0x18f74b);}return _0x56d6cf;})['then'](function(_0x2b8df8){if(!_0x2b8df8)throw new InternalError();return _0x2b8df8['destroy']();})[_0x99a1('0x23')](function(){_0x3f7c16[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();})['catch'](handleError(_0x3f7c16,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 5d022ef..6fb4e31 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 _0x8285=['request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x8285,0x180));var _0x5828=function(_0xd56523,_0x3a5fdc){_0xd56523=_0xd56523-0x0;var _0x5b05ce=_0x8285[_0xd56523];return _0x5b05ce;};'use strict';var _=require(_0x5828('0x0'));var util=require(_0x5828('0x1'));var logger=require(_0x5828('0x2'))(_0x5828('0x3'));var moment=require(_0x5828('0x4'));var BPromise=require(_0x5828('0x5'));var rp=require(_0x5828('0x6'));var fs=require('fs');var path=require(_0x5828('0x7'));var rimraf=require('rimraf');var config=require(_0x5828('0x8'));var attributes=require(_0x5828('0x9'));module[_0x5828('0xa')]=function(_0x4feb85,_0x50c3bf){return _0x4feb85[_0x5828('0xb')]('ScreenRecording',attributes,{'tableName':_0x5828('0xc'),'paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0422=['define','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports'];(function(_0xcd3205,_0x2c5d7d){var _0x4a86a0=function(_0x53f8d8){while(--_0x53f8d8){_0xcd3205['push'](_0xcd3205['shift']());}};_0x4a86a0(++_0x2c5d7d);}(_0x0422,0xe3));var _0x2042=function(_0x2a1b33,_0x409f50){_0x2a1b33=_0x2a1b33-0x0;var _0x4c50e7=_0x0422[_0x2a1b33];return _0x4c50e7;};'use strict';var _=require(_0x2042('0x0'));var util=require(_0x2042('0x1'));var logger=require(_0x2042('0x2'))(_0x2042('0x3'));var moment=require(_0x2042('0x4'));var BPromise=require(_0x2042('0x5'));var rp=require(_0x2042('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2042('0x7'));var config=require(_0x2042('0x8'));var attributes=require(_0x2042('0x9'));module[_0x2042('0xa')]=function(_0x2b7663,_0x1d691d){return _0x2b7663[_0x2042('0xb')]('ScreenRecording',attributes,{'tableName':_0x2042('0xc'),'paranoid':![],'indexes':[{'name':_0x2042('0xd'),'fields':[_0x2042('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 57556e1..9667584 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 _0xb335=['debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb335,0x1e9));var _0x5b33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb335[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5b33('0x0'));var util=require(_0x5b33('0x1'));var moment=require(_0x5b33('0x2'));var BPromise=require(_0x5b33('0x3'));var rs=require(_0x5b33('0x4'));var fs=require('fs');var Redis=require(_0x5b33('0x5'));var db=require(_0x5b33('0x6'))['db'];var utils=require(_0x5b33('0x7'));var logger=require(_0x5b33('0x8'))(_0x5b33('0x9'));var config=require('../../config/environment');var jayson=require(_0x5b33('0xa'));var client=jayson[_0x5b33('0xb')][_0x5b33('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x102df7,_0x339b5c,_0x499e22){return new BPromise(function(_0x3de4a4,_0x4841ad){return client[_0x5b33('0xd')](_0x102df7,_0x499e22)['then'](function(_0x291d7f){logger[_0x5b33('0xe')](_0x5b33('0xf'),_0x339b5c,_0x5b33('0x10'));logger[_0x5b33('0x11')](_0x5b33('0x12'),_0x339b5c,_0x5b33('0x10'),JSON[_0x5b33('0x13')](_0x291d7f));if(_0x291d7f[_0x5b33('0x14')]){if(_0x291d7f['error'][_0x5b33('0x15')]===0x1f4){logger[_0x5b33('0x14')](_0x5b33('0xf'),_0x339b5c,_0x291d7f[_0x5b33('0x14')]['message']);return _0x4841ad(_0x291d7f[_0x5b33('0x14')][_0x5b33('0x16')]);}logger[_0x5b33('0x14')](_0x5b33('0xf'),_0x339b5c,_0x291d7f[_0x5b33('0x14')][_0x5b33('0x16')]);return _0x3de4a4(_0x291d7f[_0x5b33('0x14')][_0x5b33('0x16')]);}else{logger[_0x5b33('0xe')](_0x5b33('0xf'),_0x339b5c,_0x5b33('0x10'));_0x3de4a4(_0x291d7f['result'][_0x5b33('0x16')]);}})['catch'](function(_0x111c38){logger[_0x5b33('0x14')](_0x5b33('0xf'),_0x339b5c,_0x111c38);_0x4841ad(_0x111c38);});});} \ No newline at end of file +var _0xcd52=['http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xcd52,0xdc));var _0x2cd5=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xcd52[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require('lodash');var util=require(_0x2cd5('0x0'));var moment=require(_0x2cd5('0x1'));var BPromise=require(_0x2cd5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2cd5('0x3'));var db=require(_0x2cd5('0x4'))['db'];var utils=require(_0x2cd5('0x5'));var logger=require(_0x2cd5('0x6'))(_0x2cd5('0x7'));var config=require(_0x2cd5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2cd5('0x9')][_0x2cd5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x73420c,_0xd55a8f,_0x2dfef2){return new BPromise(function(_0x57d251,_0x23291d){return client[_0x2cd5('0xb')](_0x73420c,_0x2dfef2)[_0x2cd5('0xc')](function(_0x11c0cc){logger[_0x2cd5('0xd')](_0x2cd5('0xe'),_0xd55a8f,_0x2cd5('0xf'));logger[_0x2cd5('0x10')](_0x2cd5('0x11'),_0xd55a8f,'request\x20sent',JSON['stringify'](_0x11c0cc));if(_0x11c0cc['error']){if(_0x11c0cc[_0x2cd5('0x12')][_0x2cd5('0x13')]===0x1f4){logger[_0x2cd5('0x12')]('ScreenRecording,\x20%s,\x20%s',_0xd55a8f,_0x11c0cc[_0x2cd5('0x12')][_0x2cd5('0x14')]);return _0x23291d(_0x11c0cc[_0x2cd5('0x12')][_0x2cd5('0x14')]);}logger[_0x2cd5('0x12')](_0x2cd5('0xe'),_0xd55a8f,_0x11c0cc['error'][_0x2cd5('0x14')]);return _0x57d251(_0x11c0cc[_0x2cd5('0x12')]['message']);}else{logger['info'](_0x2cd5('0xe'),_0xd55a8f,'request\x20sent');_0x57d251(_0x11c0cc[_0x2cd5('0x15')][_0x2cd5('0x14')]);}})[_0x2cd5('0x16')](function(_0x180cb6){logger[_0x2cd5('0x12')](_0x2cd5('0xe'),_0xd55a8f,_0x180cb6);_0x23291d(_0x180cb6);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 39c9778..915edf8 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 _0xf21b=['file','addLogo','logologin','post','join','%s%s','preferred','addPreferred','favicon','addFavicon','put','isAuthenticated','update','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','getDate','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','root','server/files/images/logos/','format','logo','extname','originalname','single'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf21b,0x10a));var _0xbf21=function(_0x31ef6b,_0x46c3eb){_0x31ef6b=_0x31ef6b-0x0;var _0x5679e2=_0xf21b[_0x31ef6b];return _0x5679e2;};'use strict';var multer=require(_0xbf21('0x0'));var util=require(_0xbf21('0x1'));var path=require(_0xbf21('0x2'));var timeout=require('connect-timeout');var express=require(_0xbf21('0x3'));var router=express[_0xbf21('0x4')]();var fs_extra=require(_0xbf21('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbf21('0x6'));var config=require(_0xbf21('0x7'));var controller=require(_0xbf21('0x8'));router[_0xbf21('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbf21('0x9')]('/now',controller[_0xbf21('0xa')]);router['get'](_0xbf21('0xb'),controller[_0xbf21('0xc')]);router[_0xbf21('0x9')](_0xbf21('0xd'),controller['getLogo']);router[_0xbf21('0x9')](_0xbf21('0xe'),controller[_0xbf21('0xf')]);router[_0xbf21('0x9')]('/:id/gdpr',controller[_0xbf21('0x10')]);router[_0xbf21('0x9')](_0xbf21('0x11'),controller[_0xbf21('0x12')]);router['get'](_0xbf21('0x13'),controller['getFavicon']);var upload=multer({'storage':multer[_0xbf21('0x14')]({'destination':function(_0x5b548d,_0x1c325c,_0x1aedd5){_0x1aedd5(null,path['join'](config[_0xbf21('0x15')],_0xbf21('0x16')));},'filename':function(_0x4a7efc,_0x13bd00,_0x467a21){_0x467a21(null,util[_0xbf21('0x17')]('%s%s',_0xbf21('0x18'),path[_0xbf21('0x19')](_0x13bd00[_0xbf21('0x1a')])));}})});router['post'](_0xbf21('0xd'),upload[_0xbf21('0x1b')](_0xbf21('0x1c')),controller[_0xbf21('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29ec3e,_0x3acde6,_0x558411){_0x558411(null,path['join'](config[_0xbf21('0x15')],_0xbf21('0x16')));},'filename':function(_0x542a9e,_0x3e9f12,_0x28f70c){_0x28f70c(null,util[_0xbf21('0x17')]('%s%s',_0xbf21('0x1e'),path[_0xbf21('0x19')](_0x3e9f12[_0xbf21('0x1a')])));}})});router[_0xbf21('0x1f')](_0xbf21('0xe'),upload[_0xbf21('0x1b')](_0xbf21('0x1c')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xbf21('0x14')]({'destination':function(_0x20bbb7,_0x50a5f5,_0x157d75){_0x157d75(null,path[_0xbf21('0x20')](config[_0xbf21('0x15')],_0xbf21('0x16')));},'filename':function(_0x207058,_0x2de6a6,_0x5255f2){_0x5255f2(null,util[_0xbf21('0x17')](_0xbf21('0x21'),_0xbf21('0x22'),path[_0xbf21('0x19')](_0x2de6a6[_0xbf21('0x1a')])));}})});router['post'](_0xbf21('0x11'),upload['single'](_0xbf21('0x1c')),controller[_0xbf21('0x23')]);var upload=multer({'storage':multer[_0xbf21('0x14')]({'destination':function(_0x2f945c,_0x1ae7ed,_0x450616){_0x450616(null,path[_0xbf21('0x20')](config[_0xbf21('0x15')],_0xbf21('0x16')));},'filename':function(_0x10f3cb,_0x341214,_0x131ffe){_0x131ffe(null,util[_0xbf21('0x17')](_0xbf21('0x21'),_0xbf21('0x24'),path[_0xbf21('0x19')](_0x341214[_0xbf21('0x1a')])));}})});router['post']('/:id/favicon',upload[_0xbf21('0x1b')](_0xbf21('0x1c')),controller[_0xbf21('0x25')]);router[_0xbf21('0x26')]('/:id',auth[_0xbf21('0x27')](),controller[_0xbf21('0x28')]);module[_0xbf21('0x29')]=router; \ No newline at end of file +var _0x0a02=['../../config/environment','./setting.controller','get','isAuthenticated','index','getDate','/:id','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','%s%s','logo','extname','originalname','post','single','addLogo','format','logologin','/:id/logo_login','file','addLogoLogin','root','addPreferred','favicon','addFavicon','put','update','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5b991d,_0x43499d){var _0x3d1066=function(_0x9b26bc){while(--_0x9b26bc){_0x5b991d['push'](_0x5b991d['shift']());}};_0x3d1066(++_0x43499d);}(_0x0a02,0x19e));var _0x20a0=function(_0x4206f5,_0x21f338){_0x4206f5=_0x4206f5-0x0;var _0xa29cf3=_0x0a02[_0x4206f5];return _0xa29cf3;};'use strict';var multer=require(_0x20a0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x20a0('0x1'));var express=require(_0x20a0('0x2'));var router=express[_0x20a0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x20a0('0x4'));var interaction=require(_0x20a0('0x5'));var config=require(_0x20a0('0x6'));var controller=require(_0x20a0('0x7'));router[_0x20a0('0x8')]('/',auth[_0x20a0('0x9')](),controller[_0x20a0('0xa')]);router[_0x20a0('0x8')]('/now',controller[_0x20a0('0xb')]);router[_0x20a0('0x8')](_0x20a0('0xc'),controller['show']);router['get']('/:id/logo',controller['getLogo']);router['get']('/:id/logo_login',controller[_0x20a0('0xd')]);router[_0x20a0('0x8')](_0x20a0('0xe'),controller[_0x20a0('0xf')]);router[_0x20a0('0x8')](_0x20a0('0x10'),controller[_0x20a0('0x11')]);router['get'](_0x20a0('0x12'),controller[_0x20a0('0x13')]);var upload=multer({'storage':multer[_0x20a0('0x14')]({'destination':function(_0x956f6d,_0xf79518,_0x5e1c0f){_0x5e1c0f(null,path[_0x20a0('0x15')](config['root'],_0x20a0('0x16')));},'filename':function(_0x84e0a4,_0x286998,_0x440637){_0x440637(null,util['format'](_0x20a0('0x17'),_0x20a0('0x18'),path[_0x20a0('0x19')](_0x286998[_0x20a0('0x1a')])));}})});router[_0x20a0('0x1b')]('/:id/logo',upload[_0x20a0('0x1c')]('file'),controller[_0x20a0('0x1d')]);var upload=multer({'storage':multer[_0x20a0('0x14')]({'destination':function(_0x4d4f0e,_0x144f33,_0x2328a7){_0x2328a7(null,path[_0x20a0('0x15')](config['root'],_0x20a0('0x16')));},'filename':function(_0x1acea9,_0x2c844d,_0x42d839){_0x42d839(null,util[_0x20a0('0x1e')]('%s%s',_0x20a0('0x1f'),path['extname'](_0x2c844d[_0x20a0('0x1a')])));}})});router[_0x20a0('0x1b')](_0x20a0('0x20'),upload[_0x20a0('0x1c')](_0x20a0('0x21')),controller[_0x20a0('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d4522,_0x51e839,_0x214358){_0x214358(null,path[_0x20a0('0x15')](config[_0x20a0('0x23')],_0x20a0('0x16')));},'filename':function(_0x1a5fdd,_0x373a10,_0x43c7b7){_0x43c7b7(null,util[_0x20a0('0x1e')](_0x20a0('0x17'),'preferred',path['extname'](_0x373a10[_0x20a0('0x1a')])));}})});router['post']('/:id/preferred',upload[_0x20a0('0x1c')](_0x20a0('0x21')),controller[_0x20a0('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xd51d60,_0x192de7,_0x551767){_0x551767(null,path[_0x20a0('0x15')](config['root'],_0x20a0('0x16')));},'filename':function(_0x16a5e3,_0x38b234,_0x4b9c78){_0x4b9c78(null,util['format']('%s%s',_0x20a0('0x25'),path[_0x20a0('0x19')](_0x38b234['originalname'])));}})});router[_0x20a0('0x1b')](_0x20a0('0x12'),upload['single'](_0x20a0('0x21')),controller[_0x20a0('0x26')]);router[_0x20a0('0x27')](_0x20a0('0xc'),auth[_0x20a0('0x9')](),controller[_0x20a0('0x28')]);module[_0x20a0('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index da24894..39f3dc4 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(_0x35cd63,_0x25dc89){var _0xd72f9d=function(_0x2d8308){while(--_0x2d8308){_0x35cd63['push'](_0x35cd63['shift']());}};_0xd72f9d(++_0x25dc89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x1b8781,_0x414024){var _0x58eb86=function(_0x557b4c){while(--_0x557b4c){_0x1b8781['push'](_0x1b8781['shift']());}};_0x58eb86(++_0x414024);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 4edba2b..774ee6b 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 _0x35f9=['default_loginLogo.svg','custom','securePassword','addPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','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/license/util','../../mysqldb','jayson/promise','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','update','destroy','name','send','index','Setting','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','params','find','body','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin'];(function(_0x215299,_0x29e45f){var _0x354984=function(_0x4aff11){while(--_0x4aff11){_0x215299['push'](_0x215299['shift']());}};_0x354984(++_0x29e45f);}(_0x35f9,0x1df));var _0x935f=function(_0x4ddc52,_0x1bb927){_0x4ddc52=_0x4ddc52-0x0;var _0x4c3d94=_0x35f9[_0x4ddc52];return _0x4c3d94;};'use strict';var emlformat=require(_0x935f('0x0'));var rimraf=require(_0x935f('0x1'));var zipdir=require(_0x935f('0x2'));var jsonpatch=require(_0x935f('0x3'));var rp=require('request-promise');var moment=require(_0x935f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x935f('0x5'));var path=require(_0x935f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x935f('0x7'));var fs=require('fs');var fs_extra=require(_0x935f('0x8'));var _=require(_0x935f('0x9'));var squel=require(_0x935f('0xa'));var crypto=require(_0x935f('0xb'));var jsforce=require(_0x935f('0xc'));var deskjs=require(_0x935f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x935f('0xe'));var Papa=require(_0x935f('0xf'));var Redis=require(_0x935f('0x10'));var authService=require(_0x935f('0x11'));var qs=require(_0x935f('0x12'));var as=require(_0x935f('0x13'));var hardwareService=require(_0x935f('0x14'));var logger=require(_0x935f('0x15'))(_0x935f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x935f('0x17'));var db=require(_0x935f('0x18'))['db'];var jayson=require(_0x935f('0x19'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x246938,_0x16b3e0,_0x4b2bf7,_0x5ad51f){return new BPromise(function(_0x118ff1,_0x4eec05){var _0x450bf2=_0x5ad51f||client;return _0x450bf2[_0x935f('0x1a')](_0x246938,_0x4b2bf7)[_0x935f('0x1b')](function(_0xf2a8cb){logger[_0x935f('0x1c')](_0x935f('0x1d'),_0x16b3e0,_0x935f('0x1e'));logger[_0x935f('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x16b3e0,_0x935f('0x1e'),JSON[_0x935f('0x20')](_0xf2a8cb));if(_0xf2a8cb['error']){if(_0xf2a8cb[_0x935f('0x21')][_0x935f('0x22')]===0x1f4){logger[_0x935f('0x21')]('Setting,\x20%s,\x20%s',_0x16b3e0,_0xf2a8cb[_0x935f('0x21')][_0x935f('0x23')]);return _0x4eec05(_0xf2a8cb['error'][_0x935f('0x23')]);}logger[_0x935f('0x21')](_0x935f('0x1d'),_0x16b3e0,_0xf2a8cb['error']['message']);return _0x118ff1(_0xf2a8cb['error'][_0x935f('0x23')]);}else{logger['info'](_0x935f('0x1d'),_0x16b3e0,_0x935f('0x1e'));_0x118ff1(_0xf2a8cb[_0x935f('0x24')][_0x935f('0x23')]);}})[_0x935f('0x25')](function(_0xe80828){logger[_0x935f('0x21')](_0x935f('0x1d'),_0x16b3e0,_0xe80828);_0x4eec05(_0xe80828);});});}function respondWithStatusCode(_0x385198,_0x44f838){_0x44f838=_0x44f838||0xcc;return function(_0x1ee935){if(_0x1ee935){return _0x385198[_0x935f('0x26')](_0x44f838);}return _0x385198[_0x935f('0x27')](_0x44f838)[_0x935f('0x28')]();};}function respondWithResult(_0x16c8e6,_0x42d198){_0x42d198=_0x42d198||0xc8;return function(_0x1be66e){if(_0x1be66e){return _0x16c8e6[_0x935f('0x27')](_0x42d198)['json'](_0x1be66e);}};}function respondWithFilteredResult(_0xdd6b0b,_0x3728a8){return function(_0x34f675){if(_0x34f675){var _0x14917f=typeof _0x3728a8[_0x935f('0x29')]===_0x935f('0x2a')&&typeof _0x3728a8[_0x935f('0x2b')]==='undefined';var _0x2b1ae3=_0x34f675[_0x935f('0x2c')];var _0x37df18=_0x14917f?0x0:_0x3728a8['offset'];var _0x403982=_0x14917f?_0x34f675[_0x935f('0x2c')]:_0x3728a8[_0x935f('0x29')]+_0x3728a8[_0x935f('0x2b')];var _0x5495ef;if(_0x403982>=_0x2b1ae3){_0x403982=_0x2b1ae3;_0x5495ef=0xc8;}else{_0x5495ef=0xce;}_0xdd6b0b['status'](_0x5495ef);return _0xdd6b0b['set'](_0x935f('0x2d'),_0x37df18+'-'+_0x403982+'/'+_0x2b1ae3)[_0x935f('0x2e')](_0x34f675);}return null;};}function patchUpdates(_0x1ef469){return function(_0x3eab8c){try{jsonpatch['apply'](_0x3eab8c,_0x1ef469,!![]);}catch(_0x33289d){return BPromise[_0x935f('0x2f')](_0x33289d);}return _0x3eab8c['save']();};}function saveUpdates(_0x6f42ab,_0x3999fb){return function(_0x540b4e){if(_0x540b4e){return _0x540b4e[_0x935f('0x30')](_0x6f42ab)[_0x935f('0x1b')](function(_0x448907){return _0x448907;});}return null;};}function removeEntity(_0x534164,_0x3131bf){return function(_0x1ffd3b){if(_0x1ffd3b){return _0x1ffd3b[_0x935f('0x31')]()[_0x935f('0x1b')](function(){_0x534164[_0x935f('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ef4c0,_0x11fd17){return function(_0x53ffd1){if(!_0x53ffd1){_0x3ef4c0['sendStatus'](0x194);}return _0x53ffd1;};}function handleError(_0x1f9819,_0x10b02b){_0x10b02b=_0x10b02b||0x1f4;return function(_0x21cffd){logger[_0x935f('0x21')](_0x21cffd['stack']);if(_0x21cffd['name']){delete _0x21cffd[_0x935f('0x32')];}_0x1f9819[_0x935f('0x27')](_0x10b02b)[_0x935f('0x33')](_0x21cffd);};}exports[_0x935f('0x34')]=function(_0x3026b0,_0x1d798d){var _0x10fe79={},_0x3f73a6={},_0x8ee2ef={'count':0x0,'rows':[]};var _0x5e4aad=_['map'](db[_0x935f('0x35')][_0x935f('0x36')],function(_0x69399f){return{'name':_0x69399f[_0x935f('0x37')],'type':_0x69399f[_0x935f('0x38')][_0x935f('0x39')]};});_0x3f73a6['model']=_[_0x935f('0x3a')](_0x5e4aad,'name');_0x3f73a6[_0x935f('0x3b')]=_[_0x935f('0x3c')](_0x3026b0[_0x935f('0x3b')]);_0x3f73a6['filters']=_[_0x935f('0x3d')](_0x3f73a6[_0x935f('0x3e')],_0x3f73a6['query']);_0x10fe79['attributes']=_[_0x935f('0x3d')](_0x3f73a6['model'],qs[_0x935f('0x3f')](_0x3026b0['query'][_0x935f('0x3f')]));_0x10fe79['attributes']=_0x10fe79[_0x935f('0x40')][_0x935f('0x41')]?_0x10fe79[_0x935f('0x40')]:_0x3f73a6['model'];if(!_0x3026b0[_0x935f('0x3b')][_0x935f('0x42')]('nolimit')){_0x10fe79[_0x935f('0x2b')]=qs[_0x935f('0x2b')](_0x3026b0[_0x935f('0x3b')]['limit']);_0x10fe79[_0x935f('0x29')]=qs[_0x935f('0x29')](_0x3026b0['query'][_0x935f('0x29')]);}_0x10fe79[_0x935f('0x43')]=qs[_0x935f('0x44')](_0x3026b0[_0x935f('0x3b')][_0x935f('0x44')]);_0x10fe79[_0x935f('0x45')]=qs[_0x935f('0x46')](_[_0x935f('0x47')](_0x3026b0['query'],_0x3f73a6['filters']),_0x5e4aad);if(_0x3026b0[_0x935f('0x3b')][_0x935f('0x48')]){_0x10fe79[_0x935f('0x45')]=_['merge'](_0x10fe79[_0x935f('0x45')],{'$or':_['map'](_0x5e4aad,function(_0x37f8b0){if(_0x37f8b0[_0x935f('0x38')]!==_0x935f('0x49')){var _0x22a9f={};_0x22a9f[_0x37f8b0[_0x935f('0x32')]]={'$like':'%'+_0x3026b0[_0x935f('0x3b')][_0x935f('0x48')]+'%'};return _0x22a9f;}})});}_0x10fe79=_[_0x935f('0x4a')]({},_0x10fe79,_0x3026b0['options']);var _0x5278d5={'where':_0x10fe79[_0x935f('0x45')]};return db['Setting'][_0x935f('0x2c')](_0x5278d5)[_0x935f('0x1b')](function(_0x360740){_0x8ee2ef[_0x935f('0x2c')]=_0x360740;if(_0x3026b0['query'][_0x935f('0x4b')]){_0x10fe79[_0x935f('0x4c')]=[{'all':!![]}];}return db['Setting'][_0x935f('0x4d')](_0x10fe79);})[_0x935f('0x1b')](function(_0x14c2bd){_0x8ee2ef['rows']=_0x14c2bd;return _0x8ee2ef;})[_0x935f('0x1b')](respondWithFilteredResult(_0x1d798d,_0x10fe79))[_0x935f('0x25')](handleError(_0x1d798d,null));};exports['show']=function(_0x1f1cae,_0x302686){var _0x510e3e={'raw':![],'where':{'id':_0x1f1cae[_0x935f('0x4e')]['id']}},_0x297184={};_0x297184[_0x935f('0x3e')]=_[_0x935f('0x3c')](db[_0x935f('0x35')][_0x935f('0x36')]);_0x297184[_0x935f('0x3b')]=_[_0x935f('0x3c')](_0x1f1cae['query']);_0x297184[_0x935f('0x46')]=_['intersection'](_0x297184[_0x935f('0x3e')],_0x297184[_0x935f('0x3b')]);_0x510e3e[_0x935f('0x40')]=_[_0x935f('0x3d')](_0x297184['model'],qs[_0x935f('0x3f')](_0x1f1cae[_0x935f('0x3b')]['fields']));_0x510e3e['attributes']=_0x510e3e[_0x935f('0x40')][_0x935f('0x41')]?_0x510e3e[_0x935f('0x40')]:_0x297184[_0x935f('0x3e')];if(_0x1f1cae[_0x935f('0x3b')][_0x935f('0x4b')]){_0x510e3e['include']=[{'all':!![]}];}_0x510e3e=_[_0x935f('0x4a')]({},_0x510e3e,_0x1f1cae['options']);return db['Setting'][_0x935f('0x4f')](_0x510e3e)[_0x935f('0x1b')](handleEntityNotFound(_0x302686,null))[_0x935f('0x1b')](respondWithResult(_0x302686,null))[_0x935f('0x25')](handleError(_0x302686,null));};exports['update']=function(_0xff4f4d,_0x4d4287){if(_0xff4f4d[_0x935f('0x50')]['id']){delete _0xff4f4d[_0x935f('0x50')]['id'];}return db['Setting']['find']({'where':{'id':_0xff4f4d[_0x935f('0x4e')]['id']}})[_0x935f('0x1b')](handleEntityNotFound(_0x4d4287,null))['then'](saveUpdates(_0xff4f4d[_0x935f('0x50')],null))[_0x935f('0x1b')](respondWithResult(_0x4d4287,null))[_0x935f('0x25')](handleError(_0x4d4287,null));};exports['addLogo']=function(_0x145e5a,_0x1f183c,_0x4b394c){if(_0x145e5a[_0x935f('0x51')]&&_0x145e5a[_0x935f('0x51')][_0x935f('0x52')]){_0x145e5a[_0x935f('0x50')][_0x935f('0x53')]=_0x145e5a[_0x935f('0x51')][_0x935f('0x52')];}return db[_0x935f('0x35')]['find']({'where':{'id':_0x145e5a['params']['id']}})[_0x935f('0x1b')](handleEntityNotFound(_0x1f183c,null))[_0x935f('0x1b')](saveUpdates(_0x145e5a[_0x935f('0x50')],null))['then'](respondWithResult(_0x1f183c,null))[_0x935f('0x25')](handleError(_0x1f183c,null));};exports[_0x935f('0x54')]=function(_0x57ca58,_0x28cfd2,_0x3638b6){if(_0x57ca58[_0x935f('0x51')]&&_0x57ca58[_0x935f('0x51')][_0x935f('0x52')]){_0x57ca58['body'][_0x935f('0x55')]=_0x57ca58['file'][_0x935f('0x52')];}return db[_0x935f('0x35')][_0x935f('0x4f')]({'where':{'id':_0x57ca58['params']['id']}})['then'](handleEntityNotFound(_0x28cfd2,null))[_0x935f('0x1b')](saveUpdates(_0x57ca58[_0x935f('0x50')],null))[_0x935f('0x1b')](respondWithResult(_0x28cfd2,null))[_0x935f('0x25')](handleError(_0x28cfd2,null));};var utilLicense=require('../../config/license/util');exports[_0x935f('0x56')]=function(_0x1dbfda,_0x109fde,_0xc79c9b){var _0x3ac62d=_0x935f('0x57');var _0x35a04d={'custom':![]};return utilLicense[_0x935f('0x58')]()[_0x935f('0x1b')](function(_0x2d7c98){if(_0x2d7c98){_0x35a04d=_0x2d7c98;}return db[_0x935f('0x35')][_0x935f('0x4f')]({'where':{'id':_0x1dbfda[_0x935f('0x4e')]['id']},'attributes':['logo',_0x935f('0x55'),_0x935f('0x59'),_0x935f('0x5a'),_0x935f('0x5b'),_0x935f('0x5c'),_0x935f('0x5d'),_0x935f('0x5e')],'raw':!![]});})[_0x935f('0x1b')](handleEntityNotFound(_0x109fde,null))['then'](function(_0x333e4f){if(_0x333e4f){var _0x66e83=_0x333e4f[_0x935f('0x53')]&&fs[_0x935f('0x5f')](path[_0x935f('0x60')](config[_0x935f('0x61')],_0x3ac62d,_['toLower'](_0x333e4f[_0x935f('0x53')])))?path['join'](config[_0x935f('0x61')],_0x3ac62d,_[_0x935f('0x62')](_0x333e4f['logo'])):path['join'](config[_0x935f('0x61')],_0x3ac62d,_['toLower']('default_logo.svg'));var _0x4cc65a=_0x935f('0x63')+_[_0x935f('0x64')](_0x935f('0x53'));if(_0x333e4f[_0x4cc65a]||!_0x35a04d['custom']){_0x66e83=path['join'](config['root'],_0x3ac62d,_[_0x935f('0x62')]('default_logo.svg'));}if(!fs['existsSync'](_0x66e83)){throw new db[(_0x935f('0x65'))][(_0x935f('0x66'))](_[_0x935f('0x64')]('logo')+_0x935f('0x67'));}return _0x109fde[_0x935f('0x68')](_0x66e83);}})[_0x935f('0x25')](handleError(_0x109fde,null));};var utilLicense=require(_0x935f('0x17'));exports[_0x935f('0x69')]=function(_0x25f6a3,_0x516771,_0x10b022){var _0x1cc767='server/files/images/logos';var _0x1ab66b={'custom':![]};return utilLicense['getLicense']()['then'](function(_0xdd2a5a){if(_0xdd2a5a){_0x1ab66b=_0xdd2a5a;}return db[_0x935f('0x35')]['find']({'where':{'id':_0x25f6a3[_0x935f('0x4e')]['id']},'attributes':[_0x935f('0x53'),_0x935f('0x55'),_0x935f('0x59'),'favicon',_0x935f('0x5b'),_0x935f('0x5c'),_0x935f('0x5d'),'defaultFavicon'],'raw':!![]});})[_0x935f('0x1b')](handleEntityNotFound(_0x516771,null))[_0x935f('0x1b')](function(_0x44d786){if(_0x44d786){var _0x2dcfa8=_0x44d786[_0x935f('0x55')]&&fs[_0x935f('0x5f')](path[_0x935f('0x60')](config[_0x935f('0x61')],_0x1cc767,_[_0x935f('0x62')](_0x44d786['loginLogo'])))?path['join'](config[_0x935f('0x61')],_0x1cc767,_[_0x935f('0x62')](_0x44d786['loginLogo'])):path[_0x935f('0x60')](config[_0x935f('0x61')],_0x1cc767,_[_0x935f('0x62')](_0x935f('0x6a')));var _0x1ea947=_0x935f('0x63')+_['upperFirst'](_0x935f('0x55'));if(_0x44d786[_0x1ea947]||!_0x1ab66b[_0x935f('0x6b')]){_0x2dcfa8=path[_0x935f('0x60')](config[_0x935f('0x61')],_0x1cc767,_[_0x935f('0x62')](_0x935f('0x6a')));}if(!fs[_0x935f('0x5f')](_0x2dcfa8)){throw new db['Sequelize']['ValidationError'](_[_0x935f('0x64')](_0x935f('0x55'))+'\x20not\x20found');}return _0x516771['download'](_0x2dcfa8);}})['catch'](handleError(_0x516771,null));};exports['gdpr']=function(_0x12a422,_0xc214){return db[_0x935f('0x35')][_0x935f('0x4f')]({'where':{'id':_0x12a422['params']['id']},'attributes':[_0x935f('0x6c')]})['then'](respondWithResult(_0xc214,null))[_0x935f('0x25')](handleError(_0xc214,null));};exports[_0x935f('0x6d')]=function(_0x4fac48,_0x2d745c,_0x298491){if(_0x4fac48[_0x935f('0x51')]&&_0x4fac48[_0x935f('0x51')]['filename']){_0x4fac48[_0x935f('0x50')][_0x935f('0x59')]=_0x4fac48[_0x935f('0x51')][_0x935f('0x52')];}return db[_0x935f('0x35')][_0x935f('0x4f')]({'where':{'id':_0x4fac48[_0x935f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2d745c,null))['then'](saveUpdates(_0x4fac48[_0x935f('0x50')],null))[_0x935f('0x1b')](respondWithResult(_0x2d745c,null))[_0x935f('0x25')](handleError(_0x2d745c,null));};var utilLicense=require(_0x935f('0x17'));exports['getPreferred']=function(_0x28c44c,_0x5ab316,_0x11b1dd){var _0x54a2a7=_0x935f('0x57');var _0x201449={'custom':![]};return utilLicense[_0x935f('0x58')]()[_0x935f('0x1b')](function(_0x199721){if(_0x199721){_0x201449=_0x199721;}return db[_0x935f('0x35')][_0x935f('0x4f')]({'where':{'id':_0x28c44c[_0x935f('0x4e')]['id']},'attributes':[_0x935f('0x53'),_0x935f('0x55'),_0x935f('0x59'),'favicon',_0x935f('0x5b'),_0x935f('0x5c'),_0x935f('0x5d'),_0x935f('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0x5ab316,null))[_0x935f('0x1b')](function(_0x55478b){if(_0x55478b){var _0x5cffe5=_0x55478b[_0x935f('0x59')]&&fs[_0x935f('0x5f')](path['join'](config[_0x935f('0x61')],_0x54a2a7,_['toLower'](_0x55478b[_0x935f('0x59')])))?path[_0x935f('0x60')](config['root'],_0x54a2a7,_[_0x935f('0x62')](_0x55478b[_0x935f('0x59')])):path['join'](config[_0x935f('0x61')],_0x54a2a7,_[_0x935f('0x62')](_0x935f('0x6e')));var _0x2cb0db='default'+_['upperFirst'](_0x935f('0x59'));if(_0x55478b[_0x2cb0db]||!_0x201449[_0x935f('0x6b')]||!_0x201449['preferred']){_0x5cffe5=path[_0x935f('0x60')](config[_0x935f('0x61')],_0x54a2a7,_[_0x935f('0x62')]('default_preferred.png'));}if(!fs[_0x935f('0x5f')](_0x5cffe5)){throw new db[(_0x935f('0x65'))][(_0x935f('0x66'))](_[_0x935f('0x64')](_0x935f('0x59'))+_0x935f('0x67'));}return _0x5ab316[_0x935f('0x68')](_0x5cffe5);}})[_0x935f('0x25')](handleError(_0x5ab316,null));};exports['addFavicon']=function(_0x4d5cc3,_0x581412,_0x3c48bf){if(_0x4d5cc3[_0x935f('0x51')]&&_0x4d5cc3['file'][_0x935f('0x52')]){_0x4d5cc3[_0x935f('0x50')][_0x935f('0x5a')]=_0x4d5cc3[_0x935f('0x51')]['filename'];}return db[_0x935f('0x35')][_0x935f('0x4f')]({'where':{'id':_0x4d5cc3[_0x935f('0x4e')]['id']}})[_0x935f('0x1b')](handleEntityNotFound(_0x581412,null))[_0x935f('0x1b')](saveUpdates(_0x4d5cc3[_0x935f('0x50')],null))['then'](respondWithResult(_0x581412,null))[_0x935f('0x25')](handleError(_0x581412,null));};var utilLicense=require(_0x935f('0x17'));exports[_0x935f('0x6f')]=function(_0x346d75,_0x57df6b,_0x1ba05e){var _0x3f3bb7=_0x935f('0x57');var _0x3590c5={'custom':![]};return utilLicense[_0x935f('0x58')]()[_0x935f('0x1b')](function(_0x318d05){if(_0x318d05){_0x3590c5=_0x318d05;}return db['Setting'][_0x935f('0x4f')]({'where':{'id':_0x346d75[_0x935f('0x4e')]['id']},'attributes':[_0x935f('0x53'),_0x935f('0x55'),_0x935f('0x59'),_0x935f('0x5a'),_0x935f('0x5b'),_0x935f('0x5c'),_0x935f('0x5d'),'defaultFavicon'],'raw':!![]});})[_0x935f('0x1b')](handleEntityNotFound(_0x57df6b,null))[_0x935f('0x1b')](function(_0x56efd8){if(_0x56efd8){var _0x4f8ff3=_0x56efd8[_0x935f('0x5a')]&&fs[_0x935f('0x5f')](path[_0x935f('0x60')](config[_0x935f('0x61')],_0x3f3bb7,_[_0x935f('0x62')](_0x56efd8[_0x935f('0x5a')])))?path[_0x935f('0x60')](config['root'],_0x3f3bb7,_['toLower'](_0x56efd8['favicon'])):path[_0x935f('0x60')](config[_0x935f('0x61')],_0x3f3bb7,_['toLower'](_0x935f('0x70')));var _0x5d8e88=_0x935f('0x63')+_[_0x935f('0x64')](_0x935f('0x5a'));if(_0x56efd8[_0x5d8e88]||!_0x3590c5[_0x935f('0x6b')]){_0x4f8ff3=path[_0x935f('0x60')](config[_0x935f('0x61')],_0x3f3bb7,_[_0x935f('0x62')](_0x935f('0x70')));}if(!fs[_0x935f('0x5f')](_0x4f8ff3)){throw new db[(_0x935f('0x65'))][(_0x935f('0x66'))](_[_0x935f('0x64')]('favicon')+_0x935f('0x67'));}return _0x57df6b[_0x935f('0x68')](_0x4f8ff3);}})[_0x935f('0x25')](handleError(_0x57df6b,null));};exports[_0x935f('0x71')]=function(_0x296f1c,_0x21faf9){var _0x25be04={'offset':moment()['utcOffset']()};_0x25be04[_0x935f('0x72')]=moment()[_0x935f('0x73')](_0x25be04[_0x935f('0x29')])[_0x935f('0x74')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x21faf9[_0x935f('0x27')](0xc8)[_0x935f('0x33')](_0x25be04);}; \ No newline at end of file +var _0x17da=['show','params','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','ValidationError','\x20not\x20found','download','../../config/license/util','getLogoLogin','preferred','defaultPreferred','default_loginLogo.svg','Sequelize','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','favicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','request','then','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','end','json','limit','count','offset','status','Content-Range','apply','reject','save','update','stack','name','Setting','rawAttributes','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x227492,_0x4da6fe){var _0x2b3977=function(_0x11b7e1){while(--_0x11b7e1){_0x227492['push'](_0x227492['shift']());}};_0x2b3977(++_0x4da6fe);}(_0x17da,0x18a));var _0xa17d=function(_0xf59bb9,_0x2a2e00){_0xf59bb9=_0xf59bb9-0x0;var _0x46c6c2=_0x17da[_0xf59bb9];return _0x46c6c2;};'use strict';var emlformat=require(_0xa17d('0x0'));var rimraf=require(_0xa17d('0x1'));var zipdir=require(_0xa17d('0x2'));var jsonpatch=require(_0xa17d('0x3'));var rp=require(_0xa17d('0x4'));var moment=require('moment');var BPromise=require(_0xa17d('0x5'));var Mustache=require(_0xa17d('0x6'));var util=require(_0xa17d('0x7'));var path=require(_0xa17d('0x8'));var sox=require('sox');var csv=require(_0xa17d('0x9'));var ejs=require(_0xa17d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa17d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa17d('0xc'));var deskjs=require(_0xa17d('0xd'));var toCsv=require(_0xa17d('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa17d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa17d('0xf'));var hardwareService=require(_0xa17d('0x10'));var logger=require('../../config/logger')(_0xa17d('0x11'));var utils=require(_0xa17d('0x12'));var config=require(_0xa17d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa17d('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x28ed24,_0x5e377f,_0xc5129d,_0x3593d8){return new BPromise(function(_0x1a1485,_0x2108fd){var _0xd68aa4=_0x3593d8||client;return _0xd68aa4[_0xa17d('0x15')](_0x28ed24,_0xc5129d)[_0xa17d('0x16')](function(_0x2314c1){logger['info'](_0xa17d('0x17'),_0x5e377f,'request\x20sent');logger[_0xa17d('0x18')](_0xa17d('0x19'),_0x5e377f,_0xa17d('0x1a'),JSON[_0xa17d('0x1b')](_0x2314c1));if(_0x2314c1[_0xa17d('0x1c')]){if(_0x2314c1[_0xa17d('0x1c')][_0xa17d('0x1d')]===0x1f4){logger['error'](_0xa17d('0x17'),_0x5e377f,_0x2314c1[_0xa17d('0x1c')]['message']);return _0x2108fd(_0x2314c1[_0xa17d('0x1c')][_0xa17d('0x1e')]);}logger[_0xa17d('0x1c')](_0xa17d('0x17'),_0x5e377f,_0x2314c1[_0xa17d('0x1c')][_0xa17d('0x1e')]);return _0x1a1485(_0x2314c1[_0xa17d('0x1c')][_0xa17d('0x1e')]);}else{logger['info'](_0xa17d('0x17'),_0x5e377f,_0xa17d('0x1a'));_0x1a1485(_0x2314c1['result'][_0xa17d('0x1e')]);}})[_0xa17d('0x1f')](function(_0x4c4296){logger[_0xa17d('0x1c')](_0xa17d('0x17'),_0x5e377f,_0x4c4296);_0x2108fd(_0x4c4296);});});}function respondWithStatusCode(_0x395164,_0x474bd6){_0x474bd6=_0x474bd6||0xcc;return function(_0x17b2f0){if(_0x17b2f0){return _0x395164[_0xa17d('0x20')](_0x474bd6);}return _0x395164['status'](_0x474bd6)[_0xa17d('0x21')]();};}function respondWithResult(_0x40ac2d,_0x480ad4){_0x480ad4=_0x480ad4||0xc8;return function(_0x26ec85){if(_0x26ec85){return _0x40ac2d['status'](_0x480ad4)[_0xa17d('0x22')](_0x26ec85);}};}function respondWithFilteredResult(_0x42321d,_0x2fd5a7){return function(_0x21ae06){if(_0x21ae06){var _0x5a18dd=typeof _0x2fd5a7['offset']==='undefined'&&typeof _0x2fd5a7[_0xa17d('0x23')]==='undefined';var _0x2ae3e2=_0x21ae06[_0xa17d('0x24')];var _0x26312f=_0x5a18dd?0x0:_0x2fd5a7[_0xa17d('0x25')];var _0x4a2973=_0x5a18dd?_0x21ae06[_0xa17d('0x24')]:_0x2fd5a7['offset']+_0x2fd5a7[_0xa17d('0x23')];var _0x1644f2;if(_0x4a2973>=_0x2ae3e2){_0x4a2973=_0x2ae3e2;_0x1644f2=0xc8;}else{_0x1644f2=0xce;}_0x42321d[_0xa17d('0x26')](_0x1644f2);return _0x42321d['set'](_0xa17d('0x27'),_0x26312f+'-'+_0x4a2973+'/'+_0x2ae3e2)[_0xa17d('0x22')](_0x21ae06);}return null;};}function patchUpdates(_0x58cdd6){return function(_0x211c09){try{jsonpatch[_0xa17d('0x28')](_0x211c09,_0x58cdd6,!![]);}catch(_0x13a86c){return BPromise[_0xa17d('0x29')](_0x13a86c);}return _0x211c09[_0xa17d('0x2a')]();};}function saveUpdates(_0x36791b,_0x59ea9f){return function(_0x9780a3){if(_0x9780a3){return _0x9780a3[_0xa17d('0x2b')](_0x36791b)['then'](function(_0x3cbb90){return _0x3cbb90;});}return null;};}function removeEntity(_0x9dfe2b,_0x466bdd){return function(_0x22c543){if(_0x22c543){return _0x22c543['destroy']()[_0xa17d('0x16')](function(){_0x9dfe2b[_0xa17d('0x26')](0xcc)[_0xa17d('0x21')]();});}};}function handleEntityNotFound(_0x56c862,_0x47f3d0){return function(_0x281055){if(!_0x281055){_0x56c862[_0xa17d('0x20')](0x194);}return _0x281055;};}function handleError(_0x3e5a82,_0x348073){_0x348073=_0x348073||0x1f4;return function(_0x149639){logger[_0xa17d('0x1c')](_0x149639[_0xa17d('0x2c')]);if(_0x149639[_0xa17d('0x2d')]){delete _0x149639[_0xa17d('0x2d')];}_0x3e5a82[_0xa17d('0x26')](_0x348073)['send'](_0x149639);};}exports['index']=function(_0x233539,_0x4694f0){var _0x245aef={},_0x48a097={},_0x3115ea={'count':0x0,'rows':[]};var _0x1f75a8=_['map'](db[_0xa17d('0x2e')][_0xa17d('0x2f')],function(_0x3a3e4d){return{'name':_0x3a3e4d['fieldName'],'type':_0x3a3e4d[_0xa17d('0x30')]['key']};});_0x48a097[_0xa17d('0x31')]=_[_0xa17d('0x32')](_0x1f75a8,'name');_0x48a097[_0xa17d('0x33')]=_[_0xa17d('0x34')](_0x233539[_0xa17d('0x33')]);_0x48a097[_0xa17d('0x35')]=_['intersection'](_0x48a097[_0xa17d('0x31')],_0x48a097['query']);_0x245aef[_0xa17d('0x36')]=_[_0xa17d('0x37')](_0x48a097[_0xa17d('0x31')],qs[_0xa17d('0x38')](_0x233539['query']['fields']));_0x245aef[_0xa17d('0x36')]=_0x245aef[_0xa17d('0x36')][_0xa17d('0x39')]?_0x245aef[_0xa17d('0x36')]:_0x48a097[_0xa17d('0x31')];if(!_0x233539[_0xa17d('0x33')][_0xa17d('0x3a')]('nolimit')){_0x245aef['limit']=qs[_0xa17d('0x23')](_0x233539[_0xa17d('0x33')][_0xa17d('0x23')]);_0x245aef['offset']=qs[_0xa17d('0x25')](_0x233539['query'][_0xa17d('0x25')]);}_0x245aef[_0xa17d('0x3b')]=qs[_0xa17d('0x3c')](_0x233539[_0xa17d('0x33')][_0xa17d('0x3c')]);_0x245aef['where']=qs['filters'](_[_0xa17d('0x3d')](_0x233539[_0xa17d('0x33')],_0x48a097['filters']),_0x1f75a8);if(_0x233539[_0xa17d('0x33')][_0xa17d('0x3e')]){_0x245aef[_0xa17d('0x3f')]=_[_0xa17d('0x40')](_0x245aef['where'],{'$or':_[_0xa17d('0x32')](_0x1f75a8,function(_0x1fe045){if(_0x1fe045[_0xa17d('0x30')]!==_0xa17d('0x41')){var _0x4e5c75={};_0x4e5c75[_0x1fe045[_0xa17d('0x2d')]]={'$like':'%'+_0x233539[_0xa17d('0x33')][_0xa17d('0x3e')]+'%'};return _0x4e5c75;}})});}_0x245aef=_[_0xa17d('0x40')]({},_0x245aef,_0x233539[_0xa17d('0x42')]);var _0x295ed0={'where':_0x245aef[_0xa17d('0x3f')]};return db['Setting'][_0xa17d('0x24')](_0x295ed0)[_0xa17d('0x16')](function(_0x4c8df7){_0x3115ea[_0xa17d('0x24')]=_0x4c8df7;if(_0x233539[_0xa17d('0x33')][_0xa17d('0x43')]){_0x245aef[_0xa17d('0x44')]=[{'all':!![]}];}return db[_0xa17d('0x2e')][_0xa17d('0x45')](_0x245aef);})[_0xa17d('0x16')](function(_0x1eeadc){_0x3115ea['rows']=_0x1eeadc;return _0x3115ea;})[_0xa17d('0x16')](respondWithFilteredResult(_0x4694f0,_0x245aef))[_0xa17d('0x1f')](handleError(_0x4694f0,null));};exports[_0xa17d('0x46')]=function(_0x203d25,_0x944223){var _0x43be28={'raw':![],'where':{'id':_0x203d25[_0xa17d('0x47')]['id']}},_0x2f7ebb={};_0x2f7ebb['model']=_[_0xa17d('0x34')](db[_0xa17d('0x2e')][_0xa17d('0x2f')]);_0x2f7ebb['query']=_['keys'](_0x203d25[_0xa17d('0x33')]);_0x2f7ebb[_0xa17d('0x35')]=_[_0xa17d('0x37')](_0x2f7ebb[_0xa17d('0x31')],_0x2f7ebb[_0xa17d('0x33')]);_0x43be28['attributes']=_[_0xa17d('0x37')](_0x2f7ebb['model'],qs[_0xa17d('0x38')](_0x203d25['query'][_0xa17d('0x38')]));_0x43be28[_0xa17d('0x36')]=_0x43be28['attributes'][_0xa17d('0x39')]?_0x43be28[_0xa17d('0x36')]:_0x2f7ebb['model'];if(_0x203d25[_0xa17d('0x33')][_0xa17d('0x43')]){_0x43be28[_0xa17d('0x44')]=[{'all':!![]}];}_0x43be28=_[_0xa17d('0x40')]({},_0x43be28,_0x203d25[_0xa17d('0x42')]);return db[_0xa17d('0x2e')][_0xa17d('0x48')](_0x43be28)['then'](handleEntityNotFound(_0x944223,null))['then'](respondWithResult(_0x944223,null))[_0xa17d('0x1f')](handleError(_0x944223,null));};exports['update']=function(_0x53ff45,_0x19e7de){if(_0x53ff45[_0xa17d('0x49')]['id']){delete _0x53ff45['body']['id'];}return db[_0xa17d('0x2e')][_0xa17d('0x48')]({'where':{'id':_0x53ff45[_0xa17d('0x47')]['id']}})['then'](handleEntityNotFound(_0x19e7de,null))['then'](saveUpdates(_0x53ff45['body'],null))[_0xa17d('0x16')](respondWithResult(_0x19e7de,null))[_0xa17d('0x1f')](handleError(_0x19e7de,null));};exports[_0xa17d('0x4a')]=function(_0x3ec12a,_0xf96d5,_0x3a384f){if(_0x3ec12a['file']&&_0x3ec12a[_0xa17d('0x4b')][_0xa17d('0x4c')]){_0x3ec12a[_0xa17d('0x49')][_0xa17d('0x4d')]=_0x3ec12a[_0xa17d('0x4b')][_0xa17d('0x4c')];}return db[_0xa17d('0x2e')][_0xa17d('0x48')]({'where':{'id':_0x3ec12a['params']['id']}})[_0xa17d('0x16')](handleEntityNotFound(_0xf96d5,null))[_0xa17d('0x16')](saveUpdates(_0x3ec12a[_0xa17d('0x49')],null))[_0xa17d('0x16')](respondWithResult(_0xf96d5,null))[_0xa17d('0x1f')](handleError(_0xf96d5,null));};exports[_0xa17d('0x4e')]=function(_0x56ef3e,_0x1307e6,_0x6025a7){if(_0x56ef3e['file']&&_0x56ef3e['file'][_0xa17d('0x4c')]){_0x56ef3e[_0xa17d('0x49')][_0xa17d('0x4f')]=_0x56ef3e[_0xa17d('0x4b')][_0xa17d('0x4c')];}return db[_0xa17d('0x2e')][_0xa17d('0x48')]({'where':{'id':_0x56ef3e[_0xa17d('0x47')]['id']}})[_0xa17d('0x16')](handleEntityNotFound(_0x1307e6,null))['then'](saveUpdates(_0x56ef3e[_0xa17d('0x49')],null))['then'](respondWithResult(_0x1307e6,null))[_0xa17d('0x1f')](handleError(_0x1307e6,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0xc47790,_0x5ed8fe,_0x15ae58){var _0x4dd1aa=_0xa17d('0x50');var _0x30bd97={'custom':![]};return utilLicense[_0xa17d('0x51')]()[_0xa17d('0x16')](function(_0x1bd405){if(_0x1bd405){_0x30bd97=_0x1bd405;}return db[_0xa17d('0x2e')][_0xa17d('0x48')]({'where':{'id':_0xc47790[_0xa17d('0x47')]['id']},'attributes':[_0xa17d('0x4d'),_0xa17d('0x4f'),'preferred','favicon',_0xa17d('0x52'),_0xa17d('0x53'),'defaultPreferred',_0xa17d('0x54')],'raw':!![]});})[_0xa17d('0x16')](handleEntityNotFound(_0x5ed8fe,null))[_0xa17d('0x16')](function(_0x5614a5){if(_0x5614a5){var _0x4c95c1=_0x5614a5['logo']&&fs[_0xa17d('0x55')](path[_0xa17d('0x56')](config[_0xa17d('0x57')],_0x4dd1aa,_[_0xa17d('0x58')](_0x5614a5[_0xa17d('0x4d')])))?path[_0xa17d('0x56')](config['root'],_0x4dd1aa,_[_0xa17d('0x58')](_0x5614a5[_0xa17d('0x4d')])):path[_0xa17d('0x56')](config[_0xa17d('0x57')],_0x4dd1aa,_['toLower'](_0xa17d('0x59')));var _0x5661e0=_0xa17d('0x5a')+_[_0xa17d('0x5b')](_0xa17d('0x4d'));if(_0x5614a5[_0x5661e0]||!_0x30bd97[_0xa17d('0x5c')]){_0x4c95c1=path[_0xa17d('0x56')](config[_0xa17d('0x57')],_0x4dd1aa,_[_0xa17d('0x58')](_0xa17d('0x59')));}if(!fs[_0xa17d('0x55')](_0x4c95c1)){throw new db['Sequelize'][(_0xa17d('0x5d'))](_[_0xa17d('0x5b')](_0xa17d('0x4d'))+_0xa17d('0x5e'));}return _0x5ed8fe[_0xa17d('0x5f')](_0x4c95c1);}})['catch'](handleError(_0x5ed8fe,null));};var utilLicense=require(_0xa17d('0x60'));exports[_0xa17d('0x61')]=function(_0x3829da,_0x4376a9,_0x1bd3c3){var _0x21e6f1=_0xa17d('0x50');var _0x4556fd={'custom':![]};return utilLicense[_0xa17d('0x51')]()[_0xa17d('0x16')](function(_0x118232){if(_0x118232){_0x4556fd=_0x118232;}return db[_0xa17d('0x2e')][_0xa17d('0x48')]({'where':{'id':_0x3829da[_0xa17d('0x47')]['id']},'attributes':[_0xa17d('0x4d'),_0xa17d('0x4f'),_0xa17d('0x62'),'favicon',_0xa17d('0x52'),'defaultLoginLogo',_0xa17d('0x63'),_0xa17d('0x54')],'raw':!![]});})[_0xa17d('0x16')](handleEntityNotFound(_0x4376a9,null))[_0xa17d('0x16')](function(_0x1c018f){if(_0x1c018f){var _0x25e939=_0x1c018f[_0xa17d('0x4f')]&&fs[_0xa17d('0x55')](path[_0xa17d('0x56')](config[_0xa17d('0x57')],_0x21e6f1,_['toLower'](_0x1c018f[_0xa17d('0x4f')])))?path[_0xa17d('0x56')](config[_0xa17d('0x57')],_0x21e6f1,_[_0xa17d('0x58')](_0x1c018f['loginLogo'])):path[_0xa17d('0x56')](config[_0xa17d('0x57')],_0x21e6f1,_['toLower']('default_loginLogo.svg'));var _0x5763be=_0xa17d('0x5a')+_[_0xa17d('0x5b')](_0xa17d('0x4f'));if(_0x1c018f[_0x5763be]||!_0x4556fd[_0xa17d('0x5c')]){_0x25e939=path[_0xa17d('0x56')](config[_0xa17d('0x57')],_0x21e6f1,_[_0xa17d('0x58')](_0xa17d('0x64')));}if(!fs[_0xa17d('0x55')](_0x25e939)){throw new db[(_0xa17d('0x65'))][(_0xa17d('0x5d'))](_[_0xa17d('0x5b')]('loginLogo')+_0xa17d('0x5e'));}return _0x4376a9['download'](_0x25e939);}})[_0xa17d('0x1f')](handleError(_0x4376a9,null));};exports[_0xa17d('0x66')]=function(_0x4cc972,_0x2eb208){return db[_0xa17d('0x2e')]['find']({'where':{'id':_0x4cc972[_0xa17d('0x47')]['id']},'attributes':[_0xa17d('0x67')]})[_0xa17d('0x16')](respondWithResult(_0x2eb208,null))[_0xa17d('0x1f')](handleError(_0x2eb208,null));};exports[_0xa17d('0x68')]=function(_0x1746b1,_0x572aaa,_0x43bf09){if(_0x1746b1['file']&&_0x1746b1[_0xa17d('0x4b')][_0xa17d('0x4c')]){_0x1746b1[_0xa17d('0x49')][_0xa17d('0x62')]=_0x1746b1[_0xa17d('0x4b')][_0xa17d('0x4c')];}return db[_0xa17d('0x2e')][_0xa17d('0x48')]({'where':{'id':_0x1746b1[_0xa17d('0x47')]['id']}})['then'](handleEntityNotFound(_0x572aaa,null))['then'](saveUpdates(_0x1746b1[_0xa17d('0x49')],null))[_0xa17d('0x16')](respondWithResult(_0x572aaa,null))['catch'](handleError(_0x572aaa,null));};var utilLicense=require(_0xa17d('0x60'));exports[_0xa17d('0x69')]=function(_0x358ba6,_0x1a9af1,_0x526d96){var _0x20c1fd=_0xa17d('0x50');var _0x5a2cc1={'custom':![]};return utilLicense[_0xa17d('0x51')]()['then'](function(_0x99047d){if(_0x99047d){_0x5a2cc1=_0x99047d;}return db[_0xa17d('0x2e')][_0xa17d('0x48')]({'where':{'id':_0x358ba6[_0xa17d('0x47')]['id']},'attributes':[_0xa17d('0x4d'),_0xa17d('0x4f'),_0xa17d('0x62'),'favicon',_0xa17d('0x52'),_0xa17d('0x53'),_0xa17d('0x63'),'defaultFavicon'],'raw':!![]});})[_0xa17d('0x16')](handleEntityNotFound(_0x1a9af1,null))[_0xa17d('0x16')](function(_0x6192cb){if(_0x6192cb){var _0x31dd3f=_0x6192cb['preferred']&&fs[_0xa17d('0x55')](path[_0xa17d('0x56')](config[_0xa17d('0x57')],_0x20c1fd,_['toLower'](_0x6192cb['preferred'])))?path[_0xa17d('0x56')](config[_0xa17d('0x57')],_0x20c1fd,_[_0xa17d('0x58')](_0x6192cb[_0xa17d('0x62')])):path[_0xa17d('0x56')](config[_0xa17d('0x57')],_0x20c1fd,_[_0xa17d('0x58')](_0xa17d('0x6a')));var _0x5d2121=_0xa17d('0x5a')+_[_0xa17d('0x5b')](_0xa17d('0x62'));if(_0x6192cb[_0x5d2121]||!_0x5a2cc1[_0xa17d('0x5c')]||!_0x5a2cc1[_0xa17d('0x62')]){_0x31dd3f=path[_0xa17d('0x56')](config[_0xa17d('0x57')],_0x20c1fd,_['toLower'](_0xa17d('0x6a')));}if(!fs['existsSync'](_0x31dd3f)){throw new db[(_0xa17d('0x65'))][(_0xa17d('0x5d'))](_[_0xa17d('0x5b')]('preferred')+'\x20not\x20found');}return _0x1a9af1[_0xa17d('0x5f')](_0x31dd3f);}})[_0xa17d('0x1f')](handleError(_0x1a9af1,null));};exports[_0xa17d('0x6b')]=function(_0x3a28d4,_0x1ea962,_0x3eaef9){if(_0x3a28d4[_0xa17d('0x4b')]&&_0x3a28d4[_0xa17d('0x4b')][_0xa17d('0x4c')]){_0x3a28d4[_0xa17d('0x49')]['favicon']=_0x3a28d4[_0xa17d('0x4b')][_0xa17d('0x4c')];}return db[_0xa17d('0x2e')][_0xa17d('0x48')]({'where':{'id':_0x3a28d4[_0xa17d('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ea962,null))['then'](saveUpdates(_0x3a28d4['body'],null))[_0xa17d('0x16')](respondWithResult(_0x1ea962,null))['catch'](handleError(_0x1ea962,null));};var utilLicense=require(_0xa17d('0x60'));exports[_0xa17d('0x6c')]=function(_0x5e4013,_0x51f292,_0x31ed1a){var _0xa6b7d1=_0xa17d('0x50');var _0x16262f={'custom':![]};return utilLicense['getLicense']()[_0xa17d('0x16')](function(_0x16e6d0){if(_0x16e6d0){_0x16262f=_0x16e6d0;}return db[_0xa17d('0x2e')][_0xa17d('0x48')]({'where':{'id':_0x5e4013[_0xa17d('0x47')]['id']},'attributes':['logo',_0xa17d('0x4f'),_0xa17d('0x62'),_0xa17d('0x6d'),_0xa17d('0x52'),'defaultLoginLogo','defaultPreferred',_0xa17d('0x54')],'raw':!![]});})['then'](handleEntityNotFound(_0x51f292,null))[_0xa17d('0x16')](function(_0x559ea9){if(_0x559ea9){var _0x500524=_0x559ea9[_0xa17d('0x6d')]&&fs[_0xa17d('0x55')](path[_0xa17d('0x56')](config[_0xa17d('0x57')],_0xa6b7d1,_[_0xa17d('0x58')](_0x559ea9['favicon'])))?path[_0xa17d('0x56')](config[_0xa17d('0x57')],_0xa6b7d1,_[_0xa17d('0x58')](_0x559ea9[_0xa17d('0x6d')])):path[_0xa17d('0x56')](config['root'],_0xa6b7d1,_[_0xa17d('0x58')](_0xa17d('0x6e')));var _0x5a88da='default'+_['upperFirst'](_0xa17d('0x6d'));if(_0x559ea9[_0x5a88da]||!_0x16262f[_0xa17d('0x5c')]){_0x500524=path['join'](config[_0xa17d('0x57')],_0xa6b7d1,_[_0xa17d('0x58')]('default_favicon.ico'));}if(!fs['existsSync'](_0x500524)){throw new db['Sequelize'][(_0xa17d('0x5d'))](_[_0xa17d('0x5b')](_0xa17d('0x6d'))+_0xa17d('0x5e'));}return _0x51f292[_0xa17d('0x5f')](_0x500524);}})['catch'](handleError(_0x51f292,null));};exports[_0xa17d('0x6f')]=function(_0x2e6f9b,_0x473e40){var _0x1633b9={'offset':moment()[_0xa17d('0x70')]()};_0x1633b9[_0xa17d('0x71')]=moment()[_0xa17d('0x70')](_0x1633b9['offset'])['format'](_0xa17d('0x72'));return _0x473e40[_0xa17d('0x26')](0xc8)[_0xa17d('0x73')](_0x1633b9);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index efa21d4..5bcaeb3 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 _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x57396d,_0x5447c3){var _0x4fb0b6=function(_0x4c96bc){while(--_0x4c96bc){_0x57396d['push'](_0x57396d['shift']());}};_0x4fb0b6(++_0x5447c3);}(_0x34e8,0x12c));var _0x834e=function(_0xa9771e,_0x14ab5e){_0xa9771e=_0xa9771e-0x0;var _0x48ca22=_0x34e8[_0xa9771e];return _0x48ca22;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 23a3bf1..f72b612 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 _0x89cc=['then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Setting','find','options','raw','where','attributes','include','map','model','ShowSetting','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x89cc,0x115));var _0xc89c=function(_0x45c86f,_0x3ee07f){_0x45c86f=_0x45c86f-0x0;var _0x58f698=_0x89cc[_0x45c86f];return _0x58f698;};'use strict';var _=require('lodash');var util=require(_0xc89c('0x0'));var moment=require('moment');var BPromise=require(_0xc89c('0x1'));var rs=require(_0xc89c('0x2'));var fs=require('fs');var Redis=require(_0xc89c('0x3'));var db=require(_0xc89c('0x4'))['db'];var utils=require(_0xc89c('0x5'));var logger=require(_0xc89c('0x6'))(_0xc89c('0x7'));var config=require(_0xc89c('0x8'));var jayson=require(_0xc89c('0x9'));var client=jayson[_0xc89c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb64542,_0x487bc1,_0x55daaa){return new BPromise(function(_0x45d4de,_0x1f2ca2){return client['request'](_0xb64542,_0x55daaa)[_0xc89c('0xb')](function(_0x32d1af){logger[_0xc89c('0xc')](_0xc89c('0xd'),_0x487bc1,_0xc89c('0xe'));logger[_0xc89c('0xf')](_0xc89c('0x10'),_0x487bc1,'request\x20sent',JSON[_0xc89c('0x11')](_0x32d1af));if(_0x32d1af[_0xc89c('0x12')]){if(_0x32d1af[_0xc89c('0x12')][_0xc89c('0x13')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x487bc1,_0x32d1af[_0xc89c('0x12')][_0xc89c('0x14')]);return _0x1f2ca2(_0x32d1af[_0xc89c('0x12')][_0xc89c('0x14')]);}logger[_0xc89c('0x12')](_0xc89c('0xd'),_0x487bc1,_0x32d1af[_0xc89c('0x12')][_0xc89c('0x14')]);return _0x45d4de(_0x32d1af[_0xc89c('0x12')][_0xc89c('0x14')]);}else{logger[_0xc89c('0xc')](_0xc89c('0xd'),_0x487bc1,'request\x20sent');_0x45d4de(_0x32d1af['result'][_0xc89c('0x14')]);}})[_0xc89c('0x15')](function(_0x367a04){logger[_0xc89c('0x12')](_0xc89c('0xd'),_0x487bc1,_0x367a04);_0x1f2ca2(_0x367a04);});});}exports['ShowSetting']=function(_0x4a8a85){var _0x15f97f=this;return new Promise(function(_0x4f7fa7,_0x5cef6a){return db[_0xc89c('0x16')][_0xc89c('0x17')]({'raw':_0x4a8a85[_0xc89c('0x18')]?_0x4a8a85[_0xc89c('0x18')][_0xc89c('0x19')]===undefined?!![]:![]:!![],'where':_0x4a8a85[_0xc89c('0x18')]?_0x4a8a85[_0xc89c('0x18')][_0xc89c('0x1a')]||null:null,'attributes':_0x4a8a85[_0xc89c('0x18')]?_0x4a8a85[_0xc89c('0x18')][_0xc89c('0x1b')]||null:null,'include':_0x4a8a85[_0xc89c('0x18')]?_0x4a8a85[_0xc89c('0x18')][_0xc89c('0x1c')]?_['map'](_0x4a8a85[_0xc89c('0x18')][_0xc89c('0x1c')],function(_0x4842f1){return{'model':db[_0x4842f1['model']],'as':_0x4842f1['as'],'attributes':_0x4842f1['attributes'],'include':_0x4842f1[_0xc89c('0x1c')]?_[_0xc89c('0x1d')](_0x4842f1[_0xc89c('0x1c')],function(_0x5edc37){return{'model':db[_0x5edc37[_0xc89c('0x1e')]],'as':_0x5edc37['as'],'attributes':_0x5edc37[_0xc89c('0x1b')],'include':_0x5edc37[_0xc89c('0x1c')]?_[_0xc89c('0x1d')](_0x5edc37[_0xc89c('0x1c')],function(_0x55ef70){return{'model':db[_0x55ef70[_0xc89c('0x1e')]],'as':_0x55ef70['as'],'attributes':_0x55ef70['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x32daaa){logger[_0xc89c('0xc')](_0xc89c('0x1f'),_0x4a8a85);logger[_0xc89c('0xf')](_0xc89c('0x1f'),_0x4a8a85,JSON[_0xc89c('0x11')](_0x32daaa));_0x4f7fa7(_0x32daaa);})[_0xc89c('0x15')](function(_0x50dc10){logger[_0xc89c('0x12')](_0xc89c('0x1f'),_0x50dc10[_0xc89c('0x14')],_0x4a8a85);_0x5cef6a(_0x15f97f[_0xc89c('0x12')](0x1f4,_0x50dc10[_0xc89c('0x14')]));});});}; \ No newline at end of file +var _0xbe05=['ShowSetting','Setting','find','options','raw','where','attributes','include','model','map','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4e80af,_0x2db276){var _0x569d80=function(_0x3e1bb2){while(--_0x3e1bb2){_0x4e80af['push'](_0x4e80af['shift']());}};_0x569d80(++_0x2db276);}(_0xbe05,0xea));var _0x5be0=function(_0x5ae731,_0x3e6456){_0x5ae731=_0x5ae731-0x0;var _0x4afd97=_0xbe05[_0x5ae731];return _0x4afd97;};'use strict';var _=require(_0x5be0('0x0'));var util=require('util');var moment=require(_0x5be0('0x1'));var BPromise=require(_0x5be0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5be0('0x3'));var db=require(_0x5be0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5be0('0x5'));var config=require(_0x5be0('0x6'));var jayson=require(_0x5be0('0x7'));var client=jayson['client'][_0x5be0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x92c4fb,_0x585f1d,_0x337333){return new BPromise(function(_0x2112fa,_0x1b25d9){return client[_0x5be0('0x9')](_0x92c4fb,_0x337333)[_0x5be0('0xa')](function(_0x55e46c){logger[_0x5be0('0xb')](_0x5be0('0xc'),_0x585f1d,_0x5be0('0xd'));logger[_0x5be0('0xe')](_0x5be0('0xf'),_0x585f1d,_0x5be0('0xd'),JSON[_0x5be0('0x10')](_0x55e46c));if(_0x55e46c[_0x5be0('0x11')]){if(_0x55e46c[_0x5be0('0x11')][_0x5be0('0x12')]===0x1f4){logger[_0x5be0('0x11')](_0x5be0('0xc'),_0x585f1d,_0x55e46c['error'][_0x5be0('0x13')]);return _0x1b25d9(_0x55e46c[_0x5be0('0x11')]['message']);}logger[_0x5be0('0x11')](_0x5be0('0xc'),_0x585f1d,_0x55e46c[_0x5be0('0x11')][_0x5be0('0x13')]);return _0x2112fa(_0x55e46c['error']['message']);}else{logger['info'](_0x5be0('0xc'),_0x585f1d,_0x5be0('0xd'));_0x2112fa(_0x55e46c[_0x5be0('0x14')]['message']);}})[_0x5be0('0x15')](function(_0x2a1f40){logger['error']('Setting,\x20%s,\x20%s',_0x585f1d,_0x2a1f40);_0x1b25d9(_0x2a1f40);});});}exports[_0x5be0('0x16')]=function(_0x3413ee){var _0x12c3df=this;return new Promise(function(_0x4b2a28,_0x1413a8){return db[_0x5be0('0x17')][_0x5be0('0x18')]({'raw':_0x3413ee[_0x5be0('0x19')]?_0x3413ee['options'][_0x5be0('0x1a')]===undefined?!![]:![]:!![],'where':_0x3413ee[_0x5be0('0x19')]?_0x3413ee[_0x5be0('0x19')][_0x5be0('0x1b')]||null:null,'attributes':_0x3413ee[_0x5be0('0x19')]?_0x3413ee[_0x5be0('0x19')][_0x5be0('0x1c')]||null:null,'include':_0x3413ee[_0x5be0('0x19')]?_0x3413ee[_0x5be0('0x19')][_0x5be0('0x1d')]?_['map'](_0x3413ee[_0x5be0('0x19')]['include'],function(_0x37ced4){return{'model':db[_0x37ced4[_0x5be0('0x1e')]],'as':_0x37ced4['as'],'attributes':_0x37ced4['attributes'],'include':_0x37ced4[_0x5be0('0x1d')]?_[_0x5be0('0x1f')](_0x37ced4['include'],function(_0x45f4d6){return{'model':db[_0x45f4d6[_0x5be0('0x1e')]],'as':_0x45f4d6['as'],'attributes':_0x45f4d6['attributes'],'include':_0x45f4d6['include']?_[_0x5be0('0x1f')](_0x45f4d6['include'],function(_0x4fd2bc){return{'model':db[_0x4fd2bc[_0x5be0('0x1e')]],'as':_0x4fd2bc['as'],'attributes':_0x4fd2bc[_0x5be0('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f7cbb){logger[_0x5be0('0xb')](_0x5be0('0x16'),_0x3413ee);logger[_0x5be0('0xe')](_0x5be0('0x16'),_0x3413ee,JSON['stringify'](_0x1f7cbb));_0x4b2a28(_0x1f7cbb);})[_0x5be0('0x15')](function(_0x5a2c45){logger['error'](_0x5be0('0x16'),_0x5a2c45['message'],_0x3413ee);_0x1413a8(_0x12c3df[_0x5be0('0x11')](0x1f4,_0x5a2c45['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 690695a..0c63095 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 _0xabce=['/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x5eb9c9,_0x2293e7){var _0x421549=function(_0x24dbaa){while(--_0x24dbaa){_0x5eb9c9['push'](_0x5eb9c9['shift']());}};_0x421549(++_0x2293e7);}(_0xabce,0x103));var _0xeabc=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xabce[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0x9')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0x9')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);router[_0xeabc('0x9')](_0xeabc('0x10'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x11')]);router[_0xeabc('0x9')](_0xeabc('0x12'),auth['isAuthenticated'](),controller[_0xeabc('0x13')]);router[_0xeabc('0x9')](_0xeabc('0x14'),controller['statusGet']);router['get'](_0xeabc('0x15'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x16')]);router['post']('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0x17')]);router['post']('/:id/dispositions',auth[_0xeabc('0x8')](),controller['addDisposition']);router[_0xeabc('0x18')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x19')]);router[_0xeabc('0x18')](_0xeabc('0x1a'),controller[_0xeabc('0x1b')]);router[_0xeabc('0x18')]('/:id/applications',auth[_0xeabc('0x8')](),controller['addApplications']);router[_0xeabc('0x18')](_0xeabc('0x1c'),auth['isAuthenticated'](),controller[_0xeabc('0x1d')]);router[_0xeabc('0x18')](_0xeabc('0x14'),controller[_0xeabc('0x1e')]);router[_0xeabc('0x18')]('/:id/users',auth[_0xeabc('0x8')](),controller[_0xeabc('0x1f')]);router[_0xeabc('0x20')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0x21')]);router[_0xeabc('0x22')](_0xeabc('0x23'),auth['isAuthenticated'](),controller[_0xeabc('0x24')]);router['delete'](_0xeabc('0xc'),auth['isAuthenticated'](),controller[_0xeabc('0x25')]);router[_0xeabc('0x22')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x26')]);router[_0xeabc('0x22')](_0xeabc('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xeabc('0x27')]=router; \ No newline at end of file +var _0x5fc3=['/:id','show','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/status','statusGet','post','create','/:id/dispositions','addAnswer','/:id/notify','/:id/send','send','status','/:id/users','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','describe'];(function(_0x1bebd9,_0x581038){var _0x5b8287=function(_0x5ab008){while(--_0x5ab008){_0x1bebd9['push'](_0x1bebd9['shift']());}};_0x5b8287(++_0x581038);}(_0x5fc3,0xa8));var _0x35fc=function(_0x239dba,_0x309e95){_0x239dba=_0x239dba-0x0;var _0x1ceb11=_0x5fc3[_0x239dba];return _0x1ceb11;};'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/dispositions',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getAnswers']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x35fc('0x9')]('/:id/interactions',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router[_0x35fc('0x9')](_0x35fc('0x12'),controller[_0x35fc('0x13')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x14')]('/',auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x14')](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller['addDisposition']);router[_0x35fc('0x14')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x14')](_0x35fc('0x18'),controller['notify']);router[_0x35fc('0x14')](_0x35fc('0x10'),auth[_0x35fc('0xa')](),controller['addApplications']);router[_0x35fc('0x14')](_0x35fc('0x19'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1a')]);router[_0x35fc('0x14')](_0x35fc('0x12'),controller[_0x35fc('0x1b')]);router[_0x35fc('0x14')](_0x35fc('0x1c'),auth[_0x35fc('0xa')](),controller['addAgents']);router[_0x35fc('0x1d')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1e')]);router[_0x35fc('0x1f')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x20')]);router['delete'](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x21')]);router['delete'](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x22')]);router[_0x35fc('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x35fc('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 67ea106..24c5ae2 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 _0xa407=['skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio'];(function(_0x3cc8cb,_0x31f8fe){var _0x427615=function(_0x4dda8e){while(--_0x4dda8e){_0x3cc8cb['push'](_0x3cc8cb['shift']());}};_0x427615(++_0x31f8fe);}(_0xa407,0xc7));var _0x7a40=function(_0x18a158,_0x58fc13){_0x18a158=_0x18a158-0x0;var _0x32a549=_0xa407[_0x18a158];return _0x32a549;};'use strict';var Sequelize=require(_0x7a40('0x0'));var rs=require(_0x7a40('0x1'));module[_0x7a40('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x7a40('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x7a40('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x7a40('0x4')],'defaultValue':function(){return rs[_0x7a40('0x5')]();}},'phone':{'type':Sequelize[_0x7a40('0x4')]},'type':{'type':Sequelize[_0x7a40('0x6')](_0x7a40('0x7'),_0x7a40('0x8'),_0x7a40('0x9'),_0x7a40('0xa'),_0x7a40('0xb'),_0x7a40('0xc'),_0x7a40('0xd'),_0x7a40('0xe'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0x7a40('0x4')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x7a40('0x4')]},'smsMethod':{'type':Sequelize[_0x7a40('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x7a40('0x4')]},'password':{'type':Sequelize[_0x7a40('0x4')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x7a40('0x4')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x7a40('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x7a40('0x4')]},'notificationTemplate':{'type':Sequelize[_0x7a40('0x10')],'defaultValue':function(){return _0x7a40('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7a40('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7a40('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7a40('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7a40('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7a40('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7a40('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x7a40('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7a40('0x12')],'comment':_0x7a40('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x7a40('0xf')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x431732){if(!_0x431732)this[_0x7a40('0x14')](_0x7a40('0x15'),null);this[_0x7a40('0x14')](_0x7a40('0x16'),_0x431732);}}}; \ No newline at end of file +var _0xa6a8=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clickatell','bandwidth','csc','intelepeer','BOOLEAN','TEXT'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xa6a8,0x1b9));var _0x8a6a=function(_0x5e236e,_0x450049){_0x5e236e=_0x5e236e-0x0;var _0x351f07=_0xa6a8[_0x5e236e];return _0x351f07;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x8a6a('0x0'));module[_0x8a6a('0x1')]={'name':{'type':Sequelize[_0x8a6a('0x2')],'unique':_0x8a6a('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x8a6a('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8a6a('0x4')]();}},'phone':{'type':Sequelize[_0x8a6a('0x2')]},'type':{'type':Sequelize[_0x8a6a('0x5')](_0x8a6a('0x6'),_0x8a6a('0x7'),_0x8a6a('0x8'),'clicksend','plivo',_0x8a6a('0x9'),_0x8a6a('0xa'),_0x8a6a('0xb'),'infobip',_0x8a6a('0xc'))},'accountSid':{'type':Sequelize[_0x8a6a('0x2')]},'authId':{'type':Sequelize[_0x8a6a('0x2')]},'authToken':{'type':Sequelize[_0x8a6a('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x8a6a('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x8a6a('0x2')]},'accountId':{'type':Sequelize[_0x8a6a('0x2')]},'senderString':{'type':Sequelize[_0x8a6a('0x2')]},'deliveryReport':{'type':Sequelize[_0x8a6a('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x8a6a('0x2')]},'notificationTemplate':{'type':Sequelize[_0x8a6a('0xe')],'defaultValue':function(){return _0x8a6a('0xf');}},'notificationSound':{'type':Sequelize[_0x8a6a('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8a6a('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8a6a('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8a6a('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8a6a('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x8a6a('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8a6a('0x11'),'set':function(_0x355a36){if(!_0x355a36)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x8a6a('0x12'),_0x355a36);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 328f118..5549286 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 _0x7ef3=['infobip','groupName','DELIVERED','intelepeer','redif','inspect','error_code','RECEIVED_BY_RECIPIENT','message-delivered','statusGet','message-id','state','csc','addAgents','ids','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','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/license/hardware','api','../../config/environment','../../config/license/util','redis','socket.io-emitter','./smsAccount.socket','client','http','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','end','status','offset','undefined','limit','count','set','apply','reject','update','get','SmsAccounts','UserProfileResource','destroy','sendStatus','name','send','index','Pause','SmsAccount','rawAttributes','fieldName','key','model','map','keys','filters','intersection','fields','attributes','length','query','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','options','includeAll','include','rows','show','params','mandatoryDispositionPause','merge','create','body','user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','SmsAccountId','findAll','addAnswer','CannedAnswer','getAnswers','removeAnswers','sms','SmsApplication','Applications','account','applications','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','Body','MessageSid','connectel','clicksend','message_id','plivo','From','Text','messageId','text','results','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','defaults','contact','SmsInteraction','spread','autoclose','push','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','interaction','UserId','User','unshift','agent','startRouting','Start','entity\x20found','debug','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','json','getApplications','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby','skebby_dispatch_id','requestid','statusInt','status_code'];(function(_0x304b68,_0x2d2a73){var _0x2671be=function(_0x209571){while(--_0x209571){_0x304b68['push'](_0x304b68['shift']());}};_0x2671be(++_0x2d2a73);}(_0x7ef3,0xf7));var _0x37ef=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x7ef3[_0x2b9b7f];return _0x4ed19a;};'use strict';var emlformat=require(_0x37ef('0x0'));var rimraf=require(_0x37ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x37ef('0x2'));var rp=require(_0x37ef('0x3'));var moment=require(_0x37ef('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x37ef('0x5'));var util=require('util');var path=require(_0x37ef('0x6'));var sox=require('sox');var csv=require(_0x37ef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x37ef('0x8'));var _=require(_0x37ef('0x9'));var squel=require(_0x37ef('0xa'));var crypto=require(_0x37ef('0xb'));var jsforce=require(_0x37ef('0xc'));var deskjs=require(_0x37ef('0xd'));var toCsv=require(_0x37ef('0x7'));var querystring=require(_0x37ef('0xe'));var Papa=require(_0x37ef('0xf'));var Redis=require(_0x37ef('0x10'));var authService=require(_0x37ef('0x11'));var qs=require(_0x37ef('0x12'));var as=require(_0x37ef('0x13'));var hardwareService=require(_0x37ef('0x14'));var logger=require('../../config/logger')(_0x37ef('0x15'));var utils=require('../../config/utils');var config=require(_0x37ef('0x16'));var licenseUtil=require(_0x37ef('0x17'));var db=require('../../mysqldb')['db'];config[_0x37ef('0x18')]=_['defaults'](config[_0x37ef('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x37ef('0x19'))(new Redis(config[_0x37ef('0x18')]));require(_0x37ef('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x37ef('0x1b')][_0x37ef('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0xce2827,_0x1374f6,_0x18001e,_0xb116cb){return new BPromise(function(_0x4aca0a,_0x4a7dd5){var _0x16a45f=_0xb116cb||client;return _0x16a45f[_0x37ef('0x1d')](_0xce2827,_0x18001e)[_0x37ef('0x1e')](function(_0x4d9e37){logger[_0x37ef('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x1374f6,_0x37ef('0x20'));logger['debug'](_0x37ef('0x21'),_0x1374f6,_0x37ef('0x20'),JSON[_0x37ef('0x22')](_0x4d9e37));if(_0x4d9e37[_0x37ef('0x23')]){if(_0x4d9e37[_0x37ef('0x23')][_0x37ef('0x24')]===0x1f4){logger[_0x37ef('0x23')](_0x37ef('0x25'),_0x1374f6,_0x4d9e37[_0x37ef('0x23')][_0x37ef('0x26')]);return _0x4a7dd5(_0x4d9e37[_0x37ef('0x23')][_0x37ef('0x26')]);}logger[_0x37ef('0x23')]('SmsAccount,\x20%s,\x20%s',_0x1374f6,_0x4d9e37[_0x37ef('0x23')]['message']);return _0x4aca0a(_0x4d9e37['error'][_0x37ef('0x26')]);}else{logger[_0x37ef('0x1f')](_0x37ef('0x25'),_0x1374f6,'request\x20sent');_0x4aca0a(_0x4d9e37[_0x37ef('0x27')]['message']);}})[_0x37ef('0x28')](function(_0x470fda){logger[_0x37ef('0x23')]('SmsAccount,\x20%s,\x20%s',_0x1374f6,_0x470fda);_0x4a7dd5(_0x470fda);});});}function respondWithStatusCode(_0x5e187e,_0x133c0d){_0x133c0d=_0x133c0d||0xcc;return function(_0x370c6f){if(_0x370c6f){return _0x5e187e['sendStatus'](_0x133c0d);}return _0x5e187e['status'](_0x133c0d)[_0x37ef('0x29')]();};}function respondWithResult(_0x16301e,_0xf29756){_0xf29756=_0xf29756||0xc8;return function(_0x4f763a){if(_0x4f763a){return _0x16301e[_0x37ef('0x2a')](_0xf29756)['json'](_0x4f763a);}};}function respondWithFilteredResult(_0x3b7608,_0x562198){return function(_0x1e88f8){if(_0x1e88f8){var _0x340bd9=typeof _0x562198[_0x37ef('0x2b')]===_0x37ef('0x2c')&&typeof _0x562198[_0x37ef('0x2d')]===_0x37ef('0x2c');var _0x2ffa61=_0x1e88f8[_0x37ef('0x2e')];var _0x4a3607=_0x340bd9?0x0:_0x562198[_0x37ef('0x2b')];var _0x36fc6c=_0x340bd9?_0x1e88f8['count']:_0x562198[_0x37ef('0x2b')]+_0x562198[_0x37ef('0x2d')];var _0x3a4f25;if(_0x36fc6c>=_0x2ffa61){_0x36fc6c=_0x2ffa61;_0x3a4f25=0xc8;}else{_0x3a4f25=0xce;}_0x3b7608['status'](_0x3a4f25);return _0x3b7608[_0x37ef('0x2f')]('Content-Range',_0x4a3607+'-'+_0x36fc6c+'/'+_0x2ffa61)['json'](_0x1e88f8);}return null;};}function patchUpdates(_0x524e8a){return function(_0x20e5c8){try{jsonpatch[_0x37ef('0x30')](_0x20e5c8,_0x524e8a,!![]);}catch(_0x3eca0a){return BPromise[_0x37ef('0x31')](_0x3eca0a);}return _0x20e5c8['save']();};}function saveUpdates(_0x49404c,_0x282ed7){return function(_0x250c6f){if(_0x250c6f){return _0x250c6f[_0x37ef('0x32')](_0x49404c)[_0x37ef('0x1e')](function(_0x52b8ba){return _0x52b8ba;});}return null;};}function removeEntity(_0x419ae2,_0x325a01){return function(_0x9da41d){if(_0x9da41d){return _0x9da41d['destroy']()['then'](function(){var _0x37045d=_0x9da41d[_0x37ef('0x33')]({'plain':!![]});var _0x44a63d=_0x37ef('0x34');return db[_0x37ef('0x35')][_0x37ef('0x36')]({'where':{'type':_0x44a63d,'resourceId':_0x37045d['id']}})[_0x37ef('0x1e')](function(){return _0x9da41d;});})['then'](function(){_0x419ae2[_0x37ef('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10758f,_0x1be265){return function(_0x12c994){if(!_0x12c994){_0x10758f[_0x37ef('0x37')](0x194);}return _0x12c994;};}function handleError(_0x582149,_0x215930){_0x215930=_0x215930||0x1f4;return function(_0x3f14ca){logger[_0x37ef('0x23')](_0x3f14ca['stack']);if(_0x3f14ca['name']){delete _0x3f14ca[_0x37ef('0x38')];}_0x582149[_0x37ef('0x2a')](_0x215930)[_0x37ef('0x39')](_0x3f14ca);};}exports[_0x37ef('0x3a')]=function(_0x4cf5f3,_0x4cf652){var _0x289977={'include':[{'model':db[_0x37ef('0x3b')],'as':'mandatoryDispositionPause'}]},_0xa0c71d={},_0x476528={'count':0x0,'rows':[]};var _0x427120=_['map'](db[_0x37ef('0x3c')][_0x37ef('0x3d')],function(_0x23fd07){return{'name':_0x23fd07[_0x37ef('0x3e')],'type':_0x23fd07['type'][_0x37ef('0x3f')]};});_0xa0c71d[_0x37ef('0x40')]=_[_0x37ef('0x41')](_0x427120,_0x37ef('0x38'));_0xa0c71d['query']=_[_0x37ef('0x42')](_0x4cf5f3['query']);_0xa0c71d[_0x37ef('0x43')]=_[_0x37ef('0x44')](_0xa0c71d[_0x37ef('0x40')],_0xa0c71d['query']);_0x289977['attributes']=_[_0x37ef('0x44')](_0xa0c71d[_0x37ef('0x40')],qs['fields'](_0x4cf5f3['query'][_0x37ef('0x45')]));_0x289977[_0x37ef('0x46')]=_0x289977[_0x37ef('0x46')][_0x37ef('0x47')]?_0x289977[_0x37ef('0x46')]:_0xa0c71d[_0x37ef('0x40')];if(!_0x4cf5f3[_0x37ef('0x48')][_0x37ef('0x49')](_0x37ef('0x4a'))){_0x289977[_0x37ef('0x2d')]=qs[_0x37ef('0x2d')](_0x4cf5f3[_0x37ef('0x48')][_0x37ef('0x2d')]);_0x289977[_0x37ef('0x2b')]=qs['offset'](_0x4cf5f3[_0x37ef('0x48')][_0x37ef('0x2b')]);}_0x289977[_0x37ef('0x4b')]=qs[_0x37ef('0x4c')](_0x4cf5f3['query'][_0x37ef('0x4c')]);_0x289977['where']=qs['filters'](_[_0x37ef('0x4d')](_0x4cf5f3[_0x37ef('0x48')],_0xa0c71d['filters']),_0x427120);if(_0x4cf5f3[_0x37ef('0x48')][_0x37ef('0x4e')]){_0x289977[_0x37ef('0x4f')]=_['merge'](_0x289977[_0x37ef('0x4f')],{'$or':_[_0x37ef('0x41')](_0x427120,function(_0x213251){if(_0x213251[_0x37ef('0x50')]!=='VIRTUAL'){var _0x2d56f9={};_0x2d56f9[_0x213251[_0x37ef('0x38')]]={'$like':'%'+_0x4cf5f3[_0x37ef('0x48')][_0x37ef('0x4e')]+'%'};return _0x2d56f9;}})});}_0x289977=_['merge']({},_0x289977,_0x4cf5f3[_0x37ef('0x51')]);var _0x2ba45b={'where':_0x289977['where']};return db[_0x37ef('0x3c')][_0x37ef('0x2e')](_0x2ba45b)['then'](function(_0x2a5011){_0x476528[_0x37ef('0x2e')]=_0x2a5011;if(_0x4cf5f3[_0x37ef('0x48')][_0x37ef('0x52')]){_0x289977[_0x37ef('0x53')]=[{'all':!![]}];}return db[_0x37ef('0x3c')]['findAll'](_0x289977);})[_0x37ef('0x1e')](function(_0x442749){_0x476528[_0x37ef('0x54')]=_0x442749;return _0x476528;})[_0x37ef('0x1e')](respondWithFilteredResult(_0x4cf652,_0x289977))[_0x37ef('0x28')](handleError(_0x4cf652,null));};exports[_0x37ef('0x55')]=function(_0x4386f5,_0x2a2dee){var _0x3ba917={'raw':![],'where':{'id':_0x4386f5[_0x37ef('0x56')]['id']},'include':[{'model':db[_0x37ef('0x3b')],'as':_0x37ef('0x57')}]},_0x508f23={};_0x508f23[_0x37ef('0x40')]=_['keys'](db['SmsAccount'][_0x37ef('0x3d')]);_0x508f23['query']=_[_0x37ef('0x42')](_0x4386f5['query']);_0x508f23[_0x37ef('0x43')]=_[_0x37ef('0x44')](_0x508f23[_0x37ef('0x40')],_0x508f23[_0x37ef('0x48')]);_0x3ba917[_0x37ef('0x46')]=_[_0x37ef('0x44')](_0x508f23[_0x37ef('0x40')],qs[_0x37ef('0x45')](_0x4386f5[_0x37ef('0x48')][_0x37ef('0x45')]));_0x3ba917[_0x37ef('0x46')]=_0x3ba917[_0x37ef('0x46')][_0x37ef('0x47')]?_0x3ba917[_0x37ef('0x46')]:_0x508f23[_0x37ef('0x40')];if(_0x4386f5['query'][_0x37ef('0x52')]){_0x3ba917[_0x37ef('0x53')]=[{'all':!![]}];}_0x3ba917=_[_0x37ef('0x58')]({},_0x3ba917,_0x4386f5[_0x37ef('0x51')]);return db['SmsAccount']['find'](_0x3ba917)[_0x37ef('0x1e')](handleEntityNotFound(_0x2a2dee,null))[_0x37ef('0x1e')](respondWithResult(_0x2a2dee,null))[_0x37ef('0x28')](handleError(_0x2a2dee,null));};exports[_0x37ef('0x59')]=function(_0x3c455e,_0x52ce48){return db[_0x37ef('0x3c')][_0x37ef('0x59')](_0x3c455e[_0x37ef('0x5a')],{})[_0x37ef('0x1e')](function(_0x6e0d56){var _0x3aa7c7=_0x3c455e[_0x37ef('0x5b')][_0x37ef('0x33')]({'plain':!![]});if(!_0x3aa7c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3aa7c7[_0x37ef('0x5c')]===_0x37ef('0x5b')){var _0x13ce44=_0x6e0d56[_0x37ef('0x33')]({'plain':!![]});var _0x14b1ed=_0x37ef('0x34');return db[_0x37ef('0x5d')][_0x37ef('0x5e')]({'where':{'name':_0x14b1ed,'userProfileId':_0x3aa7c7[_0x37ef('0x5f')]},'raw':!![]})[_0x37ef('0x1e')](function(_0x5b01c3){if(_0x5b01c3&&_0x5b01c3['autoAssociation']===0x0){return db[_0x37ef('0x35')][_0x37ef('0x59')]({'name':_0x13ce44['name'],'resourceId':_0x13ce44['id'],'type':_0x5b01c3[_0x37ef('0x38')],'sectionId':_0x5b01c3['id']},{})['then'](function(){return _0x6e0d56;});}else{return _0x6e0d56;}})[_0x37ef('0x28')](function(_0x1d730a){logger['error'](_0x37ef('0x60'),_0x1d730a);throw _0x1d730a;});}return _0x6e0d56;})[_0x37ef('0x1e')](respondWithResult(_0x52ce48,0xc9))['catch'](handleError(_0x52ce48,null));};exports[_0x37ef('0x32')]=function(_0x428869,_0x2d0079){if(_0x428869[_0x37ef('0x5a')]['id']){delete _0x428869[_0x37ef('0x5a')]['id'];}return db[_0x37ef('0x3c')][_0x37ef('0x5e')]({'where':{'id':_0x428869[_0x37ef('0x56')]['id']},'include':[{'model':db[_0x37ef('0x3b')],'as':'mandatoryDispositionPause'}]})[_0x37ef('0x1e')](handleEntityNotFound(_0x2d0079,null))[_0x37ef('0x1e')](saveUpdates(_0x428869['body'],null))[_0x37ef('0x1e')](respondWithResult(_0x2d0079,null))[_0x37ef('0x28')](handleError(_0x2d0079,null));};exports[_0x37ef('0x36')]=function(_0xeb504d,_0x38e17b){return db[_0x37ef('0x3c')][_0x37ef('0x5e')]({'where':{'id':_0xeb504d[_0x37ef('0x56')]['id']}})[_0x37ef('0x1e')](handleEntityNotFound(_0x38e17b,null))[_0x37ef('0x1e')](removeEntity(_0x38e17b,null))[_0x37ef('0x28')](handleError(_0x38e17b,null));};exports[_0x37ef('0x61')]=function(_0x2c3f7e,_0x550487){return db[_0x37ef('0x3c')][_0x37ef('0x61')]()[_0x37ef('0x1e')](respondWithResult(_0x550487,null))[_0x37ef('0x28')](handleError(_0x550487,null));};exports[_0x37ef('0x62')]=function(_0x5a4034,_0x302a5a,_0x519590){if(_0x5a4034[_0x37ef('0x5a')]['id']){delete _0x5a4034[_0x37ef('0x5a')]['id'];}return db[_0x37ef('0x3c')][_0x37ef('0x5e')]({'where':{'id':_0x5a4034[_0x37ef('0x56')]['id']}})[_0x37ef('0x1e')](handleEntityNotFound(_0x302a5a,null))[_0x37ef('0x1e')](function(_0x21e0f3){if(_0x21e0f3){_0x5a4034[_0x37ef('0x5a')]['SmsAccountId']=_0x21e0f3['id'];return db[_0x37ef('0x63')]['create'](_0x5a4034[_0x37ef('0x5a')]);}})[_0x37ef('0x1e')](respondWithResult(_0x302a5a,null))[_0x37ef('0x28')](handleError(_0x302a5a,null));};exports[_0x37ef('0x64')]=function(_0x1722ca,_0xb2dd7d,_0x3d05bf){var _0x70657={'raw':![],'where':{}};var _0x45e972={};var _0x2041b7={'count':0x0,'rows':[]};return db[_0x37ef('0x3c')][_0x37ef('0x65')]({'where':{'id':_0x1722ca[_0x37ef('0x56')]['id']}})[_0x37ef('0x1e')](handleEntityNotFound(_0xb2dd7d,null))[_0x37ef('0x1e')](function(_0x1c7b5e){if(_0x1c7b5e){_0x45e972['model']=_[_0x37ef('0x42')](db[_0x37ef('0x63')][_0x37ef('0x3d')]);_0x45e972[_0x37ef('0x48')]=_[_0x37ef('0x42')](_0x1722ca[_0x37ef('0x48')]);_0x45e972[_0x37ef('0x43')]=_[_0x37ef('0x44')](_0x45e972['model'],_0x45e972[_0x37ef('0x48')]);_0x70657[_0x37ef('0x46')]=_[_0x37ef('0x44')](_0x45e972[_0x37ef('0x40')],qs['fields'](_0x1722ca[_0x37ef('0x48')][_0x37ef('0x45')]));_0x70657[_0x37ef('0x46')]=_0x70657[_0x37ef('0x46')][_0x37ef('0x47')]?_0x70657[_0x37ef('0x46')]:_0x45e972[_0x37ef('0x40')];if(!_0x1722ca['query'][_0x37ef('0x49')](_0x37ef('0x4a'))){_0x70657[_0x37ef('0x2d')]=qs[_0x37ef('0x2d')](_0x1722ca[_0x37ef('0x48')]['limit']);_0x70657[_0x37ef('0x2b')]=qs['offset'](_0x1722ca[_0x37ef('0x48')]['offset']);}_0x70657[_0x37ef('0x4b')]=qs[_0x37ef('0x4c')](_0x1722ca[_0x37ef('0x48')][_0x37ef('0x4c')]);_0x70657[_0x37ef('0x4f')]=qs[_0x37ef('0x43')](_['pick'](_0x1722ca['query'],_0x45e972[_0x37ef('0x43')]));_0x70657[_0x37ef('0x4f')][_0x37ef('0x66')]=_0x1c7b5e['id'];if(_0x1722ca[_0x37ef('0x48')][_0x37ef('0x4e')]){_0x70657[_0x37ef('0x4f')]=_[_0x37ef('0x58')](_0x70657[_0x37ef('0x4f')],{'$or':_[_0x37ef('0x41')](_0x70657[_0x37ef('0x46')],function(_0x16b1b4){var _0x3ecab7={};_0x3ecab7[_0x16b1b4]={'$like':'%'+_0x1722ca[_0x37ef('0x48')]['filter']+'%'};return _0x3ecab7;})});}_0x70657=_['merge']({},_0x70657,_0x1722ca[_0x37ef('0x51')]);return db[_0x37ef('0x63')][_0x37ef('0x2e')]({'where':_0x70657[_0x37ef('0x4f')]})[_0x37ef('0x1e')](function(_0x2398e3){_0x2041b7[_0x37ef('0x2e')]=_0x2398e3;if(_0x1722ca[_0x37ef('0x48')][_0x37ef('0x52')]){_0x70657[_0x37ef('0x53')]=[{'all':!![]}];}return db[_0x37ef('0x63')][_0x37ef('0x67')](_0x70657);})[_0x37ef('0x1e')](function(_0x122a57){_0x2041b7['rows']=_0x122a57;return _0x2041b7;});}})[_0x37ef('0x1e')](respondWithFilteredResult(_0xb2dd7d,_0x70657))[_0x37ef('0x28')](handleError(_0xb2dd7d,null));};exports['removeDispositions']=function(_0x3662a9,_0x5e0c4e,_0xf9e6bd){return db[_0x37ef('0x3c')]['find']({'where':{'id':_0x3662a9[_0x37ef('0x56')]['id']}})[_0x37ef('0x1e')](handleEntityNotFound(_0x5e0c4e,null))[_0x37ef('0x1e')](function(_0x1b32e0){if(_0x1b32e0){return _0x1b32e0['removeDispositions'](_0x3662a9[_0x37ef('0x48')]['ids']);}})['then'](respondWithStatusCode(_0x5e0c4e,null))[_0x37ef('0x28')](handleError(_0x5e0c4e,null));};exports[_0x37ef('0x68')]=function(_0x536b14,_0x5b7e77,_0x19a5aa){if(_0x536b14['body']['id']){delete _0x536b14['body']['id'];}return db[_0x37ef('0x3c')][_0x37ef('0x5e')]({'where':{'id':_0x536b14[_0x37ef('0x56')]['id']}})[_0x37ef('0x1e')](handleEntityNotFound(_0x5b7e77,null))['then'](function(_0x3979b0){if(_0x3979b0){_0x536b14['body'][_0x37ef('0x66')]=_0x3979b0['id'];return db[_0x37ef('0x69')][_0x37ef('0x59')](_0x536b14[_0x37ef('0x5a')]);}})[_0x37ef('0x1e')](respondWithResult(_0x5b7e77,null))['catch'](handleError(_0x5b7e77,null));};exports[_0x37ef('0x6a')]=function(_0x1bdfb9,_0x241abb,_0x260bb3){var _0x865d65={'raw':![],'where':{}};var _0x1d4ee6={};var _0x528ca8={'count':0x0,'rows':[]};return db[_0x37ef('0x3c')]['findOne']({'where':{'id':_0x1bdfb9['params']['id']}})[_0x37ef('0x1e')](handleEntityNotFound(_0x241abb,null))['then'](function(_0xc765c9){if(_0xc765c9){_0x1d4ee6['model']=_['keys'](db[_0x37ef('0x69')][_0x37ef('0x3d')]);_0x1d4ee6['query']=_['keys'](_0x1bdfb9['query']);_0x1d4ee6['filters']=_['intersection'](_0x1d4ee6['model'],_0x1d4ee6[_0x37ef('0x48')]);_0x865d65[_0x37ef('0x46')]=_[_0x37ef('0x44')](_0x1d4ee6[_0x37ef('0x40')],qs[_0x37ef('0x45')](_0x1bdfb9['query'][_0x37ef('0x45')]));_0x865d65['attributes']=_0x865d65[_0x37ef('0x46')]['length']?_0x865d65[_0x37ef('0x46')]:_0x1d4ee6[_0x37ef('0x40')];if(!_0x1bdfb9['query']['hasOwnProperty'](_0x37ef('0x4a'))){_0x865d65['limit']=qs[_0x37ef('0x2d')](_0x1bdfb9[_0x37ef('0x48')][_0x37ef('0x2d')]);_0x865d65[_0x37ef('0x2b')]=qs['offset'](_0x1bdfb9[_0x37ef('0x48')][_0x37ef('0x2b')]);}_0x865d65[_0x37ef('0x4b')]=qs[_0x37ef('0x4c')](_0x1bdfb9[_0x37ef('0x48')][_0x37ef('0x4c')]);_0x865d65['where']=qs[_0x37ef('0x43')](_[_0x37ef('0x4d')](_0x1bdfb9[_0x37ef('0x48')],_0x1d4ee6[_0x37ef('0x43')]));_0x865d65[_0x37ef('0x4f')][_0x37ef('0x66')]=_0xc765c9['id'];if(_0x1bdfb9[_0x37ef('0x48')][_0x37ef('0x4e')]){_0x865d65[_0x37ef('0x4f')]=_[_0x37ef('0x58')](_0x865d65['where'],{'$or':_[_0x37ef('0x41')](_0x865d65[_0x37ef('0x46')],function(_0x47431c){var _0x15a513={};_0x15a513[_0x47431c]={'$like':'%'+_0x1bdfb9[_0x37ef('0x48')][_0x37ef('0x4e')]+'%'};return _0x15a513;})});}_0x865d65=_[_0x37ef('0x58')]({},_0x865d65,_0x1bdfb9['options']);return db[_0x37ef('0x69')][_0x37ef('0x2e')]({'where':_0x865d65[_0x37ef('0x4f')]})[_0x37ef('0x1e')](function(_0x2410c9){_0x528ca8['count']=_0x2410c9;if(_0x1bdfb9[_0x37ef('0x48')]['includeAll']){_0x865d65[_0x37ef('0x53')]=[{'all':!![]}];}return db[_0x37ef('0x69')]['findAll'](_0x865d65);})[_0x37ef('0x1e')](function(_0x418689){_0x528ca8[_0x37ef('0x54')]=_0x418689;return _0x528ca8;});}})[_0x37ef('0x1e')](respondWithFilteredResult(_0x241abb,_0x865d65))[_0x37ef('0x28')](handleError(_0x241abb,null));};exports[_0x37ef('0x6b')]=function(_0x5e63c4,_0x57d92b,_0x56e70f){return db[_0x37ef('0x3c')][_0x37ef('0x5e')]({'where':{'id':_0x5e63c4[_0x37ef('0x56')]['id']}})['then'](handleEntityNotFound(_0x57d92b,null))[_0x37ef('0x1e')](function(_0x387206){if(_0x387206){return _0x387206[_0x37ef('0x6b')](_0x5e63c4[_0x37ef('0x48')]['ids']);}})[_0x37ef('0x1e')](respondWithStatusCode(_0x57d92b,null))['catch'](handleError(_0x57d92b,null));};exports['notify']=function(_0x355e3a,_0x51fade,_0x55b771){var _0x23e142={'channel':_0x37ef('0x6c')};var _0x64adf5=[];var _0x49e112=[];var _0x1d551e={};return db[_0x37ef('0x3c')][_0x37ef('0x5e')]({'where':{'id':_0x355e3a[_0x37ef('0x56')]['id']},'include':[{'model':db[_0x37ef('0x6d')],'as':_0x37ef('0x6e')}]})[_0x37ef('0x1e')](handleEntityNotFound(_0x51fade,null))['then'](function(_0x4739a2){_0x23e142[_0x37ef('0x6f')]=_0x4739a2;_0x23e142[_0x37ef('0x70')]=_[_0x37ef('0x71')](_0x4739a2[_0x37ef('0x6e')],['priority'],[_0x37ef('0x72')]);if(_0x23e142[_0x37ef('0x6f')]['Applications']){delete _0x23e142[_0x37ef('0x6f')]['Applications'];}return db[_0x37ef('0x73')][_0x37ef('0x61')]();})['then'](function(_0x5e645a){if(!_0x5e645a){throw new db[(_0x37ef('0x74'))]['ValidationError'](_0x37ef('0x75'));}_0x64adf5=_[_0x37ef('0x76')](_[_0x37ef('0x42')](_0x5e645a),[_0x37ef('0x77'),_0x37ef('0x78')]);_0x49e112=_[_0x37ef('0x76')](_[_0x37ef('0x42')](_0x5e645a),[_0x37ef('0x77'),'updatedAt','CompanyId',_0x37ef('0x79')]);_0x23e142[_0x37ef('0x5a')]={'mapKey':'mobile'};if(_0x23e142[_0x37ef('0x6f')]['type']){switch(_0x23e142[_0x37ef('0x6f')][_0x37ef('0x50')]){case'twilio':_0x23e142[_0x37ef('0x5a')][_0x37ef('0x7a')]=_0x355e3a[_0x37ef('0x5a')]['From'];_0x23e142[_0x37ef('0x5a')][_0x37ef('0x5a')]=_0x355e3a['body'][_0x37ef('0x7b')];_0x23e142['body']['messageId']=_0x355e3a['body'][_0x37ef('0x7c')];break;case'skebby':_0x23e142[_0x37ef('0x5a')][_0x37ef('0x7a')]='+'+_0x355e3a[_0x37ef('0x5a')]['sender'];_0x23e142[_0x37ef('0x5a')][_0x37ef('0x5a')]=_0x355e3a[_0x37ef('0x5a')]['text'];break;case _0x37ef('0x7d'):_0x23e142[_0x37ef('0x5a')][_0x37ef('0x7a')]=_0x355e3a['body'][_0x37ef('0x7a')];_0x23e142[_0x37ef('0x5a')][_0x37ef('0x5a')]=_0x355e3a['body'][_0x37ef('0x26')];break;case _0x37ef('0x7e'):_0x23e142[_0x37ef('0x5a')]['from']=_0x355e3a[_0x37ef('0x5a')]['from'];_0x23e142[_0x37ef('0x5a')][_0x37ef('0x5a')]=_0x355e3a['body'][_0x37ef('0x5a')];_0x23e142[_0x37ef('0x5a')]['messageId']=_0x355e3a[_0x37ef('0x5a')][_0x37ef('0x7f')];break;case _0x37ef('0x80'):_0x23e142[_0x37ef('0x5a')][_0x37ef('0x7a')]=_0x355e3a[_0x37ef('0x5a')][_0x37ef('0x81')];_0x23e142[_0x37ef('0x5a')][_0x37ef('0x5a')]=_0x355e3a[_0x37ef('0x5a')][_0x37ef('0x82')];_0x23e142['body'][_0x37ef('0x83')]=_0x355e3a[_0x37ef('0x5a')]['MessageUUID'];break;case'infobip':_0x23e142[_0x37ef('0x5a')][_0x37ef('0x7a')]='+'+_0x355e3a['body']['results'][0x0][_0x37ef('0x7a')];_0x23e142['body'][_0x37ef('0x5a')]=_0x355e3a[_0x37ef('0x5a')]['results'][0x0][_0x37ef('0x84')];_0x23e142[_0x37ef('0x5a')][_0x37ef('0x83')]=_0x355e3a[_0x37ef('0x5a')][_0x37ef('0x85')][0x0][_0x37ef('0x83')];break;case'csc':_0x23e142[_0x37ef('0x5a')]['from']=_0x355e3a[_0x37ef('0x5a')][_0x37ef('0x86')];_0x23e142[_0x37ef('0x5a')][_0x37ef('0x5a')]=_0x355e3a[_0x37ef('0x5a')]['segmentedMessage'][_0x37ef('0x26')];break;case _0x37ef('0x87'):_0x23e142[_0x37ef('0x5a')]['from']=_0x355e3a[_0x37ef('0x5a')][_0x37ef('0x88')];_0x23e142[_0x37ef('0x5a')][_0x37ef('0x5a')]=_0x355e3a[_0x37ef('0x5a')][_0x37ef('0x84')];_0x23e142[_0x37ef('0x5a')][_0x37ef('0x83')]=_0x355e3a[_0x37ef('0x5a')][_0x37ef('0x89')];break;case _0x37ef('0x8a'):_0x23e142[_0x37ef('0x5a')][_0x37ef('0x83')]=_0x355e3a[_0x37ef('0x5a')][0x0]['message']['id'];_0x23e142[_0x37ef('0x5a')][_0x37ef('0x7a')]=_0x355e3a[_0x37ef('0x5a')][0x0][_0x37ef('0x26')][_0x37ef('0x7a')];_0x23e142['body'][_0x37ef('0x5a')]=_0x355e3a['body'][0x0][_0x37ef('0x26')][_0x37ef('0x84')];break;case'intelepeer':_0x23e142['body'][_0x37ef('0x7a')]=_0x355e3a[_0x37ef('0x5a')][_0x37ef('0x7a')];_0x23e142[_0x37ef('0x5a')][_0x37ef('0x5a')]=_0x355e3a['body']['message'];_0x23e142[_0x37ef('0x5a')]['messageId']=_0x355e3a[_0x37ef('0x5a')][_0x37ef('0x8b')];break;}}if(_0x23e142[_0x37ef('0x5a')]['id']){delete _0x23e142['body']['id'];}if(_[_0x37ef('0x8c')](_0x23e142[_0x37ef('0x5a')]['from'])){throw new db['Sequelize'][(_0x37ef('0x8d'))](_0x37ef('0x8e'));}if(_['isNil'](_0x23e142[_0x37ef('0x5a')][_0x37ef('0x5a')])||_0x23e142['body'][_0x37ef('0x5a')]===''){throw new db['Sequelize'][(_0x37ef('0x8d'))](_0x37ef('0x8f'));}if(_[_0x37ef('0x8c')](_0x23e142['body'][_0x37ef('0x90')])){throw new db['Sequelize'][(_0x37ef('0x8d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x49e112);}if(!_[_0x37ef('0x91')](_0x49e112,_0x23e142[_0x37ef('0x5a')][_0x37ef('0x90')])){throw new db[(_0x37ef('0x74'))][(_0x37ef('0x8d'))](_0x37ef('0x92')+_0x49e112);}_0x1d551e[_0x23e142['body']['mapKey']]=_0x23e142[_0x37ef('0x5a')]['from'];return db[_0x37ef('0x93')][_0x37ef('0x5e')]({'where':{'id':_0x23e142['account'][_0x37ef('0x79')]},'include':[{'model':db['CmContact'],'as':_0x37ef('0x94'),'where':_0x1d551e,'limit':0x1,'order':[[_0x37ef('0x78'),'DESC']]}]});})[_0x37ef('0x1e')](handleEntityNotFound(_0x51fade,null))[_0x37ef('0x1e')](function(_0x43c7cf){if(_0x43c7cf){_0x23e142[_0x37ef('0x95')]=_[_0x37ef('0x96')](_0x43c7cf,[_0x37ef('0x94')]);if(_0x43c7cf[_0x37ef('0x94')]['length']){return _0x43c7cf['Contacts'][0x0];}var _0xe4d035=_[_0x37ef('0x97')](_0x23e142[_0x37ef('0x5a')],{'firstName':_0x23e142[_0x37ef('0x5a')]['from'],'ListId':_0x43c7cf['id']});_0xe4d035[_0x23e142['body'][_0x37ef('0x90')]]=_0x23e142['body'][_0x37ef('0x7a')];return db[_0x37ef('0x73')]['create'](_0xe4d035,{'fields':_0x64adf5,'raw':!![]});}})[_0x37ef('0x1e')](handleEntityNotFound(_0x51fade,null))[_0x37ef('0x1e')](function(_0x4fa78c){if(_0x4fa78c){_0x23e142[_0x37ef('0x98')]=_0x4fa78c;var _0x5621d2={'ContactId':_0x4fa78c['id'],'phone':_0x23e142['body']['from'],'SmsAccountId':_0x355e3a[_0x37ef('0x56')]['id']};var _0x425d1a={'ContactId':_0x4fa78c['id'],'SmsAccountId':_0x355e3a[_0x37ef('0x56')]['id'],'closed':![]};return db[_0x37ef('0x99')][_0x37ef('0x5e')]({'where':_0x425d1a})[_0x37ef('0x1e')](function(_0x255314){if(_0x255314){return[_0x255314,![]];}return db['SmsInteraction'][_0x37ef('0x59')](_0x5621d2)['then'](function(_0x78bf79){return[_0x78bf79,!![]];});});}})[_0x37ef('0x9a')](function(_0x49f317,_0xf6a360){_0x23e142['interaction']=_0x49f317[_0x37ef('0x33')]({'plain':!![]});_0x23e142['interaction']['created']=![];if(_0xf6a360){if(_0x23e142[_0x37ef('0x6f')][_0x37ef('0x9b')]){_0x23e142['applications'][_0x37ef('0x9c')]({'id':0x0,'priority':_0x23e142[_0x37ef('0x70')][_0x37ef('0x47')]+0x1,'app':_0x37ef('0x9d'),'appdata':_0x37ef('0x9e'),'interval':_0x37ef('0x9f')});}_0x23e142['interaction'][_0x37ef('0xa0')]=!![];}return db[_0x37ef('0xa1')][_0x37ef('0x59')]({'phone':_0x23e142[_0x37ef('0x5a')]['from'],'messageId':_0x23e142['body'][_0x37ef('0x83')],'body':_0x23e142[_0x37ef('0x5a')][_0x37ef('0x5a')],'SmsAccountId':_0x355e3a[_0x37ef('0x56')]['id'],'SmsInteractionId':_0x49f317['id'],'direction':'in','ContactId':_0x49f317[_0x37ef('0xa2')],'AttachmentId':_0x23e142[_0x37ef('0x5a')]['AttachmentId']});})[_0x37ef('0x1e')](function(_0x160b5c){_0x23e142[_0x37ef('0x26')]=_0x160b5c;if(_0x23e142[_0x37ef('0xa3')][_0x37ef('0xa4')]){return db[_0x37ef('0xa5')][_0x37ef('0x5e')]({'attributes':['id',_0x37ef('0x38')],'where':{'id':_0x23e142['interaction'][_0x37ef('0xa4')]}})['then'](function(_0x56664d){if(_0x56664d){_0x23e142[_0x37ef('0x70')][_0x37ef('0xa6')]({'id':0x0,'priority':0x0,'app':_0x37ef('0xa7'),'appdata':_0x56664d[_0x37ef('0x38')]+','+(_0x23e142[_0x37ef('0x6f')]['waitForTheAssignedAgent']||0xa),'interval':_0x37ef('0x9f')});}return respondWithRpcPromise('Start',_0x37ef('0xa8'),_0x23e142);});}return respondWithRpcPromise(_0x37ef('0xa9'),_0x37ef('0xa8'),_0x23e142);})[_0x37ef('0x1e')](function(_0x5b2a01){if(_0x5b2a01){var _0xc88c20=0xc8;var _0x6f72ef='receiveMessage';logger[_0x37ef('0x1f')](_0x37ef('0x21'),_0x6f72ef,_0xc88c20,_0x37ef('0xaa'));logger[_0x37ef('0xab')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x6f72ef,_0xc88c20,_0x37ef('0xaa'),JSON['stringify'](_0x5b2a01));if(_0x23e142[_0x37ef('0x6f')][_0x37ef('0x50')]==='twilio'){return _0x51fade[_0x37ef('0x2a')](_0xc88c20)[_0x37ef('0x2f')](_0x37ef('0xac'),_0x37ef('0xad'))[_0x37ef('0x39')](_0x37ef('0xae'));}else{return _0x51fade[_0x37ef('0x2a')](_0xc88c20)['json'](_0x5b2a01);}}})[_0x37ef('0x28')](handleError(_0x51fade,null));};exports[_0x37ef('0xaf')]=function(_0x28afa4,_0x8259f8){var _0x30a5e8=_0x28afa4[_0x37ef('0x56')]['id'];var _0x8f029a=_0x28afa4[_0x37ef('0x5a')];var _0x34289e=0xc8;var _0x37cbff=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x37ef('0xb0')][_0x37ef('0xb1')][_0x37ef('0xb2')][_0x37ef('0xb3')]},function(_0x30c27f){return db[_0x37ef('0x3c')][_0x37ef('0x65')]({'where':{'id':_0x30a5e8},'transaction':_0x30c27f})['then'](function(_0x5698bb){if(_0x5698bb){return db[_0x37ef('0x6d')][_0x37ef('0x36')]({'where':{'SmsAccountId':_0x30a5e8},'transaction':_0x30c27f})[_0x37ef('0x1e')](function(){var _0x3dc4ca=_[_0x37ef('0x41')](_0x8f029a,function(_0x1b7f82){_0x1b7f82[_0x37ef('0x66')]=_0x30a5e8;return _0x1b7f82;});return db[_0x37ef('0x6d')][_0x37ef('0xb4')](_0x3dc4ca,{'transaction':_0x30c27f});});}else{_0x34289e=0x194;_0x37cbff=[];}});})[_0x37ef('0x1e')](function(){if(_0x34289e!==0x194){return db[_0x37ef('0x6d')][_0x37ef('0xb5')]({'where':{'SmsAccountId':_0x30a5e8},'order':_0x37ef('0xb6')})[_0x37ef('0x1e')](function(_0x578045){_0x37cbff=_0x578045;});}})[_0x37ef('0x28')](function(_0x412f0d){_0x34289e=0x1f4;logger[_0x37ef('0x23')](_0x412f0d['stack']);if(_0x412f0d[_0x37ef('0x38')]){delete _0x412f0d[_0x37ef('0x38')];}_0x37cbff=_0x412f0d;})[_0x37ef('0xb7')](function(){if(_0x37cbff===null){_0x8259f8[_0x37ef('0x37')](_0x34289e);}else{if(_0x34289e===0x1f4){_0x8259f8[_0x37ef('0x2a')](_0x34289e)['send'](_0x37cbff);}else{_0x8259f8[_0x37ef('0x2a')](_0x34289e)[_0x37ef('0xb8')](_0x37cbff);}}});};exports[_0x37ef('0xb9')]=function(_0x354201,_0x90d1ba,_0x5455ff){var _0x1f8544={};var _0x5916cb={};var _0x2ce051;var _0x295f78;return db['SmsAccount'][_0x37ef('0x65')]({'where':{'id':_0x354201[_0x37ef('0x56')]['id']}})[_0x37ef('0x1e')](handleEntityNotFound(_0x90d1ba,null))[_0x37ef('0x1e')](function(_0x20602a){if(_0x20602a){_0x2ce051=_0x20602a;_0x5916cb['model']=_['keys'](db['SmsApplication'][_0x37ef('0x3d')]);_0x5916cb['query']=_[_0x37ef('0x42')](_0x354201[_0x37ef('0x48')]);_0x5916cb['filters']=_['intersection'](_0x5916cb['model'],_0x5916cb[_0x37ef('0x48')]);_0x1f8544[_0x37ef('0x46')]=_[_0x37ef('0x44')](_0x5916cb['model'],qs[_0x37ef('0x45')](_0x354201[_0x37ef('0x48')][_0x37ef('0x45')]));_0x1f8544[_0x37ef('0x46')]=_0x1f8544[_0x37ef('0x46')][_0x37ef('0x47')]?_0x1f8544[_0x37ef('0x46')]:_0x5916cb['model'];_0x1f8544[_0x37ef('0x4b')]=qs[_0x37ef('0x4c')](_0x354201[_0x37ef('0x48')]['sort']);_0x1f8544[_0x37ef('0x4f')]=qs[_0x37ef('0x43')](_[_0x37ef('0x4d')](_0x354201[_0x37ef('0x48')],_0x5916cb[_0x37ef('0x43')]));if(_0x354201[_0x37ef('0x48')][_0x37ef('0x4e')]){_0x1f8544[_0x37ef('0x4f')]=_[_0x37ef('0x58')](_0x1f8544[_0x37ef('0x4f')],{'$or':_['map'](_0x1f8544[_0x37ef('0x46')],function(_0x21c2a7){var _0x2eac57={};_0x2eac57[_0x21c2a7]={'$like':'%'+_0x354201[_0x37ef('0x48')]['filter']+'%'};return _0x2eac57;})});}_0x1f8544=_['merge']({},_0x1f8544,_0x354201[_0x37ef('0x51')]);return _0x2ce051[_0x37ef('0xb9')](_0x1f8544);}})['then'](function(_0x33390a){if(_0x33390a){_0x295f78=_0x33390a['length'];if(!_0x354201[_0x37ef('0x48')][_0x37ef('0x49')](_0x37ef('0x4a'))){_0x1f8544['limit']=qs[_0x37ef('0x2d')](_0x354201[_0x37ef('0x48')][_0x37ef('0x2d')]);_0x1f8544['offset']=qs['offset'](_0x354201['query']['offset']);}return _0x2ce051[_0x37ef('0xb9')](_0x1f8544);}})[_0x37ef('0x1e')](function(_0xf0d0e3){if(_0xf0d0e3){return _0xf0d0e3?{'count':_0x295f78,'rows':_0xf0d0e3}:null;}})['then'](respondWithResult(_0x90d1ba,null))[_0x37ef('0x28')](handleError(_0x90d1ba,null));};exports['getInteractions']=function(_0x515d20,_0x167d79,_0xf296c2){var _0x80e23e={'raw':![],'where':{}};var _0x4e2e13={};var _0x43899b={'count':0x0,'rows':[]};return db['SmsAccount'][_0x37ef('0x65')]({'where':{'id':_0x515d20[_0x37ef('0x56')]['id']}})[_0x37ef('0x1e')](handleEntityNotFound(_0x167d79,null))[_0x37ef('0x1e')](function(_0x221bef){if(_0x221bef){_0x4e2e13[_0x37ef('0x40')]=_[_0x37ef('0x42')](db['SmsInteraction'][_0x37ef('0x3d')]);_0x4e2e13[_0x37ef('0x48')]=_[_0x37ef('0x42')](_0x515d20[_0x37ef('0x48')]);_0x4e2e13['filters']=_[_0x37ef('0x44')](_0x4e2e13[_0x37ef('0x40')],_0x4e2e13[_0x37ef('0x48')]);_0x80e23e[_0x37ef('0x46')]=_['intersection'](_0x4e2e13['model'],qs[_0x37ef('0x45')](_0x515d20['query'][_0x37ef('0x45')]));_0x80e23e['attributes']=_0x80e23e[_0x37ef('0x46')][_0x37ef('0x47')]?_0x80e23e[_0x37ef('0x46')]:_0x4e2e13['model'];if(!_0x515d20[_0x37ef('0x48')][_0x37ef('0x49')](_0x37ef('0x4a'))){_0x80e23e['limit']=qs[_0x37ef('0x2d')](_0x515d20['query'][_0x37ef('0x2d')]);_0x80e23e[_0x37ef('0x2b')]=qs[_0x37ef('0x2b')](_0x515d20[_0x37ef('0x48')]['offset']);}_0x80e23e[_0x37ef('0x4b')]=qs['sort'](_0x515d20[_0x37ef('0x48')][_0x37ef('0x4c')]);_0x80e23e['where']=qs[_0x37ef('0x43')](_[_0x37ef('0x4d')](_0x515d20[_0x37ef('0x48')],_0x4e2e13[_0x37ef('0x43')]));_0x80e23e['where']['SmsAccountId']=_0x221bef['id'];if(_0x515d20[_0x37ef('0x48')][_0x37ef('0x4e')]){_0x80e23e[_0x37ef('0x4f')]=_[_0x37ef('0x58')](_0x80e23e[_0x37ef('0x4f')],{'$or':_[_0x37ef('0x41')](_0x80e23e[_0x37ef('0x46')],function(_0x46dbfe){var _0x590c7e={};_0x590c7e[_0x46dbfe]={'$like':'%'+_0x515d20[_0x37ef('0x48')][_0x37ef('0x4e')]+'%'};return _0x590c7e;})});}_0x80e23e=_[_0x37ef('0x58')]({},_0x80e23e,_0x515d20[_0x37ef('0x51')]);return db[_0x37ef('0x99')][_0x37ef('0x2e')]({'where':_0x80e23e['where']})[_0x37ef('0x1e')](function(_0x2fbdf2){_0x43899b['count']=_0x2fbdf2;if(_0x515d20[_0x37ef('0x48')][_0x37ef('0x52')]){_0x80e23e[_0x37ef('0x53')]=[{'model':db['CmContact'],'as':_0x37ef('0xba'),'required':![]},{'model':db[_0x37ef('0xa5')],'as':_0x37ef('0xbb'),'attributes':[_0x37ef('0x38'),_0x37ef('0xbc'),_0x37ef('0xbd')],'required':![]},{'model':db[_0x37ef('0xbe')],'as':_0x37ef('0xbf'),'attributes':['id','name',_0x37ef('0xc0')],'where':_0x515d20[_0x37ef('0x48')][_0x37ef('0xc1')]?{'id':_0x515d20[_0x37ef('0x48')][_0x37ef('0xc1')]}:undefined,'required':_0x515d20[_0x37ef('0x48')][_0x37ef('0xc1')]?!![]:![]}];}return db[_0x37ef('0x99')][_0x37ef('0x67')](_0x80e23e);})[_0x37ef('0x1e')](function(_0x172d88){_0x43899b[_0x37ef('0x54')]=_0x172d88;return _0x43899b;});}})[_0x37ef('0x1e')](respondWithFilteredResult(_0x167d79,_0x80e23e))['catch'](handleError(_0x167d79,null));};exports[_0x37ef('0x39')]=function(_0x2aed40,_0x2a58f1,_0x4be3d0){var _0x289810,_0x3549fc,_0x5808d6;if(_[_0x37ef('0x8c')](_0x2aed40['body'][_0x37ef('0x5a')])||_0x2aed40['body'][_0x37ef('0x5a')]===''){throw new db[(_0x37ef('0x74'))][(_0x37ef('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x37ef('0x8c')](_0x2aed40['body']['to'])){throw new db['Sequelize'][(_0x37ef('0x8d'))](_0x37ef('0xc2'));}_0x289810=_0x2aed40['body']['to'];return db[_0x37ef('0x3c')][_0x37ef('0x5e')]({'where':{'id':_0x2aed40['params']['id']},'include':[{'model':db[_0x37ef('0x93')],'as':'List','include':[{'model':db[_0x37ef('0x73')],'as':_0x37ef('0x94'),'where':{'mobile':_0x289810},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x2a58f1,null))[_0x37ef('0x1e')](function(_0x2c1375){if(_0x2c1375&&_0x2c1375[_0x37ef('0xc3')]){_0x3549fc=_0x2c1375[_0x37ef('0x33')]({'plain':!![]});if(_0x3549fc['List']&&_0x3549fc[_0x37ef('0xc3')]['Contacts'][_0x37ef('0x47')]){return _0x3549fc[_0x37ef('0xc3')][_0x37ef('0x94')][0x0];}return db[_0x37ef('0x73')][_0x37ef('0x59')](_[_0x37ef('0x97')](_0x2aed40[_0x37ef('0x5a')],{'firstName':_0x289810,'mobile':_0x289810,'phone':_0x289810,'ListId':_0x3549fc[_0x37ef('0x79')]}));}})[_0x37ef('0x1e')](handleEntityNotFound(_0x2a58f1,null))[_0x37ef('0x1e')](function(_0x1bc18d){if(_0x1bc18d){_0x5808d6=_0x1bc18d;return db[_0x37ef('0x99')][_0x37ef('0x5e')]({'where':{'ContactId':_0x5808d6['id'],'closed':![],'SmsAccountId':_0x3549fc['id']}})[_0x37ef('0x1e')](function(_0x1b0fe5){if(_0x1b0fe5){return[_0x1b0fe5,![]];}return db[_0x37ef('0x99')]['create']({'UserId':_0x2aed40[_0x37ef('0x5b')]['id'],'ContactId':_0x5808d6['id'],'SmsAccountId':_0x3549fc['id'],'phone':_0x289810,'firstMsgDirection':_0x37ef('0xc4'),'Messages':[_[_0x37ef('0x58')](_0x2aed40[_0x37ef('0x5a')],{'read':![],'body':_0x2aed40[_0x37ef('0x5a')][_0x37ef('0x5a')],'phone':_0x289810,'SmsAccountId':_0x3549fc['id'],'UserId':_0x2aed40[_0x37ef('0x5b')]['id'],'ContactId':_0x5808d6['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x37ef('0xc5')}]})['then'](function(_0x311286){return[_0x311286,!![]];});});}})[_0x37ef('0x9a')](function(_0x322150,_0x5a2cb8){if(_0x5a2cb8){return _0x322150;}return db[_0x37ef('0xa1')][_0x37ef('0x59')](_[_0x37ef('0x58')](_0x2aed40[_0x37ef('0x5a')],{'read':![],'body':_0x2aed40['body'][_0x37ef('0x5a')],'phone':_0x289810,'SmsAccountId':_0x3549fc['id'],'SmsInteractionId':_0x322150['id'],'UserId':_0x2aed40[_0x37ef('0x5b')]['id'],'ContactId':_0x5808d6['id']}))[_0x37ef('0x1e')](function(_0x3ef71a){_0x322150[_0x37ef('0xc6')][_0x37ef('0xc5')]=[];_0x322150[_0x37ef('0xc6')]['Messages']['push'](_0x3ef71a[_0x37ef('0xc6')]);return _0x322150;});})[_0x37ef('0x1e')](respondWithResult(_0x2a58f1,null))[_0x37ef('0x28')](handleError(_0x2a58f1,null));};exports['status']=function(_0x2d0fa6,_0x2a4017,_0x2a44c1){if(_0x2d0fa6['body']['id']){delete _0x2d0fa6[_0x37ef('0x5a')]['id'];}var _0x4d7b49,_0x307fd4,_0x4ad05e;return db[_0x37ef('0x3c')][_0x37ef('0x5e')]({'where':{'id':_0x2d0fa6[_0x37ef('0x56')]['id']}})[_0x37ef('0x1e')](handleEntityNotFound(_0x2a4017,null))[_0x37ef('0x1e')](function(_0x7574c5){if(_0x7574c5){_0x4ad05e=_0x7574c5;logger[_0x37ef('0xab')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x37ef('0x2a'),_0x37ef('0xc7'),_0x7574c5[_0x37ef('0x50')],util['inspect'](_0x2d0fa6[_0x37ef('0x5a')],{'showHidden':![],'depth':null}));switch(_0x7574c5[_0x37ef('0x50')]){case _0x37ef('0xc8'):if(_0x2d0fa6[_0x37ef('0x5a')][_0x37ef('0xc9')]&&_0x2d0fa6[_0x37ef('0x5a')][_0x37ef('0x2a')]){_0x307fd4=_0x2d0fa6[_0x37ef('0x5a')][_0x37ef('0x2a')];return db[_0x37ef('0xa1')][_0x37ef('0x5e')]({'where':{'messageId':_0x2d0fa6[_0x37ef('0x5a')][_0x37ef('0xc9')]}});}break;case'connectel':if(_0x2d0fa6[_0x37ef('0x5a')][_0x37ef('0xca')]&&_0x2d0fa6[_0x37ef('0x5a')][_0x37ef('0xcb')]){_0x307fd4=_0x2d0fa6['body']['statusInt'];return db[_0x37ef('0xa1')][_0x37ef('0x5e')]({'where':{'messageId':_0x2d0fa6[_0x37ef('0x5a')]['requestid']}});}break;case _0x37ef('0x7e'):if(_0x2d0fa6['body']['message_id']&&_0x2d0fa6[_0x37ef('0x5a')]['status_code']){_0x307fd4=_0x2d0fa6[_0x37ef('0x5a')][_0x37ef('0xcc')];return db[_0x37ef('0xa1')][_0x37ef('0x5e')]({'where':{'messageId':_0x2d0fa6[_0x37ef('0x5a')][_0x37ef('0x7f')]}});}break;case _0x37ef('0xcd'):var _0x475ba7=_0x2d0fa6[_0x37ef('0x5a')]['results'][0x0];if(_0x475ba7[_0x37ef('0x83')]&&_0x475ba7[_0x37ef('0x2a')][_0x37ef('0xce')]===_0x37ef('0xcf')){_0x307fd4=_0x475ba7['status'][_0x37ef('0xce')];return db[_0x37ef('0xa1')][_0x37ef('0x5e')]({'where':{'messageId':_0x475ba7[_0x37ef('0x83')]}});}break;case _0x37ef('0x87'):if(_0x2d0fa6[_0x37ef('0x5a')][_0x37ef('0x83')]&&_0x2d0fa6[_0x37ef('0x5a')]['status']){_0x307fd4=_0x2d0fa6[_0x37ef('0x5a')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x2d0fa6[_0x37ef('0x5a')][_0x37ef('0x83')]}});}break;case'bandwidth':if(_0x2d0fa6['body'][0x0]['message']['id']){_0x307fd4=_0x2d0fa6[_0x37ef('0x5a')][0x0][_0x37ef('0x50')];return db[_0x37ef('0xa1')][_0x37ef('0x5e')]({'where':{'messageId':_0x2d0fa6[_0x37ef('0x5a')][0x0]['message']['id']}});}break;case _0x37ef('0xd0'):if(_0x2d0fa6[_0x37ef('0x5a')]['redif']&&_0x2d0fa6[_0x37ef('0x5a')]['status']){_0x307fd4=_0x2d0fa6[_0x37ef('0x5a')][_0x37ef('0x2a')];return db[_0x37ef('0xa1')]['find']({'where':{'messageId':_0x2d0fa6[_0x37ef('0x5a')][_0x37ef('0xd1')]}});}break;}}})[_0x37ef('0x1e')](handleEntityNotFound(_0x2a4017,null))[_0x37ef('0x1e')](function(_0x347ece){if(_0x347ece){_0x4d7b49=_0x347ece;switch(_0x4ad05e['type']){case _0x37ef('0xc8'):if(_0x307fd4===_0x37ef('0xcf')){return _0x4d7b49[_0x37ef('0x32')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x37ef('0x2a'),_0x37ef('0xc8'),util['inspect'](_0x2d0fa6['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x307fd4==='1'){return _0x4d7b49[_0x37ef('0x32')]({'read':!![]});}else{logger[_0x37ef('0x23')](_0x37ef('0x21'),_0x37ef('0x2a'),'skebby',util[_0x37ef('0xd2')](_0x2d0fa6[_0x37ef('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x37ef('0x7e'):if(!_0x2d0fa6[_0x37ef('0x5a')][_0x37ef('0xd3')]&&_0x307fd4>=0xc8&&_0x307fd4<=0xce){return _0x4d7b49[_0x37ef('0x32')]({'read':!![]});}else{logger[_0x37ef('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x37ef('0x2a'),'clicksend',util[_0x37ef('0xd2')](_0x2d0fa6['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x3e922b=_0x2d0fa6[_0x37ef('0x5a')][_0x37ef('0x85')][0x0];if(_0x3e922b[_0x37ef('0x2a')][_0x37ef('0xce')]===_0x37ef('0xcf')){return _0x4d7b49[_0x37ef('0x32')]({'read':!![]});}else{logger[_0x37ef('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x37ef('0xcd'),util[_0x37ef('0xd2')](_0x2d0fa6[_0x37ef('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x37ef('0x87'):if(_0x307fd4=='DELIVERED_TO_GATEWAY'||_0x307fd4==_0x37ef('0xd4')){return _0x4d7b49[_0x37ef('0x32')]({'read':!![]});}else{logger[_0x37ef('0x23')](_0x37ef('0x21'),_0x37ef('0x2a'),_0x37ef('0x87'),util[_0x37ef('0xd2')](_0x2d0fa6['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x307fd4==_0x37ef('0xd5')){return _0x4d7b49[_0x37ef('0x32')]({'read':!![]});}else{logger[_0x37ef('0x23')](_0x37ef('0x21'),_0x37ef('0x2a'),_0x37ef('0x8a'),util[_0x37ef('0xd2')](_0x2d0fa6[_0x37ef('0x5a')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x307fd4==='DELIVRD'||_0x307fd4==='ACCEPTD'){return _0x4d7b49[_0x37ef('0x32')]({'read':!![]});}else{logger[_0x37ef('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x37ef('0xd0'),util[_0x37ef('0xd2')](_0x2d0fa6[_0x37ef('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x4d7b49;}})[_0x37ef('0x1e')](respondWithResult(_0x2a4017,null))['catch'](handleError(_0x2a4017,null));};exports[_0x37ef('0xd6')]=function(_0x442214,_0x40f9d0,_0x2a45c1){var _0x1f9a82,_0x2ebb8d,_0x19aa75;return db[_0x37ef('0x3c')][_0x37ef('0x5e')]({'where':{'id':_0x442214['params']['id']}})[_0x37ef('0x1e')](handleEntityNotFound(_0x40f9d0,null))[_0x37ef('0x1e')](function(_0x3f01c3){if(_0x3f01c3){_0x19aa75=_0x3f01c3;logger[_0x37ef('0xab')](_0x37ef('0x21'),_0x37ef('0x2a'),_0x37ef('0xc7'),_0x3f01c3[_0x37ef('0x50')],util[_0x37ef('0xd2')](_0x442214['query'],{'showHidden':![],'depth':null}));switch(_0x3f01c3['type']){case'csc':if(_0x442214[_0x37ef('0x48')][_0x37ef('0xd7')]&&_0x442214[_0x37ef('0x48')][_0x37ef('0xd8')]){_0x2ebb8d=_0x442214[_0x37ef('0x48')]['state'];return db['SmsMessage'][_0x37ef('0x5e')]({'where':{'messageId':_0x442214[_0x37ef('0x48')]['message-id']}});}break;}}})[_0x37ef('0x1e')](handleEntityNotFound(_0x40f9d0,null))[_0x37ef('0x1e')](function(_0x4d0ff0){if(_0x4d0ff0){_0x1f9a82=_0x4d0ff0;switch(_0x19aa75['type']){case _0x37ef('0xd9'):if(_0x2ebb8d==='2'||_0x2ebb8d==='6'){return _0x1f9a82[_0x37ef('0x32')]({'read':!![]});}else{logger[_0x37ef('0x23')](_0x37ef('0x21'),_0x37ef('0x2a'),_0x37ef('0xd9'),util[_0x37ef('0xd2')](_0x442214['query'],{'showHidden':![],'depth':null}));};break;}return _0x1f9a82;}})[_0x37ef('0x1e')](respondWithResult(_0x40f9d0,null))[_0x37ef('0x28')](handleError(_0x40f9d0,null));};exports[_0x37ef('0xda')]=function(_0xdbce0a,_0x5b8c1e,_0x1c5ba7){return db[_0x37ef('0x3c')]['find']({'where':{'id':_0xdbce0a[_0x37ef('0x56')]['id']}})[_0x37ef('0x1e')](handleEntityNotFound(_0x5b8c1e,null))[_0x37ef('0x1e')](function(_0x1e773d){if(_0x1e773d){return _0x1e773d[_0x37ef('0xda')](_0xdbce0a[_0x37ef('0x5a')][_0x37ef('0xdb')],_[_0x37ef('0x96')](_0xdbce0a['body'],[_0x37ef('0xdb'),'id'])||{})['spread'](function(_0x47dd2a){for(var _0x5d3ec2=0x0;_0x5d3ec2<_0xdbce0a[_0x37ef('0x5a')][_0x37ef('0xdb')][_0x37ef('0x47')];_0x5d3ec2+=0x1){socket['emit'](_0x37ef('0xdc'),{'UserId':Number(_0xdbce0a[_0x37ef('0x5a')][_0x37ef('0xdb')][_0x5d3ec2]),'SmsAccountId':Number(_0xdbce0a[_0x37ef('0x56')]['id'])});}return _0x47dd2a;});}})[_0x37ef('0x1e')](respondWithResult(_0x5b8c1e,null))[_0x37ef('0x28')](handleError(_0x5b8c1e,null));};exports[_0x37ef('0xdd')]=function(_0x30a994,_0x283ef4,_0xccad89){return db[_0x37ef('0x3c')][_0x37ef('0x5e')]({'where':{'id':_0x30a994[_0x37ef('0x56')]['id']}})['then'](handleEntityNotFound(_0x283ef4,null))[_0x37ef('0x1e')](function(_0x9ece20){if(_0x9ece20){return _0x9ece20[_0x37ef('0xdd')](_0x30a994['query'][_0x37ef('0xdb')])[_0x37ef('0x1e')](function(){if(_[_0x37ef('0xde')](_0x30a994[_0x37ef('0x48')][_0x37ef('0xdb')])){for(var _0x14306e=0x0;_0x14306e<_0x30a994[_0x37ef('0x48')][_0x37ef('0xdb')][_0x37ef('0x47')];_0x14306e+=0x1){socket[_0x37ef('0xdf')](_0x37ef('0xe0'),{'UserId':Number(_0x30a994['query']['ids'][_0x14306e]),'SmsAccountId':Number(_0x30a994[_0x37ef('0x56')]['id'])});}}else{socket[_0x37ef('0xdf')](_0x37ef('0xe0'),{'UserId':Number(_0x30a994[_0x37ef('0x48')][_0x37ef('0xdb')]),'SmsAccountId':Number(_0x30a994[_0x37ef('0x56')]['id'])});}});}})[_0x37ef('0x1e')](respondWithStatusCode(_0x283ef4,null))['catch'](handleError(_0x283ef4,null));};exports[_0x37ef('0xe1')]=function(_0x59621d,_0x42d5e1,_0x5233ae){var _0x29c84f={};var _0x27fb64={};var _0x5e7444;var _0x1274e1;return db[_0x37ef('0x3c')][_0x37ef('0x65')]({'where':{'id':_0x59621d[_0x37ef('0x56')]['id']}})['then'](handleEntityNotFound(_0x42d5e1,null))[_0x37ef('0x1e')](function(_0x213110){if(_0x213110){_0x5e7444=_0x213110;_0x27fb64[_0x37ef('0x40')]=_[_0x37ef('0x42')](db[_0x37ef('0xa5')][_0x37ef('0x3d')]);_0x27fb64['query']=_[_0x37ef('0x42')](_0x59621d[_0x37ef('0x48')]);_0x27fb64[_0x37ef('0x43')]=_[_0x37ef('0x44')](_0x27fb64['model'],_0x27fb64[_0x37ef('0x48')]);_0x29c84f['attributes']=_[_0x37ef('0x44')](_0x27fb64[_0x37ef('0x40')],qs[_0x37ef('0x45')](_0x59621d[_0x37ef('0x48')][_0x37ef('0x45')]));_0x29c84f[_0x37ef('0x46')]=_0x29c84f[_0x37ef('0x46')][_0x37ef('0x47')]?_0x29c84f[_0x37ef('0x46')]:_0x27fb64['model'];_0x29c84f['order']=qs['sort'](_0x59621d['query'][_0x37ef('0x4c')]);_0x29c84f[_0x37ef('0x4f')]=qs[_0x37ef('0x43')](_[_0x37ef('0x4d')](_0x59621d[_0x37ef('0x48')],_0x27fb64[_0x37ef('0x43')]));if(_0x59621d[_0x37ef('0x48')][_0x37ef('0x4e')]){_0x29c84f[_0x37ef('0x4f')]=_[_0x37ef('0x58')](_0x29c84f['where'],{'$or':_[_0x37ef('0x41')](_0x29c84f[_0x37ef('0x46')],function(_0x312532){var _0x45d111={};_0x45d111[_0x312532]={'$like':'%'+_0x59621d[_0x37ef('0x48')][_0x37ef('0x4e')]+'%'};return _0x45d111;})});}_0x29c84f=_[_0x37ef('0x58')]({},_0x29c84f,_0x59621d[_0x37ef('0x51')]);return _0x5e7444[_0x37ef('0xe1')](_0x29c84f);}})[_0x37ef('0x1e')](function(_0x55d528){if(_0x55d528){_0x1274e1=_0x55d528[_0x37ef('0x47')];if(!_0x59621d[_0x37ef('0x48')][_0x37ef('0x49')](_0x37ef('0x4a'))){_0x29c84f[_0x37ef('0x2d')]=qs['limit'](_0x59621d[_0x37ef('0x48')][_0x37ef('0x2d')]);_0x29c84f[_0x37ef('0x2b')]=qs[_0x37ef('0x2b')](_0x59621d[_0x37ef('0x48')][_0x37ef('0x2b')]);}return _0x5e7444[_0x37ef('0xe1')](_0x29c84f);}})['then'](function(_0x4b20ff){if(_0x4b20ff){return _0x4b20ff?{'count':_0x1274e1,'rows':_0x4b20ff}:null;}})['then'](respondWithResult(_0x42d5e1,null))['catch'](handleError(_0x42d5e1,null));}; \ No newline at end of file +var _0x6a87=['redif','inspect','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','message-id','state','addAgents','omit','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','destroy','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','rows','catch','show','params','mandatoryDispositionPause','includeAll','include','merge','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','Applications','account','applications','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','MessageSid','skebby','from','text','connectel','clicksend','message_id','plivo','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','Contacts','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','SmsMessage','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','json','addApplications','sequelize','transaction','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','CmList','List','user','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','statusInt','status_code','groupName','DELIVERED'];(function(_0x2136d5,_0x4b0479){var _0x3bee2e=function(_0x119e88){while(--_0x119e88){_0x2136d5['push'](_0x2136d5['shift']());}};_0x3bee2e(++_0x4b0479);}(_0x6a87,0xf2));var _0x76a8=function(_0x130cf6,_0xce9a1c){_0x130cf6=_0x130cf6-0x0;var _0xb80f78=_0x6a87[_0x130cf6];return _0xb80f78;};'use strict';var emlformat=require(_0x76a8('0x0'));var rimraf=require(_0x76a8('0x1'));var zipdir=require(_0x76a8('0x2'));var jsonpatch=require(_0x76a8('0x3'));var rp=require('request-promise');var moment=require(_0x76a8('0x4'));var BPromise=require(_0x76a8('0x5'));var Mustache=require(_0x76a8('0x6'));var util=require(_0x76a8('0x7'));var path=require(_0x76a8('0x8'));var sox=require(_0x76a8('0x9'));var csv=require(_0x76a8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76a8('0xb'));var squel=require(_0x76a8('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x76a8('0xa'));var querystring=require('querystring');var Papa=require(_0x76a8('0xd'));var Redis=require(_0x76a8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x76a8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76a8('0x10'));var logger=require(_0x76a8('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x76a8('0x12'));var db=require('../../mysqldb')['db'];config[_0x76a8('0x13')]=_['defaults'](config[_0x76a8('0x13')],{'host':_0x76a8('0x14'),'port':0x18eb});var socket=require(_0x76a8('0x15'))(new Redis(config[_0x76a8('0x13')]));require(_0x76a8('0x16'))[_0x76a8('0x17')](socket);var jayson=require(_0x76a8('0x18'));var client=jayson[_0x76a8('0x19')][_0x76a8('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x183853,_0x55293b,_0x3a4e45,_0x414682){return new BPromise(function(_0x4994cb,_0x5da782){var _0x54278f=_0x414682||client;return _0x54278f[_0x76a8('0x1b')](_0x183853,_0x3a4e45)[_0x76a8('0x1c')](function(_0x9df3da){logger[_0x76a8('0x1d')](_0x76a8('0x1e'),_0x55293b,_0x76a8('0x1f'));logger[_0x76a8('0x20')](_0x76a8('0x21'),_0x55293b,_0x76a8('0x1f'),JSON['stringify'](_0x9df3da));if(_0x9df3da[_0x76a8('0x22')]){if(_0x9df3da[_0x76a8('0x22')][_0x76a8('0x23')]===0x1f4){logger['error'](_0x76a8('0x1e'),_0x55293b,_0x9df3da[_0x76a8('0x22')][_0x76a8('0x24')]);return _0x5da782(_0x9df3da['error']['message']);}logger[_0x76a8('0x22')]('SmsAccount,\x20%s,\x20%s',_0x55293b,_0x9df3da[_0x76a8('0x22')][_0x76a8('0x24')]);return _0x4994cb(_0x9df3da[_0x76a8('0x22')][_0x76a8('0x24')]);}else{logger[_0x76a8('0x1d')](_0x76a8('0x1e'),_0x55293b,_0x76a8('0x1f'));_0x4994cb(_0x9df3da[_0x76a8('0x25')][_0x76a8('0x24')]);}})['catch'](function(_0x16ed82){logger[_0x76a8('0x22')]('SmsAccount,\x20%s,\x20%s',_0x55293b,_0x16ed82);_0x5da782(_0x16ed82);});});}function respondWithStatusCode(_0x20ee23,_0x5bb254){_0x5bb254=_0x5bb254||0xcc;return function(_0x445e30){if(_0x445e30){return _0x20ee23[_0x76a8('0x26')](_0x5bb254);}return _0x20ee23[_0x76a8('0x27')](_0x5bb254)[_0x76a8('0x28')]();};}function respondWithResult(_0x19e138,_0x1f8fe5){_0x1f8fe5=_0x1f8fe5||0xc8;return function(_0x2027cc){if(_0x2027cc){return _0x19e138[_0x76a8('0x27')](_0x1f8fe5)['json'](_0x2027cc);}};}function respondWithFilteredResult(_0xdd2a3,_0x38758c){return function(_0x4ce123){if(_0x4ce123){var _0x1dd5c1=typeof _0x38758c[_0x76a8('0x29')]===_0x76a8('0x2a')&&typeof _0x38758c[_0x76a8('0x2b')]===_0x76a8('0x2a');var _0x54b37f=_0x4ce123[_0x76a8('0x2c')];var _0x118749=_0x1dd5c1?0x0:_0x38758c[_0x76a8('0x29')];var _0x225052=_0x1dd5c1?_0x4ce123[_0x76a8('0x2c')]:_0x38758c[_0x76a8('0x29')]+_0x38758c[_0x76a8('0x2b')];var _0x4448df;if(_0x225052>=_0x54b37f){_0x225052=_0x54b37f;_0x4448df=0xc8;}else{_0x4448df=0xce;}_0xdd2a3[_0x76a8('0x27')](_0x4448df);return _0xdd2a3[_0x76a8('0x2d')]('Content-Range',_0x118749+'-'+_0x225052+'/'+_0x54b37f)['json'](_0x4ce123);}return null;};}function patchUpdates(_0x56a104){return function(_0x1fb4da){try{jsonpatch[_0x76a8('0x2e')](_0x1fb4da,_0x56a104,!![]);}catch(_0x447f03){return BPromise[_0x76a8('0x2f')](_0x447f03);}return _0x1fb4da[_0x76a8('0x30')]();};}function saveUpdates(_0x35b14a,_0x2b491d){return function(_0xbfec2f){if(_0xbfec2f){return _0xbfec2f[_0x76a8('0x31')](_0x35b14a)[_0x76a8('0x1c')](function(_0x1fc057){return _0x1fc057;});}return null;};}function removeEntity(_0x1c63cf,_0x5c135c){return function(_0x548ffb){if(_0x548ffb){return _0x548ffb[_0x76a8('0x32')]()[_0x76a8('0x1c')](function(){var _0x205424=_0x548ffb['get']({'plain':!![]});var _0x2dcc35=_0x76a8('0x33');return db[_0x76a8('0x34')][_0x76a8('0x32')]({'where':{'type':_0x2dcc35,'resourceId':_0x205424['id']}})[_0x76a8('0x1c')](function(){return _0x548ffb;});})['then'](function(){_0x1c63cf[_0x76a8('0x27')](0xcc)[_0x76a8('0x28')]();});}};}function handleEntityNotFound(_0x4a748e,_0x252074){return function(_0x2d30c9){if(!_0x2d30c9){_0x4a748e['sendStatus'](0x194);}return _0x2d30c9;};}function handleError(_0x11a6c6,_0x4b28e8){_0x4b28e8=_0x4b28e8||0x1f4;return function(_0x35a8f5){logger['error'](_0x35a8f5[_0x76a8('0x35')]);if(_0x35a8f5[_0x76a8('0x36')]){delete _0x35a8f5[_0x76a8('0x36')];}_0x11a6c6[_0x76a8('0x27')](_0x4b28e8)[_0x76a8('0x37')](_0x35a8f5);};}exports[_0x76a8('0x38')]=function(_0x3b34ce,_0x4d3102){var _0x3451ff={'include':[{'model':db[_0x76a8('0x39')],'as':'mandatoryDispositionPause'}]},_0x23c37d={},_0x30b85f={'count':0x0,'rows':[]};var _0x3659de=_[_0x76a8('0x3a')](db[_0x76a8('0x3b')][_0x76a8('0x3c')],function(_0x2d1af4){return{'name':_0x2d1af4[_0x76a8('0x3d')],'type':_0x2d1af4[_0x76a8('0x3e')][_0x76a8('0x3f')]};});_0x23c37d[_0x76a8('0x40')]=_[_0x76a8('0x3a')](_0x3659de,_0x76a8('0x36'));_0x23c37d[_0x76a8('0x41')]=_[_0x76a8('0x42')](_0x3b34ce[_0x76a8('0x41')]);_0x23c37d[_0x76a8('0x43')]=_[_0x76a8('0x44')](_0x23c37d['model'],_0x23c37d['query']);_0x3451ff[_0x76a8('0x45')]=_[_0x76a8('0x44')](_0x23c37d[_0x76a8('0x40')],qs[_0x76a8('0x46')](_0x3b34ce[_0x76a8('0x41')][_0x76a8('0x46')]));_0x3451ff[_0x76a8('0x45')]=_0x3451ff[_0x76a8('0x45')][_0x76a8('0x47')]?_0x3451ff[_0x76a8('0x45')]:_0x23c37d[_0x76a8('0x40')];if(!_0x3b34ce[_0x76a8('0x41')][_0x76a8('0x48')](_0x76a8('0x49'))){_0x3451ff[_0x76a8('0x2b')]=qs[_0x76a8('0x2b')](_0x3b34ce[_0x76a8('0x41')][_0x76a8('0x2b')]);_0x3451ff[_0x76a8('0x29')]=qs[_0x76a8('0x29')](_0x3b34ce[_0x76a8('0x41')][_0x76a8('0x29')]);}_0x3451ff[_0x76a8('0x4a')]=qs['sort'](_0x3b34ce[_0x76a8('0x41')][_0x76a8('0x4b')]);_0x3451ff[_0x76a8('0x4c')]=qs[_0x76a8('0x43')](_[_0x76a8('0x4d')](_0x3b34ce[_0x76a8('0x41')],_0x23c37d[_0x76a8('0x43')]),_0x3659de);if(_0x3b34ce[_0x76a8('0x41')][_0x76a8('0x4e')]){_0x3451ff[_0x76a8('0x4c')]=_['merge'](_0x3451ff['where'],{'$or':_[_0x76a8('0x3a')](_0x3659de,function(_0x2706a4){if(_0x2706a4[_0x76a8('0x3e')]!=='VIRTUAL'){var _0x2a5e21={};_0x2a5e21[_0x2706a4['name']]={'$like':'%'+_0x3b34ce[_0x76a8('0x41')][_0x76a8('0x4e')]+'%'};return _0x2a5e21;}})});}_0x3451ff=_['merge']({},_0x3451ff,_0x3b34ce[_0x76a8('0x4f')]);var _0x5c7487={'where':_0x3451ff[_0x76a8('0x4c')]};return db['SmsAccount'][_0x76a8('0x2c')](_0x5c7487)[_0x76a8('0x1c')](function(_0x4efa0d){_0x30b85f[_0x76a8('0x2c')]=_0x4efa0d;if(_0x3b34ce[_0x76a8('0x41')]['includeAll']){_0x3451ff['include']=[{'all':!![]}];}return db[_0x76a8('0x3b')]['findAll'](_0x3451ff);})[_0x76a8('0x1c')](function(_0x45e5dd){_0x30b85f[_0x76a8('0x50')]=_0x45e5dd;return _0x30b85f;})[_0x76a8('0x1c')](respondWithFilteredResult(_0x4d3102,_0x3451ff))[_0x76a8('0x51')](handleError(_0x4d3102,null));};exports[_0x76a8('0x52')]=function(_0x39ce56,_0x36429a){var _0x358716={'raw':![],'where':{'id':_0x39ce56[_0x76a8('0x53')]['id']},'include':[{'model':db[_0x76a8('0x39')],'as':_0x76a8('0x54')}]},_0x457f1b={};_0x457f1b[_0x76a8('0x40')]=_[_0x76a8('0x42')](db['SmsAccount'][_0x76a8('0x3c')]);_0x457f1b['query']=_['keys'](_0x39ce56['query']);_0x457f1b[_0x76a8('0x43')]=_[_0x76a8('0x44')](_0x457f1b['model'],_0x457f1b[_0x76a8('0x41')]);_0x358716['attributes']=_[_0x76a8('0x44')](_0x457f1b['model'],qs[_0x76a8('0x46')](_0x39ce56[_0x76a8('0x41')][_0x76a8('0x46')]));_0x358716['attributes']=_0x358716[_0x76a8('0x45')][_0x76a8('0x47')]?_0x358716[_0x76a8('0x45')]:_0x457f1b['model'];if(_0x39ce56['query'][_0x76a8('0x55')]){_0x358716[_0x76a8('0x56')]=[{'all':!![]}];}_0x358716=_[_0x76a8('0x57')]({},_0x358716,_0x39ce56[_0x76a8('0x4f')]);return db['SmsAccount'][_0x76a8('0x58')](_0x358716)[_0x76a8('0x1c')](handleEntityNotFound(_0x36429a,null))['then'](respondWithResult(_0x36429a,null))['catch'](handleError(_0x36429a,null));};exports['create']=function(_0x500fbd,_0x31464a){return db[_0x76a8('0x3b')]['create'](_0x500fbd[_0x76a8('0x59')],{})[_0x76a8('0x1c')](function(_0x2aa9c6){var _0x10985e=_0x500fbd['user'][_0x76a8('0x5a')]({'plain':!![]});if(!_0x10985e)throw new Error(_0x76a8('0x5b'));if(_0x10985e[_0x76a8('0x5c')]==='user'){var _0xb35529=_0x2aa9c6[_0x76a8('0x5a')]({'plain':!![]});var _0x399839=_0x76a8('0x33');return db['UserProfileSection'][_0x76a8('0x58')]({'where':{'name':_0x399839,'userProfileId':_0x10985e[_0x76a8('0x5d')]},'raw':!![]})[_0x76a8('0x1c')](function(_0x219f71){if(_0x219f71&&_0x219f71[_0x76a8('0x5e')]===0x0){return db['UserProfileResource'][_0x76a8('0x5f')]({'name':_0xb35529[_0x76a8('0x36')],'resourceId':_0xb35529['id'],'type':_0x219f71[_0x76a8('0x36')],'sectionId':_0x219f71['id']},{})[_0x76a8('0x1c')](function(){return _0x2aa9c6;});}else{return _0x2aa9c6;}})[_0x76a8('0x51')](function(_0x2ac382){logger['error'](_0x76a8('0x60'),_0x2ac382);throw _0x2ac382;});}return _0x2aa9c6;})[_0x76a8('0x1c')](respondWithResult(_0x31464a,0xc9))[_0x76a8('0x51')](handleError(_0x31464a,null));};exports[_0x76a8('0x31')]=function(_0x5c6b00,_0x4ed890){if(_0x5c6b00[_0x76a8('0x59')]['id']){delete _0x5c6b00[_0x76a8('0x59')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x5c6b00['params']['id']},'include':[{'model':db[_0x76a8('0x39')],'as':_0x76a8('0x54')}]})[_0x76a8('0x1c')](handleEntityNotFound(_0x4ed890,null))[_0x76a8('0x1c')](saveUpdates(_0x5c6b00[_0x76a8('0x59')],null))['then'](respondWithResult(_0x4ed890,null))[_0x76a8('0x51')](handleError(_0x4ed890,null));};exports['destroy']=function(_0x1ad991,_0x3dfe69){return db[_0x76a8('0x3b')][_0x76a8('0x58')]({'where':{'id':_0x1ad991[_0x76a8('0x53')]['id']}})['then'](handleEntityNotFound(_0x3dfe69,null))['then'](removeEntity(_0x3dfe69,null))[_0x76a8('0x51')](handleError(_0x3dfe69,null));};exports[_0x76a8('0x61')]=function(_0x204f57,_0x298544){return db[_0x76a8('0x3b')][_0x76a8('0x61')]()['then'](respondWithResult(_0x298544,null))[_0x76a8('0x51')](handleError(_0x298544,null));};exports[_0x76a8('0x62')]=function(_0x46efb1,_0x446f3c,_0x5d113d){if(_0x46efb1[_0x76a8('0x59')]['id']){delete _0x46efb1['body']['id'];}return db[_0x76a8('0x3b')][_0x76a8('0x58')]({'where':{'id':_0x46efb1[_0x76a8('0x53')]['id']}})[_0x76a8('0x1c')](handleEntityNotFound(_0x446f3c,null))[_0x76a8('0x1c')](function(_0x2e1724){if(_0x2e1724){_0x46efb1['body'][_0x76a8('0x63')]=_0x2e1724['id'];return db[_0x76a8('0x64')][_0x76a8('0x5f')](_0x46efb1['body']);}})['then'](respondWithResult(_0x446f3c,null))[_0x76a8('0x51')](handleError(_0x446f3c,null));};exports[_0x76a8('0x65')]=function(_0x1ab009,_0xfa6b87,_0x2e1157){var _0x183696={'raw':![],'where':{}};var _0x5807d0={};var _0x26d5e7={'count':0x0,'rows':[]};return db[_0x76a8('0x3b')][_0x76a8('0x66')]({'where':{'id':_0x1ab009[_0x76a8('0x53')]['id']}})[_0x76a8('0x1c')](handleEntityNotFound(_0xfa6b87,null))[_0x76a8('0x1c')](function(_0xfc2347){if(_0xfc2347){_0x5807d0[_0x76a8('0x40')]=_[_0x76a8('0x42')](db[_0x76a8('0x64')][_0x76a8('0x3c')]);_0x5807d0[_0x76a8('0x41')]=_[_0x76a8('0x42')](_0x1ab009[_0x76a8('0x41')]);_0x5807d0[_0x76a8('0x43')]=_[_0x76a8('0x44')](_0x5807d0[_0x76a8('0x40')],_0x5807d0[_0x76a8('0x41')]);_0x183696['attributes']=_[_0x76a8('0x44')](_0x5807d0[_0x76a8('0x40')],qs['fields'](_0x1ab009[_0x76a8('0x41')][_0x76a8('0x46')]));_0x183696[_0x76a8('0x45')]=_0x183696[_0x76a8('0x45')][_0x76a8('0x47')]?_0x183696[_0x76a8('0x45')]:_0x5807d0[_0x76a8('0x40')];if(!_0x1ab009[_0x76a8('0x41')][_0x76a8('0x48')](_0x76a8('0x49'))){_0x183696[_0x76a8('0x2b')]=qs[_0x76a8('0x2b')](_0x1ab009[_0x76a8('0x41')][_0x76a8('0x2b')]);_0x183696[_0x76a8('0x29')]=qs[_0x76a8('0x29')](_0x1ab009[_0x76a8('0x41')][_0x76a8('0x29')]);}_0x183696[_0x76a8('0x4a')]=qs[_0x76a8('0x4b')](_0x1ab009[_0x76a8('0x41')][_0x76a8('0x4b')]);_0x183696[_0x76a8('0x4c')]=qs['filters'](_[_0x76a8('0x4d')](_0x1ab009[_0x76a8('0x41')],_0x5807d0[_0x76a8('0x43')]));_0x183696[_0x76a8('0x4c')][_0x76a8('0x63')]=_0xfc2347['id'];if(_0x1ab009[_0x76a8('0x41')][_0x76a8('0x4e')]){_0x183696[_0x76a8('0x4c')]=_['merge'](_0x183696[_0x76a8('0x4c')],{'$or':_['map'](_0x183696[_0x76a8('0x45')],function(_0x387d70){var _0x17195a={};_0x17195a[_0x387d70]={'$like':'%'+_0x1ab009[_0x76a8('0x41')]['filter']+'%'};return _0x17195a;})});}_0x183696=_[_0x76a8('0x57')]({},_0x183696,_0x1ab009['options']);return db[_0x76a8('0x64')][_0x76a8('0x2c')]({'where':_0x183696['where']})['then'](function(_0x5824d1){_0x26d5e7[_0x76a8('0x2c')]=_0x5824d1;if(_0x1ab009[_0x76a8('0x41')][_0x76a8('0x55')]){_0x183696[_0x76a8('0x56')]=[{'all':!![]}];}return db[_0x76a8('0x64')][_0x76a8('0x67')](_0x183696);})[_0x76a8('0x1c')](function(_0x4826f1){_0x26d5e7[_0x76a8('0x50')]=_0x4826f1;return _0x26d5e7;});}})['then'](respondWithFilteredResult(_0xfa6b87,_0x183696))['catch'](handleError(_0xfa6b87,null));};exports[_0x76a8('0x68')]=function(_0x5ad154,_0x4d6012,_0x4f4c65){return db[_0x76a8('0x3b')][_0x76a8('0x58')]({'where':{'id':_0x5ad154[_0x76a8('0x53')]['id']}})[_0x76a8('0x1c')](handleEntityNotFound(_0x4d6012,null))[_0x76a8('0x1c')](function(_0x28f8a9){if(_0x28f8a9){return _0x28f8a9['removeDispositions'](_0x5ad154[_0x76a8('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x4d6012,null))['catch'](handleError(_0x4d6012,null));};exports[_0x76a8('0x69')]=function(_0x4dab8a,_0x5eea56,_0x3f23f6){if(_0x4dab8a['body']['id']){delete _0x4dab8a[_0x76a8('0x59')]['id'];}return db[_0x76a8('0x3b')][_0x76a8('0x58')]({'where':{'id':_0x4dab8a[_0x76a8('0x53')]['id']}})[_0x76a8('0x1c')](handleEntityNotFound(_0x5eea56,null))['then'](function(_0x30cd92){if(_0x30cd92){_0x4dab8a['body'][_0x76a8('0x63')]=_0x30cd92['id'];return db[_0x76a8('0x6a')][_0x76a8('0x5f')](_0x4dab8a[_0x76a8('0x59')]);}})[_0x76a8('0x1c')](respondWithResult(_0x5eea56,null))['catch'](handleError(_0x5eea56,null));};exports[_0x76a8('0x6b')]=function(_0xe6480d,_0x231004,_0x36f110){var _0x153b68={'raw':![],'where':{}};var _0x3c7974={};var _0x5747bd={'count':0x0,'rows':[]};return db[_0x76a8('0x3b')]['findOne']({'where':{'id':_0xe6480d['params']['id']}})[_0x76a8('0x1c')](handleEntityNotFound(_0x231004,null))['then'](function(_0x1c2336){if(_0x1c2336){_0x3c7974[_0x76a8('0x40')]=_[_0x76a8('0x42')](db[_0x76a8('0x6a')][_0x76a8('0x3c')]);_0x3c7974[_0x76a8('0x41')]=_[_0x76a8('0x42')](_0xe6480d[_0x76a8('0x41')]);_0x3c7974[_0x76a8('0x43')]=_[_0x76a8('0x44')](_0x3c7974[_0x76a8('0x40')],_0x3c7974[_0x76a8('0x41')]);_0x153b68[_0x76a8('0x45')]=_[_0x76a8('0x44')](_0x3c7974[_0x76a8('0x40')],qs[_0x76a8('0x46')](_0xe6480d[_0x76a8('0x41')][_0x76a8('0x46')]));_0x153b68['attributes']=_0x153b68[_0x76a8('0x45')][_0x76a8('0x47')]?_0x153b68[_0x76a8('0x45')]:_0x3c7974[_0x76a8('0x40')];if(!_0xe6480d[_0x76a8('0x41')][_0x76a8('0x48')](_0x76a8('0x49'))){_0x153b68[_0x76a8('0x2b')]=qs[_0x76a8('0x2b')](_0xe6480d[_0x76a8('0x41')][_0x76a8('0x2b')]);_0x153b68[_0x76a8('0x29')]=qs['offset'](_0xe6480d[_0x76a8('0x41')]['offset']);}_0x153b68[_0x76a8('0x4a')]=qs['sort'](_0xe6480d['query'][_0x76a8('0x4b')]);_0x153b68[_0x76a8('0x4c')]=qs[_0x76a8('0x43')](_[_0x76a8('0x4d')](_0xe6480d[_0x76a8('0x41')],_0x3c7974[_0x76a8('0x43')]));_0x153b68[_0x76a8('0x4c')][_0x76a8('0x63')]=_0x1c2336['id'];if(_0xe6480d['query'][_0x76a8('0x4e')]){_0x153b68[_0x76a8('0x4c')]=_[_0x76a8('0x57')](_0x153b68[_0x76a8('0x4c')],{'$or':_[_0x76a8('0x3a')](_0x153b68[_0x76a8('0x45')],function(_0x43ac25){var _0x562def={};_0x562def[_0x43ac25]={'$like':'%'+_0xe6480d[_0x76a8('0x41')]['filter']+'%'};return _0x562def;})});}_0x153b68=_['merge']({},_0x153b68,_0xe6480d[_0x76a8('0x4f')]);return db[_0x76a8('0x6a')][_0x76a8('0x2c')]({'where':_0x153b68[_0x76a8('0x4c')]})[_0x76a8('0x1c')](function(_0x47a84c){_0x5747bd[_0x76a8('0x2c')]=_0x47a84c;if(_0xe6480d[_0x76a8('0x41')][_0x76a8('0x55')]){_0x153b68[_0x76a8('0x56')]=[{'all':!![]}];}return db[_0x76a8('0x6a')][_0x76a8('0x67')](_0x153b68);})[_0x76a8('0x1c')](function(_0x27b670){_0x5747bd[_0x76a8('0x50')]=_0x27b670;return _0x5747bd;});}})['then'](respondWithFilteredResult(_0x231004,_0x153b68))['catch'](handleError(_0x231004,null));};exports[_0x76a8('0x6c')]=function(_0x3455b1,_0x58e2d7,_0x21edc0){return db[_0x76a8('0x3b')][_0x76a8('0x58')]({'where':{'id':_0x3455b1[_0x76a8('0x53')]['id']}})['then'](handleEntityNotFound(_0x58e2d7,null))[_0x76a8('0x1c')](function(_0x122530){if(_0x122530){return _0x122530[_0x76a8('0x6c')](_0x3455b1[_0x76a8('0x41')][_0x76a8('0x6d')]);}})['then'](respondWithStatusCode(_0x58e2d7,null))['catch'](handleError(_0x58e2d7,null));};exports[_0x76a8('0x6e')]=function(_0x306d7d,_0x3598ad,_0x3c6959){var _0xff716e={'channel':_0x76a8('0x6f')};var _0x4af33d=[];var _0x55bfba=[];var _0x383bb9={};return db['SmsAccount'][_0x76a8('0x58')]({'where':{'id':_0x306d7d['params']['id']},'include':[{'model':db['SmsApplication'],'as':_0x76a8('0x70')}]})[_0x76a8('0x1c')](handleEntityNotFound(_0x3598ad,null))['then'](function(_0x32cde1){_0xff716e[_0x76a8('0x71')]=_0x32cde1;_0xff716e[_0x76a8('0x72')]=_[_0x76a8('0x73')](_0x32cde1[_0x76a8('0x70')],['priority'],[_0x76a8('0x74')]);if(_0xff716e[_0x76a8('0x71')][_0x76a8('0x70')]){delete _0xff716e[_0x76a8('0x71')][_0x76a8('0x70')];}return db[_0x76a8('0x75')][_0x76a8('0x61')]();})['then'](function(_0x2caabc){if(!_0x2caabc){throw new db[(_0x76a8('0x76'))]['ValidationError'](_0x76a8('0x77'));}_0x4af33d=_[_0x76a8('0x78')](_['keys'](_0x2caabc),[_0x76a8('0x79'),_0x76a8('0x7a')]);_0x55bfba=_['difference'](_[_0x76a8('0x42')](_0x2caabc),[_0x76a8('0x79'),_0x76a8('0x7a'),_0x76a8('0x7b'),_0x76a8('0x7c')]);_0xff716e['body']={'mapKey':_0x76a8('0x7d')};if(_0xff716e[_0x76a8('0x71')][_0x76a8('0x3e')]){switch(_0xff716e[_0x76a8('0x71')][_0x76a8('0x3e')]){case _0x76a8('0x7e'):_0xff716e['body']['from']=_0x306d7d['body'][_0x76a8('0x7f')];_0xff716e[_0x76a8('0x59')][_0x76a8('0x59')]=_0x306d7d[_0x76a8('0x59')][_0x76a8('0x80')];_0xff716e[_0x76a8('0x59')][_0x76a8('0x81')]=_0x306d7d['body'][_0x76a8('0x82')];break;case _0x76a8('0x83'):_0xff716e['body'][_0x76a8('0x84')]='+'+_0x306d7d[_0x76a8('0x59')]['sender'];_0xff716e[_0x76a8('0x59')][_0x76a8('0x59')]=_0x306d7d[_0x76a8('0x59')][_0x76a8('0x85')];break;case _0x76a8('0x86'):_0xff716e[_0x76a8('0x59')][_0x76a8('0x84')]=_0x306d7d[_0x76a8('0x59')][_0x76a8('0x84')];_0xff716e[_0x76a8('0x59')]['body']=_0x306d7d['body'][_0x76a8('0x24')];break;case _0x76a8('0x87'):_0xff716e[_0x76a8('0x59')][_0x76a8('0x84')]=_0x306d7d[_0x76a8('0x59')][_0x76a8('0x84')];_0xff716e[_0x76a8('0x59')]['body']=_0x306d7d['body'][_0x76a8('0x59')];_0xff716e['body'][_0x76a8('0x81')]=_0x306d7d[_0x76a8('0x59')][_0x76a8('0x88')];break;case _0x76a8('0x89'):_0xff716e[_0x76a8('0x59')]['from']=_0x306d7d[_0x76a8('0x59')][_0x76a8('0x7f')];_0xff716e[_0x76a8('0x59')][_0x76a8('0x59')]=_0x306d7d[_0x76a8('0x59')]['Text'];_0xff716e[_0x76a8('0x59')][_0x76a8('0x81')]=_0x306d7d[_0x76a8('0x59')]['MessageUUID'];break;case _0x76a8('0x8a'):_0xff716e[_0x76a8('0x59')]['from']='+'+_0x306d7d[_0x76a8('0x59')][_0x76a8('0x8b')][0x0][_0x76a8('0x84')];_0xff716e[_0x76a8('0x59')][_0x76a8('0x59')]=_0x306d7d[_0x76a8('0x59')]['results'][0x0][_0x76a8('0x85')];_0xff716e[_0x76a8('0x59')][_0x76a8('0x81')]=_0x306d7d[_0x76a8('0x59')]['results'][0x0][_0x76a8('0x81')];break;case _0x76a8('0x8c'):_0xff716e['body'][_0x76a8('0x84')]=_0x306d7d[_0x76a8('0x59')][_0x76a8('0x8d')];_0xff716e['body'][_0x76a8('0x59')]=_0x306d7d['body'][_0x76a8('0x8e')][_0x76a8('0x24')];break;case _0x76a8('0x8f'):_0xff716e[_0x76a8('0x59')][_0x76a8('0x84')]=_0x306d7d[_0x76a8('0x59')][_0x76a8('0x90')];_0xff716e[_0x76a8('0x59')][_0x76a8('0x59')]=_0x306d7d[_0x76a8('0x59')][_0x76a8('0x85')];_0xff716e[_0x76a8('0x59')][_0x76a8('0x81')]=_0x306d7d[_0x76a8('0x59')][_0x76a8('0x91')];break;case _0x76a8('0x92'):_0xff716e[_0x76a8('0x59')][_0x76a8('0x81')]=_0x306d7d['body'][0x0]['message']['id'];_0xff716e[_0x76a8('0x59')][_0x76a8('0x84')]=_0x306d7d['body'][0x0][_0x76a8('0x24')][_0x76a8('0x84')];_0xff716e[_0x76a8('0x59')][_0x76a8('0x59')]=_0x306d7d['body'][0x0][_0x76a8('0x24')][_0x76a8('0x85')];break;case _0x76a8('0x93'):_0xff716e[_0x76a8('0x59')][_0x76a8('0x84')]=_0x306d7d[_0x76a8('0x59')]['from'];_0xff716e[_0x76a8('0x59')]['body']=_0x306d7d['body']['message'];_0xff716e[_0x76a8('0x59')]['messageId']=_0x306d7d['body']['refid'];break;}}if(_0xff716e[_0x76a8('0x59')]['id']){delete _0xff716e[_0x76a8('0x59')]['id'];}if(_[_0x76a8('0x94')](_0xff716e[_0x76a8('0x59')][_0x76a8('0x84')])){throw new db[(_0x76a8('0x76'))][(_0x76a8('0x95'))](_0x76a8('0x96'));}if(_[_0x76a8('0x94')](_0xff716e['body'][_0x76a8('0x59')])||_0xff716e[_0x76a8('0x59')][_0x76a8('0x59')]===''){throw new db[(_0x76a8('0x76'))][(_0x76a8('0x95'))](_0x76a8('0x97'));}if(_[_0x76a8('0x94')](_0xff716e[_0x76a8('0x59')][_0x76a8('0x98')])){throw new db[(_0x76a8('0x76'))][(_0x76a8('0x95'))](_0x76a8('0x99')+_0x55bfba);}if(!_['includes'](_0x55bfba,_0xff716e[_0x76a8('0x59')][_0x76a8('0x98')])){throw new db[(_0x76a8('0x76'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x55bfba);}_0x383bb9[_0xff716e[_0x76a8('0x59')]['mapKey']]=_0xff716e[_0x76a8('0x59')][_0x76a8('0x84')];return db['CmList'][_0x76a8('0x58')]({'where':{'id':_0xff716e[_0x76a8('0x71')][_0x76a8('0x7c')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x383bb9,'limit':0x1,'order':[['updatedAt',_0x76a8('0x9a')]]}]});})['then'](handleEntityNotFound(_0x3598ad,null))['then'](function(_0x201f71){if(_0x201f71){_0xff716e['list']=_['omit'](_0x201f71,[_0x76a8('0x9b')]);if(_0x201f71['Contacts']['length']){return _0x201f71['Contacts'][0x0];}var _0x1366b4=_[_0x76a8('0x9c')](_0xff716e['body'],{'firstName':_0xff716e['body'][_0x76a8('0x84')],'ListId':_0x201f71['id']});_0x1366b4[_0xff716e[_0x76a8('0x59')]['mapKey']]=_0xff716e[_0x76a8('0x59')][_0x76a8('0x84')];return db[_0x76a8('0x75')][_0x76a8('0x5f')](_0x1366b4,{'fields':_0x4af33d,'raw':!![]});}})[_0x76a8('0x1c')](handleEntityNotFound(_0x3598ad,null))[_0x76a8('0x1c')](function(_0x4b4383){if(_0x4b4383){_0xff716e[_0x76a8('0x9d')]=_0x4b4383;var _0x53438e={'ContactId':_0x4b4383['id'],'phone':_0xff716e[_0x76a8('0x59')][_0x76a8('0x84')],'SmsAccountId':_0x306d7d[_0x76a8('0x53')]['id']};var _0x2b8e29={'ContactId':_0x4b4383['id'],'SmsAccountId':_0x306d7d[_0x76a8('0x53')]['id'],'closed':![]};return db[_0x76a8('0x9e')]['find']({'where':_0x2b8e29})[_0x76a8('0x1c')](function(_0x2de233){if(_0x2de233){return[_0x2de233,![]];}return db['SmsInteraction']['create'](_0x53438e)[_0x76a8('0x1c')](function(_0xe37e37){return[_0xe37e37,!![]];});});}})[_0x76a8('0x9f')](function(_0x5294a7,_0x4ec052){_0xff716e[_0x76a8('0xa0')]=_0x5294a7[_0x76a8('0x5a')]({'plain':!![]});_0xff716e[_0x76a8('0xa0')][_0x76a8('0xa1')]=![];if(_0x4ec052){if(_0xff716e[_0x76a8('0x71')][_0x76a8('0xa2')]){_0xff716e[_0x76a8('0x72')][_0x76a8('0xa3')]({'id':0x0,'priority':_0xff716e['applications'][_0x76a8('0x47')]+0x1,'app':_0x76a8('0xa4'),'appdata':_0x76a8('0xa5'),'interval':'*,*,*,*'});}_0xff716e[_0x76a8('0xa0')][_0x76a8('0xa1')]=!![];}return db[_0x76a8('0xa6')][_0x76a8('0x5f')]({'phone':_0xff716e[_0x76a8('0x59')][_0x76a8('0x84')],'messageId':_0xff716e[_0x76a8('0x59')][_0x76a8('0x81')],'body':_0xff716e[_0x76a8('0x59')]['body'],'SmsAccountId':_0x306d7d[_0x76a8('0x53')]['id'],'SmsInteractionId':_0x5294a7['id'],'direction':'in','ContactId':_0x5294a7[_0x76a8('0xa7')],'AttachmentId':_0xff716e['body']['AttachmentId']});})[_0x76a8('0x1c')](function(_0x2b8875){_0xff716e[_0x76a8('0x24')]=_0x2b8875;if(_0xff716e['interaction'][_0x76a8('0xa8')]){return db[_0x76a8('0xa9')]['find']({'attributes':['id',_0x76a8('0x36')],'where':{'id':_0xff716e[_0x76a8('0xa0')][_0x76a8('0xa8')]}})['then'](function(_0x53466c){if(_0x53466c){_0xff716e[_0x76a8('0x72')][_0x76a8('0xaa')]({'id':0x0,'priority':0x0,'app':_0x76a8('0xab'),'appdata':_0x53466c[_0x76a8('0x36')]+','+(_0xff716e[_0x76a8('0x71')][_0x76a8('0xac')]||0xa),'interval':_0x76a8('0xad')});}return respondWithRpcPromise(_0x76a8('0xae'),_0x76a8('0xaf'),_0xff716e);});}return respondWithRpcPromise(_0x76a8('0xae'),'startRouting',_0xff716e);})[_0x76a8('0x1c')](function(_0x1a5153){if(_0x1a5153){var _0x37778e=0xc8;var _0x8e2ecf=_0x76a8('0xb0');logger[_0x76a8('0x1d')](_0x76a8('0x21'),_0x8e2ecf,_0x37778e,_0x76a8('0xb1'));logger[_0x76a8('0x20')](_0x76a8('0xb2'),_0x8e2ecf,_0x37778e,'entity\x20found',JSON['stringify'](_0x1a5153));if(_0xff716e[_0x76a8('0x71')][_0x76a8('0x3e')]==='twilio'){return _0x3598ad[_0x76a8('0x27')](_0x37778e)[_0x76a8('0x2d')](_0x76a8('0xb3'),_0x76a8('0xb4'))[_0x76a8('0x37')]('\x0a');}else{return _0x3598ad[_0x76a8('0x27')](_0x37778e)[_0x76a8('0xb5')](_0x1a5153);}}})[_0x76a8('0x51')](handleError(_0x3598ad,null));};exports[_0x76a8('0xb6')]=function(_0x2c9a24,_0x550a19){var _0xec51b4=_0x2c9a24[_0x76a8('0x53')]['id'];var _0x116e6f=_0x2c9a24[_0x76a8('0x59')];var _0x12f847=0xc8;var _0x451b36=null;return db[_0x76a8('0xb7')][_0x76a8('0xb8')]({'isolationLevel':db[_0x76a8('0xb7')]['Transaction']['ISOLATION_LEVELS'][_0x76a8('0xb9')]},function(_0x1138fd){return db['SmsAccount']['findOne']({'where':{'id':_0xec51b4},'transaction':_0x1138fd})[_0x76a8('0x1c')](function(_0x44def1){if(_0x44def1){return db[_0x76a8('0xba')][_0x76a8('0x32')]({'where':{'SmsAccountId':_0xec51b4},'transaction':_0x1138fd})[_0x76a8('0x1c')](function(){var _0xbbcb84=_['map'](_0x116e6f,function(_0x5b6ad4){_0x5b6ad4[_0x76a8('0x63')]=_0xec51b4;return _0x5b6ad4;});return db[_0x76a8('0xba')][_0x76a8('0xbb')](_0xbbcb84,{'transaction':_0x1138fd});});}else{_0x12f847=0x194;_0x451b36=[];}});})[_0x76a8('0x1c')](function(){if(_0x12f847!==0x194){return db[_0x76a8('0xba')][_0x76a8('0xbc')]({'where':{'SmsAccountId':_0xec51b4},'order':_0x76a8('0xbd')})[_0x76a8('0x1c')](function(_0x7172da){_0x451b36=_0x7172da;});}})['catch'](function(_0x51a9e2){_0x12f847=0x1f4;logger[_0x76a8('0x22')](_0x51a9e2[_0x76a8('0x35')]);if(_0x51a9e2[_0x76a8('0x36')]){delete _0x51a9e2[_0x76a8('0x36')];}_0x451b36=_0x51a9e2;})['finally'](function(){if(_0x451b36===null){_0x550a19[_0x76a8('0x26')](_0x12f847);}else{if(_0x12f847===0x1f4){_0x550a19['status'](_0x12f847)[_0x76a8('0x37')](_0x451b36);}else{_0x550a19['status'](_0x12f847)[_0x76a8('0xb5')](_0x451b36);}}});};exports['getApplications']=function(_0x5f4d4c,_0x56e1e8,_0x33e22d){var _0x49ebd4={};var _0x3b971d={};var _0x1d1785;var _0x366ce4;return db[_0x76a8('0x3b')][_0x76a8('0x66')]({'where':{'id':_0x5f4d4c[_0x76a8('0x53')]['id']}})[_0x76a8('0x1c')](handleEntityNotFound(_0x56e1e8,null))[_0x76a8('0x1c')](function(_0x322f4a){if(_0x322f4a){_0x1d1785=_0x322f4a;_0x3b971d[_0x76a8('0x40')]=_['keys'](db[_0x76a8('0xba')][_0x76a8('0x3c')]);_0x3b971d[_0x76a8('0x41')]=_['keys'](_0x5f4d4c[_0x76a8('0x41')]);_0x3b971d[_0x76a8('0x43')]=_[_0x76a8('0x44')](_0x3b971d[_0x76a8('0x40')],_0x3b971d[_0x76a8('0x41')]);_0x49ebd4[_0x76a8('0x45')]=_['intersection'](_0x3b971d[_0x76a8('0x40')],qs[_0x76a8('0x46')](_0x5f4d4c['query'][_0x76a8('0x46')]));_0x49ebd4['attributes']=_0x49ebd4[_0x76a8('0x45')]['length']?_0x49ebd4[_0x76a8('0x45')]:_0x3b971d[_0x76a8('0x40')];_0x49ebd4[_0x76a8('0x4a')]=qs[_0x76a8('0x4b')](_0x5f4d4c[_0x76a8('0x41')][_0x76a8('0x4b')]);_0x49ebd4['where']=qs[_0x76a8('0x43')](_[_0x76a8('0x4d')](_0x5f4d4c['query'],_0x3b971d[_0x76a8('0x43')]));if(_0x5f4d4c['query']['filter']){_0x49ebd4[_0x76a8('0x4c')]=_[_0x76a8('0x57')](_0x49ebd4[_0x76a8('0x4c')],{'$or':_[_0x76a8('0x3a')](_0x49ebd4[_0x76a8('0x45')],function(_0x2966f7){var _0x5b1f17={};_0x5b1f17[_0x2966f7]={'$like':'%'+_0x5f4d4c[_0x76a8('0x41')]['filter']+'%'};return _0x5b1f17;})});}_0x49ebd4=_[_0x76a8('0x57')]({},_0x49ebd4,_0x5f4d4c[_0x76a8('0x4f')]);return _0x1d1785['getApplications'](_0x49ebd4);}})[_0x76a8('0x1c')](function(_0x8d36d6){if(_0x8d36d6){_0x366ce4=_0x8d36d6[_0x76a8('0x47')];if(!_0x5f4d4c[_0x76a8('0x41')][_0x76a8('0x48')]('nolimit')){_0x49ebd4[_0x76a8('0x2b')]=qs[_0x76a8('0x2b')](_0x5f4d4c[_0x76a8('0x41')]['limit']);_0x49ebd4['offset']=qs[_0x76a8('0x29')](_0x5f4d4c[_0x76a8('0x41')][_0x76a8('0x29')]);}return _0x1d1785[_0x76a8('0xbe')](_0x49ebd4);}})[_0x76a8('0x1c')](function(_0x3e8198){if(_0x3e8198){return _0x3e8198?{'count':_0x366ce4,'rows':_0x3e8198}:null;}})[_0x76a8('0x1c')](respondWithResult(_0x56e1e8,null))[_0x76a8('0x51')](handleError(_0x56e1e8,null));};exports[_0x76a8('0xbf')]=function(_0x12500b,_0x302e4a,_0x464774){var _0x3469f5={'raw':![],'where':{}};var _0x3d2e98={};var _0x192979={'count':0x0,'rows':[]};return db['SmsAccount'][_0x76a8('0x66')]({'where':{'id':_0x12500b['params']['id']}})[_0x76a8('0x1c')](handleEntityNotFound(_0x302e4a,null))[_0x76a8('0x1c')](function(_0x462e88){if(_0x462e88){_0x3d2e98[_0x76a8('0x40')]=_[_0x76a8('0x42')](db[_0x76a8('0x9e')][_0x76a8('0x3c')]);_0x3d2e98[_0x76a8('0x41')]=_['keys'](_0x12500b['query']);_0x3d2e98[_0x76a8('0x43')]=_[_0x76a8('0x44')](_0x3d2e98[_0x76a8('0x40')],_0x3d2e98[_0x76a8('0x41')]);_0x3469f5[_0x76a8('0x45')]=_[_0x76a8('0x44')](_0x3d2e98[_0x76a8('0x40')],qs[_0x76a8('0x46')](_0x12500b[_0x76a8('0x41')]['fields']));_0x3469f5[_0x76a8('0x45')]=_0x3469f5['attributes'][_0x76a8('0x47')]?_0x3469f5[_0x76a8('0x45')]:_0x3d2e98[_0x76a8('0x40')];if(!_0x12500b[_0x76a8('0x41')]['hasOwnProperty']('nolimit')){_0x3469f5[_0x76a8('0x2b')]=qs['limit'](_0x12500b[_0x76a8('0x41')][_0x76a8('0x2b')]);_0x3469f5['offset']=qs[_0x76a8('0x29')](_0x12500b[_0x76a8('0x41')][_0x76a8('0x29')]);}_0x3469f5[_0x76a8('0x4a')]=qs['sort'](_0x12500b[_0x76a8('0x41')]['sort']);_0x3469f5[_0x76a8('0x4c')]=qs['filters'](_[_0x76a8('0x4d')](_0x12500b['query'],_0x3d2e98[_0x76a8('0x43')]));_0x3469f5['where'][_0x76a8('0x63')]=_0x462e88['id'];if(_0x12500b[_0x76a8('0x41')]['filter']){_0x3469f5[_0x76a8('0x4c')]=_[_0x76a8('0x57')](_0x3469f5[_0x76a8('0x4c')],{'$or':_[_0x76a8('0x3a')](_0x3469f5[_0x76a8('0x45')],function(_0x3ca3b9){var _0x480029={};_0x480029[_0x3ca3b9]={'$like':'%'+_0x12500b['query'][_0x76a8('0x4e')]+'%'};return _0x480029;})});}_0x3469f5=_[_0x76a8('0x57')]({},_0x3469f5,_0x12500b[_0x76a8('0x4f')]);return db[_0x76a8('0x9e')][_0x76a8('0x2c')]({'where':_0x3469f5[_0x76a8('0x4c')]})[_0x76a8('0x1c')](function(_0x30a713){_0x192979[_0x76a8('0x2c')]=_0x30a713;if(_0x12500b[_0x76a8('0x41')][_0x76a8('0x55')]){_0x3469f5[_0x76a8('0x56')]=[{'model':db[_0x76a8('0x75')],'as':_0x76a8('0xc0'),'required':![]},{'model':db[_0x76a8('0xa9')],'as':_0x76a8('0xc1'),'attributes':[_0x76a8('0x36'),_0x76a8('0xc2'),_0x76a8('0xc3')],'required':![]},{'model':db['Tag'],'as':_0x76a8('0xc4'),'attributes':['id',_0x76a8('0x36'),_0x76a8('0xc5')],'where':_0x12500b[_0x76a8('0x41')][_0x76a8('0xc6')]?{'id':_0x12500b[_0x76a8('0x41')][_0x76a8('0xc6')]}:undefined,'required':_0x12500b[_0x76a8('0x41')][_0x76a8('0xc6')]?!![]:![]}];}return db['SmsInteraction'][_0x76a8('0x67')](_0x3469f5);})['then'](function(_0xa1afa9){_0x192979[_0x76a8('0x50')]=_0xa1afa9;return _0x192979;});}})[_0x76a8('0x1c')](respondWithFilteredResult(_0x302e4a,_0x3469f5))['catch'](handleError(_0x302e4a,null));};exports['send']=function(_0x341aee,_0x22b02f,_0x2bf672){var _0x190288,_0x49f05b,_0x2cdf38;if(_[_0x76a8('0x94')](_0x341aee[_0x76a8('0x59')]['body'])||_0x341aee[_0x76a8('0x59')][_0x76a8('0x59')]===''){throw new db[(_0x76a8('0x76'))][(_0x76a8('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x341aee[_0x76a8('0x59')]['to'])){throw new db[(_0x76a8('0x76'))][(_0x76a8('0x95'))]('to\x20is\x20mandatory');}_0x190288=_0x341aee['body']['to'];return db[_0x76a8('0x3b')][_0x76a8('0x58')]({'where':{'id':_0x341aee[_0x76a8('0x53')]['id']},'include':[{'model':db[_0x76a8('0xc7')],'as':_0x76a8('0xc8'),'include':[{'model':db['CmContact'],'as':_0x76a8('0x9b'),'where':{'mobile':_0x190288},'limit':0x1,'order':[[_0x76a8('0x7a'),_0x76a8('0x9a')]]}]}]})['then'](handleEntityNotFound(_0x22b02f,null))['then'](function(_0x247981){if(_0x247981&&_0x247981[_0x76a8('0xc8')]){_0x49f05b=_0x247981[_0x76a8('0x5a')]({'plain':!![]});if(_0x49f05b[_0x76a8('0xc8')]&&_0x49f05b[_0x76a8('0xc8')][_0x76a8('0x9b')][_0x76a8('0x47')]){return _0x49f05b[_0x76a8('0xc8')][_0x76a8('0x9b')][0x0];}return db[_0x76a8('0x75')]['create'](_['defaults'](_0x341aee[_0x76a8('0x59')],{'firstName':_0x190288,'mobile':_0x190288,'phone':_0x190288,'ListId':_0x49f05b[_0x76a8('0x7c')]}));}})[_0x76a8('0x1c')](handleEntityNotFound(_0x22b02f,null))[_0x76a8('0x1c')](function(_0x255bc0){if(_0x255bc0){_0x2cdf38=_0x255bc0;return db['SmsInteraction']['find']({'where':{'ContactId':_0x2cdf38['id'],'closed':![],'SmsAccountId':_0x49f05b['id']}})[_0x76a8('0x1c')](function(_0xfc94b6){if(_0xfc94b6){return[_0xfc94b6,![]];}return db['SmsInteraction'][_0x76a8('0x5f')]({'UserId':_0x341aee[_0x76a8('0xc9')]['id'],'ContactId':_0x2cdf38['id'],'SmsAccountId':_0x49f05b['id'],'phone':_0x190288,'firstMsgDirection':'out','Messages':[_['merge'](_0x341aee[_0x76a8('0x59')],{'read':![],'body':_0x341aee[_0x76a8('0x59')]['body'],'phone':_0x190288,'SmsAccountId':_0x49f05b['id'],'UserId':_0x341aee['user']['id'],'ContactId':_0x2cdf38['id']})]},{'include':[{'model':db[_0x76a8('0xa6')],'as':'Messages'}]})[_0x76a8('0x1c')](function(_0x5c9e92){return[_0x5c9e92,!![]];});});}})[_0x76a8('0x9f')](function(_0x1e8590,_0x28e10a){if(_0x28e10a){return _0x1e8590;}return db[_0x76a8('0xa6')][_0x76a8('0x5f')](_['merge'](_0x341aee[_0x76a8('0x59')],{'read':![],'body':_0x341aee[_0x76a8('0x59')][_0x76a8('0x59')],'phone':_0x190288,'SmsAccountId':_0x49f05b['id'],'SmsInteractionId':_0x1e8590['id'],'UserId':_0x341aee[_0x76a8('0xc9')]['id'],'ContactId':_0x2cdf38['id']}))[_0x76a8('0x1c')](function(_0x2b526e){_0x1e8590['dataValues'][_0x76a8('0xca')]=[];_0x1e8590[_0x76a8('0xcb')]['Messages'][_0x76a8('0xa3')](_0x2b526e[_0x76a8('0xcb')]);return _0x1e8590;});})['then'](respondWithResult(_0x22b02f,null))[_0x76a8('0x51')](handleError(_0x22b02f,null));};exports[_0x76a8('0x27')]=function(_0x2bce50,_0x58e882,_0x5d23ba){if(_0x2bce50['body']['id']){delete _0x2bce50['body']['id'];}var _0x541fa4,_0x25185d,_0x165928;return db[_0x76a8('0x3b')]['find']({'where':{'id':_0x2bce50[_0x76a8('0x53')]['id']}})[_0x76a8('0x1c')](handleEntityNotFound(_0x58e882,null))[_0x76a8('0x1c')](function(_0x51263d){if(_0x51263d){_0x165928=_0x51263d;logger[_0x76a8('0x20')](_0x76a8('0x21'),_0x76a8('0x27'),_0x76a8('0xcc'),_0x51263d[_0x76a8('0x3e')],util['inspect'](_0x2bce50[_0x76a8('0x59')],{'showHidden':![],'depth':null}));switch(_0x51263d['type']){case _0x76a8('0x83'):if(_0x2bce50[_0x76a8('0x59')][_0x76a8('0xcd')]&&_0x2bce50[_0x76a8('0x59')][_0x76a8('0x27')]){_0x25185d=_0x2bce50[_0x76a8('0x59')][_0x76a8('0x27')];return db[_0x76a8('0xa6')][_0x76a8('0x58')]({'where':{'messageId':_0x2bce50[_0x76a8('0x59')][_0x76a8('0xcd')]}});}break;case'connectel':if(_0x2bce50['body']['requestid']&&_0x2bce50[_0x76a8('0x59')]['statusInt']){_0x25185d=_0x2bce50[_0x76a8('0x59')][_0x76a8('0xce')];return db[_0x76a8('0xa6')][_0x76a8('0x58')]({'where':{'messageId':_0x2bce50[_0x76a8('0x59')]['requestid']}});}break;case'clicksend':if(_0x2bce50[_0x76a8('0x59')]['message_id']&&_0x2bce50[_0x76a8('0x59')][_0x76a8('0xcf')]){_0x25185d=_0x2bce50[_0x76a8('0x59')][_0x76a8('0xcf')];return db[_0x76a8('0xa6')][_0x76a8('0x58')]({'where':{'messageId':_0x2bce50['body'][_0x76a8('0x88')]}});}break;case'infobip':var _0x394f7c=_0x2bce50[_0x76a8('0x59')][_0x76a8('0x8b')][0x0];if(_0x394f7c[_0x76a8('0x81')]&&_0x394f7c[_0x76a8('0x27')][_0x76a8('0xd0')]===_0x76a8('0xd1')){_0x25185d=_0x394f7c[_0x76a8('0x27')][_0x76a8('0xd0')];return db[_0x76a8('0xa6')][_0x76a8('0x58')]({'where':{'messageId':_0x394f7c[_0x76a8('0x81')]}});}break;case _0x76a8('0x8f'):if(_0x2bce50[_0x76a8('0x59')][_0x76a8('0x81')]&&_0x2bce50[_0x76a8('0x59')][_0x76a8('0x27')]){_0x25185d=_0x2bce50['body'][_0x76a8('0x27')];return db[_0x76a8('0xa6')][_0x76a8('0x58')]({'where':{'messageId':_0x2bce50[_0x76a8('0x59')][_0x76a8('0x81')]}});}break;case _0x76a8('0x92'):if(_0x2bce50['body'][0x0]['message']['id']){_0x25185d=_0x2bce50[_0x76a8('0x59')][0x0][_0x76a8('0x3e')];return db[_0x76a8('0xa6')][_0x76a8('0x58')]({'where':{'messageId':_0x2bce50[_0x76a8('0x59')][0x0][_0x76a8('0x24')]['id']}});}break;case _0x76a8('0x93'):if(_0x2bce50[_0x76a8('0x59')][_0x76a8('0xd2')]&&_0x2bce50[_0x76a8('0x59')][_0x76a8('0x27')]){_0x25185d=_0x2bce50[_0x76a8('0x59')][_0x76a8('0x27')];return db[_0x76a8('0xa6')][_0x76a8('0x58')]({'where':{'messageId':_0x2bce50['body']['redif']}});}break;}}})['then'](handleEntityNotFound(_0x58e882,null))['then'](function(_0x161493){if(_0x161493){_0x541fa4=_0x161493;switch(_0x165928['type']){case _0x76a8('0x83'):if(_0x25185d==='DELIVERED'){return _0x541fa4['update']({'read':!![]});}else{logger['error'](_0x76a8('0x21'),'status',_0x76a8('0x83'),util[_0x76a8('0xd3')](_0x2bce50[_0x76a8('0x59')],{'showHidden':![],'depth':null}));}break;case _0x76a8('0x86'):if(_0x25185d==='1'){return _0x541fa4['update']({'read':!![]});}else{logger[_0x76a8('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x76a8('0x27'),_0x76a8('0x83'),util[_0x76a8('0xd3')](_0x2bce50[_0x76a8('0x59')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x2bce50[_0x76a8('0x59')]['error_code']&&_0x25185d>=0xc8&&_0x25185d<=0xce){return _0x541fa4['update']({'read':!![]});}else{logger[_0x76a8('0x22')](_0x76a8('0x21'),_0x76a8('0x27'),'clicksend',util[_0x76a8('0xd3')](_0x2bce50[_0x76a8('0x59')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x3c2ede=_0x2bce50['body'][_0x76a8('0x8b')][0x0];if(_0x3c2ede[_0x76a8('0x27')][_0x76a8('0xd0')]===_0x76a8('0xd1')){return _0x541fa4[_0x76a8('0x31')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x76a8('0x27'),_0x76a8('0x8a'),util[_0x76a8('0xd3')](_0x2bce50[_0x76a8('0x59')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x25185d==_0x76a8('0xd4')||_0x25185d==_0x76a8('0xd5')){return _0x541fa4[_0x76a8('0x31')]({'read':!![]});}else{logger[_0x76a8('0x22')](_0x76a8('0x21'),'status',_0x76a8('0x8f'),util[_0x76a8('0xd3')](_0x2bce50[_0x76a8('0x59')],{'showHidden':![],'depth':null}));}break;case _0x76a8('0x92'):if(_0x25185d==_0x76a8('0xd6')){return _0x541fa4[_0x76a8('0x31')]({'read':!![]});}else{logger[_0x76a8('0x22')](_0x76a8('0x21'),_0x76a8('0x27'),'bandwidth',util['inspect'](_0x2bce50[_0x76a8('0x59')],{'showHidden':![],'depth':null}));}break;case _0x76a8('0x93'):if(_0x25185d===_0x76a8('0xd7')||_0x25185d===_0x76a8('0xd8')){return _0x541fa4[_0x76a8('0x31')]({'read':!![]});}else{logger['error'](_0x76a8('0x21'),_0x76a8('0x27'),_0x76a8('0x93'),util[_0x76a8('0xd3')](_0x2bce50[_0x76a8('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x541fa4;}})['then'](respondWithResult(_0x58e882,null))[_0x76a8('0x51')](handleError(_0x58e882,null));};exports['statusGet']=function(_0x5542ca,_0x113a9b,_0x1e0878){var _0x35b45f,_0x627ae1,_0x38c9da;return db[_0x76a8('0x3b')][_0x76a8('0x58')]({'where':{'id':_0x5542ca[_0x76a8('0x53')]['id']}})[_0x76a8('0x1c')](handleEntityNotFound(_0x113a9b,null))[_0x76a8('0x1c')](function(_0x3e1e79){if(_0x3e1e79){_0x38c9da=_0x3e1e79;logger[_0x76a8('0x20')](_0x76a8('0x21'),'status',_0x76a8('0xcc'),_0x3e1e79['type'],util['inspect'](_0x5542ca[_0x76a8('0x41')],{'showHidden':![],'depth':null}));switch(_0x3e1e79[_0x76a8('0x3e')]){case _0x76a8('0x8c'):if(_0x5542ca[_0x76a8('0x41')][_0x76a8('0xd9')]&&_0x5542ca[_0x76a8('0x41')]['state']){_0x627ae1=_0x5542ca[_0x76a8('0x41')][_0x76a8('0xda')];return db[_0x76a8('0xa6')][_0x76a8('0x58')]({'where':{'messageId':_0x5542ca[_0x76a8('0x41')][_0x76a8('0xd9')]}});}break;}}})[_0x76a8('0x1c')](handleEntityNotFound(_0x113a9b,null))['then'](function(_0x1344dd){if(_0x1344dd){_0x35b45f=_0x1344dd;switch(_0x38c9da[_0x76a8('0x3e')]){case _0x76a8('0x8c'):if(_0x627ae1==='2'||_0x627ae1==='6'){return _0x35b45f[_0x76a8('0x31')]({'read':!![]});}else{logger['error'](_0x76a8('0x21'),_0x76a8('0x27'),'csc',util['inspect'](_0x5542ca[_0x76a8('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x35b45f;}})[_0x76a8('0x1c')](respondWithResult(_0x113a9b,null))[_0x76a8('0x51')](handleError(_0x113a9b,null));};exports['addAgents']=function(_0x1776de,_0x40474b,_0x35b603){return db[_0x76a8('0x3b')]['find']({'where':{'id':_0x1776de[_0x76a8('0x53')]['id']}})[_0x76a8('0x1c')](handleEntityNotFound(_0x40474b,null))[_0x76a8('0x1c')](function(_0x6e1ee8){if(_0x6e1ee8){return _0x6e1ee8[_0x76a8('0xdb')](_0x1776de[_0x76a8('0x59')][_0x76a8('0x6d')],_[_0x76a8('0xdc')](_0x1776de[_0x76a8('0x59')],[_0x76a8('0x6d'),'id'])||{})['spread'](function(_0x29df74){for(var _0x8faaa7=0x0;_0x8faaa7<_0x1776de[_0x76a8('0x59')][_0x76a8('0x6d')]['length'];_0x8faaa7+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x1776de[_0x76a8('0x59')][_0x76a8('0x6d')][_0x8faaa7]),'SmsAccountId':Number(_0x1776de['params']['id'])});}return _0x29df74;});}})[_0x76a8('0x1c')](respondWithResult(_0x40474b,null))[_0x76a8('0x51')](handleError(_0x40474b,null));};exports[_0x76a8('0xdd')]=function(_0x5957f5,_0x24e7e6,_0x3390fa){return db['SmsAccount'][_0x76a8('0x58')]({'where':{'id':_0x5957f5[_0x76a8('0x53')]['id']}})[_0x76a8('0x1c')](handleEntityNotFound(_0x24e7e6,null))[_0x76a8('0x1c')](function(_0x546c7b){if(_0x546c7b){return _0x546c7b[_0x76a8('0xdd')](_0x5957f5['query']['ids'])[_0x76a8('0x1c')](function(){if(_[_0x76a8('0xde')](_0x5957f5[_0x76a8('0x41')]['ids'])){for(var _0x3274cf=0x0;_0x3274cf<_0x5957f5[_0x76a8('0x41')]['ids']['length'];_0x3274cf+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x5957f5[_0x76a8('0x41')]['ids'][_0x3274cf]),'SmsAccountId':Number(_0x5957f5[_0x76a8('0x53')]['id'])});}}else{socket[_0x76a8('0xdf')](_0x76a8('0xe0'),{'UserId':Number(_0x5957f5[_0x76a8('0x41')][_0x76a8('0x6d')]),'SmsAccountId':Number(_0x5957f5[_0x76a8('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x24e7e6,null))[_0x76a8('0x51')](handleError(_0x24e7e6,null));};exports['getAgents']=function(_0x5effe7,_0x58885d,_0x9e8d53){var _0x4bfc98={};var _0x24c19c={};var _0x4e7761;var _0x46cc1b;return db[_0x76a8('0x3b')][_0x76a8('0x66')]({'where':{'id':_0x5effe7[_0x76a8('0x53')]['id']}})['then'](handleEntityNotFound(_0x58885d,null))['then'](function(_0x3ab307){if(_0x3ab307){_0x4e7761=_0x3ab307;_0x24c19c[_0x76a8('0x40')]=_[_0x76a8('0x42')](db['User'][_0x76a8('0x3c')]);_0x24c19c[_0x76a8('0x41')]=_['keys'](_0x5effe7['query']);_0x24c19c[_0x76a8('0x43')]=_[_0x76a8('0x44')](_0x24c19c[_0x76a8('0x40')],_0x24c19c['query']);_0x4bfc98[_0x76a8('0x45')]=_[_0x76a8('0x44')](_0x24c19c[_0x76a8('0x40')],qs['fields'](_0x5effe7[_0x76a8('0x41')]['fields']));_0x4bfc98[_0x76a8('0x45')]=_0x4bfc98[_0x76a8('0x45')]['length']?_0x4bfc98['attributes']:_0x24c19c[_0x76a8('0x40')];_0x4bfc98[_0x76a8('0x4a')]=qs['sort'](_0x5effe7[_0x76a8('0x41')]['sort']);_0x4bfc98[_0x76a8('0x4c')]=qs[_0x76a8('0x43')](_[_0x76a8('0x4d')](_0x5effe7[_0x76a8('0x41')],_0x24c19c[_0x76a8('0x43')]));if(_0x5effe7['query'][_0x76a8('0x4e')]){_0x4bfc98['where']=_[_0x76a8('0x57')](_0x4bfc98[_0x76a8('0x4c')],{'$or':_[_0x76a8('0x3a')](_0x4bfc98[_0x76a8('0x45')],function(_0xb1df0f){var _0x21b524={};_0x21b524[_0xb1df0f]={'$like':'%'+_0x5effe7[_0x76a8('0x41')][_0x76a8('0x4e')]+'%'};return _0x21b524;})});}_0x4bfc98=_[_0x76a8('0x57')]({},_0x4bfc98,_0x5effe7[_0x76a8('0x4f')]);return _0x4e7761[_0x76a8('0xe1')](_0x4bfc98);}})['then'](function(_0x34cf28){if(_0x34cf28){_0x46cc1b=_0x34cf28[_0x76a8('0x47')];if(!_0x5effe7[_0x76a8('0x41')][_0x76a8('0x48')](_0x76a8('0x49'))){_0x4bfc98[_0x76a8('0x2b')]=qs[_0x76a8('0x2b')](_0x5effe7['query'][_0x76a8('0x2b')]);_0x4bfc98[_0x76a8('0x29')]=qs['offset'](_0x5effe7[_0x76a8('0x41')][_0x76a8('0x29')]);}return _0x4e7761[_0x76a8('0xe1')](_0x4bfc98);}})[_0x76a8('0x1c')](function(_0x50bac8){if(_0x50bac8){return _0x50bac8?{'count':_0x46cc1b,'rows':_0x50bac8}:null;}})[_0x76a8('0x1c')](respondWithResult(_0x58885d,null))[_0x76a8('0x51')](handleError(_0x58885d,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index d94f1d9..325d85d 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 _0x8953=['hasOwnProperty','hook','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x8953,0x160));var _0x3895=function(_0x5276f1,_0x1fcf3f){_0x5276f1=_0x5276f1-0x0;var _0xa2d451=_0x8953[_0x5276f1];return _0xa2d451;};'use strict';var EventEmitter=require(_0x3895('0x0'));var SmsAccount=require(_0x3895('0x1'))['db'][_0x3895('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x3895('0x3')](0x0);var events={'afterCreate':_0x3895('0x4'),'afterUpdate':_0x3895('0x5'),'afterDestroy':_0x3895('0x6')};function emitEvent(_0x50a779){return function(_0x36f2b2,_0x54e2ff,_0x47888c){SmsAccountEvents['emit'](_0x50a779+':'+_0x36f2b2['id'],_0x36f2b2);SmsAccountEvents[_0x3895('0x7')](_0x50a779,_0x36f2b2);_0x47888c(null);};}for(var e in events){if(events[_0x3895('0x8')](e)){var event=events[e];SmsAccount[_0x3895('0x9')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x331b=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsAccount'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x331b,0x16e));var _0xb331=function(_0x2c4375,_0x43d256){_0x2c4375=_0x2c4375-0x0;var _0x5566b7=_0x331b[_0x2c4375];return _0x5566b7;};'use strict';var EventEmitter=require(_0xb331('0x0'));var SmsAccount=require(_0xb331('0x1'))['db'][_0xb331('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xb331('0x3')](0x0);var events={'afterCreate':_0xb331('0x4'),'afterUpdate':'update','afterDestroy':_0xb331('0x5')};function emitEvent(_0x213ca7){return function(_0x5d74d0,_0x1810ef,_0x5c7bda){SmsAccountEvents[_0xb331('0x6')](_0x213ca7+':'+_0x5d74d0['id'],_0x5d74d0);SmsAccountEvents[_0xb331('0x6')](_0x213ca7,_0x5d74d0);_0x5c7bda(null);};}for(var e in events){if(events[_0xb331('0x7')](e)){var event=events[e];SmsAccount[_0xb331('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index f681cf8..6cefe79 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 _0x0a7a=['sms_accounts','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','exports'];(function(_0x41d564,_0x4af890){var _0x4831b4=function(_0x2edd39){while(--_0x2edd39){_0x41d564['push'](_0x41d564['shift']());}};_0x4831b4(++_0x4af890);}(_0x0a7a,0xb9));var _0xa0a7=function(_0x21c79c,_0x22b1f7){_0x21c79c=_0x21c79c-0x0;var _0x5eb58c=_0x0a7a[_0x21c79c];return _0x5eb58c;};'use strict';var _=require(_0xa0a7('0x0'));var util=require(_0xa0a7('0x1'));var logger=require(_0xa0a7('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa0a7('0x3'));var rp=require(_0xa0a7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa0a7('0x5'));var attributes=require('./smsAccount.attributes');module[_0xa0a7('0x6')]=function(_0xab7a5d,_0x21231d){return _0xab7a5d['define']('SmsAccount',attributes,{'tableName':_0xa0a7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71ef=['SmsAccount','sms_accounts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./smsAccount.attributes','exports'];(function(_0x298254,_0x3f9071){var _0x51c68a=function(_0x3a9ced){while(--_0x3a9ced){_0x298254['push'](_0x298254['shift']());}};_0x51c68a(++_0x3f9071);}(_0x71ef,0x1e6));var _0xf71e=function(_0x239dba,_0x309e95){_0x239dba=_0x239dba-0x0;var _0x1ceb11=_0x71ef[_0x239dba];return _0x1ceb11;};'use strict';var _=require('lodash');var util=require(_0xf71e('0x0'));var logger=require(_0xf71e('0x1'))('api');var moment=require(_0xf71e('0x2'));var BPromise=require(_0xf71e('0x3'));var rp=require(_0xf71e('0x4'));var fs=require('fs');var path=require(_0xf71e('0x5'));var rimraf=require(_0xf71e('0x6'));var config=require('../../config/environment');var attributes=require(_0xf71e('0x7'));module[_0xf71e('0x8')]=function(_0x2b7e22,_0x14c433){return _0x2b7e22['define'](_0xf71e('0x9'),attributes,{'tableName':_0xf71e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 8727120..87cfd0b 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 _0xa6a8=['../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','debug','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xa6a8,0x1c1));var _0x8a6a=function(_0x29cfdd,_0x4c68e6){_0x29cfdd=_0x29cfdd-0x0;var _0x385b55=_0xa6a8[_0x29cfdd];return _0x385b55;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8a6a('0x0'));var rs=require(_0x8a6a('0x1'));var fs=require('fs');var Redis=require(_0x8a6a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a6a('0x3'));var logger=require(_0x8a6a('0x4'))(_0x8a6a('0x5'));var config=require(_0x8a6a('0x6'));var jayson=require(_0x8a6a('0x7'));var client=jayson['client'][_0x8a6a('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8a6a('0x9')],{'host':_0x8a6a('0xa'),'port':0x18eb});var socket=require(_0x8a6a('0xb'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x8a6a('0xc')](socket);function respondWithRpcPromise(_0x6c52e6,_0x4a287b,_0x1b30f1){return new BPromise(function(_0x42a4d3,_0x568154){return client[_0x8a6a('0xd')](_0x6c52e6,_0x1b30f1)[_0x8a6a('0xe')](function(_0x52c782){logger['info'](_0x8a6a('0xf'),_0x4a287b,_0x8a6a('0x10'));logger['debug'](_0x8a6a('0x11'),_0x4a287b,'request\x20sent',JSON[_0x8a6a('0x12')](_0x52c782));if(_0x52c782[_0x8a6a('0x13')]){if(_0x52c782[_0x8a6a('0x13')][_0x8a6a('0x14')]===0x1f4){logger[_0x8a6a('0x13')](_0x8a6a('0xf'),_0x4a287b,_0x52c782['error'][_0x8a6a('0x15')]);return _0x568154(_0x52c782['error'][_0x8a6a('0x15')]);}logger[_0x8a6a('0x13')](_0x8a6a('0xf'),_0x4a287b,_0x52c782[_0x8a6a('0x13')][_0x8a6a('0x15')]);return _0x42a4d3(_0x52c782[_0x8a6a('0x13')]['message']);}else{logger[_0x8a6a('0x16')](_0x8a6a('0xf'),_0x4a287b,'request\x20sent');_0x42a4d3(_0x52c782['result'][_0x8a6a('0x15')]);}})[_0x8a6a('0x17')](function(_0x40a654){logger[_0x8a6a('0x13')](_0x8a6a('0xf'),_0x4a287b,_0x40a654);_0x568154(_0x40a654);});});}exports[_0x8a6a('0x18')]=function(_0x2b105a){var _0x38b8ea=this;return new Promise(function(_0x48235d,_0x4804ae){return db[_0x8a6a('0x19')][_0x8a6a('0x1a')]({'raw':_0x2b105a[_0x8a6a('0x1b')]?_0x2b105a[_0x8a6a('0x1b')][_0x8a6a('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b105a[_0x8a6a('0x1b')]?_0x2b105a[_0x8a6a('0x1b')][_0x8a6a('0x1d')]||null:null,'attributes':_0x2b105a[_0x8a6a('0x1b')]?_0x2b105a[_0x8a6a('0x1b')][_0x8a6a('0x1e')]||null:null,'include':_0x2b105a['options']?_0x2b105a[_0x8a6a('0x1b')][_0x8a6a('0x1f')]?_[_0x8a6a('0x20')](_0x2b105a[_0x8a6a('0x1b')][_0x8a6a('0x1f')],function(_0x57bf38){return{'model':db[_0x57bf38[_0x8a6a('0x21')]],'as':_0x57bf38['as'],'attributes':_0x57bf38[_0x8a6a('0x1e')],'include':_0x57bf38['include']?_['map'](_0x57bf38[_0x8a6a('0x1f')],function(_0xa323df){return{'model':db[_0xa323df[_0x8a6a('0x21')]],'as':_0xa323df['as'],'attributes':_0xa323df['attributes'],'include':_0xa323df[_0x8a6a('0x1f')]?_['map'](_0xa323df[_0x8a6a('0x1f')],function(_0x572587){return{'model':db[_0x572587[_0x8a6a('0x21')]],'as':_0x572587['as'],'attributes':_0x572587['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2770fa){logger[_0x8a6a('0x16')](_0x8a6a('0x18'),_0x2b105a);logger[_0x8a6a('0x22')](_0x8a6a('0x18'),_0x2b105a,JSON['stringify'](_0x2770fa));_0x48235d(_0x2770fa);})[_0x8a6a('0x17')](function(_0x3064b6){logger['error']('ShowSmsAccount',_0x3064b6['message'],_0x2b105a);_0x4804ae(_0x38b8ea[_0x8a6a('0x13')](0x1f4,_0x3064b6[_0x8a6a('0x15')]));});});}; \ No newline at end of file +var _0xe117=['randomstring','../../config/utils','jayson/promise','client','redis','localhost','request','then','info','debug','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','catch','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird'];(function(_0x48e9e7,_0x32f36f){var _0x4763f8=function(_0x6bef3c){while(--_0x6bef3c){_0x48e9e7['push'](_0x48e9e7['shift']());}};_0x4763f8(++_0x32f36f);}(_0xe117,0x128));var _0x7e11=function(_0x1bb2ca,_0x34a1c3){_0x1bb2ca=_0x1bb2ca-0x0;var _0x143680=_0xe117[_0x1bb2ca];return _0x143680;};'use strict';var _=require(_0x7e11('0x0'));var util=require(_0x7e11('0x1'));var moment=require(_0x7e11('0x2'));var BPromise=require(_0x7e11('0x3'));var rs=require(_0x7e11('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7e11('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7e11('0x6'));var client=jayson[_0x7e11('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x7e11('0x8')],{'host':_0x7e11('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7e11('0x8')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x225ad9,_0x25b182,_0x57bf44){return new BPromise(function(_0x5e6029,_0x2e9f45){return client[_0x7e11('0xa')](_0x225ad9,_0x57bf44)[_0x7e11('0xb')](function(_0x4d31c0){logger[_0x7e11('0xc')]('SmsAccount,\x20%s,\x20%s',_0x25b182,'request\x20sent');logger[_0x7e11('0xd')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x25b182,_0x7e11('0xe'),JSON[_0x7e11('0xf')](_0x4d31c0));if(_0x4d31c0[_0x7e11('0x10')]){if(_0x4d31c0[_0x7e11('0x10')][_0x7e11('0x11')]===0x1f4){logger[_0x7e11('0x10')](_0x7e11('0x12'),_0x25b182,_0x4d31c0['error'][_0x7e11('0x13')]);return _0x2e9f45(_0x4d31c0[_0x7e11('0x10')][_0x7e11('0x13')]);}logger[_0x7e11('0x10')]('SmsAccount,\x20%s,\x20%s',_0x25b182,_0x4d31c0['error'][_0x7e11('0x13')]);return _0x5e6029(_0x4d31c0[_0x7e11('0x10')][_0x7e11('0x13')]);}else{logger[_0x7e11('0xc')](_0x7e11('0x12'),_0x25b182,_0x7e11('0xe'));_0x5e6029(_0x4d31c0['result'][_0x7e11('0x13')]);}})[_0x7e11('0x14')](function(_0x50c2a5){logger[_0x7e11('0x10')](_0x7e11('0x12'),_0x25b182,_0x50c2a5);_0x2e9f45(_0x50c2a5);});});}exports[_0x7e11('0x15')]=function(_0x13b414){var _0x15a38a=this;return new Promise(function(_0x59ffb9,_0x3bf864){return db[_0x7e11('0x16')]['find']({'raw':_0x13b414[_0x7e11('0x17')]?_0x13b414[_0x7e11('0x17')][_0x7e11('0x18')]===undefined?!![]:![]:!![],'where':_0x13b414[_0x7e11('0x17')]?_0x13b414[_0x7e11('0x17')][_0x7e11('0x19')]||null:null,'attributes':_0x13b414[_0x7e11('0x17')]?_0x13b414['options'][_0x7e11('0x1a')]||null:null,'include':_0x13b414[_0x7e11('0x17')]?_0x13b414['options'][_0x7e11('0x1b')]?_['map'](_0x13b414[_0x7e11('0x17')][_0x7e11('0x1b')],function(_0x4ad749){return{'model':db[_0x4ad749['model']],'as':_0x4ad749['as'],'attributes':_0x4ad749[_0x7e11('0x1a')],'include':_0x4ad749[_0x7e11('0x1b')]?_['map'](_0x4ad749[_0x7e11('0x1b')],function(_0x4fa008){return{'model':db[_0x4fa008['model']],'as':_0x4fa008['as'],'attributes':_0x4fa008['attributes'],'include':_0x4fa008[_0x7e11('0x1b')]?_[_0x7e11('0x1c')](_0x4fa008['include'],function(_0x1f6249){return{'model':db[_0x1f6249[_0x7e11('0x1d')]],'as':_0x1f6249['as'],'attributes':_0x1f6249[_0x7e11('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7e11('0xb')](function(_0x4a2c6c){logger[_0x7e11('0xc')](_0x7e11('0x15'),_0x13b414);logger[_0x7e11('0xd')]('ShowSmsAccount',_0x13b414,JSON[_0x7e11('0xf')](_0x4a2c6c));_0x59ffb9(_0x4a2c6c);})[_0x7e11('0x14')](function(_0x835516){logger['error'](_0x7e11('0x15'),_0x835516[_0x7e11('0x13')],_0x13b414);_0x3bf864(_0x15a38a[_0x7e11('0x10')](0x1f4,_0x835516[_0x7e11('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index b2f6de4..40243ea 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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 0bf7ffc..e032bab 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0xfd1abd,_0x5ed1fe){var _0x6671a4=function(_0x34768a){while(--_0x34768a){_0xfd1abd['push'](_0xfd1abd['shift']());}};_0x6671a4(++_0x5ed1fe);}(_0x55ca,0x126));var _0xa55c=function(_0x52a7e1,_0x189bf3){_0x52a7e1=_0x52a7e1-0x0;var _0x4f4495=_0x55ca[_0x52a7e1];return _0x4f4495;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0xd6d3c8,_0x5795c4){var _0x2a8307=function(_0x54faf0){while(--_0x54faf0){_0xd6d3c8['push'](_0xd6d3c8['shift']());}};_0x2a8307(++_0x5795c4);}(_0x7217,0x19e));var _0x7721=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x7217[_0x2f3848];return _0x102668;};'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('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index f620fce..f676c5e 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 _0xa563=['exports','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa563,0x144));var _0x3a56=function(_0x45b663,_0x1f9910){_0x45b663=_0x45b663-0x0;var _0x390b7c=_0xa563[_0x45b663];return _0x390b7c;};'use strict';var Sequelize=require(_0x3a56('0x0'));module[_0x3a56('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3a56('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3a56('0x3')]()},'description':{'type':Sequelize[_0x3a56('0x2')]},'interval':{'type':Sequelize[_0x3a56('0x2')],'defaultValue':_0x3a56('0x4')}}; \ No newline at end of file +var _0x4430=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4430,0x1ab));var _0x0443=function(_0x30a5b5,_0x21e05e){_0x30a5b5=_0x30a5b5-0x0;var _0x58e1c4=_0x4430[_0x30a5b5];return _0x58e1c4;};'use strict';var Sequelize=require('sequelize');module[_0x0443('0x0')]={'priority':{'type':Sequelize[_0x0443('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0443('0x2')],'allowNull':![],'defaultValue':_0x0443('0x3')},'appdata':{'type':Sequelize[_0x0443('0x4')]()},'description':{'type':Sequelize[_0x0443('0x2')]},'interval':{'type':Sequelize[_0x0443('0x2')],'defaultValue':_0x0443('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 61ed6e1..e112f78 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 _0xfd4f=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../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','save','update','then','destroy','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir'];(function(_0x293d41,_0x43f954){var _0x1b5245=function(_0x4db2a7){while(--_0x4db2a7){_0x293d41['push'](_0x293d41['shift']());}};_0x1b5245(++_0x43f954);}(_0xfd4f,0x183));var _0xffd4=function(_0x2a33e9,_0x2a9f84){_0x2a33e9=_0x2a33e9-0x0;var _0x4d39b0=_0xfd4f[_0x2a33e9];return _0x4d39b0;};'use strict';var emlformat=require(_0xffd4('0x0'));var rimraf=require(_0xffd4('0x1'));var zipdir=require(_0xffd4('0x2'));var jsonpatch=require(_0xffd4('0x3'));var rp=require(_0xffd4('0x4'));var moment=require(_0xffd4('0x5'));var BPromise=require(_0xffd4('0x6'));var Mustache=require(_0xffd4('0x7'));var util=require(_0xffd4('0x8'));var path=require(_0xffd4('0x9'));var sox=require(_0xffd4('0xa'));var csv=require('to-csv');var ejs=require(_0xffd4('0xb'));var fs=require('fs');var fs_extra=require(_0xffd4('0xc'));var _=require(_0xffd4('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xffd4('0xe'));var deskjs=require(_0xffd4('0xf'));var toCsv=require(_0xffd4('0x10'));var querystring=require(_0xffd4('0x11'));var Papa=require(_0xffd4('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xffd4('0x13'));var hardwareService=require(_0xffd4('0x14'));var logger=require(_0xffd4('0x15'))('api');var utils=require(_0xffd4('0x16'));var config=require(_0xffd4('0x17'));var licenseUtil=require(_0xffd4('0x18'));var db=require(_0xffd4('0x19'))['db'];function respondWithStatusCode(_0xcfab82,_0x58bdad){_0x58bdad=_0x58bdad||0xcc;return function(_0xa105dd){if(_0xa105dd){return _0xcfab82[_0xffd4('0x1a')](_0x58bdad);}return _0xcfab82[_0xffd4('0x1b')](_0x58bdad)[_0xffd4('0x1c')]();};}function respondWithResult(_0x353b1c,_0x5d9c6b){_0x5d9c6b=_0x5d9c6b||0xc8;return function(_0x39867f){if(_0x39867f){return _0x353b1c[_0xffd4('0x1b')](_0x5d9c6b)[_0xffd4('0x1d')](_0x39867f);}};}function respondWithFilteredResult(_0x3bb4e0,_0x10046b){return function(_0x1fde6c){if(_0x1fde6c){var _0x1b5ac9=typeof _0x10046b[_0xffd4('0x1e')]===_0xffd4('0x1f')&&typeof _0x10046b[_0xffd4('0x20')]===_0xffd4('0x1f');var _0x4cafe3=_0x1fde6c[_0xffd4('0x21')];var _0x4bca8e=_0x1b5ac9?0x0:_0x10046b[_0xffd4('0x1e')];var _0x47de64=_0x1b5ac9?_0x1fde6c[_0xffd4('0x21')]:_0x10046b[_0xffd4('0x1e')]+_0x10046b[_0xffd4('0x20')];var _0x46169d;if(_0x47de64>=_0x4cafe3){_0x47de64=_0x4cafe3;_0x46169d=0xc8;}else{_0x46169d=0xce;}_0x3bb4e0['status'](_0x46169d);return _0x3bb4e0['set'](_0xffd4('0x22'),_0x4bca8e+'-'+_0x47de64+'/'+_0x4cafe3)[_0xffd4('0x1d')](_0x1fde6c);}return null;};}function patchUpdates(_0x15ad90){return function(_0x4e5525){try{jsonpatch[_0xffd4('0x23')](_0x4e5525,_0x15ad90,!![]);}catch(_0x47b4c9){return BPromise[_0xffd4('0x24')](_0x47b4c9);}return _0x4e5525[_0xffd4('0x25')]();};}function saveUpdates(_0x5ceae4,_0x48b0d4){return function(_0x496bcd){if(_0x496bcd){return _0x496bcd[_0xffd4('0x26')](_0x5ceae4)[_0xffd4('0x27')](function(_0x1b9d6e){return _0x1b9d6e;});}return null;};}function removeEntity(_0x1688c3,_0x15c89c){return function(_0x2bf8dd){if(_0x2bf8dd){return _0x2bf8dd[_0xffd4('0x28')]()[_0xffd4('0x27')](function(){_0x1688c3[_0xffd4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41de61,_0x3c3ac6){return function(_0x15e115){if(!_0x15e115){_0x41de61[_0xffd4('0x1a')](0x194);}return _0x15e115;};}function handleError(_0x1af6de,_0x4ecbcd){_0x4ecbcd=_0x4ecbcd||0x1f4;return function(_0x5cac90){logger['error'](_0x5cac90[_0xffd4('0x29')]);if(_0x5cac90['name']){delete _0x5cac90[_0xffd4('0x2a')];}_0x1af6de[_0xffd4('0x1b')](_0x4ecbcd)[_0xffd4('0x2b')](_0x5cac90);};}exports[_0xffd4('0x2c')]=function(_0xbaf40f,_0x246ae3){var _0x50c2be={},_0x101ad0={},_0x4ce7a5={'count':0x0,'rows':[]};var _0x2d95ee=_[_0xffd4('0x2d')](db[_0xffd4('0x2e')][_0xffd4('0x2f')],function(_0x5dc66f){return{'name':_0x5dc66f[_0xffd4('0x30')],'type':_0x5dc66f[_0xffd4('0x31')][_0xffd4('0x32')]};});_0x101ad0[_0xffd4('0x33')]=_['map'](_0x2d95ee,_0xffd4('0x2a'));_0x101ad0[_0xffd4('0x34')]=_[_0xffd4('0x35')](_0xbaf40f[_0xffd4('0x34')]);_0x101ad0[_0xffd4('0x36')]=_[_0xffd4('0x37')](_0x101ad0[_0xffd4('0x33')],_0x101ad0[_0xffd4('0x34')]);_0x50c2be['attributes']=_[_0xffd4('0x37')](_0x101ad0['model'],qs[_0xffd4('0x38')](_0xbaf40f['query']['fields']));_0x50c2be[_0xffd4('0x39')]=_0x50c2be[_0xffd4('0x39')][_0xffd4('0x3a')]?_0x50c2be[_0xffd4('0x39')]:_0x101ad0[_0xffd4('0x33')];if(!_0xbaf40f[_0xffd4('0x34')][_0xffd4('0x3b')](_0xffd4('0x3c'))){_0x50c2be[_0xffd4('0x20')]=qs[_0xffd4('0x20')](_0xbaf40f[_0xffd4('0x34')][_0xffd4('0x20')]);_0x50c2be['offset']=qs['offset'](_0xbaf40f[_0xffd4('0x34')]['offset']);}_0x50c2be[_0xffd4('0x3d')]=qs[_0xffd4('0x3e')](_0xbaf40f[_0xffd4('0x34')][_0xffd4('0x3e')]);_0x50c2be[_0xffd4('0x3f')]=qs[_0xffd4('0x36')](_[_0xffd4('0x40')](_0xbaf40f[_0xffd4('0x34')],_0x101ad0[_0xffd4('0x36')]),_0x2d95ee);if(_0xbaf40f[_0xffd4('0x34')][_0xffd4('0x41')]){_0x50c2be['where']=_[_0xffd4('0x42')](_0x50c2be[_0xffd4('0x3f')],{'$or':_[_0xffd4('0x2d')](_0x2d95ee,function(_0x1bac7a){if(_0x1bac7a[_0xffd4('0x31')]!==_0xffd4('0x43')){var _0x448412={};_0x448412[_0x1bac7a[_0xffd4('0x2a')]]={'$like':'%'+_0xbaf40f[_0xffd4('0x34')]['filter']+'%'};return _0x448412;}})});}_0x50c2be=_[_0xffd4('0x42')]({},_0x50c2be,_0xbaf40f[_0xffd4('0x44')]);var _0x4755a0={'where':_0x50c2be[_0xffd4('0x3f')]};return db['SmsApplication'][_0xffd4('0x21')](_0x4755a0)['then'](function(_0x36859c){_0x4ce7a5[_0xffd4('0x21')]=_0x36859c;if(_0xbaf40f[_0xffd4('0x34')][_0xffd4('0x45')]){_0x50c2be[_0xffd4('0x46')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x50c2be);})[_0xffd4('0x27')](function(_0x4310fe){_0x4ce7a5[_0xffd4('0x47')]=_0x4310fe;return _0x4ce7a5;})[_0xffd4('0x27')](respondWithFilteredResult(_0x246ae3,_0x50c2be))[_0xffd4('0x48')](handleError(_0x246ae3,null));};exports[_0xffd4('0x49')]=function(_0x5ef6ac,_0x3090ff){var _0x94858d={'raw':!![],'where':{'id':_0x5ef6ac[_0xffd4('0x4a')]['id']}},_0x479f26={};_0x479f26[_0xffd4('0x33')]=_[_0xffd4('0x35')](db['SmsApplication'][_0xffd4('0x2f')]);_0x479f26[_0xffd4('0x34')]=_[_0xffd4('0x35')](_0x5ef6ac[_0xffd4('0x34')]);_0x479f26[_0xffd4('0x36')]=_['intersection'](_0x479f26[_0xffd4('0x33')],_0x479f26[_0xffd4('0x34')]);_0x94858d[_0xffd4('0x39')]=_[_0xffd4('0x37')](_0x479f26['model'],qs[_0xffd4('0x38')](_0x5ef6ac[_0xffd4('0x34')]['fields']));_0x94858d['attributes']=_0x94858d[_0xffd4('0x39')][_0xffd4('0x3a')]?_0x94858d['attributes']:_0x479f26['model'];if(_0x5ef6ac[_0xffd4('0x34')][_0xffd4('0x45')]){_0x94858d[_0xffd4('0x46')]=[{'all':!![]}];}_0x94858d=_[_0xffd4('0x42')]({},_0x94858d,_0x5ef6ac[_0xffd4('0x44')]);return db[_0xffd4('0x2e')][_0xffd4('0x4b')](_0x94858d)[_0xffd4('0x27')](handleEntityNotFound(_0x3090ff,null))[_0xffd4('0x27')](respondWithResult(_0x3090ff,null))[_0xffd4('0x48')](handleError(_0x3090ff,null));};exports[_0xffd4('0x4c')]=function(_0x5143d1,_0x104ede){return db[_0xffd4('0x2e')][_0xffd4('0x4c')](_0x5143d1[_0xffd4('0x4d')],{})[_0xffd4('0x27')](respondWithResult(_0x104ede,0xc9))[_0xffd4('0x48')](handleError(_0x104ede,null));};exports[_0xffd4('0x26')]=function(_0x4da83b,_0x2bb10a){if(_0x4da83b[_0xffd4('0x4d')]['id']){delete _0x4da83b[_0xffd4('0x4d')]['id'];}return db[_0xffd4('0x2e')]['find']({'where':{'id':_0x4da83b[_0xffd4('0x4a')]['id']}})[_0xffd4('0x27')](handleEntityNotFound(_0x2bb10a,null))[_0xffd4('0x27')](saveUpdates(_0x4da83b[_0xffd4('0x4d')],null))[_0xffd4('0x27')](respondWithResult(_0x2bb10a,null))[_0xffd4('0x48')](handleError(_0x2bb10a,null));};exports[_0xffd4('0x28')]=function(_0x5bd2b6,_0x1d5b9a){return db[_0xffd4('0x2e')]['find']({'where':{'id':_0x5bd2b6['params']['id']}})[_0xffd4('0x27')](handleEntityNotFound(_0x1d5b9a,null))[_0xffd4('0x27')](removeEntity(_0x1d5b9a,null))[_0xffd4('0x48')](handleError(_0x1d5b9a,null));}; \ No newline at end of file +var _0x5995=['rows','params','rawAttributes','keys','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','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','json','limit','count','offset','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','SmsApplication','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x4e0081,_0x5969d1){var _0x1100d4=function(_0x485f59){while(--_0x485f59){_0x4e0081['push'](_0x4e0081['shift']());}};_0x1100d4(++_0x5969d1);}(_0x5995,0x145));var _0x5599=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5995[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x5599('0x0'));var rimraf=require(_0x5599('0x1'));var zipdir=require(_0x5599('0x2'));var jsonpatch=require(_0x5599('0x3'));var rp=require(_0x5599('0x4'));var moment=require(_0x5599('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5599('0x6'));var path=require(_0x5599('0x7'));var sox=require(_0x5599('0x8'));var csv=require('to-csv');var ejs=require(_0x5599('0x9'));var fs=require('fs');var fs_extra=require(_0x5599('0xa'));var _=require('lodash');var squel=require(_0x5599('0xb'));var crypto=require(_0x5599('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5599('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5599('0xe'));var Papa=require(_0x5599('0xf'));var Redis=require(_0x5599('0x10'));var authService=require(_0x5599('0x11'));var qs=require(_0x5599('0x12'));var as=require(_0x5599('0x13'));var hardwareService=require(_0x5599('0x14'));var logger=require(_0x5599('0x15'))(_0x5599('0x16'));var utils=require(_0x5599('0x17'));var config=require(_0x5599('0x18'));var licenseUtil=require(_0x5599('0x19'));var db=require(_0x5599('0x1a'))['db'];function respondWithStatusCode(_0x2cbe00,_0x5d5040){_0x5d5040=_0x5d5040||0xcc;return function(_0xa01bef){if(_0xa01bef){return _0x2cbe00['sendStatus'](_0x5d5040);}return _0x2cbe00[_0x5599('0x1b')](_0x5d5040)['end']();};}function respondWithResult(_0x45ea04,_0x569b94){_0x569b94=_0x569b94||0xc8;return function(_0x275d5a){if(_0x275d5a){return _0x45ea04['status'](_0x569b94)[_0x5599('0x1c')](_0x275d5a);}};}function respondWithFilteredResult(_0x11eeae,_0x1f78f4){return function(_0x48343a){if(_0x48343a){var _0x290a95=typeof _0x1f78f4['offset']==='undefined'&&typeof _0x1f78f4[_0x5599('0x1d')]==='undefined';var _0xd0a21c=_0x48343a[_0x5599('0x1e')];var _0x50287a=_0x290a95?0x0:_0x1f78f4['offset'];var _0x23f036=_0x290a95?_0x48343a[_0x5599('0x1e')]:_0x1f78f4[_0x5599('0x1f')]+_0x1f78f4['limit'];var _0x186ff9;if(_0x23f036>=_0xd0a21c){_0x23f036=_0xd0a21c;_0x186ff9=0xc8;}else{_0x186ff9=0xce;}_0x11eeae['status'](_0x186ff9);return _0x11eeae[_0x5599('0x20')]('Content-Range',_0x50287a+'-'+_0x23f036+'/'+_0xd0a21c)[_0x5599('0x1c')](_0x48343a);}return null;};}function patchUpdates(_0x153d78){return function(_0x35e129){try{jsonpatch[_0x5599('0x21')](_0x35e129,_0x153d78,!![]);}catch(_0x2b0a90){return BPromise[_0x5599('0x22')](_0x2b0a90);}return _0x35e129[_0x5599('0x23')]();};}function saveUpdates(_0x3f046e,_0x51e206){return function(_0x2fc0b3){if(_0x2fc0b3){return _0x2fc0b3[_0x5599('0x24')](_0x3f046e)[_0x5599('0x25')](function(_0x2df717){return _0x2df717;});}return null;};}function removeEntity(_0xa0de3,_0xad0f4c){return function(_0x4331b2){if(_0x4331b2){return _0x4331b2[_0x5599('0x26')]()['then'](function(){_0xa0de3[_0x5599('0x1b')](0xcc)[_0x5599('0x27')]();});}};}function handleEntityNotFound(_0x1056fc,_0x33dfdd){return function(_0x13dd94){if(!_0x13dd94){_0x1056fc[_0x5599('0x28')](0x194);}return _0x13dd94;};}function handleError(_0x414fcc,_0x29ae1f){_0x29ae1f=_0x29ae1f||0x1f4;return function(_0x4bbea9){logger[_0x5599('0x29')](_0x4bbea9[_0x5599('0x2a')]);if(_0x4bbea9['name']){delete _0x4bbea9[_0x5599('0x2b')];}_0x414fcc[_0x5599('0x1b')](_0x29ae1f)[_0x5599('0x2c')](_0x4bbea9);};}exports[_0x5599('0x2d')]=function(_0x1fc71c,_0x5e49fd){var _0x3321bb={},_0x31ed1c={},_0x12618c={'count':0x0,'rows':[]};var _0x424b4a=_[_0x5599('0x2e')](db[_0x5599('0x2f')]['rawAttributes'],function(_0x3853db){return{'name':_0x3853db[_0x5599('0x30')],'type':_0x3853db[_0x5599('0x31')][_0x5599('0x32')]};});_0x31ed1c[_0x5599('0x33')]=_[_0x5599('0x2e')](_0x424b4a,'name');_0x31ed1c[_0x5599('0x34')]=_['keys'](_0x1fc71c['query']);_0x31ed1c[_0x5599('0x35')]=_[_0x5599('0x36')](_0x31ed1c[_0x5599('0x33')],_0x31ed1c[_0x5599('0x34')]);_0x3321bb[_0x5599('0x37')]=_[_0x5599('0x36')](_0x31ed1c[_0x5599('0x33')],qs[_0x5599('0x38')](_0x1fc71c['query'][_0x5599('0x38')]));_0x3321bb[_0x5599('0x37')]=_0x3321bb[_0x5599('0x37')]['length']?_0x3321bb[_0x5599('0x37')]:_0x31ed1c['model'];if(!_0x1fc71c['query'][_0x5599('0x39')](_0x5599('0x3a'))){_0x3321bb[_0x5599('0x1d')]=qs[_0x5599('0x1d')](_0x1fc71c[_0x5599('0x34')][_0x5599('0x1d')]);_0x3321bb['offset']=qs[_0x5599('0x1f')](_0x1fc71c[_0x5599('0x34')]['offset']);}_0x3321bb[_0x5599('0x3b')]=qs[_0x5599('0x3c')](_0x1fc71c[_0x5599('0x34')][_0x5599('0x3c')]);_0x3321bb['where']=qs[_0x5599('0x35')](_[_0x5599('0x3d')](_0x1fc71c[_0x5599('0x34')],_0x31ed1c['filters']),_0x424b4a);if(_0x1fc71c[_0x5599('0x34')][_0x5599('0x3e')]){_0x3321bb[_0x5599('0x3f')]=_[_0x5599('0x40')](_0x3321bb['where'],{'$or':_[_0x5599('0x2e')](_0x424b4a,function(_0x3eb7d8){if(_0x3eb7d8[_0x5599('0x31')]!==_0x5599('0x41')){var _0x311d64={};_0x311d64[_0x3eb7d8[_0x5599('0x2b')]]={'$like':'%'+_0x1fc71c[_0x5599('0x34')][_0x5599('0x3e')]+'%'};return _0x311d64;}})});}_0x3321bb=_[_0x5599('0x40')]({},_0x3321bb,_0x1fc71c[_0x5599('0x42')]);var _0x222bbd={'where':_0x3321bb[_0x5599('0x3f')]};return db[_0x5599('0x2f')]['count'](_0x222bbd)[_0x5599('0x25')](function(_0x46d518){_0x12618c[_0x5599('0x1e')]=_0x46d518;if(_0x1fc71c[_0x5599('0x34')][_0x5599('0x43')]){_0x3321bb[_0x5599('0x44')]=[{'all':!![]}];}return db['SmsApplication'][_0x5599('0x45')](_0x3321bb);})['then'](function(_0x168655){_0x12618c[_0x5599('0x46')]=_0x168655;return _0x12618c;})[_0x5599('0x25')](respondWithFilteredResult(_0x5e49fd,_0x3321bb))['catch'](handleError(_0x5e49fd,null));};exports['show']=function(_0x474e4f,_0x408905){var _0x3d43ae={'raw':!![],'where':{'id':_0x474e4f[_0x5599('0x47')]['id']}},_0x1f10df={};_0x1f10df[_0x5599('0x33')]=_['keys'](db['SmsApplication'][_0x5599('0x48')]);_0x1f10df[_0x5599('0x34')]=_[_0x5599('0x49')](_0x474e4f[_0x5599('0x34')]);_0x1f10df[_0x5599('0x35')]=_[_0x5599('0x36')](_0x1f10df['model'],_0x1f10df[_0x5599('0x34')]);_0x3d43ae[_0x5599('0x37')]=_[_0x5599('0x36')](_0x1f10df[_0x5599('0x33')],qs['fields'](_0x474e4f[_0x5599('0x34')]['fields']));_0x3d43ae[_0x5599('0x37')]=_0x3d43ae['attributes'][_0x5599('0x4a')]?_0x3d43ae['attributes']:_0x1f10df[_0x5599('0x33')];if(_0x474e4f[_0x5599('0x34')][_0x5599('0x43')]){_0x3d43ae[_0x5599('0x44')]=[{'all':!![]}];}_0x3d43ae=_[_0x5599('0x40')]({},_0x3d43ae,_0x474e4f[_0x5599('0x42')]);return db[_0x5599('0x2f')][_0x5599('0x4b')](_0x3d43ae)['then'](handleEntityNotFound(_0x408905,null))[_0x5599('0x25')](respondWithResult(_0x408905,null))[_0x5599('0x4c')](handleError(_0x408905,null));};exports[_0x5599('0x4d')]=function(_0x4bd014,_0xb53184){return db[_0x5599('0x2f')][_0x5599('0x4d')](_0x4bd014[_0x5599('0x4e')],{})[_0x5599('0x25')](respondWithResult(_0xb53184,0xc9))['catch'](handleError(_0xb53184,null));};exports['update']=function(_0x5185af,_0xabc154){if(_0x5185af[_0x5599('0x4e')]['id']){delete _0x5185af[_0x5599('0x4e')]['id'];}return db[_0x5599('0x2f')]['find']({'where':{'id':_0x5185af[_0x5599('0x47')]['id']}})[_0x5599('0x25')](handleEntityNotFound(_0xabc154,null))[_0x5599('0x25')](saveUpdates(_0x5185af[_0x5599('0x4e')],null))[_0x5599('0x25')](respondWithResult(_0xabc154,null))[_0x5599('0x4c')](handleError(_0xabc154,null));};exports[_0x5599('0x26')]=function(_0x231f55,_0x3cca33){return db[_0x5599('0x2f')][_0x5599('0x4b')]({'where':{'id':_0x231f55[_0x5599('0x47')]['id']}})[_0x5599('0x25')](handleEntityNotFound(_0x3cca33,null))[_0x5599('0x25')](removeEntity(_0x3cca33,null))[_0x5599('0x4c')](handleError(_0x3cca33,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 854aae9..f796fde 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 _0xe97e=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define','sms_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0xd598e9,_0x20cb54){var _0x12c224=function(_0x5046e1){while(--_0x5046e1){_0xd598e9['push'](_0xd598e9['shift']());}};_0x12c224(++_0x20cb54);}(_0xe97e,0xd0));var _0xee97=function(_0x15071f,_0x5eb780){_0x15071f=_0x15071f-0x0;var _0xe831e0=_0xe97e[_0x15071f];return _0xe831e0;};'use strict';var _=require(_0xee97('0x0'));var util=require(_0xee97('0x1'));var logger=require(_0xee97('0x2'))(_0xee97('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xee97('0x4'));var fs=require('fs');var path=require(_0xee97('0x5'));var rimraf=require(_0xee97('0x6'));var config=require(_0xee97('0x7'));var attributes=require(_0xee97('0x8'));module['exports']=function(_0x5a1c37,_0x42fe9f){return _0x5a1c37[_0xee97('0x9')]('SmsApplication',attributes,{'tableName':_0xee97('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xee97('0xb'),'collate':_0xee97('0xc')});}; \ No newline at end of file +var _0x636e=['request-promise','path','../../config/environment','./smsApplication.attributes','exports','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird'];(function(_0x4c0ac9,_0x540ed1){var _0x507a30=function(_0x11422a){while(--_0x11422a){_0x4c0ac9['push'](_0x4c0ac9['shift']());}};_0x507a30(++_0x540ed1);}(_0x636e,0x11b));var _0xe636=function(_0x28bc2e,_0x4930d1){_0x28bc2e=_0x28bc2e-0x0;var _0x53dc3a=_0x636e[_0x28bc2e];return _0x53dc3a;};'use strict';var _=require(_0xe636('0x0'));var util=require('util');var logger=require(_0xe636('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe636('0x2'));var rp=require(_0xe636('0x3'));var fs=require('fs');var path=require(_0xe636('0x4'));var rimraf=require('rimraf');var config=require(_0xe636('0x5'));var attributes=require(_0xe636('0x6'));module[_0xe636('0x7')]=function(_0x4b8e42,_0x429212){return _0x4b8e42['define'](_0xe636('0x8'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe636('0x9'),'collate':_0xe636('0xa')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 5bea4d8..c922702 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 _0x431b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x431b,0x18d));var _0xb431=function(_0xce3465,_0x2299f7){_0xce3465=_0xce3465-0x0;var _0x329e9e=_0x431b[_0xce3465];return _0x329e9e;};'use strict';var _=require(_0xb431('0x0'));var util=require(_0xb431('0x1'));var moment=require(_0xb431('0x2'));var BPromise=require('bluebird');var rs=require(_0xb431('0x3'));var fs=require('fs');var Redis=require(_0xb431('0x4'));var db=require(_0xb431('0x5'))['db'];var utils=require(_0xb431('0x6'));var logger=require(_0xb431('0x7'))(_0xb431('0x8'));var config=require(_0xb431('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb431('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fefc5,_0x58eb22,_0x5151a2){return new BPromise(function(_0x45adf2,_0x4a21dd){return client['request'](_0x2fefc5,_0x5151a2)[_0xb431('0xb')](function(_0x34cdb1){logger[_0xb431('0xc')](_0xb431('0xd'),_0x58eb22,_0xb431('0xe'));logger[_0xb431('0xf')](_0xb431('0x10'),_0x58eb22,'request\x20sent',JSON[_0xb431('0x11')](_0x34cdb1));if(_0x34cdb1[_0xb431('0x12')]){if(_0x34cdb1[_0xb431('0x12')]['code']===0x1f4){logger[_0xb431('0x12')](_0xb431('0xd'),_0x58eb22,_0x34cdb1[_0xb431('0x12')][_0xb431('0x13')]);return _0x4a21dd(_0x34cdb1[_0xb431('0x12')][_0xb431('0x13')]);}logger['error'](_0xb431('0xd'),_0x58eb22,_0x34cdb1['error'][_0xb431('0x13')]);return _0x45adf2(_0x34cdb1[_0xb431('0x12')][_0xb431('0x13')]);}else{logger[_0xb431('0xc')](_0xb431('0xd'),_0x58eb22,_0xb431('0xe'));_0x45adf2(_0x34cdb1['result'][_0xb431('0x13')]);}})['catch'](function(_0xc73c8a){logger[_0xb431('0x12')](_0xb431('0xd'),_0x58eb22,_0xc73c8a);_0x4a21dd(_0xc73c8a);});});} \ No newline at end of file +var _0x9ab9=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x166a40,_0x2da973){var _0x5d9dc2=function(_0x37a5e2){while(--_0x37a5e2){_0x166a40['push'](_0x166a40['shift']());}};_0x5d9dc2(++_0x2da973);}(_0x9ab9,0x19d));var _0x99ab=function(_0x3df223,_0x11a0c8){_0x3df223=_0x3df223-0x0;var _0x5f6e42=_0x9ab9[_0x3df223];return _0x5f6e42;};'use strict';var _=require(_0x99ab('0x0'));var util=require(_0x99ab('0x1'));var moment=require(_0x99ab('0x2'));var BPromise=require(_0x99ab('0x3'));var rs=require(_0x99ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99ab('0x5'))['db'];var utils=require(_0x99ab('0x6'));var logger=require('../../config/logger')(_0x99ab('0x7'));var config=require('../../config/environment');var jayson=require(_0x99ab('0x8'));var client=jayson[_0x99ab('0x9')][_0x99ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x249c1f,_0x1d2cb7,_0x513653){return new BPromise(function(_0x5762c1,_0x3f5a2c){return client[_0x99ab('0xb')](_0x249c1f,_0x513653)['then'](function(_0x14d083){logger[_0x99ab('0xc')](_0x99ab('0xd'),_0x1d2cb7,_0x99ab('0xe'));logger[_0x99ab('0xf')](_0x99ab('0x10'),_0x1d2cb7,'request\x20sent',JSON[_0x99ab('0x11')](_0x14d083));if(_0x14d083[_0x99ab('0x12')]){if(_0x14d083[_0x99ab('0x12')]['code']===0x1f4){logger['error'](_0x99ab('0xd'),_0x1d2cb7,_0x14d083[_0x99ab('0x12')][_0x99ab('0x13')]);return _0x3f5a2c(_0x14d083[_0x99ab('0x12')][_0x99ab('0x13')]);}logger[_0x99ab('0x12')]('SmsApplication,\x20%s,\x20%s',_0x1d2cb7,_0x14d083[_0x99ab('0x12')][_0x99ab('0x13')]);return _0x5762c1(_0x14d083['error'][_0x99ab('0x13')]);}else{logger[_0x99ab('0xc')](_0x99ab('0xd'),_0x1d2cb7,'request\x20sent');_0x5762c1(_0x14d083[_0x99ab('0x14')][_0x99ab('0x13')]);}})[_0x99ab('0x15')](function(_0x31b340){logger[_0x99ab('0x12')](_0x99ab('0xd'),_0x1d2cb7,_0x31b340);_0x3f5a2c(_0x31b340);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index cbf12c2..4c4d38f 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 _0xa571=['get','isAuthenticated','index','/describe','/:id','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xa571,0x107));var _0x1a57=function(_0x33e20e,_0x36a759){_0x33e20e=_0x33e20e-0x0;var _0x1578a6=_0xa571[_0x33e20e];return _0x1578a6;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./smsInteraction.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['describe']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')](_0x1a57('0xc'),auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),interaction['tracked'](_0x1a57('0x13'),_0x1a57('0x14')),controller[_0x1a57('0x15')]);router[_0x1a57('0x16')]('/:id',auth[_0x1a57('0x8')](),interaction['tracked']('sms',_0x1a57('0x17')),controller[_0x1a57('0x18')]);router[_0x1a57('0x19')]('/:id',auth[_0x1a57('0x8')](),interaction[_0x1a57('0x1a')](_0x1a57('0x13'),'smsinteraction:destroy'),controller[_0x1a57('0x1b')]);router[_0x1a57('0x19')](_0x1a57('0x1c'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x34b7=['/:id/tags','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','delete','destroy'];(function(_0x58fc2f,_0x111399){var _0x3a1312=function(_0x3d2ff2){while(--_0x3d2ff2){_0x58fc2f['push'](_0x58fc2f['shift']());}};_0x3a1312(++_0x111399);}(_0x34b7,0x196));var _0x734b=function(_0x11d541,_0xc8fe9){_0x11d541=_0x11d541-0x0;var _0x3e612a=_0x34b7[_0x11d541];return _0x3e612a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var fs_extra=require(_0x734b('0x4'));var auth=require(_0x734b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x734b('0x6'));router[_0x734b('0x7')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x9')]);router[_0x734b('0x7')](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xb')]);router[_0x734b('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x734b('0x7')]('/:id/messages',auth[_0x734b('0x8')](),controller[_0x734b('0xc')]);router[_0x734b('0x7')](_0x734b('0xd'),auth[_0x734b('0x8')](),controller[_0x734b('0xe')]);router[_0x734b('0xf')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x10')]);router[_0x734b('0xf')](_0x734b('0x11'),auth[_0x734b('0x8')](),controller[_0x734b('0x12')]);router[_0x734b('0xf')]('/:id/tags',auth[_0x734b('0x8')](),interaction[_0x734b('0x13')](_0x734b('0x14'),_0x734b('0x15')),controller[_0x734b('0x16')]);router[_0x734b('0x17')](_0x734b('0x18'),auth[_0x734b('0x8')](),interaction[_0x734b('0x13')](_0x734b('0x14'),_0x734b('0x19')),controller['update']);router[_0x734b('0x1a')](_0x734b('0x18'),auth[_0x734b('0x8')](),interaction[_0x734b('0x13')]('sms','smsinteraction:destroy'),controller[_0x734b('0x1b')]);router[_0x734b('0x1a')](_0x734b('0x1c'),auth[_0x734b('0x8')](),controller[_0x734b('0x1d')]);module[_0x734b('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 86248f4..72538b7 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 _0xb6f1=['sequelize','exports','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xb6f1,0x118));var _0x1b6f=function(_0x196e1b,_0x55fa06){_0x196e1b=_0x196e1b-0x0;var _0x5e1f18=_0xb6f1[_0x196e1b];return _0x5e1f18;};'use strict';var Sequelize=require(_0x1b6f('0x0'));var moment=require('moment');module[_0x1b6f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1b6f('0x2')]},'disposition':{'type':Sequelize[_0x1b6f('0x3')]},'secondDisposition':{'type':Sequelize[_0x1b6f('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1b6f('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x1b6f('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x1b6f('0x4')]('in',_0x1b6f('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1b6f('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1b6f('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xcb57=['sequelize','moment','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x5426a7,_0x1b0b27){var _0x216b6c=function(_0x370f07){while(--_0x370f07){_0x5426a7['push'](_0x5426a7['shift']());}};_0x216b6c(++_0x1b0b27);}(_0xcb57,0xa1));var _0x7cb5=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xcb57[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x7cb5('0x0'));var moment=require(_0x7cb5('0x1'));module['exports']={'closed':{'type':Sequelize[_0x7cb5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7cb5('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x7cb5('0x3')]},'note':{'type':Sequelize[_0x7cb5('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7cb5('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x7cb5('0x5')]('in',_0x7cb5('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7cb5('0x5')]('in',_0x7cb5('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7cb5('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index c1d4874..98895c9 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 _0xf183=['update','then','error','stack','name','send','index','map','SmsInteraction','type','key','getOptions','findAll','sms','query','user','show','params','keys','rawAttributes','filters','model','attributes','intersection','fields','includeAll','merge','options','find','catch','body','destroy','describe','SmsMessage','addMessage','omit','getMessages','length','hasOwnProperty','nolimit','order','sort','where','pick','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','ids','spread','Tag','color','emit','removeTags','download','toString','root','server','tmp','join','User','fullname','push','CmContact','Contact','firstName','lastName','Messages','createdAt','secret','SmsAccount','Account','Owner','mkdirSync','Sms','N.A.','closed','disposition','direction','out','System','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0x1032f2,_0x477191){var _0x59e5b6=function(_0x2c4b4b){while(--_0x2c4b4b){_0x1032f2['push'](_0x1032f2['shift']());}};_0x59e5b6(++_0x477191);}(_0xf183,0x1c3));var _0x3f18=function(_0x1cbf34,_0x418fd4){_0x1cbf34=_0x1cbf34-0x0;var _0x2a8a26=_0xf183[_0x1cbf34];return _0x2a8a26;};'use strict';var rimraf=require(_0x3f18('0x0'));var zipdir=require(_0x3f18('0x1'));var moment=require(_0x3f18('0x2'));var BPromise=require(_0x3f18('0x3'));var util=require(_0x3f18('0x4'));var path=require(_0x3f18('0x5'));var ejs=require(_0x3f18('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x3f18('0x7'));var qs=require(_0x3f18('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x3f18('0x9'))(_0x3f18('0xa'));var config=require(_0x3f18('0xb'));var db=require('../../mysqldb')['db'];config[_0x3f18('0xc')]=_['defaults'](config[_0x3f18('0xc')],{'host':_0x3f18('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3f18('0xe'))[_0x3f18('0xf')](socket);function respondWithStatusCode(_0x309be1,_0x1d5841){_0x1d5841=_0x1d5841||0xcc;return function(_0x22af22){if(_0x22af22){return _0x309be1[_0x3f18('0x10')](_0x1d5841);}return _0x309be1[_0x3f18('0x11')](_0x1d5841)[_0x3f18('0x12')]();};}function respondWithResult(_0x5c88ab,_0x54ff76){_0x54ff76=_0x54ff76||0xc8;return function(_0x5deff8){if(_0x5deff8){return _0x5c88ab[_0x3f18('0x11')](_0x54ff76)[_0x3f18('0x13')](_0x5deff8);}};}function respondWithFilteredResult(_0x4487db,_0x365ba3){return function(_0x469b8d){if(_0x469b8d){var _0x38e530=typeof _0x365ba3[_0x3f18('0x14')]==='undefined'&&typeof _0x365ba3[_0x3f18('0x15')]===_0x3f18('0x16');var _0x465225=_0x469b8d[_0x3f18('0x17')];var _0x6fbf0f=_0x38e530?0x0:_0x365ba3[_0x3f18('0x14')];var _0x1c3657=_0x38e530?_0x469b8d['count']:_0x365ba3[_0x3f18('0x14')]+_0x365ba3[_0x3f18('0x15')];var _0x532499;if(_0x1c3657>=_0x465225){_0x1c3657=_0x465225;_0x532499=0xc8;}else{_0x532499=0xce;}_0x4487db[_0x3f18('0x11')](_0x532499);return _0x4487db[_0x3f18('0x18')]('Content-Range',_0x6fbf0f+'-'+_0x1c3657+'/'+_0x465225)[_0x3f18('0x13')](_0x469b8d);}return null;};}function saveUpdates(_0x10348b){return function(_0x15ab45){if(_0x15ab45){return _0x15ab45[_0x3f18('0x19')](_0x10348b)[_0x3f18('0x1a')](function(_0x26341d){return _0x26341d;});}return null;};}function removeEntity(_0x5825c8){return function(_0x100ac1){if(_0x100ac1){return _0x100ac1['destroy']()[_0x3f18('0x1a')](function(){_0x5825c8[_0x3f18('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fdd4e){return function(_0x2fc946){if(!_0x2fc946){_0x4fdd4e[_0x3f18('0x10')](0x194);}return _0x2fc946;};}function handleError(_0x551e1c,_0x1d3e4b){_0x1d3e4b=_0x1d3e4b||0x1f4;return function(_0xa328f){logger[_0x3f18('0x1b')](_0xa328f[_0x3f18('0x1c')]);if(_0xa328f[_0x3f18('0x1d')]){delete _0xa328f['name'];}_0x551e1c[_0x3f18('0x11')](_0x1d3e4b)[_0x3f18('0x1e')](_0xa328f);};}exports[_0x3f18('0x1f')]=function(_0x4ba0fb,_0x4a3813){var _0x5b5e1e={};var _0x5ae0a8=_[_0x3f18('0x20')](db[_0x3f18('0x21')]['rawAttributes'],function(_0x2d77a0){return{'name':_0x2d77a0['fieldName'],'type':_0x2d77a0[_0x3f18('0x22')][_0x3f18('0x23')]};});_0x5b5e1e=qs[_0x3f18('0x24')](_0x5ae0a8,_0x4ba0fb);return interaction[_0x3f18('0x25')](_0x3f18('0x26'),_0x4ba0fb[_0x3f18('0x27')],_0x4ba0fb[_0x3f18('0x28')],_0x5b5e1e,_0x5ae0a8)['then'](respondWithFilteredResult(_0x4a3813,_0x5b5e1e))['catch'](handleError(_0x4a3813,null));};exports[_0x3f18('0x29')]=function(_0x49f615,_0x47dbe0){var _0x3eb188={'raw':![],'where':{'id':_0x49f615[_0x3f18('0x2a')]['id']}},_0x501a24={};_0x501a24['model']=_[_0x3f18('0x2b')](db[_0x3f18('0x21')][_0x3f18('0x2c')]);_0x501a24[_0x3f18('0x27')]=_[_0x3f18('0x2b')](_0x49f615[_0x3f18('0x27')]);_0x501a24[_0x3f18('0x2d')]=_['intersection'](_0x501a24[_0x3f18('0x2e')],_0x501a24[_0x3f18('0x27')]);_0x3eb188[_0x3f18('0x2f')]=_[_0x3f18('0x30')](_0x501a24['model'],qs[_0x3f18('0x31')](_0x49f615[_0x3f18('0x27')][_0x3f18('0x31')]));_0x3eb188[_0x3f18('0x2f')]=_0x3eb188[_0x3f18('0x2f')]['length']?_0x3eb188['attributes']:_0x501a24[_0x3f18('0x2e')];if(_0x49f615['query'][_0x3f18('0x32')]){_0x3eb188['include']=[{'all':!![]}];}_0x3eb188=_[_0x3f18('0x33')]({},_0x3eb188,_0x49f615[_0x3f18('0x34')]);return db[_0x3f18('0x21')][_0x3f18('0x35')](_0x3eb188)[_0x3f18('0x1a')](handleEntityNotFound(_0x47dbe0,null))['then'](respondWithResult(_0x47dbe0,null))[_0x3f18('0x36')](handleError(_0x47dbe0,null));};exports['create']=function(_0x1d2e18,_0x86a972){return db[_0x3f18('0x21')]['create'](_0x1d2e18['body'],{})[_0x3f18('0x1a')](respondWithResult(_0x86a972,0xc9))[_0x3f18('0x36')](handleError(_0x86a972,null));};exports[_0x3f18('0x19')]=function(_0x1530d1,_0x313ba1){if(_0x1530d1[_0x3f18('0x37')]['id']){delete _0x1530d1[_0x3f18('0x37')]['id'];}return db[_0x3f18('0x21')][_0x3f18('0x35')]({'where':{'id':_0x1530d1[_0x3f18('0x2a')]['id']}})[_0x3f18('0x1a')](handleEntityNotFound(_0x313ba1,null))[_0x3f18('0x1a')](saveUpdates(_0x1530d1['body'],null))[_0x3f18('0x1a')](respondWithResult(_0x313ba1,null))[_0x3f18('0x36')](handleError(_0x313ba1,null));};exports[_0x3f18('0x38')]=function(_0x102a33,_0x43c753){return db['SmsInteraction'][_0x3f18('0x35')]({'where':{'id':_0x102a33[_0x3f18('0x2a')]['id']}})[_0x3f18('0x1a')](handleEntityNotFound(_0x43c753,null))[_0x3f18('0x1a')](removeEntity(_0x43c753,null))[_0x3f18('0x36')](handleError(_0x43c753,null));};exports['describe']=function(_0x55b0a6,_0x2eb42a){return db[_0x3f18('0x21')][_0x3f18('0x39')]()[_0x3f18('0x1a')](respondWithResult(_0x2eb42a,null))[_0x3f18('0x36')](handleError(_0x2eb42a,null));};exports['addMessage']=function(_0x41efb3,_0x3f5b3e){return db[_0x3f18('0x3a')][_0x3f18('0x35')]({'where':{'id':_0x41efb3[_0x3f18('0x2a')]['id']}})[_0x3f18('0x1a')](handleEntityNotFound(_0x3f5b3e,null))[_0x3f18('0x1a')](function(_0x4690cc){if(_0x4690cc){return _0x4690cc[_0x3f18('0x3b')](_0x41efb3[_0x3f18('0x37')]['ids'],_[_0x3f18('0x3c')](_0x41efb3[_0x3f18('0x37')],['ids','id'])||{});}})['then'](respondWithResult(_0x3f5b3e,null))[_0x3f18('0x36')](handleError(_0x3f5b3e,null));};exports[_0x3f18('0x3d')]=function(_0x2c634e,_0x584e30){var _0x2c83f7={'raw':![],'where':{}};var _0x5d8f4a={};var _0x254495={'count':0x0,'rows':[]};return db[_0x3f18('0x21')]['findOne']({'where':{'id':_0x2c634e['params']['id']}})[_0x3f18('0x1a')](handleEntityNotFound(_0x584e30,null))[_0x3f18('0x1a')](function(_0x4a92a2){if(_0x4a92a2){_0x5d8f4a[_0x3f18('0x2e')]=_[_0x3f18('0x2b')](db[_0x3f18('0x3a')][_0x3f18('0x2c')]);_0x5d8f4a[_0x3f18('0x27')]=_[_0x3f18('0x2b')](_0x2c634e[_0x3f18('0x27')]);_0x5d8f4a[_0x3f18('0x2d')]=_['intersection'](_0x5d8f4a['model'],_0x5d8f4a['query']);_0x2c83f7[_0x3f18('0x2f')]=_[_0x3f18('0x30')](_0x5d8f4a[_0x3f18('0x2e')],qs[_0x3f18('0x31')](_0x2c634e[_0x3f18('0x27')][_0x3f18('0x31')]));_0x2c83f7[_0x3f18('0x2f')]=_0x2c83f7[_0x3f18('0x2f')][_0x3f18('0x3e')]?_0x2c83f7[_0x3f18('0x2f')]:_0x5d8f4a[_0x3f18('0x2e')];if(!_0x2c634e['query'][_0x3f18('0x3f')](_0x3f18('0x40'))){_0x2c83f7[_0x3f18('0x15')]=qs[_0x3f18('0x15')](_0x2c634e[_0x3f18('0x27')][_0x3f18('0x15')]);_0x2c83f7[_0x3f18('0x14')]=qs[_0x3f18('0x14')](_0x2c634e[_0x3f18('0x27')][_0x3f18('0x14')]);}_0x2c83f7[_0x3f18('0x41')]=qs['sort'](_0x2c634e[_0x3f18('0x27')][_0x3f18('0x42')]);_0x2c83f7[_0x3f18('0x43')]=qs[_0x3f18('0x2d')](_[_0x3f18('0x44')](_0x2c634e[_0x3f18('0x27')],_0x5d8f4a[_0x3f18('0x2d')]));_0x2c83f7[_0x3f18('0x43')][_0x3f18('0x45')]=_0x4a92a2['id'];if(_0x2c634e[_0x3f18('0x27')][_0x3f18('0x46')]){_0x2c83f7['where']=_[_0x3f18('0x33')](_0x2c83f7[_0x3f18('0x43')],{'$or':_[_0x3f18('0x20')](_0x2c83f7[_0x3f18('0x2f')],function(_0x3d1678){var _0x278a2d={};_0x278a2d[_0x3d1678]={'$like':'%'+_0x2c634e['query'][_0x3f18('0x46')]+'%'};return _0x278a2d;})});}if(_0x2c634e[_0x3f18('0x27')]['$gte']){var _0x23e9fe=_0x2c634e[_0x3f18('0x27')][_0x3f18('0x47')][_0x3f18('0x48')](',');var _0xfc8428={};_0xfc8428[_0x23e9fe[0x0]]={'$gte':moment(_0x23e9fe[0x1])[_0x3f18('0x49')](_0x3f18('0x4a'))};_0x2c83f7[_0x3f18('0x43')]=_[_0x3f18('0x33')](_0x2c83f7[_0x3f18('0x43')],_0xfc8428);}_0x2c83f7=_['merge']({},_0x2c83f7,_0x2c634e['options']);return db[_0x3f18('0x3a')][_0x3f18('0x17')]({'where':_0x2c83f7[_0x3f18('0x43')]})[_0x3f18('0x1a')](function(_0x3d5aec){_0x254495[_0x3f18('0x17')]=_0x3d5aec;if(_0x2c634e[_0x3f18('0x27')][_0x3f18('0x32')]){_0x2c83f7[_0x3f18('0x4b')]=[{'all':!![]}];}return db[_0x3f18('0x3a')][_0x3f18('0x25')](_0x2c83f7);})[_0x3f18('0x1a')](function(_0x52cf84){_0x254495[_0x3f18('0x4c')]=_0x52cf84;return _0x254495;});}})[_0x3f18('0x1a')](respondWithFilteredResult(_0x584e30,_0x2c83f7))[_0x3f18('0x36')](handleError(_0x584e30,null));};exports[_0x3f18('0x4d')]=function(_0x3a4136,_0xda1fd1){return db[_0x3f18('0x21')][_0x3f18('0x35')]({'where':{'id':_0x3a4136['params']['id']}})[_0x3f18('0x1a')](handleEntityNotFound(_0xda1fd1,null))[_0x3f18('0x1a')](function(_0xeb3a2c){if(_0xeb3a2c){return _0xeb3a2c['setTags'](_0x3a4136[_0x3f18('0x37')][_0x3f18('0x4e')],_[_0x3f18('0x3c')](_0x3a4136[_0x3f18('0x37')],[_0x3f18('0x4e'),'id'])||{})[_0x3f18('0x4f')](function(){return db[_0x3f18('0x50')]['findAll']({'attributes':['id',_0x3f18('0x1d'),_0x3f18('0x51')],'where':{'id':_0x3a4136[_0x3f18('0x37')][_0x3f18('0x4e')]}});})[_0x3f18('0x1a')](function(_0x2f9c56){socket[_0x3f18('0x52')]('smsInteractionTags:save',{'id':Number(_0x3a4136[_0x3f18('0x2a')]['id']),'tags':_0x2f9c56||[]});return{'id':Number(_0x3a4136[_0x3f18('0x2a')]['id']),'tags':_0x2f9c56||[]};});}})[_0x3f18('0x1a')](respondWithResult(_0xda1fd1,null))['catch'](handleError(_0xda1fd1,null));};exports[_0x3f18('0x53')]=function(_0x212fca,_0x53e61d){return db[_0x3f18('0x21')][_0x3f18('0x35')]({'where':{'id':_0x212fca[_0x3f18('0x2a')]['id']}})[_0x3f18('0x1a')](handleEntityNotFound(_0x53e61d,null))[_0x3f18('0x1a')](function(_0x350587){if(_0x350587){return _0x350587[_0x3f18('0x53')](_0x212fca[_0x3f18('0x27')][_0x3f18('0x4e')]);}})[_0x3f18('0x1a')](respondWithStatusCode(_0x53e61d,null))[_0x3f18('0x36')](handleError(_0x53e61d,null));};exports[_0x3f18('0x54')]=function(_0x9fafdd,_0x561338){var _0x53dfb6=moment()['unix']()[_0x3f18('0x55')]();var _0x14b1cd=path['join'](config[_0x3f18('0x56')],_0x3f18('0x57'),'files',_0x3f18('0x58'));var _0x3da628=path[_0x3f18('0x59')](_0x14b1cd,_0x53dfb6);var _0x359162=util[_0x3f18('0x49')]('transcript-%d-%s.zip',_0x9fafdd[_0x3f18('0x2a')]['id'],_0x53dfb6);var _0x3614ab=path[_0x3f18('0x59')](_0x14b1cd,_0x359162);var _0x3573dc=[];_0x3573dc['push']({'model':db[_0x3f18('0x5a')],'as':'User','attributes':['id',_0x3f18('0x5b')],'raw':!![]});_0x3573dc[_0x3f18('0x5c')]({'model':db[_0x3f18('0x5d')],'as':_0x3f18('0x5e'),'attributes':['id',_0x3f18('0x5f'),_0x3f18('0x60')],'raw':!![]});var _0x1503b0=[{'model':db['SmsMessage'],'as':_0x3f18('0x61'),'attributes':['id','body',_0x3f18('0x62'),'direction',_0x3f18('0x63'),'read'],'include':_0x3573dc}];_0x1503b0[_0x3f18('0x5c')]({'model':db[_0x3f18('0x64')],'as':_0x3f18('0x65'),'attributes':['id','name']});_0x1503b0[_0x3f18('0x5c')]({'model':db[_0x3f18('0x5a')],'as':_0x3f18('0x66'),'attributes':['id',_0x3f18('0x5b')]});return db[_0x3f18('0x21')][_0x3f18('0x35')]({'where':{'id':_0x9fafdd['params']['id']},'include':_0x1503b0})['then'](handleEntityNotFound(_0x561338,null))[_0x3f18('0x1a')](function(_0x2242c6){if(_0x2242c6){var _0x570b5a=_0x2242c6['get']({'plain':!![]});fs[_0x3f18('0x67')](_0x3da628);var _0x58a412={'channel':_0x3f18('0x68'),'account':_0x570b5a[_0x3f18('0x65')][_0x3f18('0x1d')],'agent':_0x570b5a[_0x3f18('0x66')]?_0x570b5a[_0x3f18('0x66')][_0x3f18('0x5b')]:_0x3f18('0x69'),'createdAt':moment(_0x570b5a[_0x3f18('0x62')])[_0x3f18('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3f18('0x55')](),'closedAt':_0x570b5a[_0x3f18('0x6a')]?moment(_0x570b5a['closedAt'])[_0x3f18('0x49')](_0x3f18('0x4a'))['toString']():'','disposition':_0x570b5a[_0x3f18('0x6b')],'messages':_(_0x570b5a[_0x3f18('0x61')])['filter']({'secret':![]})[_0x3f18('0x20')](function(_0x6cf162){return{'date':moment(_0x6cf162['createdAt'])['format'](_0x3f18('0x4a'))[_0x3f18('0x55')](),'sender':_0x6cf162[_0x3f18('0x6c')]===_0x3f18('0x6d')?_0x6cf162[_0x3f18('0x5a')]?_0x6cf162[_0x3f18('0x5a')][_0x3f18('0x5b')]:_0x3f18('0x6e'):_0x6cf162[_0x3f18('0x5e')][_0x3f18('0x5f')]+(_0x6cf162[_0x3f18('0x5e')][_0x3f18('0x60')]?'\x20'+_0x6cf162[_0x3f18('0x5e')][_0x3f18('0x60')]:''),'body':_0x6cf162[_0x3f18('0x37')],'direction':_0x6cf162['direction']===_0x3f18('0x6d')?'A':'C','secret':_0x6cf162['secret'],'read':_0x6cf162['read']};})[_0x3f18('0x6f')]()};return ejs[_0x3f18('0x70')](path[_0x3f18('0x59')](config[_0x3f18('0x56')],_0x3f18('0x57'),'views',_0x3f18('0x71')),{'interaction':_0x58a412})[_0x3f18('0x1a')](function(_0x4dbe60){var _0x103d1c=path[_0x3f18('0x59')](_0x3da628,_0x3f18('0x72')+_0x570b5a['id']+'-'+_0x53dfb6+_0x3f18('0x73'));var _0x11c05d={'path':_0x103d1c,'channel':_0x3f18('0x68'),'interactionId':_0x570b5a['id']};return pdf[_0x3f18('0x74')](_0x4dbe60,_0x11c05d);})[_0x3f18('0x1a')](function(){return new BPromise(function(_0x2be338,_0x17a558){zipdir(_0x3da628,{'saveTo':_0x3614ab},function(_0x3e3399,_0x259c41){if(_0x3e3399)return _0x17a558(_0x3e3399);return _0x2be338(_0x259c41);});})[_0x3f18('0x1a')](function(){return new BPromise(function(_0x1236c3,_0x30a305){rimraf(_0x3da628,function(_0xbc2d8a){if(_0xbc2d8a)_0x30a305(_0xbc2d8a);return _0x1236c3();});});})[_0x3f18('0x1a')](function(){return _0x561338['download'](_0x3614ab,_0x359162,function(_0x165f54){if(_0x165f54){console[_0x3f18('0x75')]('err',_0x165f54);}else{fs[_0x3f18('0x76')](_0x3614ab);}});});});}else{return _0x561338[_0x3f18('0x10')](0xc8);}})[_0x3f18('0x36')](handleError(_0x561338,null));}; \ No newline at end of file +var _0xa1cc=['format','transcript-%d-%s.zip','push','User','CmContact','firstName','lastName','Messages','createdAt','direction','read','SmsAccount','mkdirSync','Account','Owner','N.A.','fullname','System','Contact','out','secret','value','renderFile','views','downloadInteraction.ejs','.pdf','Sms','createPdfFromHTML','download','log','err','rimraf','zip-dir','moment','bluebird','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','defaults','localhost','register','sendStatus','status','end','offset','undefined','limit','Content-Range','json','update','then','destroy','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','user','catch','show','params','model','keys','filters','attributes','intersection','fields','includeAll','include','merge','options','create','body','find','describe','addMessage','SmsMessage','ids','omit','getMessages','length','hasOwnProperty','nolimit','order','sort','where','SmsInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','rows','addTags','spread','Tag','emit','smsInteractionTags:save','removeTags','toString','join','root','server','tmp'];(function(_0x558b68,_0x240b9c){var _0x3d466b=function(_0x12adf1){while(--_0x12adf1){_0x558b68['push'](_0x558b68['shift']());}};_0x3d466b(++_0x240b9c);}(_0xa1cc,0x93));var _0xca1c=function(_0x2e94a4,_0x357d86){_0x2e94a4=_0x2e94a4-0x0;var _0x147dc1=_0xa1cc[_0x2e94a4];return _0x147dc1;};'use strict';var rimraf=require(_0xca1c('0x0'));var zipdir=require(_0xca1c('0x1'));var moment=require(_0xca1c('0x2'));var BPromise=require(_0xca1c('0x3'));var util=require('util');var path=require('path');var ejs=require(_0xca1c('0x4'));var fs=require('fs');var _=require(_0xca1c('0x5'));var Redis=require(_0xca1c('0x6'));var interaction=require(_0xca1c('0x7'));var qs=require(_0xca1c('0x8'));var pdf=require(_0xca1c('0x9'));var logger=require(_0xca1c('0xa'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xca1c('0xb')](config['redis'],{'host':_0xca1c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')[_0xca1c('0xd')](socket);function respondWithStatusCode(_0x3a0fcb,_0x338b56){_0x338b56=_0x338b56||0xcc;return function(_0x521250){if(_0x521250){return _0x3a0fcb[_0xca1c('0xe')](_0x338b56);}return _0x3a0fcb[_0xca1c('0xf')](_0x338b56)[_0xca1c('0x10')]();};}function respondWithResult(_0x301986,_0x216573){_0x216573=_0x216573||0xc8;return function(_0x4f9698){if(_0x4f9698){return _0x301986[_0xca1c('0xf')](_0x216573)['json'](_0x4f9698);}};}function respondWithFilteredResult(_0x3d711f,_0x35745e){return function(_0x1c3fc8){if(_0x1c3fc8){var _0x463d3d=typeof _0x35745e[_0xca1c('0x11')]===_0xca1c('0x12')&&typeof _0x35745e[_0xca1c('0x13')]==='undefined';var _0x16e9b2=_0x1c3fc8['count'];var _0x140c53=_0x463d3d?0x0:_0x35745e[_0xca1c('0x11')];var _0x2d457e=_0x463d3d?_0x1c3fc8['count']:_0x35745e[_0xca1c('0x11')]+_0x35745e['limit'];var _0x353978;if(_0x2d457e>=_0x16e9b2){_0x2d457e=_0x16e9b2;_0x353978=0xc8;}else{_0x353978=0xce;}_0x3d711f[_0xca1c('0xf')](_0x353978);return _0x3d711f['set'](_0xca1c('0x14'),_0x140c53+'-'+_0x2d457e+'/'+_0x16e9b2)[_0xca1c('0x15')](_0x1c3fc8);}return null;};}function saveUpdates(_0x44e085){return function(_0x54a81f){if(_0x54a81f){return _0x54a81f[_0xca1c('0x16')](_0x44e085)[_0xca1c('0x17')](function(_0x22fa24){return _0x22fa24;});}return null;};}function removeEntity(_0x573a2b){return function(_0x380170){if(_0x380170){return _0x380170[_0xca1c('0x18')]()[_0xca1c('0x17')](function(){_0x573a2b[_0xca1c('0xf')](0xcc)[_0xca1c('0x10')]();});}};}function handleEntityNotFound(_0x51105e){return function(_0x3bd99e){if(!_0x3bd99e){_0x51105e['sendStatus'](0x194);}return _0x3bd99e;};}function handleError(_0x5c60a3,_0x10ac62){_0x10ac62=_0x10ac62||0x1f4;return function(_0x15ea31){logger['error'](_0x15ea31['stack']);if(_0x15ea31[_0xca1c('0x19')]){delete _0x15ea31['name'];}_0x5c60a3[_0xca1c('0xf')](_0x10ac62)[_0xca1c('0x1a')](_0x15ea31);};}exports[_0xca1c('0x1b')]=function(_0xcc34ca,_0x43fcbb){var _0x1dc62d={};var _0x179e21=_[_0xca1c('0x1c')](db[_0xca1c('0x1d')][_0xca1c('0x1e')],function(_0x5a7c4e){return{'name':_0x5a7c4e[_0xca1c('0x1f')],'type':_0x5a7c4e[_0xca1c('0x20')][_0xca1c('0x21')]};});_0x1dc62d=qs[_0xca1c('0x22')](_0x179e21,_0xcc34ca);return interaction[_0xca1c('0x23')](_0xca1c('0x24'),_0xcc34ca[_0xca1c('0x25')],_0xcc34ca[_0xca1c('0x26')],_0x1dc62d,_0x179e21)[_0xca1c('0x17')](respondWithFilteredResult(_0x43fcbb,_0x1dc62d))[_0xca1c('0x27')](handleError(_0x43fcbb,null));};exports[_0xca1c('0x28')]=function(_0x2a1a50,_0x8c84eb){var _0x2570cb={'raw':![],'where':{'id':_0x2a1a50[_0xca1c('0x29')]['id']}},_0x4bb922={};_0x4bb922[_0xca1c('0x2a')]=_[_0xca1c('0x2b')](db[_0xca1c('0x1d')]['rawAttributes']);_0x4bb922[_0xca1c('0x25')]=_[_0xca1c('0x2b')](_0x2a1a50['query']);_0x4bb922[_0xca1c('0x2c')]=_['intersection'](_0x4bb922[_0xca1c('0x2a')],_0x4bb922[_0xca1c('0x25')]);_0x2570cb[_0xca1c('0x2d')]=_[_0xca1c('0x2e')](_0x4bb922[_0xca1c('0x2a')],qs[_0xca1c('0x2f')](_0x2a1a50[_0xca1c('0x25')][_0xca1c('0x2f')]));_0x2570cb[_0xca1c('0x2d')]=_0x2570cb[_0xca1c('0x2d')]['length']?_0x2570cb[_0xca1c('0x2d')]:_0x4bb922['model'];if(_0x2a1a50['query'][_0xca1c('0x30')]){_0x2570cb[_0xca1c('0x31')]=[{'all':!![]}];}_0x2570cb=_[_0xca1c('0x32')]({},_0x2570cb,_0x2a1a50[_0xca1c('0x33')]);return db['SmsInteraction']['find'](_0x2570cb)[_0xca1c('0x17')](handleEntityNotFound(_0x8c84eb,null))['then'](respondWithResult(_0x8c84eb,null))[_0xca1c('0x27')](handleError(_0x8c84eb,null));};exports[_0xca1c('0x34')]=function(_0x1889d1,_0x2ac034){return db[_0xca1c('0x1d')][_0xca1c('0x34')](_0x1889d1[_0xca1c('0x35')],{})[_0xca1c('0x17')](respondWithResult(_0x2ac034,0xc9))[_0xca1c('0x27')](handleError(_0x2ac034,null));};exports['update']=function(_0x107197,_0x57ac07){if(_0x107197[_0xca1c('0x35')]['id']){delete _0x107197[_0xca1c('0x35')]['id'];}return db[_0xca1c('0x1d')][_0xca1c('0x36')]({'where':{'id':_0x107197[_0xca1c('0x29')]['id']}})[_0xca1c('0x17')](handleEntityNotFound(_0x57ac07,null))[_0xca1c('0x17')](saveUpdates(_0x107197['body'],null))['then'](respondWithResult(_0x57ac07,null))['catch'](handleError(_0x57ac07,null));};exports[_0xca1c('0x18')]=function(_0x4c9b0e,_0x8184f2){return db[_0xca1c('0x1d')][_0xca1c('0x36')]({'where':{'id':_0x4c9b0e['params']['id']}})[_0xca1c('0x17')](handleEntityNotFound(_0x8184f2,null))['then'](removeEntity(_0x8184f2,null))[_0xca1c('0x27')](handleError(_0x8184f2,null));};exports['describe']=function(_0x3d0c41,_0x1a7e61){return db[_0xca1c('0x1d')][_0xca1c('0x37')]()[_0xca1c('0x17')](respondWithResult(_0x1a7e61,null))[_0xca1c('0x27')](handleError(_0x1a7e61,null));};exports[_0xca1c('0x38')]=function(_0x566795,_0x5cf269){return db[_0xca1c('0x39')][_0xca1c('0x36')]({'where':{'id':_0x566795['params']['id']}})['then'](handleEntityNotFound(_0x5cf269,null))[_0xca1c('0x17')](function(_0x29c80b){if(_0x29c80b){return _0x29c80b[_0xca1c('0x38')](_0x566795[_0xca1c('0x35')][_0xca1c('0x3a')],_[_0xca1c('0x3b')](_0x566795[_0xca1c('0x35')],[_0xca1c('0x3a'),'id'])||{});}})['then'](respondWithResult(_0x5cf269,null))['catch'](handleError(_0x5cf269,null));};exports[_0xca1c('0x3c')]=function(_0x5cf68a,_0x582d1e){var _0x97ae6e={'raw':![],'where':{}};var _0x10c020={};var _0x15446d={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x5cf68a[_0xca1c('0x29')]['id']}})[_0xca1c('0x17')](handleEntityNotFound(_0x582d1e,null))['then'](function(_0x534899){if(_0x534899){_0x10c020[_0xca1c('0x2a')]=_[_0xca1c('0x2b')](db['SmsMessage'][_0xca1c('0x1e')]);_0x10c020[_0xca1c('0x25')]=_['keys'](_0x5cf68a['query']);_0x10c020[_0xca1c('0x2c')]=_['intersection'](_0x10c020['model'],_0x10c020[_0xca1c('0x25')]);_0x97ae6e[_0xca1c('0x2d')]=_['intersection'](_0x10c020['model'],qs['fields'](_0x5cf68a[_0xca1c('0x25')][_0xca1c('0x2f')]));_0x97ae6e[_0xca1c('0x2d')]=_0x97ae6e[_0xca1c('0x2d')][_0xca1c('0x3d')]?_0x97ae6e['attributes']:_0x10c020[_0xca1c('0x2a')];if(!_0x5cf68a[_0xca1c('0x25')][_0xca1c('0x3e')](_0xca1c('0x3f'))){_0x97ae6e[_0xca1c('0x13')]=qs[_0xca1c('0x13')](_0x5cf68a[_0xca1c('0x25')][_0xca1c('0x13')]);_0x97ae6e['offset']=qs[_0xca1c('0x11')](_0x5cf68a[_0xca1c('0x25')]['offset']);}_0x97ae6e[_0xca1c('0x40')]=qs[_0xca1c('0x41')](_0x5cf68a[_0xca1c('0x25')]['sort']);_0x97ae6e[_0xca1c('0x42')]=qs[_0xca1c('0x2c')](_['pick'](_0x5cf68a[_0xca1c('0x25')],_0x10c020[_0xca1c('0x2c')]));_0x97ae6e['where'][_0xca1c('0x43')]=_0x534899['id'];if(_0x5cf68a[_0xca1c('0x25')][_0xca1c('0x44')]){_0x97ae6e[_0xca1c('0x42')]=_[_0xca1c('0x32')](_0x97ae6e[_0xca1c('0x42')],{'$or':_[_0xca1c('0x1c')](_0x97ae6e[_0xca1c('0x2d')],function(_0x521e0f){var _0x3330ba={};_0x3330ba[_0x521e0f]={'$like':'%'+_0x5cf68a['query'][_0xca1c('0x44')]+'%'};return _0x3330ba;})});}if(_0x5cf68a['query'][_0xca1c('0x45')]){var _0x3e5b6d=_0x5cf68a[_0xca1c('0x25')][_0xca1c('0x45')][_0xca1c('0x46')](',');var _0x5c7308={};_0x5c7308[_0x3e5b6d[0x0]]={'$gte':moment(_0x3e5b6d[0x1])['format'](_0xca1c('0x47'))};_0x97ae6e['where']=_[_0xca1c('0x32')](_0x97ae6e[_0xca1c('0x42')],_0x5c7308);}_0x97ae6e=_['merge']({},_0x97ae6e,_0x5cf68a[_0xca1c('0x33')]);return db[_0xca1c('0x39')][_0xca1c('0x48')]({'where':_0x97ae6e[_0xca1c('0x42')]})[_0xca1c('0x17')](function(_0x2f3e5d){_0x15446d[_0xca1c('0x48')]=_0x2f3e5d;if(_0x5cf68a['query'][_0xca1c('0x30')]){_0x97ae6e['include']=[{'all':!![]}];}return db[_0xca1c('0x39')][_0xca1c('0x23')](_0x97ae6e);})[_0xca1c('0x17')](function(_0x1da34b){_0x15446d[_0xca1c('0x49')]=_0x1da34b;return _0x15446d;});}})['then'](respondWithFilteredResult(_0x582d1e,_0x97ae6e))[_0xca1c('0x27')](handleError(_0x582d1e,null));};exports[_0xca1c('0x4a')]=function(_0xd38ae4,_0x56aae0){return db[_0xca1c('0x1d')][_0xca1c('0x36')]({'where':{'id':_0xd38ae4[_0xca1c('0x29')]['id']}})['then'](handleEntityNotFound(_0x56aae0,null))[_0xca1c('0x17')](function(_0x12ac03){if(_0x12ac03){return _0x12ac03['setTags'](_0xd38ae4[_0xca1c('0x35')][_0xca1c('0x3a')],_[_0xca1c('0x3b')](_0xd38ae4['body'],[_0xca1c('0x3a'),'id'])||{})[_0xca1c('0x4b')](function(){return db[_0xca1c('0x4c')]['findAll']({'attributes':['id',_0xca1c('0x19'),'color'],'where':{'id':_0xd38ae4[_0xca1c('0x35')][_0xca1c('0x3a')]}});})[_0xca1c('0x17')](function(_0x281867){socket[_0xca1c('0x4d')](_0xca1c('0x4e'),{'id':Number(_0xd38ae4['params']['id']),'tags':_0x281867||[]});return{'id':Number(_0xd38ae4[_0xca1c('0x29')]['id']),'tags':_0x281867||[]};});}})[_0xca1c('0x17')](respondWithResult(_0x56aae0,null))['catch'](handleError(_0x56aae0,null));};exports[_0xca1c('0x4f')]=function(_0x4c43fc,_0x5d1936){return db[_0xca1c('0x1d')]['find']({'where':{'id':_0x4c43fc['params']['id']}})['then'](handleEntityNotFound(_0x5d1936,null))['then'](function(_0x2f2d63){if(_0x2f2d63){return _0x2f2d63[_0xca1c('0x4f')](_0x4c43fc[_0xca1c('0x25')][_0xca1c('0x3a')]);}})[_0xca1c('0x17')](respondWithStatusCode(_0x5d1936,null))[_0xca1c('0x27')](handleError(_0x5d1936,null));};exports['download']=function(_0x53a753,_0x4235ee){var _0x1dfb49=moment()['unix']()[_0xca1c('0x50')]();var _0x32bb75=path[_0xca1c('0x51')](config[_0xca1c('0x52')],_0xca1c('0x53'),'files',_0xca1c('0x54'));var _0x561ddb=path[_0xca1c('0x51')](_0x32bb75,_0x1dfb49);var _0x54b0f4=util[_0xca1c('0x55')](_0xca1c('0x56'),_0x53a753[_0xca1c('0x29')]['id'],_0x1dfb49);var _0x3c47de=path[_0xca1c('0x51')](_0x32bb75,_0x54b0f4);var _0x58f3f5=[];_0x58f3f5[_0xca1c('0x57')]({'model':db[_0xca1c('0x58')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x58f3f5[_0xca1c('0x57')]({'model':db[_0xca1c('0x59')],'as':'Contact','attributes':['id',_0xca1c('0x5a'),_0xca1c('0x5b')],'raw':!![]});var _0x159dfe=[{'model':db[_0xca1c('0x39')],'as':_0xca1c('0x5c'),'attributes':['id',_0xca1c('0x35'),_0xca1c('0x5d'),_0xca1c('0x5e'),'secret',_0xca1c('0x5f')],'include':_0x58f3f5}];_0x159dfe['push']({'model':db[_0xca1c('0x60')],'as':'Account','attributes':['id',_0xca1c('0x19')]});_0x159dfe[_0xca1c('0x57')]({'model':db[_0xca1c('0x58')],'as':'Owner','attributes':['id','fullname']});return db['SmsInteraction'][_0xca1c('0x36')]({'where':{'id':_0x53a753['params']['id']},'include':_0x159dfe})[_0xca1c('0x17')](handleEntityNotFound(_0x4235ee,null))[_0xca1c('0x17')](function(_0x344ef6){if(_0x344ef6){var _0x501d7a=_0x344ef6['get']({'plain':!![]});fs[_0xca1c('0x61')](_0x561ddb);var _0x45d95a={'channel':'Sms','account':_0x501d7a[_0xca1c('0x62')][_0xca1c('0x19')],'agent':_0x501d7a[_0xca1c('0x63')]?_0x501d7a[_0xca1c('0x63')]['fullname']:_0xca1c('0x64'),'createdAt':moment(_0x501d7a[_0xca1c('0x5d')])[_0xca1c('0x55')](_0xca1c('0x47'))[_0xca1c('0x50')](),'closedAt':_0x501d7a['closed']?moment(_0x501d7a['closedAt'])[_0xca1c('0x55')]('YYYY-MM-DD\x20HH:mm:ss')[_0xca1c('0x50')]():'','disposition':_0x501d7a['disposition'],'messages':_(_0x501d7a[_0xca1c('0x5c')])[_0xca1c('0x44')]({'secret':![]})[_0xca1c('0x1c')](function(_0x2f0e66){return{'date':moment(_0x2f0e66[_0xca1c('0x5d')])[_0xca1c('0x55')]('YYYY-MM-DD\x20HH:mm:ss')[_0xca1c('0x50')](),'sender':_0x2f0e66[_0xca1c('0x5e')]==='out'?_0x2f0e66[_0xca1c('0x58')]?_0x2f0e66[_0xca1c('0x58')][_0xca1c('0x65')]:_0xca1c('0x66'):_0x2f0e66['Contact'][_0xca1c('0x5a')]+(_0x2f0e66[_0xca1c('0x67')][_0xca1c('0x5b')]?'\x20'+_0x2f0e66[_0xca1c('0x67')][_0xca1c('0x5b')]:''),'body':_0x2f0e66[_0xca1c('0x35')],'direction':_0x2f0e66['direction']===_0xca1c('0x68')?'A':'C','secret':_0x2f0e66[_0xca1c('0x69')],'read':_0x2f0e66[_0xca1c('0x5f')]};})[_0xca1c('0x6a')]()};return ejs[_0xca1c('0x6b')](path[_0xca1c('0x51')](config[_0xca1c('0x52')],'server',_0xca1c('0x6c'),_0xca1c('0x6d')),{'interaction':_0x45d95a})['then'](function(_0x223810){var _0x30fe94=path['join'](_0x561ddb,'transcript-'+_0x501d7a['id']+'-'+_0x1dfb49+_0xca1c('0x6e'));var _0x40ca63={'path':_0x30fe94,'channel':_0xca1c('0x6f'),'interactionId':_0x501d7a['id']};return pdf[_0xca1c('0x70')](_0x223810,_0x40ca63);})[_0xca1c('0x17')](function(){return new BPromise(function(_0x3ec378,_0x186e85){zipdir(_0x561ddb,{'saveTo':_0x3c47de},function(_0x138bad,_0x6e7e62){if(_0x138bad)return _0x186e85(_0x138bad);return _0x3ec378(_0x6e7e62);});})[_0xca1c('0x17')](function(){return new BPromise(function(_0x158549,_0x5863b2){rimraf(_0x561ddb,function(_0x2cc574){if(_0x2cc574)_0x5863b2(_0x2cc574);return _0x158549();});});})['then'](function(){return _0x4235ee[_0xca1c('0x71')](_0x3c47de,_0x54b0f4,function(_0x307ff6){if(_0x307ff6){console[_0xca1c('0x72')](_0xca1c('0x73'),_0x307ff6);}else{fs['unlinkSync'](_0x3c47de);}});});});}else{return _0x4235ee['sendStatus'](0xc8);}})['catch'](handleError(_0x4235ee,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index ba900ab..fcb7dd3 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 _0x4137=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage'];(function(_0x453f28,_0x31cc3c){var _0x24c654=function(_0x5b6c9f){while(--_0x5b6c9f){_0x453f28['push'](_0x453f28['shift']());}};_0x24c654(++_0x31cc3c);}(_0x4137,0xf8));var _0x7413=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4137[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0x7413('0x0'));var SmsInteraction=require(_0x7413('0x1'))['db'][_0x7413('0x2')];var SmsMessage=require(_0x7413('0x1'))['db'][_0x7413('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x7413('0x4')](0x0);var events={'afterCreate':_0x7413('0x5'),'afterUpdate':_0x7413('0x6'),'afterDestroy':_0x7413('0x7')};function emitEvent(_0x3dc48a){return function(_0x451a96,_0x3bb181,_0x4fbade){_0x451a96[_0x7413('0x8')]({'attributes':['id'],'raw':!![]})[_0x7413('0x9')](function(_0x5b39ac){_0x451a96[_0x7413('0xa')]('Users',_0x5b39ac[_0x7413('0xb')](function(_0x120dc2){return{'id':_0x120dc2['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x451a96['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7413('0x9')](function(_0x2f4b54){_0x451a96['setDataValue'](_0x7413('0xc'),_0x2f4b54[_0x7413('0xd')]);SmsInteractionEvents[_0x7413('0xe')](_0x3dc48a+':'+_0x451a96['id'],_0x451a96);SmsInteractionEvents[_0x7413('0xe')](_0x3dc48a,_0x451a96);_0x4fbade(null);})[_0x7413('0xf')](_0x4fbade(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x7413('0x10')](e,emitEvent(event));}}module[_0x7413('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x4991=['then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','events','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x40a7e5,_0x116a84){var _0x3968ba=function(_0x1962e1){while(--_0x1962e1){_0x40a7e5['push'](_0x40a7e5['shift']());}};_0x3968ba(++_0x116a84);}(_0x4991,0xf7));var _0x1499=function(_0x55f4b3,_0x44ba9f){_0x55f4b3=_0x55f4b3-0x0;var _0x25b124=_0x4991[_0x55f4b3];return _0x25b124;};'use strict';var EventEmitter=require(_0x1499('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x1499('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x1499('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1499('0x3')](0x0);var events={'afterCreate':_0x1499('0x4'),'afterUpdate':_0x1499('0x5'),'afterDestroy':_0x1499('0x6')};function emitEvent(_0x158134){return function(_0x19adff,_0x209616,_0x4b6154){_0x19adff[_0x1499('0x7')]({'attributes':['id'],'raw':!![]})[_0x1499('0x8')](function(_0x1c65c3){_0x19adff[_0x1499('0x9')](_0x1499('0xa'),_0x1c65c3[_0x1499('0xb')](function(_0x3277b3){return{'id':_0x3277b3['id']};}));return SmsMessage[_0x1499('0xc')]({'where':{'SmsInteractionId':_0x19adff['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x16e8ad){_0x19adff[_0x1499('0x9')]('unreadMessages',_0x16e8ad[_0x1499('0xd')]);SmsInteractionEvents[_0x1499('0xe')](_0x158134+':'+_0x19adff['id'],_0x19adff);SmsInteractionEvents['emit'](_0x158134,_0x19adff);_0x4b6154(null);})[_0x1499('0xf')](_0x4b6154(null));};}for(var e in events){if(events[_0x1499('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 08b6ac8..33a6287 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 _0x7a34=['exports','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x4e505f,_0x2e90be){var _0xfa8de0=function(_0x55337e){while(--_0x55337e){_0x4e505f['push'](_0x4e505f['shift']());}};_0xfa8de0(++_0x2e90be);}(_0x7a34,0x170));var _0x47a3=function(_0x19c821,_0x74eeec){_0x19c821=_0x19c821-0x0;var _0x4e0faf=_0x7a34[_0x19c821];return _0x4e0faf;};'use strict';var _=require(_0x47a3('0x0'));var util=require(_0x47a3('0x1'));var logger=require(_0x47a3('0x2'))('api');var moment=require('moment');var BPromise=require(_0x47a3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a3('0x4'));var rimraf=require(_0x47a3('0x5'));var config=require(_0x47a3('0x6'));var attributes=require('./smsInteraction.attributes');module[_0x47a3('0x7')]=function(_0x344fbc,_0x49b8ad){return _0x344fbc['define'](_0x47a3('0x8'),attributes,{'tableName':_0x47a3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x750ef0,_0xddae2a,_0x3b8493){if(_0x750ef0[_0x47a3('0xa')](_0x47a3('0xb'))){_0x750ef0[_0x47a3('0xc')]=moment()[_0x47a3('0xd')](_0x47a3('0xe'));}_0x3b8493(null,_0x750ef0);}}});}; \ No newline at end of file +var _0x0a1b=['closedAt','api','bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','exports','sms_interactions','changed'];(function(_0x31ca37,_0x2b814f){var _0x4300cd=function(_0x5a8d09){while(--_0x5a8d09){_0x31ca37['push'](_0x31ca37['shift']());}};_0x4300cd(++_0x2b814f);}(_0x0a1b,0x1c3));var _0xb0a1=function(_0x7f5922,_0x283b62){_0x7f5922=_0x7f5922-0x0;var _0x1d8b0c=_0x0a1b[_0x7f5922];return _0x1d8b0c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb0a1('0x0'));var moment=require('moment');var BPromise=require(_0xb0a1('0x1'));var rp=require(_0xb0a1('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb0a1('0x3'));var config=require(_0xb0a1('0x4'));var attributes=require(_0xb0a1('0x5'));module[_0xb0a1('0x6')]=function(_0x2b6db8,_0x290c85){return _0x2b6db8['define']('SmsInteraction',attributes,{'tableName':_0xb0a1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e54f3,_0x2a8d79,_0x71270b){if(_0x4e54f3[_0xb0a1('0x8')]('closed')){_0x4e54f3[_0xb0a1('0x9')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x71270b(null,_0x4e54f3);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 2b4e7c7..27c5df2 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 _0x147f=['AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SmsInteraction','update','body','options','raw','where','attributes','UpdateSmsInteraction','catch','find','ids','spread'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x147f,0x141));var _0xf147=function(_0x31b80e,_0x4543df){_0x31b80e=_0x31b80e-0x0;var _0x4f3fe0=_0x147f[_0x31b80e];return _0x4f3fe0;};'use strict';var _=require(_0xf147('0x0'));var util=require(_0xf147('0x1'));var moment=require(_0xf147('0x2'));var BPromise=require(_0xf147('0x3'));var rs=require(_0xf147('0x4'));var fs=require('fs');var Redis=require(_0xf147('0x5'));var db=require(_0xf147('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf147('0x7'))(_0xf147('0x8'));var config=require(_0xf147('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf147('0xa')][_0xf147('0xb')]({'port':0x232a});config[_0xf147('0xc')]=_['defaults'](config[_0xf147('0xc')],{'host':_0xf147('0xd'),'port':0x18eb});var socket=require(_0xf147('0xe'))(new Redis(config[_0xf147('0xc')]));require('./smsInteraction.socket')[_0xf147('0xf')](socket);function respondWithRpcPromise(_0x24dd7b,_0x377a83,_0x3dd28e){return new BPromise(function(_0x3dfed0,_0x59d14f){return client[_0xf147('0x10')](_0x24dd7b,_0x3dd28e)[_0xf147('0x11')](function(_0x54fc53){logger[_0xf147('0x12')](_0xf147('0x13'),_0x377a83,_0xf147('0x14'));logger[_0xf147('0x15')](_0xf147('0x16'),_0x377a83,_0xf147('0x14'),JSON[_0xf147('0x17')](_0x54fc53));if(_0x54fc53[_0xf147('0x18')]){if(_0x54fc53[_0xf147('0x18')]['code']===0x1f4){logger[_0xf147('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x377a83,_0x54fc53['error'][_0xf147('0x19')]);return _0x59d14f(_0x54fc53[_0xf147('0x18')]['message']);}logger[_0xf147('0x18')](_0xf147('0x13'),_0x377a83,_0x54fc53[_0xf147('0x18')][_0xf147('0x19')]);return _0x3dfed0(_0x54fc53[_0xf147('0x18')][_0xf147('0x19')]);}else{logger[_0xf147('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x377a83,_0xf147('0x14'));_0x3dfed0(_0x54fc53[_0xf147('0x1a')][_0xf147('0x19')]);}})['catch'](function(_0x1d1e93){logger[_0xf147('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x377a83,_0x1d1e93);_0x59d14f(_0x1d1e93);});});}exports['UpdateSmsInteraction']=function(_0x5bb1a7){var _0x3b7c7b=this;return new Promise(function(_0x18df53,_0x4d1c6a){return db[_0xf147('0x1b')][_0xf147('0x1c')](_0x5bb1a7[_0xf147('0x1d')],{'raw':_0x5bb1a7[_0xf147('0x1e')]?_0x5bb1a7[_0xf147('0x1e')][_0xf147('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bb1a7[_0xf147('0x1e')]?_0x5bb1a7[_0xf147('0x1e')][_0xf147('0x20')]||null:null,'attributes':_0x5bb1a7[_0xf147('0x1e')]?_0x5bb1a7[_0xf147('0x1e')][_0xf147('0x21')]||null:null,'limit':_0x5bb1a7['options']?_0x5bb1a7[_0xf147('0x1e')]['limit']||null:null})[_0xf147('0x11')](function(_0x11622c){logger[_0xf147('0x12')]('UpdateSmsInteraction',_0x5bb1a7);logger['debug'](_0xf147('0x22'),_0x5bb1a7,JSON[_0xf147('0x17')](_0x11622c));_0x18df53(_0x11622c);})[_0xf147('0x23')](function(_0x1fe57c){logger['error'](_0xf147('0x22'),_0x1fe57c[_0xf147('0x19')],_0x5bb1a7);_0x4d1c6a(_0x3b7c7b[_0xf147('0x18')](0x1f4,_0x1fe57c[_0xf147('0x19')]));});});};exports['AddTagsToSmsInteraction']=function(_0x526516){return new Promise(function(_0x47b8b7,_0xe2f61b){return db[_0xf147('0x1b')][_0xf147('0x24')]({'where':_0x526516['options']?_0x526516[_0xf147('0x1e')][_0xf147('0x20')]||null:null})['then'](function(_0x345b98){if(_0x345b98){return _0x345b98['addTags'](_0x526516[_0xf147('0x1d')][_0xf147('0x25')],_['omit'](_0x526516[_0xf147('0x1d')],[_0xf147('0x25'),'id'])||{});}})[_0xf147('0x26')](function(_0x15b30b){logger[_0xf147('0x12')]('AddTags',_0x526516);logger['debug'](_0xf147('0x27'),_0x526516,JSON[_0xf147('0x17')](_0x15b30b));_0x47b8b7(_0x15b30b);})[_0xf147('0x23')](function(_0x89d171){logger['error']('AddTags',_0x89d171[_0xf147('0x19')],_0x526516);_0xe2f61b(_this['error'](0x1f4,_0x89d171[_0xf147('0x19')]));});});}; \ No newline at end of file +var _0x922a=['where','attributes','limit','AddTagsToSmsInteraction','find','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','http','redis','defaults','localhost','./smsInteraction.socket','request','then','info','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','request\x20sent','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw'];(function(_0x4179e2,_0xf2dbb){var _0x24cb50=function(_0x3b7899){while(--_0x3b7899){_0x4179e2['push'](_0x4179e2['shift']());}};_0x24cb50(++_0xf2dbb);}(_0x922a,0xa1));var _0xa922=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x922a[_0x33032e];return _0x13316b;};'use strict';var _=require('lodash');var util=require(_0xa922('0x0'));var moment=require(_0xa922('0x1'));var BPromise=require(_0xa922('0x2'));var rs=require(_0xa922('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa922('0x4'))['db'];var utils=require(_0xa922('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa922('0x6'));var client=jayson['client'][_0xa922('0x7')]({'port':0x232a});config[_0xa922('0x8')]=_[_0xa922('0x9')](config[_0xa922('0x8')],{'host':_0xa922('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa922('0xb'))['register'](socket);function respondWithRpcPromise(_0x147ee2,_0x20298e,_0x358726){return new BPromise(function(_0x70e5e,_0x2123e1){return client[_0xa922('0xc')](_0x147ee2,_0x358726)[_0xa922('0xd')](function(_0xd7ee47){logger[_0xa922('0xe')]('SmsInteraction,\x20%s,\x20%s',_0x20298e,'request\x20sent');logger[_0xa922('0xf')](_0xa922('0x10'),_0x20298e,'request\x20sent',JSON[_0xa922('0x11')](_0xd7ee47));if(_0xd7ee47[_0xa922('0x12')]){if(_0xd7ee47[_0xa922('0x12')][_0xa922('0x13')]===0x1f4){logger[_0xa922('0x12')](_0xa922('0x14'),_0x20298e,_0xd7ee47['error'][_0xa922('0x15')]);return _0x2123e1(_0xd7ee47[_0xa922('0x12')][_0xa922('0x15')]);}logger[_0xa922('0x12')](_0xa922('0x14'),_0x20298e,_0xd7ee47[_0xa922('0x12')][_0xa922('0x15')]);return _0x70e5e(_0xd7ee47[_0xa922('0x12')][_0xa922('0x15')]);}else{logger[_0xa922('0xe')](_0xa922('0x14'),_0x20298e,_0xa922('0x16'));_0x70e5e(_0xd7ee47['result'][_0xa922('0x15')]);}})[_0xa922('0x17')](function(_0x272615){logger[_0xa922('0x12')](_0xa922('0x14'),_0x20298e,_0x272615);_0x2123e1(_0x272615);});});}exports[_0xa922('0x18')]=function(_0x24d883){var _0x3546bf=this;return new Promise(function(_0x2f309c,_0x18fe2d){return db[_0xa922('0x19')]['update'](_0x24d883[_0xa922('0x1a')],{'raw':_0x24d883['options']?_0x24d883[_0xa922('0x1b')][_0xa922('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24d883[_0xa922('0x1b')]?_0x24d883[_0xa922('0x1b')][_0xa922('0x1d')]||null:null,'attributes':_0x24d883[_0xa922('0x1b')]?_0x24d883[_0xa922('0x1b')][_0xa922('0x1e')]||null:null,'limit':_0x24d883[_0xa922('0x1b')]?_0x24d883[_0xa922('0x1b')][_0xa922('0x1f')]||null:null})[_0xa922('0xd')](function(_0x19c694){logger[_0xa922('0xe')](_0xa922('0x18'),_0x24d883);logger['debug']('UpdateSmsInteraction',_0x24d883,JSON[_0xa922('0x11')](_0x19c694));_0x2f309c(_0x19c694);})['catch'](function(_0x549344){logger[_0xa922('0x12')](_0xa922('0x18'),_0x549344[_0xa922('0x15')],_0x24d883);_0x18fe2d(_0x3546bf[_0xa922('0x12')](0x1f4,_0x549344[_0xa922('0x15')]));});});};exports[_0xa922('0x20')]=function(_0x3dd885){return new Promise(function(_0x2c3b21,_0x245958){return db[_0xa922('0x19')][_0xa922('0x21')]({'where':_0x3dd885[_0xa922('0x1b')]?_0x3dd885['options'][_0xa922('0x1d')]||null:null})[_0xa922('0xd')](function(_0x52b8de){if(_0x52b8de){return _0x52b8de[_0xa922('0x22')](_0x3dd885[_0xa922('0x1a')][_0xa922('0x23')],_['omit'](_0x3dd885['body'],[_0xa922('0x23'),'id'])||{});}})[_0xa922('0x24')](function(_0xc52c9f){logger['info'](_0xa922('0x25'),_0x3dd885);logger[_0xa922('0xf')](_0xa922('0x25'),_0x3dd885,JSON[_0xa922('0x11')](_0xc52c9f));_0x2c3b21(_0xc52c9f);})[_0xa922('0x17')](function(_0x11de0f){logger['error'](_0xa922('0x25'),_0x11de0f[_0xa922('0x15')],_0x3dd885);_0x245958(_this[_0xa922('0x12')](0x1f4,_0x11de0f[_0xa922('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 262418b..8ef83e7 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 _0x73e8=['register','length','smsInteraction:','./smsInteraction.events','save','update','emit','removeListener'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x73e8,0x113));var _0x873e=function(_0x4f20d9,_0x44f2e0){_0x4f20d9=_0x4f20d9-0x0;var _0x3db5ed=_0x73e8[_0x4f20d9];return _0x3db5ed;};'use strict';var SmsInteractionEvents=require(_0x873e('0x0'));var events=[_0x873e('0x1'),'remove',_0x873e('0x2')];function createListener(_0x528449,_0x53655a){return function(_0x586d03){_0x53655a[_0x873e('0x3')](_0x528449,_0x586d03);};}function removeListener(_0x59f63b,_0x532aa8){return function(){SmsInteractionEvents[_0x873e('0x4')](_0x59f63b,_0x532aa8);};}exports[_0x873e('0x5')]=function(_0x250b07){for(var _0x4665f0=0x0,_0x83bf88=events[_0x873e('0x6')];_0x4665f0<_0x83bf88;_0x4665f0++){var _0x5f3e0c=events[_0x4665f0];var _0x2f1279=createListener(_0x873e('0x7')+_0x5f3e0c,_0x250b07);SmsInteractionEvents['on'](_0x5f3e0c,_0x2f1279);}}; \ No newline at end of file +var _0xefdd=['./smsInteraction.events','register'];(function(_0x2aa9c3,_0x5a49ab){var _0x5c242d=function(_0xbdbc35){while(--_0xbdbc35){_0x2aa9c3['push'](_0x2aa9c3['shift']());}};_0x5c242d(++_0x5a49ab);}(_0xefdd,0x182));var _0xdefd=function(_0x2bea75,_0xacc2bc){_0x2bea75=_0x2bea75-0x0;var _0xcf26e3=_0xefdd[_0x2bea75];return _0xcf26e3;};'use strict';var SmsInteractionEvents=require(_0xdefd('0x0'));var events=['save','remove','update'];function createListener(_0x5e1846,_0x5142b6){return function(_0x4651af){_0x5142b6['emit'](_0x5e1846,_0x4651af);};}function removeListener(_0x11cbb5,_0x4cb70f){return function(){SmsInteractionEvents['removeListener'](_0x11cbb5,_0x4cb70f);};}exports[_0xdefd('0x1')]=function(_0x5e4f75){for(var _0x5c8a85=0x0,_0x41efdf=events['length'];_0x5c8a85<_0x41efdf;_0x5c8a85++){var _0x2a6d35=events[_0x5c8a85];var _0xb19d4d=createListener('smsInteraction:'+_0x2a6d35,_0x5e4f75);SmsInteractionEvents['on'](_0x2a6d35,_0xb19d4d);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index b7c12de..26f0d11 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 _0x8863=['update','/:id/accept','accept','/:id/reject','reject','exports','util','path','connect-timeout','express','../../config/environment','./smsMessage.controller','isAuthenticated','index','/describe','describe','get','show','post','tracked','smsmessage:create','create','put','/:id'];(function(_0x48fdbb,_0x3239bd){var _0x198205=function(_0x1dd8c6){while(--_0x1dd8c6){_0x48fdbb['push'](_0x48fdbb['shift']());}};_0x198205(++_0x3239bd);}(_0x8863,0x1b6));var _0x3886=function(_0x4635e5,_0x5590a9){_0x4635e5=_0x4635e5-0x0;var _0x5a187b=_0x8863[_0x4635e5];return _0x5a187b;};'use strict';var multer=require('multer');var util=require(_0x3886('0x0'));var path=require(_0x3886('0x1'));var timeout=require(_0x3886('0x2'));var express=require(_0x3886('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3886('0x4'));var controller=require(_0x3886('0x5'));router['get']('/',auth[_0x3886('0x6')](),controller[_0x3886('0x7')]);router['get'](_0x3886('0x8'),auth[_0x3886('0x6')](),controller[_0x3886('0x9')]);router[_0x3886('0xa')]('/:id',auth[_0x3886('0x6')](),controller[_0x3886('0xb')]);router[_0x3886('0xc')]('/',auth[_0x3886('0x6')](),interaction[_0x3886('0xd')]('sms',_0x3886('0xe')),controller[_0x3886('0xf')]);router[_0x3886('0xc')]('/:id/status',controller['status']);router[_0x3886('0x10')](_0x3886('0x11'),auth[_0x3886('0x6')](),controller[_0x3886('0x12')]);router[_0x3886('0x10')](_0x3886('0x13'),auth[_0x3886('0x6')](),controller[_0x3886('0x14')]);router[_0x3886('0x10')](_0x3886('0x15'),auth[_0x3886('0x6')](),controller[_0x3886('0x16')]);router['delete'](_0x3886('0x11'),auth[_0x3886('0x6')](),controller['destroy']);module[_0x3886('0x17')]=router; \ No newline at end of file +var _0x6888=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','sms','smsmessage:create','create','post','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports'];(function(_0x39daf1,_0x23c753){var _0x5715f6=function(_0x40b9bf){while(--_0x40b9bf){_0x39daf1['push'](_0x39daf1['shift']());}};_0x5715f6(++_0x23c753);}(_0x6888,0xd2));var _0x8688=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x6888[_0x1b2ff7];return _0x31656a;};'use strict';var multer=require(_0x8688('0x0'));var util=require('util');var path=require(_0x8688('0x1'));var timeout=require(_0x8688('0x2'));var express=require(_0x8688('0x3'));var router=express[_0x8688('0x4')]();var fs_extra=require(_0x8688('0x5'));var auth=require(_0x8688('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8688('0x7'));router[_0x8688('0x8')]('/',auth[_0x8688('0x9')](),controller[_0x8688('0xa')]);router[_0x8688('0x8')](_0x8688('0xb'),auth['isAuthenticated'](),controller[_0x8688('0xc')]);router[_0x8688('0x8')](_0x8688('0xd'),auth[_0x8688('0x9')](),controller[_0x8688('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x8688('0xf')](_0x8688('0x10'),_0x8688('0x11')),controller[_0x8688('0x12')]);router[_0x8688('0x13')](_0x8688('0x14'),controller[_0x8688('0x15')]);router[_0x8688('0x16')](_0x8688('0xd'),auth['isAuthenticated'](),controller[_0x8688('0x17')]);router[_0x8688('0x16')](_0x8688('0x18'),auth[_0x8688('0x9')](),controller[_0x8688('0x19')]);router[_0x8688('0x16')](_0x8688('0x1a'),auth[_0x8688('0x9')](),controller[_0x8688('0x1b')]);router[_0x8688('0x1c')](_0x8688('0xd'),auth[_0x8688('0x9')](),controller['destroy']);module[_0x8688('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 5bfa473..38052f7 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 _0x1eca=['exports','medium','BOOLEAN','out','STRING','DATE','TEXT','sequelize'];(function(_0x22093a,_0xa7acf1){var _0x2f4989=function(_0x5bf12b){while(--_0x5bf12b){_0x22093a['push'](_0x22093a['shift']());}};_0x2f4989(++_0xa7acf1);}(_0x1eca,0x10f));var _0xa1ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1eca[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa1ec('0x0'));module[_0xa1ec('0x1')]={'body':{'type':Sequelize['TEXT'](_0xa1ec('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa1ec('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xa1ec('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa1ec('0x5')](0xbe)},'phone':{'type':Sequelize[_0xa1ec('0x5')]},'readAt':{'type':Sequelize[_0xa1ec('0x6')]},'secret':{'type':Sequelize[_0xa1ec('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa1ec('0x5')]},'providerResponse':{'type':Sequelize[_0xa1ec('0x7')]}}; \ No newline at end of file +var _0x92df=['out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x5c7c2e,_0x33a492){var _0x3b2846=function(_0x2f1643){while(--_0x2f1643){_0x5c7c2e['push'](_0x5c7c2e['shift']());}};_0x3b2846(++_0x33a492);}(_0x92df,0xcb));var _0xf92d=function(_0x373f18,_0x387b70){_0x373f18=_0x373f18-0x0;var _0x21b65f=_0x92df[_0x373f18];return _0x21b65f;};'use strict';var Sequelize=require(_0xf92d('0x0'));module[_0xf92d('0x1')]={'body':{'type':Sequelize[_0xf92d('0x2')](_0xf92d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf92d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xf92d('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xf92d('0x6')]},'readAt':{'type':Sequelize[_0xf92d('0x7')]},'secret':{'type':Sequelize[_0xf92d('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf92d('0x6')]},'providerResponse':{'type':Sequelize[_0xf92d('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 05d0c3d..1794a1a 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 _0x79e2=['inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','indexOf','sent','delivered','Status','infobip','groupName','DELIVERED','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','result','catch','end','status','json','offset','undefined','limit','count','set','apply','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','filters','filter','merge','VIRTUAL','options','SmsMessage','includeAll','include','findAll','rows','show','params','find','create','body','describe','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','fullname','email','internal','manual','channel','accept','EventManager','sms-interactions','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','User','interface','event','rejectmessage','SmsAccountId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x79e2,0x1c3));var _0x279e=function(_0xf72b46,_0x5b629e){_0xf72b46=_0xf72b46-0x0;var _0x31dcfb=_0x79e2[_0xf72b46];return _0x31dcfb;};'use strict';var emlformat=require(_0x279e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x279e('0x1'));var jsonpatch=require(_0x279e('0x2'));var rp=require(_0x279e('0x3'));var moment=require('moment');var BPromise=require(_0x279e('0x4'));var Mustache=require('mustache');var util=require(_0x279e('0x5'));var path=require(_0x279e('0x6'));var sox=require(_0x279e('0x7'));var csv=require(_0x279e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x279e('0x9'));var squel=require(_0x279e('0xa'));var crypto=require(_0x279e('0xb'));var jsforce=require(_0x279e('0xc'));var deskjs=require(_0x279e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x279e('0xe'));var Papa=require(_0x279e('0xf'));var Redis=require(_0x279e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x279e('0x11'));var as=require(_0x279e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x279e('0x13'))(_0x279e('0x14'));var utils=require(_0x279e('0x15'));var config=require(_0x279e('0x16'));var licenseUtil=require(_0x279e('0x17'));var db=require(_0x279e('0x18'))['db'];config[_0x279e('0x19')]=_[_0x279e('0x1a')](config['redis'],{'host':_0x279e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x279e('0x19')]));require(_0x279e('0x1c'))[_0x279e('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x279e('0x1e')][_0x279e('0x1f')]({'port':0x232c});var client9002=jayson[_0x279e('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x201ae0,_0x3683e6,_0x3daae8,_0xb9c4fe){return new BPromise(function(_0x14f7fc,_0x3e2d0b){var _0x484c6e=_0xb9c4fe||client;return _0x484c6e[_0x279e('0x20')](_0x201ae0,_0x3daae8)[_0x279e('0x21')](function(_0x1e9a48){logger[_0x279e('0x22')]('SmsMessage,\x20%s,\x20%s',_0x3683e6,_0x279e('0x23'));logger[_0x279e('0x24')](_0x279e('0x25'),_0x3683e6,_0x279e('0x23'),JSON[_0x279e('0x26')](_0x1e9a48));if(_0x1e9a48['error']){if(_0x1e9a48[_0x279e('0x27')]['code']===0x1f4){logger[_0x279e('0x27')](_0x279e('0x28'),_0x3683e6,_0x1e9a48['error'][_0x279e('0x29')]);return _0x3e2d0b(_0x1e9a48[_0x279e('0x27')][_0x279e('0x29')]);}logger[_0x279e('0x27')](_0x279e('0x28'),_0x3683e6,_0x1e9a48['error']['message']);return _0x14f7fc(_0x1e9a48[_0x279e('0x27')][_0x279e('0x29')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x3683e6,_0x279e('0x23'));_0x14f7fc(_0x1e9a48[_0x279e('0x2a')]['message']);}})[_0x279e('0x2b')](function(_0x5ab4a9){logger[_0x279e('0x27')](_0x279e('0x28'),_0x3683e6,_0x5ab4a9);_0x3e2d0b(_0x5ab4a9);});});}function respondWithStatusCode(_0x4cc1af,_0x5663ed){_0x5663ed=_0x5663ed||0xcc;return function(_0x54eb04){if(_0x54eb04){return _0x4cc1af['sendStatus'](_0x5663ed);}return _0x4cc1af['status'](_0x5663ed)[_0x279e('0x2c')]();};}function respondWithResult(_0x4c3104,_0x5b3c75){_0x5b3c75=_0x5b3c75||0xc8;return function(_0x73a347){if(_0x73a347){return _0x4c3104[_0x279e('0x2d')](_0x5b3c75)[_0x279e('0x2e')](_0x73a347);}};}function respondWithFilteredResult(_0x155927,_0x2957c7){return function(_0x2b9286){if(_0x2b9286){var _0x54fea1=typeof _0x2957c7[_0x279e('0x2f')]===_0x279e('0x30')&&typeof _0x2957c7[_0x279e('0x31')]===_0x279e('0x30');var _0x4fb56c=_0x2b9286[_0x279e('0x32')];var _0x28f5fe=_0x54fea1?0x0:_0x2957c7['offset'];var _0x5a73a0=_0x54fea1?_0x2b9286[_0x279e('0x32')]:_0x2957c7['offset']+_0x2957c7[_0x279e('0x31')];var _0x418daf;if(_0x5a73a0>=_0x4fb56c){_0x5a73a0=_0x4fb56c;_0x418daf=0xc8;}else{_0x418daf=0xce;}_0x155927[_0x279e('0x2d')](_0x418daf);return _0x155927[_0x279e('0x33')]('Content-Range',_0x28f5fe+'-'+_0x5a73a0+'/'+_0x4fb56c)['json'](_0x2b9286);}return null;};}function patchUpdates(_0x850f42){return function(_0x3ec817){try{jsonpatch[_0x279e('0x34')](_0x3ec817,_0x850f42,!![]);}catch(_0x13c39c){return BPromise['reject'](_0x13c39c);}return _0x3ec817['save']();};}function saveUpdates(_0x20956c,_0x1c264f){return function(_0x459cf2){if(_0x459cf2){return _0x459cf2[_0x279e('0x35')](_0x20956c)['then'](function(_0x1d3caf){return _0x1d3caf;});}return null;};}function removeEntity(_0x264e68,_0x3b5683){return function(_0x28c6c4){if(_0x28c6c4){return _0x28c6c4[_0x279e('0x36')]()[_0x279e('0x21')](function(){_0x264e68[_0x279e('0x2d')](0xcc)[_0x279e('0x2c')]();});}};}function handleEntityNotFound(_0x361309,_0x29b822){return function(_0x51f0bf){if(!_0x51f0bf){_0x361309[_0x279e('0x37')](0x194);}return _0x51f0bf;};}function handleError(_0x20c624,_0x3b40da){_0x3b40da=_0x3b40da||0x1f4;return function(_0x28327f){logger[_0x279e('0x27')](_0x28327f[_0x279e('0x38')]);if(_0x28327f['name']){delete _0x28327f[_0x279e('0x39')];}_0x20c624[_0x279e('0x2d')](_0x3b40da)[_0x279e('0x3a')](_0x28327f);};}exports[_0x279e('0x3b')]=function(_0x448690,_0x67ab69){var _0x40d3ba={},_0x1911b9={},_0x3e46b9={'count':0x0,'rows':[]};var _0x30345f=_[_0x279e('0x3c')](db['SmsMessage'][_0x279e('0x3d')],function(_0x376dae){return{'name':_0x376dae[_0x279e('0x3e')],'type':_0x376dae[_0x279e('0x3f')][_0x279e('0x40')]};});_0x1911b9[_0x279e('0x41')]=_[_0x279e('0x3c')](_0x30345f,_0x279e('0x39'));_0x1911b9[_0x279e('0x42')]=_[_0x279e('0x43')](_0x448690[_0x279e('0x42')]);_0x1911b9['filters']=_['intersection'](_0x1911b9[_0x279e('0x41')],_0x1911b9['query']);_0x40d3ba[_0x279e('0x44')]=_[_0x279e('0x45')](_0x1911b9[_0x279e('0x41')],qs['fields'](_0x448690[_0x279e('0x42')][_0x279e('0x46')]));_0x40d3ba[_0x279e('0x44')]=_0x40d3ba[_0x279e('0x44')][_0x279e('0x47')]?_0x40d3ba['attributes']:_0x1911b9['model'];if(!_0x448690['query'][_0x279e('0x48')](_0x279e('0x49'))){_0x40d3ba[_0x279e('0x31')]=qs['limit'](_0x448690[_0x279e('0x42')]['limit']);_0x40d3ba[_0x279e('0x2f')]=qs[_0x279e('0x2f')](_0x448690[_0x279e('0x42')][_0x279e('0x2f')]);}_0x40d3ba['order']=qs['sort'](_0x448690['query']['sort']);_0x40d3ba[_0x279e('0x4a')]=qs[_0x279e('0x4b')](_['pick'](_0x448690[_0x279e('0x42')],_0x1911b9[_0x279e('0x4b')]),_0x30345f);if(_0x448690['query'][_0x279e('0x4c')]){_0x40d3ba['where']=_[_0x279e('0x4d')](_0x40d3ba[_0x279e('0x4a')],{'$or':_[_0x279e('0x3c')](_0x30345f,function(_0x2b3005){if(_0x2b3005[_0x279e('0x3f')]!==_0x279e('0x4e')){var _0xc4359a={};_0xc4359a[_0x2b3005[_0x279e('0x39')]]={'$like':'%'+_0x448690[_0x279e('0x42')]['filter']+'%'};return _0xc4359a;}})});}_0x40d3ba=_['merge']({},_0x40d3ba,_0x448690[_0x279e('0x4f')]);var _0x38a5f2={'where':_0x40d3ba[_0x279e('0x4a')]};return db[_0x279e('0x50')]['count'](_0x38a5f2)[_0x279e('0x21')](function(_0x347c26){_0x3e46b9[_0x279e('0x32')]=_0x347c26;if(_0x448690[_0x279e('0x42')][_0x279e('0x51')]){_0x40d3ba[_0x279e('0x52')]=[{'all':!![]}];}return db[_0x279e('0x50')][_0x279e('0x53')](_0x40d3ba);})[_0x279e('0x21')](function(_0x480bd5){_0x3e46b9[_0x279e('0x54')]=_0x480bd5;return _0x3e46b9;})[_0x279e('0x21')](respondWithFilteredResult(_0x67ab69,_0x40d3ba))[_0x279e('0x2b')](handleError(_0x67ab69,null));};exports[_0x279e('0x55')]=function(_0xc7f0ce,_0x4b1ba1){var _0x6dbe07={'raw':!![],'where':{'id':_0xc7f0ce[_0x279e('0x56')]['id']}},_0x395c4b={};_0x395c4b[_0x279e('0x41')]=_[_0x279e('0x43')](db[_0x279e('0x50')][_0x279e('0x3d')]);_0x395c4b[_0x279e('0x42')]=_['keys'](_0xc7f0ce[_0x279e('0x42')]);_0x395c4b[_0x279e('0x4b')]=_['intersection'](_0x395c4b[_0x279e('0x41')],_0x395c4b['query']);_0x6dbe07[_0x279e('0x44')]=_[_0x279e('0x45')](_0x395c4b['model'],qs[_0x279e('0x46')](_0xc7f0ce[_0x279e('0x42')][_0x279e('0x46')]));_0x6dbe07[_0x279e('0x44')]=_0x6dbe07['attributes'][_0x279e('0x47')]?_0x6dbe07[_0x279e('0x44')]:_0x395c4b['model'];if(_0xc7f0ce[_0x279e('0x42')][_0x279e('0x51')]){_0x6dbe07[_0x279e('0x52')]=[{'all':!![]}];}_0x6dbe07=_[_0x279e('0x4d')]({},_0x6dbe07,_0xc7f0ce['options']);return db[_0x279e('0x50')][_0x279e('0x57')](_0x6dbe07)['then'](handleEntityNotFound(_0x4b1ba1,null))[_0x279e('0x21')](respondWithResult(_0x4b1ba1,null))[_0x279e('0x2b')](handleError(_0x4b1ba1,null));};exports[_0x279e('0x58')]=function(_0x5e0267,_0x443195){return db[_0x279e('0x50')]['create'](_0x5e0267[_0x279e('0x59')],{})[_0x279e('0x21')](respondWithResult(_0x443195,0xc9))[_0x279e('0x2b')](handleError(_0x443195,null));};exports['update']=function(_0x2a8639,_0x374381){if(_0x2a8639['body']['id']){delete _0x2a8639[_0x279e('0x59')]['id'];}return db[_0x279e('0x50')]['find']({'where':{'id':_0x2a8639['params']['id']}})[_0x279e('0x21')](handleEntityNotFound(_0x374381,null))[_0x279e('0x21')](saveUpdates(_0x2a8639[_0x279e('0x59')],null))[_0x279e('0x21')](respondWithResult(_0x374381,null))['catch'](handleError(_0x374381,null));};exports[_0x279e('0x36')]=function(_0x194a8b,_0x9afc0f){return db['SmsMessage'][_0x279e('0x57')]({'where':{'id':_0x194a8b[_0x279e('0x56')]['id']}})[_0x279e('0x21')](handleEntityNotFound(_0x9afc0f,null))[_0x279e('0x21')](removeEntity(_0x9afc0f,null))[_0x279e('0x2b')](handleError(_0x9afc0f,null));};exports[_0x279e('0x5a')]=function(_0x389032,_0x5697f5){return db[_0x279e('0x50')][_0x279e('0x5a')]()[_0x279e('0x21')](respondWithResult(_0x5697f5,null))[_0x279e('0x2b')](handleError(_0x5697f5,null));};var interaction_log=require(_0x279e('0x13'))('sms-interactions');exports['accept']=function(_0x33c27c,_0x13db5e,_0x189301){var _0x479fb6={'agent':{},'channel':_0x279e('0x5b')};if(_0x33c27c[_0x279e('0x59')]['id']){delete _0x33c27c[_0x279e('0x59')]['id'];}_0x33c27c['body'][_0x279e('0x5c')]=!![];_0x33c27c[_0x279e('0x59')][_0x279e('0x5d')]=moment()[_0x279e('0x5e')](_0x279e('0x5f'));_0x33c27c[_0x279e('0x59')][_0x279e('0x60')]=_0x33c27c['body']['UserId']||_0x33c27c[_0x279e('0x61')]['id'];_0x479fb6[_0x279e('0x62')]['id']=_0x33c27c[_0x279e('0x59')][_0x279e('0x60')];return db['SmsMessage'][_0x279e('0x57')]({'where':{'id':_0x33c27c['params']['id'],'UserId':null}})[_0x279e('0x21')](handleEntityNotFound(_0x13db5e,null))['then'](saveUpdates(_0x33c27c['body'],null))[_0x279e('0x21')](function(_0x292921){if(_0x292921){_0x479fb6[_0x279e('0x29')]=_0x292921[_0x279e('0x63')]({'plain':!![]});return db[_0x279e('0x64')][_0x279e('0x57')]({'where':{'id':_0x292921[_0x279e('0x65')]}});}return null;})[_0x279e('0x21')](handleEntityNotFound(_0x13db5e,null))['then'](function(_0x1a7c7c){if(_0x1a7c7c){return _0x1a7c7c[_0x279e('0x35')]({'UserId':_0x33c27c[_0x279e('0x59')]['UserId'],'read1stAt':_[_0x279e('0x66')](_0x1a7c7c[_0x279e('0x67')])?moment()[_0x279e('0x5e')](_0x279e('0x5f')):undefined});}return null;})[_0x279e('0x21')](function(_0x13c58f){if(_0x13c58f){_0x479fb6[_0x279e('0x68')]=_0x13c58f[_0x279e('0x63')]({'plain':!![]});interaction_log[_0x279e('0x22')](_0x279e('0x69'),_0x33c27c[_0x279e('0x61')]['id'],_0x33c27c[_0x279e('0x61')][_0x279e('0x39')],_0x33c27c[_0x279e('0x61')][_0x279e('0x6a')],_0x479fb6[_0x279e('0x68')]['id'],_0x33c27c[_0x279e('0x59')]?JSON[_0x279e('0x26')](_0x33c27c[_0x279e('0x59')]):_0x279e('0x6b'));return respondWithRpcPromise(_0x279e('0x6c'),_0x279e('0x6d'),_0x479fb6);}return null;})[_0x279e('0x21')](function(_0x41baef){var _0x2261ec=_0x279e('0x6e')+_0x41baef[_0x279e('0x29')][_0x279e('0x6f')];return db['sequelize'][_0x279e('0x42')](_0x2261ec,{'type':db['Sequelize'][_0x279e('0x70')][_0x279e('0x71')],'raw':!![]})[_0x279e('0x21')](function(_0x1057ca){return _0x1057ca;});})['then'](function(_0x4b5303){if(_0x4b5303){_0x479fb6[_0x279e('0x29')][_0x279e('0x72')]=_0x4b5303[0x0];if(!_0x33c27c[_0x279e('0x59')]['UserId'])return;return db['User'][_0x279e('0x57')]({'where':{'id':_0x33c27c[_0x279e('0x59')][_0x279e('0x60')],'role':'agent'},'attributes':['id',_0x279e('0x39'),_0x279e('0x73'),_0x279e('0x74'),_0x279e('0x75')],'raw':!![]});}return null;})['then'](function(_0x1c1ea0){if(!_0x1c1ea0)return null;_0x479fb6['message'][_0x279e('0x62')]=_0x1c1ea0;return _0x479fb6;})[_0x279e('0x21')](function(_0x407270){if(_0x407270){if(_0x33c27c[_0x279e('0x59')][_0x279e('0x76')]){_0x479fb6[_0x279e('0x29')]['interface']=util[_0x279e('0x5e')]('SIP/%s',_0x33c27c[_0x279e('0x61')][_0x279e('0x39')]);_0x479fb6[_0x279e('0x29')][_0x279e('0x77')]=_0x479fb6[_0x279e('0x77')];_0x479fb6[_0x279e('0x29')]['motionChannel']=_0x479fb6[_0x279e('0x77')];_0x479fb6['message']['event']=_0x279e('0x78');return respondWithRpcPromise(_0x279e('0x79'),'EventManager',{'event':'acceptmessage','message':_0x479fb6[_0x279e('0x29')]},client9002)[_0x279e('0x21')](function(){return _0x479fb6;});}return _0x479fb6;}return null;})[_0x279e('0x21')](respondWithResult(_0x13db5e,null))['catch'](handleError(_0x13db5e,null));};var interaction_log=require(_0x279e('0x13'))(_0x279e('0x7a'));exports[_0x279e('0x7b')]=function(_0x1ee8f1,_0x4db8ec,_0x35ee0e){var _0x423321={'agent':{},'channel':_0x279e('0x5b')};if(_0x1ee8f1[_0x279e('0x59')]['id']){delete _0x1ee8f1[_0x279e('0x59')]['id'];}_0x1ee8f1['body'][_0x279e('0x60')]=_0x1ee8f1[_0x279e('0x59')][_0x279e('0x60')]||_0x1ee8f1[_0x279e('0x61')]['id'];_0x423321[_0x279e('0x62')]['id']=_0x1ee8f1[_0x279e('0x59')][_0x279e('0x60')];return db['SmsMessage'][_0x279e('0x57')]({'where':{'id':_0x1ee8f1[_0x279e('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4db8ec,null))['then'](function(_0x4099b1){if(_0x4099b1){_0x423321['message']=_0x4099b1[_0x279e('0x63')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x4099b1[_0x279e('0x65')]}});}return null;})[_0x279e('0x21')](handleEntityNotFound(_0x4db8ec,null))[_0x279e('0x21')](function(_0x56a754){if(_0x56a754){_0x423321[_0x279e('0x68')]=_0x56a754[_0x279e('0x63')]({'plain':!![]});interaction_log[_0x279e('0x22')](_0x279e('0x7c'),_0x1ee8f1[_0x279e('0x61')]['id'],_0x1ee8f1[_0x279e('0x61')][_0x279e('0x39')],_0x1ee8f1[_0x279e('0x61')][_0x279e('0x6a')],_0x423321['interaction']['id'],_0x1ee8f1[_0x279e('0x59')]?JSON[_0x279e('0x26')](_0x1ee8f1[_0x279e('0x59')]):_0x279e('0x6b'));return respondWithRpcPromise(_0x279e('0x7d'),_0x279e('0x7e'),_0x423321);}return null;})[_0x279e('0x21')](function(_0x1c922e){var _0x46f074='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1c922e[_0x279e('0x29')][_0x279e('0x6f')];return db['sequelize']['query'](_0x46f074,{'type':db[_0x279e('0x7f')][_0x279e('0x70')][_0x279e('0x71')],'raw':!![]})['then'](function(_0x5ca773){return _0x5ca773;});})['then'](function(_0x1be81e){if(_0x1be81e){_0x423321['message']['contact']=_0x1be81e[0x0];if(!_0x1ee8f1[_0x279e('0x59')][_0x279e('0x60')])return;return db[_0x279e('0x80')][_0x279e('0x57')]({'where':{'id':_0x1ee8f1[_0x279e('0x59')]['UserId'],'role':'agent'},'attributes':['id',_0x279e('0x39'),_0x279e('0x73'),_0x279e('0x74'),_0x279e('0x75')],'raw':!![]});}return null;})[_0x279e('0x21')](function(_0x31dc13){if(!_0x31dc13)return null;_0x423321['message']['agent']=_0x31dc13;return _0x423321;})[_0x279e('0x21')](function(_0x53f891){if(_0x53f891){_0x53f891[_0x279e('0x29')][_0x279e('0x81')]=util[_0x279e('0x5e')]('SIP/%s',_0x1ee8f1[_0x279e('0x61')][_0x279e('0x39')]);_0x53f891['message'][_0x279e('0x77')]=_0x423321['channel'];_0x53f891[_0x279e('0x29')]['motionChannel']=_0x423321[_0x279e('0x77')];_0x53f891['message'][_0x279e('0x82')]=_0x279e('0x7b');respondWithRpcPromise(_0x279e('0x79'),'EventManager',{'event':_0x279e('0x83'),'message':_0x53f891['message']},client9002);return _0x423321;}return null;})[_0x279e('0x21')](respondWithResult(_0x4db8ec,null))[_0x279e('0x2b')](handleError(_0x4db8ec,null));};exports[_0x279e('0x2d')]=function(_0x989b7c,_0x3e8bb3,_0x4cf275){if(_0x989b7c[_0x279e('0x59')]['id']){delete _0x989b7c[_0x279e('0x59')]['id'];}var _0x594e6b;return db['SmsMessage'][_0x279e('0x57')]({'where':{'id':_0x989b7c[_0x279e('0x56')]['id']}})[_0x279e('0x21')](handleEntityNotFound(_0x3e8bb3,null))[_0x279e('0x21')](function(_0x56d209){if(_0x56d209){_0x594e6b=_0x56d209;return db['SmsAccount'][_0x279e('0x57')]({'where':{'id':_0x56d209[_0x279e('0x84')]}});}})[_0x279e('0x21')](handleEntityNotFound(_0x3e8bb3,null))[_0x279e('0x21')](function(_0x444c44){if(_0x444c44){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x279e('0x2d'),'received\x20delivery\x20report\x20from',_0x444c44[_0x279e('0x3f')],util[_0x279e('0x85')](_0x989b7c[_0x279e('0x59')],{'showHidden':![],'depth':null}));switch(_0x444c44['type']){case'twilio':if(_0x989b7c[_0x279e('0x59')]['MessageSid']&&_0x989b7c['body'][_0x279e('0x86')]===_0x594e6b['messageId']){return _0x594e6b[_0x279e('0x35')]({'read':!![]});}else{logger[_0x279e('0x27')](_0x279e('0x87'),_0x279e('0x2d'),'twilio',util[_0x279e('0x85')](_0x989b7c[_0x279e('0x59')],{'showHidden':![],'depth':null}));}break;case _0x279e('0x88'):if(_0x989b7c[_0x279e('0x59')][_0x279e('0x89')]&&_0x989b7c['body']['MessageUUID']===_0x594e6b[_0x279e('0x8a')]&&_[_0x279e('0x8b')]([_0x279e('0x8c'),_0x279e('0x8d')],_0x989b7c[_0x279e('0x59')][_0x279e('0x8e')])>=0x0){return _0x594e6b[_0x279e('0x35')]({'read':!![]});}else{logger[_0x279e('0x27')](_0x279e('0x87'),_0x279e('0x2d'),'plivio',util[_0x279e('0x85')](_0x989b7c['body'],{'showHidden':![],'depth':null}));}break;case _0x279e('0x8f'):var _0x18ca5f=_0x989b7c[_0x279e('0x59')]['results'][0x0];if(_0x18ca5f[_0x279e('0x2d')][_0x279e('0x90')]===_0x279e('0x91')){return _0x594e6b[_0x279e('0x35')]({'read':!![]});}else{logger['error'](_0x279e('0x87'),'status',_0x279e('0x8f'),util['inspect'](_0x989b7c[_0x279e('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x594e6b;}})[_0x279e('0x21')](respondWithResult(_0x3e8bb3,null))[_0x279e('0x2b')](handleError(_0x3e8bb3,null));}; \ No newline at end of file +var _0x85ed=['options','includeAll','findAll','rows','show','params','find','create','body','describe','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','update','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','SmsInteractionId','interaction','RejectMessage','rejectMessage','ContactId','Sequelize','User','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','delivered','Status','plivio','infobip','groupName','DELIVERED','eml-format','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','jayson/promise','client','http','request','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save','destroy','name','send','index','map','SmsMessage','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge'];(function(_0x43f489,_0x2b4fea){var _0x4134b4=function(_0x4365f6){while(--_0x4365f6){_0x43f489['push'](_0x43f489['shift']());}};_0x4134b4(++_0x2b4fea);}(_0x85ed,0x1e7));var _0xd85e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x85ed[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0xd85e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd85e('0x1'));var moment=require(_0xd85e('0x2'));var BPromise=require(_0xd85e('0x3'));var Mustache=require(_0xd85e('0x4'));var util=require(_0xd85e('0x5'));var path=require('path');var sox=require(_0xd85e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd85e('0x7'));var squel=require(_0xd85e('0x8'));var crypto=require(_0xd85e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd85e('0xa'));var querystring=require(_0xd85e('0xb'));var Papa=require(_0xd85e('0xc'));var Redis=require(_0xd85e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd85e('0xe'));var as=require(_0xd85e('0xf'));var hardwareService=require(_0xd85e('0x10'));var logger=require(_0xd85e('0x11'))(_0xd85e('0x12'));var utils=require(_0xd85e('0x13'));var config=require(_0xd85e('0x14'));var licenseUtil=require(_0xd85e('0x15'));var db=require(_0xd85e('0x16'))['db'];config[_0xd85e('0x17')]=_[_0xd85e('0x18')](config['redis'],{'host':_0xd85e('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd85e('0x1a'))['register'](socket);var jayson=require(_0xd85e('0x1b'));var client=jayson[_0xd85e('0x1c')][_0xd85e('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xd85e('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xc59173,_0x4df40d,_0x39acb2,_0x447cd5){return new BPromise(function(_0x125f60,_0xccc81f){var _0x3750be=_0x447cd5||client;return _0x3750be[_0xd85e('0x1e')](_0xc59173,_0x39acb2)[_0xd85e('0x1f')](function(_0x12fbf1){logger['info']('SmsMessage,\x20%s,\x20%s',_0x4df40d,_0xd85e('0x20'));logger[_0xd85e('0x21')](_0xd85e('0x22'),_0x4df40d,_0xd85e('0x20'),JSON[_0xd85e('0x23')](_0x12fbf1));if(_0x12fbf1[_0xd85e('0x24')]){if(_0x12fbf1[_0xd85e('0x24')]['code']===0x1f4){logger[_0xd85e('0x24')](_0xd85e('0x25'),_0x4df40d,_0x12fbf1[_0xd85e('0x24')][_0xd85e('0x26')]);return _0xccc81f(_0x12fbf1[_0xd85e('0x24')][_0xd85e('0x26')]);}logger[_0xd85e('0x24')]('SmsMessage,\x20%s,\x20%s',_0x4df40d,_0x12fbf1[_0xd85e('0x24')][_0xd85e('0x26')]);return _0x125f60(_0x12fbf1[_0xd85e('0x24')]['message']);}else{logger[_0xd85e('0x27')]('SmsMessage,\x20%s,\x20%s',_0x4df40d,'request\x20sent');_0x125f60(_0x12fbf1[_0xd85e('0x28')][_0xd85e('0x26')]);}})[_0xd85e('0x29')](function(_0x45baa9){logger[_0xd85e('0x24')](_0xd85e('0x25'),_0x4df40d,_0x45baa9);_0xccc81f(_0x45baa9);});});}function respondWithStatusCode(_0x1c81d9,_0xa92c43){_0xa92c43=_0xa92c43||0xcc;return function(_0x12f40d){if(_0x12f40d){return _0x1c81d9[_0xd85e('0x2a')](_0xa92c43);}return _0x1c81d9['status'](_0xa92c43)[_0xd85e('0x2b')]();};}function respondWithResult(_0x24aeaf,_0x412d45){_0x412d45=_0x412d45||0xc8;return function(_0x28aab4){if(_0x28aab4){return _0x24aeaf[_0xd85e('0x2c')](_0x412d45)[_0xd85e('0x2d')](_0x28aab4);}};}function respondWithFilteredResult(_0x461413,_0x3b9d0c){return function(_0x336e9e){if(_0x336e9e){var _0x12e820=typeof _0x3b9d0c[_0xd85e('0x2e')]==='undefined'&&typeof _0x3b9d0c[_0xd85e('0x2f')]==='undefined';var _0x417229=_0x336e9e['count'];var _0x1ab657=_0x12e820?0x0:_0x3b9d0c['offset'];var _0x1537d1=_0x12e820?_0x336e9e[_0xd85e('0x30')]:_0x3b9d0c[_0xd85e('0x2e')]+_0x3b9d0c[_0xd85e('0x2f')];var _0x3835e7;if(_0x1537d1>=_0x417229){_0x1537d1=_0x417229;_0x3835e7=0xc8;}else{_0x3835e7=0xce;}_0x461413[_0xd85e('0x2c')](_0x3835e7);return _0x461413[_0xd85e('0x31')](_0xd85e('0x32'),_0x1ab657+'-'+_0x1537d1+'/'+_0x417229)['json'](_0x336e9e);}return null;};}function patchUpdates(_0x80c368){return function(_0x3ac3a4){try{jsonpatch[_0xd85e('0x33')](_0x3ac3a4,_0x80c368,!![]);}catch(_0x52aa96){return BPromise[_0xd85e('0x34')](_0x52aa96);}return _0x3ac3a4[_0xd85e('0x35')]();};}function saveUpdates(_0x5d1f1a,_0xd50baf){return function(_0x266a8e){if(_0x266a8e){return _0x266a8e['update'](_0x5d1f1a)[_0xd85e('0x1f')](function(_0x4b8201){return _0x4b8201;});}return null;};}function removeEntity(_0x49c0f0,_0x249651){return function(_0x366e4d){if(_0x366e4d){return _0x366e4d[_0xd85e('0x36')]()[_0xd85e('0x1f')](function(){_0x49c0f0[_0xd85e('0x2c')](0xcc)[_0xd85e('0x2b')]();});}};}function handleEntityNotFound(_0x2deaef,_0x3ea565){return function(_0xa5b3f2){if(!_0xa5b3f2){_0x2deaef[_0xd85e('0x2a')](0x194);}return _0xa5b3f2;};}function handleError(_0x2a8f69,_0x212e00){_0x212e00=_0x212e00||0x1f4;return function(_0x344215){logger[_0xd85e('0x24')](_0x344215['stack']);if(_0x344215[_0xd85e('0x37')]){delete _0x344215['name'];}_0x2a8f69[_0xd85e('0x2c')](_0x212e00)[_0xd85e('0x38')](_0x344215);};}exports[_0xd85e('0x39')]=function(_0x335567,_0x166424){var _0x3bcf8a={},_0x78cfe9={},_0x18641f={'count':0x0,'rows':[]};var _0x1ede3a=_[_0xd85e('0x3a')](db[_0xd85e('0x3b')][_0xd85e('0x3c')],function(_0x1f86f4){return{'name':_0x1f86f4['fieldName'],'type':_0x1f86f4[_0xd85e('0x3d')][_0xd85e('0x3e')]};});_0x78cfe9[_0xd85e('0x3f')]=_[_0xd85e('0x3a')](_0x1ede3a,_0xd85e('0x37'));_0x78cfe9['query']=_[_0xd85e('0x40')](_0x335567[_0xd85e('0x41')]);_0x78cfe9[_0xd85e('0x42')]=_[_0xd85e('0x43')](_0x78cfe9[_0xd85e('0x3f')],_0x78cfe9[_0xd85e('0x41')]);_0x3bcf8a[_0xd85e('0x44')]=_[_0xd85e('0x43')](_0x78cfe9[_0xd85e('0x3f')],qs['fields'](_0x335567[_0xd85e('0x41')][_0xd85e('0x45')]));_0x3bcf8a[_0xd85e('0x44')]=_0x3bcf8a[_0xd85e('0x44')][_0xd85e('0x46')]?_0x3bcf8a[_0xd85e('0x44')]:_0x78cfe9[_0xd85e('0x3f')];if(!_0x335567[_0xd85e('0x41')]['hasOwnProperty']('nolimit')){_0x3bcf8a['limit']=qs[_0xd85e('0x2f')](_0x335567[_0xd85e('0x41')][_0xd85e('0x2f')]);_0x3bcf8a['offset']=qs[_0xd85e('0x2e')](_0x335567[_0xd85e('0x41')][_0xd85e('0x2e')]);}_0x3bcf8a[_0xd85e('0x47')]=qs[_0xd85e('0x48')](_0x335567['query'][_0xd85e('0x48')]);_0x3bcf8a[_0xd85e('0x49')]=qs[_0xd85e('0x42')](_[_0xd85e('0x4a')](_0x335567['query'],_0x78cfe9[_0xd85e('0x42')]),_0x1ede3a);if(_0x335567[_0xd85e('0x41')][_0xd85e('0x4b')]){_0x3bcf8a[_0xd85e('0x49')]=_[_0xd85e('0x4c')](_0x3bcf8a['where'],{'$or':_[_0xd85e('0x3a')](_0x1ede3a,function(_0x1ca963){if(_0x1ca963['type']!=='VIRTUAL'){var _0x2f1173={};_0x2f1173[_0x1ca963['name']]={'$like':'%'+_0x335567[_0xd85e('0x41')][_0xd85e('0x4b')]+'%'};return _0x2f1173;}})});}_0x3bcf8a=_['merge']({},_0x3bcf8a,_0x335567[_0xd85e('0x4d')]);var _0x5c128f={'where':_0x3bcf8a['where']};return db['SmsMessage']['count'](_0x5c128f)[_0xd85e('0x1f')](function(_0x1389e5){_0x18641f['count']=_0x1389e5;if(_0x335567[_0xd85e('0x41')][_0xd85e('0x4e')]){_0x3bcf8a['include']=[{'all':!![]}];}return db[_0xd85e('0x3b')][_0xd85e('0x4f')](_0x3bcf8a);})[_0xd85e('0x1f')](function(_0x33cb8f){_0x18641f[_0xd85e('0x50')]=_0x33cb8f;return _0x18641f;})['then'](respondWithFilteredResult(_0x166424,_0x3bcf8a))[_0xd85e('0x29')](handleError(_0x166424,null));};exports[_0xd85e('0x51')]=function(_0x271953,_0x16b7e4){var _0x25ebfc={'raw':!![],'where':{'id':_0x271953[_0xd85e('0x52')]['id']}},_0x46fa46={};_0x46fa46['model']=_['keys'](db['SmsMessage'][_0xd85e('0x3c')]);_0x46fa46['query']=_['keys'](_0x271953['query']);_0x46fa46[_0xd85e('0x42')]=_[_0xd85e('0x43')](_0x46fa46[_0xd85e('0x3f')],_0x46fa46[_0xd85e('0x41')]);_0x25ebfc[_0xd85e('0x44')]=_[_0xd85e('0x43')](_0x46fa46[_0xd85e('0x3f')],qs['fields'](_0x271953['query'][_0xd85e('0x45')]));_0x25ebfc[_0xd85e('0x44')]=_0x25ebfc['attributes'][_0xd85e('0x46')]?_0x25ebfc['attributes']:_0x46fa46['model'];if(_0x271953[_0xd85e('0x41')]['includeAll']){_0x25ebfc['include']=[{'all':!![]}];}_0x25ebfc=_[_0xd85e('0x4c')]({},_0x25ebfc,_0x271953[_0xd85e('0x4d')]);return db[_0xd85e('0x3b')][_0xd85e('0x53')](_0x25ebfc)[_0xd85e('0x1f')](handleEntityNotFound(_0x16b7e4,null))['then'](respondWithResult(_0x16b7e4,null))[_0xd85e('0x29')](handleError(_0x16b7e4,null));};exports[_0xd85e('0x54')]=function(_0x221863,_0x583c88){return db[_0xd85e('0x3b')][_0xd85e('0x54')](_0x221863[_0xd85e('0x55')],{})[_0xd85e('0x1f')](respondWithResult(_0x583c88,0xc9))['catch'](handleError(_0x583c88,null));};exports['update']=function(_0x17a047,_0x3d0682){if(_0x17a047[_0xd85e('0x55')]['id']){delete _0x17a047[_0xd85e('0x55')]['id'];}return db[_0xd85e('0x3b')][_0xd85e('0x53')]({'where':{'id':_0x17a047['params']['id']}})['then'](handleEntityNotFound(_0x3d0682,null))[_0xd85e('0x1f')](saveUpdates(_0x17a047['body'],null))[_0xd85e('0x1f')](respondWithResult(_0x3d0682,null))['catch'](handleError(_0x3d0682,null));};exports[_0xd85e('0x36')]=function(_0x276d9a,_0x214747){return db[_0xd85e('0x3b')][_0xd85e('0x53')]({'where':{'id':_0x276d9a[_0xd85e('0x52')]['id']}})[_0xd85e('0x1f')](handleEntityNotFound(_0x214747,null))['then'](removeEntity(_0x214747,null))[_0xd85e('0x29')](handleError(_0x214747,null));};exports['describe']=function(_0x11ccea,_0x390185){return db[_0xd85e('0x3b')][_0xd85e('0x56')]()[_0xd85e('0x1f')](respondWithResult(_0x390185,null))['catch'](handleError(_0x390185,null));};var interaction_log=require(_0xd85e('0x11'))(_0xd85e('0x57'));exports[_0xd85e('0x58')]=function(_0x4225ff,_0x2d33a1,_0x513588){var _0x26abbe={'agent':{},'channel':_0xd85e('0x59')};if(_0x4225ff[_0xd85e('0x55')]['id']){delete _0x4225ff[_0xd85e('0x55')]['id'];}_0x4225ff['body'][_0xd85e('0x5a')]=!![];_0x4225ff['body']['readAt']=moment()[_0xd85e('0x5b')](_0xd85e('0x5c'));_0x4225ff[_0xd85e('0x55')][_0xd85e('0x5d')]=_0x4225ff[_0xd85e('0x55')]['UserId']||_0x4225ff[_0xd85e('0x5e')]['id'];_0x26abbe[_0xd85e('0x5f')]['id']=_0x4225ff[_0xd85e('0x55')][_0xd85e('0x5d')];return db[_0xd85e('0x3b')][_0xd85e('0x53')]({'where':{'id':_0x4225ff[_0xd85e('0x52')]['id'],'UserId':null}})[_0xd85e('0x1f')](handleEntityNotFound(_0x2d33a1,null))[_0xd85e('0x1f')](saveUpdates(_0x4225ff[_0xd85e('0x55')],null))[_0xd85e('0x1f')](function(_0x52e7af){if(_0x52e7af){_0x26abbe[_0xd85e('0x26')]=_0x52e7af[_0xd85e('0x60')]({'plain':!![]});return db[_0xd85e('0x61')][_0xd85e('0x53')]({'where':{'id':_0x52e7af['SmsInteractionId']}});}return null;})[_0xd85e('0x1f')](handleEntityNotFound(_0x2d33a1,null))['then'](function(_0x3bd129){if(_0x3bd129){return _0x3bd129[_0xd85e('0x62')]({'UserId':_0x4225ff[_0xd85e('0x55')]['UserId'],'read1stAt':_['isNil'](_0x3bd129['read1stAt'])?moment()[_0xd85e('0x5b')](_0xd85e('0x5c')):undefined});}return null;})[_0xd85e('0x1f')](function(_0x1a963f){if(_0x1a963f){_0x26abbe['interaction']=_0x1a963f[_0xd85e('0x60')]({'plain':!![]});interaction_log[_0xd85e('0x27')](_0xd85e('0x63'),_0x4225ff['user']['id'],_0x4225ff['user'][_0xd85e('0x37')],_0x4225ff[_0xd85e('0x5e')][_0xd85e('0x64')],_0x26abbe['interaction']['id'],_0x4225ff[_0xd85e('0x55')]?JSON['stringify'](_0x4225ff[_0xd85e('0x55')]):_0xd85e('0x65'));return respondWithRpcPromise(_0xd85e('0x66'),_0xd85e('0x67'),_0x26abbe);}return null;})[_0xd85e('0x1f')](function(_0x20c5e0){var _0x425661='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20c5e0['message']['ContactId'];return db['sequelize'][_0xd85e('0x41')](_0x425661,{'type':db['Sequelize'][_0xd85e('0x68')][_0xd85e('0x69')],'raw':!![]})[_0xd85e('0x1f')](function(_0x5c9f73){return _0x5c9f73;});})[_0xd85e('0x1f')](function(_0x22443f){if(_0x22443f){_0x26abbe[_0xd85e('0x26')][_0xd85e('0x6a')]=_0x22443f[0x0];if(!_0x4225ff[_0xd85e('0x55')]['UserId'])return;return db['User'][_0xd85e('0x53')]({'where':{'id':_0x4225ff['body']['UserId'],'role':'agent'},'attributes':['id','name',_0xd85e('0x6b'),_0xd85e('0x6c'),_0xd85e('0x6d')],'raw':!![]});}return null;})[_0xd85e('0x1f')](function(_0x18b407){if(!_0x18b407)return null;_0x26abbe[_0xd85e('0x26')][_0xd85e('0x5f')]=_0x18b407;return _0x26abbe;})[_0xd85e('0x1f')](function(_0x547d04){if(_0x547d04){if(_0x4225ff['body'][_0xd85e('0x6e')]){_0x26abbe[_0xd85e('0x26')][_0xd85e('0x6f')]=util[_0xd85e('0x5b')](_0xd85e('0x70'),_0x4225ff[_0xd85e('0x5e')][_0xd85e('0x37')]);_0x26abbe[_0xd85e('0x26')][_0xd85e('0x71')]=_0x26abbe[_0xd85e('0x71')];_0x26abbe['message'][_0xd85e('0x72')]=_0x26abbe[_0xd85e('0x71')];_0x26abbe[_0xd85e('0x26')]['event']=_0xd85e('0x58');return respondWithRpcPromise(_0xd85e('0x73'),_0xd85e('0x73'),{'event':_0xd85e('0x74'),'message':_0x26abbe['message']},client9002)[_0xd85e('0x1f')](function(){return _0x26abbe;});}return _0x26abbe;}return null;})['then'](respondWithResult(_0x2d33a1,null))[_0xd85e('0x29')](handleError(_0x2d33a1,null));};var interaction_log=require(_0xd85e('0x11'))(_0xd85e('0x57'));exports[_0xd85e('0x34')]=function(_0x3fe5c6,_0x250488,_0x2c4c03){var _0x23b7ed={'agent':{},'channel':_0xd85e('0x59')};if(_0x3fe5c6['body']['id']){delete _0x3fe5c6[_0xd85e('0x55')]['id'];}_0x3fe5c6[_0xd85e('0x55')][_0xd85e('0x5d')]=_0x3fe5c6['body'][_0xd85e('0x5d')]||_0x3fe5c6['user']['id'];_0x23b7ed[_0xd85e('0x5f')]['id']=_0x3fe5c6[_0xd85e('0x55')][_0xd85e('0x5d')];return db[_0xd85e('0x3b')]['find']({'where':{'id':_0x3fe5c6['params']['id'],'UserId':null}})[_0xd85e('0x1f')](handleEntityNotFound(_0x250488,null))[_0xd85e('0x1f')](function(_0x1cd5c3){if(_0x1cd5c3){_0x23b7ed[_0xd85e('0x26')]=_0x1cd5c3['get']({'plain':!![]});return db['SmsInteraction'][_0xd85e('0x53')]({'where':{'id':_0x1cd5c3[_0xd85e('0x75')]}});}return null;})[_0xd85e('0x1f')](handleEntityNotFound(_0x250488,null))[_0xd85e('0x1f')](function(_0xb2201f){if(_0xb2201f){_0x23b7ed[_0xd85e('0x76')]=_0xb2201f[_0xd85e('0x60')]({'plain':!![]});interaction_log[_0xd85e('0x27')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3fe5c6['user']['id'],_0x3fe5c6[_0xd85e('0x5e')][_0xd85e('0x37')],_0x3fe5c6[_0xd85e('0x5e')]['role'],_0x23b7ed['interaction']['id'],_0x3fe5c6[_0xd85e('0x55')]?JSON[_0xd85e('0x23')](_0x3fe5c6['body']):_0xd85e('0x65'));return respondWithRpcPromise(_0xd85e('0x77'),_0xd85e('0x78'),_0x23b7ed);}return null;})['then'](function(_0x2defd3){var _0x37edfe='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2defd3['message'][_0xd85e('0x79')];return db['sequelize'][_0xd85e('0x41')](_0x37edfe,{'type':db[_0xd85e('0x7a')][_0xd85e('0x68')][_0xd85e('0x69')],'raw':!![]})[_0xd85e('0x1f')](function(_0x111cd0){return _0x111cd0;});})[_0xd85e('0x1f')](function(_0x4ad937){if(_0x4ad937){_0x23b7ed[_0xd85e('0x26')]['contact']=_0x4ad937[0x0];if(!_0x3fe5c6['body'][_0xd85e('0x5d')])return;return db[_0xd85e('0x7b')][_0xd85e('0x53')]({'where':{'id':_0x3fe5c6[_0xd85e('0x55')]['UserId'],'role':_0xd85e('0x5f')},'attributes':['id',_0xd85e('0x37'),_0xd85e('0x6b'),'email',_0xd85e('0x6d')],'raw':!![]});}return null;})[_0xd85e('0x1f')](function(_0x4bef85){if(!_0x4bef85)return null;_0x23b7ed['message'][_0xd85e('0x5f')]=_0x4bef85;return _0x23b7ed;})[_0xd85e('0x1f')](function(_0x409e70){if(_0x409e70){_0x409e70['message'][_0xd85e('0x6f')]=util[_0xd85e('0x5b')](_0xd85e('0x70'),_0x3fe5c6[_0xd85e('0x5e')][_0xd85e('0x37')]);_0x409e70[_0xd85e('0x26')][_0xd85e('0x71')]=_0x23b7ed['channel'];_0x409e70[_0xd85e('0x26')][_0xd85e('0x72')]=_0x23b7ed['channel'];_0x409e70[_0xd85e('0x26')]['event']=_0xd85e('0x34');respondWithRpcPromise(_0xd85e('0x73'),'EventManager',{'event':_0xd85e('0x7c'),'message':_0x409e70['message']},client9002);return _0x23b7ed;}return null;})['then'](respondWithResult(_0x250488,null))[_0xd85e('0x29')](handleError(_0x250488,null));};exports['status']=function(_0x2af69c,_0x3baeee,_0x471dbb){if(_0x2af69c[_0xd85e('0x55')]['id']){delete _0x2af69c['body']['id'];}var _0x22b922;return db[_0xd85e('0x3b')][_0xd85e('0x53')]({'where':{'id':_0x2af69c[_0xd85e('0x52')]['id']}})['then'](handleEntityNotFound(_0x3baeee,null))[_0xd85e('0x1f')](function(_0x5b0180){if(_0x5b0180){_0x22b922=_0x5b0180;return db['SmsAccount']['find']({'where':{'id':_0x5b0180[_0xd85e('0x7d')]}});}})[_0xd85e('0x1f')](handleEntityNotFound(_0x3baeee,null))[_0xd85e('0x1f')](function(_0x49d694){if(_0x49d694){logger[_0xd85e('0x21')](_0xd85e('0x22'),'status',_0xd85e('0x7e'),_0x49d694[_0xd85e('0x3d')],util[_0xd85e('0x7f')](_0x2af69c[_0xd85e('0x55')],{'showHidden':![],'depth':null}));switch(_0x49d694[_0xd85e('0x3d')]){case'twilio':if(_0x2af69c['body'][_0xd85e('0x80')]&&_0x2af69c[_0xd85e('0x55')][_0xd85e('0x80')]===_0x22b922[_0xd85e('0x81')]){return _0x22b922['update']({'read':!![]});}else{logger[_0xd85e('0x24')](_0xd85e('0x82'),_0xd85e('0x2c'),_0xd85e('0x83'),util[_0xd85e('0x7f')](_0x2af69c[_0xd85e('0x55')],{'showHidden':![],'depth':null}));}break;case _0xd85e('0x84'):if(_0x2af69c['body']['MessageUUID']&&_0x2af69c['body'][_0xd85e('0x85')]===_0x22b922[_0xd85e('0x81')]&&_[_0xd85e('0x86')](['sent',_0xd85e('0x87')],_0x2af69c[_0xd85e('0x55')][_0xd85e('0x88')])>=0x0){return _0x22b922['update']({'read':!![]});}else{logger[_0xd85e('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd85e('0x2c'),_0xd85e('0x89'),util[_0xd85e('0x7f')](_0x2af69c[_0xd85e('0x55')],{'showHidden':![],'depth':null}));}break;case _0xd85e('0x8a'):var _0x3c0001=_0x2af69c[_0xd85e('0x55')]['results'][0x0];if(_0x3c0001['status'][_0xd85e('0x8b')]===_0xd85e('0x8c')){return _0x22b922['update']({'read':!![]});}else{logger[_0xd85e('0x24')](_0xd85e('0x82'),'status',_0xd85e('0x8a'),util[_0xd85e('0x7f')](_0x2af69c[_0xd85e('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x22b922;}})['then'](respondWithResult(_0x3baeee,null))['catch'](handleError(_0x3baeee,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 7c90c66..61ea25e 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 _0xd12c=['SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xd12c,0x80));var _0xcd12=function(_0x3f43fa,_0x1ccd65){_0x3f43fa=_0x3f43fa-0x0;var _0x3cf4bb=_0xd12c[_0x3f43fa];return _0x3cf4bb;};'use strict';var EventEmitter=require(_0xcd12('0x0'));var SmsMessage=require(_0xcd12('0x1'))['db'][_0xcd12('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xcd12('0x3')](0x0);var events={'afterCreate':_0xcd12('0x4'),'afterUpdate':_0xcd12('0x5'),'afterDestroy':_0xcd12('0x6')};function emitEvent(_0x3d72a3){return function(_0x1eefcb,_0x493ce1,_0x5047b5){SmsMessageEvents[_0xcd12('0x7')](_0x3d72a3+':'+_0x1eefcb['id'],_0x1eefcb);SmsMessageEvents[_0xcd12('0x7')](_0x3d72a3,_0x1eefcb);_0x5047b5(null);};}for(var e in events){if(events[_0xcd12('0x8')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xcd12('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xd4c9=['events','../../mysqldb','SmsMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x3c8d0c,_0x30b9f6){var _0x47b500=function(_0x29e84a){while(--_0x29e84a){_0x3c8d0c['push'](_0x3c8d0c['shift']());}};_0x47b500(++_0x30b9f6);}(_0xd4c9,0x6c));var _0x9d4c=function(_0x54b062,_0x264bb5){_0x54b062=_0x54b062-0x0;var _0x255e41=_0xd4c9[_0x54b062];return _0x255e41;};'use strict';var EventEmitter=require(_0x9d4c('0x0'));var SmsMessage=require(_0x9d4c('0x1'))['db'][_0x9d4c('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x9d4c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9d4c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x43e56e){return function(_0xfd165d,_0x170ed9,_0x276a35){SmsMessageEvents[_0x9d4c('0x5')](_0x43e56e+':'+_0xfd165d['id'],_0xfd165d);SmsMessageEvents[_0x9d4c('0x5')](_0x43e56e,_0xfd165d);_0x276a35(null);};}for(var e in events){if(events[_0x9d4c('0x6')](e)){var event=events[e];SmsMessage[_0x9d4c('0x7')](e,emitEvent(event));}}module[_0x9d4c('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index c68896b..174fb80 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 _0x9aad=['toLowerCase','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','out','SmsAccount','find','type','twilio','accountSid','phone','messages','create','body','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','POST','session_key','total_sent','internal_order_id','read','connectel','authToken','senderString','https://smsapi.connectel.se/api/v2/send/','deliveryReport','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','data','queued_count','head','clickSend','Missing\x20parameters:\x20username,\x20password','authId','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','apiKey','login','text','timestamp','keys','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','direction'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9aad,0x6b));var _0xd9aa=function(_0x1ca882,_0x14f6e6){_0x1ca882=_0x1ca882-0x0;var _0x357d7e=_0x9aad[_0x1ca882];return _0x357d7e;};'use strict';var _=require('lodash');var util=require(_0xd9aa('0x0'));var logger=require(_0xd9aa('0x1'))(_0xd9aa('0x2'));var moment=require(_0xd9aa('0x3'));var BPromise=require(_0xd9aa('0x4'));var rp=require(_0xd9aa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd9aa('0x6'));var config=require(_0xd9aa('0x7'));var attributes=require(_0xd9aa('0x8'));module[_0xd9aa('0x9')]=function(_0x504077,_0x163807){return _0x504077[_0xd9aa('0xa')](_0xd9aa('0xb'),attributes,{'tableName':_0xd9aa('0xc'),'paranoid':![],'indexes':[{'name':_0xd9aa('0xd'),'fields':[_0xd9aa('0xd')]},{'name':_0xd9aa('0xe'),'fields':['body'],'type':_0xd9aa('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4938b2,_0x454c30,_0x2c5354){var _0x1e0018=_0x504077[_0xd9aa('0x10')];var _0x19ae67=_0x4938b2[_0xd9aa('0x11')]({'plain':!![]});if(_0x19ae67[_0xd9aa('0x12')]['toLowerCase']()==='in'||_0x19ae67[_0xd9aa('0x12')][_0xd9aa('0x13')]()==='out'&&!_0x19ae67[_0xd9aa('0x14')]&&!_[_0xd9aa('0x15')](_0x19ae67[_0xd9aa('0x16')])&&!_[_0xd9aa('0x15')](_0x19ae67[_0xd9aa('0x17')])){_0x1e0018[_0xd9aa('0x18')][_0xd9aa('0x19')]({'where':{'id':_0x19ae67[_0xd9aa('0x17')]}})[_0xd9aa('0x1a')](function(_0x2c546a){if(_0x2c546a){_0x2c546a[_0xd9aa('0x1b')]({'lastMsgAt':_0x19ae67[_0xd9aa('0x1c')],'lastMsgDirection':_0x19ae67[_0xd9aa('0x12')][_0xd9aa('0x13')]()});}})[_0xd9aa('0x1d')](function(_0x2347c2){console[_0xd9aa('0x1e')](_0x2347c2);});}if(_0x19ae67['direction']===_0xd9aa('0x1f')&&!_0x19ae67['secret']){var _0x3cc154;_0x1e0018[_0xd9aa('0x20')][_0xd9aa('0x21')]({'where':{'id':_0x19ae67['SmsAccountId']},'raw':!![]})[_0xd9aa('0x1a')](function(_0x31f39e){_0x3cc154=_0x31f39e;if(_0x3cc154&&_0x3cc154[_0xd9aa('0x22')]){switch(_0x3cc154[_0xd9aa('0x22')]){case _0xd9aa('0x23'):var _0x5b7d86=require('twilio');if(_0x3cc154[_0xd9aa('0x24')]&&_0x3cc154['authToken']&&_0x3cc154[_0xd9aa('0x25')]){var _0x1bacc9=new _0x5b7d86(_0x3cc154['accountSid'],_0x3cc154['authToken']);_0x1bacc9[_0xd9aa('0x26')][_0xd9aa('0x27')]({'body':_0x19ae67[_0xd9aa('0x28')],'to':_0x19ae67[_0xd9aa('0x25')],'from':_0x3cc154[_0xd9aa('0x25')],'statusCallback':_0x3cc154[_0xd9aa('0x29')]+_0xd9aa('0x2a')+_0x19ae67['id']+_0xd9aa('0x2b')+_0x3cc154[_0xd9aa('0x2c')]})[_0xd9aa('0x1a')](function(_0x356bf2){if(_0x356bf2['sid']){return _0x4938b2[_0xd9aa('0x1b')]({'messageId':_0x356bf2[_0xd9aa('0x2d')]});}})['catch'](function(_0x214b84){logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),_0xd9aa('0x2f'),'twilio',util[_0xd9aa('0x30')](_0x214b84,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd9aa('0x2e'),_0xd9aa('0x2f'),_0xd9aa('0x23'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xd9aa('0x31'):var _0xa44ed2=_0xd9aa('0x32');if(_0x3cc154[_0xd9aa('0x33')]&&_0x3cc154[_0xd9aa('0x34')]){var _0x21b492={'recipient':[_0x19ae67[_0xd9aa('0x25')]],'message':_0x19ae67[_0xd9aa('0x28')],'message_type':_0x3cc154['smsMethod']};if(_0x3cc154[_0xd9aa('0x35')]&&_0x3cc154[_0xd9aa('0x35')]!=='SI'){_0x21b492['sender']=_0x3cc154['phone'];}var _0x176fe4={'url':_0xa44ed2+_0xd9aa('0x36')+_0x3cc154[_0xd9aa('0x33')]+_0xd9aa('0x37')+_0x3cc154['password'],'method':_0xd9aa('0x38')};rp(_0x176fe4)[_0xd9aa('0x1a')](function(_0x5a64ed){var _0x5bd0b5=_0x5a64ed[_0xd9aa('0x39')](';');var _0x2ab1ae={'user_key':_0x5bd0b5[0x0],'session_key':_0x5bd0b5[0x1]};_0x176fe4={'url':_0xa44ed2+'sms','method':_0xd9aa('0x3a'),'headers':{'user_key':_0x2ab1ae['user_key'],'Session_key':_0x2ab1ae[_0xd9aa('0x3b')]},'json':!![],'body':_0x21b492};return rp(_0x176fe4);})['then'](function(_0x1b4f9e){if(_0x1b4f9e[_0xd9aa('0x3c')]>=0x1){var _0x33ffea={'messageId':_0x1b4f9e[_0xd9aa('0x3d')]};if(_0x3cc154['smsMethod']!=='GP'||!_0x3cc154['deliveryReport']){_0x33ffea[_0xd9aa('0x3e')]=!![];}return _0x4938b2[_0xd9aa('0x1b')](_0x33ffea);}else{return logger[_0xd9aa('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd9aa('0x2f'),_0xd9aa('0x31'),util[_0xd9aa('0x30')](_0x1b4f9e,{'showHidden':![],'depth':null}));}})[_0xd9aa('0x1d')](function(_0x183e9a){return logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),'afterCreate',_0xd9aa('0x31'),util['inspect'](_0x183e9a,{'showHidden':![],'depth':null}));});}else{logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),_0xd9aa('0x2f'),_0xd9aa('0x31'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xd9aa('0x3f'):if(_0x3cc154[_0xd9aa('0x40')]){var _0x24e064={'recipient':_0x19ae67['phone'],'message':_0x19ae67[_0xd9aa('0x28')],'sender':_0x3cc154[_0xd9aa('0x41')]||_0x3cc154[_0xd9aa('0x25')],'authorization':_0x3cc154['authToken']};var _0x454c30={'method':_0xd9aa('0x3a'),'uri':_0xd9aa('0x42'),'body':_0x24e064,'json':!![]};rp(_0x454c30)[_0xd9aa('0x1a')](function(_0x19db76){var _0x1ca6b3={'messageId':_0x19db76['requestid']};if(!_0x3cc154[_0xd9aa('0x43')]){_0x1ca6b3[_0xd9aa('0x3e')]=!![];}return _0x4938b2['update'](_0x1ca6b3);})['catch'](function(_0x2e92b1){logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),'afterCreate','connectel',util[_0xd9aa('0x30')](_0x2e92b1,{'showHidden':![],'depth':null}));});}else{logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),_0xd9aa('0x2f'),_0xd9aa('0x3f'),'Missing\x20parameters:\x20authToken');}break;case _0xd9aa('0x44'):if(_0x3cc154[_0xd9aa('0x33')]&&_0x3cc154[_0xd9aa('0x34')]){var _0x24e064={'messages':[{'source':'xCALLY\x20Motion','to':_0x19ae67[_0xd9aa('0x25')],'body':_0x19ae67[_0xd9aa('0x28')],'from':_0x3cc154[_0xd9aa('0x41')]||_0x3cc154[_0xd9aa('0x25')]}]};var _0x527b79=util[_0xd9aa('0x45')](_0xd9aa('0x46'),_0x3cc154['username'],_0x3cc154['password']);var _0x454c30={'method':'POST','uri':_0xd9aa('0x47'),'body':_0x24e064,'headers':{'Authorization':util[_0xd9aa('0x45')](_0xd9aa('0x48'),new Buffer(_0x527b79)[_0xd9aa('0x49')](_0xd9aa('0x4a')))},'json':!![]};rp(_0x454c30)[_0xd9aa('0x1a')](function(_0x274759){if(_0x274759['http_code']>=0xc8&&_0x274759['http_code']<=0xce){if(_0x274759['data']&&_0x274759[_0xd9aa('0x4b')][_0xd9aa('0x4c')]>0x0){var _0x2f9afa=_[_0xd9aa('0x4d')](_0x274759[_0xd9aa('0x4b')][_0xd9aa('0x26')]);var _0x472410={'messageId':_0x2f9afa['message_id']};if(!_0x3cc154[_0xd9aa('0x43')]){_0x472410[_0xd9aa('0x3e')]=!![];}return _0x4938b2['update'](_0x472410);}else{logger['error'](_0xd9aa('0x2e'),'afterCreate',_0xd9aa('0x4e'),util[_0xd9aa('0x30')](_0x274759,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xd9aa('0x2e'),_0xd9aa('0x2f'),_0xd9aa('0x4e'),util[_0xd9aa('0x30')](_0x274759,{'showHidden':![],'depth':null}));}})[_0xd9aa('0x1d')](function(_0x135d2f){logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),_0xd9aa('0x2f'),_0xd9aa('0x4e'),util[_0xd9aa('0x30')](_0x135d2f,{'showHidden':![],'depth':null}));});}else{logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),_0xd9aa('0x2f'),_0xd9aa('0x4e'),_0xd9aa('0x4f'));}break;case'plivo':if(_0x3cc154[_0xd9aa('0x50')]&&_0x3cc154[_0xd9aa('0x40')]){var _0x24e064={'dst':_0x19ae67['phone'],'text':_0x19ae67['body'],'src':_0x3cc154['senderString']||_0x3cc154['phone'],'url':_0x3cc154[_0xd9aa('0x29')]+'/api/sms/messages/'+_0x19ae67['id']+_0xd9aa('0x2b')+_0x3cc154[_0xd9aa('0x2c')]};var _0x527b79=util[_0xd9aa('0x45')](_0xd9aa('0x46'),_0x3cc154[_0xd9aa('0x50')],_0x3cc154[_0xd9aa('0x40')]);var _0x454c30={'method':'POST','uri':util[_0xd9aa('0x45')]('https://api.plivo.com/v1/Account/%s/Message/',_0x3cc154[_0xd9aa('0x50')]),'body':_0x24e064,'headers':{'Authorization':util['format'](_0xd9aa('0x48'),new Buffer(_0x527b79)[_0xd9aa('0x49')](_0xd9aa('0x4a')))},'json':!![]};rp(_0x454c30)['then'](function(_0x9634d7){var _0x55801f={'messageId':_0x9634d7[_0xd9aa('0x51')][0x0]};return _0x4938b2['update'](_0x55801f);})['catch'](function(_0x2955bb){logger['error'](_0xd9aa('0x2e'),'afterCreate','plivo',util['inspect'](_0x2955bb,{'showHidden':![],'depth':null}));});}else{logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),_0xd9aa('0x2f'),_0xd9aa('0x52'),_0xd9aa('0x53'));}break;case _0xd9aa('0x54'):if(_0x3cc154[_0xd9aa('0x33')]&&_0x3cc154[_0xd9aa('0x34')]){if(_0x3cc154[_0xd9aa('0x55')]){var _0x52c9e8={'method':_0xd9aa('0x3a'),'uri':_0x3cc154[_0xd9aa('0x55')]+_0xd9aa('0x56'),'body':{'username':_0x3cc154['username'],'password':_0x3cc154[_0xd9aa('0x34')]},'json':!![]};return rp(_0x52c9e8)['then'](function(_0x2dec02){var _0x37ec1b={'method':_0xd9aa('0x3a'),'uri':_0x3cc154[_0xd9aa('0x55')]+_0xd9aa('0x57'),'body':{'messages':[{'from':_0x3cc154['phone'],'destinations':[{'to':_0x19ae67[_0xd9aa('0x25')]}],'text':_0x19ae67[_0xd9aa('0x28')],'notifyUrl':_0x3cc154[_0xd9aa('0x29')]+_0xd9aa('0x2a')+_0x19ae67['id']+_0xd9aa('0x2b')+_0x3cc154['token'],'notifyContentType':_0xd9aa('0x58'),'callbackData':_0x3cc154[_0xd9aa('0x25')]+';'+_0x19ae67[_0xd9aa('0x28')]}]},'headers':{'Authorization':_0xd9aa('0x59')+_0x2dec02[_0xd9aa('0x2c')]},'json':!![]};return rp(_0x37ec1b)[_0xd9aa('0x1a')](function(_0xc3c1d5){if(_0xc3c1d5[_0xd9aa('0x26')]){var _0xdffb1e={'messageId':_0xc3c1d5[_0xd9aa('0x26')][0x0][_0xd9aa('0xd')]};if(!_0x3cc154[_0xd9aa('0x43')]){_0xdffb1e['read']=!![];}return _0x4938b2[_0xd9aa('0x1b')](_0xdffb1e);}else{return logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),_0xd9aa('0x2f'),_0xd9aa('0x54'),util[_0xd9aa('0x30')](_0xc3c1d5,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x32c983){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd9aa('0x2f'),_0xd9aa('0x54'),util['inspect'](_0x32c983,{'showHidden':![],'depth':null}));});}else{logger[_0xd9aa('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd9aa('0x2f'),_0xd9aa('0x54'),_0xd9aa('0x5a'));}}else{logger['error'](_0xd9aa('0x2e'),'afterCreate',_0xd9aa('0x54'),_0xd9aa('0x4f'));}break;case'csc':var _0x1549c6=require('crypto');if(_0x3cc154[_0xd9aa('0x5b')]){var _0x525455={};_0x525455[_0xd9aa('0x5c')]=_0x3cc154[_0xd9aa('0x33')];_0x525455[_0xd9aa('0x25')]=_0x19ae67['phone'];_0x525455['sender']=_0x3cc154['phone'];_0x525455[_0xd9aa('0x5d')]=_0x19ae67[_0xd9aa('0x28')];_0x525455[_0xd9aa('0x5e')]=+new Date();var _0x33bd48='';var _0x3b5027='';var _0xee3716=Object[_0xd9aa('0x5f')](_0x525455);_0xee3716['sort']();for(var _0x4c0f14=0x0;_0x4c0f14<_0xee3716[_0xd9aa('0x60')];_0x4c0f14++){if(_0x33bd48!=''){_0x33bd48+='&';}_0x33bd48+=_0xee3716[_0x4c0f14]+'='+encodeURIComponent(_0x525455[_0xee3716[_0x4c0f14]]);_0x3b5027+=_0x525455[_0xee3716[_0x4c0f14]];}_0x3b5027+=_0x3cc154[_0xd9aa('0x5b')];_0x3b5027=_0x1549c6[_0xd9aa('0x61')](_0xd9aa('0x62'))[_0xd9aa('0x1b')](_0x3b5027)[_0xd9aa('0x63')](_0xd9aa('0x64'));if(_0x33bd48!==''){_0x33bd48+='&';}_0x33bd48+=_0xd9aa('0x65')+_0x3b5027;var _0x176fe4={'method':_0xd9aa('0x38'),'uri':_0x3cc154['baseUrl']+_0xd9aa('0x66')+_0x33bd48,'json':!![]};return rp(_0x176fe4)[_0xd9aa('0x1a')](function(_0x47d8df){var _0x2d1d3f=Object[_0xd9aa('0x5f')](_0x47d8df);if(_0x47d8df[_0x2d1d3f[0x0]][_0xd9aa('0x1e')]&&parseInt(_0x47d8df[_0x2d1d3f[0x0]][_0xd9aa('0x1e')])===0x0){var _0x241943={'messageId':_0x47d8df[_0x2d1d3f[0x0]][_0xd9aa('0x67')]};if(!_0x3cc154[_0xd9aa('0x43')]){_0x241943[_0xd9aa('0x3e')]=!![];}return _0x4938b2[_0xd9aa('0x1b')](_0x241943);}else{return logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),'afterCreate','csc',util['inspect'](_0x47d8df['error'],{'showHidden':![],'depth':null}));}})[_0xd9aa('0x1d')](function(_0x5474be){return logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),_0xd9aa('0x2f'),_0xd9aa('0x68'),util['inspect'](_0x5474be,{'showHidden':![],'depth':null}));});}else{logger[_0xd9aa('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd9aa('0x2f'),'csc',_0xd9aa('0x69'));}break;case'clickatell':if(_0x3cc154[_0xd9aa('0x5b')]){var _0x390952={'method':_0xd9aa('0x3a'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3cc154[_0xd9aa('0x5b')]},'body':{'content':_0x19ae67[_0xd9aa('0x28')],'to':[_0x19ae67[_0xd9aa('0x25')]],'from':_0x3cc154[_0xd9aa('0x25')],'binary':![],'clientMessageId':_0xd9aa('0x6a'),'charset':_0xd9aa('0x6b')},'json':!![]};rp(_0x390952)[_0xd9aa('0x1a')](function(_0x3b1fd7){if(!_0x3b1fd7[_0xd9aa('0x1e')]){var _0x18a52b={'messageId':_0x3b1fd7[_0xd9aa('0x26')][0x0][_0xd9aa('0x6c')]};if(!_0x3cc154[_0xd9aa('0x43')]){_0x18a52b[_0xd9aa('0x3e')]=!![];}return _0x4938b2[_0xd9aa('0x1b')](_0x18a52b);}else{return logger['error'](_0xd9aa('0x2e'),'afterCreate',_0xd9aa('0x6d'),util[_0xd9aa('0x30')](_0x3b1fd7[_0xd9aa('0x1e')],{'showHidden':![],'depth':null}));}})[_0xd9aa('0x1d')](function(_0x13117a){return logger['error'](_0xd9aa('0x2e'),_0xd9aa('0x2f'),_0xd9aa('0x6d'),util[_0xd9aa('0x30')](_0x13117a,{'showHidden':![],'depth':null}));});}else{logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),_0xd9aa('0x2f'),_0xd9aa('0x6d'),'Missing\x20parameters:\x20apiKey');}break;case _0xd9aa('0x6e'):if(_0x3cc154['username']&&_0x3cc154[_0xd9aa('0x34')]){var _0x527b79=util[_0xd9aa('0x45')](_0xd9aa('0x46'),_0x3cc154['username'],_0x3cc154[_0xd9aa('0x34')]);var _0x454c30={'method':'POST','uri':_0xd9aa('0x6f')+_0x3cc154[_0xd9aa('0x70')]+_0xd9aa('0x71'),'body':{'to':[_0x19ae67[_0xd9aa('0x25')]],'text':_0x19ae67[_0xd9aa('0x28')],'from':_0x3cc154[_0xd9aa('0x25')],'applicationId':_0x3cc154[_0xd9aa('0x72')]},'headers':{'Authorization':util[_0xd9aa('0x45')](_0xd9aa('0x48'),new Buffer(_0x527b79)[_0xd9aa('0x49')](_0xd9aa('0x4a')))},'json':!![]};rp(_0x454c30)[_0xd9aa('0x1a')](function(_0x19935b){if(_0x19935b['id']){var _0x35d9c9={'messageId':_0x19935b['id']};return _0x4938b2[_0xd9aa('0x1b')](_0x35d9c9);}else{logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),_0xd9aa('0x2f'),'bandwidth',util[_0xd9aa('0x30')](_0x19935b,{'showHidden':![],'depth':null}));}})['catch'](function(_0x30a7b3){logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),_0xd9aa('0x2f'),_0xd9aa('0x6e'),util[_0xd9aa('0x30')](_0x30a7b3,{'showHidden':![],'depth':null}));});}else{logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),_0xd9aa('0x2f'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0xd9aa('0x73'):if(_0x3cc154[_0xd9aa('0x5b')]){var _0x4ffc72={};var _0x176fe4={'method':_0xd9aa('0x3a'),'uri':_0xd9aa('0x74'),'headers':{'Authorization':_0xd9aa('0x75')+_0x3cc154[_0xd9aa('0x5b')],'Content-Type':_0xd9aa('0x58')},'body':{'from':_0x3cc154['phone'],'to':_0x19ae67[_0xd9aa('0x25')],'text':_0x19ae67[_0xd9aa('0x28')]},'json':!![]};return rp(_0x176fe4)[_0xd9aa('0x1a')](function(_0x24451f){if(_0x24451f['code']==0xca){_0x4ffc72['message']=_0x24451f;var _0x29d63e={'method':'POST','uri':_0xd9aa('0x76'),'headers':{'Authorization':_0xd9aa('0x75')+_0x3cc154['apiKey'],'Content-Type':_0xd9aa('0x58')},'body':{'refid':_0x4ffc72[_0xd9aa('0x77')][_0xd9aa('0x78')]},'json':!![]};return rp(_0x29d63e)['then'](function(_0x2edf54){_0x4ffc72[_0xd9aa('0x79')]=_0x2edf54;var _0x5c8c39={'messageId':_0x4ffc72[_0xd9aa('0x77')][_0xd9aa('0x78')],'read':!![]};return _0x4938b2[_0xd9aa('0x1b')](_0x5c8c39);});}else{return logger[_0xd9aa('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd9aa('0x2f'),_0xd9aa('0x73'),util[_0xd9aa('0x30')](_0x24451f,{'showHidden':![],'depth':null}));}})[_0xd9aa('0x1d')](function(_0x4ed6a2){return logger[_0xd9aa('0x1e')](_0xd9aa('0x2e'),_0xd9aa('0x2f'),_0xd9aa('0x73'),util[_0xd9aa('0x30')](_0x4ed6a2,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xd9aa('0x2e'),'afterCreate',_0xd9aa('0x73'),_0xd9aa('0x7a'));}break;}}})[_0xd9aa('0x7b')](function(){_0x2c5354();});}else{_0x2c5354();}}},'charset':_0xd9aa('0x7c'),'collate':_0xd9aa('0x7d')});}; \ No newline at end of file +var _0x91bd=['login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','body','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','head','messages','message_id','clickSend','plivo','authId','token','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','remote','/api/sms/messages/','application/json','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','sort','length','md5','digest','hex','signature=','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','intelepeer','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','messageId','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','/status?token=','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender'];(function(_0xfcbcb8,_0x35bf6b){var _0x1b1f97=function(_0x51e11d){while(--_0x51e11d){_0xfcbcb8['push'](_0xfcbcb8['shift']());}};_0x1b1f97(++_0x35bf6b);}(_0x91bd,0x14c));var _0xd91b=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0x91bd[_0x2650e9];return _0x3511c8;};'use strict';var _=require('lodash');var util=require(_0xd91b('0x0'));var logger=require(_0xd91b('0x1'))(_0xd91b('0x2'));var moment=require(_0xd91b('0x3'));var BPromise=require(_0xd91b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd91b('0x5'));var rimraf=require(_0xd91b('0x6'));var config=require(_0xd91b('0x7'));var attributes=require('./smsMessage.attributes');module[_0xd91b('0x8')]=function(_0x333859,_0x292004){return _0x333859[_0xd91b('0x9')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xd91b('0xa'),'fields':[_0xd91b('0xa')]},{'name':'fti_sms_messages','fields':['body'],'type':_0xd91b('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc05fae,_0x2d5edb,_0x51e186){var _0x35e8a9=_0x333859[_0xd91b('0xc')];var _0x28f1ae=_0xc05fae[_0xd91b('0xd')]({'plain':!![]});if(_0x28f1ae['direction'][_0xd91b('0xe')]()==='in'||_0x28f1ae[_0xd91b('0xf')][_0xd91b('0xe')]()===_0xd91b('0x10')&&!_0x28f1ae['secret']&&!_[_0xd91b('0x11')](_0x28f1ae[_0xd91b('0x12')])&&!_[_0xd91b('0x11')](_0x28f1ae[_0xd91b('0x13')])){_0x35e8a9[_0xd91b('0x14')]['findOne']({'where':{'id':_0x28f1ae['SmsInteractionId']}})[_0xd91b('0x15')](function(_0x4c69cc){if(_0x4c69cc){_0x4c69cc[_0xd91b('0x16')]({'lastMsgAt':_0x28f1ae[_0xd91b('0x17')],'lastMsgDirection':_0x28f1ae[_0xd91b('0xf')][_0xd91b('0xe')]()});}})[_0xd91b('0x18')](function(_0x3d0b5d){console['error'](_0x3d0b5d);});}if(_0x28f1ae[_0xd91b('0xf')]===_0xd91b('0x10')&&!_0x28f1ae[_0xd91b('0x19')]){var _0x45710d;_0x35e8a9[_0xd91b('0x1a')][_0xd91b('0x1b')]({'where':{'id':_0x28f1ae[_0xd91b('0x1c')]},'raw':!![]})[_0xd91b('0x15')](function(_0xfa8ff4){_0x45710d=_0xfa8ff4;if(_0x45710d&&_0x45710d[_0xd91b('0x1d')]){switch(_0x45710d[_0xd91b('0x1d')]){case _0xd91b('0x1e'):var _0x867194=require(_0xd91b('0x1e'));if(_0x45710d[_0xd91b('0x1f')]&&_0x45710d[_0xd91b('0x20')]&&_0x45710d[_0xd91b('0x21')]){var _0x500485=new _0x867194(_0x45710d[_0xd91b('0x1f')],_0x45710d[_0xd91b('0x20')]);_0x500485['messages']['create']({'body':_0x28f1ae['body'],'to':_0x28f1ae[_0xd91b('0x21')],'from':_0x45710d[_0xd91b('0x21')],'statusCallback':_0x45710d['remote']+'/api/sms/messages/'+_0x28f1ae['id']+_0xd91b('0x22')+_0x45710d['token']})[_0xd91b('0x15')](function(_0x203411){if(_0x203411[_0xd91b('0x23')]){return _0xc05fae[_0xd91b('0x16')]({'messageId':_0x203411[_0xd91b('0x23')]});}})[_0xd91b('0x18')](function(_0x15362f){logger[_0xd91b('0x24')](_0xd91b('0x25'),_0xd91b('0x26'),'twilio',util[_0xd91b('0x27')](_0x15362f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x1e'),_0xd91b('0x28'));}break;case'skebby':var _0x22d315=_0xd91b('0x29');if(_0x45710d[_0xd91b('0x2a')]&&_0x45710d[_0xd91b('0x2b')]){var _0x44fb21={'recipient':[_0x28f1ae['phone']],'message':_0x28f1ae['body'],'message_type':_0x45710d[_0xd91b('0x2c')]};if(_0x45710d[_0xd91b('0x2c')]&&_0x45710d['smsMethod']!=='SI'){_0x44fb21[_0xd91b('0x2d')]=_0x45710d[_0xd91b('0x21')];}var _0x3c7706={'url':_0x22d315+_0xd91b('0x2e')+_0x45710d[_0xd91b('0x2a')]+_0xd91b('0x2f')+_0x45710d[_0xd91b('0x2b')],'method':_0xd91b('0x30')};rp(_0x3c7706)[_0xd91b('0x15')](function(_0x19b272){var _0x18a889=_0x19b272[_0xd91b('0x31')](';');var _0x9872af={'user_key':_0x18a889[0x0],'session_key':_0x18a889[0x1]};_0x3c7706={'url':_0x22d315+_0xd91b('0x32'),'method':_0xd91b('0x33'),'headers':{'user_key':_0x9872af[_0xd91b('0x34')],'Session_key':_0x9872af[_0xd91b('0x35')]},'json':!![],'body':_0x44fb21};return rp(_0x3c7706);})[_0xd91b('0x15')](function(_0xbd456d){if(_0xbd456d[_0xd91b('0x36')]>=0x1){var _0x4794b1={'messageId':_0xbd456d[_0xd91b('0x37')]};if(_0x45710d[_0xd91b('0x2c')]!=='GP'||!_0x45710d[_0xd91b('0x38')]){_0x4794b1[_0xd91b('0x39')]=!![];}return _0xc05fae[_0xd91b('0x16')](_0x4794b1);}else{return logger[_0xd91b('0x24')](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x3a'),util[_0xd91b('0x27')](_0xbd456d,{'showHidden':![],'depth':null}));}})[_0xd91b('0x18')](function(_0x8edc6f){return logger[_0xd91b('0x24')](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x3a'),util[_0xd91b('0x27')](_0x8edc6f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x3a'),_0xd91b('0x3b'));}break;case _0xd91b('0x3c'):if(_0x45710d[_0xd91b('0x20')]){var _0xb3d7fd={'recipient':_0x28f1ae[_0xd91b('0x21')],'message':_0x28f1ae[_0xd91b('0x3d')],'sender':_0x45710d['senderString']||_0x45710d[_0xd91b('0x21')],'authorization':_0x45710d[_0xd91b('0x20')]};var _0x2d5edb={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0xb3d7fd,'json':!![]};rp(_0x2d5edb)[_0xd91b('0x15')](function(_0x3e49d2){var _0x3ed61d={'messageId':_0x3e49d2[_0xd91b('0x3e')]};if(!_0x45710d[_0xd91b('0x38')]){_0x3ed61d[_0xd91b('0x39')]=!![];}return _0xc05fae[_0xd91b('0x16')](_0x3ed61d);})[_0xd91b('0x18')](function(_0x1207b2){logger[_0xd91b('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd91b('0x26'),_0xd91b('0x3c'),util['inspect'](_0x1207b2,{'showHidden':![],'depth':null}));});}else{logger[_0xd91b('0x24')](_0xd91b('0x25'),'afterCreate',_0xd91b('0x3c'),_0xd91b('0x3f'));}break;case _0xd91b('0x40'):if(_0x45710d['username']&&_0x45710d[_0xd91b('0x2b')]){var _0xb3d7fd={'messages':[{'source':_0xd91b('0x41'),'to':_0x28f1ae[_0xd91b('0x21')],'body':_0x28f1ae[_0xd91b('0x3d')],'from':_0x45710d[_0xd91b('0x42')]||_0x45710d['phone']}]};var _0x188a27=util[_0xd91b('0x43')](_0xd91b('0x44'),_0x45710d[_0xd91b('0x2a')],_0x45710d[_0xd91b('0x2b')]);var _0x2d5edb={'method':'POST','uri':_0xd91b('0x45'),'body':_0xb3d7fd,'headers':{'Authorization':util[_0xd91b('0x43')](_0xd91b('0x46'),new Buffer(_0x188a27)['toString'](_0xd91b('0x47')))},'json':!![]};rp(_0x2d5edb)['then'](function(_0x10508c){if(_0x10508c[_0xd91b('0x48')]>=0xc8&&_0x10508c[_0xd91b('0x48')]<=0xce){if(_0x10508c[_0xd91b('0x49')]&&_0x10508c['data']['queued_count']>0x0){var _0x40bfc5=_[_0xd91b('0x4a')](_0x10508c[_0xd91b('0x49')][_0xd91b('0x4b')]);var _0x4c26a5={'messageId':_0x40bfc5[_0xd91b('0x4c')]};if(!_0x45710d[_0xd91b('0x38')]){_0x4c26a5[_0xd91b('0x39')]=!![];}return _0xc05fae[_0xd91b('0x16')](_0x4c26a5);}else{logger[_0xd91b('0x24')](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x4d'),util[_0xd91b('0x27')](_0x10508c,{'showHidden':![],'depth':null}));}}else{logger[_0xd91b('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd91b('0x4d'),util['inspect'](_0x10508c,{'showHidden':![],'depth':null}));}})[_0xd91b('0x18')](function(_0x50f6ab){logger[_0xd91b('0x24')](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x4d'),util['inspect'](_0x50f6ab,{'showHidden':![],'depth':null}));});}else{logger[_0xd91b('0x24')](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x4d'),_0xd91b('0x3b'));}break;case _0xd91b('0x4e'):if(_0x45710d[_0xd91b('0x4f')]&&_0x45710d[_0xd91b('0x20')]){var _0xb3d7fd={'dst':_0x28f1ae[_0xd91b('0x21')],'text':_0x28f1ae[_0xd91b('0x3d')],'src':_0x45710d[_0xd91b('0x42')]||_0x45710d[_0xd91b('0x21')],'url':_0x45710d['remote']+'/api/sms/messages/'+_0x28f1ae['id']+_0xd91b('0x22')+_0x45710d[_0xd91b('0x50')]};var _0x188a27=util[_0xd91b('0x43')](_0xd91b('0x44'),_0x45710d[_0xd91b('0x4f')],_0x45710d['authToken']);var _0x2d5edb={'method':_0xd91b('0x33'),'uri':util[_0xd91b('0x43')](_0xd91b('0x51'),_0x45710d[_0xd91b('0x4f')]),'body':_0xb3d7fd,'headers':{'Authorization':util['format'](_0xd91b('0x46'),new Buffer(_0x188a27)[_0xd91b('0x52')](_0xd91b('0x47')))},'json':!![]};rp(_0x2d5edb)['then'](function(_0x4ae4b2){var _0x1aafbc={'messageId':_0x4ae4b2[_0xd91b('0x53')][0x0]};return _0xc05fae['update'](_0x1aafbc);})[_0xd91b('0x18')](function(_0x546305){logger[_0xd91b('0x24')](_0xd91b('0x25'),'afterCreate',_0xd91b('0x4e'),util['inspect'](_0x546305,{'showHidden':![],'depth':null}));});}else{logger[_0xd91b('0x24')](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x4e'),_0xd91b('0x54'));}break;case _0xd91b('0x55'):if(_0x45710d['username']&&_0x45710d[_0xd91b('0x2b')]){if(_0x45710d['baseUrl']){var _0x5900e6={'method':'POST','uri':_0x45710d[_0xd91b('0x56')]+_0xd91b('0x57'),'body':{'username':_0x45710d[_0xd91b('0x2a')],'password':_0x45710d[_0xd91b('0x2b')]},'json':!![]};return rp(_0x5900e6)[_0xd91b('0x15')](function(_0x57c719){var _0x2bb0da={'method':_0xd91b('0x33'),'uri':_0x45710d['baseUrl']+_0xd91b('0x58'),'body':{'messages':[{'from':_0x45710d[_0xd91b('0x21')],'destinations':[{'to':_0x28f1ae['phone']}],'text':_0x28f1ae[_0xd91b('0x3d')],'notifyUrl':_0x45710d[_0xd91b('0x59')]+_0xd91b('0x5a')+_0x28f1ae['id']+_0xd91b('0x22')+_0x45710d[_0xd91b('0x50')],'notifyContentType':_0xd91b('0x5b'),'callbackData':_0x45710d[_0xd91b('0x21')]+';'+_0x28f1ae[_0xd91b('0x3d')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x57c719['token']},'json':!![]};return rp(_0x2bb0da)[_0xd91b('0x15')](function(_0x119025){if(_0x119025[_0xd91b('0x4b')]){var _0x5dd96d={'messageId':_0x119025[_0xd91b('0x4b')][0x0][_0xd91b('0xa')]};if(!_0x45710d['deliveryReport']){_0x5dd96d[_0xd91b('0x39')]=!![];}return _0xc05fae[_0xd91b('0x16')](_0x5dd96d);}else{return logger[_0xd91b('0x24')](_0xd91b('0x25'),'afterCreate',_0xd91b('0x55'),util[_0xd91b('0x27')](_0x119025,{'showHidden':![],'depth':null}));}});})[_0xd91b('0x18')](function(_0x5b8a0e){return logger['error'](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x55'),util[_0xd91b('0x27')](_0x5b8a0e,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd91b('0x26'),_0xd91b('0x55'),_0xd91b('0x5c'));}}else{logger[_0xd91b('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd91b('0x26'),'infobip',_0xd91b('0x3b'));}break;case _0xd91b('0x5d'):var _0x1f44ef=require(_0xd91b('0x5e'));if(_0x45710d[_0xd91b('0x5f')]){var _0xb5578b={};_0xb5578b[_0xd91b('0x60')]=_0x45710d[_0xd91b('0x2a')];_0xb5578b[_0xd91b('0x21')]=_0x28f1ae['phone'];_0xb5578b[_0xd91b('0x2d')]=_0x45710d[_0xd91b('0x21')];_0xb5578b[_0xd91b('0x61')]=_0x28f1ae[_0xd91b('0x3d')];_0xb5578b[_0xd91b('0x62')]=+new Date();var _0x47278a='';var _0xb104e9='';var _0x1404bd=Object['keys'](_0xb5578b);_0x1404bd[_0xd91b('0x63')]();for(var _0x10231a=0x0;_0x10231a<_0x1404bd[_0xd91b('0x64')];_0x10231a++){if(_0x47278a!=''){_0x47278a+='&';}_0x47278a+=_0x1404bd[_0x10231a]+'='+encodeURIComponent(_0xb5578b[_0x1404bd[_0x10231a]]);_0xb104e9+=_0xb5578b[_0x1404bd[_0x10231a]];}_0xb104e9+=_0x45710d['apiKey'];_0xb104e9=_0x1f44ef['createHash'](_0xd91b('0x65'))[_0xd91b('0x16')](_0xb104e9)[_0xd91b('0x66')](_0xd91b('0x67'));if(_0x47278a!==''){_0x47278a+='&';}_0x47278a+=_0xd91b('0x68')+_0xb104e9;var _0x3c7706={'method':_0xd91b('0x30'),'uri':_0x45710d[_0xd91b('0x56')]+'/external/get/send.php?'+_0x47278a,'json':!![]};return rp(_0x3c7706)['then'](function(_0x26f7b7){var _0x34022e=Object[_0xd91b('0x69')](_0x26f7b7);if(_0x26f7b7[_0x34022e[0x0]]['error']&&parseInt(_0x26f7b7[_0x34022e[0x0]][_0xd91b('0x24')])===0x0){var _0x624cd7={'messageId':_0x26f7b7[_0x34022e[0x0]][_0xd91b('0x6a')]};if(!_0x45710d[_0xd91b('0x38')]){_0x624cd7['read']=!![];}return _0xc05fae[_0xd91b('0x16')](_0x624cd7);}else{return logger[_0xd91b('0x24')](_0xd91b('0x25'),_0xd91b('0x26'),'csc',util[_0xd91b('0x27')](_0x26f7b7['error'],{'showHidden':![],'depth':null}));}})[_0xd91b('0x18')](function(_0x5d7f40){return logger['error'](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x5d'),util[_0xd91b('0x27')](_0x5d7f40,{'showHidden':![],'depth':null}));});}else{logger[_0xd91b('0x24')](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x5d'),_0xd91b('0x6b'));}break;case _0xd91b('0x6c'):if(_0x45710d[_0xd91b('0x5f')]){var _0x17c109={'method':_0xd91b('0x33'),'uri':_0xd91b('0x6d'),'headers':{'Authorization':_0x45710d[_0xd91b('0x5f')]},'body':{'content':_0x28f1ae[_0xd91b('0x3d')],'to':[_0x28f1ae['phone']],'from':_0x45710d[_0xd91b('0x21')],'binary':![],'clientMessageId':_0xd91b('0x6e'),'charset':_0xd91b('0x6f')},'json':!![]};rp(_0x17c109)[_0xd91b('0x15')](function(_0x33a90f){if(!_0x33a90f['error']){var _0x2f166d={'messageId':_0x33a90f['messages'][0x0][_0xd91b('0x70')]};if(!_0x45710d['deliveryReport']){_0x2f166d['read']=!![];}return _0xc05fae[_0xd91b('0x16')](_0x2f166d);}else{return logger[_0xd91b('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd91b('0x26'),_0xd91b('0x6c'),util[_0xd91b('0x27')](_0x33a90f['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2c7ea3){return logger[_0xd91b('0x24')](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x6c'),util[_0xd91b('0x27')](_0x2c7ea3,{'showHidden':![],'depth':null}));});}else{logger[_0xd91b('0x24')](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x6c'),_0xd91b('0x6b'));}break;case _0xd91b('0x71'):if(_0x45710d[_0xd91b('0x2a')]&&_0x45710d[_0xd91b('0x2b')]){var _0x188a27=util[_0xd91b('0x43')](_0xd91b('0x44'),_0x45710d[_0xd91b('0x2a')],_0x45710d[_0xd91b('0x2b')]);var _0x2d5edb={'method':_0xd91b('0x33'),'uri':_0xd91b('0x72')+_0x45710d[_0xd91b('0x73')]+'/messages','body':{'to':[_0x28f1ae[_0xd91b('0x21')]],'text':_0x28f1ae[_0xd91b('0x3d')],'from':_0x45710d[_0xd91b('0x21')],'applicationId':_0x45710d[_0xd91b('0x74')]},'headers':{'Authorization':util[_0xd91b('0x43')](_0xd91b('0x46'),new Buffer(_0x188a27)['toString'](_0xd91b('0x47')))},'json':!![]};rp(_0x2d5edb)['then'](function(_0x140b8b){if(_0x140b8b['id']){var _0xb74c13={'messageId':_0x140b8b['id']};return _0xc05fae[_0xd91b('0x16')](_0xb74c13);}else{logger[_0xd91b('0x24')](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x71'),util[_0xd91b('0x27')](_0x140b8b,{'showHidden':![],'depth':null}));}})[_0xd91b('0x18')](function(_0x276b32){logger[_0xd91b('0x24')](_0xd91b('0x25'),_0xd91b('0x26'),_0xd91b('0x71'),util[_0xd91b('0x27')](_0x276b32,{'showHidden':![],'depth':null}));});}else{logger[_0xd91b('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd91b('0x26'),_0xd91b('0x71'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x45710d[_0xd91b('0x5f')]){var _0x25fcff={};var _0x3c7706={'method':_0xd91b('0x33'),'uri':_0xd91b('0x75'),'headers':{'Authorization':_0xd91b('0x76')+_0x45710d['apiKey'],'Content-Type':_0xd91b('0x5b')},'body':{'from':_0x45710d[_0xd91b('0x21')],'to':_0x28f1ae[_0xd91b('0x21')],'text':_0x28f1ae['body']},'json':!![]};return rp(_0x3c7706)[_0xd91b('0x15')](function(_0xe47771){if(_0xe47771[_0xd91b('0x77')]==0xca){_0x25fcff['message']=_0xe47771;var _0x297ea8={'method':_0xd91b('0x33'),'uri':_0xd91b('0x78'),'headers':{'Authorization':_0xd91b('0x76')+_0x45710d[_0xd91b('0x5f')],'Content-Type':_0xd91b('0x5b')},'body':{'refid':_0x25fcff[_0xd91b('0x79')]['refid']},'json':!![]};return rp(_0x297ea8)[_0xd91b('0x15')](function(_0xd35a75){_0x25fcff['status']=_0xd35a75;var _0x420b68={'messageId':_0x25fcff['message']['refid'],'read':!![]};return _0xc05fae[_0xd91b('0x16')](_0x420b68);});}else{return logger[_0xd91b('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd91b('0x26'),'intelepeer',util[_0xd91b('0x27')](_0xe47771,{'showHidden':![],'depth':null}));}})[_0xd91b('0x18')](function(_0x1c44e5){return logger[_0xd91b('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd91b('0x26'),_0xd91b('0x7a'),util['inspect'](_0x1c44e5,{'showHidden':![],'depth':null}));});}else{return logger[_0xd91b('0x24')](_0xd91b('0x25'),_0xd91b('0x26'),'intelepeer','Token\x20not\x20received');}break;}}})[_0xd91b('0x7b')](function(){_0x51e186();});}else{_0x51e186();}}},'charset':_0xd91b('0x7c'),'collate':_0xd91b('0x7d')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 4146e70..6a641e0 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 _0x6f6c=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','SmsMessage','options','CreateSmsMessage','lodash','bluebird','randomstring'];(function(_0x387744,_0x305a98){var _0x5d7c36=function(_0x9e9760){while(--_0x9e9760){_0x387744['push'](_0x387744['shift']());}};_0x5d7c36(++_0x305a98);}(_0x6f6c,0x1bf));var _0xc6f6=function(_0x5975b9,_0x27f2f1){_0x5975b9=_0x5975b9-0x0;var _0x2890a7=_0x6f6c[_0x5975b9];return _0x2890a7;};'use strict';var _=require(_0xc6f6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc6f6('0x1'));var rs=require(_0xc6f6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6f6('0x3'))['db'];var utils=require(_0xc6f6('0x4'));var logger=require('../../config/logger')(_0xc6f6('0x5'));var config=require(_0xc6f6('0x6'));var jayson=require(_0xc6f6('0x7'));var client=jayson[_0xc6f6('0x8')]['http']({'port':0x232a});config[_0xc6f6('0x9')]=_[_0xc6f6('0xa')](config[_0xc6f6('0x9')],{'host':_0xc6f6('0xb'),'port':0x18eb});var socket=require(_0xc6f6('0xc'))(new Redis(config[_0xc6f6('0x9')]));require(_0xc6f6('0xd'))[_0xc6f6('0xe')](socket);function respondWithRpcPromise(_0x2a4095,_0x134b61,_0xbbfd61){return new BPromise(function(_0x3259b4,_0x451afb){return client[_0xc6f6('0xf')](_0x2a4095,_0xbbfd61)[_0xc6f6('0x10')](function(_0x286f3f){logger[_0xc6f6('0x11')](_0xc6f6('0x12'),_0x134b61,_0xc6f6('0x13'));logger[_0xc6f6('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x134b61,_0xc6f6('0x13'),JSON[_0xc6f6('0x15')](_0x286f3f));if(_0x286f3f['error']){if(_0x286f3f[_0xc6f6('0x16')][_0xc6f6('0x17')]===0x1f4){logger[_0xc6f6('0x16')](_0xc6f6('0x12'),_0x134b61,_0x286f3f[_0xc6f6('0x16')][_0xc6f6('0x18')]);return _0x451afb(_0x286f3f[_0xc6f6('0x16')][_0xc6f6('0x18')]);}logger[_0xc6f6('0x16')](_0xc6f6('0x12'),_0x134b61,_0x286f3f[_0xc6f6('0x16')][_0xc6f6('0x18')]);return _0x3259b4(_0x286f3f[_0xc6f6('0x16')][_0xc6f6('0x18')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x134b61,_0xc6f6('0x13'));_0x3259b4(_0x286f3f[_0xc6f6('0x19')][_0xc6f6('0x18')]);}})[_0xc6f6('0x1a')](function(_0x535527){logger[_0xc6f6('0x16')](_0xc6f6('0x12'),_0x134b61,_0x535527);_0x451afb(_0x535527);});});}exports['CreateSmsMessage']=function(_0x1d29a4){var _0x5f1a94=this;return new Promise(function(_0x670ce8,_0x4b1f6f){return db[_0xc6f6('0x1b')]['create'](_0x1d29a4['body'],{'raw':_0x1d29a4[_0xc6f6('0x1c')]?_0x1d29a4[_0xc6f6('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xc6f6('0x10')](function(_0x3cc4fe){logger[_0xc6f6('0x11')](_0xc6f6('0x1d'),_0x1d29a4);logger[_0xc6f6('0x14')](_0xc6f6('0x1d'),_0x1d29a4,JSON[_0xc6f6('0x15')](_0x3cc4fe));_0x670ce8(_0x3cc4fe);})[_0xc6f6('0x1a')](function(_0x4ceeee){logger[_0xc6f6('0x16')](_0xc6f6('0x1d'),_0x4ceeee['message'],_0x1d29a4);_0x4b1f6f(_0x5f1a94[_0xc6f6('0x16')](0x1f4,_0x4ceeee[_0xc6f6('0x18')]));});});}; \ No newline at end of file +var _0x77ce=['debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x77ce,0x143));var _0xe77c=function(_0x238ef0,_0x43dd08){_0x238ef0=_0x238ef0-0x0;var _0x1343ba=_0x77ce[_0x238ef0];return _0x1343ba;};'use strict';var _=require('lodash');var util=require(_0xe77c('0x0'));var moment=require(_0xe77c('0x1'));var BPromise=require(_0xe77c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe77c('0x3'));var db=require(_0xe77c('0x4'))['db'];var utils=require(_0xe77c('0x5'));var logger=require('../../config/logger')(_0xe77c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe77c('0x7')]['http']({'port':0x232a});config['redis']=_[_0xe77c('0x8')](config[_0xe77c('0x9')],{'host':_0xe77c('0xa'),'port':0x18eb});var socket=require(_0xe77c('0xb'))(new Redis(config['redis']));require(_0xe77c('0xc'))[_0xe77c('0xd')](socket);function respondWithRpcPromise(_0x367148,_0x29df71,_0x5a9f9a){return new BPromise(function(_0x336701,_0x5d9998){return client['request'](_0x367148,_0x5a9f9a)[_0xe77c('0xe')](function(_0x2ba65f){logger[_0xe77c('0xf')](_0xe77c('0x10'),_0x29df71,_0xe77c('0x11'));logger[_0xe77c('0x12')](_0xe77c('0x13'),_0x29df71,_0xe77c('0x11'),JSON['stringify'](_0x2ba65f));if(_0x2ba65f[_0xe77c('0x14')]){if(_0x2ba65f[_0xe77c('0x14')][_0xe77c('0x15')]===0x1f4){logger[_0xe77c('0x14')](_0xe77c('0x10'),_0x29df71,_0x2ba65f['error'][_0xe77c('0x16')]);return _0x5d9998(_0x2ba65f[_0xe77c('0x14')]['message']);}logger[_0xe77c('0x14')](_0xe77c('0x10'),_0x29df71,_0x2ba65f['error'][_0xe77c('0x16')]);return _0x336701(_0x2ba65f[_0xe77c('0x14')][_0xe77c('0x16')]);}else{logger[_0xe77c('0xf')](_0xe77c('0x10'),_0x29df71,_0xe77c('0x11'));_0x336701(_0x2ba65f[_0xe77c('0x17')][_0xe77c('0x16')]);}})[_0xe77c('0x18')](function(_0x54da95){logger['error']('SmsMessage,\x20%s,\x20%s',_0x29df71,_0x54da95);_0x5d9998(_0x54da95);});});}exports[_0xe77c('0x19')]=function(_0x1d0304){var _0x19edd2=this;return new Promise(function(_0x83cc22,_0x1f1161){return db[_0xe77c('0x1a')]['create'](_0x1d0304[_0xe77c('0x1b')],{'raw':_0x1d0304['options']?_0x1d0304[_0xe77c('0x1c')][_0xe77c('0x1d')]===undefined?!![]:![]:!![]})[_0xe77c('0xe')](function(_0x5c758){logger[_0xe77c('0xf')](_0xe77c('0x19'),_0x1d0304);logger['debug'](_0xe77c('0x19'),_0x1d0304,JSON[_0xe77c('0x1e')](_0x5c758));_0x83cc22(_0x5c758);})[_0xe77c('0x18')](function(_0x2d3f70){logger[_0xe77c('0x14')](_0xe77c('0x19'),_0x2d3f70[_0xe77c('0x16')],_0x1d0304);_0x1f1161(_0x19edd2[_0xe77c('0x14')](0x1f4,_0x2d3f70[_0xe77c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 31f64f4..f1f842d 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 _0x3ceb=['removeListener','register','length','smsMessage:','./smsMessage.events','save','remove','update','emit'];(function(_0xe6b93f,_0x2978da){var _0x3e8287=function(_0x358373){while(--_0x358373){_0xe6b93f['push'](_0xe6b93f['shift']());}};_0x3e8287(++_0x2978da);}(_0x3ceb,0xee));var _0xb3ce=function(_0x2530f0,_0x9c4d47){_0x2530f0=_0x2530f0-0x0;var _0x647e48=_0x3ceb[_0x2530f0];return _0x647e48;};'use strict';var SmsMessageEvents=require(_0xb3ce('0x0'));var events=[_0xb3ce('0x1'),_0xb3ce('0x2'),_0xb3ce('0x3')];function createListener(_0x3c083a,_0x286d19){return function(_0x40ac19){_0x286d19[_0xb3ce('0x4')](_0x3c083a,_0x40ac19);};}function removeListener(_0x401399,_0x3b402f){return function(){SmsMessageEvents[_0xb3ce('0x5')](_0x401399,_0x3b402f);};}exports[_0xb3ce('0x6')]=function(_0x59b849){for(var _0xf67316=0x0,_0x2dd8b2=events[_0xb3ce('0x7')];_0xf67316<_0x2dd8b2;_0xf67316++){var _0x3851c9=events[_0xf67316];var _0x4a472c=createListener(_0xb3ce('0x8')+_0x3851c9,_0x59b849);SmsMessageEvents['on'](_0x3851c9,_0x4a472c);}}; \ No newline at end of file +var _0x2522=['emit','removeListener','register','length','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x28bc36,_0x3dbef9){var _0x13a6d1=function(_0x2d7b03){while(--_0x2d7b03){_0x28bc36['push'](_0x28bc36['shift']());}};_0x13a6d1(++_0x3dbef9);}(_0x2522,0x1f4));var _0x2252=function(_0x435266,_0x229075){_0x435266=_0x435266-0x0;var _0x1800f8=_0x2522[_0x435266];return _0x1800f8;};'use strict';var SmsMessageEvents=require(_0x2252('0x0'));var events=[_0x2252('0x1'),_0x2252('0x2'),_0x2252('0x3')];function createListener(_0x4490af,_0x451a0f){return function(_0xf9b39d){_0x451a0f[_0x2252('0x4')](_0x4490af,_0xf9b39d);};}function removeListener(_0x1b8fb9,_0x4f596c){return function(){SmsMessageEvents[_0x2252('0x5')](_0x1b8fb9,_0x4f596c);};}exports[_0x2252('0x6')]=function(_0x3d1ac0){for(var _0x1f48c0=0x0,_0x58193e=events[_0x2252('0x7')];_0x1f48c0<_0x58193e;_0x1f48c0++){var _0x44c0cc=events[_0x1f48c0];var _0x51eb62=createListener(_0x2252('0x8')+_0x44c0cc,_0x3d1ac0);SmsMessageEvents['on'](_0x44c0cc,_0x51eb62);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 27ce432..a1efa96 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 _0x2efc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','delete','/:id','destroy','removeTeams','multer','util','path','express'];(function(_0x4aaa1b,_0x2c02fe){var _0xdb6037=function(_0x1f963e){while(--_0x1f963e){_0x4aaa1b['push'](_0x4aaa1b['shift']());}};_0xdb6037(++_0x2c02fe);}(_0x2efc,0x114));var _0xc2ef=function(_0x42bb6d,_0x412255){_0x42bb6d=_0x42bb6d-0x0;var _0x1db89b=_0x2efc[_0x42bb6d];return _0x1db89b;};'use strict';var multer=require(_0xc2ef('0x0'));var util=require(_0xc2ef('0x1'));var path=require(_0xc2ef('0x2'));var timeout=require('connect-timeout');var express=require(_0xc2ef('0x3'));var router=express['Router']();var fs_extra=require(_0xc2ef('0x4'));var auth=require(_0xc2ef('0x5'));var interaction=require(_0xc2ef('0x6'));var config=require(_0xc2ef('0x7'));var controller=require('./smsQueue.controller');router[_0xc2ef('0x8')]('/',auth[_0xc2ef('0x9')](),controller[_0xc2ef('0xa')]);router[_0xc2ef('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xc2ef('0xb')]);router[_0xc2ef('0x8')]('/:id',auth[_0xc2ef('0x9')](),controller[_0xc2ef('0xc')]);router[_0xc2ef('0x8')](_0xc2ef('0xd'),auth['isAuthenticated'](),controller[_0xc2ef('0xe')]);router['get'](_0xc2ef('0xf'),auth['isAuthenticated'](),controller[_0xc2ef('0x10')]);router['get'](_0xc2ef('0x11'),auth['isAuthenticated'](),controller[_0xc2ef('0x12')]);router[_0xc2ef('0x13')]('/',auth['isAuthenticated'](),controller[_0xc2ef('0x14')]);router[_0xc2ef('0x13')](_0xc2ef('0xf'),auth[_0xc2ef('0x9')](),controller[_0xc2ef('0x15')]);router[_0xc2ef('0x13')](_0xc2ef('0x11'),auth[_0xc2ef('0x9')](),controller['addAgents']);router[_0xc2ef('0x16')]('/:id',auth[_0xc2ef('0x9')](),controller[_0xc2ef('0x17')]);router[_0xc2ef('0x18')](_0xc2ef('0x19'),auth[_0xc2ef('0x9')](),controller[_0xc2ef('0x1a')]);router['delete'](_0xc2ef('0xf'),auth['isAuthenticated'](),controller[_0xc2ef('0x1b')]);router[_0xc2ef('0x18')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xe9b9=['express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','/:id','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x4c4037,_0x15054b){var _0x357862=function(_0x480015){while(--_0x480015){_0x4c4037['push'](_0x4c4037['shift']());}};_0x357862(++_0x15054b);}(_0xe9b9,0xd4));var _0x9e9b=function(_0x5826b9,_0x33996e){_0x5826b9=_0x5826b9-0x0;var _0x2e4805=_0xe9b9[_0x5826b9];return _0x2e4805;};'use strict';var multer=require(_0x9e9b('0x0'));var util=require(_0x9e9b('0x1'));var path=require(_0x9e9b('0x2'));var timeout=require(_0x9e9b('0x3'));var express=require(_0x9e9b('0x4'));var router=express[_0x9e9b('0x5')]();var fs_extra=require(_0x9e9b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9e9b('0x7'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x9e9b('0x8')]('/',auth[_0x9e9b('0x9')](),controller['index']);router['get'](_0x9e9b('0xa'),auth['isAuthenticated'](),controller[_0x9e9b('0xb')]);router[_0x9e9b('0x8')]('/:id',auth[_0x9e9b('0x9')](),controller[_0x9e9b('0xc')]);router[_0x9e9b('0x8')](_0x9e9b('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0x9e9b('0x8')](_0x9e9b('0xe'),auth['isAuthenticated'](),controller[_0x9e9b('0xf')]);router['get'](_0x9e9b('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x9e9b('0x11')]('/',auth[_0x9e9b('0x9')](),controller[_0x9e9b('0x12')]);router[_0x9e9b('0x11')](_0x9e9b('0xe'),auth[_0x9e9b('0x9')](),controller['addTeams']);router[_0x9e9b('0x11')]('/:id/users',auth['isAuthenticated'](),controller[_0x9e9b('0x13')]);router[_0x9e9b('0x14')](_0x9e9b('0x15'),auth[_0x9e9b('0x9')](),controller[_0x9e9b('0x16')]);router[_0x9e9b('0x17')](_0x9e9b('0x15'),auth[_0x9e9b('0x9')](),controller[_0x9e9b('0x18')]);router[_0x9e9b('0x17')](_0x9e9b('0xe'),auth[_0x9e9b('0x9')](),controller['removeTeams']);router[_0x9e9b('0x17')]('/:id/users',auth[_0x9e9b('0x9')](),controller[_0x9e9b('0x19')]);module[_0x9e9b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 152d630..0eaf504 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 _0xb353=['roundrobin','STRING','ENUM','rrmemory','beepall'];(function(_0x27c8ab,_0x36a969){var _0x4dc031=function(_0x1735ee){while(--_0x1735ee){_0x27c8ab['push'](_0x27c8ab['shift']());}};_0x4dc031(++_0x36a969);}(_0xb353,0x97));var _0x3b35=function(_0x19305c,_0x1b93db){_0x19305c=_0x19305c-0x0;var _0x3a0ed9=_0xb353[_0x19305c];return _0x3a0ed9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3b35('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3b35('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3b35('0x1')](_0x3b35('0x2'),_0x3b35('0x3'),_0x3b35('0x4'))}}; \ No newline at end of file +var _0x007c=['rrmemory','beepall','roundrobin','sequelize','exports','name','STRING','ENUM'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x007c,0x133));var _0xc007=function(_0x33a16d,_0x172721){_0x33a16d=_0x33a16d-0x0;var _0x3f66a8=_0x007c[_0x33a16d];return _0x3f66a8;};'use strict';var Sequelize=require(_0xc007('0x0'));module[_0xc007('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc007('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc007('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc007('0x4')](_0xc007('0x5'),_0xc007('0x6'),_0xc007('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 4bc343e..313caf4 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 _0x9ccc=['addAgents','spread','emit','removeAgents','isArray','hasOwnProperty','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','SmsQueues','UserProfileResource','sendStatus','error','stack','name','send','map','SmsQueue','rawAttributes','type','key','query','intersection','attributes','model','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','keys','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','smsPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','userSmsQueue:save','ids','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','removeTeams','forEach','userSmsQueue:remove'];(function(_0x154cb5,_0x1a8d5a){var _0x3f574f=function(_0x597a52){while(--_0x597a52){_0x154cb5['push'](_0x154cb5['shift']());}};_0x3f574f(++_0x1a8d5a);}(_0x9ccc,0x11b));var _0xc9cc=function(_0x2d02a5,_0x456e7f){_0x2d02a5=_0x2d02a5-0x0;var _0x5d4a1a=_0x9ccc[_0x2d02a5];return _0x5d4a1a;};'use strict';var emlformat=require(_0xc9cc('0x0'));var rimraf=require(_0xc9cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc9cc('0x2'));var rp=require(_0xc9cc('0x3'));var moment=require('moment');var BPromise=require(_0xc9cc('0x4'));var Mustache=require(_0xc9cc('0x5'));var util=require('util');var path=require(_0xc9cc('0x6'));var sox=require(_0xc9cc('0x7'));var csv=require(_0xc9cc('0x8'));var ejs=require(_0xc9cc('0x9'));var fs=require('fs');var fs_extra=require(_0xc9cc('0xa'));var _=require(_0xc9cc('0xb'));var squel=require(_0xc9cc('0xc'));var crypto=require('crypto');var jsforce=require(_0xc9cc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc9cc('0x8'));var querystring=require(_0xc9cc('0xe'));var Papa=require(_0xc9cc('0xf'));var Redis=require(_0xc9cc('0x10'));var authService=require(_0xc9cc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc9cc('0x12'));var hardwareService=require(_0xc9cc('0x13'));var logger=require(_0xc9cc('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc9cc('0x15'));var db=require(_0xc9cc('0x16'))['db'];config[_0xc9cc('0x17')]=_['defaults'](config['redis'],{'host':_0xc9cc('0x18'),'port':0x18eb});var socket=require(_0xc9cc('0x19'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xc9cc('0x1a')](socket);function respondWithStatusCode(_0x408647,_0x4b54d5){_0x4b54d5=_0x4b54d5||0xcc;return function(_0x545394){if(_0x545394){return _0x408647['sendStatus'](_0x4b54d5);}return _0x408647[_0xc9cc('0x1b')](_0x4b54d5)[_0xc9cc('0x1c')]();};}function respondWithResult(_0xd3b6ec,_0x6c2b6d){_0x6c2b6d=_0x6c2b6d||0xc8;return function(_0x1c0dd5){if(_0x1c0dd5){return _0xd3b6ec['status'](_0x6c2b6d)[_0xc9cc('0x1d')](_0x1c0dd5);}};}function respondWithFilteredResult(_0x275875,_0x443d49){return function(_0x4df76a){if(_0x4df76a){var _0x42e697=typeof _0x443d49[_0xc9cc('0x1e')]===_0xc9cc('0x1f')&&typeof _0x443d49[_0xc9cc('0x20')]===_0xc9cc('0x1f');var _0x4141dc=_0x4df76a[_0xc9cc('0x21')];var _0x12e696=_0x42e697?0x0:_0x443d49[_0xc9cc('0x1e')];var _0x571b1b=_0x42e697?_0x4df76a[_0xc9cc('0x21')]:_0x443d49[_0xc9cc('0x1e')]+_0x443d49[_0xc9cc('0x20')];var _0x517387;if(_0x571b1b>=_0x4141dc){_0x571b1b=_0x4141dc;_0x517387=0xc8;}else{_0x517387=0xce;}_0x275875['status'](_0x517387);return _0x275875[_0xc9cc('0x22')]('Content-Range',_0x12e696+'-'+_0x571b1b+'/'+_0x4141dc)['json'](_0x4df76a);}return null;};}function patchUpdates(_0x4d9c53){return function(_0x26a17b){try{jsonpatch[_0xc9cc('0x23')](_0x26a17b,_0x4d9c53,!![]);}catch(_0x138743){return BPromise[_0xc9cc('0x24')](_0x138743);}return _0x26a17b[_0xc9cc('0x25')]();};}function saveUpdates(_0x3d1d9a,_0x5ef3e3){return function(_0x561784){if(_0x561784){return _0x561784['update'](_0x3d1d9a)[_0xc9cc('0x26')](function(_0x51df2c){return _0x51df2c;});}return null;};}function removeEntity(_0x37cc7a,_0x3fd075){return function(_0x23da89){if(_0x23da89){return _0x23da89[_0xc9cc('0x27')]()[_0xc9cc('0x26')](function(){var _0xba844e=_0x23da89[_0xc9cc('0x28')]({'plain':!![]});var _0x433dfe=_0xc9cc('0x29');return db[_0xc9cc('0x2a')][_0xc9cc('0x27')]({'where':{'type':_0x433dfe,'resourceId':_0xba844e['id']}})[_0xc9cc('0x26')](function(){return _0x23da89;});})[_0xc9cc('0x26')](function(){_0x37cc7a[_0xc9cc('0x1b')](0xcc)[_0xc9cc('0x1c')]();});}};}function handleEntityNotFound(_0xbc15bf,_0x4447a5){return function(_0x5b429c){if(!_0x5b429c){_0xbc15bf[_0xc9cc('0x2b')](0x194);}return _0x5b429c;};}function handleError(_0x12ad33,_0x12dac7){_0x12dac7=_0x12dac7||0x1f4;return function(_0x3d8575){logger[_0xc9cc('0x2c')](_0x3d8575[_0xc9cc('0x2d')]);if(_0x3d8575[_0xc9cc('0x2e')]){delete _0x3d8575[_0xc9cc('0x2e')];}_0x12ad33[_0xc9cc('0x1b')](_0x12dac7)[_0xc9cc('0x2f')](_0x3d8575);};}exports['index']=function(_0x49ce8f,_0x3206ef){var _0x2387e6={},_0x3fb36d={},_0x218964={'count':0x0,'rows':[]};var _0x41aa21=_[_0xc9cc('0x30')](db[_0xc9cc('0x31')][_0xc9cc('0x32')],function(_0x1a4101){return{'name':_0x1a4101['fieldName'],'type':_0x1a4101[_0xc9cc('0x33')][_0xc9cc('0x34')]};});_0x3fb36d['model']=_['map'](_0x41aa21,'name');_0x3fb36d['query']=_['keys'](_0x49ce8f[_0xc9cc('0x35')]);_0x3fb36d['filters']=_[_0xc9cc('0x36')](_0x3fb36d['model'],_0x3fb36d[_0xc9cc('0x35')]);_0x2387e6[_0xc9cc('0x37')]=_['intersection'](_0x3fb36d[_0xc9cc('0x38')],qs['fields'](_0x49ce8f[_0xc9cc('0x35')][_0xc9cc('0x39')]));_0x2387e6['attributes']=_0x2387e6['attributes'][_0xc9cc('0x3a')]?_0x2387e6[_0xc9cc('0x37')]:_0x3fb36d[_0xc9cc('0x38')];if(!_0x49ce8f[_0xc9cc('0x35')]['hasOwnProperty'](_0xc9cc('0x3b'))){_0x2387e6[_0xc9cc('0x20')]=qs[_0xc9cc('0x20')](_0x49ce8f[_0xc9cc('0x35')]['limit']);_0x2387e6['offset']=qs[_0xc9cc('0x1e')](_0x49ce8f[_0xc9cc('0x35')][_0xc9cc('0x1e')]);}_0x2387e6[_0xc9cc('0x3c')]=qs[_0xc9cc('0x3d')](_0x49ce8f['query'][_0xc9cc('0x3d')]);_0x2387e6[_0xc9cc('0x3e')]=qs[_0xc9cc('0x3f')](_[_0xc9cc('0x40')](_0x49ce8f[_0xc9cc('0x35')],_0x3fb36d['filters']),_0x41aa21);if(_0x49ce8f[_0xc9cc('0x35')][_0xc9cc('0x41')]){_0x2387e6[_0xc9cc('0x3e')]=_[_0xc9cc('0x42')](_0x2387e6[_0xc9cc('0x3e')],{'$or':_[_0xc9cc('0x30')](_0x41aa21,function(_0x595f0d){if(_0x595f0d[_0xc9cc('0x33')]!==_0xc9cc('0x43')){var _0x36ac10={};_0x36ac10[_0x595f0d[_0xc9cc('0x2e')]]={'$like':'%'+_0x49ce8f[_0xc9cc('0x35')][_0xc9cc('0x41')]+'%'};return _0x36ac10;}})});}_0x2387e6=_[_0xc9cc('0x42')]({},_0x2387e6,_0x49ce8f[_0xc9cc('0x44')]);var _0x4e65bd={'where':_0x2387e6['where']};return db[_0xc9cc('0x31')]['count'](_0x4e65bd)[_0xc9cc('0x26')](function(_0xe63c98){_0x218964[_0xc9cc('0x21')]=_0xe63c98;if(_0x49ce8f[_0xc9cc('0x35')]['includeAll']){_0x2387e6['include']=[{'all':!![]}];}return db[_0xc9cc('0x31')][_0xc9cc('0x45')](_0x2387e6);})[_0xc9cc('0x26')](function(_0x9367b6){_0x218964[_0xc9cc('0x46')]=_0x9367b6;return _0x218964;})[_0xc9cc('0x26')](respondWithFilteredResult(_0x3206ef,_0x2387e6))['catch'](handleError(_0x3206ef,null));};exports['show']=function(_0x1c9a89,_0x1d1c5d){var _0x1a632f={'raw':!![],'where':{'id':_0x1c9a89['params']['id']}},_0x2c038d={};_0x2c038d[_0xc9cc('0x38')]=_[_0xc9cc('0x47')](db[_0xc9cc('0x31')][_0xc9cc('0x32')]);_0x2c038d['query']=_[_0xc9cc('0x47')](_0x1c9a89[_0xc9cc('0x35')]);_0x2c038d[_0xc9cc('0x3f')]=_[_0xc9cc('0x36')](_0x2c038d['model'],_0x2c038d['query']);_0x1a632f[_0xc9cc('0x37')]=_['intersection'](_0x2c038d[_0xc9cc('0x38')],qs['fields'](_0x1c9a89[_0xc9cc('0x35')][_0xc9cc('0x39')]));_0x1a632f['attributes']=_0x1a632f[_0xc9cc('0x37')][_0xc9cc('0x3a')]?_0x1a632f[_0xc9cc('0x37')]:_0x2c038d['model'];if(_0x1c9a89['query'][_0xc9cc('0x48')]){_0x1a632f['include']=[{'all':!![]}];}_0x1a632f=_['merge']({},_0x1a632f,_0x1c9a89['options']);return db['SmsQueue'][_0xc9cc('0x49')](_0x1a632f)[_0xc9cc('0x26')](handleEntityNotFound(_0x1d1c5d,null))['then'](respondWithResult(_0x1d1c5d,null))[_0xc9cc('0x4a')](handleError(_0x1d1c5d,null));};exports[_0xc9cc('0x4b')]=function(_0x2ec45b,_0x436973){return db['SmsQueue'][_0xc9cc('0x4b')](_0x2ec45b['body'],{})[_0xc9cc('0x26')](function(_0x5f5405){var _0x50f299=_0x2ec45b['user'][_0xc9cc('0x28')]({'plain':!![]});if(!_0x50f299)throw new Error(_0xc9cc('0x4c'));if(_0x50f299[_0xc9cc('0x4d')]===_0xc9cc('0x4e')){var _0x16a8a7=_0x5f5405[_0xc9cc('0x28')]({'plain':!![]});var _0x4f1b15=_0xc9cc('0x29');return db[_0xc9cc('0x4f')][_0xc9cc('0x49')]({'where':{'name':_0x4f1b15,'userProfileId':_0x50f299[_0xc9cc('0x50')]},'raw':!![]})[_0xc9cc('0x26')](function(_0x452c7b){if(_0x452c7b&&_0x452c7b[_0xc9cc('0x51')]===0x0){return db[_0xc9cc('0x2a')][_0xc9cc('0x4b')]({'name':_0x16a8a7['name'],'resourceId':_0x16a8a7['id'],'type':_0x452c7b[_0xc9cc('0x2e')],'sectionId':_0x452c7b['id']},{})[_0xc9cc('0x26')](function(){return _0x5f5405;});}else{return _0x5f5405;}})[_0xc9cc('0x4a')](function(_0x4ba805){logger[_0xc9cc('0x2c')](_0xc9cc('0x52'),_0x4ba805);throw _0x4ba805;});}return _0x5f5405;})['then'](respondWithResult(_0x436973,0xc9))[_0xc9cc('0x4a')](handleError(_0x436973,null));};exports[_0xc9cc('0x53')]=function(_0x38f7e0,_0x365755){if(_0x38f7e0['body']['id']){delete _0x38f7e0[_0xc9cc('0x54')]['id'];}return db['SmsQueue'][_0xc9cc('0x49')]({'where':{'id':_0x38f7e0[_0xc9cc('0x55')]['id']}})[_0xc9cc('0x26')](handleEntityNotFound(_0x365755,null))['then'](saveUpdates(_0x38f7e0['body'],null))[_0xc9cc('0x26')](respondWithResult(_0x365755,null))['catch'](handleError(_0x365755,null));};exports[_0xc9cc('0x27')]=function(_0x4ca77a,_0x3c1db4){return db[_0xc9cc('0x31')][_0xc9cc('0x49')]({'where':{'id':_0x4ca77a['params']['id']}})[_0xc9cc('0x26')](handleEntityNotFound(_0x3c1db4,null))[_0xc9cc('0x26')](removeEntity(_0x3c1db4,null))[_0xc9cc('0x4a')](handleError(_0x3c1db4,null));};exports[_0xc9cc('0x56')]=function(_0x249f17,_0x34cafd){return db['SmsQueue']['describe']()[_0xc9cc('0x26')](respondWithResult(_0x34cafd,null))[_0xc9cc('0x4a')](handleError(_0x34cafd,null));};exports[_0xc9cc('0x57')]=function(_0x365637,_0x2f95b1,_0x54946e){var _0x95899f={'raw':!![],'where':{}},_0x1d661c={},_0x42912d;return db[_0xc9cc('0x31')][_0xc9cc('0x58')]({'where':{'id':_0x365637['params']['id']}})[_0xc9cc('0x26')](handleEntityNotFound(_0x2f95b1,null))[_0xc9cc('0x26')](function(_0x4432de){if(_0x4432de){_0x42912d=_0x4432de['get']({'plain':!![]});_0x1d661c['model']=_[_0xc9cc('0x47')](db[_0xc9cc('0x59')][_0xc9cc('0x32')]);_0x1d661c[_0xc9cc('0x35')]=_[_0xc9cc('0x47')](_0x365637[_0xc9cc('0x35')]);_0x1d661c[_0xc9cc('0x3f')]=_[_0xc9cc('0x36')](_0x1d661c['model'],_0x1d661c[_0xc9cc('0x35')]);_0x95899f['attributes']=_['intersection'](_0x1d661c[_0xc9cc('0x38')],qs['fields'](_0x365637['query'][_0xc9cc('0x39')]));_0x95899f['attributes']=_0x95899f[_0xc9cc('0x37')]['length']?_0x95899f[_0xc9cc('0x37')]:_0x1d661c[_0xc9cc('0x38')];if(!_0x365637[_0xc9cc('0x35')]['hasOwnProperty'](_0xc9cc('0x3b'))){_0x95899f[_0xc9cc('0x20')]=qs['limit'](_0x365637['query'][_0xc9cc('0x20')]);_0x95899f[_0xc9cc('0x1e')]=qs['offset'](_0x365637['query'][_0xc9cc('0x1e')]);}_0x95899f[_0xc9cc('0x3c')]=qs[_0xc9cc('0x3d')](_0x365637[_0xc9cc('0x35')][_0xc9cc('0x3d')]);_0x95899f[_0xc9cc('0x3e')]=qs[_0xc9cc('0x3f')](_[_0xc9cc('0x40')](_0x365637[_0xc9cc('0x35')],_0x1d661c[_0xc9cc('0x3f')]));_0x95899f[_0xc9cc('0x3e')][_0xc9cc('0x5a')]=_0x4432de['id'];if(_0x365637[_0xc9cc('0x35')][_0xc9cc('0x41')]){_0x95899f[_0xc9cc('0x3e')]=_[_0xc9cc('0x42')](_0x95899f[_0xc9cc('0x3e')],{'$or':_[_0xc9cc('0x30')](_0x95899f[_0xc9cc('0x37')],function(_0x5c5e48){var _0x596042={};_0x596042[_0x5c5e48]={'$like':'%'+_0x365637[_0xc9cc('0x35')][_0xc9cc('0x41')]+'%'};return _0x596042;})});}_0x95899f=_[_0xc9cc('0x42')]({},_0x95899f,_0x365637['options']);return db['UserSmsQueue'][_0xc9cc('0x45')](_0x95899f);}})[_0xc9cc('0x26')](function(_0x5a1c42){if(_0x5a1c42){return db[_0xc9cc('0x5b')][_0xc9cc('0x5c')]({'where':{'id':_['map'](_0x5a1c42,'UserId'),'role':'agent'},'attributes':['id','name',_0xc9cc('0x5d'),_0xc9cc('0x5e'),_0xc9cc('0x5f')]});}})[_0xc9cc('0x26')](function(_0x57a0ae){if(_0x57a0ae){return{'count':_0x57a0ae[_0xc9cc('0x21')],'rows':_['map'](_0x57a0ae[_0xc9cc('0x46')],function(_0x15fb40){return{'membername':_0x15fb40[_0xc9cc('0x2e')],'UserId':_0x15fb40['id'],'queue_name':_0x42912d[_0xc9cc('0x2e')],'SmsQueueId':_0x42912d['id'],'interface':util[_0xc9cc('0x60')](_0xc9cc('0x61'),_0xc9cc('0x62'),_0x15fb40[_0xc9cc('0x2e')]),'penalty':0x0,'paused':_0x15fb40[_0xc9cc('0x5d')],'createdAt':_0x15fb40[_0xc9cc('0x5f')],'updatedAt':_0x15fb40['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2f95b1,_0x95899f))[_0xc9cc('0x4a')](handleError(_0x2f95b1,null));};exports['getTeams']=function(_0x27ccc1,_0x15e2c1,_0x18071b){var _0x2b7687={};var _0x34b145={};var _0x2af882;var _0x13c55d;return db[_0xc9cc('0x31')][_0xc9cc('0x58')]({'where':{'id':_0x27ccc1[_0xc9cc('0x55')]['id']}})[_0xc9cc('0x26')](handleEntityNotFound(_0x15e2c1,null))['then'](function(_0x4eb2cf){if(_0x4eb2cf){_0x2af882=_0x4eb2cf;_0x34b145['model']=_['keys'](db[_0xc9cc('0x63')][_0xc9cc('0x32')]);_0x34b145['query']=_[_0xc9cc('0x47')](_0x27ccc1[_0xc9cc('0x35')]);_0x34b145[_0xc9cc('0x3f')]=_[_0xc9cc('0x36')](_0x34b145[_0xc9cc('0x38')],_0x34b145['query']);_0x2b7687[_0xc9cc('0x37')]=_[_0xc9cc('0x36')](_0x34b145[_0xc9cc('0x38')],qs[_0xc9cc('0x39')](_0x27ccc1[_0xc9cc('0x35')][_0xc9cc('0x39')]));_0x2b7687[_0xc9cc('0x37')]=_0x2b7687[_0xc9cc('0x37')][_0xc9cc('0x3a')]?_0x2b7687[_0xc9cc('0x37')]:_0x34b145['model'];_0x2b7687['order']=qs['sort'](_0x27ccc1[_0xc9cc('0x35')][_0xc9cc('0x3d')]);_0x2b7687[_0xc9cc('0x3e')]=qs['filters'](_[_0xc9cc('0x40')](_0x27ccc1[_0xc9cc('0x35')],_0x34b145[_0xc9cc('0x3f')]));if(_0x27ccc1[_0xc9cc('0x35')][_0xc9cc('0x41')]){_0x2b7687[_0xc9cc('0x3e')]=_['merge'](_0x2b7687['where'],{'$or':_[_0xc9cc('0x30')](_0x2b7687[_0xc9cc('0x37')],function(_0x47eb11){var _0x28ac95={};_0x28ac95[_0x47eb11]={'$like':'%'+_0x27ccc1[_0xc9cc('0x35')][_0xc9cc('0x41')]+'%'};return _0x28ac95;})});}_0x2b7687=_[_0xc9cc('0x42')]({},_0x2b7687,_0x27ccc1['options']);return _0x2af882[_0xc9cc('0x64')](_0x2b7687);}})[_0xc9cc('0x26')](function(_0x30aae4){if(_0x30aae4){_0x13c55d=_0x30aae4[_0xc9cc('0x3a')];if(!_0x27ccc1[_0xc9cc('0x35')]['hasOwnProperty'](_0xc9cc('0x3b'))){_0x2b7687['limit']=qs[_0xc9cc('0x20')](_0x27ccc1[_0xc9cc('0x35')][_0xc9cc('0x20')]);_0x2b7687[_0xc9cc('0x1e')]=qs[_0xc9cc('0x1e')](_0x27ccc1['query'][_0xc9cc('0x1e')]);}return _0x2af882[_0xc9cc('0x64')](_0x2b7687);}})[_0xc9cc('0x26')](function(_0x991c61){if(_0x991c61){return _0x991c61?{'count':_0x13c55d,'rows':_0x991c61}:null;}})['then'](respondWithResult(_0x15e2c1,null))['catch'](handleError(_0x15e2c1,null));};exports[_0xc9cc('0x65')]=function(_0x4209c2,_0x30dc3d,_0x325d02){var _0x5a904f=_0x4209c2[_0xc9cc('0x54')]['ids'];return db[_0xc9cc('0x63')][_0xc9cc('0x45')]({'where':{'id':_0x5a904f},'attributes':['id'],'include':[{'model':db[_0xc9cc('0x5b')],'as':_0xc9cc('0x66'),'attributes':['id','name',_0xc9cc('0x67'),_0xc9cc('0x68'),_0xc9cc('0x69')],'raw':!![]}]})['then'](function(_0x4d761c){if(_0x4d761c){var _0x3a2d8d=_[_0xc9cc('0x6a')](_0x4d761c,function(_0x3edca3){var _0x55d82c=_0x3edca3[_0xc9cc('0x28')]({'plain':!![]});return _0x55d82c[_0xc9cc('0x66')];});return db[_0xc9cc('0x31')][_0xc9cc('0x49')]({'where':{'id':_0x4209c2[_0xc9cc('0x55')]['id']}})[_0xc9cc('0x26')](function(_0x381f4e){return db[_0xc9cc('0x6b')][_0xc9cc('0x6c')](function(_0x259d5a){return _0x381f4e['addTeams'](_0x5a904f,{'transaction':_0x259d5a})[_0xc9cc('0x26')](function(){return BPromise[_0xc9cc('0x6d')](_0x3a2d8d,function(_0x328d12){return db[_0xc9cc('0x59')][_0xc9cc('0x6e')]({'where':{'UserId':_0x328d12['id'],'SmsQueueId':_0x4209c2[_0xc9cc('0x55')]['id']},'transaction':_0x259d5a});});})[_0xc9cc('0x26')](function(){_0x3a2d8d['forEach'](function(_0x4c43dc){socket['emit'](_0xc9cc('0x6f'),{'UserId':_0x4c43dc['id'],'SmsQueueId':_0x381f4e['id']});});});});});}})[_0xc9cc('0x26')](respondWithStatusCode(_0x30dc3d,null))[_0xc9cc('0x4a')](handleError(_0x30dc3d,null));};exports['removeTeams']=function(_0x18ad10,_0x31dbce,_0x451048){return db[_0xc9cc('0x63')][_0xc9cc('0x45')]({'where':{'id':_0x18ad10[_0xc9cc('0x35')][_0xc9cc('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc9cc('0x66'),'attributes':['id'],'raw':!![]}]})[_0xc9cc('0x26')](handleEntityNotFound(_0x31dbce,null))[_0xc9cc('0x26')](function(_0x45f3a4){var _0x8ced93=_[_0xc9cc('0x30')](_0x45f3a4,'id');var _0x476410=[];var _0x20556f=[];var _0x4275cc=squel[_0xc9cc('0x71')]();_0x4275cc[_0xc9cc('0x72')](_0xc9cc('0x73'))[_0xc9cc('0x74')]('team_has_sms_queues','tq')[_0xc9cc('0x75')](_0xc9cc('0x76'),'ut',_0xc9cc('0x77'))[_0xc9cc('0x3e')](_0xc9cc('0x78'),_0x18ad10[_0xc9cc('0x55')]['id']);for(var _0x76dd52=0x0;_0x76dd52<_0x45f3a4[_0xc9cc('0x3a')];_0x76dd52+=0x1){let _0xa0c6c3=_0x45f3a4[_0x76dd52];for(var _0x1522e8=0x0;_0x1522e8<_0xa0c6c3[_0xc9cc('0x66')][_0xc9cc('0x3a')];_0x1522e8+=0x1){let _0x3bd355=_0xa0c6c3[_0xc9cc('0x66')][_0x1522e8];var _0x46a8cd=_0x4275cc['clone']();_0x46a8cd['where']('ut.UserId\x20=\x20?',_0x3bd355['id']);_0x20556f[_0xc9cc('0x79')](db[_0xc9cc('0x6b')]['query'](_0x46a8cd[_0xc9cc('0x7a')](),{'type':db[_0xc9cc('0x6b')][_0xc9cc('0x7b')][_0xc9cc('0x7c')]})['then'](function(_0x1bae38){if(_0x1bae38[_0xc9cc('0x3a')]===0x1){return _0x3bd355['id'];}else{var _0x4b3d1c=_['every'](_['map'](_0x1bae38,_0xc9cc('0x7d')),function(_0x53260a){return _[_0xc9cc('0x7e')](_0x8ced93,_0x53260a);});if(_0x4b3d1c){return _0x3bd355['id'];}}}));}}return BPromise[_0xc9cc('0x7f')](_0x20556f)[_0xc9cc('0x26')](function(_0x22cfb3){_0x476410=_(_0x476410)['union'](_0x22cfb3)['compact']()['value']();return db[_0xc9cc('0x31')][_0xc9cc('0x49')]({'where':{'id':_0x18ad10[_0xc9cc('0x55')]['id']}})['then'](function(_0x3b83f5){return db[_0xc9cc('0x6b')][_0xc9cc('0x6c')](function(_0x1902c8){return _0x3b83f5[_0xc9cc('0x80')](_0x18ad10['query'][_0xc9cc('0x70')],{'transaction':_0x1902c8})[_0xc9cc('0x26')](function(){if(!_['isEmpty'](_0x476410)){return _0x3b83f5['removeAgents'](_0x476410,{'transaction':_0x1902c8});}})[_0xc9cc('0x26')](function(){_0x476410[_0xc9cc('0x81')](function(_0x175889){socket['emit'](_0xc9cc('0x82'),{'UserId':_0x175889,'SmsQueueId':_0x3b83f5['id']});});});});});});})[_0xc9cc('0x26')](respondWithStatusCode(_0x31dbce,null))[_0xc9cc('0x4a')](handleError(_0x31dbce,null));};exports[_0xc9cc('0x83')]=function(_0x46bb44,_0x2471d2,_0x419bab){return db[_0xc9cc('0x31')]['find']({'where':{'id':_0x46bb44[_0xc9cc('0x55')]['id']}})['then'](handleEntityNotFound(_0x2471d2,null))[_0xc9cc('0x26')](function(_0x395a37){if(_0x395a37){return _0x395a37[_0xc9cc('0x83')](_0x46bb44[_0xc9cc('0x54')][_0xc9cc('0x70')],_['omit'](_0x46bb44[_0xc9cc('0x54')],[_0xc9cc('0x70'),'id'])||{})[_0xc9cc('0x84')](function(_0x29c435){for(var _0x475dfd=0x0;_0x475dfd<_0x46bb44[_0xc9cc('0x54')][_0xc9cc('0x70')][_0xc9cc('0x3a')];_0x475dfd+=0x1){socket[_0xc9cc('0x85')](_0xc9cc('0x6f'),{'UserId':Number(_0x46bb44['body'][_0xc9cc('0x70')][_0x475dfd]),'SmsQueueId':Number(_0x46bb44[_0xc9cc('0x55')]['id'])});}return _0x29c435;});}})[_0xc9cc('0x26')](respondWithResult(_0x2471d2,null))[_0xc9cc('0x4a')](handleError(_0x2471d2,null));};exports['removeAgents']=function(_0x3a184f,_0x27e60b,_0x3b7163){return db['SmsQueue']['find']({'where':{'id':_0x3a184f['params']['id']}})['then'](handleEntityNotFound(_0x27e60b,null))['then'](function(_0x5701ec){if(_0x5701ec){return _0x5701ec[_0xc9cc('0x86')](_0x3a184f['query'][_0xc9cc('0x70')])[_0xc9cc('0x26')](function(){if(_[_0xc9cc('0x87')](_0x3a184f[_0xc9cc('0x35')][_0xc9cc('0x70')])){for(var _0xce34ba=0x0;_0xce34ba<_0x3a184f[_0xc9cc('0x35')][_0xc9cc('0x70')]['length'];_0xce34ba+=0x1){socket[_0xc9cc('0x85')](_0xc9cc('0x82'),{'UserId':Number(_0x3a184f['query'][_0xc9cc('0x70')][_0xce34ba]),'SmsQueueId':Number(_0x3a184f[_0xc9cc('0x55')]['id'])});}}else{socket[_0xc9cc('0x85')]('userSmsQueue:remove',{'UserId':Number(_0x3a184f['query'][_0xc9cc('0x70')]),'SmsQueueId':Number(_0x3a184f[_0xc9cc('0x55')]['id'])});}});}})[_0xc9cc('0x26')](respondWithStatusCode(_0x27e60b,null))[_0xc9cc('0x4a')](handleError(_0x27e60b,null));};exports['getAgents']=function(_0x589588,_0x25cb69,_0x31fd62){var _0x213f1c={};var _0x2a5414={};var _0x54c688;var _0x1ffb1d;return db['SmsQueue'][_0xc9cc('0x58')]({'where':{'id':_0x589588['params']['id']}})[_0xc9cc('0x26')](handleEntityNotFound(_0x25cb69,null))[_0xc9cc('0x26')](function(_0x3be7b9){if(_0x3be7b9){_0x54c688=_0x3be7b9;_0x2a5414[_0xc9cc('0x38')]=_['keys'](db[_0xc9cc('0x5b')][_0xc9cc('0x32')]);_0x2a5414[_0xc9cc('0x35')]=_[_0xc9cc('0x47')](_0x589588[_0xc9cc('0x35')]);_0x2a5414[_0xc9cc('0x3f')]=_['intersection'](_0x2a5414[_0xc9cc('0x38')],_0x2a5414[_0xc9cc('0x35')]);_0x213f1c[_0xc9cc('0x37')]=_[_0xc9cc('0x36')](_0x2a5414[_0xc9cc('0x38')],qs[_0xc9cc('0x39')](_0x589588[_0xc9cc('0x35')][_0xc9cc('0x39')]));_0x213f1c[_0xc9cc('0x37')]=_0x213f1c[_0xc9cc('0x37')][_0xc9cc('0x3a')]?_0x213f1c[_0xc9cc('0x37')]:_0x2a5414[_0xc9cc('0x38')];_0x213f1c[_0xc9cc('0x3c')]=qs[_0xc9cc('0x3d')](_0x589588[_0xc9cc('0x35')]['sort']);_0x213f1c[_0xc9cc('0x3e')]=qs['filters'](_[_0xc9cc('0x40')](_0x589588[_0xc9cc('0x35')],_0x2a5414[_0xc9cc('0x3f')]));if(_0x589588[_0xc9cc('0x35')][_0xc9cc('0x41')]){_0x213f1c[_0xc9cc('0x3e')]=_[_0xc9cc('0x42')](_0x213f1c[_0xc9cc('0x3e')],{'$or':_[_0xc9cc('0x30')](_0x213f1c[_0xc9cc('0x37')],function(_0x2057aa){var _0x55a2dc={};_0x55a2dc[_0x2057aa]={'$like':'%'+_0x589588['query'][_0xc9cc('0x41')]+'%'};return _0x55a2dc;})});}_0x213f1c=_['merge']({},_0x213f1c,_0x589588['options']);return _0x54c688['getAgents'](_0x213f1c);}})[_0xc9cc('0x26')](function(_0x1187de){if(_0x1187de){_0x1ffb1d=_0x1187de[_0xc9cc('0x3a')];if(!_0x589588[_0xc9cc('0x35')][_0xc9cc('0x88')](_0xc9cc('0x3b'))){_0x213f1c[_0xc9cc('0x20')]=qs['limit'](_0x589588[_0xc9cc('0x35')][_0xc9cc('0x20')]);_0x213f1c[_0xc9cc('0x1e')]=qs['offset'](_0x589588['query'][_0xc9cc('0x1e')]);}return _0x54c688[_0xc9cc('0x89')](_0x213f1c);}})[_0xc9cc('0x26')](function(_0x240ab9){if(_0x240ab9){return _0x240ab9?{'count':_0x1ffb1d,'rows':_0x240ab9}:null;}})[_0xc9cc('0x26')](respondWithResult(_0x25cb69,null))[_0xc9cc('0x4a')](handleError(_0x25cb69,null));}; \ No newline at end of file +var _0xfff8=['rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','destroy','describe','findOne','UserSmsQueue','hasOwnProperty','SmsQueueId','User','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','userSmsQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./smsQueue.socket','status','end','json','offset','undefined','limit','count','apply','reject','update','then','get','SmsQueues','UserProfileResource','sendStatus','error','name','send','index','map','SmsQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfff8,0xe2));var _0x8fff=function(_0x3b061a,_0x53b89c){_0x3b061a=_0x3b061a-0x0;var _0x4b52c8=_0xfff8[_0x3b061a];return _0x4b52c8;};'use strict';var emlformat=require(_0x8fff('0x0'));var rimraf=require(_0x8fff('0x1'));var zipdir=require(_0x8fff('0x2'));var jsonpatch=require(_0x8fff('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8fff('0x4'));var Mustache=require('mustache');var util=require(_0x8fff('0x5'));var path=require(_0x8fff('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8fff('0x7'));var fs=require('fs');var fs_extra=require(_0x8fff('0x8'));var _=require(_0x8fff('0x9'));var squel=require('squel');var crypto=require(_0x8fff('0xa'));var jsforce=require(_0x8fff('0xb'));var deskjs=require(_0x8fff('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8fff('0xd'));var Papa=require(_0x8fff('0xe'));var Redis=require(_0x8fff('0xf'));var authService=require(_0x8fff('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8fff('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8fff('0x12'));var config=require(_0x8fff('0x13'));var licenseUtil=require(_0x8fff('0x14'));var db=require('../../mysqldb')['db'];config[_0x8fff('0x15')]=_[_0x8fff('0x16')](config[_0x8fff('0x15')],{'host':_0x8fff('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8fff('0x18'))['register'](socket);function respondWithStatusCode(_0x483946,_0x135913){_0x135913=_0x135913||0xcc;return function(_0x431718){if(_0x431718){return _0x483946['sendStatus'](_0x135913);}return _0x483946[_0x8fff('0x19')](_0x135913)[_0x8fff('0x1a')]();};}function respondWithResult(_0x9a55c7,_0x34b3d3){_0x34b3d3=_0x34b3d3||0xc8;return function(_0x28c5a5){if(_0x28c5a5){return _0x9a55c7[_0x8fff('0x19')](_0x34b3d3)[_0x8fff('0x1b')](_0x28c5a5);}};}function respondWithFilteredResult(_0x599e06,_0x516f47){return function(_0x2a13d2){if(_0x2a13d2){var _0x359c08=typeof _0x516f47[_0x8fff('0x1c')]===_0x8fff('0x1d')&&typeof _0x516f47[_0x8fff('0x1e')]===_0x8fff('0x1d');var _0x207231=_0x2a13d2[_0x8fff('0x1f')];var _0x17b8b2=_0x359c08?0x0:_0x516f47[_0x8fff('0x1c')];var _0x8fa39e=_0x359c08?_0x2a13d2['count']:_0x516f47[_0x8fff('0x1c')]+_0x516f47[_0x8fff('0x1e')];var _0x42430b;if(_0x8fa39e>=_0x207231){_0x8fa39e=_0x207231;_0x42430b=0xc8;}else{_0x42430b=0xce;}_0x599e06['status'](_0x42430b);return _0x599e06['set']('Content-Range',_0x17b8b2+'-'+_0x8fa39e+'/'+_0x207231)['json'](_0x2a13d2);}return null;};}function patchUpdates(_0x125694){return function(_0x49fe97){try{jsonpatch[_0x8fff('0x20')](_0x49fe97,_0x125694,!![]);}catch(_0x5423a6){return BPromise[_0x8fff('0x21')](_0x5423a6);}return _0x49fe97['save']();};}function saveUpdates(_0x2e19c8,_0x4e3361){return function(_0x130cdb){if(_0x130cdb){return _0x130cdb[_0x8fff('0x22')](_0x2e19c8)['then'](function(_0x3b153a){return _0x3b153a;});}return null;};}function removeEntity(_0x5247f8,_0x5551e4){return function(_0x2a4e5e){if(_0x2a4e5e){return _0x2a4e5e['destroy']()[_0x8fff('0x23')](function(){var _0x3d4050=_0x2a4e5e[_0x8fff('0x24')]({'plain':!![]});var _0x3ccada=_0x8fff('0x25');return db[_0x8fff('0x26')]['destroy']({'where':{'type':_0x3ccada,'resourceId':_0x3d4050['id']}})['then'](function(){return _0x2a4e5e;});})['then'](function(){_0x5247f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c05cb,_0x183003){return function(_0x26119e){if(!_0x26119e){_0x5c05cb[_0x8fff('0x27')](0x194);}return _0x26119e;};}function handleError(_0x9f68e3,_0x3fd126){_0x3fd126=_0x3fd126||0x1f4;return function(_0x549de9){logger[_0x8fff('0x28')](_0x549de9['stack']);if(_0x549de9['name']){delete _0x549de9[_0x8fff('0x29')];}_0x9f68e3['status'](_0x3fd126)[_0x8fff('0x2a')](_0x549de9);};}exports[_0x8fff('0x2b')]=function(_0x239b36,_0x2787d1){var _0x2b4f5a={},_0xf1d68e={},_0x579d68={'count':0x0,'rows':[]};var _0x50672a=_[_0x8fff('0x2c')](db[_0x8fff('0x2d')][_0x8fff('0x2e')],function(_0x33a70b){return{'name':_0x33a70b[_0x8fff('0x2f')],'type':_0x33a70b[_0x8fff('0x30')][_0x8fff('0x31')]};});_0xf1d68e[_0x8fff('0x32')]=_[_0x8fff('0x2c')](_0x50672a,'name');_0xf1d68e[_0x8fff('0x33')]=_['keys'](_0x239b36[_0x8fff('0x33')]);_0xf1d68e[_0x8fff('0x34')]=_[_0x8fff('0x35')](_0xf1d68e[_0x8fff('0x32')],_0xf1d68e[_0x8fff('0x33')]);_0x2b4f5a[_0x8fff('0x36')]=_['intersection'](_0xf1d68e[_0x8fff('0x32')],qs[_0x8fff('0x37')](_0x239b36[_0x8fff('0x33')]['fields']));_0x2b4f5a[_0x8fff('0x36')]=_0x2b4f5a[_0x8fff('0x36')][_0x8fff('0x38')]?_0x2b4f5a['attributes']:_0xf1d68e[_0x8fff('0x32')];if(!_0x239b36['query']['hasOwnProperty'](_0x8fff('0x39'))){_0x2b4f5a[_0x8fff('0x1e')]=qs['limit'](_0x239b36[_0x8fff('0x33')]['limit']);_0x2b4f5a[_0x8fff('0x1c')]=qs['offset'](_0x239b36[_0x8fff('0x33')][_0x8fff('0x1c')]);}_0x2b4f5a[_0x8fff('0x3a')]=qs[_0x8fff('0x3b')](_0x239b36[_0x8fff('0x33')][_0x8fff('0x3b')]);_0x2b4f5a[_0x8fff('0x3c')]=qs['filters'](_[_0x8fff('0x3d')](_0x239b36[_0x8fff('0x33')],_0xf1d68e[_0x8fff('0x34')]),_0x50672a);if(_0x239b36[_0x8fff('0x33')]['filter']){_0x2b4f5a[_0x8fff('0x3c')]=_[_0x8fff('0x3e')](_0x2b4f5a['where'],{'$or':_['map'](_0x50672a,function(_0xaaefeb){if(_0xaaefeb['type']!==_0x8fff('0x3f')){var _0x270987={};_0x270987[_0xaaefeb[_0x8fff('0x29')]]={'$like':'%'+_0x239b36[_0x8fff('0x33')][_0x8fff('0x40')]+'%'};return _0x270987;}})});}_0x2b4f5a=_[_0x8fff('0x3e')]({},_0x2b4f5a,_0x239b36[_0x8fff('0x41')]);var _0x136b0d={'where':_0x2b4f5a[_0x8fff('0x3c')]};return db[_0x8fff('0x2d')][_0x8fff('0x1f')](_0x136b0d)[_0x8fff('0x23')](function(_0x18ee9f){_0x579d68[_0x8fff('0x1f')]=_0x18ee9f;if(_0x239b36[_0x8fff('0x33')][_0x8fff('0x42')]){_0x2b4f5a[_0x8fff('0x43')]=[{'all':!![]}];}return db[_0x8fff('0x2d')][_0x8fff('0x44')](_0x2b4f5a);})[_0x8fff('0x23')](function(_0x5113cb){_0x579d68[_0x8fff('0x45')]=_0x5113cb;return _0x579d68;})[_0x8fff('0x23')](respondWithFilteredResult(_0x2787d1,_0x2b4f5a))[_0x8fff('0x46')](handleError(_0x2787d1,null));};exports[_0x8fff('0x47')]=function(_0x428c81,_0x4d09eb){var _0x374389={'raw':!![],'where':{'id':_0x428c81[_0x8fff('0x48')]['id']}},_0x11aaf1={};_0x11aaf1[_0x8fff('0x32')]=_[_0x8fff('0x49')](db[_0x8fff('0x2d')]['rawAttributes']);_0x11aaf1[_0x8fff('0x33')]=_[_0x8fff('0x49')](_0x428c81[_0x8fff('0x33')]);_0x11aaf1[_0x8fff('0x34')]=_[_0x8fff('0x35')](_0x11aaf1[_0x8fff('0x32')],_0x11aaf1[_0x8fff('0x33')]);_0x374389['attributes']=_['intersection'](_0x11aaf1[_0x8fff('0x32')],qs[_0x8fff('0x37')](_0x428c81['query'][_0x8fff('0x37')]));_0x374389[_0x8fff('0x36')]=_0x374389[_0x8fff('0x36')][_0x8fff('0x38')]?_0x374389[_0x8fff('0x36')]:_0x11aaf1[_0x8fff('0x32')];if(_0x428c81[_0x8fff('0x33')][_0x8fff('0x42')]){_0x374389['include']=[{'all':!![]}];}_0x374389=_[_0x8fff('0x3e')]({},_0x374389,_0x428c81[_0x8fff('0x41')]);return db[_0x8fff('0x2d')][_0x8fff('0x4a')](_0x374389)[_0x8fff('0x23')](handleEntityNotFound(_0x4d09eb,null))[_0x8fff('0x23')](respondWithResult(_0x4d09eb,null))[_0x8fff('0x46')](handleError(_0x4d09eb,null));};exports[_0x8fff('0x4b')]=function(_0x576e4f,_0x3cc2e0){return db['SmsQueue'][_0x8fff('0x4b')](_0x576e4f[_0x8fff('0x4c')],{})[_0x8fff('0x23')](function(_0x1b2937){var _0x1b52ba=_0x576e4f[_0x8fff('0x4d')][_0x8fff('0x24')]({'plain':!![]});if(!_0x1b52ba)throw new Error(_0x8fff('0x4e'));if(_0x1b52ba[_0x8fff('0x4f')]===_0x8fff('0x4d')){var _0x4b4566=_0x1b2937['get']({'plain':!![]});var _0x4eb91e='SmsQueues';return db['UserProfileSection'][_0x8fff('0x4a')]({'where':{'name':_0x4eb91e,'userProfileId':_0x1b52ba[_0x8fff('0x50')]},'raw':!![]})['then'](function(_0x1929c2){if(_0x1929c2&&_0x1929c2[_0x8fff('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x4b4566[_0x8fff('0x29')],'resourceId':_0x4b4566['id'],'type':_0x1929c2[_0x8fff('0x29')],'sectionId':_0x1929c2['id']},{})[_0x8fff('0x23')](function(){return _0x1b2937;});}else{return _0x1b2937;}})[_0x8fff('0x46')](function(_0x4923fa){logger[_0x8fff('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4923fa);throw _0x4923fa;});}return _0x1b2937;})['then'](respondWithResult(_0x3cc2e0,0xc9))['catch'](handleError(_0x3cc2e0,null));};exports['update']=function(_0x2a9658,_0x55540d){if(_0x2a9658[_0x8fff('0x4c')]['id']){delete _0x2a9658[_0x8fff('0x4c')]['id'];}return db[_0x8fff('0x2d')][_0x8fff('0x4a')]({'where':{'id':_0x2a9658[_0x8fff('0x48')]['id']}})[_0x8fff('0x23')](handleEntityNotFound(_0x55540d,null))[_0x8fff('0x23')](saveUpdates(_0x2a9658[_0x8fff('0x4c')],null))[_0x8fff('0x23')](respondWithResult(_0x55540d,null))['catch'](handleError(_0x55540d,null));};exports[_0x8fff('0x52')]=function(_0x404c92,_0x17c8fa){return db[_0x8fff('0x2d')][_0x8fff('0x4a')]({'where':{'id':_0x404c92[_0x8fff('0x48')]['id']}})[_0x8fff('0x23')](handleEntityNotFound(_0x17c8fa,null))['then'](removeEntity(_0x17c8fa,null))[_0x8fff('0x46')](handleError(_0x17c8fa,null));};exports[_0x8fff('0x53')]=function(_0x7680f3,_0x1e3150){return db[_0x8fff('0x2d')]['describe']()['then'](respondWithResult(_0x1e3150,null))[_0x8fff('0x46')](handleError(_0x1e3150,null));};exports['getMembers']=function(_0x234f07,_0xc9432,_0x4234a5){var _0x393de4={'raw':!![],'where':{}},_0x58706f={},_0x48e963;return db['SmsQueue'][_0x8fff('0x54')]({'where':{'id':_0x234f07[_0x8fff('0x48')]['id']}})[_0x8fff('0x23')](handleEntityNotFound(_0xc9432,null))['then'](function(_0x230fbb){if(_0x230fbb){_0x48e963=_0x230fbb[_0x8fff('0x24')]({'plain':!![]});_0x58706f[_0x8fff('0x32')]=_[_0x8fff('0x49')](db[_0x8fff('0x55')]['rawAttributes']);_0x58706f[_0x8fff('0x33')]=_[_0x8fff('0x49')](_0x234f07[_0x8fff('0x33')]);_0x58706f['filters']=_[_0x8fff('0x35')](_0x58706f[_0x8fff('0x32')],_0x58706f['query']);_0x393de4['attributes']=_[_0x8fff('0x35')](_0x58706f[_0x8fff('0x32')],qs[_0x8fff('0x37')](_0x234f07[_0x8fff('0x33')][_0x8fff('0x37')]));_0x393de4[_0x8fff('0x36')]=_0x393de4[_0x8fff('0x36')][_0x8fff('0x38')]?_0x393de4[_0x8fff('0x36')]:_0x58706f[_0x8fff('0x32')];if(!_0x234f07[_0x8fff('0x33')][_0x8fff('0x56')](_0x8fff('0x39'))){_0x393de4[_0x8fff('0x1e')]=qs[_0x8fff('0x1e')](_0x234f07[_0x8fff('0x33')]['limit']);_0x393de4[_0x8fff('0x1c')]=qs['offset'](_0x234f07[_0x8fff('0x33')][_0x8fff('0x1c')]);}_0x393de4[_0x8fff('0x3a')]=qs['sort'](_0x234f07['query'][_0x8fff('0x3b')]);_0x393de4[_0x8fff('0x3c')]=qs[_0x8fff('0x34')](_[_0x8fff('0x3d')](_0x234f07[_0x8fff('0x33')],_0x58706f[_0x8fff('0x34')]));_0x393de4[_0x8fff('0x3c')][_0x8fff('0x57')]=_0x230fbb['id'];if(_0x234f07[_0x8fff('0x33')]['filter']){_0x393de4[_0x8fff('0x3c')]=_[_0x8fff('0x3e')](_0x393de4[_0x8fff('0x3c')],{'$or':_[_0x8fff('0x2c')](_0x393de4[_0x8fff('0x36')],function(_0x58b181){var _0x1c04da={};_0x1c04da[_0x58b181]={'$like':'%'+_0x234f07[_0x8fff('0x33')][_0x8fff('0x40')]+'%'};return _0x1c04da;})});}_0x393de4=_['merge']({},_0x393de4,_0x234f07[_0x8fff('0x41')]);return db['UserSmsQueue'][_0x8fff('0x44')](_0x393de4);}})[_0x8fff('0x23')](function(_0x289bf3){if(_0x289bf3){return db[_0x8fff('0x58')]['findAndCountAll']({'where':{'id':_[_0x8fff('0x2c')](_0x289bf3,_0x8fff('0x59')),'role':_0x8fff('0x5a')},'attributes':['id','name',_0x8fff('0x5b'),_0x8fff('0x5c'),_0x8fff('0x5d')]});}})['then'](function(_0x2d931e){if(_0x2d931e){return{'count':_0x2d931e['count'],'rows':_['map'](_0x2d931e[_0x8fff('0x45')],function(_0x10a9e7){return{'membername':_0x10a9e7['name'],'UserId':_0x10a9e7['id'],'queue_name':_0x48e963[_0x8fff('0x29')],'SmsQueueId':_0x48e963['id'],'interface':util[_0x8fff('0x5e')](_0x8fff('0x5f'),_0x8fff('0x60'),_0x10a9e7[_0x8fff('0x29')]),'penalty':0x0,'paused':_0x10a9e7[_0x8fff('0x5b')],'createdAt':_0x10a9e7['createdAt'],'updatedAt':_0x10a9e7[_0x8fff('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8fff('0x23')](respondWithFilteredResult(_0xc9432,_0x393de4))[_0x8fff('0x46')](handleError(_0xc9432,null));};exports[_0x8fff('0x61')]=function(_0x3d28f6,_0x3cb4f0,_0x5a5a78){var _0x397ae1={};var _0x555d2f={};var _0x389527;var _0x306ac1;return db[_0x8fff('0x2d')][_0x8fff('0x54')]({'where':{'id':_0x3d28f6[_0x8fff('0x48')]['id']}})['then'](handleEntityNotFound(_0x3cb4f0,null))[_0x8fff('0x23')](function(_0x5eb585){if(_0x5eb585){_0x389527=_0x5eb585;_0x555d2f[_0x8fff('0x32')]=_[_0x8fff('0x49')](db[_0x8fff('0x62')][_0x8fff('0x2e')]);_0x555d2f[_0x8fff('0x33')]=_[_0x8fff('0x49')](_0x3d28f6[_0x8fff('0x33')]);_0x555d2f[_0x8fff('0x34')]=_[_0x8fff('0x35')](_0x555d2f[_0x8fff('0x32')],_0x555d2f[_0x8fff('0x33')]);_0x397ae1[_0x8fff('0x36')]=_['intersection'](_0x555d2f[_0x8fff('0x32')],qs[_0x8fff('0x37')](_0x3d28f6[_0x8fff('0x33')]['fields']));_0x397ae1[_0x8fff('0x36')]=_0x397ae1[_0x8fff('0x36')]['length']?_0x397ae1[_0x8fff('0x36')]:_0x555d2f[_0x8fff('0x32')];_0x397ae1[_0x8fff('0x3a')]=qs[_0x8fff('0x3b')](_0x3d28f6[_0x8fff('0x33')]['sort']);_0x397ae1['where']=qs['filters'](_[_0x8fff('0x3d')](_0x3d28f6[_0x8fff('0x33')],_0x555d2f[_0x8fff('0x34')]));if(_0x3d28f6[_0x8fff('0x33')][_0x8fff('0x40')]){_0x397ae1['where']=_['merge'](_0x397ae1[_0x8fff('0x3c')],{'$or':_[_0x8fff('0x2c')](_0x397ae1[_0x8fff('0x36')],function(_0x1bdafd){var _0x1d8c98={};_0x1d8c98[_0x1bdafd]={'$like':'%'+_0x3d28f6['query'][_0x8fff('0x40')]+'%'};return _0x1d8c98;})});}_0x397ae1=_[_0x8fff('0x3e')]({},_0x397ae1,_0x3d28f6[_0x8fff('0x41')]);return _0x389527[_0x8fff('0x61')](_0x397ae1);}})[_0x8fff('0x23')](function(_0x7ddc5b){if(_0x7ddc5b){_0x306ac1=_0x7ddc5b[_0x8fff('0x38')];if(!_0x3d28f6[_0x8fff('0x33')][_0x8fff('0x56')](_0x8fff('0x39'))){_0x397ae1[_0x8fff('0x1e')]=qs[_0x8fff('0x1e')](_0x3d28f6[_0x8fff('0x33')][_0x8fff('0x1e')]);_0x397ae1[_0x8fff('0x1c')]=qs[_0x8fff('0x1c')](_0x3d28f6[_0x8fff('0x33')][_0x8fff('0x1c')]);}return _0x389527['getTeams'](_0x397ae1);}})['then'](function(_0x23e603){if(_0x23e603){return _0x23e603?{'count':_0x306ac1,'rows':_0x23e603}:null;}})[_0x8fff('0x23')](respondWithResult(_0x3cb4f0,null))[_0x8fff('0x46')](handleError(_0x3cb4f0,null));};exports[_0x8fff('0x63')]=function(_0x57022a,_0x4deb31,_0x53ae1b){var _0x52825b=_0x57022a[_0x8fff('0x4c')][_0x8fff('0x64')];return db[_0x8fff('0x62')]['findAll']({'where':{'id':_0x52825b},'attributes':['id'],'include':[{'model':db[_0x8fff('0x58')],'as':_0x8fff('0x65'),'attributes':['id',_0x8fff('0x29'),_0x8fff('0x66'),_0x8fff('0x67'),'interface'],'raw':!![]}]})[_0x8fff('0x23')](function(_0x3d7de6){if(_0x3d7de6){var _0x15cd56=_[_0x8fff('0x68')](_0x3d7de6,function(_0x5b95ff){var _0x588209=_0x5b95ff['get']({'plain':!![]});return _0x588209['Agents'];});return db[_0x8fff('0x2d')][_0x8fff('0x4a')]({'where':{'id':_0x57022a[_0x8fff('0x48')]['id']}})[_0x8fff('0x23')](function(_0x32e6e2){return db[_0x8fff('0x69')][_0x8fff('0x6a')](function(_0x486a9c){return _0x32e6e2[_0x8fff('0x63')](_0x52825b,{'transaction':_0x486a9c})['then'](function(){return BPromise[_0x8fff('0x6b')](_0x15cd56,function(_0xd7c80f){return db[_0x8fff('0x55')][_0x8fff('0x6c')]({'where':{'UserId':_0xd7c80f['id'],'SmsQueueId':_0x57022a[_0x8fff('0x48')]['id']},'transaction':_0x486a9c});});})['then'](function(){_0x15cd56[_0x8fff('0x6d')](function(_0x47c06f){socket[_0x8fff('0x6e')]('userSmsQueue:save',{'UserId':_0x47c06f['id'],'SmsQueueId':_0x32e6e2['id']});});});});});}})[_0x8fff('0x23')](respondWithStatusCode(_0x4deb31,null))[_0x8fff('0x46')](handleError(_0x4deb31,null));};exports[_0x8fff('0x6f')]=function(_0x3c977e,_0x50996e,_0x46e6fc){return db[_0x8fff('0x62')][_0x8fff('0x44')]({'where':{'id':_0x3c977e['query'][_0x8fff('0x64')]},'attributes':['id'],'include':[{'model':db[_0x8fff('0x58')],'as':_0x8fff('0x65'),'attributes':['id'],'raw':!![]}]})[_0x8fff('0x23')](handleEntityNotFound(_0x50996e,null))[_0x8fff('0x23')](function(_0x17f326){var _0x53c3ee=_[_0x8fff('0x2c')](_0x17f326,'id');var _0x5ede88=[];var _0x1386c8=[];var _0x22a152=squel[_0x8fff('0x70')]();_0x22a152[_0x8fff('0x71')](_0x8fff('0x72'))[_0x8fff('0x73')](_0x8fff('0x74'),'tq')['join'](_0x8fff('0x75'),'ut',_0x8fff('0x76'))[_0x8fff('0x3c')](_0x8fff('0x77'),_0x3c977e[_0x8fff('0x48')]['id']);for(var _0x3ea143=0x0;_0x3ea143<_0x17f326[_0x8fff('0x38')];_0x3ea143+=0x1){let _0x262c0d=_0x17f326[_0x3ea143];for(var _0x5d9ad1=0x0;_0x5d9ad1<_0x262c0d[_0x8fff('0x65')][_0x8fff('0x38')];_0x5d9ad1+=0x1){let _0x4d5a49=_0x262c0d[_0x8fff('0x65')][_0x5d9ad1];var _0x326afb=_0x22a152['clone']();_0x326afb[_0x8fff('0x3c')](_0x8fff('0x78'),_0x4d5a49['id']);_0x1386c8[_0x8fff('0x79')](db[_0x8fff('0x69')]['query'](_0x326afb['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x8fff('0x23')](function(_0x356b29){if(_0x356b29[_0x8fff('0x38')]===0x1){return _0x4d5a49['id'];}else{var _0x2b7d01=_[_0x8fff('0x7a')](_[_0x8fff('0x2c')](_0x356b29,_0x8fff('0x7b')),function(_0xf3a9ba){return _[_0x8fff('0x7c')](_0x53c3ee,_0xf3a9ba);});if(_0x2b7d01){return _0x4d5a49['id'];}}}));}}return BPromise[_0x8fff('0x7d')](_0x1386c8)[_0x8fff('0x23')](function(_0x494251){_0x5ede88=_(_0x5ede88)[_0x8fff('0x7e')](_0x494251)['compact']()[_0x8fff('0x7f')]();return db['SmsQueue'][_0x8fff('0x4a')]({'where':{'id':_0x3c977e[_0x8fff('0x48')]['id']}})[_0x8fff('0x23')](function(_0x3c8d08){return db[_0x8fff('0x69')]['transaction'](function(_0x5c25f4){return _0x3c8d08[_0x8fff('0x6f')](_0x3c977e[_0x8fff('0x33')][_0x8fff('0x64')],{'transaction':_0x5c25f4})[_0x8fff('0x23')](function(){if(!_[_0x8fff('0x80')](_0x5ede88)){return _0x3c8d08[_0x8fff('0x81')](_0x5ede88,{'transaction':_0x5c25f4});}})[_0x8fff('0x23')](function(){_0x5ede88['forEach'](function(_0x354590){socket[_0x8fff('0x6e')](_0x8fff('0x82'),{'UserId':_0x354590,'SmsQueueId':_0x3c8d08['id']});});});});});});})['then'](respondWithStatusCode(_0x50996e,null))[_0x8fff('0x46')](handleError(_0x50996e,null));};exports['addAgents']=function(_0x28d808,_0xb62336,_0x3b2d02){return db['SmsQueue']['find']({'where':{'id':_0x28d808[_0x8fff('0x48')]['id']}})['then'](handleEntityNotFound(_0xb62336,null))[_0x8fff('0x23')](function(_0x237339){if(_0x237339){return _0x237339[_0x8fff('0x83')](_0x28d808[_0x8fff('0x4c')]['ids'],_[_0x8fff('0x84')](_0x28d808[_0x8fff('0x4c')],[_0x8fff('0x64'),'id'])||{})['spread'](function(_0x1cb6c1){for(var _0x2c2974=0x0;_0x2c2974<_0x28d808['body'][_0x8fff('0x64')][_0x8fff('0x38')];_0x2c2974+=0x1){socket[_0x8fff('0x6e')](_0x8fff('0x85'),{'UserId':Number(_0x28d808['body'][_0x8fff('0x64')][_0x2c2974]),'SmsQueueId':Number(_0x28d808[_0x8fff('0x48')]['id'])});}return _0x1cb6c1;});}})[_0x8fff('0x23')](respondWithResult(_0xb62336,null))[_0x8fff('0x46')](handleError(_0xb62336,null));};exports[_0x8fff('0x81')]=function(_0x276dc8,_0x3ad18c,_0x3285c2){return db[_0x8fff('0x2d')][_0x8fff('0x4a')]({'where':{'id':_0x276dc8[_0x8fff('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ad18c,null))[_0x8fff('0x23')](function(_0x23c2cd){if(_0x23c2cd){return _0x23c2cd[_0x8fff('0x81')](_0x276dc8[_0x8fff('0x33')][_0x8fff('0x64')])[_0x8fff('0x23')](function(){if(_[_0x8fff('0x86')](_0x276dc8[_0x8fff('0x33')]['ids'])){for(var _0x1e8380=0x0;_0x1e8380<_0x276dc8[_0x8fff('0x33')][_0x8fff('0x64')][_0x8fff('0x38')];_0x1e8380+=0x1){socket[_0x8fff('0x6e')]('userSmsQueue:remove',{'UserId':Number(_0x276dc8[_0x8fff('0x33')][_0x8fff('0x64')][_0x1e8380]),'SmsQueueId':Number(_0x276dc8[_0x8fff('0x48')]['id'])});}}else{socket['emit'](_0x8fff('0x82'),{'UserId':Number(_0x276dc8[_0x8fff('0x33')][_0x8fff('0x64')]),'SmsQueueId':Number(_0x276dc8[_0x8fff('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x3ad18c,null))[_0x8fff('0x46')](handleError(_0x3ad18c,null));};exports['getAgents']=function(_0x34ebcc,_0x16df24,_0x2a2a6a){var _0x2f7ec8={};var _0x24c6da={};var _0x557648;var _0x4ffbf6;return db[_0x8fff('0x2d')]['findOne']({'where':{'id':_0x34ebcc[_0x8fff('0x48')]['id']}})[_0x8fff('0x23')](handleEntityNotFound(_0x16df24,null))[_0x8fff('0x23')](function(_0x1ef196){if(_0x1ef196){_0x557648=_0x1ef196;_0x24c6da[_0x8fff('0x32')]=_['keys'](db[_0x8fff('0x58')][_0x8fff('0x2e')]);_0x24c6da[_0x8fff('0x33')]=_['keys'](_0x34ebcc[_0x8fff('0x33')]);_0x24c6da[_0x8fff('0x34')]=_[_0x8fff('0x35')](_0x24c6da['model'],_0x24c6da[_0x8fff('0x33')]);_0x2f7ec8[_0x8fff('0x36')]=_[_0x8fff('0x35')](_0x24c6da[_0x8fff('0x32')],qs[_0x8fff('0x37')](_0x34ebcc['query'][_0x8fff('0x37')]));_0x2f7ec8[_0x8fff('0x36')]=_0x2f7ec8['attributes'][_0x8fff('0x38')]?_0x2f7ec8['attributes']:_0x24c6da[_0x8fff('0x32')];_0x2f7ec8[_0x8fff('0x3a')]=qs[_0x8fff('0x3b')](_0x34ebcc[_0x8fff('0x33')]['sort']);_0x2f7ec8[_0x8fff('0x3c')]=qs['filters'](_[_0x8fff('0x3d')](_0x34ebcc[_0x8fff('0x33')],_0x24c6da['filters']));if(_0x34ebcc[_0x8fff('0x33')][_0x8fff('0x40')]){_0x2f7ec8['where']=_[_0x8fff('0x3e')](_0x2f7ec8[_0x8fff('0x3c')],{'$or':_[_0x8fff('0x2c')](_0x2f7ec8[_0x8fff('0x36')],function(_0x3a63bb){var _0x13a2ab={};_0x13a2ab[_0x3a63bb]={'$like':'%'+_0x34ebcc['query'][_0x8fff('0x40')]+'%'};return _0x13a2ab;})});}_0x2f7ec8=_[_0x8fff('0x3e')]({},_0x2f7ec8,_0x34ebcc[_0x8fff('0x41')]);return _0x557648[_0x8fff('0x87')](_0x2f7ec8);}})[_0x8fff('0x23')](function(_0x4b76a0){if(_0x4b76a0){_0x4ffbf6=_0x4b76a0['length'];if(!_0x34ebcc[_0x8fff('0x33')][_0x8fff('0x56')]('nolimit')){_0x2f7ec8[_0x8fff('0x1e')]=qs['limit'](_0x34ebcc['query'][_0x8fff('0x1e')]);_0x2f7ec8[_0x8fff('0x1c')]=qs['offset'](_0x34ebcc[_0x8fff('0x33')][_0x8fff('0x1c')]);}return _0x557648[_0x8fff('0x87')](_0x2f7ec8);}})['then'](function(_0x329272){if(_0x329272){return _0x329272?{'count':_0x4ffbf6,'rows':_0x329272}:null;}})[_0x8fff('0x23')](respondWithResult(_0x16df24,null))[_0x8fff('0x46')](handleError(_0x16df24,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index d212fcc..d8df152 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 _0x7e91=['save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x4e2e1c,_0x192384){var _0x3b27c2=function(_0x734e9){while(--_0x734e9){_0x4e2e1c['push'](_0x4e2e1c['shift']());}};_0x3b27c2(++_0x192384);}(_0x7e91,0xf9));var _0x17e9=function(_0x51ea8a,_0x39518e){_0x51ea8a=_0x51ea8a-0x0;var _0xde8ce4=_0x7e91[_0x51ea8a];return _0xde8ce4;};'use strict';var EventEmitter=require(_0x17e9('0x0'));var SmsQueue=require(_0x17e9('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x17e9('0x2')](0x0);var events={'afterCreate':_0x17e9('0x3'),'afterUpdate':_0x17e9('0x4'),'afterDestroy':_0x17e9('0x5')};function emitEvent(_0x3a30c8){return function(_0x5ad2d0,_0x3744cb,_0x5c6716){SmsQueueEvents['emit'](_0x3a30c8+':'+_0x5ad2d0['id'],_0x5ad2d0);SmsQueueEvents['emit'](_0x3a30c8,_0x5ad2d0);_0x5c6716(null);};}for(var e in events){if(events[_0x17e9('0x6')](e)){var event=events[e];SmsQueue[_0x17e9('0x7')](e,emitEvent(event));}}module[_0x17e9('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x016e=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x18a1ef,_0x2e0151){var _0x4a28d9=function(_0x215fde){while(--_0x215fde){_0x18a1ef['push'](_0x18a1ef['shift']());}};_0x4a28d9(++_0x2e0151);}(_0x016e,0x155));var _0xe016=function(_0x4bc7e,_0x2c3c57){_0x4bc7e=_0x4bc7e-0x0;var _0x5bf96a=_0x016e[_0x4bc7e];return _0x5bf96a;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xe016('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xe016('0x1')](0x0);var events={'afterCreate':_0xe016('0x2'),'afterUpdate':_0xe016('0x3'),'afterDestroy':'remove'};function emitEvent(_0xa8b03d){return function(_0x5bb574,_0x53307a,_0xf251c9){SmsQueueEvents[_0xe016('0x4')](_0xa8b03d+':'+_0x5bb574['id'],_0x5bb574);SmsQueueEvents[_0xe016('0x4')](_0xa8b03d,_0x5bb574);_0xf251c9(null);};}for(var e in events){if(events[_0xe016('0x5')](e)){var event=events[e];SmsQueue[_0xe016('0x6')](e,emitEvent(event));}}module[_0xe016('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index efb8be8..d556ab6 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 _0x1a83=['rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','util','bluebird','request-promise'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x1a83,0x1da));var _0x31a8=function(_0x3a317c,_0x12a022){_0x3a317c=_0x3a317c-0x0;var _0x596cd1=_0x1a83[_0x3a317c];return _0x596cd1;};'use strict';var _=require('lodash');var util=require(_0x31a8('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x31a8('0x1'));var rp=require(_0x31a8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31a8('0x3'));var config=require(_0x31a8('0x4'));var attributes=require(_0x31a8('0x5'));module[_0x31a8('0x6')]=function(_0x15c877,_0x2b0fe7){return _0x15c877['define'](_0x31a8('0x7'),attributes,{'tableName':_0x31a8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20ed=['bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x1da9ec,_0x5ba3de){var _0x15e65a=function(_0x55eb0b){while(--_0x55eb0b){_0x1da9ec['push'](_0x1da9ec['shift']());}};_0x15e65a(++_0x5ba3de);}(_0x20ed,0xaf));var _0xd20e=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x20ed[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0xd20e('0x0'));var util=require(_0xd20e('0x1'));var logger=require(_0xd20e('0x2'))(_0xd20e('0x3'));var moment=require(_0xd20e('0x4'));var BPromise=require(_0xd20e('0x5'));var rp=require(_0xd20e('0x6'));var fs=require('fs');var path=require(_0xd20e('0x7'));var rimraf=require(_0xd20e('0x8'));var config=require(_0xd20e('0x9'));var attributes=require(_0xd20e('0xa'));module[_0xd20e('0xb')]=function(_0x2b6640,_0x7cd53d){return _0x2b6640[_0xd20e('0xc')](_0xd20e('0xd'),attributes,{'tableName':_0xd20e('0xe'),'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 7ec1f5a..40e0e44 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 _0xf533=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./smsQueue.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowSmsQueue','lodash','moment','bluebird','ioredis'];(function(_0x27b42c,_0x1bbc67){var _0x2e931c=function(_0x2d59ab){while(--_0x2d59ab){_0x27b42c['push'](_0x27b42c['shift']());}};_0x2e931c(++_0x1bbc67);}(_0xf533,0x1b4));var _0x3f53=function(_0x4706a6,_0x5a1c63){_0x4706a6=_0x4706a6-0x0;var _0x1bb705=_0xf533[_0x4706a6];return _0x1bb705;};'use strict';var _=require(_0x3f53('0x0'));var util=require('util');var moment=require(_0x3f53('0x1'));var BPromise=require(_0x3f53('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f53('0x3'));var db=require(_0x3f53('0x4'))['db'];var utils=require(_0x3f53('0x5'));var logger=require(_0x3f53('0x6'))(_0x3f53('0x7'));var config=require(_0x3f53('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3f53('0x9')][_0x3f53('0xa')]({'port':0x232a});config[_0x3f53('0xb')]=_['defaults'](config[_0x3f53('0xb')],{'host':_0x3f53('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3f53('0xb')]));require(_0x3f53('0xd'))[_0x3f53('0xe')](socket);function respondWithRpcPromise(_0x5e931a,_0x44eb3b,_0x29d9d5){return new BPromise(function(_0x5e2854,_0x52bd21){return client[_0x3f53('0xf')](_0x5e931a,_0x29d9d5)[_0x3f53('0x10')](function(_0x226b96){logger[_0x3f53('0x11')]('SmsQueue,\x20%s,\x20%s',_0x44eb3b,_0x3f53('0x12'));logger[_0x3f53('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x44eb3b,'request\x20sent',JSON[_0x3f53('0x14')](_0x226b96));if(_0x226b96['error']){if(_0x226b96[_0x3f53('0x15')][_0x3f53('0x16')]===0x1f4){logger[_0x3f53('0x15')](_0x3f53('0x17'),_0x44eb3b,_0x226b96[_0x3f53('0x15')][_0x3f53('0x18')]);return _0x52bd21(_0x226b96[_0x3f53('0x15')]['message']);}logger[_0x3f53('0x15')](_0x3f53('0x17'),_0x44eb3b,_0x226b96[_0x3f53('0x15')][_0x3f53('0x18')]);return _0x5e2854(_0x226b96['error'][_0x3f53('0x18')]);}else{logger[_0x3f53('0x11')]('SmsQueue,\x20%s,\x20%s',_0x44eb3b,_0x3f53('0x12'));_0x5e2854(_0x226b96[_0x3f53('0x19')]['message']);}})[_0x3f53('0x1a')](function(_0x32303c){logger['error'](_0x3f53('0x17'),_0x44eb3b,_0x32303c);_0x52bd21(_0x32303c);});});}exports[_0x3f53('0x1b')]=function(_0x223b17){var _0x545cdb=this;return new Promise(function(_0x124c17,_0x4b2bc1){return db[_0x3f53('0x1c')][_0x3f53('0x1d')]({'raw':_0x223b17[_0x3f53('0x1e')]?_0x223b17[_0x3f53('0x1e')][_0x3f53('0x1f')]===undefined?!![]:![]:!![],'where':_0x223b17[_0x3f53('0x1e')]?_0x223b17[_0x3f53('0x1e')][_0x3f53('0x20')]||null:null,'attributes':_0x223b17[_0x3f53('0x1e')]?_0x223b17[_0x3f53('0x1e')][_0x3f53('0x21')]||null:null,'limit':_0x223b17[_0x3f53('0x1e')]?_0x223b17[_0x3f53('0x1e')][_0x3f53('0x22')]||null:null,'include':_0x223b17[_0x3f53('0x1e')]?_0x223b17['options'][_0x3f53('0x23')]?_[_0x3f53('0x24')](_0x223b17[_0x3f53('0x1e')][_0x3f53('0x23')],function(_0x49df84){return{'model':db[_0x49df84['model']],'as':_0x49df84['as'],'attributes':_0x49df84['attributes'],'include':_0x49df84['include']?_['map'](_0x49df84[_0x3f53('0x23')],function(_0x509c83){return{'model':db[_0x509c83[_0x3f53('0x25')]],'as':_0x509c83['as'],'attributes':_0x509c83[_0x3f53('0x21')],'include':_0x509c83[_0x3f53('0x23')]?_['map'](_0x509c83[_0x3f53('0x23')],function(_0x19a43a){return{'model':db[_0x19a43a[_0x3f53('0x25')]],'as':_0x19a43a['as'],'attributes':_0x19a43a[_0x3f53('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d7b5b){logger[_0x3f53('0x11')]('GetSmsQueue',_0x223b17);logger[_0x3f53('0x13')]('GetSmsQueue',_0x223b17,JSON['stringify'](_0x2d7b5b));_0x124c17(_0x2d7b5b);})[_0x3f53('0x1a')](function(_0x53baa6){logger[_0x3f53('0x15')]('GetSmsQueue',_0x53baa6['message'],_0x223b17);_0x4b2bc1(_0x545cdb[_0x3f53('0x15')](0x1f4,_0x53baa6[_0x3f53('0x18')]));});});};exports['ShowSmsQueue']=function(_0x51e49f){var _0x12f549=this;return new Promise(function(_0x11d396,_0x18a31d){return db['SmsQueue'][_0x3f53('0x26')]({'raw':_0x51e49f['options']?_0x51e49f[_0x3f53('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x51e49f[_0x3f53('0x1e')]?_0x51e49f[_0x3f53('0x1e')]['where']||null:null,'attributes':_0x51e49f[_0x3f53('0x1e')]?_0x51e49f['options'][_0x3f53('0x21')]||null:null,'include':_0x51e49f[_0x3f53('0x1e')]?_0x51e49f[_0x3f53('0x1e')][_0x3f53('0x23')]?_[_0x3f53('0x24')](_0x51e49f[_0x3f53('0x1e')][_0x3f53('0x23')],function(_0x570ce2){return{'model':db[_0x570ce2[_0x3f53('0x25')]],'as':_0x570ce2['as'],'attributes':_0x570ce2['attributes'],'include':_0x570ce2[_0x3f53('0x23')]?_['map'](_0x570ce2[_0x3f53('0x23')],function(_0x4fe7bd){return{'model':db[_0x4fe7bd['model']],'as':_0x4fe7bd['as'],'attributes':_0x4fe7bd[_0x3f53('0x21')],'include':_0x4fe7bd[_0x3f53('0x23')]?_['map'](_0x4fe7bd[_0x3f53('0x23')],function(_0x24f671){return{'model':db[_0x24f671[_0x3f53('0x25')]],'as':_0x24f671['as'],'attributes':_0x24f671['attributes']};}):[]};}):[]};}):[]:[]})[_0x3f53('0x10')](function(_0x2121e5){logger[_0x3f53('0x11')](_0x3f53('0x27'),_0x51e49f);logger[_0x3f53('0x13')](_0x3f53('0x27'),_0x51e49f,JSON['stringify'](_0x2121e5));_0x11d396(_0x2121e5);})[_0x3f53('0x1a')](function(_0x5502cb){logger[_0x3f53('0x15')](_0x3f53('0x27'),_0x5502cb['message'],_0x51e49f);_0x18a31d(_0x12f549['error'](0x1f4,_0x5502cb['message']));});});}; \ No newline at end of file +var _0x3c27=['result','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetSmsQueue','stringify','catch','find','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x12d603,_0x170b32){var _0x24c8fe=function(_0x5483d8){while(--_0x5483d8){_0x12d603['push'](_0x12d603['shift']());}};_0x24c8fe(++_0x170b32);}(_0x3c27,0x1f0));var _0x73c2=function(_0x20a618,_0x3d1a7b){_0x20a618=_0x20a618-0x0;var _0x3be658=_0x3c27[_0x20a618];return _0x3be658;};'use strict';var _=require(_0x73c2('0x0'));var util=require(_0x73c2('0x1'));var moment=require(_0x73c2('0x2'));var BPromise=require(_0x73c2('0x3'));var rs=require(_0x73c2('0x4'));var fs=require('fs');var Redis=require(_0x73c2('0x5'));var db=require(_0x73c2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x73c2('0x7'))(_0x73c2('0x8'));var config=require(_0x73c2('0x9'));var jayson=require(_0x73c2('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x73c2('0xb')](config[_0x73c2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x73c2('0xd'))(new Redis(config[_0x73c2('0xc')]));require(_0x73c2('0xe'))['register'](socket);function respondWithRpcPromise(_0x1d17dd,_0x17962c,_0x457ecb){return new BPromise(function(_0x1ffe6d,_0x46b9ba){return client[_0x73c2('0xf')](_0x1d17dd,_0x457ecb)[_0x73c2('0x10')](function(_0x225caa){logger[_0x73c2('0x11')](_0x73c2('0x12'),_0x17962c,_0x73c2('0x13'));logger[_0x73c2('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x17962c,_0x73c2('0x13'),JSON['stringify'](_0x225caa));if(_0x225caa[_0x73c2('0x15')]){if(_0x225caa['error'][_0x73c2('0x16')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x17962c,_0x225caa['error'][_0x73c2('0x17')]);return _0x46b9ba(_0x225caa[_0x73c2('0x15')][_0x73c2('0x17')]);}logger[_0x73c2('0x15')](_0x73c2('0x12'),_0x17962c,_0x225caa['error'][_0x73c2('0x17')]);return _0x1ffe6d(_0x225caa[_0x73c2('0x15')][_0x73c2('0x17')]);}else{logger['info'](_0x73c2('0x12'),_0x17962c,_0x73c2('0x13'));_0x1ffe6d(_0x225caa[_0x73c2('0x18')][_0x73c2('0x17')]);}})['catch'](function(_0x5746c3){logger['error'](_0x73c2('0x12'),_0x17962c,_0x5746c3);_0x46b9ba(_0x5746c3);});});}exports['GetSmsQueue']=function(_0x792564){var _0x4f20f9=this;return new Promise(function(_0x4752b6,_0xcc0f1c){return db[_0x73c2('0x19')][_0x73c2('0x1a')]({'raw':_0x792564[_0x73c2('0x1b')]?_0x792564[_0x73c2('0x1b')][_0x73c2('0x1c')]===undefined?!![]:![]:!![],'where':_0x792564[_0x73c2('0x1b')]?_0x792564[_0x73c2('0x1b')][_0x73c2('0x1d')]||null:null,'attributes':_0x792564[_0x73c2('0x1b')]?_0x792564['options'][_0x73c2('0x1e')]||null:null,'limit':_0x792564['options']?_0x792564['options'][_0x73c2('0x1f')]||null:null,'include':_0x792564['options']?_0x792564[_0x73c2('0x1b')][_0x73c2('0x20')]?_[_0x73c2('0x21')](_0x792564[_0x73c2('0x1b')][_0x73c2('0x20')],function(_0xf6c188){return{'model':db[_0xf6c188[_0x73c2('0x22')]],'as':_0xf6c188['as'],'attributes':_0xf6c188['attributes'],'include':_0xf6c188[_0x73c2('0x20')]?_[_0x73c2('0x21')](_0xf6c188['include'],function(_0xe89fd0){return{'model':db[_0xe89fd0['model']],'as':_0xe89fd0['as'],'attributes':_0xe89fd0['attributes'],'include':_0xe89fd0[_0x73c2('0x20')]?_[_0x73c2('0x21')](_0xe89fd0[_0x73c2('0x20')],function(_0x6dc4af){return{'model':db[_0x6dc4af['model']],'as':_0x6dc4af['as'],'attributes':_0x6dc4af['attributes']};}):[]};}):[]};}):[]:[]})[_0x73c2('0x10')](function(_0x3ac9dd){logger['info'](_0x73c2('0x23'),_0x792564);logger[_0x73c2('0x14')](_0x73c2('0x23'),_0x792564,JSON[_0x73c2('0x24')](_0x3ac9dd));_0x4752b6(_0x3ac9dd);})[_0x73c2('0x25')](function(_0x2080f0){logger['error'](_0x73c2('0x23'),_0x2080f0[_0x73c2('0x17')],_0x792564);_0xcc0f1c(_0x4f20f9[_0x73c2('0x15')](0x1f4,_0x2080f0['message']));});});};exports['ShowSmsQueue']=function(_0x526ddc){var _0x5a86c9=this;return new Promise(function(_0x24a6c9,_0x55f2ba){return db[_0x73c2('0x19')][_0x73c2('0x26')]({'raw':_0x526ddc[_0x73c2('0x1b')]?_0x526ddc[_0x73c2('0x1b')][_0x73c2('0x1c')]===undefined?!![]:![]:!![],'where':_0x526ddc[_0x73c2('0x1b')]?_0x526ddc['options'][_0x73c2('0x1d')]||null:null,'attributes':_0x526ddc[_0x73c2('0x1b')]?_0x526ddc['options'][_0x73c2('0x1e')]||null:null,'include':_0x526ddc['options']?_0x526ddc[_0x73c2('0x1b')][_0x73c2('0x20')]?_['map'](_0x526ddc[_0x73c2('0x1b')][_0x73c2('0x20')],function(_0x135907){return{'model':db[_0x135907[_0x73c2('0x22')]],'as':_0x135907['as'],'attributes':_0x135907[_0x73c2('0x1e')],'include':_0x135907[_0x73c2('0x20')]?_[_0x73c2('0x21')](_0x135907['include'],function(_0x585461){return{'model':db[_0x585461[_0x73c2('0x22')]],'as':_0x585461['as'],'attributes':_0x585461[_0x73c2('0x1e')],'include':_0x585461[_0x73c2('0x20')]?_[_0x73c2('0x21')](_0x585461[_0x73c2('0x20')],function(_0x1bf781){return{'model':db[_0x1bf781[_0x73c2('0x22')]],'as':_0x1bf781['as'],'attributes':_0x1bf781[_0x73c2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x73c2('0x10')](function(_0xd5a150){logger[_0x73c2('0x11')](_0x73c2('0x27'),_0x526ddc);logger[_0x73c2('0x14')](_0x73c2('0x27'),_0x526ddc,JSON[_0x73c2('0x24')](_0xd5a150));_0x24a6c9(_0xd5a150);})[_0x73c2('0x25')](function(_0x4b937d){logger['error'](_0x73c2('0x27'),_0x4b937d[_0x73c2('0x17')],_0x526ddc);_0x55f2ba(_0x5a86c9['error'](0x1f4,_0x4b937d['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index e3fa43f..25be802 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 _0x1b33=['smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener','length'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1b33,0x89));var _0x31b3=function(_0x30eb5b,_0x234476){_0x30eb5b=_0x30eb5b-0x0;var _0x559d73=_0x1b33[_0x30eb5b];return _0x559d73;};'use strict';var SmsQueueEvents=require(_0x31b3('0x0'));var events=[_0x31b3('0x1'),_0x31b3('0x2'),_0x31b3('0x3')];function createListener(_0x41d85b,_0x2a19b8){return function(_0x5cb1dd){_0x2a19b8[_0x31b3('0x4')](_0x41d85b,_0x5cb1dd);};}function removeListener(_0x2de03c,_0x1fe4f0){return function(){SmsQueueEvents[_0x31b3('0x5')](_0x2de03c,_0x1fe4f0);};}exports['register']=function(_0x412483){for(var _0xdb7177=0x0,_0x2b037d=events[_0x31b3('0x6')];_0xdb7177<_0x2b037d;_0xdb7177++){var _0xd215c4=events[_0xdb7177];var _0x38b90c=createListener(_0x31b3('0x7')+_0xd215c4,_0x412483);SmsQueueEvents['on'](_0xd215c4,_0x38b90c);}}; \ No newline at end of file +var _0x3693=['remove','update','emit','removeListener','register','length','smsQueue:'];(function(_0x57da13,_0x319c63){var _0x4e3f98=function(_0x5a765f){while(--_0x5a765f){_0x57da13['push'](_0x57da13['shift']());}};_0x4e3f98(++_0x319c63);}(_0x3693,0x118));var _0x3369=function(_0x4ffbc5,_0xbb496b){_0x4ffbc5=_0x4ffbc5-0x0;var _0x1ce5dc=_0x3693[_0x4ffbc5];return _0x1ce5dc;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0x3369('0x0'),_0x3369('0x1')];function createListener(_0x4d819d,_0x37a9b1){return function(_0x21e6c6){_0x37a9b1[_0x3369('0x2')](_0x4d819d,_0x21e6c6);};}function removeListener(_0x512db4,_0x4e0d76){return function(){SmsQueueEvents[_0x3369('0x3')](_0x512db4,_0x4e0d76);};}exports[_0x3369('0x4')]=function(_0x300e9e){for(var _0x46f851=0x0,_0x19db37=events[_0x3369('0x5')];_0x46f851<_0x19db37;_0x46f851++){var _0x5c801c=events[_0x46f851];var _0x498ce9=createListener(_0x3369('0x6')+_0x5c801c,_0x300e9e);SmsQueueEvents['on'](_0x5c801c,_0x498ce9);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index f18e436..1b70172 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 _0x7680=['put','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','create'];(function(_0x93be41,_0x46c7f2){var _0x5cf92a=function(_0x38096a){while(--_0x38096a){_0x93be41['push'](_0x93be41['shift']());}};_0x5cf92a(++_0x46c7f2);}(_0x7680,0x178));var _0x0768=function(_0xd7a900,_0x9e1e7e){_0xd7a900=_0xd7a900-0x0;var _0x585433=_0x7680[_0xd7a900];return _0x585433;};'use strict';var multer=require('multer');var util=require(_0x0768('0x0'));var path=require(_0x0768('0x1'));var timeout=require('connect-timeout');var express=require(_0x0768('0x2'));var router=express[_0x0768('0x3')]();var fs_extra=require(_0x0768('0x4'));var auth=require(_0x0768('0x5'));var interaction=require(_0x0768('0x6'));var config=require(_0x0768('0x7'));var controller=require('./smsQueueReport.controller');router[_0x0768('0x8')]('/',auth[_0x0768('0x9')](),controller['index']);router['get'](_0x0768('0xa'),auth['isAuthenticated'](),controller[_0x0768('0xb')]);router[_0x0768('0x8')](_0x0768('0xc'),auth[_0x0768('0x9')](),controller['show']);router[_0x0768('0xd')]('/',auth[_0x0768('0x9')](),controller[_0x0768('0xe')]);router[_0x0768('0xf')](_0x0768('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0768('0xc'),auth[_0x0768('0x9')](),controller[_0x0768('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6dd1=['/:id','show','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index'];(function(_0x5774be,_0x2259d3){var _0x4914b4=function(_0x1eebc3){while(--_0x1eebc3){_0x5774be['push'](_0x5774be['shift']());}};_0x4914b4(++_0x2259d3);}(_0x6dd1,0x111));var _0x16dd=function(_0x1d816f,_0xe3dfe){_0x1d816f=_0x1d816f-0x0;var _0x8fd161=_0x6dd1[_0x1d816f];return _0x8fd161;};'use strict';var multer=require(_0x16dd('0x0'));var util=require('util');var path=require(_0x16dd('0x1'));var timeout=require(_0x16dd('0x2'));var express=require('express');var router=express[_0x16dd('0x3')]();var fs_extra=require(_0x16dd('0x4'));var auth=require(_0x16dd('0x5'));var interaction=require(_0x16dd('0x6'));var config=require(_0x16dd('0x7'));var controller=require(_0x16dd('0x8'));router[_0x16dd('0x9')]('/',auth[_0x16dd('0xa')](),controller[_0x16dd('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x16dd('0x9')](_0x16dd('0xc'),auth[_0x16dd('0xa')](),controller[_0x16dd('0xd')]);router['post']('/',auth[_0x16dd('0xa')](),controller['create']);router[_0x16dd('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x16dd('0xf')]);router[_0x16dd('0x10')]('/:id',auth[_0x16dd('0xa')](),controller[_0x16dd('0x11')]);module[_0x16dd('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index f2fabb1..e7b52f4 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 _0x6152=['sequelize','exports','DATE','STRING','moment'];(function(_0x3b39b1,_0x93813){var _0x44ce52=function(_0x4a2f60){while(--_0x4a2f60){_0x3b39b1['push'](_0x3b39b1['shift']());}};_0x44ce52(++_0x93813);}(_0x6152,0x95));var _0x2615=function(_0x197f28,_0x590307){_0x197f28=_0x197f28-0x0;var _0x271b00=_0x6152[_0x197f28];return _0x271b00;};'use strict';var moment=require(_0x2615('0x0'));var Sequelize=require(_0x2615('0x1'));module[_0x2615('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2615('0x3')]},'leaveAt':{'type':Sequelize[_0x2615('0x3')]},'acceptAt':{'type':Sequelize[_0x2615('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x2615('0x4')]}}; \ No newline at end of file +var _0xb3ad=['sequelize','exports','DATE','STRING'];(function(_0x386247,_0x5dcfa9){var _0x3abf65=function(_0x29d423){while(--_0x29d423){_0x386247['push'](_0x386247['shift']());}};_0x3abf65(++_0x5dcfa9);}(_0xb3ad,0x110));var _0xdb3a=function(_0x30fc33,_0x172aad){_0x30fc33=_0x30fc33-0x0;var _0x265bbf=_0xb3ad[_0x30fc33];return _0x265bbf;};'use strict';var moment=require('moment');var Sequelize=require(_0xdb3a('0x0'));module[_0xdb3a('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xdb3a('0x2')]},'leaveAt':{'type':Sequelize[_0xdb3a('0x2')]},'acceptAt':{'type':Sequelize[_0xdb3a('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xdb3a('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 4fa5c02..ddc47b1 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 _0xcfd5=['SmsQueueReport','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','index'];(function(_0x21b706,_0x1022f4){var _0x13b94a=function(_0x3116da){while(--_0x3116da){_0x21b706['push'](_0x21b706['shift']());}};_0x13b94a(++_0x1022f4);}(_0xcfd5,0x100));var _0x5cfd=function(_0x3bb279,_0x1fe179){_0x3bb279=_0x3bb279-0x0;var _0x33ff19=_0xcfd5[_0x3bb279];return _0x33ff19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5cfd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5cfd('0x1'));var rp=require(_0x5cfd('0x2'));var moment=require('moment');var BPromise=require(_0x5cfd('0x3'));var Mustache=require(_0x5cfd('0x4'));var util=require(_0x5cfd('0x5'));var path=require(_0x5cfd('0x6'));var sox=require(_0x5cfd('0x7'));var csv=require(_0x5cfd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cfd('0x9'));var _=require(_0x5cfd('0xa'));var squel=require(_0x5cfd('0xb'));var crypto=require(_0x5cfd('0xc'));var jsforce=require(_0x5cfd('0xd'));var deskjs=require(_0x5cfd('0xe'));var toCsv=require(_0x5cfd('0x8'));var querystring=require(_0x5cfd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5cfd('0x10'));var qs=require(_0x5cfd('0x11'));var as=require(_0x5cfd('0x12'));var hardwareService=require(_0x5cfd('0x13'));var logger=require(_0x5cfd('0x14'))(_0x5cfd('0x15'));var utils=require('../../config/utils');var config=require(_0x5cfd('0x16'));var licenseUtil=require(_0x5cfd('0x17'));var db=require(_0x5cfd('0x18'))['db'];function respondWithStatusCode(_0x187d55,_0x409fff){_0x409fff=_0x409fff||0xcc;return function(_0x84b068){if(_0x84b068){return _0x187d55[_0x5cfd('0x19')](_0x409fff);}return _0x187d55[_0x5cfd('0x1a')](_0x409fff)[_0x5cfd('0x1b')]();};}function respondWithResult(_0x4c19bd,_0x40e58f){_0x40e58f=_0x40e58f||0xc8;return function(_0x4865cb){if(_0x4865cb){return _0x4c19bd[_0x5cfd('0x1a')](_0x40e58f)['json'](_0x4865cb);}};}function respondWithFilteredResult(_0x3e997f,_0x224936){return function(_0x2ba9f5){if(_0x2ba9f5){var _0x4b1aaf=typeof _0x224936[_0x5cfd('0x1c')]===_0x5cfd('0x1d')&&typeof _0x224936[_0x5cfd('0x1e')]==='undefined';var _0xc50481=_0x2ba9f5[_0x5cfd('0x1f')];var _0x52df3f=_0x4b1aaf?0x0:_0x224936[_0x5cfd('0x1c')];var _0x4b5d8d=_0x4b1aaf?_0x2ba9f5[_0x5cfd('0x1f')]:_0x224936[_0x5cfd('0x1c')]+_0x224936[_0x5cfd('0x1e')];var _0x2caed9;if(_0x4b5d8d>=_0xc50481){_0x4b5d8d=_0xc50481;_0x2caed9=0xc8;}else{_0x2caed9=0xce;}_0x3e997f[_0x5cfd('0x1a')](_0x2caed9);return _0x3e997f[_0x5cfd('0x20')](_0x5cfd('0x21'),_0x52df3f+'-'+_0x4b5d8d+'/'+_0xc50481)[_0x5cfd('0x22')](_0x2ba9f5);}return null;};}function patchUpdates(_0x6cb869){return function(_0x19b293){try{jsonpatch[_0x5cfd('0x23')](_0x19b293,_0x6cb869,!![]);}catch(_0x4df8c5){return BPromise[_0x5cfd('0x24')](_0x4df8c5);}return _0x19b293[_0x5cfd('0x25')]();};}function saveUpdates(_0x23b33e,_0x53d51e){return function(_0x313456){if(_0x313456){return _0x313456[_0x5cfd('0x26')](_0x23b33e)[_0x5cfd('0x27')](function(_0x20f2e2){return _0x20f2e2;});}return null;};}function removeEntity(_0x509a82,_0x5c3781){return function(_0x5cc8b8){if(_0x5cc8b8){return _0x5cc8b8[_0x5cfd('0x28')]()['then'](function(){_0x509a82['status'](0xcc)[_0x5cfd('0x1b')]();});}};}function handleEntityNotFound(_0x2c917f,_0x4bf63b){return function(_0x4e0969){if(!_0x4e0969){_0x2c917f['sendStatus'](0x194);}return _0x4e0969;};}function handleError(_0x38d03c,_0x53f7e7){_0x53f7e7=_0x53f7e7||0x1f4;return function(_0x1b155a){logger['error'](_0x1b155a[_0x5cfd('0x29')]);if(_0x1b155a[_0x5cfd('0x2a')]){delete _0x1b155a['name'];}_0x38d03c[_0x5cfd('0x1a')](_0x53f7e7)['send'](_0x1b155a);};}exports[_0x5cfd('0x2b')]=function(_0x4025a0,_0x5d4989){var _0x5794cb={},_0x292b25={},_0x16bc91={'count':0x0,'rows':[]};var _0x571b49=_['map'](db[_0x5cfd('0x2c')]['rawAttributes'],function(_0x2051db){return{'name':_0x2051db['fieldName'],'type':_0x2051db[_0x5cfd('0x2d')][_0x5cfd('0x2e')]};});_0x292b25['model']=_[_0x5cfd('0x2f')](_0x571b49,_0x5cfd('0x2a'));_0x292b25[_0x5cfd('0x30')]=_[_0x5cfd('0x31')](_0x4025a0['query']);_0x292b25[_0x5cfd('0x32')]=_[_0x5cfd('0x33')](_0x292b25['model'],_0x292b25['query']);_0x5794cb[_0x5cfd('0x34')]=_[_0x5cfd('0x33')](_0x292b25[_0x5cfd('0x35')],qs['fields'](_0x4025a0[_0x5cfd('0x30')][_0x5cfd('0x36')]));_0x5794cb['attributes']=_0x5794cb[_0x5cfd('0x34')][_0x5cfd('0x37')]?_0x5794cb[_0x5cfd('0x34')]:_0x292b25['model'];if(!_0x4025a0[_0x5cfd('0x30')]['hasOwnProperty'](_0x5cfd('0x38'))){_0x5794cb[_0x5cfd('0x1e')]=qs[_0x5cfd('0x1e')](_0x4025a0[_0x5cfd('0x30')]['limit']);_0x5794cb[_0x5cfd('0x1c')]=qs[_0x5cfd('0x1c')](_0x4025a0['query'][_0x5cfd('0x1c')]);}_0x5794cb[_0x5cfd('0x39')]=qs[_0x5cfd('0x3a')](_0x4025a0[_0x5cfd('0x30')][_0x5cfd('0x3a')]);_0x5794cb['where']=qs[_0x5cfd('0x32')](_[_0x5cfd('0x3b')](_0x4025a0[_0x5cfd('0x30')],_0x292b25[_0x5cfd('0x32')]),_0x571b49);if(_0x4025a0[_0x5cfd('0x30')][_0x5cfd('0x3c')]){_0x5794cb['where']=_[_0x5cfd('0x3d')](_0x5794cb['where'],{'$or':_[_0x5cfd('0x2f')](_0x571b49,function(_0x2e97d3){if(_0x2e97d3[_0x5cfd('0x2d')]!==_0x5cfd('0x3e')){var _0x18791d={};_0x18791d[_0x2e97d3['name']]={'$like':'%'+_0x4025a0[_0x5cfd('0x30')]['filter']+'%'};return _0x18791d;}})});}_0x5794cb=_['merge']({},_0x5794cb,_0x4025a0[_0x5cfd('0x3f')]);var _0x30d6d8={'where':_0x5794cb['where']};return db['SmsQueueReport']['count'](_0x30d6d8)[_0x5cfd('0x27')](function(_0x28db87){_0x16bc91[_0x5cfd('0x1f')]=_0x28db87;if(_0x4025a0[_0x5cfd('0x30')][_0x5cfd('0x40')]){_0x5794cb['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0x5cfd('0x41')](_0x5794cb);})[_0x5cfd('0x27')](function(_0x5a54a0){_0x16bc91[_0x5cfd('0x42')]=_0x5a54a0;return _0x16bc91;})[_0x5cfd('0x27')](respondWithFilteredResult(_0x5d4989,_0x5794cb))[_0x5cfd('0x43')](handleError(_0x5d4989,null));};exports['show']=function(_0x547b58,_0x4b65f8){var _0x298d6c={'raw':!![],'where':{'id':_0x547b58[_0x5cfd('0x44')]['id']}},_0x155e80={};_0x155e80['model']=_['keys'](db[_0x5cfd('0x2c')][_0x5cfd('0x45')]);_0x155e80['query']=_['keys'](_0x547b58[_0x5cfd('0x30')]);_0x155e80['filters']=_[_0x5cfd('0x33')](_0x155e80[_0x5cfd('0x35')],_0x155e80[_0x5cfd('0x30')]);_0x298d6c[_0x5cfd('0x34')]=_[_0x5cfd('0x33')](_0x155e80[_0x5cfd('0x35')],qs[_0x5cfd('0x36')](_0x547b58[_0x5cfd('0x30')][_0x5cfd('0x36')]));_0x298d6c['attributes']=_0x298d6c[_0x5cfd('0x34')][_0x5cfd('0x37')]?_0x298d6c[_0x5cfd('0x34')]:_0x155e80[_0x5cfd('0x35')];if(_0x547b58[_0x5cfd('0x30')][_0x5cfd('0x40')]){_0x298d6c[_0x5cfd('0x46')]=[{'all':!![]}];}_0x298d6c=_['merge']({},_0x298d6c,_0x547b58['options']);return db[_0x5cfd('0x2c')][_0x5cfd('0x47')](_0x298d6c)[_0x5cfd('0x27')](handleEntityNotFound(_0x4b65f8,null))[_0x5cfd('0x27')](respondWithResult(_0x4b65f8,null))[_0x5cfd('0x43')](handleError(_0x4b65f8,null));};exports[_0x5cfd('0x48')]=function(_0x5ab551,_0x37d720){return db[_0x5cfd('0x2c')][_0x5cfd('0x48')](_0x5ab551[_0x5cfd('0x49')],{})[_0x5cfd('0x27')](respondWithResult(_0x37d720,0xc9))[_0x5cfd('0x43')](handleError(_0x37d720,null));};exports['update']=function(_0x4480c9,_0xd23297){if(_0x4480c9[_0x5cfd('0x49')]['id']){delete _0x4480c9['body']['id'];}return db['SmsQueueReport'][_0x5cfd('0x47')]({'where':{'id':_0x4480c9['params']['id']}})[_0x5cfd('0x27')](handleEntityNotFound(_0xd23297,null))[_0x5cfd('0x27')](saveUpdates(_0x4480c9[_0x5cfd('0x49')],null))[_0x5cfd('0x27')](respondWithResult(_0xd23297,null))[_0x5cfd('0x43')](handleError(_0xd23297,null));};exports['destroy']=function(_0x2148d2,_0x22005b){return db[_0x5cfd('0x2c')][_0x5cfd('0x47')]({'where':{'id':_0x2148d2['params']['id']}})[_0x5cfd('0x27')](handleEntityNotFound(_0x22005b,null))[_0x5cfd('0x27')](removeEntity(_0x22005b,null))[_0x5cfd('0x43')](handleError(_0x22005b,null));};exports[_0x5cfd('0x4a')]=function(_0x2bbd40,_0x316700){return db[_0x5cfd('0x2c')][_0x5cfd('0x4a')]()[_0x5cfd('0x27')](respondWithResult(_0x316700,null))[_0x5cfd('0x43')](handleError(_0x316700,null));}; \ No newline at end of file +var _0xe154=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x3bb557,_0x2d4e15){var _0x5eebcb=function(_0x309c44){while(--_0x309c44){_0x3bb557['push'](_0x3bb557['shift']());}};_0x5eebcb(++_0x2d4e15);}(_0xe154,0xd2));var _0x4e15=function(_0x211087,_0x354fdd){_0x211087=_0x211087-0x0;var _0x2a581f=_0xe154[_0x211087];return _0x2a581f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e15('0x0'));var zipdir=require(_0x4e15('0x1'));var jsonpatch=require(_0x4e15('0x2'));var rp=require(_0x4e15('0x3'));var moment=require(_0x4e15('0x4'));var BPromise=require(_0x4e15('0x5'));var Mustache=require(_0x4e15('0x6'));var util=require(_0x4e15('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4e15('0x8'));var ejs=require(_0x4e15('0x9'));var fs=require('fs');var fs_extra=require(_0x4e15('0xa'));var _=require(_0x4e15('0xb'));var squel=require(_0x4e15('0xc'));var crypto=require(_0x4e15('0xd'));var jsforce=require(_0x4e15('0xe'));var deskjs=require(_0x4e15('0xf'));var toCsv=require(_0x4e15('0x8'));var querystring=require(_0x4e15('0x10'));var Papa=require(_0x4e15('0x11'));var Redis=require(_0x4e15('0x12'));var authService=require(_0x4e15('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4e15('0x14'));var hardwareService=require(_0x4e15('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4e15('0x16'))['db'];function respondWithStatusCode(_0xae6529,_0x1bcea3){_0x1bcea3=_0x1bcea3||0xcc;return function(_0x32dca5){if(_0x32dca5){return _0xae6529['sendStatus'](_0x1bcea3);}return _0xae6529['status'](_0x1bcea3)[_0x4e15('0x17')]();};}function respondWithResult(_0x48030f,_0x4fc3ce){_0x4fc3ce=_0x4fc3ce||0xc8;return function(_0xbe1d33){if(_0xbe1d33){return _0x48030f[_0x4e15('0x18')](_0x4fc3ce)[_0x4e15('0x19')](_0xbe1d33);}};}function respondWithFilteredResult(_0x4210e2,_0x56e4c7){return function(_0xccc202){if(_0xccc202){var _0x16d931=typeof _0x56e4c7[_0x4e15('0x1a')]==='undefined'&&typeof _0x56e4c7[_0x4e15('0x1b')]===_0x4e15('0x1c');var _0x4a07b8=_0xccc202[_0x4e15('0x1d')];var _0x35fb78=_0x16d931?0x0:_0x56e4c7['offset'];var _0x8aab9d=_0x16d931?_0xccc202[_0x4e15('0x1d')]:_0x56e4c7[_0x4e15('0x1a')]+_0x56e4c7[_0x4e15('0x1b')];var _0xcdf263;if(_0x8aab9d>=_0x4a07b8){_0x8aab9d=_0x4a07b8;_0xcdf263=0xc8;}else{_0xcdf263=0xce;}_0x4210e2[_0x4e15('0x18')](_0xcdf263);return _0x4210e2[_0x4e15('0x1e')](_0x4e15('0x1f'),_0x35fb78+'-'+_0x8aab9d+'/'+_0x4a07b8)[_0x4e15('0x19')](_0xccc202);}return null;};}function patchUpdates(_0xbaedbe){return function(_0x2aa56a){try{jsonpatch[_0x4e15('0x20')](_0x2aa56a,_0xbaedbe,!![]);}catch(_0x41c52f){return BPromise[_0x4e15('0x21')](_0x41c52f);}return _0x2aa56a[_0x4e15('0x22')]();};}function saveUpdates(_0x4f04de,_0x41fd1c){return function(_0x29c07b){if(_0x29c07b){return _0x29c07b[_0x4e15('0x23')](_0x4f04de)[_0x4e15('0x24')](function(_0x114003){return _0x114003;});}return null;};}function removeEntity(_0x49797d,_0x304768){return function(_0x177988){if(_0x177988){return _0x177988[_0x4e15('0x25')]()[_0x4e15('0x24')](function(){_0x49797d['status'](0xcc)[_0x4e15('0x17')]();});}};}function handleEntityNotFound(_0x2b2a23,_0x226a72){return function(_0x121ecd){if(!_0x121ecd){_0x2b2a23[_0x4e15('0x26')](0x194);}return _0x121ecd;};}function handleError(_0x26cdce,_0x5eacd7){_0x5eacd7=_0x5eacd7||0x1f4;return function(_0xb841b5){logger['error'](_0xb841b5[_0x4e15('0x27')]);if(_0xb841b5['name']){delete _0xb841b5[_0x4e15('0x28')];}_0x26cdce[_0x4e15('0x18')](_0x5eacd7)[_0x4e15('0x29')](_0xb841b5);};}exports[_0x4e15('0x2a')]=function(_0x20d58e,_0x1dd576){var _0x93144a={},_0x2aeed0={},_0x40b471={'count':0x0,'rows':[]};var _0x116cf1=_[_0x4e15('0x2b')](db[_0x4e15('0x2c')][_0x4e15('0x2d')],function(_0x2f43cf){return{'name':_0x2f43cf[_0x4e15('0x2e')],'type':_0x2f43cf[_0x4e15('0x2f')][_0x4e15('0x30')]};});_0x2aeed0[_0x4e15('0x31')]=_['map'](_0x116cf1,'name');_0x2aeed0['query']=_[_0x4e15('0x32')](_0x20d58e[_0x4e15('0x33')]);_0x2aeed0[_0x4e15('0x34')]=_[_0x4e15('0x35')](_0x2aeed0[_0x4e15('0x31')],_0x2aeed0[_0x4e15('0x33')]);_0x93144a[_0x4e15('0x36')]=_[_0x4e15('0x35')](_0x2aeed0[_0x4e15('0x31')],qs[_0x4e15('0x37')](_0x20d58e[_0x4e15('0x33')][_0x4e15('0x37')]));_0x93144a[_0x4e15('0x36')]=_0x93144a[_0x4e15('0x36')][_0x4e15('0x38')]?_0x93144a[_0x4e15('0x36')]:_0x2aeed0[_0x4e15('0x31')];if(!_0x20d58e[_0x4e15('0x33')][_0x4e15('0x39')]('nolimit')){_0x93144a[_0x4e15('0x1b')]=qs[_0x4e15('0x1b')](_0x20d58e[_0x4e15('0x33')]['limit']);_0x93144a[_0x4e15('0x1a')]=qs['offset'](_0x20d58e[_0x4e15('0x33')][_0x4e15('0x1a')]);}_0x93144a['order']=qs[_0x4e15('0x3a')](_0x20d58e[_0x4e15('0x33')]['sort']);_0x93144a[_0x4e15('0x3b')]=qs[_0x4e15('0x34')](_[_0x4e15('0x3c')](_0x20d58e['query'],_0x2aeed0['filters']),_0x116cf1);if(_0x20d58e[_0x4e15('0x33')][_0x4e15('0x3d')]){_0x93144a[_0x4e15('0x3b')]=_[_0x4e15('0x3e')](_0x93144a[_0x4e15('0x3b')],{'$or':_['map'](_0x116cf1,function(_0x56edd6){if(_0x56edd6[_0x4e15('0x2f')]!==_0x4e15('0x3f')){var _0x31e1a6={};_0x31e1a6[_0x56edd6['name']]={'$like':'%'+_0x20d58e[_0x4e15('0x33')][_0x4e15('0x3d')]+'%'};return _0x31e1a6;}})});}_0x93144a=_[_0x4e15('0x3e')]({},_0x93144a,_0x20d58e[_0x4e15('0x40')]);var _0x435edf={'where':_0x93144a[_0x4e15('0x3b')]};return db[_0x4e15('0x2c')][_0x4e15('0x1d')](_0x435edf)[_0x4e15('0x24')](function(_0x19657e){_0x40b471[_0x4e15('0x1d')]=_0x19657e;if(_0x20d58e[_0x4e15('0x33')][_0x4e15('0x41')]){_0x93144a[_0x4e15('0x42')]=[{'all':!![]}];}return db[_0x4e15('0x2c')][_0x4e15('0x43')](_0x93144a);})[_0x4e15('0x24')](function(_0x4b831d){_0x40b471[_0x4e15('0x44')]=_0x4b831d;return _0x40b471;})['then'](respondWithFilteredResult(_0x1dd576,_0x93144a))['catch'](handleError(_0x1dd576,null));};exports['show']=function(_0xe17a21,_0x1d31d6){var _0x2e24f9={'raw':!![],'where':{'id':_0xe17a21[_0x4e15('0x45')]['id']}},_0x493834={};_0x493834['model']=_[_0x4e15('0x32')](db[_0x4e15('0x2c')][_0x4e15('0x2d')]);_0x493834[_0x4e15('0x33')]=_[_0x4e15('0x32')](_0xe17a21[_0x4e15('0x33')]);_0x493834['filters']=_[_0x4e15('0x35')](_0x493834[_0x4e15('0x31')],_0x493834[_0x4e15('0x33')]);_0x2e24f9[_0x4e15('0x36')]=_['intersection'](_0x493834[_0x4e15('0x31')],qs[_0x4e15('0x37')](_0xe17a21[_0x4e15('0x33')][_0x4e15('0x37')]));_0x2e24f9[_0x4e15('0x36')]=_0x2e24f9[_0x4e15('0x36')]['length']?_0x2e24f9['attributes']:_0x493834[_0x4e15('0x31')];if(_0xe17a21[_0x4e15('0x33')][_0x4e15('0x41')]){_0x2e24f9[_0x4e15('0x42')]=[{'all':!![]}];}_0x2e24f9=_[_0x4e15('0x3e')]({},_0x2e24f9,_0xe17a21['options']);return db[_0x4e15('0x2c')][_0x4e15('0x46')](_0x2e24f9)['then'](handleEntityNotFound(_0x1d31d6,null))[_0x4e15('0x24')](respondWithResult(_0x1d31d6,null))[_0x4e15('0x47')](handleError(_0x1d31d6,null));};exports[_0x4e15('0x48')]=function(_0x4d72a3,_0x4f169a){return db[_0x4e15('0x2c')]['create'](_0x4d72a3[_0x4e15('0x49')],{})[_0x4e15('0x24')](respondWithResult(_0x4f169a,0xc9))['catch'](handleError(_0x4f169a,null));};exports[_0x4e15('0x23')]=function(_0x19dd0f,_0x2bcc38){if(_0x19dd0f[_0x4e15('0x49')]['id']){delete _0x19dd0f[_0x4e15('0x49')]['id'];}return db[_0x4e15('0x2c')][_0x4e15('0x46')]({'where':{'id':_0x19dd0f[_0x4e15('0x45')]['id']}})[_0x4e15('0x24')](handleEntityNotFound(_0x2bcc38,null))['then'](saveUpdates(_0x19dd0f[_0x4e15('0x49')],null))[_0x4e15('0x24')](respondWithResult(_0x2bcc38,null))[_0x4e15('0x47')](handleError(_0x2bcc38,null));};exports[_0x4e15('0x25')]=function(_0x1f67f4,_0x24c654){return db[_0x4e15('0x2c')]['find']({'where':{'id':_0x1f67f4[_0x4e15('0x45')]['id']}})[_0x4e15('0x24')](handleEntityNotFound(_0x24c654,null))[_0x4e15('0x24')](removeEntity(_0x24c654,null))[_0x4e15('0x47')](handleError(_0x24c654,null));};exports[_0x4e15('0x4a')]=function(_0x1a77d8,_0x1a64a7){return db[_0x4e15('0x2c')][_0x4e15('0x4a')]()[_0x4e15('0x24')](respondWithResult(_0x1a64a7,null))[_0x4e15('0x47')](handleError(_0x1a64a7,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 9bede4c..9195ff0 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x2ee9c4,_0x4d50f8){var _0x47054e=function(_0x1630fa){while(--_0x1630fa){_0x2ee9c4['push'](_0x2ee9c4['shift']());}};_0x47054e(++_0x4d50f8);}(_0xb7e7,0x121));var _0x7b7e=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xb7e7[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x5222e3,_0x5c318b){var _0x5f32d6=function(_0x145398){while(--_0x145398){_0x5222e3['push'](_0x5222e3['shift']());}};_0x5f32d6(++_0x5c318b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xb7e7[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 2e6e209..0649e15 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 _0xf1c8=['SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','attributes','UpdateSmsQueueReport','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x232e6f,_0x8c8298){var _0x15b18b=function(_0x5652bd){while(--_0x5652bd){_0x232e6f['push'](_0x232e6f['shift']());}};_0x15b18b(++_0x8c8298);}(_0xf1c8,0x183));var _0x8f1c=function(_0xefe481,_0x3c9ddf){_0xefe481=_0xefe481-0x0;var _0x4781bc=_0xf1c8[_0xefe481];return _0x4781bc;};'use strict';var _=require(_0x8f1c('0x0'));var util=require('util');var moment=require(_0x8f1c('0x1'));var BPromise=require(_0x8f1c('0x2'));var rs=require(_0x8f1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f1c('0x4'))['db'];var utils=require(_0x8f1c('0x5'));var logger=require(_0x8f1c('0x6'))('rpc');var config=require(_0x8f1c('0x7'));var jayson=require(_0x8f1c('0x8'));var client=jayson['client'][_0x8f1c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d1c6a,_0x3bb0c6,_0xfd9e59){return new BPromise(function(_0x2c3e98,_0x2c4de0){return client[_0x8f1c('0xa')](_0x2d1c6a,_0xfd9e59)[_0x8f1c('0xb')](function(_0x2c9526){logger[_0x8f1c('0xc')](_0x8f1c('0xd'),_0x3bb0c6,_0x8f1c('0xe'));logger[_0x8f1c('0xf')](_0x8f1c('0x10'),_0x3bb0c6,_0x8f1c('0xe'),JSON[_0x8f1c('0x11')](_0x2c9526));if(_0x2c9526[_0x8f1c('0x12')]){if(_0x2c9526['error'][_0x8f1c('0x13')]===0x1f4){logger[_0x8f1c('0x12')](_0x8f1c('0xd'),_0x3bb0c6,_0x2c9526[_0x8f1c('0x12')]['message']);return _0x2c4de0(_0x2c9526[_0x8f1c('0x12')][_0x8f1c('0x14')]);}logger[_0x8f1c('0x12')](_0x8f1c('0xd'),_0x3bb0c6,_0x2c9526[_0x8f1c('0x12')][_0x8f1c('0x14')]);return _0x2c3e98(_0x2c9526[_0x8f1c('0x12')]['message']);}else{logger[_0x8f1c('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x3bb0c6,'request\x20sent');_0x2c3e98(_0x2c9526[_0x8f1c('0x15')][_0x8f1c('0x14')]);}})[_0x8f1c('0x16')](function(_0x512020){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x3bb0c6,_0x512020);_0x2c4de0(_0x512020);});});}exports[_0x8f1c('0x17')]=function(_0x2a8cf0){var _0x3664b0=this;return new Promise(function(_0x2c04e1,_0x461ea2){return db[_0x8f1c('0x18')][_0x8f1c('0x19')](_0x2a8cf0[_0x8f1c('0x1a')],{'raw':_0x2a8cf0[_0x8f1c('0x1b')]?_0x2a8cf0['options'][_0x8f1c('0x1c')]===undefined?!![]:![]:!![]})[_0x8f1c('0xb')](function(_0x48f2a7){logger[_0x8f1c('0xc')](_0x8f1c('0x17'),_0x2a8cf0);logger[_0x8f1c('0xf')](_0x8f1c('0x17'),_0x2a8cf0,JSON[_0x8f1c('0x11')](_0x48f2a7));_0x2c04e1(_0x48f2a7);})['catch'](function(_0x312760){logger[_0x8f1c('0x12')]('CreateSmsQueueReport',_0x312760[_0x8f1c('0x14')],_0x2a8cf0);_0x461ea2(_0x3664b0[_0x8f1c('0x12')](0x1f4,_0x312760['message']));});});};exports['UpdateSmsQueueReport']=function(_0x2513f3){var _0x528786=this;return new Promise(function(_0x3793fb,_0x308b0c){return db[_0x8f1c('0x18')]['update'](_0x2513f3[_0x8f1c('0x1a')],{'raw':_0x2513f3[_0x8f1c('0x1b')]?_0x2513f3['options'][_0x8f1c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2513f3[_0x8f1c('0x1b')]?_0x2513f3[_0x8f1c('0x1b')]['where']||null:null,'attributes':_0x2513f3[_0x8f1c('0x1b')]?_0x2513f3[_0x8f1c('0x1b')][_0x8f1c('0x1d')]||null:null,'limit':_0x2513f3[_0x8f1c('0x1b')]?_0x2513f3[_0x8f1c('0x1b')]['limit']||null:null})[_0x8f1c('0xb')](function(_0x465d3e){logger['info']('UpdateSmsQueueReport',_0x2513f3);logger[_0x8f1c('0xf')](_0x8f1c('0x1e'),_0x2513f3,JSON[_0x8f1c('0x11')](_0x465d3e));_0x3793fb(_0x465d3e);})[_0x8f1c('0x16')](function(_0x314f33){logger[_0x8f1c('0x12')](_0x8f1c('0x1e'),_0x314f33[_0x8f1c('0x14')],_0x2513f3);_0x308b0c(_0x528786[_0x8f1c('0x12')](0x1f4,_0x314f33[_0x8f1c('0x14')]));});});}; \ No newline at end of file +var _0x0b39=['rpc','client','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','result','CreateSmsQueueReport','SmsQueueReport','body','options','raw','stringify','UpdateSmsQueueReport','update','where','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x51951b,_0x5d1a16){var _0x17dc1a=function(_0x5d6ea9){while(--_0x5d6ea9){_0x51951b['push'](_0x51951b['shift']());}};_0x17dc1a(++_0x5d1a16);}(_0x0b39,0xea));var _0x90b3=function(_0x353530,_0x392c7e){_0x353530=_0x353530-0x0;var _0x39b68c=_0x0b39[_0x353530];return _0x39b68c;};'use strict';var _=require(_0x90b3('0x0'));var util=require(_0x90b3('0x1'));var moment=require('moment');var BPromise=require(_0x90b3('0x2'));var rs=require(_0x90b3('0x3'));var fs=require('fs');var Redis=require(_0x90b3('0x4'));var db=require(_0x90b3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x90b3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x90b3('0x7')][_0x90b3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d0fc7,_0x539f84,_0x59c370){return new BPromise(function(_0x52f0ec,_0x1401af){return client[_0x90b3('0x9')](_0x5d0fc7,_0x59c370)[_0x90b3('0xa')](function(_0x439303){logger['info'](_0x90b3('0xb'),_0x539f84,_0x90b3('0xc'));logger[_0x90b3('0xd')](_0x90b3('0xe'),_0x539f84,'request\x20sent',JSON['stringify'](_0x439303));if(_0x439303[_0x90b3('0xf')]){if(_0x439303[_0x90b3('0xf')]['code']===0x1f4){logger[_0x90b3('0xf')](_0x90b3('0xb'),_0x539f84,_0x439303[_0x90b3('0xf')]['message']);return _0x1401af(_0x439303[_0x90b3('0xf')][_0x90b3('0x10')]);}logger['error'](_0x90b3('0xb'),_0x539f84,_0x439303[_0x90b3('0xf')]['message']);return _0x52f0ec(_0x439303[_0x90b3('0xf')]['message']);}else{logger[_0x90b3('0x11')](_0x90b3('0xb'),_0x539f84,'request\x20sent');_0x52f0ec(_0x439303[_0x90b3('0x12')][_0x90b3('0x10')]);}})['catch'](function(_0x35c4ab){logger[_0x90b3('0xf')](_0x90b3('0xb'),_0x539f84,_0x35c4ab);_0x1401af(_0x35c4ab);});});}exports[_0x90b3('0x13')]=function(_0x143f02){var _0x342685=this;return new Promise(function(_0x467c14,_0xad32){return db[_0x90b3('0x14')]['create'](_0x143f02[_0x90b3('0x15')],{'raw':_0x143f02[_0x90b3('0x16')]?_0x143f02[_0x90b3('0x16')][_0x90b3('0x17')]===undefined?!![]:![]:!![]})[_0x90b3('0xa')](function(_0x5d5b31){logger['info'](_0x90b3('0x13'),_0x143f02);logger[_0x90b3('0xd')](_0x90b3('0x13'),_0x143f02,JSON[_0x90b3('0x18')](_0x5d5b31));_0x467c14(_0x5d5b31);})['catch'](function(_0x304d74){logger['error'](_0x90b3('0x13'),_0x304d74['message'],_0x143f02);_0xad32(_0x342685['error'](0x1f4,_0x304d74[_0x90b3('0x10')]));});});};exports[_0x90b3('0x19')]=function(_0x2c6860){var _0x521e3d=this;return new Promise(function(_0x177a01,_0xd43365){return db[_0x90b3('0x14')][_0x90b3('0x1a')](_0x2c6860[_0x90b3('0x15')],{'raw':_0x2c6860[_0x90b3('0x16')]?_0x2c6860['options'][_0x90b3('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c6860[_0x90b3('0x16')]?_0x2c6860[_0x90b3('0x16')][_0x90b3('0x1b')]||null:null,'attributes':_0x2c6860['options']?_0x2c6860[_0x90b3('0x16')]['attributes']||null:null,'limit':_0x2c6860[_0x90b3('0x16')]?_0x2c6860[_0x90b3('0x16')][_0x90b3('0x1c')]||null:null})[_0x90b3('0xa')](function(_0x180648){logger[_0x90b3('0x11')](_0x90b3('0x19'),_0x2c6860);logger[_0x90b3('0xd')](_0x90b3('0x19'),_0x2c6860,JSON[_0x90b3('0x18')](_0x180648));_0x177a01(_0x180648);})[_0x90b3('0x1d')](function(_0x730080){logger[_0x90b3('0xf')]('UpdateSmsQueueReport',_0x730080[_0x90b3('0x10')],_0x2c6860);_0xd43365(_0x521e3d[_0x90b3('0xf')](0x1f4,_0x730080['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index b769dc8..b678be7 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 _0xc978=['/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x341bf0,_0x1726b4){var _0x229815=function(_0x1adf3e){while(--_0x1adf3e){_0x341bf0['push'](_0x341bf0['shift']());}};_0x229815(++_0x1726b4);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var path=require(_0x8c97('0x2'));var timeout=require(_0x8c97('0x3'));var express=require(_0x8c97('0x4'));var router=express[_0x8c97('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8c97('0x6'));var interaction=require(_0x8c97('0x7'));var config=require(_0x8c97('0x8'));var controller=require(_0x8c97('0x9'));router[_0x8c97('0xa')]('/',auth[_0x8c97('0xb')](),controller[_0x8c97('0xc')]);router['get'](_0x8c97('0xd'),auth[_0x8c97('0xb')](),controller[_0x8c97('0xe')]);router[_0x8c97('0xa')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller[_0x8c97('0x10')]);router['post']('/',auth[_0x8c97('0xb')](),controller[_0x8c97('0x11')]);router[_0x8c97('0x12')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller[_0x8c97('0x13')]);router[_0x8c97('0x14')](_0x8c97('0xf'),auth[_0x8c97('0xb')](),controller['destroy']);module[_0x8c97('0x15')]=router; \ No newline at end of file +var _0x7a59=['get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x7a59,0x16e));var _0x97a5=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x7a59[_0x1e4150];return _0x1ce3ee;};'use strict';var multer=require(_0x97a5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x97a5('0x1'));var express=require(_0x97a5('0x2'));var router=express[_0x97a5('0x3')]();var fs_extra=require(_0x97a5('0x4'));var auth=require(_0x97a5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x97a5('0x6'));var controller=require(_0x97a5('0x7'));router[_0x97a5('0x8')]('/',auth['isAuthenticated'](),controller[_0x97a5('0x9')]);router[_0x97a5('0x8')](_0x97a5('0xa'),auth[_0x97a5('0xb')](),controller[_0x97a5('0xc')]);router[_0x97a5('0x8')](_0x97a5('0xd'),auth['isAuthenticated'](),controller[_0x97a5('0xe')]);router[_0x97a5('0xf')]('/',auth[_0x97a5('0xb')](),controller[_0x97a5('0x10')]);router[_0x97a5('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x97a5('0x12')]);router[_0x97a5('0x13')](_0x97a5('0xd'),auth['isAuthenticated'](),controller[_0x97a5('0x14')]);module[_0x97a5('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index e33ae2b..8c74a7f 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x2cb756,_0x5148e6){var _0x2994ba=function(_0x11e674){while(--_0x11e674){_0x2cb756['push'](_0x2cb756['shift']());}};_0x2994ba(++_0x5148e6);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3aec4f,_0x21fd36){_0x3aec4f=_0x3aec4f-0x0;var _0x43650c=_0xf4eb[_0x3aec4f];return _0x43650c;};'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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x125fde,_0x452756){var _0x413ebe=function(_0x151157){while(--_0x151157){_0x125fde['push'](_0x125fde['shift']());}};_0x413ebe(++_0x452756);}(_0xedd9,0xfc));var _0x9edd=function(_0x3d542c,_0x2098ae){_0x3d542c=_0x3d542c-0x0;var _0x4946de=_0xedd9[_0x3d542c];return _0x4946de;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 65c6c6a..0d9cdd5 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 _0x65ff=['merge','where','SmsTransferReport','includeAll','include','findAll','catch','show','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','index','map','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter'];(function(_0x37f7be,_0x220f4e){var _0x20ad42=function(_0x5541ae){while(--_0x5541ae){_0x37f7be['push'](_0x37f7be['shift']());}};_0x20ad42(++_0x220f4e);}(_0x65ff,0x17a));var _0xf65f=function(_0x55d829,_0x43f06c){_0x55d829=_0x55d829-0x0;var _0x52163b=_0x65ff[_0x55d829];return _0x52163b;};'use strict';var emlformat=require(_0xf65f('0x0'));var rimraf=require(_0xf65f('0x1'));var zipdir=require(_0xf65f('0x2'));var jsonpatch=require(_0xf65f('0x3'));var rp=require(_0xf65f('0x4'));var moment=require(_0xf65f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf65f('0x6'));var path=require(_0xf65f('0x7'));var sox=require(_0xf65f('0x8'));var csv=require(_0xf65f('0x9'));var ejs=require(_0xf65f('0xa'));var fs=require('fs');var fs_extra=require(_0xf65f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf65f('0xc'));var jsforce=require(_0xf65f('0xd'));var deskjs=require(_0xf65f('0xe'));var toCsv=require(_0xf65f('0x9'));var querystring=require(_0xf65f('0xf'));var Papa=require(_0xf65f('0x10'));var Redis=require(_0xf65f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf65f('0x12'));var as=require(_0xf65f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf65f('0x14'))(_0xf65f('0x15'));var utils=require('../../config/utils');var config=require(_0xf65f('0x16'));var licenseUtil=require(_0xf65f('0x17'));var db=require(_0xf65f('0x18'))['db'];function respondWithStatusCode(_0x516ea8,_0x2be8df){_0x2be8df=_0x2be8df||0xcc;return function(_0x63ab98){if(_0x63ab98){return _0x516ea8[_0xf65f('0x19')](_0x2be8df);}return _0x516ea8[_0xf65f('0x1a')](_0x2be8df)[_0xf65f('0x1b')]();};}function respondWithResult(_0x5e7301,_0x280fdd){_0x280fdd=_0x280fdd||0xc8;return function(_0x1d631a){if(_0x1d631a){return _0x5e7301[_0xf65f('0x1a')](_0x280fdd)[_0xf65f('0x1c')](_0x1d631a);}};}function respondWithFilteredResult(_0x16f848,_0x30bf25){return function(_0x4b81b5){if(_0x4b81b5){var _0x5e6618=typeof _0x30bf25[_0xf65f('0x1d')]===_0xf65f('0x1e')&&typeof _0x30bf25[_0xf65f('0x1f')]===_0xf65f('0x1e');var _0x4552c8=_0x4b81b5[_0xf65f('0x20')];var _0x26ccd1=_0x5e6618?0x0:_0x30bf25[_0xf65f('0x1d')];var _0x260f19=_0x5e6618?_0x4b81b5[_0xf65f('0x20')]:_0x30bf25[_0xf65f('0x1d')]+_0x30bf25['limit'];var _0x3955b3;if(_0x260f19>=_0x4552c8){_0x260f19=_0x4552c8;_0x3955b3=0xc8;}else{_0x3955b3=0xce;}_0x16f848[_0xf65f('0x1a')](_0x3955b3);return _0x16f848['set'](_0xf65f('0x21'),_0x26ccd1+'-'+_0x260f19+'/'+_0x4552c8)['json'](_0x4b81b5);}return null;};}function patchUpdates(_0x3396cd){return function(_0x539b4e){try{jsonpatch[_0xf65f('0x22')](_0x539b4e,_0x3396cd,!![]);}catch(_0x3d6614){return BPromise['reject'](_0x3d6614);}return _0x539b4e[_0xf65f('0x23')]();};}function saveUpdates(_0x14bd25,_0x334d95){return function(_0x2edb5b){if(_0x2edb5b){return _0x2edb5b[_0xf65f('0x24')](_0x14bd25)['then'](function(_0x1d0264){return _0x1d0264;});}return null;};}function removeEntity(_0x331562,_0x57d953){return function(_0x8ea45d){if(_0x8ea45d){return _0x8ea45d[_0xf65f('0x25')]()[_0xf65f('0x26')](function(){_0x331562[_0xf65f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe7a986,_0x23a2c1){return function(_0x1cdf5a){if(!_0x1cdf5a){_0xe7a986[_0xf65f('0x19')](0x194);}return _0x1cdf5a;};}function handleError(_0xcf8c3c,_0x190721){_0x190721=_0x190721||0x1f4;return function(_0x2789ca){logger[_0xf65f('0x27')](_0x2789ca[_0xf65f('0x28')]);if(_0x2789ca[_0xf65f('0x29')]){delete _0x2789ca['name'];}_0xcf8c3c[_0xf65f('0x1a')](_0x190721)['send'](_0x2789ca);};}exports[_0xf65f('0x2a')]=function(_0x188795,_0xcb3005){var _0x544097={},_0x12c3d3={},_0x2e47e2={'count':0x0,'rows':[]};var _0xd5e866=_[_0xf65f('0x2b')](db['SmsTransferReport'][_0xf65f('0x2c')],function(_0x2935ce){return{'name':_0x2935ce['fieldName'],'type':_0x2935ce[_0xf65f('0x2d')][_0xf65f('0x2e')]};});_0x12c3d3['model']=_[_0xf65f('0x2b')](_0xd5e866,_0xf65f('0x29'));_0x12c3d3['query']=_[_0xf65f('0x2f')](_0x188795[_0xf65f('0x30')]);_0x12c3d3[_0xf65f('0x31')]=_[_0xf65f('0x32')](_0x12c3d3[_0xf65f('0x33')],_0x12c3d3[_0xf65f('0x30')]);_0x544097['attributes']=_[_0xf65f('0x32')](_0x12c3d3['model'],qs['fields'](_0x188795['query'][_0xf65f('0x34')]));_0x544097[_0xf65f('0x35')]=_0x544097[_0xf65f('0x35')][_0xf65f('0x36')]?_0x544097[_0xf65f('0x35')]:_0x12c3d3[_0xf65f('0x33')];if(!_0x188795[_0xf65f('0x30')][_0xf65f('0x37')]('nolimit')){_0x544097['limit']=qs[_0xf65f('0x1f')](_0x188795[_0xf65f('0x30')][_0xf65f('0x1f')]);_0x544097[_0xf65f('0x1d')]=qs['offset'](_0x188795[_0xf65f('0x30')][_0xf65f('0x1d')]);}_0x544097[_0xf65f('0x38')]=qs[_0xf65f('0x39')](_0x188795[_0xf65f('0x30')][_0xf65f('0x39')]);_0x544097['where']=qs[_0xf65f('0x31')](_[_0xf65f('0x3a')](_0x188795[_0xf65f('0x30')],_0x12c3d3[_0xf65f('0x31')]),_0xd5e866);if(_0x188795[_0xf65f('0x30')][_0xf65f('0x3b')]){_0x544097['where']=_[_0xf65f('0x3c')](_0x544097[_0xf65f('0x3d')],{'$or':_['map'](_0xd5e866,function(_0x43e0fd){if(_0x43e0fd[_0xf65f('0x2d')]!=='VIRTUAL'){var _0x33fd68={};_0x33fd68[_0x43e0fd['name']]={'$like':'%'+_0x188795['query'][_0xf65f('0x3b')]+'%'};return _0x33fd68;}})});}_0x544097=_[_0xf65f('0x3c')]({},_0x544097,_0x188795['options']);var _0xbe3ef0={'where':_0x544097['where']};return db[_0xf65f('0x3e')][_0xf65f('0x20')](_0xbe3ef0)[_0xf65f('0x26')](function(_0x262732){_0x2e47e2['count']=_0x262732;if(_0x188795[_0xf65f('0x30')][_0xf65f('0x3f')]){_0x544097[_0xf65f('0x40')]=[{'all':!![]}];}return db[_0xf65f('0x3e')][_0xf65f('0x41')](_0x544097);})['then'](function(_0x874ee1){_0x2e47e2['rows']=_0x874ee1;return _0x2e47e2;})[_0xf65f('0x26')](respondWithFilteredResult(_0xcb3005,_0x544097))[_0xf65f('0x42')](handleError(_0xcb3005,null));};exports[_0xf65f('0x43')]=function(_0x547a29,_0x46419c){var _0x3f86d6={'raw':!![],'where':{'id':_0x547a29['params']['id']}},_0x3176f6={};_0x3176f6[_0xf65f('0x33')]=_['keys'](db[_0xf65f('0x3e')][_0xf65f('0x2c')]);_0x3176f6[_0xf65f('0x30')]=_[_0xf65f('0x2f')](_0x547a29[_0xf65f('0x30')]);_0x3176f6[_0xf65f('0x31')]=_[_0xf65f('0x32')](_0x3176f6['model'],_0x3176f6['query']);_0x3f86d6[_0xf65f('0x35')]=_[_0xf65f('0x32')](_0x3176f6[_0xf65f('0x33')],qs[_0xf65f('0x34')](_0x547a29[_0xf65f('0x30')]['fields']));_0x3f86d6['attributes']=_0x3f86d6[_0xf65f('0x35')][_0xf65f('0x36')]?_0x3f86d6['attributes']:_0x3176f6[_0xf65f('0x33')];if(_0x547a29[_0xf65f('0x30')][_0xf65f('0x3f')]){_0x3f86d6[_0xf65f('0x40')]=[{'all':!![]}];}_0x3f86d6=_['merge']({},_0x3f86d6,_0x547a29[_0xf65f('0x44')]);return db[_0xf65f('0x3e')][_0xf65f('0x45')](_0x3f86d6)[_0xf65f('0x26')](handleEntityNotFound(_0x46419c,null))['then'](respondWithResult(_0x46419c,null))[_0xf65f('0x42')](handleError(_0x46419c,null));};exports['create']=function(_0x26bfa5,_0x51f4f4){return db[_0xf65f('0x3e')][_0xf65f('0x46')](_0x26bfa5[_0xf65f('0x47')],{})[_0xf65f('0x26')](respondWithResult(_0x51f4f4,0xc9))[_0xf65f('0x42')](handleError(_0x51f4f4,null));};exports['update']=function(_0x547ac5,_0x548f90){if(_0x547ac5['body']['id']){delete _0x547ac5['body']['id'];}return db[_0xf65f('0x3e')][_0xf65f('0x45')]({'where':{'id':_0x547ac5['params']['id']}})[_0xf65f('0x26')](handleEntityNotFound(_0x548f90,null))[_0xf65f('0x26')](saveUpdates(_0x547ac5[_0xf65f('0x47')],null))['then'](respondWithResult(_0x548f90,null))['catch'](handleError(_0x548f90,null));};exports[_0xf65f('0x25')]=function(_0x464731,_0x4c5406){return db[_0xf65f('0x3e')][_0xf65f('0x45')]({'where':{'id':_0x464731['params']['id']}})[_0xf65f('0x26')](handleEntityNotFound(_0x4c5406,null))[_0xf65f('0x26')](removeEntity(_0x4c5406,null))[_0xf65f('0x42')](handleError(_0x4c5406,null));};exports['describe']=function(_0x9fb2c2,_0x1961a6){return db[_0xf65f('0x3e')][_0xf65f('0x48')]()[_0xf65f('0x26')](respondWithResult(_0x1961a6,null))[_0xf65f('0x42')](handleError(_0x1961a6,null));}; \ No newline at end of file +var _0xeb52=['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/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','SmsTransferReport','include','findAll','catch','show','keys','find','create','body','params','describe','eml-format','rimraf'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xeb52,0x92));var _0x2eb5=function(_0xb75ab0,_0x486409){_0xb75ab0=_0xb75ab0-0x0;var _0x19be62=_0xeb52[_0xb75ab0];return _0x19be62;};'use strict';var emlformat=require(_0x2eb5('0x0'));var rimraf=require(_0x2eb5('0x1'));var zipdir=require(_0x2eb5('0x2'));var jsonpatch=require(_0x2eb5('0x3'));var rp=require(_0x2eb5('0x4'));var moment=require(_0x2eb5('0x5'));var BPromise=require(_0x2eb5('0x6'));var Mustache=require(_0x2eb5('0x7'));var util=require(_0x2eb5('0x8'));var path=require(_0x2eb5('0x9'));var sox=require(_0x2eb5('0xa'));var csv=require(_0x2eb5('0xb'));var ejs=require(_0x2eb5('0xc'));var fs=require('fs');var fs_extra=require(_0x2eb5('0xd'));var _=require('lodash');var squel=require(_0x2eb5('0xe'));var crypto=require(_0x2eb5('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2eb5('0x10'));var toCsv=require(_0x2eb5('0xb'));var querystring=require(_0x2eb5('0x11'));var Papa=require(_0x2eb5('0x12'));var Redis=require(_0x2eb5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2eb5('0x14'));var as=require(_0x2eb5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2eb5('0x16'))(_0x2eb5('0x17'));var utils=require('../../config/utils');var config=require(_0x2eb5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2eb5('0x19'))['db'];function respondWithStatusCode(_0x48b1d7,_0x3ddf0a){_0x3ddf0a=_0x3ddf0a||0xcc;return function(_0x2e9706){if(_0x2e9706){return _0x48b1d7[_0x2eb5('0x1a')](_0x3ddf0a);}return _0x48b1d7[_0x2eb5('0x1b')](_0x3ddf0a)[_0x2eb5('0x1c')]();};}function respondWithResult(_0x226d37,_0xa63fd6){_0xa63fd6=_0xa63fd6||0xc8;return function(_0x12aa81){if(_0x12aa81){return _0x226d37[_0x2eb5('0x1b')](_0xa63fd6)[_0x2eb5('0x1d')](_0x12aa81);}};}function respondWithFilteredResult(_0x4e1661,_0x5cd894){return function(_0x586d3c){if(_0x586d3c){var _0x47c0ee=typeof _0x5cd894['offset']===_0x2eb5('0x1e')&&typeof _0x5cd894[_0x2eb5('0x1f')]===_0x2eb5('0x1e');var _0x24c39c=_0x586d3c[_0x2eb5('0x20')];var _0x50c2cd=_0x47c0ee?0x0:_0x5cd894[_0x2eb5('0x21')];var _0x1ee561=_0x47c0ee?_0x586d3c[_0x2eb5('0x20')]:_0x5cd894[_0x2eb5('0x21')]+_0x5cd894[_0x2eb5('0x1f')];var _0x3e1239;if(_0x1ee561>=_0x24c39c){_0x1ee561=_0x24c39c;_0x3e1239=0xc8;}else{_0x3e1239=0xce;}_0x4e1661['status'](_0x3e1239);return _0x4e1661[_0x2eb5('0x22')](_0x2eb5('0x23'),_0x50c2cd+'-'+_0x1ee561+'/'+_0x24c39c)['json'](_0x586d3c);}return null;};}function patchUpdates(_0x2421e5){return function(_0x5ebb8e){try{jsonpatch[_0x2eb5('0x24')](_0x5ebb8e,_0x2421e5,!![]);}catch(_0x2ab597){return BPromise[_0x2eb5('0x25')](_0x2ab597);}return _0x5ebb8e[_0x2eb5('0x26')]();};}function saveUpdates(_0x1d6239,_0x505a8c){return function(_0x1cf676){if(_0x1cf676){return _0x1cf676[_0x2eb5('0x27')](_0x1d6239)[_0x2eb5('0x28')](function(_0x565702){return _0x565702;});}return null;};}function removeEntity(_0x51213b,_0x58eef0){return function(_0x3d2fe9){if(_0x3d2fe9){return _0x3d2fe9['destroy']()[_0x2eb5('0x28')](function(){_0x51213b['status'](0xcc)[_0x2eb5('0x1c')]();});}};}function handleEntityNotFound(_0x2ab91c,_0x2b0e64){return function(_0x36b0ed){if(!_0x36b0ed){_0x2ab91c[_0x2eb5('0x1a')](0x194);}return _0x36b0ed;};}function handleError(_0x2011f1,_0x43b5b1){_0x43b5b1=_0x43b5b1||0x1f4;return function(_0x18ef5c){logger['error'](_0x18ef5c['stack']);if(_0x18ef5c[_0x2eb5('0x29')]){delete _0x18ef5c[_0x2eb5('0x29')];}_0x2011f1[_0x2eb5('0x1b')](_0x43b5b1)[_0x2eb5('0x2a')](_0x18ef5c);};}exports['index']=function(_0x33950c,_0x2b7f76){var _0x20a767={},_0x16cc86={},_0x355037={'count':0x0,'rows':[]};var _0x42f1c8=_[_0x2eb5('0x2b')](db['SmsTransferReport'][_0x2eb5('0x2c')],function(_0x494ba8){return{'name':_0x494ba8[_0x2eb5('0x2d')],'type':_0x494ba8[_0x2eb5('0x2e')][_0x2eb5('0x2f')]};});_0x16cc86[_0x2eb5('0x30')]=_[_0x2eb5('0x2b')](_0x42f1c8,_0x2eb5('0x29'));_0x16cc86[_0x2eb5('0x31')]=_['keys'](_0x33950c[_0x2eb5('0x31')]);_0x16cc86[_0x2eb5('0x32')]=_[_0x2eb5('0x33')](_0x16cc86[_0x2eb5('0x30')],_0x16cc86['query']);_0x20a767[_0x2eb5('0x34')]=_[_0x2eb5('0x33')](_0x16cc86[_0x2eb5('0x30')],qs[_0x2eb5('0x35')](_0x33950c[_0x2eb5('0x31')][_0x2eb5('0x35')]));_0x20a767[_0x2eb5('0x34')]=_0x20a767[_0x2eb5('0x34')][_0x2eb5('0x36')]?_0x20a767['attributes']:_0x16cc86[_0x2eb5('0x30')];if(!_0x33950c['query'][_0x2eb5('0x37')](_0x2eb5('0x38'))){_0x20a767['limit']=qs[_0x2eb5('0x1f')](_0x33950c[_0x2eb5('0x31')]['limit']);_0x20a767[_0x2eb5('0x21')]=qs['offset'](_0x33950c[_0x2eb5('0x31')][_0x2eb5('0x21')]);}_0x20a767['order']=qs[_0x2eb5('0x39')](_0x33950c[_0x2eb5('0x31')][_0x2eb5('0x39')]);_0x20a767[_0x2eb5('0x3a')]=qs[_0x2eb5('0x32')](_[_0x2eb5('0x3b')](_0x33950c[_0x2eb5('0x31')],_0x16cc86[_0x2eb5('0x32')]),_0x42f1c8);if(_0x33950c[_0x2eb5('0x31')][_0x2eb5('0x3c')]){_0x20a767[_0x2eb5('0x3a')]=_[_0x2eb5('0x3d')](_0x20a767[_0x2eb5('0x3a')],{'$or':_[_0x2eb5('0x2b')](_0x42f1c8,function(_0x1bf547){if(_0x1bf547[_0x2eb5('0x2e')]!=='VIRTUAL'){var _0x207a7f={};_0x207a7f[_0x1bf547['name']]={'$like':'%'+_0x33950c[_0x2eb5('0x31')]['filter']+'%'};return _0x207a7f;}})});}_0x20a767=_[_0x2eb5('0x3d')]({},_0x20a767,_0x33950c[_0x2eb5('0x3e')]);var _0x210f53={'where':_0x20a767[_0x2eb5('0x3a')]};return db[_0x2eb5('0x3f')][_0x2eb5('0x20')](_0x210f53)['then'](function(_0x51990d){_0x355037[_0x2eb5('0x20')]=_0x51990d;if(_0x33950c[_0x2eb5('0x31')]['includeAll']){_0x20a767[_0x2eb5('0x40')]=[{'all':!![]}];}return db[_0x2eb5('0x3f')][_0x2eb5('0x41')](_0x20a767);})['then'](function(_0x191f0a){_0x355037['rows']=_0x191f0a;return _0x355037;})[_0x2eb5('0x28')](respondWithFilteredResult(_0x2b7f76,_0x20a767))[_0x2eb5('0x42')](handleError(_0x2b7f76,null));};exports[_0x2eb5('0x43')]=function(_0x4034b2,_0x15cefa){var _0xb937d1={'raw':!![],'where':{'id':_0x4034b2['params']['id']}},_0x499396={};_0x499396['model']=_[_0x2eb5('0x44')](db['SmsTransferReport'][_0x2eb5('0x2c')]);_0x499396[_0x2eb5('0x31')]=_['keys'](_0x4034b2[_0x2eb5('0x31')]);_0x499396[_0x2eb5('0x32')]=_[_0x2eb5('0x33')](_0x499396['model'],_0x499396[_0x2eb5('0x31')]);_0xb937d1['attributes']=_[_0x2eb5('0x33')](_0x499396[_0x2eb5('0x30')],qs['fields'](_0x4034b2['query'][_0x2eb5('0x35')]));_0xb937d1[_0x2eb5('0x34')]=_0xb937d1['attributes'][_0x2eb5('0x36')]?_0xb937d1[_0x2eb5('0x34')]:_0x499396['model'];if(_0x4034b2['query']['includeAll']){_0xb937d1['include']=[{'all':!![]}];}_0xb937d1=_[_0x2eb5('0x3d')]({},_0xb937d1,_0x4034b2['options']);return db[_0x2eb5('0x3f')][_0x2eb5('0x45')](_0xb937d1)[_0x2eb5('0x28')](handleEntityNotFound(_0x15cefa,null))[_0x2eb5('0x28')](respondWithResult(_0x15cefa,null))['catch'](handleError(_0x15cefa,null));};exports[_0x2eb5('0x46')]=function(_0x5a14fd,_0x40dccc){return db[_0x2eb5('0x3f')][_0x2eb5('0x46')](_0x5a14fd['body'],{})[_0x2eb5('0x28')](respondWithResult(_0x40dccc,0xc9))['catch'](handleError(_0x40dccc,null));};exports['update']=function(_0x31af15,_0x1f1267){if(_0x31af15[_0x2eb5('0x47')]['id']){delete _0x31af15[_0x2eb5('0x47')]['id'];}return db['SmsTransferReport'][_0x2eb5('0x45')]({'where':{'id':_0x31af15[_0x2eb5('0x48')]['id']}})['then'](handleEntityNotFound(_0x1f1267,null))[_0x2eb5('0x28')](saveUpdates(_0x31af15[_0x2eb5('0x47')],null))[_0x2eb5('0x28')](respondWithResult(_0x1f1267,null))[_0x2eb5('0x42')](handleError(_0x1f1267,null));};exports['destroy']=function(_0x24e366,_0x55db24){return db[_0x2eb5('0x3f')][_0x2eb5('0x45')]({'where':{'id':_0x24e366[_0x2eb5('0x48')]['id']}})[_0x2eb5('0x28')](handleEntityNotFound(_0x55db24,null))[_0x2eb5('0x28')](removeEntity(_0x55db24,null))[_0x2eb5('0x42')](handleError(_0x55db24,null));};exports['describe']=function(_0x54a302,_0x5eaadf){return db[_0x2eb5('0x3f')][_0x2eb5('0x49')]()[_0x2eb5('0x28')](respondWithResult(_0x5eaadf,null))[_0x2eb5('0x42')](handleError(_0x5eaadf,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index a32c9b9..0172506 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 _0x128c=['rimraf','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','uniqueid','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x128c,0x96));var _0xc128=function(_0x3c1aed,_0x3bfe62){_0x3c1aed=_0x3c1aed-0x0;var _0x595be8=_0x128c[_0x3c1aed];return _0x595be8;};'use strict';var _=require(_0xc128('0x0'));var util=require(_0xc128('0x1'));var logger=require(_0xc128('0x2'))(_0xc128('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc128('0x4'));var fs=require('fs');var path=require(_0xc128('0x5'));var rimraf=require(_0xc128('0x6'));var config=require(_0xc128('0x7'));var attributes=require(_0xc128('0x8'));module[_0xc128('0x9')]=function(_0x579f44,_0x40690d){return _0x579f44['define'](_0xc128('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xc128('0xb'),'fields':[_0xc128('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4a25=['lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x16ba74,_0x2ebcfa){var _0x4333a6=function(_0x13b137){while(--_0x13b137){_0x16ba74['push'](_0x16ba74['shift']());}};_0x4333a6(++_0x2ebcfa);}(_0x4a25,0x1d4));var _0x54a2=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0x4a25[_0x440917];return _0x5e906b;};'use strict';var _=require(_0x54a2('0x0'));var util=require('util');var logger=require(_0x54a2('0x1'))('api');var moment=require(_0x54a2('0x2'));var BPromise=require(_0x54a2('0x3'));var rp=require(_0x54a2('0x4'));var fs=require('fs');var path=require(_0x54a2('0x5'));var rimraf=require('rimraf');var config=require(_0x54a2('0x6'));var attributes=require(_0x54a2('0x7'));module[_0x54a2('0x8')]=function(_0x3ecde5,_0x472eed){return _0x3ecde5['define'](_0x54a2('0x9'),attributes,{'tableName':_0x54a2('0xa'),'paranoid':![],'indexes':[{'name':_0x54a2('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 5c962e1..a740daa 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 _0xb7b6=['then','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsTransferReport,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x57dea2,_0x4930fd){var _0x352157=function(_0x1bca5a){while(--_0x1bca5a){_0x57dea2['push'](_0x57dea2['shift']());}};_0x352157(++_0x4930fd);}(_0xb7b6,0x15f));var _0x6b7b=function(_0x48ab84,_0x972e97){_0x48ab84=_0x48ab84-0x0;var _0x329c9a=_0xb7b6[_0x48ab84];return _0x329c9a;};'use strict';var _=require(_0x6b7b('0x0'));var util=require(_0x6b7b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b7b('0x2'));var fs=require('fs');var Redis=require(_0x6b7b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b7b('0x4'));var logger=require(_0x6b7b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6b7b('0x6'));var client=jayson[_0x6b7b('0x7')][_0x6b7b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xff519e,_0x24359f,_0x483b9c){return new BPromise(function(_0x49a6c8,_0x2bb86d){return client[_0x6b7b('0x9')](_0xff519e,_0x483b9c)[_0x6b7b('0xa')](function(_0x115f2d){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x24359f,'request\x20sent');logger[_0x6b7b('0xb')](_0x6b7b('0xc'),_0x24359f,_0x6b7b('0xd'),JSON[_0x6b7b('0xe')](_0x115f2d));if(_0x115f2d[_0x6b7b('0xf')]){if(_0x115f2d[_0x6b7b('0xf')]['code']===0x1f4){logger[_0x6b7b('0xf')](_0x6b7b('0x10'),_0x24359f,_0x115f2d['error'][_0x6b7b('0x11')]);return _0x2bb86d(_0x115f2d[_0x6b7b('0xf')]['message']);}logger[_0x6b7b('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x24359f,_0x115f2d[_0x6b7b('0xf')][_0x6b7b('0x11')]);return _0x49a6c8(_0x115f2d[_0x6b7b('0xf')]['message']);}else{logger['info'](_0x6b7b('0x10'),_0x24359f,'request\x20sent');_0x49a6c8(_0x115f2d['result'][_0x6b7b('0x11')]);}})[_0x6b7b('0x12')](function(_0x4ef35b){logger[_0x6b7b('0xf')](_0x6b7b('0x10'),_0x24359f,_0x4ef35b);_0x2bb86d(_0x4ef35b);});});} \ No newline at end of file +var _0xb2f1=['request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0xb2f1,0xee));var _0x1b2f=function(_0x214abf,_0x199a29){_0x214abf=_0x214abf-0x0;var _0x2f446d=_0xb2f1[_0x214abf];return _0x2f446d;};'use strict';var _=require(_0x1b2f('0x0'));var util=require(_0x1b2f('0x1'));var moment=require('moment');var BPromise=require(_0x1b2f('0x2'));var rs=require(_0x1b2f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b2f('0x4'))['db'];var utils=require(_0x1b2f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1b2f('0x6'));var jayson=require(_0x1b2f('0x7'));var client=jayson[_0x1b2f('0x8')][_0x1b2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57eed1,_0x532834,_0x12a0bf){return new BPromise(function(_0x28a081,_0x5627d3){return client[_0x1b2f('0xa')](_0x57eed1,_0x12a0bf)[_0x1b2f('0xb')](function(_0x5acb30){logger[_0x1b2f('0xc')](_0x1b2f('0xd'),_0x532834,_0x1b2f('0xe'));logger[_0x1b2f('0xf')](_0x1b2f('0x10'),_0x532834,_0x1b2f('0xe'),JSON[_0x1b2f('0x11')](_0x5acb30));if(_0x5acb30['error']){if(_0x5acb30[_0x1b2f('0x12')][_0x1b2f('0x13')]===0x1f4){logger[_0x1b2f('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x532834,_0x5acb30[_0x1b2f('0x12')]['message']);return _0x5627d3(_0x5acb30[_0x1b2f('0x12')][_0x1b2f('0x14')]);}logger[_0x1b2f('0x12')](_0x1b2f('0xd'),_0x532834,_0x5acb30[_0x1b2f('0x12')]['message']);return _0x28a081(_0x5acb30[_0x1b2f('0x12')][_0x1b2f('0x14')]);}else{logger[_0x1b2f('0xc')](_0x1b2f('0xd'),_0x532834,'request\x20sent');_0x28a081(_0x5acb30['result'][_0x1b2f('0x14')]);}})['catch'](function(_0x4cdc0d){logger['error'](_0x1b2f('0xd'),_0x532834,_0x4cdc0d);_0x5627d3(_0x4cdc0d);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 5caff45..5378a3e 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 _0x6602=['format','%s-%s%s','basename','extname','post','single','file','create','put','update','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','show','/:id/download','isAuthenticated','diskStorage','server/files/sounds/original/','originalname','replace'];(function(_0x1158e1,_0x31b137){var _0x22ff3d=function(_0x4bf2ed){while(--_0x4bf2ed){_0x1158e1['push'](_0x1158e1['shift']());}};_0x22ff3d(++_0x31b137);}(_0x6602,0x194));var _0x2660=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x6602[_0x62c958];return _0x57ec61;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2660('0x0'));var timeout=require(_0x2660('0x1'));var express=require(_0x2660('0x2'));var router=express['Router']();var fs_extra=require(_0x2660('0x3'));var auth=require(_0x2660('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2660('0x5'));var controller=require('./sound.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2660('0x6')]);router[_0x2660('0x7')](_0x2660('0x8'),auth['isAuthenticated'](),controller[_0x2660('0x9')]);router[_0x2660('0x7')](_0x2660('0xa'),auth[_0x2660('0xb')](),controller['download']);var upload=multer({'storage':multer[_0x2660('0xc')]({'destination':function(_0x41aa0e,_0x1069d8,_0x1e6f2c){_0x1e6f2c(null,path['join'](config['root'],_0x2660('0xd')));},'filename':function(_0xd70c19,_0x53ece5,_0x3adf58){_0x53ece5[_0x2660('0xe')]=_0x53ece5[_0x2660('0xe')][_0x2660('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3adf58(null,util[_0x2660('0x10')](_0x2660('0x11'),path[_0x2660('0x12')](_0x53ece5[_0x2660('0xe')],path[_0x2660('0x13')](_0x53ece5['originalname'])),Date['now'](),path[_0x2660('0x13')](_0x53ece5[_0x2660('0xe')])));}})});router[_0x2660('0x14')]('/',upload[_0x2660('0x15')](_0x2660('0x16')),controller[_0x2660('0x17')]);router[_0x2660('0x18')](_0x2660('0x8'),auth['isAuthenticated'](),controller[_0x2660('0x19')]);router['delete'](_0x2660('0x8'),auth['isAuthenticated'](),controller[_0x2660('0x1a')]);module[_0x2660('0x1b')]=router; \ No newline at end of file +var _0xc695=['root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','file','create','put','/:id','update','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc695,0xf0));var _0x5c69=function(_0xfc7019,_0x277c9e){_0xfc7019=_0xfc7019-0x0;var _0x2af8f4=_0xc695[_0xfc7019];return _0x2af8f4;};'use strict';var multer=require('multer');var util=require(_0x5c69('0x0'));var path=require('path');var timeout=require(_0x5c69('0x1'));var express=require('express');var router=express[_0x5c69('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5c69('0x3'));var interaction=require(_0x5c69('0x4'));var config=require(_0x5c69('0x5'));var controller=require('./sound.controller');router['get']('/',auth[_0x5c69('0x6')](),controller[_0x5c69('0x7')]);router[_0x5c69('0x8')]('/:id',auth[_0x5c69('0x6')](),controller[_0x5c69('0x9')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29b2fa,_0x3272a2,_0x122ce7){_0x122ce7(null,path['join'](config[_0x5c69('0xa')],_0x5c69('0xb')));},'filename':function(_0x12d79a,_0x5e3078,_0x805fad){_0x5e3078[_0x5c69('0xc')]=_0x5e3078[_0x5c69('0xc')][_0x5c69('0xd')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x805fad(null,util[_0x5c69('0xe')](_0x5c69('0xf'),path[_0x5c69('0x10')](_0x5e3078[_0x5c69('0xc')],path[_0x5c69('0x11')](_0x5e3078[_0x5c69('0xc')])),Date[_0x5c69('0x12')](),path[_0x5c69('0x11')](_0x5e3078[_0x5c69('0xc')])));}})});router[_0x5c69('0x13')]('/',upload['single'](_0x5c69('0x14')),controller[_0x5c69('0x15')]);router[_0x5c69('0x16')](_0x5c69('0x17'),auth[_0x5c69('0x6')](),controller[_0x5c69('0x18')]);router['delete'](_0x5c69('0x17'),auth[_0x5c69('0x6')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 5a981c2..42b029e 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 _0x14bb=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING','name'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x14bb,0x192));var _0xb14b=function(_0x13a0f9,_0x544b12){_0x13a0f9=_0x13a0f9-0x0;var _0x3516e8=_0x14bb[_0x13a0f9];return _0x3516e8;};'use strict';var Sequelize=require(_0xb14b('0x0'));module[_0xb14b('0x1')]={'name':{'type':Sequelize[_0xb14b('0x2')],'unique':_0xb14b('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xb14b('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xb14b('0x2')]},'original_format':{'type':Sequelize[_0xb14b('0x2')]},'original_duration':{'type':Sequelize[_0xb14b('0x4')]},'original_sampleCount':{'type':Sequelize[_0xb14b('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xb14b('0x5')]},'original_sampleRate':{'type':Sequelize[_0xb14b('0x6')]},'converted_format':{'type':Sequelize[_0xb14b('0x2')]},'converted_duration':{'type':Sequelize[_0xb14b('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xb14b('0x5')]},'converted_channelCount':{'type':Sequelize[_0xb14b('0x6')]},'converted_bitRate':{'type':Sequelize[_0xb14b('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xb14b('0x6')]}}; \ No newline at end of file +var _0x44cb=['BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x44cb,0xac));var _0xb44c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x44cb[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb44c('0x0'));module[_0xb44c('0x1')]={'name':{'type':Sequelize[_0xb44c('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xb44c('0x2')]},'display_name':{'type':Sequelize[_0xb44c('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xb44c('0x2')]},'original_format':{'type':Sequelize[_0xb44c('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xb44c('0x3')]},'original_channelCount':{'type':Sequelize[_0xb44c('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xb44c('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xb44c('0x3')]},'converted_sampleRate':{'type':Sequelize[_0xb44c('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 6b3927e..3b4ebf3 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 _0xaab7=['rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','status','error','stack','name','index','Sound','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','VIRTUAL','filter','merge','count','includeAll','include','rows','catch','show','params','options','find','save_name','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','download','root','format','%s.%s','create','file','originalname','extname','basename','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','delete','original_format','eml-format'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xaab7,0x7e));var _0x7aab=function(_0x1946c5,_0x42e375){_0x1946c5=_0x1946c5-0x0;var _0x12ef20=_0xaab7[_0x1946c5];return _0x12ef20;};'use strict';var emlformat=require(_0x7aab('0x0'));var rimraf=require(_0x7aab('0x1'));var zipdir=require(_0x7aab('0x2'));var jsonpatch=require(_0x7aab('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7aab('0x4'));var Mustache=require('mustache');var util=require(_0x7aab('0x5'));var path=require(_0x7aab('0x6'));var sox=require(_0x7aab('0x7'));var csv=require(_0x7aab('0x8'));var ejs=require(_0x7aab('0x9'));var fs=require('fs');var fs_extra=require(_0x7aab('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7aab('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7aab('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7aab('0xd'));var Papa=require(_0x7aab('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7aab('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7aab('0x10'))(_0x7aab('0x11'));var utils=require(_0x7aab('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7aab('0x13'));var db=require(_0x7aab('0x14'))['db'];function respondWithStatusCode(_0x419c37,_0x1722df){_0x1722df=_0x1722df||0xcc;return function(_0x4ba78b){if(_0x4ba78b){return _0x419c37[_0x7aab('0x15')](_0x1722df);}return _0x419c37['status'](_0x1722df)[_0x7aab('0x16')]();};}function respondWithResult(_0x3300e0,_0xd20cee){_0xd20cee=_0xd20cee||0xc8;return function(_0x208979){if(_0x208979){return _0x3300e0['status'](_0xd20cee)[_0x7aab('0x17')](_0x208979);}};}function respondWithFilteredResult(_0x55e810,_0x132b07){return function(_0x20137f){if(_0x20137f){var _0xe7b966=typeof _0x132b07[_0x7aab('0x18')]==='undefined'&&typeof _0x132b07['limit']===_0x7aab('0x19');var _0x2453b3=_0x20137f['count'];var _0x226131=_0xe7b966?0x0:_0x132b07[_0x7aab('0x18')];var _0x3927a2=_0xe7b966?_0x20137f['count']:_0x132b07[_0x7aab('0x18')]+_0x132b07['limit'];var _0x4cf20e;if(_0x3927a2>=_0x2453b3){_0x3927a2=_0x2453b3;_0x4cf20e=0xc8;}else{_0x4cf20e=0xce;}_0x55e810['status'](_0x4cf20e);return _0x55e810[_0x7aab('0x1a')](_0x7aab('0x1b'),_0x226131+'-'+_0x3927a2+'/'+_0x2453b3)[_0x7aab('0x17')](_0x20137f);}return null;};}function patchUpdates(_0x42e2f9){return function(_0xf2f0a4){try{jsonpatch[_0x7aab('0x1c')](_0xf2f0a4,_0x42e2f9,!![]);}catch(_0x176912){return BPromise[_0x7aab('0x1d')](_0x176912);}return _0xf2f0a4[_0x7aab('0x1e')]();};}function saveUpdates(_0x48a0a3,_0x4a7c57){return function(_0xf8aba8){if(_0xf8aba8){return _0xf8aba8[_0x7aab('0x1f')](_0x48a0a3)[_0x7aab('0x20')](function(_0x412fd9){return _0x412fd9;});}return null;};}function removeEntity(_0x509f18,_0x3d7337){return function(_0x30968b){if(_0x30968b){return _0x30968b[_0x7aab('0x21')]()[_0x7aab('0x20')](function(){var _0x5db5e9=_0x30968b[_0x7aab('0x22')]({'plain':!![]});var _0x5b5d9d=_0x7aab('0x23');return db[_0x7aab('0x24')][_0x7aab('0x21')]({'where':{'type':_0x5b5d9d,'resourceId':_0x5db5e9['id']}})['then'](function(){return _0x30968b;});})[_0x7aab('0x20')](function(){_0x509f18[_0x7aab('0x25')](0xcc)[_0x7aab('0x16')]();});}};}function handleEntityNotFound(_0x5bf24c,_0xf622c4){return function(_0x15eaa3){if(!_0x15eaa3){_0x5bf24c[_0x7aab('0x15')](0x194);}return _0x15eaa3;};}function handleError(_0x4dd14a,_0x5f85ec){_0x5f85ec=_0x5f85ec||0x1f4;return function(_0x5dc556){logger[_0x7aab('0x26')](_0x5dc556[_0x7aab('0x27')]);if(_0x5dc556[_0x7aab('0x28')]){delete _0x5dc556['name'];}_0x4dd14a['status'](_0x5f85ec)['send'](_0x5dc556);};}exports[_0x7aab('0x29')]=function(_0x4dd92c,_0x42927a){var _0x447a4a={},_0x5bc1b9={},_0x4d310c={'count':0x0,'rows':[]};var _0x5a8a56=_['map'](db[_0x7aab('0x2a')][_0x7aab('0x2b')],function(_0x54389e){return{'name':_0x54389e[_0x7aab('0x2c')],'type':_0x54389e[_0x7aab('0x2d')][_0x7aab('0x2e')]};});_0x5bc1b9['model']=_[_0x7aab('0x2f')](_0x5a8a56,_0x7aab('0x28'));_0x5bc1b9[_0x7aab('0x30')]=_[_0x7aab('0x31')](_0x4dd92c[_0x7aab('0x30')]);_0x5bc1b9[_0x7aab('0x32')]=_[_0x7aab('0x33')](_0x5bc1b9[_0x7aab('0x34')],_0x5bc1b9[_0x7aab('0x30')]);_0x447a4a[_0x7aab('0x35')]=_[_0x7aab('0x33')](_0x5bc1b9[_0x7aab('0x34')],qs['fields'](_0x4dd92c[_0x7aab('0x30')][_0x7aab('0x36')]));_0x447a4a[_0x7aab('0x35')]=_0x447a4a['attributes'][_0x7aab('0x37')]?_0x447a4a[_0x7aab('0x35')]:_0x5bc1b9[_0x7aab('0x34')];if(!_0x4dd92c['query'][_0x7aab('0x38')](_0x7aab('0x39'))){_0x447a4a['limit']=qs[_0x7aab('0x3a')](_0x4dd92c['query']['limit']);_0x447a4a['offset']=qs[_0x7aab('0x18')](_0x4dd92c[_0x7aab('0x30')][_0x7aab('0x18')]);}_0x447a4a['order']=qs[_0x7aab('0x3b')](_0x4dd92c['query'][_0x7aab('0x3b')]);_0x447a4a[_0x7aab('0x3c')]=qs['filters'](_['pick'](_0x4dd92c[_0x7aab('0x30')],_0x5bc1b9[_0x7aab('0x32')]),_0x5a8a56);if(_0x4dd92c[_0x7aab('0x30')]['filter']){_0x447a4a['where']=_['merge'](_0x447a4a[_0x7aab('0x3c')],{'$or':_[_0x7aab('0x2f')](_0x5a8a56,function(_0x26eb6e){if(_0x26eb6e[_0x7aab('0x2d')]!==_0x7aab('0x3d')){var _0x3863a5={};_0x3863a5[_0x26eb6e[_0x7aab('0x28')]]={'$like':'%'+_0x4dd92c['query'][_0x7aab('0x3e')]+'%'};return _0x3863a5;}})});}_0x447a4a=_[_0x7aab('0x3f')]({},_0x447a4a,_0x4dd92c['options']);var _0x1b5288={'where':_0x447a4a[_0x7aab('0x3c')]};return db[_0x7aab('0x2a')][_0x7aab('0x40')](_0x1b5288)[_0x7aab('0x20')](function(_0x262527){_0x4d310c[_0x7aab('0x40')]=_0x262527;if(_0x4dd92c[_0x7aab('0x30')][_0x7aab('0x41')]){_0x447a4a[_0x7aab('0x42')]=[{'all':!![]}];}return db[_0x7aab('0x2a')]['findAll'](_0x447a4a);})['then'](function(_0x4bb841){_0x4d310c[_0x7aab('0x43')]=_0x4bb841;return _0x4d310c;})['then'](respondWithFilteredResult(_0x42927a,_0x447a4a))[_0x7aab('0x44')](handleError(_0x42927a,null));};exports[_0x7aab('0x45')]=function(_0x136457,_0x5eba4f){var _0x1b88a9={'raw':!![],'where':{'id':_0x136457[_0x7aab('0x46')]['id']}},_0x452566={};_0x452566[_0x7aab('0x34')]=_[_0x7aab('0x31')](db[_0x7aab('0x2a')]['rawAttributes']);_0x452566[_0x7aab('0x30')]=_['keys'](_0x136457[_0x7aab('0x30')]);_0x452566[_0x7aab('0x32')]=_[_0x7aab('0x33')](_0x452566[_0x7aab('0x34')],_0x452566[_0x7aab('0x30')]);_0x1b88a9['attributes']=_[_0x7aab('0x33')](_0x452566[_0x7aab('0x34')],qs[_0x7aab('0x36')](_0x136457[_0x7aab('0x30')][_0x7aab('0x36')]));_0x1b88a9[_0x7aab('0x35')]=_0x1b88a9['attributes']['length']?_0x1b88a9[_0x7aab('0x35')]:_0x452566[_0x7aab('0x34')];if(_0x136457[_0x7aab('0x30')][_0x7aab('0x41')]){_0x1b88a9[_0x7aab('0x42')]=[{'all':!![]}];}_0x1b88a9=_[_0x7aab('0x3f')]({},_0x1b88a9,_0x136457[_0x7aab('0x47')]);return db[_0x7aab('0x2a')][_0x7aab('0x48')](_0x1b88a9)['then'](handleEntityNotFound(_0x5eba4f,null))[_0x7aab('0x20')](respondWithResult(_0x5eba4f,null))['catch'](handleError(_0x5eba4f,null));};exports['download']=function(_0x43d568,_0x12a374,_0x242dc2){return db[_0x7aab('0x2a')][_0x7aab('0x48')]({'where':{'id':_0x43d568[_0x7aab('0x46')]['id']},'attributes':[_0x7aab('0x28'),_0x7aab('0x49'),_0x7aab('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x12a374,null))[_0x7aab('0x20')](function(_0xa811f9){if(_0xa811f9){if(!fs[_0x7aab('0x4b')](path[_0x7aab('0x4c')](config['root'],_0x7aab('0x4d'),_0xa811f9[_0x7aab('0x49')]+'.'+_0xa811f9[_0x7aab('0x4a')]))){throw new db[(_0x7aab('0x4e'))][(_0x7aab('0x4f'))](_0x7aab('0x50'));}return _0x12a374[_0x7aab('0x51')](path[_0x7aab('0x4c')](config[_0x7aab('0x52')],_0x7aab('0x4d'),util[_0x7aab('0x53')]('%s.%s',_0xa811f9[_0x7aab('0x49')],_0xa811f9[_0x7aab('0x4a')])),util['format'](_0x7aab('0x54'),_0xa811f9[_0x7aab('0x28')],_0xa811f9[_0x7aab('0x4a')]));}return null;})[_0x7aab('0x44')](handleError(_0x12a374,null));};exports[_0x7aab('0x55')]=function(_0x38d556,_0xa18690,_0x3791fe){var _0xa472c1={'name':path['basename'](_0x38d556[_0x7aab('0x56')][_0x7aab('0x57')],path[_0x7aab('0x58')](_0x38d556['file'][_0x7aab('0x57')])),'save_name':path[_0x7aab('0x59')](_0x38d556['file'][_0x7aab('0x5a')],path[_0x7aab('0x58')](_0x38d556[_0x7aab('0x56')][_0x7aab('0x5a')])),'original_format':path[_0x7aab('0x58')](_0x38d556[_0x7aab('0x56')][_0x7aab('0x57')])[_0x7aab('0x5b')](0x1),'converted_format':_0x7aab('0x5c')};var _0x5866d7=path[_0x7aab('0x4c')](config[_0x7aab('0x52')],_0x7aab('0x5d'),_0x38d556[_0x7aab('0x56')][_0x7aab('0x5a')]);var _0x46c254=path['join'](config[_0x7aab('0x52')],_0x7aab('0x4d'),util[_0x7aab('0x53')](_0x7aab('0x54'),path[_0x7aab('0x59')](_0x38d556[_0x7aab('0x56')][_0x7aab('0x5a')],path[_0x7aab('0x58')](_0x38d556['file'][_0x7aab('0x5a')])),_0xa472c1['converted_format']));logger[_0x7aab('0x5e')](_0x7aab('0x5f'),_0x5866d7);logger[_0x7aab('0x5e')](_0x7aab('0x60'),_0x46c254);try{fs[_0x7aab('0x61')](_0x5866d7,parseInt(_0x7aab('0x62'),0x8));var _0xe446bd=sox[_0x7aab('0x63')](_0x5866d7,_0x46c254,{'sampleRate':0x1f40,'format':_0x7aab('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xe446bd['on'](_0x7aab('0x26'),function(_0x4320f0){fs[_0x7aab('0x64')](_0x5866d7);_0xa18690[_0x7aab('0x25')](0x1f4)[_0x7aab('0x65')](_0x4320f0);});_0xe446bd['on'](_0x7aab('0x66'),function(_0x2c9731){_0xa472c1[_0x7aab('0x67')]=isNaN(_0x2c9731['duration'])?null:_0x2c9731[_0x7aab('0x68')]*0x3e8;_0xa472c1[_0x7aab('0x69')]=isNaN(_0x2c9731['sampleCount'])?null:_0x2c9731[_0x7aab('0x6a')];_0xa472c1[_0x7aab('0x6b')]=isNaN(_0x2c9731[_0x7aab('0x6c')])?null:_0x2c9731[_0x7aab('0x6c')];_0xa472c1['original_bitRate']=isNaN(_0x2c9731['bitRate'])?null:_0x2c9731[_0x7aab('0x6d')];_0xa472c1[_0x7aab('0x6e')]=isNaN(_0x2c9731[_0x7aab('0x6f')])?null:_0x2c9731['sampleRate'];});_0xe446bd['on'](_0x7aab('0x70'),function(_0x19ed09){_0xa472c1[_0x7aab('0x71')]=isNaN(_0x19ed09[_0x7aab('0x68')])?null:_0x19ed09[_0x7aab('0x68')]*0x3e8;_0xa472c1[_0x7aab('0x72')]=isNaN(_0x19ed09['sampleCount'])?null:_0x19ed09[_0x7aab('0x6a')];_0xa472c1['converted_channelCount']=isNaN(_0x19ed09[_0x7aab('0x6c')])?null:_0x19ed09[_0x7aab('0x6c')];_0xa472c1[_0x7aab('0x73')]=isNaN(_0x19ed09['bitRate'])?null:_0x19ed09[_0x7aab('0x6d')];_0xa472c1['converted_sampleRate']=isNaN(_0x19ed09['sampleRate'])?null:_0x19ed09[_0x7aab('0x6f')];});_0xe446bd['on']('end',function(){fs[_0x7aab('0x61')](_0x46c254,parseInt(_0x7aab('0x62'),0x8));return db[_0x7aab('0x2a')][_0x7aab('0x55')](_0xa472c1)[_0x7aab('0x20')](function(_0x277186){var _0x447600={'role':_0x38d556['body'][_0x7aab('0x74')],'userProfileId':_0x38d556['body'][_0x7aab('0x75')]};if(!_0x447600)throw new Error(_0x7aab('0x76'));if(_0x447600['role']===_0x7aab('0x77')){var _0x2f12bc=_0x277186[_0x7aab('0x22')]({'plain':!![]});return db[_0x7aab('0x78')][_0x7aab('0x48')]({'where':{'name':_0x7aab('0x23'),'userProfileId':_0x447600[_0x7aab('0x75')]},'raw':!![]})['then'](function(_0x2234e1){if(_0x2234e1&&_0x2234e1['autoAssociation']===0x0){return db[_0x7aab('0x24')][_0x7aab('0x55')]({'name':_0x2f12bc[_0x7aab('0x28')],'resourceId':_0x2f12bc['id'],'type':_0x2234e1['name'],'sectionId':_0x2234e1['id']},{})[_0x7aab('0x20')](function(){return _0x277186;});}else{return _0x277186;}})['catch'](function(_0x2b937d){logger[_0x7aab('0x26')](_0x7aab('0x79'),_0x2b937d);throw _0x2b937d;});}return _0x277186;})['then'](respondWithResult(_0xa18690,null))[_0x7aab('0x44')](handleError(_0xa18690,null));});_0xe446bd[_0x7aab('0x7a')]();}catch(_0x4d53eb){_0xa18690[_0x7aab('0x25')](0x1f4)[_0x7aab('0x65')](_0x4d53eb);}};exports[_0x7aab('0x1f')]=function(_0x19d10e,_0x45a580,_0x4a1a1a){return db[_0x7aab('0x2a')][_0x7aab('0x48')]({'where':{'id':_0x19d10e[_0x7aab('0x46')]['id']}})[_0x7aab('0x20')](handleEntityNotFound(_0x45a580,null))[_0x7aab('0x20')](saveUpdates(_[_0x7aab('0x7b')](_0x19d10e['body'],['name',_0x7aab('0x7c')]),null))[_0x7aab('0x20')](respondWithResult(_0x45a580,null))[_0x7aab('0x44')](handleError(_0x45a580,null));};exports[_0x7aab('0x7d')]=function(_0x3efc8a,_0x54ac13,_0x2d50d5){return db[_0x7aab('0x2a')][_0x7aab('0x48')]({'where':{'id':_0x3efc8a[_0x7aab('0x46')]['id']}})[_0x7aab('0x20')](function(_0x5cc520){if(_0x5cc520){return _0x5cc520[_0x7aab('0x21')]();}})['then'](function(_0x5487c6){var _0x33f8ef=path['join'](config[_0x7aab('0x52')],'server/files/sounds/original',util[_0x7aab('0x53')](_0x7aab('0x54'),_0x5487c6[_0x7aab('0x49')],_0x5487c6[_0x7aab('0x7e')]));var _0x3ba534=path[_0x7aab('0x4c')](config['root'],_0x7aab('0x4d'),util['format'](_0x7aab('0x54'),_0x5487c6[_0x7aab('0x49')],_0x5487c6[_0x7aab('0x4a')]));fs[_0x7aab('0x64')](_0x33f8ef);fs[_0x7aab('0x64')](_0x3ba534);return _0x5487c6;})[_0x7aab('0x20')](function(_0x75057b){if(_0x75057b){return _0x54ac13[_0x7aab('0x25')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x54ac13,null))[_0x7aab('0x44')](handleError(_0x54ac13,null));}; \ No newline at end of file +var _0x5214=['catch','show','params','download','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_sampleCount','converted_bitRate','converted_sampleRate','body','role','get','UserProfileSection','find','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','destroy','then','UserProfileResource','sendStatus','error','name','send','Sound','rawAttributes','fieldName','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5214,0xb2));var _0x4521=function(_0x9b9787,_0xaf7588){_0x9b9787=_0x9b9787-0x0;var _0x28351e=_0x5214[_0x9b9787];return _0x28351e;};'use strict';var emlformat=require(_0x4521('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4521('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4521('0x2'));var moment=require('moment');var BPromise=require(_0x4521('0x3'));var Mustache=require(_0x4521('0x4'));var util=require(_0x4521('0x5'));var path=require('path');var sox=require(_0x4521('0x6'));var csv=require('to-csv');var ejs=require(_0x4521('0x7'));var fs=require('fs');var fs_extra=require(_0x4521('0x8'));var _=require(_0x4521('0x9'));var squel=require(_0x4521('0xa'));var crypto=require(_0x4521('0xb'));var jsforce=require(_0x4521('0xc'));var deskjs=require(_0x4521('0xd'));var toCsv=require(_0x4521('0xe'));var querystring=require(_0x4521('0xf'));var Papa=require(_0x4521('0x10'));var Redis=require(_0x4521('0x11'));var authService=require(_0x4521('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4521('0x13'));var hardwareService=require(_0x4521('0x14'));var logger=require(_0x4521('0x15'))(_0x4521('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4521('0x17'))['db'];function respondWithStatusCode(_0x30ee4a,_0x135b19){_0x135b19=_0x135b19||0xcc;return function(_0x500339){if(_0x500339){return _0x30ee4a['sendStatus'](_0x135b19);}return _0x30ee4a[_0x4521('0x18')](_0x135b19)[_0x4521('0x19')]();};}function respondWithResult(_0xc5ff4d,_0x5cffbb){_0x5cffbb=_0x5cffbb||0xc8;return function(_0x58322e){if(_0x58322e){return _0xc5ff4d[_0x4521('0x18')](_0x5cffbb)['json'](_0x58322e);}};}function respondWithFilteredResult(_0x1b91d0,_0x1b266f){return function(_0x1d7307){if(_0x1d7307){var _0x4c1814=typeof _0x1b266f[_0x4521('0x1a')]==='undefined'&&typeof _0x1b266f[_0x4521('0x1b')]===_0x4521('0x1c');var _0x173d45=_0x1d7307[_0x4521('0x1d')];var _0x282dca=_0x4c1814?0x0:_0x1b266f['offset'];var _0x2b8a97=_0x4c1814?_0x1d7307['count']:_0x1b266f['offset']+_0x1b266f['limit'];var _0x1127c8;if(_0x2b8a97>=_0x173d45){_0x2b8a97=_0x173d45;_0x1127c8=0xc8;}else{_0x1127c8=0xce;}_0x1b91d0[_0x4521('0x18')](_0x1127c8);return _0x1b91d0['set'](_0x4521('0x1e'),_0x282dca+'-'+_0x2b8a97+'/'+_0x173d45)[_0x4521('0x1f')](_0x1d7307);}return null;};}function patchUpdates(_0x5a5d87){return function(_0x4c5c20){try{jsonpatch[_0x4521('0x20')](_0x4c5c20,_0x5a5d87,!![]);}catch(_0x548e79){return BPromise[_0x4521('0x21')](_0x548e79);}return _0x4c5c20[_0x4521('0x22')]();};}function saveUpdates(_0x2fbc38,_0x59b30b){return function(_0x384b60){if(_0x384b60){return _0x384b60[_0x4521('0x23')](_0x2fbc38)['then'](function(_0x2f6e98){return _0x2f6e98;});}return null;};}function removeEntity(_0x588e61,_0x5e49ea){return function(_0x1ba42f){if(_0x1ba42f){return _0x1ba42f[_0x4521('0x24')]()[_0x4521('0x25')](function(){var _0x5b4bba=_0x1ba42f['get']({'plain':!![]});var _0x338b7d='Sounds';return db[_0x4521('0x26')]['destroy']({'where':{'type':_0x338b7d,'resourceId':_0x5b4bba['id']}})[_0x4521('0x25')](function(){return _0x1ba42f;});})['then'](function(){_0x588e61[_0x4521('0x18')](0xcc)[_0x4521('0x19')]();});}};}function handleEntityNotFound(_0x8626f,_0x4d372f){return function(_0x4539b2){if(!_0x4539b2){_0x8626f[_0x4521('0x27')](0x194);}return _0x4539b2;};}function handleError(_0x54ca67,_0x53f197){_0x53f197=_0x53f197||0x1f4;return function(_0x106de1){logger[_0x4521('0x28')](_0x106de1['stack']);if(_0x106de1[_0x4521('0x29')]){delete _0x106de1[_0x4521('0x29')];}_0x54ca67['status'](_0x53f197)[_0x4521('0x2a')](_0x106de1);};}exports['index']=function(_0x1ad99a,_0x2b310a){var _0xf4fbfb={},_0x1006ec={},_0x1bc47b={'count':0x0,'rows':[]};var _0x37b3bd=_['map'](db[_0x4521('0x2b')][_0x4521('0x2c')],function(_0x4728ec){return{'name':_0x4728ec[_0x4521('0x2d')],'type':_0x4728ec['type'][_0x4521('0x2e')]};});_0x1006ec[_0x4521('0x2f')]=_[_0x4521('0x30')](_0x37b3bd,_0x4521('0x29'));_0x1006ec[_0x4521('0x31')]=_[_0x4521('0x32')](_0x1ad99a[_0x4521('0x31')]);_0x1006ec['filters']=_['intersection'](_0x1006ec['model'],_0x1006ec['query']);_0xf4fbfb[_0x4521('0x33')]=_['intersection'](_0x1006ec['model'],qs[_0x4521('0x34')](_0x1ad99a[_0x4521('0x31')][_0x4521('0x34')]));_0xf4fbfb[_0x4521('0x33')]=_0xf4fbfb['attributes'][_0x4521('0x35')]?_0xf4fbfb['attributes']:_0x1006ec[_0x4521('0x2f')];if(!_0x1ad99a['query'][_0x4521('0x36')](_0x4521('0x37'))){_0xf4fbfb[_0x4521('0x1b')]=qs[_0x4521('0x1b')](_0x1ad99a['query']['limit']);_0xf4fbfb[_0x4521('0x1a')]=qs[_0x4521('0x1a')](_0x1ad99a[_0x4521('0x31')]['offset']);}_0xf4fbfb[_0x4521('0x38')]=qs['sort'](_0x1ad99a['query'][_0x4521('0x39')]);_0xf4fbfb[_0x4521('0x3a')]=qs[_0x4521('0x3b')](_[_0x4521('0x3c')](_0x1ad99a['query'],_0x1006ec['filters']),_0x37b3bd);if(_0x1ad99a[_0x4521('0x31')][_0x4521('0x3d')]){_0xf4fbfb['where']=_[_0x4521('0x3e')](_0xf4fbfb[_0x4521('0x3a')],{'$or':_[_0x4521('0x30')](_0x37b3bd,function(_0x1049c7){if(_0x1049c7[_0x4521('0x3f')]!==_0x4521('0x40')){var _0x41c627={};_0x41c627[_0x1049c7[_0x4521('0x29')]]={'$like':'%'+_0x1ad99a[_0x4521('0x31')][_0x4521('0x3d')]+'%'};return _0x41c627;}})});}_0xf4fbfb=_[_0x4521('0x3e')]({},_0xf4fbfb,_0x1ad99a[_0x4521('0x41')]);var _0x591293={'where':_0xf4fbfb['where']};return db[_0x4521('0x2b')][_0x4521('0x1d')](_0x591293)[_0x4521('0x25')](function(_0x371167){_0x1bc47b[_0x4521('0x1d')]=_0x371167;if(_0x1ad99a[_0x4521('0x31')][_0x4521('0x42')]){_0xf4fbfb[_0x4521('0x43')]=[{'all':!![]}];}return db[_0x4521('0x2b')][_0x4521('0x44')](_0xf4fbfb);})['then'](function(_0x4504b9){_0x1bc47b[_0x4521('0x45')]=_0x4504b9;return _0x1bc47b;})[_0x4521('0x25')](respondWithFilteredResult(_0x2b310a,_0xf4fbfb))[_0x4521('0x46')](handleError(_0x2b310a,null));};exports[_0x4521('0x47')]=function(_0x5a9dba,_0x5c40da){var _0x51c7d4={'raw':!![],'where':{'id':_0x5a9dba[_0x4521('0x48')]['id']}},_0x2b8b10={};_0x2b8b10[_0x4521('0x2f')]=_[_0x4521('0x32')](db[_0x4521('0x2b')][_0x4521('0x2c')]);_0x2b8b10[_0x4521('0x31')]=_[_0x4521('0x32')](_0x5a9dba[_0x4521('0x31')]);_0x2b8b10[_0x4521('0x3b')]=_['intersection'](_0x2b8b10[_0x4521('0x2f')],_0x2b8b10[_0x4521('0x31')]);_0x51c7d4[_0x4521('0x33')]=_['intersection'](_0x2b8b10[_0x4521('0x2f')],qs[_0x4521('0x34')](_0x5a9dba[_0x4521('0x31')][_0x4521('0x34')]));_0x51c7d4[_0x4521('0x33')]=_0x51c7d4['attributes']['length']?_0x51c7d4[_0x4521('0x33')]:_0x2b8b10[_0x4521('0x2f')];if(_0x5a9dba[_0x4521('0x31')][_0x4521('0x42')]){_0x51c7d4['include']=[{'all':!![]}];}_0x51c7d4=_[_0x4521('0x3e')]({},_0x51c7d4,_0x5a9dba[_0x4521('0x41')]);return db[_0x4521('0x2b')]['find'](_0x51c7d4)[_0x4521('0x25')](handleEntityNotFound(_0x5c40da,null))['then'](respondWithResult(_0x5c40da,null))[_0x4521('0x46')](handleError(_0x5c40da,null));};exports[_0x4521('0x49')]=function(_0x52b818,_0x5ba22f,_0x47c9f9){return db[_0x4521('0x2b')]['find']({'where':{'id':_0x52b818[_0x4521('0x48')]['id']},'attributes':[_0x4521('0x29'),_0x4521('0x4a'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x5ba22f,null))[_0x4521('0x25')](function(_0x3976ce){if(_0x3976ce){if(!fs[_0x4521('0x4b')](path[_0x4521('0x4c')](config[_0x4521('0x4d')],_0x4521('0x4e'),_0x3976ce[_0x4521('0x4a')]+'.'+_0x3976ce[_0x4521('0x4f')]))){throw new db[(_0x4521('0x50'))][(_0x4521('0x51'))](_0x4521('0x52'));}return _0x5ba22f['download'](path[_0x4521('0x4c')](config[_0x4521('0x4d')],_0x4521('0x4e'),util[_0x4521('0x53')](_0x4521('0x54'),_0x3976ce['save_name'],_0x3976ce['converted_format'])),util[_0x4521('0x53')]('%s.%s',_0x3976ce[_0x4521('0x29')],_0x3976ce[_0x4521('0x4f')]));}return null;})[_0x4521('0x46')](handleError(_0x5ba22f,null));};exports[_0x4521('0x55')]=function(_0x2afd92,_0x3176dd,_0x5cfbca){var _0x1f36ac={'name':path[_0x4521('0x56')](_0x2afd92[_0x4521('0x57')][_0x4521('0x58')],path[_0x4521('0x59')](_0x2afd92[_0x4521('0x57')][_0x4521('0x58')])),'save_name':path[_0x4521('0x56')](_0x2afd92[_0x4521('0x57')][_0x4521('0x5a')],path[_0x4521('0x59')](_0x2afd92[_0x4521('0x57')][_0x4521('0x5a')])),'original_format':path[_0x4521('0x59')](_0x2afd92[_0x4521('0x57')]['originalname'])[_0x4521('0x5b')](0x1),'converted_format':_0x4521('0x5c')};var _0x3e102a=path[_0x4521('0x4c')](config['root'],'server/files/sounds/original',_0x2afd92[_0x4521('0x57')][_0x4521('0x5a')]);var _0x38757b=path[_0x4521('0x4c')](config['root'],_0x4521('0x4e'),util[_0x4521('0x53')](_0x4521('0x54'),path[_0x4521('0x56')](_0x2afd92[_0x4521('0x57')][_0x4521('0x5a')],path['extname'](_0x2afd92[_0x4521('0x57')][_0x4521('0x5a')])),_0x1f36ac[_0x4521('0x4f')]));logger[_0x4521('0x5d')](_0x4521('0x5e'),_0x3e102a);logger['info'](_0x4521('0x5f'),_0x38757b);try{fs[_0x4521('0x60')](_0x3e102a,parseInt('0777',0x8));var _0x1ec5d7=sox[_0x4521('0x61')](_0x3e102a,_0x38757b,{'sampleRate':0x1f40,'format':_0x4521('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1ec5d7['on'](_0x4521('0x28'),function(_0x167760){fs[_0x4521('0x62')](_0x3e102a);_0x3176dd[_0x4521('0x18')](0x1f4)[_0x4521('0x2a')](_0x167760);});_0x1ec5d7['on'](_0x4521('0x63'),function(_0x2c7b20){_0x1f36ac[_0x4521('0x64')]=isNaN(_0x2c7b20[_0x4521('0x65')])?null:_0x2c7b20[_0x4521('0x65')]*0x3e8;_0x1f36ac[_0x4521('0x66')]=isNaN(_0x2c7b20[_0x4521('0x67')])?null:_0x2c7b20[_0x4521('0x67')];_0x1f36ac[_0x4521('0x68')]=isNaN(_0x2c7b20[_0x4521('0x69')])?null:_0x2c7b20[_0x4521('0x69')];_0x1f36ac[_0x4521('0x6a')]=isNaN(_0x2c7b20[_0x4521('0x6b')])?null:_0x2c7b20[_0x4521('0x6b')];_0x1f36ac[_0x4521('0x6c')]=isNaN(_0x2c7b20[_0x4521('0x6d')])?null:_0x2c7b20[_0x4521('0x6d')];});_0x1ec5d7['on']('dest',function(_0x4697cb){_0x1f36ac['converted_duration']=isNaN(_0x4697cb[_0x4521('0x65')])?null:_0x4697cb['duration']*0x3e8;_0x1f36ac[_0x4521('0x6e')]=isNaN(_0x4697cb[_0x4521('0x67')])?null:_0x4697cb[_0x4521('0x67')];_0x1f36ac['converted_channelCount']=isNaN(_0x4697cb[_0x4521('0x69')])?null:_0x4697cb[_0x4521('0x69')];_0x1f36ac[_0x4521('0x6f')]=isNaN(_0x4697cb[_0x4521('0x6b')])?null:_0x4697cb[_0x4521('0x6b')];_0x1f36ac[_0x4521('0x70')]=isNaN(_0x4697cb[_0x4521('0x6d')])?null:_0x4697cb[_0x4521('0x6d')];});_0x1ec5d7['on'](_0x4521('0x19'),function(){fs[_0x4521('0x60')](_0x38757b,parseInt('0777',0x8));return db['Sound'][_0x4521('0x55')](_0x1f36ac)['then'](function(_0x113e31){var _0x15f10a={'role':_0x2afd92[_0x4521('0x71')][_0x4521('0x72')],'userProfileId':_0x2afd92[_0x4521('0x71')]['userProfileId']};if(!_0x15f10a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15f10a['role']==='user'){var _0x4b80a3=_0x113e31[_0x4521('0x73')]({'plain':!![]});return db[_0x4521('0x74')][_0x4521('0x75')]({'where':{'name':_0x4521('0x76'),'userProfileId':_0x15f10a['userProfileId']},'raw':!![]})['then'](function(_0x21fc11){if(_0x21fc11&&_0x21fc11[_0x4521('0x77')]===0x0){return db['UserProfileResource'][_0x4521('0x55')]({'name':_0x4b80a3['name'],'resourceId':_0x4b80a3['id'],'type':_0x21fc11[_0x4521('0x29')],'sectionId':_0x21fc11['id']},{})['then'](function(){return _0x113e31;});}else{return _0x113e31;}})[_0x4521('0x46')](function(_0x2c44f6){logger['error'](_0x4521('0x78'),_0x2c44f6);throw _0x2c44f6;});}return _0x113e31;})['then'](respondWithResult(_0x3176dd,null))['catch'](handleError(_0x3176dd,null));});_0x1ec5d7[_0x4521('0x79')]();}catch(_0x405e04){_0x3176dd[_0x4521('0x18')](0x1f4)[_0x4521('0x2a')](_0x405e04);}};exports[_0x4521('0x23')]=function(_0x496cd7,_0x411c65,_0x3f72c6){return db[_0x4521('0x2b')][_0x4521('0x75')]({'where':{'id':_0x496cd7[_0x4521('0x48')]['id']}})['then'](handleEntityNotFound(_0x411c65,null))[_0x4521('0x25')](saveUpdates(_[_0x4521('0x3c')](_0x496cd7['body'],[_0x4521('0x29'),_0x4521('0x7a')]),null))[_0x4521('0x25')](respondWithResult(_0x411c65,null))[_0x4521('0x46')](handleError(_0x411c65,null));};exports[_0x4521('0x7b')]=function(_0x10613d,_0x5b90a5,_0x2acc7e){return db['Sound'][_0x4521('0x75')]({'where':{'id':_0x10613d[_0x4521('0x48')]['id']}})[_0x4521('0x25')](function(_0x25828c){if(_0x25828c){return _0x25828c['destroy']();}})[_0x4521('0x25')](function(_0x137c21){var _0x4a89dd=path[_0x4521('0x4c')](config[_0x4521('0x4d')],'server/files/sounds/original',util[_0x4521('0x53')]('%s.%s',_0x137c21[_0x4521('0x4a')],_0x137c21['original_format']));var _0x5ee589=path[_0x4521('0x4c')](config['root'],_0x4521('0x4e'),util['format'](_0x4521('0x54'),_0x137c21['save_name'],_0x137c21[_0x4521('0x4f')]));fs['unlinkSync'](_0x4a89dd);fs['unlinkSync'](_0x5ee589);return _0x137c21;})['then'](function(_0x55d305){if(_0x55d305){return _0x5b90a5[_0x4521('0x18')](0xcc)[_0x4521('0x19')]();}})[_0x4521('0x25')](handleEntityNotFound(_0x5b90a5,null))[_0x4521('0x46')](handleError(_0x5b90a5,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 6e6c7d1..235b7ae 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 _0x8649=['path','rimraf','../../config/environment','./sound.attributes','define','Sound','tools_sounds','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x5c279e,_0x3bedee){var _0x3b3591=function(_0x3e5455){while(--_0x3e5455){_0x5c279e['push'](_0x5c279e['shift']());}};_0x3b3591(++_0x3bedee);}(_0x8649,0xbb));var _0x9864=function(_0x28e952,_0x479804){_0x28e952=_0x28e952-0x0;var _0x237622=_0x8649[_0x28e952];return _0x237622;};'use strict';var _=require(_0x9864('0x0'));var util=require('util');var logger=require(_0x9864('0x1'))('api');var moment=require(_0x9864('0x2'));var BPromise=require(_0x9864('0x3'));var rp=require(_0x9864('0x4'));var fs=require('fs');var path=require(_0x9864('0x5'));var rimraf=require(_0x9864('0x6'));var config=require(_0x9864('0x7'));var attributes=require(_0x9864('0x8'));module['exports']=function(_0x34d814,_0x34226f){return _0x34d814[_0x9864('0x9')](_0x9864('0xa'),attributes,{'tableName':_0x9864('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x116b=['Sound','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./sound.attributes','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x116b,0x151));var _0xb116=function(_0x4d3ec7,_0x3809ff){_0x4d3ec7=_0x4d3ec7-0x0;var _0x4b999f=_0x116b[_0x4d3ec7];return _0x4b999f;};'use strict';var _=require(_0xb116('0x0'));var util=require(_0xb116('0x1'));var logger=require(_0xb116('0x2'))(_0xb116('0x3'));var moment=require(_0xb116('0x4'));var BPromise=require(_0xb116('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb116('0x6'));var config=require(_0xb116('0x7'));var attributes=require(_0xb116('0x8'));module[_0xb116('0x9')]=function(_0x4004a9,_0x1fd0f5){return _0x4004a9[_0xb116('0xa')](_0xb116('0xb'),attributes,{'tableName':'tools_sounds','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 11f9088..68f507f 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 _0xddf6=['rpc','client','then','info','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','Sound,\x20%s,\x20%s','message','catch','ShowSound','find','options','where','include','model','attributes','map','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x220481,_0x3e36b3){var _0x5eaa31=function(_0xa63fe1){while(--_0xa63fe1){_0x220481['push'](_0x220481['shift']());}};_0x5eaa31(++_0x3e36b3);}(_0xddf6,0xc2));var _0x6ddf=function(_0xf50f6a,_0x6f0d68){_0xf50f6a=_0xf50f6a-0x0;var _0xec2f6e=_0xddf6[_0xf50f6a];return _0xec2f6e;};'use strict';var _=require(_0x6ddf('0x0'));var util=require(_0x6ddf('0x1'));var moment=require(_0x6ddf('0x2'));var BPromise=require(_0x6ddf('0x3'));var rs=require(_0x6ddf('0x4'));var fs=require('fs');var Redis=require(_0x6ddf('0x5'));var db=require(_0x6ddf('0x6'))['db'];var utils=require(_0x6ddf('0x7'));var logger=require(_0x6ddf('0x8'))(_0x6ddf('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6ddf('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4db342,_0x4164f8,_0x2d7b5e){return new BPromise(function(_0x2ad884,_0x133354){return client['request'](_0x4db342,_0x2d7b5e)[_0x6ddf('0xb')](function(_0x21a646){logger[_0x6ddf('0xc')]('Sound,\x20%s,\x20%s',_0x4164f8,_0x6ddf('0xd'));logger['debug'](_0x6ddf('0xe'),_0x4164f8,_0x6ddf('0xd'),JSON[_0x6ddf('0xf')](_0x21a646));if(_0x21a646[_0x6ddf('0x10')]){if(_0x21a646[_0x6ddf('0x10')]['code']===0x1f4){logger['error'](_0x6ddf('0x11'),_0x4164f8,_0x21a646['error']['message']);return _0x133354(_0x21a646['error'][_0x6ddf('0x12')]);}logger['error'](_0x6ddf('0x11'),_0x4164f8,_0x21a646[_0x6ddf('0x10')]['message']);return _0x2ad884(_0x21a646[_0x6ddf('0x10')][_0x6ddf('0x12')]);}else{logger['info'](_0x6ddf('0x11'),_0x4164f8,_0x6ddf('0xd'));_0x2ad884(_0x21a646['result'][_0x6ddf('0x12')]);}})[_0x6ddf('0x13')](function(_0x476c93){logger[_0x6ddf('0x10')](_0x6ddf('0x11'),_0x4164f8,_0x476c93);_0x133354(_0x476c93);});});}exports[_0x6ddf('0x14')]=function(_0x414691){var _0x3b8931=this;return new Promise(function(_0x106aae,_0x1cdd45){return db['Sound'][_0x6ddf('0x15')]({'raw':_0x414691['options']?_0x414691['options']['raw']===undefined?!![]:![]:!![],'where':_0x414691[_0x6ddf('0x16')]?_0x414691[_0x6ddf('0x16')][_0x6ddf('0x17')]||null:null,'attributes':_0x414691[_0x6ddf('0x16')]?_0x414691['options']['attributes']||null:null,'include':_0x414691[_0x6ddf('0x16')]?_0x414691['options'][_0x6ddf('0x18')]?_['map'](_0x414691[_0x6ddf('0x16')][_0x6ddf('0x18')],function(_0x1ac5ef){return{'model':db[_0x1ac5ef[_0x6ddf('0x19')]],'as':_0x1ac5ef['as'],'attributes':_0x1ac5ef[_0x6ddf('0x1a')],'include':_0x1ac5ef[_0x6ddf('0x18')]?_[_0x6ddf('0x1b')](_0x1ac5ef['include'],function(_0x42e682){return{'model':db[_0x42e682['model']],'as':_0x42e682['as'],'attributes':_0x42e682[_0x6ddf('0x1a')],'include':_0x42e682['include']?_[_0x6ddf('0x1b')](_0x42e682[_0x6ddf('0x18')],function(_0x11b9ec){return{'model':db[_0x11b9ec[_0x6ddf('0x19')]],'as':_0x11b9ec['as'],'attributes':_0x11b9ec['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ddf('0xb')](function(_0x86bfbd){logger[_0x6ddf('0xc')](_0x6ddf('0x14'),_0x414691);logger[_0x6ddf('0x1c')](_0x6ddf('0x14'),_0x414691,JSON[_0x6ddf('0xf')](_0x86bfbd));_0x106aae(_0x86bfbd);})[_0x6ddf('0x13')](function(_0xf54b68){logger[_0x6ddf('0x10')](_0x6ddf('0x14'),_0xf54b68[_0x6ddf('0x12')],_0x414691);_0x1cdd45(_0x3b8931['error'](0x1f4,_0xf54b68[_0x6ddf('0x12')]));});});}; \ No newline at end of file +var _0x844a=['attributes','model','include','map','ShowSound','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','Sound,\x20%s,\x20%s','message','result','catch','Sound','find','options','raw','where'];(function(_0x4400bf,_0x3dae8a){var _0x5aa062=function(_0x114528){while(--_0x114528){_0x4400bf['push'](_0x4400bf['shift']());}};_0x5aa062(++_0x3dae8a);}(_0x844a,0x10d));var _0xa844=function(_0x1a1bbb,_0x460ac7){_0x1a1bbb=_0x1a1bbb-0x0;var _0x2ce248=_0x844a[_0x1a1bbb];return _0x2ce248;};'use strict';var _=require(_0xa844('0x0'));var util=require(_0xa844('0x1'));var moment=require(_0xa844('0x2'));var BPromise=require('bluebird');var rs=require(_0xa844('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa844('0x4'))['db'];var utils=require(_0xa844('0x5'));var logger=require(_0xa844('0x6'))(_0xa844('0x7'));var config=require(_0xa844('0x8'));var jayson=require(_0xa844('0x9'));var client=jayson['client'][_0xa844('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e7fd9,_0x546533,_0x31ed1e){return new BPromise(function(_0x22eb0c,_0xe846b8){return client[_0xa844('0xb')](_0x5e7fd9,_0x31ed1e)[_0xa844('0xc')](function(_0x2d5b33){logger[_0xa844('0xd')]('Sound,\x20%s,\x20%s',_0x546533,_0xa844('0xe'));logger[_0xa844('0xf')](_0xa844('0x10'),_0x546533,_0xa844('0xe'),JSON['stringify'](_0x2d5b33));if(_0x2d5b33[_0xa844('0x11')]){if(_0x2d5b33[_0xa844('0x11')][_0xa844('0x12')]===0x1f4){logger[_0xa844('0x11')](_0xa844('0x13'),_0x546533,_0x2d5b33[_0xa844('0x11')]['message']);return _0xe846b8(_0x2d5b33['error']['message']);}logger['error'](_0xa844('0x13'),_0x546533,_0x2d5b33[_0xa844('0x11')][_0xa844('0x14')]);return _0x22eb0c(_0x2d5b33[_0xa844('0x11')][_0xa844('0x14')]);}else{logger[_0xa844('0xd')](_0xa844('0x13'),_0x546533,_0xa844('0xe'));_0x22eb0c(_0x2d5b33[_0xa844('0x15')][_0xa844('0x14')]);}})[_0xa844('0x16')](function(_0x23c178){logger[_0xa844('0x11')]('Sound,\x20%s,\x20%s',_0x546533,_0x23c178);_0xe846b8(_0x23c178);});});}exports['ShowSound']=function(_0x4cba45){var _0x64c908=this;return new Promise(function(_0x3c31a5,_0x3b054f){return db[_0xa844('0x17')][_0xa844('0x18')]({'raw':_0x4cba45['options']?_0x4cba45[_0xa844('0x19')][_0xa844('0x1a')]===undefined?!![]:![]:!![],'where':_0x4cba45[_0xa844('0x19')]?_0x4cba45['options'][_0xa844('0x1b')]||null:null,'attributes':_0x4cba45[_0xa844('0x19')]?_0x4cba45[_0xa844('0x19')][_0xa844('0x1c')]||null:null,'include':_0x4cba45[_0xa844('0x19')]?_0x4cba45[_0xa844('0x19')]['include']?_['map'](_0x4cba45[_0xa844('0x19')]['include'],function(_0x595a0a){return{'model':db[_0x595a0a[_0xa844('0x1d')]],'as':_0x595a0a['as'],'attributes':_0x595a0a[_0xa844('0x1c')],'include':_0x595a0a['include']?_['map'](_0x595a0a[_0xa844('0x1e')],function(_0x94ee28){return{'model':db[_0x94ee28[_0xa844('0x1d')]],'as':_0x94ee28['as'],'attributes':_0x94ee28[_0xa844('0x1c')],'include':_0x94ee28[_0xa844('0x1e')]?_[_0xa844('0x1f')](_0x94ee28['include'],function(_0x10d0ed){return{'model':db[_0x10d0ed['model']],'as':_0x10d0ed['as'],'attributes':_0x10d0ed['attributes']};}):[]};}):[]};}):[]:[]})[_0xa844('0xc')](function(_0x163eb9){logger[_0xa844('0xd')](_0xa844('0x20'),_0x4cba45);logger[_0xa844('0xf')](_0xa844('0x20'),_0x4cba45,JSON['stringify'](_0x163eb9));_0x3c31a5(_0x163eb9);})['catch'](function(_0x965b21){logger[_0xa844('0x11')](_0xa844('0x20'),_0x965b21[_0xa844('0x14')],_0x4cba45);_0x3b054f(_0x64c908[_0xa844('0x11')](0x1f4,_0x965b21[_0xa844('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 70383d6..40985a2 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 _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2f4c1c,_0x5a3dd4){var _0x25e0f2=function(_0x46ea31){while(--_0x46ea31){_0x2f4c1c['push'](_0x2f4c1c['shift']());}};_0x25e0f2(++_0x5a3dd4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4a4922,_0x82cb8f){_0x4a4922=_0x4a4922-0x0;var _0x55a8c6=_0x0b0e[_0x4a4922];return _0x55a8c6;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=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(_0xd1d8f1,_0x422f15){var _0x3f758e=function(_0x5ef782){while(--_0x5ef782){_0xd1d8f1['push'](_0xd1d8f1['shift']());}};_0x3f758e(++_0x422f15);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xb7e7[_0x34bf97];return _0x292719;};'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 2e9a5e5..a3f2f22 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 _0x8dd8=['out','exports','TEXT','ENUM'];(function(_0x4817f9,_0x4070d1){var _0x2dcfa6=function(_0x408973){while(--_0x408973){_0x4817f9['push'](_0x4817f9['shift']());}};_0x2dcfa6(++_0x4070d1);}(_0x8dd8,0x121));var _0x88dd=function(_0x104f90,_0xcd8dc4){_0x104f90=_0x104f90-0x0;var _0x1e9b9f=_0x8dd8[_0x104f90];return _0x1e9b9f;};'use strict';var Sequelize=require('sequelize');module[_0x88dd('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x88dd('0x1')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x88dd('0x2')]('in','out'),'defaultValue':_0x88dd('0x3'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x88dd('0x1')]}}; \ No newline at end of file +var _0xc423=['TEXT','medium','out','STRING'];(function(_0x3a1f57,_0x2d5287){var _0x121d30=function(_0x39540a){while(--_0x39540a){_0x3a1f57['push'](_0x3a1f57['shift']());}};_0x121d30(++_0x2d5287);}(_0xc423,0x1bf));var _0x3c42=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xc423[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x3c42('0x0')]},'body':{'type':Sequelize[_0x3c42('0x1')](_0x3c42('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x3c42('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x3c42('0x0')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 15c404b..ebb4bd4 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 _0x685b=['SquareMessage','rawAttributes','key','map','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','count','limit','set','Content-Range','json','apply','save','then','end','sendStatus','error','stack','index'];(function(_0x52d4e7,_0x47f7f4){var _0x52fcbe=function(_0x14af60){while(--_0x14af60){_0x52d4e7['push'](_0x52d4e7['shift']());}};_0x52fcbe(++_0x47f7f4);}(_0x685b,0x199));var _0xb685=function(_0x503f4d,_0x476e97){_0x503f4d=_0x503f4d-0x0;var _0x4ce6d1=_0x685b[_0x503f4d];return _0x4ce6d1;};'use strict';var emlformat=require(_0xb685('0x0'));var rimraf=require(_0xb685('0x1'));var zipdir=require(_0xb685('0x2'));var jsonpatch=require(_0xb685('0x3'));var rp=require(_0xb685('0x4'));var moment=require(_0xb685('0x5'));var BPromise=require(_0xb685('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb685('0x7'));var sox=require(_0xb685('0x8'));var csv=require(_0xb685('0x9'));var ejs=require(_0xb685('0xa'));var fs=require('fs');var fs_extra=require(_0xb685('0xb'));var _=require(_0xb685('0xc'));var squel=require(_0xb685('0xd'));var crypto=require(_0xb685('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb685('0xf'));var toCsv=require(_0xb685('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb685('0x10'));var authService=require(_0xb685('0x11'));var qs=require(_0xb685('0x12'));var as=require(_0xb685('0x13'));var hardwareService=require(_0xb685('0x14'));var logger=require(_0xb685('0x15'))('api');var utils=require(_0xb685('0x16'));var config=require(_0xb685('0x17'));var licenseUtil=require(_0xb685('0x18'));var db=require(_0xb685('0x19'))['db'];function respondWithStatusCode(_0x25a06e,_0x5d4255){_0x5d4255=_0x5d4255||0xcc;return function(_0x35a41e){if(_0x35a41e){return _0x25a06e['sendStatus'](_0x5d4255);}return _0x25a06e[_0xb685('0x1a')](_0x5d4255)['end']();};}function respondWithResult(_0x37400a,_0xfac243){_0xfac243=_0xfac243||0xc8;return function(_0x2a7557){if(_0x2a7557){return _0x37400a[_0xb685('0x1a')](_0xfac243)['json'](_0x2a7557);}};}function respondWithFilteredResult(_0x217c06,_0x5dfa46){return function(_0x2aa19e){if(_0x2aa19e){var _0x1bd88b=typeof _0x5dfa46[_0xb685('0x1b')]==='undefined'&&typeof _0x5dfa46['limit']==='undefined';var _0x24028d=_0x2aa19e[_0xb685('0x1c')];var _0x23f701=_0x1bd88b?0x0:_0x5dfa46['offset'];var _0x111066=_0x1bd88b?_0x2aa19e[_0xb685('0x1c')]:_0x5dfa46[_0xb685('0x1b')]+_0x5dfa46[_0xb685('0x1d')];var _0x2587bc;if(_0x111066>=_0x24028d){_0x111066=_0x24028d;_0x2587bc=0xc8;}else{_0x2587bc=0xce;}_0x217c06[_0xb685('0x1a')](_0x2587bc);return _0x217c06[_0xb685('0x1e')](_0xb685('0x1f'),_0x23f701+'-'+_0x111066+'/'+_0x24028d)[_0xb685('0x20')](_0x2aa19e);}return null;};}function patchUpdates(_0x16032e){return function(_0x1e466f){try{jsonpatch[_0xb685('0x21')](_0x1e466f,_0x16032e,!![]);}catch(_0x394c84){return BPromise['reject'](_0x394c84);}return _0x1e466f[_0xb685('0x22')]();};}function saveUpdates(_0x13f3fc,_0x55e39e){return function(_0xcce887){if(_0xcce887){return _0xcce887['update'](_0x13f3fc)[_0xb685('0x23')](function(_0x24b78b){return _0x24b78b;});}return null;};}function removeEntity(_0x527847,_0x433bb3){return function(_0x5f1532){if(_0x5f1532){return _0x5f1532['destroy']()['then'](function(){_0x527847[_0xb685('0x1a')](0xcc)[_0xb685('0x24')]();});}};}function handleEntityNotFound(_0x42983b,_0x170798){return function(_0x39b1ac){if(!_0x39b1ac){_0x42983b[_0xb685('0x25')](0x194);}return _0x39b1ac;};}function handleError(_0x8f8da3,_0x2ea329){_0x2ea329=_0x2ea329||0x1f4;return function(_0x2ade94){logger[_0xb685('0x26')](_0x2ade94[_0xb685('0x27')]);if(_0x2ade94['name']){delete _0x2ade94['name'];}_0x8f8da3[_0xb685('0x1a')](_0x2ea329)['send'](_0x2ade94);};}exports[_0xb685('0x28')]=function(_0x42e6eb,_0x52b321){var _0x20dce7={},_0x13c91e={},_0x3af7c5={'count':0x0,'rows':[]};var _0x31cb04=_['map'](db[_0xb685('0x29')][_0xb685('0x2a')],function(_0x1747d5){return{'name':_0x1747d5['fieldName'],'type':_0x1747d5['type'][_0xb685('0x2b')]};});_0x13c91e['model']=_[_0xb685('0x2c')](_0x31cb04,_0xb685('0x2d'));_0x13c91e[_0xb685('0x2e')]=_[_0xb685('0x2f')](_0x42e6eb[_0xb685('0x2e')]);_0x13c91e[_0xb685('0x30')]=_[_0xb685('0x31')](_0x13c91e[_0xb685('0x32')],_0x13c91e['query']);_0x20dce7[_0xb685('0x33')]=_[_0xb685('0x31')](_0x13c91e[_0xb685('0x32')],qs[_0xb685('0x34')](_0x42e6eb[_0xb685('0x2e')][_0xb685('0x34')]));_0x20dce7[_0xb685('0x33')]=_0x20dce7['attributes'][_0xb685('0x35')]?_0x20dce7[_0xb685('0x33')]:_0x13c91e[_0xb685('0x32')];if(!_0x42e6eb['query'][_0xb685('0x36')](_0xb685('0x37'))){_0x20dce7['limit']=qs['limit'](_0x42e6eb[_0xb685('0x2e')][_0xb685('0x1d')]);_0x20dce7['offset']=qs['offset'](_0x42e6eb[_0xb685('0x2e')][_0xb685('0x1b')]);}_0x20dce7[_0xb685('0x38')]=qs[_0xb685('0x39')](_0x42e6eb[_0xb685('0x2e')][_0xb685('0x39')]);_0x20dce7[_0xb685('0x3a')]=qs[_0xb685('0x30')](_['pick'](_0x42e6eb[_0xb685('0x2e')],_0x13c91e[_0xb685('0x30')]),_0x31cb04);if(_0x42e6eb[_0xb685('0x2e')][_0xb685('0x3b')]){_0x20dce7[_0xb685('0x3a')]=_[_0xb685('0x3c')](_0x20dce7[_0xb685('0x3a')],{'$or':_[_0xb685('0x2c')](_0x31cb04,function(_0x2bd0fc){if(_0x2bd0fc[_0xb685('0x3d')]!==_0xb685('0x3e')){var _0x34fbfc={};_0x34fbfc[_0x2bd0fc['name']]={'$like':'%'+_0x42e6eb[_0xb685('0x2e')][_0xb685('0x3b')]+'%'};return _0x34fbfc;}})});}_0x20dce7=_[_0xb685('0x3c')]({},_0x20dce7,_0x42e6eb[_0xb685('0x3f')]);var _0x568555={'where':_0x20dce7[_0xb685('0x3a')]};return db['SquareMessage'][_0xb685('0x1c')](_0x568555)[_0xb685('0x23')](function(_0xd71ab5){_0x3af7c5[_0xb685('0x1c')]=_0xd71ab5;if(_0x42e6eb['query'][_0xb685('0x40')]){_0x20dce7[_0xb685('0x41')]=[{'all':!![]}];}return db['SquareMessage'][_0xb685('0x42')](_0x20dce7);})[_0xb685('0x23')](function(_0x562d12){_0x3af7c5[_0xb685('0x43')]=_0x562d12;return _0x3af7c5;})[_0xb685('0x23')](respondWithFilteredResult(_0x52b321,_0x20dce7))[_0xb685('0x44')](handleError(_0x52b321,null));};exports[_0xb685('0x45')]=function(_0x329cdb,_0x50c226){var _0x75abc7={'raw':!![],'where':{'id':_0x329cdb[_0xb685('0x46')]['id']}},_0x32b337={};_0x32b337[_0xb685('0x32')]=_['keys'](db[_0xb685('0x29')]['rawAttributes']);_0x32b337[_0xb685('0x2e')]=_[_0xb685('0x2f')](_0x329cdb[_0xb685('0x2e')]);_0x32b337[_0xb685('0x30')]=_[_0xb685('0x31')](_0x32b337[_0xb685('0x32')],_0x32b337[_0xb685('0x2e')]);_0x75abc7[_0xb685('0x33')]=_[_0xb685('0x31')](_0x32b337[_0xb685('0x32')],qs[_0xb685('0x34')](_0x329cdb[_0xb685('0x2e')][_0xb685('0x34')]));_0x75abc7[_0xb685('0x33')]=_0x75abc7[_0xb685('0x33')][_0xb685('0x35')]?_0x75abc7[_0xb685('0x33')]:_0x32b337['model'];if(_0x329cdb['query'][_0xb685('0x40')]){_0x75abc7[_0xb685('0x41')]=[{'all':!![]}];}_0x75abc7=_[_0xb685('0x3c')]({},_0x75abc7,_0x329cdb[_0xb685('0x3f')]);return db[_0xb685('0x29')]['find'](_0x75abc7)[_0xb685('0x23')](handleEntityNotFound(_0x50c226,null))[_0xb685('0x23')](respondWithResult(_0x50c226,null))[_0xb685('0x44')](handleError(_0x50c226,null));};exports[_0xb685('0x47')]=function(_0x544b0f,_0x120c92){return db[_0xb685('0x29')]['create'](_0x544b0f[_0xb685('0x48')],{})[_0xb685('0x23')](respondWithResult(_0x120c92,0xc9))['catch'](handleError(_0x120c92,null));};exports[_0xb685('0x49')]=function(_0x317d8b,_0x16c306){if(_0x317d8b[_0xb685('0x48')]['id']){delete _0x317d8b[_0xb685('0x48')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x317d8b[_0xb685('0x46')]['id']}})['then'](handleEntityNotFound(_0x16c306,null))[_0xb685('0x23')](saveUpdates(_0x317d8b[_0xb685('0x48')],null))[_0xb685('0x23')](respondWithResult(_0x16c306,null))[_0xb685('0x44')](handleError(_0x16c306,null));};exports[_0xb685('0x4a')]=function(_0x1e433f,_0x57a798){return db[_0xb685('0x29')]['find']({'where':{'id':_0x1e433f['params']['id']}})[_0xb685('0x23')](handleEntityNotFound(_0x57a798,null))['then'](removeEntity(_0x57a798,null))['catch'](handleError(_0x57a798,null));}; \ No newline at end of file +var _0xe0bf=['hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','sendStatus','undefined','limit','count','offset','set','Content-Range','json','apply','update','then','destroy','end','error','name','status','send','index','map','SquareMessage','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length'];(function(_0x157495,_0xdfe964){var _0x2b64df=function(_0x3d6647){while(--_0x3d6647){_0x157495['push'](_0x157495['shift']());}};_0x2b64df(++_0xdfe964);}(_0xe0bf,0x168));var _0xfe0b=function(_0x51dd10,_0x544c73){_0x51dd10=_0x51dd10-0x0;var _0x224296=_0xe0bf[_0x51dd10];return _0x224296;};'use strict';var emlformat=require(_0xfe0b('0x0'));var rimraf=require(_0xfe0b('0x1'));var zipdir=require(_0xfe0b('0x2'));var jsonpatch=require(_0xfe0b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfe0b('0x4'));var util=require(_0xfe0b('0x5'));var path=require(_0xfe0b('0x6'));var sox=require('sox');var csv=require(_0xfe0b('0x7'));var ejs=require(_0xfe0b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe0b('0x9'));var squel=require('squel');var crypto=require(_0xfe0b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfe0b('0xb'));var toCsv=require(_0xfe0b('0x7'));var querystring=require(_0xfe0b('0xc'));var Papa=require(_0xfe0b('0xd'));var Redis=require(_0xfe0b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfe0b('0xf'));var as=require(_0xfe0b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xfe0b('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182a53,_0x2df0fd){_0x2df0fd=_0x2df0fd||0xcc;return function(_0x44f93b){if(_0x44f93b){return _0x182a53[_0xfe0b('0x12')](_0x2df0fd);}return _0x182a53['status'](_0x2df0fd)['end']();};}function respondWithResult(_0x1db234,_0x487cb3){_0x487cb3=_0x487cb3||0xc8;return function(_0x4dda83){if(_0x4dda83){return _0x1db234['status'](_0x487cb3)['json'](_0x4dda83);}};}function respondWithFilteredResult(_0x3f836b,_0x2da179){return function(_0x2ecf5f){if(_0x2ecf5f){var _0x5e949b=typeof _0x2da179['offset']===_0xfe0b('0x13')&&typeof _0x2da179[_0xfe0b('0x14')]===_0xfe0b('0x13');var _0x1758dc=_0x2ecf5f[_0xfe0b('0x15')];var _0x498a34=_0x5e949b?0x0:_0x2da179['offset'];var _0x558c7f=_0x5e949b?_0x2ecf5f['count']:_0x2da179[_0xfe0b('0x16')]+_0x2da179[_0xfe0b('0x14')];var _0x277ba1;if(_0x558c7f>=_0x1758dc){_0x558c7f=_0x1758dc;_0x277ba1=0xc8;}else{_0x277ba1=0xce;}_0x3f836b['status'](_0x277ba1);return _0x3f836b[_0xfe0b('0x17')](_0xfe0b('0x18'),_0x498a34+'-'+_0x558c7f+'/'+_0x1758dc)[_0xfe0b('0x19')](_0x2ecf5f);}return null;};}function patchUpdates(_0x3efa7f){return function(_0x4dc835){try{jsonpatch[_0xfe0b('0x1a')](_0x4dc835,_0x3efa7f,!![]);}catch(_0x572e51){return BPromise['reject'](_0x572e51);}return _0x4dc835['save']();};}function saveUpdates(_0x7eef60,_0x5f4359){return function(_0x175672){if(_0x175672){return _0x175672[_0xfe0b('0x1b')](_0x7eef60)[_0xfe0b('0x1c')](function(_0x37d31b){return _0x37d31b;});}return null;};}function removeEntity(_0x366ade,_0x34554c){return function(_0x143031){if(_0x143031){return _0x143031[_0xfe0b('0x1d')]()[_0xfe0b('0x1c')](function(){_0x366ade['status'](0xcc)[_0xfe0b('0x1e')]();});}};}function handleEntityNotFound(_0x52b77b,_0xa02f96){return function(_0x1dcdf4){if(!_0x1dcdf4){_0x52b77b['sendStatus'](0x194);}return _0x1dcdf4;};}function handleError(_0x28f038,_0x453c93){_0x453c93=_0x453c93||0x1f4;return function(_0x183fbf){logger[_0xfe0b('0x1f')](_0x183fbf['stack']);if(_0x183fbf[_0xfe0b('0x20')]){delete _0x183fbf['name'];}_0x28f038[_0xfe0b('0x21')](_0x453c93)[_0xfe0b('0x22')](_0x183fbf);};}exports[_0xfe0b('0x23')]=function(_0x1dfc47,_0x4f3f56){var _0x4a5533={},_0x570a4e={},_0x516163={'count':0x0,'rows':[]};var _0x10e9a0=_[_0xfe0b('0x24')](db[_0xfe0b('0x25')][_0xfe0b('0x26')],function(_0x59ba11){return{'name':_0x59ba11['fieldName'],'type':_0x59ba11[_0xfe0b('0x27')]['key']};});_0x570a4e[_0xfe0b('0x28')]=_[_0xfe0b('0x24')](_0x10e9a0,_0xfe0b('0x20'));_0x570a4e[_0xfe0b('0x29')]=_[_0xfe0b('0x2a')](_0x1dfc47['query']);_0x570a4e[_0xfe0b('0x2b')]=_['intersection'](_0x570a4e[_0xfe0b('0x28')],_0x570a4e[_0xfe0b('0x29')]);_0x4a5533[_0xfe0b('0x2c')]=_[_0xfe0b('0x2d')](_0x570a4e[_0xfe0b('0x28')],qs[_0xfe0b('0x2e')](_0x1dfc47[_0xfe0b('0x29')][_0xfe0b('0x2e')]));_0x4a5533[_0xfe0b('0x2c')]=_0x4a5533[_0xfe0b('0x2c')][_0xfe0b('0x2f')]?_0x4a5533[_0xfe0b('0x2c')]:_0x570a4e[_0xfe0b('0x28')];if(!_0x1dfc47[_0xfe0b('0x29')][_0xfe0b('0x30')](_0xfe0b('0x31'))){_0x4a5533[_0xfe0b('0x14')]=qs[_0xfe0b('0x14')](_0x1dfc47[_0xfe0b('0x29')][_0xfe0b('0x14')]);_0x4a5533['offset']=qs[_0xfe0b('0x16')](_0x1dfc47[_0xfe0b('0x29')][_0xfe0b('0x16')]);}_0x4a5533[_0xfe0b('0x32')]=qs[_0xfe0b('0x33')](_0x1dfc47['query'][_0xfe0b('0x33')]);_0x4a5533['where']=qs[_0xfe0b('0x2b')](_[_0xfe0b('0x34')](_0x1dfc47[_0xfe0b('0x29')],_0x570a4e[_0xfe0b('0x2b')]),_0x10e9a0);if(_0x1dfc47[_0xfe0b('0x29')][_0xfe0b('0x35')]){_0x4a5533[_0xfe0b('0x36')]=_['merge'](_0x4a5533['where'],{'$or':_[_0xfe0b('0x24')](_0x10e9a0,function(_0x56bd26){if(_0x56bd26[_0xfe0b('0x27')]!==_0xfe0b('0x37')){var _0x4c1375={};_0x4c1375[_0x56bd26[_0xfe0b('0x20')]]={'$like':'%'+_0x1dfc47[_0xfe0b('0x29')][_0xfe0b('0x35')]+'%'};return _0x4c1375;}})});}_0x4a5533=_[_0xfe0b('0x38')]({},_0x4a5533,_0x1dfc47['options']);var _0x359cc0={'where':_0x4a5533[_0xfe0b('0x36')]};return db['SquareMessage'][_0xfe0b('0x15')](_0x359cc0)[_0xfe0b('0x1c')](function(_0x44cbbe){_0x516163[_0xfe0b('0x15')]=_0x44cbbe;if(_0x1dfc47[_0xfe0b('0x29')]['includeAll']){_0x4a5533[_0xfe0b('0x39')]=[{'all':!![]}];}return db[_0xfe0b('0x25')][_0xfe0b('0x3a')](_0x4a5533);})[_0xfe0b('0x1c')](function(_0x4cf1ec){_0x516163[_0xfe0b('0x3b')]=_0x4cf1ec;return _0x516163;})[_0xfe0b('0x1c')](respondWithFilteredResult(_0x4f3f56,_0x4a5533))[_0xfe0b('0x3c')](handleError(_0x4f3f56,null));};exports[_0xfe0b('0x3d')]=function(_0x29c610,_0x3962a3){var _0x119181={'raw':!![],'where':{'id':_0x29c610[_0xfe0b('0x3e')]['id']}},_0x3b9195={};_0x3b9195['model']=_[_0xfe0b('0x2a')](db['SquareMessage'][_0xfe0b('0x26')]);_0x3b9195[_0xfe0b('0x29')]=_[_0xfe0b('0x2a')](_0x29c610[_0xfe0b('0x29')]);_0x3b9195['filters']=_[_0xfe0b('0x2d')](_0x3b9195[_0xfe0b('0x28')],_0x3b9195['query']);_0x119181[_0xfe0b('0x2c')]=_[_0xfe0b('0x2d')](_0x3b9195[_0xfe0b('0x28')],qs[_0xfe0b('0x2e')](_0x29c610[_0xfe0b('0x29')][_0xfe0b('0x2e')]));_0x119181[_0xfe0b('0x2c')]=_0x119181[_0xfe0b('0x2c')][_0xfe0b('0x2f')]?_0x119181[_0xfe0b('0x2c')]:_0x3b9195['model'];if(_0x29c610[_0xfe0b('0x29')][_0xfe0b('0x3f')]){_0x119181['include']=[{'all':!![]}];}_0x119181=_['merge']({},_0x119181,_0x29c610[_0xfe0b('0x40')]);return db[_0xfe0b('0x25')][_0xfe0b('0x41')](_0x119181)[_0xfe0b('0x1c')](handleEntityNotFound(_0x3962a3,null))['then'](respondWithResult(_0x3962a3,null))['catch'](handleError(_0x3962a3,null));};exports[_0xfe0b('0x42')]=function(_0x30750a,_0x13b572){return db['SquareMessage']['create'](_0x30750a['body'],{})[_0xfe0b('0x1c')](respondWithResult(_0x13b572,0xc9))[_0xfe0b('0x3c')](handleError(_0x13b572,null));};exports[_0xfe0b('0x1b')]=function(_0x4e371f,_0x39c537){if(_0x4e371f[_0xfe0b('0x43')]['id']){delete _0x4e371f[_0xfe0b('0x43')]['id'];}return db[_0xfe0b('0x25')][_0xfe0b('0x41')]({'where':{'id':_0x4e371f[_0xfe0b('0x3e')]['id']}})[_0xfe0b('0x1c')](handleEntityNotFound(_0x39c537,null))[_0xfe0b('0x1c')](saveUpdates(_0x4e371f['body'],null))[_0xfe0b('0x1c')](respondWithResult(_0x39c537,null))[_0xfe0b('0x3c')](handleError(_0x39c537,null));};exports[_0xfe0b('0x1d')]=function(_0x1c8615,_0x3495c3){return db['SquareMessage'][_0xfe0b('0x41')]({'where':{'id':_0x1c8615[_0xfe0b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3495c3,null))[_0xfe0b('0x1c')](removeEntity(_0x3495c3,null))[_0xfe0b('0x3c')](handleError(_0x3495c3,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 628a305..b8eaebe 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 _0x67b8=['bluebird','path','../../config/environment','exports','SquareMessage','square_messages','util','../../config/logger','api','moment'];(function(_0x2e6a70,_0x29209c){var _0x2043ba=function(_0x1057a3){while(--_0x1057a3){_0x2e6a70['push'](_0x2e6a70['shift']());}};_0x2043ba(++_0x29209c);}(_0x67b8,0x15a));var _0x867b=function(_0x34461e,_0x44b85b){_0x34461e=_0x34461e-0x0;var _0xcfc45c=_0x67b8[_0x34461e];return _0xcfc45c;};'use strict';var _=require('lodash');var util=require(_0x867b('0x0'));var logger=require(_0x867b('0x1'))(_0x867b('0x2'));var moment=require(_0x867b('0x3'));var BPromise=require(_0x867b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x867b('0x5'));var rimraf=require('rimraf');var config=require(_0x867b('0x6'));var attributes=require('./squareMessage.attributes');module[_0x867b('0x7')]=function(_0x195ee5,_0x1aa976){return _0x195ee5['define'](_0x867b('0x8'),attributes,{'tableName':_0x867b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd21c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0xd21c,0x1e7));var _0xcd21=function(_0x49372d,_0x21e0bf){_0x49372d=_0x49372d-0x0;var _0x4cccf9=_0xd21c[_0x49372d];return _0x4cccf9;};'use strict';var _=require(_0xcd21('0x0'));var util=require(_0xcd21('0x1'));var logger=require(_0xcd21('0x2'))('api');var moment=require(_0xcd21('0x3'));var BPromise=require(_0xcd21('0x4'));var rp=require(_0xcd21('0x5'));var fs=require('fs');var path=require(_0xcd21('0x6'));var rimraf=require(_0xcd21('0x7'));var config=require(_0xcd21('0x8'));var attributes=require(_0xcd21('0x9'));module[_0xcd21('0xa')]=function(_0x2e533d,_0x3e0d88){return _0x2e533d[_0xcd21('0xb')](_0xcd21('0xc'),attributes,{'tableName':_0xcd21('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index fd75cc6..8cb3fc3 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 _0x0951=['raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareMessage','SquareMessage','create','options'];(function(_0x40e6c9,_0x2c8520){var _0x26919e=function(_0xf88e47){while(--_0xf88e47){_0x40e6c9['push'](_0x40e6c9['shift']());}};_0x26919e(++_0x2c8520);}(_0x0951,0x1a1));var _0x1095=function(_0x44dda2,_0x3d8e5c){_0x44dda2=_0x44dda2-0x0;var _0x294556=_0x0951[_0x44dda2];return _0x294556;};'use strict';var _=require(_0x1095('0x0'));var util=require(_0x1095('0x1'));var moment=require(_0x1095('0x2'));var BPromise=require(_0x1095('0x3'));var rs=require(_0x1095('0x4'));var fs=require('fs');var Redis=require(_0x1095('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1095('0x6'));var logger=require(_0x1095('0x7'))(_0x1095('0x8'));var config=require('../../config/environment');var jayson=require(_0x1095('0x9'));var client=jayson['client'][_0x1095('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x343a44,_0xa9c37,_0x218422){return new BPromise(function(_0x2fd040,_0x3290ca){return client[_0x1095('0xb')](_0x343a44,_0x218422)[_0x1095('0xc')](function(_0x2fcec7){logger[_0x1095('0xd')](_0x1095('0xe'),_0xa9c37,_0x1095('0xf'));logger['debug'](_0x1095('0x10'),_0xa9c37,_0x1095('0xf'),JSON[_0x1095('0x11')](_0x2fcec7));if(_0x2fcec7['error']){if(_0x2fcec7[_0x1095('0x12')]['code']===0x1f4){logger[_0x1095('0x12')](_0x1095('0xe'),_0xa9c37,_0x2fcec7[_0x1095('0x12')][_0x1095('0x13')]);return _0x3290ca(_0x2fcec7[_0x1095('0x12')]['message']);}logger['error'](_0x1095('0xe'),_0xa9c37,_0x2fcec7[_0x1095('0x12')]['message']);return _0x2fd040(_0x2fcec7[_0x1095('0x12')][_0x1095('0x13')]);}else{logger[_0x1095('0xd')](_0x1095('0xe'),_0xa9c37,_0x1095('0xf'));_0x2fd040(_0x2fcec7['result']['message']);}})[_0x1095('0x14')](function(_0x4b4edd){logger[_0x1095('0x12')]('SquareMessage,\x20%s,\x20%s',_0xa9c37,_0x4b4edd);_0x3290ca(_0x4b4edd);});});}exports[_0x1095('0x15')]=function(_0x8845e6){var _0x1c485e=this;return new Promise(function(_0x555969,_0x641b5){return db[_0x1095('0x16')][_0x1095('0x17')](_0x8845e6['body'],{'raw':_0x8845e6[_0x1095('0x18')]?_0x8845e6[_0x1095('0x18')][_0x1095('0x19')]===undefined?!![]:![]:!![]})[_0x1095('0xc')](function(_0x2b4d20){logger[_0x1095('0xd')](_0x1095('0x15'),_0x8845e6);logger['debug'](_0x1095('0x15'),_0x8845e6,JSON[_0x1095('0x11')](_0x2b4d20));_0x555969(_0x2b4d20);})[_0x1095('0x14')](function(_0x35a10c){logger['error']('CreateSquareMessage',_0x35a10c[_0x1095('0x13')],_0x8845e6);_0x641b5(_0x1c485e[_0x1095('0x12')](0x1f4,_0x35a10c[_0x1095('0x13')]));});});}; \ No newline at end of file +var _0xe2d0=['SquareMessage','create','body','options','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2d0,0xbb));var _0x0e2d=function(_0x2690d4,_0x52a083){_0x2690d4=_0x2690d4-0x0;var _0x517a4b=_0xe2d0[_0x2690d4];return _0x517a4b;};'use strict';var _=require('lodash');var util=require(_0x0e2d('0x0'));var moment=require('moment');var BPromise=require(_0x0e2d('0x1'));var rs=require(_0x0e2d('0x2'));var fs=require('fs');var Redis=require(_0x0e2d('0x3'));var db=require(_0x0e2d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e2d('0x5'))(_0x0e2d('0x6'));var config=require('../../config/environment');var jayson=require(_0x0e2d('0x7'));var client=jayson[_0x0e2d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a98b3,_0x2cd4a0,_0xb575eb){return new BPromise(function(_0x1a5c04,_0x4cc5f9){return client[_0x0e2d('0x9')](_0x1a98b3,_0xb575eb)[_0x0e2d('0xa')](function(_0x2aa629){logger[_0x0e2d('0xb')]('SquareMessage,\x20%s,\x20%s',_0x2cd4a0,_0x0e2d('0xc'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x2cd4a0,_0x0e2d('0xc'),JSON[_0x0e2d('0xd')](_0x2aa629));if(_0x2aa629[_0x0e2d('0xe')]){if(_0x2aa629[_0x0e2d('0xe')][_0x0e2d('0xf')]===0x1f4){logger['error'](_0x0e2d('0x10'),_0x2cd4a0,_0x2aa629['error'][_0x0e2d('0x11')]);return _0x4cc5f9(_0x2aa629[_0x0e2d('0xe')][_0x0e2d('0x11')]);}logger[_0x0e2d('0xe')]('SquareMessage,\x20%s,\x20%s',_0x2cd4a0,_0x2aa629[_0x0e2d('0xe')]['message']);return _0x1a5c04(_0x2aa629[_0x0e2d('0xe')][_0x0e2d('0x11')]);}else{logger[_0x0e2d('0xb')](_0x0e2d('0x10'),_0x2cd4a0,'request\x20sent');_0x1a5c04(_0x2aa629[_0x0e2d('0x12')][_0x0e2d('0x11')]);}})[_0x0e2d('0x13')](function(_0x229cbc){logger[_0x0e2d('0xe')](_0x0e2d('0x10'),_0x2cd4a0,_0x229cbc);_0x4cc5f9(_0x229cbc);});});}exports[_0x0e2d('0x14')]=function(_0x1dd19c){var _0x4588b2=this;return new Promise(function(_0x1704be,_0x12102f){return db[_0x0e2d('0x15')][_0x0e2d('0x16')](_0x1dd19c[_0x0e2d('0x17')],{'raw':_0x1dd19c[_0x0e2d('0x18')]?_0x1dd19c['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x13a36a){logger[_0x0e2d('0xb')](_0x0e2d('0x14'),_0x1dd19c);logger[_0x0e2d('0x19')]('CreateSquareMessage',_0x1dd19c,JSON[_0x0e2d('0xd')](_0x13a36a));_0x1704be(_0x13a36a);})[_0x0e2d('0x13')](function(_0x4edc69){logger[_0x0e2d('0xe')](_0x0e2d('0x14'),_0x4edc69[_0x0e2d('0x11')],_0x1dd19c);_0x12102f(_0x4588b2[_0x0e2d('0xe')](0x1f4,_0x4edc69[_0x0e2d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 04d0de6..660d560 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 _0x10f5=['show','/:id/test','15s','test','create','put','update','delete','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id'];(function(_0x50451e,_0x1c12cd){var _0x3a1fde=function(_0x2b36ce){while(--_0x2b36ce){_0x50451e['push'](_0x50451e['shift']());}};_0x3a1fde(++_0x1c12cd);}(_0x10f5,0x15e));var _0x510f=function(_0x36c6a1,_0x41edfc){_0x36c6a1=_0x36c6a1-0x0;var _0x292e0f=_0x10f5[_0x36c6a1];return _0x292e0f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x510f('0x0'));var timeout=require(_0x510f('0x1'));var express=require('express');var router=express[_0x510f('0x2')]();var fs_extra=require(_0x510f('0x3'));var auth=require(_0x510f('0x4'));var interaction=require(_0x510f('0x5'));var config=require('../../config/environment');var controller=require(_0x510f('0x6'));router[_0x510f('0x7')]('/',auth[_0x510f('0x8')](),controller[_0x510f('0x9')]);router[_0x510f('0x7')](_0x510f('0xa'),auth[_0x510f('0x8')](),controller[_0x510f('0xb')]);router[_0x510f('0x7')](_0x510f('0xc'),auth[_0x510f('0x8')](),timeout(_0x510f('0xd')),controller[_0x510f('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x510f('0xf')]);router[_0x510f('0x10')](_0x510f('0xa'),auth[_0x510f('0x8')](),controller[_0x510f('0x11')]);router[_0x510f('0x12')]('/:id',auth[_0x510f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2b63=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b63,0xba));var _0x32b6=function(_0x12a44e,_0x381e1a){_0x12a44e=_0x12a44e-0x0;var _0x222ae1=_0x2b63[_0x12a44e];return _0x222ae1;};'use strict';var multer=require('multer');var util=require(_0x32b6('0x0'));var path=require(_0x32b6('0x1'));var timeout=require(_0x32b6('0x2'));var express=require(_0x32b6('0x3'));var router=express[_0x32b6('0x4')]();var fs_extra=require(_0x32b6('0x5'));var auth=require(_0x32b6('0x6'));var interaction=require(_0x32b6('0x7'));var config=require(_0x32b6('0x8'));var controller=require(_0x32b6('0x9'));router[_0x32b6('0xa')]('/',auth[_0x32b6('0xb')](),controller[_0x32b6('0xc')]);router[_0x32b6('0xa')](_0x32b6('0xd'),auth['isAuthenticated'](),controller[_0x32b6('0xe')]);router[_0x32b6('0xa')](_0x32b6('0xf'),auth['isAuthenticated'](),timeout(_0x32b6('0x10')),controller[_0x32b6('0x11')]);router[_0x32b6('0x12')]('/',auth[_0x32b6('0xb')](),controller[_0x32b6('0x13')]);router[_0x32b6('0x14')]('/:id',auth[_0x32b6('0xb')](),controller[_0x32b6('0x15')]);router[_0x32b6('0x16')](_0x32b6('0xd'),auth[_0x32b6('0xb')](),controller['destroy']);module[_0x32b6('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 6876411..225068e 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 _0xbcc6=['exports','name','STRING','sequelize'];(function(_0x38ef42,_0x2ea01b){var _0x28bb4=function(_0x513bbd){while(--_0x513bbd){_0x38ef42['push'](_0x38ef42['shift']());}};_0x28bb4(++_0x2ea01b);}(_0xbcc6,0x107));var _0x6bcc=function(_0x58ff15,_0xb0640e){_0x58ff15=_0x58ff15-0x0;var _0x49e944=_0xbcc6[_0x58ff15];return _0x49e944;};'use strict';var Sequelize=require(_0x6bcc('0x0'));module[_0x6bcc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6bcc('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x6bcc('0x3')]},'description':{'type':Sequelize[_0x6bcc('0x3')]}}; \ No newline at end of file +var _0xab17=['STRING','name','exports'];(function(_0x14fc9d,_0x40d839){var _0x2045de=function(_0x28a305){while(--_0x28a305){_0x14fc9d['push'](_0x14fc9d['shift']());}};_0x2045de(++_0x40d839);}(_0xab17,0xb6));var _0x7ab1=function(_0x1b9acc,_0x137afd){_0x1b9acc=_0x1b9acc-0x0;var _0x2bb71e=_0xab17[_0x1b9acc];return _0x2bb71e;};'use strict';var Sequelize=require('sequelize');module[_0x7ab1('0x0')]={'name':{'type':Sequelize[_0x7ab1('0x1')],'unique':_0x7ab1('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7ab1('0x1')]},'description':{'type':Sequelize[_0x7ab1('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index b29ee28..255042f 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 _0xd72d=['reject','update','destroy','then','get','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','where','filter','type','VIRTUAL','options','SquareOdbc','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ODBC','UserProfileSection','userProfileId','autoAssociation','test','dsn','odbc','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','limit','offset','count','status','set','Content-Range','apply'];(function(_0x1d5a4f,_0x30f2cf){var _0x23b890=function(_0x541330){while(--_0x541330){_0x1d5a4f['push'](_0x1d5a4f['shift']());}};_0x23b890(++_0x30f2cf);}(_0xd72d,0x1cc));var _0xdd72=function(_0x6d72a3,_0x516107){_0x6d72a3=_0x6d72a3-0x0;var _0x4d7c33=_0xd72d[_0x6d72a3];return _0x4d7c33;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd72('0x0'));var zipdir=require(_0xdd72('0x1'));var jsonpatch=require(_0xdd72('0x2'));var rp=require(_0xdd72('0x3'));var moment=require('moment');var BPromise=require(_0xdd72('0x4'));var Mustache=require(_0xdd72('0x5'));var util=require('util');var path=require(_0xdd72('0x6'));var sox=require(_0xdd72('0x7'));var csv=require(_0xdd72('0x8'));var ejs=require(_0xdd72('0x9'));var fs=require('fs');var fs_extra=require(_0xdd72('0xa'));var _=require(_0xdd72('0xb'));var squel=require(_0xdd72('0xc'));var crypto=require('crypto');var jsforce=require(_0xdd72('0xd'));var deskjs=require(_0xdd72('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdd72('0xf'));var Redis=require('ioredis');var authService=require(_0xdd72('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdd72('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdd72('0x12'));var utils=require('../../config/utils');var config=require(_0xdd72('0x13'));var licenseUtil=require(_0xdd72('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39f250,_0x598b0c){_0x598b0c=_0x598b0c||0xcc;return function(_0x1f73a4){if(_0x1f73a4){return _0x39f250[_0xdd72('0x15')](_0x598b0c);}return _0x39f250['status'](_0x598b0c)[_0xdd72('0x16')]();};}function respondWithResult(_0x2d2589,_0x575493){_0x575493=_0x575493||0xc8;return function(_0x4420fe){if(_0x4420fe){return _0x2d2589['status'](_0x575493)[_0xdd72('0x17')](_0x4420fe);}};}function respondWithFilteredResult(_0xca6622,_0x55e44d){return function(_0x46e736){if(_0x46e736){var _0x1f59dd=typeof _0x55e44d['offset']===_0xdd72('0x18')&&typeof _0x55e44d[_0xdd72('0x19')]===_0xdd72('0x18');var _0x1622fb=_0x46e736['count'];var _0x51619d=_0x1f59dd?0x0:_0x55e44d[_0xdd72('0x1a')];var _0x4c6fac=_0x1f59dd?_0x46e736[_0xdd72('0x1b')]:_0x55e44d[_0xdd72('0x1a')]+_0x55e44d[_0xdd72('0x19')];var _0x142a45;if(_0x4c6fac>=_0x1622fb){_0x4c6fac=_0x1622fb;_0x142a45=0xc8;}else{_0x142a45=0xce;}_0xca6622[_0xdd72('0x1c')](_0x142a45);return _0xca6622[_0xdd72('0x1d')](_0xdd72('0x1e'),_0x51619d+'-'+_0x4c6fac+'/'+_0x1622fb)['json'](_0x46e736);}return null;};}function patchUpdates(_0x44655e){return function(_0x4f56ff){try{jsonpatch[_0xdd72('0x1f')](_0x4f56ff,_0x44655e,!![]);}catch(_0x4288fa){return BPromise[_0xdd72('0x20')](_0x4288fa);}return _0x4f56ff['save']();};}function saveUpdates(_0x2b4fb3,_0x101fae){return function(_0x25b5d5){if(_0x25b5d5){return _0x25b5d5[_0xdd72('0x21')](_0x2b4fb3)['then'](function(_0xe4bf1){return _0xe4bf1;});}return null;};}function removeEntity(_0x497ec2,_0x1ed42c){return function(_0x20d18f){if(_0x20d18f){return _0x20d18f[_0xdd72('0x22')]()[_0xdd72('0x23')](function(){var _0x30df94=_0x20d18f[_0xdd72('0x24')]({'plain':!![]});var _0xec577='ODBC';return db[_0xdd72('0x25')][_0xdd72('0x22')]({'where':{'type':_0xec577,'resourceId':_0x30df94['id']}})[_0xdd72('0x23')](function(){return _0x20d18f;});})[_0xdd72('0x23')](function(){_0x497ec2[_0xdd72('0x1c')](0xcc)[_0xdd72('0x16')]();});}};}function handleEntityNotFound(_0x54d68f,_0x3f43ba){return function(_0x1de976){if(!_0x1de976){_0x54d68f[_0xdd72('0x15')](0x194);}return _0x1de976;};}function handleError(_0x556f3e,_0xf228b9){_0xf228b9=_0xf228b9||0x1f4;return function(_0xa224cc){logger[_0xdd72('0x26')](_0xa224cc[_0xdd72('0x27')]);if(_0xa224cc[_0xdd72('0x28')]){delete _0xa224cc[_0xdd72('0x28')];}_0x556f3e[_0xdd72('0x1c')](_0xf228b9)['send'](_0xa224cc);};}exports[_0xdd72('0x29')]=function(_0x1c2643,_0x1ee272){var _0xf9b821={},_0x20e758={},_0x3180ea={'count':0x0,'rows':[]};var _0x2689c8=_[_0xdd72('0x2a')](db['SquareOdbc'][_0xdd72('0x2b')],function(_0x491651){return{'name':_0x491651[_0xdd72('0x2c')],'type':_0x491651['type'][_0xdd72('0x2d')]};});_0x20e758[_0xdd72('0x2e')]=_[_0xdd72('0x2a')](_0x2689c8,'name');_0x20e758[_0xdd72('0x2f')]=_[_0xdd72('0x30')](_0x1c2643[_0xdd72('0x2f')]);_0x20e758[_0xdd72('0x31')]=_[_0xdd72('0x32')](_0x20e758['model'],_0x20e758[_0xdd72('0x2f')]);_0xf9b821[_0xdd72('0x33')]=_[_0xdd72('0x32')](_0x20e758['model'],qs[_0xdd72('0x34')](_0x1c2643['query'][_0xdd72('0x34')]));_0xf9b821[_0xdd72('0x33')]=_0xf9b821[_0xdd72('0x33')][_0xdd72('0x35')]?_0xf9b821[_0xdd72('0x33')]:_0x20e758[_0xdd72('0x2e')];if(!_0x1c2643[_0xdd72('0x2f')]['hasOwnProperty'](_0xdd72('0x36'))){_0xf9b821[_0xdd72('0x19')]=qs[_0xdd72('0x19')](_0x1c2643['query'][_0xdd72('0x19')]);_0xf9b821[_0xdd72('0x1a')]=qs[_0xdd72('0x1a')](_0x1c2643[_0xdd72('0x2f')][_0xdd72('0x1a')]);}_0xf9b821['order']=qs['sort'](_0x1c2643['query']['sort']);_0xf9b821[_0xdd72('0x37')]=qs[_0xdd72('0x31')](_['pick'](_0x1c2643[_0xdd72('0x2f')],_0x20e758[_0xdd72('0x31')]),_0x2689c8);if(_0x1c2643[_0xdd72('0x2f')][_0xdd72('0x38')]){_0xf9b821['where']=_['merge'](_0xf9b821[_0xdd72('0x37')],{'$or':_[_0xdd72('0x2a')](_0x2689c8,function(_0x41a992){if(_0x41a992[_0xdd72('0x39')]!==_0xdd72('0x3a')){var _0x58715c={};_0x58715c[_0x41a992[_0xdd72('0x28')]]={'$like':'%'+_0x1c2643[_0xdd72('0x2f')][_0xdd72('0x38')]+'%'};return _0x58715c;}})});}_0xf9b821=_['merge']({},_0xf9b821,_0x1c2643[_0xdd72('0x3b')]);var _0x30126a={'where':_0xf9b821[_0xdd72('0x37')]};return db[_0xdd72('0x3c')][_0xdd72('0x1b')](_0x30126a)[_0xdd72('0x23')](function(_0x32b0b2){_0x3180ea[_0xdd72('0x1b')]=_0x32b0b2;if(_0x1c2643[_0xdd72('0x2f')][_0xdd72('0x3d')]){_0xf9b821[_0xdd72('0x3e')]=[{'all':!![]}];}return db[_0xdd72('0x3c')][_0xdd72('0x3f')](_0xf9b821);})[_0xdd72('0x23')](function(_0x85976d){_0x3180ea[_0xdd72('0x40')]=_0x85976d;return _0x3180ea;})[_0xdd72('0x23')](respondWithFilteredResult(_0x1ee272,_0xf9b821))[_0xdd72('0x41')](handleError(_0x1ee272,null));};exports[_0xdd72('0x42')]=function(_0x2849ae,_0x3693a4){var _0x3a3cc5={'raw':!![],'where':{'id':_0x2849ae[_0xdd72('0x43')]['id']}},_0x393457={};_0x393457[_0xdd72('0x2e')]=_[_0xdd72('0x30')](db[_0xdd72('0x3c')][_0xdd72('0x2b')]);_0x393457[_0xdd72('0x2f')]=_[_0xdd72('0x30')](_0x2849ae[_0xdd72('0x2f')]);_0x393457['filters']=_['intersection'](_0x393457[_0xdd72('0x2e')],_0x393457[_0xdd72('0x2f')]);_0x3a3cc5[_0xdd72('0x33')]=_[_0xdd72('0x32')](_0x393457[_0xdd72('0x2e')],qs[_0xdd72('0x34')](_0x2849ae['query'][_0xdd72('0x34')]));_0x3a3cc5[_0xdd72('0x33')]=_0x3a3cc5[_0xdd72('0x33')][_0xdd72('0x35')]?_0x3a3cc5['attributes']:_0x393457[_0xdd72('0x2e')];if(_0x2849ae[_0xdd72('0x2f')][_0xdd72('0x3d')]){_0x3a3cc5[_0xdd72('0x3e')]=[{'all':!![]}];}_0x3a3cc5=_[_0xdd72('0x44')]({},_0x3a3cc5,_0x2849ae[_0xdd72('0x3b')]);return db['SquareOdbc'][_0xdd72('0x45')](_0x3a3cc5)['then'](handleEntityNotFound(_0x3693a4,null))['then'](respondWithResult(_0x3693a4,null))[_0xdd72('0x41')](handleError(_0x3693a4,null));};exports[_0xdd72('0x46')]=function(_0x24330d,_0x1d0368){return db[_0xdd72('0x3c')][_0xdd72('0x46')](_0x24330d[_0xdd72('0x47')],{})[_0xdd72('0x23')](function(_0x34fe61){var _0x1fbcdd=_0x24330d['user'][_0xdd72('0x24')]({'plain':!![]});if(!_0x1fbcdd)throw new Error(_0xdd72('0x48'));if(_0x1fbcdd[_0xdd72('0x49')]===_0xdd72('0x4a')){var _0x3331ee=_0x34fe61[_0xdd72('0x24')]({'plain':!![]});var _0x2c9598=_0xdd72('0x4b');return db[_0xdd72('0x4c')]['find']({'where':{'name':_0x2c9598,'userProfileId':_0x1fbcdd[_0xdd72('0x4d')]},'raw':!![]})[_0xdd72('0x23')](function(_0x95bcc7){if(_0x95bcc7&&_0x95bcc7[_0xdd72('0x4e')]===0x0){return db[_0xdd72('0x25')][_0xdd72('0x46')]({'name':_0x3331ee[_0xdd72('0x28')],'resourceId':_0x3331ee['id'],'type':_0x95bcc7[_0xdd72('0x28')],'sectionId':_0x95bcc7['id']},{})['then'](function(){return _0x34fe61;});}else{return _0x34fe61;}})[_0xdd72('0x41')](function(_0x46dc0f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46dc0f);throw _0x46dc0f;});}return _0x34fe61;})[_0xdd72('0x23')](respondWithResult(_0x1d0368,0xc9))[_0xdd72('0x41')](handleError(_0x1d0368,null));};exports[_0xdd72('0x21')]=function(_0x307071,_0x5d421c){if(_0x307071[_0xdd72('0x47')]['id']){delete _0x307071[_0xdd72('0x47')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x307071[_0xdd72('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d421c,null))['then'](saveUpdates(_0x307071[_0xdd72('0x47')],null))[_0xdd72('0x23')](respondWithResult(_0x5d421c,null))[_0xdd72('0x41')](handleError(_0x5d421c,null));};exports['destroy']=function(_0x140a19,_0x4af6f8){return db['SquareOdbc'][_0xdd72('0x45')]({'where':{'id':_0x140a19[_0xdd72('0x43')]['id']}})[_0xdd72('0x23')](handleEntityNotFound(_0x4af6f8,null))['then'](removeEntity(_0x4af6f8,null))[_0xdd72('0x41')](handleError(_0x4af6f8,null));};exports[_0xdd72('0x4f')]=function(_0x2d47d5,_0x583a6c,_0x52796d){var _0x154270;return db['SquareOdbc'][_0xdd72('0x45')]({'where':{'id':_0x2d47d5[_0xdd72('0x43')]['id']},'attributes':['id',_0xdd72('0x50')]})[_0xdd72('0x23')](handleEntityNotFound(_0x583a6c,null))['then'](function(_0x1b2e4b){if(_0x1b2e4b){var _0x1f8334=require(_0xdd72('0x51'))();_0x1f8334['openSync'](_0x1b2e4b[_0xdd72('0x50')]);_0x1f8334['closeSync']();return _0x1b2e4b;}})[_0xdd72('0x23')](respondWithResult(_0x583a6c,null))['catch'](handleError(_0x583a6c,null));}; \ No newline at end of file +var _0x9bd2=['name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','SquareOdbc','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','destroy','error','stack'];(function(_0x23fd7b,_0x394165){var _0x4a4402=function(_0x459761){while(--_0x459761){_0x23fd7b['push'](_0x23fd7b['shift']());}};_0x4a4402(++_0x394165);}(_0x9bd2,0x8b));var _0x29bd=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9bd2[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x29bd('0x0'));var rimraf=require(_0x29bd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29bd('0x2'));var rp=require(_0x29bd('0x3'));var moment=require(_0x29bd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x29bd('0x5'));var util=require(_0x29bd('0x6'));var path=require('path');var sox=require(_0x29bd('0x7'));var csv=require(_0x29bd('0x8'));var ejs=require(_0x29bd('0x9'));var fs=require('fs');var fs_extra=require(_0x29bd('0xa'));var _=require(_0x29bd('0xb'));var squel=require('squel');var crypto=require(_0x29bd('0xc'));var jsforce=require(_0x29bd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x29bd('0x8'));var querystring=require(_0x29bd('0xe'));var Papa=require(_0x29bd('0xf'));var Redis=require(_0x29bd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x29bd('0x11'));var as=require(_0x29bd('0x12'));var hardwareService=require(_0x29bd('0x13'));var logger=require(_0x29bd('0x14'))('api');var utils=require(_0x29bd('0x15'));var config=require(_0x29bd('0x16'));var licenseUtil=require(_0x29bd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x397816,_0x400f3f){_0x400f3f=_0x400f3f||0xcc;return function(_0x2817b4){if(_0x2817b4){return _0x397816[_0x29bd('0x18')](_0x400f3f);}return _0x397816['status'](_0x400f3f)['end']();};}function respondWithResult(_0x2a5a19,_0x176e83){_0x176e83=_0x176e83||0xc8;return function(_0x4949c4){if(_0x4949c4){return _0x2a5a19[_0x29bd('0x19')](_0x176e83)[_0x29bd('0x1a')](_0x4949c4);}};}function respondWithFilteredResult(_0x180062,_0xc83f97){return function(_0xc6f31d){if(_0xc6f31d){var _0x134266=typeof _0xc83f97[_0x29bd('0x1b')]===_0x29bd('0x1c')&&typeof _0xc83f97[_0x29bd('0x1d')]===_0x29bd('0x1c');var _0x4dd818=_0xc6f31d[_0x29bd('0x1e')];var _0x479748=_0x134266?0x0:_0xc83f97[_0x29bd('0x1b')];var _0x4f136a=_0x134266?_0xc6f31d[_0x29bd('0x1e')]:_0xc83f97[_0x29bd('0x1b')]+_0xc83f97[_0x29bd('0x1d')];var _0x3e6cff;if(_0x4f136a>=_0x4dd818){_0x4f136a=_0x4dd818;_0x3e6cff=0xc8;}else{_0x3e6cff=0xce;}_0x180062['status'](_0x3e6cff);return _0x180062['set'](_0x29bd('0x1f'),_0x479748+'-'+_0x4f136a+'/'+_0x4dd818)['json'](_0xc6f31d);}return null;};}function patchUpdates(_0xde7a96){return function(_0x37ae6e){try{jsonpatch[_0x29bd('0x20')](_0x37ae6e,_0xde7a96,!![]);}catch(_0x3c7db3){return BPromise[_0x29bd('0x21')](_0x3c7db3);}return _0x37ae6e[_0x29bd('0x22')]();};}function saveUpdates(_0x115617,_0x2c46a8){return function(_0x20b6c4){if(_0x20b6c4){return _0x20b6c4[_0x29bd('0x23')](_0x115617)[_0x29bd('0x24')](function(_0xa4f818){return _0xa4f818;});}return null;};}function removeEntity(_0x4759bd,_0x15fbbf){return function(_0x38b501){if(_0x38b501){return _0x38b501['destroy']()[_0x29bd('0x24')](function(){var _0x1501be=_0x38b501[_0x29bd('0x25')]({'plain':!![]});var _0x295a4d='ODBC';return db['UserProfileResource'][_0x29bd('0x26')]({'where':{'type':_0x295a4d,'resourceId':_0x1501be['id']}})[_0x29bd('0x24')](function(){return _0x38b501;});})['then'](function(){_0x4759bd[_0x29bd('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc7c1ee,_0x2cb691){return function(_0x5df2cf){if(!_0x5df2cf){_0xc7c1ee['sendStatus'](0x194);}return _0x5df2cf;};}function handleError(_0x55c52e,_0x2d7117){_0x2d7117=_0x2d7117||0x1f4;return function(_0x3c8bd4){logger[_0x29bd('0x27')](_0x3c8bd4[_0x29bd('0x28')]);if(_0x3c8bd4['name']){delete _0x3c8bd4[_0x29bd('0x29')];}_0x55c52e[_0x29bd('0x19')](_0x2d7117)[_0x29bd('0x2a')](_0x3c8bd4);};}exports[_0x29bd('0x2b')]=function(_0x24df19,_0x5e0c89){var _0x38fe54={},_0x30d49d={},_0x3f95ae={'count':0x0,'rows':[]};var _0x448100=_[_0x29bd('0x2c')](db['SquareOdbc'][_0x29bd('0x2d')],function(_0x561b18){return{'name':_0x561b18[_0x29bd('0x2e')],'type':_0x561b18[_0x29bd('0x2f')][_0x29bd('0x30')]};});_0x30d49d[_0x29bd('0x31')]=_[_0x29bd('0x2c')](_0x448100,_0x29bd('0x29'));_0x30d49d['query']=_[_0x29bd('0x32')](_0x24df19[_0x29bd('0x33')]);_0x30d49d[_0x29bd('0x34')]=_[_0x29bd('0x35')](_0x30d49d[_0x29bd('0x31')],_0x30d49d[_0x29bd('0x33')]);_0x38fe54['attributes']=_[_0x29bd('0x35')](_0x30d49d[_0x29bd('0x31')],qs[_0x29bd('0x36')](_0x24df19[_0x29bd('0x33')][_0x29bd('0x36')]));_0x38fe54[_0x29bd('0x37')]=_0x38fe54['attributes'][_0x29bd('0x38')]?_0x38fe54[_0x29bd('0x37')]:_0x30d49d[_0x29bd('0x31')];if(!_0x24df19[_0x29bd('0x33')][_0x29bd('0x39')]('nolimit')){_0x38fe54[_0x29bd('0x1d')]=qs[_0x29bd('0x1d')](_0x24df19[_0x29bd('0x33')][_0x29bd('0x1d')]);_0x38fe54[_0x29bd('0x1b')]=qs[_0x29bd('0x1b')](_0x24df19[_0x29bd('0x33')][_0x29bd('0x1b')]);}_0x38fe54[_0x29bd('0x3a')]=qs['sort'](_0x24df19[_0x29bd('0x33')][_0x29bd('0x3b')]);_0x38fe54['where']=qs['filters'](_[_0x29bd('0x3c')](_0x24df19['query'],_0x30d49d[_0x29bd('0x34')]),_0x448100);if(_0x24df19[_0x29bd('0x33')][_0x29bd('0x3d')]){_0x38fe54[_0x29bd('0x3e')]=_['merge'](_0x38fe54[_0x29bd('0x3e')],{'$or':_[_0x29bd('0x2c')](_0x448100,function(_0x339d40){if(_0x339d40['type']!==_0x29bd('0x3f')){var _0x18d720={};_0x18d720[_0x339d40[_0x29bd('0x29')]]={'$like':'%'+_0x24df19[_0x29bd('0x33')][_0x29bd('0x3d')]+'%'};return _0x18d720;}})});}_0x38fe54=_[_0x29bd('0x40')]({},_0x38fe54,_0x24df19[_0x29bd('0x41')]);var _0x240bd9={'where':_0x38fe54[_0x29bd('0x3e')]};return db[_0x29bd('0x42')][_0x29bd('0x1e')](_0x240bd9)[_0x29bd('0x24')](function(_0x52eb57){_0x3f95ae['count']=_0x52eb57;if(_0x24df19[_0x29bd('0x33')][_0x29bd('0x43')]){_0x38fe54[_0x29bd('0x44')]=[{'all':!![]}];}return db[_0x29bd('0x42')][_0x29bd('0x45')](_0x38fe54);})[_0x29bd('0x24')](function(_0x5600b9){_0x3f95ae[_0x29bd('0x46')]=_0x5600b9;return _0x3f95ae;})['then'](respondWithFilteredResult(_0x5e0c89,_0x38fe54))[_0x29bd('0x47')](handleError(_0x5e0c89,null));};exports[_0x29bd('0x48')]=function(_0x56a472,_0xe18009){var _0x5859a9={'raw':!![],'where':{'id':_0x56a472[_0x29bd('0x49')]['id']}},_0x2a5230={};_0x2a5230[_0x29bd('0x31')]=_[_0x29bd('0x32')](db['SquareOdbc'][_0x29bd('0x2d')]);_0x2a5230[_0x29bd('0x33')]=_['keys'](_0x56a472['query']);_0x2a5230['filters']=_[_0x29bd('0x35')](_0x2a5230[_0x29bd('0x31')],_0x2a5230[_0x29bd('0x33')]);_0x5859a9['attributes']=_[_0x29bd('0x35')](_0x2a5230[_0x29bd('0x31')],qs[_0x29bd('0x36')](_0x56a472['query']['fields']));_0x5859a9[_0x29bd('0x37')]=_0x5859a9[_0x29bd('0x37')][_0x29bd('0x38')]?_0x5859a9[_0x29bd('0x37')]:_0x2a5230['model'];if(_0x56a472[_0x29bd('0x33')]['includeAll']){_0x5859a9['include']=[{'all':!![]}];}_0x5859a9=_[_0x29bd('0x40')]({},_0x5859a9,_0x56a472[_0x29bd('0x41')]);return db[_0x29bd('0x42')][_0x29bd('0x4a')](_0x5859a9)[_0x29bd('0x24')](handleEntityNotFound(_0xe18009,null))[_0x29bd('0x24')](respondWithResult(_0xe18009,null))[_0x29bd('0x47')](handleError(_0xe18009,null));};exports[_0x29bd('0x4b')]=function(_0x3c6a7d,_0x98bef5){return db[_0x29bd('0x42')][_0x29bd('0x4b')](_0x3c6a7d[_0x29bd('0x4c')],{})[_0x29bd('0x24')](function(_0x4ad6dc){var _0x3d819b=_0x3c6a7d[_0x29bd('0x4d')][_0x29bd('0x25')]({'plain':!![]});if(!_0x3d819b)throw new Error(_0x29bd('0x4e'));if(_0x3d819b[_0x29bd('0x4f')]===_0x29bd('0x4d')){var _0x5936a7=_0x4ad6dc[_0x29bd('0x25')]({'plain':!![]});var _0x3201de=_0x29bd('0x50');return db[_0x29bd('0x51')]['find']({'where':{'name':_0x3201de,'userProfileId':_0x3d819b[_0x29bd('0x52')]},'raw':!![]})[_0x29bd('0x24')](function(_0x259a18){if(_0x259a18&&_0x259a18[_0x29bd('0x53')]===0x0){return db[_0x29bd('0x54')][_0x29bd('0x4b')]({'name':_0x5936a7[_0x29bd('0x29')],'resourceId':_0x5936a7['id'],'type':_0x259a18[_0x29bd('0x29')],'sectionId':_0x259a18['id']},{})[_0x29bd('0x24')](function(){return _0x4ad6dc;});}else{return _0x4ad6dc;}})[_0x29bd('0x47')](function(_0x5d6d2e){logger[_0x29bd('0x27')](_0x29bd('0x55'),_0x5d6d2e);throw _0x5d6d2e;});}return _0x4ad6dc;})[_0x29bd('0x24')](respondWithResult(_0x98bef5,0xc9))[_0x29bd('0x47')](handleError(_0x98bef5,null));};exports[_0x29bd('0x23')]=function(_0x39a2fa,_0x59ca73){if(_0x39a2fa['body']['id']){delete _0x39a2fa[_0x29bd('0x4c')]['id'];}return db[_0x29bd('0x42')][_0x29bd('0x4a')]({'where':{'id':_0x39a2fa[_0x29bd('0x49')]['id']}})[_0x29bd('0x24')](handleEntityNotFound(_0x59ca73,null))[_0x29bd('0x24')](saveUpdates(_0x39a2fa[_0x29bd('0x4c')],null))[_0x29bd('0x24')](respondWithResult(_0x59ca73,null))['catch'](handleError(_0x59ca73,null));};exports[_0x29bd('0x26')]=function(_0x152b21,_0x3cbce2){return db['SquareOdbc'][_0x29bd('0x4a')]({'where':{'id':_0x152b21[_0x29bd('0x49')]['id']}})[_0x29bd('0x24')](handleEntityNotFound(_0x3cbce2,null))[_0x29bd('0x24')](removeEntity(_0x3cbce2,null))[_0x29bd('0x47')](handleError(_0x3cbce2,null));};exports[_0x29bd('0x56')]=function(_0x3f1d86,_0x22b901,_0xc7002e){var _0x5d4303;return db[_0x29bd('0x42')][_0x29bd('0x4a')]({'where':{'id':_0x3f1d86[_0x29bd('0x49')]['id']},'attributes':['id',_0x29bd('0x57')]})[_0x29bd('0x24')](handleEntityNotFound(_0x22b901,null))[_0x29bd('0x24')](function(_0x2b6be8){if(_0x2b6be8){var _0x34eb12=require(_0x29bd('0x58'))();_0x34eb12['openSync'](_0x2b6be8['dsn']);_0x34eb12[_0x29bd('0x59')]();return _0x2b6be8;}})[_0x29bd('0x24')](respondWithResult(_0x22b901,null))[_0x29bd('0x47')](handleError(_0x22b901,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index e5b3326..52ced29 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 _0x031e=['square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./squareOdbc.attributes','define','SquareOdbc'];(function(_0x5b5cde,_0x1f7c5f){var _0x364ad2=function(_0x4a1172){while(--_0x4a1172){_0x5b5cde['push'](_0x5b5cde['shift']());}};_0x364ad2(++_0x1f7c5f);}(_0x031e,0x1ae));var _0xe031=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x031e[_0x5ce15c];return _0x36e4f5;};'use strict';var _=require(_0xe031('0x0'));var util=require(_0xe031('0x1'));var logger=require(_0xe031('0x2'))(_0xe031('0x3'));var moment=require(_0xe031('0x4'));var BPromise=require(_0xe031('0x5'));var rp=require(_0xe031('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe031('0x7'));module['exports']=function(_0x418fe1,_0x2380b0){return _0x418fe1[_0xe031('0x8')](_0xe031('0x9'),attributes,{'tableName':_0xe031('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf8b3=['rimraf','../../config/environment','./squareOdbc.attributes','SquareOdbc','square_odbc','lodash','../../config/logger','api','moment','path'];(function(_0x4dc76a,_0xd9142a){var _0x3f2411=function(_0xf2660a){while(--_0xf2660a){_0x4dc76a['push'](_0x4dc76a['shift']());}};_0x3f2411(++_0xd9142a);}(_0xf8b3,0xcd));var _0x3f8b=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xf8b3[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x3f8b('0x0'));var util=require('util');var logger=require(_0x3f8b('0x1'))(_0x3f8b('0x2'));var moment=require(_0x3f8b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f8b('0x4'));var rimraf=require(_0x3f8b('0x5'));var config=require(_0x3f8b('0x6'));var attributes=require(_0x3f8b('0x7'));module['exports']=function(_0x5cb09e,_0x58c77a){return _0x5cb09e['define'](_0x3f8b('0x8'),attributes,{'tableName':_0x3f8b('0x9'),'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 f5fb570..f594a85 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 _0xa85e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','ShowSquareOdbc','find','options','raw','where','attributes','include','map','model','info','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x57c6aa,_0x51c8fd){var _0x2a1f40=function(_0x443c23){while(--_0x443c23){_0x57c6aa['push'](_0x57c6aa['shift']());}};_0x2a1f40(++_0x51c8fd);}(_0xa85e,0x123));var _0xea85=function(_0x705b98,_0x1c345b){_0x705b98=_0x705b98-0x0;var _0x47b72f=_0xa85e[_0x705b98];return _0x47b72f;};'use strict';var _=require(_0xea85('0x0'));var util=require('util');var moment=require(_0xea85('0x1'));var BPromise=require(_0xea85('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea85('0x3'));var db=require(_0xea85('0x4'))['db'];var utils=require(_0xea85('0x5'));var logger=require(_0xea85('0x6'))(_0xea85('0x7'));var config=require(_0xea85('0x8'));var jayson=require(_0xea85('0x9'));var client=jayson[_0xea85('0xa')][_0xea85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x153530,_0x21e7d0,_0x14ff74){return new BPromise(function(_0x2845a3,_0x30620e){return client['request'](_0x153530,_0x14ff74)[_0xea85('0xc')](function(_0x285c10){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x21e7d0,'request\x20sent');logger[_0xea85('0xd')](_0xea85('0xe'),_0x21e7d0,_0xea85('0xf'),JSON[_0xea85('0x10')](_0x285c10));if(_0x285c10['error']){if(_0x285c10[_0xea85('0x11')][_0xea85('0x12')]===0x1f4){logger[_0xea85('0x11')](_0xea85('0x13'),_0x21e7d0,_0x285c10[_0xea85('0x11')][_0xea85('0x14')]);return _0x30620e(_0x285c10[_0xea85('0x11')][_0xea85('0x14')]);}logger[_0xea85('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x21e7d0,_0x285c10[_0xea85('0x11')][_0xea85('0x14')]);return _0x2845a3(_0x285c10[_0xea85('0x11')][_0xea85('0x14')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x21e7d0,_0xea85('0xf'));_0x2845a3(_0x285c10[_0xea85('0x15')][_0xea85('0x14')]);}})['catch'](function(_0x399f02){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x21e7d0,_0x399f02);_0x30620e(_0x399f02);});});}exports[_0xea85('0x16')]=function(_0x4ff135){var _0x343464=this;return new Promise(function(_0x575e32,_0x59e1a0){return db['SquareOdbc'][_0xea85('0x17')]({'raw':_0x4ff135[_0xea85('0x18')]?_0x4ff135[_0xea85('0x18')][_0xea85('0x19')]===undefined?!![]:![]:!![],'where':_0x4ff135[_0xea85('0x18')]?_0x4ff135[_0xea85('0x18')][_0xea85('0x1a')]||null:null,'attributes':_0x4ff135[_0xea85('0x18')]?_0x4ff135[_0xea85('0x18')][_0xea85('0x1b')]||null:null,'include':_0x4ff135['options']?_0x4ff135[_0xea85('0x18')][_0xea85('0x1c')]?_['map'](_0x4ff135['options'][_0xea85('0x1c')],function(_0x1adcfb){return{'model':db[_0x1adcfb['model']],'as':_0x1adcfb['as'],'attributes':_0x1adcfb[_0xea85('0x1b')],'include':_0x1adcfb[_0xea85('0x1c')]?_[_0xea85('0x1d')](_0x1adcfb[_0xea85('0x1c')],function(_0x4358d8){return{'model':db[_0x4358d8[_0xea85('0x1e')]],'as':_0x4358d8['as'],'attributes':_0x4358d8[_0xea85('0x1b')],'include':_0x4358d8[_0xea85('0x1c')]?_[_0xea85('0x1d')](_0x4358d8['include'],function(_0x2b3e2f){return{'model':db[_0x2b3e2f[_0xea85('0x1e')]],'as':_0x2b3e2f['as'],'attributes':_0x2b3e2f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e2ad2){logger[_0xea85('0x1f')](_0xea85('0x16'),_0x4ff135);logger[_0xea85('0xd')](_0xea85('0x16'),_0x4ff135,JSON[_0xea85('0x10')](_0x2e2ad2));_0x575e32(_0x2e2ad2);})[_0xea85('0x20')](function(_0x45b323){logger['error'](_0xea85('0x16'),_0x45b323[_0xea85('0x14')],_0x4ff135);_0x59e1a0(_0x343464[_0xea85('0x11')](0x1f4,_0x45b323['message']));});});}; \ No newline at end of file +var _0x2b5f=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','raw','options','where','attributes','include','map','model','stringify','lodash'];(function(_0x1103e6,_0x3a0217){var _0x5bc0ef=function(_0x3e979b){while(--_0x3e979b){_0x1103e6['push'](_0x1103e6['shift']());}};_0x5bc0ef(++_0x3a0217);}(_0x2b5f,0x18b));var _0xf2b5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2b5f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf2b5('0x0'));var util=require(_0xf2b5('0x1'));var moment=require('moment');var BPromise=require(_0xf2b5('0x2'));var rs=require(_0xf2b5('0x3'));var fs=require('fs');var Redis=require(_0xf2b5('0x4'));var db=require(_0xf2b5('0x5'))['db'];var utils=require(_0xf2b5('0x6'));var logger=require('../../config/logger')(_0xf2b5('0x7'));var config=require(_0xf2b5('0x8'));var jayson=require(_0xf2b5('0x9'));var client=jayson[_0xf2b5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ce777,_0x2ce2de,_0x5d37f1){return new BPromise(function(_0x38b5dd,_0x5e7c81){return client['request'](_0x4ce777,_0x5d37f1)[_0xf2b5('0xb')](function(_0x39828f){logger[_0xf2b5('0xc')](_0xf2b5('0xd'),_0x2ce2de,_0xf2b5('0xe'));logger[_0xf2b5('0xf')](_0xf2b5('0x10'),_0x2ce2de,_0xf2b5('0xe'),JSON['stringify'](_0x39828f));if(_0x39828f['error']){if(_0x39828f[_0xf2b5('0x11')][_0xf2b5('0x12')]===0x1f4){logger[_0xf2b5('0x11')](_0xf2b5('0xd'),_0x2ce2de,_0x39828f[_0xf2b5('0x11')][_0xf2b5('0x13')]);return _0x5e7c81(_0x39828f[_0xf2b5('0x11')][_0xf2b5('0x13')]);}logger[_0xf2b5('0x11')](_0xf2b5('0xd'),_0x2ce2de,_0x39828f[_0xf2b5('0x11')]['message']);return _0x38b5dd(_0x39828f[_0xf2b5('0x11')]['message']);}else{logger[_0xf2b5('0xc')](_0xf2b5('0xd'),_0x2ce2de,'request\x20sent');_0x38b5dd(_0x39828f[_0xf2b5('0x14')][_0xf2b5('0x13')]);}})[_0xf2b5('0x15')](function(_0x7badd1){logger[_0xf2b5('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x2ce2de,_0x7badd1);_0x5e7c81(_0x7badd1);});});}exports[_0xf2b5('0x16')]=function(_0x6d2b70){var _0x558e6d=this;return new Promise(function(_0xd0d1fe,_0x1a8e32){return db[_0xf2b5('0x17')][_0xf2b5('0x18')]({'raw':_0x6d2b70['options']?_0x6d2b70['options'][_0xf2b5('0x19')]===undefined?!![]:![]:!![],'where':_0x6d2b70[_0xf2b5('0x1a')]?_0x6d2b70[_0xf2b5('0x1a')][_0xf2b5('0x1b')]||null:null,'attributes':_0x6d2b70['options']?_0x6d2b70[_0xf2b5('0x1a')][_0xf2b5('0x1c')]||null:null,'include':_0x6d2b70[_0xf2b5('0x1a')]?_0x6d2b70[_0xf2b5('0x1a')][_0xf2b5('0x1d')]?_[_0xf2b5('0x1e')](_0x6d2b70[_0xf2b5('0x1a')][_0xf2b5('0x1d')],function(_0x581332){return{'model':db[_0x581332[_0xf2b5('0x1f')]],'as':_0x581332['as'],'attributes':_0x581332[_0xf2b5('0x1c')],'include':_0x581332[_0xf2b5('0x1d')]?_[_0xf2b5('0x1e')](_0x581332[_0xf2b5('0x1d')],function(_0x45a080){return{'model':db[_0x45a080['model']],'as':_0x45a080['as'],'attributes':_0x45a080[_0xf2b5('0x1c')],'include':_0x45a080[_0xf2b5('0x1d')]?_[_0xf2b5('0x1e')](_0x45a080[_0xf2b5('0x1d')],function(_0x3b58bd){return{'model':db[_0x3b58bd[_0xf2b5('0x1f')]],'as':_0x3b58bd['as'],'attributes':_0x3b58bd[_0xf2b5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x57e38b){logger['info'](_0xf2b5('0x16'),_0x6d2b70);logger['debug'](_0xf2b5('0x16'),_0x6d2b70,JSON[_0xf2b5('0x20')](_0x57e38b));_0xd0d1fe(_0x57e38b);})[_0xf2b5('0x15')](function(_0x2fdcb1){logger['error']('ShowSquareOdbc',_0x2fdcb1[_0xf2b5('0x13')],_0x6d2b70);_0x1a8e32(_0x558e6d[_0xf2b5('0x11')](0x1f4,_0x2fdcb1[_0xf2b5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index cf1a802..797bbb0 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 _0x82ca=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','util','path'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0x82ca,0x1f1));var _0xa82c=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0x82ca[_0x1a0600];return _0x734670;};'use strict';var multer=require(_0xa82c('0x0'));var util=require(_0xa82c('0x1'));var path=require(_0xa82c('0x2'));var timeout=require('connect-timeout');var express=require(_0xa82c('0x3'));var router=express[_0xa82c('0x4')]();var fs_extra=require(_0xa82c('0x5'));var auth=require(_0xa82c('0x6'));var interaction=require(_0xa82c('0x7'));var config=require(_0xa82c('0x8'));var controller=require(_0xa82c('0x9'));router[_0xa82c('0xa')]('/',auth[_0xa82c('0xb')](),controller[_0xa82c('0xc')]);router[_0xa82c('0xa')](_0xa82c('0xd'),auth['isAuthenticated'](),controller[_0xa82c('0xe')]);router[_0xa82c('0xf')]('/',auth['isAuthenticated'](),controller[_0xa82c('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa82c('0x11')](_0xa82c('0xd'),auth['isAuthenticated'](),controller[_0xa82c('0x12')]);module[_0xa82c('0x13')]=router; \ No newline at end of file +var _0x1bbe=['/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','index','get'];(function(_0x20b4ad,_0x1e2ce9){var _0x5a51cb=function(_0x67c673){while(--_0x67c673){_0x20b4ad['push'](_0x20b4ad['shift']());}};_0x5a51cb(++_0x1e2ce9);}(_0x1bbe,0x86));var _0xe1bb=function(_0x262a69,_0x1f67fe){_0x262a69=_0x262a69-0x0;var _0x43ca44=_0x1bbe[_0x262a69];return _0x43ca44;};'use strict';var multer=require(_0xe1bb('0x0'));var util=require(_0xe1bb('0x1'));var path=require(_0xe1bb('0x2'));var timeout=require(_0xe1bb('0x3'));var express=require(_0xe1bb('0x4'));var router=express['Router']();var fs_extra=require(_0xe1bb('0x5'));var auth=require(_0xe1bb('0x6'));var interaction=require(_0xe1bb('0x7'));var config=require(_0xe1bb('0x8'));var controller=require(_0xe1bb('0x9'));router['get']('/',auth[_0xe1bb('0xa')](),controller[_0xe1bb('0xb')]);router[_0xe1bb('0xc')](_0xe1bb('0xd'),auth[_0xe1bb('0xa')](),controller[_0xe1bb('0xe')]);router['post']('/',auth[_0xe1bb('0xa')](),controller[_0xe1bb('0xf')]);router[_0xe1bb('0x10')](_0xe1bb('0xd'),auth['isAuthenticated'](),controller[_0xe1bb('0x11')]);router[_0xe1bb('0x12')](_0xe1bb('0xd'),auth[_0xe1bb('0xa')](),controller[_0xe1bb('0x13')]);module[_0xe1bb('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 2037568..0802e61 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 _0x9218=['long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB'];(function(_0xda1de7,_0x4c5edd){var _0x4ac7ba=function(_0x75a8b4){while(--_0x75a8b4){_0xda1de7['push'](_0xda1de7['shift']());}};_0x4ac7ba(++_0x4c5edd);}(_0x9218,0x10b));var _0x8921=function(_0x1b635d,_0x7c66a2){_0x1b635d=_0x1b635d-0x0;var _0x461f9e=_0x9218[_0x1b635d];return _0x461f9e;};'use strict';var Sequelize=require(_0x8921('0x0'));module[_0x8921('0x1')]={'name':{'type':Sequelize[_0x8921('0x2')],'unique':_0x8921('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x8921('0x2')]},'notes':{'type':Sequelize[_0x8921('0x4')]},'preproduction':{'type':Sequelize[_0x8921('0x5')](_0x8921('0x6')),'get':function(){if(this[_0x8921('0x7')](_0x8921('0x8'))){return this['getDataValue'](_0x8921('0x8'))[_0x8921('0x9')](_0x8921('0xa'));}}},'production':{'type':Sequelize[_0x8921('0x5')](_0x8921('0x6')),'get':function(){if(this[_0x8921('0x7')](_0x8921('0xb'))){return this[_0x8921('0x7')]('production')[_0x8921('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0x8921('0xc')]},'publishedAt':{'type':Sequelize[_0x8921('0xc')]}}; \ No newline at end of file +var _0x4141=['utf8','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x4141,0x121));var _0x1414=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4141[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x1414('0x0'));module[_0x1414('0x1')]={'name':{'type':Sequelize[_0x1414('0x2')],'unique':_0x1414('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x1414('0x2')]},'notes':{'type':Sequelize[_0x1414('0x4')]},'preproduction':{'type':Sequelize[_0x1414('0x5')](_0x1414('0x6')),'get':function(){if(this[_0x1414('0x7')](_0x1414('0x8'))){return this['getDataValue']('preproduction')[_0x1414('0x9')](_0x1414('0xa'));}}},'production':{'type':Sequelize[_0x1414('0x5')]('long'),'get':function(){if(this['getDataValue'](_0x1414('0xb'))){return this[_0x1414('0x7')](_0x1414('0xb'))['toString'](_0x1414('0xa'));}}},'savedAt':{'type':Sequelize[_0x1414('0xc')]},'publishedAt':{'type':Sequelize[_0x1414('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 32a245f..8f733bd 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 _0xa0b5=['includeAll','include','find','catch','create','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','production','lodash','ioredis','api','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','limit','undefined','count','set','update','destroy','then','SquareProjects','UserProfileResource','publish','agi','stringify','end','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','findAll','params','keys'];(function(_0xae29f9,_0x16315b){var _0x10ee97=function(_0x2445b4){while(--_0x2445b4){_0xae29f9['push'](_0xae29f9['shift']());}};_0x10ee97(++_0x16315b);}(_0xa0b5,0x1d3));var _0x5a0b=function(_0xe8e2ed,_0x34e496){_0xe8e2ed=_0xe8e2ed-0x0;var _0x4eff22=_0xa0b5[_0xe8e2ed];return _0x4eff22;};'use strict';var _=require(_0x5a0b('0x0'));var Redis=require(_0x5a0b('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x5a0b('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x5a0b('0x3')]=_['defaults'](config[_0x5a0b('0x3')],{'host':_0x5a0b('0x4'),'port':0x18eb});var socket=require(_0x5a0b('0x5'))(new Redis(config[_0x5a0b('0x3')]));require(_0x5a0b('0x6'))[_0x5a0b('0x7')](socket);function respondWithResult(_0x2b62e7,_0x1c8a0c){_0x1c8a0c=_0x1c8a0c||0xc8;return function(_0x3e551c){if(_0x3e551c){return _0x2b62e7[_0x5a0b('0x8')](_0x1c8a0c)[_0x5a0b('0x9')](_0x3e551c);}};}function respondWithFilteredResult(_0x47dbec,_0x132a76){return function(_0x74459){if(_0x74459){var _0x3b8f6f=typeof _0x132a76[_0x5a0b('0xa')]==='undefined'&&typeof _0x132a76[_0x5a0b('0xb')]===_0x5a0b('0xc');var _0x1c049b=_0x74459[_0x5a0b('0xd')];var _0x41489b=_0x3b8f6f?0x0:_0x132a76['offset'];var _0x472235=_0x3b8f6f?_0x74459[_0x5a0b('0xd')]:_0x132a76[_0x5a0b('0xa')]+_0x132a76['limit'];var _0x4f3d4d;if(_0x472235>=_0x1c049b){_0x472235=_0x1c049b;_0x4f3d4d=0xc8;}else{_0x4f3d4d=0xce;}_0x47dbec[_0x5a0b('0x8')](_0x4f3d4d);return _0x47dbec[_0x5a0b('0xe')]('Content-Range',_0x41489b+'-'+_0x472235+'/'+_0x1c049b)['json'](_0x74459);}return null;};}function saveUpdates(_0x1cbf1a){return function(_0x196c85){if(_0x196c85){return _0x196c85[_0x5a0b('0xf')](_0x1cbf1a)['then'](function(_0x448a4f){return _0x448a4f;});}return null;};}function removeEntity(_0x2a83b0){return function(_0x244b5b){if(_0x244b5b){return _0x244b5b[_0x5a0b('0x10')]()[_0x5a0b('0x11')](function(){var _0x475e12=_0x244b5b['get']({'plain':!![]});var _0x340a7e=_0x5a0b('0x12');return db[_0x5a0b('0x13')]['destroy']({'where':{'type':_0x340a7e,'resourceId':_0x475e12['id']}})[_0x5a0b('0x11')](function(){return _0x244b5b;});})[_0x5a0b('0x11')](function(){var _0x2ea6ce=new Redis(config[_0x5a0b('0x3')]);_0x2ea6ce[_0x5a0b('0x14')](_0x5a0b('0x15'),JSON[_0x5a0b('0x16')]({'id':_0x244b5b['id'],'deleted':!![]}));})['then'](function(){_0x2a83b0[_0x5a0b('0x8')](0xcc)[_0x5a0b('0x17')]();});}};}function handleEntityNotFound(_0x495df4){return function(_0x2e9ae5){if(!_0x2e9ae5){_0x495df4['sendStatus'](0x194);}return _0x2e9ae5;};}function handleError(_0x366ec2,_0x239222){_0x239222=_0x239222||0x1f4;return function(_0x71a813){logger[_0x5a0b('0x18')](_0x71a813[_0x5a0b('0x19')]);if(_0x71a813[_0x5a0b('0x1a')]){delete _0x71a813[_0x5a0b('0x1a')];}_0x366ec2[_0x5a0b('0x8')](_0x239222)[_0x5a0b('0x1b')](_0x71a813);};}exports[_0x5a0b('0x1c')]=function(_0x2c1df3,_0x5a16a6){var _0x17a108={},_0x93c323={},_0x368c9b={'count':0x0,'rows':[]};var _0x201331=_[_0x5a0b('0x1d')](db[_0x5a0b('0x1e')][_0x5a0b('0x1f')],function(_0x465b42){return{'name':_0x465b42[_0x5a0b('0x20')],'type':_0x465b42[_0x5a0b('0x21')]['key']};});_0x93c323['model']=_[_0x5a0b('0x1d')](_0x201331,_0x5a0b('0x1a'));_0x93c323[_0x5a0b('0x22')]=_['keys'](_0x2c1df3[_0x5a0b('0x22')]);_0x93c323[_0x5a0b('0x23')]=_[_0x5a0b('0x24')](_0x93c323['model'],_0x93c323['query']);_0x17a108[_0x5a0b('0x25')]=_[_0x5a0b('0x24')](_0x93c323[_0x5a0b('0x26')],qs[_0x5a0b('0x27')](_0x2c1df3[_0x5a0b('0x22')]['fields']));_0x17a108[_0x5a0b('0x25')]=_0x17a108[_0x5a0b('0x25')]['length']?_0x17a108[_0x5a0b('0x25')]:_0x93c323[_0x5a0b('0x26')];if(!_0x2c1df3[_0x5a0b('0x22')][_0x5a0b('0x28')](_0x5a0b('0x29'))){_0x17a108[_0x5a0b('0xb')]=qs[_0x5a0b('0xb')](_0x2c1df3[_0x5a0b('0x22')][_0x5a0b('0xb')]);_0x17a108['offset']=qs['offset'](_0x2c1df3[_0x5a0b('0x22')][_0x5a0b('0xa')]);}_0x17a108[_0x5a0b('0x2a')]=qs['sort'](_0x2c1df3['query'][_0x5a0b('0x2b')]);_0x17a108['where']=qs[_0x5a0b('0x23')](_[_0x5a0b('0x2c')](_0x2c1df3[_0x5a0b('0x22')],_0x93c323[_0x5a0b('0x23')]),_0x201331);if(_0x2c1df3[_0x5a0b('0x22')][_0x5a0b('0x2d')]){_0x17a108['where']=_[_0x5a0b('0x2e')](_0x17a108[_0x5a0b('0x2f')],{'$or':_[_0x5a0b('0x1d')](_0x201331,function(_0x4fbc2e){if(_0x4fbc2e['type']!==_0x5a0b('0x30')){var _0x1a81f9={};_0x1a81f9[_0x4fbc2e[_0x5a0b('0x1a')]]={'$like':'%'+_0x2c1df3[_0x5a0b('0x22')][_0x5a0b('0x2d')]+'%'};return _0x1a81f9;}})});}_0x17a108=_[_0x5a0b('0x2e')]({},_0x17a108,_0x2c1df3[_0x5a0b('0x31')]);var _0x232f17={'where':_0x17a108['where']};return db[_0x5a0b('0x1e')][_0x5a0b('0xd')](_0x232f17)['then'](function(_0x1913b4){_0x368c9b['count']=_0x1913b4;if(_0x2c1df3[_0x5a0b('0x22')]['includeAll']){_0x17a108['include']=[{'all':!![]}];}return db[_0x5a0b('0x1e')][_0x5a0b('0x32')](_0x17a108);})[_0x5a0b('0x11')](function(_0x4fa53e){_0x368c9b['rows']=_0x4fa53e;return _0x368c9b;})[_0x5a0b('0x11')](respondWithFilteredResult(_0x5a16a6,_0x17a108))['catch'](handleError(_0x5a16a6,null));};exports['show']=function(_0x2aa99e,_0x2d5941){var _0x260f15={'raw':![],'where':{'id':_0x2aa99e[_0x5a0b('0x33')]['id']}},_0x138cf7={};_0x138cf7['model']=_[_0x5a0b('0x34')](db[_0x5a0b('0x1e')][_0x5a0b('0x1f')]);_0x138cf7['query']=_[_0x5a0b('0x34')](_0x2aa99e[_0x5a0b('0x22')]);_0x138cf7[_0x5a0b('0x23')]=_[_0x5a0b('0x24')](_0x138cf7['model'],_0x138cf7['query']);_0x260f15[_0x5a0b('0x25')]=_['intersection'](_0x138cf7[_0x5a0b('0x26')],qs['fields'](_0x2aa99e[_0x5a0b('0x22')]['fields']));_0x260f15[_0x5a0b('0x25')]=_0x260f15['attributes']['length']?_0x260f15[_0x5a0b('0x25')]:_0x138cf7['model'];if(_0x2aa99e[_0x5a0b('0x22')][_0x5a0b('0x35')]){_0x260f15[_0x5a0b('0x36')]=[{'all':!![]}];}_0x260f15=_[_0x5a0b('0x2e')]({},_0x260f15,_0x2aa99e['options']);return db[_0x5a0b('0x1e')][_0x5a0b('0x37')](_0x260f15)[_0x5a0b('0x11')](handleEntityNotFound(_0x2d5941,null))[_0x5a0b('0x11')](respondWithResult(_0x2d5941,null))[_0x5a0b('0x38')](handleError(_0x2d5941,null));};exports['create']=function(_0x40b91d,_0x560aff){return db[_0x5a0b('0x1e')][_0x5a0b('0x39')](_0x40b91d['body'],{})[_0x5a0b('0x11')](function(_0x1a1862){var _0x52eebd=_0x40b91d[_0x5a0b('0x3a')][_0x5a0b('0x3b')]({'plain':!![]});if(!_0x52eebd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52eebd['role']==='user'){var _0x51b5a4=_0x1a1862['get']({'plain':!![]});var _0x1c6c9d=_0x5a0b('0x12');return db[_0x5a0b('0x3c')][_0x5a0b('0x37')]({'where':{'name':_0x1c6c9d,'userProfileId':_0x52eebd[_0x5a0b('0x3d')]},'raw':!![]})[_0x5a0b('0x11')](function(_0x11e05c){if(_0x11e05c&&_0x11e05c['autoAssociation']===0x0){return db[_0x5a0b('0x13')][_0x5a0b('0x39')]({'name':_0x51b5a4[_0x5a0b('0x1a')],'resourceId':_0x51b5a4['id'],'type':_0x11e05c[_0x5a0b('0x1a')],'sectionId':_0x11e05c['id']},{})[_0x5a0b('0x11')](function(){return _0x1a1862;});}else{return _0x1a1862;}})[_0x5a0b('0x38')](function(_0x5c5674){logger[_0x5a0b('0x18')](_0x5a0b('0x3e'),_0x5c5674);throw _0x5c5674;});}return _0x1a1862;})[_0x5a0b('0x11')](respondWithResult(_0x560aff,0xc9))[_0x5a0b('0x38')](handleError(_0x560aff,null));};exports[_0x5a0b('0xf')]=function(_0x4625c6,_0x111e9a){if(_0x4625c6[_0x5a0b('0x3f')]['id']){delete _0x4625c6['body']['id'];}return db[_0x5a0b('0x1e')][_0x5a0b('0x37')]({'where':{'id':_0x4625c6[_0x5a0b('0x33')]['id']}})[_0x5a0b('0x11')](handleEntityNotFound(_0x111e9a,null))['then'](saveUpdates(_0x4625c6[_0x5a0b('0x3f')],null))[_0x5a0b('0x11')](function(_0x2246b9){if(!_0x2246b9)return;var _0x24c9a7=_0x2246b9[_0x5a0b('0x3b')]({'plain':!![]});return _0x24c9a7;})[_0x5a0b('0x11')](function(_0x5e57b8){var _0x54ff9c=new Redis(config[_0x5a0b('0x3')]);_0x54ff9c['publish']('agi',JSON[_0x5a0b('0x16')](_[_0x5a0b('0x2c')](_0x5e57b8,['id',_0x5a0b('0x1a'),_0x5a0b('0x40')])));return _0x5e57b8;})[_0x5a0b('0x11')](respondWithResult(_0x111e9a,null))[_0x5a0b('0x38')](handleError(_0x111e9a,null));};exports[_0x5a0b('0x10')]=function(_0x5c4de2,_0x38eca2){return db[_0x5a0b('0x1e')]['find']({'where':{'id':_0x5c4de2[_0x5a0b('0x33')]['id']}})['then'](handleEntityNotFound(_0x38eca2,null))[_0x5a0b('0x11')](removeEntity(_0x38eca2,null))[_0x5a0b('0x38')](handleError(_0x38eca2,null));}; \ No newline at end of file +var _0x9dec=['sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','pick','filter','where','merge','options','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','publish','production','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','./squareProject.socket','status','json','offset','limit','undefined','count','set','Content-Range','destroy','then','get','UserProfileResource','agi','stringify','end'];(function(_0x42bc88,_0x34cab1){var _0x19a4f4=function(_0x1c708f){while(--_0x1c708f){_0x42bc88['push'](_0x42bc88['shift']());}};_0x19a4f4(++_0x34cab1);}(_0x9dec,0x138));var _0xc9de=function(_0x216939,_0x2bf81f){_0x216939=_0x216939-0x0;var _0xff19bd=_0x9dec[_0x216939];return _0xff19bd;};'use strict';var _=require(_0xc9de('0x0'));var Redis=require('ioredis');var qs=require(_0xc9de('0x1'));var logger=require(_0xc9de('0x2'))(_0xc9de('0x3'));var config=require(_0xc9de('0x4'));var db=require(_0xc9de('0x5'))['db'];config['redis']=_['defaults'](config[_0xc9de('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc9de('0x6')]));require(_0xc9de('0x7'))['register'](socket);function respondWithResult(_0x29359b,_0x19f250){_0x19f250=_0x19f250||0xc8;return function(_0x56d104){if(_0x56d104){return _0x29359b[_0xc9de('0x8')](_0x19f250)[_0xc9de('0x9')](_0x56d104);}};}function respondWithFilteredResult(_0x44b924,_0x3dd1fd){return function(_0x3e4415){if(_0x3e4415){var _0x572909=typeof _0x3dd1fd[_0xc9de('0xa')]==='undefined'&&typeof _0x3dd1fd[_0xc9de('0xb')]===_0xc9de('0xc');var _0x59f75a=_0x3e4415[_0xc9de('0xd')];var _0x342e42=_0x572909?0x0:_0x3dd1fd[_0xc9de('0xa')];var _0x456cbb=_0x572909?_0x3e4415[_0xc9de('0xd')]:_0x3dd1fd['offset']+_0x3dd1fd['limit'];var _0x2fdcd5;if(_0x456cbb>=_0x59f75a){_0x456cbb=_0x59f75a;_0x2fdcd5=0xc8;}else{_0x2fdcd5=0xce;}_0x44b924[_0xc9de('0x8')](_0x2fdcd5);return _0x44b924[_0xc9de('0xe')](_0xc9de('0xf'),_0x342e42+'-'+_0x456cbb+'/'+_0x59f75a)[_0xc9de('0x9')](_0x3e4415);}return null;};}function saveUpdates(_0x4528ef){return function(_0x482fb9){if(_0x482fb9){return _0x482fb9['update'](_0x4528ef)['then'](function(_0xc877ec){return _0xc877ec;});}return null;};}function removeEntity(_0x470bc9){return function(_0xb6e2d2){if(_0xb6e2d2){return _0xb6e2d2[_0xc9de('0x10')]()[_0xc9de('0x11')](function(){var _0xa904cc=_0xb6e2d2[_0xc9de('0x12')]({'plain':!![]});var _0x4d3b56='SquareProjects';return db[_0xc9de('0x13')][_0xc9de('0x10')]({'where':{'type':_0x4d3b56,'resourceId':_0xa904cc['id']}})['then'](function(){return _0xb6e2d2;});})[_0xc9de('0x11')](function(){var _0xb32b0e=new Redis(config['redis']);_0xb32b0e['publish'](_0xc9de('0x14'),JSON[_0xc9de('0x15')]({'id':_0xb6e2d2['id'],'deleted':!![]}));})[_0xc9de('0x11')](function(){_0x470bc9[_0xc9de('0x8')](0xcc)[_0xc9de('0x16')]();});}};}function handleEntityNotFound(_0x3a213d){return function(_0x3646df){if(!_0x3646df){_0x3a213d[_0xc9de('0x17')](0x194);}return _0x3646df;};}function handleError(_0x4ef997,_0x4d2cf6){_0x4d2cf6=_0x4d2cf6||0x1f4;return function(_0x1f1844){logger[_0xc9de('0x18')](_0x1f1844[_0xc9de('0x19')]);if(_0x1f1844[_0xc9de('0x1a')]){delete _0x1f1844[_0xc9de('0x1a')];}_0x4ef997[_0xc9de('0x8')](_0x4d2cf6)[_0xc9de('0x1b')](_0x1f1844);};}exports[_0xc9de('0x1c')]=function(_0x2cfc46,_0x330911){var _0x2176b5={},_0xb8ad6f={},_0x379441={'count':0x0,'rows':[]};var _0xddcc41=_[_0xc9de('0x1d')](db[_0xc9de('0x1e')][_0xc9de('0x1f')],function(_0x1427c2){return{'name':_0x1427c2[_0xc9de('0x20')],'type':_0x1427c2[_0xc9de('0x21')][_0xc9de('0x22')]};});_0xb8ad6f[_0xc9de('0x23')]=_[_0xc9de('0x1d')](_0xddcc41,_0xc9de('0x1a'));_0xb8ad6f['query']=_[_0xc9de('0x24')](_0x2cfc46['query']);_0xb8ad6f[_0xc9de('0x25')]=_[_0xc9de('0x26')](_0xb8ad6f[_0xc9de('0x23')],_0xb8ad6f[_0xc9de('0x27')]);_0x2176b5['attributes']=_['intersection'](_0xb8ad6f[_0xc9de('0x23')],qs[_0xc9de('0x28')](_0x2cfc46[_0xc9de('0x27')]['fields']));_0x2176b5[_0xc9de('0x29')]=_0x2176b5['attributes']['length']?_0x2176b5[_0xc9de('0x29')]:_0xb8ad6f[_0xc9de('0x23')];if(!_0x2cfc46[_0xc9de('0x27')][_0xc9de('0x2a')](_0xc9de('0x2b'))){_0x2176b5['limit']=qs['limit'](_0x2cfc46[_0xc9de('0x27')][_0xc9de('0xb')]);_0x2176b5[_0xc9de('0xa')]=qs[_0xc9de('0xa')](_0x2cfc46['query'][_0xc9de('0xa')]);}_0x2176b5[_0xc9de('0x2c')]=qs['sort'](_0x2cfc46[_0xc9de('0x27')]['sort']);_0x2176b5['where']=qs['filters'](_[_0xc9de('0x2d')](_0x2cfc46[_0xc9de('0x27')],_0xb8ad6f[_0xc9de('0x25')]),_0xddcc41);if(_0x2cfc46[_0xc9de('0x27')][_0xc9de('0x2e')]){_0x2176b5[_0xc9de('0x2f')]=_[_0xc9de('0x30')](_0x2176b5[_0xc9de('0x2f')],{'$or':_[_0xc9de('0x1d')](_0xddcc41,function(_0x2331fc){if(_0x2331fc[_0xc9de('0x21')]!=='VIRTUAL'){var _0x406f40={};_0x406f40[_0x2331fc['name']]={'$like':'%'+_0x2cfc46[_0xc9de('0x27')][_0xc9de('0x2e')]+'%'};return _0x406f40;}})});}_0x2176b5=_[_0xc9de('0x30')]({},_0x2176b5,_0x2cfc46[_0xc9de('0x31')]);var _0x34e199={'where':_0x2176b5[_0xc9de('0x2f')]};return db[_0xc9de('0x1e')]['count'](_0x34e199)[_0xc9de('0x11')](function(_0x500402){_0x379441[_0xc9de('0xd')]=_0x500402;if(_0x2cfc46[_0xc9de('0x27')]['includeAll']){_0x2176b5[_0xc9de('0x32')]=[{'all':!![]}];}return db[_0xc9de('0x1e')][_0xc9de('0x33')](_0x2176b5);})[_0xc9de('0x11')](function(_0x421031){_0x379441[_0xc9de('0x34')]=_0x421031;return _0x379441;})[_0xc9de('0x11')](respondWithFilteredResult(_0x330911,_0x2176b5))[_0xc9de('0x35')](handleError(_0x330911,null));};exports['show']=function(_0x5b01bf,_0x4b46bd){var _0x58bd27={'raw':![],'where':{'id':_0x5b01bf[_0xc9de('0x36')]['id']}},_0x3aaa2c={};_0x3aaa2c[_0xc9de('0x23')]=_['keys'](db[_0xc9de('0x1e')]['rawAttributes']);_0x3aaa2c[_0xc9de('0x27')]=_[_0xc9de('0x24')](_0x5b01bf['query']);_0x3aaa2c[_0xc9de('0x25')]=_[_0xc9de('0x26')](_0x3aaa2c['model'],_0x3aaa2c[_0xc9de('0x27')]);_0x58bd27[_0xc9de('0x29')]=_[_0xc9de('0x26')](_0x3aaa2c[_0xc9de('0x23')],qs[_0xc9de('0x28')](_0x5b01bf[_0xc9de('0x27')][_0xc9de('0x28')]));_0x58bd27[_0xc9de('0x29')]=_0x58bd27[_0xc9de('0x29')][_0xc9de('0x37')]?_0x58bd27[_0xc9de('0x29')]:_0x3aaa2c[_0xc9de('0x23')];if(_0x5b01bf[_0xc9de('0x27')]['includeAll']){_0x58bd27[_0xc9de('0x32')]=[{'all':!![]}];}_0x58bd27=_[_0xc9de('0x30')]({},_0x58bd27,_0x5b01bf['options']);return db[_0xc9de('0x1e')][_0xc9de('0x38')](_0x58bd27)['then'](handleEntityNotFound(_0x4b46bd,null))[_0xc9de('0x11')](respondWithResult(_0x4b46bd,null))['catch'](handleError(_0x4b46bd,null));};exports[_0xc9de('0x39')]=function(_0x585670,_0x4fa6bb){return db[_0xc9de('0x1e')]['create'](_0x585670[_0xc9de('0x3a')],{})[_0xc9de('0x11')](function(_0x3300e8){var _0x13c206=_0x585670[_0xc9de('0x3b')][_0xc9de('0x12')]({'plain':!![]});if(!_0x13c206)throw new Error(_0xc9de('0x3c'));if(_0x13c206[_0xc9de('0x3d')]===_0xc9de('0x3b')){var _0x4c1b1e=_0x3300e8[_0xc9de('0x12')]({'plain':!![]});var _0x50e586=_0xc9de('0x3e');return db[_0xc9de('0x3f')][_0xc9de('0x38')]({'where':{'name':_0x50e586,'userProfileId':_0x13c206['userProfileId']},'raw':!![]})[_0xc9de('0x11')](function(_0x211eb5){if(_0x211eb5&&_0x211eb5['autoAssociation']===0x0){return db[_0xc9de('0x13')][_0xc9de('0x39')]({'name':_0x4c1b1e[_0xc9de('0x1a')],'resourceId':_0x4c1b1e['id'],'type':_0x211eb5[_0xc9de('0x1a')],'sectionId':_0x211eb5['id']},{})[_0xc9de('0x11')](function(){return _0x3300e8;});}else{return _0x3300e8;}})[_0xc9de('0x35')](function(_0x184434){logger[_0xc9de('0x18')](_0xc9de('0x40'),_0x184434);throw _0x184434;});}return _0x3300e8;})[_0xc9de('0x11')](respondWithResult(_0x4fa6bb,0xc9))[_0xc9de('0x35')](handleError(_0x4fa6bb,null));};exports['update']=function(_0x1ea23b,_0x5bd891){if(_0x1ea23b[_0xc9de('0x3a')]['id']){delete _0x1ea23b[_0xc9de('0x3a')]['id'];}return db[_0xc9de('0x1e')][_0xc9de('0x38')]({'where':{'id':_0x1ea23b[_0xc9de('0x36')]['id']}})[_0xc9de('0x11')](handleEntityNotFound(_0x5bd891,null))[_0xc9de('0x11')](saveUpdates(_0x1ea23b[_0xc9de('0x3a')],null))[_0xc9de('0x11')](function(_0x7dd301){if(!_0x7dd301)return;var _0x120051=_0x7dd301['get']({'plain':!![]});return _0x120051;})['then'](function(_0x2c8603){var _0x2eb7de=new Redis(config[_0xc9de('0x6')]);_0x2eb7de[_0xc9de('0x41')](_0xc9de('0x14'),JSON['stringify'](_[_0xc9de('0x2d')](_0x2c8603,['id',_0xc9de('0x1a'),_0xc9de('0x42')])));return _0x2c8603;})[_0xc9de('0x11')](respondWithResult(_0x5bd891,null))['catch'](handleError(_0x5bd891,null));};exports[_0xc9de('0x10')]=function(_0xd82cd,_0x1bced1){return db[_0xc9de('0x1e')][_0xc9de('0x38')]({'where':{'id':_0xd82cd['params']['id']}})[_0xc9de('0x11')](handleEntityNotFound(_0x1bced1,null))[_0xc9de('0x11')](removeEntity(_0x1bced1,null))[_0xc9de('0x35')](handleError(_0x1bced1,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index e340884..475f505 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 _0x3c7b=['exports','../../mysqldb','SquareProject','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2046e8,_0x233be4){var _0x33c3ca=function(_0x48473a){while(--_0x48473a){_0x2046e8['push'](_0x2046e8['shift']());}};_0x33c3ca(++_0x233be4);}(_0x3c7b,0xeb));var _0xb3c7=function(_0x51a403,_0x3ca1c8){_0x51a403=_0x51a403-0x0;var _0x13554c=_0x3c7b[_0x51a403];return _0x13554c;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xb3c7('0x0'))['db'][_0xb3c7('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb3c7('0x2'),'afterUpdate':_0xb3c7('0x3'),'afterDestroy':_0xb3c7('0x4')};function emitEvent(_0x1cbcb1){return function(_0x1da021,_0x42ed72,_0x5baa5a){SquareProjectEvents[_0xb3c7('0x5')](_0x1cbcb1+':'+_0x1da021['id'],_0x1da021);SquareProjectEvents['emit'](_0x1cbcb1,_0x1da021);_0x5baa5a(null);};}for(var e in events){if(events[_0xb3c7('0x6')](e)){var event=events[e];SquareProject[_0xb3c7('0x7')](e,emitEvent(event));}}module[_0xb3c7('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x0345=['update','remove','exports','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x208423,_0x4e1745){var _0x1fba5d=function(_0x585aca){while(--_0x585aca){_0x208423['push'](_0x208423['shift']());}};_0x1fba5d(++_0x4e1745);}(_0x0345,0x168));var _0x5034=function(_0x2c7eda,_0x440c51){_0x2c7eda=_0x2c7eda-0x0;var _0x15839c=_0x0345[_0x2c7eda];return _0x15839c;};'use strict';var EventEmitter=require(_0x5034('0x0'));var SquareProject=require(_0x5034('0x1'))['db'][_0x5034('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x5034('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5034('0x4'),'afterDestroy':_0x5034('0x5')};function emitEvent(_0x4c2559){return function(_0x200b66,_0xfca532,_0x24eae9){SquareProjectEvents['emit'](_0x4c2559+':'+_0x200b66['id'],_0x200b66);SquareProjectEvents['emit'](_0x4c2559,_0x200b66);_0x24eae9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x5034('0x6')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 9a4e7a5..658b6a9 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 _0x8ad7=['../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x30dd51,_0x340cbf){var _0x619e1=function(_0x4b5c13){while(--_0x4b5c13){_0x30dd51['push'](_0x30dd51['shift']());}};_0x619e1(++_0x340cbf);}(_0x8ad7,0x175));var _0x78ad=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8ad7[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0x78ad('0x0'));var logger=require(_0x78ad('0x1'))(_0x78ad('0x2'));var moment=require(_0x78ad('0x3'));var BPromise=require('bluebird');var rp=require(_0x78ad('0x4'));var fs=require('fs');var path=require(_0x78ad('0x5'));var rimraf=require(_0x78ad('0x6'));var config=require(_0x78ad('0x7'));var attributes=require(_0x78ad('0x8'));module[_0x78ad('0x9')]=function(_0x191b20,_0x5213bf){return _0x191b20[_0x78ad('0xa')](_0x78ad('0xb'),attributes,{'tableName':_0x78ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x41840a,_0x112496,_0x257c0b){if(_0x41840a[_0x78ad('0xd')](_0x78ad('0xe'))){_0x41840a['savedAt']=moment()['format'](_0x78ad('0xf'));}if(_0x41840a[_0x78ad('0xd')](_0x78ad('0x10'))){_0x41840a[_0x78ad('0x11')]=moment()[_0x78ad('0x12')](_0x78ad('0xf'));}_0x257c0b(null,_0x41840a);}}});}; \ No newline at end of file +var _0x8c9f=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','changed','preproduction','format','production','publishedAt'];(function(_0x1b674c,_0x3f2397){var _0x21ae00=function(_0x3b16e3){while(--_0x3b16e3){_0x1b674c['push'](_0x1b674c['shift']());}};_0x21ae00(++_0x3f2397);}(_0x8c9f,0x1d5));var _0xf8c9=function(_0x3b2c58,_0x22f82a){_0x3b2c58=_0x3b2c58-0x0;var _0x365939=_0x8c9f[_0x3b2c58];return _0x365939;};'use strict';var _=require('lodash');var util=require(_0xf8c9('0x0'));var logger=require(_0xf8c9('0x1'))(_0xf8c9('0x2'));var moment=require(_0xf8c9('0x3'));var BPromise=require(_0xf8c9('0x4'));var rp=require(_0xf8c9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8c9('0x6'));var config=require(_0xf8c9('0x7'));var attributes=require(_0xf8c9('0x8'));module[_0xf8c9('0x9')]=function(_0x1b77d6,_0x55eb6c){return _0x1b77d6['define'](_0xf8c9('0xa'),attributes,{'tableName':_0xf8c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d14aa,_0x896d49,_0x42185e){if(_0x4d14aa[_0xf8c9('0xc')](_0xf8c9('0xd'))){_0x4d14aa['savedAt']=moment()[_0xf8c9('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4d14aa[_0xf8c9('0xc')](_0xf8c9('0xf'))){_0x4d14aa[_0xf8c9('0x10')]=moment()[_0xf8c9('0xe')](_0xf8c9('0x11'));}_0x42185e(null,_0x4d14aa);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index d7ac08a..95cf0e9 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 _0xc022=['GetSquareProjects','SquareProject','options','raw','where','limit','include','map','attributes','model','then','info','stringify','catch','error','message','ShowSquareProject','find','debug','ioredis','../../config/logger','rpc','redis','defaults','socket.io-emitter','./squareProject.socket'];(function(_0x62062b,_0x83335e){var _0x3e722c=function(_0x4bcb9b){while(--_0x4bcb9b){_0x62062b['push'](_0x62062b['shift']());}};_0x3e722c(++_0x83335e);}(_0xc022,0xe3));var _0x2c02=function(_0x31f207,_0x33353a){_0x31f207=_0x31f207-0x0;var _0x1089ef=_0xc022[_0x31f207];return _0x1089ef;};'use strict';var _=require('lodash');var Redis=require(_0x2c02('0x0'));var db=require('../../mysqldb')['db'];var logger=require(_0x2c02('0x1'))(_0x2c02('0x2'));var config=require('../../config/environment');config[_0x2c02('0x3')]=_[_0x2c02('0x4')](config[_0x2c02('0x3')],{'host':'localhost','port':0x18eb});var socket=require(_0x2c02('0x5'))(new Redis(config['redis']));require(_0x2c02('0x6'))['register'](socket);exports[_0x2c02('0x7')]=function(_0x1e1de3){var _0x9696fe=this;return new Promise(function(_0x18e607,_0x10d752){return db[_0x2c02('0x8')]['findAll']({'raw':_0x1e1de3[_0x2c02('0x9')]?_0x1e1de3[_0x2c02('0x9')][_0x2c02('0xa')]===undefined?!![]:![]:!![],'where':_0x1e1de3[_0x2c02('0x9')]?_0x1e1de3[_0x2c02('0x9')][_0x2c02('0xb')]||null:null,'attributes':_0x1e1de3[_0x2c02('0x9')]?_0x1e1de3[_0x2c02('0x9')]['attributes']||null:null,'limit':_0x1e1de3[_0x2c02('0x9')]?_0x1e1de3['options'][_0x2c02('0xc')]||null:null,'include':_0x1e1de3['options']?_0x1e1de3[_0x2c02('0x9')][_0x2c02('0xd')]?_[_0x2c02('0xe')](_0x1e1de3[_0x2c02('0x9')][_0x2c02('0xd')],function(_0x1f85c3){return{'model':db[_0x1f85c3['model']],'as':_0x1f85c3['as'],'attributes':_0x1f85c3[_0x2c02('0xf')],'include':_0x1f85c3[_0x2c02('0xd')]?_['map'](_0x1f85c3[_0x2c02('0xd')],function(_0x1c4ff7){return{'model':db[_0x1c4ff7['model']],'as':_0x1c4ff7['as'],'attributes':_0x1c4ff7[_0x2c02('0xf')],'include':_0x1c4ff7[_0x2c02('0xd')]?_[_0x2c02('0xe')](_0x1c4ff7['include'],function(_0x30e18b){return{'model':db[_0x30e18b[_0x2c02('0x10')]],'as':_0x30e18b['as'],'attributes':_0x30e18b[_0x2c02('0xf')]};}):[]};}):[]};}):[]:[]})[_0x2c02('0x11')](function(_0x1c8f2c){logger[_0x2c02('0x12')](_0x2c02('0x7'),_0x1e1de3);logger['debug']('GetSquareProjects',_0x1e1de3,JSON[_0x2c02('0x13')](_0x1c8f2c));_0x18e607(_0x1c8f2c);})[_0x2c02('0x14')](function(_0x298b7b){logger[_0x2c02('0x15')](_0x2c02('0x7'),_0x298b7b['message'],_0x1e1de3);_0x10d752(_0x9696fe[_0x2c02('0x15')](0x1f4,_0x298b7b[_0x2c02('0x16')]));});});};exports[_0x2c02('0x17')]=function(_0x4b72e0){var _0x4e66ca=this;return new Promise(function(_0x2cab56,_0x3f1183){return db[_0x2c02('0x8')][_0x2c02('0x18')]({'raw':_0x4b72e0['options']?_0x4b72e0[_0x2c02('0x9')][_0x2c02('0xa')]===undefined?!![]:![]:!![],'where':_0x4b72e0['options']?_0x4b72e0[_0x2c02('0x9')][_0x2c02('0xb')]||null:null,'attributes':_0x4b72e0[_0x2c02('0x9')]?_0x4b72e0[_0x2c02('0x9')][_0x2c02('0xf')]||null:null,'include':_0x4b72e0[_0x2c02('0x9')]?_0x4b72e0[_0x2c02('0x9')]['include']?_[_0x2c02('0xe')](_0x4b72e0[_0x2c02('0x9')]['include'],function(_0x16bc0a){return{'model':db[_0x16bc0a[_0x2c02('0x10')]],'as':_0x16bc0a['as'],'attributes':_0x16bc0a[_0x2c02('0xf')],'include':_0x16bc0a[_0x2c02('0xd')]?_[_0x2c02('0xe')](_0x16bc0a[_0x2c02('0xd')],function(_0xba715d){return{'model':db[_0xba715d[_0x2c02('0x10')]],'as':_0xba715d['as'],'attributes':_0xba715d[_0x2c02('0xf')],'include':_0xba715d[_0x2c02('0xd')]?_[_0x2c02('0xe')](_0xba715d[_0x2c02('0xd')],function(_0x515f41){return{'model':db[_0x515f41[_0x2c02('0x10')]],'as':_0x515f41['as'],'attributes':_0x515f41['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x17a38d){logger[_0x2c02('0x12')](_0x2c02('0x17'),_0x4b72e0);logger[_0x2c02('0x19')](_0x2c02('0x17'),_0x4b72e0,JSON[_0x2c02('0x13')](_0x17a38d));_0x2cab56(_0x17a38d);})[_0x2c02('0x14')](function(_0x50e587){logger[_0x2c02('0x15')]('ShowSquareProject',_0x50e587['message'],_0x4b72e0);_0x3f1183(_0x4e66ca['error'](0x1f4,_0x50e587[_0x2c02('0x16')]));});});}; \ No newline at end of file +var _0xc17f=['GetSquareProjects','SquareProject','findAll','options','raw','where','limit','include','map','model','attributes','then','stringify','message','error','ShowSquareProject','find','info','catch','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket'];(function(_0x5669b5,_0x3f8d77){var _0x265ffb=function(_0x58faca){while(--_0x58faca){_0x5669b5['push'](_0x5669b5['shift']());}};_0x265ffb(++_0x3f8d77);}(_0xc17f,0x106));var _0xfc17=function(_0x32032a,_0x24e8d1){_0x32032a=_0x32032a-0x0;var _0x5d5792=_0xc17f[_0x32032a];return _0x5d5792;};'use strict';var _=require('lodash');var Redis=require('ioredis');var db=require(_0xfc17('0x0'))['db'];var logger=require(_0xfc17('0x1'))('rpc');var config=require(_0xfc17('0x2'));config[_0xfc17('0x3')]=_[_0xfc17('0x4')](config[_0xfc17('0x3')],{'host':_0xfc17('0x5'),'port':0x18eb});var socket=require(_0xfc17('0x6'))(new Redis(config[_0xfc17('0x3')]));require(_0xfc17('0x7'))['register'](socket);exports[_0xfc17('0x8')]=function(_0x3ea821){var _0x2ce98c=this;return new Promise(function(_0x1b819b,_0x540da5){return db[_0xfc17('0x9')][_0xfc17('0xa')]({'raw':_0x3ea821[_0xfc17('0xb')]?_0x3ea821[_0xfc17('0xb')][_0xfc17('0xc')]===undefined?!![]:![]:!![],'where':_0x3ea821[_0xfc17('0xb')]?_0x3ea821[_0xfc17('0xb')][_0xfc17('0xd')]||null:null,'attributes':_0x3ea821[_0xfc17('0xb')]?_0x3ea821[_0xfc17('0xb')]['attributes']||null:null,'limit':_0x3ea821[_0xfc17('0xb')]?_0x3ea821[_0xfc17('0xb')][_0xfc17('0xe')]||null:null,'include':_0x3ea821[_0xfc17('0xb')]?_0x3ea821[_0xfc17('0xb')][_0xfc17('0xf')]?_[_0xfc17('0x10')](_0x3ea821['options'][_0xfc17('0xf')],function(_0x2f5df9){return{'model':db[_0x2f5df9[_0xfc17('0x11')]],'as':_0x2f5df9['as'],'attributes':_0x2f5df9[_0xfc17('0x12')],'include':_0x2f5df9[_0xfc17('0xf')]?_[_0xfc17('0x10')](_0x2f5df9[_0xfc17('0xf')],function(_0x9d6d41){return{'model':db[_0x9d6d41[_0xfc17('0x11')]],'as':_0x9d6d41['as'],'attributes':_0x9d6d41[_0xfc17('0x12')],'include':_0x9d6d41[_0xfc17('0xf')]?_[_0xfc17('0x10')](_0x9d6d41[_0xfc17('0xf')],function(_0x244da4){return{'model':db[_0x244da4[_0xfc17('0x11')]],'as':_0x244da4['as'],'attributes':_0x244da4[_0xfc17('0x12')]};}):[]};}):[]};}):[]:[]})[_0xfc17('0x13')](function(_0x9216de){logger['info'](_0xfc17('0x8'),_0x3ea821);logger['debug']('GetSquareProjects',_0x3ea821,JSON[_0xfc17('0x14')](_0x9216de));_0x1b819b(_0x9216de);})['catch'](function(_0x2e9afd){logger['error'](_0xfc17('0x8'),_0x2e9afd[_0xfc17('0x15')],_0x3ea821);_0x540da5(_0x2ce98c[_0xfc17('0x16')](0x1f4,_0x2e9afd[_0xfc17('0x15')]));});});};exports[_0xfc17('0x17')]=function(_0x411f3e){var _0x57c076=this;return new Promise(function(_0x5ee6e5,_0x509297){return db[_0xfc17('0x9')][_0xfc17('0x18')]({'raw':_0x411f3e[_0xfc17('0xb')]?_0x411f3e['options'][_0xfc17('0xc')]===undefined?!![]:![]:!![],'where':_0x411f3e[_0xfc17('0xb')]?_0x411f3e[_0xfc17('0xb')][_0xfc17('0xd')]||null:null,'attributes':_0x411f3e[_0xfc17('0xb')]?_0x411f3e['options'][_0xfc17('0x12')]||null:null,'include':_0x411f3e[_0xfc17('0xb')]?_0x411f3e[_0xfc17('0xb')]['include']?_['map'](_0x411f3e[_0xfc17('0xb')][_0xfc17('0xf')],function(_0x91d6cc){return{'model':db[_0x91d6cc['model']],'as':_0x91d6cc['as'],'attributes':_0x91d6cc[_0xfc17('0x12')],'include':_0x91d6cc[_0xfc17('0xf')]?_['map'](_0x91d6cc[_0xfc17('0xf')],function(_0x435497){return{'model':db[_0x435497['model']],'as':_0x435497['as'],'attributes':_0x435497['attributes'],'include':_0x435497[_0xfc17('0xf')]?_['map'](_0x435497[_0xfc17('0xf')],function(_0x2d3a93){return{'model':db[_0x2d3a93['model']],'as':_0x2d3a93['as'],'attributes':_0x2d3a93[_0xfc17('0x12')]};}):[]};}):[]};}):[]:[]})[_0xfc17('0x13')](function(_0x336cbf){logger[_0xfc17('0x19')](_0xfc17('0x17'),_0x411f3e);logger['debug'](_0xfc17('0x17'),_0x411f3e,JSON[_0xfc17('0x14')](_0x336cbf));_0x5ee6e5(_0x336cbf);})[_0xfc17('0x1a')](function(_0x35c4a9){logger['error'](_0xfc17('0x17'),_0x35c4a9[_0xfc17('0x15')],_0x411f3e);_0x509297(_0x57c076[_0xfc17('0x16')](0x1f4,_0x35c4a9[_0xfc17('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 7d973f9..a4e1f62 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 _0x4206=['squareProject:','./squareProject.events','update','emit','removeListener','register','length'];(function(_0xac1d73,_0x1d3a80){var _0x1652e0=function(_0x3ec034){while(--_0x3ec034){_0xac1d73['push'](_0xac1d73['shift']());}};_0x1652e0(++_0x1d3a80);}(_0x4206,0x166));var _0x6420=function(_0xe9eb3d,_0x187f37){_0xe9eb3d=_0xe9eb3d-0x0;var _0x411a83=_0x4206[_0xe9eb3d];return _0x411a83;};'use strict';var SquareProjectEvents=require(_0x6420('0x0'));var events=['save','remove',_0x6420('0x1')];function createListener(_0x101b6e,_0x27a515){return function(_0x1b3c34){_0x27a515[_0x6420('0x2')](_0x101b6e,_0x1b3c34);};}function removeListener(_0x4419d2,_0x39108b){return function(){SquareProjectEvents[_0x6420('0x3')](_0x4419d2,_0x39108b);};}exports[_0x6420('0x4')]=function(_0x2304b6){for(var _0x1c098b=0x0,_0x369bb3=events[_0x6420('0x5')];_0x1c098b<_0x369bb3;_0x1c098b++){var _0x30d77e=events[_0x1c098b];var _0x2df9de=createListener(_0x6420('0x6')+_0x30d77e,_0x2304b6);SquareProjectEvents['on'](_0x30d77e,_0x2df9de);}}; \ No newline at end of file +var _0x384b=['update','emit','register','length','squareProject:','./squareProject.events','save','remove'];(function(_0x357f00,_0x1e8454){var _0x450b67=function(_0x48ee57){while(--_0x48ee57){_0x357f00['push'](_0x357f00['shift']());}};_0x450b67(++_0x1e8454);}(_0x384b,0x1d5));var _0xb384=function(_0x5bd729,_0x15805f){_0x5bd729=_0x5bd729-0x0;var _0x1a1537=_0x384b[_0x5bd729];return _0x1a1537;};'use strict';var SquareProjectEvents=require(_0xb384('0x0'));var events=[_0xb384('0x1'),_0xb384('0x2'),_0xb384('0x3')];function createListener(_0x40d6a8,_0x31a8da){return function(_0xb5b425){_0x31a8da[_0xb384('0x4')](_0x40d6a8,_0xb5b425);};}function removeListener(_0x2298a3,_0x4eb47d){return function(){SquareProjectEvents['removeListener'](_0x2298a3,_0x4eb47d);};}exports[_0xb384('0x5')]=function(_0x32fa13){for(var _0x39154c=0x0,_0x172ff3=events[_0xb384('0x6')];_0x39154c<_0x172ff3;_0x39154c++){var _0x22a8cb=events[_0x39154c];var _0x43cc05=createListener(_0xb384('0x7')+_0x22a8cb,_0x32fa13);SquareProjectEvents['on'](_0x22a8cb,_0x43cc05);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 891927d..f9e48df 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 _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x4bc25c,_0x16ef0a){var _0x19803b=function(_0x1b6329){while(--_0x1b6329){_0x4bc25c['push'](_0x4bc25c['shift']());}};_0x19803b(++_0x16ef0a);}(_0x1261,0x144));var _0x1126=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0x1261[_0x1c6ef2];return _0x404b8c;};'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')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router; \ No newline at end of file +var _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0x2b0bec,_0xf00a20){var _0x3baaa0=function(_0x2dad20){while(--_0x2dad20){_0x2b0bec['push'](_0x2b0bec['shift']());}};_0x3baaa0(++_0xf00a20);}(_0xe14b,0x93));var _0xbe14=function(_0x2aec1f,_0x234d35){_0x2aec1f=_0x2aec1f-0x0;var _0x20c0e2=_0xe14b[_0x2aec1f];return _0x20c0e2;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 2995fca..c98bdbc 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 _0x8958=['savePath','substring','lastIndexOf','exports','STRING','VIRTUAL'];(function(_0x305bbf,_0x5647b3){var _0x4ed772=function(_0x3315ed){while(--_0x3315ed){_0x305bbf['push'](_0x305bbf['shift']());}};_0x4ed772(++_0x5647b3);}(_0x8958,0x93));var _0x8895=function(_0x5209e0,_0x1f8bb0){_0x5209e0=_0x5209e0-0x0;var _0x55d5cc=_0x8958[_0x5209e0];return _0x55d5cc;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x8895('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8895('0x1')]},'dnid':{'type':Sequelize[_0x8895('0x1')]},'projectName':{'type':Sequelize[_0x8895('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x8895('0x1')]},'savePath':{'type':Sequelize[_0x8895('0x1')]},'format':{'type':Sequelize[_0x8895('0x2')],'get':function(){var _0x40cec6='';var _0x33013a=this['getDataValue'](_0x8895('0x3'));if(_0x33013a){_0x40cec6=_0x33013a[_0x8895('0x4')](_0x33013a[_0x8895('0x5')]('.'));}return _0x40cec6;}}}; \ No newline at end of file +var _0xac31=['STRING','VIRTUAL','savePath','lastIndexOf','sequelize','exports'];(function(_0x46bd99,_0x25c97d){var _0x51903b=function(_0x190f06){while(--_0x190f06){_0x46bd99['push'](_0x46bd99['shift']());}};_0x51903b(++_0x25c97d);}(_0xac31,0xca));var _0x1ac3=function(_0x170d15,_0x5d1bee){_0x170d15=_0x170d15-0x0;var _0xc385f7=_0xac31[_0x170d15];return _0xc385f7;};'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 5dc1e96..4018fc5 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 _0x6a5f=['create','body','download','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','extname','unlink','SquareRecording\x20not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','name','send','index','map','SquareRecording','rawAttributes','fieldName','key','model','query','intersection','fields','length','attributes','hasOwnProperty','sort','filters','pick','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','find'];(function(_0x52949d,_0x5750ec){var _0x570250=function(_0xd9636a){while(--_0xd9636a){_0x52949d['push'](_0x52949d['shift']());}};_0x570250(++_0x5750ec);}(_0x6a5f,0x77));var _0xf6a5=function(_0xd1cf76,_0x1e667d){_0xd1cf76=_0xd1cf76-0x0;var _0x580cbf=_0x6a5f[_0xd1cf76];return _0x580cbf;};'use strict';var emlformat=require(_0xf6a5('0x0'));var rimraf=require(_0xf6a5('0x1'));var zipdir=require(_0xf6a5('0x2'));var jsonpatch=require(_0xf6a5('0x3'));var rp=require(_0xf6a5('0x4'));var moment=require(_0xf6a5('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf6a5('0x6'));var path=require(_0xf6a5('0x7'));var sox=require(_0xf6a5('0x8'));var csv=require(_0xf6a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf6a5('0xa'));var squel=require(_0xf6a5('0xb'));var crypto=require(_0xf6a5('0xc'));var jsforce=require(_0xf6a5('0xd'));var deskjs=require(_0xf6a5('0xe'));var toCsv=require(_0xf6a5('0x9'));var querystring=require('querystring');var Papa=require(_0xf6a5('0xf'));var Redis=require(_0xf6a5('0x10'));var authService=require(_0xf6a5('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6a5('0x12'));var logger=require(_0xf6a5('0x13'))(_0xf6a5('0x14'));var utils=require(_0xf6a5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf6a5('0x16'));var db=require(_0xf6a5('0x17'))['db'];function respondWithStatusCode(_0x8294a,_0x49915d){_0x49915d=_0x49915d||0xcc;return function(_0x4cdd5d){if(_0x4cdd5d){return _0x8294a[_0xf6a5('0x18')](_0x49915d);}return _0x8294a['status'](_0x49915d)[_0xf6a5('0x19')]();};}function respondWithResult(_0x4b0fff,_0xe6f29d){_0xe6f29d=_0xe6f29d||0xc8;return function(_0x5e2523){if(_0x5e2523){return _0x4b0fff[_0xf6a5('0x1a')](_0xe6f29d)['json'](_0x5e2523);}};}function respondWithFilteredResult(_0x3b632e,_0x545876){return function(_0x1f5d1f){if(_0x1f5d1f){var _0x26869a=typeof _0x545876[_0xf6a5('0x1b')]===_0xf6a5('0x1c')&&typeof _0x545876[_0xf6a5('0x1d')]===_0xf6a5('0x1c');var _0x49fea3=_0x1f5d1f[_0xf6a5('0x1e')];var _0x45c2b7=_0x26869a?0x0:_0x545876[_0xf6a5('0x1b')];var _0x371109=_0x26869a?_0x1f5d1f[_0xf6a5('0x1e')]:_0x545876[_0xf6a5('0x1b')]+_0x545876[_0xf6a5('0x1d')];var _0xbaeb64;if(_0x371109>=_0x49fea3){_0x371109=_0x49fea3;_0xbaeb64=0xc8;}else{_0xbaeb64=0xce;}_0x3b632e[_0xf6a5('0x1a')](_0xbaeb64);return _0x3b632e['set']('Content-Range',_0x45c2b7+'-'+_0x371109+'/'+_0x49fea3)['json'](_0x1f5d1f);}return null;};}function patchUpdates(_0x27b32e){return function(_0x26f533){try{jsonpatch[_0xf6a5('0x1f')](_0x26f533,_0x27b32e,!![]);}catch(_0x5e80dd){return BPromise[_0xf6a5('0x20')](_0x5e80dd);}return _0x26f533[_0xf6a5('0x21')]();};}function saveUpdates(_0x116c2c,_0xddd0da){return function(_0x5ec35c){if(_0x5ec35c){return _0x5ec35c[_0xf6a5('0x22')](_0x116c2c)[_0xf6a5('0x23')](function(_0x4dca6d){return _0x4dca6d;});}return null;};}function removeEntity(_0xb1d271,_0x1b8529){return function(_0x29170a){if(_0x29170a){return _0x29170a[_0xf6a5('0x24')]()[_0xf6a5('0x23')](function(){_0xb1d271[_0xf6a5('0x1a')](0xcc)[_0xf6a5('0x19')]();});}};}function handleEntityNotFound(_0xa594d0,_0x1f4b7e){return function(_0x67bf0f){if(!_0x67bf0f){_0xa594d0[_0xf6a5('0x18')](0x194);}return _0x67bf0f;};}function handleError(_0x5adc60,_0x365707){_0x365707=_0x365707||0x1f4;return function(_0x481d06){logger[_0xf6a5('0x25')](_0x481d06['stack']);if(_0x481d06[_0xf6a5('0x26')]){delete _0x481d06['name'];}_0x5adc60[_0xf6a5('0x1a')](_0x365707)[_0xf6a5('0x27')](_0x481d06);};}exports[_0xf6a5('0x28')]=function(_0x5728b2,_0x563c1e){var _0x77fdc4={},_0x1c0a9d={},_0x52d75c={'count':0x0,'rows':[]};var _0x373df4=_[_0xf6a5('0x29')](db[_0xf6a5('0x2a')][_0xf6a5('0x2b')],function(_0x138f77){return{'name':_0x138f77[_0xf6a5('0x2c')],'type':_0x138f77['type'][_0xf6a5('0x2d')]};});_0x1c0a9d[_0xf6a5('0x2e')]=_[_0xf6a5('0x29')](_0x373df4,_0xf6a5('0x26'));_0x1c0a9d[_0xf6a5('0x2f')]=_['keys'](_0x5728b2[_0xf6a5('0x2f')]);_0x1c0a9d['filters']=_[_0xf6a5('0x30')](_0x1c0a9d[_0xf6a5('0x2e')],_0x1c0a9d[_0xf6a5('0x2f')]);_0x77fdc4['attributes']=_['intersection'](_0x1c0a9d[_0xf6a5('0x2e')],qs[_0xf6a5('0x31')](_0x5728b2[_0xf6a5('0x2f')][_0xf6a5('0x31')]));_0x77fdc4['attributes']=_0x77fdc4['attributes'][_0xf6a5('0x32')]?_0x77fdc4[_0xf6a5('0x33')]:_0x1c0a9d['model'];if(!_0x5728b2[_0xf6a5('0x2f')][_0xf6a5('0x34')]('nolimit')){_0x77fdc4['limit']=qs['limit'](_0x5728b2[_0xf6a5('0x2f')]['limit']);_0x77fdc4['offset']=qs[_0xf6a5('0x1b')](_0x5728b2[_0xf6a5('0x2f')][_0xf6a5('0x1b')]);}_0x77fdc4['order']=qs[_0xf6a5('0x35')](_0x5728b2[_0xf6a5('0x2f')][_0xf6a5('0x35')]);_0x77fdc4['where']=qs[_0xf6a5('0x36')](_[_0xf6a5('0x37')](_0x5728b2['query'],_0x1c0a9d[_0xf6a5('0x36')]),_0x373df4);if(_0x5728b2[_0xf6a5('0x2f')]['filter']){_0x77fdc4[_0xf6a5('0x38')]=_[_0xf6a5('0x39')](_0x77fdc4['where'],{'$or':_[_0xf6a5('0x29')](_0x373df4,function(_0x2f799c){if(_0x2f799c[_0xf6a5('0x3a')]!==_0xf6a5('0x3b')){var _0x2e51f2={};_0x2e51f2[_0x2f799c[_0xf6a5('0x26')]]={'$like':'%'+_0x5728b2[_0xf6a5('0x2f')]['filter']+'%'};return _0x2e51f2;}})});}_0x77fdc4=_[_0xf6a5('0x39')]({},_0x77fdc4,_0x5728b2[_0xf6a5('0x3c')]);var _0x263ddb={'where':_0x77fdc4['where']};return db['SquareRecording'][_0xf6a5('0x1e')](_0x263ddb)[_0xf6a5('0x23')](function(_0x51a52e){_0x52d75c[_0xf6a5('0x1e')]=_0x51a52e;if(_0x5728b2[_0xf6a5('0x2f')][_0xf6a5('0x3d')]){_0x77fdc4['include']=[{'all':!![]}];}return db[_0xf6a5('0x2a')][_0xf6a5('0x3e')](_0x77fdc4);})[_0xf6a5('0x23')](function(_0x44a00e){_0x52d75c[_0xf6a5('0x3f')]=_0x44a00e;return _0x52d75c;})[_0xf6a5('0x23')](respondWithFilteredResult(_0x563c1e,_0x77fdc4))[_0xf6a5('0x40')](handleError(_0x563c1e,null));};exports[_0xf6a5('0x41')]=function(_0xfe56e,_0x3670a8){var _0x53ff51={'raw':!![],'where':{'id':_0xfe56e[_0xf6a5('0x42')]['id']}},_0x297cae={};_0x297cae[_0xf6a5('0x2e')]=_[_0xf6a5('0x43')](db[_0xf6a5('0x2a')][_0xf6a5('0x2b')]);_0x297cae['query']=_[_0xf6a5('0x43')](_0xfe56e[_0xf6a5('0x2f')]);_0x297cae['filters']=_[_0xf6a5('0x30')](_0x297cae['model'],_0x297cae[_0xf6a5('0x2f')]);_0x53ff51[_0xf6a5('0x33')]=_[_0xf6a5('0x30')](_0x297cae['model'],qs[_0xf6a5('0x31')](_0xfe56e[_0xf6a5('0x2f')]['fields']));_0x53ff51[_0xf6a5('0x33')]=_0x53ff51[_0xf6a5('0x33')][_0xf6a5('0x32')]?_0x53ff51['attributes']:_0x297cae[_0xf6a5('0x2e')];if(_0xfe56e[_0xf6a5('0x2f')][_0xf6a5('0x3d')]){_0x53ff51['include']=[{'all':!![]}];}_0x53ff51=_[_0xf6a5('0x39')]({},_0x53ff51,_0xfe56e[_0xf6a5('0x3c')]);return db[_0xf6a5('0x2a')][_0xf6a5('0x44')](_0x53ff51)[_0xf6a5('0x23')](handleEntityNotFound(_0x3670a8,null))[_0xf6a5('0x23')](respondWithResult(_0x3670a8,null))[_0xf6a5('0x40')](handleError(_0x3670a8,null));};exports['create']=function(_0x100e72,_0x42f815){return db[_0xf6a5('0x2a')][_0xf6a5('0x45')](_0x100e72[_0xf6a5('0x46')],{})[_0xf6a5('0x23')](respondWithResult(_0x42f815,0xc9))[_0xf6a5('0x40')](handleError(_0x42f815,null));};exports[_0xf6a5('0x22')]=function(_0x1b749e,_0x121306){if(_0x1b749e[_0xf6a5('0x46')]['id']){delete _0x1b749e[_0xf6a5('0x46')]['id'];}return db[_0xf6a5('0x2a')][_0xf6a5('0x44')]({'where':{'id':_0x1b749e['params']['id']}})['then'](handleEntityNotFound(_0x121306,null))[_0xf6a5('0x23')](saveUpdates(_0x1b749e[_0xf6a5('0x46')],null))[_0xf6a5('0x23')](respondWithResult(_0x121306,null))[_0xf6a5('0x40')](handleError(_0x121306,null));};exports[_0xf6a5('0x47')]=function(_0x23f51f,_0x204af2,_0x577ee1){var _0x6d1052=require(_0xf6a5('0x48'));var _0x5e7d04=![];var _0x196d5a={};if(_0x23f51f[_0xf6a5('0x2f')][_0xf6a5('0x3a')]&&_0x23f51f[_0xf6a5('0x2f')]['type']===_0xf6a5('0x49')){_0x196d5a[_0xf6a5('0x49')]=_0x23f51f[_0xf6a5('0x42')]['id'];}else{_0x196d5a['id']=_0x23f51f[_0xf6a5('0x42')]['id'];}return db['SquareRecording'][_0xf6a5('0x44')]({'where':_0x196d5a,'attributes':['id','savePath',_0xf6a5('0x4a')],'raw':!![]})[_0xf6a5('0x23')](handleEntityNotFound(_0x204af2,null))[_0xf6a5('0x23')](function(_0x3a0de6){if(_0x3a0de6){var _0x5b1e95=_0x3a0de6[_0xf6a5('0x4b')];var _0x2a195c=util[_0xf6a5('0x4c')](_0xf6a5('0x4d'),_0x5b1e95);if(fs[_0xf6a5('0x4e')](_0x2a195c)){_0x5e7d04=!![];return _0x6d1052[_0xf6a5('0x4f')](_0x2a195c,_0x5b1e95,config[_0xf6a5('0x50')][_0xf6a5('0x51')])[_0xf6a5('0x23')](function(){return _0x3a0de6;});}return _0x3a0de6;}})[_0xf6a5('0x23')](function(_0xf20fd){if(_0xf20fd){var _0x3bc098=_0xf20fd[_0xf6a5('0x4b')];if(!fs[_0xf6a5('0x4e')](_0x3bc098)){throw new db[(_0xf6a5('0x52'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0xf20fd['filename']){return _0x204af2[_0xf6a5('0x47')](_0x3bc098,_0xf20fd['filename']+path[_0xf6a5('0x53')](_0x3bc098),function(){if(_0x5e7d04){fs[_0xf6a5('0x54')](_0x3bc098);}});}else{return _0x204af2['download'](_0x3bc098,function(_0x4e8a42){if(_0x5e7d04){fs[_0xf6a5('0x54')](_0x3bc098);}});}}})['catch'](function(_0x43772e){if(_0x43772e['message']===_0xf6a5('0x55')){_0x204af2[_0xf6a5('0x1a')](0x194)[_0xf6a5('0x27')]('Not\x20found');}else{return handleError(_0x204af2,null);}});};exports['destroy']=function(_0x1a42e4,_0x1812fd){return db[_0xf6a5('0x2a')]['find']({'where':{'id':_0x1a42e4[_0xf6a5('0x42')]['id']}})[_0xf6a5('0x23')](function(_0x1c2830){if(_['isNil'](_0x1c2830)){throw new ReferenceError(_0xf6a5('0x56'));}return _0x1c2830;})['then'](function(_0x34afde){var _0x166d65=_0x34afde[_0xf6a5('0x4b')];logger[_0xf6a5('0x57')](_0xf6a5('0x58'),_0x166d65);if(!_[_0xf6a5('0x59')](_0x34afde[_0xf6a5('0x4b')])&&fs[_0xf6a5('0x4e')](_0x166d65)){logger[_0xf6a5('0x57')](_0xf6a5('0x5a')+_0x166d65+_0xf6a5('0x5b'));fs['unlinkSync'](_0x166d65);}_0x166d65=_0x166d65+_0xf6a5('0x5c');if(!_['isNil'](_0x34afde[_0xf6a5('0x4b')])&&fs[_0xf6a5('0x4e')](_0x166d65)){logger[_0xf6a5('0x57')](_0xf6a5('0x5a')+_0x166d65+_0xf6a5('0x5b'));fs[_0xf6a5('0x5d')](_0x166d65);}return _0x34afde;})[_0xf6a5('0x23')](function(_0xcfc9bb){if(!_0xcfc9bb)throw new InternalError();return _0xcfc9bb[_0xf6a5('0x24')]();})[_0xf6a5('0x23')](function(){_0x1812fd[_0xf6a5('0x1a')](0xcc)[_0xf6a5('0x19')]();})[_0xf6a5('0x40')](handleError(_0x1812fd,null));}; \ No newline at end of file +var _0x4bf3=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','update','then','sendStatus','error','name','send','index','map','SquareRecording','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','keys','create','body','find','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','download','unlink','SquareRecording\x20not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2dad1e,_0x76ebd3){var _0x10125b=function(_0xa01038){while(--_0xa01038){_0x2dad1e['push'](_0x2dad1e['shift']());}};_0x10125b(++_0x76ebd3);}(_0x4bf3,0x15c));var _0x34bf=function(_0x4a873a,_0x1b653c){_0x4a873a=_0x4a873a-0x0;var _0x19eef1=_0x4bf3[_0x4a873a];return _0x19eef1;};'use strict';var emlformat=require(_0x34bf('0x0'));var rimraf=require(_0x34bf('0x1'));var zipdir=require(_0x34bf('0x2'));var jsonpatch=require(_0x34bf('0x3'));var rp=require(_0x34bf('0x4'));var moment=require(_0x34bf('0x5'));var BPromise=require(_0x34bf('0x6'));var Mustache=require(_0x34bf('0x7'));var util=require('util');var path=require('path');var sox=require(_0x34bf('0x8'));var csv=require(_0x34bf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x34bf('0xa'));var squel=require(_0x34bf('0xb'));var crypto=require(_0x34bf('0xc'));var jsforce=require(_0x34bf('0xd'));var deskjs=require(_0x34bf('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x34bf('0xf'));var Redis=require(_0x34bf('0x10'));var authService=require(_0x34bf('0x11'));var qs=require(_0x34bf('0x12'));var as=require(_0x34bf('0x13'));var hardwareService=require(_0x34bf('0x14'));var logger=require(_0x34bf('0x15'))(_0x34bf('0x16'));var utils=require('../../config/utils');var config=require(_0x34bf('0x17'));var licenseUtil=require(_0x34bf('0x18'));var db=require(_0x34bf('0x19'))['db'];function respondWithStatusCode(_0x5dbde4,_0x46c882){_0x46c882=_0x46c882||0xcc;return function(_0x40f3cf){if(_0x40f3cf){return _0x5dbde4['sendStatus'](_0x46c882);}return _0x5dbde4[_0x34bf('0x1a')](_0x46c882)[_0x34bf('0x1b')]();};}function respondWithResult(_0x53b73e,_0x5cd17e){_0x5cd17e=_0x5cd17e||0xc8;return function(_0x3131e8){if(_0x3131e8){return _0x53b73e[_0x34bf('0x1a')](_0x5cd17e)[_0x34bf('0x1c')](_0x3131e8);}};}function respondWithFilteredResult(_0x51bff9,_0x580c8c){return function(_0x3cb089){if(_0x3cb089){var _0x1f9787=typeof _0x580c8c[_0x34bf('0x1d')]===_0x34bf('0x1e')&&typeof _0x580c8c['limit']==='undefined';var _0x2ba78b=_0x3cb089['count'];var _0x583103=_0x1f9787?0x0:_0x580c8c[_0x34bf('0x1d')];var _0x3d8a72=_0x1f9787?_0x3cb089[_0x34bf('0x1f')]:_0x580c8c[_0x34bf('0x1d')]+_0x580c8c['limit'];var _0x70c0b7;if(_0x3d8a72>=_0x2ba78b){_0x3d8a72=_0x2ba78b;_0x70c0b7=0xc8;}else{_0x70c0b7=0xce;}_0x51bff9['status'](_0x70c0b7);return _0x51bff9[_0x34bf('0x20')](_0x34bf('0x21'),_0x583103+'-'+_0x3d8a72+'/'+_0x2ba78b)[_0x34bf('0x1c')](_0x3cb089);}return null;};}function patchUpdates(_0x59a910){return function(_0x511e86){try{jsonpatch[_0x34bf('0x22')](_0x511e86,_0x59a910,!![]);}catch(_0x31bd3c){return BPromise['reject'](_0x31bd3c);}return _0x511e86['save']();};}function saveUpdates(_0x372bb3,_0x3bdf98){return function(_0x9114bc){if(_0x9114bc){return _0x9114bc[_0x34bf('0x23')](_0x372bb3)[_0x34bf('0x24')](function(_0x5bf5a9){return _0x5bf5a9;});}return null;};}function removeEntity(_0x40f879,_0x39d8a7){return function(_0x342413){if(_0x342413){return _0x342413['destroy']()[_0x34bf('0x24')](function(){_0x40f879[_0x34bf('0x1a')](0xcc)[_0x34bf('0x1b')]();});}};}function handleEntityNotFound(_0x5ae95e,_0x4b2bb9){return function(_0x7eebf){if(!_0x7eebf){_0x5ae95e[_0x34bf('0x25')](0x194);}return _0x7eebf;};}function handleError(_0x38dd22,_0x53639e){_0x53639e=_0x53639e||0x1f4;return function(_0x20140f){logger[_0x34bf('0x26')](_0x20140f['stack']);if(_0x20140f[_0x34bf('0x27')]){delete _0x20140f[_0x34bf('0x27')];}_0x38dd22[_0x34bf('0x1a')](_0x53639e)[_0x34bf('0x28')](_0x20140f);};}exports[_0x34bf('0x29')]=function(_0x219e27,_0x357c36){var _0x1ffc07={},_0x33f00c={},_0x518c95={'count':0x0,'rows':[]};var _0x32c580=_[_0x34bf('0x2a')](db[_0x34bf('0x2b')][_0x34bf('0x2c')],function(_0x836069){return{'name':_0x836069['fieldName'],'type':_0x836069[_0x34bf('0x2d')]['key']};});_0x33f00c[_0x34bf('0x2e')]=_[_0x34bf('0x2a')](_0x32c580,_0x34bf('0x27'));_0x33f00c[_0x34bf('0x2f')]=_['keys'](_0x219e27[_0x34bf('0x2f')]);_0x33f00c[_0x34bf('0x30')]=_[_0x34bf('0x31')](_0x33f00c['model'],_0x33f00c[_0x34bf('0x2f')]);_0x1ffc07[_0x34bf('0x32')]=_[_0x34bf('0x31')](_0x33f00c['model'],qs[_0x34bf('0x33')](_0x219e27[_0x34bf('0x2f')]['fields']));_0x1ffc07[_0x34bf('0x32')]=_0x1ffc07['attributes'][_0x34bf('0x34')]?_0x1ffc07['attributes']:_0x33f00c[_0x34bf('0x2e')];if(!_0x219e27[_0x34bf('0x2f')]['hasOwnProperty'](_0x34bf('0x35'))){_0x1ffc07['limit']=qs[_0x34bf('0x36')](_0x219e27[_0x34bf('0x2f')][_0x34bf('0x36')]);_0x1ffc07['offset']=qs[_0x34bf('0x1d')](_0x219e27[_0x34bf('0x2f')][_0x34bf('0x1d')]);}_0x1ffc07['order']=qs[_0x34bf('0x37')](_0x219e27[_0x34bf('0x2f')][_0x34bf('0x37')]);_0x1ffc07[_0x34bf('0x38')]=qs[_0x34bf('0x30')](_[_0x34bf('0x39')](_0x219e27[_0x34bf('0x2f')],_0x33f00c[_0x34bf('0x30')]),_0x32c580);if(_0x219e27[_0x34bf('0x2f')][_0x34bf('0x3a')]){_0x1ffc07[_0x34bf('0x38')]=_['merge'](_0x1ffc07[_0x34bf('0x38')],{'$or':_['map'](_0x32c580,function(_0x30e49d){if(_0x30e49d[_0x34bf('0x2d')]!=='VIRTUAL'){var _0x13984b={};_0x13984b[_0x30e49d[_0x34bf('0x27')]]={'$like':'%'+_0x219e27[_0x34bf('0x2f')][_0x34bf('0x3a')]+'%'};return _0x13984b;}})});}_0x1ffc07=_[_0x34bf('0x3b')]({},_0x1ffc07,_0x219e27[_0x34bf('0x3c')]);var _0x212d7a={'where':_0x1ffc07['where']};return db[_0x34bf('0x2b')][_0x34bf('0x1f')](_0x212d7a)[_0x34bf('0x24')](function(_0x5ca303){_0x518c95['count']=_0x5ca303;if(_0x219e27[_0x34bf('0x2f')][_0x34bf('0x3d')]){_0x1ffc07[_0x34bf('0x3e')]=[{'all':!![]}];}return db[_0x34bf('0x2b')]['findAll'](_0x1ffc07);})['then'](function(_0x51ccc3){_0x518c95[_0x34bf('0x3f')]=_0x51ccc3;return _0x518c95;})[_0x34bf('0x24')](respondWithFilteredResult(_0x357c36,_0x1ffc07))[_0x34bf('0x40')](handleError(_0x357c36,null));};exports[_0x34bf('0x41')]=function(_0x51f627,_0x4e8d3d){var _0x463090={'raw':!![],'where':{'id':_0x51f627[_0x34bf('0x42')]['id']}},_0x40d87f={};_0x40d87f[_0x34bf('0x2e')]=_[_0x34bf('0x43')](db[_0x34bf('0x2b')]['rawAttributes']);_0x40d87f[_0x34bf('0x2f')]=_['keys'](_0x51f627[_0x34bf('0x2f')]);_0x40d87f[_0x34bf('0x30')]=_[_0x34bf('0x31')](_0x40d87f['model'],_0x40d87f[_0x34bf('0x2f')]);_0x463090[_0x34bf('0x32')]=_['intersection'](_0x40d87f[_0x34bf('0x2e')],qs[_0x34bf('0x33')](_0x51f627[_0x34bf('0x2f')][_0x34bf('0x33')]));_0x463090[_0x34bf('0x32')]=_0x463090[_0x34bf('0x32')][_0x34bf('0x34')]?_0x463090['attributes']:_0x40d87f[_0x34bf('0x2e')];if(_0x51f627[_0x34bf('0x2f')][_0x34bf('0x3d')]){_0x463090[_0x34bf('0x3e')]=[{'all':!![]}];}_0x463090=_[_0x34bf('0x3b')]({},_0x463090,_0x51f627[_0x34bf('0x3c')]);return db['SquareRecording']['find'](_0x463090)[_0x34bf('0x24')](handleEntityNotFound(_0x4e8d3d,null))[_0x34bf('0x24')](respondWithResult(_0x4e8d3d,null))[_0x34bf('0x40')](handleError(_0x4e8d3d,null));};exports[_0x34bf('0x44')]=function(_0x386847,_0x40dc02){return db[_0x34bf('0x2b')][_0x34bf('0x44')](_0x386847[_0x34bf('0x45')],{})[_0x34bf('0x24')](respondWithResult(_0x40dc02,0xc9))[_0x34bf('0x40')](handleError(_0x40dc02,null));};exports[_0x34bf('0x23')]=function(_0x2c6825,_0x4ea607){if(_0x2c6825[_0x34bf('0x45')]['id']){delete _0x2c6825[_0x34bf('0x45')]['id'];}return db['SquareRecording'][_0x34bf('0x46')]({'where':{'id':_0x2c6825[_0x34bf('0x42')]['id']}})[_0x34bf('0x24')](handleEntityNotFound(_0x4ea607,null))[_0x34bf('0x24')](saveUpdates(_0x2c6825[_0x34bf('0x45')],null))[_0x34bf('0x24')](respondWithResult(_0x4ea607,null))['catch'](handleError(_0x4ea607,null));};exports['download']=function(_0x1d71ff,_0x5515da,_0x2eeee1){var _0x267481=require(_0x34bf('0x47'));var _0x3b678b=![];var _0x37d4c9={};if(_0x1d71ff[_0x34bf('0x2f')][_0x34bf('0x2d')]&&_0x1d71ff[_0x34bf('0x2f')][_0x34bf('0x2d')]==='uniqueid'){_0x37d4c9[_0x34bf('0x48')]=_0x1d71ff[_0x34bf('0x42')]['id'];}else{_0x37d4c9['id']=_0x1d71ff[_0x34bf('0x42')]['id'];}return db[_0x34bf('0x2b')][_0x34bf('0x46')]({'where':_0x37d4c9,'attributes':['id',_0x34bf('0x49'),_0x34bf('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x5515da,null))[_0x34bf('0x24')](function(_0x6f2fa3){if(_0x6f2fa3){var _0x1af07b=_0x6f2fa3['savePath'];var _0x49604b=util['format'](_0x34bf('0x4b'),_0x1af07b);if(fs[_0x34bf('0x4c')](_0x49604b)){_0x3b678b=!![];return _0x267481[_0x34bf('0x4d')](_0x49604b,_0x1af07b,config['secrets'][_0x34bf('0x4e')])[_0x34bf('0x24')](function(){return _0x6f2fa3;});}return _0x6f2fa3;}})[_0x34bf('0x24')](function(_0x5c556e){if(_0x5c556e){var _0x2f3e3b=_0x5c556e[_0x34bf('0x49')];if(!fs[_0x34bf('0x4c')](_0x2f3e3b)){throw new db[(_0x34bf('0x4f'))][(_0x34bf('0x50'))]('SquareRecording\x20not\x20found');}if(_0x5c556e[_0x34bf('0x4a')]){return _0x5515da[_0x34bf('0x51')](_0x2f3e3b,_0x5c556e['filename']+path['extname'](_0x2f3e3b),function(){if(_0x3b678b){fs[_0x34bf('0x52')](_0x2f3e3b);}});}else{return _0x5515da[_0x34bf('0x51')](_0x2f3e3b,function(_0x5c719a){if(_0x3b678b){fs[_0x34bf('0x52')](_0x2f3e3b);}});}}})['catch'](function(_0x12b14a){if(_0x12b14a['message']===_0x34bf('0x53')){_0x5515da[_0x34bf('0x1a')](0x194)[_0x34bf('0x28')]('Not\x20found');}else{return handleError(_0x5515da,null);}});};exports[_0x34bf('0x54')]=function(_0x219b94,_0x4335b3){return db['SquareRecording'][_0x34bf('0x46')]({'where':{'id':_0x219b94[_0x34bf('0x42')]['id']}})[_0x34bf('0x24')](function(_0x50931f){if(_[_0x34bf('0x55')](_0x50931f)){throw new ReferenceError('Entity\x20not\x20found');}return _0x50931f;})[_0x34bf('0x24')](function(_0x2826ce){var _0x47192d=_0x2826ce[_0x34bf('0x49')];logger[_0x34bf('0x56')](_0x34bf('0x57'),_0x47192d);if(!_[_0x34bf('0x55')](_0x2826ce[_0x34bf('0x49')])&&fs[_0x34bf('0x4c')](_0x47192d)){logger[_0x34bf('0x56')](_0x34bf('0x58')+_0x47192d+_0x34bf('0x59'));fs[_0x34bf('0x5a')](_0x47192d);}_0x47192d=_0x47192d+_0x34bf('0x5b');if(!_[_0x34bf('0x55')](_0x2826ce[_0x34bf('0x49')])&&fs[_0x34bf('0x4c')](_0x47192d)){logger[_0x34bf('0x56')]('File:\x20\x22'+_0x47192d+_0x34bf('0x59'));fs[_0x34bf('0x5a')](_0x47192d);}return _0x2826ce;})[_0x34bf('0x24')](function(_0x161f0e){if(!_0x161f0e)throw new InternalError();return _0x161f0e[_0x34bf('0x54')]();})[_0x34bf('0x24')](function(){_0x4335b3[_0x34bf('0x1a')](0xcc)[_0x34bf('0x1b')]();})[_0x34bf('0x40')](handleError(_0x4335b3,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 37b280d..62cfbe1 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 _0x62cf=['bluebird','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','../../config/logger','moment'];(function(_0x26c990,_0x4c20f7){var _0x167f63=function(_0x57d68e){while(--_0x57d68e){_0x26c990['push'](_0x26c990['shift']());}};_0x167f63(++_0x4c20f7);}(_0x62cf,0x81));var _0xf62c=function(_0x49d173,_0x14a94e){_0x49d173=_0x49d173-0x0;var _0x7fbd82=_0x62cf[_0x49d173];return _0x7fbd82;};'use strict';var _=require(_0xf62c('0x0'));var util=require('util');var logger=require(_0xf62c('0x1'))('api');var moment=require(_0xf62c('0x2'));var BPromise=require(_0xf62c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf62c('0x4'));var config=require(_0xf62c('0x5'));var attributes=require(_0xf62c('0x6'));module[_0xf62c('0x7')]=function(_0x3604f0,_0x40487e){return _0x3604f0[_0xf62c('0x8')](_0xf62c('0x9'),attributes,{'tableName':_0xf62c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4dcb=['path','rimraf','../../config/environment','define','SquareRecording','square_recordings','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4dcb,0x186));var _0xb4dc=function(_0x45617f,_0x3a5d4e){_0x45617f=_0x45617f-0x0;var _0x19f3d1=_0x4dcb[_0x45617f];return _0x19f3d1;};'use strict';var _=require('lodash');var util=require(_0xb4dc('0x0'));var logger=require(_0xb4dc('0x1'))(_0xb4dc('0x2'));var moment=require(_0xb4dc('0x3'));var BPromise=require(_0xb4dc('0x4'));var rp=require(_0xb4dc('0x5'));var fs=require('fs');var path=require(_0xb4dc('0x6'));var rimraf=require(_0xb4dc('0x7'));var config=require(_0xb4dc('0x8'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0x244be0,_0x5be4d1){return _0x244be0[_0xb4dc('0x9')](_0xb4dc('0xa'),attributes,{'tableName':_0xb4dc('0xb'),'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 e901964..00ef759 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 _0x5498=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','moment','ioredis'];(function(_0xd08166,_0x3b0592){var _0x5a9912=function(_0x219162){while(--_0x219162){_0xd08166['push'](_0xd08166['shift']());}};_0x5a9912(++_0x3b0592);}(_0x5498,0x88));var _0x8549=function(_0x4b4632,_0x1b9ef8){_0x4b4632=_0x4b4632-0x0;var _0x487b85=_0x5498[_0x4b4632];return _0x487b85;};'use strict';var _=require(_0x8549('0x0'));var util=require(_0x8549('0x1'));var moment=require(_0x8549('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8549('0x3'));var db=require(_0x8549('0x4'))['db'];var utils=require(_0x8549('0x5'));var logger=require(_0x8549('0x6'))(_0x8549('0x7'));var config=require(_0x8549('0x8'));var jayson=require(_0x8549('0x9'));var client=jayson[_0x8549('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x132b83,_0x3328e9,_0x150bb0){return new BPromise(function(_0x398801,_0x2962ec){return client['request'](_0x132b83,_0x150bb0)[_0x8549('0xb')](function(_0x3a9db4){logger[_0x8549('0xc')](_0x8549('0xd'),_0x3328e9,_0x8549('0xe'));logger['debug'](_0x8549('0xf'),_0x3328e9,_0x8549('0xe'),JSON[_0x8549('0x10')](_0x3a9db4));if(_0x3a9db4['error']){if(_0x3a9db4[_0x8549('0x11')][_0x8549('0x12')]===0x1f4){logger[_0x8549('0x11')](_0x8549('0xd'),_0x3328e9,_0x3a9db4[_0x8549('0x11')][_0x8549('0x13')]);return _0x2962ec(_0x3a9db4['error'][_0x8549('0x13')]);}logger[_0x8549('0x11')](_0x8549('0xd'),_0x3328e9,_0x3a9db4['error'][_0x8549('0x13')]);return _0x398801(_0x3a9db4[_0x8549('0x11')][_0x8549('0x13')]);}else{logger[_0x8549('0xc')](_0x8549('0xd'),_0x3328e9,_0x8549('0xe'));_0x398801(_0x3a9db4[_0x8549('0x14')]['message']);}})[_0x8549('0x15')](function(_0x311e23){logger['error']('SquareRecording,\x20%s,\x20%s',_0x3328e9,_0x311e23);_0x2962ec(_0x311e23);});});}exports[_0x8549('0x16')]=function(_0x2cac7a){var _0x3d08d7=this;return new Promise(function(_0x56564c,_0x468cce){return db[_0x8549('0x17')][_0x8549('0x18')](_0x2cac7a[_0x8549('0x19')],{'raw':_0x2cac7a[_0x8549('0x1a')]?_0x2cac7a[_0x8549('0x1a')][_0x8549('0x1b')]===undefined?!![]:![]:!![]})[_0x8549('0xb')](function(_0x388ba6){logger[_0x8549('0xc')](_0x8549('0x16'),_0x2cac7a);logger['debug'](_0x8549('0x16'),_0x2cac7a,JSON[_0x8549('0x10')](_0x388ba6));_0x56564c(_0x388ba6);})[_0x8549('0x15')](function(_0x8867a4){logger[_0x8549('0x11')](_0x8549('0x16'),_0x8867a4[_0x8549('0x13')],_0x2cac7a);_0x468cce(_0x3d08d7[_0x8549('0x11')](0x1f4,_0x8867a4[_0x8549('0x13')]));});});}; \ No newline at end of file +var _0x0521=['request','then','info','SquareRecording,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x0521,0x151));var _0x1052=function(_0xadbfcf,_0x292e16){_0xadbfcf=_0xadbfcf-0x0;var _0x4b3345=_0x0521[_0xadbfcf];return _0x4b3345;};'use strict';var _=require(_0x1052('0x0'));var util=require(_0x1052('0x1'));var moment=require(_0x1052('0x2'));var BPromise=require(_0x1052('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1052('0x4'));var db=require(_0x1052('0x5'))['db'];var utils=require(_0x1052('0x6'));var logger=require(_0x1052('0x7'))('rpc');var config=require(_0x1052('0x8'));var jayson=require(_0x1052('0x9'));var client=jayson[_0x1052('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35e710,_0x1db94a,_0x5e8fc9){return new BPromise(function(_0x56e7f8,_0x16bbc0){return client[_0x1052('0xb')](_0x35e710,_0x5e8fc9)[_0x1052('0xc')](function(_0x3b6853){logger[_0x1052('0xd')](_0x1052('0xe'),_0x1db94a,'request\x20sent');logger[_0x1052('0xf')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x1db94a,_0x1052('0x10'),JSON['stringify'](_0x3b6853));if(_0x3b6853[_0x1052('0x11')]){if(_0x3b6853[_0x1052('0x11')][_0x1052('0x12')]===0x1f4){logger[_0x1052('0x11')](_0x1052('0xe'),_0x1db94a,_0x3b6853['error']['message']);return _0x16bbc0(_0x3b6853[_0x1052('0x11')][_0x1052('0x13')]);}logger[_0x1052('0x11')]('SquareRecording,\x20%s,\x20%s',_0x1db94a,_0x3b6853[_0x1052('0x11')][_0x1052('0x13')]);return _0x56e7f8(_0x3b6853[_0x1052('0x11')]['message']);}else{logger['info'](_0x1052('0xe'),_0x1db94a,'request\x20sent');_0x56e7f8(_0x3b6853[_0x1052('0x14')][_0x1052('0x13')]);}})[_0x1052('0x15')](function(_0x251f6e){logger[_0x1052('0x11')]('SquareRecording,\x20%s,\x20%s',_0x1db94a,_0x251f6e);_0x16bbc0(_0x251f6e);});});}exports[_0x1052('0x16')]=function(_0x4fa3e2){var _0x2cc8fa=this;return new Promise(function(_0x5d79a4,_0x5d65e5){return db[_0x1052('0x17')][_0x1052('0x18')](_0x4fa3e2[_0x1052('0x19')],{'raw':_0x4fa3e2[_0x1052('0x1a')]?_0x4fa3e2['options'][_0x1052('0x1b')]===undefined?!![]:![]:!![]})[_0x1052('0xc')](function(_0x45db08){logger[_0x1052('0xd')](_0x1052('0x16'),_0x4fa3e2);logger[_0x1052('0xf')](_0x1052('0x16'),_0x4fa3e2,JSON[_0x1052('0x1c')](_0x45db08));_0x5d79a4(_0x45db08);})['catch'](function(_0x58d33c){logger['error']('CreateSquareRecording',_0x58d33c[_0x1052('0x13')],_0x4fa3e2);_0x5d65e5(_0x2cc8fa[_0x1052('0x11')](0x1f4,_0x58d33c[_0x1052('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 9af229d..04f3694 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(_0x51fe73,_0x269307){var _0x5347d7=function(_0x5394b1){while(--_0x5394b1){_0x51fe73['push'](_0x51fe73['shift']());}};_0x5347d7(++_0x269307);}(_0xe706,0xa3));var _0x6e70=function(_0x5b1c50,_0x56e694){_0x5b1c50=_0x5b1c50-0x0;var _0x2d379b=_0xe706[_0x5b1c50];return _0x2d379b;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x40fc07,_0x2627f4){var _0x30bded=function(_0x5b87fa){while(--_0x5b87fa){_0x40fc07['push'](_0x40fc07['shift']());}};_0x30bded(++_0x2627f4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 7993e8b..01289df 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 _0x1f20=['sequelize','exports','STRING','DATE'];(function(_0x296421,_0x27c2af){var _0x407240=function(_0x11094f){while(--_0x11094f){_0x296421['push'](_0x296421['shift']());}};_0x407240(++_0x27c2af);}(_0x1f20,0x11c));var _0x01f2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1f20[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x01f2('0x0'));module[_0x01f2('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x01f2('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x01f2('0x2')]},'language':{'type':Sequelize[_0x01f2('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x01f2('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x01f2('0x2')]},'callingpres':{'type':Sequelize[_0x01f2('0x2')]},'callingani2':{'type':Sequelize[_0x01f2('0x2')]},'callington':{'type':Sequelize[_0x01f2('0x2')]},'callingtns':{'type':Sequelize[_0x01f2('0x2')]},'dnid':{'type':Sequelize[_0x01f2('0x2')]},'rdnis':{'type':Sequelize[_0x01f2('0x2')]},'context':{'type':Sequelize[_0x01f2('0x2')]},'extension':{'type':Sequelize[_0x01f2('0x2')]},'priority':{'type':Sequelize[_0x01f2('0x2')]},'enhanced':{'type':Sequelize[_0x01f2('0x2')]},'accountcode':{'type':Sequelize[_0x01f2('0x2')]},'threadid':{'type':Sequelize[_0x01f2('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x01f2('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xdba4=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0xdba4,0x97));var _0x4dba=function(_0x7b500f,_0x5a4e54){_0x7b500f=_0x7b500f-0x0;var _0xbcac81=_0xdba4[_0x7b500f];return _0xbcac81;};'use strict';var Sequelize=require(_0x4dba('0x0'));module[_0x4dba('0x1')]={'network':{'type':Sequelize[_0x4dba('0x2')]},'network_script':{'type':Sequelize[_0x4dba('0x2')]},'request':{'type':Sequelize[_0x4dba('0x2')]},'channel':{'type':Sequelize[_0x4dba('0x2')]},'language':{'type':Sequelize[_0x4dba('0x2')]},'type':{'type':Sequelize[_0x4dba('0x2')]},'uniqueid':{'type':Sequelize[_0x4dba('0x2')]},'version':{'type':Sequelize[_0x4dba('0x2')]},'callerid':{'type':Sequelize[_0x4dba('0x2')]},'calleridname':{'type':Sequelize[_0x4dba('0x2')]},'callingpres':{'type':Sequelize[_0x4dba('0x2')]},'callingani2':{'type':Sequelize[_0x4dba('0x2')]},'callington':{'type':Sequelize[_0x4dba('0x2')]},'callingtns':{'type':Sequelize[_0x4dba('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x4dba('0x2')]},'context':{'type':Sequelize[_0x4dba('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x4dba('0x2')]},'enhanced':{'type':Sequelize[_0x4dba('0x2')]},'accountcode':{'type':Sequelize[_0x4dba('0x2')]},'threadid':{'type':Sequelize[_0x4dba('0x2')]},'project_name':{'type':Sequelize[_0x4dba('0x2')]},'joinAt':{'type':Sequelize[_0x4dba('0x3')]},'leaveAt':{'type':Sequelize[_0x4dba('0x3')]},'bot':{'type':Sequelize[_0x4dba('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 1d3304f..8a0c7ce 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 _0xf118=['count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','rows','show','includeAll','catch','create','body','find','describe','eml-format','rimraf','request-promise','moment','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x6f1a87,_0x5d5bcf){var _0x2495c7=function(_0x1c6733){while(--_0x1c6733){_0x6f1a87['push'](_0x6f1a87['shift']());}};_0x2495c7(++_0x5d5bcf);}(_0xf118,0xc2));var _0x8f11=function(_0x2a9548,_0x2742f6){_0x2a9548=_0x2a9548-0x0;var _0xf55c55=_0xf118[_0x2a9548];return _0xf55c55;};'use strict';var emlformat=require(_0x8f11('0x0'));var rimraf=require(_0x8f11('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8f11('0x2'));var moment=require(_0x8f11('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8f11('0x4'));var util=require('util');var path=require(_0x8f11('0x5'));var sox=require('sox');var csv=require(_0x8f11('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f11('0x7'));var _=require(_0x8f11('0x8'));var squel=require(_0x8f11('0x9'));var crypto=require(_0x8f11('0xa'));var jsforce=require(_0x8f11('0xb'));var deskjs=require(_0x8f11('0xc'));var toCsv=require(_0x8f11('0x6'));var querystring=require(_0x8f11('0xd'));var Papa=require(_0x8f11('0xe'));var Redis=require(_0x8f11('0xf'));var authService=require(_0x8f11('0x10'));var qs=require(_0x8f11('0x11'));var as=require(_0x8f11('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f11('0x13'))(_0x8f11('0x14'));var utils=require(_0x8f11('0x15'));var config=require(_0x8f11('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8f11('0x17'))['db'];function respondWithStatusCode(_0x40e833,_0x56266f){_0x56266f=_0x56266f||0xcc;return function(_0x533a23){if(_0x533a23){return _0x40e833[_0x8f11('0x18')](_0x56266f);}return _0x40e833[_0x8f11('0x19')](_0x56266f)[_0x8f11('0x1a')]();};}function respondWithResult(_0x4e7b8a,_0x362363){_0x362363=_0x362363||0xc8;return function(_0x2dd537){if(_0x2dd537){return _0x4e7b8a[_0x8f11('0x19')](_0x362363)[_0x8f11('0x1b')](_0x2dd537);}};}function respondWithFilteredResult(_0x48fe03,_0x143f83){return function(_0xd285e9){if(_0xd285e9){var _0x49c30b=typeof _0x143f83[_0x8f11('0x1c')]===_0x8f11('0x1d')&&typeof _0x143f83[_0x8f11('0x1e')]==='undefined';var _0x54f684=_0xd285e9[_0x8f11('0x1f')];var _0x3f74f3=_0x49c30b?0x0:_0x143f83[_0x8f11('0x1c')];var _0x5b26da=_0x49c30b?_0xd285e9[_0x8f11('0x1f')]:_0x143f83[_0x8f11('0x1c')]+_0x143f83[_0x8f11('0x1e')];var _0x1594e5;if(_0x5b26da>=_0x54f684){_0x5b26da=_0x54f684;_0x1594e5=0xc8;}else{_0x1594e5=0xce;}_0x48fe03[_0x8f11('0x19')](_0x1594e5);return _0x48fe03[_0x8f11('0x20')](_0x8f11('0x21'),_0x3f74f3+'-'+_0x5b26da+'/'+_0x54f684)['json'](_0xd285e9);}return null;};}function patchUpdates(_0x1f0394){return function(_0x1c5680){try{jsonpatch[_0x8f11('0x22')](_0x1c5680,_0x1f0394,!![]);}catch(_0x3e5fa3){return BPromise[_0x8f11('0x23')](_0x3e5fa3);}return _0x1c5680[_0x8f11('0x24')]();};}function saveUpdates(_0x1b3ecf,_0x866ad3){return function(_0x3045c1){if(_0x3045c1){return _0x3045c1[_0x8f11('0x25')](_0x1b3ecf)['then'](function(_0x56bea1){return _0x56bea1;});}return null;};}function removeEntity(_0x515d15,_0x279ed3){return function(_0x33f4fc){if(_0x33f4fc){return _0x33f4fc[_0x8f11('0x26')]()[_0x8f11('0x27')](function(){_0x515d15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24e9c4,_0x3d1cfe){return function(_0x561f78){if(!_0x561f78){_0x24e9c4[_0x8f11('0x18')](0x194);}return _0x561f78;};}function handleError(_0x450bb6,_0x95f9e8){_0x95f9e8=_0x95f9e8||0x1f4;return function(_0x4ca5c0){logger[_0x8f11('0x28')](_0x4ca5c0[_0x8f11('0x29')]);if(_0x4ca5c0['name']){delete _0x4ca5c0[_0x8f11('0x2a')];}_0x450bb6[_0x8f11('0x19')](_0x95f9e8)[_0x8f11('0x2b')](_0x4ca5c0);};}exports[_0x8f11('0x2c')]=function(_0x49caa7,_0x5bfaac){var _0x38cc7e={},_0x3f540e={},_0x163d8b={'count':0x0,'rows':[]};var _0x52b9dc=_[_0x8f11('0x2d')](db[_0x8f11('0x2e')][_0x8f11('0x2f')],function(_0x19c84d){return{'name':_0x19c84d[_0x8f11('0x30')],'type':_0x19c84d[_0x8f11('0x31')]['key']};});_0x3f540e[_0x8f11('0x32')]=_[_0x8f11('0x2d')](_0x52b9dc,_0x8f11('0x2a'));_0x3f540e[_0x8f11('0x33')]=_[_0x8f11('0x34')](_0x49caa7[_0x8f11('0x33')]);_0x3f540e[_0x8f11('0x35')]=_[_0x8f11('0x36')](_0x3f540e['model'],_0x3f540e[_0x8f11('0x33')]);_0x38cc7e['attributes']=_['intersection'](_0x3f540e[_0x8f11('0x32')],qs[_0x8f11('0x37')](_0x49caa7[_0x8f11('0x33')]['fields']));_0x38cc7e[_0x8f11('0x38')]=_0x38cc7e[_0x8f11('0x38')][_0x8f11('0x39')]?_0x38cc7e['attributes']:_0x3f540e[_0x8f11('0x32')];if(!_0x49caa7[_0x8f11('0x33')][_0x8f11('0x3a')]('nolimit')){_0x38cc7e['limit']=qs[_0x8f11('0x1e')](_0x49caa7[_0x8f11('0x33')][_0x8f11('0x1e')]);_0x38cc7e['offset']=qs[_0x8f11('0x1c')](_0x49caa7[_0x8f11('0x33')][_0x8f11('0x1c')]);}_0x38cc7e[_0x8f11('0x3b')]=qs[_0x8f11('0x3c')](_0x49caa7[_0x8f11('0x33')][_0x8f11('0x3c')]);_0x38cc7e[_0x8f11('0x3d')]=qs[_0x8f11('0x35')](_[_0x8f11('0x3e')](_0x49caa7[_0x8f11('0x33')],_0x3f540e[_0x8f11('0x35')]),_0x52b9dc);if(_0x49caa7['query'][_0x8f11('0x3f')]){_0x38cc7e[_0x8f11('0x3d')]=_['merge'](_0x38cc7e[_0x8f11('0x3d')],{'$or':_['map'](_0x52b9dc,function(_0x5dfc56){if(_0x5dfc56['type']!=='VIRTUAL'){var _0x99d393={};_0x99d393[_0x5dfc56[_0x8f11('0x2a')]]={'$like':'%'+_0x49caa7[_0x8f11('0x33')][_0x8f11('0x3f')]+'%'};return _0x99d393;}})});}_0x38cc7e=_[_0x8f11('0x40')]({},_0x38cc7e,_0x49caa7[_0x8f11('0x41')]);var _0x3dd4f5={'where':_0x38cc7e[_0x8f11('0x3d')]};return db[_0x8f11('0x2e')]['count'](_0x3dd4f5)[_0x8f11('0x27')](function(_0x2e1180){_0x163d8b[_0x8f11('0x1f')]=_0x2e1180;if(_0x49caa7[_0x8f11('0x33')]['includeAll']){_0x38cc7e[_0x8f11('0x42')]=[{'all':!![]}];}return db[_0x8f11('0x2e')]['findAll'](_0x38cc7e);})[_0x8f11('0x27')](function(_0x49ffe5){_0x163d8b[_0x8f11('0x43')]=_0x49ffe5;return _0x163d8b;})['then'](respondWithFilteredResult(_0x5bfaac,_0x38cc7e))['catch'](handleError(_0x5bfaac,null));};exports[_0x8f11('0x44')]=function(_0x441a8d,_0xc17fc3){var _0xa71cda={'raw':!![],'where':{'id':_0x441a8d['params']['id']}},_0x370d47={};_0x370d47[_0x8f11('0x32')]=_['keys'](db[_0x8f11('0x2e')]['rawAttributes']);_0x370d47[_0x8f11('0x33')]=_[_0x8f11('0x34')](_0x441a8d[_0x8f11('0x33')]);_0x370d47[_0x8f11('0x35')]=_[_0x8f11('0x36')](_0x370d47[_0x8f11('0x32')],_0x370d47[_0x8f11('0x33')]);_0xa71cda[_0x8f11('0x38')]=_['intersection'](_0x370d47['model'],qs[_0x8f11('0x37')](_0x441a8d[_0x8f11('0x33')][_0x8f11('0x37')]));_0xa71cda[_0x8f11('0x38')]=_0xa71cda['attributes'][_0x8f11('0x39')]?_0xa71cda['attributes']:_0x370d47['model'];if(_0x441a8d[_0x8f11('0x33')][_0x8f11('0x45')]){_0xa71cda['include']=[{'all':!![]}];}_0xa71cda=_[_0x8f11('0x40')]({},_0xa71cda,_0x441a8d[_0x8f11('0x41')]);return db[_0x8f11('0x2e')]['find'](_0xa71cda)[_0x8f11('0x27')](handleEntityNotFound(_0xc17fc3,null))['then'](respondWithResult(_0xc17fc3,null))[_0x8f11('0x46')](handleError(_0xc17fc3,null));};exports['create']=function(_0x164416,_0x5a3afd){return db['SquareReport'][_0x8f11('0x47')](_0x164416[_0x8f11('0x48')],{})[_0x8f11('0x27')](respondWithResult(_0x5a3afd,0xc9))[_0x8f11('0x46')](handleError(_0x5a3afd,null));};exports[_0x8f11('0x25')]=function(_0x2fe4d2,_0x3a5aa7){if(_0x2fe4d2[_0x8f11('0x48')]['id']){delete _0x2fe4d2['body']['id'];}return db['SquareReport'][_0x8f11('0x49')]({'where':{'id':_0x2fe4d2['params']['id']}})[_0x8f11('0x27')](handleEntityNotFound(_0x3a5aa7,null))[_0x8f11('0x27')](saveUpdates(_0x2fe4d2['body'],null))['then'](respondWithResult(_0x3a5aa7,null))[_0x8f11('0x46')](handleError(_0x3a5aa7,null));};exports[_0x8f11('0x26')]=function(_0x54ad22,_0x1b974d){return db[_0x8f11('0x2e')][_0x8f11('0x49')]({'where':{'id':_0x54ad22['params']['id']}})[_0x8f11('0x27')](handleEntityNotFound(_0x1b974d,null))[_0x8f11('0x27')](removeEntity(_0x1b974d,null))[_0x8f11('0x46')](handleError(_0x1b974d,null));};exports['describe']=function(_0x5ce010,_0xa2a4e0){return db[_0x8f11('0x2e')][_0x8f11('0x4a')]()[_0x8f11('0x27')](respondWithResult(_0xa2a4e0,null))[_0x8f11('0x46')](handleError(_0xa2a4e0,null));}; \ No newline at end of file +var _0xe27d=['save','update','destroy','then','name','send','index','SquareReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','reject'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0xe27d,0x1a4));var _0xde27=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0xe27d[_0x56ba92];return _0x8fe94d;};'use strict';var emlformat=require(_0xde27('0x0'));var rimraf=require(_0xde27('0x1'));var zipdir=require(_0xde27('0x2'));var jsonpatch=require(_0xde27('0x3'));var rp=require('request-promise');var moment=require(_0xde27('0x4'));var BPromise=require(_0xde27('0x5'));var Mustache=require(_0xde27('0x6'));var util=require(_0xde27('0x7'));var path=require(_0xde27('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xde27('0x9'));var fs=require('fs');var fs_extra=require(_0xde27('0xa'));var _=require(_0xde27('0xb'));var squel=require(_0xde27('0xc'));var crypto=require(_0xde27('0xd'));var jsforce=require(_0xde27('0xe'));var deskjs=require(_0xde27('0xf'));var toCsv=require(_0xde27('0x10'));var querystring=require('querystring');var Papa=require(_0xde27('0x11'));var Redis=require(_0xde27('0x12'));var authService=require(_0xde27('0x13'));var qs=require(_0xde27('0x14'));var as=require(_0xde27('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xde27('0x16'))(_0xde27('0x17'));var utils=require('../../config/utils');var config=require(_0xde27('0x18'));var licenseUtil=require(_0xde27('0x19'));var db=require(_0xde27('0x1a'))['db'];function respondWithStatusCode(_0x365366,_0x422fa9){_0x422fa9=_0x422fa9||0xcc;return function(_0x3c90da){if(_0x3c90da){return _0x365366[_0xde27('0x1b')](_0x422fa9);}return _0x365366[_0xde27('0x1c')](_0x422fa9)[_0xde27('0x1d')]();};}function respondWithResult(_0x5697ce,_0x3a8c28){_0x3a8c28=_0x3a8c28||0xc8;return function(_0x72d3a2){if(_0x72d3a2){return _0x5697ce[_0xde27('0x1c')](_0x3a8c28)['json'](_0x72d3a2);}};}function respondWithFilteredResult(_0x4c2e62,_0x651a6c){return function(_0x3e3cac){if(_0x3e3cac){var _0x5e2a15=typeof _0x651a6c['offset']==='undefined'&&typeof _0x651a6c[_0xde27('0x1e')]===_0xde27('0x1f');var _0x20f693=_0x3e3cac[_0xde27('0x20')];var _0x2f8b41=_0x5e2a15?0x0:_0x651a6c[_0xde27('0x21')];var _0x4871a6=_0x5e2a15?_0x3e3cac[_0xde27('0x20')]:_0x651a6c['offset']+_0x651a6c[_0xde27('0x1e')];var _0x453c59;if(_0x4871a6>=_0x20f693){_0x4871a6=_0x20f693;_0x453c59=0xc8;}else{_0x453c59=0xce;}_0x4c2e62['status'](_0x453c59);return _0x4c2e62[_0xde27('0x22')]('Content-Range',_0x2f8b41+'-'+_0x4871a6+'/'+_0x20f693)['json'](_0x3e3cac);}return null;};}function patchUpdates(_0x100ccb){return function(_0x2c0c75){try{jsonpatch['apply'](_0x2c0c75,_0x100ccb,!![]);}catch(_0x6b2937){return BPromise[_0xde27('0x23')](_0x6b2937);}return _0x2c0c75[_0xde27('0x24')]();};}function saveUpdates(_0x105903,_0x1c4e5c){return function(_0x80dd19){if(_0x80dd19){return _0x80dd19[_0xde27('0x25')](_0x105903)['then'](function(_0x2d78ef){return _0x2d78ef;});}return null;};}function removeEntity(_0x5a3e5b,_0x5b21df){return function(_0x58618a){if(_0x58618a){return _0x58618a[_0xde27('0x26')]()[_0xde27('0x27')](function(){_0x5a3e5b[_0xde27('0x1c')](0xcc)[_0xde27('0x1d')]();});}};}function handleEntityNotFound(_0x1289a5,_0x34c5db){return function(_0x2acf1c){if(!_0x2acf1c){_0x1289a5['sendStatus'](0x194);}return _0x2acf1c;};}function handleError(_0x253597,_0x9f7c41){_0x9f7c41=_0x9f7c41||0x1f4;return function(_0x46f525){logger['error'](_0x46f525['stack']);if(_0x46f525[_0xde27('0x28')]){delete _0x46f525[_0xde27('0x28')];}_0x253597[_0xde27('0x1c')](_0x9f7c41)[_0xde27('0x29')](_0x46f525);};}exports[_0xde27('0x2a')]=function(_0x2963f6,_0x124deb){var _0x11d103={},_0x49077a={},_0x582b47={'count':0x0,'rows':[]};var _0x371b19=_['map'](db[_0xde27('0x2b')][_0xde27('0x2c')],function(_0x70ead5){return{'name':_0x70ead5[_0xde27('0x2d')],'type':_0x70ead5[_0xde27('0x2e')][_0xde27('0x2f')]};});_0x49077a['model']=_['map'](_0x371b19,'name');_0x49077a[_0xde27('0x30')]=_[_0xde27('0x31')](_0x2963f6[_0xde27('0x30')]);_0x49077a[_0xde27('0x32')]=_[_0xde27('0x33')](_0x49077a[_0xde27('0x34')],_0x49077a['query']);_0x11d103[_0xde27('0x35')]=_[_0xde27('0x33')](_0x49077a['model'],qs[_0xde27('0x36')](_0x2963f6['query']['fields']));_0x11d103[_0xde27('0x35')]=_0x11d103[_0xde27('0x35')][_0xde27('0x37')]?_0x11d103[_0xde27('0x35')]:_0x49077a[_0xde27('0x34')];if(!_0x2963f6['query'][_0xde27('0x38')](_0xde27('0x39'))){_0x11d103['limit']=qs[_0xde27('0x1e')](_0x2963f6[_0xde27('0x30')][_0xde27('0x1e')]);_0x11d103[_0xde27('0x21')]=qs[_0xde27('0x21')](_0x2963f6[_0xde27('0x30')]['offset']);}_0x11d103[_0xde27('0x3a')]=qs[_0xde27('0x3b')](_0x2963f6[_0xde27('0x30')][_0xde27('0x3b')]);_0x11d103[_0xde27('0x3c')]=qs[_0xde27('0x32')](_[_0xde27('0x3d')](_0x2963f6[_0xde27('0x30')],_0x49077a[_0xde27('0x32')]),_0x371b19);if(_0x2963f6[_0xde27('0x30')][_0xde27('0x3e')]){_0x11d103[_0xde27('0x3c')]=_['merge'](_0x11d103[_0xde27('0x3c')],{'$or':_['map'](_0x371b19,function(_0xf16223){if(_0xf16223[_0xde27('0x2e')]!==_0xde27('0x3f')){var _0x1477bf={};_0x1477bf[_0xf16223[_0xde27('0x28')]]={'$like':'%'+_0x2963f6['query']['filter']+'%'};return _0x1477bf;}})});}_0x11d103=_[_0xde27('0x40')]({},_0x11d103,_0x2963f6[_0xde27('0x41')]);var _0x13b79d={'where':_0x11d103[_0xde27('0x3c')]};return db[_0xde27('0x2b')][_0xde27('0x20')](_0x13b79d)['then'](function(_0x50695e){_0x582b47[_0xde27('0x20')]=_0x50695e;if(_0x2963f6[_0xde27('0x30')][_0xde27('0x42')]){_0x11d103[_0xde27('0x43')]=[{'all':!![]}];}return db[_0xde27('0x2b')][_0xde27('0x44')](_0x11d103);})['then'](function(_0x4e3360){_0x582b47['rows']=_0x4e3360;return _0x582b47;})[_0xde27('0x27')](respondWithFilteredResult(_0x124deb,_0x11d103))[_0xde27('0x45')](handleError(_0x124deb,null));};exports[_0xde27('0x46')]=function(_0x4e5827,_0x5458a4){var _0x1dd0b8={'raw':!![],'where':{'id':_0x4e5827[_0xde27('0x47')]['id']}},_0x4f61ab={};_0x4f61ab[_0xde27('0x34')]=_[_0xde27('0x31')](db[_0xde27('0x2b')][_0xde27('0x2c')]);_0x4f61ab[_0xde27('0x30')]=_['keys'](_0x4e5827[_0xde27('0x30')]);_0x4f61ab[_0xde27('0x32')]=_[_0xde27('0x33')](_0x4f61ab['model'],_0x4f61ab[_0xde27('0x30')]);_0x1dd0b8[_0xde27('0x35')]=_['intersection'](_0x4f61ab[_0xde27('0x34')],qs['fields'](_0x4e5827[_0xde27('0x30')]['fields']));_0x1dd0b8[_0xde27('0x35')]=_0x1dd0b8[_0xde27('0x35')]['length']?_0x1dd0b8['attributes']:_0x4f61ab[_0xde27('0x34')];if(_0x4e5827['query']['includeAll']){_0x1dd0b8['include']=[{'all':!![]}];}_0x1dd0b8=_[_0xde27('0x40')]({},_0x1dd0b8,_0x4e5827[_0xde27('0x41')]);return db[_0xde27('0x2b')][_0xde27('0x48')](_0x1dd0b8)[_0xde27('0x27')](handleEntityNotFound(_0x5458a4,null))['then'](respondWithResult(_0x5458a4,null))[_0xde27('0x45')](handleError(_0x5458a4,null));};exports[_0xde27('0x49')]=function(_0x45593f,_0xf903aa){return db[_0xde27('0x2b')][_0xde27('0x49')](_0x45593f['body'],{})[_0xde27('0x27')](respondWithResult(_0xf903aa,0xc9))[_0xde27('0x45')](handleError(_0xf903aa,null));};exports[_0xde27('0x25')]=function(_0x3a3a11,_0x119acb){if(_0x3a3a11[_0xde27('0x4a')]['id']){delete _0x3a3a11['body']['id'];}return db[_0xde27('0x2b')][_0xde27('0x48')]({'where':{'id':_0x3a3a11[_0xde27('0x47')]['id']}})[_0xde27('0x27')](handleEntityNotFound(_0x119acb,null))[_0xde27('0x27')](saveUpdates(_0x3a3a11[_0xde27('0x4a')],null))[_0xde27('0x27')](respondWithResult(_0x119acb,null))['catch'](handleError(_0x119acb,null));};exports[_0xde27('0x26')]=function(_0xcb7336,_0x46ed0c){return db[_0xde27('0x2b')][_0xde27('0x48')]({'where':{'id':_0xcb7336[_0xde27('0x47')]['id']}})['then'](handleEntityNotFound(_0x46ed0c,null))[_0xde27('0x27')](removeEntity(_0x46ed0c,null))[_0xde27('0x45')](handleError(_0x46ed0c,null));};exports[_0xde27('0x4b')]=function(_0x5d8053,_0x2edf8b){return db['SquareReport'][_0xde27('0x4b')]()[_0xde27('0x27')](respondWithResult(_0x2edf8b,null))[_0xde27('0x45')](handleError(_0x2edf8b,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index ba915f2..d8b2070 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 _0x861b=['leaveAt','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name'];(function(_0x1baeaf,_0x41736f){var _0x246473=function(_0x1f280e){while(--_0x1f280e){_0x1baeaf['push'](_0x1baeaf['shift']());}};_0x246473(++_0x41736f);}(_0x861b,0x166));var _0xb861=function(_0x4e26b8,_0x1a3c12){_0x4e26b8=_0x4e26b8-0x0;var _0x10a6f0=_0x861b[_0x4e26b8];return _0x10a6f0;};'use strict';var _=require(_0xb861('0x0'));var util=require(_0xb861('0x1'));var logger=require(_0xb861('0x2'))(_0xb861('0x3'));var moment=require(_0xb861('0x4'));var BPromise=require('bluebird');var rp=require(_0xb861('0x5'));var fs=require('fs');var path=require(_0xb861('0x6'));var rimraf=require('rimraf');var config=require(_0xb861('0x7'));var attributes=require(_0xb861('0x8'));module[_0xb861('0x9')]=function(_0xff1325,_0x4ce63a){return _0xff1325[_0xb861('0xa')](_0xb861('0xb'),attributes,{'tableName':_0xb861('0xc'),'paranoid':![],'indexes':[{'name':_0xb861('0xd'),'fields':[_0xb861('0xe'),_0xb861('0xf')]},{'name':_0xb861('0x10'),'fields':[_0xb861('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd90b=['exports','define','report_square','uid_pname','uniqueid','project_name','leaveAt','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x4aea34,_0x5d1238){var _0x40f14e=function(_0x3d7cd6){while(--_0x3d7cd6){_0x4aea34['push'](_0x4aea34['shift']());}};_0x40f14e(++_0x5d1238);}(_0xd90b,0x177));var _0xbd90=function(_0x1979f8,_0x59ea0a){_0x1979f8=_0x1979f8-0x0;var _0x2ecd38=_0xd90b[_0x1979f8];return _0x2ecd38;};'use strict';var _=require('lodash');var util=require(_0xbd90('0x0'));var logger=require(_0xbd90('0x1'))(_0xbd90('0x2'));var moment=require('moment');var BPromise=require(_0xbd90('0x3'));var rp=require(_0xbd90('0x4'));var fs=require('fs');var path=require(_0xbd90('0x5'));var rimraf=require(_0xbd90('0x6'));var config=require(_0xbd90('0x7'));var attributes=require(_0xbd90('0x8'));module[_0xbd90('0x9')]=function(_0x47f9fc,_0x9d5b32){return _0x47f9fc[_0xbd90('0xa')]('SquareReport',attributes,{'tableName':_0xbd90('0xb'),'paranoid':![],'indexes':[{'name':_0xbd90('0xc'),'fields':[_0xbd90('0xd'),_0xbd90('0xe')]},{'name':_0xbd90('0xf'),'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 d571497..6fa1469 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 _0x9acc=['info','request\x20sent','debug','stringify','message','error','result','SquareReport,\x20%s,\x20%s','SquareReport','body','options','raw','CreateSquareReport','catch','UpdateSquareReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x4cba5a,_0x1d9edb){var _0x254a07=function(_0x148b6e){while(--_0x148b6e){_0x4cba5a['push'](_0x4cba5a['shift']());}};_0x254a07(++_0x1d9edb);}(_0x9acc,0x168));var _0xc9ac=function(_0x1a3655,_0x517e7f){_0x1a3655=_0x1a3655-0x0;var _0x297ce2=_0x9acc[_0x1a3655];return _0x297ce2;};'use strict';var _=require(_0xc9ac('0x0'));var util=require('util');var moment=require(_0xc9ac('0x1'));var BPromise=require(_0xc9ac('0x2'));var rs=require(_0xc9ac('0x3'));var fs=require('fs');var Redis=require(_0xc9ac('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc9ac('0x5'))(_0xc9ac('0x6'));var config=require(_0xc9ac('0x7'));var jayson=require(_0xc9ac('0x8'));var client=jayson[_0xc9ac('0x9')][_0xc9ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x342b56,_0x30456e,_0x33f456){return new BPromise(function(_0x48c716,_0x26c1ec){return client['request'](_0x342b56,_0x33f456)[_0xc9ac('0xb')](function(_0x1ded8c){logger[_0xc9ac('0xc')]('SquareReport,\x20%s,\x20%s',_0x30456e,_0xc9ac('0xd'));logger[_0xc9ac('0xe')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x30456e,_0xc9ac('0xd'),JSON[_0xc9ac('0xf')](_0x1ded8c));if(_0x1ded8c['error']){if(_0x1ded8c['error']['code']===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x30456e,_0x1ded8c['error'][_0xc9ac('0x10')]);return _0x26c1ec(_0x1ded8c[_0xc9ac('0x11')][_0xc9ac('0x10')]);}logger[_0xc9ac('0x11')]('SquareReport,\x20%s,\x20%s',_0x30456e,_0x1ded8c['error']['message']);return _0x48c716(_0x1ded8c[_0xc9ac('0x11')][_0xc9ac('0x10')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x30456e,'request\x20sent');_0x48c716(_0x1ded8c[_0xc9ac('0x12')][_0xc9ac('0x10')]);}})['catch'](function(_0x37733f){logger[_0xc9ac('0x11')](_0xc9ac('0x13'),_0x30456e,_0x37733f);_0x26c1ec(_0x37733f);});});}exports['CreateSquareReport']=function(_0x1831f3){var _0x39b9ec=this;return new Promise(function(_0x3aa709,_0x360bf0){return db[_0xc9ac('0x14')]['create'](_0x1831f3[_0xc9ac('0x15')],{'raw':_0x1831f3[_0xc9ac('0x16')]?_0x1831f3['options'][_0xc9ac('0x17')]===undefined?!![]:![]:!![]})[_0xc9ac('0xb')](function(_0x52e560){logger[_0xc9ac('0xc')](_0xc9ac('0x18'),_0x1831f3);logger[_0xc9ac('0xe')](_0xc9ac('0x18'),_0x1831f3,JSON['stringify'](_0x52e560));_0x3aa709(_0x52e560);})[_0xc9ac('0x19')](function(_0x2a79af){logger[_0xc9ac('0x11')](_0xc9ac('0x18'),_0x2a79af['message'],_0x1831f3);_0x360bf0(_0x39b9ec[_0xc9ac('0x11')](0x1f4,_0x2a79af[_0xc9ac('0x10')]));});});};exports[_0xc9ac('0x1a')]=function(_0x4d9867){var _0x4b959c=this;return new Promise(function(_0x5b7966,_0x3c2b7e){return db['SquareReport'][_0xc9ac('0x1b')](_0x4d9867['body'],{'raw':_0x4d9867[_0xc9ac('0x16')]?_0x4d9867['options'][_0xc9ac('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d9867[_0xc9ac('0x16')]?_0x4d9867[_0xc9ac('0x16')][_0xc9ac('0x1c')]||null:null,'attributes':_0x4d9867['options']?_0x4d9867[_0xc9ac('0x16')][_0xc9ac('0x1d')]||null:null,'limit':_0x4d9867[_0xc9ac('0x16')]?_0x4d9867['options'][_0xc9ac('0x1e')]||null:null})['then'](function(_0x542d8c){logger[_0xc9ac('0xc')](_0xc9ac('0x1a'),_0x4d9867);logger['debug'](_0xc9ac('0x1a'),_0x4d9867,JSON['stringify'](_0x542d8c));_0x5b7966(_0x542d8c);})[_0xc9ac('0x19')](function(_0x14ea35){logger[_0xc9ac('0x11')](_0xc9ac('0x1a'),_0x14ea35[_0xc9ac('0x10')],_0x4d9867);_0x3c2b7e(_0x4b959c[_0xc9ac('0x11')](0x1f4,_0x14ea35['message']));});});}; \ No newline at end of file +var _0x53f4=['then','info','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','error','SquareReport,\x20%s,\x20%s','message','result','catch','body','options','raw','CreateSquareReport','debug','stringify','UpdateSquareReport','SquareReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x18d5d7,_0x19074b){var _0x30a9ea=function(_0x514f3f){while(--_0x514f3f){_0x18d5d7['push'](_0x18d5d7['shift']());}};_0x30a9ea(++_0x19074b);}(_0x53f4,0x15f));var _0x453f=function(_0x3481a5,_0x64fd93){_0x3481a5=_0x3481a5-0x0;var _0x2cdefa=_0x53f4[_0x3481a5];return _0x2cdefa;};'use strict';var _=require(_0x453f('0x0'));var util=require('util');var moment=require(_0x453f('0x1'));var BPromise=require(_0x453f('0x2'));var rs=require(_0x453f('0x3'));var fs=require('fs');var Redis=require(_0x453f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x453f('0x5'));var logger=require(_0x453f('0x6'))(_0x453f('0x7'));var config=require('../../config/environment');var jayson=require(_0x453f('0x8'));var client=jayson[_0x453f('0x9')][_0x453f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x351d72,_0xf744f7,_0x3f3b51){return new BPromise(function(_0x4f5db8,_0x5faa34){return client[_0x453f('0xb')](_0x351d72,_0x3f3b51)[_0x453f('0xc')](function(_0x3c6eb6){logger[_0x453f('0xd')]('SquareReport,\x20%s,\x20%s',_0xf744f7,_0x453f('0xe'));logger['debug'](_0x453f('0xf'),_0xf744f7,_0x453f('0xe'),JSON['stringify'](_0x3c6eb6));if(_0x3c6eb6[_0x453f('0x10')]){if(_0x3c6eb6[_0x453f('0x10')]['code']===0x1f4){logger[_0x453f('0x10')](_0x453f('0x11'),_0xf744f7,_0x3c6eb6[_0x453f('0x10')][_0x453f('0x12')]);return _0x5faa34(_0x3c6eb6[_0x453f('0x10')]['message']);}logger[_0x453f('0x10')](_0x453f('0x11'),_0xf744f7,_0x3c6eb6[_0x453f('0x10')][_0x453f('0x12')]);return _0x4f5db8(_0x3c6eb6[_0x453f('0x10')][_0x453f('0x12')]);}else{logger[_0x453f('0xd')](_0x453f('0x11'),_0xf744f7,_0x453f('0xe'));_0x4f5db8(_0x3c6eb6[_0x453f('0x13')][_0x453f('0x12')]);}})[_0x453f('0x14')](function(_0x2571b7){logger[_0x453f('0x10')](_0x453f('0x11'),_0xf744f7,_0x2571b7);_0x5faa34(_0x2571b7);});});}exports['CreateSquareReport']=function(_0x478cf3){var _0x1196b9=this;return new Promise(function(_0x26c9e5,_0x86fbff){return db['SquareReport']['create'](_0x478cf3[_0x453f('0x15')],{'raw':_0x478cf3[_0x453f('0x16')]?_0x478cf3[_0x453f('0x16')][_0x453f('0x17')]===undefined?!![]:![]:!![]})[_0x453f('0xc')](function(_0x2512d4){logger[_0x453f('0xd')](_0x453f('0x18'),_0x478cf3);logger[_0x453f('0x19')](_0x453f('0x18'),_0x478cf3,JSON[_0x453f('0x1a')](_0x2512d4));_0x26c9e5(_0x2512d4);})[_0x453f('0x14')](function(_0x48dd6d){logger['error'](_0x453f('0x18'),_0x48dd6d[_0x453f('0x12')],_0x478cf3);_0x86fbff(_0x1196b9[_0x453f('0x10')](0x1f4,_0x48dd6d[_0x453f('0x12')]));});});};exports[_0x453f('0x1b')]=function(_0x2929ad){var _0x2be3aa=this;return new Promise(function(_0x11991c,_0x4896c6){return db[_0x453f('0x1c')][_0x453f('0x1d')](_0x2929ad[_0x453f('0x15')],{'raw':_0x2929ad[_0x453f('0x16')]?_0x2929ad[_0x453f('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2929ad[_0x453f('0x16')]?_0x2929ad[_0x453f('0x16')][_0x453f('0x1e')]||null:null,'attributes':_0x2929ad[_0x453f('0x16')]?_0x2929ad['options'][_0x453f('0x1f')]||null:null,'limit':_0x2929ad['options']?_0x2929ad['options'][_0x453f('0x20')]||null:null})[_0x453f('0xc')](function(_0x2bc1b5){logger[_0x453f('0xd')](_0x453f('0x1b'),_0x2929ad);logger['debug']('UpdateSquareReport',_0x2929ad,JSON['stringify'](_0x2bc1b5));_0x11991c(_0x2bc1b5);})[_0x453f('0x14')](function(_0xfc39e6){logger[_0x453f('0x10')](_0x453f('0x1b'),_0xfc39e6[_0x453f('0x12')],_0x2929ad);_0x4896c6(_0x2be3aa['error'](0x1f4,_0xfc39e6[_0x453f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index f890fa2..490b615 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 _0xf953=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','destroy','multer','path'];(function(_0x4c8256,_0x427c67){var _0x2e0c1c=function(_0x106ec2){while(--_0x106ec2){_0x4c8256['push'](_0x4c8256['shift']());}};_0x2e0c1c(++_0x427c67);}(_0xf953,0xa8));var _0x3f95=function(_0x26df3e,_0x16d5f7){_0x26df3e=_0x26df3e-0x0;var _0x2d34ed=_0xf953[_0x26df3e];return _0x2d34ed;};'use strict';var multer=require(_0x3f95('0x0'));var util=require('util');var path=require(_0x3f95('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3f95('0x2'));var interaction=require(_0x3f95('0x3'));var config=require(_0x3f95('0x4'));var controller=require(_0x3f95('0x5'));router[_0x3f95('0x6')]('/',auth[_0x3f95('0x7')](),controller['index']);router['get'](_0x3f95('0x8'),auth['isAuthenticated'](),controller[_0x3f95('0x9')]);router[_0x3f95('0x6')]('/:id',auth[_0x3f95('0x7')](),controller[_0x3f95('0xa')]);router[_0x3f95('0xb')]('/',auth[_0x3f95('0x7')](),controller[_0x3f95('0xc')]);router[_0x3f95('0xd')](_0x3f95('0xe'),auth[_0x3f95('0x7')](),controller[_0x3f95('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3f95('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4389=['../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','show','post','isAuthenticated','create','put','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x4389,0x76));var _0x9438=function(_0x3ca1df,_0x51a693){_0x3ca1df=_0x3ca1df-0x0;var _0x204237=_0x4389[_0x3ca1df];return _0x204237;};'use strict';var multer=require(_0x9438('0x0'));var util=require(_0x9438('0x1'));var path=require(_0x9438('0x2'));var timeout=require(_0x9438('0x3'));var express=require(_0x9438('0x4'));var router=express[_0x9438('0x5')]();var fs_extra=require(_0x9438('0x6'));var auth=require(_0x9438('0x7'));var interaction=require(_0x9438('0x8'));var config=require(_0x9438('0x9'));var controller=require('./squareReportDetail.controller');router[_0x9438('0xa')]('/',auth['isAuthenticated'](),controller[_0x9438('0xb')]);router['get'](_0x9438('0xc'),auth['isAuthenticated'](),controller[_0x9438('0xd')]);router[_0x9438('0xa')](_0x9438('0xe'),auth['isAuthenticated'](),controller[_0x9438('0xf')]);router[_0x9438('0x10')]('/',auth[_0x9438('0x11')](),controller[_0x9438('0x12')]);router[_0x9438('0x13')](_0x9438('0xe'),auth[_0x9438('0x11')](),controller['update']);router['delete'](_0x9438('0xe'),auth[_0x9438('0x11')](),controller['destroy']);module[_0x9438('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 7077ebb..3a07b7c 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 _0xf245=['TEXT','exports','STRING'];(function(_0x359cc6,_0x161486){var _0x3315de=function(_0x456a17){while(--_0x456a17){_0x359cc6['push'](_0x359cc6['shift']());}};_0x3315de(++_0x161486);}(_0xf245,0x1bd));var _0x5f24=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0xf245[_0x38537f];return _0x141e23;};'use strict';var Sequelize=require('sequelize');module[_0x5f24('0x0')]={'uniqueid':{'type':Sequelize[_0x5f24('0x1')]},'node':{'type':Sequelize[_0x5f24('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x5f24('0x2')]},'project_name':{'type':Sequelize[_0x5f24('0x1')]},'callerid':{'type':Sequelize[_0x5f24('0x1')]}}; \ No newline at end of file +var _0xb085=['TEXT','sequelize','exports','STRING'];(function(_0x4bc7e5,_0xa2bde2){var _0x15d9a5=function(_0x49e7d4){while(--_0x49e7d4){_0x4bc7e5['push'](_0x4bc7e5['shift']());}};_0x15d9a5(++_0xa2bde2);}(_0xb085,0x99));var _0x5b08=function(_0x436f08,_0x2a413c){_0x436f08=_0x436f08-0x0;var _0x325dc4=_0xb085[_0x436f08];return _0x325dc4;};'use strict';var Sequelize=require(_0x5b08('0x0'));module[_0x5b08('0x1')]={'uniqueid':{'type':Sequelize[_0x5b08('0x2')]},'node':{'type':Sequelize[_0x5b08('0x2')]},'application':{'type':Sequelize[_0x5b08('0x2')]},'data':{'type':Sequelize[_0x5b08('0x3')]},'project_name':{'type':Sequelize[_0x5b08('0x2')]},'callerid':{'type':Sequelize[_0x5b08('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index fd8a875..cede00d 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 _0x8676=['offset','set','Content-Range','apply','reject','save','update','destroy','error','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','where','VIRTUAL','filter','merge','options','then','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','undefined','count'];(function(_0x40741b,_0x380f1a){var _0x30e499=function(_0x1c8dbc){while(--_0x1c8dbc){_0x40741b['push'](_0x40741b['shift']());}};_0x30e499(++_0x380f1a);}(_0x8676,0x16a));var _0x6867=function(_0x4ee391,_0x212f0a){_0x4ee391=_0x4ee391-0x0;var _0xc740f4=_0x8676[_0x4ee391];return _0xc740f4;};'use strict';var emlformat=require(_0x6867('0x0'));var rimraf=require(_0x6867('0x1'));var zipdir=require(_0x6867('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6867('0x3'));var moment=require(_0x6867('0x4'));var BPromise=require(_0x6867('0x5'));var Mustache=require(_0x6867('0x6'));var util=require(_0x6867('0x7'));var path=require(_0x6867('0x8'));var sox=require(_0x6867('0x9'));var csv=require(_0x6867('0xa'));var ejs=require(_0x6867('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6867('0xc'));var squel=require(_0x6867('0xd'));var crypto=require(_0x6867('0xe'));var jsforce=require(_0x6867('0xf'));var deskjs=require(_0x6867('0x10'));var toCsv=require(_0x6867('0xa'));var querystring=require(_0x6867('0x11'));var Papa=require(_0x6867('0x12'));var Redis=require('ioredis');var authService=require(_0x6867('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6867('0x14'));var hardwareService=require(_0x6867('0x15'));var logger=require(_0x6867('0x16'))(_0x6867('0x17'));var utils=require(_0x6867('0x18'));var config=require(_0x6867('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b8d39,_0x37a32a){_0x37a32a=_0x37a32a||0xcc;return function(_0x300f8d){if(_0x300f8d){return _0x4b8d39[_0x6867('0x1a')](_0x37a32a);}return _0x4b8d39[_0x6867('0x1b')](_0x37a32a)[_0x6867('0x1c')]();};}function respondWithResult(_0x36f498,_0x2e31cc){_0x2e31cc=_0x2e31cc||0xc8;return function(_0x379393){if(_0x379393){return _0x36f498[_0x6867('0x1b')](_0x2e31cc)[_0x6867('0x1d')](_0x379393);}};}function respondWithFilteredResult(_0x40a1b9,_0x202ff9){return function(_0x23477f){if(_0x23477f){var _0x56a127=typeof _0x202ff9['offset']==='undefined'&&typeof _0x202ff9[_0x6867('0x1e')]===_0x6867('0x1f');var _0x2145c2=_0x23477f[_0x6867('0x20')];var _0x54824f=_0x56a127?0x0:_0x202ff9[_0x6867('0x21')];var _0x5810a1=_0x56a127?_0x23477f[_0x6867('0x20')]:_0x202ff9[_0x6867('0x21')]+_0x202ff9['limit'];var _0x4f6aa4;if(_0x5810a1>=_0x2145c2){_0x5810a1=_0x2145c2;_0x4f6aa4=0xc8;}else{_0x4f6aa4=0xce;}_0x40a1b9[_0x6867('0x1b')](_0x4f6aa4);return _0x40a1b9[_0x6867('0x22')](_0x6867('0x23'),_0x54824f+'-'+_0x5810a1+'/'+_0x2145c2)[_0x6867('0x1d')](_0x23477f);}return null;};}function patchUpdates(_0x59410d){return function(_0x1ebe81){try{jsonpatch[_0x6867('0x24')](_0x1ebe81,_0x59410d,!![]);}catch(_0x4c7700){return BPromise[_0x6867('0x25')](_0x4c7700);}return _0x1ebe81[_0x6867('0x26')]();};}function saveUpdates(_0x53047c,_0x53e47b){return function(_0x7403ba){if(_0x7403ba){return _0x7403ba[_0x6867('0x27')](_0x53047c)['then'](function(_0x42ae8a){return _0x42ae8a;});}return null;};}function removeEntity(_0x24c9f1,_0x3401e0){return function(_0x54523f){if(_0x54523f){return _0x54523f[_0x6867('0x28')]()['then'](function(){_0x24c9f1[_0x6867('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45e334,_0x237764){return function(_0x5eb146){if(!_0x5eb146){_0x45e334[_0x6867('0x1a')](0x194);}return _0x5eb146;};}function handleError(_0x24ff80,_0x3e03dc){_0x3e03dc=_0x3e03dc||0x1f4;return function(_0x163220){logger[_0x6867('0x29')](_0x163220['stack']);if(_0x163220['name']){delete _0x163220[_0x6867('0x2a')];}_0x24ff80[_0x6867('0x1b')](_0x3e03dc)[_0x6867('0x2b')](_0x163220);};}exports[_0x6867('0x2c')]=function(_0x2c5b30,_0x5778eb){var _0x48d32d={},_0x1a9c89={},_0x3ef5c9={'count':0x0,'rows':[]};var _0x3140fc=_[_0x6867('0x2d')](db[_0x6867('0x2e')][_0x6867('0x2f')],function(_0x49ed58){return{'name':_0x49ed58[_0x6867('0x30')],'type':_0x49ed58[_0x6867('0x31')][_0x6867('0x32')]};});_0x1a9c89[_0x6867('0x33')]=_[_0x6867('0x2d')](_0x3140fc,'name');_0x1a9c89[_0x6867('0x34')]=_[_0x6867('0x35')](_0x2c5b30[_0x6867('0x34')]);_0x1a9c89[_0x6867('0x36')]=_[_0x6867('0x37')](_0x1a9c89[_0x6867('0x33')],_0x1a9c89['query']);_0x48d32d[_0x6867('0x38')]=_[_0x6867('0x37')](_0x1a9c89[_0x6867('0x33')],qs[_0x6867('0x39')](_0x2c5b30[_0x6867('0x34')][_0x6867('0x39')]));_0x48d32d[_0x6867('0x38')]=_0x48d32d[_0x6867('0x38')]['length']?_0x48d32d[_0x6867('0x38')]:_0x1a9c89[_0x6867('0x33')];if(!_0x2c5b30[_0x6867('0x34')][_0x6867('0x3a')]('nolimit')){_0x48d32d['limit']=qs[_0x6867('0x1e')](_0x2c5b30[_0x6867('0x34')][_0x6867('0x1e')]);_0x48d32d[_0x6867('0x21')]=qs[_0x6867('0x21')](_0x2c5b30['query'][_0x6867('0x21')]);}_0x48d32d['order']=qs['sort'](_0x2c5b30[_0x6867('0x34')][_0x6867('0x3b')]);_0x48d32d['where']=qs[_0x6867('0x36')](_[_0x6867('0x3c')](_0x2c5b30[_0x6867('0x34')],_0x1a9c89[_0x6867('0x36')]),_0x3140fc);if(_0x2c5b30['query']['filter']){_0x48d32d[_0x6867('0x3d')]=_['merge'](_0x48d32d['where'],{'$or':_[_0x6867('0x2d')](_0x3140fc,function(_0x2d9708){if(_0x2d9708['type']!==_0x6867('0x3e')){var _0x2daf91={};_0x2daf91[_0x2d9708[_0x6867('0x2a')]]={'$like':'%'+_0x2c5b30[_0x6867('0x34')][_0x6867('0x3f')]+'%'};return _0x2daf91;}})});}_0x48d32d=_[_0x6867('0x40')]({},_0x48d32d,_0x2c5b30[_0x6867('0x41')]);var _0x3e9f5f={'where':_0x48d32d['where']};return db['SquareDetailsReport'][_0x6867('0x20')](_0x3e9f5f)[_0x6867('0x42')](function(_0x48b19c){_0x3ef5c9[_0x6867('0x20')]=_0x48b19c;if(_0x2c5b30['query']['includeAll']){_0x48d32d[_0x6867('0x43')]=[{'all':!![]}];}return db[_0x6867('0x2e')][_0x6867('0x44')](_0x48d32d);})[_0x6867('0x42')](function(_0x14e38d){_0x3ef5c9[_0x6867('0x45')]=_0x14e38d;return _0x3ef5c9;})['then'](respondWithFilteredResult(_0x5778eb,_0x48d32d))[_0x6867('0x46')](handleError(_0x5778eb,null));};exports[_0x6867('0x47')]=function(_0x2cff39,_0x281e49){var _0x1a4c8c={'raw':!![],'where':{'id':_0x2cff39[_0x6867('0x48')]['id']}},_0x13ba08={};_0x13ba08['model']=_[_0x6867('0x35')](db[_0x6867('0x2e')]['rawAttributes']);_0x13ba08[_0x6867('0x34')]=_[_0x6867('0x35')](_0x2cff39[_0x6867('0x34')]);_0x13ba08['filters']=_[_0x6867('0x37')](_0x13ba08[_0x6867('0x33')],_0x13ba08[_0x6867('0x34')]);_0x1a4c8c[_0x6867('0x38')]=_['intersection'](_0x13ba08[_0x6867('0x33')],qs[_0x6867('0x39')](_0x2cff39[_0x6867('0x34')][_0x6867('0x39')]));_0x1a4c8c[_0x6867('0x38')]=_0x1a4c8c[_0x6867('0x38')][_0x6867('0x49')]?_0x1a4c8c['attributes']:_0x13ba08[_0x6867('0x33')];if(_0x2cff39[_0x6867('0x34')][_0x6867('0x4a')]){_0x1a4c8c[_0x6867('0x43')]=[{'all':!![]}];}_0x1a4c8c=_[_0x6867('0x40')]({},_0x1a4c8c,_0x2cff39['options']);return db[_0x6867('0x2e')]['find'](_0x1a4c8c)['then'](handleEntityNotFound(_0x281e49,null))['then'](respondWithResult(_0x281e49,null))[_0x6867('0x46')](handleError(_0x281e49,null));};exports[_0x6867('0x4b')]=function(_0x5c00e2,_0x18a170){return db[_0x6867('0x2e')][_0x6867('0x4b')](_0x5c00e2[_0x6867('0x4c')],{})['then'](respondWithResult(_0x18a170,0xc9))[_0x6867('0x46')](handleError(_0x18a170,null));};exports[_0x6867('0x27')]=function(_0x302877,_0x3bf838){if(_0x302877[_0x6867('0x4c')]['id']){delete _0x302877[_0x6867('0x4c')]['id'];}return db[_0x6867('0x2e')][_0x6867('0x4d')]({'where':{'id':_0x302877[_0x6867('0x48')]['id']}})['then'](handleEntityNotFound(_0x3bf838,null))['then'](saveUpdates(_0x302877[_0x6867('0x4c')],null))[_0x6867('0x42')](respondWithResult(_0x3bf838,null))['catch'](handleError(_0x3bf838,null));};exports[_0x6867('0x28')]=function(_0x438623,_0x5f01e0){return db['SquareDetailsReport']['find']({'where':{'id':_0x438623[_0x6867('0x48')]['id']}})[_0x6867('0x42')](handleEntityNotFound(_0x5f01e0,null))[_0x6867('0x42')](removeEntity(_0x5f01e0,null))[_0x6867('0x46')](handleError(_0x5f01e0,null));};exports[_0x6867('0x4e')]=function(_0xa275f0,_0x35ac84){return db[_0x6867('0x2e')]['describe']()[_0x6867('0x42')](respondWithResult(_0x35ac84,null))[_0x6867('0x46')](handleError(_0x35ac84,null));}; \ No newline at end of file +var _0xc967=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x5ad794,_0x330eb1){var _0x58d45e=function(_0x28c899){while(--_0x28c899){_0x5ad794['push'](_0x5ad794['shift']());}};_0x58d45e(++_0x330eb1);}(_0xc967,0xe4));var _0x7c96=function(_0x53a6f8,_0x284333){_0x53a6f8=_0x53a6f8-0x0;var _0xa5fd62=_0xc967[_0x53a6f8];return _0xa5fd62;};'use strict';var emlformat=require(_0x7c96('0x0'));var rimraf=require(_0x7c96('0x1'));var zipdir=require(_0x7c96('0x2'));var jsonpatch=require(_0x7c96('0x3'));var rp=require(_0x7c96('0x4'));var moment=require(_0x7c96('0x5'));var BPromise=require(_0x7c96('0x6'));var Mustache=require(_0x7c96('0x7'));var util=require('util');var path=require('path');var sox=require(_0x7c96('0x8'));var csv=require(_0x7c96('0x9'));var ejs=require(_0x7c96('0xa'));var fs=require('fs');var fs_extra=require(_0x7c96('0xb'));var _=require(_0x7c96('0xc'));var squel=require(_0x7c96('0xd'));var crypto=require(_0x7c96('0xe'));var jsforce=require(_0x7c96('0xf'));var deskjs=require(_0x7c96('0x10'));var toCsv=require(_0x7c96('0x9'));var querystring=require(_0x7c96('0x11'));var Papa=require(_0x7c96('0x12'));var Redis=require(_0x7c96('0x13'));var authService=require(_0x7c96('0x14'));var qs=require(_0x7c96('0x15'));var as=require(_0x7c96('0x16'));var hardwareService=require(_0x7c96('0x17'));var logger=require('../../config/logger')(_0x7c96('0x18'));var utils=require(_0x7c96('0x19'));var config=require(_0x7c96('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36df4e,_0x34c591){_0x34c591=_0x34c591||0xcc;return function(_0x42b305){if(_0x42b305){return _0x36df4e[_0x7c96('0x1b')](_0x34c591);}return _0x36df4e['status'](_0x34c591)[_0x7c96('0x1c')]();};}function respondWithResult(_0x1bc6d8,_0x22fa20){_0x22fa20=_0x22fa20||0xc8;return function(_0x1133a6){if(_0x1133a6){return _0x1bc6d8[_0x7c96('0x1d')](_0x22fa20)[_0x7c96('0x1e')](_0x1133a6);}};}function respondWithFilteredResult(_0x53ba1c,_0x621686){return function(_0x4c91e5){if(_0x4c91e5){var _0x475dce=typeof _0x621686[_0x7c96('0x1f')]==='undefined'&&typeof _0x621686[_0x7c96('0x20')]===_0x7c96('0x21');var _0x1706fa=_0x4c91e5['count'];var _0xe8d360=_0x475dce?0x0:_0x621686[_0x7c96('0x1f')];var _0x5b9b7e=_0x475dce?_0x4c91e5['count']:_0x621686[_0x7c96('0x1f')]+_0x621686[_0x7c96('0x20')];var _0x58efe5;if(_0x5b9b7e>=_0x1706fa){_0x5b9b7e=_0x1706fa;_0x58efe5=0xc8;}else{_0x58efe5=0xce;}_0x53ba1c[_0x7c96('0x1d')](_0x58efe5);return _0x53ba1c[_0x7c96('0x22')](_0x7c96('0x23'),_0xe8d360+'-'+_0x5b9b7e+'/'+_0x1706fa)[_0x7c96('0x1e')](_0x4c91e5);}return null;};}function patchUpdates(_0x1fe1d6){return function(_0x222b53){try{jsonpatch[_0x7c96('0x24')](_0x222b53,_0x1fe1d6,!![]);}catch(_0x1f05e8){return BPromise[_0x7c96('0x25')](_0x1f05e8);}return _0x222b53[_0x7c96('0x26')]();};}function saveUpdates(_0x3c470a,_0x13b283){return function(_0x17745d){if(_0x17745d){return _0x17745d[_0x7c96('0x27')](_0x3c470a)['then'](function(_0x461652){return _0x461652;});}return null;};}function removeEntity(_0x476cbc,_0x695d12){return function(_0x3833a6){if(_0x3833a6){return _0x3833a6[_0x7c96('0x28')]()[_0x7c96('0x29')](function(){_0x476cbc[_0x7c96('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x567179,_0x243f10){return function(_0x301151){if(!_0x301151){_0x567179['sendStatus'](0x194);}return _0x301151;};}function handleError(_0xacf8ec,_0x144d92){_0x144d92=_0x144d92||0x1f4;return function(_0x52550d){logger['error'](_0x52550d[_0x7c96('0x2a')]);if(_0x52550d[_0x7c96('0x2b')]){delete _0x52550d[_0x7c96('0x2b')];}_0xacf8ec[_0x7c96('0x1d')](_0x144d92)[_0x7c96('0x2c')](_0x52550d);};}exports[_0x7c96('0x2d')]=function(_0x15338b,_0x263a39){var _0x36671f={},_0x1d01b0={},_0x5ac08d={'count':0x0,'rows':[]};var _0x8b33f3=_[_0x7c96('0x2e')](db[_0x7c96('0x2f')][_0x7c96('0x30')],function(_0x457dfc){return{'name':_0x457dfc[_0x7c96('0x31')],'type':_0x457dfc[_0x7c96('0x32')][_0x7c96('0x33')]};});_0x1d01b0['model']=_[_0x7c96('0x2e')](_0x8b33f3,_0x7c96('0x2b'));_0x1d01b0[_0x7c96('0x34')]=_[_0x7c96('0x35')](_0x15338b[_0x7c96('0x34')]);_0x1d01b0[_0x7c96('0x36')]=_[_0x7c96('0x37')](_0x1d01b0[_0x7c96('0x38')],_0x1d01b0[_0x7c96('0x34')]);_0x36671f[_0x7c96('0x39')]=_[_0x7c96('0x37')](_0x1d01b0[_0x7c96('0x38')],qs['fields'](_0x15338b[_0x7c96('0x34')][_0x7c96('0x3a')]));_0x36671f[_0x7c96('0x39')]=_0x36671f[_0x7c96('0x39')][_0x7c96('0x3b')]?_0x36671f['attributes']:_0x1d01b0[_0x7c96('0x38')];if(!_0x15338b[_0x7c96('0x34')][_0x7c96('0x3c')](_0x7c96('0x3d'))){_0x36671f[_0x7c96('0x20')]=qs[_0x7c96('0x20')](_0x15338b[_0x7c96('0x34')][_0x7c96('0x20')]);_0x36671f[_0x7c96('0x1f')]=qs[_0x7c96('0x1f')](_0x15338b[_0x7c96('0x34')][_0x7c96('0x1f')]);}_0x36671f[_0x7c96('0x3e')]=qs[_0x7c96('0x3f')](_0x15338b[_0x7c96('0x34')][_0x7c96('0x3f')]);_0x36671f[_0x7c96('0x40')]=qs[_0x7c96('0x36')](_[_0x7c96('0x41')](_0x15338b[_0x7c96('0x34')],_0x1d01b0[_0x7c96('0x36')]),_0x8b33f3);if(_0x15338b[_0x7c96('0x34')][_0x7c96('0x42')]){_0x36671f['where']=_[_0x7c96('0x43')](_0x36671f[_0x7c96('0x40')],{'$or':_[_0x7c96('0x2e')](_0x8b33f3,function(_0x571b4c){if(_0x571b4c[_0x7c96('0x32')]!==_0x7c96('0x44')){var _0x2443af={};_0x2443af[_0x571b4c[_0x7c96('0x2b')]]={'$like':'%'+_0x15338b[_0x7c96('0x34')]['filter']+'%'};return _0x2443af;}})});}_0x36671f=_[_0x7c96('0x43')]({},_0x36671f,_0x15338b['options']);var _0x12e3e4={'where':_0x36671f[_0x7c96('0x40')]};return db[_0x7c96('0x2f')][_0x7c96('0x45')](_0x12e3e4)[_0x7c96('0x29')](function(_0x1f9574){_0x5ac08d[_0x7c96('0x45')]=_0x1f9574;if(_0x15338b[_0x7c96('0x34')]['includeAll']){_0x36671f[_0x7c96('0x46')]=[{'all':!![]}];}return db[_0x7c96('0x2f')][_0x7c96('0x47')](_0x36671f);})[_0x7c96('0x29')](function(_0x53e138){_0x5ac08d[_0x7c96('0x48')]=_0x53e138;return _0x5ac08d;})[_0x7c96('0x29')](respondWithFilteredResult(_0x263a39,_0x36671f))[_0x7c96('0x49')](handleError(_0x263a39,null));};exports[_0x7c96('0x4a')]=function(_0x41afdd,_0x5a6ccb){var _0x8fbc1b={'raw':!![],'where':{'id':_0x41afdd['params']['id']}},_0x46f5b1={};_0x46f5b1['model']=_['keys'](db['SquareDetailsReport'][_0x7c96('0x30')]);_0x46f5b1[_0x7c96('0x34')]=_[_0x7c96('0x35')](_0x41afdd[_0x7c96('0x34')]);_0x46f5b1['filters']=_[_0x7c96('0x37')](_0x46f5b1[_0x7c96('0x38')],_0x46f5b1['query']);_0x8fbc1b['attributes']=_[_0x7c96('0x37')](_0x46f5b1[_0x7c96('0x38')],qs[_0x7c96('0x3a')](_0x41afdd['query']['fields']));_0x8fbc1b['attributes']=_0x8fbc1b[_0x7c96('0x39')][_0x7c96('0x3b')]?_0x8fbc1b['attributes']:_0x46f5b1[_0x7c96('0x38')];if(_0x41afdd[_0x7c96('0x34')][_0x7c96('0x4b')]){_0x8fbc1b['include']=[{'all':!![]}];}_0x8fbc1b=_[_0x7c96('0x43')]({},_0x8fbc1b,_0x41afdd['options']);return db['SquareDetailsReport'][_0x7c96('0x4c')](_0x8fbc1b)[_0x7c96('0x29')](handleEntityNotFound(_0x5a6ccb,null))[_0x7c96('0x29')](respondWithResult(_0x5a6ccb,null))[_0x7c96('0x49')](handleError(_0x5a6ccb,null));};exports[_0x7c96('0x4d')]=function(_0x383333,_0xbc4689){return db[_0x7c96('0x2f')][_0x7c96('0x4d')](_0x383333['body'],{})[_0x7c96('0x29')](respondWithResult(_0xbc4689,0xc9))[_0x7c96('0x49')](handleError(_0xbc4689,null));};exports['update']=function(_0x13f564,_0x1fb8bf){if(_0x13f564[_0x7c96('0x4e')]['id']){delete _0x13f564['body']['id'];}return db[_0x7c96('0x2f')][_0x7c96('0x4c')]({'where':{'id':_0x13f564['params']['id']}})[_0x7c96('0x29')](handleEntityNotFound(_0x1fb8bf,null))[_0x7c96('0x29')](saveUpdates(_0x13f564[_0x7c96('0x4e')],null))[_0x7c96('0x29')](respondWithResult(_0x1fb8bf,null))['catch'](handleError(_0x1fb8bf,null));};exports[_0x7c96('0x28')]=function(_0x3b605a,_0x252e27){return db[_0x7c96('0x2f')][_0x7c96('0x4c')]({'where':{'id':_0x3b605a[_0x7c96('0x4f')]['id']}})[_0x7c96('0x29')](handleEntityNotFound(_0x252e27,null))[_0x7c96('0x29')](removeEntity(_0x252e27,null))[_0x7c96('0x49')](handleError(_0x252e27,null));};exports['describe']=function(_0x385c2c,_0xc903d9){return db['SquareDetailsReport'][_0x7c96('0x50')]()['then'](respondWithResult(_0xc903d9,null))[_0x7c96('0x49')](handleError(_0xc903d9,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 22367a1..3d44c1c 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 _0x2844=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details'];(function(_0x333798,_0x9f6561){var _0x389f4e=function(_0x193b28){while(--_0x193b28){_0x333798['push'](_0x333798['shift']());}};_0x389f4e(++_0x9f6561);}(_0x2844,0x1d4));var _0x4284=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x2844[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x4284('0x0'));var util=require('util');var logger=require(_0x4284('0x1'))(_0x4284('0x2'));var moment=require(_0x4284('0x3'));var BPromise=require(_0x4284('0x4'));var rp=require(_0x4284('0x5'));var fs=require('fs');var path=require(_0x4284('0x6'));var rimraf=require(_0x4284('0x7'));var config=require('../../config/environment');var attributes=require(_0x4284('0x8'));module['exports']=function(_0x1112ab,_0x2e477b){return _0x1112ab[_0x4284('0x9')](_0x4284('0xa'),attributes,{'tableName':_0x4284('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c64=['path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5932c4,_0x1b58ab){var _0x53acee=function(_0x2f4c86){while(--_0x2f4c86){_0x5932c4['push'](_0x5932c4['shift']());}};_0x53acee(++_0x1b58ab);}(_0x9c64,0x165));var _0x49c6=function(_0x9757a9,_0x22b828){_0x9757a9=_0x9757a9-0x0;var _0x9954db=_0x9c64[_0x9757a9];return _0x9954db;};'use strict';var _=require(_0x49c6('0x0'));var util=require(_0x49c6('0x1'));var logger=require(_0x49c6('0x2'))(_0x49c6('0x3'));var moment=require(_0x49c6('0x4'));var BPromise=require(_0x49c6('0x5'));var rp=require(_0x49c6('0x6'));var fs=require('fs');var path=require(_0x49c6('0x7'));var rimraf=require(_0x49c6('0x8'));var config=require(_0x49c6('0x9'));var attributes=require(_0x49c6('0xa'));module[_0x49c6('0xb')]=function(_0x473d18,_0xf2a725){return _0x473d18[_0x49c6('0xc')](_0x49c6('0xd'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 6a3bf67..c87d0a4 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 _0x3c66=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','SquareDetailsReport','options','CreateSquareDetailsReport','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x3c66,0x8b));var _0x63c6=function(_0x4f73a0,_0xad6e0a){_0x4f73a0=_0x4f73a0-0x0;var _0x1dab98=_0x3c66[_0x4f73a0];return _0x1dab98;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x63c6('0x0'));var rs=require(_0x63c6('0x1'));var fs=require('fs');var Redis=require(_0x63c6('0x2'));var db=require(_0x63c6('0x3'))['db'];var utils=require(_0x63c6('0x4'));var logger=require(_0x63c6('0x5'))(_0x63c6('0x6'));var config=require(_0x63c6('0x7'));var jayson=require(_0x63c6('0x8'));var client=jayson[_0x63c6('0x9')][_0x63c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b33e8,_0x47b438,_0x232099){return new BPromise(function(_0x50ff5c,_0x44e826){return client[_0x63c6('0xb')](_0x2b33e8,_0x232099)['then'](function(_0x386110){logger[_0x63c6('0xc')](_0x63c6('0xd'),_0x47b438,_0x63c6('0xe'));logger[_0x63c6('0xf')](_0x63c6('0x10'),_0x47b438,'request\x20sent',JSON[_0x63c6('0x11')](_0x386110));if(_0x386110[_0x63c6('0x12')]){if(_0x386110[_0x63c6('0x12')]['code']===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x47b438,_0x386110['error']['message']);return _0x44e826(_0x386110['error'][_0x63c6('0x13')]);}logger[_0x63c6('0x12')](_0x63c6('0xd'),_0x47b438,_0x386110[_0x63c6('0x12')][_0x63c6('0x13')]);return _0x50ff5c(_0x386110['error'][_0x63c6('0x13')]);}else{logger[_0x63c6('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x47b438,_0x63c6('0xe'));_0x50ff5c(_0x386110['result']['message']);}})[_0x63c6('0x14')](function(_0x571022){logger[_0x63c6('0x12')](_0x63c6('0xd'),_0x47b438,_0x571022);_0x44e826(_0x571022);});});}exports['CreateSquareDetailsReport']=function(_0xd5a3b5){var _0x2bbda5=this;return new Promise(function(_0x377f6e,_0x35ee57){return db[_0x63c6('0x15')]['create'](_0xd5a3b5['body'],{'raw':_0xd5a3b5['options']?_0xd5a3b5[_0x63c6('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xb7ba4f){logger[_0x63c6('0xc')]('CreateSquareDetailsReport',_0xd5a3b5);logger[_0x63c6('0xf')](_0x63c6('0x17'),_0xd5a3b5,JSON[_0x63c6('0x11')](_0xb7ba4f));_0x377f6e(_0xb7ba4f);})[_0x63c6('0x14')](function(_0x430a6e){logger['error'](_0x63c6('0x17'),_0x430a6e[_0x63c6('0x13')],_0xd5a3b5);_0x35ee57(_0x2bbda5[_0x63c6('0x12')](0x1f4,_0x430a6e[_0x63c6('0x13')]));});});}; \ No newline at end of file +var _0xd824=['stringify','error','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','debug','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s'];(function(_0x463165,_0x4d8ea3){var _0x5e0360=function(_0x4128f6){while(--_0x4128f6){_0x463165['push'](_0x463165['shift']());}};_0x5e0360(++_0x4d8ea3);}(_0xd824,0xc2));var _0x4d82=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd824[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b842f,_0x464caf,_0xb54db2){return new BPromise(function(_0x13d624,_0x5cccb6){return client[_0x4d82('0x9')](_0x4b842f,_0xb54db2)['then'](function(_0x5356cd){logger[_0x4d82('0xa')](_0x4d82('0xb'),_0x464caf,_0x4d82('0xc'));logger['debug'](_0x4d82('0xd'),_0x464caf,'request\x20sent',JSON[_0x4d82('0xe')](_0x5356cd));if(_0x5356cd[_0x4d82('0xf')]){if(_0x5356cd[_0x4d82('0xf')]['code']===0x1f4){logger['error'](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')][_0x4d82('0x10')]);return _0x5cccb6(_0x5356cd[_0x4d82('0xf')]['message']);}logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')]['message']);return _0x13d624(_0x5356cd[_0x4d82('0xf')]['message']);}else{logger[_0x4d82('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x464caf,_0x4d82('0xc'));_0x13d624(_0x5356cd['result'][_0x4d82('0x10')]);}})[_0x4d82('0x11')](function(_0x461476){logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x461476);_0x5cccb6(_0x461476);});});}exports[_0x4d82('0x12')]=function(_0x258c59){var _0x217b72=this;return new Promise(function(_0x2f2127,_0x5ef783){return db[_0x4d82('0x13')][_0x4d82('0x14')](_0x258c59[_0x4d82('0x15')],{'raw':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')][_0x4d82('0x17')]===undefined?!![]:![]:!![]})[_0x4d82('0x18')](function(_0x64669c){logger[_0x4d82('0xa')](_0x4d82('0x12'),_0x258c59);logger[_0x4d82('0x19')]('CreateSquareDetailsReport',_0x258c59,JSON[_0x4d82('0xe')](_0x64669c));_0x2f2127(_0x64669c);})[_0x4d82('0x11')](function(_0x5e5bdf){logger[_0x4d82('0xf')](_0x4d82('0x12'),_0x5e5bdf[_0x4d82('0x10')],_0x258c59);_0x5ef783(_0x217b72[_0x4d82('0xf')](0x1f4,_0x5e5bdf[_0x4d82('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 6cf8b34..751f21c 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 _0x1783=['/process/:pid/kill','killProcess','../../components/auth/service','./system.controller','get','isAuthenticated','index'];(function(_0x5d4db8,_0x4ad01b){var _0x415548=function(_0x7ae456){while(--_0x7ae456){_0x5d4db8['push'](_0x5d4db8['shift']());}};_0x415548(++_0x4ad01b);}(_0x1783,0x1e5));var _0x3178=function(_0x32ed80,_0x3db315){_0x32ed80=_0x32ed80-0x0;var _0x212659=_0x1783[_0x32ed80];return _0x212659;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x3178('0x0'));var controller=require(_0x3178('0x1'));router[_0x3178('0x2')]('/',auth[_0x3178('0x3')](),controller[_0x3178('0x4')]);router[_0x3178('0x2')](_0x3178('0x5'),auth[_0x3178('0x3')](),controller[_0x3178('0x6')]);module['exports']=router; \ No newline at end of file +var _0x60aa=['exports','express','Router','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x328b40,_0x370642){var _0x556a56=function(_0x467553){while(--_0x467553){_0x328b40['push'](_0x328b40['shift']());}};_0x556a56(++_0x370642);}(_0x60aa,0x127));var _0xa60a=function(_0x1f6fd5,_0x399cb0){_0x1f6fd5=_0x1f6fd5-0x0;var _0x587d12=_0x60aa[_0x1f6fd5];return _0x587d12;};'use strict';var express=require(_0xa60a('0x0'));var router=express[_0xa60a('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0xa60a('0x2')]('/',auth[_0xa60a('0x3')](),controller[_0xa60a('0x4')]);router['get'](_0xa60a('0x5'),auth[_0xa60a('0x3')](),controller['killProcess']);module[_0xa60a('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 43705a9..9fb0c83 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 _0x46a8=['killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','../../config/logger','api','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','getAllData','then','status','json','catch'];(function(_0x555fe1,_0x250dad){var _0x32e425=function(_0x5bcd77){while(--_0x5bcd77){_0x555fe1['push'](_0x555fe1['shift']());}};_0x32e425(++_0x250dad);}(_0x46a8,0x185));var _0x846a=function(_0xb43e9f,_0x378aa4){_0xb43e9f=_0xb43e9f-0x0;var _0x52cd95=_0x46a8[_0xb43e9f];return _0x52cd95;};'use strict';var info=require('systeminformation');var exec=require(_0x846a('0x0'))[_0x846a('0x1')];var logger=require(_0x846a('0x2'))(_0x846a('0x3'));var util=require('util');var BPromise=require('bluebird');var _=require(_0x846a('0x4'));function handleError(_0x112404,_0x9e5358,_0x58666a){_0x9e5358=_0x9e5358||0x1f4;return function(_0x9f9ac8){logger[_0x846a('0x5')](_0x846a('0x6'),_0x58666a,_0x9e5358,util[_0x846a('0x7')](_0x9f9ac8,{'showHidden':![],'depth':null}));delete _0x9f9ac8[_0x846a('0x8')];_0x112404['status'](_0x9e5358)[_0x846a('0x9')](_0x9f9ac8);};}exports[_0x846a('0xa')]=function(_0x629c3b,_0x3bfd1e){return info[_0x846a('0xb')]()[_0x846a('0xc')](function(_0x3e432f){return _0x3bfd1e[_0x846a('0xd')](0xc8)[_0x846a('0xe')](_0x3e432f);})[_0x846a('0xf')](function(_0x23cc20){return _0x3bfd1e[_0x846a('0xd')](0x1f4)['json'](_0x23cc20);});};exports[_0x846a('0x10')]=function(_0x4f1dfd,_0x37aafa){var _0x475dce=['components/import/cm'];return new BPromise(function(_0x18b691,_0x106d2d){return exec(util['format'](_0x846a('0x11'),_0x4f1dfd[_0x846a('0x12')]['pid']),function(_0x56dfd2,_0x403ec4,_0x14da48){if(_0x56dfd2){return _0x106d2d(_0x56dfd2);}return _0x18b691(_0x403ec4);});})['then'](function(_0x2d806d){var _0x4f406e=![];var _0x5113f0=_0x2d806d[_0x846a('0x13')](/\n/);for(var _0x405ba7=0x0,_0x2085c8=_0x475dce[_0x846a('0x14')];_0x405ba7<_0x2085c8,_0x4f406e===![];_0x405ba7+=0x1){if(_0x2d806d[_0x846a('0x15')](_0x475dce[_0x405ba7])>=0x0){_0x4f406e=!![];}}if(!_0x4f406e){throw new Error(util[_0x846a('0x16')](_0x846a('0x17'),_0x4f1dfd['params'][_0x846a('0x18')]));}process[_0x846a('0x19')](_0x4f1dfd[_0x846a('0x12')][_0x846a('0x18')],'SIGINT');return _0x37aafa[_0x846a('0xd')](0xc8)['json']({'message':util[_0x846a('0x16')](_0x846a('0x1a'),_0x4f1dfd['params'][_0x846a('0x18')])});})[_0x846a('0xf')](handleError(_0x37aafa,null,_0x846a('0x10')));}; \ No newline at end of file +var _0x909f=['api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','killProcess','child_process','../../config/logger'];(function(_0x44a70e,_0x23ecc0){var _0x24eb99=function(_0x5ebdd1){while(--_0x5ebdd1){_0x44a70e['push'](_0x44a70e['shift']());}};_0x24eb99(++_0x23ecc0);}(_0x909f,0xbb));var _0xf909=function(_0x4a7a2f,_0x10b409){_0x4a7a2f=_0x4a7a2f-0x0;var _0x59dc11=_0x909f[_0x4a7a2f];return _0x59dc11;};'use strict';var info=require('systeminformation');var exec=require(_0xf909('0x0'))['exec'];var logger=require(_0xf909('0x1'))(_0xf909('0x2'));var util=require(_0xf909('0x3'));var BPromise=require(_0xf909('0x4'));var _=require(_0xf909('0x5'));function handleError(_0x37f9d1,_0x5cda5f,_0x377e30){_0x5cda5f=_0x5cda5f||0x1f4;return function(_0xb34bb6){logger[_0xf909('0x6')](_0xf909('0x7'),_0x377e30,_0x5cda5f,util[_0xf909('0x8')](_0xb34bb6,{'showHidden':![],'depth':null}));delete _0xb34bb6[_0xf909('0x9')];_0x37f9d1[_0xf909('0xa')](_0x5cda5f)[_0xf909('0xb')](_0xb34bb6);};}exports[_0xf909('0xc')]=function(_0x4b5a8a,_0x3f0863){return info[_0xf909('0xd')]()[_0xf909('0xe')](function(_0x3f8183){return _0x3f0863['status'](0xc8)[_0xf909('0xf')](_0x3f8183);})['catch'](function(_0x532d1f){return _0x3f0863[_0xf909('0xa')](0x1f4)[_0xf909('0xf')](_0x532d1f);});};exports['killProcess']=function(_0x16739b,_0x1334f8){var _0x22e3df=[_0xf909('0x10')];return new BPromise(function(_0x25d02e,_0x15480e){return exec(util[_0xf909('0x11')](_0xf909('0x12'),_0x16739b['params'][_0xf909('0x13')]),function(_0x1acecd,_0x3a0ce7,_0x8c402d){if(_0x1acecd){return _0x15480e(_0x1acecd);}return _0x25d02e(_0x3a0ce7);});})['then'](function(_0x21c66e){var _0x48f0ee=![];var _0x42ed6f=_0x21c66e['split'](/\n/);for(var _0x406e17=0x0,_0x307555=_0x22e3df['length'];_0x406e17<_0x307555,_0x48f0ee===![];_0x406e17+=0x1){if(_0x21c66e[_0xf909('0x14')](_0x22e3df[_0x406e17])>=0x0){_0x48f0ee=!![];}}if(!_0x48f0ee){throw new Error(util[_0xf909('0x11')](_0xf909('0x15'),_0x16739b[_0xf909('0x16')][_0xf909('0x13')]));}process[_0xf909('0x17')](_0x16739b[_0xf909('0x16')]['pid'],'SIGINT');return _0x1334f8[_0xf909('0xa')](0xc8)[_0xf909('0xf')]({'message':util[_0xf909('0x11')](_0xf909('0x18'),_0x16739b['params'][_0xf909('0x13')])});})[_0xf909('0x19')](handleError(_0x1334f8,null,_0xf909('0x1a')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 6d57d90..0795df4 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 _0x55e6=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','/:id','create','update','exports','multer','util'];(function(_0x2c230c,_0x2f28fa){var _0x2cabd6=function(_0x5437c7){while(--_0x5437c7){_0x2c230c['push'](_0x2c230c['shift']());}};_0x2cabd6(++_0x2f28fa);}(_0x55e6,0xca));var _0x655e=function(_0x1513c8,_0x3d4567){_0x1513c8=_0x1513c8-0x0;var _0x30ca27=_0x55e6[_0x1513c8];return _0x30ca27;};'use strict';var multer=require(_0x655e('0x0'));var util=require(_0x655e('0x1'));var path=require(_0x655e('0x2'));var timeout=require(_0x655e('0x3'));var express=require(_0x655e('0x4'));var router=express[_0x655e('0x5')]();var fs_extra=require(_0x655e('0x6'));var auth=require(_0x655e('0x7'));var interaction=require(_0x655e('0x8'));var config=require(_0x655e('0x9'));var controller=require(_0x655e('0xa'));router['get']('/',auth[_0x655e('0xb')](),controller[_0x655e('0xc')]);router['get'](_0x655e('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x655e('0xe')]);router['put']('/:id',auth[_0x655e('0xb')](),controller[_0x655e('0xf')]);router['delete']('/:id',auth[_0x655e('0xb')](),controller['destroy']);module[_0x655e('0x10')]=router; \ No newline at end of file +var _0x22a7=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','get','show','post','create','/:id','update','delete','destroy','multer','util','path'];(function(_0x56e32e,_0x9eb2f6){var _0x2a757b=function(_0x50b7bc){while(--_0x50b7bc){_0x56e32e['push'](_0x56e32e['shift']());}};_0x2a757b(++_0x9eb2f6);}(_0x22a7,0xe4));var _0x722a=function(_0x102da0,_0x539e28){_0x102da0=_0x102da0-0x0;var _0x41361c=_0x22a7[_0x102da0];return _0x41361c;};'use strict';var multer=require(_0x722a('0x0'));var util=require(_0x722a('0x1'));var path=require(_0x722a('0x2'));var timeout=require(_0x722a('0x3'));var express=require(_0x722a('0x4'));var router=express[_0x722a('0x5')]();var fs_extra=require(_0x722a('0x6'));var auth=require(_0x722a('0x7'));var interaction=require(_0x722a('0x8'));var config=require(_0x722a('0x9'));var controller=require(_0x722a('0xa'));router['get']('/',auth[_0x722a('0xb')](),controller[_0x722a('0xc')]);router[_0x722a('0xd')]('/:id',auth[_0x722a('0xb')](),controller[_0x722a('0xe')]);router[_0x722a('0xf')]('/',auth[_0x722a('0xb')](),controller[_0x722a('0x10')]);router['put'](_0x722a('0x11'),auth[_0x722a('0xb')](),controller[_0x722a('0x12')]);router[_0x722a('0x13')](_0x722a('0x11'),auth[_0x722a('0xb')](),controller[_0x722a('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index f121790..ee217fa 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 _0x85ed=['name','#0091EA','sequelize','exports','STRING'];(function(_0x4b3bfd,_0xd3a424){var _0x5d2fca=function(_0x3918ca){while(--_0x3918ca){_0x4b3bfd['push'](_0x4b3bfd['shift']());}};_0x5d2fca(++_0xd3a424);}(_0x85ed,0x66));var _0xd85e=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0x85ed[_0x2e04ef];return _0x5722b0;};'use strict';var Sequelize=require(_0xd85e('0x0'));module[_0xd85e('0x1')]={'name':{'type':Sequelize[_0xd85e('0x2')],'unique':_0xd85e('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xd85e('0x2')],'defaultValue':_0xd85e('0x4')},'description':{'type':Sequelize[_0xd85e('0x2')]}}; \ No newline at end of file +var _0x2b4f=['STRING','#0091EA','exports','name'];(function(_0x438513,_0x472928){var _0x14943a=function(_0x48492e){while(--_0x48492e){_0x438513['push'](_0x438513['shift']());}};_0x14943a(++_0x472928);}(_0x2b4f,0x142));var _0xf2b4=function(_0x49b643,_0x27de1f){_0x49b643=_0x49b643-0x0;var _0x46c7d5=_0x2b4f[_0x49b643];return _0x46c7d5;};'use strict';var Sequelize=require('sequelize');module[_0xf2b4('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf2b4('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf2b4('0x2')],'defaultValue':_0xf2b4('0x3')},'description':{'type':Sequelize[_0xf2b4('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 44d35a1..cf5d84c 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 _0xf290=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','get','Tags','UserProfileResource','error','stack','name','send','map','key','keys','query','filters','intersection','model','attributes','fields','length','sort','where','filter','merge','type','VIRTUAL','options','Tag','includeAll','include','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0xdd2303,_0x259706){var _0x14f4fb=function(_0x64ad61){while(--_0x64ad61){_0xdd2303['push'](_0xdd2303['shift']());}};_0x14f4fb(++_0x259706);}(_0xf290,0xde));var _0x0f29=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xf290[_0x403c20];return _0x2b271a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f29('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f29('0x1'));var rp=require('request-promise');var moment=require(_0x0f29('0x2'));var BPromise=require(_0x0f29('0x3'));var Mustache=require(_0x0f29('0x4'));var util=require(_0x0f29('0x5'));var path=require(_0x0f29('0x6'));var sox=require('sox');var csv=require(_0x0f29('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f29('0x8'));var _=require(_0x0f29('0x9'));var squel=require(_0x0f29('0xa'));var crypto=require(_0x0f29('0xb'));var jsforce=require(_0x0f29('0xc'));var deskjs=require(_0x0f29('0xd'));var toCsv=require(_0x0f29('0x7'));var querystring=require(_0x0f29('0xe'));var Papa=require(_0x0f29('0xf'));var Redis=require(_0x0f29('0x10'));var authService=require(_0x0f29('0x11'));var qs=require(_0x0f29('0x12'));var as=require(_0x0f29('0x13'));var hardwareService=require(_0x0f29('0x14'));var logger=require(_0x0f29('0x15'))('api');var utils=require(_0x0f29('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0f29('0x17'));var db=require(_0x0f29('0x18'))['db'];function respondWithStatusCode(_0x26bbec,_0x222c42){_0x222c42=_0x222c42||0xcc;return function(_0x195424){if(_0x195424){return _0x26bbec[_0x0f29('0x19')](_0x222c42);}return _0x26bbec['status'](_0x222c42)[_0x0f29('0x1a')]();};}function respondWithResult(_0x39961f,_0x2bb7b8){_0x2bb7b8=_0x2bb7b8||0xc8;return function(_0x368984){if(_0x368984){return _0x39961f[_0x0f29('0x1b')](_0x2bb7b8)[_0x0f29('0x1c')](_0x368984);}};}function respondWithFilteredResult(_0x1c518,_0x69df36){return function(_0x547404){if(_0x547404){var _0x4ac37d=typeof _0x69df36[_0x0f29('0x1d')]===_0x0f29('0x1e')&&typeof _0x69df36[_0x0f29('0x1f')]===_0x0f29('0x1e');var _0x4b3f0b=_0x547404[_0x0f29('0x20')];var _0x5d72a5=_0x4ac37d?0x0:_0x69df36[_0x0f29('0x1d')];var _0x4ca5e8=_0x4ac37d?_0x547404['count']:_0x69df36['offset']+_0x69df36[_0x0f29('0x1f')];var _0x8fc03f;if(_0x4ca5e8>=_0x4b3f0b){_0x4ca5e8=_0x4b3f0b;_0x8fc03f=0xc8;}else{_0x8fc03f=0xce;}_0x1c518[_0x0f29('0x1b')](_0x8fc03f);return _0x1c518[_0x0f29('0x21')](_0x0f29('0x22'),_0x5d72a5+'-'+_0x4ca5e8+'/'+_0x4b3f0b)[_0x0f29('0x1c')](_0x547404);}return null;};}function patchUpdates(_0x150271){return function(_0x4888b6){try{jsonpatch[_0x0f29('0x23')](_0x4888b6,_0x150271,!![]);}catch(_0x5a5a03){return BPromise['reject'](_0x5a5a03);}return _0x4888b6['save']();};}function saveUpdates(_0x5d94b9,_0x38a1ce){return function(_0x4a9dd8){if(_0x4a9dd8){return _0x4a9dd8['update'](_0x5d94b9)[_0x0f29('0x24')](function(_0x1840e0){return _0x1840e0;});}return null;};}function removeEntity(_0x346db8,_0x3402dc){return function(_0x29ca73){if(_0x29ca73){return _0x29ca73['destroy']()[_0x0f29('0x24')](function(){var _0x5a440f=_0x29ca73[_0x0f29('0x25')]({'plain':!![]});var _0x26f46f=_0x0f29('0x26');return db[_0x0f29('0x27')]['destroy']({'where':{'type':_0x26f46f,'resourceId':_0x5a440f['id']}})[_0x0f29('0x24')](function(){return _0x29ca73;});})['then'](function(){_0x346db8['status'](0xcc)[_0x0f29('0x1a')]();});}};}function handleEntityNotFound(_0x5c0202,_0x5bfcac){return function(_0x57dcc7){if(!_0x57dcc7){_0x5c0202['sendStatus'](0x194);}return _0x57dcc7;};}function handleError(_0x3c6ce9,_0x1f4ad2){_0x1f4ad2=_0x1f4ad2||0x1f4;return function(_0x4cc5a0){logger[_0x0f29('0x28')](_0x4cc5a0[_0x0f29('0x29')]);if(_0x4cc5a0[_0x0f29('0x2a')]){delete _0x4cc5a0['name'];}_0x3c6ce9['status'](_0x1f4ad2)[_0x0f29('0x2b')](_0x4cc5a0);};}exports['index']=function(_0x36b65c,_0x561c31){var _0x526364={},_0x7b10f={},_0x409b19={'count':0x0,'rows':[]};var _0xf59431=_[_0x0f29('0x2c')](db['Tag']['rawAttributes'],function(_0x3bb3c8){return{'name':_0x3bb3c8['fieldName'],'type':_0x3bb3c8['type'][_0x0f29('0x2d')]};});_0x7b10f['model']=_[_0x0f29('0x2c')](_0xf59431,'name');_0x7b10f['query']=_[_0x0f29('0x2e')](_0x36b65c[_0x0f29('0x2f')]);_0x7b10f[_0x0f29('0x30')]=_[_0x0f29('0x31')](_0x7b10f[_0x0f29('0x32')],_0x7b10f['query']);_0x526364[_0x0f29('0x33')]=_['intersection'](_0x7b10f[_0x0f29('0x32')],qs[_0x0f29('0x34')](_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x34')]));_0x526364['attributes']=_0x526364[_0x0f29('0x33')][_0x0f29('0x35')]?_0x526364['attributes']:_0x7b10f[_0x0f29('0x32')];if(!_0x36b65c[_0x0f29('0x2f')]['hasOwnProperty']('nolimit')){_0x526364[_0x0f29('0x1f')]=qs[_0x0f29('0x1f')](_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x1f')]);_0x526364[_0x0f29('0x1d')]=qs[_0x0f29('0x1d')](_0x36b65c['query'][_0x0f29('0x1d')]);}_0x526364['order']=qs[_0x0f29('0x36')](_0x36b65c['query'][_0x0f29('0x36')]);_0x526364[_0x0f29('0x37')]=qs[_0x0f29('0x30')](_['pick'](_0x36b65c['query'],_0x7b10f[_0x0f29('0x30')]),_0xf59431);if(_0x36b65c['query'][_0x0f29('0x38')]){_0x526364[_0x0f29('0x37')]=_[_0x0f29('0x39')](_0x526364[_0x0f29('0x37')],{'$or':_[_0x0f29('0x2c')](_0xf59431,function(_0x5afbb8){if(_0x5afbb8[_0x0f29('0x3a')]!==_0x0f29('0x3b')){var _0x42872b={};_0x42872b[_0x5afbb8[_0x0f29('0x2a')]]={'$like':'%'+_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x38')]+'%'};return _0x42872b;}})});}_0x526364=_[_0x0f29('0x39')]({},_0x526364,_0x36b65c[_0x0f29('0x3c')]);var _0x250b20={'where':_0x526364['where']};return db[_0x0f29('0x3d')][_0x0f29('0x20')](_0x250b20)[_0x0f29('0x24')](function(_0x11b1dc){_0x409b19['count']=_0x11b1dc;if(_0x36b65c[_0x0f29('0x2f')][_0x0f29('0x3e')]){_0x526364[_0x0f29('0x3f')]=[{'all':!![]}];}return db[_0x0f29('0x3d')][_0x0f29('0x40')](_0x526364);})['then'](function(_0x410c59){_0x409b19[_0x0f29('0x41')]=_0x410c59;return _0x409b19;})[_0x0f29('0x24')](respondWithFilteredResult(_0x561c31,_0x526364))['catch'](handleError(_0x561c31,null));};exports[_0x0f29('0x42')]=function(_0x284279,_0x3a6479){var _0x338412={'raw':!![],'where':{'id':_0x284279[_0x0f29('0x43')]['id']}},_0x35f753={};_0x35f753[_0x0f29('0x32')]=_[_0x0f29('0x2e')](db['Tag']['rawAttributes']);_0x35f753['query']=_[_0x0f29('0x2e')](_0x284279[_0x0f29('0x2f')]);_0x35f753[_0x0f29('0x30')]=_[_0x0f29('0x31')](_0x35f753[_0x0f29('0x32')],_0x35f753[_0x0f29('0x2f')]);_0x338412['attributes']=_[_0x0f29('0x31')](_0x35f753['model'],qs[_0x0f29('0x34')](_0x284279['query'][_0x0f29('0x34')]));_0x338412[_0x0f29('0x33')]=_0x338412[_0x0f29('0x33')][_0x0f29('0x35')]?_0x338412[_0x0f29('0x33')]:_0x35f753['model'];if(_0x284279[_0x0f29('0x2f')][_0x0f29('0x3e')]){_0x338412[_0x0f29('0x3f')]=[{'all':!![]}];}_0x338412=_['merge']({},_0x338412,_0x284279[_0x0f29('0x3c')]);return db['Tag']['find'](_0x338412)[_0x0f29('0x24')](handleEntityNotFound(_0x3a6479,null))[_0x0f29('0x24')](respondWithResult(_0x3a6479,null))[_0x0f29('0x44')](handleError(_0x3a6479,null));};exports[_0x0f29('0x45')]=function(_0x20aa53,_0x335435){return db['Tag'][_0x0f29('0x45')](_0x20aa53[_0x0f29('0x46')],{})[_0x0f29('0x24')](function(_0x857564){var _0x2455d2=_0x20aa53[_0x0f29('0x47')][_0x0f29('0x25')]({'plain':!![]});if(!_0x2455d2)throw new Error(_0x0f29('0x48'));if(_0x2455d2[_0x0f29('0x49')]===_0x0f29('0x47')){var _0x5cd4a9=_0x857564['get']({'plain':!![]});var _0xa6231e=_0x0f29('0x26');return db[_0x0f29('0x4a')][_0x0f29('0x4b')]({'where':{'name':_0xa6231e,'userProfileId':_0x2455d2['userProfileId']},'raw':!![]})[_0x0f29('0x24')](function(_0xd624ad){if(_0xd624ad&&_0xd624ad[_0x0f29('0x4c')]===0x0){return db[_0x0f29('0x27')][_0x0f29('0x45')]({'name':_0x5cd4a9[_0x0f29('0x2a')],'resourceId':_0x5cd4a9['id'],'type':_0xd624ad[_0x0f29('0x2a')],'sectionId':_0xd624ad['id']},{})['then'](function(){return _0x857564;});}else{return _0x857564;}})[_0x0f29('0x44')](function(_0x6c1800){logger[_0x0f29('0x28')](_0x0f29('0x4d'),_0x6c1800);throw _0x6c1800;});}return _0x857564;})[_0x0f29('0x24')](respondWithResult(_0x335435,0xc9))[_0x0f29('0x44')](handleError(_0x335435,null));};exports['update']=function(_0x8c9780,_0x45d87c){if(_0x8c9780[_0x0f29('0x46')]['id']){delete _0x8c9780['body']['id'];}return db[_0x0f29('0x3d')]['find']({'where':{'id':_0x8c9780[_0x0f29('0x43')]['id']}})['then'](handleEntityNotFound(_0x45d87c,null))[_0x0f29('0x24')](saveUpdates(_0x8c9780[_0x0f29('0x46')],null))['then'](respondWithResult(_0x45d87c,null))[_0x0f29('0x44')](handleError(_0x45d87c,null));};exports[_0x0f29('0x4e')]=function(_0x4ae30,_0x4a2c08){return db[_0x0f29('0x3d')]['find']({'where':{'id':_0x4ae30[_0x0f29('0x43')]['id']}})[_0x0f29('0x24')](handleEntityNotFound(_0x4a2c08,null))['then'](removeEntity(_0x4a2c08,null))[_0x0f29('0x44')](handleError(_0x4a2c08,null));}; \ No newline at end of file +var _0xbec5=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','name','send','index','map','Tag','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','sort','pick','filter','where','options','includeAll','include','catch','show','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0xd6a8fd,_0x492504){var _0x427dca=function(_0x4fabe3){while(--_0x4fabe3){_0xd6a8fd['push'](_0xd6a8fd['shift']());}};_0x427dca(++_0x492504);}(_0xbec5,0xe5));var _0x5bec=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xbec5[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];function respondWithStatusCode(_0x1c888f,_0x589d14){_0x589d14=_0x589d14||0xcc;return function(_0x2d2ba2){if(_0x2d2ba2){return _0x1c888f[_0x5bec('0x19')](_0x589d14);}return _0x1c888f[_0x5bec('0x1a')](_0x589d14)[_0x5bec('0x1b')]();};}function respondWithResult(_0x3198e0,_0xcd6d90){_0xcd6d90=_0xcd6d90||0xc8;return function(_0x24dcd6){if(_0x24dcd6){return _0x3198e0[_0x5bec('0x1a')](_0xcd6d90)[_0x5bec('0x1c')](_0x24dcd6);}};}function respondWithFilteredResult(_0x3ebc41,_0x31b9e4){return function(_0x325daf){if(_0x325daf){var _0x11fb8e=typeof _0x31b9e4['offset']==='undefined'&&typeof _0x31b9e4[_0x5bec('0x1d')]===_0x5bec('0x1e');var _0x31ad9c=_0x325daf[_0x5bec('0x1f')];var _0x5cd7ae=_0x11fb8e?0x0:_0x31b9e4['offset'];var _0x3cd354=_0x11fb8e?_0x325daf[_0x5bec('0x1f')]:_0x31b9e4['offset']+_0x31b9e4[_0x5bec('0x1d')];var _0xa7e223;if(_0x3cd354>=_0x31ad9c){_0x3cd354=_0x31ad9c;_0xa7e223=0xc8;}else{_0xa7e223=0xce;}_0x3ebc41[_0x5bec('0x1a')](_0xa7e223);return _0x3ebc41[_0x5bec('0x20')]('Content-Range',_0x5cd7ae+'-'+_0x3cd354+'/'+_0x31ad9c)[_0x5bec('0x1c')](_0x325daf);}return null;};}function patchUpdates(_0x5be91c){return function(_0x191c0f){try{jsonpatch[_0x5bec('0x21')](_0x191c0f,_0x5be91c,!![]);}catch(_0x3e1896){return BPromise[_0x5bec('0x22')](_0x3e1896);}return _0x191c0f[_0x5bec('0x23')]();};}function saveUpdates(_0x5e154e,_0x232584){return function(_0x4cfcb8){if(_0x4cfcb8){return _0x4cfcb8[_0x5bec('0x24')](_0x5e154e)[_0x5bec('0x25')](function(_0x5b2636){return _0x5b2636;});}return null;};}function removeEntity(_0xa414f8,_0xbef70b){return function(_0x4e0ca2){if(_0x4e0ca2){return _0x4e0ca2[_0x5bec('0x26')]()[_0x5bec('0x25')](function(){var _0x43d460=_0x4e0ca2[_0x5bec('0x27')]({'plain':!![]});var _0x226d55=_0x5bec('0x28');return db[_0x5bec('0x29')]['destroy']({'where':{'type':_0x226d55,'resourceId':_0x43d460['id']}})['then'](function(){return _0x4e0ca2;});})['then'](function(){_0xa414f8[_0x5bec('0x1a')](0xcc)[_0x5bec('0x1b')]();});}};}function handleEntityNotFound(_0x338c25,_0x4939a5){return function(_0x2b3b2c){if(!_0x2b3b2c){_0x338c25[_0x5bec('0x19')](0x194);}return _0x2b3b2c;};}function handleError(_0x57331b,_0x29e358){_0x29e358=_0x29e358||0x1f4;return function(_0x63ac8){logger['error'](_0x63ac8['stack']);if(_0x63ac8[_0x5bec('0x2a')]){delete _0x63ac8[_0x5bec('0x2a')];}_0x57331b[_0x5bec('0x1a')](_0x29e358)[_0x5bec('0x2b')](_0x63ac8);};}exports[_0x5bec('0x2c')]=function(_0x3f224c,_0x5d6621){var _0x2987ca={},_0x59b5b6={},_0x45863b={'count':0x0,'rows':[]};var _0xafbd94=_[_0x5bec('0x2d')](db[_0x5bec('0x2e')]['rawAttributes'],function(_0x2b42c8){return{'name':_0x2b42c8[_0x5bec('0x2f')],'type':_0x2b42c8[_0x5bec('0x30')]['key']};});_0x59b5b6[_0x5bec('0x31')]=_['map'](_0xafbd94,_0x5bec('0x2a'));_0x59b5b6[_0x5bec('0x32')]=_[_0x5bec('0x33')](_0x3f224c['query']);_0x59b5b6[_0x5bec('0x34')]=_[_0x5bec('0x35')](_0x59b5b6['model'],_0x59b5b6[_0x5bec('0x32')]);_0x2987ca[_0x5bec('0x36')]=_[_0x5bec('0x35')](_0x59b5b6[_0x5bec('0x31')],qs[_0x5bec('0x37')](_0x3f224c['query'][_0x5bec('0x37')]));_0x2987ca['attributes']=_0x2987ca[_0x5bec('0x36')][_0x5bec('0x38')]?_0x2987ca[_0x5bec('0x36')]:_0x59b5b6[_0x5bec('0x31')];if(!_0x3f224c[_0x5bec('0x32')][_0x5bec('0x39')]('nolimit')){_0x2987ca[_0x5bec('0x1d')]=qs[_0x5bec('0x1d')](_0x3f224c[_0x5bec('0x32')]['limit']);_0x2987ca[_0x5bec('0x3a')]=qs[_0x5bec('0x3a')](_0x3f224c['query'][_0x5bec('0x3a')]);}_0x2987ca['order']=qs[_0x5bec('0x3b')](_0x3f224c[_0x5bec('0x32')][_0x5bec('0x3b')]);_0x2987ca['where']=qs[_0x5bec('0x34')](_[_0x5bec('0x3c')](_0x3f224c[_0x5bec('0x32')],_0x59b5b6[_0x5bec('0x34')]),_0xafbd94);if(_0x3f224c[_0x5bec('0x32')][_0x5bec('0x3d')]){_0x2987ca[_0x5bec('0x3e')]=_['merge'](_0x2987ca[_0x5bec('0x3e')],{'$or':_[_0x5bec('0x2d')](_0xafbd94,function(_0x323812){if(_0x323812[_0x5bec('0x30')]!=='VIRTUAL'){var _0x27863b={};_0x27863b[_0x323812[_0x5bec('0x2a')]]={'$like':'%'+_0x3f224c[_0x5bec('0x32')]['filter']+'%'};return _0x27863b;}})});}_0x2987ca=_['merge']({},_0x2987ca,_0x3f224c[_0x5bec('0x3f')]);var _0x153d02={'where':_0x2987ca[_0x5bec('0x3e')]};return db[_0x5bec('0x2e')][_0x5bec('0x1f')](_0x153d02)['then'](function(_0x4fee8a){_0x45863b[_0x5bec('0x1f')]=_0x4fee8a;if(_0x3f224c['query'][_0x5bec('0x40')]){_0x2987ca[_0x5bec('0x41')]=[{'all':!![]}];}return db[_0x5bec('0x2e')]['findAll'](_0x2987ca);})[_0x5bec('0x25')](function(_0x26a4a5){_0x45863b['rows']=_0x26a4a5;return _0x45863b;})[_0x5bec('0x25')](respondWithFilteredResult(_0x5d6621,_0x2987ca))[_0x5bec('0x42')](handleError(_0x5d6621,null));};exports[_0x5bec('0x43')]=function(_0x2b51f7,_0x3b5631){var _0x2724cf={'raw':!![],'where':{'id':_0x2b51f7['params']['id']}},_0x3a795c={};_0x3a795c['model']=_[_0x5bec('0x33')](db['Tag']['rawAttributes']);_0x3a795c[_0x5bec('0x32')]=_['keys'](_0x2b51f7['query']);_0x3a795c['filters']=_[_0x5bec('0x35')](_0x3a795c[_0x5bec('0x31')],_0x3a795c[_0x5bec('0x32')]);_0x2724cf[_0x5bec('0x36')]=_['intersection'](_0x3a795c[_0x5bec('0x31')],qs[_0x5bec('0x37')](_0x2b51f7[_0x5bec('0x32')][_0x5bec('0x37')]));_0x2724cf['attributes']=_0x2724cf[_0x5bec('0x36')][_0x5bec('0x38')]?_0x2724cf[_0x5bec('0x36')]:_0x3a795c['model'];if(_0x2b51f7[_0x5bec('0x32')]['includeAll']){_0x2724cf[_0x5bec('0x41')]=[{'all':!![]}];}_0x2724cf=_[_0x5bec('0x44')]({},_0x2724cf,_0x2b51f7[_0x5bec('0x3f')]);return db[_0x5bec('0x2e')]['find'](_0x2724cf)[_0x5bec('0x25')](handleEntityNotFound(_0x3b5631,null))[_0x5bec('0x25')](respondWithResult(_0x3b5631,null))[_0x5bec('0x42')](handleError(_0x3b5631,null));};exports[_0x5bec('0x45')]=function(_0x35b250,_0x123758){return db[_0x5bec('0x2e')]['create'](_0x35b250[_0x5bec('0x46')],{})[_0x5bec('0x25')](function(_0x5775ca){var _0x273e09=_0x35b250[_0x5bec('0x47')][_0x5bec('0x27')]({'plain':!![]});if(!_0x273e09)throw new Error(_0x5bec('0x48'));if(_0x273e09[_0x5bec('0x49')]===_0x5bec('0x47')){var _0x3545a5=_0x5775ca['get']({'plain':!![]});var _0x101dcb='Tags';return db[_0x5bec('0x4a')][_0x5bec('0x4b')]({'where':{'name':_0x101dcb,'userProfileId':_0x273e09[_0x5bec('0x4c')]},'raw':!![]})[_0x5bec('0x25')](function(_0x158e8e){if(_0x158e8e&&_0x158e8e[_0x5bec('0x4d')]===0x0){return db[_0x5bec('0x29')][_0x5bec('0x45')]({'name':_0x3545a5[_0x5bec('0x2a')],'resourceId':_0x3545a5['id'],'type':_0x158e8e[_0x5bec('0x2a')],'sectionId':_0x158e8e['id']},{})['then'](function(){return _0x5775ca;});}else{return _0x5775ca;}})[_0x5bec('0x42')](function(_0x51af88){logger['error'](_0x5bec('0x4e'),_0x51af88);throw _0x51af88;});}return _0x5775ca;})['then'](respondWithResult(_0x123758,0xc9))['catch'](handleError(_0x123758,null));};exports[_0x5bec('0x24')]=function(_0x2114e5,_0x416058){if(_0x2114e5['body']['id']){delete _0x2114e5[_0x5bec('0x46')]['id'];}return db[_0x5bec('0x2e')][_0x5bec('0x4b')]({'where':{'id':_0x2114e5[_0x5bec('0x4f')]['id']}})['then'](handleEntityNotFound(_0x416058,null))[_0x5bec('0x25')](saveUpdates(_0x2114e5[_0x5bec('0x46')],null))[_0x5bec('0x25')](respondWithResult(_0x416058,null))[_0x5bec('0x42')](handleError(_0x416058,null));};exports[_0x5bec('0x26')]=function(_0x3ddf28,_0x33b924){return db['Tag']['find']({'where':{'id':_0x3ddf28[_0x5bec('0x4f')]['id']}})['then'](handleEntityNotFound(_0x33b924,null))[_0x5bec('0x25')](removeEntity(_0x33b924,null))[_0x5bec('0x42')](handleError(_0x33b924,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index a730a22..47c8657 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 _0xa60a=['Tag','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','define'];(function(_0x2712f2,_0x32ffde){var _0x27d051=function(_0x268445){while(--_0x268445){_0x2712f2['push'](_0x2712f2['shift']());}};_0x27d051(++_0x32ffde);}(_0xa60a,0x90));var _0xaa60=function(_0x3dd6dc,_0x3b841e){_0x3dd6dc=_0x3dd6dc-0x0;var _0x31f414=_0xa60a[_0x3dd6dc];return _0x31f414;};'use strict';var _=require(_0xaa60('0x0'));var util=require(_0xaa60('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaa60('0x2'));var BPromise=require(_0xaa60('0x3'));var rp=require(_0xaa60('0x4'));var fs=require('fs');var path=require(_0xaa60('0x5'));var rimraf=require(_0xaa60('0x6'));var config=require(_0xaa60('0x7'));var attributes=require(_0xaa60('0x8'));module['exports']=function(_0x4b338e,_0x5766ee){return _0x4b338e[_0xaa60('0x9')](_0xaa60('0xa'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4b6=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./tag.attributes','define','Tag','tools_tags'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa4b6,0x150));var _0x6a4b=function(_0xd423aa,_0x4ff95f){_0xd423aa=_0xd423aa-0x0;var _0x145aab=_0xa4b6[_0xd423aa];return _0x145aab;};'use strict';var _=require(_0x6a4b('0x0'));var util=require(_0x6a4b('0x1'));var logger=require(_0x6a4b('0x2'))(_0x6a4b('0x3'));var moment=require(_0x6a4b('0x4'));var BPromise=require('bluebird');var rp=require(_0x6a4b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a4b('0x6'));var config=require(_0x6a4b('0x7'));var attributes=require(_0x6a4b('0x8'));module['exports']=function(_0x430306,_0x47bd29){return _0x430306[_0x6a4b('0x9')](_0x6a4b('0xa'),attributes,{'tableName':_0x6a4b('0xb'),'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 657c3c0..e85ea3c 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 _0xa37e=['Tag,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x1422eb,_0x2d3581){var _0x130a4b=function(_0x18d4f4){while(--_0x18d4f4){_0x1422eb['push'](_0x1422eb['shift']());}};_0x130a4b(++_0x2d3581);}(_0xa37e,0x97));var _0xea37=function(_0xaf314a,_0x21e728){_0xaf314a=_0xaf314a-0x0;var _0x537fb9=_0xa37e[_0xaf314a];return _0x537fb9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea37('0x0'));var BPromise=require(_0xea37('0x1'));var rs=require(_0xea37('0x2'));var fs=require('fs');var Redis=require(_0xea37('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xea37('0x4'));var logger=require('../../config/logger')(_0xea37('0x5'));var config=require(_0xea37('0x6'));var jayson=require(_0xea37('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36c489,_0x4a9e08,_0x4ae081){return new BPromise(function(_0x2c2890,_0x1401e1){return client[_0xea37('0x8')](_0x36c489,_0x4ae081)[_0xea37('0x9')](function(_0x5e4ebe){logger[_0xea37('0xa')](_0xea37('0xb'),_0x4a9e08,_0xea37('0xc'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x4a9e08,_0xea37('0xc'),JSON[_0xea37('0xd')](_0x5e4ebe));if(_0x5e4ebe[_0xea37('0xe')]){if(_0x5e4ebe['error'][_0xea37('0xf')]===0x1f4){logger[_0xea37('0xe')](_0xea37('0xb'),_0x4a9e08,_0x5e4ebe['error'][_0xea37('0x10')]);return _0x1401e1(_0x5e4ebe[_0xea37('0xe')]['message']);}logger[_0xea37('0xe')]('Tag,\x20%s,\x20%s',_0x4a9e08,_0x5e4ebe[_0xea37('0xe')]['message']);return _0x2c2890(_0x5e4ebe[_0xea37('0xe')][_0xea37('0x10')]);}else{logger[_0xea37('0xa')](_0xea37('0xb'),_0x4a9e08,'request\x20sent');_0x2c2890(_0x5e4ebe[_0xea37('0x11')]['message']);}})['catch'](function(_0x3ae3cc){logger['error'](_0xea37('0xb'),_0x4a9e08,_0x3ae3cc);_0x1401e1(_0x3ae3cc);});});} \ No newline at end of file +var _0x8ce3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x28d783,_0x11f116){var _0x5ef4c0=function(_0x53be5f){while(--_0x53be5f){_0x28d783['push'](_0x28d783['shift']());}};_0x5ef4c0(++_0x11f116);}(_0x8ce3,0xc3));var _0x38ce=function(_0x4e63f1,_0x34a2db){_0x4e63f1=_0x4e63f1-0x0;var _0xdbd910=_0x8ce3[_0x4e63f1];return _0xdbd910;};'use strict';var _=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var moment=require('moment');var BPromise=require(_0x38ce('0x2'));var rs=require(_0x38ce('0x3'));var fs=require('fs');var Redis=require(_0x38ce('0x4'));var db=require(_0x38ce('0x5'))['db'];var utils=require(_0x38ce('0x6'));var logger=require(_0x38ce('0x7'))(_0x38ce('0x8'));var config=require(_0x38ce('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x38ce('0xa')][_0x38ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58074c,_0x262b13,_0xbe7332){return new BPromise(function(_0x3f8011,_0x482955){return client[_0x38ce('0xc')](_0x58074c,_0xbe7332)['then'](function(_0x725d27){logger['info'](_0x38ce('0xd'),_0x262b13,_0x38ce('0xe'));logger[_0x38ce('0xf')](_0x38ce('0x10'),_0x262b13,_0x38ce('0xe'),JSON[_0x38ce('0x11')](_0x725d27));if(_0x725d27[_0x38ce('0x12')]){if(_0x725d27[_0x38ce('0x12')][_0x38ce('0x13')]===0x1f4){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);return _0x482955(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}logger[_0x38ce('0x12')]('Tag,\x20%s,\x20%s',_0x262b13,_0x725d27['error'][_0x38ce('0x14')]);return _0x3f8011(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}else{logger['info'](_0x38ce('0xd'),_0x262b13,'request\x20sent');_0x3f8011(_0x725d27[_0x38ce('0x15')][_0x38ce('0x14')]);}})['catch'](function(_0x5fc115){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x5fc115);_0x482955(_0x5fc115);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 24de591..8b2bc52 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +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(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 02fc9a2..554c365 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(_0x25a0ce,_0x1ff6fd){var _0xab8d97=function(_0x30daee){while(--_0x30daee){_0x25a0ce['push'](_0x25a0ce['shift']());}};_0xab8d97(++_0x1ff6fd);}(_0x2032,0xd9));var _0x2203=function(_0x228092,_0x28be38){_0x228092=_0x228092-0x0;var _0x4539f5=_0x2032[_0x228092];return _0x4539f5;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 31de48b..6259f3b 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 _0x98a4=['spread','removeAgents','Chat','Fax','nolimit','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./team.socket','register','sendStatus','end','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','then','error','stack','name','send','map','Team','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','show','params','length','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','sequelize','transaction','Sequelize','QueryTypes','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','destroy','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','getQueues','findOne','isValidChannel','channel','ValidationError','capitalize','Queue','toLowerCase','Queues','addQueues','Unknown\x20channel','add','ids','remove','addAgents','isArray','Voice','Mail','Sms','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','VoicePrefixId'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x98a4,0x13e));var _0x498a=function(_0x39951f,_0x42fbf9){_0x39951f=_0x39951f-0x0;var _0x44624a=_0x98a4[_0x39951f];return _0x44624a;};'use strict';var emlformat=require(_0x498a('0x0'));var rimraf=require(_0x498a('0x1'));var zipdir=require(_0x498a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x498a('0x3'));var moment=require(_0x498a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x498a('0x5'));var util=require(_0x498a('0x6'));var path=require(_0x498a('0x7'));var sox=require('sox');var csv=require(_0x498a('0x8'));var ejs=require(_0x498a('0x9'));var fs=require('fs');var fs_extra=require(_0x498a('0xa'));var _=require('lodash');var squel=require(_0x498a('0xb'));var crypto=require('crypto');var jsforce=require(_0x498a('0xc'));var deskjs=require(_0x498a('0xd'));var toCsv=require(_0x498a('0x8'));var querystring=require('querystring');var Papa=require(_0x498a('0xe'));var Redis=require(_0x498a('0xf'));var authService=require(_0x498a('0x10'));var qs=require(_0x498a('0x11'));var as=require(_0x498a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x498a('0x13'))(_0x498a('0x14'));var utils=require(_0x498a('0x15'));var config=require(_0x498a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x498a('0x17'))['db'];config['redis']=_[_0x498a('0x18')](config['redis'],{'host':_0x498a('0x19'),'port':0x18eb});var socket=require(_0x498a('0x1a'))(new Redis(config[_0x498a('0x1b')]));require(_0x498a('0x1c'))[_0x498a('0x1d')](socket);function respondWithStatusCode(_0x13a241,_0x2d311b){_0x2d311b=_0x2d311b||0xcc;return function(_0x379dc2){if(_0x379dc2){return _0x13a241[_0x498a('0x1e')](_0x2d311b);}return _0x13a241['status'](_0x2d311b)[_0x498a('0x1f')]();};}function respondWithResult(_0x470c9c,_0x6c699e){_0x6c699e=_0x6c699e||0xc8;return function(_0x58de9d){if(_0x58de9d){return _0x470c9c[_0x498a('0x20')](_0x6c699e)['json'](_0x58de9d);}};}function respondWithFilteredResult(_0x298cd1,_0x36748d){return function(_0xd30414){if(_0xd30414){var _0x2af204=typeof _0x36748d[_0x498a('0x21')]===_0x498a('0x22')&&typeof _0x36748d['limit']===_0x498a('0x22');var _0x44f59e=_0xd30414[_0x498a('0x23')];var _0x2346a8=_0x2af204?0x0:_0x36748d[_0x498a('0x21')];var _0x35fb8d=_0x2af204?_0xd30414[_0x498a('0x23')]:_0x36748d['offset']+_0x36748d[_0x498a('0x24')];var _0x58cce0;if(_0x35fb8d>=_0x44f59e){_0x35fb8d=_0x44f59e;_0x58cce0=0xc8;}else{_0x58cce0=0xce;}_0x298cd1['status'](_0x58cce0);return _0x298cd1['set'](_0x498a('0x25'),_0x2346a8+'-'+_0x35fb8d+'/'+_0x44f59e)[_0x498a('0x26')](_0xd30414);}return null;};}function patchUpdates(_0x2ecc68){return function(_0x275d1b){try{jsonpatch[_0x498a('0x27')](_0x275d1b,_0x2ecc68,!![]);}catch(_0x534861){return BPromise[_0x498a('0x28')](_0x534861);}return _0x275d1b[_0x498a('0x29')]();};}function saveUpdates(_0x2bb30d,_0x2adef6){return function(_0x3ccc12){if(_0x3ccc12){return _0x3ccc12['update'](_0x2bb30d)[_0x498a('0x2a')](function(_0x57a135){return _0x57a135;});}return null;};}function handleEntityNotFound(_0x122c61,_0x39f82f){return function(_0x4ddbb7){if(!_0x4ddbb7){_0x122c61[_0x498a('0x1e')](0x194);}return _0x4ddbb7;};}function handleError(_0x3db5b7,_0x4d76f3){_0x4d76f3=_0x4d76f3||0x1f4;return function(_0x1c2f1a){logger[_0x498a('0x2b')](_0x1c2f1a[_0x498a('0x2c')]);if(_0x1c2f1a[_0x498a('0x2d')]){delete _0x1c2f1a[_0x498a('0x2d')];}_0x3db5b7[_0x498a('0x20')](_0x4d76f3)[_0x498a('0x2e')](_0x1c2f1a);};}exports['index']=function(_0x3ce0d3,_0x5ff98b){var _0x3f453b={},_0x2f60df={},_0x5cdd41={'count':0x0,'rows':[]};var _0x2bcc7e=_[_0x498a('0x2f')](db[_0x498a('0x30')][_0x498a('0x31')],function(_0x2f1c80){return{'name':_0x2f1c80[_0x498a('0x32')],'type':_0x2f1c80['type'][_0x498a('0x33')]};});_0x2f60df[_0x498a('0x34')]=_[_0x498a('0x2f')](_0x2bcc7e,'name');_0x2f60df['query']=_[_0x498a('0x35')](_0x3ce0d3[_0x498a('0x36')]);_0x2f60df[_0x498a('0x37')]=_['intersection'](_0x2f60df[_0x498a('0x34')],_0x2f60df[_0x498a('0x36')]);_0x3f453b[_0x498a('0x38')]=_[_0x498a('0x39')](_0x2f60df[_0x498a('0x34')],qs[_0x498a('0x3a')](_0x3ce0d3['query'][_0x498a('0x3a')]));_0x3f453b[_0x498a('0x38')]=_0x3f453b[_0x498a('0x38')]['length']?_0x3f453b['attributes']:_0x2f60df[_0x498a('0x34')];if(!_0x3ce0d3[_0x498a('0x36')][_0x498a('0x3b')]('nolimit')){_0x3f453b[_0x498a('0x24')]=qs[_0x498a('0x24')](_0x3ce0d3[_0x498a('0x36')][_0x498a('0x24')]);_0x3f453b[_0x498a('0x21')]=qs[_0x498a('0x21')](_0x3ce0d3[_0x498a('0x36')]['offset']);}_0x3f453b[_0x498a('0x3c')]=qs[_0x498a('0x3d')](_0x3ce0d3['query'][_0x498a('0x3d')]);_0x3f453b[_0x498a('0x3e')]=qs['filters'](_[_0x498a('0x3f')](_0x3ce0d3[_0x498a('0x36')],_0x2f60df['filters']),_0x2bcc7e);if(_0x3ce0d3[_0x498a('0x36')][_0x498a('0x40')]){_0x3f453b['where']=_['merge'](_0x3f453b[_0x498a('0x3e')],{'$or':_[_0x498a('0x2f')](_0x2bcc7e,function(_0x2a9bc2){if(_0x2a9bc2[_0x498a('0x41')]!==_0x498a('0x42')){var _0x484855={};_0x484855[_0x2a9bc2[_0x498a('0x2d')]]={'$like':'%'+_0x3ce0d3[_0x498a('0x36')][_0x498a('0x40')]+'%'};return _0x484855;}})});}_0x3f453b=_[_0x498a('0x43')]({},_0x3f453b,_0x3ce0d3[_0x498a('0x44')]);var _0x1130f4={'where':_0x3f453b['where']};return db['Team'][_0x498a('0x23')](_0x1130f4)[_0x498a('0x2a')](function(_0x31284b){_0x5cdd41['count']=_0x31284b;if(_0x3ce0d3[_0x498a('0x36')][_0x498a('0x45')]){_0x3f453b['include']=[{'all':!![]}];}return db['Team'][_0x498a('0x46')](_0x3f453b);})[_0x498a('0x2a')](function(_0x45458f){_0x5cdd41['rows']=_0x45458f;return _0x5cdd41;})['then'](respondWithFilteredResult(_0x5ff98b,_0x3f453b))['catch'](handleError(_0x5ff98b,null));};exports[_0x498a('0x47')]=function(_0x36f2cf,_0x3a4019){var _0x5a890a={'raw':![],'where':{'id':_0x36f2cf[_0x498a('0x48')]['id']}},_0xbbe10b={};_0xbbe10b[_0x498a('0x34')]=_[_0x498a('0x35')](db[_0x498a('0x30')][_0x498a('0x31')]);_0xbbe10b['query']=_[_0x498a('0x35')](_0x36f2cf[_0x498a('0x36')]);_0xbbe10b[_0x498a('0x37')]=_[_0x498a('0x39')](_0xbbe10b[_0x498a('0x34')],_0xbbe10b[_0x498a('0x36')]);_0x5a890a[_0x498a('0x38')]=_['intersection'](_0xbbe10b[_0x498a('0x34')],qs[_0x498a('0x3a')](_0x36f2cf[_0x498a('0x36')][_0x498a('0x3a')]));_0x5a890a['attributes']=_0x5a890a['attributes'][_0x498a('0x49')]?_0x5a890a['attributes']:_0xbbe10b[_0x498a('0x34')];if(_0x36f2cf[_0x498a('0x36')]['includeAll']){_0x5a890a[_0x498a('0x4a')]=[{'all':!![]}];}_0x5a890a=_[_0x498a('0x43')]({},_0x5a890a,_0x36f2cf[_0x498a('0x44')]);return db[_0x498a('0x30')][_0x498a('0x4b')](_0x5a890a)[_0x498a('0x2a')](handleEntityNotFound(_0x3a4019,null))[_0x498a('0x2a')](respondWithResult(_0x3a4019,null))[_0x498a('0x4c')](handleError(_0x3a4019,null));};exports[_0x498a('0x4d')]=function(_0x415ad5,_0x1e1b15){return db['Team']['create'](_0x415ad5[_0x498a('0x4e')],{})[_0x498a('0x2a')](function(_0x6a56a2){var _0x2f77a7=_0x415ad5[_0x498a('0x4f')][_0x498a('0x50')]({'plain':!![]});if(!_0x2f77a7)throw new Error(_0x498a('0x51'));if(_0x2f77a7[_0x498a('0x52')]===_0x498a('0x4f')){var _0x2cda99=_0x6a56a2[_0x498a('0x50')]({'plain':!![]});var _0x5b7eca=_0x498a('0x53');return db['UserProfileSection'][_0x498a('0x4b')]({'where':{'name':_0x5b7eca,'userProfileId':_0x2f77a7['userProfileId']},'raw':!![]})[_0x498a('0x2a')](function(_0x5c24f6){if(_0x5c24f6&&_0x5c24f6[_0x498a('0x54')]===0x0){return db[_0x498a('0x55')][_0x498a('0x4d')]({'name':_0x2cda99[_0x498a('0x2d')],'resourceId':_0x2cda99['id'],'type':_0x5c24f6[_0x498a('0x2d')],'sectionId':_0x5c24f6['id']},{})[_0x498a('0x2a')](function(){return _0x6a56a2;});}else{return _0x6a56a2;}})[_0x498a('0x4c')](function(_0x5b5425){logger[_0x498a('0x2b')](_0x498a('0x56'),_0x5b5425);throw _0x5b5425;});}return _0x6a56a2;})[_0x498a('0x2a')](respondWithResult(_0x1e1b15,0xc9))[_0x498a('0x4c')](handleError(_0x1e1b15,null));};exports[_0x498a('0x57')]=function(_0x33caec,_0x8c8c56){if(_0x33caec[_0x498a('0x4e')]['id']){delete _0x33caec['body']['id'];}return db['Team'][_0x498a('0x4b')]({'where':{'id':_0x33caec[_0x498a('0x48')]['id']}})[_0x498a('0x2a')](handleEntityNotFound(_0x8c8c56,null))[_0x498a('0x2a')](saveUpdates(_0x33caec[_0x498a('0x4e')],null))['then'](respondWithResult(_0x8c8c56,null))[_0x498a('0x4c')](handleError(_0x8c8c56,null));};exports['destroy']=function(_0x5dc320,_0x2b113b){var _0xa7ef93=_0x5dc320[_0x498a('0x48')]['id'];var _0x47e958=[];return db[_0x498a('0x58')][_0x498a('0x59')](function(_0x464b23){var _0x16abb8='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0xa7ef93;return db[_0x498a('0x58')][_0x498a('0x36')](_0x16abb8,{'type':db[_0x498a('0x5a')][_0x498a('0x5b')]['SELECT'],'raw':!![],'transaction':_0x464b23})[_0x498a('0x2a')](function(_0x559568){_0x47e958=_['map'](_0x559568,function(_0x340176){return Number(_0x340176['UserId']);});})[_0x498a('0x2a')](function(){var _0x7e237b=_0x498a('0x5c')+_0xa7ef93;return db[_0x498a('0x58')][_0x498a('0x36')](_0x7e237b,{'type':db[_0x498a('0x5a')][_0x498a('0x5b')]['SELECT'],'raw':!![],'transaction':_0x464b23});})[_0x498a('0x2a')](function(_0x32b7c6){var _0x42ef5f=_[_0x498a('0x2f')](_0x32b7c6,function(_0x4c8ce0){return Number(_0x4c8ce0[_0x498a('0x5d')]);});return db[_0x498a('0x5e')][_0x498a('0x5f')]({'where':{'UserId':{'$in':_0x47e958},'VoiceQueueId':{'$in':_0x42ef5f}},'transaction':_0x464b23});})[_0x498a('0x2a')](function(){var _0x5979ac='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0xa7ef93;return db[_0x498a('0x58')]['query'](_0x5979ac,{'type':db[_0x498a('0x5a')][_0x498a('0x5b')]['SELECT'],'raw':!![],'transaction':_0x464b23});})[_0x498a('0x2a')](function(_0x109b00){var _0x1741e9=_[_0x498a('0x2f')](_0x109b00,function(_0x400027){return Number(_0x400027[_0x498a('0x60')]);});return db['UserMailQueue'][_0x498a('0x5f')]({'where':{'UserId':{'$in':_0x47e958},'MailQueueId':{'$in':_0x1741e9}},'transaction':_0x464b23});})[_0x498a('0x2a')](function(){var _0x3da579=_0x498a('0x61')+_0xa7ef93;return db[_0x498a('0x58')][_0x498a('0x36')](_0x3da579,{'type':db['Sequelize']['QueryTypes'][_0x498a('0x62')],'raw':!![],'transaction':_0x464b23});})[_0x498a('0x2a')](function(_0x4baca7){var _0x1ba317=_[_0x498a('0x2f')](_0x4baca7,function(_0x5b9120){return Number(_0x5b9120[_0x498a('0x63')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x47e958},'SmsQueueId':{'$in':_0x1ba317}},'transaction':_0x464b23});})[_0x498a('0x2a')](function(){var _0x521736=_0x498a('0x64')+_0xa7ef93;return db[_0x498a('0x58')][_0x498a('0x36')](_0x521736,{'type':db[_0x498a('0x5a')][_0x498a('0x5b')][_0x498a('0x62')],'raw':!![],'transaction':_0x464b23});})[_0x498a('0x2a')](function(_0x3741d7){var _0x424e34=_[_0x498a('0x2f')](_0x3741d7,function(_0x44e3c8){return Number(_0x44e3c8['ChatQueueId']);});return db[_0x498a('0x65')][_0x498a('0x5f')]({'where':{'UserId':{'$in':_0x47e958},'ChatQueueId':{'$in':_0x424e34}},'transaction':_0x464b23});})['then'](function(){var _0x14ca7a=_0x498a('0x66')+_0xa7ef93;return db[_0x498a('0x58')]['query'](_0x14ca7a,{'type':db[_0x498a('0x5a')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x464b23});})['then'](function(_0xce589b){var _0x20b87a=_['map'](_0xce589b,function(_0x5736fd){return Number(_0x5736fd[_0x498a('0x67')]);});return db[_0x498a('0x68')][_0x498a('0x5f')]({'where':{'UserId':{'$in':_0x47e958},'FaxQueueId':{'$in':_0x20b87a}},'transaction':_0x464b23});})[_0x498a('0x2a')](function(){var _0x5454a9=_0x498a('0x69')+_0xa7ef93;return db[_0x498a('0x58')][_0x498a('0x36')](_0x5454a9,{'type':db[_0x498a('0x5a')][_0x498a('0x5b')]['SELECT'],'raw':!![],'transaction':_0x464b23});})[_0x498a('0x2a')](function(_0x50744c){var _0x4963b5=_[_0x498a('0x2f')](_0x50744c,function(_0x5ad055){return Number(_0x5ad055[_0x498a('0x6a')]);});return db[_0x498a('0x6b')][_0x498a('0x5f')]({'where':{'UserId':{'$in':_0x47e958},'OpenchannelQueueId':{'$in':_0x4963b5}},'transaction':_0x464b23});})['then'](function(){var _0x19be60=_0x498a('0x6c')+_0xa7ef93;return db[_0x498a('0x58')][_0x498a('0x36')](_0x19be60,{'type':db[_0x498a('0x5a')][_0x498a('0x5b')]['SELECT'],'raw':!![],'transaction':_0x464b23});})[_0x498a('0x2a')](function(_0x28d513){var _0x30a3fb=_[_0x498a('0x2f')](_0x28d513,function(_0x41c891){return Number(_0x41c891['WhatsappQueueId']);});return db[_0x498a('0x6d')][_0x498a('0x5f')]({'where':{'UserId':{'$in':_0x47e958},'WhatsappQueueId':{'$in':_0x30a3fb}},'transaction':_0x464b23});})[_0x498a('0x2a')](function(){return db[_0x498a('0x6e')][_0x498a('0x4b')]({'where':{'TeamId':_0xa7ef93}});})[_0x498a('0x2a')](function(_0x5b9334){if(_0x5b9334===null){return;}return db[_0x498a('0x6f')][_0x498a('0x5f')]({'where':{'UserId':{'$in':_0x47e958},'VoicePrefixId':_0x5b9334['VoicePrefixId']},'transaction':_0x464b23});})['then'](function(){return db[_0x498a('0x30')][_0x498a('0x5f')]({'where':{'id':_0xa7ef93},'cascade':!![],'transaction':_0x464b23});})['then'](function(_0x10acc3){if(_0x10acc3===0x0){_0x2b113b['sendStatus'](0x194);}else{return db[_0x498a('0x55')][_0x498a('0x5f')]({'where':{'type':'Teams','resourceId':_0xa7ef93},'cascade':!![],'transaction':_0x464b23})[_0x498a('0x2a')](function(){_0x2b113b[_0x498a('0x20')](0xcc)['end']();});}})['catch'](function(_0x5a00b7){_0x2b113b[_0x498a('0x20')](0x1f4)[_0x498a('0x2e')](_0x5a00b7);});});};exports[_0x498a('0x70')]=function(_0x57bc5d,_0xc8504a,_0x5b90ce){return db[_0x498a('0x30')][_0x498a('0x71')]({'where':{'id':_0x57bc5d[_0x498a('0x48')]['id']}})[_0x498a('0x2a')](handleEntityNotFound(_0xc8504a,null))[_0x498a('0x2a')](function(_0x543e6e){if(!_0x57bc5d[_0x498a('0x36')]['channel']||!utils[_0x498a('0x72')](_0x57bc5d[_0x498a('0x36')][_0x498a('0x73')])){throw new db['Sequelize'][(_0x498a('0x74'))]('Unknown\x20channel');}var _0x3d3df4={};var _0x1cdd67={};_0x1cdd67[_0x498a('0x34')]=_[_0x498a('0x35')](db[_[_0x498a('0x75')](_0x57bc5d[_0x498a('0x36')]['channel']['toLowerCase']())+_0x498a('0x76')][_0x498a('0x31')]);_0x1cdd67['query']=_[_0x498a('0x35')](_0x57bc5d[_0x498a('0x36')]);_0x1cdd67[_0x498a('0x37')]=_[_0x498a('0x39')](_0x1cdd67[_0x498a('0x34')],_0x1cdd67[_0x498a('0x36')]);_0x3d3df4[_0x498a('0x38')]=_[_0x498a('0x39')](_0x1cdd67[_0x498a('0x34')],qs['fields'](_0x57bc5d['query'][_0x498a('0x3a')]));_0x3d3df4[_0x498a('0x38')]=_0x3d3df4[_0x498a('0x38')][_0x498a('0x49')]?_0x3d3df4[_0x498a('0x38')]:_0x1cdd67['model'];_0x3d3df4['limit']=qs[_0x498a('0x24')](_0x57bc5d[_0x498a('0x36')][_0x498a('0x24')]);_0x3d3df4[_0x498a('0x21')]=qs['offset'](_0x57bc5d[_0x498a('0x36')][_0x498a('0x21')]);_0x3d3df4[_0x498a('0x3c')]=qs[_0x498a('0x3d')](_0x57bc5d[_0x498a('0x36')]['sort']);_0x3d3df4[_0x498a('0x3e')]=qs['filters'](_[_0x498a('0x3f')](_0x57bc5d[_0x498a('0x36')],_0x1cdd67[_0x498a('0x37')]));_0x3d3df4=_[_0x498a('0x43')]({},_0x3d3df4,_0x57bc5d[_0x498a('0x44')]);return _0x543e6e[_0x498a('0x50')+_['capitalize'](_0x57bc5d['query'][_0x498a('0x73')][_0x498a('0x77')]())+_0x498a('0x78')](_0x3d3df4);})[_0x498a('0x2a')](respondWithResult(_0xc8504a,null))[_0x498a('0x4c')](handleError(_0xc8504a,null));};exports[_0x498a('0x79')]=function(_0x143a38,_0x26467b,_0x42d95e){return db[_0x498a('0x30')][_0x498a('0x71')]({'where':{'id':_0x143a38[_0x498a('0x48')]['id']}})[_0x498a('0x2a')](function(_0x904539){if(_0x904539){if(!_0x143a38['body'][_0x498a('0x73')]||!utils[_0x498a('0x72')](_0x143a38['body'][_0x498a('0x73')])){throw new db[(_0x498a('0x5a'))][(_0x498a('0x74'))](_0x498a('0x7a'));}return _0x904539[_0x498a('0x7b')+_['capitalize'](_0x143a38[_0x498a('0x4e')][_0x498a('0x73')][_0x498a('0x77')]())+_0x498a('0x78')](_0x143a38['body'][_0x498a('0x7c')]);}return null;})[_0x498a('0x2a')](handleEntityNotFound(_0x26467b,null))[_0x498a('0x2a')](respondWithStatusCode(_0x26467b,null))[_0x498a('0x4c')](handleError(_0x26467b,null));};exports['removeQueues']=function(_0x3103ac,_0x4c6719,_0x1fb720){return db[_0x498a('0x30')]['findOne']({'where':{'id':_0x3103ac['params']['id']}})[_0x498a('0x2a')](function(_0x3ae5a1){if(_0x3ae5a1){if(!_0x3103ac[_0x498a('0x36')]['channel']||!utils[_0x498a('0x72')](_0x3103ac['query'][_0x498a('0x73')])){throw new db[(_0x498a('0x5a'))][(_0x498a('0x74'))](_0x498a('0x7a'));}return _0x3ae5a1[_0x498a('0x7d')+_[_0x498a('0x75')](_0x3103ac[_0x498a('0x36')][_0x498a('0x73')]['toLowerCase']())+_0x498a('0x78')](_0x3103ac[_0x498a('0x36')][_0x498a('0x7c')]);}return null;})[_0x498a('0x2a')](handleEntityNotFound(_0x4c6719,null))['then'](respondWithStatusCode(_0x4c6719,null))[_0x498a('0x4c')](handleError(_0x4c6719,null));};exports[_0x498a('0x7e')]=function(_0x45a295,_0x2ffeeb){var _0x519ff2=_[_0x498a('0x7f')](_0x45a295['body'][_0x498a('0x7c')])?_0x45a295[_0x498a('0x4e')][_0x498a('0x7c')]:[_0x45a295[_0x498a('0x4e')][_0x498a('0x7c')]];var _0x530528=_0x45a295[_0x498a('0x48')]['id'];return db[_0x498a('0x30')][_0x498a('0x4b')]({'where':{'id':_0x530528}})[_0x498a('0x2a')](handleEntityNotFound(_0x2ffeeb,null))['then'](function(_0x53790b){if(_0x53790b){var _0x4ff11c=[_0x498a('0x80'),'Chat',_0x498a('0x81'),_0x498a('0x82'),'Fax','Openchannel',_0x498a('0x83')];return db[_0x498a('0x58')][_0x498a('0x59')](function(_0x14574a){var _0x259cc0=_[_0x498a('0x2f')](_0x4ff11c,function(_0xbbae81){var _0x432b23={'attributes':['id',_0x498a('0x2d')]};if(_0xbbae81==='Voice'){_0x432b23[_0x498a('0x84')]={'attributes':[_0x498a('0x85')]};}return _0x53790b[_0x498a('0x50')+_0xbbae81+_0x498a('0x78')](_0x432b23)[_0x498a('0x2a')](function(_0x14dee2){var _0x1dfe2b=_['map'](_0x14dee2,function(_0xa2b039){var _0x504957=_[_0x498a('0x2f')](_0x519ff2,function(_0x1cc1e5){var _0x168192={'where':{'UserId':_0x1cc1e5,[_0xbbae81+_0x498a('0x86')]:_0xa2b039['id']},'transaction':_0x14574a};if(_0xbbae81===_0x498a('0x80')){_0x168192['defaults']={'penalty':_0xa2b039[_0x498a('0x87')][_0x498a('0x85')]};}return db[_0x498a('0x88')+_0xbbae81+_0x498a('0x76')][_0x498a('0x89')](_0x168192)['then'](function(){socket[_0x498a('0x8a')](_0x498a('0x4f')+_0xbbae81+_0x498a('0x8b'),{'UserId':_0x1cc1e5,[_0xbbae81+_0x498a('0x86')]:_0xa2b039['id']});if(_0xbbae81!==_0x498a('0x80')){return;}return db[_0x498a('0x88')][_0x498a('0x46')]({'where':{'id':_0x519ff2,'online':0x1},'attributes':['id','name',_0x498a('0x8c'),_0x498a('0x8d'),_0x498a('0x8e')],'raw':!![]})['then'](function(_0x5303bf){var _0xa7f0c7=_[_0x498a('0x2f')](_0x5303bf,function(_0x4be02c){return db[_0x498a('0x8f')][_0x498a('0x90')]({'membername':_0x4be02c[_0x498a('0x2d')],'UserId':_0x4be02c['id'],'queue_name':_0xa2b039[_0x498a('0x2d')],'VoiceQueueId':_0xa2b039['id'],'interface':_[_0x498a('0x91')](_0x4be02c[_0x498a('0x8e')])?util[_0x498a('0x92')](_0x498a('0x93'),_0x4be02c[_0x498a('0x2d')]):_0x4be02c['interface'],'paused':_0x4be02c[_0x498a('0x8d')]||![],'penalty':_0xa2b039[_0x498a('0x87')][_0x498a('0x85')]},{'transaction':_0x14574a});});return Promise[_0x498a('0x94')](_0xa7f0c7);});});});return Promise[_0x498a('0x94')](_0x504957);});return Promise[_0x498a('0x94')](_0x1dfe2b);})[_0x498a('0x2a')](function(){return db[_0x498a('0x6e')][_0x498a('0x71')]({'where':{'teamId':_0x530528}})[_0x498a('0x2a')](function(_0x1ef5d0){if(_0x1ef5d0){var _0xff6490=_[_0x498a('0x2f')](_0x519ff2,function(_0x110aff){db[_0x498a('0x6f')]['upsert']({'UserId':_0x110aff,'VoicePrefixId':_0x1ef5d0[_0x498a('0x95')]});});return Promise[_0x498a('0x94')](_0xff6490);}});});});return Promise[_0x498a('0x94')](_0x259cc0)[_0x498a('0x2a')](function(){return _0x53790b[_0x498a('0x7e')](_0x519ff2,{'transaction':_0x14574a})[_0x498a('0x96')](function(_0x5f815c){return _0x5f815c;});});});}})[_0x498a('0x2a')](respondWithResult(_0x2ffeeb,null))[_0x498a('0x4c')](handleError(_0x2ffeeb,null));};exports[_0x498a('0x97')]=function(_0x5580d4,_0x2db969){var _0x822a54=_['isArray'](_0x5580d4['query'][_0x498a('0x7c')])?_0x5580d4[_0x498a('0x36')][_0x498a('0x7c')]:[_0x5580d4['query'][_0x498a('0x7c')]];var _0x35c1bc=_0x5580d4[_0x498a('0x48')]['id'];return db[_0x498a('0x30')][_0x498a('0x4b')]({'where':{'id':_0x35c1bc}})[_0x498a('0x2a')](handleEntityNotFound(_0x2db969,null))['then'](function(_0xe25557){if(_0xe25557){var _0x5d7445=[_0x498a('0x80'),_0x498a('0x98'),_0x498a('0x81'),_0x498a('0x82'),_0x498a('0x99'),'Openchannel',_0x498a('0x83')];return db['sequelize']['transaction'](function(_0x18d9f6){var _0x1dc5db=_[_0x498a('0x2f')](_0x5d7445,function(_0x4aa2c7){var _0xd355e0={'attributes':['id',_0x498a('0x2d')]};return _0xe25557[_0x498a('0x50')+_0x4aa2c7+_0x498a('0x78')](_0xd355e0)[_0x498a('0x2a')](function(_0x1a062e){var _0xe2d5bd=_[_0x498a('0x2f')](_0x1a062e,function(_0x4e022f){return _0x4e022f[_0x498a('0x97')](_0x822a54,{'transaction':_0x18d9f6})[_0x498a('0x2a')](function(){var _0x45789b=_['map'](_0x822a54,function(_0x9440ec){socket[_0x498a('0x8a')](_0x498a('0x4f')+_0x4aa2c7+'Queue:remove',{'UserId':Number(_0x9440ec),[_0x4aa2c7+_0x498a('0x86')]:_0x4e022f['id']});if(_0x4aa2c7!==_0x498a('0x80')){return;}return db[_0x498a('0x8f')][_0x498a('0x5f')]({'where':{'VoiceQueueId':_0x4e022f['id'],'UserId':_0x9440ec},'transaction':_0x18d9f6});});return Promise[_0x498a('0x94')](_0x45789b);});});return Promise['all'](_0xe2d5bd);});});return Promise['all'](_0x1dc5db)[_0x498a('0x2a')](function(){return _0xe25557[_0x498a('0x97')](_0x822a54,{'transaction':_0x18d9f6});})[_0x498a('0x2a')](function(){return db[_0x498a('0x6e')][_0x498a('0x71')]({'where':{'teamId':_0x35c1bc}})[_0x498a('0x2a')](function(_0x3fc2ec){if(_0x3fc2ec){var _0x3dfe27=_['map'](_0x822a54,function(_0x59f0d9){db[_0x498a('0x6f')][_0x498a('0x5f')]({'where':{'UserId':_0x59f0d9,'VoicePrefixId':_0x3fc2ec[_0x498a('0x95')]}});});return Promise['all'](_0x3dfe27);}});});});}})[_0x498a('0x2a')](respondWithStatusCode(_0x2db969,null))[_0x498a('0x4c')](handleError(_0x2db969,null));};exports['getAgents']=function(_0x4951d8,_0x553eda,_0x7081b4){var _0x2ae8c8={};var _0x6462a2={};var _0x33cf1a;var _0x360371;return db[_0x498a('0x30')][_0x498a('0x71')]({'where':{'id':_0x4951d8[_0x498a('0x48')]['id']}})[_0x498a('0x2a')](handleEntityNotFound(_0x553eda,null))[_0x498a('0x2a')](function(_0xa93fc){if(_0xa93fc){_0x33cf1a=_0xa93fc;_0x6462a2[_0x498a('0x34')]=_[_0x498a('0x35')](db[_0x498a('0x88')]['rawAttributes']);_0x6462a2[_0x498a('0x36')]=_[_0x498a('0x35')](_0x4951d8[_0x498a('0x36')]);_0x6462a2[_0x498a('0x37')]=_['intersection'](_0x6462a2[_0x498a('0x34')],_0x6462a2[_0x498a('0x36')]);_0x2ae8c8[_0x498a('0x38')]=_[_0x498a('0x39')](_0x6462a2['model'],qs[_0x498a('0x3a')](_0x4951d8[_0x498a('0x36')][_0x498a('0x3a')]));_0x2ae8c8[_0x498a('0x38')]=_0x2ae8c8[_0x498a('0x38')][_0x498a('0x49')]?_0x2ae8c8[_0x498a('0x38')]:_0x6462a2[_0x498a('0x34')];_0x2ae8c8[_0x498a('0x3c')]=qs[_0x498a('0x3d')](_0x4951d8[_0x498a('0x36')]['sort']);_0x2ae8c8[_0x498a('0x3e')]=qs[_0x498a('0x37')](_['pick'](_0x4951d8['query'],_0x6462a2[_0x498a('0x37')]));if(_0x4951d8[_0x498a('0x36')][_0x498a('0x40')]){_0x2ae8c8['where']=_[_0x498a('0x43')](_0x2ae8c8[_0x498a('0x3e')],{'$or':_['map'](_0x2ae8c8['attributes'],function(_0xb80d70){var _0x3c06c4={};_0x3c06c4[_0xb80d70]={'$like':'%'+_0x4951d8[_0x498a('0x36')][_0x498a('0x40')]+'%'};return _0x3c06c4;})});}_0x2ae8c8=_['merge']({},_0x2ae8c8,_0x4951d8[_0x498a('0x44')]);return _0x33cf1a['getAgents'](_0x2ae8c8);}})[_0x498a('0x2a')](function(_0x12c84d){if(_0x12c84d){_0x360371=_0x12c84d[_0x498a('0x49')];if(!_0x4951d8[_0x498a('0x36')][_0x498a('0x3b')](_0x498a('0x9a'))){_0x2ae8c8[_0x498a('0x24')]=qs['limit'](_0x4951d8['query']['limit']);_0x2ae8c8[_0x498a('0x21')]=qs['offset'](_0x4951d8[_0x498a('0x36')][_0x498a('0x21')]);}return _0x33cf1a[_0x498a('0x9b')](_0x2ae8c8);}})[_0x498a('0x2a')](function(_0x1b40a7){if(_0x1b40a7){return _0x1b40a7?{'count':_0x360371,'rows':_0x1b40a7}:null;}})['then'](respondWithResult(_0x553eda,null))[_0x498a('0x4c')](handleError(_0x553eda,null));}; \ No newline at end of file +var _0x85f8=['map','Team','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','options','include','findAll','show','params','find','catch','create','body','user','get','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','QueryTypes','SELECT','UserId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','getQueues','findOne','channel','isValidChannel','ValidationError','toLowerCase','Queue','addQueues','Unknown\x20channel','add','capitalize','ids','removeQueues','remove','Queues','addAgents','isArray','Chat','Fax','Openchannel','Whatsapp','Voice','through','QueueId','TeamVoiceQueue','User','findOrCreate','emit','online','interface','UserVoiceQueueRt','upsert','isNil','format','penalty','all','VoicePrefixId','spread','Mail','Sms','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index'];(function(_0x13e453,_0x4ab30c){var _0x26aad2=function(_0x3387a1){while(--_0x3387a1){_0x13e453['push'](_0x13e453['shift']());}};_0x26aad2(++_0x4ab30c);}(_0x85f8,0xff));var _0x885f=function(_0x4388e1,_0x5bc3d5){_0x4388e1=_0x4388e1-0x0;var _0x52187a=_0x85f8[_0x4388e1];return _0x52187a;};'use strict';var emlformat=require(_0x885f('0x0'));var rimraf=require(_0x885f('0x1'));var zipdir=require(_0x885f('0x2'));var jsonpatch=require(_0x885f('0x3'));var rp=require(_0x885f('0x4'));var moment=require('moment');var BPromise=require(_0x885f('0x5'));var Mustache=require(_0x885f('0x6'));var util=require('util');var path=require(_0x885f('0x7'));var sox=require(_0x885f('0x8'));var csv=require(_0x885f('0x9'));var ejs=require(_0x885f('0xa'));var fs=require('fs');var fs_extra=require(_0x885f('0xb'));var _=require(_0x885f('0xc'));var squel=require(_0x885f('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x885f('0xe'));var Papa=require(_0x885f('0xf'));var Redis=require('ioredis');var authService=require(_0x885f('0x10'));var qs=require(_0x885f('0x11'));var as=require(_0x885f('0x12'));var hardwareService=require(_0x885f('0x13'));var logger=require(_0x885f('0x14'))('api');var utils=require(_0x885f('0x15'));var config=require(_0x885f('0x16'));var licenseUtil=require(_0x885f('0x17'));var db=require('../../mysqldb')['db'];config[_0x885f('0x18')]=_['defaults'](config['redis'],{'host':_0x885f('0x19'),'port':0x18eb});var socket=require(_0x885f('0x1a'))(new Redis(config[_0x885f('0x18')]));require('./team.socket')[_0x885f('0x1b')](socket);function respondWithStatusCode(_0xb7f7bc,_0x5a5d4e){_0x5a5d4e=_0x5a5d4e||0xcc;return function(_0x395f82){if(_0x395f82){return _0xb7f7bc[_0x885f('0x1c')](_0x5a5d4e);}return _0xb7f7bc[_0x885f('0x1d')](_0x5a5d4e)[_0x885f('0x1e')]();};}function respondWithResult(_0x2d4537,_0x5bcbf9){_0x5bcbf9=_0x5bcbf9||0xc8;return function(_0x3587b5){if(_0x3587b5){return _0x2d4537[_0x885f('0x1d')](_0x5bcbf9)['json'](_0x3587b5);}};}function respondWithFilteredResult(_0x398337,_0x41f844){return function(_0x962b2c){if(_0x962b2c){var _0x2e5e71=typeof _0x41f844[_0x885f('0x1f')]===_0x885f('0x20')&&typeof _0x41f844[_0x885f('0x21')]===_0x885f('0x20');var _0x241daa=_0x962b2c[_0x885f('0x22')];var _0xe6d7c2=_0x2e5e71?0x0:_0x41f844['offset'];var _0x18a1b0=_0x2e5e71?_0x962b2c[_0x885f('0x22')]:_0x41f844['offset']+_0x41f844[_0x885f('0x21')];var _0x2c70f5;if(_0x18a1b0>=_0x241daa){_0x18a1b0=_0x241daa;_0x2c70f5=0xc8;}else{_0x2c70f5=0xce;}_0x398337[_0x885f('0x1d')](_0x2c70f5);return _0x398337[_0x885f('0x23')](_0x885f('0x24'),_0xe6d7c2+'-'+_0x18a1b0+'/'+_0x241daa)[_0x885f('0x25')](_0x962b2c);}return null;};}function patchUpdates(_0x2308af){return function(_0x316b04){try{jsonpatch[_0x885f('0x26')](_0x316b04,_0x2308af,!![]);}catch(_0x15616a){return BPromise[_0x885f('0x27')](_0x15616a);}return _0x316b04[_0x885f('0x28')]();};}function saveUpdates(_0x56c7a1,_0xaa2de8){return function(_0x167f42){if(_0x167f42){return _0x167f42[_0x885f('0x29')](_0x56c7a1)[_0x885f('0x2a')](function(_0x1658ac){return _0x1658ac;});}return null;};}function handleEntityNotFound(_0x1fb76d,_0x32207d){return function(_0x54ef4c){if(!_0x54ef4c){_0x1fb76d[_0x885f('0x1c')](0x194);}return _0x54ef4c;};}function handleError(_0x3440d4,_0xf7a102){_0xf7a102=_0xf7a102||0x1f4;return function(_0x507de5){logger['error'](_0x507de5[_0x885f('0x2b')]);if(_0x507de5[_0x885f('0x2c')]){delete _0x507de5[_0x885f('0x2c')];}_0x3440d4['status'](_0xf7a102)[_0x885f('0x2d')](_0x507de5);};}exports[_0x885f('0x2e')]=function(_0x98c48e,_0x22c678){var _0x48e51d={},_0x595de3={},_0x2382e8={'count':0x0,'rows':[]};var _0x23ce36=_[_0x885f('0x2f')](db[_0x885f('0x30')][_0x885f('0x31')],function(_0x1dfb06){return{'name':_0x1dfb06[_0x885f('0x32')],'type':_0x1dfb06['type'][_0x885f('0x33')]};});_0x595de3['model']=_['map'](_0x23ce36,_0x885f('0x2c'));_0x595de3[_0x885f('0x34')]=_[_0x885f('0x35')](_0x98c48e[_0x885f('0x34')]);_0x595de3[_0x885f('0x36')]=_[_0x885f('0x37')](_0x595de3[_0x885f('0x38')],_0x595de3[_0x885f('0x34')]);_0x48e51d[_0x885f('0x39')]=_[_0x885f('0x37')](_0x595de3[_0x885f('0x38')],qs[_0x885f('0x3a')](_0x98c48e[_0x885f('0x34')][_0x885f('0x3a')]));_0x48e51d[_0x885f('0x39')]=_0x48e51d[_0x885f('0x39')][_0x885f('0x3b')]?_0x48e51d[_0x885f('0x39')]:_0x595de3[_0x885f('0x38')];if(!_0x98c48e[_0x885f('0x34')]['hasOwnProperty'](_0x885f('0x3c'))){_0x48e51d[_0x885f('0x21')]=qs['limit'](_0x98c48e[_0x885f('0x34')][_0x885f('0x21')]);_0x48e51d[_0x885f('0x1f')]=qs[_0x885f('0x1f')](_0x98c48e[_0x885f('0x34')][_0x885f('0x1f')]);}_0x48e51d[_0x885f('0x3d')]=qs[_0x885f('0x3e')](_0x98c48e[_0x885f('0x34')]['sort']);_0x48e51d['where']=qs['filters'](_[_0x885f('0x3f')](_0x98c48e['query'],_0x595de3[_0x885f('0x36')]),_0x23ce36);if(_0x98c48e[_0x885f('0x34')][_0x885f('0x40')]){_0x48e51d[_0x885f('0x41')]=_[_0x885f('0x42')](_0x48e51d['where'],{'$or':_[_0x885f('0x2f')](_0x23ce36,function(_0x42c636){if(_0x42c636[_0x885f('0x43')]!=='VIRTUAL'){var _0x2d17ab={};_0x2d17ab[_0x42c636[_0x885f('0x2c')]]={'$like':'%'+_0x98c48e[_0x885f('0x34')]['filter']+'%'};return _0x2d17ab;}})});}_0x48e51d=_[_0x885f('0x42')]({},_0x48e51d,_0x98c48e[_0x885f('0x44')]);var _0x2a0ce6={'where':_0x48e51d[_0x885f('0x41')]};return db['Team'][_0x885f('0x22')](_0x2a0ce6)[_0x885f('0x2a')](function(_0x5c2318){_0x2382e8[_0x885f('0x22')]=_0x5c2318;if(_0x98c48e[_0x885f('0x34')]['includeAll']){_0x48e51d[_0x885f('0x45')]=[{'all':!![]}];}return db[_0x885f('0x30')][_0x885f('0x46')](_0x48e51d);})[_0x885f('0x2a')](function(_0x24beab){_0x2382e8['rows']=_0x24beab;return _0x2382e8;})[_0x885f('0x2a')](respondWithFilteredResult(_0x22c678,_0x48e51d))['catch'](handleError(_0x22c678,null));};exports[_0x885f('0x47')]=function(_0x2df234,_0x511cfc){var _0x5719dc={'raw':![],'where':{'id':_0x2df234[_0x885f('0x48')]['id']}},_0x445085={};_0x445085[_0x885f('0x38')]=_[_0x885f('0x35')](db[_0x885f('0x30')][_0x885f('0x31')]);_0x445085[_0x885f('0x34')]=_[_0x885f('0x35')](_0x2df234[_0x885f('0x34')]);_0x445085[_0x885f('0x36')]=_[_0x885f('0x37')](_0x445085[_0x885f('0x38')],_0x445085[_0x885f('0x34')]);_0x5719dc[_0x885f('0x39')]=_[_0x885f('0x37')](_0x445085[_0x885f('0x38')],qs[_0x885f('0x3a')](_0x2df234[_0x885f('0x34')][_0x885f('0x3a')]));_0x5719dc[_0x885f('0x39')]=_0x5719dc[_0x885f('0x39')][_0x885f('0x3b')]?_0x5719dc[_0x885f('0x39')]:_0x445085[_0x885f('0x38')];if(_0x2df234[_0x885f('0x34')]['includeAll']){_0x5719dc[_0x885f('0x45')]=[{'all':!![]}];}_0x5719dc=_[_0x885f('0x42')]({},_0x5719dc,_0x2df234['options']);return db[_0x885f('0x30')][_0x885f('0x49')](_0x5719dc)[_0x885f('0x2a')](handleEntityNotFound(_0x511cfc,null))[_0x885f('0x2a')](respondWithResult(_0x511cfc,null))[_0x885f('0x4a')](handleError(_0x511cfc,null));};exports[_0x885f('0x4b')]=function(_0x75e9aa,_0x5c7122){return db[_0x885f('0x30')][_0x885f('0x4b')](_0x75e9aa[_0x885f('0x4c')],{})[_0x885f('0x2a')](function(_0x493bda){var _0x440c7a=_0x75e9aa['user']['get']({'plain':!![]});if(!_0x440c7a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x440c7a['role']===_0x885f('0x4d')){var _0x314b0d=_0x493bda[_0x885f('0x4e')]({'plain':!![]});var _0x32b7fc=_0x885f('0x4f');return db[_0x885f('0x50')]['find']({'where':{'name':_0x32b7fc,'userProfileId':_0x440c7a[_0x885f('0x51')]},'raw':!![]})[_0x885f('0x2a')](function(_0x20f283){if(_0x20f283&&_0x20f283[_0x885f('0x52')]===0x0){return db[_0x885f('0x53')][_0x885f('0x4b')]({'name':_0x314b0d[_0x885f('0x2c')],'resourceId':_0x314b0d['id'],'type':_0x20f283[_0x885f('0x2c')],'sectionId':_0x20f283['id']},{})[_0x885f('0x2a')](function(){return _0x493bda;});}else{return _0x493bda;}})[_0x885f('0x4a')](function(_0x5f3bab){logger[_0x885f('0x54')](_0x885f('0x55'),_0x5f3bab);throw _0x5f3bab;});}return _0x493bda;})[_0x885f('0x2a')](respondWithResult(_0x5c7122,0xc9))[_0x885f('0x4a')](handleError(_0x5c7122,null));};exports['update']=function(_0x121a19,_0x18b545){if(_0x121a19[_0x885f('0x4c')]['id']){delete _0x121a19['body']['id'];}return db[_0x885f('0x30')][_0x885f('0x49')]({'where':{'id':_0x121a19[_0x885f('0x48')]['id']}})[_0x885f('0x2a')](handleEntityNotFound(_0x18b545,null))[_0x885f('0x2a')](saveUpdates(_0x121a19[_0x885f('0x4c')],null))[_0x885f('0x2a')](respondWithResult(_0x18b545,null))[_0x885f('0x4a')](handleError(_0x18b545,null));};exports['destroy']=function(_0x2004ab,_0x4af750){var _0x3fe7c3=_0x2004ab[_0x885f('0x48')]['id'];var _0x1c8788=[];return db[_0x885f('0x56')][_0x885f('0x57')](function(_0x1cb7a7){var _0xa0e3f2=_0x885f('0x58')+_0x3fe7c3;return db[_0x885f('0x56')]['query'](_0xa0e3f2,{'type':db[_0x885f('0x59')][_0x885f('0x5a')][_0x885f('0x5b')],'raw':!![],'transaction':_0x1cb7a7})[_0x885f('0x2a')](function(_0xe974eb){_0x1c8788=_[_0x885f('0x2f')](_0xe974eb,function(_0x5877e6){return Number(_0x5877e6[_0x885f('0x5c')]);});})[_0x885f('0x2a')](function(){var _0x5a3ed6='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3fe7c3;return db[_0x885f('0x56')][_0x885f('0x34')](_0x5a3ed6,{'type':db[_0x885f('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x1cb7a7});})['then'](function(_0x1668e2){var _0x403814=_['map'](_0x1668e2,function(_0xd67220){return Number(_0xd67220['VoiceQueueId']);});return db[_0x885f('0x5d')][_0x885f('0x5e')]({'where':{'UserId':{'$in':_0x1c8788},'VoiceQueueId':{'$in':_0x403814}},'transaction':_0x1cb7a7});})[_0x885f('0x2a')](function(){var _0x4e7e9b=_0x885f('0x5f')+_0x3fe7c3;return db['sequelize'][_0x885f('0x34')](_0x4e7e9b,{'type':db[_0x885f('0x59')][_0x885f('0x5a')][_0x885f('0x5b')],'raw':!![],'transaction':_0x1cb7a7});})[_0x885f('0x2a')](function(_0x43f618){var _0x55ae59=_['map'](_0x43f618,function(_0x2edcc5){return Number(_0x2edcc5[_0x885f('0x60')]);});return db[_0x885f('0x61')][_0x885f('0x5e')]({'where':{'UserId':{'$in':_0x1c8788},'MailQueueId':{'$in':_0x55ae59}},'transaction':_0x1cb7a7});})['then'](function(){var _0x2311a5='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3fe7c3;return db[_0x885f('0x56')][_0x885f('0x34')](_0x2311a5,{'type':db[_0x885f('0x59')][_0x885f('0x5a')][_0x885f('0x5b')],'raw':!![],'transaction':_0x1cb7a7});})[_0x885f('0x2a')](function(_0x39af1b){var _0x4efe32=_[_0x885f('0x2f')](_0x39af1b,function(_0x2d6b3c){return Number(_0x2d6b3c['SmsQueueId']);});return db['UserSmsQueue'][_0x885f('0x5e')]({'where':{'UserId':{'$in':_0x1c8788},'SmsQueueId':{'$in':_0x4efe32}},'transaction':_0x1cb7a7});})[_0x885f('0x2a')](function(){var _0x3d409c=_0x885f('0x62')+_0x3fe7c3;return db[_0x885f('0x56')][_0x885f('0x34')](_0x3d409c,{'type':db['Sequelize'][_0x885f('0x5a')][_0x885f('0x5b')],'raw':!![],'transaction':_0x1cb7a7});})['then'](function(_0x2eec7e){var _0x1a3120=_[_0x885f('0x2f')](_0x2eec7e,function(_0x5581a4){return Number(_0x5581a4[_0x885f('0x63')]);});return db['UserChatQueue'][_0x885f('0x5e')]({'where':{'UserId':{'$in':_0x1c8788},'ChatQueueId':{'$in':_0x1a3120}},'transaction':_0x1cb7a7});})[_0x885f('0x2a')](function(){var _0x223117=_0x885f('0x64')+_0x3fe7c3;return db['sequelize']['query'](_0x223117,{'type':db[_0x885f('0x59')][_0x885f('0x5a')]['SELECT'],'raw':!![],'transaction':_0x1cb7a7});})[_0x885f('0x2a')](function(_0x2325a2){var _0x45fd8b=_[_0x885f('0x2f')](_0x2325a2,function(_0x5ce6af){return Number(_0x5ce6af[_0x885f('0x65')]);});return db[_0x885f('0x66')][_0x885f('0x5e')]({'where':{'UserId':{'$in':_0x1c8788},'FaxQueueId':{'$in':_0x45fd8b}},'transaction':_0x1cb7a7});})[_0x885f('0x2a')](function(){var _0x5a06ac='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3fe7c3;return db['sequelize']['query'](_0x5a06ac,{'type':db[_0x885f('0x59')]['QueryTypes'][_0x885f('0x5b')],'raw':!![],'transaction':_0x1cb7a7});})[_0x885f('0x2a')](function(_0x3ac5dc){var _0x19abaf=_[_0x885f('0x2f')](_0x3ac5dc,function(_0x454ff6){return Number(_0x454ff6[_0x885f('0x67')]);});return db[_0x885f('0x68')][_0x885f('0x5e')]({'where':{'UserId':{'$in':_0x1c8788},'OpenchannelQueueId':{'$in':_0x19abaf}},'transaction':_0x1cb7a7});})[_0x885f('0x2a')](function(){var _0x3a7421='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3fe7c3;return db['sequelize'][_0x885f('0x34')](_0x3a7421,{'type':db[_0x885f('0x59')]['QueryTypes'][_0x885f('0x5b')],'raw':!![],'transaction':_0x1cb7a7});})[_0x885f('0x2a')](function(_0x1dbb8e){var _0x1beb5f=_[_0x885f('0x2f')](_0x1dbb8e,function(_0x15149b){return Number(_0x15149b[_0x885f('0x69')]);});return db[_0x885f('0x6a')][_0x885f('0x5e')]({'where':{'UserId':{'$in':_0x1c8788},'WhatsappQueueId':{'$in':_0x1beb5f}},'transaction':_0x1cb7a7});})[_0x885f('0x2a')](function(){return db[_0x885f('0x6b')]['find']({'where':{'TeamId':_0x3fe7c3}});})[_0x885f('0x2a')](function(_0x11e5e8){if(_0x11e5e8===null){return;}return db[_0x885f('0x6c')][_0x885f('0x5e')]({'where':{'UserId':{'$in':_0x1c8788},'VoicePrefixId':_0x11e5e8['VoicePrefixId']},'transaction':_0x1cb7a7});})[_0x885f('0x2a')](function(){return db[_0x885f('0x30')]['destroy']({'where':{'id':_0x3fe7c3},'cascade':!![],'transaction':_0x1cb7a7});})['then'](function(_0x2c2ee6){if(_0x2c2ee6===0x0){_0x4af750[_0x885f('0x1c')](0x194);}else{return db['UserProfileResource'][_0x885f('0x5e')]({'where':{'type':_0x885f('0x4f'),'resourceId':_0x3fe7c3},'cascade':!![],'transaction':_0x1cb7a7})[_0x885f('0x2a')](function(){_0x4af750[_0x885f('0x1d')](0xcc)[_0x885f('0x1e')]();});}})[_0x885f('0x4a')](function(_0xdf0521){_0x4af750[_0x885f('0x1d')](0x1f4)['send'](_0xdf0521);});});};exports[_0x885f('0x6d')]=function(_0x2c44a7,_0x3cc2ee,_0x361805){return db[_0x885f('0x30')][_0x885f('0x6e')]({'where':{'id':_0x2c44a7[_0x885f('0x48')]['id']}})[_0x885f('0x2a')](handleEntityNotFound(_0x3cc2ee,null))[_0x885f('0x2a')](function(_0x16c3a7){if(!_0x2c44a7[_0x885f('0x34')][_0x885f('0x6f')]||!utils[_0x885f('0x70')](_0x2c44a7[_0x885f('0x34')][_0x885f('0x6f')])){throw new db[(_0x885f('0x59'))][(_0x885f('0x71'))]('Unknown\x20channel');}var _0xb80a7a={};var _0x2e7d51={};_0x2e7d51[_0x885f('0x38')]=_[_0x885f('0x35')](db[_['capitalize'](_0x2c44a7[_0x885f('0x34')]['channel'][_0x885f('0x72')]())+_0x885f('0x73')]['rawAttributes']);_0x2e7d51['query']=_[_0x885f('0x35')](_0x2c44a7[_0x885f('0x34')]);_0x2e7d51[_0x885f('0x36')]=_[_0x885f('0x37')](_0x2e7d51[_0x885f('0x38')],_0x2e7d51[_0x885f('0x34')]);_0xb80a7a['attributes']=_[_0x885f('0x37')](_0x2e7d51[_0x885f('0x38')],qs['fields'](_0x2c44a7[_0x885f('0x34')]['fields']));_0xb80a7a[_0x885f('0x39')]=_0xb80a7a[_0x885f('0x39')]['length']?_0xb80a7a[_0x885f('0x39')]:_0x2e7d51[_0x885f('0x38')];_0xb80a7a[_0x885f('0x21')]=qs['limit'](_0x2c44a7[_0x885f('0x34')]['limit']);_0xb80a7a[_0x885f('0x1f')]=qs['offset'](_0x2c44a7[_0x885f('0x34')]['offset']);_0xb80a7a[_0x885f('0x3d')]=qs[_0x885f('0x3e')](_0x2c44a7[_0x885f('0x34')][_0x885f('0x3e')]);_0xb80a7a[_0x885f('0x41')]=qs[_0x885f('0x36')](_[_0x885f('0x3f')](_0x2c44a7[_0x885f('0x34')],_0x2e7d51['filters']));_0xb80a7a=_['merge']({},_0xb80a7a,_0x2c44a7[_0x885f('0x44')]);return _0x16c3a7[_0x885f('0x4e')+_['capitalize'](_0x2c44a7['query']['channel'][_0x885f('0x72')]())+'Queues'](_0xb80a7a);})[_0x885f('0x2a')](respondWithResult(_0x3cc2ee,null))[_0x885f('0x4a')](handleError(_0x3cc2ee,null));};exports[_0x885f('0x74')]=function(_0x53710e,_0x467df1,_0x103eec){return db[_0x885f('0x30')][_0x885f('0x6e')]({'where':{'id':_0x53710e[_0x885f('0x48')]['id']}})[_0x885f('0x2a')](function(_0x224ed6){if(_0x224ed6){if(!_0x53710e['body']['channel']||!utils['isValidChannel'](_0x53710e['body']['channel'])){throw new db[(_0x885f('0x59'))]['ValidationError'](_0x885f('0x75'));}return _0x224ed6[_0x885f('0x76')+_[_0x885f('0x77')](_0x53710e[_0x885f('0x4c')]['channel']['toLowerCase']())+'Queues'](_0x53710e[_0x885f('0x4c')][_0x885f('0x78')]);}return null;})[_0x885f('0x2a')](handleEntityNotFound(_0x467df1,null))['then'](respondWithStatusCode(_0x467df1,null))[_0x885f('0x4a')](handleError(_0x467df1,null));};exports[_0x885f('0x79')]=function(_0x579fe2,_0x2efc23,_0x41ed47){return db[_0x885f('0x30')][_0x885f('0x6e')]({'where':{'id':_0x579fe2[_0x885f('0x48')]['id']}})[_0x885f('0x2a')](function(_0x1baf5){if(_0x1baf5){if(!_0x579fe2[_0x885f('0x34')][_0x885f('0x6f')]||!utils['isValidChannel'](_0x579fe2['query'][_0x885f('0x6f')])){throw new db[(_0x885f('0x59'))]['ValidationError'](_0x885f('0x75'));}return _0x1baf5[_0x885f('0x7a')+_['capitalize'](_0x579fe2[_0x885f('0x34')]['channel'][_0x885f('0x72')]())+_0x885f('0x7b')](_0x579fe2[_0x885f('0x34')]['ids']);}return null;})[_0x885f('0x2a')](handleEntityNotFound(_0x2efc23,null))['then'](respondWithStatusCode(_0x2efc23,null))['catch'](handleError(_0x2efc23,null));};exports[_0x885f('0x7c')]=function(_0x475201,_0x412c93){var _0x1d8701=_[_0x885f('0x7d')](_0x475201[_0x885f('0x4c')][_0x885f('0x78')])?_0x475201[_0x885f('0x4c')][_0x885f('0x78')]:[_0x475201[_0x885f('0x4c')][_0x885f('0x78')]];var _0x16b62f=_0x475201[_0x885f('0x48')]['id'];return db[_0x885f('0x30')]['find']({'where':{'id':_0x16b62f}})[_0x885f('0x2a')](handleEntityNotFound(_0x412c93,null))[_0x885f('0x2a')](function(_0x5bce9d){if(_0x5bce9d){var _0x4b232c=['Voice',_0x885f('0x7e'),'Mail','Sms',_0x885f('0x7f'),_0x885f('0x80'),_0x885f('0x81')];return db['sequelize'][_0x885f('0x57')](function(_0x2557c6){var _0x20c200=_[_0x885f('0x2f')](_0x4b232c,function(_0x5a7811){var _0x9c93cd={'attributes':['id',_0x885f('0x2c')]};if(_0x5a7811===_0x885f('0x82')){_0x9c93cd[_0x885f('0x83')]={'attributes':['penalty']};}return _0x5bce9d['get'+_0x5a7811+'Queues'](_0x9c93cd)['then'](function(_0x356f82){var _0x5e797f=_[_0x885f('0x2f')](_0x356f82,function(_0x2165ca){var _0x421d7e=_[_0x885f('0x2f')](_0x1d8701,function(_0x53075b){var _0x4bf915={'where':{'UserId':_0x53075b,[_0x5a7811+_0x885f('0x84')]:_0x2165ca['id']},'transaction':_0x2557c6};if(_0x5a7811===_0x885f('0x82')){_0x4bf915['defaults']={'penalty':_0x2165ca[_0x885f('0x85')]['penalty']};}return db[_0x885f('0x86')+_0x5a7811+_0x885f('0x73')][_0x885f('0x87')](_0x4bf915)[_0x885f('0x2a')](function(){socket[_0x885f('0x88')](_0x885f('0x4d')+_0x5a7811+'Queue:save',{'UserId':_0x53075b,[_0x5a7811+_0x885f('0x84')]:_0x2165ca['id']});if(_0x5a7811!==_0x885f('0x82')){return;}return db[_0x885f('0x86')][_0x885f('0x46')]({'where':{'id':_0x1d8701,'online':0x1},'attributes':['id',_0x885f('0x2c'),_0x885f('0x89'),'voicePause',_0x885f('0x8a')],'raw':!![]})[_0x885f('0x2a')](function(_0x42b222){var _0x184d38=_[_0x885f('0x2f')](_0x42b222,function(_0x3bbe65){return db[_0x885f('0x8b')][_0x885f('0x8c')]({'membername':_0x3bbe65['name'],'UserId':_0x3bbe65['id'],'queue_name':_0x2165ca['name'],'VoiceQueueId':_0x2165ca['id'],'interface':_[_0x885f('0x8d')](_0x3bbe65[_0x885f('0x8a')])?util[_0x885f('0x8e')]('SIP/%s',_0x3bbe65[_0x885f('0x2c')]):_0x3bbe65['interface'],'paused':_0x3bbe65['voicePause']||![],'penalty':_0x2165ca[_0x885f('0x85')][_0x885f('0x8f')]},{'transaction':_0x2557c6});});return Promise[_0x885f('0x90')](_0x184d38);});});});return Promise['all'](_0x421d7e);});return Promise[_0x885f('0x90')](_0x5e797f);})['then'](function(){return db[_0x885f('0x6b')][_0x885f('0x6e')]({'where':{'teamId':_0x16b62f}})[_0x885f('0x2a')](function(_0x5d33ba){if(_0x5d33ba){var _0x2a5abf=_['map'](_0x1d8701,function(_0x332d50){db['UserVoicePrefix'][_0x885f('0x8c')]({'UserId':_0x332d50,'VoicePrefixId':_0x5d33ba[_0x885f('0x91')]});});return Promise[_0x885f('0x90')](_0x2a5abf);}});});});return Promise[_0x885f('0x90')](_0x20c200)['then'](function(){return _0x5bce9d[_0x885f('0x7c')](_0x1d8701,{'transaction':_0x2557c6})[_0x885f('0x92')](function(_0x27e7a9){return _0x27e7a9;});});});}})[_0x885f('0x2a')](respondWithResult(_0x412c93,null))[_0x885f('0x4a')](handleError(_0x412c93,null));};exports['removeAgents']=function(_0x311368,_0x3c3260){var _0x3af1ac=_[_0x885f('0x7d')](_0x311368[_0x885f('0x34')][_0x885f('0x78')])?_0x311368[_0x885f('0x34')][_0x885f('0x78')]:[_0x311368[_0x885f('0x34')]['ids']];var _0xd39f40=_0x311368['params']['id'];return db[_0x885f('0x30')][_0x885f('0x49')]({'where':{'id':_0xd39f40}})[_0x885f('0x2a')](handleEntityNotFound(_0x3c3260,null))['then'](function(_0x4837bf){if(_0x4837bf){var _0x162777=[_0x885f('0x82'),_0x885f('0x7e'),_0x885f('0x93'),_0x885f('0x94'),_0x885f('0x7f'),_0x885f('0x80'),_0x885f('0x81')];return db[_0x885f('0x56')][_0x885f('0x57')](function(_0x4277eb){var _0x2df4ec=_[_0x885f('0x2f')](_0x162777,function(_0x4ce58f){var _0x1b7c1a={'attributes':['id',_0x885f('0x2c')]};return _0x4837bf[_0x885f('0x4e')+_0x4ce58f+_0x885f('0x7b')](_0x1b7c1a)[_0x885f('0x2a')](function(_0x1f5784){var _0x2dc18b=_[_0x885f('0x2f')](_0x1f5784,function(_0x45cd0e){return _0x45cd0e['removeAgents'](_0x3af1ac,{'transaction':_0x4277eb})[_0x885f('0x2a')](function(){var _0x12e2a9=_['map'](_0x3af1ac,function(_0x3eb4bb){socket[_0x885f('0x88')](_0x885f('0x4d')+_0x4ce58f+_0x885f('0x95'),{'UserId':Number(_0x3eb4bb),[_0x4ce58f+_0x885f('0x84')]:_0x45cd0e['id']});if(_0x4ce58f!==_0x885f('0x82')){return;}return db[_0x885f('0x8b')][_0x885f('0x5e')]({'where':{'VoiceQueueId':_0x45cd0e['id'],'UserId':_0x3eb4bb},'transaction':_0x4277eb});});return Promise[_0x885f('0x90')](_0x12e2a9);});});return Promise['all'](_0x2dc18b);});});return Promise[_0x885f('0x90')](_0x2df4ec)[_0x885f('0x2a')](function(){return _0x4837bf['removeAgents'](_0x3af1ac,{'transaction':_0x4277eb});})[_0x885f('0x2a')](function(){return db[_0x885f('0x6b')][_0x885f('0x6e')]({'where':{'teamId':_0xd39f40}})['then'](function(_0x73d5c0){if(_0x73d5c0){var _0x48c9a0=_[_0x885f('0x2f')](_0x3af1ac,function(_0x2d4f68){db[_0x885f('0x6c')][_0x885f('0x5e')]({'where':{'UserId':_0x2d4f68,'VoicePrefixId':_0x73d5c0[_0x885f('0x91')]}});});return Promise[_0x885f('0x90')](_0x48c9a0);}});});});}})['then'](respondWithStatusCode(_0x3c3260,null))[_0x885f('0x4a')](handleError(_0x3c3260,null));};exports['getAgents']=function(_0x2dceac,_0x14be5d,_0x36d288){var _0x1fdafb={};var _0x36d4dd={};var _0x560113;var _0x336a27;return db['Team'][_0x885f('0x6e')]({'where':{'id':_0x2dceac[_0x885f('0x48')]['id']}})[_0x885f('0x2a')](handleEntityNotFound(_0x14be5d,null))[_0x885f('0x2a')](function(_0x1ce1dd){if(_0x1ce1dd){_0x560113=_0x1ce1dd;_0x36d4dd['model']=_[_0x885f('0x35')](db[_0x885f('0x86')][_0x885f('0x31')]);_0x36d4dd[_0x885f('0x34')]=_[_0x885f('0x35')](_0x2dceac[_0x885f('0x34')]);_0x36d4dd[_0x885f('0x36')]=_['intersection'](_0x36d4dd['model'],_0x36d4dd[_0x885f('0x34')]);_0x1fdafb[_0x885f('0x39')]=_['intersection'](_0x36d4dd[_0x885f('0x38')],qs[_0x885f('0x3a')](_0x2dceac[_0x885f('0x34')][_0x885f('0x3a')]));_0x1fdafb[_0x885f('0x39')]=_0x1fdafb[_0x885f('0x39')][_0x885f('0x3b')]?_0x1fdafb[_0x885f('0x39')]:_0x36d4dd[_0x885f('0x38')];_0x1fdafb[_0x885f('0x3d')]=qs[_0x885f('0x3e')](_0x2dceac[_0x885f('0x34')][_0x885f('0x3e')]);_0x1fdafb[_0x885f('0x41')]=qs[_0x885f('0x36')](_[_0x885f('0x3f')](_0x2dceac[_0x885f('0x34')],_0x36d4dd[_0x885f('0x36')]));if(_0x2dceac['query'][_0x885f('0x40')]){_0x1fdafb['where']=_[_0x885f('0x42')](_0x1fdafb[_0x885f('0x41')],{'$or':_[_0x885f('0x2f')](_0x1fdafb[_0x885f('0x39')],function(_0x152657){var _0x265150={};_0x265150[_0x152657]={'$like':'%'+_0x2dceac[_0x885f('0x34')][_0x885f('0x40')]+'%'};return _0x265150;})});}_0x1fdafb=_[_0x885f('0x42')]({},_0x1fdafb,_0x2dceac[_0x885f('0x44')]);return _0x560113[_0x885f('0x96')](_0x1fdafb);}})['then'](function(_0x50790e){if(_0x50790e){_0x336a27=_0x50790e['length'];if(!_0x2dceac[_0x885f('0x34')]['hasOwnProperty'](_0x885f('0x3c'))){_0x1fdafb[_0x885f('0x21')]=qs[_0x885f('0x21')](_0x2dceac[_0x885f('0x34')][_0x885f('0x21')]);_0x1fdafb[_0x885f('0x1f')]=qs[_0x885f('0x1f')](_0x2dceac[_0x885f('0x34')][_0x885f('0x1f')]);}return _0x560113[_0x885f('0x96')](_0x1fdafb);}})['then'](function(_0x2470b5){if(_0x2470b5){return _0x2470b5?{'count':_0x336a27,'rows':_0x2470b5}:null;}})[_0x885f('0x2a')](respondWithResult(_0x14be5d,null))[_0x885f('0x4a')](handleError(_0x14be5d,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 3ed6a6b..bc29920 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 _0x2813=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','Team'];(function(_0x4125f1,_0x2a676e){var _0x23bb1a=function(_0xb332f8){while(--_0xb332f8){_0x4125f1['push'](_0x4125f1['shift']());}};_0x23bb1a(++_0x2a676e);}(_0x2813,0xa7));var _0x3281=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2813[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3281('0x0'));var Team=require(_0x3281('0x1'))['db'][_0x3281('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x3281('0x3')](0x0);var events={'afterCreate':_0x3281('0x4'),'afterUpdate':_0x3281('0x5'),'afterDestroy':_0x3281('0x6')};function emitEvent(_0x35de03){return function(_0x265436,_0x247723,_0x21cb73){TeamEvents[_0x3281('0x7')](_0x35de03+':'+_0x265436['id'],_0x265436);TeamEvents[_0x3281('0x7')](_0x35de03,_0x265436);_0x21cb73(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x3281('0x8')](e,emitEvent(event));}}module[_0x3281('0x9')]=TeamEvents; \ No newline at end of file +var _0x560b=['Team','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x28ce8c,_0x53c0a5){var _0x1fd909=function(_0x283242){while(--_0x283242){_0x28ce8c['push'](_0x28ce8c['shift']());}};_0x1fd909(++_0x53c0a5);}(_0x560b,0x12f));var _0xb560=function(_0x27ca2c,_0x1ee9bc){_0x27ca2c=_0x27ca2c-0x0;var _0x1ce0f9=_0x560b[_0x27ca2c];return _0x1ce0f9;};'use strict';var EventEmitter=require(_0xb560('0x0'));var Team=require('../../mysqldb')['db'][_0xb560('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xb560('0x2')](0x0);var events={'afterCreate':_0xb560('0x3'),'afterUpdate':_0xb560('0x4'),'afterDestroy':'remove'};function emitEvent(_0x34ff51){return function(_0x421534,_0x32cac1,_0x2d216e){TeamEvents[_0xb560('0x5')](_0x34ff51+':'+_0x421534['id'],_0x421534);TeamEvents['emit'](_0x34ff51,_0x421534);_0x2d216e(null);};}for(var e in events){if(events[_0xb560('0x6')](e)){var event=events[e];Team[_0xb560('0x7')](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 76fddc0..305c574 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 _0xe665=['channel','catch','exports','define','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Whatsapp','resolve','all','lodash','./team.attributes','get','Queues','then','map','setDataValue'];(function(_0x59a294,_0x17dde5){var _0x175f9b=function(_0xe3ece2){while(--_0xe3ece2){_0x59a294['push'](_0x59a294['shift']());}};_0x175f9b(++_0x17dde5);}(_0xe665,0x1c7));var _0x5e66=function(_0x116a5c,_0x4c7dbd){_0x116a5c=_0x116a5c-0x0;var _0x1547b6=_0xe665[_0x116a5c];return _0x1547b6;};'use strict';var _=require(_0x5e66('0x0'));var attributes=require(_0x5e66('0x1'));function getQueuesByChannel(_0x294389,_0x3f71e3){var _0x59b574=_0x5e66('0x2')+_0x3f71e3+_0x5e66('0x3');return _0x294389[_0x59b574]()[_0x5e66('0x4')](function(_0x17cc08){return _[_0x5e66('0x5')](_0x17cc08,function(_0x45884b){_0x45884b[_0x5e66('0x6')](_0x5e66('0x7'),_0x3f71e3);return _0x45884b;});})[_0x5e66('0x8')](function(_0x19e8cd){throw _0x19e8cd;});}module[_0x5e66('0x9')]=function(_0x46bda8){return _0x46bda8[_0x5e66('0xa')](_0x5e66('0xb'),attributes,{'tableName':_0x5e66('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x3a950b=this;var _0x1fa9c6=[_0x5e66('0xd'),_0x5e66('0xe'),_0x5e66('0xf'),_0x5e66('0x10'),_0x5e66('0x11'),'Voice',_0x5e66('0x12')];return Promise[_0x5e66('0x13')]()[_0x5e66('0x4')](function(){var _0x3d51a6=_[_0x5e66('0x5')](_0x1fa9c6,function(_0x5cb23a){return getQueuesByChannel(_0x3a950b,_0x5cb23a);});return Promise[_0x5e66('0x14')](_0x3d51a6);})[_0x5e66('0x8')](function(_0x125740){throw _0x125740;});}}});}; \ No newline at end of file +var _0x142e=['setDataValue','channel','catch','exports','define','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Whatsapp','resolve','all','lodash','get','then','map'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x142e,0x18b));var _0xe142=function(_0x517b56,_0x4502a1){_0x517b56=_0x517b56-0x0;var _0x42ebed=_0x142e[_0x517b56];return _0x42ebed;};'use strict';var _=require(_0xe142('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x386777,_0x499257){var _0x3590f0=_0xe142('0x1')+_0x499257+'Queues';return _0x386777[_0x3590f0]()[_0xe142('0x2')](function(_0x332f8f){return _[_0xe142('0x3')](_0x332f8f,function(_0x263d36){_0x263d36[_0xe142('0x4')](_0xe142('0x5'),_0x499257);return _0x263d36;});})[_0xe142('0x6')](function(_0x161153){throw _0x161153;});}module[_0xe142('0x7')]=function(_0x1e76c7){return _0x1e76c7[_0xe142('0x8')](_0xe142('0x9'),attributes,{'tableName':_0xe142('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1c7f31=this;var _0x3912a0=[_0xe142('0xb'),_0xe142('0xc'),_0xe142('0xd'),_0xe142('0xe'),_0xe142('0xf'),'Voice',_0xe142('0x10')];return Promise[_0xe142('0x11')]()[_0xe142('0x2')](function(){var _0xd326d=_['map'](_0x3912a0,function(_0x136351){return getQueuesByChannel(_0x1c7f31,_0x136351);});return Promise[_0xe142('0x12')](_0xd326d);})[_0xe142('0x6')](function(_0x24ac60){throw _0x24ac60;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index fbb9de3..583490e 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 _0xc9cf=['error','code','Team,\x20%s,\x20%s','result','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s'];(function(_0x375b46,_0x429d16){var _0x4f42ee=function(_0x33124b){while(--_0x33124b){_0x375b46['push'](_0x375b46['shift']());}};_0x4f42ee(++_0x429d16);}(_0xc9cf,0x1d0));var _0xfc9c=function(_0x2f71c1,_0x319017){_0x2f71c1=_0x2f71c1-0x0;var _0x411bb7=_0xc9cf[_0x2f71c1];return _0x411bb7;};'use strict';var _=require(_0xfc9c('0x0'));var util=require(_0xfc9c('0x1'));var moment=require(_0xfc9c('0x2'));var BPromise=require(_0xfc9c('0x3'));var rs=require(_0xfc9c('0x4'));var fs=require('fs');var Redis=require(_0xfc9c('0x5'));var db=require(_0xfc9c('0x6'))['db'];var utils=require(_0xfc9c('0x7'));var logger=require(_0xfc9c('0x8'))('rpc');var config=require(_0xfc9c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfc9c('0xa')]({'port':0x232a});config[_0xfc9c('0xb')]=_['defaults'](config[_0xfc9c('0xb')],{'host':_0xfc9c('0xc'),'port':0x18eb});var socket=require(_0xfc9c('0xd'))(new Redis(config[_0xfc9c('0xb')]));require(_0xfc9c('0xe'))[_0xfc9c('0xf')](socket);function respondWithRpcPromise(_0x360be3,_0x3ec5f3,_0x375ded){return new BPromise(function(_0x469034,_0x5cb27d){return client[_0xfc9c('0x10')](_0x360be3,_0x375ded)[_0xfc9c('0x11')](function(_0x484130){logger[_0xfc9c('0x12')]('Team,\x20%s,\x20%s',_0x3ec5f3,_0xfc9c('0x13'));logger[_0xfc9c('0x14')](_0xfc9c('0x15'),_0x3ec5f3,_0xfc9c('0x13'),JSON['stringify'](_0x484130));if(_0x484130[_0xfc9c('0x16')]){if(_0x484130[_0xfc9c('0x16')][_0xfc9c('0x17')]===0x1f4){logger[_0xfc9c('0x16')](_0xfc9c('0x18'),_0x3ec5f3,_0x484130['error']['message']);return _0x5cb27d(_0x484130[_0xfc9c('0x16')]['message']);}logger['error'](_0xfc9c('0x18'),_0x3ec5f3,_0x484130[_0xfc9c('0x16')]['message']);return _0x469034(_0x484130[_0xfc9c('0x16')]['message']);}else{logger['info']('Team,\x20%s,\x20%s',_0x3ec5f3,_0xfc9c('0x13'));_0x469034(_0x484130[_0xfc9c('0x19')][_0xfc9c('0x1a')]);}})['catch'](function(_0xe50b8f){logger[_0xfc9c('0x16')](_0xfc9c('0x18'),_0x3ec5f3,_0xe50b8f);_0x5cb27d(_0xe50b8f);});});} \ No newline at end of file +var _0xd1af=['register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0xb0ce7b,_0x25894a){var _0x1e2f01=function(_0x256534){while(--_0x256534){_0xb0ce7b['push'](_0xb0ce7b['shift']());}};_0x1e2f01(++_0x25894a);}(_0xd1af,0xe5));var _0xfd1a=function(_0xa8369a,_0x3d2319){_0xa8369a=_0xa8369a-0x0;var _0x4b74b7=_0xd1af[_0xa8369a];return _0x4b74b7;};'use strict';var _=require(_0xfd1a('0x0'));var util=require(_0xfd1a('0x1'));var moment=require(_0xfd1a('0x2'));var BPromise=require(_0xfd1a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd1a('0x4'))['db'];var utils=require(_0xfd1a('0x5'));var logger=require(_0xfd1a('0x6'))(_0xfd1a('0x7'));var config=require(_0xfd1a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfd1a('0x9')][_0xfd1a('0xa')]({'port':0x232a});config[_0xfd1a('0xb')]=_[_0xfd1a('0xc')](config[_0xfd1a('0xb')],{'host':_0xfd1a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd1a('0xb')]));require('./team.socket')[_0xfd1a('0xe')](socket);function respondWithRpcPromise(_0x336271,_0x7a7e50,_0xc58945){return new BPromise(function(_0x2f4dc3,_0x361dae){return client[_0xfd1a('0xf')](_0x336271,_0xc58945)['then'](function(_0x325e76){logger[_0xfd1a('0x10')](_0xfd1a('0x11'),_0x7a7e50,_0xfd1a('0x12'));logger[_0xfd1a('0x13')](_0xfd1a('0x14'),_0x7a7e50,_0xfd1a('0x12'),JSON[_0xfd1a('0x15')](_0x325e76));if(_0x325e76[_0xfd1a('0x16')]){if(_0x325e76[_0xfd1a('0x16')][_0xfd1a('0x17')]===0x1f4){logger[_0xfd1a('0x16')]('Team,\x20%s,\x20%s',_0x7a7e50,_0x325e76[_0xfd1a('0x16')][_0xfd1a('0x18')]);return _0x361dae(_0x325e76[_0xfd1a('0x16')][_0xfd1a('0x18')]);}logger[_0xfd1a('0x16')](_0xfd1a('0x11'),_0x7a7e50,_0x325e76[_0xfd1a('0x16')][_0xfd1a('0x18')]);return _0x2f4dc3(_0x325e76[_0xfd1a('0x16')][_0xfd1a('0x18')]);}else{logger[_0xfd1a('0x10')]('Team,\x20%s,\x20%s',_0x7a7e50,_0xfd1a('0x12'));_0x2f4dc3(_0x325e76[_0xfd1a('0x19')][_0xfd1a('0x18')]);}})[_0xfd1a('0x1a')](function(_0x56d5e9){logger[_0xfd1a('0x16')](_0xfd1a('0x11'),_0x7a7e50,_0x56d5e9);_0x361dae(_0x56d5e9);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index ab48228..ffa7b3a 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 _0xf925=['removeListener','register','team:','update'];(function(_0x381856,_0xed1491){var _0x46166b=function(_0xc21391){while(--_0xc21391){_0x381856['push'](_0x381856['shift']());}};_0x46166b(++_0xed1491);}(_0xf925,0xb7));var _0x5f92=function(_0xb08b54,_0x149ec4){_0xb08b54=_0xb08b54-0x0;var _0x353ed9=_0xf925[_0xb08b54];return _0x353ed9;};'use strict';var TeamEvents=require('./team.events');var events=['save','remove',_0x5f92('0x0')];function createListener(_0x40e496,_0x3e409a){return function(_0x46b17f){_0x3e409a['emit'](_0x40e496,_0x46b17f);};}function removeListener(_0x7e44ac,_0x2973c5){return function(){TeamEvents[_0x5f92('0x1')](_0x7e44ac,_0x2973c5);};}exports[_0x5f92('0x2')]=function(_0x91d10c){for(var _0x3e2312=0x0,_0x1c7ad6=events['length'];_0x3e2312<_0x1c7ad6;_0x3e2312++){var _0x5acf64=events[_0x3e2312];var _0x487d6f=createListener(_0x5f92('0x3')+_0x5acf64,_0x91d10c);TeamEvents['on'](_0x5acf64,_0x487d6f);}}; \ No newline at end of file +var _0x38db=['register','length','./team.events','save','remove','update','emit','removeListener'];(function(_0x12dd11,_0x52b882){var _0x3a502b=function(_0x1a660d){while(--_0x1a660d){_0x12dd11['push'](_0x12dd11['shift']());}};_0x3a502b(++_0x52b882);}(_0x38db,0x6a));var _0xb38d=function(_0x46c3bb,_0x50d510){_0x46c3bb=_0x46c3bb-0x0;var _0x2bbdf8=_0x38db[_0x46c3bb];return _0x2bbdf8;};'use strict';var TeamEvents=require(_0xb38d('0x0'));var events=[_0xb38d('0x1'),_0xb38d('0x2'),_0xb38d('0x3')];function createListener(_0x3f9e3b,_0x2a252a){return function(_0x37ca30){_0x2a252a[_0xb38d('0x4')](_0x3f9e3b,_0x37ca30);};}function removeListener(_0x285532,_0x1e2b0e){return function(){TeamEvents[_0xb38d('0x5')](_0x285532,_0x1e2b0e);};}exports[_0xb38d('0x6')]=function(_0x36db37){for(var _0x3bd4fa=0x0,_0x8cbe00=events[_0xb38d('0x7')];_0x3bd4fa<_0x8cbe00;_0x3bd4fa++){var _0x1e53d3=events[_0x3bd4fa];var _0xc112c=createListener('team:'+_0x1e53d3,_0x36db37);TeamEvents['on'](_0x1e53d3,_0xc112c);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 87efb0d..e76ffad 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 _0xadf7=['INTEGER','sequelize'];(function(_0x1486ce,_0x233c7f){var _0x10a7b2=function(_0xd96f47){while(--_0xd96f47){_0x1486ce['push'](_0x1486ce['shift']());}};_0x10a7b2(++_0x233c7f);}(_0xadf7,0xb5));var _0x7adf=function(_0x141e0b,_0x2e2319){_0x141e0b=_0x141e0b-0x0;var _0x3178ec=_0xadf7[_0x141e0b];return _0x3178ec;};'use strict';var Sequelize=require(_0x7adf('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x7adf('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6a24=['exports','INTEGER','sequelize'];(function(_0x16499c,_0x58a914){var _0x5c5afe=function(_0x1cd8dc){while(--_0x1cd8dc){_0x16499c['push'](_0x16499c['shift']());}};_0x5c5afe(++_0x58a914);}(_0x6a24,0xd1));var _0x46a2=function(_0x15549e,_0x1b09ac){_0x15549e=_0x15549e-0x0;var _0x40f1df=_0x6a24[_0x15549e];return _0x40f1df;};'use strict';var Sequelize=require(_0x46a2('0x0'));module[_0x46a2('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x46a2('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 331f88a..ad44f33 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 _0x823c=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x6a0d31,_0xf59fef){var _0x2e99a1=function(_0x58d986){while(--_0x58d986){_0x6a0d31['push'](_0x6a0d31['shift']());}};_0x2e99a1(++_0xf59fef);}(_0x823c,0x143));var _0xc823=function(_0x1a1739,_0x5001b7){_0x1a1739=_0x1a1739-0x0;var _0x44280d=_0x823c[_0x1a1739];return _0x44280d;};'use strict';var _=require(_0xc823('0x0'));var util=require('util');var logger=require(_0xc823('0x1'))(_0xc823('0x2'));var moment=require(_0xc823('0x3'));var BPromise=require(_0xc823('0x4'));var rp=require(_0xc823('0x5'));var fs=require('fs');var path=require(_0xc823('0x6'));var rimraf=require('rimraf');var config=require(_0xc823('0x7'));var attributes=require(_0xc823('0x8'));module[_0xc823('0x9')]=function(_0x42e0c0,_0x380607){return _0x42e0c0['define'](_0xc823('0xa'),attributes,{'tableName':_0xc823('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd10f=['lodash','util','../../config/logger','api','moment','request-promise','path','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd10f,0x198));var _0xfd10=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd10f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xfd10('0x0'));var util=require(_0xfd10('0x1'));var logger=require(_0xfd10('0x2'))(_0xfd10('0x3'));var moment=require(_0xfd10('0x4'));var BPromise=require('bluebird');var rp=require(_0xfd10('0x5'));var fs=require('fs');var path=require(_0xfd10('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfd10('0x7'));module[_0xfd10('0x8')]=function(_0x3f9cdd,_0x10a20f){return _0x3f9cdd[_0xfd10('0x9')](_0xfd10('0xa'),attributes,{'tableName':_0xfd10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index f901c35..01a2eb0 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x34fe88,_0x36a469){var _0x3d6cd0=function(_0x3e4fea){while(--_0x3e4fea){_0x34fe88['push'](_0x34fe88['shift']());}};_0x3d6cd0(++_0x36a469);}(_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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xd72a5a,_0x5a3173){var _0x11c401=function(_0x32ce84){while(--_0x32ce84){_0xd72a5a['push'](_0xd72a5a['shift']());}};_0x11c401(++_0x5a3173);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x257a28,_0x2cd00d){_0x257a28=_0x257a28-0x0;var _0x13bccc=_0xcb91[_0x257a28];return _0x13bccc;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 01faeff..d06c9e3 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 _0xaf43=['exports','INTEGER'];(function(_0x45afc1,_0x52a029){var _0x182539=function(_0x547e72){while(--_0x547e72){_0x45afc1['push'](_0x45afc1['shift']());}};_0x182539(++_0x52a029);}(_0xaf43,0x182));var _0x3af4=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xaf43[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require('sequelize');module[_0x3af4('0x0')]={'penalty':{'type':Sequelize[_0x3af4('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7715=['sequelize','exports'];(function(_0x459dd1,_0x38dfa0){var _0xb87e44=function(_0x3ed4de){while(--_0x3ed4de){_0x459dd1['push'](_0x459dd1['shift']());}};_0xb87e44(++_0x38dfa0);}(_0x7715,0x19e));var _0x5771=function(_0x39a5e9,_0x5906dd){_0x39a5e9=_0x39a5e9-0x0;var _0x1d5312=_0x7715[_0x39a5e9];return _0x1d5312;};'use strict';var Sequelize=require(_0x5771('0x0'));module[_0x5771('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 17a55e0..bf574d3 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 _0x861a=['bluebird','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger','api','moment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x861a,0x194));var _0xa861=function(_0x2ae381,_0x58c00e){_0x2ae381=_0x2ae381-0x0;var _0x199fdb=_0x861a[_0x2ae381];return _0x199fdb;};'use strict';var _=require(_0xa861('0x0'));var util=require('util');var logger=require(_0xa861('0x1'))(_0xa861('0x2'));var moment=require(_0xa861('0x3'));var BPromise=require(_0xa861('0x4'));var rp=require(_0xa861('0x5'));var fs=require('fs');var path=require(_0xa861('0x6'));var rimraf=require('rimraf');var config=require(_0xa861('0x7'));var attributes=require(_0xa861('0x8'));module[_0xa861('0x9')]=function(_0x1a9322,_0x247b78){return _0x1a9322['define'](_0xa861('0xa'),attributes,{'tableName':_0xa861('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb99=['../../config/logger','bluebird','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','lodash'];(function(_0x585e0d,_0x1ca0c0){var _0x5a0e19=function(_0x11da6b){while(--_0x11da6b){_0x585e0d['push'](_0x585e0d['shift']());}};_0x5a0e19(++_0x1ca0c0);}(_0xcb99,0x8b));var _0x9cb9=function(_0x1b54f5,_0x83ee6a){_0x1b54f5=_0x1b54f5-0x0;var _0x3b9975=_0xcb99[_0x1b54f5];return _0x3b9975;};'use strict';var _=require(_0x9cb9('0x0'));var util=require('util');var logger=require(_0x9cb9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9cb9('0x2'));var rp=require(_0x9cb9('0x3'));var fs=require('fs');var path=require(_0x9cb9('0x4'));var rimraf=require('rimraf');var config=require(_0x9cb9('0x5'));var attributes=require(_0x9cb9('0x6'));module['exports']=function(_0x214b72,_0x509cfc){return _0x214b72[_0x9cb9('0x7')](_0x9cb9('0x8'),attributes,{'tableName':_0x9cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index a553a0b..1f2e6e2 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 _0xaef2=['TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x5b2d1a,_0x4a3eb4){var _0x19a96e=function(_0x36eab7){while(--_0x36eab7){_0x5b2d1a['push'](_0x5b2d1a['shift']());}};_0x19a96e(++_0x4a3eb4);}(_0xaef2,0x138));var _0x2aef=function(_0x22cff2,_0x5ad3ed){_0x22cff2=_0x22cff2-0x0;var _0x27b388=_0xaef2[_0x22cff2];return _0x27b388;};'use strict';var _=require(_0x2aef('0x0'));var util=require(_0x2aef('0x1'));var moment=require(_0x2aef('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2aef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2aef('0x4'));var logger=require(_0x2aef('0x5'))(_0x2aef('0x6'));var config=require(_0x2aef('0x7'));var jayson=require(_0x2aef('0x8'));var client=jayson[_0x2aef('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f43d5,_0x1d90f0,_0x11c9cf){return new BPromise(function(_0xd5e3ff,_0x1e5c53){return client[_0x2aef('0xa')](_0x1f43d5,_0x11c9cf)['then'](function(_0x13e942){logger[_0x2aef('0xb')](_0x2aef('0xc'),_0x1d90f0,_0x2aef('0xd'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x1d90f0,_0x2aef('0xd'),JSON[_0x2aef('0xe')](_0x13e942));if(_0x13e942[_0x2aef('0xf')]){if(_0x13e942[_0x2aef('0xf')]['code']===0x1f4){logger[_0x2aef('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1d90f0,_0x13e942[_0x2aef('0xf')]['message']);return _0x1e5c53(_0x13e942[_0x2aef('0xf')][_0x2aef('0x10')]);}logger['error'](_0x2aef('0xc'),_0x1d90f0,_0x13e942[_0x2aef('0xf')]['message']);return _0xd5e3ff(_0x13e942[_0x2aef('0xf')][_0x2aef('0x10')]);}else{logger[_0x2aef('0xb')](_0x2aef('0xc'),_0x1d90f0,_0x2aef('0xd'));_0xd5e3ff(_0x13e942['result']['message']);}})[_0x2aef('0x11')](function(_0x526316){logger[_0x2aef('0xf')](_0x2aef('0xc'),_0x1d90f0,_0x526316);_0x1e5c53(_0x526316);});});} \ No newline at end of file +var _0x67c8=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','ioredis'];(function(_0x3c9f56,_0x198760){var _0x33f1be=function(_0x1ab06a){while(--_0x1ab06a){_0x3c9f56['push'](_0x3c9f56['shift']());}};_0x33f1be(++_0x198760);}(_0x67c8,0x1c7));var _0x867c=function(_0x8e2022,_0x4554a3){_0x8e2022=_0x8e2022-0x0;var _0x593582=_0x67c8[_0x8e2022];return _0x593582;};'use strict';var _=require(_0x867c('0x0'));var util=require(_0x867c('0x1'));var moment=require(_0x867c('0x2'));var BPromise=require('bluebird');var rs=require(_0x867c('0x3'));var fs=require('fs');var Redis=require(_0x867c('0x4'));var db=require(_0x867c('0x5'))['db'];var utils=require(_0x867c('0x6'));var logger=require('../../config/logger')(_0x867c('0x7'));var config=require(_0x867c('0x8'));var jayson=require(_0x867c('0x9'));var client=jayson[_0x867c('0xa')][_0x867c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3785e4,_0x38d919,_0x144c79){return new BPromise(function(_0x1c2c91,_0x37e855){return client[_0x867c('0xc')](_0x3785e4,_0x144c79)[_0x867c('0xd')](function(_0x545ed2){logger[_0x867c('0xe')](_0x867c('0xf'),_0x38d919,_0x867c('0x10'));logger[_0x867c('0x11')](_0x867c('0x12'),_0x38d919,'request\x20sent',JSON[_0x867c('0x13')](_0x545ed2));if(_0x545ed2[_0x867c('0x14')]){if(_0x545ed2['error'][_0x867c('0x15')]===0x1f4){logger['error'](_0x867c('0xf'),_0x38d919,_0x545ed2[_0x867c('0x14')][_0x867c('0x16')]);return _0x37e855(_0x545ed2[_0x867c('0x14')][_0x867c('0x16')]);}logger[_0x867c('0x14')](_0x867c('0xf'),_0x38d919,_0x545ed2['error'][_0x867c('0x16')]);return _0x1c2c91(_0x545ed2[_0x867c('0x14')][_0x867c('0x16')]);}else{logger[_0x867c('0xe')](_0x867c('0xf'),_0x38d919,_0x867c('0x10'));_0x1c2c91(_0x545ed2['result'][_0x867c('0x16')]);}})['catch'](function(_0x48a0e3){logger[_0x867c('0x14')](_0x867c('0xf'),_0x38d919,_0x48a0e3);_0x37e855(_0x48a0e3);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 5fdc9e4..1d3f3f8 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 _0xa908=['../../components/auth/service','../../components/interaction/service','./template.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x140d6f,_0x5303f8){var _0x56cce4=function(_0x5e94a9){while(--_0x5e94a9){_0x140d6f['push'](_0x140d6f['shift']());}};_0x56cce4(++_0x5303f8);}(_0xa908,0x1c3));var _0x8a90=function(_0x4ad553,_0x586c5a){_0x4ad553=_0x4ad553-0x0;var _0x136750=_0xa908[_0x4ad553];return _0x136750;};'use strict';var multer=require(_0x8a90('0x0'));var util=require('util');var path=require(_0x8a90('0x1'));var timeout=require('connect-timeout');var express=require(_0x8a90('0x2'));var router=express[_0x8a90('0x3')]();var fs_extra=require(_0x8a90('0x4'));var auth=require(_0x8a90('0x5'));var interaction=require(_0x8a90('0x6'));var config=require('../../config/environment');var controller=require(_0x8a90('0x7'));router[_0x8a90('0x8')]('/',auth['isAuthenticated'](),controller[_0x8a90('0x9')]);router[_0x8a90('0x8')](_0x8a90('0xa'),auth[_0x8a90('0xb')](),controller[_0x8a90('0xc')]);router[_0x8a90('0xd')]('/',auth['isAuthenticated'](),controller[_0x8a90('0xe')]);router['put'](_0x8a90('0xa'),auth['isAuthenticated'](),controller[_0x8a90('0xf')]);router[_0x8a90('0x10')](_0x8a90('0xa'),auth[_0x8a90('0xb')](),controller[_0x8a90('0x11')]);module[_0x8a90('0x12')]=router; \ No newline at end of file +var _0x29b6=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','post','put','update','delete'];(function(_0x40bf7c,_0x5a5665){var _0x84adfd=function(_0xc505ce){while(--_0xc505ce){_0x40bf7c['push'](_0x40bf7c['shift']());}};_0x84adfd(++_0x5a5665);}(_0x29b6,0x17e));var _0x629b=function(_0x384b27,_0x213eb8){_0x384b27=_0x384b27-0x0;var _0x124803=_0x29b6[_0x384b27];return _0x124803;};'use strict';var multer=require(_0x629b('0x0'));var util=require(_0x629b('0x1'));var path=require(_0x629b('0x2'));var timeout=require(_0x629b('0x3'));var express=require(_0x629b('0x4'));var router=express[_0x629b('0x5')]();var fs_extra=require(_0x629b('0x6'));var auth=require(_0x629b('0x7'));var interaction=require(_0x629b('0x8'));var config=require(_0x629b('0x9'));var controller=require('./template.controller');router[_0x629b('0xa')]('/',auth['isAuthenticated'](),controller[_0x629b('0xb')]);router[_0x629b('0xa')](_0x629b('0xc'),auth[_0x629b('0xd')](),controller['show']);router[_0x629b('0xe')]('/',auth[_0x629b('0xd')](),controller['create']);router[_0x629b('0xf')](_0x629b('0xc'),auth[_0x629b('0xd')](),controller[_0x629b('0x10')]);router[_0x629b('0x11')](_0x629b('0xc'),auth[_0x629b('0xd')](),controller[_0x629b('0x12')]);module[_0x629b('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 9d9456a..44ff206 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 _0xac12=['exports','STRING','TEXT','sequelize'];(function(_0x29e7ed,_0x29397d){var _0x15eaa7=function(_0x31fb10){while(--_0x31fb10){_0x29e7ed['push'](_0x29e7ed['shift']());}};_0x15eaa7(++_0x29397d);}(_0xac12,0x133));var _0x2ac1=function(_0x9a06f0,_0x5db000){_0x9a06f0=_0x9a06f0-0x0;var _0x53f935=_0xac12[_0x9a06f0];return _0x53f935;};'use strict';var Sequelize=require(_0x2ac1('0x0'));module[_0x2ac1('0x1')]={'name':{'type':Sequelize[_0x2ac1('0x2')]},'description':{'type':Sequelize[_0x2ac1('0x2')]},'html':{'type':Sequelize[_0x2ac1('0x3')]}}; \ No newline at end of file +var _0xf5df=['TEXT','sequelize','exports','STRING'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xf5df,0x101));var _0xff5d=function(_0x11484f,_0x42d487){_0x11484f=_0x11484f-0x0;var _0x3c6ff1=_0xf5df[_0x11484f];return _0x3c6ff1;};'use strict';var Sequelize=require(_0xff5d('0x0'));module[_0xff5d('0x1')]={'name':{'type':Sequelize[_0xff5d('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xff5d('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index b2bc89c..dfb32e5 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 _0x45dd=['params','rawAttributes','length','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Templates','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','Template','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x45dd,0x162));var _0xd45d=function(_0x40f978,_0x451eda){_0x40f978=_0x40f978-0x0;var _0x321fab=_0x45dd[_0x40f978];return _0x321fab;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd45d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd45d('0x1'));var moment=require('moment');var BPromise=require(_0xd45d('0x2'));var Mustache=require('mustache');var util=require(_0xd45d('0x3'));var path=require(_0xd45d('0x4'));var sox=require('sox');var csv=require(_0xd45d('0x5'));var ejs=require(_0xd45d('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd45d('0x7'));var squel=require(_0xd45d('0x8'));var crypto=require(_0xd45d('0x9'));var jsforce=require(_0xd45d('0xa'));var deskjs=require(_0xd45d('0xb'));var toCsv=require(_0xd45d('0x5'));var querystring=require(_0xd45d('0xc'));var Papa=require(_0xd45d('0xd'));var Redis=require(_0xd45d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd45d('0xf'));var as=require(_0xd45d('0x10'));var hardwareService=require(_0xd45d('0x11'));var logger=require(_0xd45d('0x12'))(_0xd45d('0x13'));var utils=require('../../config/utils');var config=require(_0xd45d('0x14'));var licenseUtil=require(_0xd45d('0x15'));var db=require(_0xd45d('0x16'))['db'];function respondWithStatusCode(_0x8628ac,_0x150675){_0x150675=_0x150675||0xcc;return function(_0x356eb0){if(_0x356eb0){return _0x8628ac[_0xd45d('0x17')](_0x150675);}return _0x8628ac[_0xd45d('0x18')](_0x150675)['end']();};}function respondWithResult(_0xa91e79,_0x1f9b6d){_0x1f9b6d=_0x1f9b6d||0xc8;return function(_0x3f6301){if(_0x3f6301){return _0xa91e79[_0xd45d('0x18')](_0x1f9b6d)['json'](_0x3f6301);}};}function respondWithFilteredResult(_0x5501be,_0x18d3b6){return function(_0x47296b){if(_0x47296b){var _0x58e5e4=typeof _0x18d3b6['offset']===_0xd45d('0x19')&&typeof _0x18d3b6[_0xd45d('0x1a')]===_0xd45d('0x19');var _0x38d0b5=_0x47296b[_0xd45d('0x1b')];var _0x3efdc4=_0x58e5e4?0x0:_0x18d3b6['offset'];var _0x2e71df=_0x58e5e4?_0x47296b[_0xd45d('0x1b')]:_0x18d3b6[_0xd45d('0x1c')]+_0x18d3b6[_0xd45d('0x1a')];var _0x46f761;if(_0x2e71df>=_0x38d0b5){_0x2e71df=_0x38d0b5;_0x46f761=0xc8;}else{_0x46f761=0xce;}_0x5501be[_0xd45d('0x18')](_0x46f761);return _0x5501be[_0xd45d('0x1d')](_0xd45d('0x1e'),_0x3efdc4+'-'+_0x2e71df+'/'+_0x38d0b5)[_0xd45d('0x1f')](_0x47296b);}return null;};}function patchUpdates(_0x22044a){return function(_0x2c3146){try{jsonpatch[_0xd45d('0x20')](_0x2c3146,_0x22044a,!![]);}catch(_0x35c676){return BPromise[_0xd45d('0x21')](_0x35c676);}return _0x2c3146[_0xd45d('0x22')]();};}function saveUpdates(_0x3b7669,_0x3db556){return function(_0x56314f){if(_0x56314f){return _0x56314f[_0xd45d('0x23')](_0x3b7669)[_0xd45d('0x24')](function(_0x2bf0f5){return _0x2bf0f5;});}return null;};}function removeEntity(_0x343e36,_0x358fcd){return function(_0x206f3d){if(_0x206f3d){return _0x206f3d[_0xd45d('0x25')]()['then'](function(){var _0x1439b1=_0x206f3d['get']({'plain':!![]});var _0x116f24='Templates';return db[_0xd45d('0x26')][_0xd45d('0x25')]({'where':{'type':_0x116f24,'resourceId':_0x1439b1['id']}})[_0xd45d('0x24')](function(){return _0x206f3d;});})[_0xd45d('0x24')](function(){_0x343e36['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x452df5,_0x76a9bb){return function(_0x160d78){if(!_0x160d78){_0x452df5['sendStatus'](0x194);}return _0x160d78;};}function handleError(_0x2cfb95,_0x51a191){_0x51a191=_0x51a191||0x1f4;return function(_0x5d297f){logger[_0xd45d('0x27')](_0x5d297f[_0xd45d('0x28')]);if(_0x5d297f['name']){delete _0x5d297f[_0xd45d('0x29')];}_0x2cfb95[_0xd45d('0x18')](_0x51a191)[_0xd45d('0x2a')](_0x5d297f);};}exports[_0xd45d('0x2b')]=function(_0x18bf79,_0x3fe5ee){var _0x111db0={},_0x157ab4={},_0x423d96={'count':0x0,'rows':[]};var _0x23bf23=_[_0xd45d('0x2c')](db[_0xd45d('0x2d')]['rawAttributes'],function(_0x4c3f35){return{'name':_0x4c3f35[_0xd45d('0x2e')],'type':_0x4c3f35[_0xd45d('0x2f')][_0xd45d('0x30')]};});_0x157ab4[_0xd45d('0x31')]=_[_0xd45d('0x2c')](_0x23bf23,_0xd45d('0x29'));_0x157ab4[_0xd45d('0x32')]=_[_0xd45d('0x33')](_0x18bf79[_0xd45d('0x32')]);_0x157ab4[_0xd45d('0x34')]=_[_0xd45d('0x35')](_0x157ab4[_0xd45d('0x31')],_0x157ab4[_0xd45d('0x32')]);_0x111db0[_0xd45d('0x36')]=_[_0xd45d('0x35')](_0x157ab4[_0xd45d('0x31')],qs[_0xd45d('0x37')](_0x18bf79['query'][_0xd45d('0x37')]));_0x111db0[_0xd45d('0x36')]=_0x111db0['attributes']['length']?_0x111db0[_0xd45d('0x36')]:_0x157ab4[_0xd45d('0x31')];if(!_0x18bf79[_0xd45d('0x32')][_0xd45d('0x38')](_0xd45d('0x39'))){_0x111db0['limit']=qs[_0xd45d('0x1a')](_0x18bf79[_0xd45d('0x32')][_0xd45d('0x1a')]);_0x111db0[_0xd45d('0x1c')]=qs[_0xd45d('0x1c')](_0x18bf79[_0xd45d('0x32')][_0xd45d('0x1c')]);}_0x111db0[_0xd45d('0x3a')]=qs[_0xd45d('0x3b')](_0x18bf79[_0xd45d('0x32')][_0xd45d('0x3b')]);_0x111db0[_0xd45d('0x3c')]=qs[_0xd45d('0x34')](_[_0xd45d('0x3d')](_0x18bf79[_0xd45d('0x32')],_0x157ab4[_0xd45d('0x34')]),_0x23bf23);if(_0x18bf79[_0xd45d('0x32')][_0xd45d('0x3e')]){_0x111db0['where']=_[_0xd45d('0x3f')](_0x111db0[_0xd45d('0x3c')],{'$or':_[_0xd45d('0x2c')](_0x23bf23,function(_0x169c81){if(_0x169c81['type']!==_0xd45d('0x40')){var _0x78efd2={};_0x78efd2[_0x169c81[_0xd45d('0x29')]]={'$like':'%'+_0x18bf79[_0xd45d('0x32')][_0xd45d('0x3e')]+'%'};return _0x78efd2;}})});}_0x111db0=_[_0xd45d('0x3f')]({},_0x111db0,_0x18bf79[_0xd45d('0x41')]);var _0x5db53f={'where':_0x111db0[_0xd45d('0x3c')]};return db[_0xd45d('0x2d')][_0xd45d('0x1b')](_0x5db53f)[_0xd45d('0x24')](function(_0x535f05){_0x423d96['count']=_0x535f05;if(_0x18bf79[_0xd45d('0x32')][_0xd45d('0x42')]){_0x111db0[_0xd45d('0x43')]=[{'all':!![]}];}return db[_0xd45d('0x2d')]['findAll'](_0x111db0);})[_0xd45d('0x24')](function(_0x3a2517){_0x423d96[_0xd45d('0x44')]=_0x3a2517;return _0x423d96;})['then'](respondWithFilteredResult(_0x3fe5ee,_0x111db0))[_0xd45d('0x45')](handleError(_0x3fe5ee,null));};exports[_0xd45d('0x46')]=function(_0x28244c,_0x4a6b49){var _0x40517c={'raw':!![],'where':{'id':_0x28244c[_0xd45d('0x47')]['id']}},_0x21ffb6={};_0x21ffb6['model']=_['keys'](db[_0xd45d('0x2d')][_0xd45d('0x48')]);_0x21ffb6[_0xd45d('0x32')]=_['keys'](_0x28244c[_0xd45d('0x32')]);_0x21ffb6[_0xd45d('0x34')]=_[_0xd45d('0x35')](_0x21ffb6['model'],_0x21ffb6[_0xd45d('0x32')]);_0x40517c['attributes']=_[_0xd45d('0x35')](_0x21ffb6['model'],qs[_0xd45d('0x37')](_0x28244c[_0xd45d('0x32')][_0xd45d('0x37')]));_0x40517c[_0xd45d('0x36')]=_0x40517c[_0xd45d('0x36')][_0xd45d('0x49')]?_0x40517c['attributes']:_0x21ffb6['model'];if(_0x28244c[_0xd45d('0x32')][_0xd45d('0x42')]){_0x40517c['include']=[{'all':!![]}];}_0x40517c=_['merge']({},_0x40517c,_0x28244c['options']);return db[_0xd45d('0x2d')][_0xd45d('0x4a')](_0x40517c)[_0xd45d('0x24')](handleEntityNotFound(_0x4a6b49,null))[_0xd45d('0x24')](respondWithResult(_0x4a6b49,null))[_0xd45d('0x45')](handleError(_0x4a6b49,null));};exports[_0xd45d('0x4b')]=function(_0x4189db,_0xbea6cc){return db[_0xd45d('0x2d')][_0xd45d('0x4b')](_0x4189db['body'],{})[_0xd45d('0x24')](function(_0x400ee9){var _0x1f507=_0x4189db['user'][_0xd45d('0x4c')]({'plain':!![]});if(!_0x1f507)throw new Error(_0xd45d('0x4d'));if(_0x1f507['role']===_0xd45d('0x4e')){var _0x2c52bc=_0x400ee9[_0xd45d('0x4c')]({'plain':!![]});var _0x225382=_0xd45d('0x4f');return db[_0xd45d('0x50')][_0xd45d('0x4a')]({'where':{'name':_0x225382,'userProfileId':_0x1f507[_0xd45d('0x51')]},'raw':!![]})[_0xd45d('0x24')](function(_0x2aacf9){if(_0x2aacf9&&_0x2aacf9[_0xd45d('0x52')]===0x0){return db[_0xd45d('0x26')][_0xd45d('0x4b')]({'name':_0x2c52bc['name'],'resourceId':_0x2c52bc['id'],'type':_0x2aacf9['name'],'sectionId':_0x2aacf9['id']},{})[_0xd45d('0x24')](function(){return _0x400ee9;});}else{return _0x400ee9;}})[_0xd45d('0x45')](function(_0x230dc0){logger['error'](_0xd45d('0x53'),_0x230dc0);throw _0x230dc0;});}return _0x400ee9;})[_0xd45d('0x24')](respondWithResult(_0xbea6cc,0xc9))[_0xd45d('0x45')](handleError(_0xbea6cc,null));};exports[_0xd45d('0x23')]=function(_0x19c9bb,_0x22a48e){if(_0x19c9bb[_0xd45d('0x54')]['id']){delete _0x19c9bb[_0xd45d('0x54')]['id'];}return db[_0xd45d('0x2d')][_0xd45d('0x4a')]({'where':{'id':_0x19c9bb['params']['id']}})[_0xd45d('0x24')](handleEntityNotFound(_0x22a48e,null))['then'](saveUpdates(_0x19c9bb['body'],null))[_0xd45d('0x24')](respondWithResult(_0x22a48e,null))[_0xd45d('0x45')](handleError(_0x22a48e,null));};exports[_0xd45d('0x25')]=function(_0x5cce4e,_0x557ed2){return db['Template'][_0xd45d('0x4a')]({'where':{'id':_0x5cce4e[_0xd45d('0x47')]['id']}})[_0xd45d('0x24')](handleEntityNotFound(_0x557ed2,null))[_0xd45d('0x24')](removeEntity(_0x557ed2,null))[_0xd45d('0x45')](handleError(_0x557ed2,null));}; \ No newline at end of file +var _0xcb7b=['../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','get','Templates','UserProfileResource','destroy','end','name','send','map','Template','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','error','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3cec45,_0x37d817){var _0x51d691=function(_0x2c671f){while(--_0x2c671f){_0x3cec45['push'](_0x3cec45['shift']());}};_0x51d691(++_0x37d817);}(_0xcb7b,0x172));var _0xbcb7=function(_0x457d7e,_0x4bc494){_0x457d7e=_0x457d7e-0x0;var _0x5ddeaa=_0xcb7b[_0x457d7e];return _0x5ddeaa;};'use strict';var emlformat=require(_0xbcb7('0x0'));var rimraf=require(_0xbcb7('0x1'));var zipdir=require(_0xbcb7('0x2'));var jsonpatch=require(_0xbcb7('0x3'));var rp=require(_0xbcb7('0x4'));var moment=require(_0xbcb7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbcb7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbcb7('0x7'));var ejs=require(_0xbcb7('0x8'));var fs=require('fs');var fs_extra=require(_0xbcb7('0x9'));var _=require(_0xbcb7('0xa'));var squel=require(_0xbcb7('0xb'));var crypto=require('crypto');var jsforce=require(_0xbcb7('0xc'));var deskjs=require(_0xbcb7('0xd'));var toCsv=require(_0xbcb7('0x7'));var querystring=require(_0xbcb7('0xe'));var Papa=require(_0xbcb7('0xf'));var Redis=require('ioredis');var authService=require(_0xbcb7('0x10'));var qs=require(_0xbcb7('0x11'));var as=require(_0xbcb7('0x12'));var hardwareService=require(_0xbcb7('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xbcb7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbcb7('0x15'))['db'];function respondWithStatusCode(_0x112fc1,_0xbfd544){_0xbfd544=_0xbfd544||0xcc;return function(_0x4f3b63){if(_0x4f3b63){return _0x112fc1[_0xbcb7('0x16')](_0xbfd544);}return _0x112fc1[_0xbcb7('0x17')](_0xbfd544)['end']();};}function respondWithResult(_0x50d49f,_0x11ade8){_0x11ade8=_0x11ade8||0xc8;return function(_0x4c3d0f){if(_0x4c3d0f){return _0x50d49f['status'](_0x11ade8)[_0xbcb7('0x18')](_0x4c3d0f);}};}function respondWithFilteredResult(_0xe7bd5f,_0x3383f4){return function(_0x364051){if(_0x364051){var _0x5543c4=typeof _0x3383f4[_0xbcb7('0x19')]===_0xbcb7('0x1a')&&typeof _0x3383f4[_0xbcb7('0x1b')]===_0xbcb7('0x1a');var _0x19af24=_0x364051['count'];var _0x2e3468=_0x5543c4?0x0:_0x3383f4[_0xbcb7('0x19')];var _0x2ce2ad=_0x5543c4?_0x364051['count']:_0x3383f4[_0xbcb7('0x19')]+_0x3383f4[_0xbcb7('0x1b')];var _0x4c9855;if(_0x2ce2ad>=_0x19af24){_0x2ce2ad=_0x19af24;_0x4c9855=0xc8;}else{_0x4c9855=0xce;}_0xe7bd5f[_0xbcb7('0x17')](_0x4c9855);return _0xe7bd5f[_0xbcb7('0x1c')](_0xbcb7('0x1d'),_0x2e3468+'-'+_0x2ce2ad+'/'+_0x19af24)[_0xbcb7('0x18')](_0x364051);}return null;};}function patchUpdates(_0x54c520){return function(_0xf94d0f){try{jsonpatch[_0xbcb7('0x1e')](_0xf94d0f,_0x54c520,!![]);}catch(_0x5ef644){return BPromise[_0xbcb7('0x1f')](_0x5ef644);}return _0xf94d0f[_0xbcb7('0x20')]();};}function saveUpdates(_0x44e409,_0x178885){return function(_0x439ab1){if(_0x439ab1){return _0x439ab1[_0xbcb7('0x21')](_0x44e409)[_0xbcb7('0x22')](function(_0x794924){return _0x794924;});}return null;};}function removeEntity(_0xb2a537,_0x4533a7){return function(_0x5c8866){if(_0x5c8866){return _0x5c8866['destroy']()[_0xbcb7('0x22')](function(){var _0x565403=_0x5c8866[_0xbcb7('0x23')]({'plain':!![]});var _0xc10eb4=_0xbcb7('0x24');return db[_0xbcb7('0x25')][_0xbcb7('0x26')]({'where':{'type':_0xc10eb4,'resourceId':_0x565403['id']}})['then'](function(){return _0x5c8866;});})[_0xbcb7('0x22')](function(){_0xb2a537[_0xbcb7('0x17')](0xcc)[_0xbcb7('0x27')]();});}};}function handleEntityNotFound(_0x2f0d8b,_0x13c5db){return function(_0x575557){if(!_0x575557){_0x2f0d8b['sendStatus'](0x194);}return _0x575557;};}function handleError(_0x392232,_0x5f15dd){_0x5f15dd=_0x5f15dd||0x1f4;return function(_0xfd8760){logger['error'](_0xfd8760['stack']);if(_0xfd8760[_0xbcb7('0x28')]){delete _0xfd8760[_0xbcb7('0x28')];}_0x392232[_0xbcb7('0x17')](_0x5f15dd)[_0xbcb7('0x29')](_0xfd8760);};}exports['index']=function(_0x406b14,_0x18451a){var _0xf0f82f={},_0x144bcf={},_0x49d023={'count':0x0,'rows':[]};var _0x4aeffa=_[_0xbcb7('0x2a')](db[_0xbcb7('0x2b')][_0xbcb7('0x2c')],function(_0x802b59){return{'name':_0x802b59['fieldName'],'type':_0x802b59[_0xbcb7('0x2d')][_0xbcb7('0x2e')]};});_0x144bcf[_0xbcb7('0x2f')]=_[_0xbcb7('0x2a')](_0x4aeffa,_0xbcb7('0x28'));_0x144bcf[_0xbcb7('0x30')]=_[_0xbcb7('0x31')](_0x406b14[_0xbcb7('0x30')]);_0x144bcf[_0xbcb7('0x32')]=_[_0xbcb7('0x33')](_0x144bcf[_0xbcb7('0x2f')],_0x144bcf[_0xbcb7('0x30')]);_0xf0f82f['attributes']=_[_0xbcb7('0x33')](_0x144bcf[_0xbcb7('0x2f')],qs[_0xbcb7('0x34')](_0x406b14[_0xbcb7('0x30')][_0xbcb7('0x34')]));_0xf0f82f[_0xbcb7('0x35')]=_0xf0f82f[_0xbcb7('0x35')]['length']?_0xf0f82f[_0xbcb7('0x35')]:_0x144bcf[_0xbcb7('0x2f')];if(!_0x406b14[_0xbcb7('0x30')]['hasOwnProperty']('nolimit')){_0xf0f82f[_0xbcb7('0x1b')]=qs['limit'](_0x406b14['query'][_0xbcb7('0x1b')]);_0xf0f82f[_0xbcb7('0x19')]=qs[_0xbcb7('0x19')](_0x406b14['query'][_0xbcb7('0x19')]);}_0xf0f82f[_0xbcb7('0x36')]=qs[_0xbcb7('0x37')](_0x406b14['query']['sort']);_0xf0f82f[_0xbcb7('0x38')]=qs['filters'](_[_0xbcb7('0x39')](_0x406b14['query'],_0x144bcf[_0xbcb7('0x32')]),_0x4aeffa);if(_0x406b14[_0xbcb7('0x30')][_0xbcb7('0x3a')]){_0xf0f82f[_0xbcb7('0x38')]=_[_0xbcb7('0x3b')](_0xf0f82f[_0xbcb7('0x38')],{'$or':_[_0xbcb7('0x2a')](_0x4aeffa,function(_0xb7868){if(_0xb7868[_0xbcb7('0x2d')]!==_0xbcb7('0x3c')){var _0x4ff295={};_0x4ff295[_0xb7868[_0xbcb7('0x28')]]={'$like':'%'+_0x406b14[_0xbcb7('0x30')][_0xbcb7('0x3a')]+'%'};return _0x4ff295;}})});}_0xf0f82f=_[_0xbcb7('0x3b')]({},_0xf0f82f,_0x406b14[_0xbcb7('0x3d')]);var _0x223b45={'where':_0xf0f82f[_0xbcb7('0x38')]};return db['Template'][_0xbcb7('0x3e')](_0x223b45)[_0xbcb7('0x22')](function(_0x123b86){_0x49d023[_0xbcb7('0x3e')]=_0x123b86;if(_0x406b14[_0xbcb7('0x30')][_0xbcb7('0x3f')]){_0xf0f82f[_0xbcb7('0x40')]=[{'all':!![]}];}return db[_0xbcb7('0x2b')][_0xbcb7('0x41')](_0xf0f82f);})['then'](function(_0x49dfc9){_0x49d023['rows']=_0x49dfc9;return _0x49d023;})[_0xbcb7('0x22')](respondWithFilteredResult(_0x18451a,_0xf0f82f))[_0xbcb7('0x42')](handleError(_0x18451a,null));};exports[_0xbcb7('0x43')]=function(_0x95ea2e,_0x1bfa50){var _0x2c13bc={'raw':!![],'where':{'id':_0x95ea2e['params']['id']}},_0x4f840d={};_0x4f840d['model']=_[_0xbcb7('0x31')](db[_0xbcb7('0x2b')][_0xbcb7('0x2c')]);_0x4f840d[_0xbcb7('0x30')]=_['keys'](_0x95ea2e[_0xbcb7('0x30')]);_0x4f840d[_0xbcb7('0x32')]=_[_0xbcb7('0x33')](_0x4f840d[_0xbcb7('0x2f')],_0x4f840d[_0xbcb7('0x30')]);_0x2c13bc[_0xbcb7('0x35')]=_[_0xbcb7('0x33')](_0x4f840d[_0xbcb7('0x2f')],qs[_0xbcb7('0x34')](_0x95ea2e[_0xbcb7('0x30')][_0xbcb7('0x34')]));_0x2c13bc['attributes']=_0x2c13bc[_0xbcb7('0x35')]['length']?_0x2c13bc[_0xbcb7('0x35')]:_0x4f840d['model'];if(_0x95ea2e[_0xbcb7('0x30')][_0xbcb7('0x3f')]){_0x2c13bc[_0xbcb7('0x40')]=[{'all':!![]}];}_0x2c13bc=_[_0xbcb7('0x3b')]({},_0x2c13bc,_0x95ea2e['options']);return db[_0xbcb7('0x2b')][_0xbcb7('0x44')](_0x2c13bc)[_0xbcb7('0x22')](handleEntityNotFound(_0x1bfa50,null))[_0xbcb7('0x22')](respondWithResult(_0x1bfa50,null))[_0xbcb7('0x42')](handleError(_0x1bfa50,null));};exports[_0xbcb7('0x45')]=function(_0x5af5e3,_0x541f11){return db[_0xbcb7('0x2b')][_0xbcb7('0x45')](_0x5af5e3[_0xbcb7('0x46')],{})['then'](function(_0xbc87c1){var _0xc51463=_0x5af5e3['user']['get']({'plain':!![]});if(!_0xc51463)throw new Error(_0xbcb7('0x47'));if(_0xc51463['role']===_0xbcb7('0x48')){var _0x269174=_0xbc87c1[_0xbcb7('0x23')]({'plain':!![]});var _0x3b468b=_0xbcb7('0x24');return db[_0xbcb7('0x49')][_0xbcb7('0x44')]({'where':{'name':_0x3b468b,'userProfileId':_0xc51463[_0xbcb7('0x4a')]},'raw':!![]})[_0xbcb7('0x22')](function(_0x4054fd){if(_0x4054fd&&_0x4054fd[_0xbcb7('0x4b')]===0x0){return db['UserProfileResource'][_0xbcb7('0x45')]({'name':_0x269174[_0xbcb7('0x28')],'resourceId':_0x269174['id'],'type':_0x4054fd[_0xbcb7('0x28')],'sectionId':_0x4054fd['id']},{})['then'](function(){return _0xbc87c1;});}else{return _0xbc87c1;}})['catch'](function(_0x44b977){logger[_0xbcb7('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44b977);throw _0x44b977;});}return _0xbc87c1;})[_0xbcb7('0x22')](respondWithResult(_0x541f11,0xc9))['catch'](handleError(_0x541f11,null));};exports[_0xbcb7('0x21')]=function(_0x49956d,_0x2304bb){if(_0x49956d[_0xbcb7('0x46')]['id']){delete _0x49956d[_0xbcb7('0x46')]['id'];}return db[_0xbcb7('0x2b')][_0xbcb7('0x44')]({'where':{'id':_0x49956d[_0xbcb7('0x4d')]['id']}})[_0xbcb7('0x22')](handleEntityNotFound(_0x2304bb,null))['then'](saveUpdates(_0x49956d[_0xbcb7('0x46')],null))[_0xbcb7('0x22')](respondWithResult(_0x2304bb,null))[_0xbcb7('0x42')](handleError(_0x2304bb,null));};exports[_0xbcb7('0x26')]=function(_0x42f0ab,_0x17e75a){return db[_0xbcb7('0x2b')][_0xbcb7('0x44')]({'where':{'id':_0x42f0ab[_0xbcb7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x17e75a,null))[_0xbcb7('0x22')](removeEntity(_0x17e75a,null))[_0xbcb7('0x42')](handleError(_0x17e75a,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 0f3e9d6..7c34e20 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 _0xcbde=['tools_templates','util','../../config/logger','bluebird','path','../../config/environment','exports','define','Template'];(function(_0x292ce0,_0x526019){var _0x533685=function(_0xd68a25){while(--_0xd68a25){_0x292ce0['push'](_0x292ce0['shift']());}};_0x533685(++_0x526019);}(_0xcbde,0x10f));var _0xecbd=function(_0x3c5916,_0x89796a){_0x3c5916=_0x3c5916-0x0;var _0x232c4b=_0xcbde[_0x3c5916];return _0x232c4b;};'use strict';var _=require('lodash');var util=require(_0xecbd('0x0'));var logger=require(_0xecbd('0x1'))('api');var moment=require('moment');var BPromise=require(_0xecbd('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xecbd('0x3'));var rimraf=require('rimraf');var config=require(_0xecbd('0x4'));var attributes=require('./template.attributes');module[_0xecbd('0x5')]=function(_0x2c3b85,_0xcb4bd9){return _0x2c3b85[_0xecbd('0x6')](_0xecbd('0x7'),attributes,{'tableName':_0xecbd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe230=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','util'];(function(_0x4cba56,_0x5b2c44){var _0x3cc9f3=function(_0x5bb80a){while(--_0x5bb80a){_0x4cba56['push'](_0x4cba56['shift']());}};_0x3cc9f3(++_0x5b2c44);}(_0xe230,0x18b));var _0x0e23=function(_0x4fe090,_0x3d0714){_0x4fe090=_0x4fe090-0x0;var _0x431b36=_0xe230[_0x4fe090];return _0x431b36;};'use strict';var _=require('lodash');var util=require(_0x0e23('0x0'));var logger=require(_0x0e23('0x1'))('api');var moment=require(_0x0e23('0x2'));var BPromise=require('bluebird');var rp=require(_0x0e23('0x3'));var fs=require('fs');var path=require(_0x0e23('0x4'));var rimraf=require(_0x0e23('0x5'));var config=require(_0x0e23('0x6'));var attributes=require(_0x0e23('0x7'));module[_0x0e23('0x8')]=function(_0x5d2357,_0x3b8cdc){return _0x5d2357[_0x0e23('0x9')](_0x0e23('0xa'),attributes,{'tableName':_0x0e23('0xb'),'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 5b5d12d..f4f2beb 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 _0x41ef=['request\x20sent','Template,\x20%s,\x20%s,\x20%s','error','code','Template,\x20%s,\x20%s','message','info','result','GetTemplate','findAll','options','raw','attributes','limit','include','map','model','debug','stringify','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x41ef,0xc8));var _0xf41e=function(_0x779ffc,_0x43d4bd){_0x779ffc=_0x779ffc-0x0;var _0x5312b8=_0x41ef[_0x779ffc];return _0x5312b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf41e('0x0'));var BPromise=require(_0xf41e('0x1'));var rs=require(_0xf41e('0x2'));var fs=require('fs');var Redis=require(_0xf41e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf41e('0x4'));var logger=require('../../config/logger')(_0xf41e('0x5'));var config=require(_0xf41e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf41e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cc497,_0x2c39d2,_0x586787){return new BPromise(function(_0x23a836,_0xe6466d){return client[_0xf41e('0x8')](_0x3cc497,_0x586787)[_0xf41e('0x9')](function(_0x3e3575){logger['info']('Template,\x20%s,\x20%s',_0x2c39d2,_0xf41e('0xa'));logger['debug'](_0xf41e('0xb'),_0x2c39d2,_0xf41e('0xa'),JSON['stringify'](_0x3e3575));if(_0x3e3575[_0xf41e('0xc')]){if(_0x3e3575[_0xf41e('0xc')][_0xf41e('0xd')]===0x1f4){logger[_0xf41e('0xc')](_0xf41e('0xe'),_0x2c39d2,_0x3e3575[_0xf41e('0xc')][_0xf41e('0xf')]);return _0xe6466d(_0x3e3575[_0xf41e('0xc')][_0xf41e('0xf')]);}logger[_0xf41e('0xc')]('Template,\x20%s,\x20%s',_0x2c39d2,_0x3e3575['error'][_0xf41e('0xf')]);return _0x23a836(_0x3e3575['error'][_0xf41e('0xf')]);}else{logger[_0xf41e('0x10')](_0xf41e('0xe'),_0x2c39d2,'request\x20sent');_0x23a836(_0x3e3575[_0xf41e('0x11')]['message']);}})['catch'](function(_0x36db23){logger[_0xf41e('0xc')](_0xf41e('0xe'),_0x2c39d2,_0x36db23);_0xe6466d(_0x36db23);});});}exports[_0xf41e('0x12')]=function(_0x253102){var _0x55fd5b=this;return new Promise(function(_0xb0e96e,_0x3f9062){return db['Template'][_0xf41e('0x13')]({'raw':_0x253102[_0xf41e('0x14')]?_0x253102[_0xf41e('0x14')][_0xf41e('0x15')]===undefined?!![]:![]:!![],'where':_0x253102['options']?_0x253102['options']['where']||null:null,'attributes':_0x253102[_0xf41e('0x14')]?_0x253102[_0xf41e('0x14')][_0xf41e('0x16')]||null:null,'limit':_0x253102[_0xf41e('0x14')]?_0x253102[_0xf41e('0x14')][_0xf41e('0x17')]||null:null,'include':_0x253102[_0xf41e('0x14')]?_0x253102[_0xf41e('0x14')][_0xf41e('0x18')]?_[_0xf41e('0x19')](_0x253102[_0xf41e('0x14')][_0xf41e('0x18')],function(_0x1b1be3){return{'model':db[_0x1b1be3['model']],'as':_0x1b1be3['as'],'attributes':_0x1b1be3['attributes'],'include':_0x1b1be3[_0xf41e('0x18')]?_[_0xf41e('0x19')](_0x1b1be3[_0xf41e('0x18')],function(_0x5a616c){return{'model':db[_0x5a616c[_0xf41e('0x1a')]],'as':_0x5a616c['as'],'attributes':_0x5a616c[_0xf41e('0x16')],'include':_0x5a616c[_0xf41e('0x18')]?_[_0xf41e('0x19')](_0x5a616c[_0xf41e('0x18')],function(_0x571a87){return{'model':db[_0x571a87[_0xf41e('0x1a')]],'as':_0x571a87['as'],'attributes':_0x571a87[_0xf41e('0x16')]};}):[]};}):[]};}):[]:[]})[_0xf41e('0x9')](function(_0x2f5170){logger[_0xf41e('0x10')]('GetTemplate',_0x253102);logger[_0xf41e('0x1b')](_0xf41e('0x12'),_0x253102,JSON[_0xf41e('0x1c')](_0x2f5170));_0xb0e96e(_0x2f5170);})[_0xf41e('0x1d')](function(_0x5dd4ab){logger[_0xf41e('0xc')](_0xf41e('0x12'),_0x5dd4ab[_0xf41e('0xf')],_0x253102);_0x3f9062(_0x55fd5b[_0xf41e('0xc')](0x1f4,_0x5dd4ab[_0xf41e('0xf')]));});});}; \ No newline at end of file +var _0x9a1c=['limit','map','include','model','attributes','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetTemplate','Template','findAll','options','raw'];(function(_0x2cef86,_0xbae0a6){var _0x46dfd6=function(_0x52e464){while(--_0x52e464){_0x2cef86['push'](_0x2cef86['shift']());}};_0x46dfd6(++_0xbae0a6);}(_0x9a1c,0x1c6));var _0xc9a1=function(_0x15c092,_0xa4e77d){_0x15c092=_0x15c092-0x0;var _0x281b72=_0x9a1c[_0x15c092];return _0x281b72;};'use strict';var _=require(_0xc9a1('0x0'));var util=require(_0xc9a1('0x1'));var moment=require(_0xc9a1('0x2'));var BPromise=require(_0xc9a1('0x3'));var rs=require(_0xc9a1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc9a1('0x6'))(_0xc9a1('0x7'));var config=require(_0xc9a1('0x8'));var jayson=require(_0xc9a1('0x9'));var client=jayson['client'][_0xc9a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5de72f,_0x18529a,_0x46129f){return new BPromise(function(_0x495401,_0x468414){return client['request'](_0x5de72f,_0x46129f)[_0xc9a1('0xb')](function(_0x24d789){logger[_0xc9a1('0xc')](_0xc9a1('0xd'),_0x18529a,'request\x20sent');logger[_0xc9a1('0xe')](_0xc9a1('0xf'),_0x18529a,_0xc9a1('0x10'),JSON['stringify'](_0x24d789));if(_0x24d789[_0xc9a1('0x11')]){if(_0x24d789['error'][_0xc9a1('0x12')]===0x1f4){logger[_0xc9a1('0x11')](_0xc9a1('0xd'),_0x18529a,_0x24d789['error']['message']);return _0x468414(_0x24d789[_0xc9a1('0x11')][_0xc9a1('0x13')]);}logger[_0xc9a1('0x11')](_0xc9a1('0xd'),_0x18529a,_0x24d789[_0xc9a1('0x11')]['message']);return _0x495401(_0x24d789[_0xc9a1('0x11')][_0xc9a1('0x13')]);}else{logger['info'](_0xc9a1('0xd'),_0x18529a,_0xc9a1('0x10'));_0x495401(_0x24d789['result'][_0xc9a1('0x13')]);}})[_0xc9a1('0x14')](function(_0x3563d5){logger[_0xc9a1('0x11')](_0xc9a1('0xd'),_0x18529a,_0x3563d5);_0x468414(_0x3563d5);});});}exports[_0xc9a1('0x15')]=function(_0x397f17){var _0x3e6483=this;return new Promise(function(_0x3703f0,_0x4b603b){return db[_0xc9a1('0x16')][_0xc9a1('0x17')]({'raw':_0x397f17[_0xc9a1('0x18')]?_0x397f17['options'][_0xc9a1('0x19')]===undefined?!![]:![]:!![],'where':_0x397f17[_0xc9a1('0x18')]?_0x397f17[_0xc9a1('0x18')]['where']||null:null,'attributes':_0x397f17[_0xc9a1('0x18')]?_0x397f17[_0xc9a1('0x18')]['attributes']||null:null,'limit':_0x397f17[_0xc9a1('0x18')]?_0x397f17[_0xc9a1('0x18')][_0xc9a1('0x1a')]||null:null,'include':_0x397f17[_0xc9a1('0x18')]?_0x397f17[_0xc9a1('0x18')]['include']?_[_0xc9a1('0x1b')](_0x397f17[_0xc9a1('0x18')][_0xc9a1('0x1c')],function(_0x1966f6){return{'model':db[_0x1966f6[_0xc9a1('0x1d')]],'as':_0x1966f6['as'],'attributes':_0x1966f6[_0xc9a1('0x1e')],'include':_0x1966f6[_0xc9a1('0x1c')]?_[_0xc9a1('0x1b')](_0x1966f6[_0xc9a1('0x1c')],function(_0x2009d5){return{'model':db[_0x2009d5['model']],'as':_0x2009d5['as'],'attributes':_0x2009d5[_0xc9a1('0x1e')],'include':_0x2009d5[_0xc9a1('0x1c')]?_[_0xc9a1('0x1b')](_0x2009d5[_0xc9a1('0x1c')],function(_0x3de8de){return{'model':db[_0x3de8de[_0xc9a1('0x1d')]],'as':_0x3de8de['as'],'attributes':_0x3de8de[_0xc9a1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc9a1('0xb')](function(_0x3e1d30){logger['info'](_0xc9a1('0x15'),_0x397f17);logger['debug'](_0xc9a1('0x15'),_0x397f17,JSON[_0xc9a1('0x1f')](_0x3e1d30));_0x3703f0(_0x3e1d30);})[_0xc9a1('0x14')](function(_0x31b5a9){logger[_0xc9a1('0x11')](_0xc9a1('0x15'),_0x31b5a9[_0xc9a1('0x13')],_0x397f17);_0x4b603b(_0x3e6483['error'](0x1f4,_0x31b5a9['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 45546ef..38938d4 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 _0x928c=['create','post','addAction','put','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions'];(function(_0x15fa77,_0x93eaff){var _0x1385ff=function(_0x165e02){while(--_0x165e02){_0x15fa77['push'](_0x15fa77['shift']());}};_0x1385ff(++_0x93eaff);}(_0x928c,0x157));var _0xc928=function(_0x18bc40,_0x3c15fa){_0x18bc40=_0x18bc40-0x0;var _0x4d03dd=_0x928c[_0x18bc40];return _0x4d03dd;};'use strict';var multer=require(_0xc928('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc928('0x1'));var express=require(_0xc928('0x2'));var router=express[_0xc928('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc928('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc928('0x5'));var controller=require('./trigger.controller');router[_0xc928('0x6')]('/',auth[_0xc928('0x7')](),controller[_0xc928('0x8')]);router[_0xc928('0x6')](_0xc928('0x9'),auth[_0xc928('0x7')](),controller[_0xc928('0xa')]);router[_0xc928('0x6')](_0xc928('0xb'),auth['isAuthenticated'](),controller[_0xc928('0xc')]);router[_0xc928('0x6')](_0xc928('0xd'),auth[_0xc928('0x7')](),controller[_0xc928('0xe')]);router['get'](_0xc928('0xf'),auth[_0xc928('0x7')](),controller[_0xc928('0x10')]);router['post']('/',auth[_0xc928('0x7')](),controller[_0xc928('0x11')]);router[_0xc928('0x12')]('/:id/all_conditions',auth[_0xc928('0x7')](),controller['addAllCondition']);router[_0xc928('0x12')]('/:id/any_conditions',auth[_0xc928('0x7')](),controller['addAnyCondition']);router[_0xc928('0x12')](_0xc928('0xf'),auth['isAuthenticated'](),controller[_0xc928('0x13')]);router[_0xc928('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc928('0x15')](_0xc928('0x9'),auth['isAuthenticated'](),controller[_0xc928('0x16')]);module[_0xc928('0x17')]=router; \ No newline at end of file +var _0x180a=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','/:id','isAuthenticated','show','/:id/all_conditions','get','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xce512b,_0x3163eb){var _0x44b7c5=function(_0x165eb1){while(--_0x165eb1){_0xce512b['push'](_0xce512b['shift']());}};_0x44b7c5(++_0x3163eb);}(_0x180a,0xd4));var _0xa180=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x180a[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0xa180('0x0'));var util=require(_0xa180('0x1'));var path=require(_0xa180('0x2'));var timeout=require(_0xa180('0x3'));var express=require(_0xa180('0x4'));var router=express[_0xa180('0x5')]();var fs_extra=require(_0xa180('0x6'));var auth=require(_0xa180('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa180('0x8'));var controller=require(_0xa180('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa180('0xa'),auth[_0xa180('0xb')](),controller[_0xa180('0xc')]);router['get'](_0xa180('0xd'),auth[_0xa180('0xb')](),controller['getAllConditions']);router[_0xa180('0xe')](_0xa180('0xf'),auth[_0xa180('0xb')](),controller[_0xa180('0x10')]);router[_0xa180('0xe')](_0xa180('0x11'),auth[_0xa180('0xb')](),controller[_0xa180('0x12')]);router[_0xa180('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xa180('0xd'),auth[_0xa180('0xb')](),controller['addAllCondition']);router['post'](_0xa180('0xf'),auth[_0xa180('0xb')](),controller[_0xa180('0x14')]);router[_0xa180('0x13')](_0xa180('0x11'),auth[_0xa180('0xb')](),controller[_0xa180('0x15')]);router[_0xa180('0x16')](_0xa180('0xa'),auth[_0xa180('0xb')](),controller[_0xa180('0x17')]);router[_0xa180('0x18')](_0xa180('0xa'),auth[_0xa180('0xb')](),controller[_0xa180('0x19')]);module[_0xa180('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index bd35e45..a77d382 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 _0xe7ad=['STRING','BOOLEAN','sequelize','exports'];(function(_0x5ae0fd,_0x40e4d9){var _0x35dbd1=function(_0x536a02){while(--_0x536a02){_0x5ae0fd['push'](_0x5ae0fd['shift']());}};_0x35dbd1(++_0x40e4d9);}(_0xe7ad,0x176));var _0xde7a=function(_0x480d4c,_0x258d15){_0x480d4c=_0x480d4c-0x0;var _0x4859c0=_0xe7ad[_0x480d4c];return _0x4859c0;};'use strict';var Sequelize=require(_0xde7a('0x0'));module[_0xde7a('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xde7a('0x2')]},'description':{'type':Sequelize[_0xde7a('0x2')]},'status':{'type':Sequelize[_0xde7a('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5d99=['exports','STRING','BOOLEAN','sequelize'];(function(_0x54cb68,_0x5b6889){var _0x1102df=function(_0x3b592c){while(--_0x3b592c){_0x54cb68['push'](_0x54cb68['shift']());}};_0x1102df(++_0x5b6889);}(_0x5d99,0x1b7));var _0x95d9=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0x5d99[_0xbc2974];return _0x3a5b4f;};'use strict';var Sequelize=require(_0x95d9('0x0'));module[_0x95d9('0x1')]={'name':{'type':Sequelize[_0x95d9('0x2')]},'channel':{'type':Sequelize[_0x95d9('0x2')]},'description':{'type':Sequelize[_0x95d9('0x2')]},'status':{'type':Sequelize[_0x95d9('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 8a50b8c..f1b2e57 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 _0x609d=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','Triggers','destroy','name','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','options','Trigger','count','findAll','rows','catch','show','params','keys','includeAll','include','find','create','body','user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','order','pick','merge','getAnyConditions','addAction','TriggerId','Action','getActions'];(function(_0x20e971,_0xe32f4b){var _0x303122=function(_0x3e25d5){while(--_0x3e25d5){_0x20e971['push'](_0x20e971['shift']());}};_0x303122(++_0xe32f4b);}(_0x609d,0xc0));var _0xd609=function(_0x3ef8a9,_0x59a7c2){_0x3ef8a9=_0x3ef8a9-0x0;var _0x424f63=_0x609d[_0x3ef8a9];return _0x424f63;};'use strict';var emlformat=require(_0xd609('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd609('0x1'));var jsonpatch=require(_0xd609('0x2'));var rp=require(_0xd609('0x3'));var moment=require(_0xd609('0x4'));var BPromise=require(_0xd609('0x5'));var Mustache=require('mustache');var util=require(_0xd609('0x6'));var path=require(_0xd609('0x7'));var sox=require('sox');var csv=require(_0xd609('0x8'));var ejs=require(_0xd609('0x9'));var fs=require('fs');var fs_extra=require(_0xd609('0xa'));var _=require(_0xd609('0xb'));var squel=require(_0xd609('0xc'));var crypto=require(_0xd609('0xd'));var jsforce=require(_0xd609('0xe'));var deskjs=require(_0xd609('0xf'));var toCsv=require(_0xd609('0x8'));var querystring=require(_0xd609('0x10'));var Papa=require(_0xd609('0x11'));var Redis=require(_0xd609('0x12'));var authService=require(_0xd609('0x13'));var qs=require(_0xd609('0x14'));var as=require(_0xd609('0x15'));var hardwareService=require(_0xd609('0x16'));var logger=require('../../config/logger')(_0xd609('0x17'));var utils=require(_0xd609('0x18'));var config=require(_0xd609('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x115e80,_0x299a83){_0x299a83=_0x299a83||0xcc;return function(_0x5b8149){if(_0x5b8149){return _0x115e80[_0xd609('0x1a')](_0x299a83);}return _0x115e80['status'](_0x299a83)['end']();};}function respondWithResult(_0x49340e,_0x58ac7b){_0x58ac7b=_0x58ac7b||0xc8;return function(_0x55a997){if(_0x55a997){return _0x49340e[_0xd609('0x1b')](_0x58ac7b)[_0xd609('0x1c')](_0x55a997);}};}function respondWithFilteredResult(_0x45320e,_0x949259){return function(_0xfefec2){if(_0xfefec2){var _0x1ac4f6=typeof _0x949259[_0xd609('0x1d')]===_0xd609('0x1e')&&typeof _0x949259[_0xd609('0x1f')]===_0xd609('0x1e');var _0x3d6aa7=_0xfefec2['count'];var _0x24291b=_0x1ac4f6?0x0:_0x949259[_0xd609('0x1d')];var _0x365f94=_0x1ac4f6?_0xfefec2['count']:_0x949259[_0xd609('0x1d')]+_0x949259[_0xd609('0x1f')];var _0x21708d;if(_0x365f94>=_0x3d6aa7){_0x365f94=_0x3d6aa7;_0x21708d=0xc8;}else{_0x21708d=0xce;}_0x45320e[_0xd609('0x1b')](_0x21708d);return _0x45320e[_0xd609('0x20')](_0xd609('0x21'),_0x24291b+'-'+_0x365f94+'/'+_0x3d6aa7)[_0xd609('0x1c')](_0xfefec2);}return null;};}function patchUpdates(_0x2a1f3d){return function(_0x29459b){try{jsonpatch[_0xd609('0x22')](_0x29459b,_0x2a1f3d,!![]);}catch(_0x2ae316){return BPromise[_0xd609('0x23')](_0x2ae316);}return _0x29459b['save']();};}function saveUpdates(_0x3eb5d5,_0x5e43eb){return function(_0x305a4a){if(_0x305a4a){return _0x305a4a[_0xd609('0x24')](_0x3eb5d5)[_0xd609('0x25')](function(_0x44073f){return _0x44073f;});}return null;};}function removeEntity(_0x172d68,_0x31230b){return function(_0x14ec55){if(_0x14ec55){return _0x14ec55['destroy']()[_0xd609('0x25')](function(){var _0x158db3=_0x14ec55['get']({'plain':!![]});var _0x195978=_0xd609('0x26');return db['UserProfileResource'][_0xd609('0x27')]({'where':{'type':_0x195978,'resourceId':_0x158db3['id']}})[_0xd609('0x25')](function(){return _0x14ec55;});})[_0xd609('0x25')](function(){_0x172d68[_0xd609('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x212bc5,_0x273bdb){return function(_0x56af99){if(!_0x56af99){_0x212bc5[_0xd609('0x1a')](0x194);}return _0x56af99;};}function handleError(_0x5188a9,_0x3982f9){_0x3982f9=_0x3982f9||0x1f4;return function(_0x44f6b3){logger['error'](_0x44f6b3['stack']);if(_0x44f6b3[_0xd609('0x28')]){delete _0x44f6b3[_0xd609('0x28')];}_0x5188a9[_0xd609('0x1b')](_0x3982f9)['send'](_0x44f6b3);};}exports['index']=function(_0x27d620,_0xfcdd65){var _0x54b6f4={},_0xa0bb44={},_0x4f05cc={'count':0x0,'rows':[]};var _0x2fb69b=_[_0xd609('0x29')](db['Trigger'][_0xd609('0x2a')],function(_0x1b6084){return{'name':_0x1b6084[_0xd609('0x2b')],'type':_0x1b6084[_0xd609('0x2c')][_0xd609('0x2d')]};});_0xa0bb44[_0xd609('0x2e')]=_[_0xd609('0x29')](_0x2fb69b,_0xd609('0x28'));_0xa0bb44['query']=_['keys'](_0x27d620[_0xd609('0x2f')]);_0xa0bb44[_0xd609('0x30')]=_[_0xd609('0x31')](_0xa0bb44[_0xd609('0x2e')],_0xa0bb44[_0xd609('0x2f')]);_0x54b6f4[_0xd609('0x32')]=_[_0xd609('0x31')](_0xa0bb44[_0xd609('0x2e')],qs[_0xd609('0x33')](_0x27d620[_0xd609('0x2f')][_0xd609('0x33')]));_0x54b6f4[_0xd609('0x32')]=_0x54b6f4[_0xd609('0x32')][_0xd609('0x34')]?_0x54b6f4[_0xd609('0x32')]:_0xa0bb44[_0xd609('0x2e')];if(!_0x27d620[_0xd609('0x2f')][_0xd609('0x35')](_0xd609('0x36'))){_0x54b6f4[_0xd609('0x1f')]=qs[_0xd609('0x1f')](_0x27d620['query'][_0xd609('0x1f')]);_0x54b6f4[_0xd609('0x1d')]=qs[_0xd609('0x1d')](_0x27d620[_0xd609('0x2f')][_0xd609('0x1d')]);}_0x54b6f4['order']=qs['sort'](_0x27d620[_0xd609('0x2f')][_0xd609('0x37')]);_0x54b6f4[_0xd609('0x38')]=qs['filters'](_['pick'](_0x27d620[_0xd609('0x2f')],_0xa0bb44[_0xd609('0x30')]),_0x2fb69b);if(_0x27d620['query']['filter']){_0x54b6f4[_0xd609('0x38')]=_['merge'](_0x54b6f4[_0xd609('0x38')],{'$or':_['map'](_0x2fb69b,function(_0xdada01){if(_0xdada01[_0xd609('0x2c')]!=='VIRTUAL'){var _0x1a81b7={};_0x1a81b7[_0xdada01['name']]={'$like':'%'+_0x27d620[_0xd609('0x2f')][_0xd609('0x39')]+'%'};return _0x1a81b7;}})});}_0x54b6f4=_['merge']({},_0x54b6f4,_0x27d620[_0xd609('0x3a')]);var _0x1d7722={'where':_0x54b6f4[_0xd609('0x38')]};return db[_0xd609('0x3b')][_0xd609('0x3c')](_0x1d7722)[_0xd609('0x25')](function(_0x3c0168){_0x4f05cc[_0xd609('0x3c')]=_0x3c0168;if(_0x27d620['query']['includeAll']){_0x54b6f4['include']=[{'all':!![]}];}return db[_0xd609('0x3b')][_0xd609('0x3d')](_0x54b6f4);})['then'](function(_0x28af08){_0x4f05cc[_0xd609('0x3e')]=_0x28af08;return _0x4f05cc;})['then'](respondWithFilteredResult(_0xfcdd65,_0x54b6f4))[_0xd609('0x3f')](handleError(_0xfcdd65,null));};exports[_0xd609('0x40')]=function(_0x48afd0,_0x1cee9d){var _0x5349fa={'raw':![],'where':{'id':_0x48afd0[_0xd609('0x41')]['id']}},_0x53f566={};_0x53f566[_0xd609('0x2e')]=_['keys'](db[_0xd609('0x3b')][_0xd609('0x2a')]);_0x53f566[_0xd609('0x2f')]=_[_0xd609('0x42')](_0x48afd0[_0xd609('0x2f')]);_0x53f566[_0xd609('0x30')]=_[_0xd609('0x31')](_0x53f566[_0xd609('0x2e')],_0x53f566[_0xd609('0x2f')]);_0x5349fa[_0xd609('0x32')]=_[_0xd609('0x31')](_0x53f566[_0xd609('0x2e')],qs[_0xd609('0x33')](_0x48afd0[_0xd609('0x2f')]['fields']));_0x5349fa[_0xd609('0x32')]=_0x5349fa[_0xd609('0x32')][_0xd609('0x34')]?_0x5349fa[_0xd609('0x32')]:_0x53f566['model'];if(_0x48afd0[_0xd609('0x2f')][_0xd609('0x43')]){_0x5349fa[_0xd609('0x44')]=[{'all':!![]}];}_0x5349fa=_['merge']({},_0x5349fa,_0x48afd0[_0xd609('0x3a')]);return db[_0xd609('0x3b')][_0xd609('0x45')](_0x5349fa)[_0xd609('0x25')](handleEntityNotFound(_0x1cee9d,null))[_0xd609('0x25')](respondWithResult(_0x1cee9d,null))[_0xd609('0x3f')](handleError(_0x1cee9d,null));};exports[_0xd609('0x46')]=function(_0x18a23a,_0x2c8240){return db['Trigger'][_0xd609('0x46')](_0x18a23a[_0xd609('0x47')],{})[_0xd609('0x25')](function(_0x366965){var _0x4fba30=_0x18a23a[_0xd609('0x48')]['get']({'plain':!![]});if(!_0x4fba30)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fba30[_0xd609('0x49')]===_0xd609('0x48')){var _0x41fe93=_0x366965[_0xd609('0x4a')]({'plain':!![]});var _0x41bafe=_0xd609('0x26');return db[_0xd609('0x4b')]['find']({'where':{'name':_0x41bafe,'userProfileId':_0x4fba30[_0xd609('0x4c')]},'raw':!![]})[_0xd609('0x25')](function(_0x15add3){if(_0x15add3&&_0x15add3[_0xd609('0x4d')]===0x0){return db[_0xd609('0x4e')]['create']({'name':_0x41fe93[_0xd609('0x28')],'resourceId':_0x41fe93['id'],'type':_0x15add3[_0xd609('0x28')],'sectionId':_0x15add3['id']},{})[_0xd609('0x25')](function(){return _0x366965;});}else{return _0x366965;}})[_0xd609('0x3f')](function(_0x395345){logger[_0xd609('0x4f')](_0xd609('0x50'),_0x395345);throw _0x395345;});}return _0x366965;})[_0xd609('0x25')](respondWithResult(_0x2c8240,0xc9))[_0xd609('0x3f')](handleError(_0x2c8240,null));};exports[_0xd609('0x24')]=function(_0x16fb0b,_0x4833d0){if(_0x16fb0b['body']['id']){delete _0x16fb0b[_0xd609('0x47')]['id'];}return db['Trigger']['find']({'where':{'id':_0x16fb0b[_0xd609('0x41')]['id']}})[_0xd609('0x25')](handleEntityNotFound(_0x4833d0,null))['then'](saveUpdates(_0x16fb0b['body'],null))['then'](respondWithResult(_0x4833d0,null))['catch'](handleError(_0x4833d0,null));};exports['destroy']=function(_0x34e37d,_0x688368){return db[_0xd609('0x3b')]['find']({'where':{'id':_0x34e37d[_0xd609('0x41')]['id']}})[_0xd609('0x25')](handleEntityNotFound(_0x688368,null))[_0xd609('0x25')](removeEntity(_0x688368,null))['catch'](handleError(_0x688368,null));};exports[_0xd609('0x51')]=function(_0x17ef44,_0x2d02c0,_0x27f85c){if(_0x17ef44[_0xd609('0x47')]['id']){delete _0x17ef44[_0xd609('0x47')]['id'];}return db['Trigger'][_0xd609('0x45')]({'where':{'id':_0x17ef44['params']['id']}})[_0xd609('0x25')](handleEntityNotFound(_0x2d02c0,null))[_0xd609('0x25')](function(_0x28ea0e){if(_0x28ea0e){_0x17ef44[_0xd609('0x47')][_0xd609('0x52')]=_0x28ea0e['id'];return db[_0xd609('0x53')][_0xd609('0x46')](_0x17ef44['body']);}})[_0xd609('0x25')](respondWithResult(_0x2d02c0,null))[_0xd609('0x3f')](handleError(_0x2d02c0,null));};exports[_0xd609('0x54')]=function(_0x13ddef,_0x1c37b4,_0x174d2a){if(_0x13ddef[_0xd609('0x47')]['id']){delete _0x13ddef[_0xd609('0x47')]['id'];}return db[_0xd609('0x3b')][_0xd609('0x45')]({'where':{'id':_0x13ddef[_0xd609('0x41')]['id']}})['then'](handleEntityNotFound(_0x1c37b4,null))[_0xd609('0x25')](function(_0x1a51bd){if(_0x1a51bd){_0x13ddef[_0xd609('0x47')][_0xd609('0x55')]=_0x1a51bd['id'];return db[_0xd609('0x53')][_0xd609('0x46')](_0x13ddef['body']);}})['then'](respondWithResult(_0x1c37b4,null))['catch'](handleError(_0x1c37b4,null));};exports[_0xd609('0x56')]=function(_0x2314aa,_0x8c2bc9,_0x4e40b9){var _0x4a29e1={};var _0x3fa517={};var _0x27a9a2;var _0x8e3424;return db['Trigger'][_0xd609('0x57')]({'where':{'id':_0x2314aa[_0xd609('0x41')]['id']}})[_0xd609('0x25')](handleEntityNotFound(_0x8c2bc9,null))[_0xd609('0x25')](function(_0x23d011){if(_0x23d011){_0x27a9a2=_0x23d011;_0x3fa517[_0xd609('0x2e')]=_[_0xd609('0x42')](db[_0xd609('0x53')][_0xd609('0x2a')]);_0x3fa517[_0xd609('0x2f')]=_[_0xd609('0x42')](_0x2314aa[_0xd609('0x2f')]);_0x3fa517[_0xd609('0x30')]=_[_0xd609('0x31')](_0x3fa517[_0xd609('0x2e')],_0x3fa517[_0xd609('0x2f')]);_0x4a29e1[_0xd609('0x32')]=_[_0xd609('0x31')](_0x3fa517[_0xd609('0x2e')],qs[_0xd609('0x33')](_0x2314aa[_0xd609('0x2f')][_0xd609('0x33')]));_0x4a29e1[_0xd609('0x32')]=_0x4a29e1[_0xd609('0x32')][_0xd609('0x34')]?_0x4a29e1[_0xd609('0x32')]:_0x3fa517[_0xd609('0x2e')];_0x4a29e1[_0xd609('0x58')]=qs['sort'](_0x2314aa[_0xd609('0x2f')][_0xd609('0x37')]);_0x4a29e1['where']=qs[_0xd609('0x30')](_[_0xd609('0x59')](_0x2314aa[_0xd609('0x2f')],_0x3fa517['filters']));if(_0x2314aa[_0xd609('0x2f')][_0xd609('0x39')]){_0x4a29e1[_0xd609('0x38')]=_[_0xd609('0x5a')](_0x4a29e1[_0xd609('0x38')],{'$or':_[_0xd609('0x29')](_0x4a29e1['attributes'],function(_0x1583ac){var _0x1e0fef={};_0x1e0fef[_0x1583ac]={'$like':'%'+_0x2314aa[_0xd609('0x2f')][_0xd609('0x39')]+'%'};return _0x1e0fef;})});}_0x4a29e1=_['merge']({},_0x4a29e1,_0x2314aa[_0xd609('0x3a')]);return _0x27a9a2[_0xd609('0x56')](_0x4a29e1);}})['then'](function(_0x40749f){if(_0x40749f){_0x8e3424=_0x40749f[_0xd609('0x34')];if(!_0x2314aa['query'][_0xd609('0x35')]('nolimit')){_0x4a29e1['limit']=qs[_0xd609('0x1f')](_0x2314aa[_0xd609('0x2f')][_0xd609('0x1f')]);_0x4a29e1[_0xd609('0x1d')]=qs[_0xd609('0x1d')](_0x2314aa[_0xd609('0x2f')][_0xd609('0x1d')]);}return _0x27a9a2['getAllConditions'](_0x4a29e1);}})['then'](function(_0xaa558e){if(_0xaa558e){return _0xaa558e?{'count':_0x8e3424,'rows':_0xaa558e}:null;}})[_0xd609('0x25')](respondWithResult(_0x8c2bc9,null))[_0xd609('0x3f')](handleError(_0x8c2bc9,null));};exports['getAnyConditions']=function(_0x366d23,_0x5c16be,_0xf5304f){var _0x2bb712={};var _0x4600e8={};var _0x1eb9cf;var _0xce52cf;return db['Trigger']['findOne']({'where':{'id':_0x366d23[_0xd609('0x41')]['id']}})[_0xd609('0x25')](handleEntityNotFound(_0x5c16be,null))[_0xd609('0x25')](function(_0x11c66b){if(_0x11c66b){_0x1eb9cf=_0x11c66b;_0x4600e8[_0xd609('0x2e')]=_['keys'](db[_0xd609('0x53')][_0xd609('0x2a')]);_0x4600e8[_0xd609('0x2f')]=_[_0xd609('0x42')](_0x366d23['query']);_0x4600e8[_0xd609('0x30')]=_[_0xd609('0x31')](_0x4600e8[_0xd609('0x2e')],_0x4600e8[_0xd609('0x2f')]);_0x2bb712[_0xd609('0x32')]=_['intersection'](_0x4600e8['model'],qs[_0xd609('0x33')](_0x366d23['query']['fields']));_0x2bb712[_0xd609('0x32')]=_0x2bb712[_0xd609('0x32')]['length']?_0x2bb712[_0xd609('0x32')]:_0x4600e8['model'];_0x2bb712[_0xd609('0x58')]=qs['sort'](_0x366d23['query'][_0xd609('0x37')]);_0x2bb712['where']=qs[_0xd609('0x30')](_[_0xd609('0x59')](_0x366d23['query'],_0x4600e8[_0xd609('0x30')]));if(_0x366d23[_0xd609('0x2f')]['filter']){_0x2bb712[_0xd609('0x38')]=_[_0xd609('0x5a')](_0x2bb712[_0xd609('0x38')],{'$or':_['map'](_0x2bb712[_0xd609('0x32')],function(_0x4f4ded){var _0x269bb7={};_0x269bb7[_0x4f4ded]={'$like':'%'+_0x366d23['query']['filter']+'%'};return _0x269bb7;})});}_0x2bb712=_[_0xd609('0x5a')]({},_0x2bb712,_0x366d23[_0xd609('0x3a')]);return _0x1eb9cf[_0xd609('0x5b')](_0x2bb712);}})[_0xd609('0x25')](function(_0x333bb0){if(_0x333bb0){_0xce52cf=_0x333bb0[_0xd609('0x34')];if(!_0x366d23[_0xd609('0x2f')]['hasOwnProperty'](_0xd609('0x36'))){_0x2bb712[_0xd609('0x1f')]=qs['limit'](_0x366d23['query'][_0xd609('0x1f')]);_0x2bb712[_0xd609('0x1d')]=qs[_0xd609('0x1d')](_0x366d23[_0xd609('0x2f')][_0xd609('0x1d')]);}return _0x1eb9cf[_0xd609('0x5b')](_0x2bb712);}})[_0xd609('0x25')](function(_0x559e77){if(_0x559e77){return _0x559e77?{'count':_0xce52cf,'rows':_0x559e77}:null;}})[_0xd609('0x25')](respondWithResult(_0x5c16be,null))['catch'](handleError(_0x5c16be,null));};exports[_0xd609('0x5c')]=function(_0x5a6ec5,_0x27c0a8,_0x15ce44){if(_0x5a6ec5['body']['id']){delete _0x5a6ec5[_0xd609('0x47')]['id'];}return db[_0xd609('0x3b')][_0xd609('0x45')]({'where':{'id':_0x5a6ec5[_0xd609('0x41')]['id']}})[_0xd609('0x25')](handleEntityNotFound(_0x27c0a8,null))[_0xd609('0x25')](function(_0x79806){if(_0x79806){_0x5a6ec5[_0xd609('0x47')][_0xd609('0x5d')]=_0x79806['id'];return db[_0xd609('0x5e')][_0xd609('0x46')](_0x5a6ec5[_0xd609('0x47')]);}})[_0xd609('0x25')](respondWithResult(_0x27c0a8,null))[_0xd609('0x3f')](handleError(_0x27c0a8,null));};exports[_0xd609('0x5f')]=function(_0x186905,_0x138684,_0x3c5e62){var _0x11df7f={};var _0xc90b63={};var _0x1b9828;var _0xb549e2;return db[_0xd609('0x3b')][_0xd609('0x57')]({'where':{'id':_0x186905[_0xd609('0x41')]['id']}})[_0xd609('0x25')](handleEntityNotFound(_0x138684,null))[_0xd609('0x25')](function(_0x46f0c9){if(_0x46f0c9){_0x1b9828=_0x46f0c9;_0xc90b63[_0xd609('0x2e')]=_[_0xd609('0x42')](db['Action'][_0xd609('0x2a')]);_0xc90b63['query']=_[_0xd609('0x42')](_0x186905[_0xd609('0x2f')]);_0xc90b63[_0xd609('0x30')]=_[_0xd609('0x31')](_0xc90b63[_0xd609('0x2e')],_0xc90b63[_0xd609('0x2f')]);_0x11df7f['attributes']=_[_0xd609('0x31')](_0xc90b63[_0xd609('0x2e')],qs[_0xd609('0x33')](_0x186905[_0xd609('0x2f')][_0xd609('0x33')]));_0x11df7f['attributes']=_0x11df7f[_0xd609('0x32')][_0xd609('0x34')]?_0x11df7f[_0xd609('0x32')]:_0xc90b63['model'];_0x11df7f[_0xd609('0x58')]=qs[_0xd609('0x37')](_0x186905[_0xd609('0x2f')][_0xd609('0x37')]);_0x11df7f[_0xd609('0x38')]=qs[_0xd609('0x30')](_[_0xd609('0x59')](_0x186905['query'],_0xc90b63[_0xd609('0x30')]));if(_0x186905['query'][_0xd609('0x39')]){_0x11df7f[_0xd609('0x38')]=_[_0xd609('0x5a')](_0x11df7f[_0xd609('0x38')],{'$or':_[_0xd609('0x29')](_0x11df7f[_0xd609('0x32')],function(_0x9b8ee0){var _0x33943f={};_0x33943f[_0x9b8ee0]={'$like':'%'+_0x186905[_0xd609('0x2f')][_0xd609('0x39')]+'%'};return _0x33943f;})});}_0x11df7f=_[_0xd609('0x5a')]({},_0x11df7f,_0x186905[_0xd609('0x3a')]);return _0x1b9828[_0xd609('0x5f')](_0x11df7f);}})[_0xd609('0x25')](function(_0x239135){if(_0x239135){_0xb549e2=_0x239135['length'];if(!_0x186905[_0xd609('0x2f')][_0xd609('0x35')](_0xd609('0x36'))){_0x11df7f[_0xd609('0x1f')]=qs[_0xd609('0x1f')](_0x186905[_0xd609('0x2f')][_0xd609('0x1f')]);_0x11df7f[_0xd609('0x1d')]=qs[_0xd609('0x1d')](_0x186905[_0xd609('0x2f')][_0xd609('0x1d')]);}return _0x1b9828[_0xd609('0x5f')](_0x11df7f);}})[_0xd609('0x25')](function(_0x58d207){if(_0x58d207){return _0x58d207?{'count':_0xb549e2,'rows':_0x58d207}:null;}})['then'](respondWithResult(_0x138684,null))['catch'](handleError(_0x138684,null));}; \ No newline at end of file +var _0xc4c1=['hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','Action','getActions','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','end','error','stack','name','index','map','Trigger','fieldName','type','key','model','query','intersection','attributes','fields'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0xc4c1,0x145));var _0x1c4c=function(_0x11d1c1,_0x4e47a4){_0x11d1c1=_0x11d1c1-0x0;var _0x4c5bdd=_0xc4c1[_0x11d1c1];return _0x4c5bdd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c4c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1c4c('0x1'));var moment=require(_0x1c4c('0x2'));var BPromise=require(_0x1c4c('0x3'));var Mustache=require(_0x1c4c('0x4'));var util=require(_0x1c4c('0x5'));var path=require(_0x1c4c('0x6'));var sox=require(_0x1c4c('0x7'));var csv=require(_0x1c4c('0x8'));var ejs=require(_0x1c4c('0x9'));var fs=require('fs');var fs_extra=require(_0x1c4c('0xa'));var _=require(_0x1c4c('0xb'));var squel=require(_0x1c4c('0xc'));var crypto=require('crypto');var jsforce=require(_0x1c4c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1c4c('0xe'));var authService=require(_0x1c4c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1c4c('0x10'));var hardwareService=require(_0x1c4c('0x11'));var logger=require(_0x1c4c('0x12'))(_0x1c4c('0x13'));var utils=require(_0x1c4c('0x14'));var config=require(_0x1c4c('0x15'));var licenseUtil=require(_0x1c4c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c6fda,_0x5ac57f){_0x5ac57f=_0x5ac57f||0xcc;return function(_0x30b93f){if(_0x30b93f){return _0x4c6fda[_0x1c4c('0x17')](_0x5ac57f);}return _0x4c6fda[_0x1c4c('0x18')](_0x5ac57f)['end']();};}function respondWithResult(_0x4ea243,_0x38e938){_0x38e938=_0x38e938||0xc8;return function(_0x54352b){if(_0x54352b){return _0x4ea243[_0x1c4c('0x18')](_0x38e938)['json'](_0x54352b);}};}function respondWithFilteredResult(_0x457d77,_0x1237bb){return function(_0x5732b4){if(_0x5732b4){var _0x21d5d1=typeof _0x1237bb['offset']===_0x1c4c('0x19')&&typeof _0x1237bb[_0x1c4c('0x1a')]===_0x1c4c('0x19');var _0x3eccc6=_0x5732b4[_0x1c4c('0x1b')];var _0x31635a=_0x21d5d1?0x0:_0x1237bb['offset'];var _0x2ae3e3=_0x21d5d1?_0x5732b4[_0x1c4c('0x1b')]:_0x1237bb[_0x1c4c('0x1c')]+_0x1237bb[_0x1c4c('0x1a')];var _0x38b575;if(_0x2ae3e3>=_0x3eccc6){_0x2ae3e3=_0x3eccc6;_0x38b575=0xc8;}else{_0x38b575=0xce;}_0x457d77['status'](_0x38b575);return _0x457d77[_0x1c4c('0x1d')](_0x1c4c('0x1e'),_0x31635a+'-'+_0x2ae3e3+'/'+_0x3eccc6)['json'](_0x5732b4);}return null;};}function patchUpdates(_0x352394){return function(_0xacbee){try{jsonpatch[_0x1c4c('0x1f')](_0xacbee,_0x352394,!![]);}catch(_0x1c7d49){return BPromise[_0x1c4c('0x20')](_0x1c7d49);}return _0xacbee[_0x1c4c('0x21')]();};}function saveUpdates(_0x5ed761,_0x41ed1f){return function(_0x1742b0){if(_0x1742b0){return _0x1742b0[_0x1c4c('0x22')](_0x5ed761)[_0x1c4c('0x23')](function(_0x36661d){return _0x36661d;});}return null;};}function removeEntity(_0x2b91dc,_0x4980d2){return function(_0x14f52b){if(_0x14f52b){return _0x14f52b[_0x1c4c('0x24')]()[_0x1c4c('0x23')](function(){var _0x26efc6=_0x14f52b[_0x1c4c('0x25')]({'plain':!![]});var _0x3dbf0c=_0x1c4c('0x26');return db[_0x1c4c('0x27')][_0x1c4c('0x24')]({'where':{'type':_0x3dbf0c,'resourceId':_0x26efc6['id']}})[_0x1c4c('0x23')](function(){return _0x14f52b;});})[_0x1c4c('0x23')](function(){_0x2b91dc[_0x1c4c('0x18')](0xcc)[_0x1c4c('0x28')]();});}};}function handleEntityNotFound(_0x359d80,_0x264bfe){return function(_0x14d2bf){if(!_0x14d2bf){_0x359d80[_0x1c4c('0x17')](0x194);}return _0x14d2bf;};}function handleError(_0x4ba0ca,_0x3c9eac){_0x3c9eac=_0x3c9eac||0x1f4;return function(_0x4fc2d1){logger[_0x1c4c('0x29')](_0x4fc2d1[_0x1c4c('0x2a')]);if(_0x4fc2d1['name']){delete _0x4fc2d1[_0x1c4c('0x2b')];}_0x4ba0ca[_0x1c4c('0x18')](_0x3c9eac)['send'](_0x4fc2d1);};}exports[_0x1c4c('0x2c')]=function(_0x59cf88,_0x3bac09){var _0x3e70dc={},_0x34813f={},_0x643859={'count':0x0,'rows':[]};var _0x1d3eb6=_[_0x1c4c('0x2d')](db[_0x1c4c('0x2e')]['rawAttributes'],function(_0x58d847){return{'name':_0x58d847[_0x1c4c('0x2f')],'type':_0x58d847[_0x1c4c('0x30')][_0x1c4c('0x31')]};});_0x34813f[_0x1c4c('0x32')]=_[_0x1c4c('0x2d')](_0x1d3eb6,_0x1c4c('0x2b'));_0x34813f[_0x1c4c('0x33')]=_['keys'](_0x59cf88[_0x1c4c('0x33')]);_0x34813f['filters']=_[_0x1c4c('0x34')](_0x34813f[_0x1c4c('0x32')],_0x34813f[_0x1c4c('0x33')]);_0x3e70dc[_0x1c4c('0x35')]=_[_0x1c4c('0x34')](_0x34813f['model'],qs[_0x1c4c('0x36')](_0x59cf88['query'][_0x1c4c('0x36')]));_0x3e70dc['attributes']=_0x3e70dc[_0x1c4c('0x35')]['length']?_0x3e70dc[_0x1c4c('0x35')]:_0x34813f[_0x1c4c('0x32')];if(!_0x59cf88['query'][_0x1c4c('0x37')](_0x1c4c('0x38'))){_0x3e70dc[_0x1c4c('0x1a')]=qs[_0x1c4c('0x1a')](_0x59cf88[_0x1c4c('0x33')][_0x1c4c('0x1a')]);_0x3e70dc['offset']=qs['offset'](_0x59cf88[_0x1c4c('0x33')][_0x1c4c('0x1c')]);}_0x3e70dc[_0x1c4c('0x39')]=qs[_0x1c4c('0x3a')](_0x59cf88['query'][_0x1c4c('0x3a')]);_0x3e70dc[_0x1c4c('0x3b')]=qs[_0x1c4c('0x3c')](_[_0x1c4c('0x3d')](_0x59cf88[_0x1c4c('0x33')],_0x34813f[_0x1c4c('0x3c')]),_0x1d3eb6);if(_0x59cf88[_0x1c4c('0x33')]['filter']){_0x3e70dc[_0x1c4c('0x3b')]=_[_0x1c4c('0x3e')](_0x3e70dc['where'],{'$or':_[_0x1c4c('0x2d')](_0x1d3eb6,function(_0x3da060){if(_0x3da060[_0x1c4c('0x30')]!==_0x1c4c('0x3f')){var _0x2f62ff={};_0x2f62ff[_0x3da060[_0x1c4c('0x2b')]]={'$like':'%'+_0x59cf88[_0x1c4c('0x33')][_0x1c4c('0x40')]+'%'};return _0x2f62ff;}})});}_0x3e70dc=_[_0x1c4c('0x3e')]({},_0x3e70dc,_0x59cf88[_0x1c4c('0x41')]);var _0xb189c0={'where':_0x3e70dc[_0x1c4c('0x3b')]};return db[_0x1c4c('0x2e')]['count'](_0xb189c0)[_0x1c4c('0x23')](function(_0x239998){_0x643859[_0x1c4c('0x1b')]=_0x239998;if(_0x59cf88[_0x1c4c('0x33')][_0x1c4c('0x42')]){_0x3e70dc[_0x1c4c('0x43')]=[{'all':!![]}];}return db[_0x1c4c('0x2e')][_0x1c4c('0x44')](_0x3e70dc);})[_0x1c4c('0x23')](function(_0x214a9d){_0x643859['rows']=_0x214a9d;return _0x643859;})[_0x1c4c('0x23')](respondWithFilteredResult(_0x3bac09,_0x3e70dc))[_0x1c4c('0x45')](handleError(_0x3bac09,null));};exports[_0x1c4c('0x46')]=function(_0x4ee4af,_0x1bb8eb){var _0xe473d9={'raw':![],'where':{'id':_0x4ee4af[_0x1c4c('0x47')]['id']}},_0x48f58a={};_0x48f58a[_0x1c4c('0x32')]=_[_0x1c4c('0x48')](db['Trigger'][_0x1c4c('0x49')]);_0x48f58a[_0x1c4c('0x33')]=_['keys'](_0x4ee4af['query']);_0x48f58a[_0x1c4c('0x3c')]=_['intersection'](_0x48f58a[_0x1c4c('0x32')],_0x48f58a[_0x1c4c('0x33')]);_0xe473d9[_0x1c4c('0x35')]=_[_0x1c4c('0x34')](_0x48f58a[_0x1c4c('0x32')],qs[_0x1c4c('0x36')](_0x4ee4af[_0x1c4c('0x33')][_0x1c4c('0x36')]));_0xe473d9[_0x1c4c('0x35')]=_0xe473d9[_0x1c4c('0x35')][_0x1c4c('0x4a')]?_0xe473d9[_0x1c4c('0x35')]:_0x48f58a[_0x1c4c('0x32')];if(_0x4ee4af[_0x1c4c('0x33')][_0x1c4c('0x42')]){_0xe473d9['include']=[{'all':!![]}];}_0xe473d9=_['merge']({},_0xe473d9,_0x4ee4af[_0x1c4c('0x41')]);return db[_0x1c4c('0x2e')][_0x1c4c('0x4b')](_0xe473d9)[_0x1c4c('0x23')](handleEntityNotFound(_0x1bb8eb,null))[_0x1c4c('0x23')](respondWithResult(_0x1bb8eb,null))[_0x1c4c('0x45')](handleError(_0x1bb8eb,null));};exports[_0x1c4c('0x4c')]=function(_0x20cf36,_0x40decc){return db[_0x1c4c('0x2e')][_0x1c4c('0x4c')](_0x20cf36[_0x1c4c('0x4d')],{})[_0x1c4c('0x23')](function(_0x555fe3){var _0x2476f7=_0x20cf36[_0x1c4c('0x4e')][_0x1c4c('0x25')]({'plain':!![]});if(!_0x2476f7)throw new Error(_0x1c4c('0x4f'));if(_0x2476f7[_0x1c4c('0x50')]===_0x1c4c('0x4e')){var _0x251796=_0x555fe3['get']({'plain':!![]});var _0x29fb7a=_0x1c4c('0x26');return db[_0x1c4c('0x51')][_0x1c4c('0x4b')]({'where':{'name':_0x29fb7a,'userProfileId':_0x2476f7[_0x1c4c('0x52')]},'raw':!![]})[_0x1c4c('0x23')](function(_0x432888){if(_0x432888&&_0x432888['autoAssociation']===0x0){return db[_0x1c4c('0x27')][_0x1c4c('0x4c')]({'name':_0x251796[_0x1c4c('0x2b')],'resourceId':_0x251796['id'],'type':_0x432888[_0x1c4c('0x2b')],'sectionId':_0x432888['id']},{})['then'](function(){return _0x555fe3;});}else{return _0x555fe3;}})[_0x1c4c('0x45')](function(_0x120773){logger[_0x1c4c('0x29')](_0x1c4c('0x53'),_0x120773);throw _0x120773;});}return _0x555fe3;})[_0x1c4c('0x23')](respondWithResult(_0x40decc,0xc9))[_0x1c4c('0x45')](handleError(_0x40decc,null));};exports[_0x1c4c('0x22')]=function(_0x8f3dd6,_0x84f0d2){if(_0x8f3dd6['body']['id']){delete _0x8f3dd6['body']['id'];}return db[_0x1c4c('0x2e')][_0x1c4c('0x4b')]({'where':{'id':_0x8f3dd6[_0x1c4c('0x47')]['id']}})[_0x1c4c('0x23')](handleEntityNotFound(_0x84f0d2,null))['then'](saveUpdates(_0x8f3dd6[_0x1c4c('0x4d')],null))[_0x1c4c('0x23')](respondWithResult(_0x84f0d2,null))[_0x1c4c('0x45')](handleError(_0x84f0d2,null));};exports['destroy']=function(_0x3ca276,_0x233069){return db[_0x1c4c('0x2e')][_0x1c4c('0x4b')]({'where':{'id':_0x3ca276[_0x1c4c('0x47')]['id']}})[_0x1c4c('0x23')](handleEntityNotFound(_0x233069,null))[_0x1c4c('0x23')](removeEntity(_0x233069,null))['catch'](handleError(_0x233069,null));};exports[_0x1c4c('0x54')]=function(_0x2e2014,_0x5a0efc,_0x4dd770){if(_0x2e2014[_0x1c4c('0x4d')]['id']){delete _0x2e2014[_0x1c4c('0x4d')]['id'];}return db['Trigger']['find']({'where':{'id':_0x2e2014[_0x1c4c('0x47')]['id']}})[_0x1c4c('0x23')](handleEntityNotFound(_0x5a0efc,null))['then'](function(_0x275a9e){if(_0x275a9e){_0x2e2014[_0x1c4c('0x4d')][_0x1c4c('0x55')]=_0x275a9e['id'];return db[_0x1c4c('0x56')][_0x1c4c('0x4c')](_0x2e2014[_0x1c4c('0x4d')]);}})[_0x1c4c('0x23')](respondWithResult(_0x5a0efc,null))[_0x1c4c('0x45')](handleError(_0x5a0efc,null));};exports[_0x1c4c('0x57')]=function(_0x27caac,_0x2c14cc,_0x3261ef){if(_0x27caac[_0x1c4c('0x4d')]['id']){delete _0x27caac[_0x1c4c('0x4d')]['id'];}return db['Trigger']['find']({'where':{'id':_0x27caac[_0x1c4c('0x47')]['id']}})['then'](handleEntityNotFound(_0x2c14cc,null))[_0x1c4c('0x23')](function(_0x43cdf6){if(_0x43cdf6){_0x27caac[_0x1c4c('0x4d')][_0x1c4c('0x58')]=_0x43cdf6['id'];return db[_0x1c4c('0x56')]['create'](_0x27caac[_0x1c4c('0x4d')]);}})[_0x1c4c('0x23')](respondWithResult(_0x2c14cc,null))[_0x1c4c('0x45')](handleError(_0x2c14cc,null));};exports[_0x1c4c('0x59')]=function(_0x360bf3,_0x5adec4,_0x42073b){var _0x2cba11={};var _0x14dc89={};var _0x4b361f;var _0x4afa94;return db[_0x1c4c('0x2e')][_0x1c4c('0x5a')]({'where':{'id':_0x360bf3['params']['id']}})[_0x1c4c('0x23')](handleEntityNotFound(_0x5adec4,null))[_0x1c4c('0x23')](function(_0x64762b){if(_0x64762b){_0x4b361f=_0x64762b;_0x14dc89[_0x1c4c('0x32')]=_[_0x1c4c('0x48')](db[_0x1c4c('0x56')][_0x1c4c('0x49')]);_0x14dc89[_0x1c4c('0x33')]=_[_0x1c4c('0x48')](_0x360bf3[_0x1c4c('0x33')]);_0x14dc89[_0x1c4c('0x3c')]=_[_0x1c4c('0x34')](_0x14dc89[_0x1c4c('0x32')],_0x14dc89['query']);_0x2cba11[_0x1c4c('0x35')]=_[_0x1c4c('0x34')](_0x14dc89[_0x1c4c('0x32')],qs[_0x1c4c('0x36')](_0x360bf3[_0x1c4c('0x33')][_0x1c4c('0x36')]));_0x2cba11[_0x1c4c('0x35')]=_0x2cba11[_0x1c4c('0x35')]['length']?_0x2cba11[_0x1c4c('0x35')]:_0x14dc89[_0x1c4c('0x32')];_0x2cba11[_0x1c4c('0x39')]=qs[_0x1c4c('0x3a')](_0x360bf3[_0x1c4c('0x33')][_0x1c4c('0x3a')]);_0x2cba11[_0x1c4c('0x3b')]=qs[_0x1c4c('0x3c')](_['pick'](_0x360bf3[_0x1c4c('0x33')],_0x14dc89[_0x1c4c('0x3c')]));if(_0x360bf3[_0x1c4c('0x33')][_0x1c4c('0x40')]){_0x2cba11[_0x1c4c('0x3b')]=_[_0x1c4c('0x3e')](_0x2cba11[_0x1c4c('0x3b')],{'$or':_[_0x1c4c('0x2d')](_0x2cba11[_0x1c4c('0x35')],function(_0x40442d){var _0x4ba188={};_0x4ba188[_0x40442d]={'$like':'%'+_0x360bf3['query'][_0x1c4c('0x40')]+'%'};return _0x4ba188;})});}_0x2cba11=_[_0x1c4c('0x3e')]({},_0x2cba11,_0x360bf3[_0x1c4c('0x41')]);return _0x4b361f[_0x1c4c('0x59')](_0x2cba11);}})['then'](function(_0x3bf1a0){if(_0x3bf1a0){_0x4afa94=_0x3bf1a0[_0x1c4c('0x4a')];if(!_0x360bf3['query'][_0x1c4c('0x37')](_0x1c4c('0x38'))){_0x2cba11[_0x1c4c('0x1a')]=qs[_0x1c4c('0x1a')](_0x360bf3[_0x1c4c('0x33')][_0x1c4c('0x1a')]);_0x2cba11['offset']=qs[_0x1c4c('0x1c')](_0x360bf3[_0x1c4c('0x33')][_0x1c4c('0x1c')]);}return _0x4b361f[_0x1c4c('0x59')](_0x2cba11);}})[_0x1c4c('0x23')](function(_0x1950c0){if(_0x1950c0){return _0x1950c0?{'count':_0x4afa94,'rows':_0x1950c0}:null;}})[_0x1c4c('0x23')](respondWithResult(_0x5adec4,null))[_0x1c4c('0x45')](handleError(_0x5adec4,null));};exports['getAnyConditions']=function(_0x53ebed,_0x1bc413,_0x58985f){var _0x150114={};var _0x1404ec={};var _0x1bb25a;var _0x4d73fd;return db['Trigger'][_0x1c4c('0x5a')]({'where':{'id':_0x53ebed[_0x1c4c('0x47')]['id']}})['then'](handleEntityNotFound(_0x1bc413,null))['then'](function(_0x1c6ffe){if(_0x1c6ffe){_0x1bb25a=_0x1c6ffe;_0x1404ec['model']=_[_0x1c4c('0x48')](db[_0x1c4c('0x56')][_0x1c4c('0x49')]);_0x1404ec[_0x1c4c('0x33')]=_[_0x1c4c('0x48')](_0x53ebed[_0x1c4c('0x33')]);_0x1404ec['filters']=_[_0x1c4c('0x34')](_0x1404ec[_0x1c4c('0x32')],_0x1404ec[_0x1c4c('0x33')]);_0x150114['attributes']=_[_0x1c4c('0x34')](_0x1404ec[_0x1c4c('0x32')],qs[_0x1c4c('0x36')](_0x53ebed[_0x1c4c('0x33')]['fields']));_0x150114['attributes']=_0x150114['attributes'][_0x1c4c('0x4a')]?_0x150114[_0x1c4c('0x35')]:_0x1404ec[_0x1c4c('0x32')];_0x150114[_0x1c4c('0x39')]=qs[_0x1c4c('0x3a')](_0x53ebed[_0x1c4c('0x33')]['sort']);_0x150114[_0x1c4c('0x3b')]=qs[_0x1c4c('0x3c')](_['pick'](_0x53ebed[_0x1c4c('0x33')],_0x1404ec[_0x1c4c('0x3c')]));if(_0x53ebed[_0x1c4c('0x33')][_0x1c4c('0x40')]){_0x150114[_0x1c4c('0x3b')]=_[_0x1c4c('0x3e')](_0x150114['where'],{'$or':_[_0x1c4c('0x2d')](_0x150114[_0x1c4c('0x35')],function(_0x5ae760){var _0x42cb9a={};_0x42cb9a[_0x5ae760]={'$like':'%'+_0x53ebed['query']['filter']+'%'};return _0x42cb9a;})});}_0x150114=_[_0x1c4c('0x3e')]({},_0x150114,_0x53ebed['options']);return _0x1bb25a[_0x1c4c('0x5b')](_0x150114);}})[_0x1c4c('0x23')](function(_0x55bce2){if(_0x55bce2){_0x4d73fd=_0x55bce2[_0x1c4c('0x4a')];if(!_0x53ebed[_0x1c4c('0x33')]['hasOwnProperty']('nolimit')){_0x150114[_0x1c4c('0x1a')]=qs[_0x1c4c('0x1a')](_0x53ebed[_0x1c4c('0x33')]['limit']);_0x150114[_0x1c4c('0x1c')]=qs['offset'](_0x53ebed[_0x1c4c('0x33')][_0x1c4c('0x1c')]);}return _0x1bb25a[_0x1c4c('0x5b')](_0x150114);}})[_0x1c4c('0x23')](function(_0x1a9987){if(_0x1a9987){return _0x1a9987?{'count':_0x4d73fd,'rows':_0x1a9987}:null;}})[_0x1c4c('0x23')](respondWithResult(_0x1bc413,null))[_0x1c4c('0x45')](handleError(_0x1bc413,null));};exports[_0x1c4c('0x5c')]=function(_0x291e27,_0x34c72b,_0x292ae9){if(_0x291e27['body']['id']){delete _0x291e27[_0x1c4c('0x4d')]['id'];}return db[_0x1c4c('0x2e')][_0x1c4c('0x4b')]({'where':{'id':_0x291e27['params']['id']}})[_0x1c4c('0x23')](handleEntityNotFound(_0x34c72b,null))[_0x1c4c('0x23')](function(_0x10788c){if(_0x10788c){_0x291e27[_0x1c4c('0x4d')]['TriggerId']=_0x10788c['id'];return db[_0x1c4c('0x5d')][_0x1c4c('0x4c')](_0x291e27[_0x1c4c('0x4d')]);}})['then'](respondWithResult(_0x34c72b,null))[_0x1c4c('0x45')](handleError(_0x34c72b,null));};exports[_0x1c4c('0x5e')]=function(_0xfbd32e,_0x44d8f9,_0x69f7e0){var _0x21e9e6={};var _0x549073={};var _0x48627e;var _0x172eb1;return db[_0x1c4c('0x2e')]['findOne']({'where':{'id':_0xfbd32e[_0x1c4c('0x47')]['id']}})['then'](handleEntityNotFound(_0x44d8f9,null))[_0x1c4c('0x23')](function(_0x373ea9){if(_0x373ea9){_0x48627e=_0x373ea9;_0x549073[_0x1c4c('0x32')]=_[_0x1c4c('0x48')](db[_0x1c4c('0x5d')]['rawAttributes']);_0x549073['query']=_[_0x1c4c('0x48')](_0xfbd32e[_0x1c4c('0x33')]);_0x549073['filters']=_[_0x1c4c('0x34')](_0x549073[_0x1c4c('0x32')],_0x549073[_0x1c4c('0x33')]);_0x21e9e6['attributes']=_[_0x1c4c('0x34')](_0x549073['model'],qs[_0x1c4c('0x36')](_0xfbd32e[_0x1c4c('0x33')][_0x1c4c('0x36')]));_0x21e9e6['attributes']=_0x21e9e6[_0x1c4c('0x35')][_0x1c4c('0x4a')]?_0x21e9e6[_0x1c4c('0x35')]:_0x549073['model'];_0x21e9e6[_0x1c4c('0x39')]=qs[_0x1c4c('0x3a')](_0xfbd32e[_0x1c4c('0x33')][_0x1c4c('0x3a')]);_0x21e9e6[_0x1c4c('0x3b')]=qs[_0x1c4c('0x3c')](_['pick'](_0xfbd32e[_0x1c4c('0x33')],_0x549073['filters']));if(_0xfbd32e[_0x1c4c('0x33')][_0x1c4c('0x40')]){_0x21e9e6[_0x1c4c('0x3b')]=_['merge'](_0x21e9e6['where'],{'$or':_[_0x1c4c('0x2d')](_0x21e9e6[_0x1c4c('0x35')],function(_0xdfe41c){var _0x5da0f4={};_0x5da0f4[_0xdfe41c]={'$like':'%'+_0xfbd32e['query'][_0x1c4c('0x40')]+'%'};return _0x5da0f4;})});}_0x21e9e6=_[_0x1c4c('0x3e')]({},_0x21e9e6,_0xfbd32e['options']);return _0x48627e[_0x1c4c('0x5e')](_0x21e9e6);}})[_0x1c4c('0x23')](function(_0xfb7e35){if(_0xfb7e35){_0x172eb1=_0xfb7e35[_0x1c4c('0x4a')];if(!_0xfbd32e[_0x1c4c('0x33')][_0x1c4c('0x37')](_0x1c4c('0x38'))){_0x21e9e6['limit']=qs[_0x1c4c('0x1a')](_0xfbd32e[_0x1c4c('0x33')]['limit']);_0x21e9e6[_0x1c4c('0x1c')]=qs['offset'](_0xfbd32e[_0x1c4c('0x33')]['offset']);}return _0x48627e[_0x1c4c('0x5e')](_0x21e9e6);}})[_0x1c4c('0x23')](function(_0x3585dc){if(_0x3585dc){return _0x3585dc?{'count':_0x172eb1,'rows':_0x3585dc}:null;}})['then'](respondWithResult(_0x44d8f9,null))['catch'](handleError(_0x44d8f9,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 0df4e25..2f3639b 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 _0xf842=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','Trigger','tools_triggers','lodash','util'];(function(_0x51341d,_0x1fd9ee){var _0x113299=function(_0x304767){while(--_0x304767){_0x51341d['push'](_0x51341d['shift']());}};_0x113299(++_0x1fd9ee);}(_0xf842,0x172));var _0x2f84=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xf842[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0x2f84('0x0'));var util=require(_0x2f84('0x1'));var logger=require(_0x2f84('0x2'))(_0x2f84('0x3'));var moment=require('moment');var BPromise=require(_0x2f84('0x4'));var rp=require(_0x2f84('0x5'));var fs=require('fs');var path=require(_0x2f84('0x6'));var rimraf=require(_0x2f84('0x7'));var config=require(_0x2f84('0x8'));var attributes=require('./trigger.attributes');module[_0x2f84('0x9')]=function(_0x20e773,_0x88a4cb){return _0x20e773['define'](_0x2f84('0xa'),attributes,{'tableName':_0x2f84('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48ea=['Trigger','tools_triggers','lodash','../../config/logger','api','moment','path','../../config/environment','./trigger.attributes','exports','define'];(function(_0x4f8d67,_0x345c88){var _0x1a27f7=function(_0x28c686){while(--_0x28c686){_0x4f8d67['push'](_0x4f8d67['shift']());}};_0x1a27f7(++_0x345c88);}(_0x48ea,0x9c));var _0xa48e=function(_0x32a2be,_0x4784a3){_0x32a2be=_0x32a2be-0x0;var _0x1b62c7=_0x48ea[_0x32a2be];return _0x1b62c7;};'use strict';var _=require(_0xa48e('0x0'));var util=require('util');var logger=require(_0xa48e('0x1'))(_0xa48e('0x2'));var moment=require(_0xa48e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa48e('0x4'));var rimraf=require('rimraf');var config=require(_0xa48e('0x5'));var attributes=require(_0xa48e('0x6'));module[_0xa48e('0x7')]=function(_0x4387b5,_0x2b058d){return _0x4387b5[_0xa48e('0x8')](_0xa48e('0x9'),attributes,{'tableName':_0xa48e('0xa'),'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 11b73ff..c63de43 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 _0xd7c5=['where','map','include','model','attributes','ShowTrigger','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','raw'];(function(_0x553c67,_0x27715e){var _0x25663a=function(_0x304b55){while(--_0x304b55){_0x553c67['push'](_0x553c67['shift']());}};_0x25663a(++_0x27715e);}(_0xd7c5,0x8f));var _0x5d7c=function(_0x5c058a,_0x266884){_0x5c058a=_0x5c058a-0x0;var _0x419fa7=_0xd7c5[_0x5c058a];return _0x419fa7;};'use strict';var _=require(_0x5d7c('0x0'));var util=require(_0x5d7c('0x1'));var moment=require(_0x5d7c('0x2'));var BPromise=require('bluebird');var rs=require(_0x5d7c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d7c('0x4'))['db'];var utils=require(_0x5d7c('0x5'));var logger=require(_0x5d7c('0x6'))(_0x5d7c('0x7'));var config=require(_0x5d7c('0x8'));var jayson=require(_0x5d7c('0x9'));var client=jayson['client'][_0x5d7c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x127cf7,_0x591fd7,_0x5d7665){return new BPromise(function(_0x13e0bb,_0x419cbe){return client['request'](_0x127cf7,_0x5d7665)[_0x5d7c('0xb')](function(_0x19be28){logger[_0x5d7c('0xc')](_0x5d7c('0xd'),_0x591fd7,_0x5d7c('0xe'));logger[_0x5d7c('0xf')]('Trigger,\x20%s,\x20%s,\x20%s',_0x591fd7,'request\x20sent',JSON[_0x5d7c('0x10')](_0x19be28));if(_0x19be28[_0x5d7c('0x11')]){if(_0x19be28[_0x5d7c('0x11')][_0x5d7c('0x12')]===0x1f4){logger[_0x5d7c('0x11')](_0x5d7c('0xd'),_0x591fd7,_0x19be28[_0x5d7c('0x11')][_0x5d7c('0x13')]);return _0x419cbe(_0x19be28[_0x5d7c('0x11')]['message']);}logger[_0x5d7c('0x11')](_0x5d7c('0xd'),_0x591fd7,_0x19be28[_0x5d7c('0x11')][_0x5d7c('0x13')]);return _0x13e0bb(_0x19be28[_0x5d7c('0x11')][_0x5d7c('0x13')]);}else{logger['info'](_0x5d7c('0xd'),_0x591fd7,'request\x20sent');_0x13e0bb(_0x19be28[_0x5d7c('0x14')][_0x5d7c('0x13')]);}})[_0x5d7c('0x15')](function(_0x101ada){logger['error'](_0x5d7c('0xd'),_0x591fd7,_0x101ada);_0x419cbe(_0x101ada);});});}exports[_0x5d7c('0x16')]=function(_0x31b828){var _0x43fae1=this;return new Promise(function(_0x1da759,_0x4b1eda){return db[_0x5d7c('0x17')][_0x5d7c('0x18')]({'raw':_0x31b828['options']?_0x31b828[_0x5d7c('0x19')][_0x5d7c('0x1a')]===undefined?!![]:![]:!![],'where':_0x31b828[_0x5d7c('0x19')]?_0x31b828[_0x5d7c('0x19')][_0x5d7c('0x1b')]||null:null,'attributes':_0x31b828[_0x5d7c('0x19')]?_0x31b828[_0x5d7c('0x19')]['attributes']||null:null,'limit':_0x31b828[_0x5d7c('0x19')]?_0x31b828[_0x5d7c('0x19')]['limit']||null:null,'include':_0x31b828[_0x5d7c('0x19')]?_0x31b828[_0x5d7c('0x19')]['include']?_[_0x5d7c('0x1c')](_0x31b828[_0x5d7c('0x19')][_0x5d7c('0x1d')],function(_0x418224){return{'model':db[_0x418224[_0x5d7c('0x1e')]],'as':_0x418224['as'],'attributes':_0x418224[_0x5d7c('0x1f')],'include':_0x418224[_0x5d7c('0x1d')]?_[_0x5d7c('0x1c')](_0x418224[_0x5d7c('0x1d')],function(_0x3c2ae4){return{'model':db[_0x3c2ae4['model']],'as':_0x3c2ae4['as'],'attributes':_0x3c2ae4[_0x5d7c('0x1f')],'include':_0x3c2ae4[_0x5d7c('0x1d')]?_[_0x5d7c('0x1c')](_0x3c2ae4[_0x5d7c('0x1d')],function(_0x50dfe9){return{'model':db[_0x50dfe9[_0x5d7c('0x1e')]],'as':_0x50dfe9['as'],'attributes':_0x50dfe9['attributes']};}):[]};}):[]};}):[]:[]})[_0x5d7c('0xb')](function(_0x31449c){logger[_0x5d7c('0xc')]('GetTrigger',_0x31b828);logger['debug']('GetTrigger',_0x31b828,JSON['stringify'](_0x31449c));_0x1da759(_0x31449c);})[_0x5d7c('0x15')](function(_0x1bb60d){logger[_0x5d7c('0x11')](_0x5d7c('0x16'),_0x1bb60d[_0x5d7c('0x13')],_0x31b828);_0x4b1eda(_0x43fae1['error'](0x1f4,_0x1bb60d[_0x5d7c('0x13')]));});});};exports[_0x5d7c('0x20')]=function(_0x598c9e){var _0x4f8b30=this;return new Promise(function(_0x5a8317,_0x455d10){return db[_0x5d7c('0x17')][_0x5d7c('0x21')]({'raw':_0x598c9e[_0x5d7c('0x19')]?_0x598c9e[_0x5d7c('0x19')][_0x5d7c('0x1a')]===undefined?!![]:![]:!![],'where':_0x598c9e[_0x5d7c('0x19')]?_0x598c9e[_0x5d7c('0x19')][_0x5d7c('0x1b')]||null:null,'attributes':_0x598c9e[_0x5d7c('0x19')]?_0x598c9e[_0x5d7c('0x19')][_0x5d7c('0x1f')]||null:null,'include':_0x598c9e[_0x5d7c('0x19')]?_0x598c9e['options'][_0x5d7c('0x1d')]?_[_0x5d7c('0x1c')](_0x598c9e[_0x5d7c('0x19')][_0x5d7c('0x1d')],function(_0x604b3f){return{'model':db[_0x604b3f[_0x5d7c('0x1e')]],'as':_0x604b3f['as'],'attributes':_0x604b3f[_0x5d7c('0x1f')],'include':_0x604b3f[_0x5d7c('0x1d')]?_[_0x5d7c('0x1c')](_0x604b3f['include'],function(_0xb6d8e2){return{'model':db[_0xb6d8e2['model']],'as':_0xb6d8e2['as'],'attributes':_0xb6d8e2[_0x5d7c('0x1f')],'include':_0xb6d8e2[_0x5d7c('0x1d')]?_[_0x5d7c('0x1c')](_0xb6d8e2[_0x5d7c('0x1d')],function(_0x92eb26){return{'model':db[_0x92eb26[_0x5d7c('0x1e')]],'as':_0x92eb26['as'],'attributes':_0x92eb26['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b51dc){logger[_0x5d7c('0xc')]('ShowTrigger',_0x598c9e);logger[_0x5d7c('0xf')]('ShowTrigger',_0x598c9e,JSON[_0x5d7c('0x10')](_0x3b51dc));_0x5a8317(_0x3b51dc);})['catch'](function(_0xd07958){logger[_0x5d7c('0x11')](_0x5d7c('0x20'),_0xd07958[_0x5d7c('0x13')],_0x598c9e);_0x455d10(_0x4f8b30[_0x5d7c('0x11')](0x1f4,_0xd07958[_0x5d7c('0x13')]));});});}; \ No newline at end of file +var _0xa583=['client','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetTrigger','findAll','options','where','attributes','limit','include','map','model','then','catch','ShowTrigger','Trigger','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x37faaf,_0x24fd0c){var _0x360231=function(_0x55379e){while(--_0x55379e){_0x37faaf['push'](_0x37faaf['shift']());}};_0x360231(++_0x24fd0c);}(_0xa583,0x158));var _0x3a58=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa583[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x3a58('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3a58('0x1'));var fs=require('fs');var Redis=require(_0x3a58('0x2'));var db=require(_0x3a58('0x3'))['db'];var utils=require(_0x3a58('0x4'));var logger=require(_0x3a58('0x5'))(_0x3a58('0x6'));var config=require(_0x3a58('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3a58('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cdf5a,_0x58a301,_0x1660a3){return new BPromise(function(_0x5a90d8,_0xb81d63){return client[_0x3a58('0x9')](_0x2cdf5a,_0x1660a3)['then'](function(_0x15469e){logger[_0x3a58('0xa')](_0x3a58('0xb'),_0x58a301,_0x3a58('0xc'));logger[_0x3a58('0xd')]('Trigger,\x20%s,\x20%s,\x20%s',_0x58a301,_0x3a58('0xc'),JSON[_0x3a58('0xe')](_0x15469e));if(_0x15469e['error']){if(_0x15469e[_0x3a58('0xf')][_0x3a58('0x10')]===0x1f4){logger['error'](_0x3a58('0xb'),_0x58a301,_0x15469e[_0x3a58('0xf')][_0x3a58('0x11')]);return _0xb81d63(_0x15469e[_0x3a58('0xf')][_0x3a58('0x11')]);}logger[_0x3a58('0xf')](_0x3a58('0xb'),_0x58a301,_0x15469e[_0x3a58('0xf')][_0x3a58('0x11')]);return _0x5a90d8(_0x15469e['error'][_0x3a58('0x11')]);}else{logger[_0x3a58('0xa')](_0x3a58('0xb'),_0x58a301,_0x3a58('0xc'));_0x5a90d8(_0x15469e[_0x3a58('0x12')][_0x3a58('0x11')]);}})['catch'](function(_0x16b84e){logger[_0x3a58('0xf')]('Trigger,\x20%s,\x20%s',_0x58a301,_0x16b84e);_0xb81d63(_0x16b84e);});});}exports[_0x3a58('0x13')]=function(_0x1dc869){var _0x4286c4=this;return new Promise(function(_0x3f419e,_0x33b234){return db['Trigger'][_0x3a58('0x14')]({'raw':_0x1dc869[_0x3a58('0x15')]?_0x1dc869[_0x3a58('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1dc869[_0x3a58('0x15')]?_0x1dc869[_0x3a58('0x15')][_0x3a58('0x16')]||null:null,'attributes':_0x1dc869[_0x3a58('0x15')]?_0x1dc869[_0x3a58('0x15')][_0x3a58('0x17')]||null:null,'limit':_0x1dc869[_0x3a58('0x15')]?_0x1dc869[_0x3a58('0x15')][_0x3a58('0x18')]||null:null,'include':_0x1dc869['options']?_0x1dc869[_0x3a58('0x15')][_0x3a58('0x19')]?_[_0x3a58('0x1a')](_0x1dc869[_0x3a58('0x15')][_0x3a58('0x19')],function(_0x293ccd){return{'model':db[_0x293ccd[_0x3a58('0x1b')]],'as':_0x293ccd['as'],'attributes':_0x293ccd[_0x3a58('0x17')],'include':_0x293ccd['include']?_[_0x3a58('0x1a')](_0x293ccd[_0x3a58('0x19')],function(_0x2ee018){return{'model':db[_0x2ee018[_0x3a58('0x1b')]],'as':_0x2ee018['as'],'attributes':_0x2ee018[_0x3a58('0x17')],'include':_0x2ee018[_0x3a58('0x19')]?_[_0x3a58('0x1a')](_0x2ee018[_0x3a58('0x19')],function(_0x30feb5){return{'model':db[_0x30feb5[_0x3a58('0x1b')]],'as':_0x30feb5['as'],'attributes':_0x30feb5[_0x3a58('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3a58('0x1c')](function(_0x34be26){logger[_0x3a58('0xa')](_0x3a58('0x13'),_0x1dc869);logger['debug'](_0x3a58('0x13'),_0x1dc869,JSON[_0x3a58('0xe')](_0x34be26));_0x3f419e(_0x34be26);})[_0x3a58('0x1d')](function(_0x2f7c42){logger['error'](_0x3a58('0x13'),_0x2f7c42[_0x3a58('0x11')],_0x1dc869);_0x33b234(_0x4286c4['error'](0x1f4,_0x2f7c42[_0x3a58('0x11')]));});});};exports[_0x3a58('0x1e')]=function(_0x3c3bf6){var _0x415659=this;return new Promise(function(_0x1773bf,_0x2308a3){return db[_0x3a58('0x1f')]['find']({'raw':_0x3c3bf6[_0x3a58('0x15')]?_0x3c3bf6['options']['raw']===undefined?!![]:![]:!![],'where':_0x3c3bf6[_0x3a58('0x15')]?_0x3c3bf6[_0x3a58('0x15')][_0x3a58('0x16')]||null:null,'attributes':_0x3c3bf6[_0x3a58('0x15')]?_0x3c3bf6[_0x3a58('0x15')]['attributes']||null:null,'include':_0x3c3bf6[_0x3a58('0x15')]?_0x3c3bf6[_0x3a58('0x15')][_0x3a58('0x19')]?_[_0x3a58('0x1a')](_0x3c3bf6[_0x3a58('0x15')]['include'],function(_0x2a995a){return{'model':db[_0x2a995a[_0x3a58('0x1b')]],'as':_0x2a995a['as'],'attributes':_0x2a995a[_0x3a58('0x17')],'include':_0x2a995a[_0x3a58('0x19')]?_[_0x3a58('0x1a')](_0x2a995a[_0x3a58('0x19')],function(_0x1e6ece){return{'model':db[_0x1e6ece[_0x3a58('0x1b')]],'as':_0x1e6ece['as'],'attributes':_0x1e6ece[_0x3a58('0x17')],'include':_0x1e6ece[_0x3a58('0x19')]?_[_0x3a58('0x1a')](_0x1e6ece['include'],function(_0x4ceddb){return{'model':db[_0x4ceddb[_0x3a58('0x1b')]],'as':_0x4ceddb['as'],'attributes':_0x4ceddb[_0x3a58('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3a58('0x1c')](function(_0x3bc44a){logger[_0x3a58('0xa')](_0x3a58('0x1e'),_0x3c3bf6);logger[_0x3a58('0xd')](_0x3a58('0x1e'),_0x3c3bf6,JSON[_0x3a58('0xe')](_0x3bc44a));_0x1773bf(_0x3bc44a);})[_0x3a58('0x1d')](function(_0x2f7611){logger['error'](_0x3a58('0x1e'),_0x2f7611['message'],_0x3c3bf6);_0x2308a3(_0x415659['error'](0x1f4,_0x2f7611[_0x3a58('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index e132d31..7be0034 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 _0xf76a=['clone','create','put','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post'];(function(_0x27062d,_0x24b179){var _0x4f1478=function(_0x3b4489){while(--_0x3b4489){_0x27062d['push'](_0x27062d['shift']());}};_0x4f1478(++_0x24b179);}(_0xf76a,0x182));var _0xaf76=function(_0x29d4de,_0x326baf){_0x29d4de=_0x29d4de-0x0;var _0x34810f=_0xf76a[_0x29d4de];return _0x34810f;};'use strict';var multer=require('multer');var util=require(_0xaf76('0x0'));var path=require(_0xaf76('0x1'));var timeout=require(_0xaf76('0x2'));var express=require(_0xaf76('0x3'));var router=express[_0xaf76('0x4')]();var fs_extra=require(_0xaf76('0x5'));var auth=require(_0xaf76('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaf76('0x7'));var controller=require('./trunk.controller');router[_0xaf76('0x8')]('/',auth[_0xaf76('0x9')](),controller[_0xaf76('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xaf76('0xb')]);router[_0xaf76('0xc')]('/:id/clone',auth[_0xaf76('0x9')](),controller[_0xaf76('0xd')]);router[_0xaf76('0xc')]('/',auth[_0xaf76('0x9')](),controller[_0xaf76('0xe')]);router[_0xaf76('0xf')]('/:id',auth[_0xaf76('0x9')](),controller['update']);router['delete'](_0xaf76('0x10'),auth[_0xaf76('0x9')](),controller[_0xaf76('0x11')]);module[_0xaf76('0x12')]=router; \ No newline at end of file +var _0x32f7=['isAuthenticated','post','/:id/clone','clone','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id'];(function(_0x48dad2,_0x8d4555){var _0x4f2cc9=function(_0x130283){while(--_0x130283){_0x48dad2['push'](_0x48dad2['shift']());}};_0x4f2cc9(++_0x8d4555);}(_0x32f7,0x144));var _0x732f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x32f7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x732f('0x0'));var path=require(_0x732f('0x1'));var timeout=require(_0x732f('0x2'));var express=require(_0x732f('0x3'));var router=express[_0x732f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x732f('0x5'));var interaction=require(_0x732f('0x6'));var config=require(_0x732f('0x7'));var controller=require(_0x732f('0x8'));router[_0x732f('0x9')]('/',auth['isAuthenticated'](),controller[_0x732f('0xa')]);router[_0x732f('0x9')](_0x732f('0xb'),auth[_0x732f('0xc')](),controller['show']);router[_0x732f('0xd')](_0x732f('0xe'),auth[_0x732f('0xc')](),controller[_0x732f('0xf')]);router[_0x732f('0xd')]('/',auth[_0x732f('0xc')](),controller[_0x732f('0x10')]);router['put'](_0x732f('0xb'),auth[_0x732f('0xc')](),controller[_0x732f('0x11')]);router[_0x732f('0x12')](_0x732f('0xb'),auth[_0x732f('0xc')](),controller[_0x732f('0x13')]);module[_0x732f('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 35421e7..e0ae831 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 _0xad86=['port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','dynamic','nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'];(function(_0x28a7dd,_0x614f64){var _0x2d243d=function(_0x15d940){while(--_0x15d940){_0x28a7dd['push'](_0x28a7dd['shift']());}};_0x2d243d(++_0x614f64);}(_0xad86,0x11b));var _0x6ad8=function(_0xb109db,_0x2d34e4){_0xb109db=_0xb109db-0x0;var _0x25a1ca=_0xad86[_0xb109db];return _0x25a1ca;};'use strict';var Sequelize=require(_0x6ad8('0x0'));module[_0x6ad8('0x1')]={'name':{'type':Sequelize[_0x6ad8('0x2')],'allowNull':![],'unique':_0x6ad8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x5'),_0x6ad8('0x6'),_0x6ad8('0x7')),'allowNull':![],'defaultValue':_0x6ad8('0x5')},'context':{'type':Sequelize[_0x6ad8('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x8'),_0x6ad8('0x9'),_0x6ad8('0xa'),'ALLOWED',_0x6ad8('0xb'),'PROHIB_PASSED_SCREEN',_0x6ad8('0xc'),_0x6ad8('0xd'))},'deny':{'type':Sequelize[_0x6ad8('0x2')]},'permit':{'type':Sequelize[_0x6ad8('0x2')]},'secret':{'type':Sequelize[_0x6ad8('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x6ad8('0x2')]},'transport':{'type':Sequelize[_0x6ad8('0x2')],'defaultValue':_0x6ad8('0xe'),'set':function(_0x31c0fd){this[_0x6ad8('0xf')](_0x6ad8('0x10'),_0x31c0fd?_0x31c0fd[_0x6ad8('0x11')](','):null);},'get':function(){return this[_0x6ad8('0x12')]('transport')?this['getDataValue'](_0x6ad8('0x10'))[_0x6ad8('0x13')](','):null;},'comment':_0x6ad8('0x14')},'dtmfmode':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x15'),_0x6ad8('0x16'),_0x6ad8('0x17'),'inband',_0x6ad8('0x18')),'defaultValue':_0x6ad8('0x15')},'directmedia':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x19'),'no','nonat',_0x6ad8('0x1a'),_0x6ad8('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6ad8('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x6ad8('0x1c'),'set':function(_0x1f4edf){this[_0x6ad8('0xf')](_0x6ad8('0x1d'),_0x1f4edf?_0x1f4edf[_0x6ad8('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x6ad8('0x1d'))?this[_0x6ad8('0x12')](_0x6ad8('0x1d'))[_0x6ad8('0x13')](','):null;},'comment':_0x6ad8('0x1e')},'callgroup':{'type':Sequelize[_0x6ad8('0x2')]},'namedcallgroup':{'type':Sequelize[_0x6ad8('0x2')]},'pickupgroup':{'type':Sequelize[_0x6ad8('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x6ad8('0x2')]},'language':{'type':Sequelize[_0x6ad8('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x6ad8('0x2')],'defaultValue':_0x6ad8('0x1f')},'allow':{'type':Sequelize[_0x6ad8('0x2')],'allowNull':![],'defaultValue':_0x6ad8('0x20'),'set':function(_0x133947){this[_0x6ad8('0xf')]('allow',_0x133947?_0x133947[_0x6ad8('0x11')](';'):_0x6ad8('0x20'));},'get':function(){return this['getDataValue'](_0x6ad8('0x21'))?this['getDataValue'](_0x6ad8('0x21'))[_0x6ad8('0x13')](';'):null;},'comment':_0x6ad8('0x22')},'autoframing':{'type':Sequelize['ENUM'](_0x6ad8('0x19'),'no')},'insecure':{'type':Sequelize[_0x6ad8('0x2')],'defaultValue':_0x6ad8('0x23'),'set':function(_0x51edf2){this[_0x6ad8('0xf')](_0x6ad8('0x24'),_0x51edf2?_0x51edf2[_0x6ad8('0x11')](','):null);},'get':function(){return this[_0x6ad8('0x12')](_0x6ad8('0x24'))?this['getDataValue'](_0x6ad8('0x24'))[_0x6ad8('0x13')](','):null;},'comment':_0x6ad8('0x25')},'trustrpid':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x6ad8('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x19'),'no',_0x6ad8('0x26'))},'promiscredir':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x19'),'no')},'accountcode':{'type':Sequelize[_0x6ad8('0x27')](0xb)},'setvar':{'type':Sequelize[_0x6ad8('0x2')]},'callerid':{'type':Sequelize[_0x6ad8('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0x6ad8('0x19'),'no'),'defaultValue':_0x6ad8('0x19')},'busylevel':{'type':Sequelize[_0x6ad8('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x19'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x6ad8('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x6ad8('0x19'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x6ad8('0x2')]},'videosupport':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x19'),'no',_0x6ad8('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x6ad8('0x4')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0x6ad8('0x29'),_0x6ad8('0x2a'),_0x6ad8('0x2b'))},'session_expires':{'type':Sequelize[_0x6ad8('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x6ad8('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x2c'),_0x6ad8('0x2d')),'defaultValue':_0x6ad8('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0x6ad8('0x2')]},'regexten':{'type':Sequelize[_0x6ad8('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x6ad8('0x19'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x6ad8('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x6ad8('0x2')]},'defaultuser':{'type':Sequelize[_0x6ad8('0x2')]},'rtptimeout':{'type':Sequelize[_0x6ad8('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x6ad8('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x6ad8('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x19'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6ad8('0x2')]},'callbackextension':{'type':Sequelize[_0x6ad8('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x6ad8('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x6ad8('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0x6ad8('0x2')]},'contactdeny':{'type':Sequelize[_0x6ad8('0x2')]},'contactacl':{'type':Sequelize[_0x6ad8('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x6ad8('0x2')]},'use_q850_reason':{'type':Sequelize[_0x6ad8('0x2')]},'maxforwards':{'type':Sequelize[_0x6ad8('0x27')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x19'),'no')},'force_avp':{'type':Sequelize[_0x6ad8('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0x6ad8('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x19'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x6ad8('0x19'),'no',_0x6ad8('0x2e'),_0x6ad8('0x2f'))},'dtlsrekey':{'type':Sequelize[_0x6ad8('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0x6ad8('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x6ad8('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x30'),'passive',_0x6ad8('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x6ad8('0x4')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6ad8('0x2')]},'recordofffeature':{'type':Sequelize[_0x6ad8('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x6ad8('0x4')](_0x6ad8('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x6ad8('0x4')]('yes','no')},'vmexten':{'type':Sequelize[_0x6ad8('0x2')]},'mohinterpret':{'type':Sequelize[_0x6ad8('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x6ad8('0x2')]},'description':{'type':Sequelize[_0x6ad8('0x2')]},'host':{'type':Sequelize[_0x6ad8('0x2')],'defaultValue':_0x6ad8('0x32')},'canreinvite':{'type':Sequelize['ENUM'](_0x6ad8('0x19'),'no',_0x6ad8('0x33'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x6ad8('0x2')]},'otherFields':{'type':Sequelize[_0x6ad8('0x2')]},'active':{'type':Sequelize[_0x6ad8('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x6ad8('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0xb5d2=['uac','uas','pai','fingerprint','active','passive','actpass','dynamic','nonat','update','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','auto','rfc2833','outgoing','yes','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate'];(function(_0x5dc45d,_0x55f90f){var _0x4ce697=function(_0x4e6e21){while(--_0x4e6e21){_0x5dc45d['push'](_0x5dc45d['shift']());}};_0x4ce697(++_0x55f90f);}(_0xb5d2,0x183));var _0x2b5d=function(_0x1f0b68,_0x4ac25b){_0x1f0b68=_0x1f0b68-0x0;var _0x398288=_0xb5d2[_0x1f0b68];return _0x398288;};'use strict';var Sequelize=require(_0x2b5d('0x0'));module[_0x2b5d('0x1')]={'name':{'type':Sequelize[_0x2b5d('0x2')],'allowNull':![],'unique':_0x2b5d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x5'),'user',_0x2b5d('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x2b5d('0x2')],'allowNull':![],'defaultValue':_0x2b5d('0x7')},'callingpres':{'type':Sequelize[_0x2b5d('0x4')]('ALLOWED_NOT_SCREENED',_0x2b5d('0x8'),'ALLOWED_FAILED_SCREEN',_0x2b5d('0x9'),'PROHIB_NOT_SCREENED',_0x2b5d('0xa'),_0x2b5d('0xb'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x2b5d('0x2')]},'secret':{'type':Sequelize[_0x2b5d('0x2')]},'md5secret':{'type':Sequelize[_0x2b5d('0x2')]},'remotesecret':{'type':Sequelize[_0x2b5d('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x2b5d('0xc'),'set':function(_0x4131d0){this[_0x2b5d('0xd')](_0x2b5d('0xe'),_0x4131d0?_0x4131d0[_0x2b5d('0xf')](','):null);},'get':function(){return this[_0x2b5d('0x10')](_0x2b5d('0xe'))?this[_0x2b5d('0x10')](_0x2b5d('0xe'))[_0x2b5d('0x11')](','):null;},'comment':_0x2b5d('0x12')},'dtmfmode':{'type':Sequelize[_0x2b5d('0x4')]('rfc2833',_0x2b5d('0x13'),'shortinfo','inband',_0x2b5d('0x14')),'defaultValue':_0x2b5d('0x15')},'directmedia':{'type':Sequelize[_0x2b5d('0x4')]('yes','no','nonat','update',_0x2b5d('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2b5d('0x2')]},'directmediadeny':{'type':Sequelize[_0x2b5d('0x2')]},'nat':{'type':Sequelize[_0x2b5d('0x2')],'defaultValue':_0x2b5d('0x18'),'set':function(_0x32d445){this[_0x2b5d('0xd')]('nat',_0x32d445?_0x32d445[_0x2b5d('0xf')](','):null);},'get':function(){return this[_0x2b5d('0x10')]('nat')?this['getDataValue'](_0x2b5d('0x19'))[_0x2b5d('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x2b5d('0x2')]},'pickupgroup':{'type':Sequelize[_0x2b5d('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x2b5d('0x2')]},'language':{'type':Sequelize[_0x2b5d('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x2b5d('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x2b5d('0x2')],'allowNull':![],'defaultValue':_0x2b5d('0x1a'),'set':function(_0xd52d12){this[_0x2b5d('0xd')](_0x2b5d('0x1b'),_0xd52d12?_0xd52d12[_0x2b5d('0xf')](';'):_0x2b5d('0x1a'));},'get':function(){return this[_0x2b5d('0x10')](_0x2b5d('0x1b'))?this[_0x2b5d('0x10')](_0x2b5d('0x1b'))[_0x2b5d('0x11')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no')},'insecure':{'type':Sequelize[_0x2b5d('0x2')],'defaultValue':'port,invite','set':function(_0x4bfeac){this[_0x2b5d('0xd')](_0x2b5d('0x1c'),_0x4bfeac?_0x4bfeac[_0x2b5d('0xf')](','):null);},'get':function(){return this[_0x2b5d('0x10')](_0x2b5d('0x1c'))?this[_0x2b5d('0x10')](_0x2b5d('0x1c'))[_0x2b5d('0x11')](','):null;},'comment':_0x2b5d('0x1d')},'trustrpid':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no',_0x2b5d('0x1e'))},'promiscredir':{'type':Sequelize[_0x2b5d('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no')},'accountcode':{'type':Sequelize[_0x2b5d('0x1f')](0xb)},'setvar':{'type':Sequelize[_0x2b5d('0x2')]},'callerid':{'type':Sequelize[_0x2b5d('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x2b5d('0x1f')](0xb)},'allowoverlap':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x2b5d('0x2')]},'template':{'type':Sequelize[_0x2b5d('0x2')]},'videosupport':{'type':Sequelize[_0x2b5d('0x4')]('yes','no',_0x2b5d('0x20')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no')},'mailbox':{'type':Sequelize[_0x2b5d('0x2')]},'session_timers':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x21'),_0x2b5d('0x22'),_0x2b5d('0x23'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x2b5d('0x1f')](0xb)},'session_refresher':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x24'),'uas'),'defaultValue':_0x2b5d('0x25')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x2b5d('0x2')]},'fromdomain':{'type':Sequelize[_0x2b5d('0x2')]},'fromuser':{'type':Sequelize[_0x2b5d('0x2')]},'port':{'type':Sequelize[_0x2b5d('0x1f')](0x5)},'qualify':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no'),'defaultValue':_0x2b5d('0x17')},'keepalive':{'type':Sequelize[_0x2b5d('0x1f')](0xb)},'defaultip':{'type':Sequelize[_0x2b5d('0x2')]},'defaultuser':{'type':Sequelize[_0x2b5d('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x2b5d('0x1f')](0xb)},'sendrpid':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no',_0x2b5d('0x26')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x2b5d('0x2')]},'timert1':{'type':Sequelize[_0x2b5d('0x1f')](0xb)},'timerb':{'type':Sequelize[_0x2b5d('0x1f')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x2b5d('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x2b5d('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x2b5d('0x2')]},'use_q850_reason':{'type':Sequelize[_0x2b5d('0x2')]},'maxforwards':{'type':Sequelize[_0x2b5d('0x1f')](0xb)},'encryption':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x2b5d('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no',_0x2b5d('0x27'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x2b5d('0x1f')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x2b5d('0x2')]},'dtlscapath':{'type':Sequelize[_0x2b5d('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x2b5d('0x28'),_0x2b5d('0x29'),_0x2b5d('0x2a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2b5d('0x2')]},'recordofffeature':{'type':Sequelize[_0x2b5d('0x2')]},'call_limit':{'type':Sequelize[_0x2b5d('0x1f')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x2b5d('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x2b5d('0x4')](_0x2b5d('0x17'),'no')},'vmexten':{'type':Sequelize[_0x2b5d('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x2b5d('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x2b5d('0x2')],'defaultValue':_0x2b5d('0x2b')},'canreinvite':{'type':Sequelize[_0x2b5d('0x4')]('yes','no',_0x2b5d('0x2c'),_0x2b5d('0x2d'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x2b5d('0x2')]},'otherFields':{'type':Sequelize[_0x2b5d('0x2')]},'active':{'type':Sequelize[_0x2b5d('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x2b5d('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 84c7250..14f227e 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 _0x4b84=['omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','create','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','Trunks','UserProfileResource','stack','name','send','index','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','includeAll','get'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x4b84,0x1cc));var _0x44b8=function(_0x195577,_0x5de53a){_0x195577=_0x195577-0x0;var _0x13c367=_0x4b84[_0x195577];return _0x13c367;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];var jayson=require(_0x44b8('0x14'));var client=jayson['client'][_0x44b8('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x490bc6,_0x833ea3,_0x18d642,_0x4df670){return new BPromise(function(_0x63e8f6,_0x4be54c){var _0x54fa95=_0x4df670||client;return _0x54fa95[_0x44b8('0x16')](_0x490bc6,_0x18d642)[_0x44b8('0x17')](function(_0x1722da){logger[_0x44b8('0x18')]('Trunk,\x20%s,\x20%s',_0x833ea3,'request\x20sent');logger['debug'](_0x44b8('0x19'),_0x833ea3,'request\x20sent',JSON[_0x44b8('0x1a')](_0x1722da));if(_0x1722da[_0x44b8('0x1b')]){if(_0x1722da['error'][_0x44b8('0x1c')]===0x1f4){logger[_0x44b8('0x1b')]('Trunk,\x20%s,\x20%s',_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x4be54c(_0x1722da['error'][_0x44b8('0x1d')]);}logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);return _0x63e8f6(_0x1722da[_0x44b8('0x1b')][_0x44b8('0x1d')]);}else{logger[_0x44b8('0x18')](_0x44b8('0x1e'),_0x833ea3,_0x44b8('0x1f'));_0x63e8f6(_0x1722da[_0x44b8('0x20')][_0x44b8('0x1d')]);}})['catch'](function(_0x56549a){logger[_0x44b8('0x1b')](_0x44b8('0x1e'),_0x833ea3,_0x56549a);_0x4be54c(_0x56549a);});});}function respondWithStatusCode(_0x1418db,_0x305a5c){_0x305a5c=_0x305a5c||0xcc;return function(_0x51a34a){if(_0x51a34a){return _0x1418db[_0x44b8('0x21')](_0x305a5c);}return _0x1418db['status'](_0x305a5c)[_0x44b8('0x22')]();};}function respondWithResult(_0x228c81,_0x25a0c1){_0x25a0c1=_0x25a0c1||0xc8;return function(_0x47689e){if(_0x47689e){return _0x228c81[_0x44b8('0x23')](_0x25a0c1)['json'](_0x47689e);}};}function respondWithFilteredResult(_0x474f01,_0x502acf){return function(_0x41d673){if(_0x41d673){var _0x350482=typeof _0x502acf['offset']===_0x44b8('0x24')&&typeof _0x502acf[_0x44b8('0x25')]===_0x44b8('0x24');var _0x59c1bf=_0x41d673[_0x44b8('0x26')];var _0x242342=_0x350482?0x0:_0x502acf['offset'];var _0x2e0174=_0x350482?_0x41d673['count']:_0x502acf[_0x44b8('0x27')]+_0x502acf['limit'];var _0x559f0b;if(_0x2e0174>=_0x59c1bf){_0x2e0174=_0x59c1bf;_0x559f0b=0xc8;}else{_0x559f0b=0xce;}_0x474f01['status'](_0x559f0b);return _0x474f01[_0x44b8('0x28')](_0x44b8('0x29'),_0x242342+'-'+_0x2e0174+'/'+_0x59c1bf)[_0x44b8('0x2a')](_0x41d673);}return null;};}function patchUpdates(_0x1bd1be){return function(_0x38cd17){try{jsonpatch[_0x44b8('0x2b')](_0x38cd17,_0x1bd1be,!![]);}catch(_0x2cf205){return BPromise[_0x44b8('0x2c')](_0x2cf205);}return _0x38cd17[_0x44b8('0x2d')]();};}function saveUpdates(_0x28f918,_0x5e1129){return function(_0x417d81){if(_0x417d81){return _0x417d81[_0x44b8('0x2e')](_0x28f918)['then'](function(_0x261ff2){return _0x261ff2;});}return null;};}function removeEntity(_0x538db7,_0x212983){return function(_0x1652cb){if(_0x1652cb){return _0x1652cb[_0x44b8('0x2f')]()[_0x44b8('0x17')](function(){var _0x1b63a7=_0x1652cb['get']({'plain':!![]});var _0x16b706=_0x44b8('0x30');return db[_0x44b8('0x31')][_0x44b8('0x2f')]({'where':{'type':_0x16b706,'resourceId':_0x1b63a7['id']}})[_0x44b8('0x17')](function(){return _0x1652cb;});})['then'](function(){_0x538db7[_0x44b8('0x23')](0xcc)[_0x44b8('0x22')]();});}};}function handleEntityNotFound(_0x1a30fc,_0x3e93af){return function(_0x140a79){if(!_0x140a79){_0x1a30fc[_0x44b8('0x21')](0x194);}return _0x140a79;};}function handleError(_0x2e8b88,_0x14a9d7){_0x14a9d7=_0x14a9d7||0x1f4;return function(_0x28c10d){logger[_0x44b8('0x1b')](_0x28c10d[_0x44b8('0x32')]);if(_0x28c10d[_0x44b8('0x33')]){delete _0x28c10d[_0x44b8('0x33')];}_0x2e8b88[_0x44b8('0x23')](_0x14a9d7)[_0x44b8('0x34')](_0x28c10d);};}exports[_0x44b8('0x35')]=function(_0x323c50,_0xeff999){var _0x28faa9={},_0x3984f8={},_0x2c02d6={'count':0x0,'rows':[]};var _0x282345=_['map'](db[_0x44b8('0x36')][_0x44b8('0x37')],function(_0x4fcfa0){return{'name':_0x4fcfa0[_0x44b8('0x38')],'type':_0x4fcfa0[_0x44b8('0x39')][_0x44b8('0x3a')]};});_0x3984f8[_0x44b8('0x3b')]=_['map'](_0x282345,_0x44b8('0x33'));_0x3984f8[_0x44b8('0x3c')]=_[_0x44b8('0x3d')](_0x323c50[_0x44b8('0x3c')]);_0x3984f8[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],_0x3984f8[_0x44b8('0x3c')]);_0x28faa9[_0x44b8('0x40')]=_[_0x44b8('0x3f')](_0x3984f8[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x28faa9[_0x44b8('0x40')]=_0x28faa9[_0x44b8('0x40')]['length']?_0x28faa9[_0x44b8('0x40')]:_0x3984f8[_0x44b8('0x3b')];if(!_0x323c50[_0x44b8('0x3c')]['hasOwnProperty'](_0x44b8('0x42'))){_0x28faa9[_0x44b8('0x25')]=qs[_0x44b8('0x25')](_0x323c50['query'][_0x44b8('0x25')]);_0x28faa9[_0x44b8('0x27')]=qs[_0x44b8('0x27')](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x27')]);}_0x28faa9['order']=qs['sort'](_0x323c50[_0x44b8('0x3c')][_0x44b8('0x43')]);_0x28faa9[_0x44b8('0x44')]=qs[_0x44b8('0x3e')](_[_0x44b8('0x45')](_0x323c50[_0x44b8('0x3c')],_0x3984f8[_0x44b8('0x3e')]),_0x282345);if(_0x323c50[_0x44b8('0x3c')][_0x44b8('0x46')]){_0x28faa9[_0x44b8('0x44')]=_[_0x44b8('0x47')](_0x28faa9[_0x44b8('0x44')],{'$or':_[_0x44b8('0x48')](_0x282345,function(_0x1236c7){if(_0x1236c7[_0x44b8('0x39')]!==_0x44b8('0x49')){var _0xce06dc={};_0xce06dc[_0x1236c7[_0x44b8('0x33')]]={'$like':'%'+_0x323c50[_0x44b8('0x3c')]['filter']+'%'};return _0xce06dc;}})});}_0x28faa9=_['merge']({},_0x28faa9,_0x323c50[_0x44b8('0x4a')]);var _0x1df74b={'where':_0x28faa9[_0x44b8('0x44')]};return db[_0x44b8('0x36')][_0x44b8('0x26')](_0x1df74b)[_0x44b8('0x17')](function(_0x411ed6){_0x2c02d6['count']=_0x411ed6;if(_0x323c50[_0x44b8('0x3c')]['includeAll']){_0x28faa9[_0x44b8('0x4b')]=[{'all':!![]}];}return db[_0x44b8('0x36')][_0x44b8('0x4c')](_0x28faa9);})[_0x44b8('0x17')](function(_0x103d57){_0x2c02d6[_0x44b8('0x4d')]=_0x103d57;return _0x2c02d6;})['then'](respondWithFilteredResult(_0xeff999,_0x28faa9))[_0x44b8('0x4e')](handleError(_0xeff999,null));};exports[_0x44b8('0x4f')]=function(_0x10602c,_0x25d266){var _0x4ccc77={'raw':![],'where':{'id':_0x10602c[_0x44b8('0x50')]['id']}},_0x4e4ed1={};_0x4e4ed1[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')][_0x44b8('0x37')]);_0x4e4ed1['query']=_[_0x44b8('0x3d')](_0x10602c[_0x44b8('0x3c')]);_0x4e4ed1[_0x44b8('0x3e')]=_[_0x44b8('0x3f')](_0x4e4ed1[_0x44b8('0x3b')],_0x4e4ed1['query']);_0x4ccc77['attributes']=_[_0x44b8('0x3f')](_0x4e4ed1['model'],qs[_0x44b8('0x41')](_0x10602c['query'][_0x44b8('0x41')]));_0x4ccc77[_0x44b8('0x40')]=_0x4ccc77[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4ccc77[_0x44b8('0x40')]:_0x4e4ed1[_0x44b8('0x3b')];if(_0x10602c[_0x44b8('0x3c')]['includeAll']){_0x4ccc77[_0x44b8('0x4b')]=[{'all':!![]}];}_0x4ccc77=_[_0x44b8('0x47')]({},_0x4ccc77,_0x10602c[_0x44b8('0x4a')]);return db['Trunk'][_0x44b8('0x52')](_0x4ccc77)[_0x44b8('0x17')](handleEntityNotFound(_0x25d266,null))[_0x44b8('0x17')](respondWithResult(_0x25d266,null))[_0x44b8('0x4e')](handleError(_0x25d266,null));};exports['clone']=function(_0x399d6b,_0x308f7b){var _0x4a6e55={'where':{'id':_0x399d6b[_0x44b8('0x50')]['id']}},_0x3de425={};_0x3de425[_0x44b8('0x3b')]=_[_0x44b8('0x3d')](db[_0x44b8('0x36')]['rawAttributes']);_0x4a6e55['attributes']=_[_0x44b8('0x3f')](_0x3de425[_0x44b8('0x3b')],qs[_0x44b8('0x41')](_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x41')]));_0x4a6e55[_0x44b8('0x40')]=_0x4a6e55[_0x44b8('0x40')][_0x44b8('0x51')]?_0x4a6e55[_0x44b8('0x40')]:_0x3de425[_0x44b8('0x3b')];if(_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]){_0x4a6e55['include']=[{'all':!![]}];}_0x4a6e55=_[_0x44b8('0x47')]({},_0x4a6e55,_0x399d6b[_0x44b8('0x4a')]);return db[_0x44b8('0x36')][_0x44b8('0x52')](_0x4a6e55)[_0x44b8('0x17')](handleEntityNotFound(_0x308f7b,null))[_0x44b8('0x17')](function(_0x426a6a){if(_0x426a6a){var _0x172ff3=_0x426a6a[_0x44b8('0x54')]({'plain':!![]});_0x172ff3=qs[_0x44b8('0x55')](_0x172ff3,['id',_0x44b8('0x56'),_0x44b8('0x57')]);_0x399d6b[_0x44b8('0x58')]=_[_0x44b8('0x55')](_0x399d6b[_0x44b8('0x58')],['id',_0x44b8('0x56'),_0x44b8('0x57')]);return db[_0x44b8('0x36')]['create'](_[_0x44b8('0x47')](_0x172ff3,_0x399d6b[_0x44b8('0x58')]),{'include':_0x399d6b[_0x44b8('0x3c')][_0x44b8('0x53')]?[{'all':!![]}]:undefined})[_0x44b8('0x17')](function(_0x29ed5d){var _0x2ecf65=_0x399d6b['user'][_0x44b8('0x54')]({'plain':!![]});if(!_0x2ecf65)throw new Error(_0x44b8('0x59'));if(_0x2ecf65['role']===_0x44b8('0x5a')){var _0x3354bd=_0x29ed5d['get']({'plain':!![]});var _0x37e42e=_0x44b8('0x30');return db[_0x44b8('0x5b')]['find']({'where':{'name':_0x37e42e,'userProfileId':_0x2ecf65[_0x44b8('0x5c')]},'raw':!![]})['then'](function(_0x36cdd8){if(_0x36cdd8&&_0x36cdd8['autoAssociation']===0x0){return db[_0x44b8('0x31')][_0x44b8('0x5d')]({'name':_0x3354bd[_0x44b8('0x33')],'resourceId':_0x3354bd['id'],'type':_0x36cdd8[_0x44b8('0x33')],'sectionId':_0x36cdd8['id']},{})[_0x44b8('0x17')](function(){return _0x29ed5d;});}else{return _0x29ed5d;}})[_0x44b8('0x4e')](function(_0x4c7edd){logger[_0x44b8('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c7edd);throw _0x4c7edd;});}return _0x29ed5d;});}})[_0x44b8('0x17')](respondWithResult(_0x308f7b,0xc9))[_0x44b8('0x4e')](handleError(_0x308f7b,null));};exports['create']=function(_0x3f9438,_0x1ee26b,_0x1cf31f){var _0x30d60f;return db[_0x44b8('0x36')][_0x44b8('0x5d')](_0x3f9438[_0x44b8('0x58')],{'raw':!![]})[_0x44b8('0x17')](function(_0x3f9102){_0x30d60f=_0x3f9102;return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0x52381a){var _0xd20d0=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],_0x44b8('0x60')),_0x44b8('0x61'));var _0x5bff09=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],_0x44b8('0x63')),_0x44b8('0x61'));var _0x59060b=ejs[_0x44b8('0x64')](_0xd20d0,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x59060b);if(_0x30d60f[_0x44b8('0x67')]){var _0x2e02d7=ejs[_0x44b8('0x64')](_0x5bff09,{'trunks':_0x52381a||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x2e02d7);}})['then'](function(){return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x5d'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x17')](function(){var _0x5b26e8=_0x3f9438['user']['get']({'plain':!![]});if(!_0x5b26e8)throw new Error(_0x44b8('0x59'));if(_0x5b26e8[_0x44b8('0x6b')]===_0x44b8('0x5a')){var _0x46e20f=_0x30d60f[_0x44b8('0x54')]({'plain':!![]});return db['UserProfileSection'][_0x44b8('0x52')]({'where':{'name':'Trunks','userProfileId':_0x5b26e8[_0x44b8('0x5c')]},'raw':!![]})[_0x44b8('0x17')](function(_0xea2c3e){if(_0xea2c3e&&_0xea2c3e['autoAssociation']===0x0){return db['UserProfileResource'][_0x44b8('0x5d')]({'name':_0x46e20f[_0x44b8('0x33')],'resourceId':_0x46e20f['id'],'type':_0xea2c3e[_0x44b8('0x33')],'sectionId':_0xea2c3e['id']},{})['then'](function(){return _0x30d60f;});}else{return _0x30d60f;}})[_0x44b8('0x4e')](function(_0x36f217){logger[_0x44b8('0x1b')](_0x44b8('0x6c'),_0x36f217);throw _0x36f217;});}return _0x30d60f;})[_0x44b8('0x17')](respondWithResult(_0x1ee26b,0xc9))['catch'](handleError(_0x1ee26b,null));};exports[_0x44b8('0x2e')]=function(_0x1888f8,_0xbbdab9,_0x2a8ccc){var _0x220f1b;return db['Trunk'][_0x44b8('0x52')]({'where':{'id':_0x1888f8[_0x44b8('0x50')]['id']}})[_0x44b8('0x17')](handleEntityNotFound(_0xbbdab9,null))[_0x44b8('0x17')](saveUpdates(_0x1888f8[_0x44b8('0x58')],null))[_0x44b8('0x17')](function(_0x1c7ef2){if(_0x1c7ef2){_0x220f1b=_0x1c7ef2;return db['Trunk'][_0x44b8('0x4c')]({'raw':!![]});}})[_0x44b8('0x17')](function(_0x4c3fea){if(_0x4c3fea){var _0x3bb7d8=fs[_0x44b8('0x5e')](path['join'](config[_0x44b8('0x62')],'server/files/templates/trunk.ejs'),'utf8');var _0x31d3b6=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x36334a=ejs[_0x44b8('0x64')](_0x3bb7d8,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x36334a);var _0x1a5621=ejs[_0x44b8('0x64')](_0x31d3b6,{'trunks':_0x4c3fea||[]});fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x1a5621);return respondWithRpcPromise('Reload',_0x44b8('0x2e'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x55f4e4){if(_0x55f4e4){return _0x220f1b;}})[_0x44b8('0x17')](respondWithResult(_0xbbdab9,null))['catch'](handleError(_0xbbdab9,null));};exports[_0x44b8('0x2f')]=function(_0x1e37fd,_0x268e1e,_0x306793){var _0x3a9780;return db[_0x44b8('0x36')][_0x44b8('0x52')]({'where':{'id':_0x1e37fd[_0x44b8('0x50')]['id']}})['then'](handleEntityNotFound(_0x268e1e,null))[_0x44b8('0x17')](removeEntity(_0x268e1e,null))[_0x44b8('0x17')](function(){return db[_0x44b8('0x36')][_0x44b8('0x4c')]({'raw':!![]});})[_0x44b8('0x17')](function(_0xee44b3){var _0x10034d=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config['root'],'server/files/templates/trunk.ejs'),_0x44b8('0x61'));var _0x553aa9=fs[_0x44b8('0x5e')](path[_0x44b8('0x5f')](config[_0x44b8('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x4b22e7=ejs[_0x44b8('0x64')](_0x10034d,{'trunks':_0xee44b3});var _0x4860af=ejs[_0x44b8('0x64')](_0x553aa9,{'trunks':_0xee44b3});fs[_0x44b8('0x65')](_0x44b8('0x66'),_0x4b22e7);fs[_0x44b8('0x65')](_0x44b8('0x68'),_0x4860af);return respondWithRpcPromise(_0x44b8('0x69'),_0x44b8('0x2f'),{'module':_0x44b8('0x6a')});})[_0x44b8('0x4e')](handleError(_0x268e1e,null));}; \ No newline at end of file +var _0xbec5=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','/etc/asterisk/sip_xcally_trunks.conf','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','Trunks','UserProfileResource','destroy','stack','name','send','map','Trunk','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','attributes','find','clone','get','omit','updatedAt','body','createdAt','create','user','role','UserProfileSection','userProfileId','autoAssociation','join','server/files/templates/trunk.ejs','utf8'];(function(_0x440bb1,_0x49ea67){var _0x1116e5=function(_0x183042){while(--_0x183042){_0x440bb1['push'](_0x440bb1['shift']());}};_0x1116e5(++_0x49ea67);}(_0xbec5,0xe5));var _0x5bec=function(_0x254076,_0x5e7b8d){_0x254076=_0x254076-0x0;var _0x21a93e=_0xbec5[_0x254076];return _0x21a93e;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];var jayson=require(_0x5bec('0x19'));var client=jayson['client'][_0x5bec('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xaa984d,_0x35393a,_0x6888a4,_0x3198e0){return new BPromise(function(_0xcd6d90,_0x24dcd6){var _0x43fd2a=_0x3198e0||client;return _0x43fd2a[_0x5bec('0x1b')](_0xaa984d,_0x6888a4)[_0x5bec('0x1c')](function(_0x31b9e4){logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,'request\x20sent');logger['debug'](_0x5bec('0x1f'),_0x35393a,_0x5bec('0x20'),JSON[_0x5bec('0x21')](_0x31b9e4));if(_0x31b9e4[_0x5bec('0x22')]){if(_0x31b9e4['error']['code']===0x1f4){logger[_0x5bec('0x22')](_0x5bec('0x1e'),_0x35393a,_0x31b9e4['error'][_0x5bec('0x23')]);return _0x24dcd6(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x31b9e4[_0x5bec('0x22')]['message']);return _0xcd6d90(_0x31b9e4[_0x5bec('0x22')][_0x5bec('0x23')]);}else{logger[_0x5bec('0x1d')](_0x5bec('0x1e'),_0x35393a,_0x5bec('0x20'));_0xcd6d90(_0x31b9e4['result'][_0x5bec('0x23')]);}})['catch'](function(_0x2b2d26){logger[_0x5bec('0x22')]('Trunk,\x20%s,\x20%s',_0x35393a,_0x2b2d26);_0x24dcd6(_0x2b2d26);});});}function respondWithStatusCode(_0xa414f8,_0xbef70b){_0xbef70b=_0xbef70b||0xcc;return function(_0x4e0ca2){if(_0x4e0ca2){return _0xa414f8[_0x5bec('0x24')](_0xbef70b);}return _0xa414f8[_0x5bec('0x25')](_0xbef70b)[_0x5bec('0x26')]();};}function respondWithResult(_0x20da89,_0x226d55){_0x226d55=_0x226d55||0xc8;return function(_0x131143){if(_0x131143){return _0x20da89[_0x5bec('0x25')](_0x226d55)['json'](_0x131143);}};}function respondWithFilteredResult(_0x5b63ab,_0x5e44b3){return function(_0x2961bd){if(_0x2961bd){var _0x2cdd2f=typeof _0x5e44b3[_0x5bec('0x27')]==='undefined'&&typeof _0x5e44b3[_0x5bec('0x28')]===_0x5bec('0x29');var _0x57331b=_0x2961bd[_0x5bec('0x2a')];var _0x63ac8=_0x2cdd2f?0x0:_0x5e44b3['offset'];var _0x5336b3=_0x2cdd2f?_0x2961bd[_0x5bec('0x2a')]:_0x5e44b3[_0x5bec('0x27')]+_0x5e44b3[_0x5bec('0x28')];var _0x2c7a7b;if(_0x5336b3>=_0x57331b){_0x5336b3=_0x57331b;_0x2c7a7b=0xc8;}else{_0x2c7a7b=0xce;}_0x5b63ab[_0x5bec('0x25')](_0x2c7a7b);return _0x5b63ab[_0x5bec('0x2b')]('Content-Range',_0x63ac8+'-'+_0x5336b3+'/'+_0x57331b)[_0x5bec('0x2c')](_0x2961bd);}return null;};}function patchUpdates(_0x59b5b6){return function(_0x45863b){try{jsonpatch[_0x5bec('0x2d')](_0x45863b,_0x59b5b6,!![]);}catch(_0x3034c9){return BPromise[_0x5bec('0x2e')](_0x3034c9);}return _0x45863b['save']();};}function saveUpdates(_0x2b42c8,_0x1aba46){return function(_0xfc7d41){if(_0xfc7d41){return _0xfc7d41['update'](_0x2b42c8)[_0x5bec('0x1c')](function(_0x4cfb89){return _0x4cfb89;});}return null;};}function removeEntity(_0x14cdbf,_0x207192){return function(_0x29df14){if(_0x29df14){return _0x29df14['destroy']()[_0x5bec('0x1c')](function(){var _0x420ad4=_0x29df14['get']({'plain':!![]});var _0x34b441=_0x5bec('0x2f');return db[_0x5bec('0x30')][_0x5bec('0x31')]({'where':{'type':_0x34b441,'resourceId':_0x420ad4['id']}})[_0x5bec('0x1c')](function(){return _0x29df14;});})['then'](function(){_0x14cdbf[_0x5bec('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3793,_0x384f04){return function(_0x182b86){if(!_0x182b86){_0x2d3793[_0x5bec('0x24')](0x194);}return _0x182b86;};}function handleError(_0x2e421e,_0x1923fc){_0x1923fc=_0x1923fc||0x1f4;return function(_0x49c8ef){logger[_0x5bec('0x22')](_0x49c8ef[_0x5bec('0x32')]);if(_0x49c8ef[_0x5bec('0x33')]){delete _0x49c8ef['name'];}_0x2e421e[_0x5bec('0x25')](_0x1923fc)[_0x5bec('0x34')](_0x49c8ef);};}exports['index']=function(_0xdb0430,_0x58c34e){var _0x400e22={},_0x2c0b08={},_0x402e5d={'count':0x0,'rows':[]};var _0x49cdfa=_[_0x5bec('0x35')](db[_0x5bec('0x36')][_0x5bec('0x37')],function(_0x139859){return{'name':_0x139859[_0x5bec('0x38')],'type':_0x139859[_0x5bec('0x39')][_0x5bec('0x3a')]};});_0x2c0b08['model']=_[_0x5bec('0x35')](_0x49cdfa,_0x5bec('0x33'));_0x2c0b08[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0xdb0430['query']);_0x2c0b08[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],_0x2c0b08['query']);_0x400e22['attributes']=_[_0x5bec('0x3e')](_0x2c0b08[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x40')]));_0x400e22['attributes']=_0x400e22['attributes'][_0x5bec('0x41')]?_0x400e22['attributes']:_0x2c0b08[_0x5bec('0x3f')];if(!_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x42')]('nolimit')){_0x400e22[_0x5bec('0x28')]=qs[_0x5bec('0x28')](_0xdb0430['query'][_0x5bec('0x28')]);_0x400e22[_0x5bec('0x27')]=qs[_0x5bec('0x27')](_0xdb0430[_0x5bec('0x3b')][_0x5bec('0x27')]);}_0x400e22[_0x5bec('0x43')]=qs[_0x5bec('0x44')](_0xdb0430['query']['sort']);_0x400e22[_0x5bec('0x45')]=qs['filters'](_['pick'](_0xdb0430[_0x5bec('0x3b')],_0x2c0b08['filters']),_0x49cdfa);if(_0xdb0430['query']['filter']){_0x400e22[_0x5bec('0x45')]=_[_0x5bec('0x46')](_0x400e22[_0x5bec('0x45')],{'$or':_[_0x5bec('0x35')](_0x49cdfa,function(_0x48858a){if(_0x48858a[_0x5bec('0x39')]!==_0x5bec('0x47')){var _0xa4d32={};_0xa4d32[_0x48858a[_0x5bec('0x33')]]={'$like':'%'+_0xdb0430['query'][_0x5bec('0x48')]+'%'};return _0xa4d32;}})});}_0x400e22=_[_0x5bec('0x46')]({},_0x400e22,_0xdb0430[_0x5bec('0x49')]);var _0x51a3f9={'where':_0x400e22[_0x5bec('0x45')]};return db['Trunk'][_0x5bec('0x2a')](_0x51a3f9)[_0x5bec('0x1c')](function(_0x133d5c){_0x402e5d[_0x5bec('0x2a')]=_0x133d5c;if(_0xdb0430['query'][_0x5bec('0x4a')]){_0x400e22[_0x5bec('0x4b')]=[{'all':!![]}];}return db[_0x5bec('0x36')][_0x5bec('0x4c')](_0x400e22);})[_0x5bec('0x1c')](function(_0x123758){_0x402e5d[_0x5bec('0x4d')]=_0x123758;return _0x402e5d;})['then'](respondWithFilteredResult(_0x58c34e,_0x400e22))[_0x5bec('0x4e')](handleError(_0x58c34e,null));};exports[_0x5bec('0x4f')]=function(_0x5775ca,_0x273e09){var _0x3e6180={'raw':![],'where':{'id':_0x5775ca[_0x5bec('0x50')]['id']}},_0x34ee24={};_0x34ee24[_0x5bec('0x3f')]=_[_0x5bec('0x3c')](db[_0x5bec('0x36')]['rawAttributes']);_0x34ee24[_0x5bec('0x3b')]=_['keys'](_0x5775ca[_0x5bec('0x3b')]);_0x34ee24[_0x5bec('0x3d')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],_0x34ee24[_0x5bec('0x3b')]);_0x3e6180[_0x5bec('0x51')]=_[_0x5bec('0x3e')](_0x34ee24[_0x5bec('0x3f')],qs[_0x5bec('0x40')](_0x5775ca[_0x5bec('0x3b')]['fields']));_0x3e6180[_0x5bec('0x51')]=_0x3e6180['attributes']['length']?_0x3e6180[_0x5bec('0x51')]:_0x34ee24['model'];if(_0x5775ca['query'][_0x5bec('0x4a')]){_0x3e6180[_0x5bec('0x4b')]=[{'all':!![]}];}_0x3e6180=_[_0x5bec('0x46')]({},_0x3e6180,_0x5775ca['options']);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0x3e6180)[_0x5bec('0x1c')](handleEntityNotFound(_0x273e09,null))[_0x5bec('0x1c')](respondWithResult(_0x273e09,null))['catch'](handleError(_0x273e09,null));};exports[_0x5bec('0x53')]=function(_0x209da3,_0x9cae50){var _0xc8563a={'where':{'id':_0x209da3[_0x5bec('0x50')]['id']}},_0x2f736c={};_0x2f736c[_0x5bec('0x3f')]=_['keys'](db['Trunk'][_0x5bec('0x37')]);_0xc8563a['attributes']=_[_0x5bec('0x3e')](_0x2f736c[_0x5bec('0x3f')],qs['fields'](_0x209da3[_0x5bec('0x3b')]['fields']));_0xc8563a[_0x5bec('0x51')]=_0xc8563a[_0x5bec('0x51')][_0x5bec('0x41')]?_0xc8563a[_0x5bec('0x51')]:_0x2f736c[_0x5bec('0x3f')];if(_0x209da3[_0x5bec('0x3b')][_0x5bec('0x4a')]){_0xc8563a[_0x5bec('0x4b')]=[{'all':!![]}];}_0xc8563a=_[_0x5bec('0x46')]({},_0xc8563a,_0x209da3[_0x5bec('0x49')]);return db[_0x5bec('0x36')][_0x5bec('0x52')](_0xc8563a)[_0x5bec('0x1c')](handleEntityNotFound(_0x9cae50,null))[_0x5bec('0x1c')](function(_0x51b25d){if(_0x51b25d){var _0x2e33a7=_0x51b25d[_0x5bec('0x54')]({'plain':!![]});_0x2e33a7=qs[_0x5bec('0x55')](_0x2e33a7,['id','createdAt',_0x5bec('0x56')]);_0x209da3[_0x5bec('0x57')]=_[_0x5bec('0x55')](_0x209da3[_0x5bec('0x57')],['id',_0x5bec('0x58'),'updatedAt']);return db[_0x5bec('0x36')][_0x5bec('0x59')](_[_0x5bec('0x46')](_0x2e33a7,_0x209da3[_0x5bec('0x57')]),{'include':_0x209da3['query'][_0x5bec('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x2b701f){var _0x38deb0=_0x209da3[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0x38deb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38deb0[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x1b3c40=_0x2b701f[_0x5bec('0x54')]({'plain':!![]});var _0xc3e3df=_0x5bec('0x2f');return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0xc3e3df,'userProfileId':_0x38deb0[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0xfa751f){if(_0xfa751f&&_0xfa751f[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x1b3c40[_0x5bec('0x33')],'resourceId':_0x1b3c40['id'],'type':_0xfa751f['name'],'sectionId':_0xfa751f['id']},{})[_0x5bec('0x1c')](function(){return _0x2b701f;});}else{return _0x2b701f;}})[_0x5bec('0x4e')](function(_0x4e899c){logger[_0x5bec('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e899c);throw _0x4e899c;});}return _0x2b701f;});}})[_0x5bec('0x1c')](respondWithResult(_0x9cae50,0xc9))[_0x5bec('0x4e')](handleError(_0x9cae50,null));};exports['create']=function(_0x5a2a85,_0xd54be0,_0xcac51d){var _0xb6cf85;return db[_0x5bec('0x36')][_0x5bec('0x59')](_0x5a2a85['body'],{'raw':!![]})[_0x5bec('0x1c')](function(_0x39cb06){_0xb6cf85=_0x39cb06;return db['Trunk'][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x44a945){var _0x34f31c=fs['readFileSync'](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),_0x5bec('0x61'));var _0x3ede1d=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x1ee139=ejs[_0x5bec('0x65')](_0x34f31c,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ee139);if(_0xb6cf85['registry']){var _0x3c305e=ejs[_0x5bec('0x65')](_0x3ede1d,{'trunks':_0x44a945||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0x3c305e);}})[_0x5bec('0x1c')](function(){return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x59'),{'module':'chan_sip.so'});})['then'](function(){var _0xc81e8f=_0x5a2a85[_0x5bec('0x5a')][_0x5bec('0x54')]({'plain':!![]});if(!_0xc81e8f)throw new Error(_0x5bec('0x69'));if(_0xc81e8f[_0x5bec('0x5b')]===_0x5bec('0x5a')){var _0x17cd00=_0xb6cf85[_0x5bec('0x54')]({'plain':!![]});return db[_0x5bec('0x5c')][_0x5bec('0x52')]({'where':{'name':_0x5bec('0x2f'),'userProfileId':_0xc81e8f[_0x5bec('0x5d')]},'raw':!![]})[_0x5bec('0x1c')](function(_0x325044){if(_0x325044&&_0x325044[_0x5bec('0x5e')]===0x0){return db[_0x5bec('0x30')][_0x5bec('0x59')]({'name':_0x17cd00[_0x5bec('0x33')],'resourceId':_0x17cd00['id'],'type':_0x325044[_0x5bec('0x33')],'sectionId':_0x325044['id']},{})[_0x5bec('0x1c')](function(){return _0xb6cf85;});}else{return _0xb6cf85;}})['catch'](function(_0x2e76c0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e76c0);throw _0x2e76c0;});}return _0xb6cf85;})[_0x5bec('0x1c')](respondWithResult(_0xd54be0,0xc9))['catch'](handleError(_0xd54be0,null));};exports[_0x5bec('0x6a')]=function(_0x5d6af3,_0x5ca280,_0x2e849b){var _0x1b5ec0;return db['Trunk'][_0x5bec('0x52')]({'where':{'id':_0x5d6af3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x5ca280,null))[_0x5bec('0x1c')](saveUpdates(_0x5d6af3[_0x5bec('0x57')],null))[_0x5bec('0x1c')](function(_0xb76af2){if(_0xb76af2){_0x1b5ec0=_0xb76af2;return db[_0x5bec('0x36')]['findAll']({'raw':!![]});}})['then'](function(_0x2e8cd3){if(_0x2e8cd3){var _0x122c7f=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config['root'],_0x5bec('0x60')),'utf8');var _0x44ceec=fs[_0x5bec('0x62')](path[_0x5bec('0x5f')](config[_0x5bec('0x63')],_0x5bec('0x64')),_0x5bec('0x61'));var _0x38be2d=ejs[_0x5bec('0x65')](_0x122c7f,{'trunks':_0x2e8cd3||[]});fs['writeFileSync'](_0x5bec('0x6b'),_0x38be2d);var _0xe5f9e5=ejs[_0x5bec('0x65')](_0x44ceec,{'trunks':_0x2e8cd3||[]});fs[_0x5bec('0x66')](_0x5bec('0x67'),_0xe5f9e5);return respondWithRpcPromise('Reload',_0x5bec('0x6a'),{'module':_0x5bec('0x6c')});}return null;})['then'](function(_0x195c12){if(_0x195c12){return _0x1b5ec0;}})['then'](respondWithResult(_0x5ca280,null))[_0x5bec('0x4e')](handleError(_0x5ca280,null));};exports[_0x5bec('0x31')]=function(_0x4646a3,_0x313e1c,_0x437c3e){var _0x3d7600;return db[_0x5bec('0x36')][_0x5bec('0x52')]({'where':{'id':_0x4646a3[_0x5bec('0x50')]['id']}})[_0x5bec('0x1c')](handleEntityNotFound(_0x313e1c,null))[_0x5bec('0x1c')](removeEntity(_0x313e1c,null))[_0x5bec('0x1c')](function(){return db[_0x5bec('0x36')][_0x5bec('0x4c')]({'raw':!![]});})[_0x5bec('0x1c')](function(_0x1eaf2f){var _0x317e2a=fs[_0x5bec('0x62')](path['join'](config[_0x5bec('0x63')],'server/files/templates/trunk.ejs'),_0x5bec('0x61'));var _0xfcef92=fs['readFileSync'](path['join'](config[_0x5bec('0x63')],'server/files/templates/registry.ejs'),_0x5bec('0x61'));var _0x4b70df=ejs[_0x5bec('0x65')](_0x317e2a,{'trunks':_0x1eaf2f});var _0x27b40b=ejs['render'](_0xfcef92,{'trunks':_0x1eaf2f});fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4b70df);fs[_0x5bec('0x66')]('/etc/asterisk/sip_xcally_registers.conf',_0x27b40b);return respondWithRpcPromise(_0x5bec('0x68'),_0x5bec('0x31'),{'module':'chan_sip.so'});})[_0x5bec('0x4e')](handleError(_0x313e1c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 3069731..81fe083 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 _0x8af5=['Trunk','tools_trunks','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports'];(function(_0x4b2345,_0x5d1200){var _0x1c329a=function(_0x135167){while(--_0x135167){_0x4b2345['push'](_0x4b2345['shift']());}};_0x1c329a(++_0x5d1200);}(_0x8af5,0x147));var _0x58af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8af5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x58af('0x0'));var util=require('util');var logger=require(_0x58af('0x1'))(_0x58af('0x2'));var moment=require(_0x58af('0x3'));var BPromise=require(_0x58af('0x4'));var rp=require(_0x58af('0x5'));var fs=require('fs');var path=require(_0x58af('0x6'));var rimraf=require(_0x58af('0x7'));var config=require(_0x58af('0x8'));var attributes=require(_0x58af('0x9'));module[_0x58af('0xa')]=function(_0x2b4e63,_0x266709){return _0x2b4e63['define'](_0x58af('0xb'),attributes,{'tableName':_0x58af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb51=['define','Trunk','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./trunk.attributes','exports'];(function(_0xf667d3,_0x124111){var _0x4f633e=function(_0x8f8682){while(--_0x8f8682){_0xf667d3['push'](_0xf667d3['shift']());}};_0x4f633e(++_0x124111);}(_0xbb51,0x1a6));var _0x1bb5=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xbb51[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x1bb5('0x0'));var util=require(_0x1bb5('0x1'));var logger=require(_0x1bb5('0x2'))(_0x1bb5('0x3'));var moment=require('moment');var BPromise=require(_0x1bb5('0x4'));var rp=require(_0x1bb5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1bb5('0x6'));var config=require(_0x1bb5('0x7'));var attributes=require(_0x1bb5('0x8'));module[_0x1bb5('0x9')]=function(_0xda2424,_0x1b7158){return _0xda2424[_0x1bb5('0xa')](_0x1bb5('0xb'),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 0825c93..c0b5b2e 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 _0x0c32=['attributes','limit','include','map','model','GetTrunk','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','catch','Trunk','options','raw','where'];(function(_0x106abf,_0x540cb9){var _0x171d95=function(_0x5808bb){while(--_0x5808bb){_0x106abf['push'](_0x106abf['shift']());}};_0x171d95(++_0x540cb9);}(_0x0c32,0x130));var _0x20c3=function(_0x1ab654,_0x17dd1b){_0x1ab654=_0x1ab654-0x0;var _0x13b5c7=_0x0c32[_0x1ab654];return _0x13b5c7;};'use strict';var _=require(_0x20c3('0x0'));var util=require(_0x20c3('0x1'));var moment=require(_0x20c3('0x2'));var BPromise=require(_0x20c3('0x3'));var rs=require(_0x20c3('0x4'));var fs=require('fs');var Redis=require(_0x20c3('0x5'));var db=require(_0x20c3('0x6'))['db'];var utils=require(_0x20c3('0x7'));var logger=require(_0x20c3('0x8'))(_0x20c3('0x9'));var config=require(_0x20c3('0xa'));var jayson=require(_0x20c3('0xb'));var client=jayson[_0x20c3('0xc')][_0x20c3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d069e,_0x58bdc4,_0x162df8){return new BPromise(function(_0x573b8d,_0x11703d){return client['request'](_0x4d069e,_0x162df8)[_0x20c3('0xe')](function(_0x245a31){logger[_0x20c3('0xf')]('Trunk,\x20%s,\x20%s',_0x58bdc4,'request\x20sent');logger[_0x20c3('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x58bdc4,_0x20c3('0x11'),JSON[_0x20c3('0x12')](_0x245a31));if(_0x245a31[_0x20c3('0x13')]){if(_0x245a31[_0x20c3('0x13')][_0x20c3('0x14')]===0x1f4){logger[_0x20c3('0x13')](_0x20c3('0x15'),_0x58bdc4,_0x245a31[_0x20c3('0x13')][_0x20c3('0x16')]);return _0x11703d(_0x245a31[_0x20c3('0x13')][_0x20c3('0x16')]);}logger[_0x20c3('0x13')](_0x20c3('0x15'),_0x58bdc4,_0x245a31[_0x20c3('0x13')]['message']);return _0x573b8d(_0x245a31[_0x20c3('0x13')][_0x20c3('0x16')]);}else{logger['info'](_0x20c3('0x15'),_0x58bdc4,_0x20c3('0x11'));_0x573b8d(_0x245a31[_0x20c3('0x17')][_0x20c3('0x16')]);}})[_0x20c3('0x18')](function(_0x1b6cf5){logger[_0x20c3('0x13')](_0x20c3('0x15'),_0x58bdc4,_0x1b6cf5);_0x11703d(_0x1b6cf5);});});}exports['GetTrunk']=function(_0x31514f){var _0x292d58=this;return new Promise(function(_0x2ee07d,_0x19be46){return db[_0x20c3('0x19')]['findAll']({'raw':_0x31514f[_0x20c3('0x1a')]?_0x31514f[_0x20c3('0x1a')][_0x20c3('0x1b')]===undefined?!![]:![]:!![],'where':_0x31514f[_0x20c3('0x1a')]?_0x31514f[_0x20c3('0x1a')][_0x20c3('0x1c')]||null:null,'attributes':_0x31514f[_0x20c3('0x1a')]?_0x31514f[_0x20c3('0x1a')][_0x20c3('0x1d')]||null:null,'limit':_0x31514f[_0x20c3('0x1a')]?_0x31514f[_0x20c3('0x1a')][_0x20c3('0x1e')]||null:null,'include':_0x31514f[_0x20c3('0x1a')]?_0x31514f[_0x20c3('0x1a')][_0x20c3('0x1f')]?_[_0x20c3('0x20')](_0x31514f[_0x20c3('0x1a')][_0x20c3('0x1f')],function(_0x367969){return{'model':db[_0x367969['model']],'as':_0x367969['as'],'attributes':_0x367969[_0x20c3('0x1d')],'include':_0x367969[_0x20c3('0x1f')]?_[_0x20c3('0x20')](_0x367969[_0x20c3('0x1f')],function(_0x570012){return{'model':db[_0x570012[_0x20c3('0x21')]],'as':_0x570012['as'],'attributes':_0x570012[_0x20c3('0x1d')],'include':_0x570012[_0x20c3('0x1f')]?_[_0x20c3('0x20')](_0x570012[_0x20c3('0x1f')],function(_0x23329b){return{'model':db[_0x23329b[_0x20c3('0x21')]],'as':_0x23329b['as'],'attributes':_0x23329b[_0x20c3('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35444e){logger[_0x20c3('0xf')](_0x20c3('0x22'),_0x31514f);logger[_0x20c3('0x10')](_0x20c3('0x22'),_0x31514f,JSON[_0x20c3('0x12')](_0x35444e));_0x2ee07d(_0x35444e);})['catch'](function(_0x396403){logger[_0x20c3('0x13')]('GetTrunk',_0x396403[_0x20c3('0x16')],_0x31514f);_0x19be46(_0x292d58['error'](0x1f4,_0x396403[_0x20c3('0x16')]));});});};exports[_0x20c3('0x23')]=function(_0x6a2852){var _0xe8c2b=this;return new Promise(function(_0x4b716c,_0x5c06ac){return db[_0x20c3('0x19')][_0x20c3('0x24')]({'raw':_0x6a2852['options']?_0x6a2852[_0x20c3('0x1a')][_0x20c3('0x1b')]===undefined?!![]:![]:!![],'where':_0x6a2852[_0x20c3('0x1a')]?_0x6a2852[_0x20c3('0x1a')][_0x20c3('0x1c')]||null:null,'attributes':_0x6a2852[_0x20c3('0x1a')]?_0x6a2852[_0x20c3('0x1a')][_0x20c3('0x1d')]||null:null,'include':_0x6a2852[_0x20c3('0x1a')]?_0x6a2852[_0x20c3('0x1a')][_0x20c3('0x1f')]?_[_0x20c3('0x20')](_0x6a2852[_0x20c3('0x1a')][_0x20c3('0x1f')],function(_0x53c299){return{'model':db[_0x53c299['model']],'as':_0x53c299['as'],'attributes':_0x53c299[_0x20c3('0x1d')],'include':_0x53c299[_0x20c3('0x1f')]?_[_0x20c3('0x20')](_0x53c299[_0x20c3('0x1f')],function(_0x14eceb){return{'model':db[_0x14eceb[_0x20c3('0x21')]],'as':_0x14eceb['as'],'attributes':_0x14eceb['attributes'],'include':_0x14eceb[_0x20c3('0x1f')]?_[_0x20c3('0x20')](_0x14eceb[_0x20c3('0x1f')],function(_0x2015d4){return{'model':db[_0x2015d4['model']],'as':_0x2015d4['as'],'attributes':_0x2015d4[_0x20c3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x20c3('0xe')](function(_0x29a93b){logger[_0x20c3('0xf')](_0x20c3('0x23'),_0x6a2852);logger[_0x20c3('0x10')]('ShowTrunk',_0x6a2852,JSON['stringify'](_0x29a93b));_0x4b716c(_0x29a93b);})[_0x20c3('0x18')](function(_0x300eee){logger[_0x20c3('0x13')](_0x20c3('0x23'),_0x300eee['message'],_0x6a2852);_0x5c06ac(_0xe8c2b[_0x20c3('0x13')](0x1f4,_0x300eee['message']));});});}; \ No newline at end of file +var _0xb3a0=['limit','include','map','model','GetTrunk','ShowTrunk','Trunk','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','options','raw','where','attributes'];(function(_0x29ce14,_0x334166){var _0x48f289=function(_0x288d11){while(--_0x288d11){_0x29ce14['push'](_0x29ce14['shift']());}};_0x48f289(++_0x334166);}(_0xb3a0,0x120));var _0x0b3a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb3a0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0b3a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0b3a('0x1'));var rs=require(_0x0b3a('0x2'));var fs=require('fs');var Redis=require(_0x0b3a('0x3'));var db=require(_0x0b3a('0x4'))['db'];var utils=require(_0x0b3a('0x5'));var logger=require(_0x0b3a('0x6'))(_0x0b3a('0x7'));var config=require(_0x0b3a('0x8'));var jayson=require(_0x0b3a('0x9'));var client=jayson[_0x0b3a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8b14b0,_0x2005f5,_0x60dc2d){return new BPromise(function(_0x2014c8,_0x3b7cf8){return client[_0x0b3a('0xb')](_0x8b14b0,_0x60dc2d)[_0x0b3a('0xc')](function(_0x271dc1){logger['info'](_0x0b3a('0xd'),_0x2005f5,'request\x20sent');logger[_0x0b3a('0xe')](_0x0b3a('0xf'),_0x2005f5,'request\x20sent',JSON[_0x0b3a('0x10')](_0x271dc1));if(_0x271dc1[_0x0b3a('0x11')]){if(_0x271dc1[_0x0b3a('0x11')][_0x0b3a('0x12')]===0x1f4){logger[_0x0b3a('0x11')](_0x0b3a('0xd'),_0x2005f5,_0x271dc1[_0x0b3a('0x11')]['message']);return _0x3b7cf8(_0x271dc1[_0x0b3a('0x11')][_0x0b3a('0x13')]);}logger['error'](_0x0b3a('0xd'),_0x2005f5,_0x271dc1[_0x0b3a('0x11')][_0x0b3a('0x13')]);return _0x2014c8(_0x271dc1['error'][_0x0b3a('0x13')]);}else{logger[_0x0b3a('0x14')]('Trunk,\x20%s,\x20%s',_0x2005f5,'request\x20sent');_0x2014c8(_0x271dc1[_0x0b3a('0x15')][_0x0b3a('0x13')]);}})[_0x0b3a('0x16')](function(_0x176443){logger[_0x0b3a('0x11')](_0x0b3a('0xd'),_0x2005f5,_0x176443);_0x3b7cf8(_0x176443);});});}exports['GetTrunk']=function(_0x3bb482){var _0x5e4acb=this;return new Promise(function(_0x2dc1af,_0x1fcd50){return db['Trunk']['findAll']({'raw':_0x3bb482['options']?_0x3bb482[_0x0b3a('0x17')][_0x0b3a('0x18')]===undefined?!![]:![]:!![],'where':_0x3bb482['options']?_0x3bb482[_0x0b3a('0x17')][_0x0b3a('0x19')]||null:null,'attributes':_0x3bb482[_0x0b3a('0x17')]?_0x3bb482[_0x0b3a('0x17')][_0x0b3a('0x1a')]||null:null,'limit':_0x3bb482[_0x0b3a('0x17')]?_0x3bb482[_0x0b3a('0x17')][_0x0b3a('0x1b')]||null:null,'include':_0x3bb482['options']?_0x3bb482['options'][_0x0b3a('0x1c')]?_[_0x0b3a('0x1d')](_0x3bb482[_0x0b3a('0x17')][_0x0b3a('0x1c')],function(_0xd62ed9){return{'model':db[_0xd62ed9['model']],'as':_0xd62ed9['as'],'attributes':_0xd62ed9[_0x0b3a('0x1a')],'include':_0xd62ed9['include']?_[_0x0b3a('0x1d')](_0xd62ed9[_0x0b3a('0x1c')],function(_0x4d8823){return{'model':db[_0x4d8823[_0x0b3a('0x1e')]],'as':_0x4d8823['as'],'attributes':_0x4d8823[_0x0b3a('0x1a')],'include':_0x4d8823[_0x0b3a('0x1c')]?_[_0x0b3a('0x1d')](_0x4d8823[_0x0b3a('0x1c')],function(_0x34856c){return{'model':db[_0x34856c[_0x0b3a('0x1e')]],'as':_0x34856c['as'],'attributes':_0x34856c['attributes']};}):[]};}):[]};}):[]:[]})[_0x0b3a('0xc')](function(_0x1e2106){logger[_0x0b3a('0x14')](_0x0b3a('0x1f'),_0x3bb482);logger[_0x0b3a('0xe')](_0x0b3a('0x1f'),_0x3bb482,JSON[_0x0b3a('0x10')](_0x1e2106));_0x2dc1af(_0x1e2106);})[_0x0b3a('0x16')](function(_0x567861){logger[_0x0b3a('0x11')](_0x0b3a('0x1f'),_0x567861[_0x0b3a('0x13')],_0x3bb482);_0x1fcd50(_0x5e4acb[_0x0b3a('0x11')](0x1f4,_0x567861[_0x0b3a('0x13')]));});});};exports[_0x0b3a('0x20')]=function(_0x5a31de){var _0x2709b5=this;return new Promise(function(_0x3f009f,_0x32f92a){return db[_0x0b3a('0x21')][_0x0b3a('0x22')]({'raw':_0x5a31de[_0x0b3a('0x17')]?_0x5a31de[_0x0b3a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5a31de[_0x0b3a('0x17')]?_0x5a31de[_0x0b3a('0x17')][_0x0b3a('0x19')]||null:null,'attributes':_0x5a31de[_0x0b3a('0x17')]?_0x5a31de[_0x0b3a('0x17')][_0x0b3a('0x1a')]||null:null,'include':_0x5a31de['options']?_0x5a31de[_0x0b3a('0x17')]['include']?_['map'](_0x5a31de[_0x0b3a('0x17')]['include'],function(_0x549fc4){return{'model':db[_0x549fc4[_0x0b3a('0x1e')]],'as':_0x549fc4['as'],'attributes':_0x549fc4[_0x0b3a('0x1a')],'include':_0x549fc4[_0x0b3a('0x1c')]?_[_0x0b3a('0x1d')](_0x549fc4[_0x0b3a('0x1c')],function(_0x595575){return{'model':db[_0x595575[_0x0b3a('0x1e')]],'as':_0x595575['as'],'attributes':_0x595575[_0x0b3a('0x1a')],'include':_0x595575[_0x0b3a('0x1c')]?_[_0x0b3a('0x1d')](_0x595575[_0x0b3a('0x1c')],function(_0x1389d6){return{'model':db[_0x1389d6[_0x0b3a('0x1e')]],'as':_0x1389d6['as'],'attributes':_0x1389d6[_0x0b3a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0b3a('0xc')](function(_0x3e77c1){logger[_0x0b3a('0x14')](_0x0b3a('0x20'),_0x5a31de);logger[_0x0b3a('0xe')]('ShowTrunk',_0x5a31de,JSON['stringify'](_0x3e77c1));_0x3f009f(_0x3e77c1);})[_0x0b3a('0x16')](function(_0x2c0d48){logger['error']('ShowTrunk',_0x2c0d48[_0x0b3a('0x13')],_0x5a31de);_0x32f92a(_0x2709b5[_0x0b3a('0x11')](0x1f4,_0x2c0d48['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 757ee00..cfc5346 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 _0xf177=['../../components/auth/service','./user-setting.controller','isAuthenticated','update','Router'];(function(_0x4e4ebe,_0x43ca60){var _0x270b54=function(_0x2ab515){while(--_0x2ab515){_0x4e4ebe['push'](_0x4e4ebe['shift']());}};_0x270b54(++_0x43ca60);}(_0xf177,0x112));var _0x7f17=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf177[_0x4a9fb1];return _0x348672;};'use strict';var express=require('express');var router=express[_0x7f17('0x0')]();var auth=require(_0x7f17('0x1'));var controller=require(_0x7f17('0x2'));router['put']('/:id',auth[_0x7f17('0x3')](),controller[_0x7f17('0x4')]);module['exports']=router; \ No newline at end of file +var _0xff78=['Router','put','/:id','isAuthenticated','update','exports','express'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0xff78,0xe6));var _0x8ff7=function(_0x45fe9c,_0x55e0d7){_0x45fe9c=_0x45fe9c-0x0;var _0x233d48=_0xff78[_0x45fe9c];return _0x233d48;};'use strict';var express=require(_0x8ff7('0x0'));var router=express[_0x8ff7('0x1')]();var auth=require('../../components/auth/service');var controller=require('./user-setting.controller');router[_0x8ff7('0x2')](_0x8ff7('0x3'),auth[_0x8ff7('0x4')](),controller[_0x8ff7('0x5')]);module[_0x8ff7('0x6')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 47c0c4c..252361c 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 _0xfd01=['INTEGER','UserId','sequelize','warning','debug','ENUM','error','BOOLEAN','DATE'];(function(_0x968c50,_0x1492ca){var _0x5c24ab=function(_0x1c5e7f){while(--_0x1c5e7f){_0x968c50['push'](_0x968c50['shift']());}};_0x5c24ab(++_0x1492ca);}(_0xfd01,0x185));var _0x1fd0=function(_0x3ba739,_0x92c074){_0x3ba739=_0x3ba739-0x0;var _0x582cec=_0xfd01[_0x3ba739];return _0x582cec;};'use strict';var Sequelize=require(_0x1fd0('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x1fd0('0x1'),'info',_0x1fd0('0x2')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x1fd0('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x1fd0('0x4'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x1fd0('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x1fd0('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x1fd0('0x7')],'unique':_0x1fd0('0x8')}}; \ No newline at end of file +var _0x2f57=['DATE','INTEGER','UserId','error','warning','debug','ENUM','BOOLEAN','TEXT'];(function(_0x32a790,_0x2beb23){var _0x24fc83=function(_0x23be13){while(--_0x23be13){_0x32a790['push'](_0x32a790['shift']());}};_0x24fc83(++_0x2beb23);}(_0x2f57,0x1aa));var _0x72f5=function(_0x23df94,_0x2762f5){_0x23df94=_0x23df94-0x0;var _0x56422f=_0x2f57[_0x23df94];return _0x56422f;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x72f5('0x0'),_0x72f5('0x1'),'info',_0x72f5('0x2')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x72f5('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x72f5('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x72f5('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x72f5('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x72f5('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x72f5('0x7')],'unique':_0x72f5('0x8')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index ea083f8..640e1ac 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 _0x682e=['error','stack','name','status','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','json','update','then'];(function(_0x198247,_0x491c12){var _0x2b18bc=function(_0x4a43e2){while(--_0x4a43e2){_0x198247['push'](_0x198247['shift']());}};_0x2b18bc(++_0x491c12);}(_0x682e,0x1ce));var _0xe682=function(_0x364a3a,_0x5b4fe4){_0x364a3a=_0x364a3a-0x0;var _0x17fef8=_0x682e[_0x364a3a];return _0x17fef8;};'use strict';var _=require(_0xe682('0x0'));var Redis=require(_0xe682('0x1'));var logger=require(_0xe682('0x2'))(_0xe682('0x3'));var config=require(_0xe682('0x4'));var db=require(_0xe682('0x5'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xe682('0x6')]));require(_0xe682('0x7'))[_0xe682('0x8')](socket);config[_0xe682('0x6')]=_[_0xe682('0x9')](config[_0xe682('0x6')],{'host':_0xe682('0xa'),'port':0x18eb});function respondWithResult(_0xd6995,_0x68a2e3){_0x68a2e3=_0x68a2e3||0xc8;return function(_0x1ab428){if(_0x1ab428){return _0xd6995['status'](_0x68a2e3)[_0xe682('0xb')](_0x1ab428);}};}function saveUpdates(_0x3dfb81){return function(_0x43e3d9){if(_0x43e3d9){return _0x43e3d9[_0xe682('0xc')](_0x3dfb81)[_0xe682('0xd')](function(_0x2f7213){return _0x2f7213;});}return null;};}function handleEntityNotFound(_0x5acc03){return function(_0x152b9f){if(!_0x152b9f){_0x5acc03['sendStatus'](0x194);}return _0x152b9f;};}function handleError(_0x111bc8,_0x569605){_0x569605=_0x569605||0x1f4;return function(_0x493a34){logger[_0xe682('0xe')](_0x493a34[_0xe682('0xf')]);if(_0x493a34[_0xe682('0x10')]){delete _0x493a34[_0xe682('0x10')];}_0x111bc8[_0xe682('0x11')](_0x569605)[_0xe682('0x12')](_0x493a34);};}exports['update']=function(_0x20934a,_0x3a8de0){if(_0x20934a[_0xe682('0x13')][_0xe682('0x14')]!==_0xe682('0x15'))throw new Error(_0xe682('0x16'));if(isNaN(Number(_0x20934a[_0xe682('0x17')]['id'])))throw new Error(_0xe682('0x18'));return db['UserSetting'][_0xe682('0x19')]({'where':{'id':_0x20934a['params']['id']}})['then'](handleEntityNotFound(_0x3a8de0,null))['then'](saveUpdates(_0x20934a[_0xe682('0x1a')],null))[_0xe682('0xd')](respondWithResult(_0x3a8de0,null))[_0xe682('0x1b')](handleError(_0x3a8de0,null));}; \ No newline at end of file +var _0x34b2=['UserSetting','find','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','status','json','then','sendStatus','error','stack','name','update','user','role','Unauthorized','params','Invalid\x20user\x20setting\x20id'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x34b2,0x11c));var _0x234b=function(_0x4742d0,_0x3667bd){_0x4742d0=_0x4742d0-0x0;var _0x43bc00=_0x34b2[_0x4742d0];return _0x43bc00;};'use strict';var _=require(_0x234b('0x0'));var Redis=require(_0x234b('0x1'));var logger=require(_0x234b('0x2'))(_0x234b('0x3'));var config=require(_0x234b('0x4'));var db=require(_0x234b('0x5'))['db'];var socket=require(_0x234b('0x6'))(new Redis(config[_0x234b('0x7')]));require(_0x234b('0x8'))[_0x234b('0x9')](socket);config[_0x234b('0x7')]=_[_0x234b('0xa')](config[_0x234b('0x7')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x52fac7,_0x5e71ac){_0x5e71ac=_0x5e71ac||0xc8;return function(_0x2eb07e){if(_0x2eb07e){return _0x52fac7[_0x234b('0xb')](_0x5e71ac)[_0x234b('0xc')](_0x2eb07e);}};}function saveUpdates(_0x36d33f){return function(_0x4e4c50){if(_0x4e4c50){return _0x4e4c50['update'](_0x36d33f)[_0x234b('0xd')](function(_0x3a900b){return _0x3a900b;});}return null;};}function handleEntityNotFound(_0x277a27){return function(_0x30b17b){if(!_0x30b17b){_0x277a27[_0x234b('0xe')](0x194);}return _0x30b17b;};}function handleError(_0x1bd00f,_0x3e4f17){_0x3e4f17=_0x3e4f17||0x1f4;return function(_0x9dcfd3){logger[_0x234b('0xf')](_0x9dcfd3[_0x234b('0x10')]);if(_0x9dcfd3[_0x234b('0x11')]){delete _0x9dcfd3[_0x234b('0x11')];}_0x1bd00f[_0x234b('0xb')](_0x3e4f17)['send'](_0x9dcfd3);};}exports[_0x234b('0x12')]=function(_0x2f72d9,_0x4abf92){if(_0x2f72d9[_0x234b('0x13')][_0x234b('0x14')]!=='admin')throw new Error(_0x234b('0x15'));if(isNaN(Number(_0x2f72d9[_0x234b('0x16')]['id'])))throw new Error(_0x234b('0x17'));return db[_0x234b('0x18')][_0x234b('0x19')]({'where':{'id':_0x2f72d9[_0x234b('0x16')]['id']}})[_0x234b('0xd')](handleEntityNotFound(_0x4abf92,null))[_0x234b('0xd')](saveUpdates(_0x2f72d9[_0x234b('0x1a')],null))['then'](respondWithResult(_0x4abf92,null))[_0x234b('0x1b')](handleError(_0x4abf92,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 01d821d..ab06658 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 _0x03ed=['hook','exports','events','../../mysqldb','UserSetting','save','update','remove','emit'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x03ed,0x14f));var _0xd03e=function(_0x6148d9,_0x653a21){_0x6148d9=_0x6148d9-0x0;var _0x3a136c=_0x03ed[_0x6148d9];return _0x3a136c;};'use strict';var EventEmitter=require(_0xd03e('0x0'));var UserSetting=require(_0xd03e('0x1'))['db'][_0xd03e('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd03e('0x3'),'afterUpdate':_0xd03e('0x4'),'afterDestroy':_0xd03e('0x5')};function emitEvent(_0x189749){return function(_0x4e5959,_0x30d91c,_0x5159cc){UserSettingEvents[_0xd03e('0x6')](_0x189749+':'+_0x4e5959['id'],_0x4e5959);UserSettingEvents[_0xd03e('0x6')](_0x189749,_0x4e5959);_0x5159cc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xd03e('0x7')](e,emitEvent(event));}}module[_0xd03e('0x8')]=UserSettingEvents; \ No newline at end of file +var _0xa81c=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x428f32,_0xba79ad){var _0x9e6f89=function(_0x5cf6c8){while(--_0x5cf6c8){_0x428f32['push'](_0x428f32['shift']());}};_0x9e6f89(++_0xba79ad);}(_0xa81c,0x109));var _0xca81=function(_0x383ecc,_0x30d20a){_0x383ecc=_0x383ecc-0x0;var _0x1595a8=_0xa81c[_0x383ecc];return _0x1595a8;};'use strict';var EventEmitter=require(_0xca81('0x0'));var UserSetting=require('../../mysqldb')['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xca81('0x1')](0x0);var events={'afterCreate':_0xca81('0x2'),'afterUpdate':_0xca81('0x3'),'afterDestroy':_0xca81('0x4')};function emitEvent(_0x3c2fa6){return function(_0x58af39,_0x471389,_0x8d4998){UserSettingEvents[_0xca81('0x5')](_0x3c2fa6+':'+_0x58af39['id'],_0x58af39);UserSettingEvents[_0xca81('0x5')](_0x3c2fa6,_0x58af39);_0x8d4998(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xca81('0x6')](e,emitEvent(event));}}module[_0xca81('0x7')]=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 b8b0055..36c0027 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 _0x44a3=['define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44a3,0x1a9));var _0x344a=function(_0x27a997,_0x85f149){_0x27a997=_0x27a997-0x0;var _0x5aa288=_0x44a3[_0x27a997];return _0x5aa288;};'use strict';var attributes=require(_0x344a('0x0'));module[_0x344a('0x1')]=function(_0x3fa916){return _0x3fa916[_0x344a('0x2')](_0x344a('0x3'),attributes,{'tableName':_0x344a('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bb844){if(!_0x3bb844[_0x344a('0x5')])_0x3bb844['clientSideLoggingEnabledSince']=null;else if(_0x3bb844[_0x344a('0x6')]===null)_0x3bb844[_0x344a('0x6')]=new Date();}}});}; \ No newline at end of file +var _0x0427=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','define'];(function(_0x917d72,_0x183318){var _0x568af8=function(_0x377581){while(--_0x377581){_0x917d72['push'](_0x917d72['shift']());}};_0x568af8(++_0x183318);}(_0x0427,0x137));var _0x7042=function(_0x51195a,_0x4b037f){_0x51195a=_0x51195a-0x0;var _0x528541=_0x0427[_0x51195a];return _0x528541;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x1295ad){return _0x1295ad[_0x7042('0x0')]('UserSetting',attributes,{'tableName':_0x7042('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x7c5b2d){if(!_0x7c5b2d[_0x7042('0x2')])_0x7c5b2d[_0x7042('0x3')]=null;else if(_0x7c5b2d[_0x7042('0x3')]===null)_0x7c5b2d[_0x7042('0x3')]=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 b16708d..988048e 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 _0x9468=['emit','user-setting:update','user-setting:update:user-','UserId','length','user-setting:','./user-setting.events','save','remove','update'];(function(_0x32917a,_0x3559ea){var _0x1881e1=function(_0x56730d){while(--_0x56730d){_0x32917a['push'](_0x32917a['shift']());}};_0x1881e1(++_0x3559ea);}(_0x9468,0x100));var _0x8946=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0x9468[_0x3cb30b];return _0x2ca717;};'use strict';var UserSettingEvents=require(_0x8946('0x0'));var events=[_0x8946('0x1'),_0x8946('0x2'),_0x8946('0x3')];function createListener(_0x4f0f09,_0x5d45f0){return function(_0x1593d6){_0x5d45f0[_0x8946('0x4')](_0x4f0f09,_0x1593d6);if(_0x4f0f09===_0x8946('0x5')){_0x5d45f0[_0x8946('0x4')](_0x8946('0x6')+_0x1593d6[_0x8946('0x7')],_0x1593d6);}};}exports['register']=function(_0x27535d){for(var _0x5858be=0x0,_0x5095a1=events[_0x8946('0x8')];_0x5858be<_0x5095a1;_0x5858be++){var _0x3b72ec=events[_0x5858be];var _0x1711f7=createListener(_0x8946('0x9')+_0x3b72ec,_0x27535d);UserSettingEvents['on'](_0x3b72ec,_0x1711f7);}}; \ No newline at end of file +var _0x2f82=['remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:','save'];(function(_0x4134a3,_0x5f4adb){var _0x5a2772=function(_0x3e34e4){while(--_0x3e34e4){_0x4134a3['push'](_0x4134a3['shift']());}};_0x5a2772(++_0x5f4adb);}(_0x2f82,0xf9));var _0x22f8=function(_0x363b81,_0x81e6ca){_0x363b81=_0x363b81-0x0;var _0x1d92fb=_0x2f82[_0x363b81];return _0x1d92fb;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x22f8('0x0'),_0x22f8('0x1'),_0x22f8('0x2')];function createListener(_0x39049a,_0x48d6ab){return function(_0x98d443){_0x48d6ab[_0x22f8('0x3')](_0x39049a,_0x98d443);if(_0x39049a===_0x22f8('0x4')){_0x48d6ab['emit'](_0x22f8('0x5')+_0x98d443[_0x22f8('0x6')],_0x98d443);}};}exports[_0x22f8('0x7')]=function(_0x5e90c1){for(var _0x336aad=0x0,_0x268449=events[_0x22f8('0x8')];_0x336aad<_0x268449;_0x336aad++){var _0x399bd4=events[_0x336aad];var _0x5b92a1=createListener(_0x22f8('0x9')+_0x399bd4,_0x5e90c1);UserSettingEvents['on'](_0x399bd4,_0x5b92a1);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 14ba1d5..7d97eeb 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 _0x777d=['/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','changePassword','delete','/:id/queues','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','util','path','connect-timeout','Router','fs-extra','./user.controller','isAuthenticated','get','/whoami','whoami','/presence','getPresence','/:id','show','getOpenTabs','/:id/contacts','getQueues','/:id/queues_rt','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','format','%s-%s','now','originalname','/:id/avatar','single','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x777d,0xe9));var _0xd777=function(_0x1d5458,_0x3acf09){_0x1d5458=_0x1d5458-0x0;var _0x9bf6f=_0x777d[_0x1d5458];return _0x9bf6f;};'use strict';var multer=require('multer');var util=require(_0xd777('0x0'));var path=require(_0xd777('0x1'));var timeout=require(_0xd777('0x2'));var express=require('express');var router=express[_0xd777('0x3')]();var fs_extra=require(_0xd777('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd777('0x5'));router['get']('/',auth[_0xd777('0x6')](),controller['index']);router[_0xd777('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd777('0x7')](_0xd777('0x8'),auth[_0xd777('0x6')](),controller[_0xd777('0x9')]);router[_0xd777('0x7')](_0xd777('0xa'),auth[_0xd777('0x6')](),controller[_0xd777('0xb')]);router[_0xd777('0x7')](_0xd777('0xc'),auth[_0xd777('0x6')](),controller[_0xd777('0xd')]);router[_0xd777('0x7')]('/:id/avatar',controller['getAvatar']);router[_0xd777('0x7')]('/:id/open_tabs',auth[_0xd777('0x6')](),controller[_0xd777('0xe')]);router[_0xd777('0x7')](_0xd777('0xf'),auth[_0xd777('0x6')](),controller['getContacts']);router[_0xd777('0x7')]('/:id/queues',auth[_0xd777('0x6')](),controller[_0xd777('0x10')]);router[_0xd777('0x7')](_0xd777('0x11'),auth[_0xd777('0x6')](),controller['getVoiceQueuesRt']);router[_0xd777('0x7')]('/:id/groups',auth[_0xd777('0x6')](),controller['getGroups']);router[_0xd777('0x7')](_0xd777('0x12'),auth[_0xd777('0x6')](),controller[_0xd777('0x13')]);router[_0xd777('0x7')](_0xd777('0x14'),auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0xd777('0x7')]('/:id/chat/interactions',auth[_0xd777('0x6')](),controller['getChatInteractions']);router['get']('/:id/openchannel/interactions',auth[_0xd777('0x6')](),controller['getOpenchannelInteractions']);router['get']('/:id/mail/interactions',auth['isAuthenticated'](),controller['getMailInteractions']);router[_0xd777('0x7')](_0xd777('0x15'),auth[_0xd777('0x6')](),controller[_0xd777('0x16')]);router[_0xd777('0x7')](_0xd777('0x17'),auth[_0xd777('0x6')](),controller[_0xd777('0x18')]);router[_0xd777('0x7')](_0xd777('0x19'),auth[_0xd777('0x6')](),controller['getWhatsappInteractions']);router[_0xd777('0x7')](_0xd777('0x1a'),auth[_0xd777('0x6')](),controller[_0xd777('0x1b')]);router[_0xd777('0x7')]('/:id/lists',auth[_0xd777('0x6')](),controller['getLists']);router['get'](_0xd777('0x1c'),auth[_0xd777('0x6')](),controller[_0xd777('0x1d')]);router[_0xd777('0x7')]('/:id/prefixes',auth[_0xd777('0x6')](),controller[_0xd777('0x1e')]);router[_0xd777('0x7')](_0xd777('0x1f'),auth[_0xd777('0x6')](),controller[_0xd777('0x20')]);router[_0xd777('0x7')](_0xd777('0x21'),auth['isAuthenticated'](),controller[_0xd777('0x22')]);router['get']('/:id/openchannel_accounts',auth[_0xd777('0x6')](),controller[_0xd777('0x23')]);router[_0xd777('0x7')](_0xd777('0x24'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0xd777('0x7')](_0xd777('0x25'),auth[_0xd777('0x6')](),controller[_0xd777('0x26')]);router[_0xd777('0x7')](_0xd777('0x27'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0xd777('0x7')](_0xd777('0x28'),auth[_0xd777('0x6')](),controller[_0xd777('0x29')]);router[_0xd777('0x7')](_0xd777('0x2a'),auth[_0xd777('0x6')](),controller[_0xd777('0x2b')]);router['post']('/:id/contacts',auth[_0xd777('0x6')](),controller['addContacts']);router[_0xd777('0x2c')]('/',auth[_0xd777('0x6')](),controller[_0xd777('0x2d')]);router[_0xd777('0x2c')]('/create_many',auth[_0xd777('0x6')](),controller['bulkCreate']);router[_0xd777('0x2c')]('/:id/queues',auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3503ca,_0x3cd5f3,_0x44f48f){_0x44f48f(null,path['join'](config['root'],'server/files/images/'));},'filename':function(_0x3e432d,_0x21466,_0x27aaa6){_0x27aaa6(null,util[_0xd777('0x2e')](_0xd777('0x2f'),Date[_0xd777('0x30')](),_0x21466[_0xd777('0x31')]));}})});router[_0xd777('0x2c')](_0xd777('0x32'),upload[_0xd777('0x33')]('file'),controller[_0xd777('0x34')]);router[_0xd777('0x2c')](_0xd777('0x35'),auth[_0xd777('0x6')](),controller[_0xd777('0x36')]);router[_0xd777('0x2c')](_0xd777('0x37'),auth[_0xd777('0x6')](),controller[_0xd777('0x38')]);router[_0xd777('0x2c')](_0xd777('0x39'),auth[_0xd777('0x6')](),controller['pause']);router[_0xd777('0x2c')]('/:id/unpause',auth[_0xd777('0x6')](),controller[_0xd777('0x3a')]);router[_0xd777('0x2c')](_0xd777('0x1a'),auth[_0xd777('0x6')](),controller[_0xd777('0x3b')]);router['post'](_0xd777('0x3c'),auth[_0xd777('0x6')](),controller[_0xd777('0x3d')]);router['post'](_0xd777('0x3e'),auth[_0xd777('0x6')](),controller[_0xd777('0x3f')]);router[_0xd777('0x2c')](_0xd777('0x40'),auth[_0xd777('0x6')](),controller[_0xd777('0x41')]);router['post'](_0xd777('0x42'),auth[_0xd777('0x6')](),controller['addSmsInteractions']);router['post'](_0xd777('0x43'),auth[_0xd777('0x6')](),controller[_0xd777('0x44')]);router[_0xd777('0x2c')](_0xd777('0x45'),auth[_0xd777('0x6')](),controller[_0xd777('0x46')]);router[_0xd777('0x2c')](_0xd777('0x1f'),auth[_0xd777('0x6')](),controller[_0xd777('0x47')]);router['post'](_0xd777('0x21'),auth[_0xd777('0x6')](),controller[_0xd777('0x48')]);router['post']('/:id/openchannel_accounts',auth[_0xd777('0x6')](),controller[_0xd777('0x49')]);router[_0xd777('0x2c')](_0xd777('0x24'),auth[_0xd777('0x6')](),controller[_0xd777('0x4a')]);router[_0xd777('0x2c')](_0xd777('0x25'),auth['isAuthenticated'](),controller[_0xd777('0x4b')]);router['post']('/:id/whatsapp_accounts',auth[_0xd777('0x6')](),controller[_0xd777('0x4c')]);router['post'](_0xd777('0x2a'),auth[_0xd777('0x6')](),controller[_0xd777('0x4d')]);router[_0xd777('0x4e')]('/:id',auth['isAuthenticated'](),controller[_0xd777('0x4f')]);router['put'](_0xd777('0x50'),auth[_0xd777('0x6')](),controller[_0xd777('0x51')]);router[_0xd777('0x52')](_0xd777('0x53'),auth['isAuthenticated'](),controller[_0xd777('0x54')]);router[_0xd777('0x52')](_0xd777('0x1a'),auth['isAuthenticated'](),controller[_0xd777('0x55')]);router[_0xd777('0x52')]('/:id',auth[_0xd777('0x6')](),controller[_0xd777('0x56')]);router[_0xd777('0x52')]('/:id/chat_interactions',auth[_0xd777('0x6')](),controller[_0xd777('0x57')]);router[_0xd777('0x52')](_0xd777('0x3e'),auth[_0xd777('0x6')](),controller[_0xd777('0x58')]);router[_0xd777('0x52')](_0xd777('0x40'),auth[_0xd777('0x6')](),controller[_0xd777('0x59')]);router[_0xd777('0x52')](_0xd777('0x42'),auth[_0xd777('0x6')](),controller[_0xd777('0x5a')]);router[_0xd777('0x52')](_0xd777('0x43'),auth[_0xd777('0x6')](),controller[_0xd777('0x5b')]);router[_0xd777('0x52')](_0xd777('0x45'),auth[_0xd777('0x6')](),controller[_0xd777('0x5c')]);router[_0xd777('0x52')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0xd777('0x52')](_0xd777('0x21'),auth[_0xd777('0x6')](),controller[_0xd777('0x5d')]);router[_0xd777('0x52')]('/:id/openchannel_accounts',auth[_0xd777('0x6')](),controller[_0xd777('0x5e')]);router['delete'](_0xd777('0x24'),auth[_0xd777('0x6')](),controller[_0xd777('0x5f')]);router['delete'](_0xd777('0x25'),auth['isAuthenticated'](),controller[_0xd777('0x60')]);router[_0xd777('0x52')](_0xd777('0x27'),auth[_0xd777('0x6')](),controller[_0xd777('0x61')]);router['delete'](_0xd777('0x2a'),auth['isAuthenticated'](),controller[_0xd777('0x62')]);module[_0xd777('0x63')]=router; \ No newline at end of file +var _0x4046=['getVoicePrefixes','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','create','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addWhatsappAccounts','createApiKey','put','update','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','util','path','connect-timeout','express','Router','./user.controller','get','isAuthenticated','index','describe','/whoami','whoami','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes'];(function(_0x3b13eb,_0x50a25d){var _0x16b0bd=function(_0x59b69c){while(--_0x59b69c){_0x3b13eb['push'](_0x3b13eb['shift']());}};_0x16b0bd(++_0x50a25d);}(_0x4046,0x126));var _0x6404=function(_0x20c23f,_0x39b686){_0x20c23f=_0x20c23f-0x0;var _0x1c6c78=_0x4046[_0x20c23f];return _0x1c6c78;};'use strict';var multer=require('multer');var util=require(_0x6404('0x0'));var path=require(_0x6404('0x1'));var timeout=require(_0x6404('0x2'));var express=require(_0x6404('0x3'));var router=express[_0x6404('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6404('0x5'));router[_0x6404('0x6')]('/',auth[_0x6404('0x7')](),controller[_0x6404('0x8')]);router[_0x6404('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x6404('0x9')]);router['get'](_0x6404('0xa'),auth[_0x6404('0x7')](),controller[_0x6404('0xb')]);router[_0x6404('0x6')]('/presence',auth['isAuthenticated'](),controller[_0x6404('0xc')]);router[_0x6404('0x6')](_0x6404('0xd'),auth[_0x6404('0x7')](),controller[_0x6404('0xe')]);router[_0x6404('0x6')](_0x6404('0xf'),controller[_0x6404('0x10')]);router[_0x6404('0x6')](_0x6404('0x11'),auth[_0x6404('0x7')](),controller['getOpenTabs']);router[_0x6404('0x6')](_0x6404('0x12'),auth[_0x6404('0x7')](),controller['getContacts']);router[_0x6404('0x6')]('/:id/queues',auth[_0x6404('0x7')](),controller[_0x6404('0x13')]);router['get'](_0x6404('0x14'),auth[_0x6404('0x7')](),controller['getVoiceQueuesRt']);router[_0x6404('0x6')](_0x6404('0x15'),auth[_0x6404('0x7')](),controller[_0x6404('0x16')]);router[_0x6404('0x6')](_0x6404('0x17'),auth[_0x6404('0x7')](),controller[_0x6404('0x18')]);router['get'](_0x6404('0x19'),auth[_0x6404('0x7')](),controller[_0x6404('0x1a')]);router[_0x6404('0x6')](_0x6404('0x1b'),auth[_0x6404('0x7')](),controller[_0x6404('0x1c')]);router['get']('/:id/openchannel/interactions',auth[_0x6404('0x7')](),controller[_0x6404('0x1d')]);router[_0x6404('0x6')](_0x6404('0x1e'),auth[_0x6404('0x7')](),controller['getMailInteractions']);router[_0x6404('0x6')]('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0x6404('0x1f')]);router[_0x6404('0x6')](_0x6404('0x20'),auth[_0x6404('0x7')](),controller[_0x6404('0x21')]);router['get'](_0x6404('0x22'),auth[_0x6404('0x7')](),controller[_0x6404('0x23')]);router[_0x6404('0x6')](_0x6404('0x24'),auth[_0x6404('0x7')](),controller[_0x6404('0x25')]);router[_0x6404('0x6')](_0x6404('0x26'),auth[_0x6404('0x7')](),controller[_0x6404('0x27')]);router[_0x6404('0x6')](_0x6404('0x28'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x6404('0x29'),auth[_0x6404('0x7')](),controller[_0x6404('0x2a')]);router[_0x6404('0x6')]('/:id/fax_accounts',auth[_0x6404('0x7')](),controller['getFaxAccounts']);router[_0x6404('0x6')](_0x6404('0x2b'),auth[_0x6404('0x7')](),controller[_0x6404('0x2c')]);router[_0x6404('0x6')](_0x6404('0x2d'),auth[_0x6404('0x7')](),controller[_0x6404('0x2e')]);router['get'](_0x6404('0x2f'),auth[_0x6404('0x7')](),controller[_0x6404('0x30')]);router[_0x6404('0x6')]('/:id/chat_websites',auth[_0x6404('0x7')](),controller[_0x6404('0x31')]);router[_0x6404('0x6')](_0x6404('0x32'),auth[_0x6404('0x7')](),controller['getWhatsappAccounts']);router['get'](_0x6404('0x33'),auth[_0x6404('0x7')](),controller[_0x6404('0x34')]);router[_0x6404('0x6')](_0x6404('0x35'),auth[_0x6404('0x7')](),controller['getApiKey']);router[_0x6404('0x36')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0x6404('0x36')]('/',auth['isAuthenticated'](),controller[_0x6404('0x37')]);router['post']('/create_many',auth[_0x6404('0x7')](),controller[_0x6404('0x38')]);router['post'](_0x6404('0x39'),auth[_0x6404('0x7')](),controller[_0x6404('0x3a')]);var upload=multer({'storage':multer[_0x6404('0x3b')]({'destination':function(_0x5b6fed,_0x4fef1a,_0x2fc68d){_0x2fc68d(null,path[_0x6404('0x3c')](config[_0x6404('0x3d')],_0x6404('0x3e')));},'filename':function(_0x196a49,_0x19c501,_0x77bfac){_0x77bfac(null,util[_0x6404('0x3f')](_0x6404('0x40'),Date[_0x6404('0x41')](),_0x19c501[_0x6404('0x42')]));}})});router[_0x6404('0x36')](_0x6404('0xf'),upload[_0x6404('0x43')](_0x6404('0x44')),controller[_0x6404('0x45')]);router[_0x6404('0x36')](_0x6404('0x46'),auth[_0x6404('0x7')](),controller[_0x6404('0x47')]);router['post']('/:id/logout',auth[_0x6404('0x7')](),controller['logout']);router[_0x6404('0x36')](_0x6404('0x48'),auth[_0x6404('0x7')](),controller[_0x6404('0x49')]);router[_0x6404('0x36')](_0x6404('0x4a'),auth[_0x6404('0x7')](),controller['unpause']);router['post'](_0x6404('0x24'),auth[_0x6404('0x7')](),controller[_0x6404('0x4b')]);router[_0x6404('0x36')](_0x6404('0x4c'),auth[_0x6404('0x7')](),controller['addChatInteractions']);router['post']('/:id/mail_interactions',auth[_0x6404('0x7')](),controller[_0x6404('0x4d')]);router['post'](_0x6404('0x4e'),auth[_0x6404('0x7')](),controller[_0x6404('0x4f')]);router[_0x6404('0x36')](_0x6404('0x50'),auth[_0x6404('0x7')](),controller[_0x6404('0x51')]);router[_0x6404('0x36')]('/:id/openchannel_interactions',auth[_0x6404('0x7')](),controller[_0x6404('0x52')]);router[_0x6404('0x36')](_0x6404('0x53'),auth[_0x6404('0x7')](),controller['addWhatsappInteractions']);router[_0x6404('0x36')](_0x6404('0x54'),auth['isAuthenticated'](),controller[_0x6404('0x55')]);router[_0x6404('0x36')](_0x6404('0x2b'),auth[_0x6404('0x7')](),controller[_0x6404('0x56')]);router[_0x6404('0x36')](_0x6404('0x2d'),auth['isAuthenticated'](),controller[_0x6404('0x57')]);router[_0x6404('0x36')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x6404('0x58')]);router[_0x6404('0x36')](_0x6404('0x59'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x6404('0x36')](_0x6404('0x32'),auth[_0x6404('0x7')](),controller[_0x6404('0x5a')]);router[_0x6404('0x36')]('/:id/api_key',auth[_0x6404('0x7')](),controller[_0x6404('0x5b')]);router[_0x6404('0x5c')](_0x6404('0xd'),auth[_0x6404('0x7')](),controller[_0x6404('0x5d')]);router[_0x6404('0x5c')](_0x6404('0x5e'),auth[_0x6404('0x7')](),controller[_0x6404('0x5f')]);router[_0x6404('0x60')](_0x6404('0x39'),auth[_0x6404('0x7')](),controller['removeQueues']);router['delete'](_0x6404('0x24'),auth[_0x6404('0x7')](),controller[_0x6404('0x61')]);router['delete']('/:id',auth[_0x6404('0x7')](),controller[_0x6404('0x62')]);router[_0x6404('0x60')](_0x6404('0x4c'),auth[_0x6404('0x7')](),controller[_0x6404('0x63')]);router[_0x6404('0x60')](_0x6404('0x64'),auth[_0x6404('0x7')](),controller[_0x6404('0x65')]);router[_0x6404('0x60')](_0x6404('0x4e'),auth[_0x6404('0x7')](),controller[_0x6404('0x66')]);router['delete'](_0x6404('0x50'),auth['isAuthenticated'](),controller['removeSmsInteractions']);router['delete'](_0x6404('0x67'),auth[_0x6404('0x7')](),controller[_0x6404('0x68')]);router[_0x6404('0x60')](_0x6404('0x53'),auth['isAuthenticated'](),controller[_0x6404('0x69')]);router[_0x6404('0x60')](_0x6404('0x54'),auth[_0x6404('0x7')](),controller[_0x6404('0x6a')]);router[_0x6404('0x60')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x6404('0x6b')]);router[_0x6404('0x60')](_0x6404('0x2d'),auth[_0x6404('0x7')](),controller[_0x6404('0x6c')]);router['delete'](_0x6404('0x2f'),auth[_0x6404('0x7')](),controller['removeSmsAccounts']);router[_0x6404('0x60')](_0x6404('0x59'),auth[_0x6404('0x7')](),controller[_0x6404('0x6d')]);router['delete'](_0x6404('0x32'),auth[_0x6404('0x7')](),controller[_0x6404('0x6e')]);router[_0x6404('0x60')]('/:id/api_key',auth[_0x6404('0x7')](),controller[_0x6404('0x6f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index a763d30..94c1712 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['rfc2833','info','shortinfo','inband','auto','yes','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uas','certificate','active','passive','actpass','nonat','update,nonat','DATE','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsverify','rtcp_mux','dtlsenable','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','internal','email','ENUM','admin','user','agent','telephone','local','accountcode','getDataValue','fullname','BOOLEAN','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x156b5b,_0x39ebd4){var _0x4ca8e1=function(_0x3f633a){while(--_0x3f633a){_0x156b5b['push'](_0x156b5b['shift']());}};_0x4ca8e1(++_0x39ebd4);}(_0xedd9,0xfc));var _0x9edd=function(_0x4c64e2,_0x2ed3dc){_0x4c64e2=_0x4c64e2-0x0;var _0x34f5b5=_0xedd9[_0x4c64e2];return _0x34f5b5;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9edd('0x0'));var util=require(_0x9edd('0x1'));var _=require(_0x9edd('0x2'));module[_0x9edd('0x3')]={'name':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3e6d3a){this[_0x9edd('0x6')]('name',_0x3e6d3a);this[_0x9edd('0x6')](_0x9edd('0x7'),_0x3e6d3a);},'comment':_0x9edd('0x8')},'fullname':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'set':function(_0x5319f7){this[_0x9edd('0x6')]('fullname',_0x5319f7);this[_0x9edd('0x6')](_0x9edd('0x9'),util[_0x9edd('0xa')](_0x9edd('0xb'),_0x5319f7,this['getDataValue'](_0x9edd('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'unique':_0x9edd('0xd'),'validate':{'isEmail':!![]},'set':function(_0x523026){if(_0x523026){this[_0x9edd('0x6')](_0x9edd('0xd'),_0x523026['toLowerCase']());}}},'role':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0xf'),_0x9edd('0x10'),_0x9edd('0x11'),_0x9edd('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':_0x9edd('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9edd('0xc'),'set':function(_0x44fc7c){this[_0x9edd('0x6')](_0x9edd('0xc'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x14'),_0x44fc7c);this[_0x9edd('0x6')](_0x9edd('0x9'),util['format'](_0x9edd('0xb'),this[_0x9edd('0x15')](_0x9edd('0x16')),_0x44fc7c));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9edd('0x4')]},'mobile':{'type':Sequelize[_0x9edd('0x4')]},'address':{'type':Sequelize[_0x9edd('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x9edd('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9edd('0x4')]},'online':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9edd('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9edd('0x19')},'ipaddr':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x9edd('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x1a'),'user',_0x9edd('0x1b')),'allowNull':!![],'defaultValue':_0x9edd('0x1a')},'context':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x9edd('0x1d'),_0x9edd('0x1e'),_0x9edd('0x1f'),_0x9edd('0x20'),_0x9edd('0x21'),_0x9edd('0x22'),_0x9edd('0x23'),_0x9edd('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x25'),'set':function(_0x5af178){this[_0x9edd('0x6')](_0x9edd('0x26'),_0x5af178?_0x5af178[_0x9edd('0x27')](','):null);},'get':function(){return this['getDataValue'](_0x9edd('0x26'))?this[_0x9edd('0x15')](_0x9edd('0x26'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x29')},'dtmfmode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x9edd('0x2c'),_0x9edd('0x2d'),_0x9edd('0x2e')),'allowNull':!![],'defaultValue':_0x9edd('0x2a')},'directmedia':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no','nonat',_0x9edd('0x30'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x6de835){this[_0x9edd('0x6')](_0x9edd('0x31'),_0x6de835?_0x6de835[_0x9edd('0x27')](','):null);},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x31'))?this[_0x9edd('0x15')](_0x9edd('0x31'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x32')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9edd('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x9edd('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9edd('0x4')]},'disallow':{'type':Sequelize[_0x9edd('0x4')],'allowNull':![],'defaultValue':_0x9edd('0x33')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9edd('0x34'),'set':function(_0xcbd0ef){this[_0x9edd('0x6')]('allow',_0xcbd0ef?_0xcbd0ef[_0x9edd('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x35'))?this['getDataValue'](_0x9edd('0x35'))[_0x9edd('0x28')](';'):null;},'comment':_0x9edd('0x36')},'autoframing':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'set':function(_0x5bbdf8){this[_0x9edd('0x6')](_0x9edd('0x37'),_0x5bbdf8?_0x5bbdf8['join'](','):null);},'get':function(){return this[_0x9edd('0x15')]('insecure')?this['getDataValue'](_0x9edd('0x37'))[_0x9edd('0x28')](','):null;},'comment':_0x9edd('0x38')},'trustrpid':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![],'defaultValue':_0x9edd('0x3a')},'amaflags':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'busylevel':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no',_0x9edd('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x3c'),_0x9edd('0x3d'),_0x9edd('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9edd('0xe')]('uac',_0x9edd('0x3f')),'allowNull':!![],'defaultValue':_0x9edd('0x3f')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':_0x9edd('0x2f')},'keepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x9edd('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x41'),_0x9edd('0x42'),_0x9edd('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9edd('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x9edd('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x9edd('0xe')](_0x9edd('0x2f'),'no',_0x9edd('0x44'),_0x9edd('0x30'),_0x9edd('0x45')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0,'set':function(_0x3e9a3e){this[_0x9edd('0x6')](_0x9edd('0x47'),_0x3e9a3e);var _0x5df1d7=this[_0x9edd('0x48')]({'plain':!![]});switch(_0x3e9a3e){case 0x0:case 0x1:var _0x507cce=_0x5df1d7[_0x9edd('0x26')]?_[_0x9edd('0x49')](_0x5df1d7[_0x9edd('0x26')])?_0x5df1d7['transport'][_0x9edd('0x27')]():_0x5df1d7['transport']:_0x9edd('0x25');if(_0x507cce===_0x9edd('0x4a')){_0x507cce='udp';}this[_0x9edd('0x6')]('transport',_0x507cce);this[_0x9edd('0x6')](_0x9edd('0x4b'),'no');this[_0x9edd('0x6')]('avpf',null);this[_0x9edd('0x6')](_0x9edd('0x4c'),null);this[_0x9edd('0x6')](_0x9edd('0x4d'),null);this[_0x9edd('0x6')]('dtlsenable',null);this['setDataValue'](_0x9edd('0x4e'),null);this[_0x9edd('0x6')]('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0x9edd('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x9edd('0x4f'),'no');break;case 0x2:this[_0x9edd('0x6')]('transport',_0x9edd('0x4a'));this[_0x9edd('0x6')](_0x9edd('0x4b'),'yes');this[_0x9edd('0x6')]('avpf',_0x9edd('0x2f'));this[_0x9edd('0x6')]('force_avp',_0x9edd('0x2f'));this[_0x9edd('0x6')]('icesupport',_0x9edd('0x2f'));this[_0x9edd('0x6')](_0x9edd('0x50'),_0x9edd('0x2f'));this['setDataValue'](_0x9edd('0x4e'),'no');this['setDataValue'](_0x9edd('0x51'),_0x9edd('0x43'));this[_0x9edd('0x6')]('dtlscertfile',_0x5df1d7[_0x9edd('0x52')]||_0x9edd('0x53'));this[_0x9edd('0x6')](_0x9edd('0x54'),_0x5df1d7[_0x9edd('0x54')]||_0x9edd('0x55'));this[_0x9edd('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize[_0x9edd('0x56')],'set':function(_0x3c7874){this[_0x9edd('0x6')](_0x9edd('0x57'),_0x3c7874?_0x3c7874[_0x9edd('0x27')](','):[]);},'get':function(){return this['getDataValue'](_0x9edd('0x57'))?_[_0x9edd('0x58')](this[_0x9edd('0x15')]('permissions')[_0x9edd('0x28')](','),function(_0x29d70d){return parseInt(_0x29d70d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9edd('0xe')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9edd('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9edd('0x59')],'get':function(){return this[_0x9edd('0x15')](_0x9edd('0x5a'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9edd('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9edd('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x1eabcd){if(typeof _0x1eabcd===_0x9edd('0x5b')){var _0xef1397=_0x1eabcd==='1'?!![]:_0x1eabcd==='0'?![]:_0x1eabcd==='true'?!![]:_0x1eabcd===_0x9edd('0x5c')?![]:![];this[_0x9edd('0x6')](_0x9edd('0x5d'),_0xef1397);}else{this[_0x9edd('0x6')](_0x9edd('0x5d'),_0x1eabcd);}}},'blocked':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![],'set':function(_0x14fa8a){this['setDataValue'](_0x9edd('0x5e'),_0x14fa8a);if(_0x14fa8a===!![]){this[_0x9edd('0x6')]('blockedAt',moment());this[_0x9edd('0x6')](_0x9edd('0x5f'),0x0);}else{this['setDataValue'](_0x9edd('0x60'),null);}}},'blockedAt':{'type':Sequelize[_0x9edd('0x46')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x9edd('0x18')](0x5)[_0x9edd('0x61')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x9edd('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x9edd('0x18')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['certificate','passive','nonat','update,nonat','TEXT','showWebBar','wss','encryption','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','rtcp_mux','avpf','dtlsverify','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','split','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a9e('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x14')},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x0a9e('0xc'),_0x0a9e('0x17')),'allowNull':!![],'defaultValue':_0x0a9e('0x16')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')]('ALLOWED_NOT_SCREENED',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),'PROHIB_PASSED_SCREEN',_0x0a9e('0x1d'),_0x0a9e('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x540530){this[_0x0a9e('0x4')]('transport',_0x540530?_0x540530[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))['split'](','):null;},'comment':_0x0a9e('0x22')},'dtmfmode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x23'),_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27')),'allowNull':!![],'defaultValue':_0x0a9e('0x23')},'directmedia':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no','nonat',_0x0a9e('0x29'),_0x0a9e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0x15de0e){this['setDataValue']('nat',_0x15de0e?_0x15de0e[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this[_0x0a9e('0x8')](_0x0a9e('0x2c'))[_0x0a9e('0x2d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a9e('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a9e('0x3')]},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x2e'),'set':function(_0x40d766){this['setDataValue'](_0x0a9e('0x2f'),_0x40d766?_0x40d766[_0x0a9e('0x20')](';'):_0x0a9e('0x2e'));},'get':function(){return this[_0x0a9e('0x8')]('allow')?this['getDataValue'](_0x0a9e('0x2f'))[_0x0a9e('0x2d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x5b4f5e){this[_0x0a9e('0x4')](_0x0a9e('0x30'),_0x5b4f5e?_0x5b4f5e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x30'))?this[_0x0a9e('0x8')](_0x0a9e('0x30'))[_0x0a9e('0x2d')](','):null;},'comment':_0x0a9e('0x31')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x32')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x28')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x34'),_0x0a9e('0x35'),_0x0a9e('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38')),'allowNull':!![],'defaultValue':_0x0a9e('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','fingerprint',_0x0a9e('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no',_0x0a9e('0x3b'),_0x0a9e('0x29'),_0x0a9e('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a9e('0x3d')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3649cc){this['setDataValue'](_0x0a9e('0x3e'),_0x3649cc);var _0x5ba1f9=this['get']({'plain':!![]});switch(_0x3649cc){case 0x0:case 0x1:var _0x5674ee=_0x5ba1f9[_0x0a9e('0x21')]?_['isArray'](_0x5ba1f9[_0x0a9e('0x21')])?_0x5ba1f9[_0x0a9e('0x21')][_0x0a9e('0x20')]():_0x5ba1f9[_0x0a9e('0x21')]:_0x0a9e('0x1f');if(_0x5674ee===_0x0a9e('0x3f')){_0x5674ee='udp';}this[_0x0a9e('0x4')]('transport',_0x5674ee);this[_0x0a9e('0x4')](_0x0a9e('0x40'),'no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x41'),null);this[_0x0a9e('0x4')](_0x0a9e('0x42'),null);this['setDataValue'](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('dtlsverify',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this[_0x0a9e('0x4')]('dtlsprivatekey',null);this[_0x0a9e('0x4')](_0x0a9e('0x46'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x3f'));this['setDataValue']('encryption',_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x47'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x41'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x42'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x49'));this['setDataValue'](_0x0a9e('0x45'),_0x5ba1f9[_0x0a9e('0x45')]||_0x0a9e('0x4a'));this['setDataValue'](_0x0a9e('0x4b'),_0x5ba1f9[_0x0a9e('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x0a9e('0x3d')],'set':function(_0x13b5c0){this['setDataValue']('permissions',_0x13b5c0?_0x13b5c0['join'](','):[]);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x4c'))?_[_0x0a9e('0x4d')](this[_0x0a9e('0x8')](_0x0a9e('0x4c'))[_0x0a9e('0x2d')](','),function(_0xeef20){return parseInt(_0xeef20,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0a9e('0x4e')],'get':function(){return this[_0x0a9e('0x8')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a9e('0x8')](_0x0a9e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0xdb98ca){if(typeof _0xdb98ca===_0x0a9e('0x50')){var _0x3df0e3=_0xdb98ca==='1'?!![]:_0xdb98ca==='0'?![]:_0xdb98ca===_0x0a9e('0x51')?!![]:_0xdb98ca===_0x0a9e('0x52')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0x3df0e3);}else{this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0xdb98ca);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xf4120f){this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0xf4120f);if(_0xf4120f===!![]){this['setDataValue'](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')](_0x0a9e('0x56'),0x0);}else{this[_0x0a9e('0x4')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0a9e('0xf')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'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 662f8ad..0d22351 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 _0x9760=['QueryTypes','from','voicemail','mailbox','fullname','permissions','101','102','113','104','105','106','107','100','115','user','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','create','UserProfileSection','Agents','autoAssociation','bulkCreate','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','map','VoiceMail','some','findAll','isEmpty','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','updatePasswordsHistory','online','loginInPause','voicePause','interface','isValidChannel','capitalize','toLowerCase','spread','emit','voice','VoiceQueue','SIP/%s','penalty','UserVoiceQueueRt','removeQueues','channel','remove','Queues','isArray','QueueId','Queue:remove','addAvatar','userpic','file','getAvatar','join','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','getOpenTabs','ChatOpenTabs','createdAt','FAX','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','CmContact','filters','order','sort','pick','getContacts','Tag','Tags','tag','hasOwnProperty','nolimit','getQueues','Unknown\x20channel','Queue','options','Unknown\x20role','getVoiceQueuesRt','ChatGroup','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','phone','format','LOCAL/%s@from-sip/n','intrf','user:%s','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','update','getChannels','YYYY-MM-DD\x20HH:mm:ss','PAUSE','LOGININPAUSE','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','addAgent','getDataValue','Voice','Queue:save','flattenDeep','removeAgent','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$or','$lt','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$notLike','$notILike','$like','$overlap','$any','firstName','lastName','Contact','dialActive','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','removeApiKey','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','inbound','flatten','lower','col','toString','asc','uniqBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','unavailable','voiceStatus','slice','charAt','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','OpenTabs','moment','util','path','lodash','squel','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','APINotFoundError','../../errors/api','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','client','http','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','role','admin','Users','agent','Telephones','telephone','value','includes','find','name','UserProfileResource','stack','send','index','User','rawAttributes','fieldName','type','key','filter','password','getOptions','where','include','query','userSetting','UserSetting','attributes','rows','openTabs','true','length','dataValues','push','sms','mail','openchannel','whatsapp','all','catch','show','params','model','differenceBy','keys','salt','intersection','fields','includeAll','merge','chat','fax','body','describe','addContacts','ids','omit','internal','Setting','securePassword','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)'];(function(_0x5ed3c4,_0x259c9e){var _0x4c819b=function(_0x634134){while(--_0x634134){_0x5ed3c4['push'](_0x5ed3c4['shift']());}};_0x4c819b(++_0x259c9e);}(_0x9760,0x11e));var _0x0976=function(_0x59c99e,_0x3d104c){_0x59c99e=_0x59c99e-0x0;var _0x18b907=_0x9760[_0x59c99e];return _0x18b907;};'use strict';var moment=require(_0x0976('0x0'));var util=require(_0x0976('0x1'));var path=require(_0x0976('0x2'));var fs=require('fs');var _=require(_0x0976('0x3'));var squel=require(_0x0976('0x4'));var jayson=require('jayson/promise');var Redis=require('ioredis');var authService=require(_0x0976('0x5'));var qs=require(_0x0976('0x6'));var logger=require('../../config/logger')(_0x0976('0x7'));var utils=require(_0x0976('0x8'));var config=require('../../config/environment');var licenseUtil=require(_0x0976('0x9'));var APIBadRequestError=require('../../errors/api')['APIBadRequestError'];var APINotFoundError=require('../../errors/api')[_0x0976('0xa')];var APIHandleError=require(_0x0976('0xb'))[_0x0976('0xc')];var db=require(_0x0976('0xd'))['db'];var socket=require(_0x0976('0xe'))(new Redis(config[_0x0976('0xf')]));require(_0x0976('0x10'))[_0x0976('0x11')](socket);config[_0x0976('0xf')]=_[_0x0976('0x12')](config[_0x0976('0xf')],{'host':'localhost','port':0x18eb});var amiClient=jayson[_0x0976('0x13')][_0x0976('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0xe5ba4f,_0x1a9437,_0x3965f1,_0xa56822){return new Promise(function(_0x15e2d2,_0x5a1f19){var _0x1909ca=_0xa56822||amiClient;return _0x1909ca['request'](_0xe5ba4f,_0x3965f1)['then'](function(_0x593922){logger[_0x0976('0x15')](_0x0976('0x16'),_0x1a9437,'request\x20sent');logger[_0x0976('0x17')](_0x0976('0x18'),_0x1a9437,_0x0976('0x19'),JSON['stringify'](_0x593922));if(_0x593922['error']){if(_0x593922['error'][_0x0976('0x1a')]===0x1f4){logger[_0x0976('0x1b')]('User,\x20%s,\x20%s',_0x1a9437,_0x593922['error']['message']);return _0x5a1f19(_0x593922['error'][_0x0976('0x1c')]);}logger['error'](_0x0976('0x16'),_0x1a9437,_0x593922[_0x0976('0x1b')]['message']);return _0x15e2d2(_0x593922['error']['message']);}else{logger[_0x0976('0x15')]('User,\x20%s,\x20%s',_0x1a9437,_0x0976('0x19'));_0x15e2d2(_0x593922['result'][_0x0976('0x1c')]);}})['catch'](function(_0x25c810){logger[_0x0976('0x1b')](_0x0976('0x16'),_0x1a9437,_0x25c810);_0x5a1f19(_0x25c810);});});}function respondWithStatusCode(_0x4e17a9,_0x29c4a4){_0x29c4a4=_0x29c4a4||0xcc;return function(_0x293262){if(_0x293262){return _0x4e17a9[_0x0976('0x1d')](_0x29c4a4);}return _0x4e17a9[_0x0976('0x1e')](_0x29c4a4)[_0x0976('0x1f')]();};}function respondWithResult(_0xdd751b,_0x6fe2c7){_0x6fe2c7=_0x6fe2c7||0xc8;return function(_0x4b7151){if(_0x4b7151){return _0xdd751b[_0x0976('0x1e')](_0x6fe2c7)[_0x0976('0x20')](_0x4b7151);}};}function respondWithFilteredResult(_0x1dd610,_0x3e4894){return function(_0x3d7fe6){if(_0x3d7fe6){var _0x36220a=typeof _0x3e4894[_0x0976('0x21')]===_0x0976('0x22')&&typeof _0x3e4894[_0x0976('0x23')]===_0x0976('0x22');var _0x3cde06=_0x3d7fe6[_0x0976('0x24')];var _0x19946e=_0x36220a?0x0:_0x3e4894[_0x0976('0x21')];var _0x4ff3a5=_0x36220a?_0x3d7fe6[_0x0976('0x24')]:_0x3e4894[_0x0976('0x21')]+_0x3e4894['limit'];var _0x13ae11;if(_0x4ff3a5>=_0x3cde06){_0x4ff3a5=_0x3cde06;_0x13ae11=0xc8;}else{_0x13ae11=0xce;}_0x1dd610[_0x0976('0x1e')](_0x13ae11);return _0x1dd610[_0x0976('0x25')](_0x0976('0x26'),_0x19946e+'-'+_0x4ff3a5+'/'+_0x3cde06)[_0x0976('0x20')](_0x3d7fe6);}return null;};}function saveUpdates(_0x3e5ad7){return function(_0x53d82e){if(_0x53d82e){return _0x53d82e['update'](_0x3e5ad7)[_0x0976('0x27')](function(_0x37e6fe){socket['emit']('userNotification:recalc:'+_0x37e6fe['id'],{});return _0x37e6fe;});}return null;};}function removeEntity(_0x518ae4){return function(_0x463b94){if(_0x463b94){return _0x463b94[_0x0976('0x28')]()['then'](function(){var _0x1ce7ef=_0x463b94[_0x0976('0x29')]({'plain':!![]});if(_0x1ce7ef[_0x0976('0x2a')]===_0x0976('0x2b'))return;var _0x37f0a2=[{'name':_0x0976('0x2c'),'value':'user','ignore':!![]},{'name':'Agents','value':_0x0976('0x2d'),'ignore':![]},{'name':_0x0976('0x2e'),'value':_0x0976('0x2f'),'ignore':![]}];var _0x74c8e4=_(_0x37f0a2)['filter']('ignore')['map'](_0x0976('0x30'))['value']();if(_[_0x0976('0x31')](_0x74c8e4,_0x1ce7ef[_0x0976('0x2a')])){return;}var _0x22258c=_[_0x0976('0x32')](_0x37f0a2,[_0x0976('0x30'),_0x1ce7ef[_0x0976('0x2a')]])[_0x0976('0x33')];return db[_0x0976('0x34')][_0x0976('0x28')]({'where':{'type':_0x22258c,'resourceId':_0x1ce7ef['id']}})[_0x0976('0x27')](function(){return _0x463b94;});})[_0x0976('0x27')](function(){_0x518ae4['status'](0xcc)[_0x0976('0x1f')]();});}};}function handleEntityNotFound(_0x36e023){return function(_0xe5309){if(!_0xe5309){_0x36e023[_0x0976('0x1d')](0x194);}return _0xe5309;};}function handleError(_0x14dcbf,_0x308aeb){_0x308aeb=_0x308aeb||0x1f4;return function(_0xa933c9){logger[_0x0976('0x1b')](_0xa933c9[_0x0976('0x35')]);if(_0xa933c9[_0x0976('0x33')]){delete _0xa933c9[_0x0976('0x33')];}_0x14dcbf[_0x0976('0x1e')](_0x308aeb)[_0x0976('0x36')](_0xa933c9);};}exports[_0x0976('0x37')]=function(_0x58a25d,_0x488ddd){var _0x419d1f={},_0x331195={'count':0x0,'rows':[]};var _0xa020a5=_(db[_0x0976('0x38')][_0x0976('0x39')])['map'](function(_0x5aabf1){return{'name':_0x5aabf1[_0x0976('0x3a')],'type':_0x5aabf1[_0x0976('0x3b')][_0x0976('0x3c')]};})[_0x0976('0x3d')](function(_0x40daa0){return!_[_0x0976('0x31')]([_0x0976('0x3e'),'salt'],_0x40daa0['name']);})['value']();_0x419d1f=qs[_0x0976('0x3f')](_0xa020a5,_0x58a25d);var _0x10863b={'where':_0x419d1f[_0x0976('0x40')]};return db['User']['count'](_0x10863b)[_0x0976('0x27')](function(_0x167496){_0x331195[_0x0976('0x24')]=_0x167496;if(_0x58a25d['query']['includeAll']){_0x419d1f[_0x0976('0x41')]=[{'all':!![]}];}if(_0x58a25d[_0x0976('0x42')][_0x0976('0x43')]==='true'){_0x419d1f['include']=[{'model':db[_0x0976('0x44')],'as':'userSetting'}];}if(!_[_0x0976('0x31')](_0x419d1f[_0x0976('0x45')],'id')){_0x419d1f[_0x0976('0x45')]['push']('id');}return db['User']['findAll'](_0x419d1f);})[_0x0976('0x27')](function(_0x5b06ed){_0x331195[_0x0976('0x46')]=_0x5b06ed;if(_0x58a25d['query'][_0x0976('0x47')]===_0x0976('0x48')){var _0x587b6b=[];for(var _0x2d44d9=0x0;_0x2d44d9<_0x331195[_0x0976('0x46')][_0x0976('0x49')];_0x2d44d9++){_0x587b6b['push'](get_open_tabs('chat',_0x331195['rows'][_0x2d44d9][_0x0976('0x4a')]));_0x587b6b[_0x0976('0x4b')](get_open_tabs(_0x0976('0x4c'),_0x331195[_0x0976('0x46')][_0x2d44d9][_0x0976('0x4a')]));_0x587b6b[_0x0976('0x4b')](get_open_tabs('fax',_0x331195[_0x0976('0x46')][_0x2d44d9]['dataValues']));_0x587b6b[_0x0976('0x4b')](get_open_tabs(_0x0976('0x4d'),_0x331195[_0x0976('0x46')][_0x2d44d9][_0x0976('0x4a')]));_0x587b6b['push'](get_open_tabs(_0x0976('0x4e'),_0x331195[_0x0976('0x46')][_0x2d44d9][_0x0976('0x4a')]));_0x587b6b[_0x0976('0x4b')](get_open_tabs(_0x0976('0x4f'),_0x331195[_0x0976('0x46')][_0x2d44d9][_0x0976('0x4a')]));}return Promise[_0x0976('0x50')](_0x587b6b)[_0x0976('0x27')](function(){return _0x331195;});}else{return _0x331195;}})[_0x0976('0x27')](respondWithFilteredResult(_0x488ddd,_0x419d1f))[_0x0976('0x51')](handleError(_0x488ddd,null));};exports[_0x0976('0x52')]=function(_0x3da136,_0x10f1dd){var _0x3e5099={'raw':![],'where':{'id':_0x3da136[_0x0976('0x53')]['id']}},_0x546ad7={};_0x546ad7[_0x0976('0x54')]=_[_0x0976('0x55')](_[_0x0976('0x56')](db['User'][_0x0976('0x39')]),[_0x0976('0x3e'),_0x0976('0x57')]);_0x546ad7[_0x0976('0x42')]=_['keys'](_0x3da136[_0x0976('0x42')]);_0x546ad7['filters']=_[_0x0976('0x58')](_0x546ad7[_0x0976('0x54')],_0x546ad7[_0x0976('0x42')]);_0x3e5099[_0x0976('0x45')]=_[_0x0976('0x58')](_0x546ad7[_0x0976('0x54')],qs[_0x0976('0x59')](_0x3da136[_0x0976('0x42')]['fields']));_0x3e5099[_0x0976('0x45')]=_0x3e5099[_0x0976('0x45')][_0x0976('0x49')]?_0x3e5099[_0x0976('0x45')]:_0x546ad7[_0x0976('0x54')];if(_0x3da136[_0x0976('0x42')][_0x0976('0x5a')]){_0x3e5099['include']=[{'all':!![]}];}if(_0x3da136[_0x0976('0x42')][_0x0976('0x43')]===_0x0976('0x48')){_0x3e5099[_0x0976('0x41')]=[{'model':db[_0x0976('0x44')],'as':_0x0976('0x43')}];}_0x3e5099=_[_0x0976('0x5b')]({},_0x3e5099,_0x3da136['options']);if(!_[_0x0976('0x31')](_0x3e5099[_0x0976('0x45')],'id')){_0x3e5099['attributes'][_0x0976('0x4b')]('id');}return db[_0x0976('0x38')][_0x0976('0x32')](_0x3e5099)['then'](handleEntityNotFound(_0x10f1dd,null))[_0x0976('0x27')](function(_0x238c04){var _0x5ce233=[];values=_0x238c04;if(_0x3da136[_0x0976('0x42')][_0x0976('0x47')]==='true'){_0x5ce233['push'](get_open_tabs(_0x0976('0x5c'),_0x238c04['dataValues']));_0x5ce233[_0x0976('0x4b')](get_open_tabs('sms',_0x238c04[_0x0976('0x4a')]));_0x5ce233[_0x0976('0x4b')](get_open_tabs(_0x0976('0x4e'),_0x238c04['dataValues']));_0x5ce233[_0x0976('0x4b')](get_open_tabs(_0x0976('0x4f'),_0x238c04[_0x0976('0x4a')]));_0x5ce233[_0x0976('0x4b')](get_open_tabs(_0x0976('0x5d'),_0x238c04[_0x0976('0x4a')]));_0x5ce233['push'](get_open_tabs(_0x0976('0x4d'),_0x238c04['dataValues']));return Promise['all'](_0x5ce233);}else{return values;}})[_0x0976('0x27')](function(){return values;})[_0x0976('0x27')](respondWithResult(_0x10f1dd,null))['catch'](handleError(_0x10f1dd,null));};exports['update']=function(_0x2a7b8f,_0x54d5d4){if(_0x2a7b8f[_0x0976('0x5e')]['id']){delete _0x2a7b8f[_0x0976('0x5e')]['id'];}delete _0x2a7b8f[_0x0976('0x5e')][_0x0976('0x2a')];return db[_0x0976('0x38')][_0x0976('0x32')]({'where':{'id':_0x2a7b8f['params']['id']}})[_0x0976('0x27')](handleEntityNotFound(_0x54d5d4,null))[_0x0976('0x27')](saveUpdates(_0x2a7b8f[_0x0976('0x5e')],null))[_0x0976('0x27')](respondWithResult(_0x54d5d4,null))[_0x0976('0x51')](handleError(_0x54d5d4,null));};exports['describe']=function(_0x1e078e,_0x150811){return db['User'][_0x0976('0x5f')]()['then'](respondWithResult(_0x150811,null))[_0x0976('0x51')](handleError(_0x150811,null));};exports[_0x0976('0x60')]=function(_0x3b7a15,_0x27c23f){return db[_0x0976('0x38')][_0x0976('0x32')]({'where':{'id':_0x3b7a15[_0x0976('0x53')]['id']}})[_0x0976('0x27')](handleEntityNotFound(_0x27c23f,null))[_0x0976('0x27')](function(_0x2009c1){if(_0x2009c1){return _0x2009c1[_0x0976('0x60')](_0x3b7a15[_0x0976('0x5e')][_0x0976('0x61')],_[_0x0976('0x62')](_0x3b7a15[_0x0976('0x5e')],[_0x0976('0x61'),'id'])||{});}})[_0x0976('0x27')](respondWithResult(_0x27c23f,null))[_0x0976('0x51')](handleError(_0x27c23f,null));};function validateUser(_0x1e3103){return new Promise(function(_0x1044b1,_0x20480b){if(_0x1e3103[_0x0976('0x63')])return _0x1044b1(_0x1e3103);return db[_0x0976('0x64')]['findById'](0x1)[_0x0976('0x27')](function(_0x3b4be9){if(_0x3b4be9[_0x0976('0x65')])authService['validatePasswordPattern'](_0x1e3103['password']);db[_0x0976('0x38')][_0x0976('0x66')](_0x0976('0x63'))[_0x0976('0x27')](function(_0x3949e4){if(_[_0x0976('0x67')](_0x3949e4)){_0x1e3103[_0x0976('0x63')]=_0x3b4be9[_0x0976('0x68')]||0x1;return;}if(_['isNil'](_0x3b4be9[_0x0976('0x68')])||_0x3b4be9[_0x0976('0x68')]===_0x3949e4){_0x1e3103[_0x0976('0x63')]=_0x3949e4+0x1;return;}if(_0x3b4be9[_0x0976('0x68')]>_0x3949e4){_0x1e3103[_0x0976('0x63')]=_0x3b4be9[_0x0976('0x68')];return;}return db[_0x0976('0x69')][_0x0976('0x42')](_0x0976('0x6a'),{'type':db['sequelize'][_0x0976('0x6b')]['SELECT']})['then'](function(_0x1f7f3d){if(_0x1f7f3d&&_0x1f7f3d['length']){for(var _0x1f805f=0x0,_0x2178ea=_0x1f7f3d[_0x0976('0x49')];_0x1f805f<_0x2178ea&&_[_0x0976('0x67')](_0x1e3103[_0x0976('0x63')]);_0x1f805f++){if(_0x3b4be9[_0x0976('0x68')]<=_0x1f7f3d[_0x1f805f][_0x0976('0x6c')]){_0x1e3103[_0x0976('0x63')]=_0x1f7f3d[_0x1f805f][_0x0976('0x6c')];}else if(_0x3b4be9[_0x0976('0x68')]>_0x1f7f3d[_0x1f805f]['from']&&_0x3b4be9[_0x0976('0x68')]<=_0x1f7f3d[_0x1f805f]['to']){_0x1e3103['internal']=_0x3b4be9[_0x0976('0x68')];}}}if(_[_0x0976('0x67')](_0x1e3103['internal'])){_0x1e3103[_0x0976('0x63')]=_0x3949e4+0x1;}return _0x1044b1(_0x1e3103);});});})['catch'](function(_0x2fd784){_0x20480b(_0x2fd784);});});}function updateUser(_0x1239ad){return new Promise(function(_0x36e4a7,_0x64644d){try{if(_0x1239ad[_0x0976('0x6d')]){_0x1239ad[_0x0976('0x6e')]=_0x1239ad['internal'];_0x1239ad['VoiceMail']={'mailbox':_0x1239ad[_0x0976('0x63')],'password':_0x1239ad[_0x0976('0x3e')],'fullname':_0x1239ad[_0x0976('0x6f')],'email':_0x1239ad['email']};}if(_0x1239ad['role']===_0x0976('0x2d')){if(!_0x1239ad[_0x0976('0x70')])_0x1239ad[_0x0976('0x70')]=[_0x0976('0x71'),_0x0976('0x72'),'103',_0x0976('0x73'),'110',_0x0976('0x74'),_0x0976('0x75'),_0x0976('0x76'),_0x0976('0x77'),'108','109',_0x0976('0x78'),'111','114',_0x0976('0x79')];}_0x36e4a7(_0x1239ad);}catch(_0x1f8877){_0x64644d(_0x1f8877);}});}exports['create']=function(_0x5a3bfa,_0x2481f6){if(_0x5a3bfa[_0x0976('0x7a')][_0x0976('0x2a')]===_0x0976('0x2d'))throw new Error(_0x0976('0x7b'));if(_0x5a3bfa[_0x0976('0x5e')][_0x0976('0x2a')]===_0x0976('0x7a')&&_0x5a3bfa['user'][_0x0976('0x2a')]!==_0x0976('0x2b')){throw new Error(_0x0976('0x7c'));}if(_0x5a3bfa[_0x0976('0x5e')][_0x0976('0x2a')]===_0x0976('0x2b')&&_0x5a3bfa[_0x0976('0x7a')][_0x0976('0x2a')]!=='admin'){throw new Error(_0x0976('0x7d'));}return licenseUtil['checkUserLimits']([_0x5a3bfa[_0x0976('0x5e')]])[_0x0976('0x27')](function(){return validateUser(_0x5a3bfa[_0x0976('0x5e')]);})[_0x0976('0x27')](function(_0x3bb0f5){return updateUser(_0x3bb0f5)['then'](function(_0xf756d6){if(_0xf756d6[_0x0976('0x2a')]==='admin'){_0xf756d6[_0x0976('0x7e')]=_0x5a3bfa['user'][_0x0976('0x7e')];delete _0xf756d6[_0x0976('0x7f')];}return _0xf756d6;});})[_0x0976('0x27')](function(_0xa5766){return db[_0x0976('0x38')][_0x0976('0x80')](_0xa5766,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})['then'](function(_0x5f0ac7){if(_0x5a3bfa['body']['role']===_0x0976('0x7a'))return _0x5f0ac7;if(_0x5a3bfa['user'][_0x0976('0x2a')]!==_0x0976('0x7a'))return _0x5f0ac7;return db[_0x0976('0x81')][_0x0976('0x32')]({'where':{'name':_0x5f0ac7[_0x0976('0x2a')]===_0x0976('0x2d')?_0x0976('0x82'):_0x0976('0x2e'),'userProfileId':_0x5a3bfa[_0x0976('0x7a')][_0x0976('0x7f')]},'raw':!![]})[_0x0976('0x27')](function(_0x2a19ab){if(!_0x2a19ab||_0x2a19ab[_0x0976('0x83')]!=0x0)return _0x5f0ac7;return db['UserProfileResource'][_0x0976('0x80')]({'name':_0x5f0ac7[_0x0976('0x33')],'resourceId':_0x5f0ac7['id'],'type':_0x2a19ab[_0x0976('0x33')],'sectionId':_0x2a19ab['id']},{})['then'](function(){return _0x5f0ac7;});})['catch'](function(_0xf11616){logger[_0x0976('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf11616);throw _0xf11616;});})[_0x0976('0x27')](respondWithResult(_0x2481f6,0xc9))[_0x0976('0x51')](handleError(_0x2481f6,null));};exports[_0x0976('0x84')]=function(_0xd67150,_0x4947b7){var _0x19937b=_0xd67150[_0x0976('0x5e')];var _0x51abed=[];if(_0xd67150[_0x0976('0x7a')][_0x0976('0x2a')]==='agent')throw new Error('Unauthorized');if(_['some'](_0x19937b,[_0x0976('0x2a'),_0x0976('0x7a')])&&_0xd67150[_0x0976('0x7a')]['role']!==_0x0976('0x2b')){throw new Error(_0x0976('0x7c'));}if(_['some'](_0x19937b,['role',_0x0976('0x2b')])&&_0xd67150['user'][_0x0976('0x2a')]!==_0x0976('0x2b')){throw new Error(_0x0976('0x85'));}return licenseUtil[_0x0976('0x86')](_0x19937b)['then'](function(){return validateUser(_0x19937b[0x0]);})[_0x0976('0x27')](function(){for(var _0x5e57ee=0x1;_0x5e57ee<_0x19937b['length'];_0x5e57ee++){var _0x2b076a=_0x19937b[_0x5e57ee-0x1][_0x0976('0x63')];if(!_0x19937b[_0x5e57ee][_0x0976('0x63')])_0x19937b[_0x5e57ee][_0x0976('0x63')]=_0x2b076a+0x1;_0x51abed[_0x0976('0x4b')](validateUser(_0x19937b[_0x5e57ee]));}return Promise['all'](_0x51abed);})[_0x0976('0x27')](function(){_0x51abed=[];for(var _0x2172a2=0x0;_0x2172a2<_0x19937b[_0x0976('0x49')];_0x2172a2++){_0x51abed[_0x0976('0x4b')](updateUser(_0x19937b[_0x2172a2]));}return Promise[_0x0976('0x50')](_0x51abed);})[_0x0976('0x27')](function(){_0x51abed=_0x19937b[_0x0976('0x87')](function(_0x4309f1){return db[_0x0976('0x38')][_0x0976('0x80')](_0x4309f1,{'include':[{'model':db[_0x0976('0x88')],'as':_0x0976('0x88')}]})[_0x0976('0x27')](function(_0x3b4083){_0x4309f1['id']=_0x3b4083['id'];return _0x4309f1;});});return Promise[_0x0976('0x50')](_0x51abed);})[_0x0976('0x27')](function(_0x210704){if(_0xd67150[_0x0976('0x5e')][_0x0976('0x2a')]===_0x0976('0x7a'))return _0x210704;if(_0xd67150[_0x0976('0x7a')][_0x0976('0x2a')]!==_0x0976('0x7a'))return _0x210704;var _0x1b0f0d=_[_0x0976('0x89')](_0x210704,function(_0x5aab81){return _0x5aab81[_0x0976('0x2a')]===_0x0976('0x2d')||_0x5aab81[_0x0976('0x2a')]===_0x0976('0x2f');});if(!_0x1b0f0d)return _0x210704;return db[_0x0976('0x81')][_0x0976('0x8a')]({'where':{'name':{'$or':[_0x0976('0x82'),_0x0976('0x2e')]},'userProfileId':_0xd67150['user'][_0x0976('0x7f')]},'raw':!![]})[_0x0976('0x27')](function(_0x2f43e8){if(_[_0x0976('0x8b')](_0x2f43e8)||!_[_0x0976('0x89')](_0x2f43e8,[_0x0976('0x83'),0x0]))return _0x210704;_0x51abed=[];var _0x4d4e09=_(_0x2f43e8)['map'](function(_0x28e9dc){if(_0x28e9dc[_0x0976('0x83')]===0x1)return;return _0x28e9dc[_0x0976('0x33')]===_0x0976('0x82')?_0x0976('0x2d'):'telephone';})['compact']()['value']();for(var _0x4fd22d=0x0;_0x4fd22d<_0x210704['length'];_0x4fd22d++){if(!_[_0x0976('0x31')](_0x4d4e09,_0x210704[_0x4fd22d][_0x0976('0x2a')]))return;var _0x38c0a4=_0x210704[_0x4fd22d]['role']===_0x0976('0x2d')?_0x0976('0x82'):_0x0976('0x2e');_0x51abed[_0x0976('0x4b')](db[_0x0976('0x34')]['create']({'name':_0x210704[_0x4fd22d][_0x0976('0x33')],'resourceId':_0x210704[_0x4fd22d]['id'],'type':_0x38c0a4,'sectionId':_['find'](_0x2f43e8,[_0x0976('0x33'),_0x38c0a4])['id']},{}));}return Promise[_0x0976('0x50')](_0x51abed);});})[_0x0976('0x27')](respondWithResult(_0x4947b7,0xc9))[_0x0976('0x51')](handleError(_0x4947b7,null));};exports['changePassword']=function(_0x108ee8,_0x34ac4a){if(_0x108ee8[_0x0976('0x5e')]['id']){delete _0x108ee8[_0x0976('0x5e')]['id'];}return db[_0x0976('0x38')][_0x0976('0x32')]({'where':{'id':_0x108ee8[_0x0976('0x53')]['id']}})[_0x0976('0x27')](function(_0x1a1b64){if(!_0x1a1b64)return null;if(_0x1a1b64['id']===_0x108ee8['user']['id']){if(!_0x108ee8[_0x0976('0x5e')][_0x0976('0x8c')]||!_0x108ee8[_0x0976('0x5e')]['newPassword']){throw new db[(_0x0976('0x8d'))][(_0x0976('0x8e'))](_0x0976('0x8f'));}if(!_0x1a1b64[_0x0976('0x90')](_0x108ee8[_0x0976('0x5e')][_0x0976('0x8c')])){throw new db[(_0x0976('0x8d'))]['ValidationError'](_0x0976('0x91'));}if(_0x108ee8[_0x0976('0x5e')][_0x0976('0x8c')]===_0x108ee8[_0x0976('0x5e')][_0x0976('0x92')]){throw new db['Sequelize'][(_0x0976('0x8e'))](_0x0976('0x93'));}}else if(_0x108ee8[_0x0976('0x7a')]['role']===_0x0976('0x2b')){if(!_0x108ee8[_0x0976('0x5e')]['newPassword']){throw new db[(_0x0976('0x8d'))][(_0x0976('0x8e'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x108ee8[_0x0976('0x7a')]['role']==='user'){if(!_0x108ee8[_0x0976('0x5e')]['newPassword']){throw new db[(_0x0976('0x8d'))][(_0x0976('0x8e'))](_0x0976('0x94'));}if(_0x1a1b64[_0x0976('0x2a')]!==_0x0976('0x2d')){throw new db[(_0x0976('0x8d'))]['ValidationError'](_0x0976('0x7b'));}}else{throw new db[(_0x0976('0x8d'))][(_0x0976('0x8e'))](_0x0976('0x7b'));}return _0x1a1b64;})['then'](handleEntityNotFound(_0x34ac4a,null))['then'](function(_0x2f25cb){return db[_0x0976('0x64')][_0x0976('0x95')]({'attributes':['id',_0x0976('0x65'),_0x0976('0x96'),_0x0976('0x97')]})[_0x0976('0x27')](function(_0x10f887){if(_0x10f887[_0x0976('0x65')])authService[_0x0976('0x98')](_0x108ee8[_0x0976('0x5e')][_0x0976('0x92')]);if(!_0x10f887[_0x0976('0x96')]||!_0x2f25cb[_0x0976('0x99')])return _0x2f25cb;authService['validatePasswordHistory'](_0x108ee8['body'][_0x0976('0x92')],_0x2f25cb['previousPasswords'],_0x10f887[_0x0976('0x97')]);return _0x2f25cb;})[_0x0976('0x27')](saveUpdates({'password':_0x108ee8[_0x0976('0x5e')][_0x0976('0x92')],'passwordResetAt':_0x108ee8[_0x0976('0x7a')]['id']==_0x108ee8['params']['id']?moment():null,'previousPasswords':authService[_0x0976('0x9a')](_0x108ee8[_0x0976('0x5e')][_0x0976('0x92')],_0x2f25cb[_0x0976('0x99')])},null));})['then'](respondWithResult(_0x34ac4a,null))[_0x0976('0x51')](handleError(_0x34ac4a,null));};exports['addQueues']=function(_0xe4c12d,_0x46d3a8){var _0x48279b=_0xe4c12d[_0x0976('0x5e')]['channel'];return db[_0x0976('0x38')]['find']({'where':{'id':_0xe4c12d[_0x0976('0x53')]['id']},'attributes':['id','name','role',_0x0976('0x9b'),_0x0976('0x9c'),_0x0976('0x9d'),_0x0976('0x9e')]})[_0x0976('0x27')](handleEntityNotFound(_0x46d3a8,null))[_0x0976('0x27')](function(_0x19a4c1){if(_0x19a4c1){if(!utils[_0x0976('0x9f')](_0x48279b)){throw new db[(_0x0976('0x8d'))][(_0x0976('0x8e'))]('Unknown\x20channel');}return _0x19a4c1['add'+_[_0x0976('0xa0')](_0x48279b[_0x0976('0xa1')]())+'Queues'](_0xe4c12d[_0x0976('0x5e')][_0x0976('0x61')],{'penalty':_0xe4c12d[_0x0976('0x5e')]['penalty']||0x0})[_0x0976('0xa2')](function(_0x9e31e8){for(var _0x626c09=0x0;_0x626c09<_0xe4c12d[_0x0976('0x5e')][_0x0976('0x61')][_0x0976('0x49')];_0x626c09+=0x1){var _0x34de12={'UserId':Number(_0xe4c12d[_0x0976('0x53')]['id'])};_0x34de12[_[_0x0976('0xa0')](_0x48279b[_0x0976('0xa1')]())+'QueueId']=Number(_0xe4c12d[_0x0976('0x5e')][_0x0976('0x61')][_0x626c09]);socket[_0x0976('0xa3')](_0x0976('0x7a')+_[_0x0976('0xa0')](_0x48279b[_0x0976('0xa1')]())+'Queue:save',_0x34de12);}return _0x9e31e8;})[_0x0976('0x27')](function(){if(_0x48279b===_0x0976('0xa4')){return db[_0x0976('0xa5')][_0x0976('0x8a')]({'where':{'id':_0xe4c12d[_0x0976('0x5e')][_0x0976('0x61')]||[]},'raw':!![],'attributes':['id',_0x0976('0x33')]});}})[_0x0976('0x27')](function(_0x1842ed){var _0x3f1329=_0x19a4c1[_0x0976('0x29')]({'plain':!![]});var _0x5ee0d9=[];if(_0x48279b===_0x0976('0xa4')&&_0x3f1329[_0x0976('0x2a')]===_0x0976('0x2d')&&_0x3f1329['online']){for(let _0x29a7de=0x0;_0x29a7de<_0x1842ed[_0x0976('0x49')];_0x29a7de+=0x1){_0x5ee0d9['push']({'membername':_0x3f1329[_0x0976('0x33')],'UserId':_0x3f1329['id'],'queue_name':_0x1842ed[_0x29a7de][_0x0976('0x33')],'VoiceQueueId':_0x1842ed[_0x29a7de]['id'],'interface':_[_0x0976('0x67')](_0x3f1329[_0x0976('0x9e')])?util['format'](_0x0976('0xa6'),_0x3f1329[_0x0976('0x33')]):_0x3f1329[_0x0976('0x9e')],'paused':_0x3f1329[_0x0976('0x9d')]||![],'penalty':_0xe4c12d[_0x0976('0x5e')][_0x0976('0xa7')]||0x0});}return Promise[_0x0976('0x50')](_0x5ee0d9[_0x0976('0x87')](function(_0x252923){return db[_0x0976('0xa8')]['upsert'](_0x252923);}));}return _0x19a4c1;});}})['then'](respondWithStatusCode(_0x46d3a8,null))[_0x0976('0x51')](handleError(_0x46d3a8,null));};exports[_0x0976('0xa9')]=function(_0x1dd910,_0x485255){var _0xdc89a6,_0x260b4c;return db[_0x0976('0x38')]['find']({'where':{'id':_0x1dd910[_0x0976('0x53')]['id']},'attributes':['id',_0x0976('0x33'),_0x0976('0x2a')]})['then'](handleEntityNotFound(_0x485255,null))['then'](function(_0x2291a3){if(_0x2291a3){_0xdc89a6=_0x2291a3;if(!_0x1dd910['query'][_0x0976('0xaa')]||!utils['isValidChannel'](_0x1dd910['query'][_0x0976('0xaa')])){throw new db[(_0x0976('0x8d'))][(_0x0976('0x8e'))]('Unknown\x20channel');}return _0x2291a3[_0x0976('0xab')+_[_0x0976('0xa0')](_0x1dd910[_0x0976('0x42')][_0x0976('0xaa')]['toLowerCase']())+_0x0976('0xac')](_0x1dd910[_0x0976('0x42')][_0x0976('0x61')]);}})[_0x0976('0x27')](function(_0x58520a){if(_[_0x0976('0xad')](_0x1dd910[_0x0976('0x42')][_0x0976('0x61')])){for(var _0x3cba42=0x0;_0x3cba42<_0x1dd910['query'][_0x0976('0x61')][_0x0976('0x49')];_0x3cba42+=0x1){_0x260b4c={'UserId':Number(_0x1dd910[_0x0976('0x53')]['id'])};_0x260b4c[_[_0x0976('0xa0')](_0x1dd910[_0x0976('0x42')][_0x0976('0xaa')]['toLowerCase']())+_0x0976('0xae')]=Number(_0x1dd910[_0x0976('0x42')][_0x0976('0x61')][_0x3cba42]);socket[_0x0976('0xa3')]('user'+_[_0x0976('0xa0')](_0x1dd910[_0x0976('0x42')]['channel'][_0x0976('0xa1')]())+_0x0976('0xaf'),_0x260b4c);}}else{_0x260b4c={'UserId':Number(_0x1dd910[_0x0976('0x53')]['id'])};_0x260b4c[_[_0x0976('0xa0')](_0x1dd910[_0x0976('0x42')][_0x0976('0xaa')]['toLowerCase']())+_0x0976('0xae')]=Number(_0x1dd910[_0x0976('0x42')][_0x0976('0x61')]);socket['emit'](_0x0976('0x7a')+_['capitalize'](_0x1dd910[_0x0976('0x42')][_0x0976('0xaa')]['toLowerCase']())+_0x0976('0xaf'),_0x260b4c);}return _0x58520a;})[_0x0976('0x27')](function(){if(_0x1dd910['query'][_0x0976('0xaa')]==='voice'){return db[_0x0976('0xa8')][_0x0976('0x28')]({'where':{'UserId':_0x1dd910[_0x0976('0x53')]['id'],'VoiceQueueId':_0x1dd910[_0x0976('0x42')][_0x0976('0x61')]},'individualHooks':!![]})[_0x0976('0x27')](function(){return _0xdc89a6;});}return _0xdc89a6;})['then'](respondWithStatusCode(_0x485255,null))[_0x0976('0x51')](handleError(_0x485255,null));};exports[_0x0976('0xb0')]=function(_0x4946c9,_0x38de22){_0x4946c9[_0x0976('0x5e')][_0x0976('0xb1')]=_0x4946c9[_0x0976('0xb2')]['filename'];return db[_0x0976('0x38')][_0x0976('0x32')]({'where':{'id':_0x4946c9['params']['id']}})['then'](handleEntityNotFound(_0x38de22,null))[_0x0976('0x27')](saveUpdates(_0x4946c9[_0x0976('0x5e')],null))['then'](respondWithResult(_0x38de22,null))[_0x0976('0x51')](handleError(_0x38de22,null));};exports[_0x0976('0xb3')]=function(_0x18724c,_0x2ed431){var _0x2ca5ec=path[_0x0976('0xb4')](config['root'],_0x0976('0xb5'));return db[_0x0976('0x38')]['find']({'where':{'id':_0x18724c[_0x0976('0x53')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x0976('0x27')](handleEntityNotFound(_0x2ed431,null))[_0x0976('0x27')](function(_0xfb7d13){if(_0xfb7d13){if(_[_0x0976('0x67')](_0xfb7d13[_0x0976('0xb1')])){return _0x2ed431[_0x0976('0xb6')](_0x2ca5ec);}else{if(!fs[_0x0976('0xb7')](path[_0x0976('0xb4')](config[_0x0976('0xb8')],_0x0976('0xb9'),_0xfb7d13[_0x0976('0xb1')]))){return _0x2ed431[_0x0976('0xb6')](_0x2ca5ec);}return _0x2ed431[_0x0976('0xb6')](path['join'](config[_0x0976('0xb8')],_0x0976('0xb9'),_0xfb7d13[_0x0976('0xb1')]));}}})[_0x0976('0x51')](handleError(_0x2ed431,null));};exports[_0x0976('0xba')]=function(_0x20dcf0,_0x3a2fea){return db[_0x0976('0x38')][_0x0976('0x32')]({'where':{'id':_0x20dcf0[_0x0976('0x53')]['id']},'attributes':['id']})[_0x0976('0x27')](handleEntityNotFound(_0x3a2fea,null))[_0x0976('0x27')](function(_0xfc9bf5){var _0x38dd5e=[];values=_0xfc9bf5['dataValues'];_0x38dd5e[_0x0976('0x4b')](get_open_tabs(_0x0976('0x5c'),_0xfc9bf5[_0x0976('0x4a')]));_0x38dd5e['push'](get_open_tabs(_0x0976('0x4c'),_0xfc9bf5[_0x0976('0x4a')]));_0x38dd5e[_0x0976('0x4b')](get_open_tabs(_0x0976('0x4e'),_0xfc9bf5[_0x0976('0x4a')]));_0x38dd5e[_0x0976('0x4b')](get_open_tabs('whatsapp',_0xfc9bf5['dataValues']));_0x38dd5e[_0x0976('0x4b')](get_open_tabs('fax',_0xfc9bf5[_0x0976('0x4a')]));_0x38dd5e['push'](get_open_tabs('mail',_0xfc9bf5[_0x0976('0x4a')]));return Promise[_0x0976('0x50')](_0x38dd5e);})[_0x0976('0x27')](function(_0x14ed04){if(_0x14ed04){var _0x111d6c=_[_0x0976('0x87')](values[_0x0976('0xbb')],function(_0x5815d2){return{'channel':'CHAT','id':_0x5815d2['id'],'createdAt':_0x5815d2[_0x0976('0xbc')]};});var _0xaa2c9d=_['map'](values['FaxOpenTabs'],function(_0x526ac5){return{'channel':_0x0976('0xbd'),'id':_0x526ac5['id'],'createdAt':_0x526ac5[_0x0976('0xbc')]};});var _0x327789=_[_0x0976('0x87')](values['OpenchannelOpenTabs'],function(_0x58c28e){return{'channel':_0x0976('0xbe'),'id':_0x58c28e['id'],'createdAt':_0x58c28e['createdAt']};});var _0x270cb8=_[_0x0976('0x87')](values[_0x0976('0xbf')],function(_0x5ac2eb){return{'channel':'MAIL','id':_0x5ac2eb['id'],'createdAt':_0x5ac2eb[_0x0976('0xbc')]};});var _0x42a857=_[_0x0976('0x87')](values[_0x0976('0xc0')],function(_0x34bccc){return{'channel':_0x0976('0xc1'),'id':_0x34bccc['id'],'createdAt':_0x34bccc[_0x0976('0xbc')]};});var _0x297c2d=_[_0x0976('0x87')](values[_0x0976('0xc2')],function(_0x28c57b){return{'channel':_0x0976('0xc3'),'id':_0x28c57b['id'],'createdAt':_0x28c57b['createdAt']};});var _0x3a52ff=_[_0x0976('0xc4')](_0x111d6c,_0xaa2c9d,_0x327789,_0x270cb8,_0x42a857,_0x297c2d);var _0x1740d7={'count':_0x3a52ff[_0x0976('0x49')],'rows':_0x3a52ff};return _0x1740d7;}else return null;})[_0x0976('0x27')](respondWithResult(_0x3a2fea,null))[_0x0976('0x51')](handleError(_0x3a2fea,null));};exports['getContacts']=function(_0x4a383e,_0x499c3e){var _0x1fb5f9={};var _0x473b8e={};var _0x28667d;var _0x1bc94c;return db['User'][_0x0976('0x95')]({'where':{'id':_0x4a383e[_0x0976('0x53')]['id']}})['then'](handleEntityNotFound(_0x499c3e,null))[_0x0976('0x27')](function(_0x3f06db){if(_0x3f06db){_0x28667d=_0x3f06db;_0x473b8e['model']=_[_0x0976('0x56')](db[_0x0976('0xc5')][_0x0976('0x39')]);_0x473b8e['query']=_[_0x0976('0x56')](_0x4a383e['query']);_0x473b8e[_0x0976('0xc6')]=_[_0x0976('0x58')](_0x473b8e[_0x0976('0x54')],_0x473b8e[_0x0976('0x42')]);_0x1fb5f9[_0x0976('0x45')]=_[_0x0976('0x58')](_0x473b8e[_0x0976('0x54')],qs[_0x0976('0x59')](_0x4a383e[_0x0976('0x42')][_0x0976('0x59')]));_0x1fb5f9[_0x0976('0x45')]=_0x1fb5f9['attributes'][_0x0976('0x49')]?_0x1fb5f9[_0x0976('0x45')]:_0x473b8e['model'];_0x1fb5f9[_0x0976('0xc7')]=qs[_0x0976('0xc8')](_0x4a383e['query']['sort']);_0x1fb5f9['where']=qs[_0x0976('0xc6')](_[_0x0976('0xc9')](_0x4a383e[_0x0976('0x42')],_0x473b8e[_0x0976('0xc6')]));if(_0x4a383e['query'][_0x0976('0x3d')]){_0x1fb5f9[_0x0976('0x40')]=_[_0x0976('0x5b')](_0x1fb5f9[_0x0976('0x40')],{'$or':_[_0x0976('0x87')](_0x1fb5f9[_0x0976('0x45')],function(_0x1052c9){var _0x3d3aca={};_0x3d3aca[_0x1052c9]={'$like':'%'+_0x4a383e[_0x0976('0x42')][_0x0976('0x3d')]+'%'};return _0x3d3aca;})});}_0x1fb5f9=_[_0x0976('0x5b')]({},_0x1fb5f9,_0x4a383e['options']);return _0x28667d[_0x0976('0xca')](_0x1fb5f9);}})[_0x0976('0x27')](function(_0x383d4d){if(_0x383d4d){_0x1bc94c=_0x383d4d[_0x0976('0x49')];if(_0x4a383e[_0x0976('0x42')]['hasOwnProperty'](_0x0976('0x5a'))){_0x1fb5f9[_0x0976('0x41')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0x0976('0xcb')],'as':_0x0976('0xcc'),'attributes':['id',_0x0976('0x33'),'color'],'where':_0x4a383e[_0x0976('0x42')][_0x0976('0xcd')]?{'id':_0x4a383e['query']['tag']}:undefined,'required':_0x4a383e[_0x0976('0x42')][_0x0976('0xcd')]?!![]:![]}];}if(!_0x4a383e[_0x0976('0x42')][_0x0976('0xce')](_0x0976('0xcf'))){_0x1fb5f9['limit']=qs[_0x0976('0x23')](_0x4a383e[_0x0976('0x42')][_0x0976('0x23')]);_0x1fb5f9[_0x0976('0x21')]=qs[_0x0976('0x21')](_0x4a383e[_0x0976('0x42')][_0x0976('0x21')]);}return _0x28667d['getContacts'](_0x1fb5f9);}})[_0x0976('0x27')](function(_0x30997d){if(_0x30997d){return _0x30997d?{'count':_0x1bc94c,'rows':_0x30997d}:null;}})['then'](respondWithResult(_0x499c3e,null))['catch'](handleError(_0x499c3e,null));};exports[_0x0976('0xd0')]=function(_0x2f0787,_0x229e63){var _0x5dec55;var _0x4fa3a2={};var _0xc5275;return db[_0x0976('0x38')][_0x0976('0x95')]({'where':{'id':_0x2f0787[_0x0976('0x53')]['id']},'attributes':['id','name',_0x0976('0x2a')]})['then'](handleEntityNotFound(_0x229e63,null))['then'](function(_0x49262a){if(!utils[_0x0976('0x9f')](_0x2f0787[_0x0976('0x42')][_0x0976('0xaa')])){throw new db[(_0x0976('0x8d'))][(_0x0976('0x8e'))](_0x0976('0xd1'));}_0x5dec55=_0x49262a;var _0x1bd253={};_0x1bd253[_0x0976('0x54')]=_[_0x0976('0x56')](db[_[_0x0976('0xa0')](_0x2f0787[_0x0976('0x42')][_0x0976('0xaa')])+_0x0976('0xd2')][_0x0976('0x39')]);_0x1bd253[_0x0976('0x42')]=_[_0x0976('0x56')](_0x2f0787[_0x0976('0x42')]);_0x1bd253['filters']=_['intersection'](_0x1bd253[_0x0976('0x54')],_0x1bd253[_0x0976('0x42')]);_0x4fa3a2[_0x0976('0x45')]=_[_0x0976('0x58')](_0x1bd253['model'],qs[_0x0976('0x59')](_0x2f0787[_0x0976('0x42')][_0x0976('0x59')]));_0x4fa3a2[_0x0976('0x45')]=_0x4fa3a2[_0x0976('0x45')][_0x0976('0x49')]?_0x4fa3a2[_0x0976('0x45')]:_0x1bd253[_0x0976('0x54')];_0x4fa3a2[_0x0976('0xc7')]=qs['sort'](_0x2f0787[_0x0976('0x42')][_0x0976('0xc8')]);_0x4fa3a2[_0x0976('0x40')]=qs['filters'](_[_0x0976('0xc9')](_0x2f0787[_0x0976('0x42')],_0x1bd253[_0x0976('0xc6')]));if(_0x2f0787[_0x0976('0x42')]['filter']){_0x4fa3a2[_0x0976('0x40')]=_['merge'](_0x4fa3a2[_0x0976('0x40')],{'$or':_[_0x0976('0x87')](_0x4fa3a2['attributes'],function(_0x352e53){var _0x376a83={};_0x376a83[_0x352e53]={'$like':'%'+_0x2f0787[_0x0976('0x42')][_0x0976('0x3d')]+'%'};return _0x376a83;})});}_0x4fa3a2=_[_0x0976('0x5b')]({},_0x4fa3a2,_0x2f0787[_0x0976('0xd3')]);switch(_0x5dec55[_0x0976('0x2a')]){case _0x0976('0x2b'):return db[_['capitalize'](_0x2f0787[_0x0976('0x42')]['channel'])+'Queue'][_0x0976('0x8a')](_0x4fa3a2);case _0x0976('0x7a'):case _0x0976('0x2d'):return _0x5dec55['get'+_[_0x0976('0xa0')](_0x2f0787[_0x0976('0x42')][_0x0976('0xaa')])+_0x0976('0xac')](_0x4fa3a2);default:throw new db['Sequelize']['ValidationError'](_0x0976('0xd4'));}})[_0x0976('0x27')](function(_0x150a49){_0xc5275=_0x150a49['length'];if(!_0x2f0787['query'][_0x0976('0xce')](_0x0976('0xcf'))){_0x4fa3a2[_0x0976('0x23')]=qs['limit'](_0x2f0787[_0x0976('0x42')][_0x0976('0x23')]);_0x4fa3a2[_0x0976('0x21')]=qs[_0x0976('0x21')](_0x2f0787['query'][_0x0976('0x21')]);}switch(_0x5dec55[_0x0976('0x2a')]){case _0x0976('0x2b'):return db[_[_0x0976('0xa0')](_0x2f0787[_0x0976('0x42')][_0x0976('0xaa')])+_0x0976('0xd2')][_0x0976('0x8a')](_0x4fa3a2);case'user':case _0x0976('0x2d'):return _0x5dec55[_0x0976('0x29')+_[_0x0976('0xa0')](_0x2f0787[_0x0976('0x42')][_0x0976('0xaa')])+'Queues'](_0x4fa3a2);}})['then'](function(_0x23c8cd){return{'count':_0xc5275,'rows':_0x23c8cd};})[_0x0976('0x27')](respondWithResult(_0x229e63,null))[_0x0976('0x51')](handleError(_0x229e63,null));};exports['getVoiceQueuesRt']=function(_0x44dacf,_0x26e847){var _0x25afae={};var _0x2197ea={};var _0x2d434c;var _0x3755cc;return db[_0x0976('0x38')][_0x0976('0x95')]({'where':{'id':_0x44dacf[_0x0976('0x53')]['id']}})[_0x0976('0x27')](handleEntityNotFound(_0x26e847,null))[_0x0976('0x27')](function(_0x2087ee){if(_0x2087ee){_0x2d434c=_0x2087ee;_0x2197ea[_0x0976('0x54')]=_[_0x0976('0x56')](db[_0x0976('0xa8')][_0x0976('0x39')]);_0x2197ea[_0x0976('0x42')]=_[_0x0976('0x56')](_0x44dacf['query']);_0x2197ea[_0x0976('0xc6')]=_[_0x0976('0x58')](_0x2197ea[_0x0976('0x54')],_0x2197ea[_0x0976('0x42')]);_0x25afae[_0x0976('0x45')]=_[_0x0976('0x58')](_0x2197ea[_0x0976('0x54')],qs[_0x0976('0x59')](_0x44dacf[_0x0976('0x42')][_0x0976('0x59')]));_0x25afae[_0x0976('0x45')]=_0x25afae[_0x0976('0x45')][_0x0976('0x49')]?_0x25afae['attributes']:_0x2197ea['model'];_0x25afae[_0x0976('0xc7')]=qs[_0x0976('0xc8')](_0x44dacf[_0x0976('0x42')]['sort']);_0x25afae['where']=qs[_0x0976('0xc6')](_['pick'](_0x44dacf[_0x0976('0x42')],_0x2197ea[_0x0976('0xc6')]));if(_0x44dacf[_0x0976('0x42')]['filter']){_0x25afae[_0x0976('0x40')]=_[_0x0976('0x5b')](_0x25afae[_0x0976('0x40')],{'$or':_['map'](_0x25afae['attributes'],function(_0x5a9cd1){var _0x348a45={};_0x348a45[_0x5a9cd1]={'$like':'%'+_0x44dacf['query']['filter']+'%'};return _0x348a45;})});}_0x25afae=_[_0x0976('0x5b')]({},_0x25afae,_0x44dacf[_0x0976('0xd3')]);return _0x2d434c[_0x0976('0xd5')](_0x25afae);}})['then'](function(_0x17a217){if(_0x17a217){_0x3755cc=_0x17a217[_0x0976('0x49')];if(!_0x44dacf[_0x0976('0x42')]['hasOwnProperty']('nolimit')){_0x25afae[_0x0976('0x23')]=qs[_0x0976('0x23')](_0x44dacf[_0x0976('0x42')]['limit']);_0x25afae[_0x0976('0x21')]=qs[_0x0976('0x21')](_0x44dacf[_0x0976('0x42')][_0x0976('0x21')]);}return _0x2d434c['getVoiceQueuesRt'](_0x25afae);}})[_0x0976('0x27')](function(_0x331177){if(_0x331177){return _0x331177?{'count':_0x3755cc,'rows':_0x331177}:null;}})[_0x0976('0x27')](respondWithResult(_0x26e847,null))['catch'](handleError(_0x26e847,null));};exports['getGroups']=function(_0x5af382,_0xfcc676){var _0x3c8c1e={};var _0x1792e0={};var _0x1e3c6b;var _0x1fc73c;return db[_0x0976('0x38')][_0x0976('0x95')]({'where':{'id':_0x5af382['params']['id']}})['then'](handleEntityNotFound(_0xfcc676,null))[_0x0976('0x27')](function(_0x2983e7){if(_0x2983e7){_0x1e3c6b=_0x2983e7;_0x1792e0[_0x0976('0x54')]=_[_0x0976('0x56')](db[_0x0976('0xd6')]['rawAttributes']);_0x1792e0[_0x0976('0x42')]=_['keys'](_0x5af382[_0x0976('0x42')]);_0x1792e0[_0x0976('0xc6')]=_[_0x0976('0x58')](_0x1792e0[_0x0976('0x54')],_0x1792e0[_0x0976('0x42')]);_0x3c8c1e[_0x0976('0x45')]=_[_0x0976('0x58')](_0x1792e0[_0x0976('0x54')],qs['fields'](_0x5af382['query'][_0x0976('0x59')]));_0x3c8c1e['attributes']=_0x3c8c1e[_0x0976('0x45')][_0x0976('0x49')]?_0x3c8c1e[_0x0976('0x45')]:_0x1792e0[_0x0976('0x54')];_0x3c8c1e[_0x0976('0xc7')]=qs['sort'](_0x5af382[_0x0976('0x42')][_0x0976('0xc8')]);_0x3c8c1e[_0x0976('0x40')]=qs[_0x0976('0xc6')](_['pick'](_0x5af382[_0x0976('0x42')],_0x1792e0['filters']));if(_0x5af382['query']['filter']){_0x3c8c1e[_0x0976('0x40')]=_[_0x0976('0x5b')](_0x3c8c1e['where'],{'$or':_[_0x0976('0x87')](_0x3c8c1e[_0x0976('0x45')],function(_0xb614d1){var _0x27037a={};_0x27037a[_0xb614d1]={'$like':'%'+_0x5af382[_0x0976('0x42')]['filter']+'%'};return _0x27037a;})});}_0x3c8c1e=_[_0x0976('0x5b')]({},_0x3c8c1e,_0x5af382[_0x0976('0xd3')]);return _0x1e3c6b['getGroups'](_0x3c8c1e);}})[_0x0976('0x27')](function(_0x1bbb6b){if(_0x1bbb6b){_0x1fc73c=_0x1bbb6b[_0x0976('0x49')];if(!_0x5af382[_0x0976('0x42')][_0x0976('0xce')](_0x0976('0xcf'))){_0x3c8c1e[_0x0976('0x23')]=qs[_0x0976('0x23')](_0x5af382['query'][_0x0976('0x23')]);_0x3c8c1e[_0x0976('0x21')]=qs[_0x0976('0x21')](_0x5af382['query']['offset']);}return _0x1e3c6b['getGroups'](_0x3c8c1e);}})[_0x0976('0x27')](function(_0x182d52){if(_0x182d52){return _0x182d52?{'count':_0x1fc73c,'rows':_0x182d52}:null;}})[_0x0976('0x27')](respondWithResult(_0xfcc676,null))[_0x0976('0x51')](handleError(_0xfcc676,null));};exports[_0x0976('0xd7')]=function(_0x574d37,_0x6cdd31){var _0x2f68b5={'raw':!![],'where':{}};var _0x2f6be9={};var _0x34d301={'count':0x0,'rows':[]};return db[_0x0976('0x38')][_0x0976('0x95')]({'where':{'id':_0x574d37[_0x0976('0x53')]['id']}})[_0x0976('0x27')](handleEntityNotFound(_0x6cdd31,null))['then'](function(_0x237ecb){if(_0x237ecb){_0x2f6be9[_0x0976('0x54')]=_[_0x0976('0x56')](db['VoiceRecording']['rawAttributes']);_0x2f6be9['query']=_[_0x0976('0x56')](_0x574d37[_0x0976('0x42')]);_0x2f6be9['filters']=_[_0x0976('0x58')](_0x2f6be9['model'],_0x2f6be9[_0x0976('0x42')]);_0x2f68b5[_0x0976('0x45')]=_[_0x0976('0x58')](_0x2f6be9[_0x0976('0x54')],qs[_0x0976('0x59')](_0x574d37[_0x0976('0x42')][_0x0976('0x59')]));_0x2f68b5[_0x0976('0x45')]=_0x2f68b5[_0x0976('0x45')][_0x0976('0x49')]?_0x2f68b5['attributes']:_0x2f6be9[_0x0976('0x54')];if(!_0x574d37[_0x0976('0x42')][_0x0976('0xce')](_0x0976('0xcf'))){_0x2f68b5['limit']=qs[_0x0976('0x23')](_0x574d37['query']['limit']);_0x2f68b5['offset']=qs[_0x0976('0x21')](_0x574d37[_0x0976('0x42')][_0x0976('0x21')]);}_0x2f68b5[_0x0976('0xc7')]=qs[_0x0976('0xc8')](_0x574d37['query'][_0x0976('0xc8')]);_0x2f68b5[_0x0976('0x40')]=qs[_0x0976('0xc6')](_['pick'](_0x574d37['query'],_0x2f6be9['filters']));_0x2f68b5[_0x0976('0x40')][_0x0976('0xd8')]=_0x237ecb['id'];if(_0x574d37['query'][_0x0976('0x3d')]){_0x2f68b5[_0x0976('0x40')]=_[_0x0976('0x5b')](_0x2f68b5['where'],{'$or':_[_0x0976('0x87')](_0x2f68b5['attributes'],function(_0x509011){var _0x21baed={};_0x21baed[_0x509011]={'$like':'%'+_0x574d37['query'][_0x0976('0x3d')]+'%'};return _0x21baed;})});}_0x2f68b5=_[_0x0976('0x5b')]({},_0x2f68b5,_0x574d37['options']);return db[_0x0976('0xd9')]['count']({'where':_0x2f68b5['where']})[_0x0976('0x27')](function(_0x403f94){_0x34d301[_0x0976('0x24')]=_0x403f94;if(_0x574d37['query']['includeAll']){_0x2f68b5[_0x0976('0x41')]=[{'all':!![]}];}return db[_0x0976('0xd9')][_0x0976('0x8a')](_0x2f68b5);})[_0x0976('0x27')](function(_0x4724d7){_0x34d301[_0x0976('0x46')]=_0x4724d7;return _0x34d301;});}})[_0x0976('0x27')](respondWithFilteredResult(_0x6cdd31,_0x2f68b5))[_0x0976('0x51')](handleError(_0x6cdd31,null));};exports[_0x0976('0xda')]=function(_0x265618,_0x338426){var _0x1e9a9c={'raw':!![],'where':{}};var _0x5bb81b={};var _0xf8cc59={'count':0x0,'rows':[]};return db[_0x0976('0x38')][_0x0976('0x95')]({'where':{'id':_0x265618['params']['id']}})[_0x0976('0x27')](handleEntityNotFound(_0x338426,null))[_0x0976('0x27')](function(_0x5c25bf){if(_0x5c25bf){_0x5bb81b[_0x0976('0x54')]=_[_0x0976('0x56')](db[_0x0976('0xdb')][_0x0976('0x39')]);_0x5bb81b[_0x0976('0x42')]=_[_0x0976('0x56')](_0x265618[_0x0976('0x42')]);_0x5bb81b[_0x0976('0xc6')]=_['intersection'](_0x5bb81b[_0x0976('0x54')],_0x5bb81b[_0x0976('0x42')]);_0x1e9a9c[_0x0976('0x45')]=_[_0x0976('0x58')](_0x5bb81b[_0x0976('0x54')],qs['fields'](_0x265618[_0x0976('0x42')]['fields']));_0x1e9a9c[_0x0976('0x45')]=_0x1e9a9c['attributes'][_0x0976('0x49')]?_0x1e9a9c[_0x0976('0x45')]:_0x5bb81b[_0x0976('0x54')];if(!_0x265618[_0x0976('0x42')]['hasOwnProperty'](_0x0976('0xcf'))){_0x1e9a9c[_0x0976('0x23')]=qs[_0x0976('0x23')](_0x265618[_0x0976('0x42')][_0x0976('0x23')]);_0x1e9a9c[_0x0976('0x21')]=qs[_0x0976('0x21')](_0x265618[_0x0976('0x42')]['offset']);}_0x1e9a9c['order']=qs['sort'](_0x265618[_0x0976('0x42')]['sort']);_0x1e9a9c[_0x0976('0x40')]=qs['filters'](_[_0x0976('0xc9')](_0x265618[_0x0976('0x42')],_0x5bb81b[_0x0976('0xc6')]));_0x1e9a9c['where'][_0x0976('0xd8')]=_0x5c25bf['id'];if(_0x265618[_0x0976('0x42')][_0x0976('0x3d')]){_0x1e9a9c[_0x0976('0x40')]=_[_0x0976('0x5b')](_0x1e9a9c[_0x0976('0x40')],{'$or':_[_0x0976('0x87')](_0x1e9a9c['attributes'],function(_0x58900c){var _0x238bde={};_0x238bde[_0x58900c]={'$like':'%'+_0x265618[_0x0976('0x42')][_0x0976('0x3d')]+'%'};return _0x238bde;})});}_0x1e9a9c=_['merge']({},_0x1e9a9c,_0x265618[_0x0976('0xd3')]);return db[_0x0976('0xdb')]['count']({'where':_0x1e9a9c['where']})['then'](function(_0x2fc2b0){_0xf8cc59['count']=_0x2fc2b0;if(_0x265618[_0x0976('0x42')][_0x0976('0x5a')]){_0x1e9a9c[_0x0976('0x41')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x1e9a9c);})[_0x0976('0x27')](function(_0x2c1821){_0xf8cc59[_0x0976('0x46')]=_0x2c1821;return _0xf8cc59;});}})[_0x0976('0x27')](respondWithFilteredResult(_0x338426,_0x1e9a9c))[_0x0976('0x51')](handleError(_0x338426,null));};exports['getChatInteractions']=function(_0x2feaad,_0x4e5744){var _0x45ad97={};var _0x438d16={};var _0xb8a825;var _0x63caee;return db[_0x0976('0x38')][_0x0976('0x95')]({'where':{'id':_0x2feaad[_0x0976('0x53')]['id']}})[_0x0976('0x27')](handleEntityNotFound(_0x4e5744,null))['then'](function(_0x23beec){if(_0x23beec){_0xb8a825=_0x23beec;_0x438d16[_0x0976('0x54')]=_[_0x0976('0x56')](db[_0x0976('0xdc')]['rawAttributes']);_0x438d16[_0x0976('0x42')]=_[_0x0976('0x56')](_0x2feaad['query']);_0x438d16['filters']=_[_0x0976('0x58')](_0x438d16[_0x0976('0x54')],_0x438d16[_0x0976('0x42')]);_0x45ad97[_0x0976('0x45')]=_[_0x0976('0x58')](_0x438d16[_0x0976('0x54')],qs['fields'](_0x2feaad[_0x0976('0x42')][_0x0976('0x59')]));_0x45ad97[_0x0976('0x45')]=_0x45ad97[_0x0976('0x45')][_0x0976('0x49')]?_0x45ad97[_0x0976('0x45')]:_0x438d16[_0x0976('0x54')];_0x45ad97[_0x0976('0xc7')]=qs['sort'](_0x2feaad[_0x0976('0x42')][_0x0976('0xc8')]);_0x45ad97[_0x0976('0x40')]=qs[_0x0976('0xc6')](_[_0x0976('0xc9')](_0x2feaad[_0x0976('0x42')],_0x438d16[_0x0976('0xc6')]));if(_0x2feaad[_0x0976('0x42')][_0x0976('0x3d')]){_0x45ad97['where']=_[_0x0976('0x5b')](_0x45ad97[_0x0976('0x40')],{'$or':_[_0x0976('0x87')](_0x45ad97[_0x0976('0x45')],function(_0x3e3fd6){var _0x5b2612={};_0x5b2612[_0x3e3fd6]={'$like':'%'+_0x2feaad['query']['filter']+'%'};return _0x5b2612;})});}_0x45ad97=_['merge']({},_0x45ad97,_0x2feaad[_0x0976('0xd3')]);return _0xb8a825[_0x0976('0xdd')](_0x45ad97);}})['then'](function(_0x2dea67){if(_0x2dea67){_0x63caee=_0x2dea67[_0x0976('0x49')];if(!_0x2feaad['query'][_0x0976('0xce')](_0x0976('0xcf'))){_0x45ad97['limit']=qs[_0x0976('0x23')](_0x2feaad[_0x0976('0x42')][_0x0976('0x23')]);_0x45ad97[_0x0976('0x21')]=qs['offset'](_0x2feaad[_0x0976('0x42')]['offset']);}return _0xb8a825[_0x0976('0xdd')](_0x45ad97);}})['then'](function(_0x58c4db){if(_0x58c4db){return _0x58c4db?{'count':_0x63caee,'rows':_0x58c4db}:null;}})[_0x0976('0x27')](respondWithResult(_0x4e5744,null))[_0x0976('0x51')](handleError(_0x4e5744,null));};exports['getOpenchannelInteractions']=function(_0x36d868,_0x4e5bc4){var _0x4c0109={};var _0x424a5b={};var _0x3a3329;var _0x19ec91;return db['User']['findOne']({'where':{'id':_0x36d868[_0x0976('0x53')]['id']}})[_0x0976('0x27')](handleEntityNotFound(_0x4e5bc4,null))['then'](function(_0x3493d7){if(_0x3493d7){_0x3a3329=_0x3493d7;_0x424a5b[_0x0976('0x54')]=_[_0x0976('0x56')](db[_0x0976('0xde')][_0x0976('0x39')]);_0x424a5b[_0x0976('0x42')]=_[_0x0976('0x56')](_0x36d868[_0x0976('0x42')]);_0x424a5b[_0x0976('0xc6')]=_[_0x0976('0x58')](_0x424a5b['model'],_0x424a5b[_0x0976('0x42')]);_0x4c0109[_0x0976('0x45')]=_[_0x0976('0x58')](_0x424a5b['model'],qs[_0x0976('0x59')](_0x36d868['query']['fields']));_0x4c0109[_0x0976('0x45')]=_0x4c0109[_0x0976('0x45')][_0x0976('0x49')]?_0x4c0109[_0x0976('0x45')]:_0x424a5b[_0x0976('0x54')];_0x4c0109[_0x0976('0xc7')]=qs[_0x0976('0xc8')](_0x36d868[_0x0976('0x42')][_0x0976('0xc8')]);_0x4c0109[_0x0976('0x40')]=qs['filters'](_[_0x0976('0xc9')](_0x36d868[_0x0976('0x42')],_0x424a5b[_0x0976('0xc6')]));if(_0x36d868[_0x0976('0x42')]['filter']){_0x4c0109['where']=_['merge'](_0x4c0109[_0x0976('0x40')],{'$or':_[_0x0976('0x87')](_0x4c0109['attributes'],function(_0x52fcad){var _0x4a5839={};_0x4a5839[_0x52fcad]={'$like':'%'+_0x36d868[_0x0976('0x42')][_0x0976('0x3d')]+'%'};return _0x4a5839;})});}_0x4c0109=_[_0x0976('0x5b')]({},_0x4c0109,_0x36d868[_0x0976('0xd3')]);return _0x3a3329[_0x0976('0xdf')](_0x4c0109);}})[_0x0976('0x27')](function(_0x4f39f8){if(_0x4f39f8){_0x19ec91=_0x4f39f8[_0x0976('0x49')];if(!_0x36d868[_0x0976('0x42')][_0x0976('0xce')](_0x0976('0xcf'))){_0x4c0109[_0x0976('0x23')]=qs[_0x0976('0x23')](_0x36d868['query'][_0x0976('0x23')]);_0x4c0109[_0x0976('0x21')]=qs[_0x0976('0x21')](_0x36d868[_0x0976('0x42')][_0x0976('0x21')]);}return _0x3a3329[_0x0976('0xdf')](_0x4c0109);}})[_0x0976('0x27')](function(_0x3f78bf){if(_0x3f78bf){return _0x3f78bf?{'count':_0x19ec91,'rows':_0x3f78bf}:null;}})[_0x0976('0x27')](respondWithResult(_0x4e5bc4,null))[_0x0976('0x51')](handleError(_0x4e5bc4,null));};exports['getMailInteractions']=function(_0x3f617e,_0x512bea){var _0x12c1f7={'raw':!![],'where':{}};var _0x1ce1fc={};var _0x39a72b={'count':0x0,'rows':[]};return db[_0x0976('0x38')][_0x0976('0x95')]({'where':{'id':_0x3f617e[_0x0976('0x53')]['id']}})['then'](handleEntityNotFound(_0x512bea,null))[_0x0976('0x27')](function(_0x5b0c14){if(_0x5b0c14){_0x1ce1fc[_0x0976('0x54')]=_[_0x0976('0x56')](db[_0x0976('0xe0')][_0x0976('0x39')]);_0x1ce1fc['query']=_['keys'](_0x3f617e[_0x0976('0x42')]);_0x1ce1fc[_0x0976('0xc6')]=_[_0x0976('0x58')](_0x1ce1fc[_0x0976('0x54')],_0x1ce1fc[_0x0976('0x42')]);_0x12c1f7[_0x0976('0x45')]=_['intersection'](_0x1ce1fc[_0x0976('0x54')],qs[_0x0976('0x59')](_0x3f617e[_0x0976('0x42')][_0x0976('0x59')]));_0x12c1f7['attributes']=_0x12c1f7[_0x0976('0x45')][_0x0976('0x49')]?_0x12c1f7[_0x0976('0x45')]:_0x1ce1fc[_0x0976('0x54')];if(!_0x3f617e[_0x0976('0x42')]['hasOwnProperty'](_0x0976('0xcf'))){_0x12c1f7['limit']=qs[_0x0976('0x23')](_0x3f617e[_0x0976('0x42')][_0x0976('0x23')]);_0x12c1f7[_0x0976('0x21')]=qs[_0x0976('0x21')](_0x3f617e[_0x0976('0x42')]['offset']);}_0x12c1f7[_0x0976('0xc7')]=qs[_0x0976('0xc8')](_0x3f617e[_0x0976('0x42')][_0x0976('0xc8')]);_0x12c1f7[_0x0976('0x40')]=qs['filters'](_[_0x0976('0xc9')](_0x3f617e[_0x0976('0x42')],_0x1ce1fc[_0x0976('0xc6')]));_0x12c1f7[_0x0976('0x40')][_0x0976('0xd8')]=_0x5b0c14['id'];if(_0x3f617e['query'][_0x0976('0x3d')]){_0x12c1f7['where']=_[_0x0976('0x5b')](_0x12c1f7[_0x0976('0x40')],{'$or':_[_0x0976('0x87')](_0x12c1f7['attributes'],function(_0x425f3e){var _0x3f1524={};_0x3f1524[_0x425f3e]={'$like':'%'+_0x3f617e[_0x0976('0x42')][_0x0976('0x3d')]+'%'};return _0x3f1524;})});}_0x12c1f7=_[_0x0976('0x5b')]({},_0x12c1f7,_0x3f617e[_0x0976('0xd3')]);return db[_0x0976('0xe0')][_0x0976('0x24')]({'where':_0x12c1f7[_0x0976('0x40')]})['then'](function(_0x496d95){_0x39a72b[_0x0976('0x24')]=_0x496d95;if(_0x3f617e['query']['includeAll']){_0x12c1f7[_0x0976('0x41')]=[{'all':!![]}];}return db[_0x0976('0xe0')][_0x0976('0x8a')](_0x12c1f7);})['then'](function(_0x5a8da8){_0x39a72b[_0x0976('0x46')]=_0x5a8da8;return _0x39a72b;});}})['then'](respondWithFilteredResult(_0x512bea,_0x12c1f7))['catch'](handleError(_0x512bea,null));};exports[_0x0976('0xe1')]=function(_0x5c4e09,_0x28f9ec){var _0x183cb7={};var _0x3796a7={};var _0x263922;var _0x298ece;return db['User'][_0x0976('0x95')]({'where':{'id':_0x5c4e09['params']['id']}})[_0x0976('0x27')](handleEntityNotFound(_0x28f9ec,null))[_0x0976('0x27')](function(_0x1dbbaf){if(_0x1dbbaf){_0x263922=_0x1dbbaf;_0x3796a7[_0x0976('0x54')]=_[_0x0976('0x56')](db[_0x0976('0xe2')][_0x0976('0x39')]);_0x3796a7[_0x0976('0x42')]=_[_0x0976('0x56')](_0x5c4e09[_0x0976('0x42')]);_0x3796a7[_0x0976('0xc6')]=_[_0x0976('0x58')](_0x3796a7[_0x0976('0x54')],_0x3796a7[_0x0976('0x42')]);_0x183cb7[_0x0976('0x45')]=_[_0x0976('0x58')](_0x3796a7[_0x0976('0x54')],qs[_0x0976('0x59')](_0x5c4e09[_0x0976('0x42')]['fields']));_0x183cb7[_0x0976('0x45')]=_0x183cb7['attributes']['length']?_0x183cb7[_0x0976('0x45')]:_0x3796a7[_0x0976('0x54')];_0x183cb7[_0x0976('0xc7')]=qs[_0x0976('0xc8')](_0x5c4e09[_0x0976('0x42')]['sort']);_0x183cb7['where']=qs['filters'](_[_0x0976('0xc9')](_0x5c4e09[_0x0976('0x42')],_0x3796a7[_0x0976('0xc6')]));if(_0x5c4e09[_0x0976('0x42')][_0x0976('0x3d')]){_0x183cb7['where']=_['merge'](_0x183cb7[_0x0976('0x40')],{'$or':_[_0x0976('0x87')](_0x183cb7[_0x0976('0x45')],function(_0xd0466f){var _0x166239={};_0x166239[_0xd0466f]={'$like':'%'+_0x5c4e09['query'][_0x0976('0x3d')]+'%'};return _0x166239;})});}_0x183cb7=_['merge']({},_0x183cb7,_0x5c4e09[_0x0976('0xd3')]);return _0x263922['getSmsInteractions'](_0x183cb7);}})[_0x0976('0x27')](function(_0x594d86){if(_0x594d86){_0x298ece=_0x594d86['length'];if(!_0x5c4e09[_0x0976('0x42')][_0x0976('0xce')]('nolimit')){_0x183cb7['limit']=qs[_0x0976('0x23')](_0x5c4e09[_0x0976('0x42')][_0x0976('0x23')]);_0x183cb7[_0x0976('0x21')]=qs['offset'](_0x5c4e09[_0x0976('0x42')][_0x0976('0x21')]);}return _0x263922[_0x0976('0xe1')](_0x183cb7);}})[_0x0976('0x27')](function(_0x2063ab){if(_0x2063ab){return _0x2063ab?{'count':_0x298ece,'rows':_0x2063ab}:null;}})[_0x0976('0x27')](respondWithResult(_0x28f9ec,null))[_0x0976('0x51')](handleError(_0x28f9ec,null));};exports[_0x0976('0xe3')]=function(_0x34796b,_0x3b346e){var _0x84fcdf={};var _0x404ef7={};var _0x149e3b;var _0x5310c6;return db['User'][_0x0976('0x95')]({'where':{'id':_0x34796b[_0x0976('0x53')]['id']}})['then'](handleEntityNotFound(_0x3b346e,null))[_0x0976('0x27')](function(_0x317b27){if(_0x317b27){_0x149e3b=_0x317b27;_0x404ef7[_0x0976('0x54')]=_[_0x0976('0x56')](db[_0x0976('0xe4')][_0x0976('0x39')]);_0x404ef7[_0x0976('0x42')]=_[_0x0976('0x56')](_0x34796b[_0x0976('0x42')]);_0x404ef7[_0x0976('0xc6')]=_['intersection'](_0x404ef7['model'],_0x404ef7[_0x0976('0x42')]);_0x84fcdf[_0x0976('0x45')]=_[_0x0976('0x58')](_0x404ef7['model'],qs[_0x0976('0x59')](_0x34796b[_0x0976('0x42')][_0x0976('0x59')]));_0x84fcdf[_0x0976('0x45')]=_0x84fcdf[_0x0976('0x45')]['length']?_0x84fcdf[_0x0976('0x45')]:_0x404ef7[_0x0976('0x54')];_0x84fcdf['order']=qs['sort'](_0x34796b[_0x0976('0x42')][_0x0976('0xc8')]);_0x84fcdf[_0x0976('0x40')]=qs[_0x0976('0xc6')](_[_0x0976('0xc9')](_0x34796b[_0x0976('0x42')],_0x404ef7[_0x0976('0xc6')]));if(_0x34796b[_0x0976('0x42')][_0x0976('0x3d')]){_0x84fcdf[_0x0976('0x40')]=_[_0x0976('0x5b')](_0x84fcdf[_0x0976('0x40')],{'$or':_['map'](_0x84fcdf[_0x0976('0x45')],function(_0x464e6b){var _0x7b9353={};_0x7b9353[_0x464e6b]={'$like':'%'+_0x34796b[_0x0976('0x42')][_0x0976('0x3d')]+'%'};return _0x7b9353;})});}_0x84fcdf=_['merge']({},_0x84fcdf,_0x34796b[_0x0976('0xd3')]);return _0x149e3b[_0x0976('0xe3')](_0x84fcdf);}})[_0x0976('0x27')](function(_0x53ffe8){if(_0x53ffe8){_0x5310c6=_0x53ffe8[_0x0976('0x49')];if(!_0x34796b['query'][_0x0976('0xce')](_0x0976('0xcf'))){_0x84fcdf[_0x0976('0x23')]=qs[_0x0976('0x23')](_0x34796b[_0x0976('0x42')][_0x0976('0x23')]);_0x84fcdf[_0x0976('0x21')]=qs[_0x0976('0x21')](_0x34796b['query'][_0x0976('0x21')]);}return _0x149e3b['getFaxInteractions'](_0x84fcdf);}})[_0x0976('0x27')](function(_0x1cd2fe){if(_0x1cd2fe){return _0x1cd2fe?{'count':_0x5310c6,'rows':_0x1cd2fe}:null;}})[_0x0976('0x27')](respondWithResult(_0x3b346e,null))[_0x0976('0x51')](handleError(_0x3b346e,null));};exports[_0x0976('0xe5')]=function(_0xce694e,_0x11ce61){var _0x3de720={};var _0x47b04b={};var _0x13fe73;var _0x945b83;return db[_0x0976('0x38')][_0x0976('0x95')]({'where':{'id':_0xce694e[_0x0976('0x53')]['id']}})['then'](handleEntityNotFound(_0x11ce61,null))[_0x0976('0x27')](function(_0x39beb3){if(_0x39beb3){_0x13fe73=_0x39beb3;_0x47b04b['model']=_[_0x0976('0x56')](db['WhatsappInteraction'][_0x0976('0x39')]);_0x47b04b[_0x0976('0x42')]=_[_0x0976('0x56')](_0xce694e['query']);_0x47b04b[_0x0976('0xc6')]=_['intersection'](_0x47b04b[_0x0976('0x54')],_0x47b04b[_0x0976('0x42')]);_0x3de720[_0x0976('0x45')]=_[_0x0976('0x58')](_0x47b04b[_0x0976('0x54')],qs['fields'](_0xce694e[_0x0976('0x42')][_0x0976('0x59')]));_0x3de720[_0x0976('0x45')]=_0x3de720[_0x0976('0x45')][_0x0976('0x49')]?_0x3de720[_0x0976('0x45')]:_0x47b04b[_0x0976('0x54')];_0x3de720['order']=qs[_0x0976('0xc8')](_0xce694e['query'][_0x0976('0xc8')]);_0x3de720[_0x0976('0x40')]=qs['filters'](_[_0x0976('0xc9')](_0xce694e['query'],_0x47b04b[_0x0976('0xc6')]));if(_0xce694e['query']['filter']){_0x3de720['where']=_['merge'](_0x3de720[_0x0976('0x40')],{'$or':_['map'](_0x3de720['attributes'],function(_0x157bb3){var _0x21ecea={};_0x21ecea[_0x157bb3]={'$like':'%'+_0xce694e[_0x0976('0x42')][_0x0976('0x3d')]+'%'};return _0x21ecea;})});}_0x3de720=_[_0x0976('0x5b')]({},_0x3de720,_0xce694e[_0x0976('0xd3')]);return _0x13fe73[_0x0976('0xe5')](_0x3de720);}})[_0x0976('0x27')](function(_0x2cbbb9){if(_0x2cbbb9){_0x945b83=_0x2cbbb9['length'];if(!_0xce694e[_0x0976('0x42')][_0x0976('0xce')]('nolimit')){_0x3de720[_0x0976('0x23')]=qs[_0x0976('0x23')](_0xce694e[_0x0976('0x42')][_0x0976('0x23')]);_0x3de720[_0x0976('0x21')]=qs['offset'](_0xce694e[_0x0976('0x42')]['offset']);}return _0x13fe73[_0x0976('0xe5')](_0x3de720);}})[_0x0976('0x27')](function(_0x28a7b3){if(_0x28a7b3){return _0x28a7b3?{'count':_0x945b83,'rows':_0x28a7b3}:null;}})[_0x0976('0x27')](respondWithResult(_0x11ce61,null))[_0x0976('0x51')](handleError(_0x11ce61,null));};exports[_0x0976('0xe6')]=function(_0x394e6a,_0x565613,_0x38ab95){var _0xfe5460;var _0x31b98d;var _0x1e1ab4;var _0x43f34d=!_[_0x0976('0x67')](_0x394e6a[_0x0976('0x53')]['id'])?_0x394e6a[_0x0976('0x53')]['id']:!_['isNil'](_0x394e6a[_0x0976('0x7a')]['id'])?_0x394e6a[_0x0976('0x7a')]['id']:null;return db['User'][_0x0976('0x32')]({'where':{'id':_0x43f34d,'role':{'$or':[_0x0976('0x2b'),_0x0976('0x7a'),_0x0976('0x2d')]}},'attributes':['id',_0x0976('0x33'),_0x0976('0xe7'),'mobile',_0x0976('0x2a'),_0x0976('0x63'),_0x0976('0x9c')]})[_0x0976('0x27')](function(_0x40eae6){if(_0x40eae6){if(_0x40eae6['role']==='agent'){_0xfe5460=_0x40eae6;if(_0x394e6a[_0x0976('0x5e')]['interface']){_0x1e1ab4=util[_0x0976('0xe8')](_0x0976('0xe9'),_0xfe5460[_0x394e6a[_0x0976('0x5e')][_0x0976('0x9e')]]);}else if(_0x394e6a[_0x0976('0x5e')][_0x0976('0xea')]){_0x1e1ab4=util[_0x0976('0xe8')]('SIP/%s',_0x394e6a[_0x0976('0x5e')][_0x0976('0xea')]);}else{_0x1e1ab4=util[_0x0976('0xe8')](_0x0976('0xa6'),_0xfe5460[_0x0976('0x33')]);}socket['to'](util[_0x0976('0xe8')](_0x0976('0xeb'),_0xfe5460['name']))[_0x0976('0xa3')]('user:forcelogout',{'user':{'id':_0xfe5460['id'],'name':_0xfe5460[_0x0976('0x33')]},'ip':_0x394e6a[_0x0976('0xec')][_0x0976('0xed')]||_0x394e6a[_0x0976('0xee')][_0x0976('0xef')]||_0x394e6a['socket'][_0x0976('0xef')]||_0x394e6a[_0x0976('0xee')][_0x0976('0xf0')][_0x0976('0xef')]});return db[_0x0976('0xa8')][_0x0976('0x28')]({'where':{'membername':_0xfe5460[_0x0976('0x33')]},'individualHooks':!![]});}}else{throw new db[(_0x0976('0x8d'))]['ValidationError'](_0x0976('0xf1'));}})[_0x0976('0x27')](function(){if(_0xfe5460){return _0xfe5460[_0x0976('0xf2')]({'raw':!![]});}})['then'](function(_0x264e5f){if(_0xfe5460){if(_0x264e5f){_0x31b98d=_0x264e5f;if(_0x31b98d['length']){var _0x4210f9=_0x31b98d['map'](function(_0x3407f0){var _0x11b869={'membername':_0xfe5460['name'],'UserId':_0xfe5460['id'],'queue_name':_0x3407f0[_0x0976('0x33')],'VoiceQueueId':_0x3407f0['id'],'interface':_0x1e1ab4,'paused':_0xfe5460[_0x0976('0x9c')]||![],'penalty':_0x3407f0[_0x0976('0xf3')]||0x0};return db['UserVoiceQueueRt'][_0x0976('0xf4')](_0x11b869);});return Promise['all'](_0x4210f9);}}}})[_0x0976('0x27')](function(){if(_0xfe5460){return db[_0x0976('0xf5')]['findAll']({'where':{'membername':_0xfe5460[_0x0976('0x33')],'exitAt':null}});}})['then'](function(_0x227421){if(_0xfe5460){var _0x3447a9=[];_0x227421[_0x0976('0xf6')](function(_0x174617){_0x3447a9[_0x0976('0x4b')](_0x174617[_0x0976('0xf7')]({'exitAt':moment()[_0x0976('0xe8')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x0976('0x50')](_0x3447a9);}})['then'](function(){if(_0xfe5460){var _0x18de64=[];var _0x5682be=[];var _0x1f8661=utils[_0x0976('0xf8')]();var _0x32f6ec={'membername':_0xfe5460[_0x0976('0x33')],'interface':_0x1e1ab4,'enterAt':moment()[_0x0976('0xe8')](_0x0976('0xf9')),'role':_0xfe5460['role'],'internal':_0xfe5460['internal']};_0x1f8661['forEach'](function(_0x4237d0){_0x18de64[_0x0976('0x4b')](_[_0x0976('0x5b')]({'channel':_0x4237d0,'type':'LOGIN','data1':_0x394e6a[_0x0976('0x5e')]['device'],'data2':_0x1e1ab4},_0x32f6ec));if(_0xfe5460[_0x0976('0x9c')]){_0x5682be['push'](_[_0x0976('0x5b')]({'channel':_0x4237d0,'type':_0x0976('0xfa'),'data1':'LOGININPAUSE'},_0x32f6ec));}});return db['MemberReport']['bulkCreate'](_0x18de64[_0x0976('0xc4')](_0x5682be),{'individualHooks':!![]});}})[_0x0976('0x27')](function(){if(_0xfe5460){return _0xfe5460['update']({'online':!![],'lastLoginAt':moment()[_0x0976('0xe8')](_0x0976('0xf9')),'voicePause':_0xfe5460['loginInPause']||![],'mailPause':_0xfe5460[_0x0976('0x9c')]||![],'chatPause':_0xfe5460[_0x0976('0x9c')]||![],'faxPause':_0xfe5460[_0x0976('0x9c')]||![],'smsPause':_0xfe5460[_0x0976('0x9c')]||![],'openchannelPause':_0xfe5460['loginInPause']||![],'whatsappPause':_0xfe5460['loginInPause']||![],'pauseType':_0xfe5460[_0x0976('0x9c')]?_0x0976('0xfb'):null,'interface':_0x1e1ab4,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x0976('0x27')](function(_0x261394){if(_0x394e6a['isMiddleware']){return _0x38ab95();}else{return Promise[_0x0976('0xfc')](_0x261394)['then'](respondWithResult(_0x565613,null));}})[_0x0976('0x51')](handleError(_0x565613,null));};exports[_0x0976('0xfd')]=function(_0x23d690,_0x29a2f0){var _0x449efb;return db['User']['find']({'where':{'id':_0x23d690[_0x0976('0x53')]['id'],'role':'agent'},'attributes':['id',_0x0976('0x33'),_0x0976('0x2a')]})[_0x0976('0x27')](handleEntityNotFound(_0x29a2f0,null))[_0x0976('0x27')](function(_0x5f3f10){if(_0x5f3f10){_0x449efb=_0x5f3f10;return db[_0x0976('0xa8')]['destroy']({'where':{'membername':_0x449efb[_0x0976('0x33')]},'individualHooks':!![]});}})[_0x0976('0x27')](function(){return db['MemberReport'][_0x0976('0x8a')]({'where':{'membername':_0x449efb[_0x0976('0x33')],'exitAt':null}});})['then'](function(_0xab84e1){var _0x38dce0=[];_0xab84e1[_0x0976('0xf6')](function(_0xc99964){_0x38dce0[_0x0976('0x4b')](_0xc99964[_0x0976('0xf7')]({'exitAt':moment()[_0x0976('0xe8')](_0x0976('0xf9'))}));});return Promise['all'](_0x38dce0);})['then'](function(){return _0x449efb[_0x0976('0xf7')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x0976('0x27')](respondWithResult(_0x29a2f0,null))['catch'](handleError(_0x29a2f0,null));};exports[_0x0976('0xfe')]=function(_0x121a3e,_0x4f2508){var _0xd1c275;return db[_0x0976('0xa8')][_0x0976('0xf7')]({'paused':0x1},{'where':{'UserId':_0x121a3e['params']['id']},'individualHooks':!![]})[_0x0976('0x27')](function(){return db[_0x0976('0x38')]['find']({'where':{'id':_0x121a3e[_0x0976('0x53')]['id'],'role':_0x0976('0x2d')},'attributes':['id',_0x0976('0x33'),_0x0976('0x2a'),'internal',_0x0976('0x9e'),'online']});})[_0x0976('0x27')](handleEntityNotFound(_0x4f2508,null))[_0x0976('0x27')](function(_0x3bca1d){if(_0x3bca1d){_0xd1c275=_0x3bca1d;return respondWithRpcPromise(_0x0976('0xff'),_0x0976('0xfe'),{'id':_0xd1c275['id'],'name':_0xd1c275[_0x0976('0x33')],'pause':!![]});}})[_0x0976('0x27')](function(){if(_0xd1c275){return db[_0x0976('0xf5')][_0x0976('0x8a')]({'where':{'membername':_0xd1c275['name'],'type':'PAUSE','exitAt':null}});}})[_0x0976('0x27')](function(_0x13c5e){if(_0x13c5e[_0x0976('0x49')]){var _0x47e190=moment()[_0x0976('0xe8')](_0x0976('0xf9'));for(var _0x287491=0x0,_0x3873b0=_0x13c5e['length'];_0x287491<_0x3873b0;_0x287491++){_0x13c5e[_0x287491][_0x0976('0x100')]({'exitAt':_0x47e190});}}})[_0x0976('0x27')](function(){var _0x309dc0=[];var _0x568e3b=utils[_0x0976('0xf8')]();_0x568e3b[_0x0976('0xf6')](function(_0x2f8470){_0x309dc0[_0x0976('0x4b')]({'channel':_0x2f8470,'membername':_0xd1c275[_0x0976('0x33')],'interface':_[_0x0976('0x67')](_0xd1c275['interface'])?util[_0x0976('0xe8')](_0x0976('0xa6'),_0xd1c275[_0x0976('0x33')]):_0xd1c275['interface'],'type':'PAUSE','enterAt':moment()[_0x0976('0xe8')](_0x0976('0xf9')),'data1':_0x121a3e[_0x0976('0x5e')]['type']||_0x0976('0x101'),'role':_0xd1c275[_0x0976('0x2a')],'internal':_0xd1c275[_0x0976('0x63')]});});return db['MemberReport'][_0x0976('0x84')](_0x309dc0,{'individualHooks':!![]});})[_0x0976('0x27')](function(){return _0xd1c275['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x121a3e['body'][_0x0976('0x3b')]||_0x0976('0x101'),'lastPauseAt':moment()[_0x0976('0xe8')](_0x0976('0xf9'))});})[_0x0976('0x27')](respondWithResult(_0x4f2508,null))[_0x0976('0x51')](handleError(_0x4f2508,null));};exports['unpause']=function(_0x343e89,_0x4ee60b){if(_0x343e89[_0x0976('0x5e')][_0x0976('0xaa')]&&!utils['isValidChannel'](_0x343e89[_0x0976('0x5e')][_0x0976('0xaa')])){throw new APIBadRequestError(util[_0x0976('0xe8')](_0x0976('0x102'),_0x343e89[_0x0976('0x5e')]['channel']));}return db[_0x0976('0x38')][_0x0976('0x32')]({'where':{'id':_0x343e89['params']['id']},'attributes':['id','name',_0x0976('0x2a'),_0x0976('0x63'),'interface',_0x0976('0x9b'),'voicePause',_0x0976('0x103'),_0x0976('0x104'),_0x0976('0x105'),_0x0976('0x106'),_0x0976('0x107'),_0x0976('0x108'),_0x0976('0x109'),_0x0976('0x10a')]})[_0x0976('0x27')](function(_0x22b4c1){if(!_0x22b4c1){throw new APINotFoundError(util['format'](_0x0976('0x10b'),_0x343e89['params']['id']));}return _0x22b4c1['unpause'](_0x343e89[_0x0976('0x5e')]['channel']);})[_0x0976('0x27')](respondWithResult(_0x4ee60b,null))[_0x0976('0x51')](APIHandleError(_0x4ee60b));};exports[_0x0976('0x10c')]=function(_0x117601,_0xaca2f9){var _0x19fef1={};var _0x149007={};var _0x464a56;var _0x47eeb7;return db[_0x0976('0x38')]['findOne']({'where':{'id':_0x117601[_0x0976('0x53')]['id']}})[_0x0976('0x27')](handleEntityNotFound(_0xaca2f9,null))[_0x0976('0x27')](function(_0x524d8b){if(_0x524d8b){_0x464a56=_0x524d8b;_0x149007[_0x0976('0x54')]=_['keys'](db[_0x0976('0x10d')]['rawAttributes']);_0x149007[_0x0976('0x42')]=_[_0x0976('0x56')](_0x117601[_0x0976('0x42')]);_0x149007[_0x0976('0xc6')]=_[_0x0976('0x58')](_0x149007['model'],_0x149007['query']);_0x19fef1[_0x0976('0x45')]=_['intersection'](_0x149007[_0x0976('0x54')],qs['fields'](_0x117601[_0x0976('0x42')][_0x0976('0x59')]));_0x19fef1['attributes']=_0x19fef1[_0x0976('0x45')]['length']?_0x19fef1[_0x0976('0x45')]:_0x149007['model'];_0x19fef1[_0x0976('0xc7')]=qs[_0x0976('0xc8')](_0x117601[_0x0976('0x42')][_0x0976('0xc8')]);_0x19fef1[_0x0976('0x40')]=qs[_0x0976('0xc6')](_[_0x0976('0xc9')](_0x117601['query'],_0x149007['filters']));if(_0x117601['query'][_0x0976('0x3d')]){_0x19fef1[_0x0976('0x40')]=_['merge'](_0x19fef1[_0x0976('0x40')],{'$or':_[_0x0976('0x87')](_0x19fef1[_0x0976('0x45')],function(_0x318481){var _0x1b58d1={};_0x1b58d1[_0x318481]={'$like':'%'+_0x117601[_0x0976('0x42')][_0x0976('0x3d')]+'%'};return _0x1b58d1;})});}_0x19fef1=_['merge']({},_0x19fef1,_0x117601['options']);return _0x464a56[_0x0976('0x10c')](_0x19fef1);}})['then'](function(_0x184c58){if(_0x184c58){_0x47eeb7=_0x184c58[_0x0976('0x49')];if(!_0x117601[_0x0976('0x42')][_0x0976('0xce')](_0x0976('0xcf'))){_0x19fef1[_0x0976('0x23')]=qs[_0x0976('0x23')](_0x117601[_0x0976('0x42')][_0x0976('0x23')]);_0x19fef1[_0x0976('0x21')]=qs['offset'](_0x117601[_0x0976('0x42')][_0x0976('0x21')]);}return _0x464a56[_0x0976('0x10c')](_0x19fef1);}})[_0x0976('0x27')](function(_0x17ec21){if(_0x17ec21){return _0x17ec21?{'count':_0x47eeb7,'rows':_0x17ec21}:null;}})['then'](respondWithResult(_0xaca2f9,null))[_0x0976('0x51')](handleError(_0xaca2f9,null));};exports[_0x0976('0x10e')]=function(_0x5b37c4,_0x4585b1){var _0x2d12f1=_0x5b37c4['params']['id'];var _0x31dda2=_0x5b37c4[_0x0976('0x5e')]?_0x5b37c4[_0x0976('0x5e')][_0x0976('0x61')]:null;var _0xa4cfe6=[];return Promise[_0x0976('0xfc')]()[_0x0976('0x27')](function(){if(!_0x31dda2)throw new APIBadRequestError(_0x0976('0x10f'));})[_0x0976('0x27')](function(){return db[_0x0976('0x38')][_0x0976('0x95')]({'where':{'id':_0x2d12f1}});})[_0x0976('0x27')](function(_0x59323c){if(!_0x59323c)throw new APINotFoundError(util[_0x0976('0xe8')](_0x0976('0x10b'),_0x5b37c4[_0x0976('0x53')]['id']));return db[_0x0976('0x69')][_0x0976('0x110')](function(_0x495e27){return _0x59323c[_0x0976('0x10e')](_0x31dda2,{'transaction':_0x495e27})[_0x0976('0x27')](function(){return db[_0x0976('0x10d')]['findAll']({'where':{'id':{'$in':_0x31dda2}}});})[_0x0976('0x27')](function(_0x409ebe){var _0x37a980=_[_0x0976('0x87')](_0x409ebe,function(_0x3432fa){return _0x3432fa[_0x0976('0x111')]();});return Promise[_0x0976('0x50')](_0x37a980);})['then'](function(_0x5236ef){_0xa4cfe6=_['flattenDeep'](_0x5236ef);var _0x43a071=_[_0x0976('0x87')](_0xa4cfe6,function(_0x6e9183){return _0x6e9183[_0x0976('0x112')](_0x59323c['id'],{'transaction':_0x495e27});});return Promise[_0x0976('0x50')](_0x43a071);})[_0x0976('0x27')](function(){if(!_0x59323c['online'])return;var _0x26f9f8=_[_0x0976('0x3d')](_0xa4cfe6,function(_0x26b957){return _0x26b957[_0x0976('0x113')](_0x0976('0xaa'))===_0x0976('0x114');});var _0x165f4a=_[_0x0976('0x87')](_0x26f9f8,function(_0x55ce1a){return db['UserVoiceQueueRt'][_0x0976('0xf4')]({'membername':_0x59323c['name'],'UserId':_0x59323c['id'],'queue_name':_0x55ce1a[_0x0976('0x33')],'VoiceQueueId':_0x55ce1a['id'],'interface':_['isNil'](_0x59323c[_0x0976('0x9e')])?util[_0x0976('0xe8')](_0x0976('0xa6'),_0x59323c[_0x0976('0x33')]):_0x59323c['interface'],'paused':_0x59323c[_0x0976('0x9d')]||![],'penalty':_0x59323c['penalty']},{'transaction':_0x495e27});});return Promise[_0x0976('0x50')](_0x165f4a);})[_0x0976('0x27')](function(){return db['TeamVoicePrefix'][_0x0976('0x8a')]({'where':{'teamId':{'$in':_0x31dda2}}});})[_0x0976('0x27')](function(_0x9b2ef0){var _0x3c792e=_['map'](_0x9b2ef0,function(_0x5d4f6e){return db['UserVoicePrefix']['create']({'UserId':_0x59323c['id'],'VoicePrefixId':_0x5d4f6e['VoicePrefixId']},{'transaction':_0x495e27});});return Promise['all'](_0x3c792e);});});})[_0x0976('0x27')](function(){for(var _0x170f19=0x0;_0x170f19<_0xa4cfe6[_0x0976('0x49')];_0x170f19++){var _0x3a274f=_0xa4cfe6[_0x170f19]['getDataValue']('channel');var _0x350028=_0x3a274f+'QueueId';socket[_0x0976('0xa3')]('user'+_0x3a274f+_0x0976('0x115'),{'UserId':_0x2d12f1,['queueField']:_0xa4cfe6[_0x170f19]['id']});}})[_0x0976('0x27')](respondWithStatusCode(_0x4585b1,null))['catch'](APIHandleError(_0x4585b1));};exports['removeTeams']=function(_0x5165d9,_0x34f3e4){var _0x1022ed=_0x5165d9[_0x0976('0x53')]['id'];var _0x33a974=null;if(_0x5165d9[_0x0976('0x42')][_0x0976('0x61')]){_0x33a974=_['isArray'](_0x5165d9[_0x0976('0x42')][_0x0976('0x61')])?_0x5165d9[_0x0976('0x42')][_0x0976('0x61')]:[_0x5165d9['query']['ids']];}var _0xa9c747=[];return Promise[_0x0976('0xfc')]()[_0x0976('0x27')](function(){if(!_0x33a974)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x0976('0x27')](function(){return db[_0x0976('0x38')][_0x0976('0x95')]({'where':{'id':_0x1022ed}});})['then'](function(_0x3463a1){if(!_0x3463a1)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x5165d9['params']['id']));return db[_0x0976('0x69')]['transaction'](function(_0x4f1859){return _0x3463a1['removeTeams'](_0x33a974,{'transaction':_0x4f1859})[_0x0976('0x27')](function(){return db[_0x0976('0x10d')][_0x0976('0x8a')]({'where':{'id':{'$in':_0x33a974}}});})[_0x0976('0x27')](function(_0x18c5b5){var _0x3ff70f=_['map'](_0x18c5b5,function(_0x553132){return _0x553132['getAssociatedQueues']();});return Promise['all'](_0x3ff70f);})[_0x0976('0x27')](function(_0x368596){_0xa9c747=_[_0x0976('0x116')](_0x368596);var _0x1b6b39=_[_0x0976('0x87')](_0xa9c747,function(_0x5cd07e){return _0x5cd07e[_0x0976('0x117')](_0x3463a1['id'],{'transaction':_0x4f1859});});return Promise['all'](_0x1b6b39);})[_0x0976('0x27')](function(){if(!_0x3463a1[_0x0976('0x9b')])return;var _0x3b7762=_[_0x0976('0x3d')](_0xa9c747,function(_0x2a6b99){return _0x2a6b99[_0x0976('0x113')](_0x0976('0xaa'))===_0x0976('0x114');});var _0x360d97=_[_0x0976('0x87')](_0x3b7762,function(_0x263442){return db['UserVoiceQueueRt'][_0x0976('0x28')]({'where':{'VoiceQueueId':_0x263442['id'],'UserId':_0x3463a1['id']},'transaction':_0x4f1859});});return Promise[_0x0976('0x50')](_0x360d97);})['then'](function(){return db[_0x0976('0x118')][_0x0976('0x8a')]({'where':{'teamId':{'$in':_0x33a974}}});})['then'](function(_0x362f08){var _0x1d9b75=_['map'](_0x362f08,function(_0x2fa4e7){return db[_0x0976('0x119')][_0x0976('0x28')]({'where':{'UserId':_0x3463a1['id'],'VoicePrefixId':_0x2fa4e7[_0x0976('0x11a')]}},{'transaction':_0x4f1859});});return Promise['all'](_0x1d9b75);});});})[_0x0976('0x27')](function(){for(var _0x3cfd4f=0x0;_0x3cfd4f<_0xa9c747[_0x0976('0x49')];_0x3cfd4f++){var _0x1ec01b=_0xa9c747[_0x3cfd4f][_0x0976('0x113')]('channel');var _0x30633c=_0x1ec01b+_0x0976('0xae');socket[_0x0976('0xa3')]('user'+_0x1ec01b+_0x0976('0xaf'),{'UserId':_0x1022ed,['queueField']:_0xa9c747[_0x3cfd4f]['id']});}})[_0x0976('0x27')](respondWithStatusCode(_0x34f3e4,null))[_0x0976('0x51')](APIHandleError(_0x34f3e4));};exports['getLists']=function(_0x1361e1,_0x1689a5){var _0x222e9c={};var _0x31c334={};var _0x40e569;var _0x444c9a;return db[_0x0976('0x38')]['findOne']({'where':{'id':_0x1361e1[_0x0976('0x53')]['id']}})[_0x0976('0x27')](handleEntityNotFound(_0x1689a5,null))[_0x0976('0x27')](function(_0x9eb0b1){if(_0x9eb0b1){_0x40e569=_0x9eb0b1;_0x31c334[_0x0976('0x54')]=_['keys'](db['CmList'][_0x0976('0x39')]);_0x31c334[_0x0976('0x42')]=_[_0x0976('0x56')](_0x1361e1['query']);_0x31c334['filters']=_[_0x0976('0x58')](_0x31c334[_0x0976('0x54')],_0x31c334[_0x0976('0x42')]);_0x222e9c[_0x0976('0x45')]=_[_0x0976('0x58')](_0x31c334[_0x0976('0x54')],qs[_0x0976('0x59')](_0x1361e1[_0x0976('0x42')][_0x0976('0x59')]));_0x222e9c[_0x0976('0x45')]=_0x222e9c['attributes']['length']?_0x222e9c[_0x0976('0x45')]:_0x31c334[_0x0976('0x54')];_0x222e9c[_0x0976('0xc7')]=qs[_0x0976('0xc8')](_0x1361e1[_0x0976('0x42')][_0x0976('0xc8')]);_0x222e9c[_0x0976('0x40')]=qs['filters'](_[_0x0976('0xc9')](_0x1361e1[_0x0976('0x42')],_0x31c334[_0x0976('0xc6')]));if(_0x1361e1['query'][_0x0976('0x3d')]){_0x222e9c[_0x0976('0x40')]=_[_0x0976('0x5b')](_0x222e9c[_0x0976('0x40')],{'$or':_[_0x0976('0x87')](_0x222e9c[_0x0976('0x45')],function(_0x46b12f){var _0x18713c={};_0x18713c[_0x46b12f]={'$like':'%'+_0x1361e1[_0x0976('0x42')]['filter']+'%'};return _0x18713c;})});}_0x222e9c=_[_0x0976('0x5b')]({},_0x222e9c,_0x1361e1['options']);return _0x40e569[_0x0976('0x11b')](_0x222e9c);}})[_0x0976('0x27')](function(_0x1d1a2b){if(_0x1d1a2b){_0x444c9a=_0x1d1a2b['length'];if(!_0x1361e1[_0x0976('0x42')][_0x0976('0xce')](_0x0976('0xcf'))){_0x222e9c[_0x0976('0x23')]=qs['limit'](_0x1361e1['query'][_0x0976('0x23')]);_0x222e9c[_0x0976('0x21')]=qs[_0x0976('0x21')](_0x1361e1['query'][_0x0976('0x21')]);}return _0x40e569[_0x0976('0x11b')](_0x222e9c);}})[_0x0976('0x27')](function(_0x1e2e40){if(_0x1e2e40){return _0x1e2e40?{'count':_0x444c9a,'rows':_0x1e2e40}:null;}})[_0x0976('0x27')](respondWithResult(_0x1689a5,null))['catch'](handleError(_0x1689a5,null));};exports[_0x0976('0x11c')]=function(_0x3d951e,_0x59d520){var _0x594322={};var _0x1deec4={};var _0x516f21;return db[_0x0976('0x38')][_0x0976('0x95')]({'where':{'id':_0x3d951e['params']['id']}})[_0x0976('0x27')](handleEntityNotFound(_0x59d520,null))[_0x0976('0x27')](function(_0x1a75f1){if(_0x1a75f1){_0x516f21=_0x1a75f1;_0x1deec4[_0x0976('0x54')]=_[_0x0976('0x56')](db[_0x0976('0x38')][_0x0976('0x39')]);_0x1deec4['query']=_[_0x0976('0x56')](_0x3d951e['query']);_0x1deec4[_0x0976('0xc6')]=_[_0x0976('0x58')](_0x1deec4[_0x0976('0x54')],_0x1deec4[_0x0976('0x42')]);_0x594322[_0x0976('0x45')]=_[_0x0976('0x58')](_0x1deec4[_0x0976('0x54')],qs[_0x0976('0x59')](_0x3d951e['query']['fields']));_0x594322[_0x0976('0x45')]=_0x594322[_0x0976('0x45')][_0x0976('0x49')]?_0x594322['attributes']:_0x1deec4[_0x0976('0x54')];_0x594322[_0x0976('0xc7')]=qs[_0x0976('0xc8')](_0x3d951e[_0x0976('0x42')][_0x0976('0xc8')]);_0x594322[_0x0976('0x40')]=qs[_0x0976('0xc6')](_[_0x0976('0xc9')](_0x3d951e['query'],_0x1deec4[_0x0976('0xc6')]));if(_0x3d951e[_0x0976('0x42')][_0x0976('0x3d')]){_0x594322[_0x0976('0x40')]=_[_0x0976('0x5b')](_0x594322['where'],{'$or':_[_0x0976('0x87')](_0x594322[_0x0976('0x45')],function(_0x3e2ed5){var _0x34678c={};_0x34678c[_0x3e2ed5]={'$like':'%'+_0x3d951e[_0x0976('0x42')]['filter']+'%'};return _0x34678c;})});}_0x594322[_0x0976('0x54')]=db['User'];_0x594322['as']='Agents';_0x594322=_['merge']({},_0x594322,_0x3d951e[_0x0976('0xd3')]);return _0x516f21[_0x0976('0xf2')]({'include':[_0x594322]});}})[_0x0976('0x27')](function(_0x4bc8b2){if(_0x4bc8b2){var _0x1f266c={},_0x3c76ec=[];for(var _0x1e46bc=0x0;_0x1e46bc<_0x4bc8b2[_0x0976('0x49')];_0x1e46bc+=0x1){for(var _0x5396c3=0x0,_0x33f2ab;_0x5396c3<_0x4bc8b2[_0x1e46bc][_0x0976('0x82')][_0x0976('0x49')];_0x5396c3+=0x1){_0x33f2ab=_0x4bc8b2[_0x1e46bc][_0x0976('0x82')][_0x5396c3][_0x0976('0x29')]({'plain':!![]});_0x1f266c[_0x33f2ab['id']]=_0x33f2ab;}}_0x1f266c=_[_0x0976('0x11d')](_0x1f266c);for(var _0x2ea680=qs[_0x0976('0x21')](_0x3d951e[_0x0976('0x42')][_0x0976('0x21')]);_0x2ea680<_0x1f266c[_0x0976('0x49')]&&_0x3c76ec[_0x0976('0x49')]=_0x1884bc){_0x4419a6=_0x1884bc;_0x4b1676=0xc8;}else{_0x4b1676=0xce;}_0x1a6c3b[_0x4dfc('0x20')](_0x4b1676);return _0x1a6c3b['set'](_0x4dfc('0x27'),_0x4707ab+'-'+_0x4419a6+'/'+_0x1884bc)['json'](_0x3fa96a);}return null;};}function saveUpdates(_0x481041){return function(_0x105d30){if(_0x105d30){return _0x105d30[_0x4dfc('0x28')](_0x481041)[_0x4dfc('0x29')](function(_0x1a2c88){socket[_0x4dfc('0x2a')](_0x4dfc('0x2b')+_0x1a2c88['id'],{});return _0x1a2c88;});}return null;};}function removeEntity(_0x49b9d9){return function(_0x590575){if(_0x590575){return _0x590575['destroy']()['then'](function(){var _0x101d0f=_0x590575[_0x4dfc('0x2c')]({'plain':!![]});if(_0x101d0f[_0x4dfc('0x2d')]===_0x4dfc('0x2e'))return;var _0x436034=[{'name':_0x4dfc('0x2f'),'value':_0x4dfc('0x30'),'ignore':!![]},{'name':_0x4dfc('0x31'),'value':_0x4dfc('0x32'),'ignore':![]},{'name':_0x4dfc('0x33'),'value':'telephone','ignore':![]}];var _0x1c3c1b=_(_0x436034)[_0x4dfc('0x34')](_0x4dfc('0x35'))[_0x4dfc('0x36')]('value')[_0x4dfc('0x37')]();if(_[_0x4dfc('0x38')](_0x1c3c1b,_0x101d0f[_0x4dfc('0x2d')])){return;}var _0x2d0457=_['find'](_0x436034,['value',_0x101d0f['role']])[_0x4dfc('0x39')];return db['UserProfileResource']['destroy']({'where':{'type':_0x2d0457,'resourceId':_0x101d0f['id']}})['then'](function(){return _0x590575;});})['then'](function(){_0x49b9d9[_0x4dfc('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4830ec){return function(_0x2b4ad6){if(!_0x2b4ad6){_0x4830ec[_0x4dfc('0x1f')](0x194);}return _0x2b4ad6;};}function handleError(_0x329b82,_0x585b3a){_0x585b3a=_0x585b3a||0x1f4;return function(_0x5e2d59){logger['error'](_0x5e2d59[_0x4dfc('0x3a')]);if(_0x5e2d59[_0x4dfc('0x39')]){delete _0x5e2d59[_0x4dfc('0x39')];}_0x329b82[_0x4dfc('0x20')](_0x585b3a)[_0x4dfc('0x3b')](_0x5e2d59);};}exports[_0x4dfc('0x3c')]=function(_0xd5cfb5,_0x8de7bf){var _0x52e15a={},_0x4bd9fe={'count':0x0,'rows':[]};var _0x20fd59=_(db[_0x4dfc('0x3d')]['rawAttributes'])['map'](function(_0x917f4c){return{'name':_0x917f4c[_0x4dfc('0x3e')],'type':_0x917f4c['type'][_0x4dfc('0x3f')]};})['filter'](function(_0x46b314){return!_['includes']([_0x4dfc('0x40'),'salt'],_0x46b314[_0x4dfc('0x39')]);})['value']();_0x52e15a=qs['getOptions'](_0x20fd59,_0xd5cfb5);var _0x21894f={'where':_0x52e15a['where']};return db[_0x4dfc('0x3d')]['count'](_0x21894f)[_0x4dfc('0x29')](function(_0xc38151){_0x4bd9fe[_0x4dfc('0x26')]=_0xc38151;if(_0xd5cfb5[_0x4dfc('0x41')][_0x4dfc('0x42')]){_0x52e15a['include']=[{'all':!![]}];}if(_0xd5cfb5['query']['userSetting']==='true'){_0x52e15a[_0x4dfc('0x43')]=[{'model':db[_0x4dfc('0x44')],'as':_0x4dfc('0x45')}];}if(!_[_0x4dfc('0x38')](_0x52e15a[_0x4dfc('0x46')],'id')){_0x52e15a[_0x4dfc('0x46')][_0x4dfc('0x47')]('id');}return db[_0x4dfc('0x3d')][_0x4dfc('0x48')](_0x52e15a);})['then'](function(_0x49be65){_0x4bd9fe[_0x4dfc('0x49')]=_0x49be65;if(_0xd5cfb5['query']['openTabs']==='true'){var _0x2df2a0=[];for(var _0x4c5fb8=0x0;_0x4c5fb8<_0x4bd9fe['rows']['length'];_0x4c5fb8++){_0x2df2a0[_0x4dfc('0x47')](get_open_tabs(_0x4dfc('0x4a'),_0x4bd9fe[_0x4dfc('0x49')][_0x4c5fb8][_0x4dfc('0x4b')]));_0x2df2a0[_0x4dfc('0x47')](get_open_tabs('sms',_0x4bd9fe[_0x4dfc('0x49')][_0x4c5fb8][_0x4dfc('0x4b')]));_0x2df2a0['push'](get_open_tabs(_0x4dfc('0x4c'),_0x4bd9fe[_0x4dfc('0x49')][_0x4c5fb8]['dataValues']));_0x2df2a0[_0x4dfc('0x47')](get_open_tabs(_0x4dfc('0x4d'),_0x4bd9fe[_0x4dfc('0x49')][_0x4c5fb8][_0x4dfc('0x4b')]));_0x2df2a0[_0x4dfc('0x47')](get_open_tabs(_0x4dfc('0x4e'),_0x4bd9fe['rows'][_0x4c5fb8]['dataValues']));_0x2df2a0[_0x4dfc('0x47')](get_open_tabs(_0x4dfc('0x4f'),_0x4bd9fe[_0x4dfc('0x49')][_0x4c5fb8][_0x4dfc('0x4b')]));}return Promise['all'](_0x2df2a0)['then'](function(){return _0x4bd9fe;});}else{return _0x4bd9fe;}})['then'](respondWithFilteredResult(_0x8de7bf,_0x52e15a))[_0x4dfc('0x1e')](handleError(_0x8de7bf,null));};exports[_0x4dfc('0x50')]=function(_0x56d95f,_0x53499e){var _0x30767d={'raw':![],'where':{'id':_0x56d95f[_0x4dfc('0x51')]['id']}},_0x187908={};_0x187908[_0x4dfc('0x52')]=_[_0x4dfc('0x53')](_[_0x4dfc('0x54')](db['User'][_0x4dfc('0x55')]),[_0x4dfc('0x40'),_0x4dfc('0x56')]);_0x187908['query']=_[_0x4dfc('0x54')](_0x56d95f[_0x4dfc('0x41')]);_0x187908[_0x4dfc('0x57')]=_[_0x4dfc('0x58')](_0x187908['model'],_0x187908[_0x4dfc('0x41')]);_0x30767d[_0x4dfc('0x46')]=_[_0x4dfc('0x58')](_0x187908[_0x4dfc('0x52')],qs['fields'](_0x56d95f['query'][_0x4dfc('0x59')]));_0x30767d[_0x4dfc('0x46')]=_0x30767d[_0x4dfc('0x46')][_0x4dfc('0x5a')]?_0x30767d[_0x4dfc('0x46')]:_0x187908[_0x4dfc('0x52')];if(_0x56d95f['query'][_0x4dfc('0x42')]){_0x30767d[_0x4dfc('0x43')]=[{'all':!![]}];}if(_0x56d95f[_0x4dfc('0x41')][_0x4dfc('0x45')]===_0x4dfc('0x5b')){_0x30767d[_0x4dfc('0x43')]=[{'model':db[_0x4dfc('0x44')],'as':_0x4dfc('0x45')}];}_0x30767d=_[_0x4dfc('0x5c')]({},_0x30767d,_0x56d95f[_0x4dfc('0x5d')]);if(!_[_0x4dfc('0x38')](_0x30767d[_0x4dfc('0x46')],'id')){_0x30767d[_0x4dfc('0x46')]['push']('id');}return db['User']['find'](_0x30767d)[_0x4dfc('0x29')](handleEntityNotFound(_0x53499e,null))[_0x4dfc('0x29')](function(_0x4209a8){var _0x5040f6=[];values=_0x4209a8;if(_0x56d95f[_0x4dfc('0x41')][_0x4dfc('0x5e')]==='true'){_0x5040f6['push'](get_open_tabs(_0x4dfc('0x4a'),_0x4209a8[_0x4dfc('0x4b')]));_0x5040f6[_0x4dfc('0x47')](get_open_tabs(_0x4dfc('0x5f'),_0x4209a8[_0x4dfc('0x4b')]));_0x5040f6[_0x4dfc('0x47')](get_open_tabs(_0x4dfc('0x4e'),_0x4209a8[_0x4dfc('0x4b')]));_0x5040f6[_0x4dfc('0x47')](get_open_tabs(_0x4dfc('0x4f'),_0x4209a8[_0x4dfc('0x4b')]));_0x5040f6[_0x4dfc('0x47')](get_open_tabs(_0x4dfc('0x4c'),_0x4209a8[_0x4dfc('0x4b')]));_0x5040f6[_0x4dfc('0x47')](get_open_tabs('mail',_0x4209a8[_0x4dfc('0x4b')]));return Promise[_0x4dfc('0x60')](_0x5040f6);}else{return values;}})[_0x4dfc('0x29')](function(){return values;})[_0x4dfc('0x29')](respondWithResult(_0x53499e,null))['catch'](handleError(_0x53499e,null));};exports['update']=function(_0x188ed6,_0x57a85a){if(_0x188ed6[_0x4dfc('0x61')]['id']){delete _0x188ed6[_0x4dfc('0x61')]['id'];}delete _0x188ed6['body'][_0x4dfc('0x2d')];return db['User'][_0x4dfc('0x62')]({'where':{'id':_0x188ed6[_0x4dfc('0x51')]['id']}})[_0x4dfc('0x29')](handleEntityNotFound(_0x57a85a,null))[_0x4dfc('0x29')](saveUpdates(_0x188ed6[_0x4dfc('0x61')],null))[_0x4dfc('0x29')](respondWithResult(_0x57a85a,null))[_0x4dfc('0x1e')](handleError(_0x57a85a,null));};exports[_0x4dfc('0x63')]=function(_0x13c124,_0x1b8965){return db[_0x4dfc('0x3d')][_0x4dfc('0x63')]()['then'](respondWithResult(_0x1b8965,null))[_0x4dfc('0x1e')](handleError(_0x1b8965,null));};exports[_0x4dfc('0x64')]=function(_0x12eba3,_0x2bd729){return db[_0x4dfc('0x3d')][_0x4dfc('0x62')]({'where':{'id':_0x12eba3[_0x4dfc('0x51')]['id']}})[_0x4dfc('0x29')](handleEntityNotFound(_0x2bd729,null))[_0x4dfc('0x29')](function(_0x244220){if(_0x244220){return _0x244220['addContacts'](_0x12eba3[_0x4dfc('0x61')][_0x4dfc('0x65')],_['omit'](_0x12eba3[_0x4dfc('0x61')],[_0x4dfc('0x65'),'id'])||{});}})[_0x4dfc('0x29')](respondWithResult(_0x2bd729,null))['catch'](handleError(_0x2bd729,null));};function validateUser(_0x3d3d96){return new Promise(function(_0x244b59,_0x2d0f32){if(_0x3d3d96['internal'])return _0x244b59(_0x3d3d96);return db[_0x4dfc('0x66')]['findById'](0x1)[_0x4dfc('0x29')](function(_0x20a4a4){if(_0x20a4a4[_0x4dfc('0x67')])authService['validatePasswordPattern'](_0x3d3d96[_0x4dfc('0x40')]);db[_0x4dfc('0x3d')][_0x4dfc('0x68')]('internal')[_0x4dfc('0x29')](function(_0x15b01e){if(_[_0x4dfc('0x69')](_0x15b01e)){_0x3d3d96[_0x4dfc('0x6a')]=_0x20a4a4['min_internal']||0x1;return;}if(_[_0x4dfc('0x69')](_0x20a4a4['min_internal'])||_0x20a4a4[_0x4dfc('0x6b')]===_0x15b01e){_0x3d3d96[_0x4dfc('0x6a')]=_0x15b01e+0x1;return;}if(_0x20a4a4['min_internal']>_0x15b01e){_0x3d3d96['internal']=_0x20a4a4[_0x4dfc('0x6b')];return;}return db[_0x4dfc('0x6c')][_0x4dfc('0x41')]('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[_0x4dfc('0x6c')][_0x4dfc('0x6d')][_0x4dfc('0x6e')]})[_0x4dfc('0x29')](function(_0x4509bc){if(_0x4509bc&&_0x4509bc[_0x4dfc('0x5a')]){for(var _0x41e9c2=0x0,_0x363d71=_0x4509bc['length'];_0x41e9c2<_0x363d71&&_[_0x4dfc('0x69')](_0x3d3d96[_0x4dfc('0x6a')]);_0x41e9c2++){if(_0x20a4a4[_0x4dfc('0x6b')]<=_0x4509bc[_0x41e9c2][_0x4dfc('0x6f')]){_0x3d3d96[_0x4dfc('0x6a')]=_0x4509bc[_0x41e9c2]['from'];}else if(_0x20a4a4['min_internal']>_0x4509bc[_0x41e9c2]['from']&&_0x20a4a4[_0x4dfc('0x6b')]<=_0x4509bc[_0x41e9c2]['to']){_0x3d3d96[_0x4dfc('0x6a')]=_0x20a4a4[_0x4dfc('0x6b')];}}}if(_[_0x4dfc('0x69')](_0x3d3d96[_0x4dfc('0x6a')])){_0x3d3d96['internal']=_0x15b01e+0x1;}return _0x244b59(_0x3d3d96);});});})[_0x4dfc('0x1e')](function(_0x471716){_0x2d0f32(_0x471716);});});}function updateUser(_0x137729){return new Promise(function(_0x73cb9,_0x47c113){try{if(_0x137729[_0x4dfc('0x70')]){_0x137729[_0x4dfc('0x71')]=_0x137729[_0x4dfc('0x6a')];_0x137729[_0x4dfc('0x72')]={'mailbox':_0x137729['internal'],'password':_0x137729[_0x4dfc('0x40')],'fullname':_0x137729[_0x4dfc('0x73')],'email':_0x137729[_0x4dfc('0x74')]};}if(_0x137729[_0x4dfc('0x2d')]==='agent'){if(!_0x137729[_0x4dfc('0x75')])_0x137729['permissions']=[_0x4dfc('0x76'),'102',_0x4dfc('0x77'),_0x4dfc('0x78'),'110','104',_0x4dfc('0x79'),'106',_0x4dfc('0x7a'),_0x4dfc('0x7b'),'109',_0x4dfc('0x7c'),_0x4dfc('0x7d'),_0x4dfc('0x7e'),_0x4dfc('0x7f')];}_0x73cb9(_0x137729);}catch(_0x1fc934){_0x47c113(_0x1fc934);}});}exports[_0x4dfc('0x80')]=function(_0x5ca778,_0x4508cb){if(_0x5ca778['user'][_0x4dfc('0x2d')]==='agent')throw new Error(_0x4dfc('0x81'));if(_0x5ca778['body'][_0x4dfc('0x2d')]===_0x4dfc('0x30')&&_0x5ca778[_0x4dfc('0x30')][_0x4dfc('0x2d')]!==_0x4dfc('0x2e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x5ca778['body']['role']===_0x4dfc('0x2e')&&_0x5ca778[_0x4dfc('0x30')][_0x4dfc('0x2d')]!==_0x4dfc('0x2e')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x4dfc('0x82')]([_0x5ca778[_0x4dfc('0x61')]])[_0x4dfc('0x29')](function(){return validateUser(_0x5ca778[_0x4dfc('0x61')]);})['then'](function(_0x7ec09c){return updateUser(_0x7ec09c)[_0x4dfc('0x29')](function(_0x33fe12){if(_0x33fe12[_0x4dfc('0x2d')]==='admin'){_0x33fe12[_0x4dfc('0x83')]=_0x5ca778[_0x4dfc('0x30')][_0x4dfc('0x83')];delete _0x33fe12['userProfileId'];}return _0x33fe12;});})[_0x4dfc('0x29')](function(_0x5c455a){return db[_0x4dfc('0x3d')][_0x4dfc('0x80')](_0x5c455a,{'include':[{'model':db[_0x4dfc('0x72')],'as':_0x4dfc('0x72')}]});})[_0x4dfc('0x29')](function(_0x48dc17){if(_0x5ca778[_0x4dfc('0x61')][_0x4dfc('0x2d')]===_0x4dfc('0x30'))return _0x48dc17;if(_0x5ca778[_0x4dfc('0x30')]['role']!=='user')return _0x48dc17;return db[_0x4dfc('0x84')][_0x4dfc('0x62')]({'where':{'name':_0x48dc17[_0x4dfc('0x2d')]===_0x4dfc('0x32')?_0x4dfc('0x31'):_0x4dfc('0x33'),'userProfileId':_0x5ca778[_0x4dfc('0x30')]['userProfileId']},'raw':!![]})['then'](function(_0x3a7b6c){if(!_0x3a7b6c||_0x3a7b6c[_0x4dfc('0x85')]!=0x0)return _0x48dc17;return db[_0x4dfc('0x86')][_0x4dfc('0x80')]({'name':_0x48dc17['name'],'resourceId':_0x48dc17['id'],'type':_0x3a7b6c['name'],'sectionId':_0x3a7b6c['id']},{})['then'](function(){return _0x48dc17;});})[_0x4dfc('0x1e')](function(_0x574fc7){logger['error'](_0x4dfc('0x87'),_0x574fc7);throw _0x574fc7;});})['then'](respondWithResult(_0x4508cb,0xc9))[_0x4dfc('0x1e')](handleError(_0x4508cb,null));};exports[_0x4dfc('0x88')]=function(_0x264fad,_0x48660d){var _0x592a85=_0x264fad[_0x4dfc('0x61')];var _0x24ceed=[];if(_0x264fad[_0x4dfc('0x30')]['role']==='agent')throw new Error(_0x4dfc('0x81'));if(_[_0x4dfc('0x89')](_0x592a85,[_0x4dfc('0x2d'),'user'])&&_0x264fad['user'][_0x4dfc('0x2d')]!=='admin'){throw new Error(_0x4dfc('0x8a'));}if(_[_0x4dfc('0x89')](_0x592a85,[_0x4dfc('0x2d'),'admin'])&&_0x264fad[_0x4dfc('0x30')][_0x4dfc('0x2d')]!==_0x4dfc('0x2e')){throw new Error(_0x4dfc('0x8b'));}return licenseUtil[_0x4dfc('0x82')](_0x592a85)[_0x4dfc('0x29')](function(){return validateUser(_0x592a85[0x0]);})[_0x4dfc('0x29')](function(){for(var _0x8120e8=0x1;_0x8120e8<_0x592a85['length'];_0x8120e8++){var _0x4d8afa=_0x592a85[_0x8120e8-0x1][_0x4dfc('0x6a')];if(!_0x592a85[_0x8120e8]['internal'])_0x592a85[_0x8120e8]['internal']=_0x4d8afa+0x1;_0x24ceed[_0x4dfc('0x47')](validateUser(_0x592a85[_0x8120e8]));}return Promise['all'](_0x24ceed);})[_0x4dfc('0x29')](function(){_0x24ceed=[];for(var _0x54a95f=0x0;_0x54a95f<_0x592a85[_0x4dfc('0x5a')];_0x54a95f++){_0x24ceed[_0x4dfc('0x47')](updateUser(_0x592a85[_0x54a95f]));}return Promise[_0x4dfc('0x60')](_0x24ceed);})[_0x4dfc('0x29')](function(){_0x24ceed=_0x592a85[_0x4dfc('0x36')](function(_0x54d310){return db[_0x4dfc('0x3d')][_0x4dfc('0x80')](_0x54d310,{'include':[{'model':db['VoiceMail'],'as':_0x4dfc('0x72')}]})[_0x4dfc('0x29')](function(_0x107351){_0x54d310['id']=_0x107351['id'];return _0x54d310;});});return Promise[_0x4dfc('0x60')](_0x24ceed);})[_0x4dfc('0x29')](function(_0x5bd484){if(_0x264fad[_0x4dfc('0x61')][_0x4dfc('0x2d')]===_0x4dfc('0x30'))return _0x5bd484;if(_0x264fad[_0x4dfc('0x30')][_0x4dfc('0x2d')]!=='user')return _0x5bd484;var _0x2bce8a=_[_0x4dfc('0x89')](_0x5bd484,function(_0x222c23){return _0x222c23[_0x4dfc('0x2d')]===_0x4dfc('0x32')||_0x222c23[_0x4dfc('0x2d')]===_0x4dfc('0x8c');});if(!_0x2bce8a)return _0x5bd484;return db[_0x4dfc('0x84')][_0x4dfc('0x48')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x264fad[_0x4dfc('0x30')]['userProfileId']},'raw':!![]})[_0x4dfc('0x29')](function(_0x2361e4){if(_[_0x4dfc('0x8d')](_0x2361e4)||!_['some'](_0x2361e4,[_0x4dfc('0x85'),0x0]))return _0x5bd484;_0x24ceed=[];var _0x4ebeed=_(_0x2361e4)[_0x4dfc('0x36')](function(_0x3fc632){if(_0x3fc632['autoAssociation']===0x1)return;return _0x3fc632[_0x4dfc('0x39')]===_0x4dfc('0x31')?_0x4dfc('0x32'):'telephone';})[_0x4dfc('0x8e')]()[_0x4dfc('0x37')]();for(var _0x40417f=0x0;_0x40417f<_0x5bd484[_0x4dfc('0x5a')];_0x40417f++){if(!_['includes'](_0x4ebeed,_0x5bd484[_0x40417f][_0x4dfc('0x2d')]))return;var _0x275611=_0x5bd484[_0x40417f]['role']===_0x4dfc('0x32')?_0x4dfc('0x31'):'Telephones';_0x24ceed[_0x4dfc('0x47')](db[_0x4dfc('0x86')][_0x4dfc('0x80')]({'name':_0x5bd484[_0x40417f][_0x4dfc('0x39')],'resourceId':_0x5bd484[_0x40417f]['id'],'type':_0x275611,'sectionId':_[_0x4dfc('0x62')](_0x2361e4,[_0x4dfc('0x39'),_0x275611])['id']},{}));}return Promise[_0x4dfc('0x60')](_0x24ceed);});})[_0x4dfc('0x29')](respondWithResult(_0x48660d,0xc9))[_0x4dfc('0x1e')](handleError(_0x48660d,null));};exports['changePassword']=function(_0x1c219f,_0x56d503){if(_0x1c219f[_0x4dfc('0x61')]['id']){delete _0x1c219f[_0x4dfc('0x61')]['id'];}return db[_0x4dfc('0x3d')]['find']({'where':{'id':_0x1c219f['params']['id']}})[_0x4dfc('0x29')](function(_0x20933f){if(!_0x20933f)return null;if(_0x20933f['id']===_0x1c219f['user']['id']){if(!_0x1c219f[_0x4dfc('0x61')][_0x4dfc('0x8f')]||!_0x1c219f['body'][_0x4dfc('0x90')]){throw new db[(_0x4dfc('0x91'))]['ValidationError'](_0x4dfc('0x92'));}if(!_0x20933f[_0x4dfc('0x93')](_0x1c219f[_0x4dfc('0x61')][_0x4dfc('0x8f')])){throw new db[(_0x4dfc('0x91'))][(_0x4dfc('0x94'))](_0x4dfc('0x95'));}if(_0x1c219f[_0x4dfc('0x61')][_0x4dfc('0x8f')]===_0x1c219f[_0x4dfc('0x61')][_0x4dfc('0x90')]){throw new db['Sequelize'][(_0x4dfc('0x94'))](_0x4dfc('0x96'));}}else if(_0x1c219f['user'][_0x4dfc('0x2d')]===_0x4dfc('0x2e')){if(!_0x1c219f[_0x4dfc('0x61')][_0x4dfc('0x90')]){throw new db[(_0x4dfc('0x91'))][(_0x4dfc('0x94'))](_0x4dfc('0x97'));}}else if(_0x1c219f[_0x4dfc('0x30')][_0x4dfc('0x2d')]===_0x4dfc('0x30')){if(!_0x1c219f[_0x4dfc('0x61')][_0x4dfc('0x90')]){throw new db['Sequelize'][(_0x4dfc('0x94'))](_0x4dfc('0x97'));}if(_0x20933f['role']!==_0x4dfc('0x32')){throw new db[(_0x4dfc('0x91'))][(_0x4dfc('0x94'))]('Unauthorized');}}else{throw new db[(_0x4dfc('0x91'))][(_0x4dfc('0x94'))]('Unauthorized');}return _0x20933f;})['then'](handleEntityNotFound(_0x56d503,null))[_0x4dfc('0x29')](function(_0x3999ce){return db['Setting']['findOne']({'attributes':['id',_0x4dfc('0x67'),_0x4dfc('0x98'),_0x4dfc('0x99')]})[_0x4dfc('0x29')](function(_0x18483d){if(_0x18483d['securePassword'])authService[_0x4dfc('0x9a')](_0x1c219f[_0x4dfc('0x61')][_0x4dfc('0x90')]);if(!_0x18483d[_0x4dfc('0x98')]||!_0x3999ce[_0x4dfc('0x9b')])return _0x3999ce;authService[_0x4dfc('0x9c')](_0x1c219f[_0x4dfc('0x61')][_0x4dfc('0x90')],_0x3999ce[_0x4dfc('0x9b')],_0x18483d[_0x4dfc('0x99')]);return _0x3999ce;})[_0x4dfc('0x29')](saveUpdates({'password':_0x1c219f[_0x4dfc('0x61')][_0x4dfc('0x90')],'passwordResetAt':_0x1c219f[_0x4dfc('0x30')]['id']==_0x1c219f[_0x4dfc('0x51')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x1c219f[_0x4dfc('0x61')][_0x4dfc('0x90')],_0x3999ce[_0x4dfc('0x9b')])},null));})[_0x4dfc('0x29')](respondWithResult(_0x56d503,null))[_0x4dfc('0x1e')](handleError(_0x56d503,null));};exports[_0x4dfc('0x9d')]=function(_0x58e0d0,_0x33b99b){var _0x2c1aef=_0x58e0d0[_0x4dfc('0x61')][_0x4dfc('0x9e')];return db[_0x4dfc('0x3d')][_0x4dfc('0x62')]({'where':{'id':_0x58e0d0['params']['id']},'attributes':['id',_0x4dfc('0x39'),_0x4dfc('0x2d'),_0x4dfc('0x9f'),_0x4dfc('0xa0'),_0x4dfc('0xa1'),_0x4dfc('0xa2')]})[_0x4dfc('0x29')](handleEntityNotFound(_0x33b99b,null))['then'](function(_0x38a118){if(_0x38a118){if(!utils[_0x4dfc('0xa3')](_0x2c1aef)){throw new db[(_0x4dfc('0x91'))][(_0x4dfc('0x94'))]('Unknown\x20channel');}return _0x38a118[_0x4dfc('0xa4')+_[_0x4dfc('0xa5')](_0x2c1aef['toLowerCase']())+'Queues'](_0x58e0d0[_0x4dfc('0x61')][_0x4dfc('0x65')],{'penalty':_0x58e0d0['body']['penalty']||0x0})['spread'](function(_0x33a48f){for(var _0x1616f8=0x0;_0x1616f8<_0x58e0d0[_0x4dfc('0x61')]['ids']['length'];_0x1616f8+=0x1){var _0x29a53d={'UserId':Number(_0x58e0d0[_0x4dfc('0x51')]['id'])};_0x29a53d[_[_0x4dfc('0xa5')](_0x2c1aef[_0x4dfc('0xa6')]())+'QueueId']=Number(_0x58e0d0[_0x4dfc('0x61')][_0x4dfc('0x65')][_0x1616f8]);socket[_0x4dfc('0x2a')]('user'+_[_0x4dfc('0xa5')](_0x2c1aef['toLowerCase']())+_0x4dfc('0xa7'),_0x29a53d);}return _0x33a48f;})['then'](function(){if(_0x2c1aef===_0x4dfc('0xa8')){return db['VoiceQueue'][_0x4dfc('0x48')]({'where':{'id':_0x58e0d0[_0x4dfc('0x61')][_0x4dfc('0x65')]||[]},'raw':!![],'attributes':['id',_0x4dfc('0x39')]});}})['then'](function(_0xe6e278){var _0x4fa14a=_0x38a118['get']({'plain':!![]});var _0x363191=[];if(_0x2c1aef===_0x4dfc('0xa8')&&_0x4fa14a[_0x4dfc('0x2d')]==='agent'&&_0x4fa14a[_0x4dfc('0x9f')]){for(let _0x360108=0x0;_0x360108<_0xe6e278['length'];_0x360108+=0x1){_0x363191['push']({'membername':_0x4fa14a[_0x4dfc('0x39')],'UserId':_0x4fa14a['id'],'queue_name':_0xe6e278[_0x360108][_0x4dfc('0x39')],'VoiceQueueId':_0xe6e278[_0x360108]['id'],'interface':_[_0x4dfc('0x69')](_0x4fa14a[_0x4dfc('0xa2')])?util['format'](_0x4dfc('0xa9'),_0x4fa14a[_0x4dfc('0x39')]):_0x4fa14a[_0x4dfc('0xa2')],'paused':_0x4fa14a[_0x4dfc('0xa1')]||![],'penalty':_0x58e0d0[_0x4dfc('0x61')][_0x4dfc('0xaa')]||0x0});}return Promise[_0x4dfc('0x60')](_0x363191[_0x4dfc('0x36')](function(_0x47853e){return db[_0x4dfc('0xab')][_0x4dfc('0xac')](_0x47853e);}));}return _0x38a118;});}})[_0x4dfc('0x29')](respondWithStatusCode(_0x33b99b,null))[_0x4dfc('0x1e')](handleError(_0x33b99b,null));};exports[_0x4dfc('0xad')]=function(_0x3865dc,_0x4888ca){var _0x2cbe76,_0x4a7861;return db[_0x4dfc('0x3d')][_0x4dfc('0x62')]({'where':{'id':_0x3865dc['params']['id']},'attributes':['id',_0x4dfc('0x39'),'role']})[_0x4dfc('0x29')](handleEntityNotFound(_0x4888ca,null))[_0x4dfc('0x29')](function(_0x33b69b){if(_0x33b69b){_0x2cbe76=_0x33b69b;if(!_0x3865dc['query'][_0x4dfc('0x9e')]||!utils[_0x4dfc('0xa3')](_0x3865dc['query'][_0x4dfc('0x9e')])){throw new db[(_0x4dfc('0x91'))][(_0x4dfc('0x94'))](_0x4dfc('0xae'));}return _0x33b69b['remove'+_[_0x4dfc('0xa5')](_0x3865dc[_0x4dfc('0x41')][_0x4dfc('0x9e')][_0x4dfc('0xa6')]())+'Queues'](_0x3865dc[_0x4dfc('0x41')][_0x4dfc('0x65')]);}})[_0x4dfc('0x29')](function(_0x2b8e82){if(_[_0x4dfc('0xaf')](_0x3865dc[_0x4dfc('0x41')]['ids'])){for(var _0x3066a1=0x0;_0x3066a1<_0x3865dc[_0x4dfc('0x41')][_0x4dfc('0x65')][_0x4dfc('0x5a')];_0x3066a1+=0x1){_0x4a7861={'UserId':Number(_0x3865dc['params']['id'])};_0x4a7861[_[_0x4dfc('0xa5')](_0x3865dc['query'][_0x4dfc('0x9e')][_0x4dfc('0xa6')]())+_0x4dfc('0xb0')]=Number(_0x3865dc[_0x4dfc('0x41')][_0x4dfc('0x65')][_0x3066a1]);socket[_0x4dfc('0x2a')](_0x4dfc('0x30')+_[_0x4dfc('0xa5')](_0x3865dc['query'][_0x4dfc('0x9e')][_0x4dfc('0xa6')]())+'Queue:remove',_0x4a7861);}}else{_0x4a7861={'UserId':Number(_0x3865dc[_0x4dfc('0x51')]['id'])};_0x4a7861[_[_0x4dfc('0xa5')](_0x3865dc[_0x4dfc('0x41')][_0x4dfc('0x9e')]['toLowerCase']())+_0x4dfc('0xb0')]=Number(_0x3865dc[_0x4dfc('0x41')]['ids']);socket[_0x4dfc('0x2a')](_0x4dfc('0x30')+_[_0x4dfc('0xa5')](_0x3865dc[_0x4dfc('0x41')][_0x4dfc('0x9e')]['toLowerCase']())+_0x4dfc('0xb1'),_0x4a7861);}return _0x2b8e82;})[_0x4dfc('0x29')](function(){if(_0x3865dc[_0x4dfc('0x41')][_0x4dfc('0x9e')]===_0x4dfc('0xa8')){return db[_0x4dfc('0xab')][_0x4dfc('0xb2')]({'where':{'UserId':_0x3865dc[_0x4dfc('0x51')]['id'],'VoiceQueueId':_0x3865dc['query'][_0x4dfc('0x65')]},'individualHooks':!![]})['then'](function(){return _0x2cbe76;});}return _0x2cbe76;})[_0x4dfc('0x29')](respondWithStatusCode(_0x4888ca,null))['catch'](handleError(_0x4888ca,null));};exports[_0x4dfc('0xb3')]=function(_0x3adfa5,_0x18970e){_0x3adfa5['body'][_0x4dfc('0xb4')]=_0x3adfa5[_0x4dfc('0xb5')][_0x4dfc('0xb6')];return db[_0x4dfc('0x3d')][_0x4dfc('0x62')]({'where':{'id':_0x3adfa5[_0x4dfc('0x51')]['id']}})[_0x4dfc('0x29')](handleEntityNotFound(_0x18970e,null))['then'](saveUpdates(_0x3adfa5[_0x4dfc('0x61')],null))[_0x4dfc('0x29')](respondWithResult(_0x18970e,null))[_0x4dfc('0x1e')](handleError(_0x18970e,null));};exports[_0x4dfc('0xb7')]=function(_0x309efa,_0x503eb4){var _0x1f9702=path[_0x4dfc('0xb8')](config['root'],'server/files/images/logos/default_profile.png');return db[_0x4dfc('0x3d')]['find']({'where':{'id':_0x309efa[_0x4dfc('0x51')]['id']},'attributes':['id',_0x4dfc('0xb4')],'raw':!![]})[_0x4dfc('0x29')](handleEntityNotFound(_0x503eb4,null))[_0x4dfc('0x29')](function(_0x5ecf89){if(_0x5ecf89){if(_[_0x4dfc('0x69')](_0x5ecf89[_0x4dfc('0xb4')])){return _0x503eb4[_0x4dfc('0xb9')](_0x1f9702);}else{if(!fs[_0x4dfc('0xba')](path[_0x4dfc('0xb8')](config[_0x4dfc('0xbb')],_0x4dfc('0xbc'),_0x5ecf89['userpic']))){return _0x503eb4[_0x4dfc('0xb9')](_0x1f9702);}return _0x503eb4[_0x4dfc('0xb9')](path[_0x4dfc('0xb8')](config[_0x4dfc('0xbb')],_0x4dfc('0xbc'),_0x5ecf89[_0x4dfc('0xb4')]));}}})['catch'](handleError(_0x503eb4,null));};exports[_0x4dfc('0xbd')]=function(_0x3e53e3,_0x59b835){return db[_0x4dfc('0x3d')][_0x4dfc('0x62')]({'where':{'id':_0x3e53e3[_0x4dfc('0x51')]['id']},'attributes':['id']})[_0x4dfc('0x29')](handleEntityNotFound(_0x59b835,null))[_0x4dfc('0x29')](function(_0x4451cd){var _0x5256e3=[];values=_0x4451cd[_0x4dfc('0x4b')];_0x5256e3[_0x4dfc('0x47')](get_open_tabs(_0x4dfc('0x4a'),_0x4451cd[_0x4dfc('0x4b')]));_0x5256e3[_0x4dfc('0x47')](get_open_tabs('sms',_0x4451cd[_0x4dfc('0x4b')]));_0x5256e3['push'](get_open_tabs('openchannel',_0x4451cd[_0x4dfc('0x4b')]));_0x5256e3['push'](get_open_tabs('whatsapp',_0x4451cd[_0x4dfc('0x4b')]));_0x5256e3[_0x4dfc('0x47')](get_open_tabs(_0x4dfc('0x4c'),_0x4451cd[_0x4dfc('0x4b')]));_0x5256e3[_0x4dfc('0x47')](get_open_tabs(_0x4dfc('0x4d'),_0x4451cd[_0x4dfc('0x4b')]));return Promise[_0x4dfc('0x60')](_0x5256e3);})[_0x4dfc('0x29')](function(_0x3f2b86){if(_0x3f2b86){var _0x5cbeee=_[_0x4dfc('0x36')](values[_0x4dfc('0xbe')],function(_0x462966){return{'channel':_0x4dfc('0xbf'),'id':_0x462966['id'],'createdAt':_0x462966['createdAt']};});var _0x4c83e1=_[_0x4dfc('0x36')](values[_0x4dfc('0xc0')],function(_0xd0d7db){return{'channel':_0x4dfc('0xc1'),'id':_0xd0d7db['id'],'createdAt':_0xd0d7db[_0x4dfc('0xc2')]};});var _0x115ac6=_[_0x4dfc('0x36')](values[_0x4dfc('0xc3')],function(_0x28a195){return{'channel':_0x4dfc('0xc4'),'id':_0x28a195['id'],'createdAt':_0x28a195[_0x4dfc('0xc2')]};});var _0x3d10ae=_[_0x4dfc('0x36')](values[_0x4dfc('0xc5')],function(_0x2c69f8){return{'channel':_0x4dfc('0xc6'),'id':_0x2c69f8['id'],'createdAt':_0x2c69f8[_0x4dfc('0xc2')]};});var _0xfcc3f7=_[_0x4dfc('0x36')](values[_0x4dfc('0xc7')],function(_0x1f6cff){return{'channel':'SMS','id':_0x1f6cff['id'],'createdAt':_0x1f6cff['createdAt']};});var _0x46f528=_[_0x4dfc('0x36')](values[_0x4dfc('0xc8')],function(_0x367424){return{'channel':'WHATSAPP','id':_0x367424['id'],'createdAt':_0x367424[_0x4dfc('0xc2')]};});var _0x1b58f4=_['concat'](_0x5cbeee,_0x4c83e1,_0x115ac6,_0x3d10ae,_0xfcc3f7,_0x46f528);var _0x5f512c={'count':_0x1b58f4[_0x4dfc('0x5a')],'rows':_0x1b58f4};return _0x5f512c;}else return null;})[_0x4dfc('0x29')](respondWithResult(_0x59b835,null))['catch'](handleError(_0x59b835,null));};exports[_0x4dfc('0xc9')]=function(_0x16a081,_0x4552ca){var _0xabf7d0={};var _0x3489d2={};var _0x57876e;var _0xeeddf9;return db['User'][_0x4dfc('0xca')]({'where':{'id':_0x16a081['params']['id']}})[_0x4dfc('0x29')](handleEntityNotFound(_0x4552ca,null))[_0x4dfc('0x29')](function(_0x201081){if(_0x201081){_0x57876e=_0x201081;_0x3489d2['model']=_[_0x4dfc('0x54')](db['CmContact'][_0x4dfc('0x55')]);_0x3489d2[_0x4dfc('0x41')]=_[_0x4dfc('0x54')](_0x16a081[_0x4dfc('0x41')]);_0x3489d2[_0x4dfc('0x57')]=_[_0x4dfc('0x58')](_0x3489d2[_0x4dfc('0x52')],_0x3489d2[_0x4dfc('0x41')]);_0xabf7d0[_0x4dfc('0x46')]=_['intersection'](_0x3489d2['model'],qs[_0x4dfc('0x59')](_0x16a081[_0x4dfc('0x41')][_0x4dfc('0x59')]));_0xabf7d0[_0x4dfc('0x46')]=_0xabf7d0[_0x4dfc('0x46')]['length']?_0xabf7d0[_0x4dfc('0x46')]:_0x3489d2[_0x4dfc('0x52')];_0xabf7d0[_0x4dfc('0xcb')]=qs[_0x4dfc('0xcc')](_0x16a081[_0x4dfc('0x41')]['sort']);_0xabf7d0[_0x4dfc('0xcd')]=qs[_0x4dfc('0x57')](_[_0x4dfc('0xce')](_0x16a081[_0x4dfc('0x41')],_0x3489d2['filters']));if(_0x16a081[_0x4dfc('0x41')]['filter']){_0xabf7d0[_0x4dfc('0xcd')]=_[_0x4dfc('0x5c')](_0xabf7d0[_0x4dfc('0xcd')],{'$or':_['map'](_0xabf7d0['attributes'],function(_0x58bb78){var _0x2cbef2={};_0x2cbef2[_0x58bb78]={'$like':'%'+_0x16a081[_0x4dfc('0x41')][_0x4dfc('0x34')]+'%'};return _0x2cbef2;})});}_0xabf7d0=_[_0x4dfc('0x5c')]({},_0xabf7d0,_0x16a081[_0x4dfc('0x5d')]);return _0x57876e['getContacts'](_0xabf7d0);}})['then'](function(_0xa5fdd1){if(_0xa5fdd1){_0xeeddf9=_0xa5fdd1[_0x4dfc('0x5a')];if(_0x16a081[_0x4dfc('0x41')][_0x4dfc('0xcf')](_0x4dfc('0x42'))){_0xabf7d0[_0x4dfc('0x43')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0x4dfc('0xd0')],'as':_0x4dfc('0xd1'),'attributes':['id',_0x4dfc('0x39'),_0x4dfc('0xd2')],'where':_0x16a081['query'][_0x4dfc('0xd3')]?{'id':_0x16a081[_0x4dfc('0x41')][_0x4dfc('0xd3')]}:undefined,'required':_0x16a081['query'][_0x4dfc('0xd3')]?!![]:![]}];}if(!_0x16a081['query'][_0x4dfc('0xcf')](_0x4dfc('0xd4'))){_0xabf7d0[_0x4dfc('0x25')]=qs[_0x4dfc('0x25')](_0x16a081[_0x4dfc('0x41')]['limit']);_0xabf7d0[_0x4dfc('0x23')]=qs[_0x4dfc('0x23')](_0x16a081[_0x4dfc('0x41')][_0x4dfc('0x23')]);}return _0x57876e[_0x4dfc('0xc9')](_0xabf7d0);}})[_0x4dfc('0x29')](function(_0x330c83){if(_0x330c83){return _0x330c83?{'count':_0xeeddf9,'rows':_0x330c83}:null;}})['then'](respondWithResult(_0x4552ca,null))[_0x4dfc('0x1e')](handleError(_0x4552ca,null));};exports[_0x4dfc('0xd5')]=function(_0x515f83,_0x1ef730){var _0x39bac8;var _0x4964bf={};var _0x38328f;return db['User'][_0x4dfc('0xca')]({'where':{'id':_0x515f83['params']['id']},'attributes':['id',_0x4dfc('0x39'),_0x4dfc('0x2d')]})[_0x4dfc('0x29')](handleEntityNotFound(_0x1ef730,null))[_0x4dfc('0x29')](function(_0x519f8b){if(!utils['isValidChannel'](_0x515f83[_0x4dfc('0x41')]['channel'])){throw new db[(_0x4dfc('0x91'))]['ValidationError'](_0x4dfc('0xae'));}_0x39bac8=_0x519f8b;var _0x2ec230={};_0x2ec230[_0x4dfc('0x52')]=_['keys'](db[_[_0x4dfc('0xa5')](_0x515f83[_0x4dfc('0x41')][_0x4dfc('0x9e')])+_0x4dfc('0xd6')][_0x4dfc('0x55')]);_0x2ec230[_0x4dfc('0x41')]=_[_0x4dfc('0x54')](_0x515f83[_0x4dfc('0x41')]);_0x2ec230[_0x4dfc('0x57')]=_[_0x4dfc('0x58')](_0x2ec230['model'],_0x2ec230[_0x4dfc('0x41')]);_0x4964bf[_0x4dfc('0x46')]=_[_0x4dfc('0x58')](_0x2ec230['model'],qs[_0x4dfc('0x59')](_0x515f83[_0x4dfc('0x41')]['fields']));_0x4964bf[_0x4dfc('0x46')]=_0x4964bf[_0x4dfc('0x46')][_0x4dfc('0x5a')]?_0x4964bf[_0x4dfc('0x46')]:_0x2ec230[_0x4dfc('0x52')];_0x4964bf[_0x4dfc('0xcb')]=qs[_0x4dfc('0xcc')](_0x515f83[_0x4dfc('0x41')][_0x4dfc('0xcc')]);_0x4964bf[_0x4dfc('0xcd')]=qs[_0x4dfc('0x57')](_[_0x4dfc('0xce')](_0x515f83[_0x4dfc('0x41')],_0x2ec230[_0x4dfc('0x57')]));if(_0x515f83['query']['filter']){_0x4964bf[_0x4dfc('0xcd')]=_['merge'](_0x4964bf['where'],{'$or':_[_0x4dfc('0x36')](_0x4964bf[_0x4dfc('0x46')],function(_0x1295da){var _0x42fd73={};_0x42fd73[_0x1295da]={'$like':'%'+_0x515f83['query'][_0x4dfc('0x34')]+'%'};return _0x42fd73;})});}_0x4964bf=_[_0x4dfc('0x5c')]({},_0x4964bf,_0x515f83[_0x4dfc('0x5d')]);switch(_0x39bac8[_0x4dfc('0x2d')]){case'admin':return db[_[_0x4dfc('0xa5')](_0x515f83[_0x4dfc('0x41')][_0x4dfc('0x9e')])+_0x4dfc('0xd6')][_0x4dfc('0x48')](_0x4964bf);case _0x4dfc('0x30'):case'agent':return _0x39bac8[_0x4dfc('0x2c')+_[_0x4dfc('0xa5')](_0x515f83[_0x4dfc('0x41')]['channel'])+_0x4dfc('0xd7')](_0x4964bf);default:throw new db['Sequelize'][(_0x4dfc('0x94'))](_0x4dfc('0xd8'));}})[_0x4dfc('0x29')](function(_0x495d67){_0x38328f=_0x495d67[_0x4dfc('0x5a')];if(!_0x515f83[_0x4dfc('0x41')][_0x4dfc('0xcf')](_0x4dfc('0xd4'))){_0x4964bf[_0x4dfc('0x25')]=qs[_0x4dfc('0x25')](_0x515f83[_0x4dfc('0x41')][_0x4dfc('0x25')]);_0x4964bf[_0x4dfc('0x23')]=qs[_0x4dfc('0x23')](_0x515f83['query'][_0x4dfc('0x23')]);}switch(_0x39bac8[_0x4dfc('0x2d')]){case _0x4dfc('0x2e'):return db[_[_0x4dfc('0xa5')](_0x515f83[_0x4dfc('0x41')]['channel'])+_0x4dfc('0xd6')]['findAll'](_0x4964bf);case _0x4dfc('0x30'):case'agent':return _0x39bac8[_0x4dfc('0x2c')+_[_0x4dfc('0xa5')](_0x515f83[_0x4dfc('0x41')]['channel'])+'Queues'](_0x4964bf);}})[_0x4dfc('0x29')](function(_0x35fec2){return{'count':_0x38328f,'rows':_0x35fec2};})[_0x4dfc('0x29')](respondWithResult(_0x1ef730,null))[_0x4dfc('0x1e')](handleError(_0x1ef730,null));};exports[_0x4dfc('0xd9')]=function(_0xaabe44,_0x2d242a){var _0x98c505={};var _0x28a2b7={};var _0x1523d0;var _0x5606a0;return db['User']['findOne']({'where':{'id':_0xaabe44[_0x4dfc('0x51')]['id']}})['then'](handleEntityNotFound(_0x2d242a,null))[_0x4dfc('0x29')](function(_0x5bd21c){if(_0x5bd21c){_0x1523d0=_0x5bd21c;_0x28a2b7[_0x4dfc('0x52')]=_['keys'](db[_0x4dfc('0xab')][_0x4dfc('0x55')]);_0x28a2b7[_0x4dfc('0x41')]=_['keys'](_0xaabe44[_0x4dfc('0x41')]);_0x28a2b7[_0x4dfc('0x57')]=_[_0x4dfc('0x58')](_0x28a2b7[_0x4dfc('0x52')],_0x28a2b7[_0x4dfc('0x41')]);_0x98c505[_0x4dfc('0x46')]=_[_0x4dfc('0x58')](_0x28a2b7[_0x4dfc('0x52')],qs[_0x4dfc('0x59')](_0xaabe44['query'][_0x4dfc('0x59')]));_0x98c505['attributes']=_0x98c505['attributes'][_0x4dfc('0x5a')]?_0x98c505[_0x4dfc('0x46')]:_0x28a2b7['model'];_0x98c505['order']=qs[_0x4dfc('0xcc')](_0xaabe44[_0x4dfc('0x41')][_0x4dfc('0xcc')]);_0x98c505[_0x4dfc('0xcd')]=qs[_0x4dfc('0x57')](_[_0x4dfc('0xce')](_0xaabe44['query'],_0x28a2b7['filters']));if(_0xaabe44[_0x4dfc('0x41')][_0x4dfc('0x34')]){_0x98c505[_0x4dfc('0xcd')]=_[_0x4dfc('0x5c')](_0x98c505[_0x4dfc('0xcd')],{'$or':_['map'](_0x98c505[_0x4dfc('0x46')],function(_0x5bcd4a){var _0x323734={};_0x323734[_0x5bcd4a]={'$like':'%'+_0xaabe44[_0x4dfc('0x41')][_0x4dfc('0x34')]+'%'};return _0x323734;})});}_0x98c505=_[_0x4dfc('0x5c')]({},_0x98c505,_0xaabe44[_0x4dfc('0x5d')]);return _0x1523d0[_0x4dfc('0xd9')](_0x98c505);}})['then'](function(_0x2c30d4){if(_0x2c30d4){_0x5606a0=_0x2c30d4[_0x4dfc('0x5a')];if(!_0xaabe44[_0x4dfc('0x41')][_0x4dfc('0xcf')]('nolimit')){_0x98c505[_0x4dfc('0x25')]=qs['limit'](_0xaabe44[_0x4dfc('0x41')][_0x4dfc('0x25')]);_0x98c505[_0x4dfc('0x23')]=qs[_0x4dfc('0x23')](_0xaabe44['query'][_0x4dfc('0x23')]);}return _0x1523d0['getVoiceQueuesRt'](_0x98c505);}})[_0x4dfc('0x29')](function(_0x2823b6){if(_0x2823b6){return _0x2823b6?{'count':_0x5606a0,'rows':_0x2823b6}:null;}})[_0x4dfc('0x29')](respondWithResult(_0x2d242a,null))[_0x4dfc('0x1e')](handleError(_0x2d242a,null));};exports[_0x4dfc('0xda')]=function(_0x28b042,_0x467a9a){var _0xb75b73={};var _0x36025f={};var _0x11ce66;var _0x447f8f;return db[_0x4dfc('0x3d')][_0x4dfc('0xca')]({'where':{'id':_0x28b042[_0x4dfc('0x51')]['id']}})[_0x4dfc('0x29')](handleEntityNotFound(_0x467a9a,null))[_0x4dfc('0x29')](function(_0x5a7a1f){if(_0x5a7a1f){_0x11ce66=_0x5a7a1f;_0x36025f[_0x4dfc('0x52')]=_[_0x4dfc('0x54')](db[_0x4dfc('0xdb')][_0x4dfc('0x55')]);_0x36025f[_0x4dfc('0x41')]=_['keys'](_0x28b042[_0x4dfc('0x41')]);_0x36025f[_0x4dfc('0x57')]=_[_0x4dfc('0x58')](_0x36025f['model'],_0x36025f[_0x4dfc('0x41')]);_0xb75b73[_0x4dfc('0x46')]=_[_0x4dfc('0x58')](_0x36025f['model'],qs[_0x4dfc('0x59')](_0x28b042[_0x4dfc('0x41')][_0x4dfc('0x59')]));_0xb75b73[_0x4dfc('0x46')]=_0xb75b73[_0x4dfc('0x46')]['length']?_0xb75b73['attributes']:_0x36025f[_0x4dfc('0x52')];_0xb75b73[_0x4dfc('0xcb')]=qs[_0x4dfc('0xcc')](_0x28b042[_0x4dfc('0x41')][_0x4dfc('0xcc')]);_0xb75b73[_0x4dfc('0xcd')]=qs[_0x4dfc('0x57')](_[_0x4dfc('0xce')](_0x28b042['query'],_0x36025f[_0x4dfc('0x57')]));if(_0x28b042[_0x4dfc('0x41')][_0x4dfc('0x34')]){_0xb75b73[_0x4dfc('0xcd')]=_[_0x4dfc('0x5c')](_0xb75b73[_0x4dfc('0xcd')],{'$or':_[_0x4dfc('0x36')](_0xb75b73['attributes'],function(_0x5a8e37){var _0x28799a={};_0x28799a[_0x5a8e37]={'$like':'%'+_0x28b042[_0x4dfc('0x41')][_0x4dfc('0x34')]+'%'};return _0x28799a;})});}_0xb75b73=_[_0x4dfc('0x5c')]({},_0xb75b73,_0x28b042[_0x4dfc('0x5d')]);return _0x11ce66[_0x4dfc('0xda')](_0xb75b73);}})[_0x4dfc('0x29')](function(_0x9451ff){if(_0x9451ff){_0x447f8f=_0x9451ff['length'];if(!_0x28b042[_0x4dfc('0x41')][_0x4dfc('0xcf')](_0x4dfc('0xd4'))){_0xb75b73[_0x4dfc('0x25')]=qs['limit'](_0x28b042[_0x4dfc('0x41')][_0x4dfc('0x25')]);_0xb75b73[_0x4dfc('0x23')]=qs['offset'](_0x28b042[_0x4dfc('0x41')][_0x4dfc('0x23')]);}return _0x11ce66[_0x4dfc('0xda')](_0xb75b73);}})['then'](function(_0x3d0c6d){if(_0x3d0c6d){return _0x3d0c6d?{'count':_0x447f8f,'rows':_0x3d0c6d}:null;}})[_0x4dfc('0x29')](respondWithResult(_0x467a9a,null))[_0x4dfc('0x1e')](handleError(_0x467a9a,null));};exports[_0x4dfc('0xdc')]=function(_0x4de263,_0x40ef6a){var _0x4d9727={'raw':!![],'where':{}};var _0x382678={};var _0x186556={'count':0x0,'rows':[]};return db[_0x4dfc('0x3d')][_0x4dfc('0xca')]({'where':{'id':_0x4de263[_0x4dfc('0x51')]['id']}})[_0x4dfc('0x29')](handleEntityNotFound(_0x40ef6a,null))[_0x4dfc('0x29')](function(_0x352a46){if(_0x352a46){_0x382678[_0x4dfc('0x52')]=_['keys'](db[_0x4dfc('0xdd')]['rawAttributes']);_0x382678[_0x4dfc('0x41')]=_[_0x4dfc('0x54')](_0x4de263['query']);_0x382678[_0x4dfc('0x57')]=_[_0x4dfc('0x58')](_0x382678['model'],_0x382678[_0x4dfc('0x41')]);_0x4d9727[_0x4dfc('0x46')]=_['intersection'](_0x382678['model'],qs[_0x4dfc('0x59')](_0x4de263[_0x4dfc('0x41')]['fields']));_0x4d9727[_0x4dfc('0x46')]=_0x4d9727[_0x4dfc('0x46')][_0x4dfc('0x5a')]?_0x4d9727['attributes']:_0x382678['model'];if(!_0x4de263[_0x4dfc('0x41')][_0x4dfc('0xcf')](_0x4dfc('0xd4'))){_0x4d9727['limit']=qs[_0x4dfc('0x25')](_0x4de263[_0x4dfc('0x41')][_0x4dfc('0x25')]);_0x4d9727[_0x4dfc('0x23')]=qs['offset'](_0x4de263['query'][_0x4dfc('0x23')]);}_0x4d9727[_0x4dfc('0xcb')]=qs[_0x4dfc('0xcc')](_0x4de263[_0x4dfc('0x41')][_0x4dfc('0xcc')]);_0x4d9727[_0x4dfc('0xcd')]=qs[_0x4dfc('0x57')](_[_0x4dfc('0xce')](_0x4de263[_0x4dfc('0x41')],_0x382678[_0x4dfc('0x57')]));_0x4d9727[_0x4dfc('0xcd')]['UserId']=_0x352a46['id'];if(_0x4de263[_0x4dfc('0x41')]['filter']){_0x4d9727['where']=_[_0x4dfc('0x5c')](_0x4d9727[_0x4dfc('0xcd')],{'$or':_[_0x4dfc('0x36')](_0x4d9727[_0x4dfc('0x46')],function(_0x2b561a){var _0x4f4e02={};_0x4f4e02[_0x2b561a]={'$like':'%'+_0x4de263['query'][_0x4dfc('0x34')]+'%'};return _0x4f4e02;})});}_0x4d9727=_[_0x4dfc('0x5c')]({},_0x4d9727,_0x4de263['options']);return db[_0x4dfc('0xdd')][_0x4dfc('0x26')]({'where':_0x4d9727[_0x4dfc('0xcd')]})[_0x4dfc('0x29')](function(_0x1a7b00){_0x186556[_0x4dfc('0x26')]=_0x1a7b00;if(_0x4de263[_0x4dfc('0x41')][_0x4dfc('0x42')]){_0x4d9727[_0x4dfc('0x43')]=[{'all':!![]}];}return db[_0x4dfc('0xdd')][_0x4dfc('0x48')](_0x4d9727);})['then'](function(_0x417359){_0x186556[_0x4dfc('0x49')]=_0x417359;return _0x186556;});}})[_0x4dfc('0x29')](respondWithFilteredResult(_0x40ef6a,_0x4d9727))[_0x4dfc('0x1e')](handleError(_0x40ef6a,null));};exports[_0x4dfc('0xde')]=function(_0x48ccea,_0x1b4718){var _0x361dd3={'raw':!![],'where':{}};var _0xedc776={};var _0x5a491b={'count':0x0,'rows':[]};return db['User'][_0x4dfc('0xca')]({'where':{'id':_0x48ccea[_0x4dfc('0x51')]['id']}})['then'](handleEntityNotFound(_0x1b4718,null))['then'](function(_0x3d40b8){if(_0x3d40b8){_0xedc776['model']=_[_0x4dfc('0x54')](db[_0x4dfc('0xdf')][_0x4dfc('0x55')]);_0xedc776['query']=_[_0x4dfc('0x54')](_0x48ccea[_0x4dfc('0x41')]);_0xedc776[_0x4dfc('0x57')]=_['intersection'](_0xedc776[_0x4dfc('0x52')],_0xedc776[_0x4dfc('0x41')]);_0x361dd3[_0x4dfc('0x46')]=_['intersection'](_0xedc776[_0x4dfc('0x52')],qs[_0x4dfc('0x59')](_0x48ccea[_0x4dfc('0x41')][_0x4dfc('0x59')]));_0x361dd3[_0x4dfc('0x46')]=_0x361dd3['attributes'][_0x4dfc('0x5a')]?_0x361dd3['attributes']:_0xedc776[_0x4dfc('0x52')];if(!_0x48ccea[_0x4dfc('0x41')][_0x4dfc('0xcf')]('nolimit')){_0x361dd3[_0x4dfc('0x25')]=qs[_0x4dfc('0x25')](_0x48ccea[_0x4dfc('0x41')][_0x4dfc('0x25')]);_0x361dd3[_0x4dfc('0x23')]=qs[_0x4dfc('0x23')](_0x48ccea['query'][_0x4dfc('0x23')]);}_0x361dd3['order']=qs[_0x4dfc('0xcc')](_0x48ccea[_0x4dfc('0x41')][_0x4dfc('0xcc')]);_0x361dd3[_0x4dfc('0xcd')]=qs[_0x4dfc('0x57')](_['pick'](_0x48ccea['query'],_0xedc776[_0x4dfc('0x57')]));_0x361dd3['where'][_0x4dfc('0xe0')]=_0x3d40b8['id'];if(_0x48ccea[_0x4dfc('0x41')]['filter']){_0x361dd3['where']=_['merge'](_0x361dd3[_0x4dfc('0xcd')],{'$or':_[_0x4dfc('0x36')](_0x361dd3['attributes'],function(_0x1f8e5c){var _0x5b481a={};_0x5b481a[_0x1f8e5c]={'$like':'%'+_0x48ccea['query'][_0x4dfc('0x34')]+'%'};return _0x5b481a;})});}_0x361dd3=_[_0x4dfc('0x5c')]({},_0x361dd3,_0x48ccea['options']);return db[_0x4dfc('0xdf')]['count']({'where':_0x361dd3[_0x4dfc('0xcd')]})[_0x4dfc('0x29')](function(_0x34a7a5){_0x5a491b[_0x4dfc('0x26')]=_0x34a7a5;if(_0x48ccea['query']['includeAll']){_0x361dd3[_0x4dfc('0x43')]=[{'all':!![]}];}return db['ScreenRecording'][_0x4dfc('0x48')](_0x361dd3);})[_0x4dfc('0x29')](function(_0x454182){_0x5a491b['rows']=_0x454182;return _0x5a491b;});}})['then'](respondWithFilteredResult(_0x1b4718,_0x361dd3))['catch'](handleError(_0x1b4718,null));};exports[_0x4dfc('0xe1')]=function(_0x3eca92,_0x1067b9){var _0x467f9e={};var _0x2cf6a1={};var _0x3e9f8f;var _0x672f7f;return db['User']['findOne']({'where':{'id':_0x3eca92[_0x4dfc('0x51')]['id']}})['then'](handleEntityNotFound(_0x1067b9,null))[_0x4dfc('0x29')](function(_0xfc224a){if(_0xfc224a){_0x3e9f8f=_0xfc224a;_0x2cf6a1[_0x4dfc('0x52')]=_['keys'](db['ChatInteraction'][_0x4dfc('0x55')]);_0x2cf6a1['query']=_[_0x4dfc('0x54')](_0x3eca92[_0x4dfc('0x41')]);_0x2cf6a1[_0x4dfc('0x57')]=_['intersection'](_0x2cf6a1['model'],_0x2cf6a1['query']);_0x467f9e[_0x4dfc('0x46')]=_['intersection'](_0x2cf6a1[_0x4dfc('0x52')],qs[_0x4dfc('0x59')](_0x3eca92[_0x4dfc('0x41')]['fields']));_0x467f9e[_0x4dfc('0x46')]=_0x467f9e[_0x4dfc('0x46')][_0x4dfc('0x5a')]?_0x467f9e[_0x4dfc('0x46')]:_0x2cf6a1['model'];_0x467f9e[_0x4dfc('0xcb')]=qs[_0x4dfc('0xcc')](_0x3eca92[_0x4dfc('0x41')]['sort']);_0x467f9e[_0x4dfc('0xcd')]=qs[_0x4dfc('0x57')](_['pick'](_0x3eca92[_0x4dfc('0x41')],_0x2cf6a1['filters']));if(_0x3eca92['query'][_0x4dfc('0x34')]){_0x467f9e[_0x4dfc('0xcd')]=_[_0x4dfc('0x5c')](_0x467f9e[_0x4dfc('0xcd')],{'$or':_[_0x4dfc('0x36')](_0x467f9e[_0x4dfc('0x46')],function(_0x5085de){var _0x56c54a={};_0x56c54a[_0x5085de]={'$like':'%'+_0x3eca92[_0x4dfc('0x41')][_0x4dfc('0x34')]+'%'};return _0x56c54a;})});}_0x467f9e=_[_0x4dfc('0x5c')]({},_0x467f9e,_0x3eca92['options']);return _0x3e9f8f[_0x4dfc('0xe1')](_0x467f9e);}})[_0x4dfc('0x29')](function(_0xa37e58){if(_0xa37e58){_0x672f7f=_0xa37e58[_0x4dfc('0x5a')];if(!_0x3eca92['query'][_0x4dfc('0xcf')](_0x4dfc('0xd4'))){_0x467f9e[_0x4dfc('0x25')]=qs[_0x4dfc('0x25')](_0x3eca92[_0x4dfc('0x41')]['limit']);_0x467f9e['offset']=qs[_0x4dfc('0x23')](_0x3eca92['query'][_0x4dfc('0x23')]);}return _0x3e9f8f['getChatInteractions'](_0x467f9e);}})[_0x4dfc('0x29')](function(_0x376352){if(_0x376352){return _0x376352?{'count':_0x672f7f,'rows':_0x376352}:null;}})[_0x4dfc('0x29')](respondWithResult(_0x1067b9,null))[_0x4dfc('0x1e')](handleError(_0x1067b9,null));};exports[_0x4dfc('0xe2')]=function(_0x5bc96c,_0x2e01ae){var _0x19c1d3={};var _0x3e95a2={};var _0x2a5258;var _0x318d14;return db['User']['findOne']({'where':{'id':_0x5bc96c['params']['id']}})['then'](handleEntityNotFound(_0x2e01ae,null))[_0x4dfc('0x29')](function(_0x58cf0e){if(_0x58cf0e){_0x2a5258=_0x58cf0e;_0x3e95a2[_0x4dfc('0x52')]=_['keys'](db[_0x4dfc('0xe3')]['rawAttributes']);_0x3e95a2[_0x4dfc('0x41')]=_['keys'](_0x5bc96c['query']);_0x3e95a2[_0x4dfc('0x57')]=_[_0x4dfc('0x58')](_0x3e95a2[_0x4dfc('0x52')],_0x3e95a2[_0x4dfc('0x41')]);_0x19c1d3[_0x4dfc('0x46')]=_['intersection'](_0x3e95a2[_0x4dfc('0x52')],qs[_0x4dfc('0x59')](_0x5bc96c[_0x4dfc('0x41')]['fields']));_0x19c1d3['attributes']=_0x19c1d3[_0x4dfc('0x46')][_0x4dfc('0x5a')]?_0x19c1d3[_0x4dfc('0x46')]:_0x3e95a2[_0x4dfc('0x52')];_0x19c1d3['order']=qs[_0x4dfc('0xcc')](_0x5bc96c['query']['sort']);_0x19c1d3['where']=qs[_0x4dfc('0x57')](_['pick'](_0x5bc96c['query'],_0x3e95a2[_0x4dfc('0x57')]));if(_0x5bc96c[_0x4dfc('0x41')][_0x4dfc('0x34')]){_0x19c1d3[_0x4dfc('0xcd')]=_[_0x4dfc('0x5c')](_0x19c1d3[_0x4dfc('0xcd')],{'$or':_['map'](_0x19c1d3[_0x4dfc('0x46')],function(_0x44c876){var _0x3c20a7={};_0x3c20a7[_0x44c876]={'$like':'%'+_0x5bc96c[_0x4dfc('0x41')][_0x4dfc('0x34')]+'%'};return _0x3c20a7;})});}_0x19c1d3=_[_0x4dfc('0x5c')]({},_0x19c1d3,_0x5bc96c[_0x4dfc('0x5d')]);return _0x2a5258[_0x4dfc('0xe2')](_0x19c1d3);}})[_0x4dfc('0x29')](function(_0x4a59c6){if(_0x4a59c6){_0x318d14=_0x4a59c6['length'];if(!_0x5bc96c['query']['hasOwnProperty'](_0x4dfc('0xd4'))){_0x19c1d3[_0x4dfc('0x25')]=qs['limit'](_0x5bc96c[_0x4dfc('0x41')]['limit']);_0x19c1d3['offset']=qs['offset'](_0x5bc96c[_0x4dfc('0x41')][_0x4dfc('0x23')]);}return _0x2a5258[_0x4dfc('0xe2')](_0x19c1d3);}})[_0x4dfc('0x29')](function(_0x4eb05b){if(_0x4eb05b){return _0x4eb05b?{'count':_0x318d14,'rows':_0x4eb05b}:null;}})['then'](respondWithResult(_0x2e01ae,null))[_0x4dfc('0x1e')](handleError(_0x2e01ae,null));};exports['getMailInteractions']=function(_0x4a8101,_0x472e5e){var _0x5ca789={'raw':!![],'where':{}};var _0x424573={};var _0x3e0ca5={'count':0x0,'rows':[]};return db['User'][_0x4dfc('0xca')]({'where':{'id':_0x4a8101[_0x4dfc('0x51')]['id']}})[_0x4dfc('0x29')](handleEntityNotFound(_0x472e5e,null))[_0x4dfc('0x29')](function(_0x4a207d){if(_0x4a207d){_0x424573[_0x4dfc('0x52')]=_[_0x4dfc('0x54')](db[_0x4dfc('0xe4')][_0x4dfc('0x55')]);_0x424573[_0x4dfc('0x41')]=_['keys'](_0x4a8101[_0x4dfc('0x41')]);_0x424573['filters']=_[_0x4dfc('0x58')](_0x424573[_0x4dfc('0x52')],_0x424573['query']);_0x5ca789[_0x4dfc('0x46')]=_['intersection'](_0x424573['model'],qs[_0x4dfc('0x59')](_0x4a8101[_0x4dfc('0x41')][_0x4dfc('0x59')]));_0x5ca789[_0x4dfc('0x46')]=_0x5ca789[_0x4dfc('0x46')][_0x4dfc('0x5a')]?_0x5ca789[_0x4dfc('0x46')]:_0x424573[_0x4dfc('0x52')];if(!_0x4a8101[_0x4dfc('0x41')]['hasOwnProperty']('nolimit')){_0x5ca789['limit']=qs[_0x4dfc('0x25')](_0x4a8101[_0x4dfc('0x41')][_0x4dfc('0x25')]);_0x5ca789[_0x4dfc('0x23')]=qs[_0x4dfc('0x23')](_0x4a8101[_0x4dfc('0x41')]['offset']);}_0x5ca789[_0x4dfc('0xcb')]=qs[_0x4dfc('0xcc')](_0x4a8101[_0x4dfc('0x41')][_0x4dfc('0xcc')]);_0x5ca789[_0x4dfc('0xcd')]=qs[_0x4dfc('0x57')](_[_0x4dfc('0xce')](_0x4a8101[_0x4dfc('0x41')],_0x424573[_0x4dfc('0x57')]));_0x5ca789[_0x4dfc('0xcd')][_0x4dfc('0xe0')]=_0x4a207d['id'];if(_0x4a8101[_0x4dfc('0x41')]['filter']){_0x5ca789[_0x4dfc('0xcd')]=_[_0x4dfc('0x5c')](_0x5ca789[_0x4dfc('0xcd')],{'$or':_[_0x4dfc('0x36')](_0x5ca789['attributes'],function(_0x1b9b0c){var _0x433503={};_0x433503[_0x1b9b0c]={'$like':'%'+_0x4a8101[_0x4dfc('0x41')][_0x4dfc('0x34')]+'%'};return _0x433503;})});}_0x5ca789=_[_0x4dfc('0x5c')]({},_0x5ca789,_0x4a8101[_0x4dfc('0x5d')]);return db[_0x4dfc('0xe4')][_0x4dfc('0x26')]({'where':_0x5ca789[_0x4dfc('0xcd')]})[_0x4dfc('0x29')](function(_0x1a88c6){_0x3e0ca5[_0x4dfc('0x26')]=_0x1a88c6;if(_0x4a8101['query'][_0x4dfc('0x42')]){_0x5ca789['include']=[{'all':!![]}];}return db[_0x4dfc('0xe4')][_0x4dfc('0x48')](_0x5ca789);})[_0x4dfc('0x29')](function(_0x350395){_0x3e0ca5[_0x4dfc('0x49')]=_0x350395;return _0x3e0ca5;});}})[_0x4dfc('0x29')](respondWithFilteredResult(_0x472e5e,_0x5ca789))[_0x4dfc('0x1e')](handleError(_0x472e5e,null));};exports[_0x4dfc('0xe5')]=function(_0x352584,_0x4795f6){var _0x4df493={};var _0x501263={};var _0x1a51d0;var _0x1b067f;return db['User']['findOne']({'where':{'id':_0x352584[_0x4dfc('0x51')]['id']}})[_0x4dfc('0x29')](handleEntityNotFound(_0x4795f6,null))['then'](function(_0x4181ed){if(_0x4181ed){_0x1a51d0=_0x4181ed;_0x501263[_0x4dfc('0x52')]=_['keys'](db[_0x4dfc('0xe6')][_0x4dfc('0x55')]);_0x501263[_0x4dfc('0x41')]=_[_0x4dfc('0x54')](_0x352584['query']);_0x501263[_0x4dfc('0x57')]=_[_0x4dfc('0x58')](_0x501263[_0x4dfc('0x52')],_0x501263['query']);_0x4df493['attributes']=_[_0x4dfc('0x58')](_0x501263[_0x4dfc('0x52')],qs[_0x4dfc('0x59')](_0x352584[_0x4dfc('0x41')][_0x4dfc('0x59')]));_0x4df493['attributes']=_0x4df493[_0x4dfc('0x46')]['length']?_0x4df493[_0x4dfc('0x46')]:_0x501263[_0x4dfc('0x52')];_0x4df493[_0x4dfc('0xcb')]=qs[_0x4dfc('0xcc')](_0x352584[_0x4dfc('0x41')][_0x4dfc('0xcc')]);_0x4df493[_0x4dfc('0xcd')]=qs[_0x4dfc('0x57')](_[_0x4dfc('0xce')](_0x352584[_0x4dfc('0x41')],_0x501263[_0x4dfc('0x57')]));if(_0x352584[_0x4dfc('0x41')]['filter']){_0x4df493[_0x4dfc('0xcd')]=_[_0x4dfc('0x5c')](_0x4df493[_0x4dfc('0xcd')],{'$or':_['map'](_0x4df493[_0x4dfc('0x46')],function(_0x514b22){var _0x2b6372={};_0x2b6372[_0x514b22]={'$like':'%'+_0x352584[_0x4dfc('0x41')][_0x4dfc('0x34')]+'%'};return _0x2b6372;})});}_0x4df493=_[_0x4dfc('0x5c')]({},_0x4df493,_0x352584['options']);return _0x1a51d0['getSmsInteractions'](_0x4df493);}})['then'](function(_0x5a6b8e){if(_0x5a6b8e){_0x1b067f=_0x5a6b8e[_0x4dfc('0x5a')];if(!_0x352584[_0x4dfc('0x41')][_0x4dfc('0xcf')](_0x4dfc('0xd4'))){_0x4df493[_0x4dfc('0x25')]=qs[_0x4dfc('0x25')](_0x352584[_0x4dfc('0x41')]['limit']);_0x4df493['offset']=qs[_0x4dfc('0x23')](_0x352584['query'][_0x4dfc('0x23')]);}return _0x1a51d0[_0x4dfc('0xe5')](_0x4df493);}})[_0x4dfc('0x29')](function(_0x2ec25a){if(_0x2ec25a){return _0x2ec25a?{'count':_0x1b067f,'rows':_0x2ec25a}:null;}})[_0x4dfc('0x29')](respondWithResult(_0x4795f6,null))['catch'](handleError(_0x4795f6,null));};exports[_0x4dfc('0xe7')]=function(_0x173cac,_0x416719){var _0x3ae3ac={};var _0x46257a={};var _0x1c6f47;var _0x5c9f97;return db[_0x4dfc('0x3d')][_0x4dfc('0xca')]({'where':{'id':_0x173cac[_0x4dfc('0x51')]['id']}})[_0x4dfc('0x29')](handleEntityNotFound(_0x416719,null))[_0x4dfc('0x29')](function(_0x5486e8){if(_0x5486e8){_0x1c6f47=_0x5486e8;_0x46257a['model']=_[_0x4dfc('0x54')](db[_0x4dfc('0xe8')]['rawAttributes']);_0x46257a[_0x4dfc('0x41')]=_['keys'](_0x173cac[_0x4dfc('0x41')]);_0x46257a[_0x4dfc('0x57')]=_[_0x4dfc('0x58')](_0x46257a[_0x4dfc('0x52')],_0x46257a[_0x4dfc('0x41')]);_0x3ae3ac[_0x4dfc('0x46')]=_[_0x4dfc('0x58')](_0x46257a['model'],qs[_0x4dfc('0x59')](_0x173cac['query'][_0x4dfc('0x59')]));_0x3ae3ac[_0x4dfc('0x46')]=_0x3ae3ac[_0x4dfc('0x46')][_0x4dfc('0x5a')]?_0x3ae3ac[_0x4dfc('0x46')]:_0x46257a[_0x4dfc('0x52')];_0x3ae3ac[_0x4dfc('0xcb')]=qs[_0x4dfc('0xcc')](_0x173cac['query'][_0x4dfc('0xcc')]);_0x3ae3ac[_0x4dfc('0xcd')]=qs['filters'](_[_0x4dfc('0xce')](_0x173cac[_0x4dfc('0x41')],_0x46257a[_0x4dfc('0x57')]));if(_0x173cac[_0x4dfc('0x41')]['filter']){_0x3ae3ac[_0x4dfc('0xcd')]=_[_0x4dfc('0x5c')](_0x3ae3ac[_0x4dfc('0xcd')],{'$or':_[_0x4dfc('0x36')](_0x3ae3ac[_0x4dfc('0x46')],function(_0x3a983){var _0x13ce3d={};_0x13ce3d[_0x3a983]={'$like':'%'+_0x173cac[_0x4dfc('0x41')][_0x4dfc('0x34')]+'%'};return _0x13ce3d;})});}_0x3ae3ac=_[_0x4dfc('0x5c')]({},_0x3ae3ac,_0x173cac[_0x4dfc('0x5d')]);return _0x1c6f47[_0x4dfc('0xe7')](_0x3ae3ac);}})['then'](function(_0x2c4007){if(_0x2c4007){_0x5c9f97=_0x2c4007[_0x4dfc('0x5a')];if(!_0x173cac[_0x4dfc('0x41')]['hasOwnProperty'](_0x4dfc('0xd4'))){_0x3ae3ac[_0x4dfc('0x25')]=qs[_0x4dfc('0x25')](_0x173cac[_0x4dfc('0x41')][_0x4dfc('0x25')]);_0x3ae3ac['offset']=qs['offset'](_0x173cac[_0x4dfc('0x41')][_0x4dfc('0x23')]);}return _0x1c6f47['getFaxInteractions'](_0x3ae3ac);}})[_0x4dfc('0x29')](function(_0x3b1940){if(_0x3b1940){return _0x3b1940?{'count':_0x5c9f97,'rows':_0x3b1940}:null;}})['then'](respondWithResult(_0x416719,null))[_0x4dfc('0x1e')](handleError(_0x416719,null));};exports[_0x4dfc('0xe9')]=function(_0x3af153,_0x430b2e){var _0x422111={};var _0x1eebc9={};var _0xa90e97;var _0x396e07;return db[_0x4dfc('0x3d')]['findOne']({'where':{'id':_0x3af153['params']['id']}})[_0x4dfc('0x29')](handleEntityNotFound(_0x430b2e,null))[_0x4dfc('0x29')](function(_0x5d1825){if(_0x5d1825){_0xa90e97=_0x5d1825;_0x1eebc9['model']=_[_0x4dfc('0x54')](db[_0x4dfc('0xea')]['rawAttributes']);_0x1eebc9[_0x4dfc('0x41')]=_[_0x4dfc('0x54')](_0x3af153[_0x4dfc('0x41')]);_0x1eebc9[_0x4dfc('0x57')]=_[_0x4dfc('0x58')](_0x1eebc9[_0x4dfc('0x52')],_0x1eebc9[_0x4dfc('0x41')]);_0x422111[_0x4dfc('0x46')]=_['intersection'](_0x1eebc9[_0x4dfc('0x52')],qs[_0x4dfc('0x59')](_0x3af153[_0x4dfc('0x41')][_0x4dfc('0x59')]));_0x422111[_0x4dfc('0x46')]=_0x422111['attributes'][_0x4dfc('0x5a')]?_0x422111['attributes']:_0x1eebc9[_0x4dfc('0x52')];_0x422111[_0x4dfc('0xcb')]=qs[_0x4dfc('0xcc')](_0x3af153['query']['sort']);_0x422111['where']=qs['filters'](_[_0x4dfc('0xce')](_0x3af153[_0x4dfc('0x41')],_0x1eebc9[_0x4dfc('0x57')]));if(_0x3af153['query'][_0x4dfc('0x34')]){_0x422111[_0x4dfc('0xcd')]=_[_0x4dfc('0x5c')](_0x422111[_0x4dfc('0xcd')],{'$or':_[_0x4dfc('0x36')](_0x422111[_0x4dfc('0x46')],function(_0x2e1e64){var _0x1304ca={};_0x1304ca[_0x2e1e64]={'$like':'%'+_0x3af153[_0x4dfc('0x41')][_0x4dfc('0x34')]+'%'};return _0x1304ca;})});}_0x422111=_[_0x4dfc('0x5c')]({},_0x422111,_0x3af153['options']);return _0xa90e97[_0x4dfc('0xe9')](_0x422111);}})[_0x4dfc('0x29')](function(_0x130d5e){if(_0x130d5e){_0x396e07=_0x130d5e[_0x4dfc('0x5a')];if(!_0x3af153['query'][_0x4dfc('0xcf')]('nolimit')){_0x422111[_0x4dfc('0x25')]=qs['limit'](_0x3af153[_0x4dfc('0x41')][_0x4dfc('0x25')]);_0x422111[_0x4dfc('0x23')]=qs[_0x4dfc('0x23')](_0x3af153[_0x4dfc('0x41')][_0x4dfc('0x23')]);}return _0xa90e97['getWhatsappInteractions'](_0x422111);}})[_0x4dfc('0x29')](function(_0x3c0681){if(_0x3c0681){return _0x3c0681?{'count':_0x396e07,'rows':_0x3c0681}:null;}})[_0x4dfc('0x29')](respondWithResult(_0x430b2e,null))[_0x4dfc('0x1e')](handleError(_0x430b2e,null));};exports[_0x4dfc('0xeb')]=function(_0x34474f,_0x18853c,_0xf6856c){var _0x4f6400;var _0x1a1efc;var _0x26383f;var _0xd5224f=!_[_0x4dfc('0x69')](_0x34474f[_0x4dfc('0x51')]['id'])?_0x34474f['params']['id']:!_[_0x4dfc('0x69')](_0x34474f[_0x4dfc('0x30')]['id'])?_0x34474f['user']['id']:null;return db[_0x4dfc('0x3d')][_0x4dfc('0x62')]({'where':{'id':_0xd5224f,'role':{'$or':['admin','user','agent']}},'attributes':['id',_0x4dfc('0x39'),_0x4dfc('0xec'),'mobile','role',_0x4dfc('0x6a'),_0x4dfc('0xa0')]})[_0x4dfc('0x29')](function(_0x89a35e){if(_0x89a35e){if(_0x89a35e[_0x4dfc('0x2d')]==='agent'){_0x4f6400=_0x89a35e;if(_0x34474f[_0x4dfc('0x61')][_0x4dfc('0xa2')]){_0x26383f=util[_0x4dfc('0xed')](_0x4dfc('0xee'),_0x4f6400[_0x34474f[_0x4dfc('0x61')][_0x4dfc('0xa2')]]);}else if(_0x34474f[_0x4dfc('0x61')][_0x4dfc('0xef')]){_0x26383f=util[_0x4dfc('0xed')](_0x4dfc('0xa9'),_0x34474f[_0x4dfc('0x61')]['intrf']);}else{_0x26383f=util['format'](_0x4dfc('0xa9'),_0x4f6400['name']);}socket['to'](util['format'](_0x4dfc('0xf0'),_0x4f6400['name']))[_0x4dfc('0x2a')](_0x4dfc('0xf1'),{'user':{'id':_0x4f6400['id'],'name':_0x4f6400[_0x4dfc('0x39')]},'ip':_0x34474f[_0x4dfc('0xf2')][_0x4dfc('0xf3')]||_0x34474f[_0x4dfc('0xf4')]['remoteAddress']||_0x34474f[_0x4dfc('0xf5')][_0x4dfc('0xf6')]||_0x34474f[_0x4dfc('0xf4')][_0x4dfc('0xf5')][_0x4dfc('0xf6')]});return db['UserVoiceQueueRt'][_0x4dfc('0xb2')]({'where':{'membername':_0x4f6400[_0x4dfc('0x39')]},'individualHooks':!![]});}}else{throw new db[(_0x4dfc('0x91'))][(_0x4dfc('0x94'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x4dfc('0x29')](function(){if(_0x4f6400){return _0x4f6400[_0x4dfc('0xf7')]({'raw':!![]});}})[_0x4dfc('0x29')](function(_0x2e664f){if(_0x4f6400){if(_0x2e664f){_0x1a1efc=_0x2e664f;if(_0x1a1efc[_0x4dfc('0x5a')]){var _0x1a74d2=_0x1a1efc['map'](function(_0x27b464){var _0xdc7422={'membername':_0x4f6400[_0x4dfc('0x39')],'UserId':_0x4f6400['id'],'queue_name':_0x27b464['name'],'VoiceQueueId':_0x27b464['id'],'interface':_0x26383f,'paused':_0x4f6400[_0x4dfc('0xa0')]||![],'penalty':_0x27b464[_0x4dfc('0xf8')]||0x0};return db['UserVoiceQueueRt']['upsert'](_0xdc7422);});return Promise[_0x4dfc('0x60')](_0x1a74d2);}}}})[_0x4dfc('0x29')](function(){if(_0x4f6400){return db[_0x4dfc('0xf9')][_0x4dfc('0x48')]({'where':{'membername':_0x4f6400['name'],'exitAt':null}});}})[_0x4dfc('0x29')](function(_0x3892fc){if(_0x4f6400){var _0x2ff78b=[];_0x3892fc[_0x4dfc('0xfa')](function(_0x2e0bfc){_0x2ff78b['push'](_0x2e0bfc['update']({'exitAt':moment()['format'](_0x4dfc('0xfb'))}));});return Promise[_0x4dfc('0x60')](_0x2ff78b);}})[_0x4dfc('0x29')](function(){if(_0x4f6400){var _0x2d61f8=[];var _0x7cf2eb=[];var _0x6219b7=utils[_0x4dfc('0xfc')]();var _0x40cfd9={'membername':_0x4f6400[_0x4dfc('0x39')],'interface':_0x26383f,'enterAt':moment()[_0x4dfc('0xed')](_0x4dfc('0xfb')),'role':_0x4f6400[_0x4dfc('0x2d')],'internal':_0x4f6400[_0x4dfc('0x6a')]};_0x6219b7['forEach'](function(_0x5f55ee){_0x2d61f8['push'](_[_0x4dfc('0x5c')]({'channel':_0x5f55ee,'type':_0x4dfc('0xfd'),'data1':_0x34474f[_0x4dfc('0x61')][_0x4dfc('0xfe')],'data2':_0x26383f},_0x40cfd9));if(_0x4f6400[_0x4dfc('0xa0')]){_0x7cf2eb[_0x4dfc('0x47')](_[_0x4dfc('0x5c')]({'channel':_0x5f55ee,'type':'PAUSE','data1':_0x4dfc('0xff')},_0x40cfd9));}});return db[_0x4dfc('0xf9')]['bulkCreate'](_0x2d61f8[_0x4dfc('0x100')](_0x7cf2eb),{'individualHooks':!![]});}})[_0x4dfc('0x29')](function(){if(_0x4f6400){return _0x4f6400[_0x4dfc('0x28')]({'online':!![],'lastLoginAt':moment()[_0x4dfc('0xed')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4f6400['loginInPause']||![],'mailPause':_0x4f6400[_0x4dfc('0xa0')]||![],'chatPause':_0x4f6400[_0x4dfc('0xa0')]||![],'faxPause':_0x4f6400[_0x4dfc('0xa0')]||![],'smsPause':_0x4f6400[_0x4dfc('0xa0')]||![],'openchannelPause':_0x4f6400[_0x4dfc('0xa0')]||![],'whatsappPause':_0x4f6400[_0x4dfc('0xa0')]||![],'pauseType':_0x4f6400['loginInPause']?_0x4dfc('0xff'):null,'interface':_0x26383f,'lastPauseAt':moment()[_0x4dfc('0xed')](_0x4dfc('0xfb'))});}})['then'](function(_0x40b0fe){if(_0x34474f[_0x4dfc('0x101')]){return _0xf6856c();}else{return Promise[_0x4dfc('0x102')](_0x40b0fe)[_0x4dfc('0x29')](respondWithResult(_0x18853c,null));}})['catch'](handleError(_0x18853c,null));};exports['logout']=function(_0x1001cf,_0x155e3f){var _0x438ca7;return db[_0x4dfc('0x3d')][_0x4dfc('0x62')]({'where':{'id':_0x1001cf[_0x4dfc('0x51')]['id'],'role':'agent'},'attributes':['id',_0x4dfc('0x39'),'role']})[_0x4dfc('0x29')](handleEntityNotFound(_0x155e3f,null))['then'](function(_0x358c4f){if(_0x358c4f){_0x438ca7=_0x358c4f;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x438ca7[_0x4dfc('0x39')]},'individualHooks':!![]});}})[_0x4dfc('0x29')](function(){return db['MemberReport'][_0x4dfc('0x48')]({'where':{'membername':_0x438ca7[_0x4dfc('0x39')],'exitAt':null}});})[_0x4dfc('0x29')](function(_0x1f7b57){var _0x41896c=[];_0x1f7b57[_0x4dfc('0xfa')](function(_0x5c5a50){_0x41896c['push'](_0x5c5a50[_0x4dfc('0x28')]({'exitAt':moment()[_0x4dfc('0xed')](_0x4dfc('0xfb'))}));});return Promise['all'](_0x41896c);})[_0x4dfc('0x29')](function(){return _0x438ca7[_0x4dfc('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x4dfc('0x29')](respondWithResult(_0x155e3f,null))['catch'](handleError(_0x155e3f,null));};exports[_0x4dfc('0x103')]=function(_0x13086a,_0x1731d2){var _0x146f7b;return db[_0x4dfc('0xab')][_0x4dfc('0x28')]({'paused':0x1},{'where':{'UserId':_0x13086a[_0x4dfc('0x51')]['id']},'individualHooks':!![]})[_0x4dfc('0x29')](function(){return db['User']['find']({'where':{'id':_0x13086a[_0x4dfc('0x51')]['id'],'role':_0x4dfc('0x32')},'attributes':['id',_0x4dfc('0x39'),_0x4dfc('0x2d'),_0x4dfc('0x6a'),_0x4dfc('0xa2'),_0x4dfc('0x9f')]});})[_0x4dfc('0x29')](handleEntityNotFound(_0x1731d2,null))['then'](function(_0x5e00fd){if(_0x5e00fd){_0x146f7b=_0x5e00fd;return respondWithRpcPromise(_0x4dfc('0x104'),_0x4dfc('0x103'),{'id':_0x146f7b['id'],'name':_0x146f7b[_0x4dfc('0x39')],'pause':!![]});}})[_0x4dfc('0x29')](function(){if(_0x146f7b){return db[_0x4dfc('0xf9')]['findAll']({'where':{'membername':_0x146f7b['name'],'type':_0x4dfc('0x105'),'exitAt':null}});}})['then'](function(_0x21f016){if(_0x21f016['length']){var _0x937a4b=moment()[_0x4dfc('0xed')](_0x4dfc('0xfb'));for(var _0x584eea=0x0,_0x24d977=_0x21f016[_0x4dfc('0x5a')];_0x584eea<_0x24d977;_0x584eea++){_0x21f016[_0x584eea]['updateAttributes']({'exitAt':_0x937a4b});}}})['then'](function(){var _0x39fc2b=[];var _0x42722c=utils[_0x4dfc('0xfc')]();_0x42722c['forEach'](function(_0x13e3ac){_0x39fc2b['push']({'channel':_0x13e3ac,'membername':_0x146f7b[_0x4dfc('0x39')],'interface':_[_0x4dfc('0x69')](_0x146f7b['interface'])?util[_0x4dfc('0xed')](_0x4dfc('0xa9'),_0x146f7b[_0x4dfc('0x39')]):_0x146f7b[_0x4dfc('0xa2')],'type':_0x4dfc('0x105'),'enterAt':moment()[_0x4dfc('0xed')](_0x4dfc('0xfb')),'data1':_0x13086a[_0x4dfc('0x61')][_0x4dfc('0x106')]||_0x4dfc('0x107'),'role':_0x146f7b['role'],'internal':_0x146f7b[_0x4dfc('0x6a')]});});return db[_0x4dfc('0xf9')][_0x4dfc('0x88')](_0x39fc2b,{'individualHooks':!![]});})[_0x4dfc('0x29')](function(){return _0x146f7b['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x13086a[_0x4dfc('0x61')][_0x4dfc('0x106')]||_0x4dfc('0x107'),'lastPauseAt':moment()['format'](_0x4dfc('0xfb'))});})[_0x4dfc('0x29')](respondWithResult(_0x1731d2,null))[_0x4dfc('0x1e')](handleError(_0x1731d2,null));};exports['unpause']=function(_0x3c5505,_0x39014a){if(_0x3c5505[_0x4dfc('0x61')][_0x4dfc('0x9e')]&&!utils[_0x4dfc('0xa3')](_0x3c5505['body'][_0x4dfc('0x9e')])){throw new APIBadRequestError(util[_0x4dfc('0xed')](_0x4dfc('0x108'),_0x3c5505[_0x4dfc('0x61')][_0x4dfc('0x9e')]));}return db[_0x4dfc('0x3d')]['find']({'where':{'id':_0x3c5505[_0x4dfc('0x51')]['id']},'attributes':['id','name',_0x4dfc('0x2d'),_0x4dfc('0x6a'),'interface',_0x4dfc('0x9f'),_0x4dfc('0xa1'),'mailPause',_0x4dfc('0x109'),_0x4dfc('0x10a'),_0x4dfc('0x10b'),_0x4dfc('0x10c'),_0x4dfc('0x10d'),_0x4dfc('0x10e'),_0x4dfc('0x10f')]})[_0x4dfc('0x29')](function(_0x1cdaf8){if(!_0x1cdaf8){throw new APINotFoundError(util['format'](_0x4dfc('0x110'),_0x3c5505[_0x4dfc('0x51')]['id']));}return _0x1cdaf8['unpause'](_0x3c5505['body']['channel']);})['then'](respondWithResult(_0x39014a,null))[_0x4dfc('0x1e')](APIHandleError(_0x39014a));};exports[_0x4dfc('0x111')]=function(_0xe8696f,_0x498d6d){var _0x13f2f6={};var _0x2ca110={};var _0x284f51;var _0x3001e5;return db['User']['findOne']({'where':{'id':_0xe8696f[_0x4dfc('0x51')]['id']}})[_0x4dfc('0x29')](handleEntityNotFound(_0x498d6d,null))[_0x4dfc('0x29')](function(_0x4e6293){if(_0x4e6293){_0x284f51=_0x4e6293;_0x2ca110['model']=_['keys'](db['Team']['rawAttributes']);_0x2ca110['query']=_['keys'](_0xe8696f[_0x4dfc('0x41')]);_0x2ca110[_0x4dfc('0x57')]=_[_0x4dfc('0x58')](_0x2ca110['model'],_0x2ca110[_0x4dfc('0x41')]);_0x13f2f6[_0x4dfc('0x46')]=_['intersection'](_0x2ca110[_0x4dfc('0x52')],qs[_0x4dfc('0x59')](_0xe8696f[_0x4dfc('0x41')][_0x4dfc('0x59')]));_0x13f2f6[_0x4dfc('0x46')]=_0x13f2f6['attributes'][_0x4dfc('0x5a')]?_0x13f2f6['attributes']:_0x2ca110[_0x4dfc('0x52')];_0x13f2f6[_0x4dfc('0xcb')]=qs[_0x4dfc('0xcc')](_0xe8696f[_0x4dfc('0x41')]['sort']);_0x13f2f6['where']=qs['filters'](_['pick'](_0xe8696f[_0x4dfc('0x41')],_0x2ca110[_0x4dfc('0x57')]));if(_0xe8696f[_0x4dfc('0x41')][_0x4dfc('0x34')]){_0x13f2f6[_0x4dfc('0xcd')]=_['merge'](_0x13f2f6[_0x4dfc('0xcd')],{'$or':_[_0x4dfc('0x36')](_0x13f2f6[_0x4dfc('0x46')],function(_0x509ca0){var _0xed9c83={};_0xed9c83[_0x509ca0]={'$like':'%'+_0xe8696f['query'][_0x4dfc('0x34')]+'%'};return _0xed9c83;})});}_0x13f2f6=_[_0x4dfc('0x5c')]({},_0x13f2f6,_0xe8696f[_0x4dfc('0x5d')]);return _0x284f51[_0x4dfc('0x111')](_0x13f2f6);}})[_0x4dfc('0x29')](function(_0x1085f7){if(_0x1085f7){_0x3001e5=_0x1085f7['length'];if(!_0xe8696f[_0x4dfc('0x41')][_0x4dfc('0xcf')](_0x4dfc('0xd4'))){_0x13f2f6['limit']=qs[_0x4dfc('0x25')](_0xe8696f[_0x4dfc('0x41')][_0x4dfc('0x25')]);_0x13f2f6[_0x4dfc('0x23')]=qs[_0x4dfc('0x23')](_0xe8696f[_0x4dfc('0x41')][_0x4dfc('0x23')]);}return _0x284f51[_0x4dfc('0x111')](_0x13f2f6);}})[_0x4dfc('0x29')](function(_0xbfad5f){if(_0xbfad5f){return _0xbfad5f?{'count':_0x3001e5,'rows':_0xbfad5f}:null;}})['then'](respondWithResult(_0x498d6d,null))['catch'](handleError(_0x498d6d,null));};exports[_0x4dfc('0x112')]=function(_0x324022,_0x247e10){var _0x21866b=_0x324022[_0x4dfc('0x51')]['id'];var _0x593ea5=_0x324022[_0x4dfc('0x61')]?_0x324022[_0x4dfc('0x61')]['ids']:null;var _0x45107e=[];return Promise[_0x4dfc('0x102')]()[_0x4dfc('0x29')](function(){if(!_0x593ea5)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x4dfc('0x29')](function(){return db[_0x4dfc('0x3d')]['findOne']({'where':{'id':_0x21866b}});})[_0x4dfc('0x29')](function(_0x258696){if(!_0x258696)throw new APINotFoundError(util[_0x4dfc('0xed')](_0x4dfc('0x110'),_0x324022[_0x4dfc('0x51')]['id']));return db[_0x4dfc('0x6c')][_0x4dfc('0x113')](function(_0xa74d63){return _0x258696['addTeams'](_0x593ea5,{'transaction':_0xa74d63})[_0x4dfc('0x29')](function(){return db[_0x4dfc('0x114')]['findAll']({'where':{'id':{'$in':_0x593ea5}}});})['then'](function(_0x59e45f){var _0x398aba=_['map'](_0x59e45f,function(_0x56223b){return _0x56223b[_0x4dfc('0x115')]();});return Promise[_0x4dfc('0x60')](_0x398aba);})[_0x4dfc('0x29')](function(_0x241efe){_0x45107e=_[_0x4dfc('0x116')](_0x241efe);var _0x5288ec=_['map'](_0x45107e,function(_0x575bfc){return _0x575bfc[_0x4dfc('0x117')](_0x258696['id'],{'transaction':_0xa74d63});});return Promise[_0x4dfc('0x60')](_0x5288ec);})['then'](function(){if(!_0x258696['online'])return;var _0x3beb25=_[_0x4dfc('0x34')](_0x45107e,function(_0x28a0cd){return _0x28a0cd[_0x4dfc('0x118')](_0x4dfc('0x9e'))===_0x4dfc('0x119');});var _0x56f667=_[_0x4dfc('0x36')](_0x3beb25,function(_0x26d1b5){return db['UserVoiceQueueRt'][_0x4dfc('0xac')]({'membername':_0x258696[_0x4dfc('0x39')],'UserId':_0x258696['id'],'queue_name':_0x26d1b5[_0x4dfc('0x39')],'VoiceQueueId':_0x26d1b5['id'],'interface':_[_0x4dfc('0x69')](_0x258696[_0x4dfc('0xa2')])?util[_0x4dfc('0xed')](_0x4dfc('0xa9'),_0x258696[_0x4dfc('0x39')]):_0x258696['interface'],'paused':_0x258696[_0x4dfc('0xa1')]||![],'penalty':_0x258696[_0x4dfc('0xaa')]},{'transaction':_0xa74d63});});return Promise[_0x4dfc('0x60')](_0x56f667);})['then'](function(){return db[_0x4dfc('0x11a')][_0x4dfc('0x48')]({'where':{'teamId':{'$in':_0x593ea5}}});})['then'](function(_0x590be5){var _0x314bd6=_['map'](_0x590be5,function(_0x4eedb2){return db['UserVoicePrefix'][_0x4dfc('0x80')]({'UserId':_0x258696['id'],'VoicePrefixId':_0x4eedb2[_0x4dfc('0x11b')]},{'transaction':_0xa74d63});});return Promise['all'](_0x314bd6);});});})['then'](function(){for(var _0x23ba55=0x0;_0x23ba55<_0x45107e[_0x4dfc('0x5a')];_0x23ba55++){var _0x58a2be=_0x45107e[_0x23ba55][_0x4dfc('0x118')](_0x4dfc('0x9e'));var _0x11f0b4=_0x58a2be+_0x4dfc('0xb0');socket[_0x4dfc('0x2a')](_0x4dfc('0x30')+_0x58a2be+_0x4dfc('0xa7'),{'UserId':_0x21866b,['queueField']:_0x45107e[_0x23ba55]['id']});}})[_0x4dfc('0x29')](respondWithStatusCode(_0x247e10,null))[_0x4dfc('0x1e')](APIHandleError(_0x247e10));};exports[_0x4dfc('0x11c')]=function(_0x2b8452,_0x5d6f13){var _0x307b47=_0x2b8452['params']['id'];var _0x138912=null;if(_0x2b8452[_0x4dfc('0x41')]['ids']){_0x138912=_[_0x4dfc('0xaf')](_0x2b8452[_0x4dfc('0x41')][_0x4dfc('0x65')])?_0x2b8452['query'][_0x4dfc('0x65')]:[_0x2b8452['query']['ids']];}var _0x2bc48e=[];return Promise[_0x4dfc('0x102')]()[_0x4dfc('0x29')](function(){if(!_0x138912)throw new APIBadRequestError(_0x4dfc('0x11d'));})[_0x4dfc('0x29')](function(){return db[_0x4dfc('0x3d')][_0x4dfc('0xca')]({'where':{'id':_0x307b47}});})['then'](function(_0x126932){if(!_0x126932)throw new APINotFoundError(util[_0x4dfc('0xed')](_0x4dfc('0x110'),_0x2b8452[_0x4dfc('0x51')]['id']));return db[_0x4dfc('0x6c')][_0x4dfc('0x113')](function(_0x115b5b){return _0x126932[_0x4dfc('0x11c')](_0x138912,{'transaction':_0x115b5b})['then'](function(){return db[_0x4dfc('0x114')][_0x4dfc('0x48')]({'where':{'id':{'$in':_0x138912}}});})[_0x4dfc('0x29')](function(_0x55bbd4){var _0x44f0c1=_[_0x4dfc('0x36')](_0x55bbd4,function(_0x448e24){return _0x448e24['getAssociatedQueues']();});return Promise[_0x4dfc('0x60')](_0x44f0c1);})[_0x4dfc('0x29')](function(_0x446126){_0x2bc48e=_[_0x4dfc('0x116')](_0x446126);var _0x5a19a9=_[_0x4dfc('0x36')](_0x2bc48e,function(_0x58f04f){return _0x58f04f[_0x4dfc('0x11e')](_0x126932['id'],{'transaction':_0x115b5b});});return Promise[_0x4dfc('0x60')](_0x5a19a9);})['then'](function(){if(!_0x126932[_0x4dfc('0x9f')])return;var _0x20c4b5=_[_0x4dfc('0x34')](_0x2bc48e,function(_0x142764){return _0x142764[_0x4dfc('0x118')]('channel')===_0x4dfc('0x119');});var _0x4b24f6=_[_0x4dfc('0x36')](_0x20c4b5,function(_0x3f8d51){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x3f8d51['id'],'UserId':_0x126932['id']},'transaction':_0x115b5b});});return Promise[_0x4dfc('0x60')](_0x4b24f6);})[_0x4dfc('0x29')](function(){return db[_0x4dfc('0x11a')][_0x4dfc('0x48')]({'where':{'teamId':{'$in':_0x138912}}});})['then'](function(_0x453427){var _0x4ad205=_[_0x4dfc('0x36')](_0x453427,function(_0x32e65b){return db[_0x4dfc('0x11f')][_0x4dfc('0xb2')]({'where':{'UserId':_0x126932['id'],'VoicePrefixId':_0x32e65b[_0x4dfc('0x11b')]}},{'transaction':_0x115b5b});});return Promise[_0x4dfc('0x60')](_0x4ad205);});});})[_0x4dfc('0x29')](function(){for(var _0x146835=0x0;_0x146835<_0x2bc48e[_0x4dfc('0x5a')];_0x146835++){var _0x25b529=_0x2bc48e[_0x146835][_0x4dfc('0x118')](_0x4dfc('0x9e'));var _0x3b9641=_0x25b529+'QueueId';socket[_0x4dfc('0x2a')]('user'+_0x25b529+_0x4dfc('0xb1'),{'UserId':_0x307b47,['queueField']:_0x2bc48e[_0x146835]['id']});}})[_0x4dfc('0x29')](respondWithStatusCode(_0x5d6f13,null))[_0x4dfc('0x1e')](APIHandleError(_0x5d6f13));};exports[_0x4dfc('0x120')]=function(_0x2c2002,_0x312f4e){var _0x521460={};var _0x22b4b1={};var _0x4e20ab;var _0x5a11fb;return db[_0x4dfc('0x3d')][_0x4dfc('0xca')]({'where':{'id':_0x2c2002['params']['id']}})[_0x4dfc('0x29')](handleEntityNotFound(_0x312f4e,null))['then'](function(_0x51025d){if(_0x51025d){_0x4e20ab=_0x51025d;_0x22b4b1[_0x4dfc('0x52')]=_[_0x4dfc('0x54')](db['CmList'][_0x4dfc('0x55')]);_0x22b4b1['query']=_['keys'](_0x2c2002[_0x4dfc('0x41')]);_0x22b4b1[_0x4dfc('0x57')]=_[_0x4dfc('0x58')](_0x22b4b1[_0x4dfc('0x52')],_0x22b4b1[_0x4dfc('0x41')]);_0x521460[_0x4dfc('0x46')]=_[_0x4dfc('0x58')](_0x22b4b1[_0x4dfc('0x52')],qs[_0x4dfc('0x59')](_0x2c2002[_0x4dfc('0x41')][_0x4dfc('0x59')]));_0x521460[_0x4dfc('0x46')]=_0x521460[_0x4dfc('0x46')]['length']?_0x521460['attributes']:_0x22b4b1['model'];_0x521460[_0x4dfc('0xcb')]=qs[_0x4dfc('0xcc')](_0x2c2002[_0x4dfc('0x41')][_0x4dfc('0xcc')]);_0x521460['where']=qs[_0x4dfc('0x57')](_[_0x4dfc('0xce')](_0x2c2002['query'],_0x22b4b1[_0x4dfc('0x57')]));if(_0x2c2002[_0x4dfc('0x41')]['filter']){_0x521460[_0x4dfc('0xcd')]=_[_0x4dfc('0x5c')](_0x521460[_0x4dfc('0xcd')],{'$or':_[_0x4dfc('0x36')](_0x521460['attributes'],function(_0x4549b5){var _0x4b919d={};_0x4b919d[_0x4549b5]={'$like':'%'+_0x2c2002[_0x4dfc('0x41')][_0x4dfc('0x34')]+'%'};return _0x4b919d;})});}_0x521460=_['merge']({},_0x521460,_0x2c2002['options']);return _0x4e20ab[_0x4dfc('0x120')](_0x521460);}})['then'](function(_0x2bb5f9){if(_0x2bb5f9){_0x5a11fb=_0x2bb5f9[_0x4dfc('0x5a')];if(!_0x2c2002[_0x4dfc('0x41')][_0x4dfc('0xcf')](_0x4dfc('0xd4'))){_0x521460[_0x4dfc('0x25')]=qs[_0x4dfc('0x25')](_0x2c2002[_0x4dfc('0x41')][_0x4dfc('0x25')]);_0x521460[_0x4dfc('0x23')]=qs[_0x4dfc('0x23')](_0x2c2002[_0x4dfc('0x41')][_0x4dfc('0x23')]);}return _0x4e20ab[_0x4dfc('0x120')](_0x521460);}})[_0x4dfc('0x29')](function(_0x24ab62){if(_0x24ab62){return _0x24ab62?{'count':_0x5a11fb,'rows':_0x24ab62}:null;}})[_0x4dfc('0x29')](respondWithResult(_0x312f4e,null))[_0x4dfc('0x1e')](handleError(_0x312f4e,null));};exports[_0x4dfc('0x121')]=function(_0x1cb052,_0x3b1892){var _0x598e41={};var _0x3f90b1={};var _0x310432;return db['User'][_0x4dfc('0xca')]({'where':{'id':_0x1cb052[_0x4dfc('0x51')]['id']}})[_0x4dfc('0x29')](handleEntityNotFound(_0x3b1892,null))[_0x4dfc('0x29')](function(_0x40369d){if(_0x40369d){_0x310432=_0x40369d;_0x3f90b1[_0x4dfc('0x52')]=_[_0x4dfc('0x54')](db[_0x4dfc('0x3d')][_0x4dfc('0x55')]);_0x3f90b1[_0x4dfc('0x41')]=_[_0x4dfc('0x54')](_0x1cb052[_0x4dfc('0x41')]);_0x3f90b1[_0x4dfc('0x57')]=_[_0x4dfc('0x58')](_0x3f90b1['model'],_0x3f90b1['query']);_0x598e41[_0x4dfc('0x46')]=_[_0x4dfc('0x58')](_0x3f90b1[_0x4dfc('0x52')],qs[_0x4dfc('0x59')](_0x1cb052['query'][_0x4dfc('0x59')]));_0x598e41[_0x4dfc('0x46')]=_0x598e41[_0x4dfc('0x46')][_0x4dfc('0x5a')]?_0x598e41[_0x4dfc('0x46')]:_0x3f90b1[_0x4dfc('0x52')];_0x598e41[_0x4dfc('0xcb')]=qs[_0x4dfc('0xcc')](_0x1cb052[_0x4dfc('0x41')][_0x4dfc('0xcc')]);_0x598e41[_0x4dfc('0xcd')]=qs[_0x4dfc('0x57')](_['pick'](_0x1cb052[_0x4dfc('0x41')],_0x3f90b1['filters']));if(_0x1cb052['query']['filter']){_0x598e41['where']=_[_0x4dfc('0x5c')](_0x598e41['where'],{'$or':_[_0x4dfc('0x36')](_0x598e41[_0x4dfc('0x46')],function(_0x301851){var _0x3b72a6={};_0x3b72a6[_0x301851]={'$like':'%'+_0x1cb052[_0x4dfc('0x41')][_0x4dfc('0x34')]+'%'};return _0x3b72a6;})});}_0x598e41[_0x4dfc('0x52')]=db[_0x4dfc('0x3d')];_0x598e41['as']=_0x4dfc('0x31');_0x598e41=_['merge']({},_0x598e41,_0x1cb052[_0x4dfc('0x5d')]);return _0x310432[_0x4dfc('0xf7')]({'include':[_0x598e41]});}})[_0x4dfc('0x29')](function(_0x2118ae){if(_0x2118ae){var _0x4ad58e={},_0x34b277=[];for(var _0x1495b2=0x0;_0x1495b2<_0x2118ae[_0x4dfc('0x5a')];_0x1495b2+=0x1){for(var _0x32b1c3=0x0,_0x5147b6;_0x32b1c3<_0x2118ae[_0x1495b2][_0x4dfc('0x31')][_0x4dfc('0x5a')];_0x32b1c3+=0x1){_0x5147b6=_0x2118ae[_0x1495b2]['Agents'][_0x32b1c3][_0x4dfc('0x2c')]({'plain':!![]});_0x4ad58e[_0x5147b6['id']]=_0x5147b6;}}_0x4ad58e=_[_0x4dfc('0x122')](_0x4ad58e);for(var _0x45da9b=qs[_0x4dfc('0x23')](_0x1cb052[_0x4dfc('0x41')][_0x4dfc('0x23')]);_0x45da9b<_0x4ad58e[_0x4dfc('0x5a')]&&_0x34b277['length']=_0xa1b116[_0x120a('0x4d')]){throw new Error(_0x120a('0x4e'));}})[_0x120a('0x18')](function(){if(_0x5a8c79){return db[_0x120a('0x25')][_0x120a('0x42')]({'where':{'membername':_0x5a8c79[_0x120a('0x22')]},'individualHooks':!![]});}})[_0x120a('0x18')](function(){if(_0x5a8c79){return _0x5a8c79[_0x120a('0x4f')]({'raw':!![]});}})['then'](function(_0x4eb9f4){if(_0x5a8c79){if(_0x4eb9f4){var _0x46076c=[];_0x30df2d=_0x4eb9f4;if(_0x30df2d[_0x120a('0x2a')]){for(var _0x2dc17b=0x0;_0x2dc17b<_0x30df2d[_0x120a('0x2a')];_0x2dc17b++){_0x46076c[_0x120a('0x2d')](db[_0x120a('0x25')]['upsert']({'membername':_0x5a8c79[_0x120a('0x22')],'UserId':_0x5a8c79['id'],'queue_name':_0x30df2d[_0x2dc17b][_0x120a('0x22')],'VoiceQueueId':_0x30df2d[_0x2dc17b]['id'],'interface':_0x493021,'paused':_0x5a8c79[_0x120a('0x47')]||![],'penalty':_0x30df2d[_0x2dc17b][_0x120a('0x50')]||0x0}));}return BPromise[_0x120a('0x43')](_0x46076c);}}}})['then'](function(){if(_0x5a8c79){return db['MemberReport']['findAll']({'where':{'membername':_0x5a8c79[_0x120a('0x22')],'exitAt':null}});}})[_0x120a('0x18')](function(_0xd136f4){if(_0x5a8c79){if(_0xd136f4&&_0xd136f4[_0x120a('0x2a')]){var _0x3f50b3=[];_0xd136f4['forEach'](function(_0x3b26ca){_0x3f50b3[_0x120a('0x2d')](_0x3b26ca['update']({'exitAt':moment()[_0x120a('0x29')](_0x120a('0x2f'))}));});return BPromise[_0x120a('0x43')](_0x3f50b3);}}})['then'](function(){if(_0x5a8c79){var _0x3fc88e=[];var _0x49318f=[];var _0x50811a=utils[_0x120a('0x2b')]();var _0x2d8fdb={'membername':_0x5a8c79[_0x120a('0x22')],'interface':_0x493021,'enterAt':moment()[_0x120a('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x5a8c79[_0x120a('0x36')],'internal':_0x5a8c79[_0x120a('0x23')]};_0x50811a['forEach'](function(_0x266b77){_0x3fc88e[_0x120a('0x2d')](_[_0x120a('0x51')]({'channel':_0x266b77,'type':_0x120a('0x52'),'data1':_0x120a('0x53'),'data2':_0x493021},_0x2d8fdb));if(_0x5a8c79[_0x120a('0x47')]){_0x49318f[_0x120a('0x2d')](_[_0x120a('0x51')]({'channel':_0x266b77,'type':_0x120a('0x28'),'data1':'LOGININPAUSE'},_0x2d8fdb));}});return db[_0x120a('0x27')][_0x120a('0x32')](_0x3fc88e[_0x120a('0x54')](_0x49318f),{'individualHooks':!![]});}})[_0x120a('0x18')](function(){if(_0x5a8c79){return _0x5a8c79[_0x120a('0x26')]({'online':!![],'lastLoginAt':moment()[_0x120a('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5a8c79[_0x120a('0x47')]||![],'mailPause':_0x5a8c79[_0x120a('0x47')]||![],'chatPause':_0x5a8c79[_0x120a('0x47')]||![],'faxPause':_0x5a8c79[_0x120a('0x47')]||![],'smsPause':_0x5a8c79[_0x120a('0x47')]||![],'openchannelPause':_0x5a8c79['loginInPause']||![],'pauseType':_0x5a8c79[_0x120a('0x47')]?_0x120a('0x55'):null,'lastPauseAt':moment()[_0x120a('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x493021});}})[_0x120a('0x18')](function(_0x4b0f3a){_0x5c28f5(_0x4b0f3a);})[_0x120a('0x1a')](function(_0x3f1bc1){_0x2b53ba(_0x249bac[_0x120a('0x1c')](0x1f4,_0x3f1bc1['message']));});});}; \ No newline at end of file +var _0xad88=['system','UserVoiceQueueRt','destroy','all','mobile','phone','loginInPause','SIP/%s','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','callysquare','LOGININPAUSE','bulkCreate','concat','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','register','GetUser','User','findAll','options','raw','where','attributes','limit','map','include','model','info','debug','stringify','catch','error','message','ShowUser','find','PauseUser','name','role','internal','interface','update','then','MemberReport','PAUSE','length','format','getChannels','forEach','push','isNil','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','uniqueid','UnpauseUser','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','channel','findOne','voicePause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','params','unpause'];(function(_0x446e3b,_0x180958){var _0x4d39fd=function(_0x2676a5){while(--_0x2676a5){_0x446e3b['push'](_0x446e3b['shift']());}};_0x4d39fd(++_0x180958);}(_0xad88,0x1be));var _0x8ad8=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xad88[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x8ad8('0x0'));var util=require('util');var moment=require(_0x8ad8('0x1'));var BPromise=require(_0x8ad8('0x2'));var Redis=require('ioredis');var db=require(_0x8ad8('0x3'))['db'];var utils=require(_0x8ad8('0x4'));var logger=require(_0x8ad8('0x5'))(_0x8ad8('0x6'));var config=require(_0x8ad8('0x7'));config[_0x8ad8('0x8')]=_[_0x8ad8('0x9')](config[_0x8ad8('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ad8('0xa'))(new Redis(config[_0x8ad8('0x8')]));require('./user.socket')[_0x8ad8('0xb')](socket);exports[_0x8ad8('0xc')]=function(_0xe353f3){var _0x209c5d=this;return new Promise(function(_0x16c13a,_0x31a935){return db[_0x8ad8('0xd')][_0x8ad8('0xe')]({'raw':_0xe353f3[_0x8ad8('0xf')]?_0xe353f3[_0x8ad8('0xf')][_0x8ad8('0x10')]===undefined?!![]:![]:!![],'where':_0xe353f3[_0x8ad8('0xf')]?_0xe353f3['options'][_0x8ad8('0x11')]||null:null,'attributes':_0xe353f3[_0x8ad8('0xf')]?_0xe353f3[_0x8ad8('0xf')][_0x8ad8('0x12')]||null:null,'limit':_0xe353f3[_0x8ad8('0xf')]?_0xe353f3[_0x8ad8('0xf')][_0x8ad8('0x13')]||null:null,'include':_0xe353f3['options']?_0xe353f3[_0x8ad8('0xf')]['include']?_[_0x8ad8('0x14')](_0xe353f3[_0x8ad8('0xf')][_0x8ad8('0x15')],function(_0x547e50){return{'model':db[_0x547e50[_0x8ad8('0x16')]],'as':_0x547e50['as'],'attributes':_0x547e50[_0x8ad8('0x12')],'include':_0x547e50['include']?_['map'](_0x547e50[_0x8ad8('0x15')],function(_0x305004){return{'model':db[_0x305004[_0x8ad8('0x16')]],'as':_0x305004['as'],'attributes':_0x305004[_0x8ad8('0x12')],'include':_0x305004[_0x8ad8('0x15')]?_['map'](_0x305004['include'],function(_0x5265a4){return{'model':db[_0x5265a4[_0x8ad8('0x16')]],'as':_0x5265a4['as'],'attributes':_0x5265a4[_0x8ad8('0x12')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x600cec){logger[_0x8ad8('0x17')](_0x8ad8('0xc'),_0xe353f3);logger[_0x8ad8('0x18')](_0x8ad8('0xc'),_0xe353f3,JSON[_0x8ad8('0x19')](_0x600cec));_0x16c13a(_0x600cec);})[_0x8ad8('0x1a')](function(_0x596e9e){logger[_0x8ad8('0x1b')](_0x8ad8('0xc'),_0x596e9e['message'],_0xe353f3);_0x31a935(_0x209c5d[_0x8ad8('0x1b')](0x1f4,_0x596e9e[_0x8ad8('0x1c')]));});});};exports[_0x8ad8('0x1d')]=function(_0x349a87){var _0x48e292=this;return new Promise(function(_0x5de405,_0x4bbe67){return db[_0x8ad8('0xd')][_0x8ad8('0x1e')]({'raw':_0x349a87['options']?_0x349a87[_0x8ad8('0xf')][_0x8ad8('0x10')]===undefined?!![]:![]:!![],'where':_0x349a87[_0x8ad8('0xf')]?_0x349a87[_0x8ad8('0xf')]['where']||null:null,'attributes':_0x349a87['options']?_0x349a87['options'][_0x8ad8('0x12')]||null:null,'include':_0x349a87[_0x8ad8('0xf')]?_0x349a87['options'][_0x8ad8('0x15')]?_[_0x8ad8('0x14')](_0x349a87['options'][_0x8ad8('0x15')],function(_0x5075d1){return{'model':db[_0x5075d1[_0x8ad8('0x16')]],'as':_0x5075d1['as'],'attributes':_0x5075d1['attributes'],'include':_0x5075d1[_0x8ad8('0x15')]?_[_0x8ad8('0x14')](_0x5075d1[_0x8ad8('0x15')],function(_0x553c66){return{'model':db[_0x553c66['model']],'as':_0x553c66['as'],'attributes':_0x553c66[_0x8ad8('0x12')],'include':_0x553c66[_0x8ad8('0x15')]?_[_0x8ad8('0x14')](_0x553c66[_0x8ad8('0x15')],function(_0x32dd1e){return{'model':db[_0x32dd1e[_0x8ad8('0x16')]],'as':_0x32dd1e['as'],'attributes':_0x32dd1e[_0x8ad8('0x12')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4684b5){logger['info'](_0x8ad8('0x1d'),_0x349a87);logger[_0x8ad8('0x18')]('ShowUser',_0x349a87,JSON[_0x8ad8('0x19')](_0x4684b5));_0x5de405(_0x4684b5);})[_0x8ad8('0x1a')](function(_0x7b06cd){logger[_0x8ad8('0x1b')](_0x8ad8('0x1d'),_0x7b06cd[_0x8ad8('0x1c')],_0x349a87);_0x4bbe67(_0x48e292[_0x8ad8('0x1b')](0x1f4,_0x7b06cd[_0x8ad8('0x1c')]));});});};exports[_0x8ad8('0x1f')]=function(_0x29bf68){var _0x12e7a4=this;return new Promise(function(_0x32fea6,_0x24b82d){var _0x1dad88;return db[_0x8ad8('0xd')][_0x8ad8('0x1e')]({'where':_0x29bf68[_0x8ad8('0xf')]['where']||{},'attributes':['id',_0x8ad8('0x20'),_0x8ad8('0x21'),_0x8ad8('0x22'),_0x8ad8('0x23')]})['then'](function(_0x51d564){if(_0x51d564){_0x1dad88=_0x51d564;return db['UserVoiceQueueRt'][_0x8ad8('0x24')]({'paused':0x1},{'where':{'UserId':_0x1dad88['id']},'individualHooks':!![]});}})[_0x8ad8('0x25')](function(){if(_0x1dad88){return db[_0x8ad8('0x26')][_0x8ad8('0xe')]({'where':{'membername':_0x1dad88[_0x8ad8('0x20')],'type':_0x8ad8('0x27'),'exitAt':null}});}})['then'](function(_0xc22031){if(_0x1dad88){if(_0xc22031&&_0xc22031[_0x8ad8('0x28')]){var _0x2f6df3=moment()[_0x8ad8('0x29')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4ca9d1=0x0,_0x146d02=_0xc22031[_0x8ad8('0x28')];_0x4ca9d1<_0x146d02;_0x4ca9d1++){_0xc22031[_0x4ca9d1]['updateAttributes']({'exitAt':_0x2f6df3});}}}})['then'](function(){if(_0x1dad88){var _0x8989a6=[];var _0x1e4a34=utils[_0x8ad8('0x2a')]();_0x1e4a34[_0x8ad8('0x2b')](function(_0x2f7eb8){_0x8989a6[_0x8ad8('0x2c')]({'channel':_0x2f7eb8,'membername':_0x1dad88[_0x8ad8('0x20')],'interface':_[_0x8ad8('0x2d')](_0x1dad88[_0x8ad8('0x23')])?util['format']('SIP/%s',_0x1dad88['name']):_0x1dad88[_0x8ad8('0x23')],'type':_0x8ad8('0x27'),'enterAt':moment()[_0x8ad8('0x29')](_0x8ad8('0x2e')),'data1':_0x29bf68[_0x8ad8('0x2f')][_0x8ad8('0x30')]||_0x8ad8('0x31'),'role':_0x1dad88['role'],'internal':_0x1dad88[_0x8ad8('0x22')],'uniqueid':_0x29bf68[_0x8ad8('0x2f')][_0x8ad8('0x32')]||null});});return db[_0x8ad8('0x26')]['bulkCreate'](_0x8989a6,{'individualHooks':!![]});}})[_0x8ad8('0x25')](function(){if(_0x1dad88){return _0x1dad88[_0x8ad8('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x29bf68[_0x8ad8('0x2f')][_0x8ad8('0x30')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x8ad8('0x29')](_0x8ad8('0x2e'))});}})[_0x8ad8('0x25')](function(_0x35e05c){_0x32fea6(_0x35e05c);})['catch'](function(_0x20ae9b){_0x24b82d(_0x12e7a4['error'](0x1f4,_0x20ae9b['message']));});});};exports[_0x8ad8('0x33')]=function(_0x49fc66){var _0x22d337=this;return new Promise(function(_0x120223,_0x35e027){if(_0x49fc66['body']['channel']&&!utils[_0x8ad8('0x34')](_0x49fc66['body']['channel'])){throw new Error(util[_0x8ad8('0x29')](_0x8ad8('0x35'),_0x49fc66['body'][_0x8ad8('0x36')]));}return db['User'][_0x8ad8('0x37')]({'where':_0x49fc66[_0x8ad8('0xf')][_0x8ad8('0x11')]||{},'attributes':['id',_0x8ad8('0x20'),_0x8ad8('0x21'),_0x8ad8('0x22'),_0x8ad8('0x23'),'online',_0x8ad8('0x38'),'mailPause','chatPause','faxPause',_0x8ad8('0x39'),_0x8ad8('0x3a'),_0x8ad8('0x3b'),_0x8ad8('0x3c'),_0x8ad8('0x3d')]})[_0x8ad8('0x25')](function(_0xb8f9e4){if(!_0xb8f9e4){throw new Error(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x49fc66[_0x8ad8('0x3e')]['id']));}return _0xb8f9e4[_0x8ad8('0x3f')](_0x49fc66['body'][_0x8ad8('0x36')],_0x8ad8('0x40'));})[_0x8ad8('0x25')](function(_0x4f4c96){_0x120223(_0x4f4c96);})[_0x8ad8('0x1a')](function(_0x11726e){_0x35e027(_0x22d337[_0x8ad8('0x1b')](0x1f4,_0x11726e['message']));});});};exports['LogoutUser']=function(_0x346234){var _0x2e649b=this;return new Promise(function(_0x375716,_0x5dd657){var _0x1c87b3;return db[_0x8ad8('0xd')]['findOne']({'where':_0x346234['options']['where']||{},'attributes':['id',_0x8ad8('0x20')]})[_0x8ad8('0x25')](function(_0x1bea83){if(_0x1bea83){_0x1c87b3=_0x1bea83;return db[_0x8ad8('0x41')][_0x8ad8('0x42')]({'where':{'membername':_0x1c87b3['name']},'individualHooks':!![]});}})[_0x8ad8('0x25')](function(){if(_0x1c87b3){return db[_0x8ad8('0x26')][_0x8ad8('0xe')]({'where':{'membername':_0x1c87b3['name'],'exitAt':null}});}})['then'](function(_0x23b09e){if(_0x1c87b3){if(_0x23b09e&&_0x23b09e['length']){var _0x4a5743=[];_0x23b09e['forEach'](function(_0x2ac396){_0x4a5743[_0x8ad8('0x2c')](_0x2ac396[_0x8ad8('0x24')]({'exitAt':moment()[_0x8ad8('0x29')](_0x8ad8('0x2e'))}));});return BPromise[_0x8ad8('0x43')](_0x4a5743);}}})[_0x8ad8('0x25')](function(){if(_0x1c87b3){return _0x1c87b3[_0x8ad8('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x8ad8('0x25')](function(_0x211bd5){_0x375716(_0x211bd5);})[_0x8ad8('0x1a')](function(_0x22b350){_0x5dd657(_0x2e649b[_0x8ad8('0x1b')](0x1f4,_0x22b350[_0x8ad8('0x1c')]));});});};exports['LoginUser']=function(_0x54fb0b){var _0x27c553=this;return new Promise(function(_0x7d8ae1,_0x283241){var _0x138c01;var _0x46c7e2;var _0x1284d1;var _0x37fcf9;return db[_0x8ad8('0xd')]['findOne']({'where':_0x54fb0b[_0x8ad8('0xf')]['where']||{},'attributes':['id','name',_0x8ad8('0x21'),_0x8ad8('0x44'),_0x8ad8('0x45'),_0x8ad8('0x22'),_0x8ad8('0x46'),_0x8ad8('0x23')]})[_0x8ad8('0x25')](function(_0x4f4155){if(_0x4f4155){_0x138c01=_0x4f4155;_0x37fcf9=_0x54fb0b[_0x8ad8('0x2f')]['interface']?_0x54fb0b[_0x8ad8('0x2f')][_0x8ad8('0x23')]:util[_0x8ad8('0x29')](_0x8ad8('0x47'),_0x138c01[_0x8ad8('0x20')]);return db[_0x8ad8('0xd')][_0x8ad8('0x48')]({'where':{'role':_0x8ad8('0x49'),'online':!![],'id':{'$ne':_0x138c01['id']}}});}})[_0x8ad8('0x25')](function(_0x28c331){if(_0x28c331){_0x1284d1=_0x28c331;return require(_0x8ad8('0x4a'))[_0x8ad8('0x4b')]();}})[_0x8ad8('0x25')](function(_0x253a36){if(_0x253a36&&_0x253a36[_0x8ad8('0x4c')]&&_0x1284d1>=_0x253a36['agents']){throw new Error(_0x8ad8('0x4d'));}})[_0x8ad8('0x25')](function(){if(_0x138c01){return db[_0x8ad8('0x41')]['destroy']({'where':{'membername':_0x138c01[_0x8ad8('0x20')]},'individualHooks':!![]});}})['then'](function(){if(_0x138c01){return _0x138c01[_0x8ad8('0x4e')]({'raw':!![]});}})[_0x8ad8('0x25')](function(_0xe102b0){if(_0x138c01){if(_0xe102b0){var _0x28f67f=[];_0x46c7e2=_0xe102b0;if(_0x46c7e2[_0x8ad8('0x28')]){for(var _0x137f93=0x0;_0x137f93<_0x46c7e2['length'];_0x137f93++){_0x28f67f[_0x8ad8('0x2c')](db[_0x8ad8('0x41')][_0x8ad8('0x4f')]({'membername':_0x138c01['name'],'UserId':_0x138c01['id'],'queue_name':_0x46c7e2[_0x137f93][_0x8ad8('0x20')],'VoiceQueueId':_0x46c7e2[_0x137f93]['id'],'interface':_0x37fcf9,'paused':_0x138c01[_0x8ad8('0x46')]||![],'penalty':_0x46c7e2[_0x137f93]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x8ad8('0x43')](_0x28f67f);}}}})['then'](function(){if(_0x138c01){return db[_0x8ad8('0x26')][_0x8ad8('0xe')]({'where':{'membername':_0x138c01[_0x8ad8('0x20')],'exitAt':null}});}})[_0x8ad8('0x25')](function(_0x3019f9){if(_0x138c01){if(_0x3019f9&&_0x3019f9[_0x8ad8('0x28')]){var _0x34bae4=[];_0x3019f9[_0x8ad8('0x2b')](function(_0x4ca282){_0x34bae4[_0x8ad8('0x2c')](_0x4ca282[_0x8ad8('0x24')]({'exitAt':moment()[_0x8ad8('0x29')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x8ad8('0x43')](_0x34bae4);}}})[_0x8ad8('0x25')](function(){if(_0x138c01){var _0x105052=[];var _0xd76580=[];var _0x13543d=utils['getChannels']();var _0x2e9592={'membername':_0x138c01[_0x8ad8('0x20')],'interface':_0x37fcf9,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x138c01[_0x8ad8('0x21')],'internal':_0x138c01[_0x8ad8('0x22')]};_0x13543d[_0x8ad8('0x2b')](function(_0x3f1989){_0x105052[_0x8ad8('0x2c')](_[_0x8ad8('0x50')]({'channel':_0x3f1989,'type':'LOGIN','data1':_0x8ad8('0x51'),'data2':_0x37fcf9},_0x2e9592));if(_0x138c01[_0x8ad8('0x46')]){_0xd76580['push'](_[_0x8ad8('0x50')]({'channel':_0x3f1989,'type':_0x8ad8('0x27'),'data1':_0x8ad8('0x52')},_0x2e9592));}});return db['MemberReport'][_0x8ad8('0x53')](_0x105052[_0x8ad8('0x54')](_0xd76580),{'individualHooks':!![]});}})[_0x8ad8('0x25')](function(){if(_0x138c01){return _0x138c01['update']({'online':!![],'lastLoginAt':moment()[_0x8ad8('0x29')](_0x8ad8('0x2e')),'voicePause':_0x138c01[_0x8ad8('0x46')]||![],'mailPause':_0x138c01[_0x8ad8('0x46')]||![],'chatPause':_0x138c01[_0x8ad8('0x46')]||![],'faxPause':_0x138c01['loginInPause']||![],'smsPause':_0x138c01[_0x8ad8('0x46')]||![],'openchannelPause':_0x138c01['loginInPause']||![],'pauseType':_0x138c01[_0x8ad8('0x46')]?_0x8ad8('0x52'):null,'lastPauseAt':moment()['format'](_0x8ad8('0x2e')),'interface':_0x37fcf9});}})[_0x8ad8('0x25')](function(_0x5b4432){_0x7d8ae1(_0x5b4432);})['catch'](function(_0x30033f){_0x283241(_0x27c553['error'](0x1f4,_0x30033f['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index a490d3a..e9e78b1 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 _0x767c=['register','length','user:','./user.events','remove','update','emit'];(function(_0x14246c,_0x1384d0){var _0x378955=function(_0x13ec5a){while(--_0x13ec5a){_0x14246c['push'](_0x14246c['shift']());}};_0x378955(++_0x1384d0);}(_0x767c,0x1f4));var _0xc767=function(_0x168134,_0x1edc4e){_0x168134=_0x168134-0x0;var _0x1bb0e9=_0x767c[_0x168134];return _0x1bb0e9;};'use strict';var UserEvents=require(_0xc767('0x0'));var events=['save',_0xc767('0x1'),_0xc767('0x2')];function createListener(_0x446a3c,_0x2b7384){return function(_0x392b9e){_0x2b7384[_0xc767('0x3')](_0x446a3c,_0x392b9e);};}function removeListener(_0x17f1d2,_0x393267){return function(){UserEvents['removeListener'](_0x17f1d2,_0x393267);};}exports[_0xc767('0x4')]=function(_0x33a6ac){for(var _0x5604a3=0x0,_0x1ebeb9=events[_0xc767('0x5')];_0x5604a3<_0x1ebeb9;_0x5604a3++){var _0x135086=events[_0x5604a3];var _0x12090b=createListener(_0xc767('0x6')+_0x135086,_0x33a6ac);UserEvents['on'](_0x135086,_0x12090b);}}; \ No newline at end of file +var _0x416a=['removeListener','length','user:','./user.events','update','emit'];(function(_0x4ae9b4,_0x408720){var _0x4cc544=function(_0x54a64a){while(--_0x54a64a){_0x4ae9b4['push'](_0x4ae9b4['shift']());}};_0x4cc544(++_0x408720);}(_0x416a,0x153));var _0xa416=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x416a[_0x3dd15e];return _0x231fd0;};'use strict';var UserEvents=require(_0xa416('0x0'));var events=['save','remove',_0xa416('0x1')];function createListener(_0x4a27c0,_0x3aa141){return function(_0x277c2e){_0x3aa141[_0xa416('0x2')](_0x4a27c0,_0x277c2e);};}function removeListener(_0x227796,_0x200c3a){return function(){UserEvents[_0xa416('0x3')](_0x227796,_0x200c3a);};}exports['register']=function(_0x385e67){for(var _0xa36d95=0x0,_0x466612=events[_0xa416('0x4')];_0xa36d95<_0x466612;_0xa36d95++){var _0x36a2e5=events[_0xa36d95];var _0xb28a17=createListener(_0xa416('0x5')+_0x36a2e5,_0x385e67);UserEvents['on'](_0x36a2e5,_0xb28a17);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index b5e8652..f6eaf06 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x39b801,_0x1fdd40){var _0x53acb1=function(_0x19607f){while(--_0x19607f){_0x39b801['push'](_0x39b801['shift']());}};_0x53acb1(++_0x1fdd40);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2f0428,_0x2f780f){var _0x2f9e54=function(_0x25352a){while(--_0x25352a){_0x2f0428['push'](_0x2f0428['shift']());}};_0x2f9e54(++_0x2f780f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0xcb91[_0x5dfc2a];return _0x3f1a71;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 96e19a8..4dcf2dc 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 _0x064a=['INTEGER'];(function(_0x516927,_0xb4aad0){var _0x30749b=function(_0x2ca6cc){while(--_0x2ca6cc){_0x516927['push'](_0x516927['shift']());}};_0x30749b(++_0xb4aad0);}(_0x064a,0xb1));var _0xa064=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x064a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xa064('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x22b9=['INTEGER','sequelize','exports'];(function(_0x19856d,_0x5e5a6d){var _0x2a9dd6=function(_0x4fc62d){while(--_0x4fc62d){_0x19856d['push'](_0x19856d['shift']());}};_0x2a9dd6(++_0x5e5a6d);}(_0x22b9,0x9a));var _0x922b=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x22b9[_0x4a3898];return _0x25ceb0;};'use strict';var Sequelize=require(_0x922b('0x0'));module[_0x922b('0x1')]={'penalty':{'type':Sequelize[_0x922b('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 4caa973..5f0c411 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 _0xabd5=['UserChatQueue','user_has_chat_queues','util','api','moment','request-promise','../../config/environment','./userChatQueue.attributes','exports','define'];(function(_0x118969,_0x3bea3e){var _0x12ffc8=function(_0x2dc7b5){while(--_0x2dc7b5){_0x118969['push'](_0x118969['shift']());}};_0x12ffc8(++_0x3bea3e);}(_0xabd5,0xe8));var _0x5abd=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xabd5[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require(_0x5abd('0x0'));var logger=require('../../config/logger')(_0x5abd('0x1'));var moment=require(_0x5abd('0x2'));var BPromise=require('bluebird');var rp=require(_0x5abd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5abd('0x4'));var attributes=require(_0x5abd('0x5'));module[_0x5abd('0x6')]=function(_0x12b1bf,_0x14f2e6){return _0x12b1bf[_0x5abd('0x7')](_0x5abd('0x8'),attributes,{'tableName':_0x5abd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf483=['exports','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xf483,0xd5));var _0x3f48=function(_0x50b15b,_0x71ac13){_0x50b15b=_0x50b15b-0x0;var _0x1334e2=_0xf483[_0x50b15b];return _0x1334e2;};'use strict';var _=require(_0x3f48('0x0'));var util=require(_0x3f48('0x1'));var logger=require(_0x3f48('0x2'))(_0x3f48('0x3'));var moment=require(_0x3f48('0x4'));var BPromise=require(_0x3f48('0x5'));var rp=require(_0x3f48('0x6'));var fs=require('fs');var path=require(_0x3f48('0x7'));var rimraf=require(_0x3f48('0x8'));var config=require(_0x3f48('0x9'));var attributes=require(_0x3f48('0xa'));module[_0x3f48('0xb')]=function(_0x67143,_0xf09b0f){return _0x67143['define'](_0x3f48('0xc'),attributes,{'tableName':_0x3f48('0xd'),'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 221c014..dc13464 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 _0xf916=['then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x19a90e,_0xe14b0b){var _0xa49b11=function(_0x560f76){while(--_0x560f76){_0x19a90e['push'](_0x19a90e['shift']());}};_0xa49b11(++_0xe14b0b);}(_0xf916,0x1a4));var _0x6f91=function(_0x38f4a8,_0x3bc960){_0x38f4a8=_0x38f4a8-0x0;var _0x10f4a0=_0xf916[_0x38f4a8];return _0x10f4a0;};'use strict';var _=require(_0x6f91('0x0'));var util=require('util');var moment=require(_0x6f91('0x1'));var BPromise=require(_0x6f91('0x2'));var rs=require(_0x6f91('0x3'));var fs=require('fs');var Redis=require(_0x6f91('0x4'));var db=require(_0x6f91('0x5'))['db'];var utils=require(_0x6f91('0x6'));var logger=require(_0x6f91('0x7'))('rpc');var config=require(_0x6f91('0x8'));var jayson=require(_0x6f91('0x9'));var client=jayson['client'][_0x6f91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x534683,_0x480bb9,_0xcadb4d){return new BPromise(function(_0x4d62cd,_0x21e273){return client[_0x6f91('0xb')](_0x534683,_0xcadb4d)[_0x6f91('0xc')](function(_0x38ea5f){logger['info'](_0x6f91('0xd'),_0x480bb9,_0x6f91('0xe'));logger[_0x6f91('0xf')](_0x6f91('0x10'),_0x480bb9,_0x6f91('0xe'),JSON[_0x6f91('0x11')](_0x38ea5f));if(_0x38ea5f['error']){if(_0x38ea5f[_0x6f91('0x12')][_0x6f91('0x13')]===0x1f4){logger['error'](_0x6f91('0xd'),_0x480bb9,_0x38ea5f['error'][_0x6f91('0x14')]);return _0x21e273(_0x38ea5f[_0x6f91('0x12')]['message']);}logger['error'](_0x6f91('0xd'),_0x480bb9,_0x38ea5f[_0x6f91('0x12')][_0x6f91('0x14')]);return _0x4d62cd(_0x38ea5f[_0x6f91('0x12')][_0x6f91('0x14')]);}else{logger[_0x6f91('0x15')](_0x6f91('0xd'),_0x480bb9,_0x6f91('0xe'));_0x4d62cd(_0x38ea5f[_0x6f91('0x16')][_0x6f91('0x14')]);}})[_0x6f91('0x17')](function(_0x1b3bc7){logger['error'](_0x6f91('0xd'),_0x480bb9,_0x1b3bc7);_0x21e273(_0x1b3bc7);});});} \ No newline at end of file +var _0x7b68=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','UserChatQueue,\x20%s,\x20%s','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0x7b68,0x13b));var _0x87b6=function(_0x4e217a,_0x320c92){_0x4e217a=_0x4e217a-0x0;var _0x43f0ab=_0x7b68[_0x4e217a];return _0x43f0ab;};'use strict';var _=require(_0x87b6('0x0'));var util=require(_0x87b6('0x1'));var moment=require('moment');var BPromise=require(_0x87b6('0x2'));var rs=require(_0x87b6('0x3'));var fs=require('fs');var Redis=require(_0x87b6('0x4'));var db=require(_0x87b6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x87b6('0x6'))(_0x87b6('0x7'));var config=require(_0x87b6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x87b6('0x9')][_0x87b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x366411,_0x31590d,_0x5a13af){return new BPromise(function(_0x582470,_0x34fb9f){return client[_0x87b6('0xb')](_0x366411,_0x5a13af)['then'](function(_0x48dbb5){logger[_0x87b6('0xc')](_0x87b6('0xd'),_0x31590d,'request\x20sent');logger['debug'](_0x87b6('0xe'),_0x31590d,_0x87b6('0xf'),JSON[_0x87b6('0x10')](_0x48dbb5));if(_0x48dbb5[_0x87b6('0x11')]){if(_0x48dbb5['error'][_0x87b6('0x12')]===0x1f4){logger[_0x87b6('0x11')](_0x87b6('0xd'),_0x31590d,_0x48dbb5[_0x87b6('0x11')][_0x87b6('0x13')]);return _0x34fb9f(_0x48dbb5[_0x87b6('0x11')][_0x87b6('0x13')]);}logger[_0x87b6('0x11')](_0x87b6('0xd'),_0x31590d,_0x48dbb5[_0x87b6('0x11')]['message']);return _0x582470(_0x48dbb5[_0x87b6('0x11')][_0x87b6('0x13')]);}else{logger['info'](_0x87b6('0xd'),_0x31590d,_0x87b6('0xf'));_0x582470(_0x48dbb5[_0x87b6('0x14')]['message']);}})[_0x87b6('0x15')](function(_0x253092){logger['error'](_0x87b6('0xd'),_0x31590d,_0x253092);_0x34fb9f(_0x253092);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 605a8fa..b967ef7 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x280e59,_0x250988){var _0x19c766=function(_0x2c2355){while(--_0x2c2355){_0x280e59['push'](_0x280e59['shift']());}};_0x19c766(++_0x250988);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ff685,_0x304b9e){_0x3ff685=_0x3ff685-0x0;var _0x2046c9=_0xcb91[_0x3ff685];return _0x2046c9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xb12603,_0x142505){var _0x2bdc24=function(_0x5dca90){while(--_0x5dca90){_0xb12603['push'](_0xb12603['shift']());}};_0x2bdc24(++_0x142505);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 56673fd..b8f9cd3 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 _0xc7c9=['INTEGER','STRING'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc7c9,0x156));var _0x9c7c=function(_0x70d97d,_0x35a359){_0x70d97d=_0x70d97d-0x0;var _0x1ee1d9=_0xc7c9[_0x70d97d];return _0x1ee1d9;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x9c7c('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9c7c('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x9c7c('0x1')]}}; \ No newline at end of file +var _0x1a6b=['sequelize','exports','INTEGER','STRING'];(function(_0x317f96,_0x54bd3d){var _0x3ed0f7=function(_0x5e5514){while(--_0x5e5514){_0x317f96['push'](_0x317f96['shift']());}};_0x3ed0f7(++_0x54bd3d);}(_0x1a6b,0x198));var _0xb1a6=function(_0x463865,_0x516711){_0x463865=_0x463865-0x0;var _0x53a60a=_0x1a6b[_0x463865];return _0x53a60a;};'use strict';var Sequelize=require(_0xb1a6('0x0'));module[_0xb1a6('0x1')]={'penalty':{'type':Sequelize[_0xb1a6('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb1a6('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xb1a6('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index d755805..3f98b86 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 _0xb6b2=['define','UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x2771cd,_0x182426){var _0x4231a0=function(_0x418405){while(--_0x418405){_0x2771cd['push'](_0x2771cd['shift']());}};_0x4231a0(++_0x182426);}(_0xb6b2,0x179));var _0x2b6b=function(_0x2efb2b,_0x2acf6c){_0x2efb2b=_0x2efb2b-0x0;var _0x458ec8=_0xb6b2[_0x2efb2b];return _0x458ec8;};'use strict';var _=require('lodash');var util=require(_0x2b6b('0x0'));var logger=require(_0x2b6b('0x1'))(_0x2b6b('0x2'));var moment=require(_0x2b6b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b6b('0x4'));var rimraf=require(_0x2b6b('0x5'));var config=require(_0x2b6b('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0x2b6b('0x7')]=function(_0x575c2d,_0x23ca46){return _0x575c2d[_0x2b6b('0x8')](_0x2b6b('0x9'),attributes,{'tableName':_0x2b6b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d70=['moment','bluebird','request-promise','path','../../config/environment','UserFaxQueue','util','api'];(function(_0x34ccfe,_0x4e6de8){var _0x50d168=function(_0x477c9a){while(--_0x477c9a){_0x34ccfe['push'](_0x34ccfe['shift']());}};_0x50d168(++_0x4e6de8);}(_0x7d70,0x12e));var _0x07d7=function(_0x515060,_0xb5d49d){_0x515060=_0x515060-0x0;var _0x193a88=_0x7d70[_0x515060];return _0x193a88;};'use strict';var _=require('lodash');var util=require(_0x07d7('0x0'));var logger=require('../../config/logger')(_0x07d7('0x1'));var moment=require(_0x07d7('0x2'));var BPromise=require(_0x07d7('0x3'));var rp=require(_0x07d7('0x4'));var fs=require('fs');var path=require(_0x07d7('0x5'));var rimraf=require('rimraf');var config=require(_0x07d7('0x6'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x520081,_0x46cff7){return _0x520081['define'](_0x07d7('0x7'),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 1ab5afd..731e85a 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 _0x6933=['result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4719f5,_0x30f4ed){var _0x437f23=function(_0xcef8d9){while(--_0xcef8d9){_0x4719f5['push'](_0x4719f5['shift']());}};_0x437f23(++_0x30f4ed);}(_0x6933,0x13c));var _0x3693=function(_0x2f7231,_0x20670d){_0x2f7231=_0x2f7231-0x0;var _0x1a9d86=_0x6933[_0x2f7231];return _0x1a9d86;};'use strict';var _=require('lodash');var util=require(_0x3693('0x0'));var moment=require('moment');var BPromise=require(_0x3693('0x1'));var rs=require(_0x3693('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3693('0x3'))['db'];var utils=require(_0x3693('0x4'));var logger=require(_0x3693('0x5'))(_0x3693('0x6'));var config=require(_0x3693('0x7'));var jayson=require(_0x3693('0x8'));var client=jayson[_0x3693('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42d263,_0x2431f1,_0x3727ce){return new BPromise(function(_0x3ea628,_0x508b2c){return client[_0x3693('0xa')](_0x42d263,_0x3727ce)[_0x3693('0xb')](function(_0x1e38be){logger[_0x3693('0xc')](_0x3693('0xd'),_0x2431f1,_0x3693('0xe'));logger[_0x3693('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x2431f1,'request\x20sent',JSON[_0x3693('0x10')](_0x1e38be));if(_0x1e38be[_0x3693('0x11')]){if(_0x1e38be[_0x3693('0x11')][_0x3693('0x12')]===0x1f4){logger[_0x3693('0x11')](_0x3693('0xd'),_0x2431f1,_0x1e38be[_0x3693('0x11')]['message']);return _0x508b2c(_0x1e38be['error'][_0x3693('0x13')]);}logger[_0x3693('0x11')](_0x3693('0xd'),_0x2431f1,_0x1e38be['error'][_0x3693('0x13')]);return _0x3ea628(_0x1e38be['error'][_0x3693('0x13')]);}else{logger[_0x3693('0xc')](_0x3693('0xd'),_0x2431f1,_0x3693('0xe'));_0x3ea628(_0x1e38be[_0x3693('0x14')]['message']);}})['catch'](function(_0x3b9c13){logger[_0x3693('0x11')](_0x3693('0xd'),_0x2431f1,_0x3b9c13);_0x508b2c(_0x3b9c13);});});} \ No newline at end of file +var _0x4016=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserFaxQueue,\x20%s,\x20%s','result'];(function(_0x25ab1f,_0x2d186a){var _0xc4a7b3=function(_0x45f334){while(--_0x45f334){_0x25ab1f['push'](_0x25ab1f['shift']());}};_0xc4a7b3(++_0x2d186a);}(_0x4016,0x9a));var _0x6401=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x4016[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6401('0x0'));var BPromise=require(_0x6401('0x1'));var rs=require(_0x6401('0x2'));var fs=require('fs');var Redis=require(_0x6401('0x3'));var db=require(_0x6401('0x4'))['db'];var utils=require(_0x6401('0x5'));var logger=require(_0x6401('0x6'))(_0x6401('0x7'));var config=require(_0x6401('0x8'));var jayson=require(_0x6401('0x9'));var client=jayson[_0x6401('0xa')][_0x6401('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59ab41,_0x33c55f,_0xbdf7c0){return new BPromise(function(_0x576587,_0x3270ca){return client['request'](_0x59ab41,_0xbdf7c0)['then'](function(_0x4a8b2a){logger[_0x6401('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x33c55f,_0x6401('0xd'));logger[_0x6401('0xe')](_0x6401('0xf'),_0x33c55f,_0x6401('0xd'),JSON[_0x6401('0x10')](_0x4a8b2a));if(_0x4a8b2a[_0x6401('0x11')]){if(_0x4a8b2a[_0x6401('0x11')][_0x6401('0x12')]===0x1f4){logger[_0x6401('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x33c55f,_0x4a8b2a['error'][_0x6401('0x13')]);return _0x3270ca(_0x4a8b2a['error']['message']);}logger['error'](_0x6401('0x14'),_0x33c55f,_0x4a8b2a[_0x6401('0x11')][_0x6401('0x13')]);return _0x576587(_0x4a8b2a[_0x6401('0x11')][_0x6401('0x13')]);}else{logger[_0x6401('0xc')](_0x6401('0x14'),_0x33c55f,_0x6401('0xd'));_0x576587(_0x4a8b2a[_0x6401('0x15')][_0x6401('0x13')]);}})['catch'](function(_0x90ff7c){logger[_0x6401('0x11')](_0x6401('0x14'),_0x33c55f,_0x90ff7c);_0x3270ca(_0x90ff7c);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 67bda2d..e446d4d 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x16e0c8,_0x4861eb){var _0xe4b5af=function(_0x5248bc){while(--_0x5248bc){_0x16e0c8['push'](_0x16e0c8['shift']());}};_0xe4b5af(++_0x4861eb);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1e1858,_0x2bc0ec){var _0x4d8d7a=function(_0x2145eb){while(--_0x2145eb){_0x1e1858['push'](_0x1e1858['shift']());}};_0x4d8d7a(++_0x2bc0ec);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 11c30f2..564d414 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 _0x850a=['sequelize','exports','INTEGER'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x850a,0x123));var _0xa850=function(_0x74892f,_0x1e981b){_0x74892f=_0x74892f-0x0;var _0x10ee61=_0x850a[_0x74892f];return _0x10ee61;};'use strict';var Sequelize=require(_0xa850('0x0'));module[_0xa850('0x1')]={'penalty':{'type':Sequelize[_0xa850('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x66d2=['exports','INTEGER'];(function(_0x1fa9cc,_0x1022df){var _0x90686=function(_0x439c23){while(--_0x439c23){_0x1fa9cc['push'](_0x1fa9cc['shift']());}};_0x90686(++_0x1022df);}(_0x66d2,0x1da));var _0x266d=function(_0x31d767,_0x1471c9){_0x31d767=_0x31d767-0x0;var _0x56bab0=_0x66d2[_0x31d767];return _0x56bab0;};'use strict';var Sequelize=require('sequelize');module[_0x266d('0x0')]={'penalty':{'type':Sequelize[_0x266d('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index a19fce2..ad90e65 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 _0x5dc3=['../../config/logger','api','bluebird','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','lodash'];(function(_0x31a22e,_0x2e90a7){var _0x2bf5e7=function(_0x2b1180){while(--_0x2b1180){_0x31a22e['push'](_0x31a22e['shift']());}};_0x2bf5e7(++_0x2e90a7);}(_0x5dc3,0x1af));var _0x35dc=function(_0x59d12e,_0x1128ff){_0x59d12e=_0x59d12e-0x0;var _0x2f5ee4=_0x5dc3[_0x59d12e];return _0x2f5ee4;};'use strict';var _=require(_0x35dc('0x0'));var util=require('util');var logger=require(_0x35dc('0x1'))(_0x35dc('0x2'));var moment=require('moment');var BPromise=require(_0x35dc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x35dc('0x4'));var config=require(_0x35dc('0x5'));var attributes=require(_0x35dc('0x6'));module[_0x35dc('0x7')]=function(_0x5d94c0,_0x58c079){return _0x5d94c0['define'](_0x35dc('0x8'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5f0=['request-promise','path','rimraf','../../config/environment','exports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x56dac6,_0x291782){var _0x5766f1=function(_0x17a719){while(--_0x17a719){_0x56dac6['push'](_0x56dac6['shift']());}};_0x5766f1(++_0x291782);}(_0xb5f0,0x144));var _0x0b5f=function(_0xc35608,_0x6f0a34){_0xc35608=_0xc35608-0x0;var _0x4be993=_0xb5f0[_0xc35608];return _0x4be993;};'use strict';var _=require(_0x0b5f('0x0'));var util=require(_0x0b5f('0x1'));var logger=require(_0x0b5f('0x2'))(_0x0b5f('0x3'));var moment=require(_0x0b5f('0x4'));var BPromise=require(_0x0b5f('0x5'));var rp=require(_0x0b5f('0x6'));var fs=require('fs');var path=require(_0x0b5f('0x7'));var rimraf=require(_0x0b5f('0x8'));var config=require(_0x0b5f('0x9'));var attributes=require('./userMailQueue.attributes');module[_0x0b5f('0xa')]=function(_0x4d225c,_0x1c7222){return _0x4d225c['define']('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','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 abe3ebe..35008a9 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 _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x4ed546,_0x244bd0){var _0x10bfcc=function(_0x2e2caa){while(--_0x2e2caa){_0x4ed546['push'](_0x4ed546['shift']());}};_0x10bfcc(++_0x244bd0);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0x4b84[_0x3042c5];return _0x7cd140;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ 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(_0x9a681d,_0x1e7e89){var _0x432153=function(_0x30416e){while(--_0x30416e){_0x9a681d['push'](_0x9a681d['shift']());}};_0x432153(++_0x1e7e89);}(_0xe14b,0x93));var _0xbe14=function(_0x3ec3a6,_0x10cb7f){_0x3ec3a6=_0x3ec3a6-0x0;var _0x4ce546=_0xe14b[_0x3ec3a6];return _0x4ce546;};'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 088face..22c3b21 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 _0x2249=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','sendUserNotification'];(function(_0x14d454,_0xa071e0){var _0x2b907d=function(_0x511581){while(--_0x511581){_0x14d454['push'](_0x14d454['shift']());}};_0x2b907d(++_0xa071e0);}(_0x2249,0x139));var _0x9224=function(_0x172948,_0x4262cc){_0x172948=_0x172948-0x0;var _0x4aeaa9=_0x2249[_0x172948];return _0x4aeaa9;};'use strict';var multer=require(_0x9224('0x0'));var util=require(_0x9224('0x1'));var path=require(_0x9224('0x2'));var timeout=require(_0x9224('0x3'));var express=require(_0x9224('0x4'));var router=express[_0x9224('0x5')]();var fs_extra=require(_0x9224('0x6'));var auth=require(_0x9224('0x7'));var interaction=require(_0x9224('0x8'));var config=require(_0x9224('0x9'));var controller=require('./userNotification.controller');router['post']('/',auth[_0x9224('0xa')](),controller[_0x9224('0xb')]);module[_0x9224('0xc')]=router; \ No newline at end of file +var _0x044c=['isAuthenticated','sendUserNotification','path','connect-timeout','express','Router','fs-extra','../../config/environment','./userNotification.controller','post'];(function(_0x4f187d,_0x336808){var _0xfe8881=function(_0x30f7f0){while(--_0x30f7f0){_0x4f187d['push'](_0x4f187d['shift']());}};_0xfe8881(++_0x336808);}(_0x044c,0x17e));var _0xc044=function(_0x2e4df8,_0x172be4){_0x2e4df8=_0x2e4df8-0x0;var _0x3195b4=_0x044c[_0x2e4df8];return _0x3195b4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc044('0x0'));var timeout=require(_0xc044('0x1'));var express=require(_0xc044('0x2'));var router=express[_0xc044('0x3')]();var fs_extra=require(_0xc044('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc044('0x5'));var controller=require(_0xc044('0x6'));router[_0xc044('0x7')]('/',auth[_0xc044('0x8')](),controller[_0xc044('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 64967d5..2e16f0d 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 _0x2f12=['exports','STRING','TEXT'];(function(_0x18bbfb,_0x12517f){var _0xcc9a2e=function(_0x80ccfd){while(--_0x80ccfd){_0x18bbfb['push'](_0x18bbfb['shift']());}};_0xcc9a2e(++_0x12517f);}(_0x2f12,0x84));var _0x22f1=function(_0x41f6eb,_0x5a3754){_0x41f6eb=_0x41f6eb-0x0;var _0x42e69c=_0x2f12[_0x41f6eb];return _0x42e69c;};'use strict';var Sequelize=require('sequelize');module[_0x22f1('0x0')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x22f1('0x1')]},'recipientsId':{'type':Sequelize[_0x22f1('0x2')]},'recipientsDescription':{'type':Sequelize[_0x22f1('0x1')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x2d71=['STRING'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0x2d71,0x10b));var _0x12d7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2d71[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x12d7('0x0')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x12d7('0x0')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index a614c3a..e65c82f 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 _0xcab2=['forEach','emit','catch','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','view','union','replace','queue','Queue','ids','all','flatten','findOne','getAgents','map','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userNotification.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','stack','name','send','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','whatsappqueue','team','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0xcab2,0x70));var _0x2cab=function(_0x32145f,_0x1671df){_0x32145f=_0x32145f-0x0;var _0x2f8445=_0xcab2[_0x32145f];return _0x2f8445;};'use strict';var emlformat=require(_0x2cab('0x0'));var rimraf=require(_0x2cab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2cab('0x2'));var moment=require('moment');var BPromise=require(_0x2cab('0x3'));var Mustache=require(_0x2cab('0x4'));var util=require(_0x2cab('0x5'));var path=require(_0x2cab('0x6'));var sox=require(_0x2cab('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2cab('0x8'));var _=require(_0x2cab('0x9'));var squel=require('squel');var crypto=require(_0x2cab('0xa'));var jsforce=require(_0x2cab('0xb'));var deskjs=require(_0x2cab('0xc'));var toCsv=require(_0x2cab('0xd'));var querystring=require(_0x2cab('0xe'));var Papa=require(_0x2cab('0xf'));var Redis=require(_0x2cab('0x10'));var authService=require(_0x2cab('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2cab('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2cab('0x13'))('api');var utils=require(_0x2cab('0x14'));var config=require(_0x2cab('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2cab('0x16'))['db'];config[_0x2cab('0x17')]=_['defaults'](config[_0x2cab('0x17')],{'host':_0x2cab('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2cab('0x17')]));require(_0x2cab('0x19'))[_0x2cab('0x1a')](socket);function respondWithStatusCode(_0x337361,_0x585071){_0x585071=_0x585071||0xcc;return function(_0x2fbff8){if(_0x2fbff8){return _0x337361[_0x2cab('0x1b')](_0x585071);}return _0x337361['status'](_0x585071)[_0x2cab('0x1c')]();};}function respondWithResult(_0xdb0838,_0x16e7c2){_0x16e7c2=_0x16e7c2||0xc8;return function(_0x5b16a6){if(_0x5b16a6){return _0xdb0838[_0x2cab('0x1d')](_0x16e7c2)[_0x2cab('0x1e')](_0x5b16a6);}};}function respondWithFilteredResult(_0x2d789d,_0x343460){return function(_0x54ab11){if(_0x54ab11){var _0x368dba=typeof _0x343460[_0x2cab('0x1f')]===_0x2cab('0x20')&&typeof _0x343460[_0x2cab('0x21')]===_0x2cab('0x20');var _0x28fc14=_0x54ab11[_0x2cab('0x22')];var _0xc52a=_0x368dba?0x0:_0x343460[_0x2cab('0x1f')];var _0x59dd6c=_0x368dba?_0x54ab11['count']:_0x343460[_0x2cab('0x1f')]+_0x343460['limit'];var _0x3f3f76;if(_0x59dd6c>=_0x28fc14){_0x59dd6c=_0x28fc14;_0x3f3f76=0xc8;}else{_0x3f3f76=0xce;}_0x2d789d[_0x2cab('0x1d')](_0x3f3f76);return _0x2d789d['set']('Content-Range',_0xc52a+'-'+_0x59dd6c+'/'+_0x28fc14)['json'](_0x54ab11);}return null;};}function patchUpdates(_0x5689db){return function(_0x319acb){try{jsonpatch[_0x2cab('0x23')](_0x319acb,_0x5689db,!![]);}catch(_0x53855a){return BPromise[_0x2cab('0x24')](_0x53855a);}return _0x319acb[_0x2cab('0x25')]();};}function saveUpdates(_0x45515e,_0x157cf1){return function(_0x1497e1){if(_0x1497e1){return _0x1497e1[_0x2cab('0x26')](_0x45515e)['then'](function(_0x3843a7){return _0x3843a7;});}return null;};}function removeEntity(_0x48d0aa,_0x2b9f3f){return function(_0x13c5cd){if(_0x13c5cd){return _0x13c5cd[_0x2cab('0x27')]()[_0x2cab('0x28')](function(){_0x48d0aa[_0x2cab('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x173655,_0x2de06d){return function(_0x5c09ee){if(!_0x5c09ee){_0x173655[_0x2cab('0x1b')](0x194);}return _0x5c09ee;};}function handleError(_0x387c9a,_0x4d12d9){_0x4d12d9=_0x4d12d9||0x1f4;return function(_0x2d7860){logger[_0x2cab('0x29')](_0x2d7860[_0x2cab('0x2a')]);if(_0x2d7860[_0x2cab('0x2b')]){delete _0x2d7860['name'];}_0x387c9a[_0x2cab('0x1d')](_0x4d12d9)[_0x2cab('0x2c')](_0x2d7860);};}exports['sendUserNotification']=function(_0x56d2fc,_0x3328fe,_0x5ceee3){if(!_0x56d2fc[_0x2cab('0x2d')][_0x2cab('0x2e')](_0x2cab('0x2f'))&&!_0x56d2fc[_0x2cab('0x2d')][_0x2cab('0x2e')](_0x2cab('0x30'))){throw new db[(_0x2cab('0x31'))][(_0x2cab('0x32'))](_0x2cab('0x33'));}else{if(_0x56d2fc['body'][_0x2cab('0x2e')]('TemplateId')&&!_0x56d2fc['body']['hasOwnProperty']('view')){throw new db['Sequelize']['ValidationError'](_0x2cab('0x34'));}if(!_0x56d2fc[_0x2cab('0x2d')][_0x2cab('0x2e')]('recipients')){throw new db[(_0x2cab('0x31'))]['ValidationError'](_0x2cab('0x35'));}else{try{var _0x390837=JSON['parse'](_0x56d2fc[_0x2cab('0x2d')][_0x2cab('0x36')]);}catch(_0x458754){logger['error'](_0x458754);throw new db['Sequelize'][(_0x2cab('0x32'))](_0x2cab('0x37'));}var _0x3a4c5d=[_0x2cab('0x38'),_0x2cab('0x39'),'mailqueue',_0x2cab('0x3a'),_0x2cab('0x3b'),'voicequeue',_0x2cab('0x3c'),_0x2cab('0x3d'),'user'];if(_[_0x2cab('0x3e')](_0x390837,function(_0x8a35d1){return!_[_0x2cab('0x3f')](_0x3a4c5d,_0x8a35d1['model'][_0x2cab('0x40')]());})){throw new db[(_0x2cab('0x31'))]['ValidationError'](_0x2cab('0x41'));}}}var _0xf1cd48={};_0xf1cd48[_0x2cab('0x42')]=_0x56d2fc[_0x2cab('0x2d')]['hasOwnProperty'](_0x2cab('0x42'))?_0x56d2fc[_0x2cab('0x2d')]['senderName']:_0x56d2fc[_0x2cab('0x43')]['fullname'];_0xf1cd48['recipientsDescription']=_['isEmpty'](_0x56d2fc[_0x2cab('0x2d')][_0x2cab('0x44')])?null:_0x56d2fc['body'][_0x2cab('0x44')];_0xf1cd48[_0x2cab('0x45')]=_0x56d2fc[_0x2cab('0x2d')][_0x2cab('0x45')]||![];_0xf1cd48[_0x2cab('0x46')]=_0x56d2fc[_0x2cab('0x43')]['id'];return getContent(_0x56d2fc[_0x2cab('0x2d')])[_0x2cab('0x28')](function(_0x3c394b){_0xf1cd48[_0x2cab('0x2d')]=_0x3c394b;return getRecipients(_0x390837);})[_0x2cab('0x28')](function(_0x2f9290){_0xf1cd48[_0x2cab('0x47')]=_[_0x2cab('0x48')](_0x2f9290)[_0x2cab('0x49')](',');return db[_0x2cab('0x4a')][_0x2cab('0x4b')](function(_0x27ab85){return db[_0x2cab('0x4c')][_0x2cab('0x4d')](_0xf1cd48,{'raw':!![],'transaction':_0x27ab85})[_0x2cab('0x28')](function(_0x4166e4){var _0x11dd76={'sender':_0xf1cd48['senderName'],'description':_0xf1cd48['recipientsDescription'],'content':_0xf1cd48[_0x2cab('0x2d')],'beep':_0xf1cd48[_0x2cab('0x45')]};_0x2f9290[_0x2cab('0x4e')](function(_0x4a2108){_0x11dd76['recipient']=_0x4a2108;socket[_0x2cab('0x4f')]('userNotification:send',_0x11dd76);});return _0x4166e4;});});})['then'](respondWithResult(_0x3328fe,0xc9))[_0x2cab('0x50')](handleError(_0x3328fe,null));};function getContent(_0x3f0a3b){return new BPromise(function(_0x242de7,_0x299e9d){if(_0x3f0a3b['text']){_0x242de7(_0x3f0a3b[_0x2cab('0x2f')]);return;}return db['Template']['findOne']({'attributes':['html'],'where':{'id':_0x3f0a3b[_0x2cab('0x30')]},'raw':!![]})['then'](function(_0x27a3d8){if(!_0x27a3d8)throw new db[(_0x2cab('0x31'))][(_0x2cab('0x32'))](_0x2cab('0x51'));var _0x4a53e2=Mustache[_0x2cab('0x52')](_0x27a3d8[_0x2cab('0x53')],_0x3f0a3b[_0x2cab('0x54')]);_0x242de7(_0x4a53e2);})[_0x2cab('0x50')](function(_0x39f35d){_0x299e9d(_0x39f35d);});});}function getRecipients(_0x19dc77){return new BPromise(function(_0x454f05,_0x4f39e9){var _0x3f1b4e=[];var _0x1872e1=[];_0x19dc77[_0x2cab('0x4e')](function(_0x13ef55){var _0x523b16=_['startCase'](_0x13ef55['model'][_0x2cab('0x40')]());if(_0x523b16==='User'){_0x3f1b4e=_[_0x2cab('0x55')](_0x3f1b4e,_0x13ef55['ids']);}else{if(_['includes'](_0x523b16,'queue'))_0x523b16=_0x523b16[_0x2cab('0x56')](_0x2cab('0x57'),_0x2cab('0x58'));_0x13ef55[_0x2cab('0x59')]['forEach'](function(_0x106c0c){_0x1872e1['push'](getAgents(_0x523b16,_0x106c0c));});}});return BPromise[_0x2cab('0x5a')](_0x1872e1)['then'](function(_0x16149c){_0x3f1b4e=_[_0x2cab('0x55')](_0x3f1b4e,_[_0x2cab('0x5b')](_0x16149c));_0x454f05(_0x3f1b4e);})[_0x2cab('0x50')](function(_0x50f6df){_0x4f39e9(_0x50f6df);});});}function getAgents(_0x1e3388,_0x2b0c54){return new BPromise(function(_0x4ff6b6,_0x43d33a){return db[_0x1e3388][_0x2cab('0x5c')]({'where':{'id':_0x2b0c54}})[_0x2cab('0x28')](function(_0x5bd615){return _0x5bd615[_0x2cab('0x5d')]({'attributes':['id'],'raw':!![]})[_0x2cab('0x28')](function(_0x291f4a){var _0x387179=_[_0x2cab('0x5e')](_0x291f4a,'id');_0x4ff6b6(_0x387179);});})[_0x2cab('0x50')](function(_0x2f82ec){_0x43d33a(_0x2f82ec);});});} \ No newline at end of file +var _0x5c4b=['localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','name','send','sendUserNotification','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','UserNotification','create','forEach','emit','userNotification:send','catch','findOne','html','render','startCase','User','ids','queue','replace','Queue','push','all','union','flatten','getAgents','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis'];(function(_0x5dd777,_0x2d3c5c){var _0x559e8f=function(_0x12f4fb){while(--_0x12f4fb){_0x5dd777['push'](_0x5dd777['shift']());}};_0x559e8f(++_0x2d3c5c);}(_0x5c4b,0x116));var _0xb5c4=function(_0x74ae,_0x1e312a){_0x74ae=_0x74ae-0x0;var _0x37a11e=_0x5c4b[_0x74ae];return _0x37a11e;};'use strict';var emlformat=require(_0xb5c4('0x0'));var rimraf=require(_0xb5c4('0x1'));var zipdir=require(_0xb5c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb5c4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb5c4('0x4'));var util=require(_0xb5c4('0x5'));var path=require(_0xb5c4('0x6'));var sox=require(_0xb5c4('0x7'));var csv=require(_0xb5c4('0x8'));var ejs=require(_0xb5c4('0x9'));var fs=require('fs');var fs_extra=require(_0xb5c4('0xa'));var _=require(_0xb5c4('0xb'));var squel=require(_0xb5c4('0xc'));var crypto=require(_0xb5c4('0xd'));var jsforce=require(_0xb5c4('0xe'));var deskjs=require(_0xb5c4('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb5c4('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb5c4('0x11'));var qs=require(_0xb5c4('0x12'));var as=require(_0xb5c4('0x13'));var hardwareService=require(_0xb5c4('0x14'));var logger=require(_0xb5c4('0x15'))(_0xb5c4('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb5c4('0x17'))['db'];config[_0xb5c4('0x18')]=_['defaults'](config[_0xb5c4('0x18')],{'host':_0xb5c4('0x19'),'port':0x18eb});var socket=require(_0xb5c4('0x1a'))(new Redis(config[_0xb5c4('0x18')]));require(_0xb5c4('0x1b'))[_0xb5c4('0x1c')](socket);function respondWithStatusCode(_0x135d6e,_0x9e9507){_0x9e9507=_0x9e9507||0xcc;return function(_0x962171){if(_0x962171){return _0x135d6e[_0xb5c4('0x1d')](_0x9e9507);}return _0x135d6e[_0xb5c4('0x1e')](_0x9e9507)[_0xb5c4('0x1f')]();};}function respondWithResult(_0x1140e5,_0x48b5ee){_0x48b5ee=_0x48b5ee||0xc8;return function(_0x5a2efb){if(_0x5a2efb){return _0x1140e5[_0xb5c4('0x1e')](_0x48b5ee)[_0xb5c4('0x20')](_0x5a2efb);}};}function respondWithFilteredResult(_0x51a8d5,_0x14b4a8){return function(_0x3a0d5d){if(_0x3a0d5d){var _0xe297c3=typeof _0x14b4a8[_0xb5c4('0x21')]===_0xb5c4('0x22')&&typeof _0x14b4a8[_0xb5c4('0x23')]===_0xb5c4('0x22');var _0x3a1a13=_0x3a0d5d[_0xb5c4('0x24')];var _0x24802f=_0xe297c3?0x0:_0x14b4a8[_0xb5c4('0x21')];var _0x1a350a=_0xe297c3?_0x3a0d5d[_0xb5c4('0x24')]:_0x14b4a8[_0xb5c4('0x21')]+_0x14b4a8[_0xb5c4('0x23')];var _0x16c749;if(_0x1a350a>=_0x3a1a13){_0x1a350a=_0x3a1a13;_0x16c749=0xc8;}else{_0x16c749=0xce;}_0x51a8d5['status'](_0x16c749);return _0x51a8d5['set'](_0xb5c4('0x25'),_0x24802f+'-'+_0x1a350a+'/'+_0x3a1a13)[_0xb5c4('0x20')](_0x3a0d5d);}return null;};}function patchUpdates(_0xc7b98){return function(_0x73a1ec){try{jsonpatch[_0xb5c4('0x26')](_0x73a1ec,_0xc7b98,!![]);}catch(_0x4bd3e2){return BPromise['reject'](_0x4bd3e2);}return _0x73a1ec[_0xb5c4('0x27')]();};}function saveUpdates(_0x3e5137,_0x2149ff){return function(_0x1b80cb){if(_0x1b80cb){return _0x1b80cb[_0xb5c4('0x28')](_0x3e5137)[_0xb5c4('0x29')](function(_0x189bdc){return _0x189bdc;});}return null;};}function removeEntity(_0x2c19a0,_0x14f0b7){return function(_0x485605){if(_0x485605){return _0x485605['destroy']()[_0xb5c4('0x29')](function(){_0x2c19a0[_0xb5c4('0x1e')](0xcc)[_0xb5c4('0x1f')]();});}};}function handleEntityNotFound(_0x953119,_0x64a727){return function(_0x4cfef4){if(!_0x4cfef4){_0x953119[_0xb5c4('0x1d')](0x194);}return _0x4cfef4;};}function handleError(_0x43016e,_0x5e10c6){_0x5e10c6=_0x5e10c6||0x1f4;return function(_0x27648d){logger[_0xb5c4('0x2a')](_0x27648d['stack']);if(_0x27648d[_0xb5c4('0x2b')]){delete _0x27648d['name'];}_0x43016e[_0xb5c4('0x1e')](_0x5e10c6)[_0xb5c4('0x2c')](_0x27648d);};}exports[_0xb5c4('0x2d')]=function(_0x1801d8,_0x19c546,_0x4620eb){if(!_0x1801d8[_0xb5c4('0x2e')][_0xb5c4('0x2f')](_0xb5c4('0x30'))&&!_0x1801d8['body'][_0xb5c4('0x2f')]('TemplateId')){throw new db[(_0xb5c4('0x31'))][(_0xb5c4('0x32'))](_0xb5c4('0x33'));}else{if(_0x1801d8[_0xb5c4('0x2e')][_0xb5c4('0x2f')](_0xb5c4('0x34'))&&!_0x1801d8[_0xb5c4('0x2e')]['hasOwnProperty'](_0xb5c4('0x35'))){throw new db[(_0xb5c4('0x31'))][(_0xb5c4('0x32'))](_0xb5c4('0x36'));}if(!_0x1801d8[_0xb5c4('0x2e')]['hasOwnProperty'](_0xb5c4('0x37'))){throw new db[(_0xb5c4('0x31'))][(_0xb5c4('0x32'))](_0xb5c4('0x38'));}else{try{var _0x18d662=JSON[_0xb5c4('0x39')](_0x1801d8['body'][_0xb5c4('0x37')]);}catch(_0x25055b){logger[_0xb5c4('0x2a')](_0x25055b);throw new db['Sequelize'][(_0xb5c4('0x32'))](_0xb5c4('0x3a'));}var _0x1786a2=[_0xb5c4('0x3b'),_0xb5c4('0x3c'),_0xb5c4('0x3d'),_0xb5c4('0x3e'),_0xb5c4('0x3f'),_0xb5c4('0x40'),_0xb5c4('0x41'),_0xb5c4('0x42'),_0xb5c4('0x43')];if(_[_0xb5c4('0x44')](_0x18d662,function(_0xab37e){return!_['includes'](_0x1786a2,_0xab37e[_0xb5c4('0x45')][_0xb5c4('0x46')]());})){throw new db[(_0xb5c4('0x31'))]['ValidationError'](_0xb5c4('0x47'));}}}var _0x44a6db={};_0x44a6db[_0xb5c4('0x48')]=_0x1801d8[_0xb5c4('0x2e')]['hasOwnProperty'](_0xb5c4('0x48'))?_0x1801d8[_0xb5c4('0x2e')]['senderName']:_0x1801d8[_0xb5c4('0x43')][_0xb5c4('0x49')];_0x44a6db[_0xb5c4('0x4a')]=_[_0xb5c4('0x4b')](_0x1801d8[_0xb5c4('0x2e')]['recipientsDescription'])?null:_0x1801d8[_0xb5c4('0x2e')][_0xb5c4('0x4a')];_0x44a6db[_0xb5c4('0x4c')]=_0x1801d8[_0xb5c4('0x2e')][_0xb5c4('0x4c')]||![];_0x44a6db[_0xb5c4('0x4d')]=_0x1801d8['user']['id'];return getContent(_0x1801d8['body'])[_0xb5c4('0x29')](function(_0xd0b892){_0x44a6db[_0xb5c4('0x2e')]=_0xd0b892;return getRecipients(_0x18d662);})[_0xb5c4('0x29')](function(_0x46ae0d){_0x44a6db[_0xb5c4('0x4e')]=_[_0xb5c4('0x4f')](_0x46ae0d)[_0xb5c4('0x50')](',');return db['sequelize']['transaction'](function(_0x4ba46f){return db[_0xb5c4('0x51')][_0xb5c4('0x52')](_0x44a6db,{'raw':!![],'transaction':_0x4ba46f})[_0xb5c4('0x29')](function(_0x47d925){var _0x3e7da1={'sender':_0x44a6db[_0xb5c4('0x48')],'description':_0x44a6db[_0xb5c4('0x4a')],'content':_0x44a6db['body'],'beep':_0x44a6db[_0xb5c4('0x4c')]};_0x46ae0d[_0xb5c4('0x53')](function(_0x5c2400){_0x3e7da1['recipient']=_0x5c2400;socket[_0xb5c4('0x54')](_0xb5c4('0x55'),_0x3e7da1);});return _0x47d925;});});})[_0xb5c4('0x29')](respondWithResult(_0x19c546,0xc9))[_0xb5c4('0x56')](handleError(_0x19c546,null));};function getContent(_0x4ff0a8){return new BPromise(function(_0xd5778b,_0x2d3ec2){if(_0x4ff0a8[_0xb5c4('0x30')]){_0xd5778b(_0x4ff0a8[_0xb5c4('0x30')]);return;}return db['Template'][_0xb5c4('0x57')]({'attributes':[_0xb5c4('0x58')],'where':{'id':_0x4ff0a8[_0xb5c4('0x34')]},'raw':!![]})[_0xb5c4('0x29')](function(_0x242188){if(!_0x242188)throw new db['Sequelize'][(_0xb5c4('0x32'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x25599d=Mustache[_0xb5c4('0x59')](_0x242188[_0xb5c4('0x58')],_0x4ff0a8['view']);_0xd5778b(_0x25599d);})['catch'](function(_0xb87bf){_0x2d3ec2(_0xb87bf);});});}function getRecipients(_0x480df4){return new BPromise(function(_0x308707,_0x325b4e){var _0x1a4384=[];var _0x5ae7ff=[];_0x480df4[_0xb5c4('0x53')](function(_0x4c2e14){var _0x1f60b2=_[_0xb5c4('0x5a')](_0x4c2e14[_0xb5c4('0x45')][_0xb5c4('0x46')]());if(_0x1f60b2===_0xb5c4('0x5b')){_0x1a4384=_['union'](_0x1a4384,_0x4c2e14[_0xb5c4('0x5c')]);}else{if(_['includes'](_0x1f60b2,_0xb5c4('0x5d')))_0x1f60b2=_0x1f60b2[_0xb5c4('0x5e')](_0xb5c4('0x5d'),_0xb5c4('0x5f'));_0x4c2e14[_0xb5c4('0x5c')]['forEach'](function(_0xcf1aac){_0x5ae7ff[_0xb5c4('0x60')](getAgents(_0x1f60b2,_0xcf1aac));});}});return BPromise[_0xb5c4('0x61')](_0x5ae7ff)[_0xb5c4('0x29')](function(_0x2fc0df){_0x1a4384=_[_0xb5c4('0x62')](_0x1a4384,_[_0xb5c4('0x63')](_0x2fc0df));_0x308707(_0x1a4384);})[_0xb5c4('0x56')](function(_0x5d5e99){_0x325b4e(_0x5d5e99);});});}function getAgents(_0x58bab5,_0x45545f){return new BPromise(function(_0xb5b8a8,_0x39c07a){return db[_0x58bab5]['findOne']({'where':{'id':_0x45545f}})[_0xb5c4('0x29')](function(_0xe6b71b){return _0xe6b71b[_0xb5c4('0x64')]({'attributes':['id'],'raw':!![]})['then'](function(_0x477b28){var _0x99587f=_['map'](_0x477b28,'id');_0xb5b8a8(_0x99587f);});})[_0xb5c4('0x56')](function(_0x14c1cd){_0x39c07a(_0x14c1cd);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 09402c6..ec20b4a 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 _0x374f=['UserNotification','save','update','remove','emit','hook','exports'];(function(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0x374f,0x142));var _0xf374=function(_0x21113c,_0x1ed17f){_0x21113c=_0x21113c-0x0;var _0x366a3e=_0x374f[_0x21113c];return _0x366a3e;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db'][_0xf374('0x0')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf374('0x1'),'afterUpdate':_0xf374('0x2'),'afterDestroy':_0xf374('0x3')};function emitEvent(_0x5218c0){return function(_0x4cab01,_0x24f436,_0x160416){UserNotificationEvents[_0xf374('0x4')](_0x5218c0+':'+_0x4cab01['id'],_0x4cab01);UserNotificationEvents[_0xf374('0x4')](_0x5218c0,_0x4cab01);_0x160416(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xf374('0x5')](e,emitEvent(event));}}module[_0xf374('0x6')]=UserNotificationEvents; \ No newline at end of file +var _0xcba5=['UserNotification','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x3e2e80,_0x379a91){var _0x14230f=function(_0x51f4a9){while(--_0x51f4a9){_0x3e2e80['push'](_0x3e2e80['shift']());}};_0x14230f(++_0x379a91);}(_0xcba5,0x107));var _0x5cba=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xcba5[_0xdea41a];return _0x15d0d8;};'use strict';var EventEmitter=require(_0x5cba('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x5cba('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x5cba('0x2')](0x0);var events={'afterCreate':_0x5cba('0x3'),'afterUpdate':'update','afterDestroy':_0x5cba('0x4')};function emitEvent(_0x18bb2b){return function(_0x53ab4b,_0x579246,_0x22dd0a){UserNotificationEvents[_0x5cba('0x5')](_0x18bb2b+':'+_0x53ab4b['id'],_0x53ab4b);UserNotificationEvents['emit'](_0x18bb2b,_0x53ab4b);_0x22dd0a(null);};}for(var e in events){if(events[_0x5cba('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x5cba('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 4582f46..d73ede9 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 _0xbb8e=['define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./userNotification.attributes'];(function(_0x5453d7,_0x40c399){var _0x523fb4=function(_0x35ed79){while(--_0x35ed79){_0x5453d7['push'](_0x5453d7['shift']());}};_0x523fb4(++_0x40c399);}(_0xbb8e,0x164));var _0xebb8=function(_0x1bbaec,_0x5cd74d){_0x1bbaec=_0x1bbaec-0x0;var _0x445f83=_0xbb8e[_0x1bbaec];return _0x445f83;};'use strict';var _=require(_0xebb8('0x0'));var util=require(_0xebb8('0x1'));var logger=require(_0xebb8('0x2'))(_0xebb8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xebb8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xebb8('0x5'));var config=require(_0xebb8('0x6'));var attributes=require(_0xebb8('0x7'));module['exports']=function(_0x14fb20,_0x59199b){return _0x14fb20[_0xebb8('0x8')](_0xebb8('0x9'),attributes,{'tableName':_0xebb8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xebb8('0xb'),'collate':_0xebb8('0xc')});}; \ No newline at end of file +var _0x51a1=['moment','bluebird','request-promise','rimraf','../../config/environment','./userNotification.attributes','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x399cd0,_0x3e4df6){var _0x36f4a6=function(_0x40db77){while(--_0x40db77){_0x399cd0['push'](_0x399cd0['shift']());}};_0x36f4a6(++_0x3e4df6);}(_0x51a1,0x1b7));var _0x151a=function(_0x5c3c64,_0x5868f9){_0x5c3c64=_0x5c3c64-0x0;var _0x658de1=_0x51a1[_0x5c3c64];return _0x658de1;};'use strict';var _=require(_0x151a('0x0'));var util=require(_0x151a('0x1'));var logger=require('../../config/logger')(_0x151a('0x2'));var moment=require(_0x151a('0x3'));var BPromise=require(_0x151a('0x4'));var rp=require(_0x151a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x151a('0x6'));var config=require(_0x151a('0x7'));var attributes=require(_0x151a('0x8'));module['exports']=function(_0x2d8fba,_0x5cf0e7){return _0x2d8fba['define'](_0x151a('0x9'),attributes,{'tableName':_0x151a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x151a('0xb'),'collate':_0x151a('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index a2e2a47..cd5cf8f 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 _0x80fb=['client','http','redis','defaults','./userNotification.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','UserNotification,\x20%s,\x20%s','message','catch','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x367385,_0x1f9e55){var _0x3c0351=function(_0x397a28){while(--_0x397a28){_0x367385['push'](_0x367385['shift']());}};_0x3c0351(++_0x1f9e55);}(_0x80fb,0x101));var _0xb80f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x80fb[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xb80f('0x0'));var moment=require(_0xb80f('0x1'));var BPromise=require(_0xb80f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb80f('0x3'));var logger=require(_0xb80f('0x4'))(_0xb80f('0x5'));var config=require(_0xb80f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb80f('0x7')][_0xb80f('0x8')]({'port':0x232a});config[_0xb80f('0x9')]=_[_0xb80f('0xa')](config[_0xb80f('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb80f('0x9')]));require(_0xb80f('0xb'))[_0xb80f('0xc')](socket);function respondWithRpcPromise(_0x4cbb1a,_0x21e3ff,_0x2ec9f2){return new BPromise(function(_0xf96456,_0x3380d8){return client[_0xb80f('0xd')](_0x4cbb1a,_0x2ec9f2)[_0xb80f('0xe')](function(_0xfdd1e7){logger[_0xb80f('0xf')]('UserNotification,\x20%s,\x20%s',_0x21e3ff,_0xb80f('0x10'));logger[_0xb80f('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x21e3ff,'request\x20sent',JSON[_0xb80f('0x12')](_0xfdd1e7));if(_0xfdd1e7[_0xb80f('0x13')]){if(_0xfdd1e7[_0xb80f('0x13')][_0xb80f('0x14')]===0x1f4){logger[_0xb80f('0x13')](_0xb80f('0x15'),_0x21e3ff,_0xfdd1e7[_0xb80f('0x13')]['message']);return _0x3380d8(_0xfdd1e7[_0xb80f('0x13')][_0xb80f('0x16')]);}logger[_0xb80f('0x13')](_0xb80f('0x15'),_0x21e3ff,_0xfdd1e7[_0xb80f('0x13')][_0xb80f('0x16')]);return _0xf96456(_0xfdd1e7[_0xb80f('0x13')]['message']);}else{logger[_0xb80f('0xf')](_0xb80f('0x15'),_0x21e3ff,'request\x20sent');_0xf96456(_0xfdd1e7['result'][_0xb80f('0x16')]);}})[_0xb80f('0x17')](function(_0x52511c){logger['error']('UserNotification,\x20%s,\x20%s',_0x21e3ff,_0x52511c);_0x3380d8(_0x52511c);});});} \ No newline at end of file +var _0xebb1=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','../../mysqldb'];(function(_0x3cd9b9,_0x3ab0bd){var _0x12a304=function(_0x213a15){while(--_0x213a15){_0x3cd9b9['push'](_0x3cd9b9['shift']());}};_0x12a304(++_0x3ab0bd);}(_0xebb1,0xde));var _0x1ebb=function(_0x40b8b5,_0x4ae34b){_0x40b8b5=_0x40b8b5-0x0;var _0xab4caa=_0xebb1[_0x40b8b5];return _0xab4caa;};'use strict';var _=require('lodash');var util=require(_0x1ebb('0x0'));var moment=require(_0x1ebb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ebb('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ebb('0x3'))('rpc');var config=require(_0x1ebb('0x4'));var jayson=require(_0x1ebb('0x5'));var client=jayson[_0x1ebb('0x6')][_0x1ebb('0x7')]({'port':0x232a});config[_0x1ebb('0x8')]=_[_0x1ebb('0x9')](config[_0x1ebb('0x8')],{'host':_0x1ebb('0xa'),'port':0x18eb});var socket=require(_0x1ebb('0xb'))(new Redis(config[_0x1ebb('0x8')]));require(_0x1ebb('0xc'))[_0x1ebb('0xd')](socket);function respondWithRpcPromise(_0x397304,_0x59aab0,_0x506913){return new BPromise(function(_0x5b7610,_0x465492){return client[_0x1ebb('0xe')](_0x397304,_0x506913)['then'](function(_0x60fb73){logger[_0x1ebb('0xf')](_0x1ebb('0x10'),_0x59aab0,_0x1ebb('0x11'));logger[_0x1ebb('0x12')](_0x1ebb('0x13'),_0x59aab0,'request\x20sent',JSON[_0x1ebb('0x14')](_0x60fb73));if(_0x60fb73['error']){if(_0x60fb73[_0x1ebb('0x15')][_0x1ebb('0x16')]===0x1f4){logger['error'](_0x1ebb('0x10'),_0x59aab0,_0x60fb73[_0x1ebb('0x15')][_0x1ebb('0x17')]);return _0x465492(_0x60fb73[_0x1ebb('0x15')][_0x1ebb('0x17')]);}logger[_0x1ebb('0x15')](_0x1ebb('0x10'),_0x59aab0,_0x60fb73[_0x1ebb('0x15')]['message']);return _0x5b7610(_0x60fb73['error'][_0x1ebb('0x17')]);}else{logger['info'](_0x1ebb('0x10'),_0x59aab0,_0x1ebb('0x11'));_0x5b7610(_0x60fb73['result'][_0x1ebb('0x17')]);}})[_0x1ebb('0x18')](function(_0x2c31b4){logger[_0x1ebb('0x15')]('UserNotification,\x20%s,\x20%s',_0x59aab0,_0x2c31b4);_0x465492(_0x2c31b4);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 8ba3862..4810f5d 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 _0xa49b=['./userNotification.events','save','remove','update','emit','removeListener','length','userNotification:'];(function(_0x1d5dde,_0x5d0adc){var _0xeb8b85=function(_0x13d7b3){while(--_0x13d7b3){_0x1d5dde['push'](_0x1d5dde['shift']());}};_0xeb8b85(++_0x5d0adc);}(_0xa49b,0x188));var _0xba49=function(_0x28f12a,_0x54dcb1){_0x28f12a=_0x28f12a-0x0;var _0x3ca417=_0xa49b[_0x28f12a];return _0x3ca417;};'use strict';var UserNotificationEvents=require(_0xba49('0x0'));var events=[_0xba49('0x1'),_0xba49('0x2'),_0xba49('0x3')];function createListener(_0x2b3b56,_0xa24f99){return function(_0x33ab12){_0xa24f99[_0xba49('0x4')](_0x2b3b56,_0x33ab12);};}function removeListener(_0x5c05fd,_0xd7ed5a){return function(){UserNotificationEvents[_0xba49('0x5')](_0x5c05fd,_0xd7ed5a);};}exports['register']=function(_0x20b3fc){for(var _0x38dbca=0x0,_0x7fe06e=events[_0xba49('0x6')];_0x38dbca<_0x7fe06e;_0x38dbca++){var _0x1a4042=events[_0x38dbca];var _0x1a5482=createListener(_0xba49('0x7')+_0x1a4042,_0x20b3fc);UserNotificationEvents['on'](_0x1a4042,_0x1a5482);}}; \ No newline at end of file +var _0x55d4=['emit','register','./userNotification.events','save'];(function(_0x380858,_0x35763a){var _0x5538ad=function(_0x2d43e3){while(--_0x2d43e3){_0x380858['push'](_0x380858['shift']());}};_0x5538ad(++_0x35763a);}(_0x55d4,0x14e));var _0x455d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x55d4[_0x59ee6f];return _0x4c0979;};'use strict';var UserNotificationEvents=require(_0x455d('0x0'));var events=[_0x455d('0x1'),'remove','update'];function createListener(_0x34a225,_0x3cd71b){return function(_0x322bb7){_0x3cd71b[_0x455d('0x2')](_0x34a225,_0x322bb7);};}function removeListener(_0x51d9f5,_0x3f9460){return function(){UserNotificationEvents['removeListener'](_0x51d9f5,_0x3f9460);};}exports[_0x455d('0x3')]=function(_0x5602df){for(var _0x1342e1=0x0,_0x58f01a=events['length'];_0x1342e1<_0x58f01a;_0x1342e1++){var _0x47ea3e=events[_0x1342e1];var _0x73fc00=createListener('userNotification:'+_0x47ea3e,_0x5602df);UserNotificationEvents['on'](_0x47ea3e,_0x73fc00);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 2e5b506..b39c8a9 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x13c68a,_0x5b3be2){var _0x299b3c=function(_0x2ecfb5){while(--_0x2ecfb5){_0x13c68a['push'](_0x13c68a['shift']());}};_0x299b3c(++_0x5b3be2);}(_0xedd9,0xfc));var _0x9edd=function(_0x2ca4d,_0x57ebf4){_0x2ca4d=_0x2ca4d-0x0;var _0x20cff6=_0xedd9[_0x2ca4d];return _0x20cff6;};'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(_0x482d2d,_0x42f02c){var _0x56a956=function(_0x1fa1d3){while(--_0x1fa1d3){_0x482d2d['push'](_0x482d2d['shift']());}};_0x56a956(++_0x42f02c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0xcb91[_0x2181fc];return _0x315da1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 9e2e2ec..2699bfa 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 _0xb3e9=['INTEGER','sequelize'];(function(_0x4bf0d4,_0x594635){var _0x29f6ea=function(_0x98295b){while(--_0x98295b){_0x4bf0d4['push'](_0x4bf0d4['shift']());}};_0x29f6ea(++_0x594635);}(_0xb3e9,0x1eb));var _0x9b3e=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xb3e9[_0x5cb1af];return _0x8d7940;};'use strict';var Sequelize=require(_0x9b3e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x9b3e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1d59=['sequelize','INTEGER'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x1d59,0xa6));var _0x91d5=function(_0xf73d44,_0x25a6ca){_0xf73d44=_0xf73d44-0x0;var _0x87bd17=_0x1d59[_0xf73d44];return _0x87bd17;};'use strict';var Sequelize=require(_0x91d5('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x91d5('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 07ec5e5..e3daba7 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 _0xaed8=['request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','lodash','api','bluebird'];(function(_0x3533cd,_0x3193d1){var _0x4b9f24=function(_0x14f1d3){while(--_0x14f1d3){_0x3533cd['push'](_0x3533cd['shift']());}};_0x4b9f24(++_0x3193d1);}(_0xaed8,0x1ec));var _0x8aed=function(_0x25b4a4,_0x2e081b){_0x25b4a4=_0x25b4a4-0x0;var _0x707267=_0xaed8[_0x25b4a4];return _0x707267;};'use strict';var _=require(_0x8aed('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8aed('0x1'));var moment=require('moment');var BPromise=require(_0x8aed('0x2'));var rp=require(_0x8aed('0x3'));var fs=require('fs');var path=require(_0x8aed('0x4'));var rimraf=require(_0x8aed('0x5'));var config=require(_0x8aed('0x6'));var attributes=require(_0x8aed('0x7'));module[_0x8aed('0x8')]=function(_0x11043f,_0x4aa29c){return _0x11043f['define']('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccfc=['../../config/environment','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x55a740,_0x5dd8ba){var _0x5702f8=function(_0x1873a4){while(--_0x1873a4){_0x55a740['push'](_0x55a740['shift']());}};_0x5702f8(++_0x5dd8ba);}(_0xccfc,0xad));var _0xcccf=function(_0xa37d48,_0x4b7572){_0xa37d48=_0xa37d48-0x0;var _0x897678=_0xccfc[_0xa37d48];return _0x897678;};'use strict';var _=require(_0xcccf('0x0'));var util=require(_0xcccf('0x1'));var logger=require(_0xcccf('0x2'))(_0xcccf('0x3'));var moment=require(_0xcccf('0x4'));var BPromise=require(_0xcccf('0x5'));var rp=require(_0xcccf('0x6'));var fs=require('fs');var path=require(_0xcccf('0x7'));var rimraf=require(_0xcccf('0x8'));var config=require(_0xcccf('0x9'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xcccf('0xa')]=function(_0x240362,_0x221059){return _0x240362[_0xcccf('0xb')](_0xcccf('0xc'),attributes,{'tableName':_0xcccf('0xd'),'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 c7250b6..4988111 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 _0xb3ae=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3ae,0x75));var _0xeb3a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xb3ae[_0x51020b];return _0x371e47;};'use strict';var _=require('lodash');var util=require(_0xeb3a('0x0'));var moment=require(_0xeb3a('0x1'));var BPromise=require(_0xeb3a('0x2'));var rs=require(_0xeb3a('0x3'));var fs=require('fs');var Redis=require(_0xeb3a('0x4'));var db=require(_0xeb3a('0x5'))['db'];var utils=require(_0xeb3a('0x6'));var logger=require(_0xeb3a('0x7'))(_0xeb3a('0x8'));var config=require('../../config/environment');var jayson=require(_0xeb3a('0x9'));var client=jayson[_0xeb3a('0xa')][_0xeb3a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a5238,_0x453748,_0x324da1){return new BPromise(function(_0x183e46,_0x58da62){return client[_0xeb3a('0xc')](_0x5a5238,_0x324da1)[_0xeb3a('0xd')](function(_0x595a7d){logger[_0xeb3a('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x453748,_0xeb3a('0xf'));logger['debug'](_0xeb3a('0x10'),_0x453748,_0xeb3a('0xf'),JSON['stringify'](_0x595a7d));if(_0x595a7d[_0xeb3a('0x11')]){if(_0x595a7d[_0xeb3a('0x11')][_0xeb3a('0x12')]===0x1f4){logger['error'](_0xeb3a('0x13'),_0x453748,_0x595a7d[_0xeb3a('0x11')][_0xeb3a('0x14')]);return _0x58da62(_0x595a7d[_0xeb3a('0x11')][_0xeb3a('0x14')]);}logger[_0xeb3a('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x453748,_0x595a7d[_0xeb3a('0x11')][_0xeb3a('0x14')]);return _0x183e46(_0x595a7d[_0xeb3a('0x11')][_0xeb3a('0x14')]);}else{logger[_0xeb3a('0xe')](_0xeb3a('0x13'),_0x453748,_0xeb3a('0xf'));_0x183e46(_0x595a7d[_0xeb3a('0x15')][_0xeb3a('0x14')]);}})[_0xeb3a('0x16')](function(_0xde18ad){logger[_0xeb3a('0x11')](_0xeb3a('0x13'),_0x453748,_0xde18ad);_0x58da62(_0xde18ad);});});} \ No newline at end of file +var _0xd364=['UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x34b802,_0x1267be){var _0x2eab82=function(_0x1b09e4){while(--_0x1b09e4){_0x34b802['push'](_0x34b802['shift']());}};_0x2eab82(++_0x1267be);}(_0xd364,0x162));var _0x4d36=function(_0x501136,_0x9e843){_0x501136=_0x501136-0x0;var _0x5e7acd=_0xd364[_0x501136];return _0x5e7acd;};'use strict';var _=require(_0x4d36('0x0'));var util=require(_0x4d36('0x1'));var moment=require(_0x4d36('0x2'));var BPromise=require('bluebird');var rs=require(_0x4d36('0x3'));var fs=require('fs');var Redis=require(_0x4d36('0x4'));var db=require(_0x4d36('0x5'))['db'];var utils=require(_0x4d36('0x6'));var logger=require(_0x4d36('0x7'))('rpc');var config=require(_0x4d36('0x8'));var jayson=require(_0x4d36('0x9'));var client=jayson[_0x4d36('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb830af,_0x485a5d,_0xf62386){return new BPromise(function(_0x25cae4,_0x597d2d){return client[_0x4d36('0xb')](_0xb830af,_0xf62386)[_0x4d36('0xc')](function(_0x546f6a){logger[_0x4d36('0xd')](_0x4d36('0xe'),_0x485a5d,_0x4d36('0xf'));logger[_0x4d36('0x10')](_0x4d36('0x11'),_0x485a5d,'request\x20sent',JSON[_0x4d36('0x12')](_0x546f6a));if(_0x546f6a[_0x4d36('0x13')]){if(_0x546f6a[_0x4d36('0x13')][_0x4d36('0x14')]===0x1f4){logger[_0x4d36('0x13')](_0x4d36('0xe'),_0x485a5d,_0x546f6a[_0x4d36('0x13')][_0x4d36('0x15')]);return _0x597d2d(_0x546f6a[_0x4d36('0x13')][_0x4d36('0x15')]);}logger[_0x4d36('0x13')](_0x4d36('0xe'),_0x485a5d,_0x546f6a[_0x4d36('0x13')][_0x4d36('0x15')]);return _0x25cae4(_0x546f6a['error'][_0x4d36('0x15')]);}else{logger['info'](_0x4d36('0xe'),_0x485a5d,'request\x20sent');_0x25cae4(_0x546f6a[_0x4d36('0x16')]['message']);}})['catch'](function(_0x3d7a87){logger[_0x4d36('0x13')](_0x4d36('0xe'),_0x485a5d,_0x3d7a87);_0x597d2d(_0x3d7a87);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 5d940be..5c40f01 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 _0x0ef2=['index','/describe','describe','/:id','show','/:id/sections','getSections','getResources','post','create','/:id/clone','clone','addSections','addResources','destroy','delete','removeSections','/:id/resources','removeResources','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x0ef2,0x169));var _0x20ef=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0x0ef2[_0x152121];return _0x592a85;};'use strict';var multer=require(_0x20ef('0x0'));var util=require(_0x20ef('0x1'));var path=require(_0x20ef('0x2'));var timeout=require(_0x20ef('0x3'));var express=require('express');var router=express[_0x20ef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x20ef('0x5'));var interaction=require(_0x20ef('0x6'));var config=require(_0x20ef('0x7'));var controller=require(_0x20ef('0x8'));router[_0x20ef('0x9')]('/',auth[_0x20ef('0xa')](),controller[_0x20ef('0xb')]);router[_0x20ef('0x9')](_0x20ef('0xc'),auth[_0x20ef('0xa')](),controller[_0x20ef('0xd')]);router['get'](_0x20ef('0xe'),auth[_0x20ef('0xa')](),controller[_0x20ef('0xf')]);router[_0x20ef('0x9')](_0x20ef('0x10'),auth[_0x20ef('0xa')](),controller[_0x20ef('0x11')]);router[_0x20ef('0x9')]('/:id/resources',auth['isAuthenticated'](),controller[_0x20ef('0x12')]);router[_0x20ef('0x13')]('/',auth[_0x20ef('0xa')](),controller[_0x20ef('0x14')]);router[_0x20ef('0x13')](_0x20ef('0x15'),auth['isAuthenticated'](),controller[_0x20ef('0x16')]);router['post'](_0x20ef('0x10'),auth[_0x20ef('0xa')](),controller[_0x20ef('0x17')]);router[_0x20ef('0x13')]('/:id/resources',auth[_0x20ef('0xa')](),controller[_0x20ef('0x18')]);router['put'](_0x20ef('0xe'),auth[_0x20ef('0xa')](),controller['update']);router['delete'](_0x20ef('0xe'),auth['isAuthenticated'](),controller[_0x20ef('0x19')]);router[_0x20ef('0x1a')](_0x20ef('0x10'),auth['isAuthenticated'](),controller[_0x20ef('0x1b')]);router[_0x20ef('0x1a')](_0x20ef('0x1c'),auth[_0x20ef('0xa')](),controller[_0x20ef('0x1d')]);module[_0x20ef('0x1e')]=router; \ No newline at end of file +var _0x6910=['../../components/auth/service','./userProfile.controller','get','index','/describe','describe','/:id','isAuthenticated','getSections','/:id/resources','getResources','post','create','/:id/clone','addResources','put','update','delete','/:id/sections','removeSections','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1ad926,_0x3e1fed){var _0x1b81dc=function(_0x506f83){while(--_0x506f83){_0x1ad926['push'](_0x1ad926['shift']());}};_0x1b81dc(++_0x3e1fed);}(_0x6910,0x159));var _0x0691=function(_0x322306,_0x31fc80){_0x322306=_0x322306-0x0;var _0x4f9152=_0x6910[_0x322306];return _0x4f9152;};'use strict';var multer=require(_0x0691('0x0'));var util=require('util');var path=require(_0x0691('0x1'));var timeout=require(_0x0691('0x2'));var express=require(_0x0691('0x3'));var router=express[_0x0691('0x4')]();var fs_extra=require(_0x0691('0x5'));var auth=require(_0x0691('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0691('0x7'));router[_0x0691('0x8')]('/',auth['isAuthenticated'](),controller[_0x0691('0x9')]);router[_0x0691('0x8')](_0x0691('0xa'),auth['isAuthenticated'](),controller[_0x0691('0xb')]);router[_0x0691('0x8')](_0x0691('0xc'),auth[_0x0691('0xd')](),controller['show']);router['get']('/:id/sections',auth[_0x0691('0xd')](),controller[_0x0691('0xe')]);router[_0x0691('0x8')](_0x0691('0xf'),auth[_0x0691('0xd')](),controller[_0x0691('0x10')]);router[_0x0691('0x11')]('/',auth[_0x0691('0xd')](),controller[_0x0691('0x12')]);router[_0x0691('0x11')](_0x0691('0x13'),auth['isAuthenticated'](),controller['clone']);router[_0x0691('0x11')]('/:id/sections',auth[_0x0691('0xd')](),controller['addSections']);router[_0x0691('0x11')](_0x0691('0xf'),auth[_0x0691('0xd')](),controller[_0x0691('0x14')]);router[_0x0691('0x15')](_0x0691('0xc'),auth[_0x0691('0xd')](),controller[_0x0691('0x16')]);router[_0x0691('0x17')]('/:id',auth[_0x0691('0xd')](),controller['destroy']);router[_0x0691('0x17')](_0x0691('0x18'),auth[_0x0691('0xd')](),controller[_0x0691('0x19')]);router[_0x0691('0x17')](_0x0691('0xf'),auth[_0x0691('0xd')](),controller['removeResources']);module[_0x0691('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 27639be..070d472 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 _0xbdc7=['setDataValue','crudPermissions','join','getDataValue','BOOLEAN','sequelize','exports','STRING'];(function(_0x41de6b,_0x46060c){var _0x8d343c=function(_0x56d057){while(--_0x56d057){_0x41de6b['push'](_0x41de6b['shift']());}};_0x8d343c(++_0x46060c);}(_0xbdc7,0x14d));var _0x7bdc=function(_0x5ea722,_0x5f755f){_0x5ea722=_0x5ea722-0x0;var _0x1e4dff=_0xbdc7[_0x5ea722];return _0x1e4dff;};'use strict';var Sequelize=require(_0x7bdc('0x0'));module[_0x7bdc('0x1')]={'name':{'type':Sequelize[_0x7bdc('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x7bdc('0x2')],'set':function(_0x23b375){this[_0x7bdc('0x3')](_0x7bdc('0x4'),_0x23b375?_0x23b375[_0x7bdc('0x5')](''):[]);},'get':function(){return this[_0x7bdc('0x6')]('crudPermissions')?this['getDataValue'](_0x7bdc('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x7bdc('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x7bdc('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x7bdc('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x7bdc('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x7bdc('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7bdc('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x7bdc('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7bdc('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2c0e=['crudPermissions','getDataValue','split','BOOLEAN','exports','STRING'];(function(_0x31e159,_0x476ca2){var _0x5144c0=function(_0x1c9de0){while(--_0x1c9de0){_0x31e159['push'](_0x31e159['shift']());}};_0x5144c0(++_0x476ca2);}(_0x2c0e,0x112));var _0xe2c0=function(_0x2d892a,_0x59e61a){_0x2d892a=_0x2d892a-0x0;var _0x367765=_0x2c0e[_0x2d892a];return _0x367765;};'use strict';var Sequelize=require('sequelize');module[_0xe2c0('0x0')]={'name':{'type':Sequelize[_0xe2c0('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x5d0d5a){this['setDataValue'](_0xe2c0('0x2'),_0x5d0d5a?_0x5d0d5a['join'](''):[]);},'get':function(){return this['getDataValue'](_0xe2c0('0x2'))?this[_0xe2c0('0x3')](_0xe2c0('0x2'))[_0xe2c0('0x4')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xe2c0('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xe2c0('0x5')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xe2c0('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xe2c0('0x5')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xe2c0('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xe2c0('0x5')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xe2c0('0x5')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 8e741cd..ddf5b24 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 _0xee87=['fields','length','find','catch','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','create','each','autoAssociation','UserProfileResource','sectionId','userProfileId','UserProfileSection','Resources','describe','addSections','ids','getSections','enabled','includes','isEmpty','subsections','push','findOne','Dashboard','resourceId','forEach','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','index','UserProfile','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes'];(function(_0x577fae,_0x1592d9){var _0x218b80=function(_0x1ac8ad){while(--_0x1ac8ad){_0x577fae['push'](_0x577fae['shift']());}};_0x218b80(++_0x1592d9);}(_0xee87,0x10d));var _0x7ee8=function(_0x1a2d93,_0x5e4948){_0x1a2d93=_0x1a2d93-0x0;var _0x369aa3=_0xee87[_0x1a2d93];return _0x369aa3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ee8('0x0'));var zipdir=require(_0x7ee8('0x1'));var jsonpatch=require(_0x7ee8('0x2'));var rp=require(_0x7ee8('0x3'));var moment=require(_0x7ee8('0x4'));var BPromise=require(_0x7ee8('0x5'));var Mustache=require(_0x7ee8('0x6'));var util=require(_0x7ee8('0x7'));var path=require(_0x7ee8('0x8'));var sox=require(_0x7ee8('0x9'));var csv=require('to-csv');var ejs=require(_0x7ee8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ee8('0xb'));var squel=require(_0x7ee8('0xc'));var crypto=require(_0x7ee8('0xd'));var jsforce=require(_0x7ee8('0xe'));var deskjs=require(_0x7ee8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7ee8('0x10'));var Redis=require('ioredis');var authService=require(_0x7ee8('0x11'));var qs=require(_0x7ee8('0x12'));var as=require(_0x7ee8('0x13'));var hardwareService=require(_0x7ee8('0x14'));var logger=require(_0x7ee8('0x15'))(_0x7ee8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7ee8('0x17'));var db=require(_0x7ee8('0x18'))['db'];config[_0x7ee8('0x19')]=_[_0x7ee8('0x1a')](config[_0x7ee8('0x19')],{'host':_0x7ee8('0x1b'),'port':0x18eb});var socket=require(_0x7ee8('0x1c'))(new Redis(config[_0x7ee8('0x19')]));require(_0x7ee8('0x1d'))[_0x7ee8('0x1e')](socket);function respondWithStatusCode(_0x1669d7,_0x3ac36a){_0x3ac36a=_0x3ac36a||0xcc;return function(_0x59a5d3){if(_0x59a5d3){return _0x1669d7[_0x7ee8('0x1f')](_0x3ac36a);}return _0x1669d7[_0x7ee8('0x20')](_0x3ac36a)[_0x7ee8('0x21')]();};}function respondWithResult(_0x192d8c,_0xf4a2c8){_0xf4a2c8=_0xf4a2c8||0xc8;return function(_0xc46e32){if(_0xc46e32){return _0x192d8c[_0x7ee8('0x20')](_0xf4a2c8)[_0x7ee8('0x22')](_0xc46e32);}};}function respondWithFilteredResult(_0x124442,_0x18d962){return function(_0x4028a7){if(_0x4028a7){var _0xf14110=typeof _0x18d962['offset']===_0x7ee8('0x23')&&typeof _0x18d962['limit']===_0x7ee8('0x23');var _0x459ad1=_0x4028a7['count'];var _0x59e544=_0xf14110?0x0:_0x18d962[_0x7ee8('0x24')];var _0x46a49d=_0xf14110?_0x4028a7[_0x7ee8('0x25')]:_0x18d962[_0x7ee8('0x24')]+_0x18d962[_0x7ee8('0x26')];var _0x49f7e0;if(_0x46a49d>=_0x459ad1){_0x46a49d=_0x459ad1;_0x49f7e0=0xc8;}else{_0x49f7e0=0xce;}_0x124442[_0x7ee8('0x20')](_0x49f7e0);return _0x124442[_0x7ee8('0x27')](_0x7ee8('0x28'),_0x59e544+'-'+_0x46a49d+'/'+_0x459ad1)['json'](_0x4028a7);}return null;};}function patchUpdates(_0x27bff9){return function(_0x406c2c){try{jsonpatch[_0x7ee8('0x29')](_0x406c2c,_0x27bff9,!![]);}catch(_0x1bcdd9){return BPromise['reject'](_0x1bcdd9);}return _0x406c2c[_0x7ee8('0x2a')]();};}function saveUpdates(_0x273bbe,_0x1342ca){return function(_0x5568cb){if(_0x5568cb){return _0x5568cb[_0x7ee8('0x2b')](_0x273bbe)[_0x7ee8('0x2c')](function(_0x3118fe){return _0x3118fe;});}return null;};}function removeEntity(_0x5ae459,_0x3f9cae){return function(_0x3870e9){if(_0x3870e9){return _0x3870e9[_0x7ee8('0x2d')]()['then'](function(){_0x5ae459[_0x7ee8('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d23fb,_0x368b8c){return function(_0x357683){if(!_0x357683){_0x4d23fb['sendStatus'](0x194);}return _0x357683;};}function handleError(_0x3396e3,_0x534075){_0x534075=_0x534075||0x1f4;return function(_0x2e31ed){logger['error'](_0x2e31ed[_0x7ee8('0x2e')]);if(_0x2e31ed['name']){delete _0x2e31ed[_0x7ee8('0x2f')];}_0x3396e3[_0x7ee8('0x20')](_0x534075)['send'](_0x2e31ed);};}exports[_0x7ee8('0x30')]=function(_0x1f34c5,_0x2d8809){var _0x10af17={},_0x2a8422={},_0x24ec48={'count':0x0,'rows':[]};var _0xaf69bf=_['map'](db[_0x7ee8('0x31')]['rawAttributes'],function(_0x40feae){return{'name':_0x40feae[_0x7ee8('0x32')],'type':_0x40feae[_0x7ee8('0x33')][_0x7ee8('0x34')]};});_0x2a8422['model']=_[_0x7ee8('0x35')](_0xaf69bf,_0x7ee8('0x2f'));_0x2a8422['query']=_[_0x7ee8('0x36')](_0x1f34c5[_0x7ee8('0x37')]);_0x2a8422[_0x7ee8('0x38')]=_[_0x7ee8('0x39')](_0x2a8422[_0x7ee8('0x3a')],_0x2a8422['query']);_0x10af17[_0x7ee8('0x3b')]=_[_0x7ee8('0x39')](_0x2a8422[_0x7ee8('0x3a')],qs['fields'](_0x1f34c5[_0x7ee8('0x37')]['fields']));_0x10af17[_0x7ee8('0x3b')]=_0x10af17[_0x7ee8('0x3b')]['length']?_0x10af17[_0x7ee8('0x3b')]:_0x2a8422[_0x7ee8('0x3a')];if(!_0x1f34c5[_0x7ee8('0x37')]['hasOwnProperty'](_0x7ee8('0x3c'))){_0x10af17['limit']=qs[_0x7ee8('0x26')](_0x1f34c5[_0x7ee8('0x37')][_0x7ee8('0x26')]);_0x10af17[_0x7ee8('0x24')]=qs[_0x7ee8('0x24')](_0x1f34c5[_0x7ee8('0x37')][_0x7ee8('0x24')]);}_0x10af17[_0x7ee8('0x3d')]=qs[_0x7ee8('0x3e')](_0x1f34c5[_0x7ee8('0x37')][_0x7ee8('0x3e')]);_0x10af17[_0x7ee8('0x3f')]=qs[_0x7ee8('0x38')](_[_0x7ee8('0x40')](_0x1f34c5['query'],_0x2a8422['filters']),_0xaf69bf);if(_0x1f34c5[_0x7ee8('0x37')]['filter']){_0x10af17[_0x7ee8('0x3f')]=_[_0x7ee8('0x41')](_0x10af17[_0x7ee8('0x3f')],{'$or':_[_0x7ee8('0x35')](_0xaf69bf,function(_0x111588){if(_0x111588[_0x7ee8('0x33')]!==_0x7ee8('0x42')){var _0x384d83={};_0x384d83[_0x111588[_0x7ee8('0x2f')]]={'$like':'%'+_0x1f34c5[_0x7ee8('0x37')][_0x7ee8('0x43')]+'%'};return _0x384d83;}})});}_0x10af17=_[_0x7ee8('0x41')]({},_0x10af17,_0x1f34c5[_0x7ee8('0x44')]);var _0x3ef618={'where':_0x10af17[_0x7ee8('0x3f')]};return db[_0x7ee8('0x31')][_0x7ee8('0x25')](_0x3ef618)[_0x7ee8('0x2c')](function(_0x1074ef){_0x24ec48[_0x7ee8('0x25')]=_0x1074ef;if(_0x1f34c5['query'][_0x7ee8('0x45')]){_0x10af17[_0x7ee8('0x46')]=[{'all':!![]}];}return db['UserProfile'][_0x7ee8('0x47')](_0x10af17);})[_0x7ee8('0x2c')](function(_0x509838){_0x24ec48[_0x7ee8('0x48')]=_0x509838;return _0x24ec48;})[_0x7ee8('0x2c')](respondWithFilteredResult(_0x2d8809,_0x10af17))['catch'](handleError(_0x2d8809,null));};exports[_0x7ee8('0x49')]=function(_0x533cb3,_0x56abcc){var _0x4cee21={'raw':![],'where':{'id':_0x533cb3[_0x7ee8('0x4a')]['id']}},_0x52e167={};_0x52e167[_0x7ee8('0x3a')]=_['keys'](db[_0x7ee8('0x31')][_0x7ee8('0x4b')]);_0x52e167[_0x7ee8('0x37')]=_[_0x7ee8('0x36')](_0x533cb3[_0x7ee8('0x37')]);_0x52e167[_0x7ee8('0x38')]=_[_0x7ee8('0x39')](_0x52e167[_0x7ee8('0x3a')],_0x52e167['query']);_0x4cee21[_0x7ee8('0x3b')]=_[_0x7ee8('0x39')](_0x52e167['model'],qs[_0x7ee8('0x4c')](_0x533cb3['query']['fields']));_0x4cee21[_0x7ee8('0x3b')]=_0x4cee21['attributes'][_0x7ee8('0x4d')]?_0x4cee21[_0x7ee8('0x3b')]:_0x52e167[_0x7ee8('0x3a')];if(_0x533cb3['query'][_0x7ee8('0x45')]){_0x4cee21['include']=[{'all':!![]}];}_0x4cee21=_[_0x7ee8('0x41')]({},_0x4cee21,_0x533cb3[_0x7ee8('0x44')]);return db['UserProfile'][_0x7ee8('0x4e')](_0x4cee21)[_0x7ee8('0x2c')](handleEntityNotFound(_0x56abcc,null))[_0x7ee8('0x2c')](respondWithResult(_0x56abcc,null))[_0x7ee8('0x4f')](handleError(_0x56abcc,null));};exports['create']=function(_0x4f36d0,_0x46e007){return db[_0x7ee8('0x31')]['create'](_0x4f36d0[_0x7ee8('0x50')],{})['then'](respondWithResult(_0x46e007,0xc9))['catch'](handleError(_0x46e007,null));};exports[_0x7ee8('0x51')]=function(_0x3c69dd,_0x2e43ac){var _0xe52138={'where':{'id':_0x3c69dd[_0x7ee8('0x4a')]['id']}},_0x40cd33={};_0x40cd33[_0x7ee8('0x3a')]=_[_0x7ee8('0x36')](db[_0x7ee8('0x31')][_0x7ee8('0x4b')]);_0xe52138['attributes']=_[_0x7ee8('0x39')](_0x40cd33[_0x7ee8('0x3a')],qs['fields'](_0x3c69dd[_0x7ee8('0x37')][_0x7ee8('0x4c')]));_0xe52138['attributes']=_0xe52138[_0x7ee8('0x3b')][_0x7ee8('0x4d')]?_0xe52138['attributes']:_0x40cd33['model'];if(_0x3c69dd[_0x7ee8('0x37')][_0x7ee8('0x45')]){_0xe52138['include']=[{'all':!![]}];}_0xe52138=_[_0x7ee8('0x41')]({},_0xe52138,_0x3c69dd[_0x7ee8('0x44')]);return db[_0x7ee8('0x31')][_0x7ee8('0x4e')](_0xe52138)[_0x7ee8('0x2c')](handleEntityNotFound(_0x2e43ac,null))[_0x7ee8('0x2c')](function(_0xf29280){if(_0xf29280){var _0x5c7652=_0xf29280[_0x7ee8('0x52')]({'plain':!![]});_0x5c7652=qs[_0x7ee8('0x53')](_0x5c7652,['id',_0x7ee8('0x54'),_0x7ee8('0x55'),_0x7ee8('0x56')]);_0x3c69dd[_0x7ee8('0x50')]=_[_0x7ee8('0x53')](_0x3c69dd[_0x7ee8('0x50')],['id',_0x7ee8('0x54'),_0x7ee8('0x55')]);return db[_0x7ee8('0x57')]['transaction'](function(_0x2d43ae){return db['UserProfile'][_0x7ee8('0x58')](_[_0x7ee8('0x41')](_0x5c7652,_0x3c69dd[_0x7ee8('0x50')]),{'include':_0x3c69dd[_0x7ee8('0x37')][_0x7ee8('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x2d43ae})[_0x7ee8('0x2c')](function(_0x395235){var _0x2ef412=_0x395235[_0x7ee8('0x52')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3c69dd[_0x7ee8('0x4a')]['id']},'raw':!![]})[_0x7ee8('0x2c')](function(_0x4d8473){if(_0x4d8473){return BPromise[_0x7ee8('0x59')](_0x4d8473,function(_0x3756db){return new BPromise(function(_0x2a7b97,_0x5cda8a){if(_0x3756db['autoAssociation']===null||_0x3756db[_0x7ee8('0x5a')]===0x1)_0x2a7b97(null);return db[_0x7ee8('0x5b')][_0x7ee8('0x47')]({'where':{'sectionId':_0x3756db['id']},'raw':!![]})[_0x7ee8('0x2c')](function(_0x5beb47){var _0x3975c1=_[_0x7ee8('0x35')](_0x5beb47,function(_0x1991ed){return qs['omit'](_0x1991ed,['id','createdAt',_0x7ee8('0x55'),_0x7ee8('0x5c')]);});_0x2a7b97(_0x3975c1);})['catch'](function(_0xbba570){_0x5cda8a(_0xbba570);});})[_0x7ee8('0x2c')](function(_0xabe2ff){var _0x234a80=qs[_0x7ee8('0x53')](_0x3756db,['id',_0x7ee8('0x54'),'updatedAt']);_0x234a80[_0x7ee8('0x5d')]=_0x2ef412['id'];if(_0xabe2ff)_0x234a80['Resources']=_0xabe2ff;return _0x234a80;})[_0x7ee8('0x2c')](function(_0x14735c){return db[_0x7ee8('0x5e')]['create'](_0x14735c,{'include':[{'model':db[_0x7ee8('0x5b')],'as':_0x7ee8('0x5f')}],'raw':!![],'transaction':_0x2d43ae});});})[_0x7ee8('0x2c')](function(){return _0x2ef412;});}});});});}})[_0x7ee8('0x2c')](respondWithResult(_0x2e43ac,0xc9))[_0x7ee8('0x4f')](handleError(_0x2e43ac,null));};exports[_0x7ee8('0x2b')]=function(_0x2d3fa9,_0xd84ebe){if(_0x2d3fa9[_0x7ee8('0x50')]['id']){delete _0x2d3fa9[_0x7ee8('0x50')]['id'];}return db[_0x7ee8('0x31')]['find']({'where':{'id':_0x2d3fa9[_0x7ee8('0x4a')]['id']}})[_0x7ee8('0x2c')](handleEntityNotFound(_0xd84ebe,null))['then'](saveUpdates(_0x2d3fa9[_0x7ee8('0x50')],null))[_0x7ee8('0x2c')](respondWithResult(_0xd84ebe,null))['catch'](handleError(_0xd84ebe,null));};exports['destroy']=function(_0x3a2151,_0x2100f3){return db['UserProfile'][_0x7ee8('0x4e')]({'where':{'id':_0x3a2151[_0x7ee8('0x4a')]['id']}})[_0x7ee8('0x2c')](handleEntityNotFound(_0x2100f3,null))['then'](removeEntity(_0x2100f3,null))['catch'](handleError(_0x2100f3,null));};exports[_0x7ee8('0x60')]=function(_0x268a6f,_0x4295b0){return db[_0x7ee8('0x31')][_0x7ee8('0x60')]()[_0x7ee8('0x2c')](respondWithResult(_0x4295b0,null))[_0x7ee8('0x4f')](handleError(_0x4295b0,null));};exports[_0x7ee8('0x61')]=function(_0x32b5a1,_0xebfe91){var _0x4f8836=_0x32b5a1[_0x7ee8('0x50')];return db[_0x7ee8('0x31')][_0x7ee8('0x4e')]({'where':{'id':_0x32b5a1[_0x7ee8('0x4a')]['id']}})['then'](handleEntityNotFound(_0xebfe91,null))[_0x7ee8('0x2c')](function(_0x3bf4a5){if(_0x3bf4a5){return db['sequelize']['transaction'](function(_0x542045){return db[_0x7ee8('0x5e')][_0x7ee8('0x2d')]({'where':{'userProfileId':_0x32b5a1[_0x7ee8('0x4a')]['id'],'sectionId':_[_0x7ee8('0x35')](_0x4f8836,function(_0x3e9077){return _0x3e9077['sectionId'];})},'transaction':_0x542045})[_0x7ee8('0x2c')](function(){var _0x7caaec=_[_0x7ee8('0x35')](_0x4f8836,function(_0x242e9f){_0x242e9f[_0x7ee8('0x5d')]=_0x32b5a1['params']['id'];return _0x242e9f;});var _0x22a8e8=[];return BPromise[_0x7ee8('0x59')](_0x7caaec,function(_0x52d599){return db[_0x7ee8('0x5e')]['create'](_0x52d599,{'include':[{'model':db[_0x7ee8('0x5b')],'as':_0x7ee8('0x5f')}],'raw':!![],'transaction':_0x542045})[_0x7ee8('0x2c')](function(_0x5b0dfe){_0x22a8e8['push'](_0x5b0dfe['get']({'plain':!![]}));});})['then'](function(){return _0x22a8e8;});});});}})['then'](function(_0x5f4a96){return _0x5f4a96;})[_0x7ee8('0x2c')](respondWithResult(_0xebfe91,null))[_0x7ee8('0x4f')](handleError(_0xebfe91,null));};exports['removeSections']=function(_0x417de3,_0x4ed794){var _0x3f9079;return db[_0x7ee8('0x31')][_0x7ee8('0x4e')]({'where':{'id':_0x417de3[_0x7ee8('0x4a')]['id']},'attributes':['id',_0x7ee8('0x2f')]})[_0x7ee8('0x2c')](handleEntityNotFound(_0x4ed794,null))[_0x7ee8('0x2c')](function(_0x3216f2){if(_0x3216f2){_0x3f9079=_0x3216f2;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x417de3[_0x7ee8('0x4a')]['id'],'sectionId':_0x417de3[_0x7ee8('0x37')][_0x7ee8('0x62')]}});}})[_0x7ee8('0x2c')](function(){return _0x3f9079;})[_0x7ee8('0x2c')](respondWithStatusCode(_0x4ed794,null))[_0x7ee8('0x4f')](handleError(_0x4ed794,null));};exports[_0x7ee8('0x63')]=function(_0x1e67c9,_0x4b5a92){var _0x1480fa=[];var _0x33dcfc=[];return db[_0x7ee8('0x5e')][_0x7ee8('0x47')]({'where':{'userProfileId':_0x1e67c9[_0x7ee8('0x4a')]['id']},'raw':!![]})[_0x7ee8('0x2c')](function(_0x5dee20){_0x1480fa=_['filter'](_0x5dee20,function(_0xa2ac0){return _0xa2ac0[_0x7ee8('0x64')]===0x1||_[_0x7ee8('0x65')]([0x3eb,0x709],_0xa2ac0[_0x7ee8('0x5c')]);});if(!_[_0x7ee8('0x66')](_0x1480fa)){return _['map'](_0x1480fa,function(_0x7659ba){return _0x7659ba[_0x7ee8('0x5c')];});}else{return;}})['then'](function(_0x98b503){if(_0x98b503)_0x33dcfc=_0x98b503;if(_[_0x7ee8('0x65')](_0x33dcfc,0x64)){var _0x28f39d=_[_0x7ee8('0x4e')](_0x1480fa,{'sectionId':0x64});return hasDefaultDashboard(_0x28f39d)[_0x7ee8('0x2c')](function(_0x318869){return _[_0x7ee8('0x35')](_0x1480fa,function(_0x53c14d){if(_0x53c14d['sectionId']===0x64){_0x53c14d['subsections']=_0x318869;}return _0x53c14d;});});}else{return;}})[_0x7ee8('0x2c')](function(_0x1a5afd){if(_0x1a5afd)_0x1480fa=_0x1a5afd;if(_['includes'](_0x33dcfc,0x3eb)){var _0x279b67=_[_0x7ee8('0x4e')](_0x1480fa,{'sectionId':0x3eb});return getCustomDashboards(_0x279b67)[_0x7ee8('0x2c')](function(_0xf055b0){return _[_0x7ee8('0x35')](_0x1480fa,function(_0x243ab1){if(_0x279b67['enabled']){if(_0x243ab1[_0x7ee8('0x5c')]===0x3eb){_0x243ab1[_0x7ee8('0x67')]=_0xf055b0;}}else{if(_0x243ab1[_0x7ee8('0x5c')]===0x64){_0x243ab1[_0x7ee8('0x67')]=_0xf055b0;}}return _0x243ab1;});});}else{return;}})[_0x7ee8('0x2c')](function(_0x11ac65){if(_0x11ac65)_0x1480fa=_0x11ac65;if(_[_0x7ee8('0x65')](_0x33dcfc,0x709)){var _0x1fd393=_[_0x7ee8('0x4e')](_0x1480fa,{'sectionId':0x709});return getPlugins(_0x1fd393)['then'](function(_0x303a8c){if(_0x1fd393[_0x7ee8('0x64')]){return _[_0x7ee8('0x35')](_0x1480fa,function(_0x2e8a9d){if(_0x2e8a9d[_0x7ee8('0x5c')]===0x709){_0x2e8a9d[_0x7ee8('0x67')]=_0x303a8c;}return _0x2e8a9d;});}else{var _0x17c555={'sectionId':0x76c,'enabled':0x1,'subsections':_0x303a8c};var _0x3928f4=_[_0x7ee8('0x35')](_0x1480fa);_0x3928f4[_0x7ee8('0x68')](_0x17c555);return _0x3928f4;}});}else{return;}})[_0x7ee8('0x2c')](function(_0x3428c2){if(_0x3428c2)_0x1480fa=_0x3428c2;return _[_0x7ee8('0x43')](_0x1480fa,[_0x7ee8('0x64'),0x1]);})['then'](respondWithResult(_0x4b5a92,null))['catch'](handleError(_0x4b5a92,null));};function hasDefaultDashboard(_0x432a04){var _0x207f47=[0x65];return new BPromise(function(_0x3ccfb4,_0x45515c){try{if(_0x432a04[_0x7ee8('0x5a')]){_0x3ccfb4(_0x207f47);}else{return db[_0x7ee8('0x5b')][_0x7ee8('0x69')]({'where':{'sectionId':_0x432a04['id']},'raw':!![]})[_0x7ee8('0x2c')](function(_0x3c5e9d){_0x3c5e9d?_0x3ccfb4(_0x207f47):_0x3ccfb4();});}}catch(_0x5e9c6a){_0x45515c(_0x5e9c6a);}});}function getCustomDashboards(_0x469d4c){var _0x19ded1=[];return new BPromise(function(_0xf50b66,_0x181a70){try{if(_0x469d4c[_0x7ee8('0x5a')]){return db[_0x7ee8('0x6a')][_0x7ee8('0x47')]({'raw':!![]})[_0x7ee8('0x2c')](function(_0x14b937){_0x14b937['forEach'](function(_0x3ada69){_0x19ded1[_0x7ee8('0x68')](_0x3ada69['id']+0x1869f);});_0xf50b66(_0x19ded1);});}else{return db[_0x7ee8('0x5b')][_0x7ee8('0x47')]({'where':{'sectionId':_0x469d4c['id']},'raw':!![]})['then'](function(_0x1207d2){_0x1207d2['forEach'](function(_0x28efaa){_0x19ded1[_0x7ee8('0x68')](_0x28efaa[_0x7ee8('0x6b')]+0x1869f);});_0xf50b66(_0x19ded1);});}}catch(_0x5d0c1b){_0x181a70(_0x5d0c1b);}});}function getPlugins(_0x27f3c1){var _0x329966=[];return new BPromise(function(_0x1a5523,_0x312186){try{if(_0x27f3c1[_0x7ee8('0x5a')]){return db['Plugin']['findAll']({'raw':!![]})[_0x7ee8('0x2c')](function(_0x27ebc2){_0x27ebc2[_0x7ee8('0x6c')](function(_0x2f7c3e){_0x329966[_0x7ee8('0x68')](_0x2f7c3e['id']+0x15b38);});_0x1a5523(_0x329966);});}else{return db[_0x7ee8('0x5b')]['findAll']({'where':{'sectionId':_0x27f3c1['id']},'raw':!![]})[_0x7ee8('0x2c')](function(_0x2892ac){_0x2892ac[_0x7ee8('0x6c')](function(_0x196e81){_0x329966[_0x7ee8('0x68')](_0x196e81['resourceId']+0x15b38);});_0x1a5523(_0x329966);});}}catch(_0x186607){_0x312186(_0x186607);}});}exports[_0x7ee8('0x6d')]=function(_0x5dac17,_0x8b85d5){return db['UserProfile'][_0x7ee8('0x4e')]({'where':{'id':_0x5dac17[_0x7ee8('0x4a')]['id']}})[_0x7ee8('0x2c')](handleEntityNotFound(_0x8b85d5,null))[_0x7ee8('0x2c')](function(_0x44fa3b){if(_0x44fa3b){return db['sequelize']['transaction'](function(_0x2b3d6d){return db[_0x7ee8('0x5e')][_0x7ee8('0x47')]({'where':{'userProfileId':_0x5dac17[_0x7ee8('0x4a')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x12c258){if(_0x12c258){return db[_0x7ee8('0x5e')][_0x7ee8('0x2d')]({'where':{'userProfileId':_0x5dac17['params']['id'],'id':_[_0x7ee8('0x35')](_0x12c258,function(_0x3753d7){return _0x3753d7['id'];})},'transaction':_0x2b3d6d});}})[_0x7ee8('0x2c')](function(_0x331cc0){var _0xa0322c=_[_0x7ee8('0x35')](_0x5dac17[_0x7ee8('0x50')],function(_0x469147){_0x469147[_0x7ee8('0x5d')]=_0x5dac17['params']['id'];return _0x469147;});return db[_0x7ee8('0x5e')][_0x7ee8('0x6e')](_0xa0322c,{'raw':!![],'transaction':_0x2b3d6d});})[_0x7ee8('0x2c')](function(_0x2604f5){var _0x2e2293=_[_0x7ee8('0x43')](_[_0x7ee8('0x35')](_0x2604f5,function(_0x467372){return _0x467372[_0x7ee8('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x2e2293){return db[_0x7ee8('0x5e')][_0x7ee8('0x47')]({'where':{'userProfileId':_0x5dac17[_0x7ee8('0x4a')]['id'],'sectionId':_[_0x7ee8('0x35')](_0x2e2293,function(_0x1d52ff){return _0x1d52ff['sectionId'];})},'attributes':['id',_0x7ee8('0x5c')],'raw':!![]})['then'](function(_0x451238){var _0x56c3ff=_['map'](_0x5dac17[_0x7ee8('0x50')],function(_0x1e3d68){_0x1e3d68[_0x7ee8('0x5d')]=_0x5dac17['params']['id'];return _0x1e3d68;});return db[_0x7ee8('0x5b')][_0x7ee8('0x6e')](_0x56c3ff,{'raw':!![],'transaction':_0x2b3d6d});});}})[_0x7ee8('0x4f')](handleError(_0x8b85d5,null));});}})[_0x7ee8('0x2c')](function(_0xfdac){var _0x4c109=_['map'](_0xfdac,function(_0x55cab9){return _0x55cab9[_0x7ee8('0x52')]({'plain':!![]});});})[_0x7ee8('0x2c')](respondWithResult(_0x8b85d5,null))[_0x7ee8('0x4f')](handleError(_0x8b85d5,null));};exports[_0x7ee8('0x6f')]=function(_0x262f35,_0x9e097b,_0x53515d){return db['UserProfile'][_0x7ee8('0x4e')]({'where':{'id':_0x262f35[_0x7ee8('0x4a')]['id']}})[_0x7ee8('0x2c')](handleEntityNotFound(_0x9e097b,null))[_0x7ee8('0x2c')](function(_0x1c4868){if(_0x1c4868){return _0x1c4868[_0x7ee8('0x6f')](_0x262f35[_0x7ee8('0x37')][_0x7ee8('0x62')]);}})[_0x7ee8('0x2c')](respondWithStatusCode(_0x9e097b,null))[_0x7ee8('0x4f')](handleError(_0x9e097b,null));};exports[_0x7ee8('0x70')]=function(_0x438260,_0x4d7fda){var _0x25e4c8={};if(!_0x438260[_0x7ee8('0x37')]['section'])throw new Error(_0x7ee8('0x71'));if(!_0x438260[_0x7ee8('0x37')]['hasOwnProperty'](_0x7ee8('0x3c'))){_0x25e4c8[_0x7ee8('0x26')]=qs['limit'](_0x438260[_0x7ee8('0x37')][_0x7ee8('0x26')]);_0x25e4c8[_0x7ee8('0x24')]=qs[_0x7ee8('0x24')](_0x438260['query'][_0x7ee8('0x24')]);}return db['UserProfile'][_0x7ee8('0x4e')]({'where':{'id':_0x438260['params']['id']}})[_0x7ee8('0x2c')](function(_0x46c067){if(!_0x46c067)throw new Error(_0x7ee8('0x72')+_0x438260['params']['id']);return db['UserProfile']['getResources'](_0x438260);})[_0x7ee8('0x2c')](respondWithFilteredResult(_0x4d7fda,_0x25e4c8))['catch'](handleError(_0x4d7fda,null));}; \ No newline at end of file +var _0x937d=['fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','catch','params','length','find','create','body','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','push','removeSections','ids','enabled','includes','isEmpty','subsections','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','index','map','UserProfile','rawAttributes'];(function(_0xd84b59,_0x5beeee){var _0x4366f9=function(_0x54dcf9){while(--_0x54dcf9){_0xd84b59['push'](_0xd84b59['shift']());}};_0x4366f9(++_0x5beeee);}(_0x937d,0x1f4));var _0xd937=function(_0x1282d2,_0x346ec6){_0x1282d2=_0x1282d2-0x0;var _0x5aa36c=_0x937d[_0x1282d2];return _0x5aa36c;};'use strict';var emlformat=require(_0xd937('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd937('0x1'));var moment=require(_0xd937('0x2'));var BPromise=require(_0xd937('0x3'));var Mustache=require(_0xd937('0x4'));var util=require(_0xd937('0x5'));var path=require(_0xd937('0x6'));var sox=require('sox');var csv=require(_0xd937('0x7'));var ejs=require(_0xd937('0x8'));var fs=require('fs');var fs_extra=require(_0xd937('0x9'));var _=require('lodash');var squel=require(_0xd937('0xa'));var crypto=require(_0xd937('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd937('0xc'));var toCsv=require(_0xd937('0x7'));var querystring=require(_0xd937('0xd'));var Papa=require(_0xd937('0xe'));var Redis=require(_0xd937('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd937('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd937('0x11'));var logger=require('../../config/logger')(_0xd937('0x12'));var utils=require(_0xd937('0x13'));var config=require(_0xd937('0x14'));var licenseUtil=require(_0xd937('0x15'));var db=require(_0xd937('0x16'))['db'];config['redis']=_[_0xd937('0x17')](config[_0xd937('0x18')],{'host':_0xd937('0x19'),'port':0x18eb});var socket=require(_0xd937('0x1a'))(new Redis(config[_0xd937('0x18')]));require(_0xd937('0x1b'))[_0xd937('0x1c')](socket);function respondWithStatusCode(_0x174ddf,_0x29b598){_0x29b598=_0x29b598||0xcc;return function(_0x21b87d){if(_0x21b87d){return _0x174ddf['sendStatus'](_0x29b598);}return _0x174ddf[_0xd937('0x1d')](_0x29b598)[_0xd937('0x1e')]();};}function respondWithResult(_0x295a82,_0x569a9e){_0x569a9e=_0x569a9e||0xc8;return function(_0x3786f1){if(_0x3786f1){return _0x295a82[_0xd937('0x1d')](_0x569a9e)[_0xd937('0x1f')](_0x3786f1);}};}function respondWithFilteredResult(_0x4e72fe,_0x43ab41){return function(_0x3d6b1c){if(_0x3d6b1c){var _0x1d1b8b=typeof _0x43ab41[_0xd937('0x20')]===_0xd937('0x21')&&typeof _0x43ab41[_0xd937('0x22')]===_0xd937('0x21');var _0x311f08=_0x3d6b1c[_0xd937('0x23')];var _0x31fc09=_0x1d1b8b?0x0:_0x43ab41[_0xd937('0x20')];var _0x302723=_0x1d1b8b?_0x3d6b1c[_0xd937('0x23')]:_0x43ab41[_0xd937('0x20')]+_0x43ab41[_0xd937('0x22')];var _0x2699e8;if(_0x302723>=_0x311f08){_0x302723=_0x311f08;_0x2699e8=0xc8;}else{_0x2699e8=0xce;}_0x4e72fe[_0xd937('0x1d')](_0x2699e8);return _0x4e72fe['set'](_0xd937('0x24'),_0x31fc09+'-'+_0x302723+'/'+_0x311f08)[_0xd937('0x1f')](_0x3d6b1c);}return null;};}function patchUpdates(_0x86c492){return function(_0x28703a){try{jsonpatch[_0xd937('0x25')](_0x28703a,_0x86c492,!![]);}catch(_0x31ff83){return BPromise[_0xd937('0x26')](_0x31ff83);}return _0x28703a[_0xd937('0x27')]();};}function saveUpdates(_0x194fe5,_0x14b350){return function(_0x2bbbd4){if(_0x2bbbd4){return _0x2bbbd4['update'](_0x194fe5)['then'](function(_0x541ded){return _0x541ded;});}return null;};}function removeEntity(_0x22ed55,_0x1d5a26){return function(_0x5ef39f){if(_0x5ef39f){return _0x5ef39f[_0xd937('0x28')]()[_0xd937('0x29')](function(){_0x22ed55[_0xd937('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d822f,_0x375351){return function(_0x21794d){if(!_0x21794d){_0x5d822f[_0xd937('0x2a')](0x194);}return _0x21794d;};}function handleError(_0x27f120,_0xef145){_0xef145=_0xef145||0x1f4;return function(_0x46c855){logger[_0xd937('0x2b')](_0x46c855[_0xd937('0x2c')]);if(_0x46c855[_0xd937('0x2d')]){delete _0x46c855[_0xd937('0x2d')];}_0x27f120[_0xd937('0x1d')](_0xef145)['send'](_0x46c855);};}exports[_0xd937('0x2e')]=function(_0x23b4ef,_0xaba6e0){var _0x11de50={},_0x59f741={},_0xa0e55c={'count':0x0,'rows':[]};var _0x11decc=_[_0xd937('0x2f')](db[_0xd937('0x30')][_0xd937('0x31')],function(_0x94af31){return{'name':_0x94af31[_0xd937('0x32')],'type':_0x94af31[_0xd937('0x33')][_0xd937('0x34')]};});_0x59f741[_0xd937('0x35')]=_[_0xd937('0x2f')](_0x11decc,_0xd937('0x2d'));_0x59f741[_0xd937('0x36')]=_[_0xd937('0x37')](_0x23b4ef['query']);_0x59f741['filters']=_[_0xd937('0x38')](_0x59f741[_0xd937('0x35')],_0x59f741[_0xd937('0x36')]);_0x11de50[_0xd937('0x39')]=_[_0xd937('0x38')](_0x59f741[_0xd937('0x35')],qs[_0xd937('0x3a')](_0x23b4ef[_0xd937('0x36')][_0xd937('0x3a')]));_0x11de50[_0xd937('0x39')]=_0x11de50[_0xd937('0x39')]['length']?_0x11de50['attributes']:_0x59f741['model'];if(!_0x23b4ef[_0xd937('0x36')]['hasOwnProperty'](_0xd937('0x3b'))){_0x11de50['limit']=qs[_0xd937('0x22')](_0x23b4ef[_0xd937('0x36')][_0xd937('0x22')]);_0x11de50[_0xd937('0x20')]=qs[_0xd937('0x20')](_0x23b4ef[_0xd937('0x36')][_0xd937('0x20')]);}_0x11de50[_0xd937('0x3c')]=qs[_0xd937('0x3d')](_0x23b4ef[_0xd937('0x36')][_0xd937('0x3d')]);_0x11de50[_0xd937('0x3e')]=qs[_0xd937('0x3f')](_[_0xd937('0x40')](_0x23b4ef[_0xd937('0x36')],_0x59f741[_0xd937('0x3f')]),_0x11decc);if(_0x23b4ef[_0xd937('0x36')]['filter']){_0x11de50[_0xd937('0x3e')]=_[_0xd937('0x41')](_0x11de50[_0xd937('0x3e')],{'$or':_[_0xd937('0x2f')](_0x11decc,function(_0x39e413){if(_0x39e413[_0xd937('0x33')]!=='VIRTUAL'){var _0xd9a1ce={};_0xd9a1ce[_0x39e413['name']]={'$like':'%'+_0x23b4ef[_0xd937('0x36')][_0xd937('0x42')]+'%'};return _0xd9a1ce;}})});}_0x11de50=_[_0xd937('0x41')]({},_0x11de50,_0x23b4ef[_0xd937('0x43')]);var _0x56d1e1={'where':_0x11de50[_0xd937('0x3e')]};return db[_0xd937('0x30')]['count'](_0x56d1e1)[_0xd937('0x29')](function(_0x3a1eb3){_0xa0e55c[_0xd937('0x23')]=_0x3a1eb3;if(_0x23b4ef[_0xd937('0x36')][_0xd937('0x44')]){_0x11de50[_0xd937('0x45')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x11de50);})[_0xd937('0x29')](function(_0x26b615){_0xa0e55c['rows']=_0x26b615;return _0xa0e55c;})['then'](respondWithFilteredResult(_0xaba6e0,_0x11de50))[_0xd937('0x46')](handleError(_0xaba6e0,null));};exports['show']=function(_0x37e9ae,_0x3287b1){var _0x386e01={'raw':![],'where':{'id':_0x37e9ae[_0xd937('0x47')]['id']}},_0x239edd={};_0x239edd[_0xd937('0x35')]=_[_0xd937('0x37')](db[_0xd937('0x30')][_0xd937('0x31')]);_0x239edd[_0xd937('0x36')]=_['keys'](_0x37e9ae[_0xd937('0x36')]);_0x239edd[_0xd937('0x3f')]=_[_0xd937('0x38')](_0x239edd[_0xd937('0x35')],_0x239edd[_0xd937('0x36')]);_0x386e01['attributes']=_['intersection'](_0x239edd['model'],qs[_0xd937('0x3a')](_0x37e9ae[_0xd937('0x36')][_0xd937('0x3a')]));_0x386e01[_0xd937('0x39')]=_0x386e01[_0xd937('0x39')][_0xd937('0x48')]?_0x386e01[_0xd937('0x39')]:_0x239edd[_0xd937('0x35')];if(_0x37e9ae[_0xd937('0x36')]['includeAll']){_0x386e01['include']=[{'all':!![]}];}_0x386e01=_[_0xd937('0x41')]({},_0x386e01,_0x37e9ae['options']);return db[_0xd937('0x30')][_0xd937('0x49')](_0x386e01)[_0xd937('0x29')](handleEntityNotFound(_0x3287b1,null))[_0xd937('0x29')](respondWithResult(_0x3287b1,null))[_0xd937('0x46')](handleError(_0x3287b1,null));};exports[_0xd937('0x4a')]=function(_0x27c5eb,_0x463da0){return db[_0xd937('0x30')][_0xd937('0x4a')](_0x27c5eb[_0xd937('0x4b')],{})['then'](respondWithResult(_0x463da0,0xc9))[_0xd937('0x46')](handleError(_0x463da0,null));};exports['clone']=function(_0x104442,_0x29a143){var _0x37b870={'where':{'id':_0x104442['params']['id']}},_0x87758e={};_0x87758e[_0xd937('0x35')]=_[_0xd937('0x37')](db[_0xd937('0x30')][_0xd937('0x31')]);_0x37b870[_0xd937('0x39')]=_[_0xd937('0x38')](_0x87758e[_0xd937('0x35')],qs[_0xd937('0x3a')](_0x104442[_0xd937('0x36')]['fields']));_0x37b870[_0xd937('0x39')]=_0x37b870[_0xd937('0x39')]['length']?_0x37b870[_0xd937('0x39')]:_0x87758e[_0xd937('0x35')];if(_0x104442['query'][_0xd937('0x44')]){_0x37b870[_0xd937('0x45')]=[{'all':!![]}];}_0x37b870=_['merge']({},_0x37b870,_0x104442['options']);return db[_0xd937('0x30')][_0xd937('0x49')](_0x37b870)[_0xd937('0x29')](handleEntityNotFound(_0x29a143,null))[_0xd937('0x29')](function(_0x68158){if(_0x68158){var _0x3d6ee6=_0x68158[_0xd937('0x4c')]({'plain':!![]});_0x3d6ee6=qs[_0xd937('0x4d')](_0x3d6ee6,['id',_0xd937('0x4e'),_0xd937('0x4f'),_0xd937('0x50')]);_0x104442[_0xd937('0x4b')]=_['omit'](_0x104442['body'],['id','createdAt',_0xd937('0x4f')]);return db[_0xd937('0x51')][_0xd937('0x52')](function(_0x4eb351){return db[_0xd937('0x30')][_0xd937('0x4a')](_['merge'](_0x3d6ee6,_0x104442['body']),{'include':_0x104442[_0xd937('0x36')][_0xd937('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x4eb351})['then'](function(_0x1f269b){var _0x59323e=_0x1f269b['get']({'plain':!![]});return db[_0xd937('0x53')][_0xd937('0x54')]({'where':{'userProfileId':_0x104442[_0xd937('0x47')]['id']},'raw':!![]})[_0xd937('0x29')](function(_0x3ffe5a){if(_0x3ffe5a){return BPromise[_0xd937('0x55')](_0x3ffe5a,function(_0x1d876a){return new BPromise(function(_0x4e29c3,_0x1b4841){if(_0x1d876a[_0xd937('0x56')]===null||_0x1d876a[_0xd937('0x56')]===0x1)_0x4e29c3(null);return db[_0xd937('0x57')][_0xd937('0x54')]({'where':{'sectionId':_0x1d876a['id']},'raw':!![]})[_0xd937('0x29')](function(_0x130653){var _0x4b5232=_[_0xd937('0x2f')](_0x130653,function(_0x15f84b){return qs['omit'](_0x15f84b,['id',_0xd937('0x4e'),_0xd937('0x4f'),_0xd937('0x58')]);});_0x4e29c3(_0x4b5232);})[_0xd937('0x46')](function(_0x3fcf7c){_0x1b4841(_0x3fcf7c);});})[_0xd937('0x29')](function(_0x2627ca){var _0x1050e8=qs[_0xd937('0x4d')](_0x1d876a,['id',_0xd937('0x4e'),_0xd937('0x4f')]);_0x1050e8[_0xd937('0x59')]=_0x59323e['id'];if(_0x2627ca)_0x1050e8[_0xd937('0x5a')]=_0x2627ca;return _0x1050e8;})[_0xd937('0x29')](function(_0x2977b7){return db[_0xd937('0x53')][_0xd937('0x4a')](_0x2977b7,{'include':[{'model':db['UserProfileResource'],'as':_0xd937('0x5a')}],'raw':!![],'transaction':_0x4eb351});});})['then'](function(){return _0x59323e;});}});});});}})['then'](respondWithResult(_0x29a143,0xc9))['catch'](handleError(_0x29a143,null));};exports['update']=function(_0x325c8c,_0x1cd08c){if(_0x325c8c[_0xd937('0x4b')]['id']){delete _0x325c8c[_0xd937('0x4b')]['id'];}return db['UserProfile'][_0xd937('0x49')]({'where':{'id':_0x325c8c[_0xd937('0x47')]['id']}})['then'](handleEntityNotFound(_0x1cd08c,null))[_0xd937('0x29')](saveUpdates(_0x325c8c[_0xd937('0x4b')],null))[_0xd937('0x29')](respondWithResult(_0x1cd08c,null))[_0xd937('0x46')](handleError(_0x1cd08c,null));};exports['destroy']=function(_0x13280e,_0x5e7e5c){return db[_0xd937('0x30')]['find']({'where':{'id':_0x13280e[_0xd937('0x47')]['id']}})[_0xd937('0x29')](handleEntityNotFound(_0x5e7e5c,null))[_0xd937('0x29')](removeEntity(_0x5e7e5c,null))[_0xd937('0x46')](handleError(_0x5e7e5c,null));};exports['describe']=function(_0x12a8ee,_0x3cbaf0){return db['UserProfile'][_0xd937('0x5b')]()[_0xd937('0x29')](respondWithResult(_0x3cbaf0,null))[_0xd937('0x46')](handleError(_0x3cbaf0,null));};exports[_0xd937('0x5c')]=function(_0x314ea3,_0x444391){var _0x5b07a4=_0x314ea3[_0xd937('0x4b')];return db[_0xd937('0x30')][_0xd937('0x49')]({'where':{'id':_0x314ea3[_0xd937('0x47')]['id']}})['then'](handleEntityNotFound(_0x444391,null))[_0xd937('0x29')](function(_0x2663fc){if(_0x2663fc){return db[_0xd937('0x51')][_0xd937('0x52')](function(_0x3f4701){return db[_0xd937('0x53')]['destroy']({'where':{'userProfileId':_0x314ea3[_0xd937('0x47')]['id'],'sectionId':_[_0xd937('0x2f')](_0x5b07a4,function(_0x46d067){return _0x46d067[_0xd937('0x58')];})},'transaction':_0x3f4701})['then'](function(){var _0x30139c=_[_0xd937('0x2f')](_0x5b07a4,function(_0xaf2448){_0xaf2448[_0xd937('0x59')]=_0x314ea3[_0xd937('0x47')]['id'];return _0xaf2448;});var _0x1e54b7=[];return BPromise[_0xd937('0x55')](_0x30139c,function(_0x133331){return db[_0xd937('0x53')][_0xd937('0x4a')](_0x133331,{'include':[{'model':db[_0xd937('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x3f4701})[_0xd937('0x29')](function(_0x74e5dd){_0x1e54b7[_0xd937('0x5d')](_0x74e5dd[_0xd937('0x4c')]({'plain':!![]}));});})[_0xd937('0x29')](function(){return _0x1e54b7;});});});}})[_0xd937('0x29')](function(_0x24d7d3){return _0x24d7d3;})['then'](respondWithResult(_0x444391,null))[_0xd937('0x46')](handleError(_0x444391,null));};exports[_0xd937('0x5e')]=function(_0x504cef,_0xc3fca0){var _0xaf0a1c;return db[_0xd937('0x30')][_0xd937('0x49')]({'where':{'id':_0x504cef[_0xd937('0x47')]['id']},'attributes':['id',_0xd937('0x2d')]})[_0xd937('0x29')](handleEntityNotFound(_0xc3fca0,null))[_0xd937('0x29')](function(_0x30593e){if(_0x30593e){_0xaf0a1c=_0x30593e;return db['UserProfileSection'][_0xd937('0x28')]({'where':{'userProfileId':_0x504cef[_0xd937('0x47')]['id'],'sectionId':_0x504cef[_0xd937('0x36')][_0xd937('0x5f')]}});}})[_0xd937('0x29')](function(){return _0xaf0a1c;})['then'](respondWithStatusCode(_0xc3fca0,null))['catch'](handleError(_0xc3fca0,null));};exports['getSections']=function(_0x349071,_0x398912){var _0x5779a6=[];var _0x19de27=[];return db['UserProfileSection'][_0xd937('0x54')]({'where':{'userProfileId':_0x349071[_0xd937('0x47')]['id']},'raw':!![]})[_0xd937('0x29')](function(_0x5c47cb){_0x5779a6=_[_0xd937('0x42')](_0x5c47cb,function(_0xb9184b){return _0xb9184b[_0xd937('0x60')]===0x1||_[_0xd937('0x61')]([0x3eb,0x709],_0xb9184b['sectionId']);});if(!_[_0xd937('0x62')](_0x5779a6)){return _['map'](_0x5779a6,function(_0x3e67a0){return _0x3e67a0['sectionId'];});}else{return;}})[_0xd937('0x29')](function(_0x2bf3b0){if(_0x2bf3b0)_0x19de27=_0x2bf3b0;if(_['includes'](_0x19de27,0x64)){var _0x1a87df=_[_0xd937('0x49')](_0x5779a6,{'sectionId':0x64});return hasDefaultDashboard(_0x1a87df)['then'](function(_0x29fc71){return _[_0xd937('0x2f')](_0x5779a6,function(_0x3a9f37){if(_0x3a9f37[_0xd937('0x58')]===0x64){_0x3a9f37[_0xd937('0x63')]=_0x29fc71;}return _0x3a9f37;});});}else{return;}})[_0xd937('0x29')](function(_0x1c6abf){if(_0x1c6abf)_0x5779a6=_0x1c6abf;if(_[_0xd937('0x61')](_0x19de27,0x3eb)){var _0xb0d19a=_[_0xd937('0x49')](_0x5779a6,{'sectionId':0x3eb});return getCustomDashboards(_0xb0d19a)[_0xd937('0x29')](function(_0x2742a3){return _[_0xd937('0x2f')](_0x5779a6,function(_0x4df709){if(_0xb0d19a['enabled']){if(_0x4df709[_0xd937('0x58')]===0x3eb){_0x4df709[_0xd937('0x63')]=_0x2742a3;}}else{if(_0x4df709['sectionId']===0x64){_0x4df709[_0xd937('0x63')]=_0x2742a3;}}return _0x4df709;});});}else{return;}})[_0xd937('0x29')](function(_0x2bd83a){if(_0x2bd83a)_0x5779a6=_0x2bd83a;if(_[_0xd937('0x61')](_0x19de27,0x709)){var _0x23b1f6=_[_0xd937('0x49')](_0x5779a6,{'sectionId':0x709});return getPlugins(_0x23b1f6)[_0xd937('0x29')](function(_0x57959a){if(_0x23b1f6[_0xd937('0x60')]){return _[_0xd937('0x2f')](_0x5779a6,function(_0x34935f){if(_0x34935f['sectionId']===0x709){_0x34935f['subsections']=_0x57959a;}return _0x34935f;});}else{var _0x468e6e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x57959a};var _0xe4dee6=_[_0xd937('0x2f')](_0x5779a6);_0xe4dee6[_0xd937('0x5d')](_0x468e6e);return _0xe4dee6;}});}else{return;}})[_0xd937('0x29')](function(_0x3d5a05){if(_0x3d5a05)_0x5779a6=_0x3d5a05;return _['filter'](_0x5779a6,['enabled',0x1]);})[_0xd937('0x29')](respondWithResult(_0x398912,null))[_0xd937('0x46')](handleError(_0x398912,null));};function hasDefaultDashboard(_0x48f16e){var _0x5a492e=[0x65];return new BPromise(function(_0x51080e,_0x28b88f){try{if(_0x48f16e['autoAssociation']){_0x51080e(_0x5a492e);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x48f16e['id']},'raw':!![]})[_0xd937('0x29')](function(_0x477ac4){_0x477ac4?_0x51080e(_0x5a492e):_0x51080e();});}}catch(_0x5ed2ca){_0x28b88f(_0x5ed2ca);}});}function getCustomDashboards(_0x30b02){var _0x2ec0de=[];return new BPromise(function(_0x244574,_0x5102ae){try{if(_0x30b02[_0xd937('0x56')]){return db[_0xd937('0x64')][_0xd937('0x54')]({'raw':!![]})[_0xd937('0x29')](function(_0x45adc3){_0x45adc3['forEach'](function(_0x53e067){_0x2ec0de[_0xd937('0x5d')](_0x53e067['id']+0x1869f);});_0x244574(_0x2ec0de);});}else{return db[_0xd937('0x57')][_0xd937('0x54')]({'where':{'sectionId':_0x30b02['id']},'raw':!![]})['then'](function(_0x124c15){_0x124c15[_0xd937('0x65')](function(_0xeb1d14){_0x2ec0de['push'](_0xeb1d14[_0xd937('0x66')]+0x1869f);});_0x244574(_0x2ec0de);});}}catch(_0x3608aa){_0x5102ae(_0x3608aa);}});}function getPlugins(_0x2cd0a0){var _0x210113=[];return new BPromise(function(_0x5a153a,_0x2f5743){try{if(_0x2cd0a0[_0xd937('0x56')]){return db[_0xd937('0x67')][_0xd937('0x54')]({'raw':!![]})[_0xd937('0x29')](function(_0x5be2ff){_0x5be2ff[_0xd937('0x65')](function(_0x25abc0){_0x210113['push'](_0x25abc0['id']+0x15b38);});_0x5a153a(_0x210113);});}else{return db[_0xd937('0x57')][_0xd937('0x54')]({'where':{'sectionId':_0x2cd0a0['id']},'raw':!![]})[_0xd937('0x29')](function(_0x6ef7ae){_0x6ef7ae['forEach'](function(_0x32928c){_0x210113['push'](_0x32928c[_0xd937('0x66')]+0x15b38);});_0x5a153a(_0x210113);});}}catch(_0x1be807){_0x2f5743(_0x1be807);}});}exports[_0xd937('0x68')]=function(_0x56b301,_0x279ffe){return db[_0xd937('0x30')][_0xd937('0x49')]({'where':{'id':_0x56b301[_0xd937('0x47')]['id']}})[_0xd937('0x29')](handleEntityNotFound(_0x279ffe,null))[_0xd937('0x29')](function(_0x5058da){if(_0x5058da){return db[_0xd937('0x51')][_0xd937('0x52')](function(_0x380c9d){return db[_0xd937('0x53')][_0xd937('0x54')]({'where':{'userProfileId':_0x56b301[_0xd937('0x47')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x152d3d){if(_0x152d3d){return db[_0xd937('0x53')][_0xd937('0x28')]({'where':{'userProfileId':_0x56b301[_0xd937('0x47')]['id'],'id':_[_0xd937('0x2f')](_0x152d3d,function(_0x5b0f36){return _0x5b0f36['id'];})},'transaction':_0x380c9d});}})[_0xd937('0x29')](function(_0x46ed16){var _0x3f506c=_[_0xd937('0x2f')](_0x56b301[_0xd937('0x4b')],function(_0x506c22){_0x506c22[_0xd937('0x59')]=_0x56b301[_0xd937('0x47')]['id'];return _0x506c22;});return db[_0xd937('0x53')][_0xd937('0x69')](_0x3f506c,{'raw':!![],'transaction':_0x380c9d});})[_0xd937('0x29')](function(_0xcf1b51){var _0x289be1=_[_0xd937('0x42')](_['map'](_0xcf1b51,function(_0x52ce47){return _0x52ce47[_0xd937('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x289be1){return db['UserProfileSection'][_0xd937('0x54')]({'where':{'userProfileId':_0x56b301[_0xd937('0x47')]['id'],'sectionId':_[_0xd937('0x2f')](_0x289be1,function(_0x28caba){return _0x28caba[_0xd937('0x58')];})},'attributes':['id',_0xd937('0x58')],'raw':!![]})['then'](function(_0x262671){var _0x310733=_[_0xd937('0x2f')](_0x56b301[_0xd937('0x4b')],function(_0x3ea365){_0x3ea365[_0xd937('0x59')]=_0x56b301['params']['id'];return _0x3ea365;});return db[_0xd937('0x57')][_0xd937('0x69')](_0x310733,{'raw':!![],'transaction':_0x380c9d});});}})[_0xd937('0x46')](handleError(_0x279ffe,null));});}})[_0xd937('0x29')](function(_0x220b4a){var _0x46c85f=_['map'](_0x220b4a,function(_0x404f37){return _0x404f37[_0xd937('0x4c')]({'plain':!![]});});})[_0xd937('0x29')](respondWithResult(_0x279ffe,null))['catch'](handleError(_0x279ffe,null));};exports[_0xd937('0x6a')]=function(_0x51bd0e,_0x5c6849,_0x2eb0f1){return db['UserProfile'][_0xd937('0x49')]({'where':{'id':_0x51bd0e[_0xd937('0x47')]['id']}})[_0xd937('0x29')](handleEntityNotFound(_0x5c6849,null))[_0xd937('0x29')](function(_0x35b7ad){if(_0x35b7ad){return _0x35b7ad[_0xd937('0x6a')](_0x51bd0e[_0xd937('0x36')][_0xd937('0x5f')]);}})[_0xd937('0x29')](respondWithStatusCode(_0x5c6849,null))[_0xd937('0x46')](handleError(_0x5c6849,null));};exports['getResources']=function(_0x13f0ce,_0x173342){var _0x1850a4={};if(!_0x13f0ce['query']['section'])throw new Error(_0xd937('0x6b'));if(!_0x13f0ce[_0xd937('0x36')][_0xd937('0x6c')](_0xd937('0x3b'))){_0x1850a4[_0xd937('0x22')]=qs[_0xd937('0x22')](_0x13f0ce[_0xd937('0x36')][_0xd937('0x22')]);_0x1850a4[_0xd937('0x20')]=qs[_0xd937('0x20')](_0x13f0ce['query'][_0xd937('0x20')]);}return db[_0xd937('0x30')][_0xd937('0x49')]({'where':{'id':_0x13f0ce[_0xd937('0x47')]['id']}})[_0xd937('0x29')](function(_0x10c3bd){if(!_0x10c3bd)throw new Error(_0xd937('0x6d')+_0x13f0ce[_0xd937('0x47')]['id']);return db[_0xd937('0x30')]['getResources'](_0x13f0ce);})[_0xd937('0x29')](respondWithFilteredResult(_0x173342,_0x1850a4))[_0xd937('0x46')](handleError(_0x173342,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index d93359e..095d217 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 _0xf567=['events','../../mysqldb','UserProfile','save','update','emit','hasOwnProperty','hook'];(function(_0x4edad2,_0x4b0b47){var _0x298b0c=function(_0x2e976b){while(--_0x2e976b){_0x4edad2['push'](_0x4edad2['shift']());}};_0x298b0c(++_0x4b0b47);}(_0xf567,0x118));var _0x7f56=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf567[_0x57b54c];return _0x59cc19;};'use strict';var EventEmitter=require(_0x7f56('0x0'));var UserProfile=require(_0x7f56('0x1'))['db'][_0x7f56('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7f56('0x3'),'afterUpdate':_0x7f56('0x4'),'afterDestroy':'remove'};function emitEvent(_0x548b5b){return function(_0x26ecb0,_0x271ddb,_0xe30bba){UserProfileEvents['emit'](_0x548b5b+':'+_0x26ecb0['id'],_0x26ecb0);UserProfileEvents[_0x7f56('0x5')](_0x548b5b,_0x26ecb0);_0xe30bba(null);};}for(var e in events){if(events[_0x7f56('0x6')](e)){var event=events[e];UserProfile[_0x7f56('0x7')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xaa56=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','../../mysqldb','UserProfile'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa56,0xc6));var _0x6aa5=function(_0x15aa20,_0x2a2852){_0x15aa20=_0x15aa20-0x0;var _0x7c31e8=_0xaa56[_0x15aa20];return _0x7c31e8;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x6aa5('0x0'))['db'][_0x6aa5('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6aa5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6aa5('0x3'),'afterDestroy':_0x6aa5('0x4')};function emitEvent(_0x34842d){return function(_0x39e1a6,_0x1662ee,_0x52b3d3){UserProfileEvents[_0x6aa5('0x5')](_0x34842d+':'+_0x39e1a6['id'],_0x39e1a6);UserProfileEvents['emit'](_0x34842d,_0x39e1a6);_0x52b3d3(null);};}for(var e in events){if(events[_0x6aa5('0x6')](e)){var event=events[e];UserProfile[_0x6aa5('0x7')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 391a2f9..093bbe8 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 _0xc189=['variables','Variable','plugins','Plugin','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','raw','section','mergeResources','Invalid\x20section\x20\x27','length','push','find','params','all','isEmpty','union','ignore','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','merge','key','foreignKey','forEach','options','reportType','default','custom','count','ids','customSorting','extraQueryConditions','includeAll','include','Tag','color','tag','rows','Agents','openTabs','true','chat','sms','dataValues','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','value','findAll','then','associatedResources','map','field','model','name','UserProfileResource','AnalyticExtractedReport','resourceId','catch','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','projects','contacts','CmContact','ListId','lists','companies','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','internalroutes','contexts','VoiceContext','voicemails','VoiceMail','membername','User','agent','role','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','Users','admin','Telephones','salesforceaccounts','SalesforceAccount','freshdeskaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','trunks','Trunk'];(function(_0x1eb3a9,_0x1bc3d2){var _0x588a71=function(_0x4399d8){while(--_0x4399d8){_0x1eb3a9['push'](_0x1eb3a9['shift']());}};_0x588a71(++_0x1bc3d2);}(_0xc189,0x1c6));var _0x9c18=function(_0x5e7979,_0x4175c0){_0x5e7979=_0x5e7979-0x0;var _0x50f569=_0xc189[_0x5e7979];return _0x50f569;};'use strict';var _=require(_0x9c18('0x0'));var attributes=require(_0x9c18('0x1'));var qs=require(_0x9c18('0x2'));var squel=require(_0x9c18('0x3'));module['exports']=function(_0x11242d){var _0xef7bba=_0x11242d[_0x9c18('0x4')];function _0x4d711e(_0x47f1ca,_0xaa7a58){return new Promise(function(_0x272f0e,_0x1ae49c){if(!_0xaa7a58)return _0x272f0e(null);var _0x1a7910=_0xaa7a58[_0x9c18('0x5')]?{[_0xaa7a58[_0x9c18('0x5')]['field']]:_0xaa7a58[_0x9c18('0x5')][_0x9c18('0x6')]}:undefined;return _0xef7bba[_0x47f1ca][_0x9c18('0x7')]({'where':_0x1a7910,'raw':!![]})[_0x9c18('0x8')](function(_0x2aa414){_0xaa7a58[_0x9c18('0x9')]=_[_0x9c18('0xa')](_0x2aa414,'id');_0x272f0e(_0xaa7a58);})['catch'](function(_0x505d86){_0x1ae49c(_0x505d86);});});}function _0x760ed8(_0x43f87d,_0x1c6869){return new Promise(function(_0x243ac8,_0x129895){var _0x1e96fa=_0x43f87d['filter']?{[_0x43f87d[_0x9c18('0x5')][_0x9c18('0xb')]]:_0x43f87d[_0x9c18('0x5')]['value']}:undefined;return _0xef7bba[_0x43f87d[_0x9c18('0xc')]][_0x9c18('0x7')]({'where':_0x1e96fa,'raw':!![]})[_0x9c18('0x8')](function(_0x48e72b){_0x1c6869[_0x9c18('0x9')]=_['map'](_0x48e72b,function(_0x3d390e){return _0x3d390e[_0x9c18('0xd')];});_0x243ac8(_0x1c6869);})['catch'](function(_0x2c0cd4){_0x129895(_0x2c0cd4);});});}function _0x13e0f2(_0x5d9b7e,_0x16ff2b,_0x114312){if(!_0x16ff2b)return Promise['resolve'](null);return new Promise(function(_0x34eab1,_0x4a1b58){return _0xef7bba[_0x9c18('0xe')][_0x9c18('0x7')]({'where':{'sectionId':_0x16ff2b['id']},'raw':!![]})[_0x9c18('0x8')](function(_0x4ea427){if(_0x5d9b7e[_0x9c18('0xb')]&&_0x5d9b7e[_0x9c18('0xb')]!=='id'){_0x16ff2b['associatedResources']=_[_0x9c18('0xa')](_0x4ea427,function(_0x466e9c){return _0x466e9c[_0x5d9b7e[_0x9c18('0xb')]];});}else{if(_0x114312===_0x9c18('0xf')){_0x16ff2b[_0x9c18('0x9')]=_[_0x9c18('0xa')](_0x4ea427,function(_0x55e152){return{'id':_0x55e152[_0x9c18('0x10')],'type':_0x55e152['type']};});}else{_0x16ff2b[_0x9c18('0x9')]=_[_0x9c18('0xa')](_0x4ea427,function(_0x2c2e68){return _0x2c2e68[_0x9c18('0x10')];});}}_0x34eab1(_0x16ff2b);})[_0x9c18('0x11')](function(_0x507774){_0x4a1b58(_0x507774);});});}function _0x2fd438(_0x3a156d,_0x8e45ce){var _0x56508d={'parentSections':[]};switch(_0x3a156d[_0x9c18('0x12')]()){case'squareprojects':_0x56508d[_0x9c18('0x13')]=_0x9c18('0x14');break;case _0x9c18('0x15'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x16');break;case'squarerecordings':_0x56508d['childModel']=_0x9c18('0x17');_0x56508d[_0x9c18('0x18')]=[{'name':_0x9c18('0x19'),'field':_0x9c18('0xd'),'foreignKey':_0x9c18('0x1a')}];break;case _0x9c18('0x1b'):_0x56508d[_0x9c18('0x13')]='JscriptyProject';break;case _0x9c18('0x1c'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x1d');_0x56508d[_0x9c18('0x18')]=[{'name':'Lists','field':'id','foreignKey':_0x9c18('0x1e')}];break;case _0x9c18('0x1f'):_0x56508d[_0x9c18('0x13')]='CmList';break;case _0x9c18('0x20'):_0x56508d[_0x9c18('0x13')]='CmCompany';break;case'globalcustomfields':_0x56508d[_0x9c18('0x13')]=_0x9c18('0x21');break;case _0x9c18('0x22'):_0x56508d['childModel']=_0x9c18('0x23');break;case _0x9c18('0x24'):_0x56508d['childModel']=_0x9c18('0x25');break;case _0x9c18('0x26'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x27');break;case _0x9c18('0x28'):_0x56508d['childModel']='FaxAccount';break;case'inboundroutes':case _0x9c18('0x29'):case'outboundroutes':_0x56508d[_0x9c18('0x13')]='VoiceExtension';break;case _0x9c18('0x2a'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x2b');break;case _0x9c18('0x2c'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x2d');break;case'voicerecordings':_0x56508d[_0x9c18('0x13')]='VoiceRecording';_0x56508d[_0x9c18('0x18')]=[{'name':'Agents','field':'name','foreignKey':_0x9c18('0x2e'),'model':_0x9c18('0x2f'),'filter':{'field':'role','value':[_0x9c18('0x30')]}},{'name':'Telephones','field':_0x9c18('0xd'),'foreignKey':_0x9c18('0x2e'),'model':_0x9c18('0x2f'),'filter':{'field':_0x9c18('0x31'),'value':['telephone']}},{'name':_0x9c18('0x32'),'field':_0x9c18('0xd'),'foreignKey':_0x9c18('0x33'),'model':_0x9c18('0x34'),'filter':{'field':_0x9c18('0x35'),'value':[_0x9c18('0x36')]}},{'name':_0x9c18('0x37'),'field':_0x9c18('0xd'),'foreignKey':_0x9c18('0x33'),'model':_0x9c18('0x34'),'filter':{'field':_0x9c18('0x35'),'value':[_0x9c18('0x38')]}}];break;case _0x9c18('0x39'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x3a');break;case'chanspies':_0x56508d[_0x9c18('0x13')]=_0x9c18('0x3b');break;case _0x9c18('0x3c'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x3d');break;case'ivrcampaigns':_0x56508d['childModel']='Campaign';break;case _0x9c18('0x3e'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x3f');break;case'mailaccounts':_0x56508d['childModel']=_0x9c18('0x40');break;case _0x9c18('0x41'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x42');break;case _0x9c18('0x43'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x44');break;case _0x9c18('0x45'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x46');break;case _0x9c18('0x47'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x48');break;case'smsaccounts':_0x56508d[_0x9c18('0x13')]=_0x9c18('0x49');break;case'whatsappqueues':_0x56508d['childModel']=_0x9c18('0x4a');break;case _0x9c18('0x4b'):_0x56508d['childModel']=_0x9c18('0x4c');break;case _0x9c18('0x4d'):_0x56508d[_0x9c18('0x13')]='Team';break;case _0x9c18('0x4e'):case _0x9c18('0x4f'):_0x56508d['childModel']='VoiceQueue';if(_0x8e45ce){_0x56508d[_0x9c18('0x18')]=[{'name':'VoiceQueues'},{'name':_0x9c18('0x37')}];}break;case _0x9c18('0x50'):case _0x9c18('0x51'):case'telephones':_0x56508d['childModel']=_0x9c18('0x2f');if(_0x8e45ce){_0x56508d[_0x9c18('0x18')]=[{'name':_0x9c18('0x52'),'filter':{'field':'role','value':[_0x9c18('0x53'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0x9c18('0x54')}];}break;case'zendeskaccounts':_0x56508d[_0x9c18('0x13')]='ZendeskAccount';break;case _0x9c18('0x55'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x56');break;case _0x9c18('0x57'):_0x56508d[_0x9c18('0x13')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x56508d[_0x9c18('0x13')]=_0x9c18('0x58');break;case _0x9c18('0x59'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x5a');break;case _0x9c18('0x5b'):_0x56508d[_0x9c18('0x13')]='ZohoAccount';break;case _0x9c18('0x5c'):_0x56508d['childModel']=_0x9c18('0x2f');break;case _0x9c18('0x5d'):_0x56508d['childModel']=_0x9c18('0x5e');break;case'dispositions':_0x56508d[_0x9c18('0x13')]=_0x9c18('0x5f');break;case _0x9c18('0x60'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x61');break;case _0x9c18('0x62'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x63');break;case'pauses':_0x56508d[_0x9c18('0x13')]='Pause';break;case _0x9c18('0x64'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x65');break;case _0x9c18('0x66'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x67');break;case _0x9c18('0x68'):_0x56508d[_0x9c18('0x13')]='Tag';break;case _0x9c18('0x69'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x6a');break;case _0x9c18('0x6b'):_0x56508d[_0x9c18('0x13')]='Trigger';break;case _0x9c18('0x6c'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x6d');break;case _0x9c18('0x6e'):_0x56508d['childModel']=_0x9c18('0x6f');break;case _0x9c18('0x70'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x71');break;case'extractedreports':_0x56508d[_0x9c18('0x13')]=_0x9c18('0xf');_0x56508d['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x9c18('0x72')}];break;case _0x9c18('0x73'):_0x56508d[_0x9c18('0x13')]=_0x9c18('0x74');break;}return _0x56508d;}function _0x4137a5(_0x33b0b6,_0x566061){var _0x3ee20c=_0x33b0b6[_0x9c18('0x75')](0x0)[_0x9c18('0x76')]()+_0x33b0b6[_0x9c18('0x77')](0x1);var _0x41c09d={'type':_0xef7bba[_0x9c18('0x78')][_0x9c18('0x79')][_0x9c18('0x7a')],'raw':!![]};return new Promise(function(_0x750210,_0x3de339){var _0x29babf=squel[_0x9c18('0x7b')]()[_0x9c18('0xb')](_0x9c18('0x7c')+_0x3ee20c+_0x9c18('0x7d'),'id')[_0x9c18('0xb')](_0x9c18('0x7e'))[_0x9c18('0x7f')]('user_has_'+_0x33b0b6+_0x9c18('0x80'),'ui')[_0x9c18('0x81')](_0x9c18('0x82'),_0x566061['id']);return _0xef7bba[_0x9c18('0x83')][_0x9c18('0x84')](_0x29babf[_0x9c18('0x85')](),_0x41c09d)[_0x9c18('0x8')](function(_0x2956cb){_0x566061[_0x3ee20c+_0x9c18('0x86')]=_0x2956cb;_0x750210(_0x2956cb);})[_0x9c18('0x11')](function(_0x220d6b){_0x3de339(_0x220d6b);});});}return _0x11242d[_0x9c18('0x87')](_0x9c18('0x88'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x38835b){var _0x5607ae={'raw':_0x38835b[_0x9c18('0x84')][_0x9c18('0x89')],'where':{}};var _0x5eac1d={};var _0x25a944={'count':0x0,'rows':[]};var _0x9d4a3e=_0x38835b['query'][_0x9c18('0x8a')];var _0x10d72d=_0x38835b[_0x9c18('0x84')][_0x9c18('0x8b')]||![];var _0x34cd64=_0x2fd438(_0x9d4a3e,_0x10d72d);if(!_0x34cd64['childModel'])throw new Error(_0x9c18('0x8c')+_0x9d4a3e+'\x27');var _0x268127=[{'name':_0x9d4a3e}];if(!_['isEmpty'](_0x34cd64[_0x9c18('0x18')]))_0x268127=_0x34cd64[_0x9c18('0x18')];var _0x3d92bf=[];for(var _0x32bc8f=0x0;_0x32bc8f<_0x268127[_0x9c18('0x8d')];_0x32bc8f++){_0x3d92bf[_0x9c18('0x8e')](_0xef7bba['UserProfileSection'][_0x9c18('0x8f')]({'where':{'userProfileId':_0x38835b[_0x9c18('0x90')]['id'],'name':_0x268127[_0x32bc8f][_0x9c18('0xd')]},'raw':!![]}));}return Promise[_0x9c18('0x91')](_0x3d92bf)[_0x9c18('0x8')](function(_0x4bfdbd){var _0x1ac8c4=_['filter'](_0x4bfdbd,function(_0x46d459){return _0x46d459?_0x46d459:undefined;});var _0x4c3ac4=_[_0x9c18('0x5')](_0x268127,['ignore',!![]]);var _0x4dd995=_[_0x9c18('0x92')](_0x1ac8c4)&&_['isEmpty'](_0x4c3ac4)?null:_[_0x9c18('0x93')](_0x4c3ac4,_0x1ac8c4);if(!_0x4dd995)return null;var _0x3c02d7=[];for(var _0x210ca9=0x0;_0x210ca9<_0x4dd995['length'];_0x210ca9++){var _0x28fe64=_[_0x9c18('0x8f')](_0x268127,function(_0x271caa){return _0x4dd995[_0x210ca9]?_0x271caa[_0x9c18('0xd')]===_0x4dd995[_0x210ca9]['name']:null;});if(_0x28fe64){if(_0x4dd995[_0x210ca9][_0x9c18('0x94')]){_0x3c02d7[_0x9c18('0x8e')](_0x4d711e(_0x34cd64[_0x9c18('0x13')],_0x4dd995[_0x210ca9]));}else{if(!_0x4dd995[_0x210ca9][_0x9c18('0x95')]){_0x3c02d7['push'](_0x13e0f2(_0x28fe64,_0x4dd995[_0x210ca9],_0x34cd64['childModel']));}else{if(_0x28fe64[_0x9c18('0xc')]){_0x3c02d7['push'](_0x760ed8(_0x28fe64,_0x4dd995[_0x210ca9]));}}}}}return Promise[_0x9c18('0x91')](_0x3c02d7);})[_0x9c18('0x8')](function(_0x5de708){var _0x1cb62f=_0x5de708;var _0x3cd4e9=null;if(_0x1cb62f){_0x3cd4e9=_0x1cb62f[_0x9c18('0x8d')]===0x1?_0x1cb62f[0x0]:null;}if(!_0x3cd4e9&&!_0x1cb62f)return _0x25a944;var _0x399f93=_0xef7bba[_0x34cd64[_0x9c18('0x13')]][_0x9c18('0x96')];_0x5eac1d[_0x9c18('0xc')]=_[_0x9c18('0x97')](_0x399f93);_0x5eac1d[_0x9c18('0x84')]=_[_0x9c18('0x97')](_0x38835b['query']);_0x5eac1d[_0x9c18('0x98')]=_[_0x9c18('0x99')](_0x5eac1d[_0x9c18('0xc')],_0x5eac1d[_0x9c18('0x84')]);_0x5607ae[_0x9c18('0x9a')]=_[_0x9c18('0x99')](_0x5eac1d[_0x9c18('0xc')],qs[_0x9c18('0x9b')](_0x38835b[_0x9c18('0x84')][_0x9c18('0x9b')]));_0x5607ae['attributes']=_0x5607ae['attributes'][_0x9c18('0x8d')]?_0x5607ae[_0x9c18('0x9a')]:_0x5eac1d[_0x9c18('0xc')];if(!_0x38835b[_0x9c18('0x84')][_0x9c18('0x9c')](_0x9c18('0x9d'))){_0x5607ae['limit']=qs[_0x9c18('0x9e')](_0x38835b[_0x9c18('0x84')]['limit']);_0x5607ae[_0x9c18('0x9f')]=qs[_0x9c18('0x9f')](_0x38835b[_0x9c18('0x84')][_0x9c18('0x9f')]);}_0x5607ae[_0x9c18('0xa0')]=qs['sort'](_0x38835b[_0x9c18('0x84')][_0x9c18('0xa1')]);_0x5607ae[_0x9c18('0x81')]=qs[_0x9c18('0x98')](_['pick'](_0x38835b[_0x9c18('0x84')],_0x5eac1d[_0x9c18('0x98')]));if(_0x38835b['query']['filter']){_0x5607ae['where']=_[_0x9c18('0xa2')](_0x5607ae['where'],{'$or':_[_0x9c18('0xa')](_0x399f93,function(_0x2b2991){if(_0x2b2991[_0x9c18('0x35')][_0x9c18('0xa3')]!=='VIRTUAL'){var _0x2f2069={};_0x2f2069[_0x2b2991['field']]={'$like':'%'+_0x38835b[_0x9c18('0x84')][_0x9c18('0x5')]+'%'};return _0x2f2069;}})});}var _0x265c92=[];var _0x16d72f=null;var _0x44eb3f={};if(_0x3cd4e9){_0x16d72f=_[_0x9c18('0x8f')](_0x268127,[_0x9c18('0xd'),_0x3cd4e9[_0x9c18('0xd')]]);if(_0x16d72f['field']){_0x44eb3f={};if(_0x34cd64[_0x9c18('0x13')]===_0x9c18('0xf')){_0x44eb3f[_0x16d72f[_0x9c18('0xa4')]]=_[_0x9c18('0xa')](_0x3cd4e9[_0x9c18('0x9')],'id');}else{_0x44eb3f[_0x16d72f[_0x9c18('0xa4')]]=_0x3cd4e9[_0x9c18('0x9')];}_0x265c92[_0x9c18('0x8e')](_0x44eb3f);}else{_0x5607ae['where']['id']=_0x3cd4e9[_0x9c18('0x9')];}}else{for(var _0x2a8ff9=0x0;_0x2a8ff9<_0x1cb62f[_0x9c18('0x8d')];_0x2a8ff9++){_0x16d72f=_[_0x9c18('0x8f')](_0x268127,[_0x9c18('0xd'),_0x1cb62f[_0x2a8ff9]['name']]);if(_0x16d72f['field']){_0x44eb3f={};_0x44eb3f[_0x16d72f['foreignKey']]=_0x1cb62f[_0x2a8ff9][_0x9c18('0x9')];_0x265c92[_0x9c18('0x8e')](_0x44eb3f);}else{if(!_0x5607ae['where']['id'])_0x5607ae['where']['id']=[];_0x1cb62f[_0x2a8ff9][_0x9c18('0x9')][_0x9c18('0xa5')](function(_0x3baae8){_0x5607ae[_0x9c18('0x81')]['id']['push'](_0x3baae8);});}}}if(!_[_0x9c18('0x92')](_0x265c92)){_0x5607ae[_0x9c18('0x81')]=_[_0x9c18('0xa2')](_0x5607ae[_0x9c18('0x81')],{'$and':{'$or':_0x265c92}});}_0x5607ae=_['merge']({},_0x5607ae,_0x38835b[_0x9c18('0xa6')]);if(_0x3cd4e9&&!_0x3cd4e9['autoAssociation']&&_0x34cd64['childModel']===_0x9c18('0xf')){if(_0x38835b[_0x9c18('0x84')]['includeAll']){_0x5607ae['include']=[{'all':!![]}];}return _0xef7bba[_0x34cd64['childModel']][_0x9c18('0x7')](_0x5607ae)[_0x9c18('0x8')](function(_0xe078cb){var _0x24c574=[];_0xe078cb[_0x9c18('0xa5')](function(_0x51dcac){var _0x23233d;switch(_0x51dcac[_0x9c18('0xa7')]){case _0x9c18('0xa8'):_0x23233d=_[_0x9c18('0x8f')](_0x3cd4e9[_0x9c18('0x9')],function(_0x40d18c){return _0x40d18c['id']===_0x51dcac[_0x9c18('0x72')]&&_0x40d18c['type']==='DefaultReports';});break;case _0x9c18('0xa9'):_0x23233d=_['find'](_0x3cd4e9[_0x9c18('0x9')],function(_0x3b4d5f){return _0x3b4d5f['id']===_0x51dcac[_0x9c18('0x72')]&&_0x3b4d5f['type']==='CustomReports';});break;}if(_0x23233d)_0x24c574[_0x9c18('0x8e')](_0x51dcac);});_0x25a944[_0x9c18('0xaa')]=_0x24c574[_0x9c18('0x8d')];_0x25a944['rows']=_0x24c574;return _0x25a944;});}else{if(!_[_0x9c18('0x92')](_0x38835b[_0x9c18('0x84')][_0x9c18('0xab')])){_0x5607ae[_0x9c18('0x81')]['id']=_0x5607ae[_0x9c18('0x81')]['id']?_[_0x9c18('0x99')](_0x5607ae[_0x9c18('0x81')]['id'],_0x38835b['query'][_0x9c18('0xab')]):_0x38835b[_0x9c18('0x84')][_0x9c18('0xab')];if(_0x38835b[_0x9c18('0x84')]['customSorting']){_0x5607ae['order']=_0x38835b['query'][_0x9c18('0xac')];}}if(_0x38835b['query'][_0x9c18('0xad')]){_0x5607ae[_0x9c18('0x81')]=_[_0x9c18('0xa2')](_0x5607ae[_0x9c18('0x81')],{'$and':_0x38835b['query'][_0x9c18('0xad')]});}return _0xef7bba[_0x34cd64[_0x9c18('0x13')]][_0x9c18('0xaa')]({'where':_0x5607ae['where']})[_0x9c18('0x8')](function(_0x1b1cb4){_0x25a944[_0x9c18('0xaa')]=_0x1b1cb4;if(_0x38835b['query'][_0x9c18('0xae')]){if(_0x34cd64[_0x9c18('0x13')]===_0x9c18('0x1d')){_0x5607ae[_0x9c18('0xaf')]=[{'model':_0xef7bba[_0x9c18('0xb0')],'as':'Tags','attributes':['id',_0x9c18('0xd'),_0x9c18('0xb1')],'required':_0x38835b[_0x9c18('0x84')][_0x9c18('0xb2')]?!![]:![]},{'model':_0xef7bba[_0x9c18('0xb0')],'as':'ThroughTags','attributes':['id',_0x9c18('0xd'),_0x9c18('0xb1')],'through':_0x38835b[_0x9c18('0x84')][_0x9c18('0xb2')]?{'attributes':[],'where':{'TagId':_0x38835b[_0x9c18('0x84')][_0x9c18('0xb2')]||undefined}}:{},'required':_0x38835b['query'][_0x9c18('0xb2')]?!![]:![]}];}else{_0x5607ae[_0x9c18('0xaf')]=[{'all':!![]}];}}return _0xef7bba[_0x34cd64[_0x9c18('0x13')]][_0x9c18('0x7')](_0x5607ae);})[_0x9c18('0x8')](function(_0x12e4a3){_0x25a944[_0x9c18('0xb3')]=_0x12e4a3;if(_0x9d4a3e===_0x9c18('0xb4')&&_0x38835b[_0x9c18('0x84')][_0x9c18('0xb5')]===_0x9c18('0xb6')){var _0x1d5315=[];for(var _0x34bcf5=0x0;_0x34bcf5<_0x25a944[_0x9c18('0xb3')]['length'];_0x34bcf5++){_0x1d5315['push'](_0x4137a5(_0x9c18('0xb7'),_0x25a944[_0x9c18('0xb3')][_0x34bcf5]['dataValues']));_0x1d5315[_0x9c18('0x8e')](_0x4137a5(_0x9c18('0xb8'),_0x25a944[_0x9c18('0xb3')][_0x34bcf5][_0x9c18('0xb9')]));_0x1d5315[_0x9c18('0x8e')](_0x4137a5('fax',_0x25a944[_0x9c18('0xb3')][_0x34bcf5][_0x9c18('0xb9')]));_0x1d5315[_0x9c18('0x8e')](_0x4137a5(_0x9c18('0xba'),_0x25a944['rows'][_0x34bcf5][_0x9c18('0xb9')]));_0x1d5315[_0x9c18('0x8e')](_0x4137a5(_0x9c18('0xbb'),_0x25a944['rows'][_0x34bcf5][_0x9c18('0xb9')]));_0x1d5315['push'](_0x4137a5('whatsapp',_0x25a944[_0x9c18('0xb3')][_0x34bcf5][_0x9c18('0xb9')]));}return Promise[_0x9c18('0x91')](_0x1d5315)[_0x9c18('0x8')](function(){return _0x25a944;});}return _0x25a944;});}});}}});}; \ No newline at end of file +var _0x8497=['chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceMail','voicerecordings','User','agent','Telephones','role','telephone','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoicePrefix','Campaign','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','queuecampaigns','VoiceQueues','users','agents','telephones','Users','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','then','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','params','all','ignore','keys','attributes','intersection','fields','hasOwnProperty','limit','offset','order','sort','filters','pick','merge','key','VIRTUAL','foreignKey','find','forEach','options','autoAssociation','includeAll','reportType','reportId','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','include','Tags','tag','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','models','filter','field','associatedResources','catch','value','model','findAll','map','name','resolve','UserProfileResource','AnalyticExtractedReport','toLowerCase','odbc','childModel','SquareOdbc','SquareRecording','parentSections','projects','contacts','CmContact','Lists','ListId','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue'];(function(_0x2cb2da,_0x1e3773){var _0x4d8135=function(_0x9b9675){while(--_0x9b9675){_0x2cb2da['push'](_0x2cb2da['shift']());}};_0x4d8135(++_0x1e3773);}(_0x8497,0x95));var _0x7849=function(_0x109faf,_0x24f932){_0x109faf=_0x109faf-0x0;var _0x592da1=_0x8497[_0x109faf];return _0x592da1;};'use strict';var _=require(_0x7849('0x0'));var attributes=require(_0x7849('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0x7849('0x2'));module['exports']=function(_0x13aff3){var _0x51436c=_0x13aff3[_0x7849('0x3')];function _0x2afa32(_0x4b2fbd,_0x21e9df){return new Promise(function(_0x44c931,_0x38f0e1){if(!_0x21e9df)return _0x44c931(null);var _0x4ee08f=_0x21e9df[_0x7849('0x4')]?{[_0x21e9df[_0x7849('0x4')][_0x7849('0x5')]]:_0x21e9df['filter']['value']}:undefined;return _0x51436c[_0x4b2fbd]['findAll']({'where':_0x4ee08f,'raw':!![]})['then'](function(_0x4f2de){_0x21e9df[_0x7849('0x6')]=_['map'](_0x4f2de,'id');_0x44c931(_0x21e9df);})[_0x7849('0x7')](function(_0x178a10){_0x38f0e1(_0x178a10);});});}function _0x5ba0ea(_0x21747b,_0x13ed84){return new Promise(function(_0xcb9b0e,_0x42c459){var _0x4d27b6=_0x21747b['filter']?{[_0x21747b[_0x7849('0x4')]['field']]:_0x21747b[_0x7849('0x4')][_0x7849('0x8')]}:undefined;return _0x51436c[_0x21747b[_0x7849('0x9')]][_0x7849('0xa')]({'where':_0x4d27b6,'raw':!![]})['then'](function(_0xf0b874){_0x13ed84['associatedResources']=_[_0x7849('0xb')](_0xf0b874,function(_0x4f249e){return _0x4f249e[_0x7849('0xc')];});_0xcb9b0e(_0x13ed84);})[_0x7849('0x7')](function(_0x15d707){_0x42c459(_0x15d707);});});}function _0x2146a1(_0x566009,_0x2480f4,_0x487e89){if(!_0x2480f4)return Promise[_0x7849('0xd')](null);return new Promise(function(_0x24dbed,_0x40f943){return _0x51436c[_0x7849('0xe')][_0x7849('0xa')]({'where':{'sectionId':_0x2480f4['id']},'raw':!![]})['then'](function(_0x98bd06){if(_0x566009[_0x7849('0x5')]&&_0x566009['field']!=='id'){_0x2480f4[_0x7849('0x6')]=_[_0x7849('0xb')](_0x98bd06,function(_0x10bbf5){return _0x10bbf5[_0x566009[_0x7849('0x5')]];});}else{if(_0x487e89===_0x7849('0xf')){_0x2480f4[_0x7849('0x6')]=_[_0x7849('0xb')](_0x98bd06,function(_0x466f17){return{'id':_0x466f17['resourceId'],'type':_0x466f17['type']};});}else{_0x2480f4['associatedResources']=_['map'](_0x98bd06,function(_0x1abc6d){return _0x1abc6d['resourceId'];});}}_0x24dbed(_0x2480f4);})[_0x7849('0x7')](function(_0x2c9347){_0x40f943(_0x2c9347);});});}function _0x26c126(_0x9eb0c1,_0x1e464d){var _0x9a9fd6={'parentSections':[]};switch(_0x9eb0c1[_0x7849('0x10')]()){case'squareprojects':_0x9a9fd6['childModel']='SquareProject';break;case _0x7849('0x11'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x13');break;case'squarerecordings':_0x9a9fd6['childModel']=_0x7849('0x14');_0x9a9fd6[_0x7849('0x15')]=[{'name':'SquareProjects','field':_0x7849('0xc'),'foreignKey':'projectName'}];break;case _0x7849('0x16'):_0x9a9fd6[_0x7849('0x12')]='JscriptyProject';break;case _0x7849('0x17'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x18');_0x9a9fd6['parentSections']=[{'name':_0x7849('0x19'),'field':'id','foreignKey':_0x7849('0x1a')}];break;case _0x7849('0x1b'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x1c');break;case'companies':_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x1d');break;case _0x7849('0x1e'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x1f');break;case _0x7849('0x20'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x21');break;case _0x7849('0x22'):_0x9a9fd6[_0x7849('0x12')]='ChatWebsite';break;case _0x7849('0x23'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x24');break;case _0x7849('0x25'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x26');break;case _0x7849('0x27'):case _0x7849('0x28'):case _0x7849('0x29'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x2a');break;case'contexts':_0x9a9fd6['childModel']='VoiceContext';break;case'voicemails':_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x2b');break;case _0x7849('0x2c'):_0x9a9fd6[_0x7849('0x12')]='VoiceRecording';_0x9a9fd6[_0x7849('0x15')]=[{'name':'Agents','field':_0x7849('0xc'),'foreignKey':'membername','model':_0x7849('0x2d'),'filter':{'field':'role','value':[_0x7849('0x2e')]}},{'name':_0x7849('0x2f'),'field':'name','foreignKey':'membername','model':_0x7849('0x2d'),'filter':{'field':_0x7849('0x30'),'value':[_0x7849('0x31')]}},{'name':'VoiceQueues','field':_0x7849('0xc'),'foreignKey':_0x7849('0x32'),'model':_0x7849('0x33'),'filter':{'field':_0x7849('0x34'),'value':[_0x7849('0x35')]}},{'name':_0x7849('0x36'),'field':'name','foreignKey':'queue','model':_0x7849('0x33'),'filter':{'field':_0x7849('0x34'),'value':[_0x7849('0x37')]}}];break;case _0x7849('0x38'):_0x9a9fd6['childModel']=_0x7849('0x39');break;case _0x7849('0x3a'):_0x9a9fd6[_0x7849('0x12')]='VoiceChanSpy';break;case'voiceprefixes':_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x3b');break;case'ivrcampaigns':_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x3c');break;case'mailqueues':_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x3d');break;case _0x7849('0x3e'):_0x9a9fd6[_0x7849('0x12')]='MailAccount';break;case _0x7849('0x3f'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x40');break;case _0x7849('0x41'):_0x9a9fd6['childModel']=_0x7849('0x42');break;case'openchannelaccounts':_0x9a9fd6[_0x7849('0x12')]='OpenchannelAccount';break;case _0x7849('0x43'):_0x9a9fd6[_0x7849('0x12')]='SmsQueue';break;case _0x7849('0x44'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x45');break;case _0x7849('0x46'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x47');break;case _0x7849('0x48'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x49');break;case'teams':_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x4a');break;case'voicequeues':case _0x7849('0x4b'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x33');if(_0x1e464d){_0x9a9fd6['parentSections']=[{'name':_0x7849('0x4c')},{'name':_0x7849('0x36')}];}break;case _0x7849('0x4d'):case _0x7849('0x4e'):case _0x7849('0x4f'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x2d');if(_0x1e464d){_0x9a9fd6[_0x7849('0x15')]=[{'name':_0x7849('0x50'),'filter':{'field':_0x7849('0x30'),'value':['admin',_0x7849('0x51')]},'ignore':!![]},{'name':_0x7849('0x52')},{'name':'Telephones'}];}break;case _0x7849('0x53'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x54');break;case _0x7849('0x55'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x56');break;case _0x7849('0x57'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x58');break;case'sugarcrmaccounts':_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x59');break;case _0x7849('0x5a'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x5b');break;case _0x7849('0x5c'):_0x9a9fd6[_0x7849('0x12')]='ZohoAccount';break;case'vtigeraccounts':_0x9a9fd6[_0x7849('0x12')]='User';break;case'cannedanswers':_0x9a9fd6[_0x7849('0x12')]='CannedAnswer';break;case'dispositions':_0x9a9fd6[_0x7849('0x12')]='Disposition';break;case'customdashboards':_0x9a9fd6[_0x7849('0x12')]='Dashboard';break;case'intervals':_0x9a9fd6['childModel']=_0x7849('0x5d');break;case _0x7849('0x5e'):_0x9a9fd6['childModel']=_0x7849('0x5f');break;case _0x7849('0x60'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x61');break;case _0x7849('0x62'):_0x9a9fd6['childModel']=_0x7849('0x63');break;case'tags':_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x64');break;case'templates':_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x65');break;case _0x7849('0x66'):_0x9a9fd6['childModel']=_0x7849('0x67');break;case _0x7849('0x68'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x69');break;case _0x7849('0x6a'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x6b');break;case _0x7849('0x6c'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x6d');break;case _0x7849('0x6e'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0xf');_0x9a9fd6['parentSections']=[{'name':_0x7849('0x6f'),'field':'id','foreignKey':'reportId'}];break;case _0x7849('0x70'):_0x9a9fd6[_0x7849('0x12')]=_0x7849('0x71');break;}return _0x9a9fd6;}function _0x5c803b(_0x4d1de3,_0x453dc7){var _0x136061=_0x4d1de3[_0x7849('0x72')](0x0)[_0x7849('0x73')]()+_0x4d1de3[_0x7849('0x74')](0x1);var _0x12466f={'type':_0x51436c[_0x7849('0x75')][_0x7849('0x76')][_0x7849('0x77')],'raw':!![]};return new Promise(function(_0x40b433,_0x14478c){var _0x50358f=squel['select']()['field'](_0x7849('0x78')+_0x136061+_0x7849('0x79'),'id')[_0x7849('0x5')](_0x7849('0x7a'))['from'](_0x7849('0x7b')+_0x4d1de3+_0x7849('0x7c'),'ui')[_0x7849('0x7d')](_0x7849('0x7e'),_0x453dc7['id']);return _0x51436c[_0x7849('0x7f')][_0x7849('0x80')](_0x50358f['toString'](),_0x12466f)[_0x7849('0x81')](function(_0x59ccd9){_0x453dc7[_0x136061+_0x7849('0x82')]=_0x59ccd9;_0x40b433(_0x59ccd9);})[_0x7849('0x7')](function(_0x5ab562){_0x14478c(_0x5ab562);});});}return _0x13aff3[_0x7849('0x83')](_0x7849('0x84'),attributes,{'tableName':_0x7849('0x85'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2e0a2c){var _0x4c2a68={'raw':_0x2e0a2c['query'][_0x7849('0x86')],'where':{}};var _0x47eebc={};var _0x4eb219={'count':0x0,'rows':[]};var _0x5350db=_0x2e0a2c[_0x7849('0x80')][_0x7849('0x87')];var _0x164c60=_0x2e0a2c[_0x7849('0x80')][_0x7849('0x88')]||![];var _0x4ecee5=_0x26c126(_0x5350db,_0x164c60);if(!_0x4ecee5[_0x7849('0x12')])throw new Error(_0x7849('0x89')+_0x5350db+'\x27');var _0x538eaa=[{'name':_0x5350db}];if(!_[_0x7849('0x8a')](_0x4ecee5['parentSections']))_0x538eaa=_0x4ecee5[_0x7849('0x15')];var _0x34b843=[];for(var _0x10ca94=0x0;_0x10ca94<_0x538eaa[_0x7849('0x8b')];_0x10ca94++){_0x34b843[_0x7849('0x8c')](_0x51436c['UserProfileSection']['find']({'where':{'userProfileId':_0x2e0a2c[_0x7849('0x8d')]['id'],'name':_0x538eaa[_0x10ca94][_0x7849('0xc')]},'raw':!![]}));}return Promise[_0x7849('0x8e')](_0x34b843)[_0x7849('0x81')](function(_0x22ae5b){var _0x44f935=_[_0x7849('0x4')](_0x22ae5b,function(_0x460ae7){return _0x460ae7?_0x460ae7:undefined;});var _0x98d181=_[_0x7849('0x4')](_0x538eaa,[_0x7849('0x8f'),!![]]);var _0x5646f9=_[_0x7849('0x8a')](_0x44f935)&&_[_0x7849('0x8a')](_0x98d181)?null:_['union'](_0x98d181,_0x44f935);if(!_0x5646f9)return null;var _0x3324de=[];for(var _0x106e3a=0x0;_0x106e3a<_0x5646f9[_0x7849('0x8b')];_0x106e3a++){var _0x463f49=_['find'](_0x538eaa,function(_0x553eef){return _0x5646f9[_0x106e3a]?_0x553eef['name']===_0x5646f9[_0x106e3a][_0x7849('0xc')]:null;});if(_0x463f49){if(_0x5646f9[_0x106e3a]['ignore']){_0x3324de['push'](_0x2afa32(_0x4ecee5[_0x7849('0x12')],_0x5646f9[_0x106e3a]));}else{if(!_0x5646f9[_0x106e3a]['autoAssociation']){_0x3324de[_0x7849('0x8c')](_0x2146a1(_0x463f49,_0x5646f9[_0x106e3a],_0x4ecee5[_0x7849('0x12')]));}else{if(_0x463f49['model']){_0x3324de[_0x7849('0x8c')](_0x5ba0ea(_0x463f49,_0x5646f9[_0x106e3a]));}}}}}return Promise[_0x7849('0x8e')](_0x3324de);})['then'](function(_0x59c149){var _0x3681bc=_0x59c149;var _0x2a46f0=null;if(_0x3681bc){_0x2a46f0=_0x3681bc[_0x7849('0x8b')]===0x1?_0x3681bc[0x0]:null;}if(!_0x2a46f0&&!_0x3681bc)return _0x4eb219;var _0xd3c427=_0x51436c[_0x4ecee5['childModel']]['rawAttributes'];_0x47eebc[_0x7849('0x9')]=_['keys'](_0xd3c427);_0x47eebc['query']=_[_0x7849('0x90')](_0x2e0a2c[_0x7849('0x80')]);_0x47eebc['filters']=_['intersection'](_0x47eebc[_0x7849('0x9')],_0x47eebc[_0x7849('0x80')]);_0x4c2a68[_0x7849('0x91')]=_[_0x7849('0x92')](_0x47eebc['model'],qs['fields'](_0x2e0a2c[_0x7849('0x80')][_0x7849('0x93')]));_0x4c2a68[_0x7849('0x91')]=_0x4c2a68[_0x7849('0x91')][_0x7849('0x8b')]?_0x4c2a68[_0x7849('0x91')]:_0x47eebc[_0x7849('0x9')];if(!_0x2e0a2c['query'][_0x7849('0x94')]('nolimit')){_0x4c2a68[_0x7849('0x95')]=qs[_0x7849('0x95')](_0x2e0a2c['query'][_0x7849('0x95')]);_0x4c2a68[_0x7849('0x96')]=qs[_0x7849('0x96')](_0x2e0a2c['query'][_0x7849('0x96')]);}_0x4c2a68[_0x7849('0x97')]=qs[_0x7849('0x98')](_0x2e0a2c[_0x7849('0x80')][_0x7849('0x98')]);_0x4c2a68[_0x7849('0x7d')]=qs[_0x7849('0x99')](_[_0x7849('0x9a')](_0x2e0a2c['query'],_0x47eebc[_0x7849('0x99')]));if(_0x2e0a2c[_0x7849('0x80')][_0x7849('0x4')]){_0x4c2a68[_0x7849('0x7d')]=_[_0x7849('0x9b')](_0x4c2a68[_0x7849('0x7d')],{'$or':_[_0x7849('0xb')](_0xd3c427,function(_0x1074bd){if(_0x1074bd[_0x7849('0x34')][_0x7849('0x9c')]!==_0x7849('0x9d')){var _0x249993={};_0x249993[_0x1074bd[_0x7849('0x5')]]={'$like':'%'+_0x2e0a2c[_0x7849('0x80')]['filter']+'%'};return _0x249993;}})});}var _0x53c7af=[];var _0x348549=null;var _0x612f2c={};if(_0x2a46f0){_0x348549=_['find'](_0x538eaa,[_0x7849('0xc'),_0x2a46f0[_0x7849('0xc')]]);if(_0x348549['field']){_0x612f2c={};if(_0x4ecee5[_0x7849('0x12')]===_0x7849('0xf')){_0x612f2c[_0x348549[_0x7849('0x9e')]]=_[_0x7849('0xb')](_0x2a46f0[_0x7849('0x6')],'id');}else{_0x612f2c[_0x348549[_0x7849('0x9e')]]=_0x2a46f0[_0x7849('0x6')];}_0x53c7af['push'](_0x612f2c);}else{_0x4c2a68['where']['id']=_0x2a46f0[_0x7849('0x6')];}}else{for(var _0x5f0ddc=0x0;_0x5f0ddc<_0x3681bc['length'];_0x5f0ddc++){_0x348549=_[_0x7849('0x9f')](_0x538eaa,['name',_0x3681bc[_0x5f0ddc][_0x7849('0xc')]]);if(_0x348549[_0x7849('0x5')]){_0x612f2c={};_0x612f2c[_0x348549[_0x7849('0x9e')]]=_0x3681bc[_0x5f0ddc][_0x7849('0x6')];_0x53c7af[_0x7849('0x8c')](_0x612f2c);}else{if(!_0x4c2a68[_0x7849('0x7d')]['id'])_0x4c2a68['where']['id']=[];_0x3681bc[_0x5f0ddc][_0x7849('0x6')][_0x7849('0xa0')](function(_0x52913f){_0x4c2a68[_0x7849('0x7d')]['id'][_0x7849('0x8c')](_0x52913f);});}}}if(!_[_0x7849('0x8a')](_0x53c7af)){_0x4c2a68['where']=_['merge'](_0x4c2a68['where'],{'$and':{'$or':_0x53c7af}});}_0x4c2a68=_['merge']({},_0x4c2a68,_0x2e0a2c[_0x7849('0xa1')]);if(_0x2a46f0&&!_0x2a46f0[_0x7849('0xa2')]&&_0x4ecee5[_0x7849('0x12')]===_0x7849('0xf')){if(_0x2e0a2c[_0x7849('0x80')][_0x7849('0xa3')]){_0x4c2a68['include']=[{'all':!![]}];}return _0x51436c[_0x4ecee5[_0x7849('0x12')]]['findAll'](_0x4c2a68)['then'](function(_0x2b68da){var _0x32534b=[];_0x2b68da[_0x7849('0xa0')](function(_0x5634ea){var _0x487b22;switch(_0x5634ea[_0x7849('0xa4')]){case'default':_0x487b22=_[_0x7849('0x9f')](_0x2a46f0[_0x7849('0x6')],function(_0x20b064){return _0x20b064['id']===_0x5634ea[_0x7849('0xa5')]&&_0x20b064[_0x7849('0x34')]===_0x7849('0xa6');});break;case _0x7849('0xa7'):_0x487b22=_[_0x7849('0x9f')](_0x2a46f0['associatedResources'],function(_0x1fc1b1){return _0x1fc1b1['id']===_0x5634ea['reportId']&&_0x1fc1b1[_0x7849('0x34')]===_0x7849('0xa8');});break;}if(_0x487b22)_0x32534b[_0x7849('0x8c')](_0x5634ea);});_0x4eb219[_0x7849('0xa9')]=_0x32534b['length'];_0x4eb219[_0x7849('0xaa')]=_0x32534b;return _0x4eb219;});}else{if(!_[_0x7849('0x8a')](_0x2e0a2c[_0x7849('0x80')]['ids'])){_0x4c2a68['where']['id']=_0x4c2a68['where']['id']?_[_0x7849('0x92')](_0x4c2a68[_0x7849('0x7d')]['id'],_0x2e0a2c['query'][_0x7849('0xab')]):_0x2e0a2c['query'][_0x7849('0xab')];if(_0x2e0a2c['query'][_0x7849('0xac')]){_0x4c2a68[_0x7849('0x97')]=_0x2e0a2c[_0x7849('0x80')]['customSorting'];}}if(_0x2e0a2c[_0x7849('0x80')][_0x7849('0xad')]){_0x4c2a68[_0x7849('0x7d')]=_[_0x7849('0x9b')](_0x4c2a68[_0x7849('0x7d')],{'$and':_0x2e0a2c['query']['extraQueryConditions']});}return _0x51436c[_0x4ecee5[_0x7849('0x12')]][_0x7849('0xa9')]({'where':_0x4c2a68[_0x7849('0x7d')]})[_0x7849('0x81')](function(_0x2f6dfe){_0x4eb219[_0x7849('0xa9')]=_0x2f6dfe;if(_0x2e0a2c[_0x7849('0x80')][_0x7849('0xa3')]){if(_0x4ecee5[_0x7849('0x12')]===_0x7849('0x18')){_0x4c2a68[_0x7849('0xae')]=[{'model':_0x51436c[_0x7849('0x64')],'as':_0x7849('0xaf'),'attributes':['id',_0x7849('0xc'),'color'],'required':_0x2e0a2c[_0x7849('0x80')][_0x7849('0xb0')]?!![]:![]},{'model':_0x51436c[_0x7849('0x64')],'as':'ThroughTags','attributes':['id',_0x7849('0xc'),'color'],'through':_0x2e0a2c[_0x7849('0x80')]['tag']?{'attributes':[],'where':{'TagId':_0x2e0a2c[_0x7849('0x80')][_0x7849('0xb0')]||undefined}}:{},'required':_0x2e0a2c['query']['tag']?!![]:![]}];}else{_0x4c2a68[_0x7849('0xae')]=[{'all':!![]}];}}return _0x51436c[_0x4ecee5[_0x7849('0x12')]][_0x7849('0xa')](_0x4c2a68);})[_0x7849('0x81')](function(_0x2a571b){_0x4eb219[_0x7849('0xaa')]=_0x2a571b;if(_0x5350db===_0x7849('0x52')&&_0x2e0a2c['query']['openTabs']==='true'){var _0x2aa5b8=[];for(var _0xbc3bc0=0x0;_0xbc3bc0<_0x4eb219[_0x7849('0xaa')][_0x7849('0x8b')];_0xbc3bc0++){_0x2aa5b8[_0x7849('0x8c')](_0x5c803b(_0x7849('0xb1'),_0x4eb219['rows'][_0xbc3bc0][_0x7849('0xb2')]));_0x2aa5b8[_0x7849('0x8c')](_0x5c803b(_0x7849('0xb3'),_0x4eb219[_0x7849('0xaa')][_0xbc3bc0]['dataValues']));_0x2aa5b8[_0x7849('0x8c')](_0x5c803b('fax',_0x4eb219[_0x7849('0xaa')][_0xbc3bc0][_0x7849('0xb2')]));_0x2aa5b8[_0x7849('0x8c')](_0x5c803b(_0x7849('0xb4'),_0x4eb219[_0x7849('0xaa')][_0xbc3bc0]['dataValues']));_0x2aa5b8[_0x7849('0x8c')](_0x5c803b(_0x7849('0xb5'),_0x4eb219[_0x7849('0xaa')][_0xbc3bc0][_0x7849('0xb2')]));_0x2aa5b8['push'](_0x5c803b(_0x7849('0xb6'),_0x4eb219[_0x7849('0xaa')][_0xbc3bc0][_0x7849('0xb2')]));}return Promise[_0x7849('0x8e')](_0x2aa5b8)[_0x7849('0x81')](function(){return _0x4eb219;});}return _0x4eb219;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 6eff60a..91e2d00 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 _0xdd68=['defaults','localhost','socket.io-emitter','redis','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x4c5c4c,_0x4f25e1){var _0x546718=function(_0x44f2ec){while(--_0x44f2ec){_0x4c5c4c['push'](_0x4c5c4c['shift']());}};_0x546718(++_0x4f25e1);}(_0xdd68,0x196));var _0x8dd6=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0xdd68[_0x737a1f];return _0x16eba1;};'use strict';var _=require(_0x8dd6('0x0'));var util=require('util');var moment=require(_0x8dd6('0x1'));var BPromise=require(_0x8dd6('0x2'));var rs=require(_0x8dd6('0x3'));var fs=require('fs');var Redis=require(_0x8dd6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8dd6('0x5'));var logger=require(_0x8dd6('0x6'))('rpc');var config=require(_0x8dd6('0x7'));var jayson=require(_0x8dd6('0x8'));var client=jayson['client'][_0x8dd6('0x9')]({'port':0x232a});config['redis']=_[_0x8dd6('0xa')](config['redis'],{'host':_0x8dd6('0xb'),'port':0x18eb});var socket=require(_0x8dd6('0xc'))(new Redis(config[_0x8dd6('0xd')]));require('./userProfile.socket')[_0x8dd6('0xe')](socket);function respondWithRpcPromise(_0x7ef2a7,_0x1ef33d,_0x2dc6ea){return new BPromise(function(_0x34bd4e,_0x19e423){return client[_0x8dd6('0xf')](_0x7ef2a7,_0x2dc6ea)[_0x8dd6('0x10')](function(_0x84f828){logger[_0x8dd6('0x11')](_0x8dd6('0x12'),_0x1ef33d,_0x8dd6('0x13'));logger[_0x8dd6('0x14')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x1ef33d,_0x8dd6('0x13'),JSON[_0x8dd6('0x15')](_0x84f828));if(_0x84f828[_0x8dd6('0x16')]){if(_0x84f828['error']['code']===0x1f4){logger[_0x8dd6('0x16')]('UserProfile,\x20%s,\x20%s',_0x1ef33d,_0x84f828['error'][_0x8dd6('0x17')]);return _0x19e423(_0x84f828[_0x8dd6('0x16')][_0x8dd6('0x17')]);}logger[_0x8dd6('0x16')](_0x8dd6('0x12'),_0x1ef33d,_0x84f828[_0x8dd6('0x16')][_0x8dd6('0x17')]);return _0x34bd4e(_0x84f828[_0x8dd6('0x16')][_0x8dd6('0x17')]);}else{logger['info'](_0x8dd6('0x12'),_0x1ef33d,_0x8dd6('0x13'));_0x34bd4e(_0x84f828[_0x8dd6('0x18')][_0x8dd6('0x17')]);}})[_0x8dd6('0x19')](function(_0x36bcdc){logger[_0x8dd6('0x16')](_0x8dd6('0x12'),_0x1ef33d,_0x36bcdc);_0x19e423(_0x36bcdc);});});} \ No newline at end of file +var _0xe978=['error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe978,0x70));var _0x8e97=function(_0x32c6e7,_0x529c70){_0x32c6e7=_0x32c6e7-0x0;var _0x28c5f9=_0xe978[_0x32c6e7];return _0x28c5f9;};'use strict';var _=require(_0x8e97('0x0'));var util=require(_0x8e97('0x1'));var moment=require(_0x8e97('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e97('0x3'));var db=require(_0x8e97('0x4'))['db'];var utils=require(_0x8e97('0x5'));var logger=require(_0x8e97('0x6'))(_0x8e97('0x7'));var config=require('../../config/environment');var jayson=require(_0x8e97('0x8'));var client=jayson[_0x8e97('0x9')][_0x8e97('0xa')]({'port':0x232a});config[_0x8e97('0xb')]=_[_0x8e97('0xc')](config['redis'],{'host':_0x8e97('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8e97('0xb')]));require(_0x8e97('0xe'))[_0x8e97('0xf')](socket);function respondWithRpcPromise(_0x515bc2,_0x3149de,_0x1d2aa1){return new BPromise(function(_0x4406ad,_0x37b212){return client[_0x8e97('0x10')](_0x515bc2,_0x1d2aa1)[_0x8e97('0x11')](function(_0xa97614){logger[_0x8e97('0x12')](_0x8e97('0x13'),_0x3149de,_0x8e97('0x14'));logger[_0x8e97('0x15')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x3149de,_0x8e97('0x14'),JSON[_0x8e97('0x16')](_0xa97614));if(_0xa97614[_0x8e97('0x17')]){if(_0xa97614[_0x8e97('0x17')]['code']===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x3149de,_0xa97614['error']['message']);return _0x37b212(_0xa97614['error'][_0x8e97('0x18')]);}logger['error'](_0x8e97('0x13'),_0x3149de,_0xa97614[_0x8e97('0x17')]['message']);return _0x4406ad(_0xa97614['error'][_0x8e97('0x18')]);}else{logger[_0x8e97('0x12')](_0x8e97('0x13'),_0x3149de,_0x8e97('0x14'));_0x4406ad(_0xa97614[_0x8e97('0x19')][_0x8e97('0x18')]);}})[_0x8e97('0x1a')](function(_0x2a0800){logger[_0x8e97('0x17')]('UserProfile,\x20%s,\x20%s',_0x3149de,_0x2a0800);_0x37b212(_0x2a0800);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index d3b8593..86e3fd4 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 _0xa948=['userProfile:','./userProfile.events','save','remove','update','emit','register'];(function(_0x302b17,_0x921eef){var _0x2362b8=function(_0x13e488){while(--_0x13e488){_0x302b17['push'](_0x302b17['shift']());}};_0x2362b8(++_0x921eef);}(_0xa948,0x8d));var _0x8a94=function(_0x26d678,_0x273258){_0x26d678=_0x26d678-0x0;var _0x4ad538=_0xa948[_0x26d678];return _0x4ad538;};'use strict';var UserProfileEvents=require(_0x8a94('0x0'));var events=[_0x8a94('0x1'),_0x8a94('0x2'),_0x8a94('0x3')];function createListener(_0x126783,_0x4feba2){return function(_0x5769c2){_0x4feba2[_0x8a94('0x4')](_0x126783,_0x5769c2);};}function removeListener(_0x57075e,_0x5e2ad3){return function(){UserProfileEvents['removeListener'](_0x57075e,_0x5e2ad3);};}exports[_0x8a94('0x5')]=function(_0x12bc5c){for(var _0x562aea=0x0,_0x3d6dd0=events['length'];_0x562aea<_0x3d6dd0;_0x562aea++){var _0x3ae26a=events[_0x562aea];var _0x4074eb=createListener(_0x8a94('0x6')+_0x3ae26a,_0x12bc5c);UserProfileEvents['on'](_0x3ae26a,_0x4074eb);}}; \ No newline at end of file +var _0xb0c0=['save','remove','emit','removeListener','register','length','userProfile:','./userProfile.events'];(function(_0x2459c4,_0x7f42e4){var _0x5b92e4=function(_0x113090){while(--_0x113090){_0x2459c4['push'](_0x2459c4['shift']());}};_0x5b92e4(++_0x7f42e4);}(_0xb0c0,0x1cf));var _0x0b0c=function(_0xa66559,_0x466ee4){_0xa66559=_0xa66559-0x0;var _0x2be33f=_0xb0c0[_0xa66559];return _0x2be33f;};'use strict';var UserProfileEvents=require(_0x0b0c('0x0'));var events=[_0x0b0c('0x1'),_0x0b0c('0x2'),'update'];function createListener(_0x2e732a,_0x2d0d53){return function(_0x42aa24){_0x2d0d53[_0x0b0c('0x3')](_0x2e732a,_0x42aa24);};}function removeListener(_0x1046b1,_0x35defa){return function(){UserProfileEvents[_0x0b0c('0x4')](_0x1046b1,_0x35defa);};}exports[_0x0b0c('0x5')]=function(_0x569d09){for(var _0x284a89=0x0,_0x47299a=events[_0x0b0c('0x6')];_0x284a89<_0x47299a;_0x284a89++){var _0x3ebd0b=events[_0x284a89];var _0x203f4e=createListener(_0x0b0c('0x7')+_0x3ebd0b,_0x569d09);UserProfileEvents['on'](_0x3ebd0b,_0x203f4e);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 853a41f..ba993f0 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 _0x53f8=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x53f8,0x1b4));var _0x853f=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x53f8[_0x58afd5];return _0x3e503b;};'use strict';var multer=require('multer');var util=require(_0x853f('0x0'));var path=require(_0x853f('0x1'));var timeout=require(_0x853f('0x2'));var express=require(_0x853f('0x3'));var router=express[_0x853f('0x4')]();var fs_extra=require(_0x853f('0x5'));var auth=require(_0x853f('0x6'));var interaction=require(_0x853f('0x7'));var config=require(_0x853f('0x8'));var controller=require(_0x853f('0x9'));router[_0x853f('0xa')]('/',auth['isAuthenticated'](),controller[_0x853f('0xb')]);router[_0x853f('0xa')](_0x853f('0xc'),auth[_0x853f('0xd')](),controller['describe']);router[_0x853f('0xa')]('/:id',auth[_0x853f('0xd')](),controller[_0x853f('0xe')]);router['post']('/',auth[_0x853f('0xd')](),controller[_0x853f('0xf')]);router[_0x853f('0x10')](_0x853f('0x11'),auth[_0x853f('0xd')](),controller[_0x853f('0x12')]);router[_0x853f('0x13')]('/:id',auth[_0x853f('0xd')](),controller[_0x853f('0x14')]);module[_0x853f('0x15')]=router; \ No newline at end of file +var _0x7821=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','express','../../components/auth/service','../../config/environment','get'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7821,0x9c));var _0x1782=function(_0x589f71,_0x212326){_0x589f71=_0x589f71-0x0;var _0x5763bd=_0x7821[_0x589f71];return _0x5763bd;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1782('0x0'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1782('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x1782('0x2'));var controller=require('./userProfileResource.controller');router[_0x1782('0x3')]('/',auth[_0x1782('0x4')](),controller[_0x1782('0x5')]);router['get'](_0x1782('0x6'),auth['isAuthenticated'](),controller[_0x1782('0x7')]);router[_0x1782('0x3')](_0x1782('0x8'),auth['isAuthenticated'](),controller[_0x1782('0x9')]);router[_0x1782('0xa')]('/',auth['isAuthenticated'](),controller[_0x1782('0xb')]);router[_0x1782('0xc')]('/:id',auth[_0x1782('0x4')](),controller['update']);router[_0x1782('0xd')](_0x1782('0x8'),auth[_0x1782('0x4')](),controller[_0x1782('0xe')]);module[_0x1782('0xf')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 08c6fb1..c77477a 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 _0x0ac5=['INTEGER','exports','STRING'];(function(_0x282442,_0x185644){var _0x244748=function(_0x10a419){while(--_0x10a419){_0x282442['push'](_0x282442['shift']());}};_0x244748(++_0x185644);}(_0x0ac5,0x19c));var _0x50ac=function(_0x5c0866,_0x56b948){_0x5c0866=_0x5c0866-0x0;var _0x4120a1=_0x0ac5[_0x5c0866];return _0x4120a1;};'use strict';var Sequelize=require('sequelize');module[_0x50ac('0x0')]={'name':{'type':Sequelize[_0x50ac('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x50ac('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x50ac('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x4ab4=['INTEGER','STRING','sequelize','exports'];(function(_0x1e5f6c,_0x274467){var _0x256adb=function(_0x4b4688){while(--_0x4b4688){_0x1e5f6c['push'](_0x1e5f6c['shift']());}};_0x256adb(++_0x274467);}(_0x4ab4,0x1ba));var _0x44ab=function(_0x456fa8,_0x21b4e6){_0x456fa8=_0x456fa8-0x0;var _0x237f95=_0x4ab4[_0x456fa8];return _0x237f95;};'use strict';var Sequelize=require(_0x44ab('0x0'));module[_0x44ab('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x44ab('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x44ab('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 1543c15..4792e1b 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 _0x6343=['VIRTUAL','options','UserProfileResource','then','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0x2dbce7,_0x57cb8d){var _0x3a3ed0=function(_0x28c8c6){while(--_0x28c8c6){_0x2dbce7['push'](_0x2dbce7['shift']());}};_0x3a3ed0(++_0x57cb8d);}(_0x6343,0x168));var _0x3634=function(_0x585c9b,_0x53c88d){_0x585c9b=_0x585c9b-0x0;var _0x390dca=_0x6343[_0x585c9b];return _0x390dca;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['UserProfileResource'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));};exports[_0x3634('0x44')]=function(_0x1943a5,_0x1834a3){return db['UserProfileResource'][_0x3634('0x44')]()[_0x3634('0x39')](respondWithResult(_0x1834a3,null))[_0x3634('0x3b')](handleError(_0x1834a3,null));}; \ No newline at end of file +var _0x6343=['VIRTUAL','options','UserProfileResource','then','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0x6343,0x168));var _0x3634=function(_0x41c834,_0x5806a1){_0x41c834=_0x41c834-0x0;var _0x50cadd=_0x6343[_0x41c834];return _0x50cadd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['UserProfileResource'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));};exports[_0x3634('0x44')]=function(_0x1943a5,_0x1834a3){return db['UserProfileResource'][_0x3634('0x44')]()[_0x3634('0x39')](respondWithResult(_0x1834a3,null))[_0x3634('0x3b')](handleError(_0x1834a3,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 5d9068e..a53e6c5 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 _0xb01c=['path','rimraf','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb01c,0x93));var _0xcb01=function(_0x201f6a,_0x1b6f2e){_0x201f6a=_0x201f6a-0x0;var _0xf7370e=_0xb01c[_0x201f6a];return _0xf7370e;};'use strict';var _=require(_0xcb01('0x0'));var util=require(_0xcb01('0x1'));var logger=require(_0xcb01('0x2'))(_0xcb01('0x3'));var moment=require(_0xcb01('0x4'));var BPromise=require(_0xcb01('0x5'));var rp=require(_0xcb01('0x6'));var fs=require('fs');var path=require(_0xcb01('0x7'));var rimraf=require(_0xcb01('0x8'));var config=require('../../config/environment');var attributes=require(_0xcb01('0x9'));module[_0xcb01('0xa')]=function(_0x358e07,_0x4df561){return _0x358e07['define'](_0xcb01('0xb'),attributes,{'tableName':_0xcb01('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0xcb01('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7084=['user_profile_has_resources','compositeIndex','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource'];(function(_0x2dd3aa,_0x439111){var _0xfeab52=function(_0x4593af){while(--_0x4593af){_0x2dd3aa['push'](_0x2dd3aa['shift']());}};_0xfeab52(++_0x439111);}(_0x7084,0x136));var _0x4708=function(_0x75c3dd,_0xd5d01){_0x75c3dd=_0x75c3dd-0x0;var _0x36079a=_0x7084[_0x75c3dd];return _0x36079a;};'use strict';var _=require(_0x4708('0x0'));var util=require(_0x4708('0x1'));var logger=require(_0x4708('0x2'))(_0x4708('0x3'));var moment=require(_0x4708('0x4'));var BPromise=require(_0x4708('0x5'));var rp=require(_0x4708('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4708('0x7'));var attributes=require(_0x4708('0x8'));module[_0x4708('0x9')]=function(_0xbe2007,_0x343276){return _0xbe2007[_0x4708('0xa')](_0x4708('0xb'),attributes,{'tableName':_0x4708('0xc'),'paranoid':![],'indexes':[{'name':_0x4708('0xd'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index f7192ff..92ad8d9 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 _0xd46b=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x4ccd32,_0x3b11c9){var _0x30b693=function(_0x1b816f){while(--_0x1b816f){_0x4ccd32['push'](_0x4ccd32['shift']());}};_0x30b693(++_0x3b11c9);}(_0xd46b,0x14f));var _0xbd46=function(_0x504691,_0x2d34f4){_0x504691=_0x504691-0x0;var _0x24364c=_0xd46b[_0x504691];return _0x24364c;};'use strict';var _=require(_0xbd46('0x0'));var util=require(_0xbd46('0x1'));var moment=require(_0xbd46('0x2'));var BPromise=require(_0xbd46('0x3'));var rs=require(_0xbd46('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd46('0x5'))['db'];var utils=require(_0xbd46('0x6'));var logger=require(_0xbd46('0x7'))(_0xbd46('0x8'));var config=require('../../config/environment');var jayson=require(_0xbd46('0x9'));var client=jayson[_0xbd46('0xa')][_0xbd46('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5eba51,_0x5b5943,_0x4d11cd){return new BPromise(function(_0x4d723b,_0x1f28ba){return client[_0xbd46('0xc')](_0x5eba51,_0x4d11cd)[_0xbd46('0xd')](function(_0x1b4967){logger[_0xbd46('0xe')](_0xbd46('0xf'),_0x5b5943,_0xbd46('0x10'));logger[_0xbd46('0x11')](_0xbd46('0x12'),_0x5b5943,_0xbd46('0x10'),JSON['stringify'](_0x1b4967));if(_0x1b4967[_0xbd46('0x13')]){if(_0x1b4967[_0xbd46('0x13')][_0xbd46('0x14')]===0x1f4){logger[_0xbd46('0x13')](_0xbd46('0xf'),_0x5b5943,_0x1b4967[_0xbd46('0x13')][_0xbd46('0x15')]);return _0x1f28ba(_0x1b4967[_0xbd46('0x13')][_0xbd46('0x15')]);}logger[_0xbd46('0x13')](_0xbd46('0xf'),_0x5b5943,_0x1b4967[_0xbd46('0x13')][_0xbd46('0x15')]);return _0x4d723b(_0x1b4967['error'][_0xbd46('0x15')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x5b5943,_0xbd46('0x10'));_0x4d723b(_0x1b4967[_0xbd46('0x16')][_0xbd46('0x15')]);}})[_0xbd46('0x17')](function(_0x4df382){logger[_0xbd46('0x13')](_0xbd46('0xf'),_0x5b5943,_0x4df382);_0x1f28ba(_0x4df382);});});} \ No newline at end of file +var _0x6772=['UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x6772,0x8e));var _0x2677=function(_0x180fd8,_0x5446d8){_0x180fd8=_0x180fd8-0x0;var _0x503581=_0x6772[_0x180fd8];return _0x503581;};'use strict';var _=require(_0x2677('0x0'));var util=require(_0x2677('0x1'));var moment=require(_0x2677('0x2'));var BPromise=require('bluebird');var rs=require(_0x2677('0x3'));var fs=require('fs');var Redis=require(_0x2677('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2677('0x5'));var logger=require(_0x2677('0x6'))(_0x2677('0x7'));var config=require('../../config/environment');var jayson=require(_0x2677('0x8'));var client=jayson[_0x2677('0x9')][_0x2677('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11c5d7,_0x3ab534,_0x22deb8){return new BPromise(function(_0x441e7f,_0x549011){return client['request'](_0x11c5d7,_0x22deb8)[_0x2677('0xb')](function(_0x27d71e){logger[_0x2677('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x3ab534,_0x2677('0xd'));logger[_0x2677('0xe')](_0x2677('0xf'),_0x3ab534,_0x2677('0xd'),JSON[_0x2677('0x10')](_0x27d71e));if(_0x27d71e[_0x2677('0x11')]){if(_0x27d71e['error'][_0x2677('0x12')]===0x1f4){logger[_0x2677('0x11')](_0x2677('0x13'),_0x3ab534,_0x27d71e[_0x2677('0x11')]['message']);return _0x549011(_0x27d71e[_0x2677('0x11')]['message']);}logger[_0x2677('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x3ab534,_0x27d71e[_0x2677('0x11')][_0x2677('0x14')]);return _0x441e7f(_0x27d71e[_0x2677('0x11')][_0x2677('0x14')]);}else{logger[_0x2677('0xc')](_0x2677('0x13'),_0x3ab534,'request\x20sent');_0x441e7f(_0x27d71e[_0x2677('0x15')][_0x2677('0x14')]);}})[_0x2677('0x16')](function(_0x36a30b){logger['error'](_0x2677('0x13'),_0x3ab534,_0x36a30b);_0x549011(_0x36a30b);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index c1d62a5..6324014 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 _0x8a92=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','get','/describe','show','post','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x44b23e,_0x3d951d){var _0x228403=function(_0x6d6d92){while(--_0x6d6d92){_0x44b23e['push'](_0x44b23e['shift']());}};_0x228403(++_0x3d951d);}(_0x8a92,0x12a));var _0x28a9=function(_0x5c628c,_0x47d73a){_0x5c628c=_0x5c628c-0x0;var _0x217704=_0x8a92[_0x5c628c];return _0x217704;};'use strict';var multer=require('multer');var util=require(_0x28a9('0x0'));var path=require(_0x28a9('0x1'));var timeout=require(_0x28a9('0x2'));var express=require('express');var router=express[_0x28a9('0x3')]();var fs_extra=require(_0x28a9('0x4'));var auth=require(_0x28a9('0x5'));var interaction=require(_0x28a9('0x6'));var config=require(_0x28a9('0x7'));var controller=require(_0x28a9('0x8'));router['get']('/',auth[_0x28a9('0x9')](),controller['index']);router[_0x28a9('0xa')](_0x28a9('0xb'),auth[_0x28a9('0x9')](),controller['describe']);router['get']('/:id',auth[_0x28a9('0x9')](),controller[_0x28a9('0xc')]);router[_0x28a9('0xd')]('/',auth[_0x28a9('0x9')](),controller['create']);router[_0x28a9('0xe')](_0x28a9('0xf'),auth[_0x28a9('0x9')](),controller[_0x28a9('0x10')]);router[_0x28a9('0x11')](_0x28a9('0xf'),auth[_0x28a9('0x9')](),controller[_0x28a9('0x12')]);module[_0x28a9('0x13')]=router; \ No newline at end of file +var _0x6ed3=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','/describe','isAuthenticated','describe','show','create','put','/:id','destroy','exports','multer'];(function(_0x25e196,_0x338e4c){var _0x5c1356=function(_0x5d12b9){while(--_0x5d12b9){_0x25e196['push'](_0x25e196['shift']());}};_0x5c1356(++_0x338e4c);}(_0x6ed3,0x142));var _0x36ed=function(_0x36e20c,_0x43caa5){_0x36e20c=_0x36e20c-0x0;var _0x48eba2=_0x6ed3[_0x36e20c];return _0x48eba2;};'use strict';var multer=require(_0x36ed('0x0'));var util=require(_0x36ed('0x1'));var path=require(_0x36ed('0x2'));var timeout=require('connect-timeout');var express=require(_0x36ed('0x3'));var router=express['Router']();var fs_extra=require(_0x36ed('0x4'));var auth=require(_0x36ed('0x5'));var interaction=require(_0x36ed('0x6'));var config=require(_0x36ed('0x7'));var controller=require(_0x36ed('0x8'));router[_0x36ed('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x36ed('0x9')](_0x36ed('0xa'),auth[_0x36ed('0xb')](),controller[_0x36ed('0xc')]);router['get']('/:id',auth[_0x36ed('0xb')](),controller[_0x36ed('0xd')]);router['post']('/',auth[_0x36ed('0xb')](),controller[_0x36ed('0xe')]);router[_0x36ed('0xf')](_0x36ed('0x10'),auth[_0x36ed('0xb')](),controller['update']);router['delete']('/:id',auth[_0x36ed('0xb')](),controller[_0x36ed('0x11')]);module[_0x36ed('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index bcf596c..199bba3 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 _0xd4a2=['join','getDataValue','split','sequelize','STRING','BOOLEAN','setDataValue','crudPermissions'];(function(_0x2a7fbd,_0x4cda9b){var _0x39995a=function(_0x4e10f6){while(--_0x4e10f6){_0x2a7fbd['push'](_0x2a7fbd['shift']());}};_0x39995a(++_0x4cda9b);}(_0xd4a2,0x173));var _0x2d4a=function(_0x6541aa,_0x47b8a8){_0x6541aa=_0x6541aa-0x0;var _0x554f82=_0xd4a2[_0x6541aa];return _0x554f82;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x2d4a('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x2d4a('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x2d4a('0x1')],'set':function(_0x5d435a){this[_0x2d4a('0x3')](_0x2d4a('0x4'),_0x5d435a?_0x5d435a[_0x2d4a('0x5')](''):[]);},'get':function(){return this[_0x2d4a('0x6')](_0x2d4a('0x4'))?this['getDataValue'](_0x2d4a('0x4'))[_0x2d4a('0x7')](''):[];}}}; \ No newline at end of file +var _0xcf2f=['INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING'];(function(_0xbea5b4,_0x336457){var _0x27300a=function(_0x2ed83a){while(--_0x2ed83a){_0xbea5b4['push'](_0xbea5b4['shift']());}};_0x27300a(++_0x336457);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x355fac,_0x57cb37){_0x355fac=_0x355fac-0x0;var _0x7cdc3b=_0xcf2f[_0x355fac];return _0x7cdc3b;};'use strict';var Sequelize=require(_0xfcf2('0x0'));module[_0xfcf2('0x1')]={'name':{'type':Sequelize[_0xfcf2('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xfcf2('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xfcf2('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xfcf2('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xfcf2('0x2')],'set':function(_0x1e3661){this[_0xfcf2('0x5')](_0xfcf2('0x6'),_0x1e3661?_0x1e3661[_0xfcf2('0x7')](''):[]);},'get':function(){return this[_0xfcf2('0x8')](_0xfcf2('0x6'))?this[_0xfcf2('0x8')](_0xfcf2('0x6'))[_0xfcf2('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 9175e6f..f268fa3 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 _0xc30c=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','update','then','error','stack','name','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','UserProfileSection','count','includeAll','include','rows','catch','length','merge','find','create','body','destroy','params','describe','eml-format'];(function(_0x2f5638,_0x3f4643){var _0x35507f=function(_0x5c232b){while(--_0x5c232b){_0x2f5638['push'](_0x2f5638['shift']());}};_0x35507f(++_0x3f4643);}(_0xc30c,0x1c1));var _0xcc30=function(_0x3dbccb,_0x126d36){_0x3dbccb=_0x3dbccb-0x0;var _0x3e90e7=_0xc30c[_0x3dbccb];return _0x3e90e7;};'use strict';var emlformat=require(_0xcc30('0x0'));var rimraf=require(_0xcc30('0x1'));var zipdir=require(_0xcc30('0x2'));var jsonpatch=require(_0xcc30('0x3'));var rp=require(_0xcc30('0x4'));var moment=require(_0xcc30('0x5'));var BPromise=require(_0xcc30('0x6'));var Mustache=require('mustache');var util=require(_0xcc30('0x7'));var path=require(_0xcc30('0x8'));var sox=require(_0xcc30('0x9'));var csv=require(_0xcc30('0xa'));var ejs=require(_0xcc30('0xb'));var fs=require('fs');var fs_extra=require(_0xcc30('0xc'));var _=require('lodash');var squel=require(_0xcc30('0xd'));var crypto=require(_0xcc30('0xe'));var jsforce=require(_0xcc30('0xf'));var deskjs=require(_0xcc30('0x10'));var toCsv=require(_0xcc30('0xa'));var querystring=require(_0xcc30('0x11'));var Papa=require(_0xcc30('0x12'));var Redis=require('ioredis');var authService=require(_0xcc30('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xcc30('0x14'));var hardwareService=require(_0xcc30('0x15'));var logger=require(_0xcc30('0x16'))(_0xcc30('0x17'));var utils=require(_0xcc30('0x18'));var config=require(_0xcc30('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc30('0x1a'))['db'];function respondWithStatusCode(_0x83cc76,_0x1eaac7){_0x1eaac7=_0x1eaac7||0xcc;return function(_0x5466f2){if(_0x5466f2){return _0x83cc76[_0xcc30('0x1b')](_0x1eaac7);}return _0x83cc76[_0xcc30('0x1c')](_0x1eaac7)[_0xcc30('0x1d')]();};}function respondWithResult(_0x196042,_0x599e6e){_0x599e6e=_0x599e6e||0xc8;return function(_0x1b3ec7){if(_0x1b3ec7){return _0x196042[_0xcc30('0x1c')](_0x599e6e)['json'](_0x1b3ec7);}};}function respondWithFilteredResult(_0x592270,_0x5753ca){return function(_0x18f547){if(_0x18f547){var _0x5d17cd=typeof _0x5753ca[_0xcc30('0x1e')]===_0xcc30('0x1f')&&typeof _0x5753ca[_0xcc30('0x20')]==='undefined';var _0x198baa=_0x18f547['count'];var _0x572a43=_0x5d17cd?0x0:_0x5753ca[_0xcc30('0x1e')];var _0x40255d=_0x5d17cd?_0x18f547['count']:_0x5753ca[_0xcc30('0x1e')]+_0x5753ca['limit'];var _0x271318;if(_0x40255d>=_0x198baa){_0x40255d=_0x198baa;_0x271318=0xc8;}else{_0x271318=0xce;}_0x592270[_0xcc30('0x1c')](_0x271318);return _0x592270[_0xcc30('0x21')](_0xcc30('0x22'),_0x572a43+'-'+_0x40255d+'/'+_0x198baa)[_0xcc30('0x23')](_0x18f547);}return null;};}function patchUpdates(_0x479609){return function(_0x4abbcf){try{jsonpatch[_0xcc30('0x24')](_0x4abbcf,_0x479609,!![]);}catch(_0x2ae98a){return BPromise['reject'](_0x2ae98a);}return _0x4abbcf['save']();};}function saveUpdates(_0x532d12,_0x3ee5d9){return function(_0x4de604){if(_0x4de604){return _0x4de604[_0xcc30('0x25')](_0x532d12)[_0xcc30('0x26')](function(_0x21d61a){return _0x21d61a;});}return null;};}function removeEntity(_0x40e03a,_0x463337){return function(_0x568daa){if(_0x568daa){return _0x568daa['destroy']()[_0xcc30('0x26')](function(){_0x40e03a[_0xcc30('0x1c')](0xcc)[_0xcc30('0x1d')]();});}};}function handleEntityNotFound(_0x80d877,_0x5b8ce3){return function(_0x227d4c){if(!_0x227d4c){_0x80d877[_0xcc30('0x1b')](0x194);}return _0x227d4c;};}function handleError(_0x539a16,_0x26a7d5){_0x26a7d5=_0x26a7d5||0x1f4;return function(_0x26d3f2){logger[_0xcc30('0x27')](_0x26d3f2[_0xcc30('0x28')]);if(_0x26d3f2['name']){delete _0x26d3f2[_0xcc30('0x29')];}_0x539a16[_0xcc30('0x1c')](_0x26a7d5)['send'](_0x26d3f2);};}exports['index']=function(_0x5eb06d,_0x4d407d){var _0x480cc9={},_0x223bc0={},_0x3c5372={'count':0x0,'rows':[]};var _0x349882=_['map'](db['UserProfileSection'][_0xcc30('0x2a')],function(_0x353802){return{'name':_0x353802[_0xcc30('0x2b')],'type':_0x353802['type'][_0xcc30('0x2c')]};});_0x223bc0[_0xcc30('0x2d')]=_[_0xcc30('0x2e')](_0x349882,_0xcc30('0x29'));_0x223bc0[_0xcc30('0x2f')]=_[_0xcc30('0x30')](_0x5eb06d['query']);_0x223bc0[_0xcc30('0x31')]=_[_0xcc30('0x32')](_0x223bc0[_0xcc30('0x2d')],_0x223bc0['query']);_0x480cc9[_0xcc30('0x33')]=_['intersection'](_0x223bc0['model'],qs[_0xcc30('0x34')](_0x5eb06d[_0xcc30('0x2f')][_0xcc30('0x34')]));_0x480cc9[_0xcc30('0x33')]=_0x480cc9[_0xcc30('0x33')]['length']?_0x480cc9[_0xcc30('0x33')]:_0x223bc0[_0xcc30('0x2d')];if(!_0x5eb06d['query'][_0xcc30('0x35')](_0xcc30('0x36'))){_0x480cc9['limit']=qs[_0xcc30('0x20')](_0x5eb06d[_0xcc30('0x2f')][_0xcc30('0x20')]);_0x480cc9[_0xcc30('0x1e')]=qs[_0xcc30('0x1e')](_0x5eb06d['query'][_0xcc30('0x1e')]);}_0x480cc9[_0xcc30('0x37')]=qs[_0xcc30('0x38')](_0x5eb06d[_0xcc30('0x2f')][_0xcc30('0x38')]);_0x480cc9[_0xcc30('0x39')]=qs['filters'](_[_0xcc30('0x3a')](_0x5eb06d[_0xcc30('0x2f')],_0x223bc0[_0xcc30('0x31')]),_0x349882);if(_0x5eb06d[_0xcc30('0x2f')][_0xcc30('0x3b')]){_0x480cc9[_0xcc30('0x39')]=_['merge'](_0x480cc9[_0xcc30('0x39')],{'$or':_[_0xcc30('0x2e')](_0x349882,function(_0x3a0b12){if(_0x3a0b12['type']!=='VIRTUAL'){var _0x1c784a={};_0x1c784a[_0x3a0b12[_0xcc30('0x29')]]={'$like':'%'+_0x5eb06d[_0xcc30('0x2f')][_0xcc30('0x3b')]+'%'};return _0x1c784a;}})});}_0x480cc9=_['merge']({},_0x480cc9,_0x5eb06d[_0xcc30('0x3c')]);var _0x2d1f52={'where':_0x480cc9[_0xcc30('0x39')]};return db[_0xcc30('0x3d')][_0xcc30('0x3e')](_0x2d1f52)[_0xcc30('0x26')](function(_0x302772){_0x3c5372[_0xcc30('0x3e')]=_0x302772;if(_0x5eb06d['query'][_0xcc30('0x3f')]){_0x480cc9[_0xcc30('0x40')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x480cc9);})[_0xcc30('0x26')](function(_0x5416ae){_0x3c5372[_0xcc30('0x41')]=_0x5416ae;return _0x3c5372;})[_0xcc30('0x26')](respondWithFilteredResult(_0x4d407d,_0x480cc9))[_0xcc30('0x42')](handleError(_0x4d407d,null));};exports['show']=function(_0x8d3b25,_0x2f9e60){var _0x5c4e44={'raw':![],'where':{'id':_0x8d3b25['params']['id']}},_0x412d88={};_0x412d88[_0xcc30('0x2d')]=_[_0xcc30('0x30')](db[_0xcc30('0x3d')][_0xcc30('0x2a')]);_0x412d88[_0xcc30('0x2f')]=_[_0xcc30('0x30')](_0x8d3b25[_0xcc30('0x2f')]);_0x412d88[_0xcc30('0x31')]=_['intersection'](_0x412d88[_0xcc30('0x2d')],_0x412d88[_0xcc30('0x2f')]);_0x5c4e44[_0xcc30('0x33')]=_[_0xcc30('0x32')](_0x412d88[_0xcc30('0x2d')],qs[_0xcc30('0x34')](_0x8d3b25[_0xcc30('0x2f')][_0xcc30('0x34')]));_0x5c4e44[_0xcc30('0x33')]=_0x5c4e44['attributes'][_0xcc30('0x43')]?_0x5c4e44[_0xcc30('0x33')]:_0x412d88[_0xcc30('0x2d')];if(_0x8d3b25['query'][_0xcc30('0x3f')]){_0x5c4e44[_0xcc30('0x40')]=[{'all':!![]}];}_0x5c4e44=_[_0xcc30('0x44')]({},_0x5c4e44,_0x8d3b25[_0xcc30('0x3c')]);return db['UserProfileSection'][_0xcc30('0x45')](_0x5c4e44)[_0xcc30('0x26')](handleEntityNotFound(_0x2f9e60,null))['then'](respondWithResult(_0x2f9e60,null))[_0xcc30('0x42')](handleError(_0x2f9e60,null));};exports['create']=function(_0x478511,_0x4ab63e){return db[_0xcc30('0x3d')][_0xcc30('0x46')](_0x478511['body'],{})['then'](respondWithResult(_0x4ab63e,0xc9))[_0xcc30('0x42')](handleError(_0x4ab63e,null));};exports['update']=function(_0x460b15,_0x56f548){if(_0x460b15['body']['id']){delete _0x460b15['body']['id'];}return db['UserProfileSection'][_0xcc30('0x45')]({'where':{'id':_0x460b15['params']['id']}})[_0xcc30('0x26')](handleEntityNotFound(_0x56f548,null))[_0xcc30('0x26')](saveUpdates(_0x460b15[_0xcc30('0x47')],null))[_0xcc30('0x26')](respondWithResult(_0x56f548,null))['catch'](handleError(_0x56f548,null));};exports[_0xcc30('0x48')]=function(_0x172a04,_0x50644f){return db[_0xcc30('0x3d')][_0xcc30('0x45')]({'where':{'id':_0x172a04[_0xcc30('0x49')]['id']}})[_0xcc30('0x26')](handleEntityNotFound(_0x50644f,null))[_0xcc30('0x26')](removeEntity(_0x50644f,null))[_0xcc30('0x42')](handleError(_0x50644f,null));};exports[_0xcc30('0x4a')]=function(_0x178449,_0x47b687){return db[_0xcc30('0x3d')][_0xcc30('0x4a')]()[_0xcc30('0x26')](respondWithResult(_0x47b687,null))[_0xcc30('0x42')](handleError(_0x47b687,null));}; \ No newline at end of file +var _0x8efa=['json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','UserProfileSection','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','keys','rawAttributes','find','create','body','params','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end'];(function(_0x10b553,_0x4563a9){var _0x3bac9b=function(_0x13ea4b){while(--_0x13ea4b){_0x10b553['push'](_0x10b553['shift']());}};_0x3bac9b(++_0x4563a9);}(_0x8efa,0x76));var _0xa8ef=function(_0x5ece6e,_0x3a04e2){_0x5ece6e=_0x5ece6e-0x0;var _0x3691f9=_0x8efa[_0x5ece6e];return _0x3691f9;};'use strict';var emlformat=require(_0xa8ef('0x0'));var rimraf=require(_0xa8ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa8ef('0x2'));var moment=require('moment');var BPromise=require(_0xa8ef('0x3'));var Mustache=require(_0xa8ef('0x4'));var util=require(_0xa8ef('0x5'));var path=require('path');var sox=require(_0xa8ef('0x6'));var csv=require('to-csv');var ejs=require(_0xa8ef('0x7'));var fs=require('fs');var fs_extra=require(_0xa8ef('0x8'));var _=require(_0xa8ef('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa8ef('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa8ef('0xb'));var querystring=require(_0xa8ef('0xc'));var Papa=require(_0xa8ef('0xd'));var Redis=require(_0xa8ef('0xe'));var authService=require(_0xa8ef('0xf'));var qs=require(_0xa8ef('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8ef('0x11'));var logger=require(_0xa8ef('0x12'))(_0xa8ef('0x13'));var utils=require(_0xa8ef('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9b2051,_0x1f1f0f){_0x1f1f0f=_0x1f1f0f||0xcc;return function(_0x558596){if(_0x558596){return _0x9b2051[_0xa8ef('0x15')](_0x1f1f0f);}return _0x9b2051[_0xa8ef('0x16')](_0x1f1f0f)[_0xa8ef('0x17')]();};}function respondWithResult(_0x4e454c,_0x1fe760){_0x1fe760=_0x1fe760||0xc8;return function(_0x4c8df7){if(_0x4c8df7){return _0x4e454c['status'](_0x1fe760)[_0xa8ef('0x18')](_0x4c8df7);}};}function respondWithFilteredResult(_0x3921cf,_0x1e6cef){return function(_0x32bed0){if(_0x32bed0){var _0x2c888f=typeof _0x1e6cef[_0xa8ef('0x19')]===_0xa8ef('0x1a')&&typeof _0x1e6cef[_0xa8ef('0x1b')]===_0xa8ef('0x1a');var _0x5a114e=_0x32bed0['count'];var _0x49602d=_0x2c888f?0x0:_0x1e6cef[_0xa8ef('0x19')];var _0x355a6b=_0x2c888f?_0x32bed0[_0xa8ef('0x1c')]:_0x1e6cef['offset']+_0x1e6cef[_0xa8ef('0x1b')];var _0x196a52;if(_0x355a6b>=_0x5a114e){_0x355a6b=_0x5a114e;_0x196a52=0xc8;}else{_0x196a52=0xce;}_0x3921cf[_0xa8ef('0x16')](_0x196a52);return _0x3921cf[_0xa8ef('0x1d')](_0xa8ef('0x1e'),_0x49602d+'-'+_0x355a6b+'/'+_0x5a114e)[_0xa8ef('0x18')](_0x32bed0);}return null;};}function patchUpdates(_0x3230c5){return function(_0x3d7d1f){try{jsonpatch[_0xa8ef('0x1f')](_0x3d7d1f,_0x3230c5,!![]);}catch(_0x3ba149){return BPromise['reject'](_0x3ba149);}return _0x3d7d1f[_0xa8ef('0x20')]();};}function saveUpdates(_0x1bbbd8,_0x177601){return function(_0x29d0d4){if(_0x29d0d4){return _0x29d0d4['update'](_0x1bbbd8)['then'](function(_0x21cae1){return _0x21cae1;});}return null;};}function removeEntity(_0x2eefdc,_0xbb3bdd){return function(_0x50a2d3){if(_0x50a2d3){return _0x50a2d3[_0xa8ef('0x21')]()[_0xa8ef('0x22')](function(){_0x2eefdc[_0xa8ef('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3200e5,_0x2fa2b2){return function(_0x43ff34){if(!_0x43ff34){_0x3200e5['sendStatus'](0x194);}return _0x43ff34;};}function handleError(_0x2c63df,_0x31dbe5){_0x31dbe5=_0x31dbe5||0x1f4;return function(_0x4d8f0f){logger[_0xa8ef('0x23')](_0x4d8f0f[_0xa8ef('0x24')]);if(_0x4d8f0f[_0xa8ef('0x25')]){delete _0x4d8f0f['name'];}_0x2c63df[_0xa8ef('0x16')](_0x31dbe5)[_0xa8ef('0x26')](_0x4d8f0f);};}exports[_0xa8ef('0x27')]=function(_0x5ea905,_0x14974c){var _0xc40187={},_0x5010a7={},_0x4738fb={'count':0x0,'rows':[]};var _0x127851=_[_0xa8ef('0x28')](db[_0xa8ef('0x29')]['rawAttributes'],function(_0x3eda97){return{'name':_0x3eda97[_0xa8ef('0x2a')],'type':_0x3eda97[_0xa8ef('0x2b')][_0xa8ef('0x2c')]};});_0x5010a7['model']=_[_0xa8ef('0x28')](_0x127851,_0xa8ef('0x25'));_0x5010a7[_0xa8ef('0x2d')]=_['keys'](_0x5ea905[_0xa8ef('0x2d')]);_0x5010a7[_0xa8ef('0x2e')]=_[_0xa8ef('0x2f')](_0x5010a7[_0xa8ef('0x30')],_0x5010a7['query']);_0xc40187['attributes']=_['intersection'](_0x5010a7[_0xa8ef('0x30')],qs[_0xa8ef('0x31')](_0x5ea905[_0xa8ef('0x2d')][_0xa8ef('0x31')]));_0xc40187[_0xa8ef('0x32')]=_0xc40187[_0xa8ef('0x32')][_0xa8ef('0x33')]?_0xc40187['attributes']:_0x5010a7[_0xa8ef('0x30')];if(!_0x5ea905['query']['hasOwnProperty'](_0xa8ef('0x34'))){_0xc40187[_0xa8ef('0x1b')]=qs[_0xa8ef('0x1b')](_0x5ea905[_0xa8ef('0x2d')][_0xa8ef('0x1b')]);_0xc40187[_0xa8ef('0x19')]=qs[_0xa8ef('0x19')](_0x5ea905[_0xa8ef('0x2d')]['offset']);}_0xc40187[_0xa8ef('0x35')]=qs[_0xa8ef('0x36')](_0x5ea905[_0xa8ef('0x2d')][_0xa8ef('0x36')]);_0xc40187[_0xa8ef('0x37')]=qs[_0xa8ef('0x2e')](_[_0xa8ef('0x38')](_0x5ea905['query'],_0x5010a7['filters']),_0x127851);if(_0x5ea905['query']['filter']){_0xc40187[_0xa8ef('0x37')]=_[_0xa8ef('0x39')](_0xc40187['where'],{'$or':_['map'](_0x127851,function(_0xe3da6){if(_0xe3da6[_0xa8ef('0x2b')]!==_0xa8ef('0x3a')){var _0x29862a={};_0x29862a[_0xe3da6[_0xa8ef('0x25')]]={'$like':'%'+_0x5ea905[_0xa8ef('0x2d')]['filter']+'%'};return _0x29862a;}})});}_0xc40187=_[_0xa8ef('0x39')]({},_0xc40187,_0x5ea905[_0xa8ef('0x3b')]);var _0x1cdbaf={'where':_0xc40187[_0xa8ef('0x37')]};return db[_0xa8ef('0x29')][_0xa8ef('0x1c')](_0x1cdbaf)[_0xa8ef('0x22')](function(_0x46407e){_0x4738fb[_0xa8ef('0x1c')]=_0x46407e;if(_0x5ea905['query'][_0xa8ef('0x3c')]){_0xc40187[_0xa8ef('0x3d')]=[{'all':!![]}];}return db[_0xa8ef('0x29')]['findAll'](_0xc40187);})[_0xa8ef('0x22')](function(_0xc88267){_0x4738fb[_0xa8ef('0x3e')]=_0xc88267;return _0x4738fb;})[_0xa8ef('0x22')](respondWithFilteredResult(_0x14974c,_0xc40187))[_0xa8ef('0x3f')](handleError(_0x14974c,null));};exports['show']=function(_0x4318af,_0x54d9ea){var _0x51fd1f={'raw':![],'where':{'id':_0x4318af['params']['id']}},_0x572152={};_0x572152['model']=_[_0xa8ef('0x40')](db[_0xa8ef('0x29')][_0xa8ef('0x41')]);_0x572152[_0xa8ef('0x2d')]=_['keys'](_0x4318af['query']);_0x572152[_0xa8ef('0x2e')]=_['intersection'](_0x572152['model'],_0x572152[_0xa8ef('0x2d')]);_0x51fd1f[_0xa8ef('0x32')]=_[_0xa8ef('0x2f')](_0x572152[_0xa8ef('0x30')],qs[_0xa8ef('0x31')](_0x4318af[_0xa8ef('0x2d')][_0xa8ef('0x31')]));_0x51fd1f[_0xa8ef('0x32')]=_0x51fd1f[_0xa8ef('0x32')][_0xa8ef('0x33')]?_0x51fd1f['attributes']:_0x572152[_0xa8ef('0x30')];if(_0x4318af[_0xa8ef('0x2d')][_0xa8ef('0x3c')]){_0x51fd1f[_0xa8ef('0x3d')]=[{'all':!![]}];}_0x51fd1f=_[_0xa8ef('0x39')]({},_0x51fd1f,_0x4318af[_0xa8ef('0x3b')]);return db[_0xa8ef('0x29')][_0xa8ef('0x42')](_0x51fd1f)[_0xa8ef('0x22')](handleEntityNotFound(_0x54d9ea,null))[_0xa8ef('0x22')](respondWithResult(_0x54d9ea,null))[_0xa8ef('0x3f')](handleError(_0x54d9ea,null));};exports[_0xa8ef('0x43')]=function(_0x13d4ec,_0x2cd970){return db[_0xa8ef('0x29')][_0xa8ef('0x43')](_0x13d4ec[_0xa8ef('0x44')],{})['then'](respondWithResult(_0x2cd970,0xc9))[_0xa8ef('0x3f')](handleError(_0x2cd970,null));};exports['update']=function(_0x21ddcd,_0xb1650d){if(_0x21ddcd['body']['id']){delete _0x21ddcd[_0xa8ef('0x44')]['id'];}return db['UserProfileSection'][_0xa8ef('0x42')]({'where':{'id':_0x21ddcd[_0xa8ef('0x45')]['id']}})[_0xa8ef('0x22')](handleEntityNotFound(_0xb1650d,null))[_0xa8ef('0x22')](saveUpdates(_0x21ddcd[_0xa8ef('0x44')],null))[_0xa8ef('0x22')](respondWithResult(_0xb1650d,null))[_0xa8ef('0x3f')](handleError(_0xb1650d,null));};exports[_0xa8ef('0x21')]=function(_0x1ca87a,_0x3d9ddf){return db['UserProfileSection'][_0xa8ef('0x42')]({'where':{'id':_0x1ca87a['params']['id']}})[_0xa8ef('0x22')](handleEntityNotFound(_0x3d9ddf,null))['then'](removeEntity(_0x3d9ddf,null))[_0xa8ef('0x3f')](handleError(_0x3d9ddf,null));};exports[_0xa8ef('0x46')]=function(_0x489cfc,_0x5bc305){return db['UserProfileSection']['describe']()[_0xa8ef('0x22')](respondWithResult(_0x5bc305,null))[_0xa8ef('0x3f')](handleError(_0x5bc305,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index c26a56e..5214b33 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 _0xe810=['../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x560a57,_0x203da7){var _0x3028ba=function(_0x4bf4a8){while(--_0x4bf4a8){_0x560a57['push'](_0x560a57['shift']());}};_0x3028ba(++_0x203da7);}(_0xe810,0x104));var _0x0e81=function(_0x3a0539,_0x4637c6){_0x3a0539=_0x3a0539-0x0;var _0x439ab2=_0xe810[_0x3a0539];return _0x439ab2;};'use strict';var _=require(_0x0e81('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0e81('0x1'));var moment=require(_0x0e81('0x2'));var BPromise=require(_0x0e81('0x3'));var rp=require(_0x0e81('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e81('0x5'));var config=require(_0x0e81('0x6'));var attributes=require(_0x0e81('0x7'));module['exports']=function(_0x327d6f,_0x1478dd){return _0x327d6f[_0x0e81('0x8')](_0x0e81('0x9'),attributes,{'tableName':_0x0e81('0xa'),'paranoid':![],'indexes':[{'name':_0x0e81('0xb'),'fields':[_0x0e81('0xc'),_0x0e81('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f4d=['lodash','util','moment','bluebird','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','user_profile_has_sections','sectionId','userProfileId'];(function(_0x5d48f6,_0x2f0fbd){var _0x31858e=function(_0x1da1c2){while(--_0x1da1c2){_0x5d48f6['push'](_0x5d48f6['shift']());}};_0x31858e(++_0x2f0fbd);}(_0x5f4d,0x1e1));var _0xd5f4=function(_0x302e35,_0x197af1){_0x302e35=_0x302e35-0x0;var _0x31d5f9=_0x5f4d[_0x302e35];return _0x31d5f9;};'use strict';var _=require(_0xd5f4('0x0'));var util=require(_0xd5f4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd5f4('0x2'));var BPromise=require(_0xd5f4('0x3'));var rp=require(_0xd5f4('0x4'));var fs=require('fs');var path=require(_0xd5f4('0x5'));var rimraf=require(_0xd5f4('0x6'));var config=require('../../config/environment');var attributes=require(_0xd5f4('0x7'));module[_0xd5f4('0x8')]=function(_0x4e3d3f,_0x1d00a1){return _0x4e3d3f[_0xd5f4('0x9')]('UserProfileSection',attributes,{'tableName':_0xd5f4('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xd5f4('0xb'),_0xd5f4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 6edccea..d17d035 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 _0x1b74=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','moment'];(function(_0x37c006,_0x1f647a){var _0x3f306e=function(_0x48de6a){while(--_0x48de6a){_0x37c006['push'](_0x37c006['shift']());}};_0x3f306e(++_0x1f647a);}(_0x1b74,0xfa));var _0x41b7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1b74[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x41b7('0x0'));var util=require(_0x41b7('0x1'));var moment=require(_0x41b7('0x2'));var BPromise=require(_0x41b7('0x3'));var rs=require(_0x41b7('0x4'));var fs=require('fs');var Redis=require(_0x41b7('0x5'));var db=require(_0x41b7('0x6'))['db'];var utils=require(_0x41b7('0x7'));var logger=require('../../config/logger')(_0x41b7('0x8'));var config=require(_0x41b7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x41b7('0xa')][_0x41b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x306df5,_0x2b8640,_0x39b99c){return new BPromise(function(_0x44ecbc,_0x2c4e6a){return client['request'](_0x306df5,_0x39b99c)[_0x41b7('0xc')](function(_0xe4149){logger[_0x41b7('0xd')](_0x41b7('0xe'),_0x2b8640,_0x41b7('0xf'));logger[_0x41b7('0x10')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2b8640,_0x41b7('0xf'),JSON[_0x41b7('0x11')](_0xe4149));if(_0xe4149['error']){if(_0xe4149['error'][_0x41b7('0x12')]===0x1f4){logger[_0x41b7('0x13')](_0x41b7('0xe'),_0x2b8640,_0xe4149[_0x41b7('0x13')][_0x41b7('0x14')]);return _0x2c4e6a(_0xe4149[_0x41b7('0x13')][_0x41b7('0x14')]);}logger[_0x41b7('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x2b8640,_0xe4149[_0x41b7('0x13')]['message']);return _0x44ecbc(_0xe4149[_0x41b7('0x13')]['message']);}else{logger[_0x41b7('0xd')](_0x41b7('0xe'),_0x2b8640,_0x41b7('0xf'));_0x44ecbc(_0xe4149[_0x41b7('0x15')][_0x41b7('0x14')]);}})[_0x41b7('0x16')](function(_0x1da73b){logger[_0x41b7('0x13')](_0x41b7('0xe'),_0x2b8640,_0x1da73b);_0x2c4e6a(_0x1da73b);});});} \ No newline at end of file +var _0xb9be=['http','request','then','info','UserProfileSection,\x20%s,\x20%s','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xb9be,0x124));var _0xeb9b=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0xb9be[_0x1793de];return _0x4f0309;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeb9b('0x5'));var logger=require(_0xeb9b('0x6'))('rpc');var config=require(_0xeb9b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xeb9b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x22e0f0,_0x29eddc,_0x39759e){return new BPromise(function(_0x4fe8f4,_0xf11780){return client[_0xeb9b('0x9')](_0x22e0f0,_0x39759e)[_0xeb9b('0xa')](function(_0x5baef8){logger[_0xeb9b('0xb')](_0xeb9b('0xc'),_0x29eddc,'request\x20sent');logger['debug'](_0xeb9b('0xd'),_0x29eddc,_0xeb9b('0xe'),JSON[_0xeb9b('0xf')](_0x5baef8));if(_0x5baef8[_0xeb9b('0x10')]){if(_0x5baef8[_0xeb9b('0x10')]['code']===0x1f4){logger[_0xeb9b('0x10')](_0xeb9b('0xc'),_0x29eddc,_0x5baef8[_0xeb9b('0x10')][_0xeb9b('0x11')]);return _0xf11780(_0x5baef8[_0xeb9b('0x10')][_0xeb9b('0x11')]);}logger[_0xeb9b('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x29eddc,_0x5baef8[_0xeb9b('0x10')][_0xeb9b('0x11')]);return _0x4fe8f4(_0x5baef8[_0xeb9b('0x10')][_0xeb9b('0x11')]);}else{logger[_0xeb9b('0xb')](_0xeb9b('0xc'),_0x29eddc,_0xeb9b('0xe'));_0x4fe8f4(_0x5baef8[_0xeb9b('0x12')][_0xeb9b('0x11')]);}})[_0xeb9b('0x13')](function(_0x27462f){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x29eddc,_0x27462f);_0xf11780(_0x27462f);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index d171864..de42ee9 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5c1587,_0x3d4bce){var _0x473f37=function(_0x235818){while(--_0x235818){_0x5c1587['push'](_0x5c1587['shift']());}};_0x473f37(++_0x3d4bce);}(_0xe706,0xa3));var _0x6e70=function(_0x57111f,_0x2a7bde){_0x57111f=_0x57111f-0x0;var _0xe10f6f=_0xe706[_0x57111f];return _0xe10f6f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x178318,_0x56b403){var _0x243ceb=function(_0x56d924){while(--_0x56d924){_0x178318['push'](_0x178318['shift']());}};_0x243ceb(++_0x56b403);}(_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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 05033f1..6baba3d 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 _0xf109=['INTEGER','sequelize','exports'];(function(_0x1fb4ff,_0x172d25){var _0x3f2d20=function(_0x358d44){while(--_0x358d44){_0x1fb4ff['push'](_0x1fb4ff['shift']());}};_0x3f2d20(++_0x172d25);}(_0xf109,0x1de));var _0x9f10=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xf109[_0x42bdad];return _0x122626;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'penalty':{'type':Sequelize[_0x9f10('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5804=['INTEGER','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5804,0x8d));var _0x4580=function(_0x353cd6,_0xc795f6){_0x353cd6=_0x353cd6-0x0;var _0x55712a=_0x5804[_0x353cd6];return _0x55712a;};'use strict';var Sequelize=require('sequelize');module[_0x4580('0x0')]={'penalty':{'type':Sequelize[_0x4580('0x1')],'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 2760b77..04a1502 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 _0x8ace=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api'];(function(_0x5279cb,_0x1601be){var _0x55785a=function(_0x33fd36){while(--_0x33fd36){_0x5279cb['push'](_0x5279cb['shift']());}};_0x55785a(++_0x1601be);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x575c75,_0x120aa9){_0x575c75=_0x575c75-0x0;var _0x436370=_0x8ace[_0x575c75];return _0x436370;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var logger=require(_0xe8ac('0x2'))(_0xe8ac('0x3'));var moment=require(_0xe8ac('0x4'));var BPromise=require(_0xe8ac('0x5'));var rp=require(_0xe8ac('0x6'));var fs=require('fs');var path=require(_0xe8ac('0x7'));var rimraf=require(_0xe8ac('0x8'));var config=require(_0xe8ac('0x9'));var attributes=require(_0xe8ac('0xa'));module[_0xe8ac('0xb')]=function(_0x170e14,_0x2b48ec){return _0x170e14['define'](_0xe8ac('0xc'),attributes,{'tableName':_0xe8ac('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba34=['rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x2484be,_0x12368d){var _0x2953f1=function(_0x550863){while(--_0x550863){_0x2484be['push'](_0x2484be['shift']());}};_0x2953f1(++_0x12368d);}(_0xba34,0x119));var _0x4ba3=function(_0x38de7d,_0x5da61a){_0x38de7d=_0x38de7d-0x0;var _0x25d9cb=_0xba34[_0x38de7d];return _0x25d9cb;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('UserSmsQueue',attributes,{'tableName':_0x4ba3('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 797ea4e..0e485a1 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 _0x1a87=['ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x26df67,_0x481b4a){var _0x331dee=function(_0x29d0c2){while(--_0x29d0c2){_0x26df67['push'](_0x26df67['shift']());}};_0x331dee(++_0x481b4a);}(_0x1a87,0xa6));var _0x71a8=function(_0x3d69f5,_0xb99af3){_0x3d69f5=_0x3d69f5-0x0;var _0xfc942a=_0x1a87[_0x3d69f5];return _0xfc942a;};'use strict';var _=require(_0x71a8('0x0'));var util=require('util');var moment=require(_0x71a8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71a8('0x2'));var db=require(_0x71a8('0x3'))['db'];var utils=require(_0x71a8('0x4'));var logger=require(_0x71a8('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x71a8('0x6'));var client=jayson[_0x71a8('0x7')][_0x71a8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d7ba0,_0x790787,_0x399625){return new BPromise(function(_0x43df6f,_0x7478c0){return client[_0x71a8('0x9')](_0x4d7ba0,_0x399625)[_0x71a8('0xa')](function(_0xd929a7){logger[_0x71a8('0xb')](_0x71a8('0xc'),_0x790787,_0x71a8('0xd'));logger[_0x71a8('0xe')](_0x71a8('0xf'),_0x790787,'request\x20sent',JSON[_0x71a8('0x10')](_0xd929a7));if(_0xd929a7[_0x71a8('0x11')]){if(_0xd929a7[_0x71a8('0x11')]['code']===0x1f4){logger[_0x71a8('0x11')](_0x71a8('0xc'),_0x790787,_0xd929a7[_0x71a8('0x11')]['message']);return _0x7478c0(_0xd929a7[_0x71a8('0x11')][_0x71a8('0x12')]);}logger[_0x71a8('0x11')](_0x71a8('0xc'),_0x790787,_0xd929a7['error'][_0x71a8('0x12')]);return _0x43df6f(_0xd929a7[_0x71a8('0x11')][_0x71a8('0x12')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x790787,_0x71a8('0xd'));_0x43df6f(_0xd929a7[_0x71a8('0x13')][_0x71a8('0x12')]);}})[_0x71a8('0x14')](function(_0x448585){logger[_0x71a8('0x11')](_0x71a8('0xc'),_0x790787,_0x448585);_0x7478c0(_0x448585);});});} \ No newline at end of file +var _0x334a=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x15bb23,_0x5a9d53){var _0x385555=function(_0x3c4790){while(--_0x3c4790){_0x15bb23['push'](_0x15bb23['shift']());}};_0x385555(++_0x5a9d53);}(_0x334a,0x153));var _0xa334=function(_0x528036,_0x3fd182){_0x528036=_0x528036-0x0;var _0x4c83ea=_0x334a[_0x528036];return _0x4c83ea;};'use strict';var _=require(_0xa334('0x0'));var util=require(_0xa334('0x1'));var moment=require('moment');var BPromise=require(_0xa334('0x2'));var rs=require(_0xa334('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa334('0x4'))['db'];var utils=require(_0xa334('0x5'));var logger=require(_0xa334('0x6'))(_0xa334('0x7'));var config=require(_0xa334('0x8'));var jayson=require(_0xa334('0x9'));var client=jayson['client'][_0xa334('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26a914,_0x53ca01,_0x4edb86){return new BPromise(function(_0x1ba171,_0x496776){return client[_0xa334('0xb')](_0x26a914,_0x4edb86)[_0xa334('0xc')](function(_0x177800){logger[_0xa334('0xd')](_0xa334('0xe'),_0x53ca01,'request\x20sent');logger[_0xa334('0xf')](_0xa334('0x10'),_0x53ca01,_0xa334('0x11'),JSON[_0xa334('0x12')](_0x177800));if(_0x177800[_0xa334('0x13')]){if(_0x177800[_0xa334('0x13')][_0xa334('0x14')]===0x1f4){logger[_0xa334('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x53ca01,_0x177800[_0xa334('0x13')][_0xa334('0x15')]);return _0x496776(_0x177800[_0xa334('0x13')][_0xa334('0x15')]);}logger[_0xa334('0x13')](_0xa334('0xe'),_0x53ca01,_0x177800['error'][_0xa334('0x15')]);return _0x1ba171(_0x177800[_0xa334('0x13')][_0xa334('0x15')]);}else{logger['info'](_0xa334('0xe'),_0x53ca01,'request\x20sent');_0x1ba171(_0x177800[_0xa334('0x16')][_0xa334('0x15')]);}})[_0xa334('0x17')](function(_0x498703){logger[_0xa334('0x13')](_0xa334('0xe'),_0x53ca01,_0x498703);_0x496776(_0x498703);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 04ea602..a63095d 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 _0x6347=['INTEGER','exports'];(function(_0x3fb8c7,_0x4bf727){var _0x3e3559=function(_0x20aba1){while(--_0x20aba1){_0x3fb8c7['push'](_0x3fb8c7['shift']());}};_0x3e3559(++_0x4bf727);}(_0x6347,0x151));var _0x7634=function(_0x243f5b,_0x4bb734){_0x243f5b=_0x243f5b-0x0;var _0x6ca0eb=_0x6347[_0x243f5b];return _0x6ca0eb;};'use strict';var Sequelize=require('sequelize');module[_0x7634('0x0')]={'UserId':{'type':Sequelize[_0x7634('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x7634('0x1')]}}; \ No newline at end of file +var _0x986f=['INTEGER','sequelize','exports'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0x986f,0x1cc));var _0xf986=function(_0x52dd31,_0x40973b){_0x52dd31=_0x52dd31-0x0;var _0x4720b2=_0x986f[_0x52dd31];return _0x4720b2;};'use strict';var Sequelize=require(_0xf986('0x0'));module[_0xf986('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xf986('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 5cb31f4..c3c7b01 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(_0xf6ab47,_0x2f4cbf){var _0xc8c9ec=function(_0x295598){while(--_0x295598){_0xf6ab47['push'](_0xf6ab47['shift']());}};_0xc8c9ec(++_0x2f4cbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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(_0x56cdee,_0x42193e){var _0x1cf9eb=function(_0x2bfa80){while(--_0x2bfa80){_0x56cdee['push'](_0x56cdee['shift']());}};_0x1cf9eb(++_0x42193e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 8063790..d121062 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5f23f2,_0x476d21){var _0x4332d3=function(_0x58f341){while(--_0x58f341){_0x5f23f2['push'](_0x5f23f2['shift']());}};_0x4332d3(++_0x476d21);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xeb3c25,_0x2f3991){var _0x1b1614=function(_0x1497e5){while(--_0x1497e5){_0xeb3c25['push'](_0xeb3c25['shift']());}};_0x1b1614(++_0x2f3991);}(_0x70e0,0x17b));var _0x070e=function(_0x2cec58,_0x204296){_0x2cec58=_0x2cec58-0x0;var _0x4f500a=_0x70e0[_0x2cec58];return _0x4f500a;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index a223274..4200e58 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 _0xfdd8=['sequelize'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xfdd8,0x169));var _0x8fdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfdd8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8fdd('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8457=['INTEGER','sequelize','exports'];(function(_0x61bb05,_0x47421f){var _0x3ceb3e=function(_0x54b8f7){while(--_0x54b8f7){_0x61bb05['push'](_0x61bb05['shift']());}};_0x3ceb3e(++_0x47421f);}(_0x8457,0x142));var _0x7845=function(_0x4e7a69,_0x5250c0){_0x4e7a69=_0x4e7a69-0x0;var _0x2efbaf=_0x8457[_0x4e7a69];return _0x2efbaf;};'use strict';var Sequelize=require(_0x7845('0x0'));module[_0x7845('0x1')]={'penalty':{'type':Sequelize[_0x7845('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index cb260ec..54fc99b 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 _0x08c7=['exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','api','bluebird','request-promise','path','../../config/environment','./userVoiceQueue.attributes'];(function(_0x3a9707,_0x3d19c8){var _0x2fb6aa=function(_0x51947b){while(--_0x51947b){_0x3a9707['push'](_0x3a9707['shift']());}};_0x2fb6aa(++_0x3d19c8);}(_0x08c7,0x1e4));var _0x708c=function(_0x1ca218,_0x5d41e0){_0x1ca218=_0x1ca218-0x0;var _0x6015e=_0x08c7[_0x1ca218];return _0x6015e;};'use strict';var _=require(_0x708c('0x0'));var util=require(_0x708c('0x1'));var logger=require('../../config/logger')(_0x708c('0x2'));var moment=require('moment');var BPromise=require(_0x708c('0x3'));var rp=require(_0x708c('0x4'));var fs=require('fs');var path=require(_0x708c('0x5'));var rimraf=require('rimraf');var config=require(_0x708c('0x6'));var attributes=require(_0x708c('0x7'));module[_0x708c('0x8')]=function(_0x5415c0,_0x4902ec){return _0x5415c0[_0x708c('0x9')](_0x708c('0xa'),attributes,{'tableName':_0x708c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb42=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues','lodash'];(function(_0x542a4e,_0x23f7ef){var _0x11d75d=function(_0x12c1c7){while(--_0x12c1c7){_0x542a4e['push'](_0x542a4e['shift']());}};_0x11d75d(++_0x23f7ef);}(_0xdb42,0x1b1));var _0x2db4=function(_0x206f54,_0x442f00){_0x206f54=_0x206f54-0x0;var _0x1b6be4=_0xdb42[_0x206f54];return _0x1b6be4;};'use strict';var _=require(_0x2db4('0x0'));var util=require(_0x2db4('0x1'));var logger=require(_0x2db4('0x2'))(_0x2db4('0x3'));var moment=require(_0x2db4('0x4'));var BPromise=require(_0x2db4('0x5'));var rp=require(_0x2db4('0x6'));var fs=require('fs');var path=require(_0x2db4('0x7'));var rimraf=require(_0x2db4('0x8'));var config=require(_0x2db4('0x9'));var attributes=require(_0x2db4('0xa'));module[_0x2db4('0xb')]=function(_0x18ce5a,_0x15e6c1){return _0x18ce5a[_0x2db4('0xc')]('UserVoiceQueue',attributes,{'tableName':_0x2db4('0xd'),'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 ea09710..ba6e215 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 _0x1cc5=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','UserVoiceQueue,\x20%s,\x20%s','message','result','catch'];(function(_0x4d3e97,_0x749913){var _0x3147d7=function(_0x250599){while(--_0x250599){_0x4d3e97['push'](_0x4d3e97['shift']());}};_0x3147d7(++_0x749913);}(_0x1cc5,0x85));var _0x51cc=function(_0x414b44,_0x3b95a0){_0x414b44=_0x414b44-0x0;var _0x32fa6b=_0x1cc5[_0x414b44];return _0x32fa6b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51cc('0x0'));var BPromise=require(_0x51cc('0x1'));var rs=require(_0x51cc('0x2'));var fs=require('fs');var Redis=require(_0x51cc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x51cc('0x4'))(_0x51cc('0x5'));var config=require(_0x51cc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x51cc('0x7')][_0x51cc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39638a,_0x283948,_0x55f92f){return new BPromise(function(_0x3ae61b,_0x596408){return client[_0x51cc('0x9')](_0x39638a,_0x55f92f)['then'](function(_0x5f0c26){logger[_0x51cc('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x283948,_0x51cc('0xb'));logger[_0x51cc('0xc')](_0x51cc('0xd'),_0x283948,'request\x20sent',JSON['stringify'](_0x5f0c26));if(_0x5f0c26[_0x51cc('0xe')]){if(_0x5f0c26['error']['code']===0x1f4){logger[_0x51cc('0xe')](_0x51cc('0xf'),_0x283948,_0x5f0c26[_0x51cc('0xe')][_0x51cc('0x10')]);return _0x596408(_0x5f0c26['error'][_0x51cc('0x10')]);}logger['error'](_0x51cc('0xf'),_0x283948,_0x5f0c26['error'][_0x51cc('0x10')]);return _0x3ae61b(_0x5f0c26[_0x51cc('0xe')][_0x51cc('0x10')]);}else{logger[_0x51cc('0xa')](_0x51cc('0xf'),_0x283948,_0x51cc('0xb'));_0x3ae61b(_0x5f0c26[_0x51cc('0x11')][_0x51cc('0x10')]);}})[_0x51cc('0x12')](function(_0x4f1f17){logger[_0x51cc('0xe')](_0x51cc('0xf'),_0x283948,_0x4f1f17);_0x596408(_0x4f1f17);});});} \ No newline at end of file +var _0x1aee=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5445cb,_0x1a3460){var _0x16a23b=function(_0x237b26){while(--_0x237b26){_0x5445cb['push'](_0x5445cb['shift']());}};_0x16a23b(++_0x1a3460);}(_0x1aee,0x1e9));var _0xe1ae=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x1aee[_0x191154];return _0x3dcd73;};'use strict';var _=require(_0xe1ae('0x0'));var util=require(_0xe1ae('0x1'));var moment=require(_0xe1ae('0x2'));var BPromise=require(_0xe1ae('0x3'));var rs=require(_0xe1ae('0x4'));var fs=require('fs');var Redis=require(_0xe1ae('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe1ae('0x6'));var logger=require(_0xe1ae('0x7'))(_0xe1ae('0x8'));var config=require(_0xe1ae('0x9'));var jayson=require(_0xe1ae('0xa'));var client=jayson['client'][_0xe1ae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x455fa1,_0x122460,_0x3e3431){return new BPromise(function(_0x3d3333,_0x240609){return client[_0xe1ae('0xc')](_0x455fa1,_0x3e3431)[_0xe1ae('0xd')](function(_0x12f741){logger['info'](_0xe1ae('0xe'),_0x122460,_0xe1ae('0xf'));logger[_0xe1ae('0x10')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x122460,'request\x20sent',JSON[_0xe1ae('0x11')](_0x12f741));if(_0x12f741[_0xe1ae('0x12')]){if(_0x12f741['error']['code']===0x1f4){logger[_0xe1ae('0x12')](_0xe1ae('0xe'),_0x122460,_0x12f741[_0xe1ae('0x12')][_0xe1ae('0x13')]);return _0x240609(_0x12f741[_0xe1ae('0x12')]['message']);}logger[_0xe1ae('0x12')](_0xe1ae('0xe'),_0x122460,_0x12f741[_0xe1ae('0x12')][_0xe1ae('0x13')]);return _0x3d3333(_0x12f741[_0xe1ae('0x12')][_0xe1ae('0x13')]);}else{logger[_0xe1ae('0x14')](_0xe1ae('0xe'),_0x122460,_0xe1ae('0xf'));_0x3d3333(_0x12f741[_0xe1ae('0x15')][_0xe1ae('0x13')]);}})[_0xe1ae('0x16')](function(_0x580198){logger[_0xe1ae('0x12')](_0xe1ae('0xe'),_0x122460,_0x580198);_0x240609(_0x580198);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 645761d..35064a1 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1fc760,_0xa2d2d0){var _0x584022=function(_0x3d1a5e){while(--_0x3d1a5e){_0x1fc760['push'](_0x1fc760['shift']());}};_0x584022(++_0xa2d2d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x19f457,_0x46d202){var _0x482bfc=function(_0x5925d9){while(--_0x5925d9){_0x19f457['push'](_0x19f457['shift']());}};_0x482bfc(++_0x46d202);}(_0x70e0,0x17b));var _0x070e=function(_0x53a90f,_0x572706){_0x53a90f=_0x53a90f-0x0;var _0x30241a=_0x70e0[_0x53a90f];return _0x30241a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 1c271bd..fbe7d0f 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 _0xf784=['queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x5abdfc,_0x385c27){var _0x124657=function(_0x667dde){while(--_0x667dde){_0x5abdfc['push'](_0x5abdfc['shift']());}};_0x124657(++_0x385c27);}(_0xf784,0x1b9));var _0x4f78=function(_0x141699,_0x3cf999){_0x141699=_0x141699-0x0;var _0x478205=_0xf784[_0x141699];return _0x478205;};'use strict';var Sequelize=require(_0x4f78('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4f78('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x4f78('0x2')},'membername':{'type':Sequelize[_0x4f78('0x3')],'allowNull':![],'comment':_0x4f78('0x2')},'UserId':{'type':Sequelize[_0x4f78('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4f78('0x3')],'allowNull':![],'unique':_0x4f78('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x4f78('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4f78('0x4'),'comment':_0x4f78('0x2')},'penalty':{'type':Sequelize[_0x4f78('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x4f78('0x1')](0xb),'defaultValue':0x0,'comment':_0x4f78('0x2')}}; \ No newline at end of file +var _0x8c38=['queue_interface','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x108f7e,_0x34c1a4){var _0x490f26=function(_0x4dc84e){while(--_0x4dc84e){_0x108f7e['push'](_0x108f7e['shift']());}};_0x490f26(++_0x34c1a4);}(_0x8c38,0x105));var _0x88c3=function(_0x3a4733,_0x6344e3){_0x3a4733=_0x3a4733-0x0;var _0x46c86e=_0x8c38[_0x3a4733];return _0x46c86e;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x88c3('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x88c3('0x1')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x88c3('0x1')},'UserId':{'type':Sequelize[_0x88c3('0x0')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x88c3('0x2')],'allowNull':![],'unique':_0x88c3('0x3'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x88c3('0x0')],'allowNull':![]},'interface':{'type':Sequelize[_0x88c3('0x2')],'allowNull':![],'unique':_0x88c3('0x3'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x88c3('0x0')](0xb),'defaultValue':0x0,'comment':_0x88c3('0x1')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x88c3('0x1')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 4331427..e9ba0c8 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 _0xd3cb=['../../mysqldb','UserVoiceQueueRt','save','emit','hasOwnProperty','exports','events'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd3cb,0x1a3));var _0xbd3c=function(_0x5e0e3e,_0x124cab){_0x5e0e3e=_0x5e0e3e-0x0;var _0x15c697=_0xd3cb[_0x5e0e3e];return _0x15c697;};'use strict';var EventEmitter=require(_0xbd3c('0x0'));var UserVoiceQueueRt=require(_0xbd3c('0x1'))['db'][_0xbd3c('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbd3c('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xf1cdb9){return function(_0x5c2401,_0x34d3d5,_0x1334b7){UserVoiceQueueRtEvents[_0xbd3c('0x4')](_0xf1cdb9+':'+_0x5c2401['id'],_0x5c2401);UserVoiceQueueRtEvents[_0xbd3c('0x4')](_0xf1cdb9,_0x5c2401);_0x1334b7(null);};}for(var e in events){if(events[_0xbd3c('0x5')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xbd3c('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xa3b3=['emit','hasOwnProperty','hook','exports','setMaxListeners','save','update','remove'];(function(_0x181e12,_0x96dfed){var _0x1644af=function(_0x435f35){while(--_0x435f35){_0x181e12['push'](_0x181e12['shift']());}};_0x1644af(++_0x96dfed);}(_0xa3b3,0x7c));var _0x3a3b=function(_0x467a1a,_0x366d45){_0x467a1a=_0x467a1a-0x0;var _0x66ca13=_0xa3b3[_0x467a1a];return _0x66ca13;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3a3b('0x0')](0x0);var events={'afterCreate':_0x3a3b('0x1'),'afterUpdate':_0x3a3b('0x2'),'afterDestroy':_0x3a3b('0x3')};function emitEvent(_0x3eb0a5){return function(_0x4c3904,_0x333546,_0x62b7a1){UserVoiceQueueRtEvents['emit'](_0x3eb0a5+':'+_0x4c3904['id'],_0x4c3904);UserVoiceQueueRtEvents[_0x3a3b('0x4')](_0x3eb0a5,_0x4c3904);_0x62b7a1(null);};}for(var e in events){if(events[_0x3a3b('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x3a3b('0x6')](e,emitEvent(event));}}module[_0x3a3b('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 7823459..fcd08bb 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 _0xab1a=['define','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x31038b,_0x3ac1c9){var _0x1c9d3c=function(_0xe00e97){while(--_0xe00e97){_0x31038b['push'](_0x31038b['shift']());}};_0x1c9d3c(++_0x3ac1c9);}(_0xab1a,0x121));var _0xaab1=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0xab1a[_0x3cc9d9];return _0x1a425d;};'use strict';var _=require('lodash');var util=require(_0xaab1('0x0'));var logger=require(_0xaab1('0x1'))(_0xaab1('0x2'));var moment=require(_0xaab1('0x3'));var BPromise=require('bluebird');var rp=require(_0xaab1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaab1('0x5'));var config=require(_0xaab1('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xaab1('0x7')]=function(_0xcf6e75,_0x8cae94){return _0xcf6e75[_0xaab1('0x8')](_0xaab1('0x9'),attributes,{'tableName':_0xaab1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d5f=['path','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','lodash','../../config/logger','api','bluebird'];(function(_0x3dabe3,_0x4ea9a5){var _0x2a03e4=function(_0x3164ae){while(--_0x3164ae){_0x3dabe3['push'](_0x3dabe3['shift']());}};_0x2a03e4(++_0x4ea9a5);}(_0x9d5f,0x18c));var _0xf9d5=function(_0x52f59c,_0x5ae957){_0x52f59c=_0x52f59c-0x0;var _0x465932=_0x9d5f[_0x52f59c];return _0x465932;};'use strict';var _=require(_0xf9d5('0x0'));var util=require('util');var logger=require(_0xf9d5('0x1'))(_0xf9d5('0x2'));var moment=require('moment');var BPromise=require(_0xf9d5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf9d5('0x4'));var rimraf=require(_0xf9d5('0x5'));var config=require(_0xf9d5('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xf9d5('0x7')]=function(_0x2809da,_0x1b04b2){return _0x2809da[_0xf9d5('0x8')](_0xf9d5('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 0055c70..e73167f 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 _0x965a=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','randomstring'];(function(_0x19ce60,_0x1b9af7){var _0x36fc7b=function(_0x3e34f5){while(--_0x3e34f5){_0x19ce60['push'](_0x19ce60['shift']());}};_0x36fc7b(++_0x1b9af7);}(_0x965a,0x1a9));var _0xa965=function(_0x44de29,_0x50d793){_0x44de29=_0x44de29-0x0;var _0x9393f6=_0x965a[_0x44de29];return _0x9393f6;};'use strict';var _=require(_0xa965('0x0'));var util=require('util');var moment=require(_0xa965('0x1'));var BPromise=require(_0xa965('0x2'));var rs=require(_0xa965('0x3'));var fs=require('fs');var Redis=require(_0xa965('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa965('0x5'));var logger=require(_0xa965('0x6'))(_0xa965('0x7'));var config=require(_0xa965('0x8'));var jayson=require(_0xa965('0x9'));var client=jayson[_0xa965('0xa')]['http']({'port':0x232a});config[_0xa965('0xb')]=_[_0xa965('0xc')](config[_0xa965('0xb')],{'host':_0xa965('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa965('0xb')]));require(_0xa965('0xe'))[_0xa965('0xf')](socket);function respondWithRpcPromise(_0x4ff322,_0xee3f50,_0x2f520a){return new BPromise(function(_0x1b57ea,_0x508039){return client[_0xa965('0x10')](_0x4ff322,_0x2f520a)[_0xa965('0x11')](function(_0x19dd5c){logger[_0xa965('0x12')](_0xa965('0x13'),_0xee3f50,_0xa965('0x14'));logger[_0xa965('0x15')](_0xa965('0x16'),_0xee3f50,_0xa965('0x14'),JSON['stringify'](_0x19dd5c));if(_0x19dd5c[_0xa965('0x17')]){if(_0x19dd5c[_0xa965('0x17')][_0xa965('0x18')]===0x1f4){logger['error'](_0xa965('0x13'),_0xee3f50,_0x19dd5c[_0xa965('0x17')]['message']);return _0x508039(_0x19dd5c[_0xa965('0x17')][_0xa965('0x19')]);}logger[_0xa965('0x17')](_0xa965('0x13'),_0xee3f50,_0x19dd5c[_0xa965('0x17')][_0xa965('0x19')]);return _0x1b57ea(_0x19dd5c[_0xa965('0x17')]['message']);}else{logger[_0xa965('0x12')](_0xa965('0x13'),_0xee3f50,_0xa965('0x14'));_0x1b57ea(_0x19dd5c[_0xa965('0x1a')][_0xa965('0x19')]);}})[_0xa965('0x1b')](function(_0x4ba918){logger[_0xa965('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xee3f50,_0x4ba918);_0x508039(_0x4ba918);});});}exports[_0xa965('0x1c')]=function(_0x26f118){var _0x269730=this;return new Promise(function(_0x10127a,_0x287ad4){return db[_0xa965('0x1d')][_0xa965('0x1e')]({'raw':_0x26f118[_0xa965('0x1f')]?_0x26f118[_0xa965('0x1f')][_0xa965('0x20')]===undefined?!![]:![]:!![],'where':_0x26f118[_0xa965('0x1f')]?_0x26f118['options'][_0xa965('0x21')]||null:null,'attributes':[[db[_0xa965('0x22')]['fn'](_0xa965('0x23'),db['sequelize']['fn']('IF',db[_0xa965('0x22')][_0xa965('0x24')](_0xa965('0x25')))),_0xa965('0x26')]]})[_0xa965('0x11')](function(_0x4b6a1b){logger[_0xa965('0x12')]('GetVoiceQueueRtPauses',_0x26f118);logger[_0xa965('0x15')]('GetVoiceQueueRtPauses',_0x26f118,JSON['stringify'](_0x4b6a1b));_0x10127a(_0x4b6a1b);})[_0xa965('0x1b')](function(_0x12c2c2){logger[_0xa965('0x17')](_0xa965('0x1c'),_0x12c2c2[_0xa965('0x19')],_0x26f118);_0x287ad4(_0x269730[_0xa965('0x17')](0x1f4,_0x12c2c2[_0xa965('0x19')]));});});}; \ No newline at end of file +var _0x95a7=['redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UserVoiceQueueRt','findAll','options','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','GetVoiceQueueRtPauses','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0xeb1b7b,_0xf8231a){var _0x5458b9=function(_0xf8c907){while(--_0xf8c907){_0xeb1b7b['push'](_0xeb1b7b['shift']());}};_0x5458b9(++_0xf8231a);}(_0x95a7,0x17a));var _0x795a=function(_0x176765,_0x203ba2){_0x176765=_0x176765-0x0;var _0x5db122=_0x95a7[_0x176765];return _0x5db122;};'use strict';var _=require(_0x795a('0x0'));var util=require(_0x795a('0x1'));var moment=require(_0x795a('0x2'));var BPromise=require(_0x795a('0x3'));var rs=require(_0x795a('0x4'));var fs=require('fs');var Redis=require(_0x795a('0x5'));var db=require(_0x795a('0x6'))['db'];var utils=require(_0x795a('0x7'));var logger=require(_0x795a('0x8'))('rpc');var config=require(_0x795a('0x9'));var jayson=require(_0x795a('0xa'));var client=jayson[_0x795a('0xb')]['http']({'port':0x232a});config[_0x795a('0xc')]=_[_0x795a('0xd')](config[_0x795a('0xc')],{'host':_0x795a('0xe'),'port':0x18eb});var socket=require(_0x795a('0xf'))(new Redis(config[_0x795a('0xc')]));require(_0x795a('0x10'))[_0x795a('0x11')](socket);function respondWithRpcPromise(_0x578d30,_0x24553,_0x550d4c){return new BPromise(function(_0x1c1ecc,_0x4f620b){return client['request'](_0x578d30,_0x550d4c)['then'](function(_0x56f82f){logger[_0x795a('0x12')](_0x795a('0x13'),_0x24553,_0x795a('0x14'));logger['debug'](_0x795a('0x15'),_0x24553,_0x795a('0x14'),JSON[_0x795a('0x16')](_0x56f82f));if(_0x56f82f[_0x795a('0x17')]){if(_0x56f82f[_0x795a('0x17')][_0x795a('0x18')]===0x1f4){logger[_0x795a('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x24553,_0x56f82f[_0x795a('0x17')][_0x795a('0x19')]);return _0x4f620b(_0x56f82f[_0x795a('0x17')][_0x795a('0x19')]);}logger['error'](_0x795a('0x13'),_0x24553,_0x56f82f[_0x795a('0x17')]['message']);return _0x1c1ecc(_0x56f82f[_0x795a('0x17')][_0x795a('0x19')]);}else{logger[_0x795a('0x12')](_0x795a('0x13'),_0x24553,'request\x20sent');_0x1c1ecc(_0x56f82f[_0x795a('0x1a')][_0x795a('0x19')]);}})['catch'](function(_0x4e9caa){logger[_0x795a('0x17')](_0x795a('0x13'),_0x24553,_0x4e9caa);_0x4f620b(_0x4e9caa);});});}exports['GetVoiceQueueRtPauses']=function(_0x4b7f32){var _0x40ce6a=this;return new Promise(function(_0x385aab,_0x125b3e){return db[_0x795a('0x1b')][_0x795a('0x1c')]({'raw':_0x4b7f32[_0x795a('0x1d')]?_0x4b7f32[_0x795a('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4b7f32[_0x795a('0x1d')]?_0x4b7f32[_0x795a('0x1d')][_0x795a('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x795a('0x1f'),db[_0x795a('0x20')]['fn']('IF',db[_0x795a('0x20')][_0x795a('0x21')](_0x795a('0x22')))),_0x795a('0x23')]]})[_0x795a('0x24')](function(_0x1939d5){logger[_0x795a('0x12')](_0x795a('0x25'),_0x4b7f32);logger['debug'](_0x795a('0x25'),_0x4b7f32,JSON[_0x795a('0x16')](_0x1939d5));_0x385aab(_0x1939d5);})[_0x795a('0x26')](function(_0x5c70e7){logger[_0x795a('0x17')]('GetVoiceQueueRtPauses',_0x5c70e7[_0x795a('0x19')],_0x4b7f32);_0x125b3e(_0x40ce6a[_0x795a('0x17')](0x1f4,_0x5c70e7[_0x795a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 68c656d..9e02ab8 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 _0x1488=['./userVoiceQueueRt.events','remove','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x5d27d5,_0x2d6c07){var _0x19ad0e=function(_0x193175){while(--_0x193175){_0x5d27d5['push'](_0x5d27d5['shift']());}};_0x19ad0e(++_0x2d6c07);}(_0x1488,0x88));var _0x8148=function(_0x46a3ff,_0x470b9a){_0x46a3ff=_0x46a3ff-0x0;var _0x404bc2=_0x1488[_0x46a3ff];return _0x404bc2;};'use strict';var UserVoiceQueueRtEvents=require(_0x8148('0x0'));var events=['save',_0x8148('0x1'),_0x8148('0x2')];function createListener(_0x22606a,_0x5cc7ef){return function(_0x508e80){_0x5cc7ef[_0x8148('0x3')](_0x22606a,_0x508e80);};}function removeListener(_0x5b1a48,_0x32d78){return function(){UserVoiceQueueRtEvents[_0x8148('0x4')](_0x5b1a48,_0x32d78);};}exports[_0x8148('0x5')]=function(_0x153009){for(var _0x173d87=0x0,_0x2ac35d=events[_0x8148('0x6')];_0x173d87<_0x2ac35d;_0x173d87++){var _0x1254e9=events[_0x173d87];var _0x4fb6b4=createListener(_0x8148('0x7')+_0x1254e9,_0x153009);UserVoiceQueueRtEvents['on'](_0x1254e9,_0x4fb6b4);}}; \ No newline at end of file +var _0x869e=['remove','emit','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x5998c7,_0x514254){var _0x321421=function(_0x2f0987){while(--_0x2f0987){_0x5998c7['push'](_0x5998c7['shift']());}};_0x321421(++_0x514254);}(_0x869e,0x15c));var _0xe869=function(_0x1c3fec,_0x3e8006){_0x1c3fec=_0x1c3fec-0x0;var _0x5a6b7b=_0x869e[_0x1c3fec];return _0x5a6b7b;};'use strict';var UserVoiceQueueRtEvents=require(_0xe869('0x0'));var events=[_0xe869('0x1'),_0xe869('0x2'),'update'];function createListener(_0x1984e4,_0x14dd86){return function(_0xb2e42a){_0x14dd86[_0xe869('0x3')](_0x1984e4,_0xb2e42a);};}function removeListener(_0x39fee6,_0x597771){return function(){UserVoiceQueueRtEvents[_0xe869('0x4')](_0x39fee6,_0x597771);};}exports[_0xe869('0x5')]=function(_0x26a223){for(var _0x26afde=0x0,_0x587ead=events['length'];_0x26afde<_0x587ead;_0x26afde++){var _0xb3936=events[_0x26afde];var _0x296feb=createListener(_0xe869('0x6')+_0xb3936,_0x26a223);UserVoiceQueueRtEvents['on'](_0xb3936,_0x296feb);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 1ece9c5..691d38a 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x541cd2,_0x11ff2b){var _0x2756fe=function(_0x2b521e){while(--_0x2b521e){_0x541cd2['push'](_0x541cd2['shift']());}};_0x2756fe(++_0x11ff2b);}(_0x70e0,0x17b));var _0x070e=function(_0x446a30,_0x417153){_0x446a30=_0x446a30-0x0;var _0x3470ab=_0x70e0[_0x446a30];return _0x3470ab;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2d4ba9,_0x14314c){var _0x168d72=function(_0x472ae2){while(--_0x472ae2){_0x2d4ba9['push'](_0x2d4ba9['shift']());}};_0x168d72(++_0x14314c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index e93bfc9..c6d5125 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 _0x6138=['exports','INTEGER'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x6138,0xbe));var _0x8613=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x6138[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require('sequelize');module[_0x8613('0x0')]={'penalty':{'type':Sequelize[_0x8613('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb50e=['sequelize'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xb50e,0xc6));var _0xeb50=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0xb50e[_0xd22d95];return _0x15d7a3;};'use strict';var Sequelize=require(_0xeb50('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'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 7faea4e..6a78f55 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 _0x8a11=['exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes'];(function(_0x59e8ab,_0x5333ce){var _0x22d0f6=function(_0x3126e1){while(--_0x3126e1){_0x59e8ab['push'](_0x59e8ab['shift']());}};_0x22d0f6(++_0x5333ce);}(_0x8a11,0x19a));var _0x18a1=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x8a11[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x18a1('0x0'));var util=require('util');var logger=require(_0x18a1('0x1'))(_0x18a1('0x2'));var moment=require(_0x18a1('0x3'));var BPromise=require(_0x18a1('0x4'));var rp=require(_0x18a1('0x5'));var fs=require('fs');var path=require(_0x18a1('0x6'));var rimraf=require(_0x18a1('0x7'));var config=require(_0x18a1('0x8'));var attributes=require(_0x18a1('0x9'));module[_0x18a1('0xa')]=function(_0x6eb14e,_0x356253){return _0x6eb14e[_0x18a1('0xb')](_0x18a1('0xc'),attributes,{'tableName':_0x18a1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd86e=['UserWhatsappQueue','user_has_whatsapp_queues','util','api','moment','bluebird','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define'];(function(_0x152563,_0x320b3e){var _0x4c9c55=function(_0x19a857){while(--_0x19a857){_0x152563['push'](_0x152563['shift']());}};_0x4c9c55(++_0x320b3e);}(_0xd86e,0x1ee));var _0xed86=function(_0x2d7e09,_0x16be83){_0x2d7e09=_0x2d7e09-0x0;var _0x1ba707=_0xd86e[_0x2d7e09];return _0x1ba707;};'use strict';var _=require('lodash');var util=require(_0xed86('0x0'));var logger=require('../../config/logger')(_0xed86('0x1'));var moment=require(_0xed86('0x2'));var BPromise=require(_0xed86('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed86('0x4'));var rimraf=require(_0xed86('0x5'));var config=require(_0xed86('0x6'));var attributes=require(_0xed86('0x7'));module[_0xed86('0x8')]=function(_0x126d93,_0x546693){return _0x126d93[_0xed86('0x9')](_0xed86('0xa'),attributes,{'tableName':_0xed86('0xb'),'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 4ebcfde..bc5a1c0 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 _0x8b7f=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x24f99a,_0x2ed010){var _0x4ee072=function(_0x16d4b5){while(--_0x16d4b5){_0x24f99a['push'](_0x24f99a['shift']());}};_0x4ee072(++_0x2ed010);}(_0x8b7f,0x156));var _0xf8b7=function(_0x4047fd,_0x4521d2){_0x4047fd=_0x4047fd-0x0;var _0x26458b=_0x8b7f[_0x4047fd];return _0x26458b;};'use strict';var _=require(_0xf8b7('0x0'));var util=require(_0xf8b7('0x1'));var moment=require(_0xf8b7('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8b7('0x3'));var fs=require('fs');var Redis=require(_0xf8b7('0x4'));var db=require(_0xf8b7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8b7('0x6'))(_0xf8b7('0x7'));var config=require(_0xf8b7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf8b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d0703,_0x3b7051,_0x42beb2){return new BPromise(function(_0xd3342,_0x34b170){return client[_0xf8b7('0xa')](_0x1d0703,_0x42beb2)['then'](function(_0x86c6a0){logger[_0xf8b7('0xb')](_0xf8b7('0xc'),_0x3b7051,_0xf8b7('0xd'));logger['debug'](_0xf8b7('0xe'),_0x3b7051,'request\x20sent',JSON[_0xf8b7('0xf')](_0x86c6a0));if(_0x86c6a0[_0xf8b7('0x10')]){if(_0x86c6a0['error'][_0xf8b7('0x11')]===0x1f4){logger[_0xf8b7('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3b7051,_0x86c6a0['error']['message']);return _0x34b170(_0x86c6a0[_0xf8b7('0x10')][_0xf8b7('0x12')]);}logger[_0xf8b7('0x10')](_0xf8b7('0xc'),_0x3b7051,_0x86c6a0['error'][_0xf8b7('0x12')]);return _0xd3342(_0x86c6a0['error']['message']);}else{logger[_0xf8b7('0xb')](_0xf8b7('0xc'),_0x3b7051,_0xf8b7('0xd'));_0xd3342(_0x86c6a0[_0xf8b7('0x13')][_0xf8b7('0x12')]);}})[_0xf8b7('0x14')](function(_0xb87888){logger[_0xf8b7('0x10')](_0xf8b7('0xc'),_0x3b7051,_0xb87888);_0x34b170(_0xb87888);});});} \ No newline at end of file +var _0xbd20=['request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x58fe86,_0x19655f){var _0x3f0732=function(_0x1d0b4a){while(--_0x1d0b4a){_0x58fe86['push'](_0x58fe86['shift']());}};_0x3f0732(++_0x19655f);}(_0xbd20,0xc4));var _0x0bd2=function(_0x21a2b3,_0x5d6564){_0x21a2b3=_0x21a2b3-0x0;var _0x4651a7=_0xbd20[_0x21a2b3];return _0x4651a7;};'use strict';var _=require(_0x0bd2('0x0'));var util=require(_0x0bd2('0x1'));var moment=require('moment');var BPromise=require(_0x0bd2('0x2'));var rs=require(_0x0bd2('0x3'));var fs=require('fs');var Redis=require(_0x0bd2('0x4'));var db=require(_0x0bd2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0bd2('0x6'))(_0x0bd2('0x7'));var config=require(_0x0bd2('0x8'));var jayson=require(_0x0bd2('0x9'));var client=jayson[_0x0bd2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2131b2,_0x2e10d7,_0x554f99){return new BPromise(function(_0xe8e85f,_0x3e2ecd){return client[_0x0bd2('0xb')](_0x2131b2,_0x554f99)[_0x0bd2('0xc')](function(_0x2dca95){logger[_0x0bd2('0xd')](_0x0bd2('0xe'),_0x2e10d7,_0x0bd2('0xf'));logger['debug'](_0x0bd2('0x10'),_0x2e10d7,_0x0bd2('0xf'),JSON[_0x0bd2('0x11')](_0x2dca95));if(_0x2dca95[_0x0bd2('0x12')]){if(_0x2dca95['error'][_0x0bd2('0x13')]===0x1f4){logger[_0x0bd2('0x12')](_0x0bd2('0xe'),_0x2e10d7,_0x2dca95[_0x0bd2('0x12')][_0x0bd2('0x14')]);return _0x3e2ecd(_0x2dca95[_0x0bd2('0x12')][_0x0bd2('0x14')]);}logger[_0x0bd2('0x12')](_0x0bd2('0xe'),_0x2e10d7,_0x2dca95[_0x0bd2('0x12')]['message']);return _0xe8e85f(_0x2dca95['error']['message']);}else{logger['info'](_0x0bd2('0xe'),_0x2e10d7,_0x0bd2('0xf'));_0xe8e85f(_0x2dca95[_0x0bd2('0x15')][_0x0bd2('0x14')]);}})[_0x0bd2('0x16')](function(_0x57b551){logger[_0x0bd2('0x12')](_0x0bd2('0xe'),_0x2e10d7,_0x57b551);_0x3e2ecd(_0x57b551);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 9033ff4..42fd8c8 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 _0x55d2=['../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','post','update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x55d2,0x9f));var _0x255d=function(_0x1b3f44,_0x5cdb98){_0x1b3f44=_0x1b3f44-0x0;var _0xb6ff18=_0x55d2[_0x1b3f44];return _0xb6ff18;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x255d('0x0'));var timeout=require(_0x255d('0x1'));var express=require(_0x255d('0x2'));var router=express[_0x255d('0x3')]();var fs_extra=require(_0x255d('0x4'));var auth=require(_0x255d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x255d('0x6'));var controller=require(_0x255d('0x7'));router[_0x255d('0x8')]('/',auth[_0x255d('0x9')](),controller['index']);router['get'](_0x255d('0xa'),auth[_0x255d('0x9')](),controller[_0x255d('0xb')]);router[_0x255d('0xc')]('/',auth[_0x255d('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x255d('0xd')]);router['delete'](_0x255d('0xa'),auth[_0x255d('0x9')](),controller[_0x255d('0xe')]);module['exports']=router; \ No newline at end of file +var _0x202c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0xf482c1,_0x32cbca){var _0x184548=function(_0x2f8086){while(--_0x2f8086){_0xf482c1['push'](_0xf482c1['shift']());}};_0x184548(++_0x32cbca);}(_0x202c,0x178));var _0xc202=function(_0x416ca3,_0x22ed17){_0x416ca3=_0x416ca3-0x0;var _0x894f17=_0x202c[_0x416ca3];return _0x894f17;};'use strict';var multer=require(_0xc202('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc202('0x1'));var express=require(_0xc202('0x2'));var router=express[_0xc202('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc202('0x4'));var interaction=require(_0xc202('0x5'));var config=require(_0xc202('0x6'));var controller=require(_0xc202('0x7'));router['get']('/',auth[_0xc202('0x8')](),controller[_0xc202('0x9')]);router['get'](_0xc202('0xa'),auth['isAuthenticated'](),controller[_0xc202('0xb')]);router[_0xc202('0xc')]('/',auth[_0xc202('0x8')](),controller[_0xc202('0xd')]);router[_0xc202('0xe')](_0xc202('0xa'),auth[_0xc202('0x8')](),controller[_0xc202('0xf')]);router[_0xc202('0x10')](_0xc202('0xa'),auth[_0xc202('0x8')](),controller[_0xc202('0x11')]);module[_0xc202('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 8f2451d..88b791b 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 _0x70c8=['STRING'];(function(_0x4a75e0,_0x220621){var _0x3f5c22=function(_0x282713){while(--_0x282713){_0x4a75e0['push'](_0x4a75e0['shift']());}};_0x3f5c22(++_0x220621);}(_0x70c8,0xa9));var _0x870c=function(_0x177be2,_0x19f40a){_0x177be2=_0x177be2-0x0;var _0x1de4a2=_0x70c8[_0x177be2];return _0x1de4a2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x870c('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x870c('0x0')]}}; \ No newline at end of file +var _0xed5a=['STRING','name','sequelize','exports'];(function(_0x56813d,_0x446e5e){var _0x1ed1da=function(_0x169360){while(--_0x169360){_0x56813d['push'](_0x56813d['shift']());}};_0x1ed1da(++_0x446e5e);}(_0xed5a,0xb6));var _0xaed5=function(_0x507403,_0x3f954d){_0x507403=_0x507403-0x0;var _0x1327c=_0xed5a[_0x507403];return _0x1327c;};'use strict';var Sequelize=require(_0xaed5('0x0'));module[_0xaed5('0x1')]={'name':{'type':Sequelize[_0xaed5('0x2')],'unique':_0xaed5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xaed5('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 7ccc228..3c23d19 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 _0xb03a=['body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','Variables','UserProfileResource','error','name','send','index','map','Variable','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','catch','show','params','create','user','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xb03a,0xef));var _0xab03=function(_0x43551a,_0x2c6ae4){_0x43551a=_0x43551a-0x0;var _0x1a79b1=_0xb03a[_0x43551a];return _0x1a79b1;};'use strict';var emlformat=require(_0xab03('0x0'));var rimraf=require(_0xab03('0x1'));var zipdir=require(_0xab03('0x2'));var jsonpatch=require(_0xab03('0x3'));var rp=require(_0xab03('0x4'));var moment=require(_0xab03('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xab03('0x6'));var util=require('util');var path=require('path');var sox=require(_0xab03('0x7'));var csv=require('to-csv');var ejs=require(_0xab03('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab03('0x9'));var squel=require(_0xab03('0xa'));var crypto=require(_0xab03('0xb'));var jsforce=require(_0xab03('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xab03('0xd'));var querystring=require(_0xab03('0xe'));var Papa=require(_0xab03('0xf'));var Redis=require('ioredis');var authService=require(_0xab03('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xab03('0x11'));var hardwareService=require(_0xab03('0x12'));var logger=require(_0xab03('0x13'))('api');var utils=require(_0xab03('0x14'));var config=require(_0xab03('0x15'));var licenseUtil=require(_0xab03('0x16'));var db=require(_0xab03('0x17'))['db'];function respondWithStatusCode(_0x1838a1,_0x4d818b){_0x4d818b=_0x4d818b||0xcc;return function(_0xc59c4f){if(_0xc59c4f){return _0x1838a1[_0xab03('0x18')](_0x4d818b);}return _0x1838a1['status'](_0x4d818b)[_0xab03('0x19')]();};}function respondWithResult(_0x551775,_0xbe9902){_0xbe9902=_0xbe9902||0xc8;return function(_0x73a09f){if(_0x73a09f){return _0x551775[_0xab03('0x1a')](_0xbe9902)[_0xab03('0x1b')](_0x73a09f);}};}function respondWithFilteredResult(_0x2ad314,_0x503f51){return function(_0x112114){if(_0x112114){var _0x4b3847=typeof _0x503f51[_0xab03('0x1c')]==='undefined'&&typeof _0x503f51[_0xab03('0x1d')]===_0xab03('0x1e');var _0x42d870=_0x112114[_0xab03('0x1f')];var _0x141404=_0x4b3847?0x0:_0x503f51['offset'];var _0x55a9a7=_0x4b3847?_0x112114['count']:_0x503f51[_0xab03('0x1c')]+_0x503f51[_0xab03('0x1d')];var _0x5bd04c;if(_0x55a9a7>=_0x42d870){_0x55a9a7=_0x42d870;_0x5bd04c=0xc8;}else{_0x5bd04c=0xce;}_0x2ad314[_0xab03('0x1a')](_0x5bd04c);return _0x2ad314[_0xab03('0x20')](_0xab03('0x21'),_0x141404+'-'+_0x55a9a7+'/'+_0x42d870)[_0xab03('0x1b')](_0x112114);}return null;};}function patchUpdates(_0x12027a){return function(_0x1f5585){try{jsonpatch[_0xab03('0x22')](_0x1f5585,_0x12027a,!![]);}catch(_0xfe6357){return BPromise['reject'](_0xfe6357);}return _0x1f5585[_0xab03('0x23')]();};}function saveUpdates(_0x1f3cf1,_0x4e636b){return function(_0x2efb74){if(_0x2efb74){return _0x2efb74['update'](_0x1f3cf1)[_0xab03('0x24')](function(_0x459c56){return _0x459c56;});}return null;};}function removeEntity(_0x4e3a92,_0x3b633f){return function(_0x2c9862){if(_0x2c9862){return _0x2c9862[_0xab03('0x25')]()[_0xab03('0x24')](function(){var _0x4e8c8c=_0x2c9862['get']({'plain':!![]});var _0x95dd3b=_0xab03('0x26');return db[_0xab03('0x27')][_0xab03('0x25')]({'where':{'type':_0x95dd3b,'resourceId':_0x4e8c8c['id']}})['then'](function(){return _0x2c9862;});})[_0xab03('0x24')](function(){_0x4e3a92['status'](0xcc)[_0xab03('0x19')]();});}};}function handleEntityNotFound(_0x3f8337,_0x221022){return function(_0x5955fb){if(!_0x5955fb){_0x3f8337[_0xab03('0x18')](0x194);}return _0x5955fb;};}function handleError(_0x410c82,_0x1079c3){_0x1079c3=_0x1079c3||0x1f4;return function(_0x4e4ef7){logger[_0xab03('0x28')](_0x4e4ef7['stack']);if(_0x4e4ef7[_0xab03('0x29')]){delete _0x4e4ef7[_0xab03('0x29')];}_0x410c82['status'](_0x1079c3)[_0xab03('0x2a')](_0x4e4ef7);};}exports[_0xab03('0x2b')]=function(_0x3e4a7b,_0x50d5d5){var _0x46dd8e={},_0x3b1d31={},_0x3e6657={'count':0x0,'rows':[]};var _0x249a94=_[_0xab03('0x2c')](db[_0xab03('0x2d')][_0xab03('0x2e')],function(_0x46ebea){return{'name':_0x46ebea[_0xab03('0x2f')],'type':_0x46ebea['type'][_0xab03('0x30')]};});_0x3b1d31[_0xab03('0x31')]=_['map'](_0x249a94,_0xab03('0x29'));_0x3b1d31[_0xab03('0x32')]=_[_0xab03('0x33')](_0x3e4a7b[_0xab03('0x32')]);_0x3b1d31[_0xab03('0x34')]=_[_0xab03('0x35')](_0x3b1d31[_0xab03('0x31')],_0x3b1d31[_0xab03('0x32')]);_0x46dd8e['attributes']=_[_0xab03('0x35')](_0x3b1d31[_0xab03('0x31')],qs[_0xab03('0x36')](_0x3e4a7b[_0xab03('0x32')][_0xab03('0x36')]));_0x46dd8e['attributes']=_0x46dd8e[_0xab03('0x37')][_0xab03('0x38')]?_0x46dd8e['attributes']:_0x3b1d31['model'];if(!_0x3e4a7b[_0xab03('0x32')][_0xab03('0x39')](_0xab03('0x3a'))){_0x46dd8e['limit']=qs[_0xab03('0x1d')](_0x3e4a7b[_0xab03('0x32')][_0xab03('0x1d')]);_0x46dd8e[_0xab03('0x1c')]=qs[_0xab03('0x1c')](_0x3e4a7b[_0xab03('0x32')][_0xab03('0x1c')]);}_0x46dd8e['order']=qs['sort'](_0x3e4a7b[_0xab03('0x32')][_0xab03('0x3b')]);_0x46dd8e[_0xab03('0x3c')]=qs[_0xab03('0x34')](_[_0xab03('0x3d')](_0x3e4a7b[_0xab03('0x32')],_0x3b1d31[_0xab03('0x34')]),_0x249a94);if(_0x3e4a7b[_0xab03('0x32')]['filter']){_0x46dd8e[_0xab03('0x3c')]=_['merge'](_0x46dd8e[_0xab03('0x3c')],{'$or':_['map'](_0x249a94,function(_0x20ee39){if(_0x20ee39[_0xab03('0x3e')]!==_0xab03('0x3f')){var _0x4e49f5={};_0x4e49f5[_0x20ee39[_0xab03('0x29')]]={'$like':'%'+_0x3e4a7b[_0xab03('0x32')][_0xab03('0x40')]+'%'};return _0x4e49f5;}})});}_0x46dd8e=_[_0xab03('0x41')]({},_0x46dd8e,_0x3e4a7b[_0xab03('0x42')]);var _0x6dadcf={'where':_0x46dd8e['where']};return db['Variable'][_0xab03('0x1f')](_0x6dadcf)[_0xab03('0x24')](function(_0x46624a){_0x3e6657[_0xab03('0x1f')]=_0x46624a;if(_0x3e4a7b['query'][_0xab03('0x43')]){_0x46dd8e['include']=[{'all':!![]}];}return db['Variable']['findAll'](_0x46dd8e);})[_0xab03('0x24')](function(_0x4ce850){_0x3e6657['rows']=_0x4ce850;return _0x3e6657;})[_0xab03('0x24')](respondWithFilteredResult(_0x50d5d5,_0x46dd8e))[_0xab03('0x44')](handleError(_0x50d5d5,null));};exports[_0xab03('0x45')]=function(_0x54e1a7,_0x30e5a0){var _0xa06d07={'raw':!![],'where':{'id':_0x54e1a7[_0xab03('0x46')]['id']}},_0x1d16b1={};_0x1d16b1[_0xab03('0x31')]=_[_0xab03('0x33')](db[_0xab03('0x2d')][_0xab03('0x2e')]);_0x1d16b1['query']=_['keys'](_0x54e1a7[_0xab03('0x32')]);_0x1d16b1[_0xab03('0x34')]=_[_0xab03('0x35')](_0x1d16b1['model'],_0x1d16b1[_0xab03('0x32')]);_0xa06d07[_0xab03('0x37')]=_['intersection'](_0x1d16b1['model'],qs['fields'](_0x54e1a7[_0xab03('0x32')]['fields']));_0xa06d07[_0xab03('0x37')]=_0xa06d07[_0xab03('0x37')]['length']?_0xa06d07[_0xab03('0x37')]:_0x1d16b1[_0xab03('0x31')];if(_0x54e1a7[_0xab03('0x32')][_0xab03('0x43')]){_0xa06d07['include']=[{'all':!![]}];}_0xa06d07=_['merge']({},_0xa06d07,_0x54e1a7[_0xab03('0x42')]);return db[_0xab03('0x2d')]['find'](_0xa06d07)[_0xab03('0x24')](handleEntityNotFound(_0x30e5a0,null))[_0xab03('0x24')](respondWithResult(_0x30e5a0,null))[_0xab03('0x44')](handleError(_0x30e5a0,null));};exports[_0xab03('0x47')]=function(_0x79325e,_0x58a59d){return db[_0xab03('0x2d')][_0xab03('0x47')](_0x79325e['body'],{})[_0xab03('0x24')](function(_0x3779b3){var _0x59c301=_0x79325e[_0xab03('0x48')][_0xab03('0x49')]({'plain':!![]});if(!_0x59c301)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59c301['role']===_0xab03('0x48')){var _0x15263e=_0x3779b3[_0xab03('0x49')]({'plain':!![]});var _0x35e528=_0xab03('0x26');return db[_0xab03('0x4a')]['find']({'where':{'name':_0x35e528,'userProfileId':_0x59c301['userProfileId']},'raw':!![]})['then'](function(_0x19e05c){if(_0x19e05c&&_0x19e05c['autoAssociation']===0x0){return db[_0xab03('0x27')][_0xab03('0x47')]({'name':_0x15263e[_0xab03('0x29')],'resourceId':_0x15263e['id'],'type':_0x19e05c['name'],'sectionId':_0x19e05c['id']},{})[_0xab03('0x24')](function(){return _0x3779b3;});}else{return _0x3779b3;}})[_0xab03('0x44')](function(_0x3eccd1){logger['error'](_0xab03('0x4b'),_0x3eccd1);throw _0x3eccd1;});}return _0x3779b3;})[_0xab03('0x24')](respondWithResult(_0x58a59d,0xc9))['catch'](handleError(_0x58a59d,null));};exports[_0xab03('0x4c')]=function(_0x453563,_0x186f6a){if(_0x453563[_0xab03('0x4d')]['id']){delete _0x453563[_0xab03('0x4d')]['id'];}return db[_0xab03('0x2d')][_0xab03('0x4e')]({'where':{'id':_0x453563[_0xab03('0x46')]['id']}})[_0xab03('0x24')](handleEntityNotFound(_0x186f6a,null))[_0xab03('0x24')](saveUpdates(_0x453563['body'],null))['then'](respondWithResult(_0x186f6a,null))['catch'](handleError(_0x186f6a,null));};exports[_0xab03('0x25')]=function(_0x4896f1,_0x32ff53){return db[_0xab03('0x2d')][_0xab03('0x4e')]({'where':{'id':_0x4896f1[_0xab03('0x46')]['id']}})[_0xab03('0x24')](handleEntityNotFound(_0x32ff53,null))[_0xab03('0x24')](removeEntity(_0x32ff53,null))[_0xab03('0x44')](handleError(_0x32ff53,null));}; \ No newline at end of file +var _0xea5a=['role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','index','map','Variable','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','length','find','catch','create','body','user'];(function(_0x409ef8,_0x238031){var _0x39b747=function(_0x290810){while(--_0x290810){_0x409ef8['push'](_0x409ef8['shift']());}};_0x39b747(++_0x238031);}(_0xea5a,0x16e));var _0xaea5=function(_0x4df6ba,_0x477c3e){_0x4df6ba=_0x4df6ba-0x0;var _0x472acf=_0xea5a[_0x4df6ba];return _0x472acf;};'use strict';var emlformat=require(_0xaea5('0x0'));var rimraf=require(_0xaea5('0x1'));var zipdir=require(_0xaea5('0x2'));var jsonpatch=require(_0xaea5('0x3'));var rp=require(_0xaea5('0x4'));var moment=require(_0xaea5('0x5'));var BPromise=require(_0xaea5('0x6'));var Mustache=require(_0xaea5('0x7'));var util=require(_0xaea5('0x8'));var path=require(_0xaea5('0x9'));var sox=require('sox');var csv=require(_0xaea5('0xa'));var ejs=require(_0xaea5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaea5('0xc'));var squel=require(_0xaea5('0xd'));var crypto=require(_0xaea5('0xe'));var jsforce=require(_0xaea5('0xf'));var deskjs=require(_0xaea5('0x10'));var toCsv=require(_0xaea5('0xa'));var querystring=require(_0xaea5('0x11'));var Papa=require(_0xaea5('0x12'));var Redis=require(_0xaea5('0x13'));var authService=require(_0xaea5('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xaea5('0x15'));var hardwareService=require(_0xaea5('0x16'));var logger=require('../../config/logger')(_0xaea5('0x17'));var utils=require(_0xaea5('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xaea5('0x19'));var db=require(_0xaea5('0x1a'))['db'];function respondWithStatusCode(_0x4b3f3a,_0x54cdc6){_0x54cdc6=_0x54cdc6||0xcc;return function(_0x5124e7){if(_0x5124e7){return _0x4b3f3a[_0xaea5('0x1b')](_0x54cdc6);}return _0x4b3f3a[_0xaea5('0x1c')](_0x54cdc6)[_0xaea5('0x1d')]();};}function respondWithResult(_0x2bcdba,_0x2b3f08){_0x2b3f08=_0x2b3f08||0xc8;return function(_0x4adff9){if(_0x4adff9){return _0x2bcdba[_0xaea5('0x1c')](_0x2b3f08)[_0xaea5('0x1e')](_0x4adff9);}};}function respondWithFilteredResult(_0x45c816,_0x36a959){return function(_0x2a8683){if(_0x2a8683){var _0xcdabb6=typeof _0x36a959[_0xaea5('0x1f')]===_0xaea5('0x20')&&typeof _0x36a959[_0xaea5('0x21')]===_0xaea5('0x20');var _0x874c1d=_0x2a8683[_0xaea5('0x22')];var _0x2986db=_0xcdabb6?0x0:_0x36a959[_0xaea5('0x1f')];var _0x18af42=_0xcdabb6?_0x2a8683[_0xaea5('0x22')]:_0x36a959['offset']+_0x36a959['limit'];var _0x18ba8d;if(_0x18af42>=_0x874c1d){_0x18af42=_0x874c1d;_0x18ba8d=0xc8;}else{_0x18ba8d=0xce;}_0x45c816[_0xaea5('0x1c')](_0x18ba8d);return _0x45c816[_0xaea5('0x23')](_0xaea5('0x24'),_0x2986db+'-'+_0x18af42+'/'+_0x874c1d)[_0xaea5('0x1e')](_0x2a8683);}return null;};}function patchUpdates(_0x1609a4){return function(_0xe9a358){try{jsonpatch[_0xaea5('0x25')](_0xe9a358,_0x1609a4,!![]);}catch(_0x539be4){return BPromise[_0xaea5('0x26')](_0x539be4);}return _0xe9a358[_0xaea5('0x27')]();};}function saveUpdates(_0x3fcb32,_0x13f69b){return function(_0x2c7ccc){if(_0x2c7ccc){return _0x2c7ccc[_0xaea5('0x28')](_0x3fcb32)[_0xaea5('0x29')](function(_0x5071f5){return _0x5071f5;});}return null;};}function removeEntity(_0x22a902,_0x3fe6e4){return function(_0x2b145f){if(_0x2b145f){return _0x2b145f[_0xaea5('0x2a')]()[_0xaea5('0x29')](function(){var _0x1f7e45=_0x2b145f[_0xaea5('0x2b')]({'plain':!![]});var _0x5b1217=_0xaea5('0x2c');return db[_0xaea5('0x2d')][_0xaea5('0x2a')]({'where':{'type':_0x5b1217,'resourceId':_0x1f7e45['id']}})[_0xaea5('0x29')](function(){return _0x2b145f;});})[_0xaea5('0x29')](function(){_0x22a902['status'](0xcc)[_0xaea5('0x1d')]();});}};}function handleEntityNotFound(_0x268b9b,_0x1833ff){return function(_0x19e6f1){if(!_0x19e6f1){_0x268b9b[_0xaea5('0x1b')](0x194);}return _0x19e6f1;};}function handleError(_0x53ea83,_0xae5fb0){_0xae5fb0=_0xae5fb0||0x1f4;return function(_0x47fc6b){logger[_0xaea5('0x2e')](_0x47fc6b[_0xaea5('0x2f')]);if(_0x47fc6b[_0xaea5('0x30')]){delete _0x47fc6b[_0xaea5('0x30')];}_0x53ea83[_0xaea5('0x1c')](_0xae5fb0)['send'](_0x47fc6b);};}exports[_0xaea5('0x31')]=function(_0x57418f,_0x57b73e){var _0x5c9f0e={},_0x197921={},_0x856711={'count':0x0,'rows':[]};var _0x557873=_[_0xaea5('0x32')](db[_0xaea5('0x33')][_0xaea5('0x34')],function(_0x3fe535){return{'name':_0x3fe535[_0xaea5('0x35')],'type':_0x3fe535[_0xaea5('0x36')][_0xaea5('0x37')]};});_0x197921[_0xaea5('0x38')]=_[_0xaea5('0x32')](_0x557873,_0xaea5('0x30'));_0x197921[_0xaea5('0x39')]=_['keys'](_0x57418f['query']);_0x197921['filters']=_[_0xaea5('0x3a')](_0x197921[_0xaea5('0x38')],_0x197921[_0xaea5('0x39')]);_0x5c9f0e[_0xaea5('0x3b')]=_[_0xaea5('0x3a')](_0x197921[_0xaea5('0x38')],qs[_0xaea5('0x3c')](_0x57418f['query'][_0xaea5('0x3c')]));_0x5c9f0e[_0xaea5('0x3b')]=_0x5c9f0e['attributes']['length']?_0x5c9f0e[_0xaea5('0x3b')]:_0x197921[_0xaea5('0x38')];if(!_0x57418f[_0xaea5('0x39')][_0xaea5('0x3d')](_0xaea5('0x3e'))){_0x5c9f0e[_0xaea5('0x21')]=qs[_0xaea5('0x21')](_0x57418f['query'][_0xaea5('0x21')]);_0x5c9f0e[_0xaea5('0x1f')]=qs[_0xaea5('0x1f')](_0x57418f[_0xaea5('0x39')]['offset']);}_0x5c9f0e[_0xaea5('0x3f')]=qs[_0xaea5('0x40')](_0x57418f[_0xaea5('0x39')]['sort']);_0x5c9f0e['where']=qs[_0xaea5('0x41')](_[_0xaea5('0x42')](_0x57418f[_0xaea5('0x39')],_0x197921[_0xaea5('0x41')]),_0x557873);if(_0x57418f[_0xaea5('0x39')][_0xaea5('0x43')]){_0x5c9f0e[_0xaea5('0x44')]=_[_0xaea5('0x45')](_0x5c9f0e[_0xaea5('0x44')],{'$or':_[_0xaea5('0x32')](_0x557873,function(_0x1eb5ee){if(_0x1eb5ee[_0xaea5('0x36')]!==_0xaea5('0x46')){var _0x1420e1={};_0x1420e1[_0x1eb5ee['name']]={'$like':'%'+_0x57418f[_0xaea5('0x39')][_0xaea5('0x43')]+'%'};return _0x1420e1;}})});}_0x5c9f0e=_['merge']({},_0x5c9f0e,_0x57418f[_0xaea5('0x47')]);var _0x1a6c6a={'where':_0x5c9f0e[_0xaea5('0x44')]};return db[_0xaea5('0x33')]['count'](_0x1a6c6a)[_0xaea5('0x29')](function(_0x4d000d){_0x856711[_0xaea5('0x22')]=_0x4d000d;if(_0x57418f[_0xaea5('0x39')][_0xaea5('0x48')]){_0x5c9f0e[_0xaea5('0x49')]=[{'all':!![]}];}return db['Variable'][_0xaea5('0x4a')](_0x5c9f0e);})[_0xaea5('0x29')](function(_0x56c413){_0x856711[_0xaea5('0x4b')]=_0x56c413;return _0x856711;})[_0xaea5('0x29')](respondWithFilteredResult(_0x57b73e,_0x5c9f0e))['catch'](handleError(_0x57b73e,null));};exports[_0xaea5('0x4c')]=function(_0x282de8,_0x14e9a8){var _0x3fc49c={'raw':!![],'where':{'id':_0x282de8['params']['id']}},_0x329526={};_0x329526[_0xaea5('0x38')]=_[_0xaea5('0x4d')](db[_0xaea5('0x33')][_0xaea5('0x34')]);_0x329526['query']=_[_0xaea5('0x4d')](_0x282de8[_0xaea5('0x39')]);_0x329526[_0xaea5('0x41')]=_[_0xaea5('0x3a')](_0x329526[_0xaea5('0x38')],_0x329526['query']);_0x3fc49c[_0xaea5('0x3b')]=_['intersection'](_0x329526[_0xaea5('0x38')],qs[_0xaea5('0x3c')](_0x282de8[_0xaea5('0x39')]['fields']));_0x3fc49c[_0xaea5('0x3b')]=_0x3fc49c['attributes'][_0xaea5('0x4e')]?_0x3fc49c[_0xaea5('0x3b')]:_0x329526[_0xaea5('0x38')];if(_0x282de8[_0xaea5('0x39')][_0xaea5('0x48')]){_0x3fc49c['include']=[{'all':!![]}];}_0x3fc49c=_[_0xaea5('0x45')]({},_0x3fc49c,_0x282de8[_0xaea5('0x47')]);return db[_0xaea5('0x33')][_0xaea5('0x4f')](_0x3fc49c)['then'](handleEntityNotFound(_0x14e9a8,null))[_0xaea5('0x29')](respondWithResult(_0x14e9a8,null))[_0xaea5('0x50')](handleError(_0x14e9a8,null));};exports['create']=function(_0x2d6181,_0x145887){return db[_0xaea5('0x33')][_0xaea5('0x51')](_0x2d6181[_0xaea5('0x52')],{})[_0xaea5('0x29')](function(_0x1278fb){var _0x1e0b88=_0x2d6181[_0xaea5('0x53')][_0xaea5('0x2b')]({'plain':!![]});if(!_0x1e0b88)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e0b88[_0xaea5('0x54')]==='user'){var _0x235b28=_0x1278fb[_0xaea5('0x2b')]({'plain':!![]});var _0x5140dd=_0xaea5('0x2c');return db[_0xaea5('0x55')][_0xaea5('0x4f')]({'where':{'name':_0x5140dd,'userProfileId':_0x1e0b88[_0xaea5('0x56')]},'raw':!![]})[_0xaea5('0x29')](function(_0x483cd9){if(_0x483cd9&&_0x483cd9[_0xaea5('0x57')]===0x0){return db[_0xaea5('0x2d')][_0xaea5('0x51')]({'name':_0x235b28[_0xaea5('0x30')],'resourceId':_0x235b28['id'],'type':_0x483cd9['name'],'sectionId':_0x483cd9['id']},{})[_0xaea5('0x29')](function(){return _0x1278fb;});}else{return _0x1278fb;}})[_0xaea5('0x50')](function(_0x10127c){logger[_0xaea5('0x2e')](_0xaea5('0x58'),_0x10127c);throw _0x10127c;});}return _0x1278fb;})[_0xaea5('0x29')](respondWithResult(_0x145887,0xc9))[_0xaea5('0x50')](handleError(_0x145887,null));};exports[_0xaea5('0x28')]=function(_0x139e10,_0x9f4551){if(_0x139e10[_0xaea5('0x52')]['id']){delete _0x139e10[_0xaea5('0x52')]['id'];}return db[_0xaea5('0x33')][_0xaea5('0x4f')]({'where':{'id':_0x139e10[_0xaea5('0x59')]['id']}})[_0xaea5('0x29')](handleEntityNotFound(_0x9f4551,null))['then'](saveUpdates(_0x139e10[_0xaea5('0x52')],null))[_0xaea5('0x29')](respondWithResult(_0x9f4551,null))[_0xaea5('0x50')](handleError(_0x9f4551,null));};exports[_0xaea5('0x2a')]=function(_0x5358b9,_0x1f7e6c){return db['Variable'][_0xaea5('0x4f')]({'where':{'id':_0x5358b9[_0xaea5('0x59')]['id']}})[_0xaea5('0x29')](handleEntityNotFound(_0x1f7e6c,null))[_0xaea5('0x29')](removeEntity(_0x1f7e6c,null))[_0xaea5('0x50')](handleError(_0x1f7e6c,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 92bd603..25f2a19 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 _0x2cec=['tools_variables','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','Variable'];(function(_0x195760,_0x1ecf93){var _0x58bcd1=function(_0x1774df){while(--_0x1774df){_0x195760['push'](_0x195760['shift']());}};_0x58bcd1(++_0x1ecf93);}(_0x2cec,0x9d));var _0xc2ce=function(_0x312afb,_0x42be46){_0x312afb=_0x312afb-0x0;var _0x586f1a=_0x2cec[_0x312afb];return _0x586f1a;};'use strict';var _=require(_0xc2ce('0x0'));var util=require(_0xc2ce('0x1'));var logger=require('../../config/logger')(_0xc2ce('0x2'));var moment=require(_0xc2ce('0x3'));var BPromise=require(_0xc2ce('0x4'));var rp=require(_0xc2ce('0x5'));var fs=require('fs');var path=require(_0xc2ce('0x6'));var rimraf=require(_0xc2ce('0x7'));var config=require(_0xc2ce('0x8'));var attributes=require(_0xc2ce('0x9'));module[_0xc2ce('0xa')]=function(_0x88cb0e,_0x4d7eba){return _0x88cb0e['define'](_0xc2ce('0xb'),attributes,{'tableName':_0xc2ce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ee8=['exports','define','lodash','util','moment','bluebird','path','rimraf','./variable.attributes'];(function(_0x53e37a,_0x1528b9){var _0x53e8da=function(_0x15cf28){while(--_0x15cf28){_0x53e37a['push'](_0x53e37a['shift']());}};_0x53e8da(++_0x1528b9);}(_0x5ee8,0xa4));var _0x85ee=function(_0x45feab,_0x955863){_0x45feab=_0x45feab-0x0;var _0x1d2f44=_0x5ee8[_0x45feab];return _0x1d2f44;};'use strict';var _=require(_0x85ee('0x0'));var util=require(_0x85ee('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x85ee('0x2'));var BPromise=require(_0x85ee('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x85ee('0x4'));var rimraf=require(_0x85ee('0x5'));var config=require('../../config/environment');var attributes=require(_0x85ee('0x6'));module[_0x85ee('0x7')]=function(_0x1d11f4,_0x11003d){return _0x1d11f4[_0x85ee('0x8')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 40d8d0b..d30b0a7 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 _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0xdac383,_0x505d99){var _0x3e783d=function(_0x29c22a){while(--_0x29c22a){_0xdac383['push'](_0xdac383['shift']());}};_0x3e783d(++_0x505d99);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3b18d,_0x30c7f9){_0x3b18d=_0x3b18d-0x0;var _0x1a3362=_0x1cb9[_0x3b18d];return _0x1a3362;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file +var _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x39f811,_0x3d53b8){var _0x14fb75=function(_0xd59372){while(--_0xd59372){_0x39f811['push'](_0x39f811['shift']());}};_0x14fb75(++_0x3d53b8);}(_0x814b,0x1a2));var _0xb814=function(_0x360739,_0x2ec1b2){_0x360739=_0x360739-0x0;var _0x3e23a1=_0x814b[_0x360739];return _0x3e23a1;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 0a434b3..6bcd18a 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 _0x8441=['/fetch','isAuthenticated','fetch','/reset','canUpdate','/pull','/restart','migrations','exports','../../components/auth/service','./version.controller','get','index'];(function(_0x34c825,_0x44cad4){var _0x2fde13=function(_0x5ba245){while(--_0x5ba245){_0x34c825['push'](_0x34c825['shift']());}};_0x2fde13(++_0x44cad4);}(_0x8441,0xbf));var _0x1844=function(_0x4584ed,_0x30292b){_0x4584ed=_0x4584ed-0x0;var _0x3d0859=_0x8441[_0x4584ed];return _0x3d0859;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x1844('0x0'));var controller=require(_0x1844('0x1'));router[_0x1844('0x2')]('/',controller[_0x1844('0x3')]);router['get'](_0x1844('0x4'),auth[_0x1844('0x5')](),auth['canUpdate'](),controller[_0x1844('0x6')]);router[_0x1844('0x2')](_0x1844('0x7'),auth[_0x1844('0x5')](),auth[_0x1844('0x8')](),controller['reset']);router['get'](_0x1844('0x9'),auth[_0x1844('0x5')](),auth[_0x1844('0x8')](),controller['pull']);router['get'](_0x1844('0xa'),auth[_0x1844('0x5')](),controller['restart']);router[_0x1844('0x2')]('/migrations',controller[_0x1844('0xb')]);module[_0x1844('0xc')]=router; \ No newline at end of file +var _0x2e82=['/fetch','isAuthenticated','canUpdate','/reset','pull','/restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x2e82,0x18f));var _0x22e8=function(_0x2b2826,_0x43e63f){_0x2b2826=_0x2b2826-0x0;var _0x33daaa=_0x2e82[_0x2b2826];return _0x33daaa;};'use strict';var express=require(_0x22e8('0x0'));var router=express[_0x22e8('0x1')]();var auth=require(_0x22e8('0x2'));var controller=require(_0x22e8('0x3'));router[_0x22e8('0x4')]('/',controller[_0x22e8('0x5')]);router[_0x22e8('0x4')](_0x22e8('0x6'),auth[_0x22e8('0x7')](),auth[_0x22e8('0x8')](),controller['fetch']);router[_0x22e8('0x4')](_0x22e8('0x9'),auth[_0x22e8('0x7')](),auth[_0x22e8('0x8')](),controller['reset']);router[_0x22e8('0x4')]('/pull',auth[_0x22e8('0x7')](),auth[_0x22e8('0x8')](),controller[_0x22e8('0xa')]);router['get'](_0x22e8('0xb'),auth[_0x22e8('0x7')](),controller['restart']);router[_0x22e8('0x4')](_0x22e8('0xc'),controller[_0x22e8('0xd')]);module[_0x22e8('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 4434810..debd4eb 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 _0xd1b2=['exports','query','tags','latest','2.0.0','json','status','fetch','origin','git\x20fetch','reset','--hard','FETCH_HEAD','error','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','path','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','root','index'];(function(_0x57f590,_0x27766a){var _0x39fbae=function(_0x58bcc4){while(--_0x58bcc4){_0x57f590['push'](_0x57f590['shift']());}};_0x39fbae(++_0x27766a);}(_0xd1b2,0x1ea));var _0x2d1b=function(_0x23f842,_0x270d27){_0x23f842=_0x23f842-0x0;var _0x1a4b62=_0xd1b2[_0x23f842];return _0x1a4b62;};'use strict';var Umzug=require('umzug');var path=require(_0x2d1b('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x2d1b('0x1'))(module,_0x2d1b('0x2'));var compareVersions=require('compare-versions');var exec=require(_0x2d1b('0x3'))[_0x2d1b('0x4')];var db=require(_0x2d1b('0x5'))['db'];var config=require(_0x2d1b('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x2d1b('0x7'))('update');var git=require('simple-git')(config[_0x2d1b('0x8')]);exports[_0x2d1b('0x9')]=function(_0x2a6f87,_0xfb9c05){var _0x2730c7={'current':module[_0x2d1b('0xa')][_0x2d1b('0x2')],'phonebar':0x2};if(_0x2a6f87[_0x2d1b('0xb')]&&_0x2a6f87[_0x2d1b('0xb')]['latest']){return git['fetch']()[_0x2d1b('0xc')](function(_0x39c532,_0x231bf3){_0x2730c7[_0x2d1b('0xd')]=(_0x39c532?module[_0x2d1b('0xa')]['version']:_0x231bf3[_0x2d1b('0xd')])||_0x2d1b('0xe');return _0xfb9c05['status'](0xc8)[_0x2d1b('0xf')](_0x2730c7);});}else{return _0xfb9c05[_0x2d1b('0x10')](0xc8)['json'](_0x2730c7);}};exports[_0x2d1b('0x11')]=function(_0x3e1478,_0x37b7be){return git[_0x2d1b('0x11')]([_0x2d1b('0x12'),'master'],function(_0x9b6c52){if(_0x9b6c52){logger['error'](_0x9b6c52);return _0x37b7be[_0x2d1b('0x10')](0x1f4)[_0x2d1b('0xf')](_0x9b6c52);}logger['info'](_0x2d1b('0x13'));return _0x37b7be[_0x2d1b('0x10')](0xc8)[_0x2d1b('0xf')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x2d1b('0x14')]=function(_0x40f8df,_0x175a1a){return git[_0x2d1b('0x14')]([_0x2d1b('0x15'),_0x2d1b('0x16')],function(_0x55d20a){if(_0x55d20a){logger[_0x2d1b('0x17')](_0x55d20a);return _0x175a1a[_0x2d1b('0x10')](0x1f4)[_0x2d1b('0xf')](_0x55d20a);}logger[_0x2d1b('0x18')](_0x2d1b('0x19'));return _0x175a1a[_0x2d1b('0x10')](0xc8)['json']({'output':_0x2d1b('0x1a')});});};exports['pull']=function(_0x129b01,_0x18917b){exec('npm\x20install\x20--production',function(_0x385278,_0x558f35,_0x4ac7d4){logger[_0x2d1b('0x18')](_0x558f35);logger['info'](_0x4ac7d4);if(_0x385278){logger[_0x2d1b('0x17')](_0x385278);return _0x18917b['status'](0x1f4)[_0x2d1b('0xf')](_0x385278);}return _0x18917b[_0x2d1b('0x10')](0xc8)[_0x2d1b('0xf')]({'output':_0x558f35});});};exports[_0x2d1b('0x1b')]=function(_0x224d0b,_0x1452a2){return pm2[_0x2d1b('0x1b')](_0x2d1b('0x1c'))[_0x2d1b('0x1d')](function(_0x1cd3aa){logger['info'](_0x2d1b('0x1e'),_0x1cd3aa);return _0x1452a2[_0x2d1b('0x10')](0xc8)[_0x2d1b('0xf')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x2d1b('0x1f')](function(_0x2c55ce){logger[_0x2d1b('0x17')](_0x2c55ce);return _0x1452a2[_0x2d1b('0x10')](0x1f4)[_0x2d1b('0xf')](_0x2c55ce);});};exports[_0x2d1b('0x20')]=function(_0x118458,_0x729d36){var _0x397bdb=fs[_0x2d1b('0x21')](path[_0x2d1b('0x22')](config[_0x2d1b('0x8')],_0x2d1b('0x23'),_0x2d1b('0x20')));var _0x3028ca=[];for(var _0xca00c3=0x0;_0xca00c3<_0x397bdb[_0x2d1b('0x24')];_0xca00c3++){var _0x5b79d5=_0x397bdb[_0xca00c3][_0x2d1b('0x25')](_0x2d1b('0x26'),'');if(compareVersions(module[_0x2d1b('0xa')]['version'],_0x5b79d5)===-0x1){_0x3028ca[_0x2d1b('0x27')](_0x5b79d5);}}if(_0x3028ca['length']){var _0x124522=_0x3028ca[_0x2d1b('0x28')](compareVersions);var _0x461dac=new Umzug({'storage':_0x2d1b('0x29'),'storageOptions':{'model':db['Migration'],'modelName':_0x2d1b('0x2a'),'columnName':_0x2d1b('0x2')},'migrations':{'params':[db[_0x2d1b('0x29')][_0x2d1b('0x2b')](),db[_0x2d1b('0x29')][_0x2d1b('0x2c')],function(){throw new Error(_0x2d1b('0x2d'));}],'path':path[_0x2d1b('0x22')](config[_0x2d1b('0x8')],_0x2d1b('0x23'),_0x2d1b('0x20')),'pattern':/\.js$/}});_0x461dac['up']({'migrations':_['map'](_0x124522,function(_0x8628a2){return _0x8628a2+_0x2d1b('0x26');})})['then'](function(){return _0x729d36[_0x2d1b('0x10')](0xc8)[_0x2d1b('0xf')]({'output':_0x2d1b('0x2e')+module['exports'][_0x2d1b('0x2')]+_0x2d1b('0x2f')+_[_0x2d1b('0x30')](_0x124522),'migrations':_['join'](_0x124522)});})[_0x2d1b('0x1f')](function(_0x51a393){if(_0x51a393 instanceof db[_0x2d1b('0x29')]['UniqueConstraintError']){return _0x729d36[_0x2d1b('0x10')](0xc8)[_0x2d1b('0xf')]({'output':_0x2d1b('0x31')});}else{return _0x729d36[_0x2d1b('0x10')](0x1f4)[_0x2d1b('0xf')](_0x51a393);}});}else{return _0x729d36[_0x2d1b('0x10')](0xc8)[_0x2d1b('0xf')]({'output':_0x2d1b('0x31')});}}; \ No newline at end of file +var _0xb9ee=['Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','query','latest','fetch','tags','exports','2.0.0','status','json','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','info','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','server','migrations','length','.js','push','sort','sequelize'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xb9ee,0x1b9));var _0xeb9e=function(_0x345aab,_0x18b7af){_0x345aab=_0x345aab-0x0;var _0x37d787=_0xb9ee[_0x345aab];return _0x37d787;};'use strict';var Umzug=require(_0xeb9e('0x0'));var path=require(_0xeb9e('0x1'));var fs=require('fs');var _=require(_0xeb9e('0x2'));var pkginfo=require(_0xeb9e('0x3'))(module,_0xeb9e('0x4'));var compareVersions=require(_0xeb9e('0x5'));var exec=require('child_process')['exec'];var db=require(_0xeb9e('0x6'))['db'];var config=require(_0xeb9e('0x7'));var pm2=require('../../config/pm2');var logger=require(_0xeb9e('0x8'))(_0xeb9e('0x9'));var git=require(_0xeb9e('0xa'))(config[_0xeb9e('0xb')]);exports['index']=function(_0x3e8323,_0x14c91b){var _0x34ce2a={'current':module['exports'][_0xeb9e('0x4')],'phonebar':0x2};if(_0x3e8323[_0xeb9e('0xc')]&&_0x3e8323[_0xeb9e('0xc')][_0xeb9e('0xd')]){return git[_0xeb9e('0xe')]()[_0xeb9e('0xf')](function(_0x474901,_0x53a60a){_0x34ce2a['latest']=(_0x474901?module[_0xeb9e('0x10')]['version']:_0x53a60a[_0xeb9e('0xd')])||_0xeb9e('0x11');return _0x14c91b[_0xeb9e('0x12')](0xc8)[_0xeb9e('0x13')](_0x34ce2a);});}else{return _0x14c91b[_0xeb9e('0x12')](0xc8)['json'](_0x34ce2a);}};exports['fetch']=function(_0x26d242,_0x32ff59){return git['fetch']([_0xeb9e('0x14'),_0xeb9e('0x15')],function(_0x2f51be){if(_0x2f51be){logger[_0xeb9e('0x16')](_0x2f51be);return _0x32ff59[_0xeb9e('0x12')](0x1f4)[_0xeb9e('0x13')](_0x2f51be);}logger['info'](_0xeb9e('0x17'));return _0x32ff59[_0xeb9e('0x12')](0xc8)['json']({'output':_0xeb9e('0x18')});});};exports[_0xeb9e('0x19')]=function(_0x29c956,_0x53877e){return git[_0xeb9e('0x19')]([_0xeb9e('0x1a'),_0xeb9e('0x1b')],function(_0x5aaba5){if(_0x5aaba5){logger[_0xeb9e('0x16')](_0x5aaba5);return _0x53877e[_0xeb9e('0x12')](0x1f4)['json'](_0x5aaba5);}logger['info'](_0xeb9e('0x1c'));return _0x53877e[_0xeb9e('0x12')](0xc8)['json']({'output':_0xeb9e('0x1d')});});};exports['pull']=function(_0x3c6316,_0x173880){exec(_0xeb9e('0x1e'),function(_0x369a61,_0x2fa03f,_0x4d170d){logger['info'](_0x2fa03f);logger[_0xeb9e('0x1f')](_0x4d170d);if(_0x369a61){logger[_0xeb9e('0x16')](_0x369a61);return _0x173880['status'](0x1f4)[_0xeb9e('0x13')](_0x369a61);}return _0x173880[_0xeb9e('0x12')](0xc8)['json']({'output':_0x2fa03f});});};exports[_0xeb9e('0x20')]=function(_0x43082a,_0x5ca504){return pm2[_0xeb9e('0x20')](_0xeb9e('0x21'))[_0xeb9e('0x22')](function(_0x3d92b8){logger['info'](_0xeb9e('0x23'),_0x3d92b8);return _0x5ca504['status'](0xc8)[_0xeb9e('0x13')]({'output':_0xeb9e('0x24')});})[_0xeb9e('0x25')](function(_0x4d0b78){logger[_0xeb9e('0x16')](_0x4d0b78);return _0x5ca504[_0xeb9e('0x12')](0x1f4)[_0xeb9e('0x13')](_0x4d0b78);});};exports['migrations']=function(_0x7b6def,_0x21b5f3){var _0x17fff3=fs['readdirSync'](path['join'](config[_0xeb9e('0xb')],_0xeb9e('0x26'),_0xeb9e('0x27')));var _0x3e0a02=[];for(var _0x1b2db3=0x0;_0x1b2db3<_0x17fff3[_0xeb9e('0x28')];_0x1b2db3++){var _0x189979=_0x17fff3[_0x1b2db3]['replace'](_0xeb9e('0x29'),'');if(compareVersions(module[_0xeb9e('0x10')][_0xeb9e('0x4')],_0x189979)===-0x1){_0x3e0a02[_0xeb9e('0x2a')](_0x189979);}}if(_0x3e0a02[_0xeb9e('0x28')]){var _0x23ed21=_0x3e0a02[_0xeb9e('0x2b')](compareVersions);var _0x58ae59=new Umzug({'storage':_0xeb9e('0x2c'),'storageOptions':{'model':db[_0xeb9e('0x2d')],'modelName':_0xeb9e('0x2d'),'columnName':_0xeb9e('0x4')},'migrations':{'params':[db['sequelize'][_0xeb9e('0x2e')](),db[_0xeb9e('0x2c')][_0xeb9e('0x2f')],function(){throw new Error(_0xeb9e('0x30'));}],'path':path[_0xeb9e('0x31')](config['root'],_0xeb9e('0x26'),_0xeb9e('0x27')),'pattern':/\.js$/}});_0x58ae59['up']({'migrations':_['map'](_0x23ed21,function(_0x13c410){return _0x13c410+_0xeb9e('0x29');})})[_0xeb9e('0x22')](function(){return _0x21b5f3['status'](0xc8)[_0xeb9e('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0xeb9e('0x4')]+_0xeb9e('0x32')+_[_0xeb9e('0x33')](_0x23ed21),'migrations':_[_0xeb9e('0x31')](_0x23ed21)});})[_0xeb9e('0x25')](function(_0x90045e){if(_0x90045e instanceof db[_0xeb9e('0x2c')][_0xeb9e('0x34')]){return _0x21b5f3['status'](0xc8)['json']({'output':_0xeb9e('0x35')});}else{return _0x21b5f3[_0xeb9e('0x12')](0x1f4)['json'](_0x90045e);}});}else{return _0x21b5f3[_0xeb9e('0x12')](0xc8)[_0xeb9e('0x13')]({'output':_0xeb9e('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 0f2078c..bfd9fd9 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 _0x1a1f=['isAuthenticated','index','/describe','/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get'];(function(_0x41b0a6,_0x5deda1){var _0x45c42e=function(_0x3a6e0e){while(--_0x3a6e0e){_0x41b0a6['push'](_0x41b0a6['shift']());}};_0x45c42e(++_0x5deda1);}(_0x1a1f,0x1d5));var _0xf1a1=function(_0x77263c,_0x23c411){_0x77263c=_0x77263c-0x0;var _0xb6136f=_0x1a1f[_0x77263c];return _0xb6136f;};'use strict';var multer=require(_0xf1a1('0x0'));var util=require(_0xf1a1('0x1'));var path=require(_0xf1a1('0x2'));var timeout=require(_0xf1a1('0x3'));var express=require(_0xf1a1('0x4'));var router=express['Router']();var fs_extra=require(_0xf1a1('0x5'));var auth=require(_0xf1a1('0x6'));var interaction=require(_0xf1a1('0x7'));var config=require(_0xf1a1('0x8'));var controller=require(_0xf1a1('0x9'));router[_0xf1a1('0xa')]('/',auth[_0xf1a1('0xb')](),controller[_0xf1a1('0xc')]);router['get'](_0xf1a1('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xf1a1('0xa')](_0xf1a1('0xe'),auth['isAuthenticated'](),controller[_0xf1a1('0xf')]);router[_0xf1a1('0x10')]('/',auth[_0xf1a1('0xb')](),controller[_0xf1a1('0x11')]);router[_0xf1a1('0x12')](_0xf1a1('0xe'),auth[_0xf1a1('0xb')](),controller['update']);router['delete'](_0xf1a1('0xe'),auth[_0xf1a1('0xb')](),controller[_0xf1a1('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9732=['/:id','destroy','multer','util','path','express','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','post','create','delete'];(function(_0x37f4d8,_0x4ec257){var _0x10ebd8=function(_0x189b79){while(--_0x189b79){_0x37f4d8['push'](_0x37f4d8['shift']());}};_0x10ebd8(++_0x4ec257);}(_0x9732,0x1c2));var _0x2973=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9732[_0x3511d3];return _0x5d6321;};'use strict';var multer=require(_0x2973('0x0'));var util=require(_0x2973('0x1'));var path=require(_0x2973('0x2'));var timeout=require('connect-timeout');var express=require(_0x2973('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2973('0x4'));var config=require(_0x2973('0x5'));var controller=require(_0x2973('0x6'));router[_0x2973('0x7')]('/',auth[_0x2973('0x8')](),controller['index']);router[_0x2973('0x7')](_0x2973('0x9'),auth[_0x2973('0x8')](),controller[_0x2973('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2973('0xb')]('/',auth['isAuthenticated'](),controller[_0x2973('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2973('0xd')](_0x2973('0xe'),auth[_0x2973('0x8')](),controller[_0x2973('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 7e5479f..130049e 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 _0xde9f=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x26c323,_0x559fa7){var _0xaa4f94=function(_0x7b9080){while(--_0x7b9080){_0x26c323['push'](_0x26c323['shift']());}};_0xaa4f94(++_0x559fa7);}(_0xde9f,0x118));var _0xfde9=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0xde9f[_0x9d14e3];return _0x19bf32;};'use strict';var Sequelize=require(_0xfde9('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfde9('0x1')]},'calleridnum':{'type':Sequelize[_0xfde9('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xfde9('0x1')]},'interface':{'type':Sequelize[_0xfde9('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xfde9('0x2')]},'agentconnectAt':{'type':Sequelize[_0xfde9('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xfde9('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xfde9('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xfde9('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xfde9('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xfde9('0x4')]},'agentacw':{'type':Sequelize[_0xfde9('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xfde9('0x4')]},'reason':{'type':Sequelize[_0xfde9('0x1')]},'lastevent':{'type':Sequelize[_0xfde9('0x1')]},'channel':{'type':Sequelize[_0xfde9('0x1')]},'channelstate':{'type':Sequelize[_0xfde9('0x4')]},'channelstatedesc':{'type':Sequelize[_0xfde9('0x1')]},'connectedlinenum':{'type':Sequelize[_0xfde9('0x1')]},'connectedlinename':{'type':Sequelize[_0xfde9('0x1')]},'language':{'type':Sequelize[_0xfde9('0x1')]},'accountcode':{'type':Sequelize[_0xfde9('0x1')]},'context':{'type':Sequelize[_0xfde9('0x1')]},'exten':{'type':Sequelize[_0xfde9('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xfde9('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xfde9('0x1')]},'destcalleridnum':{'type':Sequelize[_0xfde9('0x1')]},'destcalleridname':{'type':Sequelize[_0xfde9('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xfde9('0x1')]},'destaccountcode':{'type':Sequelize[_0xfde9('0x1')]},'destcontext':{'type':Sequelize[_0xfde9('0x1')]},'destexten':{'type':Sequelize[_0xfde9('0x1')]},'destpriority':{'type':Sequelize[_0xfde9('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xfde9('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xfde9('0x1')]},'transfer':{'type':Sequelize[_0xfde9('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xfde9('0x5')},'transferexten':{'type':Sequelize[_0xfde9('0x1')]},'transferuniqueid':{'type':Sequelize[_0xfde9('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x20df=['STRING','DATE','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x2d9f8f,_0x40bc79){var _0x240df4=function(_0x397d13){while(--_0x397d13){_0x2d9f8f['push'](_0x2d9f8f['shift']());}};_0x240df4(++_0x40bc79);}(_0x20df,0x7c));var _0xf20d=function(_0x38f737,_0x54f685){_0x38f737=_0x38f737-0x0;var _0x7afda3=_0x20df[_0x38f737];return _0x7afda3;};'use strict';var Sequelize=require(_0xf20d('0x0'));module[_0xf20d('0x1')]={'type':{'type':Sequelize[_0xf20d('0x2')]},'uniqueid':{'type':Sequelize[_0xf20d('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf20d('0x2')]},'queue':{'type':Sequelize[_0xf20d('0x2')]},'interface':{'type':Sequelize[_0xf20d('0x2')]},'membername':{'type':Sequelize[_0xf20d('0x2')]},'agentcalledAt':{'type':Sequelize[_0xf20d('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xf20d('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xf20d('0x3')]},'holdtime':{'type':Sequelize[_0xf20d('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xf20d('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xf20d('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf20d('0x4')]},'reason':{'type':Sequelize[_0xf20d('0x2')]},'lastevent':{'type':Sequelize[_0xf20d('0x2')]},'channel':{'type':Sequelize[_0xf20d('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xf20d('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf20d('0x2')]},'connectedlinename':{'type':Sequelize[_0xf20d('0x2')]},'language':{'type':Sequelize[_0xf20d('0x2')]},'accountcode':{'type':Sequelize[_0xf20d('0x2')]},'context':{'type':Sequelize[_0xf20d('0x2')]},'exten':{'type':Sequelize[_0xf20d('0x2')]},'priority':{'type':Sequelize[_0xf20d('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xf20d('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf20d('0x2')]},'destcalleridname':{'type':Sequelize[_0xf20d('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xf20d('0x2')]},'destlanguage':{'type':Sequelize[_0xf20d('0x2')]},'destaccountcode':{'type':Sequelize[_0xf20d('0x2')]},'destcontext':{'type':Sequelize[_0xf20d('0x2')]},'destexten':{'type':Sequelize[_0xf20d('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xf20d('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xf20d('0x2')]},'transfer':{'type':Sequelize[_0xf20d('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf20d('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xf20d('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xf20d('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 9fc7fe3..ee9182b 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(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 776b1be..6dbe391 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 _0xf5a7=['../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x34d70e,_0x217f7a){var _0x1367c1=function(_0x441c87){while(--_0x441c87){_0x34d70e['push'](_0x34d70e['shift']());}};_0x1367c1(++_0x217f7a);}(_0xf5a7,0x133));var _0x7f5a=function(_0x1e340b,_0x495f8b){_0x1e340b=_0x1e340b-0x0;var _0x787512=_0xf5a7[_0x1e340b];return _0x787512;};'use strict';var _=require(_0x7f5a('0x0'));var util=require(_0x7f5a('0x1'));var logger=require('../../config/logger')(_0x7f5a('0x2'));var moment=require(_0x7f5a('0x3'));var BPromise=require(_0x7f5a('0x4'));var rp=require(_0x7f5a('0x5'));var fs=require('fs');var path=require(_0x7f5a('0x6'));var rimraf=require(_0x7f5a('0x7'));var config=require(_0x7f5a('0x8'));var attributes=require(_0x7f5a('0x9'));module[_0x7f5a('0xa')]=function(_0x520bf9,_0x2808f2){return _0x520bf9[_0x7f5a('0xb')]('VoiceAgentReport',attributes,{'tableName':_0x7f5a('0xc'),'paranoid':![],'indexes':[{'fields':[_0x7f5a('0xd'),_0x7f5a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8a7=['VoiceAgentReport','report_agent','destuniqueid','lodash','moment','bluebird','request-promise','rimraf','./voiceAgentReport.attributes','define'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xd8a7,0xdf));var _0x7d8a=function(_0x3b1628,_0x592492){_0x3b1628=_0x3b1628-0x0;var _0x5c6a95=_0xd8a7[_0x3b1628];return _0x5c6a95;};'use strict';var _=require(_0x7d8a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7d8a('0x1'));var BPromise=require(_0x7d8a('0x2'));var rp=require(_0x7d8a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d8a('0x4'));var config=require('../../config/environment');var attributes=require(_0x7d8a('0x5'));module['exports']=function(_0x27ef8e,_0x530308){return _0x27ef8e[_0x7d8a('0x6')](_0x7d8a('0x7'),attributes,{'tableName':_0x7d8a('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x7d8a('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 458c609..f070a5b 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 _0x06f9=['code','error','message','result','catch','VoiceAgentReport','create','body','options','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0x06f9,0x104));var _0x906f=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x06f9[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0x906f('0x0'));var util=require(_0x906f('0x1'));var moment=require(_0x906f('0x2'));var BPromise=require(_0x906f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x906f('0x4'));var db=require(_0x906f('0x5'))['db'];var utils=require(_0x906f('0x6'));var logger=require(_0x906f('0x7'))(_0x906f('0x8'));var config=require(_0x906f('0x9'));var jayson=require(_0x906f('0xa'));var client=jayson[_0x906f('0xb')][_0x906f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3423f2,_0x45adaf,_0x26ff18){return new BPromise(function(_0x367894,_0x65497f){return client['request'](_0x3423f2,_0x26ff18)[_0x906f('0xd')](function(_0x52ada7){logger[_0x906f('0xe')](_0x906f('0xf'),_0x45adaf,_0x906f('0x10'));logger[_0x906f('0x11')](_0x906f('0x12'),_0x45adaf,_0x906f('0x10'),JSON[_0x906f('0x13')](_0x52ada7));if(_0x52ada7['error']){if(_0x52ada7['error'][_0x906f('0x14')]===0x1f4){logger[_0x906f('0x15')](_0x906f('0xf'),_0x45adaf,_0x52ada7[_0x906f('0x15')][_0x906f('0x16')]);return _0x65497f(_0x52ada7[_0x906f('0x15')]['message']);}logger[_0x906f('0x15')](_0x906f('0xf'),_0x45adaf,_0x52ada7[_0x906f('0x15')][_0x906f('0x16')]);return _0x367894(_0x52ada7[_0x906f('0x15')][_0x906f('0x16')]);}else{logger[_0x906f('0xe')](_0x906f('0xf'),_0x45adaf,_0x906f('0x10'));_0x367894(_0x52ada7[_0x906f('0x17')]['message']);}})[_0x906f('0x18')](function(_0x3e2d5a){logger[_0x906f('0x15')]('VoiceAgentReport,\x20%s,\x20%s',_0x45adaf,_0x3e2d5a);_0x65497f(_0x3e2d5a);});});}exports['CreateVoiceAgentReport']=function(_0x1bf44f){var _0x24419b=this;return new Promise(function(_0x149356,_0x4a36dc){return db[_0x906f('0x19')][_0x906f('0x1a')](_0x1bf44f[_0x906f('0x1b')],{'raw':_0x1bf44f[_0x906f('0x1c')]?_0x1bf44f[_0x906f('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x906f('0xd')](function(_0x223665){logger[_0x906f('0xe')](_0x906f('0x1d'),_0x1bf44f);logger[_0x906f('0x11')]('CreateVoiceAgentReport',_0x1bf44f,JSON[_0x906f('0x13')](_0x223665));_0x149356(_0x223665);})[_0x906f('0x18')](function(_0x314a18){logger[_0x906f('0x15')](_0x906f('0x1d'),_0x314a18[_0x906f('0x16')],_0x1bf44f);_0x4a36dc(_0x24419b[_0x906f('0x15')](0x1f4,_0x314a18[_0x906f('0x16')]));});});};exports[_0x906f('0x1e')]=function(_0x59fa73){var _0xf4fda8=this;return new Promise(function(_0x557eea,_0x1cea5b){return db[_0x906f('0x19')][_0x906f('0x1f')](_0x59fa73[_0x906f('0x1b')],{'raw':_0x59fa73[_0x906f('0x1c')]?_0x59fa73[_0x906f('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59fa73[_0x906f('0x1c')]?_0x59fa73['options'][_0x906f('0x20')]||null:null,'attributes':_0x59fa73['options']?_0x59fa73[_0x906f('0x1c')][_0x906f('0x21')]||null:null,'limit':_0x59fa73['options']?_0x59fa73['options'][_0x906f('0x22')]||null:null})['then'](function(_0x324fc8){logger[_0x906f('0xe')]('UpdateVoiceAgentReport',_0x59fa73);logger[_0x906f('0x11')]('UpdateVoiceAgentReport',_0x59fa73,JSON[_0x906f('0x13')](_0x324fc8));_0x557eea(_0x324fc8);})[_0x906f('0x18')](function(_0x52e0ef){logger[_0x906f('0x15')]('UpdateVoiceAgentReport',_0x52e0ef[_0x906f('0x16')],_0x59fa73);_0x1cea5b(_0xf4fda8['error'](0x1f4,_0x52e0ef[_0x906f('0x16')]));});});}; \ No newline at end of file +var _0x237c=['client','http','request','info','request\x20sent','debug','error','code','VoiceAgentReport,\x20%s,\x20%s','message','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','then','stringify','catch','UpdateVoiceAgentReport','where','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x237c,0x154));var _0xc237=function(_0x262914,_0x22f664){_0x262914=_0x262914-0x0;var _0x18e2c9=_0x237c[_0x262914];return _0x18e2c9;};'use strict';var _=require('lodash');var util=require(_0xc237('0x0'));var moment=require(_0xc237('0x1'));var BPromise=require(_0xc237('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc237('0x3'));var db=require(_0xc237('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc237('0x5'))('rpc');var config=require(_0xc237('0x6'));var jayson=require(_0xc237('0x7'));var client=jayson[_0xc237('0x8')][_0xc237('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb259af,_0x29566c,_0xbb0520){return new BPromise(function(_0x2f8ac6,_0x22b0e6){return client[_0xc237('0xa')](_0xb259af,_0xbb0520)['then'](function(_0x58300c){logger[_0xc237('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x29566c,_0xc237('0xc'));logger[_0xc237('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x29566c,_0xc237('0xc'),JSON['stringify'](_0x58300c));if(_0x58300c['error']){if(_0x58300c[_0xc237('0xe')][_0xc237('0xf')]===0x1f4){logger[_0xc237('0xe')](_0xc237('0x10'),_0x29566c,_0x58300c['error'][_0xc237('0x11')]);return _0x22b0e6(_0x58300c[_0xc237('0xe')]['message']);}logger[_0xc237('0xe')](_0xc237('0x10'),_0x29566c,_0x58300c[_0xc237('0xe')][_0xc237('0x11')]);return _0x2f8ac6(_0x58300c[_0xc237('0xe')][_0xc237('0x11')]);}else{logger[_0xc237('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x29566c,_0xc237('0xc'));_0x2f8ac6(_0x58300c['result']['message']);}})['catch'](function(_0x3be21d){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x29566c,_0x3be21d);_0x22b0e6(_0x3be21d);});});}exports[_0xc237('0x12')]=function(_0x30fad6){var _0x1d6533=this;return new Promise(function(_0xcc6b50,_0x50ab52){return db[_0xc237('0x13')]['create'](_0x30fad6[_0xc237('0x14')],{'raw':_0x30fad6['options']?_0x30fad6[_0xc237('0x15')][_0xc237('0x16')]===undefined?!![]:![]:!![]})[_0xc237('0x17')](function(_0x4ad30a){logger[_0xc237('0xb')](_0xc237('0x12'),_0x30fad6);logger[_0xc237('0xd')](_0xc237('0x12'),_0x30fad6,JSON[_0xc237('0x18')](_0x4ad30a));_0xcc6b50(_0x4ad30a);})[_0xc237('0x19')](function(_0x26ecb5){logger[_0xc237('0xe')](_0xc237('0x12'),_0x26ecb5[_0xc237('0x11')],_0x30fad6);_0x50ab52(_0x1d6533['error'](0x1f4,_0x26ecb5[_0xc237('0x11')]));});});};exports[_0xc237('0x1a')]=function(_0x1596d9){var _0x50042b=this;return new Promise(function(_0x92d02a,_0x4f7719){return db['VoiceAgentReport']['update'](_0x1596d9['body'],{'raw':_0x1596d9['options']?_0x1596d9[_0xc237('0x15')][_0xc237('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1596d9[_0xc237('0x15')]?_0x1596d9['options'][_0xc237('0x1b')]||null:null,'attributes':_0x1596d9[_0xc237('0x15')]?_0x1596d9[_0xc237('0x15')]['attributes']||null:null,'limit':_0x1596d9[_0xc237('0x15')]?_0x1596d9[_0xc237('0x15')][_0xc237('0x1c')]||null:null})[_0xc237('0x17')](function(_0x14982f){logger[_0xc237('0xb')](_0xc237('0x1a'),_0x1596d9);logger['debug'](_0xc237('0x1a'),_0x1596d9,JSON[_0xc237('0x18')](_0x14982f));_0x92d02a(_0x14982f);})[_0xc237('0x19')](function(_0x21c021){logger['error'](_0xc237('0x1a'),_0x21c021[_0xc237('0x11')],_0x1596d9);_0x4f7719(_0x50042b[_0xc237('0xe')](0x1f4,_0x21c021[_0xc237('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index b75f166..c3254cd 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 _0x98a8=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports'];(function(_0x551e6b,_0x378961){var _0x5e35cb=function(_0x11f67e){while(--_0x11f67e){_0x551e6b['push'](_0x551e6b['shift']());}};_0x5e35cb(++_0x378961);}(_0x98a8,0x12c));var _0x898a=function(_0xe8044,_0x2106d1){_0xe8044=_0xe8044-0x0;var _0x5d0a43=_0x98a8[_0xe8044];return _0x5d0a43;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var fs_extra=require(_0x898a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var controller=require(_0x898a('0x9'));router[_0x898a('0xa')]('/',auth[_0x898a('0xb')](),controller['index']);router[_0x898a('0xa')]('/describe',auth[_0x898a('0xb')](),controller['describe']);router[_0x898a('0xa')](_0x898a('0xc'),auth[_0x898a('0xb')](),controller[_0x898a('0xd')]);router[_0x898a('0xe')]('/',auth[_0x898a('0xb')](),controller[_0x898a('0xf')]);router[_0x898a('0x10')](_0x898a('0xc'),auth['isAuthenticated'](),controller[_0x898a('0x11')]);router['delete'](_0x898a('0xc'),auth['isAuthenticated'](),controller[_0x898a('0x12')]);module[_0x898a('0x13')]=router; \ No newline at end of file +var _0xaba6=['destroy','exports','multer','util','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','post','create','put','update'];(function(_0x28f5af,_0x3deb07){var _0x1fac50=function(_0x2dc19a){while(--_0x2dc19a){_0x28f5af['push'](_0x28f5af['shift']());}};_0x1fac50(++_0x3deb07);}(_0xaba6,0xe2));var _0x6aba=function(_0x4dd15b,_0x1d880a){_0x4dd15b=_0x4dd15b-0x0;var _0x2445f2=_0xaba6[_0x4dd15b];return _0x2445f2;};'use strict';var multer=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6aba('0x2'));var auth=require(_0x6aba('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6aba('0x4'));var controller=require(_0x6aba('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6aba('0x6')]('/describe',auth[_0x6aba('0x7')](),controller[_0x6aba('0x8')]);router['get'](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller['show']);router[_0x6aba('0xa')]('/',auth[_0x6aba('0x7')](),controller[_0x6aba('0xb')]);router[_0x6aba('0xc')](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xd')]);router['delete'](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xe')]);module[_0x6aba('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 413c78a..48eaab1 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 _0xd448=['internal','outbound','inbound-fax','outbound-fax','dialer','DATE','INTEGER','exports','STRING','ENUM','inbound'];(function(_0x4cb169,_0x204f7f){var _0x318884=function(_0x38fab3){while(--_0x38fab3){_0x4cb169['push'](_0x4cb169['shift']());}};_0x318884(++_0x204f7f);}(_0xd448,0x172));var _0x8d44=function(_0x190955,_0x4e4272){_0x190955=_0x190955-0x0;var _0x1fe69b=_0xd448[_0x190955];return _0x1fe69b;};'use strict';var Sequelize=require('sequelize');module[_0x8d44('0x0')]={'uniqueid':{'type':Sequelize[_0x8d44('0x1')]},'type':{'type':Sequelize[_0x8d44('0x2')](_0x8d44('0x3'),_0x8d44('0x4'),_0x8d44('0x5'),_0x8d44('0x6'),_0x8d44('0x7'),_0x8d44('0x8'))},'tag':{'type':Sequelize[_0x8d44('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x8d44('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8d44('0x1')]},'channel':{'type':Sequelize[_0x8d44('0x1')]},'destinationchannel':{'type':Sequelize[_0x8d44('0x1')]},'lastapplication':{'type':Sequelize[_0x8d44('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x8d44('0x9')]},'systemanswertime':{'type':Sequelize[_0x8d44('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x8d44('0xa')]},'billableseconds':{'type':Sequelize[_0x8d44('0xa')]},'mohtime':{'type':Sequelize[_0x8d44('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x8d44('0x1')]},'userfield':{'type':Sequelize[_0x8d44('0x1')]},'userDisposition':{'type':Sequelize[_0x8d44('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x8d44('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8d44('0x1')]},'prefix':{'type':Sequelize[_0x8d44('0x1')]},'routeid':{'type':Sequelize[_0x8d44('0xa')]},'sipcallid':{'type':Sequelize[_0x8d44('0x1')]}}; \ No newline at end of file +var _0x7462=['inbound-fax','outbound-fax','STRING','DATE','INTEGER','sequelize','exports','inbound'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x7462,0x165));var _0x2746=function(_0x4a0f16,_0x21ba18){_0x4a0f16=_0x4a0f16-0x0;var _0x45d653=_0x7462[_0x4a0f16];return _0x45d653;};'use strict';var Sequelize=require(_0x2746('0x0'));module[_0x2746('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x2746('0x2'),'internal','outbound',_0x2746('0x3'),_0x2746('0x4'),'dialer')},'tag':{'type':Sequelize[_0x2746('0x5')]},'accountcode':{'type':Sequelize[_0x2746('0x5')]},'source':{'type':Sequelize[_0x2746('0x5')]},'destination':{'type':Sequelize[_0x2746('0x5')]},'destinationcontext':{'type':Sequelize[_0x2746('0x5')]},'callerid':{'type':Sequelize[_0x2746('0x5')]},'channel':{'type':Sequelize[_0x2746('0x5')]},'destinationchannel':{'type':Sequelize[_0x2746('0x5')]},'lastapplication':{'type':Sequelize[_0x2746('0x5')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x2746('0x6')]},'systemanswertime':{'type':Sequelize[_0x2746('0x6')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x2746('0x6')]},'duration':{'type':Sequelize[_0x2746('0x7')]},'billableseconds':{'type':Sequelize[_0x2746('0x7')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2746('0x5')]},'amaflags':{'type':Sequelize[_0x2746('0x5')]},'userfield':{'type':Sequelize[_0x2746('0x5')]},'userDisposition':{'type':Sequelize[_0x2746('0x5')]},'userSecondDisposition':{'type':Sequelize[_0x2746('0x5')]},'userThirdDisposition':{'type':Sequelize[_0x2746('0x5')]},'note':{'type':Sequelize[_0x2746('0x5')]},'prefix':{'type':Sequelize[_0x2746('0x5')]},'routeid':{'type':Sequelize[_0x2746('0x7')]},'sipcallid':{'type':Sequelize[_0x2746('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 44b2e0e..470829c 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 _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x28bafe,_0x23ada9){var _0x888a65=function(_0x2eba07){while(--_0x2eba07){_0x28bafe['push'](_0x28bafe['shift']());}};_0x888a65(++_0x23ada9);}(_0xdb28,0x106));var _0x8db2=function(_0x399494,_0x2230e9){_0x399494=_0x399494-0x0;var _0x4ed462=_0xdb28[_0x399494];return _0x4ed462;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 5bd4f1c..31d569f 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 _0xdb75=['path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x149b82,_0x15af5d){var _0x1952c9=function(_0x452b9b){while(--_0x452b9b){_0x149b82['push'](_0x149b82['shift']());}};_0x1952c9(++_0x15af5d);}(_0xdb75,0xae));var _0x5db7=function(_0x3682ad,_0x3d954f){_0x3682ad=_0x3682ad-0x0;var _0x212ff3=_0xdb75[_0x3682ad];return _0x212ff3;};'use strict';var _=require(_0x5db7('0x0'));var util=require(_0x5db7('0x1'));var logger=require(_0x5db7('0x2'))(_0x5db7('0x3'));var moment=require(_0x5db7('0x4'));var BPromise=require('bluebird');var rp=require(_0x5db7('0x5'));var fs=require('fs');var path=require(_0x5db7('0x6'));var rimraf=require(_0x5db7('0x7'));var config=require(_0x5db7('0x8'));var attributes=require(_0x5db7('0x9'));module[_0x5db7('0xa')]=function(_0x4a14be,_0x3344ef){return _0x4a14be[_0x5db7('0xb')](_0x5db7('0xc'),attributes,{'tableName':_0x5db7('0xd'),'paranoid':![],'indexes':[{'fields':[_0x5db7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2b42=['../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x2b42,0xe7));var _0x22b4=function(_0x3babb2,_0x4e832d){_0x3babb2=_0x3babb2-0x0;var _0x43e8fd=_0x2b42[_0x3babb2];return _0x43e8fd;};'use strict';var _=require('lodash');var util=require(_0x22b4('0x0'));var logger=require('../../config/logger')(_0x22b4('0x1'));var moment=require(_0x22b4('0x2'));var BPromise=require(_0x22b4('0x3'));var rp=require(_0x22b4('0x4'));var fs=require('fs');var path=require(_0x22b4('0x5'));var rimraf=require(_0x22b4('0x6'));var config=require(_0x22b4('0x7'));var attributes=require(_0x22b4('0x8'));module[_0x22b4('0x9')]=function(_0x4a6328,_0x44f3a2){return _0x4a6328[_0x22b4('0xa')](_0x22b4('0xb'),attributes,{'tableName':_0x22b4('0xc'),'paranoid':![],'indexes':[{'fields':[_0x22b4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index c708789..2ed7207 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 _0x762d=['include','then','stringify','VoiceCallReport','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','VoiceCallReport,\x20%s,\x20%s','info','catch','GetVoiceCallReport','options','raw','where','attributes','limit','map','model'];(function(_0x2cdccd,_0x213fe8){var _0x56a145=function(_0x4fa90e){while(--_0x4fa90e){_0x2cdccd['push'](_0x2cdccd['shift']());}};_0x56a145(++_0x213fe8);}(_0x762d,0x104));var _0xd762=function(_0x506786,_0x3d7ec5){_0x506786=_0x506786-0x0;var _0x898449=_0x762d[_0x506786];return _0x898449;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd762('0x0'));var BPromise=require(_0xd762('0x1'));var rs=require(_0xd762('0x2'));var fs=require('fs');var Redis=require(_0xd762('0x3'));var db=require(_0xd762('0x4'))['db'];var utils=require(_0xd762('0x5'));var logger=require(_0xd762('0x6'))('rpc');var config=require(_0xd762('0x7'));var jayson=require(_0xd762('0x8'));var client=jayson['client'][_0xd762('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e1357,_0x538de1,_0x2f00f5){return new BPromise(function(_0xaae3eb,_0x4271b6){return client[_0xd762('0xa')](_0x5e1357,_0x2f00f5)['then'](function(_0x1fdeeb){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x538de1,'request\x20sent');logger[_0xd762('0xb')](_0xd762('0xc'),_0x538de1,_0xd762('0xd'),JSON['stringify'](_0x1fdeeb));if(_0x1fdeeb[_0xd762('0xe')]){if(_0x1fdeeb[_0xd762('0xe')][_0xd762('0xf')]===0x1f4){logger[_0xd762('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x538de1,_0x1fdeeb['error'][_0xd762('0x10')]);return _0x4271b6(_0x1fdeeb[_0xd762('0xe')][_0xd762('0x10')]);}logger[_0xd762('0xe')](_0xd762('0x11'),_0x538de1,_0x1fdeeb['error'][_0xd762('0x10')]);return _0xaae3eb(_0x1fdeeb[_0xd762('0xe')][_0xd762('0x10')]);}else{logger[_0xd762('0x12')](_0xd762('0x11'),_0x538de1,_0xd762('0xd'));_0xaae3eb(_0x1fdeeb['result'][_0xd762('0x10')]);}})[_0xd762('0x13')](function(_0x39c4f9){logger[_0xd762('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x538de1,_0x39c4f9);_0x4271b6(_0x39c4f9);});});}exports[_0xd762('0x14')]=function(_0x2a0dea){var _0xe57866=this;return new Promise(function(_0x5ce0cd,_0x3347c7){return db['VoiceCallReport']['findAll']({'raw':_0x2a0dea[_0xd762('0x15')]?_0x2a0dea[_0xd762('0x15')][_0xd762('0x16')]===undefined?!![]:![]:!![],'where':_0x2a0dea['options']?_0x2a0dea[_0xd762('0x15')][_0xd762('0x17')]||null:null,'attributes':_0x2a0dea[_0xd762('0x15')]?_0x2a0dea['options'][_0xd762('0x18')]||null:null,'limit':_0x2a0dea[_0xd762('0x15')]?_0x2a0dea['options'][_0xd762('0x19')]||null:null,'include':_0x2a0dea[_0xd762('0x15')]?_0x2a0dea[_0xd762('0x15')]['include']?_[_0xd762('0x1a')](_0x2a0dea[_0xd762('0x15')]['include'],function(_0x1a7e5b){return{'model':db[_0x1a7e5b[_0xd762('0x1b')]],'as':_0x1a7e5b['as'],'attributes':_0x1a7e5b['attributes'],'include':_0x1a7e5b[_0xd762('0x1c')]?_[_0xd762('0x1a')](_0x1a7e5b[_0xd762('0x1c')],function(_0x1b420d){return{'model':db[_0x1b420d['model']],'as':_0x1b420d['as'],'attributes':_0x1b420d['attributes'],'include':_0x1b420d[_0xd762('0x1c')]?_[_0xd762('0x1a')](_0x1b420d[_0xd762('0x1c')],function(_0x4e8b80){return{'model':db[_0x4e8b80['model']],'as':_0x4e8b80['as'],'attributes':_0x4e8b80['attributes']};}):[]};}):[]};}):[]:[]})[_0xd762('0x1d')](function(_0x4c7a3d){logger[_0xd762('0x12')]('GetVoiceCallReport',_0x2a0dea);logger[_0xd762('0xb')]('GetVoiceCallReport',_0x2a0dea,JSON[_0xd762('0x1e')](_0x4c7a3d));_0x5ce0cd(_0x4c7a3d);})[_0xd762('0x13')](function(_0x3a1fc5){logger[_0xd762('0xe')]('GetVoiceCallReport',_0x3a1fc5['message'],_0x2a0dea);_0x3347c7(_0xe57866['error'](0x1f4,_0x3a1fc5[_0xd762('0x10')]));});});};exports['CreateVoiceCallReport']=function(_0x4a051d){var _0x3d4bdd=this;return new Promise(function(_0x18080a,_0x42ae2e){return db[_0xd762('0x1f')][_0xd762('0x20')](_0x4a051d[_0xd762('0x21')],{'raw':_0x4a051d[_0xd762('0x15')]?_0x4a051d[_0xd762('0x15')][_0xd762('0x16')]===undefined?!![]:![]:!![]})[_0xd762('0x1d')](function(_0x2a2656){logger['info'](_0xd762('0x22'),_0x4a051d);logger['debug'](_0xd762('0x22'),_0x4a051d,JSON[_0xd762('0x1e')](_0x2a2656));_0x18080a(_0x2a2656);})[_0xd762('0x13')](function(_0x5e866f){logger[_0xd762('0xe')](_0xd762('0x22'),_0x5e866f[_0xd762('0x10')],_0x4a051d);_0x42ae2e(_0x3d4bdd['error'](0x1f4,_0x5e866f['message']));});});};exports['UpdateVoiceCallReport']=function(_0x429d09){var _0x1c0bcf=this;return new Promise(function(_0x443aa6,_0x5f0ea4){return db[_0xd762('0x1f')]['update'](_0x429d09[_0xd762('0x21')],{'raw':_0x429d09['options']?_0x429d09[_0xd762('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x429d09[_0xd762('0x15')]?_0x429d09[_0xd762('0x15')][_0xd762('0x17')]||null:null,'attributes':_0x429d09[_0xd762('0x15')]?_0x429d09[_0xd762('0x15')][_0xd762('0x18')]||null:null,'limit':_0x429d09['options']?_0x429d09[_0xd762('0x15')][_0xd762('0x19')]||null:null})['then'](function(_0x3f9ed1){logger[_0xd762('0x12')](_0xd762('0x23'),_0x429d09);logger['debug'](_0xd762('0x23'),_0x429d09,JSON[_0xd762('0x1e')](_0x3f9ed1));_0x443aa6(_0x3f9ed1);})[_0xd762('0x13')](function(_0x3abf49){logger[_0xd762('0xe')]('UpdateVoiceCallReport',_0x3abf49[_0xd762('0x10')],_0x429d09);_0x5f0ea4(_0x1c0bcf[_0xd762('0xe')](0x1f4,_0x3abf49[_0xd762('0x10')]));});});}; \ No newline at end of file +var _0x7a73=['http','request','then','request\x20sent','debug','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','VoiceCallReport','findAll','raw','options','where','include','map','model','attributes','info','GetVoiceCallReport','catch','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','body','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0x7a73,0x65));var _0x37a7=function(_0x22d8bc,_0x129a20){_0x22d8bc=_0x22d8bc-0x0;var _0x5ed782=_0x7a73[_0x22d8bc];return _0x5ed782;};'use strict';var _=require(_0x37a7('0x0'));var util=require(_0x37a7('0x1'));var moment=require(_0x37a7('0x2'));var BPromise=require(_0x37a7('0x3'));var rs=require(_0x37a7('0x4'));var fs=require('fs');var Redis=require(_0x37a7('0x5'));var db=require(_0x37a7('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x37a7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2894cc,_0x335de1,_0x47d22b){return new BPromise(function(_0x4705b0,_0x58a2db){return client[_0x37a7('0x8')](_0x2894cc,_0x47d22b)[_0x37a7('0x9')](function(_0x560c39){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x335de1,_0x37a7('0xa'));logger[_0x37a7('0xb')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x335de1,_0x37a7('0xa'),JSON[_0x37a7('0xc')](_0x560c39));if(_0x560c39[_0x37a7('0xd')]){if(_0x560c39[_0x37a7('0xd')][_0x37a7('0xe')]===0x1f4){logger[_0x37a7('0xd')](_0x37a7('0xf'),_0x335de1,_0x560c39[_0x37a7('0xd')][_0x37a7('0x10')]);return _0x58a2db(_0x560c39[_0x37a7('0xd')][_0x37a7('0x10')]);}logger[_0x37a7('0xd')](_0x37a7('0xf'),_0x335de1,_0x560c39[_0x37a7('0xd')][_0x37a7('0x10')]);return _0x4705b0(_0x560c39[_0x37a7('0xd')][_0x37a7('0x10')]);}else{logger['info'](_0x37a7('0xf'),_0x335de1,_0x37a7('0xa'));_0x4705b0(_0x560c39[_0x37a7('0x11')][_0x37a7('0x10')]);}})['catch'](function(_0x89914){logger['error'](_0x37a7('0xf'),_0x335de1,_0x89914);_0x58a2db(_0x89914);});});}exports['GetVoiceCallReport']=function(_0xf526a6){var _0x111d52=this;return new Promise(function(_0x549802,_0x406c12){return db[_0x37a7('0x12')][_0x37a7('0x13')]({'raw':_0xf526a6['options']?_0xf526a6['options'][_0x37a7('0x14')]===undefined?!![]:![]:!![],'where':_0xf526a6[_0x37a7('0x15')]?_0xf526a6[_0x37a7('0x15')][_0x37a7('0x16')]||null:null,'attributes':_0xf526a6[_0x37a7('0x15')]?_0xf526a6[_0x37a7('0x15')]['attributes']||null:null,'limit':_0xf526a6[_0x37a7('0x15')]?_0xf526a6[_0x37a7('0x15')]['limit']||null:null,'include':_0xf526a6[_0x37a7('0x15')]?_0xf526a6[_0x37a7('0x15')][_0x37a7('0x17')]?_[_0x37a7('0x18')](_0xf526a6[_0x37a7('0x15')][_0x37a7('0x17')],function(_0x879003){return{'model':db[_0x879003[_0x37a7('0x19')]],'as':_0x879003['as'],'attributes':_0x879003[_0x37a7('0x1a')],'include':_0x879003[_0x37a7('0x17')]?_[_0x37a7('0x18')](_0x879003[_0x37a7('0x17')],function(_0x175a29){return{'model':db[_0x175a29['model']],'as':_0x175a29['as'],'attributes':_0x175a29[_0x37a7('0x1a')],'include':_0x175a29['include']?_[_0x37a7('0x18')](_0x175a29[_0x37a7('0x17')],function(_0x4f516b){return{'model':db[_0x4f516b[_0x37a7('0x19')]],'as':_0x4f516b['as'],'attributes':_0x4f516b[_0x37a7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x37a7('0x9')](function(_0x113d6a){logger[_0x37a7('0x1b')](_0x37a7('0x1c'),_0xf526a6);logger[_0x37a7('0xb')](_0x37a7('0x1c'),_0xf526a6,JSON[_0x37a7('0xc')](_0x113d6a));_0x549802(_0x113d6a);})[_0x37a7('0x1d')](function(_0x125412){logger[_0x37a7('0xd')](_0x37a7('0x1c'),_0x125412[_0x37a7('0x10')],_0xf526a6);_0x406c12(_0x111d52[_0x37a7('0xd')](0x1f4,_0x125412[_0x37a7('0x10')]));});});};exports[_0x37a7('0x1e')]=function(_0x476937){var _0x3d75b3=this;return new Promise(function(_0x3f5d62,_0x3ac8d9){return db[_0x37a7('0x12')][_0x37a7('0x1f')](_0x476937['body'],{'raw':_0x476937[_0x37a7('0x15')]?_0x476937[_0x37a7('0x15')][_0x37a7('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x2f0063){logger['info']('CreateVoiceCallReport',_0x476937);logger[_0x37a7('0xb')](_0x37a7('0x1e'),_0x476937,JSON[_0x37a7('0xc')](_0x2f0063));_0x3f5d62(_0x2f0063);})[_0x37a7('0x1d')](function(_0x1b3b55){logger['error']('CreateVoiceCallReport',_0x1b3b55[_0x37a7('0x10')],_0x476937);_0x3ac8d9(_0x3d75b3[_0x37a7('0xd')](0x1f4,_0x1b3b55[_0x37a7('0x10')]));});});};exports[_0x37a7('0x20')]=function(_0x3ed079){var _0x4e5bd6=this;return new Promise(function(_0x494b46,_0x14395d){return db[_0x37a7('0x12')][_0x37a7('0x21')](_0x3ed079[_0x37a7('0x22')],{'raw':_0x3ed079[_0x37a7('0x15')]?_0x3ed079['options'][_0x37a7('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ed079['options']?_0x3ed079[_0x37a7('0x15')][_0x37a7('0x16')]||null:null,'attributes':_0x3ed079[_0x37a7('0x15')]?_0x3ed079['options'][_0x37a7('0x1a')]||null:null,'limit':_0x3ed079[_0x37a7('0x15')]?_0x3ed079[_0x37a7('0x15')][_0x37a7('0x23')]||null:null})['then'](function(_0x4c4969){logger[_0x37a7('0x1b')](_0x37a7('0x20'),_0x3ed079);logger[_0x37a7('0xb')](_0x37a7('0x20'),_0x3ed079,JSON[_0x37a7('0xc')](_0x4c4969));_0x494b46(_0x4c4969);})[_0x37a7('0x1d')](function(_0x23df8a){logger[_0x37a7('0xd')](_0x37a7('0x20'),_0x23df8a['message'],_0x3ed079);_0x14395d(_0x4e5bd6[_0x37a7('0xd')](0x1f4,_0x23df8a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index eff560e..81ff5c8 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 _0x8237=['index','get','/:id','show','post','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0x8237,0x7a));var _0x7823=function(_0x563661,_0x3047c4){_0x563661=_0x563661-0x0;var _0x20028c=_0x8237[_0x563661];return _0x20028c;};'use strict';var multer=require(_0x7823('0x0'));var util=require(_0x7823('0x1'));var path=require(_0x7823('0x2'));var timeout=require(_0x7823('0x3'));var express=require(_0x7823('0x4'));var router=express[_0x7823('0x5')]();var fs_extra=require(_0x7823('0x6'));var auth=require(_0x7823('0x7'));var interaction=require(_0x7823('0x8'));var config=require(_0x7823('0x9'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x7823('0xa')](),controller[_0x7823('0xb')]);router[_0x7823('0xc')](_0x7823('0xd'),auth[_0x7823('0xa')](),controller[_0x7823('0xe')]);router[_0x7823('0xf')]('/',auth[_0x7823('0xa')](),controller['create']);router[_0x7823('0x10')](_0x7823('0xd'),auth[_0x7823('0xa')](),controller[_0x7823('0x11')]);router[_0x7823('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9dc5=['post','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show'];(function(_0x3b8222,_0x923d4e){var _0x19bdba=function(_0x1b03c1){while(--_0x1b03c1){_0x3b8222['push'](_0x3b8222['shift']());}};_0x19bdba(++_0x923d4e);}(_0x9dc5,0x1c7));var _0x59dc=function(_0x56b6ce,_0x39626e){_0x56b6ce=_0x56b6ce-0x0;var _0x6b30d5=_0x9dc5[_0x56b6ce];return _0x6b30d5;};'use strict';var multer=require(_0x59dc('0x0'));var util=require(_0x59dc('0x1'));var path=require(_0x59dc('0x2'));var timeout=require('connect-timeout');var express=require(_0x59dc('0x3'));var router=express[_0x59dc('0x4')]();var fs_extra=require(_0x59dc('0x5'));var auth=require(_0x59dc('0x6'));var interaction=require(_0x59dc('0x7'));var config=require(_0x59dc('0x8'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x59dc('0x9')](),controller[_0x59dc('0xa')]);router['get'](_0x59dc('0xb'),auth[_0x59dc('0x9')](),controller[_0x59dc('0xc')]);router[_0x59dc('0xd')]('/',auth[_0x59dc('0x9')](),controller['create']);router[_0x59dc('0xe')]('/:id',auth[_0x59dc('0x9')](),controller[_0x59dc('0xf')]);router[_0x59dc('0x10')](_0x59dc('0xb'),auth[_0x59dc('0x9')](),controller['destroy']);module[_0x59dc('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index f5ac568..51ae4ad 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 _0x09fa=['split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','join','options'];(function(_0x566c9a,_0x449918){var _0x2f6ca4=function(_0x102caf){while(--_0x102caf){_0x566c9a['push'](_0x566c9a['shift']());}};_0x2f6ca4(++_0x449918);}(_0x09fa,0xda));var _0xa09f=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x09fa[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require(_0xa09f('0x0'));module[_0xa09f('0x1')]={'name':{'type':Sequelize[_0xa09f('0x2')]},'prefix':{'type':Sequelize[_0xa09f('0x2')],'unique':_0xa09f('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x27a649){this[_0xa09f('0x4')]('options',_0x27a649?_0x27a649[_0xa09f('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xa09f('0x6'))?this['getDataValue']('options')[_0xa09f('0x7')](''):[];}},'auth':{'type':Sequelize[_0xa09f('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xa09f('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xa09f('0x2')]},'description':{'type':Sequelize[_0xa09f('0x2')]}}; \ No newline at end of file +var _0xff53=['split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join','getDataValue'];(function(_0x10b862,_0x1089bf){var _0x2885dd=function(_0x594d13){while(--_0x594d13){_0x10b862['push'](_0x10b862['shift']());}};_0x2885dd(++_0x1089bf);}(_0xff53,0x11a));var _0x3ff5=function(_0x1e0e55,_0x239050){_0x1e0e55=_0x1e0e55-0x0;var _0x1c4963=_0xff53[_0x1e0e55];return _0x1c4963;};'use strict';var Sequelize=require(_0x3ff5('0x0'));module[_0x3ff5('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x3ff5('0x2')],'unique':_0x3ff5('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x3ff5('0x2')],'set':function(_0x37f58a){this[_0x3ff5('0x4')](_0x3ff5('0x5'),_0x37f58a?_0x37f58a[_0x3ff5('0x6')](''):[]);},'get':function(){return this[_0x3ff5('0x7')](_0x3ff5('0x5'))?this[_0x3ff5('0x7')](_0x3ff5('0x5'))[_0x3ff5('0x8')](''):[];}},'auth':{'type':Sequelize[_0x3ff5('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x3ff5('0x2')]},'record':{'type':Sequelize[_0x3ff5('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x3ff5('0x2')]},'description':{'type':Sequelize[_0x3ff5('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 8fb002a..1d9f386 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 _0x3a25=['find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x180a7f,_0x40033d){var _0x537e6d=function(_0x2af020){while(--_0x2af020){_0x180a7f['push'](_0x180a7f['shift']());}};_0x537e6d(++_0x40033d);}(_0x3a25,0x15d));var _0x53a2=function(_0x2be480,_0x186992){_0x2be480=_0x2be480-0x0;var _0x2bbd04=_0x3a25[_0x2be480];return _0x2bbd04;};'use strict';var emlformat=require(_0x53a2('0x0'));var rimraf=require(_0x53a2('0x1'));var zipdir=require(_0x53a2('0x2'));var jsonpatch=require(_0x53a2('0x3'));var rp=require(_0x53a2('0x4'));var moment=require(_0x53a2('0x5'));var BPromise=require(_0x53a2('0x6'));var Mustache=require(_0x53a2('0x7'));var util=require(_0x53a2('0x8'));var path=require(_0x53a2('0x9'));var sox=require(_0x53a2('0xa'));var csv=require(_0x53a2('0xb'));var ejs=require(_0x53a2('0xc'));var fs=require('fs');var fs_extra=require(_0x53a2('0xd'));var _=require(_0x53a2('0xe'));var squel=require('squel');var crypto=require(_0x53a2('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x53a2('0x10'));var toCsv=require(_0x53a2('0xb'));var querystring=require(_0x53a2('0x11'));var Papa=require(_0x53a2('0x12'));var Redis=require(_0x53a2('0x13'));var authService=require(_0x53a2('0x14'));var qs=require(_0x53a2('0x15'));var as=require(_0x53a2('0x16'));var hardwareService=require(_0x53a2('0x17'));var logger=require(_0x53a2('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x53a2('0x19'));var licenseUtil=require(_0x53a2('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x564ca9,_0x47881a){_0x47881a=_0x47881a||0xcc;return function(_0x410370){if(_0x410370){return _0x564ca9[_0x53a2('0x1b')](_0x47881a);}return _0x564ca9[_0x53a2('0x1c')](_0x47881a)['end']();};}function respondWithResult(_0x58070c,_0x4e2228){_0x4e2228=_0x4e2228||0xc8;return function(_0x9c14b7){if(_0x9c14b7){return _0x58070c[_0x53a2('0x1c')](_0x4e2228)[_0x53a2('0x1d')](_0x9c14b7);}};}function respondWithFilteredResult(_0xf9b589,_0x4d3a40){return function(_0x1779ef){if(_0x1779ef){var _0x3343d3=typeof _0x4d3a40[_0x53a2('0x1e')]===_0x53a2('0x1f')&&typeof _0x4d3a40[_0x53a2('0x20')]==='undefined';var _0x485c4d=_0x1779ef[_0x53a2('0x21')];var _0x446b71=_0x3343d3?0x0:_0x4d3a40[_0x53a2('0x1e')];var _0x104fb6=_0x3343d3?_0x1779ef[_0x53a2('0x21')]:_0x4d3a40[_0x53a2('0x1e')]+_0x4d3a40['limit'];var _0x589666;if(_0x104fb6>=_0x485c4d){_0x104fb6=_0x485c4d;_0x589666=0xc8;}else{_0x589666=0xce;}_0xf9b589[_0x53a2('0x1c')](_0x589666);return _0xf9b589[_0x53a2('0x22')]('Content-Range',_0x446b71+'-'+_0x104fb6+'/'+_0x485c4d)[_0x53a2('0x1d')](_0x1779ef);}return null;};}function patchUpdates(_0x3fb15b){return function(_0x3efc90){try{jsonpatch[_0x53a2('0x23')](_0x3efc90,_0x3fb15b,!![]);}catch(_0x503e9b){return BPromise[_0x53a2('0x24')](_0x503e9b);}return _0x3efc90[_0x53a2('0x25')]();};}function saveUpdates(_0xd9693c,_0x2cda68){return function(_0x42df19){if(_0x42df19){return _0x42df19[_0x53a2('0x26')](_0xd9693c)[_0x53a2('0x27')](function(_0x3a769d){return _0x3a769d;});}return null;};}function removeEntity(_0x4a1a34,_0x579b10){return function(_0x473042){if(_0x473042){return _0x473042[_0x53a2('0x28')]()[_0x53a2('0x27')](function(){var _0x2852a1=_0x473042[_0x53a2('0x29')]({'plain':!![]});var _0xa39167='ChanSpies';return db[_0x53a2('0x2a')][_0x53a2('0x28')]({'where':{'type':_0xa39167,'resourceId':_0x2852a1['id']}})[_0x53a2('0x27')](function(){return _0x473042;});})[_0x53a2('0x27')](function(){_0x4a1a34[_0x53a2('0x1c')](0xcc)[_0x53a2('0x2b')]();});}};}function handleEntityNotFound(_0x21325d,_0x41ae20){return function(_0x2f2062){if(!_0x2f2062){_0x21325d[_0x53a2('0x1b')](0x194);}return _0x2f2062;};}function handleError(_0x18d6df,_0x31426e){_0x31426e=_0x31426e||0x1f4;return function(_0x262eba){logger[_0x53a2('0x2c')](_0x262eba[_0x53a2('0x2d')]);if(_0x262eba[_0x53a2('0x2e')]){delete _0x262eba[_0x53a2('0x2e')];}_0x18d6df['status'](_0x31426e)[_0x53a2('0x2f')](_0x262eba);};}exports[_0x53a2('0x30')]=function(_0x286e70,_0x23374b){var _0x18f091={},_0x2e0dfc={},_0x137541={'count':0x0,'rows':[]};var _0x1bf7b4=_[_0x53a2('0x31')](db[_0x53a2('0x32')][_0x53a2('0x33')],function(_0x4cb93b){return{'name':_0x4cb93b[_0x53a2('0x34')],'type':_0x4cb93b[_0x53a2('0x35')][_0x53a2('0x36')]};});_0x2e0dfc[_0x53a2('0x37')]=_[_0x53a2('0x31')](_0x1bf7b4,_0x53a2('0x2e'));_0x2e0dfc[_0x53a2('0x38')]=_[_0x53a2('0x39')](_0x286e70['query']);_0x2e0dfc[_0x53a2('0x3a')]=_[_0x53a2('0x3b')](_0x2e0dfc[_0x53a2('0x37')],_0x2e0dfc[_0x53a2('0x38')]);_0x18f091['attributes']=_[_0x53a2('0x3b')](_0x2e0dfc[_0x53a2('0x37')],qs[_0x53a2('0x3c')](_0x286e70[_0x53a2('0x38')][_0x53a2('0x3c')]));_0x18f091[_0x53a2('0x3d')]=_0x18f091['attributes'][_0x53a2('0x3e')]?_0x18f091[_0x53a2('0x3d')]:_0x2e0dfc[_0x53a2('0x37')];if(!_0x286e70['query'][_0x53a2('0x3f')]('nolimit')){_0x18f091[_0x53a2('0x20')]=qs[_0x53a2('0x20')](_0x286e70[_0x53a2('0x38')]['limit']);_0x18f091['offset']=qs[_0x53a2('0x1e')](_0x286e70['query'][_0x53a2('0x1e')]);}_0x18f091[_0x53a2('0x40')]=qs[_0x53a2('0x41')](_0x286e70[_0x53a2('0x38')][_0x53a2('0x41')]);_0x18f091[_0x53a2('0x42')]=qs['filters'](_[_0x53a2('0x43')](_0x286e70[_0x53a2('0x38')],_0x2e0dfc['filters']),_0x1bf7b4);if(_0x286e70['query'][_0x53a2('0x44')]){_0x18f091['where']=_[_0x53a2('0x45')](_0x18f091[_0x53a2('0x42')],{'$or':_['map'](_0x1bf7b4,function(_0x22fede){if(_0x22fede[_0x53a2('0x35')]!==_0x53a2('0x46')){var _0x1aa50d={};_0x1aa50d[_0x22fede[_0x53a2('0x2e')]]={'$like':'%'+_0x286e70['query'][_0x53a2('0x44')]+'%'};return _0x1aa50d;}})});}_0x18f091=_[_0x53a2('0x45')]({},_0x18f091,_0x286e70['options']);var _0x411b7b={'where':_0x18f091[_0x53a2('0x42')]};return db['VoiceChanSpy'][_0x53a2('0x21')](_0x411b7b)['then'](function(_0xd5bcc8){_0x137541[_0x53a2('0x21')]=_0xd5bcc8;if(_0x286e70[_0x53a2('0x38')][_0x53a2('0x47')]){_0x18f091[_0x53a2('0x48')]=[{'all':!![]}];}return db[_0x53a2('0x32')]['findAll'](_0x18f091);})[_0x53a2('0x27')](function(_0x33238d){_0x137541[_0x53a2('0x49')]=_0x33238d;return _0x137541;})[_0x53a2('0x27')](respondWithFilteredResult(_0x23374b,_0x18f091))[_0x53a2('0x4a')](handleError(_0x23374b,null));};exports[_0x53a2('0x4b')]=function(_0x3790c1,_0x426a88){var _0x382636={'raw':![],'where':{'id':_0x3790c1[_0x53a2('0x4c')]['id']}},_0x1b5fbe={};_0x1b5fbe[_0x53a2('0x37')]=_[_0x53a2('0x39')](db[_0x53a2('0x32')][_0x53a2('0x33')]);_0x1b5fbe[_0x53a2('0x38')]=_['keys'](_0x3790c1[_0x53a2('0x38')]);_0x1b5fbe[_0x53a2('0x3a')]=_['intersection'](_0x1b5fbe['model'],_0x1b5fbe[_0x53a2('0x38')]);_0x382636['attributes']=_['intersection'](_0x1b5fbe[_0x53a2('0x37')],qs[_0x53a2('0x3c')](_0x3790c1[_0x53a2('0x38')][_0x53a2('0x3c')]));_0x382636['attributes']=_0x382636['attributes']['length']?_0x382636[_0x53a2('0x3d')]:_0x1b5fbe['model'];if(_0x3790c1['query'][_0x53a2('0x47')]){_0x382636[_0x53a2('0x48')]=[{'all':!![]}];}_0x382636=_[_0x53a2('0x45')]({},_0x382636,_0x3790c1[_0x53a2('0x4d')]);return db[_0x53a2('0x32')]['find'](_0x382636)[_0x53a2('0x27')](handleEntityNotFound(_0x426a88,null))['then'](respondWithResult(_0x426a88,null))[_0x53a2('0x4a')](handleError(_0x426a88,null));};exports[_0x53a2('0x4e')]=function(_0x5baa46,_0x35fb2b){return db[_0x53a2('0x32')][_0x53a2('0x4e')](_0x5baa46[_0x53a2('0x4f')],{})[_0x53a2('0x27')](function(_0x6fd478){var _0x622575=_0x5baa46['user'][_0x53a2('0x29')]({'plain':!![]});if(!_0x622575)throw new Error(_0x53a2('0x50'));if(_0x622575[_0x53a2('0x51')]==='user'){var _0x36df41=_0x6fd478[_0x53a2('0x29')]({'plain':!![]});var _0x42238f=_0x53a2('0x52');return db[_0x53a2('0x53')]['find']({'where':{'name':_0x42238f,'userProfileId':_0x622575['userProfileId']},'raw':!![]})[_0x53a2('0x27')](function(_0x4f65a1){if(_0x4f65a1&&_0x4f65a1[_0x53a2('0x54')]===0x0){return db[_0x53a2('0x2a')]['create']({'name':_0x36df41['name'],'resourceId':_0x36df41['id'],'type':_0x4f65a1[_0x53a2('0x2e')],'sectionId':_0x4f65a1['id']},{})[_0x53a2('0x27')](function(){return _0x6fd478;});}else{return _0x6fd478;}})[_0x53a2('0x4a')](function(_0x5eae3e){logger['error'](_0x53a2('0x55'),_0x5eae3e);throw _0x5eae3e;});}return _0x6fd478;})[_0x53a2('0x27')](respondWithResult(_0x35fb2b,0xc9))[_0x53a2('0x4a')](handleError(_0x35fb2b,null));};exports[_0x53a2('0x26')]=function(_0xf722ed,_0x50e667){if(_0xf722ed[_0x53a2('0x4f')]['id']){delete _0xf722ed[_0x53a2('0x4f')]['id'];}return db[_0x53a2('0x32')][_0x53a2('0x56')]({'where':{'id':_0xf722ed[_0x53a2('0x4c')]['id']}})[_0x53a2('0x27')](handleEntityNotFound(_0x50e667,null))[_0x53a2('0x27')](saveUpdates(_0xf722ed['body'],null))[_0x53a2('0x27')](respondWithResult(_0x50e667,null))['catch'](handleError(_0x50e667,null));};exports[_0x53a2('0x28')]=function(_0x867db6,_0x3b91eb){return db[_0x53a2('0x32')]['find']({'where':{'id':_0x867db6[_0x53a2('0x4c')]['id']}})[_0x53a2('0x27')](handleEntityNotFound(_0x3b91eb,null))[_0x53a2('0x27')](removeEntity(_0x3b91eb,null))[_0x53a2('0x4a')](handleError(_0x3b91eb,null));}; \ No newline at end of file +var _0x65d2=['order','sort','where','filters','filter','type','VIRTUAL','merge','options','include','rows','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','then','get','ChanSpies','UserProfileResource','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','length','hasOwnProperty'];(function(_0xd0429a,_0x41c289){var _0xf89938=function(_0x5898d8){while(--_0x5898d8){_0xd0429a['push'](_0xd0429a['shift']());}};_0xf89938(++_0x41c289);}(_0x65d2,0xb8));var _0x265d=function(_0x2773d9,_0x52742a){_0x2773d9=_0x2773d9-0x0;var _0x48399c=_0x65d2[_0x2773d9];return _0x48399c;};'use strict';var emlformat=require(_0x265d('0x0'));var rimraf=require(_0x265d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x265d('0x2'));var rp=require(_0x265d('0x3'));var moment=require(_0x265d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x265d('0x5'));var util=require(_0x265d('0x6'));var path=require(_0x265d('0x7'));var sox=require('sox');var csv=require(_0x265d('0x8'));var ejs=require(_0x265d('0x9'));var fs=require('fs');var fs_extra=require(_0x265d('0xa'));var _=require(_0x265d('0xb'));var squel=require(_0x265d('0xc'));var crypto=require('crypto');var jsforce=require(_0x265d('0xd'));var deskjs=require(_0x265d('0xe'));var toCsv=require(_0x265d('0x8'));var querystring=require(_0x265d('0xf'));var Papa=require(_0x265d('0x10'));var Redis=require('ioredis');var authService=require(_0x265d('0x11'));var qs=require(_0x265d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x265d('0x13'));var logger=require(_0x265d('0x14'))(_0x265d('0x15'));var utils=require(_0x265d('0x16'));var config=require(_0x265d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x265d('0x18'))['db'];function respondWithStatusCode(_0x5540fa,_0x4c1ea2){_0x4c1ea2=_0x4c1ea2||0xcc;return function(_0x24cb9d){if(_0x24cb9d){return _0x5540fa[_0x265d('0x19')](_0x4c1ea2);}return _0x5540fa[_0x265d('0x1a')](_0x4c1ea2)[_0x265d('0x1b')]();};}function respondWithResult(_0x181344,_0x5e04f6){_0x5e04f6=_0x5e04f6||0xc8;return function(_0x97bfdf){if(_0x97bfdf){return _0x181344[_0x265d('0x1a')](_0x5e04f6)[_0x265d('0x1c')](_0x97bfdf);}};}function respondWithFilteredResult(_0x34eb0b,_0x21e99b){return function(_0x183f31){if(_0x183f31){var _0x29a163=typeof _0x21e99b[_0x265d('0x1d')]===_0x265d('0x1e')&&typeof _0x21e99b[_0x265d('0x1f')]===_0x265d('0x1e');var _0x74d2e7=_0x183f31[_0x265d('0x20')];var _0x1ab38c=_0x29a163?0x0:_0x21e99b[_0x265d('0x1d')];var _0x3e2dbe=_0x29a163?_0x183f31['count']:_0x21e99b[_0x265d('0x1d')]+_0x21e99b[_0x265d('0x1f')];var _0x2f8932;if(_0x3e2dbe>=_0x74d2e7){_0x3e2dbe=_0x74d2e7;_0x2f8932=0xc8;}else{_0x2f8932=0xce;}_0x34eb0b[_0x265d('0x1a')](_0x2f8932);return _0x34eb0b[_0x265d('0x21')]('Content-Range',_0x1ab38c+'-'+_0x3e2dbe+'/'+_0x74d2e7)['json'](_0x183f31);}return null;};}function patchUpdates(_0x3dc44b){return function(_0x1ff5b6){try{jsonpatch['apply'](_0x1ff5b6,_0x3dc44b,!![]);}catch(_0x408840){return BPromise['reject'](_0x408840);}return _0x1ff5b6['save']();};}function saveUpdates(_0x31be87,_0x24245b){return function(_0x36a480){if(_0x36a480){return _0x36a480[_0x265d('0x22')](_0x31be87)['then'](function(_0x1da376){return _0x1da376;});}return null;};}function removeEntity(_0xc821d2,_0x3304e5){return function(_0xf807aa){if(_0xf807aa){return _0xf807aa[_0x265d('0x23')]()[_0x265d('0x24')](function(){var _0x26e598=_0xf807aa[_0x265d('0x25')]({'plain':!![]});var _0x53301f=_0x265d('0x26');return db[_0x265d('0x27')][_0x265d('0x23')]({'where':{'type':_0x53301f,'resourceId':_0x26e598['id']}})[_0x265d('0x24')](function(){return _0xf807aa;});})[_0x265d('0x24')](function(){_0xc821d2[_0x265d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24391c,_0x1e6352){return function(_0x5d0126){if(!_0x5d0126){_0x24391c[_0x265d('0x19')](0x194);}return _0x5d0126;};}function handleError(_0x3e061b,_0x52b8d1){_0x52b8d1=_0x52b8d1||0x1f4;return function(_0x310904){logger['error'](_0x310904[_0x265d('0x28')]);if(_0x310904[_0x265d('0x29')]){delete _0x310904[_0x265d('0x29')];}_0x3e061b[_0x265d('0x1a')](_0x52b8d1)[_0x265d('0x2a')](_0x310904);};}exports[_0x265d('0x2b')]=function(_0xd09f13,_0x10cd43){var _0x213933={},_0x54a188={},_0x3f4acd={'count':0x0,'rows':[]};var _0x593f50=_[_0x265d('0x2c')](db[_0x265d('0x2d')][_0x265d('0x2e')],function(_0x3d271c){return{'name':_0x3d271c[_0x265d('0x2f')],'type':_0x3d271c['type'][_0x265d('0x30')]};});_0x54a188['model']=_[_0x265d('0x2c')](_0x593f50,_0x265d('0x29'));_0x54a188['query']=_[_0x265d('0x31')](_0xd09f13[_0x265d('0x32')]);_0x54a188['filters']=_[_0x265d('0x33')](_0x54a188[_0x265d('0x34')],_0x54a188[_0x265d('0x32')]);_0x213933[_0x265d('0x35')]=_[_0x265d('0x33')](_0x54a188['model'],qs['fields'](_0xd09f13[_0x265d('0x32')]['fields']));_0x213933[_0x265d('0x35')]=_0x213933[_0x265d('0x35')][_0x265d('0x36')]?_0x213933[_0x265d('0x35')]:_0x54a188[_0x265d('0x34')];if(!_0xd09f13['query'][_0x265d('0x37')]('nolimit')){_0x213933[_0x265d('0x1f')]=qs[_0x265d('0x1f')](_0xd09f13[_0x265d('0x32')]['limit']);_0x213933[_0x265d('0x1d')]=qs[_0x265d('0x1d')](_0xd09f13[_0x265d('0x32')][_0x265d('0x1d')]);}_0x213933[_0x265d('0x38')]=qs['sort'](_0xd09f13['query'][_0x265d('0x39')]);_0x213933[_0x265d('0x3a')]=qs[_0x265d('0x3b')](_['pick'](_0xd09f13['query'],_0x54a188[_0x265d('0x3b')]),_0x593f50);if(_0xd09f13[_0x265d('0x32')][_0x265d('0x3c')]){_0x213933['where']=_['merge'](_0x213933['where'],{'$or':_['map'](_0x593f50,function(_0xc8d8a9){if(_0xc8d8a9[_0x265d('0x3d')]!==_0x265d('0x3e')){var _0x312204={};_0x312204[_0xc8d8a9['name']]={'$like':'%'+_0xd09f13['query'][_0x265d('0x3c')]+'%'};return _0x312204;}})});}_0x213933=_[_0x265d('0x3f')]({},_0x213933,_0xd09f13[_0x265d('0x40')]);var _0xe927ee={'where':_0x213933['where']};return db['VoiceChanSpy'][_0x265d('0x20')](_0xe927ee)[_0x265d('0x24')](function(_0x159cab){_0x3f4acd['count']=_0x159cab;if(_0xd09f13['query']['includeAll']){_0x213933[_0x265d('0x41')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x213933);})[_0x265d('0x24')](function(_0x3329b9){_0x3f4acd[_0x265d('0x42')]=_0x3329b9;return _0x3f4acd;})[_0x265d('0x24')](respondWithFilteredResult(_0x10cd43,_0x213933))['catch'](handleError(_0x10cd43,null));};exports['show']=function(_0x225d1b,_0x54b16d){var _0x429242={'raw':![],'where':{'id':_0x225d1b['params']['id']}},_0x233dd2={};_0x233dd2[_0x265d('0x34')]=_[_0x265d('0x31')](db[_0x265d('0x2d')]['rawAttributes']);_0x233dd2['query']=_[_0x265d('0x31')](_0x225d1b[_0x265d('0x32')]);_0x233dd2[_0x265d('0x3b')]=_['intersection'](_0x233dd2[_0x265d('0x34')],_0x233dd2[_0x265d('0x32')]);_0x429242['attributes']=_[_0x265d('0x33')](_0x233dd2[_0x265d('0x34')],qs['fields'](_0x225d1b[_0x265d('0x32')][_0x265d('0x43')]));_0x429242[_0x265d('0x35')]=_0x429242[_0x265d('0x35')][_0x265d('0x36')]?_0x429242[_0x265d('0x35')]:_0x233dd2[_0x265d('0x34')];if(_0x225d1b[_0x265d('0x32')]['includeAll']){_0x429242[_0x265d('0x41')]=[{'all':!![]}];}_0x429242=_[_0x265d('0x3f')]({},_0x429242,_0x225d1b[_0x265d('0x40')]);return db[_0x265d('0x2d')][_0x265d('0x44')](_0x429242)[_0x265d('0x24')](handleEntityNotFound(_0x54b16d,null))[_0x265d('0x24')](respondWithResult(_0x54b16d,null))['catch'](handleError(_0x54b16d,null));};exports[_0x265d('0x45')]=function(_0x3affc9,_0x3d2acf){return db[_0x265d('0x2d')][_0x265d('0x45')](_0x3affc9[_0x265d('0x46')],{})[_0x265d('0x24')](function(_0x4afe7c){var _0x20eec8=_0x3affc9[_0x265d('0x47')][_0x265d('0x25')]({'plain':!![]});if(!_0x20eec8)throw new Error(_0x265d('0x48'));if(_0x20eec8[_0x265d('0x49')]==='user'){var _0x676c31=_0x4afe7c[_0x265d('0x25')]({'plain':!![]});var _0x467634=_0x265d('0x26');return db[_0x265d('0x4a')][_0x265d('0x44')]({'where':{'name':_0x467634,'userProfileId':_0x20eec8[_0x265d('0x4b')]},'raw':!![]})[_0x265d('0x24')](function(_0x1ad983){if(_0x1ad983&&_0x1ad983['autoAssociation']===0x0){return db['UserProfileResource'][_0x265d('0x45')]({'name':_0x676c31[_0x265d('0x29')],'resourceId':_0x676c31['id'],'type':_0x1ad983[_0x265d('0x29')],'sectionId':_0x1ad983['id']},{})[_0x265d('0x24')](function(){return _0x4afe7c;});}else{return _0x4afe7c;}})['catch'](function(_0x17b2c5){logger[_0x265d('0x4c')](_0x265d('0x4d'),_0x17b2c5);throw _0x17b2c5;});}return _0x4afe7c;})['then'](respondWithResult(_0x3d2acf,0xc9))[_0x265d('0x4e')](handleError(_0x3d2acf,null));};exports[_0x265d('0x22')]=function(_0x589817,_0x40b167){if(_0x589817[_0x265d('0x46')]['id']){delete _0x589817['body']['id'];}return db[_0x265d('0x2d')][_0x265d('0x44')]({'where':{'id':_0x589817['params']['id']}})[_0x265d('0x24')](handleEntityNotFound(_0x40b167,null))['then'](saveUpdates(_0x589817[_0x265d('0x46')],null))[_0x265d('0x24')](respondWithResult(_0x40b167,null))[_0x265d('0x4e')](handleError(_0x40b167,null));};exports['destroy']=function(_0x5b1a03,_0x124e58){return db['VoiceChanSpy'][_0x265d('0x44')]({'where':{'id':_0x5b1a03[_0x265d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x124e58,null))[_0x265d('0x24')](removeEntity(_0x124e58,null))[_0x265d('0x4e')](handleError(_0x124e58,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 641d198..02444ec 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 _0x86b6=['StopMixMonitor','internal','findAll','catch','define','VoiceChanSpy','then','length','bulkCreate','VoiceExtension','destroy','lodash','util','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','merge','Set','CDR(type)=%s','record','push','MixMonitor','recordingFormat','auth','ChanSpy','SIP/%s,%s','name','options','join'];(function(_0x4ec9a2,_0x216a25){var _0x4424bb=function(_0x57fa19){while(--_0x57fa19){_0x4ec9a2['push'](_0x4ec9a2['shift']());}};_0x4424bb(++_0x216a25);}(_0x86b6,0xab));var _0x686b=function(_0x3c691c,_0x75c10a){_0x3c691c=_0x3c691c-0x0;var _0x5703a0=_0x86b6[_0x3c691c];return _0x5703a0;};'use strict';var _=require(_0x686b('0x0'));var util=require(_0x686b('0x1'));var BPromise=require('bluebird');var attributes=require(_0x686b('0x2'));var getUserApplications=function(_0x406259,_0xd0857a,_0x11e906){var _0x2b6b8a=0x1;var _0x348dd7=[];var _0x46ef4e={'context':_0xd0857a[_0x686b('0x3')]||'from-sip','exten':util[_0x686b('0x4')](_0x686b('0x5'),_0x406259[_0x686b('0x6')],_0x11e906),'type':_0x686b('0x7'),'isApp':![],'ChanSpyId':_0x406259['id'],'UserId':_0xd0857a['id']};_0x348dd7['push'](_[_0x686b('0x8')]({'app':_0x686b('0x9'),'appdata':util[_0x686b('0x4')](_0x686b('0xa'),'chanspy'),'priority':_0x2b6b8a++},_0x46ef4e));if(_0x406259[_0x686b('0xb')]){_0x348dd7[_0x686b('0xc')](_[_0x686b('0x8')]({'app':_0x686b('0xd'),'appdata':util[_0x686b('0x4')]('${UNIQUEID}.%s,a',_0x406259[_0x686b('0xe')]),'priority':_0x2b6b8a++},_0x46ef4e));}if(_0x406259[_0x686b('0xf')]){_0x348dd7[_0x686b('0xc')](_[_0x686b('0x8')]({'app':'Authenticate','appdata':_0x406259['password'],'priority':_0x2b6b8a++},_0x46ef4e));}_0x348dd7[_0x686b('0xc')](_[_0x686b('0x8')]({'app':_0x686b('0x10'),'appdata':util[_0x686b('0x4')](_0x686b('0x11'),_0xd0857a[_0x686b('0x12')],_0x406259[_0x686b('0x13')]?_0x406259[_0x686b('0x13')][_0x686b('0x14')](''):''),'priority':_0x2b6b8a++},_0x46ef4e));if(_0x406259[_0x686b('0xb')]){_0x348dd7[_0x686b('0xc')](_[_0x686b('0x8')]({'app':_0x686b('0x15'),'priority':_0x2b6b8a++},_0x46ef4e));}return _0x348dd7;};var getChanSpyApplications=function(_0x57c1d8,_0x15f33b){var _0x1f9f07=[];for(var _0x1deb23=0x0,_0x9e3ebc=0x1;_0x1deb23<_0x15f33b['length'];_0x1deb23++,_0x9e3ebc=0x1){_0x1f9f07=_0x1f9f07['concat'](getUserApplications(_0x57c1d8,_0x15f33b[_0x1deb23],_0x15f33b[_0x1deb23]['internal']));if(_0x15f33b[_0x1deb23][_0x686b('0x16')]!=_0x15f33b[_0x1deb23][_0x686b('0x12')]){_0x1f9f07=_0x1f9f07['concat'](getUserApplications(_0x57c1d8,_0x15f33b[_0x1deb23],_0x15f33b[_0x1deb23][_0x686b('0x12')]));}}return _0x1f9f07;};var getChanSpyPromise=function(_0x4a71b0,_0x468864){return new BPromise(function(_0x14a8f8,_0x1f07e3){return _0x4a71b0['User'][_0x686b('0x17')]({'attributes':['id','name',_0x686b('0x16')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x21100e){if(_0x21100e){return _0x14a8f8(getChanSpyApplications(_0x468864,_0x21100e));}return _0x14a8f8([]);})[_0x686b('0x18')](function(_0x4378c5){_0x1f07e3(_0x4378c5);});});};module['exports']=function(_0x4b7d74,_0x53bf1d){var _0x58989e=_0x4b7d74['models'];return _0x4b7d74[_0x686b('0x19')](_0x686b('0x1a'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x31751a,_0x1191b0,_0x5a6c4d){return getChanSpyPromise(_0x58989e,_0x31751a)[_0x686b('0x1b')](function(_0x1c3c93){if(_0x1c3c93&&_0x1c3c93[_0x686b('0x1c')]){return _0x58989e['VoiceExtension'][_0x686b('0x1d')](_0x1c3c93);}})[_0x686b('0x1b')](function(){_0x5a6c4d();})['catch'](function(_0x536e41){_0x5a6c4d(_0x536e41);});},'afterUpdate':function(_0x162375,_0x44032f,_0x1b0d16){return _0x58989e[_0x686b('0x1e')][_0x686b('0x1f')]({'where':{'ChanSpyId':_0x162375['id']}})[_0x686b('0x1b')](function(){return getChanSpyPromise(_0x58989e,_0x162375);})[_0x686b('0x1b')](function(_0x53bbc6){if(_0x53bbc6&&_0x53bbc6[_0x686b('0x1c')]){return _0x58989e[_0x686b('0x1e')][_0x686b('0x1d')](_0x53bbc6);}})[_0x686b('0x1b')](function(){_0x1b0d16();})[_0x686b('0x18')](function(_0x3aa563){_0x1b0d16(_0x3aa563);});},'afterDestroy':function(_0x1d2f98,_0x153dbb,_0xbd858e){return _0x58989e[_0x686b('0x1e')][_0x686b('0x1f')]({'where':{'ChanSpyId':_0x1d2f98['id']}})[_0x686b('0x1b')](function(){_0xbd858e();})[_0x686b('0x18')](function(_0x4ad536){_0xbd858e(_0x4ad536);});}}});}; \ No newline at end of file +var _0x76d8=['./voiceChanSpy.attributes','from-sip','%s%s','prefix','system','push','merge','format','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','length','concat','internal','User','findAll','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x76d8,0x101));var _0x876d=function(_0x36421e,_0x10eadc){_0x36421e=_0x36421e-0x0;var _0xd2e87e=_0x76d8[_0x36421e];return _0xd2e87e;};'use strict';var _=require(_0x876d('0x0'));var util=require(_0x876d('0x1'));var BPromise=require('bluebird');var attributes=require(_0x876d('0x2'));var getUserApplications=function(_0x4b0431,_0x257c0a,_0x4d4233){var _0xc7a81b=0x1;var _0x5c313b=[];var _0x37ea2d={'context':_0x257c0a['context']||_0x876d('0x3'),'exten':util['format'](_0x876d('0x4'),_0x4b0431[_0x876d('0x5')],_0x4d4233),'type':_0x876d('0x6'),'isApp':![],'ChanSpyId':_0x4b0431['id'],'UserId':_0x257c0a['id']};_0x5c313b[_0x876d('0x7')](_[_0x876d('0x8')]({'app':'Set','appdata':util[_0x876d('0x9')](_0x876d('0xa'),_0x876d('0xb')),'priority':_0xc7a81b++},_0x37ea2d));if(_0x4b0431[_0x876d('0xc')]){_0x5c313b[_0x876d('0x7')](_[_0x876d('0x8')]({'app':'MixMonitor','appdata':util[_0x876d('0x9')](_0x876d('0xd'),_0x4b0431[_0x876d('0xe')]),'priority':_0xc7a81b++},_0x37ea2d));}if(_0x4b0431[_0x876d('0xf')]){_0x5c313b['push'](_[_0x876d('0x8')]({'app':_0x876d('0x10'),'appdata':_0x4b0431[_0x876d('0x11')],'priority':_0xc7a81b++},_0x37ea2d));}_0x5c313b[_0x876d('0x7')](_[_0x876d('0x8')]({'app':_0x876d('0x12'),'appdata':util[_0x876d('0x9')](_0x876d('0x13'),_0x257c0a[_0x876d('0x14')],_0x4b0431['options']?_0x4b0431[_0x876d('0x15')]['join'](''):''),'priority':_0xc7a81b++},_0x37ea2d));if(_0x4b0431[_0x876d('0xc')]){_0x5c313b[_0x876d('0x7')](_[_0x876d('0x8')]({'app':'StopMixMonitor','priority':_0xc7a81b++},_0x37ea2d));}return _0x5c313b;};var getChanSpyApplications=function(_0x1519da,_0x25ca6a){var _0x5cd9b9=[];for(var _0x3182a2=0x0,_0x1e82d5=0x1;_0x3182a2<_0x25ca6a[_0x876d('0x16')];_0x3182a2++,_0x1e82d5=0x1){_0x5cd9b9=_0x5cd9b9[_0x876d('0x17')](getUserApplications(_0x1519da,_0x25ca6a[_0x3182a2],_0x25ca6a[_0x3182a2][_0x876d('0x18')]));if(_0x25ca6a[_0x3182a2]['internal']!=_0x25ca6a[_0x3182a2][_0x876d('0x14')]){_0x5cd9b9=_0x5cd9b9[_0x876d('0x17')](getUserApplications(_0x1519da,_0x25ca6a[_0x3182a2],_0x25ca6a[_0x3182a2][_0x876d('0x14')]));}}return _0x5cd9b9;};var getChanSpyPromise=function(_0x295caa,_0x541abe){return new BPromise(function(_0x40deb1,_0x53ea8e){return _0x295caa[_0x876d('0x19')][_0x876d('0x1a')]({'attributes':['id',_0x876d('0x14'),_0x876d('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x876d('0x1b')](function(_0x242336){if(_0x242336){return _0x40deb1(getChanSpyApplications(_0x541abe,_0x242336));}return _0x40deb1([]);})[_0x876d('0x1c')](function(_0x57d0a1){_0x53ea8e(_0x57d0a1);});});};module[_0x876d('0x1d')]=function(_0x3d2ad2,_0x224e44){var _0x5f3b67=_0x3d2ad2[_0x876d('0x1e')];return _0x3d2ad2[_0x876d('0x1f')](_0x876d('0x20'),attributes,{'tableName':_0x876d('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x52453c,_0x4bccd3,_0x167638){return getChanSpyPromise(_0x5f3b67,_0x52453c)['then'](function(_0x5cfdad){if(_0x5cfdad&&_0x5cfdad['length']){return _0x5f3b67[_0x876d('0x22')][_0x876d('0x23')](_0x5cfdad);}})['then'](function(){_0x167638();})[_0x876d('0x1c')](function(_0x28981d){_0x167638(_0x28981d);});},'afterUpdate':function(_0x4329dd,_0x36fc3c,_0x45bb38){return _0x5f3b67[_0x876d('0x22')]['destroy']({'where':{'ChanSpyId':_0x4329dd['id']}})[_0x876d('0x1b')](function(){return getChanSpyPromise(_0x5f3b67,_0x4329dd);})[_0x876d('0x1b')](function(_0x4995cb){if(_0x4995cb&&_0x4995cb['length']){return _0x5f3b67[_0x876d('0x22')]['bulkCreate'](_0x4995cb);}})['then'](function(){_0x45bb38();})[_0x876d('0x1c')](function(_0x15fe7e){_0x45bb38(_0x15fe7e);});},'afterDestroy':function(_0x5f36a0,_0x406265,_0x327352){return _0x5f3b67['VoiceExtension'][_0x876d('0x24')]({'where':{'ChanSpyId':_0x5f36a0['id']}})[_0x876d('0x1b')](function(){_0x327352();})[_0x876d('0x1c')](function(_0x2d2c54){_0x327352(_0x2d2c54);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 2c72342..04151ea 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 _0x0647=['info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x724796,_0x217237){var _0x46bfcc=function(_0x44c191){while(--_0x44c191){_0x724796['push'](_0x724796['shift']());}};_0x46bfcc(++_0x217237);}(_0x0647,0xd0));var _0x7064=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0x0647[_0x37756b];return _0x46efec;};'use strict';var _=require(_0x7064('0x0'));var util=require('util');var moment=require(_0x7064('0x1'));var BPromise=require(_0x7064('0x2'));var rs=require(_0x7064('0x3'));var fs=require('fs');var Redis=require(_0x7064('0x4'));var db=require(_0x7064('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7064('0x6'));var config=require(_0x7064('0x7'));var jayson=require(_0x7064('0x8'));var client=jayson[_0x7064('0x9')][_0x7064('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1101e4,_0x58186b,_0x536336){return new BPromise(function(_0x1c85b1,_0x39b7e3){return client[_0x7064('0xb')](_0x1101e4,_0x536336)['then'](function(_0x38c195){logger[_0x7064('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x58186b,_0x7064('0xd'));logger[_0x7064('0xe')](_0x7064('0xf'),_0x58186b,'request\x20sent',JSON[_0x7064('0x10')](_0x38c195));if(_0x38c195[_0x7064('0x11')]){if(_0x38c195[_0x7064('0x11')][_0x7064('0x12')]===0x1f4){logger['error'](_0x7064('0x13'),_0x58186b,_0x38c195[_0x7064('0x11')][_0x7064('0x14')]);return _0x39b7e3(_0x38c195[_0x7064('0x11')][_0x7064('0x14')]);}logger[_0x7064('0x11')](_0x7064('0x13'),_0x58186b,_0x38c195[_0x7064('0x11')]['message']);return _0x1c85b1(_0x38c195['error']['message']);}else{logger[_0x7064('0xc')](_0x7064('0x13'),_0x58186b,_0x7064('0xd'));_0x1c85b1(_0x38c195['result'][_0x7064('0x14')]);}})[_0x7064('0x15')](function(_0x5bb1cc){logger[_0x7064('0x11')](_0x7064('0x13'),_0x58186b,_0x5bb1cc);_0x39b7e3(_0x5bb1cc);});});} \ No newline at end of file +var _0x6b24=['client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/logger','../../config/environment'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x6b24,0x1ce));var _0x46b2=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0x6b24[_0x51ec61];return _0x223200;};'use strict';var _=require('lodash');var util=require(_0x46b2('0x0'));var moment=require(_0x46b2('0x1'));var BPromise=require(_0x46b2('0x2'));var rs=require(_0x46b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x46b2('0x4'))('rpc');var config=require(_0x46b2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x46b2('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x512905,_0x326eb7,_0x233ccf){return new BPromise(function(_0x1f81b8,_0x1531c){return client[_0x46b2('0x7')](_0x512905,_0x233ccf)[_0x46b2('0x8')](function(_0x3144df){logger[_0x46b2('0x9')](_0x46b2('0xa'),_0x326eb7,'request\x20sent');logger['debug'](_0x46b2('0xb'),_0x326eb7,_0x46b2('0xc'),JSON[_0x46b2('0xd')](_0x3144df));if(_0x3144df['error']){if(_0x3144df[_0x46b2('0xe')][_0x46b2('0xf')]===0x1f4){logger[_0x46b2('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x326eb7,_0x3144df[_0x46b2('0xe')][_0x46b2('0x10')]);return _0x1531c(_0x3144df[_0x46b2('0xe')][_0x46b2('0x10')]);}logger[_0x46b2('0xe')](_0x46b2('0xa'),_0x326eb7,_0x3144df[_0x46b2('0xe')][_0x46b2('0x10')]);return _0x1f81b8(_0x3144df[_0x46b2('0xe')][_0x46b2('0x10')]);}else{logger['info'](_0x46b2('0xa'),_0x326eb7,_0x46b2('0xc'));_0x1f81b8(_0x3144df['result'][_0x46b2('0x10')]);}})[_0x46b2('0x11')](function(_0xe3d3d9){logger[_0x46b2('0xe')](_0x46b2('0xa'),_0x326eb7,_0xe3d3d9);_0x1531c(_0xe3d3d9);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 51ff624..0033077 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 _0xfa9f=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x3d369c,_0x39b082){var _0xb96391=function(_0x18d746){while(--_0x18d746){_0x3d369c['push'](_0x3d369c['shift']());}};_0xb96391(++_0x39b082);}(_0xfa9f,0x12f));var _0xffa9=function(_0x1663ae,_0x10484a){_0x1663ae=_0x1663ae-0x0;var _0x30ffb8=_0xfa9f[_0x1663ae];return _0x30ffb8;};'use strict';var multer=require(_0xffa9('0x0'));var util=require(_0xffa9('0x1'));var path=require('path');var timeout=require(_0xffa9('0x2'));var express=require(_0xffa9('0x3'));var router=express[_0xffa9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xffa9('0x5'));var interaction=require(_0xffa9('0x6'));var config=require('../../config/environment');var controller=require(_0xffa9('0x7'));router[_0xffa9('0x8')]('/',auth[_0xffa9('0x9')](),controller['index']);router[_0xffa9('0x8')](_0xffa9('0xa'),auth[_0xffa9('0x9')](),controller[_0xffa9('0xb')]);router[_0xffa9('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xffa9('0xd')](_0xffa9('0xa'),auth['isAuthenticated'](),controller[_0xffa9('0xe')]);router[_0xffa9('0xf')](_0xffa9('0xa'),auth['isAuthenticated'](),controller[_0xffa9('0x10')]);module[_0xffa9('0x11')]=router; \ No newline at end of file +var _0x5cd4=['exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','index','get','/:id','show','post','put','delete','isAuthenticated','destroy'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x5cd4,0x9a));var _0x45cd=function(_0x56b171,_0x233718){_0x56b171=_0x56b171-0x0;var _0x223800=_0x5cd4[_0x56b171];return _0x223800;};'use strict';var multer=require(_0x45cd('0x0'));var util=require('util');var path=require(_0x45cd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x45cd('0x2'));var auth=require(_0x45cd('0x3'));var interaction=require(_0x45cd('0x4'));var config=require(_0x45cd('0x5'));var controller=require(_0x45cd('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x45cd('0x7')]);router[_0x45cd('0x8')](_0x45cd('0x9'),auth['isAuthenticated'](),controller[_0x45cd('0xa')]);router[_0x45cd('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x45cd('0xc')](_0x45cd('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x45cd('0xd')](_0x45cd('0x9'),auth[_0x45cd('0xe')](),controller[_0x45cd('0xf')]);module[_0x45cd('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 6d3c3d7..30cb07f 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 _0x5eb1=['exports','STRING','name','BOOLEAN'];(function(_0x5bc4d1,_0x5101a3){var _0x4d7f6e=function(_0xe38ec9){while(--_0xe38ec9){_0x5bc4d1['push'](_0x5bc4d1['shift']());}};_0x4d7f6e(++_0x5101a3);}(_0x5eb1,0x7c));var _0x15eb=function(_0x13d878,_0x3ac33){_0x13d878=_0x13d878-0x0;var _0x4f9280=_0x5eb1[_0x13d878];return _0x4f9280;};'use strict';var Sequelize=require('sequelize');module[_0x15eb('0x0')]={'name':{'type':Sequelize[_0x15eb('0x1')],'unique':_0x15eb('0x2')},'description':{'type':Sequelize[_0x15eb('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x15eb('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6e82=['STRING','name','BOOLEAN','exports'];(function(_0x366776,_0x48f0bf){var _0x34e2ad=function(_0xb7dfb0){while(--_0xb7dfb0){_0x366776['push'](_0x366776['shift']());}};_0x34e2ad(++_0x48f0bf);}(_0x6e82,0x1a7));var _0x26e8=function(_0x834bb6,_0x1c5e35){_0x834bb6=_0x834bb6-0x0;var _0xa35d00=_0x6e82[_0x834bb6];return _0xa35d00;};'use strict';var Sequelize=require('sequelize');module[_0x26e8('0x0')]={'name':{'type':Sequelize[_0x26e8('0x1')],'unique':_0x26e8('0x2')},'description':{'type':Sequelize[_0x26e8('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x26e8('0x3')],'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 0103461..230eecf 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 _0x43a3=['length','includeAll','options','create','readFileSync','join','root','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Contexts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','body','server/files/templates/context.ejs','utf8','rimraf','fast-json-patch','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','get','end','stack','send','index','map','rawAttributes','type','key','name','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VoiceContext','include','findAll','rows','show'];(function(_0x3e5206,_0x42de8c){var _0x3e51e8=function(_0x722bc1){while(--_0x722bc1){_0x3e5206['push'](_0x3e5206['shift']());}};_0x3e51e8(++_0x42de8c);}(_0x43a3,0x7f));var _0x343a=function(_0x2cac20,_0x804dbe){_0x2cac20=_0x2cac20-0x0;var _0x576220=_0x43a3[_0x2cac20];return _0x576220;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x343a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x343a('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x343a('0x2'));var util=require(_0x343a('0x3'));var path=require('path');var sox=require(_0x343a('0x4'));var csv=require('to-csv');var ejs=require(_0x343a('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x343a('0x6'));var squel=require(_0x343a('0x7'));var crypto=require(_0x343a('0x8'));var jsforce=require(_0x343a('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x343a('0xa'));var querystring=require(_0x343a('0xb'));var Papa=require(_0x343a('0xc'));var Redis=require(_0x343a('0xd'));var authService=require(_0x343a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x343a('0xf'));var hardwareService=require(_0x343a('0x10'));var logger=require(_0x343a('0x11'))(_0x343a('0x12'));var utils=require(_0x343a('0x13'));var config=require(_0x343a('0x14'));var licenseUtil=require(_0x343a('0x15'));var db=require(_0x343a('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x343a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x342cd6,_0x57011f,_0x5b7a92,_0x282702){return new BPromise(function(_0x5b3c56,_0x25a508){var _0x5cf464=_0x282702||client;return _0x5cf464[_0x343a('0x18')](_0x342cd6,_0x5b7a92)[_0x343a('0x19')](function(_0x4f2d27){logger[_0x343a('0x1a')](_0x343a('0x1b'),_0x57011f,_0x343a('0x1c'));logger[_0x343a('0x1d')](_0x343a('0x1e'),_0x57011f,_0x343a('0x1c'),JSON[_0x343a('0x1f')](_0x4f2d27));if(_0x4f2d27[_0x343a('0x20')]){if(_0x4f2d27[_0x343a('0x20')][_0x343a('0x21')]===0x1f4){logger[_0x343a('0x20')](_0x343a('0x1b'),_0x57011f,_0x4f2d27[_0x343a('0x20')][_0x343a('0x22')]);return _0x25a508(_0x4f2d27[_0x343a('0x20')][_0x343a('0x22')]);}logger[_0x343a('0x20')](_0x343a('0x1b'),_0x57011f,_0x4f2d27[_0x343a('0x20')][_0x343a('0x22')]);return _0x5b3c56(_0x4f2d27['error'][_0x343a('0x22')]);}else{logger['info'](_0x343a('0x1b'),_0x57011f,_0x343a('0x1c'));_0x5b3c56(_0x4f2d27['result'][_0x343a('0x22')]);}})[_0x343a('0x23')](function(_0x35b85e){logger[_0x343a('0x20')](_0x343a('0x1b'),_0x57011f,_0x35b85e);_0x25a508(_0x35b85e);});});}function respondWithStatusCode(_0x4f306d,_0x3e9406){_0x3e9406=_0x3e9406||0xcc;return function(_0x4ea9fb){if(_0x4ea9fb){return _0x4f306d[_0x343a('0x24')](_0x3e9406);}return _0x4f306d[_0x343a('0x25')](_0x3e9406)['end']();};}function respondWithResult(_0x183641,_0x6ae4f8){_0x6ae4f8=_0x6ae4f8||0xc8;return function(_0x462570){if(_0x462570){return _0x183641[_0x343a('0x25')](_0x6ae4f8)[_0x343a('0x26')](_0x462570);}};}function respondWithFilteredResult(_0x59807f,_0x3aaa73){return function(_0x3096c3){if(_0x3096c3){var _0x2c0775=typeof _0x3aaa73[_0x343a('0x27')]===_0x343a('0x28')&&typeof _0x3aaa73[_0x343a('0x29')]==='undefined';var _0x3fcc59=_0x3096c3[_0x343a('0x2a')];var _0x473256=_0x2c0775?0x0:_0x3aaa73['offset'];var _0x248960=_0x2c0775?_0x3096c3[_0x343a('0x2a')]:_0x3aaa73[_0x343a('0x27')]+_0x3aaa73[_0x343a('0x29')];var _0x5a6a58;if(_0x248960>=_0x3fcc59){_0x248960=_0x3fcc59;_0x5a6a58=0xc8;}else{_0x5a6a58=0xce;}_0x59807f[_0x343a('0x25')](_0x5a6a58);return _0x59807f['set'](_0x343a('0x2b'),_0x473256+'-'+_0x248960+'/'+_0x3fcc59)['json'](_0x3096c3);}return null;};}function patchUpdates(_0x275c2c){return function(_0x284d37){try{jsonpatch[_0x343a('0x2c')](_0x284d37,_0x275c2c,!![]);}catch(_0xc8a533){return BPromise['reject'](_0xc8a533);}return _0x284d37[_0x343a('0x2d')]();};}function saveUpdates(_0x289489,_0x1587b0){return function(_0xcc6254){if(_0xcc6254){return _0xcc6254[_0x343a('0x2e')](_0x289489)[_0x343a('0x19')](function(_0x5c09b7){return _0x5c09b7;});}return null;};}function removeEntity(_0x6d3ba3,_0x5acb77){return function(_0x282b37){if(_0x282b37){return _0x282b37[_0x343a('0x2f')]()[_0x343a('0x19')](function(){var _0x2bda5b=_0x282b37[_0x343a('0x30')]({'plain':!![]});var _0xdd508='Contexts';return db['UserProfileResource'][_0x343a('0x2f')]({'where':{'type':_0xdd508,'resourceId':_0x2bda5b['id']}})[_0x343a('0x19')](function(){return _0x282b37;});})[_0x343a('0x19')](function(){_0x6d3ba3['status'](0xcc)[_0x343a('0x31')]();});}};}function handleEntityNotFound(_0x36cddf,_0x5b7865){return function(_0x235513){if(!_0x235513){_0x36cddf[_0x343a('0x24')](0x194);}return _0x235513;};}function handleError(_0x224f16,_0x245833){_0x245833=_0x245833||0x1f4;return function(_0x3d3810){logger[_0x343a('0x20')](_0x3d3810[_0x343a('0x32')]);if(_0x3d3810['name']){delete _0x3d3810['name'];}_0x224f16['status'](_0x245833)[_0x343a('0x33')](_0x3d3810);};}exports[_0x343a('0x34')]=function(_0x1b1b82,_0x2e7d4d){var _0x35b48f={},_0x35a68e={},_0x3c0280={'count':0x0,'rows':[]};var _0x45d5a9=_[_0x343a('0x35')](db['VoiceContext'][_0x343a('0x36')],function(_0x5b179b){return{'name':_0x5b179b['fieldName'],'type':_0x5b179b[_0x343a('0x37')][_0x343a('0x38')]};});_0x35a68e['model']=_[_0x343a('0x35')](_0x45d5a9,_0x343a('0x39'));_0x35a68e[_0x343a('0x3a')]=_[_0x343a('0x3b')](_0x1b1b82['query']);_0x35a68e[_0x343a('0x3c')]=_[_0x343a('0x3d')](_0x35a68e['model'],_0x35a68e['query']);_0x35b48f['attributes']=_[_0x343a('0x3d')](_0x35a68e[_0x343a('0x3e')],qs[_0x343a('0x3f')](_0x1b1b82['query'][_0x343a('0x3f')]));_0x35b48f[_0x343a('0x40')]=_0x35b48f[_0x343a('0x40')]['length']?_0x35b48f[_0x343a('0x40')]:_0x35a68e['model'];if(!_0x1b1b82[_0x343a('0x3a')]['hasOwnProperty'](_0x343a('0x41'))){_0x35b48f[_0x343a('0x29')]=qs[_0x343a('0x29')](_0x1b1b82[_0x343a('0x3a')]['limit']);_0x35b48f[_0x343a('0x27')]=qs[_0x343a('0x27')](_0x1b1b82[_0x343a('0x3a')][_0x343a('0x27')]);}_0x35b48f[_0x343a('0x42')]=qs[_0x343a('0x43')](_0x1b1b82[_0x343a('0x3a')]['sort']);_0x35b48f[_0x343a('0x44')]=qs[_0x343a('0x3c')](_[_0x343a('0x45')](_0x1b1b82[_0x343a('0x3a')],_0x35a68e[_0x343a('0x3c')]),_0x45d5a9);if(_0x1b1b82[_0x343a('0x3a')][_0x343a('0x46')]){_0x35b48f[_0x343a('0x44')]=_[_0x343a('0x47')](_0x35b48f[_0x343a('0x44')],{'$or':_[_0x343a('0x35')](_0x45d5a9,function(_0x488ef6){if(_0x488ef6[_0x343a('0x37')]!=='VIRTUAL'){var _0x3024d4={};_0x3024d4[_0x488ef6['name']]={'$like':'%'+_0x1b1b82['query']['filter']+'%'};return _0x3024d4;}})});}_0x35b48f=_[_0x343a('0x47')]({},_0x35b48f,_0x1b1b82['options']);var _0x1b89cf={'where':_0x35b48f[_0x343a('0x44')]};return db[_0x343a('0x48')][_0x343a('0x2a')](_0x1b89cf)['then'](function(_0x672b1f){_0x3c0280[_0x343a('0x2a')]=_0x672b1f;if(_0x1b1b82['query']['includeAll']){_0x35b48f[_0x343a('0x49')]=[{'all':!![]}];}return db[_0x343a('0x48')][_0x343a('0x4a')](_0x35b48f);})[_0x343a('0x19')](function(_0x99c1d0){_0x3c0280[_0x343a('0x4b')]=_0x99c1d0;return _0x3c0280;})['then'](respondWithFilteredResult(_0x2e7d4d,_0x35b48f))[_0x343a('0x23')](handleError(_0x2e7d4d,null));};exports[_0x343a('0x4c')]=function(_0x14e81a,_0x4588bb){var _0x25e5dd={'raw':![],'where':{'id':_0x14e81a['params']['id']}},_0x50284e={};_0x50284e[_0x343a('0x3e')]=_[_0x343a('0x3b')](db['VoiceContext']['rawAttributes']);_0x50284e[_0x343a('0x3a')]=_[_0x343a('0x3b')](_0x14e81a[_0x343a('0x3a')]);_0x50284e[_0x343a('0x3c')]=_[_0x343a('0x3d')](_0x50284e[_0x343a('0x3e')],_0x50284e[_0x343a('0x3a')]);_0x25e5dd[_0x343a('0x40')]=_[_0x343a('0x3d')](_0x50284e[_0x343a('0x3e')],qs['fields'](_0x14e81a[_0x343a('0x3a')][_0x343a('0x3f')]));_0x25e5dd[_0x343a('0x40')]=_0x25e5dd['attributes'][_0x343a('0x4d')]?_0x25e5dd[_0x343a('0x40')]:_0x50284e[_0x343a('0x3e')];if(_0x14e81a['query'][_0x343a('0x4e')]){_0x25e5dd[_0x343a('0x49')]=[{'all':!![]}];}_0x25e5dd=_['merge']({},_0x25e5dd,_0x14e81a[_0x343a('0x4f')]);return db['VoiceContext']['find'](_0x25e5dd)['then'](handleEntityNotFound(_0x4588bb,null))[_0x343a('0x19')](respondWithResult(_0x4588bb,null))[_0x343a('0x23')](handleError(_0x4588bb,null));};exports[_0x343a('0x50')]=function(_0x5cf684,_0x16a941,_0x431850){var _0x26c845;return db['VoiceContext'][_0x343a('0x50')](_0x5cf684['body'],{'raw':!![]})['then'](function(_0x5ae49a){_0x26c845=_0x5ae49a;return db[_0x343a('0x48')][_0x343a('0x4a')]({'raw':!![]});})[_0x343a('0x19')](function(_0x36ec2a){var _0x36c17b=fs[_0x343a('0x51')](path[_0x343a('0x52')](config[_0x343a('0x53')],'server/files/templates/context.ejs'),'utf8');var _0x556446=ejs[_0x343a('0x54')](_0x36c17b,{'contexts':_0x36ec2a||[]});fs[_0x343a('0x55')](_0x343a('0x56'),_0x556446);})[_0x343a('0x19')](function(){return respondWithRpcPromise(_0x343a('0x57'),_0x343a('0x50'),{'module':_0x343a('0x58')});})[_0x343a('0x19')](function(){var _0x434fd3=_0x5cf684[_0x343a('0x59')][_0x343a('0x30')]({'plain':!![]});if(!_0x434fd3)throw new Error(_0x343a('0x5a'));if(_0x434fd3[_0x343a('0x5b')]==='user'){var _0x35b6e7=_0x26c845['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x343a('0x5c'),'userProfileId':_0x434fd3[_0x343a('0x5d')]},'raw':!![]})['then'](function(_0xc7c923){if(_0xc7c923&&_0xc7c923[_0x343a('0x5e')]===0x0){return db[_0x343a('0x5f')][_0x343a('0x50')]({'name':_0x35b6e7['name'],'resourceId':_0x35b6e7['id'],'type':_0xc7c923[_0x343a('0x39')],'sectionId':_0xc7c923['id']},{})['then'](function(){return _0x26c845;});}else{return _0x26c845;}})[_0x343a('0x23')](function(_0x87bbfd){logger[_0x343a('0x20')](_0x343a('0x60'),_0x87bbfd);throw _0x87bbfd;});}return _0x26c845;})[_0x343a('0x19')](respondWithResult(_0x16a941,0xc9))[_0x343a('0x23')](handleError(_0x16a941,null));};exports['update']=function(_0x490919,_0x24b54e,_0x4a6034){var _0x158a50;return db[_0x343a('0x48')][_0x343a('0x61')]({'where':{'id':_0x490919[_0x343a('0x62')]['id']}})[_0x343a('0x19')](handleEntityNotFound(_0x24b54e,null))[_0x343a('0x19')](saveUpdates(_0x490919[_0x343a('0x63')],null))[_0x343a('0x19')](function(_0x5c704a){if(_0x5c704a){_0x158a50=_0x5c704a;return db[_0x343a('0x48')]['findAll']({'raw':!![]});}})['then'](function(_0x1cbbb6){var _0x23c7ca=fs['readFileSync'](path[_0x343a('0x52')](config['root'],_0x343a('0x64')),_0x343a('0x65'));var _0x29c871=ejs[_0x343a('0x54')](_0x23c7ca,{'contexts':_0x1cbbb6||[]});fs[_0x343a('0x55')](_0x343a('0x56'),_0x29c871);})['then'](function(){return respondWithRpcPromise('Reload','update',{'module':_0x343a('0x58')});})[_0x343a('0x19')](function(){return _0x158a50;})[_0x343a('0x19')](respondWithResult(_0x24b54e,null))[_0x343a('0x23')](handleError(_0x24b54e,null));};exports[_0x343a('0x2f')]=function(_0x5a3fbd,_0x5e8de8,_0x5c5b11){var _0x1e7447;return db[_0x343a('0x48')][_0x343a('0x61')]({'where':{'id':_0x5a3fbd[_0x343a('0x62')]['id']}})[_0x343a('0x19')](handleEntityNotFound(_0x5e8de8,null))[_0x343a('0x19')](removeEntity(_0x5e8de8,null))[_0x343a('0x19')](function(){return db[_0x343a('0x48')][_0x343a('0x4a')]({'raw':!![]});})[_0x343a('0x19')](function(_0x487eba){var _0x2bc484=fs[_0x343a('0x51')](path[_0x343a('0x52')](config[_0x343a('0x53')],_0x343a('0x64')),_0x343a('0x65'));var _0xf6841f=ejs[_0x343a('0x54')](_0x2bc484,{'contexts':_0x487eba});fs[_0x343a('0x55')](_0x343a('0x56'),_0xf6841f);return respondWithRpcPromise('Reload',_0x343a('0x2f'),{'module':_0x343a('0x58')});})[_0x343a('0x23')](handleError(_0x5e8de8,null));}; \ No newline at end of file +var _0x99b7=['crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','catch','sendStatus','end','json','limit','count','offset','status','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','options','VoiceContext','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x46428c,_0x20ab75){var _0x16a677=function(_0x2b0817){while(--_0x2b0817){_0x46428c['push'](_0x46428c['shift']());}};_0x16a677(++_0x20ab75);}(_0x99b7,0x18b));var _0x799b=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x99b7[_0x35af23];return _0x340506;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x799b('0x0'));var jsonpatch=require(_0x799b('0x1'));var rp=require(_0x799b('0x2'));var moment=require(_0x799b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x799b('0x4'));var util=require(_0x799b('0x5'));var path=require(_0x799b('0x6'));var sox=require(_0x799b('0x7'));var csv=require(_0x799b('0x8'));var ejs=require(_0x799b('0x9'));var fs=require('fs');var fs_extra=require(_0x799b('0xa'));var _=require(_0x799b('0xb'));var squel=require(_0x799b('0xc'));var crypto=require(_0x799b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x799b('0xe'));var Papa=require(_0x799b('0xf'));var Redis=require(_0x799b('0x10'));var authService=require(_0x799b('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x799b('0x12'));var logger=require(_0x799b('0x13'))('api');var utils=require(_0x799b('0x14'));var config=require(_0x799b('0x15'));var licenseUtil=require(_0x799b('0x16'));var db=require(_0x799b('0x17'))['db'];var jayson=require(_0x799b('0x18'));var client=jayson[_0x799b('0x19')][_0x799b('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x496fcf,_0x501aaf,_0xa38fc6,_0x3ed600){return new BPromise(function(_0x11e84d,_0x4561d4){var _0x4767c0=_0x3ed600||client;return _0x4767c0['request'](_0x496fcf,_0xa38fc6)[_0x799b('0x1b')](function(_0x28bd23){logger['info'](_0x799b('0x1c'),_0x501aaf,'request\x20sent');logger[_0x799b('0x1d')](_0x799b('0x1e'),_0x501aaf,_0x799b('0x1f'),JSON['stringify'](_0x28bd23));if(_0x28bd23['error']){if(_0x28bd23['error'][_0x799b('0x20')]===0x1f4){logger[_0x799b('0x21')](_0x799b('0x1c'),_0x501aaf,_0x28bd23[_0x799b('0x21')][_0x799b('0x22')]);return _0x4561d4(_0x28bd23[_0x799b('0x21')][_0x799b('0x22')]);}logger[_0x799b('0x21')]('VoiceContext,\x20%s,\x20%s',_0x501aaf,_0x28bd23[_0x799b('0x21')]['message']);return _0x11e84d(_0x28bd23[_0x799b('0x21')][_0x799b('0x22')]);}else{logger[_0x799b('0x23')](_0x799b('0x1c'),_0x501aaf,_0x799b('0x1f'));_0x11e84d(_0x28bd23['result'][_0x799b('0x22')]);}})[_0x799b('0x24')](function(_0x3ff15c){logger[_0x799b('0x21')]('VoiceContext,\x20%s,\x20%s',_0x501aaf,_0x3ff15c);_0x4561d4(_0x3ff15c);});});}function respondWithStatusCode(_0x5606bf,_0x362828){_0x362828=_0x362828||0xcc;return function(_0x59a251){if(_0x59a251){return _0x5606bf[_0x799b('0x25')](_0x362828);}return _0x5606bf['status'](_0x362828)[_0x799b('0x26')]();};}function respondWithResult(_0x239a3c,_0x221333){_0x221333=_0x221333||0xc8;return function(_0x2a9397){if(_0x2a9397){return _0x239a3c['status'](_0x221333)[_0x799b('0x27')](_0x2a9397);}};}function respondWithFilteredResult(_0x54c7fd,_0x36806d){return function(_0x409a83){if(_0x409a83){var _0x696294=typeof _0x36806d['offset']==='undefined'&&typeof _0x36806d[_0x799b('0x28')]==='undefined';var _0x25e5b4=_0x409a83[_0x799b('0x29')];var _0x5726e9=_0x696294?0x0:_0x36806d[_0x799b('0x2a')];var _0x493b2c=_0x696294?_0x409a83['count']:_0x36806d[_0x799b('0x2a')]+_0x36806d[_0x799b('0x28')];var _0x370021;if(_0x493b2c>=_0x25e5b4){_0x493b2c=_0x25e5b4;_0x370021=0xc8;}else{_0x370021=0xce;}_0x54c7fd[_0x799b('0x2b')](_0x370021);return _0x54c7fd[_0x799b('0x2c')](_0x799b('0x2d'),_0x5726e9+'-'+_0x493b2c+'/'+_0x25e5b4)[_0x799b('0x27')](_0x409a83);}return null;};}function patchUpdates(_0x2484e9){return function(_0x4303db){try{jsonpatch[_0x799b('0x2e')](_0x4303db,_0x2484e9,!![]);}catch(_0x2e251e){return BPromise[_0x799b('0x2f')](_0x2e251e);}return _0x4303db[_0x799b('0x30')]();};}function saveUpdates(_0x19eece,_0x328566){return function(_0x52c66a){if(_0x52c66a){return _0x52c66a[_0x799b('0x31')](_0x19eece)[_0x799b('0x1b')](function(_0x22c102){return _0x22c102;});}return null;};}function removeEntity(_0x3a6d73,_0x2a408d){return function(_0x465059){if(_0x465059){return _0x465059[_0x799b('0x32')]()['then'](function(){var _0x2f56f0=_0x465059[_0x799b('0x33')]({'plain':!![]});var _0x3dce94=_0x799b('0x34');return db[_0x799b('0x35')]['destroy']({'where':{'type':_0x3dce94,'resourceId':_0x2f56f0['id']}})['then'](function(){return _0x465059;});})[_0x799b('0x1b')](function(){_0x3a6d73[_0x799b('0x2b')](0xcc)[_0x799b('0x26')]();});}};}function handleEntityNotFound(_0x55eb0e,_0x33aee8){return function(_0x1a82cb){if(!_0x1a82cb){_0x55eb0e[_0x799b('0x25')](0x194);}return _0x1a82cb;};}function handleError(_0x515e74,_0x4399e2){_0x4399e2=_0x4399e2||0x1f4;return function(_0x4c219e){logger[_0x799b('0x21')](_0x4c219e[_0x799b('0x36')]);if(_0x4c219e[_0x799b('0x37')]){delete _0x4c219e[_0x799b('0x37')];}_0x515e74['status'](_0x4399e2)[_0x799b('0x38')](_0x4c219e);};}exports[_0x799b('0x39')]=function(_0x35a154,_0x11cd73){var _0x5283fd={},_0x5d95d0={},_0x38c280={'count':0x0,'rows':[]};var _0x17f981=_['map'](db['VoiceContext']['rawAttributes'],function(_0x14652d){return{'name':_0x14652d[_0x799b('0x3a')],'type':_0x14652d[_0x799b('0x3b')][_0x799b('0x3c')]};});_0x5d95d0[_0x799b('0x3d')]=_[_0x799b('0x3e')](_0x17f981,_0x799b('0x37'));_0x5d95d0[_0x799b('0x3f')]=_[_0x799b('0x40')](_0x35a154['query']);_0x5d95d0['filters']=_[_0x799b('0x41')](_0x5d95d0['model'],_0x5d95d0['query']);_0x5283fd[_0x799b('0x42')]=_[_0x799b('0x41')](_0x5d95d0[_0x799b('0x3d')],qs[_0x799b('0x43')](_0x35a154[_0x799b('0x3f')]['fields']));_0x5283fd['attributes']=_0x5283fd[_0x799b('0x42')][_0x799b('0x44')]?_0x5283fd[_0x799b('0x42')]:_0x5d95d0[_0x799b('0x3d')];if(!_0x35a154['query'][_0x799b('0x45')]('nolimit')){_0x5283fd[_0x799b('0x28')]=qs[_0x799b('0x28')](_0x35a154[_0x799b('0x3f')][_0x799b('0x28')]);_0x5283fd[_0x799b('0x2a')]=qs[_0x799b('0x2a')](_0x35a154[_0x799b('0x3f')][_0x799b('0x2a')]);}_0x5283fd['order']=qs[_0x799b('0x46')](_0x35a154['query']['sort']);_0x5283fd['where']=qs[_0x799b('0x47')](_[_0x799b('0x48')](_0x35a154[_0x799b('0x3f')],_0x5d95d0['filters']),_0x17f981);if(_0x35a154[_0x799b('0x3f')][_0x799b('0x49')]){_0x5283fd[_0x799b('0x4a')]=_[_0x799b('0x4b')](_0x5283fd[_0x799b('0x4a')],{'$or':_[_0x799b('0x3e')](_0x17f981,function(_0x270bc8){if(_0x270bc8[_0x799b('0x3b')]!==_0x799b('0x4c')){var _0x4f614e={};_0x4f614e[_0x270bc8[_0x799b('0x37')]]={'$like':'%'+_0x35a154[_0x799b('0x3f')]['filter']+'%'};return _0x4f614e;}})});}_0x5283fd=_[_0x799b('0x4b')]({},_0x5283fd,_0x35a154[_0x799b('0x4d')]);var _0x4d29f9={'where':_0x5283fd[_0x799b('0x4a')]};return db[_0x799b('0x4e')][_0x799b('0x29')](_0x4d29f9)[_0x799b('0x1b')](function(_0x30a15b){_0x38c280[_0x799b('0x29')]=_0x30a15b;if(_0x35a154['query'][_0x799b('0x4f')]){_0x5283fd[_0x799b('0x50')]=[{'all':!![]}];}return db[_0x799b('0x4e')][_0x799b('0x51')](_0x5283fd);})[_0x799b('0x1b')](function(_0x223de6){_0x38c280[_0x799b('0x52')]=_0x223de6;return _0x38c280;})['then'](respondWithFilteredResult(_0x11cd73,_0x5283fd))['catch'](handleError(_0x11cd73,null));};exports['show']=function(_0x435115,_0x58bee5){var _0x590d8d={'raw':![],'where':{'id':_0x435115[_0x799b('0x53')]['id']}},_0x373ece={};_0x373ece[_0x799b('0x3d')]=_[_0x799b('0x40')](db[_0x799b('0x4e')][_0x799b('0x54')]);_0x373ece[_0x799b('0x3f')]=_['keys'](_0x435115[_0x799b('0x3f')]);_0x373ece[_0x799b('0x47')]=_[_0x799b('0x41')](_0x373ece[_0x799b('0x3d')],_0x373ece['query']);_0x590d8d[_0x799b('0x42')]=_['intersection'](_0x373ece[_0x799b('0x3d')],qs[_0x799b('0x43')](_0x435115[_0x799b('0x3f')][_0x799b('0x43')]));_0x590d8d[_0x799b('0x42')]=_0x590d8d['attributes'][_0x799b('0x44')]?_0x590d8d[_0x799b('0x42')]:_0x373ece['model'];if(_0x435115[_0x799b('0x3f')][_0x799b('0x4f')]){_0x590d8d['include']=[{'all':!![]}];}_0x590d8d=_[_0x799b('0x4b')]({},_0x590d8d,_0x435115[_0x799b('0x4d')]);return db[_0x799b('0x4e')][_0x799b('0x55')](_0x590d8d)[_0x799b('0x1b')](handleEntityNotFound(_0x58bee5,null))[_0x799b('0x1b')](respondWithResult(_0x58bee5,null))[_0x799b('0x24')](handleError(_0x58bee5,null));};exports[_0x799b('0x56')]=function(_0x523c82,_0x4b8095,_0x5708bc){var _0x5afe5e;return db['VoiceContext'][_0x799b('0x56')](_0x523c82[_0x799b('0x57')],{'raw':!![]})['then'](function(_0x35aca0){_0x5afe5e=_0x35aca0;return db[_0x799b('0x4e')][_0x799b('0x51')]({'raw':!![]});})[_0x799b('0x1b')](function(_0x6305ff){var _0x5dcc7a=fs['readFileSync'](path[_0x799b('0x58')](config[_0x799b('0x59')],_0x799b('0x5a')),_0x799b('0x5b'));var _0x3fb771=ejs[_0x799b('0x5c')](_0x5dcc7a,{'contexts':_0x6305ff||[]});fs[_0x799b('0x5d')](_0x799b('0x5e'),_0x3fb771);})[_0x799b('0x1b')](function(){return respondWithRpcPromise(_0x799b('0x5f'),_0x799b('0x56'),{'module':_0x799b('0x60')});})[_0x799b('0x1b')](function(){var _0x2ecc2a=_0x523c82[_0x799b('0x61')][_0x799b('0x33')]({'plain':!![]});if(!_0x2ecc2a)throw new Error(_0x799b('0x62'));if(_0x2ecc2a['role']==='user'){var _0x38dcea=_0x5afe5e['get']({'plain':!![]});return db['UserProfileSection'][_0x799b('0x55')]({'where':{'name':'Contexts','userProfileId':_0x2ecc2a[_0x799b('0x63')]},'raw':!![]})[_0x799b('0x1b')](function(_0x3d0e78){if(_0x3d0e78&&_0x3d0e78['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x38dcea[_0x799b('0x37')],'resourceId':_0x38dcea['id'],'type':_0x3d0e78[_0x799b('0x37')],'sectionId':_0x3d0e78['id']},{})['then'](function(){return _0x5afe5e;});}else{return _0x5afe5e;}})[_0x799b('0x24')](function(_0x3a23d2){logger[_0x799b('0x21')](_0x799b('0x64'),_0x3a23d2);throw _0x3a23d2;});}return _0x5afe5e;})[_0x799b('0x1b')](respondWithResult(_0x4b8095,0xc9))[_0x799b('0x24')](handleError(_0x4b8095,null));};exports[_0x799b('0x31')]=function(_0x5cb22c,_0x50d6b1,_0x219775){var _0xcf4a90;return db[_0x799b('0x4e')][_0x799b('0x55')]({'where':{'id':_0x5cb22c[_0x799b('0x53')]['id']}})['then'](handleEntityNotFound(_0x50d6b1,null))['then'](saveUpdates(_0x5cb22c['body'],null))[_0x799b('0x1b')](function(_0x5bc360){if(_0x5bc360){_0xcf4a90=_0x5bc360;return db[_0x799b('0x4e')][_0x799b('0x51')]({'raw':!![]});}})['then'](function(_0x3b1e31){var _0x57107d=fs[_0x799b('0x65')](path['join'](config[_0x799b('0x59')],_0x799b('0x5a')),_0x799b('0x5b'));var _0x644c33=ejs[_0x799b('0x5c')](_0x57107d,{'contexts':_0x3b1e31||[]});fs[_0x799b('0x5d')](_0x799b('0x5e'),_0x644c33);})[_0x799b('0x1b')](function(){return respondWithRpcPromise('Reload',_0x799b('0x31'),{'module':_0x799b('0x60')});})[_0x799b('0x1b')](function(){return _0xcf4a90;})[_0x799b('0x1b')](respondWithResult(_0x50d6b1,null))[_0x799b('0x24')](handleError(_0x50d6b1,null));};exports['destroy']=function(_0xe9b71b,_0x3cb825,_0x560e10){var _0x272cdd;return db[_0x799b('0x4e')][_0x799b('0x55')]({'where':{'id':_0xe9b71b[_0x799b('0x53')]['id']}})[_0x799b('0x1b')](handleEntityNotFound(_0x3cb825,null))[_0x799b('0x1b')](removeEntity(_0x3cb825,null))['then'](function(){return db[_0x799b('0x4e')][_0x799b('0x51')]({'raw':!![]});})[_0x799b('0x1b')](function(_0xd05252){var _0x3e0381=fs[_0x799b('0x65')](path['join'](config[_0x799b('0x59')],_0x799b('0x5a')),_0x799b('0x5b'));var _0x4fee7b=ejs['render'](_0x3e0381,{'contexts':_0xd05252});fs['writeFileSync'](_0x799b('0x5e'),_0x4fee7b);return respondWithRpcPromise('Reload',_0x799b('0x32'),{'module':'chan_sip.so'});})[_0x799b('0x24')](handleError(_0x3cb825,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 22ac6f5..8b6a1e8 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 _0x90fc=['path','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment'];(function(_0x476b00,_0x250877){var _0x44ec8e=function(_0xec6b23){while(--_0xec6b23){_0x476b00['push'](_0x476b00['shift']());}};_0x44ec8e(++_0x250877);}(_0x90fc,0xe1));var _0xc90f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x90fc[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xc90f('0x0'));var util=require(_0xc90f('0x1'));var logger=require(_0xc90f('0x2'))(_0xc90f('0x3'));var moment=require(_0xc90f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc90f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module[_0xc90f('0x6')]=function(_0x17685e,_0x56f210){return _0x17685e[_0xc90f('0x7')](_0xc90f('0x8'),attributes,{'tableName':_0xc90f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0dd=['voice_contexts','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./voiceContext.attributes','exports','define','VoiceContext'];(function(_0x983683,_0x5d9a25){var _0x3ea281=function(_0x5e7e45){while(--_0x5e7e45){_0x983683['push'](_0x983683['shift']());}};_0x3ea281(++_0x5d9a25);}(_0xb0dd,0xc1));var _0xdb0d=function(_0xd81023,_0x4bbcb2){_0xd81023=_0xd81023-0x0;var _0x324c6d=_0xb0dd[_0xd81023];return _0x324c6d;};'use strict';var _=require(_0xdb0d('0x0'));var util=require(_0xdb0d('0x1'));var logger=require(_0xdb0d('0x2'))('api');var moment=require(_0xdb0d('0x3'));var BPromise=require(_0xdb0d('0x4'));var rp=require(_0xdb0d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb0d('0x6'));var config=require('../../config/environment');var attributes=require(_0xdb0d('0x7'));module[_0xdb0d('0x8')]=function(_0x43d9f8,_0xd69e1c){return _0x43d9f8[_0xdb0d('0x9')](_0xdb0d('0xa'),attributes,{'tableName':_0xdb0d('0xb'),'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 67e1eb0..4040709 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 _0xe5fc=['http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x39ff5a,_0x59a24f){var _0xda9abc=function(_0x35efe2){while(--_0x35efe2){_0x39ff5a['push'](_0x39ff5a['shift']());}};_0xda9abc(++_0x59a24f);}(_0xe5fc,0x109));var _0xce5f=function(_0x7e3626,_0xac2b4b){_0x7e3626=_0x7e3626-0x0;var _0x44547e=_0xe5fc[_0x7e3626];return _0x44547e;};'use strict';var _=require(_0xce5f('0x0'));var util=require('util');var moment=require(_0xce5f('0x1'));var BPromise=require(_0xce5f('0x2'));var rs=require(_0xce5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xce5f('0x4'))('rpc');var config=require(_0xce5f('0x5'));var jayson=require(_0xce5f('0x6'));var client=jayson[_0xce5f('0x7')][_0xce5f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b77ef,_0x30a150,_0x2b64dc){return new BPromise(function(_0x3451af,_0x4fa651){return client[_0xce5f('0x9')](_0x3b77ef,_0x2b64dc)[_0xce5f('0xa')](function(_0x29a7bf){logger[_0xce5f('0xb')](_0xce5f('0xc'),_0x30a150,_0xce5f('0xd'));logger[_0xce5f('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x30a150,_0xce5f('0xd'),JSON[_0xce5f('0xf')](_0x29a7bf));if(_0x29a7bf[_0xce5f('0x10')]){if(_0x29a7bf[_0xce5f('0x10')][_0xce5f('0x11')]===0x1f4){logger[_0xce5f('0x10')](_0xce5f('0xc'),_0x30a150,_0x29a7bf[_0xce5f('0x10')][_0xce5f('0x12')]);return _0x4fa651(_0x29a7bf['error']['message']);}logger['error'](_0xce5f('0xc'),_0x30a150,_0x29a7bf[_0xce5f('0x10')][_0xce5f('0x12')]);return _0x3451af(_0x29a7bf[_0xce5f('0x10')]['message']);}else{logger[_0xce5f('0xb')](_0xce5f('0xc'),_0x30a150,_0xce5f('0xd'));_0x3451af(_0x29a7bf[_0xce5f('0x13')][_0xce5f('0x12')]);}})[_0xce5f('0x14')](function(_0x1544ba){logger[_0xce5f('0x10')](_0xce5f('0xc'),_0x30a150,_0x1544ba);_0x4fa651(_0x1544ba);});});} \ No newline at end of file +var _0xa321=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','request','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','catch','lodash','util','moment'];(function(_0x56dbc3,_0x41c87a){var _0x58cf7f=function(_0x5a06e7){while(--_0x5a06e7){_0x56dbc3['push'](_0x56dbc3['shift']());}};_0x58cf7f(++_0x41c87a);}(_0xa321,0x9d));var _0x1a32=function(_0x509c83,_0x511882){_0x509c83=_0x509c83-0x0;var _0x534626=_0xa321[_0x509c83];return _0x534626;};'use strict';var _=require(_0x1a32('0x0'));var util=require(_0x1a32('0x1'));var moment=require(_0x1a32('0x2'));var BPromise=require(_0x1a32('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a32('0x4'));var db=require(_0x1a32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a32('0x6'))(_0x1a32('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1a32('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4859d6,_0x13b4d2,_0x1fa204){return new BPromise(function(_0xdfa9fe,_0x3f4723){return client[_0x1a32('0x9')](_0x4859d6,_0x1fa204)['then'](function(_0x343faf){logger[_0x1a32('0xa')]('VoiceContext,\x20%s,\x20%s',_0x13b4d2,_0x1a32('0xb'));logger[_0x1a32('0xc')](_0x1a32('0xd'),_0x13b4d2,_0x1a32('0xb'),JSON[_0x1a32('0xe')](_0x343faf));if(_0x343faf[_0x1a32('0xf')]){if(_0x343faf['error'][_0x1a32('0x10')]===0x1f4){logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x343faf['error'][_0x1a32('0x12')]);return _0x3f4723(_0x343faf[_0x1a32('0xf')][_0x1a32('0x12')]);}logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x343faf['error'][_0x1a32('0x12')]);return _0xdfa9fe(_0x343faf[_0x1a32('0xf')][_0x1a32('0x12')]);}else{logger[_0x1a32('0xa')](_0x1a32('0x11'),_0x13b4d2,_0x1a32('0xb'));_0xdfa9fe(_0x343faf['result'][_0x1a32('0x12')]);}})[_0x1a32('0x13')](function(_0x47bb8e){logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x47bb8e);_0x3f4723(_0x47bb8e);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 5d34d13..b9066ff 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 _0x066f=['describe','/:id','show','post','put','update','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x164ddc,_0x12ed72){var _0x54ff05=function(_0x27aafa){while(--_0x27aafa){_0x164ddc['push'](_0x164ddc['shift']());}};_0x54ff05(++_0x12ed72);}(_0x066f,0x137));var _0xf066=function(_0x575ea2,_0x47569f){_0x575ea2=_0x575ea2-0x0;var _0x4ce5a4=_0x066f[_0x575ea2];return _0x4ce5a4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf066('0x0'));var timeout=require('connect-timeout');var express=require(_0xf066('0x1'));var router=express[_0xf066('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf066('0x3'));var interaction=require(_0xf066('0x4'));var config=require(_0xf066('0x5'));var controller=require('./voiceDialReport.controller');router[_0xf066('0x6')]('/',auth[_0xf066('0x7')](),controller[_0xf066('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf066('0x9')]);router[_0xf066('0x6')](_0xf066('0xa'),auth['isAuthenticated'](),controller[_0xf066('0xb')]);router[_0xf066('0xc')]('/',auth[_0xf066('0x7')](),controller['create']);router[_0xf066('0xd')]('/:id',auth[_0xf066('0x7')](),controller[_0xf066('0xe')]);router['delete'](_0xf066('0xa'),auth[_0xf066('0x7')](),controller['destroy']);module[_0xf066('0xf')]=router; \ No newline at end of file +var _0xb6fc=['destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','create','put','update','delete'];(function(_0x23c0a6,_0x3529f8){var _0x460869=function(_0x30f8ef){while(--_0x30f8ef){_0x23c0a6['push'](_0x23c0a6['shift']());}};_0x460869(++_0x3529f8);}(_0xb6fc,0x72));var _0xcb6f=function(_0x4035c7,_0x188c0a){_0x4035c7=_0x4035c7-0x0;var _0x22d774=_0xb6fc[_0x4035c7];return _0x22d774;};'use strict';var multer=require(_0xcb6f('0x0'));var util=require(_0xcb6f('0x1'));var path=require('path');var timeout=require(_0xcb6f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcb6f('0x3'));var interaction=require(_0xcb6f('0x4'));var config=require('../../config/environment');var controller=require(_0xcb6f('0x5'));router[_0xcb6f('0x6')]('/',auth[_0xcb6f('0x7')](),controller[_0xcb6f('0x8')]);router['get'](_0xcb6f('0x9'),auth[_0xcb6f('0x7')](),controller['describe']);router[_0xcb6f('0x6')]('/:id',auth[_0xcb6f('0x7')](),controller['show']);router['post']('/',auth[_0xcb6f('0x7')](),controller[_0xcb6f('0xa')]);router[_0xcb6f('0xb')]('/:id',auth[_0xcb6f('0x7')](),controller[_0xcb6f('0xc')]);router[_0xcb6f('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xcb6f('0xe')]);module[_0xcb6f('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 0ed90b9..79d8dc1 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 _0x9f62=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x301ca3,_0x4233c5){var _0x131292=function(_0x4b64fd){while(--_0x4b64fd){_0x301ca3['push'](_0x301ca3['shift']());}};_0x131292(++_0x4233c5);}(_0x9f62,0x154));var _0x29f6=function(_0x4f49cf,_0x25d447){_0x4f49cf=_0x4f49cf-0x0;var _0x60936=_0x9f62[_0x4f49cf];return _0x60936;};'use strict';var Sequelize=require('sequelize');module[_0x29f6('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x29f6('0x1')]},'channelstate':{'type':Sequelize[_0x29f6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x29f6('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'connectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'language':{'type':Sequelize[_0x29f6('0x1')]},'accountcode':{'type':Sequelize[_0x29f6('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x29f6('0x1')]},'priority':{'type':Sequelize[_0x29f6('0x2')]},'uniqueid':{'type':Sequelize[_0x29f6('0x1')]},'linkedid':{'type':Sequelize[_0x29f6('0x1')]},'destchannel':{'type':Sequelize[_0x29f6('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x29f6('0x1')]},'destexten':{'type':Sequelize[_0x29f6('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x29f6('0x1')]},'destlinkedid':{'type':Sequelize[_0x29f6('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x29f6('0x3')]},'lastevent':{'type':Sequelize[_0x29f6('0x1')],'comment':_0x29f6('0x4')},'routeId':{'type':Sequelize[_0x29f6('0x2')]},'duration':{'type':Sequelize[_0x29f6('0x2')]},'holdtime':{'type':Sequelize[_0x29f6('0x2')]},'billableseconds':{'type':Sequelize[_0x29f6('0x2')]}}; \ No newline at end of file +var _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x7d7194,_0x2ab6d8){var _0x25b172=function(_0x156553){while(--_0x156553){_0x7d7194['push'](_0x7d7194['shift']());}};_0x25b172(++_0x2ab6d8);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x22593d,_0x19999b){_0x22593d=_0x22593d-0x0;var _0x4e2e0c=_0x8d0e[_0x22593d];return _0x4e2e0c;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index bc5e28e..bb41f34 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 _0x1336=['ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','name','send','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','options','VoiceDialReport','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv'];(function(_0x3f7471,_0x2cfcef){var _0x5aa4e4=function(_0x732e61){while(--_0x732e61){_0x3f7471['push'](_0x3f7471['shift']());}};_0x5aa4e4(++_0x2cfcef);}(_0x1336,0x122));var _0x6133=function(_0x2047d0,_0x589165){_0x2047d0=_0x2047d0-0x0;var _0x14ebfc=_0x1336[_0x2047d0];return _0x14ebfc;};'use strict';var emlformat=require(_0x6133('0x0'));var rimraf=require(_0x6133('0x1'));var zipdir=require(_0x6133('0x2'));var jsonpatch=require(_0x6133('0x3'));var rp=require('request-promise');var moment=require(_0x6133('0x4'));var BPromise=require(_0x6133('0x5'));var Mustache=require(_0x6133('0x6'));var util=require(_0x6133('0x7'));var path=require(_0x6133('0x8'));var sox=require('sox');var csv=require(_0x6133('0x9'));var ejs=require(_0x6133('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6133('0xb'));var squel=require('squel');var crypto=require(_0x6133('0xc'));var jsforce=require(_0x6133('0xd'));var deskjs=require(_0x6133('0xe'));var toCsv=require(_0x6133('0x9'));var querystring=require(_0x6133('0xf'));var Papa=require(_0x6133('0x10'));var Redis=require(_0x6133('0x11'));var authService=require(_0x6133('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6133('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6133('0x14'));var utils=require('../../config/utils');var config=require(_0x6133('0x15'));var licenseUtil=require(_0x6133('0x16'));var db=require(_0x6133('0x17'))['db'];function respondWithStatusCode(_0x7089fc,_0xe5dd7a){_0xe5dd7a=_0xe5dd7a||0xcc;return function(_0x2d6615){if(_0x2d6615){return _0x7089fc[_0x6133('0x18')](_0xe5dd7a);}return _0x7089fc[_0x6133('0x19')](_0xe5dd7a)[_0x6133('0x1a')]();};}function respondWithResult(_0x18ca5c,_0x23c752){_0x23c752=_0x23c752||0xc8;return function(_0x3b758b){if(_0x3b758b){return _0x18ca5c[_0x6133('0x19')](_0x23c752)['json'](_0x3b758b);}};}function respondWithFilteredResult(_0x72e517,_0x5020c3){return function(_0x1177a1){if(_0x1177a1){var _0x402612=typeof _0x5020c3[_0x6133('0x1b')]===_0x6133('0x1c')&&typeof _0x5020c3['limit']==='undefined';var _0x20da57=_0x1177a1['count'];var _0x9d5174=_0x402612?0x0:_0x5020c3[_0x6133('0x1b')];var _0x4f0b15=_0x402612?_0x1177a1[_0x6133('0x1d')]:_0x5020c3[_0x6133('0x1b')]+_0x5020c3[_0x6133('0x1e')];var _0x2ba246;if(_0x4f0b15>=_0x20da57){_0x4f0b15=_0x20da57;_0x2ba246=0xc8;}else{_0x2ba246=0xce;}_0x72e517[_0x6133('0x19')](_0x2ba246);return _0x72e517[_0x6133('0x1f')](_0x6133('0x20'),_0x9d5174+'-'+_0x4f0b15+'/'+_0x20da57)[_0x6133('0x21')](_0x1177a1);}return null;};}function patchUpdates(_0x430104){return function(_0x15791d){try{jsonpatch[_0x6133('0x22')](_0x15791d,_0x430104,!![]);}catch(_0x3a4d11){return BPromise[_0x6133('0x23')](_0x3a4d11);}return _0x15791d[_0x6133('0x24')]();};}function saveUpdates(_0xa468e4,_0x3c624f){return function(_0x51bf75){if(_0x51bf75){return _0x51bf75[_0x6133('0x25')](_0xa468e4)[_0x6133('0x26')](function(_0x12a5de){return _0x12a5de;});}return null;};}function removeEntity(_0x4f309c,_0xb7d6af){return function(_0x5a7fcd){if(_0x5a7fcd){return _0x5a7fcd['destroy']()[_0x6133('0x26')](function(){_0x4f309c[_0x6133('0x19')](0xcc)[_0x6133('0x1a')]();});}};}function handleEntityNotFound(_0x2c5d4a,_0x2aeda9){return function(_0x14d611){if(!_0x14d611){_0x2c5d4a['sendStatus'](0x194);}return _0x14d611;};}function handleError(_0x2ccafb,_0x26ac78){_0x26ac78=_0x26ac78||0x1f4;return function(_0x23bfb7){logger[_0x6133('0x27')](_0x23bfb7['stack']);if(_0x23bfb7[_0x6133('0x28')]){delete _0x23bfb7[_0x6133('0x28')];}_0x2ccafb[_0x6133('0x19')](_0x26ac78)[_0x6133('0x29')](_0x23bfb7);};}exports['index']=function(_0x3f795b,_0x1425f4){var _0x1d776f={},_0x3aa35f={},_0x2a81ea={'count':0x0,'rows':[]};var _0x1dcf8c=_[_0x6133('0x2a')](db['VoiceDialReport'][_0x6133('0x2b')],function(_0x4757f4){return{'name':_0x4757f4['fieldName'],'type':_0x4757f4['type'][_0x6133('0x2c')]};});_0x3aa35f[_0x6133('0x2d')]=_[_0x6133('0x2a')](_0x1dcf8c,_0x6133('0x28'));_0x3aa35f[_0x6133('0x2e')]=_[_0x6133('0x2f')](_0x3f795b[_0x6133('0x2e')]);_0x3aa35f[_0x6133('0x30')]=_[_0x6133('0x31')](_0x3aa35f[_0x6133('0x2d')],_0x3aa35f[_0x6133('0x2e')]);_0x1d776f['attributes']=_[_0x6133('0x31')](_0x3aa35f[_0x6133('0x2d')],qs[_0x6133('0x32')](_0x3f795b[_0x6133('0x2e')][_0x6133('0x32')]));_0x1d776f[_0x6133('0x33')]=_0x1d776f['attributes']['length']?_0x1d776f[_0x6133('0x33')]:_0x3aa35f[_0x6133('0x2d')];if(!_0x3f795b['query'][_0x6133('0x34')](_0x6133('0x35'))){_0x1d776f['limit']=qs[_0x6133('0x1e')](_0x3f795b['query'][_0x6133('0x1e')]);_0x1d776f[_0x6133('0x1b')]=qs[_0x6133('0x1b')](_0x3f795b[_0x6133('0x2e')][_0x6133('0x1b')]);}_0x1d776f[_0x6133('0x36')]=qs[_0x6133('0x37')](_0x3f795b[_0x6133('0x2e')]['sort']);_0x1d776f[_0x6133('0x38')]=qs[_0x6133('0x30')](_[_0x6133('0x39')](_0x3f795b['query'],_0x3aa35f['filters']),_0x1dcf8c);if(_0x3f795b['query'][_0x6133('0x3a')]){_0x1d776f[_0x6133('0x38')]=_['merge'](_0x1d776f[_0x6133('0x38')],{'$or':_[_0x6133('0x2a')](_0x1dcf8c,function(_0x1c4491){if(_0x1c4491[_0x6133('0x3b')]!=='VIRTUAL'){var _0x3290f9={};_0x3290f9[_0x1c4491[_0x6133('0x28')]]={'$like':'%'+_0x3f795b[_0x6133('0x2e')][_0x6133('0x3a')]+'%'};return _0x3290f9;}})});}_0x1d776f=_['merge']({},_0x1d776f,_0x3f795b[_0x6133('0x3c')]);var _0x193403={'where':_0x1d776f['where']};return db[_0x6133('0x3d')][_0x6133('0x1d')](_0x193403)[_0x6133('0x26')](function(_0x166df7){_0x2a81ea[_0x6133('0x1d')]=_0x166df7;if(_0x3f795b[_0x6133('0x2e')][_0x6133('0x3e')]){_0x1d776f['include']=[{'all':!![]}];}return db[_0x6133('0x3d')][_0x6133('0x3f')](_0x1d776f);})[_0x6133('0x26')](function(_0x455792){_0x2a81ea[_0x6133('0x40')]=_0x455792;return _0x2a81ea;})[_0x6133('0x26')](respondWithFilteredResult(_0x1425f4,_0x1d776f))[_0x6133('0x41')](handleError(_0x1425f4,null));};exports[_0x6133('0x42')]=function(_0x4c6ae5,_0x497a9c){var _0x52c541={'raw':!![],'where':{'id':_0x4c6ae5[_0x6133('0x43')]['id']}},_0x54b509={};_0x54b509['model']=_[_0x6133('0x2f')](db['VoiceDialReport'][_0x6133('0x2b')]);_0x54b509['query']=_['keys'](_0x4c6ae5['query']);_0x54b509['filters']=_[_0x6133('0x31')](_0x54b509['model'],_0x54b509[_0x6133('0x2e')]);_0x52c541['attributes']=_[_0x6133('0x31')](_0x54b509[_0x6133('0x2d')],qs[_0x6133('0x32')](_0x4c6ae5[_0x6133('0x2e')][_0x6133('0x32')]));_0x52c541[_0x6133('0x33')]=_0x52c541[_0x6133('0x33')]['length']?_0x52c541['attributes']:_0x54b509[_0x6133('0x2d')];if(_0x4c6ae5[_0x6133('0x2e')]['includeAll']){_0x52c541[_0x6133('0x44')]=[{'all':!![]}];}_0x52c541=_[_0x6133('0x45')]({},_0x52c541,_0x4c6ae5[_0x6133('0x3c')]);return db[_0x6133('0x3d')][_0x6133('0x46')](_0x52c541)[_0x6133('0x26')](handleEntityNotFound(_0x497a9c,null))[_0x6133('0x26')](respondWithResult(_0x497a9c,null))[_0x6133('0x41')](handleError(_0x497a9c,null));};exports[_0x6133('0x47')]=function(_0x22f320,_0x1928bf){return db[_0x6133('0x3d')][_0x6133('0x47')](_0x22f320['body'],{})[_0x6133('0x26')](respondWithResult(_0x1928bf,0xc9))[_0x6133('0x41')](handleError(_0x1928bf,null));};exports['update']=function(_0x2f22f1,_0x488f33){if(_0x2f22f1['body']['id']){delete _0x2f22f1[_0x6133('0x48')]['id'];}return db[_0x6133('0x3d')][_0x6133('0x46')]({'where':{'id':_0x2f22f1[_0x6133('0x43')]['id']}})[_0x6133('0x26')](handleEntityNotFound(_0x488f33,null))[_0x6133('0x26')](saveUpdates(_0x2f22f1[_0x6133('0x48')],null))['then'](respondWithResult(_0x488f33,null))['catch'](handleError(_0x488f33,null));};exports[_0x6133('0x49')]=function(_0x5d9fec,_0x34c803){return db['VoiceDialReport']['find']({'where':{'id':_0x5d9fec['params']['id']}})['then'](handleEntityNotFound(_0x34c803,null))[_0x6133('0x26')](removeEntity(_0x34c803,null))[_0x6133('0x41')](handleError(_0x34c803,null));};exports[_0x6133('0x4a')]=function(_0x4e0ba7,_0x5a3d6e){return db[_0x6133('0x3d')][_0x6133('0x4a')]()[_0x6133('0x26')](respondWithResult(_0x5a3d6e,null))['catch'](handleError(_0x5a3d6e,null));}; \ No newline at end of file +var _0x1deb=['body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','VoiceDialReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','find','create'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x1deb,0x17e));var _0xb1de=function(_0x12d3ae,_0x793889){_0x12d3ae=_0x12d3ae-0x0;var _0x52107d=_0x1deb[_0x12d3ae];return _0x52107d;};'use strict';var emlformat=require(_0xb1de('0x0'));var rimraf=require(_0xb1de('0x1'));var zipdir=require(_0xb1de('0x2'));var jsonpatch=require(_0xb1de('0x3'));var rp=require(_0xb1de('0x4'));var moment=require(_0xb1de('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb1de('0x6'));var util=require(_0xb1de('0x7'));var path=require('path');var sox=require(_0xb1de('0x8'));var csv=require(_0xb1de('0x9'));var ejs=require(_0xb1de('0xa'));var fs=require('fs');var fs_extra=require(_0xb1de('0xb'));var _=require(_0xb1de('0xc'));var squel=require(_0xb1de('0xd'));var crypto=require(_0xb1de('0xe'));var jsforce=require(_0xb1de('0xf'));var deskjs=require(_0xb1de('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb1de('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb1de('0x12'));var as=require(_0xb1de('0x13'));var hardwareService=require(_0xb1de('0x14'));var logger=require(_0xb1de('0x15'))(_0xb1de('0x16'));var utils=require(_0xb1de('0x17'));var config=require(_0xb1de('0x18'));var licenseUtil=require(_0xb1de('0x19'));var db=require(_0xb1de('0x1a'))['db'];function respondWithStatusCode(_0xb1319e,_0x51acbf){_0x51acbf=_0x51acbf||0xcc;return function(_0x1a4df9){if(_0x1a4df9){return _0xb1319e[_0xb1de('0x1b')](_0x51acbf);}return _0xb1319e[_0xb1de('0x1c')](_0x51acbf)[_0xb1de('0x1d')]();};}function respondWithResult(_0xa74203,_0x2f07c3){_0x2f07c3=_0x2f07c3||0xc8;return function(_0x42384c){if(_0x42384c){return _0xa74203['status'](_0x2f07c3)[_0xb1de('0x1e')](_0x42384c);}};}function respondWithFilteredResult(_0x29dfd1,_0x3cc531){return function(_0x432836){if(_0x432836){var _0x46702c=typeof _0x3cc531[_0xb1de('0x1f')]===_0xb1de('0x20')&&typeof _0x3cc531[_0xb1de('0x21')]===_0xb1de('0x20');var _0x2783fb=_0x432836[_0xb1de('0x22')];var _0xeaa5f0=_0x46702c?0x0:_0x3cc531[_0xb1de('0x1f')];var _0x4ffdce=_0x46702c?_0x432836[_0xb1de('0x22')]:_0x3cc531['offset']+_0x3cc531['limit'];var _0x4f9d4b;if(_0x4ffdce>=_0x2783fb){_0x4ffdce=_0x2783fb;_0x4f9d4b=0xc8;}else{_0x4f9d4b=0xce;}_0x29dfd1['status'](_0x4f9d4b);return _0x29dfd1['set'](_0xb1de('0x23'),_0xeaa5f0+'-'+_0x4ffdce+'/'+_0x2783fb)[_0xb1de('0x1e')](_0x432836);}return null;};}function patchUpdates(_0x28d95a){return function(_0x4ddc22){try{jsonpatch[_0xb1de('0x24')](_0x4ddc22,_0x28d95a,!![]);}catch(_0x15e1c3){return BPromise[_0xb1de('0x25')](_0x15e1c3);}return _0x4ddc22['save']();};}function saveUpdates(_0x330b5c,_0x13ccf8){return function(_0x516c03){if(_0x516c03){return _0x516c03[_0xb1de('0x26')](_0x330b5c)[_0xb1de('0x27')](function(_0x35e6d1){return _0x35e6d1;});}return null;};}function removeEntity(_0x4bd11f,_0x9b8eaa){return function(_0x201df7){if(_0x201df7){return _0x201df7[_0xb1de('0x28')]()['then'](function(){_0x4bd11f[_0xb1de('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1deec4,_0x108d56){return function(_0x5f0f82){if(!_0x5f0f82){_0x1deec4[_0xb1de('0x1b')](0x194);}return _0x5f0f82;};}function handleError(_0x4da5ee,_0x298942){_0x298942=_0x298942||0x1f4;return function(_0x5031b4){logger[_0xb1de('0x29')](_0x5031b4[_0xb1de('0x2a')]);if(_0x5031b4[_0xb1de('0x2b')]){delete _0x5031b4[_0xb1de('0x2b')];}_0x4da5ee['status'](_0x298942)[_0xb1de('0x2c')](_0x5031b4);};}exports['index']=function(_0x26cf0c,_0x10090a){var _0x318af5={},_0x2c3e89={},_0x55a37f={'count':0x0,'rows':[]};var _0x383743=_[_0xb1de('0x2d')](db[_0xb1de('0x2e')]['rawAttributes'],function(_0xcf8b4d){return{'name':_0xcf8b4d[_0xb1de('0x2f')],'type':_0xcf8b4d[_0xb1de('0x30')]['key']};});_0x2c3e89[_0xb1de('0x31')]=_[_0xb1de('0x2d')](_0x383743,_0xb1de('0x2b'));_0x2c3e89[_0xb1de('0x32')]=_[_0xb1de('0x33')](_0x26cf0c[_0xb1de('0x32')]);_0x2c3e89[_0xb1de('0x34')]=_[_0xb1de('0x35')](_0x2c3e89[_0xb1de('0x31')],_0x2c3e89[_0xb1de('0x32')]);_0x318af5[_0xb1de('0x36')]=_[_0xb1de('0x35')](_0x2c3e89[_0xb1de('0x31')],qs[_0xb1de('0x37')](_0x26cf0c[_0xb1de('0x32')][_0xb1de('0x37')]));_0x318af5['attributes']=_0x318af5[_0xb1de('0x36')][_0xb1de('0x38')]?_0x318af5[_0xb1de('0x36')]:_0x2c3e89[_0xb1de('0x31')];if(!_0x26cf0c['query'][_0xb1de('0x39')](_0xb1de('0x3a'))){_0x318af5[_0xb1de('0x21')]=qs[_0xb1de('0x21')](_0x26cf0c[_0xb1de('0x32')][_0xb1de('0x21')]);_0x318af5['offset']=qs[_0xb1de('0x1f')](_0x26cf0c[_0xb1de('0x32')][_0xb1de('0x1f')]);}_0x318af5['order']=qs['sort'](_0x26cf0c['query'][_0xb1de('0x3b')]);_0x318af5[_0xb1de('0x3c')]=qs[_0xb1de('0x34')](_[_0xb1de('0x3d')](_0x26cf0c[_0xb1de('0x32')],_0x2c3e89['filters']),_0x383743);if(_0x26cf0c[_0xb1de('0x32')]['filter']){_0x318af5[_0xb1de('0x3c')]=_[_0xb1de('0x3e')](_0x318af5['where'],{'$or':_['map'](_0x383743,function(_0x32caa6){if(_0x32caa6[_0xb1de('0x30')]!==_0xb1de('0x3f')){var _0xf8015c={};_0xf8015c[_0x32caa6[_0xb1de('0x2b')]]={'$like':'%'+_0x26cf0c['query'][_0xb1de('0x40')]+'%'};return _0xf8015c;}})});}_0x318af5=_['merge']({},_0x318af5,_0x26cf0c['options']);var _0xb50ef8={'where':_0x318af5[_0xb1de('0x3c')]};return db[_0xb1de('0x2e')][_0xb1de('0x22')](_0xb50ef8)['then'](function(_0x3d52de){_0x55a37f[_0xb1de('0x22')]=_0x3d52de;if(_0x26cf0c[_0xb1de('0x32')][_0xb1de('0x41')]){_0x318af5[_0xb1de('0x42')]=[{'all':!![]}];}return db[_0xb1de('0x2e')][_0xb1de('0x43')](_0x318af5);})[_0xb1de('0x27')](function(_0x5d7a73){_0x55a37f[_0xb1de('0x44')]=_0x5d7a73;return _0x55a37f;})[_0xb1de('0x27')](respondWithFilteredResult(_0x10090a,_0x318af5))[_0xb1de('0x45')](handleError(_0x10090a,null));};exports[_0xb1de('0x46')]=function(_0x397b75,_0x39eee9){var _0x247f30={'raw':!![],'where':{'id':_0x397b75[_0xb1de('0x47')]['id']}},_0x8e16e9={};_0x8e16e9[_0xb1de('0x31')]=_[_0xb1de('0x33')](db[_0xb1de('0x2e')]['rawAttributes']);_0x8e16e9[_0xb1de('0x32')]=_[_0xb1de('0x33')](_0x397b75['query']);_0x8e16e9[_0xb1de('0x34')]=_[_0xb1de('0x35')](_0x8e16e9['model'],_0x8e16e9[_0xb1de('0x32')]);_0x247f30[_0xb1de('0x36')]=_[_0xb1de('0x35')](_0x8e16e9[_0xb1de('0x31')],qs[_0xb1de('0x37')](_0x397b75[_0xb1de('0x32')][_0xb1de('0x37')]));_0x247f30[_0xb1de('0x36')]=_0x247f30[_0xb1de('0x36')][_0xb1de('0x38')]?_0x247f30['attributes']:_0x8e16e9[_0xb1de('0x31')];if(_0x397b75[_0xb1de('0x32')]['includeAll']){_0x247f30[_0xb1de('0x42')]=[{'all':!![]}];}_0x247f30=_[_0xb1de('0x3e')]({},_0x247f30,_0x397b75['options']);return db[_0xb1de('0x2e')][_0xb1de('0x48')](_0x247f30)['then'](handleEntityNotFound(_0x39eee9,null))[_0xb1de('0x27')](respondWithResult(_0x39eee9,null))[_0xb1de('0x45')](handleError(_0x39eee9,null));};exports[_0xb1de('0x49')]=function(_0x5000dd,_0x2603af){return db[_0xb1de('0x2e')][_0xb1de('0x49')](_0x5000dd[_0xb1de('0x4a')],{})[_0xb1de('0x27')](respondWithResult(_0x2603af,0xc9))[_0xb1de('0x45')](handleError(_0x2603af,null));};exports[_0xb1de('0x26')]=function(_0x173a49,_0x44fe9d){if(_0x173a49[_0xb1de('0x4a')]['id']){delete _0x173a49[_0xb1de('0x4a')]['id'];}return db[_0xb1de('0x2e')]['find']({'where':{'id':_0x173a49[_0xb1de('0x47')]['id']}})[_0xb1de('0x27')](handleEntityNotFound(_0x44fe9d,null))[_0xb1de('0x27')](saveUpdates(_0x173a49[_0xb1de('0x4a')],null))[_0xb1de('0x27')](respondWithResult(_0x44fe9d,null))['catch'](handleError(_0x44fe9d,null));};exports[_0xb1de('0x28')]=function(_0x25bcc0,_0x33690d){return db['VoiceDialReport'][_0xb1de('0x48')]({'where':{'id':_0x25bcc0[_0xb1de('0x47')]['id']}})[_0xb1de('0x27')](handleEntityNotFound(_0x33690d,null))[_0xb1de('0x27')](removeEntity(_0x33690d,null))[_0xb1de('0x45')](handleError(_0x33690d,null));};exports['describe']=function(_0x1f5f44,_0x3e50c3){return db['VoiceDialReport'][_0xb1de('0x4b')]()[_0xb1de('0x27')](respondWithResult(_0x3e50c3,null))[_0xb1de('0x45')](handleError(_0x3e50c3,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 3208cca..df90d9f 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 _0xb40c=['lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./voiceDialReport.attributes','exports','define','uniqueid'];(function(_0xf487ae,_0x53c6ff){var _0x4a5dbe=function(_0x3f9d1d){while(--_0x3f9d1d){_0xf487ae['push'](_0xf487ae['shift']());}};_0x4a5dbe(++_0x53c6ff);}(_0xb40c,0x79));var _0xcb40=function(_0x26019a,_0x58e0e4){_0x26019a=_0x26019a-0x0;var _0xafe52b=_0xb40c[_0x26019a];return _0xafe52b;};'use strict';var _=require(_0xcb40('0x0'));var util=require(_0xcb40('0x1'));var logger=require(_0xcb40('0x2'))('api');var moment=require(_0xcb40('0x3'));var BPromise=require('bluebird');var rp=require(_0xcb40('0x4'));var fs=require('fs');var path=require(_0xcb40('0x5'));var rimraf=require('rimraf');var config=require(_0xcb40('0x6'));var attributes=require(_0xcb40('0x7'));module[_0xcb40('0x8')]=function(_0x1d5ad5,_0x474ead){return _0x1d5ad5[_0xcb40('0x9')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xcb40('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x94a1=['request-promise','path','rimraf','exports','define','report_dial','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x419e2d,_0x4c516f){var _0x3029bb=function(_0x56bf5a){while(--_0x56bf5a){_0x419e2d['push'](_0x419e2d['shift']());}};_0x3029bb(++_0x4c516f);}(_0x94a1,0x8b));var _0x194a=function(_0x144f72,_0x560350){_0x144f72=_0x144f72-0x0;var _0x3b768e=_0x94a1[_0x144f72];return _0x3b768e;};'use strict';var _=require(_0x194a('0x0'));var util=require('util');var logger=require(_0x194a('0x1'))(_0x194a('0x2'));var moment=require(_0x194a('0x3'));var BPromise=require(_0x194a('0x4'));var rp=require(_0x194a('0x5'));var fs=require('fs');var path=require(_0x194a('0x6'));var rimraf=require(_0x194a('0x7'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0x194a('0x8')]=function(_0x9c26c2,_0x41007b){return _0x9c26c2[_0x194a('0x9')]('VoiceDialReport',attributes,{'tableName':_0x194a('0xa'),'paranoid':![],'indexes':[{'fields':[_0x194a('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 33549c1..a0ff5da 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 _0x135a=['request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','where','attributes','limit','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x19344e,_0x1f8da1){var _0x590d32=function(_0x359cf5){while(--_0x359cf5){_0x19344e['push'](_0x19344e['shift']());}};_0x590d32(++_0x1f8da1);}(_0x135a,0x140));var _0xa135=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x135a[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xa135('0x0'));var util=require(_0xa135('0x1'));var moment=require(_0xa135('0x2'));var BPromise=require(_0xa135('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa135('0x4'));var logger=require(_0xa135('0x5'))(_0xa135('0x6'));var config=require(_0xa135('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa135('0x8')][_0xa135('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24c9a5,_0x475f4f,_0x4ee21f){return new BPromise(function(_0x37c2d9,_0x36f541){return client[_0xa135('0xa')](_0x24c9a5,_0x4ee21f)[_0xa135('0xb')](function(_0x16170c){logger[_0xa135('0xc')](_0xa135('0xd'),_0x475f4f,_0xa135('0xe'));logger[_0xa135('0xf')](_0xa135('0x10'),_0x475f4f,'request\x20sent',JSON[_0xa135('0x11')](_0x16170c));if(_0x16170c[_0xa135('0x12')]){if(_0x16170c[_0xa135('0x12')]['code']===0x1f4){logger[_0xa135('0x12')](_0xa135('0xd'),_0x475f4f,_0x16170c[_0xa135('0x12')]['message']);return _0x36f541(_0x16170c[_0xa135('0x12')][_0xa135('0x13')]);}logger[_0xa135('0x12')](_0xa135('0xd'),_0x475f4f,_0x16170c['error'][_0xa135('0x13')]);return _0x37c2d9(_0x16170c[_0xa135('0x12')][_0xa135('0x13')]);}else{logger[_0xa135('0xc')](_0xa135('0xd'),_0x475f4f,_0xa135('0xe'));_0x37c2d9(_0x16170c[_0xa135('0x14')][_0xa135('0x13')]);}})[_0xa135('0x15')](function(_0x50aafe){logger[_0xa135('0x12')](_0xa135('0xd'),_0x475f4f,_0x50aafe);_0x36f541(_0x50aafe);});});}exports[_0xa135('0x16')]=function(_0x4409ed){var _0x5af52f=this;return new Promise(function(_0x1319c5,_0x3f592d){return db[_0xa135('0x17')][_0xa135('0x18')](_0x4409ed[_0xa135('0x19')],{'raw':_0x4409ed[_0xa135('0x1a')]?_0x4409ed[_0xa135('0x1a')][_0xa135('0x1b')]===undefined?!![]:![]:!![]})[_0xa135('0xb')](function(_0x5b0056){logger[_0xa135('0xc')](_0xa135('0x16'),_0x4409ed);logger[_0xa135('0xf')](_0xa135('0x16'),_0x4409ed,JSON[_0xa135('0x11')](_0x5b0056));_0x1319c5(_0x5b0056);})[_0xa135('0x15')](function(_0x4d1115){logger[_0xa135('0x12')](_0xa135('0x16'),_0x4d1115[_0xa135('0x13')],_0x4409ed);_0x3f592d(_0x5af52f[_0xa135('0x12')](0x1f4,_0x4d1115['message']));});});};exports[_0xa135('0x1c')]=function(_0x4b0f0f){var _0x18c733=this;return new Promise(function(_0x57c822,_0x52a508){return db[_0xa135('0x17')][_0xa135('0x1d')](_0x4b0f0f['body'],{'raw':_0x4b0f0f[_0xa135('0x1a')]?_0x4b0f0f[_0xa135('0x1a')][_0xa135('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b0f0f[_0xa135('0x1a')]?_0x4b0f0f[_0xa135('0x1a')][_0xa135('0x1e')]||null:null,'attributes':_0x4b0f0f['options']?_0x4b0f0f[_0xa135('0x1a')][_0xa135('0x1f')]||null:null,'limit':_0x4b0f0f['options']?_0x4b0f0f['options'][_0xa135('0x20')]||null:null})[_0xa135('0xb')](function(_0x12b828){logger[_0xa135('0xc')](_0xa135('0x1c'),_0x4b0f0f);logger[_0xa135('0xf')](_0xa135('0x1c'),_0x4b0f0f,JSON['stringify'](_0x12b828));_0x57c822(_0x12b828);})['catch'](function(_0x4075e8){logger[_0xa135('0x12')](_0xa135('0x1c'),_0x4075e8[_0xa135('0x13')],_0x4b0f0f);_0x52a508(_0x18c733[_0xa135('0x12')](0x1f4,_0x4075e8[_0xa135('0x13')]));});});}; \ No newline at end of file +var _0xe8bd=['body','options','raw','stringify','UpdateVoiceDialReport','update','where','attributes','then','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create'];(function(_0x555dde,_0x5ac695){var _0x1b7e71=function(_0x28119b){while(--_0x28119b){_0x555dde['push'](_0x555dde['shift']());}};_0x1b7e71(++_0x5ac695);}(_0xe8bd,0x169));var _0xde8b=function(_0x1fe024,_0x1bc26c){_0x1fe024=_0x1fe024-0x0;var _0x20f4b4=_0xe8bd[_0x1fe024];return _0x20f4b4;};'use strict';var _=require('lodash');var util=require(_0xde8b('0x0'));var moment=require(_0xde8b('0x1'));var BPromise=require(_0xde8b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde8b('0x3'));var db=require(_0xde8b('0x4'))['db'];var utils=require(_0xde8b('0x5'));var logger=require(_0xde8b('0x6'))(_0xde8b('0x7'));var config=require('../../config/environment');var jayson=require(_0xde8b('0x8'));var client=jayson[_0xde8b('0x9')][_0xde8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48cd3e,_0x4ef59d,_0x5883f1){return new BPromise(function(_0xedbd69,_0x5bbf2b){return client['request'](_0x48cd3e,_0x5883f1)['then'](function(_0x29baef){logger[_0xde8b('0xb')](_0xde8b('0xc'),_0x4ef59d,_0xde8b('0xd'));logger[_0xde8b('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x4ef59d,_0xde8b('0xd'),JSON['stringify'](_0x29baef));if(_0x29baef['error']){if(_0x29baef[_0xde8b('0xf')][_0xde8b('0x10')]===0x1f4){logger[_0xde8b('0xf')](_0xde8b('0xc'),_0x4ef59d,_0x29baef[_0xde8b('0xf')]['message']);return _0x5bbf2b(_0x29baef[_0xde8b('0xf')][_0xde8b('0x11')]);}logger[_0xde8b('0xf')](_0xde8b('0xc'),_0x4ef59d,_0x29baef[_0xde8b('0xf')][_0xde8b('0x11')]);return _0xedbd69(_0x29baef[_0xde8b('0xf')][_0xde8b('0x11')]);}else{logger['info'](_0xde8b('0xc'),_0x4ef59d,_0xde8b('0xd'));_0xedbd69(_0x29baef[_0xde8b('0x12')][_0xde8b('0x11')]);}})[_0xde8b('0x13')](function(_0x180b48){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x4ef59d,_0x180b48);_0x5bbf2b(_0x180b48);});});}exports[_0xde8b('0x14')]=function(_0x4765ef){var _0x1869b5=this;return new Promise(function(_0x5232bc,_0x5cb174){return db[_0xde8b('0x15')][_0xde8b('0x16')](_0x4765ef[_0xde8b('0x17')],{'raw':_0x4765ef['options']?_0x4765ef[_0xde8b('0x18')][_0xde8b('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x46b2d8){logger[_0xde8b('0xb')]('CreateVoiceDialReport',_0x4765ef);logger[_0xde8b('0xe')](_0xde8b('0x14'),_0x4765ef,JSON[_0xde8b('0x1a')](_0x46b2d8));_0x5232bc(_0x46b2d8);})[_0xde8b('0x13')](function(_0x5d88d7){logger[_0xde8b('0xf')](_0xde8b('0x14'),_0x5d88d7[_0xde8b('0x11')],_0x4765ef);_0x5cb174(_0x1869b5['error'](0x1f4,_0x5d88d7['message']));});});};exports[_0xde8b('0x1b')]=function(_0x5ed1e0){var _0x144d8f=this;return new Promise(function(_0x19ddd6,_0x31dcab){return db[_0xde8b('0x15')][_0xde8b('0x1c')](_0x5ed1e0['body'],{'raw':_0x5ed1e0['options']?_0x5ed1e0[_0xde8b('0x18')][_0xde8b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ed1e0[_0xde8b('0x18')]?_0x5ed1e0['options'][_0xde8b('0x1d')]||null:null,'attributes':_0x5ed1e0[_0xde8b('0x18')]?_0x5ed1e0[_0xde8b('0x18')][_0xde8b('0x1e')]||null:null,'limit':_0x5ed1e0[_0xde8b('0x18')]?_0x5ed1e0['options']['limit']||null:null})[_0xde8b('0x1f')](function(_0x416dd3){logger[_0xde8b('0xb')](_0xde8b('0x1b'),_0x5ed1e0);logger['debug'](_0xde8b('0x1b'),_0x5ed1e0,JSON[_0xde8b('0x1a')](_0x416dd3));_0x19ddd6(_0x416dd3);})[_0xde8b('0x13')](function(_0x279dd8){logger['error'](_0xde8b('0x1b'),_0x279dd8[_0xde8b('0x11')],_0x5ed1e0);_0x31dcab(_0x144d8f[_0xde8b('0xf')](0x1f4,_0x279dd8[_0xde8b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 25ba142..93c4e67 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 _0x9b5e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','isAuthenticated','/:id','show','post','create','/:id/applications','addApplications','update','exports','util','path','express'];(function(_0x5b115d,_0x1a07e5){var _0x122f65=function(_0x350e62){while(--_0x350e62){_0x5b115d['push'](_0x5b115d['shift']());}};_0x122f65(++_0x1a07e5);}(_0x9b5e,0x10d));var _0xe9b5=function(_0x53157f,_0x30239f){_0x53157f=_0x53157f-0x0;var _0x3d9aca=_0x9b5e[_0x53157f];return _0x3d9aca;};'use strict';var multer=require('multer');var util=require(_0xe9b5('0x0'));var path=require(_0xe9b5('0x1'));var timeout=require('connect-timeout');var express=require(_0xe9b5('0x2'));var router=express[_0xe9b5('0x3')]();var fs_extra=require(_0xe9b5('0x4'));var auth=require(_0xe9b5('0x5'));var interaction=require(_0xe9b5('0x6'));var config=require('../../config/environment');var controller=require(_0xe9b5('0x7'));router['get']('/',auth[_0xe9b5('0x8')](),controller['index']);router['get'](_0xe9b5('0x9'),auth['isAuthenticated'](),controller[_0xe9b5('0xa')]);router[_0xe9b5('0xb')]('/',auth[_0xe9b5('0x8')](),controller[_0xe9b5('0xc')]);router[_0xe9b5('0xb')](_0xe9b5('0xd'),auth[_0xe9b5('0x8')](),controller[_0xe9b5('0xe')]);router['put'](_0xe9b5('0x9'),auth['isAuthenticated'](),controller[_0xe9b5('0xf')]);router['delete'](_0xe9b5('0x9'),auth[_0xe9b5('0x8')](),controller['destroy']);module[_0xe9b5('0x10')]=router; \ No newline at end of file +var _0xf339=['./voiceExtension.controller','get','isAuthenticated','index','/:id','post','create','/:id/applications','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x32226e,_0x399b40){var _0x6c2cdc=function(_0x6ba0a8){while(--_0x6ba0a8){_0x32226e['push'](_0x32226e['shift']());}};_0x6c2cdc(++_0x399b40);}(_0xf339,0x1c0));var _0x9f33=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xf339[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x9f33('0x0'));var util=require(_0x9f33('0x1'));var path=require('path');var timeout=require(_0x9f33('0x2'));var express=require(_0x9f33('0x3'));var router=express[_0x9f33('0x4')]();var fs_extra=require(_0x9f33('0x5'));var auth=require(_0x9f33('0x6'));var interaction=require(_0x9f33('0x7'));var config=require('../../config/environment');var controller=require(_0x9f33('0x8'));router[_0x9f33('0x9')]('/',auth[_0x9f33('0xa')](),controller[_0x9f33('0xb')]);router[_0x9f33('0x9')](_0x9f33('0xc'),auth[_0x9f33('0xa')](),controller['show']);router[_0x9f33('0xd')]('/',auth['isAuthenticated'](),controller[_0x9f33('0xe')]);router['post'](_0x9f33('0xf'),auth['isAuthenticated'](),controller['addApplications']);router[_0x9f33('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9f33('0x11')]);router['delete'](_0x9f33('0xc'),auth['isAuthenticated'](),controller[_0x9f33('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index a575103..6f19c01 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 _0x69c4=['compositeIndex','NoOp','ENUM','inbound','outbound','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','sequelize','STRING'];(function(_0x5eb6e6,_0x17f551){var _0x35c38b=function(_0xa3592){while(--_0xa3592){_0x5eb6e6['push'](_0x5eb6e6['shift']());}};_0x35c38b(++_0x17f551);}(_0x69c4,0xde));var _0x469c=function(_0x1f6fcb,_0x1beca3){_0x1f6fcb=_0x1f6fcb-0x0;var _0x3abd28=_0x69c4[_0x1f6fcb];return _0x3abd28;};'use strict';var Sequelize=require(_0x469c('0x0'));module['exports']={'context':{'type':Sequelize[_0x469c('0x1')],'allowNull':![],'unique':_0x469c('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x469c('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x469c('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x469c('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x469c('0x1')],'allowNull':![],'defaultValue':_0x469c('0x3')},'appdata':{'type':Sequelize[_0x469c('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x469c('0x4')](_0x469c('0x5'),_0x469c('0x6'),'internal',_0x469c('0x7'),_0x469c('0x8'),_0x469c('0x9'),_0x469c('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x469c('0x1')]},'interval':{'type':Sequelize[_0x469c('0x1')],'allowNull':![],'defaultValue':_0x469c('0xb')},'IntervalId':{'type':Sequelize[_0x469c('0xc')]},'isApp':{'type':Sequelize[_0x469c('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x469c('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x469c('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x469c('0xc')]},'recordingFormat':{'type':Sequelize[_0x469c('0x1')],'defaultValue':_0x469c('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4ed549){return this[_0x469c('0xf')]('exten');}},'alias':{'type':Sequelize[_0x469c('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x4978=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','any'];(function(_0x348ea7,_0x591405){var _0x5eafdf=function(_0x4c9f49){while(--_0x4c9f49){_0x348ea7['push'](_0x348ea7['shift']());}};_0x5eafdf(++_0x591405);}(_0x4978,0x114));var _0x8497=function(_0x1cc4e1,_0x1629d4){_0x1cc4e1=_0x1cc4e1-0x0;var _0x192d47=_0x4978[_0x1cc4e1];return _0x192d47;};'use strict';var Sequelize=require(_0x8497('0x0'));module[_0x8497('0x1')]={'context':{'type':Sequelize[_0x8497('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x8497('0x2')],'allowNull':![],'unique':_0x8497('0x3')},'priority':{'type':Sequelize[_0x8497('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x8497('0x3')},'tag':{'type':Sequelize[_0x8497('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x8497('0x2')],'allowNull':![],'defaultValue':_0x8497('0x4')},'appdata':{'type':Sequelize[_0x8497('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x8497('0x5')](_0x8497('0x6'),_0x8497('0x7'),_0x8497('0x8'),_0x8497('0x9'),_0x8497('0xa'),'system',_0x8497('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x8497('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8497('0xc')},'IntervalId':{'type':Sequelize[_0x8497('0xd')]},'isApp':{'type':Sequelize[_0x8497('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x8497('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x8497('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x8497('0xd')]},'recordingFormat':{'type':Sequelize[_0x8497('0x2')],'defaultValue':_0x8497('0xf')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x8497('0x10')],'get':function(_0x5a1b3c){return this[_0x8497('0x11')]('exten');}},'alias':{'type':Sequelize[_0x8497('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index d63d355..a351302 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 _0xb284=['body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','inbound','OutboundRoutes','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','mandatoryDisposition','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','findAndCountAll','finally','sendStatus','lodash','../../components/parsers/qs','api','../../mysqldb','redis','localhost','./voiceExtension.socket','register','status','offset','undefined','count','set','Content-Range','json','destroy','then','get','outbound','InternalRoutes','internal','filter','value','type','find','UserProfileResource','end','error','stack','name','send','index','map','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','where','merge','VIRTUAL','options','VoiceExtension','include','rows','catch','show','rawAttributes','includeAll','params','create','startsWith'];(function(_0x5a8ef5,_0x3c9264){var _0x16fcbc=function(_0x2867ce){while(--_0x2867ce){_0x5a8ef5['push'](_0x5a8ef5['shift']());}};_0x16fcbc(++_0x3c9264);}(_0xb284,0x1cd));var _0x4b28=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb284[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4b28('0x0'));var Redis=require('ioredis');var qs=require(_0x4b28('0x1'));var logger=require('../../config/logger')(_0x4b28('0x2'));var config=require('../../config/environment');var db=require(_0x4b28('0x3'))['db'];config[_0x4b28('0x4')]=_['defaults'](config[_0x4b28('0x4')],{'host':_0x4b28('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b28('0x4')]));require(_0x4b28('0x6'))[_0x4b28('0x7')](socket);function respondWithStatusCode(_0x9ca533,_0xed53b6){_0xed53b6=_0xed53b6||0xcc;return function(_0x384b5e){if(_0x384b5e){return _0x9ca533['sendStatus'](_0xed53b6);}return _0x9ca533[_0x4b28('0x8')](_0xed53b6)['end']();};}function respondWithResult(_0x4d220d,_0x3b1db3){_0x3b1db3=_0x3b1db3||0xc8;return function(_0x53a176){if(_0x53a176){return _0x4d220d[_0x4b28('0x8')](_0x3b1db3)['json'](_0x53a176);}};}function respondWithFilteredResult(_0x102ca7,_0x19363f){return function(_0x5d688a){if(_0x5d688a){var _0x226a57=typeof _0x19363f[_0x4b28('0x9')]===_0x4b28('0xa')&&typeof _0x19363f['limit']==='undefined';var _0x4bf444=_0x5d688a[_0x4b28('0xb')];var _0x359ad5=_0x226a57?0x0:_0x19363f[_0x4b28('0x9')];var _0x55d48d=_0x226a57?_0x5d688a[_0x4b28('0xb')]:_0x19363f['offset']+_0x19363f['limit'];var _0x4787b1;if(_0x55d48d>=_0x4bf444){_0x55d48d=_0x4bf444;_0x4787b1=0xc8;}else{_0x4787b1=0xce;}_0x102ca7['status'](_0x4787b1);return _0x102ca7[_0x4b28('0xc')](_0x4b28('0xd'),_0x359ad5+'-'+_0x55d48d+'/'+_0x4bf444)[_0x4b28('0xe')](_0x5d688a);}return null;};}function removeEntity(_0x2605a1){return function(_0xed0eff){if(_0xed0eff){return _0xed0eff[_0x4b28('0xf')]()[_0x4b28('0x10')](function(){var _0x4328fa=_0xed0eff[_0x4b28('0x11')]({'plain':!![]});var _0x90a501=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0x4b28('0x12'),'ignore':![]},{'name':_0x4b28('0x13'),'value':_0x4b28('0x14'),'ignore':![]}];var _0x37c494=_(_0x90a501)[_0x4b28('0x15')]('ignore')['map'](_0x4b28('0x16'))['value']();if(_['includes'](_0x37c494,_0x4328fa[_0x4b28('0x17')])){return;}var _0x134b81=_[_0x4b28('0x18')](_0x90a501,[_0x4b28('0x16'),_0x4328fa['type']])['name'];return db[_0x4b28('0x19')][_0x4b28('0xf')]({'where':{'type':_0x134b81,'resourceId':_0x4328fa['id']}})[_0x4b28('0x10')](function(){return _0xed0eff;});})[_0x4b28('0x10')](function(){_0x2605a1[_0x4b28('0x8')](0xcc)[_0x4b28('0x1a')]();});}};}function handleEntityNotFound(_0x219884){return function(_0x4c0872){if(!_0x4c0872){_0x219884['sendStatus'](0x194);}return _0x4c0872;};}function handleError(_0x2a3d43,_0x1066c3){_0x1066c3=_0x1066c3||0x1f4;return function(_0x12a430){logger[_0x4b28('0x1b')](_0x12a430[_0x4b28('0x1c')]);if(_0x12a430[_0x4b28('0x1d')]){delete _0x12a430[_0x4b28('0x1d')];}_0x2a3d43[_0x4b28('0x8')](_0x1066c3)[_0x4b28('0x1e')](_0x12a430);};}exports[_0x4b28('0x1f')]=function(_0x340ba9,_0x41240f){var _0x1bcbca={},_0x2536f4={},_0x4c2907={'count':0x0,'rows':[]};var _0x9c6250=_[_0x4b28('0x20')](db['VoiceExtension']['rawAttributes'],function(_0x5f0ce9){return{'name':_0x5f0ce9['fieldName'],'type':_0x5f0ce9[_0x4b28('0x17')][_0x4b28('0x21')]};});_0x2536f4[_0x4b28('0x22')]=_['map'](_0x9c6250,_0x4b28('0x1d'));_0x2536f4[_0x4b28('0x23')]=_[_0x4b28('0x24')](_0x340ba9['query']);_0x2536f4[_0x4b28('0x25')]=_[_0x4b28('0x26')](_0x2536f4['model'],_0x2536f4[_0x4b28('0x23')]);_0x1bcbca[_0x4b28('0x27')]=_[_0x4b28('0x26')](_0x2536f4[_0x4b28('0x22')],qs['fields'](_0x340ba9['query'][_0x4b28('0x28')]));_0x1bcbca[_0x4b28('0x27')]=_0x1bcbca[_0x4b28('0x27')][_0x4b28('0x29')]?_0x1bcbca['attributes']:_0x2536f4[_0x4b28('0x22')];if(!_0x340ba9[_0x4b28('0x23')][_0x4b28('0x2a')]('nolimit')){_0x1bcbca['limit']=qs['limit'](_0x340ba9[_0x4b28('0x23')][_0x4b28('0x2b')]);_0x1bcbca['offset']=qs[_0x4b28('0x9')](_0x340ba9[_0x4b28('0x23')][_0x4b28('0x9')]);}_0x1bcbca[_0x4b28('0x2c')]=qs[_0x4b28('0x2d')](_0x340ba9['query']['sort']);_0x1bcbca['where']=qs[_0x4b28('0x25')](_[_0x4b28('0x2e')](_0x340ba9[_0x4b28('0x23')],_0x2536f4[_0x4b28('0x25')]),_0x9c6250);if(_0x340ba9[_0x4b28('0x23')]['filter']){_0x1bcbca[_0x4b28('0x2f')]=_[_0x4b28('0x30')](_0x1bcbca[_0x4b28('0x2f')],{'$or':_[_0x4b28('0x20')](_0x9c6250,function(_0x3ec787){if(_0x3ec787[_0x4b28('0x17')]!==_0x4b28('0x31')){var _0x23d6e2={};_0x23d6e2[_0x3ec787[_0x4b28('0x1d')]]={'$like':'%'+_0x340ba9[_0x4b28('0x23')][_0x4b28('0x15')]+'%'};return _0x23d6e2;}})});}_0x1bcbca=_[_0x4b28('0x30')]({},_0x1bcbca,_0x340ba9[_0x4b28('0x32')]);var _0x248509={'where':_0x1bcbca[_0x4b28('0x2f')]};return db[_0x4b28('0x33')]['count'](_0x248509)[_0x4b28('0x10')](function(_0x46d21f){_0x4c2907['count']=_0x46d21f;if(_0x340ba9[_0x4b28('0x23')]['includeAll']){_0x1bcbca[_0x4b28('0x34')]=[{'all':!![]}];}return db[_0x4b28('0x33')]['findAll'](_0x1bcbca);})['then'](function(_0x54ee2d){_0x4c2907[_0x4b28('0x35')]=_0x54ee2d;return _0x4c2907;})[_0x4b28('0x10')](respondWithFilteredResult(_0x41240f,_0x1bcbca))[_0x4b28('0x36')](handleError(_0x41240f,null));};exports[_0x4b28('0x37')]=function(_0x3cbd49,_0x494d38){var _0x27aac5={'raw':![],'where':{'id':_0x3cbd49['params']['id']}},_0x5043c4={};_0x5043c4[_0x4b28('0x22')]=_[_0x4b28('0x24')](db[_0x4b28('0x33')][_0x4b28('0x38')]);_0x5043c4[_0x4b28('0x23')]=_[_0x4b28('0x24')](_0x3cbd49[_0x4b28('0x23')]);_0x5043c4[_0x4b28('0x25')]=_[_0x4b28('0x26')](_0x5043c4['model'],_0x5043c4[_0x4b28('0x23')]);_0x27aac5['attributes']=_['intersection'](_0x5043c4[_0x4b28('0x22')],qs[_0x4b28('0x28')](_0x3cbd49[_0x4b28('0x23')][_0x4b28('0x28')]));_0x27aac5['attributes']=_0x27aac5[_0x4b28('0x27')][_0x4b28('0x29')]?_0x27aac5[_0x4b28('0x27')]:_0x5043c4['model'];if(_0x3cbd49[_0x4b28('0x23')][_0x4b28('0x39')]){_0x27aac5[_0x4b28('0x34')]=[{'all':!![]}];}_0x27aac5=_[_0x4b28('0x30')]({},_0x27aac5,_0x3cbd49['options']);return db['VoiceExtension']['find'](_0x27aac5)[_0x4b28('0x10')](handleEntityNotFound(_0x494d38,null))[_0x4b28('0x10')](respondWithResult(_0x494d38,null))['catch'](handleError(_0x494d38,null));};exports[_0x4b28('0xf')]=function(_0x145d7c,_0x342bb5){return db[_0x4b28('0x33')][_0x4b28('0x18')]({'where':{'id':_0x145d7c[_0x4b28('0x3a')]['id']}})[_0x4b28('0x10')](handleEntityNotFound(_0x342bb5,null))['then'](removeEntity(_0x342bb5,null))[_0x4b28('0x36')](handleError(_0x342bb5,null));};exports[_0x4b28('0x3b')]=function(_0x222357,_0x5cc36b){if(_0x222357['body'][_0x4b28('0x17')]==='outbound'&&!_[_0x4b28('0x3c')](_0x222357['body']['exten'],'_')){_0x222357[_0x4b28('0x3d')][_0x4b28('0x3e')]='_'['concat'](_0x222357[_0x4b28('0x3d')]['exten']);}return db[_0x4b28('0x33')][_0x4b28('0x3b')](_0x222357[_0x4b28('0x3d')],{'raw':![]})['then'](function(_0x56c9f5){var _0x254587=_0x222357[_0x4b28('0x3f')][_0x4b28('0x11')]({'plain':!![]});if(!_0x254587)throw new Error(_0x4b28('0x40'));if(_0x254587[_0x4b28('0x41')]===_0x4b28('0x3f')){var _0x5de977=_0x56c9f5['get']({'plain':!![]});var _0x182d4d=[{'name':_0x4b28('0x42'),'value':_0x4b28('0x43')},{'name':_0x4b28('0x44'),'value':_0x4b28('0x12')},{'name':_0x4b28('0x13'),'value':_0x4b28('0x14')}];var _0x1b52fc=_[_0x4b28('0x18')](_0x182d4d,[_0x4b28('0x16'),_0x5de977['type']])[_0x4b28('0x1d')];return db[_0x4b28('0x45')][_0x4b28('0x18')]({'where':{'name':_0x1b52fc,'userProfileId':_0x254587['userProfileId']},'raw':!![]})['then'](function(_0x5239fb){if(_0x5239fb&&_0x5239fb['autoAssociation']===0x0){return db[_0x4b28('0x19')][_0x4b28('0x3b')]({'name':_0x5de977[_0x4b28('0x1d')],'resourceId':_0x5de977['id'],'type':_0x5239fb[_0x4b28('0x1d')],'sectionId':_0x5239fb['id']},{})['then'](function(){return _0x56c9f5;});}else{return _0x56c9f5;}})['catch'](function(_0x464127){logger['error'](_0x4b28('0x46'),_0x464127);throw _0x464127;});}return _0x56c9f5;})[_0x4b28('0x10')](respondWithResult(_0x5cc36b,0xc9))[_0x4b28('0x36')](handleError(_0x5cc36b,null));};exports[_0x4b28('0x47')]=function(_0x5d4b0f,_0x346e76){if(_0x5d4b0f[_0x4b28('0x3d')]['id']){delete _0x5d4b0f[_0x4b28('0x3d')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x5d4b0f['params']['id']}})[_0x4b28('0x10')](handleEntityNotFound(_0x346e76,null))[_0x4b28('0x10')](function(_0x2d661d){if(_0x2d661d){return db[_0x4b28('0x33')][_0x4b28('0x47')](_[_0x4b28('0x2e')](_0x5d4b0f[_0x4b28('0x3d')],[_0x4b28('0x3e'),_0x4b28('0x48'),'description',_0x4b28('0x49'),'cutdigits',_0x4b28('0x4a'),'alias']),{'where':{'context':_0x2d661d[_0x4b28('0x48')],'exten':_0x2d661d['exten']},'individualHooks':!![]})[_0x4b28('0x10')](function(_0x166661){return _0x166661;});}return null;})[_0x4b28('0x10')](respondWithStatusCode(_0x346e76,null))['catch'](handleError(_0x346e76,null));};exports[_0x4b28('0x4b')]=function(_0x18cc0a,_0x562a9f){var _0x102c7b=_0x18cc0a[_0x4b28('0x3a')]['id'];var _0x3aa14b=_0x18cc0a[_0x4b28('0x3d')];var _0x10d318=0xc8;var _0x232756=null;return db[_0x4b28('0x4c')][_0x4b28('0x4d')]({'isolationLevel':db[_0x4b28('0x4c')]['Transaction'][_0x4b28('0x4e')][_0x4b28('0x4f')]},function(_0x5d06ab){return db[_0x4b28('0x33')][_0x4b28('0x50')]({'where':{'id':_0x102c7b},'transaction':_0x5d06ab})[_0x4b28('0x10')](function(_0x4009a7){if(_0x4009a7){return db[_0x4b28('0x33')][_0x4b28('0xf')]({'where':{'VoiceExtensionId':_0x102c7b},'transaction':_0x5d06ab})[_0x4b28('0x10')](function(){var _0x37b2be=_[_0x4b28('0x20')](_0x3aa14b,function(_0x3ac563){_0x3ac563['VoiceExtensionId']=_0x102c7b;_0x3ac563[_0x4b28('0x51')]=!![];return _0x3ac563;});return _0x4009a7[_0x4b28('0x52')](_0x37b2be);})[_0x4b28('0x10')](function(_0x8ee0fc){return db['VoiceExtension'][_0x4b28('0x53')](_0x8ee0fc,{'transaction':_0x5d06ab});});}else{_0x10d318=0x194;_0x232756=[];}});})['then'](function(){if(_0x10d318!==0x194){return db[_0x4b28('0x33')][_0x4b28('0x54')]({'where':{'isApp':!![],'VoiceExtensionId':_0x102c7b},'order':'cast(priority\x20as\x20unsigned)'})[_0x4b28('0x10')](function(_0x3deb32){_0x232756=_0x3deb32;});}})[_0x4b28('0x36')](function(_0x1fd6c8){_0x10d318=0x1f4;logger[_0x4b28('0x1b')](_0x1fd6c8[_0x4b28('0x1c')]);if(_0x1fd6c8[_0x4b28('0x1d')]){delete _0x1fd6c8[_0x4b28('0x1d')];}_0x232756=_0x1fd6c8;})[_0x4b28('0x55')](function(){if(_0x232756===null){_0x562a9f[_0x4b28('0x56')](_0x10d318);}else{if(_0x10d318===0x1f4){_0x562a9f[_0x4b28('0x8')](_0x10d318)[_0x4b28('0x1e')](_0x232756);}else{_0x562a9f[_0x4b28('0x8')](_0x10d318)[_0x4b28('0xe')](_0x232756);}}});}; \ No newline at end of file +var _0x7745=['UserProfileResource','stack','name','send','index','VoiceExtension','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','VIRTUAL','options','where','includeAll','include','findAll','catch','show','params','create','body','outbound','startsWith','exten','concat','get','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','destroy','then','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','type','find'];(function(_0x46c8bb,_0x25ecba){var _0x194042=function(_0x1272a1){while(--_0x1272a1){_0x46c8bb['push'](_0x46c8bb['shift']());}};_0x194042(++_0x25ecba);}(_0x7745,0x9c));var _0x5774=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x7745[_0x139a3c];return _0x2b375b;};'use strict';var _=require('lodash');var Redis=require(_0x5774('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x5774('0x1'))(_0x5774('0x2'));var config=require(_0x5774('0x3'));var db=require(_0x5774('0x4'))['db'];config[_0x5774('0x5')]=_[_0x5774('0x6')](config[_0x5774('0x5')],{'host':_0x5774('0x7'),'port':0x18eb});var socket=require(_0x5774('0x8'))(new Redis(config[_0x5774('0x5')]));require(_0x5774('0x9'))[_0x5774('0xa')](socket);function respondWithStatusCode(_0x501261,_0xef7ec1){_0xef7ec1=_0xef7ec1||0xcc;return function(_0x364b74){if(_0x364b74){return _0x501261[_0x5774('0xb')](_0xef7ec1);}return _0x501261['status'](_0xef7ec1)[_0x5774('0xc')]();};}function respondWithResult(_0x1a2496,_0x45c4d5){_0x45c4d5=_0x45c4d5||0xc8;return function(_0x474402){if(_0x474402){return _0x1a2496[_0x5774('0xd')](_0x45c4d5)['json'](_0x474402);}};}function respondWithFilteredResult(_0x48486d,_0x151967){return function(_0x146c9d){if(_0x146c9d){var _0x1473b5=typeof _0x151967[_0x5774('0xe')]===_0x5774('0xf')&&typeof _0x151967[_0x5774('0x10')]===_0x5774('0xf');var _0x3c5986=_0x146c9d['count'];var _0x4ff839=_0x1473b5?0x0:_0x151967[_0x5774('0xe')];var _0x1c5df0=_0x1473b5?_0x146c9d[_0x5774('0x11')]:_0x151967[_0x5774('0xe')]+_0x151967['limit'];var _0x5797b6;if(_0x1c5df0>=_0x3c5986){_0x1c5df0=_0x3c5986;_0x5797b6=0xc8;}else{_0x5797b6=0xce;}_0x48486d[_0x5774('0xd')](_0x5797b6);return _0x48486d['set'](_0x5774('0x12'),_0x4ff839+'-'+_0x1c5df0+'/'+_0x3c5986)[_0x5774('0x13')](_0x146c9d);}return null;};}function removeEntity(_0x292951){return function(_0x45bfa7){if(_0x45bfa7){return _0x45bfa7[_0x5774('0x14')]()[_0x5774('0x15')](function(){var _0x4cfdd3=_0x45bfa7['get']({'plain':!![]});var _0x57b39d=[{'name':_0x5774('0x16'),'value':_0x5774('0x17'),'ignore':![]},{'name':_0x5774('0x18'),'value':'outbound','ignore':![]},{'name':_0x5774('0x19'),'value':_0x5774('0x1a'),'ignore':![]}];var _0x18ef11=_(_0x57b39d)[_0x5774('0x1b')](_0x5774('0x1c'))[_0x5774('0x1d')](_0x5774('0x1e'))[_0x5774('0x1e')]();if(_[_0x5774('0x1f')](_0x18ef11,_0x4cfdd3[_0x5774('0x20')])){return;}var _0x2d0030=_[_0x5774('0x21')](_0x57b39d,[_0x5774('0x1e'),_0x4cfdd3[_0x5774('0x20')]])['name'];return db[_0x5774('0x22')][_0x5774('0x14')]({'where':{'type':_0x2d0030,'resourceId':_0x4cfdd3['id']}})['then'](function(){return _0x45bfa7;});})[_0x5774('0x15')](function(){_0x292951[_0x5774('0xd')](0xcc)[_0x5774('0xc')]();});}};}function handleEntityNotFound(_0x10a577){return function(_0x7d527){if(!_0x7d527){_0x10a577[_0x5774('0xb')](0x194);}return _0x7d527;};}function handleError(_0x2b978f,_0x1e08c0){_0x1e08c0=_0x1e08c0||0x1f4;return function(_0x3caa20){logger['error'](_0x3caa20[_0x5774('0x23')]);if(_0x3caa20[_0x5774('0x24')]){delete _0x3caa20['name'];}_0x2b978f[_0x5774('0xd')](_0x1e08c0)[_0x5774('0x25')](_0x3caa20);};}exports[_0x5774('0x26')]=function(_0x3837ca,_0x163e9a){var _0x4c4191={},_0x34c595={},_0x3023cd={'count':0x0,'rows':[]};var _0x4330fb=_[_0x5774('0x1d')](db[_0x5774('0x27')][_0x5774('0x28')],function(_0x66ea54){return{'name':_0x66ea54['fieldName'],'type':_0x66ea54[_0x5774('0x20')][_0x5774('0x29')]};});_0x34c595[_0x5774('0x2a')]=_['map'](_0x4330fb,'name');_0x34c595[_0x5774('0x2b')]=_[_0x5774('0x2c')](_0x3837ca[_0x5774('0x2b')]);_0x34c595[_0x5774('0x2d')]=_[_0x5774('0x2e')](_0x34c595['model'],_0x34c595[_0x5774('0x2b')]);_0x4c4191[_0x5774('0x2f')]=_[_0x5774('0x2e')](_0x34c595[_0x5774('0x2a')],qs['fields'](_0x3837ca[_0x5774('0x2b')][_0x5774('0x30')]));_0x4c4191[_0x5774('0x2f')]=_0x4c4191[_0x5774('0x2f')][_0x5774('0x31')]?_0x4c4191[_0x5774('0x2f')]:_0x34c595[_0x5774('0x2a')];if(!_0x3837ca[_0x5774('0x2b')][_0x5774('0x32')](_0x5774('0x33'))){_0x4c4191['limit']=qs[_0x5774('0x10')](_0x3837ca[_0x5774('0x2b')][_0x5774('0x10')]);_0x4c4191[_0x5774('0xe')]=qs[_0x5774('0xe')](_0x3837ca['query'][_0x5774('0xe')]);}_0x4c4191['order']=qs[_0x5774('0x34')](_0x3837ca[_0x5774('0x2b')][_0x5774('0x34')]);_0x4c4191['where']=qs[_0x5774('0x2d')](_[_0x5774('0x35')](_0x3837ca[_0x5774('0x2b')],_0x34c595[_0x5774('0x2d')]),_0x4330fb);if(_0x3837ca[_0x5774('0x2b')][_0x5774('0x1b')]){_0x4c4191['where']=_[_0x5774('0x36')](_0x4c4191['where'],{'$or':_[_0x5774('0x1d')](_0x4330fb,function(_0x54b72f){if(_0x54b72f[_0x5774('0x20')]!==_0x5774('0x37')){var _0x3b06ca={};_0x3b06ca[_0x54b72f[_0x5774('0x24')]]={'$like':'%'+_0x3837ca[_0x5774('0x2b')][_0x5774('0x1b')]+'%'};return _0x3b06ca;}})});}_0x4c4191=_[_0x5774('0x36')]({},_0x4c4191,_0x3837ca[_0x5774('0x38')]);var _0x236948={'where':_0x4c4191[_0x5774('0x39')]};return db[_0x5774('0x27')]['count'](_0x236948)['then'](function(_0x8760f){_0x3023cd[_0x5774('0x11')]=_0x8760f;if(_0x3837ca[_0x5774('0x2b')][_0x5774('0x3a')]){_0x4c4191[_0x5774('0x3b')]=[{'all':!![]}];}return db[_0x5774('0x27')][_0x5774('0x3c')](_0x4c4191);})[_0x5774('0x15')](function(_0x12d77e){_0x3023cd['rows']=_0x12d77e;return _0x3023cd;})[_0x5774('0x15')](respondWithFilteredResult(_0x163e9a,_0x4c4191))[_0x5774('0x3d')](handleError(_0x163e9a,null));};exports[_0x5774('0x3e')]=function(_0x402ff7,_0x376e62){var _0xbc3a21={'raw':![],'where':{'id':_0x402ff7[_0x5774('0x3f')]['id']}},_0x127038={};_0x127038[_0x5774('0x2a')]=_['keys'](db['VoiceExtension'][_0x5774('0x28')]);_0x127038['query']=_[_0x5774('0x2c')](_0x402ff7['query']);_0x127038['filters']=_['intersection'](_0x127038[_0x5774('0x2a')],_0x127038[_0x5774('0x2b')]);_0xbc3a21[_0x5774('0x2f')]=_[_0x5774('0x2e')](_0x127038[_0x5774('0x2a')],qs[_0x5774('0x30')](_0x402ff7[_0x5774('0x2b')][_0x5774('0x30')]));_0xbc3a21[_0x5774('0x2f')]=_0xbc3a21[_0x5774('0x2f')][_0x5774('0x31')]?_0xbc3a21[_0x5774('0x2f')]:_0x127038[_0x5774('0x2a')];if(_0x402ff7['query']['includeAll']){_0xbc3a21[_0x5774('0x3b')]=[{'all':!![]}];}_0xbc3a21=_[_0x5774('0x36')]({},_0xbc3a21,_0x402ff7[_0x5774('0x38')]);return db['VoiceExtension'][_0x5774('0x21')](_0xbc3a21)[_0x5774('0x15')](handleEntityNotFound(_0x376e62,null))[_0x5774('0x15')](respondWithResult(_0x376e62,null))['catch'](handleError(_0x376e62,null));};exports[_0x5774('0x14')]=function(_0x5ca6f6,_0x2c8619){return db[_0x5774('0x27')][_0x5774('0x21')]({'where':{'id':_0x5ca6f6[_0x5774('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2c8619,null))[_0x5774('0x15')](removeEntity(_0x2c8619,null))[_0x5774('0x3d')](handleError(_0x2c8619,null));};exports[_0x5774('0x40')]=function(_0x4f6a44,_0x18600c){if(_0x4f6a44[_0x5774('0x41')][_0x5774('0x20')]===_0x5774('0x42')&&!_[_0x5774('0x43')](_0x4f6a44[_0x5774('0x41')][_0x5774('0x44')],'_')){_0x4f6a44[_0x5774('0x41')][_0x5774('0x44')]='_'[_0x5774('0x45')](_0x4f6a44[_0x5774('0x41')][_0x5774('0x44')]);}return db[_0x5774('0x27')][_0x5774('0x40')](_0x4f6a44[_0x5774('0x41')],{'raw':![]})['then'](function(_0x4070a2){var _0x543d63=_0x4f6a44['user'][_0x5774('0x46')]({'plain':!![]});if(!_0x543d63)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x543d63[_0x5774('0x47')]===_0x5774('0x48')){var _0xe50e85=_0x4070a2[_0x5774('0x46')]({'plain':!![]});var _0x10c2da=[{'name':'InboundRoutes','value':_0x5774('0x17')},{'name':_0x5774('0x18'),'value':_0x5774('0x42')},{'name':'InternalRoutes','value':_0x5774('0x1a')}];var _0x196fce=_['find'](_0x10c2da,['value',_0xe50e85['type']])[_0x5774('0x24')];return db[_0x5774('0x49')][_0x5774('0x21')]({'where':{'name':_0x196fce,'userProfileId':_0x543d63[_0x5774('0x4a')]},'raw':!![]})[_0x5774('0x15')](function(_0x4b9fd7){if(_0x4b9fd7&&_0x4b9fd7[_0x5774('0x4b')]===0x0){return db[_0x5774('0x22')]['create']({'name':_0xe50e85[_0x5774('0x24')],'resourceId':_0xe50e85['id'],'type':_0x4b9fd7[_0x5774('0x24')],'sectionId':_0x4b9fd7['id']},{})[_0x5774('0x15')](function(){return _0x4070a2;});}else{return _0x4070a2;}})[_0x5774('0x3d')](function(_0x4a1b9d){logger[_0x5774('0x4c')](_0x5774('0x4d'),_0x4a1b9d);throw _0x4a1b9d;});}return _0x4070a2;})[_0x5774('0x15')](respondWithResult(_0x18600c,0xc9))[_0x5774('0x3d')](handleError(_0x18600c,null));};exports['update']=function(_0x31d735,_0x219e2c){if(_0x31d735[_0x5774('0x41')]['id']){delete _0x31d735['body']['id'];}return db[_0x5774('0x27')]['find']({'where':{'id':_0x31d735[_0x5774('0x3f')]['id']}})[_0x5774('0x15')](handleEntityNotFound(_0x219e2c,null))['then'](function(_0x4c19a4){if(_0x4c19a4){return db['VoiceExtension'][_0x5774('0x4e')](_[_0x5774('0x35')](_0x31d735['body'],[_0x5774('0x44'),'context',_0x5774('0x4f'),'recordingFormat','cutdigits',_0x5774('0x50'),_0x5774('0x51')]),{'where':{'context':_0x4c19a4['context'],'exten':_0x4c19a4[_0x5774('0x44')]},'individualHooks':!![]})[_0x5774('0x15')](function(_0x1347e6){return _0x1347e6;});}return null;})[_0x5774('0x15')](respondWithStatusCode(_0x219e2c,null))['catch'](handleError(_0x219e2c,null));};exports[_0x5774('0x52')]=function(_0x129c3c,_0x1cb592){var _0x51a87f=_0x129c3c[_0x5774('0x3f')]['id'];var _0x3e6d2a=_0x129c3c[_0x5774('0x41')];var _0x3eaa2b=0xc8;var _0x1525f3=null;return db[_0x5774('0x53')][_0x5774('0x54')]({'isolationLevel':db['sequelize'][_0x5774('0x55')]['ISOLATION_LEVELS'][_0x5774('0x56')]},function(_0xfd98da){return db[_0x5774('0x27')][_0x5774('0x57')]({'where':{'id':_0x51a87f},'transaction':_0xfd98da})[_0x5774('0x15')](function(_0x38b88e){if(_0x38b88e){return db[_0x5774('0x27')][_0x5774('0x14')]({'where':{'VoiceExtensionId':_0x51a87f},'transaction':_0xfd98da})[_0x5774('0x15')](function(){var _0x316ae3=_[_0x5774('0x1d')](_0x3e6d2a,function(_0x2b330e){_0x2b330e[_0x5774('0x58')]=_0x51a87f;_0x2b330e[_0x5774('0x59')]=!![];return _0x2b330e;});return _0x38b88e[_0x5774('0x5a')](_0x316ae3);})['then'](function(_0x319406){return db[_0x5774('0x27')][_0x5774('0x5b')](_0x319406,{'transaction':_0xfd98da});});}else{_0x3eaa2b=0x194;_0x1525f3=[];}});})[_0x5774('0x15')](function(){if(_0x3eaa2b!==0x194){return db[_0x5774('0x27')][_0x5774('0x5c')]({'where':{'isApp':!![],'VoiceExtensionId':_0x51a87f},'order':_0x5774('0x5d')})[_0x5774('0x15')](function(_0x1c8c16){_0x1525f3=_0x1c8c16;});}})[_0x5774('0x3d')](function(_0x3b9ad6){_0x3eaa2b=0x1f4;logger[_0x5774('0x4c')](_0x3b9ad6[_0x5774('0x23')]);if(_0x3b9ad6['name']){delete _0x3b9ad6[_0x5774('0x24')];}_0x1525f3=_0x3b9ad6;})[_0x5774('0x5e')](function(){if(_0x1525f3===null){_0x1cb592[_0x5774('0xb')](_0x3eaa2b);}else{if(_0x3eaa2b===0x1f4){_0x1cb592[_0x5774('0xd')](_0x3eaa2b)[_0x5774('0x25')](_0x1525f3);}else{_0x1cb592[_0x5774('0xd')](_0x3eaa2b)[_0x5774('0x13')](_0x1525f3);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index b543eb5..1672b95 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 _0x45b7=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save'];(function(_0x329be6,_0xbdc71b){var _0x1cd78f=function(_0x4d235d){while(--_0x4d235d){_0x329be6['push'](_0x329be6['shift']());}};_0x1cd78f(++_0xbdc71b);}(_0x45b7,0x69));var _0x745b=function(_0x2f5dad,_0x4313ad){_0x2f5dad=_0x2f5dad-0x0;var _0x38e02d=_0x45b7[_0x2f5dad];return _0x38e02d;};'use strict';var EventEmitter=require(_0x745b('0x0'));var VoiceExtension=require(_0x745b('0x1'))['db'][_0x745b('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x745b('0x3')](0x0);var events={'afterCreate':_0x745b('0x4'),'afterUpdate':_0x745b('0x5'),'afterDestroy':_0x745b('0x6')};function emitEvent(_0x2a2da7){return function(_0x5313c7,_0x4d4e57,_0x4be867){VoiceExtensionEvents[_0x745b('0x7')](_0x2a2da7+':'+_0x5313c7['id'],_0x5313c7);VoiceExtensionEvents[_0x745b('0x7')](_0x2a2da7,_0x5313c7);_0x4be867(null);};}for(var e in events){if(events[_0x745b('0x8')](e)){var event=events[e];VoiceExtension[_0x745b('0x9')](e,emitEvent(event));}}module[_0x745b('0xa')]=VoiceExtensionEvents; \ No newline at end of file +var _0x4fb2=['VoiceExtension','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1c470d,_0x81d66b){var _0x12141b=function(_0x45bfd3){while(--_0x45bfd3){_0x1c470d['push'](_0x1c470d['shift']());}};_0x12141b(++_0x81d66b);}(_0x4fb2,0xf1));var _0x24fb=function(_0x49b9ac,_0x8f3e2b){_0x49b9ac=_0x49b9ac-0x0;var _0x434131=_0x4fb2[_0x49b9ac];return _0x434131;};'use strict';var EventEmitter=require(_0x24fb('0x0'));var VoiceExtension=require(_0x24fb('0x1'))['db'][_0x24fb('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x24fb('0x3'),'afterUpdate':'update','afterDestroy':_0x24fb('0x4')};function emitEvent(_0xe60f14){return function(_0x4fd0a9,_0x1fb9b7,_0x2afe52){VoiceExtensionEvents[_0x24fb('0x5')](_0xe60f14+':'+_0x4fd0a9['id'],_0x4fd0a9);VoiceExtensionEvents[_0x24fb('0x5')](_0xe60f14,_0x4fd0a9);_0x2afe52(null);};}for(var e in events){if(events[_0x24fb('0x6')](e)){var event=events[e];VoiceExtension[_0x24fb('0x7')](e,emitEvent(event));}}module[_0x24fb('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 ffa7858..1757d53 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 _0x4a80=['NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','define','VoiceExtension','get','Hangup','lodash','exports','models','type','Set','CDR(type)=','context','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','split','name','phone','prefix','param','join','options','indexOf','U(xcally-mixmonitor-context)','replace','Interval','interval','then','length','*,*,*,*','intervals','IntervalId','map','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)='];(function(_0x12258f,_0x22a0db){var _0x547564=function(_0x4ae224){while(--_0x4ae224){_0x12258f['push'](_0x12258f['shift']());}};_0x547564(++_0x22a0db);}(_0x4a80,0xbe));var _0x04a8=function(_0x5d2d4c,_0x3fe5d8){_0x5d2d4c=_0x5d2d4c-0x0;var _0x273ccb=_0x4a80[_0x5d2d4c];return _0x273ccb;};'use strict';var _=require(_0x04a8('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x04a8('0x1')]=function(_0x333eb6){var _0x5edee6=_0x333eb6[_0x04a8('0x2')];function _0x198bc8(_0x256369){var _0x1e36fc=0x2;var _0x85c22=[{'type':_0x256369[_0x04a8('0x3')],'app':_0x04a8('0x4'),'appdata':_0x04a8('0x5')+_0x256369[_0x04a8('0x3')],'context':_0x256369[_0x04a8('0x6')],'exten':_0x256369['exten'],'priority':_0x1e36fc++,'VoiceExtensionId':_0x256369['id']},{'type':_0x256369[_0x04a8('0x3')],'app':_0x256369[_0x04a8('0x7')]?_0x04a8('0x4'):_0x04a8('0x8'),'appdata':_0x256369[_0x04a8('0x7')]?_0x04a8('0x9')+_0x256369[_0x04a8('0x7')]:_0x04a8('0xa'),'context':_0x256369[_0x04a8('0x6')],'exten':_0x256369[_0x04a8('0xb')],'priority':_0x1e36fc++,'VoiceExtensionId':_0x256369['id']}];if(_0x256369['type']===_0x04a8('0xc')){_0x85c22[_0x04a8('0xd')]({'type':_0x04a8('0xc'),'app':'Set','appdata':_0x04a8('0xe')+_0x256369['id'],'context':_0x256369[_0x04a8('0x6')],'exten':_0x256369[_0x04a8('0xb')],'priority':_0x1e36fc++,'VoiceExtensionId':_0x256369['id']});}_0x85c22[_0x04a8('0xd')]({'type':_0x256369[_0x04a8('0x3')],'app':_0x04a8('0x4'),'appdata':_0x04a8('0xf'),'context':_0x256369['context'],'exten':_0x256369[_0x04a8('0xb')],'priority':_0x1e36fc++,'VoiceExtensionId':_0x256369['id']},{'type':_0x256369[_0x04a8('0x3')],'app':_0x04a8('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x256369['context'],'exten':_0x256369[_0x04a8('0xb')],'priority':_0x1e36fc++,'VoiceExtensionId':_0x256369['id']},{'type':_0x256369[_0x04a8('0x3')],'app':'Set','appdata':_0x04a8('0x10'),'context':_0x256369['context'],'exten':_0x256369[_0x04a8('0xb')],'priority':_0x1e36fc++,'VoiceExtensionId':_0x256369['id']});return _0x85c22;}function _0x5dee8a(_0x129973){var _0x173f8e=0x2;var _0x4bb73c=[{'type':_0x04a8('0x11'),'app':_0x04a8('0x4'),'appdata':'CDR(type)=outbound','context':_0x129973['context'],'exten':_0x129973['exten'],'priority':_0x173f8e++,'VoiceExtensionId':_0x129973['id']},{'type':_0x04a8('0x11'),'app':_0x129973[_0x04a8('0x7')]?_0x04a8('0x4'):_0x04a8('0x8'),'appdata':_0x129973[_0x04a8('0x7')]?_0x04a8('0x9')+_0x129973['alias']:_0x04a8('0xa'),'context':_0x129973[_0x04a8('0x6')],'exten':_0x129973[_0x04a8('0xb')],'priority':_0x173f8e++,'VoiceExtensionId':_0x129973['id']},{'type':_0x04a8('0x11'),'app':_0x04a8('0x4'),'appdata':_0x04a8('0x12')+(_0x129973[_0x04a8('0x13')]?_0x04a8('0x14')+_0x129973['cutdigits']+'}':_0x04a8('0x15')),'context':_0x129973[_0x04a8('0x6')],'exten':_0x129973[_0x04a8('0xb')],'priority':_0x173f8e++,'VoiceExtensionId':_0x129973['id']},{'type':'outbound','app':'Set','appdata':_0x04a8('0xe')+_0x129973['id'],'context':_0x129973['context'],'exten':_0x129973['exten'],'priority':_0x173f8e++,'VoiceExtensionId':_0x129973['id']},{'type':_0x04a8('0x11'),'app':_0x04a8('0x16'),'appdata':_0x04a8('0x17')+(_0x173f8e+0x2)+_0x04a8('0x18')+(_0x173f8e+0x1)+')','context':_0x129973[_0x04a8('0x6')],'exten':_0x129973[_0x04a8('0xb')],'priority':_0x173f8e++,'VoiceExtensionId':_0x129973['id']},{'type':_0x04a8('0x11'),'app':'Set','appdata':_0x129973[_0x04a8('0x13')]?_0x04a8('0x19')+_0x129973['cutdigits']+'}':_0x04a8('0x1a'),'context':_0x129973[_0x04a8('0x6')],'exten':_0x129973[_0x04a8('0xb')],'priority':_0x173f8e++,'VoiceExtensionId':_0x129973['id']},{'type':_0x04a8('0x11'),'app':_0x04a8('0x4'),'appdata':_0x04a8('0xf'),'context':_0x129973[_0x04a8('0x6')],'exten':_0x129973[_0x04a8('0xb')],'priority':_0x173f8e++,'VoiceExtensionId':_0x129973['id']},{'type':_0x04a8('0x11'),'app':_0x04a8('0x4'),'appdata':_0x04a8('0x1b'),'context':_0x129973[_0x04a8('0x6')],'exten':_0x129973['exten'],'priority':_0x173f8e++,'VoiceExtensionId':_0x129973['id']},{'type':'outbound','app':_0x04a8('0x4'),'appdata':_0x04a8('0x10'),'context':_0x129973['context'],'exten':_0x129973['exten'],'priority':_0x173f8e++,'VoiceExtensionId':_0x129973['id']},{'type':_0x04a8('0x11'),'app':_0x04a8('0x4'),'appdata':_0x04a8('0x1c')+_0x129973['id'],'context':_0x129973[_0x04a8('0x6')],'exten':_0x129973['exten'],'priority':_0x173f8e++,'VoiceExtensionId':_0x129973['id']}];if(_0x129973[_0x04a8('0x1d')]('recordingFormat')&&_0x129973[_0x04a8('0x1e')]!==_0x04a8('0x1f')){_0x4bb73c[_0x04a8('0xd')]({'type':_0x04a8('0x11'),'app':_0x04a8('0x4'),'appdata':_0x04a8('0x20'),'context':_0x129973[_0x04a8('0x6')],'exten':_0x129973[_0x04a8('0xb')],'priority':_0x173f8e++,'VoiceExtensionId':_0x129973['id']},{'type':'outbound','app':_0x04a8('0x4'),'appdata':_0x04a8('0x21')+_0x129973['recordingFormat']||_0x04a8('0x22'),'context':_0x129973[_0x04a8('0x6')],'exten':_0x129973['exten'],'priority':_0x173f8e++,'VoiceExtensionId':_0x129973['id']});}return _0x4bb73c;}function _0x377c39(_0x254267,_0x536f6c){var _0x1d0399=[{'name':_0x04a8('0x23'),'param':0x0},{'name':_0x04a8('0x24'),'param':0x1},{'name':'options','param':0x2},{'name':_0x04a8('0x25'),'param':0x3}];var _0xc5e0b={};var _0x4ce22b=_0x536f6c[_0x04a8('0x26')](',');var _0x10c9c5=[];for(var _0x339586=0x0;_0x339586<_0x1d0399['length'];_0x339586++){switch(_0x1d0399[_0x339586][_0x04a8('0x27')]){case _0x04a8('0x23'):_0xc5e0b[_0x04a8('0x23')]=_0x4ce22b[_0x1d0399[_0x339586]['param']]['split']('/')[0x1];_0xc5e0b[_0x04a8('0x28')]=_0x4ce22b[_0x1d0399[_0x339586]['param']]['split']('/')[0x2];_0xc5e0b[_0x04a8('0x29')]=_0xc5e0b[_0x04a8('0x28')]?_0xc5e0b[_0x04a8('0x28')][_0x04a8('0x26')]('$')[0x0]:undefined;_0xc5e0b[_0x04a8('0x28')]=_0x254267['cutdigits']?(_0xc5e0b['prefix']||'')+_0x04a8('0x14')+_0x254267[_0x04a8('0x13')]+'}':(_0xc5e0b[_0x04a8('0x29')]||'')+_0x04a8('0x15');_0x10c9c5[_0x1d0399[_0x339586][_0x04a8('0x2a')]]=['SIP',_0xc5e0b[_0x04a8('0x23')],_0xc5e0b['phone']][_0x04a8('0x2b')]('/');break;case _0x04a8('0x2c'):_0xc5e0b['options']=_0x4ce22b[_0x1d0399[_0x339586][_0x04a8('0x2a')]];if(_0x254267[_0x04a8('0x1e')]!=='none'){if(_0xc5e0b[_0x04a8('0x2c')][_0x04a8('0x2d')](_0x04a8('0x2e'))<0x0){_0xc5e0b[_0x04a8('0x2c')]+=_0x04a8('0x2e');}}else{_0xc5e0b['options']=_0xc5e0b['options'][_0x04a8('0x2f')](_0x04a8('0x2e'),'');}_0x10c9c5[_0x1d0399[_0x339586][_0x04a8('0x2a')]]=_0xc5e0b['options'];break;default:_0x10c9c5[_0x1d0399[_0x339586][_0x04a8('0x2a')]]=_0x4ce22b[_0x1d0399[_0x339586][_0x04a8('0x2a')]];}}return _0x10c9c5[_0x04a8('0x2b')](',');}function _0x16a257(_0x3b4c5b,_0x4eaeb4,_0x47067b){return new Promise(function(_0x19f417,_0x2ebe73){var _0x51bfca=[];if(_['isEmpty'](_0x4eaeb4))return _0x19f417(_0x51bfca);_0x5edee6[_0x04a8('0x30')]['findAll']({'attributes':['id',_0x04a8('0x31'),'IntervalId'],'raw':!![]})[_0x04a8('0x32')](function(_0x30f982){for(var _0x4ee013=0x0,_0x28fe9f=0x0;_0x4ee013<_0x4eaeb4[_0x04a8('0x33')];_0x4ee013++,_0x28fe9f=0x0){var _0x5c6f63=_0x4eaeb4[_0x4ee013];var _0x585d4f=[];var _0x594b1f=[];delete _0x5c6f63['id'];if(_0x5c6f63[_0x04a8('0x31')]!==_0x04a8('0x34')){_0x5c6f63['intervals']=[_0x5c6f63[_0x04a8('0x31')]];}else{_0x5c6f63[_0x04a8('0x35')]=_0x5c6f63[_0x04a8('0x36')]?_[_0x04a8('0x37')](_['filter'](_0x30f982,{'IntervalId':_0x5c6f63[_0x04a8('0x36')]}),_0x04a8('0x31')):[];}_0x5c6f63['context']=_0x3b4c5b[_0x04a8('0x6')];_0x5c6f63[_0x04a8('0xb')]=_0x3b4c5b[_0x04a8('0xb')];if(_0x5c6f63['type'])_0x5c6f63[_0x04a8('0x3')]=_0x5c6f63['type']['toLowerCase']();if(_0x3b4c5b[_0x04a8('0x3')]===_0x04a8('0x11')){if(_0x5c6f63[_0x04a8('0x1d')](_0x04a8('0x38'))&&_0x5c6f63[_0x04a8('0x38')]&&_0x5c6f63['tag']!=='--'){_0x585d4f[_0x04a8('0xd')]({'type':_0x5c6f63[_0x04a8('0x3')][_0x04a8('0x39')](),'app':_0x04a8('0x4'),'appdata':_0x04a8('0x3a')+_0x5c6f63[_0x04a8('0x38')],'context':_0x3b4c5b['context'],'exten':_0x3b4c5b[_0x04a8('0xb')],'priority':_0x5c6f63[_0x04a8('0x35')]['length']+_0x47067b+_0x28fe9f++,'VoiceExtensionId':_0x3b4c5b['id']});}_0x585d4f['push']({'type':_0x5c6f63[_0x04a8('0x3')]['toLowerCase'](),'app':_0x04a8('0x16'),'appdata':_0x04a8('0x3b')+(_0x5c6f63[_0x04a8('0x3c')]?_0x04a8('0x3d')+_0x5c6f63['callerID']+')':_0x04a8('0x3e')),'context':_0x3b4c5b['context'],'exten':_0x3b4c5b['exten'],'priority':_0x5c6f63[_0x04a8('0x35')][_0x04a8('0x33')]+_0x47067b+_0x28fe9f++,'VoiceExtensionId':_0x3b4c5b['id']});}else{if(_0x5c6f63['hasOwnProperty'](_0x04a8('0x3f'))){if(['queue',_0x04a8('0x40')][_0x04a8('0x41')](_0x5c6f63[_0x04a8('0x42')][_0x04a8('0x39')]())&&_0x5c6f63[_0x04a8('0x43')]!==_0x04a8('0x44')){if(_0x5c6f63[_0x04a8('0x3f')]){_0x585d4f['push']({'type':_0x5c6f63[_0x04a8('0x3')][_0x04a8('0x39')](),'app':_0x04a8('0x16'),'appdata':_0x04a8('0x45'),'context':_0x3b4c5b[_0x04a8('0x6')],'exten':_0x3b4c5b[_0x04a8('0xb')],'priority':_0x5c6f63[_0x04a8('0x35')][_0x04a8('0x33')]+_0x47067b+_0x28fe9f++,'VoiceExtensionId':_0x3b4c5b['id']});_0x585d4f[_0x04a8('0xd')]({'type':_0x5c6f63['type'][_0x04a8('0x39')](),'app':'Set','appdata':_0x04a8('0x46'),'context':_0x3b4c5b[_0x04a8('0x6')],'exten':_0x3b4c5b[_0x04a8('0xb')],'priority':_0x5c6f63[_0x04a8('0x35')][_0x04a8('0x33')]+_0x47067b+_0x28fe9f++,'VoiceExtensionId':_0x3b4c5b['id']});}else{_0x585d4f['push']({'type':_0x5c6f63[_0x04a8('0x3')]['toLowerCase'](),'app':_0x04a8('0x16'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3b4c5b[_0x04a8('0x6')],'exten':_0x3b4c5b['exten'],'priority':_0x5c6f63[_0x04a8('0x35')][_0x04a8('0x33')]+_0x47067b+_0x28fe9f++,'VoiceExtensionId':_0x3b4c5b['id']});_0x585d4f['push']({'type':_0x5c6f63[_0x04a8('0x3')]['toLowerCase'](),'app':_0x04a8('0x4'),'appdata':_0x04a8('0x47'),'context':_0x3b4c5b[_0x04a8('0x6')],'exten':_0x3b4c5b[_0x04a8('0xb')],'priority':_0x5c6f63[_0x04a8('0x35')][_0x04a8('0x33')]+_0x47067b+_0x28fe9f++,'VoiceExtensionId':_0x3b4c5b['id']});}}}}for(var _0x2d2085=0x0;_0x2d2085<_0x5c6f63['intervals'][_0x04a8('0x33')];_0x2d2085++){var _0x3ae4c8=_0x47067b+_0x5c6f63['intervals']['length'];var _0x3846de=_0x2d2085===_0x5c6f63['intervals']['length']-0x1?_0x47067b+_0x585d4f['length']+_0x594b1f[_0x04a8('0x33')]+0x2:_0x47067b+_0x2d2085+0x1;_0x585d4f[_0x04a8('0x48')](_0x2d2085,0x0,{'type':_0x3b4c5b['type'],'app':_0x04a8('0x49'),'appdata':_0x5c6f63[_0x04a8('0x35')][_0x2d2085]+'?'+_0x3b4c5b['context']+_0x04a8('0x4a')+_0x3ae4c8+':'+_0x3b4c5b['context']+_0x04a8('0x4a')+_0x3846de,'exten':_0x3b4c5b[_0x04a8('0xb')],'context':_0x3b4c5b['context'],'priority':_0x47067b+_0x2d2085,'VoiceExtensionId':_0x3b4c5b['id']});}if(_0x5c6f63[_0x04a8('0x43')]===_0x04a8('0x4b'))_0x5c6f63[_0x04a8('0x4c')]=_0x377c39(_0x3b4c5b,_0x5c6f63[_0x04a8('0x4c')]);_0x5c6f63[_0x04a8('0x4d')]=_0x585d4f[_0x04a8('0x33')]?_[_0x04a8('0x4e')](_0x585d4f)[_0x04a8('0x4d')]+0x1:_0x47067b;_0x51bfca=_[_0x04a8('0x4f')](_0x51bfca,_0x585d4f,[_0x5c6f63],_0x594b1f);_0x47067b=_[_0x04a8('0x4e')](_0x51bfca)[_0x04a8('0x4d')]+0x1;}return _0x19f417(_0x51bfca);})['catch'](function(_0x59f3cd){_0x2ebe73(_0x59f3cd);});});}return _0x333eb6[_0x04a8('0x50')](_0x04a8('0x51'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4a9ca9){var _0x1d5f27=this[_0x04a8('0x52')]({'plain':!![]});var _0x3a3b31=_0x1d5f27['type']===_0x04a8('0x11')?_0x5dee8a(_0x1d5f27):_0x198bc8(_0x1d5f27);return _0x16a257(_0x1d5f27,_0x4a9ca9,_[_0x04a8('0x4e')](_0x3a3b31)['priority']+0x1)[_0x04a8('0x32')](function(_0x66eab9){var _0x47911a=_[_0x04a8('0x4f')](_0x3a3b31,_0x66eab9);_0x47911a[_0x04a8('0xd')]({'type':_0x1d5f27[_0x04a8('0x3')],'app':_0x04a8('0x53'),'exten':_0x1d5f27[_0x04a8('0xb')],'context':_0x1d5f27[_0x04a8('0x6')],'priority':_[_0x04a8('0x4e')](_0x47911a)[_0x04a8('0x4d')]+0x1,'VoiceExtensionId':_0x1d5f27['id']});return _0x47911a;});}}});}; \ No newline at end of file +var _0x5d66=['inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','options','split','length','name','trunk','phone','param','prefix','${EXTEN:','SIP','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','IntervalId','interval','*,*,*,*','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','then','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)='];(function(_0x5bdf8e,_0x45d970){var _0x3e0750=function(_0x41298b){while(--_0x41298b){_0x5bdf8e['push'](_0x5bdf8e['shift']());}};_0x3e0750(++_0x45d970);}(_0x5d66,0x130));var _0x65d6=function(_0x50fe4f,_0x3b99a7){_0x50fe4f=_0x50fe4f-0x0;var _0x36c023=_0x5d66[_0x50fe4f];return _0x36c023;};'use strict';var _=require(_0x65d6('0x0'));var attributes=require(_0x65d6('0x1'));module[_0x65d6('0x2')]=function(_0x2f4967){var _0x560dbf=_0x2f4967[_0x65d6('0x3')];function _0x43d8a6(_0x4aff50){var _0x5c339b=0x2;var _0xd94f91=[{'type':_0x4aff50[_0x65d6('0x4')],'app':_0x65d6('0x5'),'appdata':_0x65d6('0x6')+_0x4aff50[_0x65d6('0x4')],'context':_0x4aff50[_0x65d6('0x7')],'exten':_0x4aff50[_0x65d6('0x8')],'priority':_0x5c339b++,'VoiceExtensionId':_0x4aff50['id']},{'type':_0x4aff50['type'],'app':_0x4aff50[_0x65d6('0x9')]?_0x65d6('0x5'):_0x65d6('0xa'),'appdata':_0x4aff50[_0x65d6('0x9')]?_0x65d6('0xb')+_0x4aff50['alias']:'No\x20alias\x20set','context':_0x4aff50[_0x65d6('0x7')],'exten':_0x4aff50[_0x65d6('0x8')],'priority':_0x5c339b++,'VoiceExtensionId':_0x4aff50['id']}];if(_0x4aff50['type']===_0x65d6('0xc')){_0xd94f91[_0x65d6('0xd')]({'type':'inbound','app':_0x65d6('0x5'),'appdata':'CDR(routeid)='+_0x4aff50['id'],'context':_0x4aff50['context'],'exten':_0x4aff50[_0x65d6('0x8')],'priority':_0x5c339b++,'VoiceExtensionId':_0x4aff50['id']});}_0xd94f91['push']({'type':_0x4aff50[_0x65d6('0x4')],'app':_0x65d6('0x5'),'appdata':_0x65d6('0xe'),'context':_0x4aff50[_0x65d6('0x7')],'exten':_0x4aff50[_0x65d6('0x8')],'priority':_0x5c339b++,'VoiceExtensionId':_0x4aff50['id']},{'type':_0x4aff50[_0x65d6('0x4')],'app':'Set','appdata':_0x65d6('0xf'),'context':_0x4aff50[_0x65d6('0x7')],'exten':_0x4aff50[_0x65d6('0x8')],'priority':_0x5c339b++,'VoiceExtensionId':_0x4aff50['id']},{'type':_0x4aff50['type'],'app':_0x65d6('0x5'),'appdata':_0x65d6('0x10'),'context':_0x4aff50[_0x65d6('0x7')],'exten':_0x4aff50['exten'],'priority':_0x5c339b++,'VoiceExtensionId':_0x4aff50['id']});return _0xd94f91;}function _0x41a46f(_0x42cce3){var _0x566422=0x2;var _0x4ec1e1=[{'type':'outbound','app':'Set','appdata':'CDR(type)=outbound','context':_0x42cce3['context'],'exten':_0x42cce3['exten'],'priority':_0x566422++,'VoiceExtensionId':_0x42cce3['id']},{'type':_0x65d6('0x11'),'app':_0x42cce3['alias']?_0x65d6('0x5'):_0x65d6('0xa'),'appdata':_0x42cce3[_0x65d6('0x9')]?_0x65d6('0xb')+_0x42cce3['alias']:_0x65d6('0x12'),'context':_0x42cce3[_0x65d6('0x7')],'exten':_0x42cce3[_0x65d6('0x8')],'priority':_0x566422++,'VoiceExtensionId':_0x42cce3['id']},{'type':'outbound','app':_0x65d6('0x5'),'appdata':_0x65d6('0x13')+(_0x42cce3['cutdigits']?'${EXTEN:'+_0x42cce3[_0x65d6('0x14')]+'}':_0x65d6('0x15')),'context':_0x42cce3['context'],'exten':_0x42cce3['exten'],'priority':_0x566422++,'VoiceExtensionId':_0x42cce3['id']},{'type':_0x65d6('0x11'),'app':_0x65d6('0x5'),'appdata':_0x65d6('0x16')+_0x42cce3['id'],'context':_0x42cce3[_0x65d6('0x7')],'exten':_0x42cce3[_0x65d6('0x8')],'priority':_0x566422++,'VoiceExtensionId':_0x42cce3['id']},{'type':_0x65d6('0x11'),'app':_0x65d6('0x17'),'appdata':_0x65d6('0x18')+(_0x566422+0x2)+_0x65d6('0x19')+(_0x566422+0x1)+')','context':_0x42cce3['context'],'exten':_0x42cce3[_0x65d6('0x8')],'priority':_0x566422++,'VoiceExtensionId':_0x42cce3['id']},{'type':_0x65d6('0x11'),'app':_0x65d6('0x5'),'appdata':_0x42cce3[_0x65d6('0x14')]?_0x65d6('0x1a')+_0x42cce3['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x42cce3[_0x65d6('0x7')],'exten':_0x42cce3[_0x65d6('0x8')],'priority':_0x566422++,'VoiceExtensionId':_0x42cce3['id']},{'type':'outbound','app':_0x65d6('0x5'),'appdata':_0x65d6('0xe'),'context':_0x42cce3[_0x65d6('0x7')],'exten':_0x42cce3[_0x65d6('0x8')],'priority':_0x566422++,'VoiceExtensionId':_0x42cce3['id']},{'type':_0x65d6('0x11'),'app':'Set','appdata':_0x65d6('0xf'),'context':_0x42cce3[_0x65d6('0x7')],'exten':_0x42cce3['exten'],'priority':_0x566422++,'VoiceExtensionId':_0x42cce3['id']},{'type':'outbound','app':_0x65d6('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x42cce3[_0x65d6('0x7')],'exten':_0x42cce3[_0x65d6('0x8')],'priority':_0x566422++,'VoiceExtensionId':_0x42cce3['id']},{'type':_0x65d6('0x11'),'app':_0x65d6('0x5'),'appdata':_0x65d6('0x1b')+_0x42cce3['id'],'context':_0x42cce3[_0x65d6('0x7')],'exten':_0x42cce3[_0x65d6('0x8')],'priority':_0x566422++,'VoiceExtensionId':_0x42cce3['id']}];if(_0x42cce3[_0x65d6('0x1c')](_0x65d6('0x1d'))&&_0x42cce3[_0x65d6('0x1d')]!==_0x65d6('0x1e')){_0x4ec1e1[_0x65d6('0xd')]({'type':_0x65d6('0x11'),'app':_0x65d6('0x5'),'appdata':_0x65d6('0x1f'),'context':_0x42cce3[_0x65d6('0x7')],'exten':_0x42cce3[_0x65d6('0x8')],'priority':_0x566422++,'VoiceExtensionId':_0x42cce3['id']},{'type':_0x65d6('0x11'),'app':_0x65d6('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x42cce3[_0x65d6('0x1d')]||'wav','context':_0x42cce3['context'],'exten':_0x42cce3[_0x65d6('0x8')],'priority':_0x566422++,'VoiceExtensionId':_0x42cce3['id']});}return _0x4ec1e1;}function _0x59fc9a(_0x57463f,_0x31de7f){var _0x1a4f13=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0x65d6('0x20'),'param':0x2},{'name':'url','param':0x3}];var _0x1dc50b={};var _0x51a5a8=_0x31de7f[_0x65d6('0x21')](',');var _0x1352e2=[];for(var _0x486c0f=0x0;_0x486c0f<_0x1a4f13[_0x65d6('0x22')];_0x486c0f++){switch(_0x1a4f13[_0x486c0f][_0x65d6('0x23')]){case'trunk':_0x1dc50b[_0x65d6('0x24')]=_0x51a5a8[_0x1a4f13[_0x486c0f]['param']]['split']('/')[0x1];_0x1dc50b[_0x65d6('0x25')]=_0x51a5a8[_0x1a4f13[_0x486c0f][_0x65d6('0x26')]][_0x65d6('0x21')]('/')[0x2];_0x1dc50b[_0x65d6('0x27')]=_0x1dc50b[_0x65d6('0x25')]?_0x1dc50b[_0x65d6('0x25')][_0x65d6('0x21')]('$')[0x0]:undefined;_0x1dc50b[_0x65d6('0x25')]=_0x57463f[_0x65d6('0x14')]?(_0x1dc50b['prefix']||'')+_0x65d6('0x28')+_0x57463f[_0x65d6('0x14')]+'}':(_0x1dc50b[_0x65d6('0x27')]||'')+_0x65d6('0x15');_0x1352e2[_0x1a4f13[_0x486c0f][_0x65d6('0x26')]]=[_0x65d6('0x29'),_0x1dc50b['trunk'],_0x1dc50b[_0x65d6('0x25')]]['join']('/');break;case _0x65d6('0x20'):_0x1dc50b[_0x65d6('0x20')]=_0x51a5a8[_0x1a4f13[_0x486c0f][_0x65d6('0x26')]];if(_0x57463f['recordingFormat']!=='none'){if(_0x1dc50b['options']['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x1dc50b[_0x65d6('0x20')]+=_0x65d6('0x2a');}}else{_0x1dc50b[_0x65d6('0x20')]=_0x1dc50b[_0x65d6('0x20')][_0x65d6('0x2b')](_0x65d6('0x2a'),'');}_0x1352e2[_0x1a4f13[_0x486c0f][_0x65d6('0x26')]]=_0x1dc50b[_0x65d6('0x20')];break;default:_0x1352e2[_0x1a4f13[_0x486c0f][_0x65d6('0x26')]]=_0x51a5a8[_0x1a4f13[_0x486c0f][_0x65d6('0x26')]];}}return _0x1352e2['join'](',');}function _0x170227(_0x32a007,_0x5eafaa,_0x4780af){return new Promise(function(_0x53df89,_0xad5ae1){var _0x46629d=[];if(_[_0x65d6('0x2c')](_0x5eafaa))return _0x53df89(_0x46629d);_0x560dbf[_0x65d6('0x2d')][_0x65d6('0x2e')]({'attributes':['id','interval',_0x65d6('0x2f')],'raw':!![]})['then'](function(_0x3a6076){for(var _0x61fded=0x0,_0x88e981=0x0;_0x61fded<_0x5eafaa[_0x65d6('0x22')];_0x61fded++,_0x88e981=0x0){var _0x453ef6=_0x5eafaa[_0x61fded];var _0x28918e=[];var _0x388dfe=[];delete _0x453ef6['id'];if(_0x453ef6[_0x65d6('0x30')]!==_0x65d6('0x31')){_0x453ef6[_0x65d6('0x32')]=[_0x453ef6[_0x65d6('0x30')]];}else{_0x453ef6[_0x65d6('0x32')]=_0x453ef6[_0x65d6('0x2f')]?_[_0x65d6('0x33')](_[_0x65d6('0x34')](_0x3a6076,{'IntervalId':_0x453ef6[_0x65d6('0x2f')]}),_0x65d6('0x30')):[];}_0x453ef6[_0x65d6('0x7')]=_0x32a007['context'];_0x453ef6['exten']=_0x32a007[_0x65d6('0x8')];if(_0x453ef6['type'])_0x453ef6['type']=_0x453ef6[_0x65d6('0x4')][_0x65d6('0x35')]();if(_0x32a007[_0x65d6('0x4')]===_0x65d6('0x11')){if(_0x453ef6[_0x65d6('0x1c')](_0x65d6('0x36'))&&_0x453ef6['tag']&&_0x453ef6[_0x65d6('0x36')]!=='--'){_0x28918e[_0x65d6('0xd')]({'type':_0x453ef6[_0x65d6('0x4')][_0x65d6('0x35')](),'app':_0x65d6('0x5'),'appdata':'CDR(tag)='+_0x453ef6[_0x65d6('0x36')],'context':_0x32a007['context'],'exten':_0x32a007[_0x65d6('0x8')],'priority':_0x453ef6[_0x65d6('0x32')][_0x65d6('0x22')]+_0x4780af+_0x88e981++,'VoiceExtensionId':_0x32a007['id']});}_0x28918e['push']({'type':_0x453ef6[_0x65d6('0x4')][_0x65d6('0x35')](),'app':'ExecIf','appdata':_0x65d6('0x37')+(_0x453ef6['callerID']?'Set(CALLERID(all)='+_0x453ef6['callerID']+')':_0x65d6('0x38')),'context':_0x32a007['context'],'exten':_0x32a007[_0x65d6('0x8')],'priority':_0x453ef6['intervals'][_0x65d6('0x22')]+_0x4780af+_0x88e981++,'VoiceExtensionId':_0x32a007['id']});}else{if(_0x453ef6['hasOwnProperty'](_0x65d6('0x39'))){if(['queue',_0x65d6('0x3a')][_0x65d6('0x3b')](_0x453ef6[_0x65d6('0x3c')][_0x65d6('0x35')]())&&_0x453ef6[_0x65d6('0x3d')]!==_0x65d6('0x3e')){if(_0x453ef6[_0x65d6('0x39')]){_0x28918e[_0x65d6('0xd')]({'type':_0x453ef6[_0x65d6('0x4')][_0x65d6('0x35')](),'app':_0x65d6('0x17'),'appdata':_0x65d6('0x3f'),'context':_0x32a007['context'],'exten':_0x32a007['exten'],'priority':_0x453ef6[_0x65d6('0x32')][_0x65d6('0x22')]+_0x4780af+_0x88e981++,'VoiceExtensionId':_0x32a007['id']});_0x28918e['push']({'type':_0x453ef6['type']['toLowerCase'](),'app':_0x65d6('0x5'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x32a007['context'],'exten':_0x32a007[_0x65d6('0x8')],'priority':_0x453ef6[_0x65d6('0x32')]['length']+_0x4780af+_0x88e981++,'VoiceExtensionId':_0x32a007['id']});}else{_0x28918e[_0x65d6('0xd')]({'type':_0x453ef6['type'][_0x65d6('0x35')](),'app':_0x65d6('0x17'),'appdata':_0x65d6('0x40'),'context':_0x32a007[_0x65d6('0x7')],'exten':_0x32a007['exten'],'priority':_0x453ef6['intervals'][_0x65d6('0x22')]+_0x4780af+_0x88e981++,'VoiceExtensionId':_0x32a007['id']});_0x28918e['push']({'type':_0x453ef6['type'][_0x65d6('0x35')](),'app':_0x65d6('0x5'),'appdata':_0x65d6('0x41'),'context':_0x32a007[_0x65d6('0x7')],'exten':_0x32a007[_0x65d6('0x8')],'priority':_0x453ef6[_0x65d6('0x32')][_0x65d6('0x22')]+_0x4780af+_0x88e981++,'VoiceExtensionId':_0x32a007['id']});}}}}for(var _0x4a168c=0x0;_0x4a168c<_0x453ef6[_0x65d6('0x32')]['length'];_0x4a168c++){var _0x2c1e71=_0x4780af+_0x453ef6[_0x65d6('0x32')]['length'];var _0x5a3bbc=_0x4a168c===_0x453ef6['intervals'][_0x65d6('0x22')]-0x1?_0x4780af+_0x28918e['length']+_0x388dfe[_0x65d6('0x22')]+0x2:_0x4780af+_0x4a168c+0x1;_0x28918e[_0x65d6('0x42')](_0x4a168c,0x0,{'type':_0x32a007['type'],'app':'GotoIfTime','appdata':_0x453ef6[_0x65d6('0x32')][_0x4a168c]+'?'+_0x32a007[_0x65d6('0x7')]+_0x65d6('0x43')+_0x2c1e71+':'+_0x32a007[_0x65d6('0x7')]+_0x65d6('0x43')+_0x5a3bbc,'exten':_0x32a007['exten'],'context':_0x32a007[_0x65d6('0x7')],'priority':_0x4780af+_0x4a168c,'VoiceExtensionId':_0x32a007['id']});}if(_0x453ef6[_0x65d6('0x3d')]==='outboundDial')_0x453ef6[_0x65d6('0x44')]=_0x59fc9a(_0x32a007,_0x453ef6[_0x65d6('0x44')]);_0x453ef6[_0x65d6('0x45')]=_0x28918e[_0x65d6('0x22')]?_[_0x65d6('0x46')](_0x28918e)[_0x65d6('0x45')]+0x1:_0x4780af;_0x46629d=_[_0x65d6('0x47')](_0x46629d,_0x28918e,[_0x453ef6],_0x388dfe);_0x4780af=_[_0x65d6('0x46')](_0x46629d)[_0x65d6('0x45')]+0x1;}return _0x53df89(_0x46629d);})[_0x65d6('0x48')](function(_0x3f47d0){_0xad5ae1(_0x3f47d0);});});}return _0x2f4967[_0x65d6('0x49')](_0x65d6('0x4a'),attributes,{'tableName':_0x65d6('0x4b'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x23aeb9){var _0x44cb3f=this[_0x65d6('0x4c')]({'plain':!![]});var _0x9f8ee0=_0x44cb3f[_0x65d6('0x4')]===_0x65d6('0x11')?_0x41a46f(_0x44cb3f):_0x43d8a6(_0x44cb3f);return _0x170227(_0x44cb3f,_0x23aeb9,_[_0x65d6('0x46')](_0x9f8ee0)[_0x65d6('0x45')]+0x1)[_0x65d6('0x4d')](function(_0x42bd51){var _0x11f4d1=_[_0x65d6('0x47')](_0x9f8ee0,_0x42bd51);_0x11f4d1[_0x65d6('0xd')]({'type':_0x44cb3f[_0x65d6('0x4')],'app':_0x65d6('0x4e'),'exten':_0x44cb3f[_0x65d6('0x8')],'context':_0x44cb3f[_0x65d6('0x7')],'priority':_[_0x65d6('0x46')](_0x11f4d1)[_0x65d6('0x45')]+0x1,'VoiceExtensionId':_0x44cb3f['id']});return _0x11f4d1;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 92aaa4c..83561bf 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 _0x02b6=['debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','findAll','options','attributes','limit','include','model','map','GetVoiceExtension','stringify','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s'];(function(_0x492987,_0x3d9e71){var _0x2ee521=function(_0x490b7e){while(--_0x490b7e){_0x492987['push'](_0x492987['shift']());}};_0x2ee521(++_0x3d9e71);}(_0x02b6,0xfe));var _0x602b=function(_0x327fce,_0x1a5a4a){_0x327fce=_0x327fce-0x0;var _0x5e32d3=_0x02b6[_0x327fce];return _0x5e32d3;};'use strict';var _=require(_0x602b('0x0'));var util=require('util');var moment=require(_0x602b('0x1'));var BPromise=require(_0x602b('0x2'));var rs=require(_0x602b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x602b('0x4'));var logger=require(_0x602b('0x5'))(_0x602b('0x6'));var config=require(_0x602b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x602b('0x8')]['http']({'port':0x232a});config[_0x602b('0x9')]=_[_0x602b('0xa')](config[_0x602b('0x9')],{'host':_0x602b('0xb'),'port':0x18eb});var socket=require(_0x602b('0xc'))(new Redis(config[_0x602b('0x9')]));require(_0x602b('0xd'))[_0x602b('0xe')](socket);function respondWithRpcPromise(_0x20c7cf,_0x1687ca,_0x4fb0a2){return new BPromise(function(_0x470cf0,_0x5ca85d){return client['request'](_0x20c7cf,_0x4fb0a2)[_0x602b('0xf')](function(_0x568461){logger[_0x602b('0x10')](_0x602b('0x11'),_0x1687ca,'request\x20sent');logger[_0x602b('0x12')](_0x602b('0x13'),_0x1687ca,_0x602b('0x14'),JSON['stringify'](_0x568461));if(_0x568461[_0x602b('0x15')]){if(_0x568461[_0x602b('0x15')][_0x602b('0x16')]===0x1f4){logger[_0x602b('0x15')](_0x602b('0x11'),_0x1687ca,_0x568461[_0x602b('0x15')][_0x602b('0x17')]);return _0x5ca85d(_0x568461['error']['message']);}logger[_0x602b('0x15')](_0x602b('0x11'),_0x1687ca,_0x568461[_0x602b('0x15')][_0x602b('0x17')]);return _0x470cf0(_0x568461[_0x602b('0x15')][_0x602b('0x17')]);}else{logger[_0x602b('0x10')](_0x602b('0x11'),_0x1687ca,_0x602b('0x14'));_0x470cf0(_0x568461['result'][_0x602b('0x17')]);}})[_0x602b('0x18')](function(_0x3ddabd){logger['error'](_0x602b('0x11'),_0x1687ca,_0x3ddabd);_0x5ca85d(_0x3ddabd);});});}exports['GetVoiceExtension']=function(_0x4ddfe0){var _0x311da8=this;return new Promise(function(_0x4e888d,_0x28eadf){return db['VoiceExtension'][_0x602b('0x19')]({'raw':_0x4ddfe0[_0x602b('0x1a')]?_0x4ddfe0[_0x602b('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4ddfe0[_0x602b('0x1a')]?_0x4ddfe0[_0x602b('0x1a')]['where']||null:null,'attributes':_0x4ddfe0[_0x602b('0x1a')]?_0x4ddfe0[_0x602b('0x1a')][_0x602b('0x1b')]||null:null,'limit':_0x4ddfe0[_0x602b('0x1a')]?_0x4ddfe0[_0x602b('0x1a')][_0x602b('0x1c')]||null:null,'include':_0x4ddfe0[_0x602b('0x1a')]?_0x4ddfe0[_0x602b('0x1a')][_0x602b('0x1d')]?_['map'](_0x4ddfe0[_0x602b('0x1a')][_0x602b('0x1d')],function(_0x5ce51b){return{'model':db[_0x5ce51b[_0x602b('0x1e')]],'as':_0x5ce51b['as'],'attributes':_0x5ce51b[_0x602b('0x1b')],'include':_0x5ce51b['include']?_[_0x602b('0x1f')](_0x5ce51b[_0x602b('0x1d')],function(_0x22cd69){return{'model':db[_0x22cd69[_0x602b('0x1e')]],'as':_0x22cd69['as'],'attributes':_0x22cd69[_0x602b('0x1b')],'include':_0x22cd69[_0x602b('0x1d')]?_[_0x602b('0x1f')](_0x22cd69[_0x602b('0x1d')],function(_0x3e82bc){return{'model':db[_0x3e82bc[_0x602b('0x1e')]],'as':_0x3e82bc['as'],'attributes':_0x3e82bc[_0x602b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23a7f4){logger['info'](_0x602b('0x20'),_0x4ddfe0);logger[_0x602b('0x12')](_0x602b('0x20'),_0x4ddfe0,JSON[_0x602b('0x21')](_0x23a7f4));_0x4e888d(_0x23a7f4);})[_0x602b('0x18')](function(_0x3647cf){logger[_0x602b('0x15')](_0x602b('0x20'),_0x3647cf[_0x602b('0x17')],_0x4ddfe0);_0x28eadf(_0x311da8[_0x602b('0x15')](0x1f4,_0x3647cf[_0x602b('0x17')]));});});}; \ No newline at end of file +var _0x1cb9=['then','info','request\x20sent','debug','stringify','error','VoiceExtension,\x20%s,\x20%s','message','result','catch','options','raw','where','limit','include','map','attributes','model','GetVoiceExtension','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request'];(function(_0x2fe319,_0x5b32c9){var _0xaf1ab2=function(_0x24db69){while(--_0x24db69){_0x2fe319['push'](_0x2fe319['shift']());}};_0xaf1ab2(++_0x5b32c9);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2942db,_0x4cf5a6){_0x2942db=_0x2942db-0x0;var _0x265b0f=_0x1cb9[_0x2942db];return _0x265b0f;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});config[_0x91cb('0xb')]=_[_0x91cb('0xc')](config['redis'],{'host':_0x91cb('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x91cb('0xb')]));require('./voiceExtension.socket')[_0x91cb('0xe')](socket);function respondWithRpcPromise(_0x317df0,_0x45317f,_0x4a631d){return new BPromise(function(_0x429928,_0x23ba9a){return client[_0x91cb('0xf')](_0x317df0,_0x4a631d)[_0x91cb('0x10')](function(_0x2465be){logger[_0x91cb('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x45317f,_0x91cb('0x12'));logger[_0x91cb('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x45317f,_0x91cb('0x12'),JSON[_0x91cb('0x14')](_0x2465be));if(_0x2465be[_0x91cb('0x15')]){if(_0x2465be[_0x91cb('0x15')]['code']===0x1f4){logger['error'](_0x91cb('0x16'),_0x45317f,_0x2465be[_0x91cb('0x15')]['message']);return _0x23ba9a(_0x2465be['error'][_0x91cb('0x17')]);}logger[_0x91cb('0x15')](_0x91cb('0x16'),_0x45317f,_0x2465be['error'][_0x91cb('0x17')]);return _0x429928(_0x2465be[_0x91cb('0x15')]['message']);}else{logger[_0x91cb('0x11')](_0x91cb('0x16'),_0x45317f,_0x91cb('0x12'));_0x429928(_0x2465be[_0x91cb('0x18')]['message']);}})[_0x91cb('0x19')](function(_0x7dcf60){logger['error'](_0x91cb('0x16'),_0x45317f,_0x7dcf60);_0x23ba9a(_0x7dcf60);});});}exports['GetVoiceExtension']=function(_0x55042a){var _0x281ff3=this;return new Promise(function(_0x160ded,_0x56e409){return db['VoiceExtension']['findAll']({'raw':_0x55042a[_0x91cb('0x1a')]?_0x55042a[_0x91cb('0x1a')][_0x91cb('0x1b')]===undefined?!![]:![]:!![],'where':_0x55042a[_0x91cb('0x1a')]?_0x55042a['options'][_0x91cb('0x1c')]||null:null,'attributes':_0x55042a[_0x91cb('0x1a')]?_0x55042a[_0x91cb('0x1a')]['attributes']||null:null,'limit':_0x55042a[_0x91cb('0x1a')]?_0x55042a[_0x91cb('0x1a')][_0x91cb('0x1d')]||null:null,'include':_0x55042a[_0x91cb('0x1a')]?_0x55042a[_0x91cb('0x1a')][_0x91cb('0x1e')]?_[_0x91cb('0x1f')](_0x55042a[_0x91cb('0x1a')][_0x91cb('0x1e')],function(_0x4c8438){return{'model':db[_0x4c8438['model']],'as':_0x4c8438['as'],'attributes':_0x4c8438[_0x91cb('0x20')],'include':_0x4c8438['include']?_[_0x91cb('0x1f')](_0x4c8438[_0x91cb('0x1e')],function(_0x318031){return{'model':db[_0x318031['model']],'as':_0x318031['as'],'attributes':_0x318031[_0x91cb('0x20')],'include':_0x318031['include']?_[_0x91cb('0x1f')](_0x318031[_0x91cb('0x1e')],function(_0x3b3ee6){return{'model':db[_0x3b3ee6[_0x91cb('0x21')]],'as':_0x3b3ee6['as'],'attributes':_0x3b3ee6[_0x91cb('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f04a3){logger['info'](_0x91cb('0x22'),_0x55042a);logger[_0x91cb('0x13')](_0x91cb('0x22'),_0x55042a,JSON['stringify'](_0x2f04a3));_0x160ded(_0x2f04a3);})[_0x91cb('0x19')](function(_0x146e1f){logger[_0x91cb('0x15')](_0x91cb('0x22'),_0x146e1f[_0x91cb('0x17')],_0x55042a);_0x56e409(_0x281ff3[_0x91cb('0x15')](0x1f4,_0x146e1f[_0x91cb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index e3f44c4..92de716 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 _0x2ef3=['update','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0xaf06ee,_0x139d54){var _0x5e463e=function(_0x4338f5){while(--_0x4338f5){_0xaf06ee['push'](_0xaf06ee['shift']());}};_0x5e463e(++_0x139d54);}(_0x2ef3,0xba));var _0x32ef=function(_0x249d7e,_0x3ccaea){_0x249d7e=_0x249d7e-0x0;var _0x2c4bcf=_0x2ef3[_0x249d7e];return _0x2c4bcf;};'use strict';var VoiceExtensionEvents=require(_0x32ef('0x0'));var events=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3')];function createListener(_0x3944df,_0x38047b){return function(_0x48106c){_0x38047b[_0x32ef('0x4')](_0x3944df,_0x48106c);};}function removeListener(_0x38b7f3,_0x524ab6){return function(){VoiceExtensionEvents[_0x32ef('0x5')](_0x38b7f3,_0x524ab6);};}exports[_0x32ef('0x6')]=function(_0x4c8104){for(var _0x5dfa09=0x0,_0x2c0089=events[_0x32ef('0x7')];_0x5dfa09<_0x2c0089;_0x5dfa09++){var _0x367c39=events[_0x5dfa09];var _0x2fb8eb=createListener(_0x32ef('0x8')+_0x367c39,_0x4c8104);VoiceExtensionEvents['on'](_0x367c39,_0x2fb8eb);}}; \ No newline at end of file +var _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x814b,0x1a2));var _0xb814=function(_0x263b0e,_0xc6479f){_0x263b0e=_0x263b0e-0x0;var _0x113fee=_0x814b[_0x263b0e];return _0x113fee;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 598af50..353bf8f 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 _0x3d04=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','show','/:id/messages','getMessages','create','update','delete','/:id','destroy'];(function(_0x1b2779,_0x181d22){var _0x162929=function(_0x2d0083){while(--_0x2d0083){_0x1b2779['push'](_0x1b2779['shift']());}};_0x162929(++_0x181d22);}(_0x3d04,0xbe));var _0x43d0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3d04[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var path=require(_0x43d0('0x2'));var timeout=require(_0x43d0('0x3'));var express=require(_0x43d0('0x4'));var router=express[_0x43d0('0x5')]();var fs_extra=require(_0x43d0('0x6'));var auth=require(_0x43d0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x43d0('0x8'));var controller=require(_0x43d0('0x9'));router[_0x43d0('0xa')]('/',auth[_0x43d0('0xb')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x43d0('0xc')]);router[_0x43d0('0xa')](_0x43d0('0xd'),auth[_0x43d0('0xb')](),controller[_0x43d0('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x43d0('0xf')]);router['put']('/:id',auth[_0x43d0('0xb')](),controller[_0x43d0('0x10')]);router[_0x43d0('0x11')](_0x43d0('0x12'),auth['isAuthenticated'](),controller[_0x43d0('0x13')]);module[_0x43d0('0x14')]=router; \ No newline at end of file +var _0x4c60=['exports','multer','util','path','connect-timeout','Router','./voiceMail.controller','get','isAuthenticated','index','/:id','/:id/messages','getMessages','put','update','destroy'];(function(_0x1b8c1b,_0x16023d){var _0x69322f=function(_0x250bf5){while(--_0x250bf5){_0x1b8c1b['push'](_0x1b8c1b['shift']());}};_0x69322f(++_0x16023d);}(_0x4c60,0xc1));var _0x04c6=function(_0x46b927,_0x1e6703){_0x46b927=_0x46b927-0x0;var _0x1b50d9=_0x4c60[_0x46b927];return _0x1b50d9;};'use strict';var multer=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var path=require(_0x04c6('0x2'));var timeout=require(_0x04c6('0x3'));var express=require('express');var router=express[_0x04c6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x04c6('0x5'));router[_0x04c6('0x6')]('/',auth[_0x04c6('0x7')](),controller[_0x04c6('0x8')]);router[_0x04c6('0x6')](_0x04c6('0x9'),auth[_0x04c6('0x7')](),controller['show']);router[_0x04c6('0x6')](_0x04c6('0xa'),auth[_0x04c6('0x7')](),controller[_0x04c6('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x04c6('0xc')]('/:id',auth[_0x04c6('0x7')](),controller[_0x04c6('0xd')]);router['delete'](_0x04c6('0x9'),auth[_0x04c6('0x7')](),controller[_0x04c6('0xe')]);module[_0x04c6('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index d8f751e..ef55134 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 _0x7ff6=['contest_mailbox','setDataValue','email','trim','central','ENUM','yes','TIMESTAMP','INTEGER','fullname','\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail'];(function(_0x1111ba,_0x3eb8b2){var _0x28921c=function(_0x5ef0e7){while(--_0x5ef0e7){_0x1111ba['push'](_0x1111ba['shift']());}};_0x28921c(++_0x3eb8b2);}(_0x7ff6,0x1a5));var _0x67ff=function(_0x432cfb,_0x1a2962){_0x432cfb=_0x432cfb-0x0;var _0x171ece=_0x7ff6[_0x432cfb];return _0x171ece;};'use strict';var Sequelize=require(_0x67ff('0x0'));module[_0x67ff('0x1')]={'customer_id':{'type':Sequelize[_0x67ff('0x2')]},'context':{'type':Sequelize[_0x67ff('0x2')],'defaultValue':_0x67ff('0x3'),'unique':_0x67ff('0x4')},'mailbox':{'type':Sequelize[_0x67ff('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x67ff('0x2')]},'fullname':{'type':Sequelize[_0x67ff('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x589709){this[_0x67ff('0x5')](_0x67ff('0x6'),typeof _0x589709==='string'&&_0x589709[_0x67ff('0x7')]()?_0x589709['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x67ff('0x2')],'defaultValue':_0x67ff('0x8')},'attach':{'type':Sequelize[_0x67ff('0x9')](_0x67ff('0xa'),'no'),'defaultValue':_0x67ff('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x67ff('0xa'),'no'),'defaultValue':_0x67ff('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x67ff('0x2')]},'callback':{'type':Sequelize[_0x67ff('0x2')]},'review':{'type':Sequelize[_0x67ff('0x9')](_0x67ff('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x67ff('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x67ff('0x9')](_0x67ff('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x67ff('0x9')](_0x67ff('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x67ff('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x67ff('0x9')](_0x67ff('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x67ff('0x9')](_0x67ff('0xa'),'no'),'defaultValue':_0x67ff('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x67ff('0x9')](_0x67ff('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x67ff('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x67ff('0x9')](_0x67ff('0xa'),'no'),'defaultValue':_0x67ff('0xa'),'allowNull':![]},'stamp':{'type':_0x67ff('0xb')},'emailsubject':{'type':Sequelize[_0x67ff('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x67ff('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x67ff('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x67ff('0xd'))+_0x67ff('0xe')+this[_0x67ff('0xf')](_0x67ff('0x10'));}}}; \ No newline at end of file +var _0xaf4d=['trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','\x20-\x20','mailbox','sequelize','exports','contest_mailbox','STRING','setDataValue','string'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xaf4d,0x14a));var _0xdaf4=function(_0x1065ba,_0x285205){_0x1065ba=_0x1065ba-0x0;var _0x47e14b=_0xaf4d[_0x1065ba];return _0x47e14b;};'use strict';var Sequelize=require(_0xdaf4('0x0'));module[_0xdaf4('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0xdaf4('0x2')},'mailbox':{'type':Sequelize[_0xdaf4('0x3')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xdaf4('0x3')]},'fullname':{'type':Sequelize[_0xdaf4('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x123dc6){this[_0xdaf4('0x4')]('email',typeof _0x123dc6===_0xdaf4('0x5')&&_0x123dc6[_0xdaf4('0x6')]()?_0x123dc6['trim']():null);}},'pager':{'type':Sequelize[_0xdaf4('0x3')]},'tz':{'type':Sequelize[_0xdaf4('0x3')],'defaultValue':_0xdaf4('0x7')},'attach':{'type':Sequelize[_0xdaf4('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xdaf4('0x8')](_0xdaf4('0x9'),'no'),'defaultValue':_0xdaf4('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xdaf4('0x3')]},'review':{'type':Sequelize[_0xdaf4('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xdaf4('0x8')](_0xdaf4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xdaf4('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xdaf4('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xdaf4('0x8')](_0xdaf4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xdaf4('0x8')](_0xdaf4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xdaf4('0x8')](_0xdaf4('0x9'),'no'),'defaultValue':_0xdaf4('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xdaf4('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xdaf4('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xdaf4('0x8')](_0xdaf4('0x9'),'no'),'defaultValue':_0xdaf4('0x9'),'allowNull':![]},'stamp':{'type':_0xdaf4('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xdaf4('0x3')]},'maxsecs':{'type':Sequelize[_0xdaf4('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xdaf4('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xdaf4('0xd')],'get':function(){return this['getDataValue']('fullname')+_0xdaf4('0xe')+this['getDataValue'](_0xdaf4('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 850b993..3f6ced6 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 _0xd64b=['merge','filter','options','includeAll','include','findAll','catch','params','filters','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','order','sort','mailbox','VoiceMailMessage','findAndCountAll','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','apply','reject','update','then','destroy','get','Voicemails','stack','name','send','index','map','VoiceMail','rawAttributes','type','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','where','pick'];(function(_0x107844,_0x41926f){var _0x40c2b5=function(_0x2d0c58){while(--_0x2d0c58){_0x107844['push'](_0x107844['shift']());}};_0x40c2b5(++_0x41926f);}(_0xd64b,0xc1));var _0xbd64=function(_0x420746,_0x26dd66){_0x420746=_0x420746-0x0;var _0x1c6de2=_0xd64b[_0x420746];return _0x1c6de2;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x136f60,_0x2729d8){_0x2729d8=_0x2729d8||0xcc;return function(_0x3a941c){if(_0x3a941c){return _0x136f60[_0xbd64('0x16')](_0x2729d8);}return _0x136f60[_0xbd64('0x17')](_0x2729d8)[_0xbd64('0x18')]();};}function respondWithResult(_0x2e23f2,_0x269e2f){_0x269e2f=_0x269e2f||0xc8;return function(_0x2b5808){if(_0x2b5808){return _0x2e23f2['status'](_0x269e2f)[_0xbd64('0x19')](_0x2b5808);}};}function respondWithFilteredResult(_0x13e7a4,_0x3ff550){return function(_0x32fd34){if(_0x32fd34){var _0x29fc16=typeof _0x3ff550['offset']===_0xbd64('0x1a')&&typeof _0x3ff550['limit']===_0xbd64('0x1a');var _0x1432a6=_0x32fd34[_0xbd64('0x1b')];var _0x1d7a14=_0x29fc16?0x0:_0x3ff550[_0xbd64('0x1c')];var _0x2f4554=_0x29fc16?_0x32fd34[_0xbd64('0x1b')]:_0x3ff550[_0xbd64('0x1c')]+_0x3ff550['limit'];var _0x305545;if(_0x2f4554>=_0x1432a6){_0x2f4554=_0x1432a6;_0x305545=0xc8;}else{_0x305545=0xce;}_0x13e7a4[_0xbd64('0x17')](_0x305545);return _0x13e7a4['set']('Content-Range',_0x1d7a14+'-'+_0x2f4554+'/'+_0x1432a6)[_0xbd64('0x19')](_0x32fd34);}return null;};}function patchUpdates(_0x42b328){return function(_0x196d21){try{jsonpatch[_0xbd64('0x1d')](_0x196d21,_0x42b328,!![]);}catch(_0x2c5551){return BPromise[_0xbd64('0x1e')](_0x2c5551);}return _0x196d21['save']();};}function saveUpdates(_0x4d4a16,_0x6038f){return function(_0x41f2f){if(_0x41f2f){return _0x41f2f[_0xbd64('0x1f')](_0x4d4a16)[_0xbd64('0x20')](function(_0x55e74c){return _0x55e74c;});}return null;};}function removeEntity(_0x51d118,_0x28497c){return function(_0x4afaff){if(_0x4afaff){return _0x4afaff[_0xbd64('0x21')]()['then'](function(){var _0x33452d=_0x4afaff[_0xbd64('0x22')]({'plain':!![]});var _0x3d12a0=_0xbd64('0x23');return db['UserProfileResource'][_0xbd64('0x21')]({'where':{'type':_0x3d12a0,'resourceId':_0x33452d['id']}})[_0xbd64('0x20')](function(){return _0x4afaff;});})[_0xbd64('0x20')](function(){_0x51d118[_0xbd64('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e8719,_0x29c9c8){return function(_0x49eac5){if(!_0x49eac5){_0x4e8719['sendStatus'](0x194);}return _0x49eac5;};}function handleError(_0xfa918,_0x5aacdd){_0x5aacdd=_0x5aacdd||0x1f4;return function(_0x3cf5b7){logger['error'](_0x3cf5b7[_0xbd64('0x24')]);if(_0x3cf5b7['name']){delete _0x3cf5b7[_0xbd64('0x25')];}_0xfa918[_0xbd64('0x17')](_0x5aacdd)[_0xbd64('0x26')](_0x3cf5b7);};}exports[_0xbd64('0x27')]=function(_0x306f19,_0x207ffc){var _0x4ed44a={},_0x35bdd5={},_0xe876c9={'count':0x0,'rows':[]};var _0xc44280=_[_0xbd64('0x28')](db[_0xbd64('0x29')][_0xbd64('0x2a')],function(_0x5e70d3){return{'name':_0x5e70d3['fieldName'],'type':_0x5e70d3[_0xbd64('0x2b')]['key']};});_0x35bdd5[_0xbd64('0x2c')]=_[_0xbd64('0x28')](_0xc44280,'name');_0x35bdd5['query']=_[_0xbd64('0x2d')](_0x306f19['query']);_0x35bdd5['filters']=_[_0xbd64('0x2e')](_0x35bdd5[_0xbd64('0x2c')],_0x35bdd5[_0xbd64('0x2f')]);_0x4ed44a['attributes']=_[_0xbd64('0x2e')](_0x35bdd5['model'],qs[_0xbd64('0x30')](_0x306f19[_0xbd64('0x2f')][_0xbd64('0x30')]));_0x4ed44a[_0xbd64('0x31')]=_0x4ed44a[_0xbd64('0x31')][_0xbd64('0x32')]?_0x4ed44a['attributes']:_0x35bdd5['model'];if(!_0x306f19[_0xbd64('0x2f')][_0xbd64('0x33')](_0xbd64('0x34'))){_0x4ed44a[_0xbd64('0x35')]=qs[_0xbd64('0x35')](_0x306f19[_0xbd64('0x2f')]['limit']);_0x4ed44a['offset']=qs[_0xbd64('0x1c')](_0x306f19[_0xbd64('0x2f')][_0xbd64('0x1c')]);}_0x4ed44a['order']=qs['sort'](_0x306f19[_0xbd64('0x2f')]['sort']);_0x4ed44a[_0xbd64('0x36')]=qs['filters'](_[_0xbd64('0x37')](_0x306f19[_0xbd64('0x2f')],_0x35bdd5['filters']),_0xc44280);if(_0x306f19[_0xbd64('0x2f')]['filter']){_0x4ed44a['where']=_[_0xbd64('0x38')](_0x4ed44a[_0xbd64('0x36')],{'$or':_[_0xbd64('0x28')](_0xc44280,function(_0x52f401){if(_0x52f401['type']!=='VIRTUAL'){var _0x344d46={};_0x344d46[_0x52f401[_0xbd64('0x25')]]={'$like':'%'+_0x306f19['query'][_0xbd64('0x39')]+'%'};return _0x344d46;}})});}_0x4ed44a=_[_0xbd64('0x38')]({},_0x4ed44a,_0x306f19[_0xbd64('0x3a')]);var _0x27fd12={'where':_0x4ed44a['where']};return db['VoiceMail'][_0xbd64('0x1b')](_0x27fd12)['then'](function(_0x595a91){_0xe876c9[_0xbd64('0x1b')]=_0x595a91;if(_0x306f19[_0xbd64('0x2f')][_0xbd64('0x3b')]){_0x4ed44a[_0xbd64('0x3c')]=[{'all':!![]}];}return db[_0xbd64('0x29')][_0xbd64('0x3d')](_0x4ed44a);})[_0xbd64('0x20')](function(_0x762380){_0xe876c9['rows']=_0x762380;return _0xe876c9;})[_0xbd64('0x20')](respondWithFilteredResult(_0x207ffc,_0x4ed44a))[_0xbd64('0x3e')](handleError(_0x207ffc,null));};exports['show']=function(_0x41b27a,_0x1e4983){var _0xe5b069={'raw':!![],'where':{'id':_0x41b27a[_0xbd64('0x3f')]['id']}},_0x2bc972={};_0x2bc972[_0xbd64('0x2c')]=_[_0xbd64('0x2d')](db['VoiceMail'][_0xbd64('0x2a')]);_0x2bc972['query']=_[_0xbd64('0x2d')](_0x41b27a['query']);_0x2bc972[_0xbd64('0x40')]=_[_0xbd64('0x2e')](_0x2bc972[_0xbd64('0x2c')],_0x2bc972['query']);_0xe5b069[_0xbd64('0x31')]=_['intersection'](_0x2bc972['model'],qs['fields'](_0x41b27a[_0xbd64('0x2f')][_0xbd64('0x30')]));_0xe5b069[_0xbd64('0x31')]=_0xe5b069[_0xbd64('0x31')][_0xbd64('0x32')]?_0xe5b069[_0xbd64('0x31')]:_0x2bc972[_0xbd64('0x2c')];if(_0x41b27a['query'][_0xbd64('0x3b')]){_0xe5b069[_0xbd64('0x3c')]=[{'all':!![]}];}_0xe5b069=_[_0xbd64('0x38')]({},_0xe5b069,_0x41b27a['options']);return db[_0xbd64('0x29')][_0xbd64('0x41')](_0xe5b069)[_0xbd64('0x20')](handleEntityNotFound(_0x1e4983,null))[_0xbd64('0x20')](respondWithResult(_0x1e4983,null))[_0xbd64('0x3e')](handleError(_0x1e4983,null));};exports['create']=function(_0x283699,_0x1a9ec8){return db[_0xbd64('0x29')][_0xbd64('0x42')](_0x283699['body'],{})['then'](function(_0x1e008f){var _0x2a7eec=_0x283699[_0xbd64('0x43')][_0xbd64('0x22')]({'plain':!![]});if(!_0x2a7eec)throw new Error(_0xbd64('0x44'));if(_0x2a7eec[_0xbd64('0x45')]===_0xbd64('0x43')){var _0x3807a7=_0x1e008f[_0xbd64('0x22')]({'plain':!![]});var _0x2709b2=_0xbd64('0x23');return db[_0xbd64('0x46')][_0xbd64('0x41')]({'where':{'name':_0x2709b2,'userProfileId':_0x2a7eec[_0xbd64('0x47')]},'raw':!![]})[_0xbd64('0x20')](function(_0x5bd444){if(_0x5bd444&&_0x5bd444[_0xbd64('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x3807a7['name'],'resourceId':_0x3807a7['id'],'type':_0x5bd444['name'],'sectionId':_0x5bd444['id']},{})[_0xbd64('0x20')](function(){return _0x1e008f;});}else{return _0x1e008f;}})[_0xbd64('0x3e')](function(_0x5480f5){logger[_0xbd64('0x49')](_0xbd64('0x4a'),_0x5480f5);throw _0x5480f5;});}return _0x1e008f;})[_0xbd64('0x20')](respondWithResult(_0x1a9ec8,0xc9))['catch'](handleError(_0x1a9ec8,null));};exports[_0xbd64('0x1f')]=function(_0x371bad,_0x44cd4f){if(_0x371bad[_0xbd64('0x4b')]['id']){delete _0x371bad[_0xbd64('0x4b')]['id'];}return db[_0xbd64('0x29')]['find']({'where':{'id':_0x371bad['params']['id']}})['then'](handleEntityNotFound(_0x44cd4f,null))[_0xbd64('0x20')](saveUpdates(_0x371bad[_0xbd64('0x4b')],null))[_0xbd64('0x20')](respondWithResult(_0x44cd4f,null))[_0xbd64('0x3e')](handleError(_0x44cd4f,null));};exports['destroy']=function(_0x1d0d9f,_0x20b275){return db[_0xbd64('0x29')][_0xbd64('0x41')]({'where':{'id':_0x1d0d9f[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x20b275,null))['then'](removeEntity(_0x20b275,null))[_0xbd64('0x3e')](handleError(_0x20b275,null));};exports[_0xbd64('0x4c')]=function(_0x15f1fc,_0x1fe3e5,_0x465661){return db[_0xbd64('0x29')][_0xbd64('0x4d')]({'where':{'id':_0x15f1fc[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x1fe3e5,null))[_0xbd64('0x20')](function(_0x3812b3){var _0xffda84;var _0x4a1e21={},_0x56c7d9={};_0x56c7d9[_0xbd64('0x2c')]=_[_0xbd64('0x2d')](db['VoiceMailMessage']['rawAttributes']);_0x56c7d9[_0xbd64('0x2f')]=_[_0xbd64('0x2d')](_0x15f1fc['query']);_0x56c7d9[_0xbd64('0x40')]=_[_0xbd64('0x2e')](_0x56c7d9[_0xbd64('0x2c')],_0x56c7d9[_0xbd64('0x2f')]);_0x4a1e21[_0xbd64('0x31')]=_[_0xbd64('0x2e')](_0x56c7d9[_0xbd64('0x2c')],qs[_0xbd64('0x30')](_0x15f1fc[_0xbd64('0x2f')]['fields']));_0x4a1e21[_0xbd64('0x31')]=_0x4a1e21[_0xbd64('0x31')][_0xbd64('0x32')]?_0x4a1e21['attributes']:_0x56c7d9[_0xbd64('0x2c')];if(!_0x15f1fc[_0xbd64('0x2f')]['hasOwnProperty'](_0xbd64('0x34'))){_0x4a1e21[_0xbd64('0x35')]=qs[_0xbd64('0x35')](_0x15f1fc[_0xbd64('0x2f')][_0xbd64('0x35')]);_0x4a1e21[_0xbd64('0x1c')]=qs['offset'](_0x15f1fc[_0xbd64('0x2f')][_0xbd64('0x1c')]);}_0x4a1e21[_0xbd64('0x4e')]=qs[_0xbd64('0x4f')](_0x15f1fc['query'][_0xbd64('0x4f')]);_0x4a1e21[_0xbd64('0x36')]=qs['filters'](_[_0xbd64('0x37')](_0x15f1fc['query'],_0x56c7d9[_0xbd64('0x40')]));if(_0x15f1fc[_0xbd64('0x2f')][_0xbd64('0x39')]){_0x4a1e21[_0xbd64('0x36')]=_['merge'](_0x4a1e21[_0xbd64('0x36')],{'$or':_[_0xbd64('0x28')](_0x4a1e21[_0xbd64('0x31')],function(_0x23925c){var _0x463a60={};_0x463a60[_0x23925c]={'$like':'%'+_0x15f1fc[_0xbd64('0x2f')]['filter']+'%'};return _0x463a60;})});}_0x4a1e21['where']=_['merge'](_0x4a1e21[_0xbd64('0x36')],{'mailboxuser':_0x3812b3[_0xbd64('0x50')]});_0x4a1e21=_[_0xbd64('0x38')]({},_0x4a1e21,_0x15f1fc[_0xbd64('0x3a')]);return db[_0xbd64('0x51')][_0xbd64('0x52')](_0x4a1e21)['then'](respondWithFilteredResult(_0x1fe3e5,_0x4a1e21));})[_0xbd64('0x3e')](handleError(_0x1fe3e5,null));}; \ No newline at end of file +var _0xbee3=['map','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceMail','includeAll','include','findAll','rows','catch','rawAttributes','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','findOne','nolimit','order','mailbox','findAndCountAll','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','end','error','stack','name','send','index'];(function(_0x59b085,_0x28d113){var _0x57cb3f=function(_0xd81b6c){while(--_0xd81b6c){_0x59b085['push'](_0x59b085['shift']());}};_0x57cb3f(++_0x28d113);}(_0xbee3,0xd5));var _0x3bee=function(_0x2cf116,_0x1287d5){_0x2cf116=_0x2cf116-0x0;var _0x24fcb7=_0xbee3[_0x2cf116];return _0x24fcb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3bee('0x1'));var moment=require(_0x3bee('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3bee('0x3'));var util=require(_0x3bee('0x4'));var path=require(_0x3bee('0x5'));var sox=require('sox');var csv=require(_0x3bee('0x6'));var ejs=require(_0x3bee('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bee('0x8'));var squel=require(_0x3bee('0x9'));var crypto=require(_0x3bee('0xa'));var jsforce=require(_0x3bee('0xb'));var deskjs=require(_0x3bee('0xc'));var toCsv=require(_0x3bee('0x6'));var querystring=require(_0x3bee('0xd'));var Papa=require('papaparse');var Redis=require(_0x3bee('0xe'));var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require(_0x3bee('0x12'));var logger=require(_0x3bee('0x13'))('api');var utils=require(_0x3bee('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3bee('0x15'));var db=require(_0x3bee('0x16'))['db'];function respondWithStatusCode(_0x407526,_0x6950d0){_0x6950d0=_0x6950d0||0xcc;return function(_0x410124){if(_0x410124){return _0x407526[_0x3bee('0x17')](_0x6950d0);}return _0x407526[_0x3bee('0x18')](_0x6950d0)['end']();};}function respondWithResult(_0xad01f9,_0x33504d){_0x33504d=_0x33504d||0xc8;return function(_0x31ac52){if(_0x31ac52){return _0xad01f9[_0x3bee('0x18')](_0x33504d)[_0x3bee('0x19')](_0x31ac52);}};}function respondWithFilteredResult(_0x5b9473,_0x558436){return function(_0x346767){if(_0x346767){var _0x515397=typeof _0x558436[_0x3bee('0x1a')]===_0x3bee('0x1b')&&typeof _0x558436['limit']==='undefined';var _0x1582a4=_0x346767[_0x3bee('0x1c')];var _0xfdba3b=_0x515397?0x0:_0x558436[_0x3bee('0x1a')];var _0x49095a=_0x515397?_0x346767[_0x3bee('0x1c')]:_0x558436[_0x3bee('0x1a')]+_0x558436[_0x3bee('0x1d')];var _0x49b32d;if(_0x49095a>=_0x1582a4){_0x49095a=_0x1582a4;_0x49b32d=0xc8;}else{_0x49b32d=0xce;}_0x5b9473[_0x3bee('0x18')](_0x49b32d);return _0x5b9473[_0x3bee('0x1e')](_0x3bee('0x1f'),_0xfdba3b+'-'+_0x49095a+'/'+_0x1582a4)['json'](_0x346767);}return null;};}function patchUpdates(_0x4f36af){return function(_0x1afd0f){try{jsonpatch[_0x3bee('0x20')](_0x1afd0f,_0x4f36af,!![]);}catch(_0x57aba4){return BPromise[_0x3bee('0x21')](_0x57aba4);}return _0x1afd0f[_0x3bee('0x22')]();};}function saveUpdates(_0x2eea75,_0x179e62){return function(_0x28c248){if(_0x28c248){return _0x28c248[_0x3bee('0x23')](_0x2eea75)[_0x3bee('0x24')](function(_0x582fa9){return _0x582fa9;});}return null;};}function removeEntity(_0x8ae4ca,_0x1ed0c1){return function(_0x1fed5a){if(_0x1fed5a){return _0x1fed5a[_0x3bee('0x25')]()['then'](function(){var _0x45249c=_0x1fed5a[_0x3bee('0x26')]({'plain':!![]});var _0x1e0111='Voicemails';return db['UserProfileResource'][_0x3bee('0x25')]({'where':{'type':_0x1e0111,'resourceId':_0x45249c['id']}})[_0x3bee('0x24')](function(){return _0x1fed5a;});})['then'](function(){_0x8ae4ca[_0x3bee('0x18')](0xcc)[_0x3bee('0x27')]();});}};}function handleEntityNotFound(_0x2e666a,_0x5b1eec){return function(_0x1984c4){if(!_0x1984c4){_0x2e666a[_0x3bee('0x17')](0x194);}return _0x1984c4;};}function handleError(_0x150766,_0x4f2066){_0x4f2066=_0x4f2066||0x1f4;return function(_0x239fa4){logger[_0x3bee('0x28')](_0x239fa4[_0x3bee('0x29')]);if(_0x239fa4['name']){delete _0x239fa4[_0x3bee('0x2a')];}_0x150766[_0x3bee('0x18')](_0x4f2066)[_0x3bee('0x2b')](_0x239fa4);};}exports[_0x3bee('0x2c')]=function(_0x3433aa,_0x559c2b){var _0x564e45={},_0x3fbc8c={},_0x1e1529={'count':0x0,'rows':[]};var _0x10bae0=_[_0x3bee('0x2d')](db['VoiceMail']['rawAttributes'],function(_0x38f93c){return{'name':_0x38f93c[_0x3bee('0x2e')],'type':_0x38f93c['type']['key']};});_0x3fbc8c[_0x3bee('0x2f')]=_[_0x3bee('0x2d')](_0x10bae0,_0x3bee('0x2a'));_0x3fbc8c[_0x3bee('0x30')]=_[_0x3bee('0x31')](_0x3433aa[_0x3bee('0x30')]);_0x3fbc8c[_0x3bee('0x32')]=_[_0x3bee('0x33')](_0x3fbc8c[_0x3bee('0x2f')],_0x3fbc8c[_0x3bee('0x30')]);_0x564e45['attributes']=_['intersection'](_0x3fbc8c[_0x3bee('0x2f')],qs['fields'](_0x3433aa['query'][_0x3bee('0x34')]));_0x564e45[_0x3bee('0x35')]=_0x564e45[_0x3bee('0x35')][_0x3bee('0x36')]?_0x564e45[_0x3bee('0x35')]:_0x3fbc8c[_0x3bee('0x2f')];if(!_0x3433aa[_0x3bee('0x30')][_0x3bee('0x37')]('nolimit')){_0x564e45[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x3433aa['query'][_0x3bee('0x1d')]);_0x564e45[_0x3bee('0x1a')]=qs[_0x3bee('0x1a')](_0x3433aa[_0x3bee('0x30')][_0x3bee('0x1a')]);}_0x564e45['order']=qs['sort'](_0x3433aa[_0x3bee('0x30')][_0x3bee('0x38')]);_0x564e45[_0x3bee('0x39')]=qs[_0x3bee('0x32')](_[_0x3bee('0x3a')](_0x3433aa[_0x3bee('0x30')],_0x3fbc8c[_0x3bee('0x32')]),_0x10bae0);if(_0x3433aa[_0x3bee('0x30')][_0x3bee('0x3b')]){_0x564e45[_0x3bee('0x39')]=_[_0x3bee('0x3c')](_0x564e45[_0x3bee('0x39')],{'$or':_['map'](_0x10bae0,function(_0xaceed4){if(_0xaceed4[_0x3bee('0x3d')]!==_0x3bee('0x3e')){var _0x45cf81={};_0x45cf81[_0xaceed4[_0x3bee('0x2a')]]={'$like':'%'+_0x3433aa[_0x3bee('0x30')][_0x3bee('0x3b')]+'%'};return _0x45cf81;}})});}_0x564e45=_[_0x3bee('0x3c')]({},_0x564e45,_0x3433aa[_0x3bee('0x3f')]);var _0x12ba6f={'where':_0x564e45[_0x3bee('0x39')]};return db[_0x3bee('0x40')][_0x3bee('0x1c')](_0x12ba6f)['then'](function(_0x2b773d){_0x1e1529[_0x3bee('0x1c')]=_0x2b773d;if(_0x3433aa[_0x3bee('0x30')][_0x3bee('0x41')]){_0x564e45[_0x3bee('0x42')]=[{'all':!![]}];}return db[_0x3bee('0x40')][_0x3bee('0x43')](_0x564e45);})[_0x3bee('0x24')](function(_0x5d9e1b){_0x1e1529[_0x3bee('0x44')]=_0x5d9e1b;return _0x1e1529;})[_0x3bee('0x24')](respondWithFilteredResult(_0x559c2b,_0x564e45))[_0x3bee('0x45')](handleError(_0x559c2b,null));};exports['show']=function(_0x4567f2,_0x57113b){var _0x2b1677={'raw':!![],'where':{'id':_0x4567f2['params']['id']}},_0x48325e={};_0x48325e[_0x3bee('0x2f')]=_[_0x3bee('0x31')](db[_0x3bee('0x40')][_0x3bee('0x46')]);_0x48325e[_0x3bee('0x30')]=_['keys'](_0x4567f2['query']);_0x48325e[_0x3bee('0x32')]=_['intersection'](_0x48325e[_0x3bee('0x2f')],_0x48325e['query']);_0x2b1677[_0x3bee('0x35')]=_['intersection'](_0x48325e[_0x3bee('0x2f')],qs[_0x3bee('0x34')](_0x4567f2[_0x3bee('0x30')][_0x3bee('0x34')]));_0x2b1677['attributes']=_0x2b1677['attributes'][_0x3bee('0x36')]?_0x2b1677['attributes']:_0x48325e['model'];if(_0x4567f2['query'][_0x3bee('0x41')]){_0x2b1677['include']=[{'all':!![]}];}_0x2b1677=_[_0x3bee('0x3c')]({},_0x2b1677,_0x4567f2[_0x3bee('0x3f')]);return db[_0x3bee('0x40')]['find'](_0x2b1677)[_0x3bee('0x24')](handleEntityNotFound(_0x57113b,null))['then'](respondWithResult(_0x57113b,null))[_0x3bee('0x45')](handleError(_0x57113b,null));};exports['create']=function(_0x26ccd7,_0x16b096){return db[_0x3bee('0x40')]['create'](_0x26ccd7[_0x3bee('0x47')],{})[_0x3bee('0x24')](function(_0x477de2){var _0x504382=_0x26ccd7['user'][_0x3bee('0x26')]({'plain':!![]});if(!_0x504382)throw new Error(_0x3bee('0x48'));if(_0x504382[_0x3bee('0x49')]===_0x3bee('0x4a')){var _0x3b5d7a=_0x477de2[_0x3bee('0x26')]({'plain':!![]});var _0x4005a3='Voicemails';return db[_0x3bee('0x4b')][_0x3bee('0x4c')]({'where':{'name':_0x4005a3,'userProfileId':_0x504382['userProfileId']},'raw':!![]})['then'](function(_0x3730c5){if(_0x3730c5&&_0x3730c5['autoAssociation']===0x0){return db[_0x3bee('0x4d')][_0x3bee('0x4e')]({'name':_0x3b5d7a[_0x3bee('0x2a')],'resourceId':_0x3b5d7a['id'],'type':_0x3730c5['name'],'sectionId':_0x3730c5['id']},{})[_0x3bee('0x24')](function(){return _0x477de2;});}else{return _0x477de2;}})[_0x3bee('0x45')](function(_0x127cb8){logger['error'](_0x3bee('0x4f'),_0x127cb8);throw _0x127cb8;});}return _0x477de2;})[_0x3bee('0x24')](respondWithResult(_0x16b096,0xc9))['catch'](handleError(_0x16b096,null));};exports[_0x3bee('0x23')]=function(_0x14940e,_0x53c881){if(_0x14940e[_0x3bee('0x47')]['id']){delete _0x14940e[_0x3bee('0x47')]['id'];}return db[_0x3bee('0x40')][_0x3bee('0x4c')]({'where':{'id':_0x14940e[_0x3bee('0x50')]['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x53c881,null))[_0x3bee('0x24')](saveUpdates(_0x14940e[_0x3bee('0x47')],null))['then'](respondWithResult(_0x53c881,null))['catch'](handleError(_0x53c881,null));};exports[_0x3bee('0x25')]=function(_0x5e13e8,_0x38b82a){return db[_0x3bee('0x40')][_0x3bee('0x4c')]({'where':{'id':_0x5e13e8['params']['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x38b82a,null))[_0x3bee('0x24')](removeEntity(_0x38b82a,null))[_0x3bee('0x45')](handleError(_0x38b82a,null));};exports['getMessages']=function(_0x19cbb8,_0x52a327,_0x3cb900){return db[_0x3bee('0x40')][_0x3bee('0x51')]({'where':{'id':_0x19cbb8['params']['id']}})[_0x3bee('0x24')](handleEntityNotFound(_0x52a327,null))[_0x3bee('0x24')](function(_0x282300){var _0x526551;var _0x5d95a7={},_0xb9f53e={};_0xb9f53e[_0x3bee('0x2f')]=_[_0x3bee('0x31')](db['VoiceMailMessage']['rawAttributes']);_0xb9f53e[_0x3bee('0x30')]=_['keys'](_0x19cbb8['query']);_0xb9f53e[_0x3bee('0x32')]=_[_0x3bee('0x33')](_0xb9f53e[_0x3bee('0x2f')],_0xb9f53e['query']);_0x5d95a7['attributes']=_[_0x3bee('0x33')](_0xb9f53e[_0x3bee('0x2f')],qs['fields'](_0x19cbb8[_0x3bee('0x30')]['fields']));_0x5d95a7[_0x3bee('0x35')]=_0x5d95a7[_0x3bee('0x35')][_0x3bee('0x36')]?_0x5d95a7[_0x3bee('0x35')]:_0xb9f53e[_0x3bee('0x2f')];if(!_0x19cbb8[_0x3bee('0x30')][_0x3bee('0x37')](_0x3bee('0x52'))){_0x5d95a7[_0x3bee('0x1d')]=qs[_0x3bee('0x1d')](_0x19cbb8[_0x3bee('0x30')]['limit']);_0x5d95a7['offset']=qs['offset'](_0x19cbb8[_0x3bee('0x30')][_0x3bee('0x1a')]);}_0x5d95a7[_0x3bee('0x53')]=qs[_0x3bee('0x38')](_0x19cbb8['query'][_0x3bee('0x38')]);_0x5d95a7[_0x3bee('0x39')]=qs['filters'](_['pick'](_0x19cbb8[_0x3bee('0x30')],_0xb9f53e[_0x3bee('0x32')]));if(_0x19cbb8[_0x3bee('0x30')]['filter']){_0x5d95a7[_0x3bee('0x39')]=_[_0x3bee('0x3c')](_0x5d95a7[_0x3bee('0x39')],{'$or':_['map'](_0x5d95a7[_0x3bee('0x35')],function(_0x412e0d){var _0x1bfb3a={};_0x1bfb3a[_0x412e0d]={'$like':'%'+_0x19cbb8[_0x3bee('0x30')]['filter']+'%'};return _0x1bfb3a;})});}_0x5d95a7['where']=_[_0x3bee('0x3c')](_0x5d95a7[_0x3bee('0x39')],{'mailboxuser':_0x282300[_0x3bee('0x54')]});_0x5d95a7=_[_0x3bee('0x3c')]({},_0x5d95a7,_0x19cbb8[_0x3bee('0x3f')]);return db['VoiceMailMessage'][_0x3bee('0x55')](_0x5d95a7)['then'](respondWithFilteredResult(_0x52a327,_0x5d95a7));})[_0x3bee('0x45')](handleError(_0x52a327,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index ea60d4c..5cbba46 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 _0xb93b=['request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x29ea7b,_0x26a8f9){var _0x12fdfb=function(_0x2444ef){while(--_0x2444ef){_0x29ea7b['push'](_0x29ea7b['shift']());}};_0x12fdfb(++_0x26a8f9);}(_0xb93b,0x1ca));var _0xbb93=function(_0x17a842,_0x1ac67a){_0x17a842=_0x17a842-0x0;var _0x142199=_0xb93b[_0x17a842];return _0x142199;};'use strict';var _=require(_0xbb93('0x0'));var util=require(_0xbb93('0x1'));var logger=require(_0xbb93('0x2'))(_0xbb93('0x3'));var moment=require(_0xbb93('0x4'));var BPromise=require(_0xbb93('0x5'));var rp=require(_0xbb93('0x6'));var fs=require('fs');var path=require(_0xbb93('0x7'));var rimraf=require(_0xbb93('0x8'));var config=require(_0xbb93('0x9'));var attributes=require(_0xbb93('0xa'));module[_0xbb93('0xb')]=function(_0x180da8,_0x3209a6){return _0x180da8['define'](_0xbb93('0xc'),attributes,{'tableName':_0xbb93('0xd'),'paranoid':![],'indexes':[{'name':_0xbb93('0xe'),'fields':['mailbox',_0xbb93('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcc6a=['mailbox','context','util','api','moment','bluebird','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','mailbox_context'];(function(_0x4ce35c,_0x1cf5cd){var _0x554eaa=function(_0xc1ff26){while(--_0xc1ff26){_0x4ce35c['push'](_0x4ce35c['shift']());}};_0x554eaa(++_0x1cf5cd);}(_0xcc6a,0xfe));var _0xacc6=function(_0x691d42,_0x5b25d3){_0x691d42=_0x691d42-0x0;var _0x2fdccf=_0xcc6a[_0x691d42];return _0x2fdccf;};'use strict';var _=require('lodash');var util=require(_0xacc6('0x0'));var logger=require('../../config/logger')(_0xacc6('0x1'));var moment=require(_0xacc6('0x2'));var BPromise=require(_0xacc6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xacc6('0x4'));var config=require(_0xacc6('0x5'));var attributes=require(_0xacc6('0x6'));module[_0xacc6('0x7')]=function(_0x19842e,_0x5d83fd){return _0x19842e['define'](_0xacc6('0x8'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xacc6('0x9'),'fields':[_0xacc6('0xa'),_0xacc6('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 b423454..8257131 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 _0x341f=['http','request','info','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','code','error','message','VoiceMail,\x20%s,\x20%s','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x29529e,_0x4694c1){var _0x123203=function(_0x160669){while(--_0x160669){_0x29529e['push'](_0x29529e['shift']());}};_0x123203(++_0x4694c1);}(_0x341f,0x1d4));var _0xf341=function(_0x2bc6aa,_0x58bbcb){_0x2bc6aa=_0x2bc6aa-0x0;var _0x2145ea=_0x341f[_0x2bc6aa];return _0x2145ea;};'use strict';var _=require(_0xf341('0x0'));var util=require(_0xf341('0x1'));var moment=require(_0xf341('0x2'));var BPromise=require(_0xf341('0x3'));var rs=require(_0xf341('0x4'));var fs=require('fs');var Redis=require(_0xf341('0x5'));var db=require(_0xf341('0x6'))['db'];var utils=require(_0xf341('0x7'));var logger=require(_0xf341('0x8'))(_0xf341('0x9'));var config=require(_0xf341('0xa'));var jayson=require(_0xf341('0xb'));var client=jayson['client'][_0xf341('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53b07d,_0x52c381,_0x5a2f59){return new BPromise(function(_0x5a940f,_0x1458e5){return client[_0xf341('0xd')](_0x53b07d,_0x5a2f59)['then'](function(_0x1e2ec7){logger[_0xf341('0xe')]('VoiceMail,\x20%s,\x20%s',_0x52c381,'request\x20sent');logger['debug'](_0xf341('0xf'),_0x52c381,'request\x20sent',JSON[_0xf341('0x10')](_0x1e2ec7));if(_0x1e2ec7['error']){if(_0x1e2ec7['error'][_0xf341('0x11')]===0x1f4){logger[_0xf341('0x12')]('VoiceMail,\x20%s,\x20%s',_0x52c381,_0x1e2ec7[_0xf341('0x12')]['message']);return _0x1458e5(_0x1e2ec7[_0xf341('0x12')]['message']);}logger[_0xf341('0x12')]('VoiceMail,\x20%s,\x20%s',_0x52c381,_0x1e2ec7[_0xf341('0x12')][_0xf341('0x13')]);return _0x5a940f(_0x1e2ec7[_0xf341('0x12')][_0xf341('0x13')]);}else{logger[_0xf341('0xe')](_0xf341('0x14'),_0x52c381,_0xf341('0x15'));_0x5a940f(_0x1e2ec7[_0xf341('0x16')][_0xf341('0x13')]);}})[_0xf341('0x17')](function(_0x55d2ef){logger[_0xf341('0x12')](_0xf341('0x14'),_0x52c381,_0x55d2ef);_0x1458e5(_0x55d2ef);});});} \ No newline at end of file +var _0xa1dc=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xa1dc,0x163));var _0xca1d=function(_0x42ac88,_0x369d9b){_0x42ac88=_0x42ac88-0x0;var _0x123993=_0xa1dc[_0x42ac88];return _0x123993;};'use strict';var _=require(_0xca1d('0x0'));var util=require('util');var moment=require(_0xca1d('0x1'));var BPromise=require(_0xca1d('0x2'));var rs=require(_0xca1d('0x3'));var fs=require('fs');var Redis=require(_0xca1d('0x4'));var db=require(_0xca1d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xca1d('0x6'));var config=require(_0xca1d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xca1d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x74b8d7,_0x43dac1,_0x3c3eda){return new BPromise(function(_0x5ceec0,_0x10c63f){return client[_0xca1d('0x9')](_0x74b8d7,_0x3c3eda)['then'](function(_0x59c6a7){logger[_0xca1d('0xa')]('VoiceMail,\x20%s,\x20%s',_0x43dac1,'request\x20sent');logger[_0xca1d('0xb')](_0xca1d('0xc'),_0x43dac1,_0xca1d('0xd'),JSON[_0xca1d('0xe')](_0x59c6a7));if(_0x59c6a7['error']){if(_0x59c6a7[_0xca1d('0xf')][_0xca1d('0x10')]===0x1f4){logger[_0xca1d('0xf')](_0xca1d('0x11'),_0x43dac1,_0x59c6a7[_0xca1d('0xf')][_0xca1d('0x12')]);return _0x10c63f(_0x59c6a7[_0xca1d('0xf')][_0xca1d('0x12')]);}logger[_0xca1d('0xf')](_0xca1d('0x11'),_0x43dac1,_0x59c6a7[_0xca1d('0xf')]['message']);return _0x5ceec0(_0x59c6a7[_0xca1d('0xf')][_0xca1d('0x12')]);}else{logger[_0xca1d('0xa')](_0xca1d('0x11'),_0x43dac1,_0xca1d('0xd'));_0x5ceec0(_0x59c6a7[_0xca1d('0x13')][_0xca1d('0x12')]);}})[_0xca1d('0x14')](function(_0x5c0046){logger['error'](_0xca1d('0x11'),_0x43dac1,_0x5c0046);_0x10c63f(_0x5c0046);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 02b30d0..ebe35cb 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 _0x47b9=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','show','post','put','/:id','delete','destroy','exports','multer','util'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x47b9,0x1c9));var _0x947b=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0x47b9[_0x29ae80];return _0x5d6d71;};'use strict';var multer=require(_0x947b('0x0'));var util=require(_0x947b('0x1'));var path=require('path');var timeout=require(_0x947b('0x2'));var express=require('express');var router=express[_0x947b('0x3')]();var fs_extra=require(_0x947b('0x4'));var auth=require(_0x947b('0x5'));var interaction=require(_0x947b('0x6'));var config=require('../../config/environment');var controller=require(_0x947b('0x7'));router[_0x947b('0x8')]('/',auth[_0x947b('0x9')](),controller['index']);router[_0x947b('0x8')]('/:id',auth[_0x947b('0x9')](),controller[_0x947b('0xa')]);router[_0x947b('0x8')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x947b('0xb')]('/',auth[_0x947b('0x9')](),controller['create']);router[_0x947b('0xc')](_0x947b('0xd'),auth[_0x947b('0x9')](),controller['update']);router[_0x947b('0xe')]('/:id',auth[_0x947b('0x9')](),controller[_0x947b('0xf')]);module[_0x947b('0x10')]=router; \ No newline at end of file +var _0xafbd=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x492e32,_0x2e0a93){var _0x4a335e=function(_0x1f4998){while(--_0x1f4998){_0x492e32['push'](_0x492e32['shift']());}};_0x4a335e(++_0x2e0a93);}(_0xafbd,0x1a0));var _0xdafb=function(_0x47242d,_0x13f993){_0x47242d=_0x47242d-0x0;var _0x30273a=_0xafbd[_0x47242d];return _0x30273a;};'use strict';var multer=require(_0xdafb('0x0'));var util=require('util');var path=require(_0xdafb('0x1'));var timeout=require('connect-timeout');var express=require(_0xdafb('0x2'));var router=express[_0xdafb('0x3')]();var fs_extra=require(_0xdafb('0x4'));var auth=require(_0xdafb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdafb('0x6'));var controller=require('./voiceMailMessage.controller');router[_0xdafb('0x7')]('/',auth[_0xdafb('0x8')](),controller[_0xdafb('0x9')]);router['get'](_0xdafb('0xa'),auth[_0xdafb('0x8')](),controller[_0xdafb('0xb')]);router[_0xdafb('0x7')](_0xdafb('0xc'),auth['isAuthenticated'](),controller[_0xdafb('0xd')]);router[_0xdafb('0xe')]('/',auth[_0xdafb('0x8')](),controller[_0xdafb('0xf')]);router[_0xdafb('0x10')](_0xdafb('0xa'),auth['isAuthenticated'](),controller[_0xdafb('0x11')]);router[_0xdafb('0x12')](_0xdafb('0xa'),auth[_0xdafb('0x8')](),controller[_0xdafb('0x13')]);module[_0xdafb('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 32a3578..465eb86 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 _0x8b37=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB'];(function(_0x29a580,_0xc0cfbb){var _0x196b8c=function(_0x4bc581){while(--_0x4bc581){_0x29a580['push'](_0x29a580['shift']());}};_0x196b8c(++_0xc0cfbb);}(_0x8b37,0x12d));var _0x78b3=function(_0x1c324d,_0x2daa7c){_0x1c324d=_0x1c324d-0x0;var _0x33347f=_0x8b37[_0x1c324d];return _0x33347f;};'use strict';var Sequelize=require(_0x78b3('0x0'));module[_0x78b3('0x1')]={'name':{'type':Sequelize[_0x78b3('0x2')],'get':function(_0x62ca7d){return this[_0x78b3('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x78b3('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x78b3('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x78b3('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x78b3('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x78b3('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x78b3('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x78b3('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x78b3('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x78b3('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x78b3('0x6')](_0x78b3('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x78b3('0x5')],'defaultValue':''},'stamp':{'type':_0x78b3('0x8'),'defaultValue':Sequelize[_0x78b3('0x9')](_0x78b3('0xa'))}}; \ No newline at end of file +var _0xe556=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','literal'];(function(_0x30c634,_0x405ef1){var _0x1ff1d6=function(_0x104700){while(--_0x104700){_0x30c634['push'](_0x30c634['shift']());}};_0x1ff1d6(++_0x405ef1);}(_0xe556,0xc9));var _0x6e55=function(_0x59c774,_0x42109c){_0x59c774=_0x59c774-0x0;var _0x19b8a1=_0xe556[_0x59c774];return _0x19b8a1;};'use strict';var Sequelize=require(_0x6e55('0x0'));module['exports']={'name':{'type':Sequelize[_0x6e55('0x1')],'get':function(_0x3715ce){return this[_0x6e55('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x6e55('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x6e55('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x6e55('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x6e55('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x6e55('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x6e55('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x6e55('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x6e55('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x6e55('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x6e55('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x6e55('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x6e55('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x6e55('0x6')](_0x6e55('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 0b537bf..6b9f227 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 _0xeb62=['request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','VoiceMailMessage','include','options','find','create','body','download','recording','Sequelize','ValidationError','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0xeb62,0x107));var _0x2eb6=function(_0x16b896,_0x4f2600){_0x16b896=_0x16b896-0x0;var _0x1a811b=_0xeb62[_0x16b896];return _0x1a811b;};'use strict';var emlformat=require(_0x2eb6('0x0'));var rimraf=require(_0x2eb6('0x1'));var zipdir=require(_0x2eb6('0x2'));var jsonpatch=require(_0x2eb6('0x3'));var rp=require(_0x2eb6('0x4'));var moment=require(_0x2eb6('0x5'));var BPromise=require(_0x2eb6('0x6'));var Mustache=require('mustache');var util=require(_0x2eb6('0x7'));var path=require('path');var sox=require(_0x2eb6('0x8'));var csv=require(_0x2eb6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2eb6('0xa'));var _=require('lodash');var squel=require(_0x2eb6('0xb'));var crypto=require(_0x2eb6('0xc'));var jsforce=require(_0x2eb6('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2eb6('0xe'));var Papa=require(_0x2eb6('0xf'));var Redis=require(_0x2eb6('0x10'));var authService=require(_0x2eb6('0x11'));var qs=require(_0x2eb6('0x12'));var as=require(_0x2eb6('0x13'));var hardwareService=require(_0x2eb6('0x14'));var logger=require('../../config/logger')(_0x2eb6('0x15'));var utils=require('../../config/utils');var config=require(_0x2eb6('0x16'));var licenseUtil=require(_0x2eb6('0x17'));var db=require(_0x2eb6('0x18'))['db'];function respondWithStatusCode(_0x5da00d,_0x19ae23){_0x19ae23=_0x19ae23||0xcc;return function(_0x505d07){if(_0x505d07){return _0x5da00d[_0x2eb6('0x19')](_0x19ae23);}return _0x5da00d[_0x2eb6('0x1a')](_0x19ae23)[_0x2eb6('0x1b')]();};}function respondWithResult(_0x3c0b02,_0x2db137){_0x2db137=_0x2db137||0xc8;return function(_0xd07cab){if(_0xd07cab){return _0x3c0b02['status'](_0x2db137)['json'](_0xd07cab);}};}function respondWithFilteredResult(_0x5a9ff3,_0x475c12){return function(_0xed87e5){if(_0xed87e5){var _0x3b850f=typeof _0x475c12[_0x2eb6('0x1c')]===_0x2eb6('0x1d')&&typeof _0x475c12['limit']===_0x2eb6('0x1d');var _0x4e818f=_0xed87e5['count'];var _0x3ce44e=_0x3b850f?0x0:_0x475c12[_0x2eb6('0x1c')];var _0x1e70df=_0x3b850f?_0xed87e5[_0x2eb6('0x1e')]:_0x475c12[_0x2eb6('0x1c')]+_0x475c12[_0x2eb6('0x1f')];var _0x5ddfcc;if(_0x1e70df>=_0x4e818f){_0x1e70df=_0x4e818f;_0x5ddfcc=0xc8;}else{_0x5ddfcc=0xce;}_0x5a9ff3['status'](_0x5ddfcc);return _0x5a9ff3[_0x2eb6('0x20')](_0x2eb6('0x21'),_0x3ce44e+'-'+_0x1e70df+'/'+_0x4e818f)[_0x2eb6('0x22')](_0xed87e5);}return null;};}function patchUpdates(_0x1ec1c8){return function(_0x4697f0){try{jsonpatch[_0x2eb6('0x23')](_0x4697f0,_0x1ec1c8,!![]);}catch(_0x332505){return BPromise[_0x2eb6('0x24')](_0x332505);}return _0x4697f0[_0x2eb6('0x25')]();};}function saveUpdates(_0x449320,_0x5890f9){return function(_0x52a8ef){if(_0x52a8ef){return _0x52a8ef[_0x2eb6('0x26')](_0x449320)[_0x2eb6('0x27')](function(_0x55c5a9){return _0x55c5a9;});}return null;};}function removeEntity(_0x261167,_0x44466c){return function(_0xcbcf8b){if(_0xcbcf8b){return _0xcbcf8b[_0x2eb6('0x28')]()[_0x2eb6('0x27')](function(){_0x261167[_0x2eb6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39e7fd,_0xe3a67c){return function(_0x25f237){if(!_0x25f237){_0x39e7fd['sendStatus'](0x194);}return _0x25f237;};}function handleError(_0x259cf0,_0x7af804){_0x7af804=_0x7af804||0x1f4;return function(_0xc7df43){logger[_0x2eb6('0x29')](_0xc7df43[_0x2eb6('0x2a')]);if(_0xc7df43['name']){delete _0xc7df43[_0x2eb6('0x2b')];}_0x259cf0[_0x2eb6('0x1a')](_0x7af804)[_0x2eb6('0x2c')](_0xc7df43);};}exports['index']=function(_0x205da9,_0x33906a){var _0x2303e0={},_0x221139={},_0x4e8e47={'count':0x0,'rows':[]};var _0xc03a9c=_[_0x2eb6('0x2d')](db['VoiceMailMessage'][_0x2eb6('0x2e')],function(_0x5f25d3){return{'name':_0x5f25d3[_0x2eb6('0x2f')],'type':_0x5f25d3[_0x2eb6('0x30')][_0x2eb6('0x31')]};});_0x221139[_0x2eb6('0x32')]=_[_0x2eb6('0x33')](_[_0x2eb6('0x2d')](_0xc03a9c,_0x2eb6('0x2b')),[_0x2eb6('0x2b')]);_0x221139[_0x2eb6('0x34')]=_[_0x2eb6('0x35')](_0x205da9[_0x2eb6('0x34')]);_0x221139['filters']=_[_0x2eb6('0x36')](_0x221139[_0x2eb6('0x32')],_0x221139[_0x2eb6('0x34')]);_0x2303e0[_0x2eb6('0x37')]=_[_0x2eb6('0x36')](_0x221139[_0x2eb6('0x32')],qs[_0x2eb6('0x38')](_0x205da9[_0x2eb6('0x34')][_0x2eb6('0x38')]));_0x2303e0[_0x2eb6('0x37')]=_0x2303e0['attributes'][_0x2eb6('0x39')]?_0x2303e0['attributes']:_0x221139[_0x2eb6('0x32')];if(!_0x205da9['query'][_0x2eb6('0x3a')](_0x2eb6('0x3b'))){_0x2303e0[_0x2eb6('0x1f')]=qs[_0x2eb6('0x1f')](_0x205da9[_0x2eb6('0x34')][_0x2eb6('0x1f')]);_0x2303e0[_0x2eb6('0x1c')]=qs[_0x2eb6('0x1c')](_0x205da9[_0x2eb6('0x34')][_0x2eb6('0x1c')]);}_0x2303e0['order']=qs['sort'](_0x205da9['query'][_0x2eb6('0x3c')]);_0x2303e0['where']=qs[_0x2eb6('0x3d')](_[_0x2eb6('0x3e')](_0x205da9[_0x2eb6('0x34')],_0x221139[_0x2eb6('0x3d')]),_0xc03a9c);if(_0x205da9['query'][_0x2eb6('0x3f')]){_0x2303e0[_0x2eb6('0x40')]=_[_0x2eb6('0x41')](_0x2303e0['where'],{'$or':_[_0x2eb6('0x2d')](_0xc03a9c,function(_0x4e293c){if(_0x4e293c[_0x2eb6('0x30')]!==_0x2eb6('0x42')){var _0x787bfd={};_0x787bfd[_0x4e293c[_0x2eb6('0x2b')]]={'$like':'%'+_0x205da9['query'][_0x2eb6('0x3f')]+'%'};return _0x787bfd;}})});}_0x2303e0=_['merge']({},_0x2303e0,_0x205da9['options']);var _0xe9f4df={'where':_0x2303e0[_0x2eb6('0x40')]};return db['VoiceMailMessage']['count'](_0xe9f4df)['then'](function(_0x1d60e0){_0x4e8e47['count']=_0x1d60e0;if(_0x205da9[_0x2eb6('0x34')][_0x2eb6('0x43')]){_0x2303e0['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0x2eb6('0x44')](_0x2303e0);})[_0x2eb6('0x27')](function(_0x391301){_0x4e8e47[_0x2eb6('0x45')]=_0x391301;return _0x4e8e47;})[_0x2eb6('0x27')](respondWithFilteredResult(_0x33906a,_0x2303e0))[_0x2eb6('0x46')](handleError(_0x33906a,null));};exports[_0x2eb6('0x47')]=function(_0x466df3,_0x4505be){var _0x2fa51a={'raw':!![],'where':{'id':_0x466df3[_0x2eb6('0x48')]['id']}},_0x44319d={};_0x44319d[_0x2eb6('0x32')]=_[_0x2eb6('0x35')](db[_0x2eb6('0x49')][_0x2eb6('0x2e')]);_0x44319d[_0x2eb6('0x34')]=_[_0x2eb6('0x35')](_0x466df3[_0x2eb6('0x34')]);_0x44319d[_0x2eb6('0x3d')]=_[_0x2eb6('0x36')](_0x44319d[_0x2eb6('0x32')],_0x44319d['query']);_0x2fa51a[_0x2eb6('0x37')]=_[_0x2eb6('0x36')](_0x44319d[_0x2eb6('0x32')],qs['fields'](_0x466df3[_0x2eb6('0x34')][_0x2eb6('0x38')]));_0x2fa51a['attributes']=_0x2fa51a[_0x2eb6('0x37')][_0x2eb6('0x39')]?_0x2fa51a[_0x2eb6('0x37')]:_0x44319d[_0x2eb6('0x32')];if(_0x466df3[_0x2eb6('0x34')][_0x2eb6('0x43')]){_0x2fa51a[_0x2eb6('0x4a')]=[{'all':!![]}];}_0x2fa51a=_[_0x2eb6('0x41')]({},_0x2fa51a,_0x466df3[_0x2eb6('0x4b')]);return db[_0x2eb6('0x49')][_0x2eb6('0x4c')](_0x2fa51a)[_0x2eb6('0x27')](handleEntityNotFound(_0x4505be,null))[_0x2eb6('0x27')](respondWithResult(_0x4505be,null))[_0x2eb6('0x46')](handleError(_0x4505be,null));};exports[_0x2eb6('0x4d')]=function(_0x3ee5e1,_0x4b80b2){return db[_0x2eb6('0x49')][_0x2eb6('0x4d')](_0x3ee5e1[_0x2eb6('0x4e')],{})[_0x2eb6('0x27')](respondWithResult(_0x4b80b2,0xc9))[_0x2eb6('0x46')](handleError(_0x4b80b2,null));};exports[_0x2eb6('0x26')]=function(_0x46bc1c,_0x4bfc2a){if(_0x46bc1c[_0x2eb6('0x4e')]['id']){delete _0x46bc1c[_0x2eb6('0x4e')]['id'];}return db['VoiceMailMessage'][_0x2eb6('0x4c')]({'where':{'id':_0x46bc1c['params']['id']}})['then'](handleEntityNotFound(_0x4bfc2a,null))['then'](saveUpdates(_0x46bc1c[_0x2eb6('0x4e')],null))[_0x2eb6('0x27')](respondWithResult(_0x4bfc2a,null))[_0x2eb6('0x46')](handleError(_0x4bfc2a,null));};exports[_0x2eb6('0x28')]=function(_0x398ffe,_0x12305e){return db[_0x2eb6('0x49')][_0x2eb6('0x4c')]({'where':{'id':_0x398ffe[_0x2eb6('0x48')]['id']}})[_0x2eb6('0x27')](handleEntityNotFound(_0x12305e,null))[_0x2eb6('0x27')](removeEntity(_0x12305e,null))[_0x2eb6('0x46')](handleError(_0x12305e,null));};exports[_0x2eb6('0x4f')]=function(_0xa5d072,_0x4d9adb,_0x40e3bd){return db[_0x2eb6('0x49')]['find']({'where':{'id':_0xa5d072[_0x2eb6('0x48')]['id']},'attributes':['id',_0x2eb6('0x50'),'msg_id']})['then'](handleEntityNotFound(_0x4d9adb,null))[_0x2eb6('0x27')](function(_0x317464){if(_0x317464){if(!_0x317464['recording']){throw new db[(_0x2eb6('0x51'))][(_0x2eb6('0x52'))]('VoiceMailMessage\x20not\x20found');}var _0x7ce598={'Content-Type':_0x2eb6('0x53'),'Content-Disposition':_0x2eb6('0x54')};if(_0x317464[_0x2eb6('0x55')]){_0x7ce598[_0x2eb6('0x56')]=_0x2eb6('0x57')+_0x317464[_0x2eb6('0x55')]+_0x2eb6('0x58');}_0x4d9adb[_0x2eb6('0x20')](_0x7ce598);return _0x4d9adb['send'](new Buffer(_0x317464[_0x2eb6('0x50')]));}})['catch'](handleError(_0x4d9adb,null));}; \ No newline at end of file +var _0xa418=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMailMessage','includeAll','findAll','catch','show','include','find','create','body','params','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','desk.js','papaparse','ioredis'];(function(_0x11ce54,_0x11837b){var _0x1b0229=function(_0x143aed){while(--_0x143aed){_0x11ce54['push'](_0x11ce54['shift']());}};_0x1b0229(++_0x11837b);}(_0xa418,0xf2));var _0x8a41=function(_0x2c1289,_0x2de3dd){_0x2c1289=_0x2c1289-0x0;var _0x49a3a5=_0xa418[_0x2c1289];return _0x49a3a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a41('0x0'));var zipdir=require(_0x8a41('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a41('0x2'));var moment=require('moment');var BPromise=require(_0x8a41('0x3'));var Mustache=require('mustache');var util=require(_0x8a41('0x4'));var path=require(_0x8a41('0x5'));var sox=require(_0x8a41('0x6'));var csv=require(_0x8a41('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a41('0x8'));var _=require('lodash');var squel=require(_0x8a41('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8a41('0xa'));var toCsv=require(_0x8a41('0x7'));var querystring=require('querystring');var Papa=require(_0x8a41('0xb'));var Redis=require(_0x8a41('0xc'));var authService=require(_0x8a41('0xd'));var qs=require(_0x8a41('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a41('0xf'));var logger=require(_0x8a41('0x10'))(_0x8a41('0x11'));var utils=require(_0x8a41('0x12'));var config=require(_0x8a41('0x13'));var licenseUtil=require(_0x8a41('0x14'));var db=require(_0x8a41('0x15'))['db'];function respondWithStatusCode(_0x328e2e,_0x5f2965){_0x5f2965=_0x5f2965||0xcc;return function(_0x35e522){if(_0x35e522){return _0x328e2e[_0x8a41('0x16')](_0x5f2965);}return _0x328e2e[_0x8a41('0x17')](_0x5f2965)[_0x8a41('0x18')]();};}function respondWithResult(_0x516db6,_0x15dae9){_0x15dae9=_0x15dae9||0xc8;return function(_0x4cce45){if(_0x4cce45){return _0x516db6[_0x8a41('0x17')](_0x15dae9)[_0x8a41('0x19')](_0x4cce45);}};}function respondWithFilteredResult(_0xec500f,_0x4555e9){return function(_0x144cfb){if(_0x144cfb){var _0x2cb9b6=typeof _0x4555e9[_0x8a41('0x1a')]===_0x8a41('0x1b')&&typeof _0x4555e9[_0x8a41('0x1c')]===_0x8a41('0x1b');var _0x24e2de=_0x144cfb[_0x8a41('0x1d')];var _0xa43f9b=_0x2cb9b6?0x0:_0x4555e9[_0x8a41('0x1a')];var _0x346ae2=_0x2cb9b6?_0x144cfb[_0x8a41('0x1d')]:_0x4555e9[_0x8a41('0x1a')]+_0x4555e9[_0x8a41('0x1c')];var _0x25a9a9;if(_0x346ae2>=_0x24e2de){_0x346ae2=_0x24e2de;_0x25a9a9=0xc8;}else{_0x25a9a9=0xce;}_0xec500f[_0x8a41('0x17')](_0x25a9a9);return _0xec500f[_0x8a41('0x1e')](_0x8a41('0x1f'),_0xa43f9b+'-'+_0x346ae2+'/'+_0x24e2de)[_0x8a41('0x19')](_0x144cfb);}return null;};}function patchUpdates(_0x1e1e22){return function(_0x3f15d7){try{jsonpatch['apply'](_0x3f15d7,_0x1e1e22,!![]);}catch(_0x138102){return BPromise[_0x8a41('0x20')](_0x138102);}return _0x3f15d7[_0x8a41('0x21')]();};}function saveUpdates(_0xe61cc1,_0x336d24){return function(_0x5ecd1a){if(_0x5ecd1a){return _0x5ecd1a[_0x8a41('0x22')](_0xe61cc1)['then'](function(_0xeb7013){return _0xeb7013;});}return null;};}function removeEntity(_0x113663,_0x55e8fb){return function(_0x45d30d){if(_0x45d30d){return _0x45d30d[_0x8a41('0x23')]()[_0x8a41('0x24')](function(){_0x113663[_0x8a41('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c4074,_0x986c2d){return function(_0x3b9f2b){if(!_0x3b9f2b){_0x1c4074['sendStatus'](0x194);}return _0x3b9f2b;};}function handleError(_0x4dc547,_0x114b00){_0x114b00=_0x114b00||0x1f4;return function(_0x365d86){logger[_0x8a41('0x25')](_0x365d86[_0x8a41('0x26')]);if(_0x365d86[_0x8a41('0x27')]){delete _0x365d86['name'];}_0x4dc547['status'](_0x114b00)[_0x8a41('0x28')](_0x365d86);};}exports[_0x8a41('0x29')]=function(_0x3fa646,_0x200c0c){var _0x390c0d={},_0xa1bcc3={},_0x45f759={'count':0x0,'rows':[]};var _0xa6ffa1=_[_0x8a41('0x2a')](db['VoiceMailMessage'][_0x8a41('0x2b')],function(_0x45ed9f){return{'name':_0x45ed9f[_0x8a41('0x2c')],'type':_0x45ed9f[_0x8a41('0x2d')][_0x8a41('0x2e')]};});_0xa1bcc3[_0x8a41('0x2f')]=_['differenceBy'](_['map'](_0xa6ffa1,'name'),[_0x8a41('0x27')]);_0xa1bcc3[_0x8a41('0x30')]=_[_0x8a41('0x31')](_0x3fa646[_0x8a41('0x30')]);_0xa1bcc3[_0x8a41('0x32')]=_['intersection'](_0xa1bcc3[_0x8a41('0x2f')],_0xa1bcc3[_0x8a41('0x30')]);_0x390c0d[_0x8a41('0x33')]=_[_0x8a41('0x34')](_0xa1bcc3[_0x8a41('0x2f')],qs['fields'](_0x3fa646[_0x8a41('0x30')][_0x8a41('0x35')]));_0x390c0d[_0x8a41('0x33')]=_0x390c0d[_0x8a41('0x33')][_0x8a41('0x36')]?_0x390c0d[_0x8a41('0x33')]:_0xa1bcc3[_0x8a41('0x2f')];if(!_0x3fa646['query'][_0x8a41('0x37')](_0x8a41('0x38'))){_0x390c0d['limit']=qs['limit'](_0x3fa646[_0x8a41('0x30')][_0x8a41('0x1c')]);_0x390c0d['offset']=qs[_0x8a41('0x1a')](_0x3fa646[_0x8a41('0x30')][_0x8a41('0x1a')]);}_0x390c0d[_0x8a41('0x39')]=qs[_0x8a41('0x3a')](_0x3fa646['query'][_0x8a41('0x3a')]);_0x390c0d[_0x8a41('0x3b')]=qs['filters'](_[_0x8a41('0x3c')](_0x3fa646[_0x8a41('0x30')],_0xa1bcc3[_0x8a41('0x32')]),_0xa6ffa1);if(_0x3fa646['query'][_0x8a41('0x3d')]){_0x390c0d[_0x8a41('0x3b')]=_[_0x8a41('0x3e')](_0x390c0d[_0x8a41('0x3b')],{'$or':_[_0x8a41('0x2a')](_0xa6ffa1,function(_0x5c92e3){if(_0x5c92e3[_0x8a41('0x2d')]!==_0x8a41('0x3f')){var _0x36e63d={};_0x36e63d[_0x5c92e3[_0x8a41('0x27')]]={'$like':'%'+_0x3fa646[_0x8a41('0x30')][_0x8a41('0x3d')]+'%'};return _0x36e63d;}})});}_0x390c0d=_[_0x8a41('0x3e')]({},_0x390c0d,_0x3fa646[_0x8a41('0x40')]);var _0x21b9e6={'where':_0x390c0d[_0x8a41('0x3b')]};return db[_0x8a41('0x41')]['count'](_0x21b9e6)[_0x8a41('0x24')](function(_0x1d8107){_0x45f759[_0x8a41('0x1d')]=_0x1d8107;if(_0x3fa646[_0x8a41('0x30')][_0x8a41('0x42')]){_0x390c0d['include']=[{'all':!![]}];}return db[_0x8a41('0x41')][_0x8a41('0x43')](_0x390c0d);})[_0x8a41('0x24')](function(_0x429c84){_0x45f759['rows']=_0x429c84;return _0x45f759;})['then'](respondWithFilteredResult(_0x200c0c,_0x390c0d))[_0x8a41('0x44')](handleError(_0x200c0c,null));};exports[_0x8a41('0x45')]=function(_0x1f842b,_0x5a760c){var _0x446089={'raw':!![],'where':{'id':_0x1f842b['params']['id']}},_0x3cd196={};_0x3cd196['model']=_['keys'](db[_0x8a41('0x41')][_0x8a41('0x2b')]);_0x3cd196['query']=_[_0x8a41('0x31')](_0x1f842b[_0x8a41('0x30')]);_0x3cd196['filters']=_[_0x8a41('0x34')](_0x3cd196[_0x8a41('0x2f')],_0x3cd196[_0x8a41('0x30')]);_0x446089[_0x8a41('0x33')]=_[_0x8a41('0x34')](_0x3cd196[_0x8a41('0x2f')],qs[_0x8a41('0x35')](_0x1f842b['query'][_0x8a41('0x35')]));_0x446089['attributes']=_0x446089[_0x8a41('0x33')][_0x8a41('0x36')]?_0x446089['attributes']:_0x3cd196[_0x8a41('0x2f')];if(_0x1f842b[_0x8a41('0x30')][_0x8a41('0x42')]){_0x446089[_0x8a41('0x46')]=[{'all':!![]}];}_0x446089=_[_0x8a41('0x3e')]({},_0x446089,_0x1f842b[_0x8a41('0x40')]);return db[_0x8a41('0x41')][_0x8a41('0x47')](_0x446089)['then'](handleEntityNotFound(_0x5a760c,null))[_0x8a41('0x24')](respondWithResult(_0x5a760c,null))['catch'](handleError(_0x5a760c,null));};exports[_0x8a41('0x48')]=function(_0x564553,_0x29161e){return db['VoiceMailMessage'][_0x8a41('0x48')](_0x564553[_0x8a41('0x49')],{})[_0x8a41('0x24')](respondWithResult(_0x29161e,0xc9))[_0x8a41('0x44')](handleError(_0x29161e,null));};exports[_0x8a41('0x22')]=function(_0x574e1d,_0x409f6d){if(_0x574e1d[_0x8a41('0x49')]['id']){delete _0x574e1d[_0x8a41('0x49')]['id'];}return db[_0x8a41('0x41')]['find']({'where':{'id':_0x574e1d[_0x8a41('0x4a')]['id']}})['then'](handleEntityNotFound(_0x409f6d,null))[_0x8a41('0x24')](saveUpdates(_0x574e1d['body'],null))[_0x8a41('0x24')](respondWithResult(_0x409f6d,null))['catch'](handleError(_0x409f6d,null));};exports[_0x8a41('0x23')]=function(_0x5ed386,_0x3fd6f2){return db[_0x8a41('0x41')][_0x8a41('0x47')]({'where':{'id':_0x5ed386[_0x8a41('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3fd6f2,null))[_0x8a41('0x24')](removeEntity(_0x3fd6f2,null))[_0x8a41('0x44')](handleError(_0x3fd6f2,null));};exports[_0x8a41('0x4b')]=function(_0x5654fb,_0x3921d8,_0x16246e){return db[_0x8a41('0x41')][_0x8a41('0x47')]({'where':{'id':_0x5654fb[_0x8a41('0x4a')]['id']},'attributes':['id',_0x8a41('0x4c'),_0x8a41('0x4d')]})['then'](handleEntityNotFound(_0x3921d8,null))[_0x8a41('0x24')](function(_0x50e795){if(_0x50e795){if(!_0x50e795[_0x8a41('0x4c')]){throw new db[(_0x8a41('0x4e'))][(_0x8a41('0x4f'))](_0x8a41('0x50'));}var _0xb680b3={'Content-Type':_0x8a41('0x51'),'Content-Disposition':'attachment'};if(_0x50e795[_0x8a41('0x4d')]){_0xb680b3[_0x8a41('0x52')]=_0x8a41('0x53')+_0x50e795[_0x8a41('0x4d')]+_0x8a41('0x54');}_0x3921d8['set'](_0xb680b3);return _0x3921d8[_0x8a41('0x28')](new Buffer(_0x50e795['recording']));}})[_0x8a41('0x44')](handleError(_0x3921d8,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 08b5734..d4338da 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 _0x6c0c=['bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment'];(function(_0x32a3ce,_0x647c17){var _0x3f8a07=function(_0x4e456d){while(--_0x4e456d){_0x32a3ce['push'](_0x32a3ce['shift']());}};_0x3f8a07(++_0x647c17);}(_0x6c0c,0x182));var _0xc6c0=function(_0x51b1f0,_0x1312ca){_0x51b1f0=_0x51b1f0-0x0;var _0x2bff94=_0x6c0c[_0x51b1f0];return _0x2bff94;};'use strict';var _=require(_0xc6c0('0x0'));var util=require('util');var logger=require(_0xc6c0('0x1'))(_0xc6c0('0x2'));var moment=require(_0xc6c0('0x3'));var BPromise=require(_0xc6c0('0x4'));var rp=require(_0xc6c0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc6c0('0x6'));var config=require(_0xc6c0('0x7'));var attributes=require(_0xc6c0('0x8'));module[_0xc6c0('0x9')]=function(_0x1fdcf2,_0xe49dbd){return _0x1fdcf2['define'](_0xc6c0('0xa'),attributes,{'tableName':_0xc6c0('0xb'),'paranoid':![],'indexes':[{'name':_0xc6c0('0xc'),'fields':[_0xc6c0('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x264a=['path','../../config/environment','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x458140,_0x20964a){var _0x5e4ba1=function(_0x240ca4){while(--_0x240ca4){_0x458140['push'](_0x458140['shift']());}};_0x5e4ba1(++_0x20964a);}(_0x264a,0x1f2));var _0xa264=function(_0x24c1bb,_0x18298a){_0x24c1bb=_0x24c1bb-0x0;var _0x4c932d=_0x264a[_0x24c1bb];return _0x4c932d;};'use strict';var _=require(_0xa264('0x0'));var util=require('util');var logger=require(_0xa264('0x1'))(_0xa264('0x2'));var moment=require(_0xa264('0x3'));var BPromise=require(_0xa264('0x4'));var rp=require(_0xa264('0x5'));var fs=require('fs');var path=require(_0xa264('0x6'));var rimraf=require('rimraf');var config=require(_0xa264('0x7'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x139d67,_0x49eae9){return _0x139d67[_0xa264('0x8')](_0xa264('0x9'),attributes,{'tableName':_0xa264('0xa'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xa264('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 eef99be..021da1d 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 _0x473d=['jayson/promise','client','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','rpc'];(function(_0x5f2afa,_0x3d2cd2){var _0xc21b56=function(_0x14825b){while(--_0x14825b){_0x5f2afa['push'](_0x5f2afa['shift']());}};_0xc21b56(++_0x3d2cd2);}(_0x473d,0xe4));var _0xd473=function(_0x39c30d,_0x54ad35){_0x39c30d=_0x39c30d-0x0;var _0x120b2b=_0x473d[_0x39c30d];return _0x120b2b;};'use strict';var _=require(_0xd473('0x0'));var util=require(_0xd473('0x1'));var moment=require(_0xd473('0x2'));var BPromise=require('bluebird');var rs=require(_0xd473('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd473('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd473('0x5'));var config=require('../../config/environment');var jayson=require(_0xd473('0x6'));var client=jayson[_0xd473('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20b52d,_0x23665a,_0xd66f1b){return new BPromise(function(_0x2276d2,_0x82e0bf){return client['request'](_0x20b52d,_0xd66f1b)[_0xd473('0x8')](function(_0x25a52b){logger['info'](_0xd473('0x9'),_0x23665a,_0xd473('0xa'));logger[_0xd473('0xb')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x23665a,_0xd473('0xa'),JSON[_0xd473('0xc')](_0x25a52b));if(_0x25a52b[_0xd473('0xd')]){if(_0x25a52b[_0xd473('0xd')][_0xd473('0xe')]===0x1f4){logger[_0xd473('0xd')](_0xd473('0x9'),_0x23665a,_0x25a52b[_0xd473('0xd')][_0xd473('0xf')]);return _0x82e0bf(_0x25a52b[_0xd473('0xd')][_0xd473('0xf')]);}logger[_0xd473('0xd')](_0xd473('0x9'),_0x23665a,_0x25a52b['error'][_0xd473('0xf')]);return _0x2276d2(_0x25a52b[_0xd473('0xd')][_0xd473('0xf')]);}else{logger[_0xd473('0x10')](_0xd473('0x9'),_0x23665a,'request\x20sent');_0x2276d2(_0x25a52b['result'][_0xd473('0xf')]);}})[_0xd473('0x11')](function(_0x597ad6){logger['error'](_0xd473('0x9'),_0x23665a,_0x597ad6);_0x82e0bf(_0x597ad6);});});} \ No newline at end of file +var _0x92e8=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','VoiceMailMessage,\x20%s,\x20%s','catch','lodash','util','moment'];(function(_0x170e53,_0x4cd7ef){var _0x95af1a=function(_0x3a4117){while(--_0x3a4117){_0x170e53['push'](_0x170e53['shift']());}};_0x95af1a(++_0x4cd7ef);}(_0x92e8,0x1b6));var _0x892e=function(_0x73b80e,_0x4daa4a){_0x73b80e=_0x73b80e-0x0;var _0x4c31cd=_0x92e8[_0x73b80e];return _0x4c31cd;};'use strict';var _=require(_0x892e('0x0'));var util=require(_0x892e('0x1'));var moment=require(_0x892e('0x2'));var BPromise=require('bluebird');var rs=require(_0x892e('0x3'));var fs=require('fs');var Redis=require(_0x892e('0x4'));var db=require(_0x892e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x892e('0x6'))(_0x892e('0x7'));var config=require(_0x892e('0x8'));var jayson=require(_0x892e('0x9'));var client=jayson[_0x892e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dde60,_0x42d7be,_0x4ac141){return new BPromise(function(_0x39ac14,_0x4c182a){return client[_0x892e('0xb')](_0x2dde60,_0x4ac141)['then'](function(_0xafb2d5){logger[_0x892e('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x42d7be,'request\x20sent');logger[_0x892e('0xd')](_0x892e('0xe'),_0x42d7be,_0x892e('0xf'),JSON[_0x892e('0x10')](_0xafb2d5));if(_0xafb2d5[_0x892e('0x11')]){if(_0xafb2d5[_0x892e('0x11')]['code']===0x1f4){logger[_0x892e('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x42d7be,_0xafb2d5[_0x892e('0x11')][_0x892e('0x12')]);return _0x4c182a(_0xafb2d5[_0x892e('0x11')][_0x892e('0x12')]);}logger[_0x892e('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x42d7be,_0xafb2d5[_0x892e('0x11')][_0x892e('0x12')]);return _0x39ac14(_0xafb2d5[_0x892e('0x11')][_0x892e('0x12')]);}else{logger[_0x892e('0xc')](_0x892e('0x13'),_0x42d7be,'request\x20sent');_0x39ac14(_0xafb2d5['result'][_0x892e('0x12')]);}})[_0x892e('0x14')](function(_0x408279){logger[_0x892e('0x11')](_0x892e('0x13'),_0x42d7be,_0x408279);_0x4c182a(_0x408279);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 3b2d9a1..e9c51ec 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 _0x4a9d=['get','isAuthenticated','/:id','show','/:id/sounds','getSounds','post','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller'];(function(_0x807ab3,_0x3dde5b){var _0x1c20df=function(_0x29c8b9){while(--_0x29c8b9){_0x807ab3['push'](_0x807ab3['shift']());}};_0x1c20df(++_0x3dde5b);}(_0x4a9d,0x1b8));var _0xd4a9=function(_0x82eb5a,_0x39d0f6){_0x82eb5a=_0x82eb5a-0x0;var _0x231d5e=_0x4a9d[_0x82eb5a];return _0x231d5e;};'use strict';var multer=require(_0xd4a9('0x0'));var util=require(_0xd4a9('0x1'));var path=require(_0xd4a9('0x2'));var timeout=require(_0xd4a9('0x3'));var express=require(_0xd4a9('0x4'));var router=express['Router']();var fs_extra=require(_0xd4a9('0x5'));var auth=require(_0xd4a9('0x6'));var interaction=require(_0xd4a9('0x7'));var config=require(_0xd4a9('0x8'));var controller=require(_0xd4a9('0x9'));router[_0xd4a9('0xa')]('/',auth[_0xd4a9('0xb')](),controller['index']);router[_0xd4a9('0xa')](_0xd4a9('0xc'),auth[_0xd4a9('0xb')](),controller[_0xd4a9('0xd')]);router[_0xd4a9('0xa')](_0xd4a9('0xe'),auth['isAuthenticated'](),controller[_0xd4a9('0xf')]);router[_0xd4a9('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd4a9('0x10')]('/:id/sounds',auth[_0xd4a9('0xb')](),controller[_0xd4a9('0x11')]);router[_0xd4a9('0x12')]('/:id',auth[_0xd4a9('0xb')](),controller[_0xd4a9('0x13')]);router[_0xd4a9('0x14')]('/:id',auth[_0xd4a9('0xb')](),controller[_0xd4a9('0x15')]);router[_0xd4a9('0x14')](_0xd4a9('0x16'),auth[_0xd4a9('0xb')](),controller[_0xd4a9('0x17')]);module[_0xd4a9('0x18')]=router; \ No newline at end of file +var _0x08fa=['update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds','getSounds','post','create','addSound','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x08fa,0x176));var _0xa08f=function(_0x18af2d,_0x2a789a){_0x18af2d=_0x18af2d-0x0;var _0x399479=_0x08fa[_0x18af2d];return _0x399479;};'use strict';var multer=require(_0xa08f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa08f('0x1'));var express=require(_0xa08f('0x2'));var router=express[_0xa08f('0x3')]();var fs_extra=require(_0xa08f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa08f('0x5'));var controller=require(_0xa08f('0x6'));router[_0xa08f('0x7')]('/',auth[_0xa08f('0x8')](),controller['index']);router[_0xa08f('0x7')](_0xa08f('0x9'),auth['isAuthenticated'](),controller[_0xa08f('0xa')]);router[_0xa08f('0x7')](_0xa08f('0xb'),auth['isAuthenticated'](),controller[_0xa08f('0xc')]);router[_0xa08f('0xd')]('/',auth[_0xa08f('0x8')](),controller[_0xa08f('0xe')]);router[_0xa08f('0xd')]('/:id/sounds',auth[_0xa08f('0x8')](),controller[_0xa08f('0xf')]);router[_0xa08f('0x10')](_0xa08f('0x9'),auth[_0xa08f('0x8')](),controller[_0xa08f('0x11')]);router[_0xa08f('0x12')](_0xa08f('0x9'),auth['isAuthenticated'](),controller[_0xa08f('0x13')]);router[_0xa08f('0x12')](_0xa08f('0x14'),auth[_0xa08f('0x8')](),controller[_0xa08f('0x15')]);module[_0xa08f('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 1843266..92ecd5e 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 _0xe02f=['files','mp3nb','quietmp3nb','quietmp3','mp3','STRING','TIMESTAMP','BOOLEAN','exports','name','ENUM','custom'];(function(_0x430bc5,_0x128451){var _0x31b37e=function(_0x33e2d3){while(--_0x33e2d3){_0x430bc5['push'](_0x430bc5['shift']());}};_0x31b37e(++_0x128451);}(_0xe02f,0x170));var _0xfe02=function(_0x4f4814,_0x44959d){_0x4f4814=_0x4f4814-0x0;var _0x179592=_0xe02f[_0x4f4814];return _0x179592;};'use strict';var Sequelize=require('sequelize');module[_0xfe02('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfe02('0x1')},'mode':{'type':Sequelize[_0xfe02('0x2')](_0xfe02('0x3'),_0xfe02('0x4'),_0xfe02('0x5'),_0xfe02('0x6'),_0xfe02('0x7'),_0xfe02('0x8')),'allowNull':!![],'defaultValue':_0xfe02('0x4')},'directory':{'type':Sequelize[_0xfe02('0x9')],'allowNull':!![]},'application':{'type':Sequelize[_0xfe02('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0xfe02('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0xfe02('0x9')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xfe02('0x9')],'allowNull':!![]},'stamp':{'type':_0xfe02('0xa')},'defaultEntry':{'type':Sequelize[_0xfe02('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x48a5=['TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha'];(function(_0x32f011,_0x3c4b35){var _0x2ac6c8=function(_0x11efd4){while(--_0x11efd4){_0x32f011['push'](_0x32f011['shift']());}};_0x2ac6c8(++_0x3c4b35);}(_0x48a5,0x1af));var _0x548a=function(_0x5cf3c6,_0x14d7ad){_0x5cf3c6=_0x5cf3c6-0x0;var _0x17eab4=_0x48a5[_0x5cf3c6];return _0x17eab4;};'use strict';var Sequelize=require(_0x548a('0x0'));module['exports']={'name':{'type':Sequelize[_0x548a('0x1')],'allowNull':![],'unique':_0x548a('0x2')},'mode':{'type':Sequelize[_0x548a('0x3')](_0x548a('0x4'),_0x548a('0x5'),_0x548a('0x6'),_0x548a('0x7'),_0x548a('0x8'),_0x548a('0x9')),'allowNull':!![],'defaultValue':_0x548a('0x5')},'directory':{'type':Sequelize[_0x548a('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x548a('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x548a('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x548a('0x1')],'allowNull':!![],'defaultValue':_0x548a('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x548a('0xb')},'defaultEntry':{'type':Sequelize[_0x548a('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 90230ed..7f45d9a 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 _0xe450=['destroy','then','MusicOnHolds','UserProfileResource','sendStatus','stack','name','send','index','map','VoiceMusicOnHold','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','type','merge','options','includeAll','include','catch','rawAttributes','find','update','body','params','create','transaction','mode','files','directory','join','root','server/files/moh','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','sequelize','Sound','findOne','save_name','converted_format','%s.%s','basename','removeSound','id2','createdAt','getSounds','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x5e13af,_0x5461e0){var _0x3dbfa0=function(_0x44c302){while(--_0x44c302){_0x5e13af['push'](_0x5e13af['shift']());}};_0x3dbfa0(++_0x5461e0);}(_0xe450,0x1e2));var _0x0e45=function(_0x1c93db,_0x19b957){_0x1c93db=_0x1c93db-0x0;var _0x21327e=_0xe450[_0x1c93db];return _0x21327e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e45('0x0'));var zipdir=require(_0x0e45('0x1'));var jsonpatch=require(_0x0e45('0x2'));var rp=require('request-promise');var moment=require(_0x0e45('0x3'));var BPromise=require(_0x0e45('0x4'));var Mustache=require(_0x0e45('0x5'));var util=require(_0x0e45('0x6'));var path=require('path');var sox=require(_0x0e45('0x7'));var csv=require('to-csv');var ejs=require(_0x0e45('0x8'));var fs=require('fs');var fs_extra=require(_0x0e45('0x9'));var _=require(_0x0e45('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0e45('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0e45('0xc'));var querystring=require(_0x0e45('0xd'));var Papa=require(_0x0e45('0xe'));var Redis=require(_0x0e45('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0e45('0x10'));var hardwareService=require(_0x0e45('0x11'));var logger=require(_0x0e45('0x12'))(_0x0e45('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0e45('0x14'));var db=require(_0x0e45('0x15'))['db'];function respondWithStatusCode(_0x299f1b,_0x89b199){_0x89b199=_0x89b199||0xcc;return function(_0x2185be){if(_0x2185be){return _0x299f1b['sendStatus'](_0x89b199);}return _0x299f1b['status'](_0x89b199)['end']();};}function respondWithResult(_0x178fe0,_0x20e8a3){_0x20e8a3=_0x20e8a3||0xc8;return function(_0x5b0b8d){if(_0x5b0b8d){return _0x178fe0[_0x0e45('0x16')](_0x20e8a3)[_0x0e45('0x17')](_0x5b0b8d);}};}function respondWithFilteredResult(_0x5b1427,_0x4c4099){return function(_0x430591){if(_0x430591){var _0x371902=typeof _0x4c4099[_0x0e45('0x18')]===_0x0e45('0x19')&&typeof _0x4c4099[_0x0e45('0x1a')]==='undefined';var _0x541271=_0x430591['count'];var _0x2f1c59=_0x371902?0x0:_0x4c4099[_0x0e45('0x18')];var _0x2a74cf=_0x371902?_0x430591[_0x0e45('0x1b')]:_0x4c4099[_0x0e45('0x18')]+_0x4c4099[_0x0e45('0x1a')];var _0x2e0f28;if(_0x2a74cf>=_0x541271){_0x2a74cf=_0x541271;_0x2e0f28=0xc8;}else{_0x2e0f28=0xce;}_0x5b1427[_0x0e45('0x16')](_0x2e0f28);return _0x5b1427[_0x0e45('0x1c')](_0x0e45('0x1d'),_0x2f1c59+'-'+_0x2a74cf+'/'+_0x541271)[_0x0e45('0x17')](_0x430591);}return null;};}function patchUpdates(_0x2a692e){return function(_0x3d2c33){try{jsonpatch[_0x0e45('0x1e')](_0x3d2c33,_0x2a692e,!![]);}catch(_0x4add3d){return BPromise[_0x0e45('0x1f')](_0x4add3d);}return _0x3d2c33[_0x0e45('0x20')]();};}function saveUpdates(_0x5d8e55,_0x28a0cc){return function(_0x2ac93d){if(_0x2ac93d){return _0x2ac93d['update'](_0x5d8e55)['then'](function(_0x1b2176){return _0x1b2176;});}return null;};}function removeEntity(_0x53907d,_0x40b25b){return function(_0x3b0504){if(_0x3b0504){return _0x3b0504[_0x0e45('0x21')]()[_0x0e45('0x22')](function(){var _0x4dfcda=_0x3b0504['get']({'plain':!![]});var _0xd918e5=_0x0e45('0x23');return db[_0x0e45('0x24')]['destroy']({'where':{'type':_0xd918e5,'resourceId':_0x4dfcda['id']}})[_0x0e45('0x22')](function(){return _0x3b0504;});})[_0x0e45('0x22')](function(){_0x53907d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c478a,_0x21a433){return function(_0x4d1e79){if(!_0x4d1e79){_0x4c478a[_0x0e45('0x25')](0x194);}return _0x4d1e79;};}function handleError(_0x59414b,_0x41d869){_0x41d869=_0x41d869||0x1f4;return function(_0x29dadd){logger['error'](_0x29dadd[_0x0e45('0x26')]);if(_0x29dadd[_0x0e45('0x27')]){delete _0x29dadd['name'];}_0x59414b[_0x0e45('0x16')](_0x41d869)[_0x0e45('0x28')](_0x29dadd);};}exports[_0x0e45('0x29')]=function(_0xc5b652,_0x57618a){var _0x30bca3={},_0x4bc4a5={},_0x4aeef9={'count':0x0,'rows':[]};var _0x4f3069=_[_0x0e45('0x2a')](db[_0x0e45('0x2b')]['rawAttributes'],function(_0x2d4556){return{'name':_0x2d4556[_0x0e45('0x2c')],'type':_0x2d4556['type'][_0x0e45('0x2d')]};});_0x4bc4a5[_0x0e45('0x2e')]=_[_0x0e45('0x2a')](_0x4f3069,_0x0e45('0x27'));_0x4bc4a5[_0x0e45('0x2f')]=_[_0x0e45('0x30')](_0xc5b652[_0x0e45('0x2f')]);_0x4bc4a5[_0x0e45('0x31')]=_[_0x0e45('0x32')](_0x4bc4a5[_0x0e45('0x2e')],_0x4bc4a5[_0x0e45('0x2f')]);_0x30bca3[_0x0e45('0x33')]=_[_0x0e45('0x32')](_0x4bc4a5[_0x0e45('0x2e')],qs[_0x0e45('0x34')](_0xc5b652[_0x0e45('0x2f')][_0x0e45('0x34')]));_0x30bca3[_0x0e45('0x33')]=_0x30bca3[_0x0e45('0x33')][_0x0e45('0x35')]?_0x30bca3[_0x0e45('0x33')]:_0x4bc4a5['model'];if(!_0xc5b652[_0x0e45('0x2f')][_0x0e45('0x36')](_0x0e45('0x37'))){_0x30bca3[_0x0e45('0x1a')]=qs[_0x0e45('0x1a')](_0xc5b652[_0x0e45('0x2f')][_0x0e45('0x1a')]);_0x30bca3['offset']=qs[_0x0e45('0x18')](_0xc5b652[_0x0e45('0x2f')][_0x0e45('0x18')]);}_0x30bca3[_0x0e45('0x38')]=qs['sort'](_0xc5b652[_0x0e45('0x2f')]['sort']);delete _0xc5b652[_0x0e45('0x2f')]['sort'];_0x30bca3[_0x0e45('0x39')]=qs[_0x0e45('0x31')](_[_0x0e45('0x3a')](_0xc5b652[_0x0e45('0x2f')],_0x4bc4a5[_0x0e45('0x31')]),_0x4f3069);if(_0xc5b652[_0x0e45('0x2f')][_0x0e45('0x3b')]){_0x30bca3[_0x0e45('0x39')]=_['merge'](_0x30bca3[_0x0e45('0x39')],{'$or':_[_0x0e45('0x2a')](_0x4f3069,function(_0x4e4bd2){if(_0x4e4bd2[_0x0e45('0x3c')]!=='VIRTUAL'){var _0x38bf50={};_0x38bf50[_0x4e4bd2['name']]={'$like':'%'+_0xc5b652[_0x0e45('0x2f')][_0x0e45('0x3b')]+'%'};return _0x38bf50;}})});}_0x30bca3=_[_0x0e45('0x3d')]({},_0x30bca3,_0xc5b652[_0x0e45('0x3e')]);var _0x1c265c={'where':_0x30bca3[_0x0e45('0x39')]};return db['VoiceMusicOnHold'][_0x0e45('0x1b')](_0x1c265c)[_0x0e45('0x22')](function(_0x2fd259){_0x4aeef9['count']=_0x2fd259;if(_0xc5b652[_0x0e45('0x2f')][_0x0e45('0x3f')]){_0x30bca3[_0x0e45('0x40')]=[{'all':!![]}];}return db[_0x0e45('0x2b')]['findAll'](_0x30bca3);})[_0x0e45('0x22')](function(_0x54a025){_0x4aeef9['rows']=_0x54a025;return _0x4aeef9;})['then'](respondWithFilteredResult(_0x57618a,_0x30bca3))[_0x0e45('0x41')](handleError(_0x57618a,null));};exports['show']=function(_0x1e73b4,_0x5a988e){var _0x4a30a1={'raw':![],'where':{'id':_0x1e73b4['params']['id']}},_0x47b469={};_0x47b469[_0x0e45('0x2e')]=_[_0x0e45('0x30')](db[_0x0e45('0x2b')][_0x0e45('0x42')]);_0x47b469[_0x0e45('0x2f')]=_['keys'](_0x1e73b4[_0x0e45('0x2f')]);_0x47b469[_0x0e45('0x31')]=_[_0x0e45('0x32')](_0x47b469[_0x0e45('0x2e')],_0x47b469['query']);_0x4a30a1[_0x0e45('0x33')]=_[_0x0e45('0x32')](_0x47b469[_0x0e45('0x2e')],qs[_0x0e45('0x34')](_0x1e73b4[_0x0e45('0x2f')][_0x0e45('0x34')]));_0x4a30a1['attributes']=_0x4a30a1[_0x0e45('0x33')][_0x0e45('0x35')]?_0x4a30a1[_0x0e45('0x33')]:_0x47b469[_0x0e45('0x2e')];if(_0x1e73b4['query'][_0x0e45('0x3f')]){_0x4a30a1[_0x0e45('0x40')]=[{'all':!![]}];}_0x4a30a1=_[_0x0e45('0x3d')]({},_0x4a30a1,_0x1e73b4['options']);return db[_0x0e45('0x2b')][_0x0e45('0x43')](_0x4a30a1)['then'](handleEntityNotFound(_0x5a988e,null))[_0x0e45('0x22')](respondWithResult(_0x5a988e,null))[_0x0e45('0x41')](handleError(_0x5a988e,null));};exports[_0x0e45('0x44')]=function(_0x26b59f,_0x11dac4){if(_0x26b59f[_0x0e45('0x45')]['id']){delete _0x26b59f[_0x0e45('0x45')]['id'];}return db[_0x0e45('0x2b')]['find']({'where':{'id':_0x26b59f[_0x0e45('0x46')]['id']}})[_0x0e45('0x22')](handleEntityNotFound(_0x11dac4,null))[_0x0e45('0x22')](saveUpdates(_0x26b59f[_0x0e45('0x45')],null))['then'](respondWithResult(_0x11dac4,null))[_0x0e45('0x41')](handleError(_0x11dac4,null));};exports[_0x0e45('0x47')]=function(_0x302bbb,_0x27d29b,_0x10c6da){return db['sequelize'][_0x0e45('0x48')](function(_0x2261f2){if(_0x302bbb[_0x0e45('0x45')][_0x0e45('0x49')]===_0x0e45('0x4a')){_0x302bbb['body'][_0x0e45('0x4b')]=path[_0x0e45('0x4c')](config[_0x0e45('0x4d')],_0x0e45('0x4e'),_0x302bbb[_0x0e45('0x45')][_0x0e45('0x27')]);}return db['VoiceMusicOnHold'][_0x0e45('0x47')](_0x302bbb[_0x0e45('0x45')],{'transaction':_0x2261f2})['then'](function(_0x1c5a9c){if(_0x302bbb[_0x0e45('0x45')][_0x0e45('0x49')]===_0x0e45('0x4a')){fs['mkdirSync'](_0x1c5a9c[_0x0e45('0x4b')],parseInt('0777',0x8));}var _0x2e19ee=_0x302bbb[_0x0e45('0x4f')][_0x0e45('0x50')]({'plain':!![]});if(!_0x2e19ee)throw new Error(_0x0e45('0x51'));if(_0x2e19ee[_0x0e45('0x52')]==='user'){var _0x38826f=_0x1c5a9c[_0x0e45('0x50')]({'plain':!![]});return db[_0x0e45('0x53')][_0x0e45('0x43')]({'where':{'name':_0x0e45('0x23'),'userProfileId':_0x2e19ee[_0x0e45('0x54')]},'raw':!![]})['then'](function(_0x1e5bef){if(_0x1e5bef&&_0x1e5bef['autoAssociation']===0x0){return db[_0x0e45('0x24')][_0x0e45('0x47')]({'name':_0x38826f[_0x0e45('0x27')],'resourceId':_0x38826f['id'],'type':_0x1e5bef[_0x0e45('0x27')],'sectionId':_0x1e5bef['id']},{})['then'](function(){return _0x1c5a9c;});}else{return _0x1c5a9c;}})[_0x0e45('0x41')](function(_0x49f1b8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49f1b8);});}return _0x1c5a9c;});})[_0x0e45('0x22')](respondWithResult(_0x27d29b,0xc9))[_0x0e45('0x41')](handleError(_0x27d29b,null));};exports[_0x0e45('0x21')]=function(_0x37fc68,_0xc73986,_0x341665){var _0x1dfea9;return db[_0x0e45('0x2b')]['find']({'where':{'id':_0x37fc68[_0x0e45('0x46')]['id']}})[_0x0e45('0x22')](function(_0x54ac1e){if(_0x54ac1e){return db['sequelize']['transaction'](function(_0x210550){return _0x54ac1e['destroy']({'transaction':_0x210550,'raw':!![]})['then'](function(_0x31fd5e){if(_0x31fd5e['directory']){fs[_0x0e45('0x55')](_0x31fd5e[_0x0e45('0x4b')])['forEach'](function(_0x480d76){fs[_0x0e45('0x56')](path[_0x0e45('0x4c')](_0x31fd5e[_0x0e45('0x4b')],_0x480d76));});fs[_0x0e45('0x57')](_0x31fd5e[_0x0e45('0x4b')]);}return _0x31fd5e;});})[_0x0e45('0x41')](function(_0x85564e){throw new db[(_0x0e45('0x58'))][(_0x0e45('0x59'))](_0x85564e[_0x0e45('0x5a')]);});}})['then'](handleEntityNotFound(_0xc73986,null))[_0x0e45('0x22')](removeEntity(_0xc73986,null))[_0x0e45('0x41')](handleError(_0xc73986,null));};exports[_0x0e45('0x5b')]=function(_0x1572c7,_0x416a5b,_0x13e632){return db[_0x0e45('0x5c')][_0x0e45('0x48')](function(_0x32cafc){var _0x5e0f40;return db[_0x0e45('0x2b')][_0x0e45('0x43')]({'where':{'id':_0x1572c7['params']['id']}})[_0x0e45('0x22')](function(_0x8b80a6){if(_0x8b80a6){_0x5e0f40=_0x8b80a6;return _0x8b80a6['addSound'](_0x1572c7[_0x0e45('0x45')]['id'],{'transaction':_0x32cafc});}})[_0x0e45('0x22')](function(_0x4654f4){if(_0x4654f4){return db[_0x0e45('0x5d')][_0x0e45('0x5e')]({'where':{'id':_0x1572c7['body']['id']},'attributes':['id',_0x0e45('0x27'),_0x0e45('0x5f'),_0x0e45('0x60'),'createdAt'],'raw':!![]});}})['then'](function(_0x38a37e){if(_0x38a37e){var _0x35a80a=path[_0x0e45('0x4c')](config['root'],'server/files/sounds/converted',util['format'](_0x0e45('0x61'),path[_0x0e45('0x62')](_0x38a37e[_0x0e45('0x5f')],path['extname'](_0x38a37e[_0x0e45('0x5f')])),_0x38a37e['converted_format']));var _0x250e7b=path['join'](config['root'],_0x0e45('0x4e'),_0x5e0f40['name'],util['format']('%s.%s',_0x38a37e[_0x0e45('0x27')],_0x38a37e['converted_format']));fs['symlinkSync'](_0x35a80a,_0x250e7b);return _0x38a37e;}})['catch'](function(_0x972e0e){throw new db[(_0x0e45('0x58'))][(_0x0e45('0x59'))](_0x972e0e[_0x0e45('0x5a')]);});})[_0x0e45('0x22')](handleEntityNotFound(_0x416a5b,null))[_0x0e45('0x22')](respondWithResult(_0x416a5b,0xc9))[_0x0e45('0x41')](handleError(_0x416a5b,null));};exports[_0x0e45('0x63')]=function(_0x28817b,_0x2b4653,_0x118121){return db['sequelize']['transaction'](function(_0x581486){var _0x25fdf7;return db[_0x0e45('0x2b')][_0x0e45('0x5e')]({'where':{'id':_0x28817b[_0x0e45('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b4653,null))[_0x0e45('0x22')](function(_0x2ba10d){if(_0x2ba10d){_0x25fdf7=_0x2ba10d;return _0x2ba10d['removeSound'](_0x28817b[_0x0e45('0x46')][_0x0e45('0x64')]);}})[_0x0e45('0x22')](function(_0x192e76){if(_0x192e76){return db[_0x0e45('0x5d')]['findOne']({'where':{'id':_0x28817b[_0x0e45('0x46')][_0x0e45('0x64')]},'attributes':['id',_0x0e45('0x27'),_0x0e45('0x5f'),'converted_format',_0x0e45('0x65')],'raw':!![]});}})[_0x0e45('0x22')](function(_0x5ec9b7){if(_0x5ec9b7){fs[_0x0e45('0x56')](path[_0x0e45('0x4c')](_0x25fdf7[_0x0e45('0x4b')],util['format'](_0x0e45('0x61'),_0x5ec9b7[_0x0e45('0x27')],_0x5ec9b7[_0x0e45('0x60')])));return _0x5ec9b7;}})['catch'](function(_0x1bde18){throw new db[(_0x0e45('0x58'))]['ValidationError'](_0x1bde18[_0x0e45('0x5a')]);});})['then'](handleEntityNotFound(_0x2b4653,null))[_0x0e45('0x22')](respondWithStatusCode(_0x2b4653,0xcc))['catch'](handleError(_0x2b4653,null));};exports[_0x0e45('0x66')]=function(_0x5a5c04,_0x48b8b5,_0xea561d){var _0x226d59={};var _0x2b8062={};var _0xe4ff23;var _0x2e2ab6;return db[_0x0e45('0x2b')][_0x0e45('0x5e')]({'where':{'id':_0x5a5c04['params']['id']}})['then'](handleEntityNotFound(_0x48b8b5,null))[_0x0e45('0x22')](function(_0x13b744){if(_0x13b744){_0xe4ff23=_0x13b744;_0x2b8062[_0x0e45('0x2e')]=_['keys'](db['Sound']['rawAttributes']);_0x2b8062[_0x0e45('0x2f')]=_[_0x0e45('0x30')](_0x5a5c04[_0x0e45('0x2f')]);_0x2b8062[_0x0e45('0x31')]=_[_0x0e45('0x32')](_0x2b8062['model'],_0x2b8062['query']);_0x226d59[_0x0e45('0x33')]=_[_0x0e45('0x32')](_0x2b8062[_0x0e45('0x2e')],qs[_0x0e45('0x34')](_0x5a5c04[_0x0e45('0x2f')]['fields']));_0x226d59['attributes']=_0x226d59[_0x0e45('0x33')][_0x0e45('0x35')]?_0x226d59[_0x0e45('0x33')]:_0x2b8062[_0x0e45('0x2e')];_0x226d59['order']=qs['sort'](_0x5a5c04[_0x0e45('0x2f')]['sort']);_0x226d59[_0x0e45('0x39')]=qs['filters'](_[_0x0e45('0x3a')](_0x5a5c04[_0x0e45('0x2f')],_0x2b8062[_0x0e45('0x31')]));if(_0x5a5c04[_0x0e45('0x2f')][_0x0e45('0x3b')]){_0x226d59['where']=_[_0x0e45('0x3d')](_0x226d59['where'],{'$or':_[_0x0e45('0x2a')](_0x226d59[_0x0e45('0x33')],function(_0x3d1234){var _0x430db4={};_0x430db4[_0x3d1234]={'$like':'%'+_0x5a5c04[_0x0e45('0x2f')][_0x0e45('0x3b')]+'%'};return _0x430db4;})});}_0x226d59=_[_0x0e45('0x3d')]({},_0x226d59,_0x5a5c04['options']);return _0xe4ff23[_0x0e45('0x66')](_0x226d59);}})['then'](function(_0x697e24){if(_0x697e24){_0x2e2ab6=_0x697e24[_0x0e45('0x35')];if(!_0x5a5c04[_0x0e45('0x2f')][_0x0e45('0x36')]('nolimit')){_0x226d59[_0x0e45('0x1a')]=qs[_0x0e45('0x1a')](_0x5a5c04[_0x0e45('0x2f')][_0x0e45('0x1a')]);_0x226d59[_0x0e45('0x18')]=qs[_0x0e45('0x18')](_0x5a5c04[_0x0e45('0x2f')]['offset']);}return _0xe4ff23[_0x0e45('0x66')](_0x226d59);}})[_0x0e45('0x22')](function(_0x1ada3a){if(_0x1ada3a){return _0x1ada3a?{'count':_0x2e2ab6,'rows':_0x1ada3a}:null;}})[_0x0e45('0x22')](respondWithResult(_0x48b8b5,null))[_0x0e45('0x41')](handleError(_0x48b8b5,null));}; \ No newline at end of file +var _0x703a=['type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','body','find','create','mode','files','directory','root','server/files/moh','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','sequelize','transaction','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','message','addSound','Sound','findOne','save_name','converted_format','createdAt','join','format','extname','ValidationError','removeSound','getSounds','pick','filter','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName'];(function(_0x291139,_0x7f30de){var _0x3c42c0=function(_0x5832e3){while(--_0x5832e3){_0x291139['push'](_0x291139['shift']());}};_0x3c42c0(++_0x7f30de);}(_0x703a,0x11d));var _0xa703=function(_0x3db25a,_0x13155b){_0x3db25a=_0x3db25a-0x0;var _0x57dd62=_0x703a[_0x3db25a];return _0x57dd62;};'use strict';var emlformat=require(_0xa703('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa703('0x1'));var jsonpatch=require(_0xa703('0x2'));var rp=require(_0xa703('0x3'));var moment=require(_0xa703('0x4'));var BPromise=require(_0xa703('0x5'));var Mustache=require('mustache');var util=require(_0xa703('0x6'));var path=require(_0xa703('0x7'));var sox=require(_0xa703('0x8'));var csv=require(_0xa703('0x9'));var ejs=require(_0xa703('0xa'));var fs=require('fs');var fs_extra=require(_0xa703('0xb'));var _=require(_0xa703('0xc'));var squel=require(_0xa703('0xd'));var crypto=require(_0xa703('0xe'));var jsforce=require(_0xa703('0xf'));var deskjs=require(_0xa703('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa703('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa703('0x12'));var hardwareService=require(_0xa703('0x13'));var logger=require(_0xa703('0x14'))('api');var utils=require(_0xa703('0x15'));var config=require(_0xa703('0x16'));var licenseUtil=require(_0xa703('0x17'));var db=require(_0xa703('0x18'))['db'];function respondWithStatusCode(_0x400fc4,_0x44b120){_0x44b120=_0x44b120||0xcc;return function(_0x3f00a1){if(_0x3f00a1){return _0x400fc4['sendStatus'](_0x44b120);}return _0x400fc4[_0xa703('0x19')](_0x44b120)[_0xa703('0x1a')]();};}function respondWithResult(_0x2ec1b0,_0x4d3e00){_0x4d3e00=_0x4d3e00||0xc8;return function(_0x1302f0){if(_0x1302f0){return _0x2ec1b0[_0xa703('0x19')](_0x4d3e00)[_0xa703('0x1b')](_0x1302f0);}};}function respondWithFilteredResult(_0x253742,_0x153128){return function(_0x3075b8){if(_0x3075b8){var _0x59bb63=typeof _0x153128[_0xa703('0x1c')]==='undefined'&&typeof _0x153128[_0xa703('0x1d')]==='undefined';var _0x512111=_0x3075b8[_0xa703('0x1e')];var _0x40f56b=_0x59bb63?0x0:_0x153128['offset'];var _0x5e4a05=_0x59bb63?_0x3075b8[_0xa703('0x1e')]:_0x153128[_0xa703('0x1c')]+_0x153128[_0xa703('0x1d')];var _0x153e4a;if(_0x5e4a05>=_0x512111){_0x5e4a05=_0x512111;_0x153e4a=0xc8;}else{_0x153e4a=0xce;}_0x253742[_0xa703('0x19')](_0x153e4a);return _0x253742[_0xa703('0x1f')](_0xa703('0x20'),_0x40f56b+'-'+_0x5e4a05+'/'+_0x512111)[_0xa703('0x1b')](_0x3075b8);}return null;};}function patchUpdates(_0x1c58cf){return function(_0x572d79){try{jsonpatch[_0xa703('0x21')](_0x572d79,_0x1c58cf,!![]);}catch(_0x3fa536){return BPromise[_0xa703('0x22')](_0x3fa536);}return _0x572d79[_0xa703('0x23')]();};}function saveUpdates(_0x2793b6,_0xbbb0cb){return function(_0x1a8614){if(_0x1a8614){return _0x1a8614[_0xa703('0x24')](_0x2793b6)[_0xa703('0x25')](function(_0x1b19b5){return _0x1b19b5;});}return null;};}function removeEntity(_0x4cd76f,_0x4a6658){return function(_0x3316e3){if(_0x3316e3){return _0x3316e3[_0xa703('0x26')]()[_0xa703('0x25')](function(){var _0x581380=_0x3316e3[_0xa703('0x27')]({'plain':!![]});var _0x296396='MusicOnHolds';return db[_0xa703('0x28')][_0xa703('0x26')]({'where':{'type':_0x296396,'resourceId':_0x581380['id']}})[_0xa703('0x25')](function(){return _0x3316e3;});})[_0xa703('0x25')](function(){_0x4cd76f[_0xa703('0x19')](0xcc)[_0xa703('0x1a')]();});}};}function handleEntityNotFound(_0x359206,_0x3be32b){return function(_0xd9a4e9){if(!_0xd9a4e9){_0x359206[_0xa703('0x29')](0x194);}return _0xd9a4e9;};}function handleError(_0xa9b804,_0x65f95c){_0x65f95c=_0x65f95c||0x1f4;return function(_0x45a68f){logger[_0xa703('0x2a')](_0x45a68f[_0xa703('0x2b')]);if(_0x45a68f[_0xa703('0x2c')]){delete _0x45a68f[_0xa703('0x2c')];}_0xa9b804[_0xa703('0x19')](_0x65f95c)[_0xa703('0x2d')](_0x45a68f);};}exports[_0xa703('0x2e')]=function(_0x3c6c55,_0x4f5dff){var _0x2dd658={},_0x1f65ea={},_0x35be91={'count':0x0,'rows':[]};var _0x5766=_[_0xa703('0x2f')](db[_0xa703('0x30')][_0xa703('0x31')],function(_0xb5bed5){return{'name':_0xb5bed5[_0xa703('0x32')],'type':_0xb5bed5[_0xa703('0x33')][_0xa703('0x34')]};});_0x1f65ea['model']=_[_0xa703('0x2f')](_0x5766,_0xa703('0x2c'));_0x1f65ea['query']=_[_0xa703('0x35')](_0x3c6c55[_0xa703('0x36')]);_0x1f65ea['filters']=_[_0xa703('0x37')](_0x1f65ea[_0xa703('0x38')],_0x1f65ea[_0xa703('0x36')]);_0x2dd658['attributes']=_[_0xa703('0x37')](_0x1f65ea[_0xa703('0x38')],qs[_0xa703('0x39')](_0x3c6c55['query'][_0xa703('0x39')]));_0x2dd658[_0xa703('0x3a')]=_0x2dd658[_0xa703('0x3a')][_0xa703('0x3b')]?_0x2dd658[_0xa703('0x3a')]:_0x1f65ea[_0xa703('0x38')];if(!_0x3c6c55[_0xa703('0x36')][_0xa703('0x3c')](_0xa703('0x3d'))){_0x2dd658[_0xa703('0x1d')]=qs['limit'](_0x3c6c55[_0xa703('0x36')][_0xa703('0x1d')]);_0x2dd658[_0xa703('0x1c')]=qs[_0xa703('0x1c')](_0x3c6c55[_0xa703('0x36')][_0xa703('0x1c')]);}_0x2dd658[_0xa703('0x3e')]=qs[_0xa703('0x3f')](_0x3c6c55[_0xa703('0x36')][_0xa703('0x3f')]);delete _0x3c6c55['query'][_0xa703('0x3f')];_0x2dd658[_0xa703('0x40')]=qs[_0xa703('0x41')](_['pick'](_0x3c6c55[_0xa703('0x36')],_0x1f65ea[_0xa703('0x41')]),_0x5766);if(_0x3c6c55[_0xa703('0x36')]['filter']){_0x2dd658[_0xa703('0x40')]=_[_0xa703('0x42')](_0x2dd658[_0xa703('0x40')],{'$or':_[_0xa703('0x2f')](_0x5766,function(_0x1b71eb){if(_0x1b71eb[_0xa703('0x33')]!==_0xa703('0x43')){var _0x3f7999={};_0x3f7999[_0x1b71eb[_0xa703('0x2c')]]={'$like':'%'+_0x3c6c55['query']['filter']+'%'};return _0x3f7999;}})});}_0x2dd658=_['merge']({},_0x2dd658,_0x3c6c55[_0xa703('0x44')]);var _0x5ebbb4={'where':_0x2dd658[_0xa703('0x40')]};return db['VoiceMusicOnHold'][_0xa703('0x1e')](_0x5ebbb4)[_0xa703('0x25')](function(_0x473f5b){_0x35be91[_0xa703('0x1e')]=_0x473f5b;if(_0x3c6c55[_0xa703('0x36')][_0xa703('0x45')]){_0x2dd658[_0xa703('0x46')]=[{'all':!![]}];}return db[_0xa703('0x30')][_0xa703('0x47')](_0x2dd658);})[_0xa703('0x25')](function(_0x588d6d){_0x35be91[_0xa703('0x48')]=_0x588d6d;return _0x35be91;})['then'](respondWithFilteredResult(_0x4f5dff,_0x2dd658))[_0xa703('0x49')](handleError(_0x4f5dff,null));};exports[_0xa703('0x4a')]=function(_0xc3a7f7,_0x5f1f0e){var _0xc22dee={'raw':![],'where':{'id':_0xc3a7f7[_0xa703('0x4b')]['id']}},_0x5865ab={};_0x5865ab[_0xa703('0x38')]=_[_0xa703('0x35')](db[_0xa703('0x30')][_0xa703('0x31')]);_0x5865ab[_0xa703('0x36')]=_[_0xa703('0x35')](_0xc3a7f7['query']);_0x5865ab[_0xa703('0x41')]=_[_0xa703('0x37')](_0x5865ab[_0xa703('0x38')],_0x5865ab['query']);_0xc22dee[_0xa703('0x3a')]=_['intersection'](_0x5865ab[_0xa703('0x38')],qs[_0xa703('0x39')](_0xc3a7f7['query'][_0xa703('0x39')]));_0xc22dee['attributes']=_0xc22dee[_0xa703('0x3a')][_0xa703('0x3b')]?_0xc22dee[_0xa703('0x3a')]:_0x5865ab[_0xa703('0x38')];if(_0xc3a7f7['query'][_0xa703('0x45')]){_0xc22dee[_0xa703('0x46')]=[{'all':!![]}];}_0xc22dee=_[_0xa703('0x42')]({},_0xc22dee,_0xc3a7f7[_0xa703('0x44')]);return db[_0xa703('0x30')]['find'](_0xc22dee)['then'](handleEntityNotFound(_0x5f1f0e,null))[_0xa703('0x25')](respondWithResult(_0x5f1f0e,null))[_0xa703('0x49')](handleError(_0x5f1f0e,null));};exports[_0xa703('0x24')]=function(_0x54241e,_0x539a3f){if(_0x54241e[_0xa703('0x4c')]['id']){delete _0x54241e[_0xa703('0x4c')]['id'];}return db[_0xa703('0x30')][_0xa703('0x4d')]({'where':{'id':_0x54241e['params']['id']}})[_0xa703('0x25')](handleEntityNotFound(_0x539a3f,null))['then'](saveUpdates(_0x54241e[_0xa703('0x4c')],null))[_0xa703('0x25')](respondWithResult(_0x539a3f,null))[_0xa703('0x49')](handleError(_0x539a3f,null));};exports[_0xa703('0x4e')]=function(_0x46d2c8,_0x32c885,_0xc3f84a){return db['sequelize']['transaction'](function(_0x2e6e4c){if(_0x46d2c8[_0xa703('0x4c')][_0xa703('0x4f')]===_0xa703('0x50')){_0x46d2c8['body'][_0xa703('0x51')]=path['join'](config[_0xa703('0x52')],_0xa703('0x53'),_0x46d2c8[_0xa703('0x4c')][_0xa703('0x2c')]);}return db[_0xa703('0x30')][_0xa703('0x4e')](_0x46d2c8[_0xa703('0x4c')],{'transaction':_0x2e6e4c})['then'](function(_0x2aa07f){if(_0x46d2c8[_0xa703('0x4c')][_0xa703('0x4f')]===_0xa703('0x50')){fs[_0xa703('0x54')](_0x2aa07f['directory'],parseInt('0777',0x8));}var _0x2f25c5=_0x46d2c8[_0xa703('0x55')][_0xa703('0x27')]({'plain':!![]});if(!_0x2f25c5)throw new Error(_0xa703('0x56'));if(_0x2f25c5[_0xa703('0x57')]===_0xa703('0x55')){var _0xff15ce=_0x2aa07f[_0xa703('0x27')]({'plain':!![]});return db[_0xa703('0x58')][_0xa703('0x4d')]({'where':{'name':'MusicOnHolds','userProfileId':_0x2f25c5[_0xa703('0x59')]},'raw':!![]})[_0xa703('0x25')](function(_0x4b6ea1){if(_0x4b6ea1&&_0x4b6ea1['autoAssociation']===0x0){return db[_0xa703('0x28')]['create']({'name':_0xff15ce[_0xa703('0x2c')],'resourceId':_0xff15ce['id'],'type':_0x4b6ea1[_0xa703('0x2c')],'sectionId':_0x4b6ea1['id']},{})[_0xa703('0x25')](function(){return _0x2aa07f;});}else{return _0x2aa07f;}})[_0xa703('0x49')](function(_0x249b1c){logger[_0xa703('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x249b1c);});}return _0x2aa07f;});})['then'](respondWithResult(_0x32c885,0xc9))[_0xa703('0x49')](handleError(_0x32c885,null));};exports[_0xa703('0x26')]=function(_0x68a4a4,_0x3a3a2a,_0x148ec8){var _0x2c342c;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x68a4a4['params']['id']}})[_0xa703('0x25')](function(_0x4816c4){if(_0x4816c4){return db[_0xa703('0x5a')][_0xa703('0x5b')](function(_0x2832d5){return _0x4816c4[_0xa703('0x26')]({'transaction':_0x2832d5,'raw':!![]})['then'](function(_0x4f8212){if(_0x4f8212[_0xa703('0x51')]){fs[_0xa703('0x5c')](_0x4f8212[_0xa703('0x51')])[_0xa703('0x5d')](function(_0x162458){fs[_0xa703('0x5e')](path['join'](_0x4f8212[_0xa703('0x51')],_0x162458));});fs[_0xa703('0x5f')](_0x4f8212['directory']);}return _0x4f8212;});})['catch'](function(_0x544959){throw new db[(_0xa703('0x60'))]['ValidationError'](_0x544959[_0xa703('0x61')]);});}})['then'](handleEntityNotFound(_0x3a3a2a,null))['then'](removeEntity(_0x3a3a2a,null))[_0xa703('0x49')](handleError(_0x3a3a2a,null));};exports[_0xa703('0x62')]=function(_0x345a93,_0x471e9c,_0x2c8661){return db[_0xa703('0x5a')][_0xa703('0x5b')](function(_0x56a1d7){var _0x411640;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x345a93[_0xa703('0x4b')]['id']}})[_0xa703('0x25')](function(_0x38be4c){if(_0x38be4c){_0x411640=_0x38be4c;return _0x38be4c['addSound'](_0x345a93[_0xa703('0x4c')]['id'],{'transaction':_0x56a1d7});}})['then'](function(_0x4ddf27){if(_0x4ddf27){return db[_0xa703('0x63')][_0xa703('0x64')]({'where':{'id':_0x345a93[_0xa703('0x4c')]['id']},'attributes':['id',_0xa703('0x2c'),_0xa703('0x65'),_0xa703('0x66'),_0xa703('0x67')],'raw':!![]});}})[_0xa703('0x25')](function(_0x779468){if(_0x779468){var _0x50e988=path[_0xa703('0x68')](config['root'],'server/files/sounds/converted',util[_0xa703('0x69')]('%s.%s',path['basename'](_0x779468[_0xa703('0x65')],path[_0xa703('0x6a')](_0x779468['save_name'])),_0x779468[_0xa703('0x66')]));var _0xfca479=path[_0xa703('0x68')](config[_0xa703('0x52')],_0xa703('0x53'),_0x411640[_0xa703('0x2c')],util['format']('%s.%s',_0x779468[_0xa703('0x2c')],_0x779468['converted_format']));fs['symlinkSync'](_0x50e988,_0xfca479);return _0x779468;}})[_0xa703('0x49')](function(_0x184b60){throw new db[(_0xa703('0x60'))][(_0xa703('0x6b'))](_0x184b60[_0xa703('0x61')]);});})[_0xa703('0x25')](handleEntityNotFound(_0x471e9c,null))[_0xa703('0x25')](respondWithResult(_0x471e9c,0xc9))[_0xa703('0x49')](handleError(_0x471e9c,null));};exports[_0xa703('0x6c')]=function(_0x2f4235,_0x1ac30d,_0x2f167c){return db[_0xa703('0x5a')][_0xa703('0x5b')](function(_0x169171){var _0x1aed61;return db['VoiceMusicOnHold'][_0xa703('0x64')]({'where':{'id':_0x2f4235['params']['id']}})['then'](handleEntityNotFound(_0x1ac30d,null))[_0xa703('0x25')](function(_0xf94c7c){if(_0xf94c7c){_0x1aed61=_0xf94c7c;return _0xf94c7c[_0xa703('0x6c')](_0x2f4235[_0xa703('0x4b')]['id2']);}})[_0xa703('0x25')](function(_0x1629a4){if(_0x1629a4){return db[_0xa703('0x63')]['findOne']({'where':{'id':_0x2f4235[_0xa703('0x4b')]['id2']},'attributes':['id',_0xa703('0x2c'),_0xa703('0x65'),'converted_format','createdAt'],'raw':!![]});}})[_0xa703('0x25')](function(_0x341555){if(_0x341555){fs[_0xa703('0x5e')](path[_0xa703('0x68')](_0x1aed61[_0xa703('0x51')],util[_0xa703('0x69')]('%s.%s',_0x341555[_0xa703('0x2c')],_0x341555[_0xa703('0x66')])));return _0x341555;}})['catch'](function(_0x15bc15){throw new db[(_0xa703('0x60'))][(_0xa703('0x6b'))](_0x15bc15[_0xa703('0x61')]);});})[_0xa703('0x25')](handleEntityNotFound(_0x1ac30d,null))['then'](respondWithStatusCode(_0x1ac30d,0xcc))[_0xa703('0x49')](handleError(_0x1ac30d,null));};exports[_0xa703('0x6d')]=function(_0x1ce8b7,_0x235bc7,_0x55d065){var _0x2273a7={};var _0x309f5b={};var _0x3d3634;var _0x15bb0b;return db[_0xa703('0x30')][_0xa703('0x64')]({'where':{'id':_0x1ce8b7['params']['id']}})['then'](handleEntityNotFound(_0x235bc7,null))[_0xa703('0x25')](function(_0x22a829){if(_0x22a829){_0x3d3634=_0x22a829;_0x309f5b[_0xa703('0x38')]=_[_0xa703('0x35')](db[_0xa703('0x63')]['rawAttributes']);_0x309f5b[_0xa703('0x36')]=_['keys'](_0x1ce8b7['query']);_0x309f5b[_0xa703('0x41')]=_[_0xa703('0x37')](_0x309f5b[_0xa703('0x38')],_0x309f5b[_0xa703('0x36')]);_0x2273a7['attributes']=_[_0xa703('0x37')](_0x309f5b[_0xa703('0x38')],qs[_0xa703('0x39')](_0x1ce8b7[_0xa703('0x36')][_0xa703('0x39')]));_0x2273a7[_0xa703('0x3a')]=_0x2273a7[_0xa703('0x3a')][_0xa703('0x3b')]?_0x2273a7[_0xa703('0x3a')]:_0x309f5b[_0xa703('0x38')];_0x2273a7[_0xa703('0x3e')]=qs['sort'](_0x1ce8b7[_0xa703('0x36')]['sort']);_0x2273a7['where']=qs[_0xa703('0x41')](_[_0xa703('0x6e')](_0x1ce8b7['query'],_0x309f5b['filters']));if(_0x1ce8b7['query'][_0xa703('0x6f')]){_0x2273a7[_0xa703('0x40')]=_[_0xa703('0x42')](_0x2273a7[_0xa703('0x40')],{'$or':_[_0xa703('0x2f')](_0x2273a7[_0xa703('0x3a')],function(_0x20aee4){var _0x261d6e={};_0x261d6e[_0x20aee4]={'$like':'%'+_0x1ce8b7[_0xa703('0x36')]['filter']+'%'};return _0x261d6e;})});}_0x2273a7=_[_0xa703('0x42')]({},_0x2273a7,_0x1ce8b7[_0xa703('0x44')]);return _0x3d3634[_0xa703('0x6d')](_0x2273a7);}})[_0xa703('0x25')](function(_0x2a3751){if(_0x2a3751){_0x15bb0b=_0x2a3751['length'];if(!_0x1ce8b7[_0xa703('0x36')][_0xa703('0x3c')]('nolimit')){_0x2273a7[_0xa703('0x1d')]=qs[_0xa703('0x1d')](_0x1ce8b7[_0xa703('0x36')][_0xa703('0x1d')]);_0x2273a7[_0xa703('0x1c')]=qs[_0xa703('0x1c')](_0x1ce8b7[_0xa703('0x36')][_0xa703('0x1c')]);}return _0x3d3634['getSounds'](_0x2273a7);}})['then'](function(_0x351fe7){if(_0x351fe7){return _0x351fe7?{'count':_0x15bb0b,'rows':_0x351fe7}:null;}})[_0xa703('0x25')](respondWithResult(_0x235bc7,null))[_0xa703('0x49')](handleError(_0x235bc7,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index ce2cba2..40333cf 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 _0x123c=['voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMusicOnHold'];(function(_0xcf30dc,_0x4e8a0d){var _0x450089=function(_0xb342c6){while(--_0xb342c6){_0xcf30dc['push'](_0xcf30dc['shift']());}};_0x450089(++_0x4e8a0d);}(_0x123c,0x127));var _0xc123=function(_0x41aa8b,_0x55f5c9){_0x41aa8b=_0x41aa8b-0x0;var _0x1ebf7c=_0x123c[_0x41aa8b];return _0x1ebf7c;};'use strict';var _=require(_0xc123('0x0'));var util=require(_0xc123('0x1'));var logger=require(_0xc123('0x2'))(_0xc123('0x3'));var moment=require(_0xc123('0x4'));var BPromise=require(_0xc123('0x5'));var rp=require(_0xc123('0x6'));var fs=require('fs');var path=require(_0xc123('0x7'));var rimraf=require(_0xc123('0x8'));var config=require(_0xc123('0x9'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xc123('0xa')]=function(_0x268687,_0x48bc44){return _0x268687[_0xc123('0xb')](_0xc123('0xc'),attributes,{'tableName':_0xc123('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e53=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceMusicOnHold.attributes','define','voice_musiconhold','lodash'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0x0e53,0x15d));var _0x30e5=function(_0x6acf8e,_0x1c87b3){_0x6acf8e=_0x6acf8e-0x0;var _0x52a4ba=_0x0e53[_0x6acf8e];return _0x52a4ba;};'use strict';var _=require(_0x30e5('0x0'));var util=require('util');var logger=require(_0x30e5('0x1'))(_0x30e5('0x2'));var moment=require(_0x30e5('0x3'));var BPromise=require(_0x30e5('0x4'));var rp=require(_0x30e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30e5('0x6'));var config=require('../../config/environment');var attributes=require(_0x30e5('0x7'));module['exports']=function(_0x34acf5,_0x5d7ed8){return _0x34acf5[_0x30e5('0x8')]('VoiceMusicOnHold',attributes,{'tableName':_0x30e5('0x9'),'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 cde02d1..e7bab5e 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x16f49c,_0x52b156){var _0x52ed0a=function(_0x40f5b6){while(--_0x40f5b6){_0x16f49c['push'](_0x16f49c['shift']());}};_0x52ed0a(++_0x52b156);}(_0x70e0,0x17b));var _0x070e=function(_0x1d22da,_0x47a555){_0x1d22da=_0x1d22da-0x0;var _0x39cc92=_0x70e0[_0x1d22da];return _0x39cc92;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3a9763,_0x2687d4){var _0x1645bc=function(_0x295295){while(--_0x295295){_0x3a9763['push'](_0x3a9763['shift']());}};_0x1645bc(++_0x2687d4);}(_0xe706,0xa3));var _0x6e70=function(_0x573773,_0x36caa2){_0x573773=_0x573773-0x0;var _0x2b56af=_0xe706[_0x573773];return _0x2b56af;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 03519a2..5436f00 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 _0x4853=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','show','/:id/users','getAgents','/:id/teams','post','addAgents','/:id','update','delete','removeAgents','util'];(function(_0x2a5d87,_0x51899d){var _0x1d7450=function(_0x3c1f0a){while(--_0x3c1f0a){_0x2a5d87['push'](_0x2a5d87['shift']());}};_0x1d7450(++_0x51899d);}(_0x4853,0x11d));var _0x3485=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4853[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x3485('0x0'));var path=require('path');var timeout=require(_0x3485('0x1'));var express=require(_0x3485('0x2'));var router=express[_0x3485('0x3')]();var fs_extra=require(_0x3485('0x4'));var auth=require(_0x3485('0x5'));var interaction=require(_0x3485('0x6'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x3485('0x7')](),controller[_0x3485('0x8')]);router[_0x3485('0x9')](_0x3485('0xa'),auth[_0x3485('0x7')](),controller[_0x3485('0xb')]);router[_0x3485('0x9')]('/:id',auth[_0x3485('0x7')](),controller[_0x3485('0xc')]);router[_0x3485('0x9')](_0x3485('0xd'),auth[_0x3485('0x7')](),controller[_0x3485('0xe')]);router[_0x3485('0x9')](_0x3485('0xf'),auth[_0x3485('0x7')](),controller['getTeams']);router[_0x3485('0x10')]('/',auth[_0x3485('0x7')](),controller['create']);router['post'](_0x3485('0xd'),auth[_0x3485('0x7')](),controller[_0x3485('0x11')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router['put'](_0x3485('0x12'),auth[_0x3485('0x7')](),controller[_0x3485('0x13')]);router['delete'](_0x3485('0x12'),auth['isAuthenticated'](),controller['destroy']);router[_0x3485('0x14')]('/:id/users',auth[_0x3485('0x7')](),controller[_0x3485('0x15')]);router[_0x3485('0x14')](_0x3485('0xf'),auth['isAuthenticated'](),controller['removeTeams']);module['exports']=router; \ No newline at end of file +var _0x7429=['describe','isAuthenticated','show','/:id/teams','getTeams','post','/:id/users','addTeams','put','/:id','update','destroy','delete','removeAgents','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','/describe'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x7429,0x6f));var _0x9742=function(_0x377891,_0x147b5d){_0x377891=_0x377891-0x0;var _0x21a539=_0x7429[_0x377891];return _0x21a539;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9742('0x0'));var timeout=require('connect-timeout');var express=require(_0x9742('0x1'));var router=express[_0x9742('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9742('0x3'));var interaction=require(_0x9742('0x4'));var config=require(_0x9742('0x5'));var controller=require(_0x9742('0x6'));router[_0x9742('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9742('0x7')](_0x9742('0x8'),auth['isAuthenticated'](),controller[_0x9742('0x9')]);router[_0x9742('0x7')]('/:id',auth[_0x9742('0xa')](),controller[_0x9742('0xb')]);router[_0x9742('0x7')]('/:id/users',auth[_0x9742('0xa')](),controller['getAgents']);router[_0x9742('0x7')](_0x9742('0xc'),auth['isAuthenticated'](),controller[_0x9742('0xd')]);router[_0x9742('0xe')]('/',auth[_0x9742('0xa')](),controller['create']);router[_0x9742('0xe')](_0x9742('0xf'),auth[_0x9742('0xa')](),controller['addAgents']);router[_0x9742('0xe')](_0x9742('0xc'),auth['isAuthenticated'](),controller[_0x9742('0x10')]);router[_0x9742('0x11')](_0x9742('0x12'),auth[_0x9742('0xa')](),controller[_0x9742('0x13')]);router['delete'](_0x9742('0x12'),auth['isAuthenticated'](),controller[_0x9742('0x14')]);router[_0x9742('0x15')](_0x9742('0xf'),auth[_0x9742('0xa')](),controller[_0x9742('0x16')]);router['delete']('/:id/teams',auth[_0x9742('0xa')](),controller['removeTeams']);module[_0x9742('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index d051029..7024fd1 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 _0x078e=['sequelize','exports','name','VIRTUAL','system-','STRING'];(function(_0x5a1eb8,_0x13e6a0){var _0x483150=function(_0x4766d5){while(--_0x4766d5){_0x5a1eb8['push'](_0x5a1eb8['shift']());}};_0x483150(++_0x13e6a0);}(_0x078e,0xf6));var _0xe078=function(_0x4792cd,_0x36e65d){_0x4792cd=_0x4792cd-0x0;var _0x4720a5=_0x078e[_0x4792cd];return _0x4720a5;};'use strict';var Sequelize=require(_0xe078('0x0'));module[_0xe078('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe078('0x2')},'prefix':{'type':Sequelize[_0xe078('0x3')],'get':function(_0x137de0){return _0xe078('0x4')+this['getDataValue'](_0xe078('0x2'))+'-';}},'description':{'type':Sequelize[_0xe078('0x5')]},'callerIdAll':{'type':Sequelize[_0xe078('0x5')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xa54e=['exports','STRING','name','system-','getDataValue','sequelize'];(function(_0x33a7c2,_0x1209be){var _0x38f16a=function(_0x34dcf0){while(--_0x34dcf0){_0x33a7c2['push'](_0x33a7c2['shift']());}};_0x38f16a(++_0x1209be);}(_0xa54e,0x1d3));var _0xea54=function(_0x119e7a,_0x3949d3){_0x119e7a=_0x119e7a-0x0;var _0x1fb90a=_0xa54e[_0x119e7a];return _0x1fb90a;};'use strict';var Sequelize=require(_0xea54('0x0'));module[_0xea54('0x1')]={'name':{'type':Sequelize[_0xea54('0x2')],'allowNull':![],'unique':_0xea54('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0xa9032a){return _0xea54('0x4')+this[_0xea54('0x5')](_0xea54('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xea54('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 8363386..3e99b77 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 _0x373d=['team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./voicePrefix.socket','register','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','describe','create','sequelize','transaction','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','addAgents','omit','ids','spread','emit','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','addTeams','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','userVoicePrefix:save','field','tq.TeamId','from'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x373d,0x1e2));var _0xd373=function(_0x237587,_0x5ca4cb){_0x237587=_0x237587-0x0;var _0x1ae730=_0x373d[_0x237587];return _0x1ae730;};'use strict';var emlformat=require(_0xd373('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd373('0x1'));var jsonpatch=require(_0xd373('0x2'));var rp=require(_0xd373('0x3'));var moment=require(_0xd373('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd373('0x5'));var util=require(_0xd373('0x6'));var path=require(_0xd373('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd373('0x8'));var fs=require('fs');var fs_extra=require(_0xd373('0x9'));var _=require(_0xd373('0xa'));var squel=require(_0xd373('0xb'));var crypto=require('crypto');var jsforce=require(_0xd373('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd373('0xd'));var Redis=require(_0xd373('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd373('0xf'));var as=require(_0xd373('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd373('0x11'));var utils=require(_0xd373('0x12'));var config=require(_0xd373('0x13'));var licenseUtil=require(_0xd373('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xd373('0x15')],{'host':_0xd373('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd373('0x15')]));require(_0xd373('0x17'))[_0xd373('0x18')](socket);function respondWithStatusCode(_0x23ed86,_0x28b2bf){_0x28b2bf=_0x28b2bf||0xcc;return function(_0x1a9df9){if(_0x1a9df9){return _0x23ed86[_0xd373('0x19')](_0x28b2bf);}return _0x23ed86[_0xd373('0x1a')](_0x28b2bf)[_0xd373('0x1b')]();};}function respondWithResult(_0x2c5854,_0x3a5316){_0x3a5316=_0x3a5316||0xc8;return function(_0x263ae3){if(_0x263ae3){return _0x2c5854[_0xd373('0x1a')](_0x3a5316)['json'](_0x263ae3);}};}function respondWithFilteredResult(_0x1e26cf,_0x5eab00){return function(_0x460259){if(_0x460259){var _0x36d47a=typeof _0x5eab00['offset']===_0xd373('0x1c')&&typeof _0x5eab00['limit']==='undefined';var _0x23fada=_0x460259[_0xd373('0x1d')];var _0x167597=_0x36d47a?0x0:_0x5eab00[_0xd373('0x1e')];var _0x16b147=_0x36d47a?_0x460259[_0xd373('0x1d')]:_0x5eab00['offset']+_0x5eab00[_0xd373('0x1f')];var _0xd808f8;if(_0x16b147>=_0x23fada){_0x16b147=_0x23fada;_0xd808f8=0xc8;}else{_0xd808f8=0xce;}_0x1e26cf[_0xd373('0x1a')](_0xd808f8);return _0x1e26cf[_0xd373('0x20')](_0xd373('0x21'),_0x167597+'-'+_0x16b147+'/'+_0x23fada)[_0xd373('0x22')](_0x460259);}return null;};}function patchUpdates(_0x4f64bd){return function(_0x355fca){try{jsonpatch[_0xd373('0x23')](_0x355fca,_0x4f64bd,!![]);}catch(_0x157f81){return BPromise[_0xd373('0x24')](_0x157f81);}return _0x355fca[_0xd373('0x25')]();};}function saveUpdates(_0x238ffd,_0x466a03){return function(_0x109e4c){if(_0x109e4c){return _0x109e4c[_0xd373('0x26')](_0x238ffd)[_0xd373('0x27')](function(_0x437110){return _0x437110;});}return null;};}function removeEntity(_0x34f05a,_0x388182){return function(_0x420a30){if(_0x420a30){return _0x420a30[_0xd373('0x28')]()[_0xd373('0x27')](function(){var _0x50b987=_0x420a30[_0xd373('0x29')]({'plain':!![]});var _0x3e657b=_0xd373('0x2a');return db[_0xd373('0x2b')][_0xd373('0x28')]({'where':{'type':_0x3e657b,'resourceId':_0x50b987['id']}})[_0xd373('0x27')](function(){return _0x420a30;});})[_0xd373('0x27')](function(){_0x34f05a[_0xd373('0x1a')](0xcc)[_0xd373('0x1b')]();});}};}function handleEntityNotFound(_0x158825,_0xbc420b){return function(_0x2ee37c){if(!_0x2ee37c){_0x158825[_0xd373('0x19')](0x194);}return _0x2ee37c;};}function handleError(_0x5287e7,_0x7ca56e){_0x7ca56e=_0x7ca56e||0x1f4;return function(_0x490842){logger['error'](_0x490842[_0xd373('0x2c')]);if(_0x490842[_0xd373('0x2d')]){delete _0x490842[_0xd373('0x2d')];}_0x5287e7[_0xd373('0x1a')](_0x7ca56e)[_0xd373('0x2e')](_0x490842);};}exports['index']=function(_0x6659f6,_0x104156){var _0x4e17c9={},_0x102c3a={},_0x8e4884={'count':0x0,'rows':[]};var _0x146e24=_[_0xd373('0x2f')](db[_0xd373('0x30')][_0xd373('0x31')],function(_0x364c01){return{'name':_0x364c01[_0xd373('0x32')],'type':_0x364c01[_0xd373('0x33')]['key']};});_0x102c3a[_0xd373('0x34')]=_[_0xd373('0x2f')](_0x146e24,_0xd373('0x2d'));_0x102c3a[_0xd373('0x35')]=_[_0xd373('0x36')](_0x6659f6[_0xd373('0x35')]);_0x102c3a[_0xd373('0x37')]=_[_0xd373('0x38')](_0x102c3a[_0xd373('0x34')],_0x102c3a[_0xd373('0x35')]);_0x4e17c9[_0xd373('0x39')]=_[_0xd373('0x38')](_0x102c3a[_0xd373('0x34')],qs[_0xd373('0x3a')](_0x6659f6[_0xd373('0x35')]['fields']));_0x4e17c9[_0xd373('0x39')]=_0x4e17c9[_0xd373('0x39')][_0xd373('0x3b')]?_0x4e17c9[_0xd373('0x39')]:_0x102c3a['model'];if(!_0x6659f6[_0xd373('0x35')][_0xd373('0x3c')](_0xd373('0x3d'))){_0x4e17c9[_0xd373('0x1f')]=qs[_0xd373('0x1f')](_0x6659f6[_0xd373('0x35')]['limit']);_0x4e17c9['offset']=qs[_0xd373('0x1e')](_0x6659f6['query'][_0xd373('0x1e')]);}_0x4e17c9[_0xd373('0x3e')]=qs[_0xd373('0x3f')](_0x6659f6['query'][_0xd373('0x3f')]);_0x4e17c9[_0xd373('0x40')]=qs[_0xd373('0x37')](_[_0xd373('0x41')](_0x6659f6['query'],_0x102c3a['filters']),_0x146e24);if(_0x6659f6['query'][_0xd373('0x42')]){_0x4e17c9['where']=_[_0xd373('0x43')](_0x4e17c9[_0xd373('0x40')],{'$or':_['map'](_0x146e24,function(_0x4e8734){if(_0x4e8734['type']!==_0xd373('0x44')){var _0x43a4b8={};_0x43a4b8[_0x4e8734[_0xd373('0x2d')]]={'$like':'%'+_0x6659f6['query']['filter']+'%'};return _0x43a4b8;}})});}_0x4e17c9=_[_0xd373('0x43')]({},_0x4e17c9,_0x6659f6[_0xd373('0x45')]);var _0x51efee={'where':_0x4e17c9[_0xd373('0x40')]};return db[_0xd373('0x30')][_0xd373('0x1d')](_0x51efee)[_0xd373('0x27')](function(_0x2d8c7d){_0x8e4884['count']=_0x2d8c7d;if(_0x6659f6['query'][_0xd373('0x46')]){_0x4e17c9[_0xd373('0x47')]=[{'all':!![]}];}return db[_0xd373('0x30')][_0xd373('0x48')](_0x4e17c9);})['then'](function(_0x29725c){_0x8e4884['rows']=_0x29725c;return _0x8e4884;})[_0xd373('0x27')](respondWithFilteredResult(_0x104156,_0x4e17c9))[_0xd373('0x49')](handleError(_0x104156,null));};exports[_0xd373('0x4a')]=function(_0xfb2922,_0x15cd1f){var _0x54afd4={'raw':![],'where':{'id':_0xfb2922[_0xd373('0x4b')]['id']}},_0x42744d={};_0x42744d['model']=_[_0xd373('0x36')](db[_0xd373('0x30')][_0xd373('0x31')]);_0x42744d[_0xd373('0x35')]=_[_0xd373('0x36')](_0xfb2922[_0xd373('0x35')]);_0x42744d[_0xd373('0x37')]=_[_0xd373('0x38')](_0x42744d[_0xd373('0x34')],_0x42744d[_0xd373('0x35')]);_0x54afd4['attributes']=_['intersection'](_0x42744d[_0xd373('0x34')],qs['fields'](_0xfb2922[_0xd373('0x35')]['fields']));_0x54afd4['attributes']=_0x54afd4['attributes'][_0xd373('0x3b')]?_0x54afd4[_0xd373('0x39')]:_0x42744d[_0xd373('0x34')];if(_0xfb2922[_0xd373('0x35')][_0xd373('0x46')]){_0x54afd4[_0xd373('0x47')]=[{'all':!![]}];}_0x54afd4=_[_0xd373('0x43')]({},_0x54afd4,_0xfb2922['options']);return db[_0xd373('0x30')]['find'](_0x54afd4)[_0xd373('0x27')](handleEntityNotFound(_0x15cd1f,null))[_0xd373('0x27')](respondWithResult(_0x15cd1f,null))['catch'](handleError(_0x15cd1f,null));};exports[_0xd373('0x28')]=function(_0x5ca39c,_0x46a582){return db[_0xd373('0x30')][_0xd373('0x4c')]({'where':{'id':_0x5ca39c[_0xd373('0x4b')]['id']}})[_0xd373('0x27')](handleEntityNotFound(_0x46a582,null))['then'](removeEntity(_0x46a582,null))['catch'](handleError(_0x46a582,null));};exports['describe']=function(_0x3a2192,_0x384e23){return db['VoicePrefix'][_0xd373('0x4d')]()[_0xd373('0x27')](respondWithResult(_0x384e23,null))['catch'](handleError(_0x384e23,null));};exports[_0xd373('0x4e')]=function(_0xb6b583,_0x102101){var _0x473af2;return db[_0xd373('0x4f')][_0xd373('0x50')](function(_0xc255ec){return db[_0xd373('0x30')][_0xd373('0x4e')](_0xb6b583[_0xd373('0x51')],{'transaction':_0xc255ec})[_0xd373('0x27')](function(_0x5b88ea){_0x473af2=_0x5b88ea['get']({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x473af2['VoiceExtensionId']},'raw':!![]})['then'](function(_0x409246){return createVoicePrefixExtensions(_0x473af2,_0x409246,_0xc255ec);});});})[_0xd373('0x27')](function(){var _0x5b2ae9=_0xb6b583['user']['get']({'plain':!![]});if(!_0x5b2ae9)throw new Error(_0xd373('0x52'));if(_0x5b2ae9[_0xd373('0x53')]==='user'){var _0x52fa5b=_0x473af2;return db[_0xd373('0x54')][_0xd373('0x4c')]({'where':{'name':_0xd373('0x2a'),'userProfileId':_0x5b2ae9[_0xd373('0x55')]},'raw':!![]})[_0xd373('0x27')](function(_0x59da03){if(_0x59da03&&_0x59da03[_0xd373('0x56')]===0x0){return db[_0xd373('0x2b')][_0xd373('0x4e')]({'name':_0x52fa5b[_0xd373('0x2d')],'resourceId':_0x52fa5b['id'],'type':_0x59da03[_0xd373('0x2d')],'sectionId':_0x59da03['id']},{})[_0xd373('0x27')](function(){return _0x473af2;});}else{return _0x473af2;}})[_0xd373('0x49')](function(_0x2e4298){logger[_0xd373('0x57')](_0xd373('0x58'),_0x2e4298);throw _0x2e4298;});}return _0x473af2;})[_0xd373('0x27')](respondWithResult(_0x102101,null))[_0xd373('0x49')](handleError(_0x102101,null));};function Extension(_0x213b3c,_0x42e45d,_0x13f139,_0x4cb143){this[_0xd373('0x59')]=_0xd373('0x5a');this[_0xd373('0x5b')]=_0x213b3c;this['app']=_0x13f139;this[_0xd373('0x33')]='system';this[_0xd373('0x5c')]='Voice\x20Prefix\x20Extension';this[_0xd373('0x5d')]=_0x42e45d;this[_0xd373('0x5e')]=_0x4cb143;}function createVoicePrefixExtensions(_0x427f68,_0x19924a,_0x41c327){return new BPromise(function(_0x1ac620,_0xa47b76){var _0xaaf7fa=new Extension(formatPrefixName(_0x427f68[_0xd373('0x5f')]),0x1,_0xd373('0x60'),_0xd373('0x61'));_0xaaf7fa[_0xd373('0x62')]=_0x427f68['id'];return db[_0xd373('0x63')][_0xd373('0x4e')](_0xaaf7fa,{'transaction':_0x41c327})[_0xd373('0x27')](function(_0x2e7edb){var _0x1379e5=_0x2e7edb[_0xd373('0x29')]({'plain':!![]});var _0x209e76=_[_0xd373('0x2f')](addVoicePrefixExtensions(_0x427f68,_0x19924a),function(_0x295e09){_0x295e09[_0xd373('0x64')]=_0x1379e5['id'];_0x295e09[_0xd373('0x62')]=_0x427f68['id'];return _0x295e09;});return db[_0xd373('0x63')][_0xd373('0x65')](_0x209e76,{'transaction':_0x41c327})[_0xd373('0x27')](function(_0x547a8a){if(!_0x547a8a){return _0xa47b76(_0xd373('0x66'));}else{return _0x1ac620(_0x547a8a);}})[_0xd373('0x49')](function(_0x5fdc16){return _0xa47b76(_0x5fdc16);});});;});};function addVoicePrefixExtensions(_0x4a7d01,_0x38068a){var _0x2d9019=[];var _0x33320c=formatPrefixName(_0x4a7d01[_0xd373('0x5f')]);_0x2d9019[_0xd373('0x67')](new Extension(_0x33320c,0x2,_0xd373('0x68'),_0xd373('0x69')+_0x4a7d01['name']));if(_0x4a7d01[_0xd373('0x6a')]){_0x2d9019[_0xd373('0x67')](new Extension(_0x33320c,0x3,_0xd373('0x68'),_0xd373('0x6b')+_0x4a7d01[_0xd373('0x6a')]));}else{_0x2d9019[_0xd373('0x67')](new Extension(_0x33320c,0x3,_0xd373('0x60'),_0xd373('0x6c')));}_0x2d9019['push'](new Extension(_0x33320c,0x4,_0xd373('0x6d'),_0x38068a['context']+','+_0xd373('0x6e')+(0x8+_0x4a7d01[_0xd373('0x2d')][_0xd373('0x3b')])+'}'+','+0x1));return _0x2d9019;}function formatPrefixName(_0x2a9582){var _0x36e7cc='_';for(var _0x32c044=0x0;_0x32c044<_0x2a9582[_0xd373('0x3b')];_0x32c044++){if(_0x2a9582[_0xd373('0x6f')](_0x32c044)=='-'){_0x36e7cc+=_0x2a9582['charAt'](_0x32c044);}else{_0x36e7cc+='['+_0x2a9582[_0xd373('0x6f')](_0x32c044)+']';}}_0x36e7cc+='.';return _0x36e7cc;}exports['update']=function(_0x40f5ad,_0x27fcbe,_0x310a65){var _0x3ce679=_0x40f5ad[_0xd373('0x51')];_0x3ce679[_0xd373('0x5f')]=_0xd373('0x70')+_0x3ce679['name']+'-';return db[_0xd373('0x4f')][_0xd373('0x50')](function(_0x3d375d){return db['VoicePrefix'][_0xd373('0x26')](_0x3ce679,{'where':{'id':_0x3ce679['id']},'transaction':_0x3d375d})[_0xd373('0x27')](function(){return db[_0xd373('0x63')][_0xd373('0x28')]({'where':{'VoicePrefixId':_0x3ce679['id']},'transaction':_0x3d375d})[_0xd373('0x27')](function(){return db[_0xd373('0x63')][_0xd373('0x4c')]({'where':{'id':_0x3ce679[_0xd373('0x64')]},'raw':!![]})[_0xd373('0x27')](function(_0x727541){return createVoicePrefixExtensions(_0x3ce679,_0x727541,_0x3d375d);});});});})[_0xd373('0x27')](function(){return db[_0xd373('0x30')]['findById'](_0x3ce679['id']);})[_0xd373('0x27')](respondWithResult(_0x27fcbe,null))[_0xd373('0x49')](handleError(_0x27fcbe,null));};exports[_0xd373('0x71')]=function(_0x506f49,_0x377147,_0x365028){return db[_0xd373('0x30')]['find']({'where':{'id':_0x506f49[_0xd373('0x4b')]['id']}})['then'](handleEntityNotFound(_0x377147,null))[_0xd373('0x27')](function(_0x26821a){if(_0x26821a){return _0x26821a[_0xd373('0x71')](_0x506f49[_0xd373('0x51')]['ids'],_[_0xd373('0x72')](_0x506f49['body'],[_0xd373('0x73'),'id'])||{})[_0xd373('0x74')](function(_0x140ec4){for(var _0xb658db=0x0;_0xb658db<_0x506f49[_0xd373('0x51')][_0xd373('0x73')]['length'];_0xb658db+=0x1){socket[_0xd373('0x75')]('userVoicePrefix:save',{'UserId':Number(_0x506f49[_0xd373('0x51')]['ids'][_0xb658db]),'VoicePrefixId':Number(_0x506f49['params']['id'])});}return _0x140ec4;});}})[_0xd373('0x27')](respondWithResult(_0x377147,null))[_0xd373('0x49')](handleError(_0x377147,null));};exports[_0xd373('0x76')]=function(_0x32b739,_0x5a5651,_0x546a07){return db[_0xd373('0x30')][_0xd373('0x4c')]({'where':{'id':_0x32b739[_0xd373('0x4b')]['id']}})[_0xd373('0x27')](handleEntityNotFound(_0x5a5651,null))[_0xd373('0x27')](function(_0x1a30eb){if(_0x1a30eb){return _0x1a30eb[_0xd373('0x76')](_0x32b739[_0xd373('0x35')][_0xd373('0x73')])[_0xd373('0x27')](function(){if(_['isArray'](_0x32b739[_0xd373('0x35')][_0xd373('0x73')])){for(var _0x1576e5=0x0;_0x1576e5<_0x32b739[_0xd373('0x35')][_0xd373('0x73')][_0xd373('0x3b')];_0x1576e5+=0x1){socket[_0xd373('0x75')]('userVoicePrefix:remove',{'UserId':Number(_0x32b739[_0xd373('0x35')]['ids'][_0x1576e5]),'VoicePrefixId':Number(_0x32b739['params']['id'])});}}else{socket[_0xd373('0x75')](_0xd373('0x77'),{'UserId':Number(_0x32b739[_0xd373('0x35')][_0xd373('0x73')]),'VoicePrefixId':Number(_0x32b739[_0xd373('0x4b')]['id'])});}});}})[_0xd373('0x27')](respondWithStatusCode(_0x5a5651,null))['catch'](handleError(_0x5a5651,null));};exports[_0xd373('0x78')]=function(_0x19eb94,_0x6114a5,_0x52ab87){var _0x467ac8={};var _0x2c543a={};var _0x1a5666;var _0x47ae4c;return db[_0xd373('0x30')][_0xd373('0x79')]({'where':{'id':_0x19eb94[_0xd373('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6114a5,null))[_0xd373('0x27')](function(_0x288295){if(_0x288295){_0x1a5666=_0x288295;_0x2c543a[_0xd373('0x34')]=_[_0xd373('0x36')](db[_0xd373('0x7a')][_0xd373('0x31')]);_0x2c543a[_0xd373('0x35')]=_[_0xd373('0x36')](_0x19eb94[_0xd373('0x35')]);_0x2c543a[_0xd373('0x37')]=_[_0xd373('0x38')](_0x2c543a[_0xd373('0x34')],_0x2c543a[_0xd373('0x35')]);_0x467ac8['attributes']=_[_0xd373('0x38')](_0x2c543a[_0xd373('0x34')],qs[_0xd373('0x3a')](_0x19eb94['query'][_0xd373('0x3a')]));_0x467ac8[_0xd373('0x39')]=_0x467ac8['attributes'][_0xd373('0x3b')]?_0x467ac8['attributes']:_0x2c543a[_0xd373('0x34')];_0x467ac8[_0xd373('0x3e')]=qs[_0xd373('0x3f')](_0x19eb94[_0xd373('0x35')][_0xd373('0x3f')]);_0x467ac8[_0xd373('0x40')]=qs['filters'](_[_0xd373('0x41')](_0x19eb94['query'],_0x2c543a[_0xd373('0x37')]));if(_0x19eb94[_0xd373('0x35')][_0xd373('0x42')]){_0x467ac8[_0xd373('0x40')]=_[_0xd373('0x43')](_0x467ac8['where'],{'$or':_[_0xd373('0x2f')](_0x467ac8[_0xd373('0x39')],function(_0x232b78){var _0x12ffc0={};_0x12ffc0[_0x232b78]={'$like':'%'+_0x19eb94[_0xd373('0x35')][_0xd373('0x42')]+'%'};return _0x12ffc0;})});}_0x467ac8=_['merge']({},_0x467ac8,_0x19eb94[_0xd373('0x45')]);return _0x1a5666[_0xd373('0x78')](_0x467ac8);}})[_0xd373('0x27')](function(_0x4b32b6){if(_0x4b32b6){_0x47ae4c=_0x4b32b6[_0xd373('0x3b')];if(!_0x19eb94[_0xd373('0x35')]['hasOwnProperty'](_0xd373('0x3d'))){_0x467ac8['limit']=qs[_0xd373('0x1f')](_0x19eb94['query']['limit']);_0x467ac8[_0xd373('0x1e')]=qs[_0xd373('0x1e')](_0x19eb94[_0xd373('0x35')][_0xd373('0x1e')]);}return _0x1a5666[_0xd373('0x78')](_0x467ac8);}})['then'](function(_0x3ae4c8){if(_0x3ae4c8){return _0x3ae4c8?{'count':_0x47ae4c,'rows':_0x3ae4c8}:null;}})['then'](respondWithResult(_0x6114a5,null))[_0xd373('0x49')](handleError(_0x6114a5,null));};exports[_0xd373('0x7b')]=function(_0xc8f4e6,_0x5c951e,_0x113671){var _0x5621d8={};var _0x30549e={};var _0x633ba0;var _0xa854a2;return db[_0xd373('0x30')][_0xd373('0x79')]({'where':{'id':_0xc8f4e6['params']['id']}})[_0xd373('0x27')](handleEntityNotFound(_0x5c951e,null))[_0xd373('0x27')](function(_0x39327f){if(_0x39327f){_0x633ba0=_0x39327f;_0x30549e[_0xd373('0x34')]=_[_0xd373('0x36')](db[_0xd373('0x7c')][_0xd373('0x31')]);_0x30549e['query']=_[_0xd373('0x36')](_0xc8f4e6[_0xd373('0x35')]);_0x30549e[_0xd373('0x37')]=_[_0xd373('0x38')](_0x30549e[_0xd373('0x34')],_0x30549e[_0xd373('0x35')]);_0x5621d8[_0xd373('0x39')]=_[_0xd373('0x38')](_0x30549e[_0xd373('0x34')],qs[_0xd373('0x3a')](_0xc8f4e6[_0xd373('0x35')][_0xd373('0x3a')]));_0x5621d8[_0xd373('0x39')]=_0x5621d8[_0xd373('0x39')][_0xd373('0x3b')]?_0x5621d8[_0xd373('0x39')]:_0x30549e[_0xd373('0x34')];_0x5621d8['order']=qs[_0xd373('0x3f')](_0xc8f4e6[_0xd373('0x35')]['sort']);_0x5621d8['where']=qs[_0xd373('0x37')](_[_0xd373('0x41')](_0xc8f4e6['query'],_0x30549e[_0xd373('0x37')]));if(_0xc8f4e6[_0xd373('0x35')][_0xd373('0x42')]){_0x5621d8[_0xd373('0x40')]=_[_0xd373('0x43')](_0x5621d8[_0xd373('0x40')],{'$or':_[_0xd373('0x2f')](_0x5621d8[_0xd373('0x39')],function(_0x3cc904){var _0x6e6c7e={};_0x6e6c7e[_0x3cc904]={'$like':'%'+_0xc8f4e6[_0xd373('0x35')]['filter']+'%'};return _0x6e6c7e;})});}_0x5621d8=_['merge']({},_0x5621d8,_0xc8f4e6[_0xd373('0x45')]);return _0x633ba0[_0xd373('0x7b')](_0x5621d8);}})['then'](function(_0x3785b7){if(_0x3785b7){_0xa854a2=_0x3785b7[_0xd373('0x3b')];if(!_0xc8f4e6[_0xd373('0x35')][_0xd373('0x3c')](_0xd373('0x3d'))){_0x5621d8[_0xd373('0x1f')]=qs['limit'](_0xc8f4e6[_0xd373('0x35')][_0xd373('0x1f')]);_0x5621d8[_0xd373('0x1e')]=qs['offset'](_0xc8f4e6[_0xd373('0x35')][_0xd373('0x1e')]);}return _0x633ba0[_0xd373('0x7b')](_0x5621d8);}})['then'](function(_0x6463cd){if(_0x6463cd){return _0x6463cd?{'count':_0xa854a2,'rows':_0x6463cd}:null;}})[_0xd373('0x27')](respondWithResult(_0x5c951e,null))['catch'](handleError(_0x5c951e,null));};exports[_0xd373('0x7d')]=function(_0x2da0cd,_0x48624a,_0x316348){var _0x48ee3b=_0x2da0cd[_0xd373('0x51')][_0xd373('0x73')];var _0x3b6ba5;return db['Team']['findAll']({'where':{'id':_0x48ee3b},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd373('0x7e'),'attributes':['id','name',_0xd373('0x7f'),_0xd373('0x80'),'interface'],'raw':!![]}]})[_0xd373('0x27')](function(_0x5be460){if(_0x5be460){_0x3b6ba5=_0x5be460;var _0x449d06=_[_0xd373('0x81')](_0x5be460,function(_0x15eb3d){var _0x1031eb=_0x15eb3d[_0xd373('0x29')]({'plain':!![]});return _0x1031eb[_0xd373('0x7e')];});return db['VoicePrefix'][_0xd373('0x4c')]({'where':{'id':_0x2da0cd['params']['id']}})[_0xd373('0x27')](function(_0x41faec){return db[_0xd373('0x4f')][_0xd373('0x50')](function(_0x39606d){return _0x41faec[_0xd373('0x7d')](_0x48ee3b,{'transaction':_0x39606d})['then'](function(){return BPromise[_0xd373('0x82')](_0x3b6ba5,function(_0x424a53){return db[_0xd373('0x83')]['upsert']({'TeamId':_0x424a53['id'],'VoicePrefixId':_0x2da0cd[_0xd373('0x4b')]['id']},{'transaction':_0x39606d});});})[_0xd373('0x27')](function(){return BPromise[_0xd373('0x82')](_0x449d06,function(_0x2f1dc0){return db[_0xd373('0x84')][_0xd373('0x85')]({'where':{'UserId':_0x2f1dc0['id'],'VoicePrefixId':_0x2da0cd['params']['id']},'transaction':_0x39606d});});})[_0xd373('0x27')](function(){_0x449d06['forEach'](function(_0x447ea9){socket[_0xd373('0x75')](_0xd373('0x86'),{'UserId':_0x447ea9['id'],'VoicePrefixId':_0x41faec['id']});});});});});}})[_0xd373('0x27')](respondWithStatusCode(_0x48624a,null))['catch'](handleError(_0x48624a,null));};exports['removeTeams']=function(_0x22e0bd,_0x44fbef,_0x3c9e20){return db[_0xd373('0x7c')][_0xd373('0x48')]({'where':{'id':_0x22e0bd[_0xd373('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd373('0x7a')],'as':_0xd373('0x7e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x44fbef,null))[_0xd373('0x27')](function(_0x2225b2){var _0x2d5326=_['map'](_0x2225b2,'id');var _0x259610=[];var _0x747622=[];var _0x5233a2=squel['select']();_0x5233a2[_0xd373('0x87')](_0xd373('0x88'))[_0xd373('0x89')](_0xd373('0x8a'),'tq')[_0xd373('0x8b')](_0xd373('0x8c'),'ut',_0xd373('0x8d'))['where'](_0xd373('0x8e'),_0x22e0bd[_0xd373('0x4b')]['id']);for(var _0x11e4a9=0x0;_0x11e4a9<_0x2225b2[_0xd373('0x3b')];_0x11e4a9+=0x1){let _0x7b49b6=_0x2225b2[_0x11e4a9];for(var _0x4d9ab3=0x0;_0x4d9ab3<_0x7b49b6[_0xd373('0x7e')][_0xd373('0x3b')];_0x4d9ab3+=0x1){let _0x4c924d=_0x7b49b6[_0xd373('0x7e')][_0x4d9ab3];var _0x494de8=_0x5233a2[_0xd373('0x8f')]();_0x494de8[_0xd373('0x40')](_0xd373('0x90'),_0x4c924d['id']);_0x747622[_0xd373('0x67')](db[_0xd373('0x4f')][_0xd373('0x35')](_0x494de8[_0xd373('0x91')](),{'type':db[_0xd373('0x4f')]['QueryTypes'][_0xd373('0x92')]})[_0xd373('0x27')](function(_0x13b085){if(_0x13b085[_0xd373('0x3b')]===0x1){return _0x4c924d['id'];}else{var _0x392bd2=_[_0xd373('0x93')](_['map'](_0x13b085,_0xd373('0x94')),function(_0x10ac87){return _[_0xd373('0x95')](_0x2d5326,_0x10ac87);});if(_0x392bd2){return _0x4c924d['id'];}}}));}}return BPromise[_0xd373('0x96')](_0x747622)[_0xd373('0x27')](function(_0x20fa2e){_0x259610=_(_0x259610)[_0xd373('0x97')](_0x20fa2e)[_0xd373('0x98')]()[_0xd373('0x99')]();return db['VoicePrefix'][_0xd373('0x4c')]({'where':{'id':_0x22e0bd[_0xd373('0x4b')]['id']}})[_0xd373('0x27')](function(_0x536c81){return db[_0xd373('0x4f')]['transaction'](function(_0x4ca4f9){return _0x536c81[_0xd373('0x9a')](_0x22e0bd['query'][_0xd373('0x73')],{'transaction':_0x4ca4f9})['then'](function(){if(!_['isEmpty'](_0x259610)){return _0x536c81['removeAgents'](_0x259610,{'transaction':_0x4ca4f9});}})['then'](function(){_0x259610['forEach'](function(_0x1de658){socket[_0xd373('0x75')](_0xd373('0x77'),{'UserId':_0x1de658,'VoicePrefixId':_0x536c81['id']});});});});});});})[_0xd373('0x27')](respondWithStatusCode(_0x44fbef,null))['catch'](handleError(_0x44fbef,null));}; \ No newline at end of file +var _0xb10b=['redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','pick','filter','where','type','VIRTUAL','merge','options','catch','show','params','fields','includeAll','find','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','prefix','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','transaction','addAgents','omit','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','order','getTeams','Team','nolimit','addTeams','User','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xb10b,0x12a));var _0xbb10=function(_0x77cbc3,_0x3f2d07){_0x77cbc3=_0x77cbc3-0x0;var _0x263ee5=_0xb10b[_0x77cbc3];return _0x263ee5;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config['redis']));require(_0xbb10('0x1c'))[_0xbb10('0x1d')](socket);function respondWithStatusCode(_0x45b9d6,_0x17fd46){_0x17fd46=_0x17fd46||0xcc;return function(_0x3df17b){if(_0x3df17b){return _0x45b9d6[_0xbb10('0x1e')](_0x17fd46);}return _0x45b9d6[_0xbb10('0x1f')](_0x17fd46)[_0xbb10('0x20')]();};}function respondWithResult(_0x3e26f4,_0x2b184e){_0x2b184e=_0x2b184e||0xc8;return function(_0x4a2bfc){if(_0x4a2bfc){return _0x3e26f4[_0xbb10('0x1f')](_0x2b184e)[_0xbb10('0x21')](_0x4a2bfc);}};}function respondWithFilteredResult(_0x133ac2,_0x42db98){return function(_0x378da8){if(_0x378da8){var _0x1682a4=typeof _0x42db98[_0xbb10('0x22')]===_0xbb10('0x23')&&typeof _0x42db98[_0xbb10('0x24')]===_0xbb10('0x23');var _0x48b6e9=_0x378da8[_0xbb10('0x25')];var _0x19f48d=_0x1682a4?0x0:_0x42db98[_0xbb10('0x22')];var _0x109908=_0x1682a4?_0x378da8[_0xbb10('0x25')]:_0x42db98[_0xbb10('0x22')]+_0x42db98['limit'];var _0x12f888;if(_0x109908>=_0x48b6e9){_0x109908=_0x48b6e9;_0x12f888=0xc8;}else{_0x12f888=0xce;}_0x133ac2[_0xbb10('0x1f')](_0x12f888);return _0x133ac2['set']('Content-Range',_0x19f48d+'-'+_0x109908+'/'+_0x48b6e9)[_0xbb10('0x21')](_0x378da8);}return null;};}function patchUpdates(_0x311abe){return function(_0x2e911d){try{jsonpatch[_0xbb10('0x26')](_0x2e911d,_0x311abe,!![]);}catch(_0x445761){return BPromise[_0xbb10('0x27')](_0x445761);}return _0x2e911d[_0xbb10('0x28')]();};}function saveUpdates(_0x436104,_0x7f2377){return function(_0x395404){if(_0x395404){return _0x395404[_0xbb10('0x29')](_0x436104)[_0xbb10('0x2a')](function(_0x537898){return _0x537898;});}return null;};}function removeEntity(_0x4fedac,_0x4fb5e0){return function(_0xc93a04){if(_0xc93a04){return _0xc93a04[_0xbb10('0x2b')]()[_0xbb10('0x2a')](function(){var _0x4e25ff=_0xc93a04[_0xbb10('0x2c')]({'plain':!![]});var _0x24d586=_0xbb10('0x2d');return db[_0xbb10('0x2e')][_0xbb10('0x2b')]({'where':{'type':_0x24d586,'resourceId':_0x4e25ff['id']}})[_0xbb10('0x2a')](function(){return _0xc93a04;});})[_0xbb10('0x2a')](function(){_0x4fedac['status'](0xcc)[_0xbb10('0x20')]();});}};}function handleEntityNotFound(_0x21ac54,_0xfc3595){return function(_0x2e0249){if(!_0x2e0249){_0x21ac54[_0xbb10('0x1e')](0x194);}return _0x2e0249;};}function handleError(_0x2ff4c1,_0x5d5c80){_0x5d5c80=_0x5d5c80||0x1f4;return function(_0x221624){logger['error'](_0x221624[_0xbb10('0x2f')]);if(_0x221624['name']){delete _0x221624[_0xbb10('0x30')];}_0x2ff4c1[_0xbb10('0x1f')](_0x5d5c80)[_0xbb10('0x31')](_0x221624);};}exports['index']=function(_0x518d47,_0x4c3744){var _0x34f65e={},_0x4f590d={},_0x359ad4={'count':0x0,'rows':[]};var _0x37dde7=_[_0xbb10('0x32')](db[_0xbb10('0x33')][_0xbb10('0x34')],function(_0x138bc6){return{'name':_0x138bc6[_0xbb10('0x35')],'type':_0x138bc6['type'][_0xbb10('0x36')]};});_0x4f590d[_0xbb10('0x37')]=_[_0xbb10('0x32')](_0x37dde7,_0xbb10('0x30'));_0x4f590d[_0xbb10('0x38')]=_[_0xbb10('0x39')](_0x518d47[_0xbb10('0x38')]);_0x4f590d[_0xbb10('0x3a')]=_[_0xbb10('0x3b')](_0x4f590d['model'],_0x4f590d[_0xbb10('0x38')]);_0x34f65e[_0xbb10('0x3c')]=_[_0xbb10('0x3b')](_0x4f590d[_0xbb10('0x37')],qs['fields'](_0x518d47[_0xbb10('0x38')]['fields']));_0x34f65e['attributes']=_0x34f65e[_0xbb10('0x3c')][_0xbb10('0x3d')]?_0x34f65e[_0xbb10('0x3c')]:_0x4f590d[_0xbb10('0x37')];if(!_0x518d47[_0xbb10('0x38')][_0xbb10('0x3e')]('nolimit')){_0x34f65e[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x518d47['query']['limit']);_0x34f65e['offset']=qs[_0xbb10('0x22')](_0x518d47[_0xbb10('0x38')][_0xbb10('0x22')]);}_0x34f65e['order']=qs[_0xbb10('0x3f')](_0x518d47[_0xbb10('0x38')][_0xbb10('0x3f')]);_0x34f65e['where']=qs[_0xbb10('0x3a')](_[_0xbb10('0x40')](_0x518d47[_0xbb10('0x38')],_0x4f590d[_0xbb10('0x3a')]),_0x37dde7);if(_0x518d47['query'][_0xbb10('0x41')]){_0x34f65e[_0xbb10('0x42')]=_['merge'](_0x34f65e[_0xbb10('0x42')],{'$or':_[_0xbb10('0x32')](_0x37dde7,function(_0x44d6ae){if(_0x44d6ae[_0xbb10('0x43')]!==_0xbb10('0x44')){var _0x185a52={};_0x185a52[_0x44d6ae['name']]={'$like':'%'+_0x518d47[_0xbb10('0x38')][_0xbb10('0x41')]+'%'};return _0x185a52;}})});}_0x34f65e=_[_0xbb10('0x45')]({},_0x34f65e,_0x518d47[_0xbb10('0x46')]);var _0x4943d9={'where':_0x34f65e[_0xbb10('0x42')]};return db[_0xbb10('0x33')][_0xbb10('0x25')](_0x4943d9)[_0xbb10('0x2a')](function(_0x5e2cfa){_0x359ad4[_0xbb10('0x25')]=_0x5e2cfa;if(_0x518d47[_0xbb10('0x38')]['includeAll']){_0x34f65e['include']=[{'all':!![]}];}return db[_0xbb10('0x33')]['findAll'](_0x34f65e);})[_0xbb10('0x2a')](function(_0x180933){_0x359ad4['rows']=_0x180933;return _0x359ad4;})[_0xbb10('0x2a')](respondWithFilteredResult(_0x4c3744,_0x34f65e))[_0xbb10('0x47')](handleError(_0x4c3744,null));};exports[_0xbb10('0x48')]=function(_0x5cf4f8,_0x2dd02b){var _0xebd70c={'raw':![],'where':{'id':_0x5cf4f8[_0xbb10('0x49')]['id']}},_0x3b9fdf={};_0x3b9fdf[_0xbb10('0x37')]=_[_0xbb10('0x39')](db[_0xbb10('0x33')][_0xbb10('0x34')]);_0x3b9fdf[_0xbb10('0x38')]=_[_0xbb10('0x39')](_0x5cf4f8[_0xbb10('0x38')]);_0x3b9fdf[_0xbb10('0x3a')]=_['intersection'](_0x3b9fdf[_0xbb10('0x37')],_0x3b9fdf[_0xbb10('0x38')]);_0xebd70c['attributes']=_[_0xbb10('0x3b')](_0x3b9fdf[_0xbb10('0x37')],qs[_0xbb10('0x4a')](_0x5cf4f8[_0xbb10('0x38')][_0xbb10('0x4a')]));_0xebd70c[_0xbb10('0x3c')]=_0xebd70c[_0xbb10('0x3c')]['length']?_0xebd70c['attributes']:_0x3b9fdf[_0xbb10('0x37')];if(_0x5cf4f8[_0xbb10('0x38')][_0xbb10('0x4b')]){_0xebd70c['include']=[{'all':!![]}];}_0xebd70c=_['merge']({},_0xebd70c,_0x5cf4f8[_0xbb10('0x46')]);return db[_0xbb10('0x33')][_0xbb10('0x4c')](_0xebd70c)[_0xbb10('0x2a')](handleEntityNotFound(_0x2dd02b,null))[_0xbb10('0x2a')](respondWithResult(_0x2dd02b,null))[_0xbb10('0x47')](handleError(_0x2dd02b,null));};exports[_0xbb10('0x2b')]=function(_0x460788,_0x2626d8){return db[_0xbb10('0x33')]['find']({'where':{'id':_0x460788['params']['id']}})[_0xbb10('0x2a')](handleEntityNotFound(_0x2626d8,null))[_0xbb10('0x2a')](removeEntity(_0x2626d8,null))[_0xbb10('0x47')](handleError(_0x2626d8,null));};exports[_0xbb10('0x4d')]=function(_0x36aa7d,_0x440f9e){return db[_0xbb10('0x33')][_0xbb10('0x4d')]()[_0xbb10('0x2a')](respondWithResult(_0x440f9e,null))[_0xbb10('0x47')](handleError(_0x440f9e,null));};exports[_0xbb10('0x4e')]=function(_0x20e18a,_0x61e689){var _0x2e6fd9;return db[_0xbb10('0x4f')]['transaction'](function(_0x124052){return db['VoicePrefix'][_0xbb10('0x4e')](_0x20e18a[_0xbb10('0x50')],{'transaction':_0x124052})[_0xbb10('0x2a')](function(_0x3f27ce){_0x2e6fd9=_0x3f27ce[_0xbb10('0x2c')]({'plain':!![]});return db[_0xbb10('0x51')][_0xbb10('0x4c')]({'where':{'id':_0x2e6fd9[_0xbb10('0x52')]},'raw':!![]})[_0xbb10('0x2a')](function(_0x3d71e){return createVoicePrefixExtensions(_0x2e6fd9,_0x3d71e,_0x124052);});});})[_0xbb10('0x2a')](function(){var _0x1c2dce=_0x20e18a[_0xbb10('0x53')][_0xbb10('0x2c')]({'plain':!![]});if(!_0x1c2dce)throw new Error(_0xbb10('0x54'));if(_0x1c2dce['role']===_0xbb10('0x53')){var _0x466eb7=_0x2e6fd9;return db[_0xbb10('0x55')][_0xbb10('0x4c')]({'where':{'name':_0xbb10('0x2d'),'userProfileId':_0x1c2dce[_0xbb10('0x56')]},'raw':!![]})['then'](function(_0x120bda){if(_0x120bda&&_0x120bda[_0xbb10('0x57')]===0x0){return db[_0xbb10('0x2e')][_0xbb10('0x4e')]({'name':_0x466eb7[_0xbb10('0x30')],'resourceId':_0x466eb7['id'],'type':_0x120bda[_0xbb10('0x30')],'sectionId':_0x120bda['id']},{})[_0xbb10('0x2a')](function(){return _0x2e6fd9;});}else{return _0x2e6fd9;}})[_0xbb10('0x47')](function(_0x205e01){logger[_0xbb10('0x58')](_0xbb10('0x59'),_0x205e01);throw _0x205e01;});}return _0x2e6fd9;})[_0xbb10('0x2a')](respondWithResult(_0x61e689,null))[_0xbb10('0x47')](handleError(_0x61e689,null));};function Extension(_0x4e7fac,_0x4ea1a6,_0x16272d,_0x3e6338){this[_0xbb10('0x5a')]=_0xbb10('0x5b');this['exten']=_0x4e7fac;this['app']=_0x16272d;this[_0xbb10('0x43')]=_0xbb10('0x5c');this[_0xbb10('0x5d')]=_0xbb10('0x5e');this[_0xbb10('0x5f')]=_0x4ea1a6;this[_0xbb10('0x60')]=_0x3e6338;}function createVoicePrefixExtensions(_0x45c0dc,_0x4a5fb9,_0x117e84){return new BPromise(function(_0x216cff,_0x4917a5){var _0x5e03cb=new Extension(formatPrefixName(_0x45c0dc['prefix']),0x1,_0xbb10('0x61'),_0xbb10('0x62'));_0x5e03cb[_0xbb10('0x63')]=_0x45c0dc['id'];return db['VoiceExtension']['create'](_0x5e03cb,{'transaction':_0x117e84})['then'](function(_0x3ebc5f){var _0x249b33=_0x3ebc5f[_0xbb10('0x2c')]({'plain':!![]});var _0x4e9fbd=_[_0xbb10('0x32')](addVoicePrefixExtensions(_0x45c0dc,_0x4a5fb9),function(_0x13131c){_0x13131c['VoiceExtensionId']=_0x249b33['id'];_0x13131c['VoicePrefixId']=_0x45c0dc['id'];return _0x13131c;});return db[_0xbb10('0x51')][_0xbb10('0x64')](_0x4e9fbd,{'transaction':_0x117e84})[_0xbb10('0x2a')](function(_0x237246){if(!_0x237246){return _0x4917a5('Extensions\x20creation\x20failed');}else{return _0x216cff(_0x237246);}})[_0xbb10('0x47')](function(_0xec48ac){return _0x4917a5(_0xec48ac);});});;});};function addVoicePrefixExtensions(_0xa7179d,_0x5202d7){var _0x402a01=[];var _0x2f05bc=formatPrefixName(_0xa7179d[_0xbb10('0x65')]);_0x402a01['push'](new Extension(_0x2f05bc,0x2,_0xbb10('0x66'),_0xbb10('0x67')+_0xa7179d[_0xbb10('0x30')]));if(_0xa7179d[_0xbb10('0x68')]){_0x402a01['push'](new Extension(_0x2f05bc,0x3,_0xbb10('0x66'),_0xbb10('0x69')+_0xa7179d[_0xbb10('0x68')]));}else{_0x402a01[_0xbb10('0x6a')](new Extension(_0x2f05bc,0x3,'NoOp',_0xbb10('0x6b')));}_0x402a01[_0xbb10('0x6a')](new Extension(_0x2f05bc,0x4,_0xbb10('0x6c'),_0x5202d7[_0xbb10('0x5a')]+','+_0xbb10('0x6d')+(0x8+_0xa7179d[_0xbb10('0x30')][_0xbb10('0x3d')])+'}'+','+0x1));return _0x402a01;}function formatPrefixName(_0x4a30c5){var _0x4a13d7='_';for(var _0x5acd5e=0x0;_0x5acd5e<_0x4a30c5[_0xbb10('0x3d')];_0x5acd5e++){if(_0x4a30c5[_0xbb10('0x6e')](_0x5acd5e)=='-'){_0x4a13d7+=_0x4a30c5[_0xbb10('0x6e')](_0x5acd5e);}else{_0x4a13d7+='['+_0x4a30c5['charAt'](_0x5acd5e)+']';}}_0x4a13d7+='.';return _0x4a13d7;}exports['update']=function(_0x46f462,_0x1b11c0,_0xd9e743){var _0x3a9677=_0x46f462[_0xbb10('0x50')];_0x3a9677[_0xbb10('0x65')]='system-'+_0x3a9677[_0xbb10('0x30')]+'-';return db[_0xbb10('0x4f')][_0xbb10('0x6f')](function(_0x14f16b){return db[_0xbb10('0x33')]['update'](_0x3a9677,{'where':{'id':_0x3a9677['id']},'transaction':_0x14f16b})['then'](function(){return db['VoiceExtension'][_0xbb10('0x2b')]({'where':{'VoicePrefixId':_0x3a9677['id']},'transaction':_0x14f16b})[_0xbb10('0x2a')](function(){return db[_0xbb10('0x51')][_0xbb10('0x4c')]({'where':{'id':_0x3a9677[_0xbb10('0x52')]},'raw':!![]})[_0xbb10('0x2a')](function(_0x5d942d){return createVoicePrefixExtensions(_0x3a9677,_0x5d942d,_0x14f16b);});});});})[_0xbb10('0x2a')](function(){return db['VoicePrefix']['findById'](_0x3a9677['id']);})['then'](respondWithResult(_0x1b11c0,null))[_0xbb10('0x47')](handleError(_0x1b11c0,null));};exports[_0xbb10('0x70')]=function(_0x23b1d5,_0x108f99,_0x5ce94f){return db[_0xbb10('0x33')]['find']({'where':{'id':_0x23b1d5['params']['id']}})[_0xbb10('0x2a')](handleEntityNotFound(_0x108f99,null))[_0xbb10('0x2a')](function(_0x29529c){if(_0x29529c){return _0x29529c[_0xbb10('0x70')](_0x23b1d5[_0xbb10('0x50')]['ids'],_[_0xbb10('0x71')](_0x23b1d5[_0xbb10('0x50')],[_0xbb10('0x72'),'id'])||{})[_0xbb10('0x73')](function(_0x43cdb7){for(var _0x27f42f=0x0;_0x27f42f<_0x23b1d5[_0xbb10('0x50')]['ids'][_0xbb10('0x3d')];_0x27f42f+=0x1){socket[_0xbb10('0x74')](_0xbb10('0x75'),{'UserId':Number(_0x23b1d5[_0xbb10('0x50')][_0xbb10('0x72')][_0x27f42f]),'VoicePrefixId':Number(_0x23b1d5[_0xbb10('0x49')]['id'])});}return _0x43cdb7;});}})[_0xbb10('0x2a')](respondWithResult(_0x108f99,null))[_0xbb10('0x47')](handleError(_0x108f99,null));};exports['removeAgents']=function(_0x428146,_0x218690,_0x145baf){return db['VoicePrefix']['find']({'where':{'id':_0x428146['params']['id']}})[_0xbb10('0x2a')](handleEntityNotFound(_0x218690,null))['then'](function(_0x4e3d6a){if(_0x4e3d6a){return _0x4e3d6a[_0xbb10('0x76')](_0x428146[_0xbb10('0x38')][_0xbb10('0x72')])[_0xbb10('0x2a')](function(){if(_[_0xbb10('0x77')](_0x428146[_0xbb10('0x38')][_0xbb10('0x72')])){for(var _0x417304=0x0;_0x417304<_0x428146[_0xbb10('0x38')]['ids'][_0xbb10('0x3d')];_0x417304+=0x1){socket[_0xbb10('0x74')](_0xbb10('0x78'),{'UserId':Number(_0x428146[_0xbb10('0x38')]['ids'][_0x417304]),'VoicePrefixId':Number(_0x428146['params']['id'])});}}else{socket[_0xbb10('0x74')](_0xbb10('0x78'),{'UserId':Number(_0x428146[_0xbb10('0x38')][_0xbb10('0x72')]),'VoicePrefixId':Number(_0x428146['params']['id'])});}});}})[_0xbb10('0x2a')](respondWithStatusCode(_0x218690,null))[_0xbb10('0x47')](handleError(_0x218690,null));};exports[_0xbb10('0x79')]=function(_0xf7b3e1,_0x35c1e8,_0x517185){var _0x5f0691={};var _0x372636={};var _0x53c698;var _0x22c030;return db['VoicePrefix'][_0xbb10('0x7a')]({'where':{'id':_0xf7b3e1[_0xbb10('0x49')]['id']}})['then'](handleEntityNotFound(_0x35c1e8,null))['then'](function(_0x2f667f){if(_0x2f667f){_0x53c698=_0x2f667f;_0x372636[_0xbb10('0x37')]=_[_0xbb10('0x39')](db['User'][_0xbb10('0x34')]);_0x372636[_0xbb10('0x38')]=_[_0xbb10('0x39')](_0xf7b3e1[_0xbb10('0x38')]);_0x372636[_0xbb10('0x3a')]=_[_0xbb10('0x3b')](_0x372636[_0xbb10('0x37')],_0x372636[_0xbb10('0x38')]);_0x5f0691[_0xbb10('0x3c')]=_['intersection'](_0x372636[_0xbb10('0x37')],qs[_0xbb10('0x4a')](_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x4a')]));_0x5f0691[_0xbb10('0x3c')]=_0x5f0691[_0xbb10('0x3c')][_0xbb10('0x3d')]?_0x5f0691[_0xbb10('0x3c')]:_0x372636[_0xbb10('0x37')];_0x5f0691[_0xbb10('0x7b')]=qs[_0xbb10('0x3f')](_0xf7b3e1[_0xbb10('0x38')]['sort']);_0x5f0691['where']=qs[_0xbb10('0x3a')](_[_0xbb10('0x40')](_0xf7b3e1[_0xbb10('0x38')],_0x372636[_0xbb10('0x3a')]));if(_0xf7b3e1[_0xbb10('0x38')]['filter']){_0x5f0691[_0xbb10('0x42')]=_[_0xbb10('0x45')](_0x5f0691[_0xbb10('0x42')],{'$or':_[_0xbb10('0x32')](_0x5f0691[_0xbb10('0x3c')],function(_0x379d49){var _0x546db5={};_0x546db5[_0x379d49]={'$like':'%'+_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x41')]+'%'};return _0x546db5;})});}_0x5f0691=_['merge']({},_0x5f0691,_0xf7b3e1[_0xbb10('0x46')]);return _0x53c698['getAgents'](_0x5f0691);}})[_0xbb10('0x2a')](function(_0x28bd76){if(_0x28bd76){_0x22c030=_0x28bd76[_0xbb10('0x3d')];if(!_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x3e')]('nolimit')){_0x5f0691[_0xbb10('0x24')]=qs['limit'](_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x24')]);_0x5f0691['offset']=qs['offset'](_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x22')]);}return _0x53c698[_0xbb10('0x79')](_0x5f0691);}})[_0xbb10('0x2a')](function(_0x18d18d){if(_0x18d18d){return _0x18d18d?{'count':_0x22c030,'rows':_0x18d18d}:null;}})[_0xbb10('0x2a')](respondWithResult(_0x35c1e8,null))[_0xbb10('0x47')](handleError(_0x35c1e8,null));};exports[_0xbb10('0x7c')]=function(_0x252ab8,_0xbccd46,_0x2bf9dd){var _0x4c0b83={};var _0x2b9a50={};var _0x3eeceb;var _0x1b0a6c;return db[_0xbb10('0x33')][_0xbb10('0x7a')]({'where':{'id':_0x252ab8[_0xbb10('0x49')]['id']}})[_0xbb10('0x2a')](handleEntityNotFound(_0xbccd46,null))[_0xbb10('0x2a')](function(_0x3e6fe2){if(_0x3e6fe2){_0x3eeceb=_0x3e6fe2;_0x2b9a50[_0xbb10('0x37')]=_[_0xbb10('0x39')](db[_0xbb10('0x7d')]['rawAttributes']);_0x2b9a50[_0xbb10('0x38')]=_['keys'](_0x252ab8[_0xbb10('0x38')]);_0x2b9a50[_0xbb10('0x3a')]=_[_0xbb10('0x3b')](_0x2b9a50[_0xbb10('0x37')],_0x2b9a50[_0xbb10('0x38')]);_0x4c0b83['attributes']=_[_0xbb10('0x3b')](_0x2b9a50[_0xbb10('0x37')],qs[_0xbb10('0x4a')](_0x252ab8[_0xbb10('0x38')][_0xbb10('0x4a')]));_0x4c0b83[_0xbb10('0x3c')]=_0x4c0b83['attributes']['length']?_0x4c0b83[_0xbb10('0x3c')]:_0x2b9a50[_0xbb10('0x37')];_0x4c0b83[_0xbb10('0x7b')]=qs['sort'](_0x252ab8[_0xbb10('0x38')][_0xbb10('0x3f')]);_0x4c0b83['where']=qs[_0xbb10('0x3a')](_[_0xbb10('0x40')](_0x252ab8['query'],_0x2b9a50[_0xbb10('0x3a')]));if(_0x252ab8['query'][_0xbb10('0x41')]){_0x4c0b83[_0xbb10('0x42')]=_['merge'](_0x4c0b83[_0xbb10('0x42')],{'$or':_[_0xbb10('0x32')](_0x4c0b83['attributes'],function(_0x5dae56){var _0xea6bf2={};_0xea6bf2[_0x5dae56]={'$like':'%'+_0x252ab8[_0xbb10('0x38')][_0xbb10('0x41')]+'%'};return _0xea6bf2;})});}_0x4c0b83=_[_0xbb10('0x45')]({},_0x4c0b83,_0x252ab8[_0xbb10('0x46')]);return _0x3eeceb['getTeams'](_0x4c0b83);}})[_0xbb10('0x2a')](function(_0x9f2e0f){if(_0x9f2e0f){_0x1b0a6c=_0x9f2e0f[_0xbb10('0x3d')];if(!_0x252ab8['query'][_0xbb10('0x3e')](_0xbb10('0x7e'))){_0x4c0b83[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x252ab8[_0xbb10('0x38')][_0xbb10('0x24')]);_0x4c0b83[_0xbb10('0x22')]=qs[_0xbb10('0x22')](_0x252ab8[_0xbb10('0x38')]['offset']);}return _0x3eeceb['getTeams'](_0x4c0b83);}})[_0xbb10('0x2a')](function(_0xe7238b){if(_0xe7238b){return _0xe7238b?{'count':_0x1b0a6c,'rows':_0xe7238b}:null;}})[_0xbb10('0x2a')](respondWithResult(_0xbccd46,null))[_0xbb10('0x47')](handleError(_0xbccd46,null));};exports[_0xbb10('0x7f')]=function(_0x363b81,_0x1cccec,_0x1674f7){var _0x3ede66=_0x363b81[_0xbb10('0x50')][_0xbb10('0x72')];var _0x167734;return db[_0xbb10('0x7d')]['findAll']({'where':{'id':_0x3ede66},'attributes':['id'],'include':[{'model':db[_0xbb10('0x80')],'as':_0xbb10('0x81'),'attributes':['id',_0xbb10('0x30'),_0xbb10('0x82'),_0xbb10('0x83'),_0xbb10('0x84')],'raw':!![]}]})[_0xbb10('0x2a')](function(_0x1421e2){if(_0x1421e2){_0x167734=_0x1421e2;var _0x3c6c45=_[_0xbb10('0x85')](_0x1421e2,function(_0x2a1c53){var _0x57f4a3=_0x2a1c53[_0xbb10('0x2c')]({'plain':!![]});return _0x57f4a3['Agents'];});return db[_0xbb10('0x33')][_0xbb10('0x4c')]({'where':{'id':_0x363b81[_0xbb10('0x49')]['id']}})[_0xbb10('0x2a')](function(_0x2b6e27){return db[_0xbb10('0x4f')]['transaction'](function(_0x2d8a25){return _0x2b6e27['addTeams'](_0x3ede66,{'transaction':_0x2d8a25})[_0xbb10('0x2a')](function(){return BPromise[_0xbb10('0x86')](_0x167734,function(_0xda122){return db[_0xbb10('0x87')][_0xbb10('0x88')]({'TeamId':_0xda122['id'],'VoicePrefixId':_0x363b81[_0xbb10('0x49')]['id']},{'transaction':_0x2d8a25});});})[_0xbb10('0x2a')](function(){return BPromise[_0xbb10('0x86')](_0x3c6c45,function(_0x25c5b2){return db[_0xbb10('0x89')][_0xbb10('0x8a')]({'where':{'UserId':_0x25c5b2['id'],'VoicePrefixId':_0x363b81[_0xbb10('0x49')]['id']},'transaction':_0x2d8a25});});})['then'](function(){_0x3c6c45[_0xbb10('0x8b')](function(_0x516520){socket[_0xbb10('0x74')](_0xbb10('0x75'),{'UserId':_0x516520['id'],'VoicePrefixId':_0x2b6e27['id']});});});});});}})[_0xbb10('0x2a')](respondWithStatusCode(_0x1cccec,null))[_0xbb10('0x47')](handleError(_0x1cccec,null));};exports[_0xbb10('0x8c')]=function(_0x40271f,_0x185ec9,_0x5e9888){return db[_0xbb10('0x7d')]['findAll']({'where':{'id':_0x40271f['query'][_0xbb10('0x72')]},'attributes':['id'],'include':[{'model':db[_0xbb10('0x80')],'as':_0xbb10('0x81'),'attributes':['id'],'raw':!![]}]})[_0xbb10('0x2a')](handleEntityNotFound(_0x185ec9,null))[_0xbb10('0x2a')](function(_0x16b8c1){var _0x5d1077=_[_0xbb10('0x32')](_0x16b8c1,'id');var _0x2c25ab=[];var _0x39aa9e=[];var _0xb1b7c8=squel[_0xbb10('0x8d')]();_0xb1b7c8[_0xbb10('0x8e')]('tq.TeamId')[_0xbb10('0x8f')](_0xbb10('0x90'),'tq')[_0xbb10('0x91')](_0xbb10('0x92'),'ut',_0xbb10('0x93'))[_0xbb10('0x42')](_0xbb10('0x94'),_0x40271f['params']['id']);for(var _0x33a43e=0x0;_0x33a43e<_0x16b8c1['length'];_0x33a43e+=0x1){let _0x3afbcf=_0x16b8c1[_0x33a43e];for(var _0x4a6660=0x0;_0x4a6660<_0x3afbcf['Agents'][_0xbb10('0x3d')];_0x4a6660+=0x1){let _0x225064=_0x3afbcf[_0xbb10('0x81')][_0x4a6660];var _0x3b7552=_0xb1b7c8[_0xbb10('0x95')]();_0x3b7552['where'](_0xbb10('0x96'),_0x225064['id']);_0x39aa9e['push'](db['sequelize']['query'](_0x3b7552[_0xbb10('0x97')](),{'type':db[_0xbb10('0x4f')][_0xbb10('0x98')][_0xbb10('0x99')]})[_0xbb10('0x2a')](function(_0x5abedf){if(_0x5abedf[_0xbb10('0x3d')]===0x1){return _0x225064['id'];}else{var _0x42a2d7=_[_0xbb10('0x9a')](_[_0xbb10('0x32')](_0x5abedf,_0xbb10('0x9b')),function(_0x37ff15){return _[_0xbb10('0x9c')](_0x5d1077,_0x37ff15);});if(_0x42a2d7){return _0x225064['id'];}}}));}}return BPromise['all'](_0x39aa9e)['then'](function(_0x584a62){_0x2c25ab=_(_0x2c25ab)[_0xbb10('0x9d')](_0x584a62)[_0xbb10('0x9e')]()[_0xbb10('0x9f')]();return db[_0xbb10('0x33')][_0xbb10('0x4c')]({'where':{'id':_0x40271f[_0xbb10('0x49')]['id']}})[_0xbb10('0x2a')](function(_0x423628){return db[_0xbb10('0x4f')][_0xbb10('0x6f')](function(_0x4cc8d4){return _0x423628['removeTeams'](_0x40271f['query'][_0xbb10('0x72')],{'transaction':_0x4cc8d4})[_0xbb10('0x2a')](function(){if(!_[_0xbb10('0xa0')](_0x2c25ab)){return _0x423628['removeAgents'](_0x2c25ab,{'transaction':_0x4cc8d4});}})[_0xbb10('0x2a')](function(){_0x2c25ab[_0xbb10('0x8b')](function(_0x2c638d){socket[_0xbb10('0x74')](_0xbb10('0x78'),{'UserId':_0x2c638d,'VoicePrefixId':_0x423628['id']});});});});});});})[_0xbb10('0x2a')](respondWithStatusCode(_0x185ec9,null))['catch'](handleError(_0x185ec9,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 0b28864..e5604f2 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 _0x2104=['hasOwnProperty','hook','exports','events','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x1ff261,_0x3a4a63){var _0x54fb32=function(_0x26a50b){while(--_0x26a50b){_0x1ff261['push'](_0x1ff261['shift']());}};_0x54fb32(++_0x3a4a63);}(_0x2104,0x1bb));var _0x4210=function(_0xe7281f,_0x2d77c3){_0xe7281f=_0xe7281f-0x0;var _0x90dc99=_0x2104[_0xe7281f];return _0x90dc99;};'use strict';var EventEmitter=require(_0x4210('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x4210('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4210('0x2')](0x0);var events={'afterCreate':_0x4210('0x3'),'afterUpdate':_0x4210('0x4'),'afterDestroy':_0x4210('0x5')};function emitEvent(_0x307070){return function(_0xc4ca36,_0x8d835e,_0x72b6d4){VoicePrefixEvents[_0x4210('0x6')](_0x307070+':'+_0xc4ca36['id'],_0xc4ca36);VoicePrefixEvents[_0x4210('0x6')](_0x307070,_0xc4ca36);_0x72b6d4(null);};}for(var e in events){if(events[_0x4210('0x7')](e)){var event=events[e];VoicePrefix[_0x4210('0x8')](e,emitEvent(event));}}module[_0x4210('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x9814=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoicePrefix'];(function(_0x3a676f,_0x27ed85){var _0x572071=function(_0x3ce3b3){while(--_0x3ce3b3){_0x3a676f['push'](_0x3a676f['shift']());}};_0x572071(++_0x27ed85);}(_0x9814,0xe8));var _0x4981=function(_0x6f980b,_0x2a6660){_0x6f980b=_0x6f980b-0x0;var _0x5a6bb7=_0x9814[_0x6f980b];return _0x5a6bb7;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x4981('0x0'))['db'][_0x4981('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4981('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4981('0x3'),'afterDestroy':_0x4981('0x4')};function emitEvent(_0x4f1179){return function(_0x409b5b,_0xfa40af,_0x483175){VoicePrefixEvents[_0x4981('0x5')](_0x4f1179+':'+_0x409b5b['id'],_0x409b5b);VoicePrefixEvents[_0x4981('0x5')](_0x4f1179,_0x409b5b);_0x483175(null);};}for(var e in events){if(events[_0x4981('0x6')](e)){var event=events[e];VoicePrefix[_0x4981('0x7')](e,emitEvent(event));}}module[_0x4981('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index dd68aed..4cafeef 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 _0x7649=['./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xe55553,_0x3222b2){var _0x346308=function(_0x14e36f){while(--_0x14e36f){_0xe55553['push'](_0xe55553['shift']());}};_0x346308(++_0x3222b2);}(_0x7649,0x1b2));var _0x9764=function(_0x3262e7,_0xae980f){_0x3262e7=_0x3262e7-0x0;var _0x297196=_0x7649[_0x3262e7];return _0x297196;};'use strict';var _=require(_0x9764('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9764('0x1'));var BPromise=require('bluebird');var rp=require(_0x9764('0x2'));var fs=require('fs');var path=require(_0x9764('0x3'));var rimraf=require(_0x9764('0x4'));var config=require(_0x9764('0x5'));var attributes=require(_0x9764('0x6'));module[_0x9764('0x7')]=function(_0x14e89c,_0x36cb12){return _0x14e89c[_0x9764('0x8')](_0x9764('0x9'),attributes,{'tableName':_0x9764('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68ad=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes'];(function(_0x57cb1c,_0x6720b1){var _0x46801c=function(_0x326afa){while(--_0x326afa){_0x57cb1c['push'](_0x57cb1c['shift']());}};_0x46801c(++_0x6720b1);}(_0x68ad,0x8f));var _0xd68a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x68ad[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd68a('0x0'));var util=require('util');var logger=require(_0xd68a('0x1'))(_0xd68a('0x2'));var moment=require(_0xd68a('0x3'));var BPromise=require(_0xd68a('0x4'));var rp=require(_0xd68a('0x5'));var fs=require('fs');var path=require(_0xd68a('0x6'));var rimraf=require(_0xd68a('0x7'));var config=require('../../config/environment');var attributes=require(_0xd68a('0x8'));module[_0xd68a('0x9')]=function(_0x2887cd,_0x51691b){return _0x2887cd[_0xd68a('0xa')](_0xd68a('0xb'),attributes,{'tableName':_0xd68a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index cb44c71..a1299b2 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 _0x8b52=['http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x8b52,0x151));var _0x28b5=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8b52[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x28b5('0x0'));var util=require(_0x28b5('0x1'));var moment=require(_0x28b5('0x2'));var BPromise=require('bluebird');var rs=require(_0x28b5('0x3'));var fs=require('fs');var Redis=require(_0x28b5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x28b5('0x5'));var logger=require(_0x28b5('0x6'))(_0x28b5('0x7'));var config=require(_0x28b5('0x8'));var jayson=require(_0x28b5('0x9'));var client=jayson[_0x28b5('0xa')][_0x28b5('0xb')]({'port':0x232a});config[_0x28b5('0xc')]=_[_0x28b5('0xd')](config['redis'],{'host':_0x28b5('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x28b5('0xf'))[_0x28b5('0x10')](socket);function respondWithRpcPromise(_0x4f2a41,_0xd8f394,_0x315ed6){return new BPromise(function(_0x4d3d4e,_0x10d2b5){return client[_0x28b5('0x11')](_0x4f2a41,_0x315ed6)[_0x28b5('0x12')](function(_0x6b22a8){logger['info'](_0x28b5('0x13'),_0xd8f394,'request\x20sent');logger[_0x28b5('0x14')](_0x28b5('0x15'),_0xd8f394,'request\x20sent',JSON[_0x28b5('0x16')](_0x6b22a8));if(_0x6b22a8['error']){if(_0x6b22a8[_0x28b5('0x17')]['code']===0x1f4){logger['error'](_0x28b5('0x13'),_0xd8f394,_0x6b22a8[_0x28b5('0x17')]['message']);return _0x10d2b5(_0x6b22a8[_0x28b5('0x17')][_0x28b5('0x18')]);}logger[_0x28b5('0x17')](_0x28b5('0x13'),_0xd8f394,_0x6b22a8[_0x28b5('0x17')]['message']);return _0x4d3d4e(_0x6b22a8[_0x28b5('0x17')]['message']);}else{logger[_0x28b5('0x19')](_0x28b5('0x13'),_0xd8f394,_0x28b5('0x1a'));_0x4d3d4e(_0x6b22a8[_0x28b5('0x1b')]['message']);}})[_0x28b5('0x1c')](function(_0x1396cf){logger[_0x28b5('0x17')]('VoicePrefix,\x20%s,\x20%s',_0xd8f394,_0x1396cf);_0x10d2b5(_0x1396cf);});});} \ No newline at end of file +var _0x600f=['jayson/promise','client','http','defaults','localhost','redis','./voicePrefix.socket','register','request','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x600f,0xb4));var _0xf600=function(_0x237c45,_0x55cf99){_0x237c45=_0x237c45-0x0;var _0x2942f6=_0x600f[_0x237c45];return _0x2942f6;};'use strict';var _=require(_0xf600('0x0'));var util=require(_0xf600('0x1'));var moment=require(_0xf600('0x2'));var BPromise=require('bluebird');var rs=require(_0xf600('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf600('0x4'))['db'];var utils=require(_0xf600('0x5'));var logger=require(_0xf600('0x6'))(_0xf600('0x7'));var config=require(_0xf600('0x8'));var jayson=require(_0xf600('0x9'));var client=jayson[_0xf600('0xa')][_0xf600('0xb')]({'port':0x232a});config['redis']=_[_0xf600('0xc')](config['redis'],{'host':_0xf600('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf600('0xe')]));require(_0xf600('0xf'))[_0xf600('0x10')](socket);function respondWithRpcPromise(_0x3583db,_0x585840,_0x3c92d8){return new BPromise(function(_0x415018,_0x430e8e){return client[_0xf600('0x11')](_0x3583db,_0x3c92d8)['then'](function(_0x107180){logger['info'](_0xf600('0x12'),_0x585840,_0xf600('0x13'));logger[_0xf600('0x14')](_0xf600('0x15'),_0x585840,_0xf600('0x13'),JSON[_0xf600('0x16')](_0x107180));if(_0x107180[_0xf600('0x17')]){if(_0x107180[_0xf600('0x17')]['code']===0x1f4){logger[_0xf600('0x17')](_0xf600('0x12'),_0x585840,_0x107180[_0xf600('0x17')]['message']);return _0x430e8e(_0x107180[_0xf600('0x17')]['message']);}logger['error'](_0xf600('0x12'),_0x585840,_0x107180[_0xf600('0x17')][_0xf600('0x18')]);return _0x415018(_0x107180[_0xf600('0x17')][_0xf600('0x18')]);}else{logger['info'](_0xf600('0x12'),_0x585840,_0xf600('0x13'));_0x415018(_0x107180[_0xf600('0x19')][_0xf600('0x18')]);}})[_0xf600('0x1a')](function(_0x1caa85){logger[_0xf600('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x585840,_0x1caa85);_0x430e8e(_0x1caa85);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 8f9b3be..169c34c 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 _0x7382=['save','register','voicePrefix:'];(function(_0x282325,_0x225755){var _0x5e71e3=function(_0x283d60){while(--_0x283d60){_0x282325['push'](_0x282325['shift']());}};_0x5e71e3(++_0x225755);}(_0x7382,0x1f2));var _0x2738=function(_0x142fe0,_0x4452fb){_0x142fe0=_0x142fe0-0x0;var _0x800621=_0x7382[_0x142fe0];return _0x800621;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x2738('0x0'),'remove','update'];function createListener(_0x190aa6,_0x480143){return function(_0x250b3c){_0x480143['emit'](_0x190aa6,_0x250b3c);};}function removeListener(_0x402f25,_0x25ad1b){return function(){VoicePrefixEvents['removeListener'](_0x402f25,_0x25ad1b);};}exports[_0x2738('0x1')]=function(_0x267a1a){for(var _0x457c61=0x0,_0x1437b0=events['length'];_0x457c61<_0x1437b0;_0x457c61++){var _0x99e22e=events[_0x457c61];var _0x20a64f=createListener(_0x2738('0x2')+_0x99e22e,_0x267a1a);VoicePrefixEvents['on'](_0x99e22e,_0x20a64f);}}; \ No newline at end of file +var _0x92d7=['register','length','voicePrefix:','./voicePrefix.events','remove','update','emit','removeListener'];(function(_0x1c8333,_0x543ec9){var _0x2a2d2=function(_0x14da43){while(--_0x14da43){_0x1c8333['push'](_0x1c8333['shift']());}};_0x2a2d2(++_0x543ec9);}(_0x92d7,0x17b));var _0x792d=function(_0x584b55,_0x327e77){_0x584b55=_0x584b55-0x0;var _0x47b94a=_0x92d7[_0x584b55];return _0x47b94a;};'use strict';var VoicePrefixEvents=require(_0x792d('0x0'));var events=['save',_0x792d('0x1'),_0x792d('0x2')];function createListener(_0x27f06d,_0xed6481){return function(_0x46982d){_0xed6481[_0x792d('0x3')](_0x27f06d,_0x46982d);};}function removeListener(_0x1b7394,_0x1c052c){return function(){VoicePrefixEvents[_0x792d('0x4')](_0x1b7394,_0x1c052c);};}exports[_0x792d('0x5')]=function(_0x54374f){for(var _0x3e95c4=0x0,_0x238cab=events[_0x792d('0x6')];_0x3e95c4<_0x238cab;_0x3e95c4++){var _0x11240a=events[_0x3e95c4];var _0x56f730=createListener(_0x792d('0x7')+_0x11240a,_0x54374f);VoicePrefixEvents['on'](_0x11240a,_0x56f730);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 6ab1d0e..d849b37 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(_0x5807d4,_0x29306b){var _0x5ddf9b=function(_0x56476c){while(--_0x56476c){_0x5807d4['push'](_0x5807d4['shift']());}};_0x5ddf9b(++_0x29306b);}(_0xb10b,0x12a));var _0xbb10=function(_0x2486a4,_0x3e3650){_0x2486a4=_0x2486a4-0x0;var _0x14cf68=_0xb10b[_0x2486a4];return _0x14cf68;};'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 _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(_0x233cb1,_0x8ca9a2){var _0x29ee7e=function(_0x20e277){while(--_0x20e277){_0x233cb1['push'](_0x233cb1['shift']());}};_0x29ee7e(++_0x8ca9a2);}(_0xb10b,0x12a));var _0xbb10=function(_0x36bf88,_0x15c459){_0x36bf88=_0x36bf88-0x0;var _0x332914=_0xb10b[_0x36bf88];return _0x332914;};'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 diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 83faf21..d5cef0e 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 _0x9508=['#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','outbound','inbound','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','booked','roundrobin','progressive','power','INTEGER','yes','once','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','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)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length'];(function(_0x33bcdb,_0x11846b){var _0x18a9bf=function(_0x34417a){while(--_0x34417a){_0x33bcdb['push'](_0x33bcdb['shift']());}};_0x18a9bf(++_0x11846b);}(_0x9508,0xf3));var _0x8950=function(_0x16fe50,_0x4711bc){_0x16fe50=_0x16fe50-0x0;var _0x5e2370=_0x9508[_0x16fe50];return _0x5e2370;};'use strict';var Sequelize=require(_0x8950('0x0'));module[_0x8950('0x1')]={'name':{'type':Sequelize[_0x8950('0x2')],'allowNull':![],'unique':_0x8950('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8950('0x4')]('inbound',_0x8950('0x5')),'allowNull':![],'defaultValue':_0x8950('0x6')},'musiconhold':{'type':Sequelize[_0x8950('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x8950('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x8950('0x4')]('rr',_0x8950('0x7'),_0x8950('0x8'),_0x8950('0x9'),_0x8950('0xa'),_0x8950('0xb'),'linear',_0x8950('0xc'),_0x8950('0xd')),'allowNull':![],'defaultValue':_0x8950('0x7'),'set':function(_0x5cde08){this[_0x8950('0xe')](_0x8950('0xf'),_0x5cde08?_0x5cde08:_0x8950('0xb'));},'get':function(){var _0x4ef9e1=this[_0x8950('0x10')]('type');var _0x5afca5=this[_0x8950('0x10')](_0x8950('0x11'));var _0x28151e=this[_0x8950('0x10')]('strategy');if(_0x4ef9e1===_0x8950('0x6')){return _0x28151e;}if(_0x5afca5===_0x8950('0x12')&&_0x28151e===_0x8950('0xb')||_0x5afca5==='booked'&&_0x28151e===_0x8950('0x13')){return _0x28151e;}if(_0x5afca5===_0x8950('0x14')||_0x5afca5==='predictive'||_0x5afca5===_0x8950('0x15')){return _0x28151e;}return null;}},'servicelevel':{'type':Sequelize[_0x8950('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8950('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x8950('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x8950('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x8950('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8950('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x8950('0x4')](_0x8950('0x17'),'no'),'defaultValue':_0x8950('0x17')},'autopause':{'type':Sequelize['ENUM'](_0x8950('0x17'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x8950('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x8950('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x8950('0x4')](_0x8950('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8950('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x8950('0x4')](_0x8950('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x8950('0x4')](_0x8950('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8950('0x4')](_0x8950('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8950('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8950('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x8950('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x8950('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8950('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x8950('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8950('0x4')](_0x8950('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x8950('0x4')](_0x8950('0x17'),'no'),'defaultValue':_0x8950('0x17')},'announce_holdtime':{'type':Sequelize[_0x8950('0x4')](_0x8950('0x17'),'no',_0x8950('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x8950('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8950('0x4')](_0x8950('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8950('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x8950('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x8950('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x8950('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8950('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x8950('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x8950('0x2')]},'queue_quantity1':{'type':Sequelize[_0x8950('0x2')]},'queue_quantity2':{'type':Sequelize[_0x8950('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x2277c9){this[_0x8950('0xe')]('periodic_announce',_0x2277c9?_0x2277c9[_0x8950('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0x8950('0x1a'))?this[_0x8950('0x10')](_0x8950('0x1a'))[_0x8950('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x8950('0x2')],'defaultValue':_0x8950('0x17'),'set':function(_0x2be8e8){this[_0x8950('0xe')]('joinempty',_0x2be8e8?_0x2be8e8[_0x8950('0x19')](','):undefined);},'get':function(){return this[_0x8950('0x10')]('joinempty')?this[_0x8950('0x10')](_0x8950('0x1c'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x8950('0x2')],'defaultValue':'no','set':function(_0x5a45ce){this[_0x8950('0xe')]('leavewhenempty',_0x5a45ce?_0x5a45ce[_0x8950('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x8950('0x1d'))?this[_0x8950('0x10')](_0x8950('0x1d'))[_0x8950('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x8950('0x4')](_0x8950('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x8950('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x8950('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x8950('0x1e')],'defaultValue':0x0,'set':function(_0x297280){this[_0x8950('0xe')](_0x8950('0x1f'),_0x297280);if(_0x297280){if(this[_0x8950('0x10')](_0x8950('0x20'))<0x2){this[_0x8950('0xe')](_0x8950('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8950('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x8950('0x4')](_0x8950('0x21'),_0x8950('0x14'),'power',_0x8950('0x22'),_0x8950('0x12')),'defaultValue':_0x8950('0x14'),'comment':_0x8950('0x23')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x8950('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x8950('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8950('0x25')},'dialPowerLevel':{'type':Sequelize[_0x8950('0x26')](0x2)[_0x8950('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x8950('0x4')]('agentBusyFactor',_0x8950('0x27')),'defaultValue':_0x8950('0x27'),'comment':_0x8950('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x8950('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x8950('0x29')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x8950('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x8950('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8950('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8950('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x8950('0x16')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x8950('0x2')],'defaultValue':'tTxX','comment':_0x8950('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0x8950('0x16')](0x3)[_0x8950('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8950('0x2c')},'dialQueueProject':{'type':Sequelize[_0x8950('0x2')],'comment':_0x8950('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8950('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8950('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x8950('0x16')](0x3)[_0x8950('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x8950('0x16')](0x5)[_0x8950('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8950('0x2f')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8950('0x16')](0x3)[_0x8950('0x24')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8950('0x16')](0x5)[_0x8950('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8950('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x8950('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8950('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x8950('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x8950('0x30'),_0x8950('0x31')),'defaultValue':_0x8950('0x32')},'dialAMDActive':{'type':Sequelize[_0x8950('0x1e')],'defaultValue':0x0,'comment':_0x8950('0x33')},'dialAMDInitialSilence':{'type':Sequelize[_0x8950('0x16')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8950('0x34')},'dialAMDGreeting':{'type':Sequelize[_0x8950('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8950('0x35')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8950('0x16')](0x9)[_0x8950('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8950('0x36')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8950('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8950('0x37')},'dialAMDMinWordLength':{'type':Sequelize[_0x8950('0x16')](0x9)[_0x8950('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8950('0x38')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8950('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8950('0x39')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8950('0x16')](0x9)[_0x8950('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8950('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8950('0x16')](0x5)[_0x8950('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8950('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x8950('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x8950('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x8950('0x3c')},'dialRecallInQueue':{'type':Sequelize[_0x8950('0x1e')],'defaultValue':0x0,'comment':_0x8950('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x8950('0x3e')),'defaultValue':_0x8950('0x3f')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x8950('0x2d')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x8950('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8950('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8950('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x8950('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8950('0x16')](0x3)[_0x8950('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8950('0x16')](0x5)[_0x8950('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8950('0x40')},'dialDropMaxRetry':{'type':Sequelize[_0x8950('0x16')](0x3)[_0x8950('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x8950('0x16')](0x5)[_0x8950('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8950('0x41')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8950('0x16')](0x3)[_0x8950('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8950('0x16')](0x5)[_0x8950('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8950('0x42')},'dialMachineMaxRetry':{'type':Sequelize[_0x8950('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8950('0x43')},'dialMachineRetryFrequency':{'type':Sequelize[_0x8950('0x16')](0x5)[_0x8950('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8950('0x44')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8950('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8950('0x45')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8950('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8950('0x46')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x8950('0x47')},'mandatoryDisposition':{'type':Sequelize[_0x8950('0x1e')],'defaultValue':![],'comment':_0x8950('0x48'),'set':function(_0x1b6dca){if(!_0x1b6dca)this[_0x8950('0xe')](_0x8950('0x49'),null);this[_0x8950('0xe')](_0x8950('0x4a'),_0x1b6dca);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x8950('0x16')](0x3)[_0x8950('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x8950('0x16')](0x3)[_0x8950('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x8950('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x8950('0x16')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x8950('0x1e')],'defaultValue':![]}}; \ No newline at end of file +var _0xe93c=['FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\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)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','type','dialMethod','roundrobin','progressive','predictive','power','INTEGER','yes','all','join','periodic_announce','joinempty','split','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','booked','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xe93c,0xcf));var _0xce93=function(_0x3583ef,_0x3edc83){_0x3583ef=_0x3583ef-0x0;var _0x3c123c=_0xe93c[_0x3583ef];return _0x3c123c;};'use strict';var Sequelize=require(_0xce93('0x0'));module[_0xce93('0x1')]={'name':{'type':Sequelize[_0xce93('0x2')],'allowNull':![],'unique':_0xce93('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xce93('0x4')](_0xce93('0x5'),_0xce93('0x6')),'allowNull':![],'defaultValue':_0xce93('0x5')},'musiconhold':{'type':Sequelize[_0xce93('0x2')],'defaultValue':_0xce93('0x7')},'announce':{'type':Sequelize[_0xce93('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xce93('0x4')]('rr',_0xce93('0x8'),'leastrecent',_0xce93('0x9'),_0xce93('0xa'),_0xce93('0xb'),_0xce93('0xc'),_0xce93('0xd'),_0xce93('0xe')),'allowNull':![],'defaultValue':_0xce93('0x8'),'set':function(_0x30812d){this[_0xce93('0xf')]('strategy',_0x30812d?_0x30812d:_0xce93('0xb'));},'get':function(){var _0x4c66ad=this[_0xce93('0x10')](_0xce93('0x11'));var _0x163738=this['getDataValue'](_0xce93('0x12'));var _0x166aa7=this[_0xce93('0x10')]('strategy');if(_0x4c66ad===_0xce93('0x5')){return _0x166aa7;}if(_0x163738==='booked'&&_0x166aa7===_0xce93('0xb')||_0x163738==='booked'&&_0x166aa7===_0xce93('0x13')){return _0x166aa7;}if(_0x163738===_0xce93('0x14')||_0x163738===_0xce93('0x15')||_0x163738===_0xce93('0x16')){return _0x166aa7;}return null;}},'servicelevel':{'type':Sequelize[_0xce93('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xce93('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xce93('0x17')](0xb)},'timeout':{'type':Sequelize[_0xce93('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xce93('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xce93('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xce93('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xce93('0x4')]('yes','no'),'defaultValue':_0xce93('0x18')},'autopause':{'type':Sequelize[_0xce93('0x4')](_0xce93('0x18'),'no',_0xce93('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xce93('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0xce93('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xce93('0x4')](_0xce93('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xce93('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xce93('0x4')](_0xce93('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xce93('0x4')](_0xce93('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xce93('0x4')](_0xce93('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xce93('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xce93('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xce93('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xce93('0x4')](_0xce93('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xce93('0x4')](_0xce93('0x18'),'no'),'defaultValue':_0xce93('0x18')},'announce_holdtime':{'type':Sequelize[_0xce93('0x4')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xce93('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xce93('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xce93('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xce93('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xce93('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xce93('0x2')]},'queue_youarenext':{'type':Sequelize[_0xce93('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xce93('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xce93('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xce93('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xce93('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xce93('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xce93('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xce93('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xce93('0x2')]},'queue_less_than':{'type':Sequelize[_0xce93('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x47f53b){this[_0xce93('0xf')]('periodic_announce',_0x47f53b?_0x47f53b[_0xce93('0x1a')](','):[]);},'get':function(){return this[_0xce93('0x10')](_0xce93('0x1b'))?this[_0xce93('0x10')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0xce93('0x2')],'defaultValue':_0xce93('0x18'),'set':function(_0x2a5941){this[_0xce93('0xf')]('joinempty',_0x2a5941?_0x2a5941[_0xce93('0x1a')](','):undefined);},'get':function(){return this[_0xce93('0x10')](_0xce93('0x1c'))?this[_0xce93('0x10')](_0xce93('0x1c'))[_0xce93('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x4f95c5){this[_0xce93('0xf')]('leavewhenempty',_0x4f95c5?_0x4f95c5[_0xce93('0x1a')](','):undefined);},'get':function(){return this[_0xce93('0x10')]('leavewhenempty')?this[_0xce93('0x10')](_0xce93('0x1e'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xce93('0x4')](_0xce93('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xce93('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xce93('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xce93('0x4')](_0xce93('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xce93('0x2')]},'acw':{'type':Sequelize[_0xce93('0x1f')],'defaultValue':0x0,'set':function(_0x300c8f){this[_0xce93('0xf')]('acw',_0x300c8f);if(_0x300c8f){if(this['getDataValue'](_0xce93('0x20'))<0x2){this[_0xce93('0xf')](_0xce93('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xce93('0x21')},'dialMethod':{'type':Sequelize['ENUM']('preview',_0xce93('0x14'),'power',_0xce93('0x15'),_0xce93('0x22')),'defaultValue':_0xce93('0x14'),'comment':_0xce93('0x23')},'dialLimitChannel':{'type':Sequelize[_0xce93('0x17')](0x4)[_0xce93('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xce93('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xce93('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xce93('0x26')},'dialPowerLevel':{'type':Sequelize[_0xce93('0x27')](0x2)[_0xce93('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xce93('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0xce93('0x4')](_0xce93('0x29'),_0xce93('0x2a')),'defaultValue':'dropRate','comment':_0xce93('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xce93('0x27')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0xce93('0x17')](0x3)[_0xce93('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xce93('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xce93('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xce93('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xce93('0x2d'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xce93('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce93('0x2e')},'dialQueueProject':{'type':Sequelize[_0xce93('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xce93('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce93('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xce93('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce93('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0xce93('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce93('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0xce93('0x17')](0x5)[_0xce93('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce93('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xce93('0x24')],'defaultValue':0x3,'comment':_0xce93('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xce93('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce93('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0xce93('0x17')](0x3)[_0xce93('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xce93('0x35')},'dialTimezone':{'type':Sequelize[_0xce93('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xce93('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xce93('0x4')](_0xce93('0x36'),_0xce93('0x37'),_0xce93('0x38')),'defaultValue':_0xce93('0x36')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xce93('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0xce93('0x17')](0x9)[_0xce93('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xce93('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0xce93('0x17')](0x9)[_0xce93('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xce93('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xce93('0x17')](0x9)[_0xce93('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xce93('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xce93('0x17')](0x9)[_0xce93('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xce93('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0xce93('0x17')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xce93('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xce93('0x17')](0x9)[_0xce93('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xce93('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xce93('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xce93('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xce93('0x17')](0x5)[_0xce93('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xce93('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xce93('0x17')](0x9)[_0xce93('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xce93('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0xce93('0x17')](0x5)[_0xce93('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xce93('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xce93('0x4')](_0xce93('0x43'),_0xce93('0x44')),'defaultValue':_0xce93('0x43')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xce93('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xce93('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xce93('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xce93('0x45')},'dialCutDigit':{'type':Sequelize[_0xce93('0x17')](0x3)[_0xce93('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xce93('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xce93('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce93('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xce93('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce93('0x48')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xce93('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce93('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xce93('0x17')](0x3)[_0xce93('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce93('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xce93('0x17')](0x5)[_0xce93('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce93('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0xce93('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce93('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xce93('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce93('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xce93('0x17')](0x3)[_0xce93('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce93('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xce93('0x17')](0x5)[_0xce93('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xce93('0x17')],'allowNull':!![],'comment':_0xce93('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0xce93('0x1f')],'defaultValue':![],'comment':_0xce93('0x50'),'set':function(_0x369666){if(!_0x369666)this[_0xce93('0xf')](_0xce93('0x51'),null);this[_0xce93('0xf')]('mandatoryDisposition',_0x369666);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xce93('0x17')](0x3)[_0xce93('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xce93('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xce93('0x17')](0x3)[_0xce93('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xce93('0x1f')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index ee2e78d..c5dc0aa 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 _0x41fe=['cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','get','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','UserProfileResource','destroy','error','stack','name','send','index','VoiceQueue','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','includeAll','include','findAll','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','findOne','VoiceQueueId','CmHopper','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','pick','getTeams','Team','addTeams','teams','User','online','voicePause','flatMap','Agents','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','emit','userVoiceQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','compact','transaction','ids','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','interface','isArray','getAgents','getMembers','CmList','getLists','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','ListId\x20=\x20?','CmHopperId','OrderBy','h.id','ci.OrderBy+1'];(function(_0xb55417,_0x40e0ef){var _0x5143e6=function(_0x2136c7){while(--_0x2136c7){_0xb55417['push'](_0xb55417['shift']());}};_0x5143e6(++_0x40e0ef);}(_0x41fe,0xd1));var _0xe41f=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x41fe[_0x38537f];return _0x141e23;};'use strict';var emlformat=require(_0xe41f('0x0'));var rimraf=require(_0xe41f('0x1'));var zipdir=require(_0xe41f('0x2'));var jsonpatch=require(_0xe41f('0x3'));var rp=require(_0xe41f('0x4'));var moment=require(_0xe41f('0x5'));var BPromise=require(_0xe41f('0x6'));var Mustache=require(_0xe41f('0x7'));var util=require(_0xe41f('0x8'));var path=require(_0xe41f('0x9'));var sox=require(_0xe41f('0xa'));var csv=require(_0xe41f('0xb'));var ejs=require(_0xe41f('0xc'));var fs=require('fs');var fs_extra=require(_0xe41f('0xd'));var _=require(_0xe41f('0xe'));var squel=require(_0xe41f('0xf'));var crypto=require(_0xe41f('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xe41f('0x11'));var toCsv=require(_0xe41f('0xb'));var querystring=require('querystring');var Papa=require(_0xe41f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe41f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe41f('0x14'));var config=require(_0xe41f('0x15'));var licenseUtil=require(_0xe41f('0x16'));var db=require(_0xe41f('0x17'))['db'];config[_0xe41f('0x18')]=_[_0xe41f('0x19')](config[_0xe41f('0x18')],{'host':_0xe41f('0x1a'),'port':0x18eb});var socket=require(_0xe41f('0x1b'))(new Redis(config[_0xe41f('0x18')]));require('./voiceQueue.socket')[_0xe41f('0x1c')](socket);function respondWithStatusCode(_0x13a2dd,_0x544753){_0x544753=_0x544753||0xcc;return function(_0x16bc30){if(_0x16bc30){return _0x13a2dd[_0xe41f('0x1d')](_0x544753);}return _0x13a2dd[_0xe41f('0x1e')](_0x544753)[_0xe41f('0x1f')]();};}function respondWithResult(_0x194653,_0x3e4e83){_0x3e4e83=_0x3e4e83||0xc8;return function(_0xab3c7d){if(_0xab3c7d){return _0x194653['status'](_0x3e4e83)['json'](_0xab3c7d);}};}function respondWithFilteredResult(_0x2b5688,_0x5e59e2){return function(_0x5b5dd7){if(_0x5b5dd7){var _0x831479=typeof _0x5e59e2[_0xe41f('0x20')]===_0xe41f('0x21')&&typeof _0x5e59e2[_0xe41f('0x22')]===_0xe41f('0x21');var _0x5bd220=_0x5b5dd7[_0xe41f('0x23')];var _0x5339dd=_0x831479?0x0:_0x5e59e2[_0xe41f('0x20')];var _0x2c264c=_0x831479?_0x5b5dd7['count']:_0x5e59e2[_0xe41f('0x20')]+_0x5e59e2[_0xe41f('0x22')];var _0x171851;if(_0x2c264c>=_0x5bd220){_0x2c264c=_0x5bd220;_0x171851=0xc8;}else{_0x171851=0xce;}_0x2b5688['status'](_0x171851);return _0x2b5688[_0xe41f('0x24')](_0xe41f('0x25'),_0x5339dd+'-'+_0x2c264c+'/'+_0x5bd220)[_0xe41f('0x26')](_0x5b5dd7);}return null;};}function patchUpdates(_0x10ee63){return function(_0xa647ca){try{jsonpatch[_0xe41f('0x27')](_0xa647ca,_0x10ee63,!![]);}catch(_0x9c0c33){return BPromise['reject'](_0x9c0c33);}return _0xa647ca[_0xe41f('0x28')]();};}function saveUpdates(_0x5a443f,_0x4e8587){return function(_0x2f586e){if(_0x2f586e){return _0x2f586e[_0xe41f('0x29')](_0x5a443f)[_0xe41f('0x2a')](function(_0x4f7965){return _0x4f7965;});}return null;};}function removeEntity(_0x1ac25a,_0x573b3){return function(_0x115701){if(_0x115701){return _0x115701['destroy']()[_0xe41f('0x2a')](function(){var _0x5790ae=_0x115701[_0xe41f('0x2b')]({'plain':!![]});var _0x44fb04=[{'name':'VoiceQueues','value':_0xe41f('0x2c'),'ignore':![]},{'name':_0xe41f('0x2d'),'value':_0xe41f('0x2e'),'ignore':![]}];var _0x68f74c=_(_0x44fb04)[_0xe41f('0x2f')](_0xe41f('0x30'))[_0xe41f('0x31')](_0xe41f('0x32'))[_0xe41f('0x32')]();if(_[_0xe41f('0x33')](_0x68f74c,_0x5790ae[_0xe41f('0x34')])){return;}var _0x60008=_[_0xe41f('0x35')](_0x44fb04,[_0xe41f('0x32'),_0x5790ae[_0xe41f('0x34')]])['name'];return db[_0xe41f('0x36')][_0xe41f('0x37')]({'where':{'type':_0x60008,'resourceId':_0x5790ae['id']}})[_0xe41f('0x2a')](function(){return _0x115701;});})[_0xe41f('0x2a')](function(){_0x1ac25a[_0xe41f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b1e86,_0x157aa0){return function(_0x3a3dbe){if(!_0x3a3dbe){_0x3b1e86[_0xe41f('0x1d')](0x194);}return _0x3a3dbe;};}function handleError(_0x51a34a,_0x59794a){_0x59794a=_0x59794a||0x1f4;return function(_0x52e335){logger[_0xe41f('0x38')](_0x52e335[_0xe41f('0x39')]);if(_0x52e335[_0xe41f('0x3a')]){delete _0x52e335['name'];}_0x51a34a[_0xe41f('0x1e')](_0x59794a)[_0xe41f('0x3b')](_0x52e335);};}exports[_0xe41f('0x3c')]=function(_0x205f3a,_0x182e32){var _0x3d9090={},_0x44f99b={},_0x2bc67a={'count':0x0,'rows':[]};var _0x1c8ef2=_[_0xe41f('0x31')](db[_0xe41f('0x3d')][_0xe41f('0x3e')],function(_0x508d2a){return{'name':_0x508d2a[_0xe41f('0x3f')],'type':_0x508d2a['type'][_0xe41f('0x40')]};});_0x44f99b['model']=_[_0xe41f('0x31')](_0x1c8ef2,'name');_0x44f99b['query']=_[_0xe41f('0x41')](_0x205f3a[_0xe41f('0x42')]);_0x44f99b[_0xe41f('0x43')]=_[_0xe41f('0x44')](_0x44f99b[_0xe41f('0x45')],_0x44f99b['query']);_0x3d9090[_0xe41f('0x46')]=_[_0xe41f('0x44')](_0x44f99b[_0xe41f('0x45')],qs[_0xe41f('0x47')](_0x205f3a[_0xe41f('0x42')][_0xe41f('0x47')]));_0x3d9090[_0xe41f('0x46')]=_0x3d9090['attributes'][_0xe41f('0x48')]?_0x3d9090[_0xe41f('0x46')]:_0x44f99b[_0xe41f('0x45')];if(!_0x205f3a[_0xe41f('0x42')][_0xe41f('0x49')](_0xe41f('0x4a'))){_0x3d9090[_0xe41f('0x22')]=qs[_0xe41f('0x22')](_0x205f3a[_0xe41f('0x42')]['limit']);_0x3d9090['offset']=qs[_0xe41f('0x20')](_0x205f3a['query'][_0xe41f('0x20')]);}_0x3d9090[_0xe41f('0x4b')]=qs[_0xe41f('0x4c')](_0x205f3a['query'][_0xe41f('0x4c')]);_0x3d9090[_0xe41f('0x4d')]=qs['filters'](_['pick'](_0x205f3a[_0xe41f('0x42')],_0x44f99b[_0xe41f('0x43')]),_0x1c8ef2);if(_0x205f3a[_0xe41f('0x42')][_0xe41f('0x2f')]){_0x3d9090[_0xe41f('0x4d')]=_[_0xe41f('0x4e')](_0x3d9090[_0xe41f('0x4d')],{'$or':_['map'](_0x1c8ef2,function(_0x255aa8){if(_0x255aa8[_0xe41f('0x34')]!=='VIRTUAL'){var _0x2bb953={};_0x2bb953[_0x255aa8['name']]={'$like':'%'+_0x205f3a[_0xe41f('0x42')][_0xe41f('0x2f')]+'%'};return _0x2bb953;}})});}_0x3d9090=_[_0xe41f('0x4e')]({},_0x3d9090,_0x205f3a['options']);var _0x3870a2={'where':_0x3d9090['where']};return db[_0xe41f('0x3d')][_0xe41f('0x23')](_0x3870a2)[_0xe41f('0x2a')](function(_0x16fd5c){_0x2bc67a[_0xe41f('0x23')]=_0x16fd5c;if(_0x205f3a[_0xe41f('0x42')][_0xe41f('0x4f')]){_0x3d9090[_0xe41f('0x50')]=[{'all':!![]}];}return db['VoiceQueue'][_0xe41f('0x51')](_0x3d9090);})['then'](function(_0x1688cb){_0x2bc67a['rows']=_0x1688cb;return _0x2bc67a;})[_0xe41f('0x2a')](respondWithFilteredResult(_0x182e32,_0x3d9090))[_0xe41f('0x52')](handleError(_0x182e32,null));};exports[_0xe41f('0x53')]=function(_0x35b7f5,_0x4be69e){var _0xf70388={'raw':![],'where':{'id':_0x35b7f5[_0xe41f('0x54')]['id']}},_0x49bcac={};_0x49bcac[_0xe41f('0x45')]=_[_0xe41f('0x41')](db[_0xe41f('0x3d')]['rawAttributes']);_0x49bcac[_0xe41f('0x42')]=_['keys'](_0x35b7f5['query']);_0x49bcac['filters']=_[_0xe41f('0x44')](_0x49bcac[_0xe41f('0x45')],_0x49bcac['query']);_0xf70388[_0xe41f('0x46')]=_[_0xe41f('0x44')](_0x49bcac[_0xe41f('0x45')],qs[_0xe41f('0x47')](_0x35b7f5[_0xe41f('0x42')][_0xe41f('0x47')]));_0xf70388[_0xe41f('0x46')]=_0xf70388[_0xe41f('0x46')][_0xe41f('0x48')]?_0xf70388[_0xe41f('0x46')]:_0x49bcac['model'];if(_0x35b7f5[_0xe41f('0x42')][_0xe41f('0x4f')]){_0xf70388[_0xe41f('0x50')]=[{'all':!![]}];}_0xf70388=_['merge']({},_0xf70388,_0x35b7f5[_0xe41f('0x55')]);return db[_0xe41f('0x3d')][_0xe41f('0x35')](_0xf70388)[_0xe41f('0x2a')](handleEntityNotFound(_0x4be69e,null))[_0xe41f('0x2a')](respondWithResult(_0x4be69e,null))['catch'](handleError(_0x4be69e,null));};exports[_0xe41f('0x56')]=function(_0x33600c,_0x55594c){return db['VoiceQueue']['create'](_0x33600c[_0xe41f('0x57')],{})[_0xe41f('0x2a')](function(_0x2d8a6a){var _0x2136a5=_0x33600c[_0xe41f('0x58')][_0xe41f('0x2b')]({'plain':!![]});if(!_0x2136a5)throw new Error(_0xe41f('0x59'));if(_0x2136a5[_0xe41f('0x5a')]==='user'){var _0x1e70ba=_0x2d8a6a[_0xe41f('0x2b')]({'plain':!![]});var _0x5efe4e=[{'name':_0xe41f('0x5b'),'value':_0xe41f('0x2c')},{'name':'QueueCampaigns','value':_0xe41f('0x2e')}];var _0x107370=_['find'](_0x5efe4e,[_0xe41f('0x32'),_0x1e70ba[_0xe41f('0x34')]])[_0xe41f('0x3a')];return db[_0xe41f('0x5c')][_0xe41f('0x35')]({'where':{'name':_0x107370,'userProfileId':_0x2136a5[_0xe41f('0x5d')]},'raw':!![]})['then'](function(_0x1d5017){if(_0x1d5017&&_0x1d5017[_0xe41f('0x5e')]===0x0){return db['UserProfileResource'][_0xe41f('0x56')]({'name':_0x1e70ba[_0xe41f('0x3a')],'resourceId':_0x1e70ba['id'],'type':_0x1d5017[_0xe41f('0x3a')],'sectionId':_0x1d5017['id']},{})['then'](function(){return _0x2d8a6a;});}else{return _0x2d8a6a;}})[_0xe41f('0x52')](function(_0x2218dd){logger[_0xe41f('0x38')](_0xe41f('0x5f'),_0x2218dd);throw _0x2218dd;});}return _0x2d8a6a;})['then'](respondWithResult(_0x55594c,0xc9))[_0xe41f('0x52')](handleError(_0x55594c,null));};exports[_0xe41f('0x60')]=function(_0x51c5ae,_0x53781a){var _0x15ba6a={'where':{'id':_0x51c5ae['params']['id']}},_0x2e284e={};_0x2e284e[_0xe41f('0x45')]=_[_0xe41f('0x41')](db[_0xe41f('0x3d')]['rawAttributes']);_0x15ba6a[_0xe41f('0x46')]=_['intersection'](_0x2e284e[_0xe41f('0x45')],qs[_0xe41f('0x47')](_0x51c5ae[_0xe41f('0x42')][_0xe41f('0x47')]));_0x15ba6a[_0xe41f('0x46')]=_0x15ba6a[_0xe41f('0x46')][_0xe41f('0x48')]?_0x15ba6a['attributes']:_0x2e284e[_0xe41f('0x45')];if(_0x51c5ae[_0xe41f('0x42')][_0xe41f('0x4f')]){_0x15ba6a['include']=[{'all':!![]}];}_0x15ba6a=_['merge']({},_0x15ba6a,_0x51c5ae['options']);return db[_0xe41f('0x3d')]['find'](_0x15ba6a)[_0xe41f('0x2a')](handleEntityNotFound(_0x53781a,null))['then'](function(_0x5c729d){if(_0x5c729d){var _0x4e01d4=_0x5c729d[_0xe41f('0x2b')]({'plain':!![]});_0x4e01d4=qs[_0xe41f('0x61')](_0x4e01d4,['id',_0xe41f('0x62'),_0xe41f('0x63')]);_0x51c5ae[_0xe41f('0x57')]=_['omit'](_0x51c5ae[_0xe41f('0x57')],['id',_0xe41f('0x62'),'updatedAt']);return db['VoiceQueue'][_0xe41f('0x56')](_['merge'](_0x4e01d4,_0x51c5ae[_0xe41f('0x57')]),{'include':_0x51c5ae[_0xe41f('0x42')][_0xe41f('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x524bc3){var _0x4fa7f0=_0x51c5ae['user']['get']({'plain':!![]});if(!_0x4fa7f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fa7f0[_0xe41f('0x5a')]===_0xe41f('0x58')){var _0x37471b=_0x524bc3[_0xe41f('0x2b')]({'plain':!![]});var _0x25a72e=[{'name':_0xe41f('0x5b'),'value':_0xe41f('0x2c')},{'name':_0xe41f('0x2d'),'value':_0xe41f('0x2e')}];var _0x585880=_['find'](_0x25a72e,[_0xe41f('0x32'),_0x37471b[_0xe41f('0x34')]])[_0xe41f('0x3a')];return db['UserProfileSection'][_0xe41f('0x35')]({'where':{'name':_0x585880,'userProfileId':_0x4fa7f0[_0xe41f('0x5d')]},'raw':!![]})[_0xe41f('0x2a')](function(_0x38b75c){if(_0x38b75c&&_0x38b75c[_0xe41f('0x5e')]===0x0){return db[_0xe41f('0x36')]['create']({'name':_0x37471b[_0xe41f('0x3a')],'resourceId':_0x37471b['id'],'type':_0x38b75c['name'],'sectionId':_0x38b75c['id']},{})[_0xe41f('0x2a')](function(){return _0x524bc3;});}else{return _0x524bc3;}})['catch'](function(_0x2cfa6c){logger[_0xe41f('0x38')](_0xe41f('0x5f'),_0x2cfa6c);throw _0x2cfa6c;});}return _0x524bc3;});}})[_0xe41f('0x2a')](respondWithResult(_0x53781a,0xc9))['catch'](handleError(_0x53781a,null));};exports['update']=function(_0x2e9ff9,_0x430dac){if(_0x2e9ff9[_0xe41f('0x57')]['id']){delete _0x2e9ff9[_0xe41f('0x57')]['id'];}return db[_0xe41f('0x3d')][_0xe41f('0x35')]({'where':{'id':_0x2e9ff9['params']['id']}})['then'](handleEntityNotFound(_0x430dac,null))['then'](saveUpdates(_0x2e9ff9['body'],null))[_0xe41f('0x2a')](respondWithResult(_0x430dac,null))[_0xe41f('0x52')](handleError(_0x430dac,null));};exports[_0xe41f('0x37')]=function(_0x45a51f,_0xb9c8d7){return db[_0xe41f('0x3d')][_0xe41f('0x35')]({'where':{'id':_0x45a51f['params']['id']}})[_0xe41f('0x2a')](handleEntityNotFound(_0xb9c8d7,null))[_0xe41f('0x2a')](removeEntity(_0xb9c8d7,null))[_0xe41f('0x52')](handleError(_0xb9c8d7,null));};exports[_0xe41f('0x64')]=function(_0x476cf6,_0x377930,_0xf6c719){var _0x300c5a={'raw':![],'where':{}};var _0x5ce1da={};var _0x326836={'count':0x0,'rows':[]};return db[_0xe41f('0x3d')][_0xe41f('0x65')]({'where':{'id':_0x476cf6[_0xe41f('0x54')]['id']}})[_0xe41f('0x2a')](handleEntityNotFound(_0x377930,null))['then'](function(_0x752620){if(_0x752620){_0x5ce1da[_0xe41f('0x45')]=_[_0xe41f('0x41')](db['CmHopper'][_0xe41f('0x3e')]);_0x5ce1da[_0xe41f('0x42')]=_[_0xe41f('0x41')](_0x476cf6[_0xe41f('0x42')]);_0x5ce1da[_0xe41f('0x43')]=_['intersection'](_0x5ce1da['model'],_0x5ce1da[_0xe41f('0x42')]);_0x300c5a[_0xe41f('0x46')]=_[_0xe41f('0x44')](_0x5ce1da[_0xe41f('0x45')],qs['fields'](_0x476cf6[_0xe41f('0x42')][_0xe41f('0x47')]));_0x300c5a['attributes']=_0x300c5a[_0xe41f('0x46')][_0xe41f('0x48')]?_0x300c5a[_0xe41f('0x46')]:_0x5ce1da[_0xe41f('0x45')];if(!_0x476cf6[_0xe41f('0x42')][_0xe41f('0x49')]('nolimit')){_0x300c5a[_0xe41f('0x22')]=qs[_0xe41f('0x22')](_0x476cf6[_0xe41f('0x42')][_0xe41f('0x22')]);_0x300c5a[_0xe41f('0x20')]=qs[_0xe41f('0x20')](_0x476cf6[_0xe41f('0x42')]['offset']);}_0x300c5a[_0xe41f('0x4b')]=qs['sort'](_0x476cf6[_0xe41f('0x42')][_0xe41f('0x4c')]);_0x300c5a[_0xe41f('0x4d')]=qs[_0xe41f('0x43')](_['pick'](_0x476cf6[_0xe41f('0x42')],_0x5ce1da['filters']));_0x300c5a[_0xe41f('0x4d')][_0xe41f('0x66')]=_0x752620['id'];if(_0x476cf6['query'][_0xe41f('0x2f')]){_0x300c5a[_0xe41f('0x4d')]=_['merge'](_0x300c5a['where'],{'$or':_[_0xe41f('0x31')](_0x300c5a[_0xe41f('0x46')],function(_0x422a0a){var _0x2a3bb6={};_0x2a3bb6[_0x422a0a]={'$like':'%'+_0x476cf6[_0xe41f('0x42')][_0xe41f('0x2f')]+'%'};return _0x2a3bb6;})});}_0x300c5a=_[_0xe41f('0x4e')]({},_0x300c5a,_0x476cf6[_0xe41f('0x55')]);return db[_0xe41f('0x67')][_0xe41f('0x23')]({'where':_0x300c5a['where']})[_0xe41f('0x2a')](function(_0x17bd89){_0x326836['count']=_0x17bd89;if(_0x476cf6[_0xe41f('0x42')][_0xe41f('0x4f')]){_0x300c5a[_0xe41f('0x50')]=[{'all':!![]}];}return db[_0xe41f('0x67')][_0xe41f('0x51')](_0x300c5a);})[_0xe41f('0x2a')](function(_0xb52da0){_0x326836[_0xe41f('0x68')]=_0xb52da0;return _0x326836;});}})[_0xe41f('0x2a')](respondWithFilteredResult(_0x377930,_0x300c5a))[_0xe41f('0x52')](handleError(_0x377930,null));};exports['getHopperHistories']=function(_0x489a94,_0x4cf71d,_0x2039b6){var _0x45fbb3={'raw':!![],'where':{}};var _0x22edc4={};var _0x4c5e53={'count':0x0,'rows':[]};return db[_0xe41f('0x3d')]['findOne']({'where':{'id':_0x489a94[_0xe41f('0x54')]['id']}})['then'](handleEntityNotFound(_0x4cf71d,null))[_0xe41f('0x2a')](function(_0x529033){if(_0x529033){_0x22edc4[_0xe41f('0x45')]=_[_0xe41f('0x41')](db[_0xe41f('0x69')][_0xe41f('0x3e')]);_0x22edc4['query']=_[_0xe41f('0x41')](_0x489a94[_0xe41f('0x42')]);_0x22edc4[_0xe41f('0x43')]=_[_0xe41f('0x44')](_0x22edc4[_0xe41f('0x45')],_0x22edc4[_0xe41f('0x42')]);_0x45fbb3[_0xe41f('0x46')]=_['intersection'](_0x22edc4[_0xe41f('0x45')],qs[_0xe41f('0x47')](_0x489a94['query'][_0xe41f('0x47')]));_0x45fbb3[_0xe41f('0x46')]=_0x45fbb3['attributes']['length']?_0x45fbb3['attributes']:_0x22edc4[_0xe41f('0x45')];if(!_0x489a94[_0xe41f('0x42')]['hasOwnProperty'](_0xe41f('0x4a'))){_0x45fbb3[_0xe41f('0x22')]=qs[_0xe41f('0x22')](_0x489a94[_0xe41f('0x42')][_0xe41f('0x22')]);_0x45fbb3[_0xe41f('0x20')]=qs[_0xe41f('0x20')](_0x489a94[_0xe41f('0x42')][_0xe41f('0x20')]);}_0x45fbb3[_0xe41f('0x4b')]=qs[_0xe41f('0x4c')](_0x489a94[_0xe41f('0x42')][_0xe41f('0x4c')]);_0x45fbb3[_0xe41f('0x4d')]=qs[_0xe41f('0x43')](_['pick'](_0x489a94[_0xe41f('0x42')],_0x22edc4[_0xe41f('0x43')]));_0x45fbb3['where'][_0xe41f('0x66')]=_0x529033['id'];if(_0x489a94[_0xe41f('0x42')][_0xe41f('0x2f')]){_0x45fbb3[_0xe41f('0x4d')]=_[_0xe41f('0x4e')](_0x45fbb3[_0xe41f('0x4d')],{'$or':_[_0xe41f('0x31')](_0x45fbb3[_0xe41f('0x46')],function(_0x40b7cd){var _0x45f81f={};_0x45f81f[_0x40b7cd]={'$like':'%'+_0x489a94['query'][_0xe41f('0x2f')]+'%'};return _0x45f81f;})});}_0x45fbb3=_[_0xe41f('0x4e')]({},_0x45fbb3,_0x489a94[_0xe41f('0x55')]);return db[_0xe41f('0x69')]['count']({'where':_0x45fbb3['where']})[_0xe41f('0x2a')](function(_0xcddae3){_0x4c5e53[_0xe41f('0x23')]=_0xcddae3;if(_0x489a94['query'][_0xe41f('0x4f')]){_0x45fbb3[_0xe41f('0x50')]=[{'all':!![]}];}return db[_0xe41f('0x69')]['findAll'](_0x45fbb3);})['then'](function(_0x1a2194){_0x4c5e53['rows']=_0x1a2194;return _0x4c5e53;});}})[_0xe41f('0x2a')](respondWithFilteredResult(_0x4cf71d,_0x45fbb3))['catch'](handleError(_0x4cf71d,null));};exports[_0xe41f('0x6a')]=function(_0x2602ba,_0x2cd117,_0x56e207){var _0xb24bc={'raw':!![],'where':{}};var _0x3326c1={};var _0x5787b4={'count':0x0,'rows':[]};return db[_0xe41f('0x3d')][_0xe41f('0x65')]({'where':{'id':_0x2602ba[_0xe41f('0x54')]['id']}})[_0xe41f('0x2a')](handleEntityNotFound(_0x2cd117,null))[_0xe41f('0x2a')](function(_0x20e303){if(_0x20e303){_0x3326c1['model']=_[_0xe41f('0x41')](db[_0xe41f('0x6b')][_0xe41f('0x3e')]);_0x3326c1[_0xe41f('0x42')]=_['keys'](_0x2602ba[_0xe41f('0x42')]);_0x3326c1[_0xe41f('0x43')]=_[_0xe41f('0x44')](_0x3326c1[_0xe41f('0x45')],_0x3326c1[_0xe41f('0x42')]);_0xb24bc[_0xe41f('0x46')]=_[_0xe41f('0x44')](_0x3326c1[_0xe41f('0x45')],qs[_0xe41f('0x47')](_0x2602ba[_0xe41f('0x42')]['fields']));_0xb24bc[_0xe41f('0x46')]=_0xb24bc[_0xe41f('0x46')][_0xe41f('0x48')]?_0xb24bc['attributes']:_0x3326c1[_0xe41f('0x45')];if(!_0x2602ba['query'][_0xe41f('0x49')](_0xe41f('0x4a'))){_0xb24bc[_0xe41f('0x22')]=qs[_0xe41f('0x22')](_0x2602ba[_0xe41f('0x42')][_0xe41f('0x22')]);_0xb24bc[_0xe41f('0x20')]=qs['offset'](_0x2602ba[_0xe41f('0x42')][_0xe41f('0x20')]);}_0xb24bc['order']=qs[_0xe41f('0x4c')](_0x2602ba[_0xe41f('0x42')]['sort']);_0xb24bc[_0xe41f('0x4d')]=qs[_0xe41f('0x43')](_['pick'](_0x2602ba['query'],_0x3326c1[_0xe41f('0x43')]));_0xb24bc['where'][_0xe41f('0x66')]=_0x20e303['id'];if(_0x2602ba[_0xe41f('0x42')][_0xe41f('0x2f')]){_0xb24bc[_0xe41f('0x4d')]=_[_0xe41f('0x4e')](_0xb24bc['where'],{'$or':_[_0xe41f('0x31')](_0xb24bc[_0xe41f('0x46')],function(_0x41810e){var _0x3cf75e={};_0x3cf75e[_0x41810e]={'$like':'%'+_0x2602ba[_0xe41f('0x42')][_0xe41f('0x2f')]+'%'};return _0x3cf75e;})});}_0xb24bc=_[_0xe41f('0x4e')]({},_0xb24bc,_0x2602ba[_0xe41f('0x55')]);return db[_0xe41f('0x6b')]['count']({'where':_0xb24bc[_0xe41f('0x4d')]})[_0xe41f('0x2a')](function(_0x1f5051){_0x5787b4['count']=_0x1f5051;if(_0x2602ba['query'][_0xe41f('0x4f')]){_0xb24bc['include']=[{'all':!![]}];}return db[_0xe41f('0x6b')][_0xe41f('0x51')](_0xb24bc);})[_0xe41f('0x2a')](function(_0x18ece8){_0x5787b4[_0xe41f('0x68')]=_0x18ece8;return _0x5787b4;});}})['then'](respondWithFilteredResult(_0x2cd117,_0xb24bc))[_0xe41f('0x52')](handleError(_0x2cd117,null));};exports[_0xe41f('0x6c')]=function(_0x1ba63c,_0x37a5ca,_0x48c4ca){var _0xef729b={'raw':!![],'where':{}};var _0x2e340a={};var _0x452a81={'count':0x0,'rows':[]};return db[_0xe41f('0x3d')][_0xe41f('0x65')]({'where':{'id':_0x1ba63c['params']['id']}})[_0xe41f('0x2a')](handleEntityNotFound(_0x37a5ca,null))[_0xe41f('0x2a')](function(_0x3c9052){if(_0x3c9052){_0x2e340a['model']=_[_0xe41f('0x41')](db[_0xe41f('0x6d')][_0xe41f('0x3e')]);_0x2e340a[_0xe41f('0x42')]=_[_0xe41f('0x41')](_0x1ba63c['query']);_0x2e340a['filters']=_[_0xe41f('0x44')](_0x2e340a[_0xe41f('0x45')],_0x2e340a['query']);_0xef729b[_0xe41f('0x46')]=_[_0xe41f('0x44')](_0x2e340a[_0xe41f('0x45')],qs[_0xe41f('0x47')](_0x1ba63c[_0xe41f('0x42')]['fields']));_0xef729b[_0xe41f('0x46')]=_0xef729b[_0xe41f('0x46')][_0xe41f('0x48')]?_0xef729b[_0xe41f('0x46')]:_0x2e340a['model'];if(!_0x1ba63c['query']['hasOwnProperty'](_0xe41f('0x4a'))){_0xef729b['limit']=qs['limit'](_0x1ba63c[_0xe41f('0x42')][_0xe41f('0x22')]);_0xef729b[_0xe41f('0x20')]=qs[_0xe41f('0x20')](_0x1ba63c['query'][_0xe41f('0x20')]);}_0xef729b[_0xe41f('0x4b')]=qs['sort'](_0x1ba63c[_0xe41f('0x42')][_0xe41f('0x4c')]);_0xef729b[_0xe41f('0x4d')]=qs[_0xe41f('0x43')](_[_0xe41f('0x6e')](_0x1ba63c[_0xe41f('0x42')],_0x2e340a[_0xe41f('0x43')]));_0xef729b[_0xe41f('0x4d')][_0xe41f('0x66')]=_0x3c9052['id'];if(_0x1ba63c[_0xe41f('0x42')][_0xe41f('0x2f')]){_0xef729b[_0xe41f('0x4d')]=_[_0xe41f('0x4e')](_0xef729b[_0xe41f('0x4d')],{'$or':_[_0xe41f('0x31')](_0xef729b[_0xe41f('0x46')],function(_0x1f9673){var _0x10d584={};_0x10d584[_0x1f9673]={'$like':'%'+_0x1ba63c[_0xe41f('0x42')][_0xe41f('0x2f')]+'%'};return _0x10d584;})});}_0xef729b=_[_0xe41f('0x4e')]({},_0xef729b,_0x1ba63c['options']);return db[_0xe41f('0x6d')]['count']({'where':_0xef729b[_0xe41f('0x4d')]})[_0xe41f('0x2a')](function(_0x5c89cb){_0x452a81[_0xe41f('0x23')]=_0x5c89cb;if(_0x1ba63c[_0xe41f('0x42')]['includeAll']){_0xef729b[_0xe41f('0x50')]=[{'all':!![]}];}return db[_0xe41f('0x6d')][_0xe41f('0x51')](_0xef729b);})[_0xe41f('0x2a')](function(_0x4cc611){_0x452a81['rows']=_0x4cc611;return _0x452a81;});}})[_0xe41f('0x2a')](respondWithFilteredResult(_0x37a5ca,_0xef729b))[_0xe41f('0x52')](handleError(_0x37a5ca,null));};exports[_0xe41f('0x6f')]=function(_0x181de3,_0x1aec9f,_0x23bf66){var _0x351563={};var _0x7f8b7f={};var _0x2ba720;var _0xbf2fcb;return db[_0xe41f('0x3d')][_0xe41f('0x65')]({'where':{'id':_0x181de3[_0xe41f('0x54')]['id']}})[_0xe41f('0x2a')](handleEntityNotFound(_0x1aec9f,null))[_0xe41f('0x2a')](function(_0x55322e){if(_0x55322e){_0x2ba720=_0x55322e;_0x7f8b7f[_0xe41f('0x45')]=_[_0xe41f('0x41')](db[_0xe41f('0x70')][_0xe41f('0x3e')]);_0x7f8b7f[_0xe41f('0x42')]=_[_0xe41f('0x41')](_0x181de3[_0xe41f('0x42')]);_0x7f8b7f[_0xe41f('0x43')]=_[_0xe41f('0x44')](_0x7f8b7f[_0xe41f('0x45')],_0x7f8b7f[_0xe41f('0x42')]);_0x351563['attributes']=_[_0xe41f('0x44')](_0x7f8b7f[_0xe41f('0x45')],qs[_0xe41f('0x47')](_0x181de3['query'][_0xe41f('0x47')]));_0x351563[_0xe41f('0x46')]=_0x351563[_0xe41f('0x46')][_0xe41f('0x48')]?_0x351563['attributes']:_0x7f8b7f[_0xe41f('0x45')];_0x351563[_0xe41f('0x4b')]=qs['sort'](_0x181de3[_0xe41f('0x42')][_0xe41f('0x4c')]);_0x351563['where']=qs[_0xe41f('0x43')](_[_0xe41f('0x6e')](_0x181de3[_0xe41f('0x42')],_0x7f8b7f[_0xe41f('0x43')]));if(_0x181de3[_0xe41f('0x42')][_0xe41f('0x2f')]){_0x351563['where']=_[_0xe41f('0x4e')](_0x351563[_0xe41f('0x4d')],{'$or':_['map'](_0x351563[_0xe41f('0x46')],function(_0x622ec5){var _0x581769={};_0x581769[_0x622ec5]={'$like':'%'+_0x181de3[_0xe41f('0x42')]['filter']+'%'};return _0x581769;})});}_0x351563=_[_0xe41f('0x4e')]({},_0x351563,_0x181de3[_0xe41f('0x55')]);return _0x2ba720[_0xe41f('0x6f')](_0x351563);}})['then'](function(_0x597e95){if(_0x597e95){_0xbf2fcb=_0x597e95[_0xe41f('0x48')];if(!_0x181de3[_0xe41f('0x42')]['hasOwnProperty'](_0xe41f('0x4a'))){_0x351563[_0xe41f('0x22')]=qs[_0xe41f('0x22')](_0x181de3[_0xe41f('0x42')][_0xe41f('0x22')]);_0x351563[_0xe41f('0x20')]=qs['offset'](_0x181de3[_0xe41f('0x42')][_0xe41f('0x20')]);}return _0x2ba720[_0xe41f('0x6f')](_0x351563);}})[_0xe41f('0x2a')](function(_0x516507){if(_0x516507){return _0x516507?{'count':_0xbf2fcb,'rows':_0x516507}:null;}})[_0xe41f('0x2a')](respondWithResult(_0x1aec9f,null))[_0xe41f('0x52')](handleError(_0x1aec9f,null));};exports[_0xe41f('0x71')]=function(_0x5bd688,_0x1a7b27,_0x3c2f7d){var _0xe64ec=_0x5bd688[_0xe41f('0x57')][_0xe41f('0x72')];var _0x273370=_[_0xe41f('0x31')](_0xe64ec,'id');return db['Team'][_0xe41f('0x51')]({'where':{'id':_0x273370},'attributes':['id'],'include':[{'model':db[_0xe41f('0x73')],'as':'Agents','attributes':['id',_0xe41f('0x3a'),_0xe41f('0x74'),_0xe41f('0x75'),'interface'],'raw':!![]}]})[_0xe41f('0x2a')](function(_0x39fb4b){if(_0x39fb4b){var _0x10a093=_[_0xe41f('0x76')](_0x39fb4b,function(_0x18aa0f){var _0x1cc00c=_0x18aa0f[_0xe41f('0x2b')]({'plain':!![]});_0x1cc00c[_0xe41f('0x77')][_0xe41f('0x78')](function(_0x3fcb79){_0x3fcb79['penalty']=_[_0xe41f('0x35')](_0xe64ec,{'id':_0x1cc00c['id']})[_0xe41f('0x79')];});return _0x1cc00c[_0xe41f('0x77')];});return db[_0xe41f('0x3d')]['find']({'where':{'id':_0x5bd688[_0xe41f('0x54')]['id']}})['then'](function(_0x66b5b7){return db[_0xe41f('0x7a')]['transaction'](function(_0x3251b6){return _0x66b5b7['addTeams'](_0x273370,{'transaction':_0x3251b6})['then'](function(){return BPromise[_0xe41f('0x7b')](_0xe64ec,function(_0xdf55ce){return db[_0xe41f('0x7c')][_0xe41f('0x7d')]({'TeamId':_0xdf55ce['id'],'VoiceQueueId':_0x5bd688[_0xe41f('0x54')]['id'],'penalty':_0xdf55ce[_0xe41f('0x79')]},{'transaction':_0x3251b6});});})['then'](function(){return BPromise[_0xe41f('0x7b')](_0x10a093,function(_0x82c44e){return db[_0xe41f('0x7e')]['findOrCreate']({'where':{'UserId':_0x82c44e['id'],'VoiceQueueId':_0x5bd688[_0xe41f('0x54')]['id']},'defaults':{'penalty':_0x82c44e[_0xe41f('0x79')]},'transaction':_0x3251b6});});})['then'](function(){return BPromise[_0xe41f('0x7b')](_[_0xe41f('0x2f')](_0x10a093,{'online':!![]}),function(_0x338d90){return db[_0xe41f('0x7f')][_0xe41f('0x7d')]({'membername':_0x338d90[_0xe41f('0x3a')],'UserId':_0x338d90['id'],'queue_name':_0x66b5b7[_0xe41f('0x3a')],'VoiceQueueId':_0x66b5b7['id'],'interface':_[_0xe41f('0x80')](_0x338d90['interface'])?util[_0xe41f('0x81')]('SIP/%s',_0x338d90[_0xe41f('0x3a')]):_0x338d90['interface'],'paused':_0x338d90['voicePause']||![],'penalty':_0x338d90[_0xe41f('0x79')]},{'transaction':_0x3251b6});});})[_0xe41f('0x2a')](function(){_0x10a093[_0xe41f('0x78')](function(_0x5d655c){socket[_0xe41f('0x82')](_0xe41f('0x83'),{'UserId':_0x5d655c['id'],'VoiceQueueId':_0x66b5b7['id']});});});});});}})[_0xe41f('0x2a')](respondWithStatusCode(_0x1a7b27,null))[_0xe41f('0x52')](handleError(_0x1a7b27,null));};exports[_0xe41f('0x84')]=function(_0x440900,_0x275537,_0x589da8){return db['Team'][_0xe41f('0x51')]({'where':{'id':_0x440900['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xe41f('0x73')],'as':_0xe41f('0x77'),'attributes':['id'],'raw':!![]}]})[_0xe41f('0x2a')](handleEntityNotFound(_0x275537,null))[_0xe41f('0x2a')](function(_0x5b8c7f){var _0x3ef844=_[_0xe41f('0x31')](_0x5b8c7f,'id');var _0x4dcf98=[];var _0x694b31=[];var _0x938753=squel[_0xe41f('0x85')]();_0x938753[_0xe41f('0x86')](_0xe41f('0x87'))[_0xe41f('0x88')](_0xe41f('0x89'),'tq')[_0xe41f('0x8a')](_0xe41f('0x8b'),'ut',_0xe41f('0x8c'))[_0xe41f('0x4d')](_0xe41f('0x8d'),_0x440900[_0xe41f('0x54')]['id']);for(var _0x5b1b2b=0x0;_0x5b1b2b<_0x5b8c7f['length'];_0x5b1b2b+=0x1){let _0x5cf61d=_0x5b8c7f[_0x5b1b2b];for(var _0x1959ae=0x0;_0x1959ae<_0x5cf61d[_0xe41f('0x77')][_0xe41f('0x48')];_0x1959ae+=0x1){let _0x4d3b75=_0x5cf61d[_0xe41f('0x77')][_0x1959ae];var _0x1d1a29=_0x938753[_0xe41f('0x60')]();_0x1d1a29[_0xe41f('0x4d')](_0xe41f('0x8e'),_0x4d3b75['id']);_0x694b31[_0xe41f('0x8f')](db['sequelize']['query'](_0x1d1a29[_0xe41f('0x90')](),{'type':db[_0xe41f('0x7a')][_0xe41f('0x91')][_0xe41f('0x92')]})[_0xe41f('0x2a')](function(_0x1b3d0e){if(_0x1b3d0e[_0xe41f('0x48')]===0x1){return _0x4d3b75['id'];}else{var _0x424237=_[_0xe41f('0x93')](_[_0xe41f('0x31')](_0x1b3d0e,'TeamId'),function(_0x3c4401){return _[_0xe41f('0x33')](_0x3ef844,_0x3c4401);});if(_0x424237){return _0x4d3b75['id'];}}}));}}return BPromise[_0xe41f('0x94')](_0x694b31)['then'](function(_0x5adb43){_0x4dcf98=_(_0x4dcf98)['union'](_0x5adb43)[_0xe41f('0x95')]()[_0xe41f('0x32')]();return db[_0xe41f('0x3d')][_0xe41f('0x35')]({'where':{'id':_0x440900[_0xe41f('0x54')]['id']}})[_0xe41f('0x2a')](function(_0x1efb37){return db[_0xe41f('0x7a')][_0xe41f('0x96')](function(_0x3f2ed1){return _0x1efb37[_0xe41f('0x84')](_0x440900[_0xe41f('0x42')][_0xe41f('0x97')],{'transaction':_0x3f2ed1})[_0xe41f('0x2a')](function(){if(!_[_0xe41f('0x98')](_0x4dcf98)){return _0x1efb37[_0xe41f('0x99')](_0x4dcf98,{'transaction':_0x3f2ed1})['then'](function(){return db[_0xe41f('0x7f')]['destroy']({'where':{'VoiceQueueId':_0x440900[_0xe41f('0x54')]['id'],'UserId':_0x4dcf98},'transaction':_0x3f2ed1});});}})['then'](function(){_0x4dcf98[_0xe41f('0x78')](function(_0x23daf4){socket[_0xe41f('0x82')](_0xe41f('0x9a'),{'UserId':_0x23daf4,'VoiceQueueId':_0x1efb37['id']});});});});});});})[_0xe41f('0x2a')](respondWithStatusCode(_0x275537,null))[_0xe41f('0x52')](handleError(_0x275537,null));};exports['addAgents']=function(_0x43d098,_0x1fdbab,_0x1a3a40){var _0x248862,_0xc14491;return db[_0xe41f('0x3d')][_0xe41f('0x35')]({'where':{'id':_0x43d098[_0xe41f('0x54')]['id']}})[_0xe41f('0x2a')](handleEntityNotFound(_0x1fdbab,null))[_0xe41f('0x2a')](function(_0x34fa74){if(_0x34fa74){_0xc14491=_0x34fa74;return _0x34fa74[_0xe41f('0x9b')](_0x43d098['body'][_0xe41f('0x97')],_[_0xe41f('0x61')](_0x43d098['body'],[_0xe41f('0x97'),'id'])||{})[_0xe41f('0x9c')](function(_0x1fb2bc){for(var _0x2c2b50=0x0;_0x2c2b50<_0x43d098[_0xe41f('0x57')]['ids'][_0xe41f('0x48')];_0x2c2b50+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x43d098[_0xe41f('0x57')][_0xe41f('0x97')][_0x2c2b50]),'VoiceQueueId':Number(_0x43d098[_0xe41f('0x54')]['id'])});}return _0x1fb2bc;});}})[_0xe41f('0x2a')](function(_0x42f566){_0x248862=_0x42f566||[];if(_0xc14491){return db[_0xe41f('0x73')]['findAll']({'where':{'id':_0x43d098['body']['ids']},'attributes':['id',_0xe41f('0x3a'),_0xe41f('0x74'),_0xe41f('0x75'),_0xe41f('0x9d')],'raw':!![]});}})[_0xe41f('0x2a')](function(_0x9f112a){if(!_[_0xe41f('0x98')](_0x9f112a)){var _0x2ed35f=[];for(var _0x4dab0a=0x0;_0x4dab0a<_0x9f112a[_0xe41f('0x48')];_0x4dab0a++){if(_0x9f112a[_0x4dab0a][_0xe41f('0x74')]){_0x2ed35f['push'](db[_0xe41f('0x7f')]['upsert']({'membername':_0x9f112a[_0x4dab0a][_0xe41f('0x3a')],'UserId':_0x9f112a[_0x4dab0a]['id'],'queue_name':_0xc14491['name'],'VoiceQueueId':_0xc14491['id'],'interface':_['isNil'](_0x9f112a[_0x4dab0a][_0xe41f('0x9d')])?util['format']('SIP/%s',_0x9f112a[_0x4dab0a]['name']):_0x9f112a[_0x4dab0a]['interface'],'paused':_0x9f112a[_0x4dab0a][_0xe41f('0x75')]||![],'penalty':_0x43d098[_0xe41f('0x57')][_0xe41f('0x79')]||0x0}));}}return BPromise[_0xe41f('0x94')](_0x2ed35f);}})[_0xe41f('0x2a')](function(){return _0x248862;})[_0xe41f('0x2a')](respondWithResult(_0x1fdbab,null))['catch'](handleError(_0x1fdbab,null));};exports['removeAgents']=function(_0x153b80,_0x349006,_0x12a52b){return db['VoiceQueue'][_0xe41f('0x35')]({'where':{'id':_0x153b80[_0xe41f('0x54')]['id']}})['then'](handleEntityNotFound(_0x349006,null))[_0xe41f('0x2a')](function(_0x3942fb){if(_0x3942fb){return _0x3942fb['removeAgents'](_0x153b80[_0xe41f('0x42')][_0xe41f('0x97')])['then'](function(){if(_[_0xe41f('0x9e')](_0x153b80[_0xe41f('0x42')][_0xe41f('0x97')])){for(var _0x3ac8e2=0x0;_0x3ac8e2<_0x153b80[_0xe41f('0x42')]['ids'][_0xe41f('0x48')];_0x3ac8e2+=0x1){socket[_0xe41f('0x82')](_0xe41f('0x9a'),{'UserId':Number(_0x153b80['query'][_0xe41f('0x97')][_0x3ac8e2]),'VoiceQueueId':Number(_0x153b80[_0xe41f('0x54')]['id'])});}}else{socket[_0xe41f('0x82')](_0xe41f('0x9a'),{'UserId':Number(_0x153b80[_0xe41f('0x42')]['ids']),'VoiceQueueId':Number(_0x153b80['params']['id'])});}});}})['then'](function(_0x1fb204){return db[_0xe41f('0x7f')][_0xe41f('0x37')]({'where':{'VoiceQueueId':_0x153b80[_0xe41f('0x54')]['id'],'UserId':_0x153b80[_0xe41f('0x42')][_0xe41f('0x97')]}})[_0xe41f('0x2a')](function(){return _0x1fb204;});})[_0xe41f('0x2a')](respondWithStatusCode(_0x349006,null))[_0xe41f('0x52')](handleError(_0x349006,null));};exports[_0xe41f('0x9f')]=function(_0x5701e4,_0x57ff12,_0x4c8582){var _0x442878={};var _0x4aea75={};var _0x48deac;var _0x3d9469;return db[_0xe41f('0x3d')][_0xe41f('0x65')]({'where':{'id':_0x5701e4[_0xe41f('0x54')]['id']}})['then'](handleEntityNotFound(_0x57ff12,null))['then'](function(_0x1a923a){if(_0x1a923a){_0x48deac=_0x1a923a;_0x4aea75[_0xe41f('0x45')]=_['keys'](db[_0xe41f('0x73')]['rawAttributes']);_0x4aea75[_0xe41f('0x42')]=_['keys'](_0x5701e4[_0xe41f('0x42')]);_0x4aea75[_0xe41f('0x43')]=_['intersection'](_0x4aea75['model'],_0x4aea75[_0xe41f('0x42')]);_0x442878[_0xe41f('0x46')]=_[_0xe41f('0x44')](_0x4aea75[_0xe41f('0x45')],qs[_0xe41f('0x47')](_0x5701e4[_0xe41f('0x42')]['fields']));_0x442878[_0xe41f('0x46')]=_0x442878[_0xe41f('0x46')][_0xe41f('0x48')]?_0x442878['attributes']:_0x4aea75['model'];_0x442878[_0xe41f('0x4b')]=qs['sort'](_0x5701e4[_0xe41f('0x42')]['sort']);_0x442878['where']=qs[_0xe41f('0x43')](_['pick'](_0x5701e4[_0xe41f('0x42')],_0x4aea75[_0xe41f('0x43')]));if(_0x5701e4['query'][_0xe41f('0x2f')]){_0x442878[_0xe41f('0x4d')]=_['merge'](_0x442878[_0xe41f('0x4d')],{'$or':_[_0xe41f('0x31')](_0x442878[_0xe41f('0x46')],function(_0x466077){var _0x1dff28={};_0x1dff28[_0x466077]={'$like':'%'+_0x5701e4[_0xe41f('0x42')]['filter']+'%'};return _0x1dff28;})});}_0x442878=_[_0xe41f('0x4e')]({},_0x442878,_0x5701e4[_0xe41f('0x55')]);return _0x48deac[_0xe41f('0x9f')](_0x442878);}})[_0xe41f('0x2a')](function(_0x1eaeee){if(_0x1eaeee){_0x3d9469=_0x1eaeee['length'];if(!_0x5701e4['query']['hasOwnProperty'](_0xe41f('0x4a'))){_0x442878['limit']=qs[_0xe41f('0x22')](_0x5701e4['query']['limit']);_0x442878[_0xe41f('0x20')]=qs[_0xe41f('0x20')](_0x5701e4['query'][_0xe41f('0x20')]);}return _0x48deac[_0xe41f('0x9f')](_0x442878);}})[_0xe41f('0x2a')](function(_0x7c3b2d){if(_0x7c3b2d){return _0x7c3b2d?{'count':_0x3d9469,'rows':_0x7c3b2d}:null;}})['then'](respondWithResult(_0x57ff12,null))[_0xe41f('0x52')](handleError(_0x57ff12,null));};exports['getMembers']=function(_0x558089,_0x107fe,_0x3af5a8){var _0x573564={};var _0x29a104={};var _0x58ce5d;var _0x11adf2;return db['VoiceQueue'][_0xe41f('0x65')]({'where':{'id':_0x558089['params']['id']}})['then'](handleEntityNotFound(_0x107fe,null))[_0xe41f('0x2a')](function(_0x2c0573){if(_0x2c0573){_0x58ce5d=_0x2c0573;_0x29a104[_0xe41f('0x45')]=_[_0xe41f('0x41')](db['UserVoiceQueueRt']['rawAttributes']);_0x29a104[_0xe41f('0x42')]=_[_0xe41f('0x41')](_0x558089[_0xe41f('0x42')]);_0x29a104[_0xe41f('0x43')]=_[_0xe41f('0x44')](_0x29a104[_0xe41f('0x45')],_0x29a104[_0xe41f('0x42')]);_0x573564[_0xe41f('0x46')]=_[_0xe41f('0x44')](_0x29a104[_0xe41f('0x45')],qs[_0xe41f('0x47')](_0x558089[_0xe41f('0x42')]['fields']));_0x573564['attributes']=_0x573564['attributes'][_0xe41f('0x48')]?_0x573564[_0xe41f('0x46')]:_0x29a104['model'];_0x573564[_0xe41f('0x4b')]=qs[_0xe41f('0x4c')](_0x558089['query']['sort']);_0x573564[_0xe41f('0x4d')]=qs[_0xe41f('0x43')](_[_0xe41f('0x6e')](_0x558089[_0xe41f('0x42')],_0x29a104[_0xe41f('0x43')]));if(_0x558089['query'][_0xe41f('0x2f')]){_0x573564[_0xe41f('0x4d')]=_[_0xe41f('0x4e')](_0x573564[_0xe41f('0x4d')],{'$or':_[_0xe41f('0x31')](_0x573564[_0xe41f('0x46')],function(_0x4ba713){var _0x32f7fd={};_0x32f7fd[_0x4ba713]={'$like':'%'+_0x558089['query']['filter']+'%'};return _0x32f7fd;})});}_0x573564=_['merge']({},_0x573564,_0x558089['options']);return _0x58ce5d[_0xe41f('0xa0')](_0x573564);}})['then'](function(_0x45885b){if(_0x45885b){_0x11adf2=_0x45885b[_0xe41f('0x48')];if(!_0x558089[_0xe41f('0x42')][_0xe41f('0x49')](_0xe41f('0x4a'))){_0x573564['limit']=qs[_0xe41f('0x22')](_0x558089[_0xe41f('0x42')][_0xe41f('0x22')]);_0x573564[_0xe41f('0x20')]=qs[_0xe41f('0x20')](_0x558089[_0xe41f('0x42')][_0xe41f('0x20')]);}return _0x58ce5d[_0xe41f('0xa0')](_0x573564);}})[_0xe41f('0x2a')](function(_0x5cf60b){return _0x5cf60b?{'count':_0x11adf2,'rows':_0x5cf60b}:null;})[_0xe41f('0x2a')](respondWithResult(_0x107fe,null))[_0xe41f('0x52')](handleError(_0x107fe,null));};exports['getLists']=function(_0xe7bc4d,_0x188fac,_0x4322a4){var _0x17166e={};var _0x4054a0={};var _0x1e7da7;var _0x26257d;return db['VoiceQueue'][_0xe41f('0x65')]({'where':{'id':_0xe7bc4d[_0xe41f('0x54')]['id']}})[_0xe41f('0x2a')](handleEntityNotFound(_0x188fac,null))['then'](function(_0x482b7d){if(_0x482b7d){_0x1e7da7=_0x482b7d;_0x4054a0[_0xe41f('0x45')]=_[_0xe41f('0x41')](db[_0xe41f('0xa1')]['rawAttributes']);_0x4054a0['query']=_[_0xe41f('0x41')](_0xe7bc4d[_0xe41f('0x42')]);_0x4054a0[_0xe41f('0x43')]=_['intersection'](_0x4054a0[_0xe41f('0x45')],_0x4054a0[_0xe41f('0x42')]);_0x17166e[_0xe41f('0x46')]=_[_0xe41f('0x44')](_0x4054a0[_0xe41f('0x45')],qs[_0xe41f('0x47')](_0xe7bc4d[_0xe41f('0x42')][_0xe41f('0x47')]));_0x17166e[_0xe41f('0x46')]=_0x17166e[_0xe41f('0x46')][_0xe41f('0x48')]?_0x17166e[_0xe41f('0x46')]:_0x4054a0[_0xe41f('0x45')];_0x17166e[_0xe41f('0x4b')]=qs[_0xe41f('0x4c')](_0xe7bc4d['query']['sort']);_0x17166e[_0xe41f('0x4d')]=qs['filters'](_['pick'](_0xe7bc4d[_0xe41f('0x42')],_0x4054a0[_0xe41f('0x43')]));if(_0xe7bc4d[_0xe41f('0x42')]['filter']){_0x17166e[_0xe41f('0x4d')]=_[_0xe41f('0x4e')](_0x17166e[_0xe41f('0x4d')],{'$or':_[_0xe41f('0x31')](_0x17166e[_0xe41f('0x46')],function(_0x401376){var _0x25e06c={};_0x25e06c[_0x401376]={'$like':'%'+_0xe7bc4d[_0xe41f('0x42')]['filter']+'%'};return _0x25e06c;})});}_0x17166e=_['merge']({},_0x17166e,_0xe7bc4d[_0xe41f('0x55')]);return _0x1e7da7[_0xe41f('0xa2')](_0x17166e);}})[_0xe41f('0x2a')](function(_0x5e3a22){if(_0x5e3a22){_0x26257d=_0x5e3a22['length'];if(!_0xe7bc4d[_0xe41f('0x42')]['hasOwnProperty'](_0xe41f('0x4a'))){_0x17166e[_0xe41f('0x22')]=qs[_0xe41f('0x22')](_0xe7bc4d[_0xe41f('0x42')][_0xe41f('0x22')]);_0x17166e['offset']=qs[_0xe41f('0x20')](_0xe7bc4d[_0xe41f('0x42')][_0xe41f('0x20')]);}return _0x1e7da7[_0xe41f('0xa2')](_0x17166e);}})[_0xe41f('0x2a')](function(_0x598f89){if(_0x598f89){return _0x598f89?{'count':_0x26257d,'rows':_0x598f89}:null;}})[_0xe41f('0x2a')](respondWithResult(_0x188fac,null))['catch'](handleError(_0x188fac,null));};exports['addLists']=function(_0x5dfc9f,_0x46c3b2,_0x535909){var _0x45f61a=moment()[_0xe41f('0x81')](_0xe41f('0xa3'));var _0x3d9c82,_0x332518;return db[_0xe41f('0x3d')][_0xe41f('0x35')]({'where':{'id':_0x5dfc9f[_0xe41f('0x54')]['id']}})[_0xe41f('0x2a')](handleEntityNotFound(_0x46c3b2,null))[_0xe41f('0x2a')](function(_0x2864c3){if(_0x2864c3){_0x332518=_0x2864c3;return _0x2864c3[_0xe41f('0xa4')](_0x5dfc9f[_0xe41f('0x57')][_0xe41f('0x97')],_[_0xe41f('0x61')](_0x5dfc9f[_0xe41f('0x57')],[_0xe41f('0x97'),'id'])||{});}return null;})[_0xe41f('0x9c')](function(_0x4ff5a9){var _0x38d8ad;_0x3d9c82=_0x4ff5a9||[];var _0x4bb242=[];if(_0x4ff5a9){for(var _0x5ab070=0x0;_0x5ab070<_0x4ff5a9[_0xe41f('0x48')];_0x5ab070+=0x1){var _0x14e00b=_0x4ff5a9[_0x5ab070]['get']({'plain':!![]});_0x332518[_0xe41f('0xa5')]=_0x5dfc9f[_0xe41f('0x57')][_0xe41f('0xa5')]?_0x5dfc9f[_0xe41f('0x57')][_0xe41f('0xa5')]:_0x332518[_0xe41f('0xa5')];switch(_0x332518['dialCheckDuplicateType']){case _0xe41f('0xa6'):_0x38d8ad=squel[_0xe41f('0xa7')]()[_0xe41f('0xa8')](_0xe41f('0xa9'))['fromQuery']([_0xe41f('0xaa'),_0xe41f('0xab'),_0xe41f('0xac'),'ListId',_0xe41f('0x66'),_0xe41f('0x62'),_0xe41f('0x63')],squel[_0xe41f('0x85')]()[_0xe41f('0x86')](_0xe41f('0xaa'),'phone')[_0xe41f('0x86')]('\x27'+_0x45f61a+'\x27',_0xe41f('0xab'))['field']('id','ContactId')[_0xe41f('0x86')](_0x14e00b[_0xe41f('0xad')]['toString'](),_0xe41f('0xae'))[_0xe41f('0x86')](_0x5dfc9f['params']['id']['toString'](),'VoiceQueueId')[_0xe41f('0x86')]('\x27'+_0x45f61a+'\x27',_0xe41f('0x62'))['field']('\x27'+_0x45f61a+'\x27','updatedAt')[_0xe41f('0x88')](_0xe41f('0xaf'))['where'](_0xe41f('0xb0'))[_0xe41f('0x4d')]('ListId\x20=\x20?',_0x14e00b[_0xe41f('0xad')][_0xe41f('0x90')]())[_0xe41f('0x4d')](_0xe41f('0xb1'))[_0xe41f('0x4d')](_0xe41f('0xb2'),squel['select']()['field'](_0xe41f('0xb3'))[_0xe41f('0x88')](_0xe41f('0xb4'))[_0xe41f('0x4d')](_0xe41f('0x8d'),_0x5dfc9f[_0xe41f('0x54')]['id'][_0xe41f('0x90')]()))[_0xe41f('0x4d')](_0xe41f('0xb2'),squel[_0xe41f('0x85')]()[_0xe41f('0x86')](_0xe41f('0xb5'))[_0xe41f('0x88')](_0xe41f('0xa9'))[_0xe41f('0x4d')](_0xe41f('0x8d'),_0x5dfc9f['params']['id'][_0xe41f('0x90')]())))[_0xe41f('0x90')]();break;case _0xe41f('0xb6'):_0x38d8ad=squel[_0xe41f('0xa7')]()[_0xe41f('0xa8')](_0xe41f('0xa9'))[_0xe41f('0xb7')]([_0xe41f('0xaa'),_0xe41f('0xab'),'ContactId',_0xe41f('0xae'),_0xe41f('0x66'),_0xe41f('0x62'),'updatedAt'],squel[_0xe41f('0x85')]()[_0xe41f('0x86')](_0xe41f('0xaa'),_0xe41f('0xaa'))[_0xe41f('0x86')]('\x27'+_0x45f61a+'\x27',_0xe41f('0xab'))[_0xe41f('0x86')]('id',_0xe41f('0xac'))[_0xe41f('0x86')](_0x14e00b[_0xe41f('0xad')][_0xe41f('0x90')](),'ListId')[_0xe41f('0x86')](_0x5dfc9f['params']['id'][_0xe41f('0x90')](),_0xe41f('0x66'))[_0xe41f('0x86')]('\x27'+_0x45f61a+'\x27',_0xe41f('0x62'))['field']('\x27'+_0x45f61a+'\x27',_0xe41f('0x63'))['from'](_0xe41f('0xaf'))['where'](_0xe41f('0xb0'))['where']('ListId\x20=\x20?',_0x14e00b['CmListId']['toString']())['where'](_0xe41f('0xb1'))[_0xe41f('0x4d')](_0xe41f('0xb2'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0xe41f('0x88')]('cm_hopper')[_0xe41f('0x4d')]('VoiceQueueId\x20=\x20?',_0x5dfc9f[_0xe41f('0x54')]['id']['toString']())))[_0xe41f('0x90')]();break;default:_0x38d8ad=squel[_0xe41f('0xa7')]()['into'](_0xe41f('0xa9'))[_0xe41f('0xb7')]([_0xe41f('0xaa'),_0xe41f('0xab'),_0xe41f('0xac'),_0xe41f('0xae'),_0xe41f('0x66'),_0xe41f('0x62'),'updatedAt'],squel[_0xe41f('0x85')]()[_0xe41f('0x86')](_0xe41f('0xaa'),_0xe41f('0xaa'))['field']('\x27'+_0x45f61a+'\x27','scheduledAt')[_0xe41f('0x86')]('id',_0xe41f('0xac'))['field'](_0x14e00b[_0xe41f('0xad')][_0xe41f('0x90')](),_0xe41f('0xae'))['field'](_0x5dfc9f[_0xe41f('0x54')]['id'][_0xe41f('0x90')](),_0xe41f('0x66'))['field']('\x27'+_0x45f61a+'\x27',_0xe41f('0x62'))[_0xe41f('0x86')]('\x27'+_0x45f61a+'\x27',_0xe41f('0x63'))[_0xe41f('0x88')](_0xe41f('0xaf'))[_0xe41f('0x4d')](_0xe41f('0xb0'))[_0xe41f('0x4d')](_0xe41f('0xb8'),_0x14e00b[_0xe41f('0xad')][_0xe41f('0x90')]())['where'](_0xe41f('0xb1')))[_0xe41f('0x90')]();}_0x4bb242[_0xe41f('0x8f')](db['sequelize'][_0xe41f('0x42')](_0x38d8ad));}return BPromise['all'](_0x4bb242);}})[_0xe41f('0x2a')](function(){var _0x21b49b=[];var _0x138421=squel[_0xe41f('0xa7')]()['into']('cm_hopper_additional_phones')[_0xe41f('0xb7')]([_0xe41f('0xb9'),_0xe41f('0xaa'),_0xe41f('0xba'),_0xe41f('0x62'),'updatedAt'],squel[_0xe41f('0x85')]()['field'](_0xe41f('0xbb'))[_0xe41f('0x86')]('ci.item')[_0xe41f('0x86')](_0xe41f('0xbc'))[_0xe41f('0x86')]('\x27'+_0x45f61a+'\x27',_0xe41f('0x62'))[_0xe41f('0x86')]('\x27'+_0x45f61a+'\x27',_0xe41f('0x63'))[_0xe41f('0x88')](_0xe41f('0xbd'),'ci')[_0xe41f('0x8a')](_0xe41f('0xa9'),'h',_0xe41f('0xbe'))[_0xe41f('0x4d')](_0xe41f('0xbf'),_0x45f61a)[_0xe41f('0x4d')](_0xe41f('0xc0'),'PHONE'))[_0xe41f('0x90')]();_0x21b49b[_0xe41f('0x8f')](db[_0xe41f('0x7a')][_0xe41f('0x42')](_0x138421));return BPromise['all'](_0x21b49b);})[_0xe41f('0x2a')](function(){return _0x3d9c82;})[_0xe41f('0x2a')](respondWithResult(_0x46c3b2,null))[_0xe41f('0x52')](handleError(_0x46c3b2,null));};exports[_0xe41f('0xc1')]=function(_0x69b1af,_0x361c2b,_0x11a1a4){return db['VoiceQueue'][_0xe41f('0x35')]({'where':{'id':_0x69b1af['params']['id']}})['then'](handleEntityNotFound(_0x361c2b,null))[_0xe41f('0x2a')](function(_0x28a226){if(_0x28a226){return _0x28a226[_0xe41f('0xc1')](_0x69b1af[_0xe41f('0x42')]['ids']);}})['then'](function(_0x1cb07a){if(_0x1cb07a){return db[_0xe41f('0x67')][_0xe41f('0x37')]({'where':{'ListId':_0x69b1af['query'][_0xe41f('0x97')],'VoiceQueueId':_0x69b1af[_0xe41f('0x54')]['id']}})[_0xe41f('0x2a')](function(){return _0x1cb07a;});}})[_0xe41f('0x2a')](respondWithStatusCode(_0x361c2b,null))[_0xe41f('0x52')](handleError(_0x361c2b,null));};exports[_0xe41f('0xc2')]=function(_0x304f4c,_0x4b245c,_0x588857){var _0x30eea4={};var _0x4bef34={};var _0x4e8e6c;var _0x131c3f;return db[_0xe41f('0x3d')][_0xe41f('0x65')]({'where':{'id':_0x304f4c[_0xe41f('0x54')]['id']}})[_0xe41f('0x2a')](handleEntityNotFound(_0x4b245c,null))[_0xe41f('0x2a')](function(_0x4621c7){if(_0x4621c7){_0x4e8e6c=_0x4621c7;_0x4bef34[_0xe41f('0x45')]=_['keys'](db[_0xe41f('0xa1')][_0xe41f('0x3e')]);_0x4bef34['query']=_[_0xe41f('0x41')](_0x304f4c[_0xe41f('0x42')]);_0x4bef34['filters']=_[_0xe41f('0x44')](_0x4bef34[_0xe41f('0x45')],_0x4bef34[_0xe41f('0x42')]);_0x30eea4['attributes']=_[_0xe41f('0x44')](_0x4bef34[_0xe41f('0x45')],qs[_0xe41f('0x47')](_0x304f4c['query'][_0xe41f('0x47')]));_0x30eea4[_0xe41f('0x46')]=_0x30eea4[_0xe41f('0x46')]['length']?_0x30eea4['attributes']:_0x4bef34[_0xe41f('0x45')];_0x30eea4[_0xe41f('0x4b')]=qs[_0xe41f('0x4c')](_0x304f4c[_0xe41f('0x42')][_0xe41f('0x4c')]);_0x30eea4[_0xe41f('0x4d')]=qs[_0xe41f('0x43')](_[_0xe41f('0x6e')](_0x304f4c[_0xe41f('0x42')],_0x4bef34[_0xe41f('0x43')]));if(_0x304f4c[_0xe41f('0x42')][_0xe41f('0x2f')]){_0x30eea4['where']=_[_0xe41f('0x4e')](_0x30eea4[_0xe41f('0x4d')],{'$or':_[_0xe41f('0x31')](_0x30eea4[_0xe41f('0x46')],function(_0x736931){var _0x3490f0={};_0x3490f0[_0x736931]={'$like':'%'+_0x304f4c[_0xe41f('0x42')][_0xe41f('0x2f')]+'%'};return _0x3490f0;})});}_0x30eea4=_[_0xe41f('0x4e')]({},_0x30eea4,_0x304f4c['options']);return _0x4e8e6c[_0xe41f('0xc2')](_0x30eea4);}})['then'](function(_0x518a56){if(_0x518a56){_0x131c3f=_0x518a56[_0xe41f('0x48')];if(!_0x304f4c[_0xe41f('0x42')]['hasOwnProperty'](_0xe41f('0x4a'))){_0x30eea4['limit']=qs[_0xe41f('0x22')](_0x304f4c[_0xe41f('0x42')][_0xe41f('0x22')]);_0x30eea4[_0xe41f('0x20')]=qs[_0xe41f('0x20')](_0x304f4c['query'][_0xe41f('0x20')]);}return _0x4e8e6c[_0xe41f('0xc2')](_0x30eea4);}})[_0xe41f('0x2a')](function(_0x2363e9){if(_0x2363e9){return _0x2363e9?{'count':_0x131c3f,'rows':_0x2363e9}:null;}})[_0xe41f('0x2a')](respondWithResult(_0x4b245c,null))[_0xe41f('0x52')](handleError(_0x4b245c,null));};exports[_0xe41f('0xc3')]=function(_0x491127,_0x24cb4f,_0x53b5dd){var _0x50c1e6,_0x181eb1;return db[_0xe41f('0x3d')][_0xe41f('0x35')]({'where':{'id':_0x491127[_0xe41f('0x54')]['id']}})[_0xe41f('0x2a')](handleEntityNotFound(_0x24cb4f,null))[_0xe41f('0x2a')](function(_0x3020f9){if(_0x3020f9){_0x181eb1=_0x3020f9;return _0x3020f9[_0xe41f('0xc3')](_0x491127[_0xe41f('0x57')][_0xe41f('0x97')],_['omit'](_0x491127[_0xe41f('0x57')],[_0xe41f('0x97'),'id'])||{});}return null;})['spread'](function(_0x424d30){var _0x3a744c;_0x50c1e6=_0x424d30||[];var _0x2727a2=[];if(_0x424d30){for(var _0x4afb28=0x0;_0x4afb28<_0x424d30['length'];_0x4afb28+=0x1){var _0x5dff85=_0x424d30[_0x4afb28][_0xe41f('0x2b')]({'plain':!![]});_0x3a744c=squel['insert']()[_0xe41f('0xa8')](_0xe41f('0xc4'))['fromQuery'](['phone',_0xe41f('0xac'),_0xe41f('0xae'),'VoiceQueueId',_0xe41f('0x62'),_0xe41f('0x63')],squel[_0xe41f('0x85')]()[_0xe41f('0x86')]('phone','phone')[_0xe41f('0x86')]('id',_0xe41f('0xac'))['field'](_0x5dff85[_0xe41f('0xad')][_0xe41f('0x90')](),_0xe41f('0xae'))['field'](_0x491127[_0xe41f('0x54')]['id']['toString'](),_0xe41f('0x66'))[_0xe41f('0x86')](_0xe41f('0xc5'),_0xe41f('0x62'))[_0xe41f('0x86')](_0xe41f('0xc5'),'updatedAt')[_0xe41f('0x88')](_0xe41f('0xaf'))[_0xe41f('0x4d')](_0xe41f('0xb0'))[_0xe41f('0x4d')](_0xe41f('0xb8'),_0x5dff85[_0xe41f('0xad')]['toString']())[_0xe41f('0x4d')](_0xe41f('0xb1')))['toString']();_0x2727a2[_0xe41f('0x8f')](db[_0xe41f('0x7a')][_0xe41f('0x42')](_0x3a744c));}return BPromise['all'](_0x2727a2);}})[_0xe41f('0x2a')](function(){return _0x50c1e6;})[_0xe41f('0x2a')](respondWithResult(_0x24cb4f,null))['catch'](handleError(_0x24cb4f,null));};exports[_0xe41f('0xc6')]=function(_0x56fb3a,_0x3c81aa,_0x5d7880){return db['VoiceQueue'][_0xe41f('0x35')]({'where':{'id':_0x56fb3a[_0xe41f('0x54')]['id']}})[_0xe41f('0x2a')](handleEntityNotFound(_0x3c81aa,null))[_0xe41f('0x2a')](function(_0x4431ce){if(_0x4431ce){return _0x4431ce['removeBlackLists'](_0x56fb3a[_0xe41f('0x42')][_0xe41f('0x97')]);}})['then'](function(_0x26c2dd){if(_0x26c2dd){return db[_0xe41f('0x6d')]['destroy']({'where':{'ListId':_0x56fb3a[_0xe41f('0x42')][_0xe41f('0x97')],'VoiceQueueId':_0x56fb3a[_0xe41f('0x54')]['id']}})[_0xe41f('0x2a')](function(){return _0x26c2dd;});}})['then'](respondWithStatusCode(_0x3c81aa,null))[_0xe41f('0x52')](handleError(_0x3c81aa,null));}; \ No newline at end of file +var _0xe55d=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','params','getHoppers','findOne','CmHopper','VoiceQueueId','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','teams','Agents','online','interface','flatMap','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','voicePause','emit','userVoiceQueue:save','removeTeams','ids','User','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','compact','isEmpty','addAgents','spread','isNil','format','SIP/%s','removeAgents','isArray','userVoiceQueue:remove','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','insert','cm_hopper','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','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/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','ignore','map','value','includes','type','find','error','stack','name','send','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','VoiceQueue','includeAll','findAll','include','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','UserProfileSection','userProfileId','autoAssociation'];(function(_0x58fae8,_0x104d38){var _0x18f808=function(_0x47c43d){while(--_0x47c43d){_0x58fae8['push'](_0x58fae8['shift']());}};_0x18f808(++_0x104d38);}(_0xe55d,0x126));var _0xde55=function(_0x13a880,_0x3e4e6b){_0x13a880=_0x13a880-0x0;var _0x3331c=_0xe55d[_0x13a880];return _0x3331c;};'use strict';var emlformat=require(_0xde55('0x0'));var rimraf=require(_0xde55('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde55('0x2'));var rp=require(_0xde55('0x3'));var moment=require(_0xde55('0x4'));var BPromise=require(_0xde55('0x5'));var Mustache=require(_0xde55('0x6'));var util=require(_0xde55('0x7'));var path=require('path');var sox=require(_0xde55('0x8'));var csv=require(_0xde55('0x9'));var ejs=require(_0xde55('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde55('0xb'));var squel=require(_0xde55('0xc'));var crypto=require(_0xde55('0xd'));var jsforce=require(_0xde55('0xe'));var deskjs=require(_0xde55('0xf'));var toCsv=require(_0xde55('0x9'));var querystring=require('querystring');var Papa=require(_0xde55('0x10'));var Redis=require(_0xde55('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xde55('0x12'));var hardwareService=require(_0xde55('0x13'));var logger=require('../../config/logger')(_0xde55('0x14'));var utils=require(_0xde55('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xde55('0x16'));var db=require(_0xde55('0x17'))['db'];config[_0xde55('0x18')]=_['defaults'](config[_0xde55('0x18')],{'host':_0xde55('0x19'),'port':0x18eb});var socket=require(_0xde55('0x1a'))(new Redis(config[_0xde55('0x18')]));require(_0xde55('0x1b'))[_0xde55('0x1c')](socket);function respondWithStatusCode(_0x5844c9,_0x5ac66e){_0x5ac66e=_0x5ac66e||0xcc;return function(_0x246d37){if(_0x246d37){return _0x5844c9[_0xde55('0x1d')](_0x5ac66e);}return _0x5844c9['status'](_0x5ac66e)[_0xde55('0x1e')]();};}function respondWithResult(_0x3dbdcb,_0x2de955){_0x2de955=_0x2de955||0xc8;return function(_0x40c59a){if(_0x40c59a){return _0x3dbdcb[_0xde55('0x1f')](_0x2de955)[_0xde55('0x20')](_0x40c59a);}};}function respondWithFilteredResult(_0x2411a4,_0x400635){return function(_0x4a97e2){if(_0x4a97e2){var _0x1abffb=typeof _0x400635[_0xde55('0x21')]===_0xde55('0x22')&&typeof _0x400635[_0xde55('0x23')]==='undefined';var _0x4113f4=_0x4a97e2['count'];var _0x45a7e5=_0x1abffb?0x0:_0x400635[_0xde55('0x21')];var _0x5c0a7e=_0x1abffb?_0x4a97e2[_0xde55('0x24')]:_0x400635['offset']+_0x400635[_0xde55('0x23')];var _0x5597a4;if(_0x5c0a7e>=_0x4113f4){_0x5c0a7e=_0x4113f4;_0x5597a4=0xc8;}else{_0x5597a4=0xce;}_0x2411a4[_0xde55('0x1f')](_0x5597a4);return _0x2411a4['set'](_0xde55('0x25'),_0x45a7e5+'-'+_0x5c0a7e+'/'+_0x4113f4)[_0xde55('0x20')](_0x4a97e2);}return null;};}function patchUpdates(_0x415463){return function(_0x2dacc6){try{jsonpatch[_0xde55('0x26')](_0x2dacc6,_0x415463,!![]);}catch(_0x29e69c){return BPromise[_0xde55('0x27')](_0x29e69c);}return _0x2dacc6[_0xde55('0x28')]();};}function saveUpdates(_0x2e5595,_0x4ea2dd){return function(_0x4bce65){if(_0x4bce65){return _0x4bce65[_0xde55('0x29')](_0x2e5595)[_0xde55('0x2a')](function(_0x15a04b){return _0x15a04b;});}return null;};}function removeEntity(_0x36488b,_0x2ece31){return function(_0x4370e6){if(_0x4370e6){return _0x4370e6[_0xde55('0x2b')]()[_0xde55('0x2a')](function(){var _0x35f246=_0x4370e6[_0xde55('0x2c')]({'plain':!![]});var _0xee8062=[{'name':_0xde55('0x2d'),'value':_0xde55('0x2e'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x2073c1=_(_0xee8062)['filter'](_0xde55('0x2f'))[_0xde55('0x30')](_0xde55('0x31'))['value']();if(_[_0xde55('0x32')](_0x2073c1,_0x35f246[_0xde55('0x33')])){return;}var _0x5babe1=_[_0xde55('0x34')](_0xee8062,[_0xde55('0x31'),_0x35f246[_0xde55('0x33')]])['name'];return db['UserProfileResource'][_0xde55('0x2b')]({'where':{'type':_0x5babe1,'resourceId':_0x35f246['id']}})[_0xde55('0x2a')](function(){return _0x4370e6;});})[_0xde55('0x2a')](function(){_0x36488b[_0xde55('0x1f')](0xcc)[_0xde55('0x1e')]();});}};}function handleEntityNotFound(_0x2f0e00,_0x576a03){return function(_0x2467e2){if(!_0x2467e2){_0x2f0e00[_0xde55('0x1d')](0x194);}return _0x2467e2;};}function handleError(_0xfb293c,_0x485c88){_0x485c88=_0x485c88||0x1f4;return function(_0x3ee702){logger[_0xde55('0x35')](_0x3ee702[_0xde55('0x36')]);if(_0x3ee702[_0xde55('0x37')]){delete _0x3ee702[_0xde55('0x37')];}_0xfb293c[_0xde55('0x1f')](_0x485c88)[_0xde55('0x38')](_0x3ee702);};}exports['index']=function(_0x43c8eb,_0x3daf72){var _0x3dc778={},_0x557097={},_0x17a0c5={'count':0x0,'rows':[]};var _0x4e50dd=_[_0xde55('0x30')](db['VoiceQueue'][_0xde55('0x39')],function(_0x1dab76){return{'name':_0x1dab76['fieldName'],'type':_0x1dab76['type']['key']};});_0x557097[_0xde55('0x3a')]=_[_0xde55('0x30')](_0x4e50dd,_0xde55('0x37'));_0x557097[_0xde55('0x3b')]=_[_0xde55('0x3c')](_0x43c8eb[_0xde55('0x3b')]);_0x557097[_0xde55('0x3d')]=_[_0xde55('0x3e')](_0x557097['model'],_0x557097['query']);_0x3dc778[_0xde55('0x3f')]=_[_0xde55('0x3e')](_0x557097[_0xde55('0x3a')],qs[_0xde55('0x40')](_0x43c8eb[_0xde55('0x3b')][_0xde55('0x40')]));_0x3dc778[_0xde55('0x3f')]=_0x3dc778[_0xde55('0x3f')][_0xde55('0x41')]?_0x3dc778[_0xde55('0x3f')]:_0x557097[_0xde55('0x3a')];if(!_0x43c8eb[_0xde55('0x3b')][_0xde55('0x42')](_0xde55('0x43'))){_0x3dc778[_0xde55('0x23')]=qs[_0xde55('0x23')](_0x43c8eb[_0xde55('0x3b')][_0xde55('0x23')]);_0x3dc778[_0xde55('0x21')]=qs['offset'](_0x43c8eb[_0xde55('0x3b')]['offset']);}_0x3dc778[_0xde55('0x44')]=qs[_0xde55('0x45')](_0x43c8eb[_0xde55('0x3b')][_0xde55('0x45')]);_0x3dc778[_0xde55('0x46')]=qs[_0xde55('0x3d')](_[_0xde55('0x47')](_0x43c8eb[_0xde55('0x3b')],_0x557097['filters']),_0x4e50dd);if(_0x43c8eb[_0xde55('0x3b')][_0xde55('0x48')]){_0x3dc778[_0xde55('0x46')]=_['merge'](_0x3dc778[_0xde55('0x46')],{'$or':_[_0xde55('0x30')](_0x4e50dd,function(_0x5f183a){if(_0x5f183a[_0xde55('0x33')]!=='VIRTUAL'){var _0x4703f3={};_0x4703f3[_0x5f183a[_0xde55('0x37')]]={'$like':'%'+_0x43c8eb[_0xde55('0x3b')][_0xde55('0x48')]+'%'};return _0x4703f3;}})});}_0x3dc778=_[_0xde55('0x49')]({},_0x3dc778,_0x43c8eb[_0xde55('0x4a')]);var _0x3b5ad5={'where':_0x3dc778[_0xde55('0x46')]};return db[_0xde55('0x4b')][_0xde55('0x24')](_0x3b5ad5)['then'](function(_0x6a05a1){_0x17a0c5['count']=_0x6a05a1;if(_0x43c8eb[_0xde55('0x3b')][_0xde55('0x4c')]){_0x3dc778['include']=[{'all':!![]}];}return db[_0xde55('0x4b')][_0xde55('0x4d')](_0x3dc778);})[_0xde55('0x2a')](function(_0x38a9a0){_0x17a0c5['rows']=_0x38a9a0;return _0x17a0c5;})['then'](respondWithFilteredResult(_0x3daf72,_0x3dc778))['catch'](handleError(_0x3daf72,null));};exports['show']=function(_0x382a21,_0xab1c10){var _0x5ef7e1={'raw':![],'where':{'id':_0x382a21['params']['id']}},_0x14e9fb={};_0x14e9fb['model']=_[_0xde55('0x3c')](db[_0xde55('0x4b')]['rawAttributes']);_0x14e9fb['query']=_[_0xde55('0x3c')](_0x382a21[_0xde55('0x3b')]);_0x14e9fb[_0xde55('0x3d')]=_[_0xde55('0x3e')](_0x14e9fb[_0xde55('0x3a')],_0x14e9fb[_0xde55('0x3b')]);_0x5ef7e1[_0xde55('0x3f')]=_['intersection'](_0x14e9fb[_0xde55('0x3a')],qs[_0xde55('0x40')](_0x382a21['query'][_0xde55('0x40')]));_0x5ef7e1[_0xde55('0x3f')]=_0x5ef7e1[_0xde55('0x3f')][_0xde55('0x41')]?_0x5ef7e1[_0xde55('0x3f')]:_0x14e9fb[_0xde55('0x3a')];if(_0x382a21[_0xde55('0x3b')][_0xde55('0x4c')]){_0x5ef7e1[_0xde55('0x4e')]=[{'all':!![]}];}_0x5ef7e1=_[_0xde55('0x49')]({},_0x5ef7e1,_0x382a21[_0xde55('0x4a')]);return db[_0xde55('0x4b')][_0xde55('0x34')](_0x5ef7e1)[_0xde55('0x2a')](handleEntityNotFound(_0xab1c10,null))[_0xde55('0x2a')](respondWithResult(_0xab1c10,null))[_0xde55('0x4f')](handleError(_0xab1c10,null));};exports['create']=function(_0x5630f3,_0x58d52e){return db[_0xde55('0x4b')]['create'](_0x5630f3[_0xde55('0x50')],{})[_0xde55('0x2a')](function(_0x5d3754){var _0x2abfa5=_0x5630f3[_0xde55('0x51')]['get']({'plain':!![]});if(!_0x2abfa5)throw new Error(_0xde55('0x52'));if(_0x2abfa5[_0xde55('0x53')]===_0xde55('0x51')){var _0x32838a=_0x5d3754['get']({'plain':!![]});var _0x318980=[{'name':_0xde55('0x2d'),'value':_0xde55('0x2e')},{'name':'QueueCampaigns','value':_0xde55('0x54')}];var _0x3d118a=_[_0xde55('0x34')](_0x318980,[_0xde55('0x31'),_0x32838a['type']])['name'];return db[_0xde55('0x55')][_0xde55('0x34')]({'where':{'name':_0x3d118a,'userProfileId':_0x2abfa5[_0xde55('0x56')]},'raw':!![]})[_0xde55('0x2a')](function(_0x424ad4){if(_0x424ad4&&_0x424ad4[_0xde55('0x57')]===0x0){return db[_0xde55('0x58')]['create']({'name':_0x32838a[_0xde55('0x37')],'resourceId':_0x32838a['id'],'type':_0x424ad4[_0xde55('0x37')],'sectionId':_0x424ad4['id']},{})[_0xde55('0x2a')](function(){return _0x5d3754;});}else{return _0x5d3754;}})[_0xde55('0x4f')](function(_0x283066){logger[_0xde55('0x35')](_0xde55('0x59'),_0x283066);throw _0x283066;});}return _0x5d3754;})[_0xde55('0x2a')](respondWithResult(_0x58d52e,0xc9))[_0xde55('0x4f')](handleError(_0x58d52e,null));};exports['clone']=function(_0x41fc15,_0x354cbd){var _0x7ccd55={'where':{'id':_0x41fc15['params']['id']}},_0x5d5c8f={};_0x5d5c8f[_0xde55('0x3a')]=_['keys'](db[_0xde55('0x4b')]['rawAttributes']);_0x7ccd55[_0xde55('0x3f')]=_[_0xde55('0x3e')](_0x5d5c8f[_0xde55('0x3a')],qs[_0xde55('0x40')](_0x41fc15['query'][_0xde55('0x40')]));_0x7ccd55['attributes']=_0x7ccd55[_0xde55('0x3f')][_0xde55('0x41')]?_0x7ccd55['attributes']:_0x5d5c8f['model'];if(_0x41fc15[_0xde55('0x3b')][_0xde55('0x4c')]){_0x7ccd55[_0xde55('0x4e')]=[{'all':!![]}];}_0x7ccd55=_[_0xde55('0x49')]({},_0x7ccd55,_0x41fc15[_0xde55('0x4a')]);return db['VoiceQueue'][_0xde55('0x34')](_0x7ccd55)['then'](handleEntityNotFound(_0x354cbd,null))[_0xde55('0x2a')](function(_0x444103){if(_0x444103){var _0x31f08e=_0x444103[_0xde55('0x2c')]({'plain':!![]});_0x31f08e=qs['omit'](_0x31f08e,['id',_0xde55('0x5a'),_0xde55('0x5b')]);_0x41fc15[_0xde55('0x50')]=_[_0xde55('0x5c')](_0x41fc15['body'],['id','createdAt',_0xde55('0x5b')]);return db[_0xde55('0x4b')]['create'](_['merge'](_0x31f08e,_0x41fc15[_0xde55('0x50')]),{'include':_0x41fc15[_0xde55('0x3b')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3a2610){var _0x1dedd1=_0x41fc15['user']['get']({'plain':!![]});if(!_0x1dedd1)throw new Error(_0xde55('0x52'));if(_0x1dedd1[_0xde55('0x53')]==='user'){var _0x44648a=_0x3a2610[_0xde55('0x2c')]({'plain':!![]});var _0x4e5ffd=[{'name':_0xde55('0x2d'),'value':'inbound'},{'name':'QueueCampaigns','value':_0xde55('0x54')}];var _0x3bd0ce=_[_0xde55('0x34')](_0x4e5ffd,[_0xde55('0x31'),_0x44648a['type']])[_0xde55('0x37')];return db[_0xde55('0x55')][_0xde55('0x34')]({'where':{'name':_0x3bd0ce,'userProfileId':_0x1dedd1[_0xde55('0x56')]},'raw':!![]})[_0xde55('0x2a')](function(_0x594ad7){if(_0x594ad7&&_0x594ad7[_0xde55('0x57')]===0x0){return db[_0xde55('0x58')]['create']({'name':_0x44648a[_0xde55('0x37')],'resourceId':_0x44648a['id'],'type':_0x594ad7[_0xde55('0x37')],'sectionId':_0x594ad7['id']},{})[_0xde55('0x2a')](function(){return _0x3a2610;});}else{return _0x3a2610;}})[_0xde55('0x4f')](function(_0x22a6e5){logger[_0xde55('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22a6e5);throw _0x22a6e5;});}return _0x3a2610;});}})[_0xde55('0x2a')](respondWithResult(_0x354cbd,0xc9))[_0xde55('0x4f')](handleError(_0x354cbd,null));};exports[_0xde55('0x29')]=function(_0x233e1b,_0x18b01d){if(_0x233e1b[_0xde55('0x50')]['id']){delete _0x233e1b['body']['id'];}return db[_0xde55('0x4b')]['find']({'where':{'id':_0x233e1b[_0xde55('0x5d')]['id']}})[_0xde55('0x2a')](handleEntityNotFound(_0x18b01d,null))['then'](saveUpdates(_0x233e1b[_0xde55('0x50')],null))['then'](respondWithResult(_0x18b01d,null))['catch'](handleError(_0x18b01d,null));};exports[_0xde55('0x2b')]=function(_0xf22dda,_0x503e9d){return db['VoiceQueue'][_0xde55('0x34')]({'where':{'id':_0xf22dda['params']['id']}})[_0xde55('0x2a')](handleEntityNotFound(_0x503e9d,null))[_0xde55('0x2a')](removeEntity(_0x503e9d,null))['catch'](handleError(_0x503e9d,null));};exports[_0xde55('0x5e')]=function(_0x1f07ec,_0x4198db,_0x1771d4){var _0x395151={'raw':![],'where':{}};var _0x5d16fc={};var _0x5c5311={'count':0x0,'rows':[]};return db[_0xde55('0x4b')][_0xde55('0x5f')]({'where':{'id':_0x1f07ec[_0xde55('0x5d')]['id']}})[_0xde55('0x2a')](handleEntityNotFound(_0x4198db,null))[_0xde55('0x2a')](function(_0x3e5e80){if(_0x3e5e80){_0x5d16fc['model']=_[_0xde55('0x3c')](db[_0xde55('0x60')][_0xde55('0x39')]);_0x5d16fc['query']=_[_0xde55('0x3c')](_0x1f07ec[_0xde55('0x3b')]);_0x5d16fc['filters']=_[_0xde55('0x3e')](_0x5d16fc[_0xde55('0x3a')],_0x5d16fc[_0xde55('0x3b')]);_0x395151[_0xde55('0x3f')]=_[_0xde55('0x3e')](_0x5d16fc[_0xde55('0x3a')],qs[_0xde55('0x40')](_0x1f07ec['query'][_0xde55('0x40')]));_0x395151[_0xde55('0x3f')]=_0x395151[_0xde55('0x3f')][_0xde55('0x41')]?_0x395151[_0xde55('0x3f')]:_0x5d16fc[_0xde55('0x3a')];if(!_0x1f07ec[_0xde55('0x3b')][_0xde55('0x42')](_0xde55('0x43'))){_0x395151[_0xde55('0x23')]=qs['limit'](_0x1f07ec[_0xde55('0x3b')][_0xde55('0x23')]);_0x395151[_0xde55('0x21')]=qs[_0xde55('0x21')](_0x1f07ec[_0xde55('0x3b')][_0xde55('0x21')]);}_0x395151[_0xde55('0x44')]=qs[_0xde55('0x45')](_0x1f07ec[_0xde55('0x3b')]['sort']);_0x395151['where']=qs['filters'](_[_0xde55('0x47')](_0x1f07ec[_0xde55('0x3b')],_0x5d16fc[_0xde55('0x3d')]));_0x395151[_0xde55('0x46')][_0xde55('0x61')]=_0x3e5e80['id'];if(_0x1f07ec[_0xde55('0x3b')][_0xde55('0x48')]){_0x395151['where']=_[_0xde55('0x49')](_0x395151[_0xde55('0x46')],{'$or':_['map'](_0x395151[_0xde55('0x3f')],function(_0x8d6e4a){var _0x1d2fd1={};_0x1d2fd1[_0x8d6e4a]={'$like':'%'+_0x1f07ec['query'][_0xde55('0x48')]+'%'};return _0x1d2fd1;})});}_0x395151=_[_0xde55('0x49')]({},_0x395151,_0x1f07ec[_0xde55('0x4a')]);return db[_0xde55('0x60')][_0xde55('0x24')]({'where':_0x395151[_0xde55('0x46')]})['then'](function(_0x4439e4){_0x5c5311['count']=_0x4439e4;if(_0x1f07ec[_0xde55('0x3b')]['includeAll']){_0x395151[_0xde55('0x4e')]=[{'all':!![]}];}return db['CmHopper'][_0xde55('0x4d')](_0x395151);})[_0xde55('0x2a')](function(_0xc30d61){_0x5c5311['rows']=_0xc30d61;return _0x5c5311;});}})['then'](respondWithFilteredResult(_0x4198db,_0x395151))[_0xde55('0x4f')](handleError(_0x4198db,null));};exports['getHopperHistories']=function(_0x4e1a7a,_0x594d0b,_0x1bca28){var _0x36bca5={'raw':!![],'where':{}};var _0xe1b093={};var _0x29ffed={'count':0x0,'rows':[]};return db[_0xde55('0x4b')][_0xde55('0x5f')]({'where':{'id':_0x4e1a7a[_0xde55('0x5d')]['id']}})[_0xde55('0x2a')](handleEntityNotFound(_0x594d0b,null))[_0xde55('0x2a')](function(_0x1c8a80){if(_0x1c8a80){_0xe1b093[_0xde55('0x3a')]=_['keys'](db[_0xde55('0x62')][_0xde55('0x39')]);_0xe1b093[_0xde55('0x3b')]=_[_0xde55('0x3c')](_0x4e1a7a[_0xde55('0x3b')]);_0xe1b093['filters']=_[_0xde55('0x3e')](_0xe1b093[_0xde55('0x3a')],_0xe1b093[_0xde55('0x3b')]);_0x36bca5[_0xde55('0x3f')]=_[_0xde55('0x3e')](_0xe1b093['model'],qs[_0xde55('0x40')](_0x4e1a7a['query'][_0xde55('0x40')]));_0x36bca5[_0xde55('0x3f')]=_0x36bca5[_0xde55('0x3f')]['length']?_0x36bca5['attributes']:_0xe1b093['model'];if(!_0x4e1a7a[_0xde55('0x3b')][_0xde55('0x42')](_0xde55('0x43'))){_0x36bca5[_0xde55('0x23')]=qs[_0xde55('0x23')](_0x4e1a7a['query'][_0xde55('0x23')]);_0x36bca5['offset']=qs[_0xde55('0x21')](_0x4e1a7a[_0xde55('0x3b')][_0xde55('0x21')]);}_0x36bca5['order']=qs[_0xde55('0x45')](_0x4e1a7a[_0xde55('0x3b')][_0xde55('0x45')]);_0x36bca5['where']=qs['filters'](_[_0xde55('0x47')](_0x4e1a7a[_0xde55('0x3b')],_0xe1b093['filters']));_0x36bca5[_0xde55('0x46')]['VoiceQueueId']=_0x1c8a80['id'];if(_0x4e1a7a[_0xde55('0x3b')][_0xde55('0x48')]){_0x36bca5[_0xde55('0x46')]=_[_0xde55('0x49')](_0x36bca5[_0xde55('0x46')],{'$or':_[_0xde55('0x30')](_0x36bca5['attributes'],function(_0x2a5c73){var _0x33dd3a={};_0x33dd3a[_0x2a5c73]={'$like':'%'+_0x4e1a7a[_0xde55('0x3b')][_0xde55('0x48')]+'%'};return _0x33dd3a;})});}_0x36bca5=_[_0xde55('0x49')]({},_0x36bca5,_0x4e1a7a[_0xde55('0x4a')]);return db[_0xde55('0x62')]['count']({'where':_0x36bca5[_0xde55('0x46')]})[_0xde55('0x2a')](function(_0x449109){_0x29ffed[_0xde55('0x24')]=_0x449109;if(_0x4e1a7a[_0xde55('0x3b')][_0xde55('0x4c')]){_0x36bca5[_0xde55('0x4e')]=[{'all':!![]}];}return db[_0xde55('0x62')][_0xde55('0x4d')](_0x36bca5);})['then'](function(_0x284878){_0x29ffed[_0xde55('0x63')]=_0x284878;return _0x29ffed;});}})['then'](respondWithFilteredResult(_0x594d0b,_0x36bca5))[_0xde55('0x4f')](handleError(_0x594d0b,null));};exports[_0xde55('0x64')]=function(_0x523414,_0x51da1c,_0x1138a3){var _0x57e4ff={'raw':!![],'where':{}};var _0x48d183={};var _0x178262={'count':0x0,'rows':[]};return db[_0xde55('0x4b')][_0xde55('0x5f')]({'where':{'id':_0x523414['params']['id']}})[_0xde55('0x2a')](handleEntityNotFound(_0x51da1c,null))[_0xde55('0x2a')](function(_0x496aa7){if(_0x496aa7){_0x48d183[_0xde55('0x3a')]=_[_0xde55('0x3c')](db[_0xde55('0x65')][_0xde55('0x39')]);_0x48d183[_0xde55('0x3b')]=_[_0xde55('0x3c')](_0x523414[_0xde55('0x3b')]);_0x48d183[_0xde55('0x3d')]=_['intersection'](_0x48d183['model'],_0x48d183[_0xde55('0x3b')]);_0x57e4ff[_0xde55('0x3f')]=_[_0xde55('0x3e')](_0x48d183[_0xde55('0x3a')],qs['fields'](_0x523414[_0xde55('0x3b')][_0xde55('0x40')]));_0x57e4ff[_0xde55('0x3f')]=_0x57e4ff[_0xde55('0x3f')][_0xde55('0x41')]?_0x57e4ff['attributes']:_0x48d183['model'];if(!_0x523414[_0xde55('0x3b')][_0xde55('0x42')](_0xde55('0x43'))){_0x57e4ff[_0xde55('0x23')]=qs[_0xde55('0x23')](_0x523414[_0xde55('0x3b')][_0xde55('0x23')]);_0x57e4ff['offset']=qs[_0xde55('0x21')](_0x523414['query'][_0xde55('0x21')]);}_0x57e4ff[_0xde55('0x44')]=qs[_0xde55('0x45')](_0x523414[_0xde55('0x3b')][_0xde55('0x45')]);_0x57e4ff['where']=qs[_0xde55('0x3d')](_['pick'](_0x523414['query'],_0x48d183['filters']));_0x57e4ff[_0xde55('0x46')][_0xde55('0x61')]=_0x496aa7['id'];if(_0x523414[_0xde55('0x3b')][_0xde55('0x48')]){_0x57e4ff[_0xde55('0x46')]=_[_0xde55('0x49')](_0x57e4ff['where'],{'$or':_[_0xde55('0x30')](_0x57e4ff[_0xde55('0x3f')],function(_0x457fde){var _0x5e7195={};_0x5e7195[_0x457fde]={'$like':'%'+_0x523414[_0xde55('0x3b')]['filter']+'%'};return _0x5e7195;})});}_0x57e4ff=_[_0xde55('0x49')]({},_0x57e4ff,_0x523414[_0xde55('0x4a')]);return db[_0xde55('0x65')][_0xde55('0x24')]({'where':_0x57e4ff['where']})[_0xde55('0x2a')](function(_0x1668fe){_0x178262[_0xde55('0x24')]=_0x1668fe;if(_0x523414[_0xde55('0x3b')][_0xde55('0x4c')]){_0x57e4ff['include']=[{'all':!![]}];}return db[_0xde55('0x65')][_0xde55('0x4d')](_0x57e4ff);})[_0xde55('0x2a')](function(_0x4ce5ab){_0x178262[_0xde55('0x63')]=_0x4ce5ab;return _0x178262;});}})[_0xde55('0x2a')](respondWithFilteredResult(_0x51da1c,_0x57e4ff))[_0xde55('0x4f')](handleError(_0x51da1c,null));};exports['getHopperBlacks']=function(_0x26bd73,_0x5c9fc9,_0x394303){var _0x46981a={'raw':!![],'where':{}};var _0x1b560d={};var _0x36d229={'count':0x0,'rows':[]};return db[_0xde55('0x4b')][_0xde55('0x5f')]({'where':{'id':_0x26bd73[_0xde55('0x5d')]['id']}})[_0xde55('0x2a')](handleEntityNotFound(_0x5c9fc9,null))['then'](function(_0x34a99d){if(_0x34a99d){_0x1b560d[_0xde55('0x3a')]=_[_0xde55('0x3c')](db[_0xde55('0x66')][_0xde55('0x39')]);_0x1b560d[_0xde55('0x3b')]=_[_0xde55('0x3c')](_0x26bd73[_0xde55('0x3b')]);_0x1b560d[_0xde55('0x3d')]=_[_0xde55('0x3e')](_0x1b560d[_0xde55('0x3a')],_0x1b560d[_0xde55('0x3b')]);_0x46981a[_0xde55('0x3f')]=_[_0xde55('0x3e')](_0x1b560d[_0xde55('0x3a')],qs[_0xde55('0x40')](_0x26bd73[_0xde55('0x3b')][_0xde55('0x40')]));_0x46981a[_0xde55('0x3f')]=_0x46981a[_0xde55('0x3f')]['length']?_0x46981a[_0xde55('0x3f')]:_0x1b560d[_0xde55('0x3a')];if(!_0x26bd73[_0xde55('0x3b')][_0xde55('0x42')](_0xde55('0x43'))){_0x46981a['limit']=qs[_0xde55('0x23')](_0x26bd73['query'][_0xde55('0x23')]);_0x46981a['offset']=qs[_0xde55('0x21')](_0x26bd73['query'][_0xde55('0x21')]);}_0x46981a[_0xde55('0x44')]=qs['sort'](_0x26bd73['query']['sort']);_0x46981a[_0xde55('0x46')]=qs[_0xde55('0x3d')](_[_0xde55('0x47')](_0x26bd73[_0xde55('0x3b')],_0x1b560d['filters']));_0x46981a['where']['VoiceQueueId']=_0x34a99d['id'];if(_0x26bd73['query'][_0xde55('0x48')]){_0x46981a['where']=_[_0xde55('0x49')](_0x46981a[_0xde55('0x46')],{'$or':_['map'](_0x46981a[_0xde55('0x3f')],function(_0x5644cf){var _0x2d096f={};_0x2d096f[_0x5644cf]={'$like':'%'+_0x26bd73['query'][_0xde55('0x48')]+'%'};return _0x2d096f;})});}_0x46981a=_[_0xde55('0x49')]({},_0x46981a,_0x26bd73[_0xde55('0x4a')]);return db[_0xde55('0x66')][_0xde55('0x24')]({'where':_0x46981a[_0xde55('0x46')]})[_0xde55('0x2a')](function(_0x20f704){_0x36d229[_0xde55('0x24')]=_0x20f704;if(_0x26bd73['query'][_0xde55('0x4c')]){_0x46981a[_0xde55('0x4e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xde55('0x4d')](_0x46981a);})[_0xde55('0x2a')](function(_0x38beb0){_0x36d229['rows']=_0x38beb0;return _0x36d229;});}})['then'](respondWithFilteredResult(_0x5c9fc9,_0x46981a))['catch'](handleError(_0x5c9fc9,null));};exports[_0xde55('0x67')]=function(_0x2b3a18,_0x4ecc5c,_0x887580){var _0x398b98={};var _0x5b3633={};var _0x176152;var _0x2db2c2;return db[_0xde55('0x4b')]['findOne']({'where':{'id':_0x2b3a18['params']['id']}})['then'](handleEntityNotFound(_0x4ecc5c,null))[_0xde55('0x2a')](function(_0x4738ed){if(_0x4738ed){_0x176152=_0x4738ed;_0x5b3633[_0xde55('0x3a')]=_[_0xde55('0x3c')](db[_0xde55('0x68')][_0xde55('0x39')]);_0x5b3633[_0xde55('0x3b')]=_[_0xde55('0x3c')](_0x2b3a18[_0xde55('0x3b')]);_0x5b3633['filters']=_['intersection'](_0x5b3633[_0xde55('0x3a')],_0x5b3633['query']);_0x398b98[_0xde55('0x3f')]=_[_0xde55('0x3e')](_0x5b3633[_0xde55('0x3a')],qs['fields'](_0x2b3a18[_0xde55('0x3b')][_0xde55('0x40')]));_0x398b98[_0xde55('0x3f')]=_0x398b98[_0xde55('0x3f')][_0xde55('0x41')]?_0x398b98[_0xde55('0x3f')]:_0x5b3633[_0xde55('0x3a')];_0x398b98[_0xde55('0x44')]=qs[_0xde55('0x45')](_0x2b3a18[_0xde55('0x3b')]['sort']);_0x398b98[_0xde55('0x46')]=qs[_0xde55('0x3d')](_[_0xde55('0x47')](_0x2b3a18[_0xde55('0x3b')],_0x5b3633['filters']));if(_0x2b3a18['query'][_0xde55('0x48')]){_0x398b98[_0xde55('0x46')]=_[_0xde55('0x49')](_0x398b98[_0xde55('0x46')],{'$or':_['map'](_0x398b98[_0xde55('0x3f')],function(_0x4d6b3d){var _0x110b50={};_0x110b50[_0x4d6b3d]={'$like':'%'+_0x2b3a18[_0xde55('0x3b')][_0xde55('0x48')]+'%'};return _0x110b50;})});}_0x398b98=_[_0xde55('0x49')]({},_0x398b98,_0x2b3a18[_0xde55('0x4a')]);return _0x176152['getTeams'](_0x398b98);}})[_0xde55('0x2a')](function(_0x1e4b13){if(_0x1e4b13){_0x2db2c2=_0x1e4b13[_0xde55('0x41')];if(!_0x2b3a18[_0xde55('0x3b')][_0xde55('0x42')]('nolimit')){_0x398b98[_0xde55('0x23')]=qs[_0xde55('0x23')](_0x2b3a18[_0xde55('0x3b')][_0xde55('0x23')]);_0x398b98[_0xde55('0x21')]=qs[_0xde55('0x21')](_0x2b3a18[_0xde55('0x3b')][_0xde55('0x21')]);}return _0x176152[_0xde55('0x67')](_0x398b98);}})[_0xde55('0x2a')](function(_0x130502){if(_0x130502){return _0x130502?{'count':_0x2db2c2,'rows':_0x130502}:null;}})[_0xde55('0x2a')](respondWithResult(_0x4ecc5c,null))[_0xde55('0x4f')](handleError(_0x4ecc5c,null));};exports['addTeams']=function(_0x71e3c3,_0x3c48fb,_0x39b128){var _0x20764b=_0x71e3c3[_0xde55('0x50')][_0xde55('0x69')];var _0x1d805e=_[_0xde55('0x30')](_0x20764b,'id');return db['Team']['findAll']({'where':{'id':_0x1d805e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xde55('0x6a'),'attributes':['id',_0xde55('0x37'),_0xde55('0x6b'),'voicePause',_0xde55('0x6c')],'raw':!![]}]})[_0xde55('0x2a')](function(_0xb2abb3){if(_0xb2abb3){var _0x4b7429=_[_0xde55('0x6d')](_0xb2abb3,function(_0x4e6b51){var _0x5d9e55=_0x4e6b51[_0xde55('0x2c')]({'plain':!![]});_0x5d9e55[_0xde55('0x6a')][_0xde55('0x6e')](function(_0x524d64){_0x524d64[_0xde55('0x6f')]=_[_0xde55('0x34')](_0x20764b,{'id':_0x5d9e55['id']})['penalty'];});return _0x5d9e55[_0xde55('0x6a')];});return db['VoiceQueue'][_0xde55('0x34')]({'where':{'id':_0x71e3c3[_0xde55('0x5d')]['id']}})[_0xde55('0x2a')](function(_0x5e925b){return db['sequelize'][_0xde55('0x70')](function(_0x27540e){return _0x5e925b['addTeams'](_0x1d805e,{'transaction':_0x27540e})['then'](function(){return BPromise[_0xde55('0x71')](_0x20764b,function(_0x532fa2){return db[_0xde55('0x72')][_0xde55('0x73')]({'TeamId':_0x532fa2['id'],'VoiceQueueId':_0x71e3c3[_0xde55('0x5d')]['id'],'penalty':_0x532fa2['penalty']},{'transaction':_0x27540e});});})[_0xde55('0x2a')](function(){return BPromise[_0xde55('0x71')](_0x4b7429,function(_0x58a40f){return db[_0xde55('0x74')]['findOrCreate']({'where':{'UserId':_0x58a40f['id'],'VoiceQueueId':_0x71e3c3[_0xde55('0x5d')]['id']},'defaults':{'penalty':_0x58a40f['penalty']},'transaction':_0x27540e});});})[_0xde55('0x2a')](function(){return BPromise[_0xde55('0x71')](_[_0xde55('0x48')](_0x4b7429,{'online':!![]}),function(_0x44428e){return db[_0xde55('0x75')][_0xde55('0x73')]({'membername':_0x44428e[_0xde55('0x37')],'UserId':_0x44428e['id'],'queue_name':_0x5e925b['name'],'VoiceQueueId':_0x5e925b['id'],'interface':_['isNil'](_0x44428e[_0xde55('0x6c')])?util['format']('SIP/%s',_0x44428e[_0xde55('0x37')]):_0x44428e[_0xde55('0x6c')],'paused':_0x44428e[_0xde55('0x76')]||![],'penalty':_0x44428e[_0xde55('0x6f')]},{'transaction':_0x27540e});});})['then'](function(){_0x4b7429[_0xde55('0x6e')](function(_0x56b5ce){socket[_0xde55('0x77')](_0xde55('0x78'),{'UserId':_0x56b5ce['id'],'VoiceQueueId':_0x5e925b['id']});});});});});}})['then'](respondWithStatusCode(_0x3c48fb,null))['catch'](handleError(_0x3c48fb,null));};exports[_0xde55('0x79')]=function(_0x54da1b,_0x5ef2fa,_0x6874e6){return db[_0xde55('0x68')][_0xde55('0x4d')]({'where':{'id':_0x54da1b[_0xde55('0x3b')][_0xde55('0x7a')]},'attributes':['id'],'include':[{'model':db[_0xde55('0x7b')],'as':_0xde55('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xde55('0x2a')](handleEntityNotFound(_0x5ef2fa,null))['then'](function(_0x5182db){var _0x1a8b4f=_[_0xde55('0x30')](_0x5182db,'id');var _0x6126ef=[];var _0x33d5b6=[];var _0x2c3ddd=squel[_0xde55('0x7c')]();_0x2c3ddd[_0xde55('0x7d')](_0xde55('0x7e'))['from'](_0xde55('0x7f'),'tq')[_0xde55('0x80')](_0xde55('0x81'),'ut',_0xde55('0x82'))['where'](_0xde55('0x83'),_0x54da1b['params']['id']);for(var _0xaed3e9=0x0;_0xaed3e9<_0x5182db[_0xde55('0x41')];_0xaed3e9+=0x1){let _0x5a39d1=_0x5182db[_0xaed3e9];for(var _0x5c31b2=0x0;_0x5c31b2<_0x5a39d1[_0xde55('0x6a')][_0xde55('0x41')];_0x5c31b2+=0x1){let _0x2465d9=_0x5a39d1[_0xde55('0x6a')][_0x5c31b2];var _0x42e3fa=_0x2c3ddd[_0xde55('0x84')]();_0x42e3fa['where'](_0xde55('0x85'),_0x2465d9['id']);_0x33d5b6[_0xde55('0x86')](db[_0xde55('0x87')][_0xde55('0x3b')](_0x42e3fa[_0xde55('0x88')](),{'type':db[_0xde55('0x87')][_0xde55('0x89')][_0xde55('0x8a')]})[_0xde55('0x2a')](function(_0x41ca8e){if(_0x41ca8e[_0xde55('0x41')]===0x1){return _0x2465d9['id'];}else{var _0x108f00=_[_0xde55('0x8b')](_['map'](_0x41ca8e,_0xde55('0x8c')),function(_0x4779ce){return _['includes'](_0x1a8b4f,_0x4779ce);});if(_0x108f00){return _0x2465d9['id'];}}}));}}return BPromise[_0xde55('0x8d')](_0x33d5b6)[_0xde55('0x2a')](function(_0x4713a4){_0x6126ef=_(_0x6126ef)['union'](_0x4713a4)[_0xde55('0x8e')]()[_0xde55('0x31')]();return db[_0xde55('0x4b')]['find']({'where':{'id':_0x54da1b[_0xde55('0x5d')]['id']}})[_0xde55('0x2a')](function(_0x362093){return db[_0xde55('0x87')][_0xde55('0x70')](function(_0x4e6fad){return _0x362093[_0xde55('0x79')](_0x54da1b['query'][_0xde55('0x7a')],{'transaction':_0x4e6fad})[_0xde55('0x2a')](function(){if(!_[_0xde55('0x8f')](_0x6126ef)){return _0x362093['removeAgents'](_0x6126ef,{'transaction':_0x4e6fad})[_0xde55('0x2a')](function(){return db[_0xde55('0x75')]['destroy']({'where':{'VoiceQueueId':_0x54da1b[_0xde55('0x5d')]['id'],'UserId':_0x6126ef},'transaction':_0x4e6fad});});}})['then'](function(){_0x6126ef[_0xde55('0x6e')](function(_0x11b564){socket[_0xde55('0x77')]('userVoiceQueue:remove',{'UserId':_0x11b564,'VoiceQueueId':_0x362093['id']});});});});});});})['then'](respondWithStatusCode(_0x5ef2fa,null))['catch'](handleError(_0x5ef2fa,null));};exports[_0xde55('0x90')]=function(_0x4f915b,_0x1ef8c7,_0x16a222){var _0x167fa0,_0x1fc3d5;return db[_0xde55('0x4b')][_0xde55('0x34')]({'where':{'id':_0x4f915b[_0xde55('0x5d')]['id']}})[_0xde55('0x2a')](handleEntityNotFound(_0x1ef8c7,null))[_0xde55('0x2a')](function(_0x476d61){if(_0x476d61){_0x1fc3d5=_0x476d61;return _0x476d61[_0xde55('0x90')](_0x4f915b[_0xde55('0x50')][_0xde55('0x7a')],_[_0xde55('0x5c')](_0x4f915b[_0xde55('0x50')],[_0xde55('0x7a'),'id'])||{})[_0xde55('0x91')](function(_0x4828c5){for(var _0x5c6c4e=0x0;_0x5c6c4e<_0x4f915b[_0xde55('0x50')][_0xde55('0x7a')][_0xde55('0x41')];_0x5c6c4e+=0x1){socket[_0xde55('0x77')](_0xde55('0x78'),{'UserId':Number(_0x4f915b[_0xde55('0x50')][_0xde55('0x7a')][_0x5c6c4e]),'VoiceQueueId':Number(_0x4f915b[_0xde55('0x5d')]['id'])});}return _0x4828c5;});}})[_0xde55('0x2a')](function(_0x381b92){_0x167fa0=_0x381b92||[];if(_0x1fc3d5){return db[_0xde55('0x7b')]['findAll']({'where':{'id':_0x4f915b[_0xde55('0x50')]['ids']},'attributes':['id',_0xde55('0x37'),_0xde55('0x6b'),'voicePause',_0xde55('0x6c')],'raw':!![]});}})['then'](function(_0x4d0765){if(!_['isEmpty'](_0x4d0765)){var _0x2a61c6=[];for(var _0x6016b7=0x0;_0x6016b7<_0x4d0765['length'];_0x6016b7++){if(_0x4d0765[_0x6016b7][_0xde55('0x6b')]){_0x2a61c6[_0xde55('0x86')](db[_0xde55('0x75')][_0xde55('0x73')]({'membername':_0x4d0765[_0x6016b7][_0xde55('0x37')],'UserId':_0x4d0765[_0x6016b7]['id'],'queue_name':_0x1fc3d5[_0xde55('0x37')],'VoiceQueueId':_0x1fc3d5['id'],'interface':_[_0xde55('0x92')](_0x4d0765[_0x6016b7][_0xde55('0x6c')])?util[_0xde55('0x93')](_0xde55('0x94'),_0x4d0765[_0x6016b7][_0xde55('0x37')]):_0x4d0765[_0x6016b7][_0xde55('0x6c')],'paused':_0x4d0765[_0x6016b7][_0xde55('0x76')]||![],'penalty':_0x4f915b['body'][_0xde55('0x6f')]||0x0}));}}return BPromise['all'](_0x2a61c6);}})[_0xde55('0x2a')](function(){return _0x167fa0;})['then'](respondWithResult(_0x1ef8c7,null))[_0xde55('0x4f')](handleError(_0x1ef8c7,null));};exports[_0xde55('0x95')]=function(_0x115f79,_0x463968,_0x1e6cd4){return db['VoiceQueue'][_0xde55('0x34')]({'where':{'id':_0x115f79[_0xde55('0x5d')]['id']}})['then'](handleEntityNotFound(_0x463968,null))[_0xde55('0x2a')](function(_0x5ae1b0){if(_0x5ae1b0){return _0x5ae1b0[_0xde55('0x95')](_0x115f79['query']['ids'])[_0xde55('0x2a')](function(){if(_[_0xde55('0x96')](_0x115f79[_0xde55('0x3b')][_0xde55('0x7a')])){for(var _0x1875fa=0x0;_0x1875fa<_0x115f79[_0xde55('0x3b')][_0xde55('0x7a')][_0xde55('0x41')];_0x1875fa+=0x1){socket['emit'](_0xde55('0x97'),{'UserId':Number(_0x115f79[_0xde55('0x3b')]['ids'][_0x1875fa]),'VoiceQueueId':Number(_0x115f79[_0xde55('0x5d')]['id'])});}}else{socket[_0xde55('0x77')]('userVoiceQueue:remove',{'UserId':Number(_0x115f79[_0xde55('0x3b')][_0xde55('0x7a')]),'VoiceQueueId':Number(_0x115f79[_0xde55('0x5d')]['id'])});}});}})[_0xde55('0x2a')](function(_0x354aba){return db[_0xde55('0x75')]['destroy']({'where':{'VoiceQueueId':_0x115f79[_0xde55('0x5d')]['id'],'UserId':_0x115f79[_0xde55('0x3b')][_0xde55('0x7a')]}})[_0xde55('0x2a')](function(){return _0x354aba;});})[_0xde55('0x2a')](respondWithStatusCode(_0x463968,null))[_0xde55('0x4f')](handleError(_0x463968,null));};exports['getAgents']=function(_0x279c36,_0x2d7442,_0x59dabe){var _0x368d39={};var _0x58886e={};var _0x1951e3;var _0x2cc7b9;return db[_0xde55('0x4b')][_0xde55('0x5f')]({'where':{'id':_0x279c36[_0xde55('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2d7442,null))[_0xde55('0x2a')](function(_0x23b833){if(_0x23b833){_0x1951e3=_0x23b833;_0x58886e[_0xde55('0x3a')]=_[_0xde55('0x3c')](db['User']['rawAttributes']);_0x58886e[_0xde55('0x3b')]=_[_0xde55('0x3c')](_0x279c36[_0xde55('0x3b')]);_0x58886e[_0xde55('0x3d')]=_[_0xde55('0x3e')](_0x58886e[_0xde55('0x3a')],_0x58886e[_0xde55('0x3b')]);_0x368d39[_0xde55('0x3f')]=_['intersection'](_0x58886e['model'],qs[_0xde55('0x40')](_0x279c36[_0xde55('0x3b')]['fields']));_0x368d39['attributes']=_0x368d39[_0xde55('0x3f')][_0xde55('0x41')]?_0x368d39[_0xde55('0x3f')]:_0x58886e[_0xde55('0x3a')];_0x368d39[_0xde55('0x44')]=qs[_0xde55('0x45')](_0x279c36[_0xde55('0x3b')][_0xde55('0x45')]);_0x368d39[_0xde55('0x46')]=qs[_0xde55('0x3d')](_['pick'](_0x279c36[_0xde55('0x3b')],_0x58886e[_0xde55('0x3d')]));if(_0x279c36[_0xde55('0x3b')][_0xde55('0x48')]){_0x368d39['where']=_[_0xde55('0x49')](_0x368d39[_0xde55('0x46')],{'$or':_[_0xde55('0x30')](_0x368d39['attributes'],function(_0x241141){var _0x5b73fb={};_0x5b73fb[_0x241141]={'$like':'%'+_0x279c36[_0xde55('0x3b')][_0xde55('0x48')]+'%'};return _0x5b73fb;})});}_0x368d39=_[_0xde55('0x49')]({},_0x368d39,_0x279c36[_0xde55('0x4a')]);return _0x1951e3['getAgents'](_0x368d39);}})[_0xde55('0x2a')](function(_0x4eab27){if(_0x4eab27){_0x2cc7b9=_0x4eab27[_0xde55('0x41')];if(!_0x279c36[_0xde55('0x3b')][_0xde55('0x42')](_0xde55('0x43'))){_0x368d39[_0xde55('0x23')]=qs[_0xde55('0x23')](_0x279c36[_0xde55('0x3b')]['limit']);_0x368d39[_0xde55('0x21')]=qs[_0xde55('0x21')](_0x279c36['query']['offset']);}return _0x1951e3['getAgents'](_0x368d39);}})['then'](function(_0x3a27ce){if(_0x3a27ce){return _0x3a27ce?{'count':_0x2cc7b9,'rows':_0x3a27ce}:null;}})['then'](respondWithResult(_0x2d7442,null))['catch'](handleError(_0x2d7442,null));};exports[_0xde55('0x98')]=function(_0x215de0,_0x3f1397,_0x53a6fb){var _0x5b2787={};var _0x50e273={};var _0x174088;var _0x51da58;return db['VoiceQueue'][_0xde55('0x5f')]({'where':{'id':_0x215de0[_0xde55('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3f1397,null))[_0xde55('0x2a')](function(_0x1b4b67){if(_0x1b4b67){_0x174088=_0x1b4b67;_0x50e273[_0xde55('0x3a')]=_[_0xde55('0x3c')](db['UserVoiceQueueRt']['rawAttributes']);_0x50e273[_0xde55('0x3b')]=_[_0xde55('0x3c')](_0x215de0['query']);_0x50e273[_0xde55('0x3d')]=_[_0xde55('0x3e')](_0x50e273[_0xde55('0x3a')],_0x50e273[_0xde55('0x3b')]);_0x5b2787['attributes']=_[_0xde55('0x3e')](_0x50e273[_0xde55('0x3a')],qs[_0xde55('0x40')](_0x215de0[_0xde55('0x3b')][_0xde55('0x40')]));_0x5b2787['attributes']=_0x5b2787[_0xde55('0x3f')]['length']?_0x5b2787[_0xde55('0x3f')]:_0x50e273[_0xde55('0x3a')];_0x5b2787['order']=qs[_0xde55('0x45')](_0x215de0[_0xde55('0x3b')][_0xde55('0x45')]);_0x5b2787['where']=qs[_0xde55('0x3d')](_[_0xde55('0x47')](_0x215de0[_0xde55('0x3b')],_0x50e273[_0xde55('0x3d')]));if(_0x215de0[_0xde55('0x3b')][_0xde55('0x48')]){_0x5b2787[_0xde55('0x46')]=_[_0xde55('0x49')](_0x5b2787[_0xde55('0x46')],{'$or':_[_0xde55('0x30')](_0x5b2787['attributes'],function(_0x16a168){var _0x2e1d9d={};_0x2e1d9d[_0x16a168]={'$like':'%'+_0x215de0[_0xde55('0x3b')][_0xde55('0x48')]+'%'};return _0x2e1d9d;})});}_0x5b2787=_['merge']({},_0x5b2787,_0x215de0['options']);return _0x174088['getMembers'](_0x5b2787);}})[_0xde55('0x2a')](function(_0x3b225a){if(_0x3b225a){_0x51da58=_0x3b225a[_0xde55('0x41')];if(!_0x215de0['query'][_0xde55('0x42')](_0xde55('0x43'))){_0x5b2787[_0xde55('0x23')]=qs[_0xde55('0x23')](_0x215de0[_0xde55('0x3b')][_0xde55('0x23')]);_0x5b2787['offset']=qs['offset'](_0x215de0[_0xde55('0x3b')][_0xde55('0x21')]);}return _0x174088[_0xde55('0x98')](_0x5b2787);}})[_0xde55('0x2a')](function(_0x282433){return _0x282433?{'count':_0x51da58,'rows':_0x282433}:null;})['then'](respondWithResult(_0x3f1397,null))[_0xde55('0x4f')](handleError(_0x3f1397,null));};exports[_0xde55('0x99')]=function(_0x5a29e5,_0x5d0b70,_0x48b3e6){var _0x3a749f={};var _0x3b2d64={};var _0x1fa1aa;var _0x1a2eb4;return db['VoiceQueue'][_0xde55('0x5f')]({'where':{'id':_0x5a29e5[_0xde55('0x5d')]['id']}})[_0xde55('0x2a')](handleEntityNotFound(_0x5d0b70,null))[_0xde55('0x2a')](function(_0x125b48){if(_0x125b48){_0x1fa1aa=_0x125b48;_0x3b2d64[_0xde55('0x3a')]=_[_0xde55('0x3c')](db[_0xde55('0x9a')][_0xde55('0x39')]);_0x3b2d64[_0xde55('0x3b')]=_[_0xde55('0x3c')](_0x5a29e5['query']);_0x3b2d64[_0xde55('0x3d')]=_['intersection'](_0x3b2d64[_0xde55('0x3a')],_0x3b2d64['query']);_0x3a749f['attributes']=_[_0xde55('0x3e')](_0x3b2d64['model'],qs['fields'](_0x5a29e5['query'][_0xde55('0x40')]));_0x3a749f[_0xde55('0x3f')]=_0x3a749f[_0xde55('0x3f')][_0xde55('0x41')]?_0x3a749f[_0xde55('0x3f')]:_0x3b2d64['model'];_0x3a749f[_0xde55('0x44')]=qs[_0xde55('0x45')](_0x5a29e5[_0xde55('0x3b')][_0xde55('0x45')]);_0x3a749f[_0xde55('0x46')]=qs['filters'](_[_0xde55('0x47')](_0x5a29e5[_0xde55('0x3b')],_0x3b2d64[_0xde55('0x3d')]));if(_0x5a29e5[_0xde55('0x3b')][_0xde55('0x48')]){_0x3a749f[_0xde55('0x46')]=_['merge'](_0x3a749f[_0xde55('0x46')],{'$or':_[_0xde55('0x30')](_0x3a749f[_0xde55('0x3f')],function(_0x45e5ef){var _0x1c01ea={};_0x1c01ea[_0x45e5ef]={'$like':'%'+_0x5a29e5[_0xde55('0x3b')][_0xde55('0x48')]+'%'};return _0x1c01ea;})});}_0x3a749f=_['merge']({},_0x3a749f,_0x5a29e5[_0xde55('0x4a')]);return _0x1fa1aa['getLists'](_0x3a749f);}})[_0xde55('0x2a')](function(_0x49a782){if(_0x49a782){_0x1a2eb4=_0x49a782['length'];if(!_0x5a29e5['query'][_0xde55('0x42')](_0xde55('0x43'))){_0x3a749f[_0xde55('0x23')]=qs[_0xde55('0x23')](_0x5a29e5[_0xde55('0x3b')][_0xde55('0x23')]);_0x3a749f[_0xde55('0x21')]=qs[_0xde55('0x21')](_0x5a29e5[_0xde55('0x3b')]['offset']);}return _0x1fa1aa[_0xde55('0x99')](_0x3a749f);}})[_0xde55('0x2a')](function(_0x140747){if(_0x140747){return _0x140747?{'count':_0x1a2eb4,'rows':_0x140747}:null;}})[_0xde55('0x2a')](respondWithResult(_0x5d0b70,null))[_0xde55('0x4f')](handleError(_0x5d0b70,null));};exports[_0xde55('0x9b')]=function(_0x4ecb58,_0x3686bd,_0x3f44d0){var _0x51f1cc=moment()[_0xde55('0x93')](_0xde55('0x9c'));var _0x41056f,_0x59947d;return db['VoiceQueue']['find']({'where':{'id':_0x4ecb58[_0xde55('0x5d')]['id']}})[_0xde55('0x2a')](handleEntityNotFound(_0x3686bd,null))['then'](function(_0x4f87bb){if(_0x4f87bb){_0x59947d=_0x4f87bb;return _0x4f87bb[_0xde55('0x9b')](_0x4ecb58[_0xde55('0x50')][_0xde55('0x7a')],_[_0xde55('0x5c')](_0x4ecb58[_0xde55('0x50')],['ids','id'])||{});}return null;})[_0xde55('0x91')](function(_0x58c0ee){var _0x3e93d4;_0x41056f=_0x58c0ee||[];var _0x5d87d8=[];if(_0x58c0ee){for(var _0x24eeb8=0x0;_0x24eeb8<_0x58c0ee[_0xde55('0x41')];_0x24eeb8+=0x1){var _0x39a235=_0x58c0ee[_0x24eeb8][_0xde55('0x2c')]({'plain':!![]});_0x59947d['dialCheckDuplicateType']=_0x4ecb58[_0xde55('0x50')][_0xde55('0x9d')]?_0x4ecb58['body'][_0xde55('0x9d')]:_0x59947d['dialCheckDuplicateType'];switch(_0x59947d['dialCheckDuplicateType']){case _0xde55('0x9e'):_0x3e93d4=squel['insert']()[_0xde55('0x9f')]('cm_hopper')[_0xde55('0xa0')]([_0xde55('0xa1'),_0xde55('0xa2'),_0xde55('0xa3'),_0xde55('0xa4'),'VoiceQueueId','createdAt','updatedAt'],squel[_0xde55('0x7c')]()[_0xde55('0x7d')](_0xde55('0xa1'),_0xde55('0xa1'))['field']('\x27'+_0x51f1cc+'\x27',_0xde55('0xa2'))[_0xde55('0x7d')]('id','ContactId')[_0xde55('0x7d')](_0x39a235[_0xde55('0xa5')][_0xde55('0x88')](),_0xde55('0xa4'))['field'](_0x4ecb58[_0xde55('0x5d')]['id'][_0xde55('0x88')](),_0xde55('0x61'))[_0xde55('0x7d')]('\x27'+_0x51f1cc+'\x27',_0xde55('0x5a'))[_0xde55('0x7d')]('\x27'+_0x51f1cc+'\x27',_0xde55('0x5b'))[_0xde55('0xa6')](_0xde55('0xa7'))[_0xde55('0x46')]('deletedAt\x20IS\x20NULL')[_0xde55('0x46')](_0xde55('0xa8'),_0x39a235[_0xde55('0xa5')][_0xde55('0x88')]())[_0xde55('0x46')](_0xde55('0xa9'))['where'](_0xde55('0xaa'),squel['select']()['field'](_0xde55('0xab'))[_0xde55('0xa6')]('cm_hopper_final')[_0xde55('0x46')](_0xde55('0x83'),_0x4ecb58[_0xde55('0x5d')]['id'][_0xde55('0x88')]()))[_0xde55('0x46')]('phone\x20NOT\x20IN\x20(?)',squel[_0xde55('0x7c')]()['field'](_0xde55('0xac'))['from']('cm_hopper')[_0xde55('0x46')](_0xde55('0x83'),_0x4ecb58[_0xde55('0x5d')]['id']['toString']())))[_0xde55('0x88')]();break;case'onlyIfOpen':_0x3e93d4=squel[_0xde55('0xad')]()[_0xde55('0x9f')](_0xde55('0xae'))[_0xde55('0xa0')]([_0xde55('0xa1'),_0xde55('0xa2'),_0xde55('0xa3'),_0xde55('0xa4'),'VoiceQueueId',_0xde55('0x5a'),'updatedAt'],squel[_0xde55('0x7c')]()[_0xde55('0x7d')](_0xde55('0xa1'),'phone')['field']('\x27'+_0x51f1cc+'\x27','scheduledAt')['field']('id',_0xde55('0xa3'))[_0xde55('0x7d')](_0x39a235[_0xde55('0xa5')]['toString'](),_0xde55('0xa4'))['field'](_0x4ecb58['params']['id'][_0xde55('0x88')](),'VoiceQueueId')[_0xde55('0x7d')]('\x27'+_0x51f1cc+'\x27','createdAt')[_0xde55('0x7d')]('\x27'+_0x51f1cc+'\x27',_0xde55('0x5b'))[_0xde55('0xa6')]('cm_contacts')['where'](_0xde55('0xaf'))[_0xde55('0x46')](_0xde55('0xa8'),_0x39a235[_0xde55('0xa5')][_0xde55('0x88')]())[_0xde55('0x46')]('phone\x20IS\x20NOT\x20NULL')[_0xde55('0x46')](_0xde55('0xaa'),squel[_0xde55('0x7c')]()[_0xde55('0x7d')](_0xde55('0xac'))[_0xde55('0xa6')](_0xde55('0xae'))[_0xde55('0x46')]('VoiceQueueId\x20=\x20?',_0x4ecb58[_0xde55('0x5d')]['id'][_0xde55('0x88')]())))[_0xde55('0x88')]();break;default:_0x3e93d4=squel[_0xde55('0xad')]()[_0xde55('0x9f')](_0xde55('0xae'))['fromQuery']([_0xde55('0xa1'),'scheduledAt',_0xde55('0xa3'),'ListId','VoiceQueueId',_0xde55('0x5a'),_0xde55('0x5b')],squel[_0xde55('0x7c')]()[_0xde55('0x7d')]('phone','phone')[_0xde55('0x7d')]('\x27'+_0x51f1cc+'\x27',_0xde55('0xa2'))[_0xde55('0x7d')]('id',_0xde55('0xa3'))[_0xde55('0x7d')](_0x39a235[_0xde55('0xa5')][_0xde55('0x88')](),'ListId')[_0xde55('0x7d')](_0x4ecb58[_0xde55('0x5d')]['id'][_0xde55('0x88')](),'VoiceQueueId')['field']('\x27'+_0x51f1cc+'\x27',_0xde55('0x5a'))[_0xde55('0x7d')]('\x27'+_0x51f1cc+'\x27',_0xde55('0x5b'))['from'](_0xde55('0xa7'))[_0xde55('0x46')]('deletedAt\x20IS\x20NULL')[_0xde55('0x46')](_0xde55('0xa8'),_0x39a235['CmListId'][_0xde55('0x88')]())[_0xde55('0x46')](_0xde55('0xa9')))[_0xde55('0x88')]();}_0x5d87d8[_0xde55('0x86')](db[_0xde55('0x87')][_0xde55('0x3b')](_0x3e93d4));}return BPromise[_0xde55('0x8d')](_0x5d87d8);}})[_0xde55('0x2a')](function(){var _0x53b538=[];var _0x295703=squel['insert']()[_0xde55('0x9f')](_0xde55('0xb0'))[_0xde55('0xa0')]([_0xde55('0xb1'),_0xde55('0xa1'),_0xde55('0xb2'),_0xde55('0x5a'),'updatedAt'],squel['select']()[_0xde55('0x7d')]('h.id')[_0xde55('0x7d')](_0xde55('0xb3'))['field'](_0xde55('0xb4'))[_0xde55('0x7d')]('\x27'+_0x51f1cc+'\x27','createdAt')['field']('\x27'+_0x51f1cc+'\x27',_0xde55('0x5b'))['from'](_0xde55('0xb5'),'ci')[_0xde55('0x80')](_0xde55('0xae'),'h',_0xde55('0xb6'))[_0xde55('0x46')](_0xde55('0xb7'),_0x51f1cc)[_0xde55('0x46')](_0xde55('0xb8'),_0xde55('0xb9')))['toString']();_0x53b538[_0xde55('0x86')](db[_0xde55('0x87')]['query'](_0x295703));return BPromise[_0xde55('0x8d')](_0x53b538);})[_0xde55('0x2a')](function(){return _0x41056f;})[_0xde55('0x2a')](respondWithResult(_0x3686bd,null))[_0xde55('0x4f')](handleError(_0x3686bd,null));};exports['removeLists']=function(_0x2fc56d,_0x2761ba,_0x5ca793){return db['VoiceQueue'][_0xde55('0x34')]({'where':{'id':_0x2fc56d[_0xde55('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2761ba,null))[_0xde55('0x2a')](function(_0x212c67){if(_0x212c67){return _0x212c67[_0xde55('0xba')](_0x2fc56d[_0xde55('0x3b')][_0xde55('0x7a')]);}})['then'](function(_0x25dc8b){if(_0x25dc8b){return db[_0xde55('0x60')][_0xde55('0x2b')]({'where':{'ListId':_0x2fc56d[_0xde55('0x3b')][_0xde55('0x7a')],'VoiceQueueId':_0x2fc56d[_0xde55('0x5d')]['id']}})[_0xde55('0x2a')](function(){return _0x25dc8b;});}})[_0xde55('0x2a')](respondWithStatusCode(_0x2761ba,null))[_0xde55('0x4f')](handleError(_0x2761ba,null));};exports['getBlackLists']=function(_0x35b935,_0x2b0fd6,_0x5c64ab){var _0x2d85cb={};var _0x2aae72={};var _0x51b430;var _0x39cb6a;return db[_0xde55('0x4b')][_0xde55('0x5f')]({'where':{'id':_0x35b935[_0xde55('0x5d')]['id']}})[_0xde55('0x2a')](handleEntityNotFound(_0x2b0fd6,null))[_0xde55('0x2a')](function(_0x365de9){if(_0x365de9){_0x51b430=_0x365de9;_0x2aae72['model']=_[_0xde55('0x3c')](db[_0xde55('0x9a')][_0xde55('0x39')]);_0x2aae72[_0xde55('0x3b')]=_[_0xde55('0x3c')](_0x35b935[_0xde55('0x3b')]);_0x2aae72[_0xde55('0x3d')]=_[_0xde55('0x3e')](_0x2aae72[_0xde55('0x3a')],_0x2aae72['query']);_0x2d85cb[_0xde55('0x3f')]=_['intersection'](_0x2aae72['model'],qs[_0xde55('0x40')](_0x35b935['query'][_0xde55('0x40')]));_0x2d85cb[_0xde55('0x3f')]=_0x2d85cb[_0xde55('0x3f')][_0xde55('0x41')]?_0x2d85cb[_0xde55('0x3f')]:_0x2aae72['model'];_0x2d85cb[_0xde55('0x44')]=qs['sort'](_0x35b935[_0xde55('0x3b')][_0xde55('0x45')]);_0x2d85cb[_0xde55('0x46')]=qs[_0xde55('0x3d')](_[_0xde55('0x47')](_0x35b935['query'],_0x2aae72[_0xde55('0x3d')]));if(_0x35b935['query'][_0xde55('0x48')]){_0x2d85cb['where']=_[_0xde55('0x49')](_0x2d85cb['where'],{'$or':_[_0xde55('0x30')](_0x2d85cb[_0xde55('0x3f')],function(_0x5531b6){var _0x49a322={};_0x49a322[_0x5531b6]={'$like':'%'+_0x35b935[_0xde55('0x3b')][_0xde55('0x48')]+'%'};return _0x49a322;})});}_0x2d85cb=_[_0xde55('0x49')]({},_0x2d85cb,_0x35b935[_0xde55('0x4a')]);return _0x51b430[_0xde55('0xbb')](_0x2d85cb);}})[_0xde55('0x2a')](function(_0x2addfe){if(_0x2addfe){_0x39cb6a=_0x2addfe['length'];if(!_0x35b935[_0xde55('0x3b')]['hasOwnProperty'](_0xde55('0x43'))){_0x2d85cb['limit']=qs[_0xde55('0x23')](_0x35b935[_0xde55('0x3b')][_0xde55('0x23')]);_0x2d85cb[_0xde55('0x21')]=qs['offset'](_0x35b935[_0xde55('0x3b')][_0xde55('0x21')]);}return _0x51b430['getBlackLists'](_0x2d85cb);}})['then'](function(_0x2dd004){if(_0x2dd004){return _0x2dd004?{'count':_0x39cb6a,'rows':_0x2dd004}:null;}})['then'](respondWithResult(_0x2b0fd6,null))[_0xde55('0x4f')](handleError(_0x2b0fd6,null));};exports['addBlackLists']=function(_0x18fcfb,_0x4f700f,_0xfea7b6){var _0x1ec81d,_0x178812;return db[_0xde55('0x4b')][_0xde55('0x34')]({'where':{'id':_0x18fcfb[_0xde55('0x5d')]['id']}})[_0xde55('0x2a')](handleEntityNotFound(_0x4f700f,null))[_0xde55('0x2a')](function(_0x4f887b){if(_0x4f887b){_0x178812=_0x4f887b;return _0x4f887b[_0xde55('0xbc')](_0x18fcfb[_0xde55('0x50')]['ids'],_['omit'](_0x18fcfb['body'],['ids','id'])||{});}return null;})['spread'](function(_0x456440){var _0x2bfee5;_0x1ec81d=_0x456440||[];var _0x5e5cff=[];if(_0x456440){for(var _0x4dd810=0x0;_0x4dd810<_0x456440[_0xde55('0x41')];_0x4dd810+=0x1){var _0x37812f=_0x456440[_0x4dd810]['get']({'plain':!![]});_0x2bfee5=squel[_0xde55('0xad')]()['into']('cm_hopper_black')[_0xde55('0xa0')]([_0xde55('0xa1'),_0xde55('0xa3'),_0xde55('0xa4'),_0xde55('0x61'),_0xde55('0x5a'),_0xde55('0x5b')],squel[_0xde55('0x7c')]()['field'](_0xde55('0xa1'),_0xde55('0xa1'))[_0xde55('0x7d')]('id',_0xde55('0xa3'))['field'](_0x37812f['CmListId'][_0xde55('0x88')](),_0xde55('0xa4'))[_0xde55('0x7d')](_0x18fcfb[_0xde55('0x5d')]['id']['toString'](),'VoiceQueueId')['field'](_0xde55('0xbd'),_0xde55('0x5a'))[_0xde55('0x7d')](_0xde55('0xbd'),_0xde55('0x5b'))['from'](_0xde55('0xa7'))[_0xde55('0x46')]('deletedAt\x20IS\x20NULL')[_0xde55('0x46')]('ListId\x20=\x20?',_0x37812f[_0xde55('0xa5')][_0xde55('0x88')]())[_0xde55('0x46')](_0xde55('0xa9')))['toString']();_0x5e5cff[_0xde55('0x86')](db[_0xde55('0x87')][_0xde55('0x3b')](_0x2bfee5));}return BPromise[_0xde55('0x8d')](_0x5e5cff);}})['then'](function(){return _0x1ec81d;})['then'](respondWithResult(_0x4f700f,null))['catch'](handleError(_0x4f700f,null));};exports[_0xde55('0xbe')]=function(_0x55f527,_0x4383e9,_0x29add8){return db[_0xde55('0x4b')][_0xde55('0x34')]({'where':{'id':_0x55f527['params']['id']}})[_0xde55('0x2a')](handleEntityNotFound(_0x4383e9,null))[_0xde55('0x2a')](function(_0x479fc3){if(_0x479fc3){return _0x479fc3['removeBlackLists'](_0x55f527[_0xde55('0x3b')][_0xde55('0x7a')]);}})[_0xde55('0x2a')](function(_0xf98f28){if(_0xf98f28){return db[_0xde55('0x66')][_0xde55('0x2b')]({'where':{'ListId':_0x55f527['query'][_0xde55('0x7a')],'VoiceQueueId':_0x55f527['params']['id']}})[_0xde55('0x2a')](function(){return _0xf98f28;});}})[_0xde55('0x2a')](respondWithStatusCode(_0x4383e9,null))[_0xde55('0x4f')](handleError(_0x4383e9,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 3d4cd9e..9cb62ff 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 _0x6937=['save','remove','emit','hasOwnProperty','hook','events','VoiceQueue','setMaxListeners'];(function(_0x10af44,_0x558fa8){var _0x3eedb7=function(_0x17d844){while(--_0x17d844){_0x10af44['push'](_0x10af44['shift']());}};_0x3eedb7(++_0x558fa8);}(_0x6937,0xf5));var _0x7693=function(_0x5b6375,_0x563718){_0x5b6375=_0x5b6375-0x0;var _0x4045b4=_0x6937[_0x5b6375];return _0x4045b4;};'use strict';var EventEmitter=require(_0x7693('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x7693('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x7693('0x2')](0x0);var events={'afterCreate':_0x7693('0x3'),'afterUpdate':'update','afterDestroy':_0x7693('0x4')};function emitEvent(_0x519369){return function(_0x5ce3ba,_0x1f31c2,_0x370741){VoiceQueueEvents['emit'](_0x519369+':'+_0x5ce3ba['id'],_0x5ce3ba);VoiceQueueEvents[_0x7693('0x5')](_0x519369,_0x5ce3ba);_0x370741(null);};}for(var e in events){if(events[_0x7693('0x6')](e)){var event=events[e];VoiceQueue[_0x7693('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x059c=['VoiceQueue','setMaxListeners','save','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x36f007,_0x557822){var _0x555d8e=function(_0x1e184f){while(--_0x1e184f){_0x36f007['push'](_0x36f007['shift']());}};_0x555d8e(++_0x557822);}(_0x059c,0x156));var _0xc059=function(_0x2971e6,_0x4a962e){_0x2971e6=_0x2971e6-0x0;var _0x5e6392=_0x059c[_0x2971e6];return _0x5e6392;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xc059('0x0'))['db'][_0xc059('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc059('0x2')](0x0);var events={'afterCreate':_0xc059('0x3'),'afterUpdate':'update','afterDestroy':_0xc059('0x4')};function emitEvent(_0x275467){return function(_0x4a7cf1,_0x46b1a7,_0x4ca0dd){VoiceQueueEvents[_0xc059('0x5')](_0x275467+':'+_0x4a7cf1['id'],_0x4a7cf1);VoiceQueueEvents[_0xc059('0x5')](_0x275467,_0x4a7cf1);_0x4ca0dd(null);};}for(var e in events){if(events[_0xc059('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index e0787f8..98b5e89 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x37595b,_0x30c6ed){var _0x116be6=function(_0x1a4f31){while(--_0x1a4f31){_0x37595b['push'](_0x37595b['shift']());}};_0x116be6(++_0x30c6ed);}(_0xedd9,0xfc));var _0x9edd=function(_0x209c03,_0x401c3d){_0x209c03=_0x209c03-0x0;var _0x34dd35=_0xedd9[_0x209c03];return _0x34dd35;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x320687,_0x14ecb9){var _0x3bdebc=function(_0x5b073a){while(--_0x5b073a){_0x320687['push'](_0x320687['shift']());}};_0x3bdebc(++_0x14ecb9);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'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 ac50914..c2d41c3 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 _0x2bc9=['model','find','ShowVoiceQueue','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','include','map'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x2bc9,0x13c));var _0x92bc=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0x2bc9[_0x5c2e5e];return _0x46a5da;};'use strict';var _=require(_0x92bc('0x0'));var util=require(_0x92bc('0x1'));var moment=require(_0x92bc('0x2'));var BPromise=require('bluebird');var rs=require(_0x92bc('0x3'));var fs=require('fs');var Redis=require(_0x92bc('0x4'));var db=require(_0x92bc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x92bc('0x6'))(_0x92bc('0x7'));var config=require(_0x92bc('0x8'));var jayson=require(_0x92bc('0x9'));var client=jayson[_0x92bc('0xa')][_0x92bc('0xb')]({'port':0x232a});config[_0x92bc('0xc')]=_['defaults'](config[_0x92bc('0xc')],{'host':_0x92bc('0xd'),'port':0x18eb});var socket=require(_0x92bc('0xe'))(new Redis(config[_0x92bc('0xc')]));require(_0x92bc('0xf'))[_0x92bc('0x10')](socket);function respondWithRpcPromise(_0x26817a,_0x384b8d,_0x49f324){return new BPromise(function(_0x2edebe,_0x440289){return client[_0x92bc('0x11')](_0x26817a,_0x49f324)['then'](function(_0x40313b){logger[_0x92bc('0x12')](_0x92bc('0x13'),_0x384b8d,_0x92bc('0x14'));logger[_0x92bc('0x15')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x384b8d,'request\x20sent',JSON['stringify'](_0x40313b));if(_0x40313b['error']){if(_0x40313b[_0x92bc('0x16')][_0x92bc('0x17')]===0x1f4){logger[_0x92bc('0x16')](_0x92bc('0x13'),_0x384b8d,_0x40313b['error'][_0x92bc('0x18')]);return _0x440289(_0x40313b[_0x92bc('0x16')]['message']);}logger[_0x92bc('0x16')](_0x92bc('0x13'),_0x384b8d,_0x40313b[_0x92bc('0x16')][_0x92bc('0x18')]);return _0x2edebe(_0x40313b[_0x92bc('0x16')]['message']);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x384b8d,_0x92bc('0x14'));_0x2edebe(_0x40313b[_0x92bc('0x19')][_0x92bc('0x18')]);}})[_0x92bc('0x1a')](function(_0x74c106){logger[_0x92bc('0x16')](_0x92bc('0x13'),_0x384b8d,_0x74c106);_0x440289(_0x74c106);});});}exports[_0x92bc('0x1b')]=function(_0x2af521){var _0x161c59=this;return new Promise(function(_0x1a8c3e,_0x380818){return db[_0x92bc('0x1c')][_0x92bc('0x1d')]({'raw':_0x2af521[_0x92bc('0x1e')]?_0x2af521[_0x92bc('0x1e')][_0x92bc('0x1f')]===undefined?!![]:![]:!![],'where':_0x2af521[_0x92bc('0x1e')]?_0x2af521[_0x92bc('0x1e')]['where']||null:null,'attributes':_0x2af521[_0x92bc('0x1e')]?_0x2af521[_0x92bc('0x1e')][_0x92bc('0x20')]||null:null,'limit':_0x2af521[_0x92bc('0x1e')]?_0x2af521['options']['limit']||null:null,'include':_0x2af521[_0x92bc('0x1e')]?_0x2af521['options'][_0x92bc('0x21')]?_[_0x92bc('0x22')](_0x2af521[_0x92bc('0x1e')][_0x92bc('0x21')],function(_0x2665f6){return{'model':db[_0x2665f6[_0x92bc('0x23')]],'as':_0x2665f6['as'],'attributes':_0x2665f6[_0x92bc('0x20')],'include':_0x2665f6['include']?_['map'](_0x2665f6[_0x92bc('0x21')],function(_0x1c6326){return{'model':db[_0x1c6326['model']],'as':_0x1c6326['as'],'attributes':_0x1c6326[_0x92bc('0x20')],'include':_0x1c6326[_0x92bc('0x21')]?_['map'](_0x1c6326[_0x92bc('0x21')],function(_0x44985d){return{'model':db[_0x44985d[_0x92bc('0x23')]],'as':_0x44985d['as'],'attributes':_0x44985d[_0x92bc('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a93c2){logger[_0x92bc('0x12')](_0x92bc('0x1b'),_0x2af521);logger[_0x92bc('0x15')](_0x92bc('0x1b'),_0x2af521,JSON['stringify'](_0x2a93c2));_0x1a8c3e(_0x2a93c2);})[_0x92bc('0x1a')](function(_0x2a6e09){logger['error'](_0x92bc('0x1b'),_0x2a6e09['message'],_0x2af521);_0x380818(_0x161c59[_0x92bc('0x16')](0x1f4,_0x2a6e09[_0x92bc('0x18')]));});});};exports['ShowVoiceQueue']=function(_0x34c4dd){var _0x24aba6=this;return new Promise(function(_0x1143fe,_0x2f8a54){return db['VoiceQueue'][_0x92bc('0x24')]({'raw':_0x34c4dd['options']?_0x34c4dd[_0x92bc('0x1e')][_0x92bc('0x1f')]===undefined?!![]:![]:!![],'where':_0x34c4dd[_0x92bc('0x1e')]?_0x34c4dd['options']['where']||null:null,'attributes':_0x34c4dd['options']?_0x34c4dd[_0x92bc('0x1e')][_0x92bc('0x20')]||null:null,'include':_0x34c4dd['options']?_0x34c4dd[_0x92bc('0x1e')]['include']?_[_0x92bc('0x22')](_0x34c4dd[_0x92bc('0x1e')][_0x92bc('0x21')],function(_0x8c0dcf){return{'model':db[_0x8c0dcf[_0x92bc('0x23')]],'as':_0x8c0dcf['as'],'attributes':_0x8c0dcf[_0x92bc('0x20')],'include':_0x8c0dcf[_0x92bc('0x21')]?_[_0x92bc('0x22')](_0x8c0dcf['include'],function(_0x44857b){return{'model':db[_0x44857b[_0x92bc('0x23')]],'as':_0x44857b['as'],'attributes':_0x44857b['attributes'],'include':_0x44857b['include']?_[_0x92bc('0x22')](_0x44857b[_0x92bc('0x21')],function(_0x2f5a3f){return{'model':db[_0x2f5a3f[_0x92bc('0x23')]],'as':_0x2f5a3f['as'],'attributes':_0x2f5a3f[_0x92bc('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x390488){logger[_0x92bc('0x12')](_0x92bc('0x25'),_0x34c4dd);logger[_0x92bc('0x15')]('ShowVoiceQueue',_0x34c4dd,JSON[_0x92bc('0x26')](_0x390488));_0x1143fe(_0x390488);})[_0x92bc('0x1a')](function(_0x4af0a9){logger['error'](_0x92bc('0x25'),_0x4af0a9[_0x92bc('0x18')],_0x34c4dd);_0x2f8a54(_0x24aba6[_0x92bc('0x16')](0x1f4,_0x4af0a9[_0x92bc('0x18')]));});});}; \ No newline at end of file +var _0x35f4=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','include','map','attributes','model','ShowVoiceQueue','find','lodash'];(function(_0x22cd9c,_0x536c21){var _0x6e17d3=function(_0x1d980e){while(--_0x1d980e){_0x22cd9c['push'](_0x22cd9c['shift']());}};_0x6e17d3(++_0x536c21);}(_0x35f4,0xdb));var _0x435f=function(_0x2351c4,_0x1dca54){_0x2351c4=_0x2351c4-0x0;var _0x1dd3f8=_0x35f4[_0x2351c4];return _0x1dd3f8;};'use strict';var _=require(_0x435f('0x0'));var util=require(_0x435f('0x1'));var moment=require(_0x435f('0x2'));var BPromise=require(_0x435f('0x3'));var rs=require(_0x435f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x435f('0x5'))['db'];var utils=require(_0x435f('0x6'));var logger=require(_0x435f('0x7'))(_0x435f('0x8'));var config=require(_0x435f('0x9'));var jayson=require(_0x435f('0xa'));var client=jayson[_0x435f('0xb')]['http']({'port':0x232a});config['redis']=_[_0x435f('0xc')](config['redis'],{'host':_0x435f('0xd'),'port':0x18eb});var socket=require(_0x435f('0xe'))(new Redis(config[_0x435f('0xf')]));require(_0x435f('0x10'))[_0x435f('0x11')](socket);function respondWithRpcPromise(_0x2735c8,_0x3c4a44,_0x4a9340){return new BPromise(function(_0x5eabb0,_0x1fb64e){return client[_0x435f('0x12')](_0x2735c8,_0x4a9340)[_0x435f('0x13')](function(_0x369367){logger['info'](_0x435f('0x14'),_0x3c4a44,'request\x20sent');logger[_0x435f('0x15')](_0x435f('0x16'),_0x3c4a44,_0x435f('0x17'),JSON[_0x435f('0x18')](_0x369367));if(_0x369367[_0x435f('0x19')]){if(_0x369367[_0x435f('0x19')][_0x435f('0x1a')]===0x1f4){logger[_0x435f('0x19')](_0x435f('0x14'),_0x3c4a44,_0x369367[_0x435f('0x19')]['message']);return _0x1fb64e(_0x369367[_0x435f('0x19')]['message']);}logger[_0x435f('0x19')](_0x435f('0x14'),_0x3c4a44,_0x369367[_0x435f('0x19')][_0x435f('0x1b')]);return _0x5eabb0(_0x369367['error'][_0x435f('0x1b')]);}else{logger[_0x435f('0x1c')](_0x435f('0x14'),_0x3c4a44,'request\x20sent');_0x5eabb0(_0x369367[_0x435f('0x1d')]['message']);}})[_0x435f('0x1e')](function(_0x55248d){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x3c4a44,_0x55248d);_0x1fb64e(_0x55248d);});});}exports[_0x435f('0x1f')]=function(_0x4c6088){var _0x5079d1=this;return new Promise(function(_0x20fd0a,_0x5dc4ad){return db[_0x435f('0x20')][_0x435f('0x21')]({'raw':_0x4c6088[_0x435f('0x22')]?_0x4c6088[_0x435f('0x22')][_0x435f('0x23')]===undefined?!![]:![]:!![],'where':_0x4c6088[_0x435f('0x22')]?_0x4c6088[_0x435f('0x22')][_0x435f('0x24')]||null:null,'attributes':_0x4c6088['options']?_0x4c6088[_0x435f('0x22')]['attributes']||null:null,'limit':_0x4c6088[_0x435f('0x22')]?_0x4c6088[_0x435f('0x22')][_0x435f('0x25')]||null:null,'include':_0x4c6088[_0x435f('0x22')]?_0x4c6088[_0x435f('0x22')][_0x435f('0x26')]?_[_0x435f('0x27')](_0x4c6088['options'][_0x435f('0x26')],function(_0x15209e){return{'model':db[_0x15209e['model']],'as':_0x15209e['as'],'attributes':_0x15209e[_0x435f('0x28')],'include':_0x15209e[_0x435f('0x26')]?_[_0x435f('0x27')](_0x15209e[_0x435f('0x26')],function(_0x4e56c6){return{'model':db[_0x4e56c6[_0x435f('0x29')]],'as':_0x4e56c6['as'],'attributes':_0x4e56c6[_0x435f('0x28')],'include':_0x4e56c6[_0x435f('0x26')]?_['map'](_0x4e56c6['include'],function(_0xb6e4be){return{'model':db[_0xb6e4be[_0x435f('0x29')]],'as':_0xb6e4be['as'],'attributes':_0xb6e4be[_0x435f('0x28')]};}):[]};}):[]};}):[]:[]})[_0x435f('0x13')](function(_0x5bf6f9){logger[_0x435f('0x1c')](_0x435f('0x1f'),_0x4c6088);logger['debug'](_0x435f('0x1f'),_0x4c6088,JSON[_0x435f('0x18')](_0x5bf6f9));_0x20fd0a(_0x5bf6f9);})[_0x435f('0x1e')](function(_0x1f6dc1){logger[_0x435f('0x19')](_0x435f('0x1f'),_0x1f6dc1[_0x435f('0x1b')],_0x4c6088);_0x5dc4ad(_0x5079d1[_0x435f('0x19')](0x1f4,_0x1f6dc1[_0x435f('0x1b')]));});});};exports[_0x435f('0x2a')]=function(_0x3fba8d){var _0x31ab1c=this;return new Promise(function(_0x3e462d,_0x34b905){return db[_0x435f('0x20')][_0x435f('0x2b')]({'raw':_0x3fba8d[_0x435f('0x22')]?_0x3fba8d[_0x435f('0x22')][_0x435f('0x23')]===undefined?!![]:![]:!![],'where':_0x3fba8d[_0x435f('0x22')]?_0x3fba8d[_0x435f('0x22')][_0x435f('0x24')]||null:null,'attributes':_0x3fba8d[_0x435f('0x22')]?_0x3fba8d[_0x435f('0x22')]['attributes']||null:null,'include':_0x3fba8d[_0x435f('0x22')]?_0x3fba8d[_0x435f('0x22')][_0x435f('0x26')]?_[_0x435f('0x27')](_0x3fba8d[_0x435f('0x22')][_0x435f('0x26')],function(_0x18a8a4){return{'model':db[_0x18a8a4[_0x435f('0x29')]],'as':_0x18a8a4['as'],'attributes':_0x18a8a4[_0x435f('0x28')],'include':_0x18a8a4[_0x435f('0x26')]?_[_0x435f('0x27')](_0x18a8a4[_0x435f('0x26')],function(_0x2b7a77){return{'model':db[_0x2b7a77[_0x435f('0x29')]],'as':_0x2b7a77['as'],'attributes':_0x2b7a77[_0x435f('0x28')],'include':_0x2b7a77[_0x435f('0x26')]?_[_0x435f('0x27')](_0x2b7a77[_0x435f('0x26')],function(_0x1fa068){return{'model':db[_0x1fa068[_0x435f('0x29')]],'as':_0x1fa068['as'],'attributes':_0x1fa068[_0x435f('0x28')]};}):[]};}):[]};}):[]:[]})[_0x435f('0x13')](function(_0x556a41){logger[_0x435f('0x1c')](_0x435f('0x2a'),_0x3fba8d);logger[_0x435f('0x15')](_0x435f('0x2a'),_0x3fba8d,JSON['stringify'](_0x556a41));_0x3e462d(_0x556a41);})[_0x435f('0x1e')](function(_0x153f33){logger[_0x435f('0x19')](_0x435f('0x2a'),_0x153f33[_0x435f('0x1b')],_0x3fba8d);_0x34b905(_0x31ab1c[_0x435f('0x19')](0x1f4,_0x153f33['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index dd1ba12..d653f3e 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 _0x5aed=['./voiceQueue.events','save','remove','emit','removeListener','register','length','voiceQueue:'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5aed,0x138));var _0xd5ae=function(_0x55b79a,_0x54ab17){_0x55b79a=_0x55b79a-0x0;var _0xbbc0e0=_0x5aed[_0x55b79a];return _0xbbc0e0;};'use strict';var VoiceQueueEvents=require(_0xd5ae('0x0'));var events=[_0xd5ae('0x1'),_0xd5ae('0x2'),'update'];function createListener(_0x19c3ea,_0x595b84){return function(_0x2d67ee){_0x595b84[_0xd5ae('0x3')](_0x19c3ea,_0x2d67ee);};}function removeListener(_0x35923d,_0x106286){return function(){VoiceQueueEvents[_0xd5ae('0x4')](_0x35923d,_0x106286);};}exports[_0xd5ae('0x5')]=function(_0x55929a){for(var _0x5871bb=0x0,_0x3a4704=events[_0xd5ae('0x6')];_0x5871bb<_0x3a4704;_0x5871bb++){var _0x32aad2=events[_0x5871bb];var _0x1d8566=createListener(_0xd5ae('0x7')+_0x32aad2,_0x55929a);VoiceQueueEvents['on'](_0x32aad2,_0x1d8566);}}; \ No newline at end of file +var _0x4d31=['register','./voiceQueue.events','save','remove','update','emit','removeListener'];(function(_0x570a0c,_0x1b77cc){var _0x4d3c4e=function(_0x256980){while(--_0x256980){_0x570a0c['push'](_0x570a0c['shift']());}};_0x4d3c4e(++_0x1b77cc);}(_0x4d31,0x13c));var _0x14d3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4d31[_0x321bb2];return _0x9c12ed;};'use strict';var VoiceQueueEvents=require(_0x14d3('0x0'));var events=[_0x14d3('0x1'),_0x14d3('0x2'),_0x14d3('0x3')];function createListener(_0xfca718,_0x3dca1c){return function(_0x2060e8){_0x3dca1c[_0x14d3('0x4')](_0xfca718,_0x2060e8);};}function removeListener(_0x3d579e,_0x21c081){return function(){VoiceQueueEvents[_0x14d3('0x5')](_0x3d579e,_0x21c081);};}exports[_0x14d3('0x6')]=function(_0x37b611){for(var _0xe96991=0x0,_0x252c0a=events['length'];_0xe96991<_0x252c0a;_0xe96991++){var _0x470cb6=events[_0xe96991];var _0x2cd649=createListener('voiceQueue:'+_0x470cb6,_0x37b611);VoiceQueueEvents['on'](_0x470cb6,_0x2cd649);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index fcadea4..53b37cf 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 _0x11e1=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','get','/describe','describe','/index','getVoiceQueuesReport','show','post','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x11e1,0x1b4));var _0x111e=function(_0x200427,_0x4cad2b){_0x200427=_0x200427-0x0;var _0x337ac9=_0x11e1[_0x200427];return _0x337ac9;};'use strict';var multer=require(_0x111e('0x0'));var util=require(_0x111e('0x1'));var path=require(_0x111e('0x2'));var timeout=require(_0x111e('0x3'));var express=require(_0x111e('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x111e('0x5'));var interaction=require(_0x111e('0x6'));var config=require(_0x111e('0x7'));var controller=require(_0x111e('0x8'));router['get']('/',auth[_0x111e('0x9')](),controller['index']);router[_0x111e('0xa')](_0x111e('0xb'),auth[_0x111e('0x9')](),controller[_0x111e('0xc')]);router[_0x111e('0xa')](_0x111e('0xd'),auth[_0x111e('0x9')](),controller[_0x111e('0xe')]);router[_0x111e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x111e('0xf')]);router[_0x111e('0x10')]('/',auth[_0x111e('0x9')](),controller['create']);router['put'](_0x111e('0x11'),auth[_0x111e('0x9')](),controller[_0x111e('0x12')]);router[_0x111e('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x111e('0x14')]);module[_0x111e('0x15')]=router; \ No newline at end of file +var _0x1aaf=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','show','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','Router'];(function(_0x2529bf,_0x43d865){var _0x45443e=function(_0x4cdaa2){while(--_0x4cdaa2){_0x2529bf['push'](_0x2529bf['shift']());}};_0x45443e(++_0x43d865);}(_0x1aaf,0xf9));var _0xf1aa=function(_0x578705,_0x2c46d2){_0x578705=_0x578705-0x0;var _0x5200c0=_0x1aaf[_0x578705];return _0x5200c0;};'use strict';var multer=require('multer');var util=require(_0xf1aa('0x0'));var path=require(_0xf1aa('0x1'));var timeout=require(_0xf1aa('0x2'));var express=require('express');var router=express[_0xf1aa('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf1aa('0x4'));var interaction=require(_0xf1aa('0x5'));var config=require(_0xf1aa('0x6'));var controller=require(_0xf1aa('0x7'));router[_0xf1aa('0x8')]('/',auth[_0xf1aa('0x9')](),controller[_0xf1aa('0xa')]);router[_0xf1aa('0x8')](_0xf1aa('0xb'),auth['isAuthenticated'](),controller[_0xf1aa('0xc')]);router[_0xf1aa('0x8')](_0xf1aa('0xd'),auth['isAuthenticated'](),controller[_0xf1aa('0xe')]);router[_0xf1aa('0x8')]('/:id',auth[_0xf1aa('0x9')](),controller[_0xf1aa('0xf')]);router[_0xf1aa('0x10')]('/',auth[_0xf1aa('0x9')](),controller[_0xf1aa('0x11')]);router[_0xf1aa('0x12')](_0xf1aa('0x13'),auth[_0xf1aa('0x9')](),controller[_0xf1aa('0x14')]);router[_0xf1aa('0x15')](_0xf1aa('0x13'),auth['isAuthenticated'](),controller[_0xf1aa('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index d669db6..96e30c3 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 _0x64f8=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','INTEGER','BOOLEAN'];(function(_0x26ae4d,_0x3c56f7){var _0xc9b89a=function(_0x411561){while(--_0x411561){_0x26ae4d['push'](_0x26ae4d['shift']());}};_0xc9b89a(++_0x3c56f7);}(_0x64f8,0x139));var _0x864f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x64f8[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x864f('0x0'));var moment=require(_0x864f('0x1'));module[_0x864f('0x2')]={'type':{'type':Sequelize[_0x864f('0x3')]},'uniqueid':{'type':Sequelize[_0x864f('0x3')]},'calleridnum':{'type':Sequelize[_0x864f('0x3')]},'calleridname':{'type':Sequelize[_0x864f('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x864f('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x2a67cb){var _0x5ce47b=moment(_0x2a67cb);var _0x562b0b=moment(this['getDataValue'](_0x864f('0x5')))['format'](_0x864f('0x6'));var _0x46aacd=_0x5ce47b[_0x864f('0x7')](_0x562b0b,'seconds');this[_0x864f('0x8')]('queuecallerleaveAt',_0x2a67cb);this[_0x864f('0x8')]('holdtime',_0x46aacd||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x864f('0x9')]},'queuecallerabandon':{'type':Sequelize[_0x864f('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x864f('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x864f('0x4')]},'queuecallerexit':{'type':Sequelize[_0x864f('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x864f('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x864f('0x3')],'comment':_0x864f('0xb')},'originalposition':{'type':Sequelize[_0x864f('0x9')]},'channel':{'type':Sequelize[_0x864f('0x3')]},'connectedlinenum':{'type':Sequelize[_0x864f('0x3')]},'connectedlinename':{'type':Sequelize[_0x864f('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x864f('0x3')]},'priority':{'type':Sequelize[_0x864f('0x3')]},'holdtime':{'type':Sequelize[_0x864f('0x9')]},'mohtime':{'type':Sequelize[_0x864f('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x864f('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x864f('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x864f('0x3')]},'transferuniqueid':{'type':Sequelize[_0x864f('0x3')]},'disposition':{'type':Sequelize[_0x864f('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x864f('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x864f('0x9')],'defaultValue':0x0},'note':{'type':Sequelize[_0x864f('0x3')]}}; \ No newline at end of file +var _0x6749=['FORWARD,\x20BLIND,\x20ATTENDED','moment','STRING','DATE','getDataValue','format','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x6749,0x1c8));var _0x9674=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6749[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9674('0x0'));module['exports']={'type':{'type':Sequelize[_0x9674('0x1')]},'uniqueid':{'type':Sequelize[_0x9674('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9674('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0x9674('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x9674('0x2')],'set':function(_0x391cc1){var _0x70a985=moment(_0x391cc1);var _0x4f919a=moment(this[_0x9674('0x3')]('queuecallerjoinAt'))[_0x9674('0x4')]('YYYY-MM-DD\x20HH:mm:ss');var _0x30198f=_0x70a985['diff'](_0x4f919a,_0x9674('0x5'));this[_0x9674('0x6')](_0x9674('0x7'),_0x391cc1);this[_0x9674('0x6')](_0x9674('0x8'),_0x30198f||null);}},'position':{'type':Sequelize[_0x9674('0x9')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9674('0x2')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x9674('0x2')]},'queuecallerexit':{'type':Sequelize[_0x9674('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x9674('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x9674('0x1')],'comment':_0x9674('0xb')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x9674('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9674('0x1')]},'connectedlinename':{'type':Sequelize[_0x9674('0x1')]},'accountcode':{'type':Sequelize[_0x9674('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x9674('0x1')]},'priority':{'type':Sequelize[_0x9674('0x1')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x9674('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9674('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9674('0x1')]},'transfer':{'type':Sequelize[_0x9674('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9674('0xc')},'transferexten':{'type':Sequelize[_0x9674('0x1')]},'transferuniqueid':{'type':Sequelize[_0x9674('0x1')]},'disposition':{'type':Sequelize[_0x9674('0x1')]},'secondDisposition':{'type':Sequelize[_0x9674('0x1')]},'thirdDisposition':{'type':Sequelize[_0x9674('0x1')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x9674('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 93f6dd7..21855a4 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 _0x8d73=['nolimit','order','sort','where','pick','filter','merge','then','catch','show','params','includeAll','include','options','create','body','update','find','describe','findAll','rows','getVoiceQueuesReport','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','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','defaults','redis','register','status','end','offset','limit','count','set','Content-Range','json','reject','save','destroy','sendStatus','error','stack','name','send','VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0xf0db21,_0x5d98c9){var _0x47f4cb=function(_0x551f5b){while(--_0x551f5b){_0xf0db21['push'](_0xf0db21['shift']());}};_0x47f4cb(++_0x5d98c9);}(_0x8d73,0x68));var _0x38d7=function(_0x5aba1b,_0x1d537d){_0x5aba1b=_0x5aba1b-0x0;var _0x4adba3=_0x8d73[_0x5aba1b];return _0x4adba3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x38d7('0x0'));var jsonpatch=require(_0x38d7('0x1'));var rp=require(_0x38d7('0x2'));var moment=require(_0x38d7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x38d7('0x4'));var util=require('util');var path=require(_0x38d7('0x5'));var sox=require(_0x38d7('0x6'));var csv=require(_0x38d7('0x7'));var ejs=require(_0x38d7('0x8'));var fs=require('fs');var fs_extra=require(_0x38d7('0x9'));var _=require(_0x38d7('0xa'));var squel=require(_0x38d7('0xb'));var crypto=require(_0x38d7('0xc'));var jsforce=require(_0x38d7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x38d7('0x7'));var querystring=require(_0x38d7('0xe'));var Papa=require(_0x38d7('0xf'));var Redis=require(_0x38d7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x38d7('0x11'));var as=require(_0x38d7('0x12'));var hardwareService=require(_0x38d7('0x13'));var logger=require(_0x38d7('0x14'))(_0x38d7('0x15'));var utils=require(_0x38d7('0x16'));var config=require(_0x38d7('0x17'));var licenseUtil=require(_0x38d7('0x18'));var db=require(_0x38d7('0x19'))['db'];config['redis']=_[_0x38d7('0x1a')](config[_0x38d7('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x38d7('0x1b')]));require('./voiceQueueReport.socket')[_0x38d7('0x1c')](socket);function respondWithStatusCode(_0x4ceb51,_0x36bc0b){_0x36bc0b=_0x36bc0b||0xcc;return function(_0x56bf22){if(_0x56bf22){return _0x4ceb51['sendStatus'](_0x36bc0b);}return _0x4ceb51[_0x38d7('0x1d')](_0x36bc0b)[_0x38d7('0x1e')]();};}function respondWithResult(_0x4c9589,_0x14ced3){_0x14ced3=_0x14ced3||0xc8;return function(_0x330010){if(_0x330010){return _0x4c9589[_0x38d7('0x1d')](_0x14ced3)['json'](_0x330010);}};}function respondWithFilteredResult(_0x2707da,_0x5dc47d){return function(_0x41df63){if(_0x41df63){var _0x5a2da2=typeof _0x5dc47d[_0x38d7('0x1f')]==='undefined'&&typeof _0x5dc47d[_0x38d7('0x20')]==='undefined';var _0x4b9bdf=_0x41df63[_0x38d7('0x21')];var _0x42e822=_0x5a2da2?0x0:_0x5dc47d[_0x38d7('0x1f')];var _0x30adb6=_0x5a2da2?_0x41df63[_0x38d7('0x21')]:_0x5dc47d[_0x38d7('0x1f')]+_0x5dc47d['limit'];var _0x9f3080;if(_0x30adb6>=_0x4b9bdf){_0x30adb6=_0x4b9bdf;_0x9f3080=0xc8;}else{_0x9f3080=0xce;}_0x2707da[_0x38d7('0x1d')](_0x9f3080);return _0x2707da[_0x38d7('0x22')](_0x38d7('0x23'),_0x42e822+'-'+_0x30adb6+'/'+_0x4b9bdf)[_0x38d7('0x24')](_0x41df63);}return null;};}function patchUpdates(_0x59498c){return function(_0x432449){try{jsonpatch['apply'](_0x432449,_0x59498c,!![]);}catch(_0x47f1fe){return BPromise[_0x38d7('0x25')](_0x47f1fe);}return _0x432449[_0x38d7('0x26')]();};}function saveUpdates(_0x5d078c,_0x519894){return function(_0x1f7a95){if(_0x1f7a95){return _0x1f7a95['update'](_0x5d078c)['then'](function(_0x4b8af0){return _0x4b8af0;});}return null;};}function removeEntity(_0x2679c2,_0x485355){return function(_0x2dc1a4){if(_0x2dc1a4){return _0x2dc1a4[_0x38d7('0x27')]()['then'](function(){_0x2679c2['status'](0xcc)[_0x38d7('0x1e')]();});}};}function handleEntityNotFound(_0x172ac9,_0x4e0c39){return function(_0x310887){if(!_0x310887){_0x172ac9[_0x38d7('0x28')](0x194);}return _0x310887;};}function handleError(_0x280954,_0x10d167){_0x10d167=_0x10d167||0x1f4;return function(_0x56b72e){logger[_0x38d7('0x29')](_0x56b72e[_0x38d7('0x2a')]);if(_0x56b72e[_0x38d7('0x2b')]){delete _0x56b72e[_0x38d7('0x2b')];}_0x280954['status'](_0x10d167)[_0x38d7('0x2c')](_0x56b72e);};}exports['index']=function(_0x2119a5,_0x608cbc){var _0xc8a408={},_0x152411={},_0x3b1a1b={'count':0x0,'rows':[]};var _0x2acd23=_['map'](db[_0x38d7('0x2d')][_0x38d7('0x2e')],function(_0x513584){return{'name':_0x513584[_0x38d7('0x2f')],'type':_0x513584[_0x38d7('0x30')][_0x38d7('0x31')]};});_0x152411[_0x38d7('0x32')]=_[_0x38d7('0x33')](_0x2acd23,_0x38d7('0x2b'));_0x152411[_0x38d7('0x34')]=_[_0x38d7('0x35')](_0x2119a5[_0x38d7('0x34')]);_0x152411[_0x38d7('0x36')]=_[_0x38d7('0x37')](_0x152411['model'],_0x152411['query']);_0xc8a408[_0x38d7('0x38')]=_[_0x38d7('0x37')](_0x152411[_0x38d7('0x32')],qs[_0x38d7('0x39')](_0x2119a5['query']['fields']));_0xc8a408[_0x38d7('0x38')]=_0xc8a408['attributes'][_0x38d7('0x3a')]?_0xc8a408[_0x38d7('0x38')]:_0x152411[_0x38d7('0x32')];if(!_0x2119a5[_0x38d7('0x34')][_0x38d7('0x3b')](_0x38d7('0x3c'))){_0xc8a408[_0x38d7('0x20')]=qs[_0x38d7('0x20')](_0x2119a5['query'][_0x38d7('0x20')]);_0xc8a408[_0x38d7('0x1f')]=qs[_0x38d7('0x1f')](_0x2119a5[_0x38d7('0x34')][_0x38d7('0x1f')]);}_0xc8a408[_0x38d7('0x3d')]=qs['sort'](_0x2119a5['query'][_0x38d7('0x3e')]);_0xc8a408[_0x38d7('0x3f')]=qs['filters'](_[_0x38d7('0x40')](_0x2119a5[_0x38d7('0x34')],_0x152411['filters']),_0x2acd23);if(_0x2119a5[_0x38d7('0x34')][_0x38d7('0x41')]){_0xc8a408[_0x38d7('0x3f')]=_[_0x38d7('0x42')](_0xc8a408[_0x38d7('0x3f')],{'$or':_[_0x38d7('0x33')](_0x2acd23,function(_0x1ecbdf){if(_0x1ecbdf['type']!=='VIRTUAL'){var _0x3007bf={};_0x3007bf[_0x1ecbdf[_0x38d7('0x2b')]]={'$like':'%'+_0x2119a5[_0x38d7('0x34')][_0x38d7('0x41')]+'%'};return _0x3007bf;}})});}_0xc8a408=_['merge']({},_0xc8a408,_0x2119a5['options']);var _0x54fdae={'where':_0xc8a408[_0x38d7('0x3f')]};return db[_0x38d7('0x2d')][_0x38d7('0x21')](_0x54fdae)[_0x38d7('0x43')](function(_0x3c78b8){_0x3b1a1b['count']=_0x3c78b8;if(_0x2119a5[_0x38d7('0x34')]['includeAll']){_0xc8a408['include']=[{'all':!![]}];}return db[_0x38d7('0x2d')]['findAll'](_0xc8a408);})[_0x38d7('0x43')](function(_0x1de9cd){_0x3b1a1b['rows']=_0x1de9cd;return _0x3b1a1b;})[_0x38d7('0x43')](respondWithFilteredResult(_0x608cbc,_0xc8a408))[_0x38d7('0x44')](handleError(_0x608cbc,null));};exports[_0x38d7('0x45')]=function(_0x1aa444,_0x4c60e7){var _0x4f12f8={'raw':![],'where':{'id':_0x1aa444[_0x38d7('0x46')]['id']}},_0x12ada7={};_0x12ada7[_0x38d7('0x32')]=_[_0x38d7('0x35')](db[_0x38d7('0x2d')]['rawAttributes']);_0x12ada7[_0x38d7('0x34')]=_['keys'](_0x1aa444['query']);_0x12ada7[_0x38d7('0x36')]=_[_0x38d7('0x37')](_0x12ada7[_0x38d7('0x32')],_0x12ada7['query']);_0x4f12f8['attributes']=_[_0x38d7('0x37')](_0x12ada7['model'],qs[_0x38d7('0x39')](_0x1aa444[_0x38d7('0x34')][_0x38d7('0x39')]));_0x4f12f8[_0x38d7('0x38')]=_0x4f12f8[_0x38d7('0x38')][_0x38d7('0x3a')]?_0x4f12f8['attributes']:_0x12ada7[_0x38d7('0x32')];if(_0x1aa444[_0x38d7('0x34')][_0x38d7('0x47')]){_0x4f12f8[_0x38d7('0x48')]=[{'all':!![]}];}_0x4f12f8=_[_0x38d7('0x42')]({},_0x4f12f8,_0x1aa444[_0x38d7('0x49')]);return db['VoiceQueueReport']['find'](_0x4f12f8)[_0x38d7('0x43')](handleEntityNotFound(_0x4c60e7,null))[_0x38d7('0x43')](respondWithResult(_0x4c60e7,null))[_0x38d7('0x44')](handleError(_0x4c60e7,null));};exports['create']=function(_0x882b4d,_0xa897a0){return db[_0x38d7('0x2d')][_0x38d7('0x4a')](_0x882b4d[_0x38d7('0x4b')],{})[_0x38d7('0x43')](respondWithResult(_0xa897a0,0xc9))['catch'](handleError(_0xa897a0,null));};exports[_0x38d7('0x4c')]=function(_0x182090,_0x60c7bb){if(_0x182090[_0x38d7('0x4b')]['id']){delete _0x182090[_0x38d7('0x4b')]['id'];}return db[_0x38d7('0x2d')][_0x38d7('0x4d')]({'where':{'id':_0x182090[_0x38d7('0x46')]['id']}})[_0x38d7('0x43')](handleEntityNotFound(_0x60c7bb,null))[_0x38d7('0x43')](saveUpdates(_0x182090[_0x38d7('0x4b')],null))['then'](respondWithResult(_0x60c7bb,null))[_0x38d7('0x44')](handleError(_0x60c7bb,null));};exports[_0x38d7('0x27')]=function(_0x1d54fe,_0x3f046b){return db[_0x38d7('0x2d')]['find']({'where':{'id':_0x1d54fe[_0x38d7('0x46')]['id']}})[_0x38d7('0x43')](handleEntityNotFound(_0x3f046b,null))['then'](removeEntity(_0x3f046b,null))[_0x38d7('0x44')](handleError(_0x3f046b,null));};exports[_0x38d7('0x4e')]=function(_0x15bcad,_0x57b6ff){return db['VoiceQueueReport']['describe']()[_0x38d7('0x43')](respondWithResult(_0x57b6ff,null))[_0x38d7('0x44')](handleError(_0x57b6ff,null));};exports['getVoiceQueuesReport']=function(_0x2e9409,_0x2faac7){var _0x24fbce={},_0x56494e={},_0x5d7cc1={'count':0x0,'rows':[]};_0x56494e['model']=_[_0x38d7('0x35')](db[_0x38d7('0x2d')][_0x38d7('0x2e')]);_0x56494e[_0x38d7('0x34')]=_[_0x38d7('0x35')](_0x2e9409[_0x38d7('0x34')]);_0x56494e[_0x38d7('0x36')]=_[_0x38d7('0x37')](_0x56494e['model'],_0x56494e['query']);_0x24fbce[_0x38d7('0x38')]=_[_0x38d7('0x37')](_0x56494e[_0x38d7('0x32')],qs[_0x38d7('0x39')](_0x2e9409[_0x38d7('0x34')][_0x38d7('0x39')]));_0x24fbce[_0x38d7('0x38')]=_0x24fbce['attributes'][_0x38d7('0x3a')]?_0x24fbce[_0x38d7('0x38')]:_0x56494e['model'];if(!_0x2e9409['query'][_0x38d7('0x3b')](_0x38d7('0x3c'))){_0x24fbce['limit']=qs[_0x38d7('0x20')](_0x2e9409['query'][_0x38d7('0x20')]);_0x24fbce['offset']=qs[_0x38d7('0x1f')](_0x2e9409['query'][_0x38d7('0x1f')]);}_0x24fbce[_0x38d7('0x3d')]=qs[_0x38d7('0x3e')](_0x2e9409['query'][_0x38d7('0x3e')]);_0x24fbce[_0x38d7('0x3f')]=qs[_0x38d7('0x36')](_[_0x38d7('0x40')](_0x2e9409[_0x38d7('0x34')],_0x56494e[_0x38d7('0x36')]));if(_0x2e9409['query'][_0x38d7('0x41')]){_0x24fbce['where']=_['merge'](_0x24fbce[_0x38d7('0x3f')],{'$or':_[_0x38d7('0x33')](_0x24fbce[_0x38d7('0x38')],function(_0x206fb1){var _0x289316={};_0x289316[_0x206fb1]={'$like':'%'+_0x2e9409[_0x38d7('0x34')]['filter']+'%'};return _0x289316;})});}_0x24fbce=_[_0x38d7('0x42')]({},_0x24fbce,_0x2e9409[_0x38d7('0x49')]);var _0x3d1380={'where':_0x24fbce['where']};return db[_0x38d7('0x2d')][_0x38d7('0x21')](_0x3d1380)['then'](function(_0x481dfe){_0x5d7cc1['count']=_0x481dfe;if(_0x2e9409['query'][_0x38d7('0x47')]){_0x24fbce['include']=[{'all':!![]}];}return db[_0x38d7('0x2d')][_0x38d7('0x4f')](_0x24fbce);})[_0x38d7('0x43')](function(_0x11acc5){_0x5d7cc1[_0x38d7('0x50')]=_0x11acc5;return _0x5d7cc1;})[_0x38d7('0x43')](respondWithFilteredResult(_0x2faac7,_0x24fbce,'getVoiceQueuesReport'))[_0x38d7('0x44')](handleError(_0x2faac7,null,_0x38d7('0x51')));}; \ No newline at end of file +var _0x51aa=['../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','getVoiceQueuesReport','order','rimraf','zip-dir','bluebird','util','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5793dc,_0x460604){var _0x449d6a=function(_0x44029d){while(--_0x44029d){_0x5793dc['push'](_0x5793dc['shift']());}};_0x449d6a(++_0x460604);}(_0x51aa,0x12d));var _0xa51a=function(_0x404b66,_0x3a3f21){_0x404b66=_0x404b66-0x0;var _0x3ccc05=_0x51aa[_0x404b66];return _0x3ccc05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa51a('0x0'));var zipdir=require(_0xa51a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa51a('0x2'));var Mustache=require('mustache');var util=require(_0xa51a('0x3'));var path=require('path');var sox=require(_0xa51a('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa51a('0x5'));var crypto=require(_0xa51a('0x6'));var jsforce=require(_0xa51a('0x7'));var deskjs=require(_0xa51a('0x8'));var toCsv=require(_0xa51a('0x9'));var querystring=require(_0xa51a('0xa'));var Papa=require(_0xa51a('0xb'));var Redis=require(_0xa51a('0xc'));var authService=require(_0xa51a('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xa51a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa51a('0xf'))(_0xa51a('0x10'));var utils=require(_0xa51a('0x11'));var config=require(_0xa51a('0x12'));var licenseUtil=require(_0xa51a('0x13'));var db=require(_0xa51a('0x14'))['db'];config[_0xa51a('0x15')]=_[_0xa51a('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa51a('0x17'))(new Redis(config[_0xa51a('0x15')]));require('./voiceQueueReport.socket')[_0xa51a('0x18')](socket);function respondWithStatusCode(_0x40ae3d,_0x4dab72){_0x4dab72=_0x4dab72||0xcc;return function(_0x4b1c20){if(_0x4b1c20){return _0x40ae3d[_0xa51a('0x19')](_0x4dab72);}return _0x40ae3d[_0xa51a('0x1a')](_0x4dab72)[_0xa51a('0x1b')]();};}function respondWithResult(_0x190368,_0x728115){_0x728115=_0x728115||0xc8;return function(_0x53da10){if(_0x53da10){return _0x190368['status'](_0x728115)[_0xa51a('0x1c')](_0x53da10);}};}function respondWithFilteredResult(_0x2f8b7b,_0x556f29){return function(_0x3f3b5c){if(_0x3f3b5c){var _0x4dac78=typeof _0x556f29[_0xa51a('0x1d')]===_0xa51a('0x1e')&&typeof _0x556f29[_0xa51a('0x1f')]==='undefined';var _0x145577=_0x3f3b5c[_0xa51a('0x20')];var _0x15fc4b=_0x4dac78?0x0:_0x556f29[_0xa51a('0x1d')];var _0x231183=_0x4dac78?_0x3f3b5c['count']:_0x556f29[_0xa51a('0x1d')]+_0x556f29[_0xa51a('0x1f')];var _0x946915;if(_0x231183>=_0x145577){_0x231183=_0x145577;_0x946915=0xc8;}else{_0x946915=0xce;}_0x2f8b7b['status'](_0x946915);return _0x2f8b7b['set'](_0xa51a('0x21'),_0x15fc4b+'-'+_0x231183+'/'+_0x145577)[_0xa51a('0x1c')](_0x3f3b5c);}return null;};}function patchUpdates(_0x1f8c5b){return function(_0x21ccaa){try{jsonpatch[_0xa51a('0x22')](_0x21ccaa,_0x1f8c5b,!![]);}catch(_0x3e91b9){return BPromise[_0xa51a('0x23')](_0x3e91b9);}return _0x21ccaa[_0xa51a('0x24')]();};}function saveUpdates(_0x2e7c83,_0x31781e){return function(_0x557099){if(_0x557099){return _0x557099[_0xa51a('0x25')](_0x2e7c83)['then'](function(_0x572648){return _0x572648;});}return null;};}function removeEntity(_0x4ed58c,_0x46a0df){return function(_0x45bfab){if(_0x45bfab){return _0x45bfab[_0xa51a('0x26')]()[_0xa51a('0x27')](function(){_0x4ed58c[_0xa51a('0x1a')](0xcc)[_0xa51a('0x1b')]();});}};}function handleEntityNotFound(_0x57b19b,_0x2f19de){return function(_0x37d261){if(!_0x37d261){_0x57b19b['sendStatus'](0x194);}return _0x37d261;};}function handleError(_0x5b0638,_0x3d8394){_0x3d8394=_0x3d8394||0x1f4;return function(_0x43a2a4){logger[_0xa51a('0x28')](_0x43a2a4[_0xa51a('0x29')]);if(_0x43a2a4[_0xa51a('0x2a')]){delete _0x43a2a4[_0xa51a('0x2a')];}_0x5b0638['status'](_0x3d8394)[_0xa51a('0x2b')](_0x43a2a4);};}exports[_0xa51a('0x2c')]=function(_0x5134bb,_0x1cfef1){var _0x429028={},_0x46932a={},_0x5d29da={'count':0x0,'rows':[]};var _0x56a0ab=_[_0xa51a('0x2d')](db[_0xa51a('0x2e')][_0xa51a('0x2f')],function(_0x41913d){return{'name':_0x41913d[_0xa51a('0x30')],'type':_0x41913d[_0xa51a('0x31')]['key']};});_0x46932a[_0xa51a('0x32')]=_[_0xa51a('0x2d')](_0x56a0ab,'name');_0x46932a['query']=_[_0xa51a('0x33')](_0x5134bb['query']);_0x46932a[_0xa51a('0x34')]=_[_0xa51a('0x35')](_0x46932a[_0xa51a('0x32')],_0x46932a[_0xa51a('0x36')]);_0x429028[_0xa51a('0x37')]=_[_0xa51a('0x35')](_0x46932a['model'],qs[_0xa51a('0x38')](_0x5134bb[_0xa51a('0x36')][_0xa51a('0x38')]));_0x429028[_0xa51a('0x37')]=_0x429028[_0xa51a('0x37')][_0xa51a('0x39')]?_0x429028[_0xa51a('0x37')]:_0x46932a[_0xa51a('0x32')];if(!_0x5134bb['query'][_0xa51a('0x3a')](_0xa51a('0x3b'))){_0x429028[_0xa51a('0x1f')]=qs[_0xa51a('0x1f')](_0x5134bb[_0xa51a('0x36')][_0xa51a('0x1f')]);_0x429028['offset']=qs['offset'](_0x5134bb[_0xa51a('0x36')][_0xa51a('0x1d')]);}_0x429028['order']=qs[_0xa51a('0x3c')](_0x5134bb[_0xa51a('0x36')][_0xa51a('0x3c')]);_0x429028[_0xa51a('0x3d')]=qs[_0xa51a('0x34')](_[_0xa51a('0x3e')](_0x5134bb[_0xa51a('0x36')],_0x46932a[_0xa51a('0x34')]),_0x56a0ab);if(_0x5134bb[_0xa51a('0x36')][_0xa51a('0x3f')]){_0x429028[_0xa51a('0x3d')]=_['merge'](_0x429028[_0xa51a('0x3d')],{'$or':_[_0xa51a('0x2d')](_0x56a0ab,function(_0x2676dc){if(_0x2676dc['type']!==_0xa51a('0x40')){var _0x3400ef={};_0x3400ef[_0x2676dc[_0xa51a('0x2a')]]={'$like':'%'+_0x5134bb[_0xa51a('0x36')][_0xa51a('0x3f')]+'%'};return _0x3400ef;}})});}_0x429028=_[_0xa51a('0x41')]({},_0x429028,_0x5134bb['options']);var _0x2fb204={'where':_0x429028[_0xa51a('0x3d')]};return db['VoiceQueueReport'][_0xa51a('0x20')](_0x2fb204)['then'](function(_0x2b45fd){_0x5d29da[_0xa51a('0x20')]=_0x2b45fd;if(_0x5134bb['query'][_0xa51a('0x42')]){_0x429028[_0xa51a('0x43')]=[{'all':!![]}];}return db[_0xa51a('0x2e')][_0xa51a('0x44')](_0x429028);})[_0xa51a('0x27')](function(_0x171493){_0x5d29da[_0xa51a('0x45')]=_0x171493;return _0x5d29da;})[_0xa51a('0x27')](respondWithFilteredResult(_0x1cfef1,_0x429028))[_0xa51a('0x46')](handleError(_0x1cfef1,null));};exports[_0xa51a('0x47')]=function(_0x545fa8,_0x578747){var _0x58f1ed={'raw':![],'where':{'id':_0x545fa8[_0xa51a('0x48')]['id']}},_0xc4a5f={};_0xc4a5f[_0xa51a('0x32')]=_['keys'](db['VoiceQueueReport'][_0xa51a('0x2f')]);_0xc4a5f[_0xa51a('0x36')]=_['keys'](_0x545fa8[_0xa51a('0x36')]);_0xc4a5f[_0xa51a('0x34')]=_[_0xa51a('0x35')](_0xc4a5f[_0xa51a('0x32')],_0xc4a5f[_0xa51a('0x36')]);_0x58f1ed[_0xa51a('0x37')]=_['intersection'](_0xc4a5f[_0xa51a('0x32')],qs['fields'](_0x545fa8[_0xa51a('0x36')][_0xa51a('0x38')]));_0x58f1ed['attributes']=_0x58f1ed[_0xa51a('0x37')][_0xa51a('0x39')]?_0x58f1ed['attributes']:_0xc4a5f[_0xa51a('0x32')];if(_0x545fa8[_0xa51a('0x36')][_0xa51a('0x42')]){_0x58f1ed[_0xa51a('0x43')]=[{'all':!![]}];}_0x58f1ed=_['merge']({},_0x58f1ed,_0x545fa8[_0xa51a('0x49')]);return db[_0xa51a('0x2e')][_0xa51a('0x4a')](_0x58f1ed)[_0xa51a('0x27')](handleEntityNotFound(_0x578747,null))[_0xa51a('0x27')](respondWithResult(_0x578747,null))[_0xa51a('0x46')](handleError(_0x578747,null));};exports[_0xa51a('0x4b')]=function(_0x1d19a9,_0x79beb4){return db[_0xa51a('0x2e')]['create'](_0x1d19a9['body'],{})[_0xa51a('0x27')](respondWithResult(_0x79beb4,0xc9))[_0xa51a('0x46')](handleError(_0x79beb4,null));};exports[_0xa51a('0x25')]=function(_0x398576,_0x30321d){if(_0x398576[_0xa51a('0x4c')]['id']){delete _0x398576[_0xa51a('0x4c')]['id'];}return db[_0xa51a('0x2e')]['find']({'where':{'id':_0x398576[_0xa51a('0x48')]['id']}})[_0xa51a('0x27')](handleEntityNotFound(_0x30321d,null))[_0xa51a('0x27')](saveUpdates(_0x398576['body'],null))['then'](respondWithResult(_0x30321d,null))[_0xa51a('0x46')](handleError(_0x30321d,null));};exports[_0xa51a('0x26')]=function(_0x1e4f44,_0x3f8fe8){return db['VoiceQueueReport']['find']({'where':{'id':_0x1e4f44['params']['id']}})['then'](handleEntityNotFound(_0x3f8fe8,null))[_0xa51a('0x27')](removeEntity(_0x3f8fe8,null))['catch'](handleError(_0x3f8fe8,null));};exports[_0xa51a('0x4d')]=function(_0x5ec721,_0x19d041){return db[_0xa51a('0x2e')][_0xa51a('0x4d')]()['then'](respondWithResult(_0x19d041,null))['catch'](handleError(_0x19d041,null));};exports[_0xa51a('0x4e')]=function(_0x33a74b,_0x10fbf3){var _0x7e8996={},_0x57a430={},_0x38fcbd={'count':0x0,'rows':[]};_0x57a430[_0xa51a('0x32')]=_[_0xa51a('0x33')](db['VoiceQueueReport'][_0xa51a('0x2f')]);_0x57a430[_0xa51a('0x36')]=_[_0xa51a('0x33')](_0x33a74b[_0xa51a('0x36')]);_0x57a430[_0xa51a('0x34')]=_['intersection'](_0x57a430[_0xa51a('0x32')],_0x57a430[_0xa51a('0x36')]);_0x7e8996[_0xa51a('0x37')]=_[_0xa51a('0x35')](_0x57a430[_0xa51a('0x32')],qs[_0xa51a('0x38')](_0x33a74b[_0xa51a('0x36')][_0xa51a('0x38')]));_0x7e8996[_0xa51a('0x37')]=_0x7e8996[_0xa51a('0x37')][_0xa51a('0x39')]?_0x7e8996[_0xa51a('0x37')]:_0x57a430[_0xa51a('0x32')];if(!_0x33a74b['query'][_0xa51a('0x3a')](_0xa51a('0x3b'))){_0x7e8996[_0xa51a('0x1f')]=qs[_0xa51a('0x1f')](_0x33a74b[_0xa51a('0x36')]['limit']);_0x7e8996[_0xa51a('0x1d')]=qs[_0xa51a('0x1d')](_0x33a74b[_0xa51a('0x36')][_0xa51a('0x1d')]);}_0x7e8996[_0xa51a('0x4f')]=qs[_0xa51a('0x3c')](_0x33a74b[_0xa51a('0x36')][_0xa51a('0x3c')]);_0x7e8996[_0xa51a('0x3d')]=qs[_0xa51a('0x34')](_[_0xa51a('0x3e')](_0x33a74b['query'],_0x57a430['filters']));if(_0x33a74b[_0xa51a('0x36')][_0xa51a('0x3f')]){_0x7e8996[_0xa51a('0x3d')]=_[_0xa51a('0x41')](_0x7e8996[_0xa51a('0x3d')],{'$or':_[_0xa51a('0x2d')](_0x7e8996[_0xa51a('0x37')],function(_0x42a688){var _0x2b3dff={};_0x2b3dff[_0x42a688]={'$like':'%'+_0x33a74b[_0xa51a('0x36')][_0xa51a('0x3f')]+'%'};return _0x2b3dff;})});}_0x7e8996=_[_0xa51a('0x41')]({},_0x7e8996,_0x33a74b['options']);var _0x4468d6={'where':_0x7e8996[_0xa51a('0x3d')]};return db['VoiceQueueReport'][_0xa51a('0x20')](_0x4468d6)[_0xa51a('0x27')](function(_0x5a211d){_0x38fcbd['count']=_0x5a211d;if(_0x33a74b[_0xa51a('0x36')]['includeAll']){_0x7e8996[_0xa51a('0x43')]=[{'all':!![]}];}return db[_0xa51a('0x2e')][_0xa51a('0x44')](_0x7e8996);})[_0xa51a('0x27')](function(_0x15affd){_0x38fcbd[_0xa51a('0x45')]=_0x15affd;return _0x38fcbd;})[_0xa51a('0x27')](respondWithFilteredResult(_0x10fbf3,_0x7e8996,'getVoiceQueuesReport'))['catch'](handleError(_0x10fbf3,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index e3dd9b7..81890bd 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 _0xad0a=['remove','emit','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update'];(function(_0x130145,_0x353c81){var _0x4f2166=function(_0x397c46){while(--_0x397c46){_0x130145['push'](_0x130145['shift']());}};_0x4f2166(++_0x353c81);}(_0xad0a,0x92));var _0xaad0=function(_0x1b9abf,_0x5e449b){_0x1b9abf=_0x1b9abf-0x0;var _0x1d8450=_0xad0a[_0x1b9abf];return _0x1d8450;};'use strict';var EventEmitter=require(_0xaad0('0x0'));var VoiceQueueReport=require(_0xaad0('0x1'))['db'][_0xaad0('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xaad0('0x3')](0x0);var events={'afterCreate':_0xaad0('0x4'),'afterUpdate':_0xaad0('0x5'),'afterDestroy':_0xaad0('0x6')};function emitEvent(_0x45f023){return function(_0x4b3698,_0x36907b,_0x1eec67){VoiceQueueReportEvents[_0xaad0('0x7')](_0x45f023+':'+_0x4b3698['id'],_0x4b3698);VoiceQueueReportEvents[_0xaad0('0x7')](_0x45f023,_0x4b3698);_0x1eec67(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 _0xf344=['emit','hasOwnProperty','hook','exports','events','VoiceQueueReport','save','update','remove'];(function(_0x5bbd9a,_0x598515){var _0x45e28d=function(_0x1a728f){while(--_0x1a728f){_0x5bbd9a['push'](_0x5bbd9a['shift']());}};_0x45e28d(++_0x598515);}(_0xf344,0xa6));var _0x4f34=function(_0x57c9f9,_0x3a9ddd){_0x57c9f9=_0x57c9f9-0x0;var _0x3ac587=_0xf344[_0x57c9f9];return _0x3ac587;};'use strict';var EventEmitter=require(_0x4f34('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x4f34('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f34('0x2'),'afterUpdate':_0x4f34('0x3'),'afterDestroy':_0x4f34('0x4')};function emitEvent(_0xbcc2c7){return function(_0x47eade,_0x176940,_0x28a1c4){VoiceQueueReportEvents['emit'](_0xbcc2c7+':'+_0x47eade['id'],_0x47eade);VoiceQueueReportEvents[_0x4f34('0x5')](_0xbcc2c7,_0x47eade);_0x28a1c4(null);};}for(var e in events){if(events[_0x4f34('0x6')](e)){var event=events[e];VoiceQueueReport[_0x4f34('0x7')](e,emitEvent(event));}}module[_0x4f34('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 4114320..69ce782 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 _0xcef2=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash'];(function(_0x28c2b2,_0x4df41f){var _0x2c4e13=function(_0x31f6b2){while(--_0x31f6b2){_0x28c2b2['push'](_0x28c2b2['shift']());}};_0x2c4e13(++_0x4df41f);}(_0xcef2,0x8f));var _0x2cef=function(_0x3c340e,_0x33c8bc){_0x3c340e=_0x3c340e-0x0;var _0x2c82b6=_0xcef2[_0x3c340e];return _0x2c82b6;};'use strict';var _=require(_0x2cef('0x0'));var util=require(_0x2cef('0x1'));var logger=require(_0x2cef('0x2'))(_0x2cef('0x3'));var moment=require('moment');var BPromise=require(_0x2cef('0x4'));var rp=require(_0x2cef('0x5'));var fs=require('fs');var path=require(_0x2cef('0x6'));var rimraf=require(_0x2cef('0x7'));var config=require(_0x2cef('0x8'));var attributes=require(_0x2cef('0x9'));module[_0x2cef('0xa')]=function(_0x268271,_0xe94631){return _0x268271[_0x2cef('0xb')](_0x2cef('0xc'),attributes,{'tableName':_0x2cef('0xd'),'paranoid':![],'indexes':[{'fields':[_0x2cef('0xe')]},{'fields':[_0x2cef('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a95=['exports','define','VoiceQueueReport','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes'];(function(_0x3bcc87,_0x2200ec){var _0x45c6e4=function(_0x458b6e){while(--_0x458b6e){_0x3bcc87['push'](_0x3bcc87['shift']());}};_0x45c6e4(++_0x2200ec);}(_0x7a95,0x113));var _0x57a9=function(_0x3ec2b4,_0x2bb341){_0x3ec2b4=_0x3ec2b4-0x0;var _0xd85882=_0x7a95[_0x3ec2b4];return _0xd85882;};'use strict';var _=require(_0x57a9('0x0'));var util=require(_0x57a9('0x1'));var logger=require(_0x57a9('0x2'))(_0x57a9('0x3'));var moment=require(_0x57a9('0x4'));var BPromise=require(_0x57a9('0x5'));var rp=require(_0x57a9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57a9('0x7'));var config=require(_0x57a9('0x8'));var attributes=require(_0x57a9('0x9'));module[_0x57a9('0xa')]=function(_0x421a5e,_0x3708a7){return _0x421a5e[_0x57a9('0xb')](_0x57a9('0xc'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x57a9('0xd')]},{'fields':[_0x57a9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index b86aeab..93fcdf4 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 _0xf7bd=['catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','include','model','map','CreateVoiceQueueReport','body','update','where','UpdateVoiceQueueReport','lodash','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3e0642,_0x5f4ef3){var _0x352cb5=function(_0x266c7b){while(--_0x266c7b){_0x3e0642['push'](_0x3e0642['shift']());}};_0x352cb5(++_0x5f4ef3);}(_0xf7bd,0xd3));var _0xdf7b=function(_0x1a7244,_0x3d99d9){_0x1a7244=_0x1a7244-0x0;var _0x5c4e9f=_0xf7bd[_0x1a7244];return _0x5c4e9f;};'use strict';var _=require(_0xdf7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdf7b('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdf7b('0x2'));var logger=require(_0xdf7b('0x3'))('rpc');var config=require(_0xdf7b('0x4'));var jayson=require(_0xdf7b('0x5'));var client=jayson[_0xdf7b('0x6')][_0xdf7b('0x7')]({'port':0x232a});config[_0xdf7b('0x8')]=_['defaults'](config['redis'],{'host':_0xdf7b('0x9'),'port':0x18eb});var socket=require(_0xdf7b('0xa'))(new Redis(config[_0xdf7b('0x8')]));require('./voiceQueueReport.socket')[_0xdf7b('0xb')](socket);function respondWithRpcPromise(_0x2215ec,_0x6d7211,_0x2b5415){return new BPromise(function(_0xf8e24d,_0x48a438){return client[_0xdf7b('0xc')](_0x2215ec,_0x2b5415)[_0xdf7b('0xd')](function(_0xeb577e){logger[_0xdf7b('0xe')](_0xdf7b('0xf'),_0x6d7211,_0xdf7b('0x10'));logger[_0xdf7b('0x11')](_0xdf7b('0x12'),_0x6d7211,_0xdf7b('0x10'),JSON[_0xdf7b('0x13')](_0xeb577e));if(_0xeb577e[_0xdf7b('0x14')]){if(_0xeb577e[_0xdf7b('0x14')]['code']===0x1f4){logger[_0xdf7b('0x14')](_0xdf7b('0xf'),_0x6d7211,_0xeb577e[_0xdf7b('0x14')][_0xdf7b('0x15')]);return _0x48a438(_0xeb577e[_0xdf7b('0x14')][_0xdf7b('0x15')]);}logger[_0xdf7b('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x6d7211,_0xeb577e[_0xdf7b('0x14')][_0xdf7b('0x15')]);return _0xf8e24d(_0xeb577e['error'][_0xdf7b('0x15')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x6d7211,_0xdf7b('0x10'));_0xf8e24d(_0xeb577e[_0xdf7b('0x16')]['message']);}})[_0xdf7b('0x17')](function(_0x2ba04a){logger[_0xdf7b('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x6d7211,_0x2ba04a);_0x48a438(_0x2ba04a);});});}exports[_0xdf7b('0x18')]=function(_0x138008){var _0x18457d=this;return new Promise(function(_0x467e42,_0x4e2806){return db[_0xdf7b('0x19')][_0xdf7b('0x1a')]({'raw':_0x138008[_0xdf7b('0x1b')]?_0x138008[_0xdf7b('0x1b')][_0xdf7b('0x1c')]===undefined?!![]:![]:!![],'where':_0x138008['options']?_0x138008[_0xdf7b('0x1b')]['where']||null:null,'attributes':_0x138008['options']?_0x138008[_0xdf7b('0x1b')][_0xdf7b('0x1d')]||null:null,'limit':_0x138008['options']?_0x138008[_0xdf7b('0x1b')][_0xdf7b('0x1e')]||null:null,'include':_0x138008[_0xdf7b('0x1b')]?_0x138008['options'][_0xdf7b('0x1f')]?_['map'](_0x138008['options']['include'],function(_0x375636){return{'model':db[_0x375636[_0xdf7b('0x20')]],'as':_0x375636['as'],'attributes':_0x375636['attributes'],'include':_0x375636[_0xdf7b('0x1f')]?_[_0xdf7b('0x21')](_0x375636[_0xdf7b('0x1f')],function(_0x5a054f){return{'model':db[_0x5a054f[_0xdf7b('0x20')]],'as':_0x5a054f['as'],'attributes':_0x5a054f[_0xdf7b('0x1d')],'include':_0x5a054f['include']?_[_0xdf7b('0x21')](_0x5a054f[_0xdf7b('0x1f')],function(_0x1cb140){return{'model':db[_0x1cb140['model']],'as':_0x1cb140['as'],'attributes':_0x1cb140[_0xdf7b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdf7b('0xd')](function(_0x22b6a7){logger[_0xdf7b('0xe')]('GetVoiceQueueReport',_0x138008);logger[_0xdf7b('0x11')](_0xdf7b('0x18'),_0x138008,JSON[_0xdf7b('0x13')](_0x22b6a7));_0x467e42(_0x22b6a7);})[_0xdf7b('0x17')](function(_0x2e2469){logger[_0xdf7b('0x14')](_0xdf7b('0x18'),_0x2e2469[_0xdf7b('0x15')],_0x138008);_0x4e2806(_0x18457d[_0xdf7b('0x14')](0x1f4,_0x2e2469[_0xdf7b('0x15')]));});});};exports[_0xdf7b('0x22')]=function(_0x840987){var _0x47e333=this;return new Promise(function(_0x4ea24c,_0x6bddbd){return db[_0xdf7b('0x19')]['create'](_0x840987[_0xdf7b('0x23')],{'raw':_0x840987[_0xdf7b('0x1b')]?_0x840987['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3a4d37){logger[_0xdf7b('0xe')](_0xdf7b('0x22'),_0x840987);logger[_0xdf7b('0x11')](_0xdf7b('0x22'),_0x840987,JSON['stringify'](_0x3a4d37));_0x4ea24c(_0x3a4d37);})[_0xdf7b('0x17')](function(_0x531fef){logger[_0xdf7b('0x14')](_0xdf7b('0x22'),_0x531fef[_0xdf7b('0x15')],_0x840987);_0x6bddbd(_0x47e333[_0xdf7b('0x14')](0x1f4,_0x531fef[_0xdf7b('0x15')]));});});};exports['UpdateVoiceQueueReport']=function(_0x5396b4){var _0x590a88=this;return new Promise(function(_0xdafe56,_0x7e0726){return db[_0xdf7b('0x19')][_0xdf7b('0x24')](_0x5396b4['body'],{'raw':_0x5396b4[_0xdf7b('0x1b')]?_0x5396b4[_0xdf7b('0x1b')][_0xdf7b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5396b4[_0xdf7b('0x1b')]?_0x5396b4['options'][_0xdf7b('0x25')]||null:null,'attributes':_0x5396b4[_0xdf7b('0x1b')]?_0x5396b4[_0xdf7b('0x1b')][_0xdf7b('0x1d')]||null:null,'limit':_0x5396b4[_0xdf7b('0x1b')]?_0x5396b4['options']['limit']||null:null})['then'](function(_0x44b870){logger[_0xdf7b('0xe')](_0xdf7b('0x26'),_0x5396b4);logger[_0xdf7b('0x11')](_0xdf7b('0x26'),_0x5396b4,JSON[_0xdf7b('0x13')](_0x44b870));_0xdafe56(_0x44b870);})[_0xdf7b('0x17')](function(_0x541237){logger['error'](_0xdf7b('0x26'),_0x541237[_0xdf7b('0x15')],_0x5396b4);_0x7e0726(_0x590a88[_0xdf7b('0x14')](0x1f4,_0x541237[_0xdf7b('0x15')]));});});}; \ No newline at end of file +var _0x1150=['http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','raw','options','where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','update','body','UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3d3a54,_0x24847c){var _0x360126=function(_0x40269d){while(--_0x40269d){_0x3d3a54['push'](_0x3d3a54['shift']());}};_0x360126(++_0x24847c);}(_0x1150,0x131));var _0x0115=function(_0x95675b,_0x88d868){_0x95675b=_0x95675b-0x0;var _0x2279e0=_0x1150[_0x95675b];return _0x2279e0;};'use strict';var _=require(_0x0115('0x0'));var util=require(_0x0115('0x1'));var moment=require(_0x0115('0x2'));var BPromise=require('bluebird');var rs=require(_0x0115('0x3'));var fs=require('fs');var Redis=require(_0x0115('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0115('0x5'));var logger=require(_0x0115('0x6'))(_0x0115('0x7'));var config=require('../../config/environment');var jayson=require(_0x0115('0x8'));var client=jayson[_0x0115('0x9')][_0x0115('0xa')]({'port':0x232a});config[_0x0115('0xb')]=_[_0x0115('0xc')](config[_0x0115('0xb')],{'host':_0x0115('0xd'),'port':0x18eb});var socket=require(_0x0115('0xe'))(new Redis(config[_0x0115('0xb')]));require(_0x0115('0xf'))[_0x0115('0x10')](socket);function respondWithRpcPromise(_0x51bccb,_0x5aa63c,_0x190d00){return new BPromise(function(_0x988851,_0x4d1f52){return client['request'](_0x51bccb,_0x190d00)[_0x0115('0x11')](function(_0x33a825){logger[_0x0115('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x5aa63c,_0x0115('0x13'));logger[_0x0115('0x14')](_0x0115('0x15'),_0x5aa63c,_0x0115('0x13'),JSON[_0x0115('0x16')](_0x33a825));if(_0x33a825[_0x0115('0x17')]){if(_0x33a825[_0x0115('0x17')][_0x0115('0x18')]===0x1f4){logger['error'](_0x0115('0x19'),_0x5aa63c,_0x33a825[_0x0115('0x17')][_0x0115('0x1a')]);return _0x4d1f52(_0x33a825['error'][_0x0115('0x1a')]);}logger[_0x0115('0x17')](_0x0115('0x19'),_0x5aa63c,_0x33a825[_0x0115('0x17')][_0x0115('0x1a')]);return _0x988851(_0x33a825['error'][_0x0115('0x1a')]);}else{logger[_0x0115('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x5aa63c,'request\x20sent');_0x988851(_0x33a825[_0x0115('0x1b')]['message']);}})[_0x0115('0x1c')](function(_0x1f74ae){logger['error'](_0x0115('0x19'),_0x5aa63c,_0x1f74ae);_0x4d1f52(_0x1f74ae);});});}exports[_0x0115('0x1d')]=function(_0x48d704){var _0x186a57=this;return new Promise(function(_0x1de872,_0x1b2b10){return db[_0x0115('0x1e')][_0x0115('0x1f')]({'raw':_0x48d704['options']?_0x48d704['options'][_0x0115('0x20')]===undefined?!![]:![]:!![],'where':_0x48d704[_0x0115('0x21')]?_0x48d704[_0x0115('0x21')][_0x0115('0x22')]||null:null,'attributes':_0x48d704['options']?_0x48d704[_0x0115('0x21')][_0x0115('0x23')]||null:null,'limit':_0x48d704[_0x0115('0x21')]?_0x48d704['options'][_0x0115('0x24')]||null:null,'include':_0x48d704[_0x0115('0x21')]?_0x48d704[_0x0115('0x21')][_0x0115('0x25')]?_[_0x0115('0x26')](_0x48d704[_0x0115('0x21')]['include'],function(_0x14d83c){return{'model':db[_0x14d83c['model']],'as':_0x14d83c['as'],'attributes':_0x14d83c[_0x0115('0x23')],'include':_0x14d83c[_0x0115('0x25')]?_[_0x0115('0x26')](_0x14d83c['include'],function(_0x422a61){return{'model':db[_0x422a61[_0x0115('0x27')]],'as':_0x422a61['as'],'attributes':_0x422a61[_0x0115('0x23')],'include':_0x422a61[_0x0115('0x25')]?_[_0x0115('0x26')](_0x422a61[_0x0115('0x25')],function(_0x343bd1){return{'model':db[_0x343bd1[_0x0115('0x27')]],'as':_0x343bd1['as'],'attributes':_0x343bd1[_0x0115('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9978de){logger[_0x0115('0x12')](_0x0115('0x1d'),_0x48d704);logger[_0x0115('0x14')](_0x0115('0x1d'),_0x48d704,JSON['stringify'](_0x9978de));_0x1de872(_0x9978de);})[_0x0115('0x1c')](function(_0x4bb88e){logger['error']('GetVoiceQueueReport',_0x4bb88e[_0x0115('0x1a')],_0x48d704);_0x1b2b10(_0x186a57[_0x0115('0x17')](0x1f4,_0x4bb88e[_0x0115('0x1a')]));});});};exports[_0x0115('0x28')]=function(_0x28233d){var _0x56882e=this;return new Promise(function(_0x4e5f42,_0x557a9b){return db[_0x0115('0x1e')][_0x0115('0x29')](_0x28233d['body'],{'raw':_0x28233d[_0x0115('0x21')]?_0x28233d[_0x0115('0x21')][_0x0115('0x20')]===undefined?!![]:![]:!![]})[_0x0115('0x11')](function(_0x5780ba){logger[_0x0115('0x12')](_0x0115('0x28'),_0x28233d);logger[_0x0115('0x14')](_0x0115('0x28'),_0x28233d,JSON['stringify'](_0x5780ba));_0x4e5f42(_0x5780ba);})[_0x0115('0x1c')](function(_0x1cb814){logger['error']('CreateVoiceQueueReport',_0x1cb814[_0x0115('0x1a')],_0x28233d);_0x557a9b(_0x56882e[_0x0115('0x17')](0x1f4,_0x1cb814[_0x0115('0x1a')]));});});};exports['UpdateVoiceQueueReport']=function(_0x535bfa){var _0x825ee5=this;return new Promise(function(_0xe04544,_0x485699){return db[_0x0115('0x1e')][_0x0115('0x2a')](_0x535bfa[_0x0115('0x2b')],{'raw':_0x535bfa[_0x0115('0x21')]?_0x535bfa[_0x0115('0x21')][_0x0115('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x535bfa[_0x0115('0x21')]?_0x535bfa[_0x0115('0x21')]['where']||null:null,'attributes':_0x535bfa[_0x0115('0x21')]?_0x535bfa['options'][_0x0115('0x23')]||null:null,'limit':_0x535bfa[_0x0115('0x21')]?_0x535bfa[_0x0115('0x21')][_0x0115('0x24')]||null:null})[_0x0115('0x11')](function(_0x1b575d){logger[_0x0115('0x12')]('UpdateVoiceQueueReport',_0x535bfa);logger['debug'](_0x0115('0x2c'),_0x535bfa,JSON[_0x0115('0x16')](_0x1b575d));_0xe04544(_0x1b575d);})[_0x0115('0x1c')](function(_0x19fd14){logger['error'](_0x0115('0x2c'),_0x19fd14[_0x0115('0x1a')],_0x535bfa);_0x485699(_0x825ee5[_0x0115('0x17')](0x1f4,_0x19fd14['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index b25d758..5a58ccc 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 _0x3248=['save','emit','register','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3248,0x1bc));var _0x8324=function(_0x3130ba,_0x49bb59){_0x3130ba=_0x3130ba-0x0;var _0x23bd10=_0x3248[_0x3130ba];return _0x23bd10;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x8324('0x0'),'remove','update'];function createListener(_0x1daa25,_0xf7c3f5){return function(_0x257d13){_0xf7c3f5[_0x8324('0x1')](_0x1daa25,_0x257d13);};}function removeListener(_0x2cfce9,_0x334505){return function(){VoiceQueueReportEvents['removeListener'](_0x2cfce9,_0x334505);};}exports[_0x8324('0x2')]=function(_0x1c5c2a){for(var _0x5157f4=0x0,_0x25ee7a=events[_0x8324('0x3')];_0x5157f4<_0x25ee7a;_0x5157f4++){var _0x4302c5=events[_0x5157f4];var _0x1514c0=createListener('voiceQueueReport:'+_0x4302c5,_0x1c5c2a);VoiceQueueReportEvents['on'](_0x4302c5,_0x1514c0);}}; \ No newline at end of file +var _0xc15b=['update','removeListener','length','./voiceQueueReport.events','remove'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0xc15b,0xe4));var _0xbc15=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xc15b[_0x15c421];return _0x5e5ed5;};'use strict';var VoiceQueueReportEvents=require(_0xbc15('0x0'));var events=['save',_0xbc15('0x1'),_0xbc15('0x2')];function createListener(_0x3365d4,_0xdb6b6e){return function(_0x4ebf9d){_0xdb6b6e['emit'](_0x3365d4,_0x4ebf9d);};}function removeListener(_0x31884e,_0x44f7ca){return function(){VoiceQueueReportEvents[_0xbc15('0x3')](_0x31884e,_0x44f7ca);};}exports['register']=function(_0x55885f){for(var _0x54f394=0x0,_0x1231f0=events[_0xbc15('0x4')];_0x54f394<_0x1231f0;_0x54f394++){var _0x3cb4b5=events[_0x54f394];var _0x50a276=createListener('voiceQueueReport:'+_0x3cb4b5,_0x55885f);VoiceQueueReportEvents['on'](_0x3cb4b5,_0x50a276);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index bfff388..e8c93da 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 _0x0e37=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','post','create','put','/:id','update','delete','exports','util','connect-timeout','express'];(function(_0x2dd0e9,_0x25b523){var _0x106ca4=function(_0x32cd67){while(--_0x32cd67){_0x2dd0e9['push'](_0x2dd0e9['shift']());}};_0x106ca4(++_0x25b523);}(_0x0e37,0xc9));var _0x70e3=function(_0x5a6dc0,_0x2948b0){_0x5a6dc0=_0x5a6dc0-0x0;var _0x141cda=_0x0e37[_0x5a6dc0];return _0x141cda;};'use strict';var multer=require('multer');var util=require(_0x70e3('0x0'));var path=require('path');var timeout=require(_0x70e3('0x1'));var express=require(_0x70e3('0x2'));var router=express[_0x70e3('0x3')]();var fs_extra=require(_0x70e3('0x4'));var auth=require(_0x70e3('0x5'));var interaction=require(_0x70e3('0x6'));var config=require(_0x70e3('0x7'));var controller=require(_0x70e3('0x8'));router['get']('/',auth[_0x70e3('0x9')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x70e3('0xa')]('/',auth['isAuthenticated'](),controller[_0x70e3('0xb')]);router[_0x70e3('0xc')](_0x70e3('0xd'),auth[_0x70e3('0x9')](),controller[_0x70e3('0xe')]);router[_0x70e3('0xf')](_0x70e3('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x70e3('0x10')]=router; \ No newline at end of file +var _0x9d92=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','post','create','delete','exports','multer','connect-timeout'];(function(_0x188cc8,_0xd39746){var _0x4cb155=function(_0x2d2a6c){while(--_0x2d2a6c){_0x188cc8['push'](_0x188cc8['shift']());}};_0x4cb155(++_0xd39746);}(_0x9d92,0xdf));var _0x29d9=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x9d92[_0x386c3e];return _0x4b8e13;};'use strict';var multer=require(_0x29d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x29d9('0x1'));var express=require(_0x29d9('0x2'));var router=express['Router']();var fs_extra=require(_0x29d9('0x3'));var auth=require(_0x29d9('0x4'));var interaction=require(_0x29d9('0x5'));var config=require(_0x29d9('0x6'));var controller=require(_0x29d9('0x7'));router[_0x29d9('0x8')]('/',auth[_0x29d9('0x9')](),controller['index']);router[_0x29d9('0x8')](_0x29d9('0xa'),auth[_0x29d9('0x9')](),controller['show']);router[_0x29d9('0xb')]('/',auth[_0x29d9('0x9')](),controller[_0x29d9('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x29d9('0xd')](_0x29d9('0xa'),auth[_0x29d9('0x9')](),controller['destroy']);module[_0x29d9('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index b72838b..302133e 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 _0x84cb=['STRING','DATE','literal','sequelize','moment','exports'];(function(_0x4a1552,_0x38a1eb){var _0x3f2f13=function(_0x313037){while(--_0x313037){_0x4a1552['push'](_0x4a1552['shift']());}};_0x3f2f13(++_0x38a1eb);}(_0x84cb,0x1bf));var _0xb84c=function(_0x3277ff,_0x4407f4){_0x3277ff=_0x3277ff-0x0;var _0x36d6d3=_0x84cb[_0x3277ff];return _0x36d6d3;};'use strict';var Sequelize=require(_0xb84c('0x0'));var moment=require(_0xb84c('0x1'));module[_0xb84c('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xb84c('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb84c('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xb84c('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xb84c('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xb84c('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xb84c('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xb84c('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xb84c('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb84c('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xb84c('0x5')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x3e22=['moment','exports','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0xc9671e,_0x5ae235){var _0x54957a=function(_0x17b799){while(--_0x17b799){_0xc9671e['push'](_0xc9671e['shift']());}};_0x54957a(++_0x5ae235);}(_0x3e22,0x168));var _0x23e2=function(_0x43a5cd,_0x1bf484){_0x43a5cd=_0x43a5cd-0x0;var _0x10d186=_0x3e22[_0x43a5cd];return _0x10d186;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x23e2('0x0'));module[_0x23e2('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x23e2('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x23e2('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x23e2('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x23e2('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x23e2('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x23e2('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x23e2('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x23e2('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x23e2('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x23e2('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x23e2('0x4')](_0x23e2('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index b269baf..938da0d 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 _0xc474=['catch','show','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x3c5ee9,_0xb251bd){var _0x149349=function(_0x594eba){while(--_0x594eba){_0x3c5ee9['push'](_0x3c5ee9['shift']());}};_0x149349(++_0xb251bd);}(_0xc474,0x9e));var _0x4c47=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc474[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x4c47('0x0'));var rimraf=require(_0x4c47('0x1'));var zipdir=require(_0x4c47('0x2'));var jsonpatch=require(_0x4c47('0x3'));var rp=require(_0x4c47('0x4'));var moment=require(_0x4c47('0x5'));var BPromise=require(_0x4c47('0x6'));var Mustache=require(_0x4c47('0x7'));var util=require(_0x4c47('0x8'));var path=require(_0x4c47('0x9'));var sox=require(_0x4c47('0xa'));var csv=require(_0x4c47('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c47('0xc'));var _=require('lodash');var squel=require(_0x4c47('0xd'));var crypto=require(_0x4c47('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4c47('0xf'));var toCsv=require(_0x4c47('0xb'));var querystring=require('querystring');var Papa=require(_0x4c47('0x10'));var Redis=require(_0x4c47('0x11'));var authService=require(_0x4c47('0x12'));var qs=require(_0x4c47('0x13'));var as=require(_0x4c47('0x14'));var hardwareService=require(_0x4c47('0x15'));var logger=require('../../config/logger')(_0x4c47('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4c47('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3654fb,_0xeda9c2){_0xeda9c2=_0xeda9c2||0xcc;return function(_0x2b63dc){if(_0x2b63dc){return _0x3654fb[_0x4c47('0x18')](_0xeda9c2);}return _0x3654fb[_0x4c47('0x19')](_0xeda9c2)[_0x4c47('0x1a')]();};}function respondWithResult(_0xeb5325,_0x4703f8){_0x4703f8=_0x4703f8||0xc8;return function(_0x3867df){if(_0x3867df){return _0xeb5325[_0x4c47('0x19')](_0x4703f8)[_0x4c47('0x1b')](_0x3867df);}};}function respondWithFilteredResult(_0x59a39a,_0x39afa1){return function(_0x11852a){if(_0x11852a){var _0x493a84=typeof _0x39afa1['offset']===_0x4c47('0x1c')&&typeof _0x39afa1[_0x4c47('0x1d')]===_0x4c47('0x1c');var _0xd461bc=_0x11852a[_0x4c47('0x1e')];var _0x32148e=_0x493a84?0x0:_0x39afa1[_0x4c47('0x1f')];var _0x26a46c=_0x493a84?_0x11852a['count']:_0x39afa1['offset']+_0x39afa1[_0x4c47('0x1d')];var _0x521aa4;if(_0x26a46c>=_0xd461bc){_0x26a46c=_0xd461bc;_0x521aa4=0xc8;}else{_0x521aa4=0xce;}_0x59a39a[_0x4c47('0x19')](_0x521aa4);return _0x59a39a[_0x4c47('0x20')](_0x4c47('0x21'),_0x32148e+'-'+_0x26a46c+'/'+_0xd461bc)['json'](_0x11852a);}return null;};}function patchUpdates(_0x291869){return function(_0x57cf13){try{jsonpatch[_0x4c47('0x22')](_0x57cf13,_0x291869,!![]);}catch(_0x510666){return BPromise[_0x4c47('0x23')](_0x510666);}return _0x57cf13['save']();};}function saveUpdates(_0x560049,_0x422ee3){return function(_0x444513){if(_0x444513){return _0x444513[_0x4c47('0x24')](_0x560049)['then'](function(_0x178ba3){return _0x178ba3;});}return null;};}function removeEntity(_0x5551e4,_0x3d1561){return function(_0x23588f){if(_0x23588f){return _0x23588f[_0x4c47('0x25')]()[_0x4c47('0x26')](function(){_0x5551e4[_0x4c47('0x19')](0xcc)[_0x4c47('0x1a')]();});}};}function handleEntityNotFound(_0x42c286,_0x236d67){return function(_0x197d94){if(!_0x197d94){_0x42c286[_0x4c47('0x18')](0x194);}return _0x197d94;};}function handleError(_0x1594a0,_0x50f357){_0x50f357=_0x50f357||0x1f4;return function(_0x2a560b){logger[_0x4c47('0x27')](_0x2a560b[_0x4c47('0x28')]);if(_0x2a560b[_0x4c47('0x29')]){delete _0x2a560b[_0x4c47('0x29')];}_0x1594a0[_0x4c47('0x19')](_0x50f357)[_0x4c47('0x2a')](_0x2a560b);};}exports[_0x4c47('0x2b')]=function(_0x26290c,_0x18998d){var _0x4b4d8b={},_0x46da66={},_0x13b62e={'count':0x0,'rows':[]};var _0x399219=_['map'](db[_0x4c47('0x2c')][_0x4c47('0x2d')],function(_0x3c1a0c){return{'name':_0x3c1a0c[_0x4c47('0x2e')],'type':_0x3c1a0c['type']['key']};});_0x46da66['model']=_['map'](_0x399219,_0x4c47('0x29'));_0x46da66[_0x4c47('0x2f')]=_[_0x4c47('0x30')](_0x26290c[_0x4c47('0x2f')]);_0x46da66[_0x4c47('0x31')]=_[_0x4c47('0x32')](_0x46da66[_0x4c47('0x33')],_0x46da66[_0x4c47('0x2f')]);_0x4b4d8b[_0x4c47('0x34')]=_[_0x4c47('0x32')](_0x46da66[_0x4c47('0x33')],qs[_0x4c47('0x35')](_0x26290c['query'][_0x4c47('0x35')]));_0x4b4d8b[_0x4c47('0x34')]=_0x4b4d8b[_0x4c47('0x34')][_0x4c47('0x36')]?_0x4b4d8b[_0x4c47('0x34')]:_0x46da66[_0x4c47('0x33')];if(!_0x26290c['query'][_0x4c47('0x37')]('nolimit')){_0x4b4d8b[_0x4c47('0x1d')]=qs['limit'](_0x26290c[_0x4c47('0x2f')][_0x4c47('0x1d')]);_0x4b4d8b['offset']=qs[_0x4c47('0x1f')](_0x26290c[_0x4c47('0x2f')][_0x4c47('0x1f')]);}_0x4b4d8b[_0x4c47('0x38')]=qs[_0x4c47('0x39')](_0x26290c[_0x4c47('0x2f')][_0x4c47('0x39')]);_0x4b4d8b[_0x4c47('0x3a')]=qs[_0x4c47('0x31')](_[_0x4c47('0x3b')](_0x26290c['query'],_0x46da66[_0x4c47('0x31')]),_0x399219);if(_0x26290c[_0x4c47('0x2f')][_0x4c47('0x3c')]){_0x4b4d8b['where']=_[_0x4c47('0x3d')](_0x4b4d8b['where'],{'$or':_[_0x4c47('0x3e')](_0x399219,function(_0x43b84a){if(_0x43b84a[_0x4c47('0x3f')]!==_0x4c47('0x40')){var _0x56a6a3={};_0x56a6a3[_0x43b84a[_0x4c47('0x29')]]={'$like':'%'+_0x26290c['query'][_0x4c47('0x3c')]+'%'};return _0x56a6a3;}})});}_0x4b4d8b=_[_0x4c47('0x3d')]({},_0x4b4d8b,_0x26290c[_0x4c47('0x41')]);var _0x2586b7={'where':_0x4b4d8b[_0x4c47('0x3a')]};return db['VoiceQueuesLog'][_0x4c47('0x1e')](_0x2586b7)['then'](function(_0x4ebe53){_0x13b62e[_0x4c47('0x1e')]=_0x4ebe53;if(_0x26290c[_0x4c47('0x2f')][_0x4c47('0x42')]){_0x4b4d8b[_0x4c47('0x43')]=[{'all':!![]}];}return db[_0x4c47('0x2c')][_0x4c47('0x44')](_0x4b4d8b);})[_0x4c47('0x26')](function(_0x4f4a8e){_0x13b62e[_0x4c47('0x45')]=_0x4f4a8e;return _0x13b62e;})[_0x4c47('0x26')](respondWithFilteredResult(_0x18998d,_0x4b4d8b))[_0x4c47('0x46')](handleError(_0x18998d,null));};exports[_0x4c47('0x47')]=function(_0x391ead,_0x2452ab){var _0x3789b2={'raw':!![],'where':{'id':_0x391ead['params']['id']}},_0x20ba09={};_0x20ba09[_0x4c47('0x33')]=_[_0x4c47('0x30')](db[_0x4c47('0x2c')]['rawAttributes']);_0x20ba09[_0x4c47('0x2f')]=_['keys'](_0x391ead[_0x4c47('0x2f')]);_0x20ba09[_0x4c47('0x31')]=_['intersection'](_0x20ba09[_0x4c47('0x33')],_0x20ba09[_0x4c47('0x2f')]);_0x3789b2[_0x4c47('0x34')]=_['intersection'](_0x20ba09[_0x4c47('0x33')],qs[_0x4c47('0x35')](_0x391ead[_0x4c47('0x2f')][_0x4c47('0x35')]));_0x3789b2['attributes']=_0x3789b2[_0x4c47('0x34')][_0x4c47('0x36')]?_0x3789b2[_0x4c47('0x34')]:_0x20ba09[_0x4c47('0x33')];if(_0x391ead[_0x4c47('0x2f')][_0x4c47('0x42')]){_0x3789b2['include']=[{'all':!![]}];}_0x3789b2=_['merge']({},_0x3789b2,_0x391ead[_0x4c47('0x41')]);return db[_0x4c47('0x2c')]['find'](_0x3789b2)['then'](handleEntityNotFound(_0x2452ab,null))[_0x4c47('0x26')](respondWithResult(_0x2452ab,null))[_0x4c47('0x46')](handleError(_0x2452ab,null));};exports[_0x4c47('0x48')]=function(_0x4e61be,_0x1d2b95){return db[_0x4c47('0x2c')][_0x4c47('0x48')](_0x4e61be[_0x4c47('0x49')],{})['then'](respondWithResult(_0x1d2b95,0xc9))['catch'](handleError(_0x1d2b95,null));};exports['update']=function(_0x5b0404,_0x78f8b2){if(_0x5b0404['body']['id']){delete _0x5b0404[_0x4c47('0x49')]['id'];}return db[_0x4c47('0x2c')][_0x4c47('0x4a')]({'where':{'id':_0x5b0404[_0x4c47('0x4b')]['id']}})['then'](handleEntityNotFound(_0x78f8b2,null))[_0x4c47('0x26')](saveUpdates(_0x5b0404[_0x4c47('0x49')],null))['then'](respondWithResult(_0x78f8b2,null))[_0x4c47('0x46')](handleError(_0x78f8b2,null));};exports['destroy']=function(_0x126ff4,_0x155820){return db['VoiceQueuesLog'][_0x4c47('0x4a')]({'where':{'id':_0x126ff4[_0x4c47('0x4b')]['id']}})[_0x4c47('0x26')](handleEntityNotFound(_0x155820,null))['then'](removeEntity(_0x155820,null))[_0x4c47('0x46')](handleError(_0x155820,null));}; \ No newline at end of file +var _0x62aa=['rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','stack','name','index','map','VoiceQueuesLog'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0x62aa,0x1cf));var _0xa62a=function(_0x5304ce,_0x48455a){_0x5304ce=_0x5304ce-0x0;var _0x31a8c1=_0x62aa[_0x5304ce];return _0x31a8c1;};'use strict';var emlformat=require(_0xa62a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa62a('0x1'));var jsonpatch=require(_0xa62a('0x2'));var rp=require(_0xa62a('0x3'));var moment=require('moment');var BPromise=require(_0xa62a('0x4'));var Mustache=require('mustache');var util=require(_0xa62a('0x5'));var path=require(_0xa62a('0x6'));var sox=require(_0xa62a('0x7'));var csv=require(_0xa62a('0x8'));var ejs=require(_0xa62a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa62a('0xa'));var squel=require(_0xa62a('0xb'));var crypto=require('crypto');var jsforce=require(_0xa62a('0xc'));var deskjs=require(_0xa62a('0xd'));var toCsv=require(_0xa62a('0x8'));var querystring=require('querystring');var Papa=require(_0xa62a('0xe'));var Redis=require(_0xa62a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa62a('0x10'));var as=require(_0xa62a('0x11'));var hardwareService=require(_0xa62a('0x12'));var logger=require(_0xa62a('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa62a('0x14'));var licenseUtil=require(_0xa62a('0x15'));var db=require(_0xa62a('0x16'))['db'];function respondWithStatusCode(_0x38bcce,_0xf676ca){_0xf676ca=_0xf676ca||0xcc;return function(_0x30bd0b){if(_0x30bd0b){return _0x38bcce[_0xa62a('0x17')](_0xf676ca);}return _0x38bcce[_0xa62a('0x18')](_0xf676ca)[_0xa62a('0x19')]();};}function respondWithResult(_0x5999a9,_0xc60d1a){_0xc60d1a=_0xc60d1a||0xc8;return function(_0x1b2a66){if(_0x1b2a66){return _0x5999a9['status'](_0xc60d1a)[_0xa62a('0x1a')](_0x1b2a66);}};}function respondWithFilteredResult(_0x20a42f,_0x3bdb81){return function(_0x535b07){if(_0x535b07){var _0x5821b2=typeof _0x3bdb81[_0xa62a('0x1b')]===_0xa62a('0x1c')&&typeof _0x3bdb81[_0xa62a('0x1d')]===_0xa62a('0x1c');var _0x2b4252=_0x535b07[_0xa62a('0x1e')];var _0x3310bd=_0x5821b2?0x0:_0x3bdb81[_0xa62a('0x1b')];var _0x31701b=_0x5821b2?_0x535b07[_0xa62a('0x1e')]:_0x3bdb81[_0xa62a('0x1b')]+_0x3bdb81['limit'];var _0x5d959d;if(_0x31701b>=_0x2b4252){_0x31701b=_0x2b4252;_0x5d959d=0xc8;}else{_0x5d959d=0xce;}_0x20a42f['status'](_0x5d959d);return _0x20a42f['set'](_0xa62a('0x1f'),_0x3310bd+'-'+_0x31701b+'/'+_0x2b4252)['json'](_0x535b07);}return null;};}function patchUpdates(_0x19287a){return function(_0x47c78a){try{jsonpatch[_0xa62a('0x20')](_0x47c78a,_0x19287a,!![]);}catch(_0x281b1f){return BPromise[_0xa62a('0x21')](_0x281b1f);}return _0x47c78a['save']();};}function saveUpdates(_0x55d76c,_0x4c8874){return function(_0x2d4400){if(_0x2d4400){return _0x2d4400[_0xa62a('0x22')](_0x55d76c)[_0xa62a('0x23')](function(_0x447c9d){return _0x447c9d;});}return null;};}function removeEntity(_0x4e804f,_0x1dfef8){return function(_0x166877){if(_0x166877){return _0x166877['destroy']()[_0xa62a('0x23')](function(){_0x4e804f[_0xa62a('0x18')](0xcc)[_0xa62a('0x19')]();});}};}function handleEntityNotFound(_0x552b67,_0x315479){return function(_0x19b554){if(!_0x19b554){_0x552b67['sendStatus'](0x194);}return _0x19b554;};}function handleError(_0x3a94de,_0xe1a229){_0xe1a229=_0xe1a229||0x1f4;return function(_0x39248c){logger['error'](_0x39248c[_0xa62a('0x24')]);if(_0x39248c[_0xa62a('0x25')]){delete _0x39248c[_0xa62a('0x25')];}_0x3a94de['status'](_0xe1a229)['send'](_0x39248c);};}exports[_0xa62a('0x26')]=function(_0x13d4fb,_0x2e89f1){var _0x52bb9a={},_0x51e252={},_0x13bf97={'count':0x0,'rows':[]};var _0x2a8cce=_[_0xa62a('0x27')](db[_0xa62a('0x28')][_0xa62a('0x29')],function(_0x25da70){return{'name':_0x25da70[_0xa62a('0x2a')],'type':_0x25da70['type'][_0xa62a('0x2b')]};});_0x51e252[_0xa62a('0x2c')]=_[_0xa62a('0x27')](_0x2a8cce,'name');_0x51e252[_0xa62a('0x2d')]=_[_0xa62a('0x2e')](_0x13d4fb[_0xa62a('0x2d')]);_0x51e252[_0xa62a('0x2f')]=_['intersection'](_0x51e252[_0xa62a('0x2c')],_0x51e252[_0xa62a('0x2d')]);_0x52bb9a[_0xa62a('0x30')]=_[_0xa62a('0x31')](_0x51e252[_0xa62a('0x2c')],qs[_0xa62a('0x32')](_0x13d4fb[_0xa62a('0x2d')][_0xa62a('0x32')]));_0x52bb9a[_0xa62a('0x30')]=_0x52bb9a[_0xa62a('0x30')][_0xa62a('0x33')]?_0x52bb9a['attributes']:_0x51e252[_0xa62a('0x2c')];if(!_0x13d4fb[_0xa62a('0x2d')][_0xa62a('0x34')](_0xa62a('0x35'))){_0x52bb9a[_0xa62a('0x1d')]=qs[_0xa62a('0x1d')](_0x13d4fb[_0xa62a('0x2d')][_0xa62a('0x1d')]);_0x52bb9a[_0xa62a('0x1b')]=qs['offset'](_0x13d4fb[_0xa62a('0x2d')]['offset']);}_0x52bb9a[_0xa62a('0x36')]=qs[_0xa62a('0x37')](_0x13d4fb[_0xa62a('0x2d')][_0xa62a('0x37')]);_0x52bb9a[_0xa62a('0x38')]=qs[_0xa62a('0x2f')](_[_0xa62a('0x39')](_0x13d4fb[_0xa62a('0x2d')],_0x51e252[_0xa62a('0x2f')]),_0x2a8cce);if(_0x13d4fb[_0xa62a('0x2d')][_0xa62a('0x3a')]){_0x52bb9a['where']=_['merge'](_0x52bb9a[_0xa62a('0x38')],{'$or':_[_0xa62a('0x27')](_0x2a8cce,function(_0x4d6e0c){if(_0x4d6e0c['type']!==_0xa62a('0x3b')){var _0x516057={};_0x516057[_0x4d6e0c['name']]={'$like':'%'+_0x13d4fb[_0xa62a('0x2d')][_0xa62a('0x3a')]+'%'};return _0x516057;}})});}_0x52bb9a=_[_0xa62a('0x3c')]({},_0x52bb9a,_0x13d4fb[_0xa62a('0x3d')]);var _0x6ca592={'where':_0x52bb9a[_0xa62a('0x38')]};return db[_0xa62a('0x28')][_0xa62a('0x1e')](_0x6ca592)[_0xa62a('0x23')](function(_0x5f3b3a){_0x13bf97[_0xa62a('0x1e')]=_0x5f3b3a;if(_0x13d4fb[_0xa62a('0x2d')][_0xa62a('0x3e')]){_0x52bb9a[_0xa62a('0x3f')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xa62a('0x40')](_0x52bb9a);})['then'](function(_0x498f0d){_0x13bf97[_0xa62a('0x41')]=_0x498f0d;return _0x13bf97;})['then'](respondWithFilteredResult(_0x2e89f1,_0x52bb9a))[_0xa62a('0x42')](handleError(_0x2e89f1,null));};exports[_0xa62a('0x43')]=function(_0x5ad179,_0x394841){var _0x31f22a={'raw':!![],'where':{'id':_0x5ad179['params']['id']}},_0x26ae3e={};_0x26ae3e['model']=_[_0xa62a('0x2e')](db[_0xa62a('0x28')][_0xa62a('0x29')]);_0x26ae3e[_0xa62a('0x2d')]=_[_0xa62a('0x2e')](_0x5ad179[_0xa62a('0x2d')]);_0x26ae3e[_0xa62a('0x2f')]=_['intersection'](_0x26ae3e[_0xa62a('0x2c')],_0x26ae3e[_0xa62a('0x2d')]);_0x31f22a[_0xa62a('0x30')]=_[_0xa62a('0x31')](_0x26ae3e[_0xa62a('0x2c')],qs['fields'](_0x5ad179['query'][_0xa62a('0x32')]));_0x31f22a[_0xa62a('0x30')]=_0x31f22a[_0xa62a('0x30')][_0xa62a('0x33')]?_0x31f22a[_0xa62a('0x30')]:_0x26ae3e[_0xa62a('0x2c')];if(_0x5ad179[_0xa62a('0x2d')][_0xa62a('0x3e')]){_0x31f22a['include']=[{'all':!![]}];}_0x31f22a=_['merge']({},_0x31f22a,_0x5ad179[_0xa62a('0x3d')]);return db['VoiceQueuesLog']['find'](_0x31f22a)[_0xa62a('0x23')](handleEntityNotFound(_0x394841,null))[_0xa62a('0x23')](respondWithResult(_0x394841,null))[_0xa62a('0x42')](handleError(_0x394841,null));};exports[_0xa62a('0x44')]=function(_0x54fcf5,_0x280dbd){return db[_0xa62a('0x28')][_0xa62a('0x44')](_0x54fcf5[_0xa62a('0x45')],{})[_0xa62a('0x23')](respondWithResult(_0x280dbd,0xc9))[_0xa62a('0x42')](handleError(_0x280dbd,null));};exports['update']=function(_0x195c9e,_0x59c951){if(_0x195c9e[_0xa62a('0x45')]['id']){delete _0x195c9e[_0xa62a('0x45')]['id'];}return db[_0xa62a('0x28')][_0xa62a('0x46')]({'where':{'id':_0x195c9e['params']['id']}})[_0xa62a('0x23')](handleEntityNotFound(_0x59c951,null))[_0xa62a('0x23')](saveUpdates(_0x195c9e[_0xa62a('0x45')],null))[_0xa62a('0x23')](respondWithResult(_0x59c951,null))[_0xa62a('0x42')](handleError(_0x59c951,null));};exports['destroy']=function(_0x38dd6d,_0x1ca635){return db['VoiceQueuesLog'][_0xa62a('0x46')]({'where':{'id':_0x38dd6d[_0xa62a('0x47')]['id']}})[_0xa62a('0x23')](handleEntityNotFound(_0x1ca635,null))[_0xa62a('0x23')](removeEntity(_0x1ca635,null))['catch'](handleError(_0x1ca635,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index dfee790..9a03b3d 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 _0x19cc=['../../config/logger','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x19cc,0x10c));var _0xc19c=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0x19cc[_0x16938f];return _0x5c66e9;};'use strict';var _=require(_0xc19c('0x0'));var util=require(_0xc19c('0x1'));var logger=require(_0xc19c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc19c('0x3'));var fs=require('fs');var path=require(_0xc19c('0x4'));var rimraf=require(_0xc19c('0x5'));var config=require(_0xc19c('0x6'));var attributes=require(_0xc19c('0x7'));module[_0xc19c('0x8')]=function(_0x219437,_0xf3b6db){return _0x219437[_0xc19c('0x9')](_0xc19c('0xa'),attributes,{'tableName':_0xc19c('0xb'),'paranoid':![],'indexes':[{'name':_0xc19c('0xc'),'fields':[_0xc19c('0xd'),_0xc19c('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x0214=['dtm','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','VoiceQueuesLog','event_dtm','event'];(function(_0x1cec47,_0x544ca3){var _0x44ba2e=function(_0xa4d126){while(--_0xa4d126){_0x1cec47['push'](_0x1cec47['shift']());}};_0x44ba2e(++_0x544ca3);}(_0x0214,0x15f));var _0x4021=function(_0x30b145,_0x5b1406){_0x30b145=_0x30b145-0x0;var _0x5acce4=_0x0214[_0x30b145];return _0x5acce4;};'use strict';var _=require(_0x4021('0x0'));var util=require(_0x4021('0x1'));var logger=require(_0x4021('0x2'))(_0x4021('0x3'));var moment=require(_0x4021('0x4'));var BPromise=require(_0x4021('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4021('0x6'));var rimraf=require(_0x4021('0x7'));var config=require(_0x4021('0x8'));var attributes=require(_0x4021('0x9'));module['exports']=function(_0x48996c,_0x352f4e){return _0x48996c['define'](_0x4021('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x4021('0xb'),'fields':[_0x4021('0xc'),_0x4021('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 8e5b7cf..730140d 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 _0xd167=['stringify','error','VoiceQueuesLog,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd167,0xc3));var _0x7d16=function(_0x517975,_0x1454b9){_0x517975=_0x517975-0x0;var _0x2108c9=_0xd167[_0x517975];return _0x2108c9;};'use strict';var _=require(_0x7d16('0x0'));var util=require(_0x7d16('0x1'));var moment=require('moment');var BPromise=require(_0x7d16('0x2'));var rs=require(_0x7d16('0x3'));var fs=require('fs');var Redis=require(_0x7d16('0x4'));var db=require(_0x7d16('0x5'))['db'];var utils=require(_0x7d16('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x7d16('0x7'));var jayson=require(_0x7d16('0x8'));var client=jayson[_0x7d16('0x9')][_0x7d16('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x93df31,_0x17e6b3,_0x5cdcd4){return new BPromise(function(_0x1d1d2e,_0x5402c3){return client['request'](_0x93df31,_0x5cdcd4)['then'](function(_0x3ae69b){logger[_0x7d16('0xb')]('VoiceQueuesLog,\x20%s,\x20%s',_0x17e6b3,_0x7d16('0xc'));logger[_0x7d16('0xd')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x17e6b3,_0x7d16('0xc'),JSON[_0x7d16('0xe')](_0x3ae69b));if(_0x3ae69b['error']){if(_0x3ae69b['error']['code']===0x1f4){logger[_0x7d16('0xf')](_0x7d16('0x10'),_0x17e6b3,_0x3ae69b[_0x7d16('0xf')][_0x7d16('0x11')]);return _0x5402c3(_0x3ae69b[_0x7d16('0xf')][_0x7d16('0x11')]);}logger[_0x7d16('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x17e6b3,_0x3ae69b[_0x7d16('0xf')]['message']);return _0x1d1d2e(_0x3ae69b[_0x7d16('0xf')]['message']);}else{logger[_0x7d16('0xb')](_0x7d16('0x10'),_0x17e6b3,_0x7d16('0xc'));_0x1d1d2e(_0x3ae69b[_0x7d16('0x12')][_0x7d16('0x11')]);}})['catch'](function(_0x4d6971){logger[_0x7d16('0xf')](_0x7d16('0x10'),_0x17e6b3,_0x4d6971);_0x5402c3(_0x4d6971);});});} \ No newline at end of file +var _0x46b9=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x46b9,0x199));var _0x946b=function(_0x3b3810,_0x16ee8c){_0x3b3810=_0x3b3810-0x0;var _0x2830b9=_0x46b9[_0x3b3810];return _0x2830b9;};'use strict';var _=require(_0x946b('0x0'));var util=require('util');var moment=require(_0x946b('0x1'));var BPromise=require(_0x946b('0x2'));var rs=require(_0x946b('0x3'));var fs=require('fs');var Redis=require(_0x946b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x946b('0x5'));var logger=require(_0x946b('0x6'))(_0x946b('0x7'));var config=require(_0x946b('0x8'));var jayson=require(_0x946b('0x9'));var client=jayson[_0x946b('0xa')][_0x946b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23cec8,_0xfded5d,_0x24a92e){return new BPromise(function(_0x4d2f0d,_0x572ea3){return client[_0x946b('0xc')](_0x23cec8,_0x24a92e)[_0x946b('0xd')](function(_0x3fc05a){logger[_0x946b('0xe')](_0x946b('0xf'),_0xfded5d,'request\x20sent');logger[_0x946b('0x10')](_0x946b('0x11'),_0xfded5d,_0x946b('0x12'),JSON[_0x946b('0x13')](_0x3fc05a));if(_0x3fc05a[_0x946b('0x14')]){if(_0x3fc05a[_0x946b('0x14')]['code']===0x1f4){logger[_0x946b('0x14')](_0x946b('0xf'),_0xfded5d,_0x3fc05a[_0x946b('0x14')][_0x946b('0x15')]);return _0x572ea3(_0x3fc05a[_0x946b('0x14')][_0x946b('0x15')]);}logger[_0x946b('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0xfded5d,_0x3fc05a[_0x946b('0x14')][_0x946b('0x15')]);return _0x4d2f0d(_0x3fc05a[_0x946b('0x14')][_0x946b('0x15')]);}else{logger[_0x946b('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0xfded5d,_0x946b('0x12'));_0x4d2f0d(_0x3fc05a[_0x946b('0x16')][_0x946b('0x15')]);}})['catch'](function(_0x4ab0ba){logger[_0x946b('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0xfded5d,_0x4ab0ba);_0x572ea3(_0x4ab0ba);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 2a2bd1e..ffc507a 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 _0x1c09=['isAuthenticated','show','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./voiceRecording.controller','get','index','/describe','describe','/:id'];(function(_0x28c5cd,_0x2c23c0){var _0x560c3=function(_0x3f89a2){while(--_0x3f89a2){_0x28c5cd['push'](_0x28c5cd['shift']());}};_0x560c3(++_0x2c23c0);}(_0x1c09,0x8f));var _0x91c0=function(_0x3f12fc,_0x5534a3){_0x3f12fc=_0x3f12fc-0x0;var _0x1448ad=_0x1c09[_0x3f12fc];return _0x1448ad;};'use strict';var multer=require(_0x91c0('0x0'));var util=require(_0x91c0('0x1'));var path=require(_0x91c0('0x2'));var timeout=require(_0x91c0('0x3'));var express=require('express');var router=express[_0x91c0('0x4')]();var fs_extra=require(_0x91c0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x91c0('0x6'));var controller=require(_0x91c0('0x7'));router[_0x91c0('0x8')]('/',auth['isAuthenticated'](),controller[_0x91c0('0x9')]);router[_0x91c0('0x8')](_0x91c0('0xa'),auth['isAuthenticated'](),controller[_0x91c0('0xb')]);router[_0x91c0('0x8')](_0x91c0('0xc'),auth[_0x91c0('0xd')](),controller[_0x91c0('0xe')]);router[_0x91c0('0x8')]('/:id/download',auth[_0x91c0('0xd')](),controller[_0x91c0('0xf')]);router[_0x91c0('0x8')](_0x91c0('0x10'),controller['downloads']);router[_0x91c0('0x8')](_0x91c0('0x11'),auth['isAuthenticated'](),controller[_0x91c0('0x12')]);router[_0x91c0('0x13')]('/',auth[_0x91c0('0xd')](),controller[_0x91c0('0x14')]);router['post'](_0x91c0('0x11'),auth[_0x91c0('0xd')](),controller[_0x91c0('0x15')]);router[_0x91c0('0x16')](_0x91c0('0xc'),auth['isAuthenticated'](),controller[_0x91c0('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x91c0('0x18')]);module[_0x91c0('0x19')]=router; \ No newline at end of file +var _0x6f1b=['create','runTranscribe','put','delete','destroy','util','connect-timeout','express','Router','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/:id','download','/:id/downloads','downloadTranscribe','post'];(function(_0x316af9,_0x4120f8){var _0x7f6dd9=function(_0x129cdf){while(--_0x129cdf){_0x316af9['push'](_0x316af9['shift']());}};_0x7f6dd9(++_0x4120f8);}(_0x6f1b,0x135));var _0xb6f1=function(_0x42dc1a,_0x3f2b2a){_0x42dc1a=_0x42dc1a-0x0;var _0x131a7a=_0x6f1b[_0x42dc1a];return _0x131a7a;};'use strict';var multer=require('multer');var util=require(_0xb6f1('0x0'));var path=require('path');var timeout=require(_0xb6f1('0x1'));var express=require(_0xb6f1('0x2'));var router=express[_0xb6f1('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb6f1('0x4'));var config=require('../../config/environment');var controller=require(_0xb6f1('0x5'));router[_0xb6f1('0x6')]('/',auth[_0xb6f1('0x7')](),controller[_0xb6f1('0x8')]);router[_0xb6f1('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xb6f1('0x6')](_0xb6f1('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xb6f1('0x6')]('/:id/download',auth[_0xb6f1('0x7')](),controller[_0xb6f1('0xa')]);router['get'](_0xb6f1('0xb'),controller['downloads']);router[_0xb6f1('0x6')]('/:id/transcribe',auth[_0xb6f1('0x7')](),controller[_0xb6f1('0xc')]);router[_0xb6f1('0xd')]('/',auth['isAuthenticated'](),controller[_0xb6f1('0xe')]);router[_0xb6f1('0xd')]('/:id/transcribe',auth[_0xb6f1('0x7')](),controller[_0xb6f1('0xf')]);router[_0xb6f1('0x10')](_0xb6f1('0x9'),auth[_0xb6f1('0x7')](),controller['update']);router[_0xb6f1('0x11')](_0xb6f1('0x9'),auth[_0xb6f1('0x7')](),controller[_0xb6f1('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 288c66e..2c52c7e 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(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 0de4222..d59d21f 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 _0xe5da=['status','end','json','offset','undefined','count','limit','set','apply','save','then','destroy','error','name','send','index','map','VoiceRecording','type','key','format','query','keys','filters','intersection','attributes','model','fields','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','create','body','update','describe','download','../../components/encryptor','uniqueid','find','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','sequelize','MD5','col','token','$and','push','%s.cypher','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','[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','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x500454,_0x103a7f){var _0x1fd60c=function(_0x5689ca){while(--_0x5689ca){_0x500454['push'](_0x500454['shift']());}};_0x1fd60c(++_0x103a7f);}(_0xe5da,0x1a2));var _0xae5d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe5da[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xae5d('0x0'));var rimraf=require(_0xae5d('0x1'));var zipdir=require(_0xae5d('0x2'));var jsonpatch=require(_0xae5d('0x3'));var rp=require(_0xae5d('0x4'));var moment=require(_0xae5d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xae5d('0x6'));var util=require(_0xae5d('0x7'));var path=require(_0xae5d('0x8'));var sox=require('sox');var csv=require(_0xae5d('0x9'));var ejs=require(_0xae5d('0xa'));var fs=require('fs');var fs_extra=require(_0xae5d('0xb'));var _=require(_0xae5d('0xc'));var squel=require(_0xae5d('0xd'));var crypto=require(_0xae5d('0xe'));var jsforce=require(_0xae5d('0xf'));var deskjs=require(_0xae5d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var AWS=require(_0xae5d('0x11'));var uuidv4=require(_0xae5d('0x12'));var Redis=require(_0xae5d('0x13'));var authService=require(_0xae5d('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae5d('0x15'));var logger=require(_0xae5d('0x16'))(_0xae5d('0x17'));var utils=require(_0xae5d('0x18'));var config=require(_0xae5d('0x19'));var licenseUtil=require(_0xae5d('0x1a'));var db=require(_0xae5d('0x1b'))['db'];function respondWithStatusCode(_0x19e4d0,_0xf12feb){_0xf12feb=_0xf12feb||0xcc;return function(_0x1df4f1){if(_0x1df4f1){return _0x19e4d0[_0xae5d('0x1c')](_0xf12feb);}return _0x19e4d0[_0xae5d('0x1d')](_0xf12feb)[_0xae5d('0x1e')]();};}function respondWithResult(_0x1cd34f,_0x1b6210){_0x1b6210=_0x1b6210||0xc8;return function(_0x2ffb2f){if(_0x2ffb2f){return _0x1cd34f['status'](_0x1b6210)[_0xae5d('0x1f')](_0x2ffb2f);}};}function respondWithFilteredResult(_0x5663af,_0x114864){return function(_0x5179dd){if(_0x5179dd){var _0x9ef599=typeof _0x114864[_0xae5d('0x20')]===_0xae5d('0x21')&&typeof _0x114864['limit']===_0xae5d('0x21');var _0x3c61be=_0x5179dd[_0xae5d('0x22')];var _0x225117=_0x9ef599?0x0:_0x114864[_0xae5d('0x20')];var _0x52a795=_0x9ef599?_0x5179dd[_0xae5d('0x22')]:_0x114864['offset']+_0x114864[_0xae5d('0x23')];var _0x532440;if(_0x52a795>=_0x3c61be){_0x52a795=_0x3c61be;_0x532440=0xc8;}else{_0x532440=0xce;}_0x5663af[_0xae5d('0x1d')](_0x532440);return _0x5663af[_0xae5d('0x24')]('Content-Range',_0x225117+'-'+_0x52a795+'/'+_0x3c61be)[_0xae5d('0x1f')](_0x5179dd);}return null;};}function patchUpdates(_0x542059){return function(_0x3b8f79){try{jsonpatch[_0xae5d('0x25')](_0x3b8f79,_0x542059,!![]);}catch(_0xa4e8a5){return BPromise['reject'](_0xa4e8a5);}return _0x3b8f79[_0xae5d('0x26')]();};}function saveUpdates(_0x5f0a4f,_0xa660ba){return function(_0x1f30e3){if(_0x1f30e3){return _0x1f30e3['update'](_0x5f0a4f)[_0xae5d('0x27')](function(_0x3f098c){return _0x3f098c;});}return null;};}function removeEntity(_0x1b6156,_0x1df948){return function(_0x7eda37){if(_0x7eda37){return _0x7eda37[_0xae5d('0x28')]()[_0xae5d('0x27')](function(){_0x1b6156['status'](0xcc)[_0xae5d('0x1e')]();});}};}function handleEntityNotFound(_0x2e7136,_0x4ccd50){return function(_0x33c2d2){if(!_0x33c2d2){_0x2e7136[_0xae5d('0x1c')](0x194);}return _0x33c2d2;};}function handleError(_0x576eca,_0x5b3d07){_0x5b3d07=_0x5b3d07||0x1f4;return function(_0x2a5fe3){logger[_0xae5d('0x29')](_0x2a5fe3['stack']);if(_0x2a5fe3[_0xae5d('0x2a')]){delete _0x2a5fe3[_0xae5d('0x2a')];}_0x576eca[_0xae5d('0x1d')](_0x5b3d07)[_0xae5d('0x2b')](_0x2a5fe3);};}exports[_0xae5d('0x2c')]=function(_0x24e68f,_0x5b280f){var _0x42ffb3={},_0x520c06={},_0x49da3e={'count':0x0,'rows':[]};var _0x47f2b2=_[_0xae5d('0x2d')](db[_0xae5d('0x2e')]['rawAttributes'],function(_0x2eeb65){return{'name':_0x2eeb65['fieldName'],'type':_0x2eeb65[_0xae5d('0x2f')][_0xae5d('0x30')]};});_0x520c06['model']=_['differenceBy'](_[_0xae5d('0x2d')](_0x47f2b2,_0xae5d('0x2a')),[_0xae5d('0x31')]);_0x520c06[_0xae5d('0x32')]=_[_0xae5d('0x33')](_0x24e68f['query']);_0x520c06[_0xae5d('0x34')]=_[_0xae5d('0x35')](_0x520c06['model'],_0x520c06[_0xae5d('0x32')]);_0x42ffb3[_0xae5d('0x36')]=_['intersection'](_0x520c06[_0xae5d('0x37')],qs[_0xae5d('0x38')](_0x24e68f['query'][_0xae5d('0x38')]));_0x42ffb3[_0xae5d('0x36')]=_0x42ffb3[_0xae5d('0x36')]['length']?_0x42ffb3[_0xae5d('0x36')]:_0x520c06['model'];if(!_0x24e68f[_0xae5d('0x32')]['hasOwnProperty']('nolimit')){_0x42ffb3['limit']=qs['limit'](_0x24e68f[_0xae5d('0x32')][_0xae5d('0x23')]);_0x42ffb3[_0xae5d('0x20')]=qs[_0xae5d('0x20')](_0x24e68f[_0xae5d('0x32')][_0xae5d('0x20')]);}_0x42ffb3[_0xae5d('0x39')]=qs['sort'](_0x24e68f[_0xae5d('0x32')][_0xae5d('0x3a')]);_0x42ffb3['where']=qs[_0xae5d('0x34')](_[_0xae5d('0x3b')](_0x24e68f[_0xae5d('0x32')],_0x520c06[_0xae5d('0x34')]),_0x47f2b2);if(_0x24e68f[_0xae5d('0x32')][_0xae5d('0x3c')]){_0x42ffb3[_0xae5d('0x3d')]=_[_0xae5d('0x3e')](_0x42ffb3[_0xae5d('0x3d')],{'$or':_[_0xae5d('0x2d')](_0x47f2b2,function(_0x41da6d){if(_0x41da6d[_0xae5d('0x2f')]!=='VIRTUAL'){var _0x483688={};_0x483688[_0x41da6d[_0xae5d('0x2a')]]={'$like':'%'+_0x24e68f[_0xae5d('0x32')][_0xae5d('0x3c')]+'%'};return _0x483688;}})});}_0x42ffb3=_[_0xae5d('0x3e')]({},_0x42ffb3,_0x24e68f[_0xae5d('0x3f')]);var _0x2832d8={'where':_0x42ffb3[_0xae5d('0x3d')]};return db['VoiceRecording'][_0xae5d('0x22')](_0x2832d8)[_0xae5d('0x27')](function(_0x578ba4){_0x49da3e[_0xae5d('0x22')]=_0x578ba4;if(_0x24e68f['query'][_0xae5d('0x40')]){_0x42ffb3['include']=[{'all':!![]}];}return db[_0xae5d('0x2e')][_0xae5d('0x41')](_0x42ffb3);})[_0xae5d('0x27')](function(_0x10c9ba){_0x49da3e[_0xae5d('0x42')]=_0x10c9ba;return _0x49da3e;})[_0xae5d('0x27')](respondWithFilteredResult(_0x5b280f,_0x42ffb3))[_0xae5d('0x43')](handleError(_0x5b280f,null));};exports[_0xae5d('0x44')]=function(_0x4df9cd,_0x2a698d){var _0x4febb6={'raw':![],'where':{'id':_0x4df9cd[_0xae5d('0x45')]['id']}},_0x11c8ba={};_0x11c8ba['model']=_[_0xae5d('0x33')](db[_0xae5d('0x2e')][_0xae5d('0x46')]);_0x11c8ba[_0xae5d('0x32')]=_[_0xae5d('0x33')](_0x4df9cd[_0xae5d('0x32')]);_0x11c8ba[_0xae5d('0x34')]=_[_0xae5d('0x35')](_0x11c8ba[_0xae5d('0x37')],_0x11c8ba[_0xae5d('0x32')]);_0x4febb6[_0xae5d('0x36')]=_[_0xae5d('0x35')](_0x11c8ba[_0xae5d('0x37')],qs['fields'](_0x4df9cd[_0xae5d('0x32')][_0xae5d('0x38')]));_0x4febb6['attributes']=_0x4febb6[_0xae5d('0x36')][_0xae5d('0x47')]?_0x4febb6[_0xae5d('0x36')]:_0x11c8ba[_0xae5d('0x37')];if(_0x4df9cd['query'][_0xae5d('0x40')]){_0x4febb6[_0xae5d('0x48')]=[{'all':!![]}];}_0x4febb6=_[_0xae5d('0x3e')]({},_0x4febb6,_0x4df9cd[_0xae5d('0x3f')]);return db[_0xae5d('0x2e')]['find'](_0x4febb6)['then'](handleEntityNotFound(_0x2a698d,null))[_0xae5d('0x27')](respondWithResult(_0x2a698d,null))['catch'](handleError(_0x2a698d,null));};exports[_0xae5d('0x49')]=function(_0x5c3a9a,_0x260718){return db[_0xae5d('0x2e')][_0xae5d('0x49')](_0x5c3a9a[_0xae5d('0x4a')],{})[_0xae5d('0x27')](respondWithResult(_0x260718,0xc9))['catch'](handleError(_0x260718,null));};exports[_0xae5d('0x4b')]=function(_0x2f5dc8,_0x3a3701){if(_0x2f5dc8[_0xae5d('0x4a')]['id']){delete _0x2f5dc8[_0xae5d('0x4a')]['id'];}return db[_0xae5d('0x2e')]['find']({'where':{'id':_0x2f5dc8['params']['id']}})[_0xae5d('0x27')](handleEntityNotFound(_0x3a3701,null))['then'](saveUpdates(_0x2f5dc8[_0xae5d('0x4a')],null))[_0xae5d('0x27')](respondWithResult(_0x3a3701,null))['catch'](handleError(_0x3a3701,null));};exports['describe']=function(_0x301cdd,_0x252955){return db['VoiceRecording'][_0xae5d('0x4c')]()[_0xae5d('0x27')](respondWithResult(_0x252955,null))[_0xae5d('0x43')](handleError(_0x252955,null));};exports[_0xae5d('0x4d')]=function(_0x371b6a,_0x4af819,_0xabaf8e){var _0x3dc8a9=require(_0xae5d('0x4e'));var _0x58976e=![];var _0x4f19d7={};if(_0x371b6a[_0xae5d('0x32')][_0xae5d('0x2f')]&&_0x371b6a[_0xae5d('0x32')][_0xae5d('0x2f')]===_0xae5d('0x4f')){_0x4f19d7['uniqueid']=_0x371b6a[_0xae5d('0x45')]['id'];}else{_0x4f19d7['id']=_0x371b6a[_0xae5d('0x45')]['id'];}return db[_0xae5d('0x2e')][_0xae5d('0x50')]({'where':_0x4f19d7,'attributes':['id',_0xae5d('0x51')],'raw':!![]})[_0xae5d('0x27')](handleEntityNotFound(_0x4af819,null))[_0xae5d('0x27')](function(_0x2e9e58){if(_0x2e9e58){var _0x29b2dd=_0x2e9e58[_0xae5d('0x51')];var _0x2898e2=util['format']('%s.cypher',_0x29b2dd);if(fs[_0xae5d('0x52')](_0x2898e2)){_0x58976e=!![];return _0x3dc8a9[_0xae5d('0x53')](_0x2898e2,_0x29b2dd,config[_0xae5d('0x54')][_0xae5d('0x55')])[_0xae5d('0x27')](function(){return _0x2e9e58;});}return _0x2e9e58;}})['then'](function(_0xe3ace){if(_0xe3ace){var _0x4ed969=_0xe3ace[_0xae5d('0x51')];if(!fs['existsSync'](_0x4ed969)){throw new db[(_0xae5d('0x56'))][(_0xae5d('0x57'))](_0xae5d('0x58'));}if(_0xe3ace[_0xae5d('0x59')]){return _0x4af819[_0xae5d('0x4d')](_0x4ed969,_0xe3ace[_0xae5d('0x59')]+path[_0xae5d('0x5a')](_0x4ed969),function(){if(_0x58976e){fs[_0xae5d('0x5b')](_0x4ed969);}});}else{return _0x4af819[_0xae5d('0x4d')](_0x4ed969,function(_0x38c600){if(_0x58976e){fs[_0xae5d('0x5b')](_0x4ed969);}});}}})[_0xae5d('0x43')](function(_0x3cb101){if(_0x3cb101['message']===_0xae5d('0x58')){_0x4af819[_0xae5d('0x1d')](0x194)[_0xae5d('0x2b')]('Not\x20found');}else{return handleError(_0x4af819,null);}});};exports['downloads']=function(_0x3fb940,_0x4d1a0b,_0x4ebe2e){var _0x23f810=require(_0xae5d('0x4e'));var _0x19d5e6=![];var _0x1969f1={'$and':[db[_0xae5d('0x5c')][_0xae5d('0x3d')](db[_0xae5d('0x5c')]['fn'](_0xae5d('0x5d'),db[_0xae5d('0x5c')][_0xae5d('0x5e')]('uniqueid')),_0x3fb940[_0xae5d('0x32')][_0xae5d('0x5f')])]};if(_0x3fb940['query'][_0xae5d('0x2f')]&&_0x3fb940[_0xae5d('0x32')]['type']===_0xae5d('0x4f')){_0x1969f1[_0xae5d('0x60')][_0xae5d('0x61')]({'uniqueid':_0x3fb940[_0xae5d('0x45')]['id']});}else{_0x1969f1['$and'][_0xae5d('0x61')]({'id':_0x3fb940['params']['id']});}return db[_0xae5d('0x2e')][_0xae5d('0x50')]({'where':_0x1969f1,'attributes':['id',_0xae5d('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x4d1a0b,null))[_0xae5d('0x27')](function(_0x57626b){if(_0x57626b){var _0x4581aa=util[_0xae5d('0x31')](_0xae5d('0x62'),_0x57626b['value']);if(fs['existsSync'](_0x4581aa)){_0x19d5e6=!![];return _0x23f810['decryptFile'](_0x4581aa,_0x57626b[_0xae5d('0x51')],config[_0xae5d('0x54')][_0xae5d('0x55')])[_0xae5d('0x27')](function(){return _0x57626b;});}return _0x57626b;}})[_0xae5d('0x27')](function(_0x34a8f9){if(_0x34a8f9){if(!fs[_0xae5d('0x52')](_0x34a8f9[_0xae5d('0x51')])){throw new db[(_0xae5d('0x56'))]['ValidationError'](_0xae5d('0x58'));}if(_0x34a8f9[_0xae5d('0x59')]){return _0x4d1a0b[_0xae5d('0x4d')](_0x34a8f9[_0xae5d('0x51')],_0x34a8f9[_0xae5d('0x59')]+path['extname'](_0x34a8f9[_0xae5d('0x51')]),function(){if(_0x19d5e6){fs[_0xae5d('0x5b')](_0x34a8f9[_0xae5d('0x51')]);}});}else{return _0x4d1a0b[_0xae5d('0x4d')](_0x34a8f9[_0xae5d('0x51')],function(_0x1a40b5){if(_0x19d5e6){fs['unlink'](_0x34a8f9[_0xae5d('0x51')]);}});}}})[_0xae5d('0x43')](handleError(_0x4d1a0b,null));};exports[_0xae5d('0x28')]=function(_0x275c80,_0x5c2456){return db['VoiceRecording']['find']({'where':{'id':_0x275c80[_0xae5d('0x45')]['id']}})['then'](function(_0x25c5f2){if(_['isNil'](_0x25c5f2)){throw new ReferenceError(_0xae5d('0x63'));}return _0x25c5f2;})[_0xae5d('0x27')](function(_0x31cce6){var _0x167ebf=_0x31cce6[_0xae5d('0x51')];logger[_0xae5d('0x64')](_0xae5d('0x65'),_0x167ebf);if(!_[_0xae5d('0x66')](_0x31cce6[_0xae5d('0x51')])&&fs['existsSync'](_0x167ebf)){logger[_0xae5d('0x64')]('File:\x20\x22'+_0x167ebf+_0xae5d('0x67'));fs[_0xae5d('0x68')](_0x167ebf);}_0x167ebf=_0x167ebf+'.cypher';if(!_[_0xae5d('0x66')](_0x31cce6[_0xae5d('0x51')])&&fs[_0xae5d('0x52')](_0x167ebf)){logger[_0xae5d('0x64')]('File:\x20\x22'+_0x167ebf+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x167ebf);}return _0x31cce6;})[_0xae5d('0x27')](function(_0xe503e6){if(!_0xe503e6)throw new InternalError();return _0xe503e6[_0xae5d('0x28')]();})['then'](function(){_0x5c2456[_0xae5d('0x1d')](0xcc)['end']();})[_0xae5d('0x43')](handleError(_0x5c2456,null));};function getBucketslist(_0x5bd867,_0xff8251,_0x1ca541){return new Promise(function(_0x133f9e,_0xb8dbb0){var _0x4474a3=new AWS['S3']({'accessKeyId':_0xff8251,'secretAccessKey':_0x5bd867,'region':_0x1ca541});_0x4474a3[_0xae5d('0x69')]({},function(_0x1f1228,_0x9787e2){if(_0x1f1228){return _0xb8dbb0(_0x1f1228);}else{return _0x133f9e(_0x9787e2);}});});}function createBucket(_0x609a2f,_0x5fd8e0,_0x21c13c,_0x23a9bc){return new Promise(function(_0x30dea2,_0x1bd9c7){var _0xa7d525=new AWS['S3']({'accessKeyId':_0x5fd8e0,'secretAccessKey':_0x609a2f,'region':_0x21c13c});_0xa7d525[_0xae5d('0x6a')]({'Bucket':_0x23a9bc},function(_0x45176b,_0x243469){if(_0x45176b){return _0x1bd9c7(_0x45176b);}else{return _0x30dea2(_0x243469);}});});}function uploadFile(_0x52331e,_0x19e96f,_0x54db96,_0x28c3c8,_0x5b2c9d,_0x22d195){return new Promise(function(_0x4c8576,_0x2cb34b){var _0x2a753e=new AWS['S3']({'accessKeyId':_0x19e96f,'secretAccessKey':_0x52331e,'region':_0x54db96});_0x2a753e[_0xae5d('0x6b')]({'Bucket':_0x28c3c8,'Key':_0x5b2c9d,'Body':_0x22d195},function(_0x56c8b,_0x28761a){if(_0x56c8b){return _0x2cb34b(_0x56c8b);}else{return _0x4c8576(_0x28761a);}});});}function startTranscribe(_0x42e4ce,_0x18ab2d,_0x17ae55,_0xb6faa6,_0x1487c0,_0x1d8406){return new Promise(function(_0x1d3981,_0x22ea62){var _0x798205=new AWS['TranscribeService']({'accessKeyId':_0x18ab2d,'secretAccessKey':_0x42e4ce,'region':_0x17ae55});_0x798205['startTranscriptionJob']({'TranscriptionJobName':_0xb6faa6,'LanguageCode':_0x1487c0,'Media':{'MediaFileUri':_0x1d8406}},function(_0x36423c,_0x83c482){if(_0x36423c){return _0x22ea62(_0x36423c);}else{return _0x1d3981(_0x83c482);}});});}function transcribe(_0x2314e1,_0x4db103,_0x380328,_0x2b4980,_0x218ff8,_0x2c976d,_0xa61941){return new Promise(function(_0x216002,_0x4b564e){var _0x2754e8={};logger['info'](util[_0xae5d('0x31')](_0xae5d('0x6c'),_0x2314e1,_0x218ff8));return uploadFile(_0x4db103,_0x380328,_0x2b4980,_0x218ff8,path[_0xae5d('0x6d')](_0x2c976d),fs[_0xae5d('0x6e')](_0x2c976d))['then'](function(_0x230ec8){logger[_0xae5d('0x64')](util[_0xae5d('0x31')](_0xae5d('0x6f'),_0x2314e1,_0x218ff8,_0x230ec8[_0xae5d('0x70')]));_0x2754e8[_0xae5d('0x71')]=_0x230ec8[_0xae5d('0x72')];_0x2754e8['location']=_0x230ec8[_0xae5d('0x70')];logger[_0xae5d('0x64')](util[_0xae5d('0x31')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x2314e1));return startTranscribe(_0x4db103,_0x380328,_0x2b4980,uuidv4(),_0xa61941,_0x230ec8[_0xae5d('0x70')]);})[_0xae5d('0x27')](function(_0x174b75){logger[_0xae5d('0x64')](util[_0xae5d('0x31')](_0xae5d('0x73'),_0x2314e1,_0x174b75[_0xae5d('0x74')]['TranscriptionJobName']));_0x2754e8['transcribeName']=_0x174b75[_0xae5d('0x74')]['TranscriptionJobName'];_0x2754e8[_0xae5d('0x75')]=_0x174b75[_0xae5d('0x74')]['TranscriptionJobStatus'];return _0x216002(_0x2754e8);})[_0xae5d('0x43')](function(_0x40b208){return _0x4b564e(_0x40b208);});});}exports[_0xae5d('0x76')]=function(_0xee49a9,_0x3b72a1,_0x20bfa7){var _0x3fbb82;var _0x2a9b53;var _0x39118a;var _0x411c69=require(_0xae5d('0x4e'));return db[_0xae5d('0x2e')][_0xae5d('0x77')]({'where':{'id':_0xee49a9['params']['id']}})['then'](function(_0x32b8f3){if(_0x32b8f3){var _0x4bf193=util[_0xae5d('0x31')](_0xae5d('0x62'),_0x32b8f3[_0xae5d('0x51')]);if(fs[_0xae5d('0x52')](_0x4bf193)){cypher=!![];return _0x411c69[_0xae5d('0x53')](_0x4bf193,_0x32b8f3['value'],config['secrets'][_0xae5d('0x55')])['then'](function(){return _0x32b8f3;});}return _0x32b8f3;}})['then'](function(_0x26058c){if(!_0x26058c){throw new db['Sequelize'][(_0xae5d('0x57'))](_0xae5d('0x78'));}_0x2a9b53=_0x26058c;return db[_0xae5d('0x79')][_0xae5d('0x77')]({'where':{'id':0x1}});})[_0xae5d('0x27')](handleEntityNotFound(_0x3b72a1,null))[_0xae5d('0x27')](function(_0xbd8694){if(_0xbd8694){_0x3fbb82=_0xbd8694;if(!_0x3fbb82[_0xae5d('0x7a')]||!_0x3fbb82[_0xae5d('0x7b')]||!_0x3fbb82[_0xae5d('0x7c')]||!_0x3fbb82[_0xae5d('0x7d')]||!_0x3fbb82[_0xae5d('0x71')]){throw new db['Sequelize'][(_0xae5d('0x57'))](_0xae5d('0x7e'));}if(_0xee49a9[_0xae5d('0x4a')][_0xae5d('0x7f')]&&(!_0x3fbb82['sentiment']||!_0x3fbb82[_0xae5d('0x80')]||!_0x3fbb82[_0xae5d('0x81')]||!_0x3fbb82[_0xae5d('0x7d')]||!_0x3fbb82['bucket'])){throw new db['Sequelize'][(_0xae5d('0x57'))](_0xae5d('0x82'));}return db[_0xae5d('0x83')][_0xae5d('0x77')]({'where':{'id':_0x3fbb82[_0xae5d('0x7b')]}});}})[_0xae5d('0x27')](function(_0x233a3b){if(!_0x233a3b){throw new db[(_0xae5d('0x56'))][(_0xae5d('0x57'))](_0xae5d('0x84'));}if(!_0x233a3b['data1']||!_0x233a3b[_0xae5d('0x85')]){throw new db[(_0xae5d('0x56'))][(_0xae5d('0x57'))](_0xae5d('0x86'));}_0x39118a=_0x233a3b;return getBucketslist(_0x39118a[_0xae5d('0x87')],_0x39118a['data2'],_0x3fbb82[_0xae5d('0x7c')]);})['then'](function(_0x3ab546){if(_0x3ab546&&_0x3ab546[_0xae5d('0x88')]){var _0xb46c44=_[_0xae5d('0x50')](_0x3ab546[_0xae5d('0x88')],function(_0x955336){return _0x955336[_0xae5d('0x89')]===_0x3fbb82[_0xae5d('0x71')];});if(!_0xb46c44){logger[_0xae5d('0x64')](util[_0xae5d('0x31')](_0xae5d('0x8a'),_0xee49a9[_0xae5d('0x45')]['id'],_0x3fbb82[_0xae5d('0x71')]));return createBucket(_0x39118a['data1'],_0x39118a['data2'],_0x3fbb82[_0xae5d('0x7c')],_0x3fbb82[_0xae5d('0x71')]);}logger[_0xae5d('0x64')](util[_0xae5d('0x31')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0xee49a9[_0xae5d('0x45')]['id'],_0x3fbb82['bucket']));return;}})[_0xae5d('0x27')](function(_0x4a7052){if(_0x2a9b53[_0xae5d('0x75')]===_0xae5d('0x8b')){return transcribe(_0xee49a9[_0xae5d('0x45')]['id'],_0x39118a[_0xae5d('0x87')],_0x39118a[_0xae5d('0x85')],_0x3fbb82[_0xae5d('0x7c')],_0x3fbb82[_0xae5d('0x71')],_0x2a9b53[_0xae5d('0x51')],_0x3fbb82[_0xae5d('0x7d')]);}else{logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0xee49a9[_0xae5d('0x45')]['id']));return{'transcribeStatus':_0xae5d('0x8c')};}})['then'](function(_0x44008a){if(_0x44008a){_0x44008a[_0xae5d('0x8d')]=_0xee49a9[_0xae5d('0x4a')][_0xae5d('0x7f')];return _0x2a9b53['updateAttributes'](_0x44008a);}})[_0xae5d('0x27')](respondWithResult(_0x3b72a1,null))[_0xae5d('0x43')](handleError(_0x3b72a1,null));};function writeFile(_0x38a5ec,_0x2e7c4a){return new Promise(function(_0x2400aa,_0x1071c0){fs[_0xae5d('0x8e')](_0x2e7c4a,_0x38a5ec,function(_0x1d60d2,_0x1d5430){if(_0x1d60d2){return _0x1071c0(_0x1d60d2);}else{return _0x2400aa(_0x1d5430);}});});}exports[_0xae5d('0x8f')]=function(_0x58d134,_0x1e9138,_0x33ecb4){return db[_0xae5d('0x2e')]['findOne']({'where':{'id':_0x58d134[_0xae5d('0x45')]['id']}})['then'](handleEntityNotFound(_0x1e9138))['then'](function(_0x10cf3e){if(_0x10cf3e&&_0x10cf3e['fileText']){var _0x5cff92=_0x10cf3e[_0xae5d('0x90')];var _0x255c7d=config[_0xae5d('0x91')]+_0xae5d('0x92')+_0x10cf3e['id']+_0xae5d('0x93');if(fs[_0xae5d('0x52')](_0x255c7d)){return _0x255c7d;}return writeFile(_0x5cff92,_0x255c7d)[_0xae5d('0x27')](function(){return _0x255c7d;});}else{throw new db[(_0xae5d('0x56'))]['ValidationError'](_0xae5d('0x94'));}})['then'](function(_0x410afe){return _0x1e9138[_0xae5d('0x4d')](_0x410afe);})[_0xae5d('0x43')](handleError(_0x1e9138));}; \ No newline at end of file +var _0xcfb8=['Sequelize','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','File:\x20\x22','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','Setting','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','data1','transcribeRegion','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','aws-sdk','ioredis','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','update','destroy','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','differenceBy','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','VoiceRecording','findAll','rows','show','include','find','catch','create','body','describe','../../components/encryptor','uniqueid','params','value','format','%s.cypher','decryptFile','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','download','downloads','sequelize','MD5','col','$and','push','existsSync'];(function(_0x57fd1f,_0x124056){var _0x59ee7c=function(_0xcdaf66){while(--_0xcdaf66){_0x57fd1f['push'](_0x57fd1f['shift']());}};_0x59ee7c(++_0x124056);}(_0xcfb8,0x1ec));var _0x8cfb=function(_0x2bee57,_0x43a2d2){_0x2bee57=_0x2bee57-0x0;var _0x2015a2=_0xcfb8[_0x2bee57];return _0x2015a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cfb('0x0'));var zipdir=require(_0x8cfb('0x1'));var jsonpatch=require(_0x8cfb('0x2'));var rp=require(_0x8cfb('0x3'));var moment=require(_0x8cfb('0x4'));var BPromise=require(_0x8cfb('0x5'));var Mustache=require(_0x8cfb('0x6'));var util=require(_0x8cfb('0x7'));var path=require(_0x8cfb('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8cfb('0x9'));var _=require(_0x8cfb('0xa'));var squel=require(_0x8cfb('0xb'));var crypto=require(_0x8cfb('0xc'));var jsforce=require(_0x8cfb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8cfb('0xe'));var Papa=require(_0x8cfb('0xf'));var AWS=require(_0x8cfb('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0x8cfb('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8cfb('0x12'))(_0x8cfb('0x13'));var utils=require(_0x8cfb('0x14'));var config=require(_0x8cfb('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x380987,_0x218ff1){_0x218ff1=_0x218ff1||0xcc;return function(_0x18409c){if(_0x18409c){return _0x380987['sendStatus'](_0x218ff1);}return _0x380987[_0x8cfb('0x16')](_0x218ff1)[_0x8cfb('0x17')]();};}function respondWithResult(_0x381430,_0x2c1075){_0x2c1075=_0x2c1075||0xc8;return function(_0x5f3674){if(_0x5f3674){return _0x381430[_0x8cfb('0x16')](_0x2c1075)[_0x8cfb('0x18')](_0x5f3674);}};}function respondWithFilteredResult(_0x99cda1,_0x70b217){return function(_0x3722e8){if(_0x3722e8){var _0x37a6fc=typeof _0x70b217['offset']===_0x8cfb('0x19')&&typeof _0x70b217['limit']==='undefined';var _0x5ae646=_0x3722e8[_0x8cfb('0x1a')];var _0x5bbc45=_0x37a6fc?0x0:_0x70b217[_0x8cfb('0x1b')];var _0x17ddd8=_0x37a6fc?_0x3722e8['count']:_0x70b217[_0x8cfb('0x1b')]+_0x70b217[_0x8cfb('0x1c')];var _0x3fcda3;if(_0x17ddd8>=_0x5ae646){_0x17ddd8=_0x5ae646;_0x3fcda3=0xc8;}else{_0x3fcda3=0xce;}_0x99cda1[_0x8cfb('0x16')](_0x3fcda3);return _0x99cda1[_0x8cfb('0x1d')](_0x8cfb('0x1e'),_0x5bbc45+'-'+_0x17ddd8+'/'+_0x5ae646)['json'](_0x3722e8);}return null;};}function patchUpdates(_0x5231af){return function(_0x531dca){try{jsonpatch['apply'](_0x531dca,_0x5231af,!![]);}catch(_0x5e479f){return BPromise[_0x8cfb('0x1f')](_0x5e479f);}return _0x531dca['save']();};}function saveUpdates(_0x555283,_0x466e7e){return function(_0x226574){if(_0x226574){return _0x226574[_0x8cfb('0x20')](_0x555283)['then'](function(_0x3901c4){return _0x3901c4;});}return null;};}function removeEntity(_0x120dfd,_0x105c2b){return function(_0x10441a){if(_0x10441a){return _0x10441a[_0x8cfb('0x21')]()[_0x8cfb('0x22')](function(){_0x120dfd[_0x8cfb('0x16')](0xcc)[_0x8cfb('0x17')]();});}};}function handleEntityNotFound(_0x31cdaf,_0x4b6c71){return function(_0x13481b){if(!_0x13481b){_0x31cdaf[_0x8cfb('0x23')](0x194);}return _0x13481b;};}function handleError(_0x1cf448,_0x5d9da4){_0x5d9da4=_0x5d9da4||0x1f4;return function(_0x51d36a){logger['error'](_0x51d36a[_0x8cfb('0x24')]);if(_0x51d36a['name']){delete _0x51d36a[_0x8cfb('0x25')];}_0x1cf448['status'](_0x5d9da4)[_0x8cfb('0x26')](_0x51d36a);};}exports[_0x8cfb('0x27')]=function(_0x4aab1e,_0x241dd1){var _0x18faca={},_0x1e2596={},_0x5e0bfe={'count':0x0,'rows':[]};var _0x3f232a=_[_0x8cfb('0x28')](db['VoiceRecording'][_0x8cfb('0x29')],function(_0x4206ba){return{'name':_0x4206ba[_0x8cfb('0x2a')],'type':_0x4206ba[_0x8cfb('0x2b')]['key']};});_0x1e2596['model']=_[_0x8cfb('0x2c')](_[_0x8cfb('0x28')](_0x3f232a,_0x8cfb('0x25')),['format']);_0x1e2596[_0x8cfb('0x2d')]=_[_0x8cfb('0x2e')](_0x4aab1e[_0x8cfb('0x2d')]);_0x1e2596[_0x8cfb('0x2f')]=_['intersection'](_0x1e2596[_0x8cfb('0x30')],_0x1e2596[_0x8cfb('0x2d')]);_0x18faca['attributes']=_[_0x8cfb('0x31')](_0x1e2596['model'],qs[_0x8cfb('0x32')](_0x4aab1e[_0x8cfb('0x2d')][_0x8cfb('0x32')]));_0x18faca[_0x8cfb('0x33')]=_0x18faca[_0x8cfb('0x33')][_0x8cfb('0x34')]?_0x18faca['attributes']:_0x1e2596[_0x8cfb('0x30')];if(!_0x4aab1e[_0x8cfb('0x2d')][_0x8cfb('0x35')](_0x8cfb('0x36'))){_0x18faca['limit']=qs['limit'](_0x4aab1e[_0x8cfb('0x2d')][_0x8cfb('0x1c')]);_0x18faca[_0x8cfb('0x1b')]=qs[_0x8cfb('0x1b')](_0x4aab1e['query']['offset']);}_0x18faca[_0x8cfb('0x37')]=qs[_0x8cfb('0x38')](_0x4aab1e[_0x8cfb('0x2d')]['sort']);_0x18faca[_0x8cfb('0x39')]=qs[_0x8cfb('0x2f')](_[_0x8cfb('0x3a')](_0x4aab1e[_0x8cfb('0x2d')],_0x1e2596['filters']),_0x3f232a);if(_0x4aab1e[_0x8cfb('0x2d')][_0x8cfb('0x3b')]){_0x18faca[_0x8cfb('0x39')]=_['merge'](_0x18faca[_0x8cfb('0x39')],{'$or':_[_0x8cfb('0x28')](_0x3f232a,function(_0x59cc19){if(_0x59cc19[_0x8cfb('0x2b')]!==_0x8cfb('0x3c')){var _0x3ae1e3={};_0x3ae1e3[_0x59cc19[_0x8cfb('0x25')]]={'$like':'%'+_0x4aab1e[_0x8cfb('0x2d')][_0x8cfb('0x3b')]+'%'};return _0x3ae1e3;}})});}_0x18faca=_[_0x8cfb('0x3d')]({},_0x18faca,_0x4aab1e[_0x8cfb('0x3e')]);var _0x214aab={'where':_0x18faca['where']};return db['VoiceRecording'][_0x8cfb('0x1a')](_0x214aab)[_0x8cfb('0x22')](function(_0x1e2fc6){_0x5e0bfe[_0x8cfb('0x1a')]=_0x1e2fc6;if(_0x4aab1e[_0x8cfb('0x2d')][_0x8cfb('0x3f')]){_0x18faca['include']=[{'all':!![]}];}return db[_0x8cfb('0x40')][_0x8cfb('0x41')](_0x18faca);})['then'](function(_0x3f9390){_0x5e0bfe[_0x8cfb('0x42')]=_0x3f9390;return _0x5e0bfe;})[_0x8cfb('0x22')](respondWithFilteredResult(_0x241dd1,_0x18faca))['catch'](handleError(_0x241dd1,null));};exports[_0x8cfb('0x43')]=function(_0x2fe1ef,_0x162a54){var _0x15fec2={'raw':![],'where':{'id':_0x2fe1ef['params']['id']}},_0x323432={};_0x323432[_0x8cfb('0x30')]=_[_0x8cfb('0x2e')](db[_0x8cfb('0x40')][_0x8cfb('0x29')]);_0x323432['query']=_['keys'](_0x2fe1ef['query']);_0x323432[_0x8cfb('0x2f')]=_[_0x8cfb('0x31')](_0x323432[_0x8cfb('0x30')],_0x323432['query']);_0x15fec2[_0x8cfb('0x33')]=_[_0x8cfb('0x31')](_0x323432['model'],qs[_0x8cfb('0x32')](_0x2fe1ef[_0x8cfb('0x2d')]['fields']));_0x15fec2[_0x8cfb('0x33')]=_0x15fec2[_0x8cfb('0x33')][_0x8cfb('0x34')]?_0x15fec2[_0x8cfb('0x33')]:_0x323432['model'];if(_0x2fe1ef[_0x8cfb('0x2d')][_0x8cfb('0x3f')]){_0x15fec2[_0x8cfb('0x44')]=[{'all':!![]}];}_0x15fec2=_[_0x8cfb('0x3d')]({},_0x15fec2,_0x2fe1ef[_0x8cfb('0x3e')]);return db[_0x8cfb('0x40')][_0x8cfb('0x45')](_0x15fec2)[_0x8cfb('0x22')](handleEntityNotFound(_0x162a54,null))[_0x8cfb('0x22')](respondWithResult(_0x162a54,null))[_0x8cfb('0x46')](handleError(_0x162a54,null));};exports[_0x8cfb('0x47')]=function(_0x213738,_0xd372d3){return db[_0x8cfb('0x40')][_0x8cfb('0x47')](_0x213738['body'],{})[_0x8cfb('0x22')](respondWithResult(_0xd372d3,0xc9))[_0x8cfb('0x46')](handleError(_0xd372d3,null));};exports['update']=function(_0x29e52f,_0x383371){if(_0x29e52f[_0x8cfb('0x48')]['id']){delete _0x29e52f[_0x8cfb('0x48')]['id'];}return db[_0x8cfb('0x40')]['find']({'where':{'id':_0x29e52f['params']['id']}})[_0x8cfb('0x22')](handleEntityNotFound(_0x383371,null))[_0x8cfb('0x22')](saveUpdates(_0x29e52f['body'],null))[_0x8cfb('0x22')](respondWithResult(_0x383371,null))[_0x8cfb('0x46')](handleError(_0x383371,null));};exports[_0x8cfb('0x49')]=function(_0x1d74e1,_0x55478f){return db['VoiceRecording'][_0x8cfb('0x49')]()['then'](respondWithResult(_0x55478f,null))[_0x8cfb('0x46')](handleError(_0x55478f,null));};exports['download']=function(_0x156764,_0x398c7f,_0x15a492){var _0xbc81a7=require(_0x8cfb('0x4a'));var _0x26354a=![];var _0xb1b1a4={};if(_0x156764['query']['type']&&_0x156764[_0x8cfb('0x2d')][_0x8cfb('0x2b')]===_0x8cfb('0x4b')){_0xb1b1a4['uniqueid']=_0x156764[_0x8cfb('0x4c')]['id'];}else{_0xb1b1a4['id']=_0x156764['params']['id'];}return db[_0x8cfb('0x40')][_0x8cfb('0x45')]({'where':_0xb1b1a4,'attributes':['id',_0x8cfb('0x4d')],'raw':!![]})[_0x8cfb('0x22')](handleEntityNotFound(_0x398c7f,null))[_0x8cfb('0x22')](function(_0x540ced){if(_0x540ced){var _0x1caf2c=_0x540ced[_0x8cfb('0x4d')];var _0x5278d6=util[_0x8cfb('0x4e')](_0x8cfb('0x4f'),_0x1caf2c);if(fs['existsSync'](_0x5278d6)){_0x26354a=!![];return _0xbc81a7[_0x8cfb('0x50')](_0x5278d6,_0x1caf2c,config[_0x8cfb('0x51')][_0x8cfb('0x52')])['then'](function(){return _0x540ced;});}return _0x540ced;}})[_0x8cfb('0x22')](function(_0x38e61c){if(_0x38e61c){var _0x3f89bf=_0x38e61c[_0x8cfb('0x4d')];if(!fs['existsSync'](_0x3f89bf)){throw new db['Sequelize'][(_0x8cfb('0x53'))](_0x8cfb('0x54'));}if(_0x38e61c['filename']){return _0x398c7f['download'](_0x3f89bf,_0x38e61c[_0x8cfb('0x55')]+path[_0x8cfb('0x56')](_0x3f89bf),function(){if(_0x26354a){fs[_0x8cfb('0x57')](_0x3f89bf);}});}else{return _0x398c7f[_0x8cfb('0x58')](_0x3f89bf,function(_0x460407){if(_0x26354a){fs[_0x8cfb('0x57')](_0x3f89bf);}});}}})[_0x8cfb('0x46')](function(_0x463ea7){if(_0x463ea7['message']===_0x8cfb('0x54')){_0x398c7f[_0x8cfb('0x16')](0x194)[_0x8cfb('0x26')]('Not\x20found');}else{return handleError(_0x398c7f,null);}});};exports[_0x8cfb('0x59')]=function(_0x52eba8,_0x508bab,_0x4dd91f){var _0x2bad75=require(_0x8cfb('0x4a'));var _0x3fb1dc=![];var _0x5e9191={'$and':[db['sequelize'][_0x8cfb('0x39')](db[_0x8cfb('0x5a')]['fn'](_0x8cfb('0x5b'),db[_0x8cfb('0x5a')][_0x8cfb('0x5c')](_0x8cfb('0x4b'))),_0x52eba8[_0x8cfb('0x2d')]['token'])]};if(_0x52eba8[_0x8cfb('0x2d')][_0x8cfb('0x2b')]&&_0x52eba8[_0x8cfb('0x2d')][_0x8cfb('0x2b')]===_0x8cfb('0x4b')){_0x5e9191[_0x8cfb('0x5d')]['push']({'uniqueid':_0x52eba8['params']['id']});}else{_0x5e9191[_0x8cfb('0x5d')][_0x8cfb('0x5e')]({'id':_0x52eba8[_0x8cfb('0x4c')]['id']});}return db[_0x8cfb('0x40')]['find']({'where':_0x5e9191,'attributes':['id',_0x8cfb('0x4d')],'raw':!![]})[_0x8cfb('0x22')](handleEntityNotFound(_0x508bab,null))[_0x8cfb('0x22')](function(_0x3e5f88){if(_0x3e5f88){var _0x2c39a9=util[_0x8cfb('0x4e')]('%s.cypher',_0x3e5f88[_0x8cfb('0x4d')]);if(fs[_0x8cfb('0x5f')](_0x2c39a9)){_0x3fb1dc=!![];return _0x2bad75[_0x8cfb('0x50')](_0x2c39a9,_0x3e5f88[_0x8cfb('0x4d')],config[_0x8cfb('0x51')][_0x8cfb('0x52')])[_0x8cfb('0x22')](function(){return _0x3e5f88;});}return _0x3e5f88;}})[_0x8cfb('0x22')](function(_0x60fed2){if(_0x60fed2){if(!fs['existsSync'](_0x60fed2[_0x8cfb('0x4d')])){throw new db[(_0x8cfb('0x60'))][(_0x8cfb('0x53'))](_0x8cfb('0x54'));}if(_0x60fed2[_0x8cfb('0x55')]){return _0x508bab[_0x8cfb('0x58')](_0x60fed2[_0x8cfb('0x4d')],_0x60fed2[_0x8cfb('0x55')]+path[_0x8cfb('0x56')](_0x60fed2[_0x8cfb('0x4d')]),function(){if(_0x3fb1dc){fs[_0x8cfb('0x57')](_0x60fed2[_0x8cfb('0x4d')]);}});}else{return _0x508bab[_0x8cfb('0x58')](_0x60fed2['value'],function(_0x3628e4){if(_0x3fb1dc){fs[_0x8cfb('0x57')](_0x60fed2[_0x8cfb('0x4d')]);}});}}})[_0x8cfb('0x46')](handleError(_0x508bab,null));};exports[_0x8cfb('0x21')]=function(_0xece45a,_0x51365b){return db[_0x8cfb('0x40')][_0x8cfb('0x45')]({'where':{'id':_0xece45a[_0x8cfb('0x4c')]['id']}})[_0x8cfb('0x22')](function(_0x262632){if(_['isNil'](_0x262632)){throw new ReferenceError('Entity\x20not\x20found');}return _0x262632;})[_0x8cfb('0x22')](function(_0xbdc993){var _0x1bea90=_0xbdc993[_0x8cfb('0x4d')];logger[_0x8cfb('0x61')](_0x8cfb('0x62'),_0x1bea90);if(!_['isNil'](_0xbdc993[_0x8cfb('0x4d')])&&fs['existsSync'](_0x1bea90)){logger['info']('File:\x20\x22'+_0x1bea90+_0x8cfb('0x63'));fs[_0x8cfb('0x64')](_0x1bea90);}_0x1bea90=_0x1bea90+_0x8cfb('0x65');if(!_[_0x8cfb('0x66')](_0xbdc993['value'])&&fs['existsSync'](_0x1bea90)){logger[_0x8cfb('0x61')](_0x8cfb('0x67')+_0x1bea90+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8cfb('0x64')](_0x1bea90);}return _0xbdc993;})[_0x8cfb('0x22')](function(_0x47f248){if(!_0x47f248)throw new InternalError();return _0x47f248[_0x8cfb('0x21')]();})['then'](function(){_0x51365b[_0x8cfb('0x16')](0xcc)['end']();})[_0x8cfb('0x46')](handleError(_0x51365b,null));};function getBucketslist(_0x3219eb,_0x4c4b4b,_0x36a87a){return new Promise(function(_0x3012f5,_0x139803){var _0x2b71e5=new AWS['S3']({'accessKeyId':_0x4c4b4b,'secretAccessKey':_0x3219eb,'region':_0x36a87a});_0x2b71e5['listBuckets']({},function(_0x31ff87,_0x4a78e7){if(_0x31ff87){return _0x139803(_0x31ff87);}else{return _0x3012f5(_0x4a78e7);}});});}function createBucket(_0x22f60b,_0x114797,_0x561001,_0x37b9f6){return new Promise(function(_0x37a183,_0x57d55a){var _0x40164d=new AWS['S3']({'accessKeyId':_0x114797,'secretAccessKey':_0x22f60b,'region':_0x561001});_0x40164d[_0x8cfb('0x68')]({'Bucket':_0x37b9f6},function(_0x201225,_0x75c7e8){if(_0x201225){return _0x57d55a(_0x201225);}else{return _0x37a183(_0x75c7e8);}});});}function uploadFile(_0x541f92,_0x3729df,_0x376684,_0x1dcabf,_0x2efb09,_0x809808){return new Promise(function(_0x2f0a47,_0x5eb1a8){var _0x12ac2c=new AWS['S3']({'accessKeyId':_0x3729df,'secretAccessKey':_0x541f92,'region':_0x376684});_0x12ac2c[_0x8cfb('0x69')]({'Bucket':_0x1dcabf,'Key':_0x2efb09,'Body':_0x809808},function(_0x42a880,_0x27ac47){if(_0x42a880){return _0x5eb1a8(_0x42a880);}else{return _0x2f0a47(_0x27ac47);}});});}function startTranscribe(_0x2d7a26,_0x418d74,_0x2786cf,_0x2651a5,_0x1666d3,_0x132785){return new Promise(function(_0x10cbef,_0x243758){var _0x1a544e=new AWS[(_0x8cfb('0x6a'))]({'accessKeyId':_0x418d74,'secretAccessKey':_0x2d7a26,'region':_0x2786cf});_0x1a544e[_0x8cfb('0x6b')]({'TranscriptionJobName':_0x2651a5,'LanguageCode':_0x1666d3,'Media':{'MediaFileUri':_0x132785}},function(_0x15067f,_0x3ab385){if(_0x15067f){return _0x243758(_0x15067f);}else{return _0x10cbef(_0x3ab385);}});});}function transcribe(_0x41c2be,_0x51afe3,_0x1819d8,_0x80cf3,_0x430b73,_0x2e6d19,_0x58aea0){return new Promise(function(_0x23c2c8,_0x36cee2){var _0x150d24={};logger[_0x8cfb('0x61')](util['format'](_0x8cfb('0x6c'),_0x41c2be,_0x430b73));return uploadFile(_0x51afe3,_0x1819d8,_0x80cf3,_0x430b73,path['basename'](_0x2e6d19),fs[_0x8cfb('0x6d')](_0x2e6d19))['then'](function(_0x42bdfc){logger[_0x8cfb('0x61')](util['format'](_0x8cfb('0x6e'),_0x41c2be,_0x430b73,_0x42bdfc['Location']));_0x150d24[_0x8cfb('0x6f')]=_0x42bdfc['Bucket'];_0x150d24[_0x8cfb('0x70')]=_0x42bdfc[_0x8cfb('0x71')];logger[_0x8cfb('0x61')](util[_0x8cfb('0x4e')](_0x8cfb('0x72'),_0x41c2be));return startTranscribe(_0x51afe3,_0x1819d8,_0x80cf3,uuidv4(),_0x58aea0,_0x42bdfc[_0x8cfb('0x71')]);})[_0x8cfb('0x22')](function(_0x577e22){logger['info'](util[_0x8cfb('0x4e')](_0x8cfb('0x73'),_0x41c2be,_0x577e22[_0x8cfb('0x74')][_0x8cfb('0x75')]));_0x150d24[_0x8cfb('0x76')]=_0x577e22['TranscriptionJob']['TranscriptionJobName'];_0x150d24[_0x8cfb('0x77')]=_0x577e22[_0x8cfb('0x74')]['TranscriptionJobStatus'];return _0x23c2c8(_0x150d24);})['catch'](function(_0x469b48){return _0x36cee2(_0x469b48);});});}exports[_0x8cfb('0x78')]=function(_0x1f1d24,_0x2d82ae,_0x36e742){var _0x48ba49;var _0x346a49;var _0x1fc2f5;var _0x17732a=require(_0x8cfb('0x4a'));return db[_0x8cfb('0x40')][_0x8cfb('0x79')]({'where':{'id':_0x1f1d24[_0x8cfb('0x4c')]['id']}})[_0x8cfb('0x22')](function(_0x4e16ec){if(_0x4e16ec){var _0x11ee69=util[_0x8cfb('0x4e')](_0x8cfb('0x4f'),_0x4e16ec['value']);if(fs[_0x8cfb('0x5f')](_0x11ee69)){cypher=!![];return _0x17732a[_0x8cfb('0x50')](_0x11ee69,_0x4e16ec[_0x8cfb('0x4d')],config['secrets']['recording'])[_0x8cfb('0x22')](function(){return _0x4e16ec;});}return _0x4e16ec;}})['then'](function(_0x5ce40a){if(!_0x5ce40a){throw new db[(_0x8cfb('0x60'))]['ValidationError']('Voice\x20Recording\x20not\x20found');}_0x346a49=_0x5ce40a;return db[_0x8cfb('0x7a')][_0x8cfb('0x79')]({'where':{'id':0x1}});})[_0x8cfb('0x22')](handleEntityNotFound(_0x2d82ae,null))[_0x8cfb('0x22')](function(_0x341968){if(_0x341968){_0x48ba49=_0x341968;if(!_0x48ba49[_0x8cfb('0x7b')]||!_0x48ba49[_0x8cfb('0x7c')]||!_0x48ba49['transcribeRegion']||!_0x48ba49[_0x8cfb('0x7d')]||!_0x48ba49['bucket']){throw new db[(_0x8cfb('0x60'))][(_0x8cfb('0x53'))](_0x8cfb('0x7e'));}if(_0x1f1d24['body'][_0x8cfb('0x7f')]&&(!_0x48ba49[_0x8cfb('0x80')]||!_0x48ba49[_0x8cfb('0x81')]||!_0x48ba49[_0x8cfb('0x82')]||!_0x48ba49['language']||!_0x48ba49['bucket'])){throw new db[(_0x8cfb('0x60'))][(_0x8cfb('0x53'))](_0x8cfb('0x83'));}return db[_0x8cfb('0x84')][_0x8cfb('0x79')]({'where':{'id':_0x48ba49[_0x8cfb('0x7c')]}});}})[_0x8cfb('0x22')](function(_0x54f056){if(!_0x54f056){throw new db['Sequelize'][(_0x8cfb('0x53'))](_0x8cfb('0x85'));}if(!_0x54f056['data1']||!_0x54f056[_0x8cfb('0x86')]){throw new db['Sequelize'][(_0x8cfb('0x53'))]('Cloud\x20Provider\x20not\x20configured');}_0x1fc2f5=_0x54f056;return getBucketslist(_0x1fc2f5[_0x8cfb('0x87')],_0x1fc2f5['data2'],_0x48ba49[_0x8cfb('0x88')]);})[_0x8cfb('0x22')](function(_0x48e673){if(_0x48e673&&_0x48e673['Buckets']){var _0x2cbe03=_['find'](_0x48e673['Buckets'],function(_0x3b86e8){return _0x3b86e8[_0x8cfb('0x89')]===_0x48ba49[_0x8cfb('0x6f')];});if(!_0x2cbe03){logger[_0x8cfb('0x61')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x1f1d24[_0x8cfb('0x4c')]['id'],_0x48ba49[_0x8cfb('0x6f')]));return createBucket(_0x1fc2f5[_0x8cfb('0x87')],_0x1fc2f5[_0x8cfb('0x86')],_0x48ba49[_0x8cfb('0x88')],_0x48ba49[_0x8cfb('0x6f')]);}logger['info'](util['format'](_0x8cfb('0x8a'),_0x1f1d24[_0x8cfb('0x4c')]['id'],_0x48ba49[_0x8cfb('0x6f')]));return;}})[_0x8cfb('0x22')](function(_0xff8469){if(_0x346a49[_0x8cfb('0x77')]===_0x8cfb('0x8b')){return transcribe(_0x1f1d24[_0x8cfb('0x4c')]['id'],_0x1fc2f5[_0x8cfb('0x87')],_0x1fc2f5[_0x8cfb('0x86')],_0x48ba49['transcribeRegion'],_0x48ba49['bucket'],_0x346a49[_0x8cfb('0x4d')],_0x48ba49[_0x8cfb('0x7d')]);}else{logger[_0x8cfb('0x61')](util[_0x8cfb('0x4e')](_0x8cfb('0x8c'),_0x1f1d24[_0x8cfb('0x4c')]['id']));return{'transcribeStatus':_0x8cfb('0x8d')};}})[_0x8cfb('0x22')](function(_0x322ac8){if(_0x322ac8){_0x322ac8['tempSentiment']=_0x1f1d24[_0x8cfb('0x48')][_0x8cfb('0x7f')];return _0x346a49[_0x8cfb('0x8e')](_0x322ac8);}})[_0x8cfb('0x22')](respondWithResult(_0x2d82ae,null))[_0x8cfb('0x46')](handleError(_0x2d82ae,null));};function writeFile(_0x464fd9,_0x53e386){return new Promise(function(_0x22d3e4,_0x44e68c){fs['writeFile'](_0x53e386,_0x464fd9,function(_0x4019c0,_0x398731){if(_0x4019c0){return _0x44e68c(_0x4019c0);}else{return _0x22d3e4(_0x398731);}});});}exports[_0x8cfb('0x8f')]=function(_0x523967,_0x1ad256,_0xe2354a){return db[_0x8cfb('0x40')][_0x8cfb('0x79')]({'where':{'id':_0x523967[_0x8cfb('0x4c')]['id']}})[_0x8cfb('0x22')](handleEntityNotFound(_0x1ad256))[_0x8cfb('0x22')](function(_0x1d5ce6){if(_0x1d5ce6&&_0x1d5ce6[_0x8cfb('0x90')]){var _0x196791=_0x1d5ce6[_0x8cfb('0x90')];var _0x1aea00=config[_0x8cfb('0x91')]+_0x8cfb('0x92')+_0x1d5ce6['id']+'.txt';if(fs[_0x8cfb('0x5f')](_0x1aea00)){return _0x1aea00;}return writeFile(_0x196791,_0x1aea00)['then'](function(){return _0x1aea00;});}else{throw new db[(_0x8cfb('0x60'))][(_0x8cfb('0x53'))]('Transcript\x20not\x20available');}})[_0x8cfb('0x22')](function(_0x557242){return _0x1ad256[_0x8cfb('0x58')](_0x557242);})['catch'](handleError(_0x1ad256));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 2ad181b..955c656 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 _0x636f=['uniqueid','transcribeStatus','define','VoiceRecording','voice_recordings'];(function(_0x4acdd4,_0x46e893){var _0x5b6973=function(_0x6fa4d0){while(--_0x6fa4d0){_0x4acdd4['push'](_0x4acdd4['shift']());}};_0x5b6973(++_0x46e893);}(_0x636f,0x188));var _0xf636=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x636f[_0x501510];return _0x1e6ee5;};'use strict';var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x352490,_0x1d8b93){return _0x352490[_0xf636('0x0')](_0xf636('0x1'),attributes,{'tableName':_0xf636('0x2'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf636('0x3')]},{'name':_0xf636('0x4'),'fields':[_0xf636('0x4')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe920=['transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x2fde14,_0xb161dc){var _0x36bc78=function(_0xbd2420){while(--_0xbd2420){_0x2fde14['push'](_0x2fde14['shift']());}};_0x36bc78(++_0xb161dc);}(_0xe920,0xbe));var _0x0e92=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0xe920[_0x2ca2d0];return _0x521c23;};'use strict';var attributes=require(_0x0e92('0x0'));module[_0x0e92('0x1')]=function(_0x203091,_0x19781b){return _0x203091[_0x0e92('0x2')](_0x0e92('0x3'),attributes,{'tableName':_0x0e92('0x4'),'paranoid':![],'indexes':[{'name':_0x0e92('0x5'),'fields':[_0x0e92('0x5')]},{'name':_0x0e92('0x6'),'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 3e05759..4b91115 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 _0x9582=['UpdateVoiceRecording','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','secrets','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','VoiceRecording','body','options','where','attributes','limit','then'];(function(_0x3da48c,_0x521cbb){var _0x205410=function(_0x55a475){while(--_0x55a475){_0x3da48c['push'](_0x3da48c['shift']());}};_0x205410(++_0x521cbb);}(_0x9582,0x95));var _0x2958=function(_0x5f031f,_0x46228e){_0x5f031f=_0x5f031f-0x0;var _0x43c40d=_0x9582[_0x5f031f];return _0x43c40d;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309525,_0xa385ec,_0x2e571b){return new BPromise(function(_0x56ca85,_0x5ec1b3){return client[_0x2958('0xd')](_0x309525,_0x2e571b)['then'](function(_0x10db1e){logger['info'](_0x2958('0xe'),_0xa385ec,'request\x20sent');logger[_0x2958('0xf')](_0x2958('0x10'),_0xa385ec,_0x2958('0x11'),JSON[_0x2958('0x12')](_0x10db1e));if(_0x10db1e[_0x2958('0x13')]){if(_0x10db1e['error'][_0x2958('0x14')]===0x1f4){logger[_0x2958('0x13')](_0x2958('0xe'),_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x5ec1b3(_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);}logger[_0x2958('0x13')]('VoiceRecording,\x20%s,\x20%s',_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x56ca85(_0x10db1e['error']['message']);}else{logger[_0x2958('0x16')](_0x2958('0xe'),_0xa385ec,'request\x20sent');_0x56ca85(_0x10db1e[_0x2958('0x17')]['message']);}})['catch'](function(_0x429d42){logger[_0x2958('0x13')]('VoiceRecording,\x20%s,\x20%s',_0xa385ec,_0x429d42);_0x5ec1b3(_0x429d42);});});}exports['UpdateVoiceRecording']=function(_0x28a92c){var _0x160949=this;return new Promise(function(_0x310d07,_0x42bb99){return db[_0x2958('0x18')]['update'](_0x28a92c[_0x2958('0x19')],{'raw':_0x28a92c[_0x2958('0x1a')]?_0x28a92c[_0x2958('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28a92c[_0x2958('0x1a')]?_0x28a92c['options'][_0x2958('0x1b')]||null:null,'attributes':_0x28a92c['options']?_0x28a92c['options'][_0x2958('0x1c')]||null:null,'limit':_0x28a92c[_0x2958('0x1a')]?_0x28a92c[_0x2958('0x1a')][_0x2958('0x1d')]||null:null})[_0x2958('0x1e')](function(_0x412e42){logger[_0x2958('0x16')](_0x2958('0x1f'),_0x28a92c);logger[_0x2958('0xf')](_0x2958('0x1f'),_0x28a92c,JSON[_0x2958('0x12')](_0x412e42));_0x310d07(_0x412e42);})[_0x2958('0x20')](function(_0x119242){logger[_0x2958('0x13')](_0x2958('0x1f'),_0x119242['message'],_0x28a92c);_0x42bb99(_0x160949['error'](0x1f4,_0x119242[_0x2958('0x15')]));});});};exports[_0x2958('0x21')]=function(_0x28c1f5){var _0x43cf73=this;return new Promise(function(_0x52bd32,_0x2bd1ac){var _0x57ae96=require(_0x2958('0x22'));var _0x40adce;return db[_0x2958('0x23')][_0x2958('0x24')]({'attributes':['id',_0x2958('0x25')],'where':{'id':0x1},'raw':!![]})[_0x2958('0x1e')](function(_0x153958){_0x40adce=_0x153958;return db['VoiceRecording'][_0x2958('0x26')](_0x28c1f5['body']);})['then'](function(_0x28ee09){if(_0x40adce[_0x2958('0x25')]&&fs[_0x2958('0x27')](_0x28ee09[_0x2958('0x28')])){var _0x584179=util[_0x2958('0x29')](_0x2958('0x2a'),_0x28ee09[_0x2958('0x28')]);return _0x57ae96['encryptFile'](_0x28ee09[_0x2958('0x28')],_0x584179,config[_0x2958('0x2b')]['recording'])[_0x2958('0x1e')](function(){fs['unlink'](_0x28ee09[_0x2958('0x28')]);logger['info'](_0x2958('0x2c'));return _0x28ee09;});}return _0x28ee09;})['then'](function(_0x4477b5){logger[_0x2958('0x16')](_0x2958('0x21'),_0x28c1f5);logger[_0x2958('0xf')](_0x2958('0x21'),_0x28c1f5,JSON[_0x2958('0x12')](_0x4477b5));_0x52bd32(_0x4477b5);})[_0x2958('0x20')](function(_0x58f9b4){logger[_0x2958('0x13')]('CreateVoiceRecording',_0x58f9b4[_0x2958('0x15')],_0x28c1f5);_0x2bd1ac(_0x43cf73['error'](0x1f4,_0x58f9b4[_0x2958('0x15')]));});});}; \ No newline at end of file +var _0x583c=['options','raw','where','attributes','limit','debug','stringify','catch','Setting','callRecordingEncryption','create','value','format','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result','UpdateVoiceRecording','VoiceRecording','body'];(function(_0x5e757c,_0x317644){var _0x2a0c4b=function(_0x4a0597){while(--_0x4a0597){_0x5e757c['push'](_0x5e757c['shift']());}};_0x2a0c4b(++_0x317644);}(_0x583c,0x12b));var _0xc583=function(_0x3ed054,_0x4d4f16){_0x3ed054=_0x3ed054-0x0;var _0x16dd95=_0x583c[_0x3ed054];return _0x16dd95;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var moment=require(_0xc583('0x2'));var BPromise=require(_0xc583('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc583('0x4'));var db=require(_0xc583('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc583('0x6'));var config=require(_0xc583('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc583('0x8')][_0xc583('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2719df,_0x1dd37c,_0x48a8d4){return new BPromise(function(_0x21ed88,_0x26cec0){return client['request'](_0x2719df,_0x48a8d4)[_0xc583('0xa')](function(_0x24ab4f){logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,_0xc583('0xd'));logger['debug'](_0xc583('0xe'),_0x1dd37c,_0xc583('0xd'),JSON['stringify'](_0x24ab4f));if(_0x24ab4f[_0xc583('0xf')]){if(_0x24ab4f[_0xc583('0xf')]['code']===0x1f4){logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);return _0x26cec0(_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);}logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')]['message']);return _0x21ed88(_0x24ab4f[_0xc583('0xf')]['message']);}else{logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,'request\x20sent');_0x21ed88(_0x24ab4f[_0xc583('0x11')][_0xc583('0x10')]);}})['catch'](function(_0x7d1690){logger[_0xc583('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x1dd37c,_0x7d1690);_0x26cec0(_0x7d1690);});});}exports[_0xc583('0x12')]=function(_0x8a2d84){var _0x12aac2=this;return new Promise(function(_0x36e0fd,_0x5433ec){return db[_0xc583('0x13')]['update'](_0x8a2d84[_0xc583('0x14')],{'raw':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x17')]||null:null,'attributes':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x18')]||null:null,'limit':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x19')]||null:null})['then'](function(_0x542256){logger[_0xc583('0xb')](_0xc583('0x12'),_0x8a2d84);logger[_0xc583('0x1a')]('UpdateVoiceRecording',_0x8a2d84,JSON[_0xc583('0x1b')](_0x542256));_0x36e0fd(_0x542256);})[_0xc583('0x1c')](function(_0x37f156){logger[_0xc583('0xf')](_0xc583('0x12'),_0x37f156['message'],_0x8a2d84);_0x5433ec(_0x12aac2['error'](0x1f4,_0x37f156[_0xc583('0x10')]));});});};exports['CreateVoiceRecording']=function(_0x45ef74){var _0xcbe9b2=this;return new Promise(function(_0xbabf24,_0x1e7809){var _0x24aab5=require('../../components/encryptor');var _0x2dafb4;return db[_0xc583('0x1d')]['findOne']({'attributes':['id',_0xc583('0x1e')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x2c9088){_0x2dafb4=_0x2c9088;return db[_0xc583('0x13')][_0xc583('0x1f')](_0x45ef74[_0xc583('0x14')]);})[_0xc583('0xa')](function(_0x19079b){if(_0x2dafb4[_0xc583('0x1e')]&&fs['existsSync'](_0x19079b[_0xc583('0x20')])){var _0x390bc3=util[_0xc583('0x21')](_0xc583('0x22'),_0x19079b[_0xc583('0x20')]);return _0x24aab5[_0xc583('0x23')](_0x19079b['value'],_0x390bc3,config[_0xc583('0x24')]['recording'])['then'](function(){fs[_0xc583('0x25')](_0x19079b[_0xc583('0x20')]);logger[_0xc583('0xb')](_0xc583('0x26'));return _0x19079b;});}return _0x19079b;})[_0xc583('0xa')](function(_0x4a9679){logger[_0xc583('0xb')](_0xc583('0x27'),_0x45ef74);logger[_0xc583('0x1a')]('CreateVoiceRecording',_0x45ef74,JSON[_0xc583('0x1b')](_0x4a9679));_0xbabf24(_0x4a9679);})['catch'](function(_0x1aa62a){logger[_0xc583('0xf')](_0xc583('0x27'),_0x1aa62a[_0xc583('0x10')],_0x45ef74);_0x1e7809(_0xcbe9b2[_0xc583('0xf')](0x1f4,_0x1aa62a['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 11b91e4..21c164d 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 _0x536c=['show','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id'];(function(_0x4ba8fc,_0x38da41){var _0x29cfd2=function(_0x52fc9b){while(--_0x52fc9b){_0x4ba8fc['push'](_0x4ba8fc['shift']());}};_0x29cfd2(++_0x38da41);}(_0x536c,0x15b));var _0xc536=function(_0x32c78e,_0x32cc40){_0x32c78e=_0x32c78e-0x0;var _0x5dc750=_0x536c[_0x32c78e];return _0x5dc750;};'use strict';var multer=require(_0xc536('0x0'));var util=require(_0xc536('0x1'));var path=require(_0xc536('0x2'));var timeout=require(_0xc536('0x3'));var express=require(_0xc536('0x4'));var router=express[_0xc536('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc536('0x6'));var interaction=require(_0xc536('0x7'));var config=require(_0xc536('0x8'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0xc536('0x9')](),controller['index']);router[_0xc536('0xa')](_0xc536('0xb'),auth['isAuthenticated'](),controller[_0xc536('0xc')]);router[_0xc536('0xa')](_0xc536('0xd'),auth[_0xc536('0x9')](),controller[_0xc536('0xe')]);router['post']('/',auth[_0xc536('0x9')](),controller[_0xc536('0xf')]);router[_0xc536('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc536('0x11')]);router['delete']('/:id',auth[_0xc536('0x9')](),controller['destroy']);module[_0xc536('0x12')]=router; \ No newline at end of file +var _0x2f36=['isAuthenticated','index','/:id','post','create','put','update','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get'];(function(_0x1887a2,_0x4b5762){var _0x4755d4=function(_0x398455){while(--_0x398455){_0x1887a2['push'](_0x1887a2['shift']());}};_0x4755d4(++_0x4b5762);}(_0x2f36,0x6d));var _0x62f3=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x2f36[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require('multer');var util=require(_0x62f3('0x0'));var path=require(_0x62f3('0x1'));var timeout=require(_0x62f3('0x2'));var express=require(_0x62f3('0x3'));var router=express[_0x62f3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x62f3('0x5'));var interaction=require(_0x62f3('0x6'));var config=require(_0x62f3('0x7'));var controller=require(_0x62f3('0x8'));router[_0x62f3('0x9')]('/',auth[_0x62f3('0xa')](),controller[_0x62f3('0xb')]);router[_0x62f3('0x9')]('/describe',auth[_0x62f3('0xa')](),controller['describe']);router[_0x62f3('0x9')](_0x62f3('0xc'),auth[_0x62f3('0xa')](),controller['show']);router[_0x62f3('0xd')]('/',auth['isAuthenticated'](),controller[_0x62f3('0xe')]);router[_0x62f3('0xf')]('/:id',auth[_0x62f3('0xa')](),controller[_0x62f3('0x10')]);router['delete'](_0x62f3('0xc'),auth[_0x62f3('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 82ca5fb..e7113e1 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 _0x45cf=['STRING','sequelize','moment','exports','ENUM','blind'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x45cf,0x1c3));var _0xf45c=function(_0x4066c2,_0xad48e8){_0x4066c2=_0x4066c2-0x0;var _0x3870a0=_0x45cf[_0x4066c2];return _0x3870a0;};'use strict';var Sequelize=require(_0xf45c('0x0'));var moment=require(_0xf45c('0x1'));module[_0xf45c('0x2')]={'type':{'type':Sequelize[_0xf45c('0x3')](_0xf45c('0x4'),'attended')},'result':{'type':Sequelize[_0xf45c('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xf45c('0x5')]},'transferercalleridname':{'type':Sequelize[_0xf45c('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xf45c('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xf45c('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xf45c('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xf45c('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xf45c('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xf45c('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xf45c('0x5')]},'transfereecontext':{'type':Sequelize[_0xf45c('0x5')]},'transfereeexten':{'type':Sequelize[_0xf45c('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xf45c('0x5')]},'isexternal':{'type':Sequelize[_0xf45c('0x3')]('Yes','No')},'context':{'type':Sequelize[_0xf45c('0x5')]},'extension':{'type':Sequelize[_0xf45c('0x5')]}}; \ No newline at end of file +var _0xda4f=['sequelize','moment','STRING','ENUM'];(function(_0x69d6c5,_0x26d921){var _0x19b1e7=function(_0x46a259){while(--_0x46a259){_0x69d6c5['push'](_0x69d6c5['shift']());}};_0x19b1e7(++_0x26d921);}(_0xda4f,0x1cc));var _0xfda4=function(_0x45368c,_0x338d45){_0x45368c=_0x45368c-0x0;var _0x298f9e=_0xda4f[_0x45368c];return _0x298f9e;};'use strict';var Sequelize=require(_0xfda4('0x0'));var moment=require(_0xfda4('0x1'));module['exports']={'type':{'type':Sequelize['ENUM']('blind','attended')},'result':{'type':Sequelize[_0xfda4('0x2')]},'transfererchannel':{'type':Sequelize[_0xfda4('0x2')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xfda4('0x2')]},'transfererconnectedlinenum':{'type':Sequelize[_0xfda4('0x2')]},'transfererconnectedlinename':{'type':Sequelize[_0xfda4('0x2')]},'transfereraccountcode':{'type':Sequelize[_0xfda4('0x2')]},'transferercontext':{'type':Sequelize[_0xfda4('0x2')]},'transfererexten':{'type':Sequelize[_0xfda4('0x2')]},'transfererlinkedid':{'type':Sequelize[_0xfda4('0x2')]},'transfereechannel':{'type':Sequelize[_0xfda4('0x2')]},'transfereecalleridnum':{'type':Sequelize[_0xfda4('0x2')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xfda4('0x2')]},'transfereeconnectedlinename':{'type':Sequelize[_0xfda4('0x2')]},'transfereeaccountcode':{'type':Sequelize[_0xfda4('0x2')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xfda4('0x2')]},'transfereelinkedid':{'type':Sequelize[_0xfda4('0x2')]},'isexternal':{'type':Sequelize[_0xfda4('0x3')]('Yes','No')},'context':{'type':Sequelize[_0xfda4('0x2')]},'extension':{'type':Sequelize[_0xfda4('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 8b0da20..ec9c699 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 _0x28de=['body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','map','VoiceTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','create'];(function(_0x2333df,_0x1be219){var _0x12013c=function(_0x4802f5){while(--_0x4802f5){_0x2333df['push'](_0x2333df['shift']());}};_0x12013c(++_0x1be219);}(_0x28de,0x180));var _0xe28d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x28de[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xe28d('0x0'));var rimraf=require(_0xe28d('0x1'));var zipdir=require(_0xe28d('0x2'));var jsonpatch=require(_0xe28d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe28d('0x4'));var Mustache=require(_0xe28d('0x5'));var util=require('util');var path=require(_0xe28d('0x6'));var sox=require(_0xe28d('0x7'));var csv=require(_0xe28d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe28d('0x9'));var _=require(_0xe28d('0xa'));var squel=require(_0xe28d('0xb'));var crypto=require(_0xe28d('0xc'));var jsforce=require(_0xe28d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe28d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe28d('0xe'));var authService=require(_0xe28d('0xf'));var qs=require(_0xe28d('0x10'));var as=require(_0xe28d('0x11'));var hardwareService=require(_0xe28d('0x12'));var logger=require(_0xe28d('0x13'))(_0xe28d('0x14'));var utils=require('../../config/utils');var config=require(_0xe28d('0x15'));var licenseUtil=require(_0xe28d('0x16'));var db=require(_0xe28d('0x17'))['db'];function respondWithStatusCode(_0x593cb2,_0x4e688b){_0x4e688b=_0x4e688b||0xcc;return function(_0x4abaed){if(_0x4abaed){return _0x593cb2[_0xe28d('0x18')](_0x4e688b);}return _0x593cb2[_0xe28d('0x19')](_0x4e688b)[_0xe28d('0x1a')]();};}function respondWithResult(_0x3afc0c,_0x30653c){_0x30653c=_0x30653c||0xc8;return function(_0x4b97d0){if(_0x4b97d0){return _0x3afc0c[_0xe28d('0x19')](_0x30653c)['json'](_0x4b97d0);}};}function respondWithFilteredResult(_0x7fbda4,_0x4c3fa3){return function(_0x8dc21a){if(_0x8dc21a){var _0x2079e4=typeof _0x4c3fa3[_0xe28d('0x1b')]===_0xe28d('0x1c')&&typeof _0x4c3fa3[_0xe28d('0x1d')]===_0xe28d('0x1c');var _0x491043=_0x8dc21a[_0xe28d('0x1e')];var _0x561ac0=_0x2079e4?0x0:_0x4c3fa3[_0xe28d('0x1b')];var _0x394fd8=_0x2079e4?_0x8dc21a[_0xe28d('0x1e')]:_0x4c3fa3[_0xe28d('0x1b')]+_0x4c3fa3[_0xe28d('0x1d')];var _0x374f07;if(_0x394fd8>=_0x491043){_0x394fd8=_0x491043;_0x374f07=0xc8;}else{_0x374f07=0xce;}_0x7fbda4[_0xe28d('0x19')](_0x374f07);return _0x7fbda4[_0xe28d('0x1f')](_0xe28d('0x20'),_0x561ac0+'-'+_0x394fd8+'/'+_0x491043)[_0xe28d('0x21')](_0x8dc21a);}return null;};}function patchUpdates(_0x33bd75){return function(_0x3202ca){try{jsonpatch[_0xe28d('0x22')](_0x3202ca,_0x33bd75,!![]);}catch(_0x58b0a2){return BPromise[_0xe28d('0x23')](_0x58b0a2);}return _0x3202ca[_0xe28d('0x24')]();};}function saveUpdates(_0x516e1c,_0x13ca0c){return function(_0x5b5e10){if(_0x5b5e10){return _0x5b5e10[_0xe28d('0x25')](_0x516e1c)['then'](function(_0x10814e){return _0x10814e;});}return null;};}function removeEntity(_0x24663c,_0xf8620f){return function(_0x4c64c7){if(_0x4c64c7){return _0x4c64c7[_0xe28d('0x26')]()[_0xe28d('0x27')](function(){_0x24663c['status'](0xcc)[_0xe28d('0x1a')]();});}};}function handleEntityNotFound(_0x172582,_0xeb69ff){return function(_0x5a8408){if(!_0x5a8408){_0x172582[_0xe28d('0x18')](0x194);}return _0x5a8408;};}function handleError(_0x1851c2,_0x16baa4){_0x16baa4=_0x16baa4||0x1f4;return function(_0x36bda8){logger[_0xe28d('0x28')](_0x36bda8[_0xe28d('0x29')]);if(_0x36bda8[_0xe28d('0x2a')]){delete _0x36bda8[_0xe28d('0x2a')];}_0x1851c2[_0xe28d('0x19')](_0x16baa4)[_0xe28d('0x2b')](_0x36bda8);};}exports['index']=function(_0x195ee8,_0x4e3377){var _0x5a4315={},_0x1b385f={},_0x44dfe7={'count':0x0,'rows':[]};var _0x2687f2=_[_0xe28d('0x2c')](db[_0xe28d('0x2d')][_0xe28d('0x2e')],function(_0x991bf5){return{'name':_0x991bf5['fieldName'],'type':_0x991bf5[_0xe28d('0x2f')][_0xe28d('0x30')]};});_0x1b385f[_0xe28d('0x31')]=_[_0xe28d('0x2c')](_0x2687f2,_0xe28d('0x2a'));_0x1b385f[_0xe28d('0x32')]=_[_0xe28d('0x33')](_0x195ee8[_0xe28d('0x32')]);_0x1b385f[_0xe28d('0x34')]=_[_0xe28d('0x35')](_0x1b385f[_0xe28d('0x31')],_0x1b385f[_0xe28d('0x32')]);_0x5a4315[_0xe28d('0x36')]=_[_0xe28d('0x35')](_0x1b385f[_0xe28d('0x31')],qs[_0xe28d('0x37')](_0x195ee8[_0xe28d('0x32')]['fields']));_0x5a4315['attributes']=_0x5a4315[_0xe28d('0x36')][_0xe28d('0x38')]?_0x5a4315[_0xe28d('0x36')]:_0x1b385f[_0xe28d('0x31')];if(!_0x195ee8[_0xe28d('0x32')][_0xe28d('0x39')](_0xe28d('0x3a'))){_0x5a4315[_0xe28d('0x1d')]=qs[_0xe28d('0x1d')](_0x195ee8['query']['limit']);_0x5a4315[_0xe28d('0x1b')]=qs['offset'](_0x195ee8[_0xe28d('0x32')][_0xe28d('0x1b')]);}_0x5a4315[_0xe28d('0x3b')]=qs[_0xe28d('0x3c')](_0x195ee8[_0xe28d('0x32')][_0xe28d('0x3c')]);_0x5a4315[_0xe28d('0x3d')]=qs[_0xe28d('0x34')](_['pick'](_0x195ee8[_0xe28d('0x32')],_0x1b385f[_0xe28d('0x34')]),_0x2687f2);if(_0x195ee8['query']['filter']){_0x5a4315[_0xe28d('0x3d')]=_[_0xe28d('0x3e')](_0x5a4315[_0xe28d('0x3d')],{'$or':_[_0xe28d('0x2c')](_0x2687f2,function(_0x508469){if(_0x508469[_0xe28d('0x2f')]!==_0xe28d('0x3f')){var _0x105d81={};_0x105d81[_0x508469[_0xe28d('0x2a')]]={'$like':'%'+_0x195ee8['query'][_0xe28d('0x40')]+'%'};return _0x105d81;}})});}_0x5a4315=_[_0xe28d('0x3e')]({},_0x5a4315,_0x195ee8[_0xe28d('0x41')]);var _0x554ca2={'where':_0x5a4315[_0xe28d('0x3d')]};return db[_0xe28d('0x2d')][_0xe28d('0x1e')](_0x554ca2)['then'](function(_0x19e8c3){_0x44dfe7['count']=_0x19e8c3;if(_0x195ee8[_0xe28d('0x32')]['includeAll']){_0x5a4315[_0xe28d('0x42')]=[{'all':!![]}];}return db[_0xe28d('0x2d')][_0xe28d('0x43')](_0x5a4315);})[_0xe28d('0x27')](function(_0x200497){_0x44dfe7[_0xe28d('0x44')]=_0x200497;return _0x44dfe7;})[_0xe28d('0x27')](respondWithFilteredResult(_0x4e3377,_0x5a4315))[_0xe28d('0x45')](handleError(_0x4e3377,null));};exports[_0xe28d('0x46')]=function(_0x2a1545,_0x47cb5f){var _0x5ed63c={'raw':!![],'where':{'id':_0x2a1545['params']['id']}},_0x2a3182={};_0x2a3182[_0xe28d('0x31')]=_['keys'](db[_0xe28d('0x2d')][_0xe28d('0x2e')]);_0x2a3182['query']=_[_0xe28d('0x33')](_0x2a1545['query']);_0x2a3182[_0xe28d('0x34')]=_[_0xe28d('0x35')](_0x2a3182[_0xe28d('0x31')],_0x2a3182[_0xe28d('0x32')]);_0x5ed63c[_0xe28d('0x36')]=_[_0xe28d('0x35')](_0x2a3182['model'],qs[_0xe28d('0x37')](_0x2a1545[_0xe28d('0x32')][_0xe28d('0x37')]));_0x5ed63c[_0xe28d('0x36')]=_0x5ed63c['attributes'][_0xe28d('0x38')]?_0x5ed63c[_0xe28d('0x36')]:_0x2a3182['model'];if(_0x2a1545[_0xe28d('0x32')]['includeAll']){_0x5ed63c[_0xe28d('0x42')]=[{'all':!![]}];}_0x5ed63c=_[_0xe28d('0x3e')]({},_0x5ed63c,_0x2a1545[_0xe28d('0x41')]);return db['VoiceTransferReport']['find'](_0x5ed63c)[_0xe28d('0x27')](handleEntityNotFound(_0x47cb5f,null))[_0xe28d('0x27')](respondWithResult(_0x47cb5f,null))[_0xe28d('0x45')](handleError(_0x47cb5f,null));};exports[_0xe28d('0x47')]=function(_0x349b4d,_0x4ed8e7){return db[_0xe28d('0x2d')][_0xe28d('0x47')](_0x349b4d[_0xe28d('0x48')],{})[_0xe28d('0x27')](respondWithResult(_0x4ed8e7,0xc9))[_0xe28d('0x45')](handleError(_0x4ed8e7,null));};exports['update']=function(_0x177106,_0x5f38b8){if(_0x177106[_0xe28d('0x48')]['id']){delete _0x177106[_0xe28d('0x48')]['id'];}return db[_0xe28d('0x2d')][_0xe28d('0x49')]({'where':{'id':_0x177106[_0xe28d('0x4a')]['id']}})[_0xe28d('0x27')](handleEntityNotFound(_0x5f38b8,null))[_0xe28d('0x27')](saveUpdates(_0x177106['body'],null))[_0xe28d('0x27')](respondWithResult(_0x5f38b8,null))[_0xe28d('0x45')](handleError(_0x5f38b8,null));};exports[_0xe28d('0x26')]=function(_0x3c883d,_0x588bd9){return db['VoiceTransferReport'][_0xe28d('0x49')]({'where':{'id':_0x3c883d[_0xe28d('0x4a')]['id']}})[_0xe28d('0x27')](handleEntityNotFound(_0x588bd9,null))[_0xe28d('0x27')](removeEntity(_0x588bd9,null))[_0xe28d('0x45')](handleError(_0x588bd9,null));};exports[_0xe28d('0x4b')]=function(_0x1e5778,_0x2d3ea5){return db[_0xe28d('0x2d')][_0xe28d('0x4b')]()[_0xe28d('0x27')](respondWithResult(_0x2d3ea5,null))[_0xe28d('0x45')](handleError(_0x2d3ea5,null));}; \ No newline at end of file +var _0x4af2=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','VoiceTransferReport','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','crypto'];(function(_0x467746,_0x52f989){var _0x1222e2=function(_0x30febe){while(--_0x30febe){_0x467746['push'](_0x467746['shift']());}};_0x1222e2(++_0x52f989);}(_0x4af2,0x1f3));var _0x24af=function(_0x24101d,_0x5f0411){_0x24101d=_0x24101d-0x0;var _0x4c484c=_0x4af2[_0x24101d];return _0x4c484c;};'use strict';var emlformat=require(_0x24af('0x0'));var rimraf=require(_0x24af('0x1'));var zipdir=require(_0x24af('0x2'));var jsonpatch=require(_0x24af('0x3'));var rp=require('request-promise');var moment=require(_0x24af('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x24af('0x5'));var path=require(_0x24af('0x6'));var sox=require(_0x24af('0x7'));var csv=require(_0x24af('0x8'));var ejs=require(_0x24af('0x9'));var fs=require('fs');var fs_extra=require(_0x24af('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x24af('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x24af('0xc'));var toCsv=require(_0x24af('0x8'));var querystring=require('querystring');var Papa=require(_0x24af('0xd'));var Redis=require(_0x24af('0xe'));var authService=require(_0x24af('0xf'));var qs=require(_0x24af('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x24af('0x11'));var logger=require(_0x24af('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x24af('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x24af('0x14'))['db'];function respondWithStatusCode(_0x1dc9d8,_0xce7855){_0xce7855=_0xce7855||0xcc;return function(_0x47b272){if(_0x47b272){return _0x1dc9d8[_0x24af('0x15')](_0xce7855);}return _0x1dc9d8[_0x24af('0x16')](_0xce7855)[_0x24af('0x17')]();};}function respondWithResult(_0x242ad9,_0x42fd93){_0x42fd93=_0x42fd93||0xc8;return function(_0x450747){if(_0x450747){return _0x242ad9['status'](_0x42fd93)[_0x24af('0x18')](_0x450747);}};}function respondWithFilteredResult(_0xa5f441,_0x47bf82){return function(_0x121a08){if(_0x121a08){var _0x33159e=typeof _0x47bf82[_0x24af('0x19')]==='undefined'&&typeof _0x47bf82[_0x24af('0x1a')]===_0x24af('0x1b');var _0xa85827=_0x121a08[_0x24af('0x1c')];var _0x333bc6=_0x33159e?0x0:_0x47bf82[_0x24af('0x19')];var _0x10cd3f=_0x33159e?_0x121a08[_0x24af('0x1c')]:_0x47bf82[_0x24af('0x19')]+_0x47bf82[_0x24af('0x1a')];var _0x575e91;if(_0x10cd3f>=_0xa85827){_0x10cd3f=_0xa85827;_0x575e91=0xc8;}else{_0x575e91=0xce;}_0xa5f441[_0x24af('0x16')](_0x575e91);return _0xa5f441[_0x24af('0x1d')](_0x24af('0x1e'),_0x333bc6+'-'+_0x10cd3f+'/'+_0xa85827)['json'](_0x121a08);}return null;};}function patchUpdates(_0x1c2da7){return function(_0x22ab56){try{jsonpatch[_0x24af('0x1f')](_0x22ab56,_0x1c2da7,!![]);}catch(_0x4a4ce4){return BPromise[_0x24af('0x20')](_0x4a4ce4);}return _0x22ab56['save']();};}function saveUpdates(_0x330c08,_0x5187a7){return function(_0x4a6ca6){if(_0x4a6ca6){return _0x4a6ca6[_0x24af('0x21')](_0x330c08)['then'](function(_0x5e3385){return _0x5e3385;});}return null;};}function removeEntity(_0x4ad7d1,_0x88e5a6){return function(_0x4d185f){if(_0x4d185f){return _0x4d185f[_0x24af('0x22')]()[_0x24af('0x23')](function(){_0x4ad7d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23b8e1,_0x20489e){return function(_0x47b8ad){if(!_0x47b8ad){_0x23b8e1[_0x24af('0x15')](0x194);}return _0x47b8ad;};}function handleError(_0x267c92,_0x4047a7){_0x4047a7=_0x4047a7||0x1f4;return function(_0x32e71f){logger[_0x24af('0x24')](_0x32e71f[_0x24af('0x25')]);if(_0x32e71f[_0x24af('0x26')]){delete _0x32e71f[_0x24af('0x26')];}_0x267c92[_0x24af('0x16')](_0x4047a7)[_0x24af('0x27')](_0x32e71f);};}exports[_0x24af('0x28')]=function(_0x3746c6,_0x19caf7){var _0xfb7554={},_0x25ccdb={},_0x34dc69={'count':0x0,'rows':[]};var _0x34739e=_[_0x24af('0x29')](db['VoiceTransferReport']['rawAttributes'],function(_0x2cb8b5){return{'name':_0x2cb8b5[_0x24af('0x2a')],'type':_0x2cb8b5[_0x24af('0x2b')]['key']};});_0x25ccdb['model']=_[_0x24af('0x29')](_0x34739e,'name');_0x25ccdb[_0x24af('0x2c')]=_[_0x24af('0x2d')](_0x3746c6[_0x24af('0x2c')]);_0x25ccdb[_0x24af('0x2e')]=_[_0x24af('0x2f')](_0x25ccdb[_0x24af('0x30')],_0x25ccdb[_0x24af('0x2c')]);_0xfb7554[_0x24af('0x31')]=_['intersection'](_0x25ccdb[_0x24af('0x30')],qs[_0x24af('0x32')](_0x3746c6['query'][_0x24af('0x32')]));_0xfb7554[_0x24af('0x31')]=_0xfb7554['attributes'][_0x24af('0x33')]?_0xfb7554[_0x24af('0x31')]:_0x25ccdb['model'];if(!_0x3746c6['query'][_0x24af('0x34')]('nolimit')){_0xfb7554[_0x24af('0x1a')]=qs[_0x24af('0x1a')](_0x3746c6[_0x24af('0x2c')][_0x24af('0x1a')]);_0xfb7554[_0x24af('0x19')]=qs[_0x24af('0x19')](_0x3746c6['query'][_0x24af('0x19')]);}_0xfb7554[_0x24af('0x35')]=qs[_0x24af('0x36')](_0x3746c6['query']['sort']);_0xfb7554[_0x24af('0x37')]=qs[_0x24af('0x2e')](_[_0x24af('0x38')](_0x3746c6['query'],_0x25ccdb['filters']),_0x34739e);if(_0x3746c6['query'][_0x24af('0x39')]){_0xfb7554[_0x24af('0x37')]=_[_0x24af('0x3a')](_0xfb7554[_0x24af('0x37')],{'$or':_[_0x24af('0x29')](_0x34739e,function(_0x48dbc4){if(_0x48dbc4[_0x24af('0x2b')]!==_0x24af('0x3b')){var _0x4a1023={};_0x4a1023[_0x48dbc4[_0x24af('0x26')]]={'$like':'%'+_0x3746c6['query'][_0x24af('0x39')]+'%'};return _0x4a1023;}})});}_0xfb7554=_['merge']({},_0xfb7554,_0x3746c6['options']);var _0x56a998={'where':_0xfb7554[_0x24af('0x37')]};return db['VoiceTransferReport'][_0x24af('0x1c')](_0x56a998)[_0x24af('0x23')](function(_0x23e362){_0x34dc69['count']=_0x23e362;if(_0x3746c6[_0x24af('0x2c')]['includeAll']){_0xfb7554[_0x24af('0x3c')]=[{'all':!![]}];}return db[_0x24af('0x3d')]['findAll'](_0xfb7554);})['then'](function(_0xaacffe){_0x34dc69[_0x24af('0x3e')]=_0xaacffe;return _0x34dc69;})[_0x24af('0x23')](respondWithFilteredResult(_0x19caf7,_0xfb7554))[_0x24af('0x3f')](handleError(_0x19caf7,null));};exports[_0x24af('0x40')]=function(_0x101f86,_0x48f621){var _0x1b40e7={'raw':!![],'where':{'id':_0x101f86[_0x24af('0x41')]['id']}},_0x30e893={};_0x30e893[_0x24af('0x30')]=_[_0x24af('0x2d')](db[_0x24af('0x3d')][_0x24af('0x42')]);_0x30e893[_0x24af('0x2c')]=_['keys'](_0x101f86[_0x24af('0x2c')]);_0x30e893['filters']=_['intersection'](_0x30e893['model'],_0x30e893[_0x24af('0x2c')]);_0x1b40e7['attributes']=_['intersection'](_0x30e893[_0x24af('0x30')],qs[_0x24af('0x32')](_0x101f86[_0x24af('0x2c')][_0x24af('0x32')]));_0x1b40e7[_0x24af('0x31')]=_0x1b40e7[_0x24af('0x31')][_0x24af('0x33')]?_0x1b40e7['attributes']:_0x30e893[_0x24af('0x30')];if(_0x101f86[_0x24af('0x2c')][_0x24af('0x43')]){_0x1b40e7[_0x24af('0x3c')]=[{'all':!![]}];}_0x1b40e7=_[_0x24af('0x3a')]({},_0x1b40e7,_0x101f86[_0x24af('0x44')]);return db[_0x24af('0x3d')][_0x24af('0x45')](_0x1b40e7)[_0x24af('0x23')](handleEntityNotFound(_0x48f621,null))[_0x24af('0x23')](respondWithResult(_0x48f621,null))['catch'](handleError(_0x48f621,null));};exports['create']=function(_0x39f892,_0x470ac0){return db[_0x24af('0x3d')][_0x24af('0x46')](_0x39f892[_0x24af('0x47')],{})['then'](respondWithResult(_0x470ac0,0xc9))[_0x24af('0x3f')](handleError(_0x470ac0,null));};exports[_0x24af('0x21')]=function(_0x1ae9ce,_0x4dae7d){if(_0x1ae9ce['body']['id']){delete _0x1ae9ce[_0x24af('0x47')]['id'];}return db[_0x24af('0x3d')][_0x24af('0x45')]({'where':{'id':_0x1ae9ce[_0x24af('0x41')]['id']}})[_0x24af('0x23')](handleEntityNotFound(_0x4dae7d,null))['then'](saveUpdates(_0x1ae9ce[_0x24af('0x47')],null))[_0x24af('0x23')](respondWithResult(_0x4dae7d,null))[_0x24af('0x3f')](handleError(_0x4dae7d,null));};exports[_0x24af('0x22')]=function(_0x159b5e,_0x1a6bd2){return db[_0x24af('0x3d')][_0x24af('0x45')]({'where':{'id':_0x159b5e[_0x24af('0x41')]['id']}})[_0x24af('0x23')](handleEntityNotFound(_0x1a6bd2,null))['then'](removeEntity(_0x1a6bd2,null))[_0x24af('0x3f')](handleError(_0x1a6bd2,null));};exports[_0x24af('0x48')]=function(_0xd9a330,_0x215a28){return db[_0x24af('0x3d')][_0x24af('0x48')]()[_0x24af('0x23')](respondWithResult(_0x215a28,null))['catch'](handleError(_0x215a28,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 650774a..f7b5f6f 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 _0x63b2=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./voiceTransferReport.attributes','VoiceTransferReport','report_call_transfer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63b2,0xdc));var _0x263b=function(_0x26d4d1,_0x239884){_0x26d4d1=_0x26d4d1-0x0;var _0x45432c=_0x63b2[_0x26d4d1];return _0x45432c;};'use strict';var _=require(_0x263b('0x0'));var util=require(_0x263b('0x1'));var logger=require(_0x263b('0x2'))('api');var moment=require(_0x263b('0x3'));var BPromise=require(_0x263b('0x4'));var rp=require(_0x263b('0x5'));var fs=require('fs');var path=require(_0x263b('0x6'));var rimraf=require('rimraf');var config=require(_0x263b('0x7'));var attributes=require(_0x263b('0x8'));module['exports']=function(_0x27c851,_0x3501f3){return _0x27c851['define'](_0x263b('0x9'),attributes,{'tableName':_0x263b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2be8=['./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2a9b9b,_0x14c245){var _0x5139a8=function(_0x2c72a3){while(--_0x2c72a3){_0x2a9b9b['push'](_0x2a9b9b['shift']());}};_0x5139a8(++_0x14c245);}(_0x2be8,0x146));var _0x82be=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0x2be8[_0x429948];return _0x35d5d1;};'use strict';var _=require(_0x82be('0x0'));var util=require(_0x82be('0x1'));var logger=require(_0x82be('0x2'))(_0x82be('0x3'));var moment=require(_0x82be('0x4'));var BPromise=require(_0x82be('0x5'));var rp=require(_0x82be('0x6'));var fs=require('fs');var path=require(_0x82be('0x7'));var rimraf=require(_0x82be('0x8'));var config=require(_0x82be('0x9'));var attributes=require(_0x82be('0xa'));module[_0x82be('0xb')]=function(_0x453c36,_0x1186c2){return _0x453c36[_0x82be('0xc')]('VoiceTransferReport',attributes,{'tableName':_0x82be('0xd'),'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 ed804f7..cb624e5 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 _0xf73a=['CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','code','error','VoiceTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x158d07,_0x4a59e3){var _0x40ef6c=function(_0x2b32ca){while(--_0x2b32ca){_0x158d07['push'](_0x158d07['shift']());}};_0x40ef6c(++_0x4a59e3);}(_0xf73a,0xc2));var _0xaf73=function(_0x1ef8a2,_0xb43031){_0x1ef8a2=_0x1ef8a2-0x0;var _0x227937=_0xf73a[_0x1ef8a2];return _0x227937;};'use strict';var _=require(_0xaf73('0x0'));var util=require('util');var moment=require(_0xaf73('0x1'));var BPromise=require(_0xaf73('0x2'));var rs=require(_0xaf73('0x3'));var fs=require('fs');var Redis=require(_0xaf73('0x4'));var db=require(_0xaf73('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf73('0x6'))('rpc');var config=require(_0xaf73('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaf73('0x8')][_0xaf73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xacdbc6,_0x10665c,_0x1c5611){return new BPromise(function(_0x550375,_0x233687){return client[_0xaf73('0xa')](_0xacdbc6,_0x1c5611)[_0xaf73('0xb')](function(_0x314dcf){logger[_0xaf73('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x10665c,_0xaf73('0xd'));logger[_0xaf73('0xe')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x10665c,_0xaf73('0xd'),JSON[_0xaf73('0xf')](_0x314dcf));if(_0x314dcf['error']){if(_0x314dcf['error'][_0xaf73('0x10')]===0x1f4){logger[_0xaf73('0x11')](_0xaf73('0x12'),_0x10665c,_0x314dcf['error'][_0xaf73('0x13')]);return _0x233687(_0x314dcf['error'][_0xaf73('0x13')]);}logger[_0xaf73('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x10665c,_0x314dcf['error'][_0xaf73('0x13')]);return _0x550375(_0x314dcf[_0xaf73('0x11')][_0xaf73('0x13')]);}else{logger[_0xaf73('0xc')](_0xaf73('0x12'),_0x10665c,_0xaf73('0xd'));_0x550375(_0x314dcf[_0xaf73('0x14')]['message']);}})[_0xaf73('0x15')](function(_0x532748){logger[_0xaf73('0x11')](_0xaf73('0x12'),_0x10665c,_0x532748);_0x233687(_0x532748);});});}exports[_0xaf73('0x16')]=function(_0xb55a57){var _0x56cd45=this;return new Promise(function(_0x498298,_0x424a48){return db[_0xaf73('0x17')]['create'](_0xb55a57[_0xaf73('0x18')],{'raw':_0xb55a57[_0xaf73('0x19')]?_0xb55a57[_0xaf73('0x19')][_0xaf73('0x1a')]===undefined?!![]:![]:!![]})[_0xaf73('0xb')](function(_0x4f524b){logger[_0xaf73('0xc')](_0xaf73('0x16'),_0xb55a57);logger['debug'](_0xaf73('0x16'),_0xb55a57,JSON[_0xaf73('0xf')](_0x4f524b));_0x498298(_0x4f524b);})[_0xaf73('0x15')](function(_0x52a00e){logger[_0xaf73('0x11')](_0xaf73('0x16'),_0x52a00e['message'],_0xb55a57);_0x424a48(_0x56cd45[_0xaf73('0x11')](0x1f4,_0x52a00e[_0xaf73('0x13')]));});});}; \ No newline at end of file +var _0x5a55=['catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','then','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x32c961,_0x170cc7){var _0x5779e7=function(_0x43dc17){while(--_0x43dc17){_0x32c961['push'](_0x32c961['shift']());}};_0x5779e7(++_0x170cc7);}(_0x5a55,0x1b7));var _0x55a5=function(_0x4f0c2b,_0x2c9d14){_0x4f0c2b=_0x4f0c2b-0x0;var _0x526436=_0x5a55[_0x4f0c2b];return _0x526436;};'use strict';var _=require(_0x55a5('0x0'));var util=require(_0x55a5('0x1'));var moment=require(_0x55a5('0x2'));var BPromise=require(_0x55a5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55a5('0x4'));var db=require(_0x55a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x55a5('0x6'))(_0x55a5('0x7'));var config=require(_0x55a5('0x8'));var jayson=require(_0x55a5('0x9'));var client=jayson[_0x55a5('0xa')][_0x55a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31534b,_0x1d61fb,_0x20ac40){return new BPromise(function(_0x1f7ac9,_0x133d5e){return client['request'](_0x31534b,_0x20ac40)['then'](function(_0x4d582b){logger[_0x55a5('0xc')](_0x55a5('0xd'),_0x1d61fb,_0x55a5('0xe'));logger['debug'](_0x55a5('0xf'),_0x1d61fb,_0x55a5('0xe'),JSON['stringify'](_0x4d582b));if(_0x4d582b[_0x55a5('0x10')]){if(_0x4d582b[_0x55a5('0x10')][_0x55a5('0x11')]===0x1f4){logger[_0x55a5('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x1d61fb,_0x4d582b[_0x55a5('0x10')][_0x55a5('0x12')]);return _0x133d5e(_0x4d582b['error']['message']);}logger['error'](_0x55a5('0xd'),_0x1d61fb,_0x4d582b[_0x55a5('0x10')][_0x55a5('0x12')]);return _0x1f7ac9(_0x4d582b[_0x55a5('0x10')][_0x55a5('0x12')]);}else{logger[_0x55a5('0xc')](_0x55a5('0xd'),_0x1d61fb,'request\x20sent');_0x1f7ac9(_0x4d582b[_0x55a5('0x13')][_0x55a5('0x12')]);}})[_0x55a5('0x14')](function(_0x1a5323){logger[_0x55a5('0x10')](_0x55a5('0xd'),_0x1d61fb,_0x1a5323);_0x133d5e(_0x1a5323);});});}exports[_0x55a5('0x15')]=function(_0x453b1e){var _0x201c42=this;return new Promise(function(_0x4569ce,_0x28de4e){return db[_0x55a5('0x16')]['create'](_0x453b1e[_0x55a5('0x17')],{'raw':_0x453b1e[_0x55a5('0x18')]?_0x453b1e[_0x55a5('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x55a5('0x19')](function(_0x394ca7){logger[_0x55a5('0xc')](_0x55a5('0x15'),_0x453b1e);logger['debug'](_0x55a5('0x15'),_0x453b1e,JSON[_0x55a5('0x1a')](_0x394ca7));_0x4569ce(_0x394ca7);})[_0x55a5('0x14')](function(_0x3a4fc3){logger[_0x55a5('0x10')](_0x55a5('0x15'),_0x3a4fc3[_0x55a5('0x12')],_0x453b1e);_0x28de4e(_0x201c42['error'](0x1f4,_0x3a4fc3[_0x55a5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 3a1dcc4..0bd3ea7 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['/unhold','unhold','/calls','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','isAuthenticated','hangup','hold'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2867d8,_0xef3ee0){_0x2867d8=_0x2867d8-0x0;var _0x3b8176=_0xcb91[_0x2867d8];return _0x3b8176;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x1cb9('0x0'));var controller=require(_0x1cb9('0x1'));router[_0x1cb9('0x2')](_0x1cb9('0x3'),auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x5')]);router['post'](_0x1cb9('0x6'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x2')]('/answer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['answer']);router[_0x1cb9('0x2')]('/hold',auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x2')](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0x2')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['calls']);router['post']('/transfer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0xd')]);module[_0x1cb9('0xe')]=router; \ No newline at end of file +var _0xaa88=['/hold','/unhold','/calls','calls','transfer','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer'];(function(_0xbc3c04,_0x4ca068){var _0x47d64b=function(_0x4332d1){while(--_0x4332d1){_0xbc3c04['push'](_0xbc3c04['shift']());}};_0x47d64b(++_0x4ca068);}(_0xaa88,0x137));var _0x8aa8=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0xaa88[_0xbb9dbf];return _0x30223c;};'use strict';var express=require(_0x8aa8('0x0'));var router=express[_0x8aa8('0x1')]();var auth=require(_0x8aa8('0x2'));var controller=require(_0x8aa8('0x3'));router['post'](_0x8aa8('0x4'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x7')]);router[_0x8aa8('0x8')](_0x8aa8('0x9'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x8aa8('0xa')]);router['post'](_0x8aa8('0xb'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0xc')]);router['post'](_0x8aa8('0xd'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller['hold']);router[_0x8aa8('0x8')](_0x8aa8('0xe'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller['unhold']);router[_0x8aa8('0x8')](_0x8aa8('0xf'),auth['isAuthenticated'](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x10')]);router[_0x8aa8('0x8')]('/transfer',auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 0a137c2..6a88cb4 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 _0x01fe=['webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','VoiceChannels','all','conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','path','../../mysqldb','../../config/environment','jayson/promise','client','http','../../config/logger','ioredis','defaults','redis','localhost','socket.io-emitter','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','status','send','NotFound','request','then','code','message','result','catch','findOne','agent','filter','rows','UserId','length','\x20not\x20found!','originate','originate\x20fired:','validate','body','userId','callNumber','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','json','sessionId','user:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01fe,0x102));var _0xe01f=function(_0x10000c,_0x4e501f){_0x10000c=_0x10000c-0x0;var _0x39df6b=_0x01fe[_0x10000c];return _0x39df6b;};'use strict';var path=require(_0xe01f('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0xe01f('0x1'))['db'];var config=require(_0xe01f('0x2'));var util=require('util');var BPromise=require('bluebird');var jayson=require(_0xe01f('0x3'));var amiClient=jayson[_0xe01f('0x4')][_0xe01f('0x5')]({'port':0x232a});var logger=require(_0xe01f('0x6'))('webbarapi');var Redis=require(_0xe01f('0x7'));config['redis']=_[_0xe01f('0x8')](config[_0xe01f('0x9')],{'host':_0xe01f('0xa'),'port':0x18eb});var io=require(_0xe01f('0xb'))(new Redis(config[_0xe01f('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xe01f('0xc'),'required':[!![],_0xe01f('0xd')]},'callNumber':{'type':'string','required':[!![],_0xe01f('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xe01f('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xe01f('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xe01f('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe01f('0xd')]},'sessionId':{'type':_0xe01f('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xe01f('0xc'),'required':[!![],_0xe01f('0xd')]},'sessionId':{'type':_0xe01f('0xf'),'required':[!![],_0xe01f('0x10')]},'transferNumber':{'type':_0xe01f('0xf'),'required':[!![],_0xe01f('0x11')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe01f('0xd')]},'sessionId':{'type':_0xe01f('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe01f('0xc'),'required':[!![],_0xe01f('0xd')]},'sessionId':{'type':_0xe01f('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xe01f('0xc'),'required':[!![],_0xe01f('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});function emit(_0x5e3877,_0x12540b,_0x14b05d){logger[_0xe01f('0x12')](_0x5e3877,_0x12540b,JSON[_0xe01f('0x13')](_0x14b05d));io['to'](_0x5e3877)[_0xe01f('0x14')](_0x12540b,_0x14b05d);}function handleError(_0x3fad9a){return function(_0x144eef){console[_0xe01f('0x15')](_0xe01f('0x16'),_0x144eef,_0x144eef instanceof RangeError);logger[_0xe01f('0x17')](_0x144eef['stack']);if(_0x144eef instanceof RangeError){if(_0x144eef[_0xe01f('0x18')]){delete _0x144eef['name'];}_0x3fad9a[_0xe01f('0x19')](0x194)[_0xe01f('0x1a')](_0x144eef);}else{if(_0x144eef[_0xe01f('0x18')]){delete _0x144eef[_0xe01f('0x18')];}_0x3fad9a['status'](0x1f4)[_0xe01f('0x1a')](_0x144eef);}};}function checkError(){return function(_0xb9343e){if(!_0xb9343e){throw new RangeError(_0xe01f('0x1b'));}return _0xb9343e;};}function respondWithRpcPromise(_0x1f0cfd,_0x369b7e){return new BPromise(function(_0x3c34fa,_0x570d48){var _0x1faeb8=amiClient;return _0x1faeb8[_0xe01f('0x1c')](_0x1f0cfd,_0x369b7e)[_0xe01f('0x1d')](function(_0xa6da95){if(_0xa6da95[_0xe01f('0x17')]){if(_0xa6da95[_0xe01f('0x17')][_0xe01f('0x1e')]===0x1f4){return _0x570d48(_0xa6da95[_0xe01f('0x17')][_0xe01f('0x1f')]);}return _0x3c34fa(_0xa6da95['error']['message']);}else{_0x3c34fa(_0xa6da95[_0xe01f('0x20')]);}})[_0xe01f('0x21')](function(_0x3f92ca){_0x570d48(_0x3f92ca);});});}function getAgent(_0x3ec80a){return db['User'][_0xe01f('0x22')]({'where':{'id':_0x3ec80a,'role':_0xe01f('0x23')}})['then'](checkError());}function getAgentCheckSession(_0x378c93,_0x5b9c5e){return new BPromise(function(_0x1b77c8,_0x387044){var _0x13dcd4=respondWithRpcPromise('VoiceChannels');var _0x940cb6=getAgent(_0x378c93);Promise['all']([_0x13dcd4,_0x940cb6])[_0xe01f('0x1d')](function(_0x232ad1){var _0x2e4568=_0x232ad1[0x0];var _0x2dbc94=_0x232ad1[0x1];var _0x35bd53=_[_0xe01f('0x24')](_0x2e4568[_0xe01f('0x25')],function(_0x41d13d){return _0x41d13d[_0xe01f('0x26')]==_0x2dbc94['id']&&_0x41d13d['sessionId']==_0x5b9c5e;});if(_0x35bd53[_0xe01f('0x27')]==0x1){_0x1b77c8(_0x2dbc94);}else{_0x387044(new RangeError('sessionId\x20'+_0x5b9c5e+_0xe01f('0x28')));}});});}exports[_0xe01f('0x29')]=function(_0x51fe9b,_0x15f98f){logger[_0xe01f('0x12')](_0xe01f('0x2a'),_0x51fe9b['body']);var _0x2e417b=originateValidation[_0xe01f('0x2b')](_0x51fe9b[_0xe01f('0x2c')]);if(_0x2e417b[_0xe01f('0x27')]>0x0){return _0x15f98f[_0xe01f('0x19')](0x190)['json'](_0x2e417b);}var _0x57aed0=_0x51fe9b['body'][_0xe01f('0x2d')];var _0x4c9f2e=_0x51fe9b[_0xe01f('0x2c')][_0xe01f('0x2e')];var _0x463687=_0x51fe9b[_0xe01f('0x2c')][_0xe01f('0x2f')];var _0x83c32=_0x51fe9b[_0xe01f('0x2c')][_0xe01f('0x30')];return getAgent(_0x57aed0)['then'](function(_0x53c309){logger[_0xe01f('0x12')](_0xe01f('0x31'),_0x53c309[_0xe01f('0x18')]);emit(util[_0xe01f('0x32')]('user:%s',_0x53c309[_0xe01f('0x18')]),_0xe01f('0x33'),{'callNumber':_0x4c9f2e,'callerId':_0x463687,'callbackUrl':_0x83c32});return _0x15f98f[_0xe01f('0x19')](0xc8)['json']({'error':![],'message':_0xe01f('0x34')});})[_0xe01f('0x21')](handleError(_0x15f98f));};exports[_0xe01f('0x35')]=function(_0x2fcc0c,_0xddb14b){logger[_0xe01f('0x12')](_0xe01f('0x36'),_0x2fcc0c[_0xe01f('0x2c')]);var _0x29c47f=hangupValidation[_0xe01f('0x2b')](_0x2fcc0c[_0xe01f('0x2c')]);if(_0x29c47f[_0xe01f('0x27')]>0x0){return _0xddb14b[_0xe01f('0x19')](0x190)[_0xe01f('0x37')](_0x29c47f);}var _0x16ab3c=_0x2fcc0c['body'][_0xe01f('0x2d')];var _0x1643a4=_0x2fcc0c[_0xe01f('0x2c')][_0xe01f('0x38')];return getAgent(_0x16ab3c)['then'](function(_0x36783f){logger[_0xe01f('0x12')](_0xe01f('0x31'),_0x36783f[_0xe01f('0x18')]);emit(util[_0xe01f('0x32')](_0xe01f('0x39'),_0x36783f['name']),_0xe01f('0x3a'),{'sessionId':_0x1643a4});return _0xddb14b[_0xe01f('0x19')](0xc8)[_0xe01f('0x37')]({'error':![],'message':_0xe01f('0x3b')});})[_0xe01f('0x21')](handleError(_0xddb14b));};exports[_0xe01f('0x3c')]=function(_0x861971,_0x305659){logger[_0xe01f('0x12')]('answer\x20fired:',_0x861971['body']);var _0x3dd453=answerValidation[_0xe01f('0x2b')](_0x861971['body']);if(_0x3dd453[_0xe01f('0x27')]>0x0){return _0x305659[_0xe01f('0x19')](0x190)[_0xe01f('0x37')](_0x3dd453);}var _0x5625d8=_0x861971[_0xe01f('0x2c')][_0xe01f('0x2d')];var _0x56785b=_0x861971['body']['sessionId'];return getAgent(_0x5625d8)[_0xe01f('0x1d')](function(_0x53c81b){logger[_0xe01f('0x12')]('entityFound:',_0x53c81b[_0xe01f('0x18')]);emit(util[_0xe01f('0x32')](_0xe01f('0x39'),_0x53c81b[_0xe01f('0x18')]),_0xe01f('0x3d'),{'sessionId':_0x56785b});return _0x305659[_0xe01f('0x19')](0xc8)[_0xe01f('0x37')]({'error':![],'message':_0xe01f('0x3e')});})[_0xe01f('0x21')](handleError(_0x305659));};exports[_0xe01f('0x3f')]=function(_0x18bb53,_0x580df5){logger[_0xe01f('0x12')](_0xe01f('0x40'),_0x18bb53[_0xe01f('0x2c')]);var _0x3c3d64=holdValidation[_0xe01f('0x2b')](_0x18bb53['body']);if(_0x3c3d64[_0xe01f('0x27')]>0x0){return _0x580df5['status'](0x190)['json'](_0x3c3d64);}var _0x25437f=_0x18bb53[_0xe01f('0x2c')][_0xe01f('0x2d')];var _0x1d8614=_0x18bb53[_0xe01f('0x2c')]['sessionId'];return getAgent(_0x25437f)[_0xe01f('0x1d')](function(_0x337c5d){logger[_0xe01f('0x12')](_0xe01f('0x31'),_0x337c5d[_0xe01f('0x18')]);emit(util[_0xe01f('0x32')](_0xe01f('0x39'),_0x337c5d['name']),_0xe01f('0x41'),{'sessionId':_0x1d8614});return _0x580df5['status'](0xc8)[_0xe01f('0x37')]({'error':![],'message':_0xe01f('0x42')});})['catch'](handleError(_0x580df5));};exports[_0xe01f('0x43')]=function(_0x100742,_0x457bb0){logger[_0xe01f('0x12')](_0xe01f('0x44'),_0x100742[_0xe01f('0x2c')]);var _0x5b04b5=unholdValidation['validate'](_0x100742[_0xe01f('0x2c')]);if(_0x5b04b5[_0xe01f('0x27')]>0x0){return _0x457bb0['status'](0x190)[_0xe01f('0x37')](_0x5b04b5);}var _0x38c8ef=_0x100742[_0xe01f('0x2c')][_0xe01f('0x2d')];var _0x56d558=_0x100742[_0xe01f('0x2c')]['sessionId'];return getAgent(_0x38c8ef)[_0xe01f('0x1d')](function(_0xfbce52){logger['info'](_0xe01f('0x31'),_0xfbce52[_0xe01f('0x18')]);emit(util[_0xe01f('0x32')](_0xe01f('0x39'),_0xfbce52[_0xe01f('0x18')]),_0xe01f('0x45'),{'sessionId':_0x56d558});return _0x457bb0['status'](0xc8)[_0xe01f('0x37')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x457bb0));};exports[_0xe01f('0x46')]=function(_0x2d53cb,_0x2161b4){logger[_0xe01f('0x12')](_0xe01f('0x47'),_0x2161b4[_0xe01f('0x2c')]);var _0x3949e1=callsValidation[_0xe01f('0x2b')](_0x2d53cb['body']);if(_0x3949e1['length']>0x0){return _0x2161b4[_0xe01f('0x19')](0x190)['json'](_0x3949e1);}var _0x3ee275=_0x2d53cb[_0xe01f('0x2c')][_0xe01f('0x2d')];var _0x33a11b=respondWithRpcPromise(_0xe01f('0x48'));var _0x4dfb61=getAgent(_0x3ee275);return Promise[_0xe01f('0x49')]([_0x33a11b,_0x4dfb61])[_0xe01f('0x1d')](function(_0x4c6d3f){var _0x3bda53=_0x4c6d3f[0x0];var _0x4dd65c=_0x4c6d3f[0x1];var _0xfb20c6=_['filter'](_0x3bda53[_0xe01f('0x25')],function(_0xe1e5df){return _0xe1e5df[_0xe01f('0x26')]==_0x4dd65c['id'];});return _0x2161b4[_0xe01f('0x19')](0xc8)[_0xe01f('0x37')]({'count':_0xfb20c6[_0xe01f('0x27')],'rows':_0xfb20c6});})[_0xe01f('0x21')](handleError(_0x2161b4));};exports[_0xe01f('0x4a')]=function(_0x5d51e5,_0x1be0f4){logger[_0xe01f('0x12')]('conference\x20fired:',_0x5d51e5[_0xe01f('0x2c')]);var _0x5ca10d=conferenceValidation[_0xe01f('0x2b')](_0x5d51e5[_0xe01f('0x2c')]);if(_0x5ca10d['length']>0x0){return _0x1be0f4[_0xe01f('0x19')](0x190)['json'](_0x5ca10d);}var _0x41c750=_0x5d51e5['body'][_0xe01f('0x2d')];return getAgent(_0x41c750)[_0xe01f('0x1d')](function(_0x141140){logger[_0xe01f('0x12')](_0xe01f('0x31'),_0x141140[_0xe01f('0x18')]);emit(util['format']('user:%s',_0x141140[_0xe01f('0x18')]),'webbar:conference');return _0x1be0f4[_0xe01f('0x19')](0xc8)['json']({'error':![],'message':_0xe01f('0x4b')});})[_0xe01f('0x21')](handleError(_0x1be0f4));};exports[_0xe01f('0x4c')]=function(_0x5a28cc,_0x5e26cb){logger[_0xe01f('0x12')]('transfer\x20fired:',_0x5a28cc['body']);var _0x1a03c6=transferValidation[_0xe01f('0x2b')](_0x5a28cc[_0xe01f('0x2c')]);if(_0x1a03c6[_0xe01f('0x27')]>0x0){return _0x5e26cb[_0xe01f('0x19')](0x190)[_0xe01f('0x37')](_0x1a03c6);}var _0x19b448=_0x5a28cc[_0xe01f('0x2c')][_0xe01f('0x2d')];var _0x526d0a=_0x5a28cc['body']['sessionId'];var _0x47c632=_0x5a28cc[_0xe01f('0x2c')][_0xe01f('0x4d')];return getAgent(_0x19b448)[_0xe01f('0x1d')](function(_0x3e5cb2){logger[_0xe01f('0x12')]('entityFound:',_0x3e5cb2[_0xe01f('0x18')]);emit(util['format'](_0xe01f('0x39'),_0x3e5cb2[_0xe01f('0x18')]),_0xe01f('0x4e'),{'sessionId':_0x526d0a,'transferNumber':_0x47c632});return _0x5e26cb[_0xe01f('0x19')](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})[_0xe01f('0x21')](handleError(_0x5e26cb));}; \ No newline at end of file +var _0xa8a8=['webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','catch','findOne','agent','all','filter','rows','UserId','sessionId','length','sessionId\x20','body','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','hangup','json','userId','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','calls','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber'];(function(_0x43d58e,_0xf624a5){var _0x561951=function(_0x511374){while(--_0x511374){_0x43d58e['push'](_0x43d58e['shift']());}};_0x561951(++_0xf624a5);}(_0xa8a8,0xec));var _0x8a8a=function(_0xba3bb7,_0x994199){_0xba3bb7=_0xba3bb7-0x0;var _0x183e31=_0xa8a8[_0xba3bb7];return _0x183e31;};'use strict';var path=require(_0x8a8a('0x0'));var fs=require('fs');var _=require(_0x8a8a('0x1'));var db=require(_0x8a8a('0x2'))['db'];var config=require(_0x8a8a('0x3'));var util=require('util');var BPromise=require(_0x8a8a('0x4'));var jayson=require(_0x8a8a('0x5'));var amiClient=jayson[_0x8a8a('0x6')][_0x8a8a('0x7')]({'port':0x232a});var logger=require(_0x8a8a('0x8'))(_0x8a8a('0x9'));var Redis=require(_0x8a8a('0xa'));config[_0x8a8a('0xb')]=_[_0x8a8a('0xc')](config[_0x8a8a('0xb')],{'host':_0x8a8a('0xd'),'port':0x18eb});var io=require(_0x8a8a('0xe'))(new Redis(config[_0x8a8a('0xb')]));var Schema=require(_0x8a8a('0xf'));var originateValidation=new Schema({'userId':{'type':_0x8a8a('0x10'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x8a8a('0x11')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x8a8a('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0x8a8a('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x8a8a('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x8a8a('0x10'),'required':[!![],_0x8a8a('0x13')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x8a8a('0x10'),'required':[!![],_0x8a8a('0x13')]},'sessionId':{'type':_0x8a8a('0x12'),'required':[!![],_0x8a8a('0x14')]},'transferNumber':{'type':'string','required':[!![],_0x8a8a('0x15')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8a8a('0x13')]},'sessionId':{'type':_0x8a8a('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x8a8a('0x10'),'required':[!![],_0x8a8a('0x13')]},'sessionId':{'type':_0x8a8a('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x8a8a('0x10'),'required':[!![],_0x8a8a('0x13')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8a8a('0x13')]}});function emit(_0x568b83,_0x1f36b6,_0x3046ae){logger[_0x8a8a('0x16')](_0x568b83,_0x1f36b6,JSON[_0x8a8a('0x17')](_0x3046ae));io['to'](_0x568b83)[_0x8a8a('0x18')](_0x1f36b6,_0x3046ae);}function handleError(_0x5dd616){return function(_0x9d55f9){console[_0x8a8a('0x19')](_0x8a8a('0x1a'),_0x9d55f9,_0x9d55f9 instanceof RangeError);logger[_0x8a8a('0x1b')](_0x9d55f9[_0x8a8a('0x1c')]);if(_0x9d55f9 instanceof RangeError){if(_0x9d55f9[_0x8a8a('0x1d')]){delete _0x9d55f9['name'];}_0x5dd616['status'](0x194)['send'](_0x9d55f9);}else{if(_0x9d55f9['name']){delete _0x9d55f9['name'];}_0x5dd616[_0x8a8a('0x1e')](0x1f4)[_0x8a8a('0x1f')](_0x9d55f9);}};}function checkError(){return function(_0xe0f449){if(!_0xe0f449){throw new RangeError(_0x8a8a('0x20'));}return _0xe0f449;};}function respondWithRpcPromise(_0x22ebd4,_0x2f6af2){return new BPromise(function(_0x242bac,_0xe0321c){var _0x25d5d4=amiClient;return _0x25d5d4[_0x8a8a('0x21')](_0x22ebd4,_0x2f6af2)[_0x8a8a('0x22')](function(_0x3aa2bb){if(_0x3aa2bb[_0x8a8a('0x1b')]){if(_0x3aa2bb[_0x8a8a('0x1b')][_0x8a8a('0x23')]===0x1f4){return _0xe0321c(_0x3aa2bb['error'][_0x8a8a('0x24')]);}return _0x242bac(_0x3aa2bb[_0x8a8a('0x1b')][_0x8a8a('0x24')]);}else{_0x242bac(_0x3aa2bb[_0x8a8a('0x25')]);}})[_0x8a8a('0x26')](function(_0x251315){_0xe0321c(_0x251315);});});}function getAgent(_0x3aa46d){return db['User'][_0x8a8a('0x27')]({'where':{'id':_0x3aa46d,'role':_0x8a8a('0x28')}})[_0x8a8a('0x22')](checkError());}function getAgentCheckSession(_0x54ff7e,_0x58f42b){return new BPromise(function(_0x2dafcd,_0x129d11){var _0x5c70bd=respondWithRpcPromise('VoiceChannels');var _0x4b3bc5=getAgent(_0x54ff7e);Promise[_0x8a8a('0x29')]([_0x5c70bd,_0x4b3bc5])['then'](function(_0x10b916){var _0xdd6221=_0x10b916[0x0];var _0x49ea81=_0x10b916[0x1];var _0x36c7f8=_[_0x8a8a('0x2a')](_0xdd6221[_0x8a8a('0x2b')],function(_0x8df0cb){return _0x8df0cb[_0x8a8a('0x2c')]==_0x49ea81['id']&&_0x8df0cb[_0x8a8a('0x2d')]==_0x58f42b;});if(_0x36c7f8[_0x8a8a('0x2e')]==0x1){_0x2dafcd(_0x49ea81);}else{_0x129d11(new RangeError(_0x8a8a('0x2f')+_0x58f42b+'\x20not\x20found!'));}});});}exports['originate']=function(_0x56e79e,_0x2a00a7){logger[_0x8a8a('0x16')]('originate\x20fired:',_0x56e79e[_0x8a8a('0x30')]);var _0x304e83=originateValidation['validate'](_0x56e79e[_0x8a8a('0x30')]);if(_0x304e83[_0x8a8a('0x2e')]>0x0){return _0x2a00a7[_0x8a8a('0x1e')](0x190)['json'](_0x304e83);}var _0x5bee53=_0x56e79e[_0x8a8a('0x30')]['userId'];var _0x2a3198=_0x56e79e[_0x8a8a('0x30')][_0x8a8a('0x31')];var _0x196698=_0x56e79e[_0x8a8a('0x30')][_0x8a8a('0x32')];var _0x37ce45=_0x56e79e[_0x8a8a('0x30')][_0x8a8a('0x33')];return getAgent(_0x5bee53)[_0x8a8a('0x22')](function(_0x27de26){logger[_0x8a8a('0x16')](_0x8a8a('0x34'),_0x27de26[_0x8a8a('0x1d')]);emit(util[_0x8a8a('0x35')](_0x8a8a('0x36'),_0x27de26[_0x8a8a('0x1d')]),_0x8a8a('0x37'),{'callNumber':_0x2a3198,'callerId':_0x196698,'callbackUrl':_0x37ce45});return _0x2a00a7['status'](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0x8a8a('0x26')](handleError(_0x2a00a7));};exports[_0x8a8a('0x38')]=function(_0x376de3,_0x117a5c){logger[_0x8a8a('0x16')]('hangup\x20fired:',_0x376de3['body']);var _0x8d8481=hangupValidation['validate'](_0x376de3[_0x8a8a('0x30')]);if(_0x8d8481['length']>0x0){return _0x117a5c['status'](0x190)[_0x8a8a('0x39')](_0x8d8481);}var _0x1ac761=_0x376de3[_0x8a8a('0x30')][_0x8a8a('0x3a')];var _0x31307c=_0x376de3[_0x8a8a('0x30')][_0x8a8a('0x2d')];return getAgent(_0x1ac761)['then'](function(_0x40d509){logger[_0x8a8a('0x16')](_0x8a8a('0x34'),_0x40d509['name']);emit(util[_0x8a8a('0x35')](_0x8a8a('0x36'),_0x40d509[_0x8a8a('0x1d')]),'webbar:hangup',{'sessionId':_0x31307c});return _0x117a5c[_0x8a8a('0x1e')](0xc8)[_0x8a8a('0x39')]({'error':![],'message':_0x8a8a('0x3b')});})[_0x8a8a('0x26')](handleError(_0x117a5c));};exports[_0x8a8a('0x3c')]=function(_0x3e5b15,_0x4ffdd9){logger['info'](_0x8a8a('0x3d'),_0x3e5b15['body']);var _0x13e0d4=answerValidation[_0x8a8a('0xf')](_0x3e5b15['body']);if(_0x13e0d4['length']>0x0){return _0x4ffdd9[_0x8a8a('0x1e')](0x190)[_0x8a8a('0x39')](_0x13e0d4);}var _0x41d986=_0x3e5b15[_0x8a8a('0x30')]['userId'];var _0x103223=_0x3e5b15['body'][_0x8a8a('0x2d')];return getAgent(_0x41d986)[_0x8a8a('0x22')](function(_0x4c19ff){logger[_0x8a8a('0x16')](_0x8a8a('0x34'),_0x4c19ff[_0x8a8a('0x1d')]);emit(util['format'](_0x8a8a('0x36'),_0x4c19ff[_0x8a8a('0x1d')]),_0x8a8a('0x3e'),{'sessionId':_0x103223});return _0x4ffdd9['status'](0xc8)['json']({'error':![],'message':_0x8a8a('0x3f')});})[_0x8a8a('0x26')](handleError(_0x4ffdd9));};exports[_0x8a8a('0x40')]=function(_0x5c6c98,_0x18449b){logger[_0x8a8a('0x16')](_0x8a8a('0x41'),_0x5c6c98[_0x8a8a('0x30')]);var _0x2d4c11=holdValidation[_0x8a8a('0xf')](_0x5c6c98[_0x8a8a('0x30')]);if(_0x2d4c11[_0x8a8a('0x2e')]>0x0){return _0x18449b[_0x8a8a('0x1e')](0x190)[_0x8a8a('0x39')](_0x2d4c11);}var _0x150b42=_0x5c6c98['body'][_0x8a8a('0x3a')];var _0x3ba9d9=_0x5c6c98[_0x8a8a('0x30')][_0x8a8a('0x2d')];return getAgent(_0x150b42)[_0x8a8a('0x22')](function(_0x2e22b0){logger['info'](_0x8a8a('0x34'),_0x2e22b0[_0x8a8a('0x1d')]);emit(util[_0x8a8a('0x35')](_0x8a8a('0x36'),_0x2e22b0['name']),_0x8a8a('0x42'),{'sessionId':_0x3ba9d9});return _0x18449b[_0x8a8a('0x1e')](0xc8)[_0x8a8a('0x39')]({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x18449b));};exports[_0x8a8a('0x43')]=function(_0x39a8e0,_0xf4b6ee){logger[_0x8a8a('0x16')](_0x8a8a('0x44'),_0x39a8e0[_0x8a8a('0x30')]);var _0x1d1b5c=unholdValidation[_0x8a8a('0xf')](_0x39a8e0[_0x8a8a('0x30')]);if(_0x1d1b5c['length']>0x0){return _0xf4b6ee['status'](0x190)[_0x8a8a('0x39')](_0x1d1b5c);}var _0x10f689=_0x39a8e0['body']['userId'];var _0x171463=_0x39a8e0['body'][_0x8a8a('0x2d')];return getAgent(_0x10f689)['then'](function(_0x4642d5){logger[_0x8a8a('0x16')](_0x8a8a('0x34'),_0x4642d5[_0x8a8a('0x1d')]);emit(util[_0x8a8a('0x35')](_0x8a8a('0x36'),_0x4642d5[_0x8a8a('0x1d')]),_0x8a8a('0x45'),{'sessionId':_0x171463});return _0xf4b6ee[_0x8a8a('0x1e')](0xc8)[_0x8a8a('0x39')]({'error':![],'message':'unhold\x20executed!'});})[_0x8a8a('0x26')](handleError(_0xf4b6ee));};exports[_0x8a8a('0x46')]=function(_0x32a4ed,_0x1e3bf5){logger[_0x8a8a('0x16')]('calls\x20fired:',_0x1e3bf5[_0x8a8a('0x30')]);var _0x140673=callsValidation['validate'](_0x32a4ed['body']);if(_0x140673[_0x8a8a('0x2e')]>0x0){return _0x1e3bf5[_0x8a8a('0x1e')](0x190)[_0x8a8a('0x39')](_0x140673);}var _0x2ba3bf=_0x32a4ed[_0x8a8a('0x30')][_0x8a8a('0x3a')];var _0x5ed59c=respondWithRpcPromise('VoiceChannels');var _0x495371=getAgent(_0x2ba3bf);return Promise[_0x8a8a('0x29')]([_0x5ed59c,_0x495371])['then'](function(_0x3984dd){var _0xb84ee7=_0x3984dd[0x0];var _0x4e1ca8=_0x3984dd[0x1];var _0x225801=_[_0x8a8a('0x2a')](_0xb84ee7[_0x8a8a('0x2b')],function(_0x119fb5){return _0x119fb5['UserId']==_0x4e1ca8['id'];});return _0x1e3bf5[_0x8a8a('0x1e')](0xc8)['json']({'count':_0x225801[_0x8a8a('0x2e')],'rows':_0x225801});})[_0x8a8a('0x26')](handleError(_0x1e3bf5));};exports['conference']=function(_0x254e4c,_0x101543){logger[_0x8a8a('0x16')](_0x8a8a('0x47'),_0x254e4c['body']);var _0x2b9e36=conferenceValidation[_0x8a8a('0xf')](_0x254e4c[_0x8a8a('0x30')]);if(_0x2b9e36['length']>0x0){return _0x101543['status'](0x190)[_0x8a8a('0x39')](_0x2b9e36);}var _0x4a18fb=_0x254e4c['body']['userId'];return getAgent(_0x4a18fb)[_0x8a8a('0x22')](function(_0x7d79a4){logger['info'](_0x8a8a('0x34'),_0x7d79a4['name']);emit(util['format'](_0x8a8a('0x36'),_0x7d79a4[_0x8a8a('0x1d')]),'webbar:conference');return _0x101543[_0x8a8a('0x1e')](0xc8)[_0x8a8a('0x39')]({'error':![],'message':_0x8a8a('0x48')});})[_0x8a8a('0x26')](handleError(_0x101543));};exports[_0x8a8a('0x49')]=function(_0x126dba,_0x4c8272){logger[_0x8a8a('0x16')](_0x8a8a('0x4a'),_0x126dba['body']);var _0x2ce579=transferValidation[_0x8a8a('0xf')](_0x126dba[_0x8a8a('0x30')]);if(_0x2ce579[_0x8a8a('0x2e')]>0x0){return _0x4c8272[_0x8a8a('0x1e')](0x190)[_0x8a8a('0x39')](_0x2ce579);}var _0x81c1dd=_0x126dba[_0x8a8a('0x30')][_0x8a8a('0x3a')];var _0x176ad3=_0x126dba['body'][_0x8a8a('0x2d')];var _0x2f7537=_0x126dba['body'][_0x8a8a('0x4b')];return getAgent(_0x81c1dd)[_0x8a8a('0x22')](function(_0x2640e3){logger[_0x8a8a('0x16')](_0x8a8a('0x34'),_0x2640e3['name']);emit(util[_0x8a8a('0x35')](_0x8a8a('0x36'),_0x2640e3[_0x8a8a('0x1d')]),_0x8a8a('0x4c'),{'sessionId':_0x176ad3,'transferNumber':_0x2f7537});return _0x4c8272[_0x8a8a('0x1e')](0xc8)[_0x8a8a('0x39')]({'error':![],'message':_0x8a8a('0x4d')});})['catch'](handleError(_0x4c8272));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 6ed44e8..8c84b93 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 _0x14a0=['update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappAccount.controller','get','isAuthenticated','/describe','describe','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAgents','addApplications','/:id/notify','notify','/:id/send','put','/:id'];(function(_0x54cfaa,_0x1875de){var _0x27f8b4=function(_0x33194c){while(--_0x33194c){_0x54cfaa['push'](_0x54cfaa['shift']());}};_0x27f8b4(++_0x1875de);}(_0x14a0,0x8e));var _0x014a=function(_0x561680,_0x5b9aea){_0x561680=_0x561680-0x0;var _0x4a196f=_0x14a0[_0x561680];return _0x4a196f;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['get']('/:id',auth[_0x014a('0x9')](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['get'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['getAnswers']);router[_0x014a('0x8')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0xf')]);router[_0x014a('0x8')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x11')]);router[_0x014a('0x12')]('/',auth[_0x014a('0x9')](),controller[_0x014a('0x13')]);router[_0x014a('0x12')]('/:id/dispositions',auth[_0x014a('0x9')](),controller[_0x014a('0x14')]);router['post'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['addAnswer']);router[_0x014a('0x12')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0x15')]);router[_0x014a('0x12')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x16')]);router[_0x014a('0x12')](_0x014a('0x17'),controller[_0x014a('0x18')]);router[_0x014a('0x12')](_0x014a('0x19'),auth[_0x014a('0x9')](),controller['send']);router[_0x014a('0x1a')](_0x014a('0x1b'),auth[_0x014a('0x9')](),controller[_0x014a('0x1c')]);router[_0x014a('0x1d')](_0x014a('0x1b'),auth[_0x014a('0x9')](),controller[_0x014a('0x1e')]);router[_0x014a('0x1d')]('/:id/dispositions',auth[_0x014a('0x9')](),controller['removeDispositions']);router[_0x014a('0x1d')](_0x014a('0xd'),auth[_0x014a('0x9')](),controller[_0x014a('0x1f')]);router[_0x014a('0x1d')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0x20')]);module[_0x014a('0x21')]=router; \ No newline at end of file +var _0xda2d=['/:id','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','util','path','connect-timeout','express','Router','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','put','delete'];(function(_0x24a318,_0x55ba75){var _0x3aa629=function(_0x55f062){while(--_0x55f062){_0x24a318['push'](_0x24a318['shift']());}};_0x3aa629(++_0x55ba75);}(_0xda2d,0x102));var _0xdda2=function(_0x1e2ed5,_0x55acfe){_0x1e2ed5=_0x1e2ed5-0x0;var _0x5bcb50=_0xda2d[_0x1e2ed5];return _0x5bcb50;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['get'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xe')]);router[_0xdda2('0x7')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xdda2('0x7')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x12')]);router[_0xdda2('0x13')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x14')]);router['post'](_0xdda2('0xd'),auth['isAuthenticated'](),controller[_0xdda2('0x15')]);router[_0xdda2('0x13')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x16')]);router['post']('/:id/users',auth[_0xdda2('0x8')](),controller['addAgents']);router[_0xdda2('0x13')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x17')]);router[_0xdda2('0x13')](_0xdda2('0x18'),controller[_0xdda2('0x19')]);router[_0xdda2('0x13')](_0xdda2('0x1a'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1b')]);router[_0xdda2('0x1c')]('/:id',auth[_0xdda2('0x8')](),controller['update']);router[_0xdda2('0x1d')](_0xdda2('0x1e'),auth[_0xdda2('0x8')](),controller['destroy']);router[_0xdda2('0x1d')]('/:id/dispositions',auth[_0xdda2('0x8')](),controller[_0xdda2('0x1f')]);router['delete'](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x20')]);router[_0xdda2('0x1d')](_0xdda2('0x21'),auth['isAuthenticated'](),controller[_0xdda2('0x22')]);module[_0xdda2('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 605cdd5..7e6fcc3 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 _0xd032=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x13ac19,_0xab7647){var _0x3472bb=function(_0x37043e){while(--_0x37043e){_0x13ac19['push'](_0x13ac19['shift']());}};_0x3472bb(++_0xab7647);}(_0xd032,0x153));var _0x2d03=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xd032[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require(_0x2d03('0x0'));var rs=require('randomstring');module[_0x2d03('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x2d03('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x2d03('0x3')]();}},'phone':{'type':Sequelize[_0x2d03('0x2')]},'type':{'type':Sequelize[_0x2d03('0x4')](_0x2d03('0x5'),_0x2d03('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x2d03('0x2')]},'authToken':{'type':Sequelize[_0x2d03('0x2')]},'notificationTemplate':{'type':Sequelize[_0x2d03('0x7')],'defaultValue':function(){return _0x2d03('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x2d03('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2d03('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2d03('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2d03('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2d03('0xa')],'comment':_0x2d03('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x2d03('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x21c314){if(!_0x21c314){this[_0x2d03('0xc')](_0x2d03('0xd'),null);}this[_0x2d03('0xc')]('mandatoryDisposition',_0x21c314);}},'description':{'type':Sequelize[_0x2d03('0x2')]}}; \ No newline at end of file +var _0xcb06=['setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','name','STRING','generate','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x181c02,_0x2f21e6){var _0x17e08c=function(_0x5cd3ba){while(--_0x5cd3ba){_0x181c02['push'](_0x181c02['shift']());}};_0x17e08c(++_0x2f21e6);}(_0xcb06,0x1b5));var _0x6cb0=function(_0x59bd3b,_0x53eff9){_0x59bd3b=_0x59bd3b-0x0;var _0x586c53=_0xcb06[_0x59bd3b];return _0x586c53;};'use strict';var Sequelize=require(_0x6cb0('0x0'));var rs=require(_0x6cb0('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x6cb0('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x6cb0('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x6cb0('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x6cb0('0x3')],'defaultValue':function(){return rs[_0x6cb0('0x4')]();}},'phone':{'type':Sequelize[_0x6cb0('0x3')]},'type':{'type':Sequelize[_0x6cb0('0x5')]('twilio',_0x6cb0('0x6'))},'accountSid':{'type':Sequelize[_0x6cb0('0x3')]},'baseUrl':{'type':Sequelize[_0x6cb0('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6cb0('0x7')],'defaultValue':function(){return _0x6cb0('0x8');}},'notificationSound':{'type':Sequelize[_0x6cb0('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6cb0('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6cb0('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6cb0('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6cb0('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6cb0('0xa')],'comment':_0x6cb0('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x6cb0('0x9')],'defaultValue':![],'comment':_0x6cb0('0xc'),'set':function(_0x32686d){if(!_0x32686d){this[_0x6cb0('0xd')](_0x6cb0('0xe'),null);}this['setDataValue']('mandatoryDisposition',_0x32686d);}},'description':{'type':Sequelize[_0x6cb0('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index e2a1016..516d2dc 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 _0xa045=['receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','push','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','WhatsappAccounts','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','WhatsappAccount','findAll','show','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','WhatsappAccountId','removeDispositions','ids','CannedAnswer','getAnswers','rows','removeAnswers','addAgents','emit','userWhatsappAccount:save','removeAgents','getAgents','User','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','timestamp','message_id','applications','CmContact','difference','createdAt','updatedAt','CompanyId','mobile','from','From','replace','notifications','messageId','isNil','ValidationError','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','ListId','Contacts','DESC','list','omit','contact','WhatsappInteraction','spread','interaction','created','autoclose','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','agent','Start','startRouting'];(function(_0x293499,_0x191b00){var _0x4a0fa7=function(_0x85aee2){while(--_0x85aee2){_0x293499['push'](_0x293499['shift']());}};_0x4a0fa7(++_0x191b00);}(_0xa045,0xd4));var _0x5a04=function(_0x479293,_0x25bba7){_0x479293=_0x479293-0x0;var _0x4aebe4=_0xa045[_0x479293];return _0x4aebe4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a04('0x0'));var zipdir=require(_0x5a04('0x1'));var jsonpatch=require(_0x5a04('0x2'));var rp=require('request-promise');var moment=require(_0x5a04('0x3'));var BPromise=require(_0x5a04('0x4'));var Mustache=require(_0x5a04('0x5'));var util=require(_0x5a04('0x6'));var path=require(_0x5a04('0x7'));var sox=require('sox');var csv=require(_0x5a04('0x8'));var ejs=require(_0x5a04('0x9'));var fs=require('fs');var fs_extra=require(_0x5a04('0xa'));var _=require(_0x5a04('0xb'));var squel=require(_0x5a04('0xc'));var crypto=require(_0x5a04('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5a04('0xe'));var toCsv=require(_0x5a04('0x8'));var querystring=require(_0x5a04('0xf'));var Papa=require(_0x5a04('0x10'));var Redis=require(_0x5a04('0x11'));var authService=require(_0x5a04('0x12'));var qs=require(_0x5a04('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a04('0x14'));var logger=require(_0x5a04('0x15'))(_0x5a04('0x16'));var utils=require(_0x5a04('0x17'));var config=require(_0x5a04('0x18'));var licenseUtil=require(_0x5a04('0x19'));var db=require(_0x5a04('0x1a'))['db'];config[_0x5a04('0x1b')]=_[_0x5a04('0x1c')](config[_0x5a04('0x1b')],{'host':_0x5a04('0x1d'),'port':0x18eb});var socket=require(_0x5a04('0x1e'))(new Redis(config[_0x5a04('0x1b')]));require(_0x5a04('0x1f'))[_0x5a04('0x20')](socket);var jayson=require(_0x5a04('0x21'));var client=jayson[_0x5a04('0x22')][_0x5a04('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x15d671,_0x3e1aa9,_0x2bde7d,_0x46a047){return new BPromise(function(_0x2af696,_0x2ec896){var _0x525c3f=_0x46a047||client;return _0x525c3f[_0x5a04('0x24')](_0x15d671,_0x2bde7d)[_0x5a04('0x25')](function(_0x5a08e9){logger[_0x5a04('0x26')](_0x5a04('0x27'),_0x3e1aa9,_0x5a04('0x28'));logger[_0x5a04('0x29')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3e1aa9,_0x5a04('0x28'),JSON[_0x5a04('0x2a')](_0x5a08e9));if(_0x5a08e9[_0x5a04('0x2b')]){if(_0x5a08e9[_0x5a04('0x2b')][_0x5a04('0x2c')]===0x1f4){logger['error'](_0x5a04('0x27'),_0x3e1aa9,_0x5a08e9[_0x5a04('0x2b')]['message']);return _0x2ec896(_0x5a08e9['error'][_0x5a04('0x2d')]);}logger[_0x5a04('0x2b')](_0x5a04('0x27'),_0x3e1aa9,_0x5a08e9[_0x5a04('0x2b')][_0x5a04('0x2d')]);return _0x2af696(_0x5a08e9[_0x5a04('0x2b')][_0x5a04('0x2d')]);}else{logger[_0x5a04('0x26')](_0x5a04('0x27'),_0x3e1aa9,_0x5a04('0x28'));_0x2af696(_0x5a08e9[_0x5a04('0x2e')][_0x5a04('0x2d')]);}})[_0x5a04('0x2f')](function(_0x13ab04){logger[_0x5a04('0x2b')](_0x5a04('0x27'),_0x3e1aa9,_0x13ab04);_0x2ec896(_0x13ab04);});});}function respondWithStatusCode(_0x378460,_0x2716bf){_0x2716bf=_0x2716bf||0xcc;return function(_0x11239c){if(_0x11239c){return _0x378460[_0x5a04('0x30')](_0x2716bf);}return _0x378460[_0x5a04('0x31')](_0x2716bf)[_0x5a04('0x32')]();};}function respondWithResult(_0x5aab33,_0x40ca21){_0x40ca21=_0x40ca21||0xc8;return function(_0x388dbc){if(_0x388dbc){return _0x5aab33['status'](_0x40ca21)[_0x5a04('0x33')](_0x388dbc);}};}function respondWithFilteredResult(_0x14ee2b,_0xec6537){return function(_0x1e9baf){if(_0x1e9baf){var _0x481d46=typeof _0xec6537['offset']===_0x5a04('0x34')&&typeof _0xec6537[_0x5a04('0x35')]==='undefined';var _0x2a8a35=_0x1e9baf[_0x5a04('0x36')];var _0x3ebf19=_0x481d46?0x0:_0xec6537[_0x5a04('0x37')];var _0x16c710=_0x481d46?_0x1e9baf['count']:_0xec6537[_0x5a04('0x37')]+_0xec6537[_0x5a04('0x35')];var _0x3c852e;if(_0x16c710>=_0x2a8a35){_0x16c710=_0x2a8a35;_0x3c852e=0xc8;}else{_0x3c852e=0xce;}_0x14ee2b[_0x5a04('0x31')](_0x3c852e);return _0x14ee2b[_0x5a04('0x38')](_0x5a04('0x39'),_0x3ebf19+'-'+_0x16c710+'/'+_0x2a8a35)[_0x5a04('0x33')](_0x1e9baf);}return null;};}function patchUpdates(_0x88eac3){return function(_0xfd2de7){try{jsonpatch[_0x5a04('0x3a')](_0xfd2de7,_0x88eac3,!![]);}catch(_0x3805aa){return BPromise[_0x5a04('0x3b')](_0x3805aa);}return _0xfd2de7[_0x5a04('0x3c')]();};}function saveUpdates(_0x3a406f,_0x55e3b2){return function(_0x5055e4){if(_0x5055e4){return _0x5055e4[_0x5a04('0x3d')](_0x3a406f)[_0x5a04('0x25')](function(_0x1c3ddb){return _0x1c3ddb;});}return null;};}function removeEntity(_0x1145e2,_0x2779ba){return function(_0x5463c8){if(_0x5463c8){return _0x5463c8['destroy']()['then'](function(){var _0x10e128=_0x5463c8[_0x5a04('0x3e')]({'plain':!![]});var _0x2e15ea=_0x5a04('0x3f');return db['UserProfileResource'][_0x5a04('0x40')]({'where':{'type':_0x2e15ea,'resourceId':_0x10e128['id']}})[_0x5a04('0x25')](function(){return _0x5463c8;});})['then'](function(){_0x1145e2[_0x5a04('0x31')](0xcc)[_0x5a04('0x32')]();});}};}function handleEntityNotFound(_0x43281e,_0x4b9fa3){return function(_0x1a1fab){if(!_0x1a1fab){_0x43281e[_0x5a04('0x30')](0x194);}return _0x1a1fab;};}function handleError(_0x10bfa0,_0x2f55cc){_0x2f55cc=_0x2f55cc||0x1f4;return function(_0x4a6911){logger[_0x5a04('0x2b')](_0x4a6911[_0x5a04('0x41')]);if(_0x4a6911[_0x5a04('0x42')]){delete _0x4a6911['name'];}_0x10bfa0[_0x5a04('0x31')](_0x2f55cc)[_0x5a04('0x43')](_0x4a6911);};}exports[_0x5a04('0x44')]=function(_0x409d21,_0x22ec06){var _0x1690ee={'include':[{'model':db[_0x5a04('0x45')],'as':_0x5a04('0x46')}]},_0x5f35ec={},_0x53b6d1={'count':0x0,'rows':[]};var _0xd25bbd=_['map'](db['WhatsappAccount'][_0x5a04('0x47')],function(_0x181376){return{'name':_0x181376[_0x5a04('0x48')],'type':_0x181376[_0x5a04('0x49')][_0x5a04('0x4a')]};});_0x5f35ec['model']=_[_0x5a04('0x4b')](_0xd25bbd,_0x5a04('0x42'));_0x5f35ec[_0x5a04('0x4c')]=_[_0x5a04('0x4d')](_0x409d21[_0x5a04('0x4c')]);_0x5f35ec[_0x5a04('0x4e')]=_[_0x5a04('0x4f')](_0x5f35ec[_0x5a04('0x50')],_0x5f35ec[_0x5a04('0x4c')]);_0x1690ee['attributes']=_[_0x5a04('0x4f')](_0x5f35ec[_0x5a04('0x50')],qs[_0x5a04('0x51')](_0x409d21[_0x5a04('0x4c')][_0x5a04('0x51')]));_0x1690ee[_0x5a04('0x52')]=_0x1690ee[_0x5a04('0x52')][_0x5a04('0x53')]?_0x1690ee[_0x5a04('0x52')]:_0x5f35ec[_0x5a04('0x50')];if(!_0x409d21['query'][_0x5a04('0x54')](_0x5a04('0x55'))){_0x1690ee[_0x5a04('0x35')]=qs[_0x5a04('0x35')](_0x409d21['query'][_0x5a04('0x35')]);_0x1690ee[_0x5a04('0x37')]=qs[_0x5a04('0x37')](_0x409d21[_0x5a04('0x4c')][_0x5a04('0x37')]);}_0x1690ee[_0x5a04('0x56')]=qs[_0x5a04('0x57')](_0x409d21[_0x5a04('0x4c')][_0x5a04('0x57')]);_0x1690ee[_0x5a04('0x58')]=qs['filters'](_[_0x5a04('0x59')](_0x409d21[_0x5a04('0x4c')],_0x5f35ec[_0x5a04('0x4e')]),_0xd25bbd);if(_0x409d21[_0x5a04('0x4c')][_0x5a04('0x5a')]){_0x1690ee[_0x5a04('0x58')]=_[_0x5a04('0x5b')](_0x1690ee[_0x5a04('0x58')],{'$or':_[_0x5a04('0x4b')](_0xd25bbd,function(_0x2b5363){if(_0x2b5363[_0x5a04('0x49')]!=='VIRTUAL'){var _0x5daba2={};_0x5daba2[_0x2b5363[_0x5a04('0x42')]]={'$like':'%'+_0x409d21[_0x5a04('0x4c')][_0x5a04('0x5a')]+'%'};return _0x5daba2;}})});}_0x1690ee=_[_0x5a04('0x5b')]({},_0x1690ee,_0x409d21[_0x5a04('0x5c')]);var _0x4c50b5={'where':_0x1690ee[_0x5a04('0x58')]};return db['WhatsappAccount'][_0x5a04('0x36')](_0x4c50b5)[_0x5a04('0x25')](function(_0x474d22){_0x53b6d1[_0x5a04('0x36')]=_0x474d22;if(_0x409d21['query']['includeAll']){_0x1690ee['include']=[{'all':!![]}];}return db[_0x5a04('0x5d')][_0x5a04('0x5e')](_0x1690ee);})[_0x5a04('0x25')](function(_0x34e805){_0x53b6d1['rows']=_0x34e805;return _0x53b6d1;})[_0x5a04('0x25')](respondWithFilteredResult(_0x22ec06,_0x1690ee))[_0x5a04('0x2f')](handleError(_0x22ec06,null));};exports[_0x5a04('0x5f')]=function(_0x546fc6,_0x438fb7){var _0xb6aab8={'raw':![],'where':{'id':_0x546fc6['params']['id']},'include':[{'model':db['Pause'],'as':_0x5a04('0x46')}]},_0x4ecbdf={};_0x4ecbdf[_0x5a04('0x50')]=_['keys'](db[_0x5a04('0x5d')]['rawAttributes']);_0x4ecbdf[_0x5a04('0x4c')]=_['keys'](_0x546fc6[_0x5a04('0x4c')]);_0x4ecbdf['filters']=_['intersection'](_0x4ecbdf[_0x5a04('0x50')],_0x4ecbdf[_0x5a04('0x4c')]);_0xb6aab8['attributes']=_['intersection'](_0x4ecbdf[_0x5a04('0x50')],qs[_0x5a04('0x51')](_0x546fc6['query'][_0x5a04('0x51')]));_0xb6aab8['attributes']=_0xb6aab8['attributes'][_0x5a04('0x53')]?_0xb6aab8[_0x5a04('0x52')]:_0x4ecbdf[_0x5a04('0x50')];if(_0x546fc6[_0x5a04('0x4c')][_0x5a04('0x60')]){_0xb6aab8[_0x5a04('0x61')]=[{'all':!![]}];}_0xb6aab8=_['merge']({},_0xb6aab8,_0x546fc6['options']);return db['WhatsappAccount'][_0x5a04('0x62')](_0xb6aab8)[_0x5a04('0x25')](handleEntityNotFound(_0x438fb7,null))['then'](respondWithResult(_0x438fb7,null))[_0x5a04('0x2f')](handleError(_0x438fb7,null));};exports['create']=function(_0x596cac,_0xad903a){return db[_0x5a04('0x5d')][_0x5a04('0x63')](_0x596cac[_0x5a04('0x64')],{})[_0x5a04('0x25')](function(_0x45bfc8){var _0x3955e5=_0x596cac['user'][_0x5a04('0x3e')]({'plain':!![]});if(!_0x3955e5)throw new Error(_0x5a04('0x65'));if(_0x3955e5[_0x5a04('0x66')]===_0x5a04('0x67')){var _0x49d343=_0x45bfc8[_0x5a04('0x3e')]({'plain':!![]});var _0x272772=_0x5a04('0x3f');return db['UserProfileSection'][_0x5a04('0x62')]({'where':{'name':_0x272772,'userProfileId':_0x3955e5['userProfileId']},'raw':!![]})[_0x5a04('0x25')](function(_0x59cf78){if(_0x59cf78&&_0x59cf78['autoAssociation']===0x0){return db[_0x5a04('0x68')][_0x5a04('0x63')]({'name':_0x49d343[_0x5a04('0x42')],'resourceId':_0x49d343['id'],'type':_0x59cf78[_0x5a04('0x42')],'sectionId':_0x59cf78['id']},{})[_0x5a04('0x25')](function(){return _0x45bfc8;});}else{return _0x45bfc8;}})[_0x5a04('0x2f')](function(_0xfe6a13){logger[_0x5a04('0x2b')](_0x5a04('0x69'),_0xfe6a13);throw _0xfe6a13;});}return _0x45bfc8;})[_0x5a04('0x25')](respondWithResult(_0xad903a,0xc9))[_0x5a04('0x2f')](handleError(_0xad903a,null));};exports['update']=function(_0x2bcbc1,_0x5b2ee1){if(_0x2bcbc1['body']['id']){delete _0x2bcbc1[_0x5a04('0x64')]['id'];}return db[_0x5a04('0x5d')]['find']({'where':{'id':_0x2bcbc1[_0x5a04('0x6a')]['id']},'include':[{'model':db[_0x5a04('0x45')],'as':_0x5a04('0x46')}]})[_0x5a04('0x25')](handleEntityNotFound(_0x5b2ee1,null))[_0x5a04('0x25')](saveUpdates(_0x2bcbc1['body'],null))[_0x5a04('0x25')](respondWithResult(_0x5b2ee1,null))['catch'](handleError(_0x5b2ee1,null));};exports['destroy']=function(_0x3babba,_0xa1ad89){return db[_0x5a04('0x5d')]['find']({'where':{'id':_0x3babba[_0x5a04('0x6a')]['id']}})[_0x5a04('0x25')](handleEntityNotFound(_0xa1ad89,null))['then'](removeEntity(_0xa1ad89,null))[_0x5a04('0x2f')](handleError(_0xa1ad89,null));};exports['describe']=function(_0xccdbc7,_0x1dae23){return db['WhatsappAccount'][_0x5a04('0x6b')]()[_0x5a04('0x25')](respondWithResult(_0x1dae23,null))[_0x5a04('0x2f')](handleError(_0x1dae23,null));};exports[_0x5a04('0x6c')]=function(_0x1f4ede,_0x363ffc,_0x314a99){if(_0x1f4ede[_0x5a04('0x64')]['id']){delete _0x1f4ede[_0x5a04('0x64')]['id'];}return db[_0x5a04('0x5d')][_0x5a04('0x62')]({'where':{'id':_0x1f4ede[_0x5a04('0x6a')]['id']}})[_0x5a04('0x25')](handleEntityNotFound(_0x363ffc,null))[_0x5a04('0x25')](function(_0x33435f){if(_0x33435f){_0x1f4ede['body']['WhatsappAccountId']=_0x33435f['id'];return db[_0x5a04('0x6d')][_0x5a04('0x63')](_0x1f4ede[_0x5a04('0x64')]);}})[_0x5a04('0x25')](respondWithResult(_0x363ffc,null))[_0x5a04('0x2f')](handleError(_0x363ffc,null));};exports[_0x5a04('0x6e')]=function(_0x5ee516,_0x28034c,_0x27ec1e){var _0x2011dc={'raw':![],'where':{}};var _0x633981={};var _0x197d72={'count':0x0,'rows':[]};return db[_0x5a04('0x5d')][_0x5a04('0x6f')]({'where':{'id':_0x5ee516[_0x5a04('0x6a')]['id']}})[_0x5a04('0x25')](handleEntityNotFound(_0x28034c,null))[_0x5a04('0x25')](function(_0x4547cd){if(_0x4547cd){_0x633981[_0x5a04('0x50')]=_['keys'](db['Disposition'][_0x5a04('0x47')]);_0x633981[_0x5a04('0x4c')]=_[_0x5a04('0x4d')](_0x5ee516[_0x5a04('0x4c')]);_0x633981['filters']=_['intersection'](_0x633981[_0x5a04('0x50')],_0x633981['query']);_0x2011dc[_0x5a04('0x52')]=_[_0x5a04('0x4f')](_0x633981[_0x5a04('0x50')],qs['fields'](_0x5ee516['query'][_0x5a04('0x51')]));_0x2011dc[_0x5a04('0x52')]=_0x2011dc[_0x5a04('0x52')][_0x5a04('0x53')]?_0x2011dc['attributes']:_0x633981[_0x5a04('0x50')];if(!_0x5ee516[_0x5a04('0x4c')][_0x5a04('0x54')](_0x5a04('0x55'))){_0x2011dc['limit']=qs[_0x5a04('0x35')](_0x5ee516[_0x5a04('0x4c')]['limit']);_0x2011dc['offset']=qs[_0x5a04('0x37')](_0x5ee516['query'][_0x5a04('0x37')]);}_0x2011dc['order']=qs[_0x5a04('0x57')](_0x5ee516['query'][_0x5a04('0x57')]);_0x2011dc[_0x5a04('0x58')]=qs[_0x5a04('0x4e')](_[_0x5a04('0x59')](_0x5ee516[_0x5a04('0x4c')],_0x633981[_0x5a04('0x4e')]));_0x2011dc['where'][_0x5a04('0x70')]=_0x4547cd['id'];if(_0x5ee516[_0x5a04('0x4c')][_0x5a04('0x5a')]){_0x2011dc[_0x5a04('0x58')]=_[_0x5a04('0x5b')](_0x2011dc['where'],{'$or':_[_0x5a04('0x4b')](_0x2011dc[_0x5a04('0x52')],function(_0x34fc19){var _0x556eb6={};_0x556eb6[_0x34fc19]={'$like':'%'+_0x5ee516[_0x5a04('0x4c')][_0x5a04('0x5a')]+'%'};return _0x556eb6;})});}_0x2011dc=_[_0x5a04('0x5b')]({},_0x2011dc,_0x5ee516[_0x5a04('0x5c')]);return db[_0x5a04('0x6d')][_0x5a04('0x36')]({'where':_0x2011dc['where']})[_0x5a04('0x25')](function(_0x39da2d){_0x197d72['count']=_0x39da2d;if(_0x5ee516[_0x5a04('0x4c')][_0x5a04('0x60')]){_0x2011dc[_0x5a04('0x61')]=[{'all':!![]}];}return db[_0x5a04('0x6d')][_0x5a04('0x5e')](_0x2011dc);})[_0x5a04('0x25')](function(_0x1922b3){_0x197d72['rows']=_0x1922b3;return _0x197d72;});}})['then'](respondWithFilteredResult(_0x28034c,_0x2011dc))[_0x5a04('0x2f')](handleError(_0x28034c,null));};exports['removeDispositions']=function(_0x45d043,_0x138ca4,_0x11c791){return db[_0x5a04('0x5d')][_0x5a04('0x62')]({'where':{'id':_0x45d043[_0x5a04('0x6a')]['id']}})['then'](handleEntityNotFound(_0x138ca4,null))['then'](function(_0x694b26){if(_0x694b26){return _0x694b26[_0x5a04('0x71')](_0x45d043[_0x5a04('0x4c')][_0x5a04('0x72')]);}})[_0x5a04('0x25')](respondWithStatusCode(_0x138ca4,null))[_0x5a04('0x2f')](handleError(_0x138ca4,null));};exports['addAnswer']=function(_0x3fda6a,_0xbf93c4,_0x29b7ec){if(_0x3fda6a[_0x5a04('0x64')]['id']){delete _0x3fda6a[_0x5a04('0x64')]['id'];}return db[_0x5a04('0x5d')]['find']({'where':{'id':_0x3fda6a[_0x5a04('0x6a')]['id']}})[_0x5a04('0x25')](handleEntityNotFound(_0xbf93c4,null))[_0x5a04('0x25')](function(_0x3a6caa){if(_0x3a6caa){_0x3fda6a[_0x5a04('0x64')][_0x5a04('0x70')]=_0x3a6caa['id'];return db[_0x5a04('0x73')][_0x5a04('0x63')](_0x3fda6a[_0x5a04('0x64')]);}})['then'](respondWithResult(_0xbf93c4,null))[_0x5a04('0x2f')](handleError(_0xbf93c4,null));};exports[_0x5a04('0x74')]=function(_0xc03b3b,_0x216c0f,_0x344891){var _0x50962d={'raw':![],'where':{}};var _0x103917={};var _0x1a1f7f={'count':0x0,'rows':[]};return db[_0x5a04('0x5d')][_0x5a04('0x6f')]({'where':{'id':_0xc03b3b[_0x5a04('0x6a')]['id']}})[_0x5a04('0x25')](handleEntityNotFound(_0x216c0f,null))[_0x5a04('0x25')](function(_0x2706b7){if(_0x2706b7){_0x103917['model']=_[_0x5a04('0x4d')](db[_0x5a04('0x73')][_0x5a04('0x47')]);_0x103917['query']=_['keys'](_0xc03b3b[_0x5a04('0x4c')]);_0x103917['filters']=_[_0x5a04('0x4f')](_0x103917[_0x5a04('0x50')],_0x103917[_0x5a04('0x4c')]);_0x50962d['attributes']=_[_0x5a04('0x4f')](_0x103917[_0x5a04('0x50')],qs['fields'](_0xc03b3b[_0x5a04('0x4c')][_0x5a04('0x51')]));_0x50962d['attributes']=_0x50962d[_0x5a04('0x52')][_0x5a04('0x53')]?_0x50962d[_0x5a04('0x52')]:_0x103917[_0x5a04('0x50')];if(!_0xc03b3b[_0x5a04('0x4c')]['hasOwnProperty'](_0x5a04('0x55'))){_0x50962d[_0x5a04('0x35')]=qs[_0x5a04('0x35')](_0xc03b3b[_0x5a04('0x4c')][_0x5a04('0x35')]);_0x50962d['offset']=qs[_0x5a04('0x37')](_0xc03b3b[_0x5a04('0x4c')]['offset']);}_0x50962d[_0x5a04('0x56')]=qs[_0x5a04('0x57')](_0xc03b3b[_0x5a04('0x4c')][_0x5a04('0x57')]);_0x50962d[_0x5a04('0x58')]=qs[_0x5a04('0x4e')](_[_0x5a04('0x59')](_0xc03b3b[_0x5a04('0x4c')],_0x103917[_0x5a04('0x4e')]));_0x50962d[_0x5a04('0x58')][_0x5a04('0x70')]=_0x2706b7['id'];if(_0xc03b3b[_0x5a04('0x4c')][_0x5a04('0x5a')]){_0x50962d[_0x5a04('0x58')]=_[_0x5a04('0x5b')](_0x50962d[_0x5a04('0x58')],{'$or':_[_0x5a04('0x4b')](_0x50962d[_0x5a04('0x52')],function(_0x259ec9){var _0x26ac69={};_0x26ac69[_0x259ec9]={'$like':'%'+_0xc03b3b[_0x5a04('0x4c')]['filter']+'%'};return _0x26ac69;})});}_0x50962d=_[_0x5a04('0x5b')]({},_0x50962d,_0xc03b3b[_0x5a04('0x5c')]);return db['CannedAnswer'][_0x5a04('0x36')]({'where':_0x50962d['where']})[_0x5a04('0x25')](function(_0x21ab00){_0x1a1f7f[_0x5a04('0x36')]=_0x21ab00;if(_0xc03b3b[_0x5a04('0x4c')][_0x5a04('0x60')]){_0x50962d[_0x5a04('0x61')]=[{'all':!![]}];}return db[_0x5a04('0x73')]['findAll'](_0x50962d);})[_0x5a04('0x25')](function(_0x1ae09f){_0x1a1f7f[_0x5a04('0x75')]=_0x1ae09f;return _0x1a1f7f;});}})[_0x5a04('0x25')](respondWithFilteredResult(_0x216c0f,_0x50962d))['catch'](handleError(_0x216c0f,null));};exports[_0x5a04('0x76')]=function(_0x45c653,_0x1169cd,_0xb42e59){return db[_0x5a04('0x5d')][_0x5a04('0x62')]({'where':{'id':_0x45c653[_0x5a04('0x6a')]['id']}})[_0x5a04('0x25')](handleEntityNotFound(_0x1169cd,null))[_0x5a04('0x25')](function(_0x1443c3){if(_0x1443c3){return _0x1443c3['removeAnswers'](_0x45c653[_0x5a04('0x4c')]['ids']);}})[_0x5a04('0x25')](respondWithStatusCode(_0x1169cd,null))['catch'](handleError(_0x1169cd,null));};exports['addAgents']=function(_0x341155,_0x8629ff,_0x1e3c1d){return db['WhatsappAccount'][_0x5a04('0x62')]({'where':{'id':_0x341155['params']['id']}})['then'](handleEntityNotFound(_0x8629ff,null))['then'](function(_0x3a045c){if(_0x3a045c){return _0x3a045c[_0x5a04('0x77')](_0x341155[_0x5a04('0x64')][_0x5a04('0x72')],_['omit'](_0x341155[_0x5a04('0x64')],[_0x5a04('0x72'),'id'])||{})['spread'](function(_0x1ec4aa){for(var _0x2776cb=0x0;_0x2776cb<_0x341155[_0x5a04('0x64')][_0x5a04('0x72')][_0x5a04('0x53')];_0x2776cb+=0x1){socket[_0x5a04('0x78')](_0x5a04('0x79'),{'UserId':Number(_0x341155[_0x5a04('0x64')]['ids'][_0x2776cb]),'WhatsappAccountId':Number(_0x341155[_0x5a04('0x6a')]['id'])});}return _0x1ec4aa;});}})[_0x5a04('0x25')](respondWithResult(_0x8629ff,null))[_0x5a04('0x2f')](handleError(_0x8629ff,null));};exports[_0x5a04('0x7a')]=function(_0x26fb70,_0x44e599,_0x1cb41e){return db[_0x5a04('0x5d')][_0x5a04('0x62')]({'where':{'id':_0x26fb70[_0x5a04('0x6a')]['id']}})[_0x5a04('0x25')](handleEntityNotFound(_0x44e599,null))[_0x5a04('0x25')](function(_0x3d83a5){if(_0x3d83a5){return _0x3d83a5[_0x5a04('0x7a')](_0x26fb70[_0x5a04('0x4c')]['ids'])['then'](function(){if(_['isArray'](_0x26fb70[_0x5a04('0x4c')][_0x5a04('0x72')])){for(var _0x48365c=0x0;_0x48365c<_0x26fb70[_0x5a04('0x4c')][_0x5a04('0x72')]['length'];_0x48365c+=0x1){socket[_0x5a04('0x78')]('userWhatsappAccount:remove',{'UserId':Number(_0x26fb70[_0x5a04('0x4c')][_0x5a04('0x72')][_0x48365c]),'WhatsappAccountId':Number(_0x26fb70['params']['id'])});}}else{socket[_0x5a04('0x78')]('userWhatsappAccount:remove',{'UserId':Number(_0x26fb70['query']['ids']),'WhatsappAccountId':Number(_0x26fb70[_0x5a04('0x6a')]['id'])});}});}})[_0x5a04('0x25')](respondWithStatusCode(_0x44e599,null))['catch'](handleError(_0x44e599,null));};exports[_0x5a04('0x7b')]=function(_0x539c9d,_0x37acdd,_0x369b23){var _0x24750e={};var _0x41c8ac={};var _0x421d86;var _0x181c8c;return db[_0x5a04('0x5d')][_0x5a04('0x6f')]({'where':{'id':_0x539c9d[_0x5a04('0x6a')]['id']}})[_0x5a04('0x25')](handleEntityNotFound(_0x37acdd,null))[_0x5a04('0x25')](function(_0x974c07){if(_0x974c07){_0x421d86=_0x974c07;_0x41c8ac[_0x5a04('0x50')]=_['keys'](db[_0x5a04('0x7c')][_0x5a04('0x47')]);_0x41c8ac[_0x5a04('0x4c')]=_[_0x5a04('0x4d')](_0x539c9d[_0x5a04('0x4c')]);_0x41c8ac[_0x5a04('0x4e')]=_[_0x5a04('0x4f')](_0x41c8ac[_0x5a04('0x50')],_0x41c8ac[_0x5a04('0x4c')]);_0x24750e[_0x5a04('0x52')]=_[_0x5a04('0x4f')](_0x41c8ac['model'],qs[_0x5a04('0x51')](_0x539c9d['query'][_0x5a04('0x51')]));_0x24750e[_0x5a04('0x52')]=_0x24750e[_0x5a04('0x52')][_0x5a04('0x53')]?_0x24750e[_0x5a04('0x52')]:_0x41c8ac[_0x5a04('0x50')];_0x24750e[_0x5a04('0x56')]=qs['sort'](_0x539c9d[_0x5a04('0x4c')][_0x5a04('0x57')]);_0x24750e[_0x5a04('0x58')]=qs[_0x5a04('0x4e')](_[_0x5a04('0x59')](_0x539c9d['query'],_0x41c8ac[_0x5a04('0x4e')]));if(_0x539c9d[_0x5a04('0x4c')]['filter']){_0x24750e[_0x5a04('0x58')]=_[_0x5a04('0x5b')](_0x24750e[_0x5a04('0x58')],{'$or':_['map'](_0x24750e[_0x5a04('0x52')],function(_0x4c6ce6){var _0x19b43c={};_0x19b43c[_0x4c6ce6]={'$like':'%'+_0x539c9d['query'][_0x5a04('0x5a')]+'%'};return _0x19b43c;})});}_0x24750e=_[_0x5a04('0x5b')]({},_0x24750e,_0x539c9d['options']);return _0x421d86['getAgents'](_0x24750e);}})[_0x5a04('0x25')](function(_0x54d608){if(_0x54d608){_0x181c8c=_0x54d608[_0x5a04('0x53')];if(!_0x539c9d['query']['hasOwnProperty'](_0x5a04('0x55'))){_0x24750e[_0x5a04('0x35')]=qs[_0x5a04('0x35')](_0x539c9d['query'][_0x5a04('0x35')]);_0x24750e[_0x5a04('0x37')]=qs[_0x5a04('0x37')](_0x539c9d[_0x5a04('0x4c')][_0x5a04('0x37')]);}return _0x421d86[_0x5a04('0x7b')](_0x24750e);}})[_0x5a04('0x25')](function(_0x628eeb){if(_0x628eeb){return _0x628eeb?{'count':_0x181c8c,'rows':_0x628eeb}:null;}})[_0x5a04('0x25')](respondWithResult(_0x37acdd,null))['catch'](handleError(_0x37acdd,null));};exports[_0x5a04('0x7d')]=function(_0x2f37d0,_0x18a652){var _0x13dfca=_0x2f37d0['params']['id'];var _0x5b9efb=_0x2f37d0[_0x5a04('0x64')];var _0x3a0a3a=0xc8;var _0x31fde4=null;return db[_0x5a04('0x7e')][_0x5a04('0x7f')]({'isolationLevel':db[_0x5a04('0x7e')][_0x5a04('0x80')]['ISOLATION_LEVELS'][_0x5a04('0x81')]},function(_0xa3c92d){return db['WhatsappAccount'][_0x5a04('0x6f')]({'where':{'id':_0x13dfca},'transaction':_0xa3c92d})[_0x5a04('0x25')](function(_0x259d0c){if(_0x259d0c){return db[_0x5a04('0x82')]['destroy']({'where':{'WhatsappAccountId':_0x13dfca},'transaction':_0xa3c92d})[_0x5a04('0x25')](function(){var _0x414ae8=_['map'](_0x5b9efb,function(_0x507c44){_0x507c44['WhatsappAccountId']=_0x13dfca;return _0x507c44;});return db['WhatsappApplication']['bulkCreate'](_0x414ae8,{'transaction':_0xa3c92d});});}else{_0x3a0a3a=0x194;_0x31fde4=[];}});})[_0x5a04('0x25')](function(){if(_0x3a0a3a!==0x194){return db[_0x5a04('0x82')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x13dfca},'order':_0x5a04('0x83')})[_0x5a04('0x25')](function(_0x499569){_0x31fde4=_0x499569;});}})[_0x5a04('0x2f')](function(_0x50f808){_0x3a0a3a=0x1f4;logger['error'](_0x50f808[_0x5a04('0x41')]);if(_0x50f808[_0x5a04('0x42')]){delete _0x50f808[_0x5a04('0x42')];}_0x31fde4=_0x50f808;})[_0x5a04('0x84')](function(){if(_0x31fde4===null){_0x18a652[_0x5a04('0x30')](_0x3a0a3a);}else{if(_0x3a0a3a===0x1f4){_0x18a652[_0x5a04('0x31')](_0x3a0a3a)['send'](_0x31fde4);}else{_0x18a652['status'](_0x3a0a3a)['json'](_0x31fde4);}}});};exports[_0x5a04('0x85')]=function(_0x208da1,_0x27620b,_0x113f17){var _0x56edc7={};var _0x2f659c={};var _0x14aa85;var _0x379ec5;return db[_0x5a04('0x5d')][_0x5a04('0x6f')]({'where':{'id':_0x208da1[_0x5a04('0x6a')]['id']}})[_0x5a04('0x25')](handleEntityNotFound(_0x27620b,null))[_0x5a04('0x25')](function(_0x54a34f){if(_0x54a34f){_0x14aa85=_0x54a34f;_0x2f659c[_0x5a04('0x50')]=_['keys'](db[_0x5a04('0x82')]['rawAttributes']);_0x2f659c[_0x5a04('0x4c')]=_[_0x5a04('0x4d')](_0x208da1[_0x5a04('0x4c')]);_0x2f659c['filters']=_[_0x5a04('0x4f')](_0x2f659c['model'],_0x2f659c[_0x5a04('0x4c')]);_0x56edc7[_0x5a04('0x52')]=_[_0x5a04('0x4f')](_0x2f659c['model'],qs['fields'](_0x208da1[_0x5a04('0x4c')][_0x5a04('0x51')]));_0x56edc7[_0x5a04('0x52')]=_0x56edc7[_0x5a04('0x52')][_0x5a04('0x53')]?_0x56edc7['attributes']:_0x2f659c[_0x5a04('0x50')];_0x56edc7[_0x5a04('0x56')]=qs[_0x5a04('0x57')](_0x208da1[_0x5a04('0x4c')][_0x5a04('0x57')]);_0x56edc7[_0x5a04('0x58')]=qs[_0x5a04('0x4e')](_[_0x5a04('0x59')](_0x208da1[_0x5a04('0x4c')],_0x2f659c[_0x5a04('0x4e')]));if(_0x208da1['query'][_0x5a04('0x5a')]){_0x56edc7['where']=_['merge'](_0x56edc7[_0x5a04('0x58')],{'$or':_[_0x5a04('0x4b')](_0x56edc7['attributes'],function(_0x5c1e4f){var _0x2e1c66={};_0x2e1c66[_0x5c1e4f]={'$like':'%'+_0x208da1[_0x5a04('0x4c')][_0x5a04('0x5a')]+'%'};return _0x2e1c66;})});}_0x56edc7=_[_0x5a04('0x5b')]({},_0x56edc7,_0x208da1[_0x5a04('0x5c')]);return _0x14aa85[_0x5a04('0x85')](_0x56edc7);}})[_0x5a04('0x25')](function(_0x6e2588){if(_0x6e2588){_0x379ec5=_0x6e2588[_0x5a04('0x53')];if(!_0x208da1[_0x5a04('0x4c')][_0x5a04('0x54')](_0x5a04('0x55'))){_0x56edc7[_0x5a04('0x35')]=qs['limit'](_0x208da1['query'][_0x5a04('0x35')]);_0x56edc7['offset']=qs[_0x5a04('0x37')](_0x208da1['query'][_0x5a04('0x37')]);}return _0x14aa85[_0x5a04('0x85')](_0x56edc7);}})[_0x5a04('0x25')](function(_0x449fa7){if(_0x449fa7){return _0x449fa7?{'count':_0x379ec5,'rows':_0x449fa7}:null;}})[_0x5a04('0x25')](respondWithResult(_0x27620b,null))['catch'](handleError(_0x27620b,null));};exports[_0x5a04('0x86')]=function(_0x2f7c1f,_0x4ff8e6,_0x39e810){var _0x51950f={'channel':_0x5a04('0x87')};var _0x3bf7ad=[];var _0x2c5440=[];var _0x5e4f50={};return db['WhatsappAccount'][_0x5a04('0x62')]({'where':{'id':_0x2f7c1f[_0x5a04('0x6a')]['id']},'include':[{'model':db[_0x5a04('0x82')],'as':_0x5a04('0x88')}]})[_0x5a04('0x25')](handleEntityNotFound(_0x4ff8e6,null))[_0x5a04('0x25')](function(_0x1ece25){_0x51950f[_0x5a04('0x89')]=_0x1ece25;if(_0x51950f['account']&&_0x51950f[_0x5a04('0x89')][_0x5a04('0x49')]===_0x5a04('0x8a')&&_0x2f7c1f[_0x5a04('0x64')]['statuses']){if(_0x2f7c1f[_0x5a04('0x64')]['statuses'][_0x5a04('0x53')]===0x0)return;if(_0x2f7c1f[_0x5a04('0x64')][_0x5a04('0x8b')][0x0][_0x5a04('0x8c')]!==_0x5a04('0x8d'))return;return db['WhatsappMessage'][_0x5a04('0x3d')]({'read':!![],'readAt':_0x2f7c1f['body'][_0x5a04('0x8b')][0x0][_0x5a04('0x8e')]},{'where':{'messageId':_0x2f7c1f[_0x5a04('0x64')]['statuses'][0x0][_0x5a04('0x8f')]},'individualHooks':!![]})[_0x5a04('0x25')](function(_0x3cdf54){return _0x4ff8e6[_0x5a04('0x31')](0xc8)[_0x5a04('0x33')](_0x3cdf54);});}_0x51950f[_0x5a04('0x90')]=_['orderBy'](_0x1ece25['Applications'],[_0x5a04('0x83')],['asc']);if(_0x51950f['account'][_0x5a04('0x88')]){delete _0x51950f['account'][_0x5a04('0x88')];}return db[_0x5a04('0x91')]['describe']()[_0x5a04('0x25')](function(_0x5514c5){if(!_0x5514c5){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x3bf7ad=_[_0x5a04('0x92')](_['keys'](_0x5514c5),[_0x5a04('0x93'),_0x5a04('0x94')]);_0x2c5440=_[_0x5a04('0x92')](_['keys'](_0x5514c5),['createdAt','updatedAt',_0x5a04('0x95'),'ListId']);_0x51950f[_0x5a04('0x64')]={'mapKey':_0x5a04('0x96')};if(_0x51950f[_0x5a04('0x89')]&&_0x51950f[_0x5a04('0x89')][_0x5a04('0x49')]==='twilio'){_0x51950f[_0x5a04('0x64')][_0x5a04('0x97')]=_0x2f7c1f[_0x5a04('0x64')][_0x5a04('0x98')][_0x5a04('0x99')]('whatsapp:','');_0x51950f['body'][_0x5a04('0x64')]=_0x2f7c1f[_0x5a04('0x64')]['Body'];_0x51950f[_0x5a04('0x64')]['messageId']=_0x2f7c1f[_0x5a04('0x64')]['MessageSid'];}if(_0x51950f[_0x5a04('0x89')]&&_0x51950f['account'][_0x5a04('0x49')]===_0x5a04('0x8a')){_0x51950f[_0x5a04('0x64')][_0x5a04('0x97')]=_0x2f7c1f['body']['notifications'][0x0][_0x5a04('0x97')];_0x51950f[_0x5a04('0x64')][_0x5a04('0x64')]=_0x2f7c1f['body'][_0x5a04('0x9a')][0x0][_0x5a04('0x2d')]['body'];_0x51950f[_0x5a04('0x64')][_0x5a04('0x9b')]=_0x2f7c1f['body']['notifications'][0x0][_0x5a04('0x8f')];}if(_0x51950f[_0x5a04('0x64')]['id']){delete _0x51950f[_0x5a04('0x64')]['id'];}if(_[_0x5a04('0x9c')](_0x51950f[_0x5a04('0x64')]['from'])){throw new db['Sequelize'][(_0x5a04('0x9d'))]('from\x20is\x20mandatory');}if(_[_0x5a04('0x9c')](_0x51950f[_0x5a04('0x64')]['body'])||_0x51950f['body'][_0x5a04('0x64')]===''){throw new db[(_0x5a04('0x9e'))]['ValidationError'](_0x5a04('0x9f'));}if(_[_0x5a04('0x9c')](_0x51950f['body'][_0x5a04('0xa0')])){throw new db[(_0x5a04('0x9e'))][(_0x5a04('0x9d'))](_0x5a04('0xa1')+_0x2c5440);}if(!_['includes'](_0x2c5440,_0x51950f['body'][_0x5a04('0xa0')])){throw new db[(_0x5a04('0x9e'))]['ValidationError'](_0x5a04('0xa2')+_0x2c5440);}_0x5e4f50[_0x51950f[_0x5a04('0x64')][_0x5a04('0xa0')]]=_0x51950f['body']['from'];return db[_0x5a04('0xa3')]['find']({'where':{'id':_0x51950f[_0x5a04('0x89')][_0x5a04('0xa4')]},'include':[{'model':db['CmContact'],'as':_0x5a04('0xa5'),'where':_0x5e4f50,'limit':0x1,'order':[[_0x5a04('0x94'),_0x5a04('0xa6')]]}]});})['then'](handleEntityNotFound(_0x4ff8e6,null))[_0x5a04('0x25')](function(_0x378343){if(_0x378343){_0x51950f[_0x5a04('0xa7')]=_[_0x5a04('0xa8')](_0x378343,[_0x5a04('0xa5')]);if(_0x378343[_0x5a04('0xa5')][_0x5a04('0x53')]){return _0x378343[_0x5a04('0xa5')][0x0];}var _0x1fd6e1=_['defaults'](_0x51950f['body'],{'firstName':_0x51950f[_0x5a04('0x64')][_0x5a04('0x97')],'ListId':_0x378343['id']});_0x1fd6e1[_0x51950f[_0x5a04('0x64')][_0x5a04('0xa0')]]=_0x51950f[_0x5a04('0x64')][_0x5a04('0x97')];return db[_0x5a04('0x91')][_0x5a04('0x63')](_0x1fd6e1,{'fields':_0x3bf7ad,'raw':!![]});}})[_0x5a04('0x25')](handleEntityNotFound(_0x4ff8e6,null))['then'](function(_0x43ae9c){if(_0x43ae9c){_0x51950f[_0x5a04('0xa9')]=_0x43ae9c;var _0x5bdfbd={'ContactId':_0x43ae9c['id'],'phone':_0x51950f[_0x5a04('0x64')][_0x5a04('0x97')],'WhatsappAccountId':_0x2f7c1f['params']['id']};var _0x5bf220={'ContactId':_0x43ae9c['id'],'WhatsappAccountId':_0x2f7c1f[_0x5a04('0x6a')]['id'],'closed':![]};return db[_0x5a04('0xaa')][_0x5a04('0x62')]({'where':_0x5bf220})[_0x5a04('0x25')](function(_0x593c2d){if(_0x593c2d){return[_0x593c2d,![]];}return db[_0x5a04('0xaa')][_0x5a04('0x63')](_0x5bdfbd)[_0x5a04('0x25')](function(_0x39eed0){return[_0x39eed0,!![]];});});}})[_0x5a04('0xab')](function(_0x3ed51e,_0x3336c5){_0x51950f[_0x5a04('0xac')]=_0x3ed51e[_0x5a04('0x3e')]({'plain':!![]});_0x51950f[_0x5a04('0xac')][_0x5a04('0xad')]=![];if(_0x3336c5){if(_0x51950f[_0x5a04('0x89')][_0x5a04('0xae')]){_0x51950f[_0x5a04('0x90')]['push']({'id':0x0,'priority':_0x51950f['applications']['length']+0x1,'app':'close','appdata':_0x5a04('0xaf'),'interval':_0x5a04('0xb0')});}_0x51950f[_0x5a04('0xac')]['created']=!![];}return db[_0x5a04('0xb1')]['create']({'phone':_0x51950f[_0x5a04('0x64')][_0x5a04('0x97')],'messageId':_0x51950f[_0x5a04('0x64')][_0x5a04('0x9b')],'body':_0x51950f[_0x5a04('0x64')][_0x5a04('0x64')],'WhatsappAccountId':_0x2f7c1f[_0x5a04('0x6a')]['id'],'WhatsappInteractionId':_0x3ed51e['id'],'direction':'in','ContactId':_0x3ed51e[_0x5a04('0xb2')],'AttachmentId':_0x51950f[_0x5a04('0x64')][_0x5a04('0xb3')]});})[_0x5a04('0x25')](function(_0x2240b7){_0x51950f[_0x5a04('0x2d')]=_0x2240b7;if(_0x51950f[_0x5a04('0xac')][_0x5a04('0xb4')]){return db[_0x5a04('0x7c')]['find']({'attributes':['id',_0x5a04('0x42')],'where':{'id':_0x51950f[_0x5a04('0xac')]['UserId']}})[_0x5a04('0x25')](function(_0x558e32){if(_0x558e32){_0x51950f[_0x5a04('0x90')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5a04('0xb5'),'appdata':_0x558e32[_0x5a04('0x42')]+','+(_0x51950f[_0x5a04('0x89')]['waitForTheAssignedAgent']||0xa),'interval':_0x5a04('0xb0')});}return respondWithRpcPromise('Start','startRouting',_0x51950f);});}return respondWithRpcPromise(_0x5a04('0xb6'),_0x5a04('0xb7'),_0x51950f);})[_0x5a04('0x25')](function(_0x3e7caa){if(_0x3e7caa){var _0x4a2d02=0xc8;var _0x248a03=_0x5a04('0xb8');logger[_0x5a04('0x26')](_0x5a04('0xb9'),_0x248a03,_0x4a2d02,_0x5a04('0xba'));logger[_0x5a04('0x29')](_0x5a04('0xbb'),_0x248a03,_0x4a2d02,_0x5a04('0xba'),JSON[_0x5a04('0x2a')](_0x3e7caa));if(_0x51950f[_0x5a04('0x89')][_0x5a04('0x49')]===_0x5a04('0xbc')){return _0x4ff8e6[_0x5a04('0x31')](_0x4a2d02)[_0x5a04('0x38')](_0x5a04('0xbd'),_0x5a04('0xbe'))[_0x5a04('0x43')](_0x5a04('0xbf'));}else{return _0x4ff8e6['status'](_0x4a2d02)[_0x5a04('0x33')](_0x3e7caa);}}});})['catch'](handleError(_0x4ff8e6,null));};exports[_0x5a04('0x43')]=function(_0x30227a,_0x4fe8ee,_0x432539){var _0x57e68a,_0x2d8e9a,_0x13a273;if(_[_0x5a04('0x9c')](_0x30227a[_0x5a04('0x64')][_0x5a04('0x64')])||_0x30227a[_0x5a04('0x64')]['body']===''){throw new db[(_0x5a04('0x9e'))][(_0x5a04('0x9d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5a04('0x9c')](_0x30227a[_0x5a04('0x64')]['to'])){throw new db['Sequelize']['ValidationError'](_0x5a04('0xc0'));}_0x57e68a=_0x30227a['body']['to'];return db[_0x5a04('0x5d')]['find']({'where':{'id':_0x30227a[_0x5a04('0x6a')]['id']},'include':[{'model':db[_0x5a04('0xa3')],'as':_0x5a04('0xc1'),'include':[{'model':db[_0x5a04('0x91')],'as':_0x5a04('0xa5'),'where':{'mobile':_0x57e68a},'limit':0x1,'order':[[_0x5a04('0x94'),_0x5a04('0xa6')]]}]}]})[_0x5a04('0x25')](handleEntityNotFound(_0x4fe8ee,null))[_0x5a04('0x25')](function(_0x28cc8d){if(_0x28cc8d&&_0x28cc8d['List']){_0x2d8e9a=_0x28cc8d[_0x5a04('0x3e')]({'plain':!![]});if(_0x2d8e9a[_0x5a04('0xc1')]&&_0x2d8e9a[_0x5a04('0xc1')][_0x5a04('0xa5')][_0x5a04('0x53')]){return _0x2d8e9a[_0x5a04('0xc1')][_0x5a04('0xa5')][0x0];}return db['CmContact'][_0x5a04('0x63')](_[_0x5a04('0x1c')](_0x30227a[_0x5a04('0x64')],{'firstName':_0x57e68a,'mobile':_0x57e68a,'phone':_0x57e68a,'ListId':_0x2d8e9a[_0x5a04('0xa4')]}));}})[_0x5a04('0x25')](handleEntityNotFound(_0x4fe8ee,null))[_0x5a04('0x25')](function(_0x256f6e){if(_0x256f6e){_0x13a273=_0x256f6e;return db[_0x5a04('0xaa')][_0x5a04('0x62')]({'where':{'ContactId':_0x13a273['id'],'closed':![],'WhatsappAccountId':_0x2d8e9a['id']}})[_0x5a04('0x25')](function(_0x370918){if(_0x370918){return[_0x370918,![]];}return db[_0x5a04('0xaa')]['create']({'UserId':_0x30227a[_0x5a04('0x67')]['id'],'ContactId':_0x13a273['id'],'WhatsappAccountId':_0x2d8e9a['id'],'phone':_0x57e68a,'firstMsgDirection':_0x5a04('0xc2'),'Messages':[_[_0x5a04('0x5b')](_0x30227a[_0x5a04('0x64')],{'read':![],'body':_0x30227a[_0x5a04('0x64')][_0x5a04('0x64')],'phone':_0x57e68a,'WhatsappAccountId':_0x2d8e9a['id'],'UserId':_0x30227a['user']['id'],'ContactId':_0x13a273['id']})]},{'include':[{'model':db[_0x5a04('0xb1')],'as':_0x5a04('0xc3')}]})[_0x5a04('0x25')](function(_0x2d70c0){return[_0x2d70c0,!![]];});});}})[_0x5a04('0xab')](function(_0x383fe1,_0x5054ca){if(_0x5054ca){return _0x383fe1;}return db[_0x5a04('0xb1')]['create'](_[_0x5a04('0x5b')](_0x30227a['body'],{'read':![],'body':_0x30227a['body'][_0x5a04('0x64')],'phone':_0x57e68a,'WhatsappAccountId':_0x2d8e9a['id'],'WhatsappInteractionId':_0x383fe1['id'],'UserId':_0x30227a[_0x5a04('0x67')]['id'],'ContactId':_0x13a273['id']}))[_0x5a04('0x25')](function(_0x73ea06){_0x383fe1[_0x5a04('0xc4')][_0x5a04('0xc3')]=[];_0x383fe1[_0x5a04('0xc4')]['Messages'][_0x5a04('0xc5')](_0x73ea06['dataValues']);return _0x383fe1;});})['then'](respondWithResult(_0x4fe8ee,null))[_0x5a04('0x2f')](handleError(_0x4fe8ee,null));}; \ No newline at end of file +var _0x3979=['receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','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','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','order','pick','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','nolimit','addApplications','sequelize','transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','list','omit','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','UserId','unshift','waitForTheAssignedAgent','Start'];(function(_0x552261,_0x4d33c5){var _0xff718c=function(_0x5922a5){while(--_0x5922a5){_0x552261['push'](_0x552261['shift']());}};_0xff718c(++_0x4d33c5);}(_0x3979,0xcf));var _0x9397=function(_0x497a0c,_0x35fa19){_0x497a0c=_0x497a0c-0x0;var _0x8073da=_0x3979[_0x497a0c];return _0x8073da;};'use strict';var emlformat=require(_0x9397('0x0'));var rimraf=require(_0x9397('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9397('0x2'));var rp=require(_0x9397('0x3'));var moment=require(_0x9397('0x4'));var BPromise=require(_0x9397('0x5'));var Mustache=require('mustache');var util=require(_0x9397('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9397('0x7'));var ejs=require(_0x9397('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9397('0x9'));var squel=require('squel');var crypto=require(_0x9397('0xa'));var jsforce=require(_0x9397('0xb'));var deskjs=require(_0x9397('0xc'));var toCsv=require(_0x9397('0x7'));var querystring=require(_0x9397('0xd'));var Papa=require(_0x9397('0xe'));var Redis=require(_0x9397('0xf'));var authService=require(_0x9397('0x10'));var qs=require(_0x9397('0x11'));var as=require(_0x9397('0x12'));var hardwareService=require(_0x9397('0x13'));var logger=require(_0x9397('0x14'))(_0x9397('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9397('0x16'))['db'];config[_0x9397('0x17')]=_[_0x9397('0x18')](config[_0x9397('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x9397('0x19'))(new Redis(config[_0x9397('0x17')]));require('./whatsappAccount.socket')[_0x9397('0x1a')](socket);var jayson=require(_0x9397('0x1b'));var client=jayson[_0x9397('0x1c')][_0x9397('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x168246,_0x487dcc,_0x486125,_0x5b7c24){return new BPromise(function(_0x3a2081,_0x418154){var _0x262750=_0x5b7c24||client;return _0x262750[_0x9397('0x1e')](_0x168246,_0x486125)[_0x9397('0x1f')](function(_0x1f3786){logger[_0x9397('0x20')](_0x9397('0x21'),_0x487dcc,_0x9397('0x22'));logger[_0x9397('0x23')](_0x9397('0x24'),_0x487dcc,_0x9397('0x22'),JSON[_0x9397('0x25')](_0x1f3786));if(_0x1f3786[_0x9397('0x26')]){if(_0x1f3786['error'][_0x9397('0x27')]===0x1f4){logger[_0x9397('0x26')](_0x9397('0x21'),_0x487dcc,_0x1f3786['error'][_0x9397('0x28')]);return _0x418154(_0x1f3786[_0x9397('0x26')]['message']);}logger[_0x9397('0x26')](_0x9397('0x21'),_0x487dcc,_0x1f3786[_0x9397('0x26')][_0x9397('0x28')]);return _0x3a2081(_0x1f3786['error'][_0x9397('0x28')]);}else{logger[_0x9397('0x20')](_0x9397('0x21'),_0x487dcc,_0x9397('0x22'));_0x3a2081(_0x1f3786[_0x9397('0x29')][_0x9397('0x28')]);}})[_0x9397('0x2a')](function(_0x5ceb5f){logger[_0x9397('0x26')](_0x9397('0x21'),_0x487dcc,_0x5ceb5f);_0x418154(_0x5ceb5f);});});}function respondWithStatusCode(_0x1098ea,_0x3d88ac){_0x3d88ac=_0x3d88ac||0xcc;return function(_0x5d7d41){if(_0x5d7d41){return _0x1098ea[_0x9397('0x2b')](_0x3d88ac);}return _0x1098ea[_0x9397('0x2c')](_0x3d88ac)['end']();};}function respondWithResult(_0x25c636,_0x18b9ce){_0x18b9ce=_0x18b9ce||0xc8;return function(_0xd16345){if(_0xd16345){return _0x25c636[_0x9397('0x2c')](_0x18b9ce)[_0x9397('0x2d')](_0xd16345);}};}function respondWithFilteredResult(_0x315694,_0x101514){return function(_0xb70a74){if(_0xb70a74){var _0x554c61=typeof _0x101514[_0x9397('0x2e')]===_0x9397('0x2f')&&typeof _0x101514[_0x9397('0x30')]===_0x9397('0x2f');var _0x599bf6=_0xb70a74[_0x9397('0x31')];var _0x58036e=_0x554c61?0x0:_0x101514[_0x9397('0x2e')];var _0x28fc7e=_0x554c61?_0xb70a74[_0x9397('0x31')]:_0x101514[_0x9397('0x2e')]+_0x101514[_0x9397('0x30')];var _0x52e5b4;if(_0x28fc7e>=_0x599bf6){_0x28fc7e=_0x599bf6;_0x52e5b4=0xc8;}else{_0x52e5b4=0xce;}_0x315694['status'](_0x52e5b4);return _0x315694[_0x9397('0x32')]('Content-Range',_0x58036e+'-'+_0x28fc7e+'/'+_0x599bf6)[_0x9397('0x2d')](_0xb70a74);}return null;};}function patchUpdates(_0x2e3477){return function(_0x3c5193){try{jsonpatch[_0x9397('0x33')](_0x3c5193,_0x2e3477,!![]);}catch(_0x487561){return BPromise[_0x9397('0x34')](_0x487561);}return _0x3c5193[_0x9397('0x35')]();};}function saveUpdates(_0x444988,_0x145ce4){return function(_0xfe8f97){if(_0xfe8f97){return _0xfe8f97[_0x9397('0x36')](_0x444988)['then'](function(_0x36ea33){return _0x36ea33;});}return null;};}function removeEntity(_0x224f0f,_0x4d3271){return function(_0x284fe4){if(_0x284fe4){return _0x284fe4[_0x9397('0x37')]()[_0x9397('0x1f')](function(){var _0x4111e6=_0x284fe4[_0x9397('0x38')]({'plain':!![]});var _0x356d5d=_0x9397('0x39');return db[_0x9397('0x3a')]['destroy']({'where':{'type':_0x356d5d,'resourceId':_0x4111e6['id']}})[_0x9397('0x1f')](function(){return _0x284fe4;});})[_0x9397('0x1f')](function(){_0x224f0f[_0x9397('0x2c')](0xcc)[_0x9397('0x3b')]();});}};}function handleEntityNotFound(_0x4b6d80,_0xc6e00){return function(_0x3ce913){if(!_0x3ce913){_0x4b6d80[_0x9397('0x2b')](0x194);}return _0x3ce913;};}function handleError(_0x4feca2,_0x89b74a){_0x89b74a=_0x89b74a||0x1f4;return function(_0x24e6e2){logger[_0x9397('0x26')](_0x24e6e2[_0x9397('0x3c')]);if(_0x24e6e2[_0x9397('0x3d')]){delete _0x24e6e2['name'];}_0x4feca2[_0x9397('0x2c')](_0x89b74a)[_0x9397('0x3e')](_0x24e6e2);};}exports[_0x9397('0x3f')]=function(_0xda368,_0x1a127a){var _0x3381f2={'include':[{'model':db[_0x9397('0x40')],'as':_0x9397('0x41')}]},_0x1e14f9={},_0x3098a7={'count':0x0,'rows':[]};var _0x5de033=_[_0x9397('0x42')](db[_0x9397('0x43')][_0x9397('0x44')],function(_0x1e4895){return{'name':_0x1e4895['fieldName'],'type':_0x1e4895['type'][_0x9397('0x45')]};});_0x1e14f9[_0x9397('0x46')]=_[_0x9397('0x42')](_0x5de033,'name');_0x1e14f9[_0x9397('0x47')]=_[_0x9397('0x48')](_0xda368['query']);_0x1e14f9[_0x9397('0x49')]=_[_0x9397('0x4a')](_0x1e14f9[_0x9397('0x46')],_0x1e14f9[_0x9397('0x47')]);_0x3381f2[_0x9397('0x4b')]=_[_0x9397('0x4a')](_0x1e14f9[_0x9397('0x46')],qs[_0x9397('0x4c')](_0xda368[_0x9397('0x47')][_0x9397('0x4c')]));_0x3381f2[_0x9397('0x4b')]=_0x3381f2['attributes'][_0x9397('0x4d')]?_0x3381f2[_0x9397('0x4b')]:_0x1e14f9['model'];if(!_0xda368['query'][_0x9397('0x4e')]('nolimit')){_0x3381f2['limit']=qs[_0x9397('0x30')](_0xda368[_0x9397('0x47')]['limit']);_0x3381f2[_0x9397('0x2e')]=qs[_0x9397('0x2e')](_0xda368[_0x9397('0x47')][_0x9397('0x2e')]);}_0x3381f2['order']=qs[_0x9397('0x4f')](_0xda368[_0x9397('0x47')][_0x9397('0x4f')]);_0x3381f2[_0x9397('0x50')]=qs[_0x9397('0x49')](_['pick'](_0xda368[_0x9397('0x47')],_0x1e14f9[_0x9397('0x49')]),_0x5de033);if(_0xda368[_0x9397('0x47')][_0x9397('0x51')]){_0x3381f2[_0x9397('0x50')]=_['merge'](_0x3381f2[_0x9397('0x50')],{'$or':_[_0x9397('0x42')](_0x5de033,function(_0x35b4d4){if(_0x35b4d4[_0x9397('0x52')]!==_0x9397('0x53')){var _0x14dce1={};_0x14dce1[_0x35b4d4['name']]={'$like':'%'+_0xda368[_0x9397('0x47')][_0x9397('0x51')]+'%'};return _0x14dce1;}})});}_0x3381f2=_['merge']({},_0x3381f2,_0xda368[_0x9397('0x54')]);var _0x38c5ee={'where':_0x3381f2[_0x9397('0x50')]};return db[_0x9397('0x43')]['count'](_0x38c5ee)[_0x9397('0x1f')](function(_0x5412f5){_0x3098a7[_0x9397('0x31')]=_0x5412f5;if(_0xda368[_0x9397('0x47')][_0x9397('0x55')]){_0x3381f2[_0x9397('0x56')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x9397('0x57')](_0x3381f2);})['then'](function(_0x39716c){_0x3098a7[_0x9397('0x58')]=_0x39716c;return _0x3098a7;})[_0x9397('0x1f')](respondWithFilteredResult(_0x1a127a,_0x3381f2))[_0x9397('0x2a')](handleError(_0x1a127a,null));};exports['show']=function(_0x51a017,_0xeb5a7a){var _0x1975b2={'raw':![],'where':{'id':_0x51a017['params']['id']},'include':[{'model':db['Pause'],'as':_0x9397('0x41')}]},_0x261b2a={};_0x261b2a[_0x9397('0x46')]=_[_0x9397('0x48')](db[_0x9397('0x43')]['rawAttributes']);_0x261b2a[_0x9397('0x47')]=_[_0x9397('0x48')](_0x51a017[_0x9397('0x47')]);_0x261b2a['filters']=_[_0x9397('0x4a')](_0x261b2a[_0x9397('0x46')],_0x261b2a[_0x9397('0x47')]);_0x1975b2[_0x9397('0x4b')]=_['intersection'](_0x261b2a[_0x9397('0x46')],qs['fields'](_0x51a017[_0x9397('0x47')]['fields']));_0x1975b2[_0x9397('0x4b')]=_0x1975b2[_0x9397('0x4b')][_0x9397('0x4d')]?_0x1975b2['attributes']:_0x261b2a['model'];if(_0x51a017[_0x9397('0x47')][_0x9397('0x55')]){_0x1975b2[_0x9397('0x56')]=[{'all':!![]}];}_0x1975b2=_[_0x9397('0x59')]({},_0x1975b2,_0x51a017[_0x9397('0x54')]);return db[_0x9397('0x43')][_0x9397('0x5a')](_0x1975b2)[_0x9397('0x1f')](handleEntityNotFound(_0xeb5a7a,null))['then'](respondWithResult(_0xeb5a7a,null))['catch'](handleError(_0xeb5a7a,null));};exports['create']=function(_0x472f33,_0x50510a){return db['WhatsappAccount'][_0x9397('0x5b')](_0x472f33[_0x9397('0x5c')],{})[_0x9397('0x1f')](function(_0x2c18ee){var _0x2d5f72=_0x472f33[_0x9397('0x5d')]['get']({'plain':!![]});if(!_0x2d5f72)throw new Error(_0x9397('0x5e'));if(_0x2d5f72[_0x9397('0x5f')]===_0x9397('0x5d')){var _0x1c0e52=_0x2c18ee[_0x9397('0x38')]({'plain':!![]});var _0x101a2a=_0x9397('0x39');return db[_0x9397('0x60')][_0x9397('0x5a')]({'where':{'name':_0x101a2a,'userProfileId':_0x2d5f72[_0x9397('0x61')]},'raw':!![]})['then'](function(_0x387f4a){if(_0x387f4a&&_0x387f4a['autoAssociation']===0x0){return db[_0x9397('0x3a')][_0x9397('0x5b')]({'name':_0x1c0e52[_0x9397('0x3d')],'resourceId':_0x1c0e52['id'],'type':_0x387f4a[_0x9397('0x3d')],'sectionId':_0x387f4a['id']},{})[_0x9397('0x1f')](function(){return _0x2c18ee;});}else{return _0x2c18ee;}})[_0x9397('0x2a')](function(_0x356291){logger['error'](_0x9397('0x62'),_0x356291);throw _0x356291;});}return _0x2c18ee;})[_0x9397('0x1f')](respondWithResult(_0x50510a,0xc9))[_0x9397('0x2a')](handleError(_0x50510a,null));};exports['update']=function(_0x12c34c,_0x167a77){if(_0x12c34c['body']['id']){delete _0x12c34c[_0x9397('0x5c')]['id'];}return db[_0x9397('0x43')][_0x9397('0x5a')]({'where':{'id':_0x12c34c[_0x9397('0x63')]['id']},'include':[{'model':db[_0x9397('0x40')],'as':_0x9397('0x41')}]})[_0x9397('0x1f')](handleEntityNotFound(_0x167a77,null))[_0x9397('0x1f')](saveUpdates(_0x12c34c[_0x9397('0x5c')],null))['then'](respondWithResult(_0x167a77,null))[_0x9397('0x2a')](handleError(_0x167a77,null));};exports[_0x9397('0x37')]=function(_0x2209f1,_0x3bb1dc){return db['WhatsappAccount']['find']({'where':{'id':_0x2209f1[_0x9397('0x63')]['id']}})[_0x9397('0x1f')](handleEntityNotFound(_0x3bb1dc,null))[_0x9397('0x1f')](removeEntity(_0x3bb1dc,null))[_0x9397('0x2a')](handleError(_0x3bb1dc,null));};exports[_0x9397('0x64')]=function(_0xfbf740,_0x511104){return db[_0x9397('0x43')][_0x9397('0x64')]()[_0x9397('0x1f')](respondWithResult(_0x511104,null))[_0x9397('0x2a')](handleError(_0x511104,null));};exports[_0x9397('0x65')]=function(_0x49a653,_0x474447,_0x3efb64){if(_0x49a653['body']['id']){delete _0x49a653[_0x9397('0x5c')]['id'];}return db[_0x9397('0x43')][_0x9397('0x5a')]({'where':{'id':_0x49a653[_0x9397('0x63')]['id']}})[_0x9397('0x1f')](handleEntityNotFound(_0x474447,null))[_0x9397('0x1f')](function(_0x3ec577){if(_0x3ec577){_0x49a653[_0x9397('0x5c')][_0x9397('0x66')]=_0x3ec577['id'];return db[_0x9397('0x67')][_0x9397('0x5b')](_0x49a653['body']);}})[_0x9397('0x1f')](respondWithResult(_0x474447,null))[_0x9397('0x2a')](handleError(_0x474447,null));};exports[_0x9397('0x68')]=function(_0x53b8a6,_0x2eaa89,_0x5e1ae9){var _0x1fefb4={'raw':![],'where':{}};var _0x5891fc={};var _0x2e2844={'count':0x0,'rows':[]};return db[_0x9397('0x43')][_0x9397('0x69')]({'where':{'id':_0x53b8a6[_0x9397('0x63')]['id']}})[_0x9397('0x1f')](handleEntityNotFound(_0x2eaa89,null))[_0x9397('0x1f')](function(_0x1ef3ef){if(_0x1ef3ef){_0x5891fc['model']=_[_0x9397('0x48')](db[_0x9397('0x67')][_0x9397('0x44')]);_0x5891fc[_0x9397('0x47')]=_[_0x9397('0x48')](_0x53b8a6[_0x9397('0x47')]);_0x5891fc[_0x9397('0x49')]=_[_0x9397('0x4a')](_0x5891fc['model'],_0x5891fc[_0x9397('0x47')]);_0x1fefb4['attributes']=_[_0x9397('0x4a')](_0x5891fc[_0x9397('0x46')],qs[_0x9397('0x4c')](_0x53b8a6[_0x9397('0x47')][_0x9397('0x4c')]));_0x1fefb4[_0x9397('0x4b')]=_0x1fefb4['attributes']['length']?_0x1fefb4[_0x9397('0x4b')]:_0x5891fc['model'];if(!_0x53b8a6[_0x9397('0x47')][_0x9397('0x4e')]('nolimit')){_0x1fefb4[_0x9397('0x30')]=qs[_0x9397('0x30')](_0x53b8a6[_0x9397('0x47')][_0x9397('0x30')]);_0x1fefb4[_0x9397('0x2e')]=qs[_0x9397('0x2e')](_0x53b8a6[_0x9397('0x47')][_0x9397('0x2e')]);}_0x1fefb4['order']=qs[_0x9397('0x4f')](_0x53b8a6[_0x9397('0x47')]['sort']);_0x1fefb4[_0x9397('0x50')]=qs[_0x9397('0x49')](_['pick'](_0x53b8a6[_0x9397('0x47')],_0x5891fc[_0x9397('0x49')]));_0x1fefb4[_0x9397('0x50')][_0x9397('0x66')]=_0x1ef3ef['id'];if(_0x53b8a6[_0x9397('0x47')]['filter']){_0x1fefb4[_0x9397('0x50')]=_[_0x9397('0x59')](_0x1fefb4[_0x9397('0x50')],{'$or':_['map'](_0x1fefb4[_0x9397('0x4b')],function(_0x4acc3e){var _0x5becc8={};_0x5becc8[_0x4acc3e]={'$like':'%'+_0x53b8a6[_0x9397('0x47')]['filter']+'%'};return _0x5becc8;})});}_0x1fefb4=_[_0x9397('0x59')]({},_0x1fefb4,_0x53b8a6[_0x9397('0x54')]);return db[_0x9397('0x67')][_0x9397('0x31')]({'where':_0x1fefb4[_0x9397('0x50')]})[_0x9397('0x1f')](function(_0x561c6d){_0x2e2844[_0x9397('0x31')]=_0x561c6d;if(_0x53b8a6[_0x9397('0x47')]['includeAll']){_0x1fefb4[_0x9397('0x56')]=[{'all':!![]}];}return db['Disposition'][_0x9397('0x57')](_0x1fefb4);})[_0x9397('0x1f')](function(_0x11860d){_0x2e2844[_0x9397('0x58')]=_0x11860d;return _0x2e2844;});}})['then'](respondWithFilteredResult(_0x2eaa89,_0x1fefb4))['catch'](handleError(_0x2eaa89,null));};exports[_0x9397('0x6a')]=function(_0x4edefb,_0x135219,_0x5e715f){return db['WhatsappAccount'][_0x9397('0x5a')]({'where':{'id':_0x4edefb[_0x9397('0x63')]['id']}})[_0x9397('0x1f')](handleEntityNotFound(_0x135219,null))[_0x9397('0x1f')](function(_0x23a66c){if(_0x23a66c){return _0x23a66c['removeDispositions'](_0x4edefb['query'][_0x9397('0x6b')]);}})[_0x9397('0x1f')](respondWithStatusCode(_0x135219,null))['catch'](handleError(_0x135219,null));};exports[_0x9397('0x6c')]=function(_0x2175a6,_0x192ccd,_0x4cce73){if(_0x2175a6['body']['id']){delete _0x2175a6[_0x9397('0x5c')]['id'];}return db[_0x9397('0x43')][_0x9397('0x5a')]({'where':{'id':_0x2175a6[_0x9397('0x63')]['id']}})[_0x9397('0x1f')](handleEntityNotFound(_0x192ccd,null))[_0x9397('0x1f')](function(_0x4c819d){if(_0x4c819d){_0x2175a6['body'][_0x9397('0x66')]=_0x4c819d['id'];return db[_0x9397('0x6d')][_0x9397('0x5b')](_0x2175a6['body']);}})[_0x9397('0x1f')](respondWithResult(_0x192ccd,null))[_0x9397('0x2a')](handleError(_0x192ccd,null));};exports['getAnswers']=function(_0x469078,_0x315315,_0x279f84){var _0x5be73e={'raw':![],'where':{}};var _0x137c07={};var _0x3f1c00={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x9397('0x69')]({'where':{'id':_0x469078['params']['id']}})[_0x9397('0x1f')](handleEntityNotFound(_0x315315,null))[_0x9397('0x1f')](function(_0x2bbb37){if(_0x2bbb37){_0x137c07[_0x9397('0x46')]=_[_0x9397('0x48')](db[_0x9397('0x6d')][_0x9397('0x44')]);_0x137c07[_0x9397('0x47')]=_['keys'](_0x469078[_0x9397('0x47')]);_0x137c07[_0x9397('0x49')]=_[_0x9397('0x4a')](_0x137c07['model'],_0x137c07['query']);_0x5be73e[_0x9397('0x4b')]=_['intersection'](_0x137c07['model'],qs[_0x9397('0x4c')](_0x469078[_0x9397('0x47')][_0x9397('0x4c')]));_0x5be73e[_0x9397('0x4b')]=_0x5be73e['attributes'][_0x9397('0x4d')]?_0x5be73e[_0x9397('0x4b')]:_0x137c07[_0x9397('0x46')];if(!_0x469078[_0x9397('0x47')]['hasOwnProperty']('nolimit')){_0x5be73e[_0x9397('0x30')]=qs[_0x9397('0x30')](_0x469078[_0x9397('0x47')][_0x9397('0x30')]);_0x5be73e['offset']=qs['offset'](_0x469078[_0x9397('0x47')][_0x9397('0x2e')]);}_0x5be73e[_0x9397('0x6e')]=qs['sort'](_0x469078['query']['sort']);_0x5be73e['where']=qs['filters'](_[_0x9397('0x6f')](_0x469078[_0x9397('0x47')],_0x137c07[_0x9397('0x49')]));_0x5be73e[_0x9397('0x50')][_0x9397('0x66')]=_0x2bbb37['id'];if(_0x469078[_0x9397('0x47')]['filter']){_0x5be73e[_0x9397('0x50')]=_[_0x9397('0x59')](_0x5be73e[_0x9397('0x50')],{'$or':_[_0x9397('0x42')](_0x5be73e[_0x9397('0x4b')],function(_0x1a8b92){var _0xb24633={};_0xb24633[_0x1a8b92]={'$like':'%'+_0x469078[_0x9397('0x47')][_0x9397('0x51')]+'%'};return _0xb24633;})});}_0x5be73e=_[_0x9397('0x59')]({},_0x5be73e,_0x469078['options']);return db[_0x9397('0x6d')][_0x9397('0x31')]({'where':_0x5be73e[_0x9397('0x50')]})[_0x9397('0x1f')](function(_0xee25b2){_0x3f1c00[_0x9397('0x31')]=_0xee25b2;if(_0x469078['query'][_0x9397('0x55')]){_0x5be73e[_0x9397('0x56')]=[{'all':!![]}];}return db[_0x9397('0x6d')]['findAll'](_0x5be73e);})[_0x9397('0x1f')](function(_0x213c0f){_0x3f1c00[_0x9397('0x58')]=_0x213c0f;return _0x3f1c00;});}})[_0x9397('0x1f')](respondWithFilteredResult(_0x315315,_0x5be73e))[_0x9397('0x2a')](handleError(_0x315315,null));};exports[_0x9397('0x70')]=function(_0x505970,_0x46d611,_0x3433c7){return db['WhatsappAccount'][_0x9397('0x5a')]({'where':{'id':_0x505970['params']['id']}})[_0x9397('0x1f')](handleEntityNotFound(_0x46d611,null))[_0x9397('0x1f')](function(_0x4e86f5){if(_0x4e86f5){return _0x4e86f5[_0x9397('0x70')](_0x505970[_0x9397('0x47')][_0x9397('0x6b')]);}})['then'](respondWithStatusCode(_0x46d611,null))[_0x9397('0x2a')](handleError(_0x46d611,null));};exports[_0x9397('0x71')]=function(_0x250d3f,_0x3bab3b,_0x1363d9){return db[_0x9397('0x43')][_0x9397('0x5a')]({'where':{'id':_0x250d3f[_0x9397('0x63')]['id']}})[_0x9397('0x1f')](handleEntityNotFound(_0x3bab3b,null))[_0x9397('0x1f')](function(_0x25ca2d){if(_0x25ca2d){return _0x25ca2d[_0x9397('0x71')](_0x250d3f[_0x9397('0x5c')][_0x9397('0x6b')],_['omit'](_0x250d3f['body'],['ids','id'])||{})[_0x9397('0x72')](function(_0x3d564e){for(var _0x799529=0x0;_0x799529<_0x250d3f[_0x9397('0x5c')][_0x9397('0x6b')]['length'];_0x799529+=0x1){socket[_0x9397('0x73')](_0x9397('0x74'),{'UserId':Number(_0x250d3f[_0x9397('0x5c')][_0x9397('0x6b')][_0x799529]),'WhatsappAccountId':Number(_0x250d3f[_0x9397('0x63')]['id'])});}return _0x3d564e;});}})[_0x9397('0x1f')](respondWithResult(_0x3bab3b,null))['catch'](handleError(_0x3bab3b,null));};exports[_0x9397('0x75')]=function(_0x38312b,_0x52454d,_0x140d02){return db[_0x9397('0x43')]['find']({'where':{'id':_0x38312b[_0x9397('0x63')]['id']}})[_0x9397('0x1f')](handleEntityNotFound(_0x52454d,null))[_0x9397('0x1f')](function(_0xbc10f){if(_0xbc10f){return _0xbc10f[_0x9397('0x75')](_0x38312b[_0x9397('0x47')][_0x9397('0x6b')])[_0x9397('0x1f')](function(){if(_[_0x9397('0x76')](_0x38312b[_0x9397('0x47')]['ids'])){for(var _0x21d38a=0x0;_0x21d38a<_0x38312b['query'][_0x9397('0x6b')][_0x9397('0x4d')];_0x21d38a+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x38312b[_0x9397('0x47')][_0x9397('0x6b')][_0x21d38a]),'WhatsappAccountId':Number(_0x38312b['params']['id'])});}}else{socket[_0x9397('0x73')](_0x9397('0x77'),{'UserId':Number(_0x38312b[_0x9397('0x47')]['ids']),'WhatsappAccountId':Number(_0x38312b[_0x9397('0x63')]['id'])});}});}})[_0x9397('0x1f')](respondWithStatusCode(_0x52454d,null))[_0x9397('0x2a')](handleError(_0x52454d,null));};exports[_0x9397('0x78')]=function(_0x350fdd,_0x422431,_0x2b83a9){var _0x524917={};var _0x159ee5={};var _0x369b87;var _0x4c47a2;return db[_0x9397('0x43')]['findOne']({'where':{'id':_0x350fdd['params']['id']}})['then'](handleEntityNotFound(_0x422431,null))[_0x9397('0x1f')](function(_0x152212){if(_0x152212){_0x369b87=_0x152212;_0x159ee5[_0x9397('0x46')]=_['keys'](db[_0x9397('0x79')][_0x9397('0x44')]);_0x159ee5[_0x9397('0x47')]=_[_0x9397('0x48')](_0x350fdd[_0x9397('0x47')]);_0x159ee5[_0x9397('0x49')]=_[_0x9397('0x4a')](_0x159ee5[_0x9397('0x46')],_0x159ee5[_0x9397('0x47')]);_0x524917[_0x9397('0x4b')]=_['intersection'](_0x159ee5['model'],qs[_0x9397('0x4c')](_0x350fdd[_0x9397('0x47')][_0x9397('0x4c')]));_0x524917[_0x9397('0x4b')]=_0x524917[_0x9397('0x4b')]['length']?_0x524917['attributes']:_0x159ee5[_0x9397('0x46')];_0x524917[_0x9397('0x6e')]=qs[_0x9397('0x4f')](_0x350fdd[_0x9397('0x47')][_0x9397('0x4f')]);_0x524917['where']=qs[_0x9397('0x49')](_[_0x9397('0x6f')](_0x350fdd[_0x9397('0x47')],_0x159ee5[_0x9397('0x49')]));if(_0x350fdd[_0x9397('0x47')][_0x9397('0x51')]){_0x524917[_0x9397('0x50')]=_[_0x9397('0x59')](_0x524917[_0x9397('0x50')],{'$or':_[_0x9397('0x42')](_0x524917[_0x9397('0x4b')],function(_0x2b2bc6){var _0x6dda87={};_0x6dda87[_0x2b2bc6]={'$like':'%'+_0x350fdd[_0x9397('0x47')]['filter']+'%'};return _0x6dda87;})});}_0x524917=_[_0x9397('0x59')]({},_0x524917,_0x350fdd[_0x9397('0x54')]);return _0x369b87[_0x9397('0x78')](_0x524917);}})[_0x9397('0x1f')](function(_0x1562d8){if(_0x1562d8){_0x4c47a2=_0x1562d8[_0x9397('0x4d')];if(!_0x350fdd[_0x9397('0x47')][_0x9397('0x4e')](_0x9397('0x7a'))){_0x524917[_0x9397('0x30')]=qs[_0x9397('0x30')](_0x350fdd['query'][_0x9397('0x30')]);_0x524917[_0x9397('0x2e')]=qs[_0x9397('0x2e')](_0x350fdd[_0x9397('0x47')]['offset']);}return _0x369b87['getAgents'](_0x524917);}})['then'](function(_0x507740){if(_0x507740){return _0x507740?{'count':_0x4c47a2,'rows':_0x507740}:null;}})[_0x9397('0x1f')](respondWithResult(_0x422431,null))['catch'](handleError(_0x422431,null));};exports[_0x9397('0x7b')]=function(_0x15b210,_0x2da2cc){var _0x52b950=_0x15b210['params']['id'];var _0x22699b=_0x15b210[_0x9397('0x5c')];var _0x2ffab9=0xc8;var _0x3b1f8f=null;return db[_0x9397('0x7c')][_0x9397('0x7d')]({'isolationLevel':db[_0x9397('0x7c')]['Transaction'][_0x9397('0x7e')]['READ_COMMITTED']},function(_0x53f0ed){return db[_0x9397('0x43')]['findOne']({'where':{'id':_0x52b950},'transaction':_0x53f0ed})[_0x9397('0x1f')](function(_0x55f219){if(_0x55f219){return db[_0x9397('0x7f')]['destroy']({'where':{'WhatsappAccountId':_0x52b950},'transaction':_0x53f0ed})['then'](function(){var _0x5e0d86=_[_0x9397('0x42')](_0x22699b,function(_0x415ac2){_0x415ac2[_0x9397('0x66')]=_0x52b950;return _0x415ac2;});return db['WhatsappApplication'][_0x9397('0x80')](_0x5e0d86,{'transaction':_0x53f0ed});});}else{_0x2ffab9=0x194;_0x3b1f8f=[];}});})[_0x9397('0x1f')](function(){if(_0x2ffab9!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x52b950},'order':_0x9397('0x81')})['then'](function(_0x3bd4c1){_0x3b1f8f=_0x3bd4c1;});}})['catch'](function(_0xd4201a){_0x2ffab9=0x1f4;logger[_0x9397('0x26')](_0xd4201a[_0x9397('0x3c')]);if(_0xd4201a[_0x9397('0x3d')]){delete _0xd4201a[_0x9397('0x3d')];}_0x3b1f8f=_0xd4201a;})[_0x9397('0x82')](function(){if(_0x3b1f8f===null){_0x2da2cc[_0x9397('0x2b')](_0x2ffab9);}else{if(_0x2ffab9===0x1f4){_0x2da2cc['status'](_0x2ffab9)['send'](_0x3b1f8f);}else{_0x2da2cc[_0x9397('0x2c')](_0x2ffab9)[_0x9397('0x2d')](_0x3b1f8f);}}});};exports[_0x9397('0x83')]=function(_0x4cb283,_0x4968f7,_0x1d422f){var _0x3d92cc={};var _0x3fcfec={};var _0x5ee00f;var _0x5eaa45;return db[_0x9397('0x43')]['findOne']({'where':{'id':_0x4cb283['params']['id']}})[_0x9397('0x1f')](handleEntityNotFound(_0x4968f7,null))[_0x9397('0x1f')](function(_0x316fe9){if(_0x316fe9){_0x5ee00f=_0x316fe9;_0x3fcfec[_0x9397('0x46')]=_['keys'](db[_0x9397('0x7f')][_0x9397('0x44')]);_0x3fcfec['query']=_[_0x9397('0x48')](_0x4cb283[_0x9397('0x47')]);_0x3fcfec[_0x9397('0x49')]=_[_0x9397('0x4a')](_0x3fcfec[_0x9397('0x46')],_0x3fcfec[_0x9397('0x47')]);_0x3d92cc['attributes']=_[_0x9397('0x4a')](_0x3fcfec[_0x9397('0x46')],qs[_0x9397('0x4c')](_0x4cb283['query'][_0x9397('0x4c')]));_0x3d92cc[_0x9397('0x4b')]=_0x3d92cc[_0x9397('0x4b')]['length']?_0x3d92cc[_0x9397('0x4b')]:_0x3fcfec[_0x9397('0x46')];_0x3d92cc[_0x9397('0x6e')]=qs[_0x9397('0x4f')](_0x4cb283['query'][_0x9397('0x4f')]);_0x3d92cc[_0x9397('0x50')]=qs['filters'](_[_0x9397('0x6f')](_0x4cb283[_0x9397('0x47')],_0x3fcfec[_0x9397('0x49')]));if(_0x4cb283[_0x9397('0x47')][_0x9397('0x51')]){_0x3d92cc['where']=_[_0x9397('0x59')](_0x3d92cc[_0x9397('0x50')],{'$or':_[_0x9397('0x42')](_0x3d92cc['attributes'],function(_0x188a3a){var _0x5f5a53={};_0x5f5a53[_0x188a3a]={'$like':'%'+_0x4cb283['query'][_0x9397('0x51')]+'%'};return _0x5f5a53;})});}_0x3d92cc=_['merge']({},_0x3d92cc,_0x4cb283[_0x9397('0x54')]);return _0x5ee00f[_0x9397('0x83')](_0x3d92cc);}})[_0x9397('0x1f')](function(_0x556fa9){if(_0x556fa9){_0x5eaa45=_0x556fa9[_0x9397('0x4d')];if(!_0x4cb283['query'][_0x9397('0x4e')]('nolimit')){_0x3d92cc[_0x9397('0x30')]=qs['limit'](_0x4cb283[_0x9397('0x47')][_0x9397('0x30')]);_0x3d92cc[_0x9397('0x2e')]=qs[_0x9397('0x2e')](_0x4cb283[_0x9397('0x47')][_0x9397('0x2e')]);}return _0x5ee00f[_0x9397('0x83')](_0x3d92cc);}})['then'](function(_0x504304){if(_0x504304){return _0x504304?{'count':_0x5eaa45,'rows':_0x504304}:null;}})['then'](respondWithResult(_0x4968f7,null))[_0x9397('0x2a')](handleError(_0x4968f7,null));};exports[_0x9397('0x84')]=function(_0x11dac8,_0x1d0424,_0x5051e8){var _0x4c9968={'channel':_0x9397('0x85')};var _0x550982=[];var _0x346db0=[];var _0x39b7fc={};return db[_0x9397('0x43')][_0x9397('0x5a')]({'where':{'id':_0x11dac8['params']['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x9397('0x86')}]})['then'](handleEntityNotFound(_0x1d0424,null))[_0x9397('0x1f')](function(_0x14b968){_0x4c9968[_0x9397('0x87')]=_0x14b968;if(_0x4c9968[_0x9397('0x87')]&&_0x4c9968['account'][_0x9397('0x52')]===_0x9397('0x88')&&_0x11dac8[_0x9397('0x5c')][_0x9397('0x89')]){if(_0x11dac8[_0x9397('0x5c')][_0x9397('0x89')][_0x9397('0x4d')]===0x0)return;if(_0x11dac8[_0x9397('0x5c')]['statuses'][0x0][_0x9397('0x8a')]!=='read')return;return db[_0x9397('0x8b')][_0x9397('0x36')]({'read':!![],'readAt':_0x11dac8[_0x9397('0x5c')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x11dac8['body'][_0x9397('0x89')][0x0]['message_id']},'individualHooks':!![]})[_0x9397('0x1f')](function(_0x32096e){return _0x1d0424['status'](0xc8)['json'](_0x32096e);});}_0x4c9968[_0x9397('0x8c')]=_[_0x9397('0x8d')](_0x14b968[_0x9397('0x86')],['priority'],[_0x9397('0x8e')]);if(_0x4c9968[_0x9397('0x87')][_0x9397('0x86')]){delete _0x4c9968['account'][_0x9397('0x86')];}return db[_0x9397('0x8f')][_0x9397('0x64')]()['then'](function(_0x52ff3b){if(!_0x52ff3b){throw new db[(_0x9397('0x90'))][(_0x9397('0x91'))](_0x9397('0x92'));}_0x550982=_[_0x9397('0x93')](_[_0x9397('0x48')](_0x52ff3b),['createdAt',_0x9397('0x94')]);_0x346db0=_[_0x9397('0x93')](_[_0x9397('0x48')](_0x52ff3b),[_0x9397('0x95'),_0x9397('0x94'),_0x9397('0x96'),_0x9397('0x97')]);_0x4c9968['body']={'mapKey':_0x9397('0x98')};if(_0x4c9968[_0x9397('0x87')]&&_0x4c9968[_0x9397('0x87')][_0x9397('0x52')]===_0x9397('0x99')){_0x4c9968[_0x9397('0x5c')][_0x9397('0x9a')]=_0x11dac8[_0x9397('0x5c')][_0x9397('0x9b')][_0x9397('0x9c')](_0x9397('0x9d'),'');_0x4c9968[_0x9397('0x5c')][_0x9397('0x5c')]=_0x11dac8['body'][_0x9397('0x9e')];_0x4c9968['body'][_0x9397('0x9f')]=_0x11dac8[_0x9397('0x5c')][_0x9397('0xa0')];}if(_0x4c9968[_0x9397('0x87')]&&_0x4c9968[_0x9397('0x87')]['type']===_0x9397('0x88')){_0x4c9968[_0x9397('0x5c')][_0x9397('0x9a')]=_0x11dac8[_0x9397('0x5c')][_0x9397('0xa1')][0x0]['from'];_0x4c9968[_0x9397('0x5c')][_0x9397('0x5c')]=_0x11dac8[_0x9397('0x5c')][_0x9397('0xa1')][0x0][_0x9397('0x28')]['body'];_0x4c9968[_0x9397('0x5c')][_0x9397('0x9f')]=_0x11dac8['body'][_0x9397('0xa1')][0x0]['message_id'];}if(_0x4c9968[_0x9397('0x5c')]['id']){delete _0x4c9968[_0x9397('0x5c')]['id'];}if(_[_0x9397('0xa2')](_0x4c9968['body']['from'])){throw new db['Sequelize'][(_0x9397('0x91'))](_0x9397('0xa3'));}if(_[_0x9397('0xa2')](_0x4c9968[_0x9397('0x5c')][_0x9397('0x5c')])||_0x4c9968[_0x9397('0x5c')][_0x9397('0x5c')]===''){throw new db[(_0x9397('0x90'))][(_0x9397('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9397('0xa2')](_0x4c9968['body']['mapKey'])){throw new db[(_0x9397('0x90'))]['ValidationError'](_0x9397('0xa4')+_0x346db0);}if(!_[_0x9397('0xa5')](_0x346db0,_0x4c9968[_0x9397('0x5c')][_0x9397('0xa6')])){throw new db[(_0x9397('0x90'))][(_0x9397('0x91'))](_0x9397('0xa7')+_0x346db0);}_0x39b7fc[_0x4c9968[_0x9397('0x5c')]['mapKey']]=_0x4c9968[_0x9397('0x5c')][_0x9397('0x9a')];return db['CmList'][_0x9397('0x5a')]({'where':{'id':_0x4c9968[_0x9397('0x87')]['ListId']},'include':[{'model':db[_0x9397('0x8f')],'as':'Contacts','where':_0x39b7fc,'limit':0x1,'order':[['updatedAt','DESC']]}]});})['then'](handleEntityNotFound(_0x1d0424,null))[_0x9397('0x1f')](function(_0x2f21a4){if(_0x2f21a4){_0x4c9968[_0x9397('0xa8')]=_[_0x9397('0xa9')](_0x2f21a4,[_0x9397('0xaa')]);if(_0x2f21a4['Contacts']['length']){return _0x2f21a4[_0x9397('0xaa')][0x0];}var _0x38434f=_[_0x9397('0x18')](_0x4c9968[_0x9397('0x5c')],{'firstName':_0x4c9968['body']['from'],'ListId':_0x2f21a4['id']});_0x38434f[_0x4c9968['body'][_0x9397('0xa6')]]=_0x4c9968[_0x9397('0x5c')][_0x9397('0x9a')];return db[_0x9397('0x8f')][_0x9397('0x5b')](_0x38434f,{'fields':_0x550982,'raw':!![]});}})[_0x9397('0x1f')](handleEntityNotFound(_0x1d0424,null))['then'](function(_0xd95bba){if(_0xd95bba){_0x4c9968[_0x9397('0xab')]=_0xd95bba;var _0x3d6d79={'ContactId':_0xd95bba['id'],'phone':_0x4c9968['body'][_0x9397('0x9a')],'WhatsappAccountId':_0x11dac8[_0x9397('0x63')]['id']};var _0x1d4df0={'ContactId':_0xd95bba['id'],'WhatsappAccountId':_0x11dac8[_0x9397('0x63')]['id'],'closed':![]};return db[_0x9397('0xac')][_0x9397('0x5a')]({'where':_0x1d4df0})[_0x9397('0x1f')](function(_0x13d103){if(_0x13d103){return[_0x13d103,![]];}return db[_0x9397('0xac')][_0x9397('0x5b')](_0x3d6d79)[_0x9397('0x1f')](function(_0x2d725e){return[_0x2d725e,!![]];});});}})[_0x9397('0x72')](function(_0x2446ab,_0x26a46e){_0x4c9968[_0x9397('0xad')]=_0x2446ab[_0x9397('0x38')]({'plain':!![]});_0x4c9968[_0x9397('0xad')][_0x9397('0xae')]=![];if(_0x26a46e){if(_0x4c9968['account'][_0x9397('0xaf')]){_0x4c9968[_0x9397('0x8c')][_0x9397('0xb0')]({'id':0x0,'priority':_0x4c9968['applications'][_0x9397('0x4d')]+0x1,'app':_0x9397('0xb1'),'appdata':_0x9397('0xb2'),'interval':_0x9397('0xb3')});}_0x4c9968[_0x9397('0xad')]['created']=!![];}return db[_0x9397('0x8b')][_0x9397('0x5b')]({'phone':_0x4c9968[_0x9397('0x5c')][_0x9397('0x9a')],'messageId':_0x4c9968[_0x9397('0x5c')][_0x9397('0x9f')],'body':_0x4c9968[_0x9397('0x5c')]['body'],'WhatsappAccountId':_0x11dac8[_0x9397('0x63')]['id'],'WhatsappInteractionId':_0x2446ab['id'],'direction':'in','ContactId':_0x2446ab[_0x9397('0xb4')],'AttachmentId':_0x4c9968[_0x9397('0x5c')]['AttachmentId']});})[_0x9397('0x1f')](function(_0xc00c8f){_0x4c9968[_0x9397('0x28')]=_0xc00c8f;if(_0x4c9968[_0x9397('0xad')][_0x9397('0xb5')]){return db[_0x9397('0x79')][_0x9397('0x5a')]({'attributes':['id',_0x9397('0x3d')],'where':{'id':_0x4c9968[_0x9397('0xad')][_0x9397('0xb5')]}})[_0x9397('0x1f')](function(_0x4116bc){if(_0x4116bc){_0x4c9968[_0x9397('0x8c')][_0x9397('0xb6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4116bc[_0x9397('0x3d')]+','+(_0x4c9968['account'][_0x9397('0xb7')]||0xa),'interval':_0x9397('0xb3')});}return respondWithRpcPromise(_0x9397('0xb8'),'startRouting',_0x4c9968);});}return respondWithRpcPromise(_0x9397('0xb8'),'startRouting',_0x4c9968);})['then'](function(_0x2c4b76){if(_0x2c4b76){var _0x252a3b=0xc8;var _0x3d074b=_0x9397('0xb9');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3d074b,_0x252a3b,'entity\x20found');logger[_0x9397('0x23')](_0x9397('0xba'),_0x3d074b,_0x252a3b,'entity\x20found',JSON[_0x9397('0x25')](_0x2c4b76));if(_0x4c9968[_0x9397('0x87')]['type']===_0x9397('0x99')){return _0x1d0424[_0x9397('0x2c')](_0x252a3b)[_0x9397('0x32')](_0x9397('0xbb'),_0x9397('0xbc'))['send'](_0x9397('0xbd'));}else{return _0x1d0424[_0x9397('0x2c')](_0x252a3b)[_0x9397('0x2d')](_0x2c4b76);}}});})['catch'](handleError(_0x1d0424,null));};exports[_0x9397('0x3e')]=function(_0x53c7d5,_0x19469b,_0x28a746){var _0xf55b20,_0x3ec04a,_0x3837fd;if(_[_0x9397('0xa2')](_0x53c7d5[_0x9397('0x5c')]['body'])||_0x53c7d5['body'][_0x9397('0x5c')]===''){throw new db[(_0x9397('0x90'))][(_0x9397('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x53c7d5['body']['to'])){throw new db[(_0x9397('0x90'))][(_0x9397('0x91'))](_0x9397('0xbe'));}_0xf55b20=_0x53c7d5[_0x9397('0x5c')]['to'];return db[_0x9397('0x43')][_0x9397('0x5a')]({'where':{'id':_0x53c7d5[_0x9397('0x63')]['id']},'include':[{'model':db[_0x9397('0xbf')],'as':_0x9397('0xc0'),'include':[{'model':db[_0x9397('0x8f')],'as':'Contacts','where':{'mobile':_0xf55b20},'limit':0x1,'order':[[_0x9397('0x94'),'DESC']]}]}]})[_0x9397('0x1f')](handleEntityNotFound(_0x19469b,null))['then'](function(_0x4a1fed){if(_0x4a1fed&&_0x4a1fed['List']){_0x3ec04a=_0x4a1fed['get']({'plain':!![]});if(_0x3ec04a[_0x9397('0xc0')]&&_0x3ec04a[_0x9397('0xc0')]['Contacts'][_0x9397('0x4d')]){return _0x3ec04a[_0x9397('0xc0')][_0x9397('0xaa')][0x0];}return db['CmContact'][_0x9397('0x5b')](_[_0x9397('0x18')](_0x53c7d5[_0x9397('0x5c')],{'firstName':_0xf55b20,'mobile':_0xf55b20,'phone':_0xf55b20,'ListId':_0x3ec04a[_0x9397('0x97')]}));}})['then'](handleEntityNotFound(_0x19469b,null))[_0x9397('0x1f')](function(_0x42933d){if(_0x42933d){_0x3837fd=_0x42933d;return db[_0x9397('0xac')][_0x9397('0x5a')]({'where':{'ContactId':_0x3837fd['id'],'closed':![],'WhatsappAccountId':_0x3ec04a['id']}})[_0x9397('0x1f')](function(_0x53577c){if(_0x53577c){return[_0x53577c,![]];}return db[_0x9397('0xac')][_0x9397('0x5b')]({'UserId':_0x53c7d5[_0x9397('0x5d')]['id'],'ContactId':_0x3837fd['id'],'WhatsappAccountId':_0x3ec04a['id'],'phone':_0xf55b20,'firstMsgDirection':_0x9397('0xc1'),'Messages':[_[_0x9397('0x59')](_0x53c7d5[_0x9397('0x5c')],{'read':![],'body':_0x53c7d5[_0x9397('0x5c')][_0x9397('0x5c')],'phone':_0xf55b20,'WhatsappAccountId':_0x3ec04a['id'],'UserId':_0x53c7d5['user']['id'],'ContactId':_0x3837fd['id']})]},{'include':[{'model':db[_0x9397('0x8b')],'as':_0x9397('0xc2')}]})[_0x9397('0x1f')](function(_0xced8c3){return[_0xced8c3,!![]];});});}})[_0x9397('0x72')](function(_0xf8cd73,_0x55cb20){if(_0x55cb20){return _0xf8cd73;}return db[_0x9397('0x8b')][_0x9397('0x5b')](_[_0x9397('0x59')](_0x53c7d5[_0x9397('0x5c')],{'read':![],'body':_0x53c7d5[_0x9397('0x5c')][_0x9397('0x5c')],'phone':_0xf55b20,'WhatsappAccountId':_0x3ec04a['id'],'WhatsappInteractionId':_0xf8cd73['id'],'UserId':_0x53c7d5[_0x9397('0x5d')]['id'],'ContactId':_0x3837fd['id']}))[_0x9397('0x1f')](function(_0x9848dd){_0xf8cd73['dataValues'][_0x9397('0xc2')]=[];_0xf8cd73['dataValues'][_0x9397('0xc2')][_0x9397('0xb0')](_0x9848dd[_0x9397('0xc3')]);return _0xf8cd73;});})[_0x9397('0x1f')](respondWithResult(_0x19469b,null))[_0x9397('0x2a')](handleError(_0x19469b,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 6ddddfb..3a4f30c 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 _0xbc95=['save','update','remove','emit','hasOwnProperty','hook','events','setMaxListeners'];(function(_0x13c22c,_0x170015){var _0x16237c=function(_0x2ef781){while(--_0x2ef781){_0x13c22c['push'](_0x13c22c['shift']());}};_0x16237c(++_0x170015);}(_0xbc95,0x186));var _0x5bc9=function(_0x7fabe1,_0x5d2150){_0x7fabe1=_0x7fabe1-0x0;var _0x43669e=_0xbc95[_0x7fabe1];return _0x43669e;};'use strict';var EventEmitter=require(_0x5bc9('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x5bc9('0x1')](0x0);var events={'afterCreate':_0x5bc9('0x2'),'afterUpdate':_0x5bc9('0x3'),'afterDestroy':_0x5bc9('0x4')};function emitEvent(_0x5f1eb5){return function(_0x48dc9e,_0x3e3d18,_0x45114b){WhatsappAccountEvents[_0x5bc9('0x5')](_0x5f1eb5+':'+_0x48dc9e['id'],_0x48dc9e);WhatsappAccountEvents['emit'](_0x5f1eb5,_0x48dc9e);_0x45114b(null);};}for(var e in events){if(events[_0x5bc9('0x6')](e)){var event=events[e];WhatsappAccount[_0x5bc9('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x395d=['WhatsappAccount','setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x29585f,_0x18c739){var _0x15d0fd=function(_0x4ace84){while(--_0x4ace84){_0x29585f['push'](_0x29585f['shift']());}};_0x15d0fd(++_0x18c739);}(_0x395d,0xa9));var _0xd395=function(_0x16fc17,_0x5f5112){_0x16fc17=_0x16fc17-0x0;var _0x277a0f=_0x395d[_0x16fc17];return _0x277a0f;};'use strict';var EventEmitter=require(_0xd395('0x0'));var WhatsappAccount=require(_0xd395('0x1'))['db'][_0xd395('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xd395('0x3')](0x0);var events={'afterCreate':_0xd395('0x4'),'afterUpdate':_0xd395('0x5'),'afterDestroy':_0xd395('0x6')};function emitEvent(_0x2c72e8){return function(_0x4df7a2,_0x4e0434,_0x53b8ca){WhatsappAccountEvents[_0xd395('0x7')](_0x2c72e8+':'+_0x4df7a2['id'],_0x4df7a2);WhatsappAccountEvents[_0xd395('0x7')](_0x2c72e8,_0x4df7a2);_0x53b8ca(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xd395('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 2ab0f77..7508ad0 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 _0x2965=['../../config/environment','./whatsappAccount.attributes','WhatsappAccount','lodash','util','moment','bluebird','request-promise','path'];(function(_0x18e0d1,_0xbca4cb){var _0x58db41=function(_0x5ccffd){while(--_0x5ccffd){_0x18e0d1['push'](_0x18e0d1['shift']());}};_0x58db41(++_0xbca4cb);}(_0x2965,0x93));var _0x5296=function(_0x46daa3,_0x12d283){_0x46daa3=_0x46daa3-0x0;var _0x23157e=_0x2965[_0x46daa3];return _0x23157e;};'use strict';var _=require(_0x5296('0x0'));var util=require(_0x5296('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5296('0x2'));var BPromise=require(_0x5296('0x3'));var rp=require(_0x5296('0x4'));var fs=require('fs');var path=require(_0x5296('0x5'));var rimraf=require('rimraf');var config=require(_0x5296('0x6'));var attributes=require(_0x5296('0x7'));module['exports']=function(_0x4871c9,_0x4c0664){return _0x4871c9['define'](_0x5296('0x8'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc8e=['whatsapp_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./whatsappAccount.attributes','exports','define','WhatsappAccount'];(function(_0x641f18,_0x2919e8){var _0x16eefe=function(_0x578a89){while(--_0x578a89){_0x641f18['push'](_0x641f18['shift']());}};_0x16eefe(++_0x2919e8);}(_0xbc8e,0xc1));var _0xebc8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xbc8e[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xebc8('0x0'));var util=require('util');var logger=require(_0xebc8('0x1'))(_0xebc8('0x2'));var moment=require(_0xebc8('0x3'));var BPromise=require(_0xebc8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xebc8('0x5'));var rimraf=require(_0xebc8('0x6'));var config=require('../../config/environment');var attributes=require(_0xebc8('0x7'));module[_0xebc8('0x8')]=function(_0x59718f,_0x53cb1e){return _0x59718f[_0xebc8('0x9')](_0xebc8('0xa'),attributes,{'tableName':_0xebc8('0xb'),'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 9e86982..12c7876 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 _0xc90c=['attributes','include','map','model','lodash','util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where'];(function(_0x58aa05,_0x7333b5){var _0x5d16b9=function(_0x6804b9){while(--_0x6804b9){_0x58aa05['push'](_0x58aa05['shift']());}};_0x5d16b9(++_0x7333b5);}(_0xc90c,0x1a6));var _0xcc90=function(_0x5966a3,_0x4b823b){_0x5966a3=_0x5966a3-0x0;var _0x4e50c7=_0xc90c[_0x5966a3];return _0x4e50c7;};'use strict';var _=require(_0xcc90('0x0'));var util=require(_0xcc90('0x1'));var moment=require(_0xcc90('0x2'));var BPromise=require(_0xcc90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcc90('0x4'))(_0xcc90('0x5'));var config=require(_0xcc90('0x6'));var jayson=require(_0xcc90('0x7'));var client=jayson[_0xcc90('0x8')][_0xcc90('0x9')]({'port':0x232a});config[_0xcc90('0xa')]=_[_0xcc90('0xb')](config[_0xcc90('0xa')],{'host':_0xcc90('0xc'),'port':0x18eb});var socket=require(_0xcc90('0xd'))(new Redis(config[_0xcc90('0xa')]));require(_0xcc90('0xe'))['register'](socket);function respondWithRpcPromise(_0x4122d1,_0x1b07af,_0x2f8cbd){return new BPromise(function(_0x2e8116,_0x11a559){return client[_0xcc90('0xf')](_0x4122d1,_0x2f8cbd)[_0xcc90('0x10')](function(_0x27e717){logger[_0xcc90('0x11')](_0xcc90('0x12'),_0x1b07af,_0xcc90('0x13'));logger[_0xcc90('0x14')](_0xcc90('0x15'),_0x1b07af,_0xcc90('0x13'),JSON[_0xcc90('0x16')](_0x27e717));if(_0x27e717[_0xcc90('0x17')]){if(_0x27e717['error'][_0xcc90('0x18')]===0x1f4){logger['error'](_0xcc90('0x12'),_0x1b07af,_0x27e717[_0xcc90('0x17')]['message']);return _0x11a559(_0x27e717[_0xcc90('0x17')]['message']);}logger[_0xcc90('0x17')](_0xcc90('0x12'),_0x1b07af,_0x27e717['error']['message']);return _0x2e8116(_0x27e717[_0xcc90('0x17')][_0xcc90('0x19')]);}else{logger['info'](_0xcc90('0x12'),_0x1b07af,_0xcc90('0x13'));_0x2e8116(_0x27e717[_0xcc90('0x1a')]['message']);}})[_0xcc90('0x1b')](function(_0x3c6853){logger[_0xcc90('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x1b07af,_0x3c6853);_0x11a559(_0x3c6853);});});}exports[_0xcc90('0x1c')]=function(_0x35c24e){var _0x43661c=this;return new Promise(function(_0x3180e9,_0x1510d0){return db[_0xcc90('0x1d')][_0xcc90('0x1e')]({'raw':_0x35c24e[_0xcc90('0x1f')]?_0x35c24e[_0xcc90('0x1f')][_0xcc90('0x20')]===undefined?!![]:![]:!![],'where':_0x35c24e[_0xcc90('0x1f')]?_0x35c24e[_0xcc90('0x1f')][_0xcc90('0x21')]||null:null,'attributes':_0x35c24e[_0xcc90('0x1f')]?_0x35c24e['options'][_0xcc90('0x22')]||null:null,'include':_0x35c24e[_0xcc90('0x1f')]?_0x35c24e[_0xcc90('0x1f')][_0xcc90('0x23')]?_[_0xcc90('0x24')](_0x35c24e[_0xcc90('0x1f')]['include'],function(_0x592956){return{'model':db[_0x592956[_0xcc90('0x25')]],'as':_0x592956['as'],'attributes':_0x592956['attributes'],'include':_0x592956[_0xcc90('0x23')]?_['map'](_0x592956[_0xcc90('0x23')],function(_0x49bdcc){return{'model':db[_0x49bdcc['model']],'as':_0x49bdcc['as'],'attributes':_0x49bdcc[_0xcc90('0x22')],'include':_0x49bdcc[_0xcc90('0x23')]?_[_0xcc90('0x24')](_0x49bdcc[_0xcc90('0x23')],function(_0x145c88){return{'model':db[_0x145c88['model']],'as':_0x145c88['as'],'attributes':_0x145c88[_0xcc90('0x22')]};}):[]};}):[]};}):[]:[]})[_0xcc90('0x10')](function(_0x2cc917){logger[_0xcc90('0x11')](_0xcc90('0x1c'),_0x35c24e);logger['debug'](_0xcc90('0x1c'),_0x35c24e,JSON[_0xcc90('0x16')](_0x2cc917));_0x3180e9(_0x2cc917);})['catch'](function(_0x2e297c){logger['error'](_0xcc90('0x1c'),_0x2e297c[_0xcc90('0x19')],_0x35c24e);_0x1510d0(_0x43661c[_0xcc90('0x17')](0x1f4,_0x2e297c[_0xcc90('0x19')]));});});}; \ No newline at end of file +var _0xa508=['message','info','result','catch','WhatsappAccount','find','options','raw','where','attributes','include','map','model','ShowWhatsappAccount','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5ec3f3,_0x3df416){var _0xf0bb05=function(_0x508eaa){while(--_0x508eaa){_0x5ec3f3['push'](_0x5ec3f3['shift']());}};_0xf0bb05(++_0x3df416);}(_0xa508,0x83));var _0x8a50=function(_0x5ec893,_0x55a18b){_0x5ec893=_0x5ec893-0x0;var _0x4497e5=_0xa508[_0x5ec893];return _0x4497e5;};'use strict';var _=require(_0x8a50('0x0'));var util=require(_0x8a50('0x1'));var moment=require('moment');var BPromise=require(_0x8a50('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a50('0x3'));var db=require(_0x8a50('0x4'))['db'];var utils=require(_0x8a50('0x5'));var logger=require(_0x8a50('0x6'))(_0x8a50('0x7'));var config=require(_0x8a50('0x8'));var jayson=require(_0x8a50('0x9'));var client=jayson[_0x8a50('0xa')]['http']({'port':0x232a});config[_0x8a50('0xb')]=_[_0x8a50('0xc')](config[_0x8a50('0xb')],{'host':_0x8a50('0xd'),'port':0x18eb});var socket=require(_0x8a50('0xe'))(new Redis(config[_0x8a50('0xb')]));require(_0x8a50('0xf'))['register'](socket);function respondWithRpcPromise(_0x44e6ee,_0x169c59,_0x164835){return new BPromise(function(_0x394ffa,_0x4829d1){return client[_0x8a50('0x10')](_0x44e6ee,_0x164835)[_0x8a50('0x11')](function(_0x5c2449){logger['info'](_0x8a50('0x12'),_0x169c59,_0x8a50('0x13'));logger[_0x8a50('0x14')](_0x8a50('0x15'),_0x169c59,_0x8a50('0x13'),JSON[_0x8a50('0x16')](_0x5c2449));if(_0x5c2449['error']){if(_0x5c2449[_0x8a50('0x17')][_0x8a50('0x18')]===0x1f4){logger[_0x8a50('0x17')](_0x8a50('0x12'),_0x169c59,_0x5c2449[_0x8a50('0x17')]['message']);return _0x4829d1(_0x5c2449[_0x8a50('0x17')]['message']);}logger[_0x8a50('0x17')](_0x8a50('0x12'),_0x169c59,_0x5c2449['error'][_0x8a50('0x19')]);return _0x394ffa(_0x5c2449[_0x8a50('0x17')][_0x8a50('0x19')]);}else{logger[_0x8a50('0x1a')]('WhatsappAccount,\x20%s,\x20%s',_0x169c59,_0x8a50('0x13'));_0x394ffa(_0x5c2449[_0x8a50('0x1b')][_0x8a50('0x19')]);}})[_0x8a50('0x1c')](function(_0x4c6830){logger[_0x8a50('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x169c59,_0x4c6830);_0x4829d1(_0x4c6830);});});}exports['ShowWhatsappAccount']=function(_0x19a621){var _0x34ed92=this;return new Promise(function(_0xdd7401,_0x34b4bf){return db[_0x8a50('0x1d')][_0x8a50('0x1e')]({'raw':_0x19a621[_0x8a50('0x1f')]?_0x19a621[_0x8a50('0x1f')][_0x8a50('0x20')]===undefined?!![]:![]:!![],'where':_0x19a621[_0x8a50('0x1f')]?_0x19a621[_0x8a50('0x1f')][_0x8a50('0x21')]||null:null,'attributes':_0x19a621[_0x8a50('0x1f')]?_0x19a621[_0x8a50('0x1f')][_0x8a50('0x22')]||null:null,'include':_0x19a621[_0x8a50('0x1f')]?_0x19a621['options'][_0x8a50('0x23')]?_[_0x8a50('0x24')](_0x19a621['options'][_0x8a50('0x23')],function(_0x4298c0){return{'model':db[_0x4298c0[_0x8a50('0x25')]],'as':_0x4298c0['as'],'attributes':_0x4298c0[_0x8a50('0x22')],'include':_0x4298c0[_0x8a50('0x23')]?_[_0x8a50('0x24')](_0x4298c0[_0x8a50('0x23')],function(_0x6061e9){return{'model':db[_0x6061e9[_0x8a50('0x25')]],'as':_0x6061e9['as'],'attributes':_0x6061e9[_0x8a50('0x22')],'include':_0x6061e9[_0x8a50('0x23')]?_[_0x8a50('0x24')](_0x6061e9[_0x8a50('0x23')],function(_0x402d7c){return{'model':db[_0x402d7c[_0x8a50('0x25')]],'as':_0x402d7c['as'],'attributes':_0x402d7c[_0x8a50('0x22')]};}):[]};}):[]};}):[]:[]})[_0x8a50('0x11')](function(_0x5f2c67){logger[_0x8a50('0x1a')]('ShowWhatsappAccount',_0x19a621);logger[_0x8a50('0x14')](_0x8a50('0x26'),_0x19a621,JSON[_0x8a50('0x16')](_0x5f2c67));_0xdd7401(_0x5f2c67);})[_0x8a50('0x1c')](function(_0x42ee41){logger[_0x8a50('0x17')](_0x8a50('0x26'),_0x42ee41[_0x8a50('0x19')],_0x19a621);_0x34b4bf(_0x34ed92['error'](0x1f4,_0x42ee41['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 7b250a8..0a7deda 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 _0x298e=['length','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x2f546a,_0x56002f){var _0x58003b=function(_0x47b01f){while(--_0x47b01f){_0x2f546a['push'](_0x2f546a['shift']());}};_0x58003b(++_0x56002f);}(_0x298e,0x1df));var _0xe298=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x298e[_0x4e676e];return _0x336a3c;};'use strict';var WhatsappAccountEvents=require(_0xe298('0x0'));var events=[_0xe298('0x1'),_0xe298('0x2'),_0xe298('0x3')];function createListener(_0x3490fe,_0x23c4b7){return function(_0x4120e4){_0x23c4b7[_0xe298('0x4')](_0x3490fe,_0x4120e4);};}function removeListener(_0x1dc892,_0x6dc0fc){return function(){WhatsappAccountEvents[_0xe298('0x5')](_0x1dc892,_0x6dc0fc);};}exports[_0xe298('0x6')]=function(_0x49d12f){for(var _0x290d97=0x0,_0x4df37d=events[_0xe298('0x7')];_0x290d97<_0x4df37d;_0x290d97++){var _0x2b8a0c=events[_0x290d97];var _0x493da2=createListener(_0xe298('0x8')+_0x2b8a0c,_0x49d12f);WhatsappAccountEvents['on'](_0x2b8a0c,_0x493da2);}}; \ No newline at end of file +var _0xe787=['update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save','remove'];(function(_0x3270ac,_0x2b6e53){var _0x1c3e32=function(_0x1f1202){while(--_0x1f1202){_0x3270ac['push'](_0x3270ac['shift']());}};_0x1c3e32(++_0x2b6e53);}(_0xe787,0x72));var _0x7e78=function(_0x3f2fea,_0x3c4ea8){_0x3f2fea=_0x3f2fea-0x0;var _0x69a4d5=_0xe787[_0x3f2fea];return _0x69a4d5;};'use strict';var WhatsappAccountEvents=require(_0x7e78('0x0'));var events=[_0x7e78('0x1'),_0x7e78('0x2'),_0x7e78('0x3')];function createListener(_0x19f8e7,_0x339e14){return function(_0x27c65a){_0x339e14[_0x7e78('0x4')](_0x19f8e7,_0x27c65a);};}function removeListener(_0x737c54,_0x3c76a4){return function(){WhatsappAccountEvents[_0x7e78('0x5')](_0x737c54,_0x3c76a4);};}exports[_0x7e78('0x6')]=function(_0x3adb17){for(var _0x2f6695=0x0,_0x365981=events[_0x7e78('0x7')];_0x2f6695<_0x365981;_0x2f6695++){var _0x3ebcf0=events[_0x2f6695];var _0x47579a=createListener(_0x7e78('0x8')+_0x3ebcf0,_0x3adb17);WhatsappAccountEvents['on'](_0x3ebcf0,_0x47579a);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 01a1eae..974ec8a 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 _0x7527=['get','show','post','put','/:id','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x502048,_0x557de3){var _0x591dbf=function(_0x394e10){while(--_0x394e10){_0x502048['push'](_0x502048['shift']());}};_0x591dbf(++_0x557de3);}(_0x7527,0x19f));var _0x7752=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7527[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7752('0x0'));var util=require(_0x7752('0x1'));var path=require(_0x7752('0x2'));var timeout=require(_0x7752('0x3'));var express=require(_0x7752('0x4'));var router=express['Router']();var fs_extra=require(_0x7752('0x5'));var auth=require(_0x7752('0x6'));var interaction=require(_0x7752('0x7'));var config=require(_0x7752('0x8'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x7752('0x9')](),controller['index']);router[_0x7752('0xa')]('/:id',auth[_0x7752('0x9')](),controller[_0x7752('0xb')]);router[_0x7752('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7752('0xd')](_0x7752('0xe'),auth[_0x7752('0x9')](),controller[_0x7752('0xf')]);router['delete'](_0x7752('0xe'),auth[_0x7752('0x9')](),controller[_0x7752('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5807=['util','connect-timeout','express','Router','../../components/interaction/service','index','get','/:id','isAuthenticated','show','create','delete','destroy','multer'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0x5807,0x109));var _0x7580=function(_0x52b7b9,_0x43ed4b){_0x52b7b9=_0x52b7b9-0x0;var _0x5b5d30=_0x5807[_0x52b7b9];return _0x5b5d30;};'use strict';var multer=require(_0x7580('0x0'));var util=require(_0x7580('0x1'));var path=require('path');var timeout=require(_0x7580('0x2'));var express=require(_0x7580('0x3'));var router=express[_0x7580('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7580('0x5'));var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7580('0x6')]);router[_0x7580('0x7')](_0x7580('0x8'),auth[_0x7580('0x9')](),controller[_0x7580('0xa')]);router['post']('/',auth[_0x7580('0x9')](),controller[_0x7580('0xb')]);router['put'](_0x7580('0x8'),auth[_0x7580('0x9')](),controller['update']);router[_0x7580('0xc')](_0x7580('0x8'),auth[_0x7580('0x9')](),controller[_0x7580('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 3e8a2a8..9612f0e 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 _0x9bca=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x51ebc9,_0x1a0db1){var _0x4b7e0b=function(_0x34b202){while(--_0x34b202){_0x51ebc9['push'](_0x51ebc9['shift']());}};_0x4b7e0b(++_0x1a0db1);}(_0x9bca,0x163));var _0xa9bc=function(_0x32047a,_0x4b7ab2){_0x32047a=_0x32047a-0x0;var _0x4a85fa=_0x9bca[_0x32047a];return _0x4a85fa;};'use strict';var Sequelize=require(_0xa9bc('0x0'));module[_0xa9bc('0x1')]={'priority':{'type':Sequelize[_0xa9bc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa9bc('0x3')],'allowNull':![],'defaultValue':_0xa9bc('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa9bc('0x3')]},'interval':{'type':Sequelize[_0xa9bc('0x3')],'defaultValue':_0xa9bc('0x5')}}; \ No newline at end of file +var _0x7286=['noop','TEXT','*,*,*,*','exports','STRING'];(function(_0x4b775b,_0x2aadc6){var _0xf84d39=function(_0x55ac96){while(--_0x55ac96){_0x4b775b['push'](_0x4b775b['shift']());}};_0xf84d39(++_0x2aadc6);}(_0x7286,0xa3));var _0x6728=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7286[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0x6728('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6728('0x1')],'allowNull':![],'defaultValue':_0x6728('0x2')},'appdata':{'type':Sequelize[_0x6728('0x3')]()},'description':{'type':Sequelize[_0x6728('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6728('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 99ed4b5..94abad7 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 _0x4c4a=['WhatsappApplication','include','findAll','rows','catch','show','length','includeAll','options','find','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x4c4a,0x1d0));var _0xa4c4=function(_0x45463c,_0x5988f8){_0x45463c=_0x45463c-0x0;var _0x240e9e=_0x4c4a[_0x45463c];return _0x240e9e;};'use strict';var emlformat=require(_0xa4c4('0x0'));var rimraf=require(_0xa4c4('0x1'));var zipdir=require(_0xa4c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa4c4('0x3'));var moment=require(_0xa4c4('0x4'));var BPromise=require(_0xa4c4('0x5'));var Mustache=require(_0xa4c4('0x6'));var util=require('util');var path=require(_0xa4c4('0x7'));var sox=require('sox');var csv=require(_0xa4c4('0x8'));var ejs=require(_0xa4c4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa4c4('0xa'));var crypto=require('crypto');var jsforce=require(_0xa4c4('0xb'));var deskjs=require(_0xa4c4('0xc'));var toCsv=require(_0xa4c4('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa4c4('0xd'));var authService=require(_0xa4c4('0xe'));var qs=require(_0xa4c4('0xf'));var as=require(_0xa4c4('0x10'));var hardwareService=require(_0xa4c4('0x11'));var logger=require('../../config/logger')(_0xa4c4('0x12'));var utils=require('../../config/utils');var config=require(_0xa4c4('0x13'));var licenseUtil=require(_0xa4c4('0x14'));var db=require(_0xa4c4('0x15'))['db'];function respondWithStatusCode(_0x2f6c71,_0x1d7750){_0x1d7750=_0x1d7750||0xcc;return function(_0x1f2051){if(_0x1f2051){return _0x2f6c71[_0xa4c4('0x16')](_0x1d7750);}return _0x2f6c71[_0xa4c4('0x17')](_0x1d7750)[_0xa4c4('0x18')]();};}function respondWithResult(_0x57ae15,_0x1abded){_0x1abded=_0x1abded||0xc8;return function(_0x35cc1f){if(_0x35cc1f){return _0x57ae15[_0xa4c4('0x17')](_0x1abded)[_0xa4c4('0x19')](_0x35cc1f);}};}function respondWithFilteredResult(_0x14a55c,_0x19033a){return function(_0x31cde0){if(_0x31cde0){var _0x5e8006=typeof _0x19033a[_0xa4c4('0x1a')]===_0xa4c4('0x1b')&&typeof _0x19033a['limit']===_0xa4c4('0x1b');var _0x451dfa=_0x31cde0[_0xa4c4('0x1c')];var _0x5f5ef=_0x5e8006?0x0:_0x19033a[_0xa4c4('0x1a')];var _0x40661e=_0x5e8006?_0x31cde0[_0xa4c4('0x1c')]:_0x19033a[_0xa4c4('0x1a')]+_0x19033a[_0xa4c4('0x1d')];var _0x157143;if(_0x40661e>=_0x451dfa){_0x40661e=_0x451dfa;_0x157143=0xc8;}else{_0x157143=0xce;}_0x14a55c[_0xa4c4('0x17')](_0x157143);return _0x14a55c[_0xa4c4('0x1e')](_0xa4c4('0x1f'),_0x5f5ef+'-'+_0x40661e+'/'+_0x451dfa)[_0xa4c4('0x19')](_0x31cde0);}return null;};}function patchUpdates(_0x19e17e){return function(_0x167502){try{jsonpatch[_0xa4c4('0x20')](_0x167502,_0x19e17e,!![]);}catch(_0x3cb3a7){return BPromise[_0xa4c4('0x21')](_0x3cb3a7);}return _0x167502['save']();};}function saveUpdates(_0x4e0249,_0x183bdf){return function(_0x3aa9a8){if(_0x3aa9a8){return _0x3aa9a8[_0xa4c4('0x22')](_0x4e0249)[_0xa4c4('0x23')](function(_0xd56b75){return _0xd56b75;});}return null;};}function removeEntity(_0x76b8f1,_0x5f1215){return function(_0x568b6a){if(_0x568b6a){return _0x568b6a['destroy']()[_0xa4c4('0x23')](function(){_0x76b8f1[_0xa4c4('0x17')](0xcc)[_0xa4c4('0x18')]();});}};}function handleEntityNotFound(_0x50bb08,_0x295c57){return function(_0x41f1ac){if(!_0x41f1ac){_0x50bb08[_0xa4c4('0x16')](0x194);}return _0x41f1ac;};}function handleError(_0x48a503,_0x40435d){_0x40435d=_0x40435d||0x1f4;return function(_0xfa33ec){logger[_0xa4c4('0x24')](_0xfa33ec[_0xa4c4('0x25')]);if(_0xfa33ec[_0xa4c4('0x26')]){delete _0xfa33ec['name'];}_0x48a503[_0xa4c4('0x17')](_0x40435d)[_0xa4c4('0x27')](_0xfa33ec);};}exports[_0xa4c4('0x28')]=function(_0x425fd8,_0x182335){var _0x5c3b3b={},_0x32af71={},_0x5688a6={'count':0x0,'rows':[]};var _0x4abddc=_['map'](db['WhatsappApplication'][_0xa4c4('0x29')],function(_0x1d852b){return{'name':_0x1d852b[_0xa4c4('0x2a')],'type':_0x1d852b[_0xa4c4('0x2b')][_0xa4c4('0x2c')]};});_0x32af71['model']=_['map'](_0x4abddc,'name');_0x32af71[_0xa4c4('0x2d')]=_[_0xa4c4('0x2e')](_0x425fd8['query']);_0x32af71[_0xa4c4('0x2f')]=_[_0xa4c4('0x30')](_0x32af71['model'],_0x32af71[_0xa4c4('0x2d')]);_0x5c3b3b[_0xa4c4('0x31')]=_['intersection'](_0x32af71[_0xa4c4('0x32')],qs[_0xa4c4('0x33')](_0x425fd8[_0xa4c4('0x2d')][_0xa4c4('0x33')]));_0x5c3b3b[_0xa4c4('0x31')]=_0x5c3b3b[_0xa4c4('0x31')]['length']?_0x5c3b3b[_0xa4c4('0x31')]:_0x32af71[_0xa4c4('0x32')];if(!_0x425fd8[_0xa4c4('0x2d')][_0xa4c4('0x34')](_0xa4c4('0x35'))){_0x5c3b3b[_0xa4c4('0x1d')]=qs[_0xa4c4('0x1d')](_0x425fd8[_0xa4c4('0x2d')]['limit']);_0x5c3b3b[_0xa4c4('0x1a')]=qs['offset'](_0x425fd8[_0xa4c4('0x2d')][_0xa4c4('0x1a')]);}_0x5c3b3b['order']=qs[_0xa4c4('0x36')](_0x425fd8[_0xa4c4('0x2d')][_0xa4c4('0x36')]);_0x5c3b3b[_0xa4c4('0x37')]=qs[_0xa4c4('0x2f')](_[_0xa4c4('0x38')](_0x425fd8['query'],_0x32af71[_0xa4c4('0x2f')]),_0x4abddc);if(_0x425fd8[_0xa4c4('0x2d')]['filter']){_0x5c3b3b[_0xa4c4('0x37')]=_[_0xa4c4('0x39')](_0x5c3b3b[_0xa4c4('0x37')],{'$or':_[_0xa4c4('0x3a')](_0x4abddc,function(_0x3193f8){if(_0x3193f8[_0xa4c4('0x2b')]!==_0xa4c4('0x3b')){var _0x2b9c17={};_0x2b9c17[_0x3193f8[_0xa4c4('0x26')]]={'$like':'%'+_0x425fd8[_0xa4c4('0x2d')][_0xa4c4('0x3c')]+'%'};return _0x2b9c17;}})});}_0x5c3b3b=_[_0xa4c4('0x39')]({},_0x5c3b3b,_0x425fd8['options']);var _0x2b02e0={'where':_0x5c3b3b[_0xa4c4('0x37')]};return db[_0xa4c4('0x3d')][_0xa4c4('0x1c')](_0x2b02e0)['then'](function(_0x588777){_0x5688a6['count']=_0x588777;if(_0x425fd8[_0xa4c4('0x2d')]['includeAll']){_0x5c3b3b[_0xa4c4('0x3e')]=[{'all':!![]}];}return db[_0xa4c4('0x3d')][_0xa4c4('0x3f')](_0x5c3b3b);})[_0xa4c4('0x23')](function(_0x379b5a){_0x5688a6[_0xa4c4('0x40')]=_0x379b5a;return _0x5688a6;})[_0xa4c4('0x23')](respondWithFilteredResult(_0x182335,_0x5c3b3b))[_0xa4c4('0x41')](handleError(_0x182335,null));};exports[_0xa4c4('0x42')]=function(_0x2a6e06,_0x4b6136){var _0x1c00b6={'raw':!![],'where':{'id':_0x2a6e06['params']['id']}},_0x7fea70={};_0x7fea70[_0xa4c4('0x32')]=_[_0xa4c4('0x2e')](db[_0xa4c4('0x3d')][_0xa4c4('0x29')]);_0x7fea70[_0xa4c4('0x2d')]=_[_0xa4c4('0x2e')](_0x2a6e06[_0xa4c4('0x2d')]);_0x7fea70['filters']=_[_0xa4c4('0x30')](_0x7fea70[_0xa4c4('0x32')],_0x7fea70[_0xa4c4('0x2d')]);_0x1c00b6[_0xa4c4('0x31')]=_[_0xa4c4('0x30')](_0x7fea70[_0xa4c4('0x32')],qs[_0xa4c4('0x33')](_0x2a6e06[_0xa4c4('0x2d')][_0xa4c4('0x33')]));_0x1c00b6[_0xa4c4('0x31')]=_0x1c00b6['attributes'][_0xa4c4('0x43')]?_0x1c00b6['attributes']:_0x7fea70[_0xa4c4('0x32')];if(_0x2a6e06[_0xa4c4('0x2d')][_0xa4c4('0x44')]){_0x1c00b6['include']=[{'all':!![]}];}_0x1c00b6=_[_0xa4c4('0x39')]({},_0x1c00b6,_0x2a6e06[_0xa4c4('0x45')]);return db[_0xa4c4('0x3d')][_0xa4c4('0x46')](_0x1c00b6)[_0xa4c4('0x23')](handleEntityNotFound(_0x4b6136,null))[_0xa4c4('0x23')](respondWithResult(_0x4b6136,null))[_0xa4c4('0x41')](handleError(_0x4b6136,null));};exports[_0xa4c4('0x47')]=function(_0x1157ff,_0x381092){return db[_0xa4c4('0x3d')][_0xa4c4('0x47')](_0x1157ff[_0xa4c4('0x48')],{})[_0xa4c4('0x23')](respondWithResult(_0x381092,0xc9))[_0xa4c4('0x41')](handleError(_0x381092,null));};exports[_0xa4c4('0x22')]=function(_0x197e84,_0x835f73){if(_0x197e84[_0xa4c4('0x48')]['id']){delete _0x197e84[_0xa4c4('0x48')]['id'];}return db[_0xa4c4('0x3d')]['find']({'where':{'id':_0x197e84[_0xa4c4('0x49')]['id']}})[_0xa4c4('0x23')](handleEntityNotFound(_0x835f73,null))['then'](saveUpdates(_0x197e84[_0xa4c4('0x48')],null))['then'](respondWithResult(_0x835f73,null))['catch'](handleError(_0x835f73,null));};exports[_0xa4c4('0x4a')]=function(_0xb812e5,_0x187cc0){return db[_0xa4c4('0x3d')][_0xa4c4('0x46')]({'where':{'id':_0xb812e5[_0xa4c4('0x49')]['id']}})[_0xa4c4('0x23')](handleEntityNotFound(_0x187cc0,null))[_0xa4c4('0x23')](removeEntity(_0x187cc0,null))[_0xa4c4('0x41')](handleError(_0x187cc0,null));}; \ No newline at end of file +var _0xe8e8=['undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','keys','query','attributes','intersection','model','length','nolimit','order','sort','filters','pick','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','params','fields','includeAll','create','body','find','eml-format','rimraf','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','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','status','end','offset'];(function(_0x21a1a6,_0x1474bf){var _0x5cec0e=function(_0x13abb9){while(--_0x13abb9){_0x21a1a6['push'](_0x21a1a6['shift']());}};_0x5cec0e(++_0x1474bf);}(_0xe8e8,0xc6));var _0x8e8e=function(_0x4eaebd,_0x213075){_0x4eaebd=_0x4eaebd-0x0;var _0x4d4823=_0xe8e8[_0x4eaebd];return _0x4d4823;};'use strict';var emlformat=require(_0x8e8e('0x0'));var rimraf=require(_0x8e8e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8e8e('0x2'));var moment=require(_0x8e8e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8e8e('0x4'));var path=require('path');var sox=require(_0x8e8e('0x5'));var csv=require(_0x8e8e('0x6'));var ejs=require(_0x8e8e('0x7'));var fs=require('fs');var fs_extra=require(_0x8e8e('0x8'));var _=require('lodash');var squel=require(_0x8e8e('0x9'));var crypto=require('crypto');var jsforce=require(_0x8e8e('0xa'));var deskjs=require(_0x8e8e('0xb'));var toCsv=require(_0x8e8e('0x6'));var querystring=require(_0x8e8e('0xc'));var Papa=require(_0x8e8e('0xd'));var Redis=require(_0x8e8e('0xe'));var authService=require(_0x8e8e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8e8e('0x10'));var hardwareService=require(_0x8e8e('0x11'));var logger=require(_0x8e8e('0x12'))(_0x8e8e('0x13'));var utils=require('../../config/utils');var config=require(_0x8e8e('0x14'));var licenseUtil=require(_0x8e8e('0x15'));var db=require(_0x8e8e('0x16'))['db'];function respondWithStatusCode(_0xb6501e,_0x1f5aa2){_0x1f5aa2=_0x1f5aa2||0xcc;return function(_0x17e222){if(_0x17e222){return _0xb6501e[_0x8e8e('0x17')](_0x1f5aa2);}return _0xb6501e[_0x8e8e('0x18')](_0x1f5aa2)[_0x8e8e('0x19')]();};}function respondWithResult(_0x176ae6,_0x548774){_0x548774=_0x548774||0xc8;return function(_0x320c42){if(_0x320c42){return _0x176ae6[_0x8e8e('0x18')](_0x548774)['json'](_0x320c42);}};}function respondWithFilteredResult(_0x45a15a,_0x23c61b){return function(_0x5d8be1){if(_0x5d8be1){var _0x439288=typeof _0x23c61b[_0x8e8e('0x1a')]===_0x8e8e('0x1b')&&typeof _0x23c61b[_0x8e8e('0x1c')]===_0x8e8e('0x1b');var _0x36c329=_0x5d8be1[_0x8e8e('0x1d')];var _0x27f7f6=_0x439288?0x0:_0x23c61b[_0x8e8e('0x1a')];var _0xdbde13=_0x439288?_0x5d8be1['count']:_0x23c61b[_0x8e8e('0x1a')]+_0x23c61b[_0x8e8e('0x1c')];var _0x5c2a85;if(_0xdbde13>=_0x36c329){_0xdbde13=_0x36c329;_0x5c2a85=0xc8;}else{_0x5c2a85=0xce;}_0x45a15a[_0x8e8e('0x18')](_0x5c2a85);return _0x45a15a[_0x8e8e('0x1e')](_0x8e8e('0x1f'),_0x27f7f6+'-'+_0xdbde13+'/'+_0x36c329)[_0x8e8e('0x20')](_0x5d8be1);}return null;};}function patchUpdates(_0x572c19){return function(_0x586b7e){try{jsonpatch['apply'](_0x586b7e,_0x572c19,!![]);}catch(_0x2676f3){return BPromise[_0x8e8e('0x21')](_0x2676f3);}return _0x586b7e[_0x8e8e('0x22')]();};}function saveUpdates(_0x21efa0,_0x59f008){return function(_0x32ff35){if(_0x32ff35){return _0x32ff35[_0x8e8e('0x23')](_0x21efa0)[_0x8e8e('0x24')](function(_0x585743){return _0x585743;});}return null;};}function removeEntity(_0x3d42c2,_0x4c685e){return function(_0x5f2a24){if(_0x5f2a24){return _0x5f2a24[_0x8e8e('0x25')]()[_0x8e8e('0x24')](function(){_0x3d42c2['status'](0xcc)[_0x8e8e('0x19')]();});}};}function handleEntityNotFound(_0x338f91,_0x32899c){return function(_0x110c70){if(!_0x110c70){_0x338f91['sendStatus'](0x194);}return _0x110c70;};}function handleError(_0x344830,_0x1dfed4){_0x1dfed4=_0x1dfed4||0x1f4;return function(_0x1ca842){logger[_0x8e8e('0x26')](_0x1ca842[_0x8e8e('0x27')]);if(_0x1ca842[_0x8e8e('0x28')]){delete _0x1ca842[_0x8e8e('0x28')];}_0x344830[_0x8e8e('0x18')](_0x1dfed4)[_0x8e8e('0x29')](_0x1ca842);};}exports[_0x8e8e('0x2a')]=function(_0x56424b,_0x3fca96){var _0x408ed6={},_0x2536df={},_0x4929ab={'count':0x0,'rows':[]};var _0xaba2cc=_[_0x8e8e('0x2b')](db[_0x8e8e('0x2c')][_0x8e8e('0x2d')],function(_0x5edf41){return{'name':_0x5edf41[_0x8e8e('0x2e')],'type':_0x5edf41[_0x8e8e('0x2f')][_0x8e8e('0x30')]};});_0x2536df['model']=_[_0x8e8e('0x2b')](_0xaba2cc,_0x8e8e('0x28'));_0x2536df['query']=_[_0x8e8e('0x31')](_0x56424b[_0x8e8e('0x32')]);_0x2536df['filters']=_['intersection'](_0x2536df['model'],_0x2536df[_0x8e8e('0x32')]);_0x408ed6[_0x8e8e('0x33')]=_[_0x8e8e('0x34')](_0x2536df[_0x8e8e('0x35')],qs['fields'](_0x56424b[_0x8e8e('0x32')]['fields']));_0x408ed6['attributes']=_0x408ed6[_0x8e8e('0x33')][_0x8e8e('0x36')]?_0x408ed6['attributes']:_0x2536df[_0x8e8e('0x35')];if(!_0x56424b[_0x8e8e('0x32')]['hasOwnProperty'](_0x8e8e('0x37'))){_0x408ed6[_0x8e8e('0x1c')]=qs[_0x8e8e('0x1c')](_0x56424b[_0x8e8e('0x32')][_0x8e8e('0x1c')]);_0x408ed6[_0x8e8e('0x1a')]=qs[_0x8e8e('0x1a')](_0x56424b[_0x8e8e('0x32')][_0x8e8e('0x1a')]);}_0x408ed6[_0x8e8e('0x38')]=qs[_0x8e8e('0x39')](_0x56424b['query'][_0x8e8e('0x39')]);_0x408ed6['where']=qs[_0x8e8e('0x3a')](_[_0x8e8e('0x3b')](_0x56424b[_0x8e8e('0x32')],_0x2536df[_0x8e8e('0x3a')]),_0xaba2cc);if(_0x56424b[_0x8e8e('0x32')]['filter']){_0x408ed6[_0x8e8e('0x3c')]=_['merge'](_0x408ed6[_0x8e8e('0x3c')],{'$or':_[_0x8e8e('0x2b')](_0xaba2cc,function(_0x3f60d1){if(_0x3f60d1['type']!==_0x8e8e('0x3d')){var _0x19fd04={};_0x19fd04[_0x3f60d1['name']]={'$like':'%'+_0x56424b[_0x8e8e('0x32')][_0x8e8e('0x3e')]+'%'};return _0x19fd04;}})});}_0x408ed6=_[_0x8e8e('0x3f')]({},_0x408ed6,_0x56424b[_0x8e8e('0x40')]);var _0x409981={'where':_0x408ed6[_0x8e8e('0x3c')]};return db['WhatsappApplication'][_0x8e8e('0x1d')](_0x409981)[_0x8e8e('0x24')](function(_0x1402d8){_0x4929ab[_0x8e8e('0x1d')]=_0x1402d8;if(_0x56424b[_0x8e8e('0x32')]['includeAll']){_0x408ed6[_0x8e8e('0x41')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x8e8e('0x42')](_0x408ed6);})['then'](function(_0x549dd6){_0x4929ab[_0x8e8e('0x43')]=_0x549dd6;return _0x4929ab;})[_0x8e8e('0x24')](respondWithFilteredResult(_0x3fca96,_0x408ed6))[_0x8e8e('0x44')](handleError(_0x3fca96,null));};exports['show']=function(_0x610892,_0x58aa71){var _0x12009c={'raw':!![],'where':{'id':_0x610892[_0x8e8e('0x45')]['id']}},_0x5dafb1={};_0x5dafb1[_0x8e8e('0x35')]=_[_0x8e8e('0x31')](db['WhatsappApplication'][_0x8e8e('0x2d')]);_0x5dafb1['query']=_[_0x8e8e('0x31')](_0x610892['query']);_0x5dafb1[_0x8e8e('0x3a')]=_[_0x8e8e('0x34')](_0x5dafb1[_0x8e8e('0x35')],_0x5dafb1[_0x8e8e('0x32')]);_0x12009c[_0x8e8e('0x33')]=_[_0x8e8e('0x34')](_0x5dafb1[_0x8e8e('0x35')],qs[_0x8e8e('0x46')](_0x610892[_0x8e8e('0x32')][_0x8e8e('0x46')]));_0x12009c[_0x8e8e('0x33')]=_0x12009c['attributes'][_0x8e8e('0x36')]?_0x12009c[_0x8e8e('0x33')]:_0x5dafb1[_0x8e8e('0x35')];if(_0x610892[_0x8e8e('0x32')][_0x8e8e('0x47')]){_0x12009c['include']=[{'all':!![]}];}_0x12009c=_[_0x8e8e('0x3f')]({},_0x12009c,_0x610892[_0x8e8e('0x40')]);return db[_0x8e8e('0x2c')]['find'](_0x12009c)[_0x8e8e('0x24')](handleEntityNotFound(_0x58aa71,null))[_0x8e8e('0x24')](respondWithResult(_0x58aa71,null))[_0x8e8e('0x44')](handleError(_0x58aa71,null));};exports[_0x8e8e('0x48')]=function(_0x132bcf,_0xae770c){return db[_0x8e8e('0x2c')]['create'](_0x132bcf['body'],{})[_0x8e8e('0x24')](respondWithResult(_0xae770c,0xc9))[_0x8e8e('0x44')](handleError(_0xae770c,null));};exports[_0x8e8e('0x23')]=function(_0x150a7d,_0x4bc828){if(_0x150a7d[_0x8e8e('0x49')]['id']){delete _0x150a7d[_0x8e8e('0x49')]['id'];}return db[_0x8e8e('0x2c')][_0x8e8e('0x4a')]({'where':{'id':_0x150a7d[_0x8e8e('0x45')]['id']}})['then'](handleEntityNotFound(_0x4bc828,null))['then'](saveUpdates(_0x150a7d['body'],null))[_0x8e8e('0x24')](respondWithResult(_0x4bc828,null))[_0x8e8e('0x44')](handleError(_0x4bc828,null));};exports[_0x8e8e('0x25')]=function(_0x5d8181,_0x310bc8){return db[_0x8e8e('0x2c')][_0x8e8e('0x4a')]({'where':{'id':_0x5d8181['params']['id']}})[_0x8e8e('0x24')](handleEntityNotFound(_0x310bc8,null))[_0x8e8e('0x24')](removeEntity(_0x310bc8,null))[_0x8e8e('0x44')](handleError(_0x310bc8,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 0537c24..f2477a1 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 _0xf873=['bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xf873,0xb2));var _0x3f87=function(_0x45b2cf,_0x206e9c){_0x45b2cf=_0x45b2cf-0x0;var _0x263120=_0xf873[_0x45b2cf];return _0x263120;};'use strict';var _=require('lodash');var util=require(_0x3f87('0x0'));var logger=require(_0x3f87('0x1'))(_0x3f87('0x2'));var moment=require(_0x3f87('0x3'));var BPromise=require(_0x3f87('0x4'));var rp=require(_0x3f87('0x5'));var fs=require('fs');var path=require(_0x3f87('0x6'));var rimraf=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var attributes=require('./whatsappApplication.attributes');module[_0x3f87('0x9')]=function(_0x43c8e4,_0x27c03e){return _0x43c8e4['define'](_0x3f87('0xa'),attributes,{'tableName':_0x3f87('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3f87('0xc'),'collate':_0x3f87('0xd')});}; \ No newline at end of file +var _0x1cc7=['define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x3c701e,_0x376b23){var _0x3dad16=function(_0x27d1ea){while(--_0x27d1ea){_0x3c701e['push'](_0x3c701e['shift']());}};_0x3dad16(++_0x376b23);}(_0x1cc7,0x15a));var _0x71cc=function(_0x3afb3e,_0x150c4d){_0x3afb3e=_0x3afb3e-0x0;var _0xae8e2e=_0x1cc7[_0x3afb3e];return _0xae8e2e;};'use strict';var _=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var logger=require(_0x71cc('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x71cc('0x3'));var fs=require('fs');var path=require(_0x71cc('0x4'));var rimraf=require(_0x71cc('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x27a175,_0x4ecf81){return _0x27a175[_0x71cc('0x6')](_0x71cc('0x7'),attributes,{'tableName':_0x71cc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x71cc('0x9'),'collate':_0x71cc('0xa')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index c2424c7..aee3750 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 _0x0a9a=['WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x4a782b,_0x55584a){var _0x5cb5a0=function(_0x3010ed){while(--_0x3010ed){_0x4a782b['push'](_0x4a782b['shift']());}};_0x5cb5a0(++_0x55584a);}(_0x0a9a,0x183));var _0xa0a9=function(_0x4a968a,_0x43689e){_0x4a968a=_0x4a968a-0x0;var _0x5a3926=_0x0a9a[_0x4a968a];return _0x5a3926;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d689,_0x499a29,_0x2b2eb4){return new BPromise(function(_0x520f42,_0x10aa8a){return client[_0xa0a9('0xa')](_0x31d689,_0x2b2eb4)[_0xa0a9('0xb')](function(_0x2d6ac0){logger['info'](_0xa0a9('0xc'),_0x499a29,_0xa0a9('0xd'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x499a29,_0xa0a9('0xd'),JSON[_0xa0a9('0xe')](_0x2d6ac0));if(_0x2d6ac0['error']){if(_0x2d6ac0[_0xa0a9('0xf')]['code']===0x1f4){logger[_0xa0a9('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x10aa8a(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}logger[_0xa0a9('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x520f42(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}else{logger[_0xa0a9('0x11')](_0xa0a9('0xc'),_0x499a29,'request\x20sent');_0x520f42(_0x2d6ac0[_0xa0a9('0x12')]['message']);}})['catch'](function(_0x347092){logger[_0xa0a9('0xf')](_0xa0a9('0xc'),_0x499a29,_0x347092);_0x10aa8a(_0x347092);});});} \ No newline at end of file +var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x58a1c9,_0x16b9e8){var _0x3d3eb7=function(_0x41caca){while(--_0x41caca){_0x58a1c9['push'](_0x58a1c9['shift']());}};_0x3d3eb7(++_0x16b9e8);}(_0x54ef,0x112));var _0xf54e=function(_0x1b7ba3,_0x42e87e){_0x1b7ba3=_0x1b7ba3-0x0;var _0x46e666=_0x54ef[_0x1b7ba3];return _0x46e666;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 2812f5c..87faca7 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 _0x23f4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','removeTags','exports','util','express'];(function(_0x15644b,_0x467bf0){var _0x3f97b1=function(_0x19e6c2){while(--_0x19e6c2){_0x15644b['push'](_0x15644b['shift']());}};_0x3f97b1(++_0x467bf0);}(_0x23f4,0x1ee));var _0x423f=function(_0x5670b5,_0x3e29d6){_0x5670b5=_0x5670b5-0x0;var _0x5cf43b=_0x23f4[_0x5670b5];return _0x5cf43b;};'use strict';var multer=require('multer');var util=require(_0x423f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x423f('0x1'));var router=express[_0x423f('0x2')]();var fs_extra=require(_0x423f('0x3'));var auth=require(_0x423f('0x4'));var interaction=require(_0x423f('0x5'));var config=require(_0x423f('0x6'));var controller=require(_0x423f('0x7'));router[_0x423f('0x8')]('/',auth[_0x423f('0x9')](),controller['index']);router[_0x423f('0x8')](_0x423f('0xa'),auth['isAuthenticated'](),controller[_0x423f('0xb')]);router[_0x423f('0x8')](_0x423f('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x423f('0xd'),auth['isAuthenticated'](),controller[_0x423f('0xe')]);router[_0x423f('0x8')](_0x423f('0xf'),auth[_0x423f('0x9')](),controller['download']);router[_0x423f('0x10')]('/',auth[_0x423f('0x9')](),controller[_0x423f('0x11')]);router[_0x423f('0x10')](_0x423f('0xd'),auth['isAuthenticated'](),controller[_0x423f('0x12')]);router[_0x423f('0x10')](_0x423f('0x13'),auth[_0x423f('0x9')](),interaction[_0x423f('0x14')](_0x423f('0x15'),_0x423f('0x16')),controller[_0x423f('0x17')]);router[_0x423f('0x18')](_0x423f('0xc'),auth[_0x423f('0x9')](),interaction[_0x423f('0x14')](_0x423f('0x15'),_0x423f('0x19')),controller[_0x423f('0x1a')]);router[_0x423f('0x1b')](_0x423f('0xc'),auth[_0x423f('0x9')](),interaction[_0x423f('0x14')]('whatsapp',_0x423f('0x1c')),controller['destroy']);router['delete'](_0x423f('0x13'),auth['isAuthenticated'](),controller[_0x423f('0x1d')]);module[_0x423f('0x1e')]=router; \ No newline at end of file +var _0x3c6c=['get','index','/:id','isAuthenticated','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x41d319,_0x43b8fc){var _0x466f55=function(_0x20fbab){while(--_0x20fbab){_0x41d319['push'](_0x41d319['shift']());}};_0x466f55(++_0x43b8fc);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x3cb8b1,_0x2508b7){_0x3cb8b1=_0x3cb8b1-0x0;var _0x3edfe7=_0x3c6c[_0x3cb8b1];return _0x3edfe7;};'use strict';var multer=require(_0xc3c6('0x0'));var util=require('util');var path=require(_0xc3c6('0x1'));var timeout=require(_0xc3c6('0x2'));var express=require(_0xc3c6('0x3'));var router=express[_0xc3c6('0x4')]();var fs_extra=require(_0xc3c6('0x5'));var auth=require(_0xc3c6('0x6'));var interaction=require(_0xc3c6('0x7'));var config=require(_0xc3c6('0x8'));var controller=require('./whatsappInteraction.controller');router[_0xc3c6('0x9')]('/',auth['isAuthenticated'](),controller[_0xc3c6('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),controller['show']);router[_0xc3c6('0x9')](_0xc3c6('0xd'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0xe')]);router['get'](_0xc3c6('0xf'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc3c6('0x11')]);router[_0xc3c6('0x12')](_0xc3c6('0xd'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0x13')]);router[_0xc3c6('0x12')](_0xc3c6('0x14'),auth[_0xc3c6('0xc')](),interaction[_0xc3c6('0x15')](_0xc3c6('0x16'),_0xc3c6('0x17')),controller[_0xc3c6('0x18')]);router[_0xc3c6('0x19')](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),interaction[_0xc3c6('0x15')](_0xc3c6('0x16'),_0xc3c6('0x1a')),controller[_0xc3c6('0x1b')]);router[_0xc3c6('0x1c')](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),interaction[_0xc3c6('0x15')](_0xc3c6('0x16'),_0xc3c6('0x1d')),controller[_0xc3c6('0x1e')]);router['delete'](_0xc3c6('0x14'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0x1f')]);module[_0xc3c6('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 2649d37..90e26a2 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 _0xbc1c=['moment','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x1b4457,_0x3637e){var _0x4459b4=function(_0x15c6cf){while(--_0x15c6cf){_0x1b4457['push'](_0x1b4457['shift']());}};_0x4459b4(++_0x3637e);}(_0xbc1c,0xd8));var _0xcbc1=function(_0xbf8ec1,_0x9169c8){_0xbf8ec1=_0xbf8ec1-0x0;var _0xc84567=_0xbc1c[_0xbf8ec1];return _0xc84567;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xcbc1('0x0'));module['exports']={'closed':{'type':Sequelize[_0xcbc1('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xcbc1('0x2')]},'secondDisposition':{'type':Sequelize[_0xcbc1('0x2')]},'thirdDisposition':{'type':Sequelize[_0xcbc1('0x2')]},'note':{'type':Sequelize[_0xcbc1('0x2')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xcbc1('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xcbc1('0x4')]('in',_0xcbc1('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcbc1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcbc1('0x4')]('in',_0xcbc1('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2e65=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e65,0x193));var _0x52e6=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x2e65[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x52e6('0x0'));var moment=require(_0x52e6('0x1'));module[_0x52e6('0x2')]={'closed':{'type':Sequelize[_0x52e6('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x52e6('0x4')]},'disposition':{'type':Sequelize[_0x52e6('0x5')]},'secondDisposition':{'type':Sequelize[_0x52e6('0x5')]},'thirdDisposition':{'type':Sequelize[_0x52e6('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x52e6('0x5')]},'read1stAt':{'type':Sequelize[_0x52e6('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x52e6('0x6')]('in',_0x52e6('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x52e6('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x52e6('0x6')]('in',_0x52e6('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x52e6('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 550f201..83adc89 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 _0xda27=['filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','createdAt','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','moment','bluebird','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','undefined','count','offset','limit','Content-Range','update','then','destroy','error','stack','name','send','index','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','whatsapp','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','WhatsappMessage','omit','ids','findOne','hasOwnProperty','nolimit','sort','where','pick','WhatsappInteractionId'];(function(_0x2b81be,_0x544bdf){var _0x8ed4a7=function(_0x4a7bf4){while(--_0x4a7bf4){_0x2b81be['push'](_0x2b81be['shift']());}};_0x8ed4a7(++_0x544bdf);}(_0xda27,0x1cf));var _0x7da2=function(_0x2ee62d,_0xeaba9d){_0x2ee62d=_0x2ee62d-0x0;var _0x5609cd=_0xda27[_0x2ee62d];return _0x5609cd;};'use strict';var rimraf=require(_0x7da2('0x0'));var zipdir=require(_0x7da2('0x1'));var moment=require(_0x7da2('0x2'));var BPromise=require(_0x7da2('0x3'));var util=require(_0x7da2('0x4'));var path=require(_0x7da2('0x5'));var ejs=require(_0x7da2('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x7da2('0x7'));var interaction=require(_0x7da2('0x8'));var qs=require(_0x7da2('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0x7da2('0xa'))(_0x7da2('0xb'));var config=require(_0x7da2('0xc'));var db=require('../../mysqldb')['db'];config[_0x7da2('0xd')]=_[_0x7da2('0xe')](config[_0x7da2('0xd')],{'host':_0x7da2('0xf'),'port':0x18eb});var socket=require(_0x7da2('0x10'))(new Redis(config[_0x7da2('0xd')]));require(_0x7da2('0x11'))[_0x7da2('0x12')](socket);function respondWithStatusCode(_0xd454cd,_0x5e3880){_0x5e3880=_0x5e3880||0xcc;return function(_0x44143c){if(_0x44143c){return _0xd454cd[_0x7da2('0x13')](_0x5e3880);}return _0xd454cd[_0x7da2('0x14')](_0x5e3880)[_0x7da2('0x15')]();};}function respondWithResult(_0x2f15e7,_0x62229f){_0x62229f=_0x62229f||0xc8;return function(_0x3c5f5a){if(_0x3c5f5a){return _0x2f15e7['status'](_0x62229f)['json'](_0x3c5f5a);}};}function respondWithFilteredResult(_0x458131,_0x49357e){return function(_0x5d6862){if(_0x5d6862){var _0x4e22fc=typeof _0x49357e['offset']===_0x7da2('0x16')&&typeof _0x49357e['limit']===_0x7da2('0x16');var _0x2184c9=_0x5d6862[_0x7da2('0x17')];var _0x564fec=_0x4e22fc?0x0:_0x49357e[_0x7da2('0x18')];var _0x1b8a8a=_0x4e22fc?_0x5d6862[_0x7da2('0x17')]:_0x49357e[_0x7da2('0x18')]+_0x49357e[_0x7da2('0x19')];var _0x3d52be;if(_0x1b8a8a>=_0x2184c9){_0x1b8a8a=_0x2184c9;_0x3d52be=0xc8;}else{_0x3d52be=0xce;}_0x458131['status'](_0x3d52be);return _0x458131['set'](_0x7da2('0x1a'),_0x564fec+'-'+_0x1b8a8a+'/'+_0x2184c9)['json'](_0x5d6862);}return null;};}function saveUpdates(_0x40e307){return function(_0x3027eb){if(_0x3027eb){return _0x3027eb[_0x7da2('0x1b')](_0x40e307)[_0x7da2('0x1c')](function(_0x30134a){return _0x30134a;});}return null;};}function removeEntity(_0xff4f9f){return function(_0x5c205a){if(_0x5c205a){return _0x5c205a[_0x7da2('0x1d')]()['then'](function(){_0xff4f9f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f0848){return function(_0x421fdf){if(!_0x421fdf){_0x4f0848[_0x7da2('0x13')](0x194);}return _0x421fdf;};}function handleError(_0x427202,_0x1071a2){_0x1071a2=_0x1071a2||0x1f4;return function(_0x118734){logger[_0x7da2('0x1e')](_0x118734[_0x7da2('0x1f')]);if(_0x118734['name']){delete _0x118734[_0x7da2('0x20')];}_0x427202[_0x7da2('0x14')](_0x1071a2)[_0x7da2('0x21')](_0x118734);};}exports[_0x7da2('0x22')]=function(_0x5d68ab,_0x23b185){var _0x3f93e0={};var _0x3d6974=_['map'](db[_0x7da2('0x23')][_0x7da2('0x24')],function(_0x15928b){return{'name':_0x15928b[_0x7da2('0x25')],'type':_0x15928b[_0x7da2('0x26')][_0x7da2('0x27')]};});_0x3f93e0=qs[_0x7da2('0x28')](_0x3d6974,_0x5d68ab);return interaction['findAll'](_0x7da2('0x29'),_0x5d68ab[_0x7da2('0x2a')],_0x5d68ab[_0x7da2('0x2b')],_0x3f93e0,_0x3d6974)[_0x7da2('0x1c')](respondWithFilteredResult(_0x23b185,_0x3f93e0))[_0x7da2('0x2c')](handleError(_0x23b185,null));};exports[_0x7da2('0x2d')]=function(_0x42e4f2,_0x490378){var _0x1e715c={'raw':![],'where':{'id':_0x42e4f2[_0x7da2('0x2e')]['id']}},_0x32d5aa={};_0x32d5aa[_0x7da2('0x2f')]=_[_0x7da2('0x30')](db['WhatsappInteraction']['rawAttributes']);_0x32d5aa[_0x7da2('0x2a')]=_[_0x7da2('0x30')](_0x42e4f2[_0x7da2('0x2a')]);_0x32d5aa[_0x7da2('0x31')]=_[_0x7da2('0x32')](_0x32d5aa[_0x7da2('0x2f')],_0x32d5aa[_0x7da2('0x2a')]);_0x1e715c[_0x7da2('0x33')]=_[_0x7da2('0x32')](_0x32d5aa[_0x7da2('0x2f')],qs[_0x7da2('0x34')](_0x42e4f2[_0x7da2('0x2a')][_0x7da2('0x34')]));_0x1e715c[_0x7da2('0x33')]=_0x1e715c[_0x7da2('0x33')][_0x7da2('0x35')]?_0x1e715c[_0x7da2('0x33')]:_0x32d5aa[_0x7da2('0x2f')];if(_0x42e4f2[_0x7da2('0x2a')][_0x7da2('0x36')]){_0x1e715c[_0x7da2('0x37')]=[{'all':!![]}];}_0x1e715c=_[_0x7da2('0x38')]({},_0x1e715c,_0x42e4f2[_0x7da2('0x39')]);return db[_0x7da2('0x23')][_0x7da2('0x3a')](_0x1e715c)[_0x7da2('0x1c')](handleEntityNotFound(_0x490378,null))[_0x7da2('0x1c')](respondWithResult(_0x490378,null))[_0x7da2('0x2c')](handleError(_0x490378,null));};exports[_0x7da2('0x3b')]=function(_0x5d738e,_0x1e29ba){return db[_0x7da2('0x23')][_0x7da2('0x3b')](_0x5d738e[_0x7da2('0x3c')],{})[_0x7da2('0x1c')](respondWithResult(_0x1e29ba,0xc9))[_0x7da2('0x2c')](handleError(_0x1e29ba,null));};exports['update']=function(_0x32bc94,_0x3d2e42){if(_0x32bc94[_0x7da2('0x3c')]['id']){delete _0x32bc94[_0x7da2('0x3c')]['id'];}return db[_0x7da2('0x23')][_0x7da2('0x3a')]({'where':{'id':_0x32bc94[_0x7da2('0x2e')]['id']}})[_0x7da2('0x1c')](handleEntityNotFound(_0x3d2e42,null))[_0x7da2('0x1c')](saveUpdates(_0x32bc94[_0x7da2('0x3c')],null))[_0x7da2('0x1c')](respondWithResult(_0x3d2e42,null))[_0x7da2('0x2c')](handleError(_0x3d2e42,null));};exports['destroy']=function(_0x25f583,_0x2008ec){return db[_0x7da2('0x23')][_0x7da2('0x3a')]({'where':{'id':_0x25f583['params']['id']}})[_0x7da2('0x1c')](handleEntityNotFound(_0x2008ec,null))[_0x7da2('0x1c')](removeEntity(_0x2008ec,null))[_0x7da2('0x2c')](handleError(_0x2008ec,null));};exports[_0x7da2('0x3d')]=function(_0x4b50ee,_0x415cda){return db[_0x7da2('0x23')]['describe']()[_0x7da2('0x1c')](respondWithResult(_0x415cda,null))[_0x7da2('0x2c')](handleError(_0x415cda,null));};exports[_0x7da2('0x3e')]=function(_0x4b579c,_0xce5be4){return db[_0x7da2('0x3f')][_0x7da2('0x3a')]({'where':{'id':_0x4b579c['params']['id']}})[_0x7da2('0x1c')](handleEntityNotFound(_0xce5be4,null))[_0x7da2('0x1c')](function(_0x3b7e4d){if(_0x3b7e4d){return _0x3b7e4d['addMessage'](_0x4b579c['body']['ids'],_[_0x7da2('0x40')](_0x4b579c['body'],[_0x7da2('0x41'),'id'])||{});}})[_0x7da2('0x1c')](respondWithResult(_0xce5be4,null))[_0x7da2('0x2c')](handleError(_0xce5be4,null));};exports['getMessages']=function(_0x385bfc,_0x27ef3f){var _0x1c83e7={'raw':![],'where':{}};var _0xd5f2a9={};var _0x59c9cd={'count':0x0,'rows':[]};return db[_0x7da2('0x23')][_0x7da2('0x42')]({'where':{'id':_0x385bfc[_0x7da2('0x2e')]['id']}})['then'](handleEntityNotFound(_0x27ef3f,null))[_0x7da2('0x1c')](function(_0x4accde){if(_0x4accde){_0xd5f2a9['model']=_[_0x7da2('0x30')](db[_0x7da2('0x3f')][_0x7da2('0x24')]);_0xd5f2a9['query']=_['keys'](_0x385bfc[_0x7da2('0x2a')]);_0xd5f2a9[_0x7da2('0x31')]=_[_0x7da2('0x32')](_0xd5f2a9[_0x7da2('0x2f')],_0xd5f2a9['query']);_0x1c83e7[_0x7da2('0x33')]=_[_0x7da2('0x32')](_0xd5f2a9['model'],qs['fields'](_0x385bfc['query'][_0x7da2('0x34')]));_0x1c83e7[_0x7da2('0x33')]=_0x1c83e7[_0x7da2('0x33')][_0x7da2('0x35')]?_0x1c83e7[_0x7da2('0x33')]:_0xd5f2a9['model'];if(!_0x385bfc[_0x7da2('0x2a')][_0x7da2('0x43')](_0x7da2('0x44'))){_0x1c83e7[_0x7da2('0x19')]=qs[_0x7da2('0x19')](_0x385bfc[_0x7da2('0x2a')][_0x7da2('0x19')]);_0x1c83e7['offset']=qs['offset'](_0x385bfc['query'][_0x7da2('0x18')]);}_0x1c83e7['order']=qs[_0x7da2('0x45')](_0x385bfc[_0x7da2('0x2a')][_0x7da2('0x45')]);_0x1c83e7[_0x7da2('0x46')]=qs['filters'](_[_0x7da2('0x47')](_0x385bfc[_0x7da2('0x2a')],_0xd5f2a9[_0x7da2('0x31')]));_0x1c83e7[_0x7da2('0x46')][_0x7da2('0x48')]=_0x4accde['id'];if(_0x385bfc[_0x7da2('0x2a')][_0x7da2('0x49')]){_0x1c83e7[_0x7da2('0x46')]=_[_0x7da2('0x38')](_0x1c83e7['where'],{'$or':_[_0x7da2('0x4a')](_0x1c83e7['attributes'],function(_0x10416f){var _0x582add={};_0x582add[_0x10416f]={'$like':'%'+_0x385bfc[_0x7da2('0x2a')][_0x7da2('0x49')]+'%'};return _0x582add;})});}if(_0x385bfc[_0x7da2('0x2a')][_0x7da2('0x4b')]){var _0x3494f3=_0x385bfc[_0x7da2('0x2a')][_0x7da2('0x4b')][_0x7da2('0x4c')](',');var _0xf446f3={};_0xf446f3[_0x3494f3[0x0]]={'$gte':moment(_0x3494f3[0x1])[_0x7da2('0x4d')](_0x7da2('0x4e'))};_0x1c83e7['where']=_[_0x7da2('0x38')](_0x1c83e7[_0x7da2('0x46')],_0xf446f3);}_0x1c83e7=_[_0x7da2('0x38')]({},_0x1c83e7,_0x385bfc[_0x7da2('0x39')]);return db['WhatsappMessage']['count']({'where':_0x1c83e7[_0x7da2('0x46')]})['then'](function(_0x392eb3){_0x59c9cd['count']=_0x392eb3;if(_0x385bfc['query'][_0x7da2('0x36')]){_0x1c83e7[_0x7da2('0x37')]=[{'all':!![]}];}return db[_0x7da2('0x3f')][_0x7da2('0x4f')](_0x1c83e7);})[_0x7da2('0x1c')](function(_0x325097){_0x59c9cd['rows']=_0x325097;return _0x59c9cd;});}})['then'](respondWithFilteredResult(_0x27ef3f,_0x1c83e7))[_0x7da2('0x2c')](handleError(_0x27ef3f,null));};exports[_0x7da2('0x50')]=function(_0x53ef36,_0x5ce898){return db[_0x7da2('0x23')][_0x7da2('0x3a')]({'where':{'id':_0x53ef36[_0x7da2('0x2e')]['id']}})['then'](handleEntityNotFound(_0x5ce898,null))[_0x7da2('0x1c')](function(_0x110ccc){if(_0x110ccc){return _0x110ccc[_0x7da2('0x51')](_0x53ef36[_0x7da2('0x3c')]['ids'],_['omit'](_0x53ef36[_0x7da2('0x3c')],['ids','id'])||{})[_0x7da2('0x52')](function(){return db[_0x7da2('0x53')]['findAll']({'attributes':['id',_0x7da2('0x20'),_0x7da2('0x54')],'where':{'id':_0x53ef36[_0x7da2('0x3c')][_0x7da2('0x41')]}});})[_0x7da2('0x1c')](function(_0x27ac2f){socket[_0x7da2('0x55')](_0x7da2('0x56'),{'id':Number(_0x53ef36['params']['id']),'tags':_0x27ac2f||[]});return{'id':Number(_0x53ef36[_0x7da2('0x2e')]['id']),'tags':_0x27ac2f||[]};});}})[_0x7da2('0x1c')](respondWithResult(_0x5ce898,null))[_0x7da2('0x2c')](handleError(_0x5ce898,null));};exports[_0x7da2('0x57')]=function(_0x2a03f7,_0x42bd79){return db[_0x7da2('0x23')][_0x7da2('0x3a')]({'where':{'id':_0x2a03f7[_0x7da2('0x2e')]['id']}})[_0x7da2('0x1c')](handleEntityNotFound(_0x42bd79,null))[_0x7da2('0x1c')](function(_0x34eeb2){if(_0x34eeb2){return _0x34eeb2[_0x7da2('0x57')](_0x2a03f7[_0x7da2('0x2a')][_0x7da2('0x41')]);}})[_0x7da2('0x1c')](respondWithStatusCode(_0x42bd79,null))[_0x7da2('0x2c')](handleError(_0x42bd79,null));};exports[_0x7da2('0x58')]=function(_0x1c281b,_0x2d50fe){var _0x50bde2=moment()[_0x7da2('0x59')]()[_0x7da2('0x5a')]();var _0x45bcb6=path[_0x7da2('0x5b')](config[_0x7da2('0x5c')],_0x7da2('0x5d'),_0x7da2('0x5e'),_0x7da2('0x5f'));var _0x1a1735=path[_0x7da2('0x5b')](config[_0x7da2('0x5c')],_0x7da2('0x5d'),_0x7da2('0x5e'),_0x7da2('0x60'));var _0x24b508=path[_0x7da2('0x5b')](_0x45bcb6,_0x50bde2);var _0x1d30bc=util[_0x7da2('0x4d')]('transcript-%d-%s.zip',_0x1c281b[_0x7da2('0x2e')]['id'],_0x50bde2);var _0x50f07b=path['join'](_0x45bcb6,_0x1d30bc);var _0x4213e3=[];_0x4213e3[_0x7da2('0x61')]({'model':db[_0x7da2('0x62')],'as':'User','attributes':['id',_0x7da2('0x63')],'raw':!![]});_0x4213e3['push']({'model':db[_0x7da2('0x64')],'as':_0x7da2('0x65'),'attributes':['id',_0x7da2('0x66'),_0x7da2('0x67')],'raw':!![]});if(_0x1c281b[_0x7da2('0x2a')][_0x7da2('0x60')]){_0x4213e3[_0x7da2('0x61')]({'model':db[_0x7da2('0x68')],'as':_0x7da2('0x68'),'raw':!![]});}var _0x47821d=[{'model':db[_0x7da2('0x3f')],'as':_0x7da2('0x69'),'attributes':['id',_0x7da2('0x3c'),'createdAt',_0x7da2('0x6a'),_0x7da2('0x6b'),_0x7da2('0x6c')],'include':_0x4213e3}];_0x47821d[_0x7da2('0x61')]({'model':db[_0x7da2('0x6d')],'as':_0x7da2('0x6e'),'attributes':['id',_0x7da2('0x20')]});_0x47821d[_0x7da2('0x61')]({'model':db[_0x7da2('0x62')],'as':_0x7da2('0x6f'),'attributes':['id',_0x7da2('0x63')]});return db[_0x7da2('0x23')]['find']({'where':{'id':_0x1c281b['params']['id']},'include':_0x47821d})[_0x7da2('0x1c')](handleEntityNotFound(_0x2d50fe,null))['then'](function(_0x73dd07){if(_0x73dd07){var _0x4fd459=_0x73dd07['get']({'plain':!![]});fs[_0x7da2('0x70')](_0x24b508);var _0x5423ff={'channel':_0x7da2('0x71'),'account':_0x4fd459[_0x7da2('0x6e')][_0x7da2('0x20')],'agent':_0x4fd459[_0x7da2('0x6f')]?_0x4fd459[_0x7da2('0x6f')][_0x7da2('0x63')]:'N.A.','createdAt':moment(_0x4fd459['createdAt'])[_0x7da2('0x4d')](_0x7da2('0x4e'))['toString'](),'closedAt':_0x4fd459[_0x7da2('0x72')]?moment(_0x4fd459[_0x7da2('0x73')])[_0x7da2('0x4d')](_0x7da2('0x4e'))[_0x7da2('0x5a')]():'','disposition':_0x4fd459[_0x7da2('0x74')],'messages':_(_0x4fd459[_0x7da2('0x69')])['filter']({'secret':![]})['map'](function(_0x1d984b){if(_0x1d984b[_0x7da2('0x68')]){var _0x524325=path[_0x7da2('0x5b')](_0x1a1735,_0x1d984b[_0x7da2('0x68')][_0x7da2('0x75')]);if(fs[_0x7da2('0x76')](_0x524325)){fs[_0x7da2('0x77')](_0x524325)[_0x7da2('0x78')](fs[_0x7da2('0x79')](path[_0x7da2('0x5b')](_0x24b508,_0x1d984b[_0x7da2('0x68')][_0x7da2('0x75')])));}}return{'date':moment(_0x1d984b[_0x7da2('0x7a')])[_0x7da2('0x4d')](_0x7da2('0x4e'))[_0x7da2('0x5a')](),'sender':_0x1d984b['direction']===_0x7da2('0x7b')?_0x1d984b[_0x7da2('0x62')]?_0x1d984b[_0x7da2('0x62')]['fullname']:_0x7da2('0x7c'):_0x1d984b[_0x7da2('0x65')][_0x7da2('0x66')]+(_0x1d984b['Contact']['lastName']?'\x20'+_0x1d984b[_0x7da2('0x65')][_0x7da2('0x67')]:''),'body':_0x1d984b['Attachment']?_0x1d984b[_0x7da2('0x68')]['basename']:_0x1d984b['body'],'direction':_0x1d984b['direction']==='out'?'A':'C','secret':_0x1d984b[_0x7da2('0x6b')],'read':_0x1d984b[_0x7da2('0x6c')],'attachment':_0x1d984b['Attachment']};})[_0x7da2('0x7d')]()};return ejs[_0x7da2('0x7e')](path['join'](config[_0x7da2('0x5c')],_0x7da2('0x5d'),_0x7da2('0x7f'),_0x7da2('0x80')),{'interaction':_0x5423ff})[_0x7da2('0x1c')](function(_0x16f389){var _0x55d233=path['join'](_0x24b508,_0x7da2('0x81')+_0x4fd459['id']+'-'+_0x50bde2+_0x7da2('0x82'));var _0x233de2={'path':_0x55d233,'channel':_0x7da2('0x71'),'interactionId':_0x4fd459['id']};return pdf[_0x7da2('0x83')](_0x16f389,_0x233de2);})[_0x7da2('0x1c')](function(){return new BPromise(function(_0x518887,_0xa6429b){zipdir(_0x24b508,{'saveTo':_0x50f07b},function(_0xb0bf83,_0x55e295){if(_0xb0bf83)return _0xa6429b(_0xb0bf83);return _0x518887(_0x55e295);});})[_0x7da2('0x1c')](function(){return new BPromise(function(_0x2cb136,_0x47e540){rimraf(_0x24b508,function(_0xa5182d){if(_0xa5182d)_0x47e540(_0xa5182d);return _0x2cb136();});});})[_0x7da2('0x1c')](function(){return _0x2d50fe[_0x7da2('0x58')](_0x50f07b,_0x1d30bc,function(_0x1ba049){if(_0x1ba049){console[_0x7da2('0x84')](_0x7da2('0x85'),_0x1ba049);}else{fs['unlinkSync'](_0x50f07b);}});});});}else{return _0x2d50fe[_0x7da2('0x13')](0xc8);}})[_0x7da2('0x2c')](handleError(_0x2d50fe,null));}; \ No newline at end of file +var _0x1a0c=['name','index','map','WhatsappInteraction','type','key','getOptions','findAll','whatsapp','query','user','catch','show','model','keys','rawAttributes','filters','intersection','fields','attributes','includeAll','include','options','find','body','update','params','describe','addMessage','ids','findOne','WhatsappMessage','length','hasOwnProperty','order','sort','where','pick','WhatsappInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','toString','join','server','files','tmp','root','attachments','User','fullname','push','CmContact','firstName','lastName','Attachment','Messages','createdAt','secret','Owner','mkdirSync','Whatsapp','Account','N.A.','closed','closedAt','disposition','basename','existsSync','pipe','createWriteStream','direction','out','Contact','read','value','renderFile','views','downloadInteraction.ejs','.pdf','log','err','rimraf','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','localhost','register','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','sendStatus','error'];(function(_0x4c4f97,_0x1b17f6){var _0x3f193b=function(_0x1a19ea){while(--_0x1a19ea){_0x4c4f97['push'](_0x4c4f97['shift']());}};_0x3f193b(++_0x1b17f6);}(_0x1a0c,0x15e));var _0xc1a0=function(_0x519c88,_0xb84103){_0x519c88=_0x519c88-0x0;var _0x4668d7=_0x1a0c[_0x519c88];return _0x4668d7;};'use strict';var rimraf=require(_0xc1a0('0x0'));var zipdir=require(_0xc1a0('0x1'));var moment=require(_0xc1a0('0x2'));var BPromise=require(_0xc1a0('0x3'));var util=require(_0xc1a0('0x4'));var path=require(_0xc1a0('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc1a0('0x6'));var Redis=require(_0xc1a0('0x7'));var interaction=require(_0xc1a0('0x8'));var qs=require(_0xc1a0('0x9'));var pdf=require(_0xc1a0('0xa'));var logger=require(_0xc1a0('0xb'))(_0xc1a0('0xc'));var config=require(_0xc1a0('0xd'));var db=require('../../mysqldb')['db'];config[_0xc1a0('0xe')]=_[_0xc1a0('0xf')](config[_0xc1a0('0xe')],{'host':_0xc1a0('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc1a0('0xe')]));require('./whatsappInteraction.socket')[_0xc1a0('0x11')](socket);function respondWithStatusCode(_0x35dacc,_0x51359d){_0x51359d=_0x51359d||0xcc;return function(_0x222d09){if(_0x222d09){return _0x35dacc['sendStatus'](_0x51359d);}return _0x35dacc[_0xc1a0('0x12')](_0x51359d)[_0xc1a0('0x13')]();};}function respondWithResult(_0x1e514c,_0x1b2bbd){_0x1b2bbd=_0x1b2bbd||0xc8;return function(_0x1ea7e5){if(_0x1ea7e5){return _0x1e514c[_0xc1a0('0x12')](_0x1b2bbd)[_0xc1a0('0x14')](_0x1ea7e5);}};}function respondWithFilteredResult(_0x43a568,_0x1b01b3){return function(_0x4eb6b2){if(_0x4eb6b2){var _0x2d36e2=typeof _0x1b01b3[_0xc1a0('0x15')]===_0xc1a0('0x16')&&typeof _0x1b01b3['limit']==='undefined';var _0x949998=_0x4eb6b2[_0xc1a0('0x17')];var _0x48ef12=_0x2d36e2?0x0:_0x1b01b3[_0xc1a0('0x15')];var _0x1e7e83=_0x2d36e2?_0x4eb6b2[_0xc1a0('0x17')]:_0x1b01b3[_0xc1a0('0x15')]+_0x1b01b3[_0xc1a0('0x18')];var _0xf8e978;if(_0x1e7e83>=_0x949998){_0x1e7e83=_0x949998;_0xf8e978=0xc8;}else{_0xf8e978=0xce;}_0x43a568[_0xc1a0('0x12')](_0xf8e978);return _0x43a568[_0xc1a0('0x19')](_0xc1a0('0x1a'),_0x48ef12+'-'+_0x1e7e83+'/'+_0x949998)[_0xc1a0('0x14')](_0x4eb6b2);}return null;};}function saveUpdates(_0x34e6d2){return function(_0x53b534){if(_0x53b534){return _0x53b534['update'](_0x34e6d2)[_0xc1a0('0x1b')](function(_0x383d66){return _0x383d66;});}return null;};}function removeEntity(_0x20b12e){return function(_0x373a11){if(_0x373a11){return _0x373a11[_0xc1a0('0x1c')]()['then'](function(){_0x20b12e[_0xc1a0('0x12')](0xcc)[_0xc1a0('0x13')]();});}};}function handleEntityNotFound(_0x4b8f2c){return function(_0x47e300){if(!_0x47e300){_0x4b8f2c[_0xc1a0('0x1d')](0x194);}return _0x47e300;};}function handleError(_0x3217db,_0x5d50ae){_0x5d50ae=_0x5d50ae||0x1f4;return function(_0x3a36fb){logger[_0xc1a0('0x1e')](_0x3a36fb['stack']);if(_0x3a36fb[_0xc1a0('0x1f')]){delete _0x3a36fb['name'];}_0x3217db[_0xc1a0('0x12')](_0x5d50ae)['send'](_0x3a36fb);};}exports[_0xc1a0('0x20')]=function(_0x76d122,_0x20dd8f){var _0x175a19={};var _0x2b4ada=_[_0xc1a0('0x21')](db[_0xc1a0('0x22')]['rawAttributes'],function(_0xef922c){return{'name':_0xef922c['fieldName'],'type':_0xef922c[_0xc1a0('0x23')][_0xc1a0('0x24')]};});_0x175a19=qs[_0xc1a0('0x25')](_0x2b4ada,_0x76d122);return interaction[_0xc1a0('0x26')](_0xc1a0('0x27'),_0x76d122[_0xc1a0('0x28')],_0x76d122[_0xc1a0('0x29')],_0x175a19,_0x2b4ada)[_0xc1a0('0x1b')](respondWithFilteredResult(_0x20dd8f,_0x175a19))[_0xc1a0('0x2a')](handleError(_0x20dd8f,null));};exports[_0xc1a0('0x2b')]=function(_0x537e8e,_0x1d47d6){var _0x1330fc={'raw':![],'where':{'id':_0x537e8e['params']['id']}},_0x43f5e9={};_0x43f5e9[_0xc1a0('0x2c')]=_[_0xc1a0('0x2d')](db[_0xc1a0('0x22')][_0xc1a0('0x2e')]);_0x43f5e9[_0xc1a0('0x28')]=_['keys'](_0x537e8e[_0xc1a0('0x28')]);_0x43f5e9[_0xc1a0('0x2f')]=_['intersection'](_0x43f5e9[_0xc1a0('0x2c')],_0x43f5e9[_0xc1a0('0x28')]);_0x1330fc['attributes']=_[_0xc1a0('0x30')](_0x43f5e9[_0xc1a0('0x2c')],qs['fields'](_0x537e8e['query'][_0xc1a0('0x31')]));_0x1330fc[_0xc1a0('0x32')]=_0x1330fc[_0xc1a0('0x32')]['length']?_0x1330fc['attributes']:_0x43f5e9[_0xc1a0('0x2c')];if(_0x537e8e['query'][_0xc1a0('0x33')]){_0x1330fc[_0xc1a0('0x34')]=[{'all':!![]}];}_0x1330fc=_['merge']({},_0x1330fc,_0x537e8e[_0xc1a0('0x35')]);return db['WhatsappInteraction'][_0xc1a0('0x36')](_0x1330fc)[_0xc1a0('0x1b')](handleEntityNotFound(_0x1d47d6,null))[_0xc1a0('0x1b')](respondWithResult(_0x1d47d6,null))[_0xc1a0('0x2a')](handleError(_0x1d47d6,null));};exports['create']=function(_0x146295,_0x377f30){return db[_0xc1a0('0x22')]['create'](_0x146295[_0xc1a0('0x37')],{})[_0xc1a0('0x1b')](respondWithResult(_0x377f30,0xc9))[_0xc1a0('0x2a')](handleError(_0x377f30,null));};exports[_0xc1a0('0x38')]=function(_0x1f7c17,_0x160c63){if(_0x1f7c17[_0xc1a0('0x37')]['id']){delete _0x1f7c17['body']['id'];}return db[_0xc1a0('0x22')]['find']({'where':{'id':_0x1f7c17['params']['id']}})[_0xc1a0('0x1b')](handleEntityNotFound(_0x160c63,null))[_0xc1a0('0x1b')](saveUpdates(_0x1f7c17[_0xc1a0('0x37')],null))[_0xc1a0('0x1b')](respondWithResult(_0x160c63,null))['catch'](handleError(_0x160c63,null));};exports[_0xc1a0('0x1c')]=function(_0x3c3fd2,_0x5fcc11){return db[_0xc1a0('0x22')][_0xc1a0('0x36')]({'where':{'id':_0x3c3fd2[_0xc1a0('0x39')]['id']}})[_0xc1a0('0x1b')](handleEntityNotFound(_0x5fcc11,null))['then'](removeEntity(_0x5fcc11,null))[_0xc1a0('0x2a')](handleError(_0x5fcc11,null));};exports[_0xc1a0('0x3a')]=function(_0x2a9321,_0x62f66c){return db[_0xc1a0('0x22')][_0xc1a0('0x3a')]()[_0xc1a0('0x1b')](respondWithResult(_0x62f66c,null))[_0xc1a0('0x2a')](handleError(_0x62f66c,null));};exports[_0xc1a0('0x3b')]=function(_0x36a536,_0x5d38c3){return db['WhatsappMessage'][_0xc1a0('0x36')]({'where':{'id':_0x36a536[_0xc1a0('0x39')]['id']}})['then'](handleEntityNotFound(_0x5d38c3,null))[_0xc1a0('0x1b')](function(_0x141b06){if(_0x141b06){return _0x141b06[_0xc1a0('0x3b')](_0x36a536['body'][_0xc1a0('0x3c')],_['omit'](_0x36a536[_0xc1a0('0x37')],[_0xc1a0('0x3c'),'id'])||{});}})[_0xc1a0('0x1b')](respondWithResult(_0x5d38c3,null))[_0xc1a0('0x2a')](handleError(_0x5d38c3,null));};exports['getMessages']=function(_0x151384,_0x4e7671){var _0x4a1fd5={'raw':![],'where':{}};var _0x22a537={};var _0x2665ea={'count':0x0,'rows':[]};return db[_0xc1a0('0x22')][_0xc1a0('0x3d')]({'where':{'id':_0x151384[_0xc1a0('0x39')]['id']}})['then'](handleEntityNotFound(_0x4e7671,null))['then'](function(_0x3afcef){if(_0x3afcef){_0x22a537['model']=_[_0xc1a0('0x2d')](db[_0xc1a0('0x3e')][_0xc1a0('0x2e')]);_0x22a537['query']=_[_0xc1a0('0x2d')](_0x151384[_0xc1a0('0x28')]);_0x22a537['filters']=_[_0xc1a0('0x30')](_0x22a537[_0xc1a0('0x2c')],_0x22a537[_0xc1a0('0x28')]);_0x4a1fd5['attributes']=_[_0xc1a0('0x30')](_0x22a537[_0xc1a0('0x2c')],qs[_0xc1a0('0x31')](_0x151384[_0xc1a0('0x28')][_0xc1a0('0x31')]));_0x4a1fd5[_0xc1a0('0x32')]=_0x4a1fd5[_0xc1a0('0x32')][_0xc1a0('0x3f')]?_0x4a1fd5[_0xc1a0('0x32')]:_0x22a537['model'];if(!_0x151384[_0xc1a0('0x28')][_0xc1a0('0x40')]('nolimit')){_0x4a1fd5[_0xc1a0('0x18')]=qs[_0xc1a0('0x18')](_0x151384[_0xc1a0('0x28')][_0xc1a0('0x18')]);_0x4a1fd5['offset']=qs[_0xc1a0('0x15')](_0x151384['query'][_0xc1a0('0x15')]);}_0x4a1fd5[_0xc1a0('0x41')]=qs[_0xc1a0('0x42')](_0x151384[_0xc1a0('0x28')][_0xc1a0('0x42')]);_0x4a1fd5[_0xc1a0('0x43')]=qs[_0xc1a0('0x2f')](_[_0xc1a0('0x44')](_0x151384[_0xc1a0('0x28')],_0x22a537[_0xc1a0('0x2f')]));_0x4a1fd5['where'][_0xc1a0('0x45')]=_0x3afcef['id'];if(_0x151384[_0xc1a0('0x28')][_0xc1a0('0x46')]){_0x4a1fd5[_0xc1a0('0x43')]=_[_0xc1a0('0x47')](_0x4a1fd5[_0xc1a0('0x43')],{'$or':_[_0xc1a0('0x21')](_0x4a1fd5[_0xc1a0('0x32')],function(_0x9f86f1){var _0x281a05={};_0x281a05[_0x9f86f1]={'$like':'%'+_0x151384[_0xc1a0('0x28')]['filter']+'%'};return _0x281a05;})});}if(_0x151384[_0xc1a0('0x28')][_0xc1a0('0x48')]){var _0x304937=_0x151384[_0xc1a0('0x28')][_0xc1a0('0x48')][_0xc1a0('0x49')](',');var _0x539f10={};_0x539f10[_0x304937[0x0]]={'$gte':moment(_0x304937[0x1])[_0xc1a0('0x4a')](_0xc1a0('0x4b'))};_0x4a1fd5['where']=_[_0xc1a0('0x47')](_0x4a1fd5[_0xc1a0('0x43')],_0x539f10);}_0x4a1fd5=_[_0xc1a0('0x47')]({},_0x4a1fd5,_0x151384[_0xc1a0('0x35')]);return db[_0xc1a0('0x3e')][_0xc1a0('0x17')]({'where':_0x4a1fd5[_0xc1a0('0x43')]})[_0xc1a0('0x1b')](function(_0x58de5c){_0x2665ea[_0xc1a0('0x17')]=_0x58de5c;if(_0x151384['query'][_0xc1a0('0x33')]){_0x4a1fd5[_0xc1a0('0x34')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xc1a0('0x26')](_0x4a1fd5);})[_0xc1a0('0x1b')](function(_0x5f0c58){_0x2665ea[_0xc1a0('0x4c')]=_0x5f0c58;return _0x2665ea;});}})[_0xc1a0('0x1b')](respondWithFilteredResult(_0x4e7671,_0x4a1fd5))[_0xc1a0('0x2a')](handleError(_0x4e7671,null));};exports[_0xc1a0('0x4d')]=function(_0x25be49,_0x164315){return db[_0xc1a0('0x22')][_0xc1a0('0x36')]({'where':{'id':_0x25be49[_0xc1a0('0x39')]['id']}})[_0xc1a0('0x1b')](handleEntityNotFound(_0x164315,null))[_0xc1a0('0x1b')](function(_0x5e2ebe){if(_0x5e2ebe){return _0x5e2ebe[_0xc1a0('0x4e')](_0x25be49[_0xc1a0('0x37')]['ids'],_[_0xc1a0('0x4f')](_0x25be49['body'],[_0xc1a0('0x3c'),'id'])||{})[_0xc1a0('0x50')](function(){return db[_0xc1a0('0x51')][_0xc1a0('0x26')]({'attributes':['id','name',_0xc1a0('0x52')],'where':{'id':_0x25be49['body'][_0xc1a0('0x3c')]}});})[_0xc1a0('0x1b')](function(_0x295510){socket[_0xc1a0('0x53')](_0xc1a0('0x54'),{'id':Number(_0x25be49[_0xc1a0('0x39')]['id']),'tags':_0x295510||[]});return{'id':Number(_0x25be49[_0xc1a0('0x39')]['id']),'tags':_0x295510||[]};});}})[_0xc1a0('0x1b')](respondWithResult(_0x164315,null))[_0xc1a0('0x2a')](handleError(_0x164315,null));};exports[_0xc1a0('0x55')]=function(_0xb58f5b,_0x2609ea){return db['WhatsappInteraction'][_0xc1a0('0x36')]({'where':{'id':_0xb58f5b[_0xc1a0('0x39')]['id']}})[_0xc1a0('0x1b')](handleEntityNotFound(_0x2609ea,null))[_0xc1a0('0x1b')](function(_0x1e8d6f){if(_0x1e8d6f){return _0x1e8d6f[_0xc1a0('0x55')](_0xb58f5b['query'][_0xc1a0('0x3c')]);}})[_0xc1a0('0x1b')](respondWithStatusCode(_0x2609ea,null))[_0xc1a0('0x2a')](handleError(_0x2609ea,null));};exports[_0xc1a0('0x56')]=function(_0x5e1989,_0x51cfd8){var _0x48d81f=moment()['unix']()[_0xc1a0('0x57')]();var _0x4a2122=path[_0xc1a0('0x58')](config['root'],_0xc1a0('0x59'),_0xc1a0('0x5a'),_0xc1a0('0x5b'));var _0x2e1625=path[_0xc1a0('0x58')](config[_0xc1a0('0x5c')],_0xc1a0('0x59'),_0xc1a0('0x5a'),_0xc1a0('0x5d'));var _0x45b9b9=path[_0xc1a0('0x58')](_0x4a2122,_0x48d81f);var _0x4a405f=util[_0xc1a0('0x4a')]('transcript-%d-%s.zip',_0x5e1989['params']['id'],_0x48d81f);var _0x25bebe=path[_0xc1a0('0x58')](_0x4a2122,_0x4a405f);var _0x221d4a=[];_0x221d4a['push']({'model':db[_0xc1a0('0x5e')],'as':_0xc1a0('0x5e'),'attributes':['id',_0xc1a0('0x5f')],'raw':!![]});_0x221d4a[_0xc1a0('0x60')]({'model':db[_0xc1a0('0x61')],'as':'Contact','attributes':['id',_0xc1a0('0x62'),_0xc1a0('0x63')],'raw':!![]});if(_0x5e1989[_0xc1a0('0x28')][_0xc1a0('0x5d')]){_0x221d4a[_0xc1a0('0x60')]({'model':db['Attachment'],'as':_0xc1a0('0x64'),'raw':!![]});}var _0x21d1d8=[{'model':db[_0xc1a0('0x3e')],'as':_0xc1a0('0x65'),'attributes':['id',_0xc1a0('0x37'),_0xc1a0('0x66'),'direction',_0xc1a0('0x67'),'read'],'include':_0x221d4a}];_0x21d1d8[_0xc1a0('0x60')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0xc1a0('0x1f')]});_0x21d1d8[_0xc1a0('0x60')]({'model':db['User'],'as':_0xc1a0('0x68'),'attributes':['id',_0xc1a0('0x5f')]});return db[_0xc1a0('0x22')][_0xc1a0('0x36')]({'where':{'id':_0x5e1989[_0xc1a0('0x39')]['id']},'include':_0x21d1d8})[_0xc1a0('0x1b')](handleEntityNotFound(_0x51cfd8,null))['then'](function(_0x277976){if(_0x277976){var _0x50493c=_0x277976['get']({'plain':!![]});fs[_0xc1a0('0x69')](_0x45b9b9);var _0x50e4c7={'channel':_0xc1a0('0x6a'),'account':_0x50493c[_0xc1a0('0x6b')][_0xc1a0('0x1f')],'agent':_0x50493c[_0xc1a0('0x68')]?_0x50493c[_0xc1a0('0x68')][_0xc1a0('0x5f')]:_0xc1a0('0x6c'),'createdAt':moment(_0x50493c[_0xc1a0('0x66')])[_0xc1a0('0x4a')](_0xc1a0('0x4b'))[_0xc1a0('0x57')](),'closedAt':_0x50493c[_0xc1a0('0x6d')]?moment(_0x50493c[_0xc1a0('0x6e')])[_0xc1a0('0x4a')](_0xc1a0('0x4b'))['toString']():'','disposition':_0x50493c[_0xc1a0('0x6f')],'messages':_(_0x50493c[_0xc1a0('0x65')])[_0xc1a0('0x46')]({'secret':![]})[_0xc1a0('0x21')](function(_0x3c5e24){if(_0x3c5e24['Attachment']){var _0x2d0b26=path[_0xc1a0('0x58')](_0x2e1625,_0x3c5e24['Attachment'][_0xc1a0('0x70')]);if(fs[_0xc1a0('0x71')](_0x2d0b26)){fs['createReadStream'](_0x2d0b26)[_0xc1a0('0x72')](fs[_0xc1a0('0x73')](path['join'](_0x45b9b9,_0x3c5e24['Attachment'][_0xc1a0('0x70')])));}}return{'date':moment(_0x3c5e24['createdAt'])[_0xc1a0('0x4a')](_0xc1a0('0x4b'))[_0xc1a0('0x57')](),'sender':_0x3c5e24[_0xc1a0('0x74')]===_0xc1a0('0x75')?_0x3c5e24['User']?_0x3c5e24[_0xc1a0('0x5e')][_0xc1a0('0x5f')]:'System':_0x3c5e24[_0xc1a0('0x76')][_0xc1a0('0x62')]+(_0x3c5e24['Contact'][_0xc1a0('0x63')]?'\x20'+_0x3c5e24[_0xc1a0('0x76')]['lastName']:''),'body':_0x3c5e24[_0xc1a0('0x64')]?_0x3c5e24[_0xc1a0('0x64')][_0xc1a0('0x70')]:_0x3c5e24[_0xc1a0('0x37')],'direction':_0x3c5e24[_0xc1a0('0x74')]===_0xc1a0('0x75')?'A':'C','secret':_0x3c5e24[_0xc1a0('0x67')],'read':_0x3c5e24[_0xc1a0('0x77')],'attachment':_0x3c5e24['Attachment']};})[_0xc1a0('0x78')]()};return ejs[_0xc1a0('0x79')](path[_0xc1a0('0x58')](config[_0xc1a0('0x5c')],_0xc1a0('0x59'),_0xc1a0('0x7a'),_0xc1a0('0x7b')),{'interaction':_0x50e4c7})[_0xc1a0('0x1b')](function(_0x2241fc){var _0x152647=path[_0xc1a0('0x58')](_0x45b9b9,'transcript-'+_0x50493c['id']+'-'+_0x48d81f+_0xc1a0('0x7c'));var _0xd024c4={'path':_0x152647,'channel':_0xc1a0('0x6a'),'interactionId':_0x50493c['id']};return pdf['createPdfFromHTML'](_0x2241fc,_0xd024c4);})[_0xc1a0('0x1b')](function(){return new BPromise(function(_0x14e428,_0x211ca2){zipdir(_0x45b9b9,{'saveTo':_0x25bebe},function(_0x5b574c,_0x31df6e){if(_0x5b574c)return _0x211ca2(_0x5b574c);return _0x14e428(_0x31df6e);});})[_0xc1a0('0x1b')](function(){return new BPromise(function(_0x2fb038,_0x16cc5c){rimraf(_0x45b9b9,function(_0x1bbf51){if(_0x1bbf51)_0x16cc5c(_0x1bbf51);return _0x2fb038();});});})['then'](function(){return _0x51cfd8[_0xc1a0('0x56')](_0x25bebe,_0x4a405f,function(_0x5f4c2c){if(_0x5f4c2c){console[_0xc1a0('0x7d')](_0xc1a0('0x7e'),_0x5f4c2c);}else{fs['unlinkSync'](_0x25bebe);}});});});}else{return _0x51cfd8[_0xc1a0('0x1d')](0xc8);}})['catch'](handleError(_0x51cfd8,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 219ee60..25ed154 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 _0x851d=['emit','catch','exports','events','WhatsappInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','length'];(function(_0x81697e,_0x552c16){var _0x1f6e36=function(_0x2a6bbd){while(--_0x2a6bbd){_0x81697e['push'](_0x81697e['shift']());}};_0x1f6e36(++_0x552c16);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd851('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xd851('0x1')];var WhatsappMessage=require(_0xd851('0x2'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xd851('0x3')](0x0);var events={'afterCreate':_0xd851('0x4'),'afterUpdate':_0xd851('0x5'),'afterDestroy':_0xd851('0x6')};function emitEvent(_0x36eb20){return function(_0x456821,_0x4812ec,_0x578809){_0x456821[_0xd851('0x7')]({'attributes':['id'],'raw':!![]})[_0xd851('0x8')](function(_0x3d2383){_0x456821[_0xd851('0x9')](_0xd851('0xa'),_0x3d2383[_0xd851('0xb')](function(_0x599973){return{'id':_0x599973['id']};}));return WhatsappMessage[_0xd851('0xc')]({'where':{'WhatsappInteractionId':_0x456821['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x33e66a){_0x456821[_0xd851('0x9')]('unreadMessages',_0x33e66a[_0xd851('0xd')]);WhatsappInteractionEvents[_0xd851('0xe')](_0x36eb20+':'+_0x456821['id'],_0x456821);WhatsappInteractionEvents[_0xd851('0xe')](_0x36eb20,_0x456821);_0x578809(null);})[_0xd851('0xf')](_0x578809(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xd851('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x1782=['save','remove','getUsers','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x7cd276,_0x35db85){var _0x599999=function(_0x4f1e5d){while(--_0x4f1e5d){_0x7cd276['push'](_0x7cd276['shift']());}};_0x599999(++_0x35db85);}(_0x1782,0x13e));var _0x2178=function(_0x2337cf,_0xf7cda7){_0x2337cf=_0x2337cf-0x0;var _0x121622=_0x1782[_0x2337cf];return _0x121622;};'use strict';var EventEmitter=require(_0x2178('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x2178('0x1')];var WhatsappMessage=require(_0x2178('0x2'))['db'][_0x2178('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x2178('0x4')](0x0);var events={'afterCreate':_0x2178('0x5'),'afterUpdate':'update','afterDestroy':_0x2178('0x6')};function emitEvent(_0x1659a1){return function(_0x5f44d6,_0x59ebf6,_0x3c4dd1){_0x5f44d6[_0x2178('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x53b9f9){_0x5f44d6['setDataValue'](_0x2178('0x8'),_0x53b9f9[_0x2178('0x9')](function(_0xdd790e){return{'id':_0xdd790e['id']};}));return WhatsappMessage[_0x2178('0xa')]({'where':{'WhatsappInteractionId':_0x5f44d6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2178('0xb')](function(_0x5ac52e){_0x5f44d6['setDataValue'](_0x2178('0xc'),_0x5ac52e[_0x2178('0xd')]);WhatsappInteractionEvents[_0x2178('0xe')](_0x1659a1+':'+_0x5f44d6['id'],_0x5f44d6);WhatsappInteractionEvents[_0x2178('0xe')](_0x1659a1,_0x5f44d6);_0x3c4dd1(null);})[_0x2178('0xf')](_0x3c4dd1(null));};}for(var e in events){if(events[_0x2178('0x10')](e)){var event=events[e];WhatsappInteraction[_0x2178('0x11')](e,emitEvent(event));}}module[_0x2178('0x12')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 7f9d54a..3f31ea1 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 _0x257c=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x317e30,_0x32ad66){var _0x203788=function(_0x264d38){while(--_0x264d38){_0x317e30['push'](_0x317e30['shift']());}};_0x203788(++_0x32ad66);}(_0x257c,0x111));var _0xc257=function(_0x545433,_0xe238b6){_0x545433=_0x545433-0x0;var _0x1d7243=_0x257c[_0x545433];return _0x1d7243;};'use strict';var _=require('lodash');var util=require(_0xc257('0x0'));var logger=require(_0xc257('0x1'))(_0xc257('0x2'));var moment=require(_0xc257('0x3'));var BPromise=require(_0xc257('0x4'));var rp=require(_0xc257('0x5'));var fs=require('fs');var path=require(_0xc257('0x6'));var rimraf=require('rimraf');var config=require(_0xc257('0x7'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x49fd88,_0x2ee293){return _0x49fd88['define']('WhatsappInteraction',attributes,{'tableName':_0xc257('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x13d321,_0x3cd84e,_0x3c42f8){if(_0x13d321[_0xc257('0x9')](_0xc257('0xa'))){_0x13d321['closedAt']=moment()[_0xc257('0xb')](_0xc257('0xc'));}_0x3c42f8(null,_0x13d321);}}});}; \ No newline at end of file +var _0xe231=['moment','bluebird','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','closed','format','lodash','util','../../config/logger','api'];(function(_0x49fc97,_0x3a7d34){var _0x5b3e26=function(_0x2ea02d){while(--_0x2ea02d){_0x49fc97['push'](_0x49fc97['shift']());}};_0x5b3e26(++_0x3a7d34);}(_0xe231,0x92));var _0x1e23=function(_0x49aed9,_0x4a7b44){_0x49aed9=_0x49aed9-0x0;var _0x5c913e=_0xe231[_0x49aed9];return _0x5c913e;};'use strict';var _=require(_0x1e23('0x0'));var util=require(_0x1e23('0x1'));var logger=require(_0x1e23('0x2'))(_0x1e23('0x3'));var moment=require(_0x1e23('0x4'));var BPromise=require(_0x1e23('0x5'));var rp=require(_0x1e23('0x6'));var fs=require('fs');var path=require(_0x1e23('0x7'));var rimraf=require(_0x1e23('0x8'));var config=require('../../config/environment');var attributes=require(_0x1e23('0x9'));module[_0x1e23('0xa')]=function(_0x2a08df,_0x4f5126){return _0x2a08df[_0x1e23('0xb')]('WhatsappInteraction',attributes,{'tableName':_0x1e23('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d9a13,_0x2b8059,_0x108878){if(_0x4d9a13['changed'](_0x1e23('0xd'))){_0x4d9a13['closedAt']=moment()[_0x1e23('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x108878(null,_0x4d9a13);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 1f3b21f..9fd22cf 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 _0x51ce=['attributes','limit','find','where','ids','omit','body','spread','AddTags','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw'];(function(_0xc20f22,_0x49698f){var _0x1535d5=function(_0x5ce3f3){while(--_0x5ce3f3){_0xc20f22['push'](_0xc20f22['shift']());}};_0x1535d5(++_0x49698f);}(_0x51ce,0x171));var _0xe51c=function(_0x40f9a0,_0x3458cc){_0x40f9a0=_0x40f9a0-0x0;var _0x3e3144=_0x51ce[_0x40f9a0];return _0x3e3144;};'use strict';var _=require(_0xe51c('0x0'));var util=require(_0xe51c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe51c('0x2'));var db=require(_0xe51c('0x3'))['db'];var utils=require(_0xe51c('0x4'));var logger=require('../../config/logger')(_0xe51c('0x5'));var config=require(_0xe51c('0x6'));var jayson=require(_0xe51c('0x7'));var client=jayson[_0xe51c('0x8')]['http']({'port':0x232a});config[_0xe51c('0x9')]=_['defaults'](config[_0xe51c('0x9')],{'host':_0xe51c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe51c('0x9')]));require(_0xe51c('0xb'))[_0xe51c('0xc')](socket);function respondWithRpcPromise(_0x50bef7,_0x4778ba,_0x4bf3bf){return new BPromise(function(_0x5d0b3d,_0x1b624d){return client[_0xe51c('0xd')](_0x50bef7,_0x4bf3bf)[_0xe51c('0xe')](function(_0x411207){logger['info'](_0xe51c('0xf'),_0x4778ba,'request\x20sent');logger[_0xe51c('0x10')](_0xe51c('0x11'),_0x4778ba,_0xe51c('0x12'),JSON[_0xe51c('0x13')](_0x411207));if(_0x411207[_0xe51c('0x14')]){if(_0x411207[_0xe51c('0x14')][_0xe51c('0x15')]===0x1f4){logger[_0xe51c('0x14')](_0xe51c('0xf'),_0x4778ba,_0x411207['error'][_0xe51c('0x16')]);return _0x1b624d(_0x411207[_0xe51c('0x14')][_0xe51c('0x16')]);}logger['error'](_0xe51c('0xf'),_0x4778ba,_0x411207[_0xe51c('0x14')][_0xe51c('0x16')]);return _0x5d0b3d(_0x411207[_0xe51c('0x14')][_0xe51c('0x16')]);}else{logger[_0xe51c('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x4778ba,'request\x20sent');_0x5d0b3d(_0x411207[_0xe51c('0x18')][_0xe51c('0x16')]);}})[_0xe51c('0x19')](function(_0x2d50e7){logger[_0xe51c('0x14')](_0xe51c('0xf'),_0x4778ba,_0x2d50e7);_0x1b624d(_0x2d50e7);});});}exports[_0xe51c('0x1a')]=function(_0x1e8ff6){var _0x5541b6=this;return new Promise(function(_0x4eac6e,_0x5439ca){return db[_0xe51c('0x1b')][_0xe51c('0x1c')](_0x1e8ff6['body'],{'raw':_0x1e8ff6[_0xe51c('0x1d')]?_0x1e8ff6[_0xe51c('0x1d')][_0xe51c('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e8ff6[_0xe51c('0x1d')]?_0x1e8ff6['options']['where']||null:null,'attributes':_0x1e8ff6[_0xe51c('0x1d')]?_0x1e8ff6[_0xe51c('0x1d')][_0xe51c('0x1f')]||null:null,'limit':_0x1e8ff6[_0xe51c('0x1d')]?_0x1e8ff6['options'][_0xe51c('0x20')]||null:null})[_0xe51c('0xe')](function(_0x483742){logger[_0xe51c('0x17')](_0xe51c('0x1a'),_0x1e8ff6);logger['debug'](_0xe51c('0x1a'),_0x1e8ff6,JSON[_0xe51c('0x13')](_0x483742));_0x4eac6e(_0x483742);})['catch'](function(_0x7a5f35){logger[_0xe51c('0x14')](_0xe51c('0x1a'),_0x7a5f35['message'],_0x1e8ff6);_0x5439ca(_0x5541b6['error'](0x1f4,_0x7a5f35[_0xe51c('0x16')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x55d1bc){return new Promise(function(_0x1c7cbe,_0x5e9cb5){return db[_0xe51c('0x1b')][_0xe51c('0x21')]({'where':_0x55d1bc[_0xe51c('0x1d')]?_0x55d1bc[_0xe51c('0x1d')][_0xe51c('0x22')]||null:null})[_0xe51c('0xe')](function(_0x2944bf){if(_0x2944bf){return _0x2944bf['addTags'](_0x55d1bc['body'][_0xe51c('0x23')],_[_0xe51c('0x24')](_0x55d1bc[_0xe51c('0x25')],[_0xe51c('0x23'),'id'])||{});}})[_0xe51c('0x26')](function(_0x13e70f){logger['info'](_0xe51c('0x27'),_0x55d1bc);logger['debug'](_0xe51c('0x27'),_0x55d1bc,JSON[_0xe51c('0x13')](_0x13e70f));_0x1c7cbe(_0x13e70f);})['catch'](function(_0x20e44a){logger[_0xe51c('0x14')](_0xe51c('0x27'),_0x20e44a[_0xe51c('0x16')],_0x55d1bc);_0x5e9cb5(_this[_0xe51c('0x14')](0x1f4,_0x20e44a['message']));});});}; \ No newline at end of file +var _0x4de9=['register','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','update','body','options','raw','where','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket'];(function(_0x3a58c9,_0x18f9e8){var _0x228fe2=function(_0x2b3034){while(--_0x2b3034){_0x3a58c9['push'](_0x3a58c9['shift']());}};_0x228fe2(++_0x18f9e8);}(_0x4de9,0x180));var _0x94de=function(_0x20d54d,_0x1adc8e){_0x20d54d=_0x20d54d-0x0;var _0x516e8b=_0x4de9[_0x20d54d];return _0x516e8b;};'use strict';var _=require(_0x94de('0x0'));var util=require(_0x94de('0x1'));var moment=require(_0x94de('0x2'));var BPromise=require(_0x94de('0x3'));var rs=require(_0x94de('0x4'));var fs=require('fs');var Redis=require(_0x94de('0x5'));var db=require(_0x94de('0x6'))['db'];var utils=require(_0x94de('0x7'));var logger=require('../../config/logger')(_0x94de('0x8'));var config=require(_0x94de('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x94de('0xa')]['http']({'port':0x232a});config['redis']=_[_0x94de('0xb')](config[_0x94de('0xc')],{'host':_0x94de('0xd'),'port':0x18eb});var socket=require(_0x94de('0xe'))(new Redis(config[_0x94de('0xc')]));require(_0x94de('0xf'))[_0x94de('0x10')](socket);function respondWithRpcPromise(_0x1c80a2,_0x36ee24,_0x4bc52c){return new BPromise(function(_0x27d657,_0x570e6b){return client['request'](_0x1c80a2,_0x4bc52c)[_0x94de('0x11')](function(_0x902885){logger[_0x94de('0x12')](_0x94de('0x13'),_0x36ee24,'request\x20sent');logger[_0x94de('0x14')](_0x94de('0x15'),_0x36ee24,_0x94de('0x16'),JSON[_0x94de('0x17')](_0x902885));if(_0x902885[_0x94de('0x18')]){if(_0x902885[_0x94de('0x18')][_0x94de('0x19')]===0x1f4){logger['error'](_0x94de('0x13'),_0x36ee24,_0x902885[_0x94de('0x18')]['message']);return _0x570e6b(_0x902885[_0x94de('0x18')][_0x94de('0x1a')]);}logger[_0x94de('0x18')](_0x94de('0x13'),_0x36ee24,_0x902885[_0x94de('0x18')][_0x94de('0x1a')]);return _0x27d657(_0x902885[_0x94de('0x18')][_0x94de('0x1a')]);}else{logger['info'](_0x94de('0x13'),_0x36ee24,_0x94de('0x16'));_0x27d657(_0x902885['result']['message']);}})['catch'](function(_0x38caba){logger[_0x94de('0x18')](_0x94de('0x13'),_0x36ee24,_0x38caba);_0x570e6b(_0x38caba);});});}exports['UpdateWhatsappInteraction']=function(_0x56f771){var _0x510dfa=this;return new Promise(function(_0xf39a66,_0x2fca27){return db['WhatsappInteraction'][_0x94de('0x1b')](_0x56f771[_0x94de('0x1c')],{'raw':_0x56f771['options']?_0x56f771[_0x94de('0x1d')][_0x94de('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56f771['options']?_0x56f771[_0x94de('0x1d')][_0x94de('0x1f')]||null:null,'attributes':_0x56f771[_0x94de('0x1d')]?_0x56f771[_0x94de('0x1d')][_0x94de('0x20')]||null:null,'limit':_0x56f771[_0x94de('0x1d')]?_0x56f771[_0x94de('0x1d')][_0x94de('0x21')]||null:null})[_0x94de('0x11')](function(_0x116d71){logger['info'](_0x94de('0x22'),_0x56f771);logger[_0x94de('0x14')](_0x94de('0x22'),_0x56f771,JSON['stringify'](_0x116d71));_0xf39a66(_0x116d71);})['catch'](function(_0x3eb600){logger[_0x94de('0x18')](_0x94de('0x22'),_0x3eb600[_0x94de('0x1a')],_0x56f771);_0x2fca27(_0x510dfa[_0x94de('0x18')](0x1f4,_0x3eb600[_0x94de('0x1a')]));});});};exports[_0x94de('0x23')]=function(_0x53241d){return new Promise(function(_0x558b7f,_0x258a71){return db['WhatsappInteraction'][_0x94de('0x24')]({'where':_0x53241d[_0x94de('0x1d')]?_0x53241d[_0x94de('0x1d')][_0x94de('0x1f')]||null:null})[_0x94de('0x11')](function(_0x3d0981){if(_0x3d0981){return _0x3d0981['addTags'](_0x53241d['body'][_0x94de('0x25')],_['omit'](_0x53241d['body'],[_0x94de('0x25'),'id'])||{});}})[_0x94de('0x26')](function(_0x21dc58){logger[_0x94de('0x12')]('AddTags',_0x53241d);logger[_0x94de('0x14')](_0x94de('0x27'),_0x53241d,JSON[_0x94de('0x17')](_0x21dc58));_0x558b7f(_0x21dc58);})['catch'](function(_0x7c73db){logger[_0x94de('0x18')](_0x94de('0x27'),_0x7c73db[_0x94de('0x1a')],_0x53241d);_0x258a71(_this[_0x94de('0x18')](0x1f4,_0x7c73db[_0x94de('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 7ac1d67..1d66818 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 _0x2203=['length','whatsappInteraction:','remove','update','emit','register'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2203,0x140));var _0x3220=function(_0x22d53d,_0x339808){_0x22d53d=_0x22d53d-0x0;var _0x40dd91=_0x2203[_0x22d53d];return _0x40dd91;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save',_0x3220('0x0'),_0x3220('0x1')];function createListener(_0x15dc58,_0x2bde38){return function(_0x821636){_0x2bde38[_0x3220('0x2')](_0x15dc58,_0x821636);};}function removeListener(_0x3bcf76,_0x7bc860){return function(){WhatsappInteractionEvents['removeListener'](_0x3bcf76,_0x7bc860);};}exports[_0x3220('0x3')]=function(_0x2b2013){for(var _0x599686=0x0,_0x5e5882=events[_0x3220('0x4')];_0x599686<_0x5e5882;_0x599686++){var _0x391321=events[_0x599686];var _0x2dfbf1=createListener(_0x3220('0x5')+_0x391321,_0x2b2013);WhatsappInteractionEvents['on'](_0x391321,_0x2dfbf1);}}; \ No newline at end of file +var _0x2aff=['length','whatsappInteraction:','save','remove','update','emit','removeListener'];(function(_0x1dde53,_0x2e93c7){var _0x46ac20=function(_0x42a041){while(--_0x42a041){_0x1dde53['push'](_0x1dde53['shift']());}};_0x46ac20(++_0x2e93c7);}(_0x2aff,0x1c9));var _0xf2af=function(_0x5148ca,_0x3cb213){_0x5148ca=_0x5148ca-0x0;var _0x455e04=_0x2aff[_0x5148ca];return _0x455e04;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xf2af('0x0'),_0xf2af('0x1'),_0xf2af('0x2')];function createListener(_0x5f3648,_0x286f08){return function(_0x997121){_0x286f08[_0xf2af('0x3')](_0x5f3648,_0x997121);};}function removeListener(_0x1a43b6,_0x439425){return function(){WhatsappInteractionEvents[_0xf2af('0x4')](_0x1a43b6,_0x439425);};}exports['register']=function(_0xfb1d67){for(var _0x4765f2=0x0,_0xdb60cb=events[_0xf2af('0x5')];_0x4765f2<_0xdb60cb;_0x4765f2++){var _0x403e4e=events[_0x4765f2];var _0x37ef06=createListener(_0xf2af('0x6')+_0x403e4e,_0xfb1d67);WhatsappInteractionEvents['on'](_0x403e4e,_0x37ef06);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 54db639..2dfcf64 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 _0xd23c=['status','put','update','/:id/accept','accept','/:id/reject','delete','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status'];(function(_0x26dbfd,_0x4e1e05){var _0x4bbbe7=function(_0x4507ac){while(--_0x4507ac){_0x26dbfd['push'](_0x26dbfd['shift']());}};_0x4bbbe7(++_0x4e1e05);}(_0xd23c,0x78));var _0xcd23=function(_0x454a21,_0x12e741){_0x454a21=_0x454a21-0x0;var _0x2594b8=_0xd23c[_0x454a21];return _0x2594b8;};'use strict';var multer=require(_0xcd23('0x0'));var util=require('util');var path=require(_0xcd23('0x1'));var timeout=require(_0xcd23('0x2'));var express=require(_0xcd23('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcd23('0x4'));var config=require(_0xcd23('0x5'));var controller=require(_0xcd23('0x6'));router[_0xcd23('0x7')]('/',auth['isAuthenticated'](),controller[_0xcd23('0x8')]);router[_0xcd23('0x7')](_0xcd23('0x9'),auth[_0xcd23('0xa')](),controller[_0xcd23('0xb')]);router['get'](_0xcd23('0xc'),auth['isAuthenticated'](),controller[_0xcd23('0xd')]);router[_0xcd23('0xe')]('/',auth['isAuthenticated'](),interaction[_0xcd23('0xf')](_0xcd23('0x10'),_0xcd23('0x11')),controller[_0xcd23('0x12')]);router[_0xcd23('0xe')](_0xcd23('0x13'),controller[_0xcd23('0x14')]);router[_0xcd23('0x15')](_0xcd23('0xc'),auth[_0xcd23('0xa')](),controller[_0xcd23('0x16')]);router['put'](_0xcd23('0x17'),auth[_0xcd23('0xa')](),controller[_0xcd23('0x18')]);router[_0xcd23('0x15')](_0xcd23('0x19'),auth[_0xcd23('0xa')](),controller['reject']);router[_0xcd23('0x1a')](_0xcd23('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xcd23('0x1b')]=router; \ No newline at end of file +var _0x6c5a=['/:id/accept','accept','put','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','whatsapp','whatsappmessage:create','create','/:id/status','status','update'];(function(_0x15acf7,_0x5db7fa){var _0x1b6a6c=function(_0x459a8e){while(--_0x459a8e){_0x15acf7['push'](_0x15acf7['shift']());}};_0x1b6a6c(++_0x5db7fa);}(_0x6c5a,0x83));var _0xa6c5=function(_0x54bde1,_0x2befa3){_0x54bde1=_0x54bde1-0x0;var _0x2e2d07=_0x6c5a[_0x54bde1];return _0x2e2d07;};'use strict';var multer=require(_0xa6c5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa6c5('0x1'));var express=require(_0xa6c5('0x2'));var router=express['Router']();var fs_extra=require(_0xa6c5('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa6c5('0x4'));var config=require(_0xa6c5('0x5'));var controller=require('./whatsappMessage.controller');router[_0xa6c5('0x6')]('/',auth[_0xa6c5('0x7')](),controller[_0xa6c5('0x8')]);router[_0xa6c5('0x6')]('/describe',auth[_0xa6c5('0x7')](),controller[_0xa6c5('0x9')]);router['get'](_0xa6c5('0xa'),auth[_0xa6c5('0x7')](),controller[_0xa6c5('0xb')]);router[_0xa6c5('0xc')]('/',auth[_0xa6c5('0x7')](),interaction['tracked'](_0xa6c5('0xd'),_0xa6c5('0xe')),controller[_0xa6c5('0xf')]);router[_0xa6c5('0xc')](_0xa6c5('0x10'),controller[_0xa6c5('0x11')]);router['put']('/:id',auth[_0xa6c5('0x7')](),controller[_0xa6c5('0x12')]);router['put'](_0xa6c5('0x13'),auth[_0xa6c5('0x7')](),controller[_0xa6c5('0x14')]);router[_0xa6c5('0x15')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0xa6c5('0x16')](_0xa6c5('0xa'),auth[_0xa6c5('0x7')](),controller[_0xa6c5('0x17')]);module[_0xa6c5('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 273418f..36269bf 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 _0xdf83=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x1f9395,_0x21f4ba){var _0x1fa1b1=function(_0x5b069f){while(--_0x5b069f){_0x1f9395['push'](_0x1f9395['shift']());}};_0x1fa1b1(++_0x21f4ba);}(_0xdf83,0x120));var _0x3df8=function(_0x833417,_0x2ea2f9){_0x833417=_0x833417-0x0;var _0x388395=_0xdf83[_0x833417];return _0x388395;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x3df8('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x3df8('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3df8('0x2')]('in',_0x3df8('0x3')),'defaultValue':_0x3df8('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3df8('0x4')](0xbe)},'phone':{'type':Sequelize[_0x3df8('0x4')]},'readAt':{'type':Sequelize[_0x3df8('0x5')]},'secret':{'type':Sequelize[_0x3df8('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3df8('0x4')]},'providerResponse':{'type':Sequelize[_0x3df8('0x6')]}}; \ No newline at end of file +var _0xb7a6=['STRING','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x4e0cdf,_0x5865bc){var _0x1fea3b=function(_0x5b4814){while(--_0x5b4814){_0x4e0cdf['push'](_0x4e0cdf['shift']());}};_0x1fea3b(++_0x5865bc);}(_0xb7a6,0x189));var _0x6b7a=function(_0x1f0da7,_0x5cee4d){_0x1f0da7=_0x1f0da7-0x0;var _0x4ea985=_0xb7a6[_0x1f0da7];return _0x4ea985;};'use strict';var Sequelize=require('sequelize');module[_0x6b7a('0x0')]={'body':{'type':Sequelize[_0x6b7a('0x1')](_0x6b7a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6b7a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6b7a('0x4')]('in',_0x6b7a('0x5')),'defaultValue':_0x6b7a('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6b7a('0x6')](0xbe)},'phone':{'type':Sequelize[_0x6b7a('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x6b7a('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x6b7a('0x6')]},'providerResponse':{'type':Sequelize[_0x6b7a('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 58a55ce..3fe9ff5 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 _0x4142=['http','request','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','save','then','destroy','stack','name','send','index','WhatsappMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','keys','rawAttributes','includeAll','create','body','update','find','describe','whatsapp-interactions','accept','whatsapp','read','readAt','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','contact','agent','fullname','email','internal','manual','interface','format','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','event','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./whatsappMessage.socket','register','client'];(function(_0x55511c,_0x307bae){var _0x11881e=function(_0x980914){while(--_0x980914){_0x55511c['push'](_0x55511c['shift']());}};_0x11881e(++_0x307bae);}(_0x4142,0x182));var _0x2414=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4142[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2414('0x0'));var rp=require(_0x2414('0x1'));var moment=require(_0x2414('0x2'));var BPromise=require(_0x2414('0x3'));var Mustache=require(_0x2414('0x4'));var util=require(_0x2414('0x5'));var path=require(_0x2414('0x6'));var sox=require(_0x2414('0x7'));var csv=require(_0x2414('0x8'));var ejs=require(_0x2414('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2414('0xa'));var squel=require(_0x2414('0xb'));var crypto=require(_0x2414('0xc'));var jsforce=require(_0x2414('0xd'));var deskjs=require(_0x2414('0xe'));var toCsv=require(_0x2414('0x8'));var querystring=require('querystring');var Papa=require(_0x2414('0xf'));var Redis=require(_0x2414('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2414('0x11'));var as=require(_0x2414('0x12'));var hardwareService=require(_0x2414('0x13'));var logger=require(_0x2414('0x14'))(_0x2414('0x15'));var utils=require('../../config/utils');var config=require(_0x2414('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2414('0x17'))['db'];config['redis']=_[_0x2414('0x18')](config['redis'],{'host':_0x2414('0x19'),'port':0x18eb});var socket=require(_0x2414('0x1a'))(new Redis(config[_0x2414('0x1b')]));require(_0x2414('0x1c'))[_0x2414('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2414('0x1e')][_0x2414('0x1f')]({'port':0x232c});var client9002=jayson[_0x2414('0x1e')][_0x2414('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2f43f3,_0xfabf66,_0x1e17ea,_0x2496ef){return new BPromise(function(_0x4dd651,_0x35322b){var _0x31fa89=_0x2496ef||client;return _0x31fa89[_0x2414('0x20')](_0x2f43f3,_0x1e17ea)['then'](function(_0x4eb0d6){logger[_0x2414('0x21')](_0x2414('0x22'),_0xfabf66,'request\x20sent');logger[_0x2414('0x23')](_0x2414('0x24'),_0xfabf66,_0x2414('0x25'),JSON[_0x2414('0x26')](_0x4eb0d6));if(_0x4eb0d6[_0x2414('0x27')]){if(_0x4eb0d6[_0x2414('0x27')][_0x2414('0x28')]===0x1f4){logger[_0x2414('0x27')](_0x2414('0x22'),_0xfabf66,_0x4eb0d6['error'][_0x2414('0x29')]);return _0x35322b(_0x4eb0d6[_0x2414('0x27')][_0x2414('0x29')]);}logger[_0x2414('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0xfabf66,_0x4eb0d6[_0x2414('0x27')][_0x2414('0x29')]);return _0x4dd651(_0x4eb0d6[_0x2414('0x27')]['message']);}else{logger[_0x2414('0x21')](_0x2414('0x22'),_0xfabf66,_0x2414('0x25'));_0x4dd651(_0x4eb0d6[_0x2414('0x2a')]['message']);}})[_0x2414('0x2b')](function(_0x5545f7){logger[_0x2414('0x27')](_0x2414('0x22'),_0xfabf66,_0x5545f7);_0x35322b(_0x5545f7);});});}function respondWithStatusCode(_0x2f01b4,_0x1ec831){_0x1ec831=_0x1ec831||0xcc;return function(_0x2b7900){if(_0x2b7900){return _0x2f01b4[_0x2414('0x2c')](_0x1ec831);}return _0x2f01b4[_0x2414('0x2d')](_0x1ec831)[_0x2414('0x2e')]();};}function respondWithResult(_0x10062d,_0x507900){_0x507900=_0x507900||0xc8;return function(_0x1c313b){if(_0x1c313b){return _0x10062d[_0x2414('0x2d')](_0x507900)['json'](_0x1c313b);}};}function respondWithFilteredResult(_0x23a20c,_0x118f5b){return function(_0x39d5a5){if(_0x39d5a5){var _0x42f59d=typeof _0x118f5b[_0x2414('0x2f')]==='undefined'&&typeof _0x118f5b[_0x2414('0x30')]===_0x2414('0x31');var _0x3faec4=_0x39d5a5[_0x2414('0x32')];var _0x40f6e1=_0x42f59d?0x0:_0x118f5b[_0x2414('0x2f')];var _0x4bd5de=_0x42f59d?_0x39d5a5[_0x2414('0x32')]:_0x118f5b[_0x2414('0x2f')]+_0x118f5b[_0x2414('0x30')];var _0x197007;if(_0x4bd5de>=_0x3faec4){_0x4bd5de=_0x3faec4;_0x197007=0xc8;}else{_0x197007=0xce;}_0x23a20c[_0x2414('0x2d')](_0x197007);return _0x23a20c[_0x2414('0x33')](_0x2414('0x34'),_0x40f6e1+'-'+_0x4bd5de+'/'+_0x3faec4)['json'](_0x39d5a5);}return null;};}function patchUpdates(_0xfa8a85){return function(_0x3a371b){try{jsonpatch['apply'](_0x3a371b,_0xfa8a85,!![]);}catch(_0x491043){return BPromise['reject'](_0x491043);}return _0x3a371b[_0x2414('0x35')]();};}function saveUpdates(_0x56a33c,_0x1b1cd2){return function(_0x2c486d){if(_0x2c486d){return _0x2c486d['update'](_0x56a33c)[_0x2414('0x36')](function(_0xf4b9f3){return _0xf4b9f3;});}return null;};}function removeEntity(_0x5c2c3d,_0x54f9b3){return function(_0x57745f){if(_0x57745f){return _0x57745f[_0x2414('0x37')]()[_0x2414('0x36')](function(){_0x5c2c3d[_0x2414('0x2d')](0xcc)[_0x2414('0x2e')]();});}};}function handleEntityNotFound(_0xe29242,_0x1161d9){return function(_0x603fff){if(!_0x603fff){_0xe29242[_0x2414('0x2c')](0x194);}return _0x603fff;};}function handleError(_0x35593d,_0x16b955){_0x16b955=_0x16b955||0x1f4;return function(_0x2ccb23){logger[_0x2414('0x27')](_0x2ccb23[_0x2414('0x38')]);if(_0x2ccb23[_0x2414('0x39')]){delete _0x2ccb23['name'];}_0x35593d[_0x2414('0x2d')](_0x16b955)[_0x2414('0x3a')](_0x2ccb23);};}exports[_0x2414('0x3b')]=function(_0xef2108,_0x2adeba){var _0x3e69e1={},_0x122e72={},_0x14e874={'count':0x0,'rows':[]};var _0x30b238=_['map'](db[_0x2414('0x3c')]['rawAttributes'],function(_0x2b601d){return{'name':_0x2b601d[_0x2414('0x3d')],'type':_0x2b601d[_0x2414('0x3e')]['key']};});_0x122e72[_0x2414('0x3f')]=_[_0x2414('0x40')](_0x30b238,_0x2414('0x39'));_0x122e72[_0x2414('0x41')]=_['keys'](_0xef2108[_0x2414('0x41')]);_0x122e72[_0x2414('0x42')]=_[_0x2414('0x43')](_0x122e72['model'],_0x122e72[_0x2414('0x41')]);_0x3e69e1[_0x2414('0x44')]=_['intersection'](_0x122e72[_0x2414('0x3f')],qs[_0x2414('0x45')](_0xef2108['query'][_0x2414('0x45')]));_0x3e69e1[_0x2414('0x44')]=_0x3e69e1[_0x2414('0x44')][_0x2414('0x46')]?_0x3e69e1[_0x2414('0x44')]:_0x122e72[_0x2414('0x3f')];if(!_0xef2108[_0x2414('0x41')][_0x2414('0x47')]('nolimit')){_0x3e69e1['limit']=qs[_0x2414('0x30')](_0xef2108[_0x2414('0x41')][_0x2414('0x30')]);_0x3e69e1['offset']=qs[_0x2414('0x2f')](_0xef2108[_0x2414('0x41')][_0x2414('0x2f')]);}_0x3e69e1[_0x2414('0x48')]=qs[_0x2414('0x49')](_0xef2108[_0x2414('0x41')][_0x2414('0x49')]);_0x3e69e1[_0x2414('0x4a')]=qs[_0x2414('0x42')](_[_0x2414('0x4b')](_0xef2108[_0x2414('0x41')],_0x122e72[_0x2414('0x42')]),_0x30b238);if(_0xef2108[_0x2414('0x41')][_0x2414('0x4c')]){_0x3e69e1[_0x2414('0x4a')]=_[_0x2414('0x4d')](_0x3e69e1[_0x2414('0x4a')],{'$or':_[_0x2414('0x40')](_0x30b238,function(_0x5abf76){if(_0x5abf76[_0x2414('0x3e')]!==_0x2414('0x4e')){var _0x26d1db={};_0x26d1db[_0x5abf76[_0x2414('0x39')]]={'$like':'%'+_0xef2108[_0x2414('0x41')]['filter']+'%'};return _0x26d1db;}})});}_0x3e69e1=_[_0x2414('0x4d')]({},_0x3e69e1,_0xef2108[_0x2414('0x4f')]);var _0xd69cf5={'where':_0x3e69e1[_0x2414('0x4a')]};return db[_0x2414('0x3c')][_0x2414('0x32')](_0xd69cf5)[_0x2414('0x36')](function(_0x5881c0){_0x14e874['count']=_0x5881c0;if(_0xef2108[_0x2414('0x41')]['includeAll']){_0x3e69e1['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x2414('0x50')](_0x3e69e1);})[_0x2414('0x36')](function(_0x846a26){_0x14e874[_0x2414('0x51')]=_0x846a26;return _0x14e874;})[_0x2414('0x36')](respondWithFilteredResult(_0x2adeba,_0x3e69e1))[_0x2414('0x2b')](handleError(_0x2adeba,null));};exports[_0x2414('0x52')]=function(_0x40822c,_0x491999){var _0x1a15d6={'raw':!![],'where':{'id':_0x40822c[_0x2414('0x53')]['id']}},_0x1ba03f={};_0x1ba03f['model']=_[_0x2414('0x54')](db[_0x2414('0x3c')][_0x2414('0x55')]);_0x1ba03f[_0x2414('0x41')]=_[_0x2414('0x54')](_0x40822c[_0x2414('0x41')]);_0x1ba03f[_0x2414('0x42')]=_[_0x2414('0x43')](_0x1ba03f[_0x2414('0x3f')],_0x1ba03f[_0x2414('0x41')]);_0x1a15d6[_0x2414('0x44')]=_[_0x2414('0x43')](_0x1ba03f[_0x2414('0x3f')],qs[_0x2414('0x45')](_0x40822c['query']['fields']));_0x1a15d6['attributes']=_0x1a15d6[_0x2414('0x44')][_0x2414('0x46')]?_0x1a15d6[_0x2414('0x44')]:_0x1ba03f[_0x2414('0x3f')];if(_0x40822c['query'][_0x2414('0x56')]){_0x1a15d6['include']=[{'all':!![]}];}_0x1a15d6=_[_0x2414('0x4d')]({},_0x1a15d6,_0x40822c['options']);return db[_0x2414('0x3c')]['find'](_0x1a15d6)['then'](handleEntityNotFound(_0x491999,null))['then'](respondWithResult(_0x491999,null))[_0x2414('0x2b')](handleError(_0x491999,null));};exports[_0x2414('0x57')]=function(_0x146e06,_0x435770){return db['WhatsappMessage'][_0x2414('0x57')](_0x146e06[_0x2414('0x58')],{})[_0x2414('0x36')](respondWithResult(_0x435770,0xc9))[_0x2414('0x2b')](handleError(_0x435770,null));};exports[_0x2414('0x59')]=function(_0x242cb5,_0x550c8a){if(_0x242cb5[_0x2414('0x58')]['id']){delete _0x242cb5['body']['id'];}return db['WhatsappMessage'][_0x2414('0x5a')]({'where':{'id':_0x242cb5[_0x2414('0x53')]['id']}})[_0x2414('0x36')](handleEntityNotFound(_0x550c8a,null))['then'](saveUpdates(_0x242cb5['body'],null))['then'](respondWithResult(_0x550c8a,null))[_0x2414('0x2b')](handleError(_0x550c8a,null));};exports[_0x2414('0x37')]=function(_0x58cbf4,_0x1ad733){return db[_0x2414('0x3c')][_0x2414('0x5a')]({'where':{'id':_0x58cbf4[_0x2414('0x53')]['id']}})[_0x2414('0x36')](handleEntityNotFound(_0x1ad733,null))[_0x2414('0x36')](removeEntity(_0x1ad733,null))[_0x2414('0x2b')](handleError(_0x1ad733,null));};exports[_0x2414('0x5b')]=function(_0x4bdfa5,_0x5ee14e){return db[_0x2414('0x3c')][_0x2414('0x5b')]()[_0x2414('0x36')](respondWithResult(_0x5ee14e,null))[_0x2414('0x2b')](handleError(_0x5ee14e,null));};var interaction_log=require(_0x2414('0x14'))(_0x2414('0x5c'));exports[_0x2414('0x5d')]=function(_0x1b9faf,_0x2300a1,_0x209ad3){var _0x317483={'agent':{},'channel':_0x2414('0x5e')};if(_0x1b9faf[_0x2414('0x58')]['id']){delete _0x1b9faf['body']['id'];}_0x1b9faf[_0x2414('0x58')][_0x2414('0x5f')]=!![];_0x1b9faf[_0x2414('0x58')][_0x2414('0x60')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1b9faf[_0x2414('0x58')][_0x2414('0x61')]=_0x1b9faf['body']['UserId']||_0x1b9faf[_0x2414('0x62')]['id'];_0x317483['agent']['id']=_0x1b9faf[_0x2414('0x58')][_0x2414('0x61')];return db['WhatsappMessage'][_0x2414('0x5a')]({'where':{'id':_0x1b9faf['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2300a1,null))['then'](saveUpdates(_0x1b9faf['body'],null))['then'](function(_0x679182){if(_0x679182){_0x317483[_0x2414('0x29')]=_0x679182[_0x2414('0x63')]({'plain':!![]});return db[_0x2414('0x64')][_0x2414('0x5a')]({'where':{'id':_0x679182[_0x2414('0x65')]}});}return null;})[_0x2414('0x36')](handleEntityNotFound(_0x2300a1,null))['then'](function(_0x3f42ac){if(_0x3f42ac){return _0x3f42ac[_0x2414('0x59')]({'UserId':_0x1b9faf[_0x2414('0x58')]['UserId'],'read1stAt':_[_0x2414('0x66')](_0x3f42ac['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x2414('0x36')](function(_0xebde94){if(_0xebde94){_0x317483[_0x2414('0x67')]=_0xebde94[_0x2414('0x63')]({'plain':!![]});interaction_log[_0x2414('0x21')](_0x2414('0x68'),_0x1b9faf[_0x2414('0x62')]['id'],_0x1b9faf[_0x2414('0x62')][_0x2414('0x39')],_0x1b9faf[_0x2414('0x62')][_0x2414('0x69')],_0x317483[_0x2414('0x67')]['id'],_0x1b9faf[_0x2414('0x58')]?JSON[_0x2414('0x26')](_0x1b9faf[_0x2414('0x58')]):_0x2414('0x6a'));return respondWithRpcPromise(_0x2414('0x6b'),_0x2414('0x6c'),_0x317483);}return null;})['then'](function(_0x101f17){var _0x1647c7=_0x2414('0x6d')+_0x101f17[_0x2414('0x29')]['ContactId'];return db['sequelize'][_0x2414('0x41')](_0x1647c7,{'type':db[_0x2414('0x6e')][_0x2414('0x6f')]['SELECT'],'raw':!![]})[_0x2414('0x36')](function(_0x2cf792){return _0x2cf792;});})[_0x2414('0x36')](function(_0x2e7621){if(_0x2e7621){_0x317483[_0x2414('0x29')][_0x2414('0x70')]=_0x2e7621[0x0];if(!_0x1b9faf[_0x2414('0x58')][_0x2414('0x61')])return;return db['User'][_0x2414('0x5a')]({'where':{'id':_0x1b9faf[_0x2414('0x58')]['UserId'],'role':_0x2414('0x71')},'attributes':['id',_0x2414('0x39'),_0x2414('0x72'),_0x2414('0x73'),_0x2414('0x74')],'raw':!![]});}return null;})[_0x2414('0x36')](function(_0x17b8c6){if(!_0x17b8c6)return null;_0x317483[_0x2414('0x29')]['agent']=_0x17b8c6;return _0x317483;})[_0x2414('0x36')](function(_0x45afff){if(_0x45afff){if(_0x1b9faf[_0x2414('0x58')][_0x2414('0x75')]){_0x317483['message'][_0x2414('0x76')]=util[_0x2414('0x77')](_0x2414('0x78'),_0x1b9faf[_0x2414('0x62')]['name']);_0x317483[_0x2414('0x29')][_0x2414('0x79')]=_0x317483[_0x2414('0x79')];_0x317483[_0x2414('0x29')][_0x2414('0x7a')]=_0x317483['channel'];_0x317483['message']['event']='accept';return respondWithRpcPromise(_0x2414('0x7b'),'EventManager',{'event':_0x2414('0x7c'),'message':_0x317483[_0x2414('0x29')]},client9002)[_0x2414('0x36')](function(){return _0x317483;});}return _0x317483;}return null;})[_0x2414('0x36')](respondWithResult(_0x2300a1,null))['catch'](handleError(_0x2300a1,null));};var interaction_log=require(_0x2414('0x14'))(_0x2414('0x5c'));exports[_0x2414('0x7d')]=function(_0x5d0b72,_0x29c06a,_0x458e32){var _0x56c44c={'agent':{},'channel':_0x2414('0x5e')};if(_0x5d0b72[_0x2414('0x58')]['id']){delete _0x5d0b72[_0x2414('0x58')]['id'];}_0x5d0b72[_0x2414('0x58')][_0x2414('0x61')]=_0x5d0b72[_0x2414('0x58')][_0x2414('0x61')]||_0x5d0b72[_0x2414('0x62')]['id'];_0x56c44c['agent']['id']=_0x5d0b72[_0x2414('0x58')][_0x2414('0x61')];return db['WhatsappMessage'][_0x2414('0x5a')]({'where':{'id':_0x5d0b72['params']['id'],'UserId':null}})[_0x2414('0x36')](handleEntityNotFound(_0x29c06a,null))[_0x2414('0x36')](function(_0x3427e8){if(_0x3427e8){_0x56c44c['message']=_0x3427e8['get']({'plain':!![]});return db['WhatsappInteraction'][_0x2414('0x5a')]({'where':{'id':_0x3427e8['WhatsappInteractionId']}});}return null;})[_0x2414('0x36')](handleEntityNotFound(_0x29c06a,null))[_0x2414('0x36')](function(_0x545ee4){if(_0x545ee4){_0x56c44c[_0x2414('0x67')]=_0x545ee4[_0x2414('0x63')]({'plain':!![]});interaction_log['info'](_0x2414('0x7e'),_0x5d0b72['user']['id'],_0x5d0b72[_0x2414('0x62')][_0x2414('0x39')],_0x5d0b72[_0x2414('0x62')][_0x2414('0x69')],_0x56c44c['interaction']['id'],_0x5d0b72[_0x2414('0x58')]?JSON[_0x2414('0x26')](_0x5d0b72['body']):'null');return respondWithRpcPromise(_0x2414('0x7f'),'rejectMessage',_0x56c44c);}return null;})[_0x2414('0x36')](function(_0x5eb98a){var _0x3a5848=_0x2414('0x6d')+_0x5eb98a['message'][_0x2414('0x80')];return db['sequelize'][_0x2414('0x41')](_0x3a5848,{'type':db['Sequelize'][_0x2414('0x6f')]['SELECT'],'raw':!![]})[_0x2414('0x36')](function(_0x2b2469){return _0x2b2469;});})[_0x2414('0x36')](function(_0x276056){if(_0x276056){_0x56c44c[_0x2414('0x29')]['contact']=_0x276056[0x0];if(!_0x5d0b72[_0x2414('0x58')][_0x2414('0x61')])return;return db['User'][_0x2414('0x5a')]({'where':{'id':_0x5d0b72[_0x2414('0x58')][_0x2414('0x61')],'role':_0x2414('0x71')},'attributes':['id',_0x2414('0x39'),_0x2414('0x72'),_0x2414('0x73'),_0x2414('0x74')],'raw':!![]});}return null;})['then'](function(_0x34e25f){if(!_0x34e25f)return null;_0x56c44c[_0x2414('0x29')][_0x2414('0x71')]=_0x34e25f;return _0x56c44c;})[_0x2414('0x36')](function(_0xfcadaa){if(_0xfcadaa){_0xfcadaa[_0x2414('0x29')][_0x2414('0x76')]=util[_0x2414('0x77')]('SIP/%s',_0x5d0b72[_0x2414('0x62')][_0x2414('0x39')]);_0xfcadaa[_0x2414('0x29')][_0x2414('0x79')]=_0x56c44c['channel'];_0xfcadaa[_0x2414('0x29')]['motionChannel']=_0x56c44c[_0x2414('0x79')];_0xfcadaa[_0x2414('0x29')][_0x2414('0x81')]=_0x2414('0x7d');respondWithRpcPromise(_0x2414('0x7b'),_0x2414('0x7b'),{'event':'rejectmessage','message':_0xfcadaa[_0x2414('0x29')]},client9002);return _0x56c44c;}return null;})['then'](respondWithResult(_0x29c06a,null))['catch'](handleError(_0x29c06a,null));};exports[_0x2414('0x2d')]=function(_0x57e4b2,_0x3cf3ce,_0x1a15c7){if(_0x57e4b2[_0x2414('0x58')]['id']){delete _0x57e4b2['body']['id'];}var _0x3053a7;return db['WhatsappMessage'][_0x2414('0x5a')]({'where':{'id':_0x57e4b2[_0x2414('0x53')]['id']}})[_0x2414('0x36')](handleEntityNotFound(_0x3cf3ce,null))['then'](function(_0x3b8ce5){if(_0x3b8ce5){_0x3053a7=_0x3b8ce5;return db[_0x2414('0x82')][_0x2414('0x5a')]({'where':{'id':_0x3b8ce5[_0x2414('0x83')]}});}})[_0x2414('0x36')](handleEntityNotFound(_0x3cf3ce,null))[_0x2414('0x36')](function(_0x3589cc){if(_0x3589cc){logger[_0x2414('0x23')](_0x2414('0x84'),_0x2414('0x2d'),'received\x20delivery\x20report\x20from',_0x3589cc[_0x2414('0x3e')],util[_0x2414('0x85')](_0x57e4b2[_0x2414('0x58')],{'showHidden':![],'depth':null}));switch(_0x3589cc[_0x2414('0x3e')]){case _0x2414('0x86'):if(_0x57e4b2['body'][_0x2414('0x87')]&&_0x57e4b2['body']['MessageSid']===_0x3053a7[_0x2414('0x88')]&&_0x57e4b2[_0x2414('0x58')][_0x2414('0x89')]&&_0x57e4b2[_0x2414('0x58')]['MessageStatus']===_0x2414('0x5f')){return _0x3053a7['update']({'read':!![]});}else{logger['error'](_0x2414('0x8a'),_0x2414('0x2d'),'twilio',util[_0x2414('0x85')](_0x57e4b2[_0x2414('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x3053a7;}})[_0x2414('0x36')](respondWithResult(_0x3cf3ce,null))['catch'](handleError(_0x3cf3ce,null));}; \ No newline at end of file +var _0x11c2=['show','params','length','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','read1stAt','format','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','ContactId','sequelize','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','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','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','client','request','WhatsappMessage,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x11c2,0x156));var _0x211c=function(_0x51dfd0,_0xf0e072){_0x51dfd0=_0x51dfd0-0x0;var _0x2468c0=_0x11c2[_0x51dfd0];return _0x2468c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x211c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x211c('0x1'));var rp=require('request-promise');var moment=require(_0x211c('0x2'));var BPromise=require(_0x211c('0x3'));var Mustache=require(_0x211c('0x4'));var util=require(_0x211c('0x5'));var path=require(_0x211c('0x6'));var sox=require(_0x211c('0x7'));var csv=require('to-csv');var ejs=require(_0x211c('0x8'));var fs=require('fs');var fs_extra=require(_0x211c('0x9'));var _=require(_0x211c('0xa'));var squel=require('squel');var crypto=require(_0x211c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x211c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x211c('0xd'));var Papa=require(_0x211c('0xe'));var Redis=require(_0x211c('0xf'));var authService=require(_0x211c('0x10'));var qs=require(_0x211c('0x11'));var as=require(_0x211c('0x12'));var hardwareService=require(_0x211c('0x13'));var logger=require(_0x211c('0x14'))(_0x211c('0x15'));var utils=require(_0x211c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x211c('0x17'));var db=require('../../mysqldb')['db'];config[_0x211c('0x18')]=_[_0x211c('0x19')](config[_0x211c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x211c('0x1a'))(new Redis(config[_0x211c('0x18')]));require(_0x211c('0x1b'))[_0x211c('0x1c')](socket);var jayson=require(_0x211c('0x1d'));var client=jayson['client'][_0x211c('0x1e')]({'port':0x232c});var client9002=jayson[_0x211c('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54c391,_0x408c1d,_0x5c9ce7,_0x558e1e){return new BPromise(function(_0x33d8ce,_0x5e2c05){var _0xa4845=_0x558e1e||client;return _0xa4845[_0x211c('0x20')](_0x54c391,_0x5c9ce7)['then'](function(_0x3c3e21){logger['info'](_0x211c('0x21'),_0x408c1d,'request\x20sent');logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x408c1d,_0x211c('0x22'),JSON['stringify'](_0x3c3e21));if(_0x3c3e21[_0x211c('0x23')]){if(_0x3c3e21[_0x211c('0x23')][_0x211c('0x24')]===0x1f4){logger['error'](_0x211c('0x21'),_0x408c1d,_0x3c3e21[_0x211c('0x23')]['message']);return _0x5e2c05(_0x3c3e21[_0x211c('0x23')][_0x211c('0x25')]);}logger['error'](_0x211c('0x21'),_0x408c1d,_0x3c3e21[_0x211c('0x23')]['message']);return _0x33d8ce(_0x3c3e21[_0x211c('0x23')][_0x211c('0x25')]);}else{logger[_0x211c('0x26')](_0x211c('0x21'),_0x408c1d,_0x211c('0x22'));_0x33d8ce(_0x3c3e21[_0x211c('0x27')][_0x211c('0x25')]);}})['catch'](function(_0x44c568){logger[_0x211c('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x408c1d,_0x44c568);_0x5e2c05(_0x44c568);});});}function respondWithStatusCode(_0x4adda6,_0x2be6c5){_0x2be6c5=_0x2be6c5||0xcc;return function(_0x411fd5){if(_0x411fd5){return _0x4adda6[_0x211c('0x28')](_0x2be6c5);}return _0x4adda6[_0x211c('0x29')](_0x2be6c5)[_0x211c('0x2a')]();};}function respondWithResult(_0x2cf7fa,_0x191e13){_0x191e13=_0x191e13||0xc8;return function(_0x5dcd88){if(_0x5dcd88){return _0x2cf7fa[_0x211c('0x29')](_0x191e13)[_0x211c('0x2b')](_0x5dcd88);}};}function respondWithFilteredResult(_0x3d1c82,_0x2c68da){return function(_0x293c22){if(_0x293c22){var _0x55fd4d=typeof _0x2c68da[_0x211c('0x2c')]===_0x211c('0x2d')&&typeof _0x2c68da[_0x211c('0x2e')]===_0x211c('0x2d');var _0x1eb20b=_0x293c22['count'];var _0x5715ea=_0x55fd4d?0x0:_0x2c68da[_0x211c('0x2c')];var _0x586ec7=_0x55fd4d?_0x293c22[_0x211c('0x2f')]:_0x2c68da['offset']+_0x2c68da[_0x211c('0x2e')];var _0x4a38f7;if(_0x586ec7>=_0x1eb20b){_0x586ec7=_0x1eb20b;_0x4a38f7=0xc8;}else{_0x4a38f7=0xce;}_0x3d1c82[_0x211c('0x29')](_0x4a38f7);return _0x3d1c82[_0x211c('0x30')](_0x211c('0x31'),_0x5715ea+'-'+_0x586ec7+'/'+_0x1eb20b)[_0x211c('0x2b')](_0x293c22);}return null;};}function patchUpdates(_0x30fe27){return function(_0xfad158){try{jsonpatch[_0x211c('0x32')](_0xfad158,_0x30fe27,!![]);}catch(_0x20cdfb){return BPromise[_0x211c('0x33')](_0x20cdfb);}return _0xfad158['save']();};}function saveUpdates(_0x38ad3d,_0x3e054d){return function(_0x3a5f56){if(_0x3a5f56){return _0x3a5f56[_0x211c('0x34')](_0x38ad3d)[_0x211c('0x35')](function(_0x2daf40){return _0x2daf40;});}return null;};}function removeEntity(_0x29f528,_0x21f21f){return function(_0x3e6b53){if(_0x3e6b53){return _0x3e6b53['destroy']()[_0x211c('0x35')](function(){_0x29f528['status'](0xcc)[_0x211c('0x2a')]();});}};}function handleEntityNotFound(_0x5da086,_0x3863f9){return function(_0x6b944b){if(!_0x6b944b){_0x5da086[_0x211c('0x28')](0x194);}return _0x6b944b;};}function handleError(_0x1c8e11,_0x438c5d){_0x438c5d=_0x438c5d||0x1f4;return function(_0x2ad6b5){logger[_0x211c('0x23')](_0x2ad6b5[_0x211c('0x36')]);if(_0x2ad6b5[_0x211c('0x37')]){delete _0x2ad6b5[_0x211c('0x37')];}_0x1c8e11['status'](_0x438c5d)[_0x211c('0x38')](_0x2ad6b5);};}exports[_0x211c('0x39')]=function(_0x1b3e52,_0x3d27c1){var _0x498836={},_0x4d36a6={},_0x39a646={'count':0x0,'rows':[]};var _0x4c1f1d=_[_0x211c('0x3a')](db[_0x211c('0x3b')][_0x211c('0x3c')],function(_0x194233){return{'name':_0x194233['fieldName'],'type':_0x194233[_0x211c('0x3d')][_0x211c('0x3e')]};});_0x4d36a6['model']=_[_0x211c('0x3a')](_0x4c1f1d,_0x211c('0x37'));_0x4d36a6[_0x211c('0x3f')]=_[_0x211c('0x40')](_0x1b3e52[_0x211c('0x3f')]);_0x4d36a6[_0x211c('0x41')]=_[_0x211c('0x42')](_0x4d36a6[_0x211c('0x43')],_0x4d36a6['query']);_0x498836[_0x211c('0x44')]=_[_0x211c('0x42')](_0x4d36a6[_0x211c('0x43')],qs[_0x211c('0x45')](_0x1b3e52['query'][_0x211c('0x45')]));_0x498836[_0x211c('0x44')]=_0x498836[_0x211c('0x44')]['length']?_0x498836[_0x211c('0x44')]:_0x4d36a6['model'];if(!_0x1b3e52[_0x211c('0x3f')][_0x211c('0x46')](_0x211c('0x47'))){_0x498836[_0x211c('0x2e')]=qs[_0x211c('0x2e')](_0x1b3e52[_0x211c('0x3f')]['limit']);_0x498836['offset']=qs[_0x211c('0x2c')](_0x1b3e52['query'][_0x211c('0x2c')]);}_0x498836[_0x211c('0x48')]=qs['sort'](_0x1b3e52[_0x211c('0x3f')]['sort']);_0x498836['where']=qs[_0x211c('0x41')](_[_0x211c('0x49')](_0x1b3e52[_0x211c('0x3f')],_0x4d36a6[_0x211c('0x41')]),_0x4c1f1d);if(_0x1b3e52[_0x211c('0x3f')][_0x211c('0x4a')]){_0x498836[_0x211c('0x4b')]=_[_0x211c('0x4c')](_0x498836[_0x211c('0x4b')],{'$or':_[_0x211c('0x3a')](_0x4c1f1d,function(_0xde466d){if(_0xde466d['type']!==_0x211c('0x4d')){var _0x17f935={};_0x17f935[_0xde466d[_0x211c('0x37')]]={'$like':'%'+_0x1b3e52[_0x211c('0x3f')][_0x211c('0x4a')]+'%'};return _0x17f935;}})});}_0x498836=_[_0x211c('0x4c')]({},_0x498836,_0x1b3e52[_0x211c('0x4e')]);var _0xe696b5={'where':_0x498836[_0x211c('0x4b')]};return db[_0x211c('0x3b')][_0x211c('0x2f')](_0xe696b5)[_0x211c('0x35')](function(_0x468408){_0x39a646[_0x211c('0x2f')]=_0x468408;if(_0x1b3e52[_0x211c('0x3f')][_0x211c('0x4f')]){_0x498836[_0x211c('0x50')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x211c('0x51')](_0x498836);})[_0x211c('0x35')](function(_0x3f863d){_0x39a646[_0x211c('0x52')]=_0x3f863d;return _0x39a646;})['then'](respondWithFilteredResult(_0x3d27c1,_0x498836))[_0x211c('0x53')](handleError(_0x3d27c1,null));};exports[_0x211c('0x54')]=function(_0x131e0a,_0x3f4b68){var _0x5404a8={'raw':!![],'where':{'id':_0x131e0a[_0x211c('0x55')]['id']}},_0x34b4e1={};_0x34b4e1[_0x211c('0x43')]=_[_0x211c('0x40')](db[_0x211c('0x3b')]['rawAttributes']);_0x34b4e1[_0x211c('0x3f')]=_['keys'](_0x131e0a[_0x211c('0x3f')]);_0x34b4e1[_0x211c('0x41')]=_[_0x211c('0x42')](_0x34b4e1[_0x211c('0x43')],_0x34b4e1[_0x211c('0x3f')]);_0x5404a8[_0x211c('0x44')]=_[_0x211c('0x42')](_0x34b4e1[_0x211c('0x43')],qs[_0x211c('0x45')](_0x131e0a[_0x211c('0x3f')][_0x211c('0x45')]));_0x5404a8['attributes']=_0x5404a8[_0x211c('0x44')][_0x211c('0x56')]?_0x5404a8['attributes']:_0x34b4e1[_0x211c('0x43')];if(_0x131e0a['query'][_0x211c('0x4f')]){_0x5404a8[_0x211c('0x50')]=[{'all':!![]}];}_0x5404a8=_[_0x211c('0x4c')]({},_0x5404a8,_0x131e0a['options']);return db[_0x211c('0x3b')][_0x211c('0x57')](_0x5404a8)[_0x211c('0x35')](handleEntityNotFound(_0x3f4b68,null))['then'](respondWithResult(_0x3f4b68,null))['catch'](handleError(_0x3f4b68,null));};exports['create']=function(_0x194fcd,_0x17f3f5){return db[_0x211c('0x3b')][_0x211c('0x58')](_0x194fcd['body'],{})[_0x211c('0x35')](respondWithResult(_0x17f3f5,0xc9))[_0x211c('0x53')](handleError(_0x17f3f5,null));};exports[_0x211c('0x34')]=function(_0x5ba921,_0x39cac7){if(_0x5ba921[_0x211c('0x59')]['id']){delete _0x5ba921['body']['id'];}return db[_0x211c('0x3b')]['find']({'where':{'id':_0x5ba921[_0x211c('0x55')]['id']}})[_0x211c('0x35')](handleEntityNotFound(_0x39cac7,null))[_0x211c('0x35')](saveUpdates(_0x5ba921['body'],null))['then'](respondWithResult(_0x39cac7,null))[_0x211c('0x53')](handleError(_0x39cac7,null));};exports['destroy']=function(_0x47ee93,_0x56e180){return db[_0x211c('0x3b')][_0x211c('0x57')]({'where':{'id':_0x47ee93[_0x211c('0x55')]['id']}})[_0x211c('0x35')](handleEntityNotFound(_0x56e180,null))['then'](removeEntity(_0x56e180,null))[_0x211c('0x53')](handleError(_0x56e180,null));};exports[_0x211c('0x5a')]=function(_0x1c0fb0,_0x3acde8){return db[_0x211c('0x3b')][_0x211c('0x5a')]()[_0x211c('0x35')](respondWithResult(_0x3acde8,null))['catch'](handleError(_0x3acde8,null));};var interaction_log=require(_0x211c('0x14'))(_0x211c('0x5b'));exports[_0x211c('0x5c')]=function(_0x381f25,_0x4da6fd,_0x4d0d9e){var _0x42fec4={'agent':{},'channel':_0x211c('0x5d')};if(_0x381f25[_0x211c('0x59')]['id']){delete _0x381f25[_0x211c('0x59')]['id'];}_0x381f25[_0x211c('0x59')][_0x211c('0x5e')]=!![];_0x381f25[_0x211c('0x59')]['readAt']=moment()['format'](_0x211c('0x5f'));_0x381f25['body'][_0x211c('0x60')]=_0x381f25[_0x211c('0x59')][_0x211c('0x60')]||_0x381f25[_0x211c('0x61')]['id'];_0x42fec4[_0x211c('0x62')]['id']=_0x381f25[_0x211c('0x59')][_0x211c('0x60')];return db[_0x211c('0x3b')]['find']({'where':{'id':_0x381f25[_0x211c('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4da6fd,null))[_0x211c('0x35')](saveUpdates(_0x381f25[_0x211c('0x59')],null))[_0x211c('0x35')](function(_0x52289f){if(_0x52289f){_0x42fec4[_0x211c('0x25')]=_0x52289f['get']({'plain':!![]});return db[_0x211c('0x63')][_0x211c('0x57')]({'where':{'id':_0x52289f[_0x211c('0x64')]}});}return null;})[_0x211c('0x35')](handleEntityNotFound(_0x4da6fd,null))[_0x211c('0x35')](function(_0x285643){if(_0x285643){return _0x285643['update']({'UserId':_0x381f25[_0x211c('0x59')][_0x211c('0x60')],'read1stAt':_['isNil'](_0x285643[_0x211c('0x65')])?moment()[_0x211c('0x66')](_0x211c('0x5f')):undefined});}return null;})[_0x211c('0x35')](function(_0x52af4b){if(_0x52af4b){_0x42fec4[_0x211c('0x67')]=_0x52af4b[_0x211c('0x68')]({'plain':!![]});interaction_log[_0x211c('0x26')](_0x211c('0x69'),_0x381f25[_0x211c('0x61')]['id'],_0x381f25[_0x211c('0x61')][_0x211c('0x37')],_0x381f25[_0x211c('0x61')]['role'],_0x42fec4['interaction']['id'],_0x381f25[_0x211c('0x59')]?JSON[_0x211c('0x6a')](_0x381f25[_0x211c('0x59')]):'null');return respondWithRpcPromise(_0x211c('0x6b'),_0x211c('0x6c'),_0x42fec4);}return null;})[_0x211c('0x35')](function(_0x446e28){var _0x211e11=_0x211c('0x6d')+_0x446e28[_0x211c('0x25')]['ContactId'];return db['sequelize'][_0x211c('0x3f')](_0x211e11,{'type':db[_0x211c('0x6e')][_0x211c('0x6f')][_0x211c('0x70')],'raw':!![]})[_0x211c('0x35')](function(_0x58839f){return _0x58839f;});})[_0x211c('0x35')](function(_0x3c9384){if(_0x3c9384){_0x42fec4['message'][_0x211c('0x71')]=_0x3c9384[0x0];if(!_0x381f25[_0x211c('0x59')][_0x211c('0x60')])return;return db[_0x211c('0x72')][_0x211c('0x57')]({'where':{'id':_0x381f25['body'][_0x211c('0x60')],'role':_0x211c('0x62')},'attributes':['id',_0x211c('0x37'),_0x211c('0x73'),_0x211c('0x74'),_0x211c('0x75')],'raw':!![]});}return null;})[_0x211c('0x35')](function(_0x4945e5){if(!_0x4945e5)return null;_0x42fec4[_0x211c('0x25')][_0x211c('0x62')]=_0x4945e5;return _0x42fec4;})['then'](function(_0x116092){if(_0x116092){if(_0x381f25[_0x211c('0x59')]['manual']){_0x42fec4[_0x211c('0x25')][_0x211c('0x76')]=util[_0x211c('0x66')](_0x211c('0x77'),_0x381f25[_0x211c('0x61')][_0x211c('0x37')]);_0x42fec4['message'][_0x211c('0x78')]=_0x42fec4[_0x211c('0x78')];_0x42fec4[_0x211c('0x25')][_0x211c('0x79')]=_0x42fec4['channel'];_0x42fec4[_0x211c('0x25')][_0x211c('0x7a')]='accept';return respondWithRpcPromise(_0x211c('0x7b'),_0x211c('0x7b'),{'event':_0x211c('0x7c'),'message':_0x42fec4[_0x211c('0x25')]},client9002)[_0x211c('0x35')](function(){return _0x42fec4;});}return _0x42fec4;}return null;})[_0x211c('0x35')](respondWithResult(_0x4da6fd,null))['catch'](handleError(_0x4da6fd,null));};var interaction_log=require(_0x211c('0x14'))(_0x211c('0x5b'));exports[_0x211c('0x33')]=function(_0x41f6a7,_0x2ca62b,_0x5be91b){var _0xe2b8ec={'agent':{},'channel':_0x211c('0x5d')};if(_0x41f6a7[_0x211c('0x59')]['id']){delete _0x41f6a7[_0x211c('0x59')]['id'];}_0x41f6a7[_0x211c('0x59')][_0x211c('0x60')]=_0x41f6a7[_0x211c('0x59')][_0x211c('0x60')]||_0x41f6a7[_0x211c('0x61')]['id'];_0xe2b8ec[_0x211c('0x62')]['id']=_0x41f6a7[_0x211c('0x59')][_0x211c('0x60')];return db[_0x211c('0x3b')][_0x211c('0x57')]({'where':{'id':_0x41f6a7[_0x211c('0x55')]['id'],'UserId':null}})[_0x211c('0x35')](handleEntityNotFound(_0x2ca62b,null))['then'](function(_0x2ef7c0){if(_0x2ef7c0){_0xe2b8ec[_0x211c('0x25')]=_0x2ef7c0[_0x211c('0x68')]({'plain':!![]});return db[_0x211c('0x63')][_0x211c('0x57')]({'where':{'id':_0x2ef7c0[_0x211c('0x64')]}});}return null;})[_0x211c('0x35')](handleEntityNotFound(_0x2ca62b,null))[_0x211c('0x35')](function(_0x277cb3){if(_0x277cb3){_0xe2b8ec['interaction']=_0x277cb3['get']({'plain':!![]});interaction_log['info'](_0x211c('0x7d'),_0x41f6a7[_0x211c('0x61')]['id'],_0x41f6a7['user'][_0x211c('0x37')],_0x41f6a7[_0x211c('0x61')][_0x211c('0x7e')],_0xe2b8ec[_0x211c('0x67')]['id'],_0x41f6a7[_0x211c('0x59')]?JSON[_0x211c('0x6a')](_0x41f6a7[_0x211c('0x59')]):_0x211c('0x7f'));return respondWithRpcPromise(_0x211c('0x80'),_0x211c('0x81'),_0xe2b8ec);}return null;})[_0x211c('0x35')](function(_0xd11460){var _0x1aaf01=_0x211c('0x6d')+_0xd11460[_0x211c('0x25')][_0x211c('0x82')];return db[_0x211c('0x83')][_0x211c('0x3f')](_0x1aaf01,{'type':db[_0x211c('0x6e')][_0x211c('0x6f')]['SELECT'],'raw':!![]})[_0x211c('0x35')](function(_0x41c660){return _0x41c660;});})['then'](function(_0x2d7dfd){if(_0x2d7dfd){_0xe2b8ec['message'][_0x211c('0x71')]=_0x2d7dfd[0x0];if(!_0x41f6a7['body'][_0x211c('0x60')])return;return db[_0x211c('0x72')][_0x211c('0x57')]({'where':{'id':_0x41f6a7[_0x211c('0x59')][_0x211c('0x60')],'role':_0x211c('0x62')},'attributes':['id',_0x211c('0x37'),_0x211c('0x73'),_0x211c('0x74'),_0x211c('0x75')],'raw':!![]});}return null;})[_0x211c('0x35')](function(_0x2ea3b0){if(!_0x2ea3b0)return null;_0xe2b8ec[_0x211c('0x25')][_0x211c('0x62')]=_0x2ea3b0;return _0xe2b8ec;})[_0x211c('0x35')](function(_0x15ddc3){if(_0x15ddc3){_0x15ddc3[_0x211c('0x25')][_0x211c('0x76')]=util[_0x211c('0x66')](_0x211c('0x77'),_0x41f6a7['user'][_0x211c('0x37')]);_0x15ddc3[_0x211c('0x25')]['channel']=_0xe2b8ec[_0x211c('0x78')];_0x15ddc3[_0x211c('0x25')][_0x211c('0x79')]=_0xe2b8ec[_0x211c('0x78')];_0x15ddc3['message'][_0x211c('0x7a')]=_0x211c('0x33');respondWithRpcPromise(_0x211c('0x7b'),'EventManager',{'event':_0x211c('0x84'),'message':_0x15ddc3[_0x211c('0x25')]},client9002);return _0xe2b8ec;}return null;})[_0x211c('0x35')](respondWithResult(_0x2ca62b,null))[_0x211c('0x53')](handleError(_0x2ca62b,null));};exports[_0x211c('0x29')]=function(_0x407ba4,_0x45a993,_0x39481b){if(_0x407ba4['body']['id']){delete _0x407ba4[_0x211c('0x59')]['id'];}var _0x5118b3;return db[_0x211c('0x3b')][_0x211c('0x57')]({'where':{'id':_0x407ba4['params']['id']}})[_0x211c('0x35')](handleEntityNotFound(_0x45a993,null))[_0x211c('0x35')](function(_0x1753d5){if(_0x1753d5){_0x5118b3=_0x1753d5;return db[_0x211c('0x85')][_0x211c('0x57')]({'where':{'id':_0x1753d5[_0x211c('0x86')]}});}})[_0x211c('0x35')](handleEntityNotFound(_0x45a993,null))['then'](function(_0x2691f5){if(_0x2691f5){logger[_0x211c('0x87')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x211c('0x29'),_0x211c('0x88'),_0x2691f5['type'],util['inspect'](_0x407ba4[_0x211c('0x59')],{'showHidden':![],'depth':null}));switch(_0x2691f5[_0x211c('0x3d')]){case _0x211c('0x89'):if(_0x407ba4[_0x211c('0x59')][_0x211c('0x8a')]&&_0x407ba4[_0x211c('0x59')][_0x211c('0x8a')]===_0x5118b3[_0x211c('0x8b')]&&_0x407ba4[_0x211c('0x59')]['MessageStatus']&&_0x407ba4[_0x211c('0x59')]['MessageStatus']===_0x211c('0x5e')){return _0x5118b3[_0x211c('0x34')]({'read':!![]});}else{logger[_0x211c('0x23')](_0x211c('0x8c'),_0x211c('0x29'),'twilio',util[_0x211c('0x8d')](_0x407ba4['body'],{'showHidden':![],'depth':null}));}break;}return _0x5118b3;}})['then'](respondWithResult(_0x45a993,null))['catch'](handleError(_0x45a993,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 10f497d..b4f64d2 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 _0x2547=['hasOwnProperty','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit'];(function(_0x58dc03,_0x1c0b28){var _0x2f14bb=function(_0x29e209){while(--_0x29e209){_0x58dc03['push'](_0x58dc03['shift']());}};_0x2f14bb(++_0x1c0b28);}(_0x2547,0x1cd));var _0x7254=function(_0x2ec55e,_0x1d2ad3){_0x2ec55e=_0x2ec55e-0x0;var _0x3bc3ea=_0x2547[_0x2ec55e];return _0x3bc3ea;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x7254('0x0'))['db'][_0x7254('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x7254('0x2')](0x0);var events={'afterCreate':_0x7254('0x3'),'afterUpdate':_0x7254('0x4'),'afterDestroy':_0x7254('0x5')};function emitEvent(_0x9f3435){return function(_0x265ebf,_0x53a02f,_0x2ddeae){WhatsappMessageEvents[_0x7254('0x6')](_0x9f3435+':'+_0x265ebf['id'],_0x265ebf);WhatsappMessageEvents[_0x7254('0x6')](_0x9f3435,_0x265ebf);_0x2ddeae(null);};}for(var e in events){if(events[_0x7254('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x7254('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0x1752=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x18889d,_0x3e8f9e){var _0x158a70=function(_0x5bc10e){while(--_0x5bc10e){_0x18889d['push'](_0x18889d['shift']());}};_0x158a70(++_0x3e8f9e);}(_0x1752,0xa5));var _0x2175=function(_0x24736c,_0x3d1e1b){_0x24736c=_0x24736c-0x0;var _0x34008e=_0x1752[_0x24736c];return _0x34008e;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x2175('0x0'))['db'][_0x2175('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2175('0x2')](0x0);var events={'afterCreate':_0x2175('0x3'),'afterUpdate':_0x2175('0x4'),'afterDestroy':_0x2175('0x5')};function emitEvent(_0x56c315){return function(_0x1ee277,_0x22c167,_0x12b8d9){WhatsappMessageEvents[_0x2175('0x6')](_0x56c315+':'+_0x1ee277['id'],_0x1ee277);WhatsappMessageEvents[_0x2175('0x6')](_0x56c315,_0x1ee277);_0x12b8d9(null);};}for(var e in events){if(events[_0x2175('0x7')](e)){var event=events[e];WhatsappMessage[_0x2175('0x8')](e,emitEvent(event));}}module[_0x2175('0x9')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index ceb536c..7941099 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 _0xe273=['direction','toLowerCase','out','secret','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','WhatsappAccount','find','type','twilio','accountSid','authToken','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','error','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','sinch','baseUrl','/whatsapp/v1/','POST','Bearer\x20','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','utf8mb4_unicode_ci','../../config/logger','moment','request-promise','node-fetch','path','rimraf','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','body','FULLTEXT','models','get'];(function(_0x5a481d,_0x572672){var _0x2d2914=function(_0xf058a9){while(--_0xf058a9){_0x5a481d['push'](_0x5a481d['shift']());}};_0x2d2914(++_0x572672);}(_0xe273,0x1a9));var _0x3e27=function(_0x9c3c56,_0x169b56){_0x9c3c56=_0x9c3c56-0x0;var _0x2dd782=_0xe273[_0x9c3c56];return _0x2dd782;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3e27('0x0'))('api');var moment=require(_0x3e27('0x1'));var BPromise=require('bluebird');var rp=require(_0x3e27('0x2'));var fetch=require(_0x3e27('0x3'));var fs=require('fs');var path=require(_0x3e27('0x4'));var rimraf=require(_0x3e27('0x5'));var config=require('../../config/environment');var attributes=require(_0x3e27('0x6'));module[_0x3e27('0x7')]=function(_0x5b13f0,_0x26af3b){return _0x5b13f0[_0x3e27('0x8')]('WhatsappMessage',attributes,{'tableName':_0x3e27('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x3e27('0xa')]},{'name':'fti_whatsapp_messages','fields':[_0x3e27('0xb')],'type':_0x3e27('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x19aa7d,_0x2630f7,_0x49ac5e){var _0x4946f1=_0x5b13f0[_0x3e27('0xd')];var _0x2acb6d=_0x19aa7d[_0x3e27('0xe')]({'plain':!![]});if(_0x2acb6d[_0x3e27('0xf')][_0x3e27('0x10')]()==='in'||_0x2acb6d[_0x3e27('0xf')][_0x3e27('0x10')]()===_0x3e27('0x11')&&!_0x2acb6d[_0x3e27('0x12')]&&!_[_0x3e27('0x13')](_0x2acb6d['UserId'])){_0x4946f1[_0x3e27('0x14')][_0x3e27('0x15')]({'where':{'id':_0x2acb6d[_0x3e27('0x16')]}})[_0x3e27('0x17')](function(_0x336af6){if(_0x336af6){_0x336af6[_0x3e27('0x18')]({'lastMsgAt':_0x2acb6d['createdAt'],'lastMsgDirection':_0x2acb6d[_0x3e27('0xf')][_0x3e27('0x10')]()});}})['catch'](function(_0x489d4c){console['error'](_0x489d4c);});}if(_0x2acb6d['direction']==='out'&&!_0x2acb6d[_0x3e27('0x12')]){var _0x362c71;_0x4946f1[_0x3e27('0x19')][_0x3e27('0x1a')]({'where':{'id':_0x2acb6d['WhatsappAccountId']},'raw':!![]})[_0x3e27('0x17')](function(_0x4e8f78){_0x362c71=_0x4e8f78;if(_0x362c71&&_0x362c71[_0x3e27('0x1b')]){switch(_0x362c71[_0x3e27('0x1b')]){case _0x3e27('0x1c'):var _0x2ceab0=require(_0x3e27('0x1c'));if(_0x362c71[_0x3e27('0x1d')]&&_0x362c71[_0x3e27('0x1e')]&&_0x362c71['phone']){var _0x2b871a=new _0x2ceab0(_0x362c71['accountSid'],_0x362c71[_0x3e27('0x1e')]);_0x2b871a['messages'][_0x3e27('0x1f')]({'body':_0x2acb6d[_0x3e27('0xb')],'to':_0x3e27('0x20')+_0x2acb6d[_0x3e27('0x21')],'from':_0x3e27('0x20')+_0x362c71[_0x3e27('0x21')],'statusCallback':_0x362c71[_0x3e27('0x22')]+_0x3e27('0x23')+_0x2acb6d['id']+_0x3e27('0x24')+_0x362c71[_0x3e27('0x25')]})[_0x3e27('0x17')](function(_0x45b75c){if(_0x45b75c[_0x3e27('0x26')]){return _0x19aa7d[_0x3e27('0x18')]({'messageId':_0x45b75c['sid']});}})[_0x3e27('0x27')](function(_0x1fcebc){logger[_0x3e27('0x28')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3e27('0x29'),_0x3e27('0x1c'),util[_0x3e27('0x2a')](_0x1fcebc,{'showHidden':![],'depth':null}));});}else{logger[_0x3e27('0x28')](_0x3e27('0x2b'),'afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x3e27('0x2c'):var _0x478c41=_0x362c71[_0x3e27('0x1d')];var _0xcf1498=_0x362c71[_0x3e27('0x1e')];var _0x3fb542=_0x362c71[_0x3e27('0x2d')]+_0x3e27('0x2e')+_0x478c41+'/messages/';var _0x409d87={'to':[_0x2acb6d['phone']],'message':{'type':'text','text':_0x2acb6d[_0x3e27('0xb')]}};var _0x4d81db={'method':_0x3e27('0x2f'),'uri':_0x3fb542,'headers':{'Authorization':_0x3e27('0x30')+_0xcf1498,'Content-Type':_0x3e27('0x31')},'body':_0x409d87,'json':!![]};rp(_0x4d81db)[_0x3e27('0x17')](function(_0x29b6e0){if(_0x29b6e0['statuses'][0x0][_0x3e27('0x32')]){return _0x19aa7d[_0x3e27('0x18')]({'messageId':_0x29b6e0[_0x3e27('0x33')][0x0]['message_id']});}})[_0x3e27('0x27')](function(_0x184afa){logger[_0x3e27('0x34')](_0x3e27('0x35'),_0x184afa);});break;}}})['finally'](function(){_0x49ac5e();});}else{_0x49ac5e();}}},'charset':'utf8mb4','collate':_0x3e27('0x36')});}; \ No newline at end of file +var _0xe59a=['rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','toLowerCase','error','find','WhatsappAccountId','type','twilio','accountSid','authToken','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','node-fetch','path'];(function(_0x8ef497,_0x40b65d){var _0x1442f1=function(_0x623b25){while(--_0x623b25){_0x8ef497['push'](_0x8ef497['shift']());}};_0x1442f1(++_0x40b65d);}(_0xe59a,0x19f));var _0xae59=function(_0x527ce7,_0x52a5db){_0x527ce7=_0x527ce7-0x0;var _0x223c17=_0xe59a[_0x527ce7];return _0x223c17;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xae59('0x0'))('api');var moment=require(_0xae59('0x1'));var BPromise=require(_0xae59('0x2'));var rp=require('request-promise');var fetch=require(_0xae59('0x3'));var fs=require('fs');var path=require(_0xae59('0x4'));var rimraf=require(_0xae59('0x5'));var config=require('../../config/environment');var attributes=require(_0xae59('0x6'));module[_0xae59('0x7')]=function(_0x5a763c,_0x16b4d3){return _0x5a763c[_0xae59('0x8')](_0xae59('0x9'),attributes,{'tableName':_0xae59('0xa'),'paranoid':![],'indexes':[{'name':_0xae59('0xb'),'fields':[_0xae59('0xb')]},{'name':_0xae59('0xc'),'fields':[_0xae59('0xd')],'type':_0xae59('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x153d37,_0x1bdcdd,_0x4f70bc){var _0x3f102d=_0x5a763c[_0xae59('0xf')];var _0x555051=_0x153d37[_0xae59('0x10')]({'plain':!![]});if(_0x555051[_0xae59('0x11')]['toLowerCase']()==='in'||_0x555051[_0xae59('0x11')]['toLowerCase']()===_0xae59('0x12')&&!_0x555051[_0xae59('0x13')]&&!_[_0xae59('0x14')](_0x555051[_0xae59('0x15')])){_0x3f102d[_0xae59('0x16')]['findOne']({'where':{'id':_0x555051[_0xae59('0x17')]}})[_0xae59('0x18')](function(_0x56a9cf){if(_0x56a9cf){_0x56a9cf[_0xae59('0x19')]({'lastMsgAt':_0x555051[_0xae59('0x1a')],'lastMsgDirection':_0x555051[_0xae59('0x11')][_0xae59('0x1b')]()});}})['catch'](function(_0x47d684){console[_0xae59('0x1c')](_0x47d684);});}if(_0x555051[_0xae59('0x11')]===_0xae59('0x12')&&!_0x555051[_0xae59('0x13')]){var _0x2652cc;_0x3f102d['WhatsappAccount'][_0xae59('0x1d')]({'where':{'id':_0x555051[_0xae59('0x1e')]},'raw':!![]})[_0xae59('0x18')](function(_0x6d4967){_0x2652cc=_0x6d4967;if(_0x2652cc&&_0x2652cc[_0xae59('0x1f')]){switch(_0x2652cc[_0xae59('0x1f')]){case _0xae59('0x20'):var _0x553a49=require(_0xae59('0x20'));if(_0x2652cc[_0xae59('0x21')]&&_0x2652cc[_0xae59('0x22')]&&_0x2652cc['phone']){var _0x401e8d=new _0x553a49(_0x2652cc[_0xae59('0x21')],_0x2652cc[_0xae59('0x22')]);_0x401e8d['messages'][_0xae59('0x23')]({'body':_0x555051[_0xae59('0xd')],'to':_0xae59('0x24')+_0x555051[_0xae59('0x25')],'from':_0xae59('0x24')+_0x2652cc[_0xae59('0x25')],'statusCallback':_0x2652cc[_0xae59('0x26')]+_0xae59('0x27')+_0x555051['id']+_0xae59('0x28')+_0x2652cc[_0xae59('0x29')]})[_0xae59('0x18')](function(_0xcfb97a){if(_0xcfb97a['sid']){return _0x153d37[_0xae59('0x19')]({'messageId':_0xcfb97a[_0xae59('0x2a')]});}})[_0xae59('0x2b')](function(_0x438ba2){logger[_0xae59('0x1c')](_0xae59('0x2c'),'afterCreate',_0xae59('0x20'),util[_0xae59('0x2d')](_0x438ba2,{'showHidden':![],'depth':null}));});}else{logger[_0xae59('0x1c')](_0xae59('0x2c'),'afterCreate',_0xae59('0x20'),_0xae59('0x2e'));}break;case _0xae59('0x2f'):var _0x3127cb=_0x2652cc[_0xae59('0x21')];var _0x32d78b=_0x2652cc[_0xae59('0x22')];var _0x270253=_0x2652cc[_0xae59('0x30')]+_0xae59('0x31')+_0x3127cb+_0xae59('0x32');var _0x44e4cc={'to':[_0x555051[_0xae59('0x25')]],'message':{'type':'text','text':_0x555051[_0xae59('0xd')]}};var _0x252cad={'method':_0xae59('0x33'),'uri':_0x270253,'headers':{'Authorization':_0xae59('0x34')+_0x32d78b,'Content-Type':_0xae59('0x35')},'body':_0x44e4cc,'json':!![]};rp(_0x252cad)[_0xae59('0x18')](function(_0x74aa83){if(_0x74aa83[_0xae59('0x36')][0x0][_0xae59('0x37')]){return _0x153d37[_0xae59('0x19')]({'messageId':_0x74aa83['statuses'][0x0]['message_id']});}})[_0xae59('0x2b')](function(_0x230ffb){logger[_0xae59('0x38')]('WhatsappMessage,\x20%s',_0x230ffb);});break;}}})[_0xae59('0x39')](function(){_0x4f70bc();});}else{_0x4f70bc();}}},'charset':_0xae59('0x3a'),'collate':_0xae59('0x3b')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index f430c74..58856fb 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 _0x11e2=['moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','lodash','util'];(function(_0x2bd537,_0x3c7217){var _0x17f131=function(_0x5ca7d2){while(--_0x5ca7d2){_0x2bd537['push'](_0x2bd537['shift']());}};_0x17f131(++_0x3c7217);}(_0x11e2,0xfe));var _0x211e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x11e2[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x211e('0x0'));var util=require(_0x211e('0x1'));var moment=require(_0x211e('0x2'));var BPromise=require('bluebird');var rs=require(_0x211e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x211e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x211e('0x5'))(_0x211e('0x6'));var config=require(_0x211e('0x7'));var jayson=require(_0x211e('0x8'));var client=jayson[_0x211e('0x9')][_0x211e('0xa')]({'port':0x232a});config[_0x211e('0xb')]=_[_0x211e('0xc')](config[_0x211e('0xb')],{'host':_0x211e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x211e('0xb')]));require(_0x211e('0xe'))['register'](socket);function respondWithRpcPromise(_0x3a1cf3,_0x5b1832,_0x5cad46){return new BPromise(function(_0x293fe8,_0x20c569){return client[_0x211e('0xf')](_0x3a1cf3,_0x5cad46)[_0x211e('0x10')](function(_0xe1432e){logger[_0x211e('0x11')](_0x211e('0x12'),_0x5b1832,_0x211e('0x13'));logger[_0x211e('0x14')](_0x211e('0x15'),_0x5b1832,'request\x20sent',JSON[_0x211e('0x16')](_0xe1432e));if(_0xe1432e[_0x211e('0x17')]){if(_0xe1432e[_0x211e('0x17')]['code']===0x1f4){logger[_0x211e('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x5b1832,_0xe1432e['error'][_0x211e('0x18')]);return _0x20c569(_0xe1432e[_0x211e('0x17')][_0x211e('0x18')]);}logger[_0x211e('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x5b1832,_0xe1432e[_0x211e('0x17')]['message']);return _0x293fe8(_0xe1432e[_0x211e('0x17')][_0x211e('0x18')]);}else{logger[_0x211e('0x11')](_0x211e('0x12'),_0x5b1832,_0x211e('0x13'));_0x293fe8(_0xe1432e[_0x211e('0x19')]['message']);}})[_0x211e('0x1a')](function(_0x132cb2){logger[_0x211e('0x17')](_0x211e('0x12'),_0x5b1832,_0x132cb2);_0x20c569(_0x132cb2);});});}exports[_0x211e('0x1b')]=function(_0x474e7d){var _0x1fd1e3=this;return new Promise(function(_0x1700f0,_0x519c58){return db[_0x211e('0x1c')]['create'](_0x474e7d[_0x211e('0x1d')],{'raw':_0x474e7d[_0x211e('0x1e')]?_0x474e7d[_0x211e('0x1e')][_0x211e('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x2bb335){logger[_0x211e('0x11')](_0x211e('0x1b'),_0x474e7d);logger[_0x211e('0x14')](_0x211e('0x1b'),_0x474e7d,JSON[_0x211e('0x16')](_0x2bb335));_0x1700f0(_0x2bb335);})[_0x211e('0x1a')](function(_0x5452df){logger[_0x211e('0x17')](_0x211e('0x1b'),_0x5452df[_0x211e('0x18')],_0x474e7d);_0x519c58(_0x1fd1e3[_0x211e('0x17')](0x1f4,_0x5452df[_0x211e('0x18')]));});});}; \ No newline at end of file +var _0x25cb=['request\x20sent','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s'];(function(_0x398a22,_0x501fe2){var _0x37467a=function(_0x15e266){while(--_0x15e266){_0x398a22['push'](_0x398a22['shift']());}};_0x37467a(++_0x501fe2);}(_0x25cb,0x17e));var _0xb25c=function(_0x1ac53b,_0x31c1f1){_0x1ac53b=_0x1ac53b-0x0;var _0x6dcc75=_0x25cb[_0x1ac53b];return _0x6dcc75;};'use strict';var _=require(_0xb25c('0x0'));var util=require(_0xb25c('0x1'));var moment=require('moment');var BPromise=require(_0xb25c('0x2'));var rs=require(_0xb25c('0x3'));var fs=require('fs');var Redis=require(_0xb25c('0x4'));var db=require(_0xb25c('0x5'))['db'];var utils=require(_0xb25c('0x6'));var logger=require('../../config/logger')(_0xb25c('0x7'));var config=require('../../config/environment');var jayson=require(_0xb25c('0x8'));var client=jayson[_0xb25c('0x9')][_0xb25c('0xa')]({'port':0x232a});config[_0xb25c('0xb')]=_[_0xb25c('0xc')](config[_0xb25c('0xb')],{'host':_0xb25c('0xd'),'port':0x18eb});var socket=require(_0xb25c('0xe'))(new Redis(config[_0xb25c('0xb')]));require(_0xb25c('0xf'))[_0xb25c('0x10')](socket);function respondWithRpcPromise(_0x2627c8,_0x15b44d,_0x4516d4){return new BPromise(function(_0x598636,_0x391aa){return client['request'](_0x2627c8,_0x4516d4)[_0xb25c('0x11')](function(_0x8d8fcb){logger[_0xb25c('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x15b44d,'request\x20sent');logger[_0xb25c('0x13')](_0xb25c('0x14'),_0x15b44d,'request\x20sent',JSON[_0xb25c('0x15')](_0x8d8fcb));if(_0x8d8fcb[_0xb25c('0x16')]){if(_0x8d8fcb[_0xb25c('0x16')][_0xb25c('0x17')]===0x1f4){logger[_0xb25c('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x15b44d,_0x8d8fcb[_0xb25c('0x16')][_0xb25c('0x18')]);return _0x391aa(_0x8d8fcb[_0xb25c('0x16')][_0xb25c('0x18')]);}logger[_0xb25c('0x16')](_0xb25c('0x19'),_0x15b44d,_0x8d8fcb[_0xb25c('0x16')]['message']);return _0x598636(_0x8d8fcb[_0xb25c('0x16')][_0xb25c('0x18')]);}else{logger[_0xb25c('0x12')](_0xb25c('0x19'),_0x15b44d,_0xb25c('0x1a'));_0x598636(_0x8d8fcb[_0xb25c('0x1b')]['message']);}})[_0xb25c('0x1c')](function(_0x4fe565){logger[_0xb25c('0x16')](_0xb25c('0x19'),_0x15b44d,_0x4fe565);_0x391aa(_0x4fe565);});});}exports[_0xb25c('0x1d')]=function(_0x59debe){var _0x41f1cb=this;return new Promise(function(_0x7100d3,_0x57a6e0){return db[_0xb25c('0x1e')][_0xb25c('0x1f')](_0x59debe['body'],{'raw':_0x59debe[_0xb25c('0x20')]?_0x59debe['options'][_0xb25c('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x23d5ac){logger[_0xb25c('0x12')]('CreateWhatsappMessage',_0x59debe);logger[_0xb25c('0x13')](_0xb25c('0x1d'),_0x59debe,JSON['stringify'](_0x23d5ac));_0x7100d3(_0x23d5ac);})[_0xb25c('0x1c')](function(_0x5916a3){logger[_0xb25c('0x16')](_0xb25c('0x1d'),_0x5916a3['message'],_0x59debe);_0x57a6e0(_0x41f1cb[_0xb25c('0x16')](0x1f4,_0x5916a3[_0xb25c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index a8207a7..12d2f76 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 _0x2e36=['whatsappMessage:','./whatsappMessage.events','save','update','emit','removeListener'];(function(_0x19ca86,_0x5808ff){var _0xb05445=function(_0x11e1f6){while(--_0x11e1f6){_0x19ca86['push'](_0x19ca86['shift']());}};_0xb05445(++_0x5808ff);}(_0x2e36,0xe5));var _0x62e3=function(_0x366cc3,_0x16da8f){_0x366cc3=_0x366cc3-0x0;var _0xa9c614=_0x2e36[_0x366cc3];return _0xa9c614;};'use strict';var WhatsappMessageEvents=require(_0x62e3('0x0'));var events=[_0x62e3('0x1'),'remove',_0x62e3('0x2')];function createListener(_0x1b4ea6,_0x1479ad){return function(_0x17bce4){_0x1479ad[_0x62e3('0x3')](_0x1b4ea6,_0x17bce4);};}function removeListener(_0x4bf684,_0x4d71ab){return function(){WhatsappMessageEvents[_0x62e3('0x4')](_0x4bf684,_0x4d71ab);};}exports['register']=function(_0x4a1945){for(var _0x21bfa7=0x0,_0x1113b1=events['length'];_0x21bfa7<_0x1113b1;_0x21bfa7++){var _0xaee9e6=events[_0x21bfa7];var _0x53279a=createListener(_0x62e3('0x5')+_0xaee9e6,_0x4a1945);WhatsappMessageEvents['on'](_0xaee9e6,_0x53279a);}}; \ No newline at end of file +var _0xe9ed=['save','remove','removeListener','register','whatsappMessage:'];(function(_0x3a28df,_0x32976c){var _0x1aba1b=function(_0x444b34){while(--_0x444b34){_0x3a28df['push'](_0x3a28df['shift']());}};_0x1aba1b(++_0x32976c);}(_0xe9ed,0x16d));var _0xde9e=function(_0x4ac13c,_0x343348){_0x4ac13c=_0x4ac13c-0x0;var _0x173400=_0xe9ed[_0x4ac13c];return _0x173400;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xde9e('0x0'),_0xde9e('0x1'),'update'];function createListener(_0x3daf18,_0x3048d2){return function(_0x1bc4d2){_0x3048d2['emit'](_0x3daf18,_0x1bc4d2);};}function removeListener(_0x327f1e,_0x5747df){return function(){WhatsappMessageEvents[_0xde9e('0x2')](_0x327f1e,_0x5747df);};}exports[_0xde9e('0x3')]=function(_0x5d2e59){for(var _0xf04e7a=0x0,_0x3dcd02=events['length'];_0xf04e7a<_0x3dcd02;_0xf04e7a++){var _0x8a8a73=events[_0xf04e7a];var _0x396bdb=createListener(_0xde9e('0x4')+_0x8a8a73,_0x5d2e59);WhatsappMessageEvents['on'](_0x8a8a73,_0x396bdb);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 3074f15..54f1625 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 _0x64f6=['getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','getMembers','/:id/teams'];(function(_0x3b0393,_0x4b0eb7){var _0x2ae662=function(_0x4af99d){while(--_0x4af99d){_0x3b0393['push'](_0x3b0393['shift']());}};_0x2ae662(++_0x4b0eb7);}(_0x64f6,0x11b));var _0x664f=function(_0x5ecc5d,_0x38d142){_0x5ecc5d=_0x5ecc5d-0x0;var _0x5b98a3=_0x64f6[_0x5ecc5d];return _0x5b98a3;};'use strict';var multer=require(_0x664f('0x0'));var util=require(_0x664f('0x1'));var path=require('path');var timeout=require(_0x664f('0x2'));var express=require(_0x664f('0x3'));var router=express[_0x664f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x664f('0x5'));var interaction=require(_0x664f('0x6'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0x664f('0x7')]('/',auth[_0x664f('0x8')](),controller[_0x664f('0x9')]);router[_0x664f('0x7')](_0x664f('0xa'),auth[_0x664f('0x8')](),controller[_0x664f('0xb')]);router[_0x664f('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x664f('0x7')]('/:id/members',auth[_0x664f('0x8')](),controller[_0x664f('0xc')]);router[_0x664f('0x7')](_0x664f('0xd'),auth[_0x664f('0x8')](),controller[_0x664f('0xe')]);router[_0x664f('0x7')](_0x664f('0xf'),auth['isAuthenticated'](),controller[_0x664f('0x10')]);router[_0x664f('0x11')]('/',auth['isAuthenticated'](),controller[_0x664f('0x12')]);router['post'](_0x664f('0xd'),auth['isAuthenticated'](),controller[_0x664f('0x13')]);router[_0x664f('0x11')](_0x664f('0xf'),auth[_0x664f('0x8')](),controller[_0x664f('0x14')]);router[_0x664f('0x15')](_0x664f('0x16'),auth[_0x664f('0x8')](),controller[_0x664f('0x17')]);router[_0x664f('0x18')](_0x664f('0x16'),auth['isAuthenticated'](),controller[_0x664f('0x19')]);router[_0x664f('0x18')](_0x664f('0xd'),auth[_0x664f('0x8')](),controller[_0x664f('0x1a')]);router[_0x664f('0x18')](_0x664f('0xf'),auth[_0x664f('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x2908=['getTeams','/:id/users','getAgents','create','post','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams'];(function(_0x2c9bd3,_0x234524){var _0x25af6a=function(_0x20cdbd){while(--_0x20cdbd){_0x2c9bd3['push'](_0x2c9bd3['shift']());}};_0x25af6a(++_0x234524);}(_0x2908,0x1be));var _0x8290=function(_0x20bb2c,_0x1f953f){_0x20bb2c=_0x20bb2c-0x0;var _0xc572e7=_0x2908[_0x20bb2c];return _0xc572e7;};'use strict';var multer=require(_0x8290('0x0'));var util=require(_0x8290('0x1'));var path=require(_0x8290('0x2'));var timeout=require(_0x8290('0x3'));var express=require(_0x8290('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8290('0x5'));var interaction=require(_0x8290('0x6'));var config=require(_0x8290('0x7'));var controller=require(_0x8290('0x8'));router[_0x8290('0x9')]('/',auth[_0x8290('0xa')](),controller[_0x8290('0xb')]);router[_0x8290('0x9')](_0x8290('0xc'),auth[_0x8290('0xa')](),controller['describe']);router[_0x8290('0x9')](_0x8290('0xd'),auth[_0x8290('0xa')](),controller[_0x8290('0xe')]);router[_0x8290('0x9')](_0x8290('0xf'),auth[_0x8290('0xa')](),controller[_0x8290('0x10')]);router[_0x8290('0x9')](_0x8290('0x11'),auth[_0x8290('0xa')](),controller[_0x8290('0x12')]);router['get'](_0x8290('0x13'),auth[_0x8290('0xa')](),controller[_0x8290('0x14')]);router['post']('/',auth[_0x8290('0xa')](),controller[_0x8290('0x15')]);router[_0x8290('0x16')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router['post']('/:id/users',auth[_0x8290('0xa')](),controller['addAgents']);router[_0x8290('0x17')]('/:id',auth[_0x8290('0xa')](),controller[_0x8290('0x18')]);router[_0x8290('0x19')](_0x8290('0xd'),auth[_0x8290('0xa')](),controller['destroy']);router[_0x8290('0x19')](_0x8290('0x11'),auth[_0x8290('0xa')](),controller[_0x8290('0x1a')]);router[_0x8290('0x19')]('/:id/users',auth['isAuthenticated'](),controller[_0x8290('0x1b')]);module[_0x8290('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 7a8611c..5aa4caa 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 _0x584a=['sequelize','exports','name','INTEGER','ENUM','rrmemory','STRING'];(function(_0x3bdd65,_0x3d187e){var _0x4c7ec6=function(_0x447e50){while(--_0x447e50){_0x3bdd65['push'](_0x3bdd65['shift']());}};_0x4c7ec6(++_0x3d187e);}(_0x584a,0x1c0));var _0xa584=function(_0x3284cd,_0x2e10a2){_0x3284cd=_0x3284cd-0x0;var _0xe92280=_0x584a[_0x3284cd];return _0xe92280;};'use strict';var Sequelize=require(_0xa584('0x0'));module[_0xa584('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa584('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xa584('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa584('0x4')](_0xa584('0x5'),'beepall','roundrobin')},'description':{'type':Sequelize[_0xa584('0x6')]}}; \ No newline at end of file +var _0x99b7=['STRING','rrmemory','beepall','roundrobin','sequelize'];(function(_0x445101,_0x2414bf){var _0x3c3d04=function(_0x249067){while(--_0x249067){_0x445101['push'](_0x445101['shift']());}};_0x3c3d04(++_0x2414bf);}(_0x99b7,0x14e));var _0x799b=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x99b7[_0x3c504b];return _0x2e5354;};'use strict';var Sequelize=require(_0x799b('0x0'));module['exports']={'name':{'type':Sequelize[_0x799b('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x799b('0x2'),_0x799b('0x3'),_0x799b('0x4'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 632da47..caeadf8 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 _0x7649=['limit','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','WhatsappQueues','error','stack','name','index','map','WhatsappQueue','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','show','params','length','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','format','%s/%s','SIP','Team','getTeams','hasOwnProperty','nolimit','addTeams','ids','Agents','interface','sequelize','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','union','compact','value','transaction','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','undefined'];(function(_0x3e40b8,_0x27358a){var _0x456430=function(_0x3310f3){while(--_0x3310f3){_0x3e40b8['push'](_0x3e40b8['shift']());}};_0x456430(++_0x27358a);}(_0x7649,0xf9));var _0x9764=function(_0xbcf372,_0x51df05){_0xbcf372=_0xbcf372-0x0;var _0x343b43=_0x7649[_0xbcf372];return _0x343b43;};'use strict';var emlformat=require(_0x9764('0x0'));var rimraf=require(_0x9764('0x1'));var zipdir=require(_0x9764('0x2'));var jsonpatch=require(_0x9764('0x3'));var rp=require('request-promise');var moment=require(_0x9764('0x4'));var BPromise=require(_0x9764('0x5'));var Mustache=require('mustache');var util=require(_0x9764('0x6'));var path=require(_0x9764('0x7'));var sox=require('sox');var csv=require(_0x9764('0x8'));var ejs=require(_0x9764('0x9'));var fs=require('fs');var fs_extra=require(_0x9764('0xa'));var _=require(_0x9764('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9764('0xc'));var deskjs=require(_0x9764('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9764('0xe'));var Papa=require(_0x9764('0xf'));var Redis=require(_0x9764('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9764('0x11'));var hardwareService=require(_0x9764('0x12'));var logger=require('../../config/logger')(_0x9764('0x13'));var utils=require(_0x9764('0x14'));var config=require(_0x9764('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9764('0x16'))['db'];config[_0x9764('0x17')]=_['defaults'](config[_0x9764('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x9764('0x18'))(new Redis(config[_0x9764('0x17')]));require('./whatsappQueue.socket')[_0x9764('0x19')](socket);function respondWithStatusCode(_0x2c9325,_0x588be5){_0x588be5=_0x588be5||0xcc;return function(_0x27e4c4){if(_0x27e4c4){return _0x2c9325[_0x9764('0x1a')](_0x588be5);}return _0x2c9325[_0x9764('0x1b')](_0x588be5)[_0x9764('0x1c')]();};}function respondWithResult(_0x2993e4,_0x1fe720){_0x1fe720=_0x1fe720||0xc8;return function(_0xa68eb2){if(_0xa68eb2){return _0x2993e4[_0x9764('0x1b')](_0x1fe720)[_0x9764('0x1d')](_0xa68eb2);}};}function respondWithFilteredResult(_0x534e02,_0x28e72b){return function(_0x57d1b5){if(_0x57d1b5){var _0x955c6d=typeof _0x28e72b['offset']===_0x9764('0x1e')&&typeof _0x28e72b[_0x9764('0x1f')]===_0x9764('0x1e');var _0x1ee0a3=_0x57d1b5['count'];var _0x1828c5=_0x955c6d?0x0:_0x28e72b[_0x9764('0x20')];var _0x53fcc4=_0x955c6d?_0x57d1b5['count']:_0x28e72b[_0x9764('0x20')]+_0x28e72b[_0x9764('0x1f')];var _0xdd076b;if(_0x53fcc4>=_0x1ee0a3){_0x53fcc4=_0x1ee0a3;_0xdd076b=0xc8;}else{_0xdd076b=0xce;}_0x534e02[_0x9764('0x1b')](_0xdd076b);return _0x534e02[_0x9764('0x21')](_0x9764('0x22'),_0x1828c5+'-'+_0x53fcc4+'/'+_0x1ee0a3)[_0x9764('0x1d')](_0x57d1b5);}return null;};}function patchUpdates(_0x51ce98){return function(_0x2b1eec){try{jsonpatch[_0x9764('0x23')](_0x2b1eec,_0x51ce98,!![]);}catch(_0x243274){return BPromise[_0x9764('0x24')](_0x243274);}return _0x2b1eec[_0x9764('0x25')]();};}function saveUpdates(_0xafdc71,_0x404f46){return function(_0x359368){if(_0x359368){return _0x359368[_0x9764('0x26')](_0xafdc71)['then'](function(_0x3170c3){return _0x3170c3;});}return null;};}function removeEntity(_0x4911f6,_0x1d6dce){return function(_0x4ed387){if(_0x4ed387){return _0x4ed387[_0x9764('0x27')]()[_0x9764('0x28')](function(){var _0x1f8833=_0x4ed387[_0x9764('0x29')]({'plain':!![]});var _0x42ae08=_0x9764('0x2a');return db['UserProfileResource'][_0x9764('0x27')]({'where':{'type':_0x42ae08,'resourceId':_0x1f8833['id']}})['then'](function(){return _0x4ed387;});})['then'](function(){_0x4911f6[_0x9764('0x1b')](0xcc)[_0x9764('0x1c')]();});}};}function handleEntityNotFound(_0x542e8c,_0x127cdd){return function(_0x37089c){if(!_0x37089c){_0x542e8c[_0x9764('0x1a')](0x194);}return _0x37089c;};}function handleError(_0x49112b,_0x3112ed){_0x3112ed=_0x3112ed||0x1f4;return function(_0x40c673){logger[_0x9764('0x2b')](_0x40c673[_0x9764('0x2c')]);if(_0x40c673[_0x9764('0x2d')]){delete _0x40c673[_0x9764('0x2d')];}_0x49112b[_0x9764('0x1b')](_0x3112ed)['send'](_0x40c673);};}exports[_0x9764('0x2e')]=function(_0x3a8702,_0x1d670b){var _0x4e618d={},_0x7b4a5b={},_0x28607e={'count':0x0,'rows':[]};var _0x32f491=_[_0x9764('0x2f')](db[_0x9764('0x30')][_0x9764('0x31')],function(_0xcb6f12){return{'name':_0xcb6f12[_0x9764('0x32')],'type':_0xcb6f12['type'][_0x9764('0x33')]};});_0x7b4a5b[_0x9764('0x34')]=_[_0x9764('0x2f')](_0x32f491,_0x9764('0x2d'));_0x7b4a5b['query']=_[_0x9764('0x35')](_0x3a8702[_0x9764('0x36')]);_0x7b4a5b[_0x9764('0x37')]=_['intersection'](_0x7b4a5b[_0x9764('0x34')],_0x7b4a5b[_0x9764('0x36')]);_0x4e618d[_0x9764('0x38')]=_[_0x9764('0x39')](_0x7b4a5b[_0x9764('0x34')],qs[_0x9764('0x3a')](_0x3a8702[_0x9764('0x36')][_0x9764('0x3a')]));_0x4e618d[_0x9764('0x38')]=_0x4e618d['attributes']['length']?_0x4e618d['attributes']:_0x7b4a5b['model'];if(!_0x3a8702[_0x9764('0x36')]['hasOwnProperty']('nolimit')){_0x4e618d[_0x9764('0x1f')]=qs[_0x9764('0x1f')](_0x3a8702['query'][_0x9764('0x1f')]);_0x4e618d[_0x9764('0x20')]=qs['offset'](_0x3a8702['query'][_0x9764('0x20')]);}_0x4e618d[_0x9764('0x3b')]=qs[_0x9764('0x3c')](_0x3a8702[_0x9764('0x36')][_0x9764('0x3c')]);_0x4e618d[_0x9764('0x3d')]=qs['filters'](_[_0x9764('0x3e')](_0x3a8702[_0x9764('0x36')],_0x7b4a5b[_0x9764('0x37')]),_0x32f491);if(_0x3a8702[_0x9764('0x36')][_0x9764('0x3f')]){_0x4e618d[_0x9764('0x3d')]=_[_0x9764('0x40')](_0x4e618d[_0x9764('0x3d')],{'$or':_[_0x9764('0x2f')](_0x32f491,function(_0x1604e1){if(_0x1604e1[_0x9764('0x41')]!==_0x9764('0x42')){var _0xda8ad6={};_0xda8ad6[_0x1604e1[_0x9764('0x2d')]]={'$like':'%'+_0x3a8702[_0x9764('0x36')][_0x9764('0x3f')]+'%'};return _0xda8ad6;}})});}_0x4e618d=_[_0x9764('0x40')]({},_0x4e618d,_0x3a8702['options']);var _0x5288c2={'where':_0x4e618d[_0x9764('0x3d')]};return db[_0x9764('0x30')][_0x9764('0x43')](_0x5288c2)[_0x9764('0x28')](function(_0x4e4e51){_0x28607e[_0x9764('0x43')]=_0x4e4e51;if(_0x3a8702[_0x9764('0x36')][_0x9764('0x44')]){_0x4e618d[_0x9764('0x45')]=[{'all':!![]}];}return db[_0x9764('0x30')][_0x9764('0x46')](_0x4e618d);})[_0x9764('0x28')](function(_0x5bfb16){_0x28607e['rows']=_0x5bfb16;return _0x28607e;})[_0x9764('0x28')](respondWithFilteredResult(_0x1d670b,_0x4e618d))['catch'](handleError(_0x1d670b,null));};exports[_0x9764('0x47')]=function(_0x5bbfa9,_0x3831b0){var _0x1520d1={'raw':!![],'where':{'id':_0x5bbfa9[_0x9764('0x48')]['id']}},_0xb7b026={};_0xb7b026[_0x9764('0x34')]=_['keys'](db[_0x9764('0x30')]['rawAttributes']);_0xb7b026[_0x9764('0x36')]=_[_0x9764('0x35')](_0x5bbfa9[_0x9764('0x36')]);_0xb7b026[_0x9764('0x37')]=_[_0x9764('0x39')](_0xb7b026[_0x9764('0x34')],_0xb7b026[_0x9764('0x36')]);_0x1520d1[_0x9764('0x38')]=_['intersection'](_0xb7b026['model'],qs[_0x9764('0x3a')](_0x5bbfa9['query']['fields']));_0x1520d1[_0x9764('0x38')]=_0x1520d1[_0x9764('0x38')][_0x9764('0x49')]?_0x1520d1[_0x9764('0x38')]:_0xb7b026[_0x9764('0x34')];if(_0x5bbfa9[_0x9764('0x36')][_0x9764('0x44')]){_0x1520d1['include']=[{'all':!![]}];}_0x1520d1=_[_0x9764('0x40')]({},_0x1520d1,_0x5bbfa9[_0x9764('0x4a')]);return db[_0x9764('0x30')][_0x9764('0x4b')](_0x1520d1)[_0x9764('0x28')](handleEntityNotFound(_0x3831b0,null))[_0x9764('0x28')](respondWithResult(_0x3831b0,null))[_0x9764('0x4c')](handleError(_0x3831b0,null));};exports[_0x9764('0x4d')]=function(_0x35343c,_0x30538f){return db['WhatsappQueue'][_0x9764('0x4d')](_0x35343c[_0x9764('0x4e')],{})[_0x9764('0x28')](function(_0xd53e4c){var _0x5df368=_0x35343c[_0x9764('0x4f')][_0x9764('0x29')]({'plain':!![]});if(!_0x5df368)throw new Error(_0x9764('0x50'));if(_0x5df368[_0x9764('0x51')]===_0x9764('0x4f')){var _0x235e8a=_0xd53e4c['get']({'plain':!![]});var _0x581c8f='WhatsappQueues';return db[_0x9764('0x52')][_0x9764('0x4b')]({'where':{'name':_0x581c8f,'userProfileId':_0x5df368[_0x9764('0x53')]},'raw':!![]})['then'](function(_0x492693){if(_0x492693&&_0x492693['autoAssociation']===0x0){return db['UserProfileResource'][_0x9764('0x4d')]({'name':_0x235e8a[_0x9764('0x2d')],'resourceId':_0x235e8a['id'],'type':_0x492693['name'],'sectionId':_0x492693['id']},{})['then'](function(){return _0xd53e4c;});}else{return _0xd53e4c;}})[_0x9764('0x4c')](function(_0x277686){logger['error'](_0x9764('0x54'),_0x277686);throw _0x277686;});}return _0xd53e4c;})['then'](respondWithResult(_0x30538f,0xc9))['catch'](handleError(_0x30538f,null));};exports[_0x9764('0x26')]=function(_0x5bbd85,_0x257261){if(_0x5bbd85[_0x9764('0x4e')]['id']){delete _0x5bbd85['body']['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x5bbd85[_0x9764('0x48')]['id']}})['then'](handleEntityNotFound(_0x257261,null))['then'](saveUpdates(_0x5bbd85['body'],null))['then'](respondWithResult(_0x257261,null))[_0x9764('0x4c')](handleError(_0x257261,null));};exports[_0x9764('0x27')]=function(_0x254232,_0x260aa7){return db['WhatsappQueue']['find']({'where':{'id':_0x254232[_0x9764('0x48')]['id']}})[_0x9764('0x28')](handleEntityNotFound(_0x260aa7,null))['then'](removeEntity(_0x260aa7,null))['catch'](handleError(_0x260aa7,null));};exports['describe']=function(_0x18b724,_0x30e221){return db[_0x9764('0x30')][_0x9764('0x55')]()[_0x9764('0x28')](respondWithResult(_0x30e221,null))['catch'](handleError(_0x30e221,null));};exports[_0x9764('0x56')]=function(_0x410496,_0x38af8f,_0x5cae4a){var _0x46a9f5={'raw':!![],'where':{}},_0x4f13b6={},_0x5079ee;return db[_0x9764('0x30')][_0x9764('0x57')]({'where':{'id':_0x410496[_0x9764('0x48')]['id']}})[_0x9764('0x28')](handleEntityNotFound(_0x38af8f,null))['then'](function(_0x55be24){if(_0x55be24){_0x5079ee=_0x55be24['get']({'plain':!![]});_0x4f13b6[_0x9764('0x34')]=_[_0x9764('0x35')](db[_0x9764('0x58')][_0x9764('0x31')]);_0x4f13b6[_0x9764('0x36')]=_['keys'](_0x410496['query']);_0x4f13b6[_0x9764('0x37')]=_[_0x9764('0x39')](_0x4f13b6[_0x9764('0x34')],_0x4f13b6[_0x9764('0x36')]);_0x46a9f5[_0x9764('0x38')]=_[_0x9764('0x39')](_0x4f13b6[_0x9764('0x34')],qs[_0x9764('0x3a')](_0x410496[_0x9764('0x36')]['fields']));_0x46a9f5[_0x9764('0x38')]=_0x46a9f5[_0x9764('0x38')][_0x9764('0x49')]?_0x46a9f5[_0x9764('0x38')]:_0x4f13b6[_0x9764('0x34')];if(!_0x410496[_0x9764('0x36')]['hasOwnProperty']('nolimit')){_0x46a9f5[_0x9764('0x1f')]=qs[_0x9764('0x1f')](_0x410496[_0x9764('0x36')]['limit']);_0x46a9f5[_0x9764('0x20')]=qs[_0x9764('0x20')](_0x410496[_0x9764('0x36')]['offset']);}_0x46a9f5[_0x9764('0x3b')]=qs[_0x9764('0x3c')](_0x410496[_0x9764('0x36')][_0x9764('0x3c')]);_0x46a9f5[_0x9764('0x3d')]=qs[_0x9764('0x37')](_[_0x9764('0x3e')](_0x410496[_0x9764('0x36')],_0x4f13b6['filters']));_0x46a9f5[_0x9764('0x3d')][_0x9764('0x59')]=_0x55be24['id'];if(_0x410496[_0x9764('0x36')]['filter']){_0x46a9f5[_0x9764('0x3d')]=_[_0x9764('0x40')](_0x46a9f5[_0x9764('0x3d')],{'$or':_[_0x9764('0x2f')](_0x46a9f5[_0x9764('0x38')],function(_0x1eeff6){var _0x142931={};_0x142931[_0x1eeff6]={'$like':'%'+_0x410496[_0x9764('0x36')]['filter']+'%'};return _0x142931;})});}_0x46a9f5=_['merge']({},_0x46a9f5,_0x410496[_0x9764('0x4a')]);return db['UserWhatsappQueue'][_0x9764('0x46')](_0x46a9f5);}})['then'](function(_0xfd73f){if(_0xfd73f){return db[_0x9764('0x5a')][_0x9764('0x5b')]({'where':{'id':_['map'](_0xfd73f,_0x9764('0x5c')),'role':_0x9764('0x5d')},'attributes':['id','name',_0x9764('0x5e'),_0x9764('0x5f'),'createdAt']});}})[_0x9764('0x28')](function(_0x513061){if(_0x513061){return{'count':_0x513061['count'],'rows':_['map'](_0x513061['rows'],function(_0x1ab0f2){return{'membername':_0x1ab0f2[_0x9764('0x2d')],'UserId':_0x1ab0f2['id'],'queue_name':_0x5079ee[_0x9764('0x2d')],'WhatsappQueueId':_0x5079ee['id'],'interface':util[_0x9764('0x60')](_0x9764('0x61'),_0x9764('0x62'),_0x1ab0f2[_0x9764('0x2d')]),'penalty':0x0,'paused':_0x1ab0f2[_0x9764('0x5e')],'createdAt':_0x1ab0f2['createdAt'],'updatedAt':_0x1ab0f2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9764('0x28')](respondWithFilteredResult(_0x38af8f,_0x46a9f5))[_0x9764('0x4c')](handleError(_0x38af8f,null));};exports['getTeams']=function(_0x4d9ec4,_0x186ee9,_0xc249ee){var _0x2e84a6={};var _0x447338={};var _0x33d333;var _0x3a60ed;return db[_0x9764('0x30')][_0x9764('0x57')]({'where':{'id':_0x4d9ec4['params']['id']}})['then'](handleEntityNotFound(_0x186ee9,null))[_0x9764('0x28')](function(_0x19f169){if(_0x19f169){_0x33d333=_0x19f169;_0x447338[_0x9764('0x34')]=_[_0x9764('0x35')](db[_0x9764('0x63')][_0x9764('0x31')]);_0x447338['query']=_[_0x9764('0x35')](_0x4d9ec4['query']);_0x447338['filters']=_['intersection'](_0x447338['model'],_0x447338[_0x9764('0x36')]);_0x2e84a6[_0x9764('0x38')]=_[_0x9764('0x39')](_0x447338[_0x9764('0x34')],qs['fields'](_0x4d9ec4['query'][_0x9764('0x3a')]));_0x2e84a6['attributes']=_0x2e84a6[_0x9764('0x38')][_0x9764('0x49')]?_0x2e84a6[_0x9764('0x38')]:_0x447338[_0x9764('0x34')];_0x2e84a6[_0x9764('0x3b')]=qs[_0x9764('0x3c')](_0x4d9ec4[_0x9764('0x36')][_0x9764('0x3c')]);_0x2e84a6['where']=qs['filters'](_['pick'](_0x4d9ec4[_0x9764('0x36')],_0x447338[_0x9764('0x37')]));if(_0x4d9ec4[_0x9764('0x36')][_0x9764('0x3f')]){_0x2e84a6['where']=_['merge'](_0x2e84a6[_0x9764('0x3d')],{'$or':_[_0x9764('0x2f')](_0x2e84a6[_0x9764('0x38')],function(_0x5b9f49){var _0xc6ba1d={};_0xc6ba1d[_0x5b9f49]={'$like':'%'+_0x4d9ec4[_0x9764('0x36')][_0x9764('0x3f')]+'%'};return _0xc6ba1d;})});}_0x2e84a6=_[_0x9764('0x40')]({},_0x2e84a6,_0x4d9ec4[_0x9764('0x4a')]);return _0x33d333[_0x9764('0x64')](_0x2e84a6);}})[_0x9764('0x28')](function(_0x105c52){if(_0x105c52){_0x3a60ed=_0x105c52[_0x9764('0x49')];if(!_0x4d9ec4[_0x9764('0x36')][_0x9764('0x65')](_0x9764('0x66'))){_0x2e84a6[_0x9764('0x1f')]=qs[_0x9764('0x1f')](_0x4d9ec4[_0x9764('0x36')][_0x9764('0x1f')]);_0x2e84a6[_0x9764('0x20')]=qs[_0x9764('0x20')](_0x4d9ec4[_0x9764('0x36')][_0x9764('0x20')]);}return _0x33d333['getTeams'](_0x2e84a6);}})[_0x9764('0x28')](function(_0x48fd68){if(_0x48fd68){return _0x48fd68?{'count':_0x3a60ed,'rows':_0x48fd68}:null;}})[_0x9764('0x28')](respondWithResult(_0x186ee9,null))[_0x9764('0x4c')](handleError(_0x186ee9,null));};exports[_0x9764('0x67')]=function(_0x3c7cf2,_0x3e6c9a,_0x5f0f1d){var _0x169d5e=_0x3c7cf2['body'][_0x9764('0x68')];return db[_0x9764('0x63')][_0x9764('0x46')]({'where':{'id':_0x169d5e},'attributes':['id'],'include':[{'model':db[_0x9764('0x5a')],'as':_0x9764('0x69'),'attributes':['id',_0x9764('0x2d'),'online','voicePause',_0x9764('0x6a')],'raw':!![]}]})[_0x9764('0x28')](function(_0x2c898b){if(_0x2c898b){var _0x351a87=_['flatMap'](_0x2c898b,function(_0x1e3428){var _0x185ef2=_0x1e3428['get']({'plain':!![]});return _0x185ef2[_0x9764('0x69')];});return db[_0x9764('0x30')][_0x9764('0x4b')]({'where':{'id':_0x3c7cf2[_0x9764('0x48')]['id']}})[_0x9764('0x28')](function(_0x51c45c){return db[_0x9764('0x6b')]['transaction'](function(_0x29e81c){return _0x51c45c[_0x9764('0x67')](_0x169d5e,{'transaction':_0x29e81c})[_0x9764('0x28')](function(){return BPromise[_0x9764('0x6c')](_0x351a87,function(_0x53576b){return db[_0x9764('0x58')][_0x9764('0x6d')]({'where':{'UserId':_0x53576b['id'],'WhatsappQueueId':_0x3c7cf2[_0x9764('0x48')]['id']},'transaction':_0x29e81c});});})[_0x9764('0x28')](function(){_0x351a87[_0x9764('0x6e')](function(_0x18feb9){socket[_0x9764('0x6f')](_0x9764('0x70'),{'UserId':_0x18feb9['id'],'WhatsappQueueId':_0x51c45c['id']});});});});});}})['then'](respondWithStatusCode(_0x3e6c9a,null))['catch'](handleError(_0x3e6c9a,null));};exports[_0x9764('0x71')]=function(_0x585dc9,_0x5866a3,_0xee1fff){return db[_0x9764('0x63')][_0x9764('0x46')]({'where':{'id':_0x585dc9[_0x9764('0x36')][_0x9764('0x68')]},'attributes':['id'],'include':[{'model':db[_0x9764('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9764('0x28')](handleEntityNotFound(_0x5866a3,null))[_0x9764('0x28')](function(_0x3f8847){var _0x2086e0=_['map'](_0x3f8847,'id');var _0x4f8896=[];var _0x435bf9=[];var _0x1b3d5c=squel['select']();_0x1b3d5c[_0x9764('0x72')](_0x9764('0x73'))[_0x9764('0x74')](_0x9764('0x75'),'tq')[_0x9764('0x76')](_0x9764('0x77'),'ut',_0x9764('0x78'))[_0x9764('0x3d')](_0x9764('0x79'),_0x585dc9[_0x9764('0x48')]['id']);for(var _0x438c43=0x0;_0x438c43<_0x3f8847[_0x9764('0x49')];_0x438c43+=0x1){let _0xbff22e=_0x3f8847[_0x438c43];for(var _0x38f631=0x0;_0x38f631<_0xbff22e['Agents']['length'];_0x38f631+=0x1){let _0x37770f=_0xbff22e[_0x9764('0x69')][_0x38f631];var _0x54f958=_0x1b3d5c[_0x9764('0x7a')]();_0x54f958[_0x9764('0x3d')](_0x9764('0x7b'),_0x37770f['id']);_0x435bf9[_0x9764('0x7c')](db['sequelize'][_0x9764('0x36')](_0x54f958['toString'](),{'type':db[_0x9764('0x6b')][_0x9764('0x7d')][_0x9764('0x7e')]})[_0x9764('0x28')](function(_0x13bb62){if(_0x13bb62[_0x9764('0x49')]===0x1){return _0x37770f['id'];}else{var _0x2c4d77=_[_0x9764('0x7f')](_[_0x9764('0x2f')](_0x13bb62,'TeamId'),function(_0x96da95){return _[_0x9764('0x80')](_0x2086e0,_0x96da95);});if(_0x2c4d77){return _0x37770f['id'];}}}));}}return BPromise['all'](_0x435bf9)[_0x9764('0x28')](function(_0x9b7392){_0x4f8896=_(_0x4f8896)[_0x9764('0x81')](_0x9b7392)[_0x9764('0x82')]()[_0x9764('0x83')]();return db['WhatsappQueue']['find']({'where':{'id':_0x585dc9[_0x9764('0x48')]['id']}})[_0x9764('0x28')](function(_0x1ae8fb){return db[_0x9764('0x6b')][_0x9764('0x84')](function(_0x34991c){return _0x1ae8fb[_0x9764('0x71')](_0x585dc9[_0x9764('0x36')][_0x9764('0x68')],{'transaction':_0x34991c})[_0x9764('0x28')](function(){if(!_[_0x9764('0x85')](_0x4f8896)){return _0x1ae8fb['removeAgents'](_0x4f8896,{'transaction':_0x34991c});}})[_0x9764('0x28')](function(){_0x4f8896[_0x9764('0x6e')](function(_0x50b118){socket[_0x9764('0x6f')](_0x9764('0x86'),{'UserId':_0x50b118,'WhatsappQueueId':_0x1ae8fb['id']});});});});});});})['then'](respondWithStatusCode(_0x5866a3,null))[_0x9764('0x4c')](handleError(_0x5866a3,null));};exports[_0x9764('0x87')]=function(_0x1e2929,_0x472b43,_0x183212){return db[_0x9764('0x30')][_0x9764('0x4b')]({'where':{'id':_0x1e2929['params']['id']}})[_0x9764('0x28')](handleEntityNotFound(_0x472b43,null))[_0x9764('0x28')](function(_0x223123){if(_0x223123){return _0x223123['addAgents'](_0x1e2929[_0x9764('0x4e')][_0x9764('0x68')],_[_0x9764('0x88')](_0x1e2929[_0x9764('0x4e')],[_0x9764('0x68'),'id'])||{})[_0x9764('0x89')](function(_0x27f6fa){for(var _0x5cd11c=0x0;_0x5cd11c<_0x1e2929['body'][_0x9764('0x68')]['length'];_0x5cd11c+=0x1){socket[_0x9764('0x6f')](_0x9764('0x70'),{'UserId':Number(_0x1e2929[_0x9764('0x4e')][_0x9764('0x68')][_0x5cd11c]),'WhatsappQueueId':Number(_0x1e2929[_0x9764('0x48')]['id'])});}return _0x27f6fa;});}})[_0x9764('0x28')](respondWithResult(_0x472b43,null))['catch'](handleError(_0x472b43,null));};exports[_0x9764('0x8a')]=function(_0x52a926,_0xe13472,_0x32efdd){return db['WhatsappQueue'][_0x9764('0x4b')]({'where':{'id':_0x52a926['params']['id']}})[_0x9764('0x28')](handleEntityNotFound(_0xe13472,null))['then'](function(_0x5e5b82){if(_0x5e5b82){return _0x5e5b82['removeAgents'](_0x52a926['query'][_0x9764('0x68')])[_0x9764('0x28')](function(){if(_['isArray'](_0x52a926['query'][_0x9764('0x68')])){for(var _0x390b4d=0x0;_0x390b4d<_0x52a926['query'][_0x9764('0x68')][_0x9764('0x49')];_0x390b4d+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x52a926[_0x9764('0x36')][_0x9764('0x68')][_0x390b4d]),'WhatsappQueueId':Number(_0x52a926[_0x9764('0x48')]['id'])});}}else{socket[_0x9764('0x6f')]('userWhatsappQueue:remove',{'UserId':Number(_0x52a926['query'][_0x9764('0x68')]),'WhatsappQueueId':Number(_0x52a926[_0x9764('0x48')]['id'])});}});}})[_0x9764('0x28')](respondWithStatusCode(_0xe13472,null))[_0x9764('0x4c')](handleError(_0xe13472,null));};exports['getAgents']=function(_0x387a9c,_0xfa757d,_0x446328){var _0x5815c7={};var _0x42b169={};var _0x4e399f;var _0x5b82fe;return db[_0x9764('0x30')][_0x9764('0x57')]({'where':{'id':_0x387a9c['params']['id']}})['then'](handleEntityNotFound(_0xfa757d,null))[_0x9764('0x28')](function(_0xac0e31){if(_0xac0e31){_0x4e399f=_0xac0e31;_0x42b169[_0x9764('0x34')]=_[_0x9764('0x35')](db[_0x9764('0x5a')][_0x9764('0x31')]);_0x42b169[_0x9764('0x36')]=_['keys'](_0x387a9c['query']);_0x42b169[_0x9764('0x37')]=_['intersection'](_0x42b169[_0x9764('0x34')],_0x42b169[_0x9764('0x36')]);_0x5815c7[_0x9764('0x38')]=_[_0x9764('0x39')](_0x42b169[_0x9764('0x34')],qs[_0x9764('0x3a')](_0x387a9c['query'][_0x9764('0x3a')]));_0x5815c7['attributes']=_0x5815c7[_0x9764('0x38')][_0x9764('0x49')]?_0x5815c7[_0x9764('0x38')]:_0x42b169[_0x9764('0x34')];_0x5815c7[_0x9764('0x3b')]=qs[_0x9764('0x3c')](_0x387a9c[_0x9764('0x36')][_0x9764('0x3c')]);_0x5815c7[_0x9764('0x3d')]=qs[_0x9764('0x37')](_['pick'](_0x387a9c[_0x9764('0x36')],_0x42b169[_0x9764('0x37')]));if(_0x387a9c[_0x9764('0x36')][_0x9764('0x3f')]){_0x5815c7[_0x9764('0x3d')]=_[_0x9764('0x40')](_0x5815c7['where'],{'$or':_[_0x9764('0x2f')](_0x5815c7[_0x9764('0x38')],function(_0x22ca56){var _0x53752a={};_0x53752a[_0x22ca56]={'$like':'%'+_0x387a9c[_0x9764('0x36')][_0x9764('0x3f')]+'%'};return _0x53752a;})});}_0x5815c7=_[_0x9764('0x40')]({},_0x5815c7,_0x387a9c[_0x9764('0x4a')]);return _0x4e399f[_0x9764('0x8b')](_0x5815c7);}})[_0x9764('0x28')](function(_0x555cc8){if(_0x555cc8){_0x5b82fe=_0x555cc8['length'];if(!_0x387a9c[_0x9764('0x36')][_0x9764('0x65')](_0x9764('0x66'))){_0x5815c7[_0x9764('0x1f')]=qs[_0x9764('0x1f')](_0x387a9c[_0x9764('0x36')][_0x9764('0x1f')]);_0x5815c7[_0x9764('0x20')]=qs[_0x9764('0x20')](_0x387a9c[_0x9764('0x36')]['offset']);}return _0x4e399f[_0x9764('0x8b')](_0x5815c7);}})[_0x9764('0x28')](function(_0x128393){if(_0x128393){return _0x128393?{'count':_0x5b82fe,'rows':_0x128393}:null;}})[_0x9764('0x28')](respondWithResult(_0xfa757d,null))[_0x9764('0x4c')](handleError(_0xfa757d,null));}; \ No newline at end of file +var _0x5eed=['format','%s/%s','whatsappPause','Team','getTeams','addTeams','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','ids','isEmpty','removeAgents','addAgents','omit','spread','userWhatsappQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','WhatsappQueues','end','error','name','send','index','map','WhatsappQueue','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','get','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','UserWhatsappQueue','order','sort','User','findAndCountAll','UserId','agent','updatedAt','createdAt'];(function(_0x49f899,_0x1f3e7d){var _0x5c0402=function(_0x4960d0){while(--_0x4960d0){_0x49f899['push'](_0x49f899['shift']());}};_0x5c0402(++_0x1f3e7d);}(_0x5eed,0x1ce));var _0xd5ee=function(_0x44054a,_0x348230){_0x44054a=_0x44054a-0x0;var _0x4cb9f0=_0x5eed[_0x44054a];return _0x4cb9f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd5ee('0x0'));var zipdir=require(_0xd5ee('0x1'));var jsonpatch=require(_0xd5ee('0x2'));var rp=require(_0xd5ee('0x3'));var moment=require(_0xd5ee('0x4'));var BPromise=require(_0xd5ee('0x5'));var Mustache=require(_0xd5ee('0x6'));var util=require(_0xd5ee('0x7'));var path=require(_0xd5ee('0x8'));var sox=require(_0xd5ee('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd5ee('0xa'));var _=require(_0xd5ee('0xb'));var squel=require(_0xd5ee('0xc'));var crypto=require(_0xd5ee('0xd'));var jsforce=require(_0xd5ee('0xe'));var deskjs=require(_0xd5ee('0xf'));var toCsv=require(_0xd5ee('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd5ee('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd5ee('0x12'));var as=require(_0xd5ee('0x13'));var hardwareService=require(_0xd5ee('0x14'));var logger=require(_0xd5ee('0x15'))('api');var utils=require(_0xd5ee('0x16'));var config=require(_0xd5ee('0x17'));var licenseUtil=require(_0xd5ee('0x18'));var db=require(_0xd5ee('0x19'))['db'];config[_0xd5ee('0x1a')]=_[_0xd5ee('0x1b')](config['redis'],{'host':_0xd5ee('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappQueue.socket')[_0xd5ee('0x1d')](socket);function respondWithStatusCode(_0x15ec9e,_0x4a0d1d){_0x4a0d1d=_0x4a0d1d||0xcc;return function(_0x5c8d71){if(_0x5c8d71){return _0x15ec9e[_0xd5ee('0x1e')](_0x4a0d1d);}return _0x15ec9e[_0xd5ee('0x1f')](_0x4a0d1d)['end']();};}function respondWithResult(_0x5886f6,_0x48912d){_0x48912d=_0x48912d||0xc8;return function(_0x218770){if(_0x218770){return _0x5886f6[_0xd5ee('0x1f')](_0x48912d)[_0xd5ee('0x20')](_0x218770);}};}function respondWithFilteredResult(_0x62f41d,_0x2166cd){return function(_0x2cc298){if(_0x2cc298){var _0x4ab5d3=typeof _0x2166cd[_0xd5ee('0x21')]===_0xd5ee('0x22')&&typeof _0x2166cd[_0xd5ee('0x23')]===_0xd5ee('0x22');var _0x54644d=_0x2cc298[_0xd5ee('0x24')];var _0x346d94=_0x4ab5d3?0x0:_0x2166cd[_0xd5ee('0x21')];var _0x18c670=_0x4ab5d3?_0x2cc298[_0xd5ee('0x24')]:_0x2166cd['offset']+_0x2166cd[_0xd5ee('0x23')];var _0x352991;if(_0x18c670>=_0x54644d){_0x18c670=_0x54644d;_0x352991=0xc8;}else{_0x352991=0xce;}_0x62f41d[_0xd5ee('0x1f')](_0x352991);return _0x62f41d[_0xd5ee('0x25')](_0xd5ee('0x26'),_0x346d94+'-'+_0x18c670+'/'+_0x54644d)['json'](_0x2cc298);}return null;};}function patchUpdates(_0x19c3c0){return function(_0x5da902){try{jsonpatch[_0xd5ee('0x27')](_0x5da902,_0x19c3c0,!![]);}catch(_0x1163d1){return BPromise['reject'](_0x1163d1);}return _0x5da902[_0xd5ee('0x28')]();};}function saveUpdates(_0x179cc8,_0x5e5717){return function(_0x279a03){if(_0x279a03){return _0x279a03['update'](_0x179cc8)[_0xd5ee('0x29')](function(_0x3026cd){return _0x3026cd;});}return null;};}function removeEntity(_0x263ed4,_0x5e6469){return function(_0x4c07ce){if(_0x4c07ce){return _0x4c07ce[_0xd5ee('0x2a')]()['then'](function(){var _0x15a247=_0x4c07ce['get']({'plain':!![]});var _0x5eae78=_0xd5ee('0x2b');return db['UserProfileResource'][_0xd5ee('0x2a')]({'where':{'type':_0x5eae78,'resourceId':_0x15a247['id']}})[_0xd5ee('0x29')](function(){return _0x4c07ce;});})[_0xd5ee('0x29')](function(){_0x263ed4[_0xd5ee('0x1f')](0xcc)[_0xd5ee('0x2c')]();});}};}function handleEntityNotFound(_0x254678,_0x3427a4){return function(_0x36cce1){if(!_0x36cce1){_0x254678[_0xd5ee('0x1e')](0x194);}return _0x36cce1;};}function handleError(_0x137c07,_0x53158d){_0x53158d=_0x53158d||0x1f4;return function(_0x4f4558){logger[_0xd5ee('0x2d')](_0x4f4558['stack']);if(_0x4f4558['name']){delete _0x4f4558[_0xd5ee('0x2e')];}_0x137c07[_0xd5ee('0x1f')](_0x53158d)[_0xd5ee('0x2f')](_0x4f4558);};}exports[_0xd5ee('0x30')]=function(_0xc0bdff,_0x38872e){var _0x43de60={},_0x297ed6={},_0x4baa48={'count':0x0,'rows':[]};var _0x470b0c=_[_0xd5ee('0x31')](db[_0xd5ee('0x32')][_0xd5ee('0x33')],function(_0x513b84){return{'name':_0x513b84['fieldName'],'type':_0x513b84[_0xd5ee('0x34')][_0xd5ee('0x35')]};});_0x297ed6[_0xd5ee('0x36')]=_[_0xd5ee('0x31')](_0x470b0c,_0xd5ee('0x2e'));_0x297ed6[_0xd5ee('0x37')]=_[_0xd5ee('0x38')](_0xc0bdff['query']);_0x297ed6[_0xd5ee('0x39')]=_[_0xd5ee('0x3a')](_0x297ed6[_0xd5ee('0x36')],_0x297ed6[_0xd5ee('0x37')]);_0x43de60['attributes']=_['intersection'](_0x297ed6[_0xd5ee('0x36')],qs[_0xd5ee('0x3b')](_0xc0bdff[_0xd5ee('0x37')][_0xd5ee('0x3b')]));_0x43de60[_0xd5ee('0x3c')]=_0x43de60[_0xd5ee('0x3c')][_0xd5ee('0x3d')]?_0x43de60[_0xd5ee('0x3c')]:_0x297ed6[_0xd5ee('0x36')];if(!_0xc0bdff[_0xd5ee('0x37')][_0xd5ee('0x3e')](_0xd5ee('0x3f'))){_0x43de60['limit']=qs[_0xd5ee('0x23')](_0xc0bdff[_0xd5ee('0x37')][_0xd5ee('0x23')]);_0x43de60[_0xd5ee('0x21')]=qs['offset'](_0xc0bdff[_0xd5ee('0x37')]['offset']);}_0x43de60['order']=qs['sort'](_0xc0bdff[_0xd5ee('0x37')]['sort']);_0x43de60[_0xd5ee('0x40')]=qs['filters'](_[_0xd5ee('0x41')](_0xc0bdff['query'],_0x297ed6[_0xd5ee('0x39')]),_0x470b0c);if(_0xc0bdff['query'][_0xd5ee('0x42')]){_0x43de60[_0xd5ee('0x40')]=_[_0xd5ee('0x43')](_0x43de60['where'],{'$or':_[_0xd5ee('0x31')](_0x470b0c,function(_0x51eec0){if(_0x51eec0[_0xd5ee('0x34')]!==_0xd5ee('0x44')){var _0x113b51={};_0x113b51[_0x51eec0[_0xd5ee('0x2e')]]={'$like':'%'+_0xc0bdff[_0xd5ee('0x37')]['filter']+'%'};return _0x113b51;}})});}_0x43de60=_[_0xd5ee('0x43')]({},_0x43de60,_0xc0bdff[_0xd5ee('0x45')]);var _0x2205a5={'where':_0x43de60[_0xd5ee('0x40')]};return db[_0xd5ee('0x32')][_0xd5ee('0x24')](_0x2205a5)[_0xd5ee('0x29')](function(_0x2ece0d){_0x4baa48['count']=_0x2ece0d;if(_0xc0bdff[_0xd5ee('0x37')][_0xd5ee('0x46')]){_0x43de60['include']=[{'all':!![]}];}return db[_0xd5ee('0x32')][_0xd5ee('0x47')](_0x43de60);})[_0xd5ee('0x29')](function(_0x48fba8){_0x4baa48[_0xd5ee('0x48')]=_0x48fba8;return _0x4baa48;})['then'](respondWithFilteredResult(_0x38872e,_0x43de60))[_0xd5ee('0x49')](handleError(_0x38872e,null));};exports[_0xd5ee('0x4a')]=function(_0x5c6b7a,_0xc25167){var _0x48f86b={'raw':!![],'where':{'id':_0x5c6b7a[_0xd5ee('0x4b')]['id']}},_0x4b9402={};_0x4b9402[_0xd5ee('0x36')]=_[_0xd5ee('0x38')](db[_0xd5ee('0x32')][_0xd5ee('0x33')]);_0x4b9402[_0xd5ee('0x37')]=_[_0xd5ee('0x38')](_0x5c6b7a['query']);_0x4b9402[_0xd5ee('0x39')]=_[_0xd5ee('0x3a')](_0x4b9402[_0xd5ee('0x36')],_0x4b9402[_0xd5ee('0x37')]);_0x48f86b[_0xd5ee('0x3c')]=_[_0xd5ee('0x3a')](_0x4b9402[_0xd5ee('0x36')],qs['fields'](_0x5c6b7a[_0xd5ee('0x37')][_0xd5ee('0x3b')]));_0x48f86b[_0xd5ee('0x3c')]=_0x48f86b[_0xd5ee('0x3c')][_0xd5ee('0x3d')]?_0x48f86b[_0xd5ee('0x3c')]:_0x4b9402[_0xd5ee('0x36')];if(_0x5c6b7a[_0xd5ee('0x37')][_0xd5ee('0x46')]){_0x48f86b[_0xd5ee('0x4c')]=[{'all':!![]}];}_0x48f86b=_[_0xd5ee('0x43')]({},_0x48f86b,_0x5c6b7a[_0xd5ee('0x45')]);return db[_0xd5ee('0x32')]['find'](_0x48f86b)[_0xd5ee('0x29')](handleEntityNotFound(_0xc25167,null))[_0xd5ee('0x29')](respondWithResult(_0xc25167,null))[_0xd5ee('0x49')](handleError(_0xc25167,null));};exports['create']=function(_0x51c833,_0x50d2ee){return db['WhatsappQueue'][_0xd5ee('0x4d')](_0x51c833[_0xd5ee('0x4e')],{})[_0xd5ee('0x29')](function(_0x533322){var _0x431727=_0x51c833[_0xd5ee('0x4f')][_0xd5ee('0x50')]({'plain':!![]});if(!_0x431727)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x431727[_0xd5ee('0x51')]==='user'){var _0x226a88=_0x533322[_0xd5ee('0x50')]({'plain':!![]});var _0xb9486e=_0xd5ee('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0xb9486e,'userProfileId':_0x431727[_0xd5ee('0x52')]},'raw':!![]})[_0xd5ee('0x29')](function(_0x58b69d){if(_0x58b69d&&_0x58b69d[_0xd5ee('0x53')]===0x0){return db[_0xd5ee('0x54')][_0xd5ee('0x4d')]({'name':_0x226a88[_0xd5ee('0x2e')],'resourceId':_0x226a88['id'],'type':_0x58b69d[_0xd5ee('0x2e')],'sectionId':_0x58b69d['id']},{})[_0xd5ee('0x29')](function(){return _0x533322;});}else{return _0x533322;}})[_0xd5ee('0x49')](function(_0x11a5a6){logger[_0xd5ee('0x2d')](_0xd5ee('0x55'),_0x11a5a6);throw _0x11a5a6;});}return _0x533322;})['then'](respondWithResult(_0x50d2ee,0xc9))[_0xd5ee('0x49')](handleError(_0x50d2ee,null));};exports['update']=function(_0x527845,_0x5d615e){if(_0x527845['body']['id']){delete _0x527845[_0xd5ee('0x4e')]['id'];}return db['WhatsappQueue'][_0xd5ee('0x56')]({'where':{'id':_0x527845[_0xd5ee('0x4b')]['id']}})[_0xd5ee('0x29')](handleEntityNotFound(_0x5d615e,null))[_0xd5ee('0x29')](saveUpdates(_0x527845[_0xd5ee('0x4e')],null))[_0xd5ee('0x29')](respondWithResult(_0x5d615e,null))[_0xd5ee('0x49')](handleError(_0x5d615e,null));};exports[_0xd5ee('0x2a')]=function(_0x590a15,_0x56ef5b){return db['WhatsappQueue']['find']({'where':{'id':_0x590a15['params']['id']}})[_0xd5ee('0x29')](handleEntityNotFound(_0x56ef5b,null))[_0xd5ee('0x29')](removeEntity(_0x56ef5b,null))[_0xd5ee('0x49')](handleError(_0x56ef5b,null));};exports[_0xd5ee('0x57')]=function(_0x10d20d,_0x1da7fe){return db[_0xd5ee('0x32')][_0xd5ee('0x57')]()[_0xd5ee('0x29')](respondWithResult(_0x1da7fe,null))['catch'](handleError(_0x1da7fe,null));};exports[_0xd5ee('0x58')]=function(_0x2b16ee,_0x1d237b,_0x47002b){var _0x473cb0={'raw':!![],'where':{}},_0x1375d3={},_0x12c539;return db[_0xd5ee('0x32')]['findOne']({'where':{'id':_0x2b16ee[_0xd5ee('0x4b')]['id']}})[_0xd5ee('0x29')](handleEntityNotFound(_0x1d237b,null))['then'](function(_0x354865){if(_0x354865){_0x12c539=_0x354865['get']({'plain':!![]});_0x1375d3[_0xd5ee('0x36')]=_[_0xd5ee('0x38')](db[_0xd5ee('0x59')][_0xd5ee('0x33')]);_0x1375d3[_0xd5ee('0x37')]=_[_0xd5ee('0x38')](_0x2b16ee[_0xd5ee('0x37')]);_0x1375d3[_0xd5ee('0x39')]=_[_0xd5ee('0x3a')](_0x1375d3[_0xd5ee('0x36')],_0x1375d3[_0xd5ee('0x37')]);_0x473cb0[_0xd5ee('0x3c')]=_[_0xd5ee('0x3a')](_0x1375d3[_0xd5ee('0x36')],qs['fields'](_0x2b16ee[_0xd5ee('0x37')][_0xd5ee('0x3b')]));_0x473cb0[_0xd5ee('0x3c')]=_0x473cb0['attributes']['length']?_0x473cb0[_0xd5ee('0x3c')]:_0x1375d3[_0xd5ee('0x36')];if(!_0x2b16ee[_0xd5ee('0x37')][_0xd5ee('0x3e')](_0xd5ee('0x3f'))){_0x473cb0['limit']=qs[_0xd5ee('0x23')](_0x2b16ee[_0xd5ee('0x37')][_0xd5ee('0x23')]);_0x473cb0[_0xd5ee('0x21')]=qs[_0xd5ee('0x21')](_0x2b16ee[_0xd5ee('0x37')][_0xd5ee('0x21')]);}_0x473cb0[_0xd5ee('0x5a')]=qs[_0xd5ee('0x5b')](_0x2b16ee[_0xd5ee('0x37')][_0xd5ee('0x5b')]);_0x473cb0[_0xd5ee('0x40')]=qs['filters'](_[_0xd5ee('0x41')](_0x2b16ee[_0xd5ee('0x37')],_0x1375d3[_0xd5ee('0x39')]));_0x473cb0[_0xd5ee('0x40')]['WhatsappQueueId']=_0x354865['id'];if(_0x2b16ee['query']['filter']){_0x473cb0['where']=_[_0xd5ee('0x43')](_0x473cb0[_0xd5ee('0x40')],{'$or':_[_0xd5ee('0x31')](_0x473cb0[_0xd5ee('0x3c')],function(_0x24dc68){var _0xf3a824={};_0xf3a824[_0x24dc68]={'$like':'%'+_0x2b16ee[_0xd5ee('0x37')][_0xd5ee('0x42')]+'%'};return _0xf3a824;})});}_0x473cb0=_['merge']({},_0x473cb0,_0x2b16ee[_0xd5ee('0x45')]);return db['UserWhatsappQueue'][_0xd5ee('0x47')](_0x473cb0);}})[_0xd5ee('0x29')](function(_0x290c93){if(_0x290c93){return db[_0xd5ee('0x5c')][_0xd5ee('0x5d')]({'where':{'id':_[_0xd5ee('0x31')](_0x290c93,_0xd5ee('0x5e')),'role':_0xd5ee('0x5f')},'attributes':['id',_0xd5ee('0x2e'),'whatsappPause',_0xd5ee('0x60'),_0xd5ee('0x61')]});}})['then'](function(_0x443d96){if(_0x443d96){return{'count':_0x443d96['count'],'rows':_[_0xd5ee('0x31')](_0x443d96[_0xd5ee('0x48')],function(_0x2f9f78){return{'membername':_0x2f9f78[_0xd5ee('0x2e')],'UserId':_0x2f9f78['id'],'queue_name':_0x12c539[_0xd5ee('0x2e')],'WhatsappQueueId':_0x12c539['id'],'interface':util[_0xd5ee('0x62')](_0xd5ee('0x63'),'SIP',_0x2f9f78[_0xd5ee('0x2e')]),'penalty':0x0,'paused':_0x2f9f78[_0xd5ee('0x64')],'createdAt':_0x2f9f78['createdAt'],'updatedAt':_0x2f9f78[_0xd5ee('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd5ee('0x29')](respondWithFilteredResult(_0x1d237b,_0x473cb0))['catch'](handleError(_0x1d237b,null));};exports['getTeams']=function(_0x33b7fc,_0x1fc32f,_0x17dc6a){var _0x4ba5c5={};var _0x325e2d={};var _0x489de8;var _0xd23ec3;return db[_0xd5ee('0x32')]['findOne']({'where':{'id':_0x33b7fc[_0xd5ee('0x4b')]['id']}})[_0xd5ee('0x29')](handleEntityNotFound(_0x1fc32f,null))[_0xd5ee('0x29')](function(_0x139c06){if(_0x139c06){_0x489de8=_0x139c06;_0x325e2d[_0xd5ee('0x36')]=_[_0xd5ee('0x38')](db[_0xd5ee('0x65')][_0xd5ee('0x33')]);_0x325e2d['query']=_[_0xd5ee('0x38')](_0x33b7fc['query']);_0x325e2d[_0xd5ee('0x39')]=_[_0xd5ee('0x3a')](_0x325e2d[_0xd5ee('0x36')],_0x325e2d[_0xd5ee('0x37')]);_0x4ba5c5[_0xd5ee('0x3c')]=_['intersection'](_0x325e2d['model'],qs['fields'](_0x33b7fc[_0xd5ee('0x37')][_0xd5ee('0x3b')]));_0x4ba5c5[_0xd5ee('0x3c')]=_0x4ba5c5['attributes'][_0xd5ee('0x3d')]?_0x4ba5c5[_0xd5ee('0x3c')]:_0x325e2d[_0xd5ee('0x36')];_0x4ba5c5['order']=qs[_0xd5ee('0x5b')](_0x33b7fc[_0xd5ee('0x37')][_0xd5ee('0x5b')]);_0x4ba5c5[_0xd5ee('0x40')]=qs[_0xd5ee('0x39')](_[_0xd5ee('0x41')](_0x33b7fc[_0xd5ee('0x37')],_0x325e2d['filters']));if(_0x33b7fc[_0xd5ee('0x37')][_0xd5ee('0x42')]){_0x4ba5c5['where']=_[_0xd5ee('0x43')](_0x4ba5c5[_0xd5ee('0x40')],{'$or':_[_0xd5ee('0x31')](_0x4ba5c5['attributes'],function(_0x348b94){var _0x454388={};_0x454388[_0x348b94]={'$like':'%'+_0x33b7fc[_0xd5ee('0x37')][_0xd5ee('0x42')]+'%'};return _0x454388;})});}_0x4ba5c5=_[_0xd5ee('0x43')]({},_0x4ba5c5,_0x33b7fc[_0xd5ee('0x45')]);return _0x489de8[_0xd5ee('0x66')](_0x4ba5c5);}})[_0xd5ee('0x29')](function(_0x15d000){if(_0x15d000){_0xd23ec3=_0x15d000[_0xd5ee('0x3d')];if(!_0x33b7fc[_0xd5ee('0x37')]['hasOwnProperty']('nolimit')){_0x4ba5c5[_0xd5ee('0x23')]=qs['limit'](_0x33b7fc[_0xd5ee('0x37')][_0xd5ee('0x23')]);_0x4ba5c5[_0xd5ee('0x21')]=qs['offset'](_0x33b7fc['query'][_0xd5ee('0x21')]);}return _0x489de8[_0xd5ee('0x66')](_0x4ba5c5);}})[_0xd5ee('0x29')](function(_0x400436){if(_0x400436){return _0x400436?{'count':_0xd23ec3,'rows':_0x400436}:null;}})[_0xd5ee('0x29')](respondWithResult(_0x1fc32f,null))[_0xd5ee('0x49')](handleError(_0x1fc32f,null));};exports[_0xd5ee('0x67')]=function(_0x5a21be,_0x384014,_0xe8ae1b){var _0xf9971d=_0x5a21be[_0xd5ee('0x4e')]['ids'];return db[_0xd5ee('0x65')][_0xd5ee('0x47')]({'where':{'id':_0xf9971d},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online',_0xd5ee('0x68'),_0xd5ee('0x69')],'raw':!![]}]})['then'](function(_0x2e635d){if(_0x2e635d){var _0x4c2e89=_[_0xd5ee('0x6a')](_0x2e635d,function(_0x530917){var _0x453948=_0x530917[_0xd5ee('0x50')]({'plain':!![]});return _0x453948[_0xd5ee('0x6b')];});return db[_0xd5ee('0x32')][_0xd5ee('0x56')]({'where':{'id':_0x5a21be[_0xd5ee('0x4b')]['id']}})[_0xd5ee('0x29')](function(_0x1f6c02){return db[_0xd5ee('0x6c')][_0xd5ee('0x6d')](function(_0x4ae40e){return _0x1f6c02['addTeams'](_0xf9971d,{'transaction':_0x4ae40e})['then'](function(){return BPromise[_0xd5ee('0x6e')](_0x4c2e89,function(_0x31ff1f){return db[_0xd5ee('0x59')][_0xd5ee('0x6f')]({'where':{'UserId':_0x31ff1f['id'],'WhatsappQueueId':_0x5a21be['params']['id']},'transaction':_0x4ae40e});});})[_0xd5ee('0x29')](function(){_0x4c2e89[_0xd5ee('0x70')](function(_0x47d091){socket[_0xd5ee('0x71')]('userWhatsappQueue:save',{'UserId':_0x47d091['id'],'WhatsappQueueId':_0x1f6c02['id']});});});});});}})[_0xd5ee('0x29')](respondWithStatusCode(_0x384014,null))[_0xd5ee('0x49')](handleError(_0x384014,null));};exports[_0xd5ee('0x72')]=function(_0x4f23f0,_0x22b4f8,_0x1921a9){return db[_0xd5ee('0x65')][_0xd5ee('0x47')]({'where':{'id':_0x4f23f0['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xd5ee('0x5c')],'as':_0xd5ee('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x22b4f8,null))['then'](function(_0x2a097b){var _0x49a1fc=_['map'](_0x2a097b,'id');var _0x507f14=[];var _0x181523=[];var _0x3751e6=squel[_0xd5ee('0x73')]();_0x3751e6[_0xd5ee('0x74')]('tq.TeamId')['from'](_0xd5ee('0x75'),'tq')[_0xd5ee('0x76')](_0xd5ee('0x77'),'ut',_0xd5ee('0x78'))[_0xd5ee('0x40')]('WhatsappQueueId\x20=\x20?',_0x4f23f0[_0xd5ee('0x4b')]['id']);for(var _0x591f01=0x0;_0x591f01<_0x2a097b['length'];_0x591f01+=0x1){let _0x4082b6=_0x2a097b[_0x591f01];for(var _0x3e93b5=0x0;_0x3e93b5<_0x4082b6[_0xd5ee('0x6b')]['length'];_0x3e93b5+=0x1){let _0x14aa5f=_0x4082b6[_0xd5ee('0x6b')][_0x3e93b5];var _0x5ca7bb=_0x3751e6[_0xd5ee('0x79')]();_0x5ca7bb[_0xd5ee('0x40')](_0xd5ee('0x7a'),_0x14aa5f['id']);_0x181523['push'](db['sequelize'][_0xd5ee('0x37')](_0x5ca7bb[_0xd5ee('0x7b')](),{'type':db['sequelize'][_0xd5ee('0x7c')][_0xd5ee('0x7d')]})[_0xd5ee('0x29')](function(_0x16282f){if(_0x16282f[_0xd5ee('0x3d')]===0x1){return _0x14aa5f['id'];}else{var _0x562124=_[_0xd5ee('0x7e')](_[_0xd5ee('0x31')](_0x16282f,'TeamId'),function(_0x1f57e6){return _[_0xd5ee('0x7f')](_0x49a1fc,_0x1f57e6);});if(_0x562124){return _0x14aa5f['id'];}}}));}}return BPromise[_0xd5ee('0x80')](_0x181523)['then'](function(_0x532034){_0x507f14=_(_0x507f14)[_0xd5ee('0x81')](_0x532034)[_0xd5ee('0x82')]()[_0xd5ee('0x83')]();return db[_0xd5ee('0x32')][_0xd5ee('0x56')]({'where':{'id':_0x4f23f0[_0xd5ee('0x4b')]['id']}})[_0xd5ee('0x29')](function(_0x2e31f3){return db['sequelize'][_0xd5ee('0x6d')](function(_0x49044c){return _0x2e31f3[_0xd5ee('0x72')](_0x4f23f0[_0xd5ee('0x37')][_0xd5ee('0x84')],{'transaction':_0x49044c})[_0xd5ee('0x29')](function(){if(!_[_0xd5ee('0x85')](_0x507f14)){return _0x2e31f3[_0xd5ee('0x86')](_0x507f14,{'transaction':_0x49044c});}})[_0xd5ee('0x29')](function(){_0x507f14[_0xd5ee('0x70')](function(_0x58f0cc){socket[_0xd5ee('0x71')]('userWhatsappQueue:remove',{'UserId':_0x58f0cc,'WhatsappQueueId':_0x2e31f3['id']});});});});});});})['then'](respondWithStatusCode(_0x22b4f8,null))['catch'](handleError(_0x22b4f8,null));};exports[_0xd5ee('0x87')]=function(_0x1b7e69,_0x1f05a2,_0x734652){return db[_0xd5ee('0x32')][_0xd5ee('0x56')]({'where':{'id':_0x1b7e69[_0xd5ee('0x4b')]['id']}})[_0xd5ee('0x29')](handleEntityNotFound(_0x1f05a2,null))[_0xd5ee('0x29')](function(_0x339ea0){if(_0x339ea0){return _0x339ea0['addAgents'](_0x1b7e69['body'][_0xd5ee('0x84')],_[_0xd5ee('0x88')](_0x1b7e69[_0xd5ee('0x4e')],[_0xd5ee('0x84'),'id'])||{})[_0xd5ee('0x89')](function(_0x410039){for(var _0x1ee333=0x0;_0x1ee333<_0x1b7e69[_0xd5ee('0x4e')][_0xd5ee('0x84')][_0xd5ee('0x3d')];_0x1ee333+=0x1){socket[_0xd5ee('0x71')]('userWhatsappQueue:save',{'UserId':Number(_0x1b7e69[_0xd5ee('0x4e')][_0xd5ee('0x84')][_0x1ee333]),'WhatsappQueueId':Number(_0x1b7e69[_0xd5ee('0x4b')]['id'])});}return _0x410039;});}})[_0xd5ee('0x29')](respondWithResult(_0x1f05a2,null))[_0xd5ee('0x49')](handleError(_0x1f05a2,null));};exports[_0xd5ee('0x86')]=function(_0x5481f0,_0x154179,_0x36b38){return db[_0xd5ee('0x32')][_0xd5ee('0x56')]({'where':{'id':_0x5481f0['params']['id']}})[_0xd5ee('0x29')](handleEntityNotFound(_0x154179,null))[_0xd5ee('0x29')](function(_0x48b7cd){if(_0x48b7cd){return _0x48b7cd[_0xd5ee('0x86')](_0x5481f0[_0xd5ee('0x37')]['ids'])[_0xd5ee('0x29')](function(){if(_['isArray'](_0x5481f0[_0xd5ee('0x37')][_0xd5ee('0x84')])){for(var _0x501252=0x0;_0x501252<_0x5481f0[_0xd5ee('0x37')][_0xd5ee('0x84')][_0xd5ee('0x3d')];_0x501252+=0x1){socket[_0xd5ee('0x71')](_0xd5ee('0x8a'),{'UserId':Number(_0x5481f0[_0xd5ee('0x37')][_0xd5ee('0x84')][_0x501252]),'WhatsappQueueId':Number(_0x5481f0[_0xd5ee('0x4b')]['id'])});}}else{socket[_0xd5ee('0x71')](_0xd5ee('0x8a'),{'UserId':Number(_0x5481f0['query'][_0xd5ee('0x84')]),'WhatsappQueueId':Number(_0x5481f0[_0xd5ee('0x4b')]['id'])});}});}})[_0xd5ee('0x29')](respondWithStatusCode(_0x154179,null))['catch'](handleError(_0x154179,null));};exports[_0xd5ee('0x8b')]=function(_0x215efd,_0x40bc63,_0x366af3){var _0x160e6b={};var _0x4f9630={};var _0x1e8cd0;var _0x120c3f;return db[_0xd5ee('0x32')]['findOne']({'where':{'id':_0x215efd[_0xd5ee('0x4b')]['id']}})[_0xd5ee('0x29')](handleEntityNotFound(_0x40bc63,null))[_0xd5ee('0x29')](function(_0x1d23d6){if(_0x1d23d6){_0x1e8cd0=_0x1d23d6;_0x4f9630[_0xd5ee('0x36')]=_['keys'](db['User'][_0xd5ee('0x33')]);_0x4f9630[_0xd5ee('0x37')]=_[_0xd5ee('0x38')](_0x215efd[_0xd5ee('0x37')]);_0x4f9630['filters']=_[_0xd5ee('0x3a')](_0x4f9630[_0xd5ee('0x36')],_0x4f9630['query']);_0x160e6b[_0xd5ee('0x3c')]=_['intersection'](_0x4f9630[_0xd5ee('0x36')],qs[_0xd5ee('0x3b')](_0x215efd[_0xd5ee('0x37')][_0xd5ee('0x3b')]));_0x160e6b[_0xd5ee('0x3c')]=_0x160e6b[_0xd5ee('0x3c')]['length']?_0x160e6b[_0xd5ee('0x3c')]:_0x4f9630[_0xd5ee('0x36')];_0x160e6b[_0xd5ee('0x5a')]=qs['sort'](_0x215efd[_0xd5ee('0x37')][_0xd5ee('0x5b')]);_0x160e6b['where']=qs[_0xd5ee('0x39')](_[_0xd5ee('0x41')](_0x215efd[_0xd5ee('0x37')],_0x4f9630[_0xd5ee('0x39')]));if(_0x215efd[_0xd5ee('0x37')][_0xd5ee('0x42')]){_0x160e6b[_0xd5ee('0x40')]=_[_0xd5ee('0x43')](_0x160e6b[_0xd5ee('0x40')],{'$or':_[_0xd5ee('0x31')](_0x160e6b['attributes'],function(_0x55eb29){var _0x2d03c9={};_0x2d03c9[_0x55eb29]={'$like':'%'+_0x215efd[_0xd5ee('0x37')]['filter']+'%'};return _0x2d03c9;})});}_0x160e6b=_['merge']({},_0x160e6b,_0x215efd[_0xd5ee('0x45')]);return _0x1e8cd0['getAgents'](_0x160e6b);}})['then'](function(_0x4a8056){if(_0x4a8056){_0x120c3f=_0x4a8056[_0xd5ee('0x3d')];if(!_0x215efd[_0xd5ee('0x37')]['hasOwnProperty'](_0xd5ee('0x3f'))){_0x160e6b[_0xd5ee('0x23')]=qs[_0xd5ee('0x23')](_0x215efd[_0xd5ee('0x37')]['limit']);_0x160e6b[_0xd5ee('0x21')]=qs[_0xd5ee('0x21')](_0x215efd['query'][_0xd5ee('0x21')]);}return _0x1e8cd0['getAgents'](_0x160e6b);}})[_0xd5ee('0x29')](function(_0x219f80){if(_0x219f80){return _0x219f80?{'count':_0x120c3f,'rows':_0x219f80}:null;}})[_0xd5ee('0x29')](respondWithResult(_0x40bc63,null))[_0xd5ee('0x49')](handleError(_0x40bc63,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 1fd12f6..3766940 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 _0x6120=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','save','update','emit'];(function(_0x4259fb,_0x5e707b){var _0x39b86c=function(_0x5297db){while(--_0x5297db){_0x4259fb['push'](_0x4259fb['shift']());}};_0x39b86c(++_0x5e707b);}(_0x6120,0x16b));var _0x0612=function(_0x5b12b3,_0x7bdc08){_0x5b12b3=_0x5b12b3-0x0;var _0x4be85f=_0x6120[_0x5b12b3];return _0x4be85f;};'use strict';var EventEmitter=require(_0x0612('0x0'));var WhatsappQueue=require(_0x0612('0x1'))['db'][_0x0612('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0612('0x3'),'afterUpdate':_0x0612('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3fc95f){return function(_0x2f814f,_0x4e6033,_0x4ea3bb){WhatsappQueueEvents[_0x0612('0x5')](_0x3fc95f+':'+_0x2f814f['id'],_0x2f814f);WhatsappQueueEvents[_0x0612('0x5')](_0x3fc95f,_0x2f814f);_0x4ea3bb(null);};}for(var e in events){if(events[_0x0612('0x6')](e)){var event=events[e];WhatsappQueue[_0x0612('0x7')](e,emitEvent(event));}}module[_0x0612('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0xbb4f=['../../mysqldb','WhatsappQueue','setMaxListeners','update','remove','emit','hasOwnProperty','events'];(function(_0x5eb6a7,_0xd80ead){var _0x4adcc0=function(_0x34b3ad){while(--_0x34b3ad){_0x5eb6a7['push'](_0x5eb6a7['shift']());}};_0x4adcc0(++_0xd80ead);}(_0xbb4f,0xf7));var _0xfbb4=function(_0xbaf9b,_0x13a3a3){_0xbaf9b=_0xbaf9b-0x0;var _0x28c4e7=_0xbb4f[_0xbaf9b];return _0x28c4e7;};'use strict';var EventEmitter=require(_0xfbb4('0x0'));var WhatsappQueue=require(_0xfbb4('0x1'))['db'][_0xfbb4('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xfbb4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfbb4('0x4'),'afterDestroy':_0xfbb4('0x5')};function emitEvent(_0x4c47ec){return function(_0x84a504,_0x5a10a1,_0x4bf539){WhatsappQueueEvents[_0xfbb4('0x6')](_0x4c47ec+':'+_0x84a504['id'],_0x84a504);WhatsappQueueEvents[_0xfbb4('0x6')](_0x4c47ec,_0x84a504);_0x4bf539(null);};}for(var e in events){if(events[_0xfbb4('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 27882b8..6f0a560 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 _0xaced=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueue.attributes','WhatsappQueue','whatsapp_queues','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaced,0xdb));var _0xdace=function(_0x11361e,_0xe24745){_0x11361e=_0x11361e-0x0;var _0x2fd67f=_0xaced[_0x11361e];return _0x2fd67f;};'use strict';var _=require('lodash');var util=require(_0xdace('0x0'));var logger=require(_0xdace('0x1'))('api');var moment=require(_0xdace('0x2'));var BPromise=require(_0xdace('0x3'));var rp=require(_0xdace('0x4'));var fs=require('fs');var path=require(_0xdace('0x5'));var rimraf=require('rimraf');var config=require(_0xdace('0x6'));var attributes=require(_0xdace('0x7'));module['exports']=function(_0x34ed3f,_0x1e70af){return _0x34ed3f['define'](_0xdace('0x8'),attributes,{'tableName':_0xdace('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ba4=['WhatsappQueue','whatsapp_queues','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x24d867,_0x5d28fb){var _0x36079b=function(_0x31e7be){while(--_0x31e7be){_0x24d867['push'](_0x24d867['shift']());}};_0x36079b(++_0x5d28fb);}(_0x5ba4,0x110));var _0x45ba=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x5ba4[_0x33032e];return _0x13316b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x45ba('0x0'))(_0x45ba('0x1'));var moment=require(_0x45ba('0x2'));var BPromise=require(_0x45ba('0x3'));var rp=require(_0x45ba('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x45ba('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module[_0x45ba('0x6')]=function(_0x39c601,_0x35bbca){return _0x39c601[_0x45ba('0x7')](_0x45ba('0x8'),attributes,{'tableName':_0x45ba('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 d607cd5..5355618 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 _0x5650=['rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','options','raw','attributes','limit','map','include','model','GetWhatsappQueue','stringify','ShowWhatsappQueue','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x13a3cb,_0x3373fc){var _0x293f42=function(_0x381779){while(--_0x381779){_0x13a3cb['push'](_0x13a3cb['shift']());}};_0x293f42(++_0x3373fc);}(_0x5650,0x190));var _0x0565=function(_0x34a47b,_0x109857){_0x34a47b=_0x34a47b-0x0;var _0x3bd3d7=_0x5650[_0x34a47b];return _0x3bd3d7;};'use strict';var _=require(_0x0565('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0565('0x1'));var rs=require(_0x0565('0x2'));var fs=require('fs');var Redis=require(_0x0565('0x3'));var db=require(_0x0565('0x4'))['db'];var utils=require(_0x0565('0x5'));var logger=require(_0x0565('0x6'))(_0x0565('0x7'));var config=require('../../config/environment');var jayson=require(_0x0565('0x8'));var client=jayson[_0x0565('0x9')][_0x0565('0xa')]({'port':0x232a});config['redis']=_[_0x0565('0xb')](config[_0x0565('0xc')],{'host':_0x0565('0xd'),'port':0x18eb});var socket=require(_0x0565('0xe'))(new Redis(config[_0x0565('0xc')]));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0xd546ab,_0x4bcced,_0x426275){return new BPromise(function(_0x297a72,_0xa6eb05){return client[_0x0565('0xf')](_0xd546ab,_0x426275)[_0x0565('0x10')](function(_0x5a27ac){logger['info'](_0x0565('0x11'),_0x4bcced,_0x0565('0x12'));logger[_0x0565('0x13')](_0x0565('0x14'),_0x4bcced,'request\x20sent',JSON['stringify'](_0x5a27ac));if(_0x5a27ac[_0x0565('0x15')]){if(_0x5a27ac[_0x0565('0x15')][_0x0565('0x16')]===0x1f4){logger[_0x0565('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x4bcced,_0x5a27ac[_0x0565('0x15')][_0x0565('0x17')]);return _0xa6eb05(_0x5a27ac[_0x0565('0x15')][_0x0565('0x17')]);}logger[_0x0565('0x15')](_0x0565('0x11'),_0x4bcced,_0x5a27ac['error'][_0x0565('0x17')]);return _0x297a72(_0x5a27ac['error'][_0x0565('0x17')]);}else{logger[_0x0565('0x18')](_0x0565('0x11'),_0x4bcced,_0x0565('0x12'));_0x297a72(_0x5a27ac[_0x0565('0x19')]['message']);}})[_0x0565('0x1a')](function(_0x10ac7a){logger['error'](_0x0565('0x11'),_0x4bcced,_0x10ac7a);_0xa6eb05(_0x10ac7a);});});}exports['GetWhatsappQueue']=function(_0x25e87a){var _0x406f61=this;return new Promise(function(_0x17fdba,_0x45d5f6){return db['WhatsappQueue']['findAll']({'raw':_0x25e87a[_0x0565('0x1b')]?_0x25e87a[_0x0565('0x1b')][_0x0565('0x1c')]===undefined?!![]:![]:!![],'where':_0x25e87a[_0x0565('0x1b')]?_0x25e87a[_0x0565('0x1b')]['where']||null:null,'attributes':_0x25e87a['options']?_0x25e87a['options'][_0x0565('0x1d')]||null:null,'limit':_0x25e87a[_0x0565('0x1b')]?_0x25e87a[_0x0565('0x1b')][_0x0565('0x1e')]||null:null,'include':_0x25e87a[_0x0565('0x1b')]?_0x25e87a[_0x0565('0x1b')]['include']?_[_0x0565('0x1f')](_0x25e87a[_0x0565('0x1b')][_0x0565('0x20')],function(_0x5356df){return{'model':db[_0x5356df[_0x0565('0x21')]],'as':_0x5356df['as'],'attributes':_0x5356df[_0x0565('0x1d')],'include':_0x5356df['include']?_['map'](_0x5356df[_0x0565('0x20')],function(_0x2a1eeb){return{'model':db[_0x2a1eeb['model']],'as':_0x2a1eeb['as'],'attributes':_0x2a1eeb[_0x0565('0x1d')],'include':_0x2a1eeb[_0x0565('0x20')]?_[_0x0565('0x1f')](_0x2a1eeb[_0x0565('0x20')],function(_0x3d54bc){return{'model':db[_0x3d54bc[_0x0565('0x21')]],'as':_0x3d54bc['as'],'attributes':_0x3d54bc[_0x0565('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0565('0x10')](function(_0x1c991a){logger['info'](_0x0565('0x22'),_0x25e87a);logger[_0x0565('0x13')](_0x0565('0x22'),_0x25e87a,JSON[_0x0565('0x23')](_0x1c991a));_0x17fdba(_0x1c991a);})[_0x0565('0x1a')](function(_0xd1d56a){logger[_0x0565('0x15')](_0x0565('0x22'),_0xd1d56a['message'],_0x25e87a);_0x45d5f6(_0x406f61[_0x0565('0x15')](0x1f4,_0xd1d56a['message']));});});};exports[_0x0565('0x24')]=function(_0x55b8bd){var _0x35f2e7=this;return new Promise(function(_0x4f3665,_0x5f4c14){return db['WhatsappQueue']['find']({'raw':_0x55b8bd['options']?_0x55b8bd[_0x0565('0x1b')][_0x0565('0x1c')]===undefined?!![]:![]:!![],'where':_0x55b8bd[_0x0565('0x1b')]?_0x55b8bd['options']['where']||null:null,'attributes':_0x55b8bd[_0x0565('0x1b')]?_0x55b8bd[_0x0565('0x1b')][_0x0565('0x1d')]||null:null,'include':_0x55b8bd[_0x0565('0x1b')]?_0x55b8bd[_0x0565('0x1b')]['include']?_['map'](_0x55b8bd[_0x0565('0x1b')][_0x0565('0x20')],function(_0x76ec7f){return{'model':db[_0x76ec7f[_0x0565('0x21')]],'as':_0x76ec7f['as'],'attributes':_0x76ec7f[_0x0565('0x1d')],'include':_0x76ec7f[_0x0565('0x20')]?_[_0x0565('0x1f')](_0x76ec7f[_0x0565('0x20')],function(_0x1a9e94){return{'model':db[_0x1a9e94[_0x0565('0x21')]],'as':_0x1a9e94['as'],'attributes':_0x1a9e94[_0x0565('0x1d')],'include':_0x1a9e94[_0x0565('0x20')]?_[_0x0565('0x1f')](_0x1a9e94[_0x0565('0x20')],function(_0x2ad3a4){return{'model':db[_0x2ad3a4[_0x0565('0x21')]],'as':_0x2ad3a4['as'],'attributes':_0x2ad3a4[_0x0565('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0565('0x10')](function(_0x5909e2){logger[_0x0565('0x18')](_0x0565('0x24'),_0x55b8bd);logger[_0x0565('0x13')](_0x0565('0x24'),_0x55b8bd,JSON[_0x0565('0x23')](_0x5909e2));_0x4f3665(_0x5909e2);})[_0x0565('0x1a')](function(_0x54bbbc){logger[_0x0565('0x15')]('ShowWhatsappQueue',_0x54bbbc[_0x0565('0x17')],_0x55b8bd);_0x5f4c14(_0x35f2e7['error'](0x1f4,_0x54bbbc[_0x0565('0x17')]));});});}; \ No newline at end of file +var _0x4272=['debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetWhatsappQueue','WhatsappQueue','options','attributes','include','map','model','then','catch','find','raw','where','ShowWhatsappQueue','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./whatsappQueue.socket','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x4272,0xbd));var _0x2427=function(_0x54f822,_0xb558d8){_0x54f822=_0x54f822-0x0;var _0x1d631d=_0x4272[_0x54f822];return _0x1d631d;};'use strict';var _=require('lodash');var util=require(_0x2427('0x0'));var moment=require('moment');var BPromise=require(_0x2427('0x1'));var rs=require(_0x2427('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2427('0x3'));var logger=require(_0x2427('0x4'))('rpc');var config=require(_0x2427('0x5'));var jayson=require(_0x2427('0x6'));var client=jayson[_0x2427('0x7')][_0x2427('0x8')]({'port':0x232a});config[_0x2427('0x9')]=_['defaults'](config[_0x2427('0x9')],{'host':_0x2427('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2427('0x9')]));require(_0x2427('0xb'))['register'](socket);function respondWithRpcPromise(_0x2cba4f,_0x275678,_0x1f5406){return new BPromise(function(_0x29e540,_0x53e2ee){return client['request'](_0x2cba4f,_0x1f5406)['then'](function(_0x5458ca){logger[_0x2427('0xc')](_0x2427('0xd'),_0x275678,_0x2427('0xe'));logger[_0x2427('0xf')](_0x2427('0x10'),_0x275678,_0x2427('0xe'),JSON[_0x2427('0x11')](_0x5458ca));if(_0x5458ca[_0x2427('0x12')]){if(_0x5458ca[_0x2427('0x12')]['code']===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x275678,_0x5458ca['error'][_0x2427('0x13')]);return _0x53e2ee(_0x5458ca[_0x2427('0x12')][_0x2427('0x13')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x275678,_0x5458ca[_0x2427('0x12')][_0x2427('0x13')]);return _0x29e540(_0x5458ca[_0x2427('0x12')][_0x2427('0x13')]);}else{logger[_0x2427('0xc')]('WhatsappQueue,\x20%s,\x20%s',_0x275678,_0x2427('0xe'));_0x29e540(_0x5458ca[_0x2427('0x14')][_0x2427('0x13')]);}})['catch'](function(_0xd00221){logger[_0x2427('0x12')](_0x2427('0xd'),_0x275678,_0xd00221);_0x53e2ee(_0xd00221);});});}exports[_0x2427('0x15')]=function(_0xe98f00){var _0x20e6c1=this;return new Promise(function(_0x3fdde2,_0x4c26e8){return db[_0x2427('0x16')]['findAll']({'raw':_0xe98f00[_0x2427('0x17')]?_0xe98f00[_0x2427('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xe98f00[_0x2427('0x17')]?_0xe98f00[_0x2427('0x17')]['where']||null:null,'attributes':_0xe98f00[_0x2427('0x17')]?_0xe98f00[_0x2427('0x17')][_0x2427('0x18')]||null:null,'limit':_0xe98f00[_0x2427('0x17')]?_0xe98f00['options']['limit']||null:null,'include':_0xe98f00[_0x2427('0x17')]?_0xe98f00[_0x2427('0x17')][_0x2427('0x19')]?_[_0x2427('0x1a')](_0xe98f00[_0x2427('0x17')][_0x2427('0x19')],function(_0x2fdccb){return{'model':db[_0x2fdccb[_0x2427('0x1b')]],'as':_0x2fdccb['as'],'attributes':_0x2fdccb['attributes'],'include':_0x2fdccb[_0x2427('0x19')]?_[_0x2427('0x1a')](_0x2fdccb[_0x2427('0x19')],function(_0x1e0490){return{'model':db[_0x1e0490[_0x2427('0x1b')]],'as':_0x1e0490['as'],'attributes':_0x1e0490[_0x2427('0x18')],'include':_0x1e0490[_0x2427('0x19')]?_[_0x2427('0x1a')](_0x1e0490[_0x2427('0x19')],function(_0x387455){return{'model':db[_0x387455[_0x2427('0x1b')]],'as':_0x387455['as'],'attributes':_0x387455['attributes']};}):[]};}):[]};}):[]:[]})[_0x2427('0x1c')](function(_0x4860be){logger[_0x2427('0xc')]('GetWhatsappQueue',_0xe98f00);logger[_0x2427('0xf')](_0x2427('0x15'),_0xe98f00,JSON[_0x2427('0x11')](_0x4860be));_0x3fdde2(_0x4860be);})[_0x2427('0x1d')](function(_0x1c4717){logger[_0x2427('0x12')](_0x2427('0x15'),_0x1c4717[_0x2427('0x13')],_0xe98f00);_0x4c26e8(_0x20e6c1['error'](0x1f4,_0x1c4717[_0x2427('0x13')]));});});};exports['ShowWhatsappQueue']=function(_0x5f01ab){var _0x3d59bb=this;return new Promise(function(_0x2e9acc,_0x5eccb4){return db['WhatsappQueue'][_0x2427('0x1e')]({'raw':_0x5f01ab[_0x2427('0x17')]?_0x5f01ab[_0x2427('0x17')][_0x2427('0x1f')]===undefined?!![]:![]:!![],'where':_0x5f01ab[_0x2427('0x17')]?_0x5f01ab['options'][_0x2427('0x20')]||null:null,'attributes':_0x5f01ab['options']?_0x5f01ab[_0x2427('0x17')][_0x2427('0x18')]||null:null,'include':_0x5f01ab[_0x2427('0x17')]?_0x5f01ab[_0x2427('0x17')][_0x2427('0x19')]?_[_0x2427('0x1a')](_0x5f01ab[_0x2427('0x17')][_0x2427('0x19')],function(_0x340a18){return{'model':db[_0x340a18['model']],'as':_0x340a18['as'],'attributes':_0x340a18[_0x2427('0x18')],'include':_0x340a18[_0x2427('0x19')]?_['map'](_0x340a18[_0x2427('0x19')],function(_0x4fbcc6){return{'model':db[_0x4fbcc6[_0x2427('0x1b')]],'as':_0x4fbcc6['as'],'attributes':_0x4fbcc6[_0x2427('0x18')],'include':_0x4fbcc6[_0x2427('0x19')]?_[_0x2427('0x1a')](_0x4fbcc6[_0x2427('0x19')],function(_0x333053){return{'model':db[_0x333053[_0x2427('0x1b')]],'as':_0x333053['as'],'attributes':_0x333053['attributes']};}):[]};}):[]};}):[]:[]})[_0x2427('0x1c')](function(_0x2157f5){logger[_0x2427('0xc')](_0x2427('0x21'),_0x5f01ab);logger[_0x2427('0xf')]('ShowWhatsappQueue',_0x5f01ab,JSON[_0x2427('0x11')](_0x2157f5));_0x2e9acc(_0x2157f5);})[_0x2427('0x1d')](function(_0x161509){logger[_0x2427('0x12')](_0x2427('0x21'),_0x161509[_0x2427('0x13')],_0x5f01ab);_0x5eccb4(_0x3d59bb[_0x2427('0x12')](0x1f4,_0x161509[_0x2427('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 76f1fb5..e76a546 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 _0x77e3=['removeListener','register','whatsappQueue:','./whatsappQueue.events','save','remove','update'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x77e3,0x6c));var _0x377e=function(_0x2b6960,_0x231952){_0x2b6960=_0x2b6960-0x0;var _0x3cf4e7=_0x77e3[_0x2b6960];return _0x3cf4e7;};'use strict';var WhatsappQueueEvents=require(_0x377e('0x0'));var events=[_0x377e('0x1'),_0x377e('0x2'),_0x377e('0x3')];function createListener(_0x762b47,_0x379955){return function(_0x504f80){_0x379955['emit'](_0x762b47,_0x504f80);};}function removeListener(_0x521594,_0x4bf30e){return function(){WhatsappQueueEvents[_0x377e('0x4')](_0x521594,_0x4bf30e);};}exports[_0x377e('0x5')]=function(_0x419b5b){for(var _0x2a07ae=0x0,_0xf0789f=events['length'];_0x2a07ae<_0xf0789f;_0x2a07ae++){var _0xea99db=events[_0x2a07ae];var _0x4f02ce=createListener(_0x377e('0x6')+_0xea99db,_0x419b5b);WhatsappQueueEvents['on'](_0xea99db,_0x4f02ce);}}; \ No newline at end of file +var _0x5a35=['update','emit','removeListener','register','length','./whatsappQueue.events','save','remove'];(function(_0x4a44fe,_0x1623fe){var _0x3d10c8=function(_0x58f1b3){while(--_0x58f1b3){_0x4a44fe['push'](_0x4a44fe['shift']());}};_0x3d10c8(++_0x1623fe);}(_0x5a35,0x105));var _0x55a3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5a35[_0x321bb2];return _0x9c12ed;};'use strict';var WhatsappQueueEvents=require(_0x55a3('0x0'));var events=[_0x55a3('0x1'),_0x55a3('0x2'),_0x55a3('0x3')];function createListener(_0x549c72,_0x376ecd){return function(_0x4747b7){_0x376ecd[_0x55a3('0x4')](_0x549c72,_0x4747b7);};}function removeListener(_0x5b3eb3,_0x5c232a){return function(){WhatsappQueueEvents[_0x55a3('0x5')](_0x5b3eb3,_0x5c232a);};}exports[_0x55a3('0x6')]=function(_0x25fc58){for(var _0x194331=0x0,_0x46f5d0=events[_0x55a3('0x7')];_0x194331<_0x46f5d0;_0x194331++){var _0xca0e8a=events[_0x194331];var _0x382283=createListener('whatsappQueue:'+_0xca0e8a,_0x25fc58);WhatsappQueueEvents['on'](_0xca0e8a,_0x382283);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index fb0d818..10856d7 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 _0x4805=['path','connect-timeout','express','fs-extra','../../components/auth/service','./whatsappQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','delete','destroy','exports','util'];(function(_0x5105b9,_0x5cb8ef){var _0x57c915=function(_0x38a2de){while(--_0x38a2de){_0x5105b9['push'](_0x5105b9['shift']());}};_0x57c915(++_0x5cb8ef);}(_0x4805,0xd7));var _0x5480=function(_0x1f9a5e,_0x511bb6){_0x1f9a5e=_0x1f9a5e-0x0;var _0x4b7e76=_0x4805[_0x1f9a5e];return _0x4b7e76;};'use strict';var multer=require('multer');var util=require(_0x5480('0x0'));var path=require(_0x5480('0x1'));var timeout=require(_0x5480('0x2'));var express=require(_0x5480('0x3'));var router=express['Router']();var fs_extra=require(_0x5480('0x4'));var auth=require(_0x5480('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5480('0x6'));router[_0x5480('0x7')]('/',auth[_0x5480('0x8')](),controller[_0x5480('0x9')]);router['get']('/describe',auth[_0x5480('0x8')](),controller[_0x5480('0xa')]);router[_0x5480('0x7')](_0x5480('0xb'),auth['isAuthenticated'](),controller[_0x5480('0xc')]);router[_0x5480('0xd')]('/',auth[_0x5480('0x8')](),controller['create']);router[_0x5480('0xe')](_0x5480('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x5480('0xf')](_0x5480('0xb'),auth[_0x5480('0x8')](),controller[_0x5480('0x10')]);module[_0x5480('0x11')]=router; \ No newline at end of file +var _0x69ad=['describe','get','/:id','show','post','create','put','update','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','/describe'];(function(_0x3fe6df,_0x5a04d4){var _0x372a0e=function(_0x144b98){while(--_0x144b98){_0x3fe6df['push'](_0x3fe6df['shift']());}};_0x372a0e(++_0x5a04d4);}(_0x69ad,0x129));var _0xd69a=function(_0x3e3178,_0x150138){_0x3e3178=_0x3e3178-0x0;var _0x20e5d8=_0x69ad[_0x3e3178];return _0x20e5d8;};'use strict';var multer=require(_0xd69a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd69a('0x1'));var express=require(_0xd69a('0x2'));var router=express[_0xd69a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd69a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd69a('0x5'));var controller=require(_0xd69a('0x6'));router['get']('/',auth[_0xd69a('0x7')](),controller['index']);router['get'](_0xd69a('0x8'),auth[_0xd69a('0x7')](),controller[_0xd69a('0x9')]);router[_0xd69a('0xa')](_0xd69a('0xb'),auth['isAuthenticated'](),controller[_0xd69a('0xc')]);router[_0xd69a('0xd')]('/',auth['isAuthenticated'](),controller[_0xd69a('0xe')]);router[_0xd69a('0xf')](_0xd69a('0xb'),auth[_0xd69a('0x7')](),controller[_0xd69a('0x10')]);router['delete'](_0xd69a('0xb'),auth[_0xd69a('0x7')](),controller['destroy']);module[_0xd69a('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 d442076..0e37250 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x103030,_0x3f6057){var _0x15b8d0=function(_0x519b4b){while(--_0x519b4b){_0x103030['push'](_0x103030['shift']());}};_0x15b8d0(++_0x3f6057);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x41135e,_0x46dcec){var _0x68f41f=function(_0x38d1a8){while(--_0x38d1a8){_0x41135e['push'](_0x41135e['shift']());}};_0x68f41f(++_0x46dcec);}(_0x7a54,0x106));var _0x47a5=function(_0x4cfd7a,_0x19812d){_0x4cfd7a=_0x4cfd7a-0x0;var _0x5a3a4a=_0x7a54[_0x4cfd7a];return _0x5a3a4a;};'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 f15781c..b029ca8 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 _0x36ee=['describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','WhatsappQueueReport','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];function respondWithStatusCode(_0x4fbdb2,_0x32981d){_0x32981d=_0x32981d||0xcc;return function(_0x27841e){if(_0x27841e){return _0x4fbdb2[_0xe36e('0x19')](_0x32981d);}return _0x4fbdb2[_0xe36e('0x1a')](_0x32981d)['end']();};}function respondWithResult(_0x3e264a,_0x521afa){_0x521afa=_0x521afa||0xc8;return function(_0x525155){if(_0x525155){return _0x3e264a[_0xe36e('0x1a')](_0x521afa)[_0xe36e('0x1b')](_0x525155);}};}function respondWithFilteredResult(_0x26fb37,_0x278135){return function(_0xd6828e){if(_0xd6828e){var _0x924cd5=typeof _0x278135[_0xe36e('0x1c')]===_0xe36e('0x1d')&&typeof _0x278135[_0xe36e('0x1e')]===_0xe36e('0x1d');var _0x5792e8=_0xd6828e[_0xe36e('0x1f')];var _0x2184ae=_0x924cd5?0x0:_0x278135['offset'];var _0x21d9a3=_0x924cd5?_0xd6828e['count']:_0x278135[_0xe36e('0x1c')]+_0x278135[_0xe36e('0x1e')];var _0x5e15f5;if(_0x21d9a3>=_0x5792e8){_0x21d9a3=_0x5792e8;_0x5e15f5=0xc8;}else{_0x5e15f5=0xce;}_0x26fb37[_0xe36e('0x1a')](_0x5e15f5);return _0x26fb37[_0xe36e('0x20')](_0xe36e('0x21'),_0x2184ae+'-'+_0x21d9a3+'/'+_0x5792e8)['json'](_0xd6828e);}return null;};}function patchUpdates(_0x21e95e){return function(_0x21bcf9){try{jsonpatch[_0xe36e('0x22')](_0x21bcf9,_0x21e95e,!![]);}catch(_0x3c4017){return BPromise[_0xe36e('0x23')](_0x3c4017);}return _0x21bcf9[_0xe36e('0x24')]();};}function saveUpdates(_0x4f438a,_0xd71137){return function(_0x4f214a){if(_0x4f214a){return _0x4f214a[_0xe36e('0x25')](_0x4f438a)[_0xe36e('0x26')](function(_0x437f3f){return _0x437f3f;});}return null;};}function removeEntity(_0x53e13a,_0x598a7a){return function(_0x4749a8){if(_0x4749a8){return _0x4749a8[_0xe36e('0x27')]()[_0xe36e('0x26')](function(){_0x53e13a[_0xe36e('0x1a')](0xcc)[_0xe36e('0x28')]();});}};}function handleEntityNotFound(_0x1507f9,_0x1a045c){return function(_0x5ac484){if(!_0x5ac484){_0x1507f9[_0xe36e('0x19')](0x194);}return _0x5ac484;};}function handleError(_0x35f9e7,_0x10597f){_0x10597f=_0x10597f||0x1f4;return function(_0x262caa){logger['error'](_0x262caa[_0xe36e('0x29')]);if(_0x262caa['name']){delete _0x262caa[_0xe36e('0x2a')];}_0x35f9e7['status'](_0x10597f)[_0xe36e('0x2b')](_0x262caa);};}exports['index']=function(_0x410504,_0x4c5d98){var _0x3b1045={},_0x59548b={},_0x4bb75b={'count':0x0,'rows':[]};var _0x5d8fd8=_['map'](db[_0xe36e('0x2c')][_0xe36e('0x2d')],function(_0x4cf185){return{'name':_0x4cf185['fieldName'],'type':_0x4cf185[_0xe36e('0x2e')][_0xe36e('0x2f')]};});_0x59548b[_0xe36e('0x30')]=_[_0xe36e('0x31')](_0x5d8fd8,_0xe36e('0x2a'));_0x59548b[_0xe36e('0x32')]=_['keys'](_0x410504[_0xe36e('0x32')]);_0x59548b[_0xe36e('0x33')]=_['intersection'](_0x59548b[_0xe36e('0x30')],_0x59548b[_0xe36e('0x32')]);_0x3b1045[_0xe36e('0x34')]=_[_0xe36e('0x35')](_0x59548b[_0xe36e('0x30')],qs[_0xe36e('0x36')](_0x410504[_0xe36e('0x32')][_0xe36e('0x36')]));_0x3b1045[_0xe36e('0x34')]=_0x3b1045[_0xe36e('0x34')][_0xe36e('0x37')]?_0x3b1045['attributes']:_0x59548b[_0xe36e('0x30')];if(!_0x410504['query']['hasOwnProperty'](_0xe36e('0x38'))){_0x3b1045['limit']=qs[_0xe36e('0x1e')](_0x410504[_0xe36e('0x32')][_0xe36e('0x1e')]);_0x3b1045[_0xe36e('0x1c')]=qs['offset'](_0x410504['query'][_0xe36e('0x1c')]);}_0x3b1045[_0xe36e('0x39')]=qs[_0xe36e('0x3a')](_0x410504[_0xe36e('0x32')]['sort']);_0x3b1045[_0xe36e('0x3b')]=qs[_0xe36e('0x33')](_[_0xe36e('0x3c')](_0x410504['query'],_0x59548b[_0xe36e('0x33')]),_0x5d8fd8);if(_0x410504[_0xe36e('0x32')]['filter']){_0x3b1045[_0xe36e('0x3b')]=_[_0xe36e('0x3d')](_0x3b1045[_0xe36e('0x3b')],{'$or':_[_0xe36e('0x31')](_0x5d8fd8,function(_0xeadfa6){if(_0xeadfa6[_0xe36e('0x2e')]!==_0xe36e('0x3e')){var _0x20877d={};_0x20877d[_0xeadfa6[_0xe36e('0x2a')]]={'$like':'%'+_0x410504[_0xe36e('0x32')][_0xe36e('0x3f')]+'%'};return _0x20877d;}})});}_0x3b1045=_[_0xe36e('0x3d')]({},_0x3b1045,_0x410504[_0xe36e('0x40')]);var _0x5f396c={'where':_0x3b1045[_0xe36e('0x3b')]};return db[_0xe36e('0x2c')][_0xe36e('0x1f')](_0x5f396c)[_0xe36e('0x26')](function(_0x295feb){_0x4bb75b['count']=_0x295feb;if(_0x410504['query'][_0xe36e('0x41')]){_0x3b1045[_0xe36e('0x42')]=[{'all':!![]}];}return db[_0xe36e('0x2c')][_0xe36e('0x43')](_0x3b1045);})[_0xe36e('0x26')](function(_0x34a1ba){_0x4bb75b[_0xe36e('0x44')]=_0x34a1ba;return _0x4bb75b;})[_0xe36e('0x26')](respondWithFilteredResult(_0x4c5d98,_0x3b1045))['catch'](handleError(_0x4c5d98,null));};exports[_0xe36e('0x45')]=function(_0x2d392c,_0x4788a0){var _0x21dc35={'raw':!![],'where':{'id':_0x2d392c[_0xe36e('0x46')]['id']}},_0x5ef3e4={};_0x5ef3e4[_0xe36e('0x30')]=_[_0xe36e('0x47')](db[_0xe36e('0x2c')][_0xe36e('0x2d')]);_0x5ef3e4['query']=_[_0xe36e('0x47')](_0x2d392c[_0xe36e('0x32')]);_0x5ef3e4[_0xe36e('0x33')]=_[_0xe36e('0x35')](_0x5ef3e4[_0xe36e('0x30')],_0x5ef3e4[_0xe36e('0x32')]);_0x21dc35['attributes']=_[_0xe36e('0x35')](_0x5ef3e4[_0xe36e('0x30')],qs[_0xe36e('0x36')](_0x2d392c[_0xe36e('0x32')][_0xe36e('0x36')]));_0x21dc35['attributes']=_0x21dc35[_0xe36e('0x34')][_0xe36e('0x37')]?_0x21dc35[_0xe36e('0x34')]:_0x5ef3e4[_0xe36e('0x30')];if(_0x2d392c[_0xe36e('0x32')][_0xe36e('0x41')]){_0x21dc35[_0xe36e('0x42')]=[{'all':!![]}];}_0x21dc35=_[_0xe36e('0x3d')]({},_0x21dc35,_0x2d392c[_0xe36e('0x40')]);return db['WhatsappQueueReport']['find'](_0x21dc35)[_0xe36e('0x26')](handleEntityNotFound(_0x4788a0,null))['then'](respondWithResult(_0x4788a0,null))[_0xe36e('0x48')](handleError(_0x4788a0,null));};exports[_0xe36e('0x49')]=function(_0x38b93f,_0x25aa09){return db['WhatsappQueueReport'][_0xe36e('0x49')](_0x38b93f[_0xe36e('0x4a')],{})['then'](respondWithResult(_0x25aa09,0xc9))[_0xe36e('0x48')](handleError(_0x25aa09,null));};exports[_0xe36e('0x25')]=function(_0x2c26e6,_0x42eae5){if(_0x2c26e6[_0xe36e('0x4a')]['id']){delete _0x2c26e6[_0xe36e('0x4a')]['id'];}return db[_0xe36e('0x2c')][_0xe36e('0x4b')]({'where':{'id':_0x2c26e6[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x42eae5,null))[_0xe36e('0x26')](saveUpdates(_0x2c26e6[_0xe36e('0x4a')],null))[_0xe36e('0x26')](respondWithResult(_0x42eae5,null))[_0xe36e('0x48')](handleError(_0x42eae5,null));};exports[_0xe36e('0x27')]=function(_0x5678d3,_0x3262bf){return db['WhatsappQueueReport']['find']({'where':{'id':_0x5678d3[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x3262bf,null))['then'](removeEntity(_0x3262bf,null))[_0xe36e('0x48')](handleError(_0x3262bf,null));};exports[_0xe36e('0x4c')]=function(_0x8a767a,_0x1f4a5d){return db[_0xe36e('0x2c')][_0xe36e('0x4c')]()[_0xe36e('0x26')](respondWithResult(_0x1f4a5d,null))[_0xe36e('0x48')](handleError(_0x1f4a5d,null));}; \ No newline at end of file +var _0x13f6=['catch','params','rawAttributes','intersection','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','name','send','map','WhatsappQueueReport','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x13f6,0x124));var _0x613f=function(_0x267080,_0x34af89){_0x267080=_0x267080-0x0;var _0x36a1af=_0x13f6[_0x267080];return _0x36a1af;};'use strict';var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x613f('0x2'));var moment=require(_0x613f('0x3'));var BPromise=require(_0x613f('0x4'));var Mustache=require('mustache');var util=require(_0x613f('0x5'));var path=require(_0x613f('0x6'));var sox=require(_0x613f('0x7'));var csv=require('to-csv');var ejs=require(_0x613f('0x8'));var fs=require('fs');var fs_extra=require(_0x613f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613f('0xa'));var toCsv=require(_0x613f('0xb'));var querystring=require(_0x613f('0xc'));var Papa=require(_0x613f('0xd'));var Redis=require('ioredis');var authService=require(_0x613f('0xe'));var qs=require(_0x613f('0xf'));var as=require(_0x613f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x11'))(_0x613f('0x12'));var utils=require(_0x613f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x613f('0x14'));var db=require(_0x613f('0x15'))['db'];function respondWithStatusCode(_0x542230,_0x4c2a85){_0x4c2a85=_0x4c2a85||0xcc;return function(_0x517f57){if(_0x517f57){return _0x542230[_0x613f('0x16')](_0x4c2a85);}return _0x542230[_0x613f('0x17')](_0x4c2a85)[_0x613f('0x18')]();};}function respondWithResult(_0x375db1,_0x329fcf){_0x329fcf=_0x329fcf||0xc8;return function(_0x4a6fc){if(_0x4a6fc){return _0x375db1[_0x613f('0x17')](_0x329fcf)[_0x613f('0x19')](_0x4a6fc);}};}function respondWithFilteredResult(_0x2eee4d,_0x1d68fd){return function(_0x548218){if(_0x548218){var _0x3c9edf=typeof _0x1d68fd['offset']==='undefined'&&typeof _0x1d68fd[_0x613f('0x1a')]===_0x613f('0x1b');var _0x544eca=_0x548218[_0x613f('0x1c')];var _0x4f9dae=_0x3c9edf?0x0:_0x1d68fd[_0x613f('0x1d')];var _0x1e5a11=_0x3c9edf?_0x548218[_0x613f('0x1c')]:_0x1d68fd[_0x613f('0x1d')]+_0x1d68fd[_0x613f('0x1a')];var _0x1ba35f;if(_0x1e5a11>=_0x544eca){_0x1e5a11=_0x544eca;_0x1ba35f=0xc8;}else{_0x1ba35f=0xce;}_0x2eee4d['status'](_0x1ba35f);return _0x2eee4d['set'](_0x613f('0x1e'),_0x4f9dae+'-'+_0x1e5a11+'/'+_0x544eca)['json'](_0x548218);}return null;};}function patchUpdates(_0x48493c){return function(_0x3c9b58){try{jsonpatch[_0x613f('0x1f')](_0x3c9b58,_0x48493c,!![]);}catch(_0x4f5a5a){return BPromise[_0x613f('0x20')](_0x4f5a5a);}return _0x3c9b58[_0x613f('0x21')]();};}function saveUpdates(_0x2aa14b,_0x48b28a){return function(_0x5401c2){if(_0x5401c2){return _0x5401c2[_0x613f('0x22')](_0x2aa14b)[_0x613f('0x23')](function(_0x2acfcf){return _0x2acfcf;});}return null;};}function removeEntity(_0x51f376,_0x41104e){return function(_0x33e0c6){if(_0x33e0c6){return _0x33e0c6[_0x613f('0x24')]()[_0x613f('0x23')](function(){_0x51f376[_0x613f('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30fb15,_0x204185){return function(_0x51bba1){if(!_0x51bba1){_0x30fb15[_0x613f('0x16')](0x194);}return _0x51bba1;};}function handleError(_0x5d4ff6,_0x32e747){_0x32e747=_0x32e747||0x1f4;return function(_0x4a878d){logger['error'](_0x4a878d['stack']);if(_0x4a878d[_0x613f('0x25')]){delete _0x4a878d['name'];}_0x5d4ff6[_0x613f('0x17')](_0x32e747)[_0x613f('0x26')](_0x4a878d);};}exports['index']=function(_0x121241,_0x2551c1){var _0x4c8aa1={},_0x4cff5d={},_0x4f892d={'count':0x0,'rows':[]};var _0x24be7c=_[_0x613f('0x27')](db[_0x613f('0x28')]['rawAttributes'],function(_0x23eda8){return{'name':_0x23eda8[_0x613f('0x29')],'type':_0x23eda8[_0x613f('0x2a')][_0x613f('0x2b')]};});_0x4cff5d['model']=_[_0x613f('0x27')](_0x24be7c,_0x613f('0x25'));_0x4cff5d[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x121241[_0x613f('0x2c')]);_0x4cff5d[_0x613f('0x2e')]=_['intersection'](_0x4cff5d[_0x613f('0x2f')],_0x4cff5d[_0x613f('0x2c')]);_0x4c8aa1[_0x613f('0x30')]=_['intersection'](_0x4cff5d[_0x613f('0x2f')],qs['fields'](_0x121241[_0x613f('0x2c')][_0x613f('0x31')]));_0x4c8aa1[_0x613f('0x30')]=_0x4c8aa1[_0x613f('0x30')][_0x613f('0x32')]?_0x4c8aa1[_0x613f('0x30')]:_0x4cff5d['model'];if(!_0x121241[_0x613f('0x2c')][_0x613f('0x33')](_0x613f('0x34'))){_0x4c8aa1[_0x613f('0x1a')]=qs[_0x613f('0x1a')](_0x121241['query']['limit']);_0x4c8aa1['offset']=qs[_0x613f('0x1d')](_0x121241[_0x613f('0x2c')][_0x613f('0x1d')]);}_0x4c8aa1[_0x613f('0x35')]=qs['sort'](_0x121241[_0x613f('0x2c')][_0x613f('0x36')]);_0x4c8aa1['where']=qs[_0x613f('0x2e')](_['pick'](_0x121241[_0x613f('0x2c')],_0x4cff5d['filters']),_0x24be7c);if(_0x121241[_0x613f('0x2c')]['filter']){_0x4c8aa1[_0x613f('0x37')]=_[_0x613f('0x38')](_0x4c8aa1[_0x613f('0x37')],{'$or':_['map'](_0x24be7c,function(_0x36eaa0){if(_0x36eaa0[_0x613f('0x2a')]!==_0x613f('0x39')){var _0x2fb3a6={};_0x2fb3a6[_0x36eaa0[_0x613f('0x25')]]={'$like':'%'+_0x121241[_0x613f('0x2c')][_0x613f('0x3a')]+'%'};return _0x2fb3a6;}})});}_0x4c8aa1=_[_0x613f('0x38')]({},_0x4c8aa1,_0x121241[_0x613f('0x3b')]);var _0x3313c1={'where':_0x4c8aa1['where']};return db[_0x613f('0x28')][_0x613f('0x1c')](_0x3313c1)[_0x613f('0x23')](function(_0x1e5af0){_0x4f892d[_0x613f('0x1c')]=_0x1e5af0;if(_0x121241[_0x613f('0x2c')][_0x613f('0x3c')]){_0x4c8aa1['include']=[{'all':!![]}];}return db[_0x613f('0x28')][_0x613f('0x3d')](_0x4c8aa1);})[_0x613f('0x23')](function(_0x3d2d7b){_0x4f892d[_0x613f('0x3e')]=_0x3d2d7b;return _0x4f892d;})[_0x613f('0x23')](respondWithFilteredResult(_0x2551c1,_0x4c8aa1))[_0x613f('0x3f')](handleError(_0x2551c1,null));};exports['show']=function(_0x343a59,_0x18f427){var _0x3bb605={'raw':!![],'where':{'id':_0x343a59[_0x613f('0x40')]['id']}},_0x2f584e={};_0x2f584e[_0x613f('0x2f')]=_[_0x613f('0x2d')](db[_0x613f('0x28')][_0x613f('0x41')]);_0x2f584e[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x343a59[_0x613f('0x2c')]);_0x2f584e[_0x613f('0x2e')]=_['intersection'](_0x2f584e[_0x613f('0x2f')],_0x2f584e[_0x613f('0x2c')]);_0x3bb605[_0x613f('0x30')]=_[_0x613f('0x42')](_0x2f584e['model'],qs[_0x613f('0x31')](_0x343a59[_0x613f('0x2c')][_0x613f('0x31')]));_0x3bb605[_0x613f('0x30')]=_0x3bb605[_0x613f('0x30')][_0x613f('0x32')]?_0x3bb605[_0x613f('0x30')]:_0x2f584e[_0x613f('0x2f')];if(_0x343a59[_0x613f('0x2c')][_0x613f('0x3c')]){_0x3bb605['include']=[{'all':!![]}];}_0x3bb605=_['merge']({},_0x3bb605,_0x343a59[_0x613f('0x3b')]);return db[_0x613f('0x28')]['find'](_0x3bb605)[_0x613f('0x23')](handleEntityNotFound(_0x18f427,null))[_0x613f('0x23')](respondWithResult(_0x18f427,null))[_0x613f('0x3f')](handleError(_0x18f427,null));};exports[_0x613f('0x43')]=function(_0x39b8b2,_0x1c0b07){return db[_0x613f('0x28')][_0x613f('0x43')](_0x39b8b2[_0x613f('0x44')],{})[_0x613f('0x23')](respondWithResult(_0x1c0b07,0xc9))[_0x613f('0x3f')](handleError(_0x1c0b07,null));};exports[_0x613f('0x22')]=function(_0x174e22,_0x17f8e5){if(_0x174e22[_0x613f('0x44')]['id']){delete _0x174e22[_0x613f('0x44')]['id'];}return db[_0x613f('0x28')][_0x613f('0x45')]({'where':{'id':_0x174e22['params']['id']}})['then'](handleEntityNotFound(_0x17f8e5,null))[_0x613f('0x23')](saveUpdates(_0x174e22[_0x613f('0x44')],null))['then'](respondWithResult(_0x17f8e5,null))['catch'](handleError(_0x17f8e5,null));};exports[_0x613f('0x24')]=function(_0x51729a,_0x513bf1){return db[_0x613f('0x28')][_0x613f('0x45')]({'where':{'id':_0x51729a[_0x613f('0x40')]['id']}})['then'](handleEntityNotFound(_0x513bf1,null))[_0x613f('0x23')](removeEntity(_0x513bf1,null))[_0x613f('0x3f')](handleError(_0x513bf1,null));};exports['describe']=function(_0x55e878,_0x1c0c8e){return db[_0x613f('0x28')][_0x613f('0x46')]()[_0x613f('0x23')](respondWithResult(_0x1c0c8e,null))[_0x613f('0x3f')](handleError(_0x1c0c8e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 9520a7c..8dc6c79 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 _0xb15a=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x3a5da5,_0x58eaa0){var _0x2de0e5=function(_0x2f1d09){while(--_0x2f1d09){_0x3a5da5['push'](_0x3a5da5['shift']());}};_0x2de0e5(++_0x58eaa0);}(_0xb15a,0x11e));var _0xab15=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0xb15a[_0x400b43];return _0x3c330f;};'use strict';var _=require(_0xab15('0x0'));var util=require(_0xab15('0x1'));var logger=require(_0xab15('0x2'))(_0xab15('0x3'));var moment=require('moment');var BPromise=require(_0xab15('0x4'));var rp=require(_0xab15('0x5'));var fs=require('fs');var path=require(_0xab15('0x6'));var rimraf=require(_0xab15('0x7'));var config=require(_0xab15('0x8'));var attributes=require(_0xab15('0x9'));module[_0xab15('0xa')]=function(_0x3ceafc,_0x1d6cac){return _0x3ceafc[_0xab15('0xb')](_0xab15('0xc'),attributes,{'tableName':_0xab15('0xd'),'paranoid':![],'indexes':[{'name':_0xab15('0xe'),'fields':[_0xab15('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f8c=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./whatsappQueueReport.attributes','exports','define','uniqueid','util'];(function(_0x2392fc,_0x2043cd){var _0x4a3041=function(_0xd87762){while(--_0xd87762){_0x2392fc['push'](_0x2392fc['shift']());}};_0x4a3041(++_0x2043cd);}(_0x5f8c,0x1c1));var _0xc5f8=function(_0x1f1f40,_0x3960fc){_0x1f1f40=_0x1f1f40-0x0;var _0x533521=_0x5f8c[_0x1f1f40];return _0x533521;};'use strict';var _=require('lodash');var util=require(_0xc5f8('0x0'));var logger=require(_0xc5f8('0x1'))('api');var moment=require(_0xc5f8('0x2'));var BPromise=require(_0xc5f8('0x3'));var rp=require(_0xc5f8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc5f8('0x5'));var attributes=require(_0xc5f8('0x6'));module[_0xc5f8('0x7')]=function(_0xf5f963,_0x361957){return _0xf5f963[_0xc5f8('0x8')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xc5f8('0x9'),'fields':[_0xc5f8('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 ba7cdc0..0f6f327 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 _0x7a66=['client','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','raw','then','debug','UpdateWhatsappQueueReport','update','body','options','where','limit','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x30ae7b,_0x3a718f){var _0xa9d0cf=function(_0x8102a1){while(--_0x8102a1){_0x30ae7b['push'](_0x30ae7b['shift']());}};_0xa9d0cf(++_0x3a718f);}(_0x7a66,0x1e6));var _0x67a6=function(_0x51e6fb,_0x1c0b7e){_0x51e6fb=_0x51e6fb-0x0;var _0x4e30a7=_0x7a66[_0x51e6fb];return _0x4e30a7;};'use strict';var _=require('lodash');var util=require(_0x67a6('0x0'));var moment=require('moment');var BPromise=require(_0x67a6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x67a6('0x2'));var db=require(_0x67a6('0x3'))['db'];var utils=require(_0x67a6('0x4'));var logger=require(_0x67a6('0x5'))(_0x67a6('0x6'));var config=require(_0x67a6('0x7'));var jayson=require(_0x67a6('0x8'));var client=jayson[_0x67a6('0x9')][_0x67a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4254ff,_0x21c170,_0x49c102){return new BPromise(function(_0x2db233,_0x5980e1){return client[_0x67a6('0xb')](_0x4254ff,_0x49c102)['then'](function(_0x3dacda){logger[_0x67a6('0xc')](_0x67a6('0xd'),_0x21c170,_0x67a6('0xe'));logger['debug'](_0x67a6('0xf'),_0x21c170,'request\x20sent',JSON[_0x67a6('0x10')](_0x3dacda));if(_0x3dacda['error']){if(_0x3dacda[_0x67a6('0x11')]['code']===0x1f4){logger[_0x67a6('0x11')](_0x67a6('0xd'),_0x21c170,_0x3dacda[_0x67a6('0x11')][_0x67a6('0x12')]);return _0x5980e1(_0x3dacda[_0x67a6('0x11')]['message']);}logger[_0x67a6('0x11')](_0x67a6('0xd'),_0x21c170,_0x3dacda[_0x67a6('0x11')][_0x67a6('0x12')]);return _0x2db233(_0x3dacda[_0x67a6('0x11')]['message']);}else{logger['info'](_0x67a6('0xd'),_0x21c170,_0x67a6('0xe'));_0x2db233(_0x3dacda[_0x67a6('0x13')][_0x67a6('0x12')]);}})[_0x67a6('0x14')](function(_0x281056){logger[_0x67a6('0x11')](_0x67a6('0xd'),_0x21c170,_0x281056);_0x5980e1(_0x281056);});});}exports[_0x67a6('0x15')]=function(_0x450783){var _0xc1d410=this;return new Promise(function(_0x3ab31a,_0x571765){return db[_0x67a6('0x16')][_0x67a6('0x17')](_0x450783['body'],{'raw':_0x450783['options']?_0x450783['options'][_0x67a6('0x18')]===undefined?!![]:![]:!![]})[_0x67a6('0x19')](function(_0x4cc4c7){logger[_0x67a6('0xc')]('CreateWhatsappQueueReport',_0x450783);logger[_0x67a6('0x1a')](_0x67a6('0x15'),_0x450783,JSON[_0x67a6('0x10')](_0x4cc4c7));_0x3ab31a(_0x4cc4c7);})[_0x67a6('0x14')](function(_0x3eba10){logger['error']('CreateWhatsappQueueReport',_0x3eba10[_0x67a6('0x12')],_0x450783);_0x571765(_0xc1d410[_0x67a6('0x11')](0x1f4,_0x3eba10[_0x67a6('0x12')]));});});};exports[_0x67a6('0x1b')]=function(_0x5712e8){var _0x3eeb70=this;return new Promise(function(_0x4033cc,_0x5e06e7){return db[_0x67a6('0x16')][_0x67a6('0x1c')](_0x5712e8[_0x67a6('0x1d')],{'raw':_0x5712e8[_0x67a6('0x1e')]?_0x5712e8['options'][_0x67a6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5712e8[_0x67a6('0x1e')]?_0x5712e8[_0x67a6('0x1e')][_0x67a6('0x1f')]||null:null,'attributes':_0x5712e8[_0x67a6('0x1e')]?_0x5712e8[_0x67a6('0x1e')]['attributes']||null:null,'limit':_0x5712e8[_0x67a6('0x1e')]?_0x5712e8[_0x67a6('0x1e')][_0x67a6('0x20')]||null:null})[_0x67a6('0x19')](function(_0x29e19e){logger['info']('UpdateWhatsappQueueReport',_0x5712e8);logger[_0x67a6('0x1a')](_0x67a6('0x1b'),_0x5712e8,JSON[_0x67a6('0x10')](_0x29e19e));_0x4033cc(_0x29e19e);})['catch'](function(_0x4d99a6){logger[_0x67a6('0x11')]('UpdateWhatsappQueueReport',_0x4d99a6[_0x67a6('0x12')],_0x5712e8);_0x5e06e7(_0x3eeb70[_0x67a6('0x11')](0x1f4,_0x4d99a6[_0x67a6('0x12')]));});});}; \ No newline at end of file +var _0x74a7=['where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','stringify','UpdateWhatsappQueueReport','update'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x74a7,0x106));var _0x774a=function(_0x184d76,_0x3cb428){_0x184d76=_0x184d76-0x0;var _0x46616c=_0x74a7[_0x184d76];return _0x46616c;};'use strict';var _=require(_0x774a('0x0'));var util=require(_0x774a('0x1'));var moment=require(_0x774a('0x2'));var BPromise=require(_0x774a('0x3'));var rs=require(_0x774a('0x4'));var fs=require('fs');var Redis=require(_0x774a('0x5'));var db=require(_0x774a('0x6'))['db'];var utils=require(_0x774a('0x7'));var logger=require(_0x774a('0x8'))('rpc');var config=require(_0x774a('0x9'));var jayson=require(_0x774a('0xa'));var client=jayson[_0x774a('0xb')][_0x774a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x555858,_0x3728c7,_0x9e0de9){return new BPromise(function(_0x2d43f6,_0x36accb){return client[_0x774a('0xd')](_0x555858,_0x9e0de9)['then'](function(_0x389eb9){logger[_0x774a('0xe')](_0x774a('0xf'),_0x3728c7,_0x774a('0x10'));logger[_0x774a('0x11')](_0x774a('0x12'),_0x3728c7,_0x774a('0x10'),JSON['stringify'](_0x389eb9));if(_0x389eb9['error']){if(_0x389eb9[_0x774a('0x13')][_0x774a('0x14')]===0x1f4){logger[_0x774a('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3728c7,_0x389eb9['error'][_0x774a('0x15')]);return _0x36accb(_0x389eb9[_0x774a('0x13')][_0x774a('0x15')]);}logger[_0x774a('0x13')](_0x774a('0xf'),_0x3728c7,_0x389eb9[_0x774a('0x13')][_0x774a('0x15')]);return _0x2d43f6(_0x389eb9['error'][_0x774a('0x15')]);}else{logger[_0x774a('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3728c7,_0x774a('0x10'));_0x2d43f6(_0x389eb9[_0x774a('0x16')]['message']);}})[_0x774a('0x17')](function(_0x266588){logger['error'](_0x774a('0xf'),_0x3728c7,_0x266588);_0x36accb(_0x266588);});});}exports[_0x774a('0x18')]=function(_0x54e566){var _0x12ba37=this;return new Promise(function(_0x515075,_0x5ef44c){return db[_0x774a('0x19')][_0x774a('0x1a')](_0x54e566[_0x774a('0x1b')],{'raw':_0x54e566[_0x774a('0x1c')]?_0x54e566[_0x774a('0x1c')][_0x774a('0x1d')]===undefined?!![]:![]:!![]})[_0x774a('0x1e')](function(_0x427a6c){logger[_0x774a('0xe')](_0x774a('0x18'),_0x54e566);logger['debug'](_0x774a('0x18'),_0x54e566,JSON[_0x774a('0x1f')](_0x427a6c));_0x515075(_0x427a6c);})['catch'](function(_0x4f3b46){logger[_0x774a('0x13')](_0x774a('0x18'),_0x4f3b46[_0x774a('0x15')],_0x54e566);_0x5ef44c(_0x12ba37[_0x774a('0x13')](0x1f4,_0x4f3b46[_0x774a('0x15')]));});});};exports[_0x774a('0x20')]=function(_0x1ef52e){var _0x52e4bc=this;return new Promise(function(_0xe83914,_0xa36baa){return db[_0x774a('0x19')][_0x774a('0x21')](_0x1ef52e['body'],{'raw':_0x1ef52e[_0x774a('0x1c')]?_0x1ef52e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ef52e[_0x774a('0x1c')]?_0x1ef52e[_0x774a('0x1c')][_0x774a('0x22')]||null:null,'attributes':_0x1ef52e['options']?_0x1ef52e[_0x774a('0x1c')][_0x774a('0x23')]||null:null,'limit':_0x1ef52e[_0x774a('0x1c')]?_0x1ef52e[_0x774a('0x1c')][_0x774a('0x24')]||null:null})[_0x774a('0x1e')](function(_0x38f2ef){logger[_0x774a('0xe')](_0x774a('0x20'),_0x1ef52e);logger[_0x774a('0x11')](_0x774a('0x20'),_0x1ef52e,JSON[_0x774a('0x1f')](_0x38f2ef));_0xe83914(_0x38f2ef);})[_0x774a('0x17')](function(_0x1efd91){logger[_0x774a('0x13')](_0x774a('0x20'),_0x1efd91[_0x774a('0x15')],_0x1ef52e);_0xa36baa(_0x52e4bc['error'](0x1f4,_0x1efd91['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 77c8e2e..cc673ac 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 _0x4408=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4408,0x1f1));var _0x8440=function(_0x312fbd,_0x2c02a3){_0x312fbd=_0x312fbd-0x0;var _0x1584ab=_0x4408[_0x312fbd];return _0x1584ab;};'use strict';var multer=require(_0x8440('0x0'));var util=require(_0x8440('0x1'));var path=require(_0x8440('0x2'));var timeout=require(_0x8440('0x3'));var express=require(_0x8440('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8440('0x5'));var interaction=require(_0x8440('0x6'));var config=require('../../config/environment');var controller=require(_0x8440('0x7'));router[_0x8440('0x8')]('/',auth[_0x8440('0x9')](),controller[_0x8440('0xa')]);router['get'](_0x8440('0xb'),auth[_0x8440('0x9')](),controller[_0x8440('0xc')]);router['get'](_0x8440('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x8440('0xe')]('/',auth[_0x8440('0x9')](),controller['create']);router[_0x8440('0xf')](_0x8440('0xd'),auth[_0x8440('0x9')](),controller[_0x8440('0x10')]);router[_0x8440('0x11')](_0x8440('0xd'),auth[_0x8440('0x9')](),controller[_0x8440('0x12')]);module[_0x8440('0x13')]=router; \ No newline at end of file +var _0xac47=['get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xac47,0x98));var _0x7ac4=function(_0x51f632,_0x5a14d5){_0x51f632=_0x51f632-0x0;var _0x24cf36=_0xac47[_0x51f632];return _0x24cf36;};'use strict';var multer=require(_0x7ac4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7ac4('0x1'));var router=express[_0x7ac4('0x2')]();var fs_extra=require(_0x7ac4('0x3'));var auth=require(_0x7ac4('0x4'));var interaction=require(_0x7ac4('0x5'));var config=require(_0x7ac4('0x6'));var controller=require(_0x7ac4('0x7'));router[_0x7ac4('0x8')]('/',auth[_0x7ac4('0x9')](),controller[_0x7ac4('0xa')]);router[_0x7ac4('0x8')](_0x7ac4('0xb'),auth[_0x7ac4('0x9')](),controller[_0x7ac4('0xc')]);router[_0x7ac4('0x8')](_0x7ac4('0xd'),auth[_0x7ac4('0x9')](),controller['show']);router[_0x7ac4('0xe')]('/',auth[_0x7ac4('0x9')](),controller['create']);router[_0x7ac4('0xf')](_0x7ac4('0xd'),auth[_0x7ac4('0x9')](),controller[_0x7ac4('0x10')]);router[_0x7ac4('0x11')](_0x7ac4('0xd'),auth[_0x7ac4('0x9')](),controller[_0x7ac4('0x12')]);module[_0x7ac4('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index bdef84d..172cc88 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 _0xd5fc=['account','agent','queue','DATE','sequelize'];(function(_0xf53937,_0x2bf512){var _0x33b67b=function(_0x133e15){while(--_0x133e15){_0xf53937['push'](_0xf53937['shift']());}};_0x33b67b(++_0x2bf512);}(_0xd5fc,0xae));var _0xcd5f=function(_0xfbf877,_0xc3fdc5){_0xfbf877=_0xfbf877-0x0;var _0x540e2c=_0xd5fc[_0xfbf877];return _0x540e2c;};'use strict';var Sequelize=require(_0xcd5f('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xcd5f('0x1'),_0xcd5f('0x2'),_0xcd5f('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xcd5f('0x4')]}}; \ No newline at end of file +var _0x2b65=['DATE','sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x2b65,0x131));var _0x52b6=function(_0x338581,_0x85c756){_0x338581=_0x338581-0x0;var _0x306123=_0x2b65[_0x338581];return _0x306123;};'use strict';var Sequelize=require(_0x52b6('0x0'));module[_0x52b6('0x1')]={'uniqueid':{'type':Sequelize[_0x52b6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x52b6('0x3')](_0x52b6('0x4'),_0x52b6('0x5'),_0x52b6('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x52b6('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index ccbc443..15ff453 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 _0x5a03=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','end','sendStatus','error','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','params','find','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x5d1d7b,_0x31905a){var _0x96e1ca=function(_0x525796){while(--_0x525796){_0x5d1d7b['push'](_0x5d1d7b['shift']());}};_0x96e1ca(++_0x31905a);}(_0x5a03,0x1a8));var _0x35a0=function(_0x275bfe,_0x39d72c){_0x275bfe=_0x275bfe-0x0;var _0x5686fb=_0x5a03[_0x275bfe];return _0x5686fb;};'use strict';var emlformat=require(_0x35a0('0x0'));var rimraf=require(_0x35a0('0x1'));var zipdir=require(_0x35a0('0x2'));var jsonpatch=require(_0x35a0('0x3'));var rp=require(_0x35a0('0x4'));var moment=require(_0x35a0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x35a0('0x6'));var util=require(_0x35a0('0x7'));var path=require(_0x35a0('0x8'));var sox=require(_0x35a0('0x9'));var csv=require(_0x35a0('0xa'));var ejs=require(_0x35a0('0xb'));var fs=require('fs');var fs_extra=require(_0x35a0('0xc'));var _=require('lodash');var squel=require(_0x35a0('0xd'));var crypto=require(_0x35a0('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x35a0('0xa'));var querystring=require('querystring');var Papa=require(_0x35a0('0xf'));var Redis=require(_0x35a0('0x10'));var authService=require(_0x35a0('0x11'));var qs=require(_0x35a0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x35a0('0x13'));var logger=require(_0x35a0('0x14'))(_0x35a0('0x15'));var utils=require(_0x35a0('0x16'));var config=require(_0x35a0('0x17'));var licenseUtil=require(_0x35a0('0x18'));var db=require(_0x35a0('0x19'))['db'];function respondWithStatusCode(_0x3a29d3,_0x1de333){_0x1de333=_0x1de333||0xcc;return function(_0x2a7c25){if(_0x2a7c25){return _0x3a29d3['sendStatus'](_0x1de333);}return _0x3a29d3[_0x35a0('0x1a')](_0x1de333)['end']();};}function respondWithResult(_0x12836b,_0x5b945e){_0x5b945e=_0x5b945e||0xc8;return function(_0xbc6c67){if(_0xbc6c67){return _0x12836b[_0x35a0('0x1a')](_0x5b945e)[_0x35a0('0x1b')](_0xbc6c67);}};}function respondWithFilteredResult(_0x1ab469,_0x5991ac){return function(_0x489057){if(_0x489057){var _0x431c30=typeof _0x5991ac['offset']===_0x35a0('0x1c')&&typeof _0x5991ac[_0x35a0('0x1d')]===_0x35a0('0x1c');var _0xeee3f8=_0x489057[_0x35a0('0x1e')];var _0x156f00=_0x431c30?0x0:_0x5991ac[_0x35a0('0x1f')];var _0x21ed8f=_0x431c30?_0x489057['count']:_0x5991ac[_0x35a0('0x1f')]+_0x5991ac[_0x35a0('0x1d')];var _0x4cdb86;if(_0x21ed8f>=_0xeee3f8){_0x21ed8f=_0xeee3f8;_0x4cdb86=0xc8;}else{_0x4cdb86=0xce;}_0x1ab469['status'](_0x4cdb86);return _0x1ab469[_0x35a0('0x20')](_0x35a0('0x21'),_0x156f00+'-'+_0x21ed8f+'/'+_0xeee3f8)[_0x35a0('0x1b')](_0x489057);}return null;};}function patchUpdates(_0x4a6a66){return function(_0x192a09){try{jsonpatch[_0x35a0('0x22')](_0x192a09,_0x4a6a66,!![]);}catch(_0x56a556){return BPromise['reject'](_0x56a556);}return _0x192a09['save']();};}function saveUpdates(_0x241005,_0x22590b){return function(_0x4a79f1){if(_0x4a79f1){return _0x4a79f1[_0x35a0('0x23')](_0x241005)['then'](function(_0x224be8){return _0x224be8;});}return null;};}function removeEntity(_0x50163b,_0x49262b){return function(_0x2cbb22){if(_0x2cbb22){return _0x2cbb22['destroy']()[_0x35a0('0x24')](function(){_0x50163b[_0x35a0('0x1a')](0xcc)[_0x35a0('0x25')]();});}};}function handleEntityNotFound(_0x4ba521,_0x490288){return function(_0x550ffc){if(!_0x550ffc){_0x4ba521[_0x35a0('0x26')](0x194);}return _0x550ffc;};}function handleError(_0x37c012,_0x1d8378){_0x1d8378=_0x1d8378||0x1f4;return function(_0x4d0833){logger[_0x35a0('0x27')](_0x4d0833['stack']);if(_0x4d0833[_0x35a0('0x28')]){delete _0x4d0833['name'];}_0x37c012[_0x35a0('0x1a')](_0x1d8378)[_0x35a0('0x29')](_0x4d0833);};}exports[_0x35a0('0x2a')]=function(_0xc24232,_0xcf20b6){var _0x9ec740={},_0x415156={},_0x432bc9={'count':0x0,'rows':[]};var _0x48e652=_[_0x35a0('0x2b')](db[_0x35a0('0x2c')][_0x35a0('0x2d')],function(_0x3fdfc6){return{'name':_0x3fdfc6[_0x35a0('0x2e')],'type':_0x3fdfc6[_0x35a0('0x2f')]['key']};});_0x415156['model']=_[_0x35a0('0x2b')](_0x48e652,_0x35a0('0x28'));_0x415156['query']=_[_0x35a0('0x30')](_0xc24232[_0x35a0('0x31')]);_0x415156[_0x35a0('0x32')]=_[_0x35a0('0x33')](_0x415156[_0x35a0('0x34')],_0x415156['query']);_0x9ec740[_0x35a0('0x35')]=_[_0x35a0('0x33')](_0x415156[_0x35a0('0x34')],qs['fields'](_0xc24232['query'][_0x35a0('0x36')]));_0x9ec740[_0x35a0('0x35')]=_0x9ec740[_0x35a0('0x35')][_0x35a0('0x37')]?_0x9ec740[_0x35a0('0x35')]:_0x415156[_0x35a0('0x34')];if(!_0xc24232[_0x35a0('0x31')]['hasOwnProperty'](_0x35a0('0x38'))){_0x9ec740['limit']=qs[_0x35a0('0x1d')](_0xc24232[_0x35a0('0x31')][_0x35a0('0x1d')]);_0x9ec740[_0x35a0('0x1f')]=qs['offset'](_0xc24232['query']['offset']);}_0x9ec740[_0x35a0('0x39')]=qs[_0x35a0('0x3a')](_0xc24232[_0x35a0('0x31')][_0x35a0('0x3a')]);_0x9ec740[_0x35a0('0x3b')]=qs[_0x35a0('0x32')](_[_0x35a0('0x3c')](_0xc24232[_0x35a0('0x31')],_0x415156[_0x35a0('0x32')]),_0x48e652);if(_0xc24232[_0x35a0('0x31')]['filter']){_0x9ec740[_0x35a0('0x3b')]=_['merge'](_0x9ec740[_0x35a0('0x3b')],{'$or':_[_0x35a0('0x2b')](_0x48e652,function(_0x270411){if(_0x270411[_0x35a0('0x2f')]!==_0x35a0('0x3d')){var _0x4dcc64={};_0x4dcc64[_0x270411[_0x35a0('0x28')]]={'$like':'%'+_0xc24232['query'][_0x35a0('0x3e')]+'%'};return _0x4dcc64;}})});}_0x9ec740=_[_0x35a0('0x3f')]({},_0x9ec740,_0xc24232[_0x35a0('0x40')]);var _0x4bb920={'where':_0x9ec740[_0x35a0('0x3b')]};return db[_0x35a0('0x2c')]['count'](_0x4bb920)[_0x35a0('0x24')](function(_0x4e70ec){_0x432bc9[_0x35a0('0x1e')]=_0x4e70ec;if(_0xc24232['query'][_0x35a0('0x41')]){_0x9ec740[_0x35a0('0x42')]=[{'all':!![]}];}return db[_0x35a0('0x2c')]['findAll'](_0x9ec740);})[_0x35a0('0x24')](function(_0x53c56c){_0x432bc9[_0x35a0('0x43')]=_0x53c56c;return _0x432bc9;})[_0x35a0('0x24')](respondWithFilteredResult(_0xcf20b6,_0x9ec740))['catch'](handleError(_0xcf20b6,null));};exports['show']=function(_0x494cb8,_0x4fa5c0){var _0x354565={'raw':!![],'where':{'id':_0x494cb8[_0x35a0('0x44')]['id']}},_0x35607a={};_0x35607a[_0x35a0('0x34')]=_[_0x35a0('0x30')](db[_0x35a0('0x2c')][_0x35a0('0x2d')]);_0x35607a[_0x35a0('0x31')]=_[_0x35a0('0x30')](_0x494cb8[_0x35a0('0x31')]);_0x35607a[_0x35a0('0x32')]=_[_0x35a0('0x33')](_0x35607a[_0x35a0('0x34')],_0x35607a['query']);_0x354565[_0x35a0('0x35')]=_[_0x35a0('0x33')](_0x35607a['model'],qs[_0x35a0('0x36')](_0x494cb8[_0x35a0('0x31')]['fields']));_0x354565['attributes']=_0x354565[_0x35a0('0x35')][_0x35a0('0x37')]?_0x354565['attributes']:_0x35607a['model'];if(_0x494cb8['query']['includeAll']){_0x354565[_0x35a0('0x42')]=[{'all':!![]}];}_0x354565=_[_0x35a0('0x3f')]({},_0x354565,_0x494cb8['options']);return db[_0x35a0('0x2c')][_0x35a0('0x45')](_0x354565)[_0x35a0('0x24')](handleEntityNotFound(_0x4fa5c0,null))[_0x35a0('0x24')](respondWithResult(_0x4fa5c0,null))['catch'](handleError(_0x4fa5c0,null));};exports['create']=function(_0x215df6,_0x5971ff){return db[_0x35a0('0x2c')]['create'](_0x215df6[_0x35a0('0x46')],{})[_0x35a0('0x24')](respondWithResult(_0x5971ff,0xc9))[_0x35a0('0x47')](handleError(_0x5971ff,null));};exports[_0x35a0('0x23')]=function(_0xd19457,_0x299eb5){if(_0xd19457['body']['id']){delete _0xd19457[_0x35a0('0x46')]['id'];}return db[_0x35a0('0x2c')][_0x35a0('0x45')]({'where':{'id':_0xd19457[_0x35a0('0x44')]['id']}})[_0x35a0('0x24')](handleEntityNotFound(_0x299eb5,null))[_0x35a0('0x24')](saveUpdates(_0xd19457[_0x35a0('0x46')],null))[_0x35a0('0x24')](respondWithResult(_0x299eb5,null))[_0x35a0('0x47')](handleError(_0x299eb5,null));};exports[_0x35a0('0x48')]=function(_0x351398,_0x29af97){return db[_0x35a0('0x2c')][_0x35a0('0x45')]({'where':{'id':_0x351398[_0x35a0('0x44')]['id']}})[_0x35a0('0x24')](handleEntityNotFound(_0x29af97,null))['then'](removeEntity(_0x29af97,null))['catch'](handleError(_0x29af97,null));};exports[_0x35a0('0x49')]=function(_0x5e3642,_0x696df6){return db[_0x35a0('0x2c')]['describe']()[_0x35a0('0x24')](respondWithResult(_0x696df6,null))['catch'](handleError(_0x696df6,null));}; \ No newline at end of file +var _0x2317=['show','params','create','body','find','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x576d8a,_0x2d7bde){var _0x3dc3ef=function(_0xc76758){while(--_0xc76758){_0x576d8a['push'](_0x576d8a['shift']());}};_0x3dc3ef(++_0x2d7bde);}(_0x2317,0x16d));var _0x7231=function(_0x52d27e,_0x22c741){_0x52d27e=_0x52d27e-0x0;var _0x149c10=_0x2317[_0x52d27e];return _0x149c10;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7231('0x0'));var zipdir=require(_0x7231('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7231('0x2'));var moment=require(_0x7231('0x3'));var BPromise=require(_0x7231('0x4'));var Mustache=require('mustache');var util=require(_0x7231('0x5'));var path=require('path');var sox=require(_0x7231('0x6'));var csv=require(_0x7231('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7231('0x8'));var _=require(_0x7231('0x9'));var squel=require(_0x7231('0xa'));var crypto=require(_0x7231('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7231('0xc'));var toCsv=require(_0x7231('0x7'));var querystring=require(_0x7231('0xd'));var Papa=require(_0x7231('0xe'));var Redis=require('ioredis');var authService=require(_0x7231('0xf'));var qs=require(_0x7231('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7231('0x11'));var logger=require(_0x7231('0x12'))(_0x7231('0x13'));var utils=require(_0x7231('0x14'));var config=require(_0x7231('0x15'));var licenseUtil=require(_0x7231('0x16'));var db=require(_0x7231('0x17'))['db'];function respondWithStatusCode(_0x4e6e16,_0x9c2b05){_0x9c2b05=_0x9c2b05||0xcc;return function(_0x39a625){if(_0x39a625){return _0x4e6e16['sendStatus'](_0x9c2b05);}return _0x4e6e16['status'](_0x9c2b05)[_0x7231('0x18')]();};}function respondWithResult(_0x4124cb,_0x4d2e47){_0x4d2e47=_0x4d2e47||0xc8;return function(_0x2776e7){if(_0x2776e7){return _0x4124cb[_0x7231('0x19')](_0x4d2e47)[_0x7231('0x1a')](_0x2776e7);}};}function respondWithFilteredResult(_0x5a2baa,_0x1b36f4){return function(_0x11ae0c){if(_0x11ae0c){var _0x4a84b3=typeof _0x1b36f4[_0x7231('0x1b')]===_0x7231('0x1c')&&typeof _0x1b36f4['limit']===_0x7231('0x1c');var _0x3fd9d2=_0x11ae0c[_0x7231('0x1d')];var _0x1f8915=_0x4a84b3?0x0:_0x1b36f4[_0x7231('0x1b')];var _0x295b9d=_0x4a84b3?_0x11ae0c[_0x7231('0x1d')]:_0x1b36f4[_0x7231('0x1b')]+_0x1b36f4[_0x7231('0x1e')];var _0x275ba7;if(_0x295b9d>=_0x3fd9d2){_0x295b9d=_0x3fd9d2;_0x275ba7=0xc8;}else{_0x275ba7=0xce;}_0x5a2baa['status'](_0x275ba7);return _0x5a2baa[_0x7231('0x1f')]('Content-Range',_0x1f8915+'-'+_0x295b9d+'/'+_0x3fd9d2)[_0x7231('0x1a')](_0x11ae0c);}return null;};}function patchUpdates(_0x12c1fc){return function(_0x107610){try{jsonpatch[_0x7231('0x20')](_0x107610,_0x12c1fc,!![]);}catch(_0x1aab69){return BPromise[_0x7231('0x21')](_0x1aab69);}return _0x107610[_0x7231('0x22')]();};}function saveUpdates(_0x513497,_0x5ebd00){return function(_0x57f611){if(_0x57f611){return _0x57f611[_0x7231('0x23')](_0x513497)[_0x7231('0x24')](function(_0x1310cd){return _0x1310cd;});}return null;};}function removeEntity(_0x5165cb,_0x4984e0){return function(_0x173f4b){if(_0x173f4b){return _0x173f4b[_0x7231('0x25')]()['then'](function(){_0x5165cb[_0x7231('0x19')](0xcc)[_0x7231('0x18')]();});}};}function handleEntityNotFound(_0x5a1054,_0x1ff7f3){return function(_0x42be85){if(!_0x42be85){_0x5a1054[_0x7231('0x26')](0x194);}return _0x42be85;};}function handleError(_0x2e5639,_0x43e4c0){_0x43e4c0=_0x43e4c0||0x1f4;return function(_0x8172d2){logger[_0x7231('0x27')](_0x8172d2['stack']);if(_0x8172d2[_0x7231('0x28')]){delete _0x8172d2[_0x7231('0x28')];}_0x2e5639[_0x7231('0x19')](_0x43e4c0)[_0x7231('0x29')](_0x8172d2);};}exports[_0x7231('0x2a')]=function(_0xa7dc44,_0x4c0d9f){var _0x34aa62={},_0x51a0cd={},_0x3fb40e={'count':0x0,'rows':[]};var _0x3b6657=_[_0x7231('0x2b')](db[_0x7231('0x2c')][_0x7231('0x2d')],function(_0x3dd8f4){return{'name':_0x3dd8f4[_0x7231('0x2e')],'type':_0x3dd8f4['type'][_0x7231('0x2f')]};});_0x51a0cd[_0x7231('0x30')]=_[_0x7231('0x2b')](_0x3b6657,_0x7231('0x28'));_0x51a0cd[_0x7231('0x31')]=_[_0x7231('0x32')](_0xa7dc44[_0x7231('0x31')]);_0x51a0cd['filters']=_[_0x7231('0x33')](_0x51a0cd[_0x7231('0x30')],_0x51a0cd[_0x7231('0x31')]);_0x34aa62[_0x7231('0x34')]=_[_0x7231('0x33')](_0x51a0cd['model'],qs[_0x7231('0x35')](_0xa7dc44['query'][_0x7231('0x35')]));_0x34aa62[_0x7231('0x34')]=_0x34aa62[_0x7231('0x34')]['length']?_0x34aa62[_0x7231('0x34')]:_0x51a0cd['model'];if(!_0xa7dc44[_0x7231('0x31')][_0x7231('0x36')]('nolimit')){_0x34aa62[_0x7231('0x1e')]=qs[_0x7231('0x1e')](_0xa7dc44[_0x7231('0x31')]['limit']);_0x34aa62['offset']=qs['offset'](_0xa7dc44[_0x7231('0x31')]['offset']);}_0x34aa62[_0x7231('0x37')]=qs[_0x7231('0x38')](_0xa7dc44['query'][_0x7231('0x38')]);_0x34aa62[_0x7231('0x39')]=qs['filters'](_[_0x7231('0x3a')](_0xa7dc44['query'],_0x51a0cd['filters']),_0x3b6657);if(_0xa7dc44[_0x7231('0x31')]['filter']){_0x34aa62['where']=_[_0x7231('0x3b')](_0x34aa62[_0x7231('0x39')],{'$or':_[_0x7231('0x2b')](_0x3b6657,function(_0x589445){if(_0x589445['type']!==_0x7231('0x3c')){var _0x16980f={};_0x16980f[_0x589445[_0x7231('0x28')]]={'$like':'%'+_0xa7dc44[_0x7231('0x31')]['filter']+'%'};return _0x16980f;}})});}_0x34aa62=_['merge']({},_0x34aa62,_0xa7dc44[_0x7231('0x3d')]);var _0x83dc67={'where':_0x34aa62['where']};return db[_0x7231('0x2c')][_0x7231('0x1d')](_0x83dc67)[_0x7231('0x24')](function(_0x4b079a){_0x3fb40e[_0x7231('0x1d')]=_0x4b079a;if(_0xa7dc44[_0x7231('0x31')][_0x7231('0x3e')]){_0x34aa62[_0x7231('0x3f')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x7231('0x40')](_0x34aa62);})[_0x7231('0x24')](function(_0xb09b7){_0x3fb40e[_0x7231('0x41')]=_0xb09b7;return _0x3fb40e;})[_0x7231('0x24')](respondWithFilteredResult(_0x4c0d9f,_0x34aa62))[_0x7231('0x42')](handleError(_0x4c0d9f,null));};exports[_0x7231('0x43')]=function(_0x75611a,_0x388608){var _0x42222f={'raw':!![],'where':{'id':_0x75611a[_0x7231('0x44')]['id']}},_0x148cbe={};_0x148cbe[_0x7231('0x30')]=_[_0x7231('0x32')](db[_0x7231('0x2c')][_0x7231('0x2d')]);_0x148cbe[_0x7231('0x31')]=_['keys'](_0x75611a[_0x7231('0x31')]);_0x148cbe['filters']=_['intersection'](_0x148cbe[_0x7231('0x30')],_0x148cbe[_0x7231('0x31')]);_0x42222f[_0x7231('0x34')]=_[_0x7231('0x33')](_0x148cbe['model'],qs[_0x7231('0x35')](_0x75611a[_0x7231('0x31')][_0x7231('0x35')]));_0x42222f[_0x7231('0x34')]=_0x42222f[_0x7231('0x34')]['length']?_0x42222f[_0x7231('0x34')]:_0x148cbe['model'];if(_0x75611a[_0x7231('0x31')][_0x7231('0x3e')]){_0x42222f[_0x7231('0x3f')]=[{'all':!![]}];}_0x42222f=_[_0x7231('0x3b')]({},_0x42222f,_0x75611a[_0x7231('0x3d')]);return db[_0x7231('0x2c')]['find'](_0x42222f)['then'](handleEntityNotFound(_0x388608,null))['then'](respondWithResult(_0x388608,null))['catch'](handleError(_0x388608,null));};exports[_0x7231('0x45')]=function(_0x50f2a0,_0x3390b5){return db[_0x7231('0x2c')][_0x7231('0x45')](_0x50f2a0[_0x7231('0x46')],{})[_0x7231('0x24')](respondWithResult(_0x3390b5,0xc9))['catch'](handleError(_0x3390b5,null));};exports[_0x7231('0x23')]=function(_0x3fb2b3,_0x219270){if(_0x3fb2b3[_0x7231('0x46')]['id']){delete _0x3fb2b3[_0x7231('0x46')]['id'];}return db[_0x7231('0x2c')][_0x7231('0x47')]({'where':{'id':_0x3fb2b3[_0x7231('0x44')]['id']}})[_0x7231('0x24')](handleEntityNotFound(_0x219270,null))[_0x7231('0x24')](saveUpdates(_0x3fb2b3['body'],null))[_0x7231('0x24')](respondWithResult(_0x219270,null))[_0x7231('0x42')](handleError(_0x219270,null));};exports[_0x7231('0x25')]=function(_0x111b75,_0xfe3d6){return db[_0x7231('0x2c')][_0x7231('0x47')]({'where':{'id':_0x111b75[_0x7231('0x44')]['id']}})[_0x7231('0x24')](handleEntityNotFound(_0xfe3d6,null))[_0x7231('0x24')](removeEntity(_0xfe3d6,null))[_0x7231('0x42')](handleError(_0xfe3d6,null));};exports['describe']=function(_0x5b48e0,_0x3bb799){return db['WhatsappTransferReport']['describe']()[_0x7231('0x24')](respondWithResult(_0x3bb799,null))[_0x7231('0x42')](handleError(_0x3bb799,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index d3e5264..ad586bf 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 _0xb9a5=['util','api','bluebird','request-promise','path','exports','define','report_whatsapp_transfer','uniqueid','lodash'];(function(_0x44e4ba,_0x3c0508){var _0x3e18b3=function(_0x3f7746){while(--_0x3f7746){_0x44e4ba['push'](_0x44e4ba['shift']());}};_0x3e18b3(++_0x3c0508);}(_0xb9a5,0x1a3));var _0x5b9a=function(_0x2f8125,_0x260435){_0x2f8125=_0x2f8125-0x0;var _0x332dfb=_0xb9a5[_0x2f8125];return _0x332dfb;};'use strict';var _=require(_0x5b9a('0x0'));var util=require(_0x5b9a('0x1'));var logger=require('../../config/logger')(_0x5b9a('0x2'));var moment=require('moment');var BPromise=require(_0x5b9a('0x3'));var rp=require(_0x5b9a('0x4'));var fs=require('fs');var path=require(_0x5b9a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x5b9a('0x6')]=function(_0x1ae1ef,_0x2b6f32){return _0x1ae1ef[_0x5b9a('0x7')]('WhatsappTransferReport',attributes,{'tableName':_0x5b9a('0x8'),'paranoid':![],'indexes':[{'name':_0x5b9a('0x9'),'fields':[_0x5b9a('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x184f=['rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','moment','request-promise'];(function(_0x5545f7,_0x570414){var _0x52a979=function(_0x28eb97){while(--_0x28eb97){_0x5545f7['push'](_0x5545f7['shift']());}};_0x52a979(++_0x570414);}(_0x184f,0xbe));var _0xf184=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0x184f[_0x999b85];return _0x1d7124;};'use strict';var _=require('lodash');var util=require(_0xf184('0x0'));var logger=require(_0xf184('0x1'))(_0xf184('0x2'));var moment=require(_0xf184('0x3'));var BPromise=require('bluebird');var rp=require(_0xf184('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf184('0x5'));var config=require(_0xf184('0x6'));var attributes=require(_0xf184('0x7'));module[_0xf184('0x8')]=function(_0x2c1130,_0x6fc935){return _0x2c1130[_0xf184('0x9')](_0xf184('0xa'),attributes,{'tableName':_0xf184('0xb'),'paranoid':![],'indexes':[{'name':_0xf184('0xc'),'fields':[_0xf184('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 35d12b3..5dac124 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 _0xbdb5=['jayson/promise','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbdb5,0x1ac));var _0x5bdb=function(_0x483e31,_0xeb01b){_0x483e31=_0x483e31-0x0;var _0xd209a3=_0xbdb5[_0x483e31];return _0xd209a3;};'use strict';var _=require(_0x5bdb('0x0'));var util=require(_0x5bdb('0x1'));var moment=require(_0x5bdb('0x2'));var BPromise=require(_0x5bdb('0x3'));var rs=require(_0x5bdb('0x4'));var fs=require('fs');var Redis=require(_0x5bdb('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5bdb('0x6'))(_0x5bdb('0x7'));var config=require(_0x5bdb('0x8'));var jayson=require(_0x5bdb('0x9'));var client=jayson[_0x5bdb('0xa')][_0x5bdb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x107738,_0x2c01b3,_0x8ee71b){return new BPromise(function(_0x222684,_0x4df69c){return client[_0x5bdb('0xc')](_0x107738,_0x8ee71b)['then'](function(_0x7f7238){logger[_0x5bdb('0xd')](_0x5bdb('0xe'),_0x2c01b3,_0x5bdb('0xf'));logger['debug'](_0x5bdb('0x10'),_0x2c01b3,_0x5bdb('0xf'),JSON[_0x5bdb('0x11')](_0x7f7238));if(_0x7f7238['error']){if(_0x7f7238[_0x5bdb('0x12')][_0x5bdb('0x13')]===0x1f4){logger[_0x5bdb('0x12')](_0x5bdb('0xe'),_0x2c01b3,_0x7f7238[_0x5bdb('0x12')][_0x5bdb('0x14')]);return _0x4df69c(_0x7f7238[_0x5bdb('0x12')][_0x5bdb('0x14')]);}logger[_0x5bdb('0x12')](_0x5bdb('0xe'),_0x2c01b3,_0x7f7238['error'][_0x5bdb('0x14')]);return _0x222684(_0x7f7238[_0x5bdb('0x12')]['message']);}else{logger[_0x5bdb('0xd')](_0x5bdb('0xe'),_0x2c01b3,_0x5bdb('0xf'));_0x222684(_0x7f7238[_0x5bdb('0x15')]['message']);}})[_0x5bdb('0x16')](function(_0x5547c9){logger['error'](_0x5bdb('0xe'),_0x2c01b3,_0x5547c9);_0x4df69c(_0x5547c9);});});} \ No newline at end of file +var _0xdd15=['jayson/promise','http','then','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdd15,0x16e));var _0x5dd1=function(_0x10dbf6,_0x3ff964){_0x10dbf6=_0x10dbf6-0x0;var _0x452147=_0xdd15[_0x10dbf6];return _0x452147;};'use strict';var _=require(_0x5dd1('0x0'));var util=require(_0x5dd1('0x1'));var moment=require(_0x5dd1('0x2'));var BPromise=require(_0x5dd1('0x3'));var rs=require(_0x5dd1('0x4'));var fs=require('fs');var Redis=require(_0x5dd1('0x5'));var db=require(_0x5dd1('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5dd1('0x7'));var jayson=require(_0x5dd1('0x8'));var client=jayson['client'][_0x5dd1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d6e55,_0x303fdf,_0x30533a){return new BPromise(function(_0x29cb73,_0x2bedd1){return client['request'](_0x4d6e55,_0x30533a)[_0x5dd1('0xa')](function(_0x59347d){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x303fdf,_0x5dd1('0xb'));logger[_0x5dd1('0xc')](_0x5dd1('0xd'),_0x303fdf,_0x5dd1('0xb'),JSON[_0x5dd1('0xe')](_0x59347d));if(_0x59347d[_0x5dd1('0xf')]){if(_0x59347d[_0x5dd1('0xf')][_0x5dd1('0x10')]===0x1f4){logger[_0x5dd1('0xf')](_0x5dd1('0x11'),_0x303fdf,_0x59347d[_0x5dd1('0xf')][_0x5dd1('0x12')]);return _0x2bedd1(_0x59347d[_0x5dd1('0xf')]['message']);}logger[_0x5dd1('0xf')](_0x5dd1('0x11'),_0x303fdf,_0x59347d['error'][_0x5dd1('0x12')]);return _0x29cb73(_0x59347d[_0x5dd1('0xf')][_0x5dd1('0x12')]);}else{logger[_0x5dd1('0x13')](_0x5dd1('0x11'),_0x303fdf,'request\x20sent');_0x29cb73(_0x59347d[_0x5dd1('0x14')][_0x5dd1('0x12')]);}})[_0x5dd1('0x15')](function(_0x5859f6){logger[_0x5dd1('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x303fdf,_0x5859f6);_0x2bedd1(_0x5859f6);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 74dcdbc..f9f46e4 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x68f5=['status','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','seedDB','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','online','name','join','Offline\x20apps:'];(function(_0x6785af,_0xde5171){var _0x434651=function(_0x641d81){while(--_0x641d81){_0x6785af['push'](_0x6785af['shift']());}};_0x434651(++_0xde5171);}(_0x68f5,0x11a));var _0x568f=function(_0x1e12c1,_0x1598bd){_0x1e12c1=_0x1e12c1-0x0;var _0x1e9abf=_0x68f5[_0x1e12c1];return _0x1e9abf;};'use strict';var _=require(_0x568f('0x0'));var db=require(_0x568f('0x1'))['db'];var seedDb=require(_0x568f('0x2'));var checkLicense=require('./config/license');var rpc=require(_0x568f('0x3'));var config=require(_0x568f('0x4'));var logger=require(_0x568f('0x5'))(_0x568f('0x6'));var pm2=require(_0x568f('0x7'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x568f('0x8'));var chat=require(_0x568f('0x9'));var whatsapp=require(_0x568f('0xa'));var transcribe=require(_0x568f('0xb'));var provider=require('./config/schedule/cloud-provider');function main(){return db['sequelize'][_0x568f('0xc')]()[_0x568f('0xd')](function(){if(config[_0x568f('0xe')]){return seedDb['default']();}})[_0x568f('0xd')](function(){return checkLicense['default']();})[_0x568f('0xd')](function(){return rpc[_0x568f('0xf')]();})['then'](function(_0x4378fc){logger[_0x568f('0x10')](_0x4378fc);return chat[_0x568f('0x11')]();})[_0x568f('0xd')](function(){return whatsapp[_0x568f('0x11')]();})[_0x568f('0xd')](function(){return schedule[_0x568f('0x11')]();})[_0x568f('0xd')](function(){return transcribe[_0x568f('0x11')]();})['then'](function(){return provider[_0x568f('0x11')]();})[_0x568f('0xd')](function(_0x67503e){logger[_0x568f('0x10')](_0x67503e);return pm2['start'](pm2Config);})[_0x568f('0xd')](function(_0x53c270){var _0x4c1504=_0x53c270[_0x568f('0x12')](function(_0x15a4e5){return typeof _0x15a4e5[_0x568f('0x13')]===_0x568f('0x14')&&_0x15a4e5[_0x568f('0x13')]>=0x0;});if(_0x4c1504[_0x568f('0x15')]>0x0){throw new Error(_0x4c1504[_0x568f('0x15')]+_0x568f('0x16')+_[_0x568f('0x17')](_0x4c1504,function(_0x3d9645){return'\x22'+_0x3d9645[_0x568f('0x18')]['name']+'\x22';}));}logger[_0x568f('0x10')](_0x568f('0x19'),_[_0x568f('0x17')](_[_0x568f('0x12')](_0x53c270,{'status':_0x568f('0x1a')}),_0x568f('0x1b'))[_0x568f('0x1c')]());logger[_0x568f('0x10')](_0x568f('0x1d'),_[_0x568f('0x17')](_[_0x568f('0x12')](_0x53c270,function(_0x22c4e0){return _0x22c4e0[_0x568f('0x1e')]!==_0x568f('0x1a');}),_0x568f('0x1b'))[_0x568f('0x1c')]()||_0x568f('0x1f'));console[_0x568f('0x20')](_0x568f('0x21'));})[_0x568f('0x22')](function(_0x2de331){console[_0x568f('0x20')](_0x568f('0x23'),_0x2de331);logger[_0x568f('0x24')](_0x568f('0x25'),_0x2de331);process[_0x568f('0x26')](0x1);});}main(); \ No newline at end of file +var _0xc99e=['./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','default','listen','start','info','filter','exitCode','number','length','map','pm2_env','name','Online\x20apps:','join','Offline\x20apps:','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash'];(function(_0x43e899,_0x22f1de){var _0xff607e=function(_0x41a955){while(--_0x41a955){_0x43e899['push'](_0x43e899['shift']());}};_0xff607e(++_0x22f1de);}(_0xc99e,0x6e));var _0xec99=function(_0x95d7b3,_0x271f72){_0x95d7b3=_0x95d7b3-0x0;var _0x5a62ef=_0xc99e[_0x95d7b3];return _0x5a62ef;};'use strict';var _=require(_0xec99('0x0'));var db=require(_0xec99('0x1'))['db'];var seedDb=require(_0xec99('0x2'));var checkLicense=require(_0xec99('0x3'));var rpc=require(_0xec99('0x4'));var config=require(_0xec99('0x5'));var logger=require('./config/logger')(_0xec99('0x6'));var pm2=require(_0xec99('0x7'));var pm2Config=require(_0xec99('0x8'));var schedule=require(_0xec99('0x9'));var chat=require(_0xec99('0xa'));var whatsapp=require(_0xec99('0xb'));var transcribe=require(_0xec99('0xc'));var provider=require(_0xec99('0xd'));function main(){return db['sequelize'][_0xec99('0xe')]()[_0xec99('0xf')](function(){if(config['seedDB']){return seedDb[_0xec99('0x10')]();}})[_0xec99('0xf')](function(){return checkLicense['default']();})['then'](function(){return rpc[_0xec99('0x11')]();})[_0xec99('0xf')](function(_0x1a057a){logger['info'](_0x1a057a);return chat[_0xec99('0x12')]();})[_0xec99('0xf')](function(){return whatsapp[_0xec99('0x12')]();})[_0xec99('0xf')](function(){return schedule[_0xec99('0x12')]();})[_0xec99('0xf')](function(){return transcribe['start']();})[_0xec99('0xf')](function(){return provider['start']();})[_0xec99('0xf')](function(_0x53d44e){logger[_0xec99('0x13')](_0x53d44e);return pm2['start'](pm2Config);})['then'](function(_0xc7627){var _0x569825=_0xc7627[_0xec99('0x14')](function(_0x159c47){return typeof _0x159c47[_0xec99('0x15')]===_0xec99('0x16')&&_0x159c47[_0xec99('0x15')]>=0x0;});if(_0x569825[_0xec99('0x17')]>0x0){throw new Error(_0x569825[_0xec99('0x17')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xec99('0x18')](_0x569825,function(_0x52d9a7){return'\x22'+_0x52d9a7[_0xec99('0x19')][_0xec99('0x1a')]+'\x22';}));}logger[_0xec99('0x13')](_0xec99('0x1b'),_['map'](_['filter'](_0xc7627,{'status':'online'}),_0xec99('0x1a'))[_0xec99('0x1c')]());logger[_0xec99('0x13')](_0xec99('0x1d'),_[_0xec99('0x18')](_[_0xec99('0x14')](_0xc7627,function(_0x1644a8){return _0x1644a8['status']!=='online';}),_0xec99('0x1a'))[_0xec99('0x1c')]()||'None');console[_0xec99('0x1e')](_0xec99('0x1f'));})[_0xec99('0x20')](function(_0x2c4a60){console[_0xec99('0x1e')](_0xec99('0x21'),_0x2c4a60);logger[_0xec99('0x22')](_0xec99('0x23'),_0x2c4a60);process[_0xec99('0x24')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 3904208..8c42b91 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 _0x9c44=['showWebBar','lastLoginAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','user','ChatInteraction','findOne','params','then','status','disposition','unmanaged','json','Unmanaged.','catch','isAuthenticated','headers','authorization','startsWith','Basic','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','User','find','sub','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','use','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','sign','options','promisify','toString','hex','floor','now','HS512','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','crypto','util','moment','secrets','session','role','name','internal','email','userpic','voicePause','chatPause','faxPause','smsPause'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require(_0x49c4('0x0'));var licenseUtil=require(_0x49c4('0x1'));var encryptor=require(_0x49c4('0x2'));var _=require(_0x49c4('0x3'));var jwt=require(_0x49c4('0x4'));var expressJwt=require(_0x49c4('0x5'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0x49c4('0x6'));var BPromise=require('bluebird');var util=require(_0x49c4('0x7'));var moment=require(_0x49c4('0x8'));var validateJwt=expressJwt({'secret':config[_0x49c4('0x9')][_0x49c4('0xa')]});var userAttributes=['id',_0x49c4('0xb'),'fullname',_0x49c4('0xc'),_0x49c4('0xd'),_0x49c4('0xe'),_0x49c4('0xf'),'permissions','md5secret',_0x49c4('0x10'),_0x49c4('0x11'),'mailPause',_0x49c4('0x12'),_0x49c4('0x13'),'openchannelPause','pauseType',_0x49c4('0x14'),_0x49c4('0x15'),'lastPauseAt',_0x49c4('0x16'),_0x49c4('0x17'),'passwordResetAt',_0x49c4('0x18'),_0x49c4('0x19'),_0x49c4('0x1a'),_0x49c4('0x1b'),_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),'phoneBarPrefixRequired',_0x49c4('0x20'),_0x49c4('0x21'),_0x49c4('0x22'),_0x49c4('0x23'),_0x49c4('0x24'),'privacyEnabled',_0x49c4('0x25'),_0x49c4('0x26'),'downloadVoiceRecordings','downloadOmnichannelInteractions',_0x49c4('0x27'),_0x49c4('0x28'),_0x49c4('0x29'),'chatAutoanswer',_0x49c4('0x2a'),'emailAutoanswer',_0x49c4('0x2b'),_0x49c4('0x2c'),_0x49c4('0x2d'),_0x49c4('0x2e'),_0x49c4('0x2f'),_0x49c4('0x30'),_0x49c4('0x31'),_0x49c4('0x32'),_0x49c4('0x33')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])['use'](function(_0x1c99b1,_0x4f0b62,_0x592bb8){if(_0x1c99b1[_0x49c4('0x34')]){_0x592bb8();}else{return db[_0x49c4('0x35')][_0x49c4('0x36')]({'where':{'id':_0x1c99b1[_0x49c4('0x37')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0x49c4('0x38')](function(_0x9cb797){if(_0x9cb797&&_0x9cb797['closed']){return _0x4f0b62[_0x49c4('0x39')](_0x9cb797[_0x49c4('0x3a')]===_0x49c4('0x3b')?0x195:0x193)[_0x49c4('0x3c')]({'message':_0x9cb797['disposition']==='unmanaged'?_0x49c4('0x3d'):'Forbidden.'});}else{_0x592bb8();}})[_0x49c4('0x3e')](function(_0x3852b2){_0x592bb8(_0x3852b2);});}});};exports[_0x49c4('0x3f')]=function isAuthenticated(_0x372a47){return compose()['use'](function(_0x889909,_0x2b2793,_0x46e04d){var _0x4f28a2;if(_0x889909[_0x49c4('0x40')][_0x49c4('0x41')]){if(_[_0x49c4('0x42')](_0x889909[_0x49c4('0x40')][_0x49c4('0x41')],_0x49c4('0x43'))){var _0x46f7ea=basicAuth(_0x889909);db['User']['find']({'where':{'name':_0x46f7ea['name']}})[_0x49c4('0x38')](function(_0x7ee704){if(!_0x7ee704||!_0x7ee704[_0x49c4('0x44')](_0x46f7ea[_0x49c4('0x45')])){return _0x2b2793[_0x49c4('0x39')](0x191)['json']({'message':_0x49c4('0x46')});}_0x889909[_0x49c4('0x34')]={'id':_0x7ee704['id']};_0x46e04d();})[_0x49c4('0x3e')](function(_0x24bba9){_0x46e04d(_0x24bba9);});}else if(_['startsWith'](_0x889909['headers'][_0x49c4('0x41')],_0x49c4('0x47'))){validateJwt(_0x889909,_0x2b2793,_0x46e04d);}else{if(_0x372a47){_0x46e04d();}else{return _0x2b2793[_0x49c4('0x39')](0x193)[_0x49c4('0x3c')]({'message':_0x49c4('0x48')});}}}else if(_0x889909['query'][_0x49c4('0x49')]){try{var _0x84c621={'audience':hardwareConf[_0x49c4('0x4a')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x889909['query'][_0x49c4('0x49')],_0x84c621)[_0x49c4('0x38')](function(_0x3bec0a){return db[_0x49c4('0x4b')][_0x49c4('0x4c')]({'where':{'id':_0x3bec0a[_0x49c4('0x4d')]}})[_0x49c4('0x38')](function(_0x27ef5f){_0x4f28a2=_0x27ef5f;return db[_0x49c4('0x4e')]['findOne']({'where':{'id':0x1},'attributes':[_0x49c4('0x4f'),'blockDuration'],'raw':!![]});})[_0x49c4('0x38')](function(_0x349791){if(!_0x4f28a2||!_[_0x49c4('0x50')](_0x4f28a2[_0x49c4('0x51')],_0x3bec0a['nonce'])){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x52')});}if(_0x4f28a2['disabled']){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x53')});}if(_0x4f28a2[_0x49c4('0x54')]){if(_0x349791[_0x49c4('0x55')]>0x0){if(moment(_0x4f28a2[_0x49c4('0x56')])[_0x49c4('0x57')](_0x349791[_0x49c4('0x55')],_0x49c4('0x58'))>moment()){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x53')});}}_0x889909[_0x49c4('0x34')]={'id':_0x4f28a2['id']};_0x46e04d();});})[_0x49c4('0x3e')](function(){return _0x2b2793[_0x49c4('0x39')](0x191)[_0x49c4('0x3c')]({'message':_0x49c4('0x53')});});}catch(_0x248c0a){_0x46e04d(_0x248c0a);}}else if(_0x372a47){_0x46e04d();}else{return _0x2b2793[_0x49c4('0x39')](0x193)[_0x49c4('0x3c')]({'message':_0x49c4('0x48')});}})[_0x49c4('0x59')](function(_0x4e38bc,_0x212366,_0x49829e){if(_0x4e38bc[_0x49c4('0x34')]){db[_0x49c4('0x4b')][_0x49c4('0x4c')]({'where':{'id':_0x4e38bc[_0x49c4('0x34')]['id']},'attributes':userAttributes})[_0x49c4('0x38')](function(_0x281b83){if(!_0x281b83){return _0x212366['status'](0x194)['json']({'message':_0x49c4('0x5a')});}_0x4e38bc[_0x49c4('0x34')]=_0x281b83;_0x49829e();})[_0x49c4('0x3e')](function(_0x117151){_0x49829e(_0x117151);});}else if(_0x372a47){_0x49829e();}else{return _0x212366['status'](0x194)[_0x49c4('0x3c')]({'message':_0x49c4('0x5b')});}});};exports[_0x49c4('0x5c')]=function canUpdate(){return compose()[_0x49c4('0x59')](function(_0x81a674,_0x3bde49,_0x1a9593){return licenseUtil[_0x49c4('0x5d')]()[_0x49c4('0x38')](function(_0x5640d3){if(_0x5640d3[_0x49c4('0x5e')]){_0x1a9593();}else{return _0x3bde49['status'](0x193)[_0x49c4('0x3c')]({'message':_0x49c4('0x5f')});}})[_0x49c4('0x3e')](function(_0x258abe){_0x1a9593(_0x258abe);});});};exports[_0x49c4('0x60')]=function isWebrtcLicence(){return compose()['use'](function(_0x592e8e,_0x15b674,_0x384862){return licenseUtil[_0x49c4('0x5d')]()[_0x49c4('0x38')](function(_0x5d4790){if(_0x5d4790[_0x49c4('0x61')]){_0x384862();}else{return _0x15b674['status'](0x193)[_0x49c4('0x3c')]({'message':'Forbidden'});}})[_0x49c4('0x3e')](function(_0x906d3){_0x384862(_0x906d3);});});};exports[_0x49c4('0x62')]=function(_0x27adfe,_0x2d8087,_0x30bea5){_0x27adfe[_0x49c4('0x62')]=!![];return _0x30bea5();};exports['signToken']=function signToken(_0x3b731f){return signJwt(_0x3b731f);};exports[_0x49c4('0x63')]=function(_0x4a5c34,_0x1e1ac4){if(!_0x4a5c34[_0x49c4('0x34')]){return _0x1e1ac4[_0x49c4('0x39')](0x194)[_0x49c4('0x3c')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x5d8bf0={'payload':{'id':_0x4a5c34[_0x49c4('0x34')]['id'],'role':_0x4a5c34['user'][_0x49c4('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5d8bf0)[_0x49c4('0x38')](function(_0x3811b2){_0x1e1ac4[_0x49c4('0x64')](_0x49c4('0x65'),_0x3811b2);_0x1e1ac4[_0x49c4('0x66')](_0x49c4('0x67'));})['catch'](function(_0x1f26c2){return _0x1e1ac4[_0x49c4('0x39')](0x1f4)[_0x49c4('0x68')](_0x1f26c2);});};exports[_0x49c4('0x69')]=function(_0x17ef75){if(_[_0x49c4('0x6a')](_0x17ef75[_0x49c4('0x51')])||_[_0x49c4('0x6a')](_0x17ef75[_0x49c4('0x6b')])){return null;}else{return createJwt(_0x17ef75);}};exports[_0x49c4('0x6c')]=function(_0x5b822f){_0x5b822f['apiKeyNonce']=generateNonce();_0x5b822f[_0x49c4('0x6b')]=generateIssuedAt();return createJwt(_0x5b822f);};exports[_0x49c4('0x6d')]=function(_0x527e74,_0x59a8bc){var _0x77163d=_0x527e74['query']['apikey'];if(_0x77163d){var _0x3208c2={'nonce':_0x59a8bc[_0x49c4('0x51')],'iat':_0x59a8bc[_0x49c4('0x6b')],'audience':hardwareConf[_0x49c4('0x4a')](),'issuer':hardwareConf[_0x49c4('0x4a')]()};return verifyJwt(_0x77163d,_0x3208c2)[_0x49c4('0x38')](function(){return generateApiKey(_0x59a8bc);});}else{throw{'message':_0x49c4('0x6e')};}};exports['validatePasswordPattern']=function(_0x859dde){var _0xcc6a2b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xcc6a2b[_0x49c4('0x6f')](_0x859dde))throw new db[(_0x49c4('0x70'))][(_0x49c4('0x71'))](_0x49c4('0x72'));return;};exports['validatePasswordHistory']=function(_0x5c7ddd,_0x1ef0c1,_0x155c43){var _0x2a6308=encryptor[_0x49c4('0x73')](_0x1ef0c1)[_0x49c4('0x74')](',');for(var _0x6b2592=0x0;_0x6b2592<_0x155c43;_0x6b2592++){if(!_0x2a6308[_0x6b2592])break;if(_0x5c7ddd[_0x49c4('0x75')]()===_0x2a6308[_0x6b2592]['toLowerCase']()){var _0x45d715=util[_0x49c4('0x76')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x155c43);if(_0x155c43===0x1){_0x45d715=_0x49c4('0x77');}throw new db['Sequelize'][(_0x49c4('0x71'))](_0x45d715);}}return;};exports[_0x49c4('0x78')]=function(_0x9eaa84,_0x2fe89a){var _0x845f7e=_0x2fe89a?encryptor[_0x49c4('0x73')](_0x2fe89a)[_0x49c4('0x74')](','):[];if(_0x845f7e[_0x49c4('0x79')]===0x5){_0x845f7e['splice'](-0x1,0x1);}_0x845f7e[_0x49c4('0x7a')](_0x9eaa84);return encryptor[_0x49c4('0x7b')](_0x845f7e['join'](','));};function signJwt(_0x10dec7){var _0x299e74=BPromise['promisify'](jwt[_0x49c4('0x7c')],{'context':jwt});var _0x42e0e6=_0x10dec7['secret']||config['secrets']['session'];return new BPromise(function(_0x513879,_0xc43386){_0x299e74(_0x10dec7['payload'],_0x42e0e6,_0x10dec7[_0x49c4('0x7d')])[_0x49c4('0x38')](function(_0x515240){_0x513879(_0x515240);})[_0x49c4('0x3e')](function(_0xdb2b33){_0xc43386(_0xdb2b33);});});}function verifyJwt(_0x5ac9f0,_0x34272f,_0x3dcf4c){var _0x167e84=BPromise[_0x49c4('0x7e')](jwt['verify'],{'context':jwt});var _0x431921=_0x3dcf4c||config[_0x49c4('0x9')][_0x49c4('0xa')];return new BPromise(function(_0x20e97d,_0x5d3375){_0x167e84(_0x5ac9f0,_0x431921,_0x34272f)[_0x49c4('0x38')](function(_0x4a93bc){_0x20e97d(_0x4a93bc);})['catch'](function(_0x58259d){_0x5d3375(_0x58259d);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x49c4('0x7f')](_0x49c4('0x80'));}function generateIssuedAt(){return Math[_0x49c4('0x81')](Date[_0x49c4('0x82')]()/0x3e8)['toString']();}function createJwt(_0x4daa6d){var _0x340523={'payload':{'iat':_0x4daa6d[_0x49c4('0x6b')],'nonce':_0x4daa6d[_0x49c4('0x51')]},'options':{'algorithm':_0x49c4('0x83'),'subject':_0x4daa6d['id'][_0x49c4('0x7f')](),'issuer':hardwareConf[_0x49c4('0x4a')](),'audience':hardwareConf[_0x49c4('0x4a')]()}};return signJwt(_0x340523)[_0x49c4('0x38')](function(_0x4d49e0){return{'iat':_0x4daa6d[_0x49c4('0x6b')],'nonce':_0x4daa6d['apiKeyNonce'],'token':_0x4d49e0};});} \ No newline at end of file +var _0xb43b=['headers','then','authenticate','pass','status','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','User','find','sub','allowedLoginAttempts','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','minutes','User\x20object\x20not\x20found.','getLicense','update','Forbidden','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','apiKeyNonce','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','unshift','encryptString','join','promisify','sign','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','moment','session','role','fullname','name','internal','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','allowmessenger','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarPrefixRequired','phoneBarRemoteControl','interface','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','whatsappAutoanswer','isChatInteractionAuthorized','use','ChatInteraction','findOne','params','closed','disposition','unmanaged','json','Forbidden.','catch','isAuthenticated','authorization','startsWith'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xb43b,0x1b2));var _0xbb43=function(_0x39b080,_0x1c5221){_0x39b080=_0x39b080-0x0;var _0x51cb55=_0xb43b[_0x39b080];return _0x51cb55;};'use strict';var db=require(_0xbb43('0x0'))['db'];var config=require(_0xbb43('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xbb43('0x2'));var encryptor=require(_0xbb43('0x3'));var _=require(_0xbb43('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xbb43('0x5'));var compose=require(_0xbb43('0x6'));var basicAuth=require(_0xbb43('0x7'));var crypto=require(_0xbb43('0x8'));var BPromise=require('bluebird');var util=require('util');var moment=require(_0xbb43('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0xbb43('0xa')]});var userAttributes=['id',_0xbb43('0xb'),_0xbb43('0xc'),_0xbb43('0xd'),_0xbb43('0xe'),'email',_0xbb43('0xf'),_0xbb43('0x10'),'md5secret',_0xbb43('0x11'),_0xbb43('0x12'),_0xbb43('0x13'),_0xbb43('0x14'),_0xbb43('0x15'),_0xbb43('0x16'),'pauseType',_0xbb43('0x17'),_0xbb43('0x18'),'lastPauseAt','crudPermissions',_0xbb43('0x19'),'passwordResetAt','alias',_0xbb43('0x1a'),'phoneBarAutoAnswerDelay',_0xbb43('0x1b'),_0xbb43('0x1c'),'phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires',_0xbb43('0x1d'),_0xbb43('0x1e'),'phoneBarRemoteControlPort','hotdesk',_0xbb43('0x1f'),'userProfileId','privacyEnabled',_0xbb43('0x20'),_0xbb43('0x21'),_0xbb43('0x22'),'downloadOmnichannelInteractions',_0xbb43('0x23'),'ignorePauseForPreviewCalls',_0xbb43('0x24'),_0xbb43('0x25'),'chatAutoanswerDelay','emailAutoanswer',_0xbb43('0x26'),_0xbb43('0x27'),_0xbb43('0x28'),_0xbb43('0x29'),'openchannelAutoanswerDelay',_0xbb43('0x2a'),'faxAutoanswerDelay',_0xbb43('0x2b'),'whatsappAutoanswerDelay'];exports[_0xbb43('0x2c')]=function(){return this['isAuthenticated'](!![])[_0xbb43('0x2d')](function(_0x451cbd,_0x577ddd,_0x1d0768){if(_0x451cbd['user']){_0x1d0768();}else{return db[_0xbb43('0x2e')][_0xbb43('0x2f')]({'where':{'id':_0x451cbd[_0xbb43('0x30')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})['then'](function(_0x269ca5){if(_0x269ca5&&_0x269ca5[_0xbb43('0x31')]){return _0x577ddd['status'](_0x269ca5[_0xbb43('0x32')]===_0xbb43('0x33')?0x195:0x193)[_0xbb43('0x34')]({'message':_0x269ca5[_0xbb43('0x32')]==='unmanaged'?'Unmanaged.':_0xbb43('0x35')});}else{_0x1d0768();}})[_0xbb43('0x36')](function(_0xa88db0){_0x1d0768(_0xa88db0);});}});};exports[_0xbb43('0x37')]=function isAuthenticated(_0x510b05){return compose()[_0xbb43('0x2d')](function(_0x21d386,_0x473828,_0x539730){var _0x2ad6da;if(_0x21d386['headers'][_0xbb43('0x38')]){if(_[_0xbb43('0x39')](_0x21d386[_0xbb43('0x3a')][_0xbb43('0x38')],'Basic')){var _0x157d62=basicAuth(_0x21d386);db['User']['find']({'where':{'name':_0x157d62['name']}})[_0xbb43('0x3b')](function(_0x573a05){if(!_0x573a05||!_0x573a05[_0xbb43('0x3c')](_0x157d62[_0xbb43('0x3d')])){return _0x473828[_0xbb43('0x3e')](0x191)['json']({'message':_0xbb43('0x3f')});}_0x21d386[_0xbb43('0x40')]={'id':_0x573a05['id']};_0x539730();})[_0xbb43('0x36')](function(_0xd987fa){_0x539730(_0xd987fa);});}else if(_[_0xbb43('0x39')](_0x21d386[_0xbb43('0x3a')][_0xbb43('0x38')],_0xbb43('0x41'))){validateJwt(_0x21d386,_0x473828,_0x539730);}else{if(_0x510b05){_0x539730();}else{return _0x473828['status'](0x193)[_0xbb43('0x34')]({'message':_0xbb43('0x42')});}}}else if(_0x21d386[_0xbb43('0x43')][_0xbb43('0x44')]){try{var _0x4015ec={'audience':hardwareConf[_0xbb43('0x45')](),'issuer':hardwareConf[_0xbb43('0x45')]()};verifyJwt(_0x21d386[_0xbb43('0x43')][_0xbb43('0x44')],_0x4015ec)[_0xbb43('0x3b')](function(_0x21346a){return db[_0xbb43('0x46')][_0xbb43('0x47')]({'where':{'id':_0x21346a[_0xbb43('0x48')]}})[_0xbb43('0x3b')](function(_0x405f36){_0x2ad6da=_0x405f36;return db['Setting'][_0xbb43('0x2f')]({'where':{'id':0x1},'attributes':[_0xbb43('0x49'),'blockDuration'],'raw':!![]});})[_0xbb43('0x3b')](function(_0x2c9a7c){if(!_0x2ad6da||!_[_0xbb43('0x4a')](_0x2ad6da['apiKeyNonce'],_0x21346a['nonce'])){return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':_0xbb43('0x4b')});}if(_0x2ad6da['disabled']){return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':_0xbb43('0x4c')});}if(_0x2ad6da[_0xbb43('0x4d')]){if(_0x2c9a7c[_0xbb43('0x4e')]>0x0){if(moment(_0x2ad6da[_0xbb43('0x4f')])['add'](_0x2c9a7c[_0xbb43('0x4e')],_0xbb43('0x50'))>moment()){return _0x473828[_0xbb43('0x3e')](0x191)[_0xbb43('0x34')]({'message':_0xbb43('0x4c')});}}else{return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x21d386[_0xbb43('0x40')]={'id':_0x2ad6da['id']};_0x539730();});})[_0xbb43('0x36')](function(){return _0x473828['status'](0x191)[_0xbb43('0x34')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1fcf64){_0x539730(_0x1fcf64);}}else if(_0x510b05){_0x539730();}else{return _0x473828[_0xbb43('0x3e')](0x193)[_0xbb43('0x34')]({'message':_0xbb43('0x42')});}})['use'](function(_0x3e0871,_0x136bd4,_0x59750b){if(_0x3e0871[_0xbb43('0x40')]){db['User'][_0xbb43('0x47')]({'where':{'id':_0x3e0871[_0xbb43('0x40')]['id']},'attributes':userAttributes})[_0xbb43('0x3b')](function(_0x14e57e){if(!_0x14e57e){return _0x136bd4[_0xbb43('0x3e')](0x194)[_0xbb43('0x34')]({'message':'User\x20not\x20found.'});}_0x3e0871[_0xbb43('0x40')]=_0x14e57e;_0x59750b();})['catch'](function(_0x307f1e){_0x59750b(_0x307f1e);});}else if(_0x510b05){_0x59750b();}else{return _0x136bd4[_0xbb43('0x3e')](0x194)[_0xbb43('0x34')]({'message':_0xbb43('0x51')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xbb43('0x2d')](function(_0x39f75f,_0x4bc351,_0x24ba15){return licenseUtil[_0xbb43('0x52')]()[_0xbb43('0x3b')](function(_0x40f519){if(_0x40f519[_0xbb43('0x53')]){_0x24ba15();}else{return _0x4bc351['status'](0x193)[_0xbb43('0x34')]({'message':_0xbb43('0x54')});}})['catch'](function(_0x1a66f0){_0x24ba15(_0x1a66f0);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0x4d7034,_0x5e2e6d,_0x1c3482){return licenseUtil['getLicense']()[_0xbb43('0x3b')](function(_0x5e5c86){if(_0x5e5c86[_0xbb43('0x55')]){_0x1c3482();}else{return _0x5e2e6d[_0xbb43('0x3e')](0x193)[_0xbb43('0x34')]({'message':'Forbidden'});}})[_0xbb43('0x36')](function(_0x4d9f18){_0x1c3482(_0x4d9f18);});});};exports[_0xbb43('0x56')]=function(_0x2518bf,_0xd43d24,_0x29840e){_0x2518bf[_0xbb43('0x56')]=!![];return _0x29840e();};exports[_0xbb43('0x57')]=function signToken(_0x37d8d3){return signJwt(_0x37d8d3);};exports['setTokenCookie']=function(_0x93f6e7,_0x26ea59){if(!_0x93f6e7[_0xbb43('0x40')]){return _0x26ea59[_0xbb43('0x3e')](0x194)['json']({'message':_0xbb43('0x58')});}var _0x3233b7={'payload':{'id':_0x93f6e7[_0xbb43('0x40')]['id'],'role':_0x93f6e7[_0xbb43('0x40')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3233b7)[_0xbb43('0x3b')](function(_0x3fdb10){_0x26ea59[_0xbb43('0x59')]('motion.token',_0x3fdb10);_0x26ea59[_0xbb43('0x5a')](_0xbb43('0x5b'));})[_0xbb43('0x36')](function(_0x1dc40a){return _0x26ea59[_0xbb43('0x3e')](0x1f4)['send'](_0x1dc40a);});};exports['retrieveApiKey']=function(_0xb44557){if(_['isNil'](_0xb44557[_0xbb43('0x5c')])||_[_0xbb43('0x5d')](_0xb44557['apiKeyIat'])){return null;}else{return createJwt(_0xb44557);}};exports[_0xbb43('0x5e')]=function(_0x3719dc){_0x3719dc[_0xbb43('0x5c')]=generateNonce();_0x3719dc[_0xbb43('0x5f')]=generateIssuedAt();return createJwt(_0x3719dc);};exports[_0xbb43('0x60')]=function(_0x5cb3c6,_0x124f88){var _0x539ffc=_0x5cb3c6['query'][_0xbb43('0x44')];if(_0x539ffc){var _0x1b9307={'nonce':_0x124f88[_0xbb43('0x5c')],'iat':_0x124f88[_0xbb43('0x5f')],'audience':hardwareConf[_0xbb43('0x45')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x539ffc,_0x1b9307)['then'](function(){return generateApiKey(_0x124f88);});}else{throw{'message':_0xbb43('0x61')};}};exports[_0xbb43('0x62')]=function(_0x3a84ad){var _0x308646=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x308646[_0xbb43('0x63')](_0x3a84ad))throw new db[(_0xbb43('0x64'))][(_0xbb43('0x65'))](_0xbb43('0x66'));return;};exports[_0xbb43('0x67')]=function(_0x578b85,_0x1b6f96,_0xb996d7){var _0x432bd8=encryptor[_0xbb43('0x68')](_0x1b6f96)[_0xbb43('0x69')](',');for(var _0x1fae27=0x0;_0x1fae27<_0xb996d7;_0x1fae27++){if(!_0x432bd8[_0x1fae27])break;if(_0x578b85[_0xbb43('0x6a')]()===_0x432bd8[_0x1fae27][_0xbb43('0x6a')]()){var _0x3e01e4=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0xb996d7);if(_0xb996d7===0x1){_0x3e01e4=_0xbb43('0x6b');}throw new db[(_0xbb43('0x64'))][(_0xbb43('0x65'))](_0x3e01e4);}}return;};exports[_0xbb43('0x6c')]=function(_0x38814a,_0x19e27e){var _0x2e01fb=_0x19e27e?encryptor['decryptString'](_0x19e27e)[_0xbb43('0x69')](','):[];if(_0x2e01fb['length']===0x5){_0x2e01fb['splice'](-0x1,0x1);}_0x2e01fb[_0xbb43('0x6d')](_0x38814a);return encryptor[_0xbb43('0x6e')](_0x2e01fb[_0xbb43('0x6f')](','));};function signJwt(_0x22ce17){var _0x24393a=BPromise[_0xbb43('0x70')](jwt[_0xbb43('0x71')],{'context':jwt});var _0x341481=_0x22ce17['secret']||config['secrets'][_0xbb43('0xa')];return new BPromise(function(_0x2b96b8,_0x137e75){_0x24393a(_0x22ce17[_0xbb43('0x72')],_0x341481,_0x22ce17[_0xbb43('0x73')])[_0xbb43('0x3b')](function(_0x12717e){_0x2b96b8(_0x12717e);})[_0xbb43('0x36')](function(_0x3ca6ad){_0x137e75(_0x3ca6ad);});});}function verifyJwt(_0x555426,_0x165936,_0x392d1a){var _0x234bc7=BPromise[_0xbb43('0x70')](jwt[_0xbb43('0x74')],{'context':jwt});var _0x33a4db=_0x392d1a||config['secrets'][_0xbb43('0xa')];return new BPromise(function(_0xb48be2,_0x42e437){_0x234bc7(_0x555426,_0x33a4db,_0x165936)[_0xbb43('0x3b')](function(_0xc34a02){_0xb48be2(_0xc34a02);})['catch'](function(_0x3c260f){_0x42e437(_0x3c260f);});});}function generateNonce(){return crypto[_0xbb43('0x75')](0x10)[_0xbb43('0x76')](_0xbb43('0x77'));}function generateIssuedAt(){return Math[_0xbb43('0x78')](Date[_0xbb43('0x79')]()/0x3e8)[_0xbb43('0x76')]();}function createJwt(_0x2992ea){var _0x10fd8b={'payload':{'iat':_0x2992ea[_0xbb43('0x5f')],'nonce':_0x2992ea['apiKeyNonce']},'options':{'algorithm':_0xbb43('0x7a'),'subject':_0x2992ea['id']['toString'](),'issuer':hardwareConf[_0xbb43('0x45')](),'audience':hardwareConf[_0xbb43('0x45')]()}};return signJwt(_0x10fd8b)[_0xbb43('0x3b')](function(_0x3dbcd9){return{'iat':_0x2992ea[_0xbb43('0x5f')],'nonce':_0x2992ea['apiKeyNonce'],'token':_0x3dbcd9};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index e4c5116..caa28e2 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 _0x2032=['map','findOne','slice','all','length','fieldType','type','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','where','user','ids','tag','countFilteredContacts','count','buildContactsQuery','clause','getFilteredContacts','rows','describe','CmContact','filter','startsWith','cf_'];(function(_0x4ad9c2,_0x4b1132){var _0xe5eb8c=function(_0x4f72c5){while(--_0x4f72c5){_0x4ad9c2['push'](_0x4ad9c2['shift']());}};_0xe5eb8c(++_0x4b1132);}(_0x2032,0xd9));var _0x2203=function(_0x46654e,_0x4a5d33){_0x46654e=_0x46654e-0x0;var _0x89237d=_0x2032[_0x46654e];return _0x89237d;};'use strict';var _=require('lodash');var sqlUtils=require(_0x2203('0x0'));var db=require(_0x2203('0x1'))['db'];exports[_0x2203('0x2')]=function(_0x4c28da,_0x486390,_0x228a29,_0x4b4c7f){var _0x46c49a={'count':0x0,'rows':[]};var _0x880dcd=sqlUtils[_0x2203('0x3')](_0x486390,_0x4c28da);if(_0x880dcd){return Promise[_0x2203('0x4')](_0x46c49a);}var _0x3f7ba1=sqlUtils[_0x2203('0x5')]();var _0x2e0f63={};var _0x2676aa=![];var _0x18c4d6=![];return Promise[_0x2203('0x4')]()[_0x2203('0x6')](function(){if(_0x4c28da['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x4c28da[_0x2203('0x7')],_0x4b4c7f);}else{return sqlUtils['parseQueryParameters'](_0x4c28da,_0x4b4c7f);}})[_0x2203('0x6')](function(_0x2972f3){_0x3f7ba1[_0x2203('0x8')](_0x2972f3['default']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3['fields']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3['filter']);_0x3f7ba1[_0x2203('0x8')](_0x2972f3[_0x2203('0x9')]['clause']);_0x2e0f63=_0x2972f3['tags'];_0x18c4d6=_0x2972f3['user']['skip'];return sqlUtils['checkListsRestrictions'](_0x486390,_0x4c28da,_0x18c4d6);})[_0x2203('0x6')](function(_0x538b30){_0x3f7ba1['where'](_0x538b30);var _0x21a3af=_0x4c28da[_0x2203('0x7')]?_0x2e0f63[_0x2203('0xa')]:_0x4c28da[_0x2203('0xb')];_0x2676aa=_0x21a3af?!![]:![];return sqlUtils[_0x2203('0xc')](_0x3f7ba1,_0x21a3af);})[_0x2203('0x6')](function(_0x2c36e6){_0x46c49a[_0x2203('0xd')]=_0x2c36e6;if(_0x46c49a[_0x2203('0xd')]===0x0){return;}return sqlUtils[_0x2203('0xe')](_0x3f7ba1,_0x4c28da['fields'],_0x228a29,_0x2676aa,_0x2e0f63[_0x2203('0xf')],_0x18c4d6);})[_0x2203('0x6')](function(_0x4893ff){if(!_0x4893ff){return[];}return sqlUtils[_0x2203('0x10')](_0x4893ff,_0x4c28da,_0x228a29);})[_0x2203('0x6')](function(_0x4aeb9f){_0x46c49a[_0x2203('0x11')]=_0x4aeb9f;return _0x46c49a;})['catch'](function(_0x2904ba){throw _0x2904ba;});};exports[_0x2203('0x12')]=function(){var _0x3c8c34={};var _0x3b4034=[];return db[_0x2203('0x13')][_0x2203('0x12')]()['then'](function(_0x13d3f7){_0x3c8c34=_0x13d3f7;var _0x50822b=Object['keys'](_0x3c8c34)[_0x2203('0x14')](function(_0x496d82){return _[_0x2203('0x15')](_0x496d82,_0x2203('0x16'))?_0x496d82:undefined;});var _0x5d4c4e=_0x50822b[_0x2203('0x17')](function(_0x5e29cd){return db['CmCustomField'][_0x2203('0x18')]({'where':{'id':_0x5e29cd[_0x2203('0x19')](0x3)},'raw':!![]});});return Promise[_0x2203('0x1a')](_0x5d4c4e);})[_0x2203('0x6')](function(_0x1244f4){for(var _0x3114ef=0x0;_0x3114ef<_0x1244f4[_0x2203('0x1b')];_0x3114ef++){if(_0x1244f4[_0x3114ef]){var _0x250349='cf_'+_0x1244f4[_0x3114ef]['id'];_0x3c8c34[_0x250349][_0x2203('0x1c')]=_0x1244f4[_0x3114ef][_0x2203('0x1d')];}}_0x3b4034=_[_0x2203('0x17')](Object['keys'](_0x3c8c34),function(_0xb2071b){return{'name':_0xb2071b,'type':_0x3c8c34[_0xb2071b][_0x2203('0x1d')]};});return _0x3b4034;})['catch'](function(_0xd6e109){throw _0xd6e109;});}; \ No newline at end of file +var _0xb10b=['user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter'];(function(_0x561f31,_0x4cb2af){var _0x2f4c62=function(_0x3019e5){while(--_0x3019e5){_0x561f31['push'](_0x561f31['shift']());}};_0x2f4c62(++_0x4cb2af);}(_0xb10b,0x12a));var _0xbb10=function(_0x405f28,_0x3ea99f){_0x405f28=_0x405f28-0x0;var _0x1a6075=_0xb10b[_0x405f28];return _0x1a6075;};'use strict';var _=require(_0xbb10('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xbb10('0x1'))['db'];exports[_0xbb10('0x2')]=function(_0x1dcb08,_0x4d688c,_0x4541ae,_0x9bbed){var _0x460981={'count':0x0,'rows':[]};var _0x22320e=sqlUtils[_0xbb10('0x3')](_0x4d688c,_0x1dcb08);if(_0x22320e){return Promise[_0xbb10('0x4')](_0x460981);}var _0x481979=sqlUtils[_0xbb10('0x5')]();var _0x3cdd53={};var _0x513741=![];var _0x1b9e94=![];return Promise[_0xbb10('0x4')]()[_0xbb10('0x6')](function(){if(_0x1dcb08[_0xbb10('0x7')]){return sqlUtils[_0xbb10('0x8')](_0x1dcb08[_0xbb10('0x7')],_0x9bbed);}else{return sqlUtils[_0xbb10('0x9')](_0x1dcb08,_0x9bbed);}})[_0xbb10('0x6')](function(_0x5ab04a){_0x481979['where'](_0x5ab04a[_0xbb10('0xa')]);_0x481979[_0xbb10('0xb')](_0x5ab04a[_0xbb10('0xc')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xd')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xe')][_0xbb10('0xf')]);_0x3cdd53=_0x5ab04a[_0xbb10('0x10')];_0x1b9e94=_0x5ab04a[_0xbb10('0xe')][_0xbb10('0x11')];return sqlUtils[_0xbb10('0x12')](_0x4d688c,_0x1dcb08,_0x1b9e94);})['then'](function(_0x26e021){_0x481979[_0xbb10('0xb')](_0x26e021);var _0x45b9d6=_0x1dcb08[_0xbb10('0x7')]?_0x3cdd53[_0xbb10('0x13')]:_0x1dcb08[_0xbb10('0x14')];_0x513741=_0x45b9d6?!![]:![];return sqlUtils[_0xbb10('0x15')](_0x481979,_0x45b9d6);})[_0xbb10('0x6')](function(_0x3e26f4){_0x460981[_0xbb10('0x16')]=_0x3e26f4;if(_0x460981['count']===0x0){return;}return sqlUtils[_0xbb10('0x17')](_0x481979,_0x1dcb08[_0xbb10('0xc')],_0x4541ae,_0x513741,_0x3cdd53[_0xbb10('0xf')],_0x1b9e94);})[_0xbb10('0x6')](function(_0x378da8){if(!_0x378da8){return[];}return sqlUtils[_0xbb10('0x18')](_0x378da8,_0x1dcb08,_0x4541ae);})[_0xbb10('0x6')](function(_0x30efc6){_0x460981[_0xbb10('0x19')]=_0x30efc6;return _0x460981;})[_0xbb10('0x1a')](function(_0x48b6e9){throw _0x48b6e9;});};exports[_0xbb10('0x1b')]=function(){var _0x19f48d={};var _0x388fab=[];return db[_0xbb10('0x1c')][_0xbb10('0x1b')]()[_0xbb10('0x6')](function(_0x4deb49){_0x19f48d=_0x4deb49;var _0x12f888=Object[_0xbb10('0x1d')](_0x19f48d)['filter'](function(_0x4c4b0d){return _[_0xbb10('0x1e')](_0x4c4b0d,_0xbb10('0x1f'))?_0x4c4b0d:undefined;});var _0x2e911d=_0x12f888[_0xbb10('0x20')](function(_0x445761){return db[_0xbb10('0x21')][_0xbb10('0x22')]({'where':{'id':_0x445761[_0xbb10('0x23')](0x3)},'raw':!![]});});return Promise[_0xbb10('0x24')](_0x2e911d);})[_0xbb10('0x6')](function(_0x3ba6cd){for(var _0x26ad93=0x0;_0x26ad93<_0x3ba6cd['length'];_0x26ad93++){if(_0x3ba6cd[_0x26ad93]){var _0x4fedac='cf_'+_0x3ba6cd[_0x26ad93]['id'];_0x19f48d[_0x4fedac][_0xbb10('0x25')]=_0x3ba6cd[_0x26ad93][_0xbb10('0x26')];}}_0x388fab=_[_0xbb10('0x20')](Object['keys'](_0x19f48d),function(_0x2fdde9){return{'name':_0x2fdde9,'type':_0x19f48d[_0x2fdde9][_0xbb10('0x26')]};});return _0x388fab;})[_0xbb10('0x1a')](function(_0x1d5e95){throw _0x1d5e95;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index f182b35..f3558f8 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 _0xde28=['fax','email','CompanyId','createdAt','updatedAt','deletedAt','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','conditions','length','find','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','default','value','start','end','map','tags','clause','ids','User','user','uc.UserId\x20=\x20?','skip','some','Contact','push','c.ListId\x20IN\x20?','concat','and','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','role','c.ListId\x20IS\x20NULL','attributes','group','limit','offset','subqry.id','having','order','DESC','subqry.','Tag','findAll','name','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','Tags','COUNT(*)','isEmpty','t.id\x20IN\x20?','sequelize','toString','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','agent','ListId','autocomplete','true','select','from','cm_contacts','where','subqry','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone'];(function(_0xb1e42f,_0x321a3f){var _0x513359=function(_0x2cf4a2){while(--_0x2cf4a2){_0xb1e42f['push'](_0xb1e42f['shift']());}};_0x513359(++_0x321a3f);}(_0xde28,0xc4));var _0x8de2=function(_0xb347b9,_0x3c4105){_0xb347b9=_0xb347b9-0x0;var _0x40091b=_0xde28[_0xb347b9];return _0x40091b;};'use strict';var _=require(_0x8de2('0x0'));var squel=require(_0x8de2('0x1'));var as=require(_0x8de2('0x2'));var qs=require(_0x8de2('0x3'));var utils=require(_0x8de2('0x4'));var db=require(_0x8de2('0x5'))['db'];function skipContactsQuery(_0x4601e8,_0x256ba2){var _0x1379e8=![];if(_0x4601e8['role']===_0x8de2('0x6')&&!_0x256ba2['search']&&!_0x256ba2[_0x8de2('0x7')]&&_0x256ba2[_0x8de2('0x8')]!==_0x8de2('0x9')){_0x1379e8=!![];}return _0x1379e8;}function getContactsSubquery(){return squel[_0x8de2('0xa')]()[_0x8de2('0xb')](_0x8de2('0xc'),'c')[_0x8de2('0xd')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x12141f,_0x164c63){var _0x7038ee=_0x164c63?'c':_0x8de2('0xe');_0x12141f['left_join']('cm_user_has_contacts','uc','uc.CmContactId\x20=\x20'+_0x7038ee+_0x8de2('0xf'))[_0x8de2('0x10')](_0x8de2('0x11'),'ct',_0x8de2('0x12')+_0x7038ee+'.id')[_0x8de2('0x10')](_0x8de2('0x13'),'t',_0x8de2('0x14'));return _0x12141f;}function addFieldsToQuery(_0x4b27e4,_0x387200,_0x123afd,_0x473811,_0xdec70b){var _0x601c7f=_0xdec70b?'c':_0x8de2('0xe');if(!_0x387200){_0x387200=['id',_0x8de2('0x15'),_0x8de2('0x16'),_0x8de2('0x17'),'mobile',_0x8de2('0x18'),_0x8de2('0x19'),_0x8de2('0x7'),_0x8de2('0x1a'),_0x8de2('0x1b'),_0x8de2('0x1c'),_0x8de2('0x1d'),'TagIds'];}else if(!_0x387200['includes']('id')){_0x387200['push']('id');}var _0x18c500=_0x123afd&&_0xdec70b||!_0x123afd&&!_0xdec70b;if(_0x473811){_0x18c500=_0x473811&&_0xdec70b||!_0x473811&&!_0xdec70b;}_0x387200[_0x8de2('0x1e')](function(_0xc998c6){if(_0xc998c6===_0x8de2('0x1f')){if(_0x18c500){_0x4b27e4[_0x8de2('0x20')](_0x8de2('0x21'),_0xc998c6);}else if(_0x123afd||_0x473811){_0x4b27e4[_0x8de2('0x20')](_0x601c7f+'.'+_0xc998c6);}}else{_0x4b27e4['field'](_0x601c7f+'.'+_0xc998c6);}});return _0x4b27e4;}function getSqlClauses(){var _0xf5f170={'default':squel['expr'](),'fields':squel[_0x8de2('0x22')](),'filter':squel[_0x8de2('0x22')](),'tags':{'clause':squel[_0x8de2('0x22')](),'ids':null},'user':{'clause':squel[_0x8de2('0x22')](),'skip':![]}};return _0xf5f170;}function parseTagParameter(_0x5125f1){var _0x333f94=squel[_0x8de2('0x22')]();if(_0x5125f1){var _0x1301a1=utils[_0x8de2('0x23')](_0x5125f1);_0x1301a1[_0x8de2('0x1e')](function(_0x1bdb9e){_0x333f94['or'](_0x8de2('0x24'),'%,'+_0x1bdb9e+',%');});}return _0x333f94;}function parseSearchFilter(_0x50d56c){var _0x328e6c=squel[_0x8de2('0x22')]();if(_0x50d56c){var _0x37bb5c=_0x50d56c['replace']('\x5c','\x5c\x5c')[_0x8de2('0x25')](/'/g,'\x27\x27');if(_0x37bb5c[_0x8de2('0x26')]('\x20')['length']>0x1){_0x328e6c['or'](_0x8de2('0x27'),qs[_0x8de2('0x28')](_0x37bb5c),null);}else{if(qs[_0x8de2('0x29')](_0x37bb5c)){_0x328e6c['or']('c.id\x20LIKE\x20?',_0x37bb5c+'%');_0x328e6c['or'](_0x8de2('0x2a'),_0x37bb5c+'%');_0x328e6c['or']('c.mobile\x20LIKE\x20?',_0x37bb5c+'%');_0x328e6c['or'](_0x8de2('0x2b'),_0x37bb5c+'%');}else if(qs[_0x8de2('0x2c')](_0x37bb5c)){_0x328e6c['or']('c.email\x20LIKE\x20?',_0x37bb5c+'%');}else{_0x328e6c['or']('c.firstName\x20LIKE\x20?','%'+_0x37bb5c+'%');_0x328e6c['or'](_0x8de2('0x2d'),'%'+_0x37bb5c+'%');_0x328e6c['or'](_0x8de2('0x2e'),'%'+_0x37bb5c+'%');}}}return _0x328e6c;}function parseAdvancedSearchFilter(_0x490863,_0x284e11){var _0x36f08a=getSqlClauses();var _0x485830=as[_0x8de2('0x2f')](_0x490863);var _0x4e33d8=_0x485830['sqlOperator'];for(var _0x3190d1=0x0;_0x3190d1<_0x485830[_0x8de2('0x30')][_0x8de2('0x31')];_0x3190d1++){var _0x45affa=_0x485830[_0x8de2('0x30')][_0x3190d1];var _0x5811b4='c';var _0x508004=_[_0x8de2('0x32')](_0x284e11,['name',_0x45affa['field']]);if(_0x508004){if(_0x45affa[_0x8de2('0x20')]===_0x8de2('0x33')||_0x508004[_0x8de2('0x34')]===_0x8de2('0x35')){_0x45affa[_0x8de2('0x36')]=_0x8de2('0x37');}var _0x5cf342=as[_0x8de2('0x38')](_0x5811b4,_0x508004[_0x8de2('0x39')],_0x45affa);_0x36f08a[_0x8de2('0x3a')][_0x4e33d8](_0x5cf342['text'],_0x5cf342[_0x8de2('0x3b')][_0x8de2('0x3c')],_0x5cf342['value'][_0x8de2('0x3d')]);}else{if(_0x45affa[_0x8de2('0x20')]==='Tag'){var _0x4fbc63=_0x45affa['value']['split'](',')[_0x8de2('0x3e')](function(_0x4fca6d){return Number(_0x4fca6d);});var _0x23defe=parseTagParameter(_0x4fbc63);_0x36f08a[_0x8de2('0x3f')][_0x8de2('0x40')]['and'](_0x23defe);_0x36f08a[_0x8de2('0x3f')][_0x8de2('0x41')]=_0x4fbc63;}else if(_0x45affa[_0x8de2('0x20')]===_0x8de2('0x42')){_0x36f08a[_0x8de2('0x43')][_0x8de2('0x40')]['and'](_0x8de2('0x44'),_0x45affa[_0x8de2('0x3b')]);_0x36f08a[_0x8de2('0x43')][_0x8de2('0x45')]=!![];}}}return _0x36f08a;}function parseModelFields(_0x2686b5,_0x53ff2b){var _0x3ad0bb=squel[_0x8de2('0x22')]();var _0x4c9300=_(_0x2686b5)['keys']()['map'](function(_0x5887c0){return _[_0x8de2('0x46')](_0x53ff2b,['name',_0x5887c0])?_0x5887c0:undefined;})['compact']()[_0x8de2('0x3b')]();if(_0x2686b5[_0x8de2('0x47')]){_0x4c9300[_0x8de2('0x48')]('Contact');}if(_0x4c9300[_0x8de2('0x31')]>0x0){_0x4c9300['forEach'](function(_0x387599){if(_0x387599==='ListId'){_0x3ad0bb['and'](_0x8de2('0x49'),[][_0x8de2('0x4a')](_0x2686b5[_0x387599]));}else if(_0x387599===_0x8de2('0x47')){var _0x23b1c0='%'+_0x2686b5[_0x387599]+'%';_0x3ad0bb[_0x8de2('0x4b')](_0x8de2('0x4c'),_0x23b1c0);}else{_0x3ad0bb[_0x8de2('0x4b')]('c.'+_0x387599+_0x8de2('0x4d'),_0x2686b5[_0x387599]);}});}return _0x3ad0bb;}function parseQueryParameters(_0x54c21f,_0x20c71c){var _0x1c73a1=getSqlClauses();return Promise[_0x8de2('0x4e')]()[_0x8de2('0x4f')](function(){return parseModelFields(_0x54c21f,_0x20c71c);})[_0x8de2('0x4f')](function(_0x561d19){_0x1c73a1[_0x8de2('0x50')][_0x8de2('0x4b')](_0x561d19);return parseTagParameter(_0x54c21f[_0x8de2('0x51')]);})[_0x8de2('0x4f')](function(_0x36db10){_0x1c73a1[_0x8de2('0x3f')][_0x8de2('0x40')][_0x8de2('0x4b')](_0x36db10);return parseSearchFilter(_0x54c21f[_0x8de2('0x52')]);})[_0x8de2('0x4f')](function(_0x5a4a95){_0x1c73a1[_0x8de2('0x52')]=_0x5a4a95;return _0x1c73a1;});}function checkListsRestrictions(_0x18706a,_0x4e9603,_0x4de835){var _0xb235e4=squel['expr']();return Promise[_0x8de2('0x4e')]()[_0x8de2('0x4f')](function(){if(_0x4e9603['search']&&_0x18706a[_0x8de2('0x53')]==='agent'&&!_0x4de835){return _0x18706a['getLists']({'attributes':['id'],'raw':!![]});}})[_0x8de2('0x4f')](function(_0x47457e){if(_0x47457e){if(_0x47457e[_0x8de2('0x31')]===0x0){_0xb235e4['and'](_0x8de2('0x54'));}else{_0xb235e4[_0x8de2('0x4b')](_0x8de2('0x49'),_[_0x8de2('0x3e')](_0x47457e,'id'));}}})[_0x8de2('0x4f')](function(){return _0xb235e4;});}function buildContactsQuery(_0x41c52a,_0x5193c3,_0x3bfcf5,_0x31977d,_0x35a78c,_0x136639){if(_0x5193c3){_0x5193c3=_0x3bfcf5[_0x8de2('0x55')];}_0x41c52a=addFieldsToQuery(_0x41c52a,_0x5193c3,_0x31977d,_0x136639,!![]);var _0x9d9dda=squel['select']();_0x9d9dda=addFieldsToQuery(_0x9d9dda,_0x5193c3,_0x31977d,_0x136639,![]);if(_0x31977d||_0x136639){_0x41c52a=applyJoinClauses(_0x41c52a,!![]);_0x41c52a[_0x8de2('0x56')]('c.id');if(_0x3bfcf5[_0x8de2('0x57')]){_0x9d9dda['limit'](_0x3bfcf5[_0x8de2('0x57')]);}if(_0x3bfcf5[_0x8de2('0x58')]){_0x9d9dda['offset'](_0x3bfcf5[_0x8de2('0x58')]);}}else{_0x9d9dda=applyJoinClauses(_0x9d9dda,![]);_0x9d9dda[_0x8de2('0x56')](_0x8de2('0x59'));if(_0x3bfcf5['limit']){_0x41c52a[_0x8de2('0x57')](_0x3bfcf5['limit']);}if(_0x3bfcf5[_0x8de2('0x58')]){_0x41c52a[_0x8de2('0x58')](_0x3bfcf5[_0x8de2('0x58')]);}}_0x9d9dda[_0x8de2('0x5a')](_0x35a78c);if(_0x3bfcf5[_0x8de2('0x5b')]){_0x3bfcf5[_0x8de2('0x5b')][_0x8de2('0x1e')](function(_0x15ad1c){_0x41c52a[_0x8de2('0x5b')]('c.'+_0x15ad1c[0x0],_0x15ad1c[0x1]===_0x8de2('0x5c')?![]:!![]);_0x9d9dda[_0x8de2('0x5b')](_0x8de2('0x5d')+_0x15ad1c[0x0],_0x15ad1c[0x1]==='DESC'?![]:!![]);});}_0x9d9dda[_0x8de2('0xb')](_0x41c52a,_0x8de2('0xe'));return _0x9d9dda;}function getFilteredContacts(_0x271586){var _0x4d778b=[];return db[_0x8de2('0x5e')][_0x8de2('0x5f')]({'attributes':['id',_0x8de2('0x60'),_0x8de2('0x61')],'raw':!![]})[_0x8de2('0x4f')](function(_0x33cf81){_0x4d778b=_[_0x8de2('0x62')](_0x33cf81,'id');var _0x45df00={'type':db[_0x8de2('0x63')][_0x8de2('0x64')][_0x8de2('0x65')],'model':db[_0x8de2('0x66')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize']['query'](_0x271586['toString'](),_0x45df00);})['then'](function(_0x3851c5){_0x3851c5[_0x8de2('0x1e')](function(_0x3d55c5){if(_0x3d55c5[_0x8de2('0x1f')]){_0x3d55c5[_0x8de2('0x67')]=[];_0x3d55c5[_0x8de2('0x1f')]['split'](',')['forEach'](function(_0x27bc73){_0x3d55c5[_0x8de2('0x67')][_0x8de2('0x48')](_0x4d778b[_0x27bc73]);});}delete _0x3d55c5[_0x8de2('0x1f')];});return _0x3851c5;});}function countFilteredContacts(_0x4c4494,_0x4f4f20){var _0x393f2=_0x4c4494['clone']();_0x393f2[_0x8de2('0x20')](_0x8de2('0x68'));_0x393f2=applyJoinClauses(_0x393f2,!![]);_0x4c4494[_0x8de2('0x56')]('c.id');var _0x5a8c01=utils['getSelectedTags'](_0x4f4f20);if(!_[_0x8de2('0x69')](_0x5a8c01)){_0x393f2[_0x8de2('0xd')](_0x8de2('0x6a'),_0x5a8c01);}var _0x129933={'type':db['Sequelize'][_0x8de2('0x64')][_0x8de2('0x65')],'raw':!![]};return db[_0x8de2('0x6b')]['query'](_0x393f2[_0x8de2('0x6c')](),_0x129933)[_0x8de2('0x4f')](function(_0x49eb83){return _0x49eb83[0x0][_0x8de2('0x68')];});}module[_0x8de2('0x6d')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xe4e3=['email','CompanyId','updatedAt','deletedAt','TagIds','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','datetime','castTo','DATE','buildExpression','default','text','value','Tag','map','clause','tags','ids','User','user','uc.UserId\x20=\x20?','keys','some','compact','push','Contact','and','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','getLists','c.ListId\x20IS\x20NULL','attributes','select','group','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','c.id','isEmpty','exports','lodash','../parsers/advancedSearch','../interaction/utils','../../mysqldb','role','ListId','from','where','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','firstName','lastName','fax'];(function(_0x43659e,_0x19fe5f){var _0x4c8b1b=function(_0x8b3d5){while(--_0x8b3d5){_0x43659e['push'](_0x43659e['shift']());}};_0x4c8b1b(++_0x19fe5f);}(_0xe4e3,0x189));var _0x3e4e=function(_0x2f778a,_0x415717){_0x2f778a=_0x2f778a-0x0;var _0x87cbd4=_0xe4e3[_0x2f778a];return _0x87cbd4;};'use strict';var _=require(_0x3e4e('0x0'));var squel=require('squel');var as=require(_0x3e4e('0x1'));var qs=require('../parsers/qs');var utils=require(_0x3e4e('0x2'));var db=require(_0x3e4e('0x3'))['db'];function skipContactsQuery(_0x480cb6,_0x1e2bc0){var _0x5585e5=![];if(_0x480cb6[_0x3e4e('0x4')]==='agent'&&!_0x1e2bc0['search']&&!_0x1e2bc0[_0x3e4e('0x5')]&&_0x1e2bc0['autocomplete']!=='true'){_0x5585e5=!![];}return _0x5585e5;}function getContactsSubquery(){return squel['select']()[_0x3e4e('0x6')]('cm_contacts','c')[_0x3e4e('0x7')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x365643,_0x5bd5ca){var _0x11e52b=_0x5bd5ca?'c':_0x3e4e('0x8');_0x365643['left_join'](_0x3e4e('0x9'),'uc',_0x3e4e('0xa')+_0x11e52b+_0x3e4e('0xb'))[_0x3e4e('0xc')](_0x3e4e('0xd'),'ct',_0x3e4e('0xe')+_0x11e52b+'.id')[_0x3e4e('0xc')](_0x3e4e('0xf'),'t','t.id\x20=\x20ct.TagId');return _0x365643;}function addFieldsToQuery(_0x5df288,_0x56d7e6,_0x201925,_0x16aab5,_0x10b98a){var _0x2dd4fe=_0x10b98a?'c':_0x3e4e('0x8');if(!_0x56d7e6){_0x56d7e6=['id',_0x3e4e('0x10'),_0x3e4e('0x11'),'phone','mobile',_0x3e4e('0x12'),_0x3e4e('0x13'),_0x3e4e('0x5'),_0x3e4e('0x14'),'createdAt',_0x3e4e('0x15'),_0x3e4e('0x16'),_0x3e4e('0x17')];}else if(!_0x56d7e6['includes']('id')){_0x56d7e6['push']('id');}var _0xcf6803=_0x201925&&_0x10b98a||!_0x201925&&!_0x10b98a;if(_0x16aab5){_0xcf6803=_0x16aab5&&_0x10b98a||!_0x16aab5&&!_0x10b98a;}_0x56d7e6[_0x3e4e('0x18')](function(_0x44e2b0){if(_0x44e2b0===_0x3e4e('0x17')){if(_0xcf6803){_0x5df288[_0x3e4e('0x19')](_0x3e4e('0x1a'),_0x44e2b0);}else if(_0x201925||_0x16aab5){_0x5df288[_0x3e4e('0x19')](_0x2dd4fe+'.'+_0x44e2b0);}}else{_0x5df288[_0x3e4e('0x19')](_0x2dd4fe+'.'+_0x44e2b0);}});return _0x5df288;}function getSqlClauses(){var _0x300519={'default':squel['expr'](),'fields':squel[_0x3e4e('0x1b')](),'filter':squel['expr'](),'tags':{'clause':squel[_0x3e4e('0x1b')](),'ids':null},'user':{'clause':squel[_0x3e4e('0x1b')](),'skip':![]}};return _0x300519;}function parseTagParameter(_0x84fc08){var _0x46dbc6=squel[_0x3e4e('0x1b')]();if(_0x84fc08){var _0x278b30=utils[_0x3e4e('0x1c')](_0x84fc08);_0x278b30[_0x3e4e('0x18')](function(_0x2388c6){_0x46dbc6['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2388c6+',%');});}return _0x46dbc6;}function parseSearchFilter(_0x58d75c){var _0x566cb9=squel[_0x3e4e('0x1b')]();if(_0x58d75c){var _0xde22d=_0x58d75c[_0x3e4e('0x1d')]('\x5c','\x5c\x5c')[_0x3e4e('0x1d')](/'/g,'\x27\x27');if(_0xde22d[_0x3e4e('0x1e')]('\x20')[_0x3e4e('0x1f')]>0x1){_0x566cb9['or'](_0x3e4e('0x20'),qs['getFullTextValue'](_0xde22d),null);}else{if(qs[_0x3e4e('0x21')](_0xde22d)){_0x566cb9['or'](_0x3e4e('0x22'),_0xde22d+'%');_0x566cb9['or'](_0x3e4e('0x23'),_0xde22d+'%');_0x566cb9['or'](_0x3e4e('0x24'),_0xde22d+'%');_0x566cb9['or'](_0x3e4e('0x25'),_0xde22d+'%');}else if(qs['isEmail'](_0xde22d)){_0x566cb9['or'](_0x3e4e('0x26'),_0xde22d+'%');}else{_0x566cb9['or'](_0x3e4e('0x27'),'%'+_0xde22d+'%');_0x566cb9['or'](_0x3e4e('0x28'),'%'+_0xde22d+'%');_0x566cb9['or'](_0x3e4e('0x26'),'%'+_0xde22d+'%');}}}return _0x566cb9;}function parseAdvancedSearchFilter(_0x44c84b,_0x26a426){var _0x26d186=getSqlClauses();var _0x5363dc=as[_0x3e4e('0x29')](_0x44c84b);var _0x4208ee=_0x5363dc[_0x3e4e('0x2a')];for(var _0x588319=0x0;_0x588319<_0x5363dc[_0x3e4e('0x2b')]['length'];_0x588319++){var _0x932d6a=_0x5363dc[_0x3e4e('0x2b')][_0x588319];var _0x45e8a4='c';var _0x404823=_[_0x3e4e('0x2c')](_0x26a426,[_0x3e4e('0x2d'),_0x932d6a[_0x3e4e('0x19')]]);if(_0x404823){if(_0x932d6a['field']==='dateOfBirth'||_0x404823['fieldType']===_0x3e4e('0x2e')){_0x932d6a[_0x3e4e('0x2f')]=_0x3e4e('0x30');}var _0x2842f3=as[_0x3e4e('0x31')](_0x45e8a4,_0x404823['type'],_0x932d6a);_0x26d186[_0x3e4e('0x32')][_0x4208ee](_0x2842f3[_0x3e4e('0x33')],_0x2842f3['value']['start'],_0x2842f3[_0x3e4e('0x34')]['end']);}else{if(_0x932d6a[_0x3e4e('0x19')]===_0x3e4e('0x35')){var _0x195b54=_0x932d6a['value'][_0x3e4e('0x1e')](',')[_0x3e4e('0x36')](function(_0x2e2aed){return Number(_0x2e2aed);});var _0xb6a160=parseTagParameter(_0x195b54);_0x26d186['tags'][_0x3e4e('0x37')]['and'](_0xb6a160);_0x26d186[_0x3e4e('0x38')][_0x3e4e('0x39')]=_0x195b54;}else if(_0x932d6a[_0x3e4e('0x19')]===_0x3e4e('0x3a')){_0x26d186[_0x3e4e('0x3b')][_0x3e4e('0x37')]['and'](_0x3e4e('0x3c'),_0x932d6a[_0x3e4e('0x34')]);_0x26d186[_0x3e4e('0x3b')]['skip']=!![];}}}return _0x26d186;}function parseModelFields(_0x1857fe,_0x4d9977){var _0x4b75fc=squel[_0x3e4e('0x1b')]();var _0x18c918=_(_0x1857fe)[_0x3e4e('0x3d')]()[_0x3e4e('0x36')](function(_0x291719){return _[_0x3e4e('0x3e')](_0x4d9977,[_0x3e4e('0x2d'),_0x291719])?_0x291719:undefined;})[_0x3e4e('0x3f')]()[_0x3e4e('0x34')]();if(_0x1857fe['Contact']){_0x18c918[_0x3e4e('0x40')](_0x3e4e('0x41'));}if(_0x18c918[_0x3e4e('0x1f')]>0x0){_0x18c918['forEach'](function(_0x42ca66){if(_0x42ca66===_0x3e4e('0x5')){_0x4b75fc[_0x3e4e('0x42')](_0x3e4e('0x43'),[]['concat'](_0x1857fe[_0x42ca66]));}else if(_0x42ca66===_0x3e4e('0x41')){var _0x329f5b='%'+_0x1857fe[_0x42ca66]+'%';_0x4b75fc['and'](_0x3e4e('0x44'),_0x329f5b);}else{_0x4b75fc['and']('c.'+_0x42ca66+_0x3e4e('0x45'),_0x1857fe[_0x42ca66]);}});}return _0x4b75fc;}function parseQueryParameters(_0x2aff93,_0x1614a2){var _0x5164fa=getSqlClauses();return Promise[_0x3e4e('0x46')]()[_0x3e4e('0x47')](function(){return parseModelFields(_0x2aff93,_0x1614a2);})[_0x3e4e('0x47')](function(_0x200676){_0x5164fa[_0x3e4e('0x48')]['and'](_0x200676);return parseTagParameter(_0x2aff93[_0x3e4e('0x49')]);})['then'](function(_0x16f802){_0x5164fa['tags'][_0x3e4e('0x37')][_0x3e4e('0x42')](_0x16f802);return parseSearchFilter(_0x2aff93[_0x3e4e('0x4a')]);})[_0x3e4e('0x47')](function(_0x41d360){_0x5164fa[_0x3e4e('0x4a')]=_0x41d360;return _0x5164fa;});}function checkListsRestrictions(_0x4b38ac,_0x27b39f,_0x491098){var _0x25fea1=squel['expr']();return Promise[_0x3e4e('0x46')]()['then'](function(){if(_0x27b39f['search']&&_0x4b38ac[_0x3e4e('0x4')]==='agent'&&!_0x491098){return _0x4b38ac[_0x3e4e('0x4b')]({'attributes':['id'],'raw':!![]});}})[_0x3e4e('0x47')](function(_0x4f5124){if(_0x4f5124){if(_0x4f5124[_0x3e4e('0x1f')]===0x0){_0x25fea1[_0x3e4e('0x42')](_0x3e4e('0x4c'));}else{_0x25fea1[_0x3e4e('0x42')]('c.ListId\x20IN\x20?',_[_0x3e4e('0x36')](_0x4f5124,'id'));}}})[_0x3e4e('0x47')](function(){return _0x25fea1;});}function buildContactsQuery(_0xdc6584,_0x18091d,_0x44d04d,_0x1799fd,_0x37d448,_0x4b9eb2){if(_0x18091d){_0x18091d=_0x44d04d[_0x3e4e('0x4d')];}_0xdc6584=addFieldsToQuery(_0xdc6584,_0x18091d,_0x1799fd,_0x4b9eb2,!![]);var _0xc7d8a7=squel[_0x3e4e('0x4e')]();_0xc7d8a7=addFieldsToQuery(_0xc7d8a7,_0x18091d,_0x1799fd,_0x4b9eb2,![]);if(_0x1799fd||_0x4b9eb2){_0xdc6584=applyJoinClauses(_0xdc6584,!![]);_0xdc6584[_0x3e4e('0x4f')]('c.id');if(_0x44d04d[_0x3e4e('0x50')]){_0xc7d8a7['limit'](_0x44d04d['limit']);}if(_0x44d04d[_0x3e4e('0x51')]){_0xc7d8a7['offset'](_0x44d04d[_0x3e4e('0x51')]);}}else{_0xc7d8a7=applyJoinClauses(_0xc7d8a7,![]);_0xc7d8a7[_0x3e4e('0x4f')](_0x3e4e('0x52'));if(_0x44d04d[_0x3e4e('0x50')]){_0xdc6584[_0x3e4e('0x50')](_0x44d04d[_0x3e4e('0x50')]);}if(_0x44d04d['offset']){_0xdc6584['offset'](_0x44d04d[_0x3e4e('0x51')]);}}_0xc7d8a7[_0x3e4e('0x53')](_0x37d448);if(_0x44d04d[_0x3e4e('0x54')]){_0x44d04d[_0x3e4e('0x54')][_0x3e4e('0x18')](function(_0x5ac113){_0xdc6584[_0x3e4e('0x54')]('c.'+_0x5ac113[0x0],_0x5ac113[0x1]===_0x3e4e('0x55')?![]:!![]);_0xc7d8a7[_0x3e4e('0x54')](_0x3e4e('0x56')+_0x5ac113[0x0],_0x5ac113[0x1]===_0x3e4e('0x55')?![]:!![]);});}_0xc7d8a7[_0x3e4e('0x6')](_0xdc6584,'subqry');return _0xc7d8a7;}function getFilteredContacts(_0x5c755f){var _0x568740=[];return db[_0x3e4e('0x35')][_0x3e4e('0x57')]({'attributes':['id','name',_0x3e4e('0x58')],'raw':!![]})['then'](function(_0x4c78b4){_0x568740=_[_0x3e4e('0x59')](_0x4c78b4,'id');var _0x3a9d3b={'type':db[_0x3e4e('0x5a')][_0x3e4e('0x5b')][_0x3e4e('0x5c')],'model':db[_0x3e4e('0x5d')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x3e4e('0x5e')][_0x3e4e('0x5f')](_0x5c755f[_0x3e4e('0x60')](),_0x3a9d3b);})['then'](function(_0x4e05ec){_0x4e05ec[_0x3e4e('0x18')](function(_0x58e209){if(_0x58e209['TagIds']){_0x58e209[_0x3e4e('0x61')]=[];_0x58e209['TagIds'][_0x3e4e('0x1e')](',')[_0x3e4e('0x18')](function(_0x1eb50f){_0x58e209['Tags'][_0x3e4e('0x40')](_0x568740[_0x1eb50f]);});}delete _0x58e209[_0x3e4e('0x17')];});return _0x4e05ec;});}function countFilteredContacts(_0x39dc06,_0x3ac387){var _0x30db22=_0x39dc06[_0x3e4e('0x62')]();_0x30db22[_0x3e4e('0x19')](_0x3e4e('0x63'));_0x30db22=applyJoinClauses(_0x30db22,!![]);_0x39dc06[_0x3e4e('0x4f')](_0x3e4e('0x64'));var _0x4af760=utils[_0x3e4e('0x1c')](_0x3ac387);if(!_[_0x3e4e('0x65')](_0x4af760)){_0x30db22[_0x3e4e('0x7')]('t.id\x20IN\x20?',_0x4af760);}var _0x2b1f00={'type':db['Sequelize'][_0x3e4e('0x5b')]['SELECT'],'raw':!![]};return db['sequelize'][_0x3e4e('0x5f')](_0x30db22[_0x3e4e('0x60')](),_0x2b1f00)['then'](function(_0x234813){return _0x234813[0x0]['COUNT(*)'];});}module[_0x3e4e('0x66')]={'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 7cab8ca..edf9083 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 _0x5f52=['session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','data','update','binary','write','final','end','close','unlink','encryptString','createCipher','utf8','base64','secret','createDecipher','lodash','../../config/environment','../../config/logger','app','secrets'];(function(_0x37e832,_0x5e87ea){var _0x49694e=function(_0x160560){while(--_0x160560){_0x37e832['push'](_0x37e832['shift']());}};_0x49694e(++_0x5e87ea);}(_0x5f52,0xa5));var _0x25f5=function(_0x1d94d1,_0x347bb8){_0x1d94d1=_0x1d94d1-0x0;var _0x23c397=_0x5f52[_0x1d94d1];return _0x23c397;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x25f5('0x0'));var config=require(_0x25f5('0x1'));var logger=require(_0x25f5('0x2'))(_0x25f5('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x25f5('0x4')][_0x25f5('0x5')],'algorithm':_0x25f5('0x6')};const fileOptions={'algorithm':_0x25f5('0x7')};if(config[_0x25f5('0x8')]&&config[_0x25f5('0x8')][_0x25f5('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x25f5('0x9')]);if(isSupported){fileOptions[_0x25f5('0x9')]=config['encrypt'][_0x25f5('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x25f5('0xa')](',\x20');logger[_0x25f5('0xb')](config[_0x25f5('0x8')][_0x25f5('0x9')],_0x25f5('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x1a408a){return AES_SUPPORTED_RX[_0x25f5('0xd')](_0x1a408a);}function getSupportedCiphers(){return crypto[_0x25f5('0xe')]()[_0x25f5('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x3e28c7){return getSupportedCiphers()[_0x25f5('0x10')](_0x3e28c7)>-0x1;}function combineOptions(_0x361237){var _0x38b6b3={};for(var _0x59f2ec in fileOptions){if(fileOptions[_0x25f5('0x11')](_0x59f2ec)){_0x38b6b3[_0x59f2ec]=fileOptions[_0x59f2ec];}}if(_0x361237){for(var _0x7af1e8 in _0x361237){if(_0x361237['hasOwnProperty'](_0x7af1e8)){_0x38b6b3[_0x7af1e8]=_0x361237[_0x7af1e8];}}}return _0x38b6b3;}exports[_0x25f5('0x12')]=function(_0x34862a,_0x32668a,_0x3fe70a,_0x3d37cd){return new BPromise(function(_0x121da6,_0x5ca560){_0x3d37cd=combineOptions(_0x3d37cd);var _0x58d413=new Buffer(_0x3fe70a);var _0x4e7aef=fs[_0x25f5('0x13')](_0x34862a);var _0x4fc84c=fs['createWriteStream'](_0x32668a);var _0x2e31cf=crypto['createCipher'](_0x3d37cd[_0x25f5('0x9')],_0x58d413);_0x4e7aef['on'](_0x25f5('0x14'),function(_0x2464fd){var _0xd8894b=new Buffer(_0x2e31cf[_0x25f5('0x15')](_0x2464fd),_0x25f5('0x16'));_0x4fc84c[_0x25f5('0x17')](_0xd8894b);});_0x4e7aef['on']('end',function(){try{var _0x14f9fa=new Buffer(_0x2e31cf[_0x25f5('0x18')](_0x25f5('0x16')),_0x25f5('0x16'));_0x4fc84c['write'](_0x14f9fa);_0x4fc84c[_0x25f5('0x19')]();_0x4fc84c['on'](_0x25f5('0x1a'),function(){return _0x121da6(_0x32668a);});}catch(_0x2a6166){fs['unlink'](_0x32668a);return _0x5ca560(_0x2a6166);}});});};exports['decryptFile']=function(_0x44d037,_0x23f9e4,_0x2b182f,_0x130370){return new BPromise(function(_0x540132,_0x463b91){_0x130370=combineOptions(_0x130370);var _0x32bf25=new Buffer(_0x2b182f);var _0x3f2e4e=fs[_0x25f5('0x13')](_0x44d037);var _0x3c41de=fs['createWriteStream'](_0x23f9e4);var _0x372e08=crypto['createDecipher'](_0x130370['algorithm'],_0x32bf25);_0x3f2e4e['on'](_0x25f5('0x14'),function(_0x9a2ea6){var _0x25acd3=new Buffer(_0x372e08[_0x25f5('0x15')](_0x9a2ea6),'binary');_0x3c41de['write'](_0x25acd3);});_0x3f2e4e['on'](_0x25f5('0x19'),function(){try{var _0x15758e=new Buffer(_0x372e08[_0x25f5('0x18')](_0x25f5('0x16')),_0x25f5('0x16'));_0x3c41de[_0x25f5('0x17')](_0x15758e);_0x3c41de['end']();_0x3c41de['on'](_0x25f5('0x1a'),function(){return _0x540132(_0x23f9e4);});}catch(_0x2165f7){fs[_0x25f5('0x1b')](_0x23f9e4);return _0x463b91(_0x2165f7);}});});};exports[_0x25f5('0x1c')]=function(_0x165e74,_0x317f63,_0xd7ad5){var _0x10b0b7=_0xd7ad5||stringOptions['algorithm'];var _0x46f31a=_0x317f63||stringOptions['secret'];var _0x2b8afe=crypto[_0x25f5('0x1d')](_0x10b0b7,_0x46f31a);var _0x5bf8d3=_0x2b8afe[_0x25f5('0x15')](_0x165e74,_0x25f5('0x1e'),'base64');_0x5bf8d3+=_0x2b8afe['final'](_0x25f5('0x1f'));return _0x5bf8d3;};exports['decryptString']=function(_0x4570a3,_0x5d2c69,_0x1b2784){var _0x1d16cc=_0x1b2784||stringOptions[_0x25f5('0x9')];var _0x9737c1=_0x5d2c69||stringOptions[_0x25f5('0x20')];var _0x5cbef5=crypto[_0x25f5('0x21')](_0x1d16cc,_0x9737c1);var _0x751a73=_0x5cbef5[_0x25f5('0x15')](_0x4570a3,_0x25f5('0x1f'),_0x25f5('0x1e'));_0x751a73+=_0x5cbef5['final']('utf8');return _0x751a73;}; \ No newline at end of file +var _0x9129=['../../config/logger','app','secrets','session','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','hasOwnProperty','encryptFile','createWriteStream','data','update','binary','write','end','final','close','unlink','decryptFile','createReadStream','createDecipher','encryptString','secret','createCipher','base64','decryptString','utf8','bluebird','lodash','../../config/environment'];(function(_0x20d73e,_0x39f9ec){var _0x52e84b=function(_0x11a4ac){while(--_0x11a4ac){_0x20d73e['push'](_0x20d73e['shift']());}};_0x52e84b(++_0x39f9ec);}(_0x9129,0x1e7));var _0x9912=function(_0x18a577,_0x25560c){_0x18a577=_0x18a577-0x0;var _0x1cb0c7=_0x9129[_0x18a577];return _0x1cb0c7;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x9912('0x0'));var _=require(_0x9912('0x1'));var config=require(_0x9912('0x2'));var logger=require(_0x9912('0x3'))(_0x9912('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x9912('0x5')][_0x9912('0x6')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x9912('0x7')};if(config[_0x9912('0x8')]&&config[_0x9912('0x8')][_0x9912('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0x9912('0x9')]=config['encrypt'][_0x9912('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x9912('0xa')](',\x20');logger[_0x9912('0xb')](config[_0x9912('0x8')][_0x9912('0x9')],_0x9912('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x2d4b74){return AES_SUPPORTED_RX[_0x9912('0xd')](_0x2d4b74);}function getSupportedCiphers(){return crypto[_0x9912('0xe')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0xad8f4f){return getSupportedCiphers()['indexOf'](_0xad8f4f)>-0x1;}function combineOptions(_0x259dff){var _0x24299a={};for(var _0x522c2a in fileOptions){if(fileOptions[_0x9912('0xf')](_0x522c2a)){_0x24299a[_0x522c2a]=fileOptions[_0x522c2a];}}if(_0x259dff){for(var _0x5cd609 in _0x259dff){if(_0x259dff[_0x9912('0xf')](_0x5cd609)){_0x24299a[_0x5cd609]=_0x259dff[_0x5cd609];}}}return _0x24299a;}exports[_0x9912('0x10')]=function(_0x17fc0c,_0x16a674,_0x5950ae,_0x14a99b){return new BPromise(function(_0x1d9985,_0x5ed518){_0x14a99b=combineOptions(_0x14a99b);var _0x5a249c=new Buffer(_0x5950ae);var _0x63180e=fs['createReadStream'](_0x17fc0c);var _0x4236d3=fs[_0x9912('0x11')](_0x16a674);var _0x1f1b11=crypto['createCipher'](_0x14a99b['algorithm'],_0x5a249c);_0x63180e['on'](_0x9912('0x12'),function(_0x3a8a93){var _0x303a63=new Buffer(_0x1f1b11[_0x9912('0x13')](_0x3a8a93),_0x9912('0x14'));_0x4236d3[_0x9912('0x15')](_0x303a63);});_0x63180e['on'](_0x9912('0x16'),function(){try{var _0x1b98f5=new Buffer(_0x1f1b11[_0x9912('0x17')](_0x9912('0x14')),_0x9912('0x14'));_0x4236d3[_0x9912('0x15')](_0x1b98f5);_0x4236d3[_0x9912('0x16')]();_0x4236d3['on'](_0x9912('0x18'),function(){return _0x1d9985(_0x16a674);});}catch(_0x553c05){fs[_0x9912('0x19')](_0x16a674);return _0x5ed518(_0x553c05);}});});};exports[_0x9912('0x1a')]=function(_0x157fa8,_0x290f31,_0x236e2f,_0x383aca){return new BPromise(function(_0x204745,_0x5e221d){_0x383aca=combineOptions(_0x383aca);var _0x387c83=new Buffer(_0x236e2f);var _0x3ad612=fs[_0x9912('0x1b')](_0x157fa8);var _0x3eca5c=fs[_0x9912('0x11')](_0x290f31);var _0x529885=crypto[_0x9912('0x1c')](_0x383aca[_0x9912('0x9')],_0x387c83);_0x3ad612['on']('data',function(_0x54d02a){var _0x39107c=new Buffer(_0x529885['update'](_0x54d02a),'binary');_0x3eca5c[_0x9912('0x15')](_0x39107c);});_0x3ad612['on'](_0x9912('0x16'),function(){try{var _0x1f5898=new Buffer(_0x529885[_0x9912('0x17')](_0x9912('0x14')),_0x9912('0x14'));_0x3eca5c[_0x9912('0x15')](_0x1f5898);_0x3eca5c[_0x9912('0x16')]();_0x3eca5c['on'](_0x9912('0x18'),function(){return _0x204745(_0x290f31);});}catch(_0x563407){fs['unlink'](_0x290f31);return _0x5e221d(_0x563407);}});});};exports[_0x9912('0x1d')]=function(_0x362130,_0x251153,_0x2743d3){var _0x973ef5=_0x2743d3||stringOptions[_0x9912('0x9')];var _0x284cbe=_0x251153||stringOptions[_0x9912('0x1e')];var _0x8d6dda=crypto[_0x9912('0x1f')](_0x973ef5,_0x284cbe);var _0xccbe2e=_0x8d6dda[_0x9912('0x13')](_0x362130,'utf8',_0x9912('0x20'));_0xccbe2e+=_0x8d6dda['final']('base64');return _0xccbe2e;};exports[_0x9912('0x21')]=function(_0x12df43,_0x9cbf53,_0x15f5b4){var _0x1e31e4=_0x15f5b4||stringOptions['algorithm'];var _0x2f2f30=_0x9cbf53||stringOptions[_0x9912('0x1e')];var _0x1c61b9=crypto[_0x9912('0x1c')](_0x1e31e4,_0x2f2f30);var _0x55f4fd=_0x1c61b9[_0x9912('0x13')](_0x12df43,_0x9912('0x20'),_0x9912('0x22'));_0x55f4fd+=_0x1c61b9[_0x9912('0x17')](_0x9912('0x22'));return _0x55f4fd;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index bdefdfc..664e577 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 _0x3d22=['update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','split','length','num','isInteger','forEach','push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','existsSync','join','mkdirSync','each','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','path','lodash','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport'];(function(_0x5913ab,_0x41e645){var _0x4bb5b3=function(_0x342a60){while(--_0x342a60){_0x5913ab['push'](_0x5913ab['shift']());}};_0x4bb5b3(++_0x41e645);}(_0x3d22,0x1e0));var _0x23d2=function(_0xcf20b6,_0x1f4362){_0xcf20b6=_0xcf20b6-0x0;var _0x3a5de6=_0x3d22[_0xcf20b6];return _0x3a5de6;};'use strict';var util=require('util');var path=require(_0x23d2('0x0'));var _=require(_0x23d2('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x23d2('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x23d2('0x3'));var db=require('../../mysqldb')['db'];var dbH=require(_0x23d2('0x4'))[_0x23d2('0x5')];var logger=require(_0x23d2('0x6'))(_0x23d2('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x23d2('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x20d2e5,_0x1a0b99){var _0x585f65={'status':_0x20d2e5};var _0x494fa9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1a0b99){_0x585f65['savename']=_0x1a0b99;}return db[_0x23d2('0x9')][_0x23d2('0xa')](_0x585f65,_0x494fa9);}function main(){var _0x49b9d4=0x1388;var _0xe26e75;logger[_0x23d2('0xb')](util['format'](_0x23d2('0xc'),EXTRACTED_REPORT_ID,_0x23d2('0xd')));return db[_0x23d2('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x23d2('0xf')]})[_0x23d2('0x10')](function(_0x20e6eb){if(_0x20e6eb){_0xe26e75=_0x20e6eb;_0x49b9d4=_0xe26e75[_0x23d2('0xf')]||0x1388;}})[_0x23d2('0x10')](function(){return dbH[_0x23d2('0x11')][_0x23d2('0x12')](util['format'](_0x23d2('0x13'),QUERY),{'type':dbH['sequelize'][_0x23d2('0x14')][_0x23d2('0x15')]});})[_0x23d2('0x10')](function(_0x28037e){if(!_0x28037e[0x0]['num']){return analyticExtractedReport(_0x23d2('0x16'));}var _0x38a62e=[];var _0x9d88b7=0x0;if(_0xe26e75[_0x23d2('0x17')]){if(_0x28037e&&_0x28037e[_0x23d2('0x18')]){var _0x4e08c3=_['range'](_0x28037e[0x0][_0x23d2('0x19')]/_0x49b9d4);var _0x15469e=Number[_0x23d2('0x1a')](_0x28037e[0x0][_0x23d2('0x19')]/_0x49b9d4)?_0x28037e[0x0][_0x23d2('0x19')]%_0x49b9d4:0x0;_0x4e08c3[_0x23d2('0x1b')](function(_0x168312){if(_0x168312>0x0){_0x9d88b7+=_0x49b9d4;}_0x38a62e[_0x23d2('0x1c')](dbH[_0x23d2('0x11')]['query'](util[_0x23d2('0x1d')](_0x23d2('0x1e'),QUERY,_0x49b9d4,_0x9d88b7),{'type':dbH[_0x23d2('0x11')][_0x23d2('0x14')][_0x23d2('0x15')]}));});if(_0x15469e>0x0){_0x9d88b7+=_0x49b9d4;_0x38a62e[_0x23d2('0x1c')](dbH['sequelize']['query'](util[_0x23d2('0x1d')](_0x23d2('0x1e'),QUERY,_0x15469e,_0x9d88b7),{'type':dbH[_0x23d2('0x11')][_0x23d2('0x14')][_0x23d2('0x15')]}));}}}else{_0x38a62e[_0x23d2('0x1c')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x23d2('0x11')][_0x23d2('0x14')]['SELECT']}));}var _0x453819=path['dirname'](PATH);var _0x4c88ca=path[_0x23d2('0x1f')](PATH,'.csv');var _0x104422=_0xe26e75[_0x23d2('0x17')]&&_0x38a62e[_0x23d2('0x18')]>0x1;var _0x4cc08f=[];if(!fs[_0x23d2('0x20')](path[_0x23d2('0x21')](_0x453819,_0x4c88ca))&&_0x104422){fs[_0x23d2('0x22')](path[_0x23d2('0x21')](_0x453819,_0x4c88ca));}return BPromise[_0x23d2('0x23')](_0x38a62e,function(_0x59d2fd){_0x4cc08f[_0x23d2('0x1c')](_0x59d2fd);})['then'](function(){for(var _0x2223f6=0x0;_0x2223f6<_0x4cc08f[_0x23d2('0x18')];_0x2223f6+=0x1){var _0x530755;var _0x2fcc8f=_0x4cc08f[_0x2223f6];if(_0x104422){_0x530755=path['join'](_0x453819,_0x4c88ca,util[_0x23d2('0x1d')](_0x23d2('0x24'),_0x4c88ca,_0x2223f6,'csv'));}else{_0x530755=path[_0x23d2('0x21')](_0x453819,util['format']('%s.%s',_0x4c88ca,_0x23d2('0x25')));}fs[_0x23d2('0x26')](_0x530755,csv(_0x2fcc8f));}})['then'](function(){if(_0x104422){return new Promise(function(_0xdc6850){zipdir(path['join'](_0x453819,_0x4c88ca),{'saveTo':path[_0x23d2('0x21')](_0x453819,util[_0x23d2('0x1d')](_0x23d2('0x27'),_0x4c88ca,_0x23d2('0x28')))},function(_0x275cbf,_0x316735){rimraf(path[_0x23d2('0x21')](_0x453819,_0x4c88ca),function(){});_0xdc6850(_0x23d2('0x29'));});});}})['then'](function(){logger[_0x23d2('0xb')](util[_0x23d2('0x1d')](_0x23d2('0x2a'),EXTRACTED_REPORT_ID,_0x23d2('0xd')));return analyticExtractedReport(_0x23d2('0x2b'),_0x104422?util[_0x23d2('0x1d')](_0x23d2('0x27'),_0x4c88ca,_0x104422?'zip':_0x23d2('0x25')):null);});})[_0x23d2('0x2c')](function(_0x5e7d78){logger['info'](util['format'](_0x23d2('0x2d'),EXTRACTED_REPORT_ID,_0x23d2('0xd')),util[_0x23d2('0x2e')](_0x5e7d78,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x23d2('0x2f'));})['finally'](function(){process[_0x23d2('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2626=['argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','push','%s\x20limit\x20%d\x20OFFSET\x20%d','query','dirname','basename','.csv','mkdirSync','each','join','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2626,0x186));var _0x6262=function(_0xfb84e4,_0x199d82){_0xfb84e4=_0xfb84e4-0x0;var _0x243e9d=_0x2626[_0xfb84e4];return _0x243e9d;};'use strict';var util=require(_0x6262('0x0'));var path=require(_0x6262('0x1'));var _=require(_0x6262('0x2'));var csv=require(_0x6262('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x6262('0x4'));var rimraf=require(_0x6262('0x5'));var db=require(_0x6262('0x6'))['db'];var dbH=require('../../mysqldb')[_0x6262('0x7')];var logger=require(_0x6262('0x8'))(_0x6262('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x6262('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x6262('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x43753b,_0x21534e){var _0x364ba8={'status':_0x43753b};var _0x2f0c58={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x21534e){_0x364ba8['savename']=_0x21534e;}return db['AnalyticExtractedReport'][_0x6262('0xb')](_0x364ba8,_0x2f0c58);}function main(){var _0x44fb26=0x1388;var _0x4bc2f2;logger[_0x6262('0xc')](util[_0x6262('0xd')](_0x6262('0xe'),EXTRACTED_REPORT_ID,_0x6262('0xf')));return db[_0x6262('0x10')][_0x6262('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6262('0x12'),'splitSizeCsv']})[_0x6262('0x13')](function(_0x1e73e4){if(_0x1e73e4){_0x4bc2f2=_0x1e73e4;_0x44fb26=_0x4bc2f2[_0x6262('0x14')]||0x1388;}})[_0x6262('0x13')](function(){return dbH[_0x6262('0x15')]['query'](util['format'](_0x6262('0x16'),QUERY),{'type':dbH['sequelize'][_0x6262('0x17')][_0x6262('0x18')]});})[_0x6262('0x13')](function(_0x43459f){if(!_0x43459f[0x0][_0x6262('0x19')]){return analyticExtractedReport(_0x6262('0x1a'));}var _0x4d3e0e=[];var _0x3c16f9=0x0;if(_0x4bc2f2[_0x6262('0x12')]){if(_0x43459f&&_0x43459f[_0x6262('0x1b')]){var _0x3546d6=_[_0x6262('0x1c')](_0x43459f[0x0][_0x6262('0x19')]/_0x44fb26);var _0x351b9c=Number['isInteger'](_0x43459f[0x0][_0x6262('0x19')]/_0x44fb26)?_0x43459f[0x0]['num']%_0x44fb26:0x0;_0x3546d6['forEach'](function(_0x1f2b53){if(_0x1f2b53>0x0){_0x3c16f9+=_0x44fb26;}_0x4d3e0e[_0x6262('0x1d')](dbH[_0x6262('0x15')]['query'](util[_0x6262('0xd')](_0x6262('0x1e'),QUERY,_0x44fb26,_0x3c16f9),{'type':dbH[_0x6262('0x15')]['QueryTypes']['SELECT']}));});if(_0x351b9c>0x0){_0x3c16f9+=_0x44fb26;_0x4d3e0e[_0x6262('0x1d')](dbH[_0x6262('0x15')][_0x6262('0x1f')](util[_0x6262('0xd')](_0x6262('0x1e'),QUERY,_0x351b9c,_0x3c16f9),{'type':dbH[_0x6262('0x15')][_0x6262('0x17')][_0x6262('0x18')]}));}}}else{_0x4d3e0e[_0x6262('0x1d')](dbH[_0x6262('0x15')][_0x6262('0x1f')](QUERY,{'type':dbH[_0x6262('0x15')]['QueryTypes'][_0x6262('0x18')]}));}var _0xeee698=path[_0x6262('0x20')](PATH);var _0x3be206=path[_0x6262('0x21')](PATH,_0x6262('0x22'));var _0x571224=_0x4bc2f2['split']&&_0x4d3e0e[_0x6262('0x1b')]>0x1;var _0x21e873=[];if(!fs['existsSync'](path['join'](_0xeee698,_0x3be206))&&_0x571224){fs[_0x6262('0x23')](path['join'](_0xeee698,_0x3be206));}return BPromise[_0x6262('0x24')](_0x4d3e0e,function(_0x1a7f32){_0x21e873[_0x6262('0x1d')](_0x1a7f32);})[_0x6262('0x13')](function(){for(var _0x13ae24=0x0;_0x13ae24<_0x21e873['length'];_0x13ae24+=0x1){var _0x4f051f;var _0x2a7ee2=_0x21e873[_0x13ae24];if(_0x571224){_0x4f051f=path[_0x6262('0x25')](_0xeee698,_0x3be206,util[_0x6262('0xd')]('%s%d.%s',_0x3be206,_0x13ae24,_0x6262('0x26')));}else{_0x4f051f=path[_0x6262('0x25')](_0xeee698,util['format'](_0x6262('0x27'),_0x3be206,_0x6262('0x26')));}fs[_0x6262('0x28')](_0x4f051f,csv(_0x2a7ee2));}})[_0x6262('0x13')](function(){if(_0x571224){return new Promise(function(_0xd08831){zipdir(path[_0x6262('0x25')](_0xeee698,_0x3be206),{'saveTo':path[_0x6262('0x25')](_0xeee698,util[_0x6262('0xd')](_0x6262('0x27'),_0x3be206,'zip'))},function(_0x56de7b,_0x1bd1d8){rimraf(path[_0x6262('0x25')](_0xeee698,_0x3be206),function(){});_0xd08831(_0x6262('0x29'));});});}})[_0x6262('0x13')](function(){logger['info'](util[_0x6262('0xd')](_0x6262('0x2a'),EXTRACTED_REPORT_ID,_0x6262('0xf')));return analyticExtractedReport(_0x6262('0x2b'),_0x571224?util[_0x6262('0xd')](_0x6262('0x27'),_0x3be206,_0x571224?_0x6262('0x2c'):_0x6262('0x26')):null);});})[_0x6262('0x2d')](function(_0x3a04e8){logger['info'](util['format'](_0x6262('0x2e'),EXTRACTED_REPORT_ID,'CSV'),util[_0x6262('0x2f')](_0x3a04e8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x6262('0x30')](function(){process[_0x6262('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index bfafe3e..a66ea66 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 _0x5976=['length','auto','push','body','concat','chunk','keys','forEach','name','startDate','format','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','right','num','Setting','split','splitSizePdf','then','range','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','createPdfFromHTML','path','lodash','util','moment','pdfmake/src/printer','zip-dir','jsdom','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','pick','toString','value','fill'];(function(_0x277c86,_0x2e6784){var _0x685562=function(_0x1bfd2e){while(--_0x1bfd2e){_0x277c86['push'](_0x277c86['shift']());}};_0x685562(++_0x2e6784);}(_0x5976,0x162));var _0x6597=function(_0x68cf94,_0xfc8b8f){_0x68cf94=_0x68cf94-0x0;var _0x5b4dac=_0x5976[_0x68cf94];return _0x5b4dac;};'use strict';var _=require(_0x6597('0x0'));var fs=require('fs');var util=require(_0x6597('0x1'));var path=require('path');var moment=require(_0x6597('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x6597('0x3'));var zipdir=require(_0x6597('0x4'));var rimraf=require('rimraf');var JSDOM=require(_0x6597('0x5'))['JSDOM'];var window=new JSDOM('')[_0x6597('0x6')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require(_0x6597('0x7'))[_0x6597('0x8')];var logger=require(_0x6597('0x9'))(_0x6597('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x6597('0xb')][0x3];var PATH=process[_0x6597('0xb')][0x4];var NAME=process[_0x6597('0xb')][0x5];var FORMAT=_0x6597('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2f4672,_0x1fb320){var _0x4b7042={'status':_0x2f4672};var _0x245f99={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1fb320){_0x4b7042[_0x6597('0xd')]=_0x1fb320;}return db[_0x6597('0xe')][_0x6597('0xf')](_0x4b7042,_0x245f99);}function getHeaders(_0x1d5e28){return _['map'](_0x1d5e28,function(_0x310d96){return{'text':_0x310d96,'style':_0x6597('0x10')};});}function getRows(_0x4a69ed,_0x30cfb7){return _[_0x6597('0x11')](_0x30cfb7,function(_0x293fd2){return _(_0x293fd2)[_0x6597('0x12')](_0x4a69ed)[_0x6597('0x11')](function(_0x4e2ce4){return _0x4e2ce4?_[_0x6597('0x13')](_0x4e2ce4):'';})[_0x6597('0x14')]();});}function createTable(_0x3869e5,_0x54d60a){var _0x8d4b76={'widths':_[_0x6597('0x15')](Array(_0x3869e5[_0x6597('0x16')]),0x91),'heights':function(_0x503436){return _0x503436===0x0?_0x6597('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x51e5f7=getHeaders(_0x3869e5);_0x8d4b76['body'][_0x6597('0x18')](_0x51e5f7);var _0x44ad32=getRows(_0x3869e5,_0x54d60a);_0x8d4b76[_0x6597('0x19')]=_0x8d4b76['body'][_0x6597('0x1a')](_0x44ad32);return _0x8d4b76;}function createTables(_0x48dceb){var _0x781622=[];var _0x2344f1=_[_0x6597('0x1b')](Object[_0x6597('0x1c')](_0x48dceb[0x0]),0x5);_0x2344f1[_0x6597('0x1d')](function(_0x2994a1){_0x781622[_0x6597('0x18')](createTable(_0x2994a1,_0x48dceb));});return _0x781622;}function getPDFDocDefinition(_0x3cfba3){var _0x24bbcb=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x6597('0x1e')],moment(EXTRACTED_REPORT[_0x6597('0x1f')])[_0x6597('0x20')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x6597('0x20')](FORMAT));var _0x1e1be3=[];for(var _0x18019e=0x0;_0x18019e<_0x3cfba3['length'];_0x18019e++){var _0x2e6496=[];if(_0x18019e===0x0){_0x2e6496[_0x6597('0x18')]({'text':_0x24bbcb,'style':_0x6597('0x21')});}var _0x5d111b={'table':_0x3cfba3[_0x18019e]};if(_0x18019e>0x0){_0x5d111b[_0x6597('0x22')]=_0x6597('0x23');_0x5d111b[_0x6597('0x24')]=[0x0,0x46,0x0,0x0];}_0x2e6496[_0x6597('0x18')](_0x5d111b);_0x1e1be3[_0x6597('0x18')](_0x2e6496);}return{'pageSize':'A4','pageOrientation':_0x6597('0x25'),'content':_0x1e1be3,'footer':function(_0x28022d,_0x5b4c57){return{'text':_0x28022d['toString']()+_0x6597('0x26')+_0x5b4c57,'style':_0x6597('0x27')};},'defaultStyle':{'font':_0x6597('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x6597('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1245b2){var _0x58e778=0x1388;var _0x515ebc;if(!_0x1245b2[0x0][_0x6597('0x2a')]){return analyticExtractedReport('Empty');}return db[_0x6597('0x2b')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6597('0x2c'),_0x6597('0x2d')]})[_0x6597('0x2e')](function(_0x560d17){if(_0x560d17){_0x515ebc=_0x560d17;_0x58e778=_0x515ebc['splitSizePdf']||0x3e8;}})[_0x6597('0x2e')](function(){var _0x3afabd=[];var _0x111376=0x0;if(_0x515ebc['split']){if(_0x1245b2&&_0x1245b2[_0x6597('0x16')]){var _0x5509ac=_[_0x6597('0x2f')](_0x1245b2[0x0][_0x6597('0x2a')]/_0x58e778);var _0x5ba3a0=Number['isInteger'](_0x1245b2[0x0][_0x6597('0x2a')]/_0x58e778)?_0x1245b2[0x0][_0x6597('0x2a')]%_0x58e778:0x0;_0x5509ac[_0x6597('0x1d')](function(_0x1a982e){if(_0x1a982e>0x0){_0x111376+=_0x58e778;}_0x3afabd[_0x6597('0x18')](dbH[_0x6597('0x30')][_0x6597('0x31')](util[_0x6597('0x20')](_0x6597('0x32'),QUERY,_0x58e778,_0x111376),{'type':dbH['sequelize'][_0x6597('0x33')][_0x6597('0x34')]}));});if(_0x5ba3a0>0x0){_0x111376+=_0x58e778;_0x3afabd['push'](dbH[_0x6597('0x30')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5ba3a0,_0x111376),{'type':dbH[_0x6597('0x30')][_0x6597('0x33')]['SELECT']}));}}}else{_0x3afabd[_0x6597('0x18')](dbH[_0x6597('0x30')][_0x6597('0x31')](QUERY,{'type':dbH['sequelize'][_0x6597('0x33')][_0x6597('0x34')]}));}var _0xa961be=path[_0x6597('0x35')](PATH);var _0x3bb512=path[_0x6597('0x36')](PATH,_0x6597('0x37'));var _0x59b0ea=_0x515ebc['split']&&_0x3afabd[_0x6597('0x16')]>0x1;var _0x2d8488=[];if(!fs[_0x6597('0x38')](path['join'](_0xa961be,_0x3bb512))&&_0x59b0ea){fs[_0x6597('0x39')](path[_0x6597('0x3a')](_0xa961be,_0x3bb512));}return BPromise[_0x6597('0x3b')](_0x3afabd,function(_0x5f58d7){_0x2d8488[_0x6597('0x18')](_0x5f58d7);})[_0x6597('0x2e')](function(){var _0x3a6ccc=[];for(var _0x3445f9=0x0;_0x3445f9<_0x2d8488[_0x6597('0x16')];_0x3445f9+=0x1){var _0x597fdf=_0x2d8488[_0x3445f9];var _0x35186d=createTables(_[_0x6597('0x3c')](_0x597fdf));var _0x508faf;var _0x879d2b=getPDFDocDefinition(_0x35186d);var _0x48446e=getPDFPrinter();var _0x1527b4=_0x48446e[_0x6597('0x3d')](_0x879d2b);if(_0x59b0ea){_0x508faf=path[_0x6597('0x3a')](_0xa961be,_0x3bb512,util['format'](_0x6597('0x3e'),_0x3bb512,_0x3445f9,_0x6597('0x3f')));}else{_0x508faf=path['join'](_0xa961be,util[_0x6597('0x20')](_0x6597('0x40'),_0x3bb512,'pdf'));}_0x3a6ccc['push'](writePDFDocument(_0x1527b4,_0x508faf));}return Promise['all'](_0x3a6ccc);})[_0x6597('0x2e')](function(){if(_0x59b0ea){return new Promise(function(_0x436b57){zipdir(path[_0x6597('0x3a')](_0xa961be,_0x3bb512),{'saveTo':path[_0x6597('0x3a')](_0xa961be,util[_0x6597('0x20')]('%s.%s',_0x3bb512,_0x6597('0x41')))},function(){rimraf(path['join'](_0xa961be,_0x3bb512),function(){});_0x436b57(_0x6597('0x42'));});});}})[_0x6597('0x2e')](function(){if(!_0x59b0ea)return;rimraf(path[_0x6597('0x3a')](_0xa961be,_0x3bb512),function(){});})['then'](function(){logger[_0x6597('0x43')](util[_0x6597('0x20')](_0x6597('0x44'),EXTRACTED_REPORT_ID,_0x6597('0x45')));return analyticExtractedReport(_0x6597('0x46'),_0x59b0ea?util['format'](_0x6597('0x40'),_0x3bb512,_0x59b0ea?_0x6597('0x41'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6597('0x43')](util[_0x6597('0x20')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6597('0x45')));return db['AnalyticExtractedReport'][_0x6597('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x6597('0x2e')](function(_0x3308e2){EXTRACTED_REPORT=_0x3308e2;return dbH[_0x6597('0x30')][_0x6597('0x31')](util[_0x6597('0x20')](_0x6597('0x48'),QUERY),{'type':dbH['sequelize'][_0x6597('0x33')][_0x6597('0x34')]});})[_0x6597('0x2e')](extractReport)[_0x6597('0x49')](function(_0x568bd5){logger[_0x6597('0x43')](util[_0x6597('0x20')](_0x6597('0x4a'),EXTRACTED_REPORT_ID,_0x6597('0x45')),util[_0x6597('0x4b')](_0x568bd5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6597('0x4c'));})[_0x6597('0x4d')](function(){process[_0x6597('0x4e')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5b9b74=new PdfPrinter({'Arial':{'normal':__dirname+_0x6597('0x4f'),'bold':__dirname+_0x6597('0x50'),'italics':__dirname+_0x6597('0x51'),'bolditalics':__dirname+_0x6597('0x52')}});return _0x5b9b74;}function getPDFDocDefinitionFromHTML(_0xf8fa26,_0x37fcf1){var _0x14ba6c=util[_0x6597('0x20')](_0x6597('0x53'),_0x37fcf1['channel'],_0x37fcf1[_0x6597('0x54')]);var _0xbf331a=moment()[_0x6597('0x20')](_0x6597('0x55'))[_0x6597('0x13')]();var _0x236263=htmlToPdfmake(_0xf8fa26,{'window':window,'tableAutoSize':!![]});return{'content':[_0x236263],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x6597('0x56'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x6597('0x57'),'style':_0x6597('0x21')}];},'footer':function(_0x3fe8dc,_0x332193){return[{'text':util[_0x6597('0x20')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x14ba6c,_0x3fe8dc,_0x332193,_0xbf331a),'style':'footer'}];}};}function writePDFDocument(_0x42bbf4,_0x4acdc6){return new Promise(function(_0x4bb55d,_0x3b16b0){var _0x409e03=_0x42bbf4[_0x6597('0x58')](fs[_0x6597('0x59')](_0x4acdc6));_0x409e03['on'](_0x6597('0x5a'),function(){_0x4bb55d('finish');});_0x409e03['on'](_0x6597('0x5b'),function(_0x12fedd){_0x3b16b0(_0x12fedd);});_0x42bbf4['end']();});}exports[_0x6597('0x5c')]=function(_0x167d71,_0x30ff2c){var _0x1dcd0e=getPDFPrinter();var _0x47701a=getPDFDocDefinitionFromHTML(_0x167d71,_0x30ff2c);var _0xb6229e=_0x1dcd0e[_0x6597('0x3d')](_0x47701a);return writePDFDocument(_0xb6229e,_0x30ff2c[_0x6597('0x5d')])[_0x6597('0x49')](function(_0x3b4a89){throw _0x3b4a89;});}; \ No newline at end of file +var _0xa41f=['savename','AnalyticExtractedReport','update','map','pick','toString','value','fill','length','auto','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','pageBreak','before','landscape','footer','Arial','right','num','Empty','Setting','find','splitSizePdf','then','split','sequelize','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','pdf','%s.%s','all','zip\x20finished','PDF','Completed','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','util','path','html-to-pdfmake','zip-dir','rimraf','jsdom','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a'];(function(_0x2f97ec,_0x20480d){var _0x15df31=function(_0x5bb666){while(--_0x5bb666){_0x2f97ec['push'](_0x2f97ec['shift']());}};_0x15df31(++_0x20480d);}(_0xa41f,0x101));var _0xfa41=function(_0x2161d0,_0x1e3261){_0x2161d0=_0x2161d0-0x0;var _0x507312=_0xa41f[_0x2161d0];return _0x507312;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xfa41('0x0'));var path=require(_0xfa41('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0xfa41('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xfa41('0x3'));var rimraf=require(_0xfa41('0x4'));var JSDOM=require(_0xfa41('0x5'))['JSDOM'];var window=new JSDOM('')[_0xfa41('0x6')];var BPromise=require(_0xfa41('0x7'));var db=require(_0xfa41('0x8'))['db'];var dbH=require(_0xfa41('0x8'))[_0xfa41('0x9')];var logger=require('../../config/logger')(_0xfa41('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xfa41('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xfa41('0xb')][0x4];var NAME=process[_0xfa41('0xb')][0x5];var FORMAT=_0xfa41('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3e8710,_0x347d60){var _0x422b1a={'status':_0x3e8710};var _0x4389c7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x347d60){_0x422b1a[_0xfa41('0xd')]=_0x347d60;}return db[_0xfa41('0xe')][_0xfa41('0xf')](_0x422b1a,_0x4389c7);}function getHeaders(_0x4f7d86){return _[_0xfa41('0x10')](_0x4f7d86,function(_0x134649){return{'text':_0x134649,'style':'tableHeader'};});}function getRows(_0x9097b7,_0x5592e7){return _[_0xfa41('0x10')](_0x5592e7,function(_0x2375eb){return _(_0x2375eb)[_0xfa41('0x11')](_0x9097b7)[_0xfa41('0x10')](function(_0x521a19){return _0x521a19?_[_0xfa41('0x12')](_0x521a19):'';})[_0xfa41('0x13')]();});}function createTable(_0x1563d3,_0x3d45ac){var _0x49e43e={'widths':_[_0xfa41('0x14')](Array(_0x1563d3[_0xfa41('0x15')]),0x91),'heights':function(_0x3a869c){return _0x3a869c===0x0?_0xfa41('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3effaa=getHeaders(_0x1563d3);_0x49e43e[_0xfa41('0x17')][_0xfa41('0x18')](_0x3effaa);var _0x546165=getRows(_0x1563d3,_0x3d45ac);_0x49e43e[_0xfa41('0x17')]=_0x49e43e[_0xfa41('0x17')][_0xfa41('0x19')](_0x546165);return _0x49e43e;}function createTables(_0x1fe800){var _0x4e3973=[];var _0x2c5788=_[_0xfa41('0x1a')](Object[_0xfa41('0x1b')](_0x1fe800[0x0]),0x5);_0x2c5788[_0xfa41('0x1c')](function(_0x121dcd){_0x4e3973[_0xfa41('0x18')](createTable(_0x121dcd,_0x1fe800));});return _0x4e3973;}function getPDFDocDefinition(_0x5ac457){var _0x579c97=util[_0xfa41('0x1d')](_0xfa41('0x1e'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xfa41('0x1f')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xfa41('0x20')])[_0xfa41('0x1d')](FORMAT));var _0x519735=[];for(var _0x26da3d=0x0;_0x26da3d<_0x5ac457[_0xfa41('0x15')];_0x26da3d++){var _0x4ddc81=[];if(_0x26da3d===0x0){_0x4ddc81[_0xfa41('0x18')]({'text':_0x579c97,'style':'header'});}var _0x3aae84={'table':_0x5ac457[_0x26da3d]};if(_0x26da3d>0x0){_0x3aae84[_0xfa41('0x21')]=_0xfa41('0x22');_0x3aae84['margin']=[0x0,0x46,0x0,0x0];}_0x4ddc81[_0xfa41('0x18')](_0x3aae84);_0x519735[_0xfa41('0x18')](_0x4ddc81);}return{'pageSize':'A4','pageOrientation':_0xfa41('0x23'),'content':_0x519735,'footer':function(_0xec2c54,_0x29f13a){return{'text':_0xec2c54[_0xfa41('0x12')]()+'\x20/\x20'+_0x29f13a,'style':_0xfa41('0x24')};},'defaultStyle':{'font':_0xfa41('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xfa41('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1aa168){var _0x306d21=0x1388;var _0x4b7105;if(!_0x1aa168[0x0][_0xfa41('0x27')]){return analyticExtractedReport(_0xfa41('0x28'));}return db[_0xfa41('0x29')][_0xfa41('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xfa41('0x2b')]})[_0xfa41('0x2c')](function(_0x4029eb){if(_0x4029eb){_0x4b7105=_0x4029eb;_0x306d21=_0x4b7105['splitSizePdf']||0x3e8;}})[_0xfa41('0x2c')](function(){var _0x9c41df=[];var _0x21fc6f=0x0;if(_0x4b7105[_0xfa41('0x2d')]){if(_0x1aa168&&_0x1aa168['length']){var _0x376555=_['range'](_0x1aa168[0x0]['num']/_0x306d21);var _0x298783=Number['isInteger'](_0x1aa168[0x0]['num']/_0x306d21)?_0x1aa168[0x0][_0xfa41('0x27')]%_0x306d21:0x0;_0x376555[_0xfa41('0x1c')](function(_0xb8440b){if(_0xb8440b>0x0){_0x21fc6f+=_0x306d21;}_0x9c41df[_0xfa41('0x18')](dbH[_0xfa41('0x2e')]['query'](util[_0xfa41('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x306d21,_0x21fc6f),{'type':dbH[_0xfa41('0x2e')]['QueryTypes'][_0xfa41('0x2f')]}));});if(_0x298783>0x0){_0x21fc6f+=_0x306d21;_0x9c41df['push'](dbH[_0xfa41('0x2e')]['query'](util[_0xfa41('0x1d')](_0xfa41('0x30'),QUERY,_0x298783,_0x21fc6f),{'type':dbH[_0xfa41('0x2e')][_0xfa41('0x31')][_0xfa41('0x2f')]}));}}}else{_0x9c41df[_0xfa41('0x18')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0xfa41('0x31')][_0xfa41('0x2f')]}));}var _0x437714=path['dirname'](PATH);var _0x4b6204=path['basename'](PATH,_0xfa41('0x32'));var _0x28edec=_0x4b7105[_0xfa41('0x2d')]&&_0x9c41df['length']>0x1;var _0x2dab3c=[];if(!fs[_0xfa41('0x33')](path[_0xfa41('0x34')](_0x437714,_0x4b6204))&&_0x28edec){fs[_0xfa41('0x35')](path[_0xfa41('0x34')](_0x437714,_0x4b6204));}return BPromise[_0xfa41('0x36')](_0x9c41df,function(_0x37cf98){_0x2dab3c[_0xfa41('0x18')](_0x37cf98);})[_0xfa41('0x2c')](function(){var _0x12b491=[];for(var _0x34cdaf=0x0;_0x34cdaf<_0x2dab3c[_0xfa41('0x15')];_0x34cdaf+=0x1){var _0x5ee6fc=_0x2dab3c[_0x34cdaf];var _0x1cb724=createTables(_[_0xfa41('0x37')](_0x5ee6fc));var _0x5ea495;var _0x19ab78=getPDFDocDefinition(_0x1cb724);var _0x3bd3ff=getPDFPrinter();var _0x385618=_0x3bd3ff[_0xfa41('0x38')](_0x19ab78);if(_0x28edec){_0x5ea495=path[_0xfa41('0x34')](_0x437714,_0x4b6204,util[_0xfa41('0x1d')]('%s%d.%s',_0x4b6204,_0x34cdaf,_0xfa41('0x39')));}else{_0x5ea495=path[_0xfa41('0x34')](_0x437714,util[_0xfa41('0x1d')](_0xfa41('0x3a'),_0x4b6204,_0xfa41('0x39')));}_0x12b491[_0xfa41('0x18')](writePDFDocument(_0x385618,_0x5ea495));}return Promise[_0xfa41('0x3b')](_0x12b491);})['then'](function(){if(_0x28edec){return new Promise(function(_0x31b61f){zipdir(path[_0xfa41('0x34')](_0x437714,_0x4b6204),{'saveTo':path['join'](_0x437714,util['format']('%s.%s',_0x4b6204,'zip'))},function(){rimraf(path[_0xfa41('0x34')](_0x437714,_0x4b6204),function(){});_0x31b61f(_0xfa41('0x3c'));});});}})[_0xfa41('0x2c')](function(){if(!_0x28edec)return;rimraf(path['join'](_0x437714,_0x4b6204),function(){});})[_0xfa41('0x2c')](function(){logger['info'](util[_0xfa41('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xfa41('0x3d')));return analyticExtractedReport(_0xfa41('0x3e'),_0x28edec?util[_0xfa41('0x1d')](_0xfa41('0x3a'),_0x4b6204,_0x28edec?_0xfa41('0x3f'):_0xfa41('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xfa41('0x40')](util[_0xfa41('0x1d')](_0xfa41('0x41'),EXTRACTED_REPORT_ID,_0xfa41('0x3d')));return db[_0xfa41('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xfa41('0x2c')](function(_0x511be8){EXTRACTED_REPORT=_0x511be8;return dbH[_0xfa41('0x2e')][_0xfa41('0x42')](util[_0xfa41('0x1d')](_0xfa41('0x43'),QUERY),{'type':dbH['sequelize'][_0xfa41('0x31')]['SELECT']});})[_0xfa41('0x2c')](extractReport)[_0xfa41('0x44')](function(_0x1c77df){logger[_0xfa41('0x40')](util[_0xfa41('0x1d')](_0xfa41('0x45'),EXTRACTED_REPORT_ID,_0xfa41('0x3d')),util[_0xfa41('0x46')](_0x1c77df,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xfa41('0x47'));})[_0xfa41('0x48')](function(){process[_0xfa41('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1095b6=new PdfPrinter({'Arial':{'normal':__dirname+_0xfa41('0x4a'),'bold':__dirname+_0xfa41('0x4b'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xfa41('0x4c')}});return _0x1095b6;}function getPDFDocDefinitionFromHTML(_0x33f6ae,_0x16b019){var _0x28cc7e=util['format'](_0xfa41('0x4d'),_0x16b019[_0xfa41('0x4e')],_0x16b019['interactionId']);var _0x98663a=moment()[_0xfa41('0x1d')](_0xfa41('0x4f'))[_0xfa41('0x12')]();var _0xf07f8a=htmlToPdfmake(_0x33f6ae,{'window':window,'tableAutoSize':!![]});return{'content':[_0xf07f8a],'defaultStyle':{'font':_0xfa41('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xfa41('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xfa41('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xfa41('0x51'),'style':_0xfa41('0x52')}];},'footer':function(_0x187eb3,_0x16487a){return[{'text':util[_0xfa41('0x1d')](_0xfa41('0x53'),_0x28cc7e,_0x187eb3,_0x16487a,_0x98663a),'style':_0xfa41('0x24')}];}};}function writePDFDocument(_0x4be758,_0x237a0f){return new Promise(function(_0x5cbbcb,_0x5f2eee){var _0x472e6d=_0x4be758[_0xfa41('0x54')](fs[_0xfa41('0x55')](_0x237a0f));_0x472e6d['on'](_0xfa41('0x56'),function(){_0x5cbbcb(_0xfa41('0x56'));});_0x472e6d['on'](_0xfa41('0x57'),function(_0x2b8d0c){_0x5f2eee(_0x2b8d0c);});_0x4be758[_0xfa41('0x58')]();});}exports[_0xfa41('0x59')]=function(_0x4dd70f,_0x110679){var _0x1dffb7=getPDFPrinter();var _0x525344=getPDFDocDefinitionFromHTML(_0x4dd70f,_0x110679);var _0x30e423=_0x1dffb7[_0xfa41('0x38')](_0x525344);return writePDFDocument(_0x30e423,_0x110679[_0xfa41('0x1')])[_0xfa41('0x44')](function(_0x1c6d50){throw _0x1c6d50;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index f631dcb..1373b4a 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 _0x7df3=['exit','util','path','json2xls','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','split','length','range','num','isInteger','forEach','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','inspect','Failed','finally'];(function(_0x367b97,_0x116cb5){var _0x18fc7b=function(_0x234412){while(--_0x234412){_0x367b97['push'](_0x367b97['shift']());}};_0x18fc7b(++_0x116cb5);}(_0x7df3,0x1cc));var _0x37df=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7df3[_0x1facfa];return _0x9ec701;};'use strict';var util=require(_0x37df('0x0'));var path=require(_0x37df('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x37df('0x2'));var BPromise=require('bluebird');var zipdir=require(_0x37df('0x3'));var rimraf=require('rimraf');var db=require(_0x37df('0x4'))['db'];var dbH=require('../../mysqldb')[_0x37df('0x5')];var logger=require(_0x37df('0x6'))(_0x37df('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x37df('0x8')][0x2]);var QUERY=process[_0x37df('0x8')][0x3];var PATH=process[_0x37df('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x579adf,_0x56eca4){var _0x559bb3={'status':_0x579adf};var _0x2d9c06={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x56eca4){_0x559bb3[_0x37df('0x9')]=_0x56eca4;}return db[_0x37df('0xa')][_0x37df('0xb')](_0x559bb3,_0x2d9c06);}function main(){var _0x5774fd=0x1388;var _0x1d0991;logger[_0x37df('0xc')](util[_0x37df('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x37df('0xe')));return db[_0x37df('0xf')][_0x37df('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x37df('0x11')]})[_0x37df('0x12')](function(_0xdae38c){if(_0xdae38c){_0x1d0991=_0xdae38c;_0x5774fd=_0x1d0991[_0x37df('0x11')]||0x1388;}})[_0x37df('0x12')](function(){return dbH['sequelize'][_0x37df('0x13')](util[_0x37df('0xd')](_0x37df('0x14'),QUERY),{'type':dbH['sequelize'][_0x37df('0x15')][_0x37df('0x16')]});})['then'](function(_0x50632c){if(!_0x50632c[0x0]['num']){return analyticExtractedReport(_0x37df('0x17'));}var _0x425c3b=[];var _0x3ed1fa=0x0;if(_0x1d0991[_0x37df('0x18')]){if(_0x50632c&&_0x50632c[_0x37df('0x19')]){var _0xcafa08=_[_0x37df('0x1a')](_0x50632c[0x0][_0x37df('0x1b')]/_0x5774fd);var _0x2ddebe=Number[_0x37df('0x1c')](_0x50632c[0x0][_0x37df('0x1b')]/_0x5774fd)?_0x50632c[0x0][_0x37df('0x1b')]%_0x5774fd:0x0;_0xcafa08[_0x37df('0x1d')](function(_0x9b502){if(_0x9b502>0x0){_0x3ed1fa+=_0x5774fd;}_0x425c3b['push'](dbH[_0x37df('0x1e')]['query'](util[_0x37df('0xd')](_0x37df('0x1f'),QUERY,_0x5774fd,_0x3ed1fa),{'type':dbH['sequelize'][_0x37df('0x15')][_0x37df('0x16')]}));});if(_0x2ddebe>0x0){_0x3ed1fa+=_0x5774fd;_0x425c3b[_0x37df('0x20')](dbH[_0x37df('0x1e')][_0x37df('0x13')](util[_0x37df('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2ddebe,_0x3ed1fa),{'type':dbH[_0x37df('0x1e')]['QueryTypes'][_0x37df('0x16')]}));}}}else{_0x425c3b['push'](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x37df('0x1e')]['QueryTypes'][_0x37df('0x16')]}));}var _0x177de2=path[_0x37df('0x21')](PATH);var _0x4a28ed=path['basename'](PATH,_0x37df('0x22'));var _0x1323e1=_0x1d0991['split']&&_0x425c3b[_0x37df('0x19')]>0x1;var _0x43cd7e=[];if(!fs[_0x37df('0x23')](path['join'](_0x177de2,_0x4a28ed))&&_0x1323e1){fs[_0x37df('0x24')](path[_0x37df('0x25')](_0x177de2,_0x4a28ed));}return BPromise[_0x37df('0x26')](_0x425c3b,function(_0x443990){_0x43cd7e['push'](_0x443990);})[_0x37df('0x12')](function(){for(var _0x325870=0x0;_0x325870<_0x43cd7e[_0x37df('0x19')];_0x325870+=0x1){var _0x481251;var _0x5716a6=_0x43cd7e[_0x325870];if(_0x1323e1){_0x481251=path[_0x37df('0x25')](_0x177de2,_0x4a28ed,util['format'](_0x37df('0x27'),_0x4a28ed,_0x325870,_0x37df('0x28')));}else{_0x481251=path[_0x37df('0x25')](_0x177de2,util[_0x37df('0xd')]('%s.%s',_0x4a28ed,'xlsx'));}fs[_0x37df('0x29')](_0x481251,json2xls(_0x5716a6),_0x37df('0x2a'));}})[_0x37df('0x12')](function(){if(_0x1323e1){return new Promise(function(_0x93d921){zipdir(path[_0x37df('0x25')](_0x177de2,_0x4a28ed),{'saveTo':path[_0x37df('0x25')](_0x177de2,util[_0x37df('0xd')](_0x37df('0x2b'),_0x4a28ed,_0x37df('0x2c')))},function(_0x215ff9,_0x14aa31){rimraf(path[_0x37df('0x25')](_0x177de2,_0x4a28ed),function(){});_0x93d921(_0x37df('0x2d'));});});}})['then'](function(){logger[_0x37df('0xc')](util[_0x37df('0xd')](_0x37df('0x2e'),EXTRACTED_REPORT_ID,_0x37df('0xe')));return analyticExtractedReport('Completed',_0x1323e1?util[_0x37df('0xd')]('%s.%s',_0x4a28ed,_0x1323e1?'zip':_0x37df('0x28')):null);});})['catch'](function(_0x3227d2){logger[_0x37df('0xc')](util[_0x37df('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x37df('0xe')),util[_0x37df('0x2f')](_0x3227d2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x37df('0x30'));})[_0x37df('0x31')](function(){process[_0x37df('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x5af4=['splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','length','range','num','isInteger','forEach','push','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','join','each','xlsx','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','%s.%s','inspect','Failed','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split'];(function(_0x1a5f96,_0x294770){var _0x15d0fe=function(_0x566b64){while(--_0x566b64){_0x1a5f96['push'](_0x1a5f96['shift']());}};_0x15d0fe(++_0x294770);}(_0x5af4,0x158));var _0x45af=function(_0x6499c8,_0x597e32){_0x6499c8=_0x6499c8-0x0;var _0x19ea4b=_0x5af4[_0x6499c8];return _0x19ea4b;};'use strict';var util=require(_0x45af('0x0'));var path=require(_0x45af('0x1'));var _=require(_0x45af('0x2'));var fs=require('fs');var json2xls=require(_0x45af('0x3'));var BPromise=require(_0x45af('0x4'));var zipdir=require(_0x45af('0x5'));var rimraf=require(_0x45af('0x6'));var db=require(_0x45af('0x7'))['db'];var dbH=require(_0x45af('0x7'))['dbH'];var logger=require(_0x45af('0x8'))(_0x45af('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x45af('0xa')][0x3];var PATH=process[_0x45af('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x12f62a,_0x12e080){var _0x3eefbb={'status':_0x12f62a};var _0x5de89d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x12e080){_0x3eefbb[_0x45af('0xb')]=_0x12e080;}return db[_0x45af('0xc')][_0x45af('0xd')](_0x3eefbb,_0x5de89d);}function main(){var _0x4d70b7=0x1388;var _0x1f6146;logger[_0x45af('0xe')](util['format'](_0x45af('0xf'),EXTRACTED_REPORT_ID,_0x45af('0x10')));return db[_0x45af('0x11')][_0x45af('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x45af('0x13'),_0x45af('0x14')]})[_0x45af('0x15')](function(_0x2726f6){if(_0x2726f6){_0x1f6146=_0x2726f6;_0x4d70b7=_0x1f6146[_0x45af('0x14')]||0x1388;}})[_0x45af('0x15')](function(){return dbH['sequelize']['query'](util['format'](_0x45af('0x16'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x45af('0x17')]});})[_0x45af('0x15')](function(_0x509bee){if(!_0x509bee[0x0]['num']){return analyticExtractedReport(_0x45af('0x18'));}var _0x58d5c6=[];var _0x57f3b1=0x0;if(_0x1f6146['split']){if(_0x509bee&&_0x509bee[_0x45af('0x19')]){var _0x5c6b79=_[_0x45af('0x1a')](_0x509bee[0x0][_0x45af('0x1b')]/_0x4d70b7);var _0xebbd6e=Number[_0x45af('0x1c')](_0x509bee[0x0][_0x45af('0x1b')]/_0x4d70b7)?_0x509bee[0x0][_0x45af('0x1b')]%_0x4d70b7:0x0;_0x5c6b79[_0x45af('0x1d')](function(_0x4d1265){if(_0x4d1265>0x0){_0x57f3b1+=_0x4d70b7;}_0x58d5c6[_0x45af('0x1e')](dbH[_0x45af('0x1f')][_0x45af('0x20')](util[_0x45af('0x21')](_0x45af('0x22'),QUERY,_0x4d70b7,_0x57f3b1),{'type':dbH[_0x45af('0x1f')][_0x45af('0x23')]['SELECT']}));});if(_0xebbd6e>0x0){_0x57f3b1+=_0x4d70b7;_0x58d5c6[_0x45af('0x1e')](dbH['sequelize'][_0x45af('0x20')](util[_0x45af('0x21')](_0x45af('0x22'),QUERY,_0xebbd6e,_0x57f3b1),{'type':dbH[_0x45af('0x1f')][_0x45af('0x23')][_0x45af('0x17')]}));}}}else{_0x58d5c6[_0x45af('0x1e')](dbH[_0x45af('0x1f')]['query'](QUERY,{'type':dbH[_0x45af('0x1f')][_0x45af('0x23')]['SELECT']}));}var _0x29e06b=path[_0x45af('0x24')](PATH);var _0x30a76e=path[_0x45af('0x25')](PATH,_0x45af('0x26'));var _0x3c1908=_0x1f6146[_0x45af('0x13')]&&_0x58d5c6[_0x45af('0x19')]>0x1;var _0x17bcc5=[];if(!fs[_0x45af('0x27')](path['join'](_0x29e06b,_0x30a76e))&&_0x3c1908){fs['mkdirSync'](path[_0x45af('0x28')](_0x29e06b,_0x30a76e));}return BPromise[_0x45af('0x29')](_0x58d5c6,function(_0x166fbb){_0x17bcc5[_0x45af('0x1e')](_0x166fbb);})[_0x45af('0x15')](function(){for(var _0x57d7af=0x0;_0x57d7af<_0x17bcc5[_0x45af('0x19')];_0x57d7af+=0x1){var _0x2a7325;var _0x12ad8d=_0x17bcc5[_0x57d7af];if(_0x3c1908){_0x2a7325=path[_0x45af('0x28')](_0x29e06b,_0x30a76e,util['format']('%s%d.%s',_0x30a76e,_0x57d7af,'xlsx'));}else{_0x2a7325=path['join'](_0x29e06b,util[_0x45af('0x21')]('%s.%s',_0x30a76e,_0x45af('0x2a')));}fs[_0x45af('0x2b')](_0x2a7325,json2xls(_0x12ad8d),_0x45af('0x2c'));}})[_0x45af('0x15')](function(){if(_0x3c1908){return new Promise(function(_0x83f5e4){zipdir(path[_0x45af('0x28')](_0x29e06b,_0x30a76e),{'saveTo':path['join'](_0x29e06b,util[_0x45af('0x21')]('%s.%s',_0x30a76e,_0x45af('0x2d')))},function(_0x5c3ccf,_0x2b377d){rimraf(path[_0x45af('0x28')](_0x29e06b,_0x30a76e),function(){});_0x83f5e4(_0x45af('0x2e'));});});}})[_0x45af('0x15')](function(){logger[_0x45af('0xe')](util[_0x45af('0x21')](_0x45af('0x2f'),EXTRACTED_REPORT_ID,_0x45af('0x10')));return analyticExtractedReport('Completed',_0x3c1908?util['format'](_0x45af('0x30'),_0x30a76e,_0x3c1908?_0x45af('0x2d'):_0x45af('0x2a')):null);});})['catch'](function(_0x2eaca1){logger[_0x45af('0xe')](util[_0x45af('0x21')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x45af('0x10')),util[_0x45af('0x31')](_0x2eaca1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x45af('0x32'));})['finally'](function(){process[_0x45af('0x33')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index e569238..6cfc17c 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 _0x29cd=['ExecIf','):Goto(','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','*,*,*,*','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','sortBy','catch','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','exten','hasOwnProperty','priority','extensions','find','push','Set','format','type','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','extension','cutdigits','${EXTEN:','${EXTEN}'];(function(_0xa04c5,_0xffb6df){var _0x18bf9b=function(_0x26c8f7){while(--_0x26c8f7){_0xa04c5['push'](_0xa04c5['shift']());}};_0x18bf9b(++_0xffb6df);}(_0x29cd,0xee));var _0xd29c=function(_0x223bbc,_0x432b03){_0x223bbc=_0x223bbc-0x0;var _0xf6df2c=_0x29cd[_0x223bbc];return _0xf6df2c;};'use strict';var _=require(_0xd29c('0x0'));var util=require(_0xd29c('0x1'));function rewrite(_0x44f886,_0x5885f0){var _0x36b59a=this;return _0x44f886[_0xd29c('0x2')][_0xd29c('0x3')][_0xd29c('0x4')]({'raw':!![]})[_0xd29c('0x5')](function(_0xfc09e4){_0x36b59a[_0xd29c('0x6')]=_0xfc09e4;return _0x44f886[_0xd29c('0x2')][_0xd29c('0x7')]['findAll']({'where':{'IntervalId':_0x5885f0['IntervalId']},'raw':!![]});})[_0xd29c('0x5')](function(_0x2bd166){return _0x44f886[_0xd29c('0x2')][_0xd29c('0x7')][_0xd29c('0x4')]({'where':{'exten':{'$in':_[_0xd29c('0x8')](_['map'](_0x2bd166,'exten'))}},'order':[{'raw':_0xd29c('0x9')}],'raw':!![]});})['then'](function(_0x4d331a){var _0x446752=_[_0xd29c('0xa')](_0x4d331a,{'priority':'1'});var _0x2f9200=_[_0xd29c('0xa')](_0x4d331a,{'isApp':0x1});var _0x4f2957=_['groupBy'](_0x2f9200,_0xd29c('0xb'));var _0x39b241=['queue','playback'];var _0x146ad2=[];var _0x11653c=[];for(var _0x573cad in _0x4f2957){if(_0x4f2957[_0xd29c('0xc')](_0x573cad)){_0x36b59a[_0xd29c('0xd')]=0x2;_0x36b59a[_0xd29c('0xe')]=[];_0x36b59a['extension']=_[_0xd29c('0xf')](_0x446752,{'exten':_0x4f2957[_0x573cad][0x0][_0xd29c('0xb')]});_0x36b59a[_0xd29c('0xe')][_0xd29c('0x10')]({'type':_0x4f2957[_0x573cad][0x0]['type'],'app':_0xd29c('0x11'),'appdata':util[_0xd29c('0x12')]('CDR(type)=%s',_0x4f2957[_0x573cad][0x0][_0xd29c('0x13')]),'context':_0x4f2957[_0x573cad][0x0][_0xd29c('0x14')],'exten':_0x4f2957[_0x573cad][0x0][_0xd29c('0xb')],'priority':_0x36b59a[_0xd29c('0xd')]++,'VoiceExtensionId':_0x4f2957[_0x573cad][0x0][_0xd29c('0x15')]});if(_0x4f2957[_0x573cad][0x0]['type']===_0xd29c('0x16')){_0x36b59a['extensions'][_0xd29c('0x10')]({'type':_0x4f2957[_0x573cad][0x0][_0xd29c('0x13')],'app':'Set','appdata':_0xd29c('0x17')+_0x4f2957[_0x573cad][0x0][_0xd29c('0x15')],'context':_0x4f2957[_0x573cad][0x0][_0xd29c('0x14')],'exten':_0x4f2957[_0x573cad][0x0][_0xd29c('0xb')],'priority':_0x36b59a[_0xd29c('0xd')]++,'VoiceExtensionId':_0x4f2957[_0x573cad][0x0][_0xd29c('0x15')]});}else if(_0x4f2957[_0x573cad][0x0][_0xd29c('0x13')]===_0xd29c('0x18')){if(_0x36b59a['extension']){_0x36b59a[_0xd29c('0xe')][_0xd29c('0x10')]({'type':_0x4f2957[_0x573cad][0x0][_0xd29c('0x13')],'app':_0xd29c('0x11'),'appdata':_0xd29c('0x19')+(_0x36b59a[_0xd29c('0x1a')][_0xd29c('0x1b')]?_0xd29c('0x1c')+_0x36b59a[_0xd29c('0x1a')][_0xd29c('0x1b')]+'}':_0xd29c('0x1d')),'context':_0x4f2957[_0x573cad][0x0][_0xd29c('0x14')],'exten':_0x4f2957[_0x573cad][0x0][_0xd29c('0xb')],'priority':_0x36b59a[_0xd29c('0xd')]++,'VoiceExtensionId':_0x4f2957[_0x573cad][0x0]['VoiceExtensionId']});}_0x36b59a['extensions']['push']({'type':_0x4f2957[_0x573cad][0x0][_0xd29c('0x13')],'app':'Set','appdata':_0xd29c('0x17')+_0x4f2957[_0x573cad][0x0][_0xd29c('0x15')],'context':_0x4f2957[_0x573cad][0x0][_0xd29c('0x14')],'exten':_0x4f2957[_0x573cad][0x0]['exten'],'priority':_0x36b59a[_0xd29c('0xd')]++,'VoiceExtensionId':_0x4f2957[_0x573cad][0x0]['VoiceExtensionId']});var _0x367017=_0x36b59a[_0xd29c('0xd')]++;_0x36b59a[_0xd29c('0xe')]['push']({'type':_0x4f2957[_0x573cad][0x0][_0xd29c('0x13')],'app':_0xd29c('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x367017+0x2)+_0xd29c('0x1f')+(_0x367017+0x1)+')','context':_0x4f2957[_0x573cad][0x0][_0xd29c('0x14')],'exten':_0x4f2957[_0x573cad][0x0][_0xd29c('0xb')],'priority':_0x367017,'VoiceExtensionId':_0x4f2957[_0x573cad][0x0][_0xd29c('0x15')]});if(_0x36b59a['extension']){_0x36b59a['extensions'][_0xd29c('0x10')]({'type':_0x4f2957[_0x573cad][0x0][_0xd29c('0x13')],'app':_0xd29c('0x11'),'appdata':_0x36b59a[_0xd29c('0x1a')][_0xd29c('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x36b59a[_0xd29c('0x1a')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x4f2957[_0x573cad][0x0][_0xd29c('0x14')],'exten':_0x4f2957[_0x573cad][0x0][_0xd29c('0xb')],'priority':_0x36b59a['priority']++,'VoiceExtensionId':_0x4f2957[_0x573cad][0x0][_0xd29c('0x15')]});}_0x36b59a[_0xd29c('0xe')][_0xd29c('0x10')]({'type':_0x4f2957[_0x573cad][0x0][_0xd29c('0x13')],'app':_0xd29c('0x11'),'appdata':_0xd29c('0x20')+_0x4f2957[_0x573cad][0x0][_0xd29c('0x15')],'context':_0x4f2957[_0x573cad][0x0][_0xd29c('0x14')],'exten':_0x4f2957[_0x573cad][0x0]['exten'],'priority':_0x36b59a[_0xd29c('0xd')]++,'VoiceExtensionId':_0x4f2957[_0x573cad][0x0]['VoiceExtensionId']});if(_0x36b59a['extension']&&_0x36b59a[_0xd29c('0x1a')][_0xd29c('0xc')](_0xd29c('0x21'))&&_0x36b59a[_0xd29c('0x1a')][_0xd29c('0x21')]!==_0xd29c('0x22')){_0x36b59a['extensions'][_0xd29c('0x10')]({'type':_0x4f2957[_0x573cad][0x0][_0xd29c('0x13')],'app':_0xd29c('0x11'),'appdata':_0xd29c('0x23'),'context':_0x4f2957[_0x573cad][0x0][_0xd29c('0x14')],'exten':_0x4f2957[_0x573cad][0x0]['exten'],'priority':_0x36b59a[_0xd29c('0xd')]++,'VoiceExtensionId':_0x4f2957[_0x573cad][0x0][_0xd29c('0x15')]});_0x36b59a[_0xd29c('0xe')]['push']({'type':_0x4f2957[_0x573cad][0x0][_0xd29c('0x13')],'app':_0xd29c('0x11'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x36b59a[_0xd29c('0x1a')][_0xd29c('0x21')]||_0xd29c('0x24'),'context':_0x4f2957[_0x573cad][0x0][_0xd29c('0x14')],'exten':_0x4f2957[_0x573cad][0x0][_0xd29c('0xb')],'priority':_0x36b59a['priority']++,'VoiceExtensionId':_0x4f2957[_0x573cad][0x0][_0xd29c('0x15')]});}}_0x36b59a[_0xd29c('0xe')][_0xd29c('0x10')]({'type':_0x4f2957[_0x573cad][0x0]['type'],'app':_0xd29c('0x11'),'appdata':_0xd29c('0x25'),'context':_0x4f2957[_0x573cad][0x0][_0xd29c('0x14')],'exten':_0x4f2957[_0x573cad][0x0][_0xd29c('0xb')],'priority':_0x36b59a['priority']++,'VoiceExtensionId':_0x4f2957[_0x573cad][0x0][_0xd29c('0x15')]});_0x36b59a[_0xd29c('0xe')]['push']({'type':_0x4f2957[_0x573cad][0x0][_0xd29c('0x13')],'app':_0xd29c('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4f2957[_0x573cad][0x0]['context'],'exten':_0x4f2957[_0x573cad][0x0][_0xd29c('0xb')],'priority':_0x36b59a[_0xd29c('0xd')]++,'VoiceExtensionId':_0x4f2957[_0x573cad][0x0]['VoiceExtensionId']});_0x36b59a[_0xd29c('0xe')][_0xd29c('0x10')]({'type':_0x4f2957[_0x573cad][0x0][_0xd29c('0x13')],'app':_0xd29c('0x11'),'appdata':_0xd29c('0x26'),'context':_0x4f2957[_0x573cad][0x0][_0xd29c('0x14')],'exten':_0x4f2957[_0x573cad][0x0][_0xd29c('0xb')],'priority':_0x36b59a[_0xd29c('0xd')]++,'VoiceExtensionId':_0x4f2957[_0x573cad][0x0][_0xd29c('0x15')]});for(var _0x4f40d3=0x0,_0x407d81=0x0;_0x4f40d3<_0x4f2957[_0x573cad][_0xd29c('0x27')];_0x4f40d3+=0x1,_0x407d81=0x0){var _0x1b027e=_0x4f2957[_0x573cad][_0x4f40d3];if(_0x1b027e['type']){_0x1b027e[_0xd29c('0x13')]=_0x1b027e[_0xd29c('0x13')]['toLowerCase']();}var _0xee4b74=[];var _0x337302=[];delete _0x1b027e['id'];delete _0x1b027e[_0xd29c('0x28')];delete _0x1b027e['updatedAt'];var _0x4f022d=_0x1b027e['interval']!==_0xd29c('0x29')?[_0x1b027e['interval']]:_0x1b027e['IntervalId']?_['map'](_[_0xd29c('0xa')](_0x36b59a['intervals'],{'IntervalId':_0x1b027e['IntervalId']}),_0xd29c('0x2a')):[];if(_0x1b027e[_0xd29c('0xc')]('tag')){if(_0x1b027e['tag']&&_0x1b027e[_0xd29c('0x2b')]!=='--'){_0xee4b74[_0xd29c('0x10')]({'type':_0x1b027e[_0xd29c('0x13')],'app':'Set','appdata':_0xd29c('0x2c')+_0x1b027e[_0xd29c('0x2b')],'context':_0x1b027e[_0xd29c('0x14')],'exten':_0x1b027e[_0xd29c('0xb')],'priority':_0x4f022d[_0xd29c('0x27')]+_0x36b59a[_0xd29c('0xd')]+_0x407d81++,'VoiceExtensionId':_0x1b027e[_0xd29c('0x15')]});}}if(_0x1b027e[_0xd29c('0x13')]===_0xd29c('0x18')&&_0x1b027e[_0xd29c('0xc')](_0xd29c('0x2d'))){if(_0x1b027e[_0xd29c('0x2d')]){_0xee4b74['push']({'type':_0x1b027e[_0xd29c('0x13')],'app':_0xd29c('0x1e'),'appdata':_0xd29c('0x2e')+_0x1b027e[_0xd29c('0x2d')]+')','context':_0x1b027e[_0xd29c('0x14')],'exten':_0x1b027e['exten'],'priority':_0x4f022d[_0xd29c('0x27')]+_0x36b59a[_0xd29c('0xd')]+_0x407d81++,'VoiceExtensionId':_0x1b027e[_0xd29c('0x15')]});}else{_0xee4b74[_0xd29c('0x10')]({'type':_0x1b027e[_0xd29c('0x13')],'app':_0xd29c('0x1e'),'appdata':_0xd29c('0x2f'),'context':_0x1b027e[_0xd29c('0x14')],'exten':_0x1b027e[_0xd29c('0xb')],'priority':_0x4f022d[_0xd29c('0x27')]+_0x36b59a[_0xd29c('0xd')]+_0x407d81++,'VoiceExtensionId':_0x1b027e[_0xd29c('0x15')]});}}if(_0x1b027e[_0xd29c('0xc')](_0xd29c('0x30'))){if(_0x39b241[_0xd29c('0x31')](_0x1b027e[_0xd29c('0x32')]['toLowerCase']())>=0x0&&_0x1b027e[_0xd29c('0x33')]!=='custom'){if(_0x1b027e[_0xd29c('0x30')]){_0xee4b74[_0xd29c('0x10')]({'type':_0x1b027e[_0xd29c('0x13')],'app':_0xd29c('0x1e'),'appdata':_0xd29c('0x34'),'context':_0x1b027e[_0xd29c('0x14')],'exten':_0x1b027e[_0xd29c('0xb')],'priority':_0x4f022d['length']+_0x36b59a[_0xd29c('0xd')]+_0x407d81++,'VoiceExtensionId':_0x1b027e[_0xd29c('0x15')]});_0xee4b74['push']({'type':_0x1b027e[_0xd29c('0x13')],'app':'Set','appdata':_0xd29c('0x35'),'context':_0x1b027e[_0xd29c('0x14')],'exten':_0x1b027e[_0xd29c('0xb')],'priority':_0x4f022d[_0xd29c('0x27')]+_0x36b59a['priority']+_0x407d81++,'VoiceExtensionId':_0x1b027e['VoiceExtensionId']});}else{_0xee4b74['push']({'type':_0x1b027e['type'],'app':_0xd29c('0x1e'),'appdata':_0xd29c('0x36'),'context':_0x1b027e[_0xd29c('0x14')],'exten':_0x1b027e[_0xd29c('0xb')],'priority':_0x4f022d[_0xd29c('0x27')]+_0x36b59a[_0xd29c('0xd')]+_0x407d81++,'VoiceExtensionId':_0x1b027e[_0xd29c('0x15')]});_0xee4b74[_0xd29c('0x10')]({'type':_0x1b027e[_0xd29c('0x13')],'app':_0xd29c('0x11'),'appdata':_0xd29c('0x37'),'context':_0x1b027e[_0xd29c('0x14')],'exten':_0x1b027e[_0xd29c('0xb')],'priority':_0x4f022d['length']+_0x36b59a[_0xd29c('0xd')]+_0x407d81++,'VoiceExtensionId':_0x1b027e[_0xd29c('0x15')]});}}}for(var _0x120029=0x0;_0x120029<_0x4f022d[_0xd29c('0x27')];_0x120029+=0x1){var _0x3dbfd9=_0x36b59a[_0xd29c('0xd')]+_0x4f022d[_0xd29c('0x27')];var _0x115036=_0x120029===_0x4f022d['length']-0x1?_0x36b59a[_0xd29c('0xd')]+_0xee4b74[_0xd29c('0x27')]+_0x337302['length']+0x2:_0x36b59a[_0xd29c('0xd')]+_0x120029+0x1;_0xee4b74[_0xd29c('0x38')](_0x120029,0x0,{'type':_0x1b027e[_0xd29c('0x13')],'app':_0xd29c('0x39'),'appdata':_0x4f022d[_0x120029]+'?'+_0x1b027e[_0xd29c('0x14')]+',${EXTEN},'+_0x3dbfd9+':'+_0x1b027e[_0xd29c('0x14')]+_0xd29c('0x3a')+_0x115036,'exten':_0x1b027e[_0xd29c('0xb')],'context':_0x1b027e[_0xd29c('0x14')],'priority':_0x36b59a[_0xd29c('0xd')]+_0x120029,'VoiceExtensionId':_0x4f2957[_0x573cad][0x0]['VoiceExtensionId']});}_0x1b027e[_0xd29c('0xd')]=_0xee4b74[_0xd29c('0x27')]?_['last'](_0xee4b74)[_0xd29c('0xd')]+0x1:_0x36b59a[_0xd29c('0xd')];_0x36b59a[_0xd29c('0xd')]=(_0x337302['length']?_[_0xd29c('0x3b')](_0x337302)['priority']:_0x1b027e[_0xd29c('0xd')])+0x1;_0x36b59a[_0xd29c('0xe')]=_[_0xd29c('0x3c')](_0x36b59a['extensions'],_0xee4b74,[_0x1b027e],_0x337302);}_0x36b59a[_0xd29c('0xe')][_0xd29c('0x10')]({'type':_0x4f2957[_0x573cad][0x0][_0xd29c('0x13')],'app':_0xd29c('0x3d'),'exten':_0x4f2957[_0x573cad][0x0][_0xd29c('0xb')],'context':_0x4f2957[_0x573cad][0x0]['context'],'priority':_0x36b59a['priority'],'VoiceExtensionId':_0x4f2957[_0x573cad][0x0][_0xd29c('0x15')]});_0x146ad2[_0xd29c('0x10')](_0x4f2957[_0x573cad][0x0]['VoiceExtensionId']);_0x11653c=_[_0xd29c('0x3c')](_0x11653c,_0x36b59a[_0xd29c('0xe')]);}}return _0x44f886['transaction'](function(_0xdc96fc){return _0x44f886[_0xd29c('0x2')][_0xd29c('0x7')][_0xd29c('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x146ad2}},'transaction':_0xdc96fc})[_0xd29c('0x5')](function(_0x235b1c){return _0x44f886[_0xd29c('0x2')][_0xd29c('0x7')][_0xd29c('0x3f')](_[_0xd29c('0x40')](_0x11653c,_0xd29c('0xd')),{'transaction':_0xdc96fc});});});})[_0xd29c('0x41')](function(_0x16611f){console['error'](_0x16611f);});}exports[_0xd29c('0x42')]=rewrite; \ No newline at end of file +var _0xa4ac=['_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','interval','IntervalId','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','error','util','models','Interval','findAll','intervals','VoiceExtension','then','exten','filter','groupBy','playback','hasOwnProperty','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','priority','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa4ac,0xa9));var _0xca4a=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xa4ac[_0x174ef5];return _0x1cc379;};'use strict';var _=require('lodash');var util=require(_0xca4a('0x0'));function rewrite(_0xfbd9b2,_0x402bbd){var _0xbdc3c4=this;return _0xfbd9b2[_0xca4a('0x1')][_0xca4a('0x2')][_0xca4a('0x3')]({'raw':!![]})['then'](function(_0x2e2769){_0xbdc3c4[_0xca4a('0x4')]=_0x2e2769;return _0xfbd9b2[_0xca4a('0x1')][_0xca4a('0x5')][_0xca4a('0x3')]({'where':{'IntervalId':_0x402bbd['IntervalId']},'raw':!![]});})[_0xca4a('0x6')](function(_0x51638c){return _0xfbd9b2[_0xca4a('0x1')]['VoiceExtension'][_0xca4a('0x3')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x51638c,_0xca4a('0x7')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xca4a('0x6')](function(_0x5d9689){var _0x354fa0=_['filter'](_0x5d9689,{'priority':'1'});var _0xd7ac78=_[_0xca4a('0x8')](_0x5d9689,{'isApp':0x1});var _0x12cff5=_[_0xca4a('0x9')](_0xd7ac78,_0xca4a('0x7'));var _0x599461=['queue',_0xca4a('0xa')];var _0x20044d=[];var _0x406b9d=[];for(var _0x1b144f in _0x12cff5){if(_0x12cff5[_0xca4a('0xb')](_0x1b144f)){_0xbdc3c4['priority']=0x2;_0xbdc3c4[_0xca4a('0xc')]=[];_0xbdc3c4[_0xca4a('0xd')]=_[_0xca4a('0xe')](_0x354fa0,{'exten':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x7')]});_0xbdc3c4[_0xca4a('0xc')][_0xca4a('0xf')]({'type':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x10')],'app':_0xca4a('0x11'),'appdata':util[_0xca4a('0x12')](_0xca4a('0x13'),_0x12cff5[_0x1b144f][0x0][_0xca4a('0x10')]),'context':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x14')],'exten':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x7')],'priority':_0xbdc3c4['priority']++,'VoiceExtensionId':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x15')]});if(_0x12cff5[_0x1b144f][0x0][_0xca4a('0x10')]===_0xca4a('0x16')){_0xbdc3c4[_0xca4a('0xc')][_0xca4a('0xf')]({'type':_0x12cff5[_0x1b144f][0x0]['type'],'app':'Set','appdata':_0xca4a('0x17')+_0x12cff5[_0x1b144f][0x0][_0xca4a('0x15')],'context':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x14')],'exten':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x7')],'priority':_0xbdc3c4[_0xca4a('0x18')]++,'VoiceExtensionId':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x15')]});}else if(_0x12cff5[_0x1b144f][0x0][_0xca4a('0x10')]===_0xca4a('0x19')){if(_0xbdc3c4['extension']){_0xbdc3c4['extensions'][_0xca4a('0xf')]({'type':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x10')],'app':_0xca4a('0x11'),'appdata':_0xca4a('0x1a')+(_0xbdc3c4[_0xca4a('0xd')]['cutdigits']?_0xca4a('0x1b')+_0xbdc3c4[_0xca4a('0xd')][_0xca4a('0x1c')]+'}':_0xca4a('0x1d')),'context':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x14')],'exten':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x7')],'priority':_0xbdc3c4[_0xca4a('0x18')]++,'VoiceExtensionId':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x15')]});}_0xbdc3c4[_0xca4a('0xc')][_0xca4a('0xf')]({'type':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x10')],'app':_0xca4a('0x11'),'appdata':_0xca4a('0x17')+_0x12cff5[_0x1b144f][0x0][_0xca4a('0x15')],'context':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x14')],'exten':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x7')],'priority':_0xbdc3c4[_0xca4a('0x18')]++,'VoiceExtensionId':_0x12cff5[_0x1b144f][0x0]['VoiceExtensionId']});var _0x4c1a74=_0xbdc3c4[_0xca4a('0x18')]++;_0xbdc3c4[_0xca4a('0xc')]['push']({'type':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x10')],'app':_0xca4a('0x1e'),'appdata':_0xca4a('0x1f')+(_0x4c1a74+0x2)+_0xca4a('0x20')+(_0x4c1a74+0x1)+')','context':_0x12cff5[_0x1b144f][0x0]['context'],'exten':_0x12cff5[_0x1b144f][0x0]['exten'],'priority':_0x4c1a74,'VoiceExtensionId':_0x12cff5[_0x1b144f][0x0]['VoiceExtensionId']});if(_0xbdc3c4[_0xca4a('0xd')]){_0xbdc3c4[_0xca4a('0xc')]['push']({'type':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x10')],'app':_0xca4a('0x11'),'appdata':_0xbdc3c4['extension']['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0xbdc3c4[_0xca4a('0xd')][_0xca4a('0x1c')]+'}':_0xca4a('0x21'),'context':_0x12cff5[_0x1b144f][0x0]['context'],'exten':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x7')],'priority':_0xbdc3c4[_0xca4a('0x18')]++,'VoiceExtensionId':_0x12cff5[_0x1b144f][0x0]['VoiceExtensionId']});}_0xbdc3c4['extensions']['push']({'type':_0x12cff5[_0x1b144f][0x0]['type'],'app':_0xca4a('0x11'),'appdata':_0xca4a('0x22')+_0x12cff5[_0x1b144f][0x0]['VoiceExtensionId'],'context':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x14')],'exten':_0x12cff5[_0x1b144f][0x0]['exten'],'priority':_0xbdc3c4[_0xca4a('0x18')]++,'VoiceExtensionId':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x15')]});if(_0xbdc3c4[_0xca4a('0xd')]&&_0xbdc3c4[_0xca4a('0xd')][_0xca4a('0xb')](_0xca4a('0x23'))&&_0xbdc3c4[_0xca4a('0xd')]['recordingFormat']!==_0xca4a('0x24')){_0xbdc3c4[_0xca4a('0xc')][_0xca4a('0xf')]({'type':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x10')],'app':'Set','appdata':_0xca4a('0x25'),'context':_0x12cff5[_0x1b144f][0x0]['context'],'exten':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x7')],'priority':_0xbdc3c4[_0xca4a('0x18')]++,'VoiceExtensionId':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x15')]});_0xbdc3c4[_0xca4a('0xc')][_0xca4a('0xf')]({'type':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x10')],'app':_0xca4a('0x11'),'appdata':_0xca4a('0x26')+_0xbdc3c4[_0xca4a('0xd')]['recordingFormat']||_0xca4a('0x27'),'context':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x14')],'exten':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x7')],'priority':_0xbdc3c4['priority']++,'VoiceExtensionId':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x15')]});}}_0xbdc3c4[_0xca4a('0xc')]['push']({'type':_0x12cff5[_0x1b144f][0x0]['type'],'app':_0xca4a('0x11'),'appdata':_0xca4a('0x28'),'context':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x14')],'exten':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x7')],'priority':_0xbdc3c4[_0xca4a('0x18')]++,'VoiceExtensionId':_0x12cff5[_0x1b144f][0x0]['VoiceExtensionId']});_0xbdc3c4['extensions']['push']({'type':_0x12cff5[_0x1b144f][0x0]['type'],'app':_0xca4a('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x12cff5[_0x1b144f][0x0]['context'],'exten':_0x12cff5[_0x1b144f][0x0]['exten'],'priority':_0xbdc3c4[_0xca4a('0x18')]++,'VoiceExtensionId':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x15')]});_0xbdc3c4[_0xca4a('0xc')][_0xca4a('0xf')]({'type':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x10')],'app':_0xca4a('0x11'),'appdata':_0xca4a('0x29'),'context':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x14')],'exten':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x7')],'priority':_0xbdc3c4['priority']++,'VoiceExtensionId':_0x12cff5[_0x1b144f][0x0]['VoiceExtensionId']});for(var _0x19bdaa=0x0,_0x3e2540=0x0;_0x19bdaa<_0x12cff5[_0x1b144f][_0xca4a('0x2a')];_0x19bdaa+=0x1,_0x3e2540=0x0){var _0x35840c=_0x12cff5[_0x1b144f][_0x19bdaa];if(_0x35840c[_0xca4a('0x10')]){_0x35840c[_0xca4a('0x10')]=_0x35840c[_0xca4a('0x10')]['toLowerCase']();}var _0x4912b3=[];var _0x39235c=[];delete _0x35840c['id'];delete _0x35840c[_0xca4a('0x2b')];delete _0x35840c['updatedAt'];var _0x2c6faf=_0x35840c['interval']!=='*,*,*,*'?[_0x35840c[_0xca4a('0x2c')]]:_0x35840c[_0xca4a('0x2d')]?_[_0xca4a('0x2e')](_['filter'](_0xbdc3c4['intervals'],{'IntervalId':_0x35840c['IntervalId']}),_0xca4a('0x2c')):[];if(_0x35840c[_0xca4a('0xb')](_0xca4a('0x2f'))){if(_0x35840c[_0xca4a('0x2f')]&&_0x35840c[_0xca4a('0x2f')]!=='--'){_0x4912b3['push']({'type':_0x35840c['type'],'app':_0xca4a('0x11'),'appdata':_0xca4a('0x30')+_0x35840c[_0xca4a('0x2f')],'context':_0x35840c[_0xca4a('0x14')],'exten':_0x35840c[_0xca4a('0x7')],'priority':_0x2c6faf[_0xca4a('0x2a')]+_0xbdc3c4['priority']+_0x3e2540++,'VoiceExtensionId':_0x35840c[_0xca4a('0x15')]});}}if(_0x35840c[_0xca4a('0x10')]==='outbound'&&_0x35840c[_0xca4a('0xb')]('callerID')){if(_0x35840c[_0xca4a('0x31')]){_0x4912b3['push']({'type':_0x35840c[_0xca4a('0x10')],'app':'ExecIf','appdata':_0xca4a('0x32')+_0x35840c[_0xca4a('0x31')]+')','context':_0x35840c[_0xca4a('0x14')],'exten':_0x35840c['exten'],'priority':_0x2c6faf['length']+_0xbdc3c4[_0xca4a('0x18')]+_0x3e2540++,'VoiceExtensionId':_0x35840c['VoiceExtensionId']});}else{_0x4912b3['push']({'type':_0x35840c[_0xca4a('0x10')],'app':'ExecIf','appdata':_0xca4a('0x33'),'context':_0x35840c[_0xca4a('0x14')],'exten':_0x35840c[_0xca4a('0x7')],'priority':_0x2c6faf[_0xca4a('0x2a')]+_0xbdc3c4['priority']+_0x3e2540++,'VoiceExtensionId':_0x35840c[_0xca4a('0x15')]});}}if(_0x35840c[_0xca4a('0xb')]('answer')){if(_0x599461[_0xca4a('0x34')](_0x35840c[_0xca4a('0x35')][_0xca4a('0x36')]())>=0x0&&_0x35840c[_0xca4a('0x37')]!==_0xca4a('0x38')){if(_0x35840c['answer']){_0x4912b3[_0xca4a('0xf')]({'type':_0x35840c[_0xca4a('0x10')],'app':_0xca4a('0x1e'),'appdata':_0xca4a('0x39'),'context':_0x35840c['context'],'exten':_0x35840c[_0xca4a('0x7')],'priority':_0x2c6faf[_0xca4a('0x2a')]+_0xbdc3c4[_0xca4a('0x18')]+_0x3e2540++,'VoiceExtensionId':_0x35840c[_0xca4a('0x15')]});_0x4912b3[_0xca4a('0xf')]({'type':_0x35840c[_0xca4a('0x10')],'app':_0xca4a('0x11'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x35840c[_0xca4a('0x14')],'exten':_0x35840c[_0xca4a('0x7')],'priority':_0x2c6faf[_0xca4a('0x2a')]+_0xbdc3c4[_0xca4a('0x18')]+_0x3e2540++,'VoiceExtensionId':_0x35840c[_0xca4a('0x15')]});}else{_0x4912b3['push']({'type':_0x35840c['type'],'app':_0xca4a('0x1e'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x35840c[_0xca4a('0x14')],'exten':_0x35840c['exten'],'priority':_0x2c6faf['length']+_0xbdc3c4[_0xca4a('0x18')]+_0x3e2540++,'VoiceExtensionId':_0x35840c[_0xca4a('0x15')]});_0x4912b3[_0xca4a('0xf')]({'type':_0x35840c[_0xca4a('0x10')],'app':_0xca4a('0x11'),'appdata':_0xca4a('0x3a'),'context':_0x35840c[_0xca4a('0x14')],'exten':_0x35840c[_0xca4a('0x7')],'priority':_0x2c6faf[_0xca4a('0x2a')]+_0xbdc3c4[_0xca4a('0x18')]+_0x3e2540++,'VoiceExtensionId':_0x35840c[_0xca4a('0x15')]});}}}for(var _0x4c66d3=0x0;_0x4c66d3<_0x2c6faf[_0xca4a('0x2a')];_0x4c66d3+=0x1){var _0x2b35c0=_0xbdc3c4['priority']+_0x2c6faf[_0xca4a('0x2a')];var _0x4e3715=_0x4c66d3===_0x2c6faf['length']-0x1?_0xbdc3c4['priority']+_0x4912b3[_0xca4a('0x2a')]+_0x39235c[_0xca4a('0x2a')]+0x2:_0xbdc3c4[_0xca4a('0x18')]+_0x4c66d3+0x1;_0x4912b3['splice'](_0x4c66d3,0x0,{'type':_0x35840c[_0xca4a('0x10')],'app':_0xca4a('0x3b'),'appdata':_0x2c6faf[_0x4c66d3]+'?'+_0x35840c[_0xca4a('0x14')]+_0xca4a('0x3c')+_0x2b35c0+':'+_0x35840c[_0xca4a('0x14')]+_0xca4a('0x3c')+_0x4e3715,'exten':_0x35840c[_0xca4a('0x7')],'context':_0x35840c[_0xca4a('0x14')],'priority':_0xbdc3c4[_0xca4a('0x18')]+_0x4c66d3,'VoiceExtensionId':_0x12cff5[_0x1b144f][0x0]['VoiceExtensionId']});}_0x35840c[_0xca4a('0x18')]=_0x4912b3[_0xca4a('0x2a')]?_['last'](_0x4912b3)[_0xca4a('0x18')]+0x1:_0xbdc3c4[_0xca4a('0x18')];_0xbdc3c4['priority']=(_0x39235c[_0xca4a('0x2a')]?_[_0xca4a('0x3d')](_0x39235c)[_0xca4a('0x18')]:_0x35840c['priority'])+0x1;_0xbdc3c4['extensions']=_[_0xca4a('0x3e')](_0xbdc3c4[_0xca4a('0xc')],_0x4912b3,[_0x35840c],_0x39235c);}_0xbdc3c4[_0xca4a('0xc')][_0xca4a('0xf')]({'type':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x10')],'app':_0xca4a('0x3f'),'exten':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x7')],'context':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x14')],'priority':_0xbdc3c4[_0xca4a('0x18')],'VoiceExtensionId':_0x12cff5[_0x1b144f][0x0][_0xca4a('0x15')]});_0x20044d['push'](_0x12cff5[_0x1b144f][0x0][_0xca4a('0x15')]);_0x406b9d=_[_0xca4a('0x3e')](_0x406b9d,_0xbdc3c4['extensions']);}}return _0xfbd9b2[_0xca4a('0x40')](function(_0x12219b){return _0xfbd9b2['models'][_0xca4a('0x5')][_0xca4a('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x20044d}},'transaction':_0x12219b})[_0xca4a('0x6')](function(_0x10acee){return _0xfbd9b2[_0xca4a('0x1')]['VoiceExtension']['bulkCreate'](_[_0xca4a('0x42')](_0x406b9d,_0xca4a('0x18')),{'transaction':_0x12219b});});});})[_0xca4a('0x43')](function(_0xb0533b){console[_0xca4a('0x44')](_0xb0533b);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 2d51503..23cb544 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 _0x5245=['Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','scheduledAt','ContactId','updatedAt','field','toString','NOW()','createdAt','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','fromQuery','select','str','calleridnum','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','get','sequelize','query','catch','onlyIfOpen','VoiceQueueId','all','BlackLists','Campaign','always','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','api','redis','defaults','localhost','socket.io-emitter','argv','undefined','zipObject','split','null','Missing\x20ListId\x20parameter!','error','contact','isNil','errors','map','message','join','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','then','push','pick'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x5245,0x114));var _0x5524=function(_0x23055f,_0x22a833){_0x23055f=_0x23055f-0x0;var _0x31bd9d=_0x5245[_0x23055f];return _0x31bd9d;};'use strict';var BPromise=require(_0x5524('0x0'));var util=require(_0x5524('0x1'));var _=require(_0x5524('0x2'));var fs=require('fs');var squel=require(_0x5524('0x3'));var Papa=require(_0x5524('0x4'));var Redis=require(_0x5524('0x5'));var db=require(_0x5524('0x6'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x5524('0x7'));config[_0x5524('0x8')]=_[_0x5524('0x9')](config['redis'],{'host':_0x5524('0xa'),'port':0x18eb});var socket=require(_0x5524('0xb'))(new Redis(config[_0x5524('0x8')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0x5524('0xc')][0x2]||process[_0x5524('0xc')][0x2]==='undefined'||process['argv'][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x5524('0xc')][0x2];if(!process[_0x5524('0xc')][0x3]||process[_0x5524('0xc')][0x3]===_0x5524('0xd')||process[_0x5524('0xc')][0x3]==='null'||!process[_0x5524('0xc')][0x4]||process[_0x5524('0xc')][0x4]===_0x5524('0xd')||process[_0x5524('0xc')][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x5524('0xe')](process[_0x5524('0xc')][0x3][_0x5524('0xf')](','),process['argv'][0x4]['split'](','));if(!process[_0x5524('0xc')][0x5]||process[_0x5524('0xc')][0x5]==='undefined'||process[_0x5524('0xc')][0x5]===_0x5524('0x10')){throw new Error(_0x5524('0x11'));}var LISTID=process[_0x5524('0xc')][0x5];var COMPANYID=process[_0x5524('0xc')][0x6]&&process[_0x5524('0xc')][0x6]!==_0x5524('0xd')&&process['argv'][0x6]!=='null'?process[_0x5524('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x5524('0xc')][0x7]!=='undefined'&&process[_0x5524('0xc')][0x7]!==_0x5524('0x10')?process[_0x5524('0xc')][0x7]:null;if(!process[_0x5524('0xc')][0x8]||process[_0x5524('0xc')][0x8]===_0x5524('0xd')||process[_0x5524('0xc')][0x8]===_0x5524('0x10')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x5524('0xc')][0x8];}catch(_0x553c8d){logger[_0x5524('0x12')](_0x553c8d);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(_0x3283e7,_0x2e70f2,_0x2f00c1,_0x29bb14){var _0x8ad643={'message':_0x2e70f2};_0x8ad643[_0x3283e7]=!![];if(_0x2f00c1){_0x8ad643[_0x5524('0x13')]=_0x2f00c1;}if(_0x29bb14){_0x8ad643['index']=_0x29bb14;}return _0x8ad643;}function isEmail(_0xee1c2){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'](_0xee1c2);}function checkRow(_0x27b258,_0x1270f7,_0x454b96){return new BPromise(function(_0x53c1db,_0x2daa2b){if(_[_0x5524('0x14')](_0x27b258)){return _0x2daa2b(handleCheckRowError(_0x5524('0x12'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x454b96));}if(_0x27b258['errors']&&_0x27b258[_0x5524('0x15')]['length']){var _0x2e55b7=_[_0x5524('0x16')](_0x27b258[_0x5524('0x15')],_0x5524('0x17'))[_0x5524('0x18')](';');return _0x2daa2b(handleCheckRowError(_0x5524('0x12'),_0x2e55b7,null,_0x454b96));}var _0x28d814={};for(var _0x448d01 in FIELDS){if(FIELDS['hasOwnProperty'](_0x448d01)&&FIELDS[_0x448d01]){_0x28d814[_0x448d01]=_0x27b258[_0x5524('0x19')][0x0][FIELDS[_0x448d01]]||_0x27b258[_0x5524('0x19')][0x0]['\ufeff'+FIELDS[_0x448d01]];}}if(!_0x28d814['firstName']){return _0x2daa2b(handleCheckRowError(_0x5524('0x12'),_0x5524('0x1a'),null,_0x454b96));}if(!_0x28d814[_0x5524('0x1b')]){return _0x2daa2b(handleCheckRowError('error',_0x5524('0x1c'),null,_0x454b96));}if(_0x28d814[_0x5524('0x1d')]){var _0x37240d=moment(_0x28d814[_0x5524('0x1d')],_0x5524('0x1e'));if(!_0x37240d[_0x5524('0x1f')]()){return _0x2daa2b(handleCheckRowError('error',_0x5524('0x20'),null,_0x454b96));}}if(_0x28d814[_0x5524('0x21')]){if(!isEmail(_0x28d814[_0x5524('0x21')])){return _0x2daa2b(handleCheckRowError(_0x5524('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x454b96));}}_0x28d814[_0x5524('0x22')]=LISTID;_0x28d814[_0x5524('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x5524('0x24')]&&_0x1270f7){var _0x2aefab={};for(var _0x2a5751=0x0,_0x22a373=DUPLICATES['length'];_0x2a5751<_0x22a373;_0x2a5751+=0x1){_0x2aefab[DUPLICATES[_0x2a5751]]=_0x28d814[DUPLICATES[_0x2a5751]];}var _0x527bae=_[_0x5524('0x25')](_0x1270f7,_0x2aefab);if(_0x527bae){return _0x2daa2b(handleCheckRowError(_0x5524('0x26'),_0x5524('0x27'),_0x527bae,_0x454b96));}}return db[_0x5524('0x28')][_0x5524('0x29')](_0x28d814,{'raw':!![],'hooks':![],'fields':_['keys'](_0x28d814)})[_0x5524('0x2a')](function(_0xf0fc){if(DUPLICATES&&DUPLICATES['length']&&_0x1270f7){_0x1270f7[_0x5524('0x2b')](_[_0x5524('0x2c')](_0x28d814,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xf0fc['id'];return _0x53c1db();})['catch'](function(_0x564f75){return _0x2daa2b(handleCheckRowError(_0x5524('0x12'),_0x5524('0x2d')+(_0x564f75[_0x5524('0x17')]||JSON[_0x5524('0x2e')](_0x564f75)),null,_0x454b96));});});}function checkHopper(){function _0x221314(){return function(_0x60d7c8){logger['error'](_0x5524('0x2f'),_0x5524('0x30'),util[_0x5524('0x31')](_0x60d7c8,{'showHidden':![],'depth':null}));};}var _0x45150c=function(_0x58aadf,_0xd209a5){var _0x2d9d9c=squel[_0x5524('0x32')]()[_0x5524('0x33')](_0x5524('0x34'))['fromQuery'](['phone',_0x5524('0x35'),_0x5524('0x36'),_0x5524('0x22'),_0xd209a5,'createdAt',_0x5524('0x37')],squel['select']()[_0x5524('0x38')](_0x5524('0x1b'),_0x5524('0x1b'))['field']('NOW()','scheduledAt')[_0x5524('0x38')]('id','ContactId')['field'](LISTID[_0x5524('0x39')](),_0x5524('0x22'))[_0x5524('0x38')](_0x58aadf['id'][_0x5524('0x39')](),_0xd209a5)[_0x5524('0x38')](_0x5524('0x3a'),_0x5524('0x3b'))['field']('NOW()',_0x5524('0x37'))[_0x5524('0x3c')](_0x5524('0x3d'))['where'](_0x5524('0x3e'))[_0x5524('0x3f')](_0x5524('0x40'),LISTID[_0x5524('0x39')]())['where'](_0x5524('0x41'))['where'](_0x5524('0x42'),squel['select']()[_0x5524('0x38')](_0x5524('0x1b'))[_0x5524('0x3c')](_0x5524('0x34'))[_0x5524('0x3f')](_0xd209a5+_0x5524('0x43'),_0x58aadf['id'][_0x5524('0x39')]())))['toString']();return _0x2d9d9c;};var _0x174b7d=function(_0x8ce620,_0x3706ba){var _0x4094e4=squel[_0x5524('0x32')]()[_0x5524('0x33')](_0x5524('0x34'))[_0x5524('0x44')]([_0x5524('0x1b'),_0x5524('0x35'),'ContactId',_0x5524('0x22'),_0x3706ba,'createdAt',_0x5524('0x37')],squel[_0x5524('0x45')]()[_0x5524('0x38')]('phone',_0x5524('0x1b'))[_0x5524('0x38')](_0x5524('0x3a'),_0x5524('0x35'))[_0x5524('0x38')]('id','ContactId')['field'](LISTID[_0x5524('0x39')](),_0x5524('0x22'))[_0x5524('0x38')](_0x8ce620['id']['toString'](),_0x3706ba)['field'](_0x5524('0x3a'),_0x5524('0x3b'))[_0x5524('0x38')]('NOW()',_0x5524('0x37'))['from'](_0x5524('0x3d'))[_0x5524('0x3f')](_0x5524('0x3e'))['where'](_0x5524('0x40'),LISTID[_0x5524('0x39')]())[_0x5524('0x3f')]('id\x20IN\x20?',squel[_0x5524('0x46')](hopperContacts))['where'](_0x5524('0x41'))[_0x5524('0x3f')](_0x5524('0x42'),squel[_0x5524('0x45')]()[_0x5524('0x38')](_0x5524('0x47'))[_0x5524('0x3c')](_0x5524('0x48'))[_0x5524('0x3f')](_0x3706ba+_0x5524('0x43'),_0x8ce620['id'][_0x5524('0x39')]()))[_0x5524('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5524('0x45')]()[_0x5524('0x38')](_0x5524('0x1b'))[_0x5524('0x3c')](_0x5524('0x34'))[_0x5524('0x3f')](_0x3706ba+'\x20=\x20?',_0x8ce620['id'][_0x5524('0x39')]())))[_0x5524('0x39')]();return _0x4094e4;};function _0x5555b2(_0x52fe20,_0x1fdeda){var _0x476e57=squel[_0x5524('0x32')]()[_0x5524('0x33')](_0x5524('0x34'))[_0x5524('0x44')]([_0x5524('0x1b'),_0x5524('0x35'),'ContactId','ListId',_0x1fdeda,_0x5524('0x3b'),_0x5524('0x37')],squel['select']()[_0x5524('0x38')](_0x5524('0x1b'),_0x5524('0x1b'))['field']('NOW()',_0x5524('0x35'))[_0x5524('0x38')]('id',_0x5524('0x36'))['field'](LISTID[_0x5524('0x39')](),_0x5524('0x22'))[_0x5524('0x38')](_0x52fe20['id'][_0x5524('0x39')](),_0x1fdeda)[_0x5524('0x38')]('NOW()',_0x5524('0x3b'))[_0x5524('0x38')](_0x5524('0x3a'),_0x5524('0x37'))['from'](_0x5524('0x3d'))[_0x5524('0x3f')]('deletedAt\x20IS\x20NULL')[_0x5524('0x3f')](_0x5524('0x40'),LISTID[_0x5524('0x39')]())['where'](_0x5524('0x49'),squel[_0x5524('0x46')](hopperContacts))[_0x5524('0x3f')](_0x5524('0x41')))['toString']();return _0x476e57;}function _0x4719b3(_0x5b1f3e,_0x263bc3){var _0x90cedb=squel[_0x5524('0x32')]()[_0x5524('0x33')](_0x5524('0x4a'))[_0x5524('0x44')]([_0x5524('0x1b'),_0x5524('0x36'),_0x5524('0x22'),_0x263bc3,_0x5524('0x3b'),'updatedAt'],squel[_0x5524('0x45')]()['field']('phone',_0x5524('0x1b'))[_0x5524('0x38')]('id','ContactId')['field'](LISTID['toString'](),_0x5524('0x22'))[_0x5524('0x38')](_0x5b1f3e['id'][_0x5524('0x39')](),_0x263bc3)[_0x5524('0x38')]('NOW()',_0x5524('0x3b'))[_0x5524('0x38')](_0x5524('0x3a'),_0x5524('0x37'))['from'](_0x5524('0x3d'))[_0x5524('0x3f')]('deletedAt\x20IS\x20NULL')[_0x5524('0x3f')](_0x5524('0x40'),LISTID[_0x5524('0x39')]())['where'](_0x5524('0x49'),squel['str'](hopperContacts))[_0x5524('0x3f')](_0x5524('0x41')))[_0x5524('0x39')]();return _0x90cedb;}return db[_0x5524('0x4b')][_0x5524('0x4c')]({'where':{'type':_0x5524('0x4d')},'attributes':['id',_0x5524('0x4e')],'include':[{'model':db[_0x5524('0x4f')],'as':'Lists','where':{'id':LISTID}}]})[_0x5524('0x2a')](function(_0x2a8b90){var _0x3e4c75=[];if(_0x2a8b90){var _0x36d2c1;for(var _0x5b07b6=0x0,_0x537b24;_0x5b07b6<_0x2a8b90[_0x5524('0x24')];_0x5b07b6+=0x1){_0x537b24=_0x2a8b90[_0x5b07b6][_0x5524('0x50')]({'plain':!![]});switch(_0x537b24['dialCheckDuplicateType']){case'always':_0x3e4c75[_0x5524('0x2b')](db[_0x5524('0x51')][_0x5524('0x52')](_0x174b7d(_0x537b24,'VoiceQueueId'))[_0x5524('0x2a')](function(){})[_0x5524('0x53')](_0x221314()));break;case _0x5524('0x54'):_0x3e4c75[_0x5524('0x2b')](db[_0x5524('0x51')][_0x5524('0x52')](_0x45150c(_0x537b24,_0x5524('0x55')))[_0x5524('0x2a')](function(){})['catch'](_0x221314()));break;default:_0x3e4c75[_0x5524('0x2b')](db[_0x5524('0x51')]['query'](_0x5555b2(_0x537b24,_0x5524('0x55')))[_0x5524('0x2a')](function(){})[_0x5524('0x53')](_0x221314()));}}}return _0x3e4c75;})[_0x5524('0x56')]()[_0x5524('0x2a')](function(){return db['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x5524('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x3cb2ba){var _0x13e618=[];if(_0x3cb2ba){var _0x42b2e5;for(var _0x1869a8=0x0,_0x442694;_0x1869a8<_0x3cb2ba[_0x5524('0x24')];_0x1869a8+=0x1){_0x442694=_0x3cb2ba[_0x1869a8][_0x5524('0x50')]({'plain':!![]});_0x13e618['push'](db[_0x5524('0x51')][_0x5524('0x52')](_0x4719b3(_0x442694,'VoiceQueueId'))[_0x5524('0x2a')](function(){})[_0x5524('0x53')](_0x221314()));}}return _0x13e618;})['all']();})[_0x5524('0x2a')](function(){return db[_0x5524('0x58')][_0x5524('0x4c')]({'attributes':['id',_0x5524('0x4e')],'include':[{'model':db[_0x5524('0x4f')],'as':'Lists','where':{'id':LISTID}}]})[_0x5524('0x2a')](function(_0xbc0ced){var _0x4d083b=[];if(_0xbc0ced){for(var _0x189660=0x0,_0x5ce59d;_0x189660<_0xbc0ced[_0x5524('0x24')];_0x189660+=0x1){_0x5ce59d=_0xbc0ced[_0x189660][_0x5524('0x50')]({'plain':!![]});switch(_0x5ce59d['dialCheckDuplicateType']){case _0x5524('0x59'):_0x4d083b['push'](db[_0x5524('0x51')][_0x5524('0x52')](_0x174b7d(_0x5ce59d,_0x5524('0x5a')))['then'](function(){})[_0x5524('0x53')](_0x221314()));break;case'onlyIfOpen':_0x4d083b[_0x5524('0x2b')](db[_0x5524('0x51')]['query'](_0x45150c(_0x5ce59d,_0x5524('0x5a')))['then'](function(){})[_0x5524('0x53')](_0x221314()));break;default:_0x4d083b['push'](db[_0x5524('0x51')]['query'](_0x5555b2(_0x5ce59d,_0x5524('0x5a')))[_0x5524('0x2a')](function(){})['catch'](_0x221314()));}}}return _0x4d083b;})[_0x5524('0x56')]();})[_0x5524('0x2a')](function(){return db[_0x5524('0x58')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x5524('0x4f')],'as':_0x5524('0x57'),'where':{'id':LISTID}}]})[_0x5524('0x2a')](function(_0x323284){var _0x2a96ef=[];if(_0x323284){for(var _0x2a9d3a=0x0,_0x8aef16;_0x2a9d3a<_0x323284['length'];_0x2a9d3a+=0x1){_0x8aef16=_0x323284[_0x2a9d3a][_0x5524('0x50')]({'plain':!![]});_0x2a96ef[_0x5524('0x2b')](db['sequelize']['query'](_0x4719b3(_0x8aef16,'CampaignId'))[_0x5524('0x2a')](function(){})[_0x5524('0x53')](_0x221314()));}}return _0x2a96ef;})[_0x5524('0x56')]();})[_0x5524('0x53')](function(_0x434113){logger[_0x5524('0x12')]('cmContact,\x20%s,\x20%s',_0x5524('0x5b'),_0x434113[_0x5524('0x17')]);});}var processPromises=function(_0x1c4068){return BPromise[_0x5524('0x56')](promises)[_0x5524('0x2a')](function(_0x5367ff){})[_0x5524('0x53')](function(_0x32e766){logger[_0x5524('0x12')](_0x5524('0x5c'),JSON[_0x5524('0x2e')](_0x32e766));})[_0x5524('0x5d')](function(){socket[_0x5524('0x5e')](_0x5524('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1c4068){return _0x1c4068[_0x5524('0x60')]();}});};var endCsv=function(){return BPromise[_0x5524('0x61')]()[_0x5524('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0x5524('0x2a')](function(){socket['emit'](_0x5524('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x5524('0x62')](FILEPATH);}catch(_0xfded96){logger[_0x5524('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0xfded96));}finally{process['exit'](0x0);}});};process['on'](_0x5524('0x63'),function(){logger[_0x5524('0x64')](_0x5524('0x65'));endCsv();});function main(){return BPromise[_0x5524('0x61')]()[_0x5524('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x5524('0xf')](',');return db[_0x5524('0x28')][_0x5524('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x5524('0x2a')](function(_0x5b8e1b){var _0x7443ee=fs[_0x5524('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x5524('0x67')](_0x7443ee,{'header':!![],'skipEmptyLines':!![],'step':function(_0x20e8f0,_0x1014c7){total+=0x1;var _0x33f35a=total;promises['push'](checkRow(_0x20e8f0,_0x5b8e1b,_0x33f35a)['then'](function(){success+=0x1;})[_0x5524('0x53')](function(_0x5ce1f7){if(_0x5ce1f7[_0x5524('0x12')]){errors+=0x1;delete _0x5ce1f7['error'];}else if(_0x5ce1f7[_0x5524('0x26')]){duplicates+=0x1;delete _0x5ce1f7['duplicate'];}rows['push'](_0x5ce1f7);}));if(total%0xc8===0x0){_0x1014c7[_0x5524('0x68')]();return processPromises(_0x1014c7);}},'complete':function(){return processPromises()[_0x5524('0x2a')](function(){logger[_0x5524('0x64')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x5d9c3f,_0x7b5add){logger[_0x5524('0x64')](_0x5524('0x69'),JSON[_0x5524('0x2e')](_0x5d9c3f));endCsv();}});})[_0x5524('0x53')](function(_0x5383ea){logger[_0x5524('0x12')](_0x5524('0x6a'),JSON[_0x5524('0x2e')](_0x5383ea));});}main(); \ No newline at end of file +var _0x651f=['contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','duplicate','CmContact','create','keys','then','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','cm_hopper','deletedAt\x20IS\x20NULL','id\x20IN\x20?','phone\x20NOT\x20IN\x20(?)','calleridnum','\x20=\x20?','str','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','query','catch','onlyIfOpen','push','sequelize','all','outbound','BlackLists','VoiceQueueId','Campaign','always','CampaignId','get','finally','emit'];(function(_0x15513d,_0xb6daa){var _0x54505c=function(_0x46307f){while(--_0x46307f){_0x15513d['push'](_0x15513d['shift']());}};_0x54505c(++_0xb6daa);}(_0x651f,0xe9));var _0xf651=function(_0x586e09,_0xc952ee){_0x586e09=_0x586e09-0x0;var _0x2d0568=_0x651f[_0x586e09];return _0x2d0568;};'use strict';var BPromise=require(_0xf651('0x0'));var util=require(_0xf651('0x1'));var _=require(_0xf651('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0xf651('0x3'));var Redis=require(_0xf651('0x4'));var db=require(_0xf651('0x5'))['db'];var config=require(_0xf651('0x6'));var logger=require(_0xf651('0x7'))('api');config[_0xf651('0x8')]=_['defaults'](config[_0xf651('0x8')],{'host':_0xf651('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf651('0x8')]));require(_0xf651('0xa'))[_0xf651('0xb')](socket);try{if(!process[_0xf651('0xc')][0x2]||process[_0xf651('0xc')][0x2]===_0xf651('0xd')||process[_0xf651('0xc')][0x2]===_0xf651('0xe')){throw new Error(_0xf651('0xf'));}var FILEPATH=process['argv'][0x2];if(!process[_0xf651('0xc')][0x3]||process['argv'][0x3]===_0xf651('0xd')||process['argv'][0x3]==='null'||!process[_0xf651('0xc')][0x4]||process[_0xf651('0xc')][0x4]===_0xf651('0xd')||process[_0xf651('0xc')][0x4]===_0xf651('0xe')){throw new Error(_0xf651('0x10'));}var FIELDS=_[_0xf651('0x11')](process[_0xf651('0xc')][0x3][_0xf651('0x12')](','),process[_0xf651('0xc')][0x4][_0xf651('0x12')](','));if(!process[_0xf651('0xc')][0x5]||process[_0xf651('0xc')][0x5]==='undefined'||process[_0xf651('0xc')][0x5]===_0xf651('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xf651('0xc')][0x5];var COMPANYID=process[_0xf651('0xc')][0x6]&&process[_0xf651('0xc')][0x6]!==_0xf651('0xd')&&process[_0xf651('0xc')][0x6]!==_0xf651('0xe')?process[_0xf651('0xc')][0x6]:null;var DUPLICATES=process[_0xf651('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0xf651('0xc')][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0xf651('0xc')][0x8]||process[_0xf651('0xc')][0x8]===_0xf651('0xd')||process[_0xf651('0xc')][0x8]===_0xf651('0xe')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xf651('0xc')][0x8];}catch(_0x4ff254){logger[_0xf651('0x13')](_0x4ff254);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(_0x478b5b,_0x259c00,_0x1df97c,_0x3562fe){var _0x4308a5={'message':_0x259c00};_0x4308a5[_0x478b5b]=!![];if(_0x1df97c){_0x4308a5[_0xf651('0x14')]=_0x1df97c;}if(_0x3562fe){_0x4308a5['index']=_0x3562fe;}return _0x4308a5;}function isEmail(_0x37bb03){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))*$/[_0xf651('0x15')](_0x37bb03);}function checkRow(_0x582346,_0xee00be,_0x5c7601){return new BPromise(function(_0x16dc70,_0x5c4d75){if(_[_0xf651('0x16')](_0x582346)){return _0x5c4d75(handleCheckRowError('error',_0xf651('0x17'),null,_0x5c7601));}if(_0x582346['errors']&&_0x582346[_0xf651('0x18')][_0xf651('0x19')]){var _0x4a4af7=_['map'](_0x582346[_0xf651('0x18')],_0xf651('0x1a'))[_0xf651('0x1b')](';');return _0x5c4d75(handleCheckRowError(_0xf651('0x13'),_0x4a4af7,null,_0x5c7601));}var _0x51a8a8={};for(var _0x34b243 in FIELDS){if(FIELDS[_0xf651('0x1c')](_0x34b243)&&FIELDS[_0x34b243]){_0x51a8a8[_0x34b243]=_0x582346[_0xf651('0x1d')][0x0][FIELDS[_0x34b243]]||_0x582346[_0xf651('0x1d')][0x0]['\ufeff'+FIELDS[_0x34b243]];}}if(!_0x51a8a8[_0xf651('0x1e')]){return _0x5c4d75(handleCheckRowError('error',_0xf651('0x1f'),null,_0x5c7601));}if(!_0x51a8a8[_0xf651('0x20')]){return _0x5c4d75(handleCheckRowError('error',_0xf651('0x21'),null,_0x5c7601));}if(_0x51a8a8[_0xf651('0x22')]){var _0x39202d=moment(_0x51a8a8[_0xf651('0x22')],_0xf651('0x23'));if(!_0x39202d[_0xf651('0x24')]()){return _0x5c4d75(handleCheckRowError(_0xf651('0x13'),_0xf651('0x25'),null,_0x5c7601));}}if(_0x51a8a8[_0xf651('0x26')]){if(!isEmail(_0x51a8a8[_0xf651('0x26')])){return _0x5c4d75(handleCheckRowError(_0xf651('0x13'),_0xf651('0x27'),null,_0x5c7601));}}_0x51a8a8['ListId']=LISTID;_0x51a8a8[_0xf651('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xf651('0x19')]&&_0xee00be){var _0x1e8772={};for(var _0xb6f77f=0x0,_0x17e4f8=DUPLICATES[_0xf651('0x19')];_0xb6f77f<_0x17e4f8;_0xb6f77f+=0x1){_0x1e8772[DUPLICATES[_0xb6f77f]]=_0x51a8a8[DUPLICATES[_0xb6f77f]];}var _0x2a872e=_['find'](_0xee00be,_0x1e8772);if(_0x2a872e){return _0x5c4d75(handleCheckRowError(_0xf651('0x29'),'Duplicate\x20Contact',_0x2a872e,_0x5c7601));}}return db[_0xf651('0x2a')][_0xf651('0x2b')](_0x51a8a8,{'raw':!![],'hooks':![],'fields':_[_0xf651('0x2c')](_0x51a8a8)})[_0xf651('0x2d')](function(_0x2e5964){if(DUPLICATES&&DUPLICATES[_0xf651('0x19')]&&_0xee00be){_0xee00be['push'](_[_0xf651('0x2e')](_0x51a8a8,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2e5964['id'];return _0x16dc70();})['catch'](function(_0x56af11){return _0x5c4d75(handleCheckRowError(_0xf651('0x13'),_0xf651('0x2f')+(_0x56af11[_0xf651('0x1a')]||JSON[_0xf651('0x30')](_0x56af11)),null,_0x5c7601));});});}function checkHopper(){function _0x13afc6(){return function(_0xae66a){logger[_0xf651('0x13')](_0xf651('0x31'),_0xf651('0x32'),util[_0xf651('0x33')](_0xae66a,{'showHidden':![],'depth':null}));};}var _0x10d1be=function(_0x32b015,_0x53106e){var _0x2ed6b3=squel[_0xf651('0x34')]()[_0xf651('0x35')]('cm_hopper')[_0xf651('0x36')](['phone',_0xf651('0x37'),_0xf651('0x38'),_0xf651('0x39'),_0x53106e,_0xf651('0x3a'),_0xf651('0x3b')],squel[_0xf651('0x3c')]()[_0xf651('0x3d')]('phone',_0xf651('0x20'))['field'](_0xf651('0x3e'),_0xf651('0x37'))['field']('id',_0xf651('0x38'))['field'](LISTID['toString'](),_0xf651('0x39'))[_0xf651('0x3d')](_0x32b015['id'][_0xf651('0x3f')](),_0x53106e)[_0xf651('0x3d')](_0xf651('0x3e'),_0xf651('0x3a'))[_0xf651('0x3d')](_0xf651('0x3e'),'updatedAt')['from'](_0xf651('0x40'))[_0xf651('0x41')]('deletedAt\x20IS\x20NULL')[_0xf651('0x41')](_0xf651('0x42'),LISTID[_0xf651('0x3f')]())[_0xf651('0x41')](_0xf651('0x43'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xf651('0x3d')]('phone')[_0xf651('0x44')](_0xf651('0x45'))[_0xf651('0x41')](_0x53106e+'\x20=\x20?',_0x32b015['id'][_0xf651('0x3f')]())))[_0xf651('0x3f')]();return _0x2ed6b3;};var _0x47c5b2=function(_0x339a71,_0x305fa3){var _0x41c083=squel[_0xf651('0x34')]()[_0xf651('0x35')](_0xf651('0x45'))[_0xf651('0x36')](['phone',_0xf651('0x37'),'ContactId','ListId',_0x305fa3,'createdAt',_0xf651('0x3b')],squel[_0xf651('0x3c')]()[_0xf651('0x3d')](_0xf651('0x20'),'phone')[_0xf651('0x3d')](_0xf651('0x3e'),_0xf651('0x37'))[_0xf651('0x3d')]('id','ContactId')[_0xf651('0x3d')](LISTID[_0xf651('0x3f')](),_0xf651('0x39'))[_0xf651('0x3d')](_0x339a71['id'][_0xf651('0x3f')](),_0x305fa3)[_0xf651('0x3d')]('NOW()',_0xf651('0x3a'))[_0xf651('0x3d')](_0xf651('0x3e'),_0xf651('0x3b'))[_0xf651('0x44')](_0xf651('0x40'))[_0xf651('0x41')](_0xf651('0x46'))['where']('ListId\x20=\x20?',LISTID[_0xf651('0x3f')]())[_0xf651('0x41')](_0xf651('0x47'),squel['str'](hopperContacts))['where'](_0xf651('0x43'))[_0xf651('0x41')](_0xf651('0x48'),squel[_0xf651('0x3c')]()['field'](_0xf651('0x49'))[_0xf651('0x44')]('cm_hopper_final')[_0xf651('0x41')](_0x305fa3+'\x20=\x20?',_0x339a71['id'][_0xf651('0x3f')]()))[_0xf651('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf651('0x3c')]()[_0xf651('0x3d')](_0xf651('0x20'))[_0xf651('0x44')](_0xf651('0x45'))[_0xf651('0x41')](_0x305fa3+_0xf651('0x4a'),_0x339a71['id']['toString']())))[_0xf651('0x3f')]();return _0x41c083;};function _0x463428(_0x4e7f58,_0x5e86bf){var _0x157cae=squel[_0xf651('0x34')]()[_0xf651('0x35')](_0xf651('0x45'))[_0xf651('0x36')]([_0xf651('0x20'),_0xf651('0x37'),_0xf651('0x38'),_0xf651('0x39'),_0x5e86bf,_0xf651('0x3a'),_0xf651('0x3b')],squel['select']()[_0xf651('0x3d')]('phone',_0xf651('0x20'))[_0xf651('0x3d')](_0xf651('0x3e'),_0xf651('0x37'))[_0xf651('0x3d')]('id','ContactId')[_0xf651('0x3d')](LISTID[_0xf651('0x3f')](),'ListId')[_0xf651('0x3d')](_0x4e7f58['id']['toString'](),_0x5e86bf)[_0xf651('0x3d')](_0xf651('0x3e'),_0xf651('0x3a'))[_0xf651('0x3d')](_0xf651('0x3e'),'updatedAt')['from'](_0xf651('0x40'))[_0xf651('0x41')](_0xf651('0x46'))[_0xf651('0x41')]('ListId\x20=\x20?',LISTID[_0xf651('0x3f')]())[_0xf651('0x41')](_0xf651('0x47'),squel[_0xf651('0x4b')](hopperContacts))[_0xf651('0x41')](_0xf651('0x43')))[_0xf651('0x3f')]();return _0x157cae;}function _0xcd48fc(_0x340b37,_0x3910db){var _0x3a077a=squel['insert']()[_0xf651('0x35')](_0xf651('0x4c'))[_0xf651('0x36')](['phone',_0xf651('0x38'),'ListId',_0x3910db,_0xf651('0x3a'),'updatedAt'],squel[_0xf651('0x3c')]()[_0xf651('0x3d')](_0xf651('0x20'),_0xf651('0x20'))[_0xf651('0x3d')]('id','ContactId')[_0xf651('0x3d')](LISTID[_0xf651('0x3f')](),'ListId')[_0xf651('0x3d')](_0x340b37['id'][_0xf651('0x3f')](),_0x3910db)['field'](_0xf651('0x3e'),_0xf651('0x3a'))[_0xf651('0x3d')](_0xf651('0x3e'),_0xf651('0x3b'))[_0xf651('0x44')](_0xf651('0x40'))[_0xf651('0x41')]('deletedAt\x20IS\x20NULL')[_0xf651('0x41')]('ListId\x20=\x20?',LISTID[_0xf651('0x3f')]())[_0xf651('0x41')](_0xf651('0x47'),squel[_0xf651('0x4b')](hopperContacts))[_0xf651('0x41')](_0xf651('0x43')))[_0xf651('0x3f')]();return _0x3a077a;}return db[_0xf651('0x4d')][_0xf651('0x4e')]({'where':{'type':'outbound'},'attributes':['id',_0xf651('0x4f')],'include':[{'model':db[_0xf651('0x50')],'as':_0xf651('0x51'),'where':{'id':LISTID}}]})[_0xf651('0x2d')](function(_0x49aae6){var _0xaa3f8b=[];if(_0x49aae6){var _0x47cd06;for(var _0x1074e3=0x0,_0x7a605f;_0x1074e3<_0x49aae6['length'];_0x1074e3+=0x1){_0x7a605f=_0x49aae6[_0x1074e3]['get']({'plain':!![]});switch(_0x7a605f[_0xf651('0x4f')]){case'always':_0xaa3f8b['push'](db['sequelize'][_0xf651('0x52')](_0x47c5b2(_0x7a605f,'VoiceQueueId'))[_0xf651('0x2d')](function(){})[_0xf651('0x53')](_0x13afc6()));break;case _0xf651('0x54'):_0xaa3f8b[_0xf651('0x55')](db[_0xf651('0x56')][_0xf651('0x52')](_0x10d1be(_0x7a605f,'VoiceQueueId'))[_0xf651('0x2d')](function(){})[_0xf651('0x53')](_0x13afc6()));break;default:_0xaa3f8b['push'](db[_0xf651('0x56')]['query'](_0x463428(_0x7a605f,'VoiceQueueId'))['then'](function(){})[_0xf651('0x53')](_0x13afc6()));}}}return _0xaa3f8b;})[_0xf651('0x57')]()['then'](function(){return db[_0xf651('0x4d')]['findAll']({'where':{'type':_0xf651('0x58')},'attributes':['id'],'include':[{'model':db[_0xf651('0x50')],'as':_0xf651('0x59'),'where':{'id':LISTID}}]})[_0xf651('0x2d')](function(_0x288149){var _0x41b698=[];if(_0x288149){var _0x51833c;for(var _0x49b5dc=0x0,_0x2f1d47;_0x49b5dc<_0x288149[_0xf651('0x19')];_0x49b5dc+=0x1){_0x2f1d47=_0x288149[_0x49b5dc]['get']({'plain':!![]});_0x41b698[_0xf651('0x55')](db['sequelize'][_0xf651('0x52')](_0xcd48fc(_0x2f1d47,_0xf651('0x5a')))[_0xf651('0x2d')](function(){})['catch'](_0x13afc6()));}}return _0x41b698;})[_0xf651('0x57')]();})[_0xf651('0x2d')](function(){return db[_0xf651('0x5b')][_0xf651('0x4e')]({'attributes':['id',_0xf651('0x4f')],'include':[{'model':db['CmList'],'as':_0xf651('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x942991){var _0x51f7f0=[];if(_0x942991){for(var _0x34b42a=0x0,_0x1fb26b;_0x34b42a<_0x942991[_0xf651('0x19')];_0x34b42a+=0x1){_0x1fb26b=_0x942991[_0x34b42a]['get']({'plain':!![]});switch(_0x1fb26b[_0xf651('0x4f')]){case _0xf651('0x5c'):_0x51f7f0[_0xf651('0x55')](db['sequelize'][_0xf651('0x52')](_0x47c5b2(_0x1fb26b,'CampaignId'))['then'](function(){})['catch'](_0x13afc6()));break;case'onlyIfOpen':_0x51f7f0[_0xf651('0x55')](db[_0xf651('0x56')][_0xf651('0x52')](_0x10d1be(_0x1fb26b,_0xf651('0x5d')))[_0xf651('0x2d')](function(){})[_0xf651('0x53')](_0x13afc6()));break;default:_0x51f7f0[_0xf651('0x55')](db['sequelize']['query'](_0x463428(_0x1fb26b,_0xf651('0x5d')))['then'](function(){})['catch'](_0x13afc6()));}}}return _0x51f7f0;})['all']();})[_0xf651('0x2d')](function(){return db[_0xf651('0x5b')]['findAll']({'attributes':['id'],'include':[{'model':db[_0xf651('0x50')],'as':_0xf651('0x59'),'where':{'id':LISTID}}]})[_0xf651('0x2d')](function(_0x482493){var _0x544822=[];if(_0x482493){for(var _0x3abf03=0x0,_0x21d47c;_0x3abf03<_0x482493[_0xf651('0x19')];_0x3abf03+=0x1){_0x21d47c=_0x482493[_0x3abf03][_0xf651('0x5e')]({'plain':!![]});_0x544822[_0xf651('0x55')](db[_0xf651('0x56')][_0xf651('0x52')](_0xcd48fc(_0x21d47c,'CampaignId'))['then'](function(){})['catch'](_0x13afc6()));}}return _0x544822;})[_0xf651('0x57')]();})['catch'](function(_0x3396a7){logger['error']('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x3396a7[_0xf651('0x1a')]);});}var processPromises=function(_0x536da5){return BPromise[_0xf651('0x57')](promises)[_0xf651('0x2d')](function(_0x48c9b7){})[_0xf651('0x53')](function(_0x2dc072){logger[_0xf651('0x13')]('Error\x20processing\x20rows\x20block:',JSON[_0xf651('0x30')](_0x2dc072));})[_0xf651('0x5f')](function(){socket[_0xf651('0x60')](_0xf651('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x536da5){return _0x536da5['resume']();}});};var endCsv=function(){return BPromise[_0xf651('0x62')]()[_0xf651('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0xf651('0x2d')](function(){socket[_0xf651('0x60')](_0xf651('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xf651('0x63')](FILEPATH);}catch(_0x5e65e1){logger[_0xf651('0x13')](_0xf651('0x64'),JSON['stringify'](_0x5e65e1));}finally{process[_0xf651('0x65')](0x0);}});};process['on'](_0xf651('0x66'),function(){logger['info'](_0xf651('0x67'));endCsv();});function main(){return BPromise[_0xf651('0x62')]()[_0xf651('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xf651('0x12')](',');return db[_0xf651('0x2a')][_0xf651('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xf651('0x2d')](function(_0x275143){var _0x398054=fs[_0xf651('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xf651('0x69')](_0x398054,{'header':!![],'skipEmptyLines':!![],'step':function(_0x521785,_0x4fc4d5){total+=0x1;var _0x24e58=total;promises[_0xf651('0x55')](checkRow(_0x521785,_0x275143,_0x24e58)[_0xf651('0x2d')](function(){success+=0x1;})[_0xf651('0x53')](function(_0x4d2b69){if(_0x4d2b69['error']){errors+=0x1;delete _0x4d2b69[_0xf651('0x13')];}else if(_0x4d2b69[_0xf651('0x29')]){duplicates+=0x1;delete _0x4d2b69['duplicate'];}rows['push'](_0x4d2b69);}));if(total%0xc8===0x0){_0x4fc4d5[_0xf651('0x6a')]();return processPromises(_0x4fc4d5);}},'complete':function(){return processPromises()[_0xf651('0x2d')](function(){logger[_0xf651('0x6b')](_0xf651('0x6c'));endCsv();});},'error':function(_0x46aa69,_0x230113){logger[_0xf651('0x6b')](_0xf651('0x6d'),JSON['stringify'](_0x46aa69));endCsv();}});})[_0xf651('0x53')](function(_0x23330c){logger[_0xf651('0x13')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xf651('0x30')](_0x23330c));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index bbd6d78..df77ede 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 _0x966f=['affectedRows','unlink','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','UserId','ListId\x20is\x20mandatory','map','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','join','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','AdditionalPhones','then','push','all','length','split','isNil','CmContactHasItem','findOne','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','fromQuery','ListId','createdAt','updatedAt','recallme','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_contacts.id','into','cm_hopper_black','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','ContactId','priority','.CmListId\x20=\x20?','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','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','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','group','error','message','exit','errors','code','info','sequelize','spread','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','query','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','main','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','findAll','name','_description','writeFileSync','parse','createReadStream','data','rows','find','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','email','email\x20wrong\x20format','dateOfBirth','isValid','firstName','hasOwnProperty','trim','replace','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','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','scheduledat','DROP\x20TABLE\x20','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','finish'];(function(_0x2b990b,_0x46e3a1){var _0xdf04b7=function(_0x1a03d9){while(--_0x1a03d9){_0x2b990b['push'](_0x2b990b['shift']());}};_0xdf04b7(++_0x46e3a1);}(_0x966f,0xbf));var _0xf966=function(_0x17e66a,_0x423449){_0x17e66a=_0x17e66a-0x0;var _0x5aa6ae=_0x966f[_0x17e66a];return _0x5aa6ae;};'use strict';var fs=require('fs');var path=require(_0xf966('0x0'));var _=require(_0xf966('0x1'));var Papa=require('papaparse');var util=require(_0xf966('0x2'));var BPromise=require(_0xf966('0x3'));var moment=require(_0xf966('0x4'));var squel=require(_0xf966('0x5'));var Redis=require(_0xf966('0x6'));var db=require(_0xf966('0x7'))['db'];var config=require(_0xf966('0x8'));var shared=require(_0xf966('0x9'));var logger=require(_0xf966('0xa'))(_0xf966('0xb'));config[_0xf966('0xc')]=_[_0xf966('0xd')](config[_0xf966('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf966('0xe'))(new Redis(config[_0xf966('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xf966('0xf')](_0xf966('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xf966('0xf')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x488cd4){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))*$/[_0xf966('0x11')](_0x488cd4);}function selectNotIn(_0x444791,_0x5d3101,_0x315446,_0x54369f,_0x112fd9){return squel[_0xf966('0x12')]()[_0xf966('0x13')](_0xf966('0x14'))['from'](_0x54369f)[_0xf966('0x15')](_0x5d3101,null,_0x5d3101+'.id\x20=\x20'+_0x54369f+'.'+_0x315446)['where'](_0x54369f+'.'+_0x315446+_0xf966('0x16')+_0x444791+'.'+_0x315446)[_0xf966('0x17')](_0x5d3101+_0xf966('0x18')+_0x112fd9[_0xf966('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4ae0bf,_0x25ac8e){promisesAdditionalPhones=[];return db['CmContact']['findAll']({'raw':!![],'attributes':['id',_0xf966('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xf966('0x1a')](function(_0x396e71){if(_0x396e71!==null){var _0x24011c=[];for(var _0x2306a5=0x0;_0x2306a5<_0x396e71['length'];_0x2306a5++){var _0x26e5cf=_0x396e71[_0x2306a5];_0x24011c[_0xf966('0x1b')](insertAdditionalPhones(_0x26e5cf));}}Promise[_0xf966('0x1c')](_0x24011c)[_0xf966('0x1a')](function(){_0x4ae0bf({'val':0x1});});});});}function insertAdditionalPhones(_0x477c97){return new Promise(function(_0x11fe9f,_0x202ad3){var _0xe0be9a=_0x477c97[_0xf966('0x19')];var _0x3fd62b=_0xe0be9a['split'](';');var _0x3931e0=[];orderBy=0x0;for(var _0x1d3e87=0x0;_0x1d3e87<_0x3fd62b[_0xf966('0x1d')];_0x1d3e87++){_0x3931e0['push'](splitAdditionalPhone(_0x477c97['id'],_0x3fd62b[_0x1d3e87]));}Promise['all'](_0x3931e0)[_0xf966('0x1a')](function(){_0x11fe9f({'val':_0x3fd62b[_0xf966('0x1d')]});});});}function splitAdditionalPhone(_0x1d14aa,_0x15dfc2){return new Promise(function(_0x219ebe,_0x1b0746){var _0x295552=_0x15dfc2[_0xf966('0x1e')](':');var _0x4cda25=_0x295552[0x0];var _0x439ec5=_0x295552[0x1];if(!_[_0xf966('0x1f')](_0x439ec5)){var _0x33f188=_0x439ec5['split']('|');var _0x308616=[];for(var _0x140932=0x0;_0x140932<_0x33f188[_0xf966('0x1d')];_0x140932++){if(_0x33f188[_0x140932]!==''){var _0x4008d2=_['filter'](promisesAdditionalPhones,{'contactId':_0x1d14aa,'phone':_0x33f188[_0x140932]});if(_0x4008d2['length']==0x0){orderBy++;promisesAdditionalPhones[_0xf966('0x1b')]({'contactId':_0x1d14aa,'contactTypeId':_0x4cda25,'phone':_0x33f188[_0x140932],'orderBy':orderBy});}}}_0x219ebe({'ok':0x1});}else _0x219ebe({'res':0x0});});}function createAdditionalPhone(_0x5007c6,_0x4a5cf6,_0x2895b8,_0x386122){var _0xe3f5eb='';var _0x4d3be4='';var _0x53d9c5=_0x2895b8[_0xf966('0x1e')]('§');_0xe3f5eb=_0x53d9c5[0x0];if(_0x53d9c5[_0xf966('0x1d')]==0x2)_0x4d3be4=_0x53d9c5[0x1];return new Promise(function(_0x3010be,_0x506329){return db[_0xf966('0x20')][_0xf966('0x21')]({'where':{'CmContactId':_0x5007c6,'item':_0xe3f5eb}})[_0xf966('0x1a')](function(_0x37471c){if(_0x37471c){return db[_0xf966('0x20')]['update']({'ItemTypeId':_0x4a5cf6,'description':_0x4d3be4,'OrderBy':_0x386122},{'where':{'CmContactId':_0x5007c6,'item':_0xe3f5eb}})[_0xf966('0x1a')](function(_0x32c464){_0x3010be({'res':'updated'});});}else{return db[_0xf966('0x20')][_0xf966('0x22')]({'CmContactId':_0x5007c6,'item':_0xe3f5eb,'description':_0x4d3be4,'ItemTypeId':_0x4a5cf6,'OrderBy':_0x386122,'ItemClass':'PHONE'})[_0xf966('0x1a')](function(_0x27ea60){_0x3010be({'res':_0xf966('0x23')});});}});});}function insertCmHopper(_0x16cc0d,_0xc1a6d9,_0x333fc9,_0x4c4b11,_0x598302){var _0xe1e4db=[_0xf966('0x24'),_0xf966('0x25'),'cm_contacts.id',_0xf966('0x26'),_0xc1a6d9+'.'+_0x4c4b11,_0xf966('0x27'),_0xf966('0x28'),_0xf966('0x29'),'cm_contacts.UserId','\x22'+_0x598302+'\x22'];return squel[_0xf966('0x2a')]()['into'](_0xf966('0x2b'))[_0xf966('0x2c')](['phone','scheduledat','ContactId',_0xf966('0x2d'),_0x4c4b11,_0xf966('0x2e'),_0xf966('0x2f'),'priority','UserId',_0xf966('0x30')],squel[_0xf966('0x12')]()[_0xf966('0x31')](_0xe1e4db)[_0xf966('0x32')](_0xc1a6d9)['join'](_0xf966('0x33'),null,_0xf966('0x34')+_0xc1a6d9+_0xf966('0x35'))[_0xf966('0x15')](_0x333fc9,null,_0x333fc9+_0xf966('0x36')+_0xc1a6d9+'.'+_0x4c4b11)[_0xf966('0x17')](_0xc1a6d9+'.CmListId\x20=\x20?',_0x16cc0d)['where'](_0xf966('0x37'),NOW)[_0xf966('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xc1a6d9,_0x333fc9,_0x4c4b11,_0xf966('0x2b'),[_0xf966('0x38'),_0xf966('0x39')]))[_0xf966('0x17')](_0xf966('0x3a'),selectNotIn(_0xc1a6d9,_0x333fc9,_0x4c4b11,_0xf966('0x2b'),[_0xf966('0x38')])))['toString']();}function insertCmHopperBlack(_0x20ae67,_0x4a2bd3,_0x5ece87,_0xc37698){var _0x2c2836=[_0xf966('0x24'),_0xf966('0x3b'),_0xf966('0x26'),_0x4a2bd3+'.'+_0xc37698,_0xf966('0x27'),_0xf966('0x28')];return squel[_0xf966('0x2a')]()[_0xf966('0x3c')]('cm_hopper_black')[_0xf966('0x2c')]([_0xf966('0x14'),'ContactId','ListId',_0xc37698,_0xf966('0x2e'),'updatedAt'],squel[_0xf966('0x12')]()[_0xf966('0x31')](_0x2c2836)[_0xf966('0x32')](_0x4a2bd3)[_0xf966('0x15')](_0xf966('0x33'),null,_0xf966('0x34')+_0x4a2bd3+_0xf966('0x35'))[_0xf966('0x15')](_0x5ece87,null,_0x5ece87+_0xf966('0x36')+_0x4a2bd3+'.'+_0xc37698)[_0xf966('0x17')](_0x4a2bd3+'.CmListId\x20=\x20?',_0x20ae67)[_0xf966('0x17')](_0xf966('0x37'),NOW)[_0xf966('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xf966('0x14'))[_0xf966('0x32')](_0xf966('0x3d'))[_0xf966('0x17')]('ListId\x20=\x20?',_0x20ae67)[_0xf966('0x17')](_0xc37698+_0xf966('0x16')+_0x4a2bd3+'.'+_0xc37698)))['toString']();}function insertTzCmHopper(_0x53564a,_0x352bfd,_0x425317,_0x57845a,_0x4ef999,_0xa6cafa){var _0x65cbbf=[_0xf966('0x24'),_0xf966('0x3e')+_0xa6cafa+_0xf966('0x3f'),_0xf966('0x3b'),_0xf966('0x26'),_0x352bfd+'.'+_0x57845a,_0xf966('0x27'),'cm_contacts.updatedAt',_0xf966('0x29'),_0xf966('0x40'),'\x22'+_0x4ef999+'\x22'];var _0x5c5866=squel['insert']()['into'](_0xf966('0x2b'))[_0xf966('0x2c')]([_0xf966('0x14'),'scheduledat',_0xf966('0x41'),_0xf966('0x2d'),_0x57845a,_0xf966('0x2e'),_0xf966('0x2f'),_0xf966('0x42'),'UserId',_0xf966('0x30')],squel['select']()[_0xf966('0x31')](_0x65cbbf)['from'](_0x352bfd)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x352bfd+_0xf966('0x35'))[_0xf966('0x15')](_0x425317,null,_0x425317+_0xf966('0x36')+_0x352bfd+'.'+_0x57845a)[_0xf966('0x15')](_0xa6cafa,null,_0xa6cafa+_0xf966('0x36')+_0x352bfd+'.'+_0x57845a)['where'](_0x352bfd+_0xf966('0x43'),_0x53564a)['where'](_0xf966('0x37'),NOW)[_0xf966('0x17')](_0xf966('0x3a'),selectNotIn(_0x352bfd,_0x425317,_0x57845a,'cm_hopper',[_0xf966('0x38'),_0xf966('0x39')]))[_0xf966('0x17')](_0xf966('0x3a'),selectNotIn(_0x352bfd,_0x425317,_0x57845a,_0xf966('0x2b'),['\x22always\x22'])))[_0xf966('0x44')]();return _0x5c5866;}function insertTzCmHopperBlack(_0x55a174,_0x44b0b3,_0xf0cdc2,_0x455565){var _0x17a914=[_0xf966('0x24'),_0xf966('0x3b'),_0xf966('0x26'),_0x44b0b3+'.'+_0x455565,'cm_contacts.createdAt',_0xf966('0x28')];return squel[_0xf966('0x2a')]()['into'](_0xf966('0x3d'))[_0xf966('0x2c')]([_0xf966('0x14'),_0xf966('0x41'),_0xf966('0x2d'),_0x455565,_0xf966('0x2e'),_0xf966('0x2f')],squel[_0xf966('0x12')]()['fields'](_0x17a914)[_0xf966('0x32')](_0x44b0b3)[_0xf966('0x15')](_0xf966('0x33'),null,_0xf966('0x34')+_0x44b0b3+'.CmListId')['join'](_0xf0cdc2,null,_0xf0cdc2+_0xf966('0x36')+_0x44b0b3+'.'+_0x455565)[_0xf966('0x17')](_0x44b0b3+'.CmListId\x20=\x20?',_0x55a174)['where'](_0xf966('0x37'),NOW)[_0xf966('0x17')](_0xf966('0x3a'),squel[_0xf966('0x12')]()[_0xf966('0x13')]('phone')[_0xf966('0x32')](_0xf966('0x3d'))[_0xf966('0x17')]('ListId\x20=\x20?',_0x55a174)[_0xf966('0x17')](_0x455565+_0xf966('0x16')+_0x44b0b3+'.'+_0x455565)))[_0xf966('0x44')]();}function insertCmHopperAdditionalPhones(_0x2e2a7c){var _0x209af2=[_0xf966('0x45'),_0xf966('0x46'),'cm_contact_has_items.OrderBy',_0xf966('0x47'),'cm_contact_has_items.updatedAt'];return squel[_0xf966('0x2a')]()[_0xf966('0x3c')](_0xf966('0x48'))[_0xf966('0x2c')]([_0xf966('0x49'),_0xf966('0x14'),_0xf966('0x4a'),_0xf966('0x2e'),_0xf966('0x2f')],squel['select']()[_0xf966('0x31')](_0x209af2)[_0xf966('0x32')]('cm_hopper')[_0xf966('0x15')](_0xf966('0x33'),null,_0xf966('0x4b'))[_0xf966('0x15')]('cm_contact_has_items',null,_0xf966('0x4c'))[_0xf966('0x17')](_0xf966('0x4d'),_0x2e2a7c)[_0xf966('0x17')](_0xf966('0x37'),NOW))[_0xf966('0x44')]();}function insertCmContact(_0x216492,_0x599558,_0x41fdb7,_0x571ba6){var _0x7f904d=_[_0xf966('0x4e')](_[_0xf966('0x4f')](_0x571ba6),[_0xf966('0x2d'),_0xf966('0x50'),_0xf966('0x2e'),_0xf966('0x2f')]);return squel[_0xf966('0x2a')]()[_0xf966('0x3c')](_0xf966('0x33'))['fromQuery'](_0x7f904d,squel['select']()['fields'](_0x7f904d)[_0xf966('0x32')](_0x599558)[_0xf966('0x17')]('('+_0x41fdb7['join'](',')+_0xf966('0x51'),squel[_0xf966('0x12')]()['fields'](_0x41fdb7)[_0xf966('0x32')](_0xf966('0x33'))['where']('ListId\x20=\x20?',_0x216492)[_0xf966('0x17')](_0xf966('0x52')))[_0xf966('0x17')](_0xf966('0x53'),squel[_0xf966('0x12')]()[_0xf966('0x13')]('MIN(id)','min_id')[_0xf966('0x32')](_0x599558)[_0xf966('0x54')](_0x41fdb7[_0xf966('0x15')](','))))[_0xf966('0x44')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x22bc7a){logger[_0xf966('0x55')](_0x22bc7a[_0xf966('0x56')]);process[_0xf966('0x57')](0x1);}function handleError(_0x5448a0,_0x2a73e8){stats[_0xf966('0x58')][_0xf966('0x1b')]({'name':_0x2a73e8[_0xf966('0x59')],'message':_0x2a73e8['message'],'row':_0x5448a0});}function handleQuery(_0x1bba94){logger[_0xf966('0x5a')](_0x1bba94);return db[_0xf966('0x5b')]['query'](_0x1bba94)[_0xf966('0x5c')](function(_0x2b28cb){results[_0xf966('0x1b')](_0x2b28cb);})['catch'](function(_0x906513){logger[_0xf966('0x55')](_0x906513[_0xf966('0x56')]);});}function updateTzCampaigns(_0x54c29d){return new Promise(function(_0x347bad,_0x55f74a){var _0x2435ba=squel['select']()[_0xf966('0x31')]([_0xf966('0x5d'),_0xf966('0x5e')])[_0xf966('0x32')]('campaigns')[_0xf966('0x15')](_0xf966('0x5f'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0xf966('0x17')](_0xf966('0x60')+_0x54c29d);db[_0xf966('0x5b')][_0xf966('0x61')](_0x2435ba[_0xf966('0x44')]())['spread'](function(_0x23a4f9){var _0x5acb41=[];for(var _0x22ca49=0x0;_0x22ca49<_0x23a4f9[_0xf966('0x1d')];_0x22ca49++){_0x5acb41[_0xf966('0x1b')](getTimezoneData(_0x23a4f9[_0x22ca49],tmp_campaigns));}BPromise['all'](_0x5acb41)[_0xf966('0x1a')](function(){_0x347bad({'val':0x1});});})[_0xf966('0x62')](function(_0x15b17d){logger[_0xf966('0x55')](_0x15b17d[_0xf966('0x56')]);_0x347bad({'val':0x0});});});}function updateTzVoiceQueues(_0x50a876){return new Promise(function(_0x165c5c,_0x7a88b8){var _0xd0e786=squel[_0xf966('0x12')]()[_0xf966('0x31')]([_0xf966('0x63'),_0xf966('0x64')])['from'](_0xf966('0x65'))[_0xf966('0x15')](_0xf966('0x66'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0xf966('0x17')](_0xf966('0x67')+_0x50a876);db[_0xf966('0x5b')][_0xf966('0x61')](_0xd0e786['toString']())[_0xf966('0x5c')](function(_0x6d305c){var _0x9662c0=[];for(var _0x2f7d25=0x0;_0x2f7d25<_0x6d305c[_0xf966('0x1d')];_0x2f7d25++){_0x9662c0['push'](getTimezoneData(_0x6d305c[_0x2f7d25],tmp_voice_queues));}BPromise[_0xf966('0x1c')](_0x9662c0)['then'](function(){_0x165c5c({'val':0x1});});})['catch'](function(_0x9d598b){logger[_0xf966('0x55')](_0x9d598b['message']);_0x165c5c({'val':0x0});});});}function getTimezoneData(_0x168a32,_0xb920d7){return new Promise(function(_0x457e6c,_0x481353){var _0x1de68c=shared[_0xf966('0x68')];var _0x7cb858=_0x1de68c[_0x168a32[_0xf966('0x69')]];if(_[_0xf966('0x1f')](_0x7cb858)){_0x457e6c({'ret':0x1});}else{var _0xd1b675=_0x7cb858[_0xf966('0x6a')];var _0x3cbe6c=squel[_0xf966('0x2a')]()[_0xf966('0x3c')](_0xb920d7)[_0xf966('0x6b')]('id',_0x168a32['id'])[_0xf966('0x6b')]('offset',_0xd1b675)[_0xf966('0x6b')](_0xf966('0x69'),_0x168a32[_0xf966('0x69')])['toString']();return db[_0xf966('0x5b')][_0xf966('0x61')](_0x3cbe6c)[_0xf966('0x5c')](function(_0x558488){_0x457e6c({'ret':0x1});})[_0xf966('0x62')](function(_0x2d26c3){logger[_0xf966('0x55')](_0x2d26c3['message']);_0x481353({'ret':0x1});});}});}function handleTZQuery(_0x5ae9d9){logger['info'](_0x5ae9d9);return db['sequelize'][_0xf966('0x61')](_0x5ae9d9)[_0xf966('0x5c')](function(_0x6c9aef){})[_0xf966('0x62')](function(_0x5493cb){logger[_0xf966('0x55')](_0x5493cb[_0xf966('0x56')]);});}function main(_0x4cff16,_0xd10b82,_0x21b7e,_0x2067b1){logger['info'](_0xf966('0x6c'),_0x4cff16,JSON['stringify'](_0xd10b82));process['send'](_0xf966('0x6d'));var _0x2a0341=_0xd10b82[_0xf966('0x6e')];var _0x3b6cd2=_[_0xf966('0x6f')](_0x2a0341);var _0x6672e9=_0xd10b82[_0xf966('0x70')];var _0x31fff5=path[_0xf966('0x15')](config[_0xf966('0x71')],_0xf966('0x72'),_0x6672e9+_0xf966('0x73'));hasTZ=_[_0xf966('0x4f')](_0x2a0341)[_0xf966('0x74')]('dialTimezone');var _0x2f0fe4=_[_0xf966('0x4f')](_0x2a0341)['join']();logger[_0xf966('0x5a')](_0xf966('0x75'),_0x2f0fe4);db[_0xf966('0x76')][_0xf966('0x77')]({'raw':!![],'attributes':['id',_0xf966('0x78')]})['then'](function(_0x1653a1){for(var _0x4f38d3=0x0;_0x4f38d3<_0x1653a1[_0xf966('0x1d')];_0x4f38d3++){if(_0x1653a1[_0x4f38d3][_0xf966('0x78')]in _0x2a0341){contactItemTypes[_0xf966('0x1b')](_0x1653a1[_0x4f38d3]);delete _0x3b6cd2[_0x1653a1[_0x4f38d3][_0xf966('0x78')]];hasAdditionalPhones=!![];}for(var _0x2c9be6 in _0x2a0341){if(_0x1653a1[_0x4f38d3]['name']+_0xf966('0x79')===_0x2c9be6){phoneDescriptions[_0xf966('0x1b')]({'itemTypeId':_0x1653a1[_0x4f38d3]['id'],'description':_0x2c9be6});delete _0x3b6cd2[_0x2c9be6];}}}if(hasAdditionalPhones)_0x3b6cd2[_0xf966('0x19')]='';var _0x4c20b6=_[_0xf966('0x4f')](_0x3b6cd2)['join']();logger[_0xf966('0x5a')](_0xf966('0x75'),_0x4c20b6);fs[_0xf966('0x7a')](_0x31fff5,_0x4c20b6+'\x0a');Papa[_0xf966('0x7b')](fs[_0xf966('0x7c')](_0x4cff16),{'header':!![],'skipEmptyLines':!![],'step':function(_0x354f24,_0x4aab0d){try{for(var _0x2c2c7f=0x0,_0x498849=[];_0x2c2c7f<_0x354f24[_0xf966('0x7d')][_0xf966('0x1d')];_0x2c2c7f++){stats[_0xf966('0x7e')]+=0x1;if(_0x354f24['errors'][_0x2c2c7f]){handleError(_0x354f24[_0xf966('0x7d')][_0x2c2c7f],_0x354f24[_0xf966('0x58')][_0x2c2c7f]);}else{var _0x38a1d9=[];var _0x18d1d3=[];var _0x712c27={};for(var _0x575046 in _0x2a0341){let _0x55336d=contactItemTypes[_0xf966('0x7f')](_0x33080b=>_0x33080b[_0xf966('0x78')]===_0x575046);let _0x31cf1c=contactItemTypes[_0xf966('0x7f')](_0x418e3d=>_0x418e3d[_0xf966('0x78')]+'_description'===_0x575046);if(_[_0xf966('0x1f')](_0x55336d)&&_[_0xf966('0x1f')](_0x31cf1c)){if(_0x2a0341['hasOwnProperty'](_0x575046)){if(_0x354f24[_0xf966('0x7d')][_0x2c2c7f][_0x2a0341[_0x575046]]){var _0x2c296c=_['trim'](_0x354f24[_0xf966('0x7d')][_0x2c2c7f][_0x2a0341[_0x575046]]['replace'](/"/g,'\x27'));switch(_0x575046){case'scheduledat':var _0x5d56a8=moment(_0x2c296c,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x5d56a8['isValid']()){_0x498849[_0xf966('0x1b')]('\x22'+_0x2c296c+'\x22');}else{_0x38a1d9['push'](_0xf966('0x80'));}break;case'priority':var _0x1ef66a=parseInt(_0x2c296c);_0x2c296c=_['isNaN'](_0x1ef66a)||_0x1ef66a<0x0||_0x1ef66a>0x4?_0x2067b1?0x3:0x2:_0x1ef66a;_0x498849['push']('\x22'+_0x2c296c+'\x22');break;case'UserId':var _0x3e8d1d=parseInt(_0x2c296c);if(_[_0xf966('0x81')](_0x3e8d1d)&&_[_0xf966('0x74')](_0x21b7e,_0x3e8d1d)){_0x498849[_0xf966('0x1b')]('\x22'+_0x3e8d1d+'\x22');}else{_0x38a1d9[_0xf966('0x1b')]('agent\x20not\x20exists');}break;case _0xf966('0x82'):if(isEmail(_0x2c296c)){_0x498849['push']('\x22'+_0x2c296c+'\x22');}else{_0x38a1d9[_0xf966('0x1b')](_0xf966('0x83'));}break;case _0xf966('0x84'):var _0x6123b5=moment(_0x2c296c,'YYYY-MM-DD',!![]);if(_0x6123b5[_0xf966('0x85')]()){_0x498849[_0xf966('0x1b')]('\x22'+_0x2c296c+'\x22');}else{_0x38a1d9[_0xf966('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xf966('0x69'):var _0x3d14da=shared['timezones'];var _0x24c511=_0x3d14da[_0x2c296c];if(!_[_0xf966('0x1f')](_0x24c511)){var _0x3b060d=_0x24c511[_0xf966('0x6a')];_0x498849[_0xf966('0x1b')]('\x22'+_0x2c296c+'\x22');_0x498849[_0xf966('0x1b')]('\x22'+_0x3b060d+'\x22');}break;default:_0x498849['push']('\x22'+_0x2c296c+'\x22');}}else{switch(_0x575046){case _0xf966('0x86'):case'phone':_0x38a1d9[_0xf966('0x1b')](_0x575046+'\x20not\x20specified');break;default:_0x498849[_0xf966('0x1b')]('\x22\x22');}}}}else{var _0x33557e='';if(!_[_0xf966('0x1f')](_0x55336d)){if(!_0x712c27[_0xf966('0x87')](_0x55336d['id'])){if(!_[_0xf966('0x1f')](_0x354f24['data'][_0x2c2c7f][_0x2a0341[_0x575046]])){var _0x2c296c=_[_0xf966('0x88')](_0x354f24['data'][_0x2c2c7f][_0x2a0341[_0x575046]][_0xf966('0x89')](/"/g,'\x27'));var _0xeec6d9=phoneDescriptions['find'](_0x9a3a36=>_0x9a3a36[_0xf966('0x8a')]===_0x55336d['id']);if(!_[_0xf966('0x1f')](_0xeec6d9)){var _0x1448b6=_[_0xf966('0x88')](_0x354f24[_0xf966('0x7d')][_0x2c2c7f][_0x2a0341[_0xeec6d9[_0xf966('0x8b')]]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x1448b6))_0x2c296c=_0x2c296c+'§'+_0x1448b6;}if(_0x33557e=='')_0x33557e=_0x2c296c;else _0x33557e+='|'+_0x2c296c;}_0x18d1d3[_0xf966('0x1b')](_0x55336d['id']+':'+_0x33557e);_0x712c27[_0x55336d['id']]=0x1;}}}}if(hasAdditionalPhones){_0x498849[_0xf966('0x1b')]('\x22'+_0x18d1d3[_0xf966('0x15')](';')+'\x22');}if(_0x38a1d9[_0xf966('0x1d')]){handleError(_0x354f24[_0xf966('0x7d')][_0x2c2c7f],{'code':_0xf966('0x8c'),'message':_0x38a1d9[_0xf966('0x15')]()});}else{fs[_0xf966('0x8d')](_0x31fff5,_0x498849[_0xf966('0x15')]()+'\x0a');}_0x498849=[];}if(!(stats[_0xf966('0x7e')]%0xc8)){socket[_0xf966('0x8e')](_0xf966('0x8f')+_0x6672e9,stats);stats['errors']=[];}}if(stopped){logger[_0xf966('0x5a')](_0xf966('0x90'));_0x4aab0d[_0xf966('0x91')]();}}catch(_0x21e020){handleError(_0x354f24['data'][_0x2c2c7f],{'code':_0xf966('0x92'),'message':_0x21e020[_0xf966('0x56')]});logger['error']('step',_0x21e020[_0xf966('0x56')]);}},'complete':function(){try{var _0x59f0e5=[];var _0x428772=[];var _0x2ab36d=_0xf966('0x33');if(_0xd10b82[_0xf966('0x93')]&&_0xd10b82[_0xf966('0x93')][_0xf966('0x1d')]){_0x2ab36d=_0xf966('0x94')+_0x6672e9;_0x59f0e5[_0xf966('0x1b')]('CREATE\x20TABLE\x20'+_0x2ab36d+_0xf966('0x95'));}tmp_campaigns=_0xf966('0x96')+_0x6672e9;tmp_voice_queues=_0xf966('0x97')+_0x6672e9;_0x428772[_0xf966('0x1b')](_0xf966('0x98')+tmp_campaigns+_0xf966('0x99'));_0x428772['push']('CREATE\x20TABLE\x20'+tmp_voice_queues+_0xf966('0x99'));BPromise[_0xf966('0x9a')](_0x428772,handleTZQuery)['then'](function(_0x3f16db){updateTzCampaigns(_0xd10b82[_0xf966('0x2d')])['then'](function(_0x4c1eda){updateTzVoiceQueues(_0xd10b82[_0xf966('0x2d')])[_0xf966('0x1a')](function(_0x101da2){if(hasTZ)_0x4c20b6=_0x4c20b6[_0xf966('0x89')](_0xf966('0x69'),'dialTimezone,utcOffset');var _0x347807=util[_0xf966('0xf')](_0xf966('0x9b'),_0x31fff5,_0x2ab36d,_0x4c20b6,_0xd10b82[_0xf966('0x2d')],_0xd10b82['CompanyId']||null,NOW,NOW);if(_[_0xf966('0x1f')](_0x2a0341[_0xf966('0x9c')])){_0x347807+=',\x20scheduledAt\x20=\x20NOW()';}_0x59f0e5[_0xf966('0x1b')](_0x347807);if(_0xd10b82[_0xf966('0x93')]&&_0xd10b82[_0xf966('0x93')][_0xf966('0x1d')]){_0x59f0e5[_0xf966('0x1b')](insertCmContact(_0xd10b82[_0xf966('0x2d')],_0x2ab36d,_0xd10b82[_0xf966('0x93')],_0x2a0341));_0x59f0e5[_0xf966('0x1b')](_0xf966('0x9d')+_0x2ab36d+';');}BPromise[_0xf966('0x9a')](_0x59f0e5,handleQuery)[_0xf966('0x1a')](function(_0x151265){BPromise[_0xf966('0x1c')]([handleAdditionalPhones()])[_0xf966('0x1a')](function(){_0x59f0e5=[];for(var _0x34cb13=0x0;_0x34cb13\x20\x20');}var _0x3f6dcf=path['join'](config['root'],_0xf966('0x72'),process['argv'][0x2]);if(!fs[_0xf966('0xa8')](_0x3f6dcf)){throw new Error(_0xf966('0xa9'));}var _0x38cab6={};try{_0x38cab6=JSON[_0xf966('0x7b')](process[_0xf966('0xa7')][0x3]);if(!_0x38cab6[_0xf966('0x6e')]){throw new Error(_0xf966('0xaa'));}if(!_0x38cab6[_0xf966('0x6e')]['phone']){throw new Error(_0xf966('0xab'));}if(!_0x38cab6[_0xf966('0x6e')][_0xf966('0x86')]){throw new Error(_0xf966('0xac'));}var _0x352caa=0x0;if(_0x38cab6[_0xf966('0x6e')][_0xf966('0xad')]){_0x352caa=0x1;}if(!_0x38cab6['ListId']){throw new Error(_0xf966('0xae'));}}catch(_0x254101){throw new Error('body\x20id\x20mandatory');}var _0x50c9b4=[];try{_0x50c9b4=_[_0xf966('0xaf')](JSON['parse'](process[_0xf966('0xa7')][0x4]),'id');}catch(_0x464e50){logger[_0xf966('0x5a')]('No\x20agent\x20available');}main(_0x3f6dcf,_0x38cab6,_0x50c9b4,_0x352caa);}validate();process['on'](_0xf966('0xb0'),handleStop);process['on'](_0xf966('0xb1'),handleUncaughtException); \ No newline at end of file +var _0x8ba5=['ContactId','from','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','select','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','insert','priority','cm_hopper_black','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','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','message','query','spread','catch','campaigns.id','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','sequelize','timezones','dialTimezone','isNil','utcOffset','set','main','send','binding','clone','socket_timestamp','server/files/tmp','header','name','_description','writeFileSync','parse','find','hasOwnProperty','data','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','appendFileSync','rows','Abort\x20parser','abort','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','voice_queues_','format','DROP\x20TABLE\x20','each','contactId','contactTypeId','orderBy','voice_queues','VoiceQueueId','campaigns','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','finish','emit','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/logger','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','join','.id\x20=\x20','where','\x20=\x20','CmContact','findAll','AdditionalPhones','length','push','then','split','all','filter','CmContactHasItem','update','create','PHONE','inserted','cm_contacts.phone','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','UserId','recallme','fields','cm_contacts','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.id'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x8ba5,0x1da));var _0x58ba=function(_0x96b6a,_0x12471d){_0x96b6a=_0x96b6a-0x0;var _0x3e16f3=_0x8ba5[_0x96b6a];return _0x3e16f3;};'use strict';var fs=require('fs');var path=require(_0x58ba('0x0'));var _=require(_0x58ba('0x1'));var Papa=require(_0x58ba('0x2'));var util=require(_0x58ba('0x3'));var BPromise=require(_0x58ba('0x4'));var moment=require('moment');var squel=require(_0x58ba('0x5'));var Redis=require(_0x58ba('0x6'));var db=require(_0x58ba('0x7'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require(_0x58ba('0x8'))('import');config['redis']=_['defaults'](config[_0x58ba('0x9')],{'host':_0x58ba('0xa'),'port':0x18eb});var socket=require(_0x58ba('0xb'))(new Redis(config[_0x58ba('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x58ba('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x58ba('0xc'));function isEmail(_0x223b7e){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))*$/[_0x58ba('0xd')](_0x223b7e);}function selectNotIn(_0x5b1607,_0x44bf4d,_0x57a2e5,_0xfbe7f1,_0x5d8924){return squel['select']()[_0x58ba('0xe')](_0x58ba('0xf'))['from'](_0xfbe7f1)[_0x58ba('0x10')](_0x44bf4d,null,_0x44bf4d+_0x58ba('0x11')+_0xfbe7f1+'.'+_0x57a2e5)[_0x58ba('0x12')](_0xfbe7f1+'.'+_0x57a2e5+_0x58ba('0x13')+_0x5b1607+'.'+_0x57a2e5)[_0x58ba('0x12')](_0x44bf4d+'.dialCheckDuplicateType\x20IN\x20('+_0x5d8924[_0x58ba('0x10')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x235a5a,_0x4c5cd1){promisesAdditionalPhones=[];return db[_0x58ba('0x14')][_0x58ba('0x15')]({'raw':!![],'attributes':['id',_0x58ba('0x16')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x4e448d){if(_0x4e448d!==null){var _0x37a3f0=[];for(var _0x4f9943=0x0;_0x4f9943<_0x4e448d[_0x58ba('0x17')];_0x4f9943++){var _0x325f81=_0x4e448d[_0x4f9943];_0x37a3f0[_0x58ba('0x18')](insertAdditionalPhones(_0x325f81));}}Promise['all'](_0x37a3f0)[_0x58ba('0x19')](function(){_0x235a5a({'val':0x1});});});});}function insertAdditionalPhones(_0x1174d0){return new Promise(function(_0x317421,_0x1977b5){var _0x4775e3=_0x1174d0[_0x58ba('0x16')];var _0x3a1909=_0x4775e3[_0x58ba('0x1a')](';');var _0x2d5a9d=[];orderBy=0x0;for(var _0x1b1673=0x0;_0x1b1673<_0x3a1909[_0x58ba('0x17')];_0x1b1673++){_0x2d5a9d[_0x58ba('0x18')](splitAdditionalPhone(_0x1174d0['id'],_0x3a1909[_0x1b1673]));}Promise[_0x58ba('0x1b')](_0x2d5a9d)[_0x58ba('0x19')](function(){_0x317421({'val':_0x3a1909['length']});});});}function splitAdditionalPhone(_0x1e68bd,_0x4ff4fb){return new Promise(function(_0x1e62f8,_0x78c779){var _0x28844c=_0x4ff4fb[_0x58ba('0x1a')](':');var _0x3d8b11=_0x28844c[0x0];var _0x9c3926=_0x28844c[0x1];if(!_['isNil'](_0x9c3926)){var _0x2bc60a=_0x9c3926['split']('|');var _0x1ba50d=[];for(var _0x56d333=0x0;_0x56d333<_0x2bc60a[_0x58ba('0x17')];_0x56d333++){if(_0x2bc60a[_0x56d333]!==''){var _0x3cd65a=_[_0x58ba('0x1c')](promisesAdditionalPhones,{'contactId':_0x1e68bd,'phone':_0x2bc60a[_0x56d333]});if(_0x3cd65a[_0x58ba('0x17')]==0x0){orderBy++;promisesAdditionalPhones[_0x58ba('0x18')]({'contactId':_0x1e68bd,'contactTypeId':_0x3d8b11,'phone':_0x2bc60a[_0x56d333],'orderBy':orderBy});}}}_0x1e62f8({'ok':0x1});}else _0x1e62f8({'res':0x0});});}function createAdditionalPhone(_0x52b278,_0x149fa9,_0x5824c9,_0x3131f9){var _0x5d0379='';var _0x223b20='';var _0x57cb22=_0x5824c9[_0x58ba('0x1a')]('§');_0x5d0379=_0x57cb22[0x0];if(_0x57cb22[_0x58ba('0x17')]==0x2)_0x223b20=_0x57cb22[0x1];return new Promise(function(_0x1283e7,_0x229447){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x52b278,'item':_0x5d0379}})[_0x58ba('0x19')](function(_0x596236){if(_0x596236){return db[_0x58ba('0x1d')][_0x58ba('0x1e')]({'ItemTypeId':_0x149fa9,'description':_0x223b20,'OrderBy':_0x3131f9},{'where':{'CmContactId':_0x52b278,'item':_0x5d0379}})['then'](function(_0x4e659c){_0x1283e7({'res':'updated'});});}else{return db['CmContactHasItem'][_0x58ba('0x1f')]({'CmContactId':_0x52b278,'item':_0x5d0379,'description':_0x223b20,'ItemTypeId':_0x149fa9,'OrderBy':_0x3131f9,'ItemClass':_0x58ba('0x20')})[_0x58ba('0x19')](function(_0x3cc8bc){_0x1283e7({'res':_0x58ba('0x21')});});}});});}function insertCmHopper(_0x447638,_0x4abae0,_0x50c59e,_0x4651fa,_0x122cc4){var _0x36714c=[_0x58ba('0x22'),'cm_contacts.scheduledat','cm_contacts.id',_0x58ba('0x23'),_0x4abae0+'.'+_0x4651fa,_0x58ba('0x24'),_0x58ba('0x25'),_0x58ba('0x26'),_0x58ba('0x27'),'\x22'+_0x122cc4+'\x22'];return squel['insert']()[_0x58ba('0x28')](_0x58ba('0x29'))[_0x58ba('0x2a')]([_0x58ba('0xf'),_0x58ba('0x2b'),'ContactId',_0x58ba('0x2c'),_0x4651fa,_0x58ba('0x2d'),_0x58ba('0x2e'),'priority',_0x58ba('0x2f'),_0x58ba('0x30')],squel['select']()[_0x58ba('0x31')](_0x36714c)['from'](_0x4abae0)[_0x58ba('0x10')](_0x58ba('0x32'),null,'cm_contacts.ListId\x20=\x20'+_0x4abae0+'.CmListId')[_0x58ba('0x10')](_0x50c59e,null,_0x50c59e+_0x58ba('0x11')+_0x4abae0+'.'+_0x4651fa)[_0x58ba('0x12')](_0x4abae0+'.CmListId\x20=\x20?',_0x447638)[_0x58ba('0x12')](_0x58ba('0x33'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4abae0,_0x50c59e,_0x4651fa,'cm_hopper',['\x22always\x22',_0x58ba('0x34')]))[_0x58ba('0x12')](_0x58ba('0x35'),selectNotIn(_0x4abae0,_0x50c59e,_0x4651fa,'cm_hopper',[_0x58ba('0x36')])))[_0x58ba('0x37')]();}function insertCmHopperBlack(_0x58ce79,_0x3da403,_0x174441,_0x2c9a76){var _0x42627c=['cm_contacts.phone',_0x58ba('0x38'),_0x58ba('0x23'),_0x3da403+'.'+_0x2c9a76,_0x58ba('0x24'),_0x58ba('0x25')];return squel['insert']()[_0x58ba('0x28')]('cm_hopper_black')[_0x58ba('0x2a')]([_0x58ba('0xf'),_0x58ba('0x39'),_0x58ba('0x2c'),_0x2c9a76,'createdAt','updatedAt'],squel['select']()[_0x58ba('0x31')](_0x42627c)[_0x58ba('0x3a')](_0x3da403)[_0x58ba('0x10')](_0x58ba('0x32'),null,_0x58ba('0x3b')+_0x3da403+_0x58ba('0x3c'))[_0x58ba('0x10')](_0x174441,null,_0x174441+_0x58ba('0x11')+_0x3da403+'.'+_0x2c9a76)[_0x58ba('0x12')](_0x3da403+_0x58ba('0x3d'),_0x58ce79)[_0x58ba('0x12')](_0x58ba('0x33'),NOW)[_0x58ba('0x12')](_0x58ba('0x35'),squel[_0x58ba('0x3e')]()[_0x58ba('0xe')](_0x58ba('0xf'))['from']('cm_hopper_black')[_0x58ba('0x12')]('ListId\x20=\x20?',_0x58ce79)[_0x58ba('0x12')](_0x2c9a76+_0x58ba('0x13')+_0x3da403+'.'+_0x2c9a76)))[_0x58ba('0x37')]();}function insertTzCmHopper(_0x596e2f,_0x2240df,_0x3f9511,_0x3c8ed5,_0x4aa5f2,_0x4ab06e){var _0x320b9e=[_0x58ba('0x22'),_0x58ba('0x3f')+_0x4ab06e+_0x58ba('0x40'),_0x58ba('0x38'),_0x58ba('0x23'),_0x2240df+'.'+_0x3c8ed5,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','\x22'+_0x4aa5f2+'\x22'];var _0xefdb6d=squel[_0x58ba('0x41')]()[_0x58ba('0x28')]('cm_hopper')[_0x58ba('0x2a')]([_0x58ba('0xf'),_0x58ba('0x2b'),_0x58ba('0x39'),'ListId',_0x3c8ed5,_0x58ba('0x2d'),_0x58ba('0x2e'),_0x58ba('0x42'),_0x58ba('0x2f'),_0x58ba('0x30')],squel[_0x58ba('0x3e')]()[_0x58ba('0x31')](_0x320b9e)['from'](_0x2240df)['join'](_0x58ba('0x32'),null,_0x58ba('0x3b')+_0x2240df+'.CmListId')['join'](_0x3f9511,null,_0x3f9511+'.id\x20=\x20'+_0x2240df+'.'+_0x3c8ed5)[_0x58ba('0x10')](_0x4ab06e,null,_0x4ab06e+_0x58ba('0x11')+_0x2240df+'.'+_0x3c8ed5)[_0x58ba('0x12')](_0x2240df+_0x58ba('0x3d'),_0x596e2f)[_0x58ba('0x12')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x58ba('0x12')](_0x58ba('0x35'),selectNotIn(_0x2240df,_0x3f9511,_0x3c8ed5,_0x58ba('0x29'),[_0x58ba('0x36'),_0x58ba('0x34')]))[_0x58ba('0x12')](_0x58ba('0x35'),selectNotIn(_0x2240df,_0x3f9511,_0x3c8ed5,_0x58ba('0x29'),[_0x58ba('0x36')])))[_0x58ba('0x37')]();return _0xefdb6d;}function insertTzCmHopperBlack(_0x54fb66,_0x569d53,_0x226bb3,_0x535d01){var _0x4ee590=[_0x58ba('0x22'),'cm_contacts.id',_0x58ba('0x23'),_0x569d53+'.'+_0x535d01,_0x58ba('0x24'),_0x58ba('0x25')];return squel[_0x58ba('0x41')]()[_0x58ba('0x28')](_0x58ba('0x43'))[_0x58ba('0x2a')]([_0x58ba('0xf'),_0x58ba('0x39'),_0x58ba('0x2c'),_0x535d01,_0x58ba('0x2d'),_0x58ba('0x2e')],squel[_0x58ba('0x3e')]()[_0x58ba('0x31')](_0x4ee590)[_0x58ba('0x3a')](_0x569d53)[_0x58ba('0x10')]('cm_contacts',null,_0x58ba('0x3b')+_0x569d53+_0x58ba('0x3c'))[_0x58ba('0x10')](_0x226bb3,null,_0x226bb3+_0x58ba('0x11')+_0x569d53+'.'+_0x535d01)[_0x58ba('0x12')](_0x569d53+_0x58ba('0x3d'),_0x54fb66)[_0x58ba('0x12')](_0x58ba('0x33'),NOW)[_0x58ba('0x12')](_0x58ba('0x35'),squel[_0x58ba('0x3e')]()['field'](_0x58ba('0xf'))['from']('cm_hopper_black')[_0x58ba('0x12')](_0x58ba('0x44'),_0x54fb66)[_0x58ba('0x12')](_0x535d01+'\x20=\x20'+_0x569d53+'.'+_0x535d01)))[_0x58ba('0x37')]();}function insertCmHopperAdditionalPhones(_0x4cf378){var _0x56b477=[_0x58ba('0x45'),_0x58ba('0x46'),_0x58ba('0x47'),_0x58ba('0x48'),_0x58ba('0x49')];return squel[_0x58ba('0x41')]()[_0x58ba('0x28')](_0x58ba('0x4a'))[_0x58ba('0x2a')](['CmHopperId',_0x58ba('0xf'),_0x58ba('0x4b'),'createdAt',_0x58ba('0x2e')],squel[_0x58ba('0x3e')]()[_0x58ba('0x31')](_0x56b477)[_0x58ba('0x3a')](_0x58ba('0x29'))[_0x58ba('0x10')](_0x58ba('0x32'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x58ba('0x10')](_0x58ba('0x4c'),null,_0x58ba('0x4d'))[_0x58ba('0x12')]('cm_hopper.ListId\x20=\x20?',_0x4cf378)['where'](_0x58ba('0x33'),NOW))[_0x58ba('0x37')]();}function insertCmContact(_0x57d5cd,_0x86810a,_0x1e4ce0,_0x4bacaa){var _0x4f8dbf=_[_0x58ba('0x4e')](_[_0x58ba('0x4f')](_0x4bacaa),[_0x58ba('0x2c'),_0x58ba('0x50'),_0x58ba('0x2d'),_0x58ba('0x2e')]);return squel['insert']()[_0x58ba('0x28')]('cm_contacts')[_0x58ba('0x2a')](_0x4f8dbf,squel[_0x58ba('0x3e')]()[_0x58ba('0x31')](_0x4f8dbf)[_0x58ba('0x3a')](_0x86810a)[_0x58ba('0x12')]('('+_0x1e4ce0[_0x58ba('0x10')](',')+_0x58ba('0x51'),squel['select']()['fields'](_0x1e4ce0)[_0x58ba('0x3a')](_0x58ba('0x32'))[_0x58ba('0x12')]('ListId\x20=\x20?',_0x57d5cd)['where'](_0x58ba('0x52')))[_0x58ba('0x12')](_0x58ba('0x53'),squel[_0x58ba('0x3e')]()[_0x58ba('0xe')]('MIN(id)',_0x58ba('0x54'))[_0x58ba('0x3a')](_0x86810a)[_0x58ba('0x55')](_0x1e4ce0['join'](','))))[_0x58ba('0x37')]();}function handleStop(){logger[_0x58ba('0x56')](_0x58ba('0x57'));stopped=!![];}function handleUncaughtException(_0x26228a){logger[_0x58ba('0x58')](_0x26228a['message']);process[_0x58ba('0x59')](0x1);}function handleError(_0x3151e8,_0x587436){stats[_0x58ba('0x5a')][_0x58ba('0x18')]({'name':_0x587436[_0x58ba('0x5b')],'message':_0x587436[_0x58ba('0x5c')],'row':_0x3151e8});}function handleQuery(_0x418ad3){logger[_0x58ba('0x56')](_0x418ad3);return db['sequelize'][_0x58ba('0x5d')](_0x418ad3)[_0x58ba('0x5e')](function(_0x3fec77){results[_0x58ba('0x18')](_0x3fec77);})[_0x58ba('0x5f')](function(_0x3d5cde){logger['error'](_0x3d5cde[_0x58ba('0x5c')]);});}function updateTzCampaigns(_0x16f11b){return new Promise(function(_0x3d75b3,_0x3c5a98){var _0x48b94a=squel['select']()['fields']([_0x58ba('0x60'),'campaigns.dialTimezone'])[_0x58ba('0x3a')]('campaigns')[_0x58ba('0x10')](_0x58ba('0x61'),null,_0x58ba('0x62'))[_0x58ba('0x12')](_0x58ba('0x63')+_0x16f11b);db['sequelize'][_0x58ba('0x5d')](_0x48b94a[_0x58ba('0x37')]())[_0x58ba('0x5e')](function(_0x310f5e){var _0x327436=[];for(var _0x4d6d16=0x0;_0x4d6d16<_0x310f5e[_0x58ba('0x17')];_0x4d6d16++){_0x327436[_0x58ba('0x18')](getTimezoneData(_0x310f5e[_0x4d6d16],tmp_campaigns));}BPromise['all'](_0x327436)['then'](function(){_0x3d75b3({'val':0x1});});})[_0x58ba('0x5f')](function(_0x98b125){logger[_0x58ba('0x58')](_0x98b125[_0x58ba('0x5c')]);_0x3d75b3({'val':0x0});});});}function updateTzVoiceQueues(_0x55969a){return new Promise(function(_0x4ad606,_0x1d95c9){var _0x1ca7d1=squel[_0x58ba('0x3e')]()[_0x58ba('0x31')]([_0x58ba('0x64'),'voice_queues.dialTimezone'])[_0x58ba('0x3a')]('voice_queues')['join'](_0x58ba('0x65'),null,_0x58ba('0x66'))[_0x58ba('0x12')](_0x58ba('0x67')+_0x55969a);db[_0x58ba('0x68')][_0x58ba('0x5d')](_0x1ca7d1[_0x58ba('0x37')]())[_0x58ba('0x5e')](function(_0x4c0c2d){var _0x490a85=[];for(var _0x6d0cbd=0x0;_0x6d0cbd<_0x4c0c2d[_0x58ba('0x17')];_0x6d0cbd++){_0x490a85['push'](getTimezoneData(_0x4c0c2d[_0x6d0cbd],tmp_voice_queues));}BPromise[_0x58ba('0x1b')](_0x490a85)['then'](function(){_0x4ad606({'val':0x1});});})[_0x58ba('0x5f')](function(_0x4f699c){logger[_0x58ba('0x58')](_0x4f699c[_0x58ba('0x5c')]);_0x4ad606({'val':0x0});});});}function getTimezoneData(_0x30454f,_0x35cd63){return new Promise(function(_0x4bc29e,_0x2ef070){var _0x38ef16=shared[_0x58ba('0x69')];var _0x5a04f7=_0x38ef16[_0x30454f[_0x58ba('0x6a')]];if(_[_0x58ba('0x6b')](_0x5a04f7)){_0x4bc29e({'ret':0x1});}else{var _0x45a0f7=_0x5a04f7[_0x58ba('0x6c')];var _0x4c03f5=squel[_0x58ba('0x41')]()['into'](_0x35cd63)['set']('id',_0x30454f['id'])[_0x58ba('0x6d')]('offset',_0x45a0f7)['set'](_0x58ba('0x6a'),_0x30454f['dialTimezone'])[_0x58ba('0x37')]();return db[_0x58ba('0x68')][_0x58ba('0x5d')](_0x4c03f5)['spread'](function(_0x43e9e8){_0x4bc29e({'ret':0x1});})[_0x58ba('0x5f')](function(_0x15a8a1){logger[_0x58ba('0x58')](_0x15a8a1[_0x58ba('0x5c')]);_0x2ef070({'ret':0x1});});}});}function handleTZQuery(_0xedbbea){logger[_0x58ba('0x56')](_0xedbbea);return db['sequelize'][_0x58ba('0x5d')](_0xedbbea)[_0x58ba('0x5e')](function(_0x1d13a6){})[_0x58ba('0x5f')](function(_0x1d9e53){logger[_0x58ba('0x58')](_0x1d9e53[_0x58ba('0x5c')]);});}function main(_0x2dba27,_0x3af53b,_0x19f2a7,_0x4beb42){logger[_0x58ba('0x56')](_0x58ba('0x6e'),_0x2dba27,JSON['stringify'](_0x3af53b));process[_0x58ba('0x6f')]('start');var _0x1263c1=_0x3af53b[_0x58ba('0x70')];var _0x2a7356=_[_0x58ba('0x71')](_0x1263c1);var _0x216521=_0x3af53b[_0x58ba('0x72')];var _0x475c16=path[_0x58ba('0x10')](config['root'],_0x58ba('0x73'),_0x216521+'.csv');hasTZ=_[_0x58ba('0x4f')](_0x1263c1)['includes'](_0x58ba('0x6a'));var _0xb30a98=_[_0x58ba('0x4f')](_0x1263c1)[_0x58ba('0x10')]();logger[_0x58ba('0x56')](_0x58ba('0x74'),_0xb30a98);db['ContactItemType'][_0x58ba('0x15')]({'raw':!![],'attributes':['id',_0x58ba('0x75')]})[_0x58ba('0x19')](function(_0x331dd6){for(var _0xc0a1d7=0x0;_0xc0a1d7<_0x331dd6['length'];_0xc0a1d7++){if(_0x331dd6[_0xc0a1d7][_0x58ba('0x75')]in _0x1263c1){contactItemTypes['push'](_0x331dd6[_0xc0a1d7]);delete _0x2a7356[_0x331dd6[_0xc0a1d7][_0x58ba('0x75')]];hasAdditionalPhones=!![];}for(var _0x50d7b0 in _0x1263c1){if(_0x331dd6[_0xc0a1d7][_0x58ba('0x75')]+_0x58ba('0x76')===_0x50d7b0){phoneDescriptions[_0x58ba('0x18')]({'itemTypeId':_0x331dd6[_0xc0a1d7]['id'],'description':_0x50d7b0});delete _0x2a7356[_0x50d7b0];}}}if(hasAdditionalPhones)_0x2a7356[_0x58ba('0x16')]='';var _0x7b269f=_[_0x58ba('0x4f')](_0x2a7356)[_0x58ba('0x10')]();logger[_0x58ba('0x56')](_0x58ba('0x74'),_0x7b269f);fs[_0x58ba('0x77')](_0x475c16,_0x7b269f+'\x0a');Papa[_0x58ba('0x78')](fs['createReadStream'](_0x2dba27),{'header':!![],'skipEmptyLines':!![],'step':function(_0x40b491,_0x2118e){try{for(var _0x330881=0x0,_0xc5a677=[];_0x330881<_0x40b491['data'][_0x58ba('0x17')];_0x330881++){stats['rows']+=0x1;if(_0x40b491[_0x58ba('0x5a')][_0x330881]){handleError(_0x40b491['data'][_0x330881],_0x40b491['errors'][_0x330881]);}else{var _0x397824=[];var _0x1a5224=[];var _0x3279a5={};for(var _0xf1e89 in _0x1263c1){let _0x1bb3a5=contactItemTypes[_0x58ba('0x79')](_0x2c4dbc=>_0x2c4dbc[_0x58ba('0x75')]===_0xf1e89);let _0x3acdca=contactItemTypes['find'](_0x24ae69=>_0x24ae69['name']+_0x58ba('0x76')===_0xf1e89);if(_[_0x58ba('0x6b')](_0x1bb3a5)&&_['isNil'](_0x3acdca)){if(_0x1263c1[_0x58ba('0x7a')](_0xf1e89)){if(_0x40b491[_0x58ba('0x7b')][_0x330881][_0x1263c1[_0xf1e89]]){var _0x1772c6=_[_0x58ba('0x7c')](_0x40b491['data'][_0x330881][_0x1263c1[_0xf1e89]][_0x58ba('0x7d')](/"/g,'\x27'));switch(_0xf1e89){case _0x58ba('0x2b'):var _0x4af473=moment(_0x1772c6,_0x58ba('0xc'),!![]);if(_0x4af473[_0x58ba('0x7e')]()){_0xc5a677['push']('\x22'+_0x1772c6+'\x22');}else{_0x397824[_0x58ba('0x18')](_0x58ba('0x7f'));}break;case'priority':var _0x3b1da1=parseInt(_0x1772c6);_0x1772c6=_[_0x58ba('0x80')](_0x3b1da1)||_0x3b1da1<0x0||_0x3b1da1>0x4?_0x4beb42?0x3:0x2:_0x3b1da1;_0xc5a677[_0x58ba('0x18')]('\x22'+_0x1772c6+'\x22');break;case _0x58ba('0x2f'):var _0x58924c=parseInt(_0x1772c6);if(_[_0x58ba('0x81')](_0x58924c)&&_[_0x58ba('0x82')](_0x19f2a7,_0x58924c)){_0xc5a677[_0x58ba('0x18')]('\x22'+_0x58924c+'\x22');}else{_0x397824[_0x58ba('0x18')](_0x58ba('0x83'));}break;case _0x58ba('0x84'):if(isEmail(_0x1772c6)){_0xc5a677[_0x58ba('0x18')]('\x22'+_0x1772c6+'\x22');}else{_0x397824['push'](_0x58ba('0x85'));}break;case _0x58ba('0x86'):var _0x43b8cf=moment(_0x1772c6,_0x58ba('0x87'),!![]);if(_0x43b8cf['isValid']()){_0xc5a677[_0x58ba('0x18')]('\x22'+_0x1772c6+'\x22');}else{_0x397824[_0x58ba('0x18')](_0x58ba('0x88'));}break;case'dialTimezone':var _0x427aaf=shared['timezones'];var _0x16db07=_0x427aaf[_0x1772c6];if(!_[_0x58ba('0x6b')](_0x16db07)){var _0x365c8e=_0x16db07['utcOffset'];_0xc5a677[_0x58ba('0x18')]('\x22'+_0x1772c6+'\x22');_0xc5a677[_0x58ba('0x18')]('\x22'+_0x365c8e+'\x22');}break;default:_0xc5a677['push']('\x22'+_0x1772c6+'\x22');}}else{switch(_0xf1e89){case _0x58ba('0x89'):case _0x58ba('0xf'):_0x397824[_0x58ba('0x18')](_0xf1e89+_0x58ba('0x8a'));break;default:_0xc5a677[_0x58ba('0x18')]('\x22\x22');}}}}else{var _0x331dd1='';if(!_[_0x58ba('0x6b')](_0x1bb3a5)){if(!_0x3279a5['hasOwnProperty'](_0x1bb3a5['id'])){if(!_['isNil'](_0x40b491[_0x58ba('0x7b')][_0x330881][_0x1263c1[_0xf1e89]])){var _0x1772c6=_[_0x58ba('0x7c')](_0x40b491['data'][_0x330881][_0x1263c1[_0xf1e89]]['replace'](/"/g,'\x27'));var _0x3be93c=phoneDescriptions['find'](_0x1548d3=>_0x1548d3[_0x58ba('0x8b')]===_0x1bb3a5['id']);if(!_['isNil'](_0x3be93c)){var _0x2a75bb=_['trim'](_0x40b491[_0x58ba('0x7b')][_0x330881][_0x1263c1[_0x3be93c['description']]][_0x58ba('0x7d')](/"/g,'\x27'));if(!_[_0x58ba('0x6b')](_0x2a75bb))_0x1772c6=_0x1772c6+'§'+_0x2a75bb;}if(_0x331dd1=='')_0x331dd1=_0x1772c6;else _0x331dd1+='|'+_0x1772c6;}_0x1a5224[_0x58ba('0x18')](_0x1bb3a5['id']+':'+_0x331dd1);_0x3279a5[_0x1bb3a5['id']]=0x1;}}}}if(hasAdditionalPhones){_0xc5a677[_0x58ba('0x18')]('\x22'+_0x1a5224[_0x58ba('0x10')](';')+'\x22');}if(_0x397824['length']){handleError(_0x40b491[_0x58ba('0x7b')][_0x330881],{'code':'SystemRow','message':_0x397824[_0x58ba('0x10')]()});}else{fs[_0x58ba('0x8c')](_0x475c16,_0xc5a677[_0x58ba('0x10')]()+'\x0a');}_0xc5a677=[];}if(!(stats[_0x58ba('0x8d')]%0xc8)){socket['emit']('contact:import:'+_0x216521,stats);stats[_0x58ba('0x5a')]=[];}}if(stopped){logger[_0x58ba('0x56')](_0x58ba('0x8e'));_0x2118e[_0x58ba('0x8f')]();}}catch(_0x47c6f9){handleError(_0x40b491[_0x58ba('0x7b')][_0x330881],{'code':'SystemError','message':_0x47c6f9[_0x58ba('0x5c')]});logger[_0x58ba('0x58')](_0x58ba('0x90'),_0x47c6f9[_0x58ba('0x5c')]);}},'complete':function(){try{var _0x87b45c=[];var _0x3fb0c4=[];var _0x2cb561='cm_contacts';if(_0x3af53b[_0x58ba('0x91')]&&_0x3af53b[_0x58ba('0x91')][_0x58ba('0x17')]){_0x2cb561='cm_contacts_'+_0x216521;_0x87b45c['push'](_0x58ba('0x92')+_0x2cb561+_0x58ba('0x93'));}tmp_campaigns='campaigns_'+_0x216521;tmp_voice_queues=_0x58ba('0x94')+_0x216521;_0x3fb0c4[_0x58ba('0x18')](_0x58ba('0x92')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x3fb0c4[_0x58ba('0x18')](_0x58ba('0x92')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise['each'](_0x3fb0c4,handleTZQuery)[_0x58ba('0x19')](function(_0x438a98){updateTzCampaigns(_0x3af53b[_0x58ba('0x2c')])[_0x58ba('0x19')](function(_0x1418a4){updateTzVoiceQueues(_0x3af53b[_0x58ba('0x2c')])[_0x58ba('0x19')](function(_0x4eef68){if(hasTZ)_0x7b269f=_0x7b269f['replace']('dialTimezone','dialTimezone,utcOffset');var _0x3db993=util[_0x58ba('0x95')]('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',_0x475c16,_0x2cb561,_0x7b269f,_0x3af53b[_0x58ba('0x2c')],_0x3af53b[_0x58ba('0x50')]||null,NOW,NOW);if(_['isNil'](_0x1263c1[_0x58ba('0x2b')])){_0x3db993+=',\x20scheduledAt\x20=\x20NOW()';}_0x87b45c[_0x58ba('0x18')](_0x3db993);if(_0x3af53b[_0x58ba('0x91')]&&_0x3af53b[_0x58ba('0x91')][_0x58ba('0x17')]){_0x87b45c[_0x58ba('0x18')](insertCmContact(_0x3af53b[_0x58ba('0x2c')],_0x2cb561,_0x3af53b[_0x58ba('0x91')],_0x1263c1));_0x87b45c['push'](_0x58ba('0x96')+_0x2cb561+';');}BPromise[_0x58ba('0x97')](_0x87b45c,handleQuery)[_0x58ba('0x19')](function(_0x3d872b){BPromise['all']([handleAdditionalPhones()])[_0x58ba('0x19')](function(){_0x87b45c=[];for(var _0x26bee9=0x0;_0x26bee9\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','UserId','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../config/environment','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','spread','length','isNil','push','all','then','catch','error','message','split','filter','CmContactHasItem','findOne','updated','create','PHONE','CmContact','update','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','updatedAt','priority','recallme','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.ListId','cm_hopper_black','createdAt','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','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','ListId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','info','Received\x20SIGINT','exit','code','query','main','stringify','start','binding','clone'];(function(_0x64a30a,_0x5dce0b){var _0xb04a37=function(_0x5ee712){while(--_0x5ee712){_0x64a30a['push'](_0x64a30a['shift']());}};_0xb04a37(++_0x5dce0b);}(_0x98d8,0xce));var _0x898d=function(_0x4b4844,_0x2f0dfb){_0x4b4844=_0x4b4844-0x0;var _0x575192=_0x98d8[_0x4b4844];return _0x575192;};'use strict';var fs=require('fs');var path=require(_0x898d('0x0'));var _=require(_0x898d('0x1'));var Papa=require(_0x898d('0x2'));var util=require(_0x898d('0x3'));var BPromise=require(_0x898d('0x4'));var moment=require(_0x898d('0x5'));var squel=require(_0x898d('0x6'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x898d('0x7'));var logger=require('../../../config/logger')('import');config[_0x898d('0x8')]=_['defaults'](config[_0x898d('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x898d('0x9'))(new Redis(config['redis']));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()[_0x898d('0xa')](_0x898d('0xb'));var tempTableName=_0x898d('0xc')+moment()[_0x898d('0xa')](_0x898d('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x3c0a37){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))*$/[_0x898d('0xe')](_0x3c0a37);}function selectNotIn(_0x3d2669,_0x316b5a,_0x3f15f3,_0xf85d8c,_0x424a43){return squel[_0x898d('0xf')]()[_0x898d('0x10')](_0x898d('0x11'))['from'](_0xf85d8c)[_0x898d('0x12')](_0x316b5a,null,_0x316b5a+_0x898d('0x13')+_0xf85d8c+'.'+_0x3f15f3)['where'](_0xf85d8c+'.'+_0x3f15f3+_0x898d('0x14')+_0x3d2669+'.'+_0x3f15f3)[_0x898d('0x15')](_0x316b5a+_0x898d('0x16')+_0x424a43[_0x898d('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x8acf64,_0x17c699){promisesAdditionalPhones=[];promisesContact=[];return db[_0x898d('0x17')]['query'](_0x898d('0x18')+tempTableName)[_0x898d('0x19')](function(_0x5deafe){if(_0x5deafe!==null){var _0x575fb3=[];for(var _0x205372=0x0;_0x205372<_0x5deafe[_0x898d('0x1a')];_0x205372++){var _0x1ff50b=_0x5deafe[_0x205372];if(!_[_0x898d('0x1b')](_0x1ff50b[_0x898d('0x11')])){if(!_[_0x898d('0x1b')](_0x1ff50b['AdditionalPhones']))_0x575fb3['push'](insertAdditionalPhones(_0x1ff50b));promisesContact[_0x898d('0x1c')]({'contact':_0x1ff50b});}}}Promise[_0x898d('0x1d')](_0x575fb3)[_0x898d('0x1e')](function(){_0x8acf64({'val':0x1});});})[_0x898d('0x1f')](function(_0x46b323){logger[_0x898d('0x20')](_0x46b323[_0x898d('0x21')]);});});}function insertAdditionalPhones(_0x229d49){return new Promise(function(_0x12e72c,_0x2b9548){var _0x220d7b=_0x229d49['AdditionalPhones'];if(_[_0x898d('0x1b')](_0x220d7b))_0x2b9548({'val':0x0});else{var _0x1af006=_0x220d7b[_0x898d('0x22')](';');var _0x59b515=[];orderBy=0x0;for(var _0x5d18a3=0x0;_0x5d18a3<_0x1af006[_0x898d('0x1a')];_0x5d18a3++){_0x59b515[_0x898d('0x1c')](splitAdditionalPhone(_0x229d49['id'],_0x1af006[_0x5d18a3]));}Promise[_0x898d('0x1d')](_0x59b515)[_0x898d('0x1e')](function(){_0x12e72c({'val':_0x1af006[_0x898d('0x1a')]});});}});}function splitAdditionalPhone(_0x3fc201,_0x25c138){return new Promise(function(_0x3bf744,_0x30c415){var _0x493a60=_0x25c138['split'](':');var _0xd1b99b=_0x493a60[0x0];var _0x252887=_0x493a60[0x1];if(_0x252887!==''){var _0x308b13=_0x252887[_0x898d('0x22')]('|');var _0x244d3a=[];for(var _0xef200a=0x0;_0xef200a<_0x308b13[_0x898d('0x1a')];_0xef200a++){if(_0x308b13[_0xef200a]!==''){var _0x574249=_[_0x898d('0x23')](promisesAdditionalPhones,{'contactId':_0x3fc201,'phone':_0x308b13[_0xef200a]});if(_0x574249['length']==0x0){orderBy++;promisesAdditionalPhones[_0x898d('0x1c')]({'contactId':_0x3fc201,'contactTypeId':_0xd1b99b,'phone':_0x308b13[_0xef200a],'orderBy':orderBy});}}}_0x3bf744({'ok':0x1});}else _0x3bf744({'res':0x0});});}function createAdditionalPhone(_0x2d988c,_0x453564,_0x32da81,_0x28186b){var _0x3a57a0='';var _0x509e9f='';var _0x2e2092=_0x32da81[_0x898d('0x22')]('§');_0x3a57a0=_0x2e2092[0x0];if(_0x2e2092[_0x898d('0x1a')]==0x2)_0x509e9f=_0x2e2092[0x1];return new Promise(function(_0x47ea99,_0xfabc3e){return db[_0x898d('0x24')][_0x898d('0x25')]({'where':{'CmContactId':_0x2d988c,'item':_0x3a57a0}})[_0x898d('0x1e')](function(_0x5af430){if(_0x5af430){return db['CmContactHasItem']['update']({'ItemTypeId':_0x453564,'description':_0x509e9f,'OrderBy':_0x28186b},{'where':{'CmContactId':_0x2d988c,'item':_0x3a57a0}})[_0x898d('0x1e')](function(_0x41e979){_0x47ea99({'res':_0x898d('0x26')});});}else{return db['CmContactHasItem'][_0x898d('0x27')]({'CmContactId':_0x2d988c,'item':_0x3a57a0,'ItemTypeId':_0x453564,'description':_0x509e9f,'OrderBy':_0x28186b,'ItemClass':_0x898d('0x28')})[_0x898d('0x1e')](function(_0xf520fa){_0x47ea99({'res':'inserted'});});}});});}function updateContact(_0x1a5dc2){return new Promise(function(_0x5058a7,_0x41903d){var _0xe1bb3f=_0x1a5dc2['id'];delete _0x1a5dc2['id'];return db[_0x898d('0x29')][_0x898d('0x2a')](_0x1a5dc2,{'where':{'id':_0xe1bb3f}})[_0x898d('0x1e')](function(_0x4a7d20){updatedRows+=0x1;return db['CmHopper'][_0x898d('0x2a')]({'phone':_0x1a5dc2[_0x898d('0x11')]},{'where':{'ContactId':_0xe1bb3f}})['then'](function(_0x317988){_0x5058a7({'ret':'OK'});});});});}function insertCmHopper(_0x374b74,_0x1d130e,_0xae2ec0,_0x1712ab,_0x20d1fd){var _0x4e93af=[_0x898d('0x2b'),_0x898d('0x2c'),_0x898d('0x2d'),'cm_contacts.ListId',_0x1d130e+'.'+_0x1712ab,_0x898d('0x2e'),_0x898d('0x2f'),_0x898d('0x30'),'cm_contacts.UserId','\x22'+_0x20d1fd+'\x22'];return squel[_0x898d('0x31')]()[_0x898d('0x32')](_0x898d('0x33'))[_0x898d('0x34')]([_0x898d('0x11'),_0x898d('0x35'),_0x898d('0x36'),'ListId',_0x1712ab,'createdAt',_0x898d('0x37'),_0x898d('0x38'),'UserId',_0x898d('0x39')],squel[_0x898d('0xf')]()[_0x898d('0x3a')](_0x4e93af)[_0x898d('0x3b')](_0x1d130e)[_0x898d('0x12')](_0x898d('0x3c'),null,_0x898d('0x3d')+_0x1d130e+_0x898d('0x3e'))[_0x898d('0x12')](_0xae2ec0,null,_0xae2ec0+_0x898d('0x13')+_0x1d130e+'.'+_0x1712ab)[_0x898d('0x15')](_0x1d130e+_0x898d('0x3f'),_0x374b74)[_0x898d('0x15')](_0x898d('0x40'),NOW)['where'](_0x898d('0x41'),selectNotIn(_0x1d130e,_0xae2ec0,_0x1712ab,_0x898d('0x33'),['\x22always\x22',_0x898d('0x42')]))[_0x898d('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1d130e,_0xae2ec0,_0x1712ab,_0x898d('0x33'),[_0x898d('0x43')])))[_0x898d('0x44')]();}function insertCmHopperBlack(_0x438973,_0x413b18,_0x56fae0,_0x29250d){var _0x441c0b=[_0x898d('0x2b'),_0x898d('0x2d'),_0x898d('0x45'),_0x413b18+'.'+_0x29250d,_0x898d('0x2e'),_0x898d('0x2f')];return squel[_0x898d('0x31')]()['into'](_0x898d('0x46'))['fromQuery']([_0x898d('0x11'),_0x898d('0x36'),'ListId',_0x29250d,_0x898d('0x47'),_0x898d('0x37')],squel[_0x898d('0xf')]()[_0x898d('0x3a')](_0x441c0b)[_0x898d('0x3b')](_0x413b18)[_0x898d('0x12')](_0x898d('0x3c'),null,_0x898d('0x3d')+_0x413b18+_0x898d('0x3e'))[_0x898d('0x12')](_0x56fae0,null,_0x56fae0+_0x898d('0x13')+_0x413b18+'.'+_0x29250d)[_0x898d('0x15')](_0x413b18+_0x898d('0x3f'),_0x438973)[_0x898d('0x15')](_0x898d('0x40'),NOW)[_0x898d('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x898d('0xf')]()['field'](_0x898d('0x11'))[_0x898d('0x3b')](_0x898d('0x46'))[_0x898d('0x15')](_0x898d('0x48'),_0x438973)[_0x898d('0x15')](_0x29250d+'\x20=\x20?',_0x413b18+'.'+_0x29250d)))[_0x898d('0x44')]();}function insertCmHopperAdditionalPhones(_0x12b03d){var _0x13e7a4=[_0x898d('0x49'),_0x898d('0x4a'),_0x898d('0x4b'),_0x898d('0x4c'),_0x898d('0x4d')];return squel[_0x898d('0x31')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x898d('0x4e'),_0x898d('0x11'),_0x898d('0x4f'),_0x898d('0x47'),'updatedAt'],squel[_0x898d('0xf')]()['fields'](_0x13e7a4)[_0x898d('0x3b')]('cm_hopper')[_0x898d('0x12')](_0x898d('0x3c'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x898d('0x12')](_0x898d('0x50'),null,_0x898d('0x51'))['where'](_0x898d('0x52'),_0x12b03d)[_0x898d('0x15')](_0x898d('0x40'),NOW))[_0x898d('0x44')]();}function insertCmContact(_0x47d0e6,_0x48679e,_0x2222e0,_0x1858e5){var _0x449a9c=_[_0x898d('0x53')](_['keys'](_0x1858e5),[_0x898d('0x54'),'CompanyId','createdAt',_0x898d('0x37')]);return squel[_0x898d('0x31')]()[_0x898d('0x32')]('cm_contacts')['fromQuery'](_0x449a9c,squel['select']()[_0x898d('0x3a')](_0x449a9c)[_0x898d('0x3b')](_0x48679e)[_0x898d('0x15')]('('+_0x2222e0[_0x898d('0x12')](',')+_0x898d('0x55'),squel['select']()[_0x898d('0x3a')](_0x2222e0)[_0x898d('0x3b')](_0x898d('0x3c'))[_0x898d('0x15')](_0x898d('0x48'),_0x47d0e6))[_0x898d('0x15')](_0x898d('0x56'),squel[_0x898d('0xf')]()['field'](_0x898d('0x57'),'min_id')[_0x898d('0x3b')](_0x48679e)['group'](_0x2222e0[_0x898d('0x12')](','))))[_0x898d('0x44')]();}function handleStop(){logger[_0x898d('0x58')](_0x898d('0x59'));stopped=!![];}function handleUncaughtException(_0x5da24){logger[_0x898d('0x20')](_0x5da24[_0x898d('0x21')]);process[_0x898d('0x5a')](0x1);}function handleError(_0x2dd525,_0x2cb7e2){stats['errors'][_0x898d('0x1c')]({'name':_0x2cb7e2[_0x898d('0x5b')],'message':_0x2cb7e2[_0x898d('0x21')],'row':_0x2dd525});}function handleQuery(_0x1e0724){logger['info'](_0x1e0724);return db['sequelize'][_0x898d('0x5c')](_0x1e0724)[_0x898d('0x19')](function(_0x2b26cc){results['push'](_0x2b26cc);})[_0x898d('0x1f')](function(_0x5741ae){logger['error'](_0x5741ae[_0x898d('0x21')]);});}function main(_0x54dbb7,_0x478a6b,_0x5b8bc3,_0x56ff24){logger['info'](_0x898d('0x5d'),_0x54dbb7,JSON[_0x898d('0x5e')](_0x478a6b));process['send'](_0x898d('0x5f'));var _0x36110f=_0x478a6b[_0x898d('0x60')];var _0x17eeff=_[_0x898d('0x61')](_0x36110f);var _0x122ad4=_0x478a6b['socket_timestamp'];var _0x1c2fa1=path[_0x898d('0x12')](config['root'],'server/files/tmp',_0x122ad4+'.csv');logger[_0x898d('0x58')](_0x898d('0x62'),_0x478a6b);db[_0x898d('0x63')]['findAll']({'raw':!![],'attributes':['id',_0x898d('0x64')]})[_0x898d('0x1e')](function(_0x2a66c4){for(var _0x2d8890=0x0;_0x2d8890<_0x2a66c4[_0x898d('0x1a')];_0x2d8890++){if(_0x2a66c4[_0x2d8890]['name']in _0x36110f){contactItemTypes[_0x898d('0x1c')](_0x2a66c4[_0x2d8890]);delete _0x17eeff[_0x2a66c4[_0x2d8890][_0x898d('0x64')]];hasAdditionalPhones=!![];}for(var _0x54b7c4 in _0x36110f){if(_0x2a66c4[_0x2d8890][_0x898d('0x64')]+_0x898d('0x65')===_0x54b7c4){phoneDescriptions[_0x898d('0x1c')]({'itemTypeId':_0x2a66c4[_0x2d8890]['id'],'description':_0x54b7c4});delete _0x17eeff[_0x54b7c4];}}}if(hasAdditionalPhones)_0x17eeff[_0x898d('0x66')]='';var _0x1fd4d9=_['keys'](_0x17eeff)['join']();logger[_0x898d('0x58')](_0x898d('0x67'),_0x1fd4d9);fs[_0x898d('0x68')](_0x1c2fa1,_0x1fd4d9+'\x0a');Papa[_0x898d('0x69')](fs['createReadStream'](_0x54dbb7),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3fc14b,_0x53457e){try{for(var _0x19d7a6=0x0,_0x514c7e=[];_0x19d7a6<_0x3fc14b['data'][_0x898d('0x1a')];_0x19d7a6++){stats['rows']+=0x1;if(_0x3fc14b[_0x898d('0x6a')][_0x19d7a6]){handleError(_0x3fc14b[_0x898d('0x6b')][_0x19d7a6],_0x3fc14b[_0x898d('0x6a')][_0x19d7a6]);}else{var _0x43878d=[];var _0x45f8d0=[];var _0x4f54c8={};for(var _0x398a99 in _0x36110f){let _0x24d300=contactItemTypes[_0x898d('0x6c')](_0x221d54=>_0x221d54[_0x898d('0x64')]===_0x398a99);let _0x4d7524=contactItemTypes['find'](_0x1dd7d6=>_0x1dd7d6['name']+_0x898d('0x65')===_0x398a99);if(_[_0x898d('0x1b')](_0x24d300)&&_['isNil'](_0x4d7524)){if(_0x36110f[_0x898d('0x6d')](_0x398a99)){if(_0x3fc14b['data'][_0x19d7a6][_0x36110f[_0x398a99]]){var _0x4100dd=_[_0x898d('0x6e')](_0x3fc14b['data'][_0x19d7a6][_0x36110f[_0x398a99]][_0x898d('0x6f')](/"/g,'\x27'));switch(_0x398a99){case _0x898d('0x35'):var _0x364d78=moment(_0x4100dd,_0x898d('0xb'),!![]);if(_0x364d78['isValid']()){_0x514c7e['push']('\x22'+_0x4100dd+'\x22');}else{_0x43878d['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x898d('0x38'):var _0x3dd4c5=parseInt(_0x4100dd);_0x4100dd=_['isNaN'](_0x3dd4c5)||_0x3dd4c5<0x0||_0x3dd4c5>0x4?_0x56ff24?0x3:0x2:_0x3dd4c5;_0x514c7e['push']('\x22'+_0x4100dd+'\x22');break;case'UserId':var _0x5bb72f=parseInt(_0x4100dd);if(_[_0x898d('0x70')](_0x5bb72f)&&_['includes'](_0x5b8bc3,_0x5bb72f)){_0x514c7e['push']('\x22'+_0x5bb72f+'\x22');}else{_0x43878d[_0x898d('0x1c')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x4100dd)){_0x514c7e['push']('\x22'+_0x4100dd+'\x22');}else{_0x43878d[_0x898d('0x1c')](_0x898d('0x71'));}break;case _0x898d('0x72'):var _0x35e20f=moment(_0x4100dd,_0x898d('0x73'),!![]);if(_0x35e20f[_0x898d('0x74')]()){_0x514c7e[_0x898d('0x1c')]('\x22'+_0x4100dd+'\x22');}else{_0x43878d[_0x898d('0x1c')](_0x898d('0x75'));}break;default:_0x514c7e['push']('\x22'+_0x4100dd+'\x22');}}else{switch(_0x398a99){case _0x898d('0x76'):case'phone':_0x43878d[_0x898d('0x1c')](_0x398a99+_0x898d('0x77'));break;default:_0x514c7e[_0x898d('0x1c')]('\x22\x22');}}}}else{var _0xd8bd46='';if(!_[_0x898d('0x1b')](_0x24d300)){if(!_0x4f54c8['hasOwnProperty'](_0x24d300['id'])){for(var _0x58f7fc=0x0;_0x58f7fc<_0x36110f[_0x398a99][_0x898d('0x1a')];_0x58f7fc++){var _0x4100dd=_[_0x898d('0x6e')](_0x3fc14b[_0x898d('0x6b')][_0x19d7a6][_0x36110f[_0x398a99][_0x58f7fc]][_0x898d('0x6f')](/"/g,'\x27'));var _0x32a413=phoneDescriptions[_0x898d('0x6c')](_0x46d148=>_0x46d148[_0x898d('0x78')]===_0x24d300['id']);if(!_[_0x898d('0x1b')](_0x32a413)){var _0x33c766=_['trim'](_0x3fc14b[_0x898d('0x6b')][_0x19d7a6][_0x36110f[_0x32a413['description']][0x0]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x33c766))_0x4100dd=_0x4100dd+'§'+_0x33c766;}if(_0xd8bd46=='')_0xd8bd46=_0x4100dd;else _0xd8bd46+='|'+_0x4100dd;}_0x45f8d0[_0x898d('0x1c')](_0x24d300['id']+':'+_0xd8bd46);_0x4f54c8[_0x24d300['id']]=0x1;}}}}if(hasAdditionalPhones){_0x514c7e[_0x898d('0x1c')]('\x22'+_0x45f8d0['join'](';')+'\x22');}if(_0x43878d[_0x898d('0x1a')]){handleError(_0x3fc14b[_0x898d('0x6b')][_0x19d7a6],{'code':_0x898d('0x79'),'message':_0x43878d[_0x898d('0x12')]()});}else{fs['appendFileSync'](_0x1c2fa1,_0x514c7e[_0x898d('0x12')]()+'\x0a');}_0x514c7e=[];}if(!(stats[_0x898d('0x7a')]%0xc8)){socket[_0x898d('0x7b')](_0x898d('0x7c')+_0x122ad4,stats);stats[_0x898d('0x6a')]=[];}}if(stopped){logger[_0x898d('0x58')](_0x898d('0x7d'));_0x53457e[_0x898d('0x7e')]();}}catch(_0x390d78){handleError(_0x3fc14b['data'][_0x19d7a6],{'code':_0x898d('0x7f'),'message':_0x390d78[_0x898d('0x21')]});logger['error']('step',_0x390d78[_0x898d('0x21')]);}},'complete':function(){try{var _0x581732=[];var _0x2b9a3f=tempTableName;_0x581732[_0x898d('0x1c')](_0x898d('0x80')+_0x2b9a3f+_0x898d('0x81'));logger[_0x898d('0x58')](_0x898d('0x82'),contactItemTypes['length']);var _0x36aa2f=util['format'](_0x898d('0x83'),_0x1c2fa1,_0x2b9a3f,_0x1fd4d9,_0x478a6b[_0x898d('0x54')],_0x478a6b[_0x898d('0x84')]||null,NOW,NOW);if(_[_0x898d('0x1b')](_0x36110f[_0x898d('0x35')])){_0x36aa2f+=_0x898d('0x85');}_0x581732[_0x898d('0x1c')](_0x36aa2f);BPromise[_0x898d('0x86')](_0x581732,handleQuery)[_0x898d('0x1e')](function(_0x230863){BPromise[_0x898d('0x1d')]([handleAdditionalPhones()])['then'](function(){_0x581732=[];for(var _0x8c5d60=0x0;_0x8c5d60\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','import','redis','localhost','socket.io-emitter','cm_contacts_temp_','format','YYYYMMDDHHmmss','test','select','phone'];(function(_0x3f3604,_0x1bcd91){var _0xd85867=function(_0x4bfdab){while(--_0x4bfdab){_0x3f3604['push'](_0x3f3604['shift']());}};_0xd85867(++_0x1bcd91);}(_0x56e7,0x93));var _0x756e=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0x56e7[_0xfedc72];return _0x2c7c78;};'use strict';var fs=require('fs');var path=require(_0x756e('0x0'));var _=require(_0x756e('0x1'));var Papa=require(_0x756e('0x2'));var util=require(_0x756e('0x3'));var BPromise=require(_0x756e('0x4'));var moment=require(_0x756e('0x5'));var squel=require('squel');var Redis=require(_0x756e('0x6'));var db=require(_0x756e('0x7'))['db'];var config=require(_0x756e('0x8'));var logger=require('../../../config/logger')(_0x756e('0x9'));config[_0x756e('0xa')]=_['defaults'](config['redis'],{'host':_0x756e('0xb'),'port':0x18eb});var socket=require(_0x756e('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x756e('0xd')+moment()[_0x756e('0xe')](_0x756e('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x20926f){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))*$/[_0x756e('0x10')](_0x20926f);}function selectNotIn(_0x5b9435,_0x20bcaa,_0x4aff41,_0x3be9da,_0x147f39){return squel[_0x756e('0x11')]()['field'](_0x756e('0x12'))[_0x756e('0x13')](_0x3be9da)[_0x756e('0x14')](_0x20bcaa,null,_0x20bcaa+'.id\x20=\x20'+_0x3be9da+'.'+_0x4aff41)[_0x756e('0x15')](_0x3be9da+'.'+_0x4aff41+_0x756e('0x16')+_0x5b9435+'.'+_0x4aff41)[_0x756e('0x15')](_0x20bcaa+_0x756e('0x17')+_0x147f39[_0x756e('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3b97a6,_0x49d4b7){promisesAdditionalPhones=[];promisesContact=[];return db[_0x756e('0x18')][_0x756e('0x19')](_0x756e('0x1a')+tempTableName)[_0x756e('0x1b')](function(_0x42a2a4){if(_0x42a2a4!==null){var _0x583ae7=[];for(var _0x5cb7cd=0x0;_0x5cb7cd<_0x42a2a4['length'];_0x5cb7cd++){var _0x1c71e1=_0x42a2a4[_0x5cb7cd];if(!_[_0x756e('0x1c')](_0x1c71e1['phone'])){if(!_[_0x756e('0x1c')](_0x1c71e1['AdditionalPhones']))_0x583ae7[_0x756e('0x1d')](insertAdditionalPhones(_0x1c71e1));promisesContact[_0x756e('0x1d')]({'contact':_0x1c71e1});}}}Promise['all'](_0x583ae7)[_0x756e('0x1e')](function(){_0x3b97a6({'val':0x1});});})[_0x756e('0x1f')](function(_0x2d2aaf){logger[_0x756e('0x20')](_0x2d2aaf[_0x756e('0x21')]);});});}function insertAdditionalPhones(_0x5650d6){return new Promise(function(_0x50759b,_0x3218a6){var _0x133fbd=_0x5650d6['AdditionalPhones'];if(_[_0x756e('0x1c')](_0x133fbd))_0x3218a6({'val':0x0});else{var _0x4fbc5b=_0x133fbd['split'](';');var _0x363eb5=[];orderBy=0x0;for(var _0x12579d=0x0;_0x12579d<_0x4fbc5b['length'];_0x12579d++){_0x363eb5[_0x756e('0x1d')](splitAdditionalPhone(_0x5650d6['id'],_0x4fbc5b[_0x12579d]));}Promise[_0x756e('0x22')](_0x363eb5)['then'](function(){_0x50759b({'val':_0x4fbc5b['length']});});}});}function splitAdditionalPhone(_0x90f5ec,_0x2a3209){return new Promise(function(_0x40ee42,_0xda7fc4){var _0x238f80=_0x2a3209['split'](':');var _0x39d2a6=_0x238f80[0x0];var _0x7b1ab=_0x238f80[0x1];if(_0x7b1ab!==''){var _0x9ab420=_0x7b1ab['split']('|');var _0x1d0077=[];for(var _0x457dd2=0x0;_0x457dd2<_0x9ab420[_0x756e('0x23')];_0x457dd2++){if(_0x9ab420[_0x457dd2]!==''){var _0x5ee8ae=_[_0x756e('0x24')](promisesAdditionalPhones,{'contactId':_0x90f5ec,'phone':_0x9ab420[_0x457dd2]});if(_0x5ee8ae[_0x756e('0x23')]==0x0){orderBy++;promisesAdditionalPhones[_0x756e('0x1d')]({'contactId':_0x90f5ec,'contactTypeId':_0x39d2a6,'phone':_0x9ab420[_0x457dd2],'orderBy':orderBy});}}}_0x40ee42({'ok':0x1});}else _0x40ee42({'res':0x0});});}function createAdditionalPhone(_0x6f730b,_0x31bdbc,_0x300315,_0x2de777){var _0x44e525='';var _0x1c9d80='';var _0x3fb17e=_0x300315['split']('§');_0x44e525=_0x3fb17e[0x0];if(_0x3fb17e[_0x756e('0x23')]==0x2)_0x1c9d80=_0x3fb17e[0x1];return new Promise(function(_0xf2138f,_0x2cce11){return db[_0x756e('0x25')]['findOne']({'where':{'CmContactId':_0x6f730b,'item':_0x44e525}})[_0x756e('0x1e')](function(_0x14a3ec){if(_0x14a3ec){return db['CmContactHasItem'][_0x756e('0x26')]({'ItemTypeId':_0x31bdbc,'description':_0x1c9d80,'OrderBy':_0x2de777},{'where':{'CmContactId':_0x6f730b,'item':_0x44e525}})['then'](function(_0xf2817c){_0xf2138f({'res':_0x756e('0x27')});});}else{return db[_0x756e('0x25')]['create']({'CmContactId':_0x6f730b,'item':_0x44e525,'ItemTypeId':_0x31bdbc,'description':_0x1c9d80,'OrderBy':_0x2de777,'ItemClass':_0x756e('0x28')})[_0x756e('0x1e')](function(_0x19f3cf){_0xf2138f({'res':_0x756e('0x29')});});}});});}function updateContact(_0xff5c8b){return new Promise(function(_0x1d4f20,_0x46d2b0){var _0xca2b17=_0xff5c8b['id'];delete _0xff5c8b['id'];return db[_0x756e('0x2a')][_0x756e('0x26')](_0xff5c8b,{'where':{'id':_0xca2b17}})[_0x756e('0x1e')](function(_0x47f393){updatedRows+=0x1;return db['CmHopper'][_0x756e('0x26')]({'phone':_0xff5c8b[_0x756e('0x12')]},{'where':{'ContactId':_0xca2b17}})[_0x756e('0x1e')](function(_0x55bf7c){_0x1d4f20({'ret':'OK'});});});});}function insertCmHopper(_0x2d59d4,_0x22a20b,_0x27c876,_0x3a00e7,_0xddd6b0){var _0x40d53d=[_0x756e('0x2b'),'cm_contacts.scheduledat',_0x756e('0x2c'),_0x756e('0x2d'),_0x22a20b+'.'+_0x3a00e7,_0x756e('0x2e'),'cm_contacts.updatedAt',_0x756e('0x2f'),_0x756e('0x30'),'\x22'+_0xddd6b0+'\x22'];return squel['insert']()[_0x756e('0x31')](_0x756e('0x32'))[_0x756e('0x33')](['phone',_0x756e('0x34'),_0x756e('0x35'),'ListId',_0x3a00e7,_0x756e('0x36'),'updatedAt',_0x756e('0x37'),_0x756e('0x38'),_0x756e('0x39')],squel[_0x756e('0x11')]()[_0x756e('0x3a')](_0x40d53d)['from'](_0x22a20b)[_0x756e('0x14')](_0x756e('0x3b'),null,_0x756e('0x3c')+_0x22a20b+_0x756e('0x3d'))[_0x756e('0x14')](_0x27c876,null,_0x27c876+_0x756e('0x3e')+_0x22a20b+'.'+_0x3a00e7)[_0x756e('0x15')](_0x22a20b+_0x756e('0x3f'),_0x2d59d4)[_0x756e('0x15')](_0x756e('0x40'),NOW)[_0x756e('0x15')](_0x756e('0x41'),selectNotIn(_0x22a20b,_0x27c876,_0x3a00e7,_0x756e('0x32'),[_0x756e('0x42'),_0x756e('0x43')]))[_0x756e('0x15')](_0x756e('0x41'),selectNotIn(_0x22a20b,_0x27c876,_0x3a00e7,_0x756e('0x32'),[_0x756e('0x42')])))['toString']();}function insertCmHopperBlack(_0x4c92d2,_0x4fa295,_0x4aac1e,_0x2272e2){var _0x267791=[_0x756e('0x2b'),'cm_contacts.id',_0x756e('0x2d'),_0x4fa295+'.'+_0x2272e2,_0x756e('0x2e'),_0x756e('0x44')];return squel[_0x756e('0x45')]()[_0x756e('0x31')](_0x756e('0x46'))[_0x756e('0x33')]([_0x756e('0x12'),_0x756e('0x35'),'ListId',_0x2272e2,_0x756e('0x36'),'updatedAt'],squel['select']()[_0x756e('0x3a')](_0x267791)[_0x756e('0x13')](_0x4fa295)[_0x756e('0x14')]('cm_contacts',null,_0x756e('0x3c')+_0x4fa295+'.CmListId')[_0x756e('0x14')](_0x4aac1e,null,_0x4aac1e+_0x756e('0x3e')+_0x4fa295+'.'+_0x2272e2)['where'](_0x4fa295+'.CmListId\x20=\x20?',_0x4c92d2)[_0x756e('0x15')](_0x756e('0x40'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x756e('0x11')]()['field'](_0x756e('0x12'))[_0x756e('0x13')]('cm_hopper_black')[_0x756e('0x15')](_0x756e('0x47'),_0x4c92d2)[_0x756e('0x15')](_0x2272e2+_0x756e('0x48'),_0x4fa295+'.'+_0x2272e2)))[_0x756e('0x49')]();}function insertCmHopperAdditionalPhones(_0x5973cc){var _0x2e8a49=[_0x756e('0x4a'),_0x756e('0x4b'),_0x756e('0x4c'),_0x756e('0x4d'),_0x756e('0x4e')];return squel[_0x756e('0x45')]()[_0x756e('0x31')](_0x756e('0x4f'))[_0x756e('0x33')]([_0x756e('0x50'),_0x756e('0x12'),'OrderBy',_0x756e('0x36'),_0x756e('0x51')],squel[_0x756e('0x11')]()['fields'](_0x2e8a49)[_0x756e('0x13')](_0x756e('0x32'))['join']('cm_contacts',null,_0x756e('0x52'))[_0x756e('0x14')](_0x756e('0x53'),null,_0x756e('0x54'))['where']('cm_hopper.ListId\x20=\x20?',_0x5973cc)['where'](_0x756e('0x40'),NOW))[_0x756e('0x49')]();}function insertCmContact(_0x211522,_0x4e4059,_0x169320,_0x3262f4){var _0x7f029c=_[_0x756e('0x55')](_[_0x756e('0x56')](_0x3262f4),[_0x756e('0x57'),_0x756e('0x58'),_0x756e('0x36'),_0x756e('0x51')]);return squel[_0x756e('0x45')]()[_0x756e('0x31')](_0x756e('0x3b'))[_0x756e('0x33')](_0x7f029c,squel[_0x756e('0x11')]()['fields'](_0x7f029c)[_0x756e('0x13')](_0x4e4059)[_0x756e('0x15')]('('+_0x169320[_0x756e('0x14')](',')+_0x756e('0x59'),squel[_0x756e('0x11')]()[_0x756e('0x3a')](_0x169320)['from'](_0x756e('0x3b'))[_0x756e('0x15')](_0x756e('0x47'),_0x211522))[_0x756e('0x15')](_0x756e('0x5a'),squel[_0x756e('0x11')]()['field'](_0x756e('0x5b'),'min_id')[_0x756e('0x13')](_0x4e4059)[_0x756e('0x5c')](_0x169320[_0x756e('0x14')](','))))[_0x756e('0x49')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x54874f){logger[_0x756e('0x20')](_0x54874f['message']);process[_0x756e('0x5d')](0x1);}function handleError(_0x50f835,_0x23589d){stats[_0x756e('0x5e')][_0x756e('0x1d')]({'name':_0x23589d[_0x756e('0x5f')],'message':_0x23589d[_0x756e('0x21')],'row':_0x50f835});}function handleQuery(_0x107d17){logger['info'](_0x107d17);return db[_0x756e('0x18')][_0x756e('0x19')](_0x107d17)[_0x756e('0x1b')](function(_0x3d93a0){results[_0x756e('0x1d')](_0x3d93a0);})['catch'](function(_0x41ef23){logger[_0x756e('0x20')](_0x41ef23[_0x756e('0x21')]);});}function main(_0x331e9b,_0x2e516a,_0x506fc7,_0x2619c3){logger[_0x756e('0x60')](_0x756e('0x61'),_0x331e9b,JSON[_0x756e('0x62')](_0x2e516a));process['send']('start');var _0x46df0d=_0x2e516a['binding'];var _0x4e6945=_[_0x756e('0x63')](_0x46df0d);var _0x539e79=_0x2e516a['socket_timestamp'];var _0x3c5b9f=path[_0x756e('0x14')](config[_0x756e('0x64')],_0x756e('0x65'),_0x539e79+_0x756e('0x66'));logger[_0x756e('0x60')]('body',_0x2e516a);db[_0x756e('0x67')]['findAll']({'raw':!![],'attributes':['id',_0x756e('0x68')]})[_0x756e('0x1e')](function(_0x4b7b83){for(var _0x200e50=0x0;_0x200e50<_0x4b7b83[_0x756e('0x23')];_0x200e50++){if(_0x4b7b83[_0x200e50]['name']in _0x46df0d){contactItemTypes[_0x756e('0x1d')](_0x4b7b83[_0x200e50]);delete _0x4e6945[_0x4b7b83[_0x200e50][_0x756e('0x68')]];hasAdditionalPhones=!![];}for(var _0x5e99fa in _0x46df0d){if(_0x4b7b83[_0x200e50]['name']+_0x756e('0x69')===_0x5e99fa){phoneDescriptions[_0x756e('0x1d')]({'itemTypeId':_0x4b7b83[_0x200e50]['id'],'description':_0x5e99fa});delete _0x4e6945[_0x5e99fa];}}}if(hasAdditionalPhones)_0x4e6945[_0x756e('0x6a')]='';var _0xc76a02=_[_0x756e('0x56')](_0x4e6945)[_0x756e('0x14')]();logger[_0x756e('0x60')](_0x756e('0x6b'),_0xc76a02);fs[_0x756e('0x6c')](_0x3c5b9f,_0xc76a02+'\x0a');Papa[_0x756e('0x6d')](fs[_0x756e('0x6e')](_0x331e9b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x28bd49,_0x100fa0){try{for(var _0x4a7832=0x0,_0x30ab80=[];_0x4a7832<_0x28bd49[_0x756e('0x6f')][_0x756e('0x23')];_0x4a7832++){stats['rows']+=0x1;if(_0x28bd49[_0x756e('0x5e')][_0x4a7832]){handleError(_0x28bd49['data'][_0x4a7832],_0x28bd49[_0x756e('0x5e')][_0x4a7832]);}else{var _0x5cd21a=[];var _0x3b32c0=[];var _0x124c5={};for(var _0x313559 in _0x46df0d){let _0x2bcd62=contactItemTypes[_0x756e('0x70')](_0x319c8b=>_0x319c8b['name']===_0x313559);let _0x1860da=contactItemTypes['find'](_0x4ac3d1=>_0x4ac3d1[_0x756e('0x68')]+_0x756e('0x69')===_0x313559);if(_[_0x756e('0x1c')](_0x2bcd62)&&_[_0x756e('0x1c')](_0x1860da)){if(_0x46df0d[_0x756e('0x71')](_0x313559)){if(_0x28bd49['data'][_0x4a7832][_0x46df0d[_0x313559]]){var _0x52d428=_['trim'](_0x28bd49[_0x756e('0x6f')][_0x4a7832][_0x46df0d[_0x313559]]['replace'](/"/g,'\x27'));switch(_0x313559){case _0x756e('0x34'):var _0x4d57c9=moment(_0x52d428,_0x756e('0x72'),!![]);if(_0x4d57c9[_0x756e('0x73')]()){_0x30ab80[_0x756e('0x1d')]('\x22'+_0x52d428+'\x22');}else{_0x5cd21a[_0x756e('0x1d')](_0x756e('0x74'));}break;case'priority':var _0x4b8e0b=parseInt(_0x52d428);_0x52d428=_[_0x756e('0x75')](_0x4b8e0b)||_0x4b8e0b<0x0||_0x4b8e0b>0x4?_0x2619c3?0x3:0x2:_0x4b8e0b;_0x30ab80[_0x756e('0x1d')]('\x22'+_0x52d428+'\x22');break;case'UserId':var _0x2a422e=parseInt(_0x52d428);if(_[_0x756e('0x76')](_0x2a422e)&&_[_0x756e('0x77')](_0x506fc7,_0x2a422e)){_0x30ab80['push']('\x22'+_0x2a422e+'\x22');}else{_0x5cd21a['push'](_0x756e('0x78'));}break;case _0x756e('0x79'):if(isEmail(_0x52d428)){_0x30ab80['push']('\x22'+_0x52d428+'\x22');}else{_0x5cd21a[_0x756e('0x1d')](_0x756e('0x7a'));}break;case _0x756e('0x7b'):var _0x4fdc3e=moment(_0x52d428,'YYYY-MM-DD',!![]);if(_0x4fdc3e[_0x756e('0x73')]()){_0x30ab80[_0x756e('0x1d')]('\x22'+_0x52d428+'\x22');}else{_0x5cd21a[_0x756e('0x1d')](_0x756e('0x7c'));}break;default:_0x30ab80[_0x756e('0x1d')]('\x22'+_0x52d428+'\x22');}}else{switch(_0x313559){case _0x756e('0x7d'):case _0x756e('0x12'):_0x5cd21a['push'](_0x313559+_0x756e('0x7e'));break;default:_0x30ab80[_0x756e('0x1d')]('\x22\x22');}}}}else{var _0x5d9e69='';if(!_[_0x756e('0x1c')](_0x2bcd62)){if(!_0x124c5[_0x756e('0x71')](_0x2bcd62['id'])){for(var _0x16aad5=0x0;_0x16aad5<_0x46df0d[_0x313559][_0x756e('0x23')];_0x16aad5++){var _0x52d428=_[_0x756e('0x7f')](_0x28bd49[_0x756e('0x6f')][_0x4a7832][_0x46df0d[_0x313559][_0x16aad5]]['replace'](/"/g,'\x27'));var _0x55049b=phoneDescriptions[_0x756e('0x70')](_0x1a008f=>_0x1a008f[_0x756e('0x80')]===_0x2bcd62['id']);if(!_[_0x756e('0x1c')](_0x55049b)){var _0x1d0971=_[_0x756e('0x7f')](_0x28bd49['data'][_0x4a7832][_0x46df0d[_0x55049b['description']][0x0]][_0x756e('0x81')](/"/g,'\x27'));if(!_[_0x756e('0x1c')](_0x1d0971))_0x52d428=_0x52d428+'§'+_0x1d0971;}if(_0x5d9e69=='')_0x5d9e69=_0x52d428;else _0x5d9e69+='|'+_0x52d428;}_0x3b32c0[_0x756e('0x1d')](_0x2bcd62['id']+':'+_0x5d9e69);_0x124c5[_0x2bcd62['id']]=0x1;}}}}if(hasAdditionalPhones){_0x30ab80[_0x756e('0x1d')]('\x22'+_0x3b32c0['join'](';')+'\x22');}if(_0x5cd21a[_0x756e('0x23')]){handleError(_0x28bd49[_0x756e('0x6f')][_0x4a7832],{'code':_0x756e('0x82'),'message':_0x5cd21a[_0x756e('0x14')]()});}else{fs[_0x756e('0x83')](_0x3c5b9f,_0x30ab80['join']()+'\x0a');}_0x30ab80=[];}if(!(stats[_0x756e('0x84')]%0xc8)){socket[_0x756e('0x85')]('contact:import:'+_0x539e79,stats);stats[_0x756e('0x5e')]=[];}}if(stopped){logger[_0x756e('0x60')](_0x756e('0x86'));_0x100fa0[_0x756e('0x87')]();}}catch(_0x4bf392){handleError(_0x28bd49[_0x756e('0x6f')][_0x4a7832],{'code':_0x756e('0x88'),'message':_0x4bf392[_0x756e('0x21')]});logger[_0x756e('0x20')](_0x756e('0x89'),_0x4bf392['message']);}},'complete':function(){try{var _0x26e64d=[];var _0x440210=tempTableName;_0x26e64d[_0x756e('0x1d')](_0x756e('0x8a')+_0x440210+_0x756e('0x8b'));logger[_0x756e('0x60')](_0x756e('0x8c'),contactItemTypes[_0x756e('0x23')]);var _0x37637a=util['format'](_0x756e('0x8d'),_0x3c5b9f,_0x440210,_0xc76a02,_0x2e516a[_0x756e('0x57')],_0x2e516a['CompanyId']||null,NOW,NOW);if(_[_0x756e('0x1c')](_0x46df0d[_0x756e('0x34')])){_0x37637a+=_0x756e('0x8e');}_0x26e64d[_0x756e('0x1d')](_0x37637a);BPromise[_0x756e('0x8f')](_0x26e64d,handleQuery)[_0x756e('0x1e')](function(_0x4e6a23){BPromise[_0x756e('0x22')]([handleAdditionalPhones()])[_0x756e('0x1e')](function(){_0x26e64d=[];for(var _0x706a21=0x0;_0x706a21\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','c.firstName','Contact.firstName','c.lastName','Contact.email','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','TagIds','limit','offset','groupBy','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','QueryTypes','exports','../parsers/advancedSearch','./update-interaction','updateInteraction','../../mysqldb','getAccountFK','agent','search','select','field','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','me.','interactionsTags','it.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','unreadMessages\x20{OPERATOR}\x200','{OPERATOR}','replace','isNumeric','sms','whatsapp','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','buildExpression','type','text','value','start','end','unreadMessages','read','Contact','operator','$substring','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','tags','clause','and','ids','User','user','UserId','body','plainBody','keys','compact','forEach','concat','createdAt','$gte'];(function(_0x33bcdb,_0x11846b){var _0x18a9bf=function(_0x34417a){while(--_0x34417a){_0x33bcdb['push'](_0x33bcdb['shift']());}};_0x18a9bf(++_0x11846b);}(_0x7341,0xe4));var _0x1734=function(_0x446399,_0xf73169){_0x446399=_0x446399-0x0;var _0x7a8c65=_0x7341[_0x446399];return _0x7a8c65;};'use strict';var _=require('lodash');var squel=require('squel');var as=require(_0x1734('0x0'));var qs=require('../parsers/qs');var updateInteraction=require(_0x1734('0x1'))[_0x1734('0x2')];var utils=require('./utils');var db=require(_0x1734('0x3'))['db'];function skipInteractionsQuery(_0x42c26d,_0x3010fd,_0x17c3d7){var _0x2de514=![];var _0x21efd9=utils[_0x1734('0x4')](_0x42c26d);if(_0x3010fd['role']===_0x1734('0x5')&&!_0x17c3d7[_0x1734('0x6')]&&!_0x17c3d7[_0x21efd9]){_0x2de514=!![];}return _0x2de514;}function getTagsQuery(){return squel[_0x1734('0x7')]()['field']('id')[_0x1734('0x8')]('name')['field'](_0x1734('0x9'))[_0x1734('0xa')](_0x1734('0xb'));}function getUsersQuery(_0x23d8d2,_0x16a4ff){var _0x22afe0=utils[_0x1734('0xc')](_0x23d8d2);var _0x24c9b7=_0x1734('0xd')+_0x23d8d2+_0x1734('0xe');var _0x59830b=squel[_0x1734('0x7')]()[_0x1734('0x8')](_0x1734('0xf'))[_0x1734('0x8')](_0x1734('0x10'))[_0x1734('0x8')](_0x1734('0x11')+_0x22afe0)[_0x1734('0xa')](_0x24c9b7,'ui')[_0x1734('0x12')](_0x1734('0x13'),'u',_0x1734('0x14'));if(_0x16a4ff[_0x1734('0x15')]>0x0){_0x59830b[_0x1734('0x16')](_0x1734('0x11')+_0x22afe0+_0x1734('0x17'),_[_0x1734('0x18')](_0x16a4ff,'id'));}return _0x59830b;}function getInteractionsQuery(_0x2b375d){var _0x1ea188=utils[_0x1734('0x19')](_0x2b375d);var _0x56756c=utils['getAccountFK'](_0x2b375d);var _0x1fa9c0=utils[_0x1734('0xc')](_0x2b375d);return squel['select']()[_0x1734('0xa')](_0x1ea188['interactions'],'i')['left_join']('cm_contacts','c',_0x1734('0x1a'))['left_join'](_0x1734('0x13'),'o',_0x1734('0x1b'))['left_join'](_0x1ea188['accounts'],'a','a.id\x20=\x20i.'+_0x56756c)[_0x1734('0x12')](_0x1ea188['messages'],'me',_0x1734('0x1c')+_0x1fa9c0+'\x20=\x20i.id')[_0x1734('0x12')](_0x1ea188[_0x1734('0x1d')],'it',_0x1734('0x1e')+_0x1fa9c0+_0x1734('0x1f'))[_0x1734('0x12')](_0x1734('0xb'),'t',_0x1734('0x20'));}function getSqlClauses(){var _0x44e420={'body':squel[_0x1734('0x21')](),'contact':squel['expr'](),'default':squel[_0x1734('0x21')](),'fields':squel['expr'](),'filter':squel['expr'](),'read':squel[_0x1734('0x21')](),'tags':{'clause':squel[_0x1734('0x21')](),'ids':null},'user':squel[_0x1734('0x21')]()};return _0x44e420;}function parseTagParameter(_0x157e35){var _0x4435ac=squel[_0x1734('0x21')]();if(_0x157e35){var _0x3616c1=utils[_0x1734('0x22')](_0x157e35);_0x3616c1['forEach'](function(_0x381960){_0x4435ac['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x381960+',%');});}return _0x4435ac;}function parseReadParameter(_0x17e068){var _0x16a35f='';if(_0x17e068){_0x16a35f=_0x1734('0x23');if(_0x17e068==='1'){_0x16a35f=_0x16a35f['replace'](_0x1734('0x24'),'=');}else{_0x16a35f=_0x16a35f[_0x1734('0x25')](_0x1734('0x24'),'>');}}return _0x16a35f;}function parseSearchFilter(_0x50efce,_0x2b1352){var _0xb5e574=squel['expr']();if(_0x2b1352){var _0x1bd659=_0x2b1352[_0x1734('0x25')]('\x5c','\x5c\x5c')[_0x1734('0x25')](/'/g,'\x27\x27');if(qs[_0x1734('0x26')](_0x1bd659)){_0xb5e574['or']('i.id\x20LIKE\x20?',_0x1bd659+'%');if([_0x1734('0x27'),_0x1734('0x28')]['includes'](_0x50efce)){_0xb5e574['or']('i.phone\x20LIKE\x20?',_0x1bd659+'%');}else if(_0x50efce===_0x1734('0x29')){_0xb5e574['or'](_0x1734('0x2a'),_0x1bd659+'%');}else if(_0x50efce===_0x1734('0x2b')){_0xb5e574['or'](_0x1734('0x2c'),_0x1bd659+'%');}}else if(_0x50efce===_0x1734('0x2d')&&qs[_0x1734('0x2e')](_0x1bd659)){_0xb5e574['or'](_0x1734('0x2f'),_0x1bd659+'%');}else{if(_0x50efce===_0x1734('0x2d')){_0xb5e574['or'](_0x1734('0x30'),qs[_0x1734('0x31')](_0x1bd659))['or'](_0x1734('0x32'),qs[_0x1734('0x31')](_0x1bd659));}else{if(_0x50efce!==_0x1734('0x29')){_0xb5e574['or'](_0x1734('0x33'),qs[_0x1734('0x31')](_0x1bd659));}_0xb5e574['or'](_0x1734('0x34'),_0x1bd659+'%');}}}return _0xb5e574;}function parseAdvancedSearchFilter(_0x1e9d12,_0x5d26dc){var _0x1e7134=getSqlClauses();var _0x4ab5b2=as[_0x1734('0x35')](_0x1e9d12);var _0x462373=_0x4ab5b2[_0x1734('0x36')];for(var _0x21a855=0x0;_0x21a855<_0x4ab5b2[_0x1734('0x37')][_0x1734('0x15')];_0x21a855++){var _0x14760f=_0x4ab5b2[_0x1734('0x37')][_0x21a855];var _0x546af1='i';var _0x16475d=_[_0x1734('0x38')](_0x5d26dc,[_0x1734('0x39'),_0x14760f[_0x1734('0x8')]]);if(_0x16475d){var _0x30817d=as[_0x1734('0x3a')](_0x546af1,_0x16475d[_0x1734('0x3b')],_0x14760f);_0x1e7134['default'][_0x462373](_0x30817d[_0x1734('0x3c')],_0x30817d[_0x1734('0x3d')][_0x1734('0x3e')],_0x30817d[_0x1734('0x3d')][_0x1734('0x3f')]);}else{switch(_0x14760f[_0x1734('0x8')]){case _0x1734('0x40'):var _0x4680d1=parseReadParameter(_0x14760f['value']);_0x1e7134[_0x1734('0x41')]['and'](_0x4680d1);break;case _0x1734('0x42'):if(_0x14760f[_0x1734('0x43')]===_0x1734('0x44')){if(_0x14760f[_0x1734('0x3d')][_0x1734('0x45')]('\x20')[_0x1734('0x15')]>0x1){_0x1e7134[_0x1734('0x46')][_0x462373](_0x1734('0x47'),qs[_0x1734('0x31')](_0x14760f[_0x1734('0x3d')]),null);}else{var _0x453bf5='%'+_0x14760f['value']+'%';_0x1e7134[_0x1734('0x46')][_0x462373](_0x1734('0x48'),_0x453bf5,_0x453bf5,_0x453bf5);}}else{_0x16475d=_[_0x1734('0x38')](_0x5d26dc,[_0x1734('0x39'),'ContactId']);_0x14760f[_0x1734('0x8')]='ContactId';_0x30817d=as['buildExpression'](_0x546af1,_0x16475d[_0x1734('0x3b')],_0x14760f);_0x1e7134[_0x1734('0x46')][_0x462373](_0x30817d[_0x1734('0x3c')],_0x30817d[_0x1734('0x3d')]['start'],_0x30817d[_0x1734('0x3d')][_0x1734('0x3f')]);}break;case'Tag':var _0x1e8e71=_0x14760f[_0x1734('0x3d')]['split'](',')[_0x1734('0x18')](function(_0x4bfc67){return Number(_0x4bfc67);});var _0x9f585d=parseTagParameter(_0x1e8e71);_0x1e7134[_0x1734('0x49')][_0x1734('0x4a')][_0x1734('0x4b')](_0x9f585d);_0x1e7134[_0x1734('0x49')][_0x1734('0x4c')]=_0x1e8e71;break;case _0x1734('0x4d'):if(_0x14760f['operator']===_0x1734('0x44')){_0x1e7134[_0x1734('0x4e')][_0x462373]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x14760f[_0x1734('0x3d')]+'%',null);}else{_0x16475d=_[_0x1734('0x38')](_0x5d26dc,[_0x1734('0x39'),_0x1734('0x4f')]);_0x14760f['field']=_0x1734('0x4f');_0x30817d=as[_0x1734('0x3a')](_0x546af1,_0x16475d[_0x1734('0x3b')],_0x14760f);_0x1e7134['user'][_0x462373](_0x30817d[_0x1734('0x3c')],_0x30817d[_0x1734('0x3d')][_0x1734('0x3e')],_0x30817d[_0x1734('0x3d')][_0x1734('0x3f')]);}break;case _0x1734('0x50'):case _0x1734('0x51'):_0x30817d=as[_0x1734('0x3a')]('me',null,_0x14760f);_0x1e7134[_0x1734('0x50')][_0x462373](_0x30817d[_0x1734('0x3c')],_0x30817d[_0x1734('0x3d')][_0x1734('0x3e')],_0x30817d[_0x1734('0x3d')][_0x1734('0x3f')]);break;}}}return _0x1e7134;}function parseModelFields(_0x470110,_0x121c8c,_0x255b75){var _0x1b4ea1=utils['getAccountFK'](_0x470110);var _0xe8e0b8=squel['expr']();var _0xfc42f3=_(_0x121c8c)[_0x1734('0x52')]()[_0x1734('0x18')](function(_0x2aaa6e){return _['some'](_0x255b75,['name',_0x2aaa6e])?_0x2aaa6e:undefined;})[_0x1734('0x53')]()[_0x1734('0x3d')]();if(_0xfc42f3['length']>0x0){_0xfc42f3[_0x1734('0x54')](function(_0x1c5d2f){if(_0x1c5d2f===_0x1b4ea1){_0xe8e0b8[_0x1734('0x4b')]('i.'+_0x1b4ea1+_0x1734('0x17'),[][_0x1734('0x55')](_0x121c8c[_0x1c5d2f]));}else if(_0x1c5d2f===_0x1734('0x56')){var _0x1c27e6=JSON['parse'](_0x121c8c[_0x1c5d2f])[_0x1734('0x57')];var _0x466899=JSON[_0x1734('0x58')](_0x121c8c[_0x1c5d2f])['$lte'];_0xe8e0b8[_0x1734('0x4b')](_0x1734('0x59'),_0x1c27e6,_0x466899);}else{if(_0x121c8c[_0x1c5d2f]===_0x1734('0x5a')){_0xe8e0b8[_0x1734('0x4b')]('i.'+_0x1c5d2f+'\x20IS\x20NULL');}else{_0xe8e0b8[_0x1734('0x4b')]('i.'+_0x1c5d2f+_0x1734('0x5b'),_0x121c8c[_0x1c5d2f]);}}});}return _0xe8e0b8;}function parseQueryParameters(_0x19ceed,_0xac0441,_0x33b805){var _0x529b8a=getSqlClauses();return Promise[_0x1734('0x5c')]()['then'](function(){return parseModelFields(_0x19ceed,_0xac0441,_0x33b805);})['then'](function(_0x456808){_0x529b8a[_0x1734('0x5d')]['and'](_0x456808);return parseReadParameter(_0xac0441['read']);})[_0x1734('0x5e')](function(_0x30bc47){_0x529b8a['read']['and'](_0x30bc47);return parseTagParameter(_0xac0441['tag']);})[_0x1734('0x5e')](function(_0x6fbdf0){_0x529b8a[_0x1734('0x49')][_0x1734('0x4a')]['and'](_0x6fbdf0);return parseSearchFilter(_0x19ceed,_0xac0441['filter']);})[_0x1734('0x5e')](function(_0x7872f5){_0x529b8a['filter']=_0x7872f5;return _0x529b8a;});}function checkAccountsRestrictions(_0x349b6a,_0x192951,_0x1cbeb4){var _0x553daf=utils[_0x1734('0x4')](_0x349b6a);var _0x371a48=_0x1734('0x5f')+_[_0x1734('0x60')](_0x349b6a)+(_0x349b6a===_0x1734('0x61')?_0x1734('0x62'):_0x1734('0x63'));var _0x2491eb=squel[_0x1734('0x21')]();return Promise['resolve']()[_0x1734('0x5e')](function(){if(_0x1cbeb4[_0x1734('0x6')]&&_0x192951[_0x1734('0x64')]===_0x1734('0x5')){return _0x192951[_0x371a48]({'attributes':['id'],'raw':!![]});}})[_0x1734('0x5e')](function(_0x3d04df){if(_0x3d04df){if(_0x3d04df[_0x1734('0x15')]===0x0){_0x2491eb[_0x1734('0x4b')]('i.'+_0x553daf+_0x1734('0x65'));}else{_0x2491eb[_0x1734('0x4b')]('i.'+_0x553daf+_0x1734('0x17'),_['map'](_0x3d04df,'id'));}}else if(!_0x1cbeb4[_0x553daf]){_0x2491eb[_0x1734('0x4b')]('i.'+_0x553daf+_0x1734('0x66'));}})[_0x1734('0x5e')](function(){return _0x2491eb;});}function getClosedOrderClause(_0x1e646d,_0x112265){var _0xa43585='';var _0x3ba5d2=['i.thirdDisposition',_0x1734('0x67'),'i.disposition'];if(_0x1e646d===_0x1734('0x2d')){_0x3ba5d2[_0x1734('0x68')](_0x1734('0x69'));}if(_0x112265[_0x1734('0x6a')]==='0'&&_0x1e646d==='mail'){_0xa43585='i.substatus';}else{if(_0x112265[_0x1734('0x6a')]==='1'){_0x3ba5d2['shift']();}_0xa43585=_0x1734('0x6b')+_0x3ba5d2[_0x1734('0x6c')](',\x20')+')';}return _0xa43585;}function getFilteredInteractions(_0x1590ab,_0x3ce57f,_0x532c6a,_0x586418){var _0x52e5e2=utils[_0x1734('0xc')](_0x1590ab);var _0x314023=_[_0x1734('0x60')](_0x1590ab)+_0x1734('0x6d');var _0x387aac=[];var _0x2303d2=getTagsQuery();var _0x17c177={'type':db[_0x1734('0x6e')]['QueryTypes'][_0x1734('0x6f')],'raw':!![]};var _0x4fd501=[];var _0x5dc7ba=[];return db[_0x1734('0x70')][_0x1734('0x71')](_0x2303d2[_0x1734('0x72')](),_0x17c177)['then'](function(_0x3220b2){_0x387aac=_[_0x1734('0x73')](_0x3220b2,'id');_0x17c177=_['merge'](_0x17c177,{'model':db[_0x314023],'mapToModel':!![],'nest':!![]});if(_0x532c6a[_0x1734('0x5d')]){_0x586418[_0x1734('0x74')][_0x1734('0x54')](function(_0x18d421){_0x3ce57f[_0x1734('0x8')]('i.'+_0x18d421);});}else{_0x3ce57f['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x3ce57f['field'](_0x1734('0x75'),'Account.key');_0x3ce57f[_0x1734('0x8')](_0x1734('0x76'),_0x1734('0x77'));if(_0x1590ab===_0x1734('0x2d')){_0x3ce57f[_0x1734('0x8')](_0x1734('0x78'),_0x1734('0x79'));_0x3ce57f[_0x1734('0x8')]('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',_0x1734('0x7a'));_0x3ce57f['field'](_0x1734('0x7b'));_0x3ce57f[_0x1734('0x8')]('i.createdAt');_0x3ce57f[_0x1734('0x8')](_0x1734('0x7c'));_0x3ce57f['field']('i.closed');_0x3ce57f[_0x1734('0x8')](_0x1734('0x7d'));_0x3ce57f[_0x1734('0x8')](_0x1734('0x7e'));_0x3ce57f['field'](_0x1734('0x7f'));_0x3ce57f['field'](_0x1734('0x80'));_0x3ce57f[_0x1734('0x8')]('i.subject');_0x3ce57f['field'](_0x1734('0x81'));_0x3ce57f[_0x1734('0x8')](_0x1734('0x67'));_0x3ce57f[_0x1734('0x8')](_0x1734('0x82'));_0x3ce57f[_0x1734('0x8')]('i.substatus');_0x3ce57f[_0x1734('0x8')]('i.to');_0x3ce57f['field'](_0x1734('0x83'));_0x3ce57f[_0x1734('0x8')](_0x1734('0x84'));_0x3ce57f[_0x1734('0x8')](_0x1734('0x85'));}else if(_0x1590ab==='openchannel'){_0x3ce57f[_0x1734('0x8')](_0x1734('0x86'),_0x1734('0x7a'));}else{_0x3ce57f[_0x1734('0x8')](_0x1734('0x87'),_0x1734('0x7a'));}if(_0x1590ab!==_0x1734('0x2d')){_0x3ce57f[_0x1734('0x8')]('i.*');}_0x3ce57f[_0x1734('0x8')](_0x1734('0x88'),_0x1734('0x89'));_0x3ce57f[_0x1734('0x8')](_0x1734('0x8a'),'Contact.lastName');_0x3ce57f['field']('c.email',_0x1734('0x8b'));_0x3ce57f['field']('c.phone',_0x1734('0x8c'));_0x3ce57f[_0x1734('0x8')](_0x1734('0x8d'),'Contact.mobile');_0x3ce57f['field'](_0x1734('0x8e'),'Contact.fax');_0x3ce57f['field'](_0x1734('0x8f'),_0x1734('0x90'));_0x3ce57f[_0x1734('0x8')](_0x1734('0x91'),'Owner.internal');_0x3ce57f[_0x1734('0x8')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x1734('0x92'));}if(_0x586418['limit']){_0x3ce57f[_0x1734('0x93')](_0x586418[_0x1734('0x93')]);}if(_0x586418[_0x1734('0x94')]){_0x3ce57f[_0x1734('0x94')](_0x586418[_0x1734('0x94')]);}return db['sequelize']['query'](_0x3ce57f[_0x1734('0x72')](),_0x17c177);})[_0x1734('0x5e')](function(_0x4054ed){_0x4fd501=_0x4054ed;var _0x21d2e6=getUsersQuery(_0x1590ab,_0x4fd501);return db[_0x1734('0x70')][_0x1734('0x71')](_0x21d2e6[_0x1734('0x72')](),_0x17c177);})[_0x1734('0x5e')](function(_0x548f62){_0x5dc7ba=_[_0x1734('0x95')](_0x548f62,_0x52e5e2);if(_0x1590ab===_0x1734('0x2d')){return db['Setting']['findOne']({'attributes':[_0x1734('0x96')],'raw':!![]});}})[_0x1734('0x5e')](function(_0x197449){var _0x3d3e82=_0x197449?_0x197449[_0x1734('0x96')]:undefined;var _0x1220f5=_0x4fd501[_0x1734('0x18')](function(_0x2185d8){return updateInteraction(_0x2185d8,_0x387aac,_0x5dc7ba,_0x3d3e82);});return Promise[_0x1734('0x97')](_0x1220f5);});}function countFilteredInteractions(_0x3af073,_0x37fc5d){var _0x300a8d=_0x3af073[_0x1734('0x98')]();_0x300a8d[_0x1734('0x8')](_0x1734('0x99'));_0x300a8d[_0x1734('0x8')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1734('0x40'));var _0x3d4830=utils[_0x1734('0x22')](_0x37fc5d);if(!_[_0x1734('0x9a')](_0x3d4830)){_0x300a8d[_0x1734('0x16')](_0x1734('0x9b'),_0x3d4830);}var _0xd39881={'type':db[_0x1734('0x6e')][_0x1734('0x9c')][_0x1734('0x6f')],'raw':!![]};return db['sequelize'][_0x1734('0x71')](_0x300a8d[_0x1734('0x72')](),_0xd39881);}module[_0x1734('0x9d')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x0c02=['accounts','a.id\x20=\x20i.','messages','me.','interactionsTags','it.','\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','openchannel','i.from\x20LIKE\x20?','mail','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','buildExpression','default','value','start','end','unreadMessages','read','and','Contact','operator','$substring','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','split','tags','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','body','some','compact','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','then','tag','filter','get','capitalize','chat','Websites','Accounts','resolve','search','agent','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','Sequelize','QueryTypes','sequelize','query','toString','merge','fields','attributes','Account.mandatoryDisposition','a.email','Account.email','contactName','i.id','i.updatedAt','i.closed','i.attach','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','Setting','enableEmailPreview','clone','SELECT','exports','squel','../parsers/advancedSearch','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','field','name','color','from','user_has_','_interactions','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','select','interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var squel=require(_0x20c0('0x0'));var as=require(_0x20c0('0x1'));var qs=require('../parsers/qs');var updateInteraction=require(_0x20c0('0x2'))[_0x20c0('0x3')];var utils=require(_0x20c0('0x4'));var db=require(_0x20c0('0x5'))['db'];function skipInteractionsQuery(_0x38022e,_0x2e9d65,_0x2afa72){var _0x1474f7=![];var _0x13312d=utils[_0x20c0('0x6')](_0x38022e);if(_0x2e9d65['role']==='agent'&&!_0x2afa72['search']&&!_0x2afa72[_0x13312d]){_0x1474f7=!![];}return _0x1474f7;}function getTagsQuery(){return squel['select']()[_0x20c0('0x7')]('id')[_0x20c0('0x7')](_0x20c0('0x8'))[_0x20c0('0x7')](_0x20c0('0x9'))[_0x20c0('0xa')]('tools_tags');}function getUsersQuery(_0x506a6c,_0x52eb0d){var _0x578592=utils['getInteractionFK'](_0x506a6c);var _0x2f82ed=_0x20c0('0xb')+_0x506a6c+_0x20c0('0xc');var _0x207b1e=squel['select']()[_0x20c0('0x7')]('u.id')['field'](_0x20c0('0xd'))[_0x20c0('0x7')](_0x20c0('0xe')+_0x578592)[_0x20c0('0xa')](_0x2f82ed,'ui')[_0x20c0('0xf')](_0x20c0('0x10'),'u',_0x20c0('0x11'));if(_0x52eb0d[_0x20c0('0x12')]>0x0){_0x207b1e[_0x20c0('0x13')]('ui.'+_0x578592+_0x20c0('0x14'),_[_0x20c0('0x15')](_0x52eb0d,'id'));}return _0x207b1e;}function getInteractionsQuery(_0x1a708e){var _0x46b9e5=utils[_0x20c0('0x16')](_0x1a708e);var _0xeff5b9=utils['getAccountFK'](_0x1a708e);var _0x55de3b=utils['getInteractionFK'](_0x1a708e);return squel[_0x20c0('0x17')]()[_0x20c0('0xa')](_0x46b9e5[_0x20c0('0x18')],'i')[_0x20c0('0xf')]('cm_contacts','c',_0x20c0('0x19'))[_0x20c0('0xf')](_0x20c0('0x10'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x46b9e5[_0x20c0('0x1a')],'a',_0x20c0('0x1b')+_0xeff5b9)[_0x20c0('0xf')](_0x46b9e5[_0x20c0('0x1c')],'me',_0x20c0('0x1d')+_0x55de3b+'\x20=\x20i.id')[_0x20c0('0xf')](_0x46b9e5[_0x20c0('0x1e')],'it',_0x20c0('0x1f')+_0x55de3b+_0x20c0('0x20'))['left_join'](_0x20c0('0x21'),'t',_0x20c0('0x22'));}function getSqlClauses(){var _0x2447e6={'body':squel[_0x20c0('0x23')](),'contact':squel[_0x20c0('0x23')](),'default':squel[_0x20c0('0x23')](),'fields':squel[_0x20c0('0x23')](),'filter':squel['expr'](),'read':squel[_0x20c0('0x23')](),'tags':{'clause':squel[_0x20c0('0x23')](),'ids':null},'user':squel[_0x20c0('0x23')]()};return _0x2447e6;}function parseTagParameter(_0x31565b){var _0x11da5a=squel[_0x20c0('0x23')]();if(_0x31565b){var _0x55684b=utils['getSelectedTags'](_0x31565b);_0x55684b[_0x20c0('0x24')](function(_0x198bdd){_0x11da5a['or'](_0x20c0('0x25'),'%,'+_0x198bdd+',%');});}return _0x11da5a;}function parseReadParameter(_0x5b863b){var _0xa24196='';if(_0x5b863b){_0xa24196=_0x20c0('0x26');if(_0x5b863b==='1'){_0xa24196=_0xa24196[_0x20c0('0x27')](_0x20c0('0x28'),'=');}else{_0xa24196=_0xa24196['replace']('{OPERATOR}','>');}}return _0xa24196;}function parseSearchFilter(_0x29d8ee,_0x11f405){var _0x3edc22=squel[_0x20c0('0x23')]();if(_0x11f405){var _0x3055e9=_0x11f405[_0x20c0('0x27')]('\x5c','\x5c\x5c')[_0x20c0('0x27')](/'/g,'\x27\x27');if(qs[_0x20c0('0x29')](_0x3055e9)){_0x3edc22['or'](_0x20c0('0x2a'),_0x3055e9+'%');if([_0x20c0('0x2b'),_0x20c0('0x2c')][_0x20c0('0x2d')](_0x29d8ee)){_0x3edc22['or'](_0x20c0('0x2e'),_0x3055e9+'%');}else if(_0x29d8ee===_0x20c0('0x2f')){_0x3edc22['or']('i.fax\x20LIKE\x20?',_0x3055e9+'%');}else if(_0x29d8ee===_0x20c0('0x30')){_0x3edc22['or'](_0x20c0('0x31'),_0x3055e9+'%');}}else if(_0x29d8ee===_0x20c0('0x32')&&qs[_0x20c0('0x33')](_0x3055e9)){_0x3edc22['or']('c.email\x20LIKE\x20?',_0x3055e9+'%');}else{if(_0x29d8ee===_0x20c0('0x32')){_0x3edc22['or'](_0x20c0('0x34'),qs[_0x20c0('0x35')](_0x3055e9))['or'](_0x20c0('0x36'),qs[_0x20c0('0x35')](_0x3055e9));}else{if(_0x29d8ee!=='fax'){_0x3edc22['or'](_0x20c0('0x37'),qs['getFullTextValue'](_0x3055e9));}_0x3edc22['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3055e9+'%');}}}return _0x3edc22;}function parseAdvancedSearchFilter(_0x394e6f,_0x1b1b31){var _0x3b334a=getSqlClauses();var _0x37714d=as[_0x20c0('0x38')](_0x394e6f);var _0x39fd84=_0x37714d[_0x20c0('0x39')];for(var _0x4c8400=0x0;_0x4c8400<_0x37714d['conditions']['length'];_0x4c8400++){var _0x129eb5=_0x37714d[_0x20c0('0x3a')][_0x4c8400];var _0x545b39='i';var _0x346a04=_[_0x20c0('0x3b')](_0x1b1b31,['name',_0x129eb5['field']]);if(_0x346a04){var _0x700675=as[_0x20c0('0x3c')](_0x545b39,_0x346a04['type'],_0x129eb5);_0x3b334a[_0x20c0('0x3d')][_0x39fd84](_0x700675['text'],_0x700675[_0x20c0('0x3e')][_0x20c0('0x3f')],_0x700675[_0x20c0('0x3e')][_0x20c0('0x40')]);}else{switch(_0x129eb5['field']){case _0x20c0('0x41'):var _0x1f7a34=parseReadParameter(_0x129eb5[_0x20c0('0x3e')]);_0x3b334a[_0x20c0('0x42')][_0x20c0('0x43')](_0x1f7a34);break;case _0x20c0('0x44'):if(_0x129eb5[_0x20c0('0x45')]===_0x20c0('0x46')){if(_0x129eb5['value']['split']('\x20')['length']>0x1){_0x3b334a[_0x20c0('0x47')][_0x39fd84]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x20c0('0x35')](_0x129eb5[_0x20c0('0x3e')]),null);}else{var _0x88863='%'+_0x129eb5[_0x20c0('0x3e')]+'%';_0x3b334a['contact'][_0x39fd84](_0x20c0('0x48'),_0x88863,_0x88863,_0x88863);}}else{_0x346a04=_['find'](_0x1b1b31,['name',_0x20c0('0x49')]);_0x129eb5[_0x20c0('0x7')]=_0x20c0('0x49');_0x700675=as[_0x20c0('0x3c')](_0x545b39,_0x346a04['type'],_0x129eb5);_0x3b334a[_0x20c0('0x47')][_0x39fd84](_0x700675[_0x20c0('0x4a')],_0x700675[_0x20c0('0x3e')][_0x20c0('0x3f')],_0x700675['value'][_0x20c0('0x40')]);}break;case _0x20c0('0x4b'):var _0x5a924e=_0x129eb5[_0x20c0('0x3e')][_0x20c0('0x4c')](',')[_0x20c0('0x15')](function(_0x527f6f){return Number(_0x527f6f);});var _0x399514=parseTagParameter(_0x5a924e);_0x3b334a['tags']['clause']['and'](_0x399514);_0x3b334a[_0x20c0('0x4d')]['ids']=_0x5a924e;break;case _0x20c0('0x4e'):if(_0x129eb5[_0x20c0('0x45')]===_0x20c0('0x46')){_0x3b334a[_0x20c0('0x4f')][_0x39fd84](_0x20c0('0x50'),'%'+_0x129eb5[_0x20c0('0x3e')]+'%',null);}else{_0x346a04=_[_0x20c0('0x3b')](_0x1b1b31,['name',_0x20c0('0x51')]);_0x129eb5[_0x20c0('0x7')]=_0x20c0('0x51');_0x700675=as[_0x20c0('0x3c')](_0x545b39,_0x346a04[_0x20c0('0x52')],_0x129eb5);_0x3b334a[_0x20c0('0x4f')][_0x39fd84](_0x700675['text'],_0x700675['value'][_0x20c0('0x3f')],_0x700675[_0x20c0('0x3e')][_0x20c0('0x40')]);}break;case'body':case'plainBody':_0x700675=as[_0x20c0('0x3c')]('me',null,_0x129eb5);_0x3b334a[_0x20c0('0x53')][_0x39fd84](_0x700675[_0x20c0('0x4a')],_0x700675['value'][_0x20c0('0x3f')],_0x700675[_0x20c0('0x3e')]['end']);break;}}}return _0x3b334a;}function parseModelFields(_0x4972a3,_0x3fb4f1,_0x5b314b){var _0xdd2a3b=utils['getAccountFK'](_0x4972a3);var _0x1b25d6=squel[_0x20c0('0x23')]();var _0x5dd76d=_(_0x3fb4f1)['keys']()[_0x20c0('0x15')](function(_0x149376){return _[_0x20c0('0x54')](_0x5b314b,[_0x20c0('0x8'),_0x149376])?_0x149376:undefined;})[_0x20c0('0x55')]()[_0x20c0('0x3e')]();if(_0x5dd76d[_0x20c0('0x12')]>0x0){_0x5dd76d[_0x20c0('0x24')](function(_0x5cccbf){if(_0x5cccbf===_0xdd2a3b){_0x1b25d6[_0x20c0('0x43')]('i.'+_0xdd2a3b+_0x20c0('0x14'),[][_0x20c0('0x56')](_0x3fb4f1[_0x5cccbf]));}else if(_0x5cccbf===_0x20c0('0x57')){var _0x2c3404=JSON['parse'](_0x3fb4f1[_0x5cccbf])['$gte'];var _0x3cff12=JSON[_0x20c0('0x58')](_0x3fb4f1[_0x5cccbf])[_0x20c0('0x59')];_0x1b25d6[_0x20c0('0x43')](_0x20c0('0x5a'),_0x2c3404,_0x3cff12);}else{if(_0x3fb4f1[_0x5cccbf]===_0x20c0('0x5b')){_0x1b25d6[_0x20c0('0x43')]('i.'+_0x5cccbf+'\x20IS\x20NULL');}else{_0x1b25d6['and']('i.'+_0x5cccbf+_0x20c0('0x5c'),_0x3fb4f1[_0x5cccbf]);}}});}return _0x1b25d6;}function parseQueryParameters(_0x1933e6,_0x10e51f,_0x4b5810){var _0xff6ea=getSqlClauses();return Promise['resolve']()[_0x20c0('0x5d')](function(){return parseModelFields(_0x1933e6,_0x10e51f,_0x4b5810);})[_0x20c0('0x5d')](function(_0x76a8a2){_0xff6ea['fields'][_0x20c0('0x43')](_0x76a8a2);return parseReadParameter(_0x10e51f[_0x20c0('0x42')]);})[_0x20c0('0x5d')](function(_0x490936){_0xff6ea[_0x20c0('0x42')]['and'](_0x490936);return parseTagParameter(_0x10e51f[_0x20c0('0x5e')]);})[_0x20c0('0x5d')](function(_0x10c8c1){_0xff6ea[_0x20c0('0x4d')]['clause'][_0x20c0('0x43')](_0x10c8c1);return parseSearchFilter(_0x1933e6,_0x10e51f['filter']);})[_0x20c0('0x5d')](function(_0x5d40c9){_0xff6ea[_0x20c0('0x5f')]=_0x5d40c9;return _0xff6ea;});}function checkAccountsRestrictions(_0x2e64f5,_0x2cf512,_0x332d83){var _0x54bb05=utils[_0x20c0('0x6')](_0x2e64f5);var _0xcd87e8=_0x20c0('0x60')+_[_0x20c0('0x61')](_0x2e64f5)+(_0x2e64f5===_0x20c0('0x62')?_0x20c0('0x63'):_0x20c0('0x64'));var _0x166dbd=squel['expr']();return Promise[_0x20c0('0x65')]()[_0x20c0('0x5d')](function(){if(_0x332d83[_0x20c0('0x66')]&&_0x2cf512['role']===_0x20c0('0x67')){return _0x2cf512[_0xcd87e8]({'attributes':['id'],'raw':!![]});}})[_0x20c0('0x5d')](function(_0x57ca28){if(_0x57ca28){if(_0x57ca28[_0x20c0('0x12')]===0x0){_0x166dbd['and']('i.'+_0x54bb05+'\x20IS\x20NULL');}else{_0x166dbd['and']('i.'+_0x54bb05+'\x20IN\x20?',_[_0x20c0('0x15')](_0x57ca28,'id'));}}else if(!_0x332d83[_0x54bb05]){_0x166dbd[_0x20c0('0x43')]('i.'+_0x54bb05+_0x20c0('0x68'));}})[_0x20c0('0x5d')](function(){return _0x166dbd;});}function getClosedOrderClause(_0x353e1b,_0xc34e9f){var _0x1f16e6='';var _0x247dee=[_0x20c0('0x69'),'i.secondDisposition',_0x20c0('0x6a')];if(_0x353e1b===_0x20c0('0x32')){_0x247dee[_0x20c0('0x6b')](_0x20c0('0x6c'));}if(_0xc34e9f[_0x20c0('0x6d')]==='0'&&_0x353e1b===_0x20c0('0x32')){_0x1f16e6=_0x20c0('0x6c');}else{if(_0xc34e9f[_0x20c0('0x6d')]==='1'){_0x247dee[_0x20c0('0x6e')]();}_0x1f16e6=_0x20c0('0x6f')+_0x247dee['join'](',\x20')+')';}return _0x1f16e6;}function getFilteredInteractions(_0x8146da,_0x32f975,_0x1ae801,_0x11511c){var _0x5a1f33=utils['getInteractionFK'](_0x8146da);var _0x9c0b80=_[_0x20c0('0x61')](_0x8146da)+'Interaction';var _0x2222eb=[];var _0x4bc360=getTagsQuery();var _0x12080a={'type':db[_0x20c0('0x70')][_0x20c0('0x71')]['SELECT'],'raw':!![]};var _0x59c854=[];var _0x113725=[];return db[_0x20c0('0x72')][_0x20c0('0x73')](_0x4bc360[_0x20c0('0x74')](),_0x12080a)['then'](function(_0x526bdb){_0x2222eb=_['keyBy'](_0x526bdb,'id');_0x12080a=_[_0x20c0('0x75')](_0x12080a,{'model':db[_0x9c0b80],'mapToModel':!![],'nest':!![]});if(_0x1ae801[_0x20c0('0x76')]){_0x11511c[_0x20c0('0x77')]['forEach'](function(_0x47b241){_0x32f975[_0x20c0('0x7')]('i.'+_0x47b241);});}else{_0x32f975[_0x20c0('0x7')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x20c0('0x41'));_0x32f975['field']('a.key','Account.key');_0x32f975[_0x20c0('0x7')]('a.mandatoryDisposition',_0x20c0('0x78'));if(_0x8146da==='mail'){_0x32f975[_0x20c0('0x7')](_0x20c0('0x79'),_0x20c0('0x7a'));_0x32f975['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x20c0('0x7b'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x7c'));_0x32f975[_0x20c0('0x7')]('i.createdAt');_0x32f975['field'](_0x20c0('0x7d'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x7e'));_0x32f975[_0x20c0('0x7')]('i.closedAt');_0x32f975[_0x20c0('0x7')](_0x20c0('0x7f'));_0x32f975[_0x20c0('0x7')]('i.lastMsgAt');_0x32f975['field']('i.lastMsgDirection');_0x32f975[_0x20c0('0x7')](_0x20c0('0x80'));_0x32f975['field']('i.disposition');_0x32f975[_0x20c0('0x7')]('i.secondDisposition');_0x32f975['field'](_0x20c0('0x69'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x6c'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x81'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x82'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x83'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x84'));}else if(_0x8146da==='openchannel'){_0x32f975[_0x20c0('0x7')](_0x20c0('0x85'),_0x20c0('0x7b'));}else{_0x32f975[_0x20c0('0x7')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x20c0('0x7b'));}if(_0x8146da!==_0x20c0('0x32')){_0x32f975[_0x20c0('0x7')](_0x20c0('0x86'));}_0x32f975[_0x20c0('0x7')](_0x20c0('0x87'),_0x20c0('0x88'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x89'),_0x20c0('0x8a'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x8b'),_0x20c0('0x8c'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x8d'),_0x20c0('0x8e'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x8f'),_0x20c0('0x90'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x91'),'Contact.fax');_0x32f975['field'](_0x20c0('0x92'),_0x20c0('0x93'));_0x32f975[_0x20c0('0x7')](_0x20c0('0x94'),'Owner.internal');_0x32f975[_0x20c0('0x7')](_0x20c0('0x95'),_0x20c0('0x96'));}if(_0x11511c['limit']){_0x32f975['limit'](_0x11511c[_0x20c0('0x97')]);}if(_0x11511c[_0x20c0('0x98')]){_0x32f975[_0x20c0('0x98')](_0x11511c[_0x20c0('0x98')]);}return db['sequelize']['query'](_0x32f975[_0x20c0('0x74')](),_0x12080a);})[_0x20c0('0x5d')](function(_0xb4c454){_0x59c854=_0xb4c454;var _0x3558af=getUsersQuery(_0x8146da,_0x59c854);return db[_0x20c0('0x72')][_0x20c0('0x73')](_0x3558af['toString'](),_0x12080a);})[_0x20c0('0x5d')](function(_0xf0b82d){_0x113725=_['groupBy'](_0xf0b82d,_0x5a1f33);if(_0x8146da==='mail'){return db[_0x20c0('0x99')]['findOne']({'attributes':[_0x20c0('0x9a')],'raw':!![]});}})[_0x20c0('0x5d')](function(_0x2c6b6b){var _0x3e55b9=_0x2c6b6b?_0x2c6b6b[_0x20c0('0x9a')]:undefined;var _0x415137=_0x59c854[_0x20c0('0x15')](function(_0x2870dd){return updateInteraction(_0x2870dd,_0x2222eb,_0x113725,_0x3e55b9);});return Promise['all'](_0x415137);});}function countFilteredInteractions(_0x13ee2d,_0x1aa1b4){var _0x29c9a1=_0x13ee2d[_0x20c0('0x9b')]();_0x29c9a1['field']('COUNT(*)');_0x29c9a1['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x20c0('0x41'));var _0x13c005=utils['getSelectedTags'](_0x1aa1b4);if(!_['isEmpty'](_0x13c005)){_0x29c9a1[_0x20c0('0x13')]('t.id\x20IN\x20?',_0x13c005);}var _0x5b853e={'type':db[_0x20c0('0x70')][_0x20c0('0x71')][_0x20c0('0x9c')],'raw':!![]};return db[_0x20c0('0x72')][_0x20c0('0x73')](_0x29c9a1['toString'](),_0x5b853e);}module[_0x20c0('0x9d')]={'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 b89a812..42daa78 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 _0x9b9e=['../../mysqldb','map','fullname','split','forEach','push','waiting','answered','unmanaged','total','closed','abandoned','disposition','UserId','talking','MailMessage','findOne','out','plainBody','then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','Tags','lodash'];(function(_0x2d2663,_0x4fd308){var _0x8b9c63=function(_0x286a2c){while(--_0x286a2c){_0x2d2663['push'](_0x2d2663['shift']());}};_0x8b9c63(++_0x4fd308);}(_0x9b9e,0x1a3));var _0xe9b9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x9b9e[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xe9b9('0x0'));var db=require(_0xe9b9('0x1'))['db'];function getInteractionUsers(_0x5d5c57,_0x1181af){return new Promise(function(_0x5f179e,_0x57553b){try{var _0x492adf=[];if(_0x1181af[_0x5d5c57]){_0x492adf=_0x1181af[_0x5d5c57][_0xe9b9('0x2')](function(_0x2585e3){return{'id':_0x2585e3['id'],'fullname':_0x2585e3[_0xe9b9('0x3')]};});}return _0x5f179e(_0x492adf);}catch(_0x45cc23){_0x57553b(_0x45cc23);}});}function getInteractionTags(_0xccfc,_0x231284){var _0x481fff=[];if(_0xccfc){_0xccfc[_0xe9b9('0x4')](',')[_0xe9b9('0x5')](function(_0x3bd5d8){_0x481fff[_0xe9b9('0x6')](_0x231284[_0x3bd5d8]);});}return _0x481fff;}function updateWaitingCounter(_0x569c6a){if(_0x569c6a['waiting']){_0x569c6a[_0xe9b9('0x7')]-=0x1;}}function updateInteractionCounters(_0x55011d){_0x55011d['waiting']=0x0;_0x55011d['talking']=0x0;_0x55011d[_0xe9b9('0x8')]=0x0;_0x55011d[_0xe9b9('0x9')]=0x0;_0x55011d['abandoned']=0x0;_0x55011d[_0xe9b9('0xa')]=0x0;if(_0x55011d[_0xe9b9('0xb')]){if(_0x55011d['disposition']==='abandoned'){_0x55011d[_0xe9b9('0xc')]+=0x1;updateWaitingCounter(_0x55011d);}if(_0x55011d['UserId']){_0x55011d[_0xe9b9('0x8')]+=0x1;if(_0x55011d['talking']){_0x55011d['talking']-=0x1;}}else{if(_0x55011d[_0xe9b9('0xd')]){_0x55011d['unmanaged']+=0x1;updateWaitingCounter(_0x55011d);}}}else{if(!_0x55011d[_0xe9b9('0xe')]){_0x55011d[_0xe9b9('0x7')]+=0x1;}if(_0x55011d[_0xe9b9('0xe')]){_0x55011d[_0xe9b9('0xf')]+=0x1;updateWaitingCounter(_0x55011d);}}_0x55011d[_0xe9b9('0xa')]+=0x1;return _0x55011d;}function getLastMessageText(_0x4f101d){return db[_0xe9b9('0x10')][_0xe9b9('0x11')]({'where':{'$and':[{'MailInteractionId':_0x4f101d['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xe9b9('0x12')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xe9b9('0x13')],'order':'-id','raw':!![]})[_0xe9b9('0x14')](function(_0x5baccf){if(_0x5baccf&&_0x5baccf[_0xe9b9('0x13')]){_0x4f101d[_0xe9b9('0x15')]=_[_0xe9b9('0x16')](_0x5baccf['plainBody']);}return _0x4f101d;})[_0xe9b9('0x17')](function(_0xdefb5a){throw _0xdefb5a;});}exports[_0xe9b9('0x18')]=function(_0x5ac7fd,_0x5b5140,_0x3e9f8e,_0x19f477){return new Promise(function(_0x4187ef,_0x5a0c32){return getInteractionUsers(_0x5ac7fd['id'],_0x3e9f8e)[_0xe9b9('0x14')](function(_0xe9bac0){_0x5ac7fd[_0xe9b9('0x19')]=_0xe9bac0;return getInteractionTags(_0x5ac7fd[_0xe9b9('0x1a')],_0x5b5140);})[_0xe9b9('0x14')](function(_0x102a98){_0x5ac7fd[_0xe9b9('0x1b')]=_0x102a98;delete _0x5ac7fd[_0xe9b9('0x1a')];return updateInteractionCounters(_0x5ac7fd);})[_0xe9b9('0x14')](function(_0x357e80){if(_0x19f477){return getLastMessageText(_0x357e80);}else{return _0x357e80;}})['then'](function(_0xcc29b3){_0x4187ef(_0xcc29b3);})[_0xe9b9('0x17')](function(_0x242593){_0x5a0c32(_0x242593);});});}; \ No newline at end of file +var _0x9b8e=['../../mysqldb','map','fullname','split','forEach','push','waiting','answered','unmanaged','total','closed','disposition','abandoned','UserId','talking','MailMessage','findOne','out','then','plainBody','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','Tags'];(function(_0x589e56,_0x5e56ec){var _0x4a94b3=function(_0x15a083){while(--_0x15a083){_0x589e56['push'](_0x589e56['shift']());}};_0x4a94b3(++_0x5e56ec);}(_0x9b8e,0x87));var _0xe9b8=function(_0x13bb45,_0x493c65){_0x13bb45=_0x13bb45-0x0;var _0x5e9c12=_0x9b8e[_0x13bb45];return _0x5e9c12;};'use strict';var _=require('lodash');var db=require(_0xe9b8('0x0'))['db'];function getInteractionUsers(_0x7488dc,_0x24713c){return new Promise(function(_0x433eff,_0x37eeff){try{var _0x18e2c3=[];if(_0x24713c[_0x7488dc]){_0x18e2c3=_0x24713c[_0x7488dc][_0xe9b8('0x1')](function(_0x1969e8){return{'id':_0x1969e8['id'],'fullname':_0x1969e8[_0xe9b8('0x2')]};});}return _0x433eff(_0x18e2c3);}catch(_0x4372f2){_0x37eeff(_0x4372f2);}});}function getInteractionTags(_0xd7510d,_0xbeebf4){var _0x5092d1=[];if(_0xd7510d){_0xd7510d[_0xe9b8('0x3')](',')[_0xe9b8('0x4')](function(_0x56fea9){_0x5092d1[_0xe9b8('0x5')](_0xbeebf4[_0x56fea9]);});}return _0x5092d1;}function updateWaitingCounter(_0x32b772){if(_0x32b772[_0xe9b8('0x6')]){_0x32b772['waiting']-=0x1;}}function updateInteractionCounters(_0x1693a8){_0x1693a8['waiting']=0x0;_0x1693a8['talking']=0x0;_0x1693a8[_0xe9b8('0x7')]=0x0;_0x1693a8[_0xe9b8('0x8')]=0x0;_0x1693a8['abandoned']=0x0;_0x1693a8[_0xe9b8('0x9')]=0x0;if(_0x1693a8[_0xe9b8('0xa')]){if(_0x1693a8[_0xe9b8('0xb')]===_0xe9b8('0xc')){_0x1693a8['abandoned']+=0x1;updateWaitingCounter(_0x1693a8);}if(_0x1693a8[_0xe9b8('0xd')]){_0x1693a8[_0xe9b8('0x7')]+=0x1;if(_0x1693a8[_0xe9b8('0xe')]){_0x1693a8[_0xe9b8('0xe')]-=0x1;}}else{if(_0x1693a8[_0xe9b8('0xb')]){_0x1693a8[_0xe9b8('0x8')]+=0x1;updateWaitingCounter(_0x1693a8);}}}else{if(!_0x1693a8[_0xe9b8('0xd')]){_0x1693a8[_0xe9b8('0x6')]+=0x1;}if(_0x1693a8['UserId']){_0x1693a8[_0xe9b8('0xe')]+=0x1;updateWaitingCounter(_0x1693a8);}}_0x1693a8[_0xe9b8('0x9')]+=0x1;return _0x1693a8;}function getLastMessageText(_0x525b5b){return db[_0xe9b8('0xf')][_0xe9b8('0x10')]({'where':{'$and':[{'MailInteractionId':_0x525b5b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xe9b8('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0xe9b8('0x12')](function(_0x12c899){if(_0x12c899&&_0x12c899[_0xe9b8('0x13')]){_0x525b5b[_0xe9b8('0x14')]=_[_0xe9b8('0x15')](_0x12c899[_0xe9b8('0x13')]);}return _0x525b5b;})[_0xe9b8('0x16')](function(_0x5e8262){throw _0x5e8262;});}exports[_0xe9b8('0x17')]=function(_0x17a05c,_0x3a6824,_0x3a4223,_0x269daa){return new Promise(function(_0x45db59,_0x251c39){return getInteractionUsers(_0x17a05c['id'],_0x3a4223)['then'](function(_0x51a318){_0x17a05c[_0xe9b8('0x18')]=_0x51a318;return getInteractionTags(_0x17a05c[_0xe9b8('0x19')],_0x3a6824);})['then'](function(_0x5a95b7){_0x17a05c[_0xe9b8('0x1a')]=_0x5a95b7;delete _0x17a05c['TagIds'];return updateInteractionCounters(_0x17a05c);})[_0xe9b8('0x12')](function(_0x19625c){if(_0x269daa){return getLastMessageText(_0x19625c);}else{return _0x19625c;}})[_0xe9b8('0x12')](function(_0x25252a){_0x45db59(_0x25252a);})[_0xe9b8('0x16')](function(_0x2aa4e0){_0x251c39(_0x2aa4e0);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 7b9e4df..bf51b72 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 _0xab0b=['_messages','user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','findOne','update','then','info','error','exports','../../mysqldb','../../config/logger','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','upperFirst','InteractionId','unknown','accounts','_interactions'];(function(_0x18a81a,_0x4fc65b){var _0x114027=function(_0x1b7e0f){while(--_0x1b7e0f){_0x18a81a['push'](_0x18a81a['shift']());}};_0x114027(++_0x4fc65b);}(_0xab0b,0x82));var _0xbab0=function(_0x1e46a5,_0x5b094e){_0x1e46a5=_0x1e46a5-0x0;var _0x35a2cf=_0xab0b[_0x1e46a5];return _0x35a2cf;};'use strict';var _=require('lodash');var db=require(_0xbab0('0x0'))['db'];var loggers={'openchannel':require(_0xbab0('0x1'))('openchannel-interactions'),'mail':require(_0xbab0('0x1'))(_0xbab0('0x2')),'fax':require(_0xbab0('0x1'))('fax-interactions'),'sms':require('../../config/logger')(_0xbab0('0x3')),'chat':require(_0xbab0('0x1'))(_0xbab0('0x4')),'whatsapp':require('../../config/logger')(_0xbab0('0x5'))};function getAccountFK(_0x2626f4){return _[_0xbab0('0x6')](_0x2626f4)+(_0x2626f4===_0xbab0('0x7')?_0xbab0('0x8'):_0xbab0('0x9'))+'Id';}function getInteractionFK(_0x3aa89d){return _[_0xbab0('0x6')](_0x3aa89d)+'InteractionId';}function getInteractionId(_0x19e5d4,_0xf18217,_0x28db5e){if(_0x19e5d4&&_0x19e5d4[_[_0xbab0('0xa')](_0x28db5e)+_0xbab0('0xb')]){return _0x19e5d4[_[_0xbab0('0xa')](_0x28db5e)+_0xbab0('0xb')];}else if(_0x19e5d4&&_0x19e5d4['id']){return _0x19e5d4['id'];}else if(_0xf18217&&_0xf18217['id']){return _0xf18217['id'];}else{return _0xbab0('0xc');}}function getInteractionsTables(_0x29f6e0){return{'accounts':_0x29f6e0+'_'+(_0x29f6e0===_0xbab0('0x7')?'websites':_0xbab0('0xd')),'interactions':_0x29f6e0+_0xbab0('0xe'),'interactionsTags':_0x29f6e0+'_interaction_has_tags','messages':_0x29f6e0+_0xbab0('0xf'),'userInteractions':_0xbab0('0x10')+_0x29f6e0+_0xbab0('0xe')};}function getSelectedTags(_0x2ef01d){var _0x1584ce=[];if(_0x2ef01d){_0x1584ce=Array[_0xbab0('0x11')](_0x2ef01d)?_0x2ef01d:[_0x2ef01d];}return _0x1584ce;}function log(_0x492f3a,_0x5e12c2,_0x1df013,_0x24c895,_0x57ac3e,_0x58d04b){loggers[_0x57ac3e['toLowerCase']()][_0x492f3a](_0xbab0('0x12'),_0x58d04b[_0xbab0('0x13')](),_0x5e12c2?_0x5e12c2['id']:null,_0x5e12c2?_0x5e12c2[_0xbab0('0x14')]:null,_0x5e12c2?_0x5e12c2['role']:null,getInteractionId(_0x1df013,_0x24c895,_0x57ac3e),_0x1df013?JSON[_0xbab0('0x15')](_0x1df013):_0xbab0('0x16'));}function updateUser(_0x3f7f12,_0xfe4bcb,_0xb72068,_0xd99fa1,_0x1e1fd2){db[_['upperFirst'](_0xd99fa1)+'Interaction'][_0xbab0('0x17')]({'where':{'id':getInteractionId(_0xfe4bcb,_0xb72068,_0xd99fa1)}})['then'](function(_0x2b9ea7){if(_0x2b9ea7){return _0x2b9ea7[_0xbab0('0x18')]({'UserId':_0x3f7f12?_0x3f7f12['id']:null});}})[_0xbab0('0x19')](function(_0xc46bce){if(_0xc46bce){log(_0xbab0('0x1a'),_0x3f7f12,_0xfe4bcb,_0xb72068,_0xd99fa1,_0x1e1fd2);}})['catch'](function(){log(_0xbab0('0x1b'),_0x3f7f12,_0xfe4bcb,_0xb72068,_0xd99fa1,_0x1e1fd2);});}module[_0xbab0('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x882a=['catch','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','capitalize','upperFirst','InteractionId','unknown','chat','websites','accounts','_interactions','_messages','user_has_','isArray','toLowerCase','toUpperCase','name','role','stringify','null','findOne','then','info'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x882a,0x10f));var _0xa882=function(_0x21c2a9,_0x5b3c37){_0x21c2a9=_0x21c2a9-0x0;var _0x519605=_0x882a[_0x21c2a9];return _0x519605;};'use strict';var _=require('lodash');var db=require(_0xa882('0x0'))['db'];var loggers={'openchannel':require(_0xa882('0x1'))(_0xa882('0x2')),'mail':require('../../config/logger')(_0xa882('0x3')),'fax':require(_0xa882('0x1'))(_0xa882('0x4')),'sms':require(_0xa882('0x1'))(_0xa882('0x5')),'chat':require(_0xa882('0x1'))('chat-interactions'),'whatsapp':require(_0xa882('0x1'))('whatsapp-interactions')};function getAccountFK(_0x47f770){return _['capitalize'](_0x47f770)+(_0x47f770==='chat'?'Website':'Account')+'Id';}function getInteractionFK(_0x402c7f){return _[_0xa882('0x6')](_0x402c7f)+'InteractionId';}function getInteractionId(_0x161c12,_0x283448,_0x1cd6fe){if(_0x161c12&&_0x161c12[_[_0xa882('0x7')](_0x1cd6fe)+_0xa882('0x8')]){return _0x161c12[_['upperFirst'](_0x1cd6fe)+_0xa882('0x8')];}else if(_0x161c12&&_0x161c12['id']){return _0x161c12['id'];}else if(_0x283448&&_0x283448['id']){return _0x283448['id'];}else{return _0xa882('0x9');}}function getInteractionsTables(_0x4825fb){return{'accounts':_0x4825fb+'_'+(_0x4825fb===_0xa882('0xa')?_0xa882('0xb'):_0xa882('0xc')),'interactions':_0x4825fb+_0xa882('0xd'),'interactionsTags':_0x4825fb+'_interaction_has_tags','messages':_0x4825fb+_0xa882('0xe'),'userInteractions':_0xa882('0xf')+_0x4825fb+'_interactions'};}function getSelectedTags(_0x5c4f8e){var _0x3660bc=[];if(_0x5c4f8e){_0x3660bc=Array[_0xa882('0x10')](_0x5c4f8e)?_0x5c4f8e:[_0x5c4f8e];}return _0x3660bc;}function log(_0x30a880,_0x6071ba,_0x697bc3,_0x1ab1dd,_0x41e7ca,_0x5cfeae){loggers[_0x41e7ca[_0xa882('0x11')]()][_0x30a880]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5cfeae[_0xa882('0x12')](),_0x6071ba?_0x6071ba['id']:null,_0x6071ba?_0x6071ba[_0xa882('0x13')]:null,_0x6071ba?_0x6071ba[_0xa882('0x14')]:null,getInteractionId(_0x697bc3,_0x1ab1dd,_0x41e7ca),_0x697bc3?JSON[_0xa882('0x15')](_0x697bc3):_0xa882('0x16'));}function updateUser(_0x53bcbd,_0x37c7f1,_0x41f9aa,_0x4fe545,_0x36a231){db[_[_0xa882('0x7')](_0x4fe545)+'Interaction'][_0xa882('0x17')]({'where':{'id':getInteractionId(_0x37c7f1,_0x41f9aa,_0x4fe545)}})[_0xa882('0x18')](function(_0x52893b){if(_0x52893b){return _0x52893b['update']({'UserId':_0x53bcbd?_0x53bcbd['id']:null});}})[_0xa882('0x18')](function(_0x4623ca){if(_0x4623ca){log(_0xa882('0x19'),_0x53bcbd,_0x37c7f1,_0x41f9aa,_0x4fe545,_0x36a231);}})[_0xa882('0x1a')](function(){log('error',_0x53bcbd,_0x37c7f1,_0x41f9aa,_0x4fe545,_0x36a231);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 8b10cee..797b316 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 _0xd350=['../../config/environment','license','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','hasOwnProperty','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd350,0x1f4));var _0x0d35=function(_0x38fb0d,_0x52b5db){_0x38fb0d=_0x38fb0d-0x0;var _0x30a5d6=_0xd350[_0x38fb0d];return _0x30a5d6;};'use strict';var crypto=require(_0x0d35('0x0'));var util=require(_0x0d35('0x1'));var compose=require(_0x0d35('0x2'));var db=require(_0x0d35('0x3'))['db'];var config=require(_0x0d35('0x4'));function getValueFromLicense(_0x552f1b,_0x237d39){if(_0x552f1b&&_0x237d39){if(_0x237d39['data1']&&_0x237d39[_0x0d35('0x5')]){var _0x176169=_0x237d39[_0x0d35('0x6')];var _0x20e04e=_0x237d39['license'];var _0x2caf6f=_0x176169[_0x0d35('0x7')]('-')[0x4];var _0x37f86d=_0x176169[_0x0d35('0x7')]('-')[0x0];var _0x129652=crypto[_0x0d35('0x8')](_0x0d35('0x9'),util[_0x0d35('0xa')](_0x0d35('0xb'),_0x2caf6f,_0x176169,_0x37f86d));var _0x3da941=_0x129652[_0x0d35('0xc')](_0x20e04e,_0x0d35('0xd'),_0x0d35('0xe'));_0x3da941+=_0x129652[_0x0d35('0xf')]('utf8');var _0x3a71b2=JSON['parse'](_0x3da941);return _0x3a71b2[_0x0d35('0x10')](_0x552f1b)?_0x3a71b2[_0x552f1b]:null;}}return null;}function isLimit(_0x3ca61f,_0x46a5ef,_0x440fb6,_0x5cf652){var _0xc0e4eb=_0x46a5ef;return compose()['use'](function(_0x4dc9da,_0x557738,_0x3d6e75){return db[_0x0d35('0x11')][_0x0d35('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x0d35('0x13')](function(_0x164630){var _0x3866e7=getValueFromLicense(_0x3ca61f,_0x164630);return _0x3866e7?_0x3866e7:_0xc0e4eb;})[_0x0d35('0x13')](function(_0x257208){_0xc0e4eb=_0x257208;return _0x440fb6[_0x0d35('0x14')](_0x5cf652);})[_0x0d35('0x13')](function(_0xe69ee3){if(_0xe69ee3>=_0xc0e4eb){return _0x557738[_0x0d35('0x15')](0x193)[_0x0d35('0x16')]({'message':util[_0x0d35('0xa')](_0x0d35('0x17'),_0x3ca61f)});}_0x3d6e75();})[_0x0d35('0x18')](function(_0x41ea24){_0x3d6e75(_0x41ea24);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x0d35('0x19')],{'where':{'$or':[{'role':'admin'},{'role':_0x0d35('0x1a')}]}});}exports[_0x0d35('0x1b')]=isUserLimit; \ No newline at end of file +var _0x48fb=['utf8','final','parse','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../config/environment','license','data1','split','aes-256-ctr','format','%s:%s:%s','update','base64'];(function(_0x52de63,_0x180e6f){var _0x5918f3=function(_0x3977b7){while(--_0x3977b7){_0x52de63['push'](_0x52de63['shift']());}};_0x5918f3(++_0x180e6f);}(_0x48fb,0x144));var _0xb48f=function(_0x1e6558,_0x922510){_0x1e6558=_0x1e6558-0x0;var _0x30ef72=_0x48fb[_0x1e6558];return _0x30ef72;};'use strict';var crypto=require(_0xb48f('0x0'));var util=require(_0xb48f('0x1'));var compose=require(_0xb48f('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xb48f('0x3'));function getValueFromLicense(_0x44a9d4,_0x1ce1b4){if(_0x44a9d4&&_0x1ce1b4){if(_0x1ce1b4['data1']&&_0x1ce1b4[_0xb48f('0x4')]){var _0x32ac54=_0x1ce1b4[_0xb48f('0x5')];var _0xfaf752=_0x1ce1b4[_0xb48f('0x4')];var _0x50931d=_0x32ac54['split']('-')[0x4];var _0x29815b=_0x32ac54[_0xb48f('0x6')]('-')[0x0];var _0x3f992c=crypto['createDecipher'](_0xb48f('0x7'),util[_0xb48f('0x8')](_0xb48f('0x9'),_0x50931d,_0x32ac54,_0x29815b));var _0x57e831=_0x3f992c[_0xb48f('0xa')](_0xfaf752,_0xb48f('0xb'),_0xb48f('0xc'));_0x57e831+=_0x3f992c[_0xb48f('0xd')]('utf8');var _0x9634dd=JSON[_0xb48f('0xe')](_0x57e831);return _0x9634dd['hasOwnProperty'](_0x44a9d4)?_0x9634dd[_0x44a9d4]:null;}}return null;}function isLimit(_0x13436e,_0x138a9d,_0x3d54f0,_0x44710d){var _0x2bb2a2=_0x138a9d;return compose()[_0xb48f('0xf')](function(_0x1698aa,_0x369d46,_0x435e21){return db[_0xb48f('0x10')][_0xb48f('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x3cb8c9){var _0x36760d=getValueFromLicense(_0x13436e,_0x3cb8c9);return _0x36760d?_0x36760d:_0x2bb2a2;})[_0xb48f('0x12')](function(_0xa28204){_0x2bb2a2=_0xa28204;return _0x3d54f0[_0xb48f('0x13')](_0x44710d);})['then'](function(_0x1499fa){if(_0x1499fa>=_0x2bb2a2){return _0x369d46[_0xb48f('0x14')](0x193)[_0xb48f('0x15')]({'message':util[_0xb48f('0x8')](_0xb48f('0x16'),_0x13436e)});}_0x435e21();})['catch'](function(_0x4a5795){_0x435e21(_0x4a5795);});});}function isUserLimit(){return isLimit(_0xb48f('0x17'),0x1,db[_0xb48f('0x18')],{'where':{'$or':[{'role':_0xb48f('0x19')},{'role':_0xb48f('0x1a')}]}});}exports[_0xb48f('0x1b')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 2a063e8..97718ef 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 _0x6d83=['CAST(','field','\x20AS\x20','text','$ne','\x20OR\x20','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','$lt','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','$notIn','start','pop','utcOffset','minutes','lodash','parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d83,0x1c7));var _0x36d8=function(_0x2ddf87,_0x3abd99){_0x2ddf87=_0x2ddf87-0x0;var _0x3f5262=_0x6d83[_0x2ddf87];return _0x3f5262;};'use strict';var _=require(_0x36d8('0x0'));var moment=require('moment');exports[_0x36d8('0x1')]=function(_0x10c375){var _0x445c38={'conditions':[]};_0x445c38[_0x36d8('0x2')]=_[_0x36d8('0x3')](_0x10c375,_0x36d8('0x4'))?'or':'and';var _0xa2eb02=_0x10c375[_0x36d8('0x5')](_0x36d8('0x6'),'')[_0x36d8('0x5')](_0x36d8('0x4'),'')[_0x36d8('0x7')]('||');for(var _0x2f128b=0x0;_0x2f128b<_0xa2eb02[_0x36d8('0x8')];_0x2f128b++){var _0x3a7607=_0xa2eb02[_0x2f128b]['split'](':=');var _0xa17b05=_0x3a7607[0x0];var _0x5cef1b=_0x3a7607[_0x36d8('0x9')](0x1);_0x5cef1b[_0x36d8('0xa')](function(_0x395531){var _0x15499e=_0x395531['split']('[')[_0x36d8('0xb')]();var _0x47a80f=_0x395531[_0x36d8('0xc')](/\[(.*?)\]/g);_0x47a80f['forEach'](function(_0x299d7c){var _0x1aebef=_0x299d7c[_0x36d8('0x7')]('[')[_0x36d8('0xd')](function(_0x449bfa){return _0x449bfa[_0x36d8('0xe')](']')>-0x1;})['map'](function(_0x5d3a86){return _0x5d3a86[_0x36d8('0x7')](']')[0x0];})[0x0];_0x445c38[_0x36d8('0xf')][_0x36d8('0x10')]({'field':_0xa17b05,'operator':_0x15499e,'value':_0x1aebef});});});}return _0x445c38;};exports[_0x36d8('0x11')]=function(_0x51c927,_0x46ac05,_0x1daff7){var _0x521a58={};if(_0x46ac05===_0x36d8('0x12')){if(_0x1daff7[_0x36d8('0x13')]===_0x36d8('0x14')){_0x1daff7[_0x36d8('0x13')]=_0x36d8('0x15');_0x1daff7['value']+=','+_0x1daff7[_0x36d8('0x16')];}else if(_[_0x36d8('0x17')]([_0x36d8('0x18'),_0x36d8('0x19')],_0x1daff7[_0x36d8('0x13')])){_0x1daff7['value']=moment(_0x1daff7[_0x36d8('0x16')])[_0x36d8('0x1a')](0x1,_0x36d8('0x1b'))[_0x36d8('0x1c')](_0x36d8('0x1d'));}}if(_0x1daff7[_0x36d8('0x1e')]){_0x46ac05=_0x1daff7[_0x36d8('0x1e')];_0x521a58['text']=_0x36d8('0x1f')+_0x51c927+'.'+_0x1daff7[_0x36d8('0x20')]+_0x36d8('0x21')+_0x1daff7[_0x36d8('0x1e')]+')\x20'+parseOperator(_0x1daff7[_0x36d8('0x13')]);}else{_0x521a58[_0x36d8('0x22')]=_0x51c927+'.'+_0x1daff7[_0x36d8('0x20')]+'\x20'+parseOperator(_0x1daff7['operator']);}if(_[_0x36d8('0x17')]([_0x36d8('0x23'),'$notIn'],_0x1daff7[_0x36d8('0x13')]))_0x521a58['text']='('+_0x521a58[_0x36d8('0x22')]+_0x36d8('0x24')+_0x51c927+'.'+_0x1daff7['field']+'\x20IS\x20NULL)';_0x521a58['value']=parseValue(_0x46ac05,_0x1daff7[_0x36d8('0x13')],_0x1daff7[_0x36d8('0x16')]);return _0x521a58;};function parseOperator(_0x11a523){var _0x5ac329;switch(_0x11a523){case _0x36d8('0x25'):_0x5ac329=_0x36d8('0x26');break;case'$notIn':_0x5ac329=_0x36d8('0x27');break;case _0x36d8('0x14'):_0x5ac329=_0x36d8('0x28');break;case _0x36d8('0x23'):_0x5ac329=_0x36d8('0x29');break;case'$substring':case _0x36d8('0x2a'):case _0x36d8('0x2b'):_0x5ac329='LIKE\x20?';break;case _0x36d8('0x2c'):_0x5ac329='<\x20?';break;case'$gt':_0x5ac329=_0x36d8('0x2d');break;case _0x36d8('0x19'):_0x5ac329=_0x36d8('0x2e');break;case _0x36d8('0x2f'):_0x5ac329='>=\x20?';break;case _0x36d8('0x15'):_0x5ac329=_0x36d8('0x30');break;}return _0x5ac329;}function parseValue(_0x3ab22a,_0x1bae83,_0x2df07b){var _0x35c05a={'start':undefined,'end':undefined};switch(_0x1bae83){case'$in':case _0x36d8('0x31'):_0x35c05a[_0x36d8('0x32')]=_0x2df07b[_0x36d8('0x7')](',');break;case'$substring':_0x35c05a[_0x36d8('0x32')]='%'+_0x2df07b+'%';break;case'$startsWith':_0x35c05a[_0x36d8('0x32')]=_0x2df07b+'%';break;case'$endsWith':_0x35c05a[_0x36d8('0x32')]='%'+_0x2df07b;break;case _0x36d8('0x15'):var _0x5040b6=_0x2df07b[_0x36d8('0x7')](',');var _0x2df07b=_0x5040b6[_0x36d8('0xb')]();var _0x1ca3e5=_0x5040b6[_0x36d8('0x33')]();if(_0x3ab22a===_0x36d8('0x12')){_0x2df07b=moment(_0x2df07b)[_0x36d8('0x34')](0x0,!![])[_0x36d8('0x1c')]();_0x1ca3e5=moment(_0x1ca3e5)['utcOffset'](0x0,!![])[_0x36d8('0x1a')](0x17,'hours')[_0x36d8('0x1a')](0x3b,_0x36d8('0x35'))[_0x36d8('0x1a')](0x3b,'seconds')[_0x36d8('0x1c')]();}_0x35c05a={'start':_0x2df07b,'end':_0x1ca3e5};break;default:_0x35c05a[_0x36d8('0x32')]=_0x2df07b;break;}return _0x35c05a;} \ No newline at end of file +var _0x71f0=['start','pop','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','forEach','shift','match','filter','indexOf','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x71f0,0x80));var _0x071f=function(_0x5ba46a,_0x582fe0){_0x5ba46a=_0x5ba46a-0x0;var _0x5cbf4f=_0x71f0[_0x5ba46a];return _0x5cbf4f;};'use strict';var _=require(_0x071f('0x0'));var moment=require(_0x071f('0x1'));exports[_0x071f('0x2')]=function(_0x288c0e){var _0x297743={'conditions':[]};_0x297743[_0x071f('0x3')]=_[_0x071f('0x4')](_0x288c0e,_0x071f('0x5'))?'or':_0x071f('0x6');var _0x508e6b=_0x288c0e[_0x071f('0x7')](_0x071f('0x8'),'')[_0x071f('0x7')]('[$or]','')[_0x071f('0x9')]('||');for(var _0x1c6e6e=0x0;_0x1c6e6e<_0x508e6b[_0x071f('0xa')];_0x1c6e6e++){var _0x4684e7=_0x508e6b[_0x1c6e6e]['split'](':=');var _0x1f7508=_0x4684e7[0x0];var _0x261e8b=_0x4684e7['slice'](0x1);_0x261e8b[_0x071f('0xb')](function(_0x34c62d){var _0x8a221d=_0x34c62d[_0x071f('0x9')]('[')[_0x071f('0xc')]();var _0x528376=_0x34c62d[_0x071f('0xd')](/\[(.*?)\]/g);_0x528376[_0x071f('0xb')](function(_0x824ebb){var _0x5b8a31=_0x824ebb[_0x071f('0x9')]('[')[_0x071f('0xe')](function(_0x529f61){return _0x529f61[_0x071f('0xf')](']')>-0x1;})['map'](function(_0x16c72f){return _0x16c72f[_0x071f('0x9')](']')[0x0];})[0x0];_0x297743[_0x071f('0x10')][_0x071f('0x11')]({'field':_0x1f7508,'operator':_0x8a221d,'value':_0x5b8a31});});});}return _0x297743;};exports[_0x071f('0x12')]=function(_0x1894db,_0x4babc3,_0x1c826d){var _0x36ecf8={};if(_0x4babc3===_0x071f('0x13')){if(_0x1c826d[_0x071f('0x14')]===_0x071f('0x15')){_0x1c826d[_0x071f('0x14')]=_0x071f('0x16');_0x1c826d[_0x071f('0x17')]+=','+_0x1c826d[_0x071f('0x17')];}else if(_[_0x071f('0x18')]([_0x071f('0x19'),_0x071f('0x1a')],_0x1c826d[_0x071f('0x14')])){_0x1c826d[_0x071f('0x17')]=moment(_0x1c826d[_0x071f('0x17')])[_0x071f('0x1b')](0x1,_0x071f('0x1c'))[_0x071f('0x1d')](_0x071f('0x1e'));}}if(_0x1c826d[_0x071f('0x1f')]){_0x4babc3=_0x1c826d[_0x071f('0x1f')];_0x36ecf8[_0x071f('0x20')]=_0x071f('0x21')+_0x1894db+'.'+_0x1c826d[_0x071f('0x22')]+_0x071f('0x23')+_0x1c826d[_0x071f('0x1f')]+')\x20'+parseOperator(_0x1c826d[_0x071f('0x14')]);}else{_0x36ecf8[_0x071f('0x20')]=_0x1894db+'.'+_0x1c826d[_0x071f('0x22')]+'\x20'+parseOperator(_0x1c826d[_0x071f('0x14')]);}if(_[_0x071f('0x18')]([_0x071f('0x24'),_0x071f('0x25')],_0x1c826d[_0x071f('0x14')]))_0x36ecf8[_0x071f('0x20')]='('+_0x36ecf8[_0x071f('0x20')]+_0x071f('0x26')+_0x1894db+'.'+_0x1c826d[_0x071f('0x22')]+_0x071f('0x27');_0x36ecf8['value']=parseValue(_0x4babc3,_0x1c826d[_0x071f('0x14')],_0x1c826d['value']);return _0x36ecf8;};function parseOperator(_0x43700f){var _0x1c66e5;switch(_0x43700f){case _0x071f('0x28'):_0x1c66e5=_0x071f('0x29');break;case'$notIn':_0x1c66e5=_0x071f('0x2a');break;case'$eq':_0x1c66e5=_0x071f('0x2b');break;case _0x071f('0x24'):_0x1c66e5=_0x071f('0x2c');break;case _0x071f('0x2d'):case _0x071f('0x2e'):case _0x071f('0x2f'):_0x1c66e5=_0x071f('0x30');break;case _0x071f('0x31'):_0x1c66e5=_0x071f('0x32');break;case'$gt':_0x1c66e5=_0x071f('0x33');break;case'$lte':_0x1c66e5='<=\x20?';break;case _0x071f('0x34'):_0x1c66e5=_0x071f('0x35');break;case'$between':_0x1c66e5=_0x071f('0x36');break;}return _0x1c66e5;}function parseValue(_0x5d963a,_0x5d322b,_0x3c53f9){var _0x47eb35={'start':undefined,'end':undefined};switch(_0x5d322b){case _0x071f('0x28'):case _0x071f('0x25'):_0x47eb35['start']=_0x3c53f9[_0x071f('0x9')](',');break;case _0x071f('0x2d'):_0x47eb35[_0x071f('0x37')]='%'+_0x3c53f9+'%';break;case _0x071f('0x2e'):_0x47eb35['start']=_0x3c53f9+'%';break;case'$endsWith':_0x47eb35[_0x071f('0x37')]='%'+_0x3c53f9;break;case _0x071f('0x16'):var _0xbca658=_0x3c53f9['split'](',');var _0x3c53f9=_0xbca658['shift']();var _0x2c1a36=_0xbca658[_0x071f('0x38')]();if(_0x5d963a===_0x071f('0x13')){_0x3c53f9=moment(_0x3c53f9)[_0x071f('0x39')](0x0,!![])[_0x071f('0x1d')]();_0x2c1a36=moment(_0x2c1a36)[_0x071f('0x39')](0x0,!![])[_0x071f('0x1b')](0x17,_0x071f('0x3a'))[_0x071f('0x1b')](0x3b,_0x071f('0x3b'))[_0x071f('0x1b')](0x3b,_0x071f('0x3c'))[_0x071f('0x1d')]();}_0x47eb35={'start':_0x3c53f9,'end':_0x2c1a36};break;default:_0x47eb35['start']=_0x3c53f9;break;}return _0x47eb35;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 4fbc128..040ff90 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 _0x1db9=['lower','options','lodash','sequelize','moment','keys','fields','split','forOwn','find','type','parse','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','indexOf','priority','cast','col','unsigned','substr','DESC','omit','isEmpty','isObject','isString','length','unset','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','push','getOptions','query','$id','model','map','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','object','columns','value','merge'];(function(_0x4f3b2d,_0x3bbf46){var _0x3dddfa=function(_0xb8179a){while(--_0xb8179a){_0x4f3b2d['push'](_0x4f3b2d['shift']());}};_0x3dddfa(++_0x3bbf46);}(_0x1db9,0x176));var _0x91db=function(_0x4df175,_0x50adfb){_0x4df175=_0x4df175-0x0;var _0x1af636=_0x1db9[_0x4df175];return _0x1af636;};'use strict';var _=require(_0x91db('0x0'));var sequelize=require(_0x91db('0x1'));var moment=require(_0x91db('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x340fb6){var _0xcdfaed=['ne'];try{var _0xb6de0b=JSON['parse'](_0x340fb6);var _0x95a17d=Object[_0x91db('0x3')](_0xb6de0b)[0x0];return _0xcdfaed['includes'](_0x95a17d);}catch(_0x4c9f59){return![];}}function getOperatorValue(_0x379fa9){var _0x4b3f5c=JSON['parse'](_0x379fa9);var _0x433c75=Object[_0x91db('0x3')](_0x4b3f5c)[0x0];var _0x45fea0=_0x4b3f5c[_0x433c75];return{['$'+_0x433c75]:_0x45fea0};}exports[_0x91db('0x4')]=function(_0x2d89a1){var _0x55fe3e=null;if(_0x2d89a1){_0x55fe3e=_0x2d89a1[_0x91db('0x5')](',');}return _0x55fe3e;};exports['filters']=function(_0x39e939,_0xad8dd7){var _0x177e5c={};if(!_['isEmpty'](_0x39e939)){_[_0x91db('0x6')](_0x39e939,function(_0x549be2,_0x4ac257){try{if(_0xad8dd7){var _0x55fcef=_[_0x91db('0x7')](_0xad8dd7,{'name':_0x4ac257})||{};if(hasSequelizeOperator(_0x549be2)){_0x177e5c[_0x4ac257]=getOperatorValue(_0x549be2);}else if(_0x55fcef[_0x91db('0x8')]==='DATE'&&_['isPlainObject'](_0x549be2)){var _0x2b9b98=JSON[_0x91db('0x9')](_0x549be2);var _0x1f55f5={'$gte':moment(moment(_0x2b9b98[_0x91db('0xa')])[_0x91db('0xb')]('YYYY-MM-DD'))[_0x91db('0xc')]()[_0x91db('0xb')](),'$lte':moment(moment(_0x2b9b98[_0x91db('0xd')])[_0x91db('0xb')](_0x91db('0xe')))[_0x91db('0xc')]()[_0x91db('0xf')](0x1,'s')[_0x91db('0xb')]()};_0x177e5c[_0x4ac257]=_0x1f55f5;}else if(_0x55fcef[_0x91db('0x10')]===_0x91db('0x11')){_0x177e5c[_0x4ac257]=_0x549be2;}else{_0x177e5c[_0x4ac257]=_[_0x91db('0x12')](_0x549be2)?_0x549be2:JSON[_0x91db('0x9')](_0x549be2);}}else{_0x177e5c[_0x4ac257]=_['isArray'](_0x549be2)?_0x549be2:JSON[_0x91db('0x9')](_0x549be2);}}catch(_0x23d125){_0x177e5c[_0x4ac257]=_0x549be2[_0x91db('0x5')](',');}});}return _0x177e5c;};exports[_0x91db('0x13')]=function(_0xeb51b0){_0xeb51b0=parseInt(_0xeb51b0,0xa);if(!_0xeb51b0||_0xeb51b0<0x0){_0xeb51b0=LIMIT_VALUE;}return _0xeb51b0;};exports[_0x91db('0x14')]=function(_0x5c15ef){_0x5c15ef=parseInt(_0x5c15ef,0xa);if(!_0x5c15ef||_0x5c15ef<0x0){_0x5c15ef=0x0;}return _0x5c15ef;};exports['sort']=function(_0x4158f5){var _0x137edf,_0x2c3915=null;if(_0x4158f5){_0x137edf=_0x4158f5[_0x91db('0x5')](',');_0x2c3915=_['map'](_0x137edf,function(_0x168dea){if(_0x168dea[_0x91db('0x15')]('-')===0x0){return[_0x168dea===_0x91db('0x16')?sequelize[_0x91db('0x17')](sequelize[_0x91db('0x18')](_0x91db('0x16')),_0x91db('0x19')):_0x168dea[_0x91db('0x1a')](0x1),_0x91db('0x1b')];}else{return[_0x168dea===_0x91db('0x16')?sequelize['cast'](sequelize['col'](_0x91db('0x16')),_0x91db('0x19')):_0x168dea,'ASC'];}});}return _0x2c3915;};exports[_0x91db('0x1c')]=function(_0x16efa4,_0x39ae31){if(_[_0x91db('0x1d')](_0x16efa4)){return _0x16efa4;}if(_[_0x91db('0x12')](_0x16efa4)){for(var _0x4e2a8f=0x0;_0x4e2a8f<_0x16efa4['length'];_0x4e2a8f+=0x1){_0x16efa4[_0x4e2a8f]=this[_0x91db('0x1c')](_0x16efa4[_0x4e2a8f],_0x39ae31);}return _0x16efa4;}if(!_[_0x91db('0x1e')](_0x16efa4)){return _0x16efa4;}if(_[_0x91db('0x1f')](_0x39ae31)){_0x39ae31=[_0x39ae31];}if(!_['isArray'](_0x39ae31)){return _0x16efa4;}for(var _0x3b38f2=0x0;_0x3b38f2<_0x39ae31[_0x91db('0x20')];_0x3b38f2+=0x1){_[_0x91db('0x21')](_0x16efa4,_0x39ae31[_0x3b38f2]);}for(var _0x1bb4f8 in _0x16efa4){if(_0x16efa4['hasOwnProperty'](_0x1bb4f8)){_0x16efa4[_0x1bb4f8]=this[_0x91db('0x1c')](_0x16efa4[_0x1bb4f8],_0x39ae31);}}return _0x16efa4;};exports[_0x91db('0x22')]=function(_0x1805ef){return _0x1805ef['match'](RegExp(_0x91db('0x23')))?!![]:![];};exports[_0x91db('0x24')]=function(_0x2d3ebd){return _0x2d3ebd[_0x91db('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x91db('0x26')]=function(_0x1e865e){var _0x2e6a27=[];_0x1e865e[_0x91db('0x5')](/[ ,]+/)[_0x91db('0x27')](function(_0x1b27f9){_0x1b27f9=_0x1b27f9[_0x91db('0x28')](/([^:]")"+/g,'$1');_0x1b27f9='+'+_0x1b27f9+'*';var _0x5b24b2=/[ `!@#$%^&*()_\-?~]/;if(_0x1b27f9[_0x91db('0x25')](_0x5b24b2))_0x1b27f9='\x22'+_0x1b27f9+'\x22';_0x2e6a27[_0x91db('0x29')](_0x1b27f9);});return _0x2e6a27['join']('\x20');};exports[_0x91db('0x2a')]=function(_0x1368b9,_0x73d4f4,_0x431bf6){var _0x370934={},_0x593920={};if(_0x73d4f4[_0x91db('0x2b')][_0x91db('0x2c')]){_0x73d4f4[_0x91db('0x2b')]['id']=_0x73d4f4['query'][_0x91db('0x2c')];delete _0x73d4f4['query'][_0x91db('0x2c')];}_0x370934[_0x91db('0x2d')]=_[_0x91db('0x2e')](_0x1368b9,_0x91db('0x10'));_0x370934['query']=_[_0x91db('0x3')](_0x73d4f4[_0x91db('0x2b')]);_0x370934[_0x91db('0x2f')]=_['intersection'](_0x370934[_0x91db('0x2d')],_0x370934[_0x91db('0x2b')]);_0x593920['attributes']=_[_0x91db('0x30')](_0x370934[_0x91db('0x2d')],this['fields'](_0x73d4f4[_0x91db('0x2b')]['fields']));_0x593920[_0x91db('0x31')]=_0x593920[_0x91db('0x31')]['length']?_0x593920['attributes']:_0x370934['model'];if(!_0x73d4f4[_0x91db('0x2b')][_0x91db('0x32')]('nolimit')){_0x593920[_0x91db('0x13')]=this[_0x91db('0x13')](_0x73d4f4[_0x91db('0x2b')][_0x91db('0x13')]);_0x593920[_0x91db('0x14')]=this[_0x91db('0x14')](_0x73d4f4[_0x91db('0x2b')][_0x91db('0x14')]);}_0x593920[_0x91db('0x33')]=this[_0x91db('0x34')](_0x73d4f4[_0x91db('0x2b')]['sort']);_0x593920[_0x91db('0x35')]=this['filters'](_[_0x91db('0x36')](_0x73d4f4[_0x91db('0x2b')],_0x370934['filters']),_0x1368b9);if(_0x73d4f4[_0x91db('0x2b')][_0x91db('0x37')]){var _0x16a7e9=_0x1368b9;var _0x12e86f=_0x73d4f4[_0x91db('0x2b')]['filter'];if(typeof _0x12e86f===_0x91db('0x38')){_0x16a7e9=_[_0x91db('0x37')](_0x1368b9,function(_0x1effb3){return _['includes'](_0x12e86f[_0x91db('0x39')],_0x1effb3[_0x91db('0x10')]);});_0x12e86f=_0x12e86f[_0x91db('0x3a')];}_0x593920['where']=_[_0x91db('0x3b')](_0x593920[_0x91db('0x35')],{'$or':_[_0x91db('0x2e')](_0x16a7e9,function(_0x3d73a7){if(_0x3d73a7[_0x91db('0x8')]!=='VIRTUAL'){if(_0x431bf6){return sequelize[_0x91db('0x35')](sequelize['fn']('lower',sequelize[_0x91db('0x18')](_0x3d73a7[_0x91db('0x10')])),{'$like':sequelize['fn'](_0x91db('0x3c'),'%'+_0x73d4f4[_0x91db('0x2b')][_0x91db('0x37')]+'%')});}else{var _0x2fcf33={};_0x2fcf33[_0x3d73a7[_0x91db('0x10')]]={'$like':'%'+_0x73d4f4[_0x91db('0x2b')][_0x91db('0x37')]+'%'};return _0x2fcf33;}}})});}_0x593920=_[_0x91db('0x3b')]({},_0x593920,_0x73d4f4[_0x91db('0x3d')]);return _0x593920;}; \ No newline at end of file +var _0x6c7b=['indexOf','cast','priority','unsigned','DESC','col','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','isNumeric','isEmail','match','getFullTextValue','forEach','replace','join','getOptions','$id','query','model','intersection','attributes','nolimit','order','where','pick','filter','includes','columns','VIRTUAL','lower','lodash','parse','keys','fields','split','filters','forOwn','find','type','DATE','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','map'];(function(_0x1bfa81,_0x3a1a1a){var _0x1514fe=function(_0x484961){while(--_0x484961){_0x1bfa81['push'](_0x1bfa81['shift']());}};_0x1514fe(++_0x3a1a1a);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x19b69c,_0x451651){_0x19b69c=_0x19b69c-0x0;var _0x4a4c3c=_0x6c7b[_0x19b69c];return _0x4a4c3c;};'use strict';var _=require(_0xb6c7('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4fd587){var _0x3f3910=['ne'];try{var _0x5528b3=JSON[_0xb6c7('0x1')](_0x4fd587);var _0x438aa8=Object[_0xb6c7('0x2')](_0x5528b3)[0x0];return _0x3f3910['includes'](_0x438aa8);}catch(_0x294dc9){return![];}}function getOperatorValue(_0x290c39){var _0xfe3eb9=JSON[_0xb6c7('0x1')](_0x290c39);var _0xb889c3=Object['keys'](_0xfe3eb9)[0x0];var _0x12e97e=_0xfe3eb9[_0xb889c3];return{['$'+_0xb889c3]:_0x12e97e};}exports[_0xb6c7('0x3')]=function(_0xe2ce08){var _0x9c88ae=null;if(_0xe2ce08){_0x9c88ae=_0xe2ce08[_0xb6c7('0x4')](',');}return _0x9c88ae;};exports[_0xb6c7('0x5')]=function(_0x245016,_0x42343b){var _0x594dbb={};if(!_['isEmpty'](_0x245016)){_[_0xb6c7('0x6')](_0x245016,function(_0x11a1ee,_0x2f9c01){try{if(_0x42343b){var _0x116ad8=_[_0xb6c7('0x7')](_0x42343b,{'name':_0x2f9c01})||{};if(hasSequelizeOperator(_0x11a1ee)){_0x594dbb[_0x2f9c01]=getOperatorValue(_0x11a1ee);}else if(_0x116ad8[_0xb6c7('0x8')]===_0xb6c7('0x9')&&_['isPlainObject'](_0x11a1ee)){var _0x9b32b7=JSON[_0xb6c7('0x1')](_0x11a1ee);var _0x6b946={'$gte':moment(moment(_0x9b32b7[_0xb6c7('0xa')])[_0xb6c7('0xb')](_0xb6c7('0xc')))[_0xb6c7('0xd')]()['format'](),'$lte':moment(moment(_0x9b32b7[_0xb6c7('0xe')])['format']('YYYY-MM-DD'))['utc']()[_0xb6c7('0xf')](0x1,'s')['format']()};_0x594dbb[_0x2f9c01]=_0x6b946;}else if(_0x116ad8[_0xb6c7('0x10')]===_0xb6c7('0x11')){_0x594dbb[_0x2f9c01]=_0x11a1ee;}else{_0x594dbb[_0x2f9c01]=_[_0xb6c7('0x12')](_0x11a1ee)?_0x11a1ee:JSON[_0xb6c7('0x1')](_0x11a1ee);}}else{_0x594dbb[_0x2f9c01]=_[_0xb6c7('0x12')](_0x11a1ee)?_0x11a1ee:JSON[_0xb6c7('0x1')](_0x11a1ee);}}catch(_0x2c819d){_0x594dbb[_0x2f9c01]=_0x11a1ee[_0xb6c7('0x4')](',');}});}return _0x594dbb;};exports[_0xb6c7('0x13')]=function(_0xd0434e){_0xd0434e=parseInt(_0xd0434e,0xa);if(!_0xd0434e||_0xd0434e<0x0){_0xd0434e=LIMIT_VALUE;}return _0xd0434e;};exports[_0xb6c7('0x14')]=function(_0x3f133f){_0x3f133f=parseInt(_0x3f133f,0xa);if(!_0x3f133f||_0x3f133f<0x0){_0x3f133f=0x0;}return _0x3f133f;};exports[_0xb6c7('0x15')]=function(_0x5b5022){var _0x274f76,_0x1cbcc8=null;if(_0x5b5022){_0x274f76=_0x5b5022['split'](',');_0x1cbcc8=_[_0xb6c7('0x16')](_0x274f76,function(_0x5a1c0a){if(_0x5a1c0a[_0xb6c7('0x17')]('-')===0x0){return[_0x5a1c0a==='priority'?sequelize[_0xb6c7('0x18')](sequelize['col'](_0xb6c7('0x19')),_0xb6c7('0x1a')):_0x5a1c0a['substr'](0x1),_0xb6c7('0x1b')];}else{return[_0x5a1c0a===_0xb6c7('0x19')?sequelize[_0xb6c7('0x18')](sequelize[_0xb6c7('0x1c')](_0xb6c7('0x19')),_0xb6c7('0x1a')):_0x5a1c0a,'ASC'];}});}return _0x1cbcc8;};exports[_0xb6c7('0x1d')]=function(_0x1f4e06,_0x209a21){if(_[_0xb6c7('0x1e')](_0x1f4e06)){return _0x1f4e06;}if(_['isArray'](_0x1f4e06)){for(var _0x1eb265=0x0;_0x1eb265<_0x1f4e06[_0xb6c7('0x1f')];_0x1eb265+=0x1){_0x1f4e06[_0x1eb265]=this['omit'](_0x1f4e06[_0x1eb265],_0x209a21);}return _0x1f4e06;}if(!_[_0xb6c7('0x20')](_0x1f4e06)){return _0x1f4e06;}if(_[_0xb6c7('0x21')](_0x209a21)){_0x209a21=[_0x209a21];}if(!_[_0xb6c7('0x12')](_0x209a21)){return _0x1f4e06;}for(var _0x32cd6b=0x0;_0x32cd6b<_0x209a21['length'];_0x32cd6b+=0x1){_[_0xb6c7('0x22')](_0x1f4e06,_0x209a21[_0x32cd6b]);}for(var _0x54373f in _0x1f4e06){if(_0x1f4e06[_0xb6c7('0x23')](_0x54373f)){_0x1f4e06[_0x54373f]=this[_0xb6c7('0x1d')](_0x1f4e06[_0x54373f],_0x209a21);}}return _0x1f4e06;};exports[_0xb6c7('0x24')]=function(_0x5f3be2){return _0x5f3be2['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xb6c7('0x25')]=function(_0xcd9464){return _0xcd9464[_0xb6c7('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0xb6c7('0x27')]=function(_0x41e46c){var _0x1b4180=[];_0x41e46c[_0xb6c7('0x4')](/[ ,]+/)[_0xb6c7('0x28')](function(_0x1f82bd){_0x1f82bd=_0x1f82bd[_0xb6c7('0x29')](/([^:]")"+/g,'$1');_0x1f82bd='+'+_0x1f82bd+'*';var _0x5dabdd=/[ `!@#$%^&*()_\-?~]/;if(_0x1f82bd[_0xb6c7('0x26')](_0x5dabdd))_0x1f82bd='\x22'+_0x1f82bd+'\x22';_0x1b4180['push'](_0x1f82bd);});return _0x1b4180[_0xb6c7('0x2a')]('\x20');};exports[_0xb6c7('0x2b')]=function(_0x4e9e90,_0x175e97,_0x1d070d){var _0x5534ca={},_0x52b120={};if(_0x175e97['query'][_0xb6c7('0x2c')]){_0x175e97[_0xb6c7('0x2d')]['id']=_0x175e97['query'][_0xb6c7('0x2c')];delete _0x175e97[_0xb6c7('0x2d')]['$id'];}_0x5534ca[_0xb6c7('0x2e')]=_[_0xb6c7('0x16')](_0x4e9e90,_0xb6c7('0x10'));_0x5534ca[_0xb6c7('0x2d')]=_[_0xb6c7('0x2')](_0x175e97[_0xb6c7('0x2d')]);_0x5534ca['filters']=_[_0xb6c7('0x2f')](_0x5534ca[_0xb6c7('0x2e')],_0x5534ca[_0xb6c7('0x2d')]);_0x52b120[_0xb6c7('0x30')]=_[_0xb6c7('0x2f')](_0x5534ca[_0xb6c7('0x2e')],this[_0xb6c7('0x3')](_0x175e97['query']['fields']));_0x52b120[_0xb6c7('0x30')]=_0x52b120[_0xb6c7('0x30')][_0xb6c7('0x1f')]?_0x52b120[_0xb6c7('0x30')]:_0x5534ca[_0xb6c7('0x2e')];if(!_0x175e97[_0xb6c7('0x2d')][_0xb6c7('0x23')](_0xb6c7('0x31'))){_0x52b120[_0xb6c7('0x13')]=this[_0xb6c7('0x13')](_0x175e97['query'][_0xb6c7('0x13')]);_0x52b120['offset']=this['offset'](_0x175e97[_0xb6c7('0x2d')]['offset']);}_0x52b120[_0xb6c7('0x32')]=this[_0xb6c7('0x15')](_0x175e97['query'][_0xb6c7('0x15')]);_0x52b120[_0xb6c7('0x33')]=this[_0xb6c7('0x5')](_[_0xb6c7('0x34')](_0x175e97[_0xb6c7('0x2d')],_0x5534ca['filters']),_0x4e9e90);if(_0x175e97['query'][_0xb6c7('0x35')]){var _0xb575=_0x4e9e90;var _0xb7f85b=_0x175e97[_0xb6c7('0x2d')]['filter'];if(typeof _0xb7f85b==='object'){_0xb575=_[_0xb6c7('0x35')](_0x4e9e90,function(_0x4019c){return _[_0xb6c7('0x36')](_0xb7f85b[_0xb6c7('0x37')],_0x4019c[_0xb6c7('0x10')]);});_0xb7f85b=_0xb7f85b['value'];}_0x52b120['where']=_['merge'](_0x52b120[_0xb6c7('0x33')],{'$or':_[_0xb6c7('0x16')](_0xb575,function(_0x4462dc){if(_0x4462dc['type']!==_0xb6c7('0x38')){if(_0x1d070d){return sequelize[_0xb6c7('0x33')](sequelize['fn']('lower',sequelize[_0xb6c7('0x1c')](_0x4462dc[_0xb6c7('0x10')])),{'$like':sequelize['fn'](_0xb6c7('0x39'),'%'+_0x175e97[_0xb6c7('0x2d')][_0xb6c7('0x35')]+'%')});}else{var _0x4ee526={};_0x4ee526[_0x4462dc[_0xb6c7('0x10')]]={'$like':'%'+_0x175e97[_0xb6c7('0x2d')][_0xb6c7('0x35')]+'%'};return _0x4ee526;}}})});}_0x52b120=_['merge']({},_0x52b120,_0x175e97['options']);return _0x52b120;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index c6dcaa9..68b6690 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 _0xa9ef=['openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','voiceStatusTime','queue','screenrecording','phoneBarEnableScreenRecordingByAgent','online','omit','pick','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','busy','isArray','startCase','Queue','map','getAgents','all','flatten','uniq','value','getAgentIdsByStatus','resolve','User','name','fullname','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','includes','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','lastPauseAt','chatCapacity'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xa9ef,0x1ec));var _0xfa9e=function(_0x4ddd8c,_0x2cae93){_0x4ddd8c=_0x4ddd8c-0x0;var _0x123a7a=_0xa9ef[_0x4ddd8c];return _0x123a7a;};'use strict';var _=require('lodash');var jayson=require(_0xfa9e('0x0'));var db=require(_0xfa9e('0x1'))['db'];var amiClient=jayson[_0xfa9e('0x2')][_0xfa9e('0x3')]({'port':0x232a});var routingClient=jayson[_0xfa9e('0x2')][_0xfa9e('0x3')]({'port':0x232c});function isAgentPaused(_0x597341,_0x2b0c4f){var _0x2bfb03=[_0x597341[_0xfa9e('0x4')],_0x597341[_0xfa9e('0x5')],_0x597341[_0xfa9e('0x6')],_0x597341[_0xfa9e('0x7')],_0x597341[_0xfa9e('0x8')],_0x597341[_0xfa9e('0x9')],_0x597341[_0xfa9e('0xa')]];if(!_0x2b0c4f)return _[_0xfa9e('0xb')](_0x2bfb03);var _0x29cf47=_[_0xfa9e('0xc')](_0x2bfb03);return _0x29cf47[_0xfa9e('0xd')]>0x0&&_0x29cf47[_0xfa9e('0xd')]<_0x2bfb03[_0xfa9e('0xd')]?!![]:![];}function isIdle(_0x381e38){return _0x381e38===_0xfa9e('0xe')||_0x381e38===_0xfa9e('0xf')||_0x381e38===_0xfa9e('0x10')||_0x381e38===_0xfa9e('0x11')||_[_0xfa9e('0x12')](_0x381e38);}function isAgentIdle(_0x549dcd){if(_0x549dcd['voiceStatus']!=='idle'&&_0x549dcd['voicePause']){_0x549dcd[_0xfa9e('0x13')]=_0xfa9e('0x14');return![];}return _[_0xfa9e('0xb')]([_0x549dcd['chatStatus'],_0x549dcd[_0xfa9e('0x15')],_0x549dcd[_0xfa9e('0x16')],_0x549dcd[_0xfa9e('0x17')],_0x549dcd['smsStatus'],_0x549dcd[_0xfa9e('0x13')],_0x549dcd[_0xfa9e('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xfa9e('0x19')](_0xfa9e('0x1a'),{})[_0xfa9e('0x1b')](function(_0x4b7cc5){if(_0x4b7cc5[_0xfa9e('0x1c')]){throw new Error(_0xfa9e('0x1d'));}var _0x40a9c7=_0x4b7cc5[_0xfa9e('0x1e')];return routingClient[_0xfa9e('0x19')](_0xfa9e('0x1a'),{})['then'](function(_0x17f25c){if(_0x17f25c['error']){throw new Error(_0xfa9e('0x1f'));}var _0x4f8644=_0x17f25c[_0xfa9e('0x1e')];return _[_0xfa9e('0x20')]({},_0x40a9c7,_0x4f8644);});})[_0xfa9e('0x21')](function(_0x1336fb){throw _0x1336fb;});}exports[_0xfa9e('0x22')]=getRealtimeAgents;function getAgentStatus(_0x2abe2e){var _0x6922a2=_0xfa9e('0xf');if(isAgentPaused(_0x2abe2e))_0x6922a2='pause';else if(isAgentPaused(_0x2abe2e,!![]))_0x6922a2=_0xfa9e('0x23');else if(isAgentIdle(_0x2abe2e))_0x6922a2='idle';else _0x6922a2=_0xfa9e('0x24');return _0x6922a2;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x300b66,_0x14f023){var _0x3b1f1e=_[_0xfa9e('0x25')](_0x300b66)?_0x300b66:[_0x300b66];var _0x171c3e=_[_0xfa9e('0x26')](_0x14f023)+_0xfa9e('0x27');var _0x48eee3=_[_0xfa9e('0x28')](_0x3b1f1e,function(_0x566f74){return db[_0x171c3e]['findOne']({'where':{'id':_0x566f74}})['then'](function(_0x1a5385){if(!_0x1a5385)return[];return _0x1a5385[_0xfa9e('0x29')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xfa9e('0x2a')](_0x48eee3)['then'](function(_0x3327e3){var _0x7bcc8a=_(_0x3327e3)[_0xfa9e('0x2b')]()[_0xfa9e('0x28')]('id')[_0xfa9e('0x2c')]()[_0xfa9e('0x2d')]();return _0x7bcc8a;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x10bb68,_0x2e82a4,_0x27039e){try{if(_0x2e82a4[_0xfa9e('0xd')]>0x0){_0x10bb68=_0x10bb68['filter'](function(_0x3d97a6){return _0x2e82a4['includes'](_0x3d97a6['id']);});}var _0xcb4dd4=_0x10bb68[_0xfa9e('0xc')](function(_0x3a9c1c){var _0x3fa30c=_0xfa9e('0x24');if(isAgentIdle(_0x3a9c1c)){_0x3fa30c=_0xfa9e('0xe');}return _0x3fa30c===_0x27039e;});return _[_0xfa9e('0x28')](_0xcb4dd4,'id');}catch(_0x2bd88f){throw _0x2bd88f;}}exports[_0xfa9e('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4b4171,_0x1ed6b2,_0x40b239){return Promise[_0xfa9e('0x2f')]()[_0xfa9e('0x1b')](function(){if(_0x1ed6b2[_0xfa9e('0xd')]>0x0){_0x4b4171=_0x4b4171['filter'](function(_0x46ed87){return _0x1ed6b2['includes'](_0x46ed87['id']);});}return _0x4b4171;})[_0xfa9e('0x1b')](function(){return db[_0xfa9e('0x30')]['findAll']({'attributes':['id',_0xfa9e('0x31'),_0xfa9e('0x32'),_0xfa9e('0x4'),_0xfa9e('0x5'),'mailPause',_0xfa9e('0x7'),_0xfa9e('0x8'),_0xfa9e('0x9'),_0xfa9e('0xa'),_0xfa9e('0x33')],'where':{'id':{'$in':_[_0xfa9e('0x28')](_0x4b4171,'id')}},'raw':!![]});})['then'](function(_0x58c49a){return _0x58c49a['map'](function(_0x91998a){var _0x38e6ef=_[_0xfa9e('0x34')](_0x4b4171,['id',_0x91998a['id']]);var _0x511c42=filterAgentAttributes(_0x38e6ef);_[_0xfa9e('0x20')](_0x91998a,_0x511c42);_0x91998a[_0xfa9e('0x35')]=getAgentStatus(_0x91998a);return _0x91998a;});})[_0xfa9e('0x1b')](function(_0x4c5fad){var _0x54f697=sortAgentsByStatus(_0x4c5fad,_0x40b239);return _[_0xfa9e('0x28')](_0x54f697,'id');})[_0xfa9e('0x21')](function(_0x1c8f30){throw _0x1c8f30;});}exports[_0xfa9e('0x36')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5458eb){var _0x1a5e09={'fields':[],'order':null};var _0x3763e4=_0x5458eb[_0xfa9e('0x37')](',');_0x1a5e09[_0xfa9e('0x38')]=_[_0xfa9e('0xc')](_0x3763e4,function(_0x1e9e5b){if(!_0x1e9e5b[_0xfa9e('0x39')](_0xfa9e('0x35'))){return!![];}_0x1a5e09[_0xfa9e('0x3a')]=_[_0xfa9e('0x3b')](_0x1e9e5b,'-')?_0xfa9e('0x3c'):_0xfa9e('0x3d');return![];});return _0x1a5e09;}exports[_0xfa9e('0x3e')]=getUpdatedSortOptions;function validateSortParameter(_0x5ab4d6){if(_0x5ab4d6['includes'](_0xfa9e('0x32'))&&!_0x5ab4d6['includes'](_0xfa9e('0x3f'))){var _0x5de674=_0x5ab4d6['substring'](0x0,_0x5ab4d6[_0xfa9e('0x40')](_0xfa9e('0x32')));_0x5ab4d6+=','+_0x5de674+_0xfa9e('0x3f');}return _0x5ab4d6;}exports[_0xfa9e('0x41')]=validateSortParameter;function sortAgentsByStatus(_0x43a2ca,_0x12fe64){var _0x2d20df=_0x43a2ca[_0xfa9e('0x42')](function(_0x10f58a,_0x3193ef){if(_0x10f58a[_0xfa9e('0x35')]===_0x3193ef['globalStatus']){if(_0x10f58a[_0xfa9e('0x35')]==='pause'){if(_0x12fe64===_0xfa9e('0x3c')){return(_0x10f58a[_0xfa9e('0x33')]||'')<(_0x3193ef[_0xfa9e('0x33')]||'')||_0x10f58a[_0xfa9e('0x32')]['toLowerCase']()>_0x3193ef[_0xfa9e('0x32')]['toLowerCase']()?0x1:-0x1;}else{return(_0x10f58a['pauseType']||'')<(_0x3193ef['pauseType']||'')||_0x10f58a[_0xfa9e('0x32')]['toLowerCase']()>_0x3193ef[_0xfa9e('0x32')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x12fe64==='DESC'){return _0x10f58a['fullname'][_0xfa9e('0x43')]()<_0x3193ef[_0xfa9e('0x32')]['toLowerCase']()?0x1:-0x1;}else{return _0x10f58a[_0xfa9e('0x32')][_0xfa9e('0x43')]()<_0x3193ef[_0xfa9e('0x32')][_0xfa9e('0x43')]()?-0x1:0x1;}}}else{if(_0x12fe64===_0xfa9e('0x3c')){return _0x10f58a[_0xfa9e('0x35')]<_0x3193ef[_0xfa9e('0x35')]?0x1:-0x1;}else{return _0x10f58a[_0xfa9e('0x35')]<_0x3193ef[_0xfa9e('0x35')]?-0x1:0x1;}}});return _0x2d20df;}exports[_0xfa9e('0x44')]=sortAgentsByStatus;function filterAgentAttributes(_0x3fb985){var _0x4019fc=[_0xfa9e('0x45'),'online','lastLoginAt',_0xfa9e('0x46'),'pauseType','lastPauseAt',_0xfa9e('0x3f'),'address','chatPause',_0xfa9e('0x7'),_0xfa9e('0x6'),_0xfa9e('0x8'),_0xfa9e('0xa'),'faxPause','voicePause',_0xfa9e('0x47'),_0xfa9e('0x48'),_0xfa9e('0x49'),_0xfa9e('0x4a'),_0xfa9e('0x4b'),_0xfa9e('0x4c'),_0xfa9e('0x4d'),_0xfa9e('0x4e'),'mailCurrentCapacity','smsCurrentCapacity',_0xfa9e('0x4f'),_0xfa9e('0x50'),_0xfa9e('0x51'),_0xfa9e('0x17'),'mailStatus','smsStatus',_0xfa9e('0x18'),_0xfa9e('0x15'),_0xfa9e('0x13'),_0xfa9e('0x52'),_0xfa9e('0x53'),_0xfa9e('0x54'),_0xfa9e('0x55'),_0xfa9e('0x56'),'faxStatusTime',_0xfa9e('0x57'),_0xfa9e('0x58'),'destconnectedlinenum',_0xfa9e('0x59'),_0xfa9e('0x5a'),'phoneBarEnableAutomaticScreenRecording','routealias'];var _0x555593=['chatPause',_0xfa9e('0x7'),_0xfa9e('0x6'),_0xfa9e('0x8'),'whatsappPause','faxPause',_0xfa9e('0x9'),_0xfa9e('0x5b')];var _0x34bd61=_(_0x3fb985)[_0xfa9e('0x5c')](_0x555593)[_0xfa9e('0x5d')](_0x4019fc)[_0xfa9e('0x2d')]();return _0x34bd61;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0x5992=['findAll','name','openchannelPause','pauseType','find','catch','getSortedAgentsIdsByStatus','split','fields','globalStatus','order','DESC','ASC','getUpdatedSortOptions','fullname','substring','indexOf','internal','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','chatStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','routealias','omit','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','unavailable','isNil','voiceStatus','pause','every','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','error','Agents','merge','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','Queue','getAgents','flatten','map','uniq','value','getAgentIdsByQueues','includes','resolve','User'];(function(_0x1ea7f2,_0x1d999f){var _0x4e23f4=function(_0x30b765){while(--_0x30b765){_0x1ea7f2['push'](_0x1ea7f2['shift']());}};_0x4e23f4(++_0x1d999f);}(_0x5992,0x8d));var _0x2599=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x5992[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x2599('0x0'));var jayson=require(_0x2599('0x1'));var db=require(_0x2599('0x2'))['db'];var amiClient=jayson[_0x2599('0x3')]['http']({'port':0x232a});var routingClient=jayson['client'][_0x2599('0x4')]({'port':0x232c});function isAgentPaused(_0x274988,_0x1494eb){var _0x393334=[_0x274988[_0x2599('0x5')],_0x274988[_0x2599('0x6')],_0x274988[_0x2599('0x7')],_0x274988['openchannelPause'],_0x274988[_0x2599('0x8')],_0x274988[_0x2599('0x9')],_0x274988[_0x2599('0xa')]];if(!_0x1494eb)return _['every'](_0x393334);var _0x449788=_[_0x2599('0xb')](_0x393334);return _0x449788[_0x2599('0xc')]>0x0&&_0x449788[_0x2599('0xc')]<_0x393334[_0x2599('0xc')]?!![]:![];}function isIdle(_0x3e37f6){return _0x3e37f6===_0x2599('0xd')||_0x3e37f6===_0x2599('0xe')||_0x3e37f6===_0x2599('0xf')||_0x3e37f6==='ringing'||_[_0x2599('0x10')](_0x3e37f6);}function isAgentIdle(_0x5e7833){if(_0x5e7833[_0x2599('0x11')]!==_0x2599('0xd')&&_0x5e7833['voicePause']){_0x5e7833[_0x2599('0x11')]=_0x2599('0x12');return![];}return _[_0x2599('0x13')]([_0x5e7833[_0x2599('0x14')],_0x5e7833[_0x2599('0x15')],_0x5e7833[_0x2599('0x16')],_0x5e7833[_0x2599('0x17')],_0x5e7833[_0x2599('0x18')],_0x5e7833[_0x2599('0x11')],_0x5e7833[_0x2599('0x19')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x2599('0x1a')]('Agents',{})[_0x2599('0x1b')](function(_0x5e9a19){if(_0x5e9a19[_0x2599('0x1c')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x5f0d74=_0x5e9a19['result'];return routingClient[_0x2599('0x1a')](_0x2599('0x1d'),{})['then'](function(_0x938d95){if(_0x938d95['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0xe71454=_0x938d95['result'];return _[_0x2599('0x1e')]({},_0x5f0d74,_0xe71454);});})['catch'](function(_0x301879){throw _0x301879;});}exports[_0x2599('0x1f')]=getRealtimeAgents;function getAgentStatus(_0x36ca98){var _0x433e7c='unknown';if(isAgentPaused(_0x36ca98))_0x433e7c=_0x2599('0x12');else if(isAgentPaused(_0x36ca98,!![]))_0x433e7c=_0x2599('0x20');else if(isAgentIdle(_0x36ca98))_0x433e7c=_0x2599('0xd');else _0x433e7c=_0x2599('0x21');return _0x433e7c;}exports[_0x2599('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x329dcc,_0x25985a){var _0x2f5d2b=_[_0x2599('0x23')](_0x329dcc)?_0x329dcc:[_0x329dcc];var _0x41bc52=_[_0x2599('0x24')](_0x25985a)+_0x2599('0x25');var _0x2ae16c=_['map'](_0x2f5d2b,function(_0x1df084){return db[_0x41bc52]['findOne']({'where':{'id':_0x1df084}})[_0x2599('0x1b')](function(_0x3acbc7){if(!_0x3acbc7)return[];return _0x3acbc7[_0x2599('0x26')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x2ae16c)[_0x2599('0x1b')](function(_0x5857a3){var _0x429779=_(_0x5857a3)[_0x2599('0x27')]()[_0x2599('0x28')]('id')[_0x2599('0x29')]()[_0x2599('0x2a')]();return _0x429779;});}exports[_0x2599('0x2b')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x29fa7d,_0x3e57c3,_0x27a87f){try{if(_0x3e57c3['length']>0x0){_0x29fa7d=_0x29fa7d[_0x2599('0xb')](function(_0x1e3b88){return _0x3e57c3[_0x2599('0x2c')](_0x1e3b88['id']);});}var _0x39ba05=_0x29fa7d[_0x2599('0xb')](function(_0x430ecf){var _0x3dcb6e='busy';if(isAgentIdle(_0x430ecf)){_0x3dcb6e=_0x2599('0xd');}return _0x3dcb6e===_0x27a87f;});return _[_0x2599('0x28')](_0x39ba05,'id');}catch(_0x3b73f3){throw _0x3b73f3;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x45237b,_0x376e9a,_0x24e541){return Promise[_0x2599('0x2d')]()[_0x2599('0x1b')](function(){if(_0x376e9a[_0x2599('0xc')]>0x0){_0x45237b=_0x45237b['filter'](function(_0x517540){return _0x376e9a[_0x2599('0x2c')](_0x517540['id']);});}return _0x45237b;})[_0x2599('0x1b')](function(){return db[_0x2599('0x2e')][_0x2599('0x2f')]({'attributes':['id',_0x2599('0x30'),'fullname',_0x2599('0x5'),_0x2599('0x6'),_0x2599('0x7'),_0x2599('0x31'),'smsPause',_0x2599('0x9'),_0x2599('0xa'),_0x2599('0x32')],'where':{'id':{'$in':_[_0x2599('0x28')](_0x45237b,'id')}},'raw':!![]});})[_0x2599('0x1b')](function(_0x3c46c0){return _0x3c46c0[_0x2599('0x28')](function(_0x77db4e){var _0xdd6ec6=_[_0x2599('0x33')](_0x45237b,['id',_0x77db4e['id']]);var _0x56b830=filterAgentAttributes(_0xdd6ec6);_[_0x2599('0x1e')](_0x77db4e,_0x56b830);_0x77db4e['globalStatus']=getAgentStatus(_0x77db4e);return _0x77db4e;});})['then'](function(_0x28e990){var _0x8843d1=sortAgentsByStatus(_0x28e990,_0x24e541);return _[_0x2599('0x28')](_0x8843d1,'id');})[_0x2599('0x34')](function(_0x12e898){throw _0x12e898;});}exports[_0x2599('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x3ecc65){var _0x5254b7={'fields':[],'order':null};var _0x32c0ed=_0x3ecc65[_0x2599('0x36')](',');_0x5254b7[_0x2599('0x37')]=_['filter'](_0x32c0ed,function(_0x143a1f){if(!_0x143a1f[_0x2599('0x2c')](_0x2599('0x38'))){return!![];}_0x5254b7[_0x2599('0x39')]=_['startsWith'](_0x143a1f,'-')?_0x2599('0x3a'):_0x2599('0x3b');return![];});return _0x5254b7;}exports[_0x2599('0x3c')]=getUpdatedSortOptions;function validateSortParameter(_0x5da406){if(_0x5da406[_0x2599('0x2c')](_0x2599('0x3d'))&&!_0x5da406[_0x2599('0x2c')]('internal')){var _0x28de8d=_0x5da406[_0x2599('0x3e')](0x0,_0x5da406[_0x2599('0x3f')](_0x2599('0x3d')));_0x5da406+=','+_0x28de8d+_0x2599('0x40');}return _0x5da406;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x35cf5e,_0x592dea){var _0x24a21f=_0x35cf5e[_0x2599('0x41')](function(_0x46c666,_0x1f6397){if(_0x46c666[_0x2599('0x38')]===_0x1f6397[_0x2599('0x38')]){if(_0x46c666[_0x2599('0x38')]===_0x2599('0x12')){if(_0x592dea===_0x2599('0x3a')){return(_0x46c666[_0x2599('0x32')]||'')<(_0x1f6397[_0x2599('0x32')]||'')||_0x46c666['fullname'][_0x2599('0x42')]()>_0x1f6397[_0x2599('0x3d')][_0x2599('0x42')]()?0x1:-0x1;}else{return(_0x46c666[_0x2599('0x32')]||'')<(_0x1f6397[_0x2599('0x32')]||'')||_0x46c666[_0x2599('0x3d')][_0x2599('0x42')]()>_0x1f6397[_0x2599('0x3d')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x592dea===_0x2599('0x3a')){return _0x46c666[_0x2599('0x3d')][_0x2599('0x42')]()<_0x1f6397[_0x2599('0x3d')][_0x2599('0x42')]()?0x1:-0x1;}else{return _0x46c666['fullname'][_0x2599('0x42')]()<_0x1f6397[_0x2599('0x3d')][_0x2599('0x42')]()?-0x1:0x1;}}}else{if(_0x592dea==='DESC'){return _0x46c666[_0x2599('0x38')]<_0x1f6397[_0x2599('0x38')]?0x1:-0x1;}else{return _0x46c666[_0x2599('0x38')]<_0x1f6397[_0x2599('0x38')]?-0x1:0x1;}}});return _0x24a21f;}exports[_0x2599('0x43')]=sortAgentsByStatus;function filterAgentAttributes(_0x412f9b){var _0xaf7b6=[_0x2599('0x44'),_0x2599('0x45'),_0x2599('0x46'),'lastPauseAt','pauseType',_0x2599('0x47'),_0x2599('0x40'),_0x2599('0x48'),_0x2599('0x5'),_0x2599('0x31'),_0x2599('0x7'),_0x2599('0x8'),'whatsappPause',_0x2599('0x6'),_0x2599('0x9'),_0x2599('0x49'),_0x2599('0x4a'),_0x2599('0x4b'),_0x2599('0x4c'),_0x2599('0x4d'),_0x2599('0x4e'),_0x2599('0x4f'),_0x2599('0x50'),_0x2599('0x51'),_0x2599('0x52'),'whatsappCurrentCapacity',_0x2599('0x53'),_0x2599('0x14'),_0x2599('0x17'),_0x2599('0x16'),'smsStatus','whatsappStatus','faxStatus',_0x2599('0x11'),_0x2599('0x54'),'openchannelStatusTime','mailStatusTime',_0x2599('0x55'),_0x2599('0x56'),_0x2599('0x57'),_0x2599('0x58'),_0x2599('0x59'),_0x2599('0x5a'),_0x2599('0x5b'),'phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording',_0x2599('0x5c')];var _0x20ed55=[_0x2599('0x5'),_0x2599('0x31'),_0x2599('0x7'),_0x2599('0x8'),_0x2599('0xa'),_0x2599('0x6'),_0x2599('0x9'),'online'];var _0x4ffd02=_(_0x412f9b)[_0x2599('0x5d')](_0x20ed55)['pick'](_0xaf7b6)[_0x2599('0x2a')]();return _0x4ffd02;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 937a7fb..3369412 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x27cbf1,_0x14613c){var _0x1cfb81=function(_0x2c001a){while(--_0x2c001a){_0x27cbf1['push'](_0x27cbf1['shift']());}};_0x1cfb81(++_0x14613c);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 1ca7831..6fd2c2e 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 _0xb9fb=['replace','macAddress','ipAddress','digest','substring','lodash','crypto','child_process','../environment','networkInterfaces','orderBy','length','filter','family','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','update','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid'];(function(_0x1add3e,_0xd9efce){var _0xe2662d=function(_0x416085){while(--_0x416085){_0x1add3e['push'](_0x1add3e['shift']());}};_0xe2662d(++_0xd9efce);}(_0xb9fb,0xaa));var _0xbb9f=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xb9fb[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xbb9f('0x0'));var os=require('os');var crypto=require(_0xbb9f('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0xbb9f('0x2'))['execSync'];var config=require(_0xbb9f('0x3'));function getInterfaces(){var _0x19149f=[];var _0x241a59=os[_0xbb9f('0x4')]();var _0x42122d=_[_0xbb9f('0x5')](_['keys'](_0x241a59));for(var _0x2f67d1=0x0;_0x2f67d1<_0x42122d[_0xbb9f('0x6')];_0x2f67d1++){var _0x5ad2e8=_0x241a59[_0x42122d[_0x2f67d1]][_0xbb9f('0x7')](function(_0x404c44){return _0x404c44[_0xbb9f('0x8')]==='IPv4'&&_0x404c44[_0xbb9f('0x9')]===![];});_0x19149f=_0x19149f['concat'](_0x5ad2e8);}return _0x19149f;}function getFirstInterface(){var _0x11d275=_[_0xbb9f('0xa')](getInterfaces());return{'macAddress':_0x11d275&&_0x11d275[_0xbb9f('0xb')]?_0x11d275[_0xbb9f('0xb')]:_0xbb9f('0xc'),'ipAddress':_0x11d275&&_0x11d275[_0xbb9f('0xd')]?_0x11d275['address']:_0xbb9f('0xe')};}exports[_0xbb9f('0xf')]=getFirstInterface;function getCPUhash(){var _0x47341e=_['orderBy'](os[_0xbb9f('0x10')]()['map'](function(_0x43214d){return _0x43214d[_0xbb9f('0x11')];}))[_0xbb9f('0x12')](':');return crypto[_0xbb9f('0x13')]('md5')[_0xbb9f('0x14')](_0x47341e)['digest'](_0xbb9f('0x15'));}exports[_0xbb9f('0x16')]=function(){var _0x5b3fc6=os[_0xbb9f('0x17')]();var _0x4e54ac=/[0-9a-f-]{36}/;if(config[_0xbb9f('0x18')]&&_0x4e54ac[_0xbb9f('0x19')](config['licenseToken'])){return config[_0xbb9f('0x18')];}else if(_0x5b3fc6===_0xbb9f('0x1a')){return exec(_0xbb9f('0x1b'),{'encoding':'utf8'})[_0xbb9f('0x1c')]('\x0d\x0a','');}else{var _0x4bf6a7=getFirstInterface();var _0x1456e6=getCPUhash();var _0x4ae4bd=_0x1456e6+'|'+os['hostname']()+'|'+_0x4bf6a7[_0xbb9f('0x1d')]+'|'+_0x4bf6a7[_0xbb9f('0x1e')];var _0x29c358=crypto[_0xbb9f('0x13')]('md5')[_0xbb9f('0x14')](_0x4ae4bd)[_0xbb9f('0x1f')](_0xbb9f('0x15'));return _0x29c358[_0xbb9f('0x20')](0x0,0x8)+'-'+_0x29c358[_0xbb9f('0x20')](0x8,0xc)+'-'+_0x29c358[_0xbb9f('0x20')](0xc,0x10)+'-'+_0x29c358[_0xbb9f('0x20')](0x10,0x14)+'-'+_0x29c358[_0xbb9f('0x20')](0x14);}}; \ No newline at end of file +var _0xf288=['../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','md5','digest','hex','getUuid','licenseToken','win32','dmidecode\x20--string\x20system-uuid','replace','ipAddress','createHash','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync'];(function(_0x4a7858,_0x4e1c9b){var _0x24fb3e=function(_0x1d39e4){while(--_0x1d39e4){_0x4a7858['push'](_0x4a7858['shift']());}};_0x24fb3e(++_0x4e1c9b);}(_0xf288,0x1cf));var _0x8f28=function(_0x1293fa,_0x446d6b){_0x1293fa=_0x1293fa-0x0;var _0x1dd054=_0xf288[_0x1293fa];return _0x1dd054;};'use strict';var _=require(_0x8f28('0x0'));var os=require('os');var crypto=require(_0x8f28('0x1'));var machine=require(_0x8f28('0x2'));var exec=require(_0x8f28('0x3'))[_0x8f28('0x4')];var config=require(_0x8f28('0x5'));function getInterfaces(){var _0x11def9=[];var _0xcaab53=os[_0x8f28('0x6')]();var _0x2edf4f=_[_0x8f28('0x7')](_[_0x8f28('0x8')](_0xcaab53));for(var _0x21a4b7=0x0;_0x21a4b7<_0x2edf4f[_0x8f28('0x9')];_0x21a4b7++){var _0x48b7c8=_0xcaab53[_0x2edf4f[_0x21a4b7]][_0x8f28('0xa')](function(_0xa4d116){return _0xa4d116[_0x8f28('0xb')]===_0x8f28('0xc')&&_0xa4d116[_0x8f28('0xd')]===![];});_0x11def9=_0x11def9[_0x8f28('0xe')](_0x48b7c8);}return _0x11def9;}function getFirstInterface(){var _0x4df942=_[_0x8f28('0xf')](getInterfaces());return{'macAddress':_0x4df942&&_0x4df942[_0x8f28('0x10')]?_0x4df942[_0x8f28('0x10')]:_0x8f28('0x11'),'ipAddress':_0x4df942&&_0x4df942[_0x8f28('0x12')]?_0x4df942[_0x8f28('0x12')]:_0x8f28('0x13')};}exports[_0x8f28('0x14')]=getFirstInterface;function getCPUhash(){var _0x2d1d9d=_['orderBy'](os[_0x8f28('0x15')]()[_0x8f28('0x16')](function(_0x5939ea){return _0x5939ea[_0x8f28('0x17')];}))[_0x8f28('0x18')](':');return crypto['createHash'](_0x8f28('0x19'))['update'](_0x2d1d9d)[_0x8f28('0x1a')](_0x8f28('0x1b'));}exports[_0x8f28('0x1c')]=function(){var _0x12c675=os['platform']();var _0x25f722=/[0-9a-f-]{36}/;if(config[_0x8f28('0x1d')]&&_0x25f722['test'](config[_0x8f28('0x1d')])){return config[_0x8f28('0x1d')];}else if(_0x12c675===_0x8f28('0x1e')){return exec(_0x8f28('0x1f'),{'encoding':'utf8'})[_0x8f28('0x20')]('\x0d\x0a','');}else{var _0x4933e6=getFirstInterface();var _0x4db452=getCPUhash();var _0x2ca19d=_0x4db452+'|'+os['hostname']()+'|'+_0x4933e6['macAddress']+'|'+_0x4933e6[_0x8f28('0x21')];var _0x5eb199=crypto[_0x8f28('0x22')]('md5')['update'](_0x2ca19d)['digest'](_0x8f28('0x1b'));return _0x5eb199['substring'](0x0,0x8)+'-'+_0x5eb199[_0x8f28('0x23')](0x8,0xc)+'-'+_0x5eb199['substring'](0xc,0x10)+'-'+_0x5eb199[_0x8f28('0x23')](0x10,0x14)+'-'+_0x5eb199[_0x8f28('0x23')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 187a936..2cefbea 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 _0xaf82=['YYYY-MM-DD\x20HH:mm','days','error','message','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','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'];(function(_0x36316a,_0x56181b){var _0x378bd5=function(_0x4c98ac){while(--_0x4c98ac){_0x36316a['push'](_0x36316a['shift']());}};_0x378bd5(++_0x56181b);}(_0xaf82,0x1dd));var _0x2af8=function(_0x5449fc,_0xfe9f54){_0x5449fc=_0x5449fc-0x0;var _0x17565c=_0xaf82[_0x5449fc];return _0x17565c;};'use strict';var util=require(_0x2af8('0x0'));var moment=require(_0x2af8('0x1'));var rp=require(_0x2af8('0x2'));var BPromise=require(_0x2af8('0x3'));var pkginfo=require(_0x2af8('0x4'))(module,_0x2af8('0x5'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x2af8('0x6'));var hardware=require(_0x2af8('0x7'));var logger=require(_0x2af8('0x8'))(_0x2af8('0x9'));var HOST=_0x2af8('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x28908b){return new BPromise(function(_0x855f44,_0x85aaad){var _0x745a8=util[_0x2af8('0xb')](_0x2af8('0xc'),HOST,_0x28908b,module[_0x2af8('0xd')]['version']);if(oldToken){_0x745a8=util[_0x2af8('0xb')](_0x2af8('0xe'),HOST,_0x28908b,module[_0x2af8('0xd')][_0x2af8('0x5')],oldToken);}var _0x4d6d6c={'uri':_0x745a8,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x4d6d6c)[_0x2af8('0xf')](function(_0x566f06){_0x855f44(_0x566f06);})[_0x2af8('0x10')](function(_0x49982e){_0x85aaad(_0x49982e);});});}function manageLicense(_0x1488b2,_0x4215c5){var _0x45790d=_0x4215c5[_0x2af8('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x45790d[_0x2af8('0x12')]!==_0x1488b2&&!_0x45790d[_0x2af8('0x13')]){oldToken=_0x45790d[_0x2af8('0x12')];}httpRequest(_0x1488b2)[_0x2af8('0xf')](function(_0x5ef4eb){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5ef4eb['active']){isOldTokenSent=![];if(!_0x45790d[_0x2af8('0x9')]&&_0x45790d[_0x2af8('0x9')]!=_0x5ef4eb['license']||_0x45790d[_0x2af8('0x9')]&&_0x45790d[_0x2af8('0x13')]){logger[_0x2af8('0x14')](_0x2af8('0x15'));}if(_0x45790d[_0x2af8('0x9')]&&!_0x45790d[_0x2af8('0x13')]&&_0x45790d['license']!=_0x5ef4eb[_0x2af8('0x9')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x45790d[_0x2af8('0x9')]&&!_0x45790d['data2']&&_0x45790d[_0x2af8('0x9')]==_0x5ef4eb['license']){return _0x4215c5;}return _0x4215c5[_0x2af8('0x16')]({'data1':_0x1488b2,'data2':null,'license':_0x5ef4eb[_0x2af8('0x9')]});}else{if(_0x5ef4eb[_0x2af8('0x9')]||_0x45790d[_0x2af8('0x9')]){if(!_0x45790d[_0x2af8('0x13')]){if(_0x45790d[_0x2af8('0x12')]==_0x1488b2){GRAY_PERIOD_REASON=_0x2af8('0x17');logger['info'](_0x2af8('0x18'));}else{GRAY_PERIOD_REASON=_0x2af8('0x19');logger[_0x2af8('0x14')](_0x2af8('0x1a'),_0x45790d[_0x2af8('0x12')],_0x1488b2);}logger[_0x2af8('0x14')](_0x2af8('0x1b'),GRAY_PERIOD_REASON[_0x2af8('0x1c')](),moment()[_0x2af8('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x4215c5[_0x2af8('0x16')]({'data2':encryptor[_0x2af8('0x1d')](moment()['format'](_0x2af8('0x1e')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x45790d['data2']),_0x2af8('0x1f'))>DAYS){logger[_0x2af8('0x14')]('DEMO\x20START\x20AT\x20%s',moment()[_0x2af8('0xb')](_0x2af8('0x1e')));isOldTokenSent=![];return _0x4215c5[_0x2af8('0x16')]({'data1':_0x1488b2,'data2':null,'license':null});}}}else{if(_0x45790d['data1']!=_0x1488b2){logger[_0x2af8('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x45790d[_0x2af8('0x12')],_0x1488b2);return _0x4215c5['update']({'data1':_0x1488b2,'data2':null,'license':null});}}}return _0x4215c5;})[_0x2af8('0xf')](function(_0x5f0081){_0x4215c5=_0x5f0081;})['catch'](function(_0x5ba357){logger[_0x2af8('0x20')](_0x5ba357[_0x2af8('0x21')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x2af8('0x22')](),_0x4215c5);},TIME);});}function defaultLicense(){var _0x25409e=hardware[_0x2af8('0x22')]();if(_0x25409e){return db['License'][_0x2af8('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x25409e}})[_0x2af8('0x24')](function(_0x2388db,_0x15532a){logger[_0x2af8('0x14')](_0x2af8('0x25'),_0x25409e);manageLicense(_0x25409e,_0x2388db);})['catch'](function(_0x1f235d){logger['error'](_0x1f235d['message']);});}}exports[_0x2af8('0x26')]=defaultLicense; \ No newline at end of file +var _0xcca2=['%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','diff','decryptString','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','message','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports'];(function(_0x27ea02,_0x5ac748){var _0x313b9b=function(_0x3c6308){while(--_0x3c6308){_0x27ea02['push'](_0x27ea02['shift']());}};_0x313b9b(++_0x5ac748);}(_0xcca2,0x1b5));var _0x2cca=function(_0x2bc104,_0x1249e1){_0x2bc104=_0x2bc104-0x0;var _0x333584=_0xcca2[_0x2bc104];return _0x333584;};'use strict';var util=require(_0x2cca('0x0'));var moment=require(_0x2cca('0x1'));var rp=require(_0x2cca('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x2cca('0x3'))(module,_0x2cca('0x4'));var db=require(_0x2cca('0x5'))['db'];var encryptor=require(_0x2cca('0x6'));var hardware=require(_0x2cca('0x7'));var logger=require(_0x2cca('0x8'))(_0x2cca('0x9'));var HOST=_0x2cca('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3e9760){return new BPromise(function(_0x1ec688,_0x34c9ee){var _0x2460d9=util[_0x2cca('0xb')](_0x2cca('0xc'),HOST,_0x3e9760,module[_0x2cca('0xd')][_0x2cca('0x4')]);if(oldToken){_0x2460d9=util[_0x2cca('0xb')](_0x2cca('0xe'),HOST,_0x3e9760,module[_0x2cca('0xd')][_0x2cca('0x4')],oldToken);}var _0xffbc00={'uri':_0x2460d9,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0xffbc00)[_0x2cca('0xf')](function(_0x4664f6){_0x1ec688(_0x4664f6);})[_0x2cca('0x10')](function(_0x5c6b79){_0x34c9ee(_0x5c6b79);});});}function manageLicense(_0x2adf06,_0x59c20e){var _0x2e9b70=_0x59c20e[_0x2cca('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x2e9b70[_0x2cca('0x12')]!==_0x2adf06&&!_0x2e9b70[_0x2cca('0x13')]){oldToken=_0x2e9b70['data1'];}httpRequest(_0x2adf06)['then'](function(_0x4e45d5){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4e45d5[_0x2cca('0x14')]){isOldTokenSent=![];if(!_0x2e9b70[_0x2cca('0x9')]&&_0x2e9b70[_0x2cca('0x9')]!=_0x4e45d5[_0x2cca('0x9')]||_0x2e9b70['license']&&_0x2e9b70[_0x2cca('0x13')]){logger[_0x2cca('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x2e9b70[_0x2cca('0x9')]&&!_0x2e9b70[_0x2cca('0x13')]&&_0x2e9b70[_0x2cca('0x9')]!=_0x4e45d5[_0x2cca('0x9')]){logger[_0x2cca('0x15')](_0x2cca('0x16'));}if(_0x2e9b70[_0x2cca('0x9')]&&!_0x2e9b70['data2']&&_0x2e9b70[_0x2cca('0x9')]==_0x4e45d5[_0x2cca('0x9')]){return _0x59c20e;}return _0x59c20e['update']({'data1':_0x2adf06,'data2':null,'license':_0x4e45d5[_0x2cca('0x9')]});}else{if(_0x4e45d5['license']||_0x2e9b70[_0x2cca('0x9')]){if(!_0x2e9b70[_0x2cca('0x13')]){if(_0x2e9b70[_0x2cca('0x12')]==_0x2adf06){GRAY_PERIOD_REASON=_0x2cca('0x17');logger[_0x2cca('0x15')](_0x2cca('0x18'));}else{GRAY_PERIOD_REASON=_0x2cca('0x19');logger[_0x2cca('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2e9b70[_0x2cca('0x12')],_0x2adf06);}logger[_0x2cca('0x15')](_0x2cca('0x1a'),GRAY_PERIOD_REASON[_0x2cca('0x1b')](),moment()[_0x2cca('0xb')](_0x2cca('0x1c')));return _0x59c20e[_0x2cca('0x1d')]({'data2':encryptor['encryptString'](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x2cca('0x1e')](encryptor[_0x2cca('0x1f')](_0x2e9b70[_0x2cca('0x13')]),_0x2cca('0x20'))>DAYS){logger[_0x2cca('0x15')]('DEMO\x20START\x20AT\x20%s',moment()[_0x2cca('0xb')](_0x2cca('0x1c')));isOldTokenSent=![];return _0x59c20e[_0x2cca('0x1d')]({'data1':_0x2adf06,'data2':null,'license':null});}}}else{if(_0x2e9b70[_0x2cca('0x12')]!=_0x2adf06){logger['info'](_0x2cca('0x21'),_0x2e9b70[_0x2cca('0x12')],_0x2adf06);return _0x59c20e['update']({'data1':_0x2adf06,'data2':null,'license':null});}}}return _0x59c20e;})[_0x2cca('0xf')](function(_0x4e875d){_0x59c20e=_0x4e875d;})[_0x2cca('0x10')](function(_0x479119){logger['error'](_0x479119[_0x2cca('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x59c20e);},TIME);});}function defaultLicense(){var _0x3d4702=hardware[_0x2cca('0x23')]();if(_0x3d4702){return db['License'][_0x2cca('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x3d4702}})[_0x2cca('0x25')](function(_0x270d34,_0x2a4348){logger[_0x2cca('0x15')](_0x2cca('0x26'),_0x3d4702);manageLicense(_0x3d4702,_0x270d34);})[_0x2cca('0x10')](function(_0x597c67){logger[_0x2cca('0x27')](_0x597c67[_0x2cca('0x22')]);});}}exports[_0x2cca('0x28')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index a5521c5..84c716c 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 _0x3191=['days','grayReason','message','findAll','role','sequelize','col','admin','user','telephone','users','telephones','forEach','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','find','defaults','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','decryptString','format','%s:%s:%s','parse','machineUuid','gray','deadline','add'];(function(_0xa61109,_0x5a526a){var _0x1e8796=function(_0x5e1e55){while(--_0x5e1e55){_0xa61109['push'](_0xa61109['shift']());}};_0x1e8796(++_0x5a526a);}(_0x3191,0x9c));var _0x1319=function(_0x1dca10,_0x1e05f1){_0x1dca10=_0x1dca10-0x0;var _0x5d26cf=_0x3191[_0x1dca10];return _0x5d26cf;};'use strict';var util=require(_0x1319('0x0'));var _=require(_0x1319('0x1'));var moment=require(_0x1319('0x2'));var BPromise=require('bluebird');var hardware=require(_0x1319('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x1319('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1319('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x1319('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1319('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x1319('0x7'),'machineUuid':hardware[_0x1319('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3812bc){return new BPromise(function(_0x4936c6,_0x5c5c62){return db[_0x1319('0x9')][_0x1319('0xa')](_[_0x1319('0xb')](_0x3812bc,{'raw':!![],'where':{'id':0x1}}))[_0x1319('0xc')](function(_0xdc19ba){return checkLicense(_0xdc19ba,null);})[_0x1319('0xc')](function(_0x305ddf){_0x4936c6(_0x305ddf);return;})[_0x1319('0xd')](function(_0x3406cf){_0x5c5c62(_0x3406cf);});});}function checkLicense(_0x3801c0,_0x52fc54){if(!_0x3801c0){demoLicense[_0x1319('0xe')]=_0x3801c0['data1'];return demoLicense;}try{var _0x406568=_0x52fc54||_0x3801c0[_0x1319('0xf')];if(_[_0x1319('0x10')](_0x406568)){throw new Error(_0x1319('0x11'));}var _0x3f3333=_0x3801c0[_0x1319('0x12')];var _0x75f16=_0x3801c0['data2'];var _0xa36b3d=_0x3f3333[_0x1319('0x13')]('-')[0x4];var _0x35ff3c=_0x3f3333['split']('-')[0x0];var _0x4388ed=encryptor[_0x1319('0x14')](_0x406568,util[_0x1319('0x15')](_0x1319('0x16'),_0xa36b3d,_0x3f3333,_0x35ff3c));var _0x35ec7e=JSON[_0x1319('0x17')](_0x4388ed);_0x35ec7e['demo']=![];_0x35ec7e['uuid']=_0x3f3333;_0x35ec7e[_0x1319('0x18')]=hardware[_0x1319('0x8')]();if(_0x75f16){var _0x2e716b=encryptor[_0x1319('0x14')](_0x75f16);_0x35ec7e[_0x1319('0x19')]=_0x2e716b;_0x35ec7e[_0x1319('0x1a')]=moment(_0x2e716b)[_0x1319('0x1b')](0x7,_0x1319('0x1c'))[_0x1319('0x15')]();_0x35ec7e[_0x1319('0x1d')]=_0x35ec7e[_0x1319('0xe')]!=_0x35ec7e[_0x1319('0x18')]?'changed':'disabled';}return _0x35ec7e;}catch(_0x2a0429){breakingLicense['uuid']=_0x3801c0[_0x1319('0x12')];breakingLicense[_0x1319('0x1e')]=_0x2a0429['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4be2c3,_0x22f92e){getLicense()[_0x1319('0xc')](function(_0xecc59){return db['User'][_0x1319('0x1f')]({'attributes':[_0x1319('0x20'),[db[_0x1319('0x21')]['fn']('COUNT',db[_0x1319('0x21')][_0x1319('0x22')](_0x1319('0x20'))),'count']],'group':_0x1319('0x20'),'where':{'role':{'$or':[_0x1319('0x23'),_0x1319('0x24'),_0x1319('0x25')]}},'raw':!![]})[_0x1319('0xc')](function(_0x252b7b){var _0x3ca7bd={'user':_0xecc59[_0x1319('0x26')]||0x0,'telephone':_0xecc59[_0x1319('0x27')]||0x0};_0x252b7b[_0x1319('0x28')](function(_0x1b2e51){var _0x573000=_0x1b2e51['role']==='admin'?_0x1319('0x24'):_0x1b2e51[_0x1319('0x20')];_0x3ca7bd[_0x573000]-=_0x1b2e51[_0x1319('0x29')];if(_0x3ca7bd[_0x573000]<0x0)_0x3ca7bd[_0x573000]=0x0;});_0x4be2c3(_0x3ca7bd);return;});})[_0x1319('0xd')](function(_0x284e9d){_0x22f92e(_0x284e9d);});});}function checkUserLimits(_0x55a279){return new BPromise(function(_0x185750,_0x4e1d92){getLimits()[_0x1319('0xc')](function(_0x399a2e){var _0x198de4=_[_0x1319('0x2a')](_[_0x1319('0x2b')](_0x55a279,_0x1319('0x20')),[_0x1319('0x23'),_0x1319('0x24'),'telephone']);var _0x298693=(_0x198de4[_0x1319('0x23')]||0x0)+(_0x198de4[_0x1319('0x24')]||0x0);var _0x49aa6b=_0x198de4['telephone']||0x0;if(_0x298693>_0x399a2e[_0x1319('0x24')])return _0x4e1d92(_0x1319('0x2c'));if(_0x49aa6b>_0x399a2e[_0x1319('0x25')])return _0x4e1d92('License\x20limit\x20reached\x20for\x20telephones');return _0x185750();})['catch'](function(_0xb41a35){_0x4e1d92(_0xb41a35);});});}module[_0x1319('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x3522=['exports','util','lodash','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','then','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','format','%s:%s:%s','parse','demo','machineUuid','decryptString','gray','days','changed','disabled','User','findAll','COUNT','sequelize','count','role','admin','user','telephone','telephones','forEach','catch','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones'];(function(_0x3f5f5b,_0x458417){var _0x2f9511=function(_0x35eafc){while(--_0x35eafc){_0x3f5f5b['push'](_0x3f5f5b['shift']());}};_0x2f9511(++_0x458417);}(_0x3522,0xad));var _0x2352=function(_0x5baa68,_0x441410){_0x5baa68=_0x5baa68-0x0;var _0x7dfd49=_0x3522[_0x5baa68];return _0x7dfd49;};'use strict';var util=require(_0x2352('0x0'));var _=require(_0x2352('0x1'));var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0x2352('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0x2352('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2352('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x2352('0x5'),'machineUuid':hardware[_0x2352('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2352('0x7'),'machineUuid':hardware[_0x2352('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5e9d47){return new BPromise(function(_0x2e609d,_0x19277b){return db[_0x2352('0x8')][_0x2352('0x9')](_['defaults'](_0x5e9d47,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x117771){return checkLicense(_0x117771,null);})[_0x2352('0xa')](function(_0x42cead){_0x2e609d(_0x42cead);return;})['catch'](function(_0x3cceb9){_0x19277b(_0x3cceb9);});});}function checkLicense(_0x22bc5c,_0xfaa812){if(!_0x22bc5c){demoLicense[_0x2352('0xb')]=_0x22bc5c[_0x2352('0xc')];return demoLicense;}try{var _0x59c5a6=_0xfaa812||_0x22bc5c[_0x2352('0xd')];if(_[_0x2352('0xe')](_0x59c5a6)){throw new Error(_0x2352('0xf'));}var _0x83018a=_0x22bc5c[_0x2352('0xc')];var _0x2a7f9a=_0x22bc5c[_0x2352('0x10')];var _0x28b5a7=_0x83018a['split']('-')[0x4];var _0x5c1916=_0x83018a[_0x2352('0x11')]('-')[0x0];var _0x37e5bf=encryptor['decryptString'](_0x59c5a6,util[_0x2352('0x12')](_0x2352('0x13'),_0x28b5a7,_0x83018a,_0x5c1916));var _0x231455=JSON[_0x2352('0x14')](_0x37e5bf);_0x231455[_0x2352('0x15')]=![];_0x231455['uuid']=_0x83018a;_0x231455[_0x2352('0x16')]=hardware[_0x2352('0x6')]();if(_0x2a7f9a){var _0x3996e1=encryptor[_0x2352('0x17')](_0x2a7f9a);_0x231455[_0x2352('0x18')]=_0x3996e1;_0x231455['deadline']=moment(_0x3996e1)['add'](0x7,_0x2352('0x19'))[_0x2352('0x12')]();_0x231455['grayReason']=_0x231455[_0x2352('0xb')]!=_0x231455[_0x2352('0x16')]?_0x2352('0x1a'):_0x2352('0x1b');}return _0x231455;}catch(_0x2b1ae4){breakingLicense[_0x2352('0xb')]=_0x22bc5c['data1'];breakingLicense['message']=_0x2b1ae4['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x23c2b6,_0x520d2d){getLicense()['then'](function(_0x1c3fe3){return db[_0x2352('0x1c')][_0x2352('0x1d')]({'attributes':['role',[db['sequelize']['fn'](_0x2352('0x1e'),db[_0x2352('0x1f')]['col']('role')),_0x2352('0x20')]],'group':_0x2352('0x21'),'where':{'role':{'$or':[_0x2352('0x22'),_0x2352('0x23'),_0x2352('0x24')]}},'raw':!![]})[_0x2352('0xa')](function(_0x1dc13b){var _0x23602a={'user':_0x1c3fe3['users']||0x0,'telephone':_0x1c3fe3[_0x2352('0x25')]||0x0};_0x1dc13b[_0x2352('0x26')](function(_0x21d4fd){var _0x3dbd37=_0x21d4fd[_0x2352('0x21')]==='admin'?_0x2352('0x23'):_0x21d4fd[_0x2352('0x21')];_0x23602a[_0x3dbd37]-=_0x21d4fd[_0x2352('0x20')];if(_0x23602a[_0x3dbd37]<0x0)_0x23602a[_0x3dbd37]=0x0;});_0x23c2b6(_0x23602a);return;});})[_0x2352('0x27')](function(_0x262001){_0x520d2d(_0x262001);});});}function checkUserLimits(_0x81c09c){return new BPromise(function(_0x4f766e,_0x3543aa){getLimits()[_0x2352('0xa')](function(_0x559e1f){var _0x33c283=_['pick'](_['countBy'](_0x81c09c,_0x2352('0x21')),[_0x2352('0x22'),_0x2352('0x23'),_0x2352('0x24')]);var _0x23b479=(_0x33c283[_0x2352('0x22')]||0x0)+(_0x33c283[_0x2352('0x23')]||0x0);var _0x24ba5c=_0x33c283[_0x2352('0x24')]||0x0;if(_0x23b479>_0x559e1f['user'])return _0x3543aa(_0x2352('0x28'));if(_0x24ba5c>_0x559e1f[_0x2352('0x24')])return _0x3543aa(_0x2352('0x29'));return _0x4f766e();})['catch'](function(_0x2c27f5){_0x3543aa(_0x2c27f5);});});}module[_0x2352('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index c0b2901..8cb2efb 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 _0xb62e=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x1f8e49,_0x12af6c){var _0x51596e=function(_0x199fc0){while(--_0x199fc0){_0x1f8e49['push'](_0x1f8e49['shift']());}};_0x51596e(++_0x12af6c);}(_0xb62e,0x1de));var _0xeb62=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xb62e[_0x1ac595];return _0x455fff;};'use strict';module[_0xeb62('0x0')]={'DOMAIN':_0xeb62('0x1'),'SESSION_SECRET':_0xeb62('0x2'),'GOOGLE_ID':_0xeb62('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x4991=['secret','exports','myappanuglar-secret'];(function(_0xd72df6,_0x4a8eba){var _0x871e42=function(_0x15ee82){while(--_0x15ee82){_0xd72df6['push'](_0xd72df6['shift']());}};_0x871e42(++_0x4a8eba);}(_0x4991,0xf7));var _0x1499=function(_0x3554c0,_0x4cc8e1){_0x3554c0=_0x3554c0-0x0;var _0x4588c8=_0x4991[_0x3554c0];return _0x4588c8;};'use strict';module[_0x1499('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x1499('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x1499('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 47c945e..01fbc1e 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8cf3=['fileLogger','../utils/loggers'];(function(_0x55cbf9,_0x5dc59a){var _0x551663=function(_0x472ed4){while(--_0x472ed4){_0x55cbf9['push'](_0x55cbf9['shift']());}};_0x551663(++_0x5dc59a);}(_0x8cf3,0x97));var _0x38cf=function(_0x4f6fee,_0x4d9445){_0x4f6fee=_0x4f6fee-0x0;var _0xaa30e4=_0x8cf3[_0x4f6fee];return _0xaa30e4;};'use strict';var fileLogger=require(_0x38cf('0x0'))[_0x38cf('0x1')];module['exports']=fileLogger; \ No newline at end of file +var _0x888b=['exports','fileLogger'];(function(_0x4f837f,_0x2ccc3b){var _0x43e776=function(_0x28468b){while(--_0x28468b){_0x4f837f['push'](_0x4f837f['shift']());}};_0x43e776(++_0x2ccc3b);}(_0x888b,0xff));var _0xb888=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x888b[_0x122ef9];return _0x42fba0;};'use strict';var fileLogger=require('../utils/loggers')[_0xb888('0x0')];module[_0xb888('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 278d8da..b2f72c3 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 _0x84d7=['../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','path','express','join','../../services/express/index.js','ami'];(function(_0x22356f,_0x59464a){var _0x413ad3=function(_0x2b98c0){while(--_0x2b98c0){_0x22356f['push'](_0x22356f['shift']());}};_0x413ad3(++_0x59464a);}(_0x84d7,0xff));var _0x784d=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x84d7[_0xac151d];return _0x111dba;};'use strict';var path=require(_0x784d('0x0'));var os=require('os');var config={'apps':[{'name':_0x784d('0x1'),'script':path[_0x784d('0x2')](__dirname,_0x784d('0x3'))},{'name':_0x784d('0x4'),'script':path[_0x784d('0x2')](__dirname,_0x784d('0x5'))},{'name':_0x784d('0x6'),'script':path[_0x784d('0x2')](__dirname,_0x784d('0x7'))},{'name':_0x784d('0x8'),'script':path['join'](__dirname,_0x784d('0x9'))},{'name':_0x784d('0xa'),'script':path[_0x784d('0x2')](__dirname,_0x784d('0xb'))},{'name':_0x784d('0xc'),'script':path['join'](__dirname,'../../services/xdr/index.js')}]};module['exports']=config; \ No newline at end of file +var _0x256e=['path','express','join','../../services/express/index.js','../../services/ami/index.js','email','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x5d9c08,_0x68d66e){var _0x3d07ae=function(_0x1f6d8d){while(--_0x1f6d8d){_0x5d9c08['push'](_0x5d9c08['shift']());}};_0x3d07ae(++_0x68d66e);}(_0x256e,0x1cc));var _0xe256=function(_0x5898cd,_0x30bf84){_0x5898cd=_0x5898cd-0x0;var _0x3ae503=_0x256e[_0x5898cd];return _0x3ae503;};'use strict';var path=require(_0xe256('0x0'));var os=require('os');var config={'apps':[{'name':_0xe256('0x1'),'script':path[_0xe256('0x2')](__dirname,_0xe256('0x3'))},{'name':'ami','script':path[_0xe256('0x2')](__dirname,_0xe256('0x4'))},{'name':'agi','script':path[_0xe256('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0xe256('0x5'),'script':path[_0xe256('0x2')](__dirname,'../../services/email/index.js')},{'name':_0xe256('0x6'),'script':path[_0xe256('0x2')](__dirname,_0xe256('0x7'))},{'name':_0xe256('0x8'),'script':path['join'](__dirname,_0xe256('0x9'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 86a9b53..6db189e 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 _0x7ba2=['then','disconnect','restart','list','describe','delete','dump','pm2','bluebird','start','stop'];(function(_0x46d263,_0x2e7448){var _0x474711=function(_0x2a8d5d){while(--_0x2a8d5d){_0x46d263['push'](_0x46d263['shift']());}};_0x474711(++_0x2e7448);}(_0x7ba2,0x1e0));var _0x27ba=function(_0x14e393,_0x5ef7b3){_0x14e393=_0x14e393-0x0;var _0x5b5ffa=_0x7ba2[_0x14e393];return _0x5b5ffa;};'use strict';var pm2=require(_0x27ba('0x0'));var BPromise=require(_0x27ba('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x4e21d1,_0x19fea7){return pm2['connect'](function(_0x467eae){if(_0x467eae){return _0x19fea7(_0x467eae);}return _0x4e21d1('connected');});});};exports['start']=function(_0x5020bd){return connect()['then'](function(){return new BPromise(function(_0x579c27,_0x35f8d0){return pm2[_0x27ba('0x2')](_0x5020bd,function(_0x25e087,_0x24df58){if(_0x25e087){return _0x35f8d0(_0x25e087);}pm2['disconnect']();return _0x579c27(_0x24df58);});});});};exports[_0x27ba('0x3')]=function(_0x45eee0){return connect()[_0x27ba('0x4')](function(){return new BPromise(function(_0x7983c1,_0x1acc5f){return pm2['stop'](_0x45eee0,function(_0x36a45f,_0x1f0451){if(_0x36a45f){return _0x1acc5f(_0x36a45f);}pm2[_0x27ba('0x5')]();return _0x7983c1(_0x1f0451);});});});};exports[_0x27ba('0x6')]=function(_0x100590){return connect()[_0x27ba('0x4')](function(){return new BPromise(function(_0x243f12,_0x1fb169){return pm2[_0x27ba('0x6')](_0x100590,function(_0x27f3aa,_0x1fa1e7){if(_0x27f3aa){return _0x1fb169(_0x27f3aa);}pm2['disconnect']();return _0x243f12(_0x1fa1e7);});});});};exports[_0x27ba('0x7')]=function(){return connect()[_0x27ba('0x4')](function(){return new BPromise(function(_0x3ada61,_0x42f254){return pm2[_0x27ba('0x7')](function(_0x304e00,_0x39cf65){if(_0x304e00){return _0x42f254(_0x304e00);}pm2[_0x27ba('0x5')]();return _0x3ada61(_0x39cf65);});});});};exports[_0x27ba('0x8')]=function(_0x3e21eb){return connect()[_0x27ba('0x4')](function(){return new BPromise(function(_0x59d485,_0x4aa403){return pm2[_0x27ba('0x8')](_0x3e21eb,function(_0x3e96cf,_0x4a3386){if(_0x3e96cf){return _0x4aa403(_0x3e96cf);}pm2['disconnect']();return _0x59d485(_0x4a3386);});});});};exports[_0x27ba('0x9')]=function(_0x519488){return connect()['then'](function(){return new BPromise(function(_0x37a88f,_0x38456c){return pm2[_0x27ba('0x9')](_0x519488,function(_0x496022,_0x260e59){if(_0x496022){return _0x38456c(_0x496022);}pm2[_0x27ba('0x5')]();return _0x37a88f(_0x260e59);});});});};exports[_0x27ba('0xa')]=function(){return connect()[_0x27ba('0x4')](function(){return new BPromise(function(_0x4d3108,_0x58fbf8){return pm2[_0x27ba('0xa')](function(_0x46edf1){if(_0x46edf1){return _0x58fbf8(_0x46edf1);}return _0x4d3108('saved');});});});}; \ No newline at end of file +var _0xd1c8=['delete','dump','saved','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe'];(function(_0x378721,_0x588c68){var _0x110423=function(_0x3ba06f){while(--_0x3ba06f){_0x378721['push'](_0x378721['shift']());}};_0x110423(++_0x588c68);}(_0xd1c8,0x10d));var _0x8d1c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd1c8[_0x3dd15e];return _0x231fd0;};'use strict';var pm2=require('pm2');var BPromise=require(_0x8d1c('0x0'));var config=require(_0x8d1c('0x1'));function connect(){return new BPromise(function(_0x24cf33,_0x13d0f6){return pm2[_0x8d1c('0x2')](function(_0x1209f6){if(_0x1209f6){return _0x13d0f6(_0x1209f6);}return _0x24cf33(_0x8d1c('0x3'));});});};exports[_0x8d1c('0x4')]=function(_0x332fde){return connect()[_0x8d1c('0x5')](function(){return new BPromise(function(_0x12eec9,_0x3e9c93){return pm2[_0x8d1c('0x4')](_0x332fde,function(_0x279012,_0x47ec91){if(_0x279012){return _0x3e9c93(_0x279012);}pm2[_0x8d1c('0x6')]();return _0x12eec9(_0x47ec91);});});});};exports[_0x8d1c('0x7')]=function(_0x34a8c5){return connect()[_0x8d1c('0x5')](function(){return new BPromise(function(_0x14c6a4,_0x329779){return pm2[_0x8d1c('0x7')](_0x34a8c5,function(_0xc41858,_0x338861){if(_0xc41858){return _0x329779(_0xc41858);}pm2[_0x8d1c('0x6')]();return _0x14c6a4(_0x338861);});});});};exports[_0x8d1c('0x8')]=function(_0x2e6f8b){return connect()[_0x8d1c('0x5')](function(){return new BPromise(function(_0x241181,_0x2ec9a5){return pm2[_0x8d1c('0x8')](_0x2e6f8b,function(_0xd13029,_0x1251b3){if(_0xd13029){return _0x2ec9a5(_0xd13029);}pm2[_0x8d1c('0x6')]();return _0x241181(_0x1251b3);});});});};exports['list']=function(){return connect()[_0x8d1c('0x5')](function(){return new BPromise(function(_0x22b7de,_0x465d49){return pm2[_0x8d1c('0x9')](function(_0x14d03e,_0xbe577f){if(_0x14d03e){return _0x465d49(_0x14d03e);}pm2[_0x8d1c('0x6')]();return _0x22b7de(_0xbe577f);});});});};exports[_0x8d1c('0xa')]=function(_0xba5055){return connect()[_0x8d1c('0x5')](function(){return new BPromise(function(_0x119709,_0x5d566e){return pm2[_0x8d1c('0xa')](_0xba5055,function(_0x249f56,_0xd00c84){if(_0x249f56){return _0x5d566e(_0x249f56);}pm2[_0x8d1c('0x6')]();return _0x119709(_0xd00c84);});});});};exports[_0x8d1c('0xb')]=function(_0x2ed4f2){return connect()[_0x8d1c('0x5')](function(){return new BPromise(function(_0x564e90,_0x456dbc){return pm2['delete'](_0x2ed4f2,function(_0x5f55c7,_0x275eef){if(_0x5f55c7){return _0x456dbc(_0x5f55c7);}pm2[_0x8d1c('0x6')]();return _0x564e90(_0x275eef);});});});};exports[_0x8d1c('0xc')]=function(){return connect()[_0x8d1c('0x5')](function(){return new BPromise(function(_0x1fcfbf,_0x5ea454){return pm2[_0x8d1c('0xc')](function(_0x312760){if(_0x312760){return _0x5ea454(_0x312760);}return _0x1fcfbf(_0x8d1c('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 1e75b97..7baed9c 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 _0xf0ab=['Setting','chatTimeout','then','ChatInteraction','lastMsgAt','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','format','YYYY-MM-DD\x20HH:mm:ss','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','lodash','moment','ioredis','redis','defaults','socket.io-emitter'];(function(_0x24092c,_0x171263){var _0x5f2cfc=function(_0x1fe393){while(--_0x1fe393){_0x24092c['push'](_0x24092c['shift']());}};_0x5f2cfc(++_0x171263);}(_0xf0ab,0x192));var _0xbf0a=function(_0x2df5b6,_0x272dd1){_0x2df5b6=_0x2df5b6-0x0;var _0x1c1010=_0xf0ab[_0x2df5b6];return _0x1c1010;};'use strict';var _=require(_0xbf0a('0x0'));var moment=require(_0xbf0a('0x1'));var Redis=require(_0xbf0a('0x2'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')('schedule');config[_0xbf0a('0x3')]=_[_0xbf0a('0x4')](config[_0xbf0a('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xbf0a('0x5'))(new Redis(config[_0xbf0a('0x3')]));function closeInteractions(){var _0x47a679=0x0;var _0x196bea=[];return db[_0xbf0a('0x6')]['find']({'raw':!![],'attributes':['id',_0xbf0a('0x7')],'where':{'id':0x1}})[_0xbf0a('0x8')](function(_0x4f3c67){_0x47a679=_0x4f3c67['chatTimeout'];if(_0x47a679){return db[_0xbf0a('0x9')]['findAll']({'raw':!![],'attributes':['id',_0xbf0a('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x4f3c67[_0xbf0a('0x7')],'minutes')}}});}else{return[];}})[_0xbf0a('0x8')](function(_0x1ca109){if(_0x1ca109&&_0x1ca109[_0xbf0a('0xb')]){_0x196bea=_[_0xbf0a('0xc')](_0x1ca109||[],'id');logger[_0xbf0a('0xd')](_0xbf0a('0xe'),_0x196bea[_0xbf0a('0xf')]());return db[_0xbf0a('0x9')][_0xbf0a('0x10')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xbf0a('0x11')](_0xbf0a('0x12'))},{'where':{'id':_0x196bea}});}})['then'](function(){if(_0x196bea&&_0x196bea[_0xbf0a('0xb')]){logger[_0xbf0a('0xd')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x196bea[_0xbf0a('0xf')]());for(var _0x340081=0x0;_0x340081<_0x196bea['length'];_0x340081++){io['emit'](_0xbf0a('0x13'),{'id':_0x196bea[_0x340081],'closed':!![]});}}})[_0xbf0a('0x14')](function(_0x221637){logger[_0xbf0a('0x15')](_0xbf0a('0x16'),_0x221637?util['inspect'](_0x221637,{'showHidden':![],'depth':null}):'');});}exports[_0xbf0a('0x17')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x3721=['info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','../logger','schedule','redis','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','lastMsgAt','subtract','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','timeout','then'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3721,0x18b));var _0x1372=function(_0x3caa65,_0x4aa770){_0x3caa65=_0x3caa65-0x0;var _0x4aeba7=_0x3721[_0x3caa65];return _0x4aeba7;};'use strict';var _=require(_0x1372('0x0'));var moment=require(_0x1372('0x1'));var Redis=require(_0x1372('0x2'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x1372('0x3'))(_0x1372('0x4'));config['redis']=_['defaults'](config[_0x1372('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1372('0x6'))(new Redis(config['redis']));function closeInteractions(){var _0xcd2d81=0x0;var _0x42455c=[];return db[_0x1372('0x7')][_0x1372('0x8')]({'raw':!![],'attributes':['id',_0x1372('0x9')],'where':{'id':0x1}})['then'](function(_0x2000e5){_0xcd2d81=_0x2000e5[_0x1372('0x9')];if(_0xcd2d81){return db[_0x1372('0xa')]['findAll']({'raw':!![],'attributes':['id',_0x1372('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x1372('0xc')](_0x2000e5[_0x1372('0x9')],_0x1372('0xd'))}}});}else{return[];}})['then'](function(_0x469deb){if(_0x469deb&&_0x469deb[_0x1372('0xe')]){_0x42455c=_[_0x1372('0xf')](_0x469deb||[],'id');logger['info'](_0x1372('0x10'),_0x42455c[_0x1372('0x11')]());return db[_0x1372('0xa')][_0x1372('0x12')]({'closeReason':'system','disposition':_0x1372('0x13'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x42455c}});}})[_0x1372('0x14')](function(){if(_0x42455c&&_0x42455c['length']){logger[_0x1372('0x15')](_0x1372('0x16'),_0x42455c[_0x1372('0x11')]());for(var _0x518740=0x0;_0x518740<_0x42455c[_0x1372('0xe')];_0x518740++){io['emit']('chatInteraction:update',{'id':_0x42455c[_0x518740],'closed':!![]});}}})[_0x1372('0x17')](function(_0x2aabc5){logger['error'](_0x1372('0x18'),_0x2aabc5?util[_0x1372('0x19')](_0x2aabc5,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index a7351a3..0759b92 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 _0xc6ee=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x255aaf,_0x282056){var _0x145bd2=function(_0x6e8c61){while(--_0x6e8c61){_0x255aaf['push'](_0x255aaf['shift']());}};_0x145bd2(++_0x282056);}(_0xc6ee,0xb2));var _0xec6e=function(_0x253099,_0x4761b5){_0x253099=_0x253099-0x0;var _0x1f0861=_0xc6ee[_0x253099];return _0x1f0861;};'use strict';function start(){var _0x5bab8d=require(_0xec6e('0x0'));return _0x5bab8d[_0xec6e('0x1')]();}module[_0xec6e('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +'use strict';function start(){var _0x1c2de1=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x1c2de1['startAllRefreshIntervals']();}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 a6142fc..79abd1d 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 _0xcfca=['length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','active','isBetween','startAt','add','cron','endAt','update','update\x20cron','start','util','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','MailAccount','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename','savename','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','catch','stringify','data','isNil','subtractNumber\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','CloudProvider','jobs','toString','keyBy','intersection','difference'];(function(_0x55dbd4,_0x281067){var _0x38f690=function(_0x529876){while(--_0x529876){_0x55dbd4['push'](_0x55dbd4['shift']());}};_0x38f690(++_0x281067);}(_0xcfca,0x6a));var _0xacfc=function(_0x6e459a,_0x2b648f){_0x6e459a=_0x6e459a-0x0;var _0x519335=_0xcfca[_0x6e459a];return _0x519335;};'use strict';var fs=require('fs');var util=require(_0xacfc('0x0'));var path=require(_0xacfc('0x1'));var _=require('lodash');var moment=require(_0xacfc('0x2'));var CronJobManager=require(_0xacfc('0x3'));var jayson=require(_0xacfc('0x4'));var BPromise=require(_0xacfc('0x5'));var logger=require(_0xacfc('0x6'))(_0xacfc('0x7'));var db=require(_0xacfc('0x8'))['db'];var analyticCustomReportController=require(_0xacfc('0x9'));var analyticDefaultReportController=require(_0xacfc('0xa'));var client=jayson[_0xacfc('0xb')][_0xacfc('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x23c2a0,_0x213cca){return function(){logger['info'](_0xacfc('0xd'),_0x23c2a0[_0xacfc('0xe')]);var _0x52bf19=!![];var _0x196b0d=_0x23c2a0['MailAccount'][_0xacfc('0xf')]();var _0x49be8e={'account':_0x196b0d,'message':{'from':util[_0xacfc('0x10')]('\x22%s\x22\x20<%s>',_0x23c2a0[_0xacfc('0x11')]['name'],_0x23c2a0[_0xacfc('0x11')][_0xacfc('0xe')]||_0x23c2a0[_0xacfc('0x11')][_0xacfc('0x12')][_0xacfc('0x13')]),'to':_0x23c2a0[_0xacfc('0xe')],'cc':_0x23c2a0['cc'],'bcc':_0x23c2a0[_0xacfc('0x14')],'subject':util[_0xacfc('0x10')](_0xacfc('0x15'),_0x213cca[_0xacfc('0x16')],_0x23c2a0[_0xacfc('0x17')],_0x23c2a0[_0xacfc('0x18')])}};var _0x2590f0=path[_0xacfc('0x19')](__dirname,_0xacfc('0x1a'));var _0x56e606=_0x213cca['savename'];var _0x2fb7a7=util['format'](_0xacfc('0x1b'),path[_0xacfc('0x1c')](_0x213cca[_0xacfc('0x1d')],path[_0xacfc('0x1e')](_0x213cca['savename'])),_0xacfc('0x1f'));var _0x5ed1b7=path[_0xacfc('0x19')](_0x2590f0,_0x56e606);var _0x15cd1c=path[_0xacfc('0x19')](_0x2590f0,_0x2fb7a7);if(fs[_0xacfc('0x20')](_0x5ed1b7)){_0x213cca[_0xacfc('0x21')]=_0xacfc('0x22');_0x49be8e[_0xacfc('0x23')][_0xacfc('0x24')]=[{'filename':_0x56e606,'path':_0x5ed1b7}];_0x49be8e[_0xacfc('0x23')][_0xacfc('0x25')]=util[_0xacfc('0x10')](_0xacfc('0x26'),JSON['stringify'](_0x213cca,null,0x2));}else if(fs[_0xacfc('0x20')](_0x15cd1c)){_0x213cca['status']=_0xacfc('0x22');_0x49be8e[_0xacfc('0x23')][_0xacfc('0x24')]=[{'filename':_0x2fb7a7,'path':_0x15cd1c}];}else{_0x49be8e[_0xacfc('0x23')][_0xacfc('0x25')]=_0xacfc('0x27');if(!_0x23c2a0[_0xacfc('0x28')]){_0x52bf19=![];logger[_0xacfc('0x29')](_0xacfc('0x2a'));}}if(_0x52bf19){return client[_0xacfc('0x2b')](_0xacfc('0x2c'),_0x49be8e)[_0xacfc('0x2d')](function(_0x287f25){if(_0x287f25[_0xacfc('0x2e')]){return logger[_0xacfc('0x2e')](_0xacfc('0x2f'),JSON['stringify'](_0x287f25));}return logger['info']('email\x20sent');})[_0xacfc('0x30')](function(_0x310fd9){return logger[_0xacfc('0x2e')]('error\x20mail',JSON[_0xacfc('0x31')](_0x310fd9));});}};}function handleError(){return function(_0x27be3a){return logger[_0xacfc('0x2e')](JSON[_0xacfc('0x31')](_0x27be3a));};}function handleResult(_0x41de71){return function(_0x5b4f17){logger['info'](_0xacfc('0x32'),JSON[_0xacfc('0x31')](_0x5b4f17));if(_0x41de71['MailAccount']&&_0x41de71['MailAccount'][_0xacfc('0x12')]&&!_['isNil'](_0x41de71[_0xacfc('0xe')])){setTimeout(handleSendEmail(_0x41de71,_0x5b4f17),0x3c*0x3e8);}};}function handleJob(_0x2f99b1){return function(){try{if(_[_0xacfc('0x33')](_0x2f99b1['subtractNumber'])){return logger[_0xacfc('0x29')](_0xacfc('0x34'));}if(_[_0xacfc('0x33')](_0x2f99b1['subtractUnit'])){return logger[_0xacfc('0x29')]('subtractUnit\x20null\x20or\x20undefined');}var _0x8fab={'startDate':moment()['subtract'](_0x2f99b1[_0xacfc('0x17')],_0x2f99b1[_0xacfc('0x18')])[_0xacfc('0x10')](_0xacfc('0x35')),'endDate':moment()[_0xacfc('0x10')](_0xacfc('0x35')),'type':_0xacfc('0x36'),'output':_0x2f99b1[_0xacfc('0x37')],'name':_0x2f99b1[_0xacfc('0x16')]};if(!_['isNil'](_0x2f99b1[_0xacfc('0x38')])){logger[_0xacfc('0x29')]('exec\x20defaul\x20report\x20id:%s',_0x2f99b1[_0xacfc('0x38')]);return analyticDefaultReportController['runReport']({'id':_0x2f99b1[_0xacfc('0x38')]},_0x8fab)[_0xacfc('0x2d')](handleResult(_0x2f99b1))['catch'](handleError());}if(!_[_0xacfc('0x33')](_0x2f99b1[_0xacfc('0x39')])){logger[_0xacfc('0x29')](_0xacfc('0x3a'),_0x2f99b1[_0xacfc('0x39')]);return analyticCustomReportController[_0xacfc('0x3b')]({'id':_0x2f99b1[_0xacfc('0x39')]},_0x8fab)[_0xacfc('0x2d')](handleResult(_0x2f99b1))[_0xacfc('0x30')](handleError());}}catch(_0x46087f){logger[_0xacfc('0x2e')](JSON[_0xacfc('0x31')](_0x46087f));}return logger[_0xacfc('0x29')](_0xacfc('0x3c'));};}function getJobs(_0x555442){var _0x283fe2={};if(_0x555442){_0x283fe2['id']=_0x555442;}return db[_0xacfc('0x3d')]['findAll']({'where':_0x283fe2,'include':[{'model':db[_0xacfc('0x11')],'attributes':['id',_0xacfc('0x16'),_0xacfc('0xe')],'include':[{'model':db['MailServerOut'],'as':_0xacfc('0x12'),'include':[{'model':db[_0xacfc('0x3e')],'as':_0xacfc('0x3e')}]}]}]})[_0xacfc('0x2d')](function(_0x1adbb4){var _0x36c610=_['keys'](manager[_0xacfc('0x3f')]);var _0x4af54f=_['map'](_0x1adbb4,function(_0x19907b){return _0x19907b['id'][_0xacfc('0x40')]();});var _0x506517=_[_0xacfc('0x41')](_0x1adbb4,function(_0x53ecf2){return _0x53ecf2['id'][_0xacfc('0x40')]();});var _0x3c1e31=_0x555442?_0x4af54f:_['difference'](_0x4af54f,_0x36c610);var _0xf78c60=_[_0xacfc('0x42')](_0x4af54f,_0x36c610);var _0x4ffe68=_[_0xacfc('0x43')](_0x36c610,_0x4af54f);var _0x182486;var _0x1503e9;for(_0x182486=0x0;_0x182486<_0x4ffe68[_0xacfc('0x44')]&&!_0x555442;_0x182486+=0x1){_0x1503e9=_0x4ffe68[_0x182486][_0xacfc('0x40')]();if(manager[_0xacfc('0x45')](_0x1503e9)){manager[_0xacfc('0x46')](_0x1503e9);manager[_0xacfc('0x47')](_0x1503e9);logger[_0xacfc('0x29')](_0xacfc('0x48'),_0x1503e9);}}logger[_0xacfc('0x29')](_0xacfc('0x49'),JSON[_0xacfc('0x31')](_0x3c1e31));for(_0x182486=0x0;_0x182486<_0x3c1e31['length'];_0x182486+=0x1){_0x1503e9=_0x3c1e31[_0x182486][_0xacfc('0x40')]();logger[_0xacfc('0x29')](_0xacfc('0x4a'),_0x1503e9);if(_0x555442){logger[_0xacfc('0x29')](_0xacfc('0x4b'),_0x555442);logger['info'](JSON[_0xacfc('0x31')](_0x506517[_0x1503e9]));BPromise[_0xacfc('0x4c')]()['then'](handleJob(_0x506517[_0x1503e9]));logger[_0xacfc('0x29')](_0xacfc('0x4d'),_0x506517[_0x1503e9][_0xacfc('0x16')],_0x506517[_0x1503e9]['cron']);}else if(_0x506517[_0x1503e9]['cron']&&_0x506517[_0x1503e9][_0xacfc('0x4e')]&&moment()[_0xacfc('0x4f')](_0x506517[_0x1503e9][_0xacfc('0x50')],_0x506517[_0x1503e9]['endAt'])){manager[_0xacfc('0x51')](_0x1503e9,_0x506517[_0x1503e9][_0xacfc('0x52')],handleJob(_0x506517[_0x1503e9]));manager['start'](_0x1503e9);logger[_0xacfc('0x29')]('add\x20cron',_0x506517[_0x1503e9][_0xacfc('0x16')],_0x506517[_0x1503e9][_0xacfc('0x52')]);}else if(manager['exists'](_0x1503e9)){manager[_0xacfc('0x46')](_0x1503e9);manager[_0xacfc('0x47')](_0x1503e9);logger[_0xacfc('0x29')]('stop\x20cron',_0x506517[_0x1503e9]['name'],_0x506517[_0x1503e9][_0xacfc('0x52')]);}}for(_0x182486=0x0,_0x1503e9;_0x182486<_0xf78c60['length']&&!_0x555442;_0x182486+=0x1){_0x1503e9=_0xf78c60[_0x182486]['toString']();if(manager[_0xacfc('0x45')](_0x1503e9)){if(_0x506517[_0x1503e9][_0xacfc('0x52')]&&_0x506517[_0x1503e9][_0xacfc('0x4e')]&&moment()['isBetween'](_0x506517[_0x1503e9]['startAt'],_0x506517[_0x1503e9][_0xacfc('0x53')])){manager[_0xacfc('0x54')](_0x1503e9,_0x506517[_0x1503e9][_0xacfc('0x52')],handleJob(_0x506517[_0x1503e9]));logger[_0xacfc('0x29')](_0xacfc('0x55'),_0x506517[_0x1503e9]['name'],_0x506517[_0x1503e9][_0xacfc('0x52')]);}else{manager[_0xacfc('0x46')](_0x1503e9);manager[_0xacfc('0x47')](_0x1503e9);logger['info']('stop\x20cron',_0x506517[_0x1503e9][_0xacfc('0x16')],_0x506517[_0x1503e9][_0xacfc('0x52')]);}}}})['catch'](function(_0x436625){logger['error'](JSON[_0xacfc('0x31')](_0x436625));});}exports['run']=function(_0x21a5d0){return getJobs(_0x21a5d0);};exports[_0xacfc('0x56')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x17ba=['client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','\x22%s\x22\x20<%s>','name','Smtp','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','../../files/reports','%s.%s','basename','extname','join','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','SendMail','error','error\x20mail','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','then','no\x20report\x20id','findAll','MailServerOut','CloudProvider','keys','jobs','map','keyBy','toString','difference','intersection','length','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','start','add\x20cron','exists','stop','stop\x20cron','update','update\x20cron','run','util','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller'];(function(_0x3a340f,_0x18653e){var _0x14ca55=function(_0x2e2fd6){while(--_0x2e2fd6){_0x3a340f['push'](_0x3a340f['shift']());}};_0x14ca55(++_0x18653e);}(_0x17ba,0xab));var _0xa17b=function(_0x346e10,_0xd2775d){_0x346e10=_0x346e10-0x0;var _0xf5db7a=_0x17ba[_0x346e10];return _0xf5db7a;};'use strict';var fs=require('fs');var util=require(_0xa17b('0x0'));var path=require(_0xa17b('0x1'));var _=require('lodash');var moment=require(_0xa17b('0x2'));var CronJobManager=require(_0xa17b('0x3'));var jayson=require(_0xa17b('0x4'));var BPromise=require(_0xa17b('0x5'));var logger=require(_0xa17b('0x6'))(_0xa17b('0x7'));var db=require(_0xa17b('0x8'))['db'];var analyticCustomReportController=require(_0xa17b('0x9'));var analyticDefaultReportController=require(_0xa17b('0xa'));var client=jayson[_0xa17b('0xb')][_0xa17b('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2e3d43,_0x1957be){return function(){logger[_0xa17b('0xd')](_0xa17b('0xe'),_0x2e3d43[_0xa17b('0xf')]);var _0x2d7aa4=!![];var _0x17852b=_0x2e3d43[_0xa17b('0x10')]['getSmtpOptions']();var _0x2556c4={'account':_0x17852b,'message':{'from':util[_0xa17b('0x11')](_0xa17b('0x12'),_0x2e3d43[_0xa17b('0x10')][_0xa17b('0x13')],_0x2e3d43[_0xa17b('0x10')][_0xa17b('0xf')]||_0x2e3d43['MailAccount'][_0xa17b('0x14')][_0xa17b('0x15')]),'to':_0x2e3d43[_0xa17b('0xf')],'cc':_0x2e3d43['cc'],'bcc':_0x2e3d43['bcc'],'subject':util[_0xa17b('0x11')](_0xa17b('0x16'),_0x1957be[_0xa17b('0x13')],_0x2e3d43[_0xa17b('0x17')],_0x2e3d43['subtractUnit'])}};var _0x117ad9=path['join'](__dirname,_0xa17b('0x18'));var _0x219385=_0x1957be['savename'];var _0x112764=util[_0xa17b('0x11')](_0xa17b('0x19'),path[_0xa17b('0x1a')](_0x1957be['savename'],path[_0xa17b('0x1b')](_0x1957be['savename'])),'zip');var _0x47d80b=path[_0xa17b('0x1c')](_0x117ad9,_0x219385);var _0x197237=path['join'](_0x117ad9,_0x112764);if(fs[_0xa17b('0x1d')](_0x47d80b)){_0x1957be[_0xa17b('0x1e')]=_0xa17b('0x1f');_0x2556c4[_0xa17b('0x20')][_0xa17b('0x21')]=[{'filename':_0x219385,'path':_0x47d80b}];_0x2556c4[_0xa17b('0x20')][_0xa17b('0x22')]=util['format'](_0xa17b('0x23'),JSON[_0xa17b('0x24')](_0x1957be,null,0x2));}else if(fs[_0xa17b('0x1d')](_0x197237)){_0x1957be['status']=_0xa17b('0x1f');_0x2556c4[_0xa17b('0x20')][_0xa17b('0x21')]=[{'filename':_0x112764,'path':_0x197237}];}else{_0x2556c4[_0xa17b('0x20')][_0xa17b('0x22')]=_0xa17b('0x25');if(!_0x2e3d43['sendIfEmpty']){_0x2d7aa4=![];logger[_0xa17b('0xd')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x2d7aa4){return client[_0xa17b('0x26')](_0xa17b('0x27'),_0x2556c4)['then'](function(_0x491764){if(_0x491764[_0xa17b('0x28')]){return logger[_0xa17b('0x28')](_0xa17b('0x29'),JSON[_0xa17b('0x24')](_0x491764));}return logger[_0xa17b('0xd')](_0xa17b('0x2a'));})['catch'](function(_0x47aff8){return logger['error']('error\x20mail',JSON[_0xa17b('0x24')](_0x47aff8));});}};}function handleError(){return function(_0x5ef356){return logger[_0xa17b('0x28')](JSON['stringify'](_0x5ef356));};}function handleResult(_0x14671b){return function(_0x3b2ba6){logger[_0xa17b('0xd')](_0xa17b('0x2b'),JSON[_0xa17b('0x24')](_0x3b2ba6));if(_0x14671b[_0xa17b('0x10')]&&_0x14671b[_0xa17b('0x10')][_0xa17b('0x14')]&&!_[_0xa17b('0x2c')](_0x14671b[_0xa17b('0xf')])){setTimeout(handleSendEmail(_0x14671b,_0x3b2ba6),0x3c*0x3e8);}};}function handleJob(_0xe84db5){return function(){try{if(_['isNil'](_0xe84db5['subtractNumber'])){return logger['info'](_0xa17b('0x2d'));}if(_[_0xa17b('0x2c')](_0xe84db5[_0xa17b('0x2e')])){return logger[_0xa17b('0xd')](_0xa17b('0x2f'));}var _0x156409={'startDate':moment()[_0xa17b('0x30')](_0xe84db5[_0xa17b('0x17')],_0xe84db5['subtractUnit'])[_0xa17b('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xa17b('0x11')](_0xa17b('0x31')),'type':_0xa17b('0x32'),'output':_0xe84db5[_0xa17b('0x33')],'name':_0xe84db5[_0xa17b('0x13')]};if(!_[_0xa17b('0x2c')](_0xe84db5['DefaultReportId'])){logger[_0xa17b('0xd')](_0xa17b('0x34'),_0xe84db5[_0xa17b('0x35')]);return analyticDefaultReportController[_0xa17b('0x36')]({'id':_0xe84db5[_0xa17b('0x35')]},_0x156409)['then'](handleResult(_0xe84db5))[_0xa17b('0x37')](handleError());}if(!_['isNil'](_0xe84db5[_0xa17b('0x38')])){logger['info'](_0xa17b('0x39'),_0xe84db5[_0xa17b('0x38')]);return analyticCustomReportController['runReport']({'id':_0xe84db5[_0xa17b('0x38')]},_0x156409)[_0xa17b('0x3a')](handleResult(_0xe84db5))['catch'](handleError());}}catch(_0x2fb380){logger[_0xa17b('0x28')](JSON[_0xa17b('0x24')](_0x2fb380));}return logger[_0xa17b('0xd')](_0xa17b('0x3b'));};}function getJobs(_0x5a7679){var _0x39da1b={};if(_0x5a7679){_0x39da1b['id']=_0x5a7679;}return db['Schedule'][_0xa17b('0x3c')]({'where':_0x39da1b,'include':[{'model':db['MailAccount'],'attributes':['id',_0xa17b('0x13'),'email'],'include':[{'model':db[_0xa17b('0x3d')],'as':'Smtp','include':[{'model':db[_0xa17b('0x3e')],'as':'CloudProvider'}]}]}]})[_0xa17b('0x3a')](function(_0x44be7d){var _0x5bfb5=_[_0xa17b('0x3f')](manager[_0xa17b('0x40')]);var _0xdd429f=_[_0xa17b('0x41')](_0x44be7d,function(_0xe57f94){return _0xe57f94['id']['toString']();});var _0x468c92=_[_0xa17b('0x42')](_0x44be7d,function(_0x53eb23){return _0x53eb23['id'][_0xa17b('0x43')]();});var _0x231b93=_0x5a7679?_0xdd429f:_[_0xa17b('0x44')](_0xdd429f,_0x5bfb5);var _0x318b3e=_[_0xa17b('0x45')](_0xdd429f,_0x5bfb5);var _0x2fe669=_['difference'](_0x5bfb5,_0xdd429f);var _0x40e805;var _0x1521fe;for(_0x40e805=0x0;_0x40e805<_0x2fe669[_0xa17b('0x46')]&&!_0x5a7679;_0x40e805+=0x1){_0x1521fe=_0x2fe669[_0x40e805]['toString']();if(manager['exists'](_0x1521fe)){manager['stop'](_0x1521fe);manager[_0xa17b('0x47')](_0x1521fe);logger[_0xa17b('0xd')](_0xa17b('0x48'),_0x1521fe);}}logger[_0xa17b('0xd')](_0xa17b('0x49'),JSON[_0xa17b('0x24')](_0x231b93));for(_0x40e805=0x0;_0x40e805<_0x231b93[_0xa17b('0x46')];_0x40e805+=0x1){_0x1521fe=_0x231b93[_0x40e805][_0xa17b('0x43')]();logger[_0xa17b('0xd')](_0xa17b('0x4a'),_0x1521fe);if(_0x5a7679){logger[_0xa17b('0xd')](_0xa17b('0x4b'),_0x5a7679);logger['info'](JSON[_0xa17b('0x24')](_0x468c92[_0x1521fe]));BPromise[_0xa17b('0x4c')]()[_0xa17b('0x3a')](handleJob(_0x468c92[_0x1521fe]));logger[_0xa17b('0xd')](_0xa17b('0x4d'),_0x468c92[_0x1521fe][_0xa17b('0x13')],_0x468c92[_0x1521fe]['cron']);}else if(_0x468c92[_0x1521fe][_0xa17b('0x4e')]&&_0x468c92[_0x1521fe][_0xa17b('0x4f')]&&moment()[_0xa17b('0x50')](_0x468c92[_0x1521fe][_0xa17b('0x51')],_0x468c92[_0x1521fe][_0xa17b('0x52')])){manager['add'](_0x1521fe,_0x468c92[_0x1521fe][_0xa17b('0x4e')],handleJob(_0x468c92[_0x1521fe]));manager[_0xa17b('0x53')](_0x1521fe);logger[_0xa17b('0xd')](_0xa17b('0x54'),_0x468c92[_0x1521fe]['name'],_0x468c92[_0x1521fe][_0xa17b('0x4e')]);}else if(manager[_0xa17b('0x55')](_0x1521fe)){manager[_0xa17b('0x56')](_0x1521fe);manager[_0xa17b('0x47')](_0x1521fe);logger[_0xa17b('0xd')](_0xa17b('0x57'),_0x468c92[_0x1521fe][_0xa17b('0x13')],_0x468c92[_0x1521fe]['cron']);}}for(_0x40e805=0x0,_0x1521fe;_0x40e805<_0x318b3e[_0xa17b('0x46')]&&!_0x5a7679;_0x40e805+=0x1){_0x1521fe=_0x318b3e[_0x40e805][_0xa17b('0x43')]();if(manager['exists'](_0x1521fe)){if(_0x468c92[_0x1521fe][_0xa17b('0x4e')]&&_0x468c92[_0x1521fe][_0xa17b('0x4f')]&&moment()[_0xa17b('0x50')](_0x468c92[_0x1521fe]['startAt'],_0x468c92[_0x1521fe][_0xa17b('0x52')])){manager[_0xa17b('0x58')](_0x1521fe,_0x468c92[_0x1521fe]['cron'],handleJob(_0x468c92[_0x1521fe]));logger[_0xa17b('0xd')](_0xa17b('0x59'),_0x468c92[_0x1521fe]['name'],_0x468c92[_0x1521fe][_0xa17b('0x4e')]);}else{manager[_0xa17b('0x56')](_0x1521fe);manager['deleteJob'](_0x1521fe);logger[_0xa17b('0xd')](_0xa17b('0x57'),_0x468c92[_0x1521fe][_0xa17b('0x13')],_0x468c92[_0x1521fe][_0xa17b('0x4e')]);}}}})[_0xa17b('0x37')](function(_0x133823){logger[_0xa17b('0x28')](JSON['stringify'](_0x133823));});}exports[_0xa17b('0x5a')]=function(_0x3ff07a){return getJobs(_0x3ff07a);};exports[_0xa17b('0x53')]=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 5e00d5b..37e117c 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 _0xc7ea=['resolve','tempSentiment','sentiment','Negative','COMPLETED','name','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','IN_PROGRESS','transcribeAccountId','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20configured','forEach','push','all','catch','SequelizeValidationError','inspect','start','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed'];(function(_0x4d8bf8,_0x1e046e){var _0x2ef669=function(_0x39e0d5){while(--_0x39e0d5){_0x4d8bf8['push'](_0x4d8bf8['shift']());}};_0x2ef669(++_0x1e046e);}(_0xc7ea,0x171));var _0xac7e=function(_0x17ec58,_0x5726fe){_0x17ec58=_0x17ec58-0x0;var _0x3d4a9f=_0xc7ea[_0x17ec58];return _0x3d4a9f;};var _=require(_0xac7e('0x0'));var AWS=require(_0xac7e('0x1'));var rp=require('request-promise');var util=require(_0xac7e('0x2'));var BPromise=require(_0xac7e('0x3'));var db=require(_0xac7e('0x4'))['db'];var logger=require(_0xac7e('0x5'))('transcribe');function getTranscriptionJob(_0x134a3d,_0x39bf60,_0x1c15cf,_0x3ca05f){return new Promise(function(_0x26b1c5,_0x45e73f){var _0x447bfe=new AWS[(_0xac7e('0x6'))]({'accessKeyId':_0x39bf60,'secretAccessKey':_0x134a3d,'region':_0x1c15cf});_0x447bfe[_0xac7e('0x7')]({'TranscriptionJobName':_0x3ca05f},function(_0x1cb874,_0x4d83fb){if(_0x1cb874){return _0x45e73f(_0x1cb874);}else{return _0x26b1c5(_0x4d83fb);}});});}function sentiment(_0x114e82,_0x446f88,_0x2efbf4,_0x173b59,_0x39d2e3){return new Promise(function(_0x260889,_0x10873d){var _0x240869=new AWS[(_0xac7e('0x8'))]({'accessKeyId':_0x446f88,'secretAccessKey':_0x114e82,'region':_0x2efbf4});_0x240869[_0xac7e('0x9')]({'Text':_0x173b59,'LanguageCode':_0x39d2e3[_0xac7e('0xa')](0x0,0x2)},function(_0xe9d96a,_0x4efc1d){if(_0xe9d96a){return _0x10873d(_0xe9d96a);}else{return _0x260889(_0x4efc1d);}});});}function checkTranscribeJob(_0x9cd7c,_0x13e126,_0x5d4537){var _0x617cf9;return new BPromise(function(_0x24d5e9,_0x37839d){logger[_0xac7e('0xb')](util[_0xac7e('0xc')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x9cd7c['id'],_0x9cd7c[_0xac7e('0xd')]));return getTranscriptionJob(_0x5d4537[_0xac7e('0xe')],_0x5d4537[_0xac7e('0xf')],_0x13e126[_0xac7e('0x10')],_0x9cd7c[_0xac7e('0xd')])[_0xac7e('0x11')](function(_0x7ee114){logger[_0xac7e('0xb')](util['format'](_0xac7e('0x12'),_0x9cd7c['id'],_0x9cd7c[_0xac7e('0xd')],_0x7ee114[_0xac7e('0x13')][_0xac7e('0x14')]));if(!_0x9cd7c[_0xac7e('0x15')]){switch(_0x7ee114['TranscriptionJob'][_0xac7e('0x14')]){case'COMPLETED':var _0xba3d01={'transcribeStatus':_0x7ee114['TranscriptionJob'][_0xac7e('0x14')],'fileUri':_0x7ee114[_0xac7e('0x13')][_0xac7e('0x16')][_0xac7e('0x17')]};logger[_0xac7e('0xb')](util[_0xac7e('0xc')]('[RECORDING:%d]\x20Get\x20transcript',_0x9cd7c['id']));return rp({'uri':_0x7ee114[_0xac7e('0x13')][_0xac7e('0x16')]['TranscriptFileUri'],'json':!![]})[_0xac7e('0x11')](function(_0x2ebc78){logger[_0xac7e('0xb')](util[_0xac7e('0xc')](_0xac7e('0x18'),_0x9cd7c['id']));if(_0x2ebc78&&_0x2ebc78[_0xac7e('0x19')]&&_0x2ebc78[_0xac7e('0x19')][_0xac7e('0x1a')]&&_0x2ebc78[_0xac7e('0x19')][_0xac7e('0x1a')][_0xac7e('0x1b')]){_0xba3d01['fileText']='';for(var _0x57c945=0x0;_0x57c945<_0x2ebc78[_0xac7e('0x19')][_0xac7e('0x1a')][_0xac7e('0x1b')];_0x57c945++){_0xba3d01['fileText']+=_0x2ebc78[_0xac7e('0x19')][_0xac7e('0x1a')][_0x57c945][_0xac7e('0x1c')]+'';}}return _0x9cd7c[_0xac7e('0x1d')](_0xba3d01);})['then'](function(){logger['info'](util[_0xac7e('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x9cd7c['id']));if(!_0x9cd7c['tempSentiment']){throw new db[(_0xac7e('0x1e'))][(_0xac7e('0x1f'))](_0xac7e('0x20'));}if(!_0x13e126['sentiment']||!_0x13e126[_0xac7e('0x21')]||!_0x13e126[_0xac7e('0x22')]||!_0x13e126[_0xac7e('0x23')]||!_0x13e126[_0xac7e('0x24')]){throw new db['Sequelize'][(_0xac7e('0x1f'))](_0xac7e('0x25'));}if(!_0xba3d01[_0xac7e('0x15')]){throw new Error('Transcript\x20not\x20available');}if(_0x13e126[_0xac7e('0x21')]===_0x5d4537['id']){return _0x5d4537;}else{return db[_0xac7e('0x26')][_0xac7e('0x27')]({'where':{'id':_settings[_0xac7e('0x21')]}});}})['then'](function(_0x282a26){if(!_0x282a26){throw new db['Sequelize'][(_0xac7e('0x1f'))](_0xac7e('0x28'));}if(!_0x282a26[_0xac7e('0xe')]||!_0x282a26['data2']){throw new db[(_0xac7e('0x1e'))][(_0xac7e('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x617cf9=_0x282a26;logger['info'](util[_0xac7e('0xc')](_0xac7e('0x29'),_0x9cd7c['id']));return sentiment(_0x617cf9[_0xac7e('0xe')],_0x617cf9[_0xac7e('0xf')],_0x13e126[_0xac7e('0x22')],_0xba3d01[_0xac7e('0x15')],_0x13e126[_0xac7e('0x23')]);})[_0xac7e('0x11')](function(_0x38bfb1){logger['info'](util[_0xac7e('0xc')](_0xac7e('0x2a'),_0x9cd7c['id']));return _0x9cd7c[_0xac7e('0x1d')]({'sentiment':_0x38bfb1[_0xac7e('0x2b')],'sPositive':_0x38bfb1[_0xac7e('0x2c')][_0xac7e('0x2d')],'sNegative':_0x38bfb1['SentimentScore']['Negative'],'sMixed':_0x38bfb1[_0xac7e('0x2c')][_0xac7e('0x2e')],'sNeutral':_0x38bfb1[_0xac7e('0x2c')][_0xac7e('0x2f')]});})[_0xac7e('0x11')](function(){logger[_0xac7e('0xb')](util[_0xac7e('0xc')](_0xac7e('0x30'),_0x9cd7c['id']));_0x24d5e9();});case _0xac7e('0x31'):return _0x9cd7c['update']({'transcribeStatus':_0xac7e('0x31'),'failureReason':_0x7ee114[_0xac7e('0x13')]['FailureReason']})[_0xac7e('0x11')](function(){logger[_0xac7e('0xb')](util['format'](_0xac7e('0x30'),_0x9cd7c['id']));_0x24d5e9();});default:logger[_0xac7e('0xb')](util[_0xac7e('0xc')](_0xac7e('0x32'),_0x9cd7c['id']));break;}}else{return BPromise[_0xac7e('0x33')]()[_0xac7e('0x11')](function(){if(!_0x9cd7c[_0xac7e('0x34')]){throw new db[(_0xac7e('0x1e'))]['ValidationError'](_0xac7e('0x20'));}if(!_0x13e126[_0xac7e('0x35')]||!_0x13e126['sentimentAccountId']||!_0x13e126[_0xac7e('0x22')]||!_0x13e126[_0xac7e('0x23')]||!_0x13e126[_0xac7e('0x24')]){throw new db['Sequelize']['ValidationError'](_0xac7e('0x25'));}if(!_0x9cd7c[_0xac7e('0x15')]){throw new Error('Transcript\x20not\x20available');}if(_0x13e126[_0xac7e('0x21')]===_0x5d4537['id']){return _0x5d4537;}else{return db[_0xac7e('0x26')][_0xac7e('0x27')]({'where':{'id':_settings[_0xac7e('0x21')]}});}})[_0xac7e('0x11')](function(_0x21e628){if(!_0x21e628){throw new db[(_0xac7e('0x1e'))][(_0xac7e('0x1f'))](_0xac7e('0x28'));}if(!_0x21e628[_0xac7e('0xe')]||!_0x21e628[_0xac7e('0xf')]){throw new db[(_0xac7e('0x1e'))][(_0xac7e('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x617cf9=_0x21e628;logger[_0xac7e('0xb')](util[_0xac7e('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x9cd7c['id']));return sentiment(_0x617cf9[_0xac7e('0xe')],_0x617cf9[_0xac7e('0xf')],_0x13e126[_0xac7e('0x22')],_0x9cd7c[_0xac7e('0x15')],_0x13e126['language']);})[_0xac7e('0x11')](function(_0xc23c3e){logger['info'](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x9cd7c['id']));return _0x9cd7c[_0xac7e('0x1d')]({'sentiment':_0xc23c3e['Sentiment'],'sPositive':_0xc23c3e[_0xac7e('0x2c')][_0xac7e('0x2d')],'sNegative':_0xc23c3e['SentimentScore'][_0xac7e('0x36')],'sMixed':_0xc23c3e[_0xac7e('0x2c')][_0xac7e('0x2e')],'sNeutral':_0xc23c3e[_0xac7e('0x2c')][_0xac7e('0x2f')],'transcribeStatus':_0xac7e('0x37')});})['then'](function(){logger[_0xac7e('0xb')](util[_0xac7e('0xc')](_0xac7e('0x30'),_0x9cd7c['id']));_0x24d5e9();});}})['catch'](function(_0x227673){if(_0x227673){if(!_0x227673[_0xac7e('0x38')]||_0x227673['name']!=='SequelizeValidationError'){logger['error'](util['format'](_0xac7e('0x39'),_0x9cd7c['id']),util['inspect'](_0x227673,{'showHidden':![],'depth':null}));}}_0x24d5e9();});});}function checkTranscribe(){var _0x47ae4e;var _0x5b3929;var _0x4cd8f6;return db[_0xac7e('0x3a')]['findAll']({'where':{'transcribeStatus':_0xac7e('0x3b')}})[_0xac7e('0x11')](function(_0x2b9ffb){if(!_0x2b9ffb||!_0x2b9ffb['length']){throw new db['Sequelize'][(_0xac7e('0x1f'))]('No\x20transcribe\x20job\x20to\x20check');}_0x47ae4e=_0x2b9ffb;return db['Setting'][_0xac7e('0x27')]({'where':{'id':0x1}});})[_0xac7e('0x11')](function(_0x319429){if(!_0x319429){throw new db['Sequelize']['ValidationError']('Settings\x20not\x20available');}_0x5b3929=_0x319429;if(!_0x5b3929['transcribe']||!_0x5b3929[_0xac7e('0x3c')]||!_0x5b3929[_0xac7e('0x10')]||!_0x5b3929[_0xac7e('0x23')]||!_0x5b3929[_0xac7e('0x24')]){throw new db[(_0xac7e('0x1e'))][(_0xac7e('0x1f'))](_0xac7e('0x3d'));}return db[_0xac7e('0x26')][_0xac7e('0x27')]({'where':{'id':_0x5b3929['transcribeAccountId']}});})[_0xac7e('0x11')](function(_0x188f59){if(!_0x188f59){throw new db[(_0xac7e('0x1e'))]['ValidationError'](_0xac7e('0x28'));}if(!_0x188f59[_0xac7e('0xe')]||!_0x188f59[_0xac7e('0xf')]){throw new db[(_0xac7e('0x1e'))][(_0xac7e('0x1f'))](_0xac7e('0x3e'));}_0x4cd8f6=_0x188f59;var _0x43cad3=[];_0x47ae4e[_0xac7e('0x3f')](function(_0xbbef){_0x43cad3[_0xac7e('0x40')](checkTranscribeJob(_0xbbef,_0x5b3929,_0x4cd8f6));});return BPromise[_0xac7e('0x41')](_0x43cad3);})[_0xac7e('0x42')](function(_0x482f27){if(_0x482f27){if(!_0x482f27[_0xac7e('0x38')]||_0x482f27['name']!==_0xac7e('0x43')){logger['error'](util[_0xac7e('0x44')](_0x482f27,{'showHidden':![],'depth':null}));}}});}exports[_0xac7e('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x574d=['Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','update','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','CloudProvider','findOne','Sentiment','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId','bucket','Transcribe\x20not\x20configured','forEach','push','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','transcribeName','then','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20available'];(function(_0x83531b,_0x5daca6){var _0x3696f2=function(_0x368b38){while(--_0x368b38){_0x83531b['push'](_0x83531b['shift']());}};_0x3696f2(++_0x5daca6);}(_0x574d,0xc0));var _0xd574=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x574d[_0x422905];return _0x33dc6c;};var _=require(_0xd574('0x0'));var AWS=require(_0xd574('0x1'));var rp=require(_0xd574('0x2'));var util=require(_0xd574('0x3'));var BPromise=require(_0xd574('0x4'));var db=require(_0xd574('0x5'))['db'];var logger=require(_0xd574('0x6'))('transcribe');function getTranscriptionJob(_0x2a54ff,_0x1be154,_0x469ad7,_0x3e2e7d){return new Promise(function(_0x56ecee,_0x16a152){var _0x13a566=new AWS[(_0xd574('0x7'))]({'accessKeyId':_0x1be154,'secretAccessKey':_0x2a54ff,'region':_0x469ad7});_0x13a566[_0xd574('0x8')]({'TranscriptionJobName':_0x3e2e7d},function(_0x3a1e54,_0x20751c){if(_0x3a1e54){return _0x16a152(_0x3a1e54);}else{return _0x56ecee(_0x20751c);}});});}function sentiment(_0x54fe4f,_0x590d25,_0x4306f7,_0x11ef21,_0x2caf61){return new Promise(function(_0x1aa38f,_0x2931ac){var _0x5de85a=new AWS[(_0xd574('0x9'))]({'accessKeyId':_0x590d25,'secretAccessKey':_0x54fe4f,'region':_0x4306f7});_0x5de85a['detectSentiment']({'Text':_0x11ef21,'LanguageCode':_0x2caf61[_0xd574('0xa')](0x0,0x2)},function(_0x178952,_0x17b2f7){if(_0x178952){return _0x2931ac(_0x178952);}else{return _0x1aa38f(_0x17b2f7);}});});}function checkTranscribeJob(_0x6bbebf,_0x1ddedb,_0x6c93de){var _0x8dd760;return new BPromise(function(_0x2a4dd4,_0x24cf77){logger[_0xd574('0xb')](util[_0xd574('0xc')](_0xd574('0xd'),_0x6bbebf['id'],_0x6bbebf['transcribeName']));return getTranscriptionJob(_0x6c93de[_0xd574('0xe')],_0x6c93de[_0xd574('0xf')],_0x1ddedb[_0xd574('0x10')],_0x6bbebf[_0xd574('0x11')])[_0xd574('0x12')](function(_0x341463){logger[_0xd574('0xb')](util[_0xd574('0xc')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x6bbebf['id'],_0x6bbebf['transcribeName'],_0x341463[_0xd574('0x13')][_0xd574('0x14')]));if(!_0x6bbebf[_0xd574('0x15')]){switch(_0x341463['TranscriptionJob']['TranscriptionJobStatus']){case _0xd574('0x16'):var _0x1ba34c={'transcribeStatus':_0x341463[_0xd574('0x13')][_0xd574('0x14')],'fileUri':_0x341463[_0xd574('0x13')][_0xd574('0x17')][_0xd574('0x18')]};logger[_0xd574('0xb')](util[_0xd574('0xc')](_0xd574('0x19'),_0x6bbebf['id']));return rp({'uri':_0x341463[_0xd574('0x13')]['Transcript'][_0xd574('0x18')],'json':!![]})[_0xd574('0x12')](function(_0x481564){logger[_0xd574('0xb')](util['format'](_0xd574('0x1a'),_0x6bbebf['id']));if(_0x481564&&_0x481564[_0xd574('0x1b')]&&_0x481564[_0xd574('0x1b')][_0xd574('0x1c')]&&_0x481564[_0xd574('0x1b')][_0xd574('0x1c')][_0xd574('0x1d')]){_0x1ba34c[_0xd574('0x15')]='';for(var _0x1e3316=0x0;_0x1e3316<_0x481564[_0xd574('0x1b')][_0xd574('0x1c')][_0xd574('0x1d')];_0x1e3316++){_0x1ba34c[_0xd574('0x15')]+=_0x481564[_0xd574('0x1b')]['transcripts'][_0x1e3316][_0xd574('0x1e')]+'';}}return _0x6bbebf['update'](_0x1ba34c);})[_0xd574('0x12')](function(){logger['info'](util['format'](_0xd574('0x1f'),_0x6bbebf['id']));if(!_0x6bbebf[_0xd574('0x20')]){throw new db[(_0xd574('0x21'))]['ValidationError'](_0xd574('0x22'));}if(!_0x1ddedb[_0xd574('0x23')]||!_0x1ddedb[_0xd574('0x24')]||!_0x1ddedb[_0xd574('0x25')]||!_0x1ddedb['language']||!_0x1ddedb['bucket']){throw new db[(_0xd574('0x21'))][(_0xd574('0x26'))](_0xd574('0x27'));}if(!_0x1ba34c[_0xd574('0x15')]){throw new Error(_0xd574('0x28'));}if(_0x1ddedb[_0xd574('0x24')]===_0x6c93de['id']){return _0x6c93de;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0xd574('0x24')]}});}})[_0xd574('0x12')](function(_0x3adfdf){if(!_0x3adfdf){throw new db[(_0xd574('0x21'))][(_0xd574('0x26'))](_0xd574('0x29'));}if(!_0x3adfdf[_0xd574('0xe')]||!_0x3adfdf[_0xd574('0xf')]){throw new db['Sequelize']['ValidationError'](_0xd574('0x2a'));}_0x8dd760=_0x3adfdf;logger[_0xd574('0xb')](util[_0xd574('0xc')](_0xd574('0x2b'),_0x6bbebf['id']));return sentiment(_0x8dd760[_0xd574('0xe')],_0x8dd760['data2'],_0x1ddedb[_0xd574('0x25')],_0x1ba34c[_0xd574('0x15')],_0x1ddedb[_0xd574('0x2c')]);})[_0xd574('0x12')](function(_0x911c31){logger[_0xd574('0xb')](util[_0xd574('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x6bbebf['id']));return _0x6bbebf[_0xd574('0x2d')]({'sentiment':_0x911c31['Sentiment'],'sPositive':_0x911c31[_0xd574('0x2e')][_0xd574('0x2f')],'sNegative':_0x911c31[_0xd574('0x2e')][_0xd574('0x30')],'sMixed':_0x911c31[_0xd574('0x2e')][_0xd574('0x31')],'sNeutral':_0x911c31[_0xd574('0x2e')][_0xd574('0x32')]});})[_0xd574('0x12')](function(){logger[_0xd574('0xb')](util[_0xd574('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x6bbebf['id']));_0x2a4dd4();});case _0xd574('0x33'):return _0x6bbebf[_0xd574('0x2d')]({'transcribeStatus':_0xd574('0x33'),'failureReason':_0x341463['TranscriptionJob'][_0xd574('0x34')]})[_0xd574('0x12')](function(){logger[_0xd574('0xb')](util[_0xd574('0xc')](_0xd574('0x1f'),_0x6bbebf['id']));_0x2a4dd4();});default:logger[_0xd574('0xb')](util['format'](_0xd574('0x35'),_0x6bbebf['id']));break;}}else{return BPromise[_0xd574('0x36')]()[_0xd574('0x12')](function(){if(!_0x6bbebf[_0xd574('0x20')]){throw new db[(_0xd574('0x21'))]['ValidationError'](_0xd574('0x22'));}if(!_0x1ddedb[_0xd574('0x23')]||!_0x1ddedb[_0xd574('0x24')]||!_0x1ddedb['sentimentRegion']||!_0x1ddedb['language']||!_0x1ddedb['bucket']){throw new db[(_0xd574('0x21'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x6bbebf['fileText']){throw new Error(_0xd574('0x28'));}if(_0x1ddedb[_0xd574('0x24')]===_0x6c93de['id']){return _0x6c93de;}else{return db[_0xd574('0x37')][_0xd574('0x38')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xd574('0x12')](function(_0x33d317){if(!_0x33d317){throw new db[(_0xd574('0x21'))][(_0xd574('0x26'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x33d317[_0xd574('0xe')]||!_0x33d317['data2']){throw new db[(_0xd574('0x21'))][(_0xd574('0x26'))](_0xd574('0x2a'));}_0x8dd760=_0x33d317;logger[_0xd574('0xb')](util[_0xd574('0xc')](_0xd574('0x2b'),_0x6bbebf['id']));return sentiment(_0x8dd760[_0xd574('0xe')],_0x8dd760[_0xd574('0xf')],_0x1ddedb[_0xd574('0x25')],_0x6bbebf[_0xd574('0x15')],_0x1ddedb[_0xd574('0x2c')]);})[_0xd574('0x12')](function(_0x2cc987){logger['info'](util[_0xd574('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x6bbebf['id']));return _0x6bbebf['update']({'sentiment':_0x2cc987[_0xd574('0x39')],'sPositive':_0x2cc987[_0xd574('0x2e')]['Positive'],'sNegative':_0x2cc987[_0xd574('0x2e')][_0xd574('0x30')],'sMixed':_0x2cc987[_0xd574('0x2e')]['Mixed'],'sNeutral':_0x2cc987[_0xd574('0x2e')][_0xd574('0x32')],'transcribeStatus':_0xd574('0x16')});})[_0xd574('0x12')](function(){logger[_0xd574('0xb')](util[_0xd574('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x6bbebf['id']));_0x2a4dd4();});}})[_0xd574('0x3a')](function(_0x47618a){if(_0x47618a){if(!_0x47618a[_0xd574('0x3b')]||_0x47618a[_0xd574('0x3b')]!==_0xd574('0x3c')){logger[_0xd574('0x3d')](util[_0xd574('0xc')](_0xd574('0x3e'),_0x6bbebf['id']),util[_0xd574('0x3f')](_0x47618a,{'showHidden':![],'depth':null}));}}_0x2a4dd4();});});}function checkTranscribe(){var _0x392a38;var _0xdabdd6;var _0x3aa4e6;return db[_0xd574('0x40')][_0xd574('0x41')]({'where':{'transcribeStatus':_0xd574('0x42')}})[_0xd574('0x12')](function(_0x56195f){if(!_0x56195f||!_0x56195f[_0xd574('0x1d')]){throw new db[(_0xd574('0x21'))]['ValidationError'](_0xd574('0x43'));}_0x392a38=_0x56195f;return db[_0xd574('0x44')][_0xd574('0x38')]({'where':{'id':0x1}});})[_0xd574('0x12')](function(_0x2fcf85){if(!_0x2fcf85){throw new db[(_0xd574('0x21'))][(_0xd574('0x26'))](_0xd574('0x45'));}_0xdabdd6=_0x2fcf85;if(!_0xdabdd6[_0xd574('0x46')]||!_0xdabdd6[_0xd574('0x47')]||!_0xdabdd6['transcribeRegion']||!_0xdabdd6[_0xd574('0x2c')]||!_0xdabdd6[_0xd574('0x48')]){throw new db[(_0xd574('0x21'))][(_0xd574('0x26'))](_0xd574('0x49'));}return db[_0xd574('0x37')][_0xd574('0x38')]({'where':{'id':_0xdabdd6[_0xd574('0x47')]}});})[_0xd574('0x12')](function(_0xba391f){if(!_0xba391f){throw new db[(_0xd574('0x21'))][(_0xd574('0x26'))](_0xd574('0x29'));}if(!_0xba391f[_0xd574('0xe')]||!_0xba391f[_0xd574('0xf')]){throw new db[(_0xd574('0x21'))][(_0xd574('0x26'))](_0xd574('0x2a'));}_0x3aa4e6=_0xba391f;var _0x331b31=[];_0x392a38[_0xd574('0x4a')](function(_0x33ca39){_0x331b31[_0xd574('0x4b')](checkTranscribeJob(_0x33ca39,_0xdabdd6,_0x3aa4e6));});return BPromise[_0xd574('0x4c')](_0x331b31);})[_0xd574('0x3a')](function(_0x31d554){if(_0x31d554){if(!_0x31d554['name']||_0x31d554[_0xd574('0x3b')]!==_0xd574('0x3c')){logger[_0xd574('0x3d')](util[_0xd574('0x3f')](_0x31d554,{'showHidden':![],'depth':null}));}}});}exports[_0xd574('0x4d')]=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 fc3698e..0701e81 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 _0x3b33=['catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','schedule','redis','localhost','socket.io-emitter','findAll','lastMsgAt','hours','then','length','info','WhatsappInteraction','system','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update'];(function(_0x24f5da,_0x2f6105){var _0x52e2ef=function(_0x4e4283){while(--_0x4e4283){_0x24f5da['push'](_0x24f5da['shift']());}};_0x52e2ef(++_0x2f6105);}(_0x3b33,0x13c));var _0x33b3=function(_0x21978c,_0x2c5e6f){_0x21978c=_0x21978c-0x0;var _0x20fb79=_0x3b33[_0x21978c];return _0x20fb79;};'use strict';var _=require(_0x33b3('0x0'));var moment=require(_0x33b3('0x1'));var Redis=require(_0x33b3('0x2'));var util=require('util');var config=require(_0x33b3('0x3'));var db=require(_0x33b3('0x4'))['db'];var logger=require('../logger')(_0x33b3('0x5'));config[_0x33b3('0x6')]=_['defaults'](config[_0x33b3('0x6')],{'host':_0x33b3('0x7'),'port':0x18eb});var io=require(_0x33b3('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x3904f0=[];return db['WhatsappInteraction'][_0x33b3('0x9')]({'raw':!![],'attributes':['id',_0x33b3('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x33b3('0xb'))}}})[_0x33b3('0xc')](function(_0x4a7d76){if(_0x4a7d76&&_0x4a7d76[_0x33b3('0xd')]){_0x3904f0=_['map'](_0x4a7d76||[],'id');logger[_0x33b3('0xe')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x3904f0['join']());return db[_0x33b3('0xf')]['update']({'closeReason':_0x33b3('0x10'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x33b3('0x11'))},{'where':{'id':_0x3904f0}});}})['then'](function(){if(_0x3904f0&&_0x3904f0[_0x33b3('0xd')]){logger[_0x33b3('0xe')](_0x33b3('0x12'),_0x3904f0[_0x33b3('0x13')]());for(var _0x4384b1=0x0;_0x4384b1<_0x3904f0[_0x33b3('0xd')];_0x4384b1++){io[_0x33b3('0x14')](_0x33b3('0x15'),{'id':_0x3904f0[_0x4384b1],'closed':!![]});}}})[_0x33b3('0x16')](function(_0x48716d){logger['error'](_0x33b3('0x17'),_0x48716d?util[_0x33b3('0x18')](_0x48716d,{'showHidden':![],'depth':null}):'');});}exports[_0x33b3('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xe7f8=['lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','socket.io-emitter','lastMsgAt','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start'];(function(_0x143d33,_0x5ae149){var _0x2ec94e=function(_0x62625a){while(--_0x62625a){_0x143d33['push'](_0x143d33['shift']());}};_0x2ec94e(++_0x5ae149);}(_0xe7f8,0x1b3));var _0x8e7f=function(_0x47e3b3,_0x734291){_0x47e3b3=_0x47e3b3-0x0;var _0x59ee94=_0xe7f8[_0x47e3b3];return _0x59ee94;};'use strict';var _=require(_0x8e7f('0x0'));var moment=require(_0x8e7f('0x1'));var Redis=require(_0x8e7f('0x2'));var util=require(_0x8e7f('0x3'));var config=require(_0x8e7f('0x4'));var db=require(_0x8e7f('0x5'))['db'];var logger=require(_0x8e7f('0x6'))(_0x8e7f('0x7'));config['redis']=_[_0x8e7f('0x8')](config[_0x8e7f('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x8e7f('0xa'))(new Redis(config[_0x8e7f('0x9')]));function closeInteractions(){var _0x11fb97=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0x8e7f('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x8e7f('0xc'))}}})[_0x8e7f('0xd')](function(_0x4bf143){if(_0x4bf143&&_0x4bf143[_0x8e7f('0xe')]){_0x11fb97=_[_0x8e7f('0xf')](_0x4bf143||[],'id');logger[_0x8e7f('0x10')](_0x8e7f('0x11'),_0x11fb97[_0x8e7f('0x12')]());return db['WhatsappInteraction'][_0x8e7f('0x13')]({'closeReason':_0x8e7f('0x14'),'disposition':_0x8e7f('0x15'),'closed':!![],'closedAt':moment()[_0x8e7f('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x11fb97}});}})[_0x8e7f('0xd')](function(){if(_0x11fb97&&_0x11fb97[_0x8e7f('0xe')]){logger[_0x8e7f('0x10')](_0x8e7f('0x17'),_0x11fb97[_0x8e7f('0x12')]());for(var _0x32660d=0x0;_0x32660d<_0x11fb97['length'];_0x32660d++){io[_0x8e7f('0x18')]('whatsappInteraction:update',{'id':_0x11fb97[_0x32660d],'closed':!![]});}}})['catch'](function(_0x1c6b7c){logger[_0x8e7f('0x19')](_0x8e7f('0x1a'),_0x1c6b7c?util[_0x8e7f('0x1b')](_0x1c6b7c,{'showHidden':![],'depth':null}):'');});}exports[_0x8e7f('0x1c')]=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 531b3dc..8c157fe 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf972=['contacts1','CmHopper','hopper1','hopper2','catch','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','destroy','then','bulkCreate','log','finished\x20populating'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf972,0x7c));var _0x2f97=function(_0x57a0df,_0x58dfbc){_0x57a0df=_0x57a0df-0x0;var _0x5da734=_0xf972[_0x57a0df];return _0x5da734;};'use strict';var util=require('util');var db=require(_0x2f97('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x2f97('0x1')]({'id':i,'firstName':_0x2f97('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x2f97('0x3')+i+_0x2f97('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x2f97('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x2f97('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2f97('0x5')](),'updatedAt':Date[_0x2f97('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x2f97('0x1')]({'id':i,'firstName':_0x2f97('0x2')+i,'lastName':_0x2f97('0x6')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x2f97('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x2f97('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2f97('0x5')](),'updatedAt':Date[_0x2f97('0x5')]()});}db['CmContact'][_0x2f97('0x7')]({'where':{}})[_0x2f97('0x8')](function(){return db['CmContact'][_0x2f97('0x9')](contacts);})[_0x2f97('0x8')](function(){console[_0x2f97('0xa')](_0x2f97('0xb'),_0x2f97('0xc'));return db[_0x2f97('0xd')][_0x2f97('0x7')]({'where':{}});})[_0x2f97('0x8')](function(){return db[_0x2f97('0xd')][_0x2f97('0x9')](hopper);})['then'](function(){console[_0x2f97('0xa')]('finished\x20populating',_0x2f97('0xe'));return db['CmContact'][_0x2f97('0x9')](contacts2);})[_0x2f97('0x8')](function(){console['log'](_0x2f97('0xb'),'contacts2');return db[_0x2f97('0xd')][_0x2f97('0x9')](hopper2);})[_0x2f97('0x8')](function(){console[_0x2f97('0xa')](_0x2f97('0xb'),_0x2f97('0xf'));})[_0x2f97('0x10')](function(_0x5b0962){console[_0x2f97('0xa')](_0x5b0962);}); \ No newline at end of file +var _0x0f92=['log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','util','../mysqldb','push','innocenzo.biondo','@xcally.com','now','Innocenzo','Biondo','CmContact','destroy','then','bulkCreate'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x0f92,0x183));var _0x20f9=function(_0x122c52,_0x163859){_0x122c52=_0x122c52-0x0;var _0x24bc7e=_0x0f92[_0x122c52];return _0x24bc7e;};'use strict';var util=require(_0x20f9('0x0'));var db=require(_0x20f9('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x20f9('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x20f9('0x3')+i+_0x20f9('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x20f9('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x20f9('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x20f9('0x5')](),'updatedAt':Date[_0x20f9('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x20f9('0x6')+i,'lastName':_0x20f9('0x7')+i,'phone':0xf879fb460+i,'email':_0x20f9('0x3')+i+_0x20f9('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x20f9('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0x20f9('0x8')][_0x20f9('0x9')]({'where':{}})[_0x20f9('0xa')](function(){return db['CmContact'][_0x20f9('0xb')](contacts);})[_0x20f9('0xa')](function(){console[_0x20f9('0xc')](_0x20f9('0xd'),_0x20f9('0xe'));return db[_0x20f9('0xf')][_0x20f9('0x9')]({'where':{}});})[_0x20f9('0xa')](function(){return db['CmHopper'][_0x20f9('0xb')](hopper);})[_0x20f9('0xa')](function(){console[_0x20f9('0xc')](_0x20f9('0xd'),_0x20f9('0x10'));return db[_0x20f9('0x8')]['bulkCreate'](contacts2);})[_0x20f9('0xa')](function(){console[_0x20f9('0xc')]('finished\x20populating',_0x20f9('0x11'));return db[_0x20f9('0xf')]['bulkCreate'](hopper2);})[_0x20f9('0xa')](function(){console[_0x20f9('0xc')]('finished\x20populating',_0x20f9('0x12'));})['catch'](function(_0x4d71d1){console['log'](_0x4d71d1);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 1119baf..f362131 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x234e=['udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','format','%s%s','agent','%s%s@xcally.com','password','friend'];(function(_0x4b1032,_0x36952e){var _0x5a1d55=function(_0x282e9b){while(--_0x282e9b){_0x4b1032['push'](_0x4b1032['shift']());}};_0x5a1d55(++_0x36952e);}(_0x234e,0xe0));var _0xe234=function(_0x263bc2,_0x3ace27){_0x263bc2=_0x263bc2-0x0;var _0x31cdff=_0x234e[_0x263bc2];return _0x31cdff;};'use strict';var util=require('util');var db=require(_0xe234('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xe234('0x1')](_0xe234('0x2'),'agent',i),'fullname':util[_0xe234('0x1')](_0xe234('0x2'),_0xe234('0x3'),i),'email':util[_0xe234('0x1')](_0xe234('0x4'),'agent',i),'role':_0xe234('0x3'),'password':_0xe234('0x5'),'internal':0xfa0+i,'type':_0xe234('0x6'),'transport':[_0xe234('0x7'),'ws',_0xe234('0x8')],'disallow':[_0xe234('0x9')],'allow':[_0xe234('0xa')],'defaultuser':util[_0xe234('0x1')](_0xe234('0x2'),_0xe234('0x3'),i),'encryption':'yes','avpf':_0xe234('0xb'),'force_avp':'yes','icesupport':_0xe234('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xe234('0xc'),'dtlssetup':_0xe234('0xd'),'callerid':util['format'](_0xe234('0xe'),util[_0xe234('0x1')]('%s%s',_0xe234('0x3'),i),0xfa0+i)});}db[_0xe234('0xf')][_0xe234('0x10')](users)[_0xe234('0x11')](function(){console[_0xe234('0x12')](_0xe234('0x13'));})[_0xe234('0x14')](function(_0x4fdc7d){console[_0xe234('0x12')](_0x4fdc7d);}); \ No newline at end of file +var _0x75b8=['bulkCreate','then','log','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','udp','wss','yes','/etc/pki/tls/certs/motion.crt','\x22%s\x22\x20<%s>'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x75b8,0x74));var _0x875b=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0x75b8[_0x4cc280];return _0x16ed24;};'use strict';var util=require(_0x875b('0x0'));var db=require(_0x875b('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x875b('0x2')]({'name':util[_0x875b('0x3')](_0x875b('0x4'),'agent',i),'fullname':util[_0x875b('0x3')](_0x875b('0x4'),_0x875b('0x5'),i),'email':util[_0x875b('0x3')](_0x875b('0x6'),_0x875b('0x5'),i),'role':_0x875b('0x5'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0x875b('0x7'),'ws',_0x875b('0x8')],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0x875b('0x3')]('%s%s',_0x875b('0x5'),i),'encryption':_0x875b('0x9'),'avpf':_0x875b('0x9'),'force_avp':_0x875b('0x9'),'icesupport':_0x875b('0x9'),'dtlsenable':_0x875b('0x9'),'dtlsverify':'no','dtlscertfile':_0x875b('0xa'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0x875b('0x3')](_0x875b('0xb'),util['format']('%s%s','agent',i),0xfa0+i)});}db['User'][_0x875b('0xc')](users)[_0x875b('0xd')](function(){console[_0x875b('0xe')]('add\x20user');})[_0x875b('0xf')](function(_0x46611f){console[_0x875b('0xe')](_0x46611f);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 2fead9e..defaba0 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5532=['mail','whatsapp','telephone:%s','campaign:%s:%s','leave','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeWhatsappInteractions','catch','log','join','default','connection','setMaxListeners','address','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','Agents','User','name','agent','type','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','Telephones','Trunks','findAll','IvrCampaigns','resourceId','map','where','telephone','Campaign','length','format','user:%s','handshake','query','find','userProfileId','ChatInteractions','MailInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','role','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','MailQueue','WhatsappQueues','Trunk','getVoiceQueues','getMailQueues','getWhatsappQueues','all','voice','chat','fax','sms'];(function(_0x1ac072,_0x5efcc4){var _0x46e3a6=function(_0x5a9071){while(--_0x5a9071){_0x1ac072['push'](_0x1ac072['shift']());}};_0x46e3a6(++_0x5efcc4);}(_0x5532,0x19a));var _0x2553=function(_0x512b6d,_0xa881ac){_0x512b6d=_0x512b6d-0x0;var _0x49dd13=_0x5532[_0x512b6d];return _0x49dd13;};'use strict';var _=require(_0x2553('0x0'));var util=require(_0x2553('0x1'));var BPromise=require(_0x2553('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x2553('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x2553('0x4'),'model':db[_0x2553('0x5')],'attributes':['id',_0x2553('0x6'),'role'],'raw':!![],'where':{'role':_0x2553('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x2553('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x2553('0x6')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2553('0x6'),_0x2553('0x8')],'where':{'type':_0x2553('0x9')}};function getAssociatedResources(_0x3360d9,_0xd28dbb,_0x183d20){return db[_0x2553('0xa')][_0x2553('0xb')]({'where':{'name':_0x3360d9,'userProfileId':_0xd28dbb},'raw':!![]})[_0x2553('0xc')](function(_0xf589a5){if(_0xf589a5){if(_0xf589a5['autoAssociation']){switch(_0x3360d9){case _0x2553('0xd'):case _0x2553('0xe'):case _0x2553('0xf'):case'SmsQueues':case _0x2553('0x10'):case _0x2553('0x11'):case'WhatsappQueues':return db[_0x183d20]['findAll'](queryQueues);case _0x2553('0x12'):return db[_0x183d20]['findAll'](queryTelephones);case _0x2553('0x13'):return db[_0x183d20][_0x2553('0x14')](queryTrunks);case _0x2553('0x15'):return db[_0x183d20]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x2553('0x14')]({'attributes':[_0x2553('0x16')],'where':{'sectionId':_0xf589a5['id']},'raw':!![]})[_0x2553('0xc')](function(_0x77477d){if(_0x77477d){var _0x241dfe={'where':{'id':_[_0x2553('0x17')](_0x77477d,'resourceId')},'raw':!![]};switch(_0x183d20){case _0x2553('0x5'):_0x241dfe[_0x2553('0x18')]['role']=_0x2553('0x19');break;case _0x2553('0x1a'):_0x241dfe['where'][_0x2553('0x8')]=_0x2553('0x9');break;}return db[_0x183d20][_0x2553('0x14')](_0x241dfe);}else{return[];}});}}else{return[];}})[_0x2553('0xc')](function(_0x4970de){return _0x4970de;});}function joinOrLeaveQueues(_0x4abc05,_0x5b875b,_0x3eba0d,_0x15ced9){_0x4abc05[_0x5b875b](util['format']('%s:queue:%s',_0x3eba0d,_0x15ced9[_0x2553('0x6')]));if(_0x15ced9[_0x2553('0x4')]){for(var _0x36f27c=0x0;_0x36f27c<_0x15ced9['Agents'][_0x2553('0x1b')];_0x36f27c+=0x1){_0x4abc05[_0x5b875b](util[_0x2553('0x1c')](_0x2553('0x1d'),_0x15ced9['Agents'][_0x36f27c][_0x2553('0x6')]));}}}function joinOrLeave(_0x3d7445,_0xe152e1,_0xc91f02){var _0x49d4d1;if(_0x3d7445[_0x2553('0x1e')][_0x2553('0x1f')]['id']){db['User'][_0x2553('0x20')]({'attributes':['id',_0x2553('0x6'),'role',_0x2553('0x21')],'where':{'id':_0x3d7445[_0x2553('0x1e')][_0x2553('0x1f')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x2553('0x22'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x2553('0x23'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2553('0x24')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2553('0x25')],'as':_0x2553('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x2553('0x27')],'as':_0x2553('0x28'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x19fec3){if(_0x19fec3){_0x49d4d1=_0x19fec3;_0x3d7445[_0xe152e1](util[_0x2553('0x1c')](_0x2553('0x1d'),_0x19fec3[_0x2553('0x6')]));var _0x931982=[];switch(_0x19fec3[_0x2553('0x29')]){case _0x2553('0x2a'):_0x3d7445[_0xe152e1](_0x2553('0x2b'));_0x3d7445[_0xe152e1](_0x2553('0x2c'));if(queryQueues[_0x2553('0x2d')](_0x2553('0x2e'))){delete queryQueues[_0x2553('0x2e')];}_0x931982[_0x2553('0x2f')](db[_0x2553('0x30')]['findAll'](queryQueues));_0x931982[_0x2553('0x2f')](db[_0x2553('0x31')]['findAll'](queryQueues));_0x931982[_0x2553('0x2f')](db[_0x2553('0x32')]['findAll'](queryQueues));_0x931982[_0x2553('0x2f')](db[_0x2553('0x33')][_0x2553('0x14')](queryQueues));_0x931982[_0x2553('0x2f')](db['MailQueue'][_0x2553('0x14')](queryQueues));_0x931982[_0x2553('0x2f')](db[_0x2553('0x34')][_0x2553('0x14')](queryQueues));_0x931982[_0x2553('0x2f')](db[_0x2553('0x35')][_0x2553('0x14')](queryQueues));_0x931982[_0x2553('0x2f')](db[_0x2553('0x5')]['findAll'](queryTelephones));_0x931982[_0x2553('0x2f')](db['Trunk'][_0x2553('0x14')](queryTrunks));_0x931982[_0x2553('0x2f')](db[_0x2553('0x1a')]['findAll'](queryCampaigns));_0x931982[_0x2553('0x2f')](db['User']['findAll'](queryAgents));break;case'user':_0x3d7445[_0xe152e1](_0x2553('0x2b'));_0x3d7445[_0xe152e1](_0x2553('0x2c'));_0x931982[_0x2553('0x2f')](getAssociatedResources(_0x2553('0xd'),_0x19fec3['userProfileId'],_0x2553('0x30')));_0x931982[_0x2553('0x2f')](getAssociatedResources(_0x2553('0xe'),_0x19fec3['userProfileId'],_0x2553('0x31')));_0x931982[_0x2553('0x2f')](getAssociatedResources(_0x2553('0xf'),_0x19fec3[_0x2553('0x21')],_0x2553('0x32')));_0x931982[_0x2553('0x2f')](getAssociatedResources('SmsQueues',_0x19fec3[_0x2553('0x21')],_0x2553('0x33')));_0x931982[_0x2553('0x2f')](getAssociatedResources(_0x2553('0x10'),_0x19fec3[_0x2553('0x21')],_0x2553('0x36')));_0x931982['push'](getAssociatedResources('OpenchannelQueues',_0x19fec3[_0x2553('0x21')],_0x2553('0x34')));_0x931982[_0x2553('0x2f')](getAssociatedResources(_0x2553('0x37'),_0x19fec3['userProfileId'],_0x2553('0x35')));_0x931982['push'](getAssociatedResources(_0x2553('0x12'),_0x19fec3[_0x2553('0x21')],_0x2553('0x5')));_0x931982[_0x2553('0x2f')](getAssociatedResources(_0x2553('0x13'),_0x19fec3['userProfileId'],_0x2553('0x38')));_0x931982[_0x2553('0x2f')](getAssociatedResources(_0x2553('0x15'),_0x19fec3[_0x2553('0x21')],'Campaign'));_0x931982[_0x2553('0x2f')](db['User']['findAll'](queryAgents));break;case _0x2553('0x7'):_0x3d7445[_0xe152e1]('voice:inbound');_0x3d7445[_0xe152e1](_0x2553('0x2c'));_0x931982[_0x2553('0x2f')](_0x19fec3[_0x2553('0x39')]({'attributes':['id',_0x2553('0x6')]}));_0x931982['push'](_0x19fec3['getChatQueues']({'attributes':['id',_0x2553('0x6')]}));_0x931982[_0x2553('0x2f')](_0x19fec3['getFaxQueues']({'attributes':['id','name']}));_0x931982['push'](_0x19fec3['getSmsQueues']({'attributes':['id','name']}));_0x931982[_0x2553('0x2f')](_0x19fec3[_0x2553('0x3a')]({'attributes':['id',_0x2553('0x6')]}));_0x931982[_0x2553('0x2f')](_0x19fec3['getOpenchannelQueues']({'attributes':['id','name']}));_0x931982['push'](_0x19fec3[_0x2553('0x3b')]({'attributes':['id',_0x2553('0x6')]}));break;}return BPromise[_0x2553('0x3c')](_0x931982);}})[_0x2553('0xc')](function(_0x27d307){if(_0x27d307&&_0x27d307[_0x2553('0x1b')]){for(var _0x5bfcf0=0x0;_0x5bfcf0<_0x27d307[_0x2553('0x1b')];_0x5bfcf0+=0x1){for(var _0x15e519=0x0;_0x15e519<_0x27d307[_0x5bfcf0][_0x2553('0x1b')];_0x15e519+=0x1){switch(_0x5bfcf0){case 0x0:joinOrLeaveQueues(_0x3d7445,_0xe152e1,_0x2553('0x3d'),_0x27d307[_0x5bfcf0][_0x15e519]);break;case 0x1:joinOrLeaveQueues(_0x3d7445,_0xe152e1,_0x2553('0x3e'),_0x27d307[_0x5bfcf0][_0x15e519]);break;case 0x2:joinOrLeaveQueues(_0x3d7445,_0xe152e1,_0x2553('0x3f'),_0x27d307[_0x5bfcf0][_0x15e519]);break;case 0x3:joinOrLeaveQueues(_0x3d7445,_0xe152e1,_0x2553('0x40'),_0x27d307[_0x5bfcf0][_0x15e519]);break;case 0x4:joinOrLeaveQueues(_0x3d7445,_0xe152e1,_0x2553('0x41'),_0x27d307[_0x5bfcf0][_0x15e519]);break;case 0x5:joinOrLeaveQueues(_0x3d7445,_0xe152e1,'openchannel',_0x27d307[_0x5bfcf0][_0x15e519]);break;case 0x6:joinOrLeaveQueues(_0x3d7445,_0xe152e1,_0x2553('0x42'),_0x27d307[_0x5bfcf0][_0x15e519]);break;case 0x7:if(_0x49d4d1[_0x2553('0x29')]!=='agent')_0x3d7445[_0xe152e1](util[_0x2553('0x1c')](_0x2553('0x43'),_0x27d307[_0x5bfcf0][_0x15e519]['name']));break;case 0x8:if(_0x49d4d1[_0x2553('0x29')]!=='agent')_0x3d7445[_0xe152e1](util[_0x2553('0x1c')]('trunk:%s',_0x27d307[_0x5bfcf0][_0x15e519]['name']));break;case 0x9:if(_0x49d4d1['role']!==_0x2553('0x7'))_0x3d7445[_0xe152e1](util[_0x2553('0x1c')](_0x2553('0x44'),_0x27d307[_0x5bfcf0][_0x15e519][_0x2553('0x8')],_0x27d307[_0x5bfcf0][_0x15e519]['name']));break;case 0xa:_0x3d7445[_0xe152e1](util['format']('user:%s',_0x27d307[_0x5bfcf0][_0x15e519][_0x2553('0x6')]));break;}}}}})['then'](function(){if(_0xe152e1===_0x2553('0x45')){var _0x3c0a84=_[_0x2553('0x17')](_0x49d4d1[_0x2553('0x22')],'id');return _0x49d4d1['removeChatInteractions'](_0x3c0a84)[_0x2553('0xc')](function(){for(var _0x3f2ee8=0x0;_0x3f2ee8<_0x3c0a84[_0x2553('0x1b')];_0x3f2ee8+=0x1){_0xc91f02[_0x2553('0x46')](_0x2553('0x47'),{'ChatInteractionId':Number(_0x3c0a84[_0x3f2ee8]),'UserId':Number(_0x49d4d1['id'])});}});}})[_0x2553('0xc')](function(){if(_0xe152e1===_0x2553('0x45')){var _0x54e924=_[_0x2553('0x17')](_0x49d4d1['MailInteractions'],'id');return _0x49d4d1[_0x2553('0x48')](_0x54e924)[_0x2553('0xc')](function(){for(var _0x364c85=0x0;_0x364c85<_0x54e924[_0x2553('0x1b')];_0x364c85+=0x1){_0xc91f02[_0x2553('0x46')](_0x2553('0x49'),{'MailInteractionId':Number(_0x54e924[_0x364c85]),'UserId':Number(_0x49d4d1['id'])});}});}})[_0x2553('0xc')](function(){if(_0xe152e1==='leave'){var _0x311b66=_[_0x2553('0x17')](_0x49d4d1[_0x2553('0x4a')],'id');return _0x49d4d1[_0x2553('0x4b')](_0x311b66)['then'](function(){for(var _0x3b8a33=0x0;_0x3b8a33<_0x311b66['length'];_0x3b8a33+=0x1){_0xc91f02[_0x2553('0x46')](_0x2553('0x4c'),{'FaxInteractionId':Number(_0x311b66[_0x3b8a33]),'UserId':Number(_0x49d4d1['id'])});}});}})[_0x2553('0xc')](function(){if(_0xe152e1==='leave'){var _0x2f3ca4=_[_0x2553('0x17')](_0x49d4d1['SmsInteractions'],'id');return _0x49d4d1[_0x2553('0x4d')](_0x2f3ca4)[_0x2553('0xc')](function(){for(var _0xfc91c8=0x0;_0xfc91c8<_0x2f3ca4[_0x2553('0x1b')];_0xfc91c8+=0x1){_0xc91f02[_0x2553('0x46')](_0x2553('0x4e'),{'SmsInteractionId':Number(_0x2f3ca4[_0xfc91c8]),'UserId':Number(_0x49d4d1['id'])});}});}})[_0x2553('0xc')](function(){if(_0xe152e1===_0x2553('0x45')){var _0x54aae9=_['map'](_0x49d4d1['OpenchannelInteractions'],'id');return _0x49d4d1['removeOpenchannelInteractions'](_0x54aae9)[_0x2553('0xc')](function(){for(var _0x133773=0x0;_0x133773<_0x54aae9['length'];_0x133773+=0x1){_0xc91f02[_0x2553('0x46')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x54aae9[_0x133773]),'UserId':Number(_0x49d4d1['id'])});}});}})[_0x2553('0xc')](function(){if(_0xe152e1===_0x2553('0x45')){var _0x176d8a=_[_0x2553('0x17')](_0x49d4d1[_0x2553('0x28')],'id');return _0x49d4d1[_0x2553('0x4f')](_0x176d8a)[_0x2553('0xc')](function(){for(var _0x1a1059=0x0;_0x1a1059<_0x176d8a[_0x2553('0x1b')];_0x1a1059+=0x1){_0xc91f02[_0x2553('0x46')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x176d8a[_0x1a1059]),'UserId':Number(_0x49d4d1['id'])});}});}})[_0x2553('0x50')](function(_0x281044){_0x3d7445[_0x2553('0x51')](_0x281044);});}}function onDisconnect(_0x2e35d7,_0x1844f9){joinOrLeave(_0x2e35d7,_0x2553('0x45'),_0x1844f9);}function onConnect(_0x3b672f){joinOrLeave(_0x3b672f,_0x2553('0x52'));}exports[_0x2553('0x53')]=function(_0x4c5aee){_0x4c5aee['on'](_0x2553('0x54'),function(_0x3dd0ef){_0x3dd0ef[_0x2553('0x55')](0x0);_0x3dd0ef[_0x2553('0x56')]=_0x3dd0ef['request']['connection'][_0x2553('0x57')]+':'+_0x3dd0ef[_0x2553('0x58')][_0x2553('0x54')][_0x2553('0x59')];_0x3dd0ef[_0x2553('0x5a')]=new Date();_0x3dd0ef[_0x2553('0x51')]=function(_0x3ee25a){console[_0x2553('0x51')](_0x2553('0x5b')+_0x3dd0ef[_0x2553('0x5c')]['name']+'['+_0x3dd0ef[_0x2553('0x56')]+']',_0x3ee25a);};_0x3dd0ef['on']('disconnect',function(){onDisconnect(_0x3dd0ef,_0x4c5aee);_0x3dd0ef[_0x2553('0x51')](_0x2553('0x5d'));});onConnect(_0x3dd0ef);_0x3dd0ef['log'](_0x2553('0x5e'));});}; \ No newline at end of file +var _0xd47f=['SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','hasOwnProperty','include','VoiceQueue','ChatQueue','push','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:outbound','WhatsappQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','all','length','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','emit','user_has_fax_interactions:remove','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','UserProfileSection','findOne','then','ChatQueues','MailQueues','Telephones','Trunks','findAll','IvrCampaigns','UserProfileResource','resourceId','map','Campaign','where','type','format','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0xd47f,0x1bd));var _0xfd47=function(_0x5bc5fe,_0x2afaef){_0x5bc5fe=_0x5bc5fe-0x0;var _0x298ea7=_0xd47f[_0x5bc5fe];return _0x298ea7;};'use strict';var _=require(_0xfd47('0x0'));var util=require('util');var BPromise=require(_0xfd47('0x1'));var db=require(_0xfd47('0x2'))['db'];var config=require(_0xfd47('0x3'));var queryQueues={'attributes':['id',_0xfd47('0x4')],'include':[{'as':_0xfd47('0x5'),'model':db[_0xfd47('0x6')],'attributes':['id',_0xfd47('0x4'),_0xfd47('0x7')],'raw':!![],'where':{'role':_0xfd47('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xfd47('0x4')],'where':{'role':_0xfd47('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xfd47('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xfd47('0x4'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x4fa356,_0xa2ef6a,_0x1d67e7){return db[_0xfd47('0xa')][_0xfd47('0xb')]({'where':{'name':_0x4fa356,'userProfileId':_0xa2ef6a},'raw':!![]})[_0xfd47('0xc')](function(_0x2cb7c2){if(_0x2cb7c2){if(_0x2cb7c2['autoAssociation']){switch(_0x4fa356){case'VoiceQueues':case _0xfd47('0xd'):case'FaxQueues':case'SmsQueues':case _0xfd47('0xe'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x1d67e7]['findAll'](queryQueues);case _0xfd47('0xf'):return db[_0x1d67e7]['findAll'](queryTelephones);case _0xfd47('0x10'):return db[_0x1d67e7][_0xfd47('0x11')](queryTrunks);case _0xfd47('0x12'):return db[_0x1d67e7]['findAll'](queryCampaigns);}}else{return db[_0xfd47('0x13')][_0xfd47('0x11')]({'attributes':[_0xfd47('0x14')],'where':{'sectionId':_0x2cb7c2['id']},'raw':!![]})[_0xfd47('0xc')](function(_0x584fe1){if(_0x584fe1){var _0x791937={'where':{'id':_[_0xfd47('0x15')](_0x584fe1,_0xfd47('0x14'))},'raw':!![]};switch(_0x1d67e7){case'User':_0x791937['where'][_0xfd47('0x7')]=_0xfd47('0x9');break;case _0xfd47('0x16'):_0x791937[_0xfd47('0x17')][_0xfd47('0x18')]='ivr';break;}return db[_0x1d67e7][_0xfd47('0x11')](_0x791937);}else{return[];}});}}else{return[];}})[_0xfd47('0xc')](function(_0x16aea0){return _0x16aea0;});}function joinOrLeaveQueues(_0x231106,_0x21cdb0,_0x3e2d03,_0x5d3c0f){_0x231106[_0x21cdb0](util[_0xfd47('0x19')]('%s:queue:%s',_0x3e2d03,_0x5d3c0f[_0xfd47('0x4')]));if(_0x5d3c0f[_0xfd47('0x5')]){for(var _0x4153f6=0x0;_0x4153f6<_0x5d3c0f[_0xfd47('0x5')]['length'];_0x4153f6+=0x1){_0x231106[_0x21cdb0](util[_0xfd47('0x19')](_0xfd47('0x1a'),_0x5d3c0f[_0xfd47('0x5')][_0x4153f6][_0xfd47('0x4')]));}}}function joinOrLeave(_0x4bbeb9,_0x511dbd,_0x285f2a){var _0xc06999;if(_0x4bbeb9[_0xfd47('0x1b')][_0xfd47('0x1c')]['id']){db[_0xfd47('0x6')]['find']({'attributes':['id',_0xfd47('0x4'),'role',_0xfd47('0x1d')],'where':{'id':_0x4bbeb9[_0xfd47('0x1b')][_0xfd47('0x1c')]['id']},'include':[{'model':db[_0xfd47('0x1e')],'as':_0xfd47('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0xfd47('0x20')],'as':_0xfd47('0x21'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xfd47('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xfd47('0x23')],'as':_0xfd47('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xfd47('0x25')],'as':_0xfd47('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xfd47('0x27')],'as':_0xfd47('0x28'),'attributes':['id'],'raw':!![]}]})[_0xfd47('0xc')](function(_0x3dfd47){if(_0x3dfd47){_0xc06999=_0x3dfd47;_0x4bbeb9[_0x511dbd](util[_0xfd47('0x19')](_0xfd47('0x1a'),_0x3dfd47[_0xfd47('0x4')]));var _0x4972bf=[];switch(_0x3dfd47[_0xfd47('0x7')]){case _0xfd47('0x29'):_0x4bbeb9[_0x511dbd](_0xfd47('0x2a'));_0x4bbeb9[_0x511dbd]('voice:outbound');if(queryQueues[_0xfd47('0x2b')]('include')){delete queryQueues[_0xfd47('0x2c')];}_0x4972bf['push'](db[_0xfd47('0x2d')][_0xfd47('0x11')](queryQueues));_0x4972bf['push'](db[_0xfd47('0x2e')][_0xfd47('0x11')](queryQueues));_0x4972bf[_0xfd47('0x2f')](db[_0xfd47('0x30')][_0xfd47('0x11')](queryQueues));_0x4972bf[_0xfd47('0x2f')](db[_0xfd47('0x31')]['findAll'](queryQueues));_0x4972bf[_0xfd47('0x2f')](db[_0xfd47('0x32')]['findAll'](queryQueues));_0x4972bf[_0xfd47('0x2f')](db[_0xfd47('0x33')][_0xfd47('0x11')](queryQueues));_0x4972bf['push'](db[_0xfd47('0x34')]['findAll'](queryQueues));_0x4972bf[_0xfd47('0x2f')](db[_0xfd47('0x6')]['findAll'](queryTelephones));_0x4972bf[_0xfd47('0x2f')](db[_0xfd47('0x35')][_0xfd47('0x11')](queryTrunks));_0x4972bf['push'](db[_0xfd47('0x16')][_0xfd47('0x11')](queryCampaigns));_0x4972bf[_0xfd47('0x2f')](db['User'][_0xfd47('0x11')](queryAgents));break;case _0xfd47('0x36'):_0x4bbeb9[_0x511dbd]('voice:inbound');_0x4bbeb9[_0x511dbd](_0xfd47('0x37'));_0x4972bf[_0xfd47('0x2f')](getAssociatedResources('VoiceQueues',_0x3dfd47['userProfileId'],_0xfd47('0x2d')));_0x4972bf['push'](getAssociatedResources(_0xfd47('0xd'),_0x3dfd47['userProfileId'],_0xfd47('0x2e')));_0x4972bf[_0xfd47('0x2f')](getAssociatedResources('FaxQueues',_0x3dfd47[_0xfd47('0x1d')],'FaxQueue'));_0x4972bf[_0xfd47('0x2f')](getAssociatedResources('SmsQueues',_0x3dfd47[_0xfd47('0x1d')],'SmsQueue'));_0x4972bf[_0xfd47('0x2f')](getAssociatedResources(_0xfd47('0xe'),_0x3dfd47[_0xfd47('0x1d')],'MailQueue'));_0x4972bf['push'](getAssociatedResources('OpenchannelQueues',_0x3dfd47[_0xfd47('0x1d')],_0xfd47('0x33')));_0x4972bf[_0xfd47('0x2f')](getAssociatedResources(_0xfd47('0x38'),_0x3dfd47[_0xfd47('0x1d')],'WhatsappQueue'));_0x4972bf[_0xfd47('0x2f')](getAssociatedResources(_0xfd47('0xf'),_0x3dfd47[_0xfd47('0x1d')],_0xfd47('0x6')));_0x4972bf[_0xfd47('0x2f')](getAssociatedResources(_0xfd47('0x10'),_0x3dfd47[_0xfd47('0x1d')],_0xfd47('0x35')));_0x4972bf[_0xfd47('0x2f')](getAssociatedResources(_0xfd47('0x12'),_0x3dfd47[_0xfd47('0x1d')],_0xfd47('0x16')));_0x4972bf['push'](db[_0xfd47('0x6')][_0xfd47('0x11')](queryAgents));break;case _0xfd47('0x8'):_0x4bbeb9[_0x511dbd](_0xfd47('0x2a'));_0x4bbeb9[_0x511dbd](_0xfd47('0x37'));_0x4972bf[_0xfd47('0x2f')](_0x3dfd47['getVoiceQueues']({'attributes':['id',_0xfd47('0x4')]}));_0x4972bf[_0xfd47('0x2f')](_0x3dfd47[_0xfd47('0x39')]({'attributes':['id','name']}));_0x4972bf[_0xfd47('0x2f')](_0x3dfd47[_0xfd47('0x3a')]({'attributes':['id',_0xfd47('0x4')]}));_0x4972bf[_0xfd47('0x2f')](_0x3dfd47[_0xfd47('0x3b')]({'attributes':['id',_0xfd47('0x4')]}));_0x4972bf[_0xfd47('0x2f')](_0x3dfd47['getMailQueues']({'attributes':['id',_0xfd47('0x4')]}));_0x4972bf[_0xfd47('0x2f')](_0x3dfd47[_0xfd47('0x3c')]({'attributes':['id','name']}));_0x4972bf[_0xfd47('0x2f')](_0x3dfd47['getWhatsappQueues']({'attributes':['id',_0xfd47('0x4')]}));break;}return BPromise[_0xfd47('0x3d')](_0x4972bf);}})['then'](function(_0x2db46b){if(_0x2db46b&&_0x2db46b[_0xfd47('0x3e')]){for(var _0x19af79=0x0;_0x19af79<_0x2db46b[_0xfd47('0x3e')];_0x19af79+=0x1){for(var _0x517908=0x0;_0x517908<_0x2db46b[_0x19af79][_0xfd47('0x3e')];_0x517908+=0x1){switch(_0x19af79){case 0x0:joinOrLeaveQueues(_0x4bbeb9,_0x511dbd,'voice',_0x2db46b[_0x19af79][_0x517908]);break;case 0x1:joinOrLeaveQueues(_0x4bbeb9,_0x511dbd,'chat',_0x2db46b[_0x19af79][_0x517908]);break;case 0x2:joinOrLeaveQueues(_0x4bbeb9,_0x511dbd,_0xfd47('0x3f'),_0x2db46b[_0x19af79][_0x517908]);break;case 0x3:joinOrLeaveQueues(_0x4bbeb9,_0x511dbd,_0xfd47('0x40'),_0x2db46b[_0x19af79][_0x517908]);break;case 0x4:joinOrLeaveQueues(_0x4bbeb9,_0x511dbd,'mail',_0x2db46b[_0x19af79][_0x517908]);break;case 0x5:joinOrLeaveQueues(_0x4bbeb9,_0x511dbd,_0xfd47('0x41'),_0x2db46b[_0x19af79][_0x517908]);break;case 0x6:joinOrLeaveQueues(_0x4bbeb9,_0x511dbd,_0xfd47('0x42'),_0x2db46b[_0x19af79][_0x517908]);break;case 0x7:if(_0xc06999['role']!==_0xfd47('0x8'))_0x4bbeb9[_0x511dbd](util[_0xfd47('0x19')](_0xfd47('0x43'),_0x2db46b[_0x19af79][_0x517908][_0xfd47('0x4')]));break;case 0x8:if(_0xc06999[_0xfd47('0x7')]!=='agent')_0x4bbeb9[_0x511dbd](util[_0xfd47('0x19')](_0xfd47('0x44'),_0x2db46b[_0x19af79][_0x517908][_0xfd47('0x4')]));break;case 0x9:if(_0xc06999['role']!=='agent')_0x4bbeb9[_0x511dbd](util[_0xfd47('0x19')](_0xfd47('0x45'),_0x2db46b[_0x19af79][_0x517908]['type'],_0x2db46b[_0x19af79][_0x517908][_0xfd47('0x4')]));break;case 0xa:_0x4bbeb9[_0x511dbd](util[_0xfd47('0x19')](_0xfd47('0x1a'),_0x2db46b[_0x19af79][_0x517908][_0xfd47('0x4')]));break;}}}}})['then'](function(){if(_0x511dbd===_0xfd47('0x46')){var _0x2c4a6e=_[_0xfd47('0x15')](_0xc06999['ChatInteractions'],'id');return _0xc06999[_0xfd47('0x47')](_0x2c4a6e)[_0xfd47('0xc')](function(){for(var _0x596b99=0x0;_0x596b99<_0x2c4a6e[_0xfd47('0x3e')];_0x596b99+=0x1){_0x285f2a['emit'](_0xfd47('0x48'),{'ChatInteractionId':Number(_0x2c4a6e[_0x596b99]),'UserId':Number(_0xc06999['id'])});}});}})[_0xfd47('0xc')](function(){if(_0x511dbd===_0xfd47('0x46')){var _0x4c0272=_[_0xfd47('0x15')](_0xc06999[_0xfd47('0x21')],'id');return _0xc06999[_0xfd47('0x49')](_0x4c0272)[_0xfd47('0xc')](function(){for(var _0x3ed00e=0x0;_0x3ed00e<_0x4c0272[_0xfd47('0x3e')];_0x3ed00e+=0x1){_0x285f2a['emit'](_0xfd47('0x4a'),{'MailInteractionId':Number(_0x4c0272[_0x3ed00e]),'UserId':Number(_0xc06999['id'])});}});}})[_0xfd47('0xc')](function(){if(_0x511dbd===_0xfd47('0x46')){var _0x49e995=_['map'](_0xc06999[_0xfd47('0x22')],'id');return _0xc06999[_0xfd47('0x4b')](_0x49e995)[_0xfd47('0xc')](function(){for(var _0x158b78=0x0;_0x158b78<_0x49e995[_0xfd47('0x3e')];_0x158b78+=0x1){_0x285f2a[_0xfd47('0x4c')](_0xfd47('0x4d'),{'FaxInteractionId':Number(_0x49e995[_0x158b78]),'UserId':Number(_0xc06999['id'])});}});}})[_0xfd47('0xc')](function(){if(_0x511dbd===_0xfd47('0x46')){var _0x212d17=_[_0xfd47('0x15')](_0xc06999[_0xfd47('0x24')],'id');return _0xc06999['removeSmsInteractions'](_0x212d17)[_0xfd47('0xc')](function(){for(var _0x29a10c=0x0;_0x29a10c<_0x212d17[_0xfd47('0x3e')];_0x29a10c+=0x1){_0x285f2a['emit'](_0xfd47('0x4e'),{'SmsInteractionId':Number(_0x212d17[_0x29a10c]),'UserId':Number(_0xc06999['id'])});}});}})['then'](function(){if(_0x511dbd==='leave'){var _0x174593=_[_0xfd47('0x15')](_0xc06999[_0xfd47('0x26')],'id');return _0xc06999['removeOpenchannelInteractions'](_0x174593)[_0xfd47('0xc')](function(){for(var _0x4c3cca=0x0;_0x4c3cca<_0x174593[_0xfd47('0x3e')];_0x4c3cca+=0x1){_0x285f2a[_0xfd47('0x4c')](_0xfd47('0x4f'),{'OpenchannelInteractionId':Number(_0x174593[_0x4c3cca]),'UserId':Number(_0xc06999['id'])});}});}})[_0xfd47('0xc')](function(){if(_0x511dbd===_0xfd47('0x46')){var _0x2c7615=_[_0xfd47('0x15')](_0xc06999[_0xfd47('0x28')],'id');return _0xc06999[_0xfd47('0x50')](_0x2c7615)['then'](function(){for(var _0x365d1f=0x0;_0x365d1f<_0x2c7615['length'];_0x365d1f+=0x1){_0x285f2a[_0xfd47('0x4c')](_0xfd47('0x51'),{'WhatsappInteractionId':Number(_0x2c7615[_0x365d1f]),'UserId':Number(_0xc06999['id'])});}});}})[_0xfd47('0x52')](function(_0x55de49){_0x4bbeb9[_0xfd47('0x53')](_0x55de49);});}}function onDisconnect(_0x3721f3,_0x241bcf){joinOrLeave(_0x3721f3,_0xfd47('0x46'),_0x241bcf);}function onConnect(_0x549b79){joinOrLeave(_0x549b79,_0xfd47('0x54'));}exports[_0xfd47('0x55')]=function(_0x256b9c){_0x256b9c['on'](_0xfd47('0x56'),function(_0x41f4a8){_0x41f4a8[_0xfd47('0x57')](0x0);_0x41f4a8[_0xfd47('0x58')]=_0x41f4a8[_0xfd47('0x59')][_0xfd47('0x56')]['remoteAddress']+':'+_0x41f4a8[_0xfd47('0x59')][_0xfd47('0x56')][_0xfd47('0x5a')];_0x41f4a8[_0xfd47('0x5b')]=new Date();_0x41f4a8['log']=function(_0x4f6af0){console[_0xfd47('0x53')]('SocketIO\x20'+_0x41f4a8[_0xfd47('0x5c')][_0xfd47('0x4')]+'['+_0x41f4a8[_0xfd47('0x58')]+']',_0x4f6af0);};_0x41f4a8['on'](_0xfd47('0x5d'),function(){onDisconnect(_0x41f4a8,_0x256b9c);_0x41f4a8[_0xfd47('0x53')](_0xfd47('0x5e'));});onConnect(_0x41f4a8);_0x41f4a8[_0xfd47('0x53')](_0xfd47('0x5f'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index c5ca554..21afd05 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 _0x15a5=['hook','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','afterCreate','newinteraction','ChatInteraction','closedinteraction','Chat','ChatOfflineMessage','newmessage','SmsInteraction','Sms','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','OpenchannelInteraction','Openchannel','request','EventManager','then','Trigger,\x20%s','error','code','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','SELECT','UserId','format','SIP/%s','name','incomingmessage','catch','AfterCreateMessage','offlineMessage','get','opened','sequelize','QueryTypes','contact','interface','agent','changed','closed','substatus','AfterUpdate','User','find','fullname','email','internal','default','length','hasOwnProperty','model'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x15a5,0x9d));var _0x515a=function(_0x38d81f,_0xe84cce){_0x38d81f=_0x38d81f-0x0;var _0x2f0c86=_0x15a5[_0x38d81f];return _0x2f0c86;};'use strict';var util=require(_0x515a('0x0'));var db=require(_0x515a('0x1'))['db'];var jayson=require(_0x515a('0x2'));var logger=require(_0x515a('0x3'))(_0x515a('0x4'));var client=jayson[_0x515a('0x5')][_0x515a('0x6')]({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':_0x515a('0x7'),'condition':_0x515a('0x8'),'callback':afterCreate},{'channel':'Chat','model':_0x515a('0x9'),'event':'afterUpdate','condition':_0x515a('0xa'),'callback':afterUpdate},{'channel':_0x515a('0xb'),'model':'ChatMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x515a('0xb'),'model':_0x515a('0xc'),'event':_0x515a('0x7'),'condition':_0x515a('0xd'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x515a('0xe'),'event':'afterCreate','condition':_0x515a('0x8'),'callback':afterCreate},{'channel':_0x515a('0xf'),'model':'SmsInteraction','event':_0x515a('0x10'),'condition':_0x515a('0xa'),'callback':afterUpdate},{'channel':_0x515a('0xf'),'model':_0x515a('0x11'),'event':_0x515a('0x7'),'condition':_0x515a('0xd'),'callback':afterCreateMessage},{'channel':_0x515a('0x12'),'model':_0x515a('0x13'),'event':_0x515a('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x515a('0x12'),'model':_0x515a('0x13'),'event':_0x515a('0x10'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x515a('0x12'),'model':_0x515a('0x14'),'event':_0x515a('0x7'),'condition':_0x515a('0xd'),'callback':afterCreateMessage},{'channel':_0x515a('0x15'),'model':'FaxInteraction','event':_0x515a('0x7'),'condition':_0x515a('0x8'),'callback':afterCreate},{'channel':_0x515a('0x15'),'model':_0x515a('0x16'),'event':_0x515a('0x10'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Fax','model':_0x515a('0x17'),'event':_0x515a('0x7'),'condition':_0x515a('0xd'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x515a('0x18'),'event':_0x515a('0x7'),'condition':_0x515a('0x8'),'callback':afterCreate},{'channel':_0x515a('0x19'),'model':_0x515a('0x18'),'event':_0x515a('0x10'),'condition':_0x515a('0xa'),'callback':afterUpdate},{'channel':_0x515a('0x19'),'model':_0x515a('0x1a'),'event':_0x515a('0x7'),'condition':_0x515a('0xd'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x515a('0x1b'),'event':_0x515a('0x7'),'condition':_0x515a('0x8'),'callback':afterCreate},{'channel':_0x515a('0x1c'),'model':_0x515a('0x1b'),'event':_0x515a('0x10'),'condition':_0x515a('0xa'),'callback':afterUpdate},{'channel':_0x515a('0x1c'),'model':'OpenchannelMessage','event':_0x515a('0x7'),'condition':_0x515a('0xd'),'callback':afterCreateMessage}];function request(_0x4062ff){return client[_0x515a('0x1d')](_0x515a('0x1e'),_0x4062ff)[_0x515a('0x1f')](function(_0x2a75b4){logger['info'](_0x515a('0x20'),_0x515a('0x1e'),_0x2a75b4);if(_0x2a75b4[_0x515a('0x21')]){if(_0x2a75b4[_0x515a('0x21')][_0x515a('0x22')]===0x1f4){logger[_0x515a('0x21')]('Trigger,\x20%s',_0x515a('0x1e'),_0x2a75b4[_0x515a('0x21')]);}}})['catch'](function(_0x285bc3){logger[_0x515a('0x21')](_0x515a('0x20'),'EventManager',_0x285bc3);});}function afterCreateMessage(_0x228001){return function(_0x6b3051){_0x6b3051=_0x6b3051['get']({'plain':!![]});_0x6b3051[_0x515a('0x23')]=_0x228001;_0x6b3051[_0x515a('0x24')]=_0x228001;_0x6b3051[_0x515a('0x25')]=_0x6b3051[_0x515a('0x26')];Promise[_0x515a('0x27')]()[_0x515a('0x1f')](function(){if(typeof _0x6b3051[_0x515a('0x28')]===_0x515a('0x29'))return null;var _0x52bae5=_0x515a('0x2a')+_0x6b3051[_0x515a('0x28')];return db['sequelize'][_0x515a('0x2b')](_0x52bae5,{'type':db[_0x515a('0x2c')]['QueryTypes'][_0x515a('0x2d')],'raw':!![]});})['then'](function(_0x4a8953){if(_0x4a8953){_0x6b3051['contact']=_0x4a8953[0x0];}if(typeof _0x6b3051['UserId']===_0x515a('0x29'))return;return getAgent(_0x6b3051[_0x515a('0x2e')]);})[_0x515a('0x1f')](function(_0x4374dd){if(_0x4374dd){_0x6b3051['interface']=util[_0x515a('0x2f')](_0x515a('0x30'),_0x4374dd[_0x515a('0x31')]);_0x6b3051['agent']=_0x4374dd;_0x6b3051['channel']=_0x228001;return request({'event':_0x515a('0x32'),'message':_0x6b3051});}else{return request({'event':'outgoingmessage','message':_0x6b3051});}})[_0x515a('0x33')](function(_0x302a26){logger['error'](_0x515a('0x20'),_0x515a('0x34'),_0x302a26);});};}function afterCreateOfflineMessage(_0x2a36a5){return function(_0x1c5105){_0x1c5105=_0x1c5105['get']({'plain':!![]});_0x1c5105[_0x515a('0x23')]=_0x2a36a5;_0x1c5105[_0x515a('0x24')]=_0x2a36a5;_0x1c5105['event']=_0x515a('0x35');return request({'event':_0x1c5105[_0x515a('0x25')],'message':_0x1c5105});};}function afterCreate(_0x2a7e38,_0x460ff2){return function(_0x6dbf0){_0x6dbf0=_0x6dbf0[_0x515a('0x36')]({'plain':!![]});_0x6dbf0[_0x515a('0x23')]=_0x2a7e38;_0x6dbf0[_0x515a('0x24')]=_0x2a7e38;_0x6dbf0['event']=_0x515a('0x37');Promise[_0x515a('0x27')]()[_0x515a('0x1f')](function(){var _0x4f20f8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x6dbf0['ContactId'];return db[_0x515a('0x38')][_0x515a('0x2b')](_0x4f20f8,{'type':db[_0x515a('0x2c')][_0x515a('0x39')][_0x515a('0x2d')],'raw':!![]});})[_0x515a('0x1f')](function(_0x1818e4){if(_0x1818e4){_0x6dbf0[_0x515a('0x3a')]=_0x1818e4[0x0];}if(typeof _0x6dbf0[_0x515a('0x2e')]==='undefined')return;return getAgent(_0x6dbf0[_0x515a('0x2e')]);})['then'](function(_0x2f8dcb){if(_0x2f8dcb){_0x6dbf0[_0x515a('0x3b')]=util[_0x515a('0x2f')](_0x515a('0x30'),_0x2f8dcb[_0x515a('0x31')]);_0x6dbf0[_0x515a('0x3c')]=_0x2f8dcb;}return request({'event':_0x460ff2,'message':_0x6dbf0});})['catch'](function(_0x2d0b88){logger[_0x515a('0x21')](_0x515a('0x20'),'AfterCreate',_0x2d0b88);});};}function afterUpdate(_0x3fb9ce){return function(_0x151c5d){var _0x25229e=_0x151c5d[_0x515a('0x3d')](_0x515a('0x3e'))&&_0x151c5d[_0x515a('0x3e')];var _0x40a6aa=_0x151c5d[_0x515a('0x3d')](_0x515a('0x3f'));if(_0x25229e||_0x40a6aa){var _0x1a42aa=_0x25229e?_0x515a('0xa'):'substatus';var _0x9153bc=_0x151c5d[_0x515a('0x36')]({'plain':!![]});_0x9153bc[_0x515a('0x23')]=_0x3fb9ce;_0x9153bc[_0x515a('0x24')]=_0x3fb9ce;_0x9153bc[_0x515a('0x25')]=_0x25229e?_0x515a('0x3e'):_0x515a('0x3f');var _0x33078e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x9153bc[_0x515a('0x28')];return db['sequelize'][_0x515a('0x2b')](_0x33078e,{'type':db['Sequelize'][_0x515a('0x39')]['SELECT'],'raw':!![]})['then'](function(_0x24cbd3){if(_0x24cbd3){_0x9153bc[_0x515a('0x3a')]=_0x24cbd3[0x0];}if(typeof _0x9153bc[_0x515a('0x2e')]===_0x515a('0x29'))return;return getAgent(_0x9153bc[_0x515a('0x2e')]);})[_0x515a('0x1f')](function(_0x597b9e){if(_0x597b9e){_0x9153bc[_0x515a('0x3b')]=util[_0x515a('0x2f')]('SIP/%s',_0x597b9e['name']);_0x9153bc[_0x515a('0x3c')]=_0x597b9e;}return request({'event':_0x1a42aa,'message':_0x9153bc});})[_0x515a('0x33')](function(_0x267179){logger['error'](_0x515a('0x20'),_0x515a('0x40'),_0x267179);});}};}function getAgent(_0x5a74b2){return db[_0x515a('0x41')][_0x515a('0x42')]({'where':{'id':_0x5a74b2},'attributes':['id','name',_0x515a('0x43'),_0x515a('0x44'),_0x515a('0x45')],'raw':!![]})[_0x515a('0x1f')](function(_0x1c0acd){return _0x1c0acd;});}exports[_0x515a('0x46')]=function(){for(var _0x335848=0x0;_0x335848=_0x32f370['agents']){throw Error(_0x8583('0x16'));}_0x3fb637(_0x497eb9);})[_0x8583('0x17')](function(_0x48212b){_0x5475cf(_0x48212b);});});}; \ No newline at end of file +var _0xbd9a=['voice','mail','chat','sms','whatsapp','openchannel','isValidChannel','includes','clearBlockUser','isUndefined','updateAttributes','getLicense','role','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb'];(function(_0x380f8a,_0x1e8d3e){var _0x3bd1bf=function(_0x344f2e){while(--_0x344f2e){_0x380f8a['push'](_0x380f8a['shift']());}};_0x3bd1bf(++_0x1e8d3e);}(_0xbd9a,0x178));var _0xabd9=function(_0x4dd72b,_0x31204f){_0x4dd72b=_0x4dd72b-0x0;var _0x3e0953=_0xbd9a[_0x4dd72b];return _0x3e0953;};'use strict';var _=require(_0xabd9('0x0'));var BPromise=require('bluebird');var db=require(_0xabd9('0x1'))['db'];var util=require('./license/util');var channels=[_0xabd9('0x2'),_0xabd9('0x3'),_0xabd9('0x4'),'fax',_0xabd9('0x5'),_0xabd9('0x6'),_0xabd9('0x7')];exports['getChannels']=function(){return channels;};exports[_0xabd9('0x8')]=function(_0x4ee066){_0x4ee066=_0x4ee066['toLowerCase']();return _[_0xabd9('0x9')](channels,_0x4ee066);};exports[_0xabd9('0xa')]=function(_0x45c76f,_0x45824e,_0x41a1a2,_0x539aae){var _0x24e051={'loginAttempts':_0x45824e,'blocked':_0x41a1a2};if(!_[_0xabd9('0xb')](_0x539aae)){_0x24e051['blockedAt']=_0x539aae;}return _0x45c76f[_0xabd9('0xc')](_0x24e051);};exports[_0xabd9('0xd')]=function(_0x46aad6){return new BPromise(function(_0x541da1,_0x39b86c){var _0x8c3e68=0x0;if(_0x46aad6[_0xabd9('0xe')]!==_0xabd9('0xf')){_0x541da1(_0x46aad6);}db[_0xabd9('0x10')]['count']({'where':{'role':_0xabd9('0xf'),'online':!![],'id':{'$ne':_0x46aad6['id']}}})['then'](function(_0x5e0ffc){_0x8c3e68=_0x5e0ffc;return util[_0xabd9('0xd')]();})[_0xabd9('0x11')](function(_0x4f79ed){if(_0x4f79ed&&_0x4f79ed[_0xabd9('0x12')]&&_0x8c3e68>=_0x4f79ed[_0xabd9('0x12')]){throw Error(_0xabd9('0x13'));}_0x541da1(_0x46aad6);})[_0xabd9('0x14')](function(_0x246da6){_0x39b86c(_0x246da6);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 1950307..c6c96bd 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda3f=['inherits','message','Bad\x20Request','Entity\x20not\x20found','name','Not\x20Found','Forbidden','OutOfInterval','error','stack','send','exports','../config/logger','api','Internal\x20Server\x20Error','Error'];(function(_0x191c3e,_0x424520){var _0x2d9440=function(_0xb7f464){while(--_0xb7f464){_0x191c3e['push'](_0x191c3e['shift']());}};_0x2d9440(++_0x424520);}(_0xda3f,0xec));var _0xfda3=function(_0x5d08b4,_0x2352f8){_0x5d08b4=_0x5d08b4-0x0;var _0x34d7c3=_0xda3f[_0x5d08b4];return _0x34d7c3;};'use strict';var util=require('util');var logger=require(_0xfda3('0x0'))(_0xfda3('0x1'));var APIError=function(_0x534697,_0x5299b0){this['message']=_0x534697||_0xfda3('0x2');this['name']=_0x5299b0||_0xfda3('0x3');util[_0xfda3('0x4')](APIError,Error);};var APIBadRequestError=function(_0x516500){this[_0xfda3('0x5')]=_0x516500||_0xfda3('0x6');this['name']='Bad\x20Request';util[_0xfda3('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x42476a){this[_0xfda3('0x5')]=_0x42476a||_0xfda3('0x7');this[_0xfda3('0x8')]=_0xfda3('0x9');util[_0xfda3('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x1b1ea6){switch(_0x1b1ea6){case _0xfda3('0x6'):return 0x190;case _0xfda3('0xa'),_0xfda3('0xb'):return 0x193;case _0xfda3('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x4d7841){return function(_0xe933f5){logger[_0xfda3('0xc')](_0xe933f5[_0xfda3('0xd')]);var _0x11afc1=getStatusCode(_0xe933f5[_0xfda3('0x8')]);if(_0xe933f5['name'])delete _0xe933f5[_0xfda3('0x8')];return _0x4d7841['status'](_0x11afc1)[_0xfda3('0xe')](_0xe933f5);};}module[_0xfda3('0xf')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x70e0=['OutOfInterval','error','stack','status','util','../config/logger','api','message','Internal\x20Server\x20Error','name','Error','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','inherits'];(function(_0x3537e1,_0xbc7714){var _0x164a50=function(_0x57c2d1){while(--_0x57c2d1){_0x3537e1['push'](_0x3537e1['shift']());}};_0x164a50(++_0xbc7714);}(_0x70e0,0x17b));var _0x070e=function(_0x506a94,_0x4ecc5a){_0x506a94=_0x506a94-0x0;var _0x1d1057=_0x70e0[_0x506a94];return _0x1d1057;};'use strict';var util=require(_0x070e('0x0'));var logger=require(_0x070e('0x1'))(_0x070e('0x2'));var APIError=function(_0x4d95bb,_0x579b83){this[_0x070e('0x3')]=_0x4d95bb||_0x070e('0x4');this[_0x070e('0x5')]=_0x579b83||_0x070e('0x6');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x7bce9b){this['message']=_0x7bce9b||_0x070e('0x7');this['name']='Bad\x20Request';util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x35ab0c){this[_0x070e('0x3')]=_0x35ab0c||_0x070e('0x8');this[_0x070e('0x5')]=_0x070e('0x9');util[_0x070e('0xa')](APINotFoundError,APIError);};function getStatusCode(_0x11ffa8){switch(_0x11ffa8){case'Bad\x20Request':return 0x190;case'Forbidden',_0x070e('0xb'):return 0x193;case _0x070e('0x9'):return 0x194;default:return 0x1f4;}}function handleError(_0x12bb37){return function(_0xb8d819){logger[_0x070e('0xc')](_0xb8d819[_0x070e('0xd')]);var _0x25cfe1=getStatusCode(_0xb8d819[_0x070e('0x5')]);if(_0xb8d819[_0x070e('0x5')])delete _0xb8d819[_0x070e('0x5')];return _0x12bb37[_0x070e('0xe')](_0x25cfe1)['send'](_0xb8d819);};}module['exports']={'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 9e28d9a..a314987 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x05b1=['status','render'];(function(_0x4ccc6c,_0x528ee6){var _0x2c7616=function(_0x40b9d0){while(--_0x40b9d0){_0x4ccc6c['push'](_0x4ccc6c['shift']());}};_0x2c7616(++_0x528ee6);}(_0x05b1,0x188));var _0x105b=function(_0x27907d,_0x2e7ba8){_0x27907d=_0x27907d-0x0;var _0x24d02b=_0x05b1[_0x27907d];return _0x24d02b;};'use strict';module['exports'][0x194]=function pageNotFound(_0x4f8a8e,_0x1dac9f){var _0x19fd9f='404';var _0x12fe15=0x194;var _0x521512={'status':_0x12fe15};_0x1dac9f[_0x105b('0x0')](_0x521512[_0x105b('0x0')]);_0x1dac9f[_0x105b('0x1')](_0x19fd9f,{},function(_0x287629,_0xfca01a){if(_0x287629){return _0x1dac9f[_0x105b('0x0')](_0x521512[_0x105b('0x0')])['json'](_0x521512);}_0x1dac9f['send'](_0xfca01a);});}; \ No newline at end of file +var _0x8435=['send','status','render'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x8435,0x1d5));var _0x5843=function(_0x29879b,_0x179ade){_0x29879b=_0x29879b-0x0;var _0x342817=_0x8435[_0x29879b];return _0x342817;};'use strict';module['exports'][0x194]=function pageNotFound(_0x28dbc5,_0x510ad4){var _0x4141d3='404';var _0x2b4db7=0x194;var _0x24ac2f={'status':_0x2b4db7};_0x510ad4[_0x5843('0x0')](_0x24ac2f[_0x5843('0x0')]);_0x510ad4[_0x5843('0x1')](_0x4141d3,{},function(_0x35cce0,_0xac9983){if(_0x35cce0){return _0x510ad4[_0x5843('0x0')](_0x24ac2f[_0x5843('0x0')])['json'](_0x24ac2f);}_0x510ad4[_0x5843('0x2')](_0xac9983);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index ec7e1b8..655fa4c 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8935=['Imap','Smtp','Answers','Messages','Interactions','MailApplication','List','ListId','TemplateId','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','ContactId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','TagId','Dashboard','Items','Dispositions','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','ChatMessage','Agent','ChatApplication','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CmCompany','CompanyId','CmContactId','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','Campaign','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','MailApplications','FaxApplications','AnalyticCustomReport','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','DefaultReportId','MetricId','Configurations','AccountId','SalesforceField','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Field','VariableId','SugarcrmConfiguration','Subjects','int_desk_configuration_has_tags','ZendeskField','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowAccount','FreshsalesConfiguration','FreshsalesField','FromId','ToId','ProjectId','TeamVoiceQueue','VoiceQueues','SmsQueues','team_has_whatsapp_queues','SquareProject','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','FromAccount','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSection','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','user_has_whatsapp_interactions','WhatsappTransferReport','ToQueueId','exports','../config/environment','sequelize','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailQueueReport','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','CmContactHasItem','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','hasOne','cascade','UserId','userSetting','hasMany','Recordings','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','userProfileId','Groups','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','VoiceQueue','UserVoiceQueue','VoicePrefixes','MailQueues','ChatQueues','UserChatQueue','OpenchannelQueues','WhatsappQueue','WhatsappQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccount','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','Applications','Sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','HopperBlacks','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','AgentReports','Contact','MailServerIn','MailAccountId','CloudProviderId','restrict'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0x8935,0x9d));var _0x5893=function(_0x70841e,_0x1e002d){_0x70841e=_0x70841e-0x0;var _0x4f15a8=_0x8935[_0x70841e];return _0x4f15a8;};'use strict';var config=require(_0x5893('0x0'));var Sequelize=require(_0x5893('0x1'));var _=require('lodash');var jstz=require(_0x5893('0x2'));var timezone=jstz[_0x5893('0x3')]();config[_0x5893('0x1')]=_[_0x5893('0x4')](config[_0x5893('0x1')],{'database':_0x5893('0x5'),'username':_0x5893('0x6'),'password':_0x5893('0x7'),'options':{'host':_0x5893('0x8'),'port':0xcea,'dialect':_0x5893('0x9'),'dialectOptions':{'charset':_0x5893('0xa')},'logging':![],'timezone':timezone[_0x5893('0xb')](),'define':{'charset':_0x5893('0xc'),'collate':_0x5893('0xd')}}});config['sequelizeHistory']=_[_0x5893('0x4')](config[_0x5893('0xe')],{'database':_0x5893('0x5'),'username':'xcall','password':_0x5893('0x7'),'options':{'host':_0x5893('0x8'),'port':0xcea,'dialect':_0x5893('0x9'),'dialectOptions':{'charset':_0x5893('0xa')},'logging':![],'timezone':timezone[_0x5893('0xb')](),'define':{'charset':_0x5893('0xc'),'collate':_0x5893('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x5893('0xf')],config[_0x5893('0x1')][_0x5893('0x10')],config[_0x5893('0x1')][_0x5893('0x11')],config[_0x5893('0x1')][_0x5893('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x5893('0xe')][_0x5893('0xf')],config['sequelizeHistory']['username'],config['sequelizeHistory'][_0x5893('0x11')],config[_0x5893('0xe')][_0x5893('0x12')])};db['User']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x14'));db['VoiceChanSpy']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x15'));db[_0x5893('0x16')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x17'));db[_0x5893('0x18')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x19'));db[_0x5893('0x1a')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x1b'));db['VoiceQueue']=db[_0x5893('0x1')][_0x5893('0x13')]('../api/voiceQueue/voiceQueue.model');db[_0x5893('0x1c')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x1d'));db[_0x5893('0x1e')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x1f'));db[_0x5893('0x20')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x21'));db[_0x5893('0x22')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0x5893('0x1')][_0x5893('0x13')]('../api/voiceCallReport/voiceCallReport.model');db[_0x5893('0x23')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x24'));db[_0x5893('0x25')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x5893('0x26')]=db[_0x5893('0x1')]['import'](_0x5893('0x27'));db['MemberReport']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x28'));db['Trunk']=db[_0x5893('0x1')]['import'](_0x5893('0x29'));db['VoiceTransferReport']=db[_0x5893('0x1')]['import'](_0x5893('0x2a'));db[_0x5893('0x2b')]=db[_0x5893('0x1')]['import'](_0x5893('0x2c'));db['UserVoiceQueue']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x2d'));db['UserChatQueue']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x2e'));db[_0x5893('0x2f')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x30'));db[_0x5893('0x31')]=db['sequelize']['import']('../api/userFaxQueue/userFaxQueue.model');db[_0x5893('0x32')]=db['sequelize'][_0x5893('0x13')](_0x5893('0x33'));db[_0x5893('0x34')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x35'));db[_0x5893('0x36')]=db['sequelize'][_0x5893('0x13')](_0x5893('0x37'));db['MailServerIn']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x38'));db[_0x5893('0x39')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x3a'));db[_0x5893('0x3b')]=db['sequelize']['import'](_0x5893('0x3c'));db[_0x5893('0x3d')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/mailQueue/mailQueue.model');db[_0x5893('0x3e')]=db['sequelize']['import'](_0x5893('0x3f'));db[_0x5893('0x40')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x41'));db[_0x5893('0x42')]=db[_0x5893('0x1')]['import'](_0x5893('0x43'));db['MailApplication']=db[_0x5893('0x1')]['import']('../api/mailApplication/mailApplication.model');db[_0x5893('0x44')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db[_0x5893('0x1')][_0x5893('0x13')]('../api/dashboard/dashboard.model');db[_0x5893('0x45')]=db['sequelize'][_0x5893('0x13')](_0x5893('0x46'));db[_0x5893('0x47')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x48'));db[_0x5893('0x49')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x4a'));db[_0x5893('0x4b')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x5893('0x4c')]=db[_0x5893('0x1')]['import'](_0x5893('0x4d'));db[_0x5893('0x4e')]=db['sequelize']['import'](_0x5893('0x4f'));db[_0x5893('0x50')]=db['sequelize'][_0x5893('0x13')](_0x5893('0x51'));db['SmsAccount']=db['sequelize'][_0x5893('0x13')](_0x5893('0x52'));db[_0x5893('0x53')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x54'));db[_0x5893('0x55')]=db[_0x5893('0x1')]['import'](_0x5893('0x56'));db[_0x5893('0x57')]=db[_0x5893('0x1')]['import'](_0x5893('0x58'));db[_0x5893('0x59')]=db[_0x5893('0x1')]['import'](_0x5893('0x5a'));db['OpenchannelAccount']=db[_0x5893('0x1')]['import'](_0x5893('0x5b'));db[_0x5893('0x5c')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x5d'));db[_0x5893('0x5e')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x5f'));db[_0x5893('0x60')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x61'));db['ChatWebsite']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x62'));db[_0x5893('0x63')]=db['sequelize'][_0x5893('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x64'));db['ChatInteraction']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x65'));db['ChatMessage']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x66'));db['ChatOfflineMessage']=db['sequelize']['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x5893('0x67')]=db[_0x5893('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x5893('0x68')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x69'));db[_0x5893('0x6a')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x6b'));db['CmCompany']=db[_0x5893('0x1')][_0x5893('0x13')]('../api/cmCompany/cmCompany.model');db[_0x5893('0x6c')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x6d'));db['CmHopper']=db[_0x5893('0x1')][_0x5893('0x13')]('../api/cmHopper/cmHopper.model');db[_0x5893('0x6e')]=db['sequelize'][_0x5893('0x13')](_0x5893('0x6f'));db['CmHopperFinal']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x70'));db[_0x5893('0x71')]=db[_0x5893('0x1')]['import'](_0x5893('0x72'));db[_0x5893('0x73')]=db['sequelize']['import'](_0x5893('0x74'));db[_0x5893('0x75')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x76'));db[_0x5893('0x77')]=db['sequelize'][_0x5893('0x13')](_0x5893('0x78'));db['Automation']=db[_0x5893('0x1')]['import'](_0x5893('0x79'));db[_0x5893('0x7a')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x7b'));db[_0x5893('0x7c')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x7d'));db[_0x5893('0x7e')]=db['sequelize'][_0x5893('0x13')](_0x5893('0x7f'));db[_0x5893('0x80')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/interval/interval.model');db[_0x5893('0x81')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x82'));db[_0x5893('0x83')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x84'));db[_0x5893('0x85')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x86'));db[_0x5893('0x87')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x88'));db[_0x5893('0x89')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x8a'));db[_0x5893('0x8b')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x8c'));db[_0x5893('0x8d')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/contactItemType/contactItemType.model');db[_0x5893('0x8e')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0x5893('0x8f')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x90'));db[_0x5893('0x91')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x92'));db[_0x5893('0x93')]=db['sequelize'][_0x5893('0x13')]('../api/trigger/trigger.model');db[_0x5893('0x94')]=db[_0x5893('0x1')]['import'](_0x5893('0x95'));db[_0x5893('0x96')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x97'));db[_0x5893('0x98')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x99'));db['AnalyticCustomReport']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x9a'));db[_0x5893('0x9b')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x5893('0x9c')]=db['sequelize']['import'](_0x5893('0x9d'));db[_0x5893('0x9e')]=db['sequelize'][_0x5893('0x13')](_0x5893('0x9f'));db[_0x5893('0xa0')]=db[_0x5893('0x1')]['import'](_0x5893('0xa1'));db[_0x5893('0xa2')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xa3'));db[_0x5893('0xa4')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xa5'));db[_0x5893('0xa6')]=db['sequelize'][_0x5893('0x13')](_0x5893('0xa7'));db['SalesforceField']=db['sequelize'][_0x5893('0x13')]('../api/intSalesforceField/intSalesforceField.model');db[_0x5893('0xa8')]=db['sequelize']['import'](_0x5893('0xa9'));db['SugarcrmConfiguration']=db['sequelize']['import'](_0x5893('0xaa'));db[_0x5893('0xab')]=db[_0x5893('0x1')]['import'](_0x5893('0xac'));db[_0x5893('0xad')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/intDeskAccount/intDeskAccount.model');db[_0x5893('0xae')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xaf'));db[_0x5893('0xb0')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xb1'));db[_0x5893('0xb2')]=db[_0x5893('0x1')]['import']('../api/intZohoAccount/intZohoAccount.model');db[_0x5893('0xb3')]=db[_0x5893('0x1')]['import'](_0x5893('0xb4'));db[_0x5893('0xb5')]=db[_0x5893('0x1')]['import'](_0x5893('0xb6'));db[_0x5893('0xb7')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xb8'));db[_0x5893('0xb9')]=db['sequelize'][_0x5893('0x13')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xba'));db[_0x5893('0xbb')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x5893('0xbc')]=db['sequelize']['import'](_0x5893('0xbd'));db['FreshdeskField']=db['sequelize'][_0x5893('0x13')](_0x5893('0xbe'));db[_0x5893('0xbf')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xc0'));db[_0x5893('0xc1')]=db[_0x5893('0x1')]['import'](_0x5893('0xc2'));db[_0x5893('0xc3')]=db['sequelize'][_0x5893('0x13')]('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xc4'));db[_0x5893('0xc5')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xc6'));db[_0x5893('0xc7')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/intServicenowField/intServicenowField.model');db[_0x5893('0xc8')]=db['sequelize']['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0x5893('0xc9')]=db[_0x5893('0x1')]['import'](_0x5893('0xca'));db[_0x5893('0xcb')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xcc'));db[_0x5893('0xcd')]=db['sequelize']['import'](_0x5893('0xce'));db['FreshsalesConfiguration']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xcf'));db['FreshsalesField']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xd0'));db[_0x5893('0x96')]=db['sequelize'][_0x5893('0x13')](_0x5893('0x97'));db[_0x5893('0xd1')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xd2'));db[_0x5893('0xd3')]=db[_0x5893('0x1')]['import'](_0x5893('0xd4'));db[_0x5893('0xd5')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xd6'));db[_0x5893('0xd7')]=db['sequelize']['import'](_0x5893('0xd8'));db[_0x5893('0xd9')]=db['sequelize'][_0x5893('0x13')](_0x5893('0xda'));db[_0x5893('0xdb')]=db[_0x5893('0x1')]['import'](_0x5893('0xdc'));db[_0x5893('0xdd')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xde'));db[_0x5893('0xdf')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/squareReport/squareReport.model');db[_0x5893('0xe0')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xe1'));db[_0x5893('0xe2')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xe3'));db[_0x5893('0xe4')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xe5'));db[_0x5893('0xe6')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xe7'));db['SquareProject']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xe8'));db[_0x5893('0xe9')]=db[_0x5893('0x1')]['import'](_0x5893('0xea'));db[_0x5893('0xeb')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xec'));db[_0x5893('0xed')]=db['sequelize'][_0x5893('0x13')](_0x5893('0xee'));db[_0x5893('0xef')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/license/license.model');db['Campaign']=db[_0x5893('0x1')]['import'](_0x5893('0xf0'));db[_0x5893('0xf1')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xf2'));db['Attachment']=db[_0x5893('0x1')]['import'](_0x5893('0xf3'));db[_0x5893('0xf4')]=db['sequelize'][_0x5893('0x13')]('../api/plugin/plugin.model');db[_0x5893('0xf5')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xf6'));db[_0x5893('0xf7')]=db[_0x5893('0x1')]['import'](_0x5893('0xf8'));db[_0x5893('0xf9')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xfa'));db[_0x5893('0xfb')]=db[_0x5893('0x1')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x5893('0xfc')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0xfd'));db[_0x5893('0xfe')]=db['sequelize'][_0x5893('0x13')](_0x5893('0xff'));db[_0x5893('0x100')]=db['sequelize'][_0x5893('0x13')](_0x5893('0x101'));db[_0x5893('0x102')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x103'));db['UserProfileSection']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x104'));db[_0x5893('0x105')]=db[_0x5893('0x1')][_0x5893('0x13')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x106'));db['WhatsappAccount']=db['sequelize'][_0x5893('0x13')](_0x5893('0x107'));db[_0x5893('0x108')]=db[_0x5893('0x1')]['import'](_0x5893('0x109'));db[_0x5893('0x10a')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x10b'));db[_0x5893('0x10c')]=db[_0x5893('0x1')]['import'](_0x5893('0x10d'));db[_0x5893('0x10e')]=db['sequelize'][_0x5893('0x13')](_0x5893('0x10f'));db['WhatsappTransferReport']=db['sequelize'][_0x5893('0x13')](_0x5893('0x110'));db['WhatsappQueue']=db[_0x5893('0x1')]['import']('../api/whatsappQueue/whatsappQueue.model');db[_0x5893('0x111')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x112'));db['TeamVoiceQueue']=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x113'));db[_0x5893('0x114')]=db[_0x5893('0x1')]['import']('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x5893('0x115')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x116'));db[_0x5893('0x117')]=db[_0x5893('0x1')][_0x5893('0x13')](_0x5893('0x118'));db[_0x5893('0x119')][_0x5893('0x11a')](db[_0x5893('0x20')],{'as':_0x5893('0x20'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x11c')});db['User'][_0x5893('0x11a')](db[_0x5893('0x117')],{'as':_0x5893('0x11d'),'onDelete':'cascade','foreignKey':_0x5893('0x11c')});db[_0x5893('0x119')][_0x5893('0x11e')](db[_0x5893('0x1c')],{'as':_0x5893('0x11f'),'foreignKey':_0x5893('0x11c')});db[_0x5893('0x119')][_0x5893('0x11e')](db['UserVoiceQueueRt'],{'as':_0x5893('0x120'),'foreignKey':_0x5893('0x11c')});db['User'][_0x5893('0x11e')](db['VoiceExtension'],{'as':_0x5893('0x121'),'onDelete':_0x5893('0x11b'),'hooks':!![]});db[_0x5893('0x119')][_0x5893('0x11e')](db[_0x5893('0x122')],{'as':_0x5893('0x123'),'foreignKey':_0x5893('0x11c')});db[_0x5893('0x119')][_0x5893('0x11e')](db[_0x5893('0x71')],{'as':_0x5893('0x124'),'foreignKey':_0x5893('0x11c')});db[_0x5893('0x119')][_0x5893('0x11e')](db[_0x5893('0x73')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0x5893('0x119')]['hasMany'](db[_0x5893('0x5e')],{'as':_0x5893('0x125'),'foreignKey':'UserId'});db[_0x5893('0x119')][_0x5893('0x11e')](db[_0x5893('0x126')],{'as':_0x5893('0x127'),'foreignKey':_0x5893('0x11c')});db['User']['hasMany'](db[_0x5893('0x55')],{'as':_0x5893('0x128'),'foreignKey':_0x5893('0x11c')});db[_0x5893('0x119')][_0x5893('0x11e')](db[_0x5893('0x4b')],{'as':_0x5893('0x129'),'foreignKey':_0x5893('0x11c')});db[_0x5893('0x119')][_0x5893('0x11e')](db[_0x5893('0x40')],{'as':_0x5893('0x12a'),'foreignKey':'UserId'});db[_0x5893('0x119')][_0x5893('0x11e')](db['WhatsappInteraction'],{'as':_0x5893('0x12b'),'foreignKey':_0x5893('0x11c')});db[_0x5893('0x119')][_0x5893('0x11e')](db[_0x5893('0x12c')],{'as':_0x5893('0x12d'),'foreignKey':_0x5893('0x12e')});db[_0x5893('0x119')][_0x5893('0x12f')](db['UserProfile'],{'as':'UserProfile','foreignKey':_0x5893('0x130')});db[_0x5893('0x119')]['belongsToMany'](db[_0x5893('0x68')],{'as':_0x5893('0x131'),'through':'chat_group_has_users'});db[_0x5893('0x119')][_0x5893('0x132')](db[_0x5893('0x6c')],{'as':_0x5893('0x133'),'through':_0x5893('0x134')});db[_0x5893('0x119')][_0x5893('0x132')](db['CmList'],{'as':_0x5893('0x135'),'through':_0x5893('0x136')});db[_0x5893('0x119')][_0x5893('0x132')](db[_0x5893('0xed')],{'through':_0x5893('0x137')});db[_0x5893('0x119')][_0x5893('0x132')](db['MailInteraction'],{'as':'MailInteractions','through':_0x5893('0x138')});db['User'][_0x5893('0x132')](db[_0x5893('0x126')],{'as':'ChatInteractions','through':_0x5893('0x139')});db[_0x5893('0x119')][_0x5893('0x132')](db[_0x5893('0x4b')],{'as':_0x5893('0x129'),'through':'user_has_fax_interactions'});db['User'][_0x5893('0x132')](db[_0x5893('0x55')],{'as':_0x5893('0x128'),'through':_0x5893('0x13a')});db[_0x5893('0x119')][_0x5893('0x132')](db[_0x5893('0x5e')],{'as':_0x5893('0x125'),'through':'user_has_openchannel_interactions'});db['User'][_0x5893('0x132')](db[_0x5893('0x10a')],{'as':_0x5893('0x12b'),'through':'user_has_whatsapp_interactions'});db['User'][_0x5893('0x132')](db[_0x5893('0x13b')],{'as':'VoiceQueues','through':_0x5893('0x13c'),'required':![]});db[_0x5893('0x119')][_0x5893('0x132')](db[_0x5893('0x100')],{'as':_0x5893('0x13d'),'through':_0x5893('0x115'),'required':![]});db[_0x5893('0x119')][_0x5893('0x132')](db['MailQueue'],{'as':_0x5893('0x13e'),'through':'UserMailQueue','required':![]});db[_0x5893('0x119')][_0x5893('0x132')](db['ChatQueue'],{'as':_0x5893('0x13f'),'through':_0x5893('0x140'),'required':![],'hooks':!![]});db[_0x5893('0x119')][_0x5893('0x132')](db[_0x5893('0x4e')],{'as':'FaxQueues','through':_0x5893('0x31'),'required':![]});db[_0x5893('0x119')][_0x5893('0x132')](db[_0x5893('0x59')],{'as':'SmsQueues','through':_0x5893('0x32'),'required':![]});db['User']['belongsToMany'](db['OpenchannelQueue'],{'as':_0x5893('0x141'),'through':_0x5893('0x34'),'required':![]});db[_0x5893('0x119')][_0x5893('0x132')](db[_0x5893('0x142')],{'as':_0x5893('0x143'),'through':_0x5893('0x36'),'required':![]});db[_0x5893('0x119')]['belongsToMany'](db['CmList'],{'through':_0x5893('0x136')});db[_0x5893('0x119')][_0x5893('0x132')](db[_0x5893('0x144')],{'as':_0x5893('0x145'),'through':_0x5893('0x146')});db['User'][_0x5893('0x132')](db[_0x5893('0x47')],{'as':_0x5893('0x147'),'through':_0x5893('0x148')});db[_0x5893('0x119')][_0x5893('0x132')](db['MailAccount'],{'as':_0x5893('0x149'),'through':'user_has_mail_accounts'});db[_0x5893('0x119')][_0x5893('0x132')](db[_0x5893('0x14a')],{'as':'OpenchannelAccounts','through':_0x5893('0x14b')});db[_0x5893('0x119')][_0x5893('0x132')](db[_0x5893('0x14c')],{'as':_0x5893('0x14d'),'through':_0x5893('0x14e')});db[_0x5893('0x119')][_0x5893('0x132')](db[_0x5893('0x14f')],{'as':_0x5893('0x150'),'through':_0x5893('0x151')});db['VoiceChanSpy'][_0x5893('0x11e')](db[_0x5893('0x18')],{'as':_0x5893('0x152'),'onDelete':_0x5893('0x11b'),'foreignKey':'ChanSpyId'});db[_0x5893('0x16')][_0x5893('0x11e')](db['VoiceExtension'],{'onDelete':_0x5893('0x11b')});db[_0x5893('0x18')]['hasMany'](db[_0x5893('0x18')],{'as':_0x5893('0x153'),'onDelete':_0x5893('0x11b')});db[_0x5893('0x1a')][_0x5893('0x132')](db[_0x5893('0x89')],{'as':_0x5893('0x154'),'through':'moh_has_sounds'});db[_0x5893('0x13b')]['hasMany'](db[_0x5893('0x2b')],{'as':_0x5893('0x155'),'foreignKey':_0x5893('0x156')});db[_0x5893('0x13b')][_0x5893('0x11e')](db[_0x5893('0x157')],{'as':_0x5893('0x158'),'foreignKey':_0x5893('0x156')});db['VoiceQueue'][_0x5893('0x11e')](db[_0x5893('0x122')],{'as':'HopperFinals','foreignKey':_0x5893('0x156')});db[_0x5893('0x13b')]['hasMany'](db['CmHopperHistory'],{'as':_0x5893('0x159'),'foreignKey':'VoiceQueueId'});db[_0x5893('0x13b')][_0x5893('0x11e')](db[_0x5893('0x73')],{'as':_0x5893('0x73'),'foreignKey':_0x5893('0x156')});db[_0x5893('0x13b')][_0x5893('0x11e')](db[_0x5893('0x6e')],{'as':_0x5893('0x15a'),'foreignKey':_0x5893('0x156')});db['VoiceQueue']['hasMany'](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0x5893('0x13b')][_0x5893('0x12f')](db[_0x5893('0x15b')],{'as':_0x5893('0x15b'),'foreignKey':_0x5893('0x15c')});db[_0x5893('0x13b')][_0x5893('0x12f')](db['Trunk'],{'as':_0x5893('0x15d'),'foreignKey':_0x5893('0x15e')});db[_0x5893('0x13b')][_0x5893('0x12f')](db[_0x5893('0x80')],{'as':'Interval','foreignKey':_0x5893('0x15f')});db[_0x5893('0x13b')][_0x5893('0x12f')](db[_0x5893('0x81')],{'as':_0x5893('0x160'),'foreignKey':_0x5893('0x161')});db[_0x5893('0x13b')][_0x5893('0x132')](db['CmList'],{'as':_0x5893('0x135'),'through':'voice_queues_has_cm_lists'});db[_0x5893('0x13b')][_0x5893('0x132')](db[_0x5893('0x119')],{'as':_0x5893('0x162'),'through':'UserVoiceQueue'});db[_0x5893('0x13b')][_0x5893('0x132')](db['Team'],{'as':_0x5893('0x163'),'through':'TeamVoiceQueue'});db[_0x5893('0x13b')]['belongsToMany'](db[_0x5893('0xfe')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x5893('0x119'),'foreignKey':_0x5893('0x11c')});db[_0x5893('0x1e')][_0x5893('0x12f')](db[_0x5893('0x119')],{'as':_0x5893('0x119'),'foreignKey':'UserId'});db[_0x5893('0x20')]['hasMany'](db[_0x5893('0x22')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x5893('0x164'),'sourceKey':_0x5893('0x165')});db[_0x5893('0x22')][_0x5893('0x12f')](db[_0x5893('0x20')],{'foreignKey':_0x5893('0x164'),'targetKey':_0x5893('0x165')});db[_0x5893('0x166')][_0x5893('0x11e')](db[_0x5893('0x26')],{'as':_0x5893('0x167'),'foreignKey':_0x5893('0x168'),'constraints':![]});db['VoiceCallReport'][_0x5893('0x11e')](db[_0x5893('0x25')],{'as':_0x5893('0x169'),'foreignKey':_0x5893('0x168'),'constraints':![]});db[_0x5893('0x166')][_0x5893('0x12f')](db[_0x5893('0x119')],{'as':'User','foreignKey':_0x5893('0x11c')});db[_0x5893('0x166')][_0x5893('0x12f')](db[_0x5893('0x6c')],{'as':_0x5893('0x16a'),'foreignKey':'ContactId'});db[_0x5893('0x16b')]['belongsTo'](db[_0x5893('0x3b')],{'as':_0x5893('0x3b'),'foreignKey':_0x5893('0x16c')});db[_0x5893('0x16b')]['belongsTo'](db['CloudProvider'],{'as':_0x5893('0x111'),'foreignKey':_0x5893('0x16d'),'onDelete':'restrict'});db[_0x5893('0x39')]['belongsTo'](db['MailAccount'],{'as':_0x5893('0x3b'),'foreignKey':'MailAccountId'});db[_0x5893('0x39')]['belongsTo'](db[_0x5893('0x111')],{'as':_0x5893('0x111'),'foreignKey':_0x5893('0x16d'),'onDelete':_0x5893('0x16e')});db[_0x5893('0x3b')]['hasOne'](db['MailServerIn'],{'as':_0x5893('0x16f'),'onDelete':_0x5893('0x11b')});db['MailAccount'][_0x5893('0x11a')](db['MailServerOut'],{'as':_0x5893('0x170'),'onDelete':_0x5893('0x11b')});db[_0x5893('0x3b')][_0x5893('0x11e')](db[_0x5893('0x7c')],{'as':'Dispositions','foreignKey':_0x5893('0x16c'),'onDelete':'cascade'});db[_0x5893('0x3b')][_0x5893('0x11e')](db[_0x5893('0x7a')],{'as':_0x5893('0x171'),'foreignKey':_0x5893('0x16c')});db[_0x5893('0x3b')]['hasMany'](db[_0x5893('0x42')],{'as':_0x5893('0x172'),'foreignKey':_0x5893('0x16c')});db[_0x5893('0x3b')][_0x5893('0x11e')](db[_0x5893('0x40')],{'as':_0x5893('0x173')});db['MailAccount'][_0x5893('0x11e')](db[_0x5893('0x174')],{'as':_0x5893('0x153')});db[_0x5893('0x3b')][_0x5893('0x12f')](db[_0x5893('0xfe')],{'as':_0x5893('0x175'),'foreignKey':_0x5893('0x176')});db[_0x5893('0x3b')][_0x5893('0x12f')](db['Template'],{'as':_0x5893('0x91'),'foreignKey':_0x5893('0x177')});db[_0x5893('0x3b')][_0x5893('0x12f')](db[_0x5893('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x5893('0x161')});db['MailAccount'][_0x5893('0x132')](db[_0x5893('0x119')],{'as':_0x5893('0x162'),'through':_0x5893('0x178')});db['MailQueue'][_0x5893('0x132')](db[_0x5893('0x119')],{'as':_0x5893('0x162'),'through':_0x5893('0x2f')});db['MailQueue'][_0x5893('0x132')](db['Team'],{'through':_0x5893('0x179'),'as':_0x5893('0x163')});db[_0x5893('0x40')][_0x5893('0x11e')](db[_0x5893('0x42')],{'as':_0x5893('0x172'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x17a')});db['MailInteraction'][_0x5893('0x12f')](db['MailAccount'],{'as':_0x5893('0x17b'),'foreignKey':_0x5893('0x16c')});db[_0x5893('0x40')][_0x5893('0x12f')](db[_0x5893('0x6c')],{'as':_0x5893('0x16a'),'foreignKey':_0x5893('0x17c')});db[_0x5893('0x40')][_0x5893('0x12f')](db[_0x5893('0x119')],{'as':_0x5893('0x17d'),'foreignKey':_0x5893('0x11c')});db[_0x5893('0x40')][_0x5893('0x132')](db['Tag'],{'through':_0x5893('0x17e'),'as':_0x5893('0x17f')});db['MailInteraction'][_0x5893('0x132')](db['Tag'],{'through':_0x5893('0x17e'),'as':_0x5893('0x180')});db[_0x5893('0x40')]['belongsToMany'](db['User'],{'as':_0x5893('0x181'),'through':_0x5893('0x138'),'foreignKey':_0x5893('0x17a')});db['MailMessage'][_0x5893('0x11e')](db[_0x5893('0x182')],{'as':_0x5893('0x183'),'onDelete':_0x5893('0x11b')});db[_0x5893('0x42')][_0x5893('0x12f')](db[_0x5893('0x119')],{'as':_0x5893('0x119')});db[_0x5893('0x42')][_0x5893('0x12f')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x5893('0x42')]['belongsTo'](db[_0x5893('0x40')],{'as':_0x5893('0x184'),'foreignKey':_0x5893('0x17a')});db[_0x5893('0x42')]['belongsTo'](db[_0x5893('0x3b')],{'as':_0x5893('0x17b'),'foreignKey':_0x5893('0x16c')});db[_0x5893('0x42')][_0x5893('0x12f')](db['ChatWebsite'],{'as':_0x5893('0x144'),'foreignKey':_0x5893('0x185')});db['MailMessage']['belongsTo'](db[_0x5893('0x186')],{'as':_0x5893('0x186'),'foreignKey':_0x5893('0x187')});db['MailApplication']['belongsTo'](db[_0x5893('0x119')],{'onDelete':'restrict'});db[_0x5893('0x174')][_0x5893('0x12f')](db['MailQueue'],{'onDelete':_0x5893('0x16e')});db['MailApplication'][_0x5893('0x12f')](db[_0x5893('0x3b')],{'onDelete':'restrict'});db[_0x5893('0x174')][_0x5893('0x12f')](db[_0x5893('0x80')],{'onDelete':_0x5893('0x16e'),'foreignKey':_0x5893('0x15f')});db[_0x5893('0x174')][_0x5893('0x12f')](db['Tag'],{'onDelete':_0x5893('0x16e'),'foreignKey':_0x5893('0x188')});db[_0x5893('0x44')]['belongsTo'](db[_0x5893('0x3b')],{});db['MailQueueReport'][_0x5893('0x12f')](db['CmList'],{'as':_0x5893('0x175'),'foreignKey':_0x5893('0x176')});db[_0x5893('0x44')][_0x5893('0x12f')](db[_0x5893('0x6c')],{'as':_0x5893('0x16a'),'foreignKey':'ContactId'});db[_0x5893('0x44')][_0x5893('0x12f')](db[_0x5893('0x40')],{});db['MailQueueReport'][_0x5893('0x12f')](db[_0x5893('0x42')],{});db[_0x5893('0x44')][_0x5893('0x12f')](db[_0x5893('0x119')],{});db[_0x5893('0x44')]['belongsTo'](db[_0x5893('0x3d')],{});db[_0x5893('0x189')][_0x5893('0x11e')](db[_0x5893('0x45')],{'as':_0x5893('0x18a'),'onDelete':_0x5893('0x11b')});db[_0x5893('0x47')]['hasMany'](db[_0x5893('0x7c')],{'as':_0x5893('0x18b'),'foreignKey':_0x5893('0x18c'),'onDelete':_0x5893('0x11b')});db[_0x5893('0x47')][_0x5893('0x11e')](db[_0x5893('0x7a')],{'as':_0x5893('0x171'),'foreignKey':_0x5893('0x18c')});db[_0x5893('0x47')][_0x5893('0x11e')](db[_0x5893('0x4b')],{'as':'Interactions'});db['FaxAccount'][_0x5893('0x11e')](db[_0x5893('0x49')],{'as':_0x5893('0x153')});db[_0x5893('0x47')][_0x5893('0x11e')](db['VoiceExtension'],{'as':_0x5893('0x18d'),'onDelete':_0x5893('0x11b')});db[_0x5893('0x47')][_0x5893('0x11e')](db[_0x5893('0x4c')],{'as':'Messages'});db[_0x5893('0x47')][_0x5893('0x12f')](db['Trunk'],{'as':'Trunk'});db['FaxAccount'][_0x5893('0x12f')](db[_0x5893('0xfe')],{'as':_0x5893('0x175'),'foreignKey':_0x5893('0x176')});db['FaxAccount'][_0x5893('0x12f')](db[_0x5893('0x81')],{'as':_0x5893('0x160'),'foreignKey':_0x5893('0x161')});db['FaxAccount'][_0x5893('0x132')](db[_0x5893('0x119')],{'as':_0x5893('0x162'),'through':'user_has_fax_accounts'});db[_0x5893('0x49')]['belongsTo'](db[_0x5893('0x119')],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db[_0x5893('0x4e')],{'onDelete':'restrict'});db[_0x5893('0x49')][_0x5893('0x12f')](db['FaxAccount'],{'onDelete':_0x5893('0x16e')});db['FaxApplication']['belongsTo'](db[_0x5893('0x8b')],{'onDelete':_0x5893('0x16e'),'foreignKey':'TagId'});db[_0x5893('0x4b')]['hasMany'](db[_0x5893('0x4c')],{'as':_0x5893('0x172'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x18e')});db['FaxInteraction'][_0x5893('0x12f')](db[_0x5893('0x47')],{'as':_0x5893('0x17b'),'foreignKey':'FaxAccountId'});db[_0x5893('0x4b')][_0x5893('0x12f')](db[_0x5893('0x6c')],{'as':_0x5893('0x16a'),'foreignKey':_0x5893('0x17c')});db['FaxInteraction'][_0x5893('0x12f')](db[_0x5893('0x119')],{'as':_0x5893('0x17d'),'foreignKey':_0x5893('0x11c')});db[_0x5893('0x4b')][_0x5893('0x132')](db[_0x5893('0x8b')],{'through':_0x5893('0x18f'),'as':_0x5893('0x17f')});db[_0x5893('0x4b')][_0x5893('0x132')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x5893('0x180')});db[_0x5893('0x4b')][_0x5893('0x132')](db['User'],{'as':'Users','through':_0x5893('0x190'),'foreignKey':'FaxInteractionId'});db[_0x5893('0x4c')][_0x5893('0x12f')](db[_0x5893('0x119')],{'onDelete':_0x5893('0x11b'),'as':_0x5893('0x119')});db[_0x5893('0x4c')][_0x5893('0x12f')](db['FaxInteraction'],{'as':_0x5893('0x184'),'foreignKey':_0x5893('0x18e')});db['FaxMessage'][_0x5893('0x12f')](db[_0x5893('0x6c')],{'onDelete':'cascade','as':'Contact'});db['FaxMessage']['belongsTo'](db['Attachment'],{'as':_0x5893('0x182'),'foreignKey':_0x5893('0x191')});db['FaxMessage']['belongsTo'](db[_0x5893('0x47')],{'as':_0x5893('0x17b'),'foreignKey':_0x5893('0x18c')});db[_0x5893('0x4e')][_0x5893('0x132')](db[_0x5893('0x119')],{'as':_0x5893('0x162'),'through':'UserFaxQueue'});db['FaxQueue']['belongsToMany'](db[_0x5893('0xed')],{'through':_0x5893('0x192'),'as':_0x5893('0x163')});db[_0x5893('0x50')]['belongsTo'](db[_0x5893('0x47')],{});db[_0x5893('0x50')][_0x5893('0x12f')](db[_0x5893('0xfe')],{'as':_0x5893('0x175'),'foreignKey':_0x5893('0x176')});db[_0x5893('0x50')][_0x5893('0x12f')](db['CmContact'],{'as':'Contact','foreignKey':_0x5893('0x17c')});db[_0x5893('0x50')][_0x5893('0x12f')](db['FaxInteraction'],{});db['FaxQueueReport'][_0x5893('0x12f')](db[_0x5893('0x4c')],{});db['FaxQueueReport'][_0x5893('0x12f')](db[_0x5893('0x119')],{});db['FaxQueueReport'][_0x5893('0x12f')](db['FaxQueue'],{});db[_0x5893('0x14c')][_0x5893('0x11e')](db[_0x5893('0x7c')],{'as':_0x5893('0x18b'),'foreignKey':_0x5893('0x193'),'onDelete':'cascade'});db[_0x5893('0x14c')][_0x5893('0x11e')](db[_0x5893('0x7a')],{'as':'Answers','foreignKey':_0x5893('0x193')});db[_0x5893('0x14c')][_0x5893('0x11e')](db[_0x5893('0x57')],{'as':_0x5893('0x172'),'foreignKey':_0x5893('0x193')});db['SmsAccount'][_0x5893('0x11e')](db[_0x5893('0x55')],{'as':_0x5893('0x173')});db[_0x5893('0x14c')][_0x5893('0x11e')](db['SmsApplication'],{'as':_0x5893('0x153')});db[_0x5893('0x14c')]['belongsTo'](db[_0x5893('0xfe')],{'as':_0x5893('0x175'),'foreignKey':'ListId'});db['SmsAccount'][_0x5893('0x12f')](db[_0x5893('0x81')],{'as':_0x5893('0x160'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x5893('0x14c')][_0x5893('0x132')](db[_0x5893('0x119')],{'as':'Agents','through':_0x5893('0x14e')});db[_0x5893('0x53')]['belongsTo'](db[_0x5893('0x119')],{'onDelete':'restrict'});db[_0x5893('0x53')][_0x5893('0x12f')](db['SmsQueue'],{'onDelete':'restrict'});db[_0x5893('0x53')]['belongsTo'](db['SmsAccount'],{'onDelete':_0x5893('0x16e')});db[_0x5893('0x53')]['belongsTo'](db['Interval'],{'onDelete':_0x5893('0x16e'),'foreignKey':'IntervalId'});db['SmsApplication'][_0x5893('0x12f')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x5893('0x188')});db['SmsInteraction']['hasMany'](db['SmsMessage'],{'as':'Messages','onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x194')});db[_0x5893('0x55')]['belongsTo'](db['SmsAccount'],{'as':'Account','foreignKey':_0x5893('0x193')});db['SmsInteraction'][_0x5893('0x12f')](db[_0x5893('0x6c')],{'as':_0x5893('0x16a'),'foreignKey':_0x5893('0x17c')});db['SmsInteraction'][_0x5893('0x12f')](db[_0x5893('0x119')],{'as':_0x5893('0x17d'),'foreignKey':_0x5893('0x11c')});db[_0x5893('0x55')][_0x5893('0x132')](db[_0x5893('0x8b')],{'through':_0x5893('0x195'),'as':'Tags'});db[_0x5893('0x55')][_0x5893('0x132')](db[_0x5893('0x8b')],{'through':_0x5893('0x195'),'as':_0x5893('0x180')});db[_0x5893('0x55')][_0x5893('0x132')](db[_0x5893('0x119')],{'as':_0x5893('0x181'),'through':'user_has_sms_interactions','foreignKey':_0x5893('0x194')});db[_0x5893('0x57')][_0x5893('0x12f')](db['User'],{'as':'User'});db[_0x5893('0x57')]['belongsTo'](db[_0x5893('0x6c')],{'onDelete':_0x5893('0x11b'),'as':_0x5893('0x16a')});db[_0x5893('0x57')]['belongsTo'](db[_0x5893('0x55')],{'onDelete':_0x5893('0x11b'),'as':'Interaction','foreignKey':'SmsInteractionId'});db[_0x5893('0x57')][_0x5893('0x12f')](db[_0x5893('0x14c')],{'as':'Account','foreignKey':_0x5893('0x193')});db[_0x5893('0x59')][_0x5893('0x132')](db[_0x5893('0x119')],{'as':_0x5893('0x162'),'through':_0x5893('0x32'),'foreignKey':_0x5893('0x196')});db[_0x5893('0x59')][_0x5893('0x132')](db[_0x5893('0xed')],{'through':_0x5893('0x197'),'as':_0x5893('0x163')});db[_0x5893('0x14a')]['hasMany'](db['Disposition'],{'as':_0x5893('0x18b'),'foreignKey':_0x5893('0x198'),'onDelete':'cascade'});db[_0x5893('0x14a')][_0x5893('0x11e')](db[_0x5893('0x7a')],{'as':_0x5893('0x171'),'foreignKey':_0x5893('0x198')});db[_0x5893('0x14a')][_0x5893('0x11e')](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0x5893('0x14a')]['hasMany'](db['OpenchannelMessage'],{'as':_0x5893('0x172'),'foreignKey':_0x5893('0x198')});db[_0x5893('0x14a')][_0x5893('0x11e')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0x5893('0x198')});db[_0x5893('0x14a')][_0x5893('0x12f')](db[_0x5893('0xfe')],{'as':'List','foreignKey':_0x5893('0x176')});db[_0x5893('0x14a')][_0x5893('0x12f')](db[_0x5893('0x81')],{'as':_0x5893('0x160'),'foreignKey':_0x5893('0x161')});db['OpenchannelAccount'][_0x5893('0x132')](db[_0x5893('0x119')],{'as':_0x5893('0x162'),'through':_0x5893('0x14b')});db[_0x5893('0x5c')][_0x5893('0x12f')](db[_0x5893('0x119')],{'onDelete':_0x5893('0x16e')});db[_0x5893('0x5c')][_0x5893('0x12f')](db['OpenchannelQueue'],{'onDelete':_0x5893('0x16e'),'foreignKey':'OpenchannelQueueId'});db[_0x5893('0x5c')][_0x5893('0x12f')](db[_0x5893('0x14a')],{'onDelete':_0x5893('0x16e'),'foreignKey':_0x5893('0x198')});db[_0x5893('0x5c')]['belongsTo'](db[_0x5893('0x80')],{'onDelete':_0x5893('0x16e'),'foreignKey':_0x5893('0x15f')});db['OpenchannelApplication'][_0x5893('0x12f')](db[_0x5893('0x8b')],{'onDelete':_0x5893('0x16e'),'foreignKey':'TagId'});db['OpenchannelInteraction'][_0x5893('0x11e')](db[_0x5893('0x199')],{'as':_0x5893('0x172'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x19a')});db[_0x5893('0x5e')]['belongsTo'](db[_0x5893('0x14a')],{'as':'Account','foreignKey':_0x5893('0x198')});db[_0x5893('0x5e')][_0x5893('0x12f')](db[_0x5893('0x6c')],{'as':_0x5893('0x16a'),'foreignKey':_0x5893('0x17c')});db[_0x5893('0x5e')][_0x5893('0x12f')](db[_0x5893('0x119')],{'as':_0x5893('0x17d'),'foreignKey':_0x5893('0x11c')});db['OpenchannelInteraction'][_0x5893('0x132')](db[_0x5893('0x8b')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db['OpenchannelInteraction'][_0x5893('0x132')](db['Tag'],{'through':_0x5893('0x19b'),'as':_0x5893('0x180')});db['OpenchannelInteraction']['belongsToMany'](db[_0x5893('0x119')],{'as':'Users','through':_0x5893('0x19c'),'foreignKey':_0x5893('0x19a')});db[_0x5893('0x199')][_0x5893('0x12f')](db[_0x5893('0x119')],{'onDelete':_0x5893('0x11b'),'as':_0x5893('0x119')});db[_0x5893('0x199')][_0x5893('0x12f')](db[_0x5893('0x6c')],{'onDelete':_0x5893('0x11b'),'as':_0x5893('0x16a')});db[_0x5893('0x199')][_0x5893('0x12f')](db[_0x5893('0x5e')],{'onDelete':_0x5893('0x11b'),'as':_0x5893('0x184'),'foreignKey':_0x5893('0x19a')});db[_0x5893('0x199')][_0x5893('0x12f')](db[_0x5893('0x182')],{'as':_0x5893('0x182'),'foreignKey':_0x5893('0x191')});db[_0x5893('0x199')][_0x5893('0x12f')](db[_0x5893('0x14a')],{'as':_0x5893('0x17b'),'foreignKey':_0x5893('0x198')});db[_0x5893('0x60')][_0x5893('0x132')](db[_0x5893('0x119')],{'as':_0x5893('0x162'),'through':'UserOpenchannelQueue','foreignKey':_0x5893('0x19d')});db['OpenchannelQueue'][_0x5893('0x132')](db[_0x5893('0xed')],{'through':_0x5893('0x19e'),'as':_0x5893('0x163')});db[_0x5893('0x144')][_0x5893('0x11e')](db[_0x5893('0x7c')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0x5893('0x11b')});db[_0x5893('0x144')][_0x5893('0x11e')](db['CannedAnswer'],{'as':_0x5893('0x171'),'foreignKey':_0x5893('0x185')});db[_0x5893('0x144')][_0x5893('0x11e')](db[_0x5893('0x6a')],{'as':_0x5893('0x19f')});db[_0x5893('0x144')][_0x5893('0x11e')](db['ChatInteraction'],{'as':_0x5893('0x173')});db['ChatWebsite'][_0x5893('0x11e')](db['ChatApplication'],{'as':_0x5893('0x153')});db[_0x5893('0x144')][_0x5893('0x11e')](db[_0x5893('0x1a0')],{'as':_0x5893('0x172')});db['ChatWebsite'][_0x5893('0x12f')](db['CmList'],{'as':_0x5893('0x175'),'foreignKey':_0x5893('0x176')});db[_0x5893('0x144')]['belongsTo'](db['Interval'],{'as':_0x5893('0x80'),'foreignKey':_0x5893('0x15f')});db['ChatWebsite']['belongsTo'](db[_0x5893('0x3b')],{'as':_0x5893('0x3b'),'foreignKey':_0x5893('0x16c')});db[_0x5893('0x144')][_0x5893('0x12f')](db[_0x5893('0x81')],{'as':_0x5893('0x160'),'foreignKey':_0x5893('0x161')});db[_0x5893('0x144')][_0x5893('0x132')](db[_0x5893('0x119')],{'as':_0x5893('0x162'),'through':_0x5893('0x146')});db['OpenchannelQueueReport']['belongsTo'](db[_0x5893('0x14a')],{});db[_0x5893('0x63')][_0x5893('0x12f')](db['CmList'],{'as':_0x5893('0x175'),'foreignKey':_0x5893('0x176')});db[_0x5893('0x63')]['belongsTo'](db[_0x5893('0x6c')],{'as':_0x5893('0x16a'),'foreignKey':_0x5893('0x17c')});db[_0x5893('0x63')][_0x5893('0x12f')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0x5893('0x12f')](db[_0x5893('0x199')],{});db['OpenchannelQueueReport'][_0x5893('0x12f')](db[_0x5893('0x119')],{});db[_0x5893('0x63')][_0x5893('0x12f')](db[_0x5893('0x60')],{});db['ChatApplication']['belongsTo'](db[_0x5893('0x119')],{'as':_0x5893('0x1a1'),'foreignKey':_0x5893('0x11c'),'onDelete':_0x5893('0x16e')});db[_0x5893('0x1a2')][_0x5893('0x12f')](db['ChatQueue'],{'as':_0x5893('0x1a3'),'foreignKey':_0x5893('0x1a4'),'onDelete':'restrict'});db[_0x5893('0x1a2')]['belongsTo'](db['ChatWebsite'],{'as':_0x5893('0x1a5'),'foreignKey':_0x5893('0x185'),'onDelete':_0x5893('0x16e')});db[_0x5893('0x1a2')][_0x5893('0x12f')](db[_0x5893('0x8b')],{'onDelete':_0x5893('0x16e'),'foreignKey':_0x5893('0x188')});db[_0x5893('0x126')][_0x5893('0x11e')](db[_0x5893('0x1a0')],{'as':'Messages','onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1a6')});db[_0x5893('0x126')]['belongsTo'](db[_0x5893('0x144')],{'as':_0x5893('0x17b'),'foreignKey':_0x5893('0x185')});db['ChatInteraction']['belongsTo'](db['CmContact'],{'as':_0x5893('0x16a'),'foreignKey':_0x5893('0x17c')});db[_0x5893('0x126')][_0x5893('0x12f')](db[_0x5893('0x119')],{'as':_0x5893('0x17d'),'foreignKey':_0x5893('0x11c')});db['ChatInteraction'][_0x5893('0x132')](db['Tag'],{'through':_0x5893('0x1a7'),'as':_0x5893('0x17f')});db[_0x5893('0x126')][_0x5893('0x132')](db[_0x5893('0x8b')],{'through':_0x5893('0x1a7'),'as':'ThroughTags'});db['ChatInteraction'][_0x5893('0x132')](db[_0x5893('0x119')],{'as':_0x5893('0x181'),'through':_0x5893('0x139'),'foreignKey':'ChatInteractionId'});db[_0x5893('0x1a0')][_0x5893('0x12f')](db[_0x5893('0x119')],{'onDelete':_0x5893('0x11b'),'as':_0x5893('0x119')});db[_0x5893('0x1a0')][_0x5893('0x12f')](db[_0x5893('0x6c')],{'onDelete':'cascade','as':_0x5893('0x16a'),'foreignKey':_0x5893('0x17c')});db[_0x5893('0x1a0')][_0x5893('0x12f')](db[_0x5893('0x126')],{'onDelete':_0x5893('0x11b'),'as':_0x5893('0x184'),'foreignKey':_0x5893('0x1a6')});db[_0x5893('0x1a0')][_0x5893('0x12f')](db[_0x5893('0x182')],{'as':'Attachment','foreignKey':_0x5893('0x191')});db[_0x5893('0x1a0')][_0x5893('0x12f')](db[_0x5893('0x144')],{'as':'Account','foreignKey':_0x5893('0x185')});db[_0x5893('0x186')]['hasMany'](db['Attachment'],{'as':_0x5893('0x183'),'foreignKey':_0x5893('0x187'),'onDelete':_0x5893('0x11b'),'hooks':!![]});db['ChatOfflineMessage'][_0x5893('0x12f')](db[_0x5893('0x6c')],{'onDelete':_0x5893('0x11b'),'as':_0x5893('0x16a'),'foreignKey':'ContactId'});db[_0x5893('0x186')][_0x5893('0x12f')](db[_0x5893('0x144')],{'as':'Account','foreignKey':_0x5893('0x185')});db[_0x5893('0x67')]['belongsToMany'](db[_0x5893('0x119')],{'as':_0x5893('0x162'),'through':_0x5893('0x140'),'hooks':!![]});db['ChatQueue'][_0x5893('0x132')](db[_0x5893('0xed')],{'through':_0x5893('0x1a8'),'as':_0x5893('0x163')});db[_0x5893('0x68')][_0x5893('0x11e')](db[_0x5893('0xd5')],{'as':_0x5893('0x172'),'foreignKey':_0x5893('0x1a9'),'onDelete':_0x5893('0x11b')});db[_0x5893('0x68')]['belongsToMany'](db['User'],{'as':'Members','through':'chat_group_has_users'});db['ChatProactiveAction'][_0x5893('0x12f')](db[_0x5893('0x144')],{'as':_0x5893('0x1a5'),'foreignKey':_0x5893('0x185')});db[_0x5893('0x1aa')][_0x5893('0x11e')](db[_0x5893('0x6c')],{'as':_0x5893('0x133'),'foreignKey':_0x5893('0x1ab')});db[_0x5893('0x6c')]['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x5893('0x1ac')});db[_0x5893('0x6c')]['hasMany'](db[_0x5893('0x157')],{'as':_0x5893('0x158'),'foreignKey':_0x5893('0x17c')});db[_0x5893('0x6c')][_0x5893('0x11e')](db[_0x5893('0x122')],{'as':_0x5893('0x123'),'foreignKey':_0x5893('0x17c')});db['CmContact'][_0x5893('0x11e')](db[_0x5893('0x71')],{'as':'HopperHistories','foreignKey':'ContactId'});db[_0x5893('0x6c')][_0x5893('0x11e')](db['ReportAgentPreview'],{'as':_0x5893('0x73'),'foreignKey':_0x5893('0x17c')});db[_0x5893('0x6c')][_0x5893('0x11e')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':'ContactId'});db['CmContact'][_0x5893('0x11e')](db[_0x5893('0x5e')],{'as':'OpenchannelInteractions','foreignKey':_0x5893('0x17c'),'onDelete':_0x5893('0x16e')});db['CmContact'][_0x5893('0x11e')](db[_0x5893('0x126')],{'as':_0x5893('0x127'),'foreignKey':_0x5893('0x17c'),'onDelete':'restrict'});db[_0x5893('0x6c')][_0x5893('0x11e')](db[_0x5893('0x55')],{'as':'SmsInteractions','foreignKey':_0x5893('0x17c'),'onDelete':'restrict'});db[_0x5893('0x6c')]['hasMany'](db[_0x5893('0x4b')],{'as':'FaxInteractions','foreignKey':_0x5893('0x17c'),'onDelete':_0x5893('0x16e')});db[_0x5893('0x6c')][_0x5893('0x11e')](db[_0x5893('0x40')],{'as':'MailInteractions','foreignKey':_0x5893('0x17c'),'onDelete':_0x5893('0x16e')});db['CmContact'][_0x5893('0x12f')](db[_0x5893('0x1aa')],{'as':_0x5893('0x1ad'),'foreignKey':_0x5893('0x1ab')});db['CmContact'][_0x5893('0x12f')](db[_0x5893('0xfe')],{'as':'List','foreignKey':_0x5893('0x176'),'onDelete':_0x5893('0x11b')});db[_0x5893('0x6c')][_0x5893('0x132')](db['User'],{'as':_0x5893('0x181'),'through':'cm_user_has_contacts'});db[_0x5893('0x6c')]['belongsToMany'](db['Tag'],{'as':_0x5893('0x17f'),'through':_0x5893('0x1ae')});db[_0x5893('0x6c')]['belongsToMany'](db[_0x5893('0x8b')],{'through':'cm_contact_has_tags','as':_0x5893('0x180')});db[_0x5893('0x157')][_0x5893('0x11e')](db[_0x5893('0x8f')],{'as':_0x5893('0x1af'),'foreignKey':_0x5893('0x1b0')});db[_0x5893('0x157')][_0x5893('0x12f')](db['CmContact'],{'as':_0x5893('0x16a'),'foreignKey':_0x5893('0x17c'),'onDelete':_0x5893('0x11b')});db[_0x5893('0x157')][_0x5893('0x12f')](db[_0x5893('0xfe')],{'as':'List','foreignKey':_0x5893('0x176'),'onDelete':_0x5893('0x11b')});db[_0x5893('0x157')][_0x5893('0x12f')](db[_0x5893('0x119')],{'as':'Agent','foreignKey':_0x5893('0x11c')});db[_0x5893('0x157')][_0x5893('0x12f')](db[_0x5893('0x13b')],{'as':_0x5893('0x1a3'),'foreignKey':_0x5893('0x156'),'onDelete':_0x5893('0x11b')});db[_0x5893('0x157')][_0x5893('0x12f')](db['Campaign'],{'as':_0x5893('0x1b1'),'foreignKey':_0x5893('0x1b2'),'onDelete':_0x5893('0x11b')});db['CmHopper'][_0x5893('0x12f')](db['User'],{'as':_0x5893('0x17d'),'foreignKey':_0x5893('0x1b3')});db['CmHopperBlack'][_0x5893('0x12f')](db[_0x5893('0x6c')],{'as':_0x5893('0x16a'),'foreignKey':_0x5893('0x17c'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db[_0x5893('0xfe')],{'as':_0x5893('0x175'),'foreignKey':_0x5893('0x176'),'onDelete':'cascade'});db['CmHopperBlack'][_0x5893('0x12f')](db[_0x5893('0x13b')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db['CmHopperBlack'][_0x5893('0x12f')](db[_0x5893('0x1b1')],{'as':'Campaign','foreignKey':_0x5893('0x1b2'),'onDelete':'cascade'});db[_0x5893('0x1b4')]['hasMany'](db[_0x5893('0x7e')],{'as':{'plural':_0x5893('0x1b5'),'singular':_0x5893('0x1b6')},'foreignKey':_0x5893('0x1b7'),'onDelete':'cascade','hooks':!![]});db['Automation']['hasMany'](db[_0x5893('0x7e')],{'as':{'plural':_0x5893('0x1b8'),'singular':_0x5893('0x1b9')},'foreignKey':_0x5893('0x1ba'),'onDelete':_0x5893('0x11b'),'hooks':!![]});db['Automation'][_0x5893('0x11e')](db[_0x5893('0x77')],{'as':_0x5893('0x1bb'),'foreignKey':_0x5893('0x1bc'),'onDelete':_0x5893('0x11b'),'hooks':!![]});db[_0x5893('0x7c')][_0x5893('0x11e')](db[_0x5893('0x7c')],{'as':_0x5893('0x18b'),'foreignKey':'ParentId','onDelete':_0x5893('0x11b')});db[_0x5893('0x80')][_0x5893('0x11e')](db[_0x5893('0x80')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0x5893('0x11b'),'hooks':!![],'required':![]});db[_0x5893('0x80')][_0x5893('0x11e')](db[_0x5893('0x18')],{'as':_0x5893('0x121'),'foreignKey':_0x5893('0x15f'),'onDelete':_0x5893('0x16e')});db['Interval'][_0x5893('0x11e')](db[_0x5893('0x174')],{'as':_0x5893('0x1bd'),'foreignKey':_0x5893('0x15f')});db[_0x5893('0x80')][_0x5893('0x11e')](db[_0x5893('0x1a2')],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0x5893('0x80')][_0x5893('0x11e')](db[_0x5893('0x49')],{'as':_0x5893('0x1be'),'foreignKey':'IntervalId'});db[_0x5893('0x80')][_0x5893('0x11e')](db[_0x5893('0x53')],{'as':'SmsApplications','foreignKey':'IntervalId'});db[_0x5893('0x87')][_0x5893('0x12f')](db[_0x5893('0x3b')],{});db['Schedule']['belongsTo'](db[_0x5893('0x9b')],{'foreignKey':'DefaultReportId'});db['Schedule']['belongsTo'](db[_0x5893('0x1bf')],{'foreignKey':'CustomReportId'});db[_0x5893('0x89')][_0x5893('0x132')](db[_0x5893('0x1a')],{'as':_0x5893('0x1c0'),'through':_0x5893('0x1c1'),'onDelete':_0x5893('0x16e')});db[_0x5893('0x8b')][_0x5893('0x132')](db[_0x5893('0x6c')],{'through':_0x5893('0x1ae')});db[_0x5893('0x8b')][_0x5893('0x132')](db[_0x5893('0x126')],{'through':'chat_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x5893('0x40')],{'through':'mail_interaction_has_tags'});db[_0x5893('0x8b')][_0x5893('0x132')](db[_0x5893('0x55')],{'through':_0x5893('0x195')});db['Tag'][_0x5893('0x132')](db['FaxInteraction'],{'through':_0x5893('0x18f')});db[_0x5893('0x8b')][_0x5893('0x132')](db[_0x5893('0x5e')],{'through':_0x5893('0x19b')});db[_0x5893('0x8b')]['belongsToMany'](db['WhatsappInteraction'],{'through':_0x5893('0x1c2')});db['CmContactHasItem'][_0x5893('0x12f')](db[_0x5893('0x8d')],{'as':_0x5893('0x1c3'),'foreignKey':_0x5893('0x1c4')});db[_0x5893('0x8f')][_0x5893('0x12f')](db[_0x5893('0x157')],{'as':_0x5893('0x1c5'),'foreignKey':_0x5893('0x1b0')});db[_0x5893('0x8e')][_0x5893('0x12f')](db[_0x5893('0x6c')],{'as':'Contact','foreignKey':'CmContactId'});db[_0x5893('0x93')]['hasMany'](db[_0x5893('0x7e')],{'as':{'plural':'AllConditions','singular':_0x5893('0x1c6')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0x5893('0x93')]['hasMany'](db[_0x5893('0x7e')],{'as':{'plural':_0x5893('0x1c7'),'singular':_0x5893('0x1c8')},'foreignKey':_0x5893('0x1c9'),'onDelete':_0x5893('0x11b'),'hooks':!![]});db[_0x5893('0x93')][_0x5893('0x11e')](db[_0x5893('0x77')],{'as':_0x5893('0x1bb'),'foreignKey':_0x5893('0x1ca'),'onDelete':_0x5893('0x11b'),'hooks':!![]});db[_0x5893('0x1bf')][_0x5893('0x11e')](db[_0x5893('0xa0')],{'as':_0x5893('0x1cb'),'onDelete':_0x5893('0x11b'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x5893('0x9b')]['hasMany'](db[_0x5893('0xa0')],{'as':_0x5893('0x1cb'),'onDelete':'cascade','foreignKey':_0x5893('0x1cc')});db[_0x5893('0x9e')][_0x5893('0x11e')](db['AnalyticFieldReport'],{'as':_0x5893('0x1cb'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1cd')});db[_0x5893('0xa0')]['belongsTo'](db[_0x5893('0x9e')],{'foreignKey':'MetricId'});db[_0x5893('0xa4')][_0x5893('0x11e')](db[_0x5893('0xa6')],{'as':_0x5893('0x1ce'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1cf')});db[_0x5893('0xa6')][_0x5893('0x11e')](db[_0x5893('0x1d0')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0x5893('0x11e')](db[_0x5893('0x1d0')],{'as':_0x5893('0x1d1'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1d2')});db[_0x5893('0xa6')]['hasMany'](db['SalesforceField'],{'as':_0x5893('0x1cb'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1d3')});db[_0x5893('0xa6')][_0x5893('0x12f')](db[_0x5893('0xa4')],{'as':'Account','foreignKey':'AccountId'});db[_0x5893('0x1d0')][_0x5893('0x11e')](db[_0x5893('0x1d0')],{'as':_0x5893('0x1d4'),'foreignKey':_0x5893('0x1d5')});db[_0x5893('0x1d0')][_0x5893('0x11e')](db[_0x5893('0x1d0')],{'as':_0x5893('0x1d6'),'foreignKey':_0x5893('0x1d2')});db['SalesforceField']['hasMany'](db[_0x5893('0x1d0')],{'as':_0x5893('0x1d7'),'foreignKey':_0x5893('0x1d3')});db[_0x5893('0x1d0')][_0x5893('0x12f')](db[_0x5893('0x94')],{'as':_0x5893('0x94'),'foreignKey':_0x5893('0x1d8')});db[_0x5893('0xa8')][_0x5893('0x11e')](db['SugarcrmConfiguration'],{'as':_0x5893('0x1ce'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x5893('0x1d9')]['hasMany'](db['SugarcrmField'],{'as':_0x5893('0x1da'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1d5')});db[_0x5893('0x1d9')]['hasMany'](db[_0x5893('0xab')],{'as':_0x5893('0x1d1'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1d2')});db[_0x5893('0x1d9')][_0x5893('0x11e')](db[_0x5893('0xab')],{'as':_0x5893('0x1cb'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1d3')});db[_0x5893('0x1d9')][_0x5893('0x12f')](db[_0x5893('0xa8')],{'as':_0x5893('0x17b'),'foreignKey':'AccountId'});db[_0x5893('0xab')][_0x5893('0x11e')](db[_0x5893('0xab')],{'as':_0x5893('0x1d4'),'foreignKey':'SubjectId'});db['SugarcrmField']['hasMany'](db[_0x5893('0xab')],{'as':_0x5893('0x1d6'),'foreignKey':_0x5893('0x1d2')});db[_0x5893('0xab')][_0x5893('0x11e')](db['SugarcrmField'],{'as':_0x5893('0x1d7'),'foreignKey':_0x5893('0x1d3')});db['SugarcrmField']['belongsTo'](db[_0x5893('0x94')],{'as':_0x5893('0x94'),'foreignKey':_0x5893('0x1d8')});db[_0x5893('0xad')][_0x5893('0x11e')](db[_0x5893('0xae')],{'as':'Configurations','onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1cf')});db[_0x5893('0xae')][_0x5893('0x11e')](db[_0x5893('0xb0')],{'as':_0x5893('0x1da'),'onDelete':'cascade','foreignKey':_0x5893('0x1d5')});db[_0x5893('0xae')][_0x5893('0x11e')](db[_0x5893('0xb0')],{'as':_0x5893('0x1d1'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1d2')});db[_0x5893('0xae')]['hasMany'](db['DeskField'],{'as':_0x5893('0x1cb'),'onDelete':'cascade','foreignKey':'FieldId'});db['DeskConfiguration'][_0x5893('0x12f')](db[_0x5893('0xad')],{'as':_0x5893('0x17b'),'foreignKey':'AccountId'});db[_0x5893('0xae')]['belongsToMany'](db[_0x5893('0x8b')],{'through':_0x5893('0x1db')});db[_0x5893('0xb0')][_0x5893('0x11e')](db[_0x5893('0xb0')],{'as':_0x5893('0x1d4'),'foreignKey':_0x5893('0x1d5')});db[_0x5893('0xb0')][_0x5893('0x11e')](db['DeskField'],{'as':'Description','foreignKey':_0x5893('0x1d2')});db[_0x5893('0xb0')][_0x5893('0x11e')](db[_0x5893('0xb0')],{'as':_0x5893('0x1d7'),'foreignKey':_0x5893('0x1d3')});db[_0x5893('0xb0')][_0x5893('0x12f')](db[_0x5893('0x94')],{'as':'Variable','foreignKey':_0x5893('0x1d8')});db['ZohoAccount'][_0x5893('0x11e')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x5893('0x1cf')});db[_0x5893('0xb3')][_0x5893('0x11e')](db[_0x5893('0xb5')],{'as':_0x5893('0x1da'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1d5')});db[_0x5893('0xb3')][_0x5893('0x11e')](db[_0x5893('0xb5')],{'as':_0x5893('0x1d1'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1d2')});db[_0x5893('0xb3')][_0x5893('0x11e')](db[_0x5893('0xb5')],{'as':_0x5893('0x1cb'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1d3')});db[_0x5893('0xb3')][_0x5893('0x12f')](db[_0x5893('0xb2')],{'as':'Account','foreignKey':_0x5893('0x1cf')});db[_0x5893('0xb5')][_0x5893('0x11e')](db[_0x5893('0xb5')],{'as':_0x5893('0x1d4'),'foreignKey':_0x5893('0x1d5')});db[_0x5893('0xb5')][_0x5893('0x11e')](db['ZohoField'],{'as':_0x5893('0x1d6'),'foreignKey':_0x5893('0x1d2')});db[_0x5893('0xb5')][_0x5893('0x11e')](db['ZohoField'],{'as':_0x5893('0x1d7'),'foreignKey':'FieldId'});db['ZohoField'][_0x5893('0x12f')](db[_0x5893('0x94')],{'as':_0x5893('0x94'),'foreignKey':_0x5893('0x1d8')});db[_0x5893('0xb7')][_0x5893('0x11e')](db[_0x5893('0xb9')],{'as':'Configurations','onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1cf')});db[_0x5893('0xb9')][_0x5893('0x11e')](db[_0x5893('0x1dc')],{'as':_0x5893('0x1da'),'foreignKey':_0x5893('0x1d5')});db['ZendeskConfiguration'][_0x5893('0x11e')](db[_0x5893('0x1dc')],{'as':_0x5893('0x1d1'),'foreignKey':_0x5893('0x1d2')});db[_0x5893('0xb9')]['hasMany'](db[_0x5893('0x1dc')],{'as':_0x5893('0x1cb'),'foreignKey':'FieldId'});db[_0x5893('0xb9')][_0x5893('0x12f')](db[_0x5893('0xb7')],{'as':_0x5893('0x17b'),'foreignKey':_0x5893('0x1cf')});db['ZendeskConfiguration']['belongsToMany'](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db[_0x5893('0x1dc')][_0x5893('0x11e')](db['ZendeskField'],{'as':_0x5893('0x1d4'),'foreignKey':_0x5893('0x1d5')});db['ZendeskField'][_0x5893('0x11e')](db[_0x5893('0x1dc')],{'as':_0x5893('0x1d6'),'foreignKey':_0x5893('0x1d2')});db['ZendeskField']['hasMany'](db[_0x5893('0x1dc')],{'as':_0x5893('0x1d7'),'foreignKey':'FieldId'});db[_0x5893('0x1dc')]['belongsTo'](db['Variable'],{'as':_0x5893('0x94'),'foreignKey':'VariableId'});db[_0x5893('0xbb')][_0x5893('0x11e')](db[_0x5893('0xbc')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x5893('0x1cf')});db[_0x5893('0xbc')]['hasMany'](db['FreshdeskField'],{'as':_0x5893('0x1da'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1d5')});db[_0x5893('0xbc')][_0x5893('0x11e')](db[_0x5893('0x1dd')],{'as':'Descriptions','onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1d2')});db[_0x5893('0xbc')][_0x5893('0x11e')](db[_0x5893('0x1dd')],{'as':_0x5893('0x1cb'),'onDelete':_0x5893('0x11b'),'foreignKey':'FieldId'});db[_0x5893('0xbc')]['belongsTo'](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0x5893('0x1cf')});db['FreshdeskConfiguration'][_0x5893('0x132')](db[_0x5893('0x8b')],{'through':_0x5893('0x1de')});db[_0x5893('0x1dd')][_0x5893('0x11e')](db[_0x5893('0x1dd')],{'as':_0x5893('0x1d4'),'foreignKey':_0x5893('0x1d5')});db['FreshdeskField'][_0x5893('0x11e')](db['FreshdeskField'],{'as':_0x5893('0x1d6'),'foreignKey':_0x5893('0x1d2')});db['FreshdeskField'][_0x5893('0x11e')](db[_0x5893('0x1dd')],{'as':_0x5893('0x1d7'),'foreignKey':'FieldId'});db[_0x5893('0x1dd')]['belongsTo'](db[_0x5893('0x94')],{'as':_0x5893('0x94'),'foreignKey':_0x5893('0x1d8')});db[_0x5893('0xbf')][_0x5893('0x11e')](db[_0x5893('0xc1')],{'as':_0x5893('0x1ce'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1cf')});db[_0x5893('0xc1')][_0x5893('0x11e')](db['VtigerField'],{'as':_0x5893('0x1da'),'foreignKey':_0x5893('0x1d5')});db[_0x5893('0xc1')]['hasMany'](db[_0x5893('0xc3')],{'as':_0x5893('0x1d1'),'foreignKey':_0x5893('0x1d2')});db['VtigerConfiguration'][_0x5893('0x11e')](db[_0x5893('0xc3')],{'as':_0x5893('0x1cb'),'foreignKey':_0x5893('0x1d3')});db[_0x5893('0xc1')][_0x5893('0x12f')](db['VtigerAccount'],{'as':_0x5893('0x17b'),'foreignKey':'AccountId'});db[_0x5893('0xc3')][_0x5893('0x11e')](db['VtigerField'],{'as':'Subject','foreignKey':_0x5893('0x1d5')});db[_0x5893('0xc3')][_0x5893('0x11e')](db[_0x5893('0xc3')],{'as':_0x5893('0x1d6'),'foreignKey':_0x5893('0x1d2')});db[_0x5893('0xc3')][_0x5893('0x11e')](db[_0x5893('0xc3')],{'as':_0x5893('0x1d7'),'foreignKey':_0x5893('0x1d3')});db[_0x5893('0xc3')][_0x5893('0x12f')](db[_0x5893('0x94')],{'as':_0x5893('0x94'),'foreignKey':'VariableId'});db[_0x5893('0x1df')][_0x5893('0x11e')](db[_0x5893('0xc5')],{'as':'Configurations','onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1cf')});db[_0x5893('0xc5')][_0x5893('0x11e')](db['ServicenowField'],{'as':_0x5893('0x1da'),'foreignKey':_0x5893('0x1d5')});db[_0x5893('0xc5')][_0x5893('0x11e')](db[_0x5893('0xc7')],{'as':_0x5893('0x1d1'),'foreignKey':_0x5893('0x1d2')});db[_0x5893('0xc5')][_0x5893('0x11e')](db[_0x5893('0xc7')],{'as':_0x5893('0x1cb'),'foreignKey':_0x5893('0x1d3')});db[_0x5893('0xc5')][_0x5893('0x12f')](db[_0x5893('0x1df')],{'as':_0x5893('0x17b'),'foreignKey':_0x5893('0x1cf')});db[_0x5893('0xc7')][_0x5893('0x11e')](db[_0x5893('0xc7')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x5893('0xc7')][_0x5893('0x11e')](db[_0x5893('0xc7')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x5893('0xc7')]['hasMany'](db['ServicenowField'],{'as':_0x5893('0x1d7'),'foreignKey':_0x5893('0x1d3')});db[_0x5893('0xc7')][_0x5893('0x12f')](db[_0x5893('0x94')],{'as':'Variable','foreignKey':'VariableId'});db['Dynamics365Account'][_0x5893('0x11e')](db[_0x5893('0xc9')],{'as':_0x5893('0x1ce'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1cf')});db[_0x5893('0xc8')][_0x5893('0x12f')](db['CloudProvider'],{'as':_0x5893('0x111'),'foreignKey':_0x5893('0x16d')});db[_0x5893('0xc9')][_0x5893('0x11e')](db[_0x5893('0xcb')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x5893('0x1d5')});db[_0x5893('0xc9')][_0x5893('0x11e')](db[_0x5893('0xcb')],{'as':_0x5893('0x1d1'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1d2')});db[_0x5893('0xc9')][_0x5893('0x11e')](db[_0x5893('0xcb')],{'as':'Fields','onDelete':_0x5893('0x11b'),'foreignKey':'FieldId'});db[_0x5893('0xc9')][_0x5893('0x12f')](db['Dynamics365Account'],{'as':_0x5893('0x17b'),'foreignKey':_0x5893('0x1cf')});db[_0x5893('0xcb')]['hasMany'](db[_0x5893('0xcb')],{'as':_0x5893('0x1d4'),'foreignKey':_0x5893('0x1d5')});db[_0x5893('0xcb')][_0x5893('0x11e')](db[_0x5893('0xcb')],{'as':_0x5893('0x1d6'),'foreignKey':_0x5893('0x1d2')});db[_0x5893('0xcb')]['hasMany'](db[_0x5893('0xcb')],{'as':'Field','foreignKey':_0x5893('0x1d3')});db['Dynamics365Field'][_0x5893('0x12f')](db[_0x5893('0x94')],{'as':_0x5893('0x94'),'foreignKey':_0x5893('0x1d8')});db['FreshsalesAccount'][_0x5893('0x11e')](db['FreshsalesConfiguration'],{'as':_0x5893('0x1ce'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1cf')});db[_0x5893('0x1e0')]['hasMany'](db[_0x5893('0x1e1')],{'as':_0x5893('0x1da'),'foreignKey':_0x5893('0x1d5')});db[_0x5893('0x1e0')][_0x5893('0x11e')](db[_0x5893('0x1e1')],{'as':_0x5893('0x1d1'),'foreignKey':'DescriptionId'});db[_0x5893('0x1e0')][_0x5893('0x11e')](db[_0x5893('0x1e1')],{'as':_0x5893('0x1cb'),'foreignKey':_0x5893('0x1d3')});db[_0x5893('0x1e0')][_0x5893('0x12f')](db['FreshsalesAccount'],{'as':_0x5893('0x17b'),'foreignKey':_0x5893('0x1cf')});db[_0x5893('0x1e1')][_0x5893('0x11e')](db['FreshsalesField'],{'as':_0x5893('0x1d4'),'foreignKey':'SubjectId'});db[_0x5893('0x1e1')]['hasMany'](db['FreshsalesField'],{'as':_0x5893('0x1d6'),'foreignKey':_0x5893('0x1d2')});db[_0x5893('0x1e1')][_0x5893('0x11e')](db[_0x5893('0x1e1')],{'as':'Field','foreignKey':_0x5893('0x1d3')});db[_0x5893('0x1e1')][_0x5893('0x12f')](db[_0x5893('0x94')],{'as':_0x5893('0x94'),'foreignKey':_0x5893('0x1d8')});db['ChatQueueReport']['belongsTo'](db['ChatWebsite'],{});db[_0x5893('0xd3')][_0x5893('0x12f')](db['CmList'],{'as':_0x5893('0x175'),'foreignKey':_0x5893('0x176')});db[_0x5893('0xd3')][_0x5893('0x12f')](db[_0x5893('0x6c')],{'as':_0x5893('0x16a'),'foreignKey':_0x5893('0x17c')});db[_0x5893('0xd3')][_0x5893('0x12f')](db[_0x5893('0x126')],{});db[_0x5893('0xd3')][_0x5893('0x12f')](db[_0x5893('0x1a0')],{});db[_0x5893('0xd3')][_0x5893('0x12f')](db[_0x5893('0x119')],{});db[_0x5893('0xd3')][_0x5893('0x12f')](db[_0x5893('0x67')],{});db[_0x5893('0xd5')]['belongsTo'](db[_0x5893('0x119')],{'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1e2')});db[_0x5893('0xd5')]['belongsTo'](db[_0x5893('0x119')],{'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x1e3')});db['JscriptySessionReport'][_0x5893('0x11e')](db[_0x5893('0xd9')],{'foreignKey':'SessionId','onDelete':'cascade'});db['JscriptySessionReport'][_0x5893('0x11e')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0x5893('0x11b')});db[_0x5893('0xdd')][_0x5893('0x12f')](db[_0x5893('0x14c')],{});db[_0x5893('0xdd')][_0x5893('0x12f')](db['CmList'],{'as':_0x5893('0x175'),'foreignKey':_0x5893('0x176')});db[_0x5893('0xdd')][_0x5893('0x12f')](db[_0x5893('0x6c')],{'as':_0x5893('0x16a'),'foreignKey':_0x5893('0x17c')});db[_0x5893('0xdd')]['belongsTo'](db[_0x5893('0x55')],{});db[_0x5893('0xdd')]['belongsTo'](db[_0x5893('0x57')],{});db[_0x5893('0xdd')]['belongsTo'](db[_0x5893('0x119')],{});db[_0x5893('0xdd')]['belongsTo'](db[_0x5893('0x59')],{});db[_0x5893('0xe2')][_0x5893('0x11e')](db[_0x5893('0xdb')],{'foreignKey':_0x5893('0x1e4')});db[_0x5893('0xe2')][_0x5893('0x11e')](db[_0x5893('0xd9')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x5893('0x11e')](db[_0x5893('0xd7')],{'foreignKey':_0x5893('0x1e4')});db[_0x5893('0xed')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x5893('0x137')});db[_0x5893('0xed')]['belongsToMany'](db[_0x5893('0x13b')],{'through':_0x5893('0x1e5'),'as':_0x5893('0x1e6')});db[_0x5893('0xed')][_0x5893('0x132')](db[_0x5893('0x3d')],{'through':_0x5893('0x179'),'as':_0x5893('0x13e')});db[_0x5893('0xed')]['belongsToMany'](db[_0x5893('0x67')],{'through':_0x5893('0x1a8'),'as':_0x5893('0x13f')});db[_0x5893('0xed')]['belongsToMany'](db['FaxQueue'],{'through':_0x5893('0x192'),'as':'FaxQueues'});db['Team'][_0x5893('0x132')](db[_0x5893('0x59')],{'through':'team_has_sms_queues','as':_0x5893('0x1e7')});db[_0x5893('0xed')][_0x5893('0x132')](db[_0x5893('0x60')],{'through':_0x5893('0x19e'),'as':'OpenchannelQueues'});db[_0x5893('0xed')][_0x5893('0x132')](db[_0x5893('0x142')],{'through':_0x5893('0x1e8'),'as':_0x5893('0x143')});db['Team'][_0x5893('0x132')](db['VoicePrefix'],{'through':_0x5893('0x114'),'as':'VoicePrefixes'});db[_0x5893('0x1b1')][_0x5893('0x11e')](db[_0x5893('0x157')],{'as':_0x5893('0x158'),'foreignKey':_0x5893('0x1b2')});db[_0x5893('0x1b1')]['hasMany'](db['CmHopperFinal'],{'as':_0x5893('0x123'),'foreignKey':_0x5893('0x1b2')});db[_0x5893('0x1b1')][_0x5893('0x11e')](db['CmHopperHistory'],{'as':_0x5893('0x159'),'foreignKey':_0x5893('0x1b2')});db[_0x5893('0x1b1')][_0x5893('0x11e')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x5893('0x1b2')});db[_0x5893('0x1b1')]['belongsTo'](db[_0x5893('0x15b')],{'as':_0x5893('0x15b'),'foreignKey':_0x5893('0x15c')});db['Campaign'][_0x5893('0x12f')](db['Trunk'],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x5893('0x1b1')][_0x5893('0x12f')](db[_0x5893('0x80')],{'as':_0x5893('0x80'),'foreignKey':_0x5893('0x15f')});db['Campaign']['belongsTo'](db[_0x5893('0x1e9')],{'as':_0x5893('0x1e9'),'foreignKey':_0x5893('0x1ea')});db[_0x5893('0x1b1')][_0x5893('0x132')](db[_0x5893('0xfe')],{'as':'Lists','through':_0x5893('0x1eb')});db[_0x5893('0x1b1')][_0x5893('0x132')](db['CmList'],{'as':_0x5893('0x1ec'),'through':_0x5893('0x1ed')});db['Attachment'][_0x5893('0x12f')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x5893('0x187')});db[_0x5893('0xf5')][_0x5893('0x12f')](db['MailMessage'],{});db['MailTransferReport'][_0x5893('0x12f')](db[_0x5893('0x40')],{});db[_0x5893('0xf5')][_0x5893('0x12f')](db[_0x5893('0x3b')],{'foreignKey':_0x5893('0x1ee'),'as':'FromAccount'});db[_0x5893('0xf5')][_0x5893('0x12f')](db[_0x5893('0x119')],{'foreignKey':_0x5893('0x1ef'),'as':_0x5893('0x1f0')});db[_0x5893('0xf5')][_0x5893('0x12f')](db[_0x5893('0x119')],{'foreignKey':_0x5893('0x1f1'),'as':_0x5893('0x1f2')});db['MailTransferReport'][_0x5893('0x12f')](db['MailQueue'],{'foreignKey':_0x5893('0x1f3'),'as':_0x5893('0x1f4')});db[_0x5893('0xf5')]['belongsTo'](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0x5893('0x1f5')});db['ChatTransferReport'][_0x5893('0x12f')](db[_0x5893('0x1a0')],{});db[_0x5893('0xf7')][_0x5893('0x12f')](db['ChatInteraction'],{});db['ChatTransferReport'][_0x5893('0x12f')](db[_0x5893('0x144')],{'foreignKey':'FromChatWebsiteId','as':_0x5893('0x1f6')});db[_0x5893('0xf7')]['belongsTo'](db[_0x5893('0x119')],{'foreignKey':_0x5893('0x1ef'),'as':_0x5893('0x1f0')});db['ChatTransferReport'][_0x5893('0x12f')](db[_0x5893('0x119')],{'foreignKey':_0x5893('0x1f1'),'as':_0x5893('0x1f2')});db['ChatTransferReport'][_0x5893('0x12f')](db[_0x5893('0x67')],{'foreignKey':_0x5893('0x1f7'),'as':_0x5893('0x1f4')});db[_0x5893('0xf7')][_0x5893('0x12f')](db[_0x5893('0x144')],{'foreignKey':_0x5893('0x1f8'),'as':_0x5893('0x1f5')});db['FaxTransferReport'][_0x5893('0x12f')](db[_0x5893('0x4c')],{});db['FaxTransferReport'][_0x5893('0x12f')](db[_0x5893('0x4b')],{});db[_0x5893('0xf9')]['belongsTo'](db[_0x5893('0x47')],{'foreignKey':_0x5893('0x1f9'),'as':_0x5893('0x1f6')});db[_0x5893('0xf9')][_0x5893('0x12f')](db[_0x5893('0x119')],{'foreignKey':_0x5893('0x1ef'),'as':_0x5893('0x1f0')});db[_0x5893('0xf9')][_0x5893('0x12f')](db[_0x5893('0x119')],{'foreignKey':_0x5893('0x1f1'),'as':_0x5893('0x1f2')});db[_0x5893('0xf9')][_0x5893('0x12f')](db[_0x5893('0x4e')],{'foreignKey':_0x5893('0x1fa'),'as':'ToQueue'});db[_0x5893('0xf9')]['belongsTo'](db[_0x5893('0x47')],{'foreignKey':_0x5893('0x1fb'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0x5893('0x12f')](db[_0x5893('0x199')],{});db[_0x5893('0xfb')]['belongsTo'](db[_0x5893('0x5e')],{});db[_0x5893('0xfb')][_0x5893('0x12f')](db['OpenchannelAccount'],{'foreignKey':_0x5893('0x1fc'),'as':'FromAccount'});db[_0x5893('0xfb')]['belongsTo'](db[_0x5893('0x119')],{'foreignKey':_0x5893('0x1ef'),'as':'FromAgent'});db[_0x5893('0xfb')][_0x5893('0x12f')](db['User'],{'foreignKey':_0x5893('0x1f1'),'as':_0x5893('0x1f2')});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0x5893('0x1fd'),'as':_0x5893('0x1f4')});db[_0x5893('0xfb')][_0x5893('0x12f')](db['OpenchannelAccount'],{'foreignKey':_0x5893('0x1fe'),'as':_0x5893('0x1f5')});db[_0x5893('0xfc')]['belongsTo'](db[_0x5893('0x57')],{});db[_0x5893('0xfc')][_0x5893('0x12f')](db['SmsInteraction'],{});db[_0x5893('0xfc')][_0x5893('0x12f')](db[_0x5893('0x14c')],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db['SmsTransferReport'][_0x5893('0x12f')](db[_0x5893('0x119')],{'foreignKey':_0x5893('0x1ef'),'as':'FromAgent'});db[_0x5893('0xfc')][_0x5893('0x12f')](db[_0x5893('0x119')],{'foreignKey':_0x5893('0x1f1'),'as':_0x5893('0x1f2')});db[_0x5893('0xfc')]['belongsTo'](db[_0x5893('0x59')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db['SmsTransferReport'][_0x5893('0x12f')](db['SmsAccount'],{'foreignKey':_0x5893('0x1ff'),'as':_0x5893('0x1f5')});db[_0x5893('0xfe')][_0x5893('0x11e')](db['Disposition'],{'as':_0x5893('0x18b'),'foreignKey':_0x5893('0x176'),'onDelete':_0x5893('0x11b')});db[_0x5893('0xfe')][_0x5893('0x11e')](db['CmCustomField'],{'as':_0x5893('0x200'),'foreignKey':_0x5893('0x176')});db['CmList'][_0x5893('0x11e')](db[_0x5893('0x6c')],{'as':'Contacts','onDelete':_0x5893('0x11b'),'foreignKey':'ListId'});db[_0x5893('0xfe')][_0x5893('0x11e')](db[_0x5893('0x122')],{'as':_0x5893('0x123'),'foreignKey':'ListId'});db['CmList'][_0x5893('0x11e')](db[_0x5893('0x71')],{'as':'HopperHistory','foreignKey':_0x5893('0x176')});db[_0x5893('0xfe')][_0x5893('0x11e')](db[_0x5893('0x73')],{'as':'ReportAgentPreview','foreignKey':_0x5893('0x176')});db[_0x5893('0xfe')]['belongsToMany'](db['VoiceQueue'],{'as':_0x5893('0x201'),'through':_0x5893('0x202')});db[_0x5893('0xfe')][_0x5893('0x132')](db[_0x5893('0x119')],{'as':'Agents','through':'cm_user_has_lists'});db[_0x5893('0x100')]['hasMany'](db[_0x5893('0x18')],{'as':_0x5893('0x121'),'onDelete':_0x5893('0x11b')});db['VoicePrefix'][_0x5893('0x132')](db[_0x5893('0x119')],{'as':'Agents','through':_0x5893('0x115')});db['VoicePrefix'][_0x5893('0x132')](db[_0x5893('0xed')],{'through':_0x5893('0x114'),'as':'Teams'});db[_0x5893('0x102')][_0x5893('0x11e')](db[_0x5893('0x119')],{'as':'Users','foreignKey':_0x5893('0x130')});db[_0x5893('0x102')][_0x5893('0x11e')](db[_0x5893('0x203')],{'as':'UserProfileSections','foreignKey':_0x5893('0x130'),'onDelete':'cascade'});db[_0x5893('0x203')]['hasMany'](db[_0x5893('0x105')],{'as':_0x5893('0x204'),'foreignKey':_0x5893('0x205'),'onDelete':_0x5893('0x11b')});db[_0x5893('0x14f')][_0x5893('0x11e')](db[_0x5893('0x7c')],{'as':_0x5893('0x18b'),'foreignKey':_0x5893('0x206'),'onDelete':_0x5893('0x11b')});db[_0x5893('0x14f')]['hasMany'](db[_0x5893('0x7a')],{'as':_0x5893('0x171'),'foreignKey':_0x5893('0x206')});db[_0x5893('0x14f')][_0x5893('0x11e')](db[_0x5893('0x10c')],{'as':'Messages','foreignKey':_0x5893('0x206')});db['WhatsappAccount']['hasMany'](db[_0x5893('0x10a')],{'as':_0x5893('0x173')});db[_0x5893('0x14f')][_0x5893('0x11e')](db[_0x5893('0x108')],{'as':_0x5893('0x153')});db['WhatsappAccount'][_0x5893('0x12f')](db[_0x5893('0xfe')],{'as':'List','foreignKey':_0x5893('0x176')});db[_0x5893('0x14f')][_0x5893('0x12f')](db[_0x5893('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x5893('0x161')});db[_0x5893('0x14f')][_0x5893('0x132')](db[_0x5893('0x119')],{'as':_0x5893('0x162'),'through':_0x5893('0x151')});db[_0x5893('0x108')]['belongsTo'](db[_0x5893('0x119')],{'onDelete':_0x5893('0x16e')});db[_0x5893('0x108')][_0x5893('0x12f')](db[_0x5893('0x142')],{'onDelete':_0x5893('0x16e')});db[_0x5893('0x108')]['belongsTo'](db[_0x5893('0x14f')],{'onDelete':_0x5893('0x16e')});db['WhatsappApplication'][_0x5893('0x12f')](db[_0x5893('0x80')],{'onDelete':_0x5893('0x16e'),'foreignKey':_0x5893('0x15f')});db[_0x5893('0x108')][_0x5893('0x12f')](db['Tag'],{'onDelete':_0x5893('0x16e'),'foreignKey':_0x5893('0x188')});db['WhatsappInteraction']['hasMany'](db['WhatsappMessage'],{'as':_0x5893('0x172'),'onDelete':_0x5893('0x11b'),'foreignKey':_0x5893('0x207')});db[_0x5893('0x10a')][_0x5893('0x12f')](db[_0x5893('0x14f')],{'as':_0x5893('0x17b'),'foreignKey':_0x5893('0x206')});db[_0x5893('0x10a')][_0x5893('0x12f')](db[_0x5893('0x6c')],{'as':_0x5893('0x16a'),'foreignKey':'ContactId'});db[_0x5893('0x10a')][_0x5893('0x12f')](db['User'],{'as':_0x5893('0x17d'),'foreignKey':_0x5893('0x11c')});db['WhatsappInteraction'][_0x5893('0x132')](db[_0x5893('0x8b')],{'through':_0x5893('0x1c2'),'as':_0x5893('0x17f')});db[_0x5893('0x10a')][_0x5893('0x132')](db['Tag'],{'through':_0x5893('0x1c2'),'as':_0x5893('0x180')});db['WhatsappInteraction'][_0x5893('0x132')](db[_0x5893('0x119')],{'as':_0x5893('0x181'),'through':_0x5893('0x208'),'foreignKey':_0x5893('0x207')});db[_0x5893('0x10c')]['belongsTo'](db[_0x5893('0x119')],{'as':_0x5893('0x119')});db[_0x5893('0x10c')][_0x5893('0x12f')](db[_0x5893('0x6c')],{'onDelete':_0x5893('0x11b'),'as':_0x5893('0x16a')});db[_0x5893('0x10c')]['belongsTo'](db[_0x5893('0x10a')],{'onDelete':_0x5893('0x11b'),'as':'Interaction','foreignKey':_0x5893('0x207')});db['WhatsappMessage']['belongsTo'](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0x5893('0x10e')][_0x5893('0x12f')](db['WhatsappAccount'],{});db[_0x5893('0x10e')][_0x5893('0x12f')](db[_0x5893('0xfe')],{'as':_0x5893('0x175'),'foreignKey':_0x5893('0x176')});db[_0x5893('0x10e')][_0x5893('0x12f')](db[_0x5893('0x6c')],{'as':_0x5893('0x16a'),'foreignKey':'ContactId'});db[_0x5893('0x10e')][_0x5893('0x12f')](db['WhatsappInteraction'],{});db['WhatsappQueueReport'][_0x5893('0x12f')](db[_0x5893('0x142')],{});db['WhatsappQueueReport'][_0x5893('0x12f')](db['WhatsappMessage'],{});db[_0x5893('0x10e')][_0x5893('0x12f')](db[_0x5893('0x119')],{});db[_0x5893('0x209')][_0x5893('0x12f')](db[_0x5893('0x10c')],{});db['WhatsappTransferReport']['belongsTo'](db['WhatsappInteraction'],{});db[_0x5893('0x209')]['belongsTo'](db[_0x5893('0x14f')],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0x5893('0x209')][_0x5893('0x12f')](db[_0x5893('0x14f')],{'foreignKey':'ToWhatsappAccountId','as':_0x5893('0x1f5')});db['WhatsappTransferReport'][_0x5893('0x12f')](db[_0x5893('0x142')],{'foreignKey':_0x5893('0x20a'),'as':_0x5893('0x1f4')});db[_0x5893('0x209')][_0x5893('0x12f')](db[_0x5893('0x119')],{'foreignKey':_0x5893('0x1ef'),'as':_0x5893('0x1f0')});db[_0x5893('0x209')][_0x5893('0x12f')](db[_0x5893('0x119')],{'foreignKey':_0x5893('0x1f1'),'as':_0x5893('0x1f2')});db[_0x5893('0x142')][_0x5893('0x132')](db[_0x5893('0x119')],{'as':_0x5893('0x162'),'through':_0x5893('0x36'),'foreignKey':'WhatsappQueueId'});db[_0x5893('0x142')][_0x5893('0x132')](db['Team'],{'through':_0x5893('0x1e8'),'as':_0x5893('0x163')});db['UserSetting'][_0x5893('0x12f')](db[_0x5893('0x119')],{'as':'user','foreignKey':_0x5893('0x11c'),'onDelete':_0x5893('0x11b'),'hooks':!![]});db[_0x5893('0x111')][_0x5893('0x11a')](db[_0x5893('0xc8')],{'as':_0x5893('0xc8'),'onDelete':_0x5893('0x16e')});db[_0x5893('0x111')][_0x5893('0x11a')](db[_0x5893('0x16b')],{'as':_0x5893('0x16f'),'onDelete':_0x5893('0x16e')});db['CloudProvider'][_0x5893('0x11a')](db['MailServerOut'],{'as':_0x5893('0x170'),'onDelete':_0x5893('0x16e')});module[_0x5893('0x20b')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x58fd=['AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','userSetting','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','WhatsappInteractions','SenderId','belongsTo','userProfileId','Groups','Contacts','cm_user_has_contacts','belongsToMany','cm_user_has_lists','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','MailQueues','ChatQueue','ChatQueues','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccount','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Applications','Sound','Members','CmHopper','Hoppers','VoiceQueueId','ReportAgentPreview','HopperBlacks','JscriptySessionReport','TrunkId','TrunkBackup','TrunkBackupId','Interval','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','mailboxuser','mailbox','uniqueid','AgentReports','CmContact','MailServerIn','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Messages','Interactions','List','ListId','Template','TemplateId','team_has_mail_queues','MailInteractionId','Account','Contact','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatOfflineMessage','IntervalId','TagId','Dashboard','Items','Disposition','FaxAccountId','FaxAccount','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','user_has_sms_accounts','sms_interaction_has_tags','SmsInteractionId','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','Owner','openchannel_interaction_has_tags','user_has_openchannel_interactions','ChatWebsiteId','ProactiveActions','ChatApplication','OpenchannelQueueReport','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','ChatOfflineMessageId','team_has_chat_queues','chat_group_has_users','CompanyId','Phones','CmContactId','HopperHistories','cm_contact_has_tags','CmHopperId','Agent','OwnerId','CampaignId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Action','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','Schedule','Mohs','whatsapp_interaction_has_tags','Hopper','AllCondition','AnyConditions','AnyCondition','TriggerId','Fields','CustomReportId','DefaultReportId','MetricId','AccountId','Subjects','Descriptions','FieldId','Description','DescriptionId','VariableId','SugarcrmConfiguration','Subject','SubjectId','DeskConfiguration','Configurations','int_desk_configuration_has_tags','Field','ZohoConfiguration','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Configuration','FromId','ToId','SessionId','ProjectId','user_has_teams','FaxQueues','team_has_sms_queues','SmsQueues','team_has_whatsapp_queues','VoicePrefixes','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToQueue','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','FromAccount','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','UserProfileSection','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','user','exports','../config/environment','sequelize','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','options','password','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../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','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','CmContactHasItem','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric'];(function(_0x17a7d8,_0x175204){var _0x417e7d=function(_0x4c5b93){while(--_0x4c5b93){_0x17a7d8['push'](_0x17a7d8['shift']());}};_0x417e7d(++_0x175204);}(_0x58fd,0x165));var _0xd58f=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x58fd[_0x4fc9e6];return _0x551d28;};'use strict';var config=require(_0xd58f('0x0'));var Sequelize=require(_0xd58f('0x1'));var _=require('lodash');var jstz=require('jstz');var timezone=jstz[_0xd58f('0x2')]();config[_0xd58f('0x1')]=_[_0xd58f('0x3')](config['sequelize'],{'database':_0xd58f('0x4'),'username':_0xd58f('0x5'),'password':_0xd58f('0x6'),'options':{'host':_0xd58f('0x7'),'port':0xcea,'dialect':_0xd58f('0x8'),'dialectOptions':{'charset':_0xd58f('0x9')},'logging':![],'timezone':timezone[_0xd58f('0xa')](),'define':{'charset':_0xd58f('0xb'),'collate':_0xd58f('0xc')}}});config['sequelizeHistory']=_[_0xd58f('0x3')](config[_0xd58f('0xd')],{'database':_0xd58f('0x4'),'username':'xcall','password':_0xd58f('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xd58f('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xd58f('0xb'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd58f('0x1')][_0xd58f('0xe')],config[_0xd58f('0x1')][_0xd58f('0xf')],config[_0xd58f('0x1')]['password'],config[_0xd58f('0x1')][_0xd58f('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd58f('0xd')][_0xd58f('0xe')],config[_0xd58f('0xd')]['username'],config[_0xd58f('0xd')][_0xd58f('0x11')],config[_0xd58f('0xd')][_0xd58f('0x10')])};db[_0xd58f('0x12')]=db['sequelize']['import'](_0xd58f('0x13'));db[_0xd58f('0x14')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x16'));db[_0xd58f('0x17')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x18'));db[_0xd58f('0x19')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x1a'));db[_0xd58f('0x1b')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x1c'));db['VoiceQueue']=db[_0xd58f('0x1')]['import'](_0xd58f('0x1d'));db[_0xd58f('0x1e')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0x1f'));db[_0xd58f('0x20')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x21'));db[_0xd58f('0x22')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x23'));db[_0xd58f('0x24')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x25'));db[_0xd58f('0x26')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x27'));db[_0xd58f('0x28')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0x29'));db[_0xd58f('0x2a')]=db['sequelize']['import'](_0xd58f('0x2b'));db[_0xd58f('0x2c')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x2d'));db[_0xd58f('0x2e')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x2f'));db[_0xd58f('0x30')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x31'));db['VoiceTransferReport']=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x32'));db[_0xd58f('0x33')]=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xd58f('0x34')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x35'));db[_0xd58f('0x36')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x37'));db[_0xd58f('0x38')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x39'));db[_0xd58f('0x3a')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x3b'));db[_0xd58f('0x3c')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x3d'));db['UserOpenchannelQueue']=db[_0xd58f('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xd58f('0x3e')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x3f'));db['MailServerIn']=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/mailServerIn/mailServerIn.model');db[_0xd58f('0x40')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x41'));db['MailAccount']=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x42'));db[_0xd58f('0x43')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x44'));db[_0xd58f('0x45')]=db[_0xd58f('0x1')]['import']('../api/mailSubstatus/mailSubstatus.model');db[_0xd58f('0x46')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x47'));db[_0xd58f('0x48')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0x49'));db[_0xd58f('0x4a')]=db['sequelize']['import'](_0xd58f('0x4b'));db[_0xd58f('0x4c')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x4d'));db['Dashboard']=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/dashboard/dashboard.model');db[_0xd58f('0x4e')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x4f'));db['FaxAccount']=db['sequelize'][_0xd58f('0x15')](_0xd58f('0x50'));db[_0xd58f('0x51')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x52'));db[_0xd58f('0x53')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0x54'));db[_0xd58f('0x55')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x56'));db[_0xd58f('0x57')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x58'));db[_0xd58f('0x59')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x5a'));db['SmsAccount']=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db['sequelize'][_0xd58f('0x15')]('../api/smsApplication/smsApplication.model');db[_0xd58f('0x5b')]=db['sequelize']['import'](_0xd58f('0x5c'));db[_0xd58f('0x5d')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x5e'));db[_0xd58f('0x5f')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x60'));db[_0xd58f('0x61')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x62'));db['OpenchannelApplication']=db['sequelize'][_0xd58f('0x15')]('../api/openchannelApplication/openchannelApplication.model');db[_0xd58f('0x63')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0x64'));db[_0xd58f('0x65')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0x66'));db[_0xd58f('0x67')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0x68'));db[_0xd58f('0x69')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x6a'));db['OpenchannelQueueReport']=db[_0xd58f('0x1')]['import'](_0xd58f('0x6b'));db['ChatApplication']=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x6c'));db[_0xd58f('0x6d')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x6e'));db[_0xd58f('0x6f')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x70'));db['ChatOfflineMessage']=db[_0xd58f('0x1')]['import'](_0xd58f('0x71'));db['ChatQueue']=db[_0xd58f('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0xd58f('0x72')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x73'));db[_0xd58f('0x74')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x75'));db[_0xd58f('0x76')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x77'));db['CmContact']=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x78'));db[_0xd58f('0x79')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x7a'));db[_0xd58f('0x7b')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x7c'));db[_0xd58f('0x7d')]=db[_0xd58f('0x1')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xd58f('0x7e')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x7f'));db['Action']=db['sequelize'][_0xd58f('0x15')]('../api/action/action.model');db[_0xd58f('0x80')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x81'));db[_0xd58f('0x82')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x83'));db['Disposition']=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x84'));db[_0xd58f('0x85')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x86'));db['Interval']=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/interval/interval.model');db[_0xd58f('0x87')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x88'));db[_0xd58f('0x89')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0x8a'));db['VoiceQueuesLog']=db['sequelize'][_0xd58f('0x15')](_0xd58f('0x8b'));db['Schedule']=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x8c'));db['Sound']=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x8d'));db[_0xd58f('0x8e')]=db['sequelize']['import'](_0xd58f('0x8f'));db[_0xd58f('0x90')]=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/contactItemType/contactItemType.model');db[_0xd58f('0x91')]=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0xd58f('0x92')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x93'));db['Template']=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/template/template.model');db[_0xd58f('0x94')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x95'));db[_0xd58f('0x96')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x97'));db[_0xd58f('0x98')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x99'));db[_0xd58f('0x9a')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x9b'));db[_0xd58f('0x9c')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x9d'));db[_0xd58f('0x9e')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x9f'));db[_0xd58f('0xa0')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xa1'));db[_0xd58f('0xa2')]=db['sequelize'][_0xd58f('0x15')]('../api/analyticMetric/analyticMetric.model');db[_0xd58f('0xa3')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xa4'));db[_0xd58f('0xa5')]=db[_0xd58f('0x1')]['import'](_0xd58f('0xa6'));db[_0xd58f('0xa7')]=db['sequelize'][_0xd58f('0x15')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xd58f('0xa8')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xa9'));db[_0xd58f('0xaa')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xab'));db[_0xd58f('0xac')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0xad'));db['SugarcrmConfiguration']=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xae'));db[_0xd58f('0xaf')]=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0xd58f('0xb0')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xb1'));db['DeskConfiguration']=db['sequelize'][_0xd58f('0x15')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xd58f('0xb2')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xb3'));db[_0xd58f('0xb4')]=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xd58f('0xb5')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0xb6'));db[_0xd58f('0xb7')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xb8'));db['ZendeskConfiguration']=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xb9'));db['ZendeskField']=db[_0xd58f('0x1')]['import']('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db['sequelize'][_0xd58f('0x15')](_0xd58f('0xba'));db[_0xd58f('0xbb')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xbc'));db[_0xd58f('0xbd')]=db['sequelize'][_0xd58f('0x15')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0xd58f('0xbe')]=db['sequelize'][_0xd58f('0x15')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0xd58f('0xbf')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xc0'));db[_0xd58f('0xc1')]=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/intVtigerField/intVtigerField.model');db[_0xd58f('0xc2')]=db[_0xd58f('0x1')]['import'](_0xd58f('0xc3'));db['ServicenowConfiguration']=db['sequelize'][_0xd58f('0x15')](_0xd58f('0xc4'));db[_0xd58f('0xc5')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xc6'));db[_0xd58f('0xc7')]=db['sequelize']['import']('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xc8'));db[_0xd58f('0xc9')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xca'));db[_0xd58f('0xcb')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xcc'));db[_0xd58f('0xcd')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xce'));db[_0xd58f('0xcf')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xd0'));db[_0xd58f('0x98')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x99'));db[_0xd58f('0xd1')]=db[_0xd58f('0x1')]['import'](_0xd58f('0xd2'));db[_0xd58f('0xd3')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xd4'));db[_0xd58f('0xd5')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xd6'));db[_0xd58f('0xd7')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xd8'));db[_0xd58f('0xd9')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0xda'));db['JscriptySessionReport']=db[_0xd58f('0x1')]['import'](_0xd58f('0xdb'));db[_0xd58f('0xdc')]=db[_0xd58f('0x1')]['import']('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/squareReport/squareReport.model');db[_0xd58f('0xdd')]=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/squareReportDetail/squareReportDetail.model');db[_0xd58f('0xde')]=db[_0xd58f('0x1')]['import'](_0xd58f('0xdf'));db['Setting']=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/setting/setting.model');db[_0xd58f('0xe0')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xe1'));db[_0xd58f('0xe2')]=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/squareProject/squareProject.model');db[_0xd58f('0xe3')]=db[_0xd58f('0x1')]['import'](_0xd58f('0xe4'));db[_0xd58f('0xe5')]=db[_0xd58f('0x1')]['import'](_0xd58f('0xe6'));db[_0xd58f('0xe7')]=db[_0xd58f('0x1')]['import'](_0xd58f('0xe8'));db['License']=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xe9'));db[_0xd58f('0xea')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xeb'));db[_0xd58f('0xec')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xed'));db[_0xd58f('0xee')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0xef'));db[_0xd58f('0xf0')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0xf1'));db[_0xd58f('0xf2')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xf3'));db[_0xd58f('0xf4')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xf5'));db[_0xd58f('0xf6')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0xf7'));db[_0xd58f('0xf8')]=db[_0xd58f('0x1')]['import'](_0xd58f('0xf9'));db['SmsTransferReport']=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xfa'));db[_0xd58f('0xfb')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xfc'));db[_0xd58f('0xfd')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0xfe'));db[_0xd58f('0xff')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x100'));db['UserProfileSection']=db[_0xd58f('0x1')]['import']('../api/userProfileSection/userProfileSection.model');db[_0xd58f('0x101')]=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/userProfileResource/userProfileResource.model');db[_0xd58f('0x102')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x103'));db[_0xd58f('0x104')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x105'));db[_0xd58f('0x106')]=db['sequelize']['import'](_0xd58f('0x107'));db[_0xd58f('0x108')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0x109'));db[_0xd58f('0x10a')]=db['sequelize']['import'](_0xd58f('0x10b'));db['WhatsappQueueReport']=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x10c'));db[_0xd58f('0x10d')]=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xd58f('0x10e')]=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/whatsappQueue/whatsappQueue.model');db[_0xd58f('0x10f')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x110'));db[_0xd58f('0x111')]=db[_0xd58f('0x1')][_0xd58f('0x15')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xd58f('0x112')]=db[_0xd58f('0x1')]['import'](_0xd58f('0x113'));db[_0xd58f('0x114')]=db[_0xd58f('0x1')][_0xd58f('0x15')](_0xd58f('0x115'));db[_0xd58f('0x116')]=db['sequelize'][_0xd58f('0x15')](_0xd58f('0x117'));db[_0xd58f('0x12')][_0xd58f('0x118')](db['VoiceMail'],{'as':_0xd58f('0x22'),'onDelete':'cascade','foreignKey':'UserId'});db[_0xd58f('0x12')][_0xd58f('0x118')](db['UserSetting'],{'as':_0xd58f('0x119'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x11b')});db['User']['hasMany'](db[_0xd58f('0x1e')],{'as':_0xd58f('0x11c'),'foreignKey':_0xd58f('0x11b')});db[_0xd58f('0x12')][_0xd58f('0x11d')](db[_0xd58f('0x33')],{'as':_0xd58f('0x11e'),'foreignKey':'UserId'});db['User'][_0xd58f('0x11d')](db['VoiceExtension'],{'as':_0xd58f('0x11f'),'onDelete':_0xd58f('0x11a'),'hooks':!![]});db['User'][_0xd58f('0x11d')](db[_0xd58f('0x7b')],{'as':_0xd58f('0x120'),'foreignKey':'UserId'});db[_0xd58f('0x12')][_0xd58f('0x11d')](db['CmHopperHistory'],{'as':_0xd58f('0x121'),'foreignKey':'UserId'});db['User'][_0xd58f('0x11d')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xd58f('0x11b')});db[_0xd58f('0x12')]['hasMany'](db[_0xd58f('0x63')],{'as':_0xd58f('0x122'),'foreignKey':'UserId'});db[_0xd58f('0x12')][_0xd58f('0x11d')](db[_0xd58f('0x6d')],{'as':_0xd58f('0x123'),'foreignKey':'UserId'});db['User'][_0xd58f('0x11d')](db[_0xd58f('0x5b')],{'as':_0xd58f('0x124'),'foreignKey':_0xd58f('0x11b')});db['User']['hasMany'](db[_0xd58f('0x53')],{'as':_0xd58f('0x125'),'foreignKey':_0xd58f('0x11b')});db[_0xd58f('0x12')][_0xd58f('0x11d')](db[_0xd58f('0x46')],{'as':'MailInteractions','foreignKey':_0xd58f('0x11b')});db['User'][_0xd58f('0x11d')](db[_0xd58f('0x108')],{'as':_0xd58f('0x126'),'foreignKey':_0xd58f('0x11b')});db['User'][_0xd58f('0x11d')](db[_0xd58f('0x102')],{'as':'UserNotifications','foreignKey':_0xd58f('0x127')});db[_0xd58f('0x12')][_0xd58f('0x128')](db[_0xd58f('0xff')],{'as':_0xd58f('0xff'),'foreignKey':_0xd58f('0x129')});db[_0xd58f('0x12')]['belongsToMany'](db['ChatGroup'],{'as':_0xd58f('0x12a'),'through':'chat_group_has_users'});db['User']['belongsToMany'](db['CmContact'],{'as':_0xd58f('0x12b'),'through':_0xd58f('0x12c')});db[_0xd58f('0x12')][_0xd58f('0x12d')](db[_0xd58f('0xfb')],{'as':'Lists','through':_0xd58f('0x12e')});db[_0xd58f('0x12')][_0xd58f('0x12d')](db[_0xd58f('0xe7')],{'through':'user_has_teams'});db[_0xd58f('0x12')][_0xd58f('0x12d')](db[_0xd58f('0x46')],{'as':_0xd58f('0x12f'),'through':_0xd58f('0x130')});db[_0xd58f('0x12')]['belongsToMany'](db['ChatInteraction'],{'as':'ChatInteractions','through':_0xd58f('0x131')});db[_0xd58f('0x12')]['belongsToMany'](db['FaxInteraction'],{'as':'FaxInteractions','through':_0xd58f('0x132')});db[_0xd58f('0x12')][_0xd58f('0x12d')](db[_0xd58f('0x5b')],{'as':_0xd58f('0x124'),'through':_0xd58f('0x133')});db[_0xd58f('0x12')]['belongsToMany'](db[_0xd58f('0x63')],{'as':_0xd58f('0x122'),'through':'user_has_openchannel_interactions'});db[_0xd58f('0x12')]['belongsToMany'](db[_0xd58f('0x108')],{'as':'WhatsappInteractions','through':_0xd58f('0x134')});db['User'][_0xd58f('0x12d')](db[_0xd58f('0x135')],{'as':_0xd58f('0x136'),'through':_0xd58f('0x34'),'required':![]});db[_0xd58f('0x12')][_0xd58f('0x12d')](db[_0xd58f('0xfd')],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db['User'][_0xd58f('0x12d')](db[_0xd58f('0x43')],{'as':_0xd58f('0x137'),'through':'UserMailQueue','required':![]});db['User'][_0xd58f('0x12d')](db[_0xd58f('0x138')],{'as':_0xd58f('0x139'),'through':_0xd58f('0x36'),'required':![],'hooks':!![]});db[_0xd58f('0x12')]['belongsToMany'](db[_0xd58f('0x57')],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0xd58f('0x12')]['belongsToMany'](db[_0xd58f('0x5f')],{'as':'SmsQueues','through':_0xd58f('0x3c'),'required':![]});db[_0xd58f('0x12')][_0xd58f('0x12d')](db[_0xd58f('0x67')],{'as':_0xd58f('0x13a'),'through':_0xd58f('0x13b'),'required':![]});db[_0xd58f('0x12')]['belongsToMany'](db[_0xd58f('0x10e')],{'as':_0xd58f('0x13c'),'through':_0xd58f('0x3e'),'required':![]});db['User'][_0xd58f('0x12d')](db[_0xd58f('0xfb')],{'through':_0xd58f('0x12e')});db[_0xd58f('0x12')]['belongsToMany'](db[_0xd58f('0x69')],{'as':_0xd58f('0x13d'),'through':_0xd58f('0x13e')});db[_0xd58f('0x12')][_0xd58f('0x12d')](db['FaxAccount'],{'as':_0xd58f('0x13f'),'through':'user_has_fax_accounts'});db[_0xd58f('0x12')][_0xd58f('0x12d')](db[_0xd58f('0x140')],{'as':_0xd58f('0x141'),'through':_0xd58f('0x142')});db['User'][_0xd58f('0x12d')](db[_0xd58f('0x61')],{'as':_0xd58f('0x143'),'through':'user_has_openchannel_accounts'});db[_0xd58f('0x12')][_0xd58f('0x12d')](db[_0xd58f('0x144')],{'as':_0xd58f('0x145'),'through':'user_has_sms_accounts'});db['User']['belongsToMany'](db[_0xd58f('0x104')],{'as':_0xd58f('0x146'),'through':_0xd58f('0x147')});db['VoiceChanSpy'][_0xd58f('0x11d')](db[_0xd58f('0x19')],{'as':_0xd58f('0x148'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x149')});db[_0xd58f('0x17')][_0xd58f('0x11d')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0xd58f('0x19')][_0xd58f('0x11d')](db[_0xd58f('0x19')],{'as':_0xd58f('0x14a'),'onDelete':_0xd58f('0x11a')});db[_0xd58f('0x1b')]['belongsToMany'](db[_0xd58f('0x14b')],{'as':'Sounds','through':'moh_has_sounds'});db[_0xd58f('0x135')][_0xd58f('0x11d')](db[_0xd58f('0x33')],{'as':_0xd58f('0x14c'),'foreignKey':'VoiceQueueId'});db[_0xd58f('0x135')][_0xd58f('0x11d')](db[_0xd58f('0x14d')],{'as':_0xd58f('0x14e'),'foreignKey':_0xd58f('0x14f')});db[_0xd58f('0x135')][_0xd58f('0x11d')](db[_0xd58f('0x7b')],{'as':_0xd58f('0x120'),'foreignKey':_0xd58f('0x14f')});db['VoiceQueue'][_0xd58f('0x11d')](db[_0xd58f('0x7d')],{'as':'HopperHistories','foreignKey':_0xd58f('0x14f')});db[_0xd58f('0x135')]['hasMany'](db['ReportAgentPreview'],{'as':_0xd58f('0x150'),'foreignKey':_0xd58f('0x14f')});db[_0xd58f('0x135')][_0xd58f('0x11d')](db[_0xd58f('0x79')],{'as':_0xd58f('0x151'),'foreignKey':_0xd58f('0x14f')});db[_0xd58f('0x135')]['hasMany'](db[_0xd58f('0x152')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0xd58f('0x135')]['belongsTo'](db['Trunk'],{'as':_0xd58f('0x30'),'foreignKey':_0xd58f('0x153')});db[_0xd58f('0x135')][_0xd58f('0x128')](db[_0xd58f('0x30')],{'as':_0xd58f('0x154'),'foreignKey':_0xd58f('0x155')});db[_0xd58f('0x135')][_0xd58f('0x128')](db['Interval'],{'as':_0xd58f('0x156'),'foreignKey':'IntervalId'});db[_0xd58f('0x135')][_0xd58f('0x128')](db[_0xd58f('0x87')],{'as':_0xd58f('0x157'),'foreignKey':_0xd58f('0x158')});db[_0xd58f('0x135')][_0xd58f('0x12d')](db[_0xd58f('0xfb')],{'as':_0xd58f('0x159'),'through':_0xd58f('0x15a')});db[_0xd58f('0x135')][_0xd58f('0x12d')](db['User'],{'as':_0xd58f('0x15b'),'through':_0xd58f('0x34')});db[_0xd58f('0x135')][_0xd58f('0x12d')](db[_0xd58f('0xe7')],{'as':_0xd58f('0x15c'),'through':'TeamVoiceQueue'});db[_0xd58f('0x135')][_0xd58f('0x12d')](db['CmList'],{'as':'BlackLists','through':_0xd58f('0x15d')});db[_0xd58f('0x1e')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'as':_0xd58f('0x12'),'foreignKey':_0xd58f('0x11b')});db['ScreenRecording']['belongsTo'](db['User'],{'as':_0xd58f('0x12'),'foreignKey':'UserId'});db[_0xd58f('0x22')][_0xd58f('0x11d')](db[_0xd58f('0x24')],{'as':'Messages','onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x15e'),'sourceKey':_0xd58f('0x15f')});db[_0xd58f('0x24')][_0xd58f('0x128')](db['VoiceMail'],{'foreignKey':_0xd58f('0x15e'),'targetKey':_0xd58f('0x15f')});db[_0xd58f('0x26')][_0xd58f('0x11d')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0xd58f('0x160'),'constraints':![]});db[_0xd58f('0x26')]['hasMany'](db[_0xd58f('0x2a')],{'as':_0xd58f('0x161'),'foreignKey':_0xd58f('0x160'),'constraints':![]});db[_0xd58f('0x26')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'as':_0xd58f('0x12'),'foreignKey':_0xd58f('0x11b')});db[_0xd58f('0x26')][_0xd58f('0x128')](db[_0xd58f('0x162')],{'as':'Contact','foreignKey':'ContactId'});db[_0xd58f('0x163')][_0xd58f('0x128')](db[_0xd58f('0x140')],{'as':_0xd58f('0x140'),'foreignKey':_0xd58f('0x164')});db['MailServerIn'][_0xd58f('0x128')](db[_0xd58f('0x10f')],{'as':_0xd58f('0x10f'),'foreignKey':_0xd58f('0x165'),'onDelete':_0xd58f('0x166')});db['MailServerOut']['belongsTo'](db[_0xd58f('0x140')],{'as':'MailAccount','foreignKey':_0xd58f('0x164')});db[_0xd58f('0x40')][_0xd58f('0x128')](db[_0xd58f('0x10f')],{'as':_0xd58f('0x10f'),'foreignKey':'CloudProviderId','onDelete':_0xd58f('0x166')});db[_0xd58f('0x140')]['hasOne'](db[_0xd58f('0x163')],{'as':_0xd58f('0x167'),'onDelete':_0xd58f('0x11a')});db['MailAccount'][_0xd58f('0x118')](db['MailServerOut'],{'as':_0xd58f('0x168'),'onDelete':'cascade'});db['MailAccount']['hasMany'](db['Disposition'],{'as':_0xd58f('0x169'),'foreignKey':_0xd58f('0x164'),'onDelete':_0xd58f('0x11a')});db[_0xd58f('0x140')][_0xd58f('0x11d')](db['CannedAnswer'],{'as':_0xd58f('0x16a'),'foreignKey':_0xd58f('0x164')});db[_0xd58f('0x140')]['hasMany'](db[_0xd58f('0x48')],{'as':_0xd58f('0x16b'),'foreignKey':_0xd58f('0x164')});db[_0xd58f('0x140')][_0xd58f('0x11d')](db[_0xd58f('0x46')],{'as':_0xd58f('0x16c')});db['MailAccount'][_0xd58f('0x11d')](db[_0xd58f('0x4a')],{'as':'Applications'});db['MailAccount'][_0xd58f('0x128')](db['CmList'],{'as':_0xd58f('0x16d'),'foreignKey':_0xd58f('0x16e')});db[_0xd58f('0x140')][_0xd58f('0x128')](db['Template'],{'as':_0xd58f('0x16f'),'foreignKey':_0xd58f('0x170')});db[_0xd58f('0x140')][_0xd58f('0x128')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xd58f('0x158')});db[_0xd58f('0x140')][_0xd58f('0x12d')](db[_0xd58f('0x12')],{'as':_0xd58f('0x15b'),'through':'user_has_mail_accounts'});db['MailQueue'][_0xd58f('0x12d')](db[_0xd58f('0x12')],{'as':_0xd58f('0x15b'),'through':_0xd58f('0x38')});db[_0xd58f('0x43')][_0xd58f('0x12d')](db[_0xd58f('0xe7')],{'through':_0xd58f('0x171'),'as':_0xd58f('0x15c')});db['MailInteraction']['hasMany'](db[_0xd58f('0x48')],{'as':_0xd58f('0x16b'),'onDelete':'cascade','foreignKey':_0xd58f('0x172')});db[_0xd58f('0x46')]['belongsTo'](db[_0xd58f('0x140')],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x164')});db[_0xd58f('0x46')][_0xd58f('0x128')](db[_0xd58f('0x162')],{'as':_0xd58f('0x174'),'foreignKey':_0xd58f('0x175')});db[_0xd58f('0x46')][_0xd58f('0x128')](db['User'],{'as':'Owner','foreignKey':_0xd58f('0x11b')});db[_0xd58f('0x46')][_0xd58f('0x12d')](db[_0xd58f('0x8e')],{'through':_0xd58f('0x176'),'as':_0xd58f('0x177')});db[_0xd58f('0x46')][_0xd58f('0x12d')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xd58f('0x178')});db[_0xd58f('0x46')][_0xd58f('0x12d')](db['User'],{'as':_0xd58f('0x179'),'through':_0xd58f('0x130'),'foreignKey':_0xd58f('0x172')});db[_0xd58f('0x48')]['hasMany'](db['Attachment'],{'as':_0xd58f('0x17a'),'onDelete':_0xd58f('0x11a')});db['MailMessage'][_0xd58f('0x128')](db['User'],{'as':'User'});db[_0xd58f('0x48')][_0xd58f('0x128')](db['CmContact'],{'onDelete':_0xd58f('0x11a'),'as':'Contact'});db[_0xd58f('0x48')][_0xd58f('0x128')](db['MailInteraction'],{'as':_0xd58f('0x17b'),'foreignKey':_0xd58f('0x172')});db['MailMessage']['belongsTo'](db[_0xd58f('0x140')],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x164')});db[_0xd58f('0x48')][_0xd58f('0x128')](db[_0xd58f('0x69')],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db[_0xd58f('0x48')][_0xd58f('0x128')](db[_0xd58f('0x17c')],{'as':_0xd58f('0x17c'),'foreignKey':'ChatOfflineMessageId'});db[_0xd58f('0x4a')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'onDelete':_0xd58f('0x166')});db[_0xd58f('0x4a')]['belongsTo'](db[_0xd58f('0x43')],{'onDelete':'restrict'});db[_0xd58f('0x4a')]['belongsTo'](db['MailAccount'],{'onDelete':_0xd58f('0x166')});db[_0xd58f('0x4a')][_0xd58f('0x128')](db[_0xd58f('0x156')],{'onDelete':'restrict','foreignKey':_0xd58f('0x17d')});db['MailApplication']['belongsTo'](db[_0xd58f('0x8e')],{'onDelete':_0xd58f('0x166'),'foreignKey':_0xd58f('0x17e')});db['MailQueueReport'][_0xd58f('0x128')](db[_0xd58f('0x140')],{});db[_0xd58f('0x4c')][_0xd58f('0x128')](db[_0xd58f('0xfb')],{'as':'List','foreignKey':_0xd58f('0x16e')});db[_0xd58f('0x4c')]['belongsTo'](db[_0xd58f('0x162')],{'as':_0xd58f('0x174'),'foreignKey':_0xd58f('0x175')});db['MailQueueReport'][_0xd58f('0x128')](db[_0xd58f('0x46')],{});db['MailQueueReport'][_0xd58f('0x128')](db[_0xd58f('0x48')],{});db[_0xd58f('0x4c')]['belongsTo'](db[_0xd58f('0x12')],{});db[_0xd58f('0x4c')]['belongsTo'](db[_0xd58f('0x43')],{});db[_0xd58f('0x17f')][_0xd58f('0x11d')](db[_0xd58f('0x4e')],{'as':_0xd58f('0x180'),'onDelete':'cascade'});db['FaxAccount'][_0xd58f('0x11d')](db[_0xd58f('0x181')],{'as':_0xd58f('0x169'),'foreignKey':_0xd58f('0x182'),'onDelete':_0xd58f('0x11a')});db['FaxAccount'][_0xd58f('0x11d')](db['CannedAnswer'],{'as':_0xd58f('0x16a'),'foreignKey':_0xd58f('0x182')});db[_0xd58f('0x183')][_0xd58f('0x11d')](db[_0xd58f('0x53')],{'as':_0xd58f('0x16c')});db[_0xd58f('0x183')][_0xd58f('0x11d')](db[_0xd58f('0x51')],{'as':_0xd58f('0x14a')});db[_0xd58f('0x183')]['hasMany'](db[_0xd58f('0x19')],{'as':_0xd58f('0x184'),'onDelete':_0xd58f('0x11a')});db[_0xd58f('0x183')][_0xd58f('0x11d')](db[_0xd58f('0x55')],{'as':_0xd58f('0x16b')});db[_0xd58f('0x183')]['belongsTo'](db[_0xd58f('0x30')],{'as':_0xd58f('0x30')});db[_0xd58f('0x183')][_0xd58f('0x128')](db[_0xd58f('0xfb')],{'as':_0xd58f('0x16d'),'foreignKey':'ListId'});db[_0xd58f('0x183')][_0xd58f('0x128')](db[_0xd58f('0x87')],{'as':_0xd58f('0x157'),'foreignKey':_0xd58f('0x158')});db['FaxAccount'][_0xd58f('0x12d')](db[_0xd58f('0x12')],{'as':_0xd58f('0x15b'),'through':_0xd58f('0x185')});db[_0xd58f('0x51')]['belongsTo'](db[_0xd58f('0x12')],{'onDelete':_0xd58f('0x166')});db['FaxApplication'][_0xd58f('0x128')](db[_0xd58f('0x57')],{'onDelete':_0xd58f('0x166')});db[_0xd58f('0x51')][_0xd58f('0x128')](db['FaxAccount'],{'onDelete':_0xd58f('0x166')});db[_0xd58f('0x51')][_0xd58f('0x128')](db[_0xd58f('0x8e')],{'onDelete':_0xd58f('0x166'),'foreignKey':_0xd58f('0x17e')});db[_0xd58f('0x53')][_0xd58f('0x11d')](db['FaxMessage'],{'as':_0xd58f('0x16b'),'onDelete':'cascade','foreignKey':_0xd58f('0x186')});db[_0xd58f('0x53')][_0xd58f('0x128')](db[_0xd58f('0x183')],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x182')});db[_0xd58f('0x53')][_0xd58f('0x128')](db['CmContact'],{'as':_0xd58f('0x174'),'foreignKey':_0xd58f('0x175')});db[_0xd58f('0x53')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0xd58f('0x53')]['belongsToMany'](db[_0xd58f('0x8e')],{'through':_0xd58f('0x187'),'as':'Tags'});db[_0xd58f('0x53')][_0xd58f('0x12d')](db[_0xd58f('0x8e')],{'through':_0xd58f('0x187'),'as':'ThroughTags'});db[_0xd58f('0x53')]['belongsToMany'](db[_0xd58f('0x12')],{'as':'Users','through':'user_has_fax_interactions','foreignKey':_0xd58f('0x186')});db[_0xd58f('0x55')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'onDelete':_0xd58f('0x11a'),'as':'User'});db[_0xd58f('0x55')][_0xd58f('0x128')](db['FaxInteraction'],{'as':_0xd58f('0x17b'),'foreignKey':_0xd58f('0x186')});db[_0xd58f('0x55')]['belongsTo'](db['CmContact'],{'onDelete':_0xd58f('0x11a'),'as':_0xd58f('0x174')});db[_0xd58f('0x55')][_0xd58f('0x128')](db[_0xd58f('0xee')],{'as':_0xd58f('0xee'),'foreignKey':_0xd58f('0x188')});db[_0xd58f('0x55')][_0xd58f('0x128')](db['FaxAccount'],{'as':'Account','foreignKey':_0xd58f('0x182')});db[_0xd58f('0x57')][_0xd58f('0x12d')](db[_0xd58f('0x12')],{'as':_0xd58f('0x15b'),'through':_0xd58f('0x3a')});db[_0xd58f('0x57')][_0xd58f('0x12d')](db[_0xd58f('0xe7')],{'through':_0xd58f('0x189'),'as':_0xd58f('0x15c')});db[_0xd58f('0x59')][_0xd58f('0x128')](db[_0xd58f('0x183')],{});db[_0xd58f('0x59')][_0xd58f('0x128')](db[_0xd58f('0xfb')],{'as':'List','foreignKey':_0xd58f('0x16e')});db[_0xd58f('0x59')][_0xd58f('0x128')](db['CmContact'],{'as':_0xd58f('0x174'),'foreignKey':_0xd58f('0x175')});db[_0xd58f('0x59')][_0xd58f('0x128')](db[_0xd58f('0x53')],{});db[_0xd58f('0x59')][_0xd58f('0x128')](db[_0xd58f('0x55')],{});db[_0xd58f('0x59')][_0xd58f('0x128')](db['User'],{});db[_0xd58f('0x59')][_0xd58f('0x128')](db['FaxQueue'],{});db[_0xd58f('0x144')]['hasMany'](db[_0xd58f('0x181')],{'as':_0xd58f('0x169'),'foreignKey':_0xd58f('0x18a'),'onDelete':_0xd58f('0x11a')});db[_0xd58f('0x144')][_0xd58f('0x11d')](db[_0xd58f('0x82')],{'as':_0xd58f('0x16a'),'foreignKey':_0xd58f('0x18a')});db[_0xd58f('0x144')][_0xd58f('0x11d')](db[_0xd58f('0x5d')],{'as':'Messages','foreignKey':'SmsAccountId'});db['SmsAccount']['hasMany'](db[_0xd58f('0x5b')],{'as':_0xd58f('0x16c')});db[_0xd58f('0x144')][_0xd58f('0x11d')](db[_0xd58f('0x18b')],{'as':_0xd58f('0x14a')});db[_0xd58f('0x144')][_0xd58f('0x128')](db[_0xd58f('0xfb')],{'as':_0xd58f('0x16d'),'foreignKey':_0xd58f('0x16e')});db[_0xd58f('0x144')][_0xd58f('0x128')](db[_0xd58f('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0xd58f('0x158')});db['SmsAccount'][_0xd58f('0x12d')](db['User'],{'as':_0xd58f('0x15b'),'through':_0xd58f('0x18c')});db[_0xd58f('0x18b')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'onDelete':'restrict'});db[_0xd58f('0x18b')][_0xd58f('0x128')](db[_0xd58f('0x5f')],{'onDelete':_0xd58f('0x166')});db['SmsApplication'][_0xd58f('0x128')](db[_0xd58f('0x144')],{'onDelete':_0xd58f('0x166')});db[_0xd58f('0x18b')][_0xd58f('0x128')](db[_0xd58f('0x156')],{'onDelete':_0xd58f('0x166'),'foreignKey':'IntervalId'});db[_0xd58f('0x18b')]['belongsTo'](db[_0xd58f('0x8e')],{'onDelete':_0xd58f('0x166'),'foreignKey':_0xd58f('0x17e')});db[_0xd58f('0x5b')]['hasMany'](db['SmsMessage'],{'as':_0xd58f('0x16b'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0xd58f('0x5b')][_0xd58f('0x128')](db[_0xd58f('0x144')],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x18a')});db[_0xd58f('0x5b')]['belongsTo'](db[_0xd58f('0x162')],{'as':_0xd58f('0x174'),'foreignKey':_0xd58f('0x175')});db[_0xd58f('0x5b')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'as':'Owner','foreignKey':_0xd58f('0x11b')});db[_0xd58f('0x5b')][_0xd58f('0x12d')](db[_0xd58f('0x8e')],{'through':_0xd58f('0x18d'),'as':_0xd58f('0x177')});db[_0xd58f('0x5b')][_0xd58f('0x12d')](db[_0xd58f('0x8e')],{'through':_0xd58f('0x18d'),'as':'ThroughTags'});db['SmsInteraction']['belongsToMany'](db[_0xd58f('0x12')],{'as':_0xd58f('0x179'),'through':_0xd58f('0x133'),'foreignKey':_0xd58f('0x18e')});db[_0xd58f('0x5d')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'as':'User'});db['SmsMessage']['belongsTo'](db[_0xd58f('0x162')],{'onDelete':_0xd58f('0x11a'),'as':_0xd58f('0x174')});db[_0xd58f('0x5d')]['belongsTo'](db[_0xd58f('0x5b')],{'onDelete':'cascade','as':_0xd58f('0x17b'),'foreignKey':_0xd58f('0x18e')});db['SmsMessage'][_0xd58f('0x128')](db['SmsAccount'],{'as':_0xd58f('0x173'),'foreignKey':'SmsAccountId'});db[_0xd58f('0x5f')][_0xd58f('0x12d')](db[_0xd58f('0x12')],{'as':_0xd58f('0x15b'),'through':_0xd58f('0x3c'),'foreignKey':'SmsQueueId'});db[_0xd58f('0x5f')][_0xd58f('0x12d')](db[_0xd58f('0xe7')],{'through':'team_has_sms_queues','as':_0xd58f('0x15c')});db[_0xd58f('0x61')][_0xd58f('0x11d')](db[_0xd58f('0x181')],{'as':_0xd58f('0x169'),'foreignKey':_0xd58f('0x18f'),'onDelete':_0xd58f('0x11a')});db[_0xd58f('0x61')]['hasMany'](db['CannedAnswer'],{'as':_0xd58f('0x16a'),'foreignKey':_0xd58f('0x18f')});db['OpenchannelAccount'][_0xd58f('0x11d')](db[_0xd58f('0x63')],{'as':_0xd58f('0x16c'),'foreignKey':'OpenchannelAccountId'});db[_0xd58f('0x61')]['hasMany'](db[_0xd58f('0x65')],{'as':'Messages','foreignKey':_0xd58f('0x18f')});db['OpenchannelAccount'][_0xd58f('0x11d')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0xd58f('0x18f')});db[_0xd58f('0x61')][_0xd58f('0x128')](db[_0xd58f('0xfb')],{'as':_0xd58f('0x16d'),'foreignKey':'ListId'});db[_0xd58f('0x61')][_0xd58f('0x128')](db[_0xd58f('0x87')],{'as':_0xd58f('0x157'),'foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount'][_0xd58f('0x12d')](db['User'],{'as':_0xd58f('0x15b'),'through':_0xd58f('0x190')});db['OpenchannelApplication'][_0xd58f('0x128')](db[_0xd58f('0x12')],{'onDelete':_0xd58f('0x166')});db[_0xd58f('0x191')][_0xd58f('0x128')](db['OpenchannelQueue'],{'onDelete':_0xd58f('0x166'),'foreignKey':_0xd58f('0x192')});db[_0xd58f('0x191')][_0xd58f('0x128')](db[_0xd58f('0x61')],{'onDelete':'restrict','foreignKey':_0xd58f('0x18f')});db[_0xd58f('0x191')][_0xd58f('0x128')](db['Interval'],{'onDelete':_0xd58f('0x166'),'foreignKey':'IntervalId'});db[_0xd58f('0x191')][_0xd58f('0x128')](db[_0xd58f('0x8e')],{'onDelete':_0xd58f('0x166'),'foreignKey':_0xd58f('0x17e')});db[_0xd58f('0x63')][_0xd58f('0x11d')](db[_0xd58f('0x65')],{'as':_0xd58f('0x16b'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x193')});db['OpenchannelInteraction'][_0xd58f('0x128')](db['OpenchannelAccount'],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x18f')});db[_0xd58f('0x63')][_0xd58f('0x128')](db[_0xd58f('0x162')],{'as':_0xd58f('0x174'),'foreignKey':'ContactId'});db['OpenchannelInteraction']['belongsTo'](db[_0xd58f('0x12')],{'as':_0xd58f('0x194'),'foreignKey':'UserId'});db[_0xd58f('0x63')][_0xd58f('0x12d')](db[_0xd58f('0x8e')],{'through':_0xd58f('0x195'),'as':'Tags'});db[_0xd58f('0x63')][_0xd58f('0x12d')](db[_0xd58f('0x8e')],{'through':_0xd58f('0x195'),'as':_0xd58f('0x178')});db[_0xd58f('0x63')]['belongsToMany'](db[_0xd58f('0x12')],{'as':_0xd58f('0x179'),'through':_0xd58f('0x196'),'foreignKey':_0xd58f('0x193')});db[_0xd58f('0x65')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'onDelete':_0xd58f('0x11a'),'as':_0xd58f('0x12')});db['OpenchannelMessage'][_0xd58f('0x128')](db[_0xd58f('0x162')],{'onDelete':_0xd58f('0x11a'),'as':'Contact'});db['OpenchannelMessage']['belongsTo'](db[_0xd58f('0x63')],{'onDelete':_0xd58f('0x11a'),'as':'Interaction','foreignKey':_0xd58f('0x193')});db[_0xd58f('0x65')][_0xd58f('0x128')](db['Attachment'],{'as':_0xd58f('0xee'),'foreignKey':'AttachmentId'});db['OpenchannelMessage'][_0xd58f('0x128')](db[_0xd58f('0x61')],{'as':_0xd58f('0x173'),'foreignKey':'OpenchannelAccountId'});db[_0xd58f('0x67')][_0xd58f('0x12d')](db['User'],{'as':_0xd58f('0x15b'),'through':_0xd58f('0x13b'),'foreignKey':_0xd58f('0x192')});db[_0xd58f('0x67')][_0xd58f('0x12d')](db[_0xd58f('0xe7')],{'through':'team_has_openchannel_queues','as':_0xd58f('0x15c')});db[_0xd58f('0x69')]['hasMany'](db[_0xd58f('0x181')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0xd58f('0x11a')});db[_0xd58f('0x69')]['hasMany'](db[_0xd58f('0x82')],{'as':'Answers','foreignKey':_0xd58f('0x197')});db[_0xd58f('0x69')][_0xd58f('0x11d')](db[_0xd58f('0x74')],{'as':_0xd58f('0x198')});db[_0xd58f('0x69')][_0xd58f('0x11d')](db[_0xd58f('0x6d')],{'as':_0xd58f('0x16c')});db[_0xd58f('0x69')][_0xd58f('0x11d')](db[_0xd58f('0x199')],{'as':_0xd58f('0x14a')});db[_0xd58f('0x69')][_0xd58f('0x11d')](db[_0xd58f('0x6f')],{'as':_0xd58f('0x16b')});db[_0xd58f('0x69')]['belongsTo'](db[_0xd58f('0xfb')],{'as':_0xd58f('0x16d'),'foreignKey':_0xd58f('0x16e')});db[_0xd58f('0x69')]['belongsTo'](db[_0xd58f('0x156')],{'as':_0xd58f('0x156'),'foreignKey':_0xd58f('0x17d')});db[_0xd58f('0x69')][_0xd58f('0x128')](db['MailAccount'],{'as':_0xd58f('0x140'),'foreignKey':'MailAccountId'});db['ChatWebsite'][_0xd58f('0x128')](db[_0xd58f('0x87')],{'as':_0xd58f('0x157'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0xd58f('0x12d')](db[_0xd58f('0x12')],{'as':_0xd58f('0x15b'),'through':_0xd58f('0x13e')});db[_0xd58f('0x19a')]['belongsTo'](db['OpenchannelAccount'],{});db[_0xd58f('0x19a')][_0xd58f('0x128')](db[_0xd58f('0xfb')],{'as':'List','foreignKey':_0xd58f('0x16e')});db[_0xd58f('0x19a')]['belongsTo'](db[_0xd58f('0x162')],{'as':_0xd58f('0x174'),'foreignKey':_0xd58f('0x175')});db[_0xd58f('0x19a')][_0xd58f('0x128')](db[_0xd58f('0x63')],{});db[_0xd58f('0x19a')][_0xd58f('0x128')](db[_0xd58f('0x65')],{});db[_0xd58f('0x19a')][_0xd58f('0x128')](db[_0xd58f('0x12')],{});db[_0xd58f('0x19a')][_0xd58f('0x128')](db['OpenchannelQueue'],{});db[_0xd58f('0x199')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'as':'Agent','foreignKey':_0xd58f('0x11b'),'onDelete':'restrict'});db[_0xd58f('0x199')][_0xd58f('0x128')](db[_0xd58f('0x138')],{'as':_0xd58f('0x19b'),'foreignKey':_0xd58f('0x19c'),'onDelete':'restrict'});db[_0xd58f('0x199')]['belongsTo'](db[_0xd58f('0x69')],{'as':_0xd58f('0x19d'),'foreignKey':_0xd58f('0x197'),'onDelete':_0xd58f('0x166')});db[_0xd58f('0x199')][_0xd58f('0x128')](db['Tag'],{'onDelete':_0xd58f('0x166'),'foreignKey':'TagId'});db['ChatInteraction'][_0xd58f('0x11d')](db[_0xd58f('0x6f')],{'as':_0xd58f('0x16b'),'onDelete':_0xd58f('0x11a'),'foreignKey':'ChatInteractionId'});db[_0xd58f('0x6d')]['belongsTo'](db[_0xd58f('0x69')],{'as':'Account','foreignKey':_0xd58f('0x197')});db[_0xd58f('0x6d')]['belongsTo'](db[_0xd58f('0x162')],{'as':_0xd58f('0x174'),'foreignKey':_0xd58f('0x175')});db[_0xd58f('0x6d')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'as':_0xd58f('0x194'),'foreignKey':_0xd58f('0x11b')});db[_0xd58f('0x6d')][_0xd58f('0x12d')](db[_0xd58f('0x8e')],{'through':_0xd58f('0x19e'),'as':_0xd58f('0x177')});db[_0xd58f('0x6d')]['belongsToMany'](db[_0xd58f('0x8e')],{'through':'chat_interaction_has_tags','as':_0xd58f('0x178')});db[_0xd58f('0x6d')]['belongsToMany'](db[_0xd58f('0x12')],{'as':_0xd58f('0x179'),'through':'user_has_chat_interactions','foreignKey':_0xd58f('0x19f')});db[_0xd58f('0x6f')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'onDelete':_0xd58f('0x11a'),'as':_0xd58f('0x12')});db[_0xd58f('0x6f')]['belongsTo'](db[_0xd58f('0x162')],{'onDelete':_0xd58f('0x11a'),'as':'Contact','foreignKey':_0xd58f('0x175')});db[_0xd58f('0x6f')][_0xd58f('0x128')](db[_0xd58f('0x6d')],{'onDelete':_0xd58f('0x11a'),'as':_0xd58f('0x17b'),'foreignKey':'ChatInteractionId'});db[_0xd58f('0x6f')][_0xd58f('0x128')](db[_0xd58f('0xee')],{'as':'Attachment','foreignKey':_0xd58f('0x188')});db[_0xd58f('0x6f')][_0xd58f('0x128')](db[_0xd58f('0x69')],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x197')});db[_0xd58f('0x17c')][_0xd58f('0x11d')](db[_0xd58f('0xee')],{'as':'Attachments','foreignKey':_0xd58f('0x1a0'),'onDelete':_0xd58f('0x11a'),'hooks':!![]});db[_0xd58f('0x17c')][_0xd58f('0x128')](db[_0xd58f('0x162')],{'onDelete':_0xd58f('0x11a'),'as':'Contact','foreignKey':_0xd58f('0x175')});db['ChatOfflineMessage'][_0xd58f('0x128')](db[_0xd58f('0x69')],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x197')});db['ChatQueue']['belongsToMany'](db[_0xd58f('0x12')],{'as':_0xd58f('0x15b'),'through':_0xd58f('0x36'),'hooks':!![]});db['ChatQueue'][_0xd58f('0x12d')](db[_0xd58f('0xe7')],{'through':_0xd58f('0x1a1'),'as':'Teams'});db[_0xd58f('0x72')][_0xd58f('0x11d')](db[_0xd58f('0xd5')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0xd58f('0x11a')});db[_0xd58f('0x72')][_0xd58f('0x12d')](db['User'],{'as':'Members','through':_0xd58f('0x1a2')});db['ChatProactiveAction']['belongsTo'](db[_0xd58f('0x69')],{'as':_0xd58f('0x19d'),'foreignKey':_0xd58f('0x197')});db[_0xd58f('0x76')]['hasMany'](db[_0xd58f('0x162')],{'as':_0xd58f('0x12b'),'foreignKey':_0xd58f('0x1a3')});db['CmContact'][_0xd58f('0x11d')](db['CmContactHasItem'],{'as':_0xd58f('0x1a4'),'foreignKey':_0xd58f('0x1a5')});db[_0xd58f('0x162')][_0xd58f('0x11d')](db[_0xd58f('0x14d')],{'as':_0xd58f('0x14e'),'foreignKey':_0xd58f('0x175')});db[_0xd58f('0x162')][_0xd58f('0x11d')](db[_0xd58f('0x7b')],{'as':'HopperFinals','foreignKey':_0xd58f('0x175')});db['CmContact'][_0xd58f('0x11d')](db[_0xd58f('0x7d')],{'as':_0xd58f('0x1a6'),'foreignKey':_0xd58f('0x175')});db['CmContact']['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xd58f('0x175')});db['CmContact'][_0xd58f('0x11d')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0xd58f('0x175')});db['CmContact'][_0xd58f('0x11d')](db[_0xd58f('0x63')],{'as':'OpenchannelInteractions','foreignKey':_0xd58f('0x175'),'onDelete':'restrict'});db[_0xd58f('0x162')][_0xd58f('0x11d')](db['ChatInteraction'],{'as':_0xd58f('0x123'),'foreignKey':'ContactId','onDelete':_0xd58f('0x166')});db[_0xd58f('0x162')]['hasMany'](db['SmsInteraction'],{'as':_0xd58f('0x124'),'foreignKey':_0xd58f('0x175'),'onDelete':_0xd58f('0x166')});db[_0xd58f('0x162')][_0xd58f('0x11d')](db['FaxInteraction'],{'as':_0xd58f('0x125'),'foreignKey':_0xd58f('0x175'),'onDelete':'restrict'});db[_0xd58f('0x162')][_0xd58f('0x11d')](db[_0xd58f('0x46')],{'as':_0xd58f('0x12f'),'foreignKey':_0xd58f('0x175'),'onDelete':_0xd58f('0x166')});db[_0xd58f('0x162')]['belongsTo'](db['CmCompany'],{'as':'Company','foreignKey':_0xd58f('0x1a3')});db[_0xd58f('0x162')][_0xd58f('0x128')](db['CmList'],{'as':_0xd58f('0x16d'),'foreignKey':_0xd58f('0x16e'),'onDelete':_0xd58f('0x11a')});db[_0xd58f('0x162')]['belongsToMany'](db['User'],{'as':_0xd58f('0x179'),'through':'cm_user_has_contacts'});db[_0xd58f('0x162')][_0xd58f('0x12d')](db[_0xd58f('0x8e')],{'as':_0xd58f('0x177'),'through':_0xd58f('0x1a7')});db[_0xd58f('0x162')]['belongsToMany'](db[_0xd58f('0x8e')],{'through':'cm_contact_has_tags','as':_0xd58f('0x178')});db['CmHopper'][_0xd58f('0x11d')](db[_0xd58f('0x92')],{'as':'AdditionalPhones','foreignKey':_0xd58f('0x1a8')});db[_0xd58f('0x14d')]['belongsTo'](db['CmContact'],{'as':_0xd58f('0x174'),'foreignKey':_0xd58f('0x175'),'onDelete':_0xd58f('0x11a')});db['CmHopper'][_0xd58f('0x128')](db[_0xd58f('0xfb')],{'as':_0xd58f('0x16d'),'foreignKey':_0xd58f('0x16e'),'onDelete':_0xd58f('0x11a')});db[_0xd58f('0x14d')][_0xd58f('0x128')](db['User'],{'as':_0xd58f('0x1a9'),'foreignKey':_0xd58f('0x11b')});db[_0xd58f('0x14d')]['belongsTo'](db['VoiceQueue'],{'as':_0xd58f('0x19b'),'foreignKey':_0xd58f('0x14f'),'onDelete':_0xd58f('0x11a')});db[_0xd58f('0x14d')][_0xd58f('0x128')](db['Campaign'],{'as':_0xd58f('0xea'),'foreignKey':'CampaignId','onDelete':_0xd58f('0x11a')});db[_0xd58f('0x14d')][_0xd58f('0x128')](db['User'],{'as':'Owner','foreignKey':_0xd58f('0x1aa')});db[_0xd58f('0x79')]['belongsTo'](db[_0xd58f('0x162')],{'as':_0xd58f('0x174'),'foreignKey':_0xd58f('0x175'),'onDelete':'cascade'});db[_0xd58f('0x79')][_0xd58f('0x128')](db['CmList'],{'as':_0xd58f('0x16d'),'foreignKey':_0xd58f('0x16e'),'onDelete':_0xd58f('0x11a')});db['CmHopperBlack'][_0xd58f('0x128')](db[_0xd58f('0x135')],{'as':'Queue','foreignKey':_0xd58f('0x14f'),'onDelete':_0xd58f('0x11a')});db[_0xd58f('0x79')]['belongsTo'](db[_0xd58f('0xea')],{'as':_0xd58f('0xea'),'foreignKey':_0xd58f('0x1ab'),'onDelete':'cascade'});db[_0xd58f('0x80')][_0xd58f('0x11d')](db['Condition'],{'as':{'plural':'All','singular':_0xd58f('0x1ac')},'foreignKey':_0xd58f('0x1ad'),'onDelete':_0xd58f('0x11a'),'hooks':!![]});db['Automation']['hasMany'](db[_0xd58f('0x85')],{'as':{'plural':_0xd58f('0x1ae'),'singular':_0xd58f('0x1af')},'foreignKey':_0xd58f('0x1b0'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xd58f('0x11d')](db[_0xd58f('0x1b1')],{'as':_0xd58f('0x1b2'),'foreignKey':_0xd58f('0x1b3'),'onDelete':'cascade','hooks':!![]});db['Disposition'][_0xd58f('0x11d')](db['Disposition'],{'as':_0xd58f('0x169'),'foreignKey':'ParentId','onDelete':_0xd58f('0x11a')});db[_0xd58f('0x156')][_0xd58f('0x11d')](db[_0xd58f('0x156')],{'as':_0xd58f('0x1b4'),'foreignKey':_0xd58f('0x17d'),'onDelete':_0xd58f('0x11a'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xd58f('0x19')],{'as':'Extensions','foreignKey':_0xd58f('0x17d'),'onDelete':_0xd58f('0x166')});db[_0xd58f('0x156')]['hasMany'](db[_0xd58f('0x4a')],{'as':_0xd58f('0x1b5'),'foreignKey':_0xd58f('0x17d')});db[_0xd58f('0x156')][_0xd58f('0x11d')](db['ChatApplication'],{'as':_0xd58f('0x1b6'),'foreignKey':_0xd58f('0x17d')});db[_0xd58f('0x156')][_0xd58f('0x11d')](db[_0xd58f('0x51')],{'as':_0xd58f('0x1b7'),'foreignKey':'IntervalId'});db[_0xd58f('0x156')][_0xd58f('0x11d')](db[_0xd58f('0x18b')],{'as':'SmsApplications','foreignKey':_0xd58f('0x17d')});db[_0xd58f('0x1b8')][_0xd58f('0x128')](db[_0xd58f('0x140')],{});db[_0xd58f('0x1b8')][_0xd58f('0x128')](db[_0xd58f('0x9e')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0xd58f('0x128')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db['Sound'][_0xd58f('0x12d')](db[_0xd58f('0x1b')],{'as':_0xd58f('0x1b9'),'through':'moh_has_sounds','onDelete':_0xd58f('0x166')});db[_0xd58f('0x8e')][_0xd58f('0x12d')](db[_0xd58f('0x162')],{'through':_0xd58f('0x1a7')});db[_0xd58f('0x8e')]['belongsToMany'](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db['Tag'][_0xd58f('0x12d')](db[_0xd58f('0x46')],{'through':_0xd58f('0x176')});db[_0xd58f('0x8e')][_0xd58f('0x12d')](db[_0xd58f('0x5b')],{'through':'sms_interaction_has_tags'});db['Tag'][_0xd58f('0x12d')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0xd58f('0x8e')][_0xd58f('0x12d')](db[_0xd58f('0x63')],{'through':_0xd58f('0x195')});db[_0xd58f('0x8e')][_0xd58f('0x12d')](db[_0xd58f('0x108')],{'through':_0xd58f('0x1ba')});db['CmContactHasItem'][_0xd58f('0x128')](db[_0xd58f('0x90')],{'as':'ItemType','foreignKey':'ItemTypeId'});db['CmHopperAdditionalPhone']['belongsTo'](db[_0xd58f('0x14d')],{'as':_0xd58f('0x1bb'),'foreignKey':_0xd58f('0x1a8')});db[_0xd58f('0x91')][_0xd58f('0x128')](db[_0xd58f('0x162')],{'as':_0xd58f('0x174'),'foreignKey':_0xd58f('0x1a5')});db[_0xd58f('0x94')][_0xd58f('0x11d')](db[_0xd58f('0x85')],{'as':{'plural':'AllConditions','singular':_0xd58f('0x1bc')},'foreignKey':'TriggerAllId','onDelete':_0xd58f('0x11a'),'hooks':!![]});db['Trigger']['hasMany'](db[_0xd58f('0x85')],{'as':{'plural':_0xd58f('0x1bd'),'singular':_0xd58f('0x1be')},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0xd58f('0x94')][_0xd58f('0x11d')](db[_0xd58f('0x1b1')],{'as':_0xd58f('0x1b2'),'foreignKey':_0xd58f('0x1bf'),'onDelete':_0xd58f('0x11a'),'hooks':!![]});db['AnalyticCustomReport'][_0xd58f('0x11d')](db['AnalyticFieldReport'],{'as':_0xd58f('0x1c0'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1c1'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db['AnalyticFieldReport'],{'as':_0xd58f('0x1c0'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1c2')});db[_0xd58f('0xa2')][_0xd58f('0x11d')](db[_0xd58f('0xa3')],{'as':'Fields','onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1c3')});db[_0xd58f('0xa3')][_0xd58f('0x128')](db[_0xd58f('0xa2')],{'foreignKey':_0xd58f('0x1c3')});db[_0xd58f('0xa7')][_0xd58f('0x11d')](db[_0xd58f('0xa8')],{'as':'Configurations','onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1c4')});db[_0xd58f('0xa8')][_0xd58f('0x11d')](db['SalesforceField'],{'as':_0xd58f('0x1c5'),'onDelete':_0xd58f('0x11a'),'foreignKey':'SubjectId'});db[_0xd58f('0xa8')][_0xd58f('0x11d')](db['SalesforceField'],{'as':_0xd58f('0x1c6'),'onDelete':_0xd58f('0x11a'),'foreignKey':'DescriptionId'});db[_0xd58f('0xa8')]['hasMany'](db[_0xd58f('0xaa')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xd58f('0x1c7')});db[_0xd58f('0xa8')][_0xd58f('0x128')](db[_0xd58f('0xa7')],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x1c4')});db[_0xd58f('0xaa')][_0xd58f('0x11d')](db[_0xd58f('0xaa')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xd58f('0xaa')]['hasMany'](db[_0xd58f('0xaa')],{'as':_0xd58f('0x1c8'),'foreignKey':_0xd58f('0x1c9')});db['SalesforceField'][_0xd58f('0x11d')](db['SalesforceField'],{'as':'Field','foreignKey':_0xd58f('0x1c7')});db[_0xd58f('0xaa')][_0xd58f('0x128')](db['Variable'],{'as':_0xd58f('0x96'),'foreignKey':_0xd58f('0x1ca')});db[_0xd58f('0xac')][_0xd58f('0x11d')](db[_0xd58f('0x1cb')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xd58f('0x1c4')});db[_0xd58f('0x1cb')][_0xd58f('0x11d')](db['SugarcrmField'],{'as':_0xd58f('0x1c5'),'onDelete':_0xd58f('0x11a'),'foreignKey':'SubjectId'});db[_0xd58f('0x1cb')][_0xd58f('0x11d')](db[_0xd58f('0xaf')],{'as':_0xd58f('0x1c6'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1c9')});db['SugarcrmConfiguration']['hasMany'](db[_0xd58f('0xaf')],{'as':_0xd58f('0x1c0'),'onDelete':_0xd58f('0x11a'),'foreignKey':'FieldId'});db[_0xd58f('0x1cb')]['belongsTo'](db[_0xd58f('0xac')],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x1c4')});db[_0xd58f('0xaf')][_0xd58f('0x11d')](db[_0xd58f('0xaf')],{'as':_0xd58f('0x1cc'),'foreignKey':_0xd58f('0x1cd')});db[_0xd58f('0xaf')][_0xd58f('0x11d')](db['SugarcrmField'],{'as':_0xd58f('0x1c8'),'foreignKey':'DescriptionId'});db[_0xd58f('0xaf')][_0xd58f('0x11d')](db[_0xd58f('0xaf')],{'as':'Field','foreignKey':_0xd58f('0x1c7')});db['SugarcrmField'][_0xd58f('0x128')](db['Variable'],{'as':_0xd58f('0x96'),'foreignKey':_0xd58f('0x1ca')});db[_0xd58f('0xb0')][_0xd58f('0x11d')](db[_0xd58f('0x1ce')],{'as':_0xd58f('0x1cf'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1c4')});db[_0xd58f('0x1ce')][_0xd58f('0x11d')](db[_0xd58f('0xb2')],{'as':'Subjects','onDelete':_0xd58f('0x11a'),'foreignKey':'SubjectId'});db[_0xd58f('0x1ce')]['hasMany'](db['DeskField'],{'as':_0xd58f('0x1c6'),'onDelete':_0xd58f('0x11a'),'foreignKey':'DescriptionId'});db[_0xd58f('0x1ce')][_0xd58f('0x11d')](db[_0xd58f('0xb2')],{'as':'Fields','onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1c7')});db[_0xd58f('0x1ce')]['belongsTo'](db[_0xd58f('0xb0')],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x1c4')});db[_0xd58f('0x1ce')][_0xd58f('0x12d')](db[_0xd58f('0x8e')],{'through':_0xd58f('0x1d0')});db[_0xd58f('0xb2')][_0xd58f('0x11d')](db['DeskField'],{'as':'Subject','foreignKey':_0xd58f('0x1cd')});db[_0xd58f('0xb2')][_0xd58f('0x11d')](db['DeskField'],{'as':_0xd58f('0x1c8'),'foreignKey':_0xd58f('0x1c9')});db[_0xd58f('0xb2')][_0xd58f('0x11d')](db[_0xd58f('0xb2')],{'as':_0xd58f('0x1d1'),'foreignKey':_0xd58f('0x1c7')});db[_0xd58f('0xb2')][_0xd58f('0x128')](db[_0xd58f('0x96')],{'as':'Variable','foreignKey':_0xd58f('0x1ca')});db[_0xd58f('0xb4')]['hasMany'](db[_0xd58f('0x1d2')],{'as':_0xd58f('0x1cf'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1c4')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':_0xd58f('0x1c5'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1cd')});db[_0xd58f('0x1d2')][_0xd58f('0x11d')](db[_0xd58f('0xb5')],{'as':_0xd58f('0x1c6'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1c9')});db[_0xd58f('0x1d2')][_0xd58f('0x11d')](db[_0xd58f('0xb5')],{'as':_0xd58f('0x1c0'),'onDelete':_0xd58f('0x11a'),'foreignKey':'FieldId'});db[_0xd58f('0x1d2')][_0xd58f('0x128')](db[_0xd58f('0xb4')],{'as':'Account','foreignKey':_0xd58f('0x1c4')});db[_0xd58f('0xb5')][_0xd58f('0x11d')](db[_0xd58f('0xb5')],{'as':_0xd58f('0x1cc'),'foreignKey':'SubjectId'});db[_0xd58f('0xb5')][_0xd58f('0x11d')](db[_0xd58f('0xb5')],{'as':_0xd58f('0x1c8'),'foreignKey':_0xd58f('0x1c9')});db[_0xd58f('0xb5')]['hasMany'](db[_0xd58f('0xb5')],{'as':_0xd58f('0x1d1'),'foreignKey':_0xd58f('0x1c7')});db[_0xd58f('0xb5')][_0xd58f('0x128')](db[_0xd58f('0x96')],{'as':_0xd58f('0x96'),'foreignKey':'VariableId'});db[_0xd58f('0xb7')][_0xd58f('0x11d')](db[_0xd58f('0x1d3')],{'as':_0xd58f('0x1cf'),'onDelete':'cascade','foreignKey':_0xd58f('0x1c4')});db['ZendeskConfiguration'][_0xd58f('0x11d')](db[_0xd58f('0x1d4')],{'as':_0xd58f('0x1c5'),'foreignKey':_0xd58f('0x1cd')});db[_0xd58f('0x1d3')][_0xd58f('0x11d')](db[_0xd58f('0x1d4')],{'as':_0xd58f('0x1c6'),'foreignKey':_0xd58f('0x1c9')});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':_0xd58f('0x1c0'),'foreignKey':'FieldId'});db[_0xd58f('0x1d3')]['belongsTo'](db[_0xd58f('0xb7')],{'as':'Account','foreignKey':_0xd58f('0x1c4')});db[_0xd58f('0x1d3')]['belongsToMany'](db[_0xd58f('0x8e')],{'through':_0xd58f('0x1d5')});db[_0xd58f('0x1d4')][_0xd58f('0x11d')](db[_0xd58f('0x1d4')],{'as':_0xd58f('0x1cc'),'foreignKey':_0xd58f('0x1cd')});db[_0xd58f('0x1d4')]['hasMany'](db[_0xd58f('0x1d4')],{'as':_0xd58f('0x1c8'),'foreignKey':_0xd58f('0x1c9')});db[_0xd58f('0x1d4')][_0xd58f('0x11d')](db['ZendeskField'],{'as':_0xd58f('0x1d1'),'foreignKey':_0xd58f('0x1c7')});db[_0xd58f('0x1d4')][_0xd58f('0x128')](db[_0xd58f('0x96')],{'as':_0xd58f('0x96'),'foreignKey':_0xd58f('0x1ca')});db['FreshdeskAccount'][_0xd58f('0x11d')](db[_0xd58f('0xbb')],{'as':_0xd58f('0x1cf'),'onDelete':_0xd58f('0x11a'),'foreignKey':'AccountId'});db[_0xd58f('0xbb')]['hasMany'](db[_0xd58f('0xbd')],{'as':_0xd58f('0x1c5'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1cd')});db[_0xd58f('0xbb')][_0xd58f('0x11d')](db[_0xd58f('0xbd')],{'as':'Descriptions','onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1c9')});db[_0xd58f('0xbb')][_0xd58f('0x11d')](db[_0xd58f('0xbd')],{'as':_0xd58f('0x1c0'),'onDelete':'cascade','foreignKey':_0xd58f('0x1c7')});db[_0xd58f('0xbb')][_0xd58f('0x128')](db['FreshdeskAccount'],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x1c4')});db['FreshdeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0xd58f('0x1d6')});db[_0xd58f('0xbd')][_0xd58f('0x11d')](db[_0xd58f('0xbd')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xd58f('0xbd')][_0xd58f('0x11d')](db[_0xd58f('0xbd')],{'as':_0xd58f('0x1c8'),'foreignKey':_0xd58f('0x1c9')});db[_0xd58f('0xbd')]['hasMany'](db['FreshdeskField'],{'as':'Field','foreignKey':_0xd58f('0x1c7')});db[_0xd58f('0xbd')][_0xd58f('0x128')](db[_0xd58f('0x96')],{'as':'Variable','foreignKey':_0xd58f('0x1ca')});db['VtigerAccount'][_0xd58f('0x11d')](db['VtigerConfiguration'],{'as':_0xd58f('0x1cf'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1c4')});db[_0xd58f('0xbf')]['hasMany'](db[_0xd58f('0xc1')],{'as':'Subjects','foreignKey':_0xd58f('0x1cd')});db[_0xd58f('0xbf')][_0xd58f('0x11d')](db[_0xd58f('0xc1')],{'as':_0xd58f('0x1c6'),'foreignKey':'DescriptionId'});db[_0xd58f('0xbf')][_0xd58f('0x11d')](db[_0xd58f('0xc1')],{'as':_0xd58f('0x1c0'),'foreignKey':'FieldId'});db['VtigerConfiguration']['belongsTo'](db[_0xd58f('0xbe')],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x1c4')});db[_0xd58f('0xc1')][_0xd58f('0x11d')](db['VtigerField'],{'as':'Subject','foreignKey':_0xd58f('0x1cd')});db[_0xd58f('0xc1')][_0xd58f('0x11d')](db[_0xd58f('0xc1')],{'as':'Description','foreignKey':_0xd58f('0x1c9')});db[_0xd58f('0xc1')][_0xd58f('0x11d')](db[_0xd58f('0xc1')],{'as':'Field','foreignKey':'FieldId'});db[_0xd58f('0xc1')][_0xd58f('0x128')](db['Variable'],{'as':_0xd58f('0x96'),'foreignKey':_0xd58f('0x1ca')});db[_0xd58f('0xc2')][_0xd58f('0x11d')](db[_0xd58f('0x1d7')],{'as':_0xd58f('0x1cf'),'onDelete':'cascade','foreignKey':_0xd58f('0x1c4')});db[_0xd58f('0x1d7')][_0xd58f('0x11d')](db[_0xd58f('0xc5')],{'as':_0xd58f('0x1c5'),'foreignKey':_0xd58f('0x1cd')});db[_0xd58f('0x1d7')][_0xd58f('0x11d')](db[_0xd58f('0xc5')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xd58f('0x1d7')][_0xd58f('0x11d')](db[_0xd58f('0xc5')],{'as':_0xd58f('0x1c0'),'foreignKey':_0xd58f('0x1c7')});db[_0xd58f('0x1d7')]['belongsTo'](db[_0xd58f('0xc2')],{'as':'Account','foreignKey':_0xd58f('0x1c4')});db['ServicenowField'][_0xd58f('0x11d')](db['ServicenowField'],{'as':_0xd58f('0x1cc'),'foreignKey':_0xd58f('0x1cd')});db[_0xd58f('0xc5')][_0xd58f('0x11d')](db[_0xd58f('0xc5')],{'as':_0xd58f('0x1c8'),'foreignKey':_0xd58f('0x1c9')});db[_0xd58f('0xc5')][_0xd58f('0x11d')](db['ServicenowField'],{'as':_0xd58f('0x1d1'),'foreignKey':'FieldId'});db[_0xd58f('0xc5')][_0xd58f('0x128')](db[_0xd58f('0x96')],{'as':'Variable','foreignKey':_0xd58f('0x1ca')});db['Dynamics365Account']['hasMany'](db[_0xd58f('0x1d8')],{'as':_0xd58f('0x1cf'),'onDelete':_0xd58f('0x11a'),'foreignKey':'AccountId'});db[_0xd58f('0xc7')][_0xd58f('0x128')](db[_0xd58f('0x10f')],{'as':_0xd58f('0x10f'),'foreignKey':_0xd58f('0x165')});db['Dynamics365Configuration'][_0xd58f('0x11d')](db[_0xd58f('0xc9')],{'as':_0xd58f('0x1c5'),'onDelete':'cascade','foreignKey':_0xd58f('0x1cd')});db[_0xd58f('0x1d8')][_0xd58f('0x11d')](db[_0xd58f('0xc9')],{'as':_0xd58f('0x1c6'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1c9')});db[_0xd58f('0x1d8')]['hasMany'](db[_0xd58f('0xc9')],{'as':_0xd58f('0x1c0'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1c7')});db[_0xd58f('0x1d8')][_0xd58f('0x128')](db[_0xd58f('0xc7')],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x1c4')});db[_0xd58f('0xc9')]['hasMany'](db[_0xd58f('0xc9')],{'as':'Subject','foreignKey':_0xd58f('0x1cd')});db[_0xd58f('0xc9')][_0xd58f('0x11d')](db[_0xd58f('0xc9')],{'as':_0xd58f('0x1c8'),'foreignKey':_0xd58f('0x1c9')});db['Dynamics365Field'][_0xd58f('0x11d')](db[_0xd58f('0xc9')],{'as':_0xd58f('0x1d1'),'foreignKey':_0xd58f('0x1c7')});db[_0xd58f('0xc9')][_0xd58f('0x128')](db['Variable'],{'as':_0xd58f('0x96'),'foreignKey':_0xd58f('0x1ca')});db['FreshsalesAccount'][_0xd58f('0x11d')](db[_0xd58f('0xcd')],{'as':_0xd58f('0x1cf'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1c4')});db['FreshsalesConfiguration']['hasMany'](db[_0xd58f('0xcf')],{'as':_0xd58f('0x1c5'),'foreignKey':'SubjectId'});db[_0xd58f('0xcd')][_0xd58f('0x11d')](db[_0xd58f('0xcf')],{'as':'Descriptions','foreignKey':_0xd58f('0x1c9')});db['FreshsalesConfiguration'][_0xd58f('0x11d')](db[_0xd58f('0xcf')],{'as':_0xd58f('0x1c0'),'foreignKey':_0xd58f('0x1c7')});db[_0xd58f('0xcd')][_0xd58f('0x128')](db[_0xd58f('0xcb')],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x1c4')});db[_0xd58f('0xcf')][_0xd58f('0x11d')](db['FreshsalesField'],{'as':_0xd58f('0x1cc'),'foreignKey':'SubjectId'});db[_0xd58f('0xcf')][_0xd58f('0x11d')](db[_0xd58f('0xcf')],{'as':_0xd58f('0x1c8'),'foreignKey':'DescriptionId'});db[_0xd58f('0xcf')][_0xd58f('0x11d')](db[_0xd58f('0xcf')],{'as':_0xd58f('0x1d1'),'foreignKey':_0xd58f('0x1c7')});db['FreshsalesField']['belongsTo'](db[_0xd58f('0x96')],{'as':_0xd58f('0x96'),'foreignKey':_0xd58f('0x1ca')});db[_0xd58f('0xd3')][_0xd58f('0x128')](db['ChatWebsite'],{});db[_0xd58f('0xd3')][_0xd58f('0x128')](db[_0xd58f('0xfb')],{'as':_0xd58f('0x16d'),'foreignKey':_0xd58f('0x16e')});db[_0xd58f('0xd3')][_0xd58f('0x128')](db[_0xd58f('0x162')],{'as':_0xd58f('0x174'),'foreignKey':_0xd58f('0x175')});db[_0xd58f('0xd3')]['belongsTo'](db[_0xd58f('0x6d')],{});db[_0xd58f('0xd3')][_0xd58f('0x128')](db[_0xd58f('0x6f')],{});db['ChatQueueReport']['belongsTo'](db[_0xd58f('0x12')],{});db['ChatQueueReport'][_0xd58f('0x128')](db[_0xd58f('0x138')],{});db[_0xd58f('0xd5')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1d9')});db[_0xd58f('0xd5')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x1da')});db['JscriptySessionReport'][_0xd58f('0x11d')](db[_0xd58f('0xd9')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xd58f('0x152')][_0xd58f('0x11d')](db[_0xd58f('0xd7')],{'foreignKey':_0xd58f('0x1db'),'onDelete':_0xd58f('0x11a')});db[_0xd58f('0xdc')]['belongsTo'](db['SmsAccount'],{});db[_0xd58f('0xdc')][_0xd58f('0x128')](db[_0xd58f('0xfb')],{'as':_0xd58f('0x16d'),'foreignKey':_0xd58f('0x16e')});db['SmsQueueReport'][_0xd58f('0x128')](db[_0xd58f('0x162')],{'as':_0xd58f('0x174'),'foreignKey':_0xd58f('0x175')});db['SmsQueueReport'][_0xd58f('0x128')](db['SmsInteraction'],{});db[_0xd58f('0xdc')]['belongsTo'](db[_0xd58f('0x5d')],{});db['SmsQueueReport']['belongsTo'](db[_0xd58f('0x12')],{});db[_0xd58f('0xdc')][_0xd58f('0x128')](db[_0xd58f('0x5f')],{});db['JscriptyProject'][_0xd58f('0x11d')](db['JscriptySessionReport'],{'foreignKey':_0xd58f('0x1dc')});db['JscriptyProject']['hasMany'](db[_0xd58f('0xd9')],{'foreignKey':_0xd58f('0x1dc')});db[_0xd58f('0xde')][_0xd58f('0x11d')](db[_0xd58f('0xd7')],{'foreignKey':_0xd58f('0x1dc')});db['Team'][_0xd58f('0x12d')](db[_0xd58f('0x12')],{'as':'Agents','through':_0xd58f('0x1dd')});db[_0xd58f('0xe7')]['belongsToMany'](db[_0xd58f('0x135')],{'through':'TeamVoiceQueue','as':_0xd58f('0x136')});db[_0xd58f('0xe7')][_0xd58f('0x12d')](db[_0xd58f('0x43')],{'through':_0xd58f('0x171'),'as':'MailQueues'});db[_0xd58f('0xe7')][_0xd58f('0x12d')](db[_0xd58f('0x138')],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0xd58f('0xe7')][_0xd58f('0x12d')](db[_0xd58f('0x57')],{'through':_0xd58f('0x189'),'as':_0xd58f('0x1de')});db[_0xd58f('0xe7')][_0xd58f('0x12d')](db[_0xd58f('0x5f')],{'through':_0xd58f('0x1df'),'as':_0xd58f('0x1e0')});db[_0xd58f('0xe7')][_0xd58f('0x12d')](db[_0xd58f('0x67')],{'through':'team_has_openchannel_queues','as':_0xd58f('0x13a')});db[_0xd58f('0xe7')][_0xd58f('0x12d')](db['WhatsappQueue'],{'through':_0xd58f('0x1e1'),'as':_0xd58f('0x13c')});db[_0xd58f('0xe7')][_0xd58f('0x12d')](db[_0xd58f('0xfd')],{'through':_0xd58f('0x112'),'as':_0xd58f('0x1e2')});db[_0xd58f('0xea')][_0xd58f('0x11d')](db[_0xd58f('0x14d')],{'as':'Hoppers','foreignKey':_0xd58f('0x1ab')});db[_0xd58f('0xea')][_0xd58f('0x11d')](db['CmHopperFinal'],{'as':_0xd58f('0x120'),'foreignKey':'CampaignId'});db[_0xd58f('0xea')]['hasMany'](db[_0xd58f('0x7d')],{'as':_0xd58f('0x1a6'),'foreignKey':_0xd58f('0x1ab')});db['Campaign'][_0xd58f('0x11d')](db['CmHopperBlack'],{'as':_0xd58f('0x151'),'foreignKey':_0xd58f('0x1ab')});db[_0xd58f('0xea')][_0xd58f('0x128')](db[_0xd58f('0x30')],{'as':_0xd58f('0x30'),'foreignKey':'TrunkId'});db['Campaign'][_0xd58f('0x128')](db[_0xd58f('0x30')],{'as':_0xd58f('0x154'),'foreignKey':_0xd58f('0x155')});db[_0xd58f('0xea')][_0xd58f('0x128')](db['Interval'],{'as':_0xd58f('0x156'),'foreignKey':_0xd58f('0x17d')});db['Campaign'][_0xd58f('0x128')](db[_0xd58f('0xe2')],{'as':'SquareProject','foreignKey':_0xd58f('0x1e3')});db['Campaign'][_0xd58f('0x12d')](db[_0xd58f('0xfb')],{'as':_0xd58f('0x159'),'through':_0xd58f('0x1e4')});db[_0xd58f('0xea')][_0xd58f('0x12d')](db[_0xd58f('0xfb')],{'as':_0xd58f('0x1e5'),'through':_0xd58f('0x1e6')});db[_0xd58f('0xee')][_0xd58f('0x128')](db['ChatOfflineMessage'],{'as':_0xd58f('0x17c'),'foreignKey':_0xd58f('0x1a0')});db['MailTransferReport'][_0xd58f('0x128')](db[_0xd58f('0x48')],{});db[_0xd58f('0xf2')][_0xd58f('0x128')](db[_0xd58f('0x46')],{});db[_0xd58f('0xf2')][_0xd58f('0x128')](db[_0xd58f('0x140')],{'foreignKey':_0xd58f('0x1e7'),'as':'FromAccount'});db['MailTransferReport'][_0xd58f('0x128')](db[_0xd58f('0x12')],{'foreignKey':_0xd58f('0x1e8'),'as':_0xd58f('0x1e9')});db[_0xd58f('0xf2')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'foreignKey':_0xd58f('0x1ea'),'as':_0xd58f('0x1eb')});db[_0xd58f('0xf2')][_0xd58f('0x128')](db[_0xd58f('0x43')],{'foreignKey':_0xd58f('0x1ec'),'as':'ToQueue'});db[_0xd58f('0xf2')][_0xd58f('0x128')](db[_0xd58f('0x140')],{'foreignKey':_0xd58f('0x1ed'),'as':_0xd58f('0x1ee')});db[_0xd58f('0xf4')]['belongsTo'](db[_0xd58f('0x6f')],{});db[_0xd58f('0xf4')][_0xd58f('0x128')](db['ChatInteraction'],{});db[_0xd58f('0xf4')][_0xd58f('0x128')](db['ChatWebsite'],{'foreignKey':_0xd58f('0x1ef'),'as':'FromAccount'});db['ChatTransferReport']['belongsTo'](db[_0xd58f('0x12')],{'foreignKey':_0xd58f('0x1e8'),'as':_0xd58f('0x1e9')});db['ChatTransferReport'][_0xd58f('0x128')](db[_0xd58f('0x12')],{'foreignKey':_0xd58f('0x1ea'),'as':_0xd58f('0x1eb')});db['ChatTransferReport'][_0xd58f('0x128')](db['ChatQueue'],{'foreignKey':_0xd58f('0x1f0'),'as':_0xd58f('0x1f1')});db['ChatTransferReport']['belongsTo'](db[_0xd58f('0x69')],{'foreignKey':'ToChatWebsiteId','as':'ToAccount'});db[_0xd58f('0xf6')][_0xd58f('0x128')](db[_0xd58f('0x55')],{});db[_0xd58f('0xf6')]['belongsTo'](db['FaxInteraction'],{});db[_0xd58f('0xf6')][_0xd58f('0x128')](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db[_0xd58f('0xf6')][_0xd58f('0x128')](db['User'],{'foreignKey':_0xd58f('0x1e8'),'as':_0xd58f('0x1e9')});db[_0xd58f('0xf6')][_0xd58f('0x128')](db['User'],{'foreignKey':_0xd58f('0x1ea'),'as':'ToAgent'});db['FaxTransferReport'][_0xd58f('0x128')](db['FaxQueue'],{'foreignKey':_0xd58f('0x1f2'),'as':_0xd58f('0x1f1')});db[_0xd58f('0xf6')][_0xd58f('0x128')](db[_0xd58f('0x183')],{'foreignKey':_0xd58f('0x1f3'),'as':_0xd58f('0x1ee')});db[_0xd58f('0xf8')][_0xd58f('0x128')](db[_0xd58f('0x65')],{});db['OpenchannelTransferReport'][_0xd58f('0x128')](db['OpenchannelInteraction'],{});db[_0xd58f('0xf8')][_0xd58f('0x128')](db['OpenchannelAccount'],{'foreignKey':_0xd58f('0x1f4'),'as':_0xd58f('0x1f5')});db['OpenchannelTransferReport'][_0xd58f('0x128')](db[_0xd58f('0x12')],{'foreignKey':_0xd58f('0x1e8'),'as':_0xd58f('0x1e9')});db[_0xd58f('0xf8')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'foreignKey':_0xd58f('0x1ea'),'as':_0xd58f('0x1eb')});db[_0xd58f('0xf8')][_0xd58f('0x128')](db[_0xd58f('0x67')],{'foreignKey':_0xd58f('0x1f6'),'as':'ToQueue'});db[_0xd58f('0xf8')]['belongsTo'](db[_0xd58f('0x61')],{'foreignKey':_0xd58f('0x1f7'),'as':_0xd58f('0x1ee')});db[_0xd58f('0x1f8')][_0xd58f('0x128')](db[_0xd58f('0x5d')],{});db[_0xd58f('0x1f8')]['belongsTo'](db[_0xd58f('0x5b')],{});db[_0xd58f('0x1f8')][_0xd58f('0x128')](db[_0xd58f('0x144')],{'foreignKey':_0xd58f('0x1f9'),'as':_0xd58f('0x1f5')});db[_0xd58f('0x1f8')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xd58f('0x1f8')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'foreignKey':'ToUserId','as':_0xd58f('0x1eb')});db[_0xd58f('0x1f8')][_0xd58f('0x128')](db[_0xd58f('0x5f')],{'foreignKey':_0xd58f('0x1fa'),'as':_0xd58f('0x1f1')});db['SmsTransferReport'][_0xd58f('0x128')](db[_0xd58f('0x144')],{'foreignKey':'ToSmsAccountId','as':_0xd58f('0x1ee')});db['CmList']['hasMany'](db[_0xd58f('0x181')],{'as':_0xd58f('0x169'),'foreignKey':_0xd58f('0x16e'),'onDelete':_0xd58f('0x11a')});db[_0xd58f('0xfb')][_0xd58f('0x11d')](db[_0xd58f('0x7e')],{'as':_0xd58f('0x1fb'),'foreignKey':_0xd58f('0x16e')});db[_0xd58f('0xfb')][_0xd58f('0x11d')](db[_0xd58f('0x162')],{'as':_0xd58f('0x12b'),'onDelete':_0xd58f('0x11a'),'foreignKey':_0xd58f('0x16e')});db['CmList'][_0xd58f('0x11d')](db[_0xd58f('0x7b')],{'as':_0xd58f('0x120'),'foreignKey':_0xd58f('0x16e')});db[_0xd58f('0xfb')][_0xd58f('0x11d')](db[_0xd58f('0x7d')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0xd58f('0xfb')][_0xd58f('0x11d')](db[_0xd58f('0x150')],{'as':_0xd58f('0x150'),'foreignKey':_0xd58f('0x16e')});db[_0xd58f('0xfb')]['belongsToMany'](db[_0xd58f('0x135')],{'as':_0xd58f('0x1fc'),'through':_0xd58f('0x15a')});db['CmList'][_0xd58f('0x12d')](db['User'],{'as':_0xd58f('0x15b'),'through':_0xd58f('0x12e')});db[_0xd58f('0xfd')]['hasMany'](db[_0xd58f('0x19')],{'as':_0xd58f('0x11f'),'onDelete':'cascade'});db[_0xd58f('0xfd')][_0xd58f('0x12d')](db[_0xd58f('0x12')],{'as':'Agents','through':_0xd58f('0x114')});db['VoicePrefix'][_0xd58f('0x12d')](db[_0xd58f('0xe7')],{'through':_0xd58f('0x112'),'as':_0xd58f('0x15c')});db[_0xd58f('0xff')][_0xd58f('0x11d')](db['User'],{'as':_0xd58f('0x179'),'foreignKey':'userProfileId'});db[_0xd58f('0xff')][_0xd58f('0x11d')](db[_0xd58f('0x1fd')],{'as':'UserProfileSections','foreignKey':_0xd58f('0x129'),'onDelete':_0xd58f('0x11a')});db[_0xd58f('0x1fd')][_0xd58f('0x11d')](db[_0xd58f('0x101')],{'as':_0xd58f('0x1fe'),'foreignKey':_0xd58f('0x1ff'),'onDelete':'cascade'});db['WhatsappAccount'][_0xd58f('0x11d')](db['Disposition'],{'as':_0xd58f('0x169'),'foreignKey':_0xd58f('0x200'),'onDelete':_0xd58f('0x11a')});db[_0xd58f('0x104')]['hasMany'](db[_0xd58f('0x82')],{'as':'Answers','foreignKey':_0xd58f('0x200')});db[_0xd58f('0x104')][_0xd58f('0x11d')](db[_0xd58f('0x10a')],{'as':_0xd58f('0x16b'),'foreignKey':_0xd58f('0x200')});db['WhatsappAccount'][_0xd58f('0x11d')](db[_0xd58f('0x108')],{'as':_0xd58f('0x16c')});db[_0xd58f('0x104')][_0xd58f('0x11d')](db['WhatsappApplication'],{'as':'Applications'});db[_0xd58f('0x104')]['belongsTo'](db[_0xd58f('0xfb')],{'as':_0xd58f('0x16d'),'foreignKey':_0xd58f('0x16e')});db['WhatsappAccount'][_0xd58f('0x128')](db[_0xd58f('0x87')],{'as':_0xd58f('0x157'),'foreignKey':_0xd58f('0x158')});db['WhatsappAccount'][_0xd58f('0x12d')](db[_0xd58f('0x12')],{'as':_0xd58f('0x15b'),'through':_0xd58f('0x147')});db[_0xd58f('0x106')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'onDelete':'restrict'});db[_0xd58f('0x106')][_0xd58f('0x128')](db['WhatsappQueue'],{'onDelete':_0xd58f('0x166')});db[_0xd58f('0x106')][_0xd58f('0x128')](db[_0xd58f('0x104')],{'onDelete':_0xd58f('0x166')});db[_0xd58f('0x106')][_0xd58f('0x128')](db[_0xd58f('0x156')],{'onDelete':_0xd58f('0x166'),'foreignKey':_0xd58f('0x17d')});db[_0xd58f('0x106')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0xd58f('0x17e')});db[_0xd58f('0x108')][_0xd58f('0x11d')](db[_0xd58f('0x10a')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xd58f('0x201')});db[_0xd58f('0x108')][_0xd58f('0x128')](db[_0xd58f('0x104')],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x200')});db[_0xd58f('0x108')]['belongsTo'](db['CmContact'],{'as':_0xd58f('0x174'),'foreignKey':_0xd58f('0x175')});db['WhatsappInteraction']['belongsTo'](db[_0xd58f('0x12')],{'as':_0xd58f('0x194'),'foreignKey':_0xd58f('0x11b')});db[_0xd58f('0x108')][_0xd58f('0x12d')](db[_0xd58f('0x8e')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0xd58f('0x108')][_0xd58f('0x12d')](db[_0xd58f('0x8e')],{'through':_0xd58f('0x1ba'),'as':'ThroughTags'});db['WhatsappInteraction'][_0xd58f('0x12d')](db[_0xd58f('0x12')],{'as':'Users','through':_0xd58f('0x134'),'foreignKey':_0xd58f('0x201')});db['WhatsappMessage'][_0xd58f('0x128')](db[_0xd58f('0x12')],{'as':'User'});db[_0xd58f('0x10a')]['belongsTo'](db[_0xd58f('0x162')],{'onDelete':'cascade','as':'Contact'});db['WhatsappMessage'][_0xd58f('0x128')](db['WhatsappInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xd58f('0x201')});db[_0xd58f('0x10a')][_0xd58f('0x128')](db[_0xd58f('0x104')],{'as':_0xd58f('0x173'),'foreignKey':_0xd58f('0x200')});db[_0xd58f('0x202')]['belongsTo'](db[_0xd58f('0x104')],{});db[_0xd58f('0x202')][_0xd58f('0x128')](db[_0xd58f('0xfb')],{'as':_0xd58f('0x16d'),'foreignKey':_0xd58f('0x16e')});db[_0xd58f('0x202')]['belongsTo'](db[_0xd58f('0x162')],{'as':'Contact','foreignKey':_0xd58f('0x175')});db[_0xd58f('0x202')][_0xd58f('0x128')](db['WhatsappInteraction'],{});db[_0xd58f('0x202')][_0xd58f('0x128')](db[_0xd58f('0x10e')],{});db[_0xd58f('0x202')]['belongsTo'](db[_0xd58f('0x10a')],{});db[_0xd58f('0x202')]['belongsTo'](db[_0xd58f('0x12')],{});db[_0xd58f('0x10d')][_0xd58f('0x128')](db['WhatsappMessage'],{});db[_0xd58f('0x10d')][_0xd58f('0x128')](db[_0xd58f('0x108')],{});db['WhatsappTransferReport'][_0xd58f('0x128')](db[_0xd58f('0x104')],{'foreignKey':_0xd58f('0x203'),'as':_0xd58f('0x1f5')});db['WhatsappTransferReport']['belongsTo'](db[_0xd58f('0x104')],{'foreignKey':_0xd58f('0x204'),'as':'ToAccount'});db['WhatsappTransferReport'][_0xd58f('0x128')](db[_0xd58f('0x10e')],{'foreignKey':_0xd58f('0x205'),'as':_0xd58f('0x1f1')});db['WhatsappTransferReport'][_0xd58f('0x128')](db[_0xd58f('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xd58f('0x10d')][_0xd58f('0x128')](db['User'],{'foreignKey':_0xd58f('0x1ea'),'as':'ToAgent'});db[_0xd58f('0x10e')][_0xd58f('0x12d')](db[_0xd58f('0x12')],{'as':_0xd58f('0x15b'),'through':_0xd58f('0x3e'),'foreignKey':'WhatsappQueueId'});db['WhatsappQueue'][_0xd58f('0x12d')](db[_0xd58f('0xe7')],{'through':_0xd58f('0x1e1'),'as':_0xd58f('0x15c')});db[_0xd58f('0x116')][_0xd58f('0x128')](db[_0xd58f('0x12')],{'as':_0xd58f('0x206'),'foreignKey':'UserId','onDelete':_0xd58f('0x11a'),'hooks':!![]});db[_0xd58f('0x10f')][_0xd58f('0x118')](db['Dynamics365Account'],{'as':_0xd58f('0xc7'),'onDelete':_0xd58f('0x166')});db[_0xd58f('0x10f')][_0xd58f('0x118')](db[_0xd58f('0x163')],{'as':_0xd58f('0x167'),'onDelete':'restrict'});db[_0xd58f('0x10f')][_0xd58f('0x118')](db[_0xd58f('0x40')],{'as':_0xd58f('0x168'),'onDelete':'restrict'});module[_0xd58f('0x207')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 7db70d0..bff2cbd 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce58=['./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','/api/triggers','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/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/campaigns','/api/migrations','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/resources','/api/userNotifications','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','./api/rpc','/api/version','./api/version','/api/pm2','./api/pm2','./api/webbar','/api/logs','/apidoc','static','join','/www','root','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','get','route','appPath','/index.html','path','./config/environment','./utils/client-side-logger','setupLoggers','default','then','use','/api/users','./api/user','/api/voice/contexts','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/trunks','./api/trunk','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/smsAccount','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue'];(function(_0x367e53,_0x4e725a){var _0x1bb547=function(_0x16d097){while(--_0x16d097){_0x367e53['push'](_0x367e53['shift']());}};_0x1bb547(++_0x4e725a);}(_0xce58,0xbe));var _0x8ce5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce58[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x8ce5('0x0'));var express=require('express');var errors=require('./errors');var config=require(_0x8ce5('0x1'));var setupLoggers=require(_0x8ce5('0x2'))[_0x8ce5('0x3')];var clientSideLogs=require('./api/client-side-logs');exports[_0x8ce5('0x4')]=function(_0x4f1d5b){return setupLoggers(_0x4f1d5b)[_0x8ce5('0x5')](function(){_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x7'),require(_0x8ce5('0x8')));_0x4f1d5b[_0x8ce5('0x6')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x9'),require('./api/voiceContext'));_0x4f1d5b[_0x8ce5('0x6')]('/api/voice/extensions',require('./api/voiceExtension'));_0x4f1d5b['use'](_0x8ce5('0xa'),require('./api/voiceMusicOnHold'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xb'),require(_0x8ce5('0xc')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xd'),require('./api/voiceRecording'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xe'),require('./api/screenRecording'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xf'),require(_0x8ce5('0x10')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x11'),require(_0x8ce5('0x12')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x13'),require(_0x8ce5('0x14')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x15'),require('./api/voiceDialReport'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x16'),require(_0x8ce5('0x17')));_0x4f1d5b['use'](_0x8ce5('0x18'),require(_0x8ce5('0x19')));_0x4f1d5b[_0x8ce5('0x6')]('/api/members/reports',require('./api/memberReport'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x1a'),require(_0x8ce5('0x1b')));_0x4f1d5b[_0x8ce5('0x6')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x1c'),require(_0x8ce5('0x1d')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x1e'),require(_0x8ce5('0x1f')));_0x4f1d5b['use'](_0x8ce5('0x20'),require(_0x8ce5('0x21')));_0x4f1d5b[_0x8ce5('0x6')]('/api/mail/substatuses',require(_0x8ce5('0x22')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x23'),require(_0x8ce5('0x24')));_0x4f1d5b['use']('/api/mail/messages',require(_0x8ce5('0x25')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x26'),require(_0x8ce5('0x27')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x28'),require('./api/mailQueueReport'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x29'),require(_0x8ce5('0x2a')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x2b'),require('./api/dashboardItem'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x2c'),require('./api/faxAccount'));_0x4f1d5b[_0x8ce5('0x6')]('/api/fax/applications',require(_0x8ce5('0x2d')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x2e'),require(_0x8ce5('0x2f')));_0x4f1d5b['use'](_0x8ce5('0x30'),require(_0x8ce5('0x31')));_0x4f1d5b[_0x8ce5('0x6')]('/api/fax/queues',require(_0x8ce5('0x32')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x33'),require('./api/faxQueueReport'));_0x4f1d5b['use']('/api/sms/accounts',require(_0x8ce5('0x34')));_0x4f1d5b[_0x8ce5('0x6')]('/api/sms/applications',require(_0x8ce5('0x35')));_0x4f1d5b[_0x8ce5('0x6')]('/api/sms/interactions',require(_0x8ce5('0x36')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x37'),require(_0x8ce5('0x38')));_0x4f1d5b['use'](_0x8ce5('0x39'),require(_0x8ce5('0x3a')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x3b'),require('./api/openchannelAccount'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x3c'),require(_0x8ce5('0x3d')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x3e'),require(_0x8ce5('0x3f')));_0x4f1d5b[_0x8ce5('0x6')]('/api/openchannel/messages',require(_0x8ce5('0x40')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x41'),require(_0x8ce5('0x42')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x43'),require(_0x8ce5('0x44')));_0x4f1d5b['use'](_0x8ce5('0x45'),require(_0x8ce5('0x46')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x47'),require(_0x8ce5('0x48')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x49'),require('./api/chatInteraction'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x4a'),require(_0x8ce5('0x4b')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x4c'),require('./api/chatOfflineMessage'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x4d'),require('./api/chatQueue'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x4e'),require(_0x8ce5('0x4f')));_0x4f1d5b[_0x8ce5('0x6')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x50'),require(_0x8ce5('0x51')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x52'),require(_0x8ce5('0x53')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x54'),require('./api/cmHopper'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x55'),require(_0x8ce5('0x56')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x57'),require(_0x8ce5('0x58')));_0x4f1d5b[_0x8ce5('0x6')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x59'),require(_0x8ce5('0x5a')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x5b'),require(_0x8ce5('0x5c')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x5d'),require(_0x8ce5('0x5e')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x5f'),require(_0x8ce5('0x60')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x61'),require(_0x8ce5('0x62')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x63'),require(_0x8ce5('0x64')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x65'),require('./api/interval'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x66'),require(_0x8ce5('0x67')));_0x4f1d5b[_0x8ce5('0x6')]('/api/cdr',require(_0x8ce5('0x68')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x69'),require(_0x8ce5('0x6a')));_0x4f1d5b[_0x8ce5('0x6')]('/api/schedules',require(_0x8ce5('0x6b')));_0x4f1d5b[_0x8ce5('0x6')]('/api/sounds',require('./api/sound'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x6c'),require(_0x8ce5('0x6d')));_0x4f1d5b['use'](_0x8ce5('0x6e'),require('./api/contactItemType'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x6f'),require(_0x8ce5('0x70')));_0x4f1d5b[_0x8ce5('0x6')]('/api/cm_hopper_additional_phones',require(_0x8ce5('0x71')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x72'),require('./api/template'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x73'),require('./api/trigger'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x74'),require(_0x8ce5('0x75')));_0x4f1d5b['use']('/api/integrations',require(_0x8ce5('0x76')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x77'),require(_0x8ce5('0x78')));_0x4f1d5b['use'](_0x8ce5('0x79'),require('./api/analyticCustomReport'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x7a'),require(_0x8ce5('0x7b')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x7c'),require(_0x8ce5('0x7d')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x7e'),require('./api/analyticMetric'));_0x4f1d5b['use'](_0x8ce5('0x7f'),require(_0x8ce5('0x80')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x81'),require(_0x8ce5('0x82')));_0x4f1d5b[_0x8ce5('0x6')]('/api/integrations/salesforce/accounts',require(_0x8ce5('0x83')));_0x4f1d5b[_0x8ce5('0x6')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x84'),require('./api/intSalesforceField'));_0x4f1d5b['use'](_0x8ce5('0x85'),require('./api/intSugarcrmAccount'));_0x4f1d5b['use']('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x86'),require(_0x8ce5('0x87')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x88'),require(_0x8ce5('0x89')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x8a'),require(_0x8ce5('0x8b')));_0x4f1d5b['use']('/api/integrations/desk/fields',require(_0x8ce5('0x8c')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x8d'),require(_0x8ce5('0x8e')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x8f'),require(_0x8ce5('0x90')));_0x4f1d5b['use'](_0x8ce5('0x91'),require(_0x8ce5('0x92')));_0x4f1d5b['use'](_0x8ce5('0x93'),require('./api/intZendeskAccount'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x94'),require(_0x8ce5('0x95')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x96'),require('./api/intZendeskField'));_0x4f1d5b[_0x8ce5('0x6')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x97'),require('./api/intFreshdeskConfiguration'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x98'),require('./api/intFreshdeskField'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x99'),require(_0x8ce5('0x9a')));_0x4f1d5b[_0x8ce5('0x6')]('/api/integrations/vtiger/configurations',require(_0x8ce5('0x9b')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x9c'),require(_0x8ce5('0x9d')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0x9e'),require(_0x8ce5('0x9f')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xa0'),require(_0x8ce5('0xa1')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xa2'),require(_0x8ce5('0xa3')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xa4'),require(_0x8ce5('0xa5')));_0x4f1d5b[_0x8ce5('0x6')]('/api/integrations/dynamics365/configurations',require(_0x8ce5('0xa6')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xa7'),require('./api/intDynamics365Field'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xa8'),require(_0x8ce5('0xa9')));_0x4f1d5b[_0x8ce5('0x6')]('/api/integrations/freshsales/configurations',require(_0x8ce5('0xaa')));_0x4f1d5b[_0x8ce5('0x6')]('/api/integrations/freshsales/fields',require(_0x8ce5('0xab')));_0x4f1d5b[_0x8ce5('0x6')]('/api/networks',require(_0x8ce5('0xac')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xad'),require(_0x8ce5('0xae')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xaf'),require('./api/chatInternalMessage'));_0x4f1d5b[_0x8ce5('0x6')]('/api/jscripty/answers/reports',require(_0x8ce5('0xb0')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xb1'),require('./api/jscriptyQuestionReport'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xb2'),require(_0x8ce5('0xb3')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xb4'),require(_0x8ce5('0xb5')));_0x4f1d5b['use'](_0x8ce5('0xb6'),require(_0x8ce5('0xb7')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xb8'),require(_0x8ce5('0xb9')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xba'),require(_0x8ce5('0xbb')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xbc'),require(_0x8ce5('0xbd')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xbe'),require(_0x8ce5('0xbf')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xc0'),require(_0x8ce5('0xc1')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xc2'),require(_0x8ce5('0xc3')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xc4'),require(_0x8ce5('0xc5')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xc6'),require(_0x8ce5('0xc7')));_0x4f1d5b[_0x8ce5('0x6')]('/api/license',require(_0x8ce5('0xc8')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xc9'),require('./api/campaign'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xca'),require('./api/migration'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xcb'),require(_0x8ce5('0xcc')));_0x4f1d5b[_0x8ce5('0x6')]('/api/plugins',require(_0x8ce5('0xcd')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xce'),require(_0x8ce5('0xcf')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xd0'),require(_0x8ce5('0xd1')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xd2'),require('./api/faxTransferReport'));_0x4f1d5b[_0x8ce5('0x6')]('/api/openchannel/reports/transfer',require(_0x8ce5('0xd3')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xd4'),require(_0x8ce5('0xd5')));_0x4f1d5b['use'](_0x8ce5('0xd6'),require('./api/cmList'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xd7'),require('./api/voicePrefix'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xd8'),require(_0x8ce5('0xd9')));_0x4f1d5b[_0x8ce5('0x6')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xda'),require('./api/userProfileResource'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xdb'),require('./api/userNotification'));_0x4f1d5b['use']('/api/whatsapp/accounts',require(_0x8ce5('0xdc')));_0x4f1d5b['use']('/api/whatsapp/applications',require(_0x8ce5('0xdd')));_0x4f1d5b[_0x8ce5('0x6')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xde'),require(_0x8ce5('0xdf')));_0x4f1d5b[_0x8ce5('0x6')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x4f1d5b[_0x8ce5('0x6')]('/api/whatsapp/reports/transfer',require(_0x8ce5('0xe0')));_0x4f1d5b['use'](_0x8ce5('0xe1'),require(_0x8ce5('0xe2')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xe3'),require(_0x8ce5('0xe4')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xe5'),require(_0x8ce5('0xe6')));_0x4f1d5b[_0x8ce5('0x6')]('/api/user-settings',require(_0x8ce5('0xe7')));_0x4f1d5b['use'](_0x8ce5('0xe8'),require('./api/authLocal'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xe9'),require(_0x8ce5('0xea')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xeb'),require(_0x8ce5('0xec')));_0x4f1d5b[_0x8ce5('0x6')]('/api/jira',require(_0x8ce5('0xed')));_0x4f1d5b['use']('/api/rpc',require(_0x8ce5('0xee')));_0x4f1d5b['use'](_0x8ce5('0xef'),require(_0x8ce5('0xf0')));_0x4f1d5b['use']('/api/system',require('./api/system'));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xf1'),require(_0x8ce5('0xf2')));_0x4f1d5b[_0x8ce5('0x6')]('/api/webbar',require(_0x8ce5('0xf3')));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xf4'),clientSideLogs);_0x4f1d5b['use'](_0x8ce5('0xf5'),express[_0x8ce5('0xf6')](path[_0x8ce5('0xf7')](config['root'],'/apidoc')));_0x4f1d5b['use'](_0x8ce5('0xf8'),express[_0x8ce5('0xf6')](path[_0x8ce5('0xf7')](config[_0x8ce5('0xf9')],_0x8ce5('0xf8'))));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xfa'),express[_0x8ce5('0xf6')](path[_0x8ce5('0xf7')](config[_0x8ce5('0xf9')],_0x8ce5('0xfa'))));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xfb'),express[_0x8ce5('0xf6')](path[_0x8ce5('0xf7')](config[_0x8ce5('0xf9')],_0x8ce5('0xfc'),_0x8ce5('0xfd'))));_0x4f1d5b[_0x8ce5('0x6')](_0x8ce5('0xfe'),express[_0x8ce5('0xf6')](path[_0x8ce5('0xf7')](config['root'],_0x8ce5('0xff'))));_0x4f1d5b['route']('/:url(api|auth|components|app|bower_components|assets)/*')[_0x8ce5('0x100')](errors[0x194]);_0x4f1d5b[_0x8ce5('0x101')]('/*')[_0x8ce5('0x100')](function(_0x1cade1,_0x4ea89f){_0x4ea89f['sendFile'](path['resolve'](_0x4f1d5b[_0x8ce5('0x100')](_0x8ce5('0x102'))+_0x8ce5('0x103')));});return _0x4f1d5b;});}; \ No newline at end of file +var _0x0032=['/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/license','./api/campaign','./api/migration','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','/index.html','path','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/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/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/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/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField'];(function(_0xd558c,_0x4d3fc0){var _0x4abc73=function(_0x1c4aef){while(--_0x1c4aef){_0xd558c['push'](_0xd558c['shift']());}};_0x4abc73(++_0x4d3fc0);}(_0x0032,0xbb));var _0x2003=function(_0x5362da,_0x5e53dd){_0x5362da=_0x5362da-0x0;var _0x3d968=_0x0032[_0x5362da];return _0x3d968;};'use strict';var path=require(_0x2003('0x0'));var express=require('express');var errors=require(_0x2003('0x1'));var config=require(_0x2003('0x2'));var setupLoggers=require(_0x2003('0x3'))[_0x2003('0x4')];var clientSideLogs=require('./api/client-side-logs');exports[_0x2003('0x5')]=function(_0x16c59d){return setupLoggers(_0x16c59d)['then'](function(){_0x16c59d[_0x2003('0x6')](_0x2003('0x7'),require(_0x2003('0x8')));_0x16c59d['use'](_0x2003('0x9'),require(_0x2003('0xa')));_0x16c59d[_0x2003('0x6')](_0x2003('0xb'),require(_0x2003('0xc')));_0x16c59d[_0x2003('0x6')](_0x2003('0xd'),require(_0x2003('0xe')));_0x16c59d[_0x2003('0x6')](_0x2003('0xf'),require('./api/voiceMusicOnHold'));_0x16c59d[_0x2003('0x6')]('/api/voice/queues',require('./api/voiceQueue'));_0x16c59d[_0x2003('0x6')](_0x2003('0x10'),require(_0x2003('0x11')));_0x16c59d[_0x2003('0x6')](_0x2003('0x12'),require(_0x2003('0x13')));_0x16c59d[_0x2003('0x6')](_0x2003('0x14'),require(_0x2003('0x15')));_0x16c59d['use'](_0x2003('0x16'),require(_0x2003('0x17')));_0x16c59d[_0x2003('0x6')](_0x2003('0x18'),require(_0x2003('0x19')));_0x16c59d[_0x2003('0x6')](_0x2003('0x1a'),require('./api/voiceDialReport'));_0x16c59d[_0x2003('0x6')](_0x2003('0x1b'),require(_0x2003('0x1c')));_0x16c59d['use'](_0x2003('0x1d'),require('./api/voiceQueueReport'));_0x16c59d[_0x2003('0x6')](_0x2003('0x1e'),require(_0x2003('0x1f')));_0x16c59d[_0x2003('0x6')](_0x2003('0x20'),require(_0x2003('0x21')));_0x16c59d[_0x2003('0x6')](_0x2003('0x22'),require(_0x2003('0x23')));_0x16c59d[_0x2003('0x6')]('/api/mail/out_servers',require(_0x2003('0x24')));_0x16c59d[_0x2003('0x6')](_0x2003('0x25'),require(_0x2003('0x26')));_0x16c59d['use']('/api/mail/queues',require(_0x2003('0x27')));_0x16c59d[_0x2003('0x6')](_0x2003('0x28'),require(_0x2003('0x29')));_0x16c59d[_0x2003('0x6')](_0x2003('0x2a'),require('./api/mailInteraction'));_0x16c59d['use'](_0x2003('0x2b'),require(_0x2003('0x2c')));_0x16c59d['use'](_0x2003('0x2d'),require('./api/mailApplication'));_0x16c59d['use'](_0x2003('0x2e'),require('./api/mailQueueReport'));_0x16c59d['use'](_0x2003('0x2f'),require(_0x2003('0x30')));_0x16c59d[_0x2003('0x6')]('/api/dashboards/items',require(_0x2003('0x31')));_0x16c59d['use'](_0x2003('0x32'),require(_0x2003('0x33')));_0x16c59d[_0x2003('0x6')](_0x2003('0x34'),require(_0x2003('0x35')));_0x16c59d['use'](_0x2003('0x36'),require(_0x2003('0x37')));_0x16c59d[_0x2003('0x6')](_0x2003('0x38'),require(_0x2003('0x39')));_0x16c59d[_0x2003('0x6')](_0x2003('0x3a'),require(_0x2003('0x3b')));_0x16c59d[_0x2003('0x6')](_0x2003('0x3c'),require(_0x2003('0x3d')));_0x16c59d['use']('/api/sms/accounts',require(_0x2003('0x3e')));_0x16c59d[_0x2003('0x6')]('/api/sms/applications',require(_0x2003('0x3f')));_0x16c59d['use'](_0x2003('0x40'),require(_0x2003('0x41')));_0x16c59d[_0x2003('0x6')]('/api/sms/messages',require(_0x2003('0x42')));_0x16c59d['use'](_0x2003('0x43'),require(_0x2003('0x44')));_0x16c59d[_0x2003('0x6')]('/api/openchannel/accounts',require(_0x2003('0x45')));_0x16c59d[_0x2003('0x6')](_0x2003('0x46'),require(_0x2003('0x47')));_0x16c59d[_0x2003('0x6')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x16c59d['use'](_0x2003('0x48'),require(_0x2003('0x49')));_0x16c59d[_0x2003('0x6')](_0x2003('0x4a'),require(_0x2003('0x4b')));_0x16c59d[_0x2003('0x6')](_0x2003('0x4c'),require(_0x2003('0x4d')));_0x16c59d['use']('/api/openchannel/reports/queue',require(_0x2003('0x4e')));_0x16c59d[_0x2003('0x6')](_0x2003('0x4f'),require(_0x2003('0x50')));_0x16c59d[_0x2003('0x6')]('/api/chat/interactions',require(_0x2003('0x51')));_0x16c59d[_0x2003('0x6')](_0x2003('0x52'),require(_0x2003('0x53')));_0x16c59d[_0x2003('0x6')](_0x2003('0x54'),require(_0x2003('0x55')));_0x16c59d['use'](_0x2003('0x56'),require('./api/chatQueue'));_0x16c59d[_0x2003('0x6')](_0x2003('0x57'),require(_0x2003('0x58')));_0x16c59d[_0x2003('0x6')](_0x2003('0x59'),require(_0x2003('0x5a')));_0x16c59d[_0x2003('0x6')](_0x2003('0x5b'),require(_0x2003('0x5c')));_0x16c59d[_0x2003('0x6')](_0x2003('0x5d'),require('./api/cmContact'));_0x16c59d[_0x2003('0x6')](_0x2003('0x5e'),require(_0x2003('0x5f')));_0x16c59d[_0x2003('0x6')]('/api/cm/hopper_black',require(_0x2003('0x60')));_0x16c59d[_0x2003('0x6')](_0x2003('0x61'),require(_0x2003('0x62')));_0x16c59d['use'](_0x2003('0x63'),require(_0x2003('0x64')));_0x16c59d['use'](_0x2003('0x65'),require(_0x2003('0x66')));_0x16c59d[_0x2003('0x6')](_0x2003('0x67'),require(_0x2003('0x68')));_0x16c59d[_0x2003('0x6')](_0x2003('0x69'),require(_0x2003('0x6a')));_0x16c59d['use'](_0x2003('0x6b'),require(_0x2003('0x6c')));_0x16c59d[_0x2003('0x6')](_0x2003('0x6d'),require(_0x2003('0x6e')));_0x16c59d['use'](_0x2003('0x6f'),require(_0x2003('0x70')));_0x16c59d[_0x2003('0x6')](_0x2003('0x71'),require(_0x2003('0x72')));_0x16c59d['use'](_0x2003('0x73'),require(_0x2003('0x74')));_0x16c59d[_0x2003('0x6')](_0x2003('0x75'),require(_0x2003('0x76')));_0x16c59d[_0x2003('0x6')](_0x2003('0x77'),require(_0x2003('0x78')));_0x16c59d[_0x2003('0x6')](_0x2003('0x79'),require(_0x2003('0x7a')));_0x16c59d[_0x2003('0x6')]('/api/sounds',require(_0x2003('0x7b')));_0x16c59d[_0x2003('0x6')]('/api/tags',require(_0x2003('0x7c')));_0x16c59d[_0x2003('0x6')](_0x2003('0x7d'),require('./api/contactItemType'));_0x16c59d[_0x2003('0x6')](_0x2003('0x7e'),require(_0x2003('0x7f')));_0x16c59d[_0x2003('0x6')]('/api/cm_hopper_additional_phones',require(_0x2003('0x80')));_0x16c59d[_0x2003('0x6')](_0x2003('0x81'),require(_0x2003('0x82')));_0x16c59d[_0x2003('0x6')](_0x2003('0x83'),require(_0x2003('0x84')));_0x16c59d[_0x2003('0x6')](_0x2003('0x85'),require(_0x2003('0x86')));_0x16c59d[_0x2003('0x6')](_0x2003('0x87'),require(_0x2003('0x88')));_0x16c59d[_0x2003('0x6')](_0x2003('0x89'),require(_0x2003('0x8a')));_0x16c59d[_0x2003('0x6')]('/api/analytics/custom_reports',require(_0x2003('0x8b')));_0x16c59d[_0x2003('0x6')](_0x2003('0x8c'),require(_0x2003('0x8d')));_0x16c59d[_0x2003('0x6')]('/api/analytics/extracted_reports',require(_0x2003('0x8e')));_0x16c59d[_0x2003('0x6')](_0x2003('0x8f'),require(_0x2003('0x90')));_0x16c59d['use'](_0x2003('0x91'),require('./api/analyticFieldReport'));_0x16c59d['use'](_0x2003('0x92'),require('./api/analyticTreeReport'));_0x16c59d[_0x2003('0x6')](_0x2003('0x93'),require(_0x2003('0x94')));_0x16c59d[_0x2003('0x6')](_0x2003('0x95'),require(_0x2003('0x96')));_0x16c59d['use']('/api/integrations/salesforce/fields',require(_0x2003('0x97')));_0x16c59d[_0x2003('0x6')](_0x2003('0x98'),require('./api/intSugarcrmAccount'));_0x16c59d[_0x2003('0x6')](_0x2003('0x99'),require(_0x2003('0x9a')));_0x16c59d['use'](_0x2003('0x9b'),require('./api/intSugarcrmField'));_0x16c59d[_0x2003('0x6')](_0x2003('0x9c'),require(_0x2003('0x9d')));_0x16c59d['use'](_0x2003('0x9e'),require(_0x2003('0x9f')));_0x16c59d[_0x2003('0x6')]('/api/integrations/desk/fields',require(_0x2003('0xa0')));_0x16c59d['use']('/api/integrations/zoho/accounts',require(_0x2003('0xa1')));_0x16c59d[_0x2003('0x6')]('/api/integrations/zoho/configurations',require(_0x2003('0xa2')));_0x16c59d[_0x2003('0x6')](_0x2003('0xa3'),require('./api/intZohoField'));_0x16c59d[_0x2003('0x6')](_0x2003('0xa4'),require(_0x2003('0xa5')));_0x16c59d[_0x2003('0x6')](_0x2003('0xa6'),require(_0x2003('0xa7')));_0x16c59d['use'](_0x2003('0xa8'),require(_0x2003('0xa9')));_0x16c59d[_0x2003('0x6')](_0x2003('0xaa'),require(_0x2003('0xab')));_0x16c59d[_0x2003('0x6')](_0x2003('0xac'),require(_0x2003('0xad')));_0x16c59d[_0x2003('0x6')](_0x2003('0xae'),require('./api/intFreshdeskField'));_0x16c59d[_0x2003('0x6')](_0x2003('0xaf'),require('./api/intVtigerAccount'));_0x16c59d[_0x2003('0x6')](_0x2003('0xb0'),require(_0x2003('0xb1')));_0x16c59d['use'](_0x2003('0xb2'),require('./api/intVtigerField'));_0x16c59d[_0x2003('0x6')]('/api/integrations/servicenow/accounts',require(_0x2003('0xb3')));_0x16c59d[_0x2003('0x6')](_0x2003('0xb4'),require(_0x2003('0xb5')));_0x16c59d[_0x2003('0x6')](_0x2003('0xb6'),require('./api/intServicenowField'));_0x16c59d[_0x2003('0x6')](_0x2003('0xb7'),require(_0x2003('0xb8')));_0x16c59d[_0x2003('0x6')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x16c59d[_0x2003('0x6')](_0x2003('0xb9'),require(_0x2003('0xba')));_0x16c59d[_0x2003('0x6')](_0x2003('0xbb'),require(_0x2003('0xbc')));_0x16c59d[_0x2003('0x6')](_0x2003('0xbd'),require(_0x2003('0xbe')));_0x16c59d[_0x2003('0x6')](_0x2003('0xbf'),require(_0x2003('0xc0')));_0x16c59d[_0x2003('0x6')](_0x2003('0xc1'),require(_0x2003('0xc2')));_0x16c59d[_0x2003('0x6')](_0x2003('0xc3'),require(_0x2003('0xc4')));_0x16c59d[_0x2003('0x6')](_0x2003('0xc5'),require('./api/chatInternalMessage'));_0x16c59d[_0x2003('0x6')](_0x2003('0xc6'),require('./api/jscriptyAnswerReport'));_0x16c59d['use'](_0x2003('0xc7'),require(_0x2003('0xc8')));_0x16c59d[_0x2003('0x6')](_0x2003('0xc9'),require(_0x2003('0xca')));_0x16c59d['use']('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x16c59d[_0x2003('0x6')](_0x2003('0xcb'),require(_0x2003('0xcc')));_0x16c59d[_0x2003('0x6')](_0x2003('0xcd'),require(_0x2003('0xce')));_0x16c59d[_0x2003('0x6')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x16c59d[_0x2003('0x6')](_0x2003('0xcf'),require(_0x2003('0xd0')));_0x16c59d[_0x2003('0x6')](_0x2003('0xd1'),require(_0x2003('0xd2')));_0x16c59d['use'](_0x2003('0xd3'),require(_0x2003('0xd4')));_0x16c59d[_0x2003('0x6')](_0x2003('0xd5'),require('./api/squareRecording'));_0x16c59d[_0x2003('0x6')](_0x2003('0xd6'),require(_0x2003('0xd7')));_0x16c59d['use'](_0x2003('0xd8'),require('./api/team'));_0x16c59d[_0x2003('0x6')]('/api/license',require(_0x2003('0xd9')));_0x16c59d[_0x2003('0x6')]('/api/campaigns',require(_0x2003('0xda')));_0x16c59d['use']('/api/migrations',require(_0x2003('0xdb')));_0x16c59d[_0x2003('0x6')]('/api/attachments',require(_0x2003('0xdc')));_0x16c59d[_0x2003('0x6')](_0x2003('0xdd'),require(_0x2003('0xde')));_0x16c59d[_0x2003('0x6')](_0x2003('0xdf'),require('./api/mailTransferReport'));_0x16c59d['use']('/api/chat/reports/transfer',require(_0x2003('0xe0')));_0x16c59d[_0x2003('0x6')](_0x2003('0xe1'),require(_0x2003('0xe2')));_0x16c59d[_0x2003('0x6')](_0x2003('0xe3'),require(_0x2003('0xe4')));_0x16c59d[_0x2003('0x6')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x16c59d[_0x2003('0x6')](_0x2003('0xe5'),require(_0x2003('0xe6')));_0x16c59d['use'](_0x2003('0xe7'),require(_0x2003('0xe8')));_0x16c59d[_0x2003('0x6')](_0x2003('0xe9'),require(_0x2003('0xea')));_0x16c59d[_0x2003('0x6')](_0x2003('0xeb'),require(_0x2003('0xec')));_0x16c59d[_0x2003('0x6')](_0x2003('0xed'),require('./api/userProfileResource'));_0x16c59d[_0x2003('0x6')](_0x2003('0xee'),require(_0x2003('0xef')));_0x16c59d[_0x2003('0x6')](_0x2003('0xf0'),require(_0x2003('0xf1')));_0x16c59d[_0x2003('0x6')](_0x2003('0xf2'),require(_0x2003('0xf3')));_0x16c59d['use'](_0x2003('0xf4'),require(_0x2003('0xf5')));_0x16c59d[_0x2003('0x6')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x16c59d[_0x2003('0x6')]('/api/whatsapp/reports/queue',require(_0x2003('0xf6')));_0x16c59d[_0x2003('0x6')]('/api/whatsapp/reports/transfer',require(_0x2003('0xf7')));_0x16c59d['use'](_0x2003('0xf8'),require(_0x2003('0xf9')));_0x16c59d[_0x2003('0x6')](_0x2003('0xfa'),require(_0x2003('0xfb')));_0x16c59d[_0x2003('0x6')](_0x2003('0xfc'),require(_0x2003('0xfd')));_0x16c59d[_0x2003('0x6')](_0x2003('0xfe'),require(_0x2003('0xff')));_0x16c59d[_0x2003('0x6')](_0x2003('0x100'),require(_0x2003('0x101')));_0x16c59d[_0x2003('0x6')](_0x2003('0x102'),require(_0x2003('0x103')));_0x16c59d['use'](_0x2003('0x104'),require(_0x2003('0x105')));_0x16c59d[_0x2003('0x6')](_0x2003('0x106'),require(_0x2003('0x107')));_0x16c59d[_0x2003('0x6')](_0x2003('0x108'),require(_0x2003('0x109')));_0x16c59d[_0x2003('0x6')](_0x2003('0x10a'),require(_0x2003('0x10b')));_0x16c59d[_0x2003('0x6')](_0x2003('0x10c'),require(_0x2003('0x10d')));_0x16c59d[_0x2003('0x6')](_0x2003('0x10e'),require(_0x2003('0x10f')));_0x16c59d[_0x2003('0x6')](_0x2003('0x110'),require(_0x2003('0x111')));_0x16c59d[_0x2003('0x6')](_0x2003('0x112'),clientSideLogs);_0x16c59d[_0x2003('0x6')](_0x2003('0x113'),express[_0x2003('0x114')](path[_0x2003('0x115')](config[_0x2003('0x116')],'/apidoc')));_0x16c59d[_0x2003('0x6')]('/www',express[_0x2003('0x114')](path['join'](config[_0x2003('0x116')],'/www')));_0x16c59d[_0x2003('0x6')]('/demo',express[_0x2003('0x114')](path[_0x2003('0x115')](config[_0x2003('0x116')],_0x2003('0x117'))));_0x16c59d[_0x2003('0x6')](_0x2003('0x118'),express[_0x2003('0x114')](path[_0x2003('0x115')](config[_0x2003('0x116')],_0x2003('0x119'),_0x2003('0x11a'))));_0x16c59d[_0x2003('0x6')](_0x2003('0x11b'),express[_0x2003('0x114')](path[_0x2003('0x115')](config[_0x2003('0x116')],_0x2003('0x11c'))));_0x16c59d[_0x2003('0x11d')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x2003('0x11e')](errors[0x194]);_0x16c59d[_0x2003('0x11d')]('/*')[_0x2003('0x11e')](function(_0xf07cb6,_0x11dfd9){_0x11dfd9[_0x2003('0x11f')](path[_0x2003('0x120')](_0x16c59d[_0x2003('0x11e')]('appPath')+_0x2003('0x121')));});return _0x16c59d;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 5f654e8..cc5d340 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0dd6=['merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','../config/environment','listen'];(function(_0x380e9c,_0x3a7675){var _0x56a468=function(_0x5f0408){while(--_0x5f0408){_0x380e9c['push'](_0x380e9c['shift']());}};_0x56a468(++_0x3a7675);}(_0x0dd6,0xca));var _0x60dd=function(_0x564cf3,_0x595b52){_0x564cf3=_0x564cf3-0x0;var _0x9cd21e=_0x0dd6[_0x564cf3];return _0x9cd21e;};'use strict';var jayson=require('jayson/promise');var _=require('lodash');var config=require(_0x60dd('0x0'));exports[_0x60dd('0x1')]=function(){return new Promise(function(_0x292e8,_0x200bcf){var _0x1cf933={};_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x3')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x4')));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0x5')));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0x6')));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0x7')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x8')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x9')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0xa')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/memberReport/memberReport.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0xb')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0xc')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0xd')));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0xe')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/mailAccount/mailAccount.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0xf')));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0x10')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/mailMessage/mailMessage.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x11')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x12')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/faxAccount/faxAccount.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x13')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x14')));_0x1cf933=_['merge'](_0x1cf933,require('../api/faxMessage/faxMessage.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x15')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x16')));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0x17')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x18')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x19')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x1a')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x1b')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x1c')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x1d')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/chatInteraction/chatInteraction.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x1e')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x1f')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x20')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/cmHopper/cmHopper.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x21')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x22')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x23')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x24')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x25')));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0x26')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x27')));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0x28')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/trigger/trigger.rpc'));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0x29')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x2a')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x2b')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x2c')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x1cf933=_['merge'](_0x1cf933,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0x2d')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x2e')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x2f')));_0x1cf933=_['merge'](_0x1cf933,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0x30')));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0x31')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x32')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/setting/setting.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/squareOdbc/squareOdbc.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x33')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/squareRecording/squareRecording.rpc'));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0x34')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/campaign/campaign.rpc'));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x35')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x36')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require(_0x60dd('0x37')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0x38')));_0x1cf933=_['merge'](_0x1cf933,require(_0x60dd('0x39')));_0x1cf933=_[_0x60dd('0x2')](_0x1cf933,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x514ea6=jayson[_0x60dd('0x3a')](_0x1cf933)[_0x60dd('0x3b')]();var _0x18a313=config[_0x60dd('0x3c')][_0x60dd('0x3d')]||config[_0x60dd('0x3d')]+0x1;var _0x367098=config[_0x60dd('0x3c')]['ip']||_0x60dd('0x3e');_0x514ea6['on'](_0x60dd('0x3f'),function(_0xc0f02d){return _0x200bcf(_0xc0f02d);});_0x514ea6['listen'](_0x18a313,_0x367098,function(){console['log'](_0x60dd('0x40'),_0x367098,_0x18a313);require(_0x60dd('0x41'))[_0x60dd('0x42')]();return _0x292e8(_0x60dd('0x43')+_0x367098+':'+_0x18a313);});});}; \ No newline at end of file +var _0x0f89=['../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.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','http','rpc','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc'];(function(_0x41d3e0,_0x3e52a7){var _0x5c058c=function(_0x55da35){while(--_0x55da35){_0x41d3e0['push'](_0x41d3e0['shift']());}};_0x5c058c(++_0x3e52a7);}(_0x0f89,0x111));var _0x90f8=function(_0x2bbc0b,_0x2439f6){_0x2bbc0b=_0x2bbc0b-0x0;var _0x4efef5=_0x0f89[_0x2bbc0b];return _0x4efef5;};'use strict';var jayson=require(_0x90f8('0x0'));var _=require(_0x90f8('0x1'));var config=require(_0x90f8('0x2'));exports['listen']=function(){return new Promise(function(_0x30231a,_0x344939){var _0x19774b={};_0x19774b=_[_0x90f8('0x3')](_0x19774b,require('../api/user/user.rpc'));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x4')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x5')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x6')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x7')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x8')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x9')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0xa')));_0x19774b=_['merge'](_0x19774b,require('../api/memberReport/memberReport.rpc'));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0xb')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0xc')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0xd')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0xe')));_0x19774b=_['merge'](_0x19774b,require('../api/mailAccount/mailAccount.rpc'));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0xf')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x10')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x11')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x12')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x13')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x14')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x15')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require('../api/faxMessage/faxMessage.rpc'));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x16')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x17')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x18')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x19')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x1a')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x1b')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x1c')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x1d')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x1e')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x1f')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require('../api/chatInteraction/chatInteraction.rpc'));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x20')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x21')));_0x19774b=_['merge'](_0x19774b,require('../api/cmContact/cmContact.rpc'));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x22')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x23')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x24')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x25')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x26')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x27')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x28')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x29')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x2a')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x2b')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x2c')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x2d')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x2e')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x2f')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x30')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x31')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x32')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x33')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x34')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x35')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x36')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x37')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x38')));_0x19774b=_['merge'](_0x19774b,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x39')));_0x19774b=_['merge'](_0x19774b,require('../api/squareOdbc/squareOdbc.rpc'));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x3a')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x3b')));_0x19774b=_['merge'](_0x19774b,require('../api/squareMessage/squareMessage.rpc'));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require('../api/campaign/campaign.rpc'));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x3c')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x3d')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x3e')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x3f')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require(_0x90f8('0x40')));_0x19774b=_['merge'](_0x19774b,require(_0x90f8('0x41')));_0x19774b=_[_0x90f8('0x3')](_0x19774b,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x241308=jayson['server'](_0x19774b)[_0x90f8('0x42')]();var _0x232079=config[_0x90f8('0x43')]['port']||config['port']+0x1;var _0x4a5bb1=config[_0x90f8('0x43')]['ip']||_0x90f8('0x44');_0x241308['on'](_0x90f8('0x45'),function(_0x3600ce){return _0x344939(_0x3600ce);});_0x241308[_0x90f8('0x46')](_0x232079,_0x4a5bb1,function(){console[_0x90f8('0x47')](_0x90f8('0x48'),_0x4a5bb1,_0x232079);require(_0x90f8('0x49'))['default']();return _0x30231a(_0x90f8('0x4a')+_0x4a5bb1+':'+_0x232079);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index d074950..b49968d 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 _0x6e4d=['result=','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','sendRequest','sync','ANSWER','getData','beep','format','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setExtension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','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','lodash','EventEmitter','./reply','call','utf8','setTimeout','setEncoding','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace'];(function(_0x1e65f6,_0x3615c9){var _0x5205f1=function(_0x1fecc2){while(--_0x1fecc2){_0x1e65f6['push'](_0x1e65f6['shift']());}};_0x5205f1(++_0x3615c9);}(_0x6e4d,0x1cb));var _0xd6e4=function(_0x57fca6,_0x497213){_0x57fca6=_0x57fca6-0x0;var _0x1f2800=_0x6e4d[_0x57fca6];return _0x1f2800;};'use strict';var util=require(_0xd6e4('0x0'));var _=require(_0xd6e4('0x1'));var EventEmitter=require('events')[_0xd6e4('0x2')];var AGIReply=require(_0xd6e4('0x3'));var AGIError=require('./error');function AGIChannel(_0x1177a4){var _0x2c0410=this,_0x252011=new AGIReply(),_0x52f622=![],_0x5bde1a={};EventEmitter[_0xd6e4('0x4')](_0x2c0410);_0x1177a4['setEncoding'](_0xd6e4('0x5'));_0x1177a4[_0xd6e4('0x6')](0x8*0x3c*0x3c*0x3e8);_0x252011[_0xd6e4('0x7')](_0xd6e4('0x5'));_0x252011['on'](_0xd6e4('0x8'),function(_0x2ea2e2){for(var _0x21b000 in _0x2ea2e2){_0x2c0410[_0x21b000]=_0x2ea2e2[_0x21b000];}_0x2c0410[_0xd6e4('0x9')](_0xd6e4('0xa'));});_0x252011['on'](_0xd6e4('0xb'),function(_0xa413f6){if(_0xa413f6[_0xd6e4('0xc')]()==_0xd6e4('0xd')){_0x2c0410['emit'](_0xd6e4('0xd'));return;}if(_0xa413f6[_0xd6e4('0xe')](0x0,0xb)==_0xd6e4('0xf')){_0x52f622=!![];}if(_0x52f622){_0x5bde1a['rx']+=_0xa413f6+'\x0a';if(_0xa413f6[_0xd6e4('0x10')](_0xd6e4('0x11'))!=-0x1){_0x52f622=![];}}else{_0x5bde1a['rx']=_0xa413f6;}if(_0x52f622){return;}if(typeof _0x5bde1a['cb']==_0xd6e4('0x12')){var _0x75dab=_0x5bde1a['rx'][_0xd6e4('0xe')](0x0,0x3),_0x57c10a=null,_0x1e41f7=null;_0x75dab=parseInt(_0x75dab);if(isNaN(_0x75dab)){_0x5bde1a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xd6e4('0x13')});return;}if(_0x75dab!=0xc8){_0x5bde1a['cb'](null,{'code':_0x75dab,'result':-0x1,'extra':'KO'});return;}_0x57c10a=_0x5bde1a['rx'][_0xd6e4('0xe')](0x4)[_0xd6e4('0x14')](_0xd6e4('0x15'),'');if(_0x57c10a['indexOf']('\x20')!=-0x1){_0x57c10a=_0x57c10a[_0xd6e4('0x16')](0x0,_0x57c10a[_0xd6e4('0x17')]('\x20'));}if(_[_0xd6e4('0x18')](_0x57c10a,'-1')){_0x57c10a=parseInt(_0x57c10a);}_0x1e41f7=_0x5bde1a['rx'][_0xd6e4('0x19')]('\x20');if(_0x1e41f7[_0xd6e4('0x1a')]==0x3){_0x1e41f7=_0x1e41f7[0x2][_0xd6e4('0xe')](0x1,_0x1e41f7[0x2][_0xd6e4('0x1a')]-0x1);}else if(_0x1e41f7[_0xd6e4('0x1a')]>0x3){var _0x270b25=/\((.+)\)/;var _0x566c97=_0x5bde1a['rx'][_0xd6e4('0x1b')](_0x270b25);if(_0x566c97){_0x1e41f7=_0x566c97[0x1];}else{_0x1e41f7=null;}}else{_0x1e41f7=null;}_0x5bde1a['cb'](null,{'code':_0x75dab,'result':_0x57c10a,'extra':_0x1e41f7});}});_0x1177a4['on'](_0xd6e4('0x1c'),function(_0x316637){_0x2c0410[_0xd6e4('0x9')](_0xd6e4('0x1c'),new AGIError(_0xd6e4('0x1d'),_0x316637[_0xd6e4('0x1e')]));});_0x1177a4['on'](_0xd6e4('0x1f'),function(){_0x2c0410[_0xd6e4('0x9')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x1177a4['on'](_0xd6e4('0x20'),function(){_0x2c0410[_0xd6e4('0x9')](_0xd6e4('0x20'),new AGIError(_0xd6e4('0x21')));_0x1177a4[_0xd6e4('0x22')]();});_0x1177a4[_0xd6e4('0x23')](_0x252011);this[_0xd6e4('0x24')]=function(_0x217fe6,_0x269e7e){var _0x217fe6=_0x217fe6||'',_0x269e7e=typeof _0x269e7e==_0xd6e4('0x12')?_0x269e7e:new Function();_0x5bde1a={'tx':_0x217fe6,'rx':'','cb':_0x269e7e};_0x1177a4[_0xd6e4('0x25')](_0x217fe6+'\x0a');},this[_0xd6e4('0x1f')]=function(){_0x1177a4[_0xd6e4('0x22')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xd6e4('0x26')][_0xd6e4('0x27')]=function(_0x22a3c4){return this[_0xd6e4('0x24')][_0xd6e4('0x28')](this,_0x22a3c4);};AGIChannel[_0xd6e4('0x26')]['answer']=function(){return this[_0xd6e4('0x27')](_0xd6e4('0x29'));};AGIChannel[_0xd6e4('0x26')][_0xd6e4('0x2a')]=function(_0x41b06f,_0x249ef3,_0x4e6575){_0x41b06f=_0x41b06f===undefined?_0xd6e4('0x2b'):_0x41b06f;_0x249ef3=_0x249ef3===undefined?'5':_0x249ef3;_0x4e6575=_0x4e6575===undefined?'1':_0x4e6575;return this[_0xd6e4('0x27')](util[_0xd6e4('0x2c')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x41b06f,_0x249ef3*0x3e8,_0x4e6575));};AGIChannel[_0xd6e4('0x26')][_0xd6e4('0x2d')]=function(_0x72d0a9){_0x72d0a9=_0x72d0a9||_0xd6e4('0x2e');return this[_0xd6e4('0x27')](util[_0xd6e4('0x2c')](_0xd6e4('0x2f'),_0x72d0a9));};AGIChannel[_0xd6e4('0x26')]['exec']=function(_0x5d9a2e,_0x1ec9ce){if(_[_0xd6e4('0x30')](_0x1ec9ce)){return this[_0xd6e4('0x27')](util['format']('EXEC\x20%s\x20%s',_0x5d9a2e,_0x1ec9ce['join'](',')));}return this[_0xd6e4('0x27')](util[_0xd6e4('0x2c')](_0xd6e4('0x31'),_0x5d9a2e,_0x1ec9ce));};AGIChannel['prototype'][_0xd6e4('0x32')]=function(_0x339fac){return this[_0xd6e4('0x27')](util[_0xd6e4('0x2c')](_0xd6e4('0x33'),_0x339fac));};AGIChannel[_0xd6e4('0x26')]['setExtension']=function(_0x10ff85){return this[_0xd6e4('0x27')](util[_0xd6e4('0x2c')](_0xd6e4('0x34'),_0x10ff85));};AGIChannel['prototype']['setPriority']=function(_0x5db7e8){return this[_0xd6e4('0x27')](util[_0xd6e4('0x2c')](_0xd6e4('0x35'),_0x5db7e8));};AGIChannel[_0xd6e4('0x26')][_0xd6e4('0xd')]=function(){return this[_0xd6e4('0x27')]('HANGUP');};AGIChannel['prototype'][_0xd6e4('0x36')]=function(_0x254104,_0x20cd60){var _0xf78011=_[_0xd6e4('0x37')](_0x20cd60)||_[_0xd6e4('0x38')](_0x20cd60)?_0x20cd60[_0xd6e4('0x39')]():_0x20cd60;return this[_0xd6e4('0x27')](util[_0xd6e4('0x2c')](_0xd6e4('0x3a'),_0x254104,_0xf78011?_0xf78011['toString']()[_0xd6e4('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xd6e4('0x26')]['sayNumber']=function(_0x2d1e83,_0x10aa79){return this[_0xd6e4('0x27')](util[_0xd6e4('0x2c')](_0xd6e4('0x3b'),_0x2d1e83,_0x10aa79));};AGIChannel[_0xd6e4('0x26')][_0xd6e4('0x3c')]=function(_0x46aee8,_0x2f991c){return this[_0xd6e4('0x27')](util[_0xd6e4('0x2c')](_0xd6e4('0x3d'),_0x46aee8,_0x2f991c));};AGIChannel[_0xd6e4('0x26')][_0xd6e4('0x3e')]=function(_0x8715d9,_0x523b7a){return this['sendRequest'](util['format'](_0xd6e4('0x3f'),_0x8715d9,_0x523b7a));};AGIChannel['prototype'][_0xd6e4('0x40')]=function(_0x184d0e,_0x5ec6b0,_0x63c1e5){_0x5ec6b0=_0x5ec6b0||this['extension'];_0x63c1e5=_0x63c1e5||0x1;this['setContext'](_0x184d0e);this[_0xd6e4('0x41')](_0x5ec6b0);this[_0xd6e4('0x42')](_0x63c1e5);return this[_0xd6e4('0x2d')](util[_0xd6e4('0x2c')](_0xd6e4('0x43'),_0x184d0e,_0x5ec6b0,_0x63c1e5));};AGIChannel[_0xd6e4('0x26')][_0xd6e4('0x44')]=function(_0x1dafd5){return this[_0xd6e4('0x27')](util[_0xd6e4('0x2c')](_0xd6e4('0x45'),_0x1dafd5));};AGIChannel[_0xd6e4('0x26')][_0xd6e4('0x46')]=function(_0x15aa33,_0x3eed47,_0xd5cc6e,_0x55d36c,_0x25aa90,_0x55fd56){_0x3eed47=_0x3eed47||_0xd6e4('0x47');_0xd5cc6e=_0xd5cc6e||'';_0x55d36c=_0x55d36c===undefined?-0x1:_0x55d36c==='-1'?-0x1:_0x55d36c*0x3e8;_0x25aa90=_0x25aa90===undefined?'':'s='+_0x25aa90;_0x55fd56=_0x55fd56?'BEEP':'';return this[_0xd6e4('0x27')](util[_0xd6e4('0x2c')](_0xd6e4('0x48'),_0x15aa33,_0x3eed47,_0xd5cc6e,_0x55d36c,_0x55fd56,_0x25aa90));};AGIChannel[_0xd6e4('0x26')][_0xd6e4('0x49')]=function(_0x3487da,_0x22cfca){_0x22cfca=_0x22cfca||'';return this['sendRequest'](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x3487da,_0x22cfca));};AGIChannel[_0xd6e4('0x26')][_0xd6e4('0x4a')]=function(_0xc3569c){return this['exec'](_0xd6e4('0x4b'),_0xc3569c);};AGIChannel[_0xd6e4('0x26')]['wait']=function(_0x1e1e0a){return this['exec'](_0xd6e4('0x4c'),_0x1e1e0a);};AGIChannel['prototype'][_0xd6e4('0x1c')]=function(_0x7f0289,_0x2f25b6){this[_0xd6e4('0x2d')](util['format'](_0xd6e4('0x4d'),_0x7f0289['id'],_0x7f0289[_0xd6e4('0x4e')],_0x2f25b6));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xd6e4('0x4f')]=AGIChannel; \ No newline at end of file +var _0x1e8b=['recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','./reply','setEncoding','utf8','setTimeout','emit','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','result=','indexOf','substr','startsWith','split','length','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','sendRequest','command','sync','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22'];(function(_0xf9f40e,_0x5cbfb1){var _0x148283=function(_0x1f180e){while(--_0x1f180e){_0xf9f40e['push'](_0xf9f40e['shift']());}};_0x148283(++_0x5cbfb1);}(_0x1e8b,0xf0));var _0xb1e8=function(_0x365009,_0x215c27){_0x365009=_0x365009-0x0;var _0x19fc0c=_0x1e8b[_0x365009];return _0x19fc0c;};'use strict';var util=require('util');var _=require(_0xb1e8('0x0'));var EventEmitter=require(_0xb1e8('0x1'))['EventEmitter'];var AGIReply=require(_0xb1e8('0x2'));var AGIError=require('./error');function AGIChannel(_0x37a6a8){var _0x1b40cc=this,_0x432c60=new AGIReply(),_0x20bfb4=![],_0x4ee14f={};EventEmitter['call'](_0x1b40cc);_0x37a6a8[_0xb1e8('0x3')](_0xb1e8('0x4'));_0x37a6a8[_0xb1e8('0x5')](0x8*0x3c*0x3c*0x3e8);_0x432c60['setEncoding'](_0xb1e8('0x4'));_0x432c60['on']('headers',function(_0x3d0067){for(var _0x307b68 in _0x3d0067){_0x1b40cc[_0x307b68]=_0x3d0067[_0x307b68];}_0x1b40cc[_0xb1e8('0x6')]('ready');});_0x432c60['on']('line',function(_0x4ef888){if(_0x4ef888['toLowerCase']()==_0xb1e8('0x7')){_0x1b40cc['emit'](_0xb1e8('0x7'));return;}if(_0x4ef888[_0xb1e8('0x8')](0x0,0xb)==_0xb1e8('0x9')){_0x20bfb4=!![];}if(_0x20bfb4){_0x4ee14f['rx']+=_0x4ef888+'\x0a';if(_0x4ef888[_0xb1e8('0xa')](_0xb1e8('0xb'))!=-0x1){_0x20bfb4=![];}}else{_0x4ee14f['rx']=_0x4ef888;}if(_0x20bfb4){return;}if(typeof _0x4ee14f['cb']==_0xb1e8('0xc')){var _0x393aec=_0x4ee14f['rx'][_0xb1e8('0x8')](0x0,0x3),_0x4068d5=null,_0x55eb24=null;_0x393aec=parseInt(_0x393aec);if(isNaN(_0x393aec)){_0x4ee14f['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xb1e8('0xd')});return;}if(_0x393aec!=0xc8){_0x4ee14f['cb'](null,{'code':_0x393aec,'result':-0x1,'extra':'KO'});return;}_0x4068d5=_0x4ee14f['rx'][_0xb1e8('0x8')](0x4)['replace'](_0xb1e8('0xe'),'');if(_0x4068d5[_0xb1e8('0xf')]('\x20')!=-0x1){_0x4068d5=_0x4068d5[_0xb1e8('0x10')](0x0,_0x4068d5['indexOf']('\x20'));}if(_[_0xb1e8('0x11')](_0x4068d5,'-1')){_0x4068d5=parseInt(_0x4068d5);}_0x55eb24=_0x4ee14f['rx'][_0xb1e8('0x12')]('\x20');if(_0x55eb24[_0xb1e8('0x13')]==0x3){_0x55eb24=_0x55eb24[0x2]['substring'](0x1,_0x55eb24[0x2][_0xb1e8('0x13')]-0x1);}else if(_0x55eb24[_0xb1e8('0x13')]>0x3){var _0x2a1f1a=/\((.+)\)/;var _0x42bb50=_0x4ee14f['rx']['match'](_0x2a1f1a);if(_0x42bb50){_0x55eb24=_0x42bb50[0x1];}else{_0x55eb24=null;}}else{_0x55eb24=null;}_0x4ee14f['cb'](null,{'code':_0x393aec,'result':_0x4068d5,'extra':_0x55eb24});}});_0x37a6a8['on'](_0xb1e8('0x14'),function(_0x41c5cb){_0x1b40cc[_0xb1e8('0x6')](_0xb1e8('0x14'),new AGIError('E_AGI_SOCKET_ERROR',_0x41c5cb[_0xb1e8('0x15')]));});_0x37a6a8['on'](_0xb1e8('0x16'),function(){_0x1b40cc['emit'](_0xb1e8('0x16'),new AGIError(_0xb1e8('0x17')));});_0x37a6a8['on'](_0xb1e8('0x18'),function(){_0x1b40cc['emit'](_0xb1e8('0x18'),new AGIError(_0xb1e8('0x19')));_0x37a6a8[_0xb1e8('0x1a')]();});_0x37a6a8[_0xb1e8('0x1b')](_0x432c60);this['command']=function(_0x5e90f2,_0x16111f){var _0x5e90f2=_0x5e90f2||'',_0x16111f=typeof _0x16111f=='function'?_0x16111f:new Function();_0x4ee14f={'tx':_0x5e90f2,'rx':'','cb':_0x16111f};_0x37a6a8[_0xb1e8('0x1c')](_0x5e90f2+'\x0a');},this['close']=function(){_0x37a6a8[_0xb1e8('0x1a')]();};}util[_0xb1e8('0x1d')](AGIChannel,EventEmitter);AGIChannel[_0xb1e8('0x1e')][_0xb1e8('0x1f')]=function(_0x152413){return this[_0xb1e8('0x20')][_0xb1e8('0x21')](this,_0x152413);};AGIChannel[_0xb1e8('0x1e')]['answer']=function(){return this[_0xb1e8('0x1f')](_0xb1e8('0x22'));};AGIChannel['prototype'][_0xb1e8('0x23')]=function(_0x248b27,_0x550d47,_0x434b19){_0x248b27=_0x248b27===undefined?_0xb1e8('0x24'):_0x248b27;_0x550d47=_0x550d47===undefined?'5':_0x550d47;_0x434b19=_0x434b19===undefined?'1':_0x434b19;return this[_0xb1e8('0x1f')](util['format'](_0xb1e8('0x25'),_0x248b27,_0x550d47*0x3e8,_0x434b19));};AGIChannel[_0xb1e8('0x1e')][_0xb1e8('0x26')]=function(_0x4b7ddd){_0x4b7ddd=_0x4b7ddd||_0xb1e8('0x27');return this[_0xb1e8('0x1f')](util[_0xb1e8('0x28')](_0xb1e8('0x29'),_0x4b7ddd));};AGIChannel['prototype']['exec']=function(_0x3724ff,_0x1ea31d){if(_[_0xb1e8('0x2a')](_0x1ea31d)){return this['sendRequest'](util[_0xb1e8('0x28')]('EXEC\x20%s\x20%s',_0x3724ff,_0x1ea31d[_0xb1e8('0x2b')](',')));}return this[_0xb1e8('0x1f')](util[_0xb1e8('0x28')](_0xb1e8('0x2c'),_0x3724ff,_0x1ea31d));};AGIChannel['prototype'][_0xb1e8('0x2d')]=function(_0x7f430a){return this[_0xb1e8('0x1f')](util[_0xb1e8('0x28')](_0xb1e8('0x2e'),_0x7f430a));};AGIChannel[_0xb1e8('0x1e')][_0xb1e8('0x2f')]=function(_0x5253a7){return this[_0xb1e8('0x1f')](util[_0xb1e8('0x28')](_0xb1e8('0x30'),_0x5253a7));};AGIChannel['prototype']['setPriority']=function(_0x5a4c96){return this['sendRequest'](util[_0xb1e8('0x28')](_0xb1e8('0x31'),_0x5a4c96));};AGIChannel[_0xb1e8('0x1e')]['hangup']=function(){return this[_0xb1e8('0x1f')](_0xb1e8('0x32'));};AGIChannel[_0xb1e8('0x1e')]['setVariable']=function(_0x1863b5,_0x27349b){var _0x59e17d=_['isBoolean'](_0x27349b)||_[_0xb1e8('0x33')](_0x27349b)?_0x27349b['toString']():_0x27349b;return this[_0xb1e8('0x1f')](util[_0xb1e8('0x28')](_0xb1e8('0x34'),_0x1863b5,_0x59e17d?_0x59e17d['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xb1e8('0x35')]=function(_0x35dc73,_0x58390e){return this[_0xb1e8('0x1f')](util['format'](_0xb1e8('0x36'),_0x35dc73,_0x58390e));};AGIChannel['prototype']['sayDigits']=function(_0x599a55,_0x1ae775){return this[_0xb1e8('0x1f')](util[_0xb1e8('0x28')](_0xb1e8('0x37'),_0x599a55,_0x1ae775));};AGIChannel[_0xb1e8('0x1e')][_0xb1e8('0x38')]=function(_0x5da6f9,_0x26a075){return this[_0xb1e8('0x1f')](util[_0xb1e8('0x28')](_0xb1e8('0x39'),_0x5da6f9,_0x26a075));};AGIChannel['prototype'][_0xb1e8('0x3a')]=function(_0x3b4f7c,_0x3271eb,_0x3c1344){_0x3271eb=_0x3271eb||this[_0xb1e8('0x3b')];_0x3c1344=_0x3c1344||0x1;this['setContext'](_0x3b4f7c);this['setExtension'](_0x3271eb);this[_0xb1e8('0x3c')](_0x3c1344);return this[_0xb1e8('0x26')](util[_0xb1e8('0x28')](_0xb1e8('0x3d'),_0x3b4f7c,_0x3271eb,_0x3c1344));};AGIChannel['prototype'][_0xb1e8('0x3e')]=function(_0x595adf){return this[_0xb1e8('0x1f')](util[_0xb1e8('0x28')](_0xb1e8('0x3f'),_0x595adf));};AGIChannel[_0xb1e8('0x1e')][_0xb1e8('0x40')]=function(_0x4b577e,_0x419e36,_0x5ad1d3,_0xec6eec,_0x1bff46,_0x37552d){_0x419e36=_0x419e36||_0xb1e8('0x41');_0x5ad1d3=_0x5ad1d3||'';_0xec6eec=_0xec6eec===undefined?-0x1:_0xec6eec==='-1'?-0x1:_0xec6eec*0x3e8;_0x1bff46=_0x1bff46===undefined?'':'s='+_0x1bff46;_0x37552d=_0x37552d?_0xb1e8('0x42'):'';return this[_0xb1e8('0x1f')](util[_0xb1e8('0x28')](_0xb1e8('0x43'),_0x4b577e,_0x419e36,_0x5ad1d3,_0xec6eec,_0x37552d,_0x1bff46));};AGIChannel[_0xb1e8('0x1e')]['streamFile']=function(_0x4db865,_0x3cf99d){_0x3cf99d=_0x3cf99d||'';return this[_0xb1e8('0x1f')](util[_0xb1e8('0x28')](_0xb1e8('0x44'),_0x4db865,_0x3cf99d));};AGIChannel[_0xb1e8('0x1e')][_0xb1e8('0x45')]=function(_0x2d4524){return this[_0xb1e8('0x46')]('AGI',_0x2d4524);};AGIChannel[_0xb1e8('0x1e')][_0xb1e8('0x47')]=function(_0xef633){return this['exec'](_0xb1e8('0x48'),_0xef633);};AGIChannel[_0xb1e8('0x1e')][_0xb1e8('0x14')]=function(_0x423636,_0x518f76){this[_0xb1e8('0x26')](util[_0xb1e8('0x28')](_0xb1e8('0x49'),_0x423636['id'],_0x423636[_0xb1e8('0x4a')],_0x518f76));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xb1e8('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index e27bd5e..ef05a23 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 _0x0aeb=['apply','message','name','util','Undefined\x20error.','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.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push'];(function(_0x2424f4,_0x489983){var _0x53bed1=function(_0xadc602){while(--_0xadc602){_0x2424f4['push'](_0x2424f4['shift']());}};_0x53bed1(++_0x489983);}(_0x0aeb,0xa3));var _0xb0ae=function(_0x3918e2,_0x24d29b){_0x3918e2=_0x3918e2-0x0;var _0x31edab=_0x0aeb[_0x3918e2];return _0x31edab;};'use strict';var util=require(_0xb0ae('0x0'));var error={'E_AGI_UNDEFINED':_0xb0ae('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xb0ae('0x2'),'E_AGI_SERVER_CLOSE':_0xb0ae('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xb0ae('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xb0ae('0x5'),'E_AGI_SOCKET_ERROR':_0xb0ae('0x6'),'E_AGI_SOCKET_CLOSE':_0xb0ae('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xb0ae('0x8'),'E_AGI_COMMAND_EMPTY':_0xb0ae('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb0ae('0xa'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x53cfdc){var _0x53cfdc=_0x53cfdc||null,_0x170d37=_0x170d37||[],_0x42cdeb=0x1,_0x2b394d='';if(!error[_0x53cfdc]){_0x53cfdc=_0xb0ae('0xb');}_0x170d37[_0xb0ae('0xc')](error[_0x53cfdc]);while(arguments[_0x42cdeb]){_0x170d37[_0xb0ae('0xc')](arguments[_0x42cdeb]);_0x42cdeb++;}_0x2b394d=util['format'][_0xb0ae('0xd')](util,_0x170d37);this[_0xb0ae('0xe')]=_0x2b394d;this[_0xb0ae('0xf')]=_0x53cfdc;}module['exports']=AGIError; \ No newline at end of file +var _0xc293=['apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format'];(function(_0x7220f4,_0x5ac632){var _0x5e4f9f=function(_0x3f12ce){while(--_0x3f12ce){_0x7220f4['push'](_0x7220f4['shift']());}};_0x5e4f9f(++_0x5ac632);}(_0xc293,0x114));var _0x3c29=function(_0xb6afe,_0x38671f){_0xb6afe=_0xb6afe-0x0;var _0x335218=_0xc293[_0xb6afe];return _0x335218;};'use strict';var util=require(_0x3c29('0x0'));var error={'E_AGI_UNDEFINED':_0x3c29('0x1'),'E_AGI_ARGUMENT_PORT':_0x3c29('0x2'),'E_AGI_SERVER_ERROR':_0x3c29('0x3'),'E_AGI_SERVER_CLOSE':_0x3c29('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x3c29('0x5'),'E_AGI_SOCKET_CLOSE':_0x3c29('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x3c29('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x3c29('0x8'),'E_AGI_IVR_ENTRY':_0x3c29('0x9')};function AGIError(_0x1d9fd6){var _0x1d9fd6=_0x1d9fd6||null,_0x3e12e5=_0x3e12e5||[],_0x3618c7=0x1,_0xf1b252='';if(!error[_0x1d9fd6]){_0x1d9fd6=_0x3c29('0xa');}_0x3e12e5[_0x3c29('0xb')](error[_0x1d9fd6]);while(arguments[_0x3618c7]){_0x3e12e5[_0x3c29('0xb')](arguments[_0x3618c7]);_0x3618c7++;}_0xf1b252=util[_0x3c29('0xc')][_0x3c29('0xd')](util,_0x3e12e5);this[_0x3c29('0xe')]=_0xf1b252;this[_0x3c29('0xf')]=_0x1d9fd6;}module[_0x3c29('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index ef63a37..0bd6209 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 _0x869b=['defaults','localhost','agi','E_AGI_SERVER_ERROR','parse','emit','projectUpdate','error','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis'];(function(_0x3e5f6d,_0x121db6){var _0x1bea6e=function(_0x435c7c){while(--_0x435c7c){_0x3e5f6d['push'](_0x3e5f6d['shift']());}};_0x1bea6e(++_0x121db6);}(_0x869b,0x1b9));var _0xb869=function(_0x6e6fe9,_0x2d398e){_0x6e6fe9=_0x6e6fe9-0x0;var _0x216f91=_0x869b[_0x6e6fe9];return _0x216f91;};'use strict';var _=require(_0xb869('0x0'));var EventEmitter=require(_0xb869('0x1'))[_0xb869('0x2')];var Redis=require(_0xb869('0x3'));var AGIError=require(_0xb869('0x4'));var config=require(_0xb869('0x5'));config[_0xb869('0x6')]=_[_0xb869('0x7')](config['redis'],{'host':_0xb869('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xb869('0x6')]);sub['subscribe'](_0xb869('0x9'),function(_0x2f225b){if(_0x2f225b)return eventEmitter['emit']('error',new AGIError(_0xb869('0xa'),_0x2f225b));});sub['on']('message',function(_0x2b58e0,_0x2cef8f){if(_0x2b58e0!==_0xb869('0x9'))return;try{var _0x5c81d8=JSON[_0xb869('0xb')](_0x2cef8f);eventEmitter[_0xb869('0xc')](_0xb869('0xd'),_0x5c81d8);}catch(_0x135c72){eventEmitter[_0xb869('0xc')](_0xb869('0xe'),new AGIError(_0xb869('0xa'),_0x135c72));}});module[_0xb869('0xf')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x5145=['projectUpdate','exports','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x5145,0x7a));var _0x5514=function(_0x590bcd,_0x558f1d){_0x590bcd=_0x590bcd-0x0;var _0x3991b5=_0x5145[_0x590bcd];return _0x3991b5;};'use strict';var _=require(_0x5514('0x0'));var EventEmitter=require(_0x5514('0x1'))[_0x5514('0x2')];var Redis=require(_0x5514('0x3'));var AGIError=require(_0x5514('0x4'));var config=require(_0x5514('0x5'));config[_0x5514('0x6')]=_['defaults'](config[_0x5514('0x6')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x5514('0x7')](_0x5514('0x8'),function(_0xe1f037){if(_0xe1f037)return eventEmitter[_0x5514('0x9')](_0x5514('0xa'),new AGIError(_0x5514('0xb'),_0xe1f037));});sub['on'](_0x5514('0xc'),function(_0x58299e,_0x256ea4){if(_0x58299e!==_0x5514('0x8'))return;try{var _0x43f8b7=JSON['parse'](_0x256ea4);eventEmitter[_0x5514('0x9')](_0x5514('0xd'),_0x43f8b7);}catch(_0x55b931){eventEmitter[_0x5514('0x9')](_0x5514('0xa'),new AGIError(_0x5514('0xb'),_0x55b931));}});module[_0x5514('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 2d8ba3e..c04e1a9 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 _0x5604=['agicommand','target','default','menu','vswitch','includes','max\x20retry\x20reach','lodash','../../../config/logger','agi','getdigits','getsecretdigits','edges','numberOfEdges','prototype','addVertex','vertices','push','relations','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split'];(function(_0x3b6f46,_0x404426){var _0x48a29d=function(_0x30bbe1){while(--_0x30bbe1){_0x3b6f46['push'](_0x3b6f46['shift']());}};_0x48a29d(++_0x404426);}(_0x5604,0xfa));var _0x4560=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5604[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x4560('0x0'));var logger=require(_0x4560('0x1'))(_0x4560('0x2'));var verticesWithRetry=['menu',_0x4560('0x3'),_0x4560('0x4')];var Graph=function(){this['vertices']={};this[_0x4560('0x5')]={};this[_0x4560('0x6')]=0x0;};Graph[_0x4560('0x7')][_0x4560('0x8')]=function(_0x5b21f8){this[_0x4560('0x9')][_0x5b21f8['id']]=_0x5b21f8;this['edges'][_0x5b21f8['id']]=[];};Graph['prototype']['addEdge']=function(_0x1608ac,_0x56b5e9,_0x350680){this[_0x4560('0x5')][_0x1608ac][_0x4560('0xa')]({'target':_0x56b5e9,'condition':_0x350680});this[_0x4560('0x6')]+=0x1;};Graph[_0x4560('0x7')]['size']=function(){return _['size'](this[_0x4560('0x9')]);};Graph[_0x4560('0x7')][_0x4560('0xb')]=function(){return this[_0x4560('0x6')];};Graph[_0x4560('0x7')][_0x4560('0xc')]=function(_0x2af5d8){return this[_0x4560('0x9')][_0x2af5d8];};Graph[_0x4560('0x7')][_0x4560('0xd')]=function(_0xb4fe38,_0x19fd31){if(!this[_0x4560('0x9')][_0xb4fe38]){return logger[_0x4560('0xe')]('no\x20vertex\x20found');}var _0x950ca9=_0x19fd31(this[_0x4560('0x9')][_0xb4fe38]);if(!_0x950ca9){return logger[_0x4560('0xe')](_0x4560('0xf'));}if(this[_0x4560('0x5')][_0xb4fe38][_0x4560('0x10')]===0x0){return logger[_0x4560('0xe')](_0x4560('0x11'));}for(var _0x3e8c6d=0x0,_0x802588=[],_0x26a464=![];_0x3e8c6d\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','uniqueid','arg_1','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','agi_','substring','debug','variables','stringify','close','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s'];(function(_0x5a5313,_0x1ca221){var _0x11761f=function(_0x2f9950){while(--_0x2f9950){_0x5a5313['push'](_0x5a5313['shift']());}};_0x11761f(++_0x1ca221);}(_0xcca9,0xe9));var _0x9cca=function(_0x5db313,_0x3c8f0c){_0x5db313=_0x5db313-0x0;var _0x36d503=_0xcca9[_0x5db313];return _0x36d503;};'use strict';var _=require(_0x9cca('0x0'));var syncho=require('syncho');var util=require(_0x9cca('0x1'));var config=require(_0x9cca('0x2'));var logger=require(_0x9cca('0x3'))(_0x9cca('0x4'));var utilLicense=require(_0x9cca('0x5'));var rpc=require(_0x9cca('0x6'));var Project=require('./project');var AGIEmitter=require('./events')['EventEmitter'];var projects=[];config[_0x9cca('0x4')]=_[_0x9cca('0x7')](config[_0x9cca('0x4')],{'ip':_0x9cca('0x8'),'port':0x11dd});AGIEmitter['on'](_0x9cca('0x9'),projectUpdateHandler);function connectionHandler(_0x44797f){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x44797f);agiHandler(_0x44797f);}catch(_0x51d05a){logger[_0x9cca('0xa')](_0x51d05a[_0x9cca('0xb')]);}});});}function projectUpdateHandler(_0x47d78a){try{var _0x5b27db=_[_0x9cca('0xc')](projects,['id',_0x47d78a['id']]);if(_0x5b27db>-0x1){if(_0x47d78a[_0x9cca('0xd')]===!![]){projects[_0x9cca('0xe')](_0x5b27db,0x1);}else{projects[_0x5b27db]=_0x47d78a;}}else{projects[_0x9cca('0xf')](_0x47d78a);}}catch(_0x169672){logger[_0x9cca('0xa')](_0x169672[_0x9cca('0xb')]);}}function listeningHandler(){console[_0x9cca('0x10')](_0x9cca('0x11'),config[_0x9cca('0x4')][_0x9cca('0x12')]);logger[_0x9cca('0x13')](util[_0x9cca('0x14')](_0x9cca('0x15'),config['agi']['ip'],config[_0x9cca('0x4')]['port']));}function errorHandler(_0x3966b7){if(_0x3966b7&&_0x3966b7[_0x9cca('0x16')]&&_0x3966b7[_0x9cca('0x17')]){logger[_0x9cca('0xa')](util[_0x9cca('0x14')](_0x9cca('0x18'),_0x3966b7[_0x9cca('0x16')],_0x3966b7[_0x9cca('0x17')]));}else{logger[_0x9cca('0xa')](util[_0x9cca('0x14')](_0x9cca('0x19'),_0x3966b7[_0x9cca('0xb')]));}}function closeHandler(){logger[_0x9cca('0x13')](util[_0x9cca('0x14')](_0x9cca('0x1a'),this['arg_1'],this[_0x9cca('0x1b')],this[_0x9cca('0x1c')],this['dnid'],this[_0x9cca('0x1d')]));try{createSquareReport(this);}catch(_0x489c3d){logger[_0x9cca('0xa')](_0x489c3d[_0x9cca('0xb')]);}}function timeoutHandler(){logger[_0x9cca('0x13')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x9cca('0x1e')],this[_0x9cca('0x1b')],this[_0x9cca('0x1c')],this[_0x9cca('0x1f')],this['uniqueid']));}function hangupHandler(){logger[_0x9cca('0x13')](util[_0x9cca('0x14')](_0x9cca('0x20'),this[_0x9cca('0x1e')],this[_0x9cca('0x1b')],this[_0x9cca('0x1c')],this[_0x9cca('0x1f')],this[_0x9cca('0x1d')]));this[_0x9cca('0x21')]=!![];}function createSquareReport(_0x224877,_0x34517b){rpc['createSquareReport'](_0x224877)[_0x9cca('0x22')](function(_0x9aa6c5){if(_0x34517b){_0x34517b(null,_0x9aa6c5);}})[_0x9cca('0x23')](function(_0x2ec373){if(_0x34517b){_0x34517b(null,_0x2ec373);}});}function setChannelVariables(_0x40ad88){for(var _0x92b4ce in _0x40ad88){if(_0x40ad88['hasOwnProperty'](_0x92b4ce)){if(_0x92b4ce['indexOf'](_0x9cca('0x24'))===0x0){_0x40ad88[_0x92b4ce[_0x9cca('0x25')](0x4)]=_0x40ad88[_0x92b4ce];delete _0x40ad88[_0x92b4ce];}}}}function agiHandler(_0x57e483){logger[_0x9cca('0x26')](_0x9cca('0x27'),JSON[_0x9cca('0x28')](_0x57e483,null,0x2));logger[_0x9cca('0x13')](util[_0x9cca('0x14')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x57e483['arg_1'],_0x57e483[_0x9cca('0x1b')],_0x57e483['callerid'],_0x57e483[_0x9cca('0x1f')],_0x57e483[_0x9cca('0x1d')]));_0x57e483['on'](_0x9cca('0xa'),errorHandler);_0x57e483['on'](_0x9cca('0x29'),closeHandler);_0x57e483['on']('timeout',timeoutHandler);_0x57e483[_0x9cca('0x21')]=![];_0x57e483['on'](_0x9cca('0x2a'),hangupHandler);var _0x1ad9a3=_[_0x9cca('0x2b')](projects,[_0x9cca('0x16'),_0x57e483[_0x9cca('0x1e')]]);if(!_0x1ad9a3)return Project[_0x9cca('0x2c')](_0x57e483);if(!_0x1ad9a3[_0x9cca('0x2d')])return Project[_0x9cca('0x2e')](_0x57e483);return Project[_0x9cca('0x2f')](_0x1ad9a3,_0x57e483);}function main(){var _0xca552b;return utilLicense[_0x9cca('0x30')]()[_0x9cca('0x22')](function(_0x587b5e){if(!_0x587b5e)return;if(_0x587b5e[_0x9cca('0x31')]){if(_0x587b5e[_0x9cca('0x32')]&&_0x587b5e[_0x9cca('0x32')]>0x0){logger[_0x9cca('0x13')](util['format'](_0x9cca('0x33'),_0x587b5e[_0x9cca('0x32')]));_0xca552b=_0x587b5e[_0x9cca('0x32')];}else{logger[_0x9cca('0x13')](_0x9cca('0x34'));}}else{logger[_0x9cca('0x13')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0xca552b=-0x1;}})[_0x9cca('0x22')](function(){return Project[_0x9cca('0x35')]();})['then'](function(_0x1c6dc0){projects=_0x1c6dc0;return;})[_0x9cca('0x23')](function(_0x54e21a){logger['error'](_0x9cca('0x36'),_0x54e21a[_0x9cca('0xb')]);})[_0x9cca('0x37')](function(){var _0x16ce59=require(_0x9cca('0x38'))(config[_0x9cca('0x4')][_0x9cca('0x12')],config[_0x9cca('0x4')]['ip'],_0xca552b);_0x16ce59['on'](_0x9cca('0xa'),errorHandler);_0x16ce59['on']('listening',listeningHandler);_0x16ce59['on']('connection',connectionHandler);_0x16ce59['on'](_0x9cca('0x29'),closeHandler);});}main(); \ No newline at end of file +var _0x43a3=['lodash','syncho','util','../../config/environment','agi','./rpc','./project','./events','127.0.0.1','projectUpdate','stack','findIndex','deleted','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','evtHangup','then','catch','hasOwnProperty','agi_','substring','debug','variables','stringify','close','timeout','hangup','find','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','finally','./server','listening'];(function(_0x101a1e,_0x1c4531){var _0x45ab1c=function(_0x393eb4){while(--_0x393eb4){_0x101a1e['push'](_0x101a1e['shift']());}};_0x45ab1c(++_0x1c4531);}(_0x43a3,0x10e));var _0x343a=function(_0x44d907,_0x54202d){_0x44d907=_0x44d907-0x0;var _0x2fb9b5=_0x43a3[_0x44d907];return _0x2fb9b5;};'use strict';var _=require(_0x343a('0x0'));var syncho=require(_0x343a('0x1'));var util=require(_0x343a('0x2'));var config=require(_0x343a('0x3'));var logger=require('../../config/logger')(_0x343a('0x4'));var utilLicense=require('../../config/license/util');var rpc=require(_0x343a('0x5'));var Project=require(_0x343a('0x6'));var AGIEmitter=require(_0x343a('0x7'))['EventEmitter'];var projects=[];config[_0x343a('0x4')]=_['defaults'](config[_0x343a('0x4')],{'ip':_0x343a('0x8'),'port':0x11dd});AGIEmitter['on'](_0x343a('0x9'),projectUpdateHandler);function connectionHandler(_0x5d2a95){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x5d2a95);agiHandler(_0x5d2a95);}catch(_0x1e023b){logger['error'](_0x1e023b[_0x343a('0xa')]);}});});}function projectUpdateHandler(_0x1eb861){try{var _0x1ed330=_[_0x343a('0xb')](projects,['id',_0x1eb861['id']]);if(_0x1ed330>-0x1){if(_0x1eb861[_0x343a('0xc')]===!![]){projects['splice'](_0x1ed330,0x1);}else{projects[_0x1ed330]=_0x1eb861;}}else{projects[_0x343a('0xd')](_0x1eb861);}}catch(_0x55ecda){logger[_0x343a('0xe')](_0x55ecda[_0x343a('0xa')]);}}function listeningHandler(){console[_0x343a('0xf')](_0x343a('0x10'),config[_0x343a('0x4')]['port']);logger[_0x343a('0x11')](util[_0x343a('0x12')](_0x343a('0x13'),config[_0x343a('0x4')]['ip'],config[_0x343a('0x4')][_0x343a('0x14')]));}function errorHandler(_0xfbd434){if(_0xfbd434&&_0xfbd434[_0x343a('0x15')]&&_0xfbd434[_0x343a('0x16')]){logger[_0x343a('0xe')](util[_0x343a('0x12')]('[%s]\x20%s',_0xfbd434[_0x343a('0x15')],_0xfbd434[_0x343a('0x16')]));}else{logger[_0x343a('0xe')](util['format']('[ERROR]\x20%s',_0xfbd434[_0x343a('0xa')]));}}function closeHandler(){logger[_0x343a('0x11')](util[_0x343a('0x12')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x343a('0x17')],this[_0x343a('0x18')],this[_0x343a('0x19')],this[_0x343a('0x1a')]));try{createSquareReport(this);}catch(_0x232f5){logger[_0x343a('0xe')](_0x232f5[_0x343a('0xa')]);}}function timeoutHandler(){logger[_0x343a('0x11')](util['format'](_0x343a('0x1b'),this[_0x343a('0x1c')],this[_0x343a('0x17')],this[_0x343a('0x18')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0x343a('0x11')](util[_0x343a('0x12')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x343a('0x1c')],this[_0x343a('0x17')],this[_0x343a('0x18')],this['dnid'],this[_0x343a('0x1a')]));this[_0x343a('0x1d')]=!![];}function createSquareReport(_0x5f1b48,_0x49f8d8){rpc['createSquareReport'](_0x5f1b48)[_0x343a('0x1e')](function(_0x237061){if(_0x49f8d8){_0x49f8d8(null,_0x237061);}})[_0x343a('0x1f')](function(_0x3fed8c){if(_0x49f8d8){_0x49f8d8(null,_0x3fed8c);}});}function setChannelVariables(_0x34a02c){for(var _0x238a9b in _0x34a02c){if(_0x34a02c[_0x343a('0x20')](_0x238a9b)){if(_0x238a9b['indexOf'](_0x343a('0x21'))===0x0){_0x34a02c[_0x238a9b[_0x343a('0x22')](0x4)]=_0x34a02c[_0x238a9b];delete _0x34a02c[_0x238a9b];}}}}function agiHandler(_0x26712a){logger[_0x343a('0x23')](_0x343a('0x24'),JSON[_0x343a('0x25')](_0x26712a,null,0x2));logger['info'](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x26712a[_0x343a('0x1c')],_0x26712a[_0x343a('0x17')],_0x26712a['callerid'],_0x26712a[_0x343a('0x19')],_0x26712a[_0x343a('0x1a')]));_0x26712a['on'](_0x343a('0xe'),errorHandler);_0x26712a['on'](_0x343a('0x26'),closeHandler);_0x26712a['on'](_0x343a('0x27'),timeoutHandler);_0x26712a[_0x343a('0x1d')]=![];_0x26712a['on'](_0x343a('0x28'),hangupHandler);var _0x3483bd=_[_0x343a('0x29')](projects,[_0x343a('0x15'),_0x26712a[_0x343a('0x1c')]]);if(!_0x3483bd)return Project['handleNotFound'](_0x26712a);if(!_0x3483bd['production'])return Project[_0x343a('0x2a')](_0x26712a);return Project[_0x343a('0x2b')](_0x3483bd,_0x26712a);}function main(){var _0xacbed4;return utilLicense[_0x343a('0x2c')]()['then'](function(_0x208bf7){if(!_0x208bf7)return;if(_0x208bf7[_0x343a('0x2d')]){if(_0x208bf7[_0x343a('0x2e')]&&_0x208bf7['callysquare']>0x0){logger[_0x343a('0x11')](util[_0x343a('0x12')](_0x343a('0x2f'),_0x208bf7[_0x343a('0x2e')]));_0xacbed4=_0x208bf7[_0x343a('0x2e')];}else{logger[_0x343a('0x11')](_0x343a('0x30'));}}else{logger[_0x343a('0x11')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0xacbed4=-0x1;}})[_0x343a('0x1e')](function(){return Project[_0x343a('0x31')]();})[_0x343a('0x1e')](function(_0x2db55e){projects=_0x2db55e;return;})['catch'](function(_0x5b1ca0){logger[_0x343a('0xe')](_0x343a('0x32'),_0x5b1ca0[_0x343a('0xa')]);})[_0x343a('0x33')](function(){var _0x30f40f=require(_0x343a('0x34'))(config[_0x343a('0x4')][_0x343a('0x14')],config[_0x343a('0x4')]['ip'],_0xacbed4);_0x30f40f['on'](_0x343a('0xe'),errorHandler);_0x30f40f['on'](_0x343a('0x35'),listeningHandler);_0x30f40f['on']('connection',connectionHandler);_0x30f40f['on'](_0x343a('0x26'),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 9cd55e7..52b1aaf 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 _0x3ee4=['SendMail','bluebird','client','http','request','then','error','catch'];(function(_0xd4d9e7,_0x278e5e){var _0x5790fd=function(_0x3bd4da){while(--_0x3bd4da){_0xd4d9e7['push'](_0xd4d9e7['shift']());}};_0x5790fd(++_0x278e5e);}(_0x3ee4,0xa1));var _0x43ee=function(_0x422a1d,_0x3b06e9){_0x422a1d=_0x422a1d-0x0;var _0x1ce743=_0x3ee4[_0x422a1d];return _0x1ce743;};'use strict';var BPromise=require(_0x43ee('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x43ee('0x1')][_0x43ee('0x2')]({'port':0x232b});function request(_0x3742d1,_0x30f671){return new BPromise(function(_0x2ac12a,_0x1b04a2){return client[_0x43ee('0x3')](_0x3742d1,_0x30f671)[_0x43ee('0x4')](function(_0x3c9e07){if(_0x3c9e07[_0x43ee('0x5')]){return _0x1b04a2(_0x3c9e07[_0x43ee('0x5')]['message']);}else{return _0x2ac12a(_0x3c9e07['result']);}})[_0x43ee('0x6')](function(_0x47e1c2){return _0x1b04a2(_0x47e1c2);});});}exports['sendMailMessage']=function(_0x35731d,_0x7796e8){return request(_0x43ee('0x7'),{'account':_0x35731d,'message':_0x7796e8});}; \ No newline at end of file +var _0x39b5=['then','error','message','result','catch','sendMailMessage','bluebird','jayson/promise','client','request'];(function(_0x5885bc,_0x191e09){var _0x6b59e9=function(_0x22333a){while(--_0x22333a){_0x5885bc['push'](_0x5885bc['shift']());}};_0x6b59e9(++_0x191e09);}(_0x39b5,0xa6));var _0x539b=function(_0x2074fb,_0x4c5253){_0x2074fb=_0x2074fb-0x0;var _0x238756=_0x39b5[_0x2074fb];return _0x238756;};'use strict';var BPromise=require(_0x539b('0x0'));var jayson=require(_0x539b('0x1'));var client=jayson[_0x539b('0x2')]['http']({'port':0x232b});function request(_0x196f48,_0x1aca26){return new BPromise(function(_0x4de48c,_0x372403){return client[_0x539b('0x3')](_0x196f48,_0x1aca26)[_0x539b('0x4')](function(_0x585be7){if(_0x585be7[_0x539b('0x5')]){return _0x372403(_0x585be7[_0x539b('0x5')][_0x539b('0x6')]);}else{return _0x4de48c(_0x585be7[_0x539b('0x7')]);}})[_0x539b('0x8')](function(_0x3ee5ab){return _0x372403(_0x3ee5ab);});});}exports[_0x539b('0x9')]=function(_0x5d3faf,_0x24fdaf){return request('SendMail',{'account':_0x5d3faf,'message':_0x24fdaf});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 00b5832..99ddf6d 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 _0x8cf6=['Project\x20%s\x20not\x20published','close','exports','lodash','moment','xml2json','../../config/logger','agi','./rpc','./graph','getSquareProjects','catch','error','stack','retry','maxRetry','addVertex','mxCell','hasOwnProperty','isArray','length','source','target','value','toJson','mxGraphModel','root','inspect','production','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','agicommand','response','code','result','evtHangup','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','uniqueid','isUndefined','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found'];(function(_0x2ba92f,_0xcd3f6){var _0xba13c=function(_0xc93d37){while(--_0xc93d37){_0x2ba92f['push'](_0x2ba92f['shift']());}};_0xba13c(++_0xcd3f6);}(_0x8cf6,0x7f));var _0x68cf=function(_0x2c0ded,_0x3de22c){_0x2c0ded=_0x2c0ded-0x0;var _0x4473e5=_0x8cf6[_0x2c0ded];return _0x4473e5;};'use strict';var _=require(_0x68cf('0x0'));var moment=require(_0x68cf('0x1'));var parser=require(_0x68cf('0x2'));var util=require('util');var logger=require(_0x68cf('0x3'))(_0x68cf('0x4'));var rpc=require(_0x68cf('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0x68cf('0x6'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x68cf('0x7')]()[_0x68cf('0x8')](function(_0x4709b6){logger[_0x68cf('0x9')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x4709b6[_0x68cf('0xa')]);return[];});}function addVertex(_0x1f75f5,_0x5c2725,_0x732630){_0x5c2725['agicommand']=_0x732630;if(_0x5c2725['hasOwnProperty'](_0x68cf('0xb'))){_0x5c2725[_0x68cf('0xc')]=parseInt(_0x5c2725[_0x68cf('0xb')],0xa);}_0x1f75f5[_0x68cf('0xd')](_['omit'](_0x5c2725,_0x68cf('0xe')));}function initGraph(_0x4f32d2,_0x5b07d1){var _0x2e7b60=new Graph();for(var _0x1fa03e in _0x4f32d2){if(_0x4f32d2[_0x68cf('0xf')](_0x1fa03e)){if(_[_0x68cf('0x10')](_0x4f32d2[_0x1fa03e])){for(var _0x5959d0=0x0;_0x5959d0<_0x4f32d2[_0x1fa03e][_0x68cf('0x11')];_0x5959d0+=0x1){addVertex(_0x2e7b60,_0x4f32d2[_0x1fa03e][_0x5959d0],_0x1fa03e);}}else{addVertex(_0x2e7b60,_0x4f32d2[_0x1fa03e],_0x1fa03e);}}}for(var _0x1fbba4=0x0;_0x1fbba4<_0x5b07d1[_0x68cf('0x11')];_0x1fbba4+=0x1){if(_0x5b07d1[_0x1fbba4][_0x68cf('0x12')]&&_0x5b07d1[_0x1fbba4][_0x68cf('0x13')]){_0x2e7b60['addEdge'](_0x5b07d1[_0x1fbba4][_0x68cf('0x12')],_0x5b07d1[_0x1fbba4][_0x68cf('0x13')],_0x5b07d1[_0x1fbba4][_0x68cf('0x14')]);}}return _0x2e7b60;}function getRoot(_0x30d553){return parser[_0x68cf('0x15')](_0x30d553,{'object':!![]})[_0x68cf('0x16')][_0x68cf('0x17')];}function inspect(_0x167eb1){return util[_0x68cf('0x18')](_0x167eb1,{'showHidden':![],'depth':null});}function initialize(_0x5da2af,_0x3782a4){var _0x2c6fa7=getRoot(_0x5da2af[_0x68cf('0x19')]);if(!_0x2c6fa7||!_0x2c6fa7['start'])return;var _0x21b7ae,_0x2d4286,_0x4840b4;logger[_0x68cf('0x1a')](_0x68cf('0x17'),JSON[_0x68cf('0x1b')](_0x2c6fa7,null,0x2));_0x3782a4[_0x68cf('0x1c')]=moment()[_0x68cf('0x1d')](_0x68cf('0x1e'));_0x21b7ae=initGraph(_['omit'](_0x2c6fa7,_0x68cf('0xe')),_0x2c6fa7[_0x68cf('0xe')]);_0x2d4286=new Vertices(_0x3782a4,rpc,mailRpc);logger[_0x68cf('0x1f')](util[_0x68cf('0x1d')](_0x68cf('0x20'),_0x3782a4[_0x68cf('0x21')],_0x3782a4[_0x68cf('0x22')],_0x3782a4[_0x68cf('0x23')],_0x3782a4['dnid'],_0x3782a4['uniqueid']));_0x21b7ae[_0x68cf('0x24')](_0x2c6fa7['start']['id'],function(_0x436282){try{_0x436282=_0x2d4286[_0x68cf('0x25')](_0x436282);logger[_0x68cf('0x1a')](_0x68cf('0x26'),JSON[_0x68cf('0x1b')](_0x436282,null,0x2));if(_0x436282['agicommand']===_0x68cf('0x27')){logger[_0x68cf('0x1f')](_0x68cf('0x28'));_0x3782a4[_0x68cf('0x29')]=_0x436282[_0x68cf('0x29')]||_0x3782a4['context'];_0x3782a4['extension']=_0x436282[_0x68cf('0x2a')];_0x3782a4['priority']=_0x436282[_0x68cf('0x2b')]?_0x436282[_0x68cf('0x2b')]-0x1:0x1;return null;}else if(_0x436282&&_0x2d4286[_0x436282[_0x68cf('0x2c')]]){_0x4840b4=_0x2d4286[_0x436282[_0x68cf('0x2c')]](_0x436282);logger[_0x68cf('0x1f')](_0x68cf('0x2d'),JSON[_0x68cf('0x1b')](_0x4840b4,null,0x2));if(_0x4840b4&&_0x4840b4[_0x68cf('0x2e')]===AGI_CODE_SUCCESS&&_0x4840b4[_0x68cf('0x2f')]!==AGI_RESULT_ERROR&&!_0x3782a4[_0x68cf('0x30')]){logger[_0x68cf('0x1a')](_0x68cf('0x2d'),inspect(_0x4840b4));return _['isUndefined'](_0x4840b4[_0x68cf('0x2f')])?null:_0x4840b4['result'][_0x68cf('0x31')]();}else{logger[_0x68cf('0x9')]('response',inspect(_0x4840b4));return null;}}else{logger[_0x68cf('0x9')](_0x68cf('0x32'));return null;}}catch(_0x242dba){logger[_0x68cf('0x9')](_0x242dba['stack']);return null;}});if(_0x2c6fa7[_0x68cf('0x33')]){logger[_0x68cf('0x1f')](util['format'](_0x68cf('0x34'),_0x3782a4[_0x68cf('0x21')],_0x3782a4['calleridname'],_0x3782a4[_0x68cf('0x23')],_0x3782a4[_0x68cf('0x35')],_0x3782a4[_0x68cf('0x36')]));_0x21b7ae[_0x68cf('0x24')](_0x2c6fa7['finally']['id'],function(_0x5672d4){try{_0x5672d4=_0x2d4286[_0x68cf('0x25')](_0x5672d4);logger[_0x68cf('0x1a')](_0x68cf('0x26'),JSON[_0x68cf('0x1b')](_0x5672d4,null,0x2));if(_0x5672d4&&_0x2d4286[_0x5672d4[_0x68cf('0x2c')]]){_0x4840b4=_0x2d4286[_0x5672d4[_0x68cf('0x2c')]](_0x5672d4);if(_0x4840b4){logger[_0x68cf('0x1a')]('response',inspect(_0x4840b4));return _[_0x68cf('0x37')](_0x4840b4[_0x68cf('0x2f')])?null:_0x4840b4[_0x68cf('0x2f')][_0x68cf('0x31')]();}else{logger['error'](_0x68cf('0x2d'),inspect(_0x4840b4));return null;}}else{logger[_0x68cf('0x9')](_0x68cf('0x32'));return null;}}catch(_0x3c2139){logger[_0x68cf('0x9')](_0x3c2139[_0x68cf('0xa')]);return null;}});}logger[_0x68cf('0x1f')](util[_0x68cf('0x1d')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3782a4[_0x68cf('0x21')],_0x3782a4[_0x68cf('0x22')],_0x3782a4[_0x68cf('0x23')],_0x3782a4[_0x68cf('0x35')],_0x3782a4['uniqueid']));logger[_0x68cf('0x1f')](util[_0x68cf('0x1d')](_0x68cf('0x38'),_0x3782a4[_0x68cf('0x29')],_0x3782a4[_0x68cf('0x2a')],parseInt(_0x3782a4[_0x68cf('0x2b')],0xa)+0x1));_0x3782a4[_0x68cf('0x39')](_0x3782a4[_0x68cf('0x29')],_0x3782a4[_0x68cf('0x2a')],parseInt(_0x3782a4[_0x68cf('0x2b')],0xa)+0x1);_0x3782a4['close']();}function handleNotFound(_0x5c1199){logger[_0x68cf('0x9')](util[_0x68cf('0x1d')](_0x68cf('0x3a'),_0x5c1199['arg_1']));_0x5c1199[_0x68cf('0x39')](_0x5c1199[_0x68cf('0x29')],_0x5c1199['extension'],parseInt(_0x5c1199[_0x68cf('0x2b')],0xa)+0x1);_0x5c1199['close']();}function handleUnpublished(_0x41250f){logger[_0x68cf('0x9')](util[_0x68cf('0x1d')](_0x68cf('0x3b'),_0x41250f['arg_1']));_0x41250f[_0x68cf('0x39')](_0x41250f[_0x68cf('0x29')],_0x41250f['extension'],parseInt(_0x41250f[_0x68cf('0x2b')],0xa)+0x1);_0x41250f[_0x68cf('0x3c')]();}module[_0x68cf('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xef66=['catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','maxRetry','mxCell','isArray','length','target','addEdge','toJson','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','uniqueid','traverseBFS','vertex','agicommand','gotoc','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','isUndefined','agicommand\x20not\x20found','callerid','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./graph','getSquareProjects'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xef66,0x16b));var _0x6ef6=function(_0x36e71e,_0x56c5cf){_0x36e71e=_0x36e71e-0x0;var _0x5ed9d1=_0xef66[_0x36e71e];return _0x5ed9d1;};'use strict';var _=require(_0x6ef6('0x0'));var moment=require('moment');var parser=require(_0x6ef6('0x1'));var util=require(_0x6ef6('0x2'));var logger=require(_0x6ef6('0x3'))(_0x6ef6('0x4'));var rpc=require(_0x6ef6('0x5'));var mailRpc=require(_0x6ef6('0x6'));var Graph=require(_0x6ef6('0x7'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x6ef6('0x8')]()[_0x6ef6('0x9')](function(_0x56a186){logger[_0x6ef6('0xa')](_0x6ef6('0xb'),_0x56a186[_0x6ef6('0xc')]);return[];});}function addVertex(_0x3a9a9a,_0x21a16c,_0x345e09){_0x21a16c['agicommand']=_0x345e09;if(_0x21a16c[_0x6ef6('0xd')](_0x6ef6('0xe'))){_0x21a16c[_0x6ef6('0xf')]=parseInt(_0x21a16c[_0x6ef6('0xe')],0xa);}_0x3a9a9a['addVertex'](_['omit'](_0x21a16c,_0x6ef6('0x10')));}function initGraph(_0x41f6bd,_0xc5d7b3){var _0x391f49=new Graph();for(var _0x4b5086 in _0x41f6bd){if(_0x41f6bd[_0x6ef6('0xd')](_0x4b5086)){if(_[_0x6ef6('0x11')](_0x41f6bd[_0x4b5086])){for(var _0x4774dd=0x0;_0x4774dd<_0x41f6bd[_0x4b5086][_0x6ef6('0x12')];_0x4774dd+=0x1){addVertex(_0x391f49,_0x41f6bd[_0x4b5086][_0x4774dd],_0x4b5086);}}else{addVertex(_0x391f49,_0x41f6bd[_0x4b5086],_0x4b5086);}}}for(var _0x59d2a4=0x0;_0x59d2a4<_0xc5d7b3['length'];_0x59d2a4+=0x1){if(_0xc5d7b3[_0x59d2a4]['source']&&_0xc5d7b3[_0x59d2a4][_0x6ef6('0x13')]){_0x391f49[_0x6ef6('0x14')](_0xc5d7b3[_0x59d2a4]['source'],_0xc5d7b3[_0x59d2a4]['target'],_0xc5d7b3[_0x59d2a4]['value']);}}return _0x391f49;}function getRoot(_0x47d825){return parser[_0x6ef6('0x15')](_0x47d825,{'object':!![]})[_0x6ef6('0x16')][_0x6ef6('0x17')];}function inspect(_0x1db166){return util[_0x6ef6('0x18')](_0x1db166,{'showHidden':![],'depth':null});}function initialize(_0x4d85f4,_0x1b5066){var _0x72594d=getRoot(_0x4d85f4[_0x6ef6('0x19')]);if(!_0x72594d||!_0x72594d[_0x6ef6('0x1a')])return;var _0x31cfcc,_0x39c0bf,_0x1b4ea8;logger[_0x6ef6('0x1b')](_0x6ef6('0x17'),JSON[_0x6ef6('0x1c')](_0x72594d,null,0x2));_0x1b5066[_0x6ef6('0x1d')]=moment()[_0x6ef6('0x1e')](_0x6ef6('0x1f'));_0x31cfcc=initGraph(_[_0x6ef6('0x20')](_0x72594d,_0x6ef6('0x10')),_0x72594d['mxCell']);_0x39c0bf=new Vertices(_0x1b5066,rpc,mailRpc);logger['info'](util['format'](_0x6ef6('0x21'),_0x1b5066[_0x6ef6('0x22')],_0x1b5066[_0x6ef6('0x23')],_0x1b5066['callerid'],_0x1b5066['dnid'],_0x1b5066[_0x6ef6('0x24')]));_0x31cfcc[_0x6ef6('0x25')](_0x72594d[_0x6ef6('0x1a')]['id'],function(_0x371684){try{_0x371684=_0x39c0bf['clear'](_0x371684);logger[_0x6ef6('0x1b')](_0x6ef6('0x26'),JSON[_0x6ef6('0x1c')](_0x371684,null,0x2));if(_0x371684[_0x6ef6('0x27')]===_0x6ef6('0x28')){logger[_0x6ef6('0x29')](_0x6ef6('0x2a'));_0x1b5066['context']=_0x371684['context']||_0x1b5066[_0x6ef6('0x2b')];_0x1b5066[_0x6ef6('0x2c')]=_0x371684[_0x6ef6('0x2c')];_0x1b5066[_0x6ef6('0x2d')]=_0x371684[_0x6ef6('0x2d')]?_0x371684[_0x6ef6('0x2d')]-0x1:0x1;return null;}else if(_0x371684&&_0x39c0bf[_0x371684[_0x6ef6('0x27')]]){_0x1b4ea8=_0x39c0bf[_0x371684[_0x6ef6('0x27')]](_0x371684);logger[_0x6ef6('0x29')](_0x6ef6('0x2e'),JSON[_0x6ef6('0x1c')](_0x1b4ea8,null,0x2));if(_0x1b4ea8&&_0x1b4ea8[_0x6ef6('0x2f')]===AGI_CODE_SUCCESS&&_0x1b4ea8[_0x6ef6('0x30')]!==AGI_RESULT_ERROR&&!_0x1b5066['evtHangup']){logger[_0x6ef6('0x1b')](_0x6ef6('0x2e'),inspect(_0x1b4ea8));return _['isUndefined'](_0x1b4ea8[_0x6ef6('0x30')])?null:_0x1b4ea8[_0x6ef6('0x30')][_0x6ef6('0x31')]();}else{logger['error'](_0x6ef6('0x2e'),inspect(_0x1b4ea8));return null;}}else{logger[_0x6ef6('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0xbca7cd){logger['error'](_0xbca7cd['stack']);return null;}});if(_0x72594d[_0x6ef6('0x32')]){logger['info'](util['format'](_0x6ef6('0x33'),_0x1b5066['arg_1'],_0x1b5066[_0x6ef6('0x23')],_0x1b5066['callerid'],_0x1b5066[_0x6ef6('0x34')],_0x1b5066[_0x6ef6('0x24')]));_0x31cfcc[_0x6ef6('0x25')](_0x72594d[_0x6ef6('0x32')]['id'],function(_0x2a923c){try{_0x2a923c=_0x39c0bf['clear'](_0x2a923c);logger[_0x6ef6('0x1b')](_0x6ef6('0x26'),JSON[_0x6ef6('0x1c')](_0x2a923c,null,0x2));if(_0x2a923c&&_0x39c0bf[_0x2a923c[_0x6ef6('0x27')]]){_0x1b4ea8=_0x39c0bf[_0x2a923c[_0x6ef6('0x27')]](_0x2a923c);if(_0x1b4ea8){logger[_0x6ef6('0x1b')](_0x6ef6('0x2e'),inspect(_0x1b4ea8));return _[_0x6ef6('0x35')](_0x1b4ea8[_0x6ef6('0x30')])?null:_0x1b4ea8['result'][_0x6ef6('0x31')]();}else{logger[_0x6ef6('0xa')]('response',inspect(_0x1b4ea8));return null;}}else{logger[_0x6ef6('0xa')](_0x6ef6('0x36'));return null;}}catch(_0x5ebce8){logger[_0x6ef6('0xa')](_0x5ebce8['stack']);return null;}});}logger[_0x6ef6('0x29')](util[_0x6ef6('0x1e')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1b5066[_0x6ef6('0x22')],_0x1b5066[_0x6ef6('0x23')],_0x1b5066[_0x6ef6('0x37')],_0x1b5066[_0x6ef6('0x34')],_0x1b5066[_0x6ef6('0x24')]));logger[_0x6ef6('0x29')](util[_0x6ef6('0x1e')](_0x6ef6('0x38'),_0x1b5066[_0x6ef6('0x2b')],_0x1b5066[_0x6ef6('0x2c')],parseInt(_0x1b5066['priority'],0xa)+0x1));_0x1b5066[_0x6ef6('0x39')](_0x1b5066[_0x6ef6('0x2b')],_0x1b5066[_0x6ef6('0x2c')],parseInt(_0x1b5066['priority'],0xa)+0x1);_0x1b5066[_0x6ef6('0x3a')]();}function handleNotFound(_0x4b9e50){logger['error'](util[_0x6ef6('0x1e')](_0x6ef6('0x3b'),_0x4b9e50[_0x6ef6('0x22')]));_0x4b9e50['continueAt'](_0x4b9e50['context'],_0x4b9e50[_0x6ef6('0x2c')],parseInt(_0x4b9e50[_0x6ef6('0x2d')],0xa)+0x1);_0x4b9e50[_0x6ef6('0x3a')]();}function handleUnpublished(_0x486e62){logger[_0x6ef6('0xa')](util[_0x6ef6('0x1e')](_0x6ef6('0x3c'),_0x486e62[_0x6ef6('0x22')]));_0x486e62[_0x6ef6('0x39')](_0x486e62[_0x6ef6('0x2b')],_0x486e62[_0x6ef6('0x2c')],parseInt(_0x486e62[_0x6ef6('0x2d')],0xa)+0x1);_0x486e62[_0x6ef6('0x3a')]();}module[_0x6ef6('0x3d')]={'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 0b99c5c..aeb335d 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 _0x4241=['slice','trim','headers','emit','Transform','call','_localBuffer','inherits','prototype','_transform','_inBody','indexOf','substring'];(function(_0x2b3f10,_0x14dc06){var _0xb80d5b=function(_0x5ec971){while(--_0x5ec971){_0x2b3f10['push'](_0x2b3f10['shift']());}};_0xb80d5b(++_0x14dc06);}(_0x4241,0x17d));var _0x1424=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x4241[_0x1969a7];return _0x3d665f;};'use strict';var util=require('util');var Transform=require('stream')[_0x1424('0x0')];function AGIReply(_0x3eba7e){Transform[_0x1424('0x1')](this,_0x3eba7e);this[_0x1424('0x2')]='';this['_inBody']=![];}util[_0x1424('0x3')](AGIReply,Transform);AGIReply[_0x1424('0x4')][_0x1424('0x5')]=function(_0x114d20,_0x155593,_0x1edd66){var _0x2e44b5='\x0a',_0x30706e=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x22ec29=-0x1,_0x3d6283=-0x1,_0x1ebe5b='',_0x4b5503=0x0,_0x2dba36='',_0x4d1196='';this[_0x1424('0x2')]+=_0x114d20['toString']();_0x2dba36=this[_0x1424('0x2')];if(!this[_0x1424('0x6')]){_0x4b5503=0x0;while(_0x30706e[_0x4b5503]){while((_0x3d6283=_0x2dba36[_0x1424('0x7')](_0x30706e[_0x4b5503]))!=-0x1){_0x1ebe5b=_0x30706e[_0x4b5503];_0x4d1196=_0x2dba36[_0x1424('0x8')](0x0,_0x3d6283);_0x2dba36=_0x2dba36['substring'](_0x3d6283+_0x1ebe5b['length']);var _0x1fe442=_0x4d1196['split'](_0x2e44b5),_0x56002a=0x0,_0x45986f={},_0x85d9a0='',_0x4bcd30='',_0x1004c9=-0x1;while(_0x1fe442[_0x56002a]){_0x1004c9=_0x1fe442[_0x56002a]['indexOf'](':');if(_0x1004c9!=-0x1){_0x85d9a0=_0x1fe442[_0x56002a][_0x1424('0x9')](0x0,_0x1004c9)[_0x1424('0xa')]();_0x4bcd30=_0x1fe442[_0x56002a][_0x1424('0x9')](_0x1004c9+0x1)[_0x1424('0xa')]();if(_0x85d9a0['length']>0x0){_0x45986f[_0x85d9a0]=_0x4bcd30;}}else{}_0x56002a++;}this['emit'](_0x1424('0xb'),_0x45986f);this[_0x1424('0x6')]=!![];}_0x4b5503++;}this[_0x1424('0x2')]=_0x2dba36;}else{while((_0x22ec29=_0x2dba36[_0x1424('0x7')](_0x2e44b5))!=-0x1){_0x4d1196=_0x2dba36[_0x1424('0x8')](0x0,_0x22ec29);this[_0x1424('0xc')]('line',_0x4d1196);_0x2dba36=_0x2dba36[_0x1424('0x8')](_0x22ec29+_0x2e44b5['length']);}this[_0x1424('0x2')]=_0x2dba36;}_0x1edd66();};module['exports']=AGIReply; \ No newline at end of file +var _0xbf02=['length','split','slice','trim','emit','headers','exports','util','stream','Transform','call','_localBuffer','_inBody','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring'];(function(_0x5508db,_0x22ecbe){var _0x54ce94=function(_0x389047){while(--_0x389047){_0x5508db['push'](_0x5508db['shift']());}};_0x54ce94(++_0x22ecbe);}(_0xbf02,0x139));var _0x2bf0=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbf02[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require(_0x2bf0('0x0'));var Transform=require(_0x2bf0('0x1'))[_0x2bf0('0x2')];function AGIReply(_0x405545){Transform[_0x2bf0('0x3')](this,_0x405545);this[_0x2bf0('0x4')]='';this[_0x2bf0('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x2bf0('0x6')]['_transform']=function(_0x325ad6,_0x24a4b7,_0x24204f){var _0x13a4f4='\x0a',_0x3156ac=['\x0a\x0a',_0x2bf0('0x7')],_0x10779f=-0x1,_0xbd09de=-0x1,_0x559d99='',_0xf79ed4=0x0,_0x67c0a='',_0x4896f0='';this[_0x2bf0('0x4')]+=_0x325ad6[_0x2bf0('0x8')]();_0x67c0a=this['_localBuffer'];if(!this[_0x2bf0('0x5')]){_0xf79ed4=0x0;while(_0x3156ac[_0xf79ed4]){while((_0xbd09de=_0x67c0a[_0x2bf0('0x9')](_0x3156ac[_0xf79ed4]))!=-0x1){_0x559d99=_0x3156ac[_0xf79ed4];_0x4896f0=_0x67c0a['substring'](0x0,_0xbd09de);_0x67c0a=_0x67c0a[_0x2bf0('0xa')](_0xbd09de+_0x559d99[_0x2bf0('0xb')]);var _0x1c77bd=_0x4896f0[_0x2bf0('0xc')](_0x13a4f4),_0x15eaa7=0x0,_0x10d0fb={},_0x4663b0='',_0x406c03='',_0xcad32f=-0x1;while(_0x1c77bd[_0x15eaa7]){_0xcad32f=_0x1c77bd[_0x15eaa7][_0x2bf0('0x9')](':');if(_0xcad32f!=-0x1){_0x4663b0=_0x1c77bd[_0x15eaa7][_0x2bf0('0xd')](0x0,_0xcad32f)[_0x2bf0('0xe')]();_0x406c03=_0x1c77bd[_0x15eaa7][_0x2bf0('0xd')](_0xcad32f+0x1)[_0x2bf0('0xe')]();if(_0x4663b0[_0x2bf0('0xb')]>0x0){_0x10d0fb[_0x4663b0]=_0x406c03;}}else{}_0x15eaa7++;}this[_0x2bf0('0xf')](_0x2bf0('0x10'),_0x10d0fb);this[_0x2bf0('0x5')]=!![];}_0xf79ed4++;}this[_0x2bf0('0x4')]=_0x67c0a;}else{while((_0x10779f=_0x67c0a[_0x2bf0('0x9')](_0x13a4f4))!=-0x1){_0x4896f0=_0x67c0a[_0x2bf0('0xa')](0x0,_0x10779f);this['emit']('line',_0x4896f0);_0x67c0a=_0x67c0a[_0x2bf0('0xa')](_0x10779f+_0x13a4f4[_0x2bf0('0xb')]);}this['_localBuffer']=_0x67c0a;}_0x24204f();};module[_0x2bf0('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index da95179..7838fdf 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 _0xe64a=['lodash','moment','jayson/promise','client','http','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','ShowMailAccount','MailServerOut','Smtp','CloudProvider','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','createSquareRecording','createSquareMessage','CreateSquareMessage','then','CreateCmContact','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser'];(function(_0x53d934,_0x346ce2){var _0x190dfc=function(_0x397328){while(--_0x397328){_0x53d934['push'](_0x53d934['shift']());}};_0x190dfc(++_0x346ce2);}(_0xe64a,0x1e0));var _0xae64=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe64a[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xae64('0x0'));var moment=require(_0xae64('0x1'));var jayson=require(_0xae64('0x2'));var client=jayson[_0xae64('0x3')][_0xae64('0x4')]({'port':0x2329});function request(_0xae1542,_0x80d46f){return new Promise(function(_0x275ae7,_0x5c8e95){return client['request'](_0xae1542,_0x80d46f)['then'](function(_0x527d9c){if(_0x527d9c[_0xae64('0x5')]){return _0x5c8e95(_0x527d9c[_0xae64('0x5')][_0xae64('0x6')]);}else{return _0x275ae7(_0x527d9c[_0xae64('0x7')]);}})[_0xae64('0x8')](function(_0x65a9d1){return _0x5c8e95(_0x65a9d1);});});}exports[_0xae64('0x9')]=function(){return request(_0xae64('0xa'),{'options':{'raw':![],'attributes':['id',_0xae64('0xb'),_0xae64('0xc')]}});};exports[_0xae64('0xd')]=function(_0x55dbe1){return request(_0xae64('0xe'),{'options':{'raw':![],'where':{'name':_0x55dbe1},'attributes':['production']}});};exports['getMailAccountById']=function(_0x111e51){return request(_0xae64('0xf'),{'options':{'raw':![],'where':{'id':_0x111e51},'include':[{'model':_0xae64('0x10'),'as':_0xae64('0x11'),'include':[{'model':'CloudProvider','as':_0xae64('0x12')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports[_0xae64('0x13')]=function(_0x15a9bf){return request(_0xae64('0xe'),{'options':{'where':{'id':_0x15a9bf},'attributes':['name']}});};exports[_0xae64('0x14')]=function(_0x760b31){return request(_0xae64('0x15'),{'options':{'where':{'id':_0x760b31},'attributes':[_0xae64('0xb')]}});};exports[_0xae64('0x16')]=function(_0x4c7d1c){return request(_0xae64('0x17'),{'options':{'where':{'id':_0x4c7d1c},'attributes':[_0xae64('0xb')]}});};exports[_0xae64('0x18')]=function(_0x285a48){return request(_0xae64('0x19'),{'options':{'where':{'id':_0x285a48},'attributes':['dsn']}});};exports[_0xae64('0x1a')]=function(_0x21c285){return request(_0xae64('0x1b'),{'options':{'where':{'id':_0x21c285},'attributes':[_0xae64('0xb')]}});};exports[_0xae64('0x1c')]=function(_0x227223){return request(_0xae64('0x1d'),{'options':{'where':{'phone':_0x227223[_0xae64('0x1e')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x3cdd98){return request(_0xae64('0x1f'),{'options':{'where':{'id':_0x3cdd98},'attributes':[_0xae64('0xb')]}});};exports[_0xae64('0x20')]=function(_0x42a4b4){return request(_0xae64('0x21'),{'options':{'where':{'id':_0x42a4b4},'attributes':['save_name']}});};exports[_0xae64('0x22')]=function(_0x4a4c4e){return request(_0xae64('0x23'),{'options':{'raw':![],'where':{'id':_0x4a4c4e},'include':[{'model':_0xae64('0x24'),'as':_0xae64('0x25')}]}});};exports[_0xae64('0x26')]=function(_0x4406dc){return request(_0xae64('0x27'),{'options':{'where':{'id':_0x4406dc},'attributes':['id',_0xae64('0xb')]}});};exports[_0xae64('0x28')]=function(_0x24a35f){return request(_0xae64('0x29'),{'body':_0x24a35f});};exports[_0xae64('0x2a')]=function(_0x134c0c){return request(_0xae64('0x2b'),{'body':_0x134c0c});};exports['createSquareReport']=function(_0x5bb2da){return request(_0xae64('0x2c'),{'body':_[_0xae64('0x2d')](_0x5bb2da,{'project_name':_0x5bb2da[_0xae64('0x2e')],'prev_project_name':_0x5bb2da[_0xae64('0x2f')]||'','is_subproject':_0x5bb2da[_0xae64('0x2f')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xae64('0x30')]=function(_0x3e9046){return request('CreateSquareRecording',{'body':_0x3e9046});};exports[_0xae64('0x31')]=function(_0x1fd9c8){return request(_0xae64('0x32'),{'body':_0x1fd9c8});};exports['createCmContact']=function(_0x3b946c){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x3b946c['phone'],'ListId':_0x3b946c['ListId']}}})[_0xae64('0x33')](function(_0x4ea1b3){if(_0x4ea1b3){return _0x4ea1b3;}return request(_0xae64('0x34'),{'body':_0x3b946c});});};exports['getPauseById']=function(_0x50ef06){return request('ShowPause',{'options':{'where':{'id':_0x50ef06},'attributes':[_0xae64('0xb')]}});};exports[_0xae64('0x35')]=function(_0x1982d9,_0x119a18){return request(_0xae64('0x36'),{'body':{'interface':_0x119a18},'options':{'where':_0x1982d9}});};exports[_0xae64('0x37')]=function(_0x32e92a,_0x993e4,_0x2509e2){return request('PauseUser',{'body':{'type':_0x993e4,'uniqueid':_0x2509e2},'options':{'where':_0x32e92a}});};exports[_0xae64('0x38')]=function(_0x1ccfd2){return request(_0xae64('0x39'),{'body':{},'options':{'where':_0x1ccfd2}});};exports[_0xae64('0x3a')]=function(_0x1900d8){return request(_0xae64('0x3b'),{'body':{},'options':{'where':_0x1900d8}});}; \ No newline at end of file +var _0x3d9f=['ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ListId','then','CreateCmContact','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','error','message','getSquareProjects','GetSquareProjects','name','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk'];(function(_0x4417cb,_0x2c26af){var _0x2cd457=function(_0x278ab4){while(--_0x278ab4){_0x4417cb['push'](_0x4417cb['shift']());}};_0x2cd457(++_0x2c26af);}(_0x3d9f,0xd2));var _0xf3d9=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x3d9f[_0x5b561d];return _0x431060;};'use strict';var _=require(_0xf3d9('0x0'));var moment=require(_0xf3d9('0x1'));var jayson=require(_0xf3d9('0x2'));var client=jayson[_0xf3d9('0x3')][_0xf3d9('0x4')]({'port':0x2329});function request(_0x14f5ee,_0x3d6e55){return new Promise(function(_0x30036e,_0x4ac931){return client['request'](_0x14f5ee,_0x3d6e55)['then'](function(_0x29dd94){if(_0x29dd94['error']){return _0x4ac931(_0x29dd94[_0xf3d9('0x5')][_0xf3d9('0x6')]);}else{return _0x30036e(_0x29dd94['result']);}})['catch'](function(_0x30272e){return _0x4ac931(_0x30272e);});});}exports[_0xf3d9('0x7')]=function(){return request(_0xf3d9('0x8'),{'options':{'raw':![],'attributes':['id',_0xf3d9('0x9'),_0xf3d9('0xa')]}});};exports[_0xf3d9('0xb')]=function(_0x4ea5f5){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x4ea5f5},'attributes':[_0xf3d9('0xa')]}});};exports[_0xf3d9('0xc')]=function(_0x252ed2){return request(_0xf3d9('0xd'),{'options':{'raw':![],'where':{'id':_0x252ed2},'include':[{'model':_0xf3d9('0xe'),'as':'Smtp','include':[{'model':_0xf3d9('0xf'),'as':'CloudProvider'}]}],'attributes':['id',_0xf3d9('0x9'),_0xf3d9('0x10')],'smtp':!![]}});};exports[_0xf3d9('0x11')]=function(_0x5f13cd){return request(_0xf3d9('0x12'),{'options':{'where':{'id':_0x5f13cd},'attributes':[_0xf3d9('0x9')]}});};exports[_0xf3d9('0x13')]=function(_0x15a74e){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x15a74e},'attributes':[_0xf3d9('0x9')]}});};exports[_0xf3d9('0x14')]=function(_0x1f3f9b){return request('ShowVariable',{'options':{'where':{'id':_0x1f3f9b},'attributes':[_0xf3d9('0x9')]}});};exports[_0xf3d9('0x15')]=function(_0x166aec){return request(_0xf3d9('0x16'),{'options':{'where':{'id':_0x166aec},'attributes':[_0xf3d9('0x17')]}});};exports['getUserById']=function(_0x18393a){return request(_0xf3d9('0x18'),{'options':{'where':{'id':_0x18393a},'attributes':[_0xf3d9('0x9')]}});};exports[_0xf3d9('0x19')]=function(_0x3386cb){return request(_0xf3d9('0x1a'),{'options':{'where':{'phone':_0x3386cb[_0xf3d9('0x1b')]},'attributes':['id']}});};exports[_0xf3d9('0x1c')]=function(_0x473085){return request(_0xf3d9('0x1d'),{'options':{'where':{'id':_0x473085},'attributes':[_0xf3d9('0x9')]}});};exports['getSoundById']=function(_0x49ec24){return request(_0xf3d9('0x1e'),{'options':{'where':{'id':_0x49ec24},'attributes':[_0xf3d9('0x1f')]}});};exports[_0xf3d9('0x20')]=function(_0x22d2f6){return request(_0xf3d9('0x21'),{'options':{'raw':![],'where':{'id':_0x22d2f6},'include':[{'model':_0xf3d9('0x22'),'as':_0xf3d9('0x23')}]}});};exports[_0xf3d9('0x24')]=function(_0x7770dc){return request(_0xf3d9('0x25'),{'options':{'where':{'id':_0x7770dc},'attributes':['id',_0xf3d9('0x9')]}});};exports[_0xf3d9('0x26')]=function(_0x3aeec9){return request('CreateSmsMessage',{'body':_0x3aeec9});};exports[_0xf3d9('0x27')]=function(_0x154064){return request(_0xf3d9('0x28'),{'body':_0x154064});};exports['createSquareReport']=function(_0x11c62a){return request(_0xf3d9('0x29'),{'body':_[_0xf3d9('0x2a')](_0x11c62a,{'project_name':_0x11c62a[_0xf3d9('0x2b')],'prev_project_name':_0x11c62a[_0xf3d9('0x2c')]||'','is_subproject':_0x11c62a[_0xf3d9('0x2c')]?!![]:![],'leaveAt':moment()[_0xf3d9('0x2d')](_0xf3d9('0x2e'))})});};exports[_0xf3d9('0x2f')]=function(_0x5ae343){return request(_0xf3d9('0x30'),{'body':_0x5ae343});};exports['createSquareMessage']=function(_0x114fcd){return request(_0xf3d9('0x31'),{'body':_0x114fcd});};exports[_0xf3d9('0x32')]=function(_0x3d9c23){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x3d9c23[_0xf3d9('0x1b')],'ListId':_0x3d9c23[_0xf3d9('0x33')]}}})[_0xf3d9('0x34')](function(_0x5e2835){if(_0x5e2835){return _0x5e2835;}return request(_0xf3d9('0x35'),{'body':_0x3d9c23});});};exports['getPauseById']=function(_0xfb610f){return request('ShowPause',{'options':{'where':{'id':_0xfb610f},'attributes':[_0xf3d9('0x9')]}});};exports['agentLogin']=function(_0xeef377,_0x31e166){return request(_0xf3d9('0x36'),{'body':{'interface':_0x31e166},'options':{'where':_0xeef377}});};exports['agentPause']=function(_0x7d0ef7,_0x524da0,_0x295f3d){return request(_0xf3d9('0x37'),{'body':{'type':_0x524da0,'uniqueid':_0x295f3d},'options':{'where':_0x7d0ef7}});};exports[_0xf3d9('0x38')]=function(_0x1a083f){return request(_0xf3d9('0x39'),{'body':{},'options':{'where':_0x1a083f}});};exports[_0xf3d9('0x3a')]=function(_0x1a0860){return request(_0xf3d9('0x3b'),{'body':{},'options':{'where':_0x1a0860}});}; \ 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 22232e3..03046aa 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 _0x5078=['exports','./polly','./lex'];(function(_0x528fc0,_0x108799){var _0x3954e2=function(_0x25d3ba){while(--_0x25d3ba){_0x528fc0['push'](_0x528fc0['shift']());}};_0x3954e2(++_0x108799);}(_0x5078,0x148));var _0x8507=function(_0x57d500,_0xf52c67){_0x57d500=_0x57d500-0x0;var _0x142c14=_0x5078[_0x57d500];return _0x142c14;};var polly=require(_0x8507('0x0'));var lex=require(_0x8507('0x1'));module[_0x8507('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x004c=['exports','./polly','./lex'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x004c,0x85));var _0xc004=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x004c[_0x36ed48];return _0x51c63a;};var polly=require(_0xc004('0x0'));var lex=require(_0xc004('0x1'));module[_0xc004('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 1273693..cf6ecb3 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. * // * * // ************************************************************************* -'use strict';var lex=require('./lib/api');module['exports']=function(_0x3d5d4e,_0x33a55d,_0x5527b3,_0x175deb,_0xd002ca,_0x200b2a){return lex(_0x3d5d4e,_0x33a55d,_0x5527b3,_0x175deb,_0xd002ca,_0x200b2a);}; \ No newline at end of file +var _0xd8b0=['exports','./lib/api'];(function(_0x235d0f,_0x563b51){var _0x43c479=function(_0x1eec8b){while(--_0x1eec8b){_0x235d0f['push'](_0x235d0f['shift']());}};_0x43c479(++_0x563b51);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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 diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index fcc3cd3..f6ebd70 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(_0x5c5227,_0x1b7b53){var _0x39b7ca=function(_0x57c275){while(--_0x57c275){_0x5c5227['push'](_0x5c5227['shift']());}};_0x39b7ca(++_0x1b7b53);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x232f10,_0x548331){var _0x251f18=function(_0x1ea51c){while(--_0x1ea51c){_0x232f10['push'](_0x232f10['shift']());}};_0x251f18(++_0x548331);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 c305d07..b746433 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 _0x2323=['./lib/api','exports'];(function(_0x2f8805,_0x3734aa){var _0x82fa2d=function(_0x410095){while(--_0x410095){_0x2f8805['push'](_0x2f8805['shift']());}};_0x82fa2d(++_0x3734aa);}(_0x2323,0x186));var _0x3232=function(_0x139cc0,_0x1c67f3){_0x139cc0=_0x139cc0-0x0;var _0x11dc1a=_0x2323[_0x139cc0];return _0x11dc1a;};'use strict';var polly=require(_0x3232('0x0'));module[_0x3232('0x1')]=function(_0x31b52a,_0x1f0d6e,_0x423b4f,_0x8d98fa,_0x4daa99,_0x3d4c73,_0x18e2ef){return polly(_0x31b52a,_0x1f0d6e,_0x423b4f,_0x8d98fa,_0x4daa99,_0x3d4c73,_0x18e2ef);}; \ No newline at end of file +var _0x6698=['./lib/api'];(function(_0x27fb03,_0x1ed6b2){var _0x405460=function(_0x1ee0a7){while(--_0x1ee0a7){_0x27fb03['push'](_0x27fb03['shift']());}};_0x405460(++_0x1ed6b2);}(_0x6698,0x73));var _0x8669=function(_0x2ce495,_0x5c55b9){_0x2ce495=_0x2ce495-0x0;var _0x4fdc8f=_0x6698[_0x2ce495];return _0x4fdc8f;};'use strict';var polly=require(_0x8669('0x0'));module['exports']=function(_0x1040ad,_0x1b3d6d,_0x5a2581,_0x24210e,_0x5d88ea,_0x17e0a5,_0x518777){return polly(_0x1040ad,_0x1b3d6d,_0x5a2581,_0x24210e,_0x5d88ea,_0x17e0a5,_0x518777);}; \ 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 df7da1a..5315654 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 _0x0741=['bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3'];(function(_0x5dd0b5,_0x151387){var _0x4953f7=function(_0x59acd2){while(--_0x59acd2){_0x5dd0b5['push'](_0x5dd0b5['shift']());}};_0x4953f7(++_0x151387);}(_0x0741,0xdc));var _0x1074=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x0741[_0x13ea00];return _0x1f7347;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x1074('0x0'));var rs=require(_0x1074('0x1'));var AWS=require(_0x1074('0x2'));function pollyResult(_0x194de2,_0x34c752,_0x181345){return new BPromise(function(_0x4a4c1c,_0x28ecc3){_0x194de2[_0x1074('0x3')](_0x34c752,function(_0x42ef8b,_0x24e392){if(_0x42ef8b){_0x28ecc3(_0x42ef8b);}else if(_0x24e392){if(_0x24e392[_0x1074('0x4')]instanceof Buffer){fs['writeFile'](_0x181345,_0x24e392[_0x1074('0x4')],function(_0x2e565e){if(_0x2e565e){_0x28ecc3(_0x2e565e);}else{_0x4a4c1c();}});}else{_0x28ecc3(new Error(_0x1074('0x5')));}}else{_0x28ecc3(new Error(_0x1074('0x6')));}});});}module[_0x1074('0x7')]=function(_0xce0213,_0x3519ef,_0x27c4be,_0x339bb6,_0x3dc60a,_0x151696,_0x4e2347){var _0x4d06ec=new AWS[(_0x1074('0x8'))]({'accessKeyId':_0xce0213,'secretAccessKey':_0x3519ef,'region':_0x27c4be});var _0x4a2777={'Text':_0x3dc60a,'TextType':_0x151696||'text','OutputFormat':_0x1074('0x9'),'VoiceId':_0x339bb6};return pollyResult(_0x4d06ec,_0x4a2777,_0x4e2347);}; \ No newline at end of file +var _0xfe5c=['path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text'];(function(_0x2f5c30,_0x4b8aa0){var _0x9f5f99=function(_0x3e9562){while(--_0x3e9562){_0x2f5c30['push'](_0x2f5c30['shift']());}};_0x9f5f99(++_0x4b8aa0);}(_0xfe5c,0xb4));var _0xcfe5=function(_0x10c33a,_0x547c46){_0x10c33a=_0x10c33a-0x0;var _0x106e8f=_0xfe5c[_0x10c33a];return _0x106e8f;};'use strict';var fs=require('fs');var path=require(_0xcfe5('0x0'));var BPromise=require(_0xcfe5('0x1'));var rs=require(_0xcfe5('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x34a4d3,_0x231a08,_0x29d2a5){return new BPromise(function(_0x228e03,_0x250890){_0x34a4d3[_0xcfe5('0x3')](_0x231a08,function(_0x3b0699,_0x14d9d5){if(_0x3b0699){_0x250890(_0x3b0699);}else if(_0x14d9d5){if(_0x14d9d5[_0xcfe5('0x4')]instanceof Buffer){fs[_0xcfe5('0x5')](_0x29d2a5,_0x14d9d5[_0xcfe5('0x4')],function(_0x468740){if(_0x468740){_0x250890(_0x468740);}else{_0x228e03();}});}else{_0x250890(new Error(_0xcfe5('0x6')));}}else{_0x250890(new Error(_0xcfe5('0x7')));}});});}module['exports']=function(_0x8c4e6c,_0x146457,_0x19b61d,_0x230cbf,_0x1776b6,_0xa05591,_0x3d7045){var _0x3a0040=new AWS[(_0xcfe5('0x8'))]({'accessKeyId':_0x8c4e6c,'secretAccessKey':_0x146457,'region':_0x19b61d});var _0x1fad6b={'Text':_0x1776b6,'TextType':_0xa05591||_0xcfe5('0x9'),'OutputFormat':'mp3','VoiceId':_0x230cbf};return pollyResult(_0x3a0040,_0x1fad6b,_0x3d7045);}; \ 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 d053064..7ce7c12 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa097=['exports','./lib/api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa097,0x131));var _0x7a09=function(_0x4555c2,_0x138d83){_0x4555c2=_0x4555c2-0x0;var _0x492d1d=_0xa097[_0x4555c2];return _0x492d1d;};'use strict';var asr=require(_0x7a09('0x0'));module[_0x7a09('0x1')]=function(_0x41869a,_0x12f0dc,_0x5993c0,_0x2977d5){return asr(_0x41869a,_0x12f0dc,_0x5993c0);}; \ No newline at end of file +var _0xed30=['./lib/api'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xed30,0x69));var _0x0ed3=function(_0x2ff3fe,_0x658b93){_0x2ff3fe=_0x2ff3fe-0x0;var _0x42e491=_0xed30[_0x2ff3fe];return _0x42e491;};'use strict';var asr=require(_0x0ed3('0x0'));module['exports']=function(_0x427ec1,_0x1ae6c2,_0x366a6f,_0x25fb4a){return asr(_0x427ec1,_0x1ae6c2,_0x366a6f);}; \ 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 620d6ef..0cd2884 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 _0xf46a=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','readFileSync','POST','/v1/speech:recognize?key=','8000','url','https://speech.googleapis.com','exports','string'];(function(_0x30734a,_0x594b0a){var _0x303af1=function(_0x3c4d23){while(--_0x3c4d23){_0x30734a['push'](_0x30734a['shift']());}};_0x303af1(++_0x594b0a);}(_0xf46a,0xa4));var _0xaf46=function(_0x45782e,_0x2a08bf){_0x45782e=_0x45782e-0x0;var _0x2c4522=_0xf46a[_0x45782e];return _0x2c4522;};'use strict';var url=require(_0xaf46('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xaf46('0x1');module[_0xaf46('0x2')]=function(_0x571132,_0xf4ff9e,_0x3a7936){return new BPromise(function(_0x53059e,_0x14a6b6){var _0x34c69d;if(typeof _0x571132!==_0xaf46('0x3')||_0x571132[_0xaf46('0x4')]===0x0){return _0x14a6b6(_0xaf46('0x5'));}if(typeof _0xf4ff9e!==_0xaf46('0x3')||_0xf4ff9e[_0xaf46('0x4')]===0x0){return _0x14a6b6(_0xaf46('0x6'));}if(typeof _0x3a7936!==_0xaf46('0x7')&&(typeof _0x3a7936!==_0xaf46('0x3')||_0x3a7936[_0xaf46('0x4')]===0x0)){return _0x14a6b6('lang\x20should\x20be\x20a\x20string');}try{_0x34c69d=fs[_0xaf46('0x8')](_0x571132)['toString']('base64');}catch(_0x51f679){return _0x14a6b6(_0x51f679);}return _0x53059e({'method':_0xaf46('0x9'),'uri':host+_0xaf46('0xa')+_0xf4ff9e,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xaf46('0xb'),'languageCode':_0x3a7936},'audio':{'content':_0x34c69d}},'json':!![]});});}; \ No newline at end of file +var _0x2ce1=['length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','toString','base64','POST','LINEAR16','exports'];(function(_0x18d5d7,_0x19074b){var _0x30a9ea=function(_0x514f3f){while(--_0x514f3f){_0x18d5d7['push'](_0x18d5d7['shift']());}};_0x30a9ea(++_0x19074b);}(_0x2ce1,0x8b));var _0x12ce=function(_0x169745,_0x23f1c0){_0x169745=_0x169745-0x0;var _0x447a90=_0x2ce1[_0x169745];return _0x447a90;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x12ce('0x0')]=function(_0x190dc3,_0x9601f9,_0xfe8bb0){return new BPromise(function(_0x4918dc,_0x37b568){var _0x168e95;if(typeof _0x190dc3!=='string'||_0x190dc3[_0x12ce('0x1')]===0x0){return _0x37b568(_0x12ce('0x2'));}if(typeof _0x9601f9!==_0x12ce('0x3')||_0x9601f9['length']===0x0){return _0x37b568(_0x12ce('0x4'));}if(typeof _0xfe8bb0!=='undefined'&&(typeof _0xfe8bb0!==_0x12ce('0x3')||_0xfe8bb0[_0x12ce('0x1')]===0x0)){return _0x37b568(_0x12ce('0x5'));}try{_0x168e95=fs['readFileSync'](_0x190dc3)[_0x12ce('0x6')](_0x12ce('0x7'));}catch(_0x3e1ee9){return _0x37b568(_0x3e1ee9);}return _0x4918dc({'method':_0x12ce('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x9601f9,'body':{'config':{'encoding':_0x12ce('0x9'),'sampleRateHertz':'8000','languageCode':_0xfe8bb0},'audio':{'content':_0x168e95}},'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 da5b14a..c067582 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 _0x3680=['exports'];(function(_0x498b52,_0x172050){var _0x19152f=function(_0x43cbfb){while(--_0x43cbfb){_0x498b52['push'](_0x498b52['shift']());}};_0x19152f(++_0x172050);}(_0x3680,0x13a));var _0x0368=function(_0x56337f,_0x1d0d12){_0x56337f=_0x56337f-0x0;var _0x1b0eec=_0x3680[_0x56337f];return _0x1b0eec;};var asr=require('./asr');module[_0x0368('0x0')]={'asr':asr}; \ No newline at end of file +var _0x6a10=['exports','./asr'];(function(_0x73c130,_0x5f532f){var _0x3bd9b4=function(_0x56cac8){while(--_0x56cac8){_0x73c130['push'](_0x73c130['shift']());}};_0x3bd9b4(++_0x5f532f);}(_0x6a10,0x19d));var _0x06a1=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x6a10[_0x1f36bb];return _0xaf97fa;};var asr=require(_0x06a1('0x0'));module[_0x06a1('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 3d56a86..1e92b54 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 _0xa4ba=['https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','data','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','action','status','code','endConversation','metadata','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','Data','dirName','apiai-promise','dialogflow','https','md5','path','request-promise','randomstring','google-tts-api','url','parse','./aws','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','download\x20error','pipe','host','end','transcode','wav','error\x20convert','info','start','resolve','.wav','writeFileSync','base64','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','then','tmp','from','writeFile','generate','unlink','777','googleCloudTTS\x20path'];(function(_0x4eed17,_0x27f081){var _0x479134=function(_0x31c9ed){while(--_0x31c9ed){_0x4eed17['push'](_0x4eed17['shift']());}};_0x479134(++_0x27f081);}(_0xa4ba,0xd1));var _0xaa4b=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xa4ba[_0x4b055c];return _0x4b62bb;};'use strict';var apiai=require(_0xaa4b('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0xaa4b('0x1'));var fs=require('fs');var http=require('http');var https=require(_0xaa4b('0x2'));var md5=require(_0xaa4b('0x3'));var path=require(_0xaa4b('0x4'));var querystring=require('querystring');var rp=require(_0xaa4b('0x5'));var rs=require(_0xaa4b('0x6'));var sox=require('sox');var tts=require(_0xaa4b('0x7'));var urlParse=require(_0xaa4b('0x8'))[_0xaa4b('0x9')];var util=require('util');var aws=require(_0xaa4b('0xa'));var google=require(_0xaa4b('0xb'));var sestek=require(_0xaa4b('0xc'));var tilde=require('./tilde');var logger=require(_0xaa4b('0xd'))(_0xaa4b('0xe'));var ISPEECH_API=_0xaa4b('0xf');function downloadFile(_0x4d4359,_0x10a30d){return new BPromise(function(_0x36e8f8,_0x4e65ed){var _0x288378=urlParse(_0x4d4359);var _0x304bc3=_0x288378[_0xaa4b('0x10')]===_0xaa4b('0x11')?https:http;var _0x4bc542={'host':_0x288378['host'],'path':_0x288378['path'],'headers':{'user-agent':_0xaa4b('0x12')}};_0x304bc3[_0xaa4b('0x13')](_0x4bc542,function(_0x5b76e6){if(_0x5b76e6[_0xaa4b('0x14')]!==0xc8){logger[_0xaa4b('0x15')](_0xaa4b('0x16')+_0x4d4359+'\x20failed,\x20status\x20code\x20=\x20'+_0x5b76e6[_0xaa4b('0x14')]+'\x20('+_0x5b76e6['statusMessage']+')');_0x4e65ed(new Error(_0xaa4b('0x16')+_0x4d4359+_0xaa4b('0x17')+_0x5b76e6[_0xaa4b('0x14')]+'\x20('+_0x5b76e6[_0xaa4b('0x18')]+')'));return;}var _0x5578fa=fs[_0xaa4b('0x19')](_0x10a30d);_0x5578fa['on'](_0xaa4b('0x1a'),function(){logger['info'](_0xaa4b('0x1b'));_0x5578fa[_0xaa4b('0x1c')](_0x36e8f8);});_0x5578fa['on']('error',function(_0x40f16f){fs['unlink'](_0x10a30d);logger[_0xaa4b('0x15')](_0xaa4b('0x1d'),_0x40f16f);_0x4e65ed(_0x40f16f);});_0x5b76e6[_0xaa4b('0x1e')](_0x5578fa);})['on'](_0xaa4b('0x15'),function(_0x1504af){logger['error'](_0x1504af);_0x4e65ed(_0x1504af);})['end']();});}function uploadFile(_0x5e3fc9){return new BPromise(function(_0xf9bb28,_0x498085){var _0x5c8161=urlParse(_0x5e3fc9);var _0x39087d=_0x5c8161['protocol']===_0xaa4b('0x11')?https:http;var _0x560fc3={'host':_0x5c8161[_0xaa4b('0x1f')],'path':_0x5c8161[_0xaa4b('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x39087d[_0xaa4b('0x13')](_0x560fc3,function(_0x5e08f0){if(_0x5e08f0[_0xaa4b('0x14')]!==0xc8){_0x498085(new Error(_0xaa4b('0x16')+_0x5e3fc9+'\x20failed,\x20status\x20code\x20=\x20'+_0x5e08f0[_0xaa4b('0x14')]+'\x20('+_0x5e08f0[_0xaa4b('0x18')]+')'));return;}var _0x3c6968='';_0x5e08f0['on']('data',function(_0x341a71){_0x3c6968+=_0x341a71;});_0x5e08f0['on'](_0xaa4b('0x20'),function(){_0xf9bb28(_0x3c6968);});})['on'](_0xaa4b('0x15'),function(_0x3b6d2d){_0x498085(_0x3b6d2d);})[_0xaa4b('0x20')]();});}function convertFile(_0x2a1934,_0x13aa83){return new BPromise(function(_0x3ffd70,_0x51e7bd){var _0x412149=sox[_0xaa4b('0x21')](_0x2a1934,_0x13aa83,{'sampleRate':0x1f40,'format':_0xaa4b('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x412149['on']('error',function(_0x276c10){logger[_0xaa4b('0x15')](_0xaa4b('0x23'),_0x276c10);_0x51e7bd(_0x276c10);});_0x412149['on'](_0xaa4b('0x20'),function(){logger[_0xaa4b('0x24')]('finish\x20to\x20convert');_0x3ffd70();});_0x412149[_0xaa4b('0x25')]();});}function base64Decode(_0xd58628,_0x263fa8){var _0x4e43aa=path[_0xaa4b('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0xaa4b('0x27'));fs[_0xaa4b('0x28')](_0x4e43aa,_0xd58628,_0xaa4b('0x29'));return convertFile(_0x4e43aa,_0x263fa8)['then'](function(){try{fs['unlink'](_0x4e43aa);fs[_0xaa4b('0x2a')](_0x263fa8,'777');}catch(_0x3d043d){logger[_0xaa4b('0x15')](_0x3d043d);}return _0x263fa8[_0xaa4b('0x2b')]('.')[0x0];});}function base64Encode(_0x242908){var _0x5e75cf=fs[_0xaa4b('0x2c')](_0x242908);return new Buffer(_0x5e75cf)[_0xaa4b('0x2d')](_0xaa4b('0x29'));}exports[_0xaa4b('0x2e')]=function(_0xc2c3c5,_0x19d31f,_0x3560ec,_0x1107db,_0x5c4fb8,_0x23f6d3){var _0x48c464,_0x417866;var _0x3a47dc=_0xaa4b('0x2f');var _0x12a3d9=_0xaa4b('0x30')+_0xc2c3c5;var _0x3fa38b={};if(_0x19d31f===_0xaa4b('0x31')){_0x3fa38b['input']={'ssml':_0x3560ec};}else{_0x3fa38b[_0xaa4b('0x32')]={'text':_0x3560ec};};_0x3fa38b[_0xaa4b('0x33')]={'languageCode':_0x1107db,'ssmlGender':_0x5c4fb8};_0x3fa38b[_0xaa4b('0x34')]={'audioEncoding':_0xaa4b('0x35'),'sampleRateHertz':0x1f40};var _0x329f7e={'url':_0x3a47dc+_0xaa4b('0x36')+_0x12a3d9,'method':'POST','json':!![],'body':_0x3fa38b};return rp(_0x329f7e)[_0xaa4b('0x37')](function(_0x24501d){return new BPromise(function(_0x6d3ac2,_0x2aa2c4){_0x48c464=path[_0xaa4b('0x26')](__dirname,_0xaa4b('0x38'),rs['generate'](0x4)+'.mp3');var _0x3dc1ea=Buffer[_0xaa4b('0x39')](_0x24501d['audioContent'],'base64');return fs[_0xaa4b('0x3a')](_0x48c464,_0x3dc1ea,function(_0x194e1e){_0x2aa2c4(_0x194e1e);},function(_0xdbfaae){fs[_0xaa4b('0x2a')](_0x48c464,'777');_0x6d3ac2(_0xdbfaae);});});})[_0xaa4b('0x37')](function(_0xb071b6){_0x417866=path[_0xaa4b('0x26')](__dirname,_0xaa4b('0x38'),rs[_0xaa4b('0x3b')](0x4)+_0xaa4b('0x27'));return convertFile(_0x48c464,_0x417866);})['then'](function(){try{fs[_0xaa4b('0x3c')](_0x48c464);fs['chmodSync'](_0x417866,_0xaa4b('0x3d'));}catch(_0x19242f){logger['error'](_0x19242f);}logger[_0xaa4b('0x24')](_0xaa4b('0x3e'),_0x417866[_0xaa4b('0x2b')]('.')[0x0]);return _0x417866[_0xaa4b('0x2b')]('.')[0x0];});};exports['googleTTS']=function(_0x190217,_0x3c482d){var _0x60945=_0xaa4b('0x3f');var _0xb646e8,_0x12b396;var _0x1a86db;var _0x4195a9={'encoding':_0xaa4b('0x40'),'method':'POST','timeout':0x2710,'url':_0x60945,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0xaa4b('0x41')]([[[_0xaa4b('0x42'),JSON[_0xaa4b('0x41')]([_0x190217,_0x3c482d||'en',![],'null']),null,_0xaa4b('0x43')]]]))};return rp(_0x4195a9)['then'](function(_0x1bdfc2){try{_0x1a86db=eval(_0x1bdfc2[_0xaa4b('0x44')](0x5))[0x0][0x2];}catch(_0x5eba7c){throw new Error(_0xaa4b('0x45')+_0x1bdfc2[_0xaa4b('0x46')]);}if(!_0x1a86db){if(_0x190217['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xaa4b('0x47')+_0x3c482d+_0xaa4b('0x48'));}}try{_0x1a86db=eval(_0x1a86db)[0x0];}catch(_0x5260da){throw new Error(_0xaa4b('0x45')+res[_0xaa4b('0x46')]);}const _0x54a0c7=_0x1a86db;_0xb646e8=path[_0xaa4b('0x26')](__dirname,_0xaa4b('0x38'),rs[_0xaa4b('0x3b')](0x4)+_0xaa4b('0x49'));fs[_0xaa4b('0x28')](_0xb646e8,_0x1a86db,{'encoding':_0xaa4b('0x29')});_0x12b396=path[_0xaa4b('0x26')](__dirname,_0xaa4b('0x38'),rs[_0xaa4b('0x3b')](0x4)+_0xaa4b('0x27'));return convertFile(_0xb646e8,_0x12b396);})['then'](function(){try{fs[_0xaa4b('0x3c')](_0xb646e8);fs[_0xaa4b('0x2a')](_0x12b396,'777');}catch(_0x31540c){logger[_0xaa4b('0x15')](_0x31540c);}logger[_0xaa4b('0x24')](_0xaa4b('0x4a'),_0x12b396[_0xaa4b('0x2b')]('.')[0x0]);return _0x12b396[_0xaa4b('0x2b')]('.')[0x0];});};exports[_0xaa4b('0x4b')]=function(_0x1bfaa5,_0x3013ca,_0x1d3c74){return google[_0xaa4b('0x4c')](_0x1bfaa5,_0x3013ca,_0x1d3c74)['then'](function(_0x2b6b59){logger[_0xaa4b('0x24')](_0x2b6b59[_0xaa4b('0x4d')]);return rp(_0x2b6b59);})[_0xaa4b('0x37')](function(_0x1c1ee9){var _0x5b4d9b='';var _0xf84b0e=0x0;try{fs[_0xaa4b('0x3c')](_0x1bfaa5);}catch(_0x207e2f){logger[_0xaa4b('0x15')](_0x207e2f);}if(_0x1c1ee9&&_0x1c1ee9['results']){_0x5b4d9b=_0x1c1ee9[_0xaa4b('0x4e')][_0xaa4b('0x4f')](function(_0x5511d0){return _0x5511d0&&_0x5511d0[_0xaa4b('0x50')][0x0]&&_0x5511d0['alternatives'][0x0]['transcript']?_0x5511d0[_0xaa4b('0x50')][0x0][_0xaa4b('0x51')]:'';})[_0xaa4b('0x52')]('\x0a');_0xf84b0e=_0x1c1ee9[_0xaa4b('0x4e')][_0xaa4b('0x4f')](function(_0x99f196){return _0x99f196&&_0x99f196['alternatives'][0x0]&&_0x99f196[_0xaa4b('0x50')][0x0][_0xaa4b('0x53')]?_0x99f196[_0xaa4b('0x50')][0x0]['confidence']:0x0;})[_0xaa4b('0x52')]('\x0a');}logger['info'](_0xaa4b('0x54'),_0x5b4d9b);logger[_0xaa4b('0x24')]('googleASR\x20confidence',_0xf84b0e);return{'transcript':_0x5b4d9b,'confidence':_0xf84b0e};})['catch'](function(_0x6e045b){logger[_0xaa4b('0x15')](_0xaa4b('0x55'),_0x6e045b[_0xaa4b('0x14')],_0x6e045b[_0xaa4b('0x56')],_0x6e045b[_0xaa4b('0x57')]);});};exports[_0xaa4b('0x58')]=function(_0x4e9faf,_0x34ebec,_0x1d7c92,_0x18da79){var _0x2dca41=apiai(_0x34ebec,{'language':_0x18da79||'en'});return _0x2dca41[_0xaa4b('0x59')](_0x1d7c92,{'sessionId':md5(_0x4e9faf)})[_0xaa4b('0x37')](function(_0x740cb0){logger[_0xaa4b('0x24')](JSON['stringify'](_0x740cb0));return{'source':_0x740cb0[_0xaa4b('0x5a')]['source'],'resolvedQuery':_0x740cb0['result'][_0xaa4b('0x5b')],'action':_0x740cb0[_0xaa4b('0x5a')][_0xaa4b('0x5c')],'actionIncomplete':_0x740cb0[_0xaa4b('0x5a')]['actionIncomplete'],'speech':_0x740cb0[_0xaa4b('0x5a')]['fulfillment']['speech'],'score':_0x740cb0[_0xaa4b('0x5a')]['score'],'statusCode':_0x740cb0[_0xaa4b('0x5d')][_0xaa4b('0x5e')],'endConversation':_0x740cb0[_0xaa4b('0x5a')]['metadata'][_0xaa4b('0x5f')]||![],'isFallbackIntent':_0x740cb0['result'][_0xaa4b('0x60')]['isFallbackIntent']};});};exports[_0xaa4b('0x61')]=function(_0x55e4c2,_0x82052a,_0x1a20a5,_0x4ba042,_0x5224d5,_0x1b911e){var _0x447131=_0x4ba042[_0xaa4b('0x62')](/\\n/g,'\x0a');var _0x1b05f5={'credentials':{'private_key':_0x447131,'client_email':_0x1a20a5}};var _0x116139=new dialogflow[(_0xaa4b('0x63'))](_0x1b05f5);var _0x5dc8ed=_0x116139[_0xaa4b('0x64')](_0x82052a,md5(_0x55e4c2));var _0x247cef={'session':_0x5dc8ed,'queryInput':{'text':{'text':_0x5224d5,'languageCode':_0x1b911e}}};return _0x116139[_0xaa4b('0x65')](_0x247cef)[_0xaa4b('0x37')](function(_0x80b228){if(_0x80b228&&_0x80b228[_0xaa4b('0x66')]){logger[_0xaa4b('0x24')](_0xaa4b('0x67'),JSON[_0xaa4b('0x41')](_0x80b228));var _0xebb150=_0x80b228[0x0];if(_0xebb150){var _0x56052b={'action':_0xebb150[_0xaa4b('0x68')]['action'],'allRequiredParamsPresent':_0xebb150[_0xaa4b('0x68')][_0xaa4b('0x69')],'endConversation':_0xebb150[_0xaa4b('0x68')][_0xaa4b('0x6a')]&&_0xebb150[_0xaa4b('0x68')][_0xaa4b('0x6a')][_0xaa4b('0x6b')]?_0xebb150['queryResult'][_0xaa4b('0x6a')]['fields'][_0xaa4b('0x6c')][_0xaa4b('0x6d')]:![],'fulfillmentText':_0xebb150[_0xaa4b('0x68')][_0xaa4b('0x6e')],'intentName':_0xebb150[_0xaa4b('0x68')]['intent'][_0xaa4b('0x56')],'intentDisplayName':_0xebb150[_0xaa4b('0x68')][_0xaa4b('0x6f')][_0xaa4b('0x70')],'isFallbackIntent':_0xebb150[_0xaa4b('0x68')]['intent'][_0xaa4b('0x71')],'languageCode':_0xebb150[_0xaa4b('0x68')]['languageCode'],'queryText':_0xebb150[_0xaa4b('0x68')][_0xaa4b('0x72')],'responseId':_0xebb150['responseId'],'score':_0xebb150[_0xaa4b('0x68')][_0xaa4b('0x73')],'speech':_0xebb150[_0xaa4b('0x68')]['fulfillmentText'],'providerResponse':JSON[_0xaa4b('0x41')](_0x80b228)};return _0x56052b;}}});};exports[_0xaa4b('0x74')]=function(_0x977fe9,_0x40aab8,_0x642c41,_0x3d2133){return tilde[_0xaa4b('0x4c')](_0x977fe9,_0x40aab8,_0x642c41,_0x3d2133)[_0xaa4b('0x37')](function(_0x500b40){try{fs[_0xaa4b('0x3c')](_0x977fe9);}catch(_0xff1016){logger[_0xaa4b('0x15')](_0xff1016);}logger[_0xaa4b('0x24')](_0xaa4b('0x75'),_0x500b40['transcript']);logger['info']('Tilde\x20ASR\x20confidence',_0x500b40[_0xaa4b('0x53')]);return _0x500b40;});};exports[_0xaa4b('0x76')]=function(_0x2d2a4e,_0x29a4ce,_0x353aaa,_0x41d8bf,_0x28922f,_0x6d5772){var _0x53e64f=path[_0xaa4b('0x26')](__dirname,_0xaa4b('0x38'),rs['generate'](0x4)+_0xaa4b('0x49'));var _0x113790;return aws[_0xaa4b('0x77')](_0x2d2a4e,_0x29a4ce,_0x353aaa,_0x41d8bf,_0x28922f,_0x6d5772,_0x53e64f)['then'](function(){_0x113790=path[_0xaa4b('0x26')](__dirname,_0xaa4b('0x38'),rs['generate'](0x4)+_0xaa4b('0x27'));return convertFile(_0x53e64f,_0x113790);})['then'](function(){try{fs[_0xaa4b('0x3c')](_0x53e64f);fs[_0xaa4b('0x2a')](_0x113790,_0xaa4b('0x3d'));}catch(_0x4ff9f5){logger[_0xaa4b('0x15')](_0x4ff9f5);}return _0x113790[_0xaa4b('0x2b')]('.')[0x0];});};exports[_0xaa4b('0x78')]=function(_0x3d46bd,_0x171529,_0x4c4a6a,_0x340744,_0x199bbd,_0x3b634e){return aws['lex'](_0x3d46bd,_0x171529,_0x4c4a6a,_0x340744,_0x199bbd,_0x3b634e)[_0xaa4b('0x37')](function(_0xe00160){logger[_0xaa4b('0x24')](JSON['stringify'](_0xe00160));return _0xe00160;});};exports[_0xaa4b('0x79')]=function(_0x2ed08b,_0x37e551,_0x29185f,_0x6d7c27){var _0x40039e=util[_0xaa4b('0x7a')](_0xaa4b('0x7b'),ISPEECH_API,_0x2ed08b,encodeURIComponent(_0x37e551),_0x29185f,_0x6d7c27);var _0x31d888=path['resolve'](__dirname,_0xaa4b('0x38'),rs[_0xaa4b('0x3b')](0x4)+_0xaa4b('0x49'));var _0x360264;return downloadFile(_0x40039e,_0x31d888)[_0xaa4b('0x37')](function(){_0x360264=path[_0xaa4b('0x26')](__dirname,_0xaa4b('0x38'),rs[_0xaa4b('0x3b')](0x4)+'.wav');return convertFile(_0x31d888,_0x360264);})[_0xaa4b('0x37')](function(){try{fs['unlink'](_0x31d888);fs[_0xaa4b('0x2a')](_0x360264,_0xaa4b('0x3d'));}catch(_0xbebedd){logger[_0xaa4b('0x15')](_0xbebedd);}return _0x360264['split']('.')[0x0];});};exports[_0xaa4b('0x7c')]=function(_0x574769,_0x4cd1cb,_0x398859,_0x51827c){var _0x286d27=util[_0xaa4b('0x7a')](_0xaa4b('0x7d'),ISPEECH_API,_0x4cd1cb,_0x398859,base64Encode(_0x574769),_0x51827c?util['format'](_0xaa4b('0x7e'),encodeURIComponent(_0x51827c)):_0xaa4b('0x7f'));return uploadFile(_0x286d27)['then'](function(_0x375bf5){return querystring['parse'](_0x375bf5);});};exports[_0xaa4b('0x80')]=function(_0x419d5a,_0x536bcc){return sestek[_0xaa4b('0x81')](_0x419d5a,_0x536bcc)['then'](function(_0x229bd4){logger[_0xaa4b('0x24')](JSON[_0xaa4b('0x41')](_0x229bd4));var _0x61bc75={'speech':_0x229bd4[_0xaa4b('0x82')],'action':_0x229bd4[_0xaa4b('0x83')]?_0x229bd4[_0xaa4b('0x83')][_0xaa4b('0x84')]:undefined,'actiondata':_0x229bd4['channelData']?_0x229bd4[_0xaa4b('0x83')][_0xaa4b('0x85')]:undefined};if(_0x229bd4[_0xaa4b('0x83')]&&_0x229bd4[_0xaa4b('0x83')]['AudioFromTts']){return base64Decode(_0x229bd4[_0xaa4b('0x83')]['AudioFromTts'][_0xaa4b('0x86')],path[_0xaa4b('0x26')](__dirname,_0xaa4b('0x38'),rs[_0xaa4b('0x3b')](0x4)+_0xaa4b('0x27')))[_0xaa4b('0x37')](function(_0xcea7f3){_0x61bc75['audiofile']=_0xcea7f3;return _0x61bc75;});}return _0x61bc75;});};exports[_0xaa4b('0x87')]=function(){return __dirname;}; \ No newline at end of file +var _0x7638=['CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','http','https','path','querystring','randomstring','sox','google-tts-api','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','get','statusCode','error','request\x20to\x20','statusMessage','finish','info','finish\x20download\x20file','close','pipe','end','WHAT_EVER','\x20failed,\x20status\x20code\x20=\x20','data','transcode','wav','error\x20convert','resolve','tmp','.wav','writeFileSync','base64','then','unlink','chmodSync','777','split','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','text:synthesize','POST','generate','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','jQ1olc','null','generic','slice','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','result','source','resolvedQuery','action','fulfillment','speech','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','stringify','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','text','channelData'];(function(_0x43077b,_0x2e8274){var _0x429348=function(_0x4e8d01){while(--_0x4e8d01){_0x43077b['push'](_0x43077b['shift']());}};_0x429348(++_0x2e8274);}(_0x7638,0x19e));var _0x8763=function(_0x12b614,_0x487a2d){_0x12b614=_0x12b614-0x0;var _0x3ba25d=_0x7638[_0x12b614];return _0x3ba25d;};'use strict';var apiai=require(_0x8763('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x8763('0x1'));var fs=require('fs');var http=require(_0x8763('0x2'));var https=require(_0x8763('0x3'));var md5=require('md5');var path=require(_0x8763('0x4'));var querystring=require(_0x8763('0x5'));var rp=require('request-promise');var rs=require(_0x8763('0x6'));var sox=require(_0x8763('0x7'));var tts=require(_0x8763('0x8'));var urlParse=require('url')['parse'];var util=require(_0x8763('0x9'));var aws=require(_0x8763('0xa'));var google=require(_0x8763('0xb'));var sestek=require(_0x8763('0xc'));var tilde=require(_0x8763('0xd'));var logger=require(_0x8763('0xe'))(_0x8763('0xf'));var ISPEECH_API=_0x8763('0x10');function downloadFile(_0x501dcf,_0x5dea6b){return new BPromise(function(_0x54d358,_0xf5139b){var _0x5a97f6=urlParse(_0x501dcf);var _0x19cd9d=_0x5a97f6[_0x8763('0x11')]===_0x8763('0x12')?https:http;var _0x3cc835={'host':_0x5a97f6[_0x8763('0x13')],'path':_0x5a97f6[_0x8763('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x19cd9d[_0x8763('0x14')](_0x3cc835,function(_0x995c0d){if(_0x995c0d[_0x8763('0x15')]!==0xc8){logger[_0x8763('0x16')]('request\x20to\x20'+_0x501dcf+'\x20failed,\x20status\x20code\x20=\x20'+_0x995c0d[_0x8763('0x15')]+'\x20('+_0x995c0d['statusMessage']+')');_0xf5139b(new Error(_0x8763('0x17')+_0x501dcf+'\x20failed,\x20status\x20code\x20=\x20'+_0x995c0d[_0x8763('0x15')]+'\x20('+_0x995c0d[_0x8763('0x18')]+')'));return;}var _0x2cb747=fs['createWriteStream'](_0x5dea6b);_0x2cb747['on'](_0x8763('0x19'),function(){logger[_0x8763('0x1a')](_0x8763('0x1b'));_0x2cb747[_0x8763('0x1c')](_0x54d358);});_0x2cb747['on'](_0x8763('0x16'),function(_0x3631f7){fs['unlink'](_0x5dea6b);logger[_0x8763('0x16')]('download\x20error',_0x3631f7);_0xf5139b(_0x3631f7);});_0x995c0d[_0x8763('0x1d')](_0x2cb747);})['on']('error',function(_0x358a94){logger[_0x8763('0x16')](_0x358a94);_0xf5139b(_0x358a94);})[_0x8763('0x1e')]();});}function uploadFile(_0x21bd80){return new BPromise(function(_0x33b82c,_0x6d51c5){var _0x51a1d4=urlParse(_0x21bd80);var _0x3c0d36=_0x51a1d4['protocol']==='https:'?https:http;var _0x45d8e8={'host':_0x51a1d4[_0x8763('0x13')],'path':_0x51a1d4['path'],'headers':{'user-agent':_0x8763('0x1f')}};_0x3c0d36[_0x8763('0x14')](_0x45d8e8,function(_0x3c9e87){if(_0x3c9e87['statusCode']!==0xc8){_0x6d51c5(new Error(_0x8763('0x17')+_0x21bd80+_0x8763('0x20')+_0x3c9e87[_0x8763('0x15')]+'\x20('+_0x3c9e87[_0x8763('0x18')]+')'));return;}var _0x53e849='';_0x3c9e87['on'](_0x8763('0x21'),function(_0x2001ea){_0x53e849+=_0x2001ea;});_0x3c9e87['on'](_0x8763('0x1e'),function(){_0x33b82c(_0x53e849);});})['on'](_0x8763('0x16'),function(_0x12f9f0){_0x6d51c5(_0x12f9f0);})[_0x8763('0x1e')]();});}function convertFile(_0x552d27,_0x35a59d){return new BPromise(function(_0x7ffca,_0x10e5ed){var _0x49a372=sox[_0x8763('0x22')](_0x552d27,_0x35a59d,{'sampleRate':0x1f40,'format':_0x8763('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x49a372['on'](_0x8763('0x16'),function(_0x570d4f){logger[_0x8763('0x16')](_0x8763('0x24'),_0x570d4f);_0x10e5ed(_0x570d4f);});_0x49a372['on'](_0x8763('0x1e'),function(){logger[_0x8763('0x1a')]('finish\x20to\x20convert');_0x7ffca();});_0x49a372['start']();});}function base64Decode(_0x2639e7,_0x1c5073){var _0x382a86=path[_0x8763('0x25')](__dirname,_0x8763('0x26'),rs['generate'](0x4)+_0x8763('0x27'));fs[_0x8763('0x28')](_0x382a86,_0x2639e7,_0x8763('0x29'));return convertFile(_0x382a86,_0x1c5073)[_0x8763('0x2a')](function(){try{fs[_0x8763('0x2b')](_0x382a86);fs[_0x8763('0x2c')](_0x1c5073,_0x8763('0x2d'));}catch(_0x265c38){logger[_0x8763('0x16')](_0x265c38);}return _0x1c5073[_0x8763('0x2e')]('.')[0x0];});}function base64Encode(_0x51149a){var _0x11468e=fs[_0x8763('0x2f')](_0x51149a);return new Buffer(_0x11468e)['toString'](_0x8763('0x29'));}exports['googleCloudTTS']=function(_0x45af0c,_0x359bb2,_0x425957,_0x1ad57,_0x5c71ee,_0x3c92f1){var _0x505867,_0x36453a;var _0x2baefd=_0x8763('0x30');var _0x11a7ea=_0x8763('0x31')+_0x45af0c;var _0x26d597={};if(_0x359bb2===_0x8763('0x32')){_0x26d597['input']={'ssml':_0x425957};}else{_0x26d597[_0x8763('0x33')]={'text':_0x425957};};_0x26d597[_0x8763('0x34')]={'languageCode':_0x1ad57,'ssmlGender':_0x5c71ee};_0x26d597['audioConfig']={'audioEncoding':_0x8763('0x35'),'sampleRateHertz':0x1f40};var _0x145210={'url':_0x2baefd+_0x8763('0x36')+_0x11a7ea,'method':_0x8763('0x37'),'json':!![],'body':_0x26d597};return rp(_0x145210)[_0x8763('0x2a')](function(_0x1ff799){return new BPromise(function(_0x4b2845,_0x4c9689){_0x505867=path[_0x8763('0x25')](__dirname,'tmp',rs[_0x8763('0x38')](0x4)+_0x8763('0x39'));var _0x1bb3b6=Buffer[_0x8763('0x3a')](_0x1ff799[_0x8763('0x3b')],_0x8763('0x29'));return fs[_0x8763('0x3c')](_0x505867,_0x1bb3b6,function(_0x2b056e){_0x4c9689(_0x2b056e);},function(_0x23d22b){fs['chmodSync'](_0x505867,'777');_0x4b2845(_0x23d22b);});});})[_0x8763('0x2a')](function(_0x371d75){_0x36453a=path['resolve'](__dirname,_0x8763('0x26'),rs[_0x8763('0x38')](0x4)+_0x8763('0x27'));return convertFile(_0x505867,_0x36453a);})[_0x8763('0x2a')](function(){try{fs[_0x8763('0x2b')](_0x505867);fs['chmodSync'](_0x36453a,_0x8763('0x2d'));}catch(_0x51623d){logger['error'](_0x51623d);}logger['info'](_0x8763('0x3d'),_0x36453a[_0x8763('0x2e')]('.')[0x0]);return _0x36453a['split']('.')[0x0];});};exports[_0x8763('0x3e')]=function(_0x22696c,_0x3f63cf){var _0x4c55b3=_0x8763('0x3f');var _0x52bda0,_0x297712;var _0x10899f;var _0x3edd8c={'encoding':_0x8763('0x40'),'method':'POST','timeout':0x2710,'url':_0x4c55b3,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0x8763('0x41'),JSON['stringify']([_0x22696c,_0x3f63cf||'en',![],_0x8763('0x42')]),null,_0x8763('0x43')]]]))};return rp(_0x3edd8c)[_0x8763('0x2a')](function(_0x5000a0){try{_0x10899f=eval(_0x5000a0[_0x8763('0x44')](0x5))[0x0][0x2];}catch(_0x366c8e){throw new Error('parse\x20response\x20failed:\x0a'+_0x5000a0[_0x8763('0x21')]);}if(!_0x10899f){if(_0x22696c['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x8763('0x45')+_0x3f63cf+_0x8763('0x46'));}}try{_0x10899f=eval(_0x10899f)[0x0];}catch(_0x4abe7e){throw new Error(_0x8763('0x47')+res['data']);}const _0x420c85=_0x10899f;_0x52bda0=path[_0x8763('0x25')](__dirname,_0x8763('0x26'),rs[_0x8763('0x38')](0x4)+'.mp3');fs[_0x8763('0x28')](_0x52bda0,_0x10899f,{'encoding':_0x8763('0x29')});_0x297712=path['resolve'](__dirname,'tmp',rs[_0x8763('0x38')](0x4)+_0x8763('0x27'));return convertFile(_0x52bda0,_0x297712);})['then'](function(){try{fs['unlink'](_0x52bda0);fs[_0x8763('0x2c')](_0x297712,_0x8763('0x2d'));}catch(_0x52f162){logger[_0x8763('0x16')](_0x52f162);}logger[_0x8763('0x1a')](_0x8763('0x48'),_0x297712[_0x8763('0x2e')]('.')[0x0]);return _0x297712[_0x8763('0x2e')]('.')[0x0];});};exports[_0x8763('0x49')]=function(_0x47ec55,_0x199871,_0x342099){return google[_0x8763('0x4a')](_0x47ec55,_0x199871,_0x342099)[_0x8763('0x2a')](function(_0x1e9b78){logger[_0x8763('0x1a')](_0x1e9b78[_0x8763('0x4b')]);return rp(_0x1e9b78);})['then'](function(_0x4bbc99){var _0x565610='';var _0x590c64=0x0;try{fs[_0x8763('0x2b')](_0x47ec55);}catch(_0x529df6){logger['error'](_0x529df6);}if(_0x4bbc99&&_0x4bbc99[_0x8763('0x4c')]){_0x565610=_0x4bbc99['results'][_0x8763('0x4d')](function(_0x5422d2){return _0x5422d2&&_0x5422d2['alternatives'][0x0]&&_0x5422d2[_0x8763('0x4e')][0x0][_0x8763('0x4f')]?_0x5422d2[_0x8763('0x4e')][0x0][_0x8763('0x4f')]:'';})[_0x8763('0x50')]('\x0a');_0x590c64=_0x4bbc99['results'][_0x8763('0x4d')](function(_0x196129){return _0x196129&&_0x196129[_0x8763('0x4e')][0x0]&&_0x196129[_0x8763('0x4e')][0x0][_0x8763('0x51')]?_0x196129['alternatives'][0x0][_0x8763('0x51')]:0x0;})[_0x8763('0x50')]('\x0a');}logger[_0x8763('0x1a')](_0x8763('0x52'),_0x565610);logger['info'](_0x8763('0x53'),_0x590c64);return{'transcript':_0x565610,'confidence':_0x590c64};})[_0x8763('0x54')](function(_0x4e84bb){logger[_0x8763('0x16')](_0x8763('0x55'),_0x4e84bb[_0x8763('0x15')],_0x4e84bb[_0x8763('0x56')],_0x4e84bb['message']);});};exports[_0x8763('0x57')]=function(_0x500b2b,_0x21901c,_0x4311f6,_0x3d7b3e){var _0x465ec2=apiai(_0x21901c,{'language':_0x3d7b3e||'en'});return _0x465ec2['textRequest'](_0x4311f6,{'sessionId':md5(_0x500b2b)})[_0x8763('0x2a')](function(_0x4836d7){logger[_0x8763('0x1a')](JSON['stringify'](_0x4836d7));return{'source':_0x4836d7[_0x8763('0x58')][_0x8763('0x59')],'resolvedQuery':_0x4836d7['result'][_0x8763('0x5a')],'action':_0x4836d7[_0x8763('0x58')][_0x8763('0x5b')],'actionIncomplete':_0x4836d7[_0x8763('0x58')]['actionIncomplete'],'speech':_0x4836d7['result'][_0x8763('0x5c')][_0x8763('0x5d')],'score':_0x4836d7['result']['score'],'statusCode':_0x4836d7[_0x8763('0x5e')][_0x8763('0x5f')],'endConversation':_0x4836d7[_0x8763('0x58')][_0x8763('0x60')][_0x8763('0x61')]||![],'isFallbackIntent':_0x4836d7['result'][_0x8763('0x60')][_0x8763('0x62')]};});};exports[_0x8763('0x63')]=function(_0x43be9e,_0x55ca2d,_0x3804f7,_0x3a2bf3,_0x537b1e,_0x49dff8){var _0xe22fbe=_0x3a2bf3['replace'](/\\n/g,'\x0a');var _0x4a0620={'credentials':{'private_key':_0xe22fbe,'client_email':_0x3804f7}};var _0x1bc6fa=new dialogflow['SessionsClient'](_0x4a0620);var _0x18a345=_0x1bc6fa['sessionPath'](_0x55ca2d,md5(_0x43be9e));var _0x83bff5={'session':_0x18a345,'queryInput':{'text':{'text':_0x537b1e,'languageCode':_0x49dff8}}};return _0x1bc6fa['detectIntent'](_0x83bff5)[_0x8763('0x2a')](function(_0x425d41){if(_0x425d41&&_0x425d41[_0x8763('0x64')]){logger['info'](_0x8763('0x65'),JSON['stringify'](_0x425d41));var _0x181b7b=_0x425d41[0x0];if(_0x181b7b){var _0xa5fccd={'action':_0x181b7b[_0x8763('0x66')][_0x8763('0x5b')],'allRequiredParamsPresent':_0x181b7b[_0x8763('0x66')][_0x8763('0x67')],'endConversation':_0x181b7b[_0x8763('0x66')][_0x8763('0x68')]&&_0x181b7b[_0x8763('0x66')]['diagnosticInfo'][_0x8763('0x69')]?_0x181b7b['queryResult'][_0x8763('0x68')]['fields'][_0x8763('0x6a')][_0x8763('0x6b')]:![],'fulfillmentText':_0x181b7b[_0x8763('0x66')][_0x8763('0x6c')],'intentName':_0x181b7b['queryResult'][_0x8763('0x6d')][_0x8763('0x56')],'intentDisplayName':_0x181b7b[_0x8763('0x66')][_0x8763('0x6d')]['displayName'],'isFallbackIntent':_0x181b7b[_0x8763('0x66')][_0x8763('0x6d')]['isFallback'],'languageCode':_0x181b7b[_0x8763('0x66')][_0x8763('0x6e')],'queryText':_0x181b7b[_0x8763('0x66')][_0x8763('0x6f')],'responseId':_0x181b7b[_0x8763('0x70')],'score':_0x181b7b[_0x8763('0x66')][_0x8763('0x71')],'speech':_0x181b7b['queryResult'][_0x8763('0x6c')],'providerResponse':JSON['stringify'](_0x425d41)};return _0xa5fccd;}}});};exports[_0x8763('0x72')]=function(_0x57e4ae,_0xc35f18,_0x3d4fa1,_0x2467af){return tilde[_0x8763('0x4a')](_0x57e4ae,_0xc35f18,_0x3d4fa1,_0x2467af)[_0x8763('0x2a')](function(_0x2f29f7){try{fs['unlink'](_0x57e4ae);}catch(_0x171c11){logger['error'](_0x171c11);}logger['info'](_0x8763('0x73'),_0x2f29f7[_0x8763('0x4f')]);logger[_0x8763('0x1a')](_0x8763('0x74'),_0x2f29f7[_0x8763('0x51')]);return _0x2f29f7;});};exports[_0x8763('0x75')]=function(_0x1e1274,_0x125369,_0x1f793e,_0xf29859,_0x15a5a9,_0x346789){var _0x586fee=path[_0x8763('0x25')](__dirname,_0x8763('0x26'),rs['generate'](0x4)+'.mp3');var _0xc0a68b;return aws['polly'](_0x1e1274,_0x125369,_0x1f793e,_0xf29859,_0x15a5a9,_0x346789,_0x586fee)[_0x8763('0x2a')](function(){_0xc0a68b=path[_0x8763('0x25')](__dirname,_0x8763('0x26'),rs[_0x8763('0x38')](0x4)+_0x8763('0x27'));return convertFile(_0x586fee,_0xc0a68b);})[_0x8763('0x2a')](function(){try{fs[_0x8763('0x2b')](_0x586fee);fs['chmodSync'](_0xc0a68b,_0x8763('0x2d'));}catch(_0x218d30){logger[_0x8763('0x16')](_0x218d30);}return _0xc0a68b[_0x8763('0x2e')]('.')[0x0];});};exports[_0x8763('0x76')]=function(_0x110072,_0x11f20d,_0x158e09,_0x5b37bf,_0x2f24a3,_0x26054d){return aws['lex'](_0x110072,_0x11f20d,_0x158e09,_0x5b37bf,_0x2f24a3,_0x26054d)[_0x8763('0x2a')](function(_0x3b179b){logger['info'](JSON[_0x8763('0x77')](_0x3b179b));return _0x3b179b;});};exports[_0x8763('0x78')]=function(_0x1568c4,_0x131cc4,_0x51253e,_0x2fd704){var _0x2555b3=util[_0x8763('0x79')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x1568c4,encodeURIComponent(_0x131cc4),_0x51253e,_0x2fd704);var _0x19fd54=path[_0x8763('0x25')](__dirname,_0x8763('0x26'),rs[_0x8763('0x38')](0x4)+_0x8763('0x39'));var _0x2827b4;return downloadFile(_0x2555b3,_0x19fd54)[_0x8763('0x2a')](function(){_0x2827b4=path[_0x8763('0x25')](__dirname,_0x8763('0x26'),rs['generate'](0x4)+_0x8763('0x27'));return convertFile(_0x19fd54,_0x2827b4);})[_0x8763('0x2a')](function(){try{fs[_0x8763('0x2b')](_0x19fd54);fs[_0x8763('0x2c')](_0x2827b4,_0x8763('0x2d'));}catch(_0x552f33){logger[_0x8763('0x16')](_0x552f33);}return _0x2827b4[_0x8763('0x2e')]('.')[0x0];});};exports[_0x8763('0x7a')]=function(_0x311eb6,_0x5ee7e2,_0x255ac9,_0x31c076){var _0x35c9b8=util[_0x8763('0x79')](_0x8763('0x7b'),ISPEECH_API,_0x5ee7e2,_0x255ac9,base64Encode(_0x311eb6),_0x31c076?util[_0x8763('0x79')](_0x8763('0x7c'),encodeURIComponent(_0x31c076)):_0x8763('0x7d'));return uploadFile(_0x35c9b8)[_0x8763('0x2a')](function(_0x3d52df){return querystring[_0x8763('0x7e')](_0x3d52df);});};exports[_0x8763('0x7f')]=function(_0x4737b0,_0x477710){return sestek['nda'](_0x4737b0,_0x477710)['then'](function(_0x32f234){logger[_0x8763('0x1a')](JSON[_0x8763('0x77')](_0x32f234));var _0x3c9dca={'speech':_0x32f234[_0x8763('0x80')],'action':_0x32f234['channelData']?_0x32f234[_0x8763('0x81')][_0x8763('0x82')]:undefined,'actiondata':_0x32f234[_0x8763('0x81')]?_0x32f234[_0x8763('0x81')][_0x8763('0x83')]:undefined};if(_0x32f234[_0x8763('0x81')]&&_0x32f234[_0x8763('0x81')][_0x8763('0x84')]){return base64Decode(_0x32f234['channelData'][_0x8763('0x84')][_0x8763('0x85')],path[_0x8763('0x25')](__dirname,'tmp',rs['generate'](0x4)+_0x8763('0x27')))[_0x8763('0x2a')](function(_0x8795a2){_0x3c9dca[_0x8763('0x86')]=_0x8795a2;return _0x3c9dca;});}return _0x3c9dca;});};exports[_0x8763('0x87')]=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 a8318d1..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 _0x1cbb=['exports'];(function(_0x38de33,_0x4361bb){var _0x40f16d=function(_0x25975c){while(--_0x25975c){_0x38de33['push'](_0x38de33['shift']());}};_0x40f16d(++_0x4361bb);}(_0x1cbb,0x1c4));var _0xb1cb=function(_0x5e878c,_0x4e5c6a){_0x5e878c=_0x5e878c-0x0;var _0x218ef7=_0x1cbb[_0x5e878c];return _0x218ef7;};var nda=require('./nda');module[_0xb1cb('0x0')]={'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 acdd2f2..87aa13c 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 _0x24b3=['/token','then','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve'];(function(_0xb43605,_0x24f6ea){var _0x164866=function(_0x4245d6){while(--_0x4245d6){_0xb43605['push'](_0xb43605['shift']());}};_0x164866(++_0x24f6ea);}(_0x24b3,0xd3));var _0x324b=function(_0x3e2002,_0x498a1f){_0x3e2002=_0x3e2002-0x0;var _0x389cc7=_0x24b3[_0x3e2002];return _0x389cc7;};'use strict';var rp=require(_0x324b('0x0'));var url=require(_0x324b('0x1'));var logger=require(_0x324b('0x2'))('agi');module[_0x324b('0x3')]=function(_0x5691ab,_0x49ce20){var _0x51f113={'method':_0x324b('0x4'),'uri':url[_0x324b('0x5')](_0x49ce20['ndauth_url'],_0x324b('0x6')),'form':{'grant_type':'password','username':_0x49ce20['username'],'password':_0x49ce20['password']},'json':!![]};return rp(_0x51f113)[_0x324b('0x7')](function(_0x39d42c){var _0x7da7d0={'method':'POST','uri':url['resolve'](_0x49ce20['ndassistant_url'],_0x324b('0x8')),'body':{'type':_0x49ce20['ndaactivity_type']||_0x324b('0x9'),'channelId':_0x324b('0xa'),'conversation':{'id':_0x5691ab[_0x324b('0xb')]},'from':{'id':_0x5691ab[_0x324b('0xc')],'name':_0x5691ab[_0x324b('0xd')]},'recipient':{'id':_0x5691ab[_0x324b('0xe')],'name':_0x5691ab[_0x324b('0xf')]},'text':_0x49ce20[_0x324b('0x10')],'channelData':{}},'headers':{'Authorization':_0x324b('0x11')+_0x39d42c[_0x324b('0x12')]},'json':!![]};if(_0x49ce20['project']){_0x7da7d0[_0x324b('0x13')][_0x324b('0x14')][_0x324b('0x15')]=_0x49ce20[_0x324b('0x16')];}if(_0x49ce20[_0x324b('0x17')]=='1'){_0x7da7d0[_0x324b('0x13')][_0x324b('0x14')][_0x324b('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x324b('0x19')};}if(_0x49ce20[_0x324b('0x1a')]){_0x7da7d0['body'][_0x324b('0x14')]['CustomAction']=_0x49ce20[_0x324b('0x1a')];if(_0x49ce20[_0x324b('0x1b')]){_0x7da7d0['body'][_0x324b('0x14')][_0x324b('0x1c')]=_0x49ce20[_0x324b('0x1b')];}}logger[_0x324b('0x1d')](JSON[_0x324b('0x1e')](_0x7da7d0));return rp(_0x7da7d0);});}; \ No newline at end of file +var _0x7dc2=['then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','uniqueid','callerid','calleridname','text','Bearer\x20','access_token','project','channelData','body','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','username'];(function(_0x124298,_0x542004){var _0x35ac24=function(_0x49afe8){while(--_0x49afe8){_0x124298['push'](_0x124298['shift']());}};_0x35ac24(++_0x542004);}(_0x7dc2,0x19d));var _0x27dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dc2[_0x321bb2];return _0x9c12ed;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x27dc('0x0'))(_0x27dc('0x1'));module[_0x27dc('0x2')]=function(_0x426f56,_0x57d4b4){var _0x15d70c={'method':_0x27dc('0x3'),'uri':url['resolve'](_0x57d4b4[_0x27dc('0x4')],_0x27dc('0x5')),'form':{'grant_type':'password','username':_0x57d4b4[_0x27dc('0x6')],'password':_0x57d4b4['password']},'json':!![]};return rp(_0x15d70c)[_0x27dc('0x7')](function(_0x3b3eee){var _0x5181ab={'method':_0x27dc('0x3'),'uri':url[_0x27dc('0x8')](_0x57d4b4[_0x27dc('0x9')],_0x27dc('0xa')),'body':{'type':_0x57d4b4['ndaactivity_type']||_0x27dc('0xb'),'channelId':'Nda','conversation':{'id':_0x426f56[_0x27dc('0xc')]},'from':{'id':_0x426f56[_0x27dc('0xd')],'name':_0x426f56[_0x27dc('0xe')]},'recipient':{'id':_0x426f56['dnid'],'name':_0x426f56['extension']},'text':_0x57d4b4[_0x27dc('0xf')],'channelData':{}},'headers':{'Authorization':_0x27dc('0x10')+_0x3b3eee[_0x27dc('0x11')]},'json':!![]};if(_0x57d4b4[_0x27dc('0x12')]){_0x5181ab['body'][_0x27dc('0x13')]['ProjectName']=_0x57d4b4[_0x27dc('0x12')];}if(_0x57d4b4['ndagenerate_audio']=='1'){_0x5181ab[_0x27dc('0x14')][_0x27dc('0x13')][_0x27dc('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x27dc('0x16')};}if(_0x57d4b4['custom_action']){_0x5181ab[_0x27dc('0x14')][_0x27dc('0x13')][_0x27dc('0x17')]=_0x57d4b4[_0x27dc('0x18')];if(_0x57d4b4[_0x27dc('0x19')]){_0x5181ab['body'][_0x27dc('0x13')][_0x27dc('0x1a')]=_0x57d4b4[_0x27dc('0x19')];}}logger[_0x27dc('0x1b')](JSON['stringify'](_0x5181ab));return rp(_0x5181ab);});}; \ 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 50bdeca..9a6f40a 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 _0x8183=['./lib/api'];(function(_0x1475a6,_0x56628c){var _0x3c0d07=function(_0xf4e6f3){while(--_0xf4e6f3){_0x1475a6['push'](_0x1475a6['shift']());}};_0x3c0d07(++_0x56628c);}(_0x8183,0x98));var _0x3818=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x8183[_0x48d6a3];return _0x38bfa0;};'use strict';var asr=require(_0x3818('0x0'));module['exports']=function(_0x2d415d,_0x5d1176,_0x58eca8,_0x4cd4a8){return asr(_0x2d415d,_0x5d1176,_0x58eca8,_0x4cd4a8);}; \ No newline at end of file +var _0xf15f=['exports'];(function(_0x48cf40,_0x31ee75){var _0x40982f=function(_0x444743){while(--_0x444743){_0x48cf40['push'](_0x48cf40['shift']());}};_0x40982f(++_0x31ee75);}(_0xf15f,0x94));var _0xff15=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xf15f[_0x39096d];return _0x13da4f;};'use strict';var asr=require('./lib/api');module[_0xff15('0x0')]=function(_0x216776,_0xdc28c8,_0x373014,_0xf20205){return asr(_0x216776,_0xdc28c8,_0x373014,_0xf20205);}; \ 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 b7a0ff0..c7cce13 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 _0xc6a7=['result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','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','isNil','isObject','open','message','close','bluebird','moment','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','EOS','error','terminate','status'];(function(_0x427cb4,_0x3c154b){var _0x43f775=function(_0x213c11){while(--_0x213c11){_0x427cb4['push'](_0x427cb4['shift']());}};_0x43f775(++_0x3c154b);}(_0xc6a7,0x1da));var _0x7c6a=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xc6a7[_0x87b0ff];return _0x3bc0b2;};'use strict';var BPromise=require(_0x7c6a('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7c6a('0x1'));var crypto=require(_0x7c6a('0x2'));var logger=require(_0x7c6a('0x3'))(_0x7c6a('0x4'));module['exports']=function(_0x390bc7,_0x4c5aae,_0xf96341,_0x39483e){return new BPromise(function(_0xa8e2cc,_0x48ef1d){logger[_0x7c6a('0x5')](_0x7c6a('0x6'),_0x39483e||_0x7c6a('0x7'));var _0x14d1f6=new WebSocket(_0x39483e||_0x7c6a('0x7'),{'perMessageDeflate':![]});var _0x105d47='';var _0x24c1a6='0';var _0x3ee79d='1';var _0x4b2862='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x5e06fa(_0x2f56c9){var _0x4f5d2a=crypto[_0x7c6a('0x8')](_0x7c6a('0x9'));_0x4f5d2a['update'](_0x2f56c9);return _0x4f5d2a['digest']('hex');}function _0x5676df(){try{logger[_0x7c6a('0x5')](_0x7c6a('0xa'));var _0x331a50=moment()[_0x7c6a('0xb')]();var _0x5c032f=_0x5e06fa(_0x331a50+_0x4c5aae+_0xf96341);_0x14d1f6[_0x7c6a('0xc')](JSON[_0x7c6a('0xd')]({'appID':_0x4c5aae,'timestamp':_0x331a50,'appKey':_0x5c032f}));var _0x5297cb=fs[_0x7c6a('0xe')](_0x390bc7);_0x5297cb['on'](_0x7c6a('0xf'),function(_0x5333e5){_0x14d1f6['send'](_0x5333e5);});_0x5297cb['on']('close',function(){_0x14d1f6['send'](_0x7c6a('0x10'));});}catch(_0x2c56ce){logger[_0x7c6a('0x11')]('Tilde\x20ASR\x20send\x20error',JSON[_0x7c6a('0xd')](_0x2c56ce));_0x14d1f6[_0x7c6a('0x12')]();}}function _0x3d87ef(_0x784ad){try{if(_0x784ad){var _0xb56855=JSON['parse'](_0x784ad);switch(_0xb56855[_0x7c6a('0x13')]){case 0x0:if(_0xb56855[_0x7c6a('0x14')]){if(_0xb56855[_0x7c6a('0x14')][_0x7c6a('0x15')]){logger[_0x7c6a('0x5')](_0x7c6a('0x16'),JSON[_0x7c6a('0xd')](_0xb56855[_0x7c6a('0x14')][_0x7c6a('0x17')]));_0x105d47=_0xb56855[_0x7c6a('0x14')][_0x7c6a('0x17')][0x0][_0x7c6a('0x18')];_0x24c1a6=_0xb56855[_0x7c6a('0x14')]['hypotheses'][0x0][_0x7c6a('0x19')];_0x3ee79d='0';_0x4b2862=_0x7c6a('0x1a');_0x14d1f6[_0x7c6a('0x12')]();}}break;case 0x1:logger[_0x7c6a('0x5')](_0x7c6a('0x1b'));_0x3ee79d='1';_0x4b2862=_0x7c6a('0x1b');break;case 0x2:logger[_0x7c6a('0x5')](_0x7c6a('0x1c'));_0x3ee79d='2';_0x4b2862=_0x7c6a('0x1c');break;case 0x9:logger[_0x7c6a('0x5')](_0x7c6a('0x1d'));_0x3ee79d='9';_0x4b2862='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x7c6a('0x5')](_0x7c6a('0x1e'));_0x3ee79d='10';_0x4b2862=_0x7c6a('0x1e');break;case 0xb:logger[_0x7c6a('0x5')](_0x7c6a('0x1f'));_0x3ee79d='11';_0x4b2862=_0x7c6a('0x1f');}}}catch(_0x1ca2ef){logger[_0x7c6a('0x11')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x7c6a('0xd')](_0x1ca2ef));_0x14d1f6[_0x7c6a('0x12')]();}}function _0x530a3b(){logger[_0x7c6a('0x5')](_0x7c6a('0x20'));_0xa8e2cc({'transcript':_0x105d47,'confidence':_0x24c1a6,'status':_0x3ee79d,'status_message':_0x4b2862});}function _0x1f3451(_0x4146a9){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x7c6a('0x21')](_0x4146a9)){logger['error'](_[_0x7c6a('0x22')](_0x4146a9)?JSON[_0x7c6a('0xd')](_0x4146a9):_0x4146a9);}}_0x14d1f6['on'](_0x7c6a('0x23'),_0x5676df);_0x14d1f6['on'](_0x7c6a('0x24'),_0x3d87ef);_0x14d1f6['on'](_0x7c6a('0x25'),_0x530a3b);_0x14d1f6['on'](_0x7c6a('0x11'),_0x1f3451);});}; \ No newline at end of file +var _0xf03b=['Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','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','isNil','isObject','open','message','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0xf03b,0xdc));var _0xbf03=function(_0x317e26,_0x2c1ac8){_0x317e26=_0x317e26-0x0;var _0x5e61d8=_0xf03b[_0x317e26];return _0x5e61d8;};'use strict';var BPromise=require(_0xbf03('0x0'));var _=require(_0xbf03('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xbf03('0x2'));var logger=require(_0xbf03('0x3'))(_0xbf03('0x4'));module[_0xbf03('0x5')]=function(_0xdbb0cf,_0x490e8c,_0x3365be,_0x16275a){return new BPromise(function(_0x5042cb,_0x5b4f6b){logger[_0xbf03('0x6')](_0xbf03('0x7'),_0x16275a||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x24af84=new WebSocket(_0x16275a||_0xbf03('0x8'),{'perMessageDeflate':![]});var _0x41cbc2='';var _0x12c605='0';var _0x3131ba='1';var _0x25e42e=_0xbf03('0x9');function _0x5349de(_0x295d9c){var _0x3362e5=crypto[_0xbf03('0xa')]('sha1');_0x3362e5[_0xbf03('0xb')](_0x295d9c);return _0x3362e5[_0xbf03('0xc')](_0xbf03('0xd'));}function _0x40003d(){try{logger[_0xbf03('0x6')](_0xbf03('0xe'));var _0x6e92c8=moment()[_0xbf03('0xf')]();var _0x4de7d9=_0x5349de(_0x6e92c8+_0x490e8c+_0x3365be);_0x24af84[_0xbf03('0x10')](JSON[_0xbf03('0x11')]({'appID':_0x490e8c,'timestamp':_0x6e92c8,'appKey':_0x4de7d9}));var _0x441102=fs[_0xbf03('0x12')](_0xdbb0cf);_0x441102['on'](_0xbf03('0x13'),function(_0x4ccbc4){_0x24af84['send'](_0x4ccbc4);});_0x441102['on'](_0xbf03('0x14'),function(){_0x24af84[_0xbf03('0x10')](_0xbf03('0x15'));});}catch(_0x54af23){logger[_0xbf03('0x16')](_0xbf03('0x17'),JSON[_0xbf03('0x11')](_0x54af23));_0x24af84[_0xbf03('0x18')]();}}function _0x57b8a5(_0x3380b7){try{if(_0x3380b7){var _0x564aac=JSON['parse'](_0x3380b7);switch(_0x564aac[_0xbf03('0x19')]){case 0x0:if(_0x564aac[_0xbf03('0x1a')]){if(_0x564aac[_0xbf03('0x1a')][_0xbf03('0x1b')]){logger[_0xbf03('0x6')](_0xbf03('0x1c'),JSON[_0xbf03('0x11')](_0x564aac[_0xbf03('0x1a')][_0xbf03('0x1d')]));_0x41cbc2=_0x564aac[_0xbf03('0x1a')][_0xbf03('0x1d')][0x0]['transcript'];_0x12c605=_0x564aac[_0xbf03('0x1a')]['hypotheses'][0x0]['likelihood'];_0x3131ba='0';_0x25e42e='Success.';_0x24af84[_0xbf03('0x18')]();}}break;case 0x1:logger[_0xbf03('0x6')](_0xbf03('0x9'));_0x3131ba='1';_0x25e42e='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xbf03('0x6')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x3131ba='2';_0x25e42e=_0xbf03('0x1e');break;case 0x9:logger[_0xbf03('0x6')](_0xbf03('0x1f'));_0x3131ba='9';_0x25e42e=_0xbf03('0x1f');break;case 0xa:logger[_0xbf03('0x6')](_0xbf03('0x20'));_0x3131ba='10';_0x25e42e=_0xbf03('0x20');break;case 0xb:logger[_0xbf03('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x3131ba='11';_0x25e42e=_0xbf03('0x21');}}}catch(_0x3d9f54){logger[_0xbf03('0x16')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x3d9f54));_0x24af84['terminate']();}}function _0x282007(){logger[_0xbf03('0x6')](_0xbf03('0x22'));_0x5042cb({'transcript':_0x41cbc2,'confidence':_0x12c605,'status':_0x3131ba,'status_message':_0x25e42e});}function _0x27705c(_0x4aa24c){logger[_0xbf03('0x16')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xbf03('0x23')](_0x4aa24c)){logger['error'](_[_0xbf03('0x24')](_0x4aa24c)?JSON[_0xbf03('0x11')](_0x4aa24c):_0x4aa24c);}}_0x24af84['on'](_0xbf03('0x25'),_0x40003d);_0x24af84['on'](_0xbf03('0x26'),_0x57b8a5);_0x24af84['on'](_0xbf03('0x14'),_0x282007);_0x24af84['on'](_0xbf03('0x16'),_0x27705c);});}; \ 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 239fb5d..061aa2d 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 _0xdeac=['exports','./asr'];(function(_0xe86217,_0xbdf22f){var _0x10a94f=function(_0x2fcb68){while(--_0x2fcb68){_0xe86217['push'](_0xe86217['shift']());}};_0x10a94f(++_0xbdf22f);}(_0xdeac,0x155));var _0xcdea=function(_0x48401,_0x428f78){_0x48401=_0x48401-0x0;var _0x54834=_0xdeac[_0x48401];return _0x54834;};var asr=require(_0xcdea('0x0'));module[_0xcdea('0x1')]={'asr':asr}; \ No newline at end of file +var _0x4aa1=['exports'];(function(_0x2feb53,_0x264ef7){var _0x5700ee=function(_0x700c98){while(--_0x700c98){_0x2feb53['push'](_0x2feb53['shift']());}};_0x5700ee(++_0x264ef7);}(_0x4aa1,0xf5));var _0x14aa=function(_0x42d762,_0x38020f){_0x42d762=_0x42d762-0x0;var _0x160c37=_0x4aa1[_0x42d762];return _0x160c37;};var asr=require('./asr');module[_0x14aa('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index d5558a5..8c6219f 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x3f25b2,_0x412bd4){var _0xd8caeb=function(_0x52d252){while(--_0x52d252){_0x3f25b2['push'](_0x3f25b2['shift']());}};_0xd8caeb(++_0x412bd4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index d96623d..254803d 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 _0xf12a=['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','wav','%s/recordings/%s','beep','NOBEEP','intKey','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','TILDE_ASR_%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','IFTIME\x20%s\x20%s','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','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','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20NOT\x20FOUND\x20BY','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','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','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','agi','../../config/environment/shared','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','getVariable','then','name','catch','prototype','getVoiceQueue','rpc','getVoiceQueueById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','%s/sounds/converted/%s','getQueryOdbc','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','calleridname','context','extension','priority','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','format','%s/%s@from-sip/n','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','POST','PUT','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','Amy','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','length','recursiveNodeIndex','saveRestApiResult','%s.%s','isArray','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','SESTEK_ASR_TRANSCRIPT','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s_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','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','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','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xf12a,0x8e));var _0xaf12=function(_0xbc3542,_0x4de021){_0xbc3542=_0xbc3542-0x0;var _0x1c88ff=_0xf12a[_0xbc3542];return _0x1c88ff;};'use strict';var fs=require('fs');var util=require(_0xaf12('0x0'));var _=require(_0xaf12('0x1'));var sh=require(_0xaf12('0x2'));var odbc=require(_0xaf12('0x3'))();var rs=require(_0xaf12('0x4'));var moment=require(_0xaf12('0x5'));var Mustache=require(_0xaf12('0x6'));var rp=require('request-promise');var logger=require('../../config/logger')(_0xaf12('0x7'));var config=require('../../config/environment');var shared=require(_0xaf12('0x8'));var scripts=require('./scripts');var FILES_PATH=_0xaf12('0x9');var recursiveMapAttributes=['rawHeaders',_0xaf12('0xa')];var verticesWithRetry=[_0xaf12('0xb'),_0xaf12('0xc'),_0xaf12('0xd')];var AGIVertices=function(_0x16e152,_0x2ef7a5,_0x3d733d){this[_0xaf12('0xe')]=_0x16e152;this['rpc']=_0x2ef7a5;this[_0xaf12('0xf')]=_0x3d733d;};AGIVertices['prototype'][_0xaf12('0x10')]=function(_0x4c97a6,_0x21710e){this['rpc']['getVariableById'](_0x4c97a6)[_0xaf12('0x11')](function(_0x2b2676){_0x21710e(null,_0x2b2676?_0x2b2676[_0xaf12('0x12')]:![]);})[_0xaf12('0x13')](function(_0x400dd1){_0x21710e(_0x400dd1);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x15')]=function(_0x29b14c,_0xae61cb){this[_0xaf12('0x16')][_0xaf12('0x17')](_0x29b14c)[_0xaf12('0x11')](function(_0x1e0304){_0xae61cb(null,_0x1e0304?_0x1e0304[_0xaf12('0x12')]:![]);})[_0xaf12('0x13')](function(_0x3205ae){_0xae61cb(_0x3205ae);});};AGIVertices[_0xaf12('0x14')]['getSquareProject']=function(_0x245cf5,_0x31a420){this['rpc']['getSquareProjectById'](_0x245cf5)['then'](function(_0xd0c5f){_0x31a420(null,_0xd0c5f?_0xd0c5f['name']:![]);})[_0xaf12('0x13')](function(_0x516bad){_0x31a420(_0x516bad);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x18')]=function(_0x3752a6,_0x215ff5){this['rpc'][_0xaf12('0x19')](_0x3752a6)[_0xaf12('0x11')](function(_0x3e81ce){_0x215ff5(null,_0x3e81ce?_0x3e81ce[_0xaf12('0x1a')]:![]);})[_0xaf12('0x13')](function(_0xeb8bc9){_0x215ff5(_0xeb8bc9);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x1b')]=function(_0x402e51,_0x41f9f7){this[_0xaf12('0x16')][_0xaf12('0x1c')](_0x402e51)[_0xaf12('0x11')](function(_0x4cb01b){_0x41f9f7(null,_0x4cb01b?_0x4cb01b[_0xaf12('0x12')]:![]);})['catch'](function(_0x576fd4){_0x41f9f7(_0x576fd4);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x1d')]=function(_0x1b66bc,_0x5f28e9){this[_0xaf12('0x16')][_0xaf12('0x1e')](_0x1b66bc)['then'](function(_0x439409){_0x5f28e9(null,_0x439409?_0x439409[_0xaf12('0x12')]:![]);})[_0xaf12('0x13')](function(_0x2ed53d){_0x5f28e9(_0x2ed53d);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x1f')]=function(_0x43eaa5,_0x344976){var _0x34fb64=this;this['rpc'][_0xaf12('0x20')](_0x43eaa5)['then'](function(_0x39b12f){_0x344976(null,_0x39b12f?_0x34fb64[_0xaf12('0x21')](_0x39b12f[_0xaf12('0x22')]):![]);})['catch'](function(_0x4f0a8b){_0x344976(_0x4f0a8b);});};AGIVertices['prototype']['getMailAccount']=function(_0x5484c8,_0x53401b){this[_0xaf12('0x16')][_0xaf12('0x23')](_0x5484c8)[_0xaf12('0x11')](function(_0x4092d5){_0x53401b(null,_0x4092d5?_0x4092d5:![]);})['catch'](function(_0x4362cb){_0x53401b(_0x4362cb);});};AGIVertices[_0xaf12('0x14')]['sendMailMessage']=function(_0x384cad,_0x5f4c30,_0x269b70){this[_0xaf12('0xf')][_0xaf12('0x24')](_0x384cad,_0x5f4c30)[_0xaf12('0x11')](function(){_0x269b70(null);})[_0xaf12('0x13')](function(_0x562132){_0x269b70(_0x562132);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x25')]=function(_0x27658b,_0x173bfb){this[_0xaf12('0x16')][_0xaf12('0x26')](_0x27658b)[_0xaf12('0x11')](function(_0xe5def6){if(_0xe5def6){if(_0xe5def6[_0xaf12('0x27')]){_0x173bfb(null,[_0xe5def6[_0xaf12('0x28')]]);}else{_0x173bfb(null,_['map'](_0xe5def6['Intervals'],_0xaf12('0x28')));}}else{_0x173bfb(null,![]);}})['catch'](function(_0x4a907b){_0x173bfb(_0x4a907b);});};AGIVertices['prototype'][_0xaf12('0x21')]=function(_0x54248c){return util['format'](_0xaf12('0x29'),FILES_PATH,_0x54248c);};AGIVertices['prototype'][_0xaf12('0x2a')]=function(_0x4b6186,_0x3307bb,_0x62339d){odbc['open'](_0x4b6186,function(_0x1b39af){if(_0x1b39af){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x1b39af);_0x62339d(_0x1b39af);}else{logger[_0xaf12('0x2b')](_0xaf12('0x2c'));odbc[_0xaf12('0x2d')](_0x3307bb,function(_0x14b036,_0x1dafbc){if(_0x14b036){logger[_0xaf12('0x2b')](_0xaf12('0x2e'),_0x3307bb);_0x62339d(_0x14b036);}else{logger[_0xaf12('0x2b')](_0xaf12('0x2f'),_0x3307bb);odbc['close'](function(_0x5a0f09){if(_0x5a0f09){logger[_0xaf12('0x30')](_0xaf12('0x31'),_0x5a0f09);}_0x62339d(null,_0x1dafbc);});}});}});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x32')]=function(_0x3017d9,_0xb29037){this[_0xaf12('0x16')]['getSmsAccountById'](_0x3017d9)[_0xaf12('0x11')](function(_0x33795b){_0xb29037(null,_0x33795b?_0x33795b:![]);})[_0xaf12('0x13')](function(_0x1511da){_0xb29037(_0x1511da);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x33')]=function(_0xc171b9,_0x5fe11a){this[_0xaf12('0x16')][_0xaf12('0x33')](_0xc171b9)['then'](function(_0x3313bb){_0x5fe11a(null,_0x3313bb);})[_0xaf12('0x13')](function(_0x5b7641){_0x5fe11a(_0x5b7641);});};AGIVertices['prototype'][_0xaf12('0x34')]=function(_0x387c96,_0x309532,_0x5ddd2d){this[_0xaf12('0x16')][_0xaf12('0x34')]({'uniqueid':this[_0xaf12('0xe')][_0xaf12('0x35')],'node':_0x387c96[_0xaf12('0x36')],'application':_0x387c96[_0xaf12('0x37')],'data':_0x309532||null,'project_name':this[_0xaf12('0xe')]['arg_1'],'callerid':this[_0xaf12('0xe')][_0xaf12('0x38')]})[_0xaf12('0x11')](function(_0xeadc5b){if(_0x5ddd2d){_0x5ddd2d(null,_0xeadc5b);}})[_0xaf12('0x13')](function(_0x33dacc){if(_0x5ddd2d){_0x5ddd2d(_0x33dacc);}});};AGIVertices[_0xaf12('0x14')]['createSquareRecording']=function(_0x5dcf9c,_0xb832ed,_0x29ddb2,_0x1fed3c){this[_0xaf12('0x16')]['createSquareRecording']({'uniqueid':this[_0xaf12('0xe')][_0xaf12('0x35')],'callerid':this[_0xaf12('0xe')][_0xaf12('0x38')],'calleridname':this['channel'][_0xaf12('0x39')],'context':this[_0xaf12('0xe')][_0xaf12('0x3a')],'extension':this['channel'][_0xaf12('0x3b')],'priority':this[_0xaf12('0xe')][_0xaf12('0x3c')],'accountcode':this[_0xaf12('0xe')]['accountcode'],'dnid':this[_0xaf12('0xe')]['dnid'],'projectName':this[_0xaf12('0xe')][_0xaf12('0x3d')],'saveName':_0xb832ed,'filename':_0x5dcf9c[_0xaf12('0x3e')]||_0xb832ed,'savePath':_0x29ddb2})[_0xaf12('0x11')](function(_0x362e2c){_0x1fed3c(null,_0x362e2c);})[_0xaf12('0x13')](function(_0x418004){_0x1fed3c(_0x418004);});};AGIVertices['prototype'][_0xaf12('0x3f')]=function(_0x483902,_0x52b2c3,_0x3fd0fc,_0x453f98,_0x5ee78d){this[_0xaf12('0x16')][_0xaf12('0x3f')]({'uniqueid':this[_0xaf12('0xe')]['uniqueid'],'body':_0x483902,'direction':_0x52b2c3,'providerName':_0x3fd0fc,'providerResponse':_0x453f98})[_0xaf12('0x11')](function(_0x3a984a){if(_0x5ee78d){_0x5ee78d(null,_0x3a984a);}})['catch'](function(_0x348170){if(_0x5ee78d){_0x5ee78d(_0x348170);}});};AGIVertices['prototype'][_0xaf12('0x40')]=function(_0x5094f7,_0x2ca730){this[_0xaf12('0x16')][_0xaf12('0x40')]({'firstName':_[_0xaf12('0x41')](_0x5094f7[_0xaf12('0x12')])||_[_0xaf12('0x42')](_0x5094f7[_0xaf12('0x12')])?_0xaf12('0x43')+Math[_0xaf12('0x44')]():_0x5094f7[_0xaf12('0x12')],'lastName':_[_0xaf12('0x41')](_0x5094f7[_0xaf12('0x45')])||_[_0xaf12('0x42')](_0x5094f7['lastName'])?null:_0x5094f7['lastName'],'phone':_0x5094f7[_0xaf12('0x46')],'ListId':_0x5094f7[_0xaf12('0x47')],'scheduledat':_0x5094f7[_0xaf12('0x48')],'callbackUniqueid':this[_0xaf12('0xe')][_0xaf12('0x35')],'tags':_0xaf12('0x49'),'description':'Callback\x20scheduled\x20at\x20'+_0x5094f7[_0xaf12('0x48')][_0xaf12('0x4a')](),'priority':_0x5094f7['callback_priority']})[_0xaf12('0x11')](function(_0x178aba){_0x2ca730(null,_0x178aba);})[_0xaf12('0x13')](function(_0x431f9c){_0x2ca730(_0x431f9c);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x4b')]=function(_0x4ead59,_0x1e35e4){this['rpc'][_0xaf12('0x4c')](_0x4ead59)[_0xaf12('0x11')](function(_0xf5cdb6){_0x1e35e4(null,_0xf5cdb6?_0xf5cdb6[_0xaf12('0x12')]:![]);})[_0xaf12('0x13')](function(_0x5263aa){_0x1e35e4(_0x5263aa);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x4d')]=function(_0x1bc14a,_0x6a9dab,_0x50ccd4){var _0x141ee2={'role':_0xaf12('0x4e')};_0x141ee2[_0x1bc14a]=this[_0xaf12('0xe')][_0xaf12('0x38')];this[_0xaf12('0x16')]['agentPause'](_0x141ee2,_0x6a9dab,this[_0xaf12('0xe')]['uniqueid'])[_0xaf12('0x11')](function(_0x1ac4e0){_0x50ccd4(null,_['isNil'](_0x1ac4e0)?![]:!![]);})['catch'](function(_0x3b5229){logger[_0xaf12('0x30')](_0x3b5229);_0x50ccd4(null,![]);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x4f')]=function(_0x33d523,_0x2f8afd){var _0x5ce25c={'role':_0xaf12('0x4e')};_0x5ce25c[_0x33d523]=this['channel']['callerid'];this[_0xaf12('0x16')][_0xaf12('0x4f')](_0x5ce25c)[_0xaf12('0x11')](function(_0x2f6781){_0x2f8afd(null,_[_0xaf12('0x42')](_0x2f6781)?![]:!![]);})[_0xaf12('0x13')](function(_0x1b6b1f){logger[_0xaf12('0x30')](_0x1b6b1f);_0x2f8afd(null,![]);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x50')]=function(_0x3e16f2,_0xc2efce){var _0x351326={'role':'agent'};_0x351326[_0x3e16f2]=this[_0xaf12('0xe')][_0xaf12('0x38')];this[_0xaf12('0x16')][_0xaf12('0x50')](_0x351326)[_0xaf12('0x11')](function(_0x321934){_0xc2efce(null,_[_0xaf12('0x42')](_0x321934)?![]:!![]);})[_0xaf12('0x13')](function(_0x11a6b3){logger['error'](_0x11a6b3);_0xc2efce(null,![]);});};AGIVertices[_0xaf12('0x14')]['agentLogin']=function(_0x2c1e77,_0x2a7ca4){var _0x26eafb={'role':_0xaf12('0x4e')};_0x26eafb[_0x2c1e77]=this[_0xaf12('0xe')][_0xaf12('0x38')];var _0x5456f1=_0x2c1e77!=_0xaf12('0x51')?util[_0xaf12('0x52')](_0xaf12('0x53'),'LOCAL',this[_0xaf12('0xe')][_0xaf12('0x38')]):undefined;this[_0xaf12('0x16')][_0xaf12('0x54')](_0x26eafb,_0x5456f1)[_0xaf12('0x11')](function(_0x187a97){_0x2a7ca4(null,_[_0xaf12('0x42')](_0x187a97)?![]:!![]);})['catch'](function(_0x48ae6c){logger[_0xaf12('0x30')](_0x48ae6c);_0x2a7ca4(null,![]);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x55')]=function(_0x24465f,_0x19d8a5){sh[_0xaf12('0x56')](_[_0xaf12('0x57')](_0x24465f),function(_0x96bfad,_0x333081){var _0x475992=_0x333081[_0xaf12('0x58')](/(\r\n|\n|\r)/gm,'');_0x19d8a5(null,_0x475992);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x59')]=function(_0x76693e,_0x19b129){scripts['googleCloudTTS'](_0x76693e[_0xaf12('0x5a')],_0x76693e[_0xaf12('0x5b')]||'text',_0x76693e[_0xaf12('0x5c')],_0x76693e['languageCode']||_0xaf12('0x5d'),_0x76693e[_0xaf12('0x5e')]||_0xaf12('0x5f'),_0x76693e['audioEncoding']||'MP3')[_0xaf12('0x11')](function(_0x37bb52){_0x19b129(null,_0x37bb52);})[_0xaf12('0x13')](function(_0x282233){_0x19b129(_0x282233);});};AGIVertices['prototype'][_0xaf12('0x60')]=function(_0x165e46,_0x5605d6){scripts[_0xaf12('0x60')](_0x165e46[_0xaf12('0x5c')],_0x165e46[_0xaf12('0x61')]||'en',0x1)['then'](function(_0x642836){_0x5605d6(null,_0x642836);})[_0xaf12('0x13')](function(_0x15e38e){_0x5605d6(_0x15e38e);});};AGIVertices['prototype'][_0xaf12('0x62')]=function(_0x295baf,_0x514279){var _0x2508cf={'uri':_0x295baf[_0xaf12('0x63')],'method':_0x295baf['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x295baf[_0xaf12('0x64')])===_0xaf12('0x65')&&parseInt(_0x295baf['timeout'])>=0x1?parseInt(_0x295baf[_0xaf12('0x64')])*0x3e8:0x5*0x3e8};if(_[_0xaf12('0x66')]([_0xaf12('0x67'),_0xaf12('0x68')],_0x2508cf[_0xaf12('0x69')][_0xaf12('0x6a')]())){try{_0x2508cf[_0xaf12('0x6b')]=_0x295baf[_0xaf12('0xa')]?JSON[_0xaf12('0x6c')](_0x295baf['rawBody']):{};}catch(_0x5956c6){logger[_0xaf12('0x30')](_0xaf12('0x6d'),_0x5956c6);}}try{_0x2508cf[_0xaf12('0x6e')]=_0x295baf[_0xaf12('0x6f')]?JSON[_0xaf12('0x6c')](_0x295baf[_0xaf12('0x6f')]):{};}catch(_0x4274e6){logger[_0xaf12('0x30')](_0xaf12('0x70'),_0x4274e6);}if(_0x295baf[_0xaf12('0x71')]){try{var _0x34debf=require(_0x295baf['computedVariables'])[_0xaf12('0x72')](this,_0x2508cf);_0x2508cf[_0xaf12('0x73')]=Mustache['render'](_0x295baf['url'],_0x34debf,{},['$$','$$']);if(_0x2508cf['headers']){_0x2508cf['headers']=JSON['parse'](Mustache[_0xaf12('0x74')](JSON[_0xaf12('0x75')](_0x2508cf[_0xaf12('0x6e')]),_0x34debf,{},['$$','$$']));}if(_0x2508cf[_0xaf12('0x6b')]){_0x2508cf[_0xaf12('0x6b')]=JSON[_0xaf12('0x6c')](Mustache[_0xaf12('0x74')](JSON['stringify'](_0x2508cf['body']),_0x34debf,{},['$$','$$']));}}catch(_0x4cbd7e){logger[_0xaf12('0x30')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4cbd7e);}}rp(_0x2508cf)[_0xaf12('0x11')](function(_0x5f46e1){var _0x5e60fb={'statusCode':_0x5f46e1[_0xaf12('0x76')]||0xc8,'statusMessage':_0x5f46e1[_0xaf12('0x77')]||'OK','headers':_0x5f46e1[_0xaf12('0x6e')]||{},'body':_0x5f46e1['body']||{}};_0x514279(null,_0x5e60fb);})[_0xaf12('0x13')](function(_0x5961f3){var _0x5e3fa0={'statusCode':_0x5961f3[_0xaf12('0x76')]||0x1f4,'statusMessage':_0x5961f3[_0xaf12('0x78')]||_0xaf12('0x79'),'headers':_0x5961f3[_0xaf12('0x7a')][_0xaf12('0x6e')]||{},'body':_0x5961f3[_0xaf12('0x7a')]['body']||{}};_0x514279(null,_0x5e3fa0);});};AGIVertices['prototype']['googleDialogflow']=function(_0x54206f,_0x2c7ac3){scripts[_0xaf12('0x7b')](this[_0xaf12('0xe')][_0xaf12('0x35')],_0x54206f[_0xaf12('0x7c')],_0x54206f[_0xaf12('0x5c')],_0x54206f[_0xaf12('0x7d')]||'en')[_0xaf12('0x11')](function(_0x24094a){_0x2c7ac3(null,_0x24094a);})[_0xaf12('0x13')](function(_0x7df54c){_0x2c7ac3(_0x7df54c);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x7e')]=function(_0x1a4184,_0x6e13ed){scripts[_0xaf12('0x7e')](this[_0xaf12('0xe')][_0xaf12('0x35')],_0x1a4184[_0xaf12('0x7f')],_0x1a4184['client_email'],_0x1a4184['private_key'],_0x1a4184[_0xaf12('0x5c')],_0x1a4184[_0xaf12('0x80')]||'en')[_0xaf12('0x11')](function(_0x5c40a9){_0x6e13ed(null,_0x5c40a9);})['catch'](function(_0x4d18ef){_0x6e13ed(_0x4d18ef);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x81')]=function(_0xe52844,_0x3da929){scripts[_0xaf12('0x81')](this[_0xaf12('0xe')],_0xe52844)['then'](function(_0x52a756){_0x3da929(null,_0x52a756);})[_0xaf12('0x13')](function(_0x3370de){_0x3da929(_0x3370de);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x82')]=function(_0x3084ee,_0x1119ee){scripts[_0xaf12('0x82')](_0x3084ee[_0xaf12('0x7c')],_0x3084ee[_0xaf12('0x5c')],_0x3084ee['ispeech_tts_language']||_0xaf12('0x5d'),_0x3084ee[_0xaf12('0x83')])['then'](function(_0x39045c){_0x1119ee(null,_0x39045c);})['catch'](function(_0x587778){_0x1119ee(_0x587778);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x84')]=function(_0x381580,_0x21957e,_0x56ca2b){scripts[_0xaf12('0x84')](_0x21957e,_0x381580[_0xaf12('0x7c')],_0x381580[_0xaf12('0x85')]||'en-US',this[_0xaf12('0x86')](_0x381580['model'])?_0x381580[_0xaf12('0x87')]:undefined)[_0xaf12('0x11')](function(_0x1bf6d8){_0x56ca2b(null,_0x1bf6d8);})[_0xaf12('0x13')](function(_0xed8de2){_0x56ca2b(_0xed8de2);});};AGIVertices[_0xaf12('0x14')]['awsPolly']=function(_0x5888af,_0x8da8e7){scripts[_0xaf12('0x88')](_0x5888af[_0xaf12('0x89')],_0x5888af[_0xaf12('0x8a')],_0x5888af['aws_polly_region'],_0x5888af['aws_polly_voice']||_0xaf12('0x8b'),_0x5888af[_0xaf12('0x5c')],_0x5888af['aws_text_type']||_0xaf12('0x5c'))[_0xaf12('0x11')](function(_0x3690db){_0x8da8e7(null,_0x3690db);})[_0xaf12('0x13')](function(_0x265aa1){_0x8da8e7(_0x265aa1);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x8c')]=function(_0x1a5a75,_0x5764c3){scripts['awsLex'](this[_0xaf12('0xe')][_0xaf12('0x35')],_0x1a5a75[_0xaf12('0x89')],_0x1a5a75[_0xaf12('0x8a')],_0x1a5a75[_0xaf12('0x8d')],_0x1a5a75[_0xaf12('0x5c')],_0x1a5a75['aws_bot_name'])['then'](function(_0x1a225c){_0x5764c3(null,_0x1a225c);})[_0xaf12('0x13')](function(_0x3e4bb5){_0x5764c3(_0x3e4bb5);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x8e')]=function(_0x581e61,_0xba79ba,_0x47ee02){scripts[_0xaf12('0x8e')](_0xba79ba,_0x581e61[_0xaf12('0x7c')],_0x581e61[_0xaf12('0x8f')]||'en-US')[_0xaf12('0x11')](function(_0x266bff){_0x47ee02(null,_0x266bff);})[_0xaf12('0x13')](function(_0x27c8ba){_0x47ee02(_0x27c8ba);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x90')]=function(_0x258dee,_0xdb0862,_0x1229c1){scripts['tildeASR'](_0xdb0862,_0x258dee['appid'],_0x258dee[_0xaf12('0x91')],_0x258dee['uri'])[_0xaf12('0x11')](function(_0x5ba3b4){_0x1229c1(null,_0x5ba3b4);})['catch'](function(_0x77da41){_0x1229c1(_0x77da41);});};AGIVertices[_0xaf12('0x14')][_0xaf12('0x92')]=function(_0x389807){var _0x402eb0=_[_0xaf12('0x66')](verticesWithRetry,_0x389807[_0xaf12('0x37')])?_0x389807:_[_0xaf12('0x93')](_0x389807);for(var _0x3a2127 in _0x402eb0){if(_0x402eb0[_0xaf12('0x94')](_0x3a2127)){if(_0x402eb0[_0x3a2127]&&_[_0xaf12('0x95')](_0x402eb0[_0x3a2127])){if(_[_0xaf12('0x66')](recursiveMapAttributes,_0x3a2127)){_0x402eb0[_0x3a2127]=this[_0xaf12('0x96')](_0x402eb0[_0x3a2127]);}else{_0x402eb0[_0x3a2127]=this[_0xaf12('0x97')](_0x402eb0[_0x3a2127]);}}}}return _0x402eb0;};AGIVertices[_0xaf12('0x14')]['recursiveNodeIndex']=function(_0x1b44e2){for(var _0x384819 in _0x1b44e2){if(_0x1b44e2[_0xaf12('0x94')](_0x384819)){if(_[_0xaf12('0x98')](_0x1b44e2[_0x384819])){this['recursiveNodeIndex'](_0x1b44e2[_0x384819]);}else if(_['isArray'](_0x1b44e2[_0x384819])){for(var _0x305064=0x0;_0x305064<_0x1b44e2[_0x384819][_0xaf12('0x99')];_0x305064++){this[_0xaf12('0x9a')](_0x1b44e2[_0x384819][_0x305064]);}}else if(_[_0xaf12('0x95')](_0x1b44e2[_0x384819])){_0x1b44e2[_0x384819]=this[_0xaf12('0x97')](_0x1b44e2[_0x384819]);}}}};AGIVertices['prototype'][_0xaf12('0x9b')]=function(_0x3f41f1,_0x3a03ad){for(var _0x29f49f in _0x3f41f1){if(_0x3f41f1['hasOwnProperty'](_0x29f49f)){if(_[_0xaf12('0x98')](_0x3f41f1[_0x29f49f])){if(!_[_0xaf12('0x41')](_0x3f41f1[_0x29f49f])){this[_0xaf12('0x9b')](_0x3f41f1[_0x29f49f],util[_0xaf12('0x52')](_0xaf12('0x9c'),_0x3a03ad,_0x29f49f));}}else if(_[_0xaf12('0x9d')](_0x3f41f1[_0x29f49f])){for(var _0x32fd46=0x0;_0x32fd46<_0x3f41f1[_0x29f49f]['length'];_0x32fd46++){this[_0xaf12('0x9b')](_0x3f41f1[_0x29f49f][_0x32fd46],util['format']('%s.%s',_0x3a03ad,_0x29f49f+'['+_0x32fd46+']'));}}else{if(!_[_0xaf12('0x42')](_0x3f41f1[_0x29f49f])){this[_0xaf12('0xe')][_0xaf12('0x9e')](util['format'](_0xaf12('0x9c'),_0x3a03ad,_0x29f49f),_0x3f41f1[_0x29f49f]);}}}}};AGIVertices[_0xaf12('0x14')][_0xaf12('0x96')]=function(_0x257a37){try{var _0x11df8a=JSON[_0xaf12('0x6c')](_0x257a37);this[_0xaf12('0x9a')](_0x11df8a);return JSON[_0xaf12('0x75')](_0x11df8a);}catch(_0x14c1d7){return this[_0xaf12('0x97')](_0x257a37);}};AGIVertices[_0xaf12('0x14')][_0xaf12('0x97')]=function(_0x1e896b){var _0x1f9c5a=_0x1e896b[_0xaf12('0x9f')]('{');for(var _0xe495c2=0x1;_0xe495c2<_0x1f9c5a['length'];_0xe495c2+=0x1){var _0x4bf7a5=_0x1f9c5a[_0xe495c2][_0xaf12('0x9f')]('}');if(_0x4bf7a5['length']>0x1){_0x1e896b=_0x1e896b[_0xaf12('0xa0')]('{'+_0x4bf7a5[0x0]+'}',this['channel'][_0xaf12('0x10')](_0x4bf7a5[0x0])[_0xaf12('0xa1')]||_0x4bf7a5[0x0]);}}if(_0x1f9c5a[_0xaf12('0x99')]===0x1){return _0x1e896b[_0xaf12('0x4a')]();}return this[_0xaf12('0x97')](_0x1e896b);};AGIVertices[_0xaf12('0x14')][_0xaf12('0xa2')]=function(_0x4c651b,_0x4ccdad){var _0x23adc1=this['channel']['getVariable'](_0x4c651b);if(_0x23adc1[_0xaf12('0xa3')]===-0x1){return _0x23adc1;}logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0xa4'),_0x4ccdad,_0x23adc1[_0xaf12('0xa1')]));return this[_0xaf12('0xe')][_0xaf12('0x9e')](_0x4ccdad,_0x23adc1[_0xaf12('0xa1')]);};AGIVertices[_0xaf12('0x14')][_0xaf12('0x86')]=function(_0x517b53){return _0x517b53&&_0x517b53!=='0'&&_0x517b53!=='-1'&&_0x517b53!=='';};AGIVertices['prototype'][_0xaf12('0xa5')]=function(_0x204edf){this[_0xaf12('0x34')][_0xaf12('0x72')](this,_0x204edf,'-');_0x204edf[_0xaf12('0xa6')]=_0x204edf[_0xaf12('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xaf12('0x14')][_0xaf12('0xa7')]=function(_0x4e82f3){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0xa8'),_0x4e82f3['label']));if(!this[_0xaf12('0x86')](_0x4e82f3['text'])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0xaa'));}var _0x2b7a16='\x22'+_0x4e82f3[_0xaf12('0x5c')]+'\x22';if(this[_0xaf12('0x86')](_0x4e82f3['options'])){_0x2b7a16+=','+_0x4e82f3[_0xaf12('0x7a')];}var _0x147785=this[_0xaf12('0xe')][_0xaf12('0x56')](_0xaf12('0xab'),_0x2b7a16);if(_0x147785['result']===-0x1){return _0x147785;}return this[_0xaf12('0xe')][_0xaf12('0xa9')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x2b7a16));};AGIVertices['prototype']['mrcprecog']=function(_0x55d189){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0xac'),_0x55d189['label']));if(!this[_0xaf12('0x86')](_0x55d189[_0xaf12('0xad')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x249f43=_0x55d189[_0xaf12('0xad')];if(this[_0xaf12('0x86')](_0x55d189['options'])){_0x249f43+=','+_0x55d189[_0xaf12('0x7a')];}var _0x1237e4=this[_0xaf12('0xe')][_0xaf12('0x56')]('MRCPRecog',_0x249f43);if(_0x1237e4[_0xaf12('0xa3')]===-0x1){return _0x1237e4;}var _0x45b54c=this[_0xaf12('0xa2')](_0xaf12('0xae'),'MRCP_RECOG_CONFIDENCE');if(_0x45b54c[_0xaf12('0xa3')]===-0x1){return _0x45b54c;}var _0x365510=this[_0xaf12('0xa2')](_0xaf12('0xaf'),_0xaf12('0xb0'));if(_0x365510[_0xaf12('0xa3')]===-0x1){return _0x365510;}var _0x174151=this[_0xaf12('0xa2')](_0xaf12('0xb1'),'MRCP_RECOG_INSTANCE');if(_0x174151[_0xaf12('0xa3')]===-0x1){return _0x174151;}return this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')]('Executed\x20command\x20MRCPRecog\x20%s',_0x249f43));};AGIVertices[_0xaf12('0x14')][_0xaf12('0x7')]=function(_0x3928ae){logger['info'](util[_0xaf12('0x52')](_0xaf12('0xb2'),_0x3928ae[_0xaf12('0x36')]));return this[_0xaf12('0xe')][_0xaf12('0x7')]([_0x3928ae['command'],_0x3928ae[_0xaf12('0xb3')]]);};AGIVertices[_0xaf12('0x14')][_0xaf12('0xb4')]=function(_0x3b3e4c){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0xb5'),_0x3b3e4c[_0xaf12('0x36')]));if(this[_0xaf12('0x86')](_0x3b3e4c[_0xaf12('0x64')])){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0xb6'),_0x3b3e4c['timeout']));var _0x34c271=this[_0xaf12('0xe')]['wait'](_0x3b3e4c['timeout']);if(_0x34c271[_0xaf12('0xa3')]===-0x1){return _0x34c271;}}return this[_0xaf12('0xe')]['answer']();};AGIVertices[_0xaf12('0x14')]['callback']=function(_0x266d1a){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0xb7'),_0x266d1a['label']));if(!this['isConfigured'](_0x266d1a['list_id'])){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x266d1a,_0xaf12('0xb8'));}_0x266d1a[_0xaf12('0x48')]=moment();if(this['isConfigured'](_0x266d1a['delay'])){_0x266d1a[_0xaf12('0x48')]=moment()[_0xaf12('0xb9')](_0x266d1a['delay'],'minutes');}if(!this[_0xaf12('0x86')](_0x266d1a[_0xaf12('0xba')])){_0x266d1a[_0xaf12('0xba')]=0x2;}this[_0xaf12('0x40')]['sync'](this,_0x266d1a);return this[_0xaf12('0xe')][_0xaf12('0xa9')](util['format'](_0xaf12('0xbb'),_0x266d1a[_0xaf12('0x46')],_0x266d1a[_0xaf12('0x47')],_0x266d1a[_0xaf12('0x48')]));};AGIVertices[_0xaf12('0x14')][_0xaf12('0xbc')]=function(_0x545c4c){logger['info'](util[_0xaf12('0x52')](_0xaf12('0xbd'),_0x545c4c['label']));var _0x26ac41=this['channel'][_0xaf12('0x56')](_0x545c4c['application'],_0x545c4c[_0xaf12('0x7a')]);if(_0x26ac41[_0xaf12('0xa3')]===-0x1){return _0x26ac41;}return this['channel'][_0xaf12('0xa9')](util['format'](_0xaf12('0xbe'),_0x545c4c[_0xaf12('0xbf')],_0x545c4c['options']));};AGIVertices[_0xaf12('0x14')][_0xaf12('0xc0')]=function(_0x39f807){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x39f807[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x39f807[_0xaf12('0x5c')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0xaa'));}var _0x1284b9='\x22'+_0x39f807[_0xaf12('0x5c')]+'\x22';if(this[_0xaf12('0x86')](_0x39f807['options'])){_0x1284b9+=','+_0x39f807[_0xaf12('0x7a')];}var _0x1aa10e=this[_0xaf12('0xe')][_0xaf12('0x56')](_0xaf12('0xab'),_0x1284b9);if(_0x1aa10e[_0xaf12('0xa3')]===-0x1){return _0x1aa10e;}return this[_0xaf12('0xe')]['noop'](util['format'](_0xaf12('0xc1'),_0x1284b9));};AGIVertices[_0xaf12('0x14')][_0xaf12('0xc2')]=function(_0x44e692){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0xc3'),_0x44e692[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x44e692['text'])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0xaa'));}var _0xda9b8d='\x22'+_0x44e692[_0xaf12('0x5c')]+'\x22';if(this[_0xaf12('0x86')](_0x44e692[_0xaf12('0x7a')])){_0xda9b8d+=','+_0x44e692[_0xaf12('0x7a')];}var _0x1df711=this[_0xaf12('0xe')][_0xaf12('0x56')]('MRCPSynth',_0xda9b8d);if(_0x1df711['result']===-0x1){return _0x1df711;}return this[_0xaf12('0xe')]['noop'](util[_0xaf12('0x52')](_0xaf12('0xc1'),_0xda9b8d));};AGIVertices[_0xaf12('0x14')][_0xaf12('0xc4')]=function(_0x218097){logger['info'](util[_0xaf12('0x52')](_0xaf12('0xc5'),_0x218097[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x218097[_0xaf12('0xad')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0xc6'));}var _0x28b161=_0x218097[_0xaf12('0xad')];if(this[_0xaf12('0x86')](_0x218097[_0xaf12('0x7a')])){_0x28b161+=','+_0x218097[_0xaf12('0x7a')];}var _0x9789fd=this[_0xaf12('0xe')][_0xaf12('0x56')](_0xaf12('0xc7'),_0x28b161);if(_0x9789fd[_0xaf12('0xa3')]===-0x1){return _0x9789fd;}var _0x483e1c=this[_0xaf12('0xa2')](_0xaf12('0xae'),'LUMENVOX_ASR_CONFIDENCE');if(_0x483e1c[_0xaf12('0xa3')]===-0x1){return _0x483e1c;}var _0x36ffaa=this[_0xaf12('0xa2')]('RECOG_INPUT()',_0xaf12('0xc8'));if(_0x36ffaa['result']===-0x1){return _0x36ffaa;}var _0x486b06=this[_0xaf12('0xa2')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x486b06[_0xaf12('0xa3')]===-0x1){return _0x486b06;}return this['channel'][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0xc9'),_0x28b161));};AGIVertices[_0xaf12('0x14')][_0xaf12('0xca')]=function(_0x103159){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x103159[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x103159[_0xaf12('0xad')])){return this['channel'][_0xaf12('0xa9')](_0xaf12('0xc6'));}var _0x5a4dc9=_0x103159[_0xaf12('0xad')];if(this[_0xaf12('0x86')](_0x103159[_0xaf12('0x7a')])){_0x5a4dc9+=','+_0x103159[_0xaf12('0x7a')];}var _0x4cf936=this[_0xaf12('0xe')][_0xaf12('0x56')](_0xaf12('0xc7'),_0x5a4dc9);if(_0x4cf936[_0xaf12('0xa3')]===-0x1){return _0x4cf936;}var _0x40772f=this[_0xaf12('0xa2')](_0xaf12('0xae'),'SESTEK_ASR_CONFIDENCE');if(_0x40772f[_0xaf12('0xa3')]===-0x1){return _0x40772f;}var _0x546659=this[_0xaf12('0xa2')](_0xaf12('0xaf'),_0xaf12('0xcb'));if(_0x546659[_0xaf12('0xa3')]===-0x1){return _0x546659;}var _0x279ce1=this[_0xaf12('0xa2')](_0xaf12('0xb1'),'SESTEK_ASR_INSTANCE');if(_0x279ce1[_0xaf12('0xa3')]===-0x1){return _0x279ce1;}return this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5a4dc9));};AGIVertices['prototype']['database']=function(_0x2b4eb7){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x2b4eb7[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x2b4eb7[_0xaf12('0xcc')])){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x2b4eb7,_0xaf12('0xcd'));}var _0x4cb0bd=this[_0xaf12('0x18')]['sync'](this,_0x2b4eb7[_0xaf12('0xcc')]);if(!_0x4cb0bd){return this['channel'][_0xaf12('0x30')](_0x2b4eb7,_0xaf12('0xce'));}if(!this[_0xaf12('0x86')](_0x2b4eb7[_0xaf12('0x2d')])){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x2b4eb7,_0xaf12('0xcf'));}var _0x2f5e0a=_0x2b4eb7['query'][_0xaf12('0x58')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0xd0'),_0x2f5e0a));var _0x49ddc0=this[_0xaf12('0x2a')]['sync'](this,_0x4cb0bd,_0x2f5e0a);this[_0xaf12('0x34')]['sync'](this,_0x2b4eb7,_0x2f5e0a);if(!this['isConfigured'](_0x2b4eb7[_0xaf12('0xd1')])){return this['channel'][_0xaf12('0xa9')](_0xaf12('0xd2'));}var _0x12d24f=this[_0xaf12('0x10')][_0xaf12('0x72')](this,_0x2b4eb7[_0xaf12('0xd1')]);if(!_0x12d24f){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x2b4eb7,_0xaf12('0xd3'));}var _0x1b3d52=this;_0x49ddc0[_0xaf12('0xd4')](function(_0x274f74,_0x25b61d){Object[_0xaf12('0xd5')](_0x274f74)[_0xaf12('0xd4')](function(_0x2eb76d){_0x1b3d52[_0xaf12('0xe')]['setVariable'](util['format']('%s[%s][%s]',_0x12d24f,_0x25b61d,_0x2eb76d),_0x274f74[_0x2eb76d]);});});this['channel'][_0xaf12('0x9e')](util[_0xaf12('0x52')](_0xaf12('0xd6'),_0x12d24f),_0x49ddc0['length']);return this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0xd7'),_0x12d24f));};AGIVertices[_0xaf12('0x14')][_0xaf12('0xd8')]=function(_0x5dc966){logger[_0xaf12('0xd9')](util[_0xaf12('0x52')](_0xaf12('0xda'),_0x5dc966[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x5dc966[_0xaf12('0xdb')])){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x5dc966,_0xaf12('0xdc'));}var _0x3f6687=this[_0xaf12('0x1b')][_0xaf12('0x72')](this,_0x5dc966[_0xaf12('0xdb')]);if(!_0x3f6687){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x5dc966,_0xaf12('0xdd'));}var _0x249463=this['channel'][_0xaf12('0x56')](_0xaf12('0xde'),[util['format'](_0xaf12('0xdf'),_0x3f6687),_0x5dc966[_0xaf12('0x64')],_0x5dc966[_0xaf12('0xe0')],_0x5dc966['url']]);if(_0x249463[_0xaf12('0xa3')]===-0x1){return _0x249463;}return this['channel']['noop'](util['format'](_0xaf12('0xe1'),_0xaf12('0xde')));};AGIVertices['prototype'][_0xaf12('0xe2')]=function(_0x554563){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x554563[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x554563[_0xaf12('0x7c')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0xe3'));}if(!this[_0xaf12('0x86')](_0x554563[_0xaf12('0x5c')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0xaa'));}this[_0xaf12('0xe')][_0xaf12('0xe4')]=!![];this[_0xaf12('0x34')](_0x554563);this['createSquareMessage'](_0x554563[_0xaf12('0x5c')],'in','','');this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0xe5'),_0x554563[_0xaf12('0x5c')]));var _0x31a9f7=this[_0xaf12('0x7b')]['sync'](this,_0x554563);if(_0x31a9f7){for(var _0x4781bb in _0x31a9f7){if(_0x31a9f7[_0xaf12('0x94')](_0x4781bb)){this['channel']['setVariable'](util['format'](_0xaf12('0xe6'),_0x4781bb['toUpperCase']()),_0x31a9f7[_0x4781bb]);}}this['createSquareMessage'](_0x31a9f7['speech'],_0xaf12('0xe7'),'dialogflow','');return this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0xe8'),_0x31a9f7[_0xaf12('0xe9')]));}return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x554563,_0xaf12('0xea'));};AGIVertices[_0xaf12('0x14')][_0xaf12('0xeb')]=function(_0x473ab0){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0xec'),_0x473ab0['label']));if(!this[_0xaf12('0x86')](_0x473ab0['dialogflowV2_project_id'])){return this['channel'][_0xaf12('0xa9')](_0xaf12('0xed'));}if(!this[_0xaf12('0x86')](_0x473ab0[_0xaf12('0xee')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0xef'));}if(!this[_0xaf12('0x86')](_0x473ab0[_0xaf12('0xf0')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0xf1'));}if(!this[_0xaf12('0x86')](_0x473ab0['dialogflowV2_language'])){return this['channel']['noop'](_0xaf12('0xf2'));}if(!this['isConfigured'](_0x473ab0[_0xaf12('0x5c')])){return this[_0xaf12('0xe')]['noop'](_0xaf12('0xaa'));}this['channel'][_0xaf12('0xe4')]=!![];this['createSquareDetailsReport'](_0x473ab0);this[_0xaf12('0x3f')](_0x473ab0['text'],'in','','');this[_0xaf12('0xe')]['noop'](util['format'](_0xaf12('0xf3'),_0x473ab0[_0xaf12('0x5c')]));var _0x326bdf=this[_0xaf12('0x7e')][_0xaf12('0x72')](this,_0x473ab0);if(_0x326bdf){for(var _0x418662 in _0x326bdf){if(_0x326bdf['hasOwnProperty'](_0x418662)){if(_0x418662!==_0xaf12('0xf4')){this['channel'][_0xaf12('0x9e')](util[_0xaf12('0x52')](_0xaf12('0xe6'),_0x418662[_0xaf12('0x6a')]()),_0x326bdf[_0x418662]);}}}this[_0xaf12('0x3f')](_0x326bdf['speech'],_0xaf12('0xe7'),'dialogflowV2',_0x326bdf[_0xaf12('0xf4')]);return this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0xf5'),_0x326bdf['speech']));}return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x473ab0,_0xaf12('0xf6'));};AGIVertices['prototype'][_0xaf12('0xf7')]=function(_0x3e99f9){logger['info'](util['format'](_0xaf12('0xf8'),_0x3e99f9[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x3e99f9[_0xaf12('0xf9')])){return this[_0xaf12('0xe')]['noop'](_0xaf12('0xfa'));}if(!this[_0xaf12('0x86')](_0x3e99f9[_0xaf12('0xfb')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0xfc'));}if(!this[_0xaf12('0x86')](_0x3e99f9['password'])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0xfd'));}if(!this[_0xaf12('0x86')](_0x3e99f9[_0xaf12('0xfe')])){return this['channel'][_0xaf12('0xa9')]('no\x20text\x20configured');}this[_0xaf12('0xe')][_0xaf12('0xe4')]=!![];this[_0xaf12('0x34')](_0x3e99f9);this['createSquareMessage'](_0x3e99f9['text'],'in','','');this[_0xaf12('0xe')]['noop'](util[_0xaf12('0x52')](_0xaf12('0xff'),_0x3e99f9[_0xaf12('0x5c')]));var _0x1b92a6=this[_0xaf12('0x81')][_0xaf12('0x72')](this,_0x3e99f9);if(_0x1b92a6){for(var _0xb63628 in _0x1b92a6){if(_0x1b92a6[_0xaf12('0x94')](_0xb63628)){this[_0xaf12('0xe')]['setVariable'](util[_0xaf12('0x52')](_0xaf12('0x100'),_0xb63628[_0xaf12('0x6a')]()),_0x1b92a6[_0xb63628]);}}this[_0xaf12('0x3f')](_0x1b92a6[_0xaf12('0xe9')],_0xaf12('0xe7'),'sesteknda','');if(_0x1b92a6[_0xaf12('0x101')]){this['channel'][_0xaf12('0xa9')](util['format'](_0xaf12('0x102'),_0x1b92a6[_0xaf12('0x101')]));var _0x54223e=this[_0xaf12('0xe')][_0xaf12('0x103')](_0x1b92a6[_0xaf12('0x101')]);try{fs[_0xaf12('0x104')](_0x1b92a6[_0xaf12('0x101')]+_0xaf12('0x105'));}catch(_0x1165ea){logger[_0xaf12('0x30')](_0x1165ea);}return _0x54223e;}else{return this[_0xaf12('0xe')][_0xaf12('0xa9')](util['format'](_0xaf12('0x106'),_0x1b92a6[_0xaf12('0xe9')]));}}return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x3e99f9,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0xaf12('0x107')]=function(_0x1019e7){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x108'),_0x1019e7['label']));return this[_0xaf12('0xe')]['noop']('end');};AGIVertices[_0xaf12('0x14')][_0xaf12('0x109')]=function(_0x1afe39){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x10a'),_0x1afe39['label']));var _0x4b3ccb='';if(_0x1afe39[_0xaf12('0x10b')]){if(!this[_0xaf12('0x86')](_0x1afe39[_0xaf12('0x10b')])){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x1afe39,_0xaf12('0x10c'));}else{var _0x4ccbcd=parseInt(_0x1afe39[_0xaf12('0x10b')],0xa);if(isNaN(_0x4ccbcd)){_0x4b3ccb=_0x1afe39['trunk_id'];}else{_0x4b3ccb=this[_0xaf12('0x1d')][_0xaf12('0x72')](this,_0x1afe39['trunk_id']);if(!_0x4b3ccb){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x1afe39,'no\x20trunk\x20found');}}}}else if(_0x1afe39[_0xaf12('0x10d')]){_0x4b3ccb=_0x1afe39[_0xaf12('0x10d')];}else{return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x1afe39,_0xaf12('0x10c'));}var _0x1f7b0d=this[_0xaf12('0xe')][_0xaf12('0x56')]('DIAL',[util[_0xaf12('0x52')](_0xaf12('0x10e'),_0x4b3ccb,_0x1afe39['phone']),_0x1afe39['timeout'],_0x1afe39[_0xaf12('0xe0')],_0x1afe39[_0xaf12('0x63')]]);if(_0x1f7b0d[_0xaf12('0xa3')]===-0x1){return _0x1f7b0d;}return this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0xe1'),_0xaf12('0xde')));};AGIVertices[_0xaf12('0x14')][_0xaf12('0x10f')]=function(_0x37dac9){logger['info'](util[_0xaf12('0x52')](_0xaf12('0x110'),_0x37dac9[_0xaf12('0x36')]));return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0x10f'));};AGIVertices[_0xaf12('0x14')][_0xaf12('0xc')]=function(_0x3e61f4){logger['info'](util[_0xaf12('0x52')](_0xaf12('0x111'),_0x3e61f4[_0xaf12('0x36')]));if(_0x3e61f4[_0xaf12('0xa6')]===0x0){return this[_0xaf12('0xa5')](_0x3e61f4);}_0x3e61f4['retry']-=0x1;if(!this['isConfigured'](_0x3e61f4[_0xaf12('0x112')])){return this[_0xaf12('0xe')]['error'](_0x3e61f4,_0xaf12('0x113'));}var _0x19b4d7=this[_0xaf12('0x1f')][_0xaf12('0x72')](this,_0x3e61f4[_0xaf12('0x112')]);if(!_0x19b4d7){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x3e61f4,_0xaf12('0x114'));}if(!this[_0xaf12('0x86')](_0x3e61f4[_0xaf12('0xd1')])){return this['channel']['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x58e3bc=this[_0xaf12('0xe')][_0xaf12('0x115')](_0x19b4d7,_0x3e61f4[_0xaf12('0x116')],_0x3e61f4[_0xaf12('0x117')]);var _0x1291ad=_0x58e3bc[_0xaf12('0xa3')]?_0x58e3bc[_0xaf12('0xa3')]['toString']():'';logger[_0xaf12('0x2b')](_0xaf12('0x118'),JSON['stringify'](_0x58e3bc));if(_0x58e3bc[_0xaf12('0xa3')]===-0x1){this[_0xaf12('0x34')][_0xaf12('0x72')](this,_0x3e61f4,_0x1291ad);return _0x58e3bc;}else if(_0x58e3bc[_0xaf12('0xa1')]===_0xaf12('0x64')){_0x58e3bc[_0xaf12('0xa3')]=_0x1291ad['length']>=parseInt(_0x3e61f4['mindigit'])?'x':'i';}else{_0x58e3bc[_0xaf12('0xa3')]=_0x1291ad[_0xaf12('0x99')]>=parseInt(_0x3e61f4[_0xaf12('0x119')])&&_0x1291ad[_0xaf12('0x99')]<=parseInt(_0x3e61f4[_0xaf12('0x117')])?'x':'i';}var _0x4faf19=this[_0xaf12('0x10')]['sync'](this,_0x3e61f4['variable_id']);if(!_0x4faf19){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x3e61f4,_0xaf12('0xd3'));}this[_0xaf12('0xe')][_0xaf12('0x9e')](_0x4faf19,_0x1291ad);if(this[_0xaf12('0x86')](_0x3e61f4['hiddendigitsnum'])){var _0x15ecb9=parseInt(_0x3e61f4['hiddendigitsnum'],0xa);var _0x3b1d49=rs[_0xaf12('0x11a')]({'charset':'*','length':_0x15ecb9});var _0x247fe4=_0x1291ad[_0xaf12('0x99')];if(_0x247fe4>0x0){if(_0x247fe4>_0x15ecb9){this['createSquareDetailsReport'][_0xaf12('0x72')](this,_0x3e61f4,_0x3e61f4[_0xaf12('0x11b')]===_0xaf12('0x11c')?_0x3b1d49+_0x1291ad[_0xaf12('0x11d')](_0x15ecb9):_0x1291ad[_0xaf12('0x11d')](0x0,_0x247fe4-_0x15ecb9)+_0x3b1d49);}else{this[_0xaf12('0x34')][_0xaf12('0x72')](this,_0x3e61f4,rs[_0xaf12('0x11a')]({'charset':'*','length':_0x247fe4}));}}else{this[_0xaf12('0x34')][_0xaf12('0x72')](this,_0x3e61f4,'');}}else{this[_0xaf12('0x34')][_0xaf12('0x72')](this,_0x3e61f4,_0x1291ad);}return _0x58e3bc;};AGIVertices[_0xaf12('0x14')]['getsecretdigits']=function(_0x451231){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x11e'),_0x451231['label']));return this['getdigits'](_0x451231);};AGIVertices['prototype']['goal']=function(_0x18a632){logger[_0xaf12('0x2b')](util['format'](_0xaf12('0x11f'),_0x18a632[_0xaf12('0x36')]));this[_0xaf12('0x34')][_0xaf12('0x72')](this,_0x18a632,_0x18a632[_0xaf12('0x120')]);return this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0x121'),_0x18a632[_0xaf12('0x120')]));};AGIVertices[_0xaf12('0x14')]['awspolly']=function(_0x28e24c){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x122'),_0x28e24c[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x28e24c[_0xaf12('0x89')])||!this['isConfigured'](_0x28e24c['aws_secret_access_key'])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0x123'));}if(!this[_0xaf12('0x86')](_0x28e24c[_0xaf12('0x5c')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0xaa'));}this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')]('Trying\x20aws\x20Polly\x20%s',_0x28e24c['text']));var _0x504801=this[_0xaf12('0x88')][_0xaf12('0x72')](this,_0x28e24c);if(_0x504801){this['channel'][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0x124'),_0x504801));var _0x30e409=this[_0xaf12('0xe')][_0xaf12('0x103')](_0x504801);try{fs[_0xaf12('0x104')](_0x504801+_0xaf12('0x105'));}catch(_0x55918f){logger[_0xaf12('0x30')](_0x55918f);}return _0x30e409;}return this['channel'][_0xaf12('0x30')](_0x28e24c,_0xaf12('0x125'));};AGIVertices[_0xaf12('0x14')][_0xaf12('0x126')]=function(_0x2bdce3){logger[_0xaf12('0x2b')](util['format'](_0xaf12('0x127'),_0x2bdce3[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x2bdce3[_0xaf12('0x89')])||!this[_0xaf12('0x86')](_0x2bdce3[_0xaf12('0x8a')])){return this['channel'][_0xaf12('0xa9')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x2bdce3[_0xaf12('0x128')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0x129'));}if(!this[_0xaf12('0x86')](_0x2bdce3['text'])){return this[_0xaf12('0xe')]['noop'](_0xaf12('0xaa'));}this[_0xaf12('0xe')][_0xaf12('0xe4')]=!![];this[_0xaf12('0x34')](_0x2bdce3);this['createSquareMessage'](_0x2bdce3['text'],'in','','');this[_0xaf12('0xe')][_0xaf12('0xa9')](util['format'](_0xaf12('0x12a'),_0x2bdce3[_0xaf12('0x5c')]));var _0x3d927f=this['awsLex'][_0xaf12('0x72')](this,_0x2bdce3);if(_0x3d927f){for(var _0x1f1e90 in _0x3d927f){if(_0x3d927f[_0xaf12('0x94')](_0x1f1e90)&&_['isString'](_0x3d927f[_0x1f1e90])){this[_0xaf12('0xe')]['setVariable'](util[_0xaf12('0x52')](_0xaf12('0x12b'),_0x1f1e90[_0xaf12('0x6a')]()),_0x3d927f[_0x1f1e90]);}}if(_[_0xaf12('0x42')](_0x3d927f[_0xaf12('0x78')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0x12c'));}else{this['createSquareMessage'](_0x3d927f[_0xaf12('0x78')],_0xaf12('0xe7'),_0xaf12('0x12d'),'');return this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0x12e'),_0x3d927f['message']));}}return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x2bdce3,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xaf12('0x14')][_0xaf12('0x12f')]=function(_0x112c21){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x130'),_0x112c21[_0xaf12('0x36')],_0x112c21[_0xaf12('0x64')]));if(!this[_0xaf12('0x86')](_0x112c21['key'])){return this[_0xaf12('0xe')]['noop']('no\x20key\x20configured');}var _0xf5a2a4=_0xaf12('0x131');var _0x3733a5=util[_0xaf12('0x52')](_0xaf12('0x132'),FILES_PATH,rs[_0xaf12('0x11a')](0x4));var _0x5d5491=util['format'](_0xaf12('0x9c'),_0x3733a5,_0xf5a2a4);var _0x23ebda=!![];if(_0x112c21[_0xaf12('0x133')]===_0xaf12('0x134')){_0x23ebda=![];}var _0x3d837f=this[_0xaf12('0xe')]['recordFile'](_0x3733a5,_0xf5a2a4,_0x112c21[_0xaf12('0x135')],_0x112c21[_0xaf12('0x64')],undefined,_0x23ebda);if(_0x3d837f[_0xaf12('0xa3')]!==-0x1){this[_0xaf12('0xe')]['noop'](util[_0xaf12('0x52')]('google\x20%s\x20file\x20created',_0x5d5491));var _0x4de933=this['googleASR'][_0xaf12('0x72')](this,_0x112c21,_0x5d5491);if(_0x4de933){for(var _0x58dbbe in _0x4de933){if(_0x4de933['hasOwnProperty'](_0x58dbbe)){this[_0xaf12('0xe')][_0xaf12('0x9e')](util[_0xaf12('0x52')](_0xaf12('0x136'),_0x58dbbe[_0xaf12('0x6a')]()),_0x4de933[_0x58dbbe]);}}return this['channel'][_0xaf12('0xa9')](util[_0xaf12('0x52')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x4de933)));}}return _0x3d837f;};AGIVertices['prototype'][_0xaf12('0x137')]=function(_0x557051){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x138'),_0x557051['label']));if(!this[_0xaf12('0x86')](_0x557051['appid'])){return this['channel'][_0xaf12('0xa9')](_0xaf12('0x139'));}if(!this[_0xaf12('0x86')](_0x557051['appsecret'])){return this['channel'][_0xaf12('0xa9')](_0xaf12('0x13a'));}var _0x18bee3=_0xaf12('0x131');var _0x390860=util[_0xaf12('0x52')](_0xaf12('0x132'),FILES_PATH,rs[_0xaf12('0x11a')](0x4));var _0x2a60fc=util[_0xaf12('0x52')](_0xaf12('0x9c'),_0x390860,_0x18bee3);var _0x3f3f04=!![];if(_0x557051[_0xaf12('0x133')]===_0xaf12('0x134')){_0x3f3f04=![];}var _0x12d1b6=this[_0xaf12('0xe')][_0xaf12('0x13b')](_0x390860,_0x18bee3,_0x557051[_0xaf12('0x135')],_0x557051['timeout'],undefined,_0x3f3f04);if(_0x12d1b6[_0xaf12('0xa3')]!==-0x1){this['channel']['noop'](util[_0xaf12('0x52')]('tilde\x20%s\x20file\x20created',_0x2a60fc));var _0x4a84d4=this[_0xaf12('0x90')][_0xaf12('0x72')](this,_0x557051,_0x2a60fc);if(_0x4a84d4){for(var _0x13e114 in _0x4a84d4){if(_0x4a84d4[_0xaf12('0x94')](_0x13e114)){this[_0xaf12('0xe')]['setVariable'](util[_0xaf12('0x52')](_0xaf12('0x13c'),_0x13e114[_0xaf12('0x6a')]()),_0x4a84d4[_0x13e114]);}}return this['channel'][_0xaf12('0xa9')](util[_0xaf12('0x52')]('TildeASR\x20Result\x20%s',JSON[_0xaf12('0x75')](_0x4a84d4)));}}return _0x12d1b6;};AGIVertices['prototype']['gotoc']=function(_0x109e18){logger[_0xaf12('0x2b')](util['format'](_0xaf12('0x13d'),_0x109e18[_0xaf12('0x36')]));return this[_0xaf12('0xe')][_0xaf12('0x13e')](_0x109e18[_0xaf12('0x3a')],_0x109e18[_0xaf12('0x3b')],_0x109e18['priority']);};AGIVertices[_0xaf12('0x14')][_0xaf12('0x13f')]=function(_0x1473d5){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x1473d5[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x1473d5[_0xaf12('0x140')])){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x1473d5,_0xaf12('0x141'));}try{var _0x332b7f=eval(_0x1473d5[_0xaf12('0x140')])?_0xaf12('0x142'):_0xaf12('0x143');this['channel'][_0xaf12('0xa9')](util[_0xaf12('0x52')]('EVAL\x20CONDITION\x20%s\x20%s',_0x1473d5[_0xaf12('0x140')],_0x332b7f));return{'code':0xc8,'result':_0x332b7f};}catch(_0x1305a3){return{'code':0xc8,'result':_0xaf12('0x143')};}};AGIVertices[_0xaf12('0x14')][_0xaf12('0x144')]=function(_0x269289){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x145'),_0x269289[_0xaf12('0x36')]));if(!this['isConfigured'](_0x269289['interval_id'])){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x269289,'no\x20interval\x20configured');}var _0x463062=this['getIntervals'][_0xaf12('0x72')](this,_0x269289[_0xaf12('0x146')]);if(!_0x463062){return this[_0xaf12('0xe')]['error'](_0x269289,'no\x20intervals\x20found');}for(var _0x6600c1=0x0;_0x6600c1<_0x463062['length'];_0x6600c1+=0x1){var _0x38202d=this['channel']['getVariable'](util[_0xaf12('0x52')]('IFTIME(%s?true:false)',_0x463062[_0x6600c1]));if(_0x38202d[_0xaf12('0xa3')]===-0x1){return _0x38202d;}logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x147'),_0x463062[_0x6600c1],_0x38202d['extra']));if(_0x38202d[_0xaf12('0xa1')]===_0xaf12('0x142')){logger[_0xaf12('0x2b')](util['format'](_0xaf12('0x147'),_0x463062[_0x6600c1],_0xaf12('0x142')));this[_0xaf12('0xe')][_0xaf12('0xa9')](util['format']('IFTIME\x20%s\x20%s',_0x463062[_0x6600c1],'true'));return{'code':0xc8,'result':_0xaf12('0x142')};}else{logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('IFTIME\x20%s\x20%s',_0x463062[_0x6600c1],_0xaf12('0x143')));this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0x147'),_0x463062[_0x6600c1],_0xaf12('0x143')));}}return{'code':0xc8,'result':_0xaf12('0x143')};};AGIVertices['prototype']['hangup']=function(_0x43c182){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x43c182[_0xaf12('0x36')]));return this['channel']['hangup']();};AGIVertices[_0xaf12('0x14')][_0xaf12('0x148')]=function(_0x520ff9){logger['info'](util['format'](_0xaf12('0x149'),_0x520ff9[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x520ff9[_0xaf12('0x7c')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')]('no\x20key\x20configured');}var _0x4316b8=_0xaf12('0x131');var _0xa9f8d5=util['format'](_0xaf12('0x132'),FILES_PATH,rs['generate'](0x4));var _0x11fe17=util[_0xaf12('0x52')]('%s.%s',_0xa9f8d5,_0x4316b8);var _0x488731=!![];if(_0x520ff9[_0xaf12('0x133')]==='NOBEEP'){_0x488731=![];}var _0x3e9f1d=this[_0xaf12('0xe')]['recordFile'](_0xa9f8d5,_0x4316b8,_0x520ff9[_0xaf12('0x135')],_0x520ff9[_0xaf12('0x64')],undefined,_0x488731);if(_0x3e9f1d[_0xaf12('0xa3')]!==-0x1){this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0x14a'),_0x11fe17));var _0x401b13=this[_0xaf12('0x84')][_0xaf12('0x72')](this,_0x520ff9,_0x11fe17);if(_0x401b13){for(var _0x499b5b in _0x401b13){if(_0x401b13[_0xaf12('0x94')](_0x499b5b)){this[_0xaf12('0xe')][_0xaf12('0x9e')](util['format'](_0xaf12('0x14b'),_0x499b5b['toUpperCase']()),_0x401b13[_0x499b5b]);}}return this['channel']['noop'](util['format'](_0xaf12('0x14c'),JSON['stringify'](_0x401b13)));}}return _0x3e9f1d;};AGIVertices[_0xaf12('0x14')][_0xaf12('0x14d')]=function(_0x5c35c9){logger['info'](util[_0xaf12('0x52')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x5c35c9[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x5c35c9['key'])){return this['channel'][_0xaf12('0xa9')](_0xaf12('0xe3'));}if(!this[_0xaf12('0x86')](_0x5c35c9[_0xaf12('0x5c')])){return this[_0xaf12('0xe')]['noop']('no\x20text\x20configured');}this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0x14e'),_0x5c35c9[_0xaf12('0x5c')]));var _0x50b8d2=this[_0xaf12('0x82')][_0xaf12('0x72')](this,_0x5c35c9);if(_0x50b8d2){this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')]('ispeech\x20%s\x20file\x20created',_0x50b8d2));var _0x478038=this[_0xaf12('0xe')][_0xaf12('0x103')](_0x50b8d2,_0x5c35c9[_0xaf12('0x135')]);try{fs[_0xaf12('0x104')](_0x50b8d2+_0xaf12('0x105'));}catch(_0x573d73){logger[_0xaf12('0x30')](_0x573d73);}return _0x478038;}return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x5c35c9,_0xaf12('0x14f'));};AGIVertices[_0xaf12('0x14')][_0xaf12('0x150')]=function(_0x157839){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x151'),_0x157839[_0xaf12('0x36')]));if(!this['isConfigured'](_0x157839[_0xaf12('0x152')])){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x157839,_0xaf12('0x153'));}logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x154'),this[_0xaf12('0xe')]['callerid'],_0x157839[_0xaf12('0x152')]));var _0x3df0d7=this[_0xaf12('0x54')][_0xaf12('0x72')](this,_0x157839[_0xaf12('0x152')]);if(_0x3df0d7){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xaf12('0xe')][_0xaf12('0x38')],_0x157839[_0xaf12('0x152')]));this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0x155'),this['channel'][_0xaf12('0x38')],_0x157839[_0xaf12('0x152')]));return{'code':0xc8,'result':_0xaf12('0x156')};}else{logger['info'](util[_0xaf12('0x52')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xaf12('0x38')],_0x157839['findBy']));this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xaf12('0xe')][_0xaf12('0x38')],_0x157839[_0xaf12('0x152')]));return{'code':0xc8,'result':_0xaf12('0x157')};}};AGIVertices['prototype']['logout']=function(_0x1467a6){logger['info'](util[_0xaf12('0x52')](_0xaf12('0x158'),_0x1467a6['label']));if(!this['isConfigured'](_0x1467a6[_0xaf12('0x152')])){return this['channel'][_0xaf12('0x30')](_0x1467a6,_0xaf12('0x153'));}logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x154'),this['channel'][_0xaf12('0x38')],_0x1467a6[_0xaf12('0x152')]));var _0x1c93d9=this[_0xaf12('0x50')][_0xaf12('0x72')](this,_0x1467a6[_0xaf12('0x152')]);if(_0x1c93d9){logger[_0xaf12('0x2b')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xaf12('0xe')]['callerid'],_0x1467a6[_0xaf12('0x152')]));this[_0xaf12('0xe')][_0xaf12('0xa9')](util['format'](_0xaf12('0x155'),this[_0xaf12('0xe')]['callerid'],_0x1467a6[_0xaf12('0x152')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0xaf12('0x159'),this[_0xaf12('0xe')][_0xaf12('0x38')],_0x1467a6[_0xaf12('0x152')]));this['channel'][_0xaf12('0xa9')](util[_0xaf12('0x52')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xaf12('0x38')],_0x1467a6[_0xaf12('0x152')]));return{'code':0xc8,'result':_0xaf12('0x157')};}};AGIVertices['prototype']['math']=function(_0x1049d2){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1049d2['label']));if(!this[_0xaf12('0x86')](_0x1049d2[_0xaf12('0x15a')])){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x1049d2,'no\x20operation\x20configured');}this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0x15b'),_0x1049d2[_0xaf12('0x15a')]));var _0x42b42d=eval(_0x1049d2[_0xaf12('0x15a')]);if(!this[_0xaf12('0x86')](_0x1049d2['variable_id'])){return this[_0xaf12('0xe')]['noop'](_0xaf12('0xd2'));}var _0x8afc55=this[_0xaf12('0x10')][_0xaf12('0x72')](this,_0x1049d2[_0xaf12('0xd1')]);if(!_0x8afc55){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x1049d2,'no\x20variable\x20found');}if(_[_0xaf12('0x9d')](_0x42b42d)){var _0x490360=this;_0x42b42d[_0xaf12('0xd4')](function(_0x30b013,_0x1849a0){_0x490360['channel'][_0xaf12('0x9e')](util[_0xaf12('0x52')](_0xaf12('0x15c'),_0x8afc55,_0x1849a0),_0x30b013);});return this[_0xaf12('0xe')][_0xaf12('0xa9')](util['format'](_0xaf12('0x15d'),_0x8afc55));}else{return this['channel']['setVariable'](_0x8afc55,_0x42b42d);}};AGIVertices[_0xaf12('0x14')][_0xaf12('0xb')]=function(_0xa0146f){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x15e'),_0xa0146f[_0xaf12('0x36')]));if(_0xa0146f[_0xaf12('0xa6')]===0x0){return this[_0xaf12('0xa5')](_0xa0146f);}_0xa0146f[_0xaf12('0xa6')]-=0x1;if(!this[_0xaf12('0x86')](_0xa0146f[_0xaf12('0x112')])){return this['channel']['error'](_0xa0146f,_0xaf12('0x113'));}var _0x1857c8=this['getSound'][_0xaf12('0x72')](this,_0xa0146f['file_id']);if(!_0x1857c8){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0xa0146f,_0xaf12('0x114'));}var _0x32b4f1=this['channel']['getData'](_0x1857c8,_0xa0146f[_0xaf12('0x116')],_0xa0146f['digit']);var _0x4c2aa2=_0x32b4f1[_0xaf12('0xa3')];if(_0x32b4f1[_0xaf12('0xa3')]===-0x1){this[_0xaf12('0x34')][_0xaf12('0x72')](this,_0xa0146f,'-1');return _0x32b4f1;}else if(_0x32b4f1[_0xaf12('0xa1')]===_0xaf12('0x64')){_0x32b4f1[_0xaf12('0xa3')]=_0x32b4f1[_0xaf12('0xa3')]['length']>0x0?_0x32b4f1[_0xaf12('0xa3')]:'t';}else if(_[_0xaf12('0x41')](_0x32b4f1['result'])){_0x32b4f1[_0xaf12('0xa3')]='#';_0x4c2aa2='#';}if(!this[_0xaf12('0x86')](_0xa0146f[_0xaf12('0xd1')])){this[_0xaf12('0xe')]['noop'](_0xaf12('0xd2'));}else{var _0x10c13c=this[_0xaf12('0x10')][_0xaf12('0x72')](this,_0xa0146f[_0xaf12('0xd1')]);if(!_0x10c13c){return this['channel'][_0xaf12('0x30')](_0xa0146f,_0xaf12('0xd3'));}this[_0xaf12('0xe')][_0xaf12('0x9e')](_0x10c13c,_0x4c2aa2);}this[_0xaf12('0x34')][_0xaf12('0x72')](this,_0xa0146f,_0x4c2aa2);return _0x32b4f1;};AGIVertices[_0xaf12('0x14')][_0xaf12('0xa9')]=function(_0x4f98d9){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x4f98d9[_0xaf12('0x36')]));return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0x4f98d9[_0xaf12('0x15f')]||_0x4f98d9[_0xaf12('0x36')]);};AGIVertices[_0xaf12('0x14')][_0xaf12('0x160')]=function(_0x5e202e){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x5e202e[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x5e202e[_0xaf12('0x152')])){return this['channel'][_0xaf12('0x30')](_0x5e202e,_0xaf12('0x153'));}logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xaf12('0xe')][_0xaf12('0x38')],_0x5e202e[_0xaf12('0x152')]));var _0x4bce59=this[_0xaf12('0x4b')]['sync'](this,_0x5e202e[_0xaf12('0x161')]);var _0x53ffec=this[_0xaf12('0x4d')][_0xaf12('0x72')](this,_0x5e202e[_0xaf12('0x152')],_0x4bce59);if(_0x53ffec){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x155'),this[_0xaf12('0xe')]['callerid'],_0x5e202e[_0xaf12('0x152')]));this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x5e202e[_0xaf12('0x152')]));return{'code':0xc8,'result':_0xaf12('0x156')};}else{logger[_0xaf12('0x2b')](util['format'](_0xaf12('0x159'),this[_0xaf12('0xe')][_0xaf12('0x38')],_0x5e202e[_0xaf12('0x152')]));this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0x155'),this['channel']['callerid'],_0x5e202e[_0xaf12('0x152')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xaf12('0x14')][_0xaf12('0x162')]=function(_0x7ca841){logger['info'](util[_0xaf12('0x52')](_0xaf12('0x163'),_0x7ca841['label']));if(!this[_0xaf12('0x86')](_0x7ca841[_0xaf12('0x112')])){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x7ca841,'no\x20file\x20audio\x20selected');}var _0x4daa2b=this[_0xaf12('0x1f')][_0xaf12('0x72')](this,_0x7ca841[_0xaf12('0x112')]);if(!_0x4daa2b){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x7ca841,_0xaf12('0x114'));}var _0x3f8c72=this[_0xaf12('0xe')][_0xaf12('0x56')](_0xaf12('0x164'),[_0x4daa2b,_0x7ca841[_0xaf12('0xe0')]]);if(_0x3f8c72[_0xaf12('0xa3')]===-0x1){return _0x3f8c72;}return this[_0xaf12('0xe')]['noop'](util[_0xaf12('0x52')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x4daa2b));};AGIVertices[_0xaf12('0x14')][_0xaf12('0x165')]=function(_0xe5e91b){logger['info'](util[_0xaf12('0x52')](_0xaf12('0x166'),_0xe5e91b[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0xe5e91b[_0xaf12('0x167')])){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0xe5e91b,'no\x20queue\x20selected');}var _0x22406e='';var _0x200152=parseInt(_0xe5e91b[_0xaf12('0x167')],0xa);if(isNaN(_0x200152)){_0x22406e=_0xe5e91b[_0xaf12('0x167')];}else{_0x22406e=this[_0xaf12('0x15')][_0xaf12('0x72')](this,_0xe5e91b[_0xaf12('0x167')]);if(!_0x22406e){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0xe5e91b,_0xaf12('0x168'));}}var _0x1b1058='';if(this['isConfigured'](_0xe5e91b[_0xaf12('0x112')])){var _0x5efa34=this[_0xaf12('0x1f')][_0xaf12('0x72')](this,_0xe5e91b[_0xaf12('0x112')]);if(_0x5efa34){_0x1b1058=_0x5efa34;}}this[_0xaf12('0x34')][_0xaf12('0x72')](this,_0xe5e91b,_0x22406e);if(_0xe5e91b[_0xaf12('0xe0')][_0xaf12('0x169')]('x')<0x0){_0xe5e91b[_0xaf12('0xe0')]+='x';}if(_0xe5e91b[_0xaf12('0xe0')][_0xaf12('0x169')]('X')<0x0){_0xe5e91b[_0xaf12('0xe0')]+='X';}this[_0xaf12('0xe')][_0xaf12('0x9e')](_0xaf12('0x16a'),_0x22406e?_0x22406e[_0xaf12('0x16b')]():'');var _0x3fe890=this[_0xaf12('0xe')]['exec'](_0xaf12('0x16c'),[_0x22406e,_0xe5e91b[_0xaf12('0xe0')],_0xe5e91b[_0xaf12('0x63')],_0x1b1058,_0xe5e91b['timeout'],_0xe5e91b['agi'],_0xe5e91b[_0xaf12('0x16d')],_0xe5e91b[_0xaf12('0x16e')],'',_0xe5e91b[_0xaf12('0x16f')]]);if(_0x3fe890[_0xaf12('0xa3')]===-0x1){return _0x3fe890;}return this['channel'][_0xaf12('0xa9')](util[_0xaf12('0x52')]('Executed\x20command\x20%s\x20%s',_0xaf12('0x16c'),_0x22406e));};AGIVertices[_0xaf12('0x14')][_0xaf12('0x170')]=function(_0x597ba3){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x171'),_0x597ba3[_0xaf12('0x36')]));var _0x470909=_0x597ba3['recordingFormat']||_0xaf12('0x131');var _0x2a8d30=util['format'](_0xaf12('0x172'),this[_0xaf12('0xe')][_0xaf12('0x35')],rs[_0xaf12('0x11a')](0x5));var _0x2be2ae=util[_0xaf12('0x52')](_0xaf12('0x173'),FILES_PATH,_0x2a8d30,_0x470909);var _0x5b3d75=util['format'](_0xaf12('0x132'),FILES_PATH,_0x2a8d30);this['createSquareRecording']['sync'](this,_0x597ba3,_0x2a8d30,_0x2be2ae);this[_0xaf12('0xe')][_0xaf12('0x9e')]('RECORDING_SAVENAME',_0x2a8d30);logger[_0xaf12('0x2b')](_0xaf12('0x174'),_0x5b3d75,_0x470909,_0x597ba3[_0xaf12('0x175')],_0x597ba3[_0xaf12('0x64')]);return this[_0xaf12('0xe')][_0xaf12('0x13b')](_0x5b3d75,_0x470909,_0x597ba3[_0xaf12('0x175')],_0x597ba3[_0xaf12('0x64')],undefined,!![]);};AGIVertices[_0xaf12('0x14')]['restapi']=function(_0xef5f8c){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x176'),_0xef5f8c[_0xaf12('0x36')]));if(!this['isConfigured'](_0xef5f8c['url'])){return this[_0xaf12('0xe')][_0xaf12('0xa9')]('no\x20url\x20configured');}var _0x258760=this[_0xaf12('0x62')]['sync'](this,_0xef5f8c);logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x177'),util['inspect'](_0x258760,{'showHidden':![],'depth':null})));if(!this[_0xaf12('0x86')](_0xef5f8c[_0xaf12('0xd1')])){return this['channel']['noop'](_0xaf12('0x178'));}var _0x55b476=this[_0xaf12('0x10')]['sync'](this,_0xef5f8c[_0xaf12('0xd1')]);if(!_0x55b476){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0xef5f8c,_0xaf12('0xd3'));}this[_0xaf12('0xe')][_0xaf12('0x9e')](util['format'](_0xaf12('0x179'),_0x55b476),_0x258760[_0xaf12('0x76')]?_0x258760[_0xaf12('0x76')]:_0xaf12('0x17a'));this[_0xaf12('0xe')][_0xaf12('0x9e')](util[_0xaf12('0x52')](_0xaf12('0x17b'),_0x55b476),_0x258760[_0xaf12('0x77')]?_0x258760[_0xaf12('0x77')]:'OK');if(_0x258760[_0xaf12('0x6b')]){try{this[_0xaf12('0x9b')](_0x258760[_0xaf12('0x6b')],_0x55b476);}catch(_0x4c9eb7){logger['error'](util[_0xaf12('0x52')](_0xaf12('0x17c'),_0x55b476));}}return this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0xd7'),_0x55b476));};AGIVertices[_0xaf12('0x14')]['saydigits']=function(_0x5b6778){logger['info'](util['format']('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x5b6778['label']));return this[_0xaf12('0xe')]['sayDigits'](_0x5b6778['digits'][_0xaf12('0x58')](/\s+/g,''),_0x5b6778['escape_digits']);};AGIVertices[_0xaf12('0x14')]['saynumber']=function(_0x1a2b4d){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x1a2b4d[_0xaf12('0x36')]));return this[_0xaf12('0xe')][_0xaf12('0x17d')](_0x1a2b4d[_0xaf12('0x65')][_0xaf12('0x58')](/\s+/g,''),_0x1a2b4d[_0xaf12('0x175')]);};AGIVertices[_0xaf12('0x14')][_0xaf12('0x17e')]=function(_0x31e1e0){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x17f'),_0x31e1e0[_0xaf12('0x36')]));return this['channel'][_0xaf12('0x180')](_0x31e1e0[_0xaf12('0x5c')],_0x31e1e0['escape_digits']);};AGIVertices[_0xaf12('0x14')]['sendMail']=function(_0x24326e){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x24326e[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x24326e[_0xaf12('0x181')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0x182'));}var _0x4068a6=this[_0xaf12('0x183')][_0xaf12('0x72')](this,_0x24326e[_0xaf12('0x181')]);if(!_0x4068a6||!_0x4068a6[_0xaf12('0x184')]){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x24326e,_0xaf12('0x185'));}var _0x360ff1={'from':util['format'](_0xaf12('0x186'),_0x4068a6['name'],_0x4068a6[_0xaf12('0x187')]||_0x4068a6['Smtp'][_0xaf12('0x188')]),'to':_0x24326e['to']||'','cc':_0x24326e['cc']||'','bcc':_0x24326e[_0xaf12('0x189')]||'','subject':_0x24326e[_0xaf12('0x18a')],'html':_0x24326e[_0xaf12('0x5c')],'text':_0x24326e[_0xaf12('0x5c')]};if(this[_0xaf12('0x86')](_0x24326e['template_id'])){}logger[_0xaf12('0xd9')](_0xaf12('0x18b'),JSON[_0xaf12('0x75')](_0x360ff1));this[_0xaf12('0x34')][_0xaf12('0x72')](this,_0x24326e,_0x24326e[_0xaf12('0x181')]);this[_0xaf12('0xe')]['noop'](util[_0xaf12('0x52')](_0xaf12('0x18c'),_0x4068a6[_0xaf12('0x12')]));this['sendMailMessage'][_0xaf12('0x72')](this,_0x4068a6[_0xaf12('0x18d')],_0x360ff1);return this[_0xaf12('0xe')][_0xaf12('0xa9')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype']['sendFax']=function(_0x180bcb){logger[_0xaf12('0x2b')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x180bcb[_0xaf12('0x36')]));return this['channel']['noop'](_0xaf12('0x18e'));};AGIVertices['prototype']['sendSMS']=function(_0x35775c){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x18f'),_0x35775c[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x35775c[_0xaf12('0x190')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')]('no\x20sms\x20account\x20configured');}var _0x1b004b=this['getSmsAccount'][_0xaf12('0x72')](this,_0x35775c[_0xaf12('0x190')]);if(!_0x1b004b){return this['channel']['error'](_0x35775c,_0xaf12('0x191'));}var _0x52a039={'body':_0x35775c[_0xaf12('0x192')],'phone':_0x35775c['to']||'','SmsAccountId':_0x1b004b['id']};logger[_0xaf12('0xd9')](_0xaf12('0x193'),JSON[_0xaf12('0x75')](_0x52a039));this[_0xaf12('0x34')][_0xaf12('0x72')](this,_0x35775c,_0x35775c[_0xaf12('0x190')]);this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0x194'),_0x1b004b[_0xaf12('0x12')]));this[_0xaf12('0x33')]['sync'](this,_0x52a039);return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0x195'));};AGIVertices[_0xaf12('0x14')][_0xaf12('0x196')]=function(_0x5a5454){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x5a5454[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x5a5454['variable_id'])){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x5a5454,_0xaf12('0x197'));}var _0x154068=this[_0xaf12('0x10')][_0xaf12('0x72')](this,_0x5a5454[_0xaf12('0xd1')]);if(!_0x154068){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x5a5454,_0xaf12('0xd3'));}return this['channel'][_0xaf12('0x9e')](_0x154068,_0x5a5454[_0xaf12('0x198')]);};AGIVertices[_0xaf12('0x14')][_0xaf12('0x199')]=function(_0xfca54c){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x19a'),_0xfca54c[_0xaf12('0x36')]));this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0x19b'));if(_0xfca54c[_0xaf12('0xb4')]==='yes'){this[_0xaf12('0xe')]['noop']('Answer');return this['channel'][_0xaf12('0xb4')]();}return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0x19c'));};AGIVertices[_0xaf12('0x14')]['subproject']=function(_0x677e8d){logger['info'](util['format'](_0xaf12('0x19d'),_0x677e8d[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0x677e8d['project_id'])){return this[_0xaf12('0xe')]['error'](_0x677e8d,_0xaf12('0x19e'));}var _0xcba90a=this[_0xaf12('0x19f')]['sync'](this,_0x677e8d[_0xaf12('0x1a0')]);if(!this[_0xaf12('0x86')](_0xcba90a)){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x677e8d,util['format'](_0xaf12('0x1a1'),_0x677e8d[_0xaf12('0x1a0')]));}if(_0xcba90a===this[_0xaf12('0xe')][_0xaf12('0x3d')]){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x677e8d,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xaf12('0x34')][_0xaf12('0x72')](this,_0x677e8d,_0xcba90a);var _0x4a43d5=this[_0xaf12('0xe')][_0xaf12('0x56')](_0xaf12('0x1a2'),util[_0xaf12('0x52')](_0xaf12('0x1a3'),config['agi'][_0xaf12('0x1a4')]||'127.0.0.1',_0xcba90a,this[_0xaf12('0xe')]['arg_1']));if(_0x4a43d5[_0xaf12('0xa3')]===-0x1){return _0x4a43d5;}return this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')]('Executed\x20command\x20%s\x20%s','AGI',_0xcba90a));};AGIVertices[_0xaf12('0x14')]['system']=function(_0x462e87){logger['info'](util[_0xaf12('0x52')](_0xaf12('0x1a5'),_0x462e87['label']));var _0x49fa32=this[_0xaf12('0x55')][_0xaf12('0x72')](this,_0x462e87[_0xaf12('0x1a6')]);this[_0xaf12('0x34')][_0xaf12('0x72')](this,_0x462e87,_0x462e87['command']);if(this[_0xaf12('0x86')](_0x462e87[_0xaf12('0xd1')])){var _0x219ede=this[_0xaf12('0x10')][_0xaf12('0x72')](this,_0x462e87['variable_id']);if(_0x219ede){this['channel'][_0xaf12('0x9e')](_0x219ede,_0x49fa32);return this['channel']['noop'](util[_0xaf12('0x52')](_0xaf12('0x1a7'),_0x462e87[_0xaf12('0x1a6')],_0x219ede));}}return this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x462e87['command']));};AGIVertices[_0xaf12('0x14')]['google_cloud_tts']=function(_0x1d007a){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x1a8'),_0x1d007a[_0xaf12('0x36')]));_0x1d007a['text']=_0x1d007a['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1d007a[_0xaf12('0x5a')])){return this[_0xaf12('0xe')]['noop'](_0xaf12('0x1a9'));}if(!this[_0xaf12('0x86')](_0x1d007a[_0xaf12('0x5c')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0xaa'));}this[_0xaf12('0xe')]['noop'](util['format'](_0xaf12('0x1aa'),_0x1d007a['text']));var _0x44af3c=this[_0xaf12('0x59')][_0xaf12('0x72')](this,_0x1d007a);if(_0x44af3c){this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0x1ab'),_0x44af3c));var _0x1d7fd3=this[_0xaf12('0xe')]['streamFile'](_0x44af3c);try{fs[_0xaf12('0x104')](_0x44af3c+_0xaf12('0x105'));}catch(_0x3c70c4){logger[_0xaf12('0x30')](_0x3c70c4);}return _0x1d7fd3;}return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x1d007a,_0xaf12('0x1ac'));};AGIVertices[_0xaf12('0x14')][_0xaf12('0x1ad')]=function(_0x411e2d){logger[_0xaf12('0x2b')](util['format'](_0xaf12('0x1ae'),_0x411e2d[_0xaf12('0x36')]));_0x411e2d[_0xaf12('0x5c')]=_0x411e2d['text'][_0xaf12('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x411e2d[_0xaf12('0x5c')])){return this[_0xaf12('0xe')][_0xaf12('0xa9')](_0xaf12('0xaa'));}this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')]('Trying\x20Google\x20TTS\x20%s',_0x411e2d[_0xaf12('0x5c')]));var _0x2bcde8=this[_0xaf12('0x60')][_0xaf12('0x72')](this,_0x411e2d);if(_0x2bcde8){this['channel'][_0xaf12('0xa9')](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x2bcde8));var _0x59d8ff=this[_0xaf12('0xe')][_0xaf12('0x103')](_0x2bcde8);try{fs[_0xaf12('0x104')](_0x2bcde8+_0xaf12('0x105'));}catch(_0x16a5b1){logger[_0xaf12('0x30')](_0x16a5b1);}return _0x59d8ff;}return this[_0xaf12('0xe')]['error'](_0x411e2d,_0xaf12('0x1af'));};AGIVertices[_0xaf12('0x14')][_0xaf12('0x1b0')]=function(_0x548309){logger['info'](util[_0xaf12('0x52')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x548309['label']));if(!this[_0xaf12('0x86')](_0x548309[_0xaf12('0x152')])){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0x548309,_0xaf12('0x153'));}logger['info'](util[_0xaf12('0x52')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xaf12('0xe')][_0xaf12('0x38')],_0x548309[_0xaf12('0x152')]));var _0x515280=this[_0xaf12('0x4f')][_0xaf12('0x72')](this,_0x548309['findBy']);if(_0x515280){logger['info'](util['format'](_0xaf12('0x155'),this['channel'][_0xaf12('0x38')],_0x548309[_0xaf12('0x152')]));this[_0xaf12('0xe')]['noop'](util[_0xaf12('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xaf12('0x38')],_0x548309['findBy']));return{'code':0xc8,'result':_0xaf12('0x156')};}else{logger[_0xaf12('0x2b')](util['format'](_0xaf12('0x159'),this[_0xaf12('0xe')][_0xaf12('0x38')],_0x548309['findBy']));this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0x159'),this[_0xaf12('0xe')][_0xaf12('0x38')],_0x548309[_0xaf12('0x152')]));return{'code':0xc8,'result':_0xaf12('0x157')};}};AGIVertices['prototype'][_0xaf12('0x1b1')]=function(_0x313da3){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x1b2'),_0x313da3[_0xaf12('0x36')]));var _0x105d6b=this[_0xaf12('0xe')][_0xaf12('0x56')]('VOICEMAIL',[_0x313da3[_0xaf12('0x1b3')],_0x313da3[_0xaf12('0x7a')]]);if(_0x105d6b['result']===-0x1){return _0x105d6b;}return this[_0xaf12('0xe')][_0xaf12('0xa9')](util[_0xaf12('0x52')](_0xaf12('0xbe'),'VOICEMAIL',_0x313da3[_0xaf12('0x1b3')]));};AGIVertices[_0xaf12('0x14')][_0xaf12('0x1b4')]=function(_0xa86051){logger[_0xaf12('0x2b')](util[_0xaf12('0x52')](_0xaf12('0x1b5'),_0xa86051[_0xaf12('0x36')]));if(!this[_0xaf12('0x86')](_0xa86051[_0xaf12('0xd1')])){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0xa86051,'no\x20variable\x20selected');}var _0x1c607a=this[_0xaf12('0x10')][_0xaf12('0x72')](this,_0xa86051[_0xaf12('0xd1')]);if(!_0x1c607a){return this[_0xaf12('0xe')][_0xaf12('0x30')](_0xa86051,_0xaf12('0xd3'));}var _0x2b4d37=this[_0xaf12('0xe')][_0xaf12('0x10')](_0x1c607a);return{'code':0xc8,'result':_0x2b4d37[_0xaf12('0xa1')]?_0x2b4d37[_0xaf12('0xa1')]:'-'};};String[_0xaf12('0x14')][_0xaf12('0xa0')]=function(_0x25af47,_0xbb4836){return this[_0xaf12('0x9f')](_0x25af47)[_0xaf12('0x1b6')](_0xbb4836);};module[_0xaf12('0x1b7')]=AGIVertices; \ No newline at end of file +var _0x7334=['toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','googleCloudTTS','apiKey','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','google_tts_language','restAPI','number','timeout','includes','PUT','body','parse','headers','computedVariables','sync','url','render','stringify','statusCode','statusMessage','message','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','clone','hasOwnProperty','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','replaceAllVariables','isEmpty','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','retry','label','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','exec','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','odbc_id','no\x20database\x20selected','no\x20query\x20configured','replace','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','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','ndauth_url','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','file_id','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','isString','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','intKey','google\x20%s\x20file\x20created','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','NOBEEP','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','findBy','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','no\x20find\x20by\x20configured','getPause','pause_id','playback','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','escape_digits','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Answer','Skipped\x20Answer','subproject','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','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','googleTTS','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','util','lodash','shelljs','moment','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunkById','getMailAccount','getMailAccountById','mailRpc','sendMailMessage','getIntervals','IntervalId','interval','map','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20'];(function(_0x42acfc,_0x349f46){var _0x24b053=function(_0x49409e){while(--_0x49409e){_0x42acfc['push'](_0x42acfc['shift']());}};_0x24b053(++_0x349f46);}(_0x7334,0x184));var _0x4733=function(_0x2c04c6,_0x582725){_0x2c04c6=_0x2c04c6-0x0;var _0x5c4d9f=_0x7334[_0x2c04c6];return _0x5c4d9f;};'use strict';var fs=require('fs');var util=require(_0x4733('0x0'));var _=require(_0x4733('0x1'));var sh=require(_0x4733('0x2'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0x4733('0x3'));var Mustache=require('mustache');var rp=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var shared=require(_0x4733('0x8'));var scripts=require(_0x4733('0x9'));var FILES_PATH=_0x4733('0xa');var recursiveMapAttributes=[_0x4733('0xb'),_0x4733('0xc')];var verticesWithRetry=[_0x4733('0xd'),_0x4733('0xe'),_0x4733('0xf')];var AGIVertices=function(_0x4c5c0,_0x38b7f5,_0x2d5fde){this[_0x4733('0x10')]=_0x4c5c0;this[_0x4733('0x11')]=_0x38b7f5;this['mailRpc']=_0x2d5fde;};AGIVertices[_0x4733('0x12')][_0x4733('0x13')]=function(_0x534c7d,_0x41b526){this['rpc'][_0x4733('0x14')](_0x534c7d)[_0x4733('0x15')](function(_0x44cb92){_0x41b526(null,_0x44cb92?_0x44cb92[_0x4733('0x16')]:![]);})[_0x4733('0x17')](function(_0x1c146c){_0x41b526(_0x1c146c);});};AGIVertices[_0x4733('0x12')]['getVoiceQueue']=function(_0x57e554,_0x543caf){this[_0x4733('0x11')][_0x4733('0x18')](_0x57e554)[_0x4733('0x15')](function(_0x22283e){_0x543caf(null,_0x22283e?_0x22283e[_0x4733('0x16')]:![]);})[_0x4733('0x17')](function(_0x12f111){_0x543caf(_0x12f111);});};AGIVertices[_0x4733('0x12')][_0x4733('0x19')]=function(_0x4ab37a,_0x2c0031){this[_0x4733('0x11')]['getSquareProjectById'](_0x4ab37a)[_0x4733('0x15')](function(_0x1d2fb6){_0x2c0031(null,_0x1d2fb6?_0x1d2fb6[_0x4733('0x16')]:![]);})[_0x4733('0x17')](function(_0x579f67){_0x2c0031(_0x579f67);});};AGIVertices['prototype'][_0x4733('0x1a')]=function(_0x3b730a,_0x50c585){this[_0x4733('0x11')][_0x4733('0x1b')](_0x3b730a)[_0x4733('0x15')](function(_0x7a4e0){_0x50c585(null,_0x7a4e0?_0x7a4e0['dsn']:![]);})[_0x4733('0x17')](function(_0xb45e1){_0x50c585(_0xb45e1);});};AGIVertices['prototype'][_0x4733('0x1c')]=function(_0x18da47,_0x478e34){this[_0x4733('0x11')][_0x4733('0x1d')](_0x18da47)[_0x4733('0x15')](function(_0x1a0643){_0x478e34(null,_0x1a0643?_0x1a0643[_0x4733('0x16')]:![]);})[_0x4733('0x17')](function(_0x180049){_0x478e34(_0x180049);});};AGIVertices[_0x4733('0x12')]['getTrunk']=function(_0x3e6976,_0x2e8545){this[_0x4733('0x11')][_0x4733('0x1e')](_0x3e6976)[_0x4733('0x15')](function(_0x3bd683){_0x2e8545(null,_0x3bd683?_0x3bd683[_0x4733('0x16')]:![]);})[_0x4733('0x17')](function(_0x13bc12){_0x2e8545(_0x13bc12);});};AGIVertices[_0x4733('0x12')]['getSound']=function(_0x3aeb57,_0x4c91bc){var _0x5b6fc0=this;this[_0x4733('0x11')]['getSoundById'](_0x3aeb57)[_0x4733('0x15')](function(_0x479989){_0x4c91bc(null,_0x479989?_0x5b6fc0['getSoundPath'](_0x479989['save_name']):![]);})[_0x4733('0x17')](function(_0x3bfe53){_0x4c91bc(_0x3bfe53);});};AGIVertices[_0x4733('0x12')][_0x4733('0x1f')]=function(_0x4fee4a,_0x538a7c){this['rpc'][_0x4733('0x20')](_0x4fee4a)['then'](function(_0x5a4814){_0x538a7c(null,_0x5a4814?_0x5a4814:![]);})[_0x4733('0x17')](function(_0x39cf44){_0x538a7c(_0x39cf44);});};AGIVertices[_0x4733('0x12')]['sendMailMessage']=function(_0x523c61,_0x4412f7,_0x3a4307){this[_0x4733('0x21')][_0x4733('0x22')](_0x523c61,_0x4412f7)[_0x4733('0x15')](function(){_0x3a4307(null);})['catch'](function(_0x191ff8){_0x3a4307(_0x191ff8);});};AGIVertices[_0x4733('0x12')][_0x4733('0x23')]=function(_0x3f0ac8,_0x49f4a1){this['rpc']['getIntervalById'](_0x3f0ac8)[_0x4733('0x15')](function(_0x6637db){if(_0x6637db){if(_0x6637db[_0x4733('0x24')]){_0x49f4a1(null,[_0x6637db[_0x4733('0x25')]]);}else{_0x49f4a1(null,_[_0x4733('0x26')](_0x6637db['Intervals'],_0x4733('0x25')));}}else{_0x49f4a1(null,![]);}})[_0x4733('0x17')](function(_0x2c32d5){_0x49f4a1(_0x2c32d5);});};AGIVertices['prototype'][_0x4733('0x27')]=function(_0x10a5e9){return util[_0x4733('0x28')](_0x4733('0x29'),FILES_PATH,_0x10a5e9);};AGIVertices[_0x4733('0x12')][_0x4733('0x2a')]=function(_0xc5fff0,_0x1c7daf,_0x4f70bf){odbc[_0x4733('0x2b')](_0xc5fff0,function(_0x51f889){if(_0x51f889){logger[_0x4733('0x2c')](_0x4733('0x2d'),_0x51f889);_0x4f70bf(_0x51f889);}else{logger[_0x4733('0x2e')](_0x4733('0x2f'));odbc[_0x4733('0x30')](_0x1c7daf,function(_0x1a8b50,_0x393925){if(_0x1a8b50){logger[_0x4733('0x2e')]('Error\x20executing\x20query\x20%s',_0x1c7daf);_0x4f70bf(_0x1a8b50);}else{logger[_0x4733('0x2e')](_0x4733('0x31'),_0x1c7daf);odbc['close'](function(_0x37f35b){if(_0x37f35b){logger[_0x4733('0x2c')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x37f35b);}_0x4f70bf(null,_0x393925);});}});}});};AGIVertices[_0x4733('0x12')]['getSmsAccount']=function(_0x43ac2d,_0x4c3073){this[_0x4733('0x11')][_0x4733('0x32')](_0x43ac2d)['then'](function(_0x515720){_0x4c3073(null,_0x515720?_0x515720:![]);})[_0x4733('0x17')](function(_0x1d7112){_0x4c3073(_0x1d7112);});};AGIVertices['prototype'][_0x4733('0x33')]=function(_0x432359,_0xe53833){this[_0x4733('0x11')][_0x4733('0x33')](_0x432359)[_0x4733('0x15')](function(_0x23e355){_0xe53833(null,_0x23e355);})[_0x4733('0x17')](function(_0x1f04dd){_0xe53833(_0x1f04dd);});};AGIVertices[_0x4733('0x12')][_0x4733('0x34')]=function(_0x1d32df,_0x191c04,_0x7c6f63){this[_0x4733('0x11')][_0x4733('0x34')]({'uniqueid':this[_0x4733('0x10')][_0x4733('0x35')],'node':_0x1d32df['label'],'application':_0x1d32df[_0x4733('0x36')],'data':_0x191c04||null,'project_name':this[_0x4733('0x10')][_0x4733('0x37')],'callerid':this[_0x4733('0x10')][_0x4733('0x38')]})[_0x4733('0x15')](function(_0x70123d){if(_0x7c6f63){_0x7c6f63(null,_0x70123d);}})[_0x4733('0x17')](function(_0x34ec6c){if(_0x7c6f63){_0x7c6f63(_0x34ec6c);}});};AGIVertices[_0x4733('0x12')][_0x4733('0x39')]=function(_0x1a50f5,_0x7976e,_0x117ce9,_0x561377){this['rpc'][_0x4733('0x39')]({'uniqueid':this[_0x4733('0x10')][_0x4733('0x35')],'callerid':this[_0x4733('0x10')][_0x4733('0x38')],'calleridname':this[_0x4733('0x10')][_0x4733('0x3a')],'context':this[_0x4733('0x10')][_0x4733('0x3b')],'extension':this[_0x4733('0x10')]['extension'],'priority':this['channel']['priority'],'accountcode':this['channel'][_0x4733('0x3c')],'dnid':this[_0x4733('0x10')][_0x4733('0x3d')],'projectName':this[_0x4733('0x10')][_0x4733('0x37')],'saveName':_0x7976e,'filename':_0x1a50f5[_0x4733('0x3e')]||_0x7976e,'savePath':_0x117ce9})[_0x4733('0x15')](function(_0x2484f4){_0x561377(null,_0x2484f4);})[_0x4733('0x17')](function(_0x1f470f){_0x561377(_0x1f470f);});};AGIVertices['prototype']['createSquareMessage']=function(_0x29c93d,_0x5372d2,_0x2882ed,_0x17e686,_0x359df){this['rpc'][_0x4733('0x3f')]({'uniqueid':this[_0x4733('0x10')][_0x4733('0x35')],'body':_0x29c93d,'direction':_0x5372d2,'providerName':_0x2882ed,'providerResponse':_0x17e686})[_0x4733('0x15')](function(_0xdc2998){if(_0x359df){_0x359df(null,_0xdc2998);}})[_0x4733('0x17')](function(_0xaa38c2){if(_0x359df){_0x359df(_0xaa38c2);}});};AGIVertices[_0x4733('0x12')][_0x4733('0x40')]=function(_0x5af8c7,_0x31fb69){this[_0x4733('0x11')][_0x4733('0x40')]({'firstName':_['isEmpty'](_0x5af8c7[_0x4733('0x16')])||_[_0x4733('0x41')](_0x5af8c7[_0x4733('0x16')])?_0x4733('0x42')+Math['random']():_0x5af8c7[_0x4733('0x16')],'lastName':_['isEmpty'](_0x5af8c7[_0x4733('0x43')])||_[_0x4733('0x41')](_0x5af8c7[_0x4733('0x43')])?null:_0x5af8c7[_0x4733('0x43')],'phone':_0x5af8c7[_0x4733('0x44')],'ListId':_0x5af8c7['list_id'],'scheduledat':_0x5af8c7[_0x4733('0x45')],'callbackUniqueid':this[_0x4733('0x10')]['uniqueid'],'tags':'callback','description':_0x4733('0x46')+_0x5af8c7[_0x4733('0x45')][_0x4733('0x47')](),'priority':_0x5af8c7[_0x4733('0x48')]})[_0x4733('0x15')](function(_0x972fde){_0x31fb69(null,_0x972fde);})[_0x4733('0x17')](function(_0x45bc1b){_0x31fb69(_0x45bc1b);});};AGIVertices['prototype']['getPause']=function(_0x3b7f06,_0x5d45c5){this[_0x4733('0x11')][_0x4733('0x49')](_0x3b7f06)[_0x4733('0x15')](function(_0x57034a){_0x5d45c5(null,_0x57034a?_0x57034a['name']:![]);})['catch'](function(_0x1106df){_0x5d45c5(_0x1106df);});};AGIVertices[_0x4733('0x12')][_0x4733('0x4a')]=function(_0x5e451a,_0x12242a,_0x3d1157){var _0x15a32e={'role':_0x4733('0x4b')};_0x15a32e[_0x5e451a]=this[_0x4733('0x10')][_0x4733('0x38')];this[_0x4733('0x11')]['agentPause'](_0x15a32e,_0x12242a,this[_0x4733('0x10')][_0x4733('0x35')])['then'](function(_0x573541){_0x3d1157(null,_[_0x4733('0x41')](_0x573541)?![]:!![]);})[_0x4733('0x17')](function(_0x25cafc){logger[_0x4733('0x2c')](_0x25cafc);_0x3d1157(null,![]);});};AGIVertices[_0x4733('0x12')][_0x4733('0x4c')]=function(_0x31f1d1,_0x460969){var _0x3597bf={'role':'agent'};_0x3597bf[_0x31f1d1]=this[_0x4733('0x10')][_0x4733('0x38')];this[_0x4733('0x11')]['agentUnpause'](_0x3597bf)[_0x4733('0x15')](function(_0x55040c){_0x460969(null,_[_0x4733('0x41')](_0x55040c)?![]:!![]);})[_0x4733('0x17')](function(_0x276a46){logger[_0x4733('0x2c')](_0x276a46);_0x460969(null,![]);});};AGIVertices[_0x4733('0x12')][_0x4733('0x4d')]=function(_0x487c43,_0x137793){var _0x574787={'role':_0x4733('0x4b')};_0x574787[_0x487c43]=this[_0x4733('0x10')]['callerid'];this[_0x4733('0x11')]['agentLogout'](_0x574787)['then'](function(_0x39d393){_0x137793(null,_[_0x4733('0x41')](_0x39d393)?![]:!![]);})[_0x4733('0x17')](function(_0x3166c5){logger[_0x4733('0x2c')](_0x3166c5);_0x137793(null,![]);});};AGIVertices[_0x4733('0x12')][_0x4733('0x4e')]=function(_0x181b34,_0x30cd37){var _0x5eab76={'role':'agent'};_0x5eab76[_0x181b34]=this['channel'][_0x4733('0x38')];var _0x36266d=_0x181b34!=_0x4733('0x4f')?util[_0x4733('0x28')]('%s/%s@from-sip/n',_0x4733('0x50'),this[_0x4733('0x10')][_0x4733('0x38')]):undefined;this['rpc'][_0x4733('0x4e')](_0x5eab76,_0x36266d)['then'](function(_0x7436b7){_0x30cd37(null,_['isNil'](_0x7436b7)?![]:!![]);})['catch'](function(_0x171884){logger['error'](_0x171884);_0x30cd37(null,![]);});};AGIVertices[_0x4733('0x12')]['shellCommand']=function(_0x4e835b,_0x1a7baf){sh['exec'](_['trim'](_0x4e835b),function(_0x918cd9,_0x27f3f5){var _0x959768=_0x27f3f5['replace'](/(\r\n|\n|\r)/gm,'');_0x1a7baf(null,_0x959768);});};AGIVertices[_0x4733('0x12')][_0x4733('0x51')]=function(_0x13cd12,_0x7003cc){scripts[_0x4733('0x51')](_0x13cd12[_0x4733('0x52')],_0x13cd12['google_cloud_tts_text_type']||_0x4733('0x53'),_0x13cd12[_0x4733('0x53')],_0x13cd12[_0x4733('0x54')]||'en-US',_0x13cd12[_0x4733('0x55')]||_0x4733('0x56'),_0x13cd12[_0x4733('0x57')]||_0x4733('0x58'))[_0x4733('0x15')](function(_0x42d342){_0x7003cc(null,_0x42d342);})[_0x4733('0x17')](function(_0x2fd8e7){_0x7003cc(_0x2fd8e7);});};AGIVertices['prototype']['googleTTS']=function(_0x1af81e,_0x4fac10){scripts['googleTTS'](_0x1af81e[_0x4733('0x53')],_0x1af81e[_0x4733('0x59')]||'en',0x1)[_0x4733('0x15')](function(_0x3cf503){_0x4fac10(null,_0x3cf503);})['catch'](function(_0x28c5c8){_0x4fac10(_0x28c5c8);});};AGIVertices['prototype'][_0x4733('0x5a')]=function(_0x5f1290,_0x542397){var _0x129cc2={'uri':_0x5f1290['url'],'method':_0x5f1290['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5f1290['timeout'])===_0x4733('0x5b')&&parseInt(_0x5f1290['timeout'])>=0x1?parseInt(_0x5f1290[_0x4733('0x5c')])*0x3e8:0x5*0x3e8};if(_[_0x4733('0x5d')](['POST',_0x4733('0x5e')],_0x129cc2['method']['toUpperCase']())){try{_0x129cc2[_0x4733('0x5f')]=_0x5f1290[_0x4733('0xc')]?JSON[_0x4733('0x60')](_0x5f1290['rawBody']):{};}catch(_0x4bde5b){logger[_0x4733('0x2c')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4bde5b);}}try{_0x129cc2[_0x4733('0x61')]=_0x5f1290[_0x4733('0xb')]?JSON[_0x4733('0x60')](_0x5f1290[_0x4733('0xb')]):{};}catch(_0x302f02){logger[_0x4733('0x2c')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x302f02);}if(_0x5f1290[_0x4733('0x62')]){try{var _0x42facb=require(_0x5f1290[_0x4733('0x62')])[_0x4733('0x63')](this,_0x129cc2);_0x129cc2['uri']=Mustache['render'](_0x5f1290[_0x4733('0x64')],_0x42facb,{},['$$','$$']);if(_0x129cc2['headers']){_0x129cc2[_0x4733('0x61')]=JSON[_0x4733('0x60')](Mustache[_0x4733('0x65')](JSON[_0x4733('0x66')](_0x129cc2[_0x4733('0x61')]),_0x42facb,{},['$$','$$']));}if(_0x129cc2[_0x4733('0x5f')]){_0x129cc2[_0x4733('0x5f')]=JSON['parse'](Mustache[_0x4733('0x65')](JSON[_0x4733('0x66')](_0x129cc2['body']),_0x42facb,{},['$$','$$']));}}catch(_0x59d559){logger[_0x4733('0x2c')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x59d559);}}rp(_0x129cc2)[_0x4733('0x15')](function(_0x592a5b){var _0x4b1ea4={'statusCode':_0x592a5b[_0x4733('0x67')]||0xc8,'statusMessage':_0x592a5b[_0x4733('0x68')]||'OK','headers':_0x592a5b[_0x4733('0x61')]||{},'body':_0x592a5b[_0x4733('0x5f')]||{}};_0x542397(null,_0x4b1ea4);})[_0x4733('0x17')](function(_0x56729d){var _0x3a68d7={'statusCode':_0x56729d[_0x4733('0x67')]||0x1f4,'statusMessage':_0x56729d[_0x4733('0x69')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x56729d['options']['headers']||{},'body':_0x56729d[_0x4733('0x6a')][_0x4733('0x5f')]||{}};_0x542397(null,_0x3a68d7);});};AGIVertices[_0x4733('0x12')][_0x4733('0x6b')]=function(_0x34f61a,_0xce07b9){scripts['googleDialogflow'](this[_0x4733('0x10')][_0x4733('0x35')],_0x34f61a[_0x4733('0x6c')],_0x34f61a['text'],_0x34f61a['dialogflow_language']||'en')['then'](function(_0x274704){_0xce07b9(null,_0x274704);})['catch'](function(_0x9d5719){_0xce07b9(_0x9d5719);});};AGIVertices[_0x4733('0x12')][_0x4733('0x6d')]=function(_0x33a056,_0x52aa67){scripts[_0x4733('0x6d')](this[_0x4733('0x10')][_0x4733('0x35')],_0x33a056[_0x4733('0x6e')],_0x33a056[_0x4733('0x6f')],_0x33a056[_0x4733('0x70')],_0x33a056[_0x4733('0x53')],_0x33a056[_0x4733('0x71')]||'en')['then'](function(_0x12aeb4){_0x52aa67(null,_0x12aeb4);})['catch'](function(_0xe0969){_0x52aa67(_0xe0969);});};AGIVertices[_0x4733('0x12')][_0x4733('0x72')]=function(_0x4ebaf2,_0xb8d9d3){scripts['sestekNDA'](this[_0x4733('0x10')],_0x4ebaf2)['then'](function(_0xba365){_0xb8d9d3(null,_0xba365);})['catch'](function(_0x44b061){_0xb8d9d3(_0x44b061);});};AGIVertices[_0x4733('0x12')][_0x4733('0x73')]=function(_0x40d881,_0x11aed9){scripts[_0x4733('0x73')](_0x40d881['key'],_0x40d881['text'],_0x40d881[_0x4733('0x74')]||_0x4733('0x75'),_0x40d881[_0x4733('0x76')])[_0x4733('0x15')](function(_0x28aef1){_0x11aed9(null,_0x28aef1);})['catch'](function(_0xbadce4){_0x11aed9(_0xbadce4);});};AGIVertices['prototype']['ispeechASR']=function(_0x50be00,_0x46a15c,_0x61323b){scripts[_0x4733('0x77')](_0x46a15c,_0x50be00[_0x4733('0x6c')],_0x50be00[_0x4733('0x78')]||_0x4733('0x75'),this['isConfigured'](_0x50be00[_0x4733('0x79')])?_0x50be00['model']:undefined)[_0x4733('0x15')](function(_0x483183){_0x61323b(null,_0x483183);})[_0x4733('0x17')](function(_0x2376b6){_0x61323b(_0x2376b6);});};AGIVertices[_0x4733('0x12')]['awsPolly']=function(_0x4db01b,_0x173b53){scripts[_0x4733('0x7a')](_0x4db01b[_0x4733('0x7b')],_0x4db01b[_0x4733('0x7c')],_0x4db01b['aws_polly_region'],_0x4db01b[_0x4733('0x7d')]||_0x4733('0x7e'),_0x4db01b['text'],_0x4db01b[_0x4733('0x7f')]||_0x4733('0x53'))[_0x4733('0x15')](function(_0x5c61ae){_0x173b53(null,_0x5c61ae);})['catch'](function(_0x5b62b5){_0x173b53(_0x5b62b5);});};AGIVertices[_0x4733('0x12')][_0x4733('0x80')]=function(_0x49d450,_0x5cb95c){scripts['awsLex'](this['channel']['uniqueid'],_0x49d450[_0x4733('0x7b')],_0x49d450[_0x4733('0x7c')],_0x49d450[_0x4733('0x81')],_0x49d450['text'],_0x49d450[_0x4733('0x82')])[_0x4733('0x15')](function(_0xe2c765){_0x5cb95c(null,_0xe2c765);})[_0x4733('0x17')](function(_0x7d7673){_0x5cb95c(_0x7d7673);});};AGIVertices[_0x4733('0x12')][_0x4733('0x83')]=function(_0x16e832,_0x363786,_0x166719){scripts[_0x4733('0x83')](_0x363786,_0x16e832['key'],_0x16e832[_0x4733('0x84')]||_0x4733('0x75'))['then'](function(_0xd04ac7){_0x166719(null,_0xd04ac7);})[_0x4733('0x17')](function(_0x38a3cc){_0x166719(_0x38a3cc);});};AGIVertices['prototype'][_0x4733('0x85')]=function(_0x3c6464,_0x11f410,_0x3416b8){scripts['tildeASR'](_0x11f410,_0x3c6464[_0x4733('0x86')],_0x3c6464[_0x4733('0x87')],_0x3c6464[_0x4733('0x88')])[_0x4733('0x15')](function(_0x1f74e0){_0x3416b8(null,_0x1f74e0);})[_0x4733('0x17')](function(_0x483ddc){_0x3416b8(_0x483ddc);});};AGIVertices[_0x4733('0x12')][_0x4733('0x89')]=function(_0x1d50af){var _0x5c5b76=_[_0x4733('0x5d')](verticesWithRetry,_0x1d50af[_0x4733('0x36')])?_0x1d50af:_[_0x4733('0x8a')](_0x1d50af);for(var _0x18059d in _0x5c5b76){if(_0x5c5b76[_0x4733('0x8b')](_0x18059d)){if(_0x5c5b76[_0x18059d]&&_['isString'](_0x5c5b76[_0x18059d])){if(_[_0x4733('0x5d')](recursiveMapAttributes,_0x18059d)){_0x5c5b76[_0x18059d]=this[_0x4733('0x8c')](_0x5c5b76[_0x18059d]);}else{_0x5c5b76[_0x18059d]=this['replaceAllVariables'](_0x5c5b76[_0x18059d]);}}}}return _0x5c5b76;};AGIVertices[_0x4733('0x12')][_0x4733('0x8d')]=function(_0x50f8db){for(var _0x1a44ae in _0x50f8db){if(_0x50f8db[_0x4733('0x8b')](_0x1a44ae)){if(_[_0x4733('0x8e')](_0x50f8db[_0x1a44ae])){this[_0x4733('0x8d')](_0x50f8db[_0x1a44ae]);}else if(_[_0x4733('0x8f')](_0x50f8db[_0x1a44ae])){for(var _0x461bfc=0x0;_0x461bfc<_0x50f8db[_0x1a44ae][_0x4733('0x90')];_0x461bfc++){this['recursiveNodeIndex'](_0x50f8db[_0x1a44ae][_0x461bfc]);}}else if(_['isString'](_0x50f8db[_0x1a44ae])){_0x50f8db[_0x1a44ae]=this[_0x4733('0x91')](_0x50f8db[_0x1a44ae]);}}}};AGIVertices[_0x4733('0x12')]['saveRestApiResult']=function(_0x18b38c,_0x53e996){for(var _0x4d8180 in _0x18b38c){if(_0x18b38c[_0x4733('0x8b')](_0x4d8180)){if(_[_0x4733('0x8e')](_0x18b38c[_0x4d8180])){if(!_[_0x4733('0x92')](_0x18b38c[_0x4d8180])){this[_0x4733('0x93')](_0x18b38c[_0x4d8180],util[_0x4733('0x28')]('%s.%s',_0x53e996,_0x4d8180));}}else if(_[_0x4733('0x8f')](_0x18b38c[_0x4d8180])){for(var _0x21172a=0x0;_0x21172a<_0x18b38c[_0x4d8180][_0x4733('0x90')];_0x21172a++){this[_0x4733('0x93')](_0x18b38c[_0x4d8180][_0x21172a],util[_0x4733('0x28')](_0x4733('0x94'),_0x53e996,_0x4d8180+'['+_0x21172a+']'));}}else{if(!_[_0x4733('0x41')](_0x18b38c[_0x4d8180])){this[_0x4733('0x10')][_0x4733('0x95')](util[_0x4733('0x28')](_0x4733('0x94'),_0x53e996,_0x4d8180),_0x18b38c[_0x4d8180]);}}}}};AGIVertices[_0x4733('0x12')][_0x4733('0x8c')]=function(_0x595d94){try{var _0x2ce46b=JSON[_0x4733('0x60')](_0x595d94);this[_0x4733('0x8d')](_0x2ce46b);return JSON['stringify'](_0x2ce46b);}catch(_0x4b98fd){return this['replaceAllVariables'](_0x595d94);}};AGIVertices[_0x4733('0x12')]['replaceAllVariables']=function(_0x44e357){var _0x359c84=_0x44e357['split']('{');for(var _0xa4fb7=0x1;_0xa4fb7<_0x359c84['length'];_0xa4fb7+=0x1){var _0x225ed7=_0x359c84[_0xa4fb7][_0x4733('0x96')]('}');if(_0x225ed7[_0x4733('0x90')]>0x1){_0x44e357=_0x44e357['replaceAll']('{'+_0x225ed7[0x0]+'}',this['channel']['getVariable'](_0x225ed7[0x0])[_0x4733('0x97')]||_0x225ed7[0x0]);}}if(_0x359c84[_0x4733('0x90')]===0x1){return _0x44e357[_0x4733('0x47')]();}return this[_0x4733('0x91')](_0x44e357);};AGIVertices[_0x4733('0x12')][_0x4733('0x98')]=function(_0x4fd45c,_0x11de09){var _0x32aa25=this['channel'][_0x4733('0x13')](_0x4fd45c);if(_0x32aa25[_0x4733('0x99')]===-0x1){return _0x32aa25;}logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x9a'),_0x11de09,_0x32aa25[_0x4733('0x97')]));return this[_0x4733('0x10')][_0x4733('0x95')](_0x11de09,_0x32aa25['extra']);};AGIVertices[_0x4733('0x12')][_0x4733('0x9b')]=function(_0x56d626){return _0x56d626&&_0x56d626!=='0'&&_0x56d626!=='-1'&&_0x56d626!=='';};AGIVertices[_0x4733('0x12')][_0x4733('0x9c')]=function(_0x277d4b){this['createSquareDetailsReport'][_0x4733('0x63')](this,_0x277d4b,'-');_0x277d4b[_0x4733('0x9d')]=_0x277d4b['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x5b8e16){logger[_0x4733('0x2e')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x5b8e16[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x5b8e16[_0x4733('0x53')])){return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0xa0'));}var _0x4a5b46='\x22'+_0x5b8e16['text']+'\x22';if(this[_0x4733('0x9b')](_0x5b8e16[_0x4733('0x6a')])){_0x4a5b46+=','+_0x5b8e16['options'];}var _0x1e5532=this[_0x4733('0x10')]['exec'](_0x4733('0xa1'),_0x4a5b46);if(_0x1e5532[_0x4733('0x99')]===-0x1){return _0x1e5532;}return this[_0x4733('0x10')]['noop'](util[_0x4733('0x28')](_0x4733('0xa2'),_0x4a5b46));};AGIVertices[_0x4733('0x12')][_0x4733('0xa3')]=function(_0x315840){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0xa4'),_0x315840['label']));if(!this['isConfigured'](_0x315840[_0x4733('0xa5')])){return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0xa6'));}var _0x2bff1d=_0x315840[_0x4733('0xa5')];if(this[_0x4733('0x9b')](_0x315840['options'])){_0x2bff1d+=','+_0x315840[_0x4733('0x6a')];}var _0x21a610=this[_0x4733('0x10')][_0x4733('0xa7')](_0x4733('0xa8'),_0x2bff1d);if(_0x21a610[_0x4733('0x99')]===-0x1){return _0x21a610;}var _0x3cea22=this[_0x4733('0x98')](_0x4733('0xa9'),_0x4733('0xaa'));if(_0x3cea22['result']===-0x1){return _0x3cea22;}var _0x295400=this[_0x4733('0x98')]('RECOG_INPUT()',_0x4733('0xab'));if(_0x295400[_0x4733('0x99')]===-0x1){return _0x295400;}var _0x1882bb=this['getAndSetVariable'](_0x4733('0xac'),_0x4733('0xad'));if(_0x1882bb[_0x4733('0x99')]===-0x1){return _0x1882bb;}return this['channel']['noop'](util[_0x4733('0x28')](_0x4733('0xae'),_0x2bff1d));};AGIVertices[_0x4733('0x12')]['agi']=function(_0x307579){logger[_0x4733('0x2e')](util['format'](_0x4733('0xaf'),_0x307579[_0x4733('0x9e')]));return this[_0x4733('0x10')][_0x4733('0x6')]([_0x307579[_0x4733('0xb0')],_0x307579[_0x4733('0xb1')]]);};AGIVertices['prototype'][_0x4733('0xb2')]=function(_0x19f744){logger['info'](util[_0x4733('0x28')](_0x4733('0xb3'),_0x19f744[_0x4733('0x9e')]));if(this[_0x4733('0x9b')](_0x19f744[_0x4733('0x5c')])){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0xb4'),_0x19f744[_0x4733('0x5c')]));var _0x418cfe=this[_0x4733('0x10')]['wait'](_0x19f744['timeout']);if(_0x418cfe[_0x4733('0x99')]===-0x1){return _0x418cfe;}}return this[_0x4733('0x10')][_0x4733('0xb2')]();};AGIVertices[_0x4733('0x12')][_0x4733('0xb5')]=function(_0x3d9829){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0xb6'),_0x3d9829[_0x4733('0x9e')]));if(!this['isConfigured'](_0x3d9829[_0x4733('0xb7')])){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x3d9829,_0x4733('0xb8'));}_0x3d9829[_0x4733('0x45')]=moment();if(this[_0x4733('0x9b')](_0x3d9829[_0x4733('0xb9')])){_0x3d9829[_0x4733('0x45')]=moment()[_0x4733('0xba')](_0x3d9829[_0x4733('0xb9')],_0x4733('0xbb'));}if(!this[_0x4733('0x9b')](_0x3d9829[_0x4733('0x48')])){_0x3d9829[_0x4733('0x48')]=0x2;}this[_0x4733('0x40')][_0x4733('0x63')](this,_0x3d9829);return this['channel']['noop'](util['format'](_0x4733('0xbc'),_0x3d9829[_0x4733('0x44')],_0x3d9829[_0x4733('0xb7')],_0x3d9829[_0x4733('0x45')]));};AGIVertices[_0x4733('0x12')][_0x4733('0xbd')]=function(_0x4e4a4c){logger[_0x4733('0x2e')](util['format'](_0x4733('0xbe'),_0x4e4a4c[_0x4733('0x9e')]));var _0x47c73e=this[_0x4733('0x10')]['exec'](_0x4e4a4c['application'],_0x4e4a4c[_0x4733('0x6a')]);if(_0x47c73e['result']===-0x1){return _0x47c73e;}return this[_0x4733('0x10')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x4e4a4c['application'],_0x4e4a4c[_0x4733('0x6a')]));};AGIVertices['prototype'][_0x4733('0xbf')]=function(_0x1d0aaf){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0xc0'),_0x1d0aaf['label']));if(!this['isConfigured'](_0x1d0aaf[_0x4733('0x53')])){return this['channel'][_0x4733('0x9f')]('no\x20text\x20configured');}var _0x3a99e5='\x22'+_0x1d0aaf['text']+'\x22';if(this[_0x4733('0x9b')](_0x1d0aaf[_0x4733('0x6a')])){_0x3a99e5+=','+_0x1d0aaf[_0x4733('0x6a')];}var _0x39df2a=this[_0x4733('0x10')]['exec'](_0x4733('0xa1'),_0x3a99e5);if(_0x39df2a[_0x4733('0x99')]===-0x1){return _0x39df2a;}return this['channel'][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0xa2'),_0x3a99e5));};AGIVertices['prototype'][_0x4733('0xc1')]=function(_0x24f29d){logger[_0x4733('0x2e')](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x24f29d['label']));if(!this[_0x4733('0x9b')](_0x24f29d[_0x4733('0x53')])){return this['channel'][_0x4733('0x9f')](_0x4733('0xa0'));}var _0x1596bd='\x22'+_0x24f29d[_0x4733('0x53')]+'\x22';if(this['isConfigured'](_0x24f29d[_0x4733('0x6a')])){_0x1596bd+=','+_0x24f29d[_0x4733('0x6a')];}var _0x200e73=this[_0x4733('0x10')][_0x4733('0xa7')](_0x4733('0xa1'),_0x1596bd);if(_0x200e73[_0x4733('0x99')]===-0x1){return _0x200e73;}return this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0xa2'),_0x1596bd));};AGIVertices[_0x4733('0x12')]['lumenvoxasr']=function(_0x434bd6){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0xc2'),_0x434bd6['label']));if(!this[_0x4733('0x9b')](_0x434bd6[_0x4733('0xa5')])){return this[_0x4733('0x10')][_0x4733('0x9f')]('no\x20grammar\x20configured');}var _0x52b253=_0x434bd6['grammar'];if(this[_0x4733('0x9b')](_0x434bd6['options'])){_0x52b253+=','+_0x434bd6[_0x4733('0x6a')];}var _0x23c7e1=this['channel'][_0x4733('0xa7')]('MRCPRecog',_0x52b253);if(_0x23c7e1[_0x4733('0x99')]===-0x1){return _0x23c7e1;}var _0x531529=this['getAndSetVariable'](_0x4733('0xa9'),_0x4733('0xc3'));if(_0x531529['result']===-0x1){return _0x531529;}var _0x3f0afa=this['getAndSetVariable'](_0x4733('0xc4'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x3f0afa[_0x4733('0x99')]===-0x1){return _0x3f0afa;}var _0x5156a0=this[_0x4733('0x98')](_0x4733('0xac'),_0x4733('0xc5'));if(_0x5156a0[_0x4733('0x99')]===-0x1){return _0x5156a0;}return this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0xae'),_0x52b253));};AGIVertices['prototype'][_0x4733('0xc6')]=function(_0x1f0018){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0xc7'),_0x1f0018['label']));if(!this[_0x4733('0x9b')](_0x1f0018[_0x4733('0xa5')])){return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0xa6'));}var _0x59bd31=_0x1f0018[_0x4733('0xa5')];if(this[_0x4733('0x9b')](_0x1f0018[_0x4733('0x6a')])){_0x59bd31+=','+_0x1f0018[_0x4733('0x6a')];}var _0x52e377=this[_0x4733('0x10')][_0x4733('0xa7')](_0x4733('0xa8'),_0x59bd31);if(_0x52e377[_0x4733('0x99')]===-0x1){return _0x52e377;}var _0x626bb0=this[_0x4733('0x98')]('RECOG_CONFIDENCE()',_0x4733('0xc8'));if(_0x626bb0['result']===-0x1){return _0x626bb0;}var _0x462e1c=this['getAndSetVariable'](_0x4733('0xc4'),'SESTEK_ASR_TRANSCRIPT');if(_0x462e1c[_0x4733('0x99')]===-0x1){return _0x462e1c;}var _0x386412=this[_0x4733('0x98')]('RECOG_INSTANCE()',_0x4733('0xc9'));if(_0x386412['result']===-0x1){return _0x386412;}return this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x59bd31));};AGIVertices[_0x4733('0x12')]['database']=function(_0x149eca){logger[_0x4733('0x2e')](util[_0x4733('0x28')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x149eca['label']));if(!this[_0x4733('0x9b')](_0x149eca[_0x4733('0xca')])){return this[_0x4733('0x10')]['error'](_0x149eca,_0x4733('0xcb'));}var _0x57409f=this['getSquareOdbc'][_0x4733('0x63')](this,_0x149eca[_0x4733('0xca')]);if(!_0x57409f){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x149eca,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x149eca['query'])){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x149eca,_0x4733('0xcc'));}var _0x3887a5=_0x149eca['query'][_0x4733('0xcd')](/(\r\n|\n|\r)/gm,'\x20');this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')]('query:\x20%s',_0x3887a5));var _0x1e52ae=this[_0x4733('0x2a')][_0x4733('0x63')](this,_0x57409f,_0x3887a5);this['createSquareDetailsReport'][_0x4733('0x63')](this,_0x149eca,_0x3887a5);if(!this[_0x4733('0x9b')](_0x149eca[_0x4733('0xce')])){return this[_0x4733('0x10')][_0x4733('0x9f')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x741623=this[_0x4733('0x13')][_0x4733('0x63')](this,_0x149eca[_0x4733('0xce')]);if(!_0x741623){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x149eca,_0x4733('0xcf'));}var _0x5a6e3c=this;_0x1e52ae[_0x4733('0xd0')](function(_0x5e5345,_0x4068a5){Object[_0x4733('0xd1')](_0x5e5345)[_0x4733('0xd0')](function(_0x302625){_0x5a6e3c['channel'][_0x4733('0x95')](util[_0x4733('0x28')](_0x4733('0xd2'),_0x741623,_0x4068a5,_0x302625),_0x5e5345[_0x302625]);});});this[_0x4733('0x10')][_0x4733('0x95')](util[_0x4733('0x28')](_0x4733('0xd3'),_0x741623),_0x1e52ae[_0x4733('0x90')]);return this[_0x4733('0x10')][_0x4733('0x9f')](util['format'](_0x4733('0xd4'),_0x741623));};AGIVertices[_0x4733('0x12')][_0x4733('0xd5')]=function(_0x1ea295){logger[_0x4733('0xd6')](util[_0x4733('0x28')](_0x4733('0xd7'),_0x1ea295[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x1ea295['sip_id'])){return this[_0x4733('0x10')]['error'](_0x1ea295,_0x4733('0xd8'));}var _0xa0d7e2=this[_0x4733('0x1c')][_0x4733('0x63')](this,_0x1ea295[_0x4733('0xd9')]);if(!_0xa0d7e2){return this['channel']['error'](_0x1ea295,_0x4733('0xda'));}var _0x5a39c9=this[_0x4733('0x10')][_0x4733('0xa7')](_0x4733('0xdb'),[util[_0x4733('0x28')](_0x4733('0xdc'),_0xa0d7e2),_0x1ea295[_0x4733('0x5c')],_0x1ea295[_0x4733('0xdd')],_0x1ea295[_0x4733('0x64')]]);if(_0x5a39c9['result']===-0x1){return _0x5a39c9;}return this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0xde'),_0x4733('0xdb')));};AGIVertices[_0x4733('0x12')][_0x4733('0xdf')]=function(_0x2fd129){logger['info'](util[_0x4733('0x28')](_0x4733('0xe0'),_0x2fd129[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x2fd129['key'])){return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0xe1'));}if(!this[_0x4733('0x9b')](_0x2fd129[_0x4733('0x53')])){return this['channel'][_0x4733('0x9f')](_0x4733('0xa0'));}this[_0x4733('0x10')][_0x4733('0xe2')]=!![];this[_0x4733('0x34')](_0x2fd129);this[_0x4733('0x3f')](_0x2fd129[_0x4733('0x53')],'in','','');this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0xe3'),_0x2fd129[_0x4733('0x53')]));var _0x2b19a7=this['googleDialogflow'][_0x4733('0x63')](this,_0x2fd129);if(_0x2b19a7){for(var _0x57ed5d in _0x2b19a7){if(_0x2b19a7['hasOwnProperty'](_0x57ed5d)){this['channel'][_0x4733('0x95')](util[_0x4733('0x28')](_0x4733('0xe4'),_0x57ed5d[_0x4733('0xe5')]()),_0x2b19a7[_0x57ed5d]);}}this[_0x4733('0x3f')](_0x2b19a7[_0x4733('0xe6')],_0x4733('0xe7'),_0x4733('0xdf'),'');return this[_0x4733('0x10')]['noop'](util['format'](_0x4733('0xe8'),_0x2b19a7[_0x4733('0xe6')]));}return this[_0x4733('0x10')]['error'](_0x2fd129,_0x4733('0xe9'));};AGIVertices['prototype'][_0x4733('0xea')]=function(_0xdbd83c){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0xeb'),_0xdbd83c[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0xdbd83c['dialogflowV2_project_id'])){return this[_0x4733('0x10')][_0x4733('0x9f')]('no\x20project_id\x20configured');}if(!this[_0x4733('0x9b')](_0xdbd83c[_0x4733('0x6f')])){return this['channel']['noop'](_0x4733('0xec'));}if(!this[_0x4733('0x9b')](_0xdbd83c[_0x4733('0x70')])){return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0xed'));}if(!this[_0x4733('0x9b')](_0xdbd83c[_0x4733('0x71')])){return this[_0x4733('0x10')]['noop'](_0x4733('0xee'));}if(!this['isConfigured'](_0xdbd83c[_0x4733('0x53')])){return this[_0x4733('0x10')]['noop'](_0x4733('0xa0'));}this['channel'][_0x4733('0xe2')]=!![];this[_0x4733('0x34')](_0xdbd83c);this[_0x4733('0x3f')](_0xdbd83c[_0x4733('0x53')],'in','','');this[_0x4733('0x10')]['noop'](util[_0x4733('0x28')](_0x4733('0xef'),_0xdbd83c[_0x4733('0x53')]));var _0x4309f1=this['googleDialogflowV2'][_0x4733('0x63')](this,_0xdbd83c);if(_0x4309f1){for(var _0x246a7f in _0x4309f1){if(_0x4309f1[_0x4733('0x8b')](_0x246a7f)){if(_0x246a7f!==_0x4733('0xf0')){this[_0x4733('0x10')][_0x4733('0x95')](util[_0x4733('0x28')](_0x4733('0xe4'),_0x246a7f['toUpperCase']()),_0x4309f1[_0x246a7f]);}}}this[_0x4733('0x3f')](_0x4309f1[_0x4733('0xe6')],_0x4733('0xe7'),'dialogflowV2',_0x4309f1[_0x4733('0xf0')]);return this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0xf1'),_0x4309f1[_0x4733('0xe6')]));}return this[_0x4733('0x10')][_0x4733('0x2c')](_0xdbd83c,_0x4733('0xf2'));};AGIVertices[_0x4733('0x12')][_0x4733('0xf3')]=function(_0x12a6ca){logger[_0x4733('0x2e')](util['format'](_0x4733('0xf4'),_0x12a6ca[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x12a6ca[_0x4733('0xf5')])){return this[_0x4733('0x10')][_0x4733('0x9f')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x4733('0x9b')](_0x12a6ca['username'])){return this['channel'][_0x4733('0x9f')](_0x4733('0xf6'));}if(!this[_0x4733('0x9b')](_0x12a6ca[_0x4733('0xf7')])){return this[_0x4733('0x10')][_0x4733('0x9f')]('no\x20password\x20configured');}if(!this[_0x4733('0x9b')](_0x12a6ca[_0x4733('0xf8')])){return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0xa0'));}this[_0x4733('0x10')][_0x4733('0xe2')]=!![];this[_0x4733('0x34')](_0x12a6ca);this[_0x4733('0x3f')](_0x12a6ca[_0x4733('0x53')],'in','','');this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0xf9'),_0x12a6ca['text']));var _0x37f2f5=this[_0x4733('0x72')][_0x4733('0x63')](this,_0x12a6ca);if(_0x37f2f5){for(var _0x3ccf07 in _0x37f2f5){if(_0x37f2f5[_0x4733('0x8b')](_0x3ccf07)){this[_0x4733('0x10')][_0x4733('0x95')](util[_0x4733('0x28')](_0x4733('0xfa'),_0x3ccf07[_0x4733('0xe5')]()),_0x37f2f5[_0x3ccf07]);}}this[_0x4733('0x3f')](_0x37f2f5['speech'],_0x4733('0xe7'),_0x4733('0xf3'),'');if(_0x37f2f5['audiofile']){this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0xfb'),_0x37f2f5['audiofile']));var _0x562c4d=this['channel'][_0x4733('0xfc')](_0x37f2f5[_0x4733('0xfd')]);try{fs[_0x4733('0xfe')](_0x37f2f5[_0x4733('0xfd')]+_0x4733('0xff'));}catch(_0x4eed2a){logger[_0x4733('0x2c')](_0x4eed2a);}return _0x562c4d;}else{return this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x100'),_0x37f2f5[_0x4733('0xe6')]));}}return this['channel'][_0x4733('0x2c')](_0x12a6ca,_0x4733('0x101'));};AGIVertices[_0x4733('0x12')]['end']=function(_0x1f2224){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x102'),_0x1f2224[_0x4733('0x9e')]));return this['channel']['noop']('end');};AGIVertices[_0x4733('0x12')]['ext_dial']=function(_0x2d1e04){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x103'),_0x2d1e04[_0x4733('0x9e')]));var _0xc8de1a='';if(_0x2d1e04[_0x4733('0x104')]){if(!this[_0x4733('0x9b')](_0x2d1e04[_0x4733('0x104')])){return this['channel'][_0x4733('0x2c')](_0x2d1e04,_0x4733('0x105'));}else{var _0x4513a5=parseInt(_0x2d1e04[_0x4733('0x104')],0xa);if(isNaN(_0x4513a5)){_0xc8de1a=_0x2d1e04[_0x4733('0x104')];}else{_0xc8de1a=this[_0x4733('0x106')][_0x4733('0x63')](this,_0x2d1e04[_0x4733('0x104')]);if(!_0xc8de1a){return this[_0x4733('0x10')]['error'](_0x2d1e04,_0x4733('0x107'));}}}}else if(_0x2d1e04[_0x4733('0x108')]){_0xc8de1a=_0x2d1e04[_0x4733('0x108')];}else{return this[_0x4733('0x10')][_0x4733('0x2c')](_0x2d1e04,_0x4733('0x105'));}var _0x565c69=this[_0x4733('0x10')][_0x4733('0xa7')](_0x4733('0xdb'),[util[_0x4733('0x28')]('SIP/%s/%s',_0xc8de1a,_0x2d1e04[_0x4733('0x44')]),_0x2d1e04[_0x4733('0x5c')],_0x2d1e04[_0x4733('0xdd')],_0x2d1e04[_0x4733('0x64')]]);if(_0x565c69['result']===-0x1){return _0x565c69;}return this[_0x4733('0x10')][_0x4733('0x9f')](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x4733('0x12')]['finally']=function(_0x4ea8e3){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x109'),_0x4ea8e3[_0x4733('0x9e')]));return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0x10a'));};AGIVertices[_0x4733('0x12')][_0x4733('0xe')]=function(_0x4a0917){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x10b'),_0x4a0917[_0x4733('0x9e')]));if(_0x4a0917[_0x4733('0x9d')]===0x0){return this[_0x4733('0x9c')](_0x4a0917);}_0x4a0917['retry']-=0x1;if(!this[_0x4733('0x9b')](_0x4a0917['file_id'])){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x4a0917,_0x4733('0x10c'));}var _0x1c1b3e=this[_0x4733('0x10d')][_0x4733('0x63')](this,_0x4a0917[_0x4733('0x10e')]);if(!_0x1c1b3e){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x4a0917,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x4a0917['variable_id'])){return this[_0x4733('0x10')]['error'](_0x4733('0x10f'));}var _0x3bcc15=this[_0x4733('0x10')][_0x4733('0x110')](_0x1c1b3e,_0x4a0917[_0x4733('0x111')],_0x4a0917[_0x4733('0x112')]);var _0xf043ba=_0x3bcc15[_0x4733('0x99')]?_0x3bcc15[_0x4733('0x99')]['toString']():'';logger['info'](_0x4733('0x113'),JSON[_0x4733('0x66')](_0x3bcc15));if(_0x3bcc15[_0x4733('0x99')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x4a0917,_0xf043ba);return _0x3bcc15;}else if(_0x3bcc15[_0x4733('0x97')]==='timeout'){_0x3bcc15[_0x4733('0x99')]=_0xf043ba[_0x4733('0x90')]>=parseInt(_0x4a0917[_0x4733('0x114')])?'x':'i';}else{_0x3bcc15[_0x4733('0x99')]=_0xf043ba[_0x4733('0x90')]>=parseInt(_0x4a0917[_0x4733('0x114')])&&_0xf043ba[_0x4733('0x90')]<=parseInt(_0x4a0917[_0x4733('0x112')])?'x':'i';}var _0x3c43f0=this[_0x4733('0x13')]['sync'](this,_0x4a0917[_0x4733('0xce')]);if(!_0x3c43f0){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x4a0917,_0x4733('0xcf'));}this[_0x4733('0x10')][_0x4733('0x95')](_0x3c43f0,_0xf043ba);if(this[_0x4733('0x9b')](_0x4a0917['hiddendigitsnum'])){var _0x353c08=parseInt(_0x4a0917[_0x4733('0x115')],0xa);var _0x34de9d=rs[_0x4733('0x116')]({'charset':'*','length':_0x353c08});var _0x3c4d68=_0xf043ba['length'];if(_0x3c4d68>0x0){if(_0x3c4d68>_0x353c08){this[_0x4733('0x34')][_0x4733('0x63')](this,_0x4a0917,_0x4a0917[_0x4733('0x117')]===_0x4733('0x118')?_0x34de9d+_0xf043ba['substr'](_0x353c08):_0xf043ba[_0x4733('0x119')](0x0,_0x3c4d68-_0x353c08)+_0x34de9d);}else{this[_0x4733('0x34')]['sync'](this,_0x4a0917,rs['generate']({'charset':'*','length':_0x3c4d68}));}}else{this[_0x4733('0x34')][_0x4733('0x63')](this,_0x4a0917,'');}}else{this[_0x4733('0x34')][_0x4733('0x63')](this,_0x4a0917,_0xf043ba);}return _0x3bcc15;};AGIVertices[_0x4733('0x12')][_0x4733('0xf')]=function(_0x5082ee){logger['info'](util[_0x4733('0x28')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x5082ee[_0x4733('0x9e')]));return this[_0x4733('0xe')](_0x5082ee);};AGIVertices[_0x4733('0x12')][_0x4733('0x11a')]=function(_0x25a70a){logger['info'](util['format'](_0x4733('0x11b'),_0x25a70a[_0x4733('0x9e')]));this['createSquareDetailsReport'][_0x4733('0x63')](this,_0x25a70a,_0x25a70a[_0x4733('0x11c')]);return this[_0x4733('0x10')]['noop'](util[_0x4733('0x28')](_0x4733('0x11d'),_0x25a70a[_0x4733('0x11c')]));};AGIVertices['prototype'][_0x4733('0x11e')]=function(_0x4130be){logger['info'](util[_0x4733('0x28')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x4130be[_0x4733('0x9e')]));if(!this['isConfigured'](_0x4130be['aws_access_key_id'])||!this[_0x4733('0x9b')](_0x4130be[_0x4733('0x7c')])){return this[_0x4733('0x10')][_0x4733('0x9f')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x4733('0x9b')](_0x4130be[_0x4733('0x53')])){return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0xa0'));}this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x11f'),_0x4130be[_0x4733('0x53')]));var _0x488041=this[_0x4733('0x7a')]['sync'](this,_0x4130be);if(_0x488041){this[_0x4733('0x10')][_0x4733('0x9f')](util['format'](_0x4733('0x120'),_0x488041));var _0x536c61=this[_0x4733('0x10')][_0x4733('0xfc')](_0x488041);try{fs[_0x4733('0xfe')](_0x488041+_0x4733('0xff'));}catch(_0x36a3a3){logger[_0x4733('0x2c')](_0x36a3a3);}return _0x536c61;}return this[_0x4733('0x10')][_0x4733('0x2c')](_0x4130be,_0x4733('0x121'));};AGIVertices['prototype']['awslex']=function(_0x276901){logger['info'](util[_0x4733('0x28')](_0x4733('0x122'),_0x276901[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x276901[_0x4733('0x7b')])||!this['isConfigured'](_0x276901['aws_secret_access_key'])){return this['channel'][_0x4733('0x9f')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x4733('0x9b')](_0x276901[_0x4733('0x82')])){return this['channel'][_0x4733('0x9f')]('no\x20bot\x20name\x20configured');}if(!this[_0x4733('0x9b')](_0x276901[_0x4733('0x53')])){return this['channel'][_0x4733('0x9f')]('no\x20text\x20configured');}this[_0x4733('0x10')][_0x4733('0xe2')]=!![];this[_0x4733('0x34')](_0x276901);this[_0x4733('0x3f')](_0x276901[_0x4733('0x53')],'in','','');this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')]('Trying\x20Amazon\x20Lex:\x20%s',_0x276901[_0x4733('0x53')]));var _0x4e4a8e=this[_0x4733('0x80')][_0x4733('0x63')](this,_0x276901);if(_0x4e4a8e){for(var _0x43ec24 in _0x4e4a8e){if(_0x4e4a8e[_0x4733('0x8b')](_0x43ec24)&&_[_0x4733('0x123')](_0x4e4a8e[_0x43ec24])){this['channel']['setVariable'](util['format']('AWS_LEX_%s',_0x43ec24['toUpperCase']()),_0x4e4a8e[_0x43ec24]);}}if(_[_0x4733('0x41')](_0x4e4a8e['message'])){return this[_0x4733('0x10')]['noop'](_0x4733('0x124'));}else{this[_0x4733('0x3f')](_0x4e4a8e['message'],_0x4733('0xe7'),_0x4733('0x125'),'');return this[_0x4733('0x10')][_0x4733('0x9f')](util['format'](_0x4733('0x126'),_0x4e4a8e['message']));}}return this[_0x4733('0x10')][_0x4733('0x2c')](_0x276901,_0x4733('0x127'));};AGIVertices['prototype'][_0x4733('0x128')]=function(_0x4ea255){logger[_0x4733('0x2e')](util['format'](_0x4733('0x129'),_0x4ea255[_0x4733('0x9e')],_0x4ea255['timeout']));if(!this[_0x4733('0x9b')](_0x4ea255['key'])){return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0xe1'));}var _0x31bb98=_0x4733('0x12a');var _0x4c649f=util[_0x4733('0x28')](_0x4733('0x12b'),FILES_PATH,rs[_0x4733('0x116')](0x4));var _0xaa250f=util[_0x4733('0x28')]('%s.%s',_0x4c649f,_0x31bb98);var _0x47efad=!![];if(_0x4ea255['beep']==='NOBEEP'){_0x47efad=![];}var _0xea274e=this[_0x4733('0x10')]['recordFile'](_0x4c649f,_0x31bb98,_0x4ea255[_0x4733('0x12c')],_0x4ea255['timeout'],undefined,_0x47efad);if(_0xea274e[_0x4733('0x99')]!==-0x1){this[_0x4733('0x10')][_0x4733('0x9f')](util['format'](_0x4733('0x12d'),_0xaa250f));var _0x364a27=this[_0x4733('0x83')][_0x4733('0x63')](this,_0x4ea255,_0xaa250f);if(_0x364a27){for(var _0x203ccb in _0x364a27){if(_0x364a27[_0x4733('0x8b')](_0x203ccb)){this[_0x4733('0x10')][_0x4733('0x95')](util[_0x4733('0x28')]('GOOGLE_ASR_%s',_0x203ccb[_0x4733('0xe5')]()),_0x364a27[_0x203ccb]);}}return this['channel'][_0x4733('0x9f')](util[_0x4733('0x28')]('GoogleASR\x20Result\x20%s',JSON[_0x4733('0x66')](_0x364a27)));}}return _0xea274e;};AGIVertices[_0x4733('0x12')][_0x4733('0x12e')]=function(_0x55001c){logger['info'](util[_0x4733('0x28')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x55001c[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x55001c[_0x4733('0x86')])){return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0x12f'));}if(!this[_0x4733('0x9b')](_0x55001c[_0x4733('0x87')])){return this[_0x4733('0x10')]['noop'](_0x4733('0x130'));}var _0x2af563=_0x4733('0x12a');var _0x3bca53=util[_0x4733('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x4733('0x116')](0x4));var _0x4ab58f=util[_0x4733('0x28')](_0x4733('0x94'),_0x3bca53,_0x2af563);var _0x161fcf=!![];if(_0x55001c[_0x4733('0x131')]===_0x4733('0x132')){_0x161fcf=![];}var _0x2ca366=this['channel'][_0x4733('0x133')](_0x3bca53,_0x2af563,_0x55001c[_0x4733('0x12c')],_0x55001c[_0x4733('0x5c')],undefined,_0x161fcf);if(_0x2ca366['result']!==-0x1){this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x134'),_0x4ab58f));var _0x172884=this['tildeASR'][_0x4733('0x63')](this,_0x55001c,_0x4ab58f);if(_0x172884){for(var _0x3480e4 in _0x172884){if(_0x172884[_0x4733('0x8b')](_0x3480e4)){this[_0x4733('0x10')]['setVariable'](util[_0x4733('0x28')](_0x4733('0x135'),_0x3480e4[_0x4733('0xe5')]()),_0x172884[_0x3480e4]);}}return this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x136'),JSON[_0x4733('0x66')](_0x172884)));}}return _0x2ca366;};AGIVertices[_0x4733('0x12')][_0x4733('0x137')]=function(_0x4fde82){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x138'),_0x4fde82[_0x4733('0x9e')]));return this[_0x4733('0x10')][_0x4733('0x139')](_0x4fde82[_0x4733('0x3b')],_0x4fde82[_0x4733('0x13a')],_0x4fde82[_0x4733('0x13b')]);};AGIVertices[_0x4733('0x12')][_0x4733('0x13c')]=function(_0xc87f8f){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x13d'),_0xc87f8f[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0xc87f8f[_0x4733('0x13e')])){return this[_0x4733('0x10')]['error'](_0xc87f8f,_0x4733('0x13f'));}try{var _0x4264c6=eval(_0xc87f8f[_0x4733('0x13e')])?_0x4733('0x140'):_0x4733('0x141');this['channel'][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x142'),_0xc87f8f['condition'],_0x4264c6));return{'code':0xc8,'result':_0x4264c6};}catch(_0x26d524){return{'code':0xc8,'result':_0x4733('0x141')};}};AGIVertices[_0x4733('0x12')][_0x4733('0x143')]=function(_0x4b9902){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x144'),_0x4b9902[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x4b9902[_0x4733('0x145')])){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x4b9902,_0x4733('0x146'));}var _0xbb9cd8=this[_0x4733('0x23')][_0x4733('0x63')](this,_0x4b9902[_0x4733('0x145')]);if(!_0xbb9cd8){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x4b9902,'no\x20intervals\x20found');}for(var _0x328bca=0x0;_0x328bca<_0xbb9cd8[_0x4733('0x90')];_0x328bca+=0x1){var _0x300570=this[_0x4733('0x10')]['getVariable'](util['format']('IFTIME(%s?true:false)',_0xbb9cd8[_0x328bca]));if(_0x300570['result']===-0x1){return _0x300570;}logger[_0x4733('0x2e')](util['format'](_0x4733('0x147'),_0xbb9cd8[_0x328bca],_0x300570[_0x4733('0x97')]));if(_0x300570[_0x4733('0x97')]===_0x4733('0x140')){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x147'),_0xbb9cd8[_0x328bca],_0x4733('0x140')));this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')]('IFTIME\x20%s\x20%s',_0xbb9cd8[_0x328bca],'true'));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x4733('0x28')](_0x4733('0x147'),_0xbb9cd8[_0x328bca],_0x4733('0x141')));this['channel'][_0x4733('0x9f')](util['format'](_0x4733('0x147'),_0xbb9cd8[_0x328bca],_0x4733('0x141')));}}return{'code':0xc8,'result':_0x4733('0x141')};};AGIVertices[_0x4733('0x12')][_0x4733('0x148')]=function(_0x223cc5){logger[_0x4733('0x2e')](util['format'](_0x4733('0x149'),_0x223cc5[_0x4733('0x9e')]));return this[_0x4733('0x10')]['hangup']();};AGIVertices['prototype']['ispeechasr']=function(_0x15445d){logger['info'](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x15445d[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x15445d[_0x4733('0x6c')])){return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0xe1'));}var _0x423780='wav';var _0x56df90=util['format'](_0x4733('0x12b'),FILES_PATH,rs[_0x4733('0x116')](0x4));var _0x3d2dc5=util['format']('%s.%s',_0x56df90,_0x423780);var _0x498dee=!![];if(_0x15445d[_0x4733('0x131')]==='NOBEEP'){_0x498dee=![];}var _0x497578=this[_0x4733('0x10')][_0x4733('0x133')](_0x56df90,_0x423780,_0x15445d[_0x4733('0x12c')],_0x15445d[_0x4733('0x5c')],undefined,_0x498dee);if(_0x497578[_0x4733('0x99')]!==-0x1){this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')]('ispeech\x20%s\x20file\x20created',_0x3d2dc5));var _0x25ad9a=this[_0x4733('0x77')][_0x4733('0x63')](this,_0x15445d,_0x3d2dc5);if(_0x25ad9a){for(var _0x5a9c63 in _0x25ad9a){if(_0x25ad9a[_0x4733('0x8b')](_0x5a9c63)){this[_0x4733('0x10')][_0x4733('0x95')](util[_0x4733('0x28')]('ISPEECH_ASR_%s',_0x5a9c63[_0x4733('0xe5')]()),_0x25ad9a[_0x5a9c63]);}}return this[_0x4733('0x10')]['noop'](util[_0x4733('0x28')](_0x4733('0x14a'),JSON[_0x4733('0x66')](_0x25ad9a)));}}return _0x497578;};AGIVertices['prototype']['ispeechtts']=function(_0x5beb5d){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x14b'),_0x5beb5d[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x5beb5d[_0x4733('0x6c')])){return this[_0x4733('0x10')][_0x4733('0x9f')]('no\x20key\x20configured');}if(!this[_0x4733('0x9b')](_0x5beb5d[_0x4733('0x53')])){return this['channel'][_0x4733('0x9f')]('no\x20text\x20configured');}this[_0x4733('0x10')][_0x4733('0x9f')](util['format'](_0x4733('0x14c'),_0x5beb5d[_0x4733('0x53')]));var _0x258020=this['ispeechTTS'][_0x4733('0x63')](this,_0x5beb5d);if(_0x258020){this[_0x4733('0x10')]['noop'](util[_0x4733('0x28')](_0x4733('0x14d'),_0x258020));var _0x2bab36=this[_0x4733('0x10')][_0x4733('0xfc')](_0x258020,_0x5beb5d[_0x4733('0x12c')]);try{fs[_0x4733('0xfe')](_0x258020+_0x4733('0xff'));}catch(_0x3af23a){logger['error'](_0x3af23a);}return _0x2bab36;}return this[_0x4733('0x10')][_0x4733('0x2c')](_0x5beb5d,_0x4733('0x14e'));};AGIVertices['prototype']['login']=function(_0x25895e){logger['info'](util[_0x4733('0x28')](_0x4733('0x14f'),_0x25895e[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x25895e['findBy'])){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x25895e,'no\x20find\x20by\x20configured');}logger[_0x4733('0x2e')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4733('0x10')][_0x4733('0x38')],_0x25895e['findBy']));var _0x90bd67=this[_0x4733('0x4e')][_0x4733('0x63')](this,_0x25895e['findBy']);if(_0x90bd67){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x150'),this[_0x4733('0x10')]['callerid'],_0x25895e[_0x4733('0x151')]));this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x150'),this[_0x4733('0x10')]['callerid'],_0x25895e[_0x4733('0x151')]));return{'code':0xc8,'result':_0x4733('0x152')};}else{logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x153'),this[_0x4733('0x10')][_0x4733('0x38')],_0x25895e[_0x4733('0x151')]));this['channel']['noop'](util[_0x4733('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x4733('0x38')],_0x25895e[_0x4733('0x151')]));return{'code':0xc8,'result':_0x4733('0x154')};}};AGIVertices[_0x4733('0x12')][_0x4733('0x155')]=function(_0x302804){logger['info'](util[_0x4733('0x28')](_0x4733('0x156'),_0x302804[_0x4733('0x9e')]));if(!this['isConfigured'](_0x302804[_0x4733('0x151')])){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x302804,'no\x20find\x20by\x20configured');}logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x157'),this[_0x4733('0x10')][_0x4733('0x38')],_0x302804[_0x4733('0x151')]));var _0x5edb1e=this[_0x4733('0x4d')][_0x4733('0x63')](this,_0x302804[_0x4733('0x151')]);if(_0x5edb1e){logger[_0x4733('0x2e')](util[_0x4733('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x4733('0x38')],_0x302804[_0x4733('0x151')]));this['channel'][_0x4733('0x9f')](util[_0x4733('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4733('0x10')]['callerid'],_0x302804['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x4733('0x10')][_0x4733('0x38')],_0x302804[_0x4733('0x151')]));this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x153'),this[_0x4733('0x10')]['callerid'],_0x302804['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x4733('0x12')][_0x4733('0x158')]=function(_0x41ab5b){logger['info'](util['format'](_0x4733('0x159'),_0x41ab5b[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x41ab5b[_0x4733('0x15a')])){return this[_0x4733('0x10')]['error'](_0x41ab5b,_0x4733('0x15b'));}this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x15c'),_0x41ab5b[_0x4733('0x15a')]));var _0xb81e2d=eval(_0x41ab5b[_0x4733('0x15a')]);if(!this[_0x4733('0x9b')](_0x41ab5b[_0x4733('0xce')])){return this[_0x4733('0x10')]['noop'](_0x4733('0x10f'));}var _0x609fbd=this[_0x4733('0x13')]['sync'](this,_0x41ab5b[_0x4733('0xce')]);if(!_0x609fbd){return this['channel'][_0x4733('0x2c')](_0x41ab5b,'no\x20variable\x20found');}if(_['isArray'](_0xb81e2d)){var _0x14f5a1=this;_0xb81e2d['forEach'](function(_0x146fc0,_0x412bea){_0x14f5a1[_0x4733('0x10')][_0x4733('0x95')](util[_0x4733('0x28')](_0x4733('0x15d'),_0x609fbd,_0x412bea),_0x146fc0);});return this[_0x4733('0x10')]['noop'](util[_0x4733('0x28')](_0x4733('0x15e'),_0x609fbd));}else{return this[_0x4733('0x10')][_0x4733('0x95')](_0x609fbd,_0xb81e2d);}};AGIVertices[_0x4733('0x12')][_0x4733('0xd')]=function(_0x21a43f){logger[_0x4733('0x2e')](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x21a43f[_0x4733('0x9e')]));if(_0x21a43f[_0x4733('0x9d')]===0x0){return this[_0x4733('0x9c')](_0x21a43f);}_0x21a43f[_0x4733('0x9d')]-=0x1;if(!this['isConfigured'](_0x21a43f[_0x4733('0x10e')])){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x21a43f,'no\x20file\x20audio\x20selected');}var _0x3c2088=this[_0x4733('0x10d')][_0x4733('0x63')](this,_0x21a43f['file_id']);if(!_0x3c2088){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x21a43f,_0x4733('0x15f'));}var _0x14262c=this['channel']['getData'](_0x3c2088,_0x21a43f[_0x4733('0x111')],_0x21a43f[_0x4733('0x160')]);var _0x1d4538=_0x14262c['result'];if(_0x14262c['result']===-0x1){this['createSquareDetailsReport'][_0x4733('0x63')](this,_0x21a43f,'-1');return _0x14262c;}else if(_0x14262c[_0x4733('0x97')]===_0x4733('0x5c')){_0x14262c['result']=_0x14262c[_0x4733('0x99')][_0x4733('0x90')]>0x0?_0x14262c[_0x4733('0x99')]:'t';}else if(_[_0x4733('0x92')](_0x14262c[_0x4733('0x99')])){_0x14262c[_0x4733('0x99')]='#';_0x1d4538='#';}if(!this[_0x4733('0x9b')](_0x21a43f['variable_id'])){this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0x10f'));}else{var _0x2b21f5=this[_0x4733('0x13')][_0x4733('0x63')](this,_0x21a43f[_0x4733('0xce')]);if(!_0x2b21f5){return this['channel'][_0x4733('0x2c')](_0x21a43f,_0x4733('0xcf'));}this[_0x4733('0x10')][_0x4733('0x95')](_0x2b21f5,_0x1d4538);}this[_0x4733('0x34')][_0x4733('0x63')](this,_0x21a43f,_0x1d4538);return _0x14262c;};AGIVertices[_0x4733('0x12')]['noop']=function(_0x6390d1){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x161'),_0x6390d1[_0x4733('0x9e')]));return this[_0x4733('0x10')][_0x4733('0x9f')](_0x6390d1[_0x4733('0x162')]||_0x6390d1['label']);};AGIVertices[_0x4733('0x12')][_0x4733('0x163')]=function(_0x4bd87f){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x164'),_0x4bd87f[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x4bd87f['findBy'])){return this['channel']['error'](_0x4bd87f,_0x4733('0x165'));}logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x157'),this[_0x4733('0x10')]['callerid'],_0x4bd87f[_0x4733('0x151')]));var _0x1717ad=this[_0x4733('0x166')]['sync'](this,_0x4bd87f[_0x4733('0x167')]);var _0x3d867b=this[_0x4733('0x4a')][_0x4733('0x63')](this,_0x4bd87f[_0x4733('0x151')],_0x1717ad);if(_0x3d867b){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x150'),this[_0x4733('0x10')][_0x4733('0x38')],_0x4bd87f[_0x4733('0x151')]));this['channel'][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x150'),this[_0x4733('0x10')]['callerid'],_0x4bd87f[_0x4733('0x151')]));return{'code':0xc8,'result':_0x4733('0x152')};}else{logger[_0x4733('0x2e')](util['format'](_0x4733('0x153'),this[_0x4733('0x10')][_0x4733('0x38')],_0x4bd87f['findBy']));this[_0x4733('0x10')]['noop'](util['format'](_0x4733('0x150'),this[_0x4733('0x10')][_0x4733('0x38')],_0x4bd87f['findBy']));return{'code':0xc8,'result':_0x4733('0x154')};}};AGIVertices[_0x4733('0x12')][_0x4733('0x168')]=function(_0x1dfaa9){logger['info'](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x1dfaa9['label']));if(!this['isConfigured'](_0x1dfaa9[_0x4733('0x10e')])){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x1dfaa9,_0x4733('0x10c'));}var _0x35da3f=this[_0x4733('0x10d')][_0x4733('0x63')](this,_0x1dfaa9['file_id']);if(!_0x35da3f){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x1dfaa9,_0x4733('0x15f'));}var _0x4a1fec=this[_0x4733('0x10')][_0x4733('0xa7')](_0x4733('0x169'),[_0x35da3f,_0x1dfaa9[_0x4733('0xdd')]]);if(_0x4a1fec[_0x4733('0x99')]===-0x1){return _0x4a1fec;}return this['channel'][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x16a'),_0x4733('0x169'),_0x35da3f));};AGIVertices[_0x4733('0x12')][_0x4733('0x16b')]=function(_0x26150f){logger['info'](util[_0x4733('0x28')](_0x4733('0x16c'),_0x26150f[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x26150f[_0x4733('0x16d')])){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x26150f,_0x4733('0x16e'));}var _0x4ccac5='';var _0x17d60b=parseInt(_0x26150f[_0x4733('0x16d')],0xa);if(isNaN(_0x17d60b)){_0x4ccac5=_0x26150f[_0x4733('0x16d')];}else{_0x4ccac5=this[_0x4733('0x16f')][_0x4733('0x63')](this,_0x26150f['queue_id']);if(!_0x4ccac5){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x26150f,_0x4733('0x170'));}}var _0xb359dc='';if(this['isConfigured'](_0x26150f['file_id'])){var _0x98a8a=this[_0x4733('0x10d')]['sync'](this,_0x26150f[_0x4733('0x10e')]);if(_0x98a8a){_0xb359dc=_0x98a8a;}}this['createSquareDetailsReport'][_0x4733('0x63')](this,_0x26150f,_0x4ccac5);if(_0x26150f[_0x4733('0xdd')][_0x4733('0x171')]('x')<0x0){_0x26150f[_0x4733('0xdd')]+='x';}if(_0x26150f[_0x4733('0xdd')][_0x4733('0x171')]('X')<0x0){_0x26150f['opts']+='X';}this[_0x4733('0x10')]['setVariable']('XMCS-QUEUE',_0x4ccac5?_0x4ccac5[_0x4733('0x172')]():'');var _0x44249c=this[_0x4733('0x10')]['exec'](_0x4733('0x173'),[_0x4ccac5,_0x26150f[_0x4733('0xdd')],_0x26150f[_0x4733('0x64')],_0xb359dc,_0x26150f[_0x4733('0x5c')],_0x26150f[_0x4733('0x6')],_0x26150f[_0x4733('0x174')],_0x26150f[_0x4733('0x175')],'',_0x26150f[_0x4733('0x176')]]);if(_0x44249c[_0x4733('0x99')]===-0x1){return _0x44249c;}return this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x16a'),_0x4733('0x173'),_0x4ccac5));};AGIVertices[_0x4733('0x12')][_0x4733('0x177')]=function(_0x317eb5){logger[_0x4733('0x2e')](util[_0x4733('0x28')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x317eb5[_0x4733('0x9e')]));var _0x4e41e0=_0x317eb5[_0x4733('0x178')]||_0x4733('0x12a');var _0x174b16=util[_0x4733('0x28')](_0x4733('0x179'),this[_0x4733('0x10')]['uniqueid'],rs['generate'](0x5));var _0x2217a8=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x174b16,_0x4e41e0);var _0x4b8156=util[_0x4733('0x28')]('%s/recordings/%s',FILES_PATH,_0x174b16);this[_0x4733('0x39')][_0x4733('0x63')](this,_0x317eb5,_0x174b16,_0x2217a8);this[_0x4733('0x10')][_0x4733('0x95')](_0x4733('0x17a'),_0x174b16);logger['info'](_0x4733('0x17b'),_0x4b8156,_0x4e41e0,_0x317eb5['escape_digits'],_0x317eb5[_0x4733('0x5c')]);return this[_0x4733('0x10')][_0x4733('0x133')](_0x4b8156,_0x4e41e0,_0x317eb5['escape_digits'],_0x317eb5[_0x4733('0x5c')],undefined,!![]);};AGIVertices['prototype'][_0x4733('0x17c')]=function(_0x2fffd7){logger[_0x4733('0x2e')](util[_0x4733('0x28')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x2fffd7['label']));if(!this[_0x4733('0x9b')](_0x2fffd7[_0x4733('0x64')])){return this['channel'][_0x4733('0x9f')](_0x4733('0x17d'));}var _0xf97a63=this[_0x4733('0x5a')]['sync'](this,_0x2fffd7);logger['info'](util['format'](_0x4733('0x17e'),util[_0x4733('0x17f')](_0xf97a63,{'showHidden':![],'depth':null})));if(!this[_0x4733('0x9b')](_0x2fffd7[_0x4733('0xce')])){return this[_0x4733('0x10')]['noop'](_0x4733('0x180'));}var _0x5e6e76=this[_0x4733('0x13')]['sync'](this,_0x2fffd7[_0x4733('0xce')]);if(!_0x5e6e76){return this[_0x4733('0x10')]['error'](_0x2fffd7,_0x4733('0xcf'));}this[_0x4733('0x10')][_0x4733('0x95')](util[_0x4733('0x28')](_0x4733('0x181'),_0x5e6e76),_0xf97a63['statusCode']?_0xf97a63[_0x4733('0x67')]:_0x4733('0x182'));this[_0x4733('0x10')][_0x4733('0x95')](util[_0x4733('0x28')]('%s_STATUS_MESSAGE',_0x5e6e76),_0xf97a63[_0x4733('0x68')]?_0xf97a63['statusMessage']:'OK');if(_0xf97a63[_0x4733('0x5f')]){try{this[_0x4733('0x93')](_0xf97a63[_0x4733('0x5f')],_0x5e6e76);}catch(_0x36cbeb){logger[_0x4733('0x2c')](util[_0x4733('0x28')](_0x4733('0x183'),_0x5e6e76));}}return this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')]('variable\x20%s\x20set',_0x5e6e76));};AGIVertices[_0x4733('0x12')][_0x4733('0x184')]=function(_0x50b3f0){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x185'),_0x50b3f0['label']));return this[_0x4733('0x10')][_0x4733('0x186')](_0x50b3f0[_0x4733('0x187')][_0x4733('0xcd')](/\s+/g,''),_0x50b3f0[_0x4733('0x188')]);};AGIVertices[_0x4733('0x12')]['saynumber']=function(_0xa44ae0){logger[_0x4733('0x2e')](util[_0x4733('0x28')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0xa44ae0['label']));return this[_0x4733('0x10')]['sayNumber'](_0xa44ae0[_0x4733('0x5b')]['replace'](/\s+/g,''),_0xa44ae0['escape_digits']);};AGIVertices[_0x4733('0x12')][_0x4733('0x189')]=function(_0x2fe675){logger['info'](util[_0x4733('0x28')](_0x4733('0x18a'),_0x2fe675[_0x4733('0x9e')]));return this[_0x4733('0x10')][_0x4733('0x18b')](_0x2fe675[_0x4733('0x53')],_0x2fe675[_0x4733('0x188')]);};AGIVertices[_0x4733('0x12')][_0x4733('0x18c')]=function(_0x22fa45){logger[_0x4733('0x2e')](util[_0x4733('0x28')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x22fa45[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x22fa45[_0x4733('0x18d')])){return this[_0x4733('0x10')]['noop']('no\x20mail\x20account\x20configured');}var _0x4e7b97=this[_0x4733('0x1f')]['sync'](this,_0x22fa45[_0x4733('0x18d')]);if(!_0x4e7b97||!_0x4e7b97['Smtp']){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x22fa45,_0x4733('0x18e'));}var _0xbb3315={'from':util['format'](_0x4733('0x18f'),_0x4e7b97[_0x4733('0x16')],_0x4e7b97[_0x4733('0x190')]||_0x4e7b97[_0x4733('0x191')][_0x4733('0x192')]),'to':_0x22fa45['to']||'','cc':_0x22fa45['cc']||'','bcc':_0x22fa45['bcc']||'','subject':_0x22fa45[_0x4733('0x193')],'html':_0x22fa45[_0x4733('0x53')],'text':_0x22fa45[_0x4733('0x53')]};if(this[_0x4733('0x9b')](_0x22fa45['template_id'])){}logger[_0x4733('0xd6')](_0x4733('0x194'),JSON['stringify'](_0xbb3315));this[_0x4733('0x34')][_0x4733('0x63')](this,_0x22fa45,_0x22fa45[_0x4733('0x18d')]);this['channel'][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x195'),_0x4e7b97[_0x4733('0x16')]));this[_0x4733('0x22')][_0x4733('0x63')](this,_0x4e7b97[_0x4733('0x196')],_0xbb3315);return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0x197'));};AGIVertices[_0x4733('0x12')][_0x4733('0x198')]=function(_0x855de0){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x199'),_0x855de0[_0x4733('0x9e')]));return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0x19a'));};AGIVertices[_0x4733('0x12')][_0x4733('0x19b')]=function(_0x205fc1){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x19c'),_0x205fc1[_0x4733('0x9e')]));if(!this['isConfigured'](_0x205fc1[_0x4733('0x19d')])){return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0x19e'));}var _0x476f35=this[_0x4733('0x19f')]['sync'](this,_0x205fc1['sms_account_id']);if(!_0x476f35){return this['channel']['error'](_0x205fc1,'no\x20sms\x20account\x20found');}var _0x5ad196={'body':_0x205fc1[_0x4733('0x1a0')],'phone':_0x205fc1['to']||'','SmsAccountId':_0x476f35['id']};logger[_0x4733('0xd6')](_0x4733('0x1a1'),JSON[_0x4733('0x66')](_0x5ad196));this[_0x4733('0x34')][_0x4733('0x63')](this,_0x205fc1,_0x205fc1[_0x4733('0x19d')]);this[_0x4733('0x10')]['noop'](util[_0x4733('0x28')](_0x4733('0x1a2'),_0x476f35['name']));this[_0x4733('0x33')][_0x4733('0x63')](this,_0x5ad196);return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0x1a3'));};AGIVertices[_0x4733('0x12')][_0x4733('0x1a4')]=function(_0x385976){logger[_0x4733('0x2e')](util[_0x4733('0x28')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x385976['label']));if(!this[_0x4733('0x9b')](_0x385976[_0x4733('0xce')])){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x385976,_0x4733('0x1a5'));}var _0x18fbc3=this[_0x4733('0x13')]['sync'](this,_0x385976[_0x4733('0xce')]);if(!_0x18fbc3){return this['channel']['error'](_0x385976,_0x4733('0xcf'));}return this[_0x4733('0x10')][_0x4733('0x95')](_0x18fbc3,_0x385976[_0x4733('0x1a6')]);};AGIVertices['prototype'][_0x4733('0x1a7')]=function(_0xae01f2){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x1a8'),_0xae01f2['label']));this[_0x4733('0x10')][_0x4733('0x9f')]('START\x20CALLY\x20SQUARE');if(_0xae01f2[_0x4733('0xb2')]==='yes'){this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0x1a9'));return this['channel'][_0x4733('0xb2')]();}return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0x1aa'));};AGIVertices['prototype'][_0x4733('0x1ab')]=function(_0x1ff0c2){logger[_0x4733('0x2e')](util[_0x4733('0x28')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x1ff0c2['label']));if(!this[_0x4733('0x9b')](_0x1ff0c2[_0x4733('0x1ac')])){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x1ff0c2,_0x4733('0x1ad'));}var _0x42b680=this[_0x4733('0x19')]['sync'](this,_0x1ff0c2['project_id']);if(!this[_0x4733('0x9b')](_0x42b680)){return this['channel'][_0x4733('0x2c')](_0x1ff0c2,util[_0x4733('0x28')](_0x4733('0x1ae'),_0x1ff0c2[_0x4733('0x1ac')]));}if(_0x42b680===this[_0x4733('0x10')][_0x4733('0x37')]){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x1ff0c2,_0x4733('0x1af'));}this['createSquareDetailsReport'][_0x4733('0x63')](this,_0x1ff0c2,_0x42b680);var _0x4ad0e9=this[_0x4733('0x10')][_0x4733('0xa7')](_0x4733('0x1b0'),util[_0x4733('0x28')](_0x4733('0x1b1'),config['agi']['host']||_0x4733('0x1b2'),_0x42b680,this[_0x4733('0x10')][_0x4733('0x37')]));if(_0x4ad0e9[_0x4733('0x99')]===-0x1){return _0x4ad0e9;}return this[_0x4733('0x10')][_0x4733('0x9f')](util['format'](_0x4733('0x16a'),_0x4733('0x1b0'),_0x42b680));};AGIVertices[_0x4733('0x12')][_0x4733('0x1b3')]=function(_0x38c6aa){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x1b4'),_0x38c6aa[_0x4733('0x9e')]));var _0x463038=this[_0x4733('0x1b5')][_0x4733('0x63')](this,_0x38c6aa[_0x4733('0xb0')]);this[_0x4733('0x34')][_0x4733('0x63')](this,_0x38c6aa,_0x38c6aa[_0x4733('0xb0')]);if(this[_0x4733('0x9b')](_0x38c6aa[_0x4733('0xce')])){var _0x1b69b5=this['getVariable'][_0x4733('0x63')](this,_0x38c6aa['variable_id']);if(_0x1b69b5){this[_0x4733('0x10')][_0x4733('0x95')](_0x1b69b5,_0x463038);return this[_0x4733('0x10')][_0x4733('0x9f')](util['format'](_0x4733('0x1b6'),_0x38c6aa[_0x4733('0xb0')],_0x1b69b5));}}return this['channel'][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x1b7'),_0x38c6aa[_0x4733('0xb0')]));};AGIVertices[_0x4733('0x12')][_0x4733('0x1b8')]=function(_0x5187d2){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x1b9'),_0x5187d2['label']));_0x5187d2['text']=_0x5187d2[_0x4733('0x53')][_0x4733('0xcd')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4733('0x9b')](_0x5187d2[_0x4733('0x52')])){return this[_0x4733('0x10')][_0x4733('0x9f')](_0x4733('0x1ba'));}if(!this[_0x4733('0x9b')](_0x5187d2[_0x4733('0x53')])){return this[_0x4733('0x10')]['noop']('no\x20text\x20configured');}this[_0x4733('0x10')][_0x4733('0x9f')](util['format'](_0x4733('0x1bb'),_0x5187d2[_0x4733('0x53')]));var _0x1d9c62=this[_0x4733('0x51')][_0x4733('0x63')](this,_0x5187d2);if(_0x1d9c62){this[_0x4733('0x10')]['noop'](util['format'](_0x4733('0x1bc'),_0x1d9c62));var _0x4eb644=this[_0x4733('0x10')][_0x4733('0xfc')](_0x1d9c62);try{fs[_0x4733('0xfe')](_0x1d9c62+_0x4733('0xff'));}catch(_0x34663d){logger['error'](_0x34663d);}return _0x4eb644;}return this[_0x4733('0x10')]['error'](_0x5187d2,_0x4733('0x1bd'));};AGIVertices[_0x4733('0x12')]['tts']=function(_0x2eb894){logger[_0x4733('0x2e')](util['format'](_0x4733('0x1be'),_0x2eb894[_0x4733('0x9e')]));_0x2eb894[_0x4733('0x53')]=_0x2eb894[_0x4733('0x53')][_0x4733('0xcd')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4733('0x9b')](_0x2eb894[_0x4733('0x53')])){return this['channel'][_0x4733('0x9f')](_0x4733('0xa0'));}this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x1bf'),_0x2eb894[_0x4733('0x53')]));var _0x2dcbf3=this[_0x4733('0x1c0')][_0x4733('0x63')](this,_0x2eb894);if(_0x2dcbf3){this['channel']['noop'](util['format']('Google\x20TTS\x20%s\x20file\x20created',_0x2dcbf3));var _0x26fa96=this[_0x4733('0x10')][_0x4733('0xfc')](_0x2dcbf3);try{fs['unlink'](_0x2dcbf3+_0x4733('0xff'));}catch(_0x1bb902){logger[_0x4733('0x2c')](_0x1bb902);}return _0x26fa96;}return this['channel'][_0x4733('0x2c')](_0x2eb894,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x4733('0x12')][_0x4733('0x1c1')]=function(_0x105e01){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x1c2'),_0x105e01[_0x4733('0x9e')]));if(!this[_0x4733('0x9b')](_0x105e01[_0x4733('0x151')])){return this['channel'][_0x4733('0x2c')](_0x105e01,'no\x20find\x20by\x20configured');}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4733('0x10')][_0x4733('0x38')],_0x105e01[_0x4733('0x151')]));var _0x1795f7=this[_0x4733('0x4c')][_0x4733('0x63')](this,_0x105e01['findBy']);if(_0x1795f7){logger[_0x4733('0x2e')](util['format'](_0x4733('0x150'),this['channel'][_0x4733('0x38')],_0x105e01[_0x4733('0x151')]));this[_0x4733('0x10')][_0x4733('0x9f')](util[_0x4733('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4733('0x10')][_0x4733('0x38')],_0x105e01[_0x4733('0x151')]));return{'code':0xc8,'result':_0x4733('0x152')};}else{logger[_0x4733('0x2e')](util['format'](_0x4733('0x153'),this[_0x4733('0x10')]['callerid'],_0x105e01[_0x4733('0x151')]));this['channel'][_0x4733('0x9f')](util[_0x4733('0x28')](_0x4733('0x153'),this[_0x4733('0x10')]['callerid'],_0x105e01[_0x4733('0x151')]));return{'code':0xc8,'result':_0x4733('0x154')};}};AGIVertices['prototype'][_0x4733('0x1c3')]=function(_0x3dd547){logger[_0x4733('0x2e')](util[_0x4733('0x28')](_0x4733('0x1c4'),_0x3dd547['label']));var _0x920faf=this[_0x4733('0x10')]['exec'](_0x4733('0x1c5'),[_0x3dd547[_0x4733('0x1c6')],_0x3dd547['options']]);if(_0x920faf['result']===-0x1){return _0x920faf;}return this[_0x4733('0x10')]['noop'](util['format'](_0x4733('0x16a'),_0x4733('0x1c5'),_0x3dd547[_0x4733('0x1c6')]));};AGIVertices['prototype']['vswitch']=function(_0x240a30){logger['info'](util['format'](_0x4733('0x1c7'),_0x240a30[_0x4733('0x9e')]));if(!this['isConfigured'](_0x240a30['variable_id'])){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x240a30,_0x4733('0x1a5'));}var _0x2d6a93=this[_0x4733('0x13')][_0x4733('0x63')](this,_0x240a30[_0x4733('0xce')]);if(!_0x2d6a93){return this[_0x4733('0x10')][_0x4733('0x2c')](_0x240a30,_0x4733('0xcf'));}var _0x5ca677=this['channel'][_0x4733('0x13')](_0x2d6a93);return{'code':0xc8,'result':_0x5ca677[_0x4733('0x97')]?_0x5ca677[_0x4733('0x97')]:'-'};};String['prototype'][_0x4733('0x1c8')]=function(_0x272614,_0xc72546){return this[_0x4733('0x96')](_0x272614)[_0x4733('0x1c9')](_0xc72546);};module[_0x4733('0x1ca')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index c893d92..ef5e907 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 _0xbe15=['Auto-Pause','exports','util','lodash','moment','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','hanguprequest','syncHangupRequest','bind','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][TIMERS]','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause'];(function(_0x3a3c43,_0x3f7f95){var _0xa140a2=function(_0x2adff9){while(--_0x2adff9){_0x3a3c43['push'](_0x3a3c43['shift']());}};_0xa140a2(++_0x3f7f95);}(_0xbe15,0xb0));var _0x5be1=function(_0x1c5f5a,_0x5a0a16){_0x1c5f5a=_0x1c5f5a-0x0;var _0x99549f=_0xbe15[_0x1c5f5a];return _0x99549f;};'use strict';var util=require(_0x5be1('0x0'));var _=require(_0x5be1('0x1'));var moment=require(_0x5be1('0x2'));var ami=require('../ami');var logger=require(_0x5be1('0x3'))('acw');var RpcUser=require(_0x5be1('0x4'));var RpcVoiceAgentReport=require(_0x5be1('0x5'));function Acw(_0x54918d){this[_0x5be1('0x6')]=_0x54918d[_0x5be1('0x6')];this['agents']=_0x54918d[_0x5be1('0x7')];this[_0x5be1('0x8')]=_0x54918d[_0x5be1('0x8')];this[_0x5be1('0x9')]={};ami['on']('agentconnect',this[_0x5be1('0xa')]['bind'](this));ami['on'](_0x5be1('0xb'),this[_0x5be1('0xc')][_0x5be1('0xd')](this));ami['on']('hangup',this[_0x5be1('0xe')][_0x5be1('0xd')](this));ami['on'](_0x5be1('0xf'),this[_0x5be1('0x10')][_0x5be1('0xd')](this));ami['on'](_0x5be1('0x11'),this[_0x5be1('0x12')][_0x5be1('0xd')](this));ami['on'](_0x5be1('0x13'),this[_0x5be1('0x14')][_0x5be1('0xd')](this));ami['on'](_0x5be1('0x15'),this[_0x5be1('0x16')][_0x5be1('0xd')](this));}function getDiff(_0x81f5c2){var _0x310da2=moment()[_0x5be1('0x17')](0x0);var _0x3360fc=moment(_0x81f5c2)['milliseconds'](0x0);return _0x310da2[_0x5be1('0x18')](_0x3360fc,_0x5be1('0x19'));}Acw[_0x5be1('0x1a')]['startAcw']=function(_0x249322){try{var _0x45ed44=this;var _0x1c8fd5=this['channels'][_0x249322][_0x5be1('0x1b')];var _0x30fc33=this[_0x5be1('0x9')][_0x249322][_0x5be1('0x1c')];var _0xa7e6ff=this['voiceQueues'][_0x30fc33];var _0x1589ed=![];var _0x440c91=_0x5be1('0x1d');if(_0xa7e6ff[_0x5be1('0x1e')]){if(_0xa7e6ff['mandatoryDispositionPause']['name']){_0x1589ed=!![];_0x440c91=_0xa7e6ff[_0x5be1('0x1f')][_0x5be1('0x20')];}}ami[_0x5be1('0x21')]({'action':_0x5be1('0x22'),'interface':_0x1c8fd5,'paused':!![],'reason':_0x440c91})[_0x5be1('0x23')](function(_0x3b095d){if(_0x45ed44[_0x5be1('0x7')][_0x1c8fd5]){return RpcUser[_0x5be1('0x24')](_0x45ed44[_0x5be1('0x7')][_0x1c8fd5]['id'])[_0x5be1('0x23')](function(_0x3245f7){if(_0x3245f7&&!_0x3245f7[_0x5be1('0x25')]){logger[_0x5be1('0x26')](_0x5be1('0x27'),_0x249322,_0x1c8fd5,_0x30fc33);var _0x1f2953=_0x45ed44[_0x5be1('0x9')][_0x249322][_0x5be1('0x28')]&&_0x45ed44[_0x5be1('0x9')][_0x249322][_0x5be1('0x29')]?_0x45ed44[_0x5be1('0x9')][_0x249322][_0x5be1('0x29')]:_0x249322;return RpcUser[_0x5be1('0x2a')](_0x45ed44[_0x5be1('0x7')][_0x1c8fd5],_0x440c91,_0x1f2953)[_0x5be1('0x23')](function(_0x2b689c){if(!_0x1589ed){_0x45ed44['timers'][_0x1c8fd5]={};logger[_0x5be1('0x26')](_0x5be1('0x2b'),_0x249322,_0x45ed44[_0x5be1('0x6')][_0x30fc33][_0x5be1('0x2c')],_0x1c8fd5,_0x30fc33);_0x45ed44['timers'][_0x1c8fd5][_0x5be1('0x2d')]=setTimeout(_0x45ed44[_0x5be1('0x2e')]['bind'](_0x45ed44,_0x1c8fd5),_0x45ed44[_0x5be1('0x6')][_0x30fc33][_0x5be1('0x2c')]*0x3e8);_0x45ed44['timers'][_0x1c8fd5][_0x5be1('0x2f')]=moment()[_0x5be1('0x30')](_0x5be1('0x31'));_0x45ed44[_0x5be1('0x8')][_0x1c8fd5][_0x5be1('0x32')]=_0x249322;_0x45ed44[_0x5be1('0x8')][_0x1c8fd5][_0x5be1('0x1c')]=_0x30fc33;_0x45ed44[_0x5be1('0x8')][_0x1c8fd5][_0x5be1('0x33')]=function(){var _0x39e263=getDiff(_0x45ed44[_0x5be1('0x8')][_0x1c8fd5][_0x5be1('0x2f')]);clearTimeout(_0x45ed44[_0x5be1('0x8')][_0x1c8fd5]['timer']);_0x45ed44[_0x5be1('0x8')][_0x1c8fd5]['timer']=![];RpcVoiceAgentReport[_0x5be1('0x34')]({'acwtime':_0x39e263},_0x45ed44[_0x5be1('0x8')][_0x1c8fd5][_0x5be1('0x32')],_0x1c8fd5)[_0x5be1('0x23')](function(_0x4ed37b){logger[_0x5be1('0x26')](_0x5be1('0x35'),_0x249322,_0x39e263,_0x4ed37b);})[_0x5be1('0x36')](function(_0x455523){logger['error'](_0x5be1('0x37'),_0x249322,_0x455523);});delete _0x45ed44['timers'][_0x1c8fd5];};}});}else{logger[_0x5be1('0x26')](_0x5be1('0x38'),_0x249322,_0x1c8fd5,_0x30fc33);}});}})[_0x5be1('0x36')](function(_0x137b7b){logger[_0x5be1('0x39')](_0x5be1('0x2b'),_0x249322,_0x45ed44[_0x5be1('0x6')][_0x30fc33][_0x5be1('0x2c')],_0x1c8fd5,_0x30fc33);})[_0x5be1('0x3a')](function(){delete _0x45ed44[_0x5be1('0x9')][_0x249322];});}catch(_0x3821d6){logger[_0x5be1('0x39')](_0x5be1('0x3b'),_0x3821d6[_0x5be1('0x3c')]);}};Acw['prototype'][_0x5be1('0x2e')]=function(_0x1e4859){try{var _0x73f068=this;if(_0x73f068[_0x5be1('0x8')][_0x1e4859]){_0x73f068[_0x5be1('0x8')][_0x1e4859]['timer']=![];var _0x33d60a=_0x73f068[_0x5be1('0x8')][_0x1e4859][_0x5be1('0x32')];var _0x41c083=_0x73f068['timers'][_0x1e4859]['queue'];var _0x32ff28=_0x73f068[_0x5be1('0x6')][_0x41c083][_0x5be1('0x2c')];logger[_0x5be1('0x26')](_0x5be1('0x3d'),_0x33d60a,_0x1e4859);RpcUser[_0x5be1('0x3e')](this[_0x5be1('0x7')][_0x1e4859]);RpcVoiceAgentReport[_0x5be1('0x34')]({'acwtime':_0x32ff28,'agentacw':!![]},_0x33d60a,_0x1e4859)[_0x5be1('0x23')](function(_0x47fd27){logger['info'](_0x5be1('0x35'),_0x33d60a,_0x32ff28,_0x47fd27);})['catch'](function(_0x136448){logger[_0x5be1('0x39')](_0x5be1('0x37'),_0x33d60a,_0x136448);});}else{logger[_0x5be1('0x39')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x1e4859);if(_0x73f068['timers']){logger['info'](_0x5be1('0x3f'),JSON['stringify'](_0x73f068[_0x5be1('0x8')]));}}}catch(_0x49f2ca){logger['error'](_0x5be1('0x40'),_0x49f2ca[_0x5be1('0x3c')]);}};Acw['prototype'][_0x5be1('0xa')]=function(_0x25dbdb){try{if(this[_0x5be1('0x6')][_0x25dbdb[_0x5be1('0x1c')]]&&(this['voiceQueues'][_0x25dbdb[_0x5be1('0x1c')]]['acw']||this[_0x5be1('0x6')][_0x25dbdb[_0x5be1('0x1c')]][_0x5be1('0x1e')])){if(this['agents'][_0x25dbdb[_0x5be1('0x1b')]]){this[_0x5be1('0x9')][_0x25dbdb['uniqueid']]={'queue':_0x25dbdb[_0x5be1('0x1c')],'interface':_0x25dbdb[_0x5be1('0x1b')],'destlinkedid':_0x25dbdb[_0x5be1('0x29')]};}}}catch(_0x21cd4a){logger[_0x5be1('0x39')]('[ACW][syncAgentConnect]\x20%s',_0x21cd4a['message']);}};Acw[_0x5be1('0x1a')][_0x5be1('0x16')]=function(_0x2f971d){try{if(this['voiceQueues'][_0x2f971d[_0x5be1('0x1c')]]&&(this['voiceQueues'][_0x2f971d['queue']][_0x5be1('0x41')]||this[_0x5be1('0x6')][_0x2f971d['queue']]['mandatoryDisposition'])){if(this[_0x5be1('0x7')][_0x2f971d[_0x5be1('0x1b')]]){this[_0x5be1('0x9')][_0x2f971d[_0x5be1('0x32')]]={'queue':_0x2f971d['queue'],'interface':_0x2f971d[_0x5be1('0x1b')]};}}}catch(_0x2a9813){logger[_0x5be1('0x39')](_0x5be1('0x42'),_0x2a9813[_0x5be1('0x3c')]);}};Acw[_0x5be1('0x1a')][_0x5be1('0xc')]=function(_0x8041d7){try{if(this[_0x5be1('0x9')][_0x8041d7[_0x5be1('0x32')]]&&_[_0x5be1('0x43')](this['channels'][_0x8041d7['uniqueid']]['attended'])){logger[_0x5be1('0x26')](_0x5be1('0x44'),_0x8041d7['uniqueid']);this[_0x5be1('0x45')](_0x8041d7[_0x5be1('0x32')]);}else if(this[_0x5be1('0x9')][_0x8041d7[_0x5be1('0x46')]]&&_[_0x5be1('0x43')](this[_0x5be1('0x9')][_0x8041d7[_0x5be1('0x46')]][_0x5be1('0x28')])){logger[_0x5be1('0x26')](_0x5be1('0x47'),_0x8041d7[_0x5be1('0x46')]);this[_0x5be1('0x45')](_0x8041d7[_0x5be1('0x46')]);}}catch(_0x21deb4){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x21deb4[_0x5be1('0x3c')]);}};Acw[_0x5be1('0x1a')][_0x5be1('0xe')]=function(_0x5c9db7){try{if(this['channels'][_0x5c9db7[_0x5be1('0x32')]]&&this[_0x5be1('0x9')][_0x5c9db7[_0x5be1('0x32')]][_0x5be1('0x28')]){logger[_0x5be1('0x26')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5c9db7[_0x5be1('0x32')]);this['startAcw'](_0x5c9db7[_0x5be1('0x32')]);}else if(this[_0x5be1('0x9')][_0x5c9db7[_0x5be1('0x46')]]&&this[_0x5be1('0x9')][_0x5c9db7['linkedid']][_0x5be1('0x28')]){logger[_0x5be1('0x26')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x5c9db7['linkedid']);this['startAcw'](_0x5c9db7[_0x5be1('0x46')]);}}catch(_0x3f9eb9){logger[_0x5be1('0x39')](_0x5be1('0x48'),_0x3f9eb9['message']);}};Acw[_0x5be1('0x1a')]['syncAttendedTransfer']=function(_0x4333ab){try{if(!_[_0x5be1('0x49')](this[_0x5be1('0x9')][_0x4333ab[_0x5be1('0x4a')]])){this[_0x5be1('0x45')](_0x4333ab[_0x5be1('0x4a')]);if(this[_0x5be1('0x9')][_0x4333ab[_0x5be1('0x4b')]]){this['channels'][_0x4333ab[_0x5be1('0x4b')]][_0x5be1('0x28')]=!![];this[_0x5be1('0x9')][_0x4333ab[_0x5be1('0x4c')]]=this[_0x5be1('0x9')][_0x4333ab[_0x5be1('0x4b')]];delete this[_0x5be1('0x9')][_0x4333ab[_0x5be1('0x4b')]];}}else if(!_[_0x5be1('0x49')](this['channels'][_0x4333ab[_0x5be1('0x4c')]])){this[_0x5be1('0x45')](_0x4333ab['transfertargetuniqueid']);if(this['channels'][_0x4333ab[_0x5be1('0x4d')]]){this['channels'][_0x4333ab[_0x5be1('0x4d')]][_0x5be1('0x28')]=!![];this[_0x5be1('0x9')][_0x4333ab['transfereeuniqueid']]=this[_0x5be1('0x9')][_0x4333ab['origtransfereruniqueid']];delete this[_0x5be1('0x9')][_0x4333ab[_0x5be1('0x4d')]];}}}catch(_0x5e1721){logger[_0x5be1('0x39')](_0x5be1('0x4e'),_0x5e1721[_0x5be1('0x3c')]);}};Acw[_0x5be1('0x1a')][_0x5be1('0x14')]=function(_0x3b1ef4){try{if(this[_0x5be1('0x9')][_0x3b1ef4[_0x5be1('0x4f')]]){logger['info'](_0x5be1('0x50'),JSON[_0x5be1('0x51')](_0x3b1ef4[_0x5be1('0x4f')]));this[_0x5be1('0x45')](_0x3b1ef4[_0x5be1('0x4f')]);}else if(this[_0x5be1('0x9')][_0x3b1ef4[_0x5be1('0x52')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x5be1('0x51')](_0x3b1ef4['transfererlinkedid']));this[_0x5be1('0x45')](_0x3b1ef4[_0x5be1('0x52')]);}}catch(_0x40e824){logger['error'](_0x5be1('0x53'),_0x40e824[_0x5be1('0x3c')]);}};Acw[_0x5be1('0x1a')][_0x5be1('0x10')]=function(_0x64db1e){try{if(this['voiceQueues'][_0x64db1e['queue']]&&this[_0x5be1('0x6')][_0x64db1e[_0x5be1('0x1c')]][_0x5be1('0x54')]==='all'){if(this[_0x5be1('0x7')][_0x64db1e['interface']]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x64db1e['uniqueid'],_0x64db1e[_0x5be1('0x1b')],_0x64db1e[_0x5be1('0x1c')]);return RpcUser[_0x5be1('0x2a')](this[_0x5be1('0x7')][_0x64db1e[_0x5be1('0x1b')]],_0x5be1('0x55'),_0x64db1e[_0x5be1('0x32')]);}}}catch(_0x191752){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x191752['message']);}};module[_0x5be1('0x56')]=Acw; \ No newline at end of file +var _0x478d=['info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','update','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','prototype','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','isNil','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','startAcw','interface','queue','ACW','mandatoryDisposition','name','Action','then','getAgent','voicePause'];(function(_0x2cf064,_0x206ccc){var _0x42bfaf=function(_0x113614){while(--_0x113614){_0x2cf064['push'](_0x2cf064['shift']());}};_0x42bfaf(++_0x206ccc);}(_0x478d,0x1eb));var _0xd478=function(_0x58f686,_0x3440e2){_0x58f686=_0x58f686-0x0;var _0x3c82b9=_0x478d[_0x58f686];return _0x3c82b9;};'use strict';var util=require(_0xd478('0x0'));var _=require(_0xd478('0x1'));var moment=require(_0xd478('0x2'));var ami=require('../ami');var logger=require(_0xd478('0x3'))(_0xd478('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xd478('0x5'));function Acw(_0x48b647){this[_0xd478('0x6')]=_0x48b647[_0xd478('0x6')];this['agents']=_0x48b647[_0xd478('0x7')];this[_0xd478('0x8')]=_0x48b647[_0xd478('0x8')];this[_0xd478('0x9')]={};ami['on'](_0xd478('0xa'),this[_0xd478('0xb')][_0xd478('0xc')](this));ami['on'](_0xd478('0xd'),this[_0xd478('0xe')][_0xd478('0xc')](this));ami['on'](_0xd478('0xf'),this[_0xd478('0x10')][_0xd478('0xc')](this));ami['on'](_0xd478('0x11'),this[_0xd478('0x12')][_0xd478('0xc')](this));ami['on'](_0xd478('0x13'),this[_0xd478('0x14')][_0xd478('0xc')](this));ami['on'](_0xd478('0x15'),this[_0xd478('0x16')][_0xd478('0xc')](this));ami['on'](_0xd478('0x17'),this[_0xd478('0x18')][_0xd478('0xc')](this));}function getDiff(_0x4d83c3){var _0x56c3a1=moment()[_0xd478('0x19')](0x0);var _0xf51d70=moment(_0x4d83c3)[_0xd478('0x19')](0x0);return _0x56c3a1[_0xd478('0x1a')](_0xf51d70,'seconds');}Acw['prototype'][_0xd478('0x1b')]=function(_0x1a569a){try{var _0x5f2510=this;var _0x276531=this['channels'][_0x1a569a][_0xd478('0x1c')];var _0x40e5c1=this['channels'][_0x1a569a][_0xd478('0x1d')];var _0x352378=this[_0xd478('0x6')][_0x40e5c1];var _0x1d8d61=![];var _0x4f67e4=_0xd478('0x1e');if(_0x352378[_0xd478('0x1f')]){if(_0x352378['mandatoryDispositionPause'][_0xd478('0x20')]){_0x1d8d61=!![];_0x4f67e4=_0x352378['mandatoryDispositionPause'][_0xd478('0x20')];}}ami[_0xd478('0x21')]({'action':'QueuePause','interface':_0x276531,'paused':!![],'reason':_0x4f67e4})[_0xd478('0x22')](function(_0x1f3f9a){if(_0x5f2510[_0xd478('0x7')][_0x276531]){return RpcUser[_0xd478('0x23')](_0x5f2510[_0xd478('0x7')][_0x276531]['id'])[_0xd478('0x22')](function(_0x4983e0){if(_0x4983e0&&!_0x4983e0[_0xd478('0x24')]){logger[_0xd478('0x25')](_0xd478('0x26'),_0x1a569a,_0x276531,_0x40e5c1);var _0x32df40=_0x5f2510['channels'][_0x1a569a][_0xd478('0x27')]&&_0x5f2510[_0xd478('0x9')][_0x1a569a][_0xd478('0x28')]?_0x5f2510[_0xd478('0x9')][_0x1a569a]['destlinkedid']:_0x1a569a;return RpcUser['savePause'](_0x5f2510[_0xd478('0x7')][_0x276531],_0x4f67e4,_0x32df40)[_0xd478('0x22')](function(_0x51ba67){if(!_0x1d8d61){_0x5f2510[_0xd478('0x8')][_0x276531]={};logger[_0xd478('0x25')](_0xd478('0x29'),_0x1a569a,_0x5f2510[_0xd478('0x6')][_0x40e5c1][_0xd478('0x2a')],_0x276531,_0x40e5c1);_0x5f2510[_0xd478('0x8')][_0x276531][_0xd478('0x2b')]=setTimeout(_0x5f2510[_0xd478('0x2c')][_0xd478('0xc')](_0x5f2510,_0x276531),_0x5f2510[_0xd478('0x6')][_0x40e5c1][_0xd478('0x2a')]*0x3e8);_0x5f2510[_0xd478('0x8')][_0x276531][_0xd478('0x2d')]=moment()[_0xd478('0x2e')](_0xd478('0x2f'));_0x5f2510[_0xd478('0x8')][_0x276531][_0xd478('0x30')]=_0x1a569a;_0x5f2510[_0xd478('0x8')][_0x276531][_0xd478('0x1d')]=_0x40e5c1;_0x5f2510[_0xd478('0x8')][_0x276531][_0xd478('0x31')]=function(){var _0x297cd9=getDiff(_0x5f2510[_0xd478('0x8')][_0x276531]['lastPauseAt']);clearTimeout(_0x5f2510[_0xd478('0x8')][_0x276531][_0xd478('0x2b')]);_0x5f2510[_0xd478('0x8')][_0x276531][_0xd478('0x2b')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x297cd9},_0x5f2510['timers'][_0x276531][_0xd478('0x30')],_0x276531)[_0xd478('0x22')](function(_0x5e4b6a){logger[_0xd478('0x25')](_0xd478('0x32'),_0x1a569a,_0x297cd9,_0x5e4b6a);})[_0xd478('0x33')](function(_0x27a64e){logger[_0xd478('0x34')](_0xd478('0x35'),_0x1a569a,_0x27a64e);});delete _0x5f2510['timers'][_0x276531];};}});}else{logger[_0xd478('0x25')](_0xd478('0x36'),_0x1a569a,_0x276531,_0x40e5c1);}});}})[_0xd478('0x33')](function(_0x3cde04){logger['error'](_0xd478('0x29'),_0x1a569a,_0x5f2510['voiceQueues'][_0x40e5c1][_0xd478('0x2a')],_0x276531,_0x40e5c1);})[_0xd478('0x37')](function(){delete _0x5f2510[_0xd478('0x9')][_0x1a569a];});}catch(_0x2cbbfd){logger[_0xd478('0x34')](_0xd478('0x38'),_0x2cbbfd[_0xd478('0x39')]);}};Acw['prototype'][_0xd478('0x2c')]=function(_0x199368){try{var _0x2d9da3=this;if(_0x2d9da3[_0xd478('0x8')][_0x199368]){_0x2d9da3[_0xd478('0x8')][_0x199368][_0xd478('0x2b')]=![];var _0x24147c=_0x2d9da3[_0xd478('0x8')][_0x199368][_0xd478('0x30')];var _0x51f63e=_0x2d9da3['timers'][_0x199368][_0xd478('0x1d')];var _0xc9df31=_0x2d9da3[_0xd478('0x6')][_0x51f63e][_0xd478('0x2a')];logger[_0xd478('0x25')]('[%s][TIMER][STOP][AGENT:%s]',_0x24147c,_0x199368);RpcUser['saveUnpause'](this[_0xd478('0x7')][_0x199368]);RpcVoiceAgentReport[_0xd478('0x3a')]({'acwtime':_0xc9df31,'agentacw':!![]},_0x24147c,_0x199368)[_0xd478('0x22')](function(_0x12f019){logger[_0xd478('0x25')](_0xd478('0x32'),_0x24147c,_0xc9df31,_0x12f019);})[_0xd478('0x33')](function(_0x1f2f50){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x24147c,_0x1f2f50);});}else{logger[_0xd478('0x34')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x199368);if(_0x2d9da3[_0xd478('0x8')]){logger[_0xd478('0x25')](_0xd478('0x3b'),JSON[_0xd478('0x3c')](_0x2d9da3[_0xd478('0x8')]));}}}catch(_0x4b9875){logger[_0xd478('0x34')](_0xd478('0x3d'),_0x4b9875[_0xd478('0x39')]);}};Acw[_0xd478('0x3e')]['syncAgentConnect']=function(_0x4cff7d){try{if(this[_0xd478('0x6')][_0x4cff7d['queue']]&&(this[_0xd478('0x6')][_0x4cff7d[_0xd478('0x1d')]][_0xd478('0x4')]||this['voiceQueues'][_0x4cff7d[_0xd478('0x1d')]]['mandatoryDisposition'])){if(this['agents'][_0x4cff7d[_0xd478('0x1c')]]){this[_0xd478('0x9')][_0x4cff7d[_0xd478('0x30')]]={'queue':_0x4cff7d[_0xd478('0x1d')],'interface':_0x4cff7d[_0xd478('0x1c')],'destlinkedid':_0x4cff7d[_0xd478('0x28')]};}}}catch(_0x3ad3a8){logger[_0xd478('0x34')](_0xd478('0x3f'),_0x3ad3a8[_0xd478('0x39')]);}};Acw[_0xd478('0x3e')]['syncAgentConnectPreview']=function(_0x3df7e0){try{if(this[_0xd478('0x6')][_0x3df7e0[_0xd478('0x1d')]]&&(this[_0xd478('0x6')][_0x3df7e0[_0xd478('0x1d')]][_0xd478('0x4')]||this[_0xd478('0x6')][_0x3df7e0[_0xd478('0x1d')]][_0xd478('0x1f')])){if(this[_0xd478('0x7')][_0x3df7e0[_0xd478('0x1c')]]){this[_0xd478('0x9')][_0x3df7e0[_0xd478('0x30')]]={'queue':_0x3df7e0[_0xd478('0x1d')],'interface':_0x3df7e0[_0xd478('0x1c')]};}}}catch(_0x24228e){logger[_0xd478('0x34')](_0xd478('0x40'),_0x24228e[_0xd478('0x39')]);}};Acw[_0xd478('0x3e')][_0xd478('0xe')]=function(_0x4d761c){try{if(this[_0xd478('0x9')][_0x4d761c[_0xd478('0x30')]]&&_[_0xd478('0x41')](this[_0xd478('0x9')][_0x4d761c[_0xd478('0x30')]][_0xd478('0x27')])){logger[_0xd478('0x25')](_0xd478('0x42'),_0x4d761c['uniqueid']);this[_0xd478('0x1b')](_0x4d761c[_0xd478('0x30')]);}else if(this[_0xd478('0x9')][_0x4d761c[_0xd478('0x43')]]&&_[_0xd478('0x41')](this[_0xd478('0x9')][_0x4d761c['linkedid']][_0xd478('0x27')])){logger[_0xd478('0x25')](_0xd478('0x44'),_0x4d761c['linkedid']);this[_0xd478('0x1b')](_0x4d761c[_0xd478('0x43')]);}}catch(_0x413290){logger[_0xd478('0x34')]('[ACW][syncHangupRequest]\x20%s',_0x413290[_0xd478('0x39')]);}};Acw[_0xd478('0x3e')][_0xd478('0x10')]=function(_0x194a9a){try{if(this[_0xd478('0x9')][_0x194a9a['uniqueid']]&&this['channels'][_0x194a9a[_0xd478('0x30')]][_0xd478('0x27')]){logger[_0xd478('0x25')](_0xd478('0x45'),_0x194a9a[_0xd478('0x30')]);this['startAcw'](_0x194a9a[_0xd478('0x30')]);}else if(this[_0xd478('0x9')][_0x194a9a[_0xd478('0x43')]]&&this[_0xd478('0x9')][_0x194a9a['linkedid']][_0xd478('0x27')]){logger[_0xd478('0x25')](_0xd478('0x46'),_0x194a9a['linkedid']);this['startAcw'](_0x194a9a[_0xd478('0x43')]);}}catch(_0x13a191){logger[_0xd478('0x34')](_0xd478('0x47'),_0x13a191[_0xd478('0x39')]);}};Acw[_0xd478('0x3e')]['syncAttendedTransfer']=function(_0x9cf15b){try{if(!_['isNil'](this[_0xd478('0x9')][_0x9cf15b[_0xd478('0x48')]])){this['startAcw'](_0x9cf15b[_0xd478('0x48')]);if(this[_0xd478('0x9')][_0x9cf15b[_0xd478('0x49')]]){this[_0xd478('0x9')][_0x9cf15b[_0xd478('0x49')]][_0xd478('0x27')]=!![];this[_0xd478('0x9')][_0x9cf15b['transfertargetuniqueid']]=this[_0xd478('0x9')][_0x9cf15b['secondtransfereruniqueid']];delete this[_0xd478('0x9')][_0x9cf15b['secondtransfereruniqueid']];}}else if(!_[_0xd478('0x4a')](this[_0xd478('0x9')][_0x9cf15b[_0xd478('0x4b')]])){this[_0xd478('0x1b')](_0x9cf15b[_0xd478('0x4b')]);if(this[_0xd478('0x9')][_0x9cf15b['origtransfereruniqueid']]){this[_0xd478('0x9')][_0x9cf15b[_0xd478('0x4c')]]['attended']=!![];this[_0xd478('0x9')][_0x9cf15b[_0xd478('0x48')]]=this[_0xd478('0x9')][_0x9cf15b['origtransfereruniqueid']];delete this['channels'][_0x9cf15b[_0xd478('0x4c')]];}}}catch(_0x2ebd8a){logger[_0xd478('0x34')]('[ACW][syncAttendedTransfer]\x20%s',_0x2ebd8a[_0xd478('0x39')]);}};Acw[_0xd478('0x3e')]['syncBlindTransfer']=function(_0x1a9a95){try{if(this[_0xd478('0x9')][_0x1a9a95['transfereruniqueid']]){logger[_0xd478('0x25')](_0xd478('0x4d'),JSON[_0xd478('0x3c')](_0x1a9a95[_0xd478('0x4e')]));this['startAcw'](_0x1a9a95[_0xd478('0x4e')]);}else if(this[_0xd478('0x9')][_0x1a9a95['transfererlinkedid']]){logger[_0xd478('0x25')](_0xd478('0x4f'),JSON['stringify'](_0x1a9a95['transfererlinkedid']));this[_0xd478('0x1b')](_0x1a9a95[_0xd478('0x50')]);}}catch(_0x31b94b){logger[_0xd478('0x34')](_0xd478('0x51'),_0x31b94b[_0xd478('0x39')]);}};Acw['prototype'][_0xd478('0x12')]=function(_0x394da1){try{if(this['voiceQueues'][_0x394da1[_0xd478('0x1d')]]&&this[_0xd478('0x6')][_0x394da1[_0xd478('0x1d')]][_0xd478('0x52')]===_0xd478('0x53')){if(this['agents'][_0x394da1[_0xd478('0x1c')]]){logger['info'](_0xd478('0x54'),_0x394da1[_0xd478('0x30')],_0x394da1[_0xd478('0x1c')],_0x394da1[_0xd478('0x1d')]);return RpcUser['savePause'](this[_0xd478('0x7')][_0x394da1['interface']],_0xd478('0x55'),_0x394da1[_0xd478('0x30')]);}}}catch(_0x5ca548){logger[_0xd478('0x34')](_0xd478('0x56'),_0x5ca548['message']);}};module[_0xd478('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 7dafdee..7d0adda 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 _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x329002,_0x5a2640){var _0x177655=function(_0x45ee0c){while(--_0x45ee0c){_0x329002['push'](_0x329002['shift']());}};_0x177655(++_0x5a2640);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0x0b0e[_0x3b7a0c];return _0x3bb70f;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),close);module['exports']=ami; \ No newline at end of file +var _0xb7e7=['username','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','moment','lodash','ami','asterisk','port','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x3ff2ae,_0x49e3df){var _0x1f2e95=function(_0x15d1ee){while(--_0x15d1ee){_0x3ff2ae['push'](_0x3ff2ae['shift']());}};_0x1f2e95(++_0x49e3df);}(_0xb7e7,0x121));var _0x7b7e=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xb7e7[_0x174ef5];return _0x1cc379;};'use strict';var Manager=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var moment=require(_0x7b7e('0x1'));var util=require('util');var _=require(_0x7b7e('0x2'));var logger=require('../../config/logger')(_0x7b7e('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x7b7e('0x4')][_0x7b7e('0x5')],config[_0x7b7e('0x4')]['ip'],config['asterisk']['username'],config[_0x7b7e('0x4')][_0x7b7e('0x6')],!![]);ami[_0x7b7e('0x7')]();ami['Action']=BPromise[_0x7b7e('0x8')](ami[_0x7b7e('0x9')]);function error(_0x2917f9){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xc'),config[_0x7b7e('0x4')]['username'],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x2917f9,![],null)));}function close(){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xe'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x11')});};};ami[_0x7b7e('0x12')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x7b7e('0x14')});};};ami[_0x7b7e('0x15')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x16')});};};function connect(_0x2cc400){logger[_0x7b7e('0x17')](util[_0x7b7e('0xb')](_0x7b7e('0x18'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')](_0x7b7e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x7b7e('0x1b'),function(_0x43db4f){logger[_0x7b7e('0x17')](util['format'](_0x7b7e('0x1c'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x43db4f,![],null)));});ami['on'](_0x7b7e('0x1d'),function(_0x53bbb3){logger['info'](util['format'](_0x7b7e('0x1e'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x7b7e('0x1f')]()[_0x7b7e('0x20')](ami[_0x7b7e('0x21')]())[_0x7b7e('0x20')](ami[_0x7b7e('0x22')]())['then'](ami[_0x7b7e('0x12')]())[_0x7b7e('0x20')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7b7e('0x23')](function(_0x423832){logger['error'](_0x7b7e('0x24'),util['inspect'](_0x423832,{'showHidden':![],'depth':null}));});});ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')]('close',close);module[_0x7b7e('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 0181264..9623330 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 _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x242a98,_0x13988e){var _0x580999=function(_0x341927){while(--_0x341927){_0x242a98['push'](_0x242a98['shift']());}};_0x580999(++_0x13988e);}(_0xe706,0xa3));var _0x6e70=function(_0x1e8219,_0x31b4a0){_0x1e8219=_0x1e8219-0x0;var _0x37d537=_0xe706[_0x1e8219];return _0x37d537;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file +var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x1a2c2b,_0x530c67){var _0x4c9b3a=function(_0x1262eb){while(--_0x1262eb){_0x1a2c2b['push'](_0x1a2c2b['shift']());}};_0x4c9b3a(++_0x530c67);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x4d5d28,_0x26bd9b){_0x4d5d28=_0x4d5d28-0x0;var _0x2026b1=_0xbdb7[_0x4d5d28];return _0x2026b1;};'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 diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 782f37a..76ec66b 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x566a=['substring','getQueue','queue','util','moment','isNil','string','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number'];(function(_0x50bb41,_0x4da1d6){var _0x512809=function(_0x5019f8){while(--_0x5019f8){_0x50bb41['push'](_0x50bb41['shift']());}};_0x512809(++_0x4da1d6);}(_0x566a,0xe4));var _0xa566=function(_0x28e4a3,_0x271bad){_0x28e4a3=_0x28e4a3-0x0;var _0x43b001=_0x566a[_0x28e4a3];return _0x43b001;};'use strict';var util=require(_0xa566('0x0'));var _=require('lodash');var moment=require(_0xa566('0x1'));function checkNameSurname(_0x44a2f4,_0x525067,_0x30fcb3){var _0x4b9a83='';if(!_[_0xa566('0x2')](_0x525067)&&_0xa566('0x3')===typeof _0x525067){_0x4b9a83+=_0x525067;}if(!_[_0xa566('0x2')](_0x30fcb3)&&_0xa566('0x3')===typeof _0x30fcb3){_0x4b9a83+='\x20'+_0x30fcb3;}if(_0x4b9a83!==''){return _0x4b9a83;}return _0x44a2f4;}function Action(_0x1fdd45,_0x1423a4,_0x2d5d75){this[_0xa566('0x4')]=_0x1fdd45;this[_0xa566('0x5')]=_0x2d5d75||undefined;this[_0xa566('0x6')]=checkNameSurname(_0x1423a4['Contact'][_0xa566('0x7')],_0x1423a4[_0xa566('0x8')][_0xa566('0x9')],_0x1423a4[_0xa566('0x8')][_0xa566('0xa')]);this['number']=_0x1423a4[_0xa566('0x7')];this['queue']=_0x1fdd45[_0xa566('0x6')];this[_0xa566('0xb')]=_0x1423a4[_0xa566('0xb')]||![];this['type']=_0x1fdd45[_0xa566('0xc')];this[_0xa566('0xd')]=_0x1fdd45['dialQueueTimeout']||0x3;this[_0xa566('0xe')]=_0x1423a4['scheduledat'];this[_0xa566('0xf')]=_0x1423a4[_0xa566('0xf')];this['countcongestionretry']=_0x1423a4['countcongestionretry'];this[_0xa566('0x10')]=_0x1423a4['countnoanswerretry'];this['countnosuchnumberretry']=_0x1423a4[_0xa566('0x11')];this[_0xa566('0x12')]=_0x1423a4[_0xa566('0x12')];this['countabandonedretry']=_0x1423a4[_0xa566('0x13')];this[_0xa566('0x14')]=_0x1423a4[_0xa566('0x14')];this['countagentrejectretry']=_0x1423a4[_0xa566('0x15')];this['ContactId']=_0x1423a4[_0xa566('0x16')];this['ListId']=_0x1423a4[_0xa566('0x17')];this[_0xa566('0x18')]=_0x1423a4['UserId'];this[_0xa566('0x19')]=_0x1423a4[_0xa566('0x19')];this[_0xa566('0x1a')]=_0x1423a4[_0xa566('0x1a')];this[_0xa566('0x1b')]=_0x1423a4['id'];this[_0xa566('0x1c')]=_0x1423a4[_0xa566('0x8')][_0xa566('0x9')]||'';this[_0xa566('0x1d')]=moment()[_0xa566('0x1e')](_0xa566('0x1f'));this[_0xa566('0x20')]=_0x1423a4[_0xa566('0x20')];this['callbackuniqueid']=_0x1423a4[_0xa566('0x21')];this['callbackat']=_0x1423a4['callbackat'];this[_0xa566('0x22')]=_0x1423a4['recallme'];this[_0xa566('0x23')]='';this[_0xa566('0x24')]='';}Action[_0xa566('0x25')][_0xa566('0x26')]=function(){return util[_0xa566('0x1e')](_0xa566('0x27'),this[_0xa566('0x6')],this['voiceQueue'][_0xa566('0x28')]>0x0?this[_0xa566('0x29')][_0xa566('0x2a')](this[_0xa566('0x4')]['dialCutDigit']):this[_0xa566('0x29')]);};Action[_0xa566('0x25')][_0xa566('0x2b')]=function(){return this[_0xa566('0x2c')];};module['exports']=Action; \ No newline at end of file +var _0x69ea=['countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','firstName','starttime','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','name','dialCutDigit','substring','util','lodash','isNil','string','voiceQueue','uniqueid','phone','Contact','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x4e1026,_0xfd377){var _0x42ab92=function(_0x600ee4){while(--_0x600ee4){_0x4e1026['push'](_0x4e1026['shift']());}};_0x42ab92(++_0xfd377);}(_0x69ea,0xe8));var _0xa69e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x69ea[_0x59ee6f];return _0x4c0979;};'use strict';var util=require(_0xa69e('0x0'));var _=require(_0xa69e('0x1'));var moment=require('moment');function checkNameSurname(_0x5baf44,_0x32803a,_0x9c66d8){var _0x3e0aae='';if(!_[_0xa69e('0x2')](_0x32803a)&&_0xa69e('0x3')===typeof _0x32803a){_0x3e0aae+=_0x32803a;}if(!_[_0xa69e('0x2')](_0x9c66d8)&&'string'===typeof _0x9c66d8){_0x3e0aae+='\x20'+_0x9c66d8;}if(_0x3e0aae!==''){return _0x3e0aae;}return _0x5baf44;}function Action(_0x15a6d2,_0x1a3e60,_0xc6e54f){this[_0xa69e('0x4')]=_0x15a6d2;this[_0xa69e('0x5')]=_0xc6e54f||undefined;this['name']=checkNameSurname(_0x1a3e60['Contact'][_0xa69e('0x6')],_0x1a3e60['Contact']['firstName'],_0x1a3e60[_0xa69e('0x7')][_0xa69e('0x8')]);this[_0xa69e('0x9')]=_0x1a3e60[_0xa69e('0x6')];this[_0xa69e('0xa')]=_0x15a6d2['name'];this['active']=_0x1a3e60[_0xa69e('0xb')]||![];this[_0xa69e('0xc')]=_0x15a6d2[_0xa69e('0xc')];this[_0xa69e('0xd')]=_0x15a6d2[_0xa69e('0xd')]||0x3;this[_0xa69e('0xe')]=_0x1a3e60[_0xa69e('0xe')];this[_0xa69e('0xf')]=_0x1a3e60[_0xa69e('0xf')];this[_0xa69e('0x10')]=_0x1a3e60[_0xa69e('0x10')];this[_0xa69e('0x11')]=_0x1a3e60['countnoanswerretry'];this[_0xa69e('0x12')]=_0x1a3e60[_0xa69e('0x12')];this[_0xa69e('0x13')]=_0x1a3e60[_0xa69e('0x13')];this[_0xa69e('0x14')]=_0x1a3e60[_0xa69e('0x14')];this[_0xa69e('0x15')]=_0x1a3e60[_0xa69e('0x15')];this[_0xa69e('0x16')]=_0x1a3e60['countagentrejectretry'];this[_0xa69e('0x17')]=_0x1a3e60['ContactId'];this[_0xa69e('0x18')]=_0x1a3e60[_0xa69e('0x18')];this[_0xa69e('0x19')]=_0x1a3e60['UserId'];this[_0xa69e('0x1a')]=_0x1a3e60['VoiceQueueId'];this['CampaignId']=_0x1a3e60['CampaignId'];this[_0xa69e('0x1b')]=_0x1a3e60['id'];this['ContactFirstName']=_0x1a3e60[_0xa69e('0x7')][_0xa69e('0x1c')]||'';this[_0xa69e('0x1d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xa69e('0x1e')]=_0x1a3e60[_0xa69e('0x1e')];this[_0xa69e('0x1f')]=_0x1a3e60[_0xa69e('0x1f')];this['callbackat']=_0x1a3e60[_0xa69e('0x20')];this[_0xa69e('0x21')]=_0x1a3e60['recallme'];this[_0xa69e('0x22')]='';this[_0xa69e('0x23')]='';}Action[_0xa69e('0x24')][_0xa69e('0x25')]=function(){return util['format'](_0xa69e('0x26'),this[_0xa69e('0x27')],this[_0xa69e('0x4')][_0xa69e('0x28')]>0x0?this[_0xa69e('0x9')][_0xa69e('0x29')](this['voiceQueue'][_0xa69e('0x28')]):this[_0xa69e('0x9')]);};Action[_0xa69e('0x24')]['getQueue']=function(){return this[_0xa69e('0xa')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index af67da1..1728882 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1f1=['responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','answertime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','state','statedesc','Answer','type','campaigntype','outbound','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','starttime'];(function(_0x3fa3f7,_0x985562){var _0x4bbaa0=function(_0x1b21eb){while(--_0x1b21eb){_0x3fa3f7['push'](_0x3fa3f7['shift']());}};_0x4bbaa0(++_0x985562);}(_0xd1f1,0xbc));var _0x1d1f=function(_0x2b2b33,_0x56606f){_0x2b2b33=_0x2b2b33-0x0;var _0x229157=_0xd1f1[_0x2b2b33];return _0x229157;};'use strict';var util=require(_0x1d1f('0x0'));var _=require(_0x1d1f('0x1'));var moment=require('moment');function getSeconds(_0x3c29ba,_0x28750f){var _0x346c36=moment(_0x3c29ba)[_0x1d1f('0x2')](0x0);var _0x402c84=moment(_0x28750f)[_0x1d1f('0x2')](0x0);return _0x346c36[_0x1d1f('0x3')](_0x402c84,'seconds');}function AgentComplete(_0x11f303,_0x246882){this[_0x1d1f('0x4')]=0x4;this[_0x1d1f('0x5')]=_0x1d1f('0x6');this['scheduledat']=_0x11f303['scheduledat'];this['type']=_0x11f303[_0x1d1f('0x7')];this[_0x1d1f('0x8')]=_0x11f303[_0x1d1f('0x7')]===_0x1d1f('0x9')?'queue':_0x11f303[_0x1d1f('0x7')];this[_0x1d1f('0xa')]=_0x11f303[_0x1d1f('0xa')];this[_0x1d1f('0xb')]=_0x11f303[_0x1d1f('0xb')];this['countnoanswerretry']=_0x11f303['countnoanswerretry'];this[_0x1d1f('0xc')]=_0x11f303[_0x1d1f('0xa')]+_0x11f303['countcongestionretry']+_0x11f303[_0x1d1f('0xd')]+_0x11f303[_0x1d1f('0xe')]+_0x11f303[_0x1d1f('0xf')]+_0x11f303[_0x1d1f('0x10')]+_0x11f303['countmachineretry']+_0x11f303[_0x1d1f('0x11')];this[_0x1d1f('0xe')]=_0x11f303[_0x1d1f('0xe')];this[_0x1d1f('0xf')]=_0x11f303[_0x1d1f('0xf')];this[_0x1d1f('0x10')]=_0x11f303[_0x1d1f('0x10')];this[_0x1d1f('0x12')]=_0x11f303[_0x1d1f('0x12')];this[_0x1d1f('0x11')]=_0x11f303[_0x1d1f('0x11')];this[_0x1d1f('0x13')]=_0x246882[_0x1d1f('0x13')];this[_0x1d1f('0x14')]=_0x11f303['name'];this['calleridnum']=_0x11f303['number'];this[_0x1d1f('0x15')]=_0x11f303['starttime'];this[_0x1d1f('0x16')]=_0x11f303['responsetime'];this['answertime']=_0x11f303['answertime'];this[_0x1d1f('0x17')]=moment()['format'](_0x1d1f('0x18'));this[_0x1d1f('0x19')]=getSeconds(_0x11f303[_0x1d1f('0x16')],_0x11f303[_0x1d1f('0x15')]);this['holdtime']=getSeconds(_0x11f303['answertime'],_0x11f303[_0x1d1f('0x16')]);this['talktime']=getSeconds(this[_0x1d1f('0x17')],_0x11f303[_0x1d1f('0x1a')]);this[_0x1d1f('0x1b')]=_0x246882[_0x1d1f('0x1b')];this[_0x1d1f('0x1c')]=_0x246882[_0x1d1f('0x1c')];this['reason']=_0x246882[_0x1d1f('0x1d')];this[_0x1d1f('0x1e')]=_0x11f303['callback'];this[_0x1d1f('0x1f')]=_0x11f303[_0x1d1f('0x1f')];this[_0x1d1f('0x20')]=_0x11f303['callbackat'];this[_0x1d1f('0x21')]=_0x11f303[_0x1d1f('0x21')];this[_0x1d1f('0x22')]=_0x11f303['ContactId'];this[_0x1d1f('0x23')]=_0x11f303[_0x1d1f('0x23')];this[_0x1d1f('0x24')]=_0x11f303['UserId'];this[_0x1d1f('0x25')]=_0x11f303[_0x1d1f('0x25')];this[_0x1d1f('0x26')]=_0x11f303[_0x1d1f('0x26')];this[_0x1d1f('0x27')]=_0x11f303['originatecalleridnum']||'';this['originatecalleridname']=_0x11f303[_0x1d1f('0x28')]||'';}module[_0x1d1f('0x29')]=AgentComplete; \ No newline at end of file +var _0xd742=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue'];(function(_0x23cbe7,_0xc9c60e){var _0x4ccfa5=function(_0x5b4cd2){while(--_0x5b4cd2){_0x23cbe7['push'](_0x23cbe7['shift']());}};_0x4ccfa5(++_0xc9c60e);}(_0xd742,0x7e));var _0x2d74=function(_0x37be7e,_0x50ca31){_0x37be7e=_0x37be7e-0x0;var _0x54958b=_0xd742[_0x37be7e];return _0x54958b;};'use strict';var util=require('util');var _=require(_0x2d74('0x0'));var moment=require(_0x2d74('0x1'));function getSeconds(_0x1a260d,_0x189f66){var _0x2bcf01=moment(_0x1a260d)[_0x2d74('0x2')](0x0);var _0x255a3b=moment(_0x189f66)[_0x2d74('0x2')](0x0);return _0x2bcf01[_0x2d74('0x3')](_0x255a3b,'seconds');}function AgentComplete(_0x1d01c3,_0x34c837){this[_0x2d74('0x4')]=0x4;this[_0x2d74('0x5')]=_0x2d74('0x6');this[_0x2d74('0x7')]=_0x1d01c3[_0x2d74('0x7')];this[_0x2d74('0x8')]=_0x1d01c3[_0x2d74('0x8')];this[_0x2d74('0x9')]=_0x1d01c3[_0x2d74('0x8')]===_0x2d74('0xa')?_0x2d74('0xb'):_0x1d01c3[_0x2d74('0x8')];this[_0x2d74('0xc')]=_0x1d01c3['countbusyretry'];this['countcongestionretry']=_0x1d01c3[_0x2d74('0xd')];this[_0x2d74('0xe')]=_0x1d01c3[_0x2d74('0xe')];this[_0x2d74('0xf')]=_0x1d01c3[_0x2d74('0xc')]+_0x1d01c3[_0x2d74('0xd')]+_0x1d01c3[_0x2d74('0xe')]+_0x1d01c3[_0x2d74('0x10')]+_0x1d01c3[_0x2d74('0x11')]+_0x1d01c3[_0x2d74('0x12')]+_0x1d01c3[_0x2d74('0x13')]+_0x1d01c3[_0x2d74('0x14')];this['countnosuchnumberretry']=_0x1d01c3['countnosuchnumberretry'];this[_0x2d74('0x11')]=_0x1d01c3['countdropretry'];this[_0x2d74('0x12')]=_0x1d01c3[_0x2d74('0x12')];this[_0x2d74('0x13')]=_0x1d01c3[_0x2d74('0x13')];this[_0x2d74('0x14')]=_0x1d01c3['countagentrejectretry'];this[_0x2d74('0x15')]=_0x34c837['uniqueid'];this['calleridname']=_0x1d01c3[_0x2d74('0x16')];this['calleridnum']=_0x1d01c3[_0x2d74('0x17')];this[_0x2d74('0x18')]=_0x1d01c3['starttime'];this[_0x2d74('0x19')]=_0x1d01c3[_0x2d74('0x19')];this[_0x2d74('0x1a')]=_0x1d01c3[_0x2d74('0x1a')];this[_0x2d74('0x1b')]=moment()[_0x2d74('0x1c')](_0x2d74('0x1d'));this['ringtime']=getSeconds(_0x1d01c3['responsetime'],_0x1d01c3['starttime']);this[_0x2d74('0x1e')]=getSeconds(_0x1d01c3['answertime'],_0x1d01c3[_0x2d74('0x19')]);this[_0x2d74('0x1f')]=getSeconds(this[_0x2d74('0x1b')],_0x1d01c3[_0x2d74('0x1a')]);this[_0x2d74('0xb')]=_0x34c837[_0x2d74('0xb')];this['membername']=_0x34c837[_0x2d74('0x20')];this['reason']=_0x34c837[_0x2d74('0x21')];this[_0x2d74('0x22')]=_0x1d01c3[_0x2d74('0x22')];this[_0x2d74('0x23')]=_0x1d01c3[_0x2d74('0x23')];this[_0x2d74('0x24')]=_0x1d01c3['callbackat'];this[_0x2d74('0x25')]=_0x1d01c3['recallme'];this[_0x2d74('0x26')]=_0x1d01c3[_0x2d74('0x26')];this[_0x2d74('0x27')]=_0x1d01c3[_0x2d74('0x27')];this[_0x2d74('0x28')]=_0x1d01c3[_0x2d74('0x28')];this[_0x2d74('0x29')]=_0x1d01c3['VoiceQueueId'];this[_0x2d74('0x2a')]=_0x1d01c3[_0x2d74('0x2a')];this[_0x2d74('0x2b')]=_0x1d01c3[_0x2d74('0x2b')]||'';this[_0x2d74('0x2c')]=_0x1d01c3[_0x2d74('0x2c')]||'';}module[_0x2d74('0x2d')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 3154653..7eaa0c2 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x885a=['scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid'];(function(_0x2d1f85,_0x1d5827){var _0x2ef9fd=function(_0x53161a){while(--_0x53161a){_0x2d1f85['push'](_0x2d1f85['shift']());}};_0x2ef9fd(++_0x1d5827);}(_0x885a,0x180));var _0xa885=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x885a[_0x178e48];return _0x440d7e;};'use strict';var util=require('util');var _=require(_0xa885('0x0'));var moment=require(_0xa885('0x1'));function getSeconds(_0x35456c,_0x2e4bc8){var _0x573a2b=moment(_0x35456c)[_0xa885('0x2')](0x0);var _0x1c41b5=moment(_0x2e4bc8)[_0xa885('0x2')](0x0);return _0x573a2b[_0xa885('0x3')](_0x1c41b5,_0xa885('0x4'));}function Final(_0x33f18b){this['uniqueid']=_0x33f18b[_0xa885('0x5')];this[_0xa885('0x6')]=_0x33f18b[_0xa885('0x6')];this['type']=_0x33f18b[_0xa885('0x7')];this[_0xa885('0x8')]=_0x33f18b[_0xa885('0x7')]==='outbound'?_0xa885('0x9'):_0x33f18b[_0xa885('0x7')];this[_0xa885('0xa')]=_0x33f18b[_0xa885('0xa')];this[_0xa885('0xb')]=_0x33f18b[_0xa885('0xb')];this[_0xa885('0xc')]=_0x33f18b['countnoanswerretry'];this[_0xa885('0xd')]=_0x33f18b[_0xa885('0xa')]+_0x33f18b[_0xa885('0xb')]+_0x33f18b[_0xa885('0xc')]+_0x33f18b[_0xa885('0xe')]+_0x33f18b[_0xa885('0xf')]+_0x33f18b[_0xa885('0x10')]+_0x33f18b['countmachineretry']+_0x33f18b[_0xa885('0x11')];this[_0xa885('0xe')]=_0x33f18b[_0xa885('0xe')];this[_0xa885('0xf')]=_0x33f18b[_0xa885('0xf')];this['countabandonedretry']=_0x33f18b[_0xa885('0x10')];this[_0xa885('0x12')]=_0x33f18b['countmachineretry'];this[_0xa885('0x11')]=_0x33f18b[_0xa885('0x11')];this['queue']=_0x33f18b[_0xa885('0x9')];this[_0xa885('0x13')]=_0x33f18b['calleridname'];this[_0xa885('0x14')]=_0x33f18b['calleridnum'];this[_0xa885('0x15')]=_0x33f18b[_0xa885('0x15')];this[_0xa885('0x16')]=_0x33f18b['responsetime'];this[_0xa885('0x17')]=_0x33f18b['responsetime'];this[_0xa885('0x18')]=_0x33f18b[_0xa885('0x18')]||0x0;this[_0xa885('0x19')]=_0x33f18b['holdtime']||0x0;this[_0xa885('0x1a')]=_0x33f18b[_0xa885('0x1a')]||0x0;this[_0xa885('0x1b')]=_0x33f18b['callback'];this[_0xa885('0x1c')]=_0x33f18b[_0xa885('0x1c')];this[_0xa885('0x1d')]=_0x33f18b['callbackat'];this[_0xa885('0x1e')]=_0x33f18b['recallme'];this[_0xa885('0x1f')]=_0x33f18b[_0xa885('0x1f')];this['ListId']=_0x33f18b[_0xa885('0x20')];this[_0xa885('0x21')]=_0x33f18b[_0xa885('0x21')];this['VoiceQueueId']=_0x33f18b[_0xa885('0x22')];this[_0xa885('0x23')]=_0x33f18b['CampaignId'];this[_0xa885('0x24')]=_0x33f18b['originatecalleridnum']||'';this[_0xa885('0x25')]=_0x33f18b['originatecalleridname']||'';}module[_0xa885('0x26')]=Final; \ No newline at end of file +var _0xee14=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xee14,0x13a));var _0x4ee1=function(_0x561ed5,_0x3405b0){_0x561ed5=_0x561ed5-0x0;var _0xd05846=_0xee14[_0x561ed5];return _0xd05846;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x4ee1('0x0'));function getSeconds(_0x674696,_0x34e49d){var _0x1fa407=moment(_0x674696)[_0x4ee1('0x1')](0x0);var _0x236ccd=moment(_0x34e49d)[_0x4ee1('0x1')](0x0);return _0x1fa407[_0x4ee1('0x2')](_0x236ccd,_0x4ee1('0x3'));}function Final(_0x4bc729){this[_0x4ee1('0x4')]=_0x4bc729['uniqueid'];this[_0x4ee1('0x5')]=_0x4bc729[_0x4ee1('0x5')];this[_0x4ee1('0x6')]=_0x4bc729[_0x4ee1('0x6')];this[_0x4ee1('0x7')]=_0x4bc729[_0x4ee1('0x6')]==='outbound'?_0x4ee1('0x8'):_0x4bc729[_0x4ee1('0x6')];this['countbusyretry']=_0x4bc729[_0x4ee1('0x9')];this[_0x4ee1('0xa')]=_0x4bc729[_0x4ee1('0xa')];this[_0x4ee1('0xb')]=_0x4bc729['countnoanswerretry'];this[_0x4ee1('0xc')]=_0x4bc729[_0x4ee1('0x9')]+_0x4bc729[_0x4ee1('0xa')]+_0x4bc729[_0x4ee1('0xb')]+_0x4bc729[_0x4ee1('0xd')]+_0x4bc729[_0x4ee1('0xe')]+_0x4bc729['countabandonedretry']+_0x4bc729[_0x4ee1('0xf')]+_0x4bc729[_0x4ee1('0x10')];this[_0x4ee1('0xd')]=_0x4bc729[_0x4ee1('0xd')];this[_0x4ee1('0xe')]=_0x4bc729[_0x4ee1('0xe')];this[_0x4ee1('0x11')]=_0x4bc729[_0x4ee1('0x11')];this[_0x4ee1('0xf')]=_0x4bc729['countmachineretry'];this[_0x4ee1('0x10')]=_0x4bc729[_0x4ee1('0x10')];this[_0x4ee1('0x8')]=_0x4bc729[_0x4ee1('0x8')];this[_0x4ee1('0x12')]=_0x4bc729[_0x4ee1('0x12')];this[_0x4ee1('0x13')]=_0x4bc729[_0x4ee1('0x13')];this[_0x4ee1('0x14')]=_0x4bc729[_0x4ee1('0x14')];this[_0x4ee1('0x15')]=_0x4bc729['responsetime'];this[_0x4ee1('0x16')]=_0x4bc729[_0x4ee1('0x15')];this[_0x4ee1('0x17')]=_0x4bc729[_0x4ee1('0x17')]||0x0;this[_0x4ee1('0x18')]=_0x4bc729[_0x4ee1('0x18')]||0x0;this['talktime']=_0x4bc729[_0x4ee1('0x19')]||0x0;this[_0x4ee1('0x1a')]=_0x4bc729[_0x4ee1('0x1a')];this[_0x4ee1('0x1b')]=_0x4bc729[_0x4ee1('0x1b')];this[_0x4ee1('0x1c')]=_0x4bc729[_0x4ee1('0x1c')];this[_0x4ee1('0x1d')]=_0x4bc729[_0x4ee1('0x1d')];this[_0x4ee1('0x1e')]=_0x4bc729['ContactId'];this['ListId']=_0x4bc729[_0x4ee1('0x1f')];this[_0x4ee1('0x20')]=_0x4bc729[_0x4ee1('0x20')];this[_0x4ee1('0x21')]=_0x4bc729[_0x4ee1('0x21')];this[_0x4ee1('0x22')]=_0x4bc729['CampaignId'];this['originatecalleridnum']=_0x4bc729[_0x4ee1('0x23')]||'';this[_0x4ee1('0x24')]=_0x4bc729['originatecalleridname']||'';}module[_0x4ee1('0x25')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 30a915f..ae61af6 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x771e=['ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','diff','state','statedesc','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','cause-txt','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x771e,0x124));var _0xe771=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x771e[_0x3ab51d];return _0x29a04e;};'use strict';var util=require('util');var _=require(_0xe771('0x0'));var moment=require(_0xe771('0x1'));function getSeconds(_0x4d98aa,_0x31f5df){var _0x5b07af=moment(_0x4d98aa)[_0xe771('0x2')](0x0);var _0x437698=moment(_0x31f5df)['milliseconds'](0x0);return _0x5b07af[_0xe771('0x3')](_0x437698,'seconds');}function Hangup(_0x36d64c,_0x38772e){this[_0xe771('0x4')]=0x4;this[_0xe771('0x5')]='Answer';this['scheduledat']=_0x36d64c[_0xe771('0x6')];this[_0xe771('0x7')]=_0x36d64c['type'];this[_0xe771('0x8')]=_0x36d64c[_0xe771('0x7')]==='outbound'?_0xe771('0x9'):_0x36d64c[_0xe771('0x7')];this['countbusyretry']=_0x36d64c[_0xe771('0xa')];this[_0xe771('0xb')]=_0x36d64c[_0xe771('0xb')];this['countnoanswerretry']=_0x36d64c[_0xe771('0xc')];this['countglobal']=_0x36d64c[_0xe771('0xa')]+_0x36d64c[_0xe771('0xb')]+_0x36d64c[_0xe771('0xc')]+_0x36d64c[_0xe771('0xd')]+_0x36d64c[_0xe771('0xe')]+_0x36d64c[_0xe771('0xf')]+_0x36d64c[_0xe771('0x10')]+_0x36d64c['countagentrejectretry'];this[_0xe771('0xd')]=_0x36d64c['countnosuchnumberretry'];this[_0xe771('0xe')]=_0x36d64c[_0xe771('0xe')];this[_0xe771('0xf')]=_0x36d64c[_0xe771('0xf')];this['countmachineretry']=_0x36d64c[_0xe771('0x10')];this[_0xe771('0x11')]=_0x36d64c[_0xe771('0x11')];this['uniqueid']=_0x38772e[_0xe771('0x12')];this['calleridname']=_0x36d64c[_0xe771('0x13')];this[_0xe771('0x14')]=_0x36d64c[_0xe771('0x15')];this['starttime']=_0x36d64c[_0xe771('0x16')];this[_0xe771('0x17')]=_0x36d64c[_0xe771('0x17')];this[_0xe771('0x18')]=moment()['format'](_0xe771('0x19'));this[_0xe771('0x1a')]=getSeconds(_0x36d64c[_0xe771('0x17')],_0x36d64c['starttime']);this[_0xe771('0x1b')]=0x0;this[_0xe771('0x1c')]=getSeconds(this[_0xe771('0x18')],_0x36d64c['responsetime']);this[_0xe771('0x9')]=_0x36d64c[_0xe771('0x9')];this[_0xe771('0x1d')]='IVR';this[_0xe771('0x1e')]=_0x38772e[_0xe771('0x1f')];this['callback']=_0x36d64c['callback'];this['callbackuniqueid']=_0x36d64c[_0xe771('0x20')];this[_0xe771('0x21')]=_0x36d64c['callbackat'];this['recallme']=_0x36d64c[_0xe771('0x22')];this['ContactId']=_0x36d64c[_0xe771('0x23')];this['ListId']=_0x36d64c[_0xe771('0x24')];this[_0xe771('0x25')]=_0x36d64c[_0xe771('0x25')];this[_0xe771('0x26')]=_0x36d64c[_0xe771('0x26')];this[_0xe771('0x27')]=_0x36d64c['CampaignId'];}module[_0xe771('0x28')]=Hangup; \ No newline at end of file +var _0xfd5d=['milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','number','starttime','responsetime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd5d,0x1d7));var _0xdfd5=function(_0x339998,_0x11b727){_0x339998=_0x339998-0x0;var _0x1074b5=_0xfd5d[_0x339998];return _0x1074b5;};'use strict';var util=require(_0xdfd5('0x0'));var _=require('lodash');var moment=require(_0xdfd5('0x1'));function getSeconds(_0x57331c,_0x4161cb){var _0x41affb=moment(_0x57331c)[_0xdfd5('0x2')](0x0);var _0x4901ce=moment(_0x4161cb)[_0xdfd5('0x2')](0x0);return _0x41affb[_0xdfd5('0x3')](_0x4901ce,_0xdfd5('0x4'));}function Hangup(_0x1a04ec,_0x201665){this[_0xdfd5('0x5')]=0x4;this[_0xdfd5('0x6')]='Answer';this[_0xdfd5('0x7')]=_0x1a04ec['scheduledat'];this[_0xdfd5('0x8')]=_0x1a04ec[_0xdfd5('0x8')];this[_0xdfd5('0x9')]=_0x1a04ec[_0xdfd5('0x8')]===_0xdfd5('0xa')?_0xdfd5('0xb'):_0x1a04ec[_0xdfd5('0x8')];this[_0xdfd5('0xc')]=_0x1a04ec['countbusyretry'];this[_0xdfd5('0xd')]=_0x1a04ec[_0xdfd5('0xd')];this[_0xdfd5('0xe')]=_0x1a04ec[_0xdfd5('0xe')];this['countglobal']=_0x1a04ec['countbusyretry']+_0x1a04ec[_0xdfd5('0xd')]+_0x1a04ec['countnoanswerretry']+_0x1a04ec[_0xdfd5('0xf')]+_0x1a04ec['countdropretry']+_0x1a04ec[_0xdfd5('0x10')]+_0x1a04ec[_0xdfd5('0x11')]+_0x1a04ec[_0xdfd5('0x12')];this[_0xdfd5('0xf')]=_0x1a04ec[_0xdfd5('0xf')];this['countdropretry']=_0x1a04ec[_0xdfd5('0x13')];this[_0xdfd5('0x10')]=_0x1a04ec['countabandonedretry'];this[_0xdfd5('0x11')]=_0x1a04ec[_0xdfd5('0x11')];this[_0xdfd5('0x12')]=_0x1a04ec['countagentrejectretry'];this[_0xdfd5('0x14')]=_0x201665[_0xdfd5('0x14')];this[_0xdfd5('0x15')]=_0x1a04ec[_0xdfd5('0x16')];this['calleridnum']=_0x1a04ec[_0xdfd5('0x17')];this['starttime']=_0x1a04ec[_0xdfd5('0x18')];this[_0xdfd5('0x19')]=_0x1a04ec['responsetime'];this['endtime']=moment()['format'](_0xdfd5('0x1a'));this[_0xdfd5('0x1b')]=getSeconds(_0x1a04ec[_0xdfd5('0x19')],_0x1a04ec['starttime']);this[_0xdfd5('0x1c')]=0x0;this[_0xdfd5('0x1d')]=getSeconds(this[_0xdfd5('0x1e')],_0x1a04ec[_0xdfd5('0x19')]);this[_0xdfd5('0xb')]=_0x1a04ec[_0xdfd5('0xb')];this[_0xdfd5('0x1f')]=_0xdfd5('0x20');this['reason']=_0x201665[_0xdfd5('0x21')];this['callback']=_0x1a04ec[_0xdfd5('0x22')];this[_0xdfd5('0x23')]=_0x1a04ec[_0xdfd5('0x23')];this[_0xdfd5('0x24')]=_0x1a04ec[_0xdfd5('0x24')];this['recallme']=_0x1a04ec[_0xdfd5('0x25')];this[_0xdfd5('0x26')]=_0x1a04ec['ContactId'];this[_0xdfd5('0x27')]=_0x1a04ec[_0xdfd5('0x27')];this[_0xdfd5('0x28')]=_0x1a04ec[_0xdfd5('0x28')];this[_0xdfd5('0x29')]=_0x1a04ec[_0xdfd5('0x29')];this['CampaignId']=_0x1a04ec[_0xdfd5('0x2a')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 47c9c66..a874bf1 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x458e=['seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff'];(function(_0x45e80f,_0x51fe00){var _0x280287=function(_0x1d2e06){while(--_0x1d2e06){_0x45e80f['push'](_0x45e80f['shift']());}};_0x280287(++_0x51fe00);}(_0x458e,0x106));var _0xe458=function(_0x5d266b,_0x1e0f4d){_0x5d266b=_0x5d266b-0x0;var _0x27674f=_0x458e[_0x5d266b];return _0x27674f;};'use strict';var util=require(_0xe458('0x0'));var _=require('lodash');var moment=require(_0xe458('0x1'));function getSeconds(_0x252024,_0x3916f8){var _0x45afa3=moment(_0x252024)[_0xe458('0x2')](0x0);var _0x178518=moment(_0x3916f8)['milliseconds'](0x0);return _0x45afa3[_0xe458('0x3')](_0x178518,_0xe458('0x4'));}function History(_0x11c997){this['uniqueid']=_0x11c997[_0xe458('0x5')];this[_0xe458('0x6')]=_0x11c997[_0xe458('0x6')]||undefined;this[_0xe458('0x7')]=_0x11c997[_0xe458('0x7')];this[_0xe458('0x8')]=_0x11c997[_0xe458('0x7')]==='outbound'?_0xe458('0x9'):_0x11c997[_0xe458('0x7')];this[_0xe458('0xa')]=_0x11c997[_0xe458('0xa')];this['countcongestionretry']=_0x11c997[_0xe458('0xb')];this['countnoanswerretry']=_0x11c997[_0xe458('0xc')];this[_0xe458('0xd')]=_0x11c997[_0xe458('0xa')]+_0x11c997[_0xe458('0xb')]+_0x11c997[_0xe458('0xc')]+_0x11c997[_0xe458('0xe')]+_0x11c997[_0xe458('0xf')]+_0x11c997['countabandonedretry']+_0x11c997['countmachineretry']+_0x11c997['countagentrejectretry'];this[_0xe458('0xe')]=_0x11c997['countnosuchnumberretry'];this[_0xe458('0xf')]=_0x11c997[_0xe458('0xf')];this['countabandonedretry']=_0x11c997[_0xe458('0x10')];this[_0xe458('0x11')]=_0x11c997['countmachineretry'];this[_0xe458('0x12')]=_0x11c997[_0xe458('0x12')];this['queue']=_0x11c997['queue'];this[_0xe458('0x13')]=_0x11c997['name'];this[_0xe458('0x14')]=_0x11c997[_0xe458('0x15')];this['starttime']=_0x11c997[_0xe458('0x16')];this[_0xe458('0x17')]=_0x11c997[_0xe458('0x17')];this['endtime']=_0x11c997['responsetime'];this[_0xe458('0x18')]=getSeconds(_0x11c997[_0xe458('0x17')],_0x11c997[_0xe458('0x16')]);this[_0xe458('0x19')]=0x0;this[_0xe458('0x1a')]=0x0;this[_0xe458('0x1b')]=_0x11c997[_0xe458('0x1b')];this[_0xe458('0x1c')]=_0x11c997['callbackuniqueid'];this[_0xe458('0x1d')]=_0x11c997[_0xe458('0x1d')];this[_0xe458('0x1e')]=_0x11c997[_0xe458('0x1e')];this[_0xe458('0x1f')]=_0x11c997['ContactId'];this[_0xe458('0x20')]=_0x11c997[_0xe458('0x20')];this[_0xe458('0x21')]=_0x11c997[_0xe458('0x21')];this['VoiceQueueId']=_0x11c997['VoiceQueueId'];this[_0xe458('0x22')]=_0x11c997[_0xe458('0x22')];this[_0xe458('0x23')]=_0x11c997['originatecalleridnum']||'';this[_0xe458('0x24')]=_0x11c997[_0xe458('0x24')]||'';}module[_0xe458('0x25')]=History; \ No newline at end of file +var _0xc5c2=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x486790,_0x1f6dfc){var _0xa5e6a6=function(_0x100465){while(--_0x100465){_0x486790['push'](_0x486790['shift']());}};_0xa5e6a6(++_0x1f6dfc);}(_0xc5c2,0xd8));var _0x2c5c=function(_0x3ac12d,_0x3a3885){_0x3ac12d=_0x3ac12d-0x0;var _0x20fe52=_0xc5c2[_0x3ac12d];return _0x20fe52;};'use strict';var util=require(_0x2c5c('0x0'));var _=require(_0x2c5c('0x1'));var moment=require(_0x2c5c('0x2'));function getSeconds(_0x48f450,_0x19bf54){var _0x306261=moment(_0x48f450)[_0x2c5c('0x3')](0x0);var _0x2aa84e=moment(_0x19bf54)[_0x2c5c('0x3')](0x0);return _0x306261[_0x2c5c('0x4')](_0x2aa84e,_0x2c5c('0x5'));}function History(_0x25dba8){this['uniqueid']=_0x25dba8[_0x2c5c('0x6')];this['scheduledat']=_0x25dba8[_0x2c5c('0x7')]||undefined;this[_0x2c5c('0x8')]=_0x25dba8[_0x2c5c('0x8')];this[_0x2c5c('0x9')]=_0x25dba8['type']===_0x2c5c('0xa')?_0x2c5c('0xb'):_0x25dba8[_0x2c5c('0x8')];this[_0x2c5c('0xc')]=_0x25dba8[_0x2c5c('0xc')];this['countcongestionretry']=_0x25dba8['countcongestionretry'];this[_0x2c5c('0xd')]=_0x25dba8[_0x2c5c('0xd')];this[_0x2c5c('0xe')]=_0x25dba8['countbusyretry']+_0x25dba8[_0x2c5c('0xf')]+_0x25dba8[_0x2c5c('0xd')]+_0x25dba8[_0x2c5c('0x10')]+_0x25dba8[_0x2c5c('0x11')]+_0x25dba8[_0x2c5c('0x12')]+_0x25dba8[_0x2c5c('0x13')]+_0x25dba8[_0x2c5c('0x14')];this['countnosuchnumberretry']=_0x25dba8[_0x2c5c('0x10')];this[_0x2c5c('0x11')]=_0x25dba8[_0x2c5c('0x11')];this[_0x2c5c('0x12')]=_0x25dba8[_0x2c5c('0x12')];this['countmachineretry']=_0x25dba8['countmachineretry'];this[_0x2c5c('0x14')]=_0x25dba8[_0x2c5c('0x14')];this[_0x2c5c('0xb')]=_0x25dba8[_0x2c5c('0xb')];this[_0x2c5c('0x15')]=_0x25dba8[_0x2c5c('0x16')];this[_0x2c5c('0x17')]=_0x25dba8[_0x2c5c('0x18')];this[_0x2c5c('0x19')]=_0x25dba8[_0x2c5c('0x19')];this['responsetime']=_0x25dba8[_0x2c5c('0x1a')];this[_0x2c5c('0x1b')]=_0x25dba8[_0x2c5c('0x1a')];this[_0x2c5c('0x1c')]=getSeconds(_0x25dba8[_0x2c5c('0x1a')],_0x25dba8[_0x2c5c('0x19')]);this[_0x2c5c('0x1d')]=0x0;this[_0x2c5c('0x1e')]=0x0;this[_0x2c5c('0x1f')]=_0x25dba8[_0x2c5c('0x1f')];this[_0x2c5c('0x20')]=_0x25dba8['callbackuniqueid'];this['callbackat']=_0x25dba8[_0x2c5c('0x21')];this[_0x2c5c('0x22')]=_0x25dba8[_0x2c5c('0x22')];this[_0x2c5c('0x23')]=_0x25dba8[_0x2c5c('0x23')];this[_0x2c5c('0x24')]=_0x25dba8[_0x2c5c('0x24')];this['UserId']=_0x25dba8[_0x2c5c('0x25')];this[_0x2c5c('0x26')]=_0x25dba8[_0x2c5c('0x26')];this[_0x2c5c('0x27')]=_0x25dba8[_0x2c5c('0x27')];this[_0x2c5c('0x28')]=_0x25dba8[_0x2c5c('0x28')]||'';this[_0x2c5c('0x29')]=_0x25dba8['originatecalleridname']||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 6236826..72d56aa 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 _0xa26c=['message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','\x20INTERVAL_IS_NULL','Interval','Intervals','INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','strategy','answered','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','[getContactDialer2][ReScheduled]','sendMessageOneNotActive','pTalking','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','starttime','prototype','clearZombieChannels','[uniqueid]','sequence','isNil','Action','status','channel','catch','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','swapAdditionalPhones','[swapAdditionalPhone]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','notFound','saveInDb','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','trunks','unmonitored','syncVarSet','uniqueid','variable','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','statedesc','countglobal','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','dialGlobalMaxRetry','reason19\x20machine....','createStateFinal','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','countdropretry','countabandonedretry','countagentrejectretry','dialMachineMaxRetry','reason\x2019\x20machine....','minutes','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','rrmemory','pick','idHopper','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','queueStatusComplete','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','push','command','iftime\x20%s,%s','true','content','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','handlePreviewRecallNotifications','user:%s','user:dialPreviewRecallReminder','launchHandleIvr','handleIvr','dialTimezone','throttle','filter','online','map','Agent','checkPreviewRecallReminder','checkIsTrunkReachable','dialGlobalInterval','\x5cw{0,','pow','replace','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','SIP/%s/%s%s','trim','substring','dialCutDigit','[originateError]:\x20%s','OriginateError','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','nosuchnumber','reason\x200\x20no\x20such\x20number....','stateGlobal','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','Busy','custom:agentbusy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','dialAgentRejectRetryFrequency','custom:agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','predictiveIntervalErlangCallsDroppedCalls','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','loggerHandler','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','lodash','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/setting','./action','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','queuecallerabandon','syncQueueCallerAbandon','bind','syncOriginateResponse','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','syncNewExten','varset','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined'];(function(_0x166ad6,_0x27b368){var _0x6f2a2c=function(_0x485936){while(--_0x485936){_0x166ad6['push'](_0x166ad6['shift']());}};_0x6f2a2c(++_0x27b368);}(_0xa26c,0x1e1));var _0xca26=function(_0x18b1a4,_0x426396){_0x18b1a4=_0x18b1a4-0x0;var _0x207792=_0xa26c[_0x18b1a4];return _0x207792;};'use strict';var util=require('util');var _=require(_0xca26('0x0'));var uuid=require(_0xca26('0x1'));var moment=require('moment');var rr=require('rr');var md5=require(_0xca26('0x2'));var Redis=require(_0xca26('0x3'));var ut=require(_0xca26('0x4'));var config=require(_0xca26('0x5'));var logger=require(_0xca26('0x6'))(_0xca26('0x7'));var loggerBooked=require(_0xca26('0x6'))(_0xca26('0x8'));var loggerPredictive=require(_0xca26('0x6'))(_0xca26('0x9'));var loggerPredictiveCalls=require(_0xca26('0x6'))(_0xca26('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xca26('0xb'));var ami=require(_0xca26('0xc'));config[_0xca26('0xd')]=_[_0xca26('0xe')](config[_0xca26('0xd')],{'host':_0xca26('0xf'),'port':0x18eb});var io=require(_0xca26('0x10'))(new Redis(config[_0xca26('0xd')]));var cmHopper=require(_0xca26('0x11'));var cmHopperHistory=require(_0xca26('0x12'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0xca26('0x13'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xca26('0x14'));var Action=require(_0xca26('0x15'));var History=require('./history');var Final=require(_0xca26('0x16'));var AgentComplete=require(_0xca26('0x17'));var QueueCallerAbandon=require(_0xca26('0x18'));var Hangup=require(_0xca26('0x19'));var ipAgi=process[_0xca26('0x1a')][_0xca26('0x1b')]||_0xca26('0x1c');var strategy={'rrmemory':'rrmemory','roundrobin':_0xca26('0x1d')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xca26('0x1e')]=function(_0x1ef2c1){this[_0xca26('0x1f')]=this[_0xca26('0x1f')]?this[_0xca26('0x1f')][_0xca26('0x20')](_0x1ef2c1):_0x1ef2c1();};function Dialer(_0x5bb706,_0x5b1524){this['sequence']=new Sequence();this[_0xca26('0x21')]=_0x5b1524;this[_0xca26('0x22')]=_0x5bb706[_0xca26('0x22')];this[_0xca26('0x23')]=_0x5bb706[_0xca26('0x23')];this[_0xca26('0x24')]=_0x5bb706[_0xca26('0x24')];this['trunks']=_0x5bb706['trunks'];this[_0xca26('0x25')]=config[_0xca26('0x25')]||0x2;this[_0xca26('0x26')]={};this[_0xca26('0x27')]={};this[_0xca26('0x28')]={};this[_0xca26('0x29')]={};this[_0xca26('0x2a')]={};this[_0xca26('0x2b')]={};this[_0xca26('0x2c')]={};this['ivrOriginated']={};this[_0xca26('0x2d')]={};this[_0xca26('0x2e')]={};ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0xca26('0x2f'),this[_0xca26('0x30')][_0xca26('0x31')](this));ami['on']('originateresponse',this[_0xca26('0x32')]['bind'](this));ami['on']('agentcomplete',this[_0xca26('0x33')][_0xca26('0x31')](this));ami['on'](_0xca26('0x34'),this[_0xca26('0xb')][_0xca26('0x31')](this));ami['on'](_0xca26('0x35'),this[_0xca26('0x36')][_0xca26('0x31')](this));ami['on']('hangup',this[_0xca26('0x37')][_0xca26('0x31')](this));ami['on'](_0xca26('0x38'),this[_0xca26('0x39')]['bind'](this));ami['on'](_0xca26('0x3a'),this['syncVarSet'][_0xca26('0x31')](this));ami['on']('queuemember',this[_0xca26('0x3b')][_0xca26('0x31')](this));ami['on'](_0xca26('0x3c'),this['syncQueueStatusComplete']['bind'](this));this[_0xca26('0x3d')]();this[_0xca26('0x3e')]();RpcSetting[_0xca26('0x3f')]()[_0xca26('0x40')](function(_0x5bf05f){previewRecallmeReminderInterval=_0x5bf05f[_0xca26('0x41')];});}function isNotNull(_0x3d591b){return _0x3d591b!==null&&!_[_0xca26('0x42')](_0x3d591b);}function checkIsLoggedIn(_0x4d7b57,_0x5b132c){return function(){if(_0x5b132c<=0x0){_0x4d7b57[_0xca26('0x43')]=_0xca26('0x44');throw _0x4d7b57['name']+_0xca26('0x45');}};}function isActive(_0x1ef083){return _0x1ef083;}function checkIsActive(_0x1af108,_0x4b67e3){return function(){if(!isActive(_0x4b67e3)){_0x1af108[_0xca26('0x43')]=_0xca26('0x46');throw _0x1af108[_0xca26('0x47')]+_0xca26('0x48');}};}function checkInterval(_0x56377e){return function(){if(!isNotNull(_0x56377e['Interval'])){_0x56377e['message']='INTERVAL_IS_NULL';throw _0x56377e[_0xca26('0x47')]+_0xca26('0x49');}if(!isNotNull(_0x56377e[_0xca26('0x4a')][_0xca26('0x4b')])){_0x56377e[_0xca26('0x43')]=_0xca26('0x4c');throw _0x56377e['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x56377e['Interval'][_0xca26('0x4b')]))){_0x56377e['message']=_0xca26('0x4c');throw _0x56377e[_0xca26('0x47')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x1d8efa,_0x547dd0,_0xc9bb08){return{'action':_0x1d8efa,'response':_0x547dd0,'message':_0xc9bb08,'stack':_0xc9bb08};}function myreject(_0x6b6f6b){return function(_0x68282a){return _0x6b6f6b(msgResponse(_0xca26('0x4d'),_0xca26('0x4e'),JSON[_0xca26('0x4f')](_0x68282a)));};}function getSeconds(_0x57766b,_0x53f03f){var _0x4c1c48=moment(_0x57766b)[_0xca26('0x50')](0x0);var _0x2ebf82=moment(_0x53f03f)[_0xca26('0x50')](0x0);return _0x4c1c48[_0xca26('0x51')](_0x2ebf82,_0xca26('0x52'));}function emit(_0x4bd428,_0x3d45a5,_0x47e1e6){io['to'](_0x4bd428)[_0xca26('0x53')](_0x3d45a5,_0x47e1e6);}function emitVoiceQueueSummary(_0x46e65f){if(_0x46e65f[_0xca26('0x54')]==='outbound'){var _0x4b3c47={'id':_0x46e65f['id'],'name':_0x46e65f[_0xca26('0x47')],'strategy':_0x46e65f[_0xca26('0x55')],'answered':_0x46e65f[_0xca26('0x56')],'available':_0x46e65f['available'],'loggedIn':_0x46e65f[_0xca26('0x57')],'pTalking':_0x46e65f['pTalking'],'sumBillable':_0x46e65f[_0xca26('0x58')],'sumDuration':_0x46e65f[_0xca26('0x59')],'sumHoldTime':_0x46e65f[_0xca26('0x5a')]||0x0,'talking':_0x46e65f[_0xca26('0x5b')],'total':_0x46e65f[_0xca26('0x5c')],'type':_0x46e65f[_0xca26('0x54')],'unmanaged':_0x46e65f[_0xca26('0x5d')],'abandoned':_0x46e65f[_0xca26('0x5e')],'waiting':_0x46e65f[_0xca26('0x5f')],'loggedInDb':_0x46e65f[_0xca26('0x60')],'dialActive':_0x46e65f[_0xca26('0x61')],'dialMethod':_0x46e65f[_0xca26('0x62')],'dialOriginateCallerIdName':_0x46e65f[_0xca26('0x63')],'dialOriginateCallerIdNumber':_0x46e65f[_0xca26('0x64')],'dialOriginateTimeout':_0x46e65f[_0xca26('0x65')],'dialPrefix':_0x46e65f[_0xca26('0x66')],'outboundAnswerAgiCallsDay':_0x46e65f[_0xca26('0x67')],'outboundAnswerCallsDay':_0x46e65f[_0xca26('0x68')],'outboundBlacklistCallsDay':_0x46e65f['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x46e65f[_0xca26('0x69')],'outboundCongestionCallsDay':_0x46e65f[_0xca26('0x6a')],'outboundDropCallsDayACS':_0x46e65f[_0xca26('0x6b')],'outboundDropCallsDayCallersExit':_0x46e65f[_0xca26('0x6c')],'outboundDropCallsDayTimeout':_0x46e65f['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x46e65f[_0xca26('0x6d')],'outboundNoSuchCallsDay':_0x46e65f[_0xca26('0x6e')],'outboundOriginateFailureCallsDay':_0x46e65f[_0xca26('0x6f')],'outboundReCallsDay':_0x46e65f[_0xca26('0x70')],'outboundRejectCallsDay':_0x46e65f[_0xca26('0x71')],'outboundUnknownCallsDay':_0x46e65f[_0xca26('0x72')],'predictiveIntervalAnsweredCalls':_0x46e65f[_0xca26('0x73')],'predictiveIntervalAvgHoldtime':_0x46e65f[_0xca26('0x74')],'predictiveIntervalAvgTalktime':_0x46e65f['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x46e65f[_0xca26('0x75')],'predictiveIntervalDroppedCallsTimeout':_0x46e65f[_0xca26('0x76')],'predictiveIntervalErlangCalls':_0x46e65f[_0xca26('0x77')],'predictiveIntervalErlangCallsDroppedCalls':_0x46e65f['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x46e65f[_0xca26('0x78')],'predictiveIntervalMultiplicativeFactor':_0x46e65f[_0xca26('0x79')],'predictiveIntervalPauses':_0x46e65f[_0xca26('0x7a')],'predictiveIntervalAvailable':_0x46e65f['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x46e65f[_0xca26('0x7b')],'message':_0x46e65f[_0xca26('0x43')],'originated':_0x46e65f[_0xca26('0x7c')],'erlangCalls':_0x46e65f[_0xca26('0x7d')],'erlangCallToSecond':_0x46e65f[_0xca26('0x7e')],'erlangAbandonmentRate':_0x46e65f['erlangAbandonmentRate'],'erlangBusyFactor':_0x46e65f[_0xca26('0x7f')],'startPredictive':_0x46e65f['startPredictive'],'startProgressive':_0x46e65f[_0xca26('0x2c')]};if(_0x46e65f[_0xca26('0x80')]){_0x4b3c47[_0xca26('0x80')]={'id':_0x46e65f['Trunk']['id'],'name':_0x46e65f[_0xca26('0x80')]['name'],'active':_0x46e65f[_0xca26('0x80')][_0xca26('0x81')],'callerid':_0x46e65f['Trunk'][_0xca26('0x82')]};}if(_0x46e65f[_0xca26('0x4a')]){_0x4b3c47[_0xca26('0x4a')]={'id':_0x46e65f[_0xca26('0x4a')]['id'],'name':_0x46e65f[_0xca26('0x4a')][_0xca26('0x47')]};}var _0x1e9dd4=md5(JSON[_0xca26('0x4f')](_0x4b3c47));if(_0x46e65f[_0xca26('0x2')]!==_0x1e9dd4){_0x46e65f['md5']=_0x1e9dd4;emit(util[_0xca26('0x83')](_0xca26('0x84'),_0x4b3c47[_0xca26('0x47')]),'voice_queue:save',_0x4b3c47);}}}function emitCampaignSummary(_0x4f56d5){if(_0x4f56d5[_0xca26('0x54')]===_0xca26('0x85')){emit(util[_0xca26('0x83')](_0xca26('0x86'),_0x4f56d5[_0xca26('0x47')]),_0xca26('0x87'),_0x4f56d5);}}function checkGetDataPredictive(_0x106094){if(isNotNull(_0x106094)&&!_[_0xca26('0x88')](_0x106094)){loggerPredictive[_0xca26('0x89')](_0xca26('0x8a'));loggerPredictive[_0xca26('0x89')](_0xca26('0x8b'),_0x106094[_0xca26('0x7b')]);loggerPredictive[_0xca26('0x89')](_0xca26('0x8c'),_0x106094[_0xca26('0x73')]);loggerPredictive[_0xca26('0x89')](_0xca26('0x8d'),_0x106094['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xca26('0x89')](_0xca26('0x8e'),_0x106094['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xca26('0x89')](_0xca26('0x8f'),_0x106094[_0xca26('0x74')]);loggerPredictive[_0xca26('0x89')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x106094[_0xca26('0x90')]);loggerPredictive[_0xca26('0x89')](_0xca26('0x91'));if(_0x106094[_0xca26('0x7b')]>0x0){if(!_[_0xca26('0x42')](_0x106094[_0xca26('0x90')])&&_0x106094[_0xca26('0x90')]>0x0){return!![];}loggerPredictive[_0xca26('0x89')](_0xca26('0x92'));if(!_[_0xca26('0x42')](_0x106094['predictiveIntervalAvgHoldtime'])&&_0x106094[_0xca26('0x74')]>0x0){return!![];}loggerPredictive['info'](_0xca26('0x93'));}else{loggerPredictive[_0xca26('0x89')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xca26('0x89')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x803566){return function(_0x5842b2){loggerPredictive[_0xca26('0x89')]('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0xca26('0x94'),_0x5842b2[_0xca26('0x7d')]);loggerPredictive['info'](_0xca26('0x95'),_0x5842b2[_0xca26('0x7e')]);loggerPredictive['info'](_0xca26('0x96'),_0x5842b2['erlangAbandonmentRate']);loggerPredictive[_0xca26('0x89')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5842b2['erlangBusyFactor']);loggerPredictive[_0xca26('0x89')](_0xca26('0x96'),_0x5842b2[_0xca26('0x97')]);loggerPredictive[_0xca26('0x89')]('---------------------------');_[_0xca26('0x98')](_0x803566,_0x5842b2);};}function getDiff(_0x2d41f3){var _0x3f18d0=moment()[_0xca26('0x50')](0x0);var _0xf74422=moment(_0x2d41f3)[_0xca26('0x50')](0x0);return _0x3f18d0[_0xca26('0x51')](_0xf74422,_0xca26('0x52'));}function ifInterval(_0x2f8c6a,_0x178654){if(_['isUndefined'](_0x178654)){return![];}return getDiff(_0x178654)<_0x2f8c6a*0x3c;}function freeVariablesPredictive(_0x3f3947){if(isNotNull(_0x3f3947)){if(!_[_0xca26('0x42')](_0x3f3947[_0xca26('0x2c')])){_0x3f3947[_0xca26('0x2c')]=undefined;loggerPredictive[_0xca26('0x89')](_0x3f3947[_0xca26('0x47')],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0x3f3947[_0xca26('0x2b')])){_0x3f3947[_0xca26('0x2b')]=undefined;loggerPredictive['info'](_0x3f3947[_0xca26('0x47')],_0xca26('0x99'));}if(!_[_0xca26('0x42')](_0x3f3947[_0xca26('0x9a')])){clearInterval(_0x3f3947[_0xca26('0x9a')]);_0x3f3947[_0xca26('0x9a')]=undefined;loggerPredictive['info'](_0x3f3947['name'],_0xca26('0x9b'));}}}function erlangb(_0x292c18,_0x54a394){if(_0x54a394===0x0){return 0x0;}var _0x1b856f=0x1;for(var _0x1421ed=0x1;_0x1421ed<=_0x54a394;_0x1421ed+=0x1){_0x1b856f=0x1+_0x1b856f*_0x1421ed/_0x292c18;}return 0x1/_0x1b856f;}function isVoiceQueueOutbound(_0x3390f7){return _0x3390f7==='outbound';}function isNotPreview(_0x50c3a8){return _0x50c3a8!==_0xca26('0x21');}function isCampaignIvr(_0x489570){return _0x489570==='ivr';}function getCallerId(_0x172b77,_0x3c4388,_0x410b6d){if(!_[_0xca26('0x42')](_0x410b6d)&&typeof _0x410b6d==='string'&&!_[_0xca26('0x88')](_0x410b6d)){if(!_[_0xca26('0x42')](_0x3c4388)&&typeof _0x3c4388===_0xca26('0x9c')&&!_['isEmpty'](_0x3c4388)){return util[_0xca26('0x83')]('\x22%s\x22\x20<%s>',_0x3c4388,_0x410b6d);}return util[_0xca26('0x83')](_0xca26('0x9d'),_0x410b6d,_0x410b6d);}if(!_[_0xca26('0x42')](_0x172b77)&&typeof _0x172b77===_0xca26('0x9c')&&!_[_0xca26('0x88')](_0x172b77)){return _0x172b77;}return _0xca26('0x9e');}function loggerCatchQueueSummary(_0x216791,_0x29329d){return function(_0x539201){freeVariablesPredictive(_0x29329d);emitVoiceQueueSummary(_0x29329d);emitCampaignSummary(_0x29329d);loggerSyncQueueSummary[_0xca26('0x9f')](_0x216791,util[_0xca26('0xa0')](_0x539201,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x12f36c,_0x307e92){return function(_0x55a213){loggerPredictive['error'](_0x307e92[_0xca26('0x47')],_0x12f36c);loggerPredictive[_0xca26('0xa1')](_0x55a213['stack']);freeVariablesPredictive(_0x307e92);};}function loggerCatch(_0x436c81){return function(_0x77c0f3){logger['error'](_0x436c81,util['inspect'](_0x77c0f3,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x58e050){return _0x58e050&&!_[_0xca26('0x42')](_0x58e050)&&_0x58e050[_0xca26('0xa2')]>0x0;}function decremetOriginate(_0x9b4eca){if(!_[_0xca26('0x42')](_0x9b4eca)&&_0x9b4eca!==null){if(typeof _0x9b4eca[_0xca26('0x7c')]!==_0xca26('0xa3')){if(_0x9b4eca[_0xca26('0x7c')]>0x0){_0x9b4eca[_0xca26('0x7c')]-=0x1;}else{logger[_0xca26('0xa1')](_0xca26('0xa4'));}}}else{logger[_0xca26('0xa1')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x5b1817,_0x5c5c6a,_0x79aeec){if(_0x5c5c6a>_0x79aeec){for(var _0x1a2d81=0x0;_0x1a2d81<_0x5c5c6a-_0x79aeec;_0x1a2d81+=0x1){decremetOriginate(_0x5b1817);}}}function loggerGetContactDialer(_0x4e00e0,_0xe27ec4,_0xd1ffad){return function(_0x1b77b8){checkContactLowerLimitOriginate(_0xe27ec4,_0xd1ffad,0x0);logger[_0xca26('0xa1')](_0x4e00e0,util[_0xca26('0xa0')](_0x1b77b8,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4de699){return function(_0x121726){if(isNotNull(_0x121726)&&isNotNull(_0x121726[0x0])){if(_0x121726[0x0][_0xca26('0xa5')]>0x0){_0x4de699['message']='RESCHEDULED_CONTACTS';logger[_0xca26('0x89')](_0xca26('0xa6')+_0x4de699['name'],_0x121726[0x0][_0xca26('0xa5')],'contacts');}else{_0x4de699[_0xca26('0x43')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xca26('0x89')]('[getContactDialer2][Empty]'+_0x4de699['name']);}}};}function notSendMessagesQueue(_0x1212a0){if(_0x1212a0[_0xca26('0xa7')]){freeVariablesPredictive(_0x1212a0);if(_0x1212a0[_0xca26('0x7c')]===0x0&&_0x1212a0[_0xca26('0x5b')]===0x0&&_0x1212a0[_0xca26('0x5f')]===0x0&&(_0x1212a0[_0xca26('0xa8')]||0x0)===0x0){_0x1212a0[_0xca26('0xa7')]=![];_0x1212a0['available']=0x0;_0x1212a0['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0xca26('0x9f')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1212a0[_0xca26('0x47')],_0xca26('0xa9'));}else{_0x1212a0[_0xca26('0x43')]=_0xca26('0xaa');loggerSyncQueueSummary[_0xca26('0x9f')](_0xca26('0xab'),_0x1212a0[_0xca26('0x47')],'is\x20disactive');}emitVoiceQueueSummary(_0x1212a0);}}function notSendMessagesCampaign(_0x2c0ae0){if(_0x2c0ae0[_0xca26('0xa7')]){if(_0x2c0ae0[_0xca26('0x7c')]===0x0){_0x2c0ae0['sendMessageOneNotActive']=![];_0x2c0ae0[_0xca26('0x43')]=_0xca26('0x46');loggerSyncQueueSummary[_0xca26('0x9f')](_0xca26('0xac'),_0x2c0ae0[_0xca26('0x47')],_0xca26('0xa9'));}else{_0x2c0ae0[_0xca26('0x43')]=_0xca26('0xaa');loggerSyncQueueSummary[_0xca26('0x9f')](_0xca26('0xac'),_0x2c0ae0[_0xca26('0x47')],'is\x20disactive');}emitCampaignSummary(_0x2c0ae0);}}function createObjHistory(_0x3f66fc,_0x4cba73,_0x588359,_0x55f230,_0x42eb81){_0x3f66fc[_0xca26('0x43')]=_0x588359;var _0xc17c70=new Action(_0x3f66fc,_0x4cba73);var _0x39df28=new History(_0xc17c70);_0x39df28[_0xca26('0xad')]=_0x55f230;_0x39df28['statedesc']=_0x42eb81;_0x39df28[_0xca26('0xae')]=_0xc17c70[_0xca26('0xaf')];return _0x39df28;}Dialer[_0xca26('0xb0')][_0xca26('0x3e')]=function(){var _0x4b87d1=this;setInterval(function(){_0x4b87d1[_0xca26('0xb1')](_0x4b87d1['uniqueId'],_0xca26('0xb2'));_0x4b87d1[_0xca26('0xb1')](_0x4b87d1['actions'],'[actions]');},0x32c8);};Dialer['prototype'][_0xca26('0xb1')]=function(_0x3302ee,_0x1b7380){var _0x4c9106=this;for(var _0x160c28 in _0x3302ee){if(typeof _0x3302ee[_0x160c28]!==_0xca26('0xa3')){this[_0xca26('0xb3')]['enqueue'](function(){if(!_[_0xca26('0xb4')](_0x3302ee[_0x160c28])){return ami[_0xca26('0xb5')]({'action':_0xca26('0xb6'),'channel':_0x3302ee[_0x160c28][_0xca26('0xb7')]})[_0xca26('0xb8')](function(_0x2c6e75){if(_0x2c6e75[_0xca26('0x43')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3302ee[_0x160c28]&&_0x3302ee[_0x160c28][_0xca26('0x54')]!=='ivr'){_0x4c9106[_0xca26('0xb9')](_0x4c9106[_0xca26('0x22')][_0x3302ee[_0x160c28][_0xca26('0xba')]]);logger[_0xca26('0xa1')]('[Dialer][checkChannel]',_0x1b7380,_0x160c28,_0x3302ee[_0x160c28][_0xca26('0xba')]);delete _0x3302ee[_0x160c28];}if(_0x3302ee[_0x160c28]&&_0x3302ee[_0x160c28][_0xca26('0x54')]===_0xca26('0x85')){_0x4c9106[_0xca26('0xb9')](_0x4c9106[_0xca26('0x23')][_0x3302ee[_0x160c28]['queue']]);logger['error'](_0xca26('0xbb'),_0x1b7380,_0x160c28,_0x3302ee[_0x160c28]['queue']);delete _0x3302ee[_0x160c28];}},0x2328);}});}});}}};Dialer['prototype'][_0xca26('0xbc')]=function(_0xa3a8bb){return Promise[_0xca26('0xbd')]()[_0xca26('0x40')](cmHopper[_0xca26('0xbc')](_0xa3a8bb))[_0xca26('0xb8')](loggerCatch(_0xca26('0xbe')));};Dialer[_0xca26('0xb0')][_0xca26('0xbf')]=function(_0x4f3d7e){return Promise[_0xca26('0xbd')]()[_0xca26('0x40')](cmHopperBlack[_0xca26('0xbf')](_0x4f3d7e))[_0xca26('0xb8')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0xca26('0xb0')]['verifyAdditionalPhones']=function(_0x34d87d,_0x3d05b0,_0x261915){return Promise[_0xca26('0xbd')]()[_0xca26('0x40')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x34d87d,_0x3d05b0,_0x261915))[_0xca26('0xb8')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0xca26('0xb0')]['swapAdditionalPhones']=function(_0x47aa49,_0x139eff,_0x9fb081){return Promise[_0xca26('0xbd')]()[_0xca26('0x40')](cmHopperAdditionalPhone[_0xca26('0xc0')](_0x47aa49,_0x139eff,_0x9fb081))[_0xca26('0xb8')](loggerCatch(_0xca26('0xc1')));};Dialer[_0xca26('0xb0')]['checkIsBlackListIvr']=function(_0x45c4aa){return Promise[_0xca26('0xbd')]()[_0xca26('0x40')](cmHopperBlack['checkIsBlackListIvr'](_0x45c4aa))[_0xca26('0xb8')](loggerCatch(_0xca26('0xc2')));};Dialer[_0xca26('0xb0')][_0xca26('0xc3')]=function(_0x1e037f){return Promise[_0xca26('0xbd')]()[_0xca26('0x40')](cmHopperHistory['avgHandleTime'](_0x1e037f))['catch'](loggerCatch(_0xca26('0xc4')));};Dialer['prototype']['rescheduleContact']=function(_0x5ec84f){return Promise[_0xca26('0xbd')]()['then'](cmHopper[_0xca26('0xc5')](_0x5ec84f))[_0xca26('0xb8')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xca26('0xb0')][_0xca26('0xc6')]=function(_0x327d57,_0x2b8622,_0x517cdb){return Promise[_0xca26('0xbd')]()['then'](cmHopper['unlockContact'](_0x327d57,_0x2b8622,_0x517cdb))[_0xca26('0xb8')](loggerCatch(_0xca26('0xc7')));};Dialer[_0xca26('0xb0')][_0xca26('0xc8')]=function(_0x3daef3,_0x2b8aef,_0x22b787,_0x223f1b,_0x36f2d4){return Promise[_0xca26('0xbd')]()[_0xca26('0x40')](cmHopper[_0xca26('0xc8')](_0x3daef3,_0x2b8aef,_0x22b787,_0x223f1b))[_0xca26('0xb8')](function(_0x5c6b38){_0x36f2d4[_0xca26('0xc9')]-=_0x22b787;_0x36f2d4['temp']=_0x36f2d4[_0xca26('0xc9')]>0x0?_0x36f2d4[_0xca26('0xc9')]:0x0;loggerCatch(_0xca26('0xca'))(_0x5c6b38);});};Dialer['prototype'][_0xca26('0xcb')]=function(_0xfebbf6,_0x5f216a,_0x392f0b,_0x3ab961){return Promise[_0xca26('0xbd')]()['then'](cmHopper[_0xca26('0xcb')](_0xfebbf6,_0x5f216a,_0x392f0b))[_0xca26('0xb8')](function(_0x43a64b){_0x3ab961[_0xca26('0xc9')]-=_0x5f216a;_0x3ab961[_0xca26('0xc9')]=_0x3ab961[_0xca26('0xc9')]>0x0?_0x3ab961[_0xca26('0xc9')]:0x0;loggerCatch(_0xca26('0xcc'))(_0x43a64b);});};Dialer[_0xca26('0xb0')][_0xca26('0xcd')]=function(_0x288ded){return Promise[_0xca26('0xbd')]()[_0xca26('0x40')](voiceQueueRt['getVoiceQueueRtPauses'](_0x288ded))[_0xca26('0xb8')](loggerCatch(_0xca26('0xce')));};Dialer[_0xca26('0xb0')][_0xca26('0xcf')]=function(_0x3dc2f9){return Promise['resolve']()[_0xca26('0x40')](cmHopper['moveContactManagedDialer'](_0x3dc2f9))[_0xca26('0xb8')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xca26('0xb0')][_0xca26('0xd0')]=function(_0x45c368){return Promise[_0xca26('0xbd')]()[_0xca26('0x40')](cmHopperHistory['createHistory'](_0x45c368))[_0xca26('0xb8')](loggerCatch(_0xca26('0xd1')));};Dialer[_0xca26('0xb0')][_0xca26('0xb9')]=function(_0x29dcbe){if(!_['isUndefined'](_0x29dcbe)&&_0x29dcbe!==null){if(typeof _0x29dcbe[_0xca26('0x7c')]!=='undefined'){if(_0x29dcbe['originated']>0x0){_0x29dcbe[_0xca26('0x7c')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xca26('0xa1')](_0xca26('0xd2'));}};Dialer[_0xca26('0xb0')]['loggerHandler']=function(_0x4a167f,_0x46e1a6){var _0x95d756=this;return function(_0xdcf905){_0x95d756['updateOriginated'](_0x46e1a6);logger[_0xca26('0xa1')](_0x4a167f,util[_0xca26('0xa0')](_0xdcf905,{'showHidden':![],'depth':null}));};};Dialer[_0xca26('0xb0')]['emptyContact']=function(_0x258213,_0x288761,_0x474e87){var _0x39bcea={'state':0x19,'statedesc':_0xca26('0xd3')};this[_0xca26('0xb9')](_0x288761);this[_0xca26('0xd4')](_[_0xca26('0x98')](_0x39bcea,_['pick'](_0x474e87,['ContactId',_0xca26('0xd5'),_0xca26('0xd6'),_0xca26('0xd7'),_0xca26('0xd8')])),_0xca26('0xd9'),'[emptyContact]');logger[_0xca26('0xa1')](_0x258213);};Dialer[_0xca26('0xb0')][_0xca26('0xda')]=function(_0x296103){return _0x296103===_0xca26('0xdb');};Dialer[_0xca26('0xb0')][_0xca26('0xdc')]=function(_0x1316bb){return!_[_0xca26('0x42')](_0x1316bb)&&_0x1316bb&&!_[_0xca26('0x42')](_0x1316bb[_0xca26('0x47')])&&!_[_0xca26('0x42')](_0x1316bb[_0xca26('0x81')])&&_0x1316bb[_0xca26('0x81')]&&(this['trunks'][util[_0xca26('0x83')](_0xca26('0xdd'),_0x1316bb[_0xca26('0x47')])]['status']===_0xca26('0xde')||this[_0xca26('0xdf')][util[_0xca26('0x83')](_0xca26('0xdd'),_0x1316bb[_0xca26('0x47')])][_0xca26('0xb6')]===_0xca26('0xe0'));};Dialer['prototype']['saveInDb']=function(_0x55c37c,_0x267022,_0x250e57){this[_0xca26('0xd0')](_0x55c37c)[_0xca26('0xb8')](loggerCatch(_0x267022));this[_0xca26('0xcf')](_0x55c37c)['catch'](loggerCatch(_0x250e57));};Dialer[_0xca26('0xb0')][_0xca26('0xe1')]=function(_0x52437d){var _0x23269f=this;var _0x3e7346=this[_0xca26('0x29')][_0x52437d[_0xca26('0xe2')]];var _0x502461;if(!_['isNil'](_0x52437d)&&!_['isNil'](_0x52437d[_0xca26('0xe3')])&&!_[_0xca26('0xb4')](_0x52437d[_0xca26('0xe3')]['amdstatus'])&&_0x52437d['exten']===_0xca26('0xe4')&&_0x3e7346){if(_0x3e7346[_0xca26('0x54')]!==_0xca26('0x85')&&this['voiceQueues'][_0x3e7346['queue']][_0xca26('0xe5')]&&_0x52437d[_0xca26('0xe6')]===_0xca26('0xe7')){delete this[_0xca26('0x29')][_0x52437d[_0xca26('0xe2')]];this[_0xca26('0xb9')](this[_0xca26('0x22')][_0x3e7346[_0xca26('0xba')]]);this[_0xca26('0x22')][_0x3e7346[_0xca26('0xba')]]['outboundAnswerCallsDay']+=0x1;this[_0xca26('0x22')][_0x3e7346[_0xca26('0xba')]][_0xca26('0x67')]+=0x1;_0x502461=new Hangup(_0x3e7346,_0x52437d);_0x502461[_0xca26('0xad')]=0x12;_0x502461['statedesc']=_0xca26('0xe8');_0x502461[_0xca26('0xe9')]=_0xca26('0xea');ami['emit'](_0xca26('0xeb'),ut['buildObj'](_0x502461,_0xca26('0xec')));this[_0xca26('0xd4')](_0x502461,_0xca26('0xed'),_0xca26('0xee'));}if(_0x3e7346[_0xca26('0x54')]!==_0xca26('0x85')&&this[_0xca26('0x22')][_0x3e7346[_0xca26('0xba')]][_0xca26('0xe5')]&&_0x52437d[_0xca26('0xe6')]===_0xca26('0xef')){return new Promise(function(_0x355cf1,_0x597b60){delete _0x23269f[_0xca26('0x29')][_0x52437d[_0xca26('0xe2')]];_0x23269f[_0xca26('0xb9')](_0x23269f[_0xca26('0x22')][_0x3e7346[_0xca26('0xba')]]);_0x23269f[_0xca26('0x22')][_0x3e7346['queue']]['outboundAnswerCallsDay']+=0x1;_0x23269f['voiceQueues'][_0x3e7346[_0xca26('0xba')]][_0xca26('0x67')]+=0x1;var _0x313a90=_0x23269f[_0xca26('0x22')][_0x3e7346[_0xca26('0xba')]];var _0x4214ad=new Hangup(_0x3e7346,_0x52437d);_0x4214ad[_0xca26('0xad')]=0x13;_0x4214ad[_0xca26('0xf0')]='Machine';_0x4214ad[_0xca26('0xe9')]='AMD';_0x4214ad['countmachineretry']+=0x1;_0x4214ad[_0xca26('0xf1')]+=0x1;_0x4214ad[_0xca26('0xec')]=!![];ami['emit']('custom:amd',ut[_0xca26('0xf2')](_0x4214ad,_0xca26('0xec')));_0x23269f[_0xca26('0xd0')](_0x4214ad)[_0xca26('0xb8')](loggerCatch(_0xca26('0xf3')));if(_0x4214ad[_0xca26('0xf4')]+_0x4214ad[_0xca26('0xf5')]+_0x4214ad[_0xca26('0xf6')]+_0x4214ad[_0xca26('0xf7')]+_0x4214ad['countdropretry']+_0x4214ad['countabandonedretry']+_0x4214ad[_0xca26('0xf8')]+_0x4214ad['countagentrejectretry']>=_0x313a90[_0xca26('0xf9')]){_0x23269f['stateGlobal'](_0x4214ad,_0x355cf1,_0x597b60,_0xca26('0xfa'));}else{if(_0x4214ad[_0xca26('0xf8')]>=_0x313a90['dialMachineMaxRetry']){_0x23269f[_0xca26('0xfb')](_0x4214ad,_0x355cf1,_0x597b60,'reason\x2019\x20machine....');}else{_0x23269f[_0xca26('0xc5')]({'active':![],'countmachineretry':_0x4214ad[_0xca26('0xf8')],'scheduledat':moment()[_0xca26('0xfc')](_0x313a90[_0xca26('0xfd')],'minutes')['format'](_0xca26('0xfe')),'ContactId':_0x4214ad[_0xca26('0xff')],'ListId':_0x4214ad['ListId'],'VoiceQueueId':_0x4214ad['VoiceQueueId']||undefined,'CampaignId':_0x4214ad[_0xca26('0xd8')]||undefined})[_0xca26('0xb8')](loggerCatch(_0xca26('0x100')));_0x355cf1({'reschedule':0x1});}}});}if(_0x3e7346[_0xca26('0x54')]===_0xca26('0x85')&&this[_0xca26('0x23')][_0x3e7346[_0xca26('0xba')]][_0xca26('0xe5')]&&_0x52437d[_0xca26('0xe6')]===_0xca26('0xe7')){delete this['uniqueId'][_0x52437d[_0xca26('0xe2')]];this[_0xca26('0xb9')](this['campaigns'][_0x3e7346['queue']]);_0x502461=new Hangup(_0x3e7346,_0x52437d);_0x502461['state']=0x12;_0x502461[_0xca26('0xf0')]='HangupInAMD';_0x502461[_0xca26('0xe9')]=_0xca26('0xea');ami['emit']('custom:amd',ut[_0xca26('0xf2')](_0x502461,_0xca26('0xec')));this[_0xca26('0xd4')](_0x502461,_0xca26('0x101'),_0xca26('0x102'));}if(_0x3e7346['type']===_0xca26('0x85')&&this['campaigns'][_0x3e7346['queue']][_0xca26('0xe5')]&&_0x52437d[_0xca26('0xe6')]===_0xca26('0xef')){return new Promise(function(_0x2a8516,_0x51f6a9){delete _0x23269f[_0xca26('0x29')][_0x52437d['uniqueid']];_0x23269f[_0xca26('0xb9')](_0x23269f[_0xca26('0x23')][_0x3e7346['queue']]);_0x23269f[_0xca26('0x23')][_0x3e7346[_0xca26('0xba')]][_0xca26('0x68')]+=0x1;_0x23269f[_0xca26('0x23')][_0x3e7346[_0xca26('0xba')]][_0xca26('0x67')]+=0x1;var _0xff3f66=_0x23269f[_0xca26('0x23')][_0x3e7346[_0xca26('0xba')]];var _0x2c5713=new Hangup(_0x3e7346,_0x52437d);_0x2c5713[_0xca26('0xad')]=0x13;_0x2c5713['statedesc']=_0xca26('0x103');_0x2c5713['membername']='AMD';_0x2c5713['countmachineretry']+=0x1;_0x2c5713[_0xca26('0xf1')]+=0x1;_0x2c5713[_0xca26('0xec')]=!![];ami[_0xca26('0x53')](_0xca26('0xeb'),ut[_0xca26('0xf2')](_0x2c5713,_0xca26('0xec')));_0x23269f['createHistory'](_0x2c5713)[_0xca26('0xb8')](loggerCatch(_0xca26('0xf3')));if(_0x2c5713[_0xca26('0xf4')]+_0x2c5713[_0xca26('0xf5')]+_0x2c5713['countnoanswerretry']+_0x2c5713[_0xca26('0xf7')]+_0x2c5713[_0xca26('0x104')]+_0x2c5713[_0xca26('0x105')]+_0x2c5713[_0xca26('0xf8')]+_0x2c5713[_0xca26('0x106')]>=_0xff3f66[_0xca26('0xf9')]){_0x23269f['stateGlobal'](_0x2c5713,_0x2a8516,_0x51f6a9,'reason19\x20machine....');}else{if(_0x2c5713['countmachineretry']>=_0xff3f66[_0xca26('0x107')]){_0x23269f[_0xca26('0xfb')](_0x2c5713,_0x2a8516,_0x51f6a9,_0xca26('0x108'));}else{_0x23269f['rescheduleContact']({'active':![],'countmachineretry':_0x2c5713[_0xca26('0xf8')],'scheduledat':moment()[_0xca26('0xfc')](_0xff3f66['dialMachineRetryFrequency'],_0xca26('0x109'))[_0xca26('0x83')](_0xca26('0xfe')),'ContactId':_0x2c5713['ContactId'],'ListId':_0x2c5713[_0xca26('0xd5')],'VoiceQueueId':_0x2c5713[_0xca26('0xd7')]||undefined,'CampaignId':_0x2c5713[_0xca26('0xd8')]||undefined})[_0xca26('0xb8')](loggerCatch('[rescheduleContact][Machine]'));_0x2a8516({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xca26('0x37')]=function(_0x5f0885){var _0x258e0b=this['uniqueId'][_0x5f0885[_0xca26('0xe2')]];var _0x341bc0;if(_0x258e0b&&_0x258e0b[_0xca26('0x54')]===_0xca26('0x85')){delete this[_0xca26('0x29')][_0x5f0885['uniqueid']];this[_0xca26('0xb9')](this[_0xca26('0x23')][_0x258e0b['queue']]);this[_0xca26('0x23')][_0x258e0b[_0xca26('0xba')]]['ivrAnswerCallsDay']+=0x1;_0x341bc0=new Hangup(_0x258e0b,_0x5f0885);this[_0xca26('0xd0')](_0x341bc0)[_0xca26('0xb8')](loggerCatch(_0xca26('0x10a')));this[_0xca26('0xcf')](_0x341bc0)[_0xca26('0xb8')](loggerCatch('[syncHangupIvr]'));}if(_0x258e0b&&_0x258e0b[_0xca26('0x54')]!==_0xca26('0x85')&&isNotNull(this[_0xca26('0x22')][_0x258e0b['queue']][_0xca26('0x10b')])){delete this[_0xca26('0x29')][_0x5f0885['uniqueid']];this[_0xca26('0xb9')](this['voiceQueues'][_0x258e0b[_0xca26('0xba')]]);this[_0xca26('0x22')][_0x258e0b[_0xca26('0xba')]][_0xca26('0x68')]+=0x1;this[_0xca26('0x22')][_0x258e0b['queue']][_0xca26('0x67')]+=0x1;_0x341bc0=new Hangup(_0x258e0b,_0x5f0885);_0x341bc0[_0xca26('0xad')]=0x10;_0x341bc0[_0xca26('0xf0')]=_0xca26('0x10c');_0x341bc0[_0xca26('0xe9')]=_0xca26('0x10d');this[_0xca26('0xd0')](_0x341bc0)[_0xca26('0xb8')](loggerCatch(_0xca26('0x10a')));this[_0xca26('0xcf')](_0x341bc0)[_0xca26('0xb8')](loggerCatch(_0xca26('0x10e')));}if(_0x258e0b&&_0x258e0b[_0xca26('0x54')]!==_0xca26('0x85')&&!isNotNull(this[_0xca26('0x22')][_0x258e0b[_0xca26('0xba')]][_0xca26('0x10b')])){delete this[_0xca26('0x29')][_0x5f0885[_0xca26('0xe2')]];this['updateOriginated'](this[_0xca26('0x22')][_0x258e0b[_0xca26('0xba')]]);this[_0xca26('0x22')][_0x258e0b[_0xca26('0xba')]]['outboundUnknownCallsDay']+=0x1;_0x341bc0=new Hangup(_0x258e0b,_0x5f0885);_0x341bc0[_0xca26('0xad')]=0xc;_0x341bc0[_0xca26('0xf0')]=_0x5f0885[_0xca26('0x10f')];_0x341bc0[_0xca26('0xe9')]='Unknow';this[_0xca26('0xd0')](_0x341bc0)['catch'](loggerCatch(_0xca26('0x10a')));this[_0xca26('0xcf')](_0x341bc0)[_0xca26('0xb8')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0xca26('0x33')]=function(_0x21ae6b){var _0x29003d=this['uniqueId'][_0x21ae6b[_0xca26('0xe2')]];if(this[_0xca26('0x22')][_0x21ae6b['queue']]){if(_0x29003d&&_0x29003d[_0xca26('0x54')]!==_0xca26('0x85')){delete this[_0xca26('0x29')][_0x21ae6b[_0xca26('0xe2')]];this['voiceQueues'][_0x21ae6b[_0xca26('0xba')]][_0xca26('0x68')]+=0x1;var _0x430938=new AgentComplete(_0x29003d,_0x21ae6b);if(_0x21ae6b[_0xca26('0x110')]===_0xca26('0x111')){_0x430938[_0xca26('0x112')]=this[_0xca26('0x22')][_0x21ae6b[_0xca26('0xba')]]['dialQueueProject2']&&this[_0xca26('0x22')][_0x21ae6b[_0xca26('0xba')]][_0xca26('0x113')]?moment()[_0xca26('0x83')](_0xca26('0xfe')):undefined;}this[_0xca26('0xd0')](_0x430938)[_0xca26('0xb8')](loggerCatch(_0xca26('0x114')));this[_0xca26('0xcf')](_0x430938)[_0xca26('0xb8')](loggerCatch(_0xca26('0x115')));}}};Dialer['prototype'][_0xca26('0x116')]=function(_0x4cd40e){if(this[_0xca26('0x22')][_0x4cd40e['queue']]){if(this[_0xca26('0x29')][_0x4cd40e['uniqueid']]&&this['uniqueId'][_0x4cd40e['uniqueid']][_0xca26('0x54')]!==_0xca26('0x85')){this[_0xca26('0xb9')](this['voiceQueues'][_0x4cd40e[_0xca26('0xba')]]);this[_0xca26('0x29')][_0x4cd40e['uniqueid']][_0xca26('0x117')]=moment()[_0xca26('0x83')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xca26('0xb0')][_0xca26('0x118')]=function(_0x5f2195,_0x204fa5){this[_0xca26('0xd0')](_0x5f2195)[_0xca26('0xb8')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x204fa5==0x0){this[_0xca26('0xcf')](_0x5f2195)[_0xca26('0xb8')](loggerCatch(_0xca26('0x119')));}};Dialer[_0xca26('0xb0')][_0xca26('0x30')]=function(_0x27f7f5){var _0x529c0e=this[_0xca26('0x29')][_0x27f7f5['uniqueid']];var _0xb804bc=this;var _0x445c4d=![];var _0x2aeb30;var _0x54eced;if(this[_0xca26('0x22')][_0x27f7f5[_0xca26('0xba')]]){if(_0x529c0e&&_0x529c0e['type']!==_0xca26('0x85')){delete this[_0xca26('0x29')][_0x27f7f5[_0xca26('0xe2')]];this[_0xca26('0xb9')](this['voiceQueues'][_0x27f7f5[_0xca26('0xba')]]);_0x529c0e['droptime']=moment()[_0xca26('0x83')](_0xca26('0xfe'));var _0x1ffb38=new QueueCallerAbandon(_0x529c0e,_0x27f7f5);if(getSeconds(_0x529c0e[_0xca26('0x11a')],_0x529c0e[_0xca26('0x11b')])>=_0x529c0e['dialQueueTimeout']){this[_0xca26('0x22')][_0x27f7f5[_0xca26('0xba')]][_0xca26('0x76')]+=0x1;this[_0xca26('0x22')][_0x27f7f5[_0xca26('0xba')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xca26('0x22')][_0x27f7f5[_0xca26('0xba')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x1ffb38[_0xca26('0xad')]=0xa;_0x1ffb38['statedesc']=_0xca26('0x11c');_0x1ffb38[_0xca26('0x11d')]=_0xca26('0x11e');_0x1ffb38['agiafterat']=this[_0xca26('0x22')][_0x27f7f5[_0xca26('0xba')]][_0xca26('0x11f')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x1ffb38[_0xca26('0x104')]+=0x1;_0x1ffb38['countglobal']+=0x1;_0x2aeb30=this[_0xca26('0x22')][_0x27f7f5['queue']][_0xca26('0x120')];_0x54eced=this[_0xca26('0x22')][_0x27f7f5[_0xca26('0xba')]][_0xca26('0x121')];_0xb804bc[_0xca26('0x122')](_0x1ffb38,_0x1ffb38[_0xca26('0xad')],_0x529c0e[_0xca26('0x123')])['then'](function(_0x65cd1){_0x445c4d=_0x65cd1[_0xca26('0x124')]==0x1;if(_0x1ffb38[_0xca26('0x104')]>=_0xb804bc[_0xca26('0x22')][_0x27f7f5[_0xca26('0xba')]][_0xca26('0x125')]){_0xb804bc['queueCallerAbandonCreateState'](_0x1ffb38,_0x65cd1[_0xca26('0x124')]);}else{_0xb804bc['rescheduleContact']({'active':![],'countdropretry':_0x1ffb38[_0xca26('0x104')],'scheduledat':moment()['add'](_0xb804bc['voiceQueues'][_0x27f7f5['queue']][_0xca26('0x120')],_0xca26('0x109'))[_0xca26('0x83')](_0xca26('0xfe')),'ContactId':_0x529c0e[_0xca26('0xff')],'ListId':_0x529c0e['ListId'],'VoiceQueueId':_0x529c0e[_0xca26('0xd7')]||undefined,'CampaignId':_0x529c0e[_0xca26('0xd8')]||undefined})['catch'](loggerCatch(_0xca26('0x126')));var _0x34ce6b=new History(_0x1ffb38);_0x34ce6b[_0xca26('0xad')]=0xa;_0x34ce6b[_0xca26('0xf0')]=_0xca26('0x11c');_0x34ce6b[_0xca26('0xaf')]=moment()[_0xca26('0x83')](_0xca26('0xfe'));_0x34ce6b[_0xca26('0xae')]=_0x34ce6b[_0xca26('0xaf')];_0x34ce6b[_0xca26('0x127')]=_0x1ffb38[_0xca26('0x127')];_0x34ce6b[_0xca26('0x128')]=_0x1ffb38[_0xca26('0x128')];_0xb804bc['createHistory'](_0x34ce6b)[_0xca26('0xb8')](loggerCatch(_0xca26('0x129')));}})[_0xca26('0x40')](function(){if(_0x445c4d)_0xb804bc['swapAdditionalPhones'](_0x1ffb38,_0x2aeb30,_0x54eced)[_0xca26('0x40')](function(){return 0x1;});});}else{this[_0xca26('0x22')][_0x27f7f5['queue']][_0xca26('0x75')]+=0x1;this['voiceQueues'][_0x27f7f5['queue']][_0xca26('0x6c')]+=0x1;_0x1ffb38['state']=0xb;_0x1ffb38['statedesc']=_0xca26('0x12a');_0x1ffb38[_0xca26('0x11d')]=_0xca26('0x12b');_0x1ffb38[_0xca26('0x105')]+=0x1;_0x1ffb38[_0xca26('0xf1')]+=0x1;_0x2aeb30=this[_0xca26('0x22')][_0x27f7f5[_0xca26('0xba')]]['dialAbandonedRetryFrequency'];_0x54eced=this[_0xca26('0x22')][_0x27f7f5[_0xca26('0xba')]][_0xca26('0x121')];_0xb804bc[_0xca26('0x122')](_0x1ffb38,_0x1ffb38['state'],_0x529c0e[_0xca26('0x123')])[_0xca26('0x40')](function(_0x5ee01d){if(_0x1ffb38['countabandonedretry']>=_0xb804bc[_0xca26('0x22')][_0x27f7f5[_0xca26('0xba')]][_0xca26('0x12c')]){_0xb804bc[_0xca26('0x118')](_0x1ffb38,_0x5ee01d['additional']);}else{_0xb804bc[_0xca26('0xc5')]({'active':![],'countabandonedretry':_0x1ffb38[_0xca26('0x105')],'scheduledat':moment()[_0xca26('0xfc')](_0xb804bc[_0xca26('0x22')][_0x27f7f5[_0xca26('0xba')]][_0xca26('0x12d')],'minutes')[_0xca26('0x83')](_0xca26('0xfe')),'ContactId':_0x529c0e[_0xca26('0xff')],'ListId':_0x529c0e[_0xca26('0xd5')],'VoiceQueueId':_0x529c0e[_0xca26('0xd7')]||undefined,'CampaignId':_0x529c0e[_0xca26('0xd8')]||undefined})[_0xca26('0xb8')](loggerCatch(_0xca26('0x12e')));var _0x366fda=new History(_0x1ffb38);_0x366fda[_0xca26('0xad')]=0xb;_0x366fda[_0xca26('0xf0')]=_0xca26('0x12a');_0x366fda['starttime']=moment()['format'](_0xca26('0xfe'));_0x366fda[_0xca26('0xae')]=_0x366fda['starttime'];_0x366fda[_0xca26('0x127')]=_0x1ffb38[_0xca26('0x127')];_0x366fda[_0xca26('0x128')]=_0x1ffb38[_0xca26('0x128')];_0xb804bc[_0xca26('0xd0')](_0x366fda)[_0xca26('0xb8')](loggerCatch(_0xca26('0x12f')));}})[_0xca26('0x40')](function(){if(_0x445c4d)_0xb804bc[_0xca26('0xc0')](_0x1ffb38,_0x2aeb30,_0x54eced)['then'](function(){return 0x1;});});}}}};Dialer['prototype'][_0xca26('0x39')]=function(_0x540086){if(this[_0xca26('0x27')][_0x540086[_0xca26('0xe2')]]){this[_0xca26('0x27')][_0x540086['uniqueid']][_0xca26('0xb7')]=_0x540086[_0xca26('0xb7')];}if(this[_0xca26('0x29')][_0x540086[_0xca26('0xe2')]]){this[_0xca26('0x29')][_0x540086[_0xca26('0xe2')]][_0xca26('0xb7')]=_0x540086[_0xca26('0xb7')];}};Dialer[_0xca26('0xb0')][_0xca26('0x3b')]=function(_0x333259){if(strategy[this[_0xca26('0x22')][this[_0xca26('0x27')][_0x333259[_0xca26('0x130')]]['queue']][_0xca26('0x55')]]==='roundrobin'){if(this['actions'][_0x333259['actionid']]&&_[_0xca26('0xb4')](this[_0xca26('0x27')][_0x333259[_0xca26('0x130')]][_0xca26('0x131')])&&_0x333259['status']==='1'&&_0x333259[_0xca26('0x132')]==='0'){if(this[_0xca26('0x24')][_0x333259[_0xca26('0x133')]]){if(!this[_0xca26('0x24')][_0x333259['stateinterface']][_0xca26('0x131')]){this[_0xca26('0x24')][_0x333259[_0xca26('0x133')]][_0xca26('0x131')]=!![];this[_0xca26('0x27')][_0x333259[_0xca26('0x130')]]['locked']=!![];this[_0xca26('0x27')][_0x333259['actionid']]['stateinterface']=_0x333259[_0xca26('0x133')];}}}}else if((strategy[this[_0xca26('0x22')][this[_0xca26('0x27')][_0x333259[_0xca26('0x130')]][_0xca26('0xba')]][_0xca26('0x55')]]||'rrmemory')===_0xca26('0x134')){if(this[_0xca26('0x27')][_0x333259['actionid']]){if(this[_0xca26('0x24')][_0x333259[_0xca26('0x133')]]){this[_0xca26('0x27')][_0x333259['actionid']][_0xca26('0x133')]=_0x333259[_0xca26('0x133')];if(_['isNil'](this[_0xca26('0x2d')][this['actions'][_0x333259['actionid']][_0xca26('0xba')]])){this['queueBooked'][this[_0xca26('0x27')][_0x333259[_0xca26('0x130')]][_0xca26('0xba')]]=[];}this[_0xca26('0x2d')][this[_0xca26('0x27')][_0x333259[_0xca26('0x130')]][_0xca26('0xba')]]['push'](_[_0xca26('0x98')](_[_0xca26('0x135')](this[_0xca26('0x27')][_0x333259['actionid']],[_0xca26('0x136'),_0xca26('0x133')]),{'status':_0x333259[_0xca26('0xb6')],'paused':_0x333259[_0xca26('0x132')]}));}}}};function unlockQueueStatus(_0x36c759,_0x45c3b3){setTimeout(function(){if(_[_0xca26('0x42')](_0x36c759['queueStatusComplete'])){loggerBooked[_0xca26('0xa1')](_0xca26('0x137'),_0x45c3b3);}_0x36c759['queueStatusComplete']=!![];loggerBooked['info'](_0xca26('0x138'),_0x45c3b3,JSON[_0xca26('0x4f')](_[_0xca26('0x135')](_0x36c759,[_0xca26('0x47'),_0xca26('0x139')])));},0x1f3);}Dialer[_0xca26('0xb0')][_0xca26('0x13a')]=function(_0x309364){var _0x7ebb0a=this;var _0x1cde42=_0x7ebb0a[_0xca26('0x22')][_0x7ebb0a[_0xca26('0x27')][_0x309364[_0xca26('0x130')]][_0xca26('0xba')]];if(strategy[this[_0xca26('0x22')][this[_0xca26('0x27')][_0x309364[_0xca26('0x130')]]['queue']][_0xca26('0x55')]]==='roundrobin'){if(this[_0xca26('0x27')][_0x309364[_0xca26('0x130')]]&&this['actions'][_0x309364[_0xca26('0x130')]][_0xca26('0x133')]){this['preview'][_0xca26('0x13b')](this[_0xca26('0x27')][_0x309364[_0xca26('0x130')]]['idHopper'],this['actions'][_0x309364[_0xca26('0x130')]][_0xca26('0x133')])[_0xca26('0xb8')](function(_0x32fcae){logger['error'](_0xca26('0x13c'),util[_0xca26('0xa0')](_0x32fcae,{'showHidden':![],'depth':null}));})[_0xca26('0x20')](function(){_0x7ebb0a[_0xca26('0xb9')](_0x7ebb0a[_0xca26('0x22')][_0x7ebb0a[_0xca26('0x27')][_0x309364['actionid']][_0xca26('0xba')]]);_0x7ebb0a[_0xca26('0x24')][_0x7ebb0a['actions'][_0x309364[_0xca26('0x130')]][_0xca26('0x133')]][_0xca26('0x131')]=![];delete _0x7ebb0a[_0xca26('0x27')][_0x309364['actionid']];unlockQueueStatus(_0x1cde42);});}else{this['updateOriginated'](this['voiceQueues'][this[_0xca26('0x27')][_0x309364[_0xca26('0x130')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xca26('0x27')][_0x309364[_0xca26('0x130')]]['ContactId'],'ListId':this['actions'][_0x309364[_0xca26('0x130')]][_0xca26('0xd5')],'VoiceQueueId':this[_0xca26('0x27')][_0x309364[_0xca26('0x130')]][_0xca26('0xd7')]||undefined,'CampaignId':this[_0xca26('0x27')][_0x309364['actionid']][_0xca26('0xd8')]||undefined})['catch'](loggerCatch(_0xca26('0x13d')));delete this[_0xca26('0x27')][_0x309364[_0xca26('0x130')]];unlockQueueStatus(_0x1cde42);}}else if((strategy[this[_0xca26('0x22')][this[_0xca26('0x27')][_0x309364[_0xca26('0x130')]]['queue']]['strategy']]||'rrmemory')===_0xca26('0x134')){var _0x4427e6;if(this[_0xca26('0x27')][_0x309364[_0xca26('0x130')]]&&!_[_0xca26('0x88')](this['queueBooked'][this[_0xca26('0x27')][_0x309364[_0xca26('0x130')]][_0xca26('0xba')]])){if(this[_0xca26('0x2e')][_0x7ebb0a[_0xca26('0x27')][_0x309364[_0xca26('0x130')]][_0xca26('0xba')]]){this['queueBookedRR'][_0x7ebb0a[_0xca26('0x27')][_0x309364['actionid']][_0xca26('0xba')]]=this[_0xca26('0x2e')][this['actions'][_0x309364[_0xca26('0x130')]]['queue']]?this[_0xca26('0x2e')][this[_0xca26('0x27')][_0x309364['actionid']]['queue']]:this[_0xca26('0x2d')][this[_0xca26('0x27')][_0x309364[_0xca26('0x130')]][_0xca26('0xba')]]?this[_0xca26('0x2d')][this[_0xca26('0x27')][_0x309364[_0xca26('0x130')]][_0xca26('0xba')]]['_rr']||0x0:0x0;}this[_0xca26('0x2d')][this[_0xca26('0x27')][_0x309364[_0xca26('0x130')]][_0xca26('0xba')]]['_rr']=this[_0xca26('0x2e')][this[_0xca26('0x27')][_0x309364[_0xca26('0x130')]]['queue']];for(var _0x39cbc2=0x0;_0x39cbc2=0x0;})[_0xca26('0xb8')](myreject(_0x31e008)));}}else{_0x2ff869[_0xca26('0x153')](ami['Action']({'action':_0xca26('0x154'),'command':util['format']('iftime\x20%s,%s',_0x70a10f,!_[_0xca26('0x42')](config[_0xca26('0x150')][_0x3ab33b])?_0x3ab33b:'')})[_0xca26('0x40')](function(_0x51889b){return _0x51889b[_0xca26('0x157')][_0xca26('0x158')]('true')>=0x0;})[_0xca26('0xb8')](myreject(_0x31e008)));}Promise[_0xca26('0x159')](_0x2ff869)[_0xca26('0x40')](function(_0x1748f1){var _0x53790a=_[_0xca26('0x15a')](_0x1748f1);if(_0x53790a){return _0x21b9b2(_0x53790a);}else{_0x3d6556[_0xca26('0x43')]=_0x59103a?_0xca26('0x15b'):_0xca26('0x15c');return _0x31e008(msgResponse(_0xca26('0x15d'),_0xca26('0x14e'),'Global:\x20'+_0x59103a+'\x20'+_0x2c5895+_0xca26('0x15e')+util[_0xca26('0xa0')](_0x70a10f,{'showHidden':![],'depth':null})+_0xca26('0x15f')+_0x3ab33b));}})[_0xca26('0xb8')](function(_0x28aea9){return _0x31e008(msgResponse(_0xca26('0x14b'),_0xca26('0x14e'),JSON['stringify'](_0x28aea9)));});});};Dialer[_0xca26('0xb0')][_0xca26('0x160')]=function(_0x3fac82){var _0x5cfb7f=this;return function(){switch(_0x3fac82[_0xca26('0x62')]){case _0xca26('0x161'):freeVariablesPredictive(_0x3fac82);_0x5cfb7f[_0xca26('0x162')](_0x3fac82,0x1);break;case _0xca26('0x163'):freeVariablesPredictive(_0x3fac82);_0x5cfb7f[_0xca26('0x162')](_0x3fac82,_0x3fac82[_0xca26('0x164')]);break;case _0xca26('0x9'):_0x5cfb7f[_0xca26('0x9')](_0x3fac82);break;case _0xca26('0x8'):freeVariablesPredictive(_0x3fac82);_0x5cfb7f['handlePower'](_0x3fac82,0x1);break;default:freeVariablesPredictive(_0x3fac82);logger[_0xca26('0xa1')](_0xca26('0x165'),_0x3fac82[_0xca26('0x47')],_0xca26('0x166'));}};};Dialer[_0xca26('0xb0')]['checkPreviewRecallReminder']=function(_0x293b4e){return Promise[_0xca26('0xbd')]()['then'](cmHopper[_0xca26('0x167')](_0x293b4e['id'],previewRecallmeReminderInterval))[_0xca26('0x40')](function(_0x4697a8){for(var _0x57a1cc=0x0;_0x57a1cc<_0x4697a8[_0xca26('0xa2')];_0x57a1cc++){var _0x59160f=_0x4697a8[_0x57a1cc]['Agent'][_0xca26('0x47')];if(_0x59160f)io['to'](util[_0xca26('0x83')](_0xca26('0x168'),_0x59160f))[_0xca26('0x53')](_0xca26('0x169'),{'hopper':_0x4697a8[_0x57a1cc]});}})[_0xca26('0xb8')](function(){});};Dialer['prototype'][_0xca26('0x16a')]=function(_0x347914){var _0x53dbb4=this;return function(){_0x53dbb4[_0xca26('0x16b')](_0x347914);};};Dialer[_0xca26('0xb0')][_0xca26('0xb')]=function(_0x1d9f8e){var _0x91b8e7=this;if(isNotPreview(_0x1d9f8e[_0xca26('0x62')])){if(isVoiceQueueOutbound(_0x1d9f8e[_0xca26('0x54')])&&isActive(_0x1d9f8e['dialActive'])){_0x1d9f8e[_0xca26('0xa7')]=!![];Promise[_0xca26('0xbd')]()[_0xca26('0x40')](checkIsLoggedIn(_0x1d9f8e,_0x1d9f8e[_0xca26('0x57')]))[_0xca26('0x40')](checkIsActive(_0x1d9f8e,_0x1d9f8e[_0xca26('0x61')]))[_0xca26('0x40')](checkInterval(_0x1d9f8e))[_0xca26('0x40')](_0x91b8e7['checkIsTrunkReachable'](_0x1d9f8e))[_0xca26('0x40')](_0x91b8e7[_0xca26('0x14a')](_0x1d9f8e['dialGlobalInterval'],_0x1d9f8e[_0xca26('0x16c')],_0x1d9f8e[_0xca26('0x47')],_0x1d9f8e))[_0xca26('0x40')](_0x91b8e7['checkIfTimeIntervals'](_0x1d9f8e[_0xca26('0x4a')],_0x1d9f8e[_0xca26('0x16c')],_0x1d9f8e[_0xca26('0x47')],_0x1d9f8e))[_0xca26('0x40')](_0x91b8e7[_0xca26('0x160')](_0x1d9f8e))[_0xca26('0xb8')](loggerCatchQueueSummary('[syncQueueSummary]',_0x1d9f8e));}else{notSendMessagesQueue(_0x1d9f8e);}}else{freeVariablesPredictive(_0x1d9f8e);}};Dialer[_0xca26('0xb0')][_0xca26('0x36')]=_[_0xca26('0x16d')](function(){var _0x4639f2=_[_0xca26('0x16e')](this[_0xca26('0x22')],function(_0x36ad42){return _0x36ad42['dialPreviewRecallmeReminder'];});var _0x5a90fe=_[_0xca26('0x16e')](this[_0xca26('0x24')],function(_0x794f91){return _0x794f91[_0xca26('0x16f')]&&_0x794f91['status']===_0xca26('0xde');});if(_0x4639f2['length']>0x0&&_0x5a90fe[_0xca26('0xa2')]>0x0){return Promise[_0xca26('0xbd')]()[_0xca26('0x40')](cmHopper['handlePreviewRecallNotifications'](_['map'](_0x4639f2,'id'),previewRecallmeReminderInterval,_[_0xca26('0x170')](_0x5a90fe,'id')))['then'](function(_0x120e88){for(var _0x39ee8f=0x0;_0x39ee8f<_0x120e88['length'];_0x39ee8f++){var _0x28bafd=_0x120e88[_0x39ee8f][_0xca26('0x171')][_0xca26('0x47')];if(_0x28bafd)io['to'](util['format'](_0xca26('0x168'),_0x28bafd))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x120e88[_0x39ee8f]});}})[_0xca26('0xb8')](function(_0x10e50e){logger['error'](_0xca26('0x172'),_0x10e50e);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xca26('0xb0')][_0xca26('0x147')]=function(){var _0x29eaf8=this;var _0xc18d57;for(var _0x1dfd5b in this[_0xca26('0x23')]){if(typeof this[_0xca26('0x23')][_0x1dfd5b]!=='undefined'){_0xc18d57=this[_0xca26('0x23')][_0x1dfd5b];if(isCampaignIvr(_0xc18d57[_0xca26('0x54')])&&isActive(_0xc18d57[_0xca26('0x81')])){_0xc18d57['sendMessageOneNotActive']=!![];Promise[_0xca26('0xbd')]()[_0xca26('0x40')](checkIsActive(_0xc18d57,_0xc18d57[_0xca26('0x81')]))[_0xca26('0x40')](checkInterval(_0xc18d57))['then'](_0x29eaf8[_0xca26('0x173')](_0xc18d57))['then'](_0x29eaf8[_0xca26('0x14a')](_0xc18d57[_0xca26('0x174')],_0xc18d57[_0xca26('0x16c')],_0xc18d57[_0xca26('0x47')],_0xc18d57))[_0xca26('0x40')](_0x29eaf8['checkIfTimeIntervals'](_0xc18d57[_0xca26('0x4a')],_0xc18d57[_0xca26('0x16c')],_0xc18d57[_0xca26('0x47')],_0xc18d57))[_0xca26('0x40')](_0x29eaf8[_0xca26('0x16a')](_0xc18d57))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0xc18d57));}else{notSendMessagesCampaign(_0xc18d57);}}}};function getCallerIdRandom(_0x3e550b,_0x2ddb10){var _0x33f64d;var _0x428ae3;var _0x2590dc;if(_0x2ddb10<=0x0){_0x2ddb10=0x1;}_0x33f64d=new RegExp(_0xca26('0x175')+_0x2ddb10+'}$');_0x428ae3=Math[_0xca26('0x176')](0xa,_0x2ddb10-0x1);_0x2590dc=Math[_0xca26('0x176')](0xa,_0x2ddb10)-0x1;return util['format']('%s',_[_0xca26('0x177')](_0x3e550b,_0x33f64d,_['random'](_0x428ae3,_0x2590dc)));}function extractCalleridName(_0x1c8e65){var _0xce5e47=_0x1c8e65['match'](/"(.*?)"/);return _0xce5e47?_0xce5e47[0x1]:_0x1c8e65;}Dialer['prototype'][_0xca26('0x178')]=function(_0x2da006,_0x19e508){var _0x5b0a03=this;var _0xc6c3ea=uuid['v4']();this[_0xca26('0x27')][_0xc6c3ea]=new Action(_0x2da006,_0x19e508,_0xc6c3ea);return new Promise(function(_0xbed2f6,_0x4fb8ef){if(_[_0xca26('0x42')](_0x2da006)&&typeof _0x2da006!=='object'){return _0x4fb8ef(msgResponse(_0xca26('0x179'),'Failure',_0xca26('0x17a')));}if(_[_0xca26('0x42')](_0x19e508[_0xca26('0x17b')])||_0x19e508[_0xca26('0x17b')]===null){return _0x4fb8ef(msgResponse(_0xca26('0x179'),'Failure',_0xca26('0x17c')));}var _0x3c9f83={'XMD-CALLERID':_0x5b0a03[_0xca26('0x27')][_0xc6c3ea][_0xca26('0x17d')](),'XMD-AGI':_0x2da006[_0xca26('0x10b')]?util[_0xca26('0x83')](_0xca26('0x17e'),ipAgi,_0x2da006[_0xca26('0x10b')]):_0xca26('0x17f'),'XMD-AGIAFTER':_0x2da006[_0xca26('0x11f')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x2da006[_0xca26('0x11f')]):_0xca26('0x17f'),'XMD-QUEUE':_0x2da006[_0xca26('0x54')]==='outbound'?util[_0xca26('0x83')](_0xca26('0x180'),_0x2da006[_0xca26('0x47')],_0x2da006[_0xca26('0x181')]||'',_0x2da006[_0xca26('0x113')]?'c':'',_0x2da006['dialQueueTimeout']||0x3):_0xca26('0x17f'),'XMD-CONTACTID':_0x19e508[_0xca26('0xff')],'XMD-CDRTYPE':_0xca26('0x7'),'CALLERID(all)':_0x5b0a03['actions'][_0xc6c3ea][_0xca26('0x17d')](),'XMD-AMD':_0x2da006[_0xca26('0xe5')]?_0xca26('0x182'):_0xca26('0x17f'),'XMD-DESTINATION':_0xca26('0xe4')};if(_0x2da006[_0xca26('0xe5')]){_0x3c9f83['XMD-AMDINITIALSILENCE']=_0x2da006[_0xca26('0x183')]||0x9c4;_0x3c9f83[_0xca26('0x184')]=_0x2da006[_0xca26('0x185')]||0x5dc;_0x3c9f83[_0xca26('0x186')]=_0x2da006[_0xca26('0x187')]||0x320;_0x3c9f83['XMD-AMDTOTALANALYSISTIME']=_0x2da006['dialAMDTotalAnalysisTime']||0x1388;_0x3c9f83['XMD-AMDMINWORDLENGTH']=_0x2da006[_0xca26('0x188')]||0x64;_0x3c9f83[_0xca26('0x189')]=_0x2da006['dialAMDBetweenWordsSilence']||0x32;_0x3c9f83[_0xca26('0x18a')]=_0x2da006['dialAMDMaximumNumberOfWords']||0x3;_0x3c9f83[_0xca26('0x18b')]=_0x2da006['dialAMDSilenceThreshold']||0x100;_0x3c9f83[_0xca26('0x18c')]=_0x2da006[_0xca26('0x18d')]||0x1388;}if(_0x2da006[_0xca26('0x54')]==='outbound'){_0x3c9f83[_0xca26('0x18e')]=_0x19e508['VoiceQueueId'];}else{_0x3c9f83['XMD-CAMPAIGNID']=_0x19e508[_0xca26('0xd8')];}for(var _0x1a8a1e in _0x19e508[_0xca26('0x18f')]){if(typeof _0x19e508[_0xca26('0x18f')][_0x1a8a1e]!=='undefined'){if(isNotNull(_0x19e508[_0xca26('0x18f')][_0x1a8a1e])&&_0x1a8a1e!=='id'&&_0x1a8a1e!==_0xca26('0x190')&&_0x1a8a1e!==_0xca26('0x191')&&_0x1a8a1e!==_0xca26('0x192')){_0x3c9f83[util[_0xca26('0x83')](_0xca26('0x193'),_0xca26('0x194'),_[_0xca26('0x195')](_0x1a8a1e))]=_0x19e508[_0xca26('0x18f')][_0x1a8a1e];}}}var _0x31d53a=_0x5b0a03[_0xca26('0xdc')](_0x2da006['Trunk'])?getCallerId(_0x2da006[_0xca26('0x80')][_0xca26('0x82')],_0x2da006['dialOriginateCallerIdName'],_0x2da006[_0xca26('0x196')]>0x0?getCallerIdRandom(_0x2da006[_0xca26('0x64')],_0x2da006[_0xca26('0x196')]):_0x2da006['dialOriginateCallerIdNumber']):getCallerId(_[_0xca26('0xb4')](_0x2da006[_0xca26('0x197')])?_0x2da006[_0xca26('0x80')][_0xca26('0x82')]:_0x2da006[_0xca26('0x197')][_0xca26('0x82')],_0x2da006[_0xca26('0x63')],_0x2da006[_0xca26('0x196')]>0x0?getCallerIdRandom(_0x2da006[_0xca26('0x64')],_0x2da006[_0xca26('0x196')]):_0x2da006[_0xca26('0x64')]);if(_0x31d53a){_0x3c9f83[_0xca26('0x198')]=_0x5b0a03['actions'][_0xc6c3ea]['originatecalleridname']=extractCalleridName(_0x31d53a);_0x3c9f83['XMD-ORIGINATECALLERIDNUM']=_0x19e508[_0xca26('0x17b')];}_0x2da006['variables']=_0x3c9f83;return ami[_0xca26('0xb5')]({'actionid':_0xc6c3ea,'action':'originate','channel':_0x5b0a03['isTrunkReachable'](_0x2da006['Trunk'])?util[_0xca26('0x83')](_0xca26('0x199'),_0x2da006['Trunk'][_0xca26('0x47')],isNotNull(_0x2da006['dialPrefix'])?_0x2da006[_0xca26('0x66')][_0xca26('0x19a')]()||'':'',_0x2da006['dialCutDigit']>0x0?_0x19e508['phone'][_0xca26('0x19b')](_0x2da006['dialCutDigit']):_0x19e508['phone']):util[_0xca26('0x83')]('SIP/%s/%s%s',_[_0xca26('0xb4')](_0x2da006[_0xca26('0x197')])?_0x2da006['Trunk'][_0xca26('0x47')]:_0x2da006[_0xca26('0x197')]['name'],isNotNull(_0x2da006[_0xca26('0x66')])?_0x2da006['dialPrefix'][_0xca26('0x19a')]()||'':'',_0x2da006[_0xca26('0x19c')]>0x0?_0x19e508[_0xca26('0x17b')][_0xca26('0x19b')](_0x2da006[_0xca26('0x19c')]):_0x19e508[_0xca26('0x17b')]),'callerid':_0x31d53a,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x3c9f83,'timeout':(_0x2da006[_0xca26('0x65')]||0x1e)*0x3e8,'async':!![],'channelid':_0xc6c3ea})[_0xca26('0x40')](function(_0xd2c556){return _0xbed2f6(_0xd2c556);})[_0xca26('0xb8')](function(_0x322d3e){_0x2da006[_0xca26('0x6f')]+=0x1;var _0x372d19=new History(_0x5b0a03[_0xca26('0x27')][_0xc6c3ea]);logger[_0xca26('0xa1')](util[_0xca26('0x83')](_0xca26('0x19d'),JSON[_0xca26('0x4f')](_0x322d3e)));_0x372d19[_0xca26('0xad')]=0xe;_0x372d19[_0xca26('0xf0')]=_0xca26('0x19e');_0x372d19[_0xca26('0xaf')]=moment()[_0xca26('0x83')](_0xca26('0xfe'));_0x372d19[_0xca26('0xae')]=_0x372d19[_0xca26('0xaf')];_0x5b0a03[_0xca26('0xd0')](_0x372d19)[_0xca26('0xb8')](loggerCatch('[originate][error]'));_0x5b0a03[_0xca26('0xcf')](_0x372d19)['catch'](loggerCatch('[originate][error]'))['finally'](function(){delete _0x5b0a03[_0xca26('0x27')][_0xc6c3ea];return _0x4fb8ef(msgResponse(_0xca26('0x179'),_0xca26('0x4e'),_0xca26('0x19f')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x5275a8){var _0x3c5ffa=this[_0xca26('0x27')][_0x5275a8[_0xca26('0x130')]];if(_0x3c5ffa){delete this['actions'][_0x5275a8[_0xca26('0x130')]];_0x3c5ffa[_0xca26('0x11b')]=moment()[_0xca26('0x83')](_0xca26('0xfe'));var _0x3f63db=_0x3c5ffa[_0xca26('0x54')]===_0xca26('0x85')?this[_0xca26('0x23')][_0x3c5ffa[_0xca26('0xba')]]:this[_0xca26('0x22')][_0x3c5ffa[_0xca26('0x1a0')]()];if(!this[_0xca26('0xda')](_0x5275a8[_0xca26('0x1a1')])){this[_0xca26('0xb9')](_0x3f63db);return this[_0xca26('0x1a2')](_0x3c5ffa,_0x3f63db,_0x5275a8)[_0xca26('0xb8')](loggerCatch(_0xca26('0x1a3')));}this['uniqueId'][_0x5275a8[_0xca26('0xe2')]]=_0x3c5ffa;}};Dialer[_0xca26('0xb0')][_0xca26('0x1a4')]=function(_0x18b274,_0xd2ebac,_0x30e3be){var _0x334155=new History(_0xd2ebac);if(_0x334155[_0xca26('0xf4')]+_0x334155[_0xca26('0xf5')]+_0x334155[_0xca26('0xf6')]+_0x334155[_0xca26('0xf7')]+_0x334155[_0xca26('0x104')]+_0x334155[_0xca26('0x105')]+_0x334155[_0xca26('0xf8')]+_0x334155[_0xca26('0x106')]>=_0x30e3be[_0xca26('0xf9')]-0x1){return!![];}switch(_0x18b274){case 0x3:if(_0x334155[_0xca26('0xf6')]>=_0x30e3be[_0xca26('0x1a5')]-0x1){return!![];}this[_0xca26('0xc5')]({'active':![],'countnoanswerretry':_0x334155['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xca26('0xfc')](_0x30e3be[_0xca26('0x1a6')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x334155['ContactId'],'ListId':_0x334155[_0xca26('0xd5')],'VoiceQueueId':_0x334155[_0xca26('0xd7')]||undefined,'CampaignId':_0x334155['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x334155[_0xca26('0xf4')]>=_0x30e3be[_0xca26('0x1a7')]-0x1){return!![];}this[_0xca26('0xc5')]({'active':![],'countbusyretry':_0x334155[_0xca26('0xf4')]+=0x1,'scheduledat':moment()['add'](_0x30e3be['dialBusyRetryFrequency'],_0xca26('0x109'))['format'](_0xca26('0xfe')),'ContactId':_0x334155[_0xca26('0xff')],'ListId':_0x334155['ListId'],'VoiceQueueId':_0x334155[_0xca26('0xd7')]||undefined,'CampaignId':_0x334155[_0xca26('0xd8')]||undefined})['catch'](loggerCatch(_0xca26('0x1a8')));break;case 0x8:if(_0x334155['countcongestionretry']>=_0x30e3be[_0xca26('0x1a9')]-0x1){return!![];}this[_0xca26('0xc5')]({'active':![],'countcongestionretry':_0x334155[_0xca26('0xf5')]+=0x1,'scheduledat':moment()['add'](_0x30e3be[_0xca26('0x1aa')],'minutes')[_0xca26('0x83')](_0xca26('0xfe')),'ContactId':_0x334155['ContactId'],'ListId':_0x334155[_0xca26('0xd5')],'VoiceQueueId':_0x334155[_0xca26('0xd7')]||undefined,'CampaignId':_0x334155[_0xca26('0xd8')]||undefined})[_0xca26('0xb8')](loggerCatch(_0xca26('0x1ab')));break;case 0x0:if(_0x334155[_0xca26('0xf7')]>=_0x30e3be[_0xca26('0x1ac')]-0x1){return!![];}else{this[_0xca26('0xc5')]({'active':![],'countnosuchnumberretry':_0x334155[_0xca26('0xf7')]+=0x1,'scheduledat':moment()[_0xca26('0xfc')](_0x30e3be[_0xca26('0x1ad')],'minutes')[_0xca26('0x83')](_0xca26('0xfe')),'ContactId':_0x334155[_0xca26('0xff')],'ListId':_0x334155[_0xca26('0xd5')],'VoiceQueueId':_0x334155['VoiceQueueId']||undefined,'CampaignId':_0x334155[_0xca26('0xd8')]||undefined})['catch'](loggerCatch(_0xca26('0x1ae')));}break;case 0xa:if(_0x334155[_0xca26('0x104')]>=_0x30e3be[_0xca26('0x125')]-0x1){return!![];}this[_0xca26('0xc5')]({'active':![],'countdropretry':_0x334155[_0xca26('0x104')]+=0x1,'scheduledat':moment()[_0xca26('0xfc')](_0x30e3be[_0xca26('0x120')],_0xca26('0x109'))[_0xca26('0x83')](_0xca26('0xfe')),'ContactId':_0x334155[_0xca26('0xff')],'ListId':_0x334155[_0xca26('0xd5')],'VoiceQueueId':_0x334155[_0xca26('0xd7')]||undefined,'CampaignId':_0x334155[_0xca26('0xd8')]||undefined})[_0xca26('0xb8')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x334155[_0xca26('0x105')]>=_0x30e3be[_0xca26('0x12c')]-0x1){return!![];}this[_0xca26('0xc5')]({'active':![],'countabandonedretry':_0x334155['countabandonedretry']+=0x1,'scheduledat':moment()[_0xca26('0xfc')](_0x30e3be['dialAbandonedRetryFrequency'],_0xca26('0x109'))[_0xca26('0x83')](_0xca26('0xfe')),'ContactId':_0x334155[_0xca26('0xff')],'ListId':_0x334155[_0xca26('0xd5')],'VoiceQueueId':_0x334155[_0xca26('0xd7')]||undefined,'CampaignId':_0x334155[_0xca26('0xd8')]||undefined})[_0xca26('0xb8')](loggerCatch(_0xca26('0x12e')));break;case 0x13:if(_0x334155[_0xca26('0xf8')]>=_0x30e3be[_0xca26('0x107')]-0x1){return!![];}this[_0xca26('0xc5')]({'active':![],'countmachineretry':_0x334155[_0xca26('0xf8')]+=0x1,'scheduledat':moment()['add'](_0x30e3be[_0xca26('0xfd')],_0xca26('0x109'))[_0xca26('0x83')](_0xca26('0xfe')),'ContactId':_0x334155['ContactId'],'ListId':_0x334155[_0xca26('0xd5')],'VoiceQueueId':_0x334155[_0xca26('0xd7')]||undefined,'CampaignId':_0x334155[_0xca26('0xd8')]||undefined})[_0xca26('0xb8')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x334155[_0xca26('0x106')]>=_0x30e3be[_0xca26('0x1af')]-0x1){return!![];}this[_0xca26('0xc5')]({'active':![],'countagentrejectretry':_0x334155[_0xca26('0x106')]+=0x1,'scheduledat':moment()[_0xca26('0xfc')](_0x30e3be['dialAgentRejectRetryFrequency'],_0xca26('0x109'))[_0xca26('0x83')](_0xca26('0xfe')),'ContactId':_0x334155[_0xca26('0xff')],'ListId':_0x334155[_0xca26('0xd5')],'VoiceQueueId':_0x334155['VoiceQueueId']||undefined,'CampaignId':_0x334155[_0xca26('0xd8')]||undefined})[_0xca26('0xb8')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xca26('0xb0')][_0xca26('0x1a2')]=function(_0x480969,_0x492d86,_0x5db069){var _0x46ae85=this;var _0x1915db=new History(_0x480969);var _0x2bea40=![];var _0x1a7678;var _0x6696d7;return new Promise(function(_0x5b9dff,_0x4116e0){if(_[_0xca26('0x42')](_0x492d86)&&typeof _0x492d86!==_0xca26('0x1b0')){return _0x4116e0(msgResponse(_0xca26('0x1b1'),_0xca26('0x14e'),_0xca26('0x1b2')));}if(_['isUndefined'](_0x5db069)&&typeof _0x5db069!==_0xca26('0x1b0')){return _0x4116e0(msgResponse(_0xca26('0x1b1'),_0xca26('0x14e'),_0xca26('0x1b3')));}_0x46ae85['verifyAdditionalPhones'](_0x1915db,_0x5db069[_0xca26('0x110')],_0x492d86)[_0xca26('0x40')](function(_0x38aac4){if(_0x38aac4[_0xca26('0x124')]==0x1)_0x2bea40=!![];switch(_0x5db069[_0xca26('0x110')]){case'0':_0x492d86[_0xca26('0x6e')]+=0x1;_0x1915db[_0xca26('0xad')]=0x0;_0x1915db[_0xca26('0xf0')]='NoSuchNumber';_0x1915db[_0xca26('0xf7')]+=0x1;_0x1915db[_0xca26('0xf1')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut['buildObj'](_0x480969,_0xca26('0x1b4')));_0x1a7678=_0x492d86['dialNoSuchNumberRetryFrequency'];_0x6696d7=_0x492d86[_0xca26('0x121')];_0x46ae85['createHistory'](_0x1915db)[_0xca26('0xb8')](loggerCatch(_0xca26('0xf3')));if(_0x46ae85[_0xca26('0x1a4')](0x0,_0x480969,_0x492d86)&&!_0x2bea40){if(_0x1915db[_0xca26('0xf7')]>=_0x492d86[_0xca26('0x1ac')]){_0x46ae85[_0xca26('0xfb')](_0x1915db,_0x5b9dff,_0x4116e0,_0xca26('0x1b5'));}else{_0x46ae85[_0xca26('0x1b6')](_0x1915db,_0x5b9dff,_0x4116e0,_0xca26('0x1b5'));}}break;case'3':_0x492d86[_0xca26('0x6d')]+=0x1;_0x1915db[_0xca26('0xad')]=0x3;_0x1915db[_0xca26('0xf0')]=_0xca26('0x1b7');_0x1915db[_0xca26('0xf6')]+=0x1;_0x1915db[_0xca26('0xf1')]+=0x1;var _0x4cb983=ut['buildNoAnswerEventPayload'](_0x480969,_0x492d86);ami[_0xca26('0x53')](_0xca26('0x1b8'),_0x4cb983);_0x1a7678=_0x492d86['dialNoAnswerRetryFrequency'];_0x6696d7=_0x492d86[_0xca26('0x121')];_0x46ae85['createHistory'](_0x1915db)[_0xca26('0xb8')](loggerCatch(_0xca26('0x1b9')));if(_0x46ae85[_0xca26('0x1a4')](0x3,_0x480969,_0x492d86)&&!_0x2bea40){if(_0x1915db[_0xca26('0xf6')]>=_0x492d86[_0xca26('0x1a5')]){_0x46ae85[_0xca26('0xfb')](_0x1915db,_0x5b9dff,_0x4116e0,'reason\x203\x20ringing\x20no\x20answer');}else{_0x46ae85['stateGlobal'](_0x1915db,_0x5b9dff,_0x4116e0,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x492d86[_0xca26('0x69')]+=0x1;_0x1915db['state']=0x5;_0x1915db['statedesc']=_0xca26('0x1ba');_0x1915db[_0xca26('0xf4')]+=0x1;_0x1915db[_0xca26('0xf1')]+=0x1;ami[_0xca26('0x53')](_0xca26('0x1bb'),ut[_0xca26('0xf2')](_0x480969,'busy'));_0x1a7678=_0x492d86[_0xca26('0x1bc')];_0x6696d7=_0x492d86[_0xca26('0x121')];_0x46ae85['createHistory'](_0x1915db)['catch'](loggerCatch(_0xca26('0x1bd')));if(_0x46ae85['checkRetriveMax'](0x5,_0x480969,_0x492d86)&&!_0x2bea40){if(_0x1915db[_0xca26('0xf4')]>=_0x492d86['dialBusyMaxRetry']){_0x46ae85[_0xca26('0xfb')](_0x1915db,_0x5b9dff,_0x4116e0,'reason\x205\x20busy');}else{_0x46ae85[_0xca26('0x1b6')](_0x1915db,_0x5b9dff,_0x4116e0,'reason\x205\x20busy');}}break;case'8':_0x492d86[_0xca26('0x6a')]+=0x1;_0x1915db[_0xca26('0xad')]=0x8;_0x1915db['statedesc']=_0xca26('0x1be');_0x1915db[_0xca26('0xf5')]+=0x1;_0x1915db[_0xca26('0xf1')]+=0x1;_0x1a7678=_0x492d86[_0xca26('0x1aa')];_0x6696d7=_0x492d86['callAdditionalPhoneAfterMin'];ami['emit'](_0xca26('0x1bf'),ut[_0xca26('0xf2')](_0x480969,_0xca26('0x1c0')));_0x46ae85['createHistory'](_0x1915db)[_0xca26('0xb8')](loggerCatch(_0xca26('0x1c1')));if(_0x46ae85[_0xca26('0x1a4')](0x8,_0x480969,_0x492d86)&&!_0x2bea40){if(_0x1915db[_0xca26('0xf5')]>=_0x492d86['dialCongestionMaxRetry']){_0x46ae85[_0xca26('0xfb')](_0x1915db,_0x5b9dff,_0x4116e0,'reason\x208\x20congestion');}else{_0x46ae85[_0xca26('0x1b6')](_0x1915db,_0x5b9dff,_0x4116e0,_0xca26('0x1c2'));}}break;case'11':_0x492d86['outboundAbandonedCallsDay']+=0x1;_0x1915db[_0xca26('0xad')]=0xb;_0x1915db[_0xca26('0xf0')]='Abandoned';_0x1915db[_0xca26('0x105')]+=0x1;_0x1915db['countglobal']+=0x1;_0x1a7678=_0x492d86['dialAbandonedRetryFrequency'];_0x6696d7=_0x492d86[_0xca26('0x121')];_0x46ae85[_0xca26('0xd0')](_0x1915db)[_0xca26('0xb8')](loggerCatch(_0xca26('0x12f')));if(_0x46ae85[_0xca26('0x1a4')](0xb,_0x480969,_0x492d86)&&!_0x2bea40){if(_0x1915db[_0xca26('0x105')]>=_0x492d86['dialAbandonedMaxRetry']){_0x46ae85[_0xca26('0xfb')](_0x1915db,_0x5b9dff,_0x4116e0,_0xca26('0x1c3'));}else{_0x46ae85[_0xca26('0x1b6')](_0x1915db,_0x5b9dff,_0x4116e0,_0xca26('0x1c3'));}}break;case'20':_0x492d86['outboundRejectCallsDay']+=0x1;_0x1915db['state']=0x14;_0x1915db[_0xca26('0xf0')]='AgentReject';_0x1915db['countagentrejectretry']+=0x1;_0x1915db['countglobal']+=0x1;_0x1a7678=_0x492d86[_0xca26('0x1c4')];_0x6696d7=_0x492d86[_0xca26('0x121')];ami[_0xca26('0x53')](_0xca26('0x1c5'),ut[_0xca26('0xf2')](_0x480969,'agentreject'));_0x46ae85['createHistory'](_0x1915db)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x46ae85[_0xca26('0x1a4')](0x14,_0x480969,_0x492d86)&&!_0x2bea40){if(_0x1915db[_0xca26('0x106')]>=_0x492d86[_0xca26('0x1af')]){_0x46ae85['createStateFinal'](_0x1915db,_0x5b9dff,_0x4116e0,'reason\x2020\x20agentreject');}else{_0x46ae85[_0xca26('0x1b6')](_0x1915db,_0x5b9dff,_0x4116e0,_0xca26('0x1c6'));}}break;default:_0x492d86[_0xca26('0x72')]+=0x1;_0x1915db[_0xca26('0xad')]=0xc;_0x1915db[_0xca26('0xf0')]=_0x5db069[_0xca26('0x110')];_0x1a7678=_0x492d86[_0xca26('0x1c4')];_0x6696d7=_0x492d86[_0xca26('0x121')];_0x46ae85[_0xca26('0xd0')](_0x1915db)[_0xca26('0xb8')](loggerCatch(_0xca26('0x1c7')));if(_0x46ae85[_0xca26('0x1a4')](_0x5db069['reason'],_0x480969,_0x492d86)&&!_0x2bea40){if(_0x1915db['countbusyretry']+_0x1915db[_0xca26('0xf5')]+_0x1915db[_0xca26('0xf6')]+_0x1915db['countnosuchnumberretry']+_0x1915db[_0xca26('0x104')]+_0x1915db[_0xca26('0x105')]+_0x1915db[_0xca26('0xf8')]+_0x1915db['countagentrejectretry']>=_0x492d86[_0xca26('0xf9')]){_0x46ae85[_0xca26('0x1b6')](_0x1915db,_0x5b9dff,_0x4116e0,_0x5db069[_0xca26('0x110')]);}else{_0x46ae85[_0xca26('0xfb')](_0x1915db,_0x5b9dff,_0x4116e0,_0x5db069[_0xca26('0x110')]);}}}})[_0xca26('0x40')](function(){if(_0x2bea40){_0x46ae85[_0xca26('0xc0')](_0x1915db,_0x1a7678,_0x6696d7)[_0xca26('0x40')](function(){return _0x5b9dff(0x1);});}});});};Dialer[_0xca26('0xb0')][_0xca26('0x1b6')]=function(_0x358832,_0x4f3b97,_0x402c20,_0x413ff4){var _0x4765b0=new Final(_0x358832);_0x4765b0[_0xca26('0xad')]=0xf;_0x4765b0['statedesc']=_0xca26('0x1c8');this[_0xca26('0xfb')](_0x4765b0,_0x4f3b97,_0x402c20,_0x413ff4);};Dialer[_0xca26('0xb0')]['createStateFinal']=function(_0x5881b6,_0x167c8d,_0x430165,_0x1106eb){this[_0xca26('0xcf')](_0x5881b6)[_0xca26('0x40')](function(){return _0x167c8d(msgResponse(_0xca26('0x1b1'),'Success',_0x1106eb));})[_0xca26('0xb8')](function(){return _0x430165(msgResponse(_0xca26('0x1c9'),'Failure',_0xca26('0x1ca')));});};Dialer['prototype'][_0xca26('0x9')]=function(_0x54051b){var _0x3a84f7=_0x54051b['dialPredictiveOptimizationPercentage']/0x64;var _0x4a3575=_0x54051b['outboundDropCallsDayTimeout']/(_0x54051b[_0xca26('0x1cb')]+_0x54051b['outboundAnswerCallsDay']);var _0x18b0e8=Math[_0xca26('0x1cc')](_0x54051b[_0xca26('0x1cd')]*(_0x54051b[_0xca26('0x1ce')]/0x64));var _0x179658=Math['round'](_0x54051b['predictiveIntervalAvailable']*(_0x54051b[_0xca26('0x1cf')]/0x64));var _0x1eacd0=_0x54051b[_0xca26('0x1d0')]+_0x54051b['talking'];var _0x19a4e6=Math[_0xca26('0x1d1')](_0x54051b['erlangCalls']*_0x54051b['erlangAbandonmentRate']*_0x54051b[_0xca26('0x78')]*_0x54051b[_0xca26('0x79')]);if(_[_0xca26('0x42')](_0x54051b[_0xca26('0x2c')])){if(!_[_0xca26('0x42')](_0x54051b[_0xca26('0x2b')])){_0x54051b[_0xca26('0x2b')]=undefined;loggerPredictive[_0xca26('0xa1')](_0xca26('0x1d2'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xca26('0x42')](_0x54051b[_0xca26('0x9a')])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xca26('0x1d3'));clearInterval(_0x54051b[_0xca26('0x9a')]);_0x54051b['handlePredictive']=undefined;}_0x54051b['startProgressive']=moment()[_0xca26('0x83')](_0xca26('0xfe'));loggerPredictive[_0xca26('0x89')](_0x54051b[_0xca26('0x47')],_0xca26('0x1d4'),_0x54051b[_0xca26('0x2c')]);this[_0xca26('0x162')](_0x54051b,0x1);}else if(ifInterval(_0x54051b[_0xca26('0x1d5')],_0x54051b[_0xca26('0x2c')])){this[_0xca26('0x162')](_0x54051b,0x1);loggerPredictiveCalls[_0xca26('0x89')](_0xca26('0x1d6'),_0x54051b['startProgressive'],_0x54051b[_0xca26('0x47')]);_0x54051b[_0xca26('0x7d')]=0x0;_0x54051b['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x3a84f7<_0x4a3575&&_0x54051b[_0xca26('0x1d7')]===_0xca26('0x1d8')){freeVariablesPredictive(_0x54051b);loggerPredictive[_0xca26('0x89')](_0xca26('0x1d9'),_0xca26('0x1da'),_0x4a3575,_0xca26('0x2c'),_0x54051b[_0xca26('0x47')]);}else if(_0x19a4e6<_0x54051b['predictiveIntervalErlangCallsDroppedCalls']&&_0x54051b['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x54051b);loggerPredictive[_0xca26('0x89')](_0xca26('0x1db'),'Max\x20Drop\x20',_0x19a4e6,_0xca26('0x1dc'),_0x54051b[_0xca26('0x1dd')],_0xca26('0x2c'),_0x54051b[_0xca26('0x47')]);}else if(!ifInterval(_0x54051b[_0xca26('0x1d5')],_0x54051b[_0xca26('0x2c')])&&_[_0xca26('0x42')](_0x54051b[_0xca26('0x2b')])&&!_['isUndefined'](_0x54051b['startProgressive'])){_0x54051b[_0xca26('0x2b')]=moment()[_0xca26('0x83')](_0xca26('0xfe'));loggerPredictive[_0xca26('0x89')](_0x54051b['name'],_0xca26('0x1de'),_0x54051b[_0xca26('0x2b')]);this['averageHandleTime'](_0x54051b[_0xca26('0x1d5')])['then'](this[_0xca26('0x1df')](_0x54051b))[_0xca26('0x40')](mergeDataErlangB(_0x54051b))[_0xca26('0x40')](this[_0xca26('0x1e0')](_0x54051b))[_0xca26('0xb8')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x54051b));}else if(!ifInterval(_0x54051b['dialPredictiveInterval'],_0x54051b[_0xca26('0x2b')])){_0x54051b['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x54051b[_0xca26('0x2b')]=moment()[_0xca26('0x83')](_0xca26('0xfe'));loggerPredictive[_0xca26('0x89')](_0x54051b[_0xca26('0x47')],_0xca26('0x1e1'),_0x54051b[_0xca26('0x2b')]);clearInterval(_0x54051b[_0xca26('0x9a')]);_0x54051b[_0xca26('0x9a')]=undefined;this['averageHandleTime'](_0x54051b[_0xca26('0x1d5')])['then'](this[_0xca26('0x1df')](_0x54051b))[_0xca26('0x40')](mergeDataErlangB(_0x54051b))[_0xca26('0x40')](this['startMethodPredictive'](_0x54051b))['catch'](loggerCatchPredictive(_0xca26('0x1e2'),_0x54051b));}else if(_0x54051b['predictiveIntervalAvailable']&&_0x1eacd0<_0x54051b[_0xca26('0x1cd')]-_0x179658){freeVariablesPredictive(_0x54051b);loggerPredictive[_0xca26('0x89')](_0x54051b[_0xca26('0x47')],_0xca26('0x1e3'),_0x1eacd0,')\x20are\x20less\x20than\x20threshold\x20(',_0x54051b[_0xca26('0x1cd')],'-',_0x179658,'=',_0x54051b[_0xca26('0x1cd')]-_0x179658,')');}else if(_0x54051b[_0xca26('0x1cd')]&&_0x1eacd0>_0x54051b[_0xca26('0x1cd')]+_0x18b0e8){freeVariablesPredictive(_0x54051b);loggerPredictive[_0xca26('0x89')](_0x54051b[_0xca26('0x47')],_0xca26('0x1e3'),_0x1eacd0,_0xca26('0x1e4'),_0x54051b[_0xca26('0x1cd')],'+',_0x18b0e8,'=',_0x54051b[_0xca26('0x1cd')]+_0x18b0e8,')');}};Dialer[_0xca26('0xb0')][_0xca26('0x1df')]=function(_0x5dfaf){var _0x1e5d53=this;return function(_0x50d9fd){return new Promise(function(_0x53011c,_0x430a34){_[_0xca26('0x98')](_0x5dfaf,_0x50d9fd[0x0]);if(checkGetDataPredictive(_0x50d9fd[0x0])){var _0x2bfa2b=_0x5dfaf['predictiveIntervalAvailable']=_0x5dfaf[_0xca26('0x5b')]+_0x5dfaf[_0xca26('0x1d0')];var _0x4ca7f8=_0x5dfaf[_0xca26('0x1d5')]*0x3c;var _0x39d458=_0x50d9fd[0x0][_0xca26('0x90')]+_0x50d9fd[0x0][_0xca26('0x74')];var _0x2d586b=(_0x50d9fd[0x0][_0xca26('0x73')]+_0x50d9fd[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x50d9fd[0x0][_0xca26('0x75')])/_0x50d9fd[0x0][_0xca26('0x7b')];_0x5dfaf[_0xca26('0x78')]=_0x2d586b>0x0?_0x2d586b:0x1;switch(_0x5dfaf['dialPredictiveOptimization']){case _0xca26('0x1d8'):var _0x2f2ac3=_0x5dfaf[_0xca26('0x1e5')]/0x64;return _0x1e5d53[_0xca26('0x1e6')](_0x2bfa2b,_0x4ca7f8,_0x39d458,_0x2d586b,_0x2f2ac3)[_0xca26('0x40')](function(_0x36273d){return _0x53011c(_0x36273d);});case'agentBusyFactor':var _0x33a9a3=_0x5dfaf['dialPredictiveOptimizationPercentage']/0x64;return _0x1e5d53[_0xca26('0x1e7')](_0x2bfa2b,_0x4ca7f8,_0x39d458,_0x2d586b,_0x33a9a3)[_0xca26('0x40')](function(_0x58b1a5){return _0x53011c(_0x58b1a5);});default:return _0x430a34(msgResponse(_0xca26('0x1e8'),_0xca26('0x14e'),_0xca26('0x1e9')));}}else{return _0x430a34(msgResponse(_0xca26('0x1e8'),_0xca26('0x14e'),_0xca26('0x1ea')));}});};};Dialer[_0xca26('0xb0')][_0xca26('0x1eb')]=function(_0x467c84){var _0x165f10=this;return function(_0x3697c9){return new Promise(function(_0x3f1f24,_0x49e704){_[_0xca26('0x98')](_0x467c84,_0x3697c9[0x0]);if(checkGetDataPredictive(_0x3697c9[0x0])){loggerPredictive['info'](JSON[_0xca26('0x4f')](_0x3697c9[0x0]));if(_0x467c84[_0xca26('0x1d7')]===_0xca26('0x1d8')){return _0x165f10[_0xca26('0xcd')](_0x467c84['id'])[_0xca26('0x40')](function(_0x242274){var _0x564260=_0x467c84[_0xca26('0x57')]-_0x242274[0x0]['outboundQueuePauses'];var _0x9d982c=_0x467c84['dialPredictiveInterval']*0x3c;var _0x569e5c=_0x3697c9[0x0][_0xca26('0x90')]+_0x3697c9[0x0][_0xca26('0x74')];var _0x290567=(_0x3697c9[0x0][_0xca26('0x73')]+_0x3697c9[0x0][_0xca26('0x76')]+_0x3697c9[0x0][_0xca26('0x75')])/_0x3697c9[0x0]['predictiveIntervalTotalCalls'];var _0x288b2b=_0x467c84[_0xca26('0x1e5')]/0x64;_0x467c84['predictiveIntervalPauses']=_0x242274[0x0][_0xca26('0x1ec')]||0x0;_0x467c84['predictiveIntervalHitRate']=_0x290567>0x0?_0x290567:0x1;return _0x165f10[_0xca26('0x1e6')](_0x564260,_0x9d982c,_0x569e5c,_0x290567,_0x288b2b);})['then'](function(_0x5c09fb){return _0x3f1f24(_0x5c09fb);})[_0xca26('0xb8')](function(_0xa5ee8b){return _0x49e704(msgResponse('[CatchErlangB]','Failure',JSON['stringify'](_0xa5ee8b)));});}if(_0x467c84[_0xca26('0x1d7')]==='agentBusyFactor'){return _0x165f10['getVoiceQueueRtPauses'](_0x467c84['id'])[_0xca26('0x40')](function(_0x575733){var _0x1f2cbe=_0x467c84[_0xca26('0x57')]-_0x575733[0x0][_0xca26('0x1ec')];var _0x492796=_0x467c84[_0xca26('0x1d5')]*0x3c;var _0x159d11=_0x3697c9[0x0][_0xca26('0x90')]+_0x3697c9[0x0][_0xca26('0x74')];var _0x1e265c=(_0x3697c9[0x0][_0xca26('0x73')]+_0x3697c9[0x0][_0xca26('0x76')]+_0x3697c9[0x0][_0xca26('0x75')])/_0x3697c9[0x0][_0xca26('0x7b')];var _0x4c40cc=_0x467c84[_0xca26('0x1e5')]/0x64;_0x467c84['predictiveIntervalPauses']=_0x575733[0x0][_0xca26('0x1ec')]||0x0;_0x467c84[_0xca26('0x78')]=_0x1e265c>0x0?_0x1e265c:0x1;return _0x165f10['busyFactor'](_0x1f2cbe,_0x492796,_0x159d11,_0x1e265c,_0x4c40cc);})['then'](function(_0x79d614){return _0x3f1f24(_0x79d614);})['catch'](function(_0x4b68db){return _0x49e704(msgResponse('[CatchErlangB]','Failure',JSON[_0xca26('0x4f')](_0x4b68db)));});}}else{return _0x49e704(msgResponse(_0xca26('0x1e8'),'Failure',_0xca26('0x1ea')));}});};};Dialer[_0xca26('0xb0')][_0xca26('0x1e0')]=function(_0x233dba){var _0x127194=this;return function(){var _0x37fd0d=0x0;var _0x55b71b=Math['floor'](_0x233dba['erlangCallToSecond']*0x3e8);if(_0x55b71b>0x0){_0x55b71b=_0x55b71b<0x64?0x64:_0x55b71b;loggerPredictive[_0xca26('0x89')](_0x233dba['name'],_0xca26('0x1ed'),_0x55b71b,_0xca26('0x50'));_0x233dba[_0xca26('0x9a')]=setInterval(function(){_0x127194[_0xca26('0x9a')](_0x233dba);loggerPredictiveCalls[_0xca26('0x89')]('[handlePredictive]',_0x37fd0d+=0x1);},_0x55b71b);}else{loggerPredictive[_0xca26('0x89')](_0x233dba[_0xca26('0x47')],_0xca26('0x1ee'));}};};Dialer['prototype'][_0xca26('0x1ef')]=function(_0x40212c,_0x16b6a0){var _0x4d0136=this;return function(_0x4e472a){if(_[_0xca26('0x88')](_0x4e472a)){if(_[_0xca26('0xb4')](_0x16b6a0[_0xca26('0xd6')])||!_0x16b6a0[_0xca26('0x1f0')]){if(_0x40212c[_0xca26('0x62')]==='booked'){_0x40212c[_0xca26('0x139')]=_[_0xca26('0x42')](_0x40212c[_0xca26('0x139')])?!![]:_0x40212c['queueStatusComplete'];var _0x1c1530=uuid['v4']();_0x4d0136[_0xca26('0x27')][_0x1c1530]=new Action(_0x40212c,_0x16b6a0,_0x1c1530);loggerBooked['info']('[booked][checkContactBlack]',_0x1c1530,_0xca26('0x1f1'),JSON[_0xca26('0x4f')](_0x40212c[_0xca26('0x139')]),_0xca26('0x1f2'),_0x40212c[_0xca26('0x47')]);if(_0x40212c[_0xca26('0x139')]){_0x40212c[_0xca26('0x139')]=![];_0x4d0136[_0xca26('0x2d')][_0x4d0136[_0xca26('0x27')][_0x1c1530][_0xca26('0xba')]]=[];ami[_0xca26('0xb5')]({'actionid':_0x1c1530,'action':_0xca26('0x1f3'),'queue':_0x40212c[_0xca26('0x47')]})[_0xca26('0xb8')](function(){_0x4d0136[_0xca26('0xb9')](_0x40212c);_0x4d0136[_0xca26('0xc5')]({'active':![],'ContactId':_0x4d0136['actions'][_0x1c1530][_0xca26('0xff')],'ListId':_0x4d0136[_0xca26('0x27')][_0x1c1530]['ListId'],'VoiceQueueId':_0x4d0136[_0xca26('0x27')][_0x1c1530]['VoiceQueueId']||undefined,'CampaignId':_0x4d0136[_0xca26('0x27')][_0x1c1530][_0xca26('0xd8')]||undefined})['catch'](loggerCatch(_0xca26('0x1f4')));delete _0x4d0136['actions'][_0x1c1530];});}else{loggerBooked[_0xca26('0x89')]('[booked][checkContactBlack][else]',JSON[_0xca26('0x4f')](_0x40212c[_0xca26('0x139')]),_0xca26('0x1f2'),_0x40212c[_0xca26('0x47')]);_0x4d0136['updateOriginated'](_0x40212c);_0x4d0136[_0xca26('0xc5')]({'active':![],'ContactId':_0x4d0136[_0xca26('0x27')][_0x1c1530][_0xca26('0xff')],'ListId':_0x4d0136['actions'][_0x1c1530][_0xca26('0xd5')],'VoiceQueueId':_0x4d0136[_0xca26('0x27')][_0x1c1530][_0xca26('0xd7')]||undefined,'CampaignId':_0x4d0136[_0xca26('0x27')][_0x1c1530][_0xca26('0xd8')]||undefined})[_0xca26('0xb8')](loggerCatch(_0xca26('0x1f4')));delete _0x4d0136['actions'][_0x1c1530];}}else{return _0x4d0136[_0xca26('0x178')](_0x40212c,_0x16b6a0);}}else{if(getDiff(_0x16b6a0[_0xca26('0x1f5')])<_0x40212c[_0xca26('0x1f6')]*0x3c){if(_0x16b6a0['Agent']&&!_0x16b6a0['Agent'][_0xca26('0x1f7')]){_0x4d0136['preview']['run'](_0x16b6a0['id'])[_0xca26('0x20')](function(){_0x4d0136[_0xca26('0xb9')](_0x40212c);});}else{_0x4d0136[_0xca26('0xc6')]({'active':![]},_0x16b6a0['id'],0x1)[_0xca26('0x20')](function(){_0x4d0136[_0xca26('0xb9')](_0x40212c);});}}else{_0x40212c[_0xca26('0x70')]+=0x1;_0x4d0136[_0xca26('0xb9')](_0x40212c);if(_0x40212c[_0xca26('0x1f8')]){_0x4d0136['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x16b6a0[_0xca26('0xff')],'ListId':_0x16b6a0[_0xca26('0xd5')],'VoiceQueueId':_0x16b6a0[_0xca26('0xd7')]||undefined,'CampaignId':_0x16b6a0[_0xca26('0xd8')]||undefined})[_0xca26('0xb8')](loggerCatch(_0xca26('0x1f9')));_0x4d0136['createHistory'](createObjHistory(_0x40212c,_0x16b6a0,'RECALLINQUEUE',0x17,_0xca26('0x1fa')))[_0xca26('0xb8')](loggerCatch(_0xca26('0x1fb')));}else{_0x4d0136[_0xca26('0xd4')](createObjHistory(_0x40212c,_0x16b6a0,_0xca26('0x1fc'),0x16,_0xca26('0x1fd')),'[Originate][HistoryRecallClose][historyCatch]',_0xca26('0x1fe'));}}}}else{_0x40212c[_0xca26('0x1ff')]+=0x1;_0x4d0136['saveInDb'](createObjHistory(_0x40212c,_0x16b6a0,_0xca26('0x200'),0xd,_0xca26('0x201')),_0xca26('0x202'),_0xca26('0x203'));throw _0xca26('0x204');}};};Dialer['prototype'][_0xca26('0x16b')]=function(_0x26eed4){var _0x3677d9=this;var _0x180cb2=_0x26eed4[_0xca26('0x205')]-_0x26eed4['originated']-_0x26eed4[_0xca26('0xc9')];emitCampaignSummary(_0x26eed4);if(_0x180cb2>0x0){if(_0x180cb2>this[_0xca26('0x25')]){_0x180cb2=this[_0xca26('0x25')];}_0x26eed4['temp']+=_0x180cb2;this[_0xca26('0xcb')](_0x26eed4['id'],_0x180cb2,_0x26eed4[_0xca26('0x206')],_0x26eed4)['then'](function(_0xa353cf){_0x26eed4[_0xca26('0xc9')]-=_0x180cb2;_0x26eed4['temp']=_0x26eed4[_0xca26('0xc9')]>0x0?_0x26eed4[_0xca26('0xc9')]:0x0;if(!checkContactEmpty(_0xa353cf)){_0x26eed4[_0xca26('0x43')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xca26('0x89')]('[getContactCampaign2][Empty]'+_0x26eed4[_0xca26('0x47')]);}else{_0x26eed4['originated']+=_0xa353cf[_0xca26('0xa2')];_0x26eed4['message']=_0xca26('0x207');for(var _0x41d646=0x0;_0x41d646<_0xa353cf[_0xca26('0xa2')];_0x41d646+=0x1){_0x26eed4[_0xca26('0x208')]+=0x1;if(_['isNil'](_0xa353cf[_0x41d646])||_[_0xca26('0xb4')](_0xa353cf[_0x41d646][_0xca26('0x18f')])||_['isNil'](_0xa353cf[_0x41d646][_0xca26('0x17b')])){_0x3677d9[_0xca26('0x209')](_0xca26('0x20a'),_0x26eed4,_0xa353cf[_0x41d646]);}else{_0x3677d9['checkIsBlackListIvr'](_[_0xca26('0x135')](_0xa353cf[_0x41d646],[_0xca26('0xd8'),'phone']))['then'](_0x3677d9['checkContactBlack'](_0x26eed4,_0xa353cf[_0x41d646]))[_0xca26('0xb8')](_0x3677d9[_0xca26('0x20b')](_0xca26('0x20c'),_0x26eed4));}}}})[_0xca26('0xb8')](loggerGetContactDialer('[getContactCampaign2]',_0x26eed4,_0x180cb2));}};Dialer[_0xca26('0xb0')]['handlePower']=function(_0x145a1e,_0x475801){var _0x132779=this;var _0x525abf=[];var _0x4cb86d=_0x475801>=0x1?_0x475801:0x1;if(_0x145a1e[_0xca26('0x62')]==='booked'){_0x4cb86d=0x1;}var _0x2a250d=Math[_0xca26('0x1d1')](_0x145a1e[_0xca26('0x1d0')]*_0x4cb86d)-_0x145a1e[_0xca26('0x7c')]-_0x145a1e[_0xca26('0xc9')];emitVoiceQueueSummary(_0x145a1e);if(_0x145a1e['dialLimitQueue']>0x0){var _0x2ecba4=_0x145a1e[_0xca26('0x20d')]-_0x145a1e[_0xca26('0x7c')]-_0x145a1e['talking']-_0x145a1e[_0xca26('0xc9')]-_0x145a1e[_0xca26('0xa8')];if(_0x2a250d>_0x2ecba4){_0x2a250d=_0x2ecba4;}}if(_0x2a250d>0x0){if(_0x145a1e[_0xca26('0x62')]===_0xca26('0x8')){_0x2a250d=0x1;}if(_0x2a250d>this['maxNumberOriginate']){_0x2a250d=this[_0xca26('0x25')];}_0x145a1e[_0xca26('0xc9')]+=_0x2a250d;for(var _0x285651 in this[_0xca26('0x24')]){if(typeof this[_0xca26('0x24')][_0x285651]!=='undefined'){if(this[_0xca26('0x24')][_0x285651][_0xca26('0xad')]===_0xca26('0x20e')&&this['agents'][_0x285651]['status']===_0xca26('0xde')){_0x525abf[_0xca26('0x153')](this[_0xca26('0x24')][_0x285651]['id']);}}}this[_0xca26('0xc8')](_0x145a1e['id'],_0x525abf,_0x2a250d,_0x145a1e[_0xca26('0x206')],_0x145a1e)[_0xca26('0x40')](function(_0x3d089c){_0x145a1e[_0xca26('0xc9')]-=_0x2a250d;_0x145a1e[_0xca26('0xc9')]=_0x145a1e['temp']>0x0?_0x145a1e['temp']:0x0;if(!checkContactEmpty(_0x3d089c)){_0x132779[_0xca26('0xbc')](_0x145a1e)[_0xca26('0x40')](sendMessageReschedule(_0x145a1e))[_0xca26('0xb8')](loggerCatch(_0xca26('0xbe')));}else{_0x145a1e[_0xca26('0x7c')]+=_0x3d089c[_0xca26('0xa2')];_0x145a1e['message']=_0x145a1e['dialMethod']===_0xca26('0x8')?_0xca26('0x182'):'RUNNING';for(var _0x137ee2=0x0;_0x137ee2<_0x3d089c[_0xca26('0xa2')];_0x137ee2+=0x1){if(_[_0xca26('0xb4')](_0x3d089c[_0x137ee2])||_[_0xca26('0xb4')](_0x3d089c[_0x137ee2]['Contact'])||_[_0xca26('0xb4')](_0x3d089c[_0x137ee2][_0xca26('0x17b')])){_0x132779['emptyContact'](_0xca26('0x20a'),_0x145a1e,_0x3d089c[_0x137ee2]);}else{_0x132779[_0xca26('0xbf')](_['pick'](_0x3d089c[_0x137ee2],[_0xca26('0xd7'),_0xca26('0x17b')]))[_0xca26('0x40')](_0x132779['checkContactBlack'](_0x145a1e,_0x3d089c[_0x137ee2]))[_0xca26('0xb8')](_0x132779[_0xca26('0x20b')](_0xca26('0x20a'),_0x145a1e));}}}})[_0xca26('0xb8')](loggerGetContactDialer(_0xca26('0x20f'),_0x145a1e,_0x2a250d));}};Dialer[_0xca26('0xb0')][_0xca26('0x9a')]=function(_0x1c0091){if(_0x1c0091['dialLimitQueue']>0x0){var _0x25a30a=_0x1c0091[_0xca26('0x20d')]-_0x1c0091[_0xca26('0x7c')]-_0x1c0091[_0xca26('0x5b')];if(_0x25a30a>0x0){this[_0xca26('0x210')](_0x1c0091);}else{loggerPredictiveCalls[_0xca26('0x89')](_0xca26('0x211'));}}else{this[_0xca26('0x210')](_0x1c0091);}};Dialer['prototype'][_0xca26('0x210')]=function(_0x11eb03){var _0x3d588b=this;var _0xdf288d=[];_0x11eb03[_0xca26('0x7c')]+=0x1;for(var _0xf65086 in this[_0xca26('0x24')]){if(typeof this[_0xca26('0x24')][_0xf65086]!==_0xca26('0xa3')){if(this[_0xca26('0x24')][_0xf65086][_0xca26('0xad')]==='not_inuse'&&this['agents'][_0xf65086][_0xca26('0xb6')]===_0xca26('0xde')){_0xdf288d[_0xca26('0x153')](this[_0xca26('0x24')][_0xf65086]['id']);}}}this['getContactDialer'](_0x11eb03['id'],_0xdf288d,0x1,_0x11eb03[_0xca26('0x206')],_0x11eb03)[_0xca26('0x40')](function(_0x33c58a){if(!checkContactEmpty(_0x33c58a)){checkContactLowerLimitOriginate(_0x11eb03,0x1,0x0);_0x3d588b['countReScheduled'](_0x11eb03)['then'](sendMessageReschedule(_0x11eb03))[_0xca26('0xb8')](loggerCatch(_0xca26('0xbe')));}else{_0x11eb03[_0xca26('0x43')]=_0xca26('0x207');if(_[_0xca26('0xb4')](_0x33c58a[0x0])||_[_0xca26('0xb4')](_0x33c58a[0x0][_0xca26('0x18f')])||_['isNil'](_0x33c58a[0x0][_0xca26('0x17b')])){_0x3d588b[_0xca26('0x209')](_0xca26('0x20a'),_0x11eb03,_0x33c58a[0x0]);}else{_0x3d588b[_0xca26('0xbf')](_[_0xca26('0x135')](_0x33c58a[0x0],[_0xca26('0xd7'),'phone']))[_0xca26('0x40')](_0x3d588b[_0xca26('0x1ef')](_0x11eb03,_0x33c58a[0x0]))[_0xca26('0xb8')](_0x3d588b[_0xca26('0x20b')](_0xca26('0x212'),_0x11eb03));}}})[_0xca26('0xb8')](loggerGetContactDialer(_0xca26('0x213'),_0x11eb03,0x1));emitVoiceQueueSummary(_0x11eb03);};Dialer[_0xca26('0xb0')]['abandonmentRate']=function(_0x48f4d9,_0x2d314b,_0x45fffe,_0x41ae19,_0x238896,_0x492618){loggerPredictive[_0xca26('0x89')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xca26('0x89')]('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',_0x48f4d9);loggerPredictive['info'](_0xca26('0x214'),_0x2d314b);loggerPredictive['info'](_0xca26('0x215'),_0x45fffe);loggerPredictive[_0xca26('0x89')](_0xca26('0x216'),_0x41ae19);loggerPredictive['info'](_0xca26('0x217'),_0x238896);loggerPredictive['info'](_0xca26('0x91'));return new Promise(function(_0x182585,_0x5e5e4a){if(_0x48f4d9<=0x0||isNaN(_0x48f4d9)){return _0x5e5e4a(msgResponse(_0xca26('0x218'),_0xca26('0x4e'),_0xca26('0x219')+_0x48f4d9));}if(_0x45fffe<=0x0||isNaN(_0x45fffe)){return _0x5e5e4a(msgResponse('[abandonmentRate]','Error','Ts\x20=\x20'+_0x45fffe));}if(_0x41ae19<=0x0||isNaN(_0x41ae19)){return _0x5e5e4a(msgResponse(_0xca26('0x218'),'Error',_0xca26('0x21a')+_0x41ae19));}if(_0x2d314b<=0x0||isNaN(_0x2d314b)){return _0x5e5e4a(msgResponse(_0xca26('0x218'),_0xca26('0x4e'),_0xca26('0x21b')+_0x2d314b));}if(_0x238896<=0x0||isNaN(_0x238896)){return _0x5e5e4a(msgResponse(_0xca26('0x218'),'Error',_0xca26('0x21c')+_0x238896));}_0x492618=_0x492618||0x0;var _0x22085f=0x1/_0x45fffe;var _0x46f5f4=0x0;var _0x29308f=0x0;var _0x27e55a=0x0;var _0x23b08e=0x0;for(var _0x2690ff=0x0;_0x27e55a<_0x238896;_0x2690ff+=0x1){_0x29308f=_0x2690ff/_0x2d314b;_0x46f5f4=(_0x41ae19*_0x29308f+_0x492618)/_0x22085f;_0x27e55a=erlangb(_0x46f5f4,_0x48f4d9);_0x23b08e=_0x46f5f4/_0x48f4d9*(0x1-erlangb(_0x46f5f4,_0x48f4d9));}return _0x182585({'erlangCalls':_0x2690ff,'erlangCallToSecond':_0x2d314b/_0x2690ff,'erlangAbandonmentRate':_0x27e55a,'erlangBusyFactor':_0x23b08e});});};Dialer[_0xca26('0xb0')][_0xca26('0x1e7')]=function(_0x151a0e,_0x14fabf,_0x609134,_0x573d3e,_0x86121a,_0x301fd0){loggerPredictive[_0xca26('0x89')](_0xca26('0x21d'));loggerPredictive['info'](_0xca26('0x21e'),_0x151a0e);loggerPredictive[_0xca26('0x89')](_0xca26('0x214'),_0x14fabf);loggerPredictive[_0xca26('0x89')]('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',_0x609134);loggerPredictive[_0xca26('0x89')](_0xca26('0x216'),_0x573d3e);loggerPredictive[_0xca26('0x89')](_0xca26('0x21f'),_0x86121a);loggerPredictive[_0xca26('0x89')]('---------------------------');return new Promise(function(_0x423413,_0x34648b){if(_0x151a0e<=0x0||isNaN(_0x151a0e)){return _0x34648b(msgResponse(_0xca26('0x220'),_0xca26('0x4e'),'m\x20=\x20'+_0x151a0e));}if(_0x609134<=0x0||isNaN(_0x609134)){return _0x34648b(msgResponse('[busyFactor]',_0xca26('0x4e'),_0xca26('0x221')+_0x609134));}if(_0x573d3e<=0x0||isNaN(_0x573d3e)){return _0x34648b(msgResponse(_0xca26('0x220'),_0xca26('0x4e'),_0xca26('0x21a')+_0x573d3e));}if(_0x14fabf<=0x0||isNaN(_0x14fabf)){return _0x34648b(msgResponse(_0xca26('0x220'),'Error','interval\x20=\x20'+_0x14fabf));}if(_0x86121a<=0x0||isNaN(_0x86121a)){return _0x34648b(msgResponse('[busyFactor]',_0xca26('0x4e'),_0xca26('0x222')+_0x86121a));}_0x301fd0=_0x301fd0||0x0;var _0x254c69=0x1/_0x609134;var _0x38ad39=0x0;var _0x372daa=0x0;var _0x5f6eae=0x0;var _0x4c1472=0x0;for(var _0x549b41=0x0;_0x4c1472<_0x86121a;_0x549b41+=0x1){_0x372daa=_0x549b41/_0x14fabf;_0x38ad39=(_0x573d3e*_0x372daa+_0x301fd0)/_0x254c69;_0x5f6eae=erlangb(_0x38ad39,_0x151a0e);_0x4c1472=_0x38ad39/_0x151a0e*(0x1-erlangb(_0x38ad39,_0x151a0e));}return _0x423413({'erlangCalls':_0x549b41,'erlangCallToSecond':_0x14fabf/_0x549b41,'erlangAbandonmentRate':_0x5f6eae,'erlangBusyFactor':_0x4c1472});});};module[_0xca26('0x223')]=Dialer; \ No newline at end of file +var _0x1846=['checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','outboundBusyCallsDay','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','tryOriginatePredictive','[handlePredictive][limitChannel]','[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','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./hangup','env','127.0.0.1','rrmemory','roundrobin','enqueue','tail','finally','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','varset','syncVarSet','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Intervals','Error','milliseconds','seconds','type','answered','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','callerid','stringify','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','stack','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','pTalking','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','IS_DISACTIVED','state','endtime','prototype','clearZombieChannels','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','campaigns','[Dialer][checkChannel][ivr]','resolve','[countReScheduled]\x20','checkIsBlackList','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','merge','ListId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','active','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','HANGUP','updateOriginated','statedesc','HangupInAMD','AMD','emit','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','membername','countmachineretry','countglobal','countbusyretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','ContactId','VoiceQueueId','[rescheduleContact][Machine]','dialAMDActive','value','amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countcongestionretry','countdropretry','countagentrejectretry','add','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','AnswerAGI','AGI','[syncHangupIvr]','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','agiafterat','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','dialDropMaxRetry','queueCallerAbandonCreateState','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedMaxRetry','additional','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','syncQueueMember','strategy','actionid','paused','stateinterface','locked','push','pick','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','idHopper','_rr','length','unlockRR','contactAgent-idHopper:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[booked][unlock3]','resetActiveCalls','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','iftime\x20%s,%s','interval','content','indexOf','true','command','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','checkDialMethod','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','Agent','user:%s','launchHandleIvr','handleIvr','loggedIn','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','user:dialPreviewRecallReminder','syncCampaigns','pow','replace','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','ACTIVE','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','createdAt','%s%s','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','variables','dialCutDigit','substring','trim','from-sip','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1846,0x7b));var _0x6184=function(_0x51f67c,_0x45f896){_0x51f67c=_0x51f67c-0x0;var _0x3ff50f=_0x1846[_0x51f67c];return _0x3ff50f;};'use strict';var util=require(_0x6184('0x0'));var _=require(_0x6184('0x1'));var uuid=require('uuid');var moment=require(_0x6184('0x2'));var rr=require('rr');var md5=require(_0x6184('0x3'));var Redis=require(_0x6184('0x4'));var ut=require(_0x6184('0x5'));var config=require(_0x6184('0x6'));var logger=require(_0x6184('0x7'))(_0x6184('0x8'));var loggerBooked=require(_0x6184('0x7'))(_0x6184('0x9'));var loggerPredictive=require(_0x6184('0x7'))(_0x6184('0xa'));var loggerPredictiveCalls=require(_0x6184('0x7'))(_0x6184('0xb'));var loggerSyncQueueSummary=require(_0x6184('0x7'))(_0x6184('0xc'));var ami=require('../ami');config[_0x6184('0xd')]=_[_0x6184('0xe')](config[_0x6184('0xd')],{'host':_0x6184('0xf'),'port':0x18eb});var io=require(_0x6184('0x10'))(new Redis(config[_0x6184('0xd')]));var cmHopper=require(_0x6184('0x11'));var cmHopperHistory=require(_0x6184('0x12'));var cmHopperAdditionalPhone=require(_0x6184('0x13'));var cmHopperBlack=require(_0x6184('0x14'));var voiceQueueRt=require(_0x6184('0x15'));var RpcSetting=require(_0x6184('0x16'));var Action=require(_0x6184('0x17'));var History=require(_0x6184('0x18'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x6184('0x19'));var ipAgi=process[_0x6184('0x1a')]['XCALLY_IP_AGI']||_0x6184('0x1b');var strategy={'rrmemory':_0x6184('0x1c'),'roundrobin':_0x6184('0x1d')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0x6184('0x1e')]=function(_0x1359c0){this[_0x6184('0x1f')]=this[_0x6184('0x1f')]?this[_0x6184('0x1f')][_0x6184('0x20')](_0x1359c0):_0x1359c0();};function Dialer(_0x15d87d,_0x4493d1){this[_0x6184('0x21')]=new Sequence();this[_0x6184('0x22')]=_0x4493d1;this['voiceQueues']=_0x15d87d[_0x6184('0x23')];this['campaigns']=_0x15d87d['campaigns'];this[_0x6184('0x24')]=_0x15d87d[_0x6184('0x24')];this[_0x6184('0x25')]=_0x15d87d[_0x6184('0x25')];this[_0x6184('0x26')]=config['maxNumberOriginate']||0x2;this[_0x6184('0x27')]={};this[_0x6184('0x28')]={};this[_0x6184('0x29')]={};this[_0x6184('0x2a')]={};this[_0x6184('0x2b')]={};this[_0x6184('0x2c')]={};this['startProgressive']={};this[_0x6184('0x2d')]={};this[_0x6184('0x2e')]={};this[_0x6184('0x2f')]={};ami['on'](_0x6184('0x30'),this[_0x6184('0x31')][_0x6184('0x32')](this));ami['on'](_0x6184('0x33'),this['syncQueueCallerAbandon'][_0x6184('0x32')](this));ami['on'](_0x6184('0x34'),this[_0x6184('0x35')][_0x6184('0x32')](this));ami['on'](_0x6184('0x36'),this[_0x6184('0x37')][_0x6184('0x32')](this));ami['on'](_0x6184('0x38'),this[_0x6184('0xc')][_0x6184('0x32')](this));ami['on'](_0x6184('0x39'),this[_0x6184('0x3a')][_0x6184('0x32')](this));ami['on'](_0x6184('0x3b'),this[_0x6184('0x3c')][_0x6184('0x32')](this));ami['on'](_0x6184('0x3d'),this['syncNewExten']['bind'](this));ami['on'](_0x6184('0x3e'),this[_0x6184('0x3f')]['bind'](this));ami['on']('queuemember',this['syncQueueMember'][_0x6184('0x32')](this));ami['on'](_0x6184('0x40'),this[_0x6184('0x41')][_0x6184('0x32')](this));this[_0x6184('0x42')]();this[_0x6184('0x43')]();RpcSetting[_0x6184('0x44')]()[_0x6184('0x45')](function(_0x6770fd){previewRecallmeReminderInterval=_0x6770fd['previewRecallmeReminderInterval'];});}function isNotNull(_0x3d042f){return _0x3d042f!==null&&!_[_0x6184('0x46')](_0x3d042f);}function checkIsLoggedIn(_0x47552c,_0x305b94){return function(){if(_0x305b94<=0x0){_0x47552c[_0x6184('0x47')]='AGENTS_NOT_LOGGED';throw _0x47552c[_0x6184('0x48')]+_0x6184('0x49');}};}function isActive(_0x3a509c){return _0x3a509c;}function checkIsActive(_0x294e76,_0x41a041){return function(){if(!isActive(_0x41a041)){_0x294e76[_0x6184('0x47')]=_0x6184('0x4a');throw _0x294e76[_0x6184('0x48')]+'\x20NOT\x20Active';}};}function checkInterval(_0x34a299){return function(){if(!isNotNull(_0x34a299[_0x6184('0x4b')])){_0x34a299['message']=_0x6184('0x4c');throw _0x34a299[_0x6184('0x48')]+_0x6184('0x4d');}if(!isNotNull(_0x34a299[_0x6184('0x4b')]['Intervals'])){_0x34a299[_0x6184('0x47')]=_0x6184('0x4c');throw _0x34a299[_0x6184('0x48')]+_0x6184('0x4d');}if(!isNotNull(_[_0x6184('0x4e')](_0x34a299['Interval'][_0x6184('0x4f')]))){_0x34a299[_0x6184('0x47')]=_0x6184('0x4c');throw _0x34a299[_0x6184('0x48')]+_0x6184('0x4d');}};}function msgResponse(_0x4bbf16,_0x31bf20,_0x67cefb){return{'action':_0x4bbf16,'response':_0x31bf20,'message':_0x67cefb,'stack':_0x67cefb};}function myreject(_0x51aa7e){return function(_0x53cafc){return _0x51aa7e(msgResponse('[ifTime][Action]',_0x6184('0x50'),JSON['stringify'](_0x53cafc)));};}function getSeconds(_0x1bdf2c,_0x51e82e){var _0x4b725f=moment(_0x1bdf2c)[_0x6184('0x51')](0x0);var _0x2fa6f7=moment(_0x51e82e)[_0x6184('0x51')](0x0);return _0x4b725f['diff'](_0x2fa6f7,_0x6184('0x52'));}function emit(_0x171cf2,_0x2fa862,_0x3d5e80){io['to'](_0x171cf2)['emit'](_0x2fa862,_0x3d5e80);}function emitVoiceQueueSummary(_0xbbd401){if(_0xbbd401[_0x6184('0x53')]==='outbound'){var _0x3ffebf={'id':_0xbbd401['id'],'name':_0xbbd401['name'],'strategy':_0xbbd401['strategy'],'answered':_0xbbd401[_0x6184('0x54')],'available':_0xbbd401['available'],'loggedIn':_0xbbd401['loggedIn'],'pTalking':_0xbbd401['pTalking'],'sumBillable':_0xbbd401['sumBillable'],'sumDuration':_0xbbd401[_0x6184('0x55')],'sumHoldTime':_0xbbd401[_0x6184('0x56')]||0x0,'talking':_0xbbd401['talking'],'total':_0xbbd401[_0x6184('0x57')],'type':_0xbbd401[_0x6184('0x53')],'unmanaged':_0xbbd401[_0x6184('0x58')],'abandoned':_0xbbd401[_0x6184('0x59')],'waiting':_0xbbd401[_0x6184('0x5a')],'loggedInDb':_0xbbd401[_0x6184('0x5b')],'dialActive':_0xbbd401[_0x6184('0x5c')],'dialMethod':_0xbbd401[_0x6184('0x5d')],'dialOriginateCallerIdName':_0xbbd401[_0x6184('0x5e')],'dialOriginateCallerIdNumber':_0xbbd401[_0x6184('0x5f')],'dialOriginateTimeout':_0xbbd401[_0x6184('0x60')],'dialPrefix':_0xbbd401[_0x6184('0x61')],'outboundAnswerAgiCallsDay':_0xbbd401[_0x6184('0x62')],'outboundAnswerCallsDay':_0xbbd401[_0x6184('0x63')],'outboundBlacklistCallsDay':_0xbbd401[_0x6184('0x64')],'outboundBusyCallsDay':_0xbbd401['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0xbbd401[_0x6184('0x65')],'outboundDropCallsDayACS':_0xbbd401['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0xbbd401[_0x6184('0x66')],'outboundDropCallsDayTimeout':_0xbbd401[_0x6184('0x67')],'outboundNoAnswerCallsDay':_0xbbd401['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0xbbd401[_0x6184('0x68')],'outboundOriginateFailureCallsDay':_0xbbd401[_0x6184('0x69')],'outboundReCallsDay':_0xbbd401[_0x6184('0x6a')],'outboundRejectCallsDay':_0xbbd401[_0x6184('0x6b')],'outboundUnknownCallsDay':_0xbbd401['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0xbbd401[_0x6184('0x6c')],'predictiveIntervalAvgHoldtime':_0xbbd401['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0xbbd401['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0xbbd401[_0x6184('0x6d')],'predictiveIntervalDroppedCallsTimeout':_0xbbd401['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0xbbd401[_0x6184('0x6e')],'predictiveIntervalErlangCallsDroppedCalls':_0xbbd401['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0xbbd401[_0x6184('0x6f')],'predictiveIntervalMultiplicativeFactor':_0xbbd401['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0xbbd401[_0x6184('0x70')],'predictiveIntervalAvailable':_0xbbd401['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0xbbd401[_0x6184('0x71')],'message':_0xbbd401[_0x6184('0x47')],'originated':_0xbbd401[_0x6184('0x72')],'erlangCalls':_0xbbd401[_0x6184('0x73')],'erlangCallToSecond':_0xbbd401[_0x6184('0x74')],'erlangAbandonmentRate':_0xbbd401[_0x6184('0x75')],'erlangBusyFactor':_0xbbd401[_0x6184('0x76')],'startPredictive':_0xbbd401[_0x6184('0x2c')],'startProgressive':_0xbbd401[_0x6184('0x77')]};if(_0xbbd401['Trunk']){_0x3ffebf[_0x6184('0x78')]={'id':_0xbbd401[_0x6184('0x78')]['id'],'name':_0xbbd401[_0x6184('0x78')][_0x6184('0x48')],'active':_0xbbd401[_0x6184('0x78')]['active'],'callerid':_0xbbd401['Trunk'][_0x6184('0x79')]};}if(_0xbbd401['Interval']){_0x3ffebf['Interval']={'id':_0xbbd401[_0x6184('0x4b')]['id'],'name':_0xbbd401[_0x6184('0x4b')]['name']};}var _0x1b602d=md5(JSON[_0x6184('0x7a')](_0x3ffebf));if(_0xbbd401['md5']!==_0x1b602d){_0xbbd401[_0x6184('0x3')]=_0x1b602d;emit(util[_0x6184('0x7b')](_0x6184('0x7c'),_0x3ffebf[_0x6184('0x48')]),_0x6184('0x7d'),_0x3ffebf);}}}function emitCampaignSummary(_0x3ed50b){if(_0x3ed50b[_0x6184('0x53')]===_0x6184('0x7e')){emit(util['format']('campaign:ivr:%s',_0x3ed50b[_0x6184('0x48')]),_0x6184('0x7f'),_0x3ed50b);}}function checkGetDataPredictive(_0x412783){if(isNotNull(_0x412783)&&!_[_0x6184('0x4e')](_0x412783)){loggerPredictive['info'](_0x6184('0x80'));loggerPredictive[_0x6184('0x81')](_0x6184('0x82'),_0x412783[_0x6184('0x71')]);loggerPredictive[_0x6184('0x81')](_0x6184('0x83'),_0x412783[_0x6184('0x6c')]);loggerPredictive[_0x6184('0x81')](_0x6184('0x84'),_0x412783[_0x6184('0x85')]);loggerPredictive[_0x6184('0x81')](_0x6184('0x86'),_0x412783['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x6184('0x81')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x412783[_0x6184('0x87')]);loggerPredictive[_0x6184('0x81')](_0x6184('0x88'),_0x412783[_0x6184('0x89')]);loggerPredictive[_0x6184('0x81')](_0x6184('0x8a'));if(_0x412783[_0x6184('0x71')]>0x0){if(!_[_0x6184('0x46')](_0x412783['predictiveIntervalAvgTalktime'])&&_0x412783[_0x6184('0x89')]>0x0){return!![];}loggerPredictive[_0x6184('0x81')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x6184('0x46')](_0x412783[_0x6184('0x87')])&&_0x412783[_0x6184('0x87')]>0x0){return!![];}loggerPredictive[_0x6184('0x81')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x6184('0x81')](_0x6184('0x8b'));}}else{loggerPredictive['info'](_0x6184('0x8c'));}return![];}function mergeDataErlangB(_0x45de6d){return function(_0x2127f0){loggerPredictive[_0x6184('0x81')](_0x6184('0x8d'));loggerPredictive[_0x6184('0x81')](_0x6184('0x8e'),_0x2127f0['erlangCalls']);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2127f0[_0x6184('0x74')]);loggerPredictive[_0x6184('0x81')](_0x6184('0x8f'),_0x2127f0[_0x6184('0x75')]);loggerPredictive['info'](_0x6184('0x90'),_0x2127f0['erlangBusyFactor']);loggerPredictive[_0x6184('0x81')](_0x6184('0x8f'),_0x2127f0['erlangAbandonmentRate']);loggerPredictive['info'](_0x6184('0x8a'));_['merge'](_0x45de6d,_0x2127f0);};}function getDiff(_0x5bf91b){var _0x4ffe69=moment()['milliseconds'](0x0);var _0x214e3a=moment(_0x5bf91b)['milliseconds'](0x0);return _0x4ffe69[_0x6184('0x91')](_0x214e3a,_0x6184('0x52'));}function ifInterval(_0x2ff443,_0x5c17e8){if(_[_0x6184('0x46')](_0x5c17e8)){return![];}return getDiff(_0x5c17e8)<_0x2ff443*0x3c;}function freeVariablesPredictive(_0x880da4){if(isNotNull(_0x880da4)){if(!_[_0x6184('0x46')](_0x880da4['startProgressive'])){_0x880da4[_0x6184('0x77')]=undefined;loggerPredictive[_0x6184('0x81')](_0x880da4['name'],_0x6184('0x92'));}if(!_[_0x6184('0x46')](_0x880da4['startPredictive'])){_0x880da4[_0x6184('0x2c')]=undefined;loggerPredictive[_0x6184('0x81')](_0x880da4[_0x6184('0x48')],_0x6184('0x93'));}if(!_[_0x6184('0x46')](_0x880da4[_0x6184('0x94')])){clearInterval(_0x880da4[_0x6184('0x94')]);_0x880da4[_0x6184('0x94')]=undefined;loggerPredictive[_0x6184('0x81')](_0x880da4['name'],_0x6184('0x95'));}}}function erlangb(_0x27fa6b,_0x50080b){if(_0x50080b===0x0){return 0x0;}var _0x553863=0x1;for(var _0x1e7540=0x1;_0x1e7540<=_0x50080b;_0x1e7540+=0x1){_0x553863=0x1+_0x553863*_0x1e7540/_0x27fa6b;}return 0x1/_0x553863;}function isVoiceQueueOutbound(_0x2c4b3f){return _0x2c4b3f===_0x6184('0x96');}function isNotPreview(_0x24cb17){return _0x24cb17!=='preview';}function isCampaignIvr(_0x34a0aa){return _0x34a0aa==='ivr';}function getCallerId(_0x5b3f22,_0x38bc98,_0x571574){if(!_[_0x6184('0x46')](_0x571574)&&typeof _0x571574===_0x6184('0x97')&&!_[_0x6184('0x4e')](_0x571574)){if(!_[_0x6184('0x46')](_0x38bc98)&&typeof _0x38bc98===_0x6184('0x97')&&!_[_0x6184('0x4e')](_0x38bc98)){return util['format'](_0x6184('0x98'),_0x38bc98,_0x571574);}return util['format']('\x22%s\x22\x20<%s>',_0x571574,_0x571574);}if(!_['isUndefined'](_0x5b3f22)&&typeof _0x5b3f22==='string'&&!_[_0x6184('0x4e')](_0x5b3f22)){return _0x5b3f22;}return _0x6184('0x99');}function loggerCatchQueueSummary(_0x34bd52,_0x15f1e0){return function(_0x482fab){freeVariablesPredictive(_0x15f1e0);emitVoiceQueueSummary(_0x15f1e0);emitCampaignSummary(_0x15f1e0);loggerSyncQueueSummary[_0x6184('0x9a')](_0x34bd52,util[_0x6184('0x9b')](_0x482fab,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x5d7071,_0x4b4cc0){return function(_0x1d588c){loggerPredictive[_0x6184('0x9c')](_0x4b4cc0['name'],_0x5d7071);loggerPredictive['error'](_0x1d588c[_0x6184('0x9d')]);freeVariablesPredictive(_0x4b4cc0);};}function loggerCatch(_0x564d4c){return function(_0x4b95d6){logger[_0x6184('0x9c')](_0x564d4c,util[_0x6184('0x9b')](_0x4b95d6,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x58584f){return _0x58584f&&!_[_0x6184('0x46')](_0x58584f)&&_0x58584f['length']>0x0;}function decremetOriginate(_0x2a29ad){if(!_['isUndefined'](_0x2a29ad)&&_0x2a29ad!==null){if(typeof _0x2a29ad['originated']!==_0x6184('0x9e')){if(_0x2a29ad[_0x6184('0x72')]>0x0){_0x2a29ad[_0x6184('0x72')]-=0x1;}else{logger[_0x6184('0x9c')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x6184('0x9c')](_0x6184('0x9f'));}}function checkContactLowerLimitOriginate(_0x52aece,_0x1f4ac6,_0x4623a7){if(_0x1f4ac6>_0x4623a7){for(var _0x394fe2=0x0;_0x394fe2<_0x1f4ac6-_0x4623a7;_0x394fe2+=0x1){decremetOriginate(_0x52aece);}}}function loggerGetContactDialer(_0x1d00be,_0x1c6e23,_0xb96e82){return function(_0x2f0ee7){checkContactLowerLimitOriginate(_0x1c6e23,_0xb96e82,0x0);logger[_0x6184('0x9c')](_0x1d00be,util[_0x6184('0x9b')](_0x2f0ee7,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x251bf7){return function(_0x563fc1){if(isNotNull(_0x563fc1)&&isNotNull(_0x563fc1[0x0])){if(_0x563fc1[0x0][_0x6184('0xa0')]>0x0){_0x251bf7[_0x6184('0x47')]=_0x6184('0xa1');logger['info']('[getContactDialer2][ReScheduled]'+_0x251bf7['name'],_0x563fc1[0x0][_0x6184('0xa0')],_0x6184('0xa2'));}else{_0x251bf7['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0x6184('0x81')](_0x6184('0xa3')+_0x251bf7[_0x6184('0x48')]);}}};}function notSendMessagesQueue(_0x2295b2){if(_0x2295b2[_0x6184('0xa4')]){freeVariablesPredictive(_0x2295b2);if(_0x2295b2[_0x6184('0x72')]===0x0&&_0x2295b2[_0x6184('0xa5')]===0x0&&_0x2295b2[_0x6184('0x5a')]===0x0&&(_0x2295b2[_0x6184('0xa6')]||0x0)===0x0){_0x2295b2[_0x6184('0xa4')]=![];_0x2295b2[_0x6184('0xa7')]=0x0;_0x2295b2[_0x6184('0x47')]=_0x6184('0x4a');loggerSyncQueueSummary[_0x6184('0x9a')](_0x6184('0xa8'),_0x2295b2['name'],'is\x20not\x20active');}else{_0x2295b2[_0x6184('0x47')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x6184('0x9a')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2295b2[_0x6184('0x48')],_0x6184('0xa9'));}emitVoiceQueueSummary(_0x2295b2);}}function notSendMessagesCampaign(_0x5acc7f){if(_0x5acc7f[_0x6184('0xa4')]){if(_0x5acc7f[_0x6184('0x72')]===0x0){_0x5acc7f['sendMessageOneNotActive']=![];_0x5acc7f['message']=_0x6184('0x4a');loggerSyncQueueSummary[_0x6184('0x9a')](_0x6184('0xaa'),_0x5acc7f[_0x6184('0x48')],_0x6184('0xab'));}else{_0x5acc7f[_0x6184('0x47')]=_0x6184('0xac');loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5acc7f['name'],_0x6184('0xa9'));}emitCampaignSummary(_0x5acc7f);}}function createObjHistory(_0x5576c7,_0x5b8965,_0x53f201,_0x4e9769,_0x425715){_0x5576c7[_0x6184('0x47')]=_0x53f201;var _0x4afd08=new Action(_0x5576c7,_0x5b8965);var _0x342467=new History(_0x4afd08);_0x342467[_0x6184('0xad')]=_0x4e9769;_0x342467['statedesc']=_0x425715;_0x342467[_0x6184('0xae')]=_0x4afd08['starttime'];return _0x342467;}Dialer[_0x6184('0xaf')]['loopClearZombieChannels']=function(){var _0x1f3194=this;setInterval(function(){_0x1f3194['clearZombieChannels'](_0x1f3194[_0x6184('0x2a')],'[uniqueid]');_0x1f3194[_0x6184('0xb0')](_0x1f3194[_0x6184('0x28')],_0x6184('0xb1'));},0x32c8);};Dialer[_0x6184('0xaf')][_0x6184('0xb0')]=function(_0x2377e8,_0x109e5b){var _0x30c0bb=this;for(var _0x4c7a32 in _0x2377e8){if(typeof _0x2377e8[_0x4c7a32]!==_0x6184('0x9e')){this[_0x6184('0x21')][_0x6184('0x1e')](function(){if(!_[_0x6184('0xb2')](_0x2377e8[_0x4c7a32])){return ami[_0x6184('0xb3')]({'action':_0x6184('0xb4'),'channel':_0x2377e8[_0x4c7a32][_0x6184('0xb5')]})[_0x6184('0xb6')](function(_0xae878f){if(_0xae878f[_0x6184('0x47')]===_0x6184('0xb7')){setTimeout(function(){if(_0x2377e8[_0x4c7a32]&&_0x2377e8[_0x4c7a32][_0x6184('0x53')]!==_0x6184('0x7e')){_0x30c0bb['updateOriginated'](_0x30c0bb[_0x6184('0x23')][_0x2377e8[_0x4c7a32][_0x6184('0xb8')]]);logger['error'](_0x6184('0xb9'),_0x109e5b,_0x4c7a32,_0x2377e8[_0x4c7a32][_0x6184('0xb8')]);delete _0x2377e8[_0x4c7a32];}if(_0x2377e8[_0x4c7a32]&&_0x2377e8[_0x4c7a32]['type']==='ivr'){_0x30c0bb['updateOriginated'](_0x30c0bb[_0x6184('0xba')][_0x2377e8[_0x4c7a32][_0x6184('0xb8')]]);logger[_0x6184('0x9c')](_0x6184('0xbb'),_0x109e5b,_0x4c7a32,_0x2377e8[_0x4c7a32][_0x6184('0xb8')]);delete _0x2377e8[_0x4c7a32];}},0x2328);}});}});}}};Dialer[_0x6184('0xaf')]['countReScheduled']=function(_0x489b85){return Promise[_0x6184('0xbc')]()[_0x6184('0x45')](cmHopper['countReScheduled'](_0x489b85))['catch'](loggerCatch(_0x6184('0xbd')));};Dialer[_0x6184('0xaf')][_0x6184('0xbe')]=function(_0x40416c){return Promise['resolve']()[_0x6184('0x45')](cmHopperBlack[_0x6184('0xbe')](_0x40416c))[_0x6184('0xb6')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x6184('0xaf')][_0x6184('0xbf')]=function(_0x3f4156,_0x4dd091,_0x519a51){return Promise[_0x6184('0xbc')]()['then'](cmHopperAdditionalPhone[_0x6184('0xbf')](_0x3f4156,_0x4dd091,_0x519a51))[_0x6184('0xb6')](loggerCatch(_0x6184('0xc0')));};Dialer['prototype']['swapAdditionalPhones']=function(_0x510bb3,_0x2f4947,_0x13701a){return Promise[_0x6184('0xbc')]()['then'](cmHopperAdditionalPhone[_0x6184('0xc1')](_0x510bb3,_0x2f4947,_0x13701a))[_0x6184('0xb6')](loggerCatch(_0x6184('0xc2')));};Dialer[_0x6184('0xaf')][_0x6184('0xc3')]=function(_0x15489d){return Promise['resolve']()[_0x6184('0x45')](cmHopperBlack[_0x6184('0xc3')](_0x15489d))[_0x6184('0xb6')](loggerCatch(_0x6184('0xc4')));};Dialer['prototype'][_0x6184('0xc5')]=function(_0x1d3021){return Promise['resolve']()['then'](cmHopperHistory[_0x6184('0xc6')](_0x1d3021))[_0x6184('0xb6')](loggerCatch(_0x6184('0xc7')));};Dialer[_0x6184('0xaf')][_0x6184('0xc8')]=function(_0x337de7){return Promise['resolve']()[_0x6184('0x45')](cmHopper['rescheduleContact'](_0x337de7))[_0x6184('0xb6')](loggerCatch(_0x6184('0xc9')));};Dialer[_0x6184('0xaf')][_0x6184('0xca')]=function(_0xf927a7,_0x4a2aea,_0x1d606c){return Promise[_0x6184('0xbc')]()[_0x6184('0x45')](cmHopper[_0x6184('0xca')](_0xf927a7,_0x4a2aea,_0x1d606c))[_0x6184('0xb6')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x6184('0xaf')]['getContactDialer']=function(_0x4638c3,_0x25bc6b,_0x2d7082,_0x334252,_0x58a956){return Promise['resolve']()[_0x6184('0x45')](cmHopper['getContactDialer'](_0x4638c3,_0x25bc6b,_0x2d7082,_0x334252))['catch'](function(_0x514bfa){_0x58a956[_0x6184('0xcb')]-=_0x2d7082;_0x58a956[_0x6184('0xcb')]=_0x58a956[_0x6184('0xcb')]>0x0?_0x58a956['temp']:0x0;loggerCatch(_0x6184('0xcc'))(_0x514bfa);});};Dialer[_0x6184('0xaf')]['getContactDialerIvr']=function(_0x633216,_0xc3672d,_0x1146d0,_0x21d199){return Promise[_0x6184('0xbc')]()[_0x6184('0x45')](cmHopper[_0x6184('0xcd')](_0x633216,_0xc3672d,_0x1146d0))[_0x6184('0xb6')](function(_0x16cf59){_0x21d199[_0x6184('0xcb')]-=_0xc3672d;_0x21d199[_0x6184('0xcb')]=_0x21d199['temp']>0x0?_0x21d199[_0x6184('0xcb')]:0x0;loggerCatch(_0x6184('0xce'))(_0x16cf59);});};Dialer[_0x6184('0xaf')][_0x6184('0xcf')]=function(_0x2853d3){return Promise[_0x6184('0xbc')]()[_0x6184('0x45')](voiceQueueRt[_0x6184('0xcf')](_0x2853d3))[_0x6184('0xb6')](loggerCatch(_0x6184('0xd0')));};Dialer[_0x6184('0xaf')][_0x6184('0xd1')]=function(_0x1be820){return Promise['resolve']()[_0x6184('0x45')](cmHopper['moveContactManagedDialer'](_0x1be820))[_0x6184('0xb6')](loggerCatch(_0x6184('0xd2')));};Dialer[_0x6184('0xaf')][_0x6184('0xd3')]=function(_0x1417eb){return Promise[_0x6184('0xbc')]()[_0x6184('0x45')](cmHopperHistory['createHistory'](_0x1417eb))[_0x6184('0xb6')](loggerCatch('[createHistory]\x20'));};Dialer[_0x6184('0xaf')]['updateOriginated']=function(_0x14c7c4){if(!_[_0x6184('0x46')](_0x14c7c4)&&_0x14c7c4!==null){if(typeof _0x14c7c4['originated']!==_0x6184('0x9e')){if(_0x14c7c4[_0x6184('0x72')]>0x0){_0x14c7c4['originated']-=0x1;}else{logger[_0x6184('0x9c')](_0x6184('0xd4'));}}}else{logger[_0x6184('0x9c')](_0x6184('0xd5'));}};Dialer[_0x6184('0xaf')][_0x6184('0xd6')]=function(_0x237e4b,_0x1e60be){var _0x517b34=this;return function(_0x26677c){_0x517b34['updateOriginated'](_0x1e60be);logger[_0x6184('0x9c')](_0x237e4b,util[_0x6184('0x9b')](_0x26677c,{'showHidden':![],'depth':null}));};};Dialer[_0x6184('0xaf')][_0x6184('0xd7')]=function(_0x4d7309,_0x3cff81,_0x509153){var _0x5ecfa4={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x3cff81);this[_0x6184('0xd8')](_[_0x6184('0xd9')](_0x5ecfa4,_['pick'](_0x509153,['ContactId',_0x6184('0xda'),_0x6184('0xdb'),'VoiceQueueId',_0x6184('0xdc')])),_0x6184('0xdd'),_0x6184('0xde'));logger[_0x6184('0x9c')](_0x4d7309);};Dialer[_0x6184('0xaf')][_0x6184('0xdf')]=function(_0x22993f){return _0x22993f===_0x6184('0xe0');};Dialer[_0x6184('0xaf')]['isTrunkReachable']=function(_0x53f946){return!_[_0x6184('0x46')](_0x53f946)&&_0x53f946&&!_[_0x6184('0x46')](_0x53f946['name'])&&!_[_0x6184('0x46')](_0x53f946[_0x6184('0xe1')])&&_0x53f946[_0x6184('0xe1')]&&(this[_0x6184('0x25')][util['format'](_0x6184('0xe2'),_0x53f946['name'])][_0x6184('0xb4')]===_0x6184('0xe3')||this[_0x6184('0x25')][util[_0x6184('0x7b')](_0x6184('0xe2'),_0x53f946[_0x6184('0x48')])][_0x6184('0xb4')]===_0x6184('0xe4'));};Dialer[_0x6184('0xaf')][_0x6184('0xd8')]=function(_0x5a1ec6,_0x1453b6,_0x195371){this['createHistory'](_0x5a1ec6)[_0x6184('0xb6')](loggerCatch(_0x1453b6));this['moveContactManagedDialer'](_0x5a1ec6)[_0x6184('0xb6')](loggerCatch(_0x195371));};Dialer['prototype'][_0x6184('0x3f')]=function(_0x2b252e){var _0x1c8caa=this;var _0x29133f=this[_0x6184('0x2a')][_0x2b252e[_0x6184('0xe5')]];var _0x23e383;if(!_[_0x6184('0xb2')](_0x2b252e)&&!_[_0x6184('0xb2')](_0x2b252e[_0x6184('0xe6')])&&!_[_0x6184('0xb2')](_0x2b252e[_0x6184('0xe6')][_0x6184('0xe7')])&&_0x2b252e[_0x6184('0xe8')]==='xcally-motion-dialer'&&_0x29133f){if(_0x29133f[_0x6184('0x53')]!==_0x6184('0x7e')&&this['voiceQueues'][_0x29133f['queue']]['dialAMDActive']&&_0x2b252e['value']===_0x6184('0xe9')){delete this[_0x6184('0x2a')][_0x2b252e['uniqueid']];this[_0x6184('0xea')](this[_0x6184('0x23')][_0x29133f[_0x6184('0xb8')]]);this['voiceQueues'][_0x29133f[_0x6184('0xb8')]][_0x6184('0x63')]+=0x1;this[_0x6184('0x23')][_0x29133f[_0x6184('0xb8')]][_0x6184('0x62')]+=0x1;_0x23e383=new Hangup(_0x29133f,_0x2b252e);_0x23e383['state']=0x12;_0x23e383[_0x6184('0xeb')]=_0x6184('0xec');_0x23e383['membername']=_0x6184('0xed');ami[_0x6184('0xee')](_0x6184('0xef'),ut[_0x6184('0xf0')](_0x23e383,'amd'));this[_0x6184('0xd8')](_0x23e383,_0x6184('0xf1'),_0x6184('0xf2'));}if(_0x29133f[_0x6184('0x53')]!==_0x6184('0x7e')&&this['voiceQueues'][_0x29133f['queue']]['dialAMDActive']&&_0x2b252e['value']===_0x6184('0xf3')){return new Promise(function(_0x6b799b,_0x3cac56){delete _0x1c8caa[_0x6184('0x2a')][_0x2b252e[_0x6184('0xe5')]];_0x1c8caa[_0x6184('0xea')](_0x1c8caa['voiceQueues'][_0x29133f[_0x6184('0xb8')]]);_0x1c8caa['voiceQueues'][_0x29133f[_0x6184('0xb8')]][_0x6184('0x63')]+=0x1;_0x1c8caa['voiceQueues'][_0x29133f[_0x6184('0xb8')]][_0x6184('0x62')]+=0x1;var _0x31a3e4=_0x1c8caa[_0x6184('0x23')][_0x29133f[_0x6184('0xb8')]];var _0x27a419=new Hangup(_0x29133f,_0x2b252e);_0x27a419[_0x6184('0xad')]=0x13;_0x27a419[_0x6184('0xeb')]=_0x6184('0xf4');_0x27a419[_0x6184('0xf5')]='AMD';_0x27a419[_0x6184('0xf6')]+=0x1;_0x27a419[_0x6184('0xf7')]+=0x1;_0x27a419['amd']=!![];ami['emit'](_0x6184('0xef'),ut[_0x6184('0xf0')](_0x27a419,'amd'));_0x1c8caa['createHistory'](_0x27a419)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x27a419[_0x6184('0xf8')]+_0x27a419['countcongestionretry']+_0x27a419[_0x6184('0xf9')]+_0x27a419[_0x6184('0xfa')]+_0x27a419['countdropretry']+_0x27a419[_0x6184('0xfb')]+_0x27a419[_0x6184('0xf6')]+_0x27a419['countagentrejectretry']>=_0x31a3e4[_0x6184('0xfc')]){_0x1c8caa[_0x6184('0xfd')](_0x27a419,_0x6b799b,_0x3cac56,_0x6184('0xfe'));}else{if(_0x27a419['countmachineretry']>=_0x31a3e4[_0x6184('0xff')]){_0x1c8caa[_0x6184('0x100')](_0x27a419,_0x6b799b,_0x3cac56,_0x6184('0x101'));}else{_0x1c8caa[_0x6184('0xc8')]({'active':![],'countmachineretry':_0x27a419[_0x6184('0xf6')],'scheduledat':moment()['add'](_0x31a3e4[_0x6184('0x102')],_0x6184('0x103'))[_0x6184('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x27a419[_0x6184('0x104')],'ListId':_0x27a419[_0x6184('0xda')],'VoiceQueueId':_0x27a419[_0x6184('0x105')]||undefined,'CampaignId':_0x27a419[_0x6184('0xdc')]||undefined})['catch'](loggerCatch(_0x6184('0x106')));_0x6b799b({'reschedule':0x1});}}});}if(_0x29133f['type']===_0x6184('0x7e')&&this[_0x6184('0xba')][_0x29133f[_0x6184('0xb8')]][_0x6184('0x107')]&&_0x2b252e[_0x6184('0x108')]===_0x6184('0xe9')){delete this[_0x6184('0x2a')][_0x2b252e[_0x6184('0xe5')]];this[_0x6184('0xea')](this[_0x6184('0xba')][_0x29133f[_0x6184('0xb8')]]);_0x23e383=new Hangup(_0x29133f,_0x2b252e);_0x23e383[_0x6184('0xad')]=0x12;_0x23e383[_0x6184('0xeb')]=_0x6184('0xec');_0x23e383[_0x6184('0xf5')]=_0x6184('0xed');ami[_0x6184('0xee')](_0x6184('0xef'),ut['buildObj'](_0x23e383,_0x6184('0x109')));this[_0x6184('0xd8')](_0x23e383,_0x6184('0x10a'),_0x6184('0x10b'));}if(_0x29133f[_0x6184('0x53')]===_0x6184('0x7e')&&this['campaigns'][_0x29133f[_0x6184('0xb8')]][_0x6184('0x107')]&&_0x2b252e[_0x6184('0x108')]===_0x6184('0xf3')){return new Promise(function(_0x4619a4,_0x3ea685){delete _0x1c8caa[_0x6184('0x2a')][_0x2b252e[_0x6184('0xe5')]];_0x1c8caa[_0x6184('0xea')](_0x1c8caa[_0x6184('0xba')][_0x29133f[_0x6184('0xb8')]]);_0x1c8caa[_0x6184('0xba')][_0x29133f[_0x6184('0xb8')]]['outboundAnswerCallsDay']+=0x1;_0x1c8caa[_0x6184('0xba')][_0x29133f[_0x6184('0xb8')]][_0x6184('0x62')]+=0x1;var _0x2b0be1=_0x1c8caa[_0x6184('0xba')][_0x29133f[_0x6184('0xb8')]];var _0x2f9413=new Hangup(_0x29133f,_0x2b252e);_0x2f9413[_0x6184('0xad')]=0x13;_0x2f9413['statedesc']=_0x6184('0xf4');_0x2f9413[_0x6184('0xf5')]=_0x6184('0xed');_0x2f9413['countmachineretry']+=0x1;_0x2f9413[_0x6184('0xf7')]+=0x1;_0x2f9413[_0x6184('0x109')]=!![];ami[_0x6184('0xee')](_0x6184('0xef'),ut[_0x6184('0xf0')](_0x2f9413,_0x6184('0x109')));_0x1c8caa['createHistory'](_0x2f9413)[_0x6184('0xb6')](loggerCatch(_0x6184('0x10c')));if(_0x2f9413[_0x6184('0xf8')]+_0x2f9413[_0x6184('0x10d')]+_0x2f9413[_0x6184('0xf9')]+_0x2f9413[_0x6184('0xfa')]+_0x2f9413[_0x6184('0x10e')]+_0x2f9413[_0x6184('0xfb')]+_0x2f9413[_0x6184('0xf6')]+_0x2f9413[_0x6184('0x10f')]>=_0x2b0be1['dialGlobalMaxRetry']){_0x1c8caa[_0x6184('0xfd')](_0x2f9413,_0x4619a4,_0x3ea685,_0x6184('0xfe'));}else{if(_0x2f9413[_0x6184('0xf6')]>=_0x2b0be1[_0x6184('0xff')]){_0x1c8caa[_0x6184('0x100')](_0x2f9413,_0x4619a4,_0x3ea685,_0x6184('0x101'));}else{_0x1c8caa[_0x6184('0xc8')]({'active':![],'countmachineretry':_0x2f9413[_0x6184('0xf6')],'scheduledat':moment()[_0x6184('0x110')](_0x2b0be1[_0x6184('0x102')],_0x6184('0x103'))['format'](_0x6184('0x111')),'ContactId':_0x2f9413[_0x6184('0x104')],'ListId':_0x2f9413[_0x6184('0xda')],'VoiceQueueId':_0x2f9413['VoiceQueueId']||undefined,'CampaignId':_0x2f9413[_0x6184('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x4619a4({'reschedule':0x1});}}});}}};Dialer[_0x6184('0xaf')][_0x6184('0x3c')]=function(_0x3d0fb2){var _0x12a40b=this['uniqueId'][_0x3d0fb2[_0x6184('0xe5')]];var _0x118bfe;if(_0x12a40b&&_0x12a40b[_0x6184('0x53')]===_0x6184('0x7e')){delete this[_0x6184('0x2a')][_0x3d0fb2[_0x6184('0xe5')]];this[_0x6184('0xea')](this['campaigns'][_0x12a40b[_0x6184('0xb8')]]);this['campaigns'][_0x12a40b[_0x6184('0xb8')]][_0x6184('0x112')]+=0x1;_0x118bfe=new Hangup(_0x12a40b,_0x3d0fb2);this[_0x6184('0xd3')](_0x118bfe)['catch'](loggerCatch(_0x6184('0x113')));this[_0x6184('0xd1')](_0x118bfe)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x12a40b&&_0x12a40b['type']!=='ivr'&&isNotNull(this[_0x6184('0x23')][_0x12a40b[_0x6184('0xb8')]]['dialQueueProject'])){delete this[_0x6184('0x2a')][_0x3d0fb2[_0x6184('0xe5')]];this[_0x6184('0xea')](this['voiceQueues'][_0x12a40b[_0x6184('0xb8')]]);this[_0x6184('0x23')][_0x12a40b[_0x6184('0xb8')]]['outboundAnswerCallsDay']+=0x1;this[_0x6184('0x23')][_0x12a40b[_0x6184('0xb8')]][_0x6184('0x62')]+=0x1;_0x118bfe=new Hangup(_0x12a40b,_0x3d0fb2);_0x118bfe[_0x6184('0xad')]=0x10;_0x118bfe[_0x6184('0xeb')]=_0x6184('0x114');_0x118bfe[_0x6184('0xf5')]=_0x6184('0x115');this[_0x6184('0xd3')](_0x118bfe)[_0x6184('0xb6')](loggerCatch(_0x6184('0x113')));this[_0x6184('0xd1')](_0x118bfe)[_0x6184('0xb6')](loggerCatch(_0x6184('0x116')));}if(_0x12a40b&&_0x12a40b['type']!==_0x6184('0x7e')&&!isNotNull(this[_0x6184('0x23')][_0x12a40b[_0x6184('0xb8')]][_0x6184('0x117')])){delete this[_0x6184('0x2a')][_0x3d0fb2[_0x6184('0xe5')]];this[_0x6184('0xea')](this[_0x6184('0x23')][_0x12a40b[_0x6184('0xb8')]]);this[_0x6184('0x23')][_0x12a40b['queue']][_0x6184('0x118')]+=0x1;_0x118bfe=new Hangup(_0x12a40b,_0x3d0fb2);_0x118bfe['state']=0xc;_0x118bfe['statedesc']=_0x3d0fb2[_0x6184('0x119')];_0x118bfe[_0x6184('0xf5')]=_0x6184('0x11a');this[_0x6184('0xd3')](_0x118bfe)['catch'](loggerCatch(_0x6184('0x113')));this[_0x6184('0xd1')](_0x118bfe)['catch'](loggerCatch(_0x6184('0x116')));}};Dialer[_0x6184('0xaf')]['syncAgentComplete']=function(_0x399df9){var _0x223647=this[_0x6184('0x2a')][_0x399df9['uniqueid']];if(this[_0x6184('0x23')][_0x399df9[_0x6184('0xb8')]]){if(_0x223647&&_0x223647[_0x6184('0x53')]!==_0x6184('0x7e')){delete this[_0x6184('0x2a')][_0x399df9[_0x6184('0xe5')]];this[_0x6184('0x23')][_0x399df9[_0x6184('0xb8')]][_0x6184('0x63')]+=0x1;var _0x38649a=new AgentComplete(_0x223647,_0x399df9);if(_0x399df9[_0x6184('0x11b')]===_0x6184('0x11c')){_0x38649a['agiafterat']=this['voiceQueues'][_0x399df9[_0x6184('0xb8')]][_0x6184('0x11d')]&&this['voiceQueues'][_0x399df9['queue']][_0x6184('0x11e')]?moment()[_0x6184('0x7b')](_0x6184('0x111')):undefined;}this[_0x6184('0xd3')](_0x38649a)['catch'](loggerCatch(_0x6184('0x11f')));this[_0x6184('0xd1')](_0x38649a)[_0x6184('0xb6')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x6184('0xaf')]['syncAgentConnect']=function(_0x58bf27){if(this['voiceQueues'][_0x58bf27['queue']]){if(this[_0x6184('0x2a')][_0x58bf27['uniqueid']]&&this[_0x6184('0x2a')][_0x58bf27[_0x6184('0xe5')]][_0x6184('0x53')]!=='ivr'){this[_0x6184('0xea')](this['voiceQueues'][_0x58bf27[_0x6184('0xb8')]]);this['uniqueId'][_0x58bf27[_0x6184('0xe5')]][_0x6184('0x120')]=moment()[_0x6184('0x7b')](_0x6184('0x111'));}}};Dialer[_0x6184('0xaf')]['queueCallerAbandonCreateState']=function(_0x20bd78,_0x556984){this[_0x6184('0xd3')](_0x20bd78)[_0x6184('0xb6')](loggerCatch(_0x6184('0x11f')));if(_0x556984==0x0){this[_0x6184('0xd1')](_0x20bd78)['catch'](loggerCatch(_0x6184('0x121')));}};Dialer[_0x6184('0xaf')]['syncQueueCallerAbandon']=function(_0x5db949){var _0x2f5bcc=this['uniqueId'][_0x5db949['uniqueid']];var _0x41796b=this;var _0x23fe0a=![];var _0x25e421;var _0x5d447a;if(this[_0x6184('0x23')][_0x5db949[_0x6184('0xb8')]]){if(_0x2f5bcc&&_0x2f5bcc[_0x6184('0x53')]!==_0x6184('0x7e')){delete this[_0x6184('0x2a')][_0x5db949[_0x6184('0xe5')]];this[_0x6184('0xea')](this['voiceQueues'][_0x5db949['queue']]);_0x2f5bcc[_0x6184('0x122')]=moment()['format'](_0x6184('0x111'));var _0x18aee0=new QueueCallerAbandon(_0x2f5bcc,_0x5db949);if(getSeconds(_0x2f5bcc[_0x6184('0x122')],_0x2f5bcc[_0x6184('0x123')])>=_0x2f5bcc[_0x6184('0x124')]){this[_0x6184('0x23')][_0x5db949[_0x6184('0xb8')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x5db949[_0x6184('0xb8')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x6184('0x23')][_0x5db949[_0x6184('0xb8')]][_0x6184('0x125')]+=0x1;_0x18aee0[_0x6184('0xad')]=0xa;_0x18aee0['statedesc']=_0x6184('0x126');_0x18aee0[_0x6184('0x127')]=_0x6184('0x128');_0x18aee0[_0x6184('0x129')]=this[_0x6184('0x23')][_0x5db949['queue']][_0x6184('0x11d')]?moment()[_0x6184('0x7b')](_0x6184('0x111')):undefined;_0x18aee0[_0x6184('0x10e')]+=0x1;_0x18aee0[_0x6184('0xf7')]+=0x1;_0x25e421=this[_0x6184('0x23')][_0x5db949[_0x6184('0xb8')]][_0x6184('0x12a')];_0x5d447a=this[_0x6184('0x23')][_0x5db949[_0x6184('0xb8')]][_0x6184('0x12b')];_0x41796b[_0x6184('0xbf')](_0x18aee0,_0x18aee0[_0x6184('0xad')],_0x2f5bcc[_0x6184('0x12c')])[_0x6184('0x45')](function(_0x3e8631){_0x23fe0a=_0x3e8631['additional']==0x1;if(_0x18aee0[_0x6184('0x10e')]>=_0x41796b[_0x6184('0x23')][_0x5db949['queue']][_0x6184('0x12d')]){_0x41796b[_0x6184('0x12e')](_0x18aee0,_0x3e8631['additional']);}else{_0x41796b['rescheduleContact']({'active':![],'countdropretry':_0x18aee0[_0x6184('0x10e')],'scheduledat':moment()[_0x6184('0x110')](_0x41796b[_0x6184('0x23')][_0x5db949[_0x6184('0xb8')]][_0x6184('0x12a')],_0x6184('0x103'))[_0x6184('0x7b')](_0x6184('0x111')),'ContactId':_0x2f5bcc[_0x6184('0x104')],'ListId':_0x2f5bcc['ListId'],'VoiceQueueId':_0x2f5bcc[_0x6184('0x105')]||undefined,'CampaignId':_0x2f5bcc[_0x6184('0xdc')]||undefined})[_0x6184('0xb6')](loggerCatch(_0x6184('0x12f')));var _0x5278d2=new History(_0x18aee0);_0x5278d2[_0x6184('0xad')]=0xa;_0x5278d2[_0x6184('0xeb')]=_0x6184('0x126');_0x5278d2[_0x6184('0x130')]=moment()[_0x6184('0x7b')](_0x6184('0x111'));_0x5278d2[_0x6184('0xae')]=_0x5278d2['starttime'];_0x5278d2[_0x6184('0x131')]=_0x18aee0[_0x6184('0x131')];_0x5278d2[_0x6184('0x132')]=_0x18aee0['calleridnum'];_0x41796b[_0x6184('0xd3')](_0x5278d2)['catch'](loggerCatch(_0x6184('0x133')));}})[_0x6184('0x45')](function(){if(_0x23fe0a)_0x41796b[_0x6184('0xc1')](_0x18aee0,_0x25e421,_0x5d447a)[_0x6184('0x45')](function(){return 0x1;});});}else{this[_0x6184('0x23')][_0x5db949[_0x6184('0xb8')]][_0x6184('0x6d')]+=0x1;this[_0x6184('0x23')][_0x5db949[_0x6184('0xb8')]][_0x6184('0x66')]+=0x1;_0x18aee0['state']=0xb;_0x18aee0[_0x6184('0xeb')]=_0x6184('0x134');_0x18aee0[_0x6184('0x127')]='CALLEREXIT';_0x18aee0[_0x6184('0xfb')]+=0x1;_0x18aee0[_0x6184('0xf7')]+=0x1;_0x25e421=this[_0x6184('0x23')][_0x5db949[_0x6184('0xb8')]]['dialAbandonedRetryFrequency'];_0x5d447a=this[_0x6184('0x23')][_0x5db949[_0x6184('0xb8')]][_0x6184('0x12b')];_0x41796b[_0x6184('0xbf')](_0x18aee0,_0x18aee0[_0x6184('0xad')],_0x2f5bcc['voiceQueue'])['then'](function(_0x38d276){if(_0x18aee0[_0x6184('0xfb')]>=_0x41796b['voiceQueues'][_0x5db949[_0x6184('0xb8')]][_0x6184('0x135')]){_0x41796b[_0x6184('0x12e')](_0x18aee0,_0x38d276[_0x6184('0x136')]);}else{_0x41796b[_0x6184('0xc8')]({'active':![],'countabandonedretry':_0x18aee0['countabandonedretry'],'scheduledat':moment()[_0x6184('0x110')](_0x41796b[_0x6184('0x23')][_0x5db949[_0x6184('0xb8')]][_0x6184('0x137')],_0x6184('0x103'))[_0x6184('0x7b')](_0x6184('0x111')),'ContactId':_0x2f5bcc[_0x6184('0x104')],'ListId':_0x2f5bcc['ListId'],'VoiceQueueId':_0x2f5bcc['VoiceQueueId']||undefined,'CampaignId':_0x2f5bcc['CampaignId']||undefined})[_0x6184('0xb6')](loggerCatch(_0x6184('0x138')));var _0x5b5ddb=new History(_0x18aee0);_0x5b5ddb[_0x6184('0xad')]=0xb;_0x5b5ddb[_0x6184('0xeb')]='Abandoned';_0x5b5ddb[_0x6184('0x130')]=moment()[_0x6184('0x7b')](_0x6184('0x111'));_0x5b5ddb[_0x6184('0xae')]=_0x5b5ddb['starttime'];_0x5b5ddb['calleridname']=_0x18aee0[_0x6184('0x131')];_0x5b5ddb[_0x6184('0x132')]=_0x18aee0[_0x6184('0x132')];_0x41796b[_0x6184('0xd3')](_0x5b5ddb)[_0x6184('0xb6')](loggerCatch(_0x6184('0x139')));}})[_0x6184('0x45')](function(){if(_0x23fe0a)_0x41796b[_0x6184('0xc1')](_0x18aee0,_0x25e421,_0x5d447a)[_0x6184('0x45')](function(){return 0x1;});});}}}};Dialer[_0x6184('0xaf')][_0x6184('0x13a')]=function(_0x24895c){if(this[_0x6184('0x28')][_0x24895c[_0x6184('0xe5')]]){this[_0x6184('0x28')][_0x24895c['uniqueid']]['channel']=_0x24895c['channel'];}if(this[_0x6184('0x2a')][_0x24895c[_0x6184('0xe5')]]){this[_0x6184('0x2a')][_0x24895c[_0x6184('0xe5')]][_0x6184('0xb5')]=_0x24895c[_0x6184('0xb5')];}};Dialer[_0x6184('0xaf')][_0x6184('0x13b')]=function(_0xfddeb){if(strategy[this[_0x6184('0x23')][this[_0x6184('0x28')][_0xfddeb['actionid']][_0x6184('0xb8')]][_0x6184('0x13c')]]==='roundrobin'){if(this[_0x6184('0x28')][_0xfddeb[_0x6184('0x13d')]]&&_[_0x6184('0xb2')](this[_0x6184('0x28')][_0xfddeb['actionid']]['locked'])&&_0xfddeb[_0x6184('0xb4')]==='1'&&_0xfddeb[_0x6184('0x13e')]==='0'){if(this[_0x6184('0x24')][_0xfddeb[_0x6184('0x13f')]]){if(!this[_0x6184('0x24')][_0xfddeb[_0x6184('0x13f')]][_0x6184('0x140')]){this[_0x6184('0x24')][_0xfddeb['stateinterface']]['locked']=!![];this['actions'][_0xfddeb[_0x6184('0x13d')]][_0x6184('0x140')]=!![];this[_0x6184('0x28')][_0xfddeb['actionid']][_0x6184('0x13f')]=_0xfddeb['stateinterface'];}}}}else if((strategy[this[_0x6184('0x23')][this[_0x6184('0x28')][_0xfddeb[_0x6184('0x13d')]]['queue']]['strategy']]||_0x6184('0x1c'))===_0x6184('0x1c')){if(this[_0x6184('0x28')][_0xfddeb[_0x6184('0x13d')]]){if(this[_0x6184('0x24')][_0xfddeb[_0x6184('0x13f')]]){this['actions'][_0xfddeb[_0x6184('0x13d')]][_0x6184('0x13f')]=_0xfddeb['stateinterface'];if(_['isNil'](this[_0x6184('0x2e')][this[_0x6184('0x28')][_0xfddeb['actionid']]['queue']])){this['queueBooked'][this[_0x6184('0x28')][_0xfddeb[_0x6184('0x13d')]][_0x6184('0xb8')]]=[];}this[_0x6184('0x2e')][this[_0x6184('0x28')][_0xfddeb[_0x6184('0x13d')]]['queue']][_0x6184('0x141')](_[_0x6184('0xd9')](_[_0x6184('0x142')](this[_0x6184('0x28')][_0xfddeb[_0x6184('0x13d')]],['idHopper','stateinterface']),{'status':_0xfddeb[_0x6184('0xb4')],'paused':_0xfddeb['paused']}));}}}};function unlockQueueStatus(_0x36b9a9,_0x433ed8){setTimeout(function(){if(_[_0x6184('0x46')](_0x36b9a9['queueStatusComplete'])){loggerBooked[_0x6184('0x9c')](_0x6184('0x143'),_0x433ed8);}_0x36b9a9[_0x6184('0x144')]=!![];loggerBooked['info'](_0x6184('0x145'),_0x433ed8,JSON[_0x6184('0x7a')](_[_0x6184('0x142')](_0x36b9a9,[_0x6184('0x48'),_0x6184('0x144')])));},0x1f3);}Dialer[_0x6184('0xaf')]['syncQueueStatusComplete']=function(_0x2b0eca){var _0x5f28bb=this;var _0x38ce1c=_0x5f28bb[_0x6184('0x23')][_0x5f28bb[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0xb8')]];if(strategy[this[_0x6184('0x23')][this[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0xb8')]]['strategy']]===_0x6184('0x1d')){if(this[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]]&&this['actions'][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0x13f')]){this[_0x6184('0x22')]['run'](this['actions'][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0x146')],this[_0x6184('0x28')][_0x2b0eca['actionid']][_0x6184('0x13f')])[_0x6184('0xb6')](function(_0x8783fc){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x6184('0x9b')](_0x8783fc,{'showHidden':![],'depth':null}));})[_0x6184('0x20')](function(){_0x5f28bb[_0x6184('0xea')](_0x5f28bb[_0x6184('0x23')][_0x5f28bb[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0xb8')]]);_0x5f28bb[_0x6184('0x24')][_0x5f28bb[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]]['stateinterface']][_0x6184('0x140')]=![];delete _0x5f28bb[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]];unlockQueueStatus(_0x38ce1c);});}else{this[_0x6184('0xea')](this['voiceQueues'][this[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0xb8')]]);this[_0x6184('0xc8')]({'active':![],'ContactId':this['actions'][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0x104')],'ListId':this[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0xda')],'VoiceQueueId':this['actions'][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0x105')]||undefined,'CampaignId':this[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0xdc')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x6184('0x28')][_0x2b0eca['actionid']];unlockQueueStatus(_0x38ce1c);}}else if((strategy[this[_0x6184('0x23')][this[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]]['queue']]['strategy']]||_0x6184('0x1c'))===_0x6184('0x1c')){var _0x516a8c;if(this[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]]&&!_[_0x6184('0x4e')](this[_0x6184('0x2e')][this[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]]['queue']])){if(this[_0x6184('0x2f')][_0x5f28bb[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0xb8')]]){this[_0x6184('0x2f')][_0x5f28bb[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0xb8')]]=this[_0x6184('0x2f')][this[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]]['queue']]?this['queueBookedRR'][this['actions'][_0x2b0eca['actionid']][_0x6184('0xb8')]]:this['queueBooked'][this[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0xb8')]]?this['queueBooked'][this[_0x6184('0x28')][_0x2b0eca['actionid']][_0x6184('0xb8')]][_0x6184('0x147')]||0x0:0x0;}this[_0x6184('0x2e')][this[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0xb8')]][_0x6184('0x147')]=this['queueBookedRR'][this[_0x6184('0x28')][_0x2b0eca[_0x6184('0x13d')]][_0x6184('0xb8')]];for(var _0x8b0bce=0x0;_0x8b0bce=0x0;})[_0x6184('0xb6')](myreject(_0x56f239)));}}else{_0x20c3e3[_0x6184('0x141')](ami[_0x6184('0xb3')]({'action':_0x6184('0x163'),'command':util['format'](_0x6184('0x15e'),_0x40c036,!_['isUndefined'](config[_0x6184('0x15b')][_0x2f0442])?_0x2f0442:'')})['then'](function(_0x364147){return _0x364147[_0x6184('0x160')][_0x6184('0x161')]('true')>=0x0;})[_0x6184('0xb6')](myreject(_0x56f239)));}Promise[_0x6184('0x164')](_0x20c3e3)[_0x6184('0x45')](function(_0x18049c){var _0x45db84=_['some'](_0x18049c);if(_0x45db84){return _0x396c42(_0x45db84);}else{_0x16add1[_0x6184('0x47')]=_0x3199b6?_0x6184('0x165'):_0x6184('0x166');return _0x56f239(msgResponse('[ifTime][promiseAll]',_0x6184('0x157'),_0x6184('0x167')+_0x3199b6+'\x20'+_0x4e1b53+'\x20Interval\x20is\x20overtime:\x20'+util[_0x6184('0x9b')](_0x40c036,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x2f0442));}})[_0x6184('0xb6')](function(_0x2e3123){return _0x56f239(msgResponse(_0x6184('0x155'),'Failure',JSON[_0x6184('0x7a')](_0x2e3123)));});});};Dialer[_0x6184('0xaf')][_0x6184('0x168')]=function(_0x4e67c3){var _0x893ef5=this;return function(){switch(_0x4e67c3[_0x6184('0x5d')]){case'progressive':freeVariablesPredictive(_0x4e67c3);_0x893ef5[_0x6184('0x169')](_0x4e67c3,0x1);break;case'power':freeVariablesPredictive(_0x4e67c3);_0x893ef5[_0x6184('0x169')](_0x4e67c3,_0x4e67c3[_0x6184('0x16a')]);break;case _0x6184('0xa'):_0x893ef5['predictive'](_0x4e67c3);break;case'booked':freeVariablesPredictive(_0x4e67c3);_0x893ef5[_0x6184('0x169')](_0x4e67c3,0x1);break;default:freeVariablesPredictive(_0x4e67c3);logger['error'](_0x6184('0x16b'),_0x4e67c3[_0x6184('0x48')],_0x6184('0x16c'));}};};Dialer[_0x6184('0xaf')][_0x6184('0x16d')]=function(_0x59c268){return Promise[_0x6184('0xbc')]()[_0x6184('0x45')](cmHopper['handlePreviewRecallNotifications'](_0x59c268['id'],previewRecallmeReminderInterval))[_0x6184('0x45')](function(_0x5a5274){for(var _0x3ef72a=0x0;_0x3ef72a<_0x5a5274[_0x6184('0x148')];_0x3ef72a++){var _0x34e832=_0x5a5274[_0x3ef72a][_0x6184('0x16e')][_0x6184('0x48')];if(_0x34e832)io['to'](util[_0x6184('0x7b')](_0x6184('0x16f'),_0x34e832))[_0x6184('0xee')]('user:dialPreviewRecallReminder',{'hopper':_0x5a5274[_0x3ef72a]});}})['catch'](function(){});};Dialer[_0x6184('0xaf')][_0x6184('0x170')]=function(_0x4da423){var _0x35ae5a=this;return function(){_0x35ae5a[_0x6184('0x171')](_0x4da423);};};Dialer[_0x6184('0xaf')][_0x6184('0xc')]=function(_0x3ee948){var _0x48fad4=this;if(isNotPreview(_0x3ee948[_0x6184('0x5d')])){if(isVoiceQueueOutbound(_0x3ee948[_0x6184('0x53')])&&isActive(_0x3ee948[_0x6184('0x5c')])){_0x3ee948[_0x6184('0xa4')]=!![];Promise[_0x6184('0xbc')]()[_0x6184('0x45')](checkIsLoggedIn(_0x3ee948,_0x3ee948[_0x6184('0x172')]))[_0x6184('0x45')](checkIsActive(_0x3ee948,_0x3ee948[_0x6184('0x5c')]))[_0x6184('0x45')](checkInterval(_0x3ee948))['then'](_0x48fad4[_0x6184('0x173')](_0x3ee948))['then'](_0x48fad4[_0x6184('0x154')](_0x3ee948[_0x6184('0x174')],_0x3ee948[_0x6184('0x175')],_0x3ee948[_0x6184('0x48')],_0x3ee948))[_0x6184('0x45')](_0x48fad4[_0x6184('0x156')](_0x3ee948[_0x6184('0x4b')],_0x3ee948[_0x6184('0x175')],_0x3ee948['name'],_0x3ee948))['then'](_0x48fad4[_0x6184('0x168')](_0x3ee948))[_0x6184('0xb6')](loggerCatchQueueSummary(_0x6184('0x176'),_0x3ee948));}else{notSendMessagesQueue(_0x3ee948);}}else{freeVariablesPredictive(_0x3ee948);}};Dialer[_0x6184('0xaf')][_0x6184('0x3a')]=_[_0x6184('0x177')](function(){var _0x530bfc=_[_0x6184('0x178')](this[_0x6184('0x23')],function(_0x3275e3){return _0x3275e3[_0x6184('0x179')];});var _0x28135e=_[_0x6184('0x178')](this[_0x6184('0x24')],function(_0x5d1bfb){return _0x5d1bfb[_0x6184('0x17a')]&&_0x5d1bfb[_0x6184('0xb4')]==='reachable';});if(_0x530bfc[_0x6184('0x148')]>0x0&&_0x28135e['length']>0x0){return Promise['resolve']()[_0x6184('0x45')](cmHopper[_0x6184('0x17b')](_[_0x6184('0x17c')](_0x530bfc,'id'),previewRecallmeReminderInterval,_[_0x6184('0x17c')](_0x28135e,'id')))[_0x6184('0x45')](function(_0x2df646){for(var _0x23ff69=0x0;_0x23ff69<_0x2df646[_0x6184('0x148')];_0x23ff69++){var _0x181711=_0x2df646[_0x23ff69][_0x6184('0x16e')][_0x6184('0x48')];if(_0x181711)io['to'](util[_0x6184('0x7b')](_0x6184('0x16f'),_0x181711))['emit'](_0x6184('0x17d'),{'hopper':_0x2df646[_0x23ff69]});}})[_0x6184('0xb6')](function(_0x49cdfe){logger[_0x6184('0x9c')](_0x6184('0x16d'),_0x49cdfe);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x6184('0xaf')][_0x6184('0x17e')]=function(){var _0x1227b5=this;var _0x5dee8e;for(var _0x364180 in this[_0x6184('0xba')]){if(typeof this['campaigns'][_0x364180]!=='undefined'){_0x5dee8e=this[_0x6184('0xba')][_0x364180];if(isCampaignIvr(_0x5dee8e[_0x6184('0x53')])&&isActive(_0x5dee8e[_0x6184('0xe1')])){_0x5dee8e['sendMessageOneNotActive']=!![];Promise['resolve']()[_0x6184('0x45')](checkIsActive(_0x5dee8e,_0x5dee8e[_0x6184('0xe1')]))[_0x6184('0x45')](checkInterval(_0x5dee8e))['then'](_0x1227b5[_0x6184('0x173')](_0x5dee8e))[_0x6184('0x45')](_0x1227b5['checkIfTime'](_0x5dee8e[_0x6184('0x174')],_0x5dee8e[_0x6184('0x175')],_0x5dee8e[_0x6184('0x48')],_0x5dee8e))['then'](_0x1227b5['checkIfTimeIntervals'](_0x5dee8e[_0x6184('0x4b')],_0x5dee8e['dialTimezone'],_0x5dee8e['name'],_0x5dee8e))[_0x6184('0x45')](_0x1227b5[_0x6184('0x170')](_0x5dee8e))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x5dee8e));}else{notSendMessagesCampaign(_0x5dee8e);}}}};function getCallerIdRandom(_0xcce974,_0x565847){var _0x2e6031;var _0x1f3092;var _0x2ad3b6;if(_0x565847<=0x0){_0x565847=0x1;}_0x2e6031=new RegExp('\x5cw{0,'+_0x565847+'}$');_0x1f3092=Math['pow'](0xa,_0x565847-0x1);_0x2ad3b6=Math[_0x6184('0x17f')](0xa,_0x565847)-0x1;return util[_0x6184('0x7b')]('%s',_[_0x6184('0x180')](_0xcce974,_0x2e6031,_[_0x6184('0x181')](_0x1f3092,_0x2ad3b6)));}function extractCalleridName(_0x22dee1){var _0x45eef9=_0x22dee1[_0x6184('0x182')](/"(.*?)"/);return _0x45eef9?_0x45eef9[0x1]:_0x22dee1;}Dialer['prototype'][_0x6184('0x183')]=function(_0xa749c6,_0x2e1d80){var _0x4f2c11=this;var _0xd99603=uuid['v4']();this[_0x6184('0x28')][_0xd99603]=new Action(_0xa749c6,_0x2e1d80,_0xd99603);return new Promise(function(_0x5f3398,_0x15eeb1){if(_[_0x6184('0x46')](_0xa749c6)&&typeof _0xa749c6!=='object'){return _0x15eeb1(msgResponse(_0x6184('0x184'),'Failure',_0x6184('0x185')));}if(_['isUndefined'](_0x2e1d80[_0x6184('0x186')])||_0x2e1d80['phone']===null){return _0x15eeb1(msgResponse('originate',_0x6184('0x157'),_0x6184('0x187')));}var _0x25a63f={'XMD-CALLERID':_0x4f2c11[_0x6184('0x28')][_0xd99603]['getCaller'](),'XMD-AGI':_0xa749c6[_0x6184('0x117')]?util[_0x6184('0x7b')](_0x6184('0x188'),ipAgi,_0xa749c6['dialQueueProject']):_0x6184('0x189'),'XMD-AGIAFTER':_0xa749c6[_0x6184('0x11d')]?util[_0x6184('0x7b')]('\x22agi://%s/square,%s\x22',ipAgi,_0xa749c6[_0x6184('0x11d')]):_0x6184('0x189'),'XMD-QUEUE':_0xa749c6[_0x6184('0x53')]==='outbound'?util[_0x6184('0x7b')](_0x6184('0x18a'),_0xa749c6[_0x6184('0x48')],_0xa749c6[_0x6184('0x18b')]||'',_0xa749c6[_0x6184('0x11e')]?'c':'',_0xa749c6[_0x6184('0x124')]||0x3):_0x6184('0x189'),'XMD-CONTACTID':_0x2e1d80[_0x6184('0x104')],'XMD-CDRTYPE':_0x6184('0x8'),'CALLERID(all)':_0x4f2c11['actions'][_0xd99603][_0x6184('0x18c')](),'XMD-AMD':_0xa749c6[_0x6184('0x107')]?_0x6184('0x18d'):_0x6184('0x189'),'XMD-DESTINATION':_0x6184('0x18e')};if(_0xa749c6[_0x6184('0x107')]){_0x25a63f['XMD-AMDINITIALSILENCE']=_0xa749c6[_0x6184('0x18f')]||0x9c4;_0x25a63f[_0x6184('0x190')]=_0xa749c6[_0x6184('0x191')]||0x5dc;_0x25a63f[_0x6184('0x192')]=_0xa749c6[_0x6184('0x193')]||0x320;_0x25a63f[_0x6184('0x194')]=_0xa749c6[_0x6184('0x195')]||0x1388;_0x25a63f[_0x6184('0x196')]=_0xa749c6[_0x6184('0x197')]||0x64;_0x25a63f[_0x6184('0x198')]=_0xa749c6['dialAMDBetweenWordsSilence']||0x32;_0x25a63f[_0x6184('0x199')]=_0xa749c6[_0x6184('0x19a')]||0x3;_0x25a63f[_0x6184('0x19b')]=_0xa749c6[_0x6184('0x19c')]||0x100;_0x25a63f['XMD-AMDMAXIMUMWORDLENGTH']=_0xa749c6[_0x6184('0x19d')]||0x1388;}if(_0xa749c6[_0x6184('0x53')]===_0x6184('0x96')){_0x25a63f['XMD-VOICEQUEUEID']=_0x2e1d80['VoiceQueueId'];}else{_0x25a63f[_0x6184('0x19e')]=_0x2e1d80[_0x6184('0xdc')];}for(var _0x3564c1 in _0x2e1d80['Contact']){if(typeof _0x2e1d80[_0x6184('0x19f')][_0x3564c1]!==_0x6184('0x9e')){if(isNotNull(_0x2e1d80[_0x6184('0x19f')][_0x3564c1])&&_0x3564c1!=='id'&&_0x3564c1!=='tags'&&_0x3564c1!==_0x6184('0x1a0')&&_0x3564c1!=='updatedAt'){_0x25a63f[util[_0x6184('0x7b')](_0x6184('0x1a1'),'XMD-',_['toUpper'](_0x3564c1))]=_0x2e1d80[_0x6184('0x19f')][_0x3564c1];}}}var _0x2f56ba=_0x4f2c11[_0x6184('0x150')](_0xa749c6[_0x6184('0x78')])?getCallerId(_0xa749c6[_0x6184('0x78')]['callerid'],_0xa749c6[_0x6184('0x5e')],_0xa749c6[_0x6184('0x1a2')]>0x0?getCallerIdRandom(_0xa749c6[_0x6184('0x5f')],_0xa749c6['dialRandomLastDigitCallerIdNumber']):_0xa749c6[_0x6184('0x5f')]):getCallerId(_['isNil'](_0xa749c6[_0x6184('0x151')])?_0xa749c6[_0x6184('0x78')][_0x6184('0x79')]:_0xa749c6['TrunkBackup'][_0x6184('0x79')],_0xa749c6[_0x6184('0x5e')],_0xa749c6[_0x6184('0x1a2')]>0x0?getCallerIdRandom(_0xa749c6['dialOriginateCallerIdNumber'],_0xa749c6[_0x6184('0x1a2')]):_0xa749c6['dialOriginateCallerIdNumber']);if(_0x2f56ba){_0x25a63f[_0x6184('0x1a3')]=_0x4f2c11['actions'][_0xd99603]['originatecalleridname']=extractCalleridName(_0x2f56ba);_0x25a63f['XMD-ORIGINATECALLERIDNUM']=_0x2e1d80[_0x6184('0x186')];}_0xa749c6[_0x6184('0x1a4')]=_0x25a63f;return ami['Action']({'actionid':_0xd99603,'action':_0x6184('0x184'),'channel':_0x4f2c11[_0x6184('0x150')](_0xa749c6['Trunk'])?util[_0x6184('0x7b')]('SIP/%s/%s%s',_0xa749c6['Trunk'][_0x6184('0x48')],isNotNull(_0xa749c6['dialPrefix'])?_0xa749c6[_0x6184('0x61')]['trim']()||'':'',_0xa749c6[_0x6184('0x1a5')]>0x0?_0x2e1d80['phone'][_0x6184('0x1a6')](_0xa749c6[_0x6184('0x1a5')]):_0x2e1d80[_0x6184('0x186')]):util[_0x6184('0x7b')]('SIP/%s/%s%s',_[_0x6184('0xb2')](_0xa749c6['TrunkBackup'])?_0xa749c6[_0x6184('0x78')][_0x6184('0x48')]:_0xa749c6[_0x6184('0x151')][_0x6184('0x48')],isNotNull(_0xa749c6[_0x6184('0x61')])?_0xa749c6[_0x6184('0x61')][_0x6184('0x1a7')]()||'':'',_0xa749c6[_0x6184('0x1a5')]>0x0?_0x2e1d80[_0x6184('0x186')]['substring'](_0xa749c6[_0x6184('0x1a5')]):_0x2e1d80['phone']),'callerid':_0x2f56ba,'Exten':'xcally-motion-dialer','Context':_0x6184('0x1a8'),'Priority':'1','variable':_0x25a63f,'timeout':(_0xa749c6[_0x6184('0x60')]||0x1e)*0x3e8,'async':!![],'channelid':_0xd99603})[_0x6184('0x45')](function(_0x372cb1){return _0x5f3398(_0x372cb1);})[_0x6184('0xb6')](function(_0x24daf0){_0xa749c6[_0x6184('0x69')]+=0x1;var _0x50361b=new History(_0x4f2c11[_0x6184('0x28')][_0xd99603]);logger[_0x6184('0x9c')](util[_0x6184('0x7b')]('[originateError]:\x20%s',JSON[_0x6184('0x7a')](_0x24daf0)));_0x50361b[_0x6184('0xad')]=0xe;_0x50361b[_0x6184('0xeb')]=_0x6184('0x1a9');_0x50361b[_0x6184('0x130')]=moment()[_0x6184('0x7b')](_0x6184('0x111'));_0x50361b[_0x6184('0xae')]=_0x50361b[_0x6184('0x130')];_0x4f2c11[_0x6184('0xd3')](_0x50361b)['catch'](loggerCatch('[originate][error]'));_0x4f2c11[_0x6184('0xd1')](_0x50361b)[_0x6184('0xb6')](loggerCatch(_0x6184('0x1aa')))[_0x6184('0x20')](function(){delete _0x4f2c11['actions'][_0xd99603];return _0x15eeb1(msgResponse(_0x6184('0x184'),_0x6184('0x50'),_0x6184('0x1ab')));});});});};Dialer['prototype'][_0x6184('0x35')]=function(_0x55230c){var _0x2df66d=this['actions'][_0x55230c[_0x6184('0x13d')]];if(_0x2df66d){delete this[_0x6184('0x28')][_0x55230c[_0x6184('0x13d')]];_0x2df66d['responsetime']=moment()['format'](_0x6184('0x111'));var _0x239155=_0x2df66d[_0x6184('0x53')]===_0x6184('0x7e')?this[_0x6184('0xba')][_0x2df66d[_0x6184('0xb8')]]:this[_0x6184('0x23')][_0x2df66d[_0x6184('0x1ac')]()];if(!this['isSuccess'](_0x55230c[_0x6184('0x1ad')])){this[_0x6184('0xea')](_0x239155);return this[_0x6184('0x1ae')](_0x2df66d,_0x239155,_0x55230c)['catch'](loggerCatch(_0x6184('0x1af')));}this[_0x6184('0x2a')][_0x55230c[_0x6184('0xe5')]]=_0x2df66d;}};Dialer['prototype'][_0x6184('0x1b0')]=function(_0x4e51c3,_0x2385cb,_0x5b8594){var _0x5d8411=new History(_0x2385cb);if(_0x5d8411[_0x6184('0xf8')]+_0x5d8411['countcongestionretry']+_0x5d8411['countnoanswerretry']+_0x5d8411[_0x6184('0xfa')]+_0x5d8411['countdropretry']+_0x5d8411[_0x6184('0xfb')]+_0x5d8411[_0x6184('0xf6')]+_0x5d8411['countagentrejectretry']>=_0x5b8594[_0x6184('0xfc')]-0x1){return!![];}switch(_0x4e51c3){case 0x3:if(_0x5d8411[_0x6184('0xf9')]>=_0x5b8594[_0x6184('0x1b1')]-0x1){return!![];}this[_0x6184('0xc8')]({'active':![],'countnoanswerretry':_0x5d8411[_0x6184('0xf9')]+=0x1,'scheduledat':moment()[_0x6184('0x110')](_0x5b8594['dialNoAnswerRetryFrequency'],_0x6184('0x103'))[_0x6184('0x7b')](_0x6184('0x111')),'ContactId':_0x5d8411[_0x6184('0x104')],'ListId':_0x5d8411[_0x6184('0xda')],'VoiceQueueId':_0x5d8411[_0x6184('0x105')]||undefined,'CampaignId':_0x5d8411[_0x6184('0xdc')]||undefined})['catch'](loggerCatch(_0x6184('0x1b2')));break;case 0x5:if(_0x5d8411[_0x6184('0xf8')]>=_0x5b8594[_0x6184('0x1b3')]-0x1){return!![];}this[_0x6184('0xc8')]({'active':![],'countbusyretry':_0x5d8411[_0x6184('0xf8')]+=0x1,'scheduledat':moment()[_0x6184('0x110')](_0x5b8594[_0x6184('0x1b4')],_0x6184('0x103'))[_0x6184('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5d8411[_0x6184('0x104')],'ListId':_0x5d8411[_0x6184('0xda')],'VoiceQueueId':_0x5d8411[_0x6184('0x105')]||undefined,'CampaignId':_0x5d8411[_0x6184('0xdc')]||undefined})[_0x6184('0xb6')](loggerCatch(_0x6184('0x1b5')));break;case 0x8:if(_0x5d8411['countcongestionretry']>=_0x5b8594[_0x6184('0x1b6')]-0x1){return!![];}this[_0x6184('0xc8')]({'active':![],'countcongestionretry':_0x5d8411[_0x6184('0x10d')]+=0x1,'scheduledat':moment()[_0x6184('0x110')](_0x5b8594['dialCongestionRetryFrequency'],_0x6184('0x103'))[_0x6184('0x7b')](_0x6184('0x111')),'ContactId':_0x5d8411['ContactId'],'ListId':_0x5d8411['ListId'],'VoiceQueueId':_0x5d8411[_0x6184('0x105')]||undefined,'CampaignId':_0x5d8411[_0x6184('0xdc')]||undefined})[_0x6184('0xb6')](loggerCatch(_0x6184('0x1b7')));break;case 0x0:if(_0x5d8411[_0x6184('0xfa')]>=_0x5b8594[_0x6184('0x1b8')]-0x1){return!![];}else{this[_0x6184('0xc8')]({'active':![],'countnosuchnumberretry':_0x5d8411[_0x6184('0xfa')]+=0x1,'scheduledat':moment()[_0x6184('0x110')](_0x5b8594['dialNoSuchNumberRetryFrequency'],_0x6184('0x103'))[_0x6184('0x7b')](_0x6184('0x111')),'ContactId':_0x5d8411[_0x6184('0x104')],'ListId':_0x5d8411[_0x6184('0xda')],'VoiceQueueId':_0x5d8411[_0x6184('0x105')]||undefined,'CampaignId':_0x5d8411['CampaignId']||undefined})[_0x6184('0xb6')](loggerCatch(_0x6184('0x1b9')));}break;case 0xa:if(_0x5d8411[_0x6184('0x10e')]>=_0x5b8594[_0x6184('0x12d')]-0x1){return!![];}this[_0x6184('0xc8')]({'active':![],'countdropretry':_0x5d8411[_0x6184('0x10e')]+=0x1,'scheduledat':moment()[_0x6184('0x110')](_0x5b8594['dialDropRetryFrequency'],_0x6184('0x103'))[_0x6184('0x7b')](_0x6184('0x111')),'ContactId':_0x5d8411[_0x6184('0x104')],'ListId':_0x5d8411[_0x6184('0xda')],'VoiceQueueId':_0x5d8411['VoiceQueueId']||undefined,'CampaignId':_0x5d8411[_0x6184('0xdc')]||undefined})[_0x6184('0xb6')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x5d8411[_0x6184('0xfb')]>=_0x5b8594[_0x6184('0x135')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x5d8411[_0x6184('0xfb')]+=0x1,'scheduledat':moment()[_0x6184('0x110')](_0x5b8594[_0x6184('0x137')],_0x6184('0x103'))['format'](_0x6184('0x111')),'ContactId':_0x5d8411[_0x6184('0x104')],'ListId':_0x5d8411[_0x6184('0xda')],'VoiceQueueId':_0x5d8411[_0x6184('0x105')]||undefined,'CampaignId':_0x5d8411[_0x6184('0xdc')]||undefined})[_0x6184('0xb6')](loggerCatch(_0x6184('0x138')));break;case 0x13:if(_0x5d8411[_0x6184('0xf6')]>=_0x5b8594['dialMachineMaxRetry']-0x1){return!![];}this[_0x6184('0xc8')]({'active':![],'countmachineretry':_0x5d8411['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x5b8594[_0x6184('0x102')],_0x6184('0x103'))[_0x6184('0x7b')](_0x6184('0x111')),'ContactId':_0x5d8411[_0x6184('0x104')],'ListId':_0x5d8411[_0x6184('0xda')],'VoiceQueueId':_0x5d8411[_0x6184('0x105')]||undefined,'CampaignId':_0x5d8411[_0x6184('0xdc')]||undefined})[_0x6184('0xb6')](loggerCatch(_0x6184('0x106')));break;case 0x14:if(_0x5d8411[_0x6184('0x10f')]>=_0x5b8594['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x6184('0xc8')]({'active':![],'countagentrejectretry':_0x5d8411['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x6184('0x110')](_0x5b8594[_0x6184('0x1ba')],_0x6184('0x103'))[_0x6184('0x7b')](_0x6184('0x111')),'ContactId':_0x5d8411[_0x6184('0x104')],'ListId':_0x5d8411[_0x6184('0xda')],'VoiceQueueId':_0x5d8411['VoiceQueueId']||undefined,'CampaignId':_0x5d8411['CampaignId']||undefined})[_0x6184('0xb6')](loggerCatch(_0x6184('0x1bb')));break;default:return!![];}};Dialer[_0x6184('0xaf')][_0x6184('0x1ae')]=function(_0x321f86,_0x12388b,_0x5ba709){var _0x30ec54=this;var _0x48f020=new History(_0x321f86);var _0x2db199=![];var _0x12ca02;var _0x5b788f;return new Promise(function(_0x25b152,_0x3c95f8){if(_['isUndefined'](_0x12388b)&&typeof _0x12388b!==_0x6184('0x1bc')){return _0x3c95f8(msgResponse(_0x6184('0x1bd'),_0x6184('0x157'),'entity\x20is\x20undefine'));}if(_[_0x6184('0x46')](_0x5ba709)&&typeof _0x5ba709!=='object'){return _0x3c95f8(msgResponse(_0x6184('0x1bd'),_0x6184('0x157'),'evt\x20is\x20undefine'));}_0x30ec54[_0x6184('0xbf')](_0x48f020,_0x5ba709[_0x6184('0x11b')],_0x12388b)['then'](function(_0x50eb0c){if(_0x50eb0c[_0x6184('0x136')]==0x1)_0x2db199=!![];switch(_0x5ba709[_0x6184('0x11b')]){case'0':_0x12388b[_0x6184('0x68')]+=0x1;_0x48f020[_0x6184('0xad')]=0x0;_0x48f020[_0x6184('0xeb')]=_0x6184('0x1be');_0x48f020[_0x6184('0xfa')]+=0x1;_0x48f020[_0x6184('0xf7')]+=0x1;ami['emit'](_0x6184('0x1bf'),ut[_0x6184('0xf0')](_0x321f86,_0x6184('0x1c0')));_0x12ca02=_0x12388b[_0x6184('0x1c1')];_0x5b788f=_0x12388b[_0x6184('0x12b')];_0x30ec54[_0x6184('0xd3')](_0x48f020)[_0x6184('0xb6')](loggerCatch(_0x6184('0x10c')));if(_0x30ec54[_0x6184('0x1b0')](0x0,_0x321f86,_0x12388b)&&!_0x2db199){if(_0x48f020['countnosuchnumberretry']>=_0x12388b[_0x6184('0x1b8')]){_0x30ec54[_0x6184('0x100')](_0x48f020,_0x25b152,_0x3c95f8,_0x6184('0x1c2'));}else{_0x30ec54[_0x6184('0xfd')](_0x48f020,_0x25b152,_0x3c95f8,_0x6184('0x1c2'));}}break;case'3':_0x12388b[_0x6184('0x1c3')]+=0x1;_0x48f020[_0x6184('0xad')]=0x3;_0x48f020['statedesc']=_0x6184('0x1c4');_0x48f020[_0x6184('0xf9')]+=0x1;_0x48f020['countglobal']+=0x1;var _0x5e59ec=ut[_0x6184('0x1c5')](_0x321f86,_0x12388b);ami[_0x6184('0xee')](_0x6184('0x1c6'),_0x5e59ec);_0x12ca02=_0x12388b['dialNoAnswerRetryFrequency'];_0x5b788f=_0x12388b[_0x6184('0x12b')];_0x30ec54[_0x6184('0xd3')](_0x48f020)[_0x6184('0xb6')](loggerCatch(_0x6184('0x1c7')));if(_0x30ec54[_0x6184('0x1b0')](0x3,_0x321f86,_0x12388b)&&!_0x2db199){if(_0x48f020['countnoanswerretry']>=_0x12388b[_0x6184('0x1b1')]){_0x30ec54[_0x6184('0x100')](_0x48f020,_0x25b152,_0x3c95f8,'reason\x203\x20ringing\x20no\x20answer');}else{_0x30ec54[_0x6184('0xfd')](_0x48f020,_0x25b152,_0x3c95f8,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x12388b[_0x6184('0x1c8')]+=0x1;_0x48f020[_0x6184('0xad')]=0x5;_0x48f020[_0x6184('0xeb')]=_0x6184('0x1c9');_0x48f020[_0x6184('0xf8')]+=0x1;_0x48f020['countglobal']+=0x1;ami[_0x6184('0xee')]('custom:agentbusy',ut[_0x6184('0xf0')](_0x321f86,'busy'));_0x12ca02=_0x12388b[_0x6184('0x1b4')];_0x5b788f=_0x12388b[_0x6184('0x12b')];_0x30ec54[_0x6184('0xd3')](_0x48f020)[_0x6184('0xb6')](loggerCatch(_0x6184('0x1ca')));if(_0x30ec54[_0x6184('0x1b0')](0x5,_0x321f86,_0x12388b)&&!_0x2db199){if(_0x48f020[_0x6184('0xf8')]>=_0x12388b[_0x6184('0x1b3')]){_0x30ec54[_0x6184('0x100')](_0x48f020,_0x25b152,_0x3c95f8,_0x6184('0x1cb'));}else{_0x30ec54[_0x6184('0xfd')](_0x48f020,_0x25b152,_0x3c95f8,_0x6184('0x1cb'));}}break;case'8':_0x12388b['outboundCongestionCallsDay']+=0x1;_0x48f020['state']=0x8;_0x48f020['statedesc']=_0x6184('0x1cc');_0x48f020['countcongestionretry']+=0x1;_0x48f020[_0x6184('0xf7')]+=0x1;_0x12ca02=_0x12388b[_0x6184('0x1cd')];_0x5b788f=_0x12388b['callAdditionalPhoneAfterMin'];ami['emit'](_0x6184('0x1ce'),ut[_0x6184('0xf0')](_0x321f86,_0x6184('0x1cf')));_0x30ec54[_0x6184('0xd3')](_0x48f020)[_0x6184('0xb6')](loggerCatch(_0x6184('0x1d0')));if(_0x30ec54[_0x6184('0x1b0')](0x8,_0x321f86,_0x12388b)&&!_0x2db199){if(_0x48f020[_0x6184('0x10d')]>=_0x12388b[_0x6184('0x1b6')]){_0x30ec54[_0x6184('0x100')](_0x48f020,_0x25b152,_0x3c95f8,_0x6184('0x1d1'));}else{_0x30ec54[_0x6184('0xfd')](_0x48f020,_0x25b152,_0x3c95f8,_0x6184('0x1d1'));}}break;case'11':_0x12388b['outboundAbandonedCallsDay']+=0x1;_0x48f020[_0x6184('0xad')]=0xb;_0x48f020[_0x6184('0xeb')]='Abandoned';_0x48f020[_0x6184('0xfb')]+=0x1;_0x48f020[_0x6184('0xf7')]+=0x1;_0x12ca02=_0x12388b[_0x6184('0x137')];_0x5b788f=_0x12388b['callAdditionalPhoneAfterMin'];_0x30ec54['createHistory'](_0x48f020)['catch'](loggerCatch(_0x6184('0x139')));if(_0x30ec54[_0x6184('0x1b0')](0xb,_0x321f86,_0x12388b)&&!_0x2db199){if(_0x48f020[_0x6184('0xfb')]>=_0x12388b['dialAbandonedMaxRetry']){_0x30ec54[_0x6184('0x100')](_0x48f020,_0x25b152,_0x3c95f8,_0x6184('0x1d2'));}else{_0x30ec54['stateGlobal'](_0x48f020,_0x25b152,_0x3c95f8,_0x6184('0x1d2'));}}break;case'20':_0x12388b[_0x6184('0x6b')]+=0x1;_0x48f020[_0x6184('0xad')]=0x14;_0x48f020[_0x6184('0xeb')]='AgentReject';_0x48f020['countagentrejectretry']+=0x1;_0x48f020['countglobal']+=0x1;_0x12ca02=_0x12388b[_0x6184('0x1ba')];_0x5b788f=_0x12388b[_0x6184('0x12b')];ami[_0x6184('0xee')](_0x6184('0x1d3'),ut[_0x6184('0xf0')](_0x321f86,_0x6184('0x1d4')));_0x30ec54[_0x6184('0xd3')](_0x48f020)[_0x6184('0xb6')](loggerCatch(_0x6184('0x1d5')));if(_0x30ec54['checkRetriveMax'](0x14,_0x321f86,_0x12388b)&&!_0x2db199){if(_0x48f020[_0x6184('0x10f')]>=_0x12388b[_0x6184('0x1d6')]){_0x30ec54[_0x6184('0x100')](_0x48f020,_0x25b152,_0x3c95f8,_0x6184('0x1d7'));}else{_0x30ec54[_0x6184('0xfd')](_0x48f020,_0x25b152,_0x3c95f8,_0x6184('0x1d7'));}}break;default:_0x12388b[_0x6184('0x118')]+=0x1;_0x48f020[_0x6184('0xad')]=0xc;_0x48f020[_0x6184('0xeb')]=_0x5ba709['reason'];_0x12ca02=_0x12388b[_0x6184('0x1ba')];_0x5b788f=_0x12388b[_0x6184('0x12b')];_0x30ec54[_0x6184('0xd3')](_0x48f020)[_0x6184('0xb6')](loggerCatch(_0x6184('0x1d8')));if(_0x30ec54[_0x6184('0x1b0')](_0x5ba709['reason'],_0x321f86,_0x12388b)&&!_0x2db199){if(_0x48f020[_0x6184('0xf8')]+_0x48f020[_0x6184('0x10d')]+_0x48f020['countnoanswerretry']+_0x48f020[_0x6184('0xfa')]+_0x48f020[_0x6184('0x10e')]+_0x48f020['countabandonedretry']+_0x48f020['countmachineretry']+_0x48f020[_0x6184('0x10f')]>=_0x12388b['dialGlobalMaxRetry']){_0x30ec54[_0x6184('0xfd')](_0x48f020,_0x25b152,_0x3c95f8,_0x5ba709[_0x6184('0x11b')]);}else{_0x30ec54[_0x6184('0x100')](_0x48f020,_0x25b152,_0x3c95f8,_0x5ba709[_0x6184('0x11b')]);}}}})[_0x6184('0x45')](function(){if(_0x2db199){_0x30ec54[_0x6184('0xc1')](_0x48f020,_0x12ca02,_0x5b788f)[_0x6184('0x45')](function(){return _0x25b152(0x1);});}});});};Dialer[_0x6184('0xaf')][_0x6184('0xfd')]=function(_0x3a1270,_0x8c00ea,_0x5781b2,_0x329490){var _0x2a81d9=new Final(_0x3a1270);_0x2a81d9[_0x6184('0xad')]=0xf;_0x2a81d9['statedesc']=_0x6184('0x1d9');this[_0x6184('0x100')](_0x2a81d9,_0x8c00ea,_0x5781b2,_0x329490);};Dialer[_0x6184('0xaf')][_0x6184('0x100')]=function(_0x5a7827,_0x3bf003,_0x10b3d6,_0x3d69e4){this[_0x6184('0xd1')](_0x5a7827)[_0x6184('0x45')](function(){return _0x3bf003(msgResponse(_0x6184('0x1bd'),_0x6184('0xe0'),_0x3d69e4));})['catch'](function(){return _0x10b3d6(msgResponse(_0x6184('0x1da'),_0x6184('0x157'),_0x6184('0x1db')));});};Dialer[_0x6184('0xaf')][_0x6184('0xa')]=function(_0xd5bc4a){var _0x2db002=_0xd5bc4a[_0x6184('0x1dc')]/0x64;var _0x4fa5f8=_0xd5bc4a['outboundDropCallsDayTimeout']/(_0xd5bc4a[_0x6184('0x67')]+_0xd5bc4a[_0x6184('0x63')]);var _0x1f558b=Math[_0x6184('0x1dd')](_0xd5bc4a[_0x6184('0x1de')]*(_0xd5bc4a[_0x6184('0x1df')]/0x64));var _0x16ba02=Math[_0x6184('0x1dd')](_0xd5bc4a['predictiveIntervalAvailable']*(_0xd5bc4a[_0x6184('0x1e0')]/0x64));var _0x555784=_0xd5bc4a['available']+_0xd5bc4a[_0x6184('0xa5')];var _0xbaabad=Math[_0x6184('0x1e1')](_0xd5bc4a[_0x6184('0x73')]*_0xd5bc4a[_0x6184('0x75')]*_0xd5bc4a[_0x6184('0x6f')]*_0xd5bc4a[_0x6184('0x1e2')]);if(_[_0x6184('0x46')](_0xd5bc4a[_0x6184('0x77')])){if(!_[_0x6184('0x46')](_0xd5bc4a['startPredictive'])){_0xd5bc4a[_0x6184('0x2c')]=undefined;loggerPredictive[_0x6184('0x9c')](_0x6184('0x1e3'),_0x6184('0x1e4'));}if(!_['isUndefined'](_0xd5bc4a['handlePredictive'])){loggerPredictive[_0x6184('0x9c')](_0x6184('0x1e3'),_0x6184('0x1e5'));clearInterval(_0xd5bc4a['handlePredictive']);_0xd5bc4a[_0x6184('0x94')]=undefined;}_0xd5bc4a['startProgressive']=moment()[_0x6184('0x7b')](_0x6184('0x111'));loggerPredictive[_0x6184('0x81')](_0xd5bc4a[_0x6184('0x48')],_0x6184('0x1e6'),_0xd5bc4a['startProgressive']);this[_0x6184('0x169')](_0xd5bc4a,0x1);}else if(ifInterval(_0xd5bc4a[_0x6184('0x1e7')],_0xd5bc4a[_0x6184('0x77')])){this[_0x6184('0x169')](_0xd5bc4a,0x1);loggerPredictiveCalls['info'](_0x6184('0x1e8'),_0xd5bc4a[_0x6184('0x77')],_0xd5bc4a['name']);_0xd5bc4a[_0x6184('0x73')]=0x0;_0xd5bc4a[_0x6184('0x125')]=0x0;}else if(_0x2db002<_0x4fa5f8&&_0xd5bc4a[_0x6184('0x1e9')]===_0x6184('0x1ea')){freeVariablesPredictive(_0xd5bc4a);loggerPredictive[_0x6184('0x81')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day',_0x4fa5f8,_0x6184('0x77'),_0xd5bc4a['name']);}else if(_0xbaabad<_0xd5bc4a['predictiveIntervalErlangCallsDroppedCalls']&&_0xd5bc4a[_0x6184('0x1e9')]===_0x6184('0x1ea')){freeVariablesPredictive(_0xd5bc4a);loggerPredictive[_0x6184('0x81')](_0x6184('0x1eb'),_0x6184('0x1ec'),_0xbaabad,_0x6184('0x1ed'),_0xd5bc4a[_0x6184('0x125')],_0x6184('0x77'),_0xd5bc4a[_0x6184('0x48')]);}else if(!ifInterval(_0xd5bc4a[_0x6184('0x1e7')],_0xd5bc4a[_0x6184('0x77')])&&_[_0x6184('0x46')](_0xd5bc4a['startPredictive'])&&!_[_0x6184('0x46')](_0xd5bc4a['startProgressive'])){_0xd5bc4a[_0x6184('0x2c')]=moment()[_0x6184('0x7b')](_0x6184('0x111'));loggerPredictive['info'](_0xd5bc4a[_0x6184('0x48')],_0x6184('0x1ee'),_0xd5bc4a[_0x6184('0x2c')]);this[_0x6184('0xc5')](_0xd5bc4a[_0x6184('0x1e7')])[_0x6184('0x45')](this[_0x6184('0x1ef')](_0xd5bc4a))['then'](mergeDataErlangB(_0xd5bc4a))[_0x6184('0x45')](this[_0x6184('0x1f0')](_0xd5bc4a))[_0x6184('0xb6')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0xd5bc4a));}else if(!ifInterval(_0xd5bc4a['dialPredictiveInterval'],_0xd5bc4a['startPredictive'])){_0xd5bc4a[_0x6184('0x125')]=0x0;_0xd5bc4a[_0x6184('0x2c')]=moment()[_0x6184('0x7b')](_0x6184('0x111'));loggerPredictive['info'](_0xd5bc4a[_0x6184('0x48')],_0x6184('0x1f1'),_0xd5bc4a[_0x6184('0x2c')]);clearInterval(_0xd5bc4a['handlePredictive']);_0xd5bc4a['handlePredictive']=undefined;this[_0x6184('0xc5')](_0xd5bc4a[_0x6184('0x1e7')])['then'](this[_0x6184('0x1ef')](_0xd5bc4a))[_0x6184('0x45')](mergeDataErlangB(_0xd5bc4a))[_0x6184('0x45')](this[_0x6184('0x1f0')](_0xd5bc4a))[_0x6184('0xb6')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0xd5bc4a));}else if(_0xd5bc4a[_0x6184('0x1de')]&&_0x555784<_0xd5bc4a[_0x6184('0x1de')]-_0x16ba02){freeVariablesPredictive(_0xd5bc4a);loggerPredictive[_0x6184('0x81')](_0xd5bc4a['name'],_0x6184('0x1f2'),_0x555784,_0x6184('0x1f3'),_0xd5bc4a[_0x6184('0x1de')],'-',_0x16ba02,'=',_0xd5bc4a[_0x6184('0x1de')]-_0x16ba02,')');}else if(_0xd5bc4a[_0x6184('0x1de')]&&_0x555784>_0xd5bc4a[_0x6184('0x1de')]+_0x1f558b){freeVariablesPredictive(_0xd5bc4a);loggerPredictive[_0x6184('0x81')](_0xd5bc4a[_0x6184('0x48')],_0x6184('0x1f2'),_0x555784,')\x20are\x20more\x20than\x20threshold\x20(',_0xd5bc4a[_0x6184('0x1de')],'+',_0x1f558b,'=',_0xd5bc4a[_0x6184('0x1de')]+_0x1f558b,')');}};Dialer[_0x6184('0xaf')]['getDataPredictive']=function(_0x1dec54){var _0x2f0cf7=this;return function(_0x9b5426){return new Promise(function(_0x2ac013,_0x28f8d0){_[_0x6184('0xd9')](_0x1dec54,_0x9b5426[0x0]);if(checkGetDataPredictive(_0x9b5426[0x0])){var _0x3ff414=_0x1dec54[_0x6184('0x1de')]=_0x1dec54[_0x6184('0xa5')]+_0x1dec54[_0x6184('0xa7')];var _0x5232d5=_0x1dec54[_0x6184('0x1e7')]*0x3c;var _0x1e7454=_0x9b5426[0x0][_0x6184('0x89')]+_0x9b5426[0x0]['predictiveIntervalAvgHoldtime'];var _0x3ae9d4=(_0x9b5426[0x0][_0x6184('0x6c')]+_0x9b5426[0x0][_0x6184('0x85')]+_0x9b5426[0x0][_0x6184('0x6d')])/_0x9b5426[0x0][_0x6184('0x71')];_0x1dec54['predictiveIntervalHitRate']=_0x3ae9d4>0x0?_0x3ae9d4:0x1;switch(_0x1dec54[_0x6184('0x1e9')]){case'dropRate':var _0x43831c=_0x1dec54[_0x6184('0x1dc')]/0x64;return _0x2f0cf7[_0x6184('0x1f4')](_0x3ff414,_0x5232d5,_0x1e7454,_0x3ae9d4,_0x43831c)[_0x6184('0x45')](function(_0x16eae2){return _0x2ac013(_0x16eae2);});case _0x6184('0x1f5'):var _0x4c89e0=_0x1dec54['dialPredictiveOptimizationPercentage']/0x64;return _0x2f0cf7[_0x6184('0x1f6')](_0x3ff414,_0x5232d5,_0x1e7454,_0x3ae9d4,_0x4c89e0)[_0x6184('0x45')](function(_0x38dc16){return _0x2ac013(_0x38dc16);});default:return _0x28f8d0(msgResponse(_0x6184('0x1f7'),_0x6184('0x157'),_0x6184('0x1f8')));}}else{return _0x28f8d0(msgResponse(_0x6184('0x1f7'),'Failure',_0x6184('0x1f9')));}});};};Dialer[_0x6184('0xaf')]['getDataPredictiveOld']=function(_0xa5aca3){var _0xecf46f=this;return function(_0x484bc9){return new Promise(function(_0x4de57a,_0x353717){_[_0x6184('0xd9')](_0xa5aca3,_0x484bc9[0x0]);if(checkGetDataPredictive(_0x484bc9[0x0])){loggerPredictive['info'](JSON[_0x6184('0x7a')](_0x484bc9[0x0]));if(_0xa5aca3[_0x6184('0x1e9')]===_0x6184('0x1ea')){return _0xecf46f[_0x6184('0xcf')](_0xa5aca3['id'])['then'](function(_0x1313a5){var _0x19386e=_0xa5aca3['loggedIn']-_0x1313a5[0x0]['outboundQueuePauses'];var _0x3ba098=_0xa5aca3[_0x6184('0x1e7')]*0x3c;var _0x3bbe28=_0x484bc9[0x0][_0x6184('0x89')]+_0x484bc9[0x0][_0x6184('0x87')];var _0x4fc2c3=(_0x484bc9[0x0][_0x6184('0x6c')]+_0x484bc9[0x0][_0x6184('0x85')]+_0x484bc9[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x484bc9[0x0][_0x6184('0x71')];var _0x49bd9b=_0xa5aca3[_0x6184('0x1dc')]/0x64;_0xa5aca3[_0x6184('0x70')]=_0x1313a5[0x0][_0x6184('0x1fa')]||0x0;_0xa5aca3[_0x6184('0x6f')]=_0x4fc2c3>0x0?_0x4fc2c3:0x1;return _0xecf46f[_0x6184('0x1f4')](_0x19386e,_0x3ba098,_0x3bbe28,_0x4fc2c3,_0x49bd9b);})[_0x6184('0x45')](function(_0x1485a0){return _0x4de57a(_0x1485a0);})[_0x6184('0xb6')](function(_0x3ef7f1){return _0x353717(msgResponse(_0x6184('0x1fb'),_0x6184('0x157'),JSON[_0x6184('0x7a')](_0x3ef7f1)));});}if(_0xa5aca3['dialPredictiveOptimization']===_0x6184('0x1f5')){return _0xecf46f[_0x6184('0xcf')](_0xa5aca3['id'])[_0x6184('0x45')](function(_0x90de77){var _0x3c7fa9=_0xa5aca3['loggedIn']-_0x90de77[0x0]['outboundQueuePauses'];var _0x1b7008=_0xa5aca3[_0x6184('0x1e7')]*0x3c;var _0x516358=_0x484bc9[0x0][_0x6184('0x89')]+_0x484bc9[0x0]['predictiveIntervalAvgHoldtime'];var _0x1d6666=(_0x484bc9[0x0][_0x6184('0x6c')]+_0x484bc9[0x0][_0x6184('0x85')]+_0x484bc9[0x0][_0x6184('0x6d')])/_0x484bc9[0x0][_0x6184('0x71')];var _0x8d15=_0xa5aca3[_0x6184('0x1dc')]/0x64;_0xa5aca3[_0x6184('0x70')]=_0x90de77[0x0]['outboundQueuePauses']||0x0;_0xa5aca3[_0x6184('0x6f')]=_0x1d6666>0x0?_0x1d6666:0x1;return _0xecf46f[_0x6184('0x1f6')](_0x3c7fa9,_0x1b7008,_0x516358,_0x1d6666,_0x8d15);})['then'](function(_0x54cc46){return _0x4de57a(_0x54cc46);})[_0x6184('0xb6')](function(_0x1e0678){return _0x353717(msgResponse(_0x6184('0x1fb'),_0x6184('0x157'),JSON['stringify'](_0x1e0678)));});}}else{return _0x353717(msgResponse(_0x6184('0x1f7'),_0x6184('0x157'),_0x6184('0x1f9')));}});};};Dialer[_0x6184('0xaf')][_0x6184('0x1f0')]=function(_0x241f49){var _0x104391=this;return function(){var _0x4b1670=0x0;var _0x434dfe=Math[_0x6184('0x1e1')](_0x241f49['erlangCallToSecond']*0x3e8);if(_0x434dfe>0x0){_0x434dfe=_0x434dfe<0x64?0x64:_0x434dfe;loggerPredictive[_0x6184('0x81')](_0x241f49[_0x6184('0x48')],_0x6184('0x1fc'),_0x434dfe,'milliseconds');_0x241f49[_0x6184('0x94')]=setInterval(function(){_0x104391[_0x6184('0x94')](_0x241f49);loggerPredictiveCalls[_0x6184('0x81')](_0x6184('0x1fd'),_0x4b1670+=0x1);},_0x434dfe);}else{loggerPredictive[_0x6184('0x81')](_0x241f49[_0x6184('0x48')],_0x6184('0x1fe'));}};};Dialer[_0x6184('0xaf')][_0x6184('0x1ff')]=function(_0x15a53c,_0xc413a0){var _0x5859dc=this;return function(_0x28f156){if(_[_0x6184('0x4e')](_0x28f156)){if(_['isNil'](_0xc413a0[_0x6184('0xdb')])||!_0xc413a0[_0x6184('0x200')]){if(_0x15a53c[_0x6184('0x5d')]===_0x6184('0x9')){_0x15a53c[_0x6184('0x144')]=_[_0x6184('0x46')](_0x15a53c[_0x6184('0x144')])?!![]:_0x15a53c[_0x6184('0x144')];var _0x5c43b3=uuid['v4']();_0x5859dc[_0x6184('0x28')][_0x5c43b3]=new Action(_0x15a53c,_0xc413a0,_0x5c43b3);loggerBooked['info']('[booked][checkContactBlack]',_0x5c43b3,'queueStatusComplete:\x20',JSON[_0x6184('0x7a')](_0x15a53c[_0x6184('0x144')]),_0x6184('0x201'),_0x15a53c[_0x6184('0x48')]);if(_0x15a53c[_0x6184('0x144')]){_0x15a53c[_0x6184('0x144')]=![];_0x5859dc[_0x6184('0x2e')][_0x5859dc[_0x6184('0x28')][_0x5c43b3][_0x6184('0xb8')]]=[];ami[_0x6184('0xb3')]({'actionid':_0x5c43b3,'action':'queuestatus','queue':_0x15a53c[_0x6184('0x48')]})[_0x6184('0xb6')](function(){_0x5859dc[_0x6184('0xea')](_0x15a53c);_0x5859dc['rescheduleContact']({'active':![],'ContactId':_0x5859dc['actions'][_0x5c43b3]['ContactId'],'ListId':_0x5859dc[_0x6184('0x28')][_0x5c43b3][_0x6184('0xda')],'VoiceQueueId':_0x5859dc['actions'][_0x5c43b3][_0x6184('0x105')]||undefined,'CampaignId':_0x5859dc[_0x6184('0x28')][_0x5c43b3][_0x6184('0xdc')]||undefined})[_0x6184('0xb6')](loggerCatch(_0x6184('0x202')));delete _0x5859dc['actions'][_0x5c43b3];});}else{loggerBooked[_0x6184('0x81')](_0x6184('0x203'),JSON[_0x6184('0x7a')](_0x15a53c[_0x6184('0x144')]),'Queue:\x20',_0x15a53c[_0x6184('0x48')]);_0x5859dc['updateOriginated'](_0x15a53c);_0x5859dc['rescheduleContact']({'active':![],'ContactId':_0x5859dc[_0x6184('0x28')][_0x5c43b3][_0x6184('0x104')],'ListId':_0x5859dc['actions'][_0x5c43b3]['ListId'],'VoiceQueueId':_0x5859dc['actions'][_0x5c43b3][_0x6184('0x105')]||undefined,'CampaignId':_0x5859dc['actions'][_0x5c43b3][_0x6184('0xdc')]||undefined})[_0x6184('0xb6')](loggerCatch(_0x6184('0x202')));delete _0x5859dc[_0x6184('0x28')][_0x5c43b3];}}else{return _0x5859dc[_0x6184('0x183')](_0x15a53c,_0xc413a0);}}else{if(getDiff(_0xc413a0[_0x6184('0x204')])<_0x15a53c[_0x6184('0x205')]*0x3c){if(_0xc413a0[_0x6184('0x16e')]&&!_0xc413a0[_0x6184('0x16e')][_0x6184('0x206')]){_0x5859dc[_0x6184('0x22')]['run'](_0xc413a0['id'])[_0x6184('0x20')](function(){_0x5859dc[_0x6184('0xea')](_0x15a53c);});}else{_0x5859dc[_0x6184('0xca')]({'active':![]},_0xc413a0['id'],0x1)[_0x6184('0x20')](function(){_0x5859dc[_0x6184('0xea')](_0x15a53c);});}}else{_0x15a53c['outboundReCallsDay']+=0x1;_0x5859dc['updateOriginated'](_0x15a53c);if(_0x15a53c[_0x6184('0x207')]){_0x5859dc[_0x6184('0xc8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xc413a0[_0x6184('0x104')],'ListId':_0xc413a0[_0x6184('0xda')],'VoiceQueueId':_0xc413a0[_0x6184('0x105')]||undefined,'CampaignId':_0xc413a0[_0x6184('0xdc')]||undefined})[_0x6184('0xb6')](loggerCatch(_0x6184('0x208')));_0x5859dc['createHistory'](createObjHistory(_0x15a53c,_0xc413a0,_0x6184('0x209'),0x17,'RecallInQueue'))[_0x6184('0xb6')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x5859dc[_0x6184('0xd8')](createObjHistory(_0x15a53c,_0xc413a0,_0x6184('0x20a'),0x16,'RecallFailedTimeout'),_0x6184('0x20b'),_0x6184('0x20c'));}}}}else{_0x15a53c[_0x6184('0x64')]+=0x1;_0x5859dc[_0x6184('0xd8')](createObjHistory(_0x15a53c,_0xc413a0,_0x6184('0x20d'),0xd,_0x6184('0x20e')),'[Originate][historyBlacklist]',_0x6184('0x20f'));throw'inBlackList';}};};Dialer[_0x6184('0xaf')]['handleIvr']=function(_0x3fa062){var _0x2e0554=this;var _0x44ba50=_0x3fa062[_0x6184('0x210')]-_0x3fa062[_0x6184('0x72')]-_0x3fa062['temp'];emitCampaignSummary(_0x3fa062);if(_0x44ba50>0x0){if(_0x44ba50>this[_0x6184('0x26')]){_0x44ba50=this['maxNumberOriginate'];}_0x3fa062[_0x6184('0xcb')]+=_0x44ba50;this[_0x6184('0xcd')](_0x3fa062['id'],_0x44ba50,_0x3fa062[_0x6184('0x211')],_0x3fa062)['then'](function(_0x4d2fb6){_0x3fa062[_0x6184('0xcb')]-=_0x44ba50;_0x3fa062[_0x6184('0xcb')]=_0x3fa062[_0x6184('0xcb')]>0x0?_0x3fa062['temp']:0x0;if(!checkContactEmpty(_0x4d2fb6)){_0x3fa062[_0x6184('0x47')]=_0x6184('0x212');logger[_0x6184('0x81')]('[getContactCampaign2][Empty]'+_0x3fa062['name']);}else{_0x3fa062['originated']+=_0x4d2fb6[_0x6184('0x148')];_0x3fa062[_0x6184('0x47')]=_0x6184('0x213');for(var _0x5e0b09=0x0;_0x5e0b09<_0x4d2fb6[_0x6184('0x148')];_0x5e0b09+=0x1){_0x3fa062[_0x6184('0x214')]+=0x1;if(_['isNil'](_0x4d2fb6[_0x5e0b09])||_[_0x6184('0xb2')](_0x4d2fb6[_0x5e0b09][_0x6184('0x19f')])||_[_0x6184('0xb2')](_0x4d2fb6[_0x5e0b09][_0x6184('0x186')])){_0x2e0554[_0x6184('0xd7')](_0x6184('0x215'),_0x3fa062,_0x4d2fb6[_0x5e0b09]);}else{_0x2e0554['checkIsBlackListIvr'](_['pick'](_0x4d2fb6[_0x5e0b09],[_0x6184('0xdc'),_0x6184('0x186')]))['then'](_0x2e0554[_0x6184('0x1ff')](_0x3fa062,_0x4d2fb6[_0x5e0b09]))[_0x6184('0xb6')](_0x2e0554[_0x6184('0xd6')](_0x6184('0x216'),_0x3fa062));}}}})[_0x6184('0xb6')](loggerGetContactDialer(_0x6184('0x217'),_0x3fa062,_0x44ba50));}};Dialer[_0x6184('0xaf')][_0x6184('0x169')]=function(_0x3eeab9,_0x1371e2){var _0x14513c=this;var _0x551d00=[];var _0x5dc456=_0x1371e2>=0x1?_0x1371e2:0x1;if(_0x3eeab9[_0x6184('0x5d')]==='booked'){_0x5dc456=0x1;}var _0x2b86b6=Math[_0x6184('0x1e1')](_0x3eeab9[_0x6184('0xa7')]*_0x5dc456)-_0x3eeab9[_0x6184('0x72')]-_0x3eeab9[_0x6184('0xcb')];emitVoiceQueueSummary(_0x3eeab9);if(_0x3eeab9[_0x6184('0x218')]>0x0){var _0x34097c=_0x3eeab9[_0x6184('0x218')]-_0x3eeab9['originated']-_0x3eeab9[_0x6184('0xa5')]-_0x3eeab9[_0x6184('0xcb')]-_0x3eeab9[_0x6184('0xa6')];if(_0x2b86b6>_0x34097c){_0x2b86b6=_0x34097c;}}if(_0x2b86b6>0x0){if(_0x3eeab9[_0x6184('0x5d')]===_0x6184('0x9')){_0x2b86b6=0x1;}if(_0x2b86b6>this[_0x6184('0x26')]){_0x2b86b6=this['maxNumberOriginate'];}_0x3eeab9['temp']+=_0x2b86b6;for(var _0xbd41b0 in this[_0x6184('0x24')]){if(typeof this[_0x6184('0x24')][_0xbd41b0]!==_0x6184('0x9e')){if(this[_0x6184('0x24')][_0xbd41b0][_0x6184('0xad')]===_0x6184('0x219')&&this[_0x6184('0x24')][_0xbd41b0][_0x6184('0xb4')]===_0x6184('0xe3')){_0x551d00[_0x6184('0x141')](this[_0x6184('0x24')][_0xbd41b0]['id']);}}}this[_0x6184('0x21a')](_0x3eeab9['id'],_0x551d00,_0x2b86b6,_0x3eeab9[_0x6184('0x211')],_0x3eeab9)[_0x6184('0x45')](function(_0x24e58f){_0x3eeab9[_0x6184('0xcb')]-=_0x2b86b6;_0x3eeab9[_0x6184('0xcb')]=_0x3eeab9[_0x6184('0xcb')]>0x0?_0x3eeab9[_0x6184('0xcb')]:0x0;if(!checkContactEmpty(_0x24e58f)){_0x14513c[_0x6184('0x21b')](_0x3eeab9)[_0x6184('0x45')](sendMessageReschedule(_0x3eeab9))['catch'](loggerCatch(_0x6184('0xbd')));}else{_0x3eeab9[_0x6184('0x72')]+=_0x24e58f[_0x6184('0x148')];_0x3eeab9[_0x6184('0x47')]=_0x3eeab9[_0x6184('0x5d')]===_0x6184('0x9')?_0x6184('0x18d'):_0x6184('0x213');for(var _0x36a508=0x0;_0x36a508<_0x24e58f[_0x6184('0x148')];_0x36a508+=0x1){if(_[_0x6184('0xb2')](_0x24e58f[_0x36a508])||_[_0x6184('0xb2')](_0x24e58f[_0x36a508][_0x6184('0x19f')])||_[_0x6184('0xb2')](_0x24e58f[_0x36a508]['phone'])){_0x14513c[_0x6184('0xd7')](_0x6184('0x215'),_0x3eeab9,_0x24e58f[_0x36a508]);}else{_0x14513c['checkIsBlackList'](_['pick'](_0x24e58f[_0x36a508],[_0x6184('0x105'),_0x6184('0x186')]))['then'](_0x14513c[_0x6184('0x1ff')](_0x3eeab9,_0x24e58f[_0x36a508]))[_0x6184('0xb6')](_0x14513c[_0x6184('0xd6')](_0x6184('0x215'),_0x3eeab9));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x3eeab9,_0x2b86b6));}};Dialer[_0x6184('0xaf')]['handlePredictive']=function(_0x5f196f){if(_0x5f196f[_0x6184('0x218')]>0x0){var _0x50d9aa=_0x5f196f['dialLimitQueue']-_0x5f196f[_0x6184('0x72')]-_0x5f196f[_0x6184('0xa5')];if(_0x50d9aa>0x0){this[_0x6184('0x21c')](_0x5f196f);}else{loggerPredictiveCalls[_0x6184('0x81')](_0x6184('0x21d'));}}else{this[_0x6184('0x21c')](_0x5f196f);}};Dialer[_0x6184('0xaf')][_0x6184('0x21c')]=function(_0x2d461b){var _0x514d5e=this;var _0x4c29ce=[];_0x2d461b[_0x6184('0x72')]+=0x1;for(var _0x180963 in this['agents']){if(typeof this[_0x6184('0x24')][_0x180963]!==_0x6184('0x9e')){if(this[_0x6184('0x24')][_0x180963][_0x6184('0xad')]===_0x6184('0x219')&&this[_0x6184('0x24')][_0x180963][_0x6184('0xb4')]===_0x6184('0xe3')){_0x4c29ce[_0x6184('0x141')](this[_0x6184('0x24')][_0x180963]['id']);}}}this[_0x6184('0x21a')](_0x2d461b['id'],_0x4c29ce,0x1,_0x2d461b['dialOrderByScheduledAt'],_0x2d461b)[_0x6184('0x45')](function(_0x4f4b9a){if(!checkContactEmpty(_0x4f4b9a)){checkContactLowerLimitOriginate(_0x2d461b,0x1,0x0);_0x514d5e[_0x6184('0x21b')](_0x2d461b)[_0x6184('0x45')](sendMessageReschedule(_0x2d461b))['catch'](loggerCatch(_0x6184('0xbd')));}else{_0x2d461b[_0x6184('0x47')]=_0x6184('0x213');if(_[_0x6184('0xb2')](_0x4f4b9a[0x0])||_['isNil'](_0x4f4b9a[0x0][_0x6184('0x19f')])||_[_0x6184('0xb2')](_0x4f4b9a[0x0]['phone'])){_0x514d5e[_0x6184('0xd7')]('[actionOriginate]\x20',_0x2d461b,_0x4f4b9a[0x0]);}else{_0x514d5e['checkIsBlackList'](_[_0x6184('0x142')](_0x4f4b9a[0x0],['VoiceQueueId','phone']))[_0x6184('0x45')](_0x514d5e[_0x6184('0x1ff')](_0x2d461b,_0x4f4b9a[0x0]))[_0x6184('0xb6')](_0x514d5e['loggerHandler']('[actionOriginatePredictive]\x20',_0x2d461b));}}})[_0x6184('0xb6')](loggerGetContactDialer(_0x6184('0x21e'),_0x2d461b,0x1));emitVoiceQueueSummary(_0x2d461b);};Dialer[_0x6184('0xaf')]['abandonmentRate']=function(_0x568828,_0x5d402b,_0x5aab41,_0x585e53,_0x2f4348,_0x3e8cf2){loggerPredictive[_0x6184('0x81')](_0x6184('0x21f'));loggerPredictive[_0x6184('0x81')](_0x6184('0x220'),_0x568828);loggerPredictive[_0x6184('0x81')](_0x6184('0x221'),_0x5d402b);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5aab41);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',_0x585e53);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',_0x2f4348);loggerPredictive['info'](_0x6184('0x8a'));return new Promise(function(_0x5d5975,_0x1935bf){if(_0x568828<=0x0||isNaN(_0x568828)){return _0x1935bf(msgResponse(_0x6184('0x222'),'Error',_0x6184('0x223')+_0x568828));}if(_0x5aab41<=0x0||isNaN(_0x5aab41)){return _0x1935bf(msgResponse(_0x6184('0x222'),'Error',_0x6184('0x224')+_0x5aab41));}if(_0x585e53<=0x0||isNaN(_0x585e53)){return _0x1935bf(msgResponse('[abandonmentRate]',_0x6184('0x50'),_0x6184('0x225')+_0x585e53));}if(_0x5d402b<=0x0||isNaN(_0x5d402b)){return _0x1935bf(msgResponse('[abandonmentRate]','Error','interval\x20=\x20'+_0x5d402b));}if(_0x2f4348<=0x0||isNaN(_0x2f4348)){return _0x1935bf(msgResponse('[abandonmentRate]',_0x6184('0x50'),'Amax\x20=\x20'+_0x2f4348));}_0x3e8cf2=_0x3e8cf2||0x0;var _0x25c4ca=0x1/_0x5aab41;var _0x17deba=0x0;var _0x5a10b4=0x0;var _0x33b4f3=0x0;var _0x199ccb=0x0;for(var _0x55d66e=0x0;_0x33b4f3<_0x2f4348;_0x55d66e+=0x1){_0x5a10b4=_0x55d66e/_0x5d402b;_0x17deba=(_0x585e53*_0x5a10b4+_0x3e8cf2)/_0x25c4ca;_0x33b4f3=erlangb(_0x17deba,_0x568828);_0x199ccb=_0x17deba/_0x568828*(0x1-erlangb(_0x17deba,_0x568828));}return _0x5d5975({'erlangCalls':_0x55d66e,'erlangCallToSecond':_0x5d402b/_0x55d66e,'erlangAbandonmentRate':_0x33b4f3,'erlangBusyFactor':_0x199ccb});});};Dialer[_0x6184('0xaf')]['busyFactor']=function(_0x4c73c6,_0x4e1837,_0x3b6706,_0x26404a,_0x21e652,_0x4882bd){loggerPredictive[_0x6184('0x81')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x6184('0x81')](_0x6184('0x220'),_0x4c73c6);loggerPredictive['info'](_0x6184('0x221'),_0x4e1837);loggerPredictive[_0x6184('0x81')](_0x6184('0x226'),_0x3b6706);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',_0x26404a);loggerPredictive[_0x6184('0x81')](_0x6184('0x227'),_0x21e652);loggerPredictive[_0x6184('0x81')](_0x6184('0x8a'));return new Promise(function(_0x313cac,_0x185eb9){if(_0x4c73c6<=0x0||isNaN(_0x4c73c6)){return _0x185eb9(msgResponse('[busyFactor]','Error',_0x6184('0x223')+_0x4c73c6));}if(_0x3b6706<=0x0||isNaN(_0x3b6706)){return _0x185eb9(msgResponse(_0x6184('0x228'),_0x6184('0x50'),_0x6184('0x224')+_0x3b6706));}if(_0x26404a<=0x0||isNaN(_0x26404a)){return _0x185eb9(msgResponse(_0x6184('0x228'),'Error','p\x20=\x20'+_0x26404a));}if(_0x4e1837<=0x0||isNaN(_0x4e1837)){return _0x185eb9(msgResponse(_0x6184('0x228'),'Error','interval\x20=\x20'+_0x4e1837));}if(_0x21e652<=0x0||isNaN(_0x21e652)){return _0x185eb9(msgResponse(_0x6184('0x228'),'Error',_0x6184('0x229')+_0x21e652));}_0x4882bd=_0x4882bd||0x0;var _0x52f29a=0x1/_0x3b6706;var _0x45ce04=0x0;var _0xf6e757=0x0;var _0x26ff12=0x0;var _0x44ff98=0x0;for(var _0x242910=0x0;_0x44ff98<_0x21e652;_0x242910+=0x1){_0xf6e757=_0x242910/_0x4e1837;_0x45ce04=(_0x26404a*_0xf6e757+_0x4882bd)/_0x52f29a;_0x26ff12=erlangb(_0x45ce04,_0x4c73c6);_0x44ff98=_0x45ce04/_0x4c73c6*(0x1-erlangb(_0x45ce04,_0x4c73c6));}return _0x313cac({'erlangCalls':_0x242910,'erlangCallToSecond':_0x4e1837/_0x242910,'erlangAbandonmentRate':_0x26ff12,'erlangBusyFactor':_0x44ff98});});};module[_0x6184('0x22a')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 02bfaf9..9507e8c 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6955=['countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','number','starttime','responsetime','droptime','holdtime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0xcb62,_0x1da81b){var _0x3b56b4=function(_0x3ebbc7){while(--_0x3ebbc7){_0xcb62['push'](_0xcb62['shift']());}};_0x3b56b4(++_0x1da81b);}(_0x6955,0x12c));var _0x5695=function(_0x31f004,_0x105612){_0x31f004=_0x31f004-0x0;var _0x2ba90e=_0x6955[_0x31f004];return _0x2ba90e;};'use strict';var util=require('util');var _=require(_0x5695('0x0'));var moment=require(_0x5695('0x1'));function getSeconds(_0x14dcc9,_0x9e5956){var _0x136f23=moment(_0x14dcc9)[_0x5695('0x2')](0x0);var _0x24859d=moment(_0x9e5956)[_0x5695('0x2')](0x0);return _0x136f23[_0x5695('0x3')](_0x24859d,_0x5695('0x4'));}function QueueCallerAbandon(_0x114f2c,_0x267965){this[_0x5695('0x5')]=_0x114f2c[_0x5695('0x5')];this[_0x5695('0x6')]=_0x114f2c['type'];this[_0x5695('0x7')]=_0x114f2c[_0x5695('0x6')]===_0x5695('0x8')?_0x5695('0x9'):_0x114f2c[_0x5695('0x6')];this[_0x5695('0xa')]=_0x114f2c['countbusyretry'];this[_0x5695('0xb')]=_0x114f2c[_0x5695('0xb')];this['countnoanswerretry']=_0x114f2c['countnoanswerretry'];this[_0x5695('0xc')]=_0x114f2c[_0x5695('0xa')]+_0x114f2c[_0x5695('0xb')]+_0x114f2c[_0x5695('0xd')]+_0x114f2c[_0x5695('0xe')]+_0x114f2c[_0x5695('0xf')]+_0x114f2c[_0x5695('0x10')]+_0x114f2c[_0x5695('0x11')]+_0x114f2c[_0x5695('0x12')];this[_0x5695('0xe')]=_0x114f2c[_0x5695('0xe')];this[_0x5695('0xf')]=_0x114f2c[_0x5695('0xf')];this[_0x5695('0x10')]=_0x114f2c[_0x5695('0x10')];this[_0x5695('0x11')]=_0x114f2c[_0x5695('0x11')];this['countagentrejectretry']=_0x114f2c[_0x5695('0x12')];this[_0x5695('0x13')]=_0x267965[_0x5695('0x13')];this[_0x5695('0x14')]=_0x114f2c['name'];this['calleridnum']=_0x114f2c[_0x5695('0x15')];this[_0x5695('0x16')]=_0x114f2c['starttime'];this[_0x5695('0x17')]=_0x114f2c['responsetime'];this[_0x5695('0x18')]=_0x114f2c['droptime'];this['endtime']=this[_0x5695('0x18')];this['ringtime']=getSeconds(_0x114f2c[_0x5695('0x17')],_0x114f2c[_0x5695('0x16')]);this[_0x5695('0x19')]=getSeconds(this[_0x5695('0x18')],_0x114f2c[_0x5695('0x17')]);this['talktime']=0x0;this['queue']=_0x267965[_0x5695('0x9')];this['membername']=_0x267965[_0x5695('0x1a')];this[_0x5695('0x1b')]=_0x267965[_0x5695('0x1b')];this[_0x5695('0x1c')]=_0x114f2c[_0x5695('0x1c')];this[_0x5695('0x1d')]=_0x114f2c[_0x5695('0x1d')];this['callbackat']=_0x114f2c[_0x5695('0x1e')];this[_0x5695('0x1f')]=_0x114f2c[_0x5695('0x1f')];this[_0x5695('0x20')]=_0x114f2c[_0x5695('0x20')];this[_0x5695('0x21')]=_0x114f2c['ListId'];this['UserId']=_0x114f2c[_0x5695('0x22')];this[_0x5695('0x23')]=_0x114f2c[_0x5695('0x23')];this[_0x5695('0x24')]=_0x114f2c[_0x5695('0x24')];this[_0x5695('0x25')]=_0x114f2c[_0x5695('0x25')]||'';this['originatecalleridname']=_0x114f2c[_0x5695('0x26')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xdb87=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridnum','starttime','responsetime','droptime','endtime','holdtime','membername','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x478a4a,_0x197493){var _0x353441=function(_0x3c58f9){while(--_0x3c58f9){_0x478a4a['push'](_0x478a4a['shift']());}};_0x353441(++_0x197493);}(_0xdb87,0x11d));var _0x7db8=function(_0x2e507e,_0x2e5fcd){_0x2e507e=_0x2e507e-0x0;var _0x2948eb=_0xdb87[_0x2e507e];return _0x2948eb;};'use strict';var util=require(_0x7db8('0x0'));var _=require('lodash');var moment=require(_0x7db8('0x1'));function getSeconds(_0x1082a2,_0x12a3c8){var _0x244fe1=moment(_0x1082a2)['milliseconds'](0x0);var _0x1a0b85=moment(_0x12a3c8)[_0x7db8('0x2')](0x0);return _0x244fe1[_0x7db8('0x3')](_0x1a0b85,_0x7db8('0x4'));}function QueueCallerAbandon(_0x1e76da,_0x2d061e){this[_0x7db8('0x5')]=_0x1e76da[_0x7db8('0x5')];this[_0x7db8('0x6')]=_0x1e76da[_0x7db8('0x6')];this[_0x7db8('0x7')]=_0x1e76da[_0x7db8('0x6')]===_0x7db8('0x8')?_0x7db8('0x9'):_0x1e76da[_0x7db8('0x6')];this['countbusyretry']=_0x1e76da[_0x7db8('0xa')];this[_0x7db8('0xb')]=_0x1e76da[_0x7db8('0xb')];this['countnoanswerretry']=_0x1e76da[_0x7db8('0xc')];this[_0x7db8('0xd')]=_0x1e76da[_0x7db8('0xa')]+_0x1e76da[_0x7db8('0xb')]+_0x1e76da['countnoanswerretry']+_0x1e76da[_0x7db8('0xe')]+_0x1e76da['countdropretry']+_0x1e76da[_0x7db8('0xf')]+_0x1e76da[_0x7db8('0x10')]+_0x1e76da[_0x7db8('0x11')];this[_0x7db8('0xe')]=_0x1e76da[_0x7db8('0xe')];this[_0x7db8('0x12')]=_0x1e76da['countdropretry'];this['countabandonedretry']=_0x1e76da['countabandonedretry'];this['countmachineretry']=_0x1e76da['countmachineretry'];this[_0x7db8('0x11')]=_0x1e76da['countagentrejectretry'];this[_0x7db8('0x13')]=_0x2d061e['uniqueid'];this['calleridname']=_0x1e76da['name'];this[_0x7db8('0x14')]=_0x1e76da['number'];this[_0x7db8('0x15')]=_0x1e76da[_0x7db8('0x15')];this['responsetime']=_0x1e76da[_0x7db8('0x16')];this[_0x7db8('0x17')]=_0x1e76da['droptime'];this[_0x7db8('0x18')]=this['droptime'];this['ringtime']=getSeconds(_0x1e76da['responsetime'],_0x1e76da[_0x7db8('0x15')]);this[_0x7db8('0x19')]=getSeconds(this[_0x7db8('0x17')],_0x1e76da['responsetime']);this['talktime']=0x0;this[_0x7db8('0x9')]=_0x2d061e['queue'];this[_0x7db8('0x1a')]=_0x2d061e[_0x7db8('0x1b')];this[_0x7db8('0x1c')]=_0x2d061e[_0x7db8('0x1c')];this[_0x7db8('0x1d')]=_0x1e76da['callback'];this['callbackuniqueid']=_0x1e76da['callbackuniqueid'];this[_0x7db8('0x1e')]=_0x1e76da[_0x7db8('0x1e')];this['recallme']=_0x1e76da[_0x7db8('0x1f')];this[_0x7db8('0x20')]=_0x1e76da[_0x7db8('0x20')];this[_0x7db8('0x21')]=_0x1e76da[_0x7db8('0x21')];this[_0x7db8('0x22')]=_0x1e76da[_0x7db8('0x22')];this[_0x7db8('0x23')]=_0x1e76da['VoiceQueueId'];this['CampaignId']=_0x1e76da[_0x7db8('0x24')];this['originatecalleridnum']=_0x1e76da[_0x7db8('0x25')]||'';this[_0x7db8('0x26')]=_0x1e76da[_0x7db8('0x26')]||'';}module[_0x7db8('0x27')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index ae9fcd9..b79b47c 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(_0xf4e992,_0x33bf5a){var _0x1a737e=function(_0x442d4c){while(--_0x442d4c){_0xf4e992['push'](_0xf4e992['shift']());}};_0x1a737e(++_0x33bf5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0x2787c3,_0x58223f){var _0x5664be=function(_0xa374fa){while(--_0xa374fa){_0x2787c3['push'](_0x2787c3['shift']());}};_0x5664be(++_0x58223f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 889fa86..2386730 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 _0x237f=['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','execOriginate','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','varset','syncVarSet','bind','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','syncNewchannel','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','message','create','parse','notify','.pdf','catch','error','stringify','\x20receiveFax\x20','syncOriginateResponse','pick','response','reason','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','update','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','format'];(function(_0x5f0501,_0x19196e){var _0x3c2c45=function(_0x107fe6){while(--_0x107fe6){_0x5f0501['push'](_0x5f0501['shift']());}};_0x3c2c45(++_0x19196e);}(_0x237f,0x104));var _0xf237=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x237f[_0x43b08];return _0x5e05f4;};'use strict';var util=require(_0xf237('0x0'));var _=require(_0xf237('0x1'));var BPromise=require(_0xf237('0x2'));var uuid=require(_0xf237('0x3'));var moment=require(_0xf237('0x4'));var path=require(_0xf237('0x5'));var tiff2pdf=require(_0xf237('0x6'));var gs=require(_0xf237('0x7'));var logger=require(_0xf237('0x8'))(_0xf237('0x9'));var ami=require(_0xf237('0xa'));var rpcDb=require('./rpcDb');var Channel=require(_0xf237('0xb'));var ut=require(_0xf237('0xc'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0xf237('0xd'));function Fax(_0x1c0f6c){this['channels']={};this[_0xf237('0xe')]=_0x1c0f6c[_0xf237('0xe')];this[_0xf237('0xf')]=_0x1c0f6c[_0xf237('0xf')];this[_0xf237('0x10')]={};ami['on'](_0xf237('0x11'),this['syncNewchannel']['bind'](this));ami['on'](_0xf237('0x12'),this[_0xf237('0x13')][_0xf237('0x14')](this));ami['on']('newstate',this['syncNewState']['bind'](this));ami['on'](_0xf237('0x15'),this[_0xf237('0x16')][_0xf237('0x14')](this));ami['on'](_0xf237('0x17'),this[_0xf237('0x18')][_0xf237('0x14')](this));ami['on'](_0xf237('0x19'),this[_0xf237('0x1a')]['bind'](this));ami['on'](_0xf237('0x1b'),this[_0xf237('0x1c')][_0xf237('0x14')](this));ami['on'](_0xf237('0x1d'),this['syncOriginateResponse'][_0xf237('0x14')](this));}Fax[_0xf237('0x1e')][_0xf237('0x1f')]=function(_0x2894aa){if(_0x2894aa['context']==='from-voip-provider'){for(var _0x10ee5c in this[_0xf237('0xe')]){if(this[_0xf237('0xe')][_0xf237('0x20')](_0x10ee5c)){if(_0x2894aa[_0xf237('0x21')]===this['faxAccounts'][_0x10ee5c][_0xf237('0x22')]){this[_0xf237('0x23')][_0x2894aa[_0xf237('0x24')]]={};this[_0xf237('0x23')][_0x2894aa[_0xf237('0x24')]]['channel']=_0x2894aa[_0xf237('0x25')];this[_0xf237('0x23')][_0x2894aa[_0xf237('0x24')]]['id']=this[_0xf237('0xe')][_0x10ee5c]['id'];this[_0xf237('0x23')][_0x2894aa['uniqueid']][_0xf237('0x26')]=this[_0xf237('0xe')][_0x10ee5c][_0xf237('0x26')];logger[_0xf237('0x27')](_0x2894aa[_0xf237('0x24')],_0xf237('0x28'));}}}}if(this['actions'][_0x2894aa[_0xf237('0x24')]]){this[_0xf237('0x23')][_0x2894aa[_0xf237('0x24')]]={};this[_0xf237('0x23')][_0x2894aa['uniqueid']]['channel']=_0x2894aa[_0xf237('0x25')];logger[_0xf237('0x27')](_0x2894aa['uniqueid'],_0xf237('0x28'));}};Fax[_0xf237('0x1e')][_0xf237('0x13')]=function(_0xde9723){if(this[_0xf237('0x23')][_0xde9723['uniqueid']]){for(var _0x375fac in _0xde9723[_0xf237('0x29')]){if(_0xde9723['variable'][_0xf237('0x20')](_0x375fac)){this[_0xf237('0x23')][_0xde9723['uniqueid']][_0x375fac]=_0xde9723[_0xf237('0x2a')];}}}};Fax[_0xf237('0x1e')][_0xf237('0x2b')]=function(_0x5eb6d9){if(this[_0xf237('0x23')][_0x5eb6d9[_0xf237('0x24')]]){this[_0xf237('0x23')][_0x5eb6d9[_0xf237('0x24')]][_0xf237('0x2c')]=_0x5eb6d9[_0xf237('0x2c')];this[_0xf237('0x23')][_0x5eb6d9[_0xf237('0x24')]][_0xf237('0x2d')]=_0x5eb6d9['channelstatedesc'];}};Fax['prototype']['syncNewExten']=function(_0x52f572){if(this[_0xf237('0x23')][_0x52f572[_0xf237('0x24')]]){for(var _0x4af04b in _0x52f572[_0xf237('0x29')]){if(_0x52f572[_0xf237('0x29')][_0xf237('0x20')](_0x4af04b)){this['channels'][_0x52f572[_0xf237('0x24')]][_0x4af04b]=_0x52f572['value'];}}}};Fax['prototype'][_0xf237('0x18')]=function(_0x3b9af8){if(this[_0xf237('0x23')][_0x3b9af8[_0xf237('0x24')]]){this[_0xf237('0x23')][_0x3b9af8[_0xf237('0x24')]]['operation']=_0x3b9af8['operation'];this[_0xf237('0x23')][_0x3b9af8['uniqueid']][_0xf237('0x2e')]=_0x3b9af8[_0xf237('0x2e')];this['channels'][_0x3b9af8[_0xf237('0x24')]][_0xf237('0x22')]=_0x3b9af8['localstationid'];this[_0xf237('0x23')][_0x3b9af8[_0xf237('0x24')]][_0xf237('0x2f')]=_0x3b9af8[_0xf237('0x2f')];logger[_0xf237('0x27')](_0x3b9af8[_0xf237('0x24')],_0xf237('0x30'));}};Fax['prototype'][_0xf237('0x1a')]=function(_0x4e4313){var _0x935cf2=this;if(this[_0xf237('0x23')][_0x4e4313[_0xf237('0x24')]]){var _0x4f22a6=this[_0xf237('0x23')][_0x4e4313[_0xf237('0x24')]]['id'];this[_0xf237('0x23')][_0x4e4313['uniqueid']][_0xf237('0x31')]=_0x4e4313[_0xf237('0x31')];this[_0xf237('0x23')][_0x4e4313[_0xf237('0x24')]][_0xf237('0x32')]=_0x4e4313[_0xf237('0x32')];this[_0xf237('0x23')][_0x4e4313[_0xf237('0x24')]]['localstationid']=_0x4e4313[_0xf237('0x22')];this[_0xf237('0x23')][_0x4e4313[_0xf237('0x24')]][_0xf237('0x33')]=_0x4e4313[_0xf237('0x33')];this[_0xf237('0x23')][_0x4e4313[_0xf237('0x24')]][_0xf237('0x34')]=_0x4e4313[_0xf237('0x34')];this['channels'][_0x4e4313['uniqueid']][_0xf237('0x2f')]=_0x4e4313[_0xf237('0x2f')];this[_0xf237('0x23')][_0x4e4313['uniqueid']][_0xf237('0x35')]=_0x4e4313['calleridnum'];if(this[_0xf237('0x23')][_0x4e4313[_0xf237('0x24')]][_0xf237('0x32')]>0x0){tiff2pdf(_0x4e4313[_0xf237('0x2f')],'/var/opt/motion2/server/files/attachments/',function(_0xce6aff){logger['info'](_0x4e4313['uniqueid'],'\x20result\x20conversion\x20file\x20',_0xce6aff[_0xf237('0x36')]);attachment[_0xf237('0x37')]({'name':path['parse'](_0x4e4313['filename'])['name'],'basename':path[_0xf237('0x38')](_0x4e4313[_0xf237('0x2f')])[_0xf237('0x26')]+'.pdf','type':'application/pdf'})['then'](function(_0x9cb3ad){faxAccount[_0xf237('0x39')](_0x4f22a6,{'from':_0x4e4313['calleridnum'],'mapKey':'fax','body':path['parse'](_0x4e4313[_0xf237('0x2f')])['name']+_0xf237('0x3a'),'AttachmentId':_0x9cb3ad['id']})[_0xf237('0x3b')](function(_0x214d13){logger[_0xf237('0x3c')](_0x4e4313['uniqueid'],'\x20notify\x20',JSON[_0xf237('0x3d')](_0x214d13));});})[_0xf237('0x3b')](function(_0x351701){logger[_0xf237('0x3c')](_0x4e4313['uniqueid'],'\x20receiveFax\x20',JSON['stringify'](_0x351701));});});}logger[_0xf237('0x27')](_0x4e4313['uniqueid'],_0xf237('0x3e'));}};Fax['prototype'][_0xf237('0x3f')]=function(_0xabdef1){if(this['actions'][_0xabdef1[_0xf237('0x24')]]){_['merge'](this[_0xf237('0x23')][_0xabdef1[_0xf237('0x24')]],_[_0xf237('0x40')](_0xabdef1,[_0xf237('0x41'),_0xf237('0x42')]));}};function updateStatus(_0x1cf210){if(_0x1cf210['AttachmentId']){faxMessage['update'](_0x1cf210['AttachmentId'],{'failMessage':_0xf237('0x43')})[_0xf237('0x44')](function(_0x4637fa){ut[_0xf237('0x45')](_0xf237('0x46'),_0x4637fa);})[_0xf237('0x3b')](function(_0x52ff85){ut[_0xf237('0x45')](_0xf237('0x47'),_0x52ff85);});}else{ut['logger'](_0xf237('0x48'));}}Fax['prototype'][_0xf237('0x49')]=function(_0x27ca29,_0x27d898,_0x414b39){var _0x161f54=this;var _0x137e77={};if(_0x27d898){_0x137e77={'read':_0x27d898};}else{_0x137e77={'failMessage':_0x414b39};}if(this['actions'][_0x27ca29][_0xf237('0x4a')]){faxMessage[_0xf237('0x4b')](this[_0xf237('0x10')][_0x27ca29][_0xf237('0x4a')],_0x137e77)[_0xf237('0x44')](function(_0x163181){ut[_0xf237('0x45')](_0xf237('0x4c'),_0x163181);})['catch'](function(_0xc31a0b){ut['logger']('[Fax][Message][NoUpdate1]',_0xc31a0b);})[_0xf237('0x4d')](function(){delete _0x161f54[_0xf237('0x23')][_0x27ca29];delete _0x161f54['actions'][_0x27ca29];});}else{ut[_0xf237('0x45')](_0xf237('0x4e'));delete this[_0xf237('0x23')][_0x27ca29];delete this[_0xf237('0x10')][_0x27ca29];}};Fax['prototype'][_0xf237('0x1c')]=function(_0x29bd5b){var _0x1ee1d1=this;if(this[_0xf237('0x23')][_0x29bd5b[_0xf237('0x24')]]){if(this[_0xf237('0x10')][_0x29bd5b[_0xf237('0x24')]]){this[_0xf237('0x23')][_0x29bd5b[_0xf237('0x24')]]['id']=this['actions'][_0x29bd5b['uniqueid']]['id'];this[_0xf237('0x23')][_0x29bd5b['uniqueid']][_0xf237('0x26')]=this[_0xf237('0x10')][_0x29bd5b[_0xf237('0x24')]]['name'];}logger[_0xf237('0x27')](_0x29bd5b[_0xf237('0x24')],this[_0xf237('0x10')][_0x29bd5b[_0xf237('0x24')]]?'\x20hangup\x20sendFile\x20':_0xf237('0x4f'),JSON['stringify'](this[_0xf237('0x23')][_0x29bd5b[_0xf237('0x24')]]));if(this[_0xf237('0x10')][_0x29bd5b[_0xf237('0x24')]]){if(this[_0xf237('0x23')][_0x29bd5b['uniqueid']][_0xf237('0x50')]>0x0&&this['channels'][_0x29bd5b['uniqueid']][_0xf237('0x17')]==='SUCCESS'){this[_0xf237('0x49')](_0x29bd5b[_0xf237('0x24')],!![]);}else{this[_0xf237('0x49')](_0x29bd5b['uniqueid'],![],this['channels'][_0x29bd5b[_0xf237('0x24')]][_0xf237('0x51')]?_0xf237('0x52')+this[_0xf237('0x23')][_0x29bd5b['uniqueid']][_0xf237('0x51')]:'SENDING\x20FAILED');}}}};Fax[_0xf237('0x1e')][_0xf237('0x53')]=function(_0x8242ed){var _0x5b0da3=this;return new BPromise(function(_0x5a668d,_0x13db07){_0x5b0da3['execOriginate'](_0x8242ed,_0x5b0da3['faxAccounts'][_0x8242ed[_0xf237('0x54')]])[_0xf237('0x44')](function(_0x41dc00){ut[_0xf237('0x45')](_0xf237('0x55'),_0x41dc00);_0x5a668d(ut[_0xf237('0x36')](_0xf237('0x56')));})[_0xf237('0x3b')](function(_0x1479c2){ut['logger'](_0xf237('0x57'),_0x1479c2);updateStatus(_0x8242ed);_0x13db07(ut[_0xf237('0x36')](_0xf237('0x58')));});});};Fax[_0xf237('0x1e')][_0xf237('0x59')]=function(_0x3f9792){var _0x2a0e48=this;return new BPromise(function(_0x10b8b7,_0x3f88bc){var _0x2ba2af=_0x2a0e48['checkTrunk'](_0x2a0e48[_0xf237('0xe')][_0x3f9792[_0xf237('0x54')]][_0xf237('0x5a')],_0x3f9792);if(_0x2ba2af[_0xf237('0x5b')]){_0x10b8b7(ut[_0xf237('0x36')](_0xf237('0x5c')));}else{_0x3f88bc(ut[_0xf237('0x36')](_0x2ba2af[_0xf237('0x36')]));}});};function originate(_0x1dac90,_0xa66fab,_0x2e1c9b){return new BPromise(function(_0x19e517,_0x3bf375){if(_0x2e1c9b){var _0x192d1c=util[_0xf237('0x5d')](_0xf237('0x5e'),path['parse'](_0x1dac90['path'])[_0xf237('0x26')],_0x1dac90[_0xf237('0x5')]);gs[_0xf237('0x5f')](_0x192d1c)['then'](function(){_0x1dac90[_0xf237('0x5')]=util['format'](_0xf237('0x60'),path[_0xf237('0x38')](_0x1dac90[_0xf237('0x5')])[_0xf237('0x61')],path[_0xf237('0x38')](_0x1dac90['path'])[_0xf237('0x26')]);_0xa66fab[_0xf237('0x62')]=_0x1dac90[_0xf237('0x5')];ut[_0xf237('0x45')](_0xf237('0x63'),'');ami[_0xf237('0x64')](ut['variablesAction'](_0x1dac90,_0xa66fab))[_0xf237('0x44')](function(_0x1cc1e1){_0x19e517(_0x1cc1e1);})[_0xf237('0x3b')](function(_0xcd7441){_0x3bf375(_0xcd7441);});})[_0xf237('0x3b')](function(_0x594e27){_0x3bf375(_0x594e27);});}else{ami[_0xf237('0x64')](ut[_0xf237('0x65')](_0x1dac90,_0xa66fab))[_0xf237('0x44')](function(_0xbb2919){_0x19e517(_0xbb2919);})[_0xf237('0x3b')](function(_0x48800a){_0x3bf375(_0x48800a);});}});}Fax['prototype'][_0xf237('0x66')]=function(_0x191ae5,_0x258d4d){var _0x30a276=this;return new BPromise(function(_0x50cbeb,_0x33f3f1){var _0x41b1ef=uuid['v4']();var _0x39571e=ut[_0xf237('0x67')](_0x191ae5,_0x258d4d);_0x30a276[_0xf237('0x10')][_0x41b1ef]=new Action(_0x41b1ef,_0x258d4d,_0x191ae5);var _0x2f48d7=_0x30a276[_0xf237('0x10')][_0x41b1ef];if(path['parse'](_0x191ae5['path'])['ext']===_0xf237('0x3a')){originate(_0x2f48d7,_0x39571e,!![])[_0xf237('0x44')](function(_0x20e900){_0x50cbeb(_0x20e900);})[_0xf237('0x3b')](function(_0x44434b){_0x33f3f1(_0x44434b);});}else{originate(_0x2f48d7,_0x39571e,![])['then'](function(_0x595e59){_0x50cbeb(_0x595e59);})[_0xf237('0x3b')](function(_0x5ef563){_0x33f3f1(_0x5ef563);});}});};Fax['prototype'][_0xf237('0x68')]=function(_0x555934){return!_['isNil'](_0x555934)&&!_[_0xf237('0x69')](_0x555934[_0xf237('0x26')])&&!_[_0xf237('0x69')](_0x555934[_0xf237('0x6a')])&&_0x555934[_0xf237('0x6a')]&&!_[_0xf237('0x69')](this[_0xf237('0xf')][util[_0xf237('0x5d')](_0xf237('0x6b'),_0x555934['name'])])&&!_[_0xf237('0x69')](this[_0xf237('0xf')][util['format'](_0xf237('0x6b'),_0x555934['name'])][_0xf237('0x2e')])&&(this[_0xf237('0xf')][util[_0xf237('0x5d')](_0xf237('0x6b'),_0x555934[_0xf237('0x26')])][_0xf237('0x2e')]===_0xf237('0x6c')||this[_0xf237('0xf')][util['format'](_0xf237('0x6b'),_0x555934[_0xf237('0x26')])][_0xf237('0x2e')]===_0xf237('0x6d'));};Fax[_0xf237('0x1e')][_0xf237('0x6e')]=function(_0x5046b0,_0x3c424d){if(!this[_0xf237('0x68')](_0x5046b0)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_['isNil'](_0x5046b0)?'':_0x5046b0['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xf237('0x6f')};}if(_[_0xf237('0x69')](_0x3c424d[_0xf237('0x9')])){ut[_0xf237('0x45')](_0xf237('0x70'),JSON['stringify'](_0x3c424d));return{'isValid':![],'message':_0xf237('0x71')};}if(_[_0xf237('0x69')](_0x3c424d['path'])){ut[_0xf237('0x45')](_0xf237('0x72'),JSON[_0xf237('0x3d')](_0x3c424d));return{'isValid':![],'message':_0xf237('0x73')};}return{'isValid':!![],'message':_0xf237('0x74')};};module[_0xf237('0x75')]=Fax; \ No newline at end of file +var _0xf927=['uuid','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','newexten','syncNewExten','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','.pdf','isTrunkReachable','isNil','SIP/%s','reachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Is\x20Valid','util','lodash','bluebird'];(function(_0x492700,_0x3a0e74){var _0x1a33d5=function(_0x1111d2){while(--_0x1111d2){_0x492700['push'](_0x492700['shift']());}};_0x1a33d5(++_0x3a0e74);}(_0xf927,0x15c));var _0x7f92=function(_0x19ef92,_0x3a0d23){_0x19ef92=_0x19ef92-0x0;var _0x4cf7c4=_0xf927[_0x19ef92];return _0x4cf7c4;};'use strict';var util=require(_0x7f92('0x0'));var _=require(_0x7f92('0x1'));var BPromise=require(_0x7f92('0x2'));var uuid=require(_0x7f92('0x3'));var moment=require(_0x7f92('0x4'));var path=require(_0x7f92('0x5'));var tiff2pdf=require(_0x7f92('0x6'));var gs=require('./util/gs');var logger=require(_0x7f92('0x7'))(_0x7f92('0x8'));var ami=require(_0x7f92('0x9'));var rpcDb=require(_0x7f92('0xa'));var Channel=require(_0x7f92('0xb'));var ut=require(_0x7f92('0xc'));var Action=require(_0x7f92('0xd'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x7f92('0xe'));var faxMessage=require(_0x7f92('0xf'));function Fax(_0x1c280e){this['channels']={};this['faxAccounts']=_0x1c280e[_0x7f92('0x10')];this[_0x7f92('0x11')]=_0x1c280e['trunks'];this[_0x7f92('0x12')]={};ami['on'](_0x7f92('0x13'),this[_0x7f92('0x14')][_0x7f92('0x15')](this));ami['on'](_0x7f92('0x16'),this['syncVarSet']['bind'](this));ami['on'](_0x7f92('0x17'),this['syncNewState'][_0x7f92('0x15')](this));ami['on'](_0x7f92('0x18'),this[_0x7f92('0x19')][_0x7f92('0x15')](this));ami['on']('faxstatus',this['syncFaxStatus']['bind'](this));ami['on'](_0x7f92('0x1a'),this[_0x7f92('0x1b')][_0x7f92('0x15')](this));ami['on'](_0x7f92('0x1c'),this['syncHangup'][_0x7f92('0x15')](this));ami['on'](_0x7f92('0x1d'),this[_0x7f92('0x1e')][_0x7f92('0x15')](this));}Fax[_0x7f92('0x1f')][_0x7f92('0x14')]=function(_0xabc9b1){if(_0xabc9b1['context']===_0x7f92('0x20')){for(var _0x5eab36 in this[_0x7f92('0x10')]){if(this[_0x7f92('0x10')][_0x7f92('0x21')](_0x5eab36)){if(_0xabc9b1['exten']===this[_0x7f92('0x10')][_0x5eab36][_0x7f92('0x22')]){this[_0x7f92('0x23')][_0xabc9b1['uniqueid']]={};this[_0x7f92('0x23')][_0xabc9b1[_0x7f92('0x24')]][_0x7f92('0x25')]=_0xabc9b1[_0x7f92('0x25')];this[_0x7f92('0x23')][_0xabc9b1[_0x7f92('0x24')]]['id']=this[_0x7f92('0x10')][_0x5eab36]['id'];this[_0x7f92('0x23')][_0xabc9b1['uniqueid']][_0x7f92('0x26')]=this[_0x7f92('0x10')][_0x5eab36]['name'];logger[_0x7f92('0x27')](_0xabc9b1[_0x7f92('0x24')],_0x7f92('0x28'));}}}}if(this[_0x7f92('0x12')][_0xabc9b1[_0x7f92('0x24')]]){this['channels'][_0xabc9b1['uniqueid']]={};this['channels'][_0xabc9b1[_0x7f92('0x24')]][_0x7f92('0x25')]=_0xabc9b1['channel'];logger['info'](_0xabc9b1[_0x7f92('0x24')],_0x7f92('0x28'));}};Fax[_0x7f92('0x1f')]['syncVarSet']=function(_0x5d63ca){if(this[_0x7f92('0x23')][_0x5d63ca['uniqueid']]){for(var _0x3296a1 in _0x5d63ca[_0x7f92('0x29')]){if(_0x5d63ca[_0x7f92('0x29')][_0x7f92('0x21')](_0x3296a1)){this[_0x7f92('0x23')][_0x5d63ca[_0x7f92('0x24')]][_0x3296a1]=_0x5d63ca[_0x7f92('0x2a')];}}}};Fax[_0x7f92('0x1f')][_0x7f92('0x2b')]=function(_0x1a8f09){if(this[_0x7f92('0x23')][_0x1a8f09[_0x7f92('0x24')]]){this[_0x7f92('0x23')][_0x1a8f09[_0x7f92('0x24')]][_0x7f92('0x2c')]=_0x1a8f09['channelstate'];this['channels'][_0x1a8f09[_0x7f92('0x24')]][_0x7f92('0x2d')]=_0x1a8f09[_0x7f92('0x2d')];}};Fax[_0x7f92('0x1f')]['syncNewExten']=function(_0xf87b62){if(this['channels'][_0xf87b62['uniqueid']]){for(var _0x29d5cf in _0xf87b62[_0x7f92('0x29')]){if(_0xf87b62['variable'][_0x7f92('0x21')](_0x29d5cf)){this[_0x7f92('0x23')][_0xf87b62[_0x7f92('0x24')]][_0x29d5cf]=_0xf87b62['value'];}}}};Fax['prototype'][_0x7f92('0x2e')]=function(_0x48a3bf){if(this[_0x7f92('0x23')][_0x48a3bf[_0x7f92('0x24')]]){this[_0x7f92('0x23')][_0x48a3bf[_0x7f92('0x24')]][_0x7f92('0x2f')]=_0x48a3bf[_0x7f92('0x2f')];this['channels'][_0x48a3bf[_0x7f92('0x24')]]['status']=_0x48a3bf[_0x7f92('0x30')];this[_0x7f92('0x23')][_0x48a3bf[_0x7f92('0x24')]][_0x7f92('0x22')]=_0x48a3bf[_0x7f92('0x22')];this[_0x7f92('0x23')][_0x48a3bf[_0x7f92('0x24')]][_0x7f92('0x31')]=_0x48a3bf[_0x7f92('0x31')];logger[_0x7f92('0x27')](_0x48a3bf[_0x7f92('0x24')],_0x7f92('0x32'));}};Fax['prototype']['syncReceiveFax']=function(_0x10de25){var _0x4ab002=this;if(this[_0x7f92('0x23')][_0x10de25[_0x7f92('0x24')]]){var _0x32a014=this[_0x7f92('0x23')][_0x10de25[_0x7f92('0x24')]]['id'];this['channels'][_0x10de25[_0x7f92('0x24')]][_0x7f92('0x33')]=_0x10de25[_0x7f92('0x33')];this[_0x7f92('0x23')][_0x10de25[_0x7f92('0x24')]][_0x7f92('0x34')]=_0x10de25[_0x7f92('0x34')];this[_0x7f92('0x23')][_0x10de25['uniqueid']][_0x7f92('0x22')]=_0x10de25[_0x7f92('0x22')];this[_0x7f92('0x23')][_0x10de25[_0x7f92('0x24')]]['resolution']=_0x10de25[_0x7f92('0x35')];this[_0x7f92('0x23')][_0x10de25[_0x7f92('0x24')]][_0x7f92('0x36')]=_0x10de25[_0x7f92('0x36')];this[_0x7f92('0x23')][_0x10de25[_0x7f92('0x24')]][_0x7f92('0x31')]=_0x10de25[_0x7f92('0x31')];this[_0x7f92('0x23')][_0x10de25[_0x7f92('0x24')]][_0x7f92('0x37')]=_0x10de25[_0x7f92('0x37')];if(this[_0x7f92('0x23')][_0x10de25[_0x7f92('0x24')]]['pagestransferred']>0x0){tiff2pdf(_0x10de25['filename'],_0x7f92('0x38'),function(_0x248b6e){logger[_0x7f92('0x27')](_0x10de25[_0x7f92('0x24')],'\x20result\x20conversion\x20file\x20',_0x248b6e[_0x7f92('0x39')]);attachment[_0x7f92('0x3a')]({'name':path[_0x7f92('0x3b')](_0x10de25[_0x7f92('0x31')])[_0x7f92('0x26')],'basename':path['parse'](_0x10de25[_0x7f92('0x31')])['name']+'.pdf','type':_0x7f92('0x3c')})[_0x7f92('0x3d')](function(_0x351b98){faxAccount[_0x7f92('0x3e')](_0x32a014,{'from':_0x10de25[_0x7f92('0x37')],'mapKey':'fax','body':path[_0x7f92('0x3b')](_0x10de25[_0x7f92('0x31')])['name']+'.pdf','AttachmentId':_0x351b98['id']})[_0x7f92('0x3f')](function(_0x92363c){logger[_0x7f92('0x40')](_0x10de25[_0x7f92('0x24')],_0x7f92('0x41'),JSON[_0x7f92('0x42')](_0x92363c));});})[_0x7f92('0x3f')](function(_0x469843){logger[_0x7f92('0x40')](_0x10de25[_0x7f92('0x24')],_0x7f92('0x43'),JSON[_0x7f92('0x42')](_0x469843));});});}logger[_0x7f92('0x27')](_0x10de25[_0x7f92('0x24')],'\x20receiveFax\x20');}};Fax[_0x7f92('0x1f')][_0x7f92('0x1e')]=function(_0x4a4bd2){if(this[_0x7f92('0x12')][_0x4a4bd2[_0x7f92('0x24')]]){_[_0x7f92('0x44')](this['channels'][_0x4a4bd2['uniqueid']],_[_0x7f92('0x45')](_0x4a4bd2,[_0x7f92('0x46'),'reason']));}};function updateStatus(_0x5a4087){if(_0x5a4087[_0x7f92('0x47')]){faxMessage['update'](_0x5a4087[_0x7f92('0x47')],{'failMessage':_0x7f92('0x48')})[_0x7f92('0x3d')](function(_0x1f10ca){ut[_0x7f92('0x49')]('[Fax][Message][Error][Updated]',_0x1f10ca);})[_0x7f92('0x3f')](function(_0x5bfcf7){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x5bfcf7);});}else{ut[_0x7f92('0x49')](_0x7f92('0x4a'));}}Fax[_0x7f92('0x1f')][_0x7f92('0x4b')]=function(_0x4f3ec7,_0xa1427d,_0x5ed334){var _0x2d9116=this;var _0x5e583a={};if(_0xa1427d){_0x5e583a={'read':_0xa1427d};}else{_0x5e583a={'failMessage':_0x5ed334};}if(this[_0x7f92('0x12')][_0x4f3ec7][_0x7f92('0x47')]){faxMessage[_0x7f92('0x4c')](this[_0x7f92('0x12')][_0x4f3ec7][_0x7f92('0x47')],_0x5e583a)[_0x7f92('0x3d')](function(_0xe050a9){ut[_0x7f92('0x49')](_0x7f92('0x4d'),_0xe050a9);})['catch'](function(_0x5f3c91){ut[_0x7f92('0x49')](_0x7f92('0x4e'),_0x5f3c91);})['finally'](function(){delete _0x2d9116[_0x7f92('0x23')][_0x4f3ec7];delete _0x2d9116[_0x7f92('0x12')][_0x4f3ec7];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this['channels'][_0x4f3ec7];delete this[_0x7f92('0x12')][_0x4f3ec7];}};Fax[_0x7f92('0x1f')][_0x7f92('0x4f')]=function(_0x24ea6e){var _0x165df9=this;if(this['channels'][_0x24ea6e[_0x7f92('0x24')]]){if(this['actions'][_0x24ea6e[_0x7f92('0x24')]]){this[_0x7f92('0x23')][_0x24ea6e[_0x7f92('0x24')]]['id']=this['actions'][_0x24ea6e[_0x7f92('0x24')]]['id'];this[_0x7f92('0x23')][_0x24ea6e['uniqueid']][_0x7f92('0x26')]=this['actions'][_0x24ea6e['uniqueid']][_0x7f92('0x26')];}logger[_0x7f92('0x27')](_0x24ea6e['uniqueid'],this[_0x7f92('0x12')][_0x24ea6e[_0x7f92('0x24')]]?_0x7f92('0x50'):_0x7f92('0x51'),JSON['stringify'](this[_0x7f92('0x23')][_0x24ea6e['uniqueid']]));if(this[_0x7f92('0x12')][_0x24ea6e['uniqueid']]){if(this['channels'][_0x24ea6e[_0x7f92('0x24')]][_0x7f92('0x52')]>0x0&&this[_0x7f92('0x23')][_0x24ea6e[_0x7f92('0x24')]][_0x7f92('0x53')]==='SUCCESS'){this['updateStatus'](_0x24ea6e[_0x7f92('0x24')],!![]);}else{this[_0x7f92('0x4b')](_0x24ea6e[_0x7f92('0x24')],![],this[_0x7f92('0x23')][_0x24ea6e[_0x7f92('0x24')]][_0x7f92('0x54')]?_0x7f92('0x55')+this[_0x7f92('0x23')][_0x24ea6e[_0x7f92('0x24')]][_0x7f92('0x54')]:_0x7f92('0x56'));}}}};Fax['prototype'][_0x7f92('0x57')]=function(_0x2a5e51){var _0x4cbd46=this;return new BPromise(function(_0x2685b7,_0x1e5a9a){_0x4cbd46['execOriginate'](_0x2a5e51,_0x4cbd46['faxAccounts'][_0x2a5e51[_0x7f92('0x58')]])['then'](function(_0xde087e){ut['logger'](_0x7f92('0x59'),_0xde087e);_0x2685b7(ut['message'](_0x7f92('0x5a')));})['catch'](function(_0x4e1cb1){ut[_0x7f92('0x49')]('[Fax][execOriginate][failure]',_0x4e1cb1);updateStatus(_0x2a5e51);_0x1e5a9a(ut['message'](_0x7f92('0x5b')));});});};Fax[_0x7f92('0x1f')][_0x7f92('0x5c')]=function(_0x27c9d9){var _0x1fd8f0=this;return new BPromise(function(_0x3eb5fe,_0x2f9699){var _0x5c152a=_0x1fd8f0[_0x7f92('0x5d')](_0x1fd8f0[_0x7f92('0x10')][_0x27c9d9[_0x7f92('0x58')]][_0x7f92('0x5e')],_0x27c9d9);if(_0x5c152a['isValid']){_0x3eb5fe(ut[_0x7f92('0x39')](_0x7f92('0x5f')));}else{_0x2f9699(ut[_0x7f92('0x39')](_0x5c152a[_0x7f92('0x39')]));}});};function originate(_0x2469af,_0x5b1fc2,_0x1e5b16){return new BPromise(function(_0x3b3d9f,_0x257c58){if(_0x1e5b16){var _0x1a35b0=util[_0x7f92('0x60')](_0x7f92('0x61'),path['parse'](_0x2469af[_0x7f92('0x5')])[_0x7f92('0x26')],_0x2469af[_0x7f92('0x5')]);gs[_0x7f92('0x62')](_0x1a35b0)[_0x7f92('0x3d')](function(){_0x2469af[_0x7f92('0x5')]=util['format'](_0x7f92('0x63'),path[_0x7f92('0x3b')](_0x2469af[_0x7f92('0x5')])['dir'],path[_0x7f92('0x3b')](_0x2469af['path'])[_0x7f92('0x26')]);_0x5b1fc2[_0x7f92('0x64')]=_0x2469af['path'];ut[_0x7f92('0x49')](_0x7f92('0x65'),'');ami[_0x7f92('0x66')](ut[_0x7f92('0x67')](_0x2469af,_0x5b1fc2))[_0x7f92('0x3d')](function(_0x175faf){_0x3b3d9f(_0x175faf);})[_0x7f92('0x3f')](function(_0x579152){_0x257c58(_0x579152);});})['catch'](function(_0x13d934){_0x257c58(_0x13d934);});}else{ami[_0x7f92('0x66')](ut[_0x7f92('0x67')](_0x2469af,_0x5b1fc2))[_0x7f92('0x3d')](function(_0x7bd52e){_0x3b3d9f(_0x7bd52e);})['catch'](function(_0x370eb1){_0x257c58(_0x370eb1);});}});}Fax['prototype'][_0x7f92('0x68')]=function(_0xf1cf9d,_0x41217e){var _0x48ed9a=this;return new BPromise(function(_0x3f735c,_0x51ca2b){var _0x1221f=uuid['v4']();var _0x4628ae=ut[_0x7f92('0x69')](_0xf1cf9d,_0x41217e);_0x48ed9a[_0x7f92('0x12')][_0x1221f]=new Action(_0x1221f,_0x41217e,_0xf1cf9d);var _0x23d4fc=_0x48ed9a[_0x7f92('0x12')][_0x1221f];if(path[_0x7f92('0x3b')](_0xf1cf9d[_0x7f92('0x5')])[_0x7f92('0x6a')]===_0x7f92('0x6b')){originate(_0x23d4fc,_0x4628ae,!![])['then'](function(_0x1ca3c3){_0x3f735c(_0x1ca3c3);})[_0x7f92('0x3f')](function(_0x2a8db1){_0x51ca2b(_0x2a8db1);});}else{originate(_0x23d4fc,_0x4628ae,![])[_0x7f92('0x3d')](function(_0x12e12c){_0x3f735c(_0x12e12c);})['catch'](function(_0x248b14){_0x51ca2b(_0x248b14);});}});};Fax[_0x7f92('0x1f')][_0x7f92('0x6c')]=function(_0x23fb7b){return!_[_0x7f92('0x6d')](_0x23fb7b)&&!_['isNil'](_0x23fb7b['name'])&&!_[_0x7f92('0x6d')](_0x23fb7b['active'])&&_0x23fb7b['active']&&!_[_0x7f92('0x6d')](this[_0x7f92('0x11')][util[_0x7f92('0x60')](_0x7f92('0x6e'),_0x23fb7b[_0x7f92('0x26')])])&&!_['isNil'](this[_0x7f92('0x11')][util[_0x7f92('0x60')](_0x7f92('0x6e'),_0x23fb7b[_0x7f92('0x26')])][_0x7f92('0x30')])&&(this[_0x7f92('0x11')][util[_0x7f92('0x60')](_0x7f92('0x6e'),_0x23fb7b['name'])][_0x7f92('0x30')]===_0x7f92('0x6f')||this[_0x7f92('0x11')][util[_0x7f92('0x60')](_0x7f92('0x6e'),_0x23fb7b[_0x7f92('0x26')])][_0x7f92('0x30')]==='unmonitored');};Fax[_0x7f92('0x1f')][_0x7f92('0x5d')]=function(_0x4ce8c0,_0xf5c075){if(!this[_0x7f92('0x6c')](_0x4ce8c0)){ut[_0x7f92('0x49')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x7f92('0x6d')](_0x4ce8c0)?'':_0x4ce8c0[_0x7f92('0x26')]+_0x7f92('0x70'));return{'isValid':![],'message':_0x7f92('0x71')};}if(_[_0x7f92('0x6d')](_0xf5c075[_0x7f92('0x8')])){ut[_0x7f92('0x49')](_0x7f92('0x72'),JSON['stringify'](_0xf5c075));return{'isValid':![],'message':_0x7f92('0x73')};}if(_['isNil'](_0xf5c075[_0x7f92('0x5')])){ut[_0x7f92('0x49')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x7f92('0x42')](_0xf5c075));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x7f92('0x74')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 71fc590..ebd354b 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 _0x3a45=['then','catch','[Notify]\x20','util','bluebird','../../../config/logger','lodash','../rpc/faxAccount','error','inspect','notify','resolve'];(function(_0x3457b4,_0x4cd8f9){var _0xaa8fa9=function(_0x51897a){while(--_0x51897a){_0x3457b4['push'](_0x3457b4['shift']());}};_0xaa8fa9(++_0x4cd8f9);}(_0x3a45,0xe7));var _0x53a4=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x3a45[_0x49b207];return _0x2dc8fa;};'use strict';var util=require(_0x53a4('0x0'));var BPromise=require(_0x53a4('0x1'));var logger=require(_0x53a4('0x2'))('preview');var _=require(_0x53a4('0x3'));var faxAccount=require(_0x53a4('0x4'));function loggerCatch(_0x4df5f7){return function(_0x5b298f){logger[_0x53a4('0x5')](_0x4df5f7,util[_0x53a4('0x6')](_0x5b298f,{'showHidden':![],'depth':null}));};}exports[_0x53a4('0x7')]=function(_0x23a8cb,_0x4ac03d){return BPromise[_0x53a4('0x8')]()[_0x53a4('0x9')](faxAccount[_0x53a4('0x7')](_0x23a8cb,_0x4ac03d))[_0x53a4('0xa')](loggerCatch(_0x53a4('0xb')));}; \ No newline at end of file +var _0x32b9=['[Notify]\x20','../../../config/logger','preview','error','notify','then'];(function(_0x299205,_0x51aefe){var _0x38cf75=function(_0x2644ed){while(--_0x2644ed){_0x299205['push'](_0x299205['shift']());}};_0x38cf75(++_0x51aefe);}(_0x32b9,0xd9));var _0x932b=function(_0x550ff3,_0x501b4b){_0x550ff3=_0x550ff3-0x0;var _0x6bd04b=_0x32b9[_0x550ff3];return _0x6bd04b;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x932b('0x0'))(_0x932b('0x1'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x26e50e){return function(_0x2f344e){logger[_0x932b('0x2')](_0x26e50e,util['inspect'](_0x2f344e,{'showHidden':![],'depth':null}));};}exports[_0x932b('0x3')]=function(_0x25efff,_0x22e0f1){return BPromise['resolve']()[_0x932b('0x4')](faxAccount[_0x932b('0x3')](_0x25efff,_0x22e0f1))['catch'](loggerCatch(_0x932b('0x5')));}; \ 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 a2df364..b4bcba7 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 _0xf0df=['exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x229a9d,_0x4d3229){var _0x5bd600=function(_0x5f5af9){while(--_0x5f5af9){_0x229a9d['push'](_0x229a9d['shift']());}};_0x5bd600(++_0x4d3229);}(_0xf0df,0xf6));var _0xff0d=function(_0x319132,_0x16a669){_0x319132=_0x319132-0x0;var _0x31500b=_0xf0df[_0x319132];return _0x31500b;};'use strict';var util=require(_0xff0d('0x0'));var logger=require(_0xff0d('0x1'))(_0xff0d('0x2'));var BPromise=require(_0xff0d('0x3'));var exec=require('child_process')[_0xff0d('0x4')];exports[_0xff0d('0x5')]=function(_0x441c6f){return new BPromise(function(_0x298594,_0x9d7ffe){exec(_0x441c6f,function(_0x93055c,_0x5585c9,_0x13d656){logger[_0xff0d('0x6')](_0xff0d('0x7'),_0x5585c9);if(_0x93055c){logger[_0xff0d('0x6')](_0xff0d('0x7'),_0xff0d('0x8'),util[_0xff0d('0x9')](_0x93055c,{'showHidden':![],'depth':null}),_0x5585c9,_0x13d656);_0x9d7ffe(_0x93055c);}_0x298594(_0x5585c9);});});}; \ No newline at end of file +var _0x3875=['util','../../../../config/logger','fax','bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x1f62a2,_0x5d4af9){var _0x493672=function(_0x5a0441){while(--_0x5a0441){_0x1f62a2['push'](_0x1f62a2['shift']());}};_0x493672(++_0x5d4af9);}(_0x3875,0x1ae));var _0x5387=function(_0x41188f,_0x43488c){_0x41188f=_0x41188f-0x0;var _0x356950=_0x3875[_0x41188f];return _0x356950;};'use strict';var util=require(_0x5387('0x0'));var logger=require(_0x5387('0x1'))(_0x5387('0x2'));var BPromise=require(_0x5387('0x3'));var exec=require(_0x5387('0x4'))['exec'];exports[_0x5387('0x5')]=function(_0x39b0f5){return new BPromise(function(_0x536f1a,_0x1310ab){exec(_0x39b0f5,function(_0x159624,_0x3cf0ed,_0x5e5f28){logger[_0x5387('0x6')](_0x5387('0x7'),_0x3cf0ed);if(_0x159624){logger[_0x5387('0x6')](_0x5387('0x7'),_0x5387('0x8'),util[_0x5387('0x9')](_0x159624,{'showHidden':![],'depth':null}),_0x3cf0ed,_0x5e5f28);_0x1310ab(_0x159624);}_0x536f1a(_0x3cf0ed);});});}; \ 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 3c56948..0435761 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 _0x9bcd=['maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','headerinfo','localstationid','util','lodash','fax','logger','inspect','addVariables','ecm','minrate'];(function(_0x571240,_0x572d08){var _0x212c45=function(_0x2dd349){while(--_0x2dd349){_0x571240['push'](_0x571240['shift']());}};_0x212c45(++_0x572d08);}(_0x9bcd,0x100));var _0xd9bc=function(_0x2aa73a,_0x2efe44){_0x2aa73a=_0x2aa73a-0x0;var _0xeb23f6=_0x9bcd[_0x2aa73a];return _0xeb23f6;};'use strict';var util=require(_0xd9bc('0x0'));var _=require(_0xd9bc('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0xd9bc('0x2'));exports['message']=function(_0x33612c){return{'message':_0x33612c};};exports[_0xd9bc('0x3')]=function(_0x45a856,_0x29fdac){logger['info'](_0x45a856,util[_0xd9bc('0x4')](_0x29fdac,{'showHidden':![],'depth':null}));};exports[_0xd9bc('0x5')]=function(_0x2f2cf1,_0x4e4bf2){var _0x2d0fc8={'XMF-ECM':_0x4e4bf2[_0xd9bc('0x6')],'XMF-HEADERINFO':_0x4e4bf2['headerinfo'],'XMF-MINRATE':_0x4e4bf2[_0xd9bc('0x7')],'XMF-MAXRATE':_0x4e4bf2[_0xd9bc('0x8')],'XMF-MODEM':util[_0xd9bc('0x9')](_0xd9bc('0xa'),_0x4e4bf2[_0xd9bc('0xb')]),'XMF-GATEWAY':_0x4e4bf2[_0xd9bc('0xc')],'XMF-FAXDETECT':_0x4e4bf2[_0xd9bc('0xd')],'XMF-T38TIMEOUT':_0x4e4bf2[_0xd9bc('0xe')],'XMF-LOCALSTATIONID':_0x4e4bf2['localstationid'],'XMF-PATH':_0x2f2cf1[_0xd9bc('0xf')]};return _0x2d0fc8;};exports[_0xd9bc('0x10')]=function(_0x469225,_0x10d0ce){return{'actionid':_0x469225[_0xd9bc('0x11')],'action':_0xd9bc('0x12'),'channel':_0x469225[_0xd9bc('0x13')],'Exten':_0xd9bc('0x14'),'Context':'from-sip','Priority':'1','callerid':util[_0xd9bc('0x9')](_0xd9bc('0x15'),_0x469225['headerinfo']?_0x469225[_0xd9bc('0x16')]:'',_0x469225[_0xd9bc('0x17')]),'variable':_0x10d0ce,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x469225[_0xd9bc('0x11')]};}; \ No newline at end of file +var _0x4b15=['headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','t38timeout','localstationid','variablesAction','uniqueid','originate','channel','xcally-motion-fax','util','lodash','moment','fax','message','logger','info','inspect','addVariables','ecm'];(function(_0xd9c878,_0x5bf239){var _0x24790d=function(_0xa8379c){while(--_0xa8379c){_0xd9c878['push'](_0xd9c878['shift']());}};_0x24790d(++_0x5bf239);}(_0x4b15,0x1a6));var _0x54b1=function(_0x55ac9a,_0x1c8177){_0x55ac9a=_0x55ac9a-0x0;var _0x24086d=_0x4b15[_0x55ac9a];return _0x24086d;};'use strict';var util=require(_0x54b1('0x0'));var _=require(_0x54b1('0x1'));var moment=require(_0x54b1('0x2'));var logger=require('../../../../config/logger')(_0x54b1('0x3'));exports[_0x54b1('0x4')]=function(_0xb56596){return{'message':_0xb56596};};exports[_0x54b1('0x5')]=function(_0x3880ed,_0x260c7c){logger[_0x54b1('0x6')](_0x3880ed,util[_0x54b1('0x7')](_0x260c7c,{'showHidden':![],'depth':null}));};exports[_0x54b1('0x8')]=function(_0xa07d84,_0x1c8aa1){var _0x46c015={'XMF-ECM':_0x1c8aa1[_0x54b1('0x9')],'XMF-HEADERINFO':_0x1c8aa1[_0x54b1('0xa')],'XMF-MINRATE':_0x1c8aa1[_0x54b1('0xb')],'XMF-MAXRATE':_0x1c8aa1[_0x54b1('0xc')],'XMF-MODEM':util[_0x54b1('0xd')](_0x54b1('0xe'),_0x1c8aa1[_0x54b1('0xf')]),'XMF-GATEWAY':_0x1c8aa1[_0x54b1('0x10')],'XMF-FAXDETECT':_0x1c8aa1['faxdetect'],'XMF-T38TIMEOUT':_0x1c8aa1[_0x54b1('0x11')],'XMF-LOCALSTATIONID':_0x1c8aa1[_0x54b1('0x12')],'XMF-PATH':_0xa07d84['path']};return _0x46c015;};exports[_0x54b1('0x13')]=function(_0x55f63c,_0x409c6b){return{'actionid':_0x55f63c[_0x54b1('0x14')],'action':_0x54b1('0x15'),'channel':_0x55f63c[_0x54b1('0x16')],'Exten':_0x54b1('0x17'),'Context':'from-sip','Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x55f63c['headerinfo']?_0x55f63c[_0x54b1('0xa')]:'',_0x55f63c['localstationid']),'variable':_0x409c6b,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x55f63c[_0x54b1('0x14')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 603ee8a..bdf9e81 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 _0x2ff1=['getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initSalesforceAccounts','getFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','error','[index.js][main]','util','./realtime','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/trunk','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','getAgents','then','getVoiceQueues','initVoiceQueues'];(function(_0x21a9fc,_0xda2726){var _0x26496c=function(_0x223213){while(--_0x223213){_0x21a9fc['push'](_0x21a9fc['shift']());}};_0x26496c(++_0xda2726);}(_0x2ff1,0xd9));var _0x12ff=function(_0xe7d1fd,_0x460a1e){_0xe7d1fd=_0xe7d1fd-0x0;var _0x24b18b=_0x2ff1[_0xe7d1fd];return _0x24b18b;};'use strict';var BPromise=require('bluebird');var util=require(_0x12ff('0x0'));var moment=require('moment');var server=require('./server');var Realtime=require(_0x12ff('0x1'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x12ff('0x2'));var Dialer=require(_0x12ff('0x3'));var Preview=require('./preview');var Fax=require(_0x12ff('0x4'));var user=require(_0x12ff('0x5'));var voiceQueue=require(_0x12ff('0x6'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x12ff('0x7'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0x12ff('0x8'));var campaign=require(_0x12ff('0x9'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x12ff('0xa'));var zendesk=require(_0x12ff('0xb'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x12ff('0xc'));var zoho=require(_0x12ff('0xd'));var vtiger=require(_0x12ff('0xe'));var freshsales=require(_0x12ff('0xf'));var servicenow=require(_0x12ff('0x10'));var dynamics365=require(_0x12ff('0x11'));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(_0x12ff('0x12'))(_0x12ff('0x13'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x12ff('0x14')](_0x12ff('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x12ff('0x14')](_0x12ff('0x15'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x12ff('0x16')]()['then'](user[_0x12ff('0x17')]())[_0x12ff('0x18')](realtime['initAgents']())[_0x12ff('0x18')](user['getTelephones']())[_0x12ff('0x18')](realtime['initTelephones']())[_0x12ff('0x18')](trunk['getTrunks']())[_0x12ff('0x18')](realtime['initTrunks']())['then'](voiceQueue[_0x12ff('0x19')]())[_0x12ff('0x18')](realtime[_0x12ff('0x1a')]())[_0x12ff('0x18')](trigger[_0x12ff('0x1b')]())['then'](realtime[_0x12ff('0x1c')]())[_0x12ff('0x18')](template[_0x12ff('0x1d')]())[_0x12ff('0x18')](realtime[_0x12ff('0x1e')]())[_0x12ff('0x18')](zendesk[_0x12ff('0x1f')]())['then'](realtime['initZendeskAccounts']())[_0x12ff('0x18')](salesforce['getSalesforceAccounts']())[_0x12ff('0x18')](realtime[_0x12ff('0x20')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0x12ff('0x18')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x12ff('0x21')]())[_0x12ff('0x18')](realtime['initFreshdeskAccounts']())[_0x12ff('0x18')](desk[_0x12ff('0x22')]())[_0x12ff('0x18')](realtime['initDeskAccounts']())[_0x12ff('0x18')](zoho[_0x12ff('0x23')]())[_0x12ff('0x18')](realtime[_0x12ff('0x24')]())[_0x12ff('0x18')](vtiger[_0x12ff('0x25')]())[_0x12ff('0x18')](realtime[_0x12ff('0x26')]())[_0x12ff('0x18')](freshsales['getFreshsalesAccounts']())[_0x12ff('0x18')](realtime[_0x12ff('0x27')]())[_0x12ff('0x18')](servicenow[_0x12ff('0x28')]())['then'](realtime[_0x12ff('0x29')]())[_0x12ff('0x18')](dynamics365[_0x12ff('0x2a')]())['then'](realtime[_0x12ff('0x2b')]())[_0x12ff('0x18')](campaign[_0x12ff('0x2c')]())[_0x12ff('0x18')](realtime['initCampaigns']())[_0x12ff('0x18')](voiceExtension[_0x12ff('0x2d')]())[_0x12ff('0x18')](realtime[_0x12ff('0x2e')]())[_0x12ff('0x18')](faxAccount['getFaxAccounts']())[_0x12ff('0x18')](realtime['initFaxAccounts']())[_0x12ff('0x18')](function(){return realtime;});}function initParams(){return BPromise[_0x12ff('0x16')]()[_0x12ff('0x18')](voiceQueueReport[_0x12ff('0x2f')]())['then'](realtime[_0x12ff('0x30')]())[_0x12ff('0x18')](cmHopperHistory[_0x12ff('0x31')]())['then'](realtime[_0x12ff('0x32')]())[_0x12ff('0x18')](cmHopperHistory['getCampaignHopperHistory']())[_0x12ff('0x18')](realtime[_0x12ff('0x33')]())[_0x12ff('0x18')](voiceCallReport[_0x12ff('0x34')]())['then'](realtime[_0x12ff('0x35')]())[_0x12ff('0x36')](function(_0x48517b){logger['error'](_0x12ff('0x37'),util[_0x12ff('0x38')](_0x48517b,{'showHidden':![],'depth':null}));});}function main(){return server[_0x12ff('0x39')](realtime,preview,fax)[_0x12ff('0x18')](function(_0x3aebf8){return initRealtime();})['then'](function(){return initParams();})[_0x12ff('0x18')](function(){report[_0x12ff('0x3a')]();setInterval(initRealtime,0x1388);})[_0x12ff('0x36')](function(_0x2b76ba){logger[_0x12ff('0x3b')](_0x12ff('0x3c'),util[_0x12ff('0x38')](_0x2b76ba,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x5830=['./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','then','getAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','inspect','listen','sync','error','[index.js][main]','util','moment','./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce'];(function(_0x246e5c,_0x5ecf78){var _0x7f2a1f=function(_0x1eee63){while(--_0x1eee63){_0x246e5c['push'](_0x246e5c['shift']());}};_0x7f2a1f(++_0x5ecf78);}(_0x5830,0x84));var _0x0583=function(_0x3a2103,_0x11ccff){_0x3a2103=_0x3a2103-0x0;var _0x329eb7=_0x5830[_0x3a2103];return _0x329eb7;};'use strict';var BPromise=require('bluebird');var util=require(_0x0583('0x0'));var moment=require(_0x0583('0x1'));var server=require(_0x0583('0x2'));var Realtime=require(_0x0583('0x3'));var Report=require(_0x0583('0x4'));var Acw=require(_0x0583('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x0583('0x6'));var Preview=require(_0x0583('0x7'));var Fax=require(_0x0583('0x8'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x0583('0x9'));var voiceCallReport=require(_0x0583('0xa'));var trunk=require(_0x0583('0xb'));var trigger=require('./rpc/trigger');var template=require(_0x0583('0xc'));var cmHopperHistory=require(_0x0583('0xd'));var campaign=require(_0x0583('0xe'));var voiceExtension=require(_0x0583('0xf'));var faxAccount=require(_0x0583('0x10'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x0583('0x11'));var sugarcrm=require(_0x0583('0x12'));var freshdesk=require(_0x0583('0x13'));var desk=require(_0x0583('0x14'));var zoho=require(_0x0583('0x15'));var vtiger=require(_0x0583('0x16'));var freshsales=require(_0x0583('0x17'));var servicenow=require(_0x0583('0x18'));var dynamics365=require(_0x0583('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x0583('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x0583('0x1b')](_0x0583('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0583('0x1b')](_0x0583('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x0583('0x1d')](user[_0x0583('0x1e')]())[_0x0583('0x1d')](realtime['initAgents']())[_0x0583('0x1d')](user[_0x0583('0x1f')]())[_0x0583('0x1d')](realtime[_0x0583('0x20')]())[_0x0583('0x1d')](trunk['getTrunks']())[_0x0583('0x1d')](realtime[_0x0583('0x21')]())[_0x0583('0x1d')](voiceQueue[_0x0583('0x22')]())[_0x0583('0x1d')](realtime[_0x0583('0x23')]())['then'](trigger[_0x0583('0x24')]())[_0x0583('0x1d')](realtime[_0x0583('0x25')]())['then'](template[_0x0583('0x26')]())[_0x0583('0x1d')](realtime[_0x0583('0x27')]())['then'](zendesk[_0x0583('0x28')]())[_0x0583('0x1d')](realtime['initZendeskAccounts']())[_0x0583('0x1d')](salesforce[_0x0583('0x29')]())[_0x0583('0x1d')](realtime[_0x0583('0x2a')]())['then'](sugarcrm[_0x0583('0x2b')]())[_0x0583('0x1d')](realtime[_0x0583('0x2c')]())[_0x0583('0x1d')](freshdesk[_0x0583('0x2d')]())['then'](realtime[_0x0583('0x2e')]())['then'](desk[_0x0583('0x2f')]())[_0x0583('0x1d')](realtime[_0x0583('0x30')]())[_0x0583('0x1d')](zoho[_0x0583('0x31')]())['then'](realtime['initZohoAccounts']())[_0x0583('0x1d')](vtiger[_0x0583('0x32')]())['then'](realtime[_0x0583('0x33')]())[_0x0583('0x1d')](freshsales[_0x0583('0x34')]())[_0x0583('0x1d')](realtime[_0x0583('0x35')]())[_0x0583('0x1d')](servicenow['getServicenowAccounts']())[_0x0583('0x1d')](realtime[_0x0583('0x36')]())['then'](dynamics365[_0x0583('0x37')]())['then'](realtime[_0x0583('0x38')]())[_0x0583('0x1d')](campaign[_0x0583('0x39')]())[_0x0583('0x1d')](realtime[_0x0583('0x3a')]())[_0x0583('0x1d')](voiceExtension[_0x0583('0x3b')]())['then'](realtime[_0x0583('0x3c')]())[_0x0583('0x1d')](faxAccount[_0x0583('0x3d')]())[_0x0583('0x1d')](realtime[_0x0583('0x3e')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x0583('0x3f')]()[_0x0583('0x1d')](voiceQueueReport[_0x0583('0x40')]())[_0x0583('0x1d')](realtime[_0x0583('0x41')]())[_0x0583('0x1d')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0x0583('0x42')]())[_0x0583('0x1d')](cmHopperHistory[_0x0583('0x43')]())[_0x0583('0x1d')](realtime['initCampaignHopperHistory']())[_0x0583('0x1d')](voiceCallReport[_0x0583('0x44')]())[_0x0583('0x1d')](realtime[_0x0583('0x45')]())['catch'](function(_0x2b219f){logger['error']('[index.js][initParams]',util[_0x0583('0x46')](_0x2b219f,{'showHidden':![],'depth':null}));});}function main(){return server[_0x0583('0x47')](realtime,preview,fax)['then'](function(_0x5b2c11){return initRealtime();})[_0x0583('0x1d')](function(){return initParams();})['then'](function(){report[_0x0583('0x48')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x3db164){logger[_0x0583('0x49')](_0x0583('0x4a'),util['inspect'](_0x3db164,{'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 0343676..eb4e806 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 _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file +var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x12e039,_0x16d189){var _0x5b9d1b=function(_0x540e18){while(--_0x540e18){_0x12e039['push'](_0x12e039['shift']());}};_0x5b9d1b(++_0x16d189);}(_0x70e0,0x17b));var _0x070e=function(_0x2d9c1b,_0x532cea){_0x2d9c1b=_0x2d9c1b-0x0;var _0x58f79f=_0x70e0[_0x2d9c1b];return _0x58f79f;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index d509015..ee8d09e 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 _0xc6c5=['ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp'];(function(_0x5a3364,_0x1a50a6){var _0x1bf09a=function(_0x4ff4e7){while(--_0x4ff4e7){_0x5a3364['push'](_0x5a3364['shift']());}};_0x1bf09a(++_0x1a50a6);}(_0xc6c5,0x14c));var _0x5c6c=function(_0x494525,_0x42e87a){_0x494525=_0x494525-0x0;var _0x2d1610=_0xc6c5[_0x494525];return _0x2d1610;};'use strict';function Campaign(_0x410b8e){this['id']=_0x410b8e['id']||0x0;this[_0x5c6c('0x0')]=_0x410b8e[_0x5c6c('0x0')]||'';this['type']=_0x410b8e[_0x5c6c('0x1')]||_0x5c6c('0x2');this['originated']=0x0;this[_0x5c6c('0x3')]=0x0;this[_0x5c6c('0x4')]=0x0;this[_0x5c6c('0x5')]=0x0;this['message']='';this[_0x5c6c('0x6')]=!![];this[_0x5c6c('0x7')]=_0x410b8e[_0x5c6c('0x7')];this[_0x5c6c('0x8')]=_0x410b8e[_0x5c6c('0x8')];this[_0x5c6c('0x9')]=_0x410b8e['dialTimezone']||null;this[_0x5c6c('0xa')]=_0x410b8e[_0x5c6c('0xa')]?_0x410b8e['dialGlobalInterval']:null;this[_0x5c6c('0xb')]=_0x410b8e['dialOriginateCallerIdName'];this[_0x5c6c('0xc')]=_0x410b8e[_0x5c6c('0xc')];this[_0x5c6c('0xd')]=_0x410b8e[_0x5c6c('0xd')]||0x1e;this[_0x5c6c('0xe')]=_0x410b8e[_0x5c6c('0xe')];this[_0x5c6c('0xf')]=_0x410b8e['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x410b8e['dialBusyMaxRetry'];this[_0x5c6c('0x10')]=_0x410b8e[_0x5c6c('0x10')];this[_0x5c6c('0x11')]=_0x410b8e[_0x5c6c('0x11')];this[_0x5c6c('0x12')]=_0x410b8e['dialNoAnswerRetryFrequency'];this[_0x5c6c('0x13')]=_0x410b8e[_0x5c6c('0x13')];this['dialNoSuchNumberMaxRetry']=_0x410b8e[_0x5c6c('0x14')]||0x3;this[_0x5c6c('0x15')]=_0x410b8e[_0x5c6c('0x15')]||0x96;this[_0x5c6c('0x16')]=_0x410b8e['dialDropMaxRetry']||0x3;this[_0x5c6c('0x17')]=_0x410b8e[_0x5c6c('0x17')]||0x96;this[_0x5c6c('0x18')]=_0x410b8e['dialAbandonedMaxRetry']||0x3;this[_0x5c6c('0x19')]=_0x410b8e[_0x5c6c('0x19')]||0x96;this[_0x5c6c('0x1a')]=_0x410b8e['dialMachineMaxRetry']||0x3;this[_0x5c6c('0x1b')]=_0x410b8e[_0x5c6c('0x1b')]||0x96;this[_0x5c6c('0x1c')]=_0x410b8e[_0x5c6c('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x410b8e['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x410b8e[_0x5c6c('0x1d')]||'DESC';this[_0x5c6c('0x1e')]=_0x410b8e[_0x5c6c('0x1e')]||undefined;this[_0x5c6c('0x1f')]=_0x410b8e['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x5c6c('0x20')]=_0x410b8e[_0x5c6c('0x20')]||undefined;this['TrunkBackup']=_0x410b8e[_0x5c6c('0x21')]?_0x410b8e[_0x5c6c('0x21')]:undefined;this[_0x5c6c('0x22')]=_0x410b8e[_0x5c6c('0x22')]?_0x410b8e['Trunk']:undefined;this[_0x5c6c('0x23')]=_0x410b8e[_0x5c6c('0x23')]?_0x410b8e[_0x5c6c('0x23')]:undefined;this[_0x5c6c('0x24')]=_0x410b8e[_0x5c6c('0x24')]?_0x410b8e[_0x5c6c('0x24')]:undefined;this[_0x5c6c('0x25')]=_0x410b8e[_0x5c6c('0x24')]?_0x410b8e[_0x5c6c('0x24')][_0x5c6c('0x0')]:undefined;this['dialAMDActive']=_0x410b8e[_0x5c6c('0x26')]||![];this['dialAMDInitialSilence']=_0x410b8e[_0x5c6c('0x27')];this['dialAMDGreeting']=_0x410b8e[_0x5c6c('0x28')];this[_0x5c6c('0x29')]=_0x410b8e[_0x5c6c('0x29')];this[_0x5c6c('0x2a')]=_0x410b8e[_0x5c6c('0x2a')];this['dialAMDMinWordLength']=_0x410b8e['dialAMDMinWordLength'];this[_0x5c6c('0x2b')]=_0x410b8e[_0x5c6c('0x2b')];this[_0x5c6c('0x2c')]=_0x410b8e[_0x5c6c('0x2c')];this[_0x5c6c('0x2d')]=_0x410b8e[_0x5c6c('0x2d')];this['dialAMDMaximumWordLength']=_0x410b8e[_0x5c6c('0x2e')];}module[_0x5c6c('0x2f')]=Campaign; \ No newline at end of file +var _0xeda3=['dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence'];(function(_0x38d56c,_0x1b594a){var _0x2140b2=function(_0x2c6fd0){while(--_0x2c6fd0){_0x38d56c['push'](_0x38d56c['shift']());}};_0x2140b2(++_0x1b594a);}(_0xeda3,0x96));var _0x3eda=function(_0x1b409c,_0x18a4e8){_0x1b409c=_0x1b409c-0x0;var _0x4f32c8=_0xeda3[_0x1b409c];return _0x4f32c8;};'use strict';function Campaign(_0x1f065c){this['id']=_0x1f065c['id']||0x0;this[_0x3eda('0x0')]=_0x1f065c[_0x3eda('0x0')]||'';this[_0x3eda('0x1')]=_0x1f065c[_0x3eda('0x1')]||_0x3eda('0x2');this['originated']=0x0;this[_0x3eda('0x3')]=0x0;this[_0x3eda('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0x3eda('0x5')]=!![];this[_0x3eda('0x6')]=_0x1f065c[_0x3eda('0x6')];this[_0x3eda('0x7')]=_0x1f065c['limitCalls'];this['dialTimezone']=_0x1f065c['dialTimezone']||null;this[_0x3eda('0x8')]=_0x1f065c[_0x3eda('0x8')]?_0x1f065c['dialGlobalInterval']:null;this[_0x3eda('0x9')]=_0x1f065c[_0x3eda('0x9')];this[_0x3eda('0xa')]=_0x1f065c[_0x3eda('0xa')];this['dialOriginateTimeout']=_0x1f065c['dialOriginateTimeout']||0x1e;this[_0x3eda('0xb')]=_0x1f065c[_0x3eda('0xb')];this[_0x3eda('0xc')]=_0x1f065c['dialCongestionRetryFrequency'];this[_0x3eda('0xd')]=_0x1f065c[_0x3eda('0xd')];this[_0x3eda('0xe')]=_0x1f065c[_0x3eda('0xe')];this[_0x3eda('0xf')]=_0x1f065c[_0x3eda('0xf')];this[_0x3eda('0x10')]=_0x1f065c[_0x3eda('0x10')];this[_0x3eda('0x11')]=_0x1f065c['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x1f065c['dialNoSuchNumberMaxRetry']||0x3;this[_0x3eda('0x12')]=_0x1f065c[_0x3eda('0x12')]||0x96;this['dialDropMaxRetry']=_0x1f065c[_0x3eda('0x13')]||0x3;this[_0x3eda('0x14')]=_0x1f065c[_0x3eda('0x14')]||0x96;this['dialAbandonedMaxRetry']=_0x1f065c['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x1f065c[_0x3eda('0x15')]||0x96;this['dialMachineMaxRetry']=_0x1f065c[_0x3eda('0x16')]||0x3;this[_0x3eda('0x17')]=_0x1f065c[_0x3eda('0x17')]||0x96;this[_0x3eda('0x18')]=_0x1f065c['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x1f065c[_0x3eda('0x19')]||0x96;this[_0x3eda('0x1a')]=_0x1f065c[_0x3eda('0x1a')]||_0x3eda('0x1b');this['dialPrefix']=_0x1f065c[_0x3eda('0x1c')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x1f065c[_0x3eda('0x1d')]||undefined;this[_0x3eda('0x1e')]=_0x1f065c[_0x3eda('0x1e')]||undefined;this[_0x3eda('0x1f')]=_0x1f065c[_0x3eda('0x1f')]?_0x1f065c['TrunkBackup']:undefined;this[_0x3eda('0x20')]=_0x1f065c[_0x3eda('0x20')]?_0x1f065c['Trunk']:undefined;this[_0x3eda('0x21')]=_0x1f065c[_0x3eda('0x21')]?_0x1f065c[_0x3eda('0x21')]:undefined;this[_0x3eda('0x22')]=_0x1f065c[_0x3eda('0x22')]?_0x1f065c[_0x3eda('0x22')]:undefined;this[_0x3eda('0x23')]=_0x1f065c[_0x3eda('0x22')]?_0x1f065c['SquareProject'][_0x3eda('0x0')]:undefined;this[_0x3eda('0x24')]=_0x1f065c[_0x3eda('0x24')]||![];this[_0x3eda('0x25')]=_0x1f065c[_0x3eda('0x25')];this['dialAMDGreeting']=_0x1f065c[_0x3eda('0x26')];this['dialAMDAfterGreetingSilence']=_0x1f065c[_0x3eda('0x27')];this[_0x3eda('0x28')]=_0x1f065c[_0x3eda('0x28')];this[_0x3eda('0x29')]=_0x1f065c[_0x3eda('0x29')];this[_0x3eda('0x2a')]=_0x1f065c[_0x3eda('0x2a')];this[_0x3eda('0x2b')]=_0x1f065c['dialAMDMaximumNumberOfWords'];this[_0x3eda('0x2c')]=_0x1f065c['dialAMDSilenceThreshold'];this[_0x3eda('0x2d')]=_0x1f065c['dialAMDMaximumWordLength'];}module[_0x3eda('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 75648f3..0f1d5e6 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 _0x2deb=['transferconnectedlinenum','transferType','exports','starttime','channel','destinationchannel','calleridnum','connectedlinename','accountcode','context','uniqueid','answered','answertime','endtime','abandoned','lastapplication','duration','billableseconds','holdtime','tag','disposition','monitor','monitorFilename','transfercalleridnum'];(function(_0x45edaa,_0x5be33a){var _0x3592f7=function(_0xfdaf26){while(--_0xfdaf26){_0x45edaa['push'](_0x45edaa['shift']());}};_0x3592f7(++_0x5be33a);}(_0x2deb,0xdb));var _0xb2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2deb[_0x3dd15e];return _0x231fd0;};'use strict';function Channel(){this[_0xb2de('0x0')]=null;this[_0xb2de('0x1')]='';this[_0xb2de('0x2')]='';this[_0xb2de('0x3')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0xb2de('0x4')]=undefined;this[_0xb2de('0x5')]=0x0;this[_0xb2de('0x6')]='';this[_0xb2de('0x7')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0xb2de('0x8')]=![];this[_0xb2de('0x9')]=null;this[_0xb2de('0xa')]=null;this['unmanaged']=![];this[_0xb2de('0xb')]=![];this[_0xb2de('0xc')]='';this['lastdata']='';this[_0xb2de('0xd')]=0x0;this[_0xb2de('0xe')]=0x0;this[_0xb2de('0xf')]=0x0;this['type']=null;this[_0xb2de('0x10')]=null;this[_0xb2de('0x11')]=null;this[_0xb2de('0x12')]=![];this[_0xb2de('0x13')]=null;this['queue']=null;this['monitors']=[];this[_0xb2de('0x14')]=undefined;this[_0xb2de('0x15')]=undefined;this[_0xb2de('0x16')]=undefined;this['mohtime']=0x0;}module[_0xb2de('0x17')]=Channel; \ No newline at end of file +var _0x56c8=['transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answered','answertime','endtime','unmanaged','abandoned','duration','billableseconds','holdtime','monitor','monitorFilename','queue','transfercalleridnum'];(function(_0xb6e43,_0x1568fc){var _0x47c40f=function(_0x107786){while(--_0x107786){_0xb6e43['push'](_0xb6e43['shift']());}};_0x47c40f(++_0x1568fc);}(_0x56c8,0x12f));var _0x856c=function(_0x16b4ce,_0x4e606f){_0x16b4ce=_0x16b4ce-0x0;var _0x5e6319=_0x56c8[_0x16b4ce];return _0x5e6319;};'use strict';function Channel(){this[_0x856c('0x0')]=null;this[_0x856c('0x1')]='';this[_0x856c('0x2')]='';this[_0x856c('0x3')]=0x0;this['calleridname']='';this[_0x856c('0x4')]=undefined;this[_0x856c('0x5')]=undefined;this[_0x856c('0x6')]=0x0;this[_0x856c('0x7')]='';this[_0x856c('0x8')]=0x0;this['linkedid']=0x0;this[_0x856c('0x9')]=0x0;this[_0x856c('0xa')]=![];this[_0x856c('0xb')]=null;this[_0x856c('0xc')]=null;this[_0x856c('0xd')]=![];this[_0x856c('0xe')]=![];this['lastapplication']='';this['lastdata']='';this[_0x856c('0xf')]=0x0;this[_0x856c('0x10')]=0x0;this[_0x856c('0x11')]=0x0;this['type']=null;this['tag']=null;this['disposition']=null;this[_0x856c('0x12')]=![];this[_0x856c('0x13')]=null;this[_0x856c('0x14')]=null;this['monitors']=[];this[_0x856c('0x15')]=undefined;this[_0x856c('0x16')]=undefined;this['transferType']=undefined;this[_0x856c('0x17')]=0x0;}module[_0x856c('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 8d12a20..159435e 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 _0x0287=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x47615c,_0x2536db){var _0x2d797c=function(_0x290b49){while(--_0x290b49){_0x47615c['push'](_0x47615c['shift']());}};_0x2d797c(++_0x2536db);}(_0x0287,0xd2));var _0x7028=function(_0x2f7cc0,_0xa7ddc9){_0x2f7cc0=_0x2f7cc0-0x0;var _0x42ac73=_0x0287[_0x2f7cc0];return _0x42ac73;};'use strict';function DeskAccount(_0x510df5){this['id']=_0x510df5['id']||0x0;this[_0x7028('0x0')]=_0x510df5[_0x7028('0x0')]||'';this[_0x7028('0x1')]=_0x510df5[_0x7028('0x1')]||'';this[_0x7028('0x2')]=_0x510df5[_0x7028('0x2')]||'';this[_0x7028('0x3')]=_0x510df5['authType']||'';this[_0x7028('0x4')]=_0x510df5[_0x7028('0x4')]||'';this[_0x7028('0x5')]=_0x510df5[_0x7028('0x5')]||'';this[_0x7028('0x6')]=_0x510df5[_0x7028('0x6')]||'';this[_0x7028('0x7')]=_0x510df5[_0x7028('0x7')]||'';this['tokenSecret']=_0x510df5[_0x7028('0x8')]||'';this[_0x7028('0x9')]=_0x510df5[_0x7028('0x9')]||'';this[_0x7028('0xa')]=_0x510df5['serverUrl']||'';this[_0x7028('0xb')]=_0x510df5[_0x7028('0xb')]||{};}module[_0x7028('0xc')]=DeskAccount; \ No newline at end of file +var _0x15c1=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','serverUrl','Configurations'];(function(_0x56545b,_0x5d6a60){var _0x55cd80=function(_0x2a7e68){while(--_0x2a7e68){_0x56545b['push'](_0x56545b['shift']());}};_0x55cd80(++_0x5d6a60);}(_0x15c1,0x139));var _0x115c=function(_0x5edb0c,_0x10dd30){_0x5edb0c=_0x5edb0c-0x0;var _0x3ae1d4=_0x15c1[_0x5edb0c];return _0x3ae1d4;};'use strict';function DeskAccount(_0x209745){this['id']=_0x209745['id']||0x0;this[_0x115c('0x0')]=_0x209745[_0x115c('0x0')]||'';this[_0x115c('0x1')]=_0x209745['username']||'';this[_0x115c('0x2')]=_0x209745[_0x115c('0x2')]||'';this[_0x115c('0x3')]=_0x209745['authType']||'';this[_0x115c('0x4')]=_0x209745[_0x115c('0x4')]||'';this[_0x115c('0x5')]=_0x209745[_0x115c('0x5')]||'';this[_0x115c('0x6')]=_0x209745[_0x115c('0x6')]||'';this[_0x115c('0x7')]=_0x209745['token']||'';this[_0x115c('0x8')]=_0x209745[_0x115c('0x8')]||'';this['type']=_0x209745['type']||'';this[_0x115c('0x9')]=_0x209745[_0x115c('0x9')]||'';this[_0x115c('0xa')]=_0x209745[_0x115c('0xa')]||{};}module[_0x115c('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 10ec7d0..07892c2 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 _0x0a9b=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x2e1879,_0x25c62a){var _0x5d2cc3=function(_0x881805){while(--_0x881805){_0x2e1879['push'](_0x2e1879['shift']());}};_0x5d2cc3(++_0x25c62a);}(_0x0a9b,0x1a4));var _0xb0a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a9b[_0x3dd15e];return _0x231fd0;};'use strict';function Dynamics365Account(_0x1188f9){this['id']=_0x1188f9['id']||0x0;this[_0xb0a9('0x0')]=_0x1188f9[_0xb0a9('0x0')]||'';this[_0xb0a9('0x1')]=_0x1188f9[_0xb0a9('0x1')]||'';this['password']=_0x1188f9[_0xb0a9('0x2')]||'';this[_0xb0a9('0x3')]=_0x1188f9['remoteUri']||'';this[_0xb0a9('0x4')]=_0x1188f9[_0xb0a9('0x4')]||'';this[_0xb0a9('0x5')]=_0x1188f9[_0xb0a9('0x5')]||'';this[_0xb0a9('0x6')]=_0x1188f9[_0xb0a9('0x6')]||{};this[_0xb0a9('0x7')]=_0x1188f9[_0xb0a9('0x7')]||'';this[_0xb0a9('0x8')]=_0x1188f9[_0xb0a9('0x8')]||![];this[_0xb0a9('0x9')]=_0x1188f9[_0xb0a9('0x9')]||{};this['CloudProvider']=_0x1188f9[_0xb0a9('0xa')]||{};}module[_0xb0a9('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x5a52=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username'];(function(_0x243dbc,_0x3b5f34){var _0x58aaf9=function(_0x1582dc){while(--_0x1582dc){_0x243dbc['push'](_0x243dbc['shift']());}};_0x58aaf9(++_0x3b5f34);}(_0x5a52,0xb2));var _0x25a5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a52[_0x14add3];return _0x4a174f;};'use strict';function Dynamics365Account(_0x1496cb){this['id']=_0x1496cb['id']||0x0;this[_0x25a5('0x0')]=_0x1496cb[_0x25a5('0x0')]||'';this['username']=_0x1496cb[_0x25a5('0x1')]||'';this[_0x25a5('0x2')]=_0x1496cb['password']||'';this[_0x25a5('0x3')]=_0x1496cb[_0x25a5('0x3')]||'';this[_0x25a5('0x4')]=_0x1496cb['tenantId']||'';this[_0x25a5('0x5')]=_0x1496cb[_0x25a5('0x5')]||'';this[_0x25a5('0x6')]=_0x1496cb[_0x25a5('0x6')]||{};this[_0x25a5('0x7')]=_0x1496cb['serverUrl']||'';this[_0x25a5('0x8')]=_0x1496cb[_0x25a5('0x8')]||![];this['Configurations']=_0x1496cb[_0x25a5('0x9')]||{};this[_0x25a5('0xa')]=_0x1496cb[_0x25a5('0xa')]||{};}module[_0x25a5('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 3288a8e..38ab6cd 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 _0xdc30=['ecm','headerinfo','localstationid','minrate','maxrate','gateway','t38timeout','tech','Trunk','ListId','key','exports','name','description'];(function(_0x10b2c4,_0x4b10ed){var _0xb10a8e=function(_0x58ff68){while(--_0x58ff68){_0x10b2c4['push'](_0x10b2c4['shift']());}};_0xb10a8e(++_0x4b10ed);}(_0xdc30,0x194));var _0x0dc3=function(_0x570496,_0x26a150){_0x570496=_0x570496-0x0;var _0x1d4204=_0xdc30[_0x570496];return _0x1d4204;};'use strict';function FaxAccount(_0x42fe69){this['id']=_0x42fe69['id']||0x0;this[_0x0dc3('0x0')]=_0x42fe69[_0x0dc3('0x0')]||'';this[_0x0dc3('0x1')]=_0x42fe69[_0x0dc3('0x1')];this[_0x0dc3('0x2')]=_0x42fe69[_0x0dc3('0x2')];this[_0x0dc3('0x3')]=_0x42fe69[_0x0dc3('0x3')];this[_0x0dc3('0x4')]=_0x42fe69[_0x0dc3('0x4')];this[_0x0dc3('0x5')]=_0x42fe69[_0x0dc3('0x5')]||0x960;this['maxrate']=_0x42fe69[_0x0dc3('0x6')]||0x3840;this['modem']=_0x42fe69['modem']||'v17,v27,v29';this[_0x0dc3('0x7')]=_0x42fe69[_0x0dc3('0x7')]||'no';this['faxdetect']=_0x42fe69['faxdetect']||'no';this[_0x0dc3('0x8')]=_0x42fe69['t38timeout']||0x1388;this[_0x0dc3('0x9')]=_0x42fe69[_0x0dc3('0x9')]||'SIP';this[_0x0dc3('0xa')]=_0x42fe69[_0x0dc3('0xa')]?_0x42fe69['Trunk']:undefined;this[_0x0dc3('0xb')]=_0x42fe69[_0x0dc3('0xb')];this[_0x0dc3('0xc')]=_0x42fe69[_0x0dc3('0xc')];}module[_0x0dc3('0xd')]=FaxAccount; \ No newline at end of file +var _0x78ab=['exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','v17,v27,v29','gateway','t38timeout','tech','SIP','Trunk','ListId','key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x78ab,0x81));var _0xb78a=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x78ab[_0x3070dc];return _0x431489;};'use strict';function FaxAccount(_0x1ba0a5){this['id']=_0x1ba0a5['id']||0x0;this[_0xb78a('0x0')]=_0x1ba0a5[_0xb78a('0x0')]||'';this[_0xb78a('0x1')]=_0x1ba0a5[_0xb78a('0x1')];this[_0xb78a('0x2')]=_0x1ba0a5[_0xb78a('0x2')];this[_0xb78a('0x3')]=_0x1ba0a5['headerinfo'];this['localstationid']=_0x1ba0a5[_0xb78a('0x4')];this[_0xb78a('0x5')]=_0x1ba0a5[_0xb78a('0x5')]||0x960;this[_0xb78a('0x6')]=_0x1ba0a5[_0xb78a('0x6')]||0x3840;this['modem']=_0x1ba0a5['modem']||_0xb78a('0x7');this[_0xb78a('0x8')]=_0x1ba0a5[_0xb78a('0x8')]||'no';this['faxdetect']=_0x1ba0a5['faxdetect']||'no';this[_0xb78a('0x9')]=_0x1ba0a5['t38timeout']||0x1388;this[_0xb78a('0xa')]=_0x1ba0a5[_0xb78a('0xa')]||_0xb78a('0xb');this[_0xb78a('0xc')]=_0x1ba0a5['Trunk']?_0x1ba0a5[_0xb78a('0xc')]:undefined;this[_0xb78a('0xd')]=_0x1ba0a5[_0xb78a('0xd')];this[_0xb78a('0xe')]=_0x1ba0a5['key'];}module[_0xb78a('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 1dfc947..7c7d715 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 _0x25c0=['username','apiKey','token','remoteUri','serverUrl','Configurations','name'];(function(_0x4800c4,_0x13b31e){var _0x5bd103=function(_0x57b08a){while(--_0x57b08a){_0x4800c4['push'](_0x4800c4['shift']());}};_0x5bd103(++_0x13b31e);}(_0x25c0,0xb5));var _0x025c=function(_0x5af903,_0x258d63){_0x5af903=_0x5af903-0x0;var _0x6b0e75=_0x25c0[_0x5af903];return _0x6b0e75;};'use strict';function FreshdeskAccount(_0x424bc9){this['id']=_0x424bc9['id']||0x0;this[_0x025c('0x0')]=_0x424bc9[_0x025c('0x0')]||'';this[_0x025c('0x1')]=_0x424bc9[_0x025c('0x1')]||'';this[_0x025c('0x2')]=_0x424bc9[_0x025c('0x3')]||'';this[_0x025c('0x4')]=_0x424bc9['remoteUri']||'';this[_0x025c('0x5')]=_0x424bc9[_0x025c('0x5')]||'';this[_0x025c('0x6')]=_0x424bc9[_0x025c('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xd5ee=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xd5ee,0xc7));var _0xed5e=function(_0xfcc0e,_0x1da886){_0xfcc0e=_0xfcc0e-0x0;var _0x32bb2e=_0xd5ee[_0xfcc0e];return _0x32bb2e;};'use strict';function FreshdeskAccount(_0xfa8f39){this['id']=_0xfa8f39['id']||0x0;this[_0xed5e('0x0')]=_0xfa8f39[_0xed5e('0x0')]||'';this[_0xed5e('0x1')]=_0xfa8f39[_0xed5e('0x1')]||'';this[_0xed5e('0x2')]=_0xfa8f39[_0xed5e('0x3')]||'';this[_0xed5e('0x4')]=_0xfa8f39[_0xed5e('0x4')]||'';this[_0xed5e('0x5')]=_0xfa8f39[_0xed5e('0x5')]||'';this[_0xed5e('0x6')]=_0xfa8f39['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 02eb9ea..6d4e5e3 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 _0xdb94=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x395499,_0x4fecf1){var _0x2d8024=function(_0x104b9e){while(--_0x104b9e){_0x395499['push'](_0x395499['shift']());}};_0x2d8024(++_0x4fecf1);}(_0xdb94,0xe5));var _0x4db9=function(_0x11d30f,_0x235b86){_0x11d30f=_0x11d30f-0x0;var _0x118d60=_0xdb94[_0x11d30f];return _0x118d60;};'use strict';function FreshsalesAccount(_0x247e6b){this['id']=_0x247e6b['id']||0x0;this[_0x4db9('0x0')]=_0x247e6b[_0x4db9('0x0')]||'';this['username']=_0x247e6b[_0x4db9('0x1')]||'';this[_0x4db9('0x2')]=_0x247e6b[_0x4db9('0x3')]||'';this[_0x4db9('0x4')]=_0x247e6b[_0x4db9('0x4')]||'';this['serverUrl']=_0x247e6b[_0x4db9('0x5')]||'';this['Configurations']=_0x247e6b[_0x4db9('0x6')]||{};}module[_0x4db9('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x0734=['name','username','token','remoteUri','serverUrl','Configurations'];(function(_0x31cef1,_0x275018){var _0xdad81b=function(_0x177cc9){while(--_0x177cc9){_0x31cef1['push'](_0x31cef1['shift']());}};_0xdad81b(++_0x275018);}(_0x0734,0xba));var _0x4073=function(_0x3e6a0b,_0x371c4c){_0x3e6a0b=_0x3e6a0b-0x0;var _0x3cdf46=_0x0734[_0x3e6a0b];return _0x3cdf46;};'use strict';function FreshsalesAccount(_0x2f727f){this['id']=_0x2f727f['id']||0x0;this[_0x4073('0x0')]=_0x2f727f[_0x4073('0x0')]||'';this[_0x4073('0x1')]=_0x2f727f[_0x4073('0x1')]||'';this['apiKey']=_0x2f727f[_0x4073('0x2')]||'';this[_0x4073('0x3')]=_0x2f727f[_0x4073('0x3')]||'';this[_0x4073('0x4')]=_0x2f727f['serverUrl']||'';this['Configurations']=_0x2f727f[_0x4073('0x5')]||{};}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 c9fbb0f..c12248a 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 _0x3d18=['exports','type','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','holdtime','lastAssignedTo','voice','mohtime','variables'];(function(_0x3d3130,_0x3f17a6){var _0x3b43b6=function(_0x5ae389){while(--_0x5ae389){_0x3d3130['push'](_0x3d3130['shift']());}};_0x3b43b6(++_0x3f17a6);}(_0x3d18,0x6a));var _0x83d1=function(_0x1e691f,_0x215f5f){_0x1e691f=_0x1e691f-0x0;var _0x5b37cb=_0x3d18[_0x1e691f];return _0x5b37cb;};'use strict';function QueueReport(){this[_0x83d1('0x0')]='inbound';this[_0x83d1('0x1')]='';this['calleridnum']='';this['calleridname']='';this[_0x83d1('0x2')]='';this[_0x83d1('0x3')]=null;this[_0x83d1('0x4')]=null;this['position']=0x1;this['count']=0x1;this[_0x83d1('0x5')]=![];this[_0x83d1('0x6')]=null;this[_0x83d1('0x7')]=![];this['queuecallercompleteAt']=null;this[_0x83d1('0x8')]=![];this[_0x83d1('0x9')]=null;this[_0x83d1('0xa')]=0x1;this[_0x83d1('0xb')]='';this[_0x83d1('0xc')]='';this[_0x83d1('0xd')]='';this[_0x83d1('0xe')]='';this['context']='';this['exten']='';this['priority']='';this[_0x83d1('0xf')]=0x0;this['assigned']=![];this[_0x83d1('0x10')]='';this['motionChannel']=_0x83d1('0x11');this[_0x83d1('0x12')]=0x0;this[_0x83d1('0x13')]={};}module[_0x83d1('0x14')]=QueueReport; \ No newline at end of file +var _0x3574=['channel','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','variables','type','uniqueid','calleridnum','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','originalposition'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x3574,0x1d4));var _0x4357=function(_0x5da7fb,_0x143fb3){_0x5da7fb=_0x5da7fb-0x0;var _0x5c9d10=_0x3574[_0x5da7fb];return _0x5c9d10;};'use strict';function QueueReport(){this[_0x4357('0x0')]='inbound';this[_0x4357('0x1')]='';this[_0x4357('0x2')]='';this['calleridname']='';this[_0x4357('0x3')]='';this[_0x4357('0x4')]=null;this['queuecallerleaveAt']=null;this[_0x4357('0x5')]=0x1;this[_0x4357('0x6')]=0x1;this[_0x4357('0x7')]=![];this[_0x4357('0x8')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x4357('0x9')]=![];this[_0x4357('0xa')]=null;this[_0x4357('0xb')]=0x1;this[_0x4357('0xc')]='';this['connectedlinenum']='';this[_0x4357('0xd')]='';this[_0x4357('0xe')]='';this[_0x4357('0xf')]='';this[_0x4357('0x10')]='';this[_0x4357('0x11')]='';this[_0x4357('0x12')]=0x0;this[_0x4357('0x13')]=![];this[_0x4357('0x14')]='';this[_0x4357('0x15')]=_0x4357('0x16');this['mohtime']=0x0;this[_0x4357('0x17')]={};}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 f8cc240..8213621 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 _0x8069=['remoteUri','clientId','clientSecret','securityToken','type','serverUrl','Configurations','name','username'];(function(_0x22e817,_0x55df1f){var _0x47f160=function(_0x2fbbac){while(--_0x2fbbac){_0x22e817['push'](_0x22e817['shift']());}};_0x47f160(++_0x55df1f);}(_0x8069,0xbb));var _0x9806=function(_0x3bc626,_0x3dcc09){_0x3bc626=_0x3bc626-0x0;var _0x569023=_0x8069[_0x3bc626];return _0x569023;};'use strict';function SalesforceAccount(_0xffb06){this['id']=_0xffb06['id']||0x0;this[_0x9806('0x0')]=_0xffb06[_0x9806('0x0')]||'';this[_0x9806('0x1')]=_0xffb06['username']||'';this[_0x9806('0x2')]=_0xffb06[_0x9806('0x2')]||'';this['password']=_0xffb06['password']||'';this[_0x9806('0x3')]=_0xffb06[_0x9806('0x3')]||'';this['clientSecret']=_0xffb06[_0x9806('0x4')]||'';this[_0x9806('0x5')]=_0xffb06['securityToken']||'';this['type']=_0xffb06[_0x9806('0x6')]||'integrationTab';this[_0x9806('0x7')]=_0xffb06[_0x9806('0x7')]||'';this[_0x9806('0x8')]=_0xffb06['Configurations']||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x0b44=['clientId','clientSecret','type','integrationTab','serverUrl','Configurations','name','username','remoteUri','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b44,0xe2));var _0x40b4=function(_0x3c8587,_0x1776bf){_0x3c8587=_0x3c8587-0x0;var _0x5da887=_0x0b44[_0x3c8587];return _0x5da887;};'use strict';function SalesforceAccount(_0x22f0df){this['id']=_0x22f0df['id']||0x0;this[_0x40b4('0x0')]=_0x22f0df['name']||'';this[_0x40b4('0x1')]=_0x22f0df[_0x40b4('0x1')]||'';this[_0x40b4('0x2')]=_0x22f0df['remoteUri']||'';this[_0x40b4('0x3')]=_0x22f0df['password']||'';this[_0x40b4('0x4')]=_0x22f0df[_0x40b4('0x4')]||'';this[_0x40b4('0x5')]=_0x22f0df[_0x40b4('0x5')]||'';this['securityToken']=_0x22f0df['securityToken']||'';this[_0x40b4('0x6')]=_0x22f0df[_0x40b4('0x6')]||_0x40b4('0x7');this[_0x40b4('0x8')]=_0x22f0df[_0x40b4('0x8')]||'';this[_0x40b4('0x9')]=_0x22f0df[_0x40b4('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 cfb1376..96d1f49 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 _0xb5be=['name','username','password','serverUrl','Configurations'];(function(_0x2c7fc0,_0x48d943){var _0x2e8516=function(_0x5c0f50){while(--_0x5c0f50){_0x2c7fc0['push'](_0x2c7fc0['shift']());}};_0x2e8516(++_0x48d943);}(_0xb5be,0xa0));var _0xeb5b=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xb5be[_0x53ccf2];return _0x5a2964;};'use strict';function ServicenowAccount(_0x53dd3c){this['id']=_0x53dd3c['id']||0x0;this[_0xeb5b('0x0')]=_0x53dd3c[_0xeb5b('0x0')]||'';this['username']=_0x53dd3c[_0xeb5b('0x1')]||'';this[_0xeb5b('0x2')]=_0x53dd3c[_0xeb5b('0x2')]||'';this['remoteUri']=_0x53dd3c['remoteUri']||'';this[_0xeb5b('0x3')]=_0x53dd3c[_0xeb5b('0x3')]||'';this[_0xeb5b('0x4')]=_0x53dd3c[_0xeb5b('0x4')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x3e74=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x22d131,_0x54a116){var _0x658d64=function(_0x4fa447){while(--_0x4fa447){_0x22d131['push'](_0x22d131['shift']());}};_0x658d64(++_0x54a116);}(_0x3e74,0xfd));var _0x43e7=function(_0x1a5819,_0x4b8858){_0x1a5819=_0x1a5819-0x0;var _0x517c35=_0x3e74[_0x1a5819];return _0x517c35;};'use strict';function ServicenowAccount(_0x46e0d6){this['id']=_0x46e0d6['id']||0x0;this['name']=_0x46e0d6[_0x43e7('0x0')]||'';this[_0x43e7('0x1')]=_0x46e0d6[_0x43e7('0x1')]||'';this[_0x43e7('0x2')]=_0x46e0d6['password']||'';this[_0x43e7('0x3')]=_0x46e0d6[_0x43e7('0x3')]||'';this[_0x43e7('0x4')]=_0x46e0d6[_0x43e7('0x4')]||'';this[_0x43e7('0x5')]=_0x46e0d6[_0x43e7('0x5')]||{};}module[_0x43e7('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 e14c861..5132e2b 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 _0x7b8b=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x7b8b,0xd4));var _0xb7b8=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x7b8b[_0x3da832];return _0xe602f2;};'use strict';function SugarcrmAccount(_0xd04930){this['id']=_0xd04930['id']||0x0;this[_0xb7b8('0x0')]=_0xd04930['name']||'';this[_0xb7b8('0x1')]=_0xd04930['username']||'';this['password']=_0xd04930[_0xb7b8('0x2')]||'';this[_0xb7b8('0x3')]=_0xd04930['remoteUri']||'';this[_0xb7b8('0x4')]=_0xd04930[_0xb7b8('0x4')]||'';this[_0xb7b8('0x5')]=_0xd04930[_0xb7b8('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x2b1b=['serverUrl','Configurations','name','username','password'];(function(_0x4391e5,_0x491204){var _0x50db23=function(_0xd24d3d){while(--_0xd24d3d){_0x4391e5['push'](_0x4391e5['shift']());}};_0x50db23(++_0x491204);}(_0x2b1b,0xde));var _0xb2b1=function(_0x4afb39,_0x1bd52d){_0x4afb39=_0x4afb39-0x0;var _0xf39db5=_0x2b1b[_0x4afb39];return _0xf39db5;};'use strict';function SugarcrmAccount(_0x38eeae){this['id']=_0x38eeae['id']||0x0;this['name']=_0x38eeae[_0xb2b1('0x0')]||'';this[_0xb2b1('0x1')]=_0x38eeae[_0xb2b1('0x1')]||'';this['password']=_0x38eeae[_0xb2b1('0x2')]||'';this['remoteUri']=_0x38eeae['remoteUri']||'';this['serverUrl']=_0x38eeae[_0xb2b1('0x3')]||'';this[_0xb2b1('0x4')]=_0x38eeae[_0xb2b1('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index d79bc05..cc8e7c8 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 _0x3e74=['stateTime','status','address','exports','name','accountcode','state','unknown'];(function(_0x75044a,_0x244082){var _0x3400c3=function(_0x51f0d6){while(--_0x51f0d6){_0x75044a['push'](_0x75044a['shift']());}};_0x3400c3(++_0x244082);}(_0x3e74,0x1e4));var _0x43e7=function(_0x31e5a7,_0xa6774d){_0x31e5a7=_0x31e5a7-0x0;var _0x39bc5e=_0x3e74[_0x31e5a7];return _0x39bc5e;};'use strict';function Telephone(_0x573a04){this['id']=_0x573a04['id']||0x0;this['name']=_0x573a04[_0x43e7('0x0')]||'';this[_0x43e7('0x1')]=_0x573a04['accountcode']||'';this[_0x43e7('0x2')]=_0x43e7('0x3');this[_0x43e7('0x4')]=0x0;this[_0x43e7('0x5')]=_0x43e7('0x3');this[_0x43e7('0x6')]='';}module[_0x43e7('0x7')]=Telephone; \ No newline at end of file +var _0x6a11=['stateTime','status','exports','name','accountcode','state','unknown'];(function(_0x545bed,_0x221e96){var _0x16c79c=function(_0x465346){while(--_0x465346){_0x545bed['push'](_0x545bed['shift']());}};_0x16c79c(++_0x221e96);}(_0x6a11,0xc0));var _0x16a1=function(_0x3a4aec,_0x35c955){_0x3a4aec=_0x3a4aec-0x0;var _0x26bad8=_0x6a11[_0x3a4aec];return _0x26bad8;};'use strict';function Telephone(_0x2b3088){this['id']=_0x2b3088['id']||0x0;this['name']=_0x2b3088[_0x16a1('0x0')]||'';this[_0x16a1('0x1')]=_0x2b3088[_0x16a1('0x1')]||'';this[_0x16a1('0x2')]=_0x16a1('0x3');this[_0x16a1('0x4')]=0x0;this[_0x16a1('0x5')]=_0x16a1('0x3');this['address']='';}module[_0x16a1('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index eb1d320..4f38934 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x53100f,_0x1bf485){var _0x154306=function(_0x3dba57){while(--_0x3dba57){_0x53100f['push'](_0x53100f['shift']());}};_0x154306(++_0x1bf485);}(_0xb10b,0x12a));var _0xbb10=function(_0x244cef,_0xbce3ec){_0x244cef=_0x244cef-0x0;var _0x32139b=_0xb10b[_0x244cef];return _0x32139b;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x39394f,_0x127006){var _0x54f376=function(_0x38a19d){while(--_0x38a19d){_0x39394f['push'](_0x39394f['shift']());}};_0x54f376(++_0x127006);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 9ea8d71..de895ae 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x7efeb5,_0x3343df){var _0x5df4b5=function(_0x4fa0a8){while(--_0x4fa0a8){_0x7efeb5['push'](_0x7efeb5['shift']());}};_0x5df4b5(++_0x3343df);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x41de08,_0x5ce678){_0x41de08=_0x41de08-0x0;var _0x106bf8=_0x9ffd[_0x41de08];return _0x106bf8;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 6ea8b20..3229d66 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 _0x0fd9=['active','name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','address','defaultuser','exports'];(function(_0x1de7d3,_0x50fb04){var _0x10de57=function(_0x4647d1){while(--_0x4647d1){_0x1de7d3['push'](_0x1de7d3['shift']());}};_0x10de57(++_0x50fb04);}(_0x0fd9,0x7e));var _0x90fd=function(_0x11d95f,_0x34f442){_0x11d95f=_0x11d95f-0x0;var _0x2b1a14=_0x0fd9[_0x11d95f];return _0x2b1a14;};'use strict';function Trunk(_0x38c346){this['id']=_0x38c346['id']||0x0;this[_0x90fd('0x0')]=_0x38c346[_0x90fd('0x0')]||![];this[_0x90fd('0x1')]=_0x38c346[_0x90fd('0x1')]||'';this[_0x90fd('0x2')]=_0x90fd('0x3');this[_0x90fd('0x4')]=0x0;this[_0x90fd('0x5')]=_0x90fd('0x3');this[_0x90fd('0x6')]=_0x38c346[_0x90fd('0x6')]&&_0x38c346['registry'][_0x90fd('0x7')](':')?_0x38c346[_0x90fd('0x6')][_0x90fd('0x8')](':')[0x0]:'';this[_0x90fd('0x9')]='';this[_0x90fd('0xa')]='';this[_0x90fd('0xb')]='';this[_0x90fd('0xc')]='';this[_0x90fd('0xd')]='';this[_0x90fd('0xe')]=_0x90fd('0x3');this['registrationtime']='';this[_0x90fd('0xf')]='';this[_0x90fd('0x10')]=_0x38c346[_0x90fd('0x10')]||'';}module[_0x90fd('0x11')]=Trunk; \ No newline at end of file +var _0x98be=['domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','active','name','state','unknown','status','registry','split','port'];(function(_0x17e735,_0x328f40){var _0x1824d6=function(_0x4460fe){while(--_0x4460fe){_0x17e735['push'](_0x17e735['shift']());}};_0x1824d6(++_0x328f40);}(_0x98be,0x19c));var _0xe98b=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x98be[_0x2fc012];return _0x2891f9;};'use strict';function Trunk(_0x1bf3a2){this['id']=_0x1bf3a2['id']||0x0;this[_0xe98b('0x0')]=_0x1bf3a2['active']||![];this['name']=_0x1bf3a2[_0xe98b('0x1')]||'';this[_0xe98b('0x2')]=_0xe98b('0x3');this['stateTime']=0x0;this[_0xe98b('0x4')]=_0xe98b('0x3');this['registry']=_0x1bf3a2[_0xe98b('0x5')]&&_0x1bf3a2[_0xe98b('0x5')]['indexOf'](':')?_0x1bf3a2[_0xe98b('0x5')][_0xe98b('0x6')](':')[0x0]:'';this['host']='';this[_0xe98b('0x7')]='';this[_0xe98b('0x8')]='';this[_0xe98b('0x9')]='';this[_0xe98b('0xa')]='';this[_0xe98b('0xb')]='unknown';this[_0xe98b('0xc')]='';this['address']='';this[_0xe98b('0xd')]=_0x1bf3a2['defaultuser']||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 9288799..e828c90 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 _0x24a8=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x1a09f3,_0x55835f){var _0x4bf28c=function(_0x543041){while(--_0x543041){_0x1a09f3['push'](_0x1a09f3['shift']());}};_0x4bf28c(++_0x55835f);}(_0x24a8,0xa9));var _0x824a=function(_0x2eb895,_0x519fce){_0x2eb895=_0x2eb895-0x0;var _0x4b2733=_0x24a8[_0x2eb895];return _0x4b2733;};'use strict';function voiceExtension(_0x3e1aa2){this['id']=_0x3e1aa2['id']||0x0;this[_0x824a('0x0')]=_0x3e1aa2[_0x824a('0x0')]||'';this[_0x824a('0x1')]=_0x3e1aa2[_0x824a('0x1')]||'none';this[_0x824a('0x2')]=_0x3e1aa2['mandatoryDisposition']||![];}module[_0x824a('0x3')]=voiceExtension; \ No newline at end of file +var _0xe24a=['recordingFormat','mandatoryDisposition','exten'];(function(_0x2f637e,_0x35dde1){var _0x41de6b=function(_0x4260fb){while(--_0x4260fb){_0x2f637e['push'](_0x2f637e['shift']());}};_0x41de6b(++_0x35dde1);}(_0xe24a,0xb9));var _0xae24=function(_0x303209,_0xb4abc){_0x303209=_0x303209-0x0;var _0xbaf6f4=_0xe24a[_0x303209];return _0xbaf6f4;};'use strict';function voiceExtension(_0x5bdb38){this['id']=_0x5bdb38['id']||0x0;this['exten']=_0x5bdb38[_0xae24('0x0')]||'';this[_0xae24('0x1')]=_0x5bdb38[_0xae24('0x1')]||'none';this[_0xae24('0x2')]=_0x5bdb38[_0xae24('0x2')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index dab7645..6503db9 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 _0x903b=['outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','inuse','busy','unavailable','ringing','ringinuse','onhold','wav','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit'];(function(_0x1316fa,_0x3aadc3){var _0xd12a71=function(_0xe199eb){while(--_0xe199eb){_0x1316fa['push'](_0x1316fa['shift']());}};_0xd12a71(++_0x3aadc3);}(_0x903b,0x1f0));var _0xb903=function(_0x476b80,_0x4e3d09){_0x476b80=_0x476b80-0x0;var _0x12c49c=_0x903b[_0x476b80];return _0x12c49c;};'use strict';var statusDesc=[_0xb903('0x0'),'not_inuse',_0xb903('0x1'),_0xb903('0x2'),'invalid',_0xb903('0x3'),_0xb903('0x4'),_0xb903('0x5'),_0xb903('0x6')];var monitorFormat={'wav':_0xb903('0x7'),'wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':_0xb903('0x8'),'roundrobin':_0xb903('0x9')};function VoiceQueue(_0x24b785){this['id']=_0x24b785['id']||0x0;this[_0xb903('0xa')]=_0x24b785['name']||'';this['monitor_format']=_0x24b785[_0xb903('0xb')]||'';this[_0xb903('0xc')]=_0x24b785[_0xb903('0xc')]||_0xb903('0xd');this[_0xb903('0xe')]=0x0;this['talking']=0x0;this[_0xb903('0xf')]=0x0;this[_0xb903('0x10')]=0x0;this[_0xb903('0x11')]=0x0;this[_0xb903('0x12')]=0x0;this[_0xb903('0x13')]=0x0;this[_0xb903('0x14')]=0x0;this['abandoned']=0x0;this[_0xb903('0x15')]=0x0;this['available']=0x0;this['acw']=_0x24b785['acw']||![];this[_0xb903('0x16')]=_0x24b785['acwTimeout']||0xa;this['autopause']=_0x24b785[_0xb903('0x17')]||'no';this[_0xb903('0x18')]=!![];this[_0xb903('0x19')]='';this[_0xb903('0x1a')]=0x0;this[_0xb903('0x1b')]=0x0;this[_0xb903('0x1c')]=_0x24b785[_0xb903('0x1c')]||null;this[_0xb903('0x1d')]=_0x24b785[_0xb903('0x1d')]?_0x24b785['dialGlobalInterval']:null;this[_0xb903('0x1e')]=_0x24b785[_0xb903('0x1e')];this[_0xb903('0x1f')]=_0x24b785[_0xb903('0x1f')]||'progressive';this['dialLimitChannel']=_0x24b785['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x24b785['dialLimitQueue']||0x0;this[_0xb903('0x20')]=_0x24b785[_0xb903('0x20')]||0x1;this[_0xb903('0x21')]=_0x24b785['dialPredictiveOptimization']||_0xb903('0x22');this[_0xb903('0x23')]=_0x24b785[_0xb903('0x23')]||0.03;this[_0xb903('0x24')]=_0x24b785['dialPredictiveInterval']||0x258;this[_0xb903('0x25')]=_0x24b785[_0xb903('0x25')]||_0xb903('0x26');this[_0xb903('0x27')]=_0x24b785[_0xb903('0x27')]||_0xb903('0x26');this[_0xb903('0x28')]=_0x24b785['dialOriginateTimeout']||0x1e;this[_0xb903('0x29')]=_0x24b785[_0xb903('0x29')]||_0xb903('0x2a');this[_0xb903('0x2b')]=_0x24b785['dialQueueTimeout']||0x3;this['dialQueueProject']=_0x24b785[_0xb903('0x2c')]||undefined;this[_0xb903('0x2d')]=_0x24b785[_0xb903('0x2d')]||0x3;this[_0xb903('0x2e')]=_0x24b785['dialCongestionRetryFrequency']||0x96;this[_0xb903('0x2f')]=_0x24b785[_0xb903('0x2f')]||0x3;this[_0xb903('0x30')]=_0x24b785[_0xb903('0x30')]||0x96;this['dialNoAnswerMaxRetry']=_0x24b785['dialNoAnswerMaxRetry']||0x3;this[_0xb903('0x31')]=_0x24b785[_0xb903('0x31')]||0x96;this[_0xb903('0x32')]=_0x24b785[_0xb903('0x32')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x24b785[_0xb903('0x33')]||0x96;this[_0xb903('0x34')]=_0x24b785['dialDropMaxRetry']||0x3;this[_0xb903('0x35')]=_0x24b785[_0xb903('0x35')]||0x96;this[_0xb903('0x36')]=_0x24b785[_0xb903('0x36')]||0x3;this[_0xb903('0x37')]=_0x24b785['dialAbandonedRetryFrequency']||0x96;this[_0xb903('0x38')]=_0x24b785[_0xb903('0x38')]||0x3;this[_0xb903('0x39')]=_0x24b785[_0xb903('0x39')]||0x96;this[_0xb903('0x3a')]=_0x24b785[_0xb903('0x3a')]||0x3;this[_0xb903('0x3b')]=_0x24b785[_0xb903('0x3b')]||0x96;this[_0xb903('0x3c')]=_0x24b785[_0xb903('0x3c')]||0x3;this[_0xb903('0x3d')]=_0x24b785[_0xb903('0x3d')]||0x4;this[_0xb903('0x3e')]=_0x24b785['Trunk']?_0x24b785[_0xb903('0x3e')]:undefined;this[_0xb903('0x3f')]=_0x24b785[_0xb903('0x3f')]?_0x24b785['TrunkBackup']:undefined;this[_0xb903('0x40')]=_0x24b785[_0xb903('0x40')]||undefined;this['Interval']=_0x24b785[_0xb903('0x41')]?_0x24b785['Interval']:undefined;this['dialOrderByScheduledAt']=_0x24b785[_0xb903('0x42')]||'DESC';this[_0xb903('0x43')]=_0x24b785['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xb903('0x44')]=_0x24b785[_0xb903('0x44')]||undefined;this[_0xb903('0x45')]=strategy[_0x24b785[_0xb903('0x45')]]||'rrmemory';this['queueStatusComplete']=!![];this[_0xb903('0x46')]=_0x24b785[_0xb903('0x46')]||![];this[_0xb903('0x47')]=_0x24b785[_0xb903('0x47')];this['dialAMDGreeting']=_0x24b785['dialAMDGreeting'];this[_0xb903('0x48')]=_0x24b785['dialAMDAfterGreetingSilence'];this[_0xb903('0x49')]=_0x24b785[_0xb903('0x49')];this['dialAMDMinWordLength']=_0x24b785[_0xb903('0x4a')];this[_0xb903('0x4b')]=_0x24b785[_0xb903('0x4b')];this[_0xb903('0x4c')]=_0x24b785[_0xb903('0x4c')];this[_0xb903('0x4d')]=_0x24b785[_0xb903('0x4d')];this[_0xb903('0x4e')]=_0x24b785['dialAMDMaximumWordLength'];this[_0xb903('0x4f')]=0x0;this['pTalking']=0x0;this[_0xb903('0x50')]=_0x24b785[_0xb903('0x50')];this['outboundAnswerCallsDay']=0x0;this[_0xb903('0x51')]=0x0;this[_0xb903('0x52')]=0x0;this[_0xb903('0x53')]=0x0;this[_0xb903('0x54')]=0x0;this[_0xb903('0x55')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xb903('0x56')]=0x0;this[_0xb903('0x57')]=0x0;this[_0xb903('0x58')]=0x0;this[_0xb903('0x59')]=0x0;this[_0xb903('0x5a')]=0x0;this[_0xb903('0x5b')]=0x0;this[_0xb903('0x5c')]=0x0;this[_0xb903('0x5d')]=undefined;this['startPredictive']=undefined;this[_0xb903('0x5e')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xb903('0x5f')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xb903('0x60')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xb903('0x61')]=0x0;this[_0xb903('0x62')]=0x0;this[_0xb903('0x63')]=0x0;this[_0xb903('0x64')]=_0x24b785['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xb903('0x65')]=_0x24b785['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xb903('0x66')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xb903('0x67')]=0x1;this[_0xb903('0x68')]=0x0;this[_0xb903('0x69')]=0x0;this[_0xb903('0x6a')]=0x0;this[_0xb903('0x6b')]=0x0;this[_0xb903('0x6c')]=_0x24b785['dialRecallMeTimeout']||0x1e;this[_0xb903('0x6d')]=_0x24b785[_0xb903('0x6d')]||![];this[_0xb903('0x6e')]=!!_0x24b785[_0xb903('0x6e')]||![];this[_0xb903('0x6f')]=!!_0x24b785[_0xb903('0x6f')]||![];this[_0xb903('0x70')]=_0x24b785[_0xb903('0x70')]||undefined;this['dialAgiAfterHangupClient']=_0x24b785[_0xb903('0x71')]||![];this[_0xb903('0x72')]=_0x24b785[_0xb903('0x72')]||![];this[_0xb903('0xb')]=monitorFormat[_0x24b785[_0xb903('0xb')]]?monitorFormat[_0x24b785[_0xb903('0xb')]]:undefined;this['mandatoryDisposition']=_0x24b785[_0xb903('0x73')]||![];this['mandatoryDispositionPause']=_0x24b785[_0xb903('0x74')]?_0x24b785['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x719c=['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','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x719c,0x1c3));var _0xc719=function(_0x52d257,_0x134912){_0x52d257=_0x52d257-0x0;var _0x57b9d8=_0x719c[_0x52d257];return _0x57b9d8;};'use strict';var statusDesc=[_0xc719('0x0'),_0xc719('0x1'),_0xc719('0x2'),'busy',_0xc719('0x3'),_0xc719('0x4'),'ringing',_0xc719('0x5'),_0xc719('0x6')];var monitorFormat={'wav':_0xc719('0x7'),'wav49':_0xc719('0x8'),'gsm':_0xc719('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xc719('0xa')};function VoiceQueue(_0x5a0684){this['id']=_0x5a0684['id']||0x0;this['name']=_0x5a0684[_0xc719('0xb')]||'';this[_0xc719('0xc')]=_0x5a0684[_0xc719('0xc')]||'';this[_0xc719('0xd')]=_0x5a0684[_0xc719('0xd')]||_0xc719('0xe');this[_0xc719('0xf')]=0x0;this[_0xc719('0x10')]=0x0;this[_0xc719('0x11')]=0x0;this[_0xc719('0x12')]=0x0;this[_0xc719('0x13')]=0x0;this[_0xc719('0x14')]=0x0;this[_0xc719('0x15')]=0x0;this[_0xc719('0x16')]=0x0;this[_0xc719('0x17')]=0x0;this['loggedIn']=0x0;this[_0xc719('0x18')]=0x0;this[_0xc719('0x19')]=_0x5a0684['acw']||![];this[_0xc719('0x1a')]=_0x5a0684[_0xc719('0x1a')]||0xa;this[_0xc719('0x1b')]=_0x5a0684[_0xc719('0x1b')]||'no';this[_0xc719('0x1c')]=!![];this['message']='';this[_0xc719('0x1d')]=0x0;this[_0xc719('0x1e')]=0x0;this[_0xc719('0x1f')]=_0x5a0684[_0xc719('0x1f')]||null;this[_0xc719('0x20')]=_0x5a0684[_0xc719('0x20')]?_0x5a0684[_0xc719('0x20')]:null;this[_0xc719('0x21')]=_0x5a0684[_0xc719('0x21')];this[_0xc719('0x22')]=_0x5a0684[_0xc719('0x22')]||_0xc719('0x23');this['dialLimitChannel']=_0x5a0684['dialLimitChannel']||0x0;this[_0xc719('0x24')]=_0x5a0684['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x5a0684[_0xc719('0x25')]||0x1;this[_0xc719('0x26')]=_0x5a0684[_0xc719('0x26')]||'dropRate';this[_0xc719('0x27')]=_0x5a0684[_0xc719('0x27')]||0.03;this[_0xc719('0x28')]=_0x5a0684[_0xc719('0x28')]||0x258;this[_0xc719('0x29')]=_0x5a0684['dialOriginateCallerIdName']||_0xc719('0x2a');this[_0xc719('0x2b')]=_0x5a0684[_0xc719('0x2b')]||_0xc719('0x2a');this[_0xc719('0x2c')]=_0x5a0684[_0xc719('0x2c')]||0x1e;this[_0xc719('0x2d')]=_0x5a0684['dialQueueOptions']||_0xc719('0x2e');this[_0xc719('0x2f')]=_0x5a0684[_0xc719('0x2f')]||0x3;this['dialQueueProject']=_0x5a0684[_0xc719('0x30')]||undefined;this[_0xc719('0x31')]=_0x5a0684[_0xc719('0x31')]||0x3;this['dialCongestionRetryFrequency']=_0x5a0684[_0xc719('0x32')]||0x96;this[_0xc719('0x33')]=_0x5a0684[_0xc719('0x33')]||0x3;this[_0xc719('0x34')]=_0x5a0684[_0xc719('0x34')]||0x96;this[_0xc719('0x35')]=_0x5a0684[_0xc719('0x35')]||0x3;this[_0xc719('0x36')]=_0x5a0684['dialNoAnswerRetryFrequency']||0x96;this[_0xc719('0x37')]=_0x5a0684['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5a0684[_0xc719('0x38')]||0x96;this[_0xc719('0x39')]=_0x5a0684[_0xc719('0x39')]||0x3;this[_0xc719('0x3a')]=_0x5a0684[_0xc719('0x3a')]||0x96;this[_0xc719('0x3b')]=_0x5a0684[_0xc719('0x3b')]||0x3;this[_0xc719('0x3c')]=_0x5a0684[_0xc719('0x3c')]||0x96;this[_0xc719('0x3d')]=_0x5a0684[_0xc719('0x3d')]||0x3;this[_0xc719('0x3e')]=_0x5a0684[_0xc719('0x3e')]||0x96;this['dialAgentRejectMaxRetry']=_0x5a0684[_0xc719('0x3f')]||0x3;this[_0xc719('0x40')]=_0x5a0684[_0xc719('0x40')]||0x96;this['callAdditionalPhoneAfterMin']=_0x5a0684[_0xc719('0x41')]||0x3;this[_0xc719('0x42')]=_0x5a0684['dialGlobalMaxRetry']||0x4;this[_0xc719('0x43')]=_0x5a0684[_0xc719('0x43')]?_0x5a0684['Trunk']:undefined;this[_0xc719('0x44')]=_0x5a0684[_0xc719('0x44')]?_0x5a0684[_0xc719('0x44')]:undefined;this['dialPrefix']=_0x5a0684['dialPrefix']||undefined;this[_0xc719('0x45')]=_0x5a0684[_0xc719('0x45')]?_0x5a0684['Interval']:undefined;this[_0xc719('0x46')]=_0x5a0684[_0xc719('0x46')]||_0xc719('0x47');this[_0xc719('0x48')]=_0x5a0684[_0xc719('0x48')]||undefined;this[_0xc719('0x49')]=_0x5a0684['dialCutDigit']||undefined;this[_0xc719('0x4a')]=strategy[_0x5a0684['strategy']]||_0xc719('0x4b');this['queueStatusComplete']=!![];this[_0xc719('0x4c')]=_0x5a0684[_0xc719('0x4c')]||![];this[_0xc719('0x4d')]=_0x5a0684[_0xc719('0x4d')];this[_0xc719('0x4e')]=_0x5a0684[_0xc719('0x4e')];this[_0xc719('0x4f')]=_0x5a0684[_0xc719('0x4f')];this[_0xc719('0x50')]=_0x5a0684[_0xc719('0x50')];this[_0xc719('0x51')]=_0x5a0684[_0xc719('0x51')];this[_0xc719('0x52')]=_0x5a0684[_0xc719('0x52')];this[_0xc719('0x53')]=_0x5a0684['dialAMDMaximumNumberOfWords'];this[_0xc719('0x54')]=_0x5a0684[_0xc719('0x54')];this[_0xc719('0x55')]=_0x5a0684[_0xc719('0x55')];this[_0xc719('0x56')]=0x0;this['pTalking']=0x0;this[_0xc719('0x57')]=_0x5a0684[_0xc719('0x57')];this[_0xc719('0x58')]=0x0;this[_0xc719('0x59')]=0x0;this[_0xc719('0x5a')]=0x0;this[_0xc719('0x5b')]=0x0;this[_0xc719('0x5c')]=0x0;this[_0xc719('0x5d')]=0x0;this[_0xc719('0x5e')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xc719('0x5f')]=0x0;this[_0xc719('0x60')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xc719('0x61')]=0x0;this[_0xc719('0x62')]=0x0;this[_0xc719('0x63')]=0x0;this[_0xc719('0x64')]=undefined;this[_0xc719('0x65')]=undefined;this[_0xc719('0x66')]=undefined;this[_0xc719('0x67')]=1.05;this[_0xc719('0x68')]=0x0;this[_0xc719('0x69')]=0x0;this[_0xc719('0x6a')]=0x0;this[_0xc719('0x6b')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xc719('0x6c')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xc719('0x6d')]=0x0;this[_0xc719('0x6e')]=_0x5a0684[_0xc719('0x6f')]||0x14;this[_0xc719('0x70')]=_0x5a0684[_0xc719('0x6f')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xc719('0x71')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0xc719('0x72')]=0x0;this['dialRecallMeTimeout']=_0x5a0684[_0xc719('0x73')]||0x1e;this[_0xc719('0x74')]=_0x5a0684['dialRecallInQueue']||![];this['dialPreviewAutoRecallMe']=!!_0x5a0684[_0xc719('0x75')]||![];this['dialPreviewRecallmeReminder']=!!_0x5a0684['dialPreviewRecallmeReminder']||![];this[_0xc719('0x76')]=_0x5a0684[_0xc719('0x76')]||undefined;this[_0xc719('0x77')]=_0x5a0684[_0xc719('0x77')]||![];this[_0xc719('0x78')]=_0x5a0684[_0xc719('0x78')]||![];this['monitor_format']=monitorFormat[_0x5a0684[_0xc719('0xc')]]?monitorFormat[_0x5a0684['monitor_format']]:undefined;this[_0xc719('0x79')]=_0x5a0684[_0xc719('0x79')]||![];this[_0xc719('0x7a')]=_0x5a0684['mandatoryDispositionPause']?_0x5a0684[_0xc719('0x7a')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 6de9f07..6788237 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 _0x9494=['remoteUri','serverUrl','Configurations','name','username'];(function(_0x4c5b1e,_0x535dc6){var _0x44f446=function(_0x3fec0e){while(--_0x3fec0e){_0x4c5b1e['push'](_0x4c5b1e['shift']());}};_0x44f446(++_0x535dc6);}(_0x9494,0x1a7));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';function VtigerAccount(_0x159a20){this['id']=_0x159a20['id']||0x0;this[_0x4949('0x0')]=_0x159a20['name']||'';this[_0x4949('0x1')]=_0x159a20[_0x4949('0x1')]||'';this['accessKey']=_0x159a20['accessKey']||'';this[_0x4949('0x2')]=_0x159a20['remoteUri']||'';this[_0x4949('0x3')]=_0x159a20['serverUrl']||'';this[_0x4949('0x4')]=_0x159a20[_0x4949('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x75d4=['remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x4ee8da,_0x111e61){var _0x2d485c=function(_0x2550d1){while(--_0x2550d1){_0x4ee8da['push'](_0x4ee8da['shift']());}};_0x2d485c(++_0x111e61);}(_0x75d4,0x112));var _0x475d=function(_0x50d180,_0x11ff17){_0x50d180=_0x50d180-0x0;var _0x576c15=_0x75d4[_0x50d180];return _0x576c15;};'use strict';function VtigerAccount(_0x5b017d){this['id']=_0x5b017d['id']||0x0;this[_0x475d('0x0')]=_0x5b017d['name']||'';this[_0x475d('0x1')]=_0x5b017d[_0x475d('0x1')]||'';this['accessKey']=_0x5b017d['accessKey']||'';this[_0x475d('0x2')]=_0x5b017d[_0x475d('0x2')]||'';this['serverUrl']=_0x5b017d[_0x475d('0x3')]||'';this[_0x475d('0x4')]=_0x5b017d[_0x475d('0x4')]||{};}module[_0x475d('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 7074474..d34f528 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 _0x1db2=['password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username'];(function(_0x1b1e01,_0x1eb3e7){var _0x51e835=function(_0x592f69){while(--_0x592f69){_0x1b1e01['push'](_0x1b1e01['shift']());}};_0x51e835(++_0x1eb3e7);}(_0x1db2,0x1e8));var _0x21db=function(_0x12a6bd,_0x22f026){_0x12a6bd=_0x12a6bd-0x0;var _0x32446a=_0x1db2[_0x12a6bd];return _0x32446a;};'use strict';function ZendeskAccount(_0x3e250d){this['id']=_0x3e250d['id']||0x0;this[_0x21db('0x0')]=_0x3e250d[_0x21db('0x0')]||'';this[_0x21db('0x1')]=_0x3e250d[_0x21db('0x1')]||'';this[_0x21db('0x2')]=_0x3e250d[_0x21db('0x2')]||'';this[_0x21db('0x3')]=_0x3e250d['token']||'';this[_0x21db('0x4')]=_0x3e250d[_0x21db('0x4')]||'';this[_0x21db('0x5')]=_0x3e250d[_0x21db('0x5')]||'';this['type']=_0x3e250d[_0x21db('0x6')]||_0x21db('0x7');this[_0x21db('0x8')]=_0x3e250d[_0x21db('0x8')]||'';this[_0x21db('0x9')]=_0x3e250d[_0x21db('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x95b3=['serverUrl','exports','name','username','token','remoteUri','authType','type','integrationTab'];(function(_0x29fc92,_0x588038){var _0x12804f=function(_0x549bdf){while(--_0x549bdf){_0x29fc92['push'](_0x29fc92['shift']());}};_0x12804f(++_0x588038);}(_0x95b3,0x1b2));var _0x395b=function(_0x19e376,_0x3bd366){_0x19e376=_0x19e376-0x0;var _0x49c43d=_0x95b3[_0x19e376];return _0x49c43d;};'use strict';function ZendeskAccount(_0x1426c2){this['id']=_0x1426c2['id']||0x0;this[_0x395b('0x0')]=_0x1426c2['name']||'';this[_0x395b('0x1')]=_0x1426c2[_0x395b('0x1')]||'';this['password']=_0x1426c2['password']||'';this[_0x395b('0x2')]=_0x1426c2['token']||'';this['remoteUri']=_0x1426c2[_0x395b('0x3')]||'';this[_0x395b('0x4')]=_0x1426c2['authType']||'';this['type']=_0x1426c2[_0x395b('0x5')]||_0x395b('0x6');this[_0x395b('0x7')]=_0x1426c2[_0x395b('0x7')]||'';this['Configurations']=_0x1426c2['Configurations']||{};}module[_0x395b('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 7cfd960..2d39b5b 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 _0x1205=['exports','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x362438,_0x5d5208){var _0x699be5=function(_0x977ca1){while(--_0x977ca1){_0x362438['push'](_0x362438['shift']());}};_0x699be5(++_0x5d5208);}(_0x1205,0x1eb));var _0x5120=function(_0x4249ef,_0x1aa911){_0x4249ef=_0x4249ef-0x0;var _0x5e1c4=_0x1205[_0x4249ef];return _0x5e1c4;};'use strict';function ZohoAccount(_0x1add5f){this['id']=_0x1add5f['id']||0x0;this['name']=_0x1add5f['name']||'';this[_0x5120('0x0')]=_0x1add5f[_0x5120('0x0')]||'';this[_0x5120('0x1')]=_0x1add5f[_0x5120('0x1')]||'';this[_0x5120('0x2')]=_0x1add5f[_0x5120('0x2')]||'';this[_0x5120('0x3')]=_0x1add5f[_0x5120('0x3')]||'';this[_0x5120('0x4')]=_0x1add5f['clientSecret']||'';this[_0x5120('0x5')]=_0x1add5f[_0x5120('0x5')]||'';this['code']=_0x1add5f[_0x5120('0x6')]||'';this[_0x5120('0x7')]=_0x1add5f['refreshToken']||'';this[_0x5120('0x8')]=_0x1add5f['Configurations']||{};}module[_0x5120('0x9')]=ZohoAccount; \ No newline at end of file +var _0x19cb=['host','zone','clientId','clientSecret','code','refreshToken','Configurations','exports','name','description'];(function(_0x483b4c,_0x5167b1){var _0x5d1b87=function(_0x4cad32){while(--_0x4cad32){_0x483b4c['push'](_0x483b4c['shift']());}};_0x5d1b87(++_0x5167b1);}(_0x19cb,0x9e));var _0xb19c=function(_0x547cc7,_0xc186c6){_0x547cc7=_0x547cc7-0x0;var _0x4ada9=_0x19cb[_0x547cc7];return _0x4ada9;};'use strict';function ZohoAccount(_0x501775){this['id']=_0x501775['id']||0x0;this[_0xb19c('0x0')]=_0x501775[_0xb19c('0x0')]||'';this[_0xb19c('0x1')]=_0x501775[_0xb19c('0x1')]||'';this[_0xb19c('0x2')]=_0x501775[_0xb19c('0x2')]||'';this['zone']=_0x501775[_0xb19c('0x3')]||'';this[_0xb19c('0x4')]=_0x501775['clientId']||'';this[_0xb19c('0x5')]=_0x501775['clientSecret']||'';this['serverUrl']=_0x501775['serverUrl']||'';this['code']=_0x501775[_0xb19c('0x6')]||'';this[_0xb19c('0x7')]=_0x501775['refreshToken']||'';this[_0xb19c('0x8')]=_0x501775['Configurations']||{};}module[_0xb19c('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index c9b8b88..845b332 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 _0xd824=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','exports','util','lodash','isNil','string','uniqueid','idContact','name','campaigntype','queue','dialAnswer','Agent','channelAgent','SIP/%s','membername','calleridname','Contact','firstName','active','calleridnum','scheduledat','countbusyretry'];(function(_0x48bdab,_0x3f824d){var _0x2597ce=function(_0x267040){while(--_0x267040){_0x48bdab['push'](_0x48bdab['shift']());}};_0x2597ce(++_0x3f824d);}(_0xd824,0xc2));var _0x4d82=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd824[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x4d82('0x0'));var _=require(_0x4d82('0x1'));var moment=require('moment');function checkNameSurname(_0x53fe9a,_0x223217,_0x42badb){var _0x3f13e4='';if(!_[_0x4d82('0x2')](_0x223217)&&_0x4d82('0x3')===typeof _0x223217){_0x3f13e4+=_0x223217;}if(!_[_0x4d82('0x2')](_0x42badb)&&'string'===typeof _0x42badb){_0x3f13e4+='\x20'+_0x42badb;}if(_0x3f13e4!==''){return _0x3f13e4;}return _0x53fe9a;}function Action(_0x57850a,_0xd00023,_0x583c7c,_0x4b842f,_0x464caf){this[_0x4d82('0x4')]=_0x583c7c||undefined;this[_0x4d82('0x5')]=_0x57850a['id'];this['queue']=_0xd00023[_0x4d82('0x6')];this['type']=_0xd00023['type'];this[_0x4d82('0x7')]=_0x4d82('0x8');this[_0x4d82('0x9')]=![];this['membername']=_[_0x4d82('0x2')](_0x57850a['Agent'])?undefined:_0x57850a[_0x4d82('0xa')][_0x4d82('0x6')];this[_0x4d82('0xb')]=this['membername']?util['format'](_0x4d82('0xc'),this[_0x4d82('0xd')]):_0x4b842f||undefined;this[_0x4d82('0xe')]=checkNameSurname(_0x57850a[_0x4d82('0xf')]['phone'],_0x57850a[_0x4d82('0xf')][_0x4d82('0x10')],_0x57850a[_0x4d82('0xf')]['lastName']);this[_0x4d82('0x11')]=_0x57850a['active']||![];this[_0x4d82('0x12')]=_0x57850a['phone'];this[_0x4d82('0x13')]=_0x57850a['scheduledat'];this[_0x4d82('0x14')]=_0x57850a[_0x4d82('0x14')]||0x0;this[_0x4d82('0x15')]=_0x57850a[_0x4d82('0x15')]||0x0;this[_0x4d82('0x16')]=_0x57850a[_0x4d82('0x16')]||0x0;this[_0x4d82('0x17')]=(_0x57850a[_0x4d82('0x14')]||0x0)+(_0x57850a[_0x4d82('0x15')]||0x0)+(_0x57850a['countnoanswerretry']||0x0)+(_0x57850a[_0x4d82('0x18')]||0x0)+(_0x57850a[_0x4d82('0x19')]||0x0)+(_0x57850a[_0x4d82('0x1a')]||0x0)+(_0x57850a[_0x4d82('0x1b')]||0x0)+(_0x57850a[_0x4d82('0x1c')]||0x0);this[_0x4d82('0x18')]=_0x57850a[_0x4d82('0x18')]||0x0;this[_0x4d82('0x19')]=_0x57850a[_0x4d82('0x19')]||0x0;this[_0x4d82('0x1a')]=_0x57850a[_0x4d82('0x1a')]||0x0;this['countmachineretry']=_0x57850a[_0x4d82('0x1b')]||0x0;this[_0x4d82('0x1c')]=_0x57850a['countagentrejectretry']||0x0;this[_0x4d82('0x1d')]=_0x57850a[_0x4d82('0x1d')];this[_0x4d82('0x1e')]=_0x57850a[_0x4d82('0x1e')];this[_0x4d82('0x1f')]=_0x57850a[_0x4d82('0x1f')];this[_0x4d82('0x20')]=_0x57850a[_0x4d82('0x20')];this[_0x4d82('0x21')]=_0x57850a[_0x4d82('0x21')];this[_0x4d82('0x22')]=_0x57850a[_0x4d82('0x22')];this[_0x4d82('0x23')]=_[_0x4d82('0x2')](_0x57850a[_0x4d82('0xa')])?_0x57850a['UserId']:_0x57850a['Agent']['id'];this[_0x4d82('0x24')]=_0x57850a[_0x4d82('0x24')];this[_0x4d82('0x25')]='';this[_0x4d82('0x26')]='';}Action['prototype'][_0x4d82('0x27')]=function(){return util[_0x4d82('0x28')](_0x4d82('0x29'),this[_0x4d82('0xe')],this['number']);};module[_0x4d82('0x2a')]=Action; \ No newline at end of file +var _0x1967=['type','campaigntype','queue','Agent','channelAgent','membername','format','SIP/%s','calleridname','Contact','firstName','lastName','active','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','prototype','getCaller','exports','lodash','moment','isNil','string','uniqueid','idContact','name'];(function(_0x4f492c,_0x2f5d87){var _0x347ea5=function(_0x7f5e5a){while(--_0x7f5e5a){_0x4f492c['push'](_0x4f492c['shift']());}};_0x347ea5(++_0x2f5d87);}(_0x1967,0x173));var _0x7196=function(_0xba4857,_0x2e880f){_0xba4857=_0xba4857-0x0;var _0x2463c8=_0x1967[_0xba4857];return _0x2463c8;};'use strict';var util=require('util');var _=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));function checkNameSurname(_0x4d0a98,_0x35803d,_0x3319fa){var _0xa80a3f='';if(!_[_0x7196('0x2')](_0x35803d)&&_0x7196('0x3')===typeof _0x35803d){_0xa80a3f+=_0x35803d;}if(!_[_0x7196('0x2')](_0x3319fa)&&_0x7196('0x3')===typeof _0x3319fa){_0xa80a3f+='\x20'+_0x3319fa;}if(_0xa80a3f!==''){return _0xa80a3f;}return _0x4d0a98;}function Action(_0x5c128f,_0x36b01e,_0x186175,_0x194746,_0x40e0af){this[_0x7196('0x4')]=_0x186175||undefined;this[_0x7196('0x5')]=_0x5c128f['id'];this['queue']=_0x36b01e[_0x7196('0x6')];this[_0x7196('0x7')]=_0x36b01e[_0x7196('0x7')];this[_0x7196('0x8')]=_0x7196('0x9');this['dialAnswer']=![];this['membername']=_[_0x7196('0x2')](_0x5c128f[_0x7196('0xa')])?undefined:_0x5c128f[_0x7196('0xa')][_0x7196('0x6')];this[_0x7196('0xb')]=this[_0x7196('0xc')]?util[_0x7196('0xd')](_0x7196('0xe'),this[_0x7196('0xc')]):_0x194746||undefined;this[_0x7196('0xf')]=checkNameSurname(_0x5c128f[_0x7196('0x10')]['phone'],_0x5c128f[_0x7196('0x10')][_0x7196('0x11')],_0x5c128f[_0x7196('0x10')][_0x7196('0x12')]);this['active']=_0x5c128f[_0x7196('0x13')]||![];this['calleridnum']=_0x5c128f[_0x7196('0x14')];this[_0x7196('0x15')]=_0x5c128f[_0x7196('0x15')];this[_0x7196('0x16')]=_0x5c128f[_0x7196('0x16')]||0x0;this[_0x7196('0x17')]=_0x5c128f[_0x7196('0x17')]||0x0;this[_0x7196('0x18')]=_0x5c128f[_0x7196('0x18')]||0x0;this[_0x7196('0x19')]=(_0x5c128f[_0x7196('0x16')]||0x0)+(_0x5c128f['countcongestionretry']||0x0)+(_0x5c128f['countnoanswerretry']||0x0)+(_0x5c128f[_0x7196('0x1a')]||0x0)+(_0x5c128f[_0x7196('0x1b')]||0x0)+(_0x5c128f[_0x7196('0x1c')]||0x0)+(_0x5c128f['countmachineretry']||0x0)+(_0x5c128f[_0x7196('0x1d')]||0x0);this['countnosuchnumberretry']=_0x5c128f['countnosuchnumberretry']||0x0;this[_0x7196('0x1b')]=_0x5c128f[_0x7196('0x1b')]||0x0;this[_0x7196('0x1c')]=_0x5c128f['countabandonedretry']||0x0;this['countmachineretry']=_0x5c128f[_0x7196('0x1e')]||0x0;this[_0x7196('0x1d')]=_0x5c128f['countagentrejectretry']||0x0;this[_0x7196('0x1f')]=_0x5c128f[_0x7196('0x1f')];this[_0x7196('0x20')]=_0x5c128f[_0x7196('0x20')];this[_0x7196('0x21')]=_0x5c128f['callbackat'];this[_0x7196('0x22')]=_0x5c128f['recallme'];this[_0x7196('0x23')]=_0x5c128f[_0x7196('0x23')];this[_0x7196('0x24')]=_0x5c128f[_0x7196('0x24')];this[_0x7196('0x25')]=_[_0x7196('0x2')](_0x5c128f['Agent'])?_0x5c128f['UserId']:_0x5c128f[_0x7196('0xa')]['id'];this[_0x7196('0x26')]=_0x5c128f[_0x7196('0x26')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x7196('0x27')][_0x7196('0x28')]=function(){return util[_0x7196('0xd')]('\x22%s\x22\x20<%s>',this[_0x7196('0xf')],this['number']);};module[_0x7196('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index c56cd12..0fcfbd2 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 _0x8daf=['isFailure','response','custom:agentringnoanswer','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','filterKey','addVariable','keys','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','md5','ioredis','../../../config/logger','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','defaults','localhost','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','strategy','answered','available','loggedIn','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_presence:remove','originated','pTalking','paused','message','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','syncCampaigns','booked','clearZombieChannels','hasOwnProperty','dialMethod','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','Queue','queue','originated:\x20','actions','pTalking:\x20','dialAnswer','VoiceQueueId','ListId','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','sendMessageOneNotActive','IsNotLoggedIn','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','linkedid','idContact','incrementPreviewCounters','swapAdditionalPhones','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','[syncHangup][talking][decrement]','countbusyretry','Busy','callAdditionalPhoneAfterMin','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countmachineretry','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','cause-txt','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','logAgent','createAgentHistory','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','reason','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','isNil','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','execRun','pick','unlock','unlockContact','getContactPreview','recallme','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','substring','dialCutDigit','getCallerId','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','merge','toLowerVariables','variables','Action','variablesAction','OriginateError','actionid'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8daf,0x15c));var _0xf8da=function(_0x2666de,_0x41ce04){_0x2666de=_0x2666de-0x0;var _0x55704f=_0x8daf[_0x2666de];return _0x55704f;};'use strict';var util=require('util');var _=require('lodash');var uuid=require('uuid');var moment=require('moment');var md5=require(_0xf8da('0x0'));var Redis=require(_0xf8da('0x1'));var config=require('../../../config/environment');var logger=require(_0xf8da('0x2'))(_0xf8da('0x3'));var loggerAction=require(_0xf8da('0x2'))(_0xf8da('0x4'));var ami=require(_0xf8da('0x5'));var rpcDb=require(_0xf8da('0x6'));var cmHopperAdditionalPhone=require(_0xf8da('0x7'));var Action=require(_0xf8da('0x8'));var ut=require(_0xf8da('0x9'));config['redis']=_[_0xf8da('0xa')](config['redis'],{'host':_0xf8da('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xf8da('0xc')][_0xf8da('0xd')]=function(_0xbd4f48){this[_0xf8da('0xe')]=this[_0xf8da('0xe')]?this[_0xf8da('0xe')][_0xf8da('0xf')](_0xbd4f48):_0xbd4f48();};function Preview(_0x31193e){this['sequence']=new Sequence();this[_0xf8da('0x10')]=_0x31193e[_0xf8da('0x11')];this[_0xf8da('0x12')]=_0x31193e[_0xf8da('0x12')];this['actions']={};this[_0xf8da('0x13')]=_0x31193e['agents'];this[_0xf8da('0x14')]=0x0;ami['on'](_0xf8da('0x15'),this[_0xf8da('0x16')][_0xf8da('0x17')](this));ami['on'](_0xf8da('0x18'),this['syncHangup'][_0xf8da('0x17')](this));ami['on'](_0xf8da('0x19'),this[_0xf8da('0x1a')][_0xf8da('0x17')](this));ami['on'](_0xf8da('0x1b'),this[_0xf8da('0x1c')][_0xf8da('0x17')](this));ami['on']('newexten',this[_0xf8da('0x1d')]['bind'](this));ami['on']('varset',this[_0xf8da('0x1e')][_0xf8da('0x17')](this));ami['on']('attendedtransfer',this[_0xf8da('0x1f')][_0xf8da('0x17')](this));ami['on'](_0xf8da('0x20'),this[_0xf8da('0x21')][_0xf8da('0x17')](this));this[_0xf8da('0x22')](this[_0xf8da('0x10')]);}function emit(_0xfe5c73,_0x5acd3f,_0x27f5a4){io['to'](_0xfe5c73)[_0xf8da('0x23')](_0x5acd3f,_0x27f5a4);}function emitCampaignPreview(_0x53ad22){if(_0x53ad22[_0xf8da('0x24')]===_0xf8da('0x25')){var _0x4ca909={'id':_0x53ad22['id'],'name':_0x53ad22['name'],'strategy':_0x53ad22[_0xf8da('0x26')],'answered':_0x53ad22[_0xf8da('0x27')],'available':_0x53ad22[_0xf8da('0x28')],'loggedIn':_0x53ad22[_0xf8da('0x29')],'pTalking':_0x53ad22['pTalking'],'sumBillable':_0x53ad22['sumBillable'],'sumDuration':_0x53ad22['sumDuration'],'sumHoldTime':_0x53ad22['sumHoldTime']||0x0,'talking':_0x53ad22[_0xf8da('0x2a')],'total':_0x53ad22[_0xf8da('0x2b')],'type':_0x53ad22[_0xf8da('0x24')],'unmanaged':_0x53ad22[_0xf8da('0x2c')],'abandoned':_0x53ad22['abandoned'],'waiting':_0x53ad22[_0xf8da('0x2d')],'loggedInDb':_0x53ad22[_0xf8da('0x2e')],'dialActive':_0x53ad22[_0xf8da('0x2f')],'dialMethod':_0x53ad22['dialMethod'],'dialOriginateCallerIdName':_0x53ad22[_0xf8da('0x30')],'dialOriginateCallerIdNumber':_0x53ad22['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x53ad22[_0xf8da('0x31')],'dialPrefix':_0x53ad22[_0xf8da('0x32')],'outboundAnswerAgiCallsDay':_0x53ad22[_0xf8da('0x33')],'outboundAnswerCallsDay':_0x53ad22[_0xf8da('0x34')],'outboundBlacklistCallsDay':_0x53ad22[_0xf8da('0x35')],'outboundBusyCallsDay':_0x53ad22[_0xf8da('0x36')],'outboundCongestionCallsDay':_0x53ad22[_0xf8da('0x37')],'outboundDropCallsDayACS':_0x53ad22[_0xf8da('0x38')],'outboundDropCallsDayCallersExit':_0x53ad22['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x53ad22[_0xf8da('0x39')],'outboundNoAnswerCallsDay':_0x53ad22['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x53ad22['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x53ad22[_0xf8da('0x3a')],'outboundReCallsDay':_0x53ad22[_0xf8da('0x3b')],'outboundRejectCallsDay':_0x53ad22[_0xf8da('0x3c')],'outboundUnknownCallsDay':_0x53ad22[_0xf8da('0x3d')],'outboundAbandonedCallsDay':_0x53ad22[_0xf8da('0x3e')],'predictiveIntervalAnsweredCalls':_0x53ad22['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x53ad22[_0xf8da('0x3f')],'predictiveIntervalAvgTalktime':_0x53ad22['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x53ad22['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x53ad22['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x53ad22['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x53ad22['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x53ad22[_0xf8da('0x40')],'predictiveIntervalMultiplicativeFactor':_0x53ad22['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x53ad22[_0xf8da('0x41')],'predictiveIntervalAvailable':_0x53ad22[_0xf8da('0x42')],'predictiveIntervalTotalCalls':_0x53ad22[_0xf8da('0x43')],'message':_0x53ad22['message'],'originated':_0x53ad22['originated'],'erlangCalls':_0x53ad22[_0xf8da('0x44')],'erlangCallToSecond':_0x53ad22[_0xf8da('0x45')],'erlangAbandonmentRate':_0x53ad22[_0xf8da('0x46')],'erlangBusyFactor':_0x53ad22[_0xf8da('0x47')],'startPredictive':_0x53ad22[_0xf8da('0x48')],'startProgressive':_0x53ad22[_0xf8da('0x49')]};if(_0x53ad22['Trunk']){_0x4ca909[_0xf8da('0x4a')]={'id':_0x53ad22[_0xf8da('0x4a')]['id'],'name':_0x53ad22[_0xf8da('0x4a')][_0xf8da('0x4b')],'active':_0x53ad22[_0xf8da('0x4a')][_0xf8da('0x4c')],'callerid':_0x53ad22['Trunk'][_0xf8da('0x4d')]};}if(_0x53ad22[_0xf8da('0x4e')]){_0x4ca909[_0xf8da('0x4e')]={'id':_0x53ad22[_0xf8da('0x4e')]['id'],'name':_0x53ad22['Interval'][_0xf8da('0x4b')]};}var _0x4fc59f=md5(JSON[_0xf8da('0x4f')](_0x4ca909));if(_0x53ad22['md5']!==_0x4fc59f){_0x53ad22[_0xf8da('0x0')]=_0x4fc59f;emit(util['format'](_0xf8da('0x50'),_0x4ca909[_0xf8da('0x4b')]),_0xf8da('0x51'),_0x4ca909);}}}function emitVoiceQueueChannelRemove(_0x2197bd){logger[_0xf8da('0x52')](_0xf8da('0x53'),JSON['stringify'](_0x2197bd));emit(util[_0xf8da('0x54')](_0xf8da('0x50'),_0x2197bd[_0xf8da('0x4b')]),'voice_queue_channel:remove',_0x2197bd);io[_0xf8da('0x23')](_0xf8da('0x55'),_0x2197bd);}function notSendMessagesQueue(_0x9b370e){if(_0x9b370e['sendMessageOneNotActive']){if(_0x9b370e[_0xf8da('0x56')]===0x0&&_0x9b370e[_0xf8da('0x57')]===0x0){_0x9b370e['sendMessageOneNotActive']=![];_0x9b370e[_0xf8da('0x28')]=0x0;_0x9b370e[_0xf8da('0x58')]=0x0;_0x9b370e[_0xf8da('0x59')]='NOT_ACTIVE';ut[_0xf8da('0x5a')](_0xf8da('0x5b'),_0x9b370e[_0xf8da('0x4b')]+_0xf8da('0x5c'));}else{_0x9b370e[_0xf8da('0x59')]=_0xf8da('0x5d');ut['logger'](_0xf8da('0x5b'),_0x9b370e[_0xf8da('0x4b')]+'\x20is\x20deactivated');}emitCampaignPreview(_0x9b370e);}}Preview['prototype'][_0xf8da('0x22')]=function(){var _0x32bc20=this;setInterval(function(){_0x32bc20[_0xf8da('0x5e')]();},0x7cf);};Preview[_0xf8da('0xc')]['syncCampaigns']=function(){var _0x246192=this[_0xf8da('0x10')];this[_0xf8da('0x14')]+=0x1;for(var _0x2fd0db in _0x246192){if(_0x246192['hasOwnProperty'](_0x2fd0db)&&(_0x246192[_0x2fd0db]['dialMethod']===_0xf8da('0x3')||_0x246192[_0x2fd0db]['dialMethod']===_0xf8da('0x5f'))&&_0x246192[_0x2fd0db]['type']===_0xf8da('0x25')){if(this[_0xf8da('0x14')]>0x7){this[_0xf8da('0x14')]=0x0;this[_0xf8da('0x60')]();}}if(_0x246192[_0xf8da('0x61')](_0x2fd0db)&&_0x246192[_0x2fd0db][_0xf8da('0x62')]===_0xf8da('0x3')&&_0x246192[_0x2fd0db]['type']===_0xf8da('0x25')){if(_0x246192[_0x2fd0db][_0xf8da('0x2f')]){this['setMessage'](_0x246192[_0x2fd0db]);if(_0x246192[_0x2fd0db][_0xf8da('0x63')])this[_0xf8da('0x64')](_0x246192[_0x2fd0db]);}else{notSendMessagesQueue(_0x246192[_0x2fd0db]);}}}};Preview['prototype'][_0xf8da('0x65')]=function(_0x5285a6){var _0x1fe8d1=this;this[_0xf8da('0x66')][_0xf8da('0xd')](function(){if(!_['isNil'](_0x1fe8d1['actions'][_0x5285a6])){loggerAction[_0xf8da('0x52')]('[clearZombieChannels][talking]',_0x5285a6,_0xf8da('0x67'),_0x1fe8d1['actions'][_0x5285a6][_0xf8da('0x68')],_0xf8da('0x69'),JSON[_0xf8da('0x4f')](_0x1fe8d1[_0xf8da('0x10')][_0x1fe8d1[_0xf8da('0x6a')][_0x5285a6][_0xf8da('0x68')]][_0xf8da('0x56')]),_0xf8da('0x6b'),JSON['stringify'](_0x1fe8d1[_0xf8da('0x10')][_0x1fe8d1[_0xf8da('0x6a')][_0x5285a6]['queue']][_0xf8da('0x57')]),JSON[_0xf8da('0x4f')](_0x1fe8d1[_0xf8da('0x6a')][_0x5285a6][_0xf8da('0x6c')]),JSON[_0xf8da('0x4f')](_['pick'](_0x1fe8d1['actions'][_0x5285a6],['contactId','UserId',_0xf8da('0x6d'),_0xf8da('0x6e')])));return ami['Action']({'action':'status','channel':_0x1fe8d1[_0xf8da('0x6a')][_0x5285a6][_0xf8da('0x6f')]})[_0xf8da('0x70')](function(_0x35f920){if(_0x35f920[_0xf8da('0x59')]===_0xf8da('0x71')){setTimeout(function(){if(_0x1fe8d1[_0xf8da('0x6a')][_0x5285a6]){ut[_0xf8da('0x72')](_0x1fe8d1[_0xf8da('0x10')][_0x1fe8d1['actions'][_0x5285a6]['queue']],'[clearZombieChannel]');if(_0x1fe8d1['actions'][_0x5285a6][_0xf8da('0x6c')]===!![]){ut[_0xf8da('0x73')](_0x1fe8d1[_0xf8da('0x10')][_0x1fe8d1[_0xf8da('0x6a')][_0x5285a6][_0xf8da('0x68')]],'[clearZombieChannel]');ut['loggerError'](_0xf8da('0x74')+_0x5285a6,_0x1fe8d1[_0xf8da('0x6a')][_0x5285a6][_0xf8da('0x68')]);}ut[_0xf8da('0x75')](_0xf8da('0x76')+_0x5285a6,_0x1fe8d1['actions'][_0x5285a6][_0xf8da('0x68')]);delete _0x1fe8d1[_0xf8da('0x6a')][_0x5285a6];}},0x2328);}});}});};Preview[_0xf8da('0xc')][_0xf8da('0x60')]=function(){var _0x464827=this;loggerAction[_0xf8da('0x52')](_0xf8da('0x77'),_[_0xf8da('0x78')](this[_0xf8da('0x6a')]));for(var _0x35d666 in this['actions']){if(_0x464827[_0xf8da('0x6a')][_0xf8da('0x61')](_0x35d666)){_0x464827['clearZombieChannel'](_0x35d666);}}};Preview['prototype'][_0xf8da('0x64')]=function(_0x5e0f70){var _0x5c6236=this;rpcDb[_0xf8da('0x79')](_0x5e0f70['id'],ut[_0xf8da('0x7a')](this[_0xf8da('0x13')]))[_0xf8da('0x7b')](function(_0xd58654){if(!_['isNil'](_0xd58654)){for(var _0x2da398=0x0;_0x2da398<_0xd58654[_0xf8da('0x7c')];_0x2da398+=0x1){if(ut['getDiff'](_0xd58654[_0x2da398]['scheduledat'])<_0x5e0f70[_0xf8da('0x7d')]*0x3c){if(_0xd58654[_0x2da398][_0xf8da('0x7e')]&&!_0xd58654[_0x2da398][_0xf8da('0x7e')][_0xf8da('0x7f')]){_0x5c6236[_0xf8da('0x80')](_0xd58654[_0x2da398]['id'])[_0xf8da('0x7b')](ut['logger2'](_0xf8da('0x81')))['catch'](ut['logger2']('[RecallMe]'));}else{rpcDb[_0xf8da('0x82')](_0xd58654[_0x2da398]['id']);}}else{var _0x1df5fd=new Action(_0xd58654[_0x2da398],_0x5e0f70);_0x1df5fd[_0xf8da('0x83')]=moment()[_0xf8da('0x54')](_0xf8da('0x84'));_0x5e0f70[_0xf8da('0x3b')]+=0x1;ut[_0xf8da('0x85')](_0x1df5fd,0x17,'RecallInQueue');if(_0x5e0f70[_0xf8da('0x86')]){rpcDb[_0xf8da('0x87')](ut['createBody'](_0xd58654[_0x2da398]));rpcDb['createCustomerHistory'](_0x1df5fd,_0xf8da('0x88'));}else{ut[_0xf8da('0x85')](_0x1df5fd,0x16,_0xf8da('0x89'));rpcDb[_0xf8da('0x8a')](_0x1df5fd,_0xf8da('0x8b'));rpcDb[_0xf8da('0x8c')](_0x1df5fd,'[HistoryRecallClose]');}}}}})[_0xf8da('0x70')](ut['logger2'](_0xf8da('0x8d')));};Preview[_0xf8da('0xc')][_0xf8da('0x8e')]=function(_0xca622a){_0xca622a[_0xf8da('0x8f')]=!![];if(ut[_0xf8da('0x90')](_0xca622a[_0xf8da('0x29')])){_0xca622a['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0xf8da('0x91')](_0xca622a[_0xf8da('0x2f')])){_0xca622a[_0xf8da('0x59')]=_0xf8da('0x92');}else if(!this[_0xf8da('0x93')](_0xca622a[_0xf8da('0x4a')])){if(!this[_0xf8da('0x93')](_0xca622a[_0xf8da('0x94')])){_0xca622a[_0xf8da('0x59')]=_0xf8da('0x95');}else{_0xca622a[_0xf8da('0x59')]='ACTIVE';}}else{_0xca622a[_0xf8da('0x59')]=_0xf8da('0x96');}emitCampaignPreview(_0xca622a);};Preview['prototype']['callProgressDetectingCustomer']=function(_0x1c3558,_0x3b7560,_0x363b66){var _0x47a56e=this;var _0x5239b7=this[_0xf8da('0x6a')][_0x3b7560];var _0x35598a=this['campaignsPreview'][_0x5239b7[_0xf8da('0x68')]];var _0x49467b;var _0x305320=![];var _0x4d0cfe=0x2;var _0x3df92b=0x3;if(_0x35598a){switch(_0x363b66){case'1':_0x35598a['outboundNoSuchCallsDay']+=0x1;_0x5239b7[_0xf8da('0x97')]+=0x1;_0x5239b7[_0xf8da('0x98')]=ut[_0xf8da('0x99')](_0x5239b7);ut[_0xf8da('0x85')](_0x5239b7,0x0,_0xf8da('0x9a'));ami[_0xf8da('0x23')](_0xf8da('0x9b'),ut['buildObj'](_0x5239b7,_0xf8da('0x9c')));rpcDb[_0xf8da('0x8a')](_0x5239b7,_0xf8da('0x9d'));_0x47a56e[_0xf8da('0x9e')](_0x5239b7,'0',_0x35598a)[_0xf8da('0x7b')](function(_0x3112dc){_0x305320=_0x3112dc[_0xf8da('0x9f')]==0x1;_0x4d0cfe=_0x35598a[_0xf8da('0xa0')];_0x3df92b=_0x35598a['callAdditionalPhoneAfterMin'];if(!_0x305320){if(ut['totalGlobal'](_0x5239b7)>=_0x35598a['dialGlobalMaxRetry']){_0x49467b=ut['cloneAction'](_0x5239b7,0xf,_0xf8da('0xa1'));rpcDb['createCustomerFinal'](_0x49467b,_0xf8da('0xa2'));}else{if(_0x5239b7['countnosuchnumberretry']>=_0x35598a[_0xf8da('0xa3')]){rpcDb[_0xf8da('0x8c')](_0x5239b7,_0xf8da('0xa2'));}else{rpcDb[_0xf8da('0xa4')](ut[_0xf8da('0xa5')](_0x5239b7,_0xf8da('0x97'),_0x35598a[_0xf8da('0xa0')]),_0x5239b7[_0xf8da('0xa6')],_0x5239b7['activeContact']);}}delete this[_0xf8da('0x6a')][_0x1c3558[_0xf8da('0xa7')]];}else{_0x5239b7['countnosuchnumberretry']++;logger[_0xf8da('0x52')]('actioncountonusuch',_0x5239b7['countnosuchnumberretry']);logger['info']('id',_0x5239b7[_0xf8da('0xa8')]);_0x47a56e[_0xf8da('0xa9')]({'id':_0x5239b7['idContact'],'field':{'countnosuchnumberretry':_0x5239b7[_0xf8da('0x97')]}})[_0xf8da('0x7b')](function(){_0x47a56e[_0xf8da('0xaa')](_0x5239b7,_0x4d0cfe,_0x3df92b)[_0xf8da('0x7b')](function(){});});}});break;case'ANSWER':var _0x4f9075=moment()[_0xf8da('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x5239b7[_0xf8da('0xab')]=_0x4f9075;_0x5239b7['answertime']=_0x4f9075;_0x5239b7['dialAnswer']=!![];_0x35598a[_0xf8da('0x57')]+=0x1;logger['info'](_0xf8da('0xac'),_0x5239b7[_0xf8da('0xad')],_0xf8da('0xae'),_0x35598a[_0xf8da('0x4b')],_0xf8da('0x6b'),_0x35598a['pTalking']);ami['emit']('custom:agentconnect',ut[_0xf8da('0xaf')](_0x5239b7,_0xf8da('0xb0'),this[_0xf8da('0x10')][_0x5239b7[_0xf8da('0x68')]]));if(_0x35598a[_0xf8da('0xb1')]){ami[_0xf8da('0x23')](_0xf8da('0xb2'),ut[_0xf8da('0xb3')](_0x5239b7));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0xf8da('0xaf')](_0x5239b7,_0xf8da('0xb4'),this[_0xf8da('0x10')][_0x5239b7[_0xf8da('0x68')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x5239b7,'complete'));_0x35598a['outboundAnswerCallsDay']+=0x1;_0x35598a[_0xf8da('0x2b')]+=0x1;_0x35598a['answered']+=0x1;ut[_0xf8da('0x73')](_0x35598a,'[16]');_0x5239b7[_0xf8da('0x98')]=ut['totalGlobal'](_0x5239b7);ut[_0xf8da('0x85')](_0x5239b7,0x4,_0xf8da('0xb5'));rpcDb['createCustomerHistory'](_0x5239b7,_0xf8da('0xb6'));rpcDb['createCustomerFinal'](_0x5239b7,_0xf8da('0xb7'));rpcDb['crateCustomerReportQueue'](_0x5239b7);_0x35598a[_0xf8da('0xb8')]+=_0x5239b7[_0xf8da('0xb9')];_0x35598a['sumBillable']+=_0x5239b7[_0xf8da('0xb9')];logger[_0xf8da('0x52')](_0xf8da('0xba'),_0x5239b7['uniqueid'],'\x20Queue',_0x35598a[_0xf8da('0x4b')],_0xf8da('0x6b'),_0x35598a[_0xf8da('0x57')]);delete this[_0xf8da('0x6a')][_0x1c3558['linkedid']];break;case'BUSY':_0x35598a[_0xf8da('0x36')]+=0x1;_0x5239b7[_0xf8da('0xbb')]+=0x1;_0x5239b7[_0xf8da('0x98')]=ut[_0xf8da('0x99')](_0x5239b7);ut['logCustomer'](_0x5239b7,0x5,_0xf8da('0xbc'));_0x4d0cfe=_0x35598a['dialBusyRetryFrequency'];_0x3df92b=_0x35598a[_0xf8da('0xbd')];ami[_0xf8da('0x23')](_0xf8da('0xbe'),ut['buildObj'](_0x5239b7,_0xf8da('0xbf')));rpcDb['createCustomerHistory'](_0x5239b7,_0xf8da('0xc0'));_0x47a56e[_0xf8da('0x9e')](_0x5239b7,'5',_0x35598a)[_0xf8da('0x7b')](function(_0x433458){_0x305320=_0x433458[_0xf8da('0x9f')]==0x1;if(!_0x305320){if(ut[_0xf8da('0x99')](_0x5239b7)>=_0x35598a['dialGlobalMaxRetry']){_0x49467b=ut[_0xf8da('0xc1')](_0x5239b7,0xf,_0xf8da('0xa1'));rpcDb[_0xf8da('0x8c')](_0x49467b,_0xf8da('0xc2'));}else{if(_0x5239b7[_0xf8da('0xbb')]>=_0x35598a[_0xf8da('0xc3')]){rpcDb['createCustomerFinal'](_0x5239b7,_0xf8da('0xc0'));}else{rpcDb[_0xf8da('0xa4')](ut[_0xf8da('0xa5')](_0x5239b7,_0xf8da('0xbb'),_0x35598a[_0xf8da('0xc4')]),_0x5239b7['unlockAgent'],_0x5239b7[_0xf8da('0xc5')]);}}}else{_0x5239b7[_0xf8da('0xbb')]++;_0x47a56e[_0xf8da('0xa9')]({'id':_0x5239b7[_0xf8da('0xa8')],'field':{'countbusyretry':_0x5239b7[_0xf8da('0xbb')]}})['then'](function(){_0x47a56e[_0xf8da('0xaa')](_0x5239b7,_0x4d0cfe,_0x3df92b)[_0xf8da('0x7b')](function(){});});}});break;case _0xf8da('0xc6'):_0x35598a[_0xf8da('0xc7')]+=0x1;_0x5239b7[_0xf8da('0xc8')]+=0x1;_0x5239b7[_0xf8da('0x98')]=ut[_0xf8da('0x99')](_0x5239b7);ut[_0xf8da('0x85')](_0x5239b7,0x3,_0xf8da('0xc9'));_0x4d0cfe=_0x35598a['dialNoAnswerRetryFrequency'];_0x3df92b=_0x35598a[_0xf8da('0xbd')];var _0xbaaada=ut[_0xf8da('0xca')](_0x5239b7,_0x35598a);ami['emit'](_0xf8da('0xcb'),_0xbaaada);rpcDb[_0xf8da('0x8a')](_0x5239b7,'[callProgressDetectingCustomer][logNoAnswer]');_0x47a56e['verifyAdditionalPhones'](_0x5239b7,'3',_0x35598a)[_0xf8da('0x7b')](function(_0x48e2c1){_0x305320=_0x48e2c1[_0xf8da('0x9f')]==0x1;if(!_0x305320){if(ut[_0xf8da('0x99')](_0x5239b7)>=_0x35598a[_0xf8da('0xcc')]){_0x49467b=ut[_0xf8da('0xc1')](_0x5239b7,0xf,_0xf8da('0xa1'));rpcDb['createCustomerFinal'](_0x49467b,_0xf8da('0xcd'));}else{if(_0x5239b7[_0xf8da('0xc8')]>=_0x35598a[_0xf8da('0xce')]){rpcDb['createCustomerFinal'](_0x5239b7,_0xf8da('0xcf'));}else{rpcDb[_0xf8da('0xa4')](ut['scheduledAt'](_0x5239b7,_0xf8da('0xc8'),_0x35598a[_0xf8da('0xd0')]),_0x5239b7[_0xf8da('0xa6')],_0x5239b7[_0xf8da('0xc5')]);}}}else{_0x5239b7['countnoanswerretry']++;_0x47a56e[_0xf8da('0xa9')]({'id':_0x5239b7['idContact'],'field':{'countnoanswerretry':_0x5239b7[_0xf8da('0xc8')]}})['then'](function(){_0x47a56e[_0xf8da('0xaa')](_0x5239b7,_0x4d0cfe,_0x3df92b)['then'](function(){});});}});break;case _0xf8da('0xd1'):_0x35598a[_0xf8da('0x37')]+=0x1;_0x5239b7[_0xf8da('0xd2')]+=0x1;_0x5239b7['countglobal']=ut[_0xf8da('0x99')](_0x5239b7);ut[_0xf8da('0x85')](_0x5239b7,0x8,_0xf8da('0xd3'));_0x4d0cfe=_0x35598a[_0xf8da('0xd4')];_0x3df92b=_0x35598a[_0xf8da('0xbd')];ami['emit']('custom:agentcongestion',ut[_0xf8da('0xaf')](_0x5239b7,_0xf8da('0xd5')));rpcDb[_0xf8da('0x8a')](_0x5239b7,_0xf8da('0xd6'));_0x47a56e[_0xf8da('0x9e')](_0x5239b7,'8',_0x35598a)[_0xf8da('0x7b')](function(_0x49646d){_0x305320=_0x49646d[_0xf8da('0x9f')]==0x1;if(!_0x305320){if(ut[_0xf8da('0x99')](_0x5239b7)>=_0x35598a[_0xf8da('0xcc')]){_0x49467b=ut[_0xf8da('0xc1')](_0x5239b7,0xf,'Global');rpcDb[_0xf8da('0x8c')](_0x49467b,_0xf8da('0xd7'));}else{if(_0x5239b7[_0xf8da('0xd2')]>=_0x35598a['dialCongestionMaxRetry']){rpcDb[_0xf8da('0x8c')](_0x5239b7,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0xf8da('0xa5')](_0x5239b7,'countcongestionretry',_0x35598a[_0xf8da('0xc4')]),_0x5239b7[_0xf8da('0xa6')],_0x5239b7['activeContact']);}}}else{_0x5239b7[_0xf8da('0xd2')]++;_0x47a56e[_0xf8da('0xa9')]({'id':_0x5239b7[_0xf8da('0xa8')],'field':{'countcongestionretry':_0x5239b7[_0xf8da('0xd2')]}})[_0xf8da('0x7b')](function(){_0x47a56e['swapAdditionalPhones'](_0x5239b7,_0x4d0cfe,_0x3df92b)['then'](function(){});});}});break;case _0xf8da('0xd8'):_0x35598a[_0xf8da('0x3c')]+=0x1;_0x5239b7[_0xf8da('0xd9')]+=0x1;_0x5239b7[_0xf8da('0x98')]=ut['totalGlobal'](_0x5239b7);ut[_0xf8da('0x85')](_0x5239b7,0x14,_0xf8da('0xda'));_0x4d0cfe=_0x35598a[_0xf8da('0xdb')];_0x3df92b=_0x35598a[_0xf8da('0xbd')];ami[_0xf8da('0x23')](_0xf8da('0xdc'),ut[_0xf8da('0xaf')](_0x5239b7,_0xf8da('0xdd')));rpcDb[_0xf8da('0x8a')](_0x5239b7,'[syncHangupRequest][logAgentReject]');_0x47a56e[_0xf8da('0x9e')](_0x5239b7,'20',_0x35598a)[_0xf8da('0x7b')](function(_0x343eed){_0x305320=_0x343eed[_0xf8da('0x9f')]==0x1;if(!_0x305320){if(ut[_0xf8da('0x99')](_0x5239b7)>=_0x35598a['dialGlobalMaxRetry']){_0x49467b=ut['cloneAction'](_0x5239b7,0x14,'AgentReject');rpcDb[_0xf8da('0x8c')](_0x49467b,_0xf8da('0xde'));}else{if(_0x5239b7[_0xf8da('0xd9')]>=_0x35598a['dialAgentRejectMaxRetry']){rpcDb[_0xf8da('0x8c')](_0x5239b7,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x5239b7,_0xf8da('0xd9'),_0x35598a['dialAgentRejectRetryFrequency']),_0x5239b7[_0xf8da('0xa6')],_0x5239b7[_0xf8da('0xc5')]);}}}else{_0x5239b7[_0xf8da('0xc8')]++;_0x47a56e['incrementPreviewCounters']({'id':_0x5239b7[_0xf8da('0xa8')],'field':{'countnoanswerretry':_0x5239b7[_0xf8da('0xc8')]}})[_0xf8da('0x7b')](function(){_0x47a56e[_0xf8da('0xaa')](_0x5239b7,_0x4d0cfe,_0x3df92b)[_0xf8da('0x7b')](function(){});});}});break;case'ABANDONED':_0x35598a[_0xf8da('0x3e')]+=0x1;_0x5239b7[_0xf8da('0xdf')]+=0x1;_0x5239b7[_0xf8da('0x98')]=ut['totalGlobal'](_0x5239b7);ut['logCustomer'](_0x5239b7,0xb,_0xf8da('0xe0'));rpcDb[_0xf8da('0x8a')](_0x5239b7,_0xf8da('0xe1'));_0x47a56e[_0xf8da('0x9e')](_0x5239b7,'11',_0x35598a)[_0xf8da('0x7b')](function(_0x467fa2){_0x305320=_0x467fa2[_0xf8da('0x9f')]==0x1;if(!_0x305320){if(ut[_0xf8da('0x99')](_0x5239b7)>=_0x35598a[_0xf8da('0xcc')]){_0x49467b=ut[_0xf8da('0xc1')](_0x5239b7,0xf,_0xf8da('0xa1'));rpcDb[_0xf8da('0x8c')](_0x49467b,_0xf8da('0xe1'));}else{if(_0x5239b7[_0xf8da('0xe2')]>=_0x35598a[_0xf8da('0xe3')]){rpcDb[_0xf8da('0x8c')](_0x5239b7,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0xf8da('0xa5')](_0x5239b7,'countabandonedretry',_0x35598a['dialAbandonedRetryFrequency']),_0x5239b7[_0xf8da('0xa6')],_0x5239b7[_0xf8da('0xc5')]);}}}else{_0x5239b7[_0xf8da('0xc8')]++;_0x47a56e[_0xf8da('0xa9')]({'id':_0x5239b7['idContact'],'field':{'countnoanswerretry':_0x5239b7[_0xf8da('0xc8')]}})[_0xf8da('0x7b')](function(){_0x47a56e[_0xf8da('0xaa')](_0x5239b7,_0x4d0cfe,_0x3df92b)[_0xf8da('0x7b')](function(){});});}});break;case'18':_0x35598a[_0xf8da('0x3d')]+=0x1;_0x5239b7[_0xf8da('0xe4')]+=0x1;_0x5239b7[_0xf8da('0x98')]=ut[_0xf8da('0x99')](_0x5239b7);ut['logCustomer'](_0x5239b7,0x12,_0x1c3558['cause-txt']||_0x1c3558[_0xf8da('0xe5')]);ami[_0xf8da('0x23')](_0xf8da('0xe6'),ut['buildObj'](_0x5239b7,_0xf8da('0xe7')));rpcDb['createCustomerHistory'](_0x5239b7,_0xf8da('0xe8'));_0x47a56e['verifyAdditionalPhones'](_0x5239b7,'18',_0x35598a)['then'](function(_0x492f23){_0x305320=_0x492f23[_0xf8da('0x9f')]==0x1;if(!_0x305320){if(ut['totalGlobal'](_0x5239b7)>=_0x35598a[_0xf8da('0xcc')]){_0x49467b=ut['cloneAction'](_0x5239b7,0x12,'Global');rpcDb[_0xf8da('0x8c')](_0x49467b,_0xf8da('0xe8'));}else{rpcDb['createCustomerFinal'](_0x5239b7,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x5239b7[_0xf8da('0xc8')]++;_0x47a56e[_0xf8da('0xa9')]({'id':_0x5239b7['idContact'],'field':{'countnoanswerretry':_0x5239b7[_0xf8da('0xc8')]}})[_0xf8da('0x7b')](function(){_0x47a56e[_0xf8da('0xaa')](_0x5239b7,_0x4d0cfe,_0x3df92b)[_0xf8da('0x7b')](function(){});});}});delete this[_0xf8da('0x6a')][_0x1c3558[_0xf8da('0xa7')]];break;case'19':_0x35598a['outboundUnknownCallsDay']+=0x1;_0x5239b7[_0xf8da('0x98')]=ut[_0xf8da('0x99')](_0x5239b7);ut[_0xf8da('0x85')](_0x5239b7,0x13,_0x1c3558['cause-txt']||_0x1c3558[_0xf8da('0xe5')]);ami[_0xf8da('0x23')](_0xf8da('0xe6'),ut[_0xf8da('0xaf')](_0x5239b7,_0xf8da('0xe7')));rpcDb[_0xf8da('0x8a')](_0x5239b7,_0xf8da('0xe9'));_0x47a56e['verifyAdditionalPhones'](_0x5239b7,'18',_0x35598a)['then'](function(_0x1dd7ea){_0x305320=_0x1dd7ea[_0xf8da('0x9f')]==0x1;if(!_0x305320){if(ut[_0xf8da('0x99')](_0x5239b7)>=_0x35598a[_0xf8da('0xcc')]){_0x49467b=ut[_0xf8da('0xc1')](_0x5239b7,0xf,_0xf8da('0xa1'));rpcDb['createCustomerFinal'](_0x49467b,_0xf8da('0xe9'));}else{rpcDb[_0xf8da('0x8c')](_0x5239b7,_0xf8da('0xe9'));}}else{_0x5239b7[_0xf8da('0xc8')]++;_0x47a56e[_0xf8da('0xa9')]({'id':_0x5239b7[_0xf8da('0xa8')],'field':{'countnoanswerretry':_0x5239b7[_0xf8da('0xc8')]}})[_0xf8da('0x7b')](function(){_0x47a56e[_0xf8da('0xaa')](_0x5239b7,_0x4d0cfe,_0x3df92b)[_0xf8da('0x7b')](function(){});});}});delete this[_0xf8da('0x6a')][_0x1c3558['linkedid']];break;default:if(_0x5239b7[_0xf8da('0x6c')]){ut['decrementTalkink'](_0x35598a,'[default]');ut[_0xf8da('0x75')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x35598a[_0xf8da('0x4b')],_0x1c3558);}_0x35598a[_0xf8da('0x3d')]+=0x1;_0x5239b7[_0xf8da('0x98')]=ut[_0xf8da('0x99')](_0x5239b7);ut['logCustomer'](_0x5239b7,0xc,_0x1c3558[_0xf8da('0xea')]||_0x1c3558['dialstatus']);_0x4d0cfe=_0x35598a[_0xf8da('0xdb')];_0x3df92b=_0x35598a[_0xf8da('0xbd')];rpcDb[_0xf8da('0x8a')](_0x5239b7,_0xf8da('0xeb'));_0x47a56e[_0xf8da('0x9e')](_0x5239b7,'20',_0x35598a)[_0xf8da('0x7b')](function(_0x246162){_0x305320=_0x246162['additional']==0x1;if(!_0x305320){if(ut[_0xf8da('0x99')](_0x5239b7)>=_0x35598a[_0xf8da('0xcc')]){_0x49467b=ut[_0xf8da('0xc1')](_0x5239b7,0xf,_0xf8da('0xa1'));rpcDb[_0xf8da('0x8c')](_0x49467b,_0xf8da('0xec'));}else{rpcDb[_0xf8da('0x8c')](_0x5239b7,_0xf8da('0xec'));}delete this['actions'][_0x1c3558[_0xf8da('0xa7')]];}else{_0x47a56e[_0xf8da('0xaa')](_0x5239b7,_0x4d0cfe,_0x3df92b)[_0xf8da('0x7b')](function(){});}});}if(!(_0x5239b7[_0xf8da('0x6c')]&&_0x363b66==='16')){ut[_0xf8da('0x72')](_0x35598a,_0xf8da('0xed'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x5239b7[_0xf8da('0xad')],_0xf8da('0xae'),_0x35598a[_0xf8da('0x4b')],_0xf8da('0x69'),_0x35598a[_0xf8da('0x56')]);}if(_0x363b66!==_0xf8da('0xee')){delete this[_0xf8da('0x6a')][_0x1c3558[_0xf8da('0xa7')]];delete this[_0xf8da('0x6a')][_0x1c3558[_0xf8da('0xef')]];}}};Preview[_0xf8da('0xc')][_0xf8da('0xf0')]=function(_0x2c7796,_0x5eb554,_0x329547){if(_[_0xf8da('0xf1')](_0x5eb554)&&'object'!==typeof _0x5eb554){return;}if(_[_0xf8da('0xf1')](_0x329547)&&'object'!==typeof _0x329547){return;}switch(_0x329547['reason']){case'0':ut[_0xf8da('0xf2')](_0x2c7796,0x0,'NoSuchNumber');rpcDb[_0xf8da('0xf3')](_0x2c7796,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xf8da('0xf2')](_0x2c7796,0x3,_0xf8da('0xc9'));rpcDb['createAgentHistory'](_0x2c7796,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xf8da('0xf2')](_0x2c7796,0x5,_0xf8da('0xbc'));rpcDb[_0xf8da('0xf3')](_0x2c7796,_0xf8da('0xf4'));break;case'8':ut[_0xf8da('0xf2')](_0x2c7796,0x8,'Congestion');rpcDb[_0xf8da('0xf3')](_0x2c7796,_0xf8da('0xf5'));break;case'22':ut['logAgent'](_0x2c7796,0x16,_0xf8da('0xf6'));rpcDb[_0xf8da('0xf3')](_0x2c7796,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x2c7796,0xc,_0x329547[_0xf8da('0xf7')]);rpcDb[_0xf8da('0xf3')](_0x2c7796,_0xf8da('0xf5'));}ut[_0xf8da('0x72')](_0x5eb554,'[callProgressDetectingAgent]');logger[_0xf8da('0x52')](_0xf8da('0xf8'),_0x2c7796['uniqueid'],_0xf8da('0xae'),_0x5eb554[_0xf8da('0x4b')],_0xf8da('0x69'),_0x5eb554[_0xf8da('0x56')]);delete this['actions'][_0x2c7796[_0xf8da('0xad')]];};Preview[_0xf8da('0xc')][_0xf8da('0x9e')]=function(_0xf10f07,_0x42bcf9,_0x1f8a94){return Promise['resolve']()[_0xf8da('0x7b')](cmHopperAdditionalPhone[_0xf8da('0x9e')](_0xf10f07,_0x42bcf9,_0x1f8a94))['catch'](logger['info'](_0xf8da('0xf9')));};Preview[_0xf8da('0xc')][_0xf8da('0xaa')]=function(_0x275b1c,_0x57d921,_0x3dade4){return Promise[_0xf8da('0xfa')]()['then'](cmHopperAdditionalPhone[_0xf8da('0xaa')](_0x275b1c,_0x57d921,_0x3dade4))[_0xf8da('0x70')](logger[_0xf8da('0x52')]('[swapAdditionalPhone]\x20'));};Preview[_0xf8da('0xc')]['incrementPreviewCounters']=function(_0x5264b7){return Promise[_0xf8da('0xfa')]()['then'](cmHopperAdditionalPhone[_0xf8da('0xa9')](_0x5264b7))[_0xf8da('0x70')](logger[_0xf8da('0x52')](_0xf8da('0xfb')));};Preview[_0xf8da('0xc')][_0xf8da('0xfc')]=function(_0x544379,_0x33c9c5,_0x20404a,_0x2e0e05,_0x39d377){var _0x4415bc=this;return new Promise(function(_0x431f87,_0x15bd91){if(_[_0xf8da('0xfd')](_0x33c9c5)||_[_0xf8da('0xfd')](_0x33c9c5['Contact'])||_[_0xf8da('0xfd')](_0x33c9c5[_0xf8da('0xfe')])||_[_0xf8da('0xfd')](_0x33c9c5[_0xf8da('0x6d')])){_0x15bd91(ut['message'](_0xf8da('0xff'),_0x2e0e05,_0x39d377));return;}var _0x36025f=uuid['v4']();var _0x42382d=_0x4415bc['campaignsPreview'][_0x33c9c5['Queue'][_0xf8da('0x4b')]];var _0x9dd3e7=_0x20404a?_0x4415bc[_0xf8da('0x13')][_0x20404a]['id']:undefined;_0x4415bc[_0xf8da('0x6a')][_0x36025f]=new Action(_0x33c9c5,_0x42382d,_0x36025f,_0x20404a,_0x9dd3e7);var _0x530500=_0x4415bc['actions'][_0x36025f];_0x530500['unlockAgent']=_0x2e0e05;_0x530500['activeContact']=_0x39d377;_0x530500[_0xf8da('0x100')]=_0x20404a;if(_[_0xf8da('0x101')](_0x544379)){_0x4415bc[_0xf8da('0x102')](_0x530500,_0x42382d,_0x33c9c5,_0x20404a)[_0xf8da('0x7b')](function(_0x2faf12){logger['info'](_0xf8da('0x103'),'Queue:\x20'+_0x530500[_0xf8da('0x68')]+_0xf8da('0x104')+_0x530500[_0xf8da('0xa8')],JSON['stringify'](_0x2faf12));ami[_0xf8da('0x23')](_0xf8da('0x105'),ut[_0xf8da('0xaf')](_0x530500,_0xf8da('0x106'),_0x4415bc[_0xf8da('0x10')][_0x530500['queue']]));_0x431f87(ut['message'](_0xf8da('0x107')));})['catch'](function(_0x600861){ut[_0xf8da('0x5a')](_0xf8da('0x108'),_0x600861);_0x15bd91(ut[_0xf8da('0x59')]('Call\x20failed',_0x2e0e05,_0x39d377));});}else{_0x42382d[_0xf8da('0x35')]+=0x1;ut['logBlacklist'](_0x530500);rpcDb[_0xf8da('0x109')](_0x530500,_0xf8da('0x10a'));delete _0x4415bc[_0xf8da('0x6a')][_0x36025f];_0x15bd91(ut[_0xf8da('0x59')](_0xf8da('0x10b'),_0x2e0e05,_0x39d377));}});};Preview['prototype'][_0xf8da('0x93')]=function(_0x26f149){return!_[_0xf8da('0xfd')](_0x26f149)&&!_[_0xf8da('0xfd')](_0x26f149[_0xf8da('0x4b')])&&!_[_0xf8da('0xfd')](_0x26f149[_0xf8da('0x4c')])&&_0x26f149['active']&&!_[_0xf8da('0xfd')](this[_0xf8da('0x12')][util[_0xf8da('0x54')](_0xf8da('0x10c'),_0x26f149[_0xf8da('0x4b')])])&&!_[_0xf8da('0xfd')](this[_0xf8da('0x12')][util[_0xf8da('0x54')](_0xf8da('0x10c'),_0x26f149[_0xf8da('0x4b')])]['status'])&&(this[_0xf8da('0x12')][util['format']('SIP/%s',_0x26f149[_0xf8da('0x4b')])][_0xf8da('0x10d')]===_0xf8da('0x10e')||this['trunks'][util['format'](_0xf8da('0x10c'),_0x26f149[_0xf8da('0x4b')])]['status']==='unmonitored');};Preview[_0xf8da('0xc')]['run']=function(_0x35f5ed,_0x335a6c){return this[_0xf8da('0x10f')](_0x35f5ed,_0x335a6c)[_0xf8da('0x7b')](function(_0x14c3cd){return _[_0xf8da('0x110')](_0x14c3cd,['message']);})[_0xf8da('0x70')](function(_0x383594){if(_0x383594[_0xf8da('0x111')]){rpcDb[_0xf8da('0x112')](_0x35f5ed);}if(_0x383594[_0xf8da('0x4c')]){rpcDb[_0xf8da('0x82')](_0x35f5ed);}throw _[_0xf8da('0x110')](_0x383594,[_0xf8da('0x59')]);});};Preview[_0xf8da('0xc')][_0xf8da('0x10f')]=function(_0x4c370c,_0x3ca50f){var _0x12bd8a=this;var _0x18de0c,_0x3e3bd0;return rpcDb[_0xf8da('0x113')](_0x4c370c)['then'](function(_0x70a88b){if(!_['isNil'](_0x70a88b[0x0])){_0x3e3bd0=_0x70a88b[0x0]['recallme']?![]:!![];_0x18de0c=_0x70a88b[0x0][_0xf8da('0x114')]?!![]:![];_0x18de0c=_0x3ca50f?!![]:_0x18de0c;}var _0x5c3862=_0x12bd8a['validateContact'](_0x70a88b);if(_0x5c3862['isValid']){rpcDb[_0xf8da('0x115')](_[_0xf8da('0x110')](_0x70a88b[0x0],[_0xf8da('0x6d'),'phone']))['then'](function(_0x32c0df){_0x12bd8a[_0xf8da('0xfc')](_0x32c0df,_0x70a88b[0x0],_0x3ca50f,_0x3e3bd0,_0x18de0c)[_0xf8da('0x7b')](function(_0x215672){return _0x215672;})['catch'](function(_0x2422e6){throw _0x2422e6;});})[_0xf8da('0x70')](function(_0x1b8d23){ut[_0xf8da('0x5a')](_0xf8da('0x116'),_0x1b8d23);throw ut[_0xf8da('0x59')](_0xf8da('0x117'),_0x3e3bd0,_0x18de0c);});}else{throw ut[_0xf8da('0x59')](_0x5c3862[_0xf8da('0x59')],_0x3e3bd0,_0x18de0c);}})[_0xf8da('0x70')](function(_0x339e7f){ut[_0xf8da('0x5a')]('[Preview][getContactPreview]',_0x339e7f);throw ut['message'](_0xf8da('0x117'),![],!![]);});};Preview[_0xf8da('0xc')][_0xf8da('0x118')]=function(_0x437901){if(_[_0xf8da('0xfd')](_0x437901)||_[_0xf8da('0x101')](_0x437901)||!_[_0xf8da('0xfd')](_0x437901[0x0]['Agent'])&&_[_0xf8da('0xfd')](_0x437901[0x0][_0xf8da('0x7e')][_0xf8da('0x4b')])){ut[_0xf8da('0x5a')](_0xf8da('0x119'),_0x437901);return{'isValid':![],'message':_0xf8da('0x11a')};}var _0x300226=this['campaignsPreview'][_0x437901[0x0]['Queue']['name']];_0x300226[_0xf8da('0x59')]=_0xf8da('0x96');if(_[_0xf8da('0xfd')](_0x300226)){ut['logger'](_0xf8da('0x11b'),_0x300226);return{'isValid':![],'message':_0xf8da('0x11c')};}if(!this[_0xf8da('0x93')](_0x300226['Trunk'])){ut['logger'](_0xf8da('0x11d'),_0xf8da('0x11e')+_0x300226[_0xf8da('0x4b')]+_0xf8da('0x11f'));if(!this[_0xf8da('0x93')](_0x300226[_0xf8da('0x94')])){ut[_0xf8da('0x5a')](_0xf8da('0x11d'),_0x300226[_0xf8da('0x4b')]+_0xf8da('0x120'));return{'isValid':![],'message':_0xf8da('0x121')};}}if(!ut[_0xf8da('0x91')](_0x300226['dialActive'])){ut[_0xf8da('0x5a')]('[Preview][validateContact][Campaign\x20Active]',_0x300226[_0xf8da('0x4b')]+_0xf8da('0x122'));return{'isValid':![],'message':_0xf8da('0x11e')+_0x300226[_0xf8da('0x4b')]+_0xf8da('0x122')};}return{'isValid':!![],'message':_0xf8da('0x123')};};Preview[_0xf8da('0xc')][_0xf8da('0x102')]=function(_0x270c73,_0x4e5a21,_0x62c029,_0x2c4155){var _0x7e83ce=this;return new Promise(function(_0x158602,_0x4a5058){var _0x1faaa2=_0x270c73[_0xf8da('0xad')];var _0x42dc30=_0x7e83ce[_0xf8da('0x93')](_0x4e5a21[_0xf8da('0x4a')])?util[_0xf8da('0x54')](_0xf8da('0x124'),_0x4e5a21[_0xf8da('0x4a')][_0xf8da('0x4b')],_[_0xf8da('0xfd')](_0x4e5a21[_0xf8da('0x32')])?'':_0x4e5a21[_0xf8da('0x32')][_0xf8da('0x125')]()||'',_0x4e5a21['dialCutDigit']>0x0?_0x62c029[_0xf8da('0xfe')][_0xf8da('0x126')](_0x4e5a21[_0xf8da('0x127')]):_0x62c029[_0xf8da('0xfe')]):util['format']('SIP/%s/%s%s',_[_0xf8da('0xfd')](_0x4e5a21['TrunkBackup'])?_0x4e5a21[_0xf8da('0x4a')][_0xf8da('0x4b')]:_0x4e5a21[_0xf8da('0x94')][_0xf8da('0x4b')],_['isNil'](_0x4e5a21[_0xf8da('0x32')])?'':_0x4e5a21['dialPrefix'][_0xf8da('0x125')]()||'',_0x4e5a21[_0xf8da('0x127')]>0x0?_0x62c029['phone'][_0xf8da('0x126')](_0x4e5a21[_0xf8da('0x127')]):_0x62c029[_0xf8da('0xfe')]);var _0x2da77a=_0x7e83ce[_0xf8da('0x93')](_0x4e5a21['Trunk'])?ut[_0xf8da('0x128')](_0x4e5a21['Trunk']['callerid'],_0x4e5a21[_0xf8da('0x30')],_0x4e5a21['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x4e5a21[_0xf8da('0x129')],_0x4e5a21[_0xf8da('0x12a')]):_0x4e5a21[_0xf8da('0x129')]):ut['getCallerId'](_[_0xf8da('0xfd')](_0x4e5a21['TrunkBackup'])?_0x4e5a21[_0xf8da('0x4a')][_0xf8da('0x4d')]:_0x4e5a21[_0xf8da('0x94')][_0xf8da('0x4d')],_0x4e5a21[_0xf8da('0x30')],_0x4e5a21[_0xf8da('0x12a')]>0x0?ut[_0xf8da('0x12b')](_0x4e5a21[_0xf8da('0x129')],_0x4e5a21[_0xf8da('0x12a')]):_0x4e5a21['dialOriginateCallerIdNumber']);if(_0x2da77a){_0x270c73['originatecalleridname']=ut[_0xf8da('0x12c')](_0x2da77a);_0x270c73['originatecalleridnum']=ut['extractCalleridNumber'](_0x2da77a);}var _0x3a9cbc=ut['addVariables'](_0x4e5a21,_0x62c029,_0x42dc30,_0x2da77a,_0x1faaa2,_0x270c73);_[_0xf8da('0x12d')](_0x270c73,ut[_0xf8da('0x12e')](_0x3a9cbc));_0x270c73[_0xf8da('0x83')]=moment()[_0xf8da('0x54')](_0xf8da('0x84'));_0x4e5a21[_0xf8da('0x12f')]=_0x3a9cbc;ami[_0xf8da('0x130')](ut[_0xf8da('0x131')](_0x270c73,_0x4e5a21,_0x3a9cbc,_0x270c73[_0xf8da('0xc5')],_0x2c4155))[_0xf8da('0x7b')](function(_0x4be59f){_0x4e5a21[_0xf8da('0x56')]+=0x1;logger[_0xf8da('0x52')]('[originated][increment]',_0x1faaa2,_0xf8da('0xae'),_0x4e5a21['name'],'originated:\x20',_0x4e5a21[_0xf8da('0x56')]);_0x158602(_0x4be59f);})[_0xf8da('0x70')](function(_0x38b8a3){ut[_0xf8da('0xf2')](_0x270c73,0xe,_0xf8da('0x132'));rpcDb['createAgentHistory'](_0x270c73,'[originateFailure][logOriginateFailure]');_0x4a5058(_0x38b8a3);});});};Preview[_0xf8da('0xc')][_0xf8da('0x1d')]=function(_0x1809ac){if(this[_0xf8da('0x6a')][_0x1809ac[_0xf8da('0xa7')]]){this['actions'][_0x1809ac[_0xf8da('0xa7')]][_0xf8da('0x6f')]=_0x1809ac[_0xf8da('0x6f')];}};Preview[_0xf8da('0xc')][_0xf8da('0x16')]=function(_0x875f25){var _0x105a5c=this;var _0x278601=this[_0xf8da('0x6a')][_0x875f25[_0xf8da('0x133')]];if(_0x278601){if(_0x278601['lookAgent']&&this['agents'][_0x278601[_0xf8da('0x100')]]){ut['logLookAgent'](_0x278601,this['agents'][_0x278601[_0xf8da('0x100')]][_0xf8da('0x4b')],this[_0xf8da('0x13')][_0x278601[_0xf8da('0x100')]]['id']);}var _0x1d9781=_['clone'](_0x278601);_0x1d9781[_0xf8da('0xab')]=moment()[_0xf8da('0x54')]('YYYY-MM-DD\x20HH:mm:ss');var _0x35af11=_0x105a5c[_0xf8da('0x10')][_0x278601[_0xf8da('0x68')]];if(ut[_0xf8da('0x134')](_0x875f25[_0xf8da('0x135')])){if(_0x278601[_0xf8da('0xa6')]){rpcDb['unlockContact'](_0x278601[_0xf8da('0xa8')]);}if(_0x278601[_0xf8da('0xc5')]){rpcDb[_0xf8da('0x82')](_0x278601[_0xf8da('0xa8')]);}ami[_0xf8da('0x23')](_0xf8da('0x136'),ut['buildObj'](_0x278601,'rejected',this[_0xf8da('0x10')][_0x278601['queue']]));this['callProgressDetectingAgent'](_0x1d9781,_0x35af11,_0x875f25);}else{_0x278601[_0xf8da('0x83')]=moment()[_0xf8da('0x54')](_0xf8da('0x84'));ut['logAgent'](_0x1d9781,0x4,_0xf8da('0xb5'));rpcDb[_0xf8da('0xf3')](_0x1d9781,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xf8da('0xc')]['syncHangup']=function(_0x492f3e){var _0x2f9fbe=this[_0xf8da('0x6a')][_0x492f3e[_0xf8da('0xa7')]];var _0x1a0c72;if(_0x2f9fbe){_0x1a0c72=this[_0xf8da('0x10')][_0x2f9fbe[_0xf8da('0x68')]];logger[_0xf8da('0x52')](_0xf8da('0x137'),_0x492f3e['linkedid'],_0xf8da('0xae'),_0x1a0c72['name'],'pTalking:\x20',_0x1a0c72[_0xf8da('0x57')]);}if(this[_0xf8da('0x6a')][_0x492f3e['linkedid']]&&_0x492f3e['linkedid']!==_0x492f3e[_0xf8da('0xad')]){if(_0x492f3e[_0xf8da('0x138')]==='16'&&this[_0xf8da('0x6a')][_0x492f3e[_0xf8da('0xa7')]][_0xf8da('0x6c')]){this[_0xf8da('0x139')](_0x492f3e,_0x492f3e[_0xf8da('0xa7')],_0x492f3e[_0xf8da('0x138')]);}else if(this[_0xf8da('0x6a')][_0x492f3e[_0xf8da('0xa7')]][_0xf8da('0x6c')]){logger[_0xf8da('0x52')](_0xf8da('0x13a'),_0x492f3e[_0xf8da('0xa7')],_0x492f3e['cause'],'\x20Queue',_0x1a0c72[_0xf8da('0x4b')],_0xf8da('0x6b'),_0x1a0c72[_0xf8da('0x57')]);this[_0xf8da('0x139')](_0x492f3e,_0x492f3e[_0xf8da('0xa7')],_0x492f3e[_0xf8da('0x138')]);}}else if(_0x2f9fbe&&_[_0xf8da('0xfd')](_0x2f9fbe[_0xf8da('0x13b')])&&_0x1a0c72['dialQueueProject']&&_0x492f3e[_0xf8da('0xa7')]===_0x492f3e[_0xf8da('0xad')]&&_['isNil'](_0x492f3e[_0xf8da('0xf7')])&&_0x492f3e[_0xf8da('0x138')]==='16'&&_0x492f3e[_0xf8da('0x13c')]==='6'&&_[_0xf8da('0xf1')](_0x2f9fbe['transfer'])){if(_0x2f9fbe[_0xf8da('0xa6')]){rpcDb['unlockContact'](_0x2f9fbe[_0xf8da('0xa8')]);}if(_0x2f9fbe[_0xf8da('0xc5')]){rpcDb[_0xf8da('0x82')](_0x2f9fbe[_0xf8da('0xa8')]);}_0x492f3e[_0xf8da('0xf7')]='22';this[_0xf8da('0xf0')](_0x2f9fbe,_0x1a0c72,_0x492f3e);}else if(_0x2f9fbe&&_0x2f9fbe[_0xf8da('0x13d')]){if(_0x492f3e['cause']==='16'&&this['actions'][_0x492f3e[_0xf8da('0xa7')]]['dialAnswer']){logger['info'](_0xf8da('0x13e'),_0x492f3e[_0xf8da('0xa7')],_0x492f3e['cause'],_0xf8da('0xae'),_0x1a0c72['name'],'pTalking:\x20',_0x1a0c72[_0xf8da('0x57')]);this[_0xf8da('0x139')](_0x492f3e,_0x492f3e[_0xf8da('0xa7')],_0x492f3e[_0xf8da('0x138')]);}else if(this['actions'][_0x492f3e[_0xf8da('0xa7')]][_0xf8da('0x6c')]){logger['info'](_0xf8da('0x13a'),_0x492f3e[_0xf8da('0xa7')],_0x492f3e[_0xf8da('0x138')],_0xf8da('0xae'),_0x1a0c72[_0xf8da('0x4b')],_0xf8da('0x6b'),_0x1a0c72['pTalking']);this[_0xf8da('0x139')](_0x492f3e,_0x492f3e[_0xf8da('0xa7')],_0x492f3e['cause']);}}};Preview['prototype'][_0xf8da('0x1c')]=function(_0x1a2af4){if(this[_0xf8da('0x6a')][_0x1a2af4['destlinkedid']]&&_0x1a2af4[_0xf8da('0xef')]!==_0x1a2af4[_0xf8da('0x13f')]){this[_0xf8da('0x139')](_0x1a2af4,_0x1a2af4[_0xf8da('0xef')],_0x1a2af4['dialstatus']);}};Preview[_0xf8da('0xc')][_0xf8da('0x1a')]=function(_0x2a1c0c){if(this[_0xf8da('0x6a')][_0x2a1c0c[_0xf8da('0xa7')]]&&_0x2a1c0c[_0xf8da('0xa7')]!==_0x2a1c0c['uniqueid']&&!this['actions'][_0x2a1c0c[_0xf8da('0xa7')]][_0xf8da('0x6c')]){if(_0x2a1c0c[_0xf8da('0x138')]==='1'){this[_0xf8da('0x139')](_0x2a1c0c,_0x2a1c0c[_0xf8da('0xa7')],_0x2a1c0c['cause']);}}};Preview[_0xf8da('0xc')]['addVariable']=function(_0x454f66,_0x552f31,_0x565e00){if(this[_0xf8da('0x6a')][_0x454f66]){if(_['isNil'](this['actions'][_0x454f66][_0xf8da('0x12f')])){this[_0xf8da('0x6a')][_0x454f66][_0xf8da('0x12f')]={};}this[_0xf8da('0x6a')][_0x454f66][_0xf8da('0x12f')][_0x552f31]=_0x565e00;}};Preview[_0xf8da('0xc')]['syncVarSet']=function(_0x9712d2){try{if(!_[_0xf8da('0xfd')](_0x9712d2)){if(ut[_0xf8da('0x140')](_['keys'](_0x9712d2['variable'])[0x0])){this[_0xf8da('0x141')](_0x9712d2['uniqueid'],_[_0xf8da('0x142')](_0x9712d2['variable'])[0x0],_0x9712d2['value']);}}}catch(_0x7db38c){logger[_0xf8da('0x143')](_0xf8da('0x144'),util['inspect'](_0x7db38c,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x26337d){if(_0x26337d){if(this[_0xf8da('0x6a')][_0x26337d['transfertargetlinkedid']]){this['actions'][_0x26337d[_0xf8da('0x145')]][_0xf8da('0x13d')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x18fee7){if(_0x18fee7){if(this[_0xf8da('0x6a')][_0x18fee7[_0xf8da('0x146')]]){this[_0xf8da('0x6a')][_0x18fee7[_0xf8da('0x146')]][_0xf8da('0x13d')]=!![];}}};module[_0xf8da('0x147')]=Preview; \ No newline at end of file +var _0x5430=['paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','logger','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','dialPreviewAutoRecallMe','recallMe','enqueue','isNil','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','pTalking','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','clearZombieChannel','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','idContact','incrementPreviewCounters','swapAdditionalPhones','responsetime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','scheduledAt','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','originated','ANSWER','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','Congestion','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','unlock','unlockContact','disableContact','recallme','validateContact','isValid','checkIsBlackList','checkInBlack','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','syncDialEnd','destlinkedid','destuniqueid','addVariable','variables','filterKey','variable','keys','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','md5','ioredis','preview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','defaults','redis','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available'];(function(_0x47610d,_0x4d2880){var _0x5d9f7d=function(_0x137bce){while(--_0x137bce){_0x47610d['push'](_0x47610d['shift']());}};_0x5d9f7d(++_0x4d2880);}(_0x5430,0x10c));var _0x0543=function(_0x464b33,_0x5986c0){_0x464b33=_0x464b33-0x0;var _0x2560af=_0x5430[_0x464b33];return _0x2560af;};'use strict';var util=require(_0x0543('0x0'));var _=require(_0x0543('0x1'));var uuid=require(_0x0543('0x2'));var moment=require(_0x0543('0x3'));var md5=require(_0x0543('0x4'));var Redis=require(_0x0543('0x5'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x0543('0x6'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0x0543('0x7'));var rpcDb=require(_0x0543('0x8'));var cmHopperAdditionalPhone=require(_0x0543('0x9'));var Action=require(_0x0543('0xa'));var ut=require(_0x0543('0xb'));config['redis']=_[_0x0543('0xc')](config[_0x0543('0xd')],{'host':_0x0543('0xe'),'port':0x18eb});var io=require(_0x0543('0xf'))(new Redis(config[_0x0543('0xd')]));var Sequence=function(){};Sequence[_0x0543('0x10')]['enqueue']=function(_0x1ed7cc){this[_0x0543('0x11')]=this['tail']?this[_0x0543('0x11')][_0x0543('0x12')](_0x1ed7cc):_0x1ed7cc();};function Preview(_0x2bb810){this[_0x0543('0x13')]=new Sequence();this[_0x0543('0x14')]=_0x2bb810[_0x0543('0x15')];this[_0x0543('0x16')]=_0x2bb810[_0x0543('0x16')];this[_0x0543('0x17')]={};this[_0x0543('0x18')]=_0x2bb810[_0x0543('0x18')];this[_0x0543('0x19')]=0x0;ami['on']('originateresponse',this[_0x0543('0x1a')][_0x0543('0x1b')](this));ami['on']('hangup',this['syncHangup'][_0x0543('0x1b')](this));ami['on'](_0x0543('0x1c'),this[_0x0543('0x1d')][_0x0543('0x1b')](this));ami['on'](_0x0543('0x1e'),this['syncDialEnd'][_0x0543('0x1b')](this));ami['on'](_0x0543('0x1f'),this[_0x0543('0x20')][_0x0543('0x1b')](this));ami['on'](_0x0543('0x21'),this[_0x0543('0x22')][_0x0543('0x1b')](this));ami['on']('attendedtransfer',this[_0x0543('0x23')]['bind'](this));ami['on']('blindtransfer',this[_0x0543('0x24')][_0x0543('0x1b')](this));this[_0x0543('0x25')](this['campaignsPreview']);}function emit(_0x3f0452,_0x51c271,_0x401da5){io['to'](_0x3f0452)[_0x0543('0x26')](_0x51c271,_0x401da5);}function emitCampaignPreview(_0x543677){if(_0x543677[_0x0543('0x27')]===_0x0543('0x28')){var _0x427919={'id':_0x543677['id'],'name':_0x543677[_0x0543('0x29')],'strategy':_0x543677[_0x0543('0x2a')],'answered':_0x543677[_0x0543('0x2b')],'available':_0x543677['available'],'loggedIn':_0x543677['loggedIn'],'pTalking':_0x543677['pTalking'],'sumBillable':_0x543677[_0x0543('0x2c')],'sumDuration':_0x543677[_0x0543('0x2d')],'sumHoldTime':_0x543677[_0x0543('0x2e')]||0x0,'talking':_0x543677[_0x0543('0x2f')],'total':_0x543677[_0x0543('0x30')],'type':_0x543677[_0x0543('0x27')],'unmanaged':_0x543677[_0x0543('0x31')],'abandoned':_0x543677[_0x0543('0x32')],'waiting':_0x543677[_0x0543('0x33')],'loggedInDb':_0x543677[_0x0543('0x34')],'dialActive':_0x543677[_0x0543('0x35')],'dialMethod':_0x543677[_0x0543('0x36')],'dialOriginateCallerIdName':_0x543677['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x543677[_0x0543('0x37')],'dialOriginateTimeout':_0x543677[_0x0543('0x38')],'dialPrefix':_0x543677[_0x0543('0x39')],'outboundAnswerAgiCallsDay':_0x543677['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x543677[_0x0543('0x3a')],'outboundBlacklistCallsDay':_0x543677[_0x0543('0x3b')],'outboundBusyCallsDay':_0x543677[_0x0543('0x3c')],'outboundCongestionCallsDay':_0x543677[_0x0543('0x3d')],'outboundDropCallsDayACS':_0x543677['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x543677[_0x0543('0x3e')],'outboundDropCallsDayTimeout':_0x543677[_0x0543('0x3f')],'outboundNoAnswerCallsDay':_0x543677['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x543677['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x543677[_0x0543('0x40')],'outboundReCallsDay':_0x543677[_0x0543('0x41')],'outboundRejectCallsDay':_0x543677['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x543677[_0x0543('0x42')],'outboundAbandonedCallsDay':_0x543677[_0x0543('0x43')],'predictiveIntervalAnsweredCalls':_0x543677[_0x0543('0x44')],'predictiveIntervalAvgHoldtime':_0x543677[_0x0543('0x45')],'predictiveIntervalAvgTalktime':_0x543677[_0x0543('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x543677[_0x0543('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x543677[_0x0543('0x48')],'predictiveIntervalErlangCalls':_0x543677['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x543677[_0x0543('0x49')],'predictiveIntervalHitRate':_0x543677['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x543677[_0x0543('0x4a')],'predictiveIntervalPauses':_0x543677[_0x0543('0x4b')],'predictiveIntervalAvailable':_0x543677[_0x0543('0x4c')],'predictiveIntervalTotalCalls':_0x543677[_0x0543('0x4d')],'message':_0x543677[_0x0543('0x4e')],'originated':_0x543677['originated'],'erlangCalls':_0x543677[_0x0543('0x4f')],'erlangCallToSecond':_0x543677['erlangCallToSecond'],'erlangAbandonmentRate':_0x543677[_0x0543('0x50')],'erlangBusyFactor':_0x543677[_0x0543('0x51')],'startPredictive':_0x543677[_0x0543('0x52')],'startProgressive':_0x543677[_0x0543('0x53')]};if(_0x543677['Trunk']){_0x427919[_0x0543('0x54')]={'id':_0x543677['Trunk']['id'],'name':_0x543677[_0x0543('0x54')][_0x0543('0x29')],'active':_0x543677[_0x0543('0x54')][_0x0543('0x55')],'callerid':_0x543677[_0x0543('0x54')][_0x0543('0x56')]};}if(_0x543677[_0x0543('0x57')]){_0x427919[_0x0543('0x57')]={'id':_0x543677[_0x0543('0x57')]['id'],'name':_0x543677[_0x0543('0x57')]['name']};}var _0x2bd920=md5(JSON[_0x0543('0x58')](_0x427919));if(_0x543677['md5']!==_0x2bd920){_0x543677[_0x0543('0x4')]=_0x2bd920;emit(util['format'](_0x0543('0x59'),_0x427919[_0x0543('0x29')]),'voice_queue:save',_0x427919);}}}function emitVoiceQueueChannelRemove(_0x5e8800){logger[_0x0543('0x5a')](_0x0543('0x5b'),JSON['stringify'](_0x5e8800));emit(util[_0x0543('0x5c')](_0x0543('0x59'),_0x5e8800['name']),_0x0543('0x5d'),_0x5e8800);io[_0x0543('0x26')](_0x0543('0x5e'),_0x5e8800);}function notSendMessagesQueue(_0x117982){if(_0x117982[_0x0543('0x5f')]){if(_0x117982['originated']===0x0&&_0x117982['pTalking']===0x0){_0x117982['sendMessageOneNotActive']=![];_0x117982[_0x0543('0x60')]=0x0;_0x117982[_0x0543('0x61')]=0x0;_0x117982[_0x0543('0x4e')]=_0x0543('0x62');ut['logger'](_0x0543('0x63'),_0x117982[_0x0543('0x29')]+_0x0543('0x64'));}else{_0x117982[_0x0543('0x4e')]=_0x0543('0x65');ut[_0x0543('0x66')](_0x0543('0x63'),_0x117982['name']+_0x0543('0x67'));}emitCampaignPreview(_0x117982);}}Preview[_0x0543('0x10')][_0x0543('0x25')]=function(){var _0x1b38bc=this;setInterval(function(){_0x1b38bc[_0x0543('0x68')]();},0x7cf);};Preview[_0x0543('0x10')]['syncCampaigns']=function(){var _0x53dfb8=this[_0x0543('0x14')];this[_0x0543('0x19')]+=0x1;for(var _0x1e4818 in _0x53dfb8){if(_0x53dfb8[_0x0543('0x69')](_0x1e4818)&&(_0x53dfb8[_0x1e4818][_0x0543('0x36')]===_0x0543('0x6')||_0x53dfb8[_0x1e4818][_0x0543('0x36')]===_0x0543('0x6a'))&&_0x53dfb8[_0x1e4818][_0x0543('0x27')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x0543('0x19')]=0x0;this[_0x0543('0x6b')]();}}if(_0x53dfb8['hasOwnProperty'](_0x1e4818)&&_0x53dfb8[_0x1e4818]['dialMethod']===_0x0543('0x6')&&_0x53dfb8[_0x1e4818][_0x0543('0x27')]==='outbound'){if(_0x53dfb8[_0x1e4818][_0x0543('0x35')]){this['setMessage'](_0x53dfb8[_0x1e4818]);if(_0x53dfb8[_0x1e4818][_0x0543('0x6c')])this[_0x0543('0x6d')](_0x53dfb8[_0x1e4818]);}else{notSendMessagesQueue(_0x53dfb8[_0x1e4818]);}}}};Preview['prototype']['clearZombieChannel']=function(_0xd95442){var _0x5383c2=this;this[_0x0543('0x13')][_0x0543('0x6e')](function(){if(!_[_0x0543('0x6f')](_0x5383c2[_0x0543('0x17')][_0xd95442])){loggerAction[_0x0543('0x5a')](_0x0543('0x70'),_0xd95442,'Queue',_0x5383c2[_0x0543('0x17')][_0xd95442][_0x0543('0x71')],_0x0543('0x72'),JSON[_0x0543('0x58')](_0x5383c2[_0x0543('0x14')][_0x5383c2['actions'][_0xd95442][_0x0543('0x71')]]['originated']),_0x0543('0x73'),JSON[_0x0543('0x58')](_0x5383c2[_0x0543('0x14')][_0x5383c2[_0x0543('0x17')][_0xd95442][_0x0543('0x71')]][_0x0543('0x74')]),JSON['stringify'](_0x5383c2['actions'][_0xd95442]['dialAnswer']),JSON[_0x0543('0x58')](_[_0x0543('0x75')](_0x5383c2['actions'][_0xd95442],[_0x0543('0x76'),_0x0543('0x77'),_0x0543('0x78'),_0x0543('0x79')])));return ami[_0x0543('0x7a')]({'action':_0x0543('0x7b'),'channel':_0x5383c2['actions'][_0xd95442][_0x0543('0x7c')]})[_0x0543('0x7d')](function(_0x2b4abd){if(_0x2b4abd[_0x0543('0x4e')]===_0x0543('0x7e')){setTimeout(function(){if(_0x5383c2[_0x0543('0x17')][_0xd95442]){ut[_0x0543('0x7f')](_0x5383c2[_0x0543('0x14')][_0x5383c2[_0x0543('0x17')][_0xd95442][_0x0543('0x71')]],_0x0543('0x80'));if(_0x5383c2[_0x0543('0x17')][_0xd95442][_0x0543('0x81')]===!![]){ut[_0x0543('0x82')](_0x5383c2['campaignsPreview'][_0x5383c2[_0x0543('0x17')][_0xd95442][_0x0543('0x71')]],_0x0543('0x80'));ut[_0x0543('0x83')](_0x0543('0x84')+_0xd95442,_0x5383c2[_0x0543('0x17')][_0xd95442][_0x0543('0x71')]);}ut[_0x0543('0x83')](_0x0543('0x85')+_0xd95442,_0x5383c2[_0x0543('0x17')][_0xd95442][_0x0543('0x71')]);delete _0x5383c2[_0x0543('0x17')][_0xd95442];}},0x2328);}});}});};Preview[_0x0543('0x10')][_0x0543('0x6b')]=function(){var _0x1dd874=this;loggerAction['info'](_0x0543('0x86'),_[_0x0543('0x87')](this['actions']));for(var _0x59eea9 in this[_0x0543('0x17')]){if(_0x1dd874[_0x0543('0x17')]['hasOwnProperty'](_0x59eea9)){_0x1dd874[_0x0543('0x88')](_0x59eea9);}}};Preview['prototype'][_0x0543('0x6d')]=function(_0x4f58a4){var _0x31aea7=this;rpcDb['getContactRecallMe'](_0x4f58a4['id'],ut[_0x0543('0x89')](this[_0x0543('0x18')]))[_0x0543('0x8a')](function(_0x5e6b95){if(!_[_0x0543('0x6f')](_0x5e6b95)){for(var _0x1a569b=0x0;_0x1a569b<_0x5e6b95[_0x0543('0x8b')];_0x1a569b+=0x1){if(ut[_0x0543('0x8c')](_0x5e6b95[_0x1a569b][_0x0543('0x8d')])<_0x4f58a4[_0x0543('0x8e')]*0x3c){if(_0x5e6b95[_0x1a569b][_0x0543('0x8f')]&&!_0x5e6b95[_0x1a569b][_0x0543('0x8f')][_0x0543('0x90')]){_0x31aea7[_0x0543('0x91')](_0x5e6b95[_0x1a569b]['id'])[_0x0543('0x8a')](ut[_0x0543('0x92')](_0x0543('0x93')))[_0x0543('0x7d')](ut[_0x0543('0x92')]('[RecallMe]'));}else{rpcDb['disableContact'](_0x5e6b95[_0x1a569b]['id']);}}else{var _0x356b36=new Action(_0x5e6b95[_0x1a569b],_0x4f58a4);_0x356b36[_0x0543('0x94')]=moment()[_0x0543('0x5c')](_0x0543('0x95'));_0x4f58a4[_0x0543('0x41')]+=0x1;ut[_0x0543('0x96')](_0x356b36,0x17,_0x0543('0x97'));if(_0x4f58a4[_0x0543('0x98')]){rpcDb[_0x0543('0x99')](ut['createBody'](_0x5e6b95[_0x1a569b]));rpcDb[_0x0543('0x9a')](_0x356b36,_0x0543('0x9b'));}else{ut[_0x0543('0x96')](_0x356b36,0x16,_0x0543('0x9c'));rpcDb['createCustomerHistory'](_0x356b36,_0x0543('0x9d'));rpcDb[_0x0543('0x9e')](_0x356b36,_0x0543('0x9d'));}}}}})['catch'](ut['logger2'](_0x0543('0x9f')));};Preview[_0x0543('0x10')][_0x0543('0xa0')]=function(_0x5311b7){_0x5311b7[_0x0543('0x5f')]=!![];if(ut[_0x0543('0xa1')](_0x5311b7[_0x0543('0xa2')])){_0x5311b7['message']=_0x0543('0xa3');}else if(!ut[_0x0543('0xa4')](_0x5311b7[_0x0543('0x35')])){_0x5311b7[_0x0543('0x4e')]=_0x0543('0x62');}else if(!this[_0x0543('0xa5')](_0x5311b7[_0x0543('0x54')])){if(!this[_0x0543('0xa5')](_0x5311b7[_0x0543('0xa6')])){_0x5311b7[_0x0543('0x4e')]=_0x0543('0xa7');}else{_0x5311b7[_0x0543('0x4e')]=_0x0543('0xa8');}}else{_0x5311b7[_0x0543('0x4e')]='ACTIVE';}emitCampaignPreview(_0x5311b7);};Preview['prototype'][_0x0543('0xa9')]=function(_0x1f767c,_0x3a6d64,_0x2ee541){var _0x54ab46=this;var _0xcf969f=this['actions'][_0x3a6d64];var _0x1e1fc0=this[_0x0543('0x14')][_0xcf969f[_0x0543('0x71')]];var _0x5bd53d;var _0x5cb8ce=![];var _0x1671b2=0x2;var _0x537b7d=0x3;if(_0x1e1fc0){switch(_0x2ee541){case'1':_0x1e1fc0['outboundNoSuchCallsDay']+=0x1;_0xcf969f[_0x0543('0xaa')]+=0x1;_0xcf969f[_0x0543('0xab')]=ut[_0x0543('0xac')](_0xcf969f);ut[_0x0543('0x96')](_0xcf969f,0x0,_0x0543('0xad'));ami[_0x0543('0x26')](_0x0543('0xae'),ut[_0x0543('0xaf')](_0xcf969f,_0x0543('0xb0')));rpcDb['createCustomerHistory'](_0xcf969f,_0x0543('0xb1'));_0x54ab46[_0x0543('0xb2')](_0xcf969f,'0',_0x1e1fc0)[_0x0543('0x8a')](function(_0x2e081e){_0x5cb8ce=_0x2e081e[_0x0543('0xb3')]==0x1;_0x1671b2=_0x1e1fc0['dialNoSuchNumberRetryFrequency'];_0x537b7d=_0x1e1fc0[_0x0543('0xb4')];if(!_0x5cb8ce){if(ut['totalGlobal'](_0xcf969f)>=_0x1e1fc0[_0x0543('0xb5')]){_0x5bd53d=ut[_0x0543('0xb6')](_0xcf969f,0xf,_0x0543('0xb7'));rpcDb[_0x0543('0x9e')](_0x5bd53d,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0xcf969f[_0x0543('0xaa')]>=_0x1e1fc0[_0x0543('0xb8')]){rpcDb[_0x0543('0x9e')](_0xcf969f,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x0543('0xb9')](ut['scheduledAt'](_0xcf969f,_0x0543('0xaa'),_0x1e1fc0[_0x0543('0xba')]),_0xcf969f[_0x0543('0xbb')],_0xcf969f[_0x0543('0xbc')]);}}delete this[_0x0543('0x17')][_0x1f767c[_0x0543('0xbd')]];}else{_0xcf969f['countnosuchnumberretry']++;logger['info']('actioncountonusuch',_0xcf969f[_0x0543('0xaa')]);logger[_0x0543('0x5a')]('id',_0xcf969f[_0x0543('0xbe')]);_0x54ab46[_0x0543('0xbf')]({'id':_0xcf969f[_0x0543('0xbe')],'field':{'countnosuchnumberretry':_0xcf969f[_0x0543('0xaa')]}})[_0x0543('0x8a')](function(){_0x54ab46[_0x0543('0xc0')](_0xcf969f,_0x1671b2,_0x537b7d)['then'](function(){});});}});break;case'ANSWER':var _0x30390b=moment()[_0x0543('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0xcf969f[_0x0543('0xc1')]=_0x30390b;_0xcf969f['answertime']=_0x30390b;_0xcf969f[_0x0543('0x81')]=!![];_0x1e1fc0[_0x0543('0x74')]+=0x1;logger[_0x0543('0x5a')](_0x0543('0xc2'),_0xcf969f[_0x0543('0xc3')],'\x20Queue',_0x1e1fc0[_0x0543('0x29')],_0x0543('0x73'),_0x1e1fc0['pTalking']);ami[_0x0543('0x26')](_0x0543('0xc4'),ut[_0x0543('0xaf')](_0xcf969f,'connect',this[_0x0543('0x14')][_0xcf969f[_0x0543('0x71')]]));if(_0x1e1fc0[_0x0543('0xc5')]){ami['emit'](_0x0543('0xc6'),ut[_0x0543('0xc7')](_0xcf969f));}break;case'16':ami[_0x0543('0x26')](_0x0543('0xc8'),ut['buildObj'](_0xcf969f,_0x0543('0xc9'),this[_0x0543('0x14')][_0xcf969f[_0x0543('0x71')]]));emitVoiceQueueChannelRemove(ut[_0x0543('0xaf')](_0xcf969f,_0x0543('0xc9')));_0x1e1fc0[_0x0543('0x3a')]+=0x1;_0x1e1fc0[_0x0543('0x30')]+=0x1;_0x1e1fc0[_0x0543('0x2b')]+=0x1;ut[_0x0543('0x82')](_0x1e1fc0,_0x0543('0xca'));_0xcf969f[_0x0543('0xab')]=ut[_0x0543('0xac')](_0xcf969f);ut[_0x0543('0x96')](_0xcf969f,0x4,_0x0543('0xcb'));rpcDb[_0x0543('0x9a')](_0xcf969f,_0x0543('0xcc'));rpcDb[_0x0543('0x9e')](_0xcf969f,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x0543('0xcd')](_0xcf969f);_0x1e1fc0[_0x0543('0x2d')]+=_0xcf969f[_0x0543('0xce')];_0x1e1fc0[_0x0543('0x2c')]+=_0xcf969f[_0x0543('0xce')];logger[_0x0543('0x5a')](_0x0543('0xcf'),_0xcf969f[_0x0543('0xc3')],_0x0543('0xd0'),_0x1e1fc0[_0x0543('0x29')],_0x0543('0x73'),_0x1e1fc0['pTalking']);delete this[_0x0543('0x17')][_0x1f767c[_0x0543('0xbd')]];break;case _0x0543('0xd1'):_0x1e1fc0['outboundBusyCallsDay']+=0x1;_0xcf969f[_0x0543('0xd2')]+=0x1;_0xcf969f['countglobal']=ut['totalGlobal'](_0xcf969f);ut[_0x0543('0x96')](_0xcf969f,0x5,'Busy');_0x1671b2=_0x1e1fc0[_0x0543('0xd3')];_0x537b7d=_0x1e1fc0[_0x0543('0xb4')];ami[_0x0543('0x26')](_0x0543('0xd4'),ut['buildObj'](_0xcf969f,'busy'));rpcDb[_0x0543('0x9a')](_0xcf969f,_0x0543('0xd5'));_0x54ab46[_0x0543('0xb2')](_0xcf969f,'5',_0x1e1fc0)['then'](function(_0x31cc2a){_0x5cb8ce=_0x31cc2a[_0x0543('0xb3')]==0x1;if(!_0x5cb8ce){if(ut['totalGlobal'](_0xcf969f)>=_0x1e1fc0[_0x0543('0xb5')]){_0x5bd53d=ut[_0x0543('0xb6')](_0xcf969f,0xf,'Global');rpcDb['createCustomerFinal'](_0x5bd53d,_0x0543('0xd6'));}else{if(_0xcf969f[_0x0543('0xd2')]>=_0x1e1fc0[_0x0543('0xd7')]){rpcDb['createCustomerFinal'](_0xcf969f,_0x0543('0xd5'));}else{rpcDb[_0x0543('0xb9')](ut[_0x0543('0xd8')](_0xcf969f,'countbusyretry',_0x1e1fc0['dialBusyRetryFrequency']),_0xcf969f[_0x0543('0xbb')],_0xcf969f[_0x0543('0xbc')]);}}}else{_0xcf969f[_0x0543('0xd2')]++;_0x54ab46['incrementPreviewCounters']({'id':_0xcf969f[_0x0543('0xbe')],'field':{'countbusyretry':_0xcf969f[_0x0543('0xd2')]}})[_0x0543('0x8a')](function(){_0x54ab46[_0x0543('0xc0')](_0xcf969f,_0x1671b2,_0x537b7d)[_0x0543('0x8a')](function(){});});}});break;case _0x0543('0xd9'):_0x1e1fc0[_0x0543('0xda')]+=0x1;_0xcf969f[_0x0543('0xdb')]+=0x1;_0xcf969f[_0x0543('0xab')]=ut[_0x0543('0xac')](_0xcf969f);ut[_0x0543('0x96')](_0xcf969f,0x3,_0x0543('0xdc'));_0x1671b2=_0x1e1fc0[_0x0543('0xdd')];_0x537b7d=_0x1e1fc0[_0x0543('0xb4')];var _0x3eb609=ut[_0x0543('0xde')](_0xcf969f,_0x1e1fc0);ami[_0x0543('0x26')]('custom:agentnoanswer',_0x3eb609);rpcDb[_0x0543('0x9a')](_0xcf969f,_0x0543('0xdf'));_0x54ab46[_0x0543('0xb2')](_0xcf969f,'3',_0x1e1fc0)[_0x0543('0x8a')](function(_0x4f2319){_0x5cb8ce=_0x4f2319[_0x0543('0xb3')]==0x1;if(!_0x5cb8ce){if(ut[_0x0543('0xac')](_0xcf969f)>=_0x1e1fc0[_0x0543('0xb5')]){_0x5bd53d=ut[_0x0543('0xb6')](_0xcf969f,0xf,'Global');rpcDb[_0x0543('0x9e')](_0x5bd53d,_0x0543('0xe0'));}else{if(_0xcf969f['countnoanswerretry']>=_0x1e1fc0[_0x0543('0xe1')]){rpcDb[_0x0543('0x9e')](_0xcf969f,_0x0543('0xdf'));}else{rpcDb[_0x0543('0xb9')](ut['scheduledAt'](_0xcf969f,_0x0543('0xdb'),_0x1e1fc0[_0x0543('0xdd')]),_0xcf969f[_0x0543('0xbb')],_0xcf969f[_0x0543('0xbc')]);}}}else{_0xcf969f[_0x0543('0xdb')]++;_0x54ab46['incrementPreviewCounters']({'id':_0xcf969f[_0x0543('0xbe')],'field':{'countnoanswerretry':_0xcf969f[_0x0543('0xdb')]}})['then'](function(){_0x54ab46[_0x0543('0xc0')](_0xcf969f,_0x1671b2,_0x537b7d)['then'](function(){});});}});break;case _0x0543('0xe2'):_0x1e1fc0[_0x0543('0x3d')]+=0x1;_0xcf969f[_0x0543('0xe3')]+=0x1;_0xcf969f[_0x0543('0xab')]=ut['totalGlobal'](_0xcf969f);ut[_0x0543('0x96')](_0xcf969f,0x8,'Congestion');_0x1671b2=_0x1e1fc0[_0x0543('0xe4')];_0x537b7d=_0x1e1fc0[_0x0543('0xb4')];ami[_0x0543('0x26')](_0x0543('0xe5'),ut[_0x0543('0xaf')](_0xcf969f,_0x0543('0xe6')));rpcDb[_0x0543('0x9a')](_0xcf969f,_0x0543('0xe7'));_0x54ab46[_0x0543('0xb2')](_0xcf969f,'8',_0x1e1fc0)[_0x0543('0x8a')](function(_0x3be402){_0x5cb8ce=_0x3be402['additional']==0x1;if(!_0x5cb8ce){if(ut[_0x0543('0xac')](_0xcf969f)>=_0x1e1fc0[_0x0543('0xb5')]){_0x5bd53d=ut[_0x0543('0xb6')](_0xcf969f,0xf,'Global');rpcDb[_0x0543('0x9e')](_0x5bd53d,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0xcf969f['countcongestionretry']>=_0x1e1fc0[_0x0543('0xe8')]){rpcDb['createCustomerFinal'](_0xcf969f,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x0543('0xb9')](ut[_0x0543('0xd8')](_0xcf969f,_0x0543('0xe3'),_0x1e1fc0[_0x0543('0xd3')]),_0xcf969f[_0x0543('0xbb')],_0xcf969f[_0x0543('0xbc')]);}}}else{_0xcf969f['countcongestionretry']++;_0x54ab46['incrementPreviewCounters']({'id':_0xcf969f['idContact'],'field':{'countcongestionretry':_0xcf969f['countcongestionretry']}})[_0x0543('0x8a')](function(){_0x54ab46[_0x0543('0xc0')](_0xcf969f,_0x1671b2,_0x537b7d)[_0x0543('0x8a')](function(){});});}});break;case _0x0543('0xe9'):_0x1e1fc0['outboundRejectCallsDay']+=0x1;_0xcf969f[_0x0543('0xea')]+=0x1;_0xcf969f[_0x0543('0xab')]=ut[_0x0543('0xac')](_0xcf969f);ut[_0x0543('0x96')](_0xcf969f,0x14,_0x0543('0xeb'));_0x1671b2=_0x1e1fc0[_0x0543('0xec')];_0x537b7d=_0x1e1fc0[_0x0543('0xb4')];ami[_0x0543('0x26')](_0x0543('0xed'),ut[_0x0543('0xaf')](_0xcf969f,'agentreject'));rpcDb[_0x0543('0x9a')](_0xcf969f,_0x0543('0xee'));_0x54ab46[_0x0543('0xb2')](_0xcf969f,'20',_0x1e1fc0)[_0x0543('0x8a')](function(_0x113ebf){_0x5cb8ce=_0x113ebf[_0x0543('0xb3')]==0x1;if(!_0x5cb8ce){if(ut['totalGlobal'](_0xcf969f)>=_0x1e1fc0[_0x0543('0xb5')]){_0x5bd53d=ut[_0x0543('0xb6')](_0xcf969f,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x5bd53d,_0x0543('0xef'));}else{if(_0xcf969f[_0x0543('0xea')]>=_0x1e1fc0[_0x0543('0xf0')]){rpcDb['createCustomerFinal'](_0xcf969f,_0x0543('0xef'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0xcf969f,_0x0543('0xea'),_0x1e1fc0['dialAgentRejectRetryFrequency']),_0xcf969f[_0x0543('0xbb')],_0xcf969f[_0x0543('0xbc')]);}}}else{_0xcf969f['countnoanswerretry']++;_0x54ab46[_0x0543('0xbf')]({'id':_0xcf969f['idContact'],'field':{'countnoanswerretry':_0xcf969f[_0x0543('0xdb')]}})[_0x0543('0x8a')](function(){_0x54ab46[_0x0543('0xc0')](_0xcf969f,_0x1671b2,_0x537b7d)['then'](function(){});});}});break;case _0x0543('0xf1'):_0x1e1fc0[_0x0543('0x43')]+=0x1;_0xcf969f[_0x0543('0xf2')]+=0x1;_0xcf969f[_0x0543('0xab')]=ut['totalGlobal'](_0xcf969f);ut[_0x0543('0x96')](_0xcf969f,0xb,_0x0543('0xf3'));rpcDb[_0x0543('0x9a')](_0xcf969f,'[callProgressDetectingCustomer][logAbandoned]');_0x54ab46['verifyAdditionalPhones'](_0xcf969f,'11',_0x1e1fc0)[_0x0543('0x8a')](function(_0x5de37a){_0x5cb8ce=_0x5de37a[_0x0543('0xb3')]==0x1;if(!_0x5cb8ce){if(ut[_0x0543('0xac')](_0xcf969f)>=_0x1e1fc0[_0x0543('0xb5')]){_0x5bd53d=ut[_0x0543('0xb6')](_0xcf969f,0xf,'Global');rpcDb[_0x0543('0x9e')](_0x5bd53d,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0xcf969f[_0x0543('0xf4')]>=_0x1e1fc0[_0x0543('0xf5')]){rpcDb[_0x0543('0x9e')](_0xcf969f,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x0543('0xb9')](ut[_0x0543('0xd8')](_0xcf969f,'countabandonedretry',_0x1e1fc0[_0x0543('0xf6')]),_0xcf969f['unlockAgent'],_0xcf969f[_0x0543('0xbc')]);}}}else{_0xcf969f[_0x0543('0xdb')]++;_0x54ab46[_0x0543('0xbf')]({'id':_0xcf969f[_0x0543('0xbe')],'field':{'countnoanswerretry':_0xcf969f['countnoanswerretry']}})[_0x0543('0x8a')](function(){_0x54ab46[_0x0543('0xc0')](_0xcf969f,_0x1671b2,_0x537b7d)[_0x0543('0x8a')](function(){});});}});break;case'18':_0x1e1fc0[_0x0543('0x42')]+=0x1;_0xcf969f[_0x0543('0xf7')]+=0x1;_0xcf969f['countglobal']=ut[_0x0543('0xac')](_0xcf969f);ut[_0x0543('0x96')](_0xcf969f,0x12,_0x1f767c['cause-txt']||_0x1f767c['dialstatus']);ami[_0x0543('0x26')]('custom:amd',ut[_0x0543('0xaf')](_0xcf969f,_0x0543('0xf8')));rpcDb[_0x0543('0x9a')](_0xcf969f,_0x0543('0xf9'));_0x54ab46['verifyAdditionalPhones'](_0xcf969f,'18',_0x1e1fc0)[_0x0543('0x8a')](function(_0x3eb462){_0x5cb8ce=_0x3eb462[_0x0543('0xb3')]==0x1;if(!_0x5cb8ce){if(ut[_0x0543('0xac')](_0xcf969f)>=_0x1e1fc0['dialGlobalMaxRetry']){_0x5bd53d=ut['cloneAction'](_0xcf969f,0x12,'Global');rpcDb[_0x0543('0x9e')](_0x5bd53d,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x0543('0x9e')](_0xcf969f,_0x0543('0xf9'));}}else{_0xcf969f[_0x0543('0xdb')]++;_0x54ab46['incrementPreviewCounters']({'id':_0xcf969f[_0x0543('0xbe')],'field':{'countnoanswerretry':_0xcf969f[_0x0543('0xdb')]}})[_0x0543('0x8a')](function(){_0x54ab46['swapAdditionalPhones'](_0xcf969f,_0x1671b2,_0x537b7d)[_0x0543('0x8a')](function(){});});}});delete this[_0x0543('0x17')][_0x1f767c[_0x0543('0xbd')]];break;case'19':_0x1e1fc0[_0x0543('0x42')]+=0x1;_0xcf969f['countglobal']=ut[_0x0543('0xac')](_0xcf969f);ut['logCustomer'](_0xcf969f,0x13,_0x1f767c[_0x0543('0xfa')]||_0x1f767c[_0x0543('0xfb')]);ami[_0x0543('0x26')](_0x0543('0xfc'),ut[_0x0543('0xaf')](_0xcf969f,_0x0543('0xf8')));rpcDb['createCustomerHistory'](_0xcf969f,'[callProgressDetectingCustomer][machine]');_0x54ab46[_0x0543('0xb2')](_0xcf969f,'18',_0x1e1fc0)[_0x0543('0x8a')](function(_0x3ce165){_0x5cb8ce=_0x3ce165[_0x0543('0xb3')]==0x1;if(!_0x5cb8ce){if(ut[_0x0543('0xac')](_0xcf969f)>=_0x1e1fc0[_0x0543('0xb5')]){_0x5bd53d=ut[_0x0543('0xb6')](_0xcf969f,0xf,_0x0543('0xb7'));rpcDb[_0x0543('0x9e')](_0x5bd53d,_0x0543('0xfd'));}else{rpcDb['createCustomerFinal'](_0xcf969f,'[callProgressDetectingCustomer][machine]');}}else{_0xcf969f[_0x0543('0xdb')]++;_0x54ab46[_0x0543('0xbf')]({'id':_0xcf969f['idContact'],'field':{'countnoanswerretry':_0xcf969f[_0x0543('0xdb')]}})[_0x0543('0x8a')](function(){_0x54ab46[_0x0543('0xc0')](_0xcf969f,_0x1671b2,_0x537b7d)[_0x0543('0x8a')](function(){});});}});delete this['actions'][_0x1f767c[_0x0543('0xbd')]];break;default:if(_0xcf969f[_0x0543('0x81')]){ut[_0x0543('0x82')](_0x1e1fc0,_0x0543('0xfe'));ut[_0x0543('0x83')](_0x0543('0xff')+_0x1e1fc0[_0x0543('0x29')],_0x1f767c);}_0x1e1fc0[_0x0543('0x42')]+=0x1;_0xcf969f[_0x0543('0xab')]=ut[_0x0543('0xac')](_0xcf969f);ut[_0x0543('0x96')](_0xcf969f,0xc,_0x1f767c[_0x0543('0xfa')]||_0x1f767c[_0x0543('0xfb')]);_0x1671b2=_0x1e1fc0[_0x0543('0xec')];_0x537b7d=_0x1e1fc0[_0x0543('0xb4')];rpcDb[_0x0543('0x9a')](_0xcf969f,_0x0543('0x100'));_0x54ab46[_0x0543('0xb2')](_0xcf969f,'20',_0x1e1fc0)[_0x0543('0x8a')](function(_0x3bd5bd){_0x5cb8ce=_0x3bd5bd[_0x0543('0xb3')]==0x1;if(!_0x5cb8ce){if(ut['totalGlobal'](_0xcf969f)>=_0x1e1fc0[_0x0543('0xb5')]){_0x5bd53d=ut[_0x0543('0xb6')](_0xcf969f,0xf,'Global');rpcDb[_0x0543('0x9e')](_0x5bd53d,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0543('0x9e')](_0xcf969f,_0x0543('0x101'));}delete this[_0x0543('0x17')][_0x1f767c[_0x0543('0xbd')]];}else{_0x54ab46[_0x0543('0xc0')](_0xcf969f,_0x1671b2,_0x537b7d)[_0x0543('0x8a')](function(){});}});}if(!(_0xcf969f[_0x0543('0x81')]&&_0x2ee541==='16')){ut['updateOriginated'](_0x1e1fc0,'[callProgressDetectingCustomer]');logger['info'](_0x0543('0x102'),_0xcf969f['uniqueid'],_0x0543('0xd0'),_0x1e1fc0[_0x0543('0x29')],'originated:\x20',_0x1e1fc0[_0x0543('0x103')]);}if(_0x2ee541!==_0x0543('0x104')){delete this[_0x0543('0x17')][_0x1f767c[_0x0543('0xbd')]];delete this[_0x0543('0x17')][_0x1f767c['destlinkedid']];}}};Preview[_0x0543('0x10')][_0x0543('0x105')]=function(_0x1be1b7,_0x2159db,_0x2f7e2d){if(_[_0x0543('0x106')](_0x2159db)&&_0x0543('0x107')!==typeof _0x2159db){return;}if(_[_0x0543('0x106')](_0x2f7e2d)&&'object'!==typeof _0x2f7e2d){return;}switch(_0x2f7e2d['reason']){case'0':ut[_0x0543('0x108')](_0x1be1b7,0x0,_0x0543('0xad'));rpcDb['createAgentHistory'](_0x1be1b7,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x0543('0x108')](_0x1be1b7,0x3,_0x0543('0xdc'));rpcDb[_0x0543('0x109')](_0x1be1b7,_0x0543('0x10a'));break;case'5':ut[_0x0543('0x108')](_0x1be1b7,0x5,_0x0543('0x10b'));rpcDb[_0x0543('0x109')](_0x1be1b7,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x0543('0x108')](_0x1be1b7,0x8,_0x0543('0x10c'));rpcDb[_0x0543('0x109')](_0x1be1b7,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x0543('0x108')](_0x1be1b7,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x1be1b7,_0x0543('0x10d'));break;default:ut[_0x0543('0x108')](_0x1be1b7,0xc,_0x2f7e2d[_0x0543('0x10e')]);rpcDb[_0x0543('0x109')](_0x1be1b7,_0x0543('0x10f'));}ut[_0x0543('0x7f')](_0x2159db,_0x0543('0x110'));logger[_0x0543('0x5a')](_0x0543('0x111'),_0x1be1b7[_0x0543('0xc3')],_0x0543('0xd0'),_0x2159db[_0x0543('0x29')],_0x0543('0x72'),_0x2159db[_0x0543('0x103')]);delete this['actions'][_0x1be1b7[_0x0543('0xc3')]];};Preview[_0x0543('0x10')][_0x0543('0xb2')]=function(_0xc4531b,_0x366d81,_0x29960b){return Promise[_0x0543('0x112')]()[_0x0543('0x8a')](cmHopperAdditionalPhone[_0x0543('0xb2')](_0xc4531b,_0x366d81,_0x29960b))[_0x0543('0x7d')](logger[_0x0543('0x5a')](_0x0543('0x113')));};Preview[_0x0543('0x10')]['swapAdditionalPhones']=function(_0x57fdb6,_0x1779c8,_0x1d0147){return Promise[_0x0543('0x112')]()['then'](cmHopperAdditionalPhone[_0x0543('0xc0')](_0x57fdb6,_0x1779c8,_0x1d0147))['catch'](logger[_0x0543('0x5a')](_0x0543('0x114')));};Preview[_0x0543('0x10')][_0x0543('0xbf')]=function(_0x4447c9){return Promise['resolve']()[_0x0543('0x8a')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x4447c9))[_0x0543('0x7d')](logger[_0x0543('0x5a')](_0x0543('0x115')));};Preview[_0x0543('0x10')]['checkInBlack']=function(_0x5b0ab2,_0xdbc4d1,_0xba6175,_0x516687,_0x31d8ee){var _0x5b9a12=this;return new Promise(function(_0x53d3e7,_0x13de38){if(_['isNil'](_0xdbc4d1)||_[_0x0543('0x6f')](_0xdbc4d1[_0x0543('0x116')])||_[_0x0543('0x6f')](_0xdbc4d1[_0x0543('0x117')])||_['isNil'](_0xdbc4d1[_0x0543('0x78')])){_0x13de38(ut[_0x0543('0x4e')](_0x0543('0x118'),_0x516687,_0x31d8ee));return;}var _0x2fb8f6=uuid['v4']();var _0x5aaae4=_0x5b9a12[_0x0543('0x14')][_0xdbc4d1[_0x0543('0x119')][_0x0543('0x29')]];var _0x1b47e6=_0xba6175?_0x5b9a12['agents'][_0xba6175]['id']:undefined;_0x5b9a12[_0x0543('0x17')][_0x2fb8f6]=new Action(_0xdbc4d1,_0x5aaae4,_0x2fb8f6,_0xba6175,_0x1b47e6);var _0x414078=_0x5b9a12[_0x0543('0x17')][_0x2fb8f6];_0x414078[_0x0543('0xbb')]=_0x516687;_0x414078[_0x0543('0xbc')]=_0x31d8ee;_0x414078[_0x0543('0x11a')]=_0xba6175;if(_[_0x0543('0x11b')](_0x5b0ab2)){_0x5b9a12[_0x0543('0x11c')](_0x414078,_0x5aaae4,_0xdbc4d1,_0xba6175)[_0x0543('0x8a')](function(_0x5f48a7){logger[_0x0543('0x5a')](_0x0543('0x11d'),_0x0543('0x11e')+_0x414078['queue']+_0x0543('0x11f')+_0x414078[_0x0543('0xbe')],JSON[_0x0543('0x58')](_0x5f48a7));ami['emit'](_0x0543('0x120'),ut[_0x0543('0xaf')](_0x414078,'called',_0x5b9a12[_0x0543('0x14')][_0x414078[_0x0543('0x71')]]));_0x53d3e7(ut['message']('Calling'));})[_0x0543('0x7d')](function(_0x3eafe0){ut[_0x0543('0x66')](_0x0543('0x121'),_0x3eafe0);_0x13de38(ut[_0x0543('0x4e')](_0x0543('0x122'),_0x516687,_0x31d8ee));});}else{_0x5aaae4[_0x0543('0x3b')]+=0x1;ut[_0x0543('0x123')](_0x414078);rpcDb['createHistory'](_0x414078,_0x0543('0x124'));delete _0x5b9a12['actions'][_0x2fb8f6];_0x13de38(ut[_0x0543('0x4e')](_0x0543('0x125'),_0x516687,_0x31d8ee));}});};Preview[_0x0543('0x10')]['isTrunkReachable']=function(_0x267bf9){return!_['isNil'](_0x267bf9)&&!_['isNil'](_0x267bf9[_0x0543('0x29')])&&!_[_0x0543('0x6f')](_0x267bf9[_0x0543('0x55')])&&_0x267bf9[_0x0543('0x55')]&&!_[_0x0543('0x6f')](this[_0x0543('0x16')][util[_0x0543('0x5c')](_0x0543('0x126'),_0x267bf9['name'])])&&!_[_0x0543('0x6f')](this[_0x0543('0x16')][util[_0x0543('0x5c')](_0x0543('0x126'),_0x267bf9['name'])][_0x0543('0x7b')])&&(this[_0x0543('0x16')][util[_0x0543('0x5c')](_0x0543('0x126'),_0x267bf9[_0x0543('0x29')])][_0x0543('0x7b')]==='reachable'||this[_0x0543('0x16')][util['format'](_0x0543('0x126'),_0x267bf9[_0x0543('0x29')])][_0x0543('0x7b')]===_0x0543('0x127'));};Preview[_0x0543('0x10')][_0x0543('0x91')]=function(_0x5e681b,_0x24181d){return this[_0x0543('0x128')](_0x5e681b,_0x24181d)[_0x0543('0x8a')](function(_0x3874cd){return _[_0x0543('0x75')](_0x3874cd,[_0x0543('0x4e')]);})[_0x0543('0x7d')](function(_0x114170){if(_0x114170[_0x0543('0x129')]){rpcDb[_0x0543('0x12a')](_0x5e681b);}if(_0x114170[_0x0543('0x55')]){rpcDb[_0x0543('0x12b')](_0x5e681b);}throw _[_0x0543('0x75')](_0x114170,[_0x0543('0x4e')]);});};Preview[_0x0543('0x10')][_0x0543('0x128')]=function(_0x358c5d,_0x10f1c6){var _0xdb3b9c=this;var _0x311170,_0x1d256b;return rpcDb['getContactPreview'](_0x358c5d)[_0x0543('0x8a')](function(_0x115892){if(!_[_0x0543('0x6f')](_0x115892[0x0])){_0x1d256b=_0x115892[0x0][_0x0543('0x12c')]?![]:!![];_0x311170=_0x115892[0x0][_0x0543('0x12c')]?!![]:![];_0x311170=_0x10f1c6?!![]:_0x311170;}var _0x5ead6a=_0xdb3b9c[_0x0543('0x12d')](_0x115892);if(_0x5ead6a[_0x0543('0x12e')]){rpcDb[_0x0543('0x12f')](_[_0x0543('0x75')](_0x115892[0x0],['VoiceQueueId',_0x0543('0x117')]))['then'](function(_0x4df87e){_0xdb3b9c[_0x0543('0x130')](_0x4df87e,_0x115892[0x0],_0x10f1c6,_0x1d256b,_0x311170)['then'](function(_0x38c780){return _0x38c780;})[_0x0543('0x7d')](function(_0x5a53f3){throw _0x5a53f3;});})[_0x0543('0x7d')](function(_0x101537){ut[_0x0543('0x66')]('[Preview][checkIsBlackList]',_0x101537);throw ut[_0x0543('0x4e')](_0x0543('0x131'),_0x1d256b,_0x311170);});}else{throw ut[_0x0543('0x4e')](_0x5ead6a[_0x0543('0x4e')],_0x1d256b,_0x311170);}})[_0x0543('0x7d')](function(_0x5dfa08){ut[_0x0543('0x66')](_0x0543('0x132'),_0x5dfa08);throw ut['message'](_0x0543('0x131'),![],!![]);});};Preview[_0x0543('0x10')][_0x0543('0x12d')]=function(_0x22e9ab){if(_['isNil'](_0x22e9ab)||_['isEmpty'](_0x22e9ab)||!_['isNil'](_0x22e9ab[0x0][_0x0543('0x8f')])&&_[_0x0543('0x6f')](_0x22e9ab[0x0][_0x0543('0x8f')][_0x0543('0x29')])){ut[_0x0543('0x66')](_0x0543('0x133'),_0x22e9ab);return{'isValid':![],'message':_0x0543('0x134')};}var _0x2a9fd8=this['campaignsPreview'][_0x22e9ab[0x0][_0x0543('0x119')][_0x0543('0x29')]];_0x2a9fd8[_0x0543('0x4e')]='ACTIVE';if(_[_0x0543('0x6f')](_0x2a9fd8)){ut[_0x0543('0x66')](_0x0543('0x135'),_0x2a9fd8);return{'isValid':![],'message':_0x0543('0x136')};}if(!this[_0x0543('0xa5')](_0x2a9fd8[_0x0543('0x54')])){ut[_0x0543('0x66')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20'+_0x2a9fd8[_0x0543('0x29')]+_0x0543('0x137'));if(!this['isTrunkReachable'](_0x2a9fd8[_0x0543('0xa6')])){ut[_0x0543('0x66')](_0x0543('0x138'),_0x2a9fd8[_0x0543('0x29')]+_0x0543('0x139'));return{'isValid':![],'message':_0x0543('0x13a')};}}if(!ut[_0x0543('0xa4')](_0x2a9fd8[_0x0543('0x35')])){ut[_0x0543('0x66')](_0x0543('0x13b'),_0x2a9fd8[_0x0543('0x29')]+_0x0543('0x13c'));return{'isValid':![],'message':_0x0543('0x13d')+_0x2a9fd8[_0x0543('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x0543('0x13e')};};Preview[_0x0543('0x10')][_0x0543('0x11c')]=function(_0x242365,_0x2bdda7,_0xcdabbc,_0x4d1bfe){var _0x1b36e4=this;return new Promise(function(_0x5efa23,_0x5483f0){var _0x1421bf=_0x242365['uniqueid'];var _0x31efed=_0x1b36e4[_0x0543('0xa5')](_0x2bdda7['Trunk'])?util[_0x0543('0x5c')](_0x0543('0x13f'),_0x2bdda7[_0x0543('0x54')][_0x0543('0x29')],_[_0x0543('0x6f')](_0x2bdda7[_0x0543('0x39')])?'':_0x2bdda7[_0x0543('0x39')][_0x0543('0x140')]()||'',_0x2bdda7[_0x0543('0x141')]>0x0?_0xcdabbc[_0x0543('0x117')]['substring'](_0x2bdda7[_0x0543('0x141')]):_0xcdabbc[_0x0543('0x117')]):util[_0x0543('0x5c')](_0x0543('0x13f'),_['isNil'](_0x2bdda7[_0x0543('0xa6')])?_0x2bdda7['Trunk'][_0x0543('0x29')]:_0x2bdda7['TrunkBackup']['name'],_['isNil'](_0x2bdda7[_0x0543('0x39')])?'':_0x2bdda7[_0x0543('0x39')]['trim']()||'',_0x2bdda7[_0x0543('0x141')]>0x0?_0xcdabbc[_0x0543('0x117')][_0x0543('0x142')](_0x2bdda7['dialCutDigit']):_0xcdabbc[_0x0543('0x117')]);var _0x5b287b=_0x1b36e4[_0x0543('0xa5')](_0x2bdda7[_0x0543('0x54')])?ut['getCallerId'](_0x2bdda7['Trunk'][_0x0543('0x56')],_0x2bdda7[_0x0543('0x143')],_0x2bdda7[_0x0543('0x144')]>0x0?ut[_0x0543('0x145')](_0x2bdda7[_0x0543('0x37')],_0x2bdda7[_0x0543('0x144')]):_0x2bdda7[_0x0543('0x37')]):ut[_0x0543('0x146')](_[_0x0543('0x6f')](_0x2bdda7['TrunkBackup'])?_0x2bdda7[_0x0543('0x54')][_0x0543('0x56')]:_0x2bdda7['TrunkBackup'][_0x0543('0x56')],_0x2bdda7[_0x0543('0x143')],_0x2bdda7[_0x0543('0x144')]>0x0?ut[_0x0543('0x145')](_0x2bdda7[_0x0543('0x37')],_0x2bdda7[_0x0543('0x144')]):_0x2bdda7[_0x0543('0x37')]);if(_0x5b287b){_0x242365[_0x0543('0x147')]=ut[_0x0543('0x148')](_0x5b287b);_0x242365[_0x0543('0x149')]=ut['extractCalleridNumber'](_0x5b287b);}var _0x5a3368=ut[_0x0543('0x14a')](_0x2bdda7,_0xcdabbc,_0x31efed,_0x5b287b,_0x1421bf,_0x242365);_[_0x0543('0x14b')](_0x242365,ut[_0x0543('0x14c')](_0x5a3368));_0x242365[_0x0543('0x94')]=moment()[_0x0543('0x5c')](_0x0543('0x95'));_0x2bdda7['variables']=_0x5a3368;ami[_0x0543('0x7a')](ut[_0x0543('0x14d')](_0x242365,_0x2bdda7,_0x5a3368,_0x242365[_0x0543('0xbc')],_0x4d1bfe))[_0x0543('0x8a')](function(_0x41fc46){_0x2bdda7['originated']+=0x1;logger['info'](_0x0543('0x14e'),_0x1421bf,'\x20Queue',_0x2bdda7['name'],'originated:\x20',_0x2bdda7[_0x0543('0x103')]);_0x5efa23(_0x41fc46);})[_0x0543('0x7d')](function(_0x2ec85d){ut[_0x0543('0x108')](_0x242365,0xe,'OriginateError');rpcDb[_0x0543('0x109')](_0x242365,_0x0543('0x14f'));_0x5483f0(_0x2ec85d);});});};Preview[_0x0543('0x10')][_0x0543('0x20')]=function(_0x53e915){if(this['actions'][_0x53e915[_0x0543('0xbd')]]){this['actions'][_0x53e915[_0x0543('0xbd')]][_0x0543('0x7c')]=_0x53e915[_0x0543('0x7c')];}};Preview[_0x0543('0x10')][_0x0543('0x1a')]=function(_0x214d2a){var _0x5775a7=this;var _0x19bd31=this[_0x0543('0x17')][_0x214d2a[_0x0543('0x150')]];if(_0x19bd31){if(_0x19bd31['lookAgent']&&this[_0x0543('0x18')][_0x19bd31['lookAgent']]){ut[_0x0543('0x151')](_0x19bd31,this[_0x0543('0x18')][_0x19bd31[_0x0543('0x11a')]]['name'],this['agents'][_0x19bd31['lookAgent']]['id']);}var _0x2e00f7=_[_0x0543('0x152')](_0x19bd31);_0x2e00f7['responsetime']=moment()[_0x0543('0x5c')](_0x0543('0x95'));var _0x2ba926=_0x5775a7['campaignsPreview'][_0x19bd31['queue']];if(ut[_0x0543('0x153')](_0x214d2a['response'])){if(_0x19bd31['unlockAgent']){rpcDb[_0x0543('0x12a')](_0x19bd31[_0x0543('0xbe')]);}if(_0x19bd31['activeContact']){rpcDb[_0x0543('0x12b')](_0x19bd31[_0x0543('0xbe')]);}ami['emit'](_0x0543('0x154'),ut[_0x0543('0xaf')](_0x19bd31,_0x0543('0x155'),this[_0x0543('0x14')][_0x19bd31[_0x0543('0x71')]]));this[_0x0543('0x105')](_0x2e00f7,_0x2ba926,_0x214d2a);}else{_0x19bd31[_0x0543('0x94')]=moment()['format'](_0x0543('0x95'));ut['logAgent'](_0x2e00f7,0x4,_0x0543('0xcb'));rpcDb[_0x0543('0x109')](_0x2e00f7,_0x0543('0x156'));}}};Preview[_0x0543('0x10')][_0x0543('0x157')]=function(_0x2e091e){var _0x42de2d=this[_0x0543('0x17')][_0x2e091e[_0x0543('0xbd')]];var _0xb2e1f5;if(_0x42de2d){_0xb2e1f5=this[_0x0543('0x14')][_0x42de2d[_0x0543('0x71')]];logger['info'](_0x0543('0x158'),_0x2e091e[_0x0543('0xbd')],_0x0543('0xd0'),_0xb2e1f5[_0x0543('0x29')],_0x0543('0x73'),_0xb2e1f5['pTalking']);}if(this['actions'][_0x2e091e[_0x0543('0xbd')]]&&_0x2e091e[_0x0543('0xbd')]!==_0x2e091e[_0x0543('0xc3')]){if(_0x2e091e[_0x0543('0x159')]==='16'&&this[_0x0543('0x17')][_0x2e091e[_0x0543('0xbd')]][_0x0543('0x81')]){this['callProgressDetectingCustomer'](_0x2e091e,_0x2e091e['linkedid'],_0x2e091e[_0x0543('0x159')]);}else if(this[_0x0543('0x17')][_0x2e091e['linkedid']][_0x0543('0x81')]){logger[_0x0543('0x5a')]('[syncHangup][talking][cause]',_0x2e091e[_0x0543('0xbd')],_0x2e091e[_0x0543('0x159')],'\x20Queue',_0xb2e1f5['name'],_0x0543('0x73'),_0xb2e1f5[_0x0543('0x74')]);this[_0x0543('0xa9')](_0x2e091e,_0x2e091e[_0x0543('0xbd')],_0x2e091e['cause']);}}else if(_0x42de2d&&_['isNil'](_0x42de2d[_0x0543('0x15a')])&&_0xb2e1f5[_0x0543('0x15b')]&&_0x2e091e[_0x0543('0xbd')]===_0x2e091e[_0x0543('0xc3')]&&_[_0x0543('0x6f')](_0x2e091e[_0x0543('0x10e')])&&_0x2e091e[_0x0543('0x159')]==='16'&&_0x2e091e[_0x0543('0x15c')]==='6'&&_[_0x0543('0x106')](_0x42de2d[_0x0543('0x15d')])){if(_0x42de2d['unlockAgent']){rpcDb[_0x0543('0x12a')](_0x42de2d[_0x0543('0xbe')]);}if(_0x42de2d['activeContact']){rpcDb[_0x0543('0x12b')](_0x42de2d[_0x0543('0xbe')]);}_0x2e091e[_0x0543('0x10e')]='22';this[_0x0543('0x105')](_0x42de2d,_0xb2e1f5,_0x2e091e);}else if(_0x42de2d&&_0x42de2d[_0x0543('0x15d')]){if(_0x2e091e['cause']==='16'&&this[_0x0543('0x17')][_0x2e091e[_0x0543('0xbd')]][_0x0543('0x81')]){logger[_0x0543('0x5a')](_0x0543('0x15e'),_0x2e091e[_0x0543('0xbd')],_0x2e091e[_0x0543('0x159')],_0x0543('0xd0'),_0xb2e1f5['name'],_0x0543('0x73'),_0xb2e1f5[_0x0543('0x74')]);this[_0x0543('0xa9')](_0x2e091e,_0x2e091e[_0x0543('0xbd')],_0x2e091e[_0x0543('0x159')]);}else if(this[_0x0543('0x17')][_0x2e091e[_0x0543('0xbd')]]['dialAnswer']){logger[_0x0543('0x5a')](_0x0543('0x15f'),_0x2e091e[_0x0543('0xbd')],_0x2e091e[_0x0543('0x159')],'\x20Queue',_0xb2e1f5['name'],_0x0543('0x73'),_0xb2e1f5[_0x0543('0x74')]);this[_0x0543('0xa9')](_0x2e091e,_0x2e091e[_0x0543('0xbd')],_0x2e091e[_0x0543('0x159')]);}}};Preview[_0x0543('0x10')][_0x0543('0x160')]=function(_0x21b61c){if(this[_0x0543('0x17')][_0x21b61c[_0x0543('0x161')]]&&_0x21b61c[_0x0543('0x161')]!==_0x21b61c[_0x0543('0x162')]){this[_0x0543('0xa9')](_0x21b61c,_0x21b61c[_0x0543('0x161')],_0x21b61c[_0x0543('0xfb')]);}};Preview[_0x0543('0x10')][_0x0543('0x1d')]=function(_0x15f76b){if(this['actions'][_0x15f76b[_0x0543('0xbd')]]&&_0x15f76b[_0x0543('0xbd')]!==_0x15f76b['uniqueid']&&!this[_0x0543('0x17')][_0x15f76b['linkedid']][_0x0543('0x81')]){if(_0x15f76b['cause']==='1'){this['callProgressDetectingCustomer'](_0x15f76b,_0x15f76b[_0x0543('0xbd')],_0x15f76b['cause']);}}};Preview[_0x0543('0x10')][_0x0543('0x163')]=function(_0x29a1d8,_0x29c9b5,_0x2c7c2f){if(this[_0x0543('0x17')][_0x29a1d8]){if(_[_0x0543('0x6f')](this[_0x0543('0x17')][_0x29a1d8][_0x0543('0x164')])){this[_0x0543('0x17')][_0x29a1d8][_0x0543('0x164')]={};}this[_0x0543('0x17')][_0x29a1d8]['variables'][_0x29c9b5]=_0x2c7c2f;}};Preview['prototype']['syncVarSet']=function(_0x42afa5){try{if(!_['isNil'](_0x42afa5)){if(ut[_0x0543('0x165')](_['keys'](_0x42afa5[_0x0543('0x166')])[0x0])){this[_0x0543('0x163')](_0x42afa5[_0x0543('0xc3')],_[_0x0543('0x167')](_0x42afa5[_0x0543('0x166')])[0x0],_0x42afa5['value']);}}}catch(_0x7962b2){logger[_0x0543('0x168')](_0x0543('0x169'),util['inspect'](_0x7962b2,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x596768){if(_0x596768){if(this[_0x0543('0x17')][_0x596768[_0x0543('0x16a')]]){this[_0x0543('0x17')][_0x596768[_0x0543('0x16a')]][_0x0543('0x15d')]=!![];}}};Preview['prototype'][_0x0543('0x24')]=function(_0x25ca57){if(_0x25ca57){if(this[_0x0543('0x17')][_0x25ca57[_0x0543('0x16b')]]){this[_0x0543('0x17')][_0x25ca57[_0x0543('0x16b')]][_0x0543('0x15d')]=!![];}}};module[_0x0543('0x16c')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 7a39781..1a4948f 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 _0xa9af=['../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','context','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory'];(function(_0xc16cd8,_0x5c93af){var _0x517d1d=function(_0x2fc214){while(--_0x2fc214){_0xc16cd8['push'](_0xc16cd8['shift']());}};_0x517d1d(++_0x5c93af);}(_0xa9af,0x1c0));var _0xfa9a=function(_0x4d2111,_0x24c83d){_0x4d2111=_0x4d2111-0x0;var _0x5f00a0=_0xa9af[_0x4d2111];return _0x5f00a0;};'use strict';var util=require(_0xfa9a('0x0'));var BPromise=require(_0xfa9a('0x1'));var logger=require(_0xfa9a('0x2'))(_0xfa9a('0x3'));var _=require(_0xfa9a('0x4'));var cmHopper=require(_0xfa9a('0x5'));var cmHopperFinal=require(_0xfa9a('0x6'));var cmHopperHistory=require(_0xfa9a('0x7'));var cmHopperBlack=require(_0xfa9a('0x8'));var voiceQueueRt=require(_0xfa9a('0x9'));var agentReportPreview=require(_0xfa9a('0xa'));var voiceQueueReport=require(_0xfa9a('0xb'));function loggerCatch(_0x5edff6){return function(_0x425c8d){logger['error'](_0x5edff6,util['inspect'](_0x425c8d,{'showHidden':![],'depth':null}));};}function create(_0x55b2c2){return BPromise[_0xfa9a('0xc')]()['then'](cmHopperHistory[_0xfa9a('0xd')](_0x55b2c2))[_0xfa9a('0xe')](loggerCatch(_0xfa9a('0xf')));}function createAgent(_0x22eae7){return BPromise[_0xfa9a('0xc')]()[_0xfa9a('0x10')](agentReportPreview[_0xfa9a('0xd')](_0x22eae7))[_0xfa9a('0xe')](loggerCatch(_0xfa9a('0xf')));}function moveContact(_0x1cb4ea){return BPromise['resolve']()[_0xfa9a('0x10')](cmHopper[_0xfa9a('0x11')](_0x1cb4ea,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xfa9a('0x12')]=function(_0x3213e7){return BPromise[_0xfa9a('0xc')]()[_0xfa9a('0x10')](cmHopperBlack[_0xfa9a('0x12')](_0x3213e7))[_0xfa9a('0xe')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xfa9a('0x13')]=function(_0x16f9b3){return BPromise[_0xfa9a('0xc')]()['then'](cmHopper[_0xfa9a('0x13')](_0x16f9b3))[_0xfa9a('0xe')](loggerCatch(_0xfa9a('0x14')));};exports[_0xfa9a('0xd')]=function(_0x41525d,_0x3db8f7){create(_0x41525d)[_0xfa9a('0xe')](loggerCatch(_0x3db8f7));moveContact(_0x41525d)['catch'](loggerCatch(_0x3db8f7));};exports[_0xfa9a('0x15')]=function(_0x1cd1c4,_0x327aba){createAgent(_0x1cd1c4)['catch'](loggerCatch(_0x327aba));};exports['createCustomerHistory']=function(_0x355977,_0x430866){create(_0x355977)['catch'](loggerCatch(_0x430866));};exports[_0xfa9a('0x16')]=function(_0x5114c0,_0x5b5cd9){moveContact(_0x5114c0)[_0xfa9a('0xe')](loggerCatch(_0x5b5cd9));};exports[_0xfa9a('0x17')]=function(_0x23b05f,_0x59da1a,_0x5e95ee){if(_0x59da1a){_0x23b05f[_0xfa9a('0x18')]=null;}if(_0x5e95ee){_0x23b05f[_0xfa9a('0x19')]=![];}return BPromise[_0xfa9a('0xc')]()[_0xfa9a('0x10')](cmHopper[_0xfa9a('0x17')](_0x23b05f))[_0xfa9a('0xe')](loggerCatch(_0xfa9a('0x1a')));};exports[_0xfa9a('0x1b')]=function(_0x10c923){return BPromise['resolve']()[_0xfa9a('0x10')](cmHopper[_0xfa9a('0x1b')](_0x10c923))[_0xfa9a('0xe')](loggerCatch(_0xfa9a('0x1c')));};exports[_0xfa9a('0x1d')]=function(_0x52af38){return BPromise['resolve']()[_0xfa9a('0x10')](cmHopper[_0xfa9a('0x1d')]({'UserId':null},_0x52af38,0x1))[_0xfa9a('0xe')](loggerCatch(_0xfa9a('0x1e')));};exports['disableContact']=function(_0x3a9c3c){return BPromise[_0xfa9a('0xc')]()['then'](cmHopper[_0xfa9a('0x1d')]({'active':![]},_0x3a9c3c,0x1))[_0xfa9a('0xe')](loggerCatch(_0xfa9a('0x1f')));};exports[_0xfa9a('0x20')]=function(_0x4728a0){var _0x203927={};_0x203927['type']=_0x4728a0[_0xfa9a('0x21')];_0x203927['uniqueid']=_0x4728a0[_0xfa9a('0x22')];_0x203927[_0xfa9a('0x23')]=_0x4728a0['calleridnum'];_0x203927[_0xfa9a('0x24')]=_0x4728a0[_0xfa9a('0x24')];_0x203927[_0xfa9a('0x25')]=_0x4728a0[_0xfa9a('0x25')];_0x203927[_0xfa9a('0x26')]=_0x4728a0['answertime'];_0x203927[_0xfa9a('0x27')]=_0x4728a0[_0xfa9a('0x28')];_0x203927[_0xfa9a('0x29')]=0x1;_0x203927[_0xfa9a('0x2a')]=_0x4728a0['endtime'];_0x203927[_0xfa9a('0x2b')]=_0x4728a0['membername'];_0x203927[_0xfa9a('0x2c')]='from-sip';_0x203927['exten']=_0xfa9a('0x2d');_0x203927[_0xfa9a('0x2e')]=0x0;_0x203927[_0xfa9a('0x2f')]=0x1;_0x203927[_0xfa9a('0x30')]=_0x4728a0['membername'];_0x203927[_0xfa9a('0x31')]=_0xfa9a('0x32');return BPromise[_0xfa9a('0xc')]()[_0xfa9a('0x10')](voiceQueueReport[_0xfa9a('0x33')](_0x203927))['catch'](loggerCatch(_0xfa9a('0x34')));};exports[_0xfa9a('0x35')]=function(_0x1c81be,_0x26ae35){return BPromise['resolve']()[_0xfa9a('0x10')](cmHopper['getContactRecallMe'](_0x1c81be,_0x26ae35))[_0xfa9a('0xe')](loggerCatch(_0xfa9a('0x36')));};exports[_0xfa9a('0x37')]=function(_0x212b0e){return BPromise[_0xfa9a('0xc')]()[_0xfa9a('0x10')](cmHopper[_0xfa9a('0x17')](_0x212b0e,!![],!![]))[_0xfa9a('0xe')](loggerCatch(_0xfa9a('0x38')));}; \ No newline at end of file +var _0x86d2=['queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','disableContact','crateCustomerReportQueue','type','calleridnum','calleridname','queue','queuecallerjoinAt','answertime'];(function(_0x32ddad,_0x5a0470){var _0x70b364=function(_0x1b25eb){while(--_0x1b25eb){_0x32ddad['push'](_0x32ddad['shift']());}};_0x70b364(++_0x5a0470);}(_0x86d2,0x1b9));var _0x286d=function(_0x33f9ac,_0x4e7c29){_0x33f9ac=_0x33f9ac-0x0;var _0x48238a=_0x86d2[_0x33f9ac];return _0x48238a;};'use strict';var util=require('util');var BPromise=require(_0x286d('0x0'));var logger=require(_0x286d('0x1'))(_0x286d('0x2'));var _=require(_0x286d('0x3'));var cmHopper=require(_0x286d('0x4'));var cmHopperFinal=require(_0x286d('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x286d('0x6'));var voiceQueueRt=require(_0x286d('0x7'));var agentReportPreview=require(_0x286d('0x8'));var voiceQueueReport=require(_0x286d('0x9'));function loggerCatch(_0x53e3df){return function(_0x5423dc){logger['error'](_0x53e3df,util[_0x286d('0xa')](_0x5423dc,{'showHidden':![],'depth':null}));};}function create(_0x3f1005){return BPromise[_0x286d('0xb')]()[_0x286d('0xc')](cmHopperHistory[_0x286d('0xd')](_0x3f1005))[_0x286d('0xe')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x47ee72){return BPromise[_0x286d('0xb')]()['then'](agentReportPreview[_0x286d('0xd')](_0x47ee72))[_0x286d('0xe')](loggerCatch(_0x286d('0xf')));}function moveContact(_0x65046e){return BPromise[_0x286d('0xb')]()[_0x286d('0xc')](cmHopper[_0x286d('0x10')](_0x65046e,!![]))[_0x286d('0xe')](loggerCatch(_0x286d('0x11')));}exports[_0x286d('0x12')]=function(_0x9afce8){return BPromise[_0x286d('0xb')]()[_0x286d('0xc')](cmHopperBlack[_0x286d('0x12')](_0x9afce8))[_0x286d('0xe')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x286d('0x13')]=function(_0x57a9bd){return BPromise['resolve']()[_0x286d('0xc')](cmHopper[_0x286d('0x13')](_0x57a9bd))[_0x286d('0xe')](loggerCatch('[getContactPreview]\x20'));};exports[_0x286d('0xd')]=function(_0x204993,_0x4e4e8d){create(_0x204993)['catch'](loggerCatch(_0x4e4e8d));moveContact(_0x204993)[_0x286d('0xe')](loggerCatch(_0x4e4e8d));};exports[_0x286d('0x14')]=function(_0x160251,_0x30aa15){createAgent(_0x160251)[_0x286d('0xe')](loggerCatch(_0x30aa15));};exports['createCustomerHistory']=function(_0x11bf5e,_0xe0ac63){create(_0x11bf5e)[_0x286d('0xe')](loggerCatch(_0xe0ac63));};exports[_0x286d('0x15')]=function(_0x1abcc9,_0x1d63dc){moveContact(_0x1abcc9)['catch'](loggerCatch(_0x1d63dc));};exports[_0x286d('0x16')]=function(_0x9f8434,_0xb11297,_0x2ec655){if(_0xb11297){_0x9f8434[_0x286d('0x17')]=null;}if(_0x2ec655){_0x9f8434[_0x286d('0x18')]=![];}return BPromise['resolve']()[_0x286d('0xc')](cmHopper[_0x286d('0x16')](_0x9f8434))[_0x286d('0xe')](loggerCatch(_0x286d('0x19')));};exports[_0x286d('0x1a')]=function(_0x5084cb){return BPromise[_0x286d('0xb')]()[_0x286d('0xc')](cmHopper[_0x286d('0x1a')](_0x5084cb))[_0x286d('0xe')](loggerCatch(_0x286d('0x1b')));};exports['unlockContact']=function(_0x1b9d95){return BPromise['resolve']()[_0x286d('0xc')](cmHopper['unlockContact']({'UserId':null},_0x1b9d95,0x1))[_0x286d('0xe')](loggerCatch('[unlockContact]\x20'));};exports[_0x286d('0x1c')]=function(_0x610e01){return BPromise[_0x286d('0xb')]()[_0x286d('0xc')](cmHopper['unlockContact']({'active':![]},_0x610e01,0x1))[_0x286d('0xe')](loggerCatch('[activeContact]\x20'));};exports[_0x286d('0x1d')]=function(_0x411782){var _0x1d5e94={};_0x1d5e94[_0x286d('0x1e')]=_0x411782[_0x286d('0x1e')];_0x1d5e94['uniqueid']=_0x411782['uniqueid'];_0x1d5e94[_0x286d('0x1f')]=_0x411782[_0x286d('0x1f')];_0x1d5e94['calleridname']=_0x411782[_0x286d('0x20')];_0x1d5e94[_0x286d('0x21')]=_0x411782[_0x286d('0x21')];_0x1d5e94[_0x286d('0x22')]=_0x411782[_0x286d('0x23')];_0x1d5e94['queuecallerleaveAt']=_0x411782[_0x286d('0x23')];_0x1d5e94['queuecallercomplete']=0x1;_0x1d5e94[_0x286d('0x24')]=_0x411782[_0x286d('0x25')];_0x1d5e94[_0x286d('0x26')]=_0x411782[_0x286d('0x27')];_0x1d5e94[_0x286d('0x28')]=_0x286d('0x29');_0x1d5e94[_0x286d('0x2a')]=_0x286d('0x2b');_0x1d5e94[_0x286d('0x2c')]=0x0;_0x1d5e94['assigned']=0x1;_0x1d5e94[_0x286d('0x2d')]=_0x411782[_0x286d('0x27')];_0x1d5e94[_0x286d('0x2e')]=_0x286d('0x2f');return BPromise[_0x286d('0xb')]()[_0x286d('0xc')](voiceQueueReport[_0x286d('0x30')](_0x1d5e94))[_0x286d('0xe')](loggerCatch(_0x286d('0x31')));};exports[_0x286d('0x32')]=function(_0x184a6e,_0x1c1f0c){return BPromise[_0x286d('0xb')]()['then'](cmHopper[_0x286d('0x32')](_0x184a6e,_0x1c1f0c))[_0x286d('0xe')](loggerCatch(_0x286d('0x33')));};exports['rescheduleContactInQueue']=function(_0x5c21cf){return BPromise[_0x286d('0xb')]()[_0x286d('0xc')](cmHopper['rescheduleContact'](_0x5c21cf,!![],!![]))[_0x286d('0xe')](loggerCatch(_0x286d('0x34')));}; \ 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 9b611bc..f8dff0f 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 _0x22af=['countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','add','minutes','ContactId','ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countcongestionretry','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','\x5cw{0,','pow','replace','extractCalleridName','match','noanswer','keys','variables','toLowerCase','buildNoAnswerEventPayload','lodash','moment','../../../../config/logger','milliseconds','diff','loggerCatch','error','logger','inspect','loggerError','logger2','info','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','logLookAgent','membername','logCustomer','ringtime','talktime','answertime','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','calleridnum','xcally-motion-preview','timeout','totalGlobal'];(function(_0x4d3f88,_0x3ee5dd){var _0x47350c=function(_0x2fb09f){while(--_0x2fb09f){_0x4d3f88['push'](_0x4d3f88['shift']());}};_0x47350c(++_0x3ee5dd);}(_0x22af,0x16a));var _0xf22a=function(_0x1be790,_0x112549){_0x1be790=_0x1be790-0x0;var _0x7668c8=_0x22af[_0x1be790];return _0x7668c8;};'use strict';var util=require('util');var _=require(_0xf22a('0x0'));var moment=require(_0xf22a('0x1'));var logger=require(_0xf22a('0x2'))('preview');var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x3878b9,_0x427d57){var _0x239d79=moment(_0x3878b9)[_0xf22a('0x3')](0x0);var _0x3fdded=moment(_0x427d57)['milliseconds'](0x0);return _0x239d79[_0xf22a('0x4')](_0x3fdded,'seconds');}exports[_0xf22a('0x5')]=function(_0x40febb){return function(_0x1a5286){logger[_0xf22a('0x6')](_0x40febb,util['inspect'](_0x1a5286,{'showHidden':![],'depth':null}));};};exports[_0xf22a('0x7')]=function(_0x435317,_0xd37f8){logger['info'](_0x435317,util[_0xf22a('0x8')](_0xd37f8,{'showHidden':![],'depth':null}));};exports[_0xf22a('0x9')]=function(_0x4b7f71,_0x943f8f){logger[_0xf22a('0x6')](_0x4b7f71,util['inspect'](_0x943f8f,{'showHidden':![],'depth':null}));};exports[_0xf22a('0xa')]=function(_0x26d685){return function(_0x4e2fc6){logger[_0xf22a('0xb')](_0x26d685,util[_0xf22a('0x8')](_0x4e2fc6,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x286a54,_0x5bfada,_0x1fc4b6){return{'message':_0x286a54,'unlock':_0x5bfada,'active':_0x1fc4b6};};exports[_0xf22a('0xc')]=function(_0x3474cd,_0x336a7c,_0x2e971c){if(!_[_0xf22a('0xd')](_0x2e971c)&&_0xf22a('0xe')===typeof _0x2e971c&&!_[_0xf22a('0xf')](_0x2e971c)){if(!_[_0xf22a('0xd')](_0x336a7c)&&_0xf22a('0xe')===typeof _0x336a7c&&!_['isEmpty'](_0x336a7c)){return util[_0xf22a('0x10')](_0xf22a('0x11'),_0x336a7c,_0x2e971c);}return util['format'](_0xf22a('0x11'),_0x2e971c,_0x2e971c);}if(!_[_0xf22a('0xd')](_0x3474cd)&&_0xf22a('0xe')===typeof _0x3474cd&&!_[_0xf22a('0xf')](_0x3474cd)){return _0x3474cd;}return'\x22\x22\x20<>';};exports[_0xf22a('0x12')]=function(_0x6663d7){if(_[_0xf22a('0x13')](_0x6663d7)){return![];}return _0x6663d7;};exports[_0xf22a('0x14')]=function(_0x2cb649,_0x1cc3ad,_0x4aeaa1,_0x266fec,_0x639946,_0x4f1547){var _0x46c6aa={'XMD-QUEUE':_0x1cc3ad[_0xf22a('0x15')]?_0x1cc3ad[_0xf22a('0x15')][_0xf22a('0x16')]:'','XMD-CALLERID':_0x266fec,'XMD-CALLERID-PREVIEW':_0x4f1547?util['format'](_0xf22a('0x11'),_0x4f1547[_0xf22a('0x17')],_0x4f1547['calleridnum']):_0x266fec,'XMD-DIALID':_0x639946,'XMD-CONTACTID':_0x1cc3ad['ContactId'],'XMD-CDRTYPE':_0xf22a('0x18'),'CALLERID(all)':_0x266fec,'XMD-VOICEQUEUEID':_0x1cc3ad[_0xf22a('0x19')],'XMD-DIALCHANNEL':_0x4aeaa1,'XMD-DIALTIMEOUT':_0x2cb649['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xf22a('0x10')](_0xf22a('0x1a'),_0x2cb649[_0xf22a('0x1b')]?'g':'',_[_0xf22a('0xf')](_0x2cb649[_0xf22a('0x1c')])?'':_0xf22a('0x1d')),'XMD-DIALURL':_0x2cb649['dialPreviewUrl']||'','XMD-AGI':_0x2cb649[_0xf22a('0x1e')]?util[_0xf22a('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2cb649[_0xf22a('0x1e')]):_0xf22a('0x1f'),'XMD-AGIAFTER':_0x2cb649[_0xf22a('0x1b')]?util[_0xf22a('0x10')](_0xf22a('0x20'),ipAgi,_0x2cb649['dialQueueProject2']):_0xf22a('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x4f1547?_0x4f1547['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x4f1547?_0x4f1547['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0xf22a('0x21')};if(!_[_0xf22a('0xf')](_0x2cb649['monitor_format'])){_0x46c6aa[util[_0xf22a('0x10')]('%s',_0xf22a('0x22'))]=_0x2cb649[_0xf22a('0x1c')];_0x46c6aa[util['format']('%s',_0xf22a('0x23'))]=_0x639946;}if(_0x1cc3ad&&_0x1cc3ad[_0xf22a('0x24')]){for(var _0x55986c in _0x1cc3ad[_0xf22a('0x24')]){if(_0x1cc3ad[_0xf22a('0x24')][_0xf22a('0x25')](_0x55986c)){if(!_['isNil'](_0x1cc3ad['Contact'][_0x55986c])&&_0x55986c!=='id'&&_0x55986c!==_0xf22a('0x26')&&_0x55986c!==_0xf22a('0x27')&&_0x55986c!==_0xf22a('0x28')){_0x46c6aa[util[_0xf22a('0x10')](_0xf22a('0x29'),_0xf22a('0x2a'),_[_0xf22a('0x2b')](_0x55986c))]=_0x1cc3ad[_0xf22a('0x24')][_0x55986c];}}}}return _0x46c6aa;};exports['toLowerVariables']=function(_0x4d7ded){var _0x6e356d={};for(var _0x4eccf7 in _0x4d7ded){if(_0x4d7ded[_0xf22a('0x25')](_0x4eccf7)){_0x6e356d[util['format']('%s',_['toLower'](_0x4eccf7))]=_0x4d7ded[_0x4eccf7];}}return{'variables':_0x6e356d};};exports[_0xf22a('0x2c')]=function(_0x4028a4,_0x4267e6){if(!_[_0xf22a('0x13')](_0x4028a4)){if(_0x4028a4['hasOwnProperty'](_0xf22a('0x2d'))){if(_0x4028a4[_0xf22a('0x2d')]>0x0){_0x4028a4[_0xf22a('0x2d')]-=0x1;}else{logger['error'](_0xf22a('0x2e'),_0x4267e6);}}}else{logger[_0xf22a('0x6')](_0xf22a('0x2f'),_0x4267e6);}};exports[_0xf22a('0x30')]=function(_0x87a752){var _0x29e990=moment()[_0xf22a('0x10')](_0xf22a('0x31'));_0x87a752[_0xf22a('0x32')]=0xd;_0x87a752[_0xf22a('0x33')]=_0xf22a('0x34');_0x87a752[_0xf22a('0x35')]=_0x29e990;_0x87a752[_0xf22a('0x36')]=_0x29e990;_0x87a752[_0xf22a('0x37')]=_0x29e990;};exports[_0xf22a('0x38')]=function(_0x2a94dc,_0x3c8b50,_0x554014){var _0x57361b=moment()['format'](_0xf22a('0x31'));_0x2a94dc[_0xf22a('0x32')]=_0x3c8b50;_0x2a94dc[_0xf22a('0x33')]=_0x554014;_0x2a94dc[_0xf22a('0x36')]=_0x57361b;_0x2a94dc['ringtime']=getSeconds(_0x2a94dc[_0xf22a('0x36')],_0x2a94dc['starttime']);};exports[_0xf22a('0x39')]=function(_0x13af9c,_0x346f27,_0x33a77d){_0x13af9c[_0xf22a('0x3a')]=_0x346f27;_0x13af9c['UserId']=_0x33a77d;};exports[_0xf22a('0x3b')]=function(_0xe48314,_0x4a6e80,_0x38cf40){var _0x45df12=moment()[_0xf22a('0x10')](_0xf22a('0x31'));_0xe48314[_0xf22a('0x32')]=_0x4a6e80;_0xe48314[_0xf22a('0x33')]=_0x38cf40;_0xe48314[_0xf22a('0x36')]=_0xe48314[_0xf22a('0x36')]?_0xe48314[_0xf22a('0x36')]:_0x45df12;_0xe48314[_0xf22a('0x37')]=_0xe48314[_0xf22a('0x37')]?_0xe48314[_0xf22a('0x37')]:_0x45df12;_0xe48314[_0xf22a('0x3c')]=getSeconds(_0xe48314['responsetime']||0x0,_0xe48314['starttime']||0x0);_0xe48314[_0xf22a('0x3d')]=_0xe48314[_0xf22a('0x3e')]?getSeconds(_0xe48314[_0xf22a('0x37')],_0xe48314[_0xf22a('0x3e')]):0x0;};exports['isFailure']=function(_0x87df7f){return _0x87df7f===_0xf22a('0x3f');};exports[_0xf22a('0x40')]=function(_0x1f8bc8,_0xd1338a,_0x3fd4b5,_0x11b608,_0x3bfe92){var _0x3db6f7=_0x11b608?'RECALL':_0x1f8bc8[_0xf22a('0x17')];_0x3db6f7=_0x3bfe92?_0xf22a('0x41'):_0x3db6f7;return{'actionid':_0x1f8bc8[_0xf22a('0x42')],'action':_0xf22a('0x43'),'channel':_0x1f8bc8[_0xf22a('0x44')],'callerid':util['format'](_0xf22a('0x11'),_0x3db6f7,_0x1f8bc8[_0xf22a('0x45')]),'Exten':_0xf22a('0x46'),'Context':'from-sip','Priority':'1','variable':_0x3fd4b5,'timeout':(_0xd1338a[_0xf22a('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1f8bc8[_0xf22a('0x42')]};};exports[_0xf22a('0x48')]=function(_0x3b7ce8){return _0x3b7ce8[_0xf22a('0x49')]+_0x3b7ce8['countcongestionretry']+_0x3b7ce8[_0xf22a('0x4a')]+_0x3b7ce8[_0xf22a('0x4b')]+_0x3b7ce8[_0xf22a('0x4c')];};exports[_0xf22a('0x4d')]=function(_0x38dd7f){var _0x816668=_[_0xf22a('0x4e')](_0x38dd7f);_0x816668[_0xf22a('0x32')]=0xf;_0x816668[_0xf22a('0x33')]=_0xf22a('0x4f');return _0x816668;};exports[_0xf22a('0x50')]=function(_0x45d1e2,_0x58a959,_0x293fe3){var _0x7a615e={};_0x7a615e[_0x58a959]=_0x45d1e2[_0x58a959];_0x7a615e[_0xf22a('0x51')]=![];_0x7a615e['scheduledat']=moment()[_0xf22a('0x52')](_0x293fe3,_0xf22a('0x53'))[_0xf22a('0x10')](_0xf22a('0x31'));_0x7a615e[_0xf22a('0x54')]=_0x45d1e2[_0xf22a('0x54')];_0x7a615e[_0xf22a('0x55')]=_0x45d1e2['ListId'];_0x7a615e[_0xf22a('0x19')]=_0x45d1e2[_0xf22a('0x19')]||undefined;return _0x7a615e;};exports[_0xf22a('0x56')]=function(_0x51666b,_0xec6539){if(!_['isNil'](_0x51666b)){if(_0x51666b['pTalking']>0x0){_0x51666b['pTalking']-=0x1;}else{logger[_0xf22a('0x6')](_0xec6539,_0xf22a('0x57'));}}else{logger[_0xf22a('0x6')](_0xec6539,_0xf22a('0x58'));}};exports[_0xf22a('0x59')]=function(_0x1f3457){if(_0x1f3457<=0x0){return!![];}return![];};function buildObj(_0x18e010,_0x4f63de,_0x28c9ce){_0x18e010[_0xf22a('0x5a')]=_0x4f63de;_0x18e010[_0xf22a('0x16')]=_0x18e010[_0xf22a('0x5b')];_0x18e010[_0xf22a('0x5c')]=_0x18e010[_0xf22a('0x44')];_0x18e010[_0xf22a('0x5d')]=_0xf22a('0x5e');if(_0x28c9ce){_0x18e010['mandatoryDisposition']=_0x28c9ce[_0xf22a('0x5f')];}return _0x18e010;}exports[_0xf22a('0x60')]=buildObj;exports[_0xf22a('0x61')]=function(_0x146788){var _0x634ae0={};_0x634ae0[_0xf22a('0x5b')]=_0x146788[_0xf22a('0x5b')];_0x634ae0[_0xf22a('0x5c')]=_0x146788[_0xf22a('0x44')];_0x634ae0[_0xf22a('0x42')]=_0x146788['uniqueid'];return _0x634ae0;};exports[_0xf22a('0x62')]=function(_0x181a9d){var _0x139846=[];for(var _0x102f7b in _0x181a9d){if(_0x181a9d[_0xf22a('0x25')](_0x102f7b)){if(!_[_0xf22a('0x13')](_0x181a9d[_0x102f7b])&&_0x181a9d[_0x102f7b]['state']===_0xf22a('0x63')&&_0x181a9d[_0x102f7b][_0xf22a('0x64')]===_0xf22a('0x65')){_0x139846[_0xf22a('0x66')](_0x181a9d[_0x102f7b]['id']);}}}return _0x139846;};exports[_0xf22a('0x67')]=function(_0x589c36){var _0x4f9eee=moment()[_0xf22a('0x3')](0x0);var _0x3e5f12=moment(_0x589c36)[_0xf22a('0x3')](0x0);return _0x4f9eee[_0xf22a('0x4')](_0x3e5f12,_0xf22a('0x68'));};exports[_0xf22a('0x69')]=function(_0x409ea2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x409ea2['ContactId'],'ListId':_0x409ea2[_0xf22a('0x55')],'VoiceQueueId':_0x409ea2[_0xf22a('0x19')]||undefined,'CampaignId':_0x409ea2[_0xf22a('0x6a')]||undefined};};exports[_0xf22a('0x6b')]=function(_0x12f206){if(_0x12f206==='uniqueid'||_0x12f206===_0xf22a('0x6c')||_0x12f206===_0xf22a('0x5b')||_0x12f206===_0xf22a('0x6d')||_0x12f206===_0xf22a('0x6e')||_0x12f206===_0xf22a('0x6f')||_0x12f206==='membername'||_0x12f206==='channelAgent'||_0x12f206===_0xf22a('0x17')||_0x12f206===_0xf22a('0x51')||_0x12f206==='calleridnum'||_0x12f206==='scheduledat'||_0x12f206===_0xf22a('0x49')||_0x12f206===_0xf22a('0x70')||_0x12f206==='countnoanswerretry'||_0x12f206==='countglobal'||_0x12f206===_0xf22a('0x71')||_0x12f206===_0xf22a('0x72')||_0x12f206===_0xf22a('0x73')||_0x12f206===_0xf22a('0x74')||_0x12f206===_0xf22a('0x54')||_0x12f206===_0xf22a('0x55')||_0x12f206==='UserId'||_0x12f206===_0xf22a('0x19')||_0x12f206===_0xf22a('0x75')||_0x12f206===_0xf22a('0x76')||_0x12f206===_0xf22a('0x77')||_0x12f206==='xmd-phone'||_0x12f206==='xmd-listid'||_0x12f206==='xmd-dialurl'||_0x12f206===_0xf22a('0x78')||_0x12f206==='xmd-dialoptions'||_0x12f206===_0xf22a('0x79')||_0x12f206===_0xf22a('0x7a')||_0x12f206==='xmd-contactid'||_0x12f206===_0xf22a('0x7b')||_0x12f206===_0xf22a('0x7c')||_0x12f206===_0xf22a('0x7d')||_0x12f206===_0xf22a('0x7e')||_0x12f206===_0xf22a('0x7f')||_0x12f206===_0xf22a('0x80')||_0x12f206===_0xf22a('0x81')||_0x12f206===_0xf22a('0x82')||_0x12f206===_0xf22a('0x83')||_0x12f206===_0xf22a('0x84')||_0x12f206===_0xf22a('0x85')||_0x12f206===_0xf22a('0x86')||_0x12f206===_0xf22a('0x7f')||_0x12f206===_0xf22a('0x80')||_0x12f206==='rtpaudioqosjitter'||_0x12f206==='rtpaudioqosjitterbridged'||_0x12f206===_0xf22a('0x83')||_0x12f206===_0xf22a('0x84')||_0x12f206==='rtpaudioqosrtt'||_0x12f206===_0xf22a('0x86')||_0x12f206==='bridgepeer'||_0x12f206==='bridgepvtcallid'||_0x12f206===_0xf22a('0x32')||_0x12f206==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x53346f,_0x5c0dab){var _0x31a5ab,_0x549d9a,_0x3f2b78;if(_0x5c0dab<=0x0){_0x5c0dab=0x1;}_0x31a5ab=new RegExp(_0xf22a('0x87')+_0x5c0dab+'}$');_0x549d9a=Math[_0xf22a('0x88')](0xa,_0x5c0dab-0x1);_0x3f2b78=Math[_0xf22a('0x88')](0xa,_0x5c0dab)-0x1;return util[_0xf22a('0x10')]('%s',_[_0xf22a('0x89')](_0x53346f,_0x31a5ab,_['random'](_0x549d9a,_0x3f2b78)));};exports[_0xf22a('0x8a')]=function(_0xf15b55){var _0x311a1b=_0xf15b55[_0xf22a('0x8b')](/"(.*?)"/);return _0x311a1b?_0x311a1b[0x1]:_0xf15b55;};exports['extractCalleridNumber']=function(_0x3a6f74){var _0x5ca22e=_0x3a6f74[_0xf22a('0x8b')](/<(.*?)>/);return _0x5ca22e?_0x5ca22e[0x1]:_0x3a6f74;};function buildNoAnswerEventPayload(_0x84e6e5,_0xcefd60){var _0x432f09=buildObj(_0x84e6e5,_0xf22a('0x8c'));if(!_[_0xf22a('0xf')](_0xcefd60['variables'])){Object[_0xf22a('0x8d')](_0xcefd60[_0xf22a('0x8e')])['forEach'](function(_0x26a15a){_0x432f09[_0x26a15a[_0xf22a('0x8f')]()]=_0xcefd60[_0xf22a('0x8e')][_0x26a15a];});}return _0x432f09;}exports[_0xf22a('0x90')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x7742=['\x22\x22\x20<>','isNil','addVariables','name','calleridname','calleridnum','ContactId','dialer','dialQueueProject2','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','ringtime','membername','logCustomer','endtime','answertime','isFailure','RECALL','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','queue','interface','not_inuse','status','reachable','push','filterKey','type','dialAnswer','countbusyretry','countnoanswerretry','countglobal','callback','recallme','UserId','sipcallid','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','moment','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','logger','info','inspect','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7742,0x74));var _0x2774=function(_0x321fea,_0xbd752a){_0x321fea=_0x321fea-0x0;var _0x55a101=_0x7742[_0x321fea];return _0x55a101;};'use strict';var util=require(_0x2774('0x0'));var _=require('lodash');var moment=require(_0x2774('0x1'));var logger=require('../../../../config/logger')(_0x2774('0x2'));var ipAgi=process[_0x2774('0x3')][_0x2774('0x4')]||'127.0.0.1';function getSeconds(_0x37ed24,_0x4d21b1){var _0x4f4b73=moment(_0x37ed24)['milliseconds'](0x0);var _0x11e303=moment(_0x4d21b1)[_0x2774('0x5')](0x0);return _0x4f4b73[_0x2774('0x6')](_0x11e303,_0x2774('0x7'));}exports[_0x2774('0x8')]=function(_0x3781e9){return function(_0xd4324c){logger[_0x2774('0x9')](_0x3781e9,util['inspect'](_0xd4324c,{'showHidden':![],'depth':null}));};};exports[_0x2774('0xa')]=function(_0x361e5a,_0x260257){logger[_0x2774('0xb')](_0x361e5a,util[_0x2774('0xc')](_0x260257,{'showHidden':![],'depth':null}));};exports[_0x2774('0xd')]=function(_0x51049e,_0x4f6925){logger[_0x2774('0x9')](_0x51049e,util['inspect'](_0x4f6925,{'showHidden':![],'depth':null}));};exports[_0x2774('0xe')]=function(_0x2e80fa){return function(_0x2469da){logger[_0x2774('0xb')](_0x2e80fa,util[_0x2774('0xc')](_0x2469da,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x1ae6bc,_0x90acf1,_0x508b57){return{'message':_0x1ae6bc,'unlock':_0x90acf1,'active':_0x508b57};};exports[_0x2774('0xf')]=function(_0x484aec,_0x1a892c,_0x12121a){if(!_[_0x2774('0x10')](_0x12121a)&&_0x2774('0x11')===typeof _0x12121a&&!_[_0x2774('0x12')](_0x12121a)){if(!_[_0x2774('0x10')](_0x1a892c)&&_0x2774('0x11')===typeof _0x1a892c&&!_[_0x2774('0x12')](_0x1a892c)){return util['format'](_0x2774('0x13'),_0x1a892c,_0x12121a);}return util[_0x2774('0x14')]('\x22%s\x22\x20<%s>',_0x12121a,_0x12121a);}if(!_[_0x2774('0x10')](_0x484aec)&&_0x2774('0x11')===typeof _0x484aec&&!_['isEmpty'](_0x484aec)){return _0x484aec;}return _0x2774('0x15');};exports['isActive']=function(_0x598ab7){if(_[_0x2774('0x16')](_0x598ab7)){return![];}return _0x598ab7;};exports[_0x2774('0x17')]=function(_0x4baf13,_0x3be034,_0x4f6bff,_0x473710,_0x2eb6be,_0x5a373a){var _0x2620ca={'XMD-QUEUE':_0x3be034['Queue']?_0x3be034['Queue'][_0x2774('0x18')]:'','XMD-CALLERID':_0x473710,'XMD-CALLERID-PREVIEW':_0x5a373a?util[_0x2774('0x14')](_0x2774('0x13'),_0x5a373a[_0x2774('0x19')],_0x5a373a[_0x2774('0x1a')]):_0x473710,'XMD-DIALID':_0x2eb6be,'XMD-CONTACTID':_0x3be034[_0x2774('0x1b')],'XMD-CDRTYPE':_0x2774('0x1c'),'CALLERID(all)':_0x473710,'XMD-VOICEQUEUEID':_0x3be034['VoiceQueueId'],'XMD-DIALCHANNEL':_0x4f6bff,'XMD-DIALTIMEOUT':_0x4baf13['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x2774('0x14')]('\x22rtTxX%s%s\x22',_0x4baf13[_0x2774('0x1d')]?'g':'',_[_0x2774('0x12')](_0x4baf13['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x4baf13[_0x2774('0x1e')]||'','XMD-AGI':_0x4baf13['dialQueueProject']?util[_0x2774('0x14')](_0x2774('0x1f'),ipAgi,_0x4baf13[_0x2774('0x20')]):'NONE','XMD-AGIAFTER':_0x4baf13[_0x2774('0x1d')]?util[_0x2774('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4baf13[_0x2774('0x1d')]):_0x2774('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x5a373a?_0x5a373a[_0x2774('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x5a373a?_0x5a373a['originatecalleridname']:'','XMD-DESTINATION':_0x2774('0x23'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x2774('0x12')](_0x4baf13[_0x2774('0x24')])){_0x2620ca[util[_0x2774('0x14')]('%s',_0x2774('0x25'))]=_0x4baf13[_0x2774('0x24')];_0x2620ca[util[_0x2774('0x14')]('%s',_0x2774('0x26'))]=_0x2eb6be;}if(_0x3be034&&_0x3be034[_0x2774('0x27')]){for(var _0x197145 in _0x3be034['Contact']){if(_0x3be034[_0x2774('0x27')]['hasOwnProperty'](_0x197145)){if(!_[_0x2774('0x16')](_0x3be034['Contact'][_0x197145])&&_0x197145!=='id'&&_0x197145!==_0x2774('0x28')&&_0x197145!==_0x2774('0x29')&&_0x197145!=='updatedAt'){_0x2620ca[util['format']('%s%s',_0x2774('0x2a'),_[_0x2774('0x2b')](_0x197145))]=_0x3be034[_0x2774('0x27')][_0x197145];}}}}return _0x2620ca;};exports[_0x2774('0x2c')]=function(_0x475b88){var _0x2a6c12={};for(var _0x70a0b0 in _0x475b88){if(_0x475b88[_0x2774('0x2d')](_0x70a0b0)){_0x2a6c12[util[_0x2774('0x14')]('%s',_[_0x2774('0x2e')](_0x70a0b0))]=_0x475b88[_0x70a0b0];}}return{'variables':_0x2a6c12};};exports['updateOriginated']=function(_0x2e84c3,_0x5a4691){if(!_[_0x2774('0x16')](_0x2e84c3)){if(_0x2e84c3[_0x2774('0x2d')](_0x2774('0x2f'))){if(_0x2e84c3['originated']>0x0){_0x2e84c3[_0x2774('0x2f')]-=0x1;}else{logger[_0x2774('0x9')](_0x2774('0x30'),_0x5a4691);}}}else{logger[_0x2774('0x9')](_0x2774('0x31'),_0x5a4691);}};exports['logBlacklist']=function(_0x144c00){var _0x532216=moment()[_0x2774('0x14')](_0x2774('0x32'));_0x144c00[_0x2774('0x33')]=0xd;_0x144c00[_0x2774('0x34')]=_0x2774('0x35');_0x144c00[_0x2774('0x36')]=_0x532216;_0x144c00[_0x2774('0x37')]=_0x532216;_0x144c00['endtime']=_0x532216;};exports[_0x2774('0x38')]=function(_0xa5c3ba,_0x5438a1,_0x16f035){var _0x357002=moment()['format'](_0x2774('0x32'));_0xa5c3ba[_0x2774('0x33')]=_0x5438a1;_0xa5c3ba[_0x2774('0x34')]=_0x16f035;_0xa5c3ba[_0x2774('0x37')]=_0x357002;_0xa5c3ba[_0x2774('0x39')]=getSeconds(_0xa5c3ba[_0x2774('0x37')],_0xa5c3ba[_0x2774('0x36')]);};exports['logLookAgent']=function(_0x1865c2,_0x44efd6,_0x46b05d){_0x1865c2[_0x2774('0x3a')]=_0x44efd6;_0x1865c2['UserId']=_0x46b05d;};exports[_0x2774('0x3b')]=function(_0x2fb3e1,_0x1a4c1e,_0x5e1cda){var _0x5515cb=moment()[_0x2774('0x14')](_0x2774('0x32'));_0x2fb3e1[_0x2774('0x33')]=_0x1a4c1e;_0x2fb3e1[_0x2774('0x34')]=_0x5e1cda;_0x2fb3e1[_0x2774('0x37')]=_0x2fb3e1[_0x2774('0x37')]?_0x2fb3e1[_0x2774('0x37')]:_0x5515cb;_0x2fb3e1[_0x2774('0x3c')]=_0x2fb3e1[_0x2774('0x3c')]?_0x2fb3e1[_0x2774('0x3c')]:_0x5515cb;_0x2fb3e1[_0x2774('0x39')]=getSeconds(_0x2fb3e1[_0x2774('0x37')]||0x0,_0x2fb3e1[_0x2774('0x36')]||0x0);_0x2fb3e1['talktime']=_0x2fb3e1[_0x2774('0x3d')]?getSeconds(_0x2fb3e1[_0x2774('0x3c')],_0x2fb3e1['answertime']):0x0;};exports[_0x2774('0x3e')]=function(_0x494a4d){return _0x494a4d==='Failure';};exports['variablesAction']=function(_0x375101,_0x5ab232,_0x36f329,_0x262756,_0x3390c2){var _0x180719=_0x262756?_0x2774('0x3f'):_0x375101[_0x2774('0x19')];_0x180719=_0x3390c2?'BOOKED':_0x180719;return{'actionid':_0x375101[_0x2774('0x40')],'action':_0x2774('0x41'),'channel':_0x375101[_0x2774('0x42')],'callerid':util[_0x2774('0x14')](_0x2774('0x13'),_0x180719,_0x375101['calleridnum']),'Exten':'xcally-motion-preview','Context':_0x2774('0x43'),'Priority':'1','variable':_0x36f329,'timeout':(_0x5ab232[_0x2774('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x375101[_0x2774('0x40')]};};exports[_0x2774('0x45')]=function(_0x5ec840){return _0x5ec840['countbusyretry']+_0x5ec840[_0x2774('0x46')]+_0x5ec840['countnoanswerretry']+_0x5ec840[_0x2774('0x47')]+_0x5ec840[_0x2774('0x48')];};exports['cloneAction']=function(_0x2f11a7){var _0x2eae86=_[_0x2774('0x49')](_0x2f11a7);_0x2eae86[_0x2774('0x33')]=0xf;_0x2eae86['statedesc']=_0x2774('0x4a');return _0x2eae86;};exports[_0x2774('0x4b')]=function(_0x34bb82,_0x7dddc,_0x1d8b5f){var _0x4f5f44={};_0x4f5f44[_0x7dddc]=_0x34bb82[_0x7dddc];_0x4f5f44['active']=![];_0x4f5f44['scheduledat']=moment()[_0x2774('0x4c')](_0x1d8b5f,_0x2774('0x4d'))[_0x2774('0x14')](_0x2774('0x32'));_0x4f5f44[_0x2774('0x1b')]=_0x34bb82['ContactId'];_0x4f5f44[_0x2774('0x4e')]=_0x34bb82['ListId'];_0x4f5f44[_0x2774('0x4f')]=_0x34bb82[_0x2774('0x4f')]||undefined;return _0x4f5f44;};exports[_0x2774('0x50')]=function(_0x4a63ae,_0x155542){if(!_[_0x2774('0x16')](_0x4a63ae)){if(_0x4a63ae[_0x2774('0x51')]>0x0){_0x4a63ae[_0x2774('0x51')]-=0x1;}else{logger[_0x2774('0x9')](_0x155542,_0x2774('0x52'));}}else{logger[_0x2774('0x9')](_0x155542,_0x2774('0x53'));}};exports[_0x2774('0x54')]=function(_0x597de8){if(_0x597de8<=0x0){return!![];}return![];};function buildObj(_0x3e9092,_0x39bc5c,_0x148b74){_0x3e9092[_0x2774('0x55')]=_0x39bc5c;_0x3e9092[_0x2774('0x18')]=_0x3e9092['queue'];_0x3e9092['interface']=_0x3e9092['channelAgent'];_0x3e9092[_0x2774('0x56')]=_0x2774('0x57');if(_0x148b74){_0x3e9092[_0x2774('0x58')]=_0x148b74[_0x2774('0x58')];}return _0x3e9092;}exports[_0x2774('0x59')]=buildObj;exports[_0x2774('0x5a')]=function(_0x403343){var _0x2ebebb={};_0x2ebebb[_0x2774('0x5b')]=_0x403343[_0x2774('0x5b')];_0x2ebebb[_0x2774('0x5c')]=_0x403343[_0x2774('0x42')];_0x2ebebb[_0x2774('0x40')]=_0x403343[_0x2774('0x40')];return _0x2ebebb;};exports['agentReadyId']=function(_0x1fff09){var _0x13f606=[];for(var _0x47b57f in _0x1fff09){if(_0x1fff09['hasOwnProperty'](_0x47b57f)){if(!_['isNil'](_0x1fff09[_0x47b57f])&&_0x1fff09[_0x47b57f]['state']===_0x2774('0x5d')&&_0x1fff09[_0x47b57f][_0x2774('0x5e')]===_0x2774('0x5f')){_0x13f606[_0x2774('0x60')](_0x1fff09[_0x47b57f]['id']);}}}return _0x13f606;};exports['getDiff']=function(_0x50a415){var _0x561e1f=moment()[_0x2774('0x5')](0x0);var _0x4d44f0=moment(_0x50a415)['milliseconds'](0x0);return _0x561e1f[_0x2774('0x6')](_0x4d44f0,_0x2774('0x7'));};exports['createBody']=function(_0x3caf3c){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3caf3c[_0x2774('0x1b')],'ListId':_0x3caf3c[_0x2774('0x4e')],'VoiceQueueId':_0x3caf3c[_0x2774('0x4f')]||undefined,'CampaignId':_0x3caf3c['CampaignId']||undefined};};exports[_0x2774('0x61')]=function(_0x25879c){if(_0x25879c==='uniqueid'||_0x25879c==='idContact'||_0x25879c===_0x2774('0x5b')||_0x25879c===_0x2774('0x62')||_0x25879c==='campaigntype'||_0x25879c===_0x2774('0x63')||_0x25879c==='membername'||_0x25879c===_0x2774('0x42')||_0x25879c==='calleridname'||_0x25879c==='active'||_0x25879c===_0x2774('0x1a')||_0x25879c==='scheduledat'||_0x25879c===_0x2774('0x64')||_0x25879c===_0x2774('0x46')||_0x25879c===_0x2774('0x65')||_0x25879c===_0x2774('0x66')||_0x25879c===_0x2774('0x67')||_0x25879c==='callbackuniqueid'||_0x25879c==='callbackat'||_0x25879c===_0x2774('0x68')||_0x25879c===_0x2774('0x1b')||_0x25879c==='ListId'||_0x25879c===_0x2774('0x69')||_0x25879c===_0x2774('0x4f')||_0x25879c===_0x2774('0x6a')||_0x25879c==='xmd-voicequeueid'||_0x25879c==='xmd-queue'||_0x25879c==='xmd-phone'||_0x25879c===_0x2774('0x6b')||_0x25879c===_0x2774('0x6c')||_0x25879c==='xmd-dialtimeout'||_0x25879c===_0x2774('0x6d')||_0x25879c===_0x2774('0x6e')||_0x25879c===_0x2774('0x6f')||_0x25879c===_0x2774('0x70')||_0x25879c===_0x2774('0x71')||_0x25879c===_0x2774('0x72')||_0x25879c===_0x2774('0x73')||_0x25879c===_0x2774('0x74')||_0x25879c===_0x2774('0x75')||_0x25879c===_0x2774('0x76')||_0x25879c===_0x2774('0x77')||_0x25879c===_0x2774('0x78')||_0x25879c==='rtpaudioqosloss'||_0x25879c===_0x2774('0x79')||_0x25879c===_0x2774('0x7a')||_0x25879c===_0x2774('0x7b')||_0x25879c===_0x2774('0x75')||_0x25879c===_0x2774('0x76')||_0x25879c===_0x2774('0x77')||_0x25879c==='rtpaudioqosjitterbridged'||_0x25879c===_0x2774('0x7c')||_0x25879c===_0x2774('0x79')||_0x25879c===_0x2774('0x7a')||_0x25879c===_0x2774('0x7b')||_0x25879c===_0x2774('0x7d')||_0x25879c==='bridgepvtcallid'||_0x25879c===_0x2774('0x33')||_0x25879c===_0x2774('0x34')){return![];}return!![];};exports[_0x2774('0x7e')]=function(_0x43fe4a,_0x1e0a69){var _0x434ba9,_0x5c018f,_0x5da840;if(_0x1e0a69<=0x0){_0x1e0a69=0x1;}_0x434ba9=new RegExp(_0x2774('0x7f')+_0x1e0a69+'}$');_0x5c018f=Math[_0x2774('0x80')](0xa,_0x1e0a69-0x1);_0x5da840=Math[_0x2774('0x80')](0xa,_0x1e0a69)-0x1;return util[_0x2774('0x14')]('%s',_[_0x2774('0x81')](_0x43fe4a,_0x434ba9,_['random'](_0x5c018f,_0x5da840)));};exports[_0x2774('0x82')]=function(_0xfb0dc0){var _0x471c60=_0xfb0dc0[_0x2774('0x83')](/"(.*?)"/);return _0x471c60?_0x471c60[0x1]:_0xfb0dc0;};exports['extractCalleridNumber']=function(_0x550462){var _0x25dd9b=_0x550462[_0x2774('0x83')](/<(.*?)>/);return _0x25dd9b?_0x25dd9b[0x1]:_0x550462;};function buildNoAnswerEventPayload(_0x36771b,_0x57ef97){var _0x2a40b7=buildObj(_0x36771b,_0x2774('0x84'));if(!_[_0x2774('0x12')](_0x57ef97[_0x2774('0x85')])){Object['keys'](_0x57ef97[_0x2774('0x85')])[_0x2774('0x86')](function(_0x40905a){_0x2a40b7[_0x40905a[_0x2774('0x87')]()]=_0x57ef97['variables'][_0x40905a];});}return _0x2a40b7;}exports[_0x2774('0x88')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 8a32031..adf4251 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 _0x1aa9=['boolean','queuepause','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1aa9,0x7e));var _0x91aa=function(_0x43dd40,_0x431145){_0x43dd40=_0x43dd40-0x0;var _0x200de4=_0x1aa9[_0x43dd40];return _0x200de4;};'use strict';exports['queueadd']={'queue':{'type':_0x91aa('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x91aa('0x0'),'required':!![]},'penalty':{'type':_0x91aa('0x1'),'required':![]},'paused':{'type':_0x91aa('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x91aa('0x0'),'required':!![]}};exports[_0x91aa('0x3')]={'interface':{'type':_0x91aa('0x0'),'required':!![]},'paused':{'type':_0x91aa('0x2')},'reason':{'type':_0x91aa('0x0'),'required':![]}};exports[_0x91aa('0x4')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x91aa('0x0'),'required':!![]}};exports[_0x91aa('0x5')]={'uniqueid':{'type':_0x91aa('0x0'),'required':!![]},'filename':{'type':_0x91aa('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':_0x91aa('0x0')}};exports[_0x91aa('0x6')]={'uniqueid':{'type':_0x91aa('0x0'),'required':!![]}};exports[_0x91aa('0x7')]={'uniqueid':{'type':_0x91aa('0x0'),'required':!![]},'exten':{'type':_0x91aa('0x0'),'required':!![]},'context':{'type':_0x91aa('0x0')}}; \ No newline at end of file +var _0x2c06=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','queueremove','queuepause','boolean','reload','voicequeuechannel'];(function(_0xfe101e,_0x527731){var _0x40eaca=function(_0x2f21ca){while(--_0x2f21ca){_0xfe101e['push'](_0xfe101e['shift']());}};_0x40eaca(++_0x527731);}(_0x2c06,0x1dc));var _0x62c0=function(_0x57aa50,_0x250309){_0x57aa50=_0x57aa50-0x0;var _0x27ee49=_0x2c06[_0x57aa50];return _0x27ee49;};'use strict';exports[_0x62c0('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x62c0('0x1'),'required':!![]},'penalty':{'type':_0x62c0('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x62c0('0x3')]={'queue':{'type':_0x62c0('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x62c0('0x4')]={'interface':{'type':_0x62c0('0x1'),'required':!![]},'paused':{'type':_0x62c0('0x5')},'reason':{'type':_0x62c0('0x1'),'required':![]}};exports[_0x62c0('0x6')]={'module':{'type':_0x62c0('0x1'),'required':![]}};exports[_0x62c0('0x7')]={'uniqueid':{'type':_0x62c0('0x1'),'required':!![]}};exports[_0x62c0('0x8')]={'uniqueid':{'type':_0x62c0('0x1'),'required':!![]},'filename':{'type':_0x62c0('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x62c0('0x9')]={'uniqueid':{'type':_0x62c0('0x1'),'required':!![]}};exports[_0x62c0('0xa')]={'uniqueid':{'type':_0x62c0('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index fa9e556..30ad212 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 _0x6b1b=['ivrTotalCallsDays','ivrAnswerCallsDay','answered','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','isUndefined','initTelephones','telephones','length','initTrunks','trunks','initVoiceQueues','voiceQueues','initTriggers','triggers','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initServicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','queuecallerabandonAt','queuecallerexitAt','seconds','queuecallercompleteAt','diff','initVoiceCallReports','outbound','duration','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','faxAccounts','exports','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/freshsalesAccount','agents','campaigns','templates','voiceExtensions','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','mapKeys','format','hasOwnProperty','isNil','interface','SIP/%s','name','total','sumHoldTime','sumBillable','isEmpty'];(function(_0x39321e,_0x38a59c){var _0x27d3c8=function(_0x5cbeec){while(--_0x5cbeec){_0x39321e['push'](_0x39321e['shift']());}};_0x27d3c8(++_0x38a59c);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x6b1b[_0xf50820];return _0x2a9b10;};'use strict';var util=require('util');var _=require(_0xb6b1('0x0'));var moment=require(_0xb6b1('0x1'));var Agent=require(_0xb6b1('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0xb6b1('0x3'));var VoiceQueue=require(_0xb6b1('0x4'));var Trigger=require(_0xb6b1('0x5'));var Template=require(_0xb6b1('0x6'));var Campaign=require(_0xb6b1('0x7'));var VoiceExtension=require(_0xb6b1('0x8'));var ZendeskAccount=require(_0xb6b1('0x9'));var SalesforceAccount=require(_0xb6b1('0xa'));var FreshdeskAccount=require(_0xb6b1('0xb'));var SugarcrmAccount=require(_0xb6b1('0xc'));var ZohoAccount=require(_0xb6b1('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xb6b1('0xe'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0xb6b1('0xf'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xb6b1('0x10')]={};this['telephones']={};this['trunks']={};this['voiceQueues']={};this['triggers']={};this[_0xb6b1('0x11')]={};this[_0xb6b1('0x12')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xb6b1('0x13')]={};this['channels']={};this['queueChannels']={};this[_0xb6b1('0x14')]={};this[_0xb6b1('0x15')]={};this[_0xb6b1('0x16')]={};this[_0xb6b1('0x17')]={};this[_0xb6b1('0x18')]={};this[_0xb6b1('0x19')]={};this[_0xb6b1('0x1a')]={};this[_0xb6b1('0x1b')]={};this[_0xb6b1('0x1c')]={};this[_0xb6b1('0x1d')]={};this[_0xb6b1('0x1e')]={};this[_0xb6b1('0x1f')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x513207,_0x51f25f,_0xee229d){var _0x12c595=_[_0xb6b1('0x20')](_0x513207,function(_0x2b72e5,_0x32e395){return _0x2b72e5[_0xee229d];});for(var _0x51fb33 in _0x51f25f){if(_0x51f25f['hasOwnProperty'](_0x51fb33)){if(!_0x12c595[_0x51fb33]){delete _0x51f25f[_0x51fb33];}}}}function freeIsNotKeySip(_0x581e28,_0x1bdf63){var _0x15456d=_[_0xb6b1('0x20')](_0x581e28,function(_0x11e8ae,_0x45d9e6){return util[_0xb6b1('0x21')]('SIP/%s',_0x11e8ae['name']);});for(var _0x43312e in _0x1bdf63){if(_0x1bdf63[_0xb6b1('0x22')](_0x43312e)){if(!_0x15456d[_0x43312e]){delete _0x1bdf63[_0x43312e];}}}}function freeIsNotKeyAgent(_0x5ce41c,_0x5ced4c){var _0xfc247a=_['mapKeys'](_0x5ce41c,function(_0x509c55,_0x232157){var _0x2086ea=_[_0xb6b1('0x23')](_0x509c55[_0xb6b1('0x24')])?util[_0xb6b1('0x21')](_0xb6b1('0x25'),_0x509c55[_0xb6b1('0x26')]):_0x509c55[_0xb6b1('0x24')];return _0x2086ea;});for(var _0x472585 in _0x5ced4c){if(_0x5ced4c[_0xb6b1('0x22')](_0x472585)){if(!_0xfc247a[_0x472585]){delete _0x5ced4c[_0x472585];}}}}function clearVoiceCallReports(_0x5069cd){_0x5069cd[_0xb6b1('0x27')]=0x0;_0x5069cd['answered']=0x0;_0x5069cd[_0xb6b1('0x28')]=0x0;_0x5069cd['sumDuration']=0x0;_0x5069cd[_0xb6b1('0x29')]=0x0;}function clearCampaigns(_0x48c1d2){if(!_[_0xb6b1('0x2a')](_0x48c1d2)){for(var _0x387603 in _0x48c1d2){if(_0x48c1d2[_0xb6b1('0x22')](_0x387603)){_0x48c1d2[_0x387603][_0xb6b1('0x2b')]=0x0;_0x48c1d2[_0x387603][_0xb6b1('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x188627){if(!_[_0xb6b1('0x2a')](_0x188627)){for(var _0xd3c6da in _0x188627){if(_0x188627[_0xb6b1('0x22')](_0xd3c6da)){_0x188627[_0xd3c6da]['total']=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x2d')]=0x0;_0x188627[_0xd3c6da]['unmanaged']=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x2e')]=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x28')]=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x2f')]=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x29')]=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x30')]=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x31')]=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x32')]=0x0;_0x188627[_0xd3c6da]['outboundCongestionCallsDay']=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x33')]=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x34')]=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x35')]=0x0;_0x188627[_0xd3c6da]['outboundDropCallsDayCallersExit']=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x36')]=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x37')]=0x0;_0x188627[_0xd3c6da]['outboundRejectCallsDay']=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x38')]=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x30')]=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x39')]=0x0;_0x188627[_0xd3c6da][_0xb6b1('0x3a')]=!![];}}}}Realtime[_0xb6b1('0x3b')][_0xb6b1('0x3c')]=function(_0x4d29e4,_0x3cca75){for(var _0xff1d43 in _0x3cca75){if(_0x4d29e4['hasOwnProperty'](_0xff1d43)){_0x4d29e4[_0xff1d43]=_0x3cca75[_0xff1d43];}}};Realtime[_0xb6b1('0x3b')]['initAgents']=function(){var _0x448382=this;return function(_0x242ec3){if(_0x242ec3){freeIsNotKeyAgent(_0x242ec3,_0x448382[_0xb6b1('0x10')]);for(var _0x4cad81=0x0,_0x127481={},_0x2dd9e2={};_0x4cad81<_0x242ec3['length'];_0x4cad81+=0x1){_0x127481=_0x242ec3[_0x4cad81];var _0x203d8e=_[_0xb6b1('0x23')](_0x127481[_0xb6b1('0x24')])?util[_0xb6b1('0x21')]('SIP/%s',_0x127481['name']):_0x127481['interface'];if(_[_0xb6b1('0x3d')](_0x448382[_0xb6b1('0x10')][_0x203d8e])){_0x448382[_0xb6b1('0x10')][_0x203d8e]=new Agent(_0x127481);}else{_0x448382[_0xb6b1('0x3c')](_0x448382[_0xb6b1('0x10')][_0x203d8e],_0x127481);}}}return _0x448382[_0xb6b1('0x10')];};};Realtime[_0xb6b1('0x3b')][_0xb6b1('0x3e')]=function(){var _0x206008=this;return function(_0x25d6a2){if(_0x25d6a2){freeIsNotKeySip(_0x25d6a2,_0x206008[_0xb6b1('0x3f')]);for(var _0x1bc661=0x0,_0x5b8a57={},_0x17f529={};_0x1bc661<_0x25d6a2[_0xb6b1('0x40')];_0x1bc661+=0x1){_0x5b8a57=_0x25d6a2[_0x1bc661];if(_[_0xb6b1('0x3d')](_0x206008[_0xb6b1('0x3f')][util[_0xb6b1('0x21')](_0xb6b1('0x25'),_0x5b8a57[_0xb6b1('0x26')])])){_0x206008[_0xb6b1('0x3f')][util[_0xb6b1('0x21')](_0xb6b1('0x25'),_0x5b8a57[_0xb6b1('0x26')])]=new Telephone(_0x5b8a57);}else{_0x206008['mergeFromDatabase'](_0x206008[_0xb6b1('0x3f')][util[_0xb6b1('0x21')](_0xb6b1('0x25'),_0x5b8a57[_0xb6b1('0x26')])],_0x5b8a57);}}}return _0x206008[_0xb6b1('0x3f')];};};Realtime[_0xb6b1('0x3b')][_0xb6b1('0x41')]=function(){var _0x22be21=this;return function(_0x51e68c){if(_0x51e68c){freeIsNotKeySip(_0x51e68c,_0x22be21['trunks']);for(var _0x46070c=0x0,_0x19853f={},_0x1f43fe={};_0x46070c<_0x51e68c['length'];_0x46070c+=0x1){_0x19853f=_0x51e68c[_0x46070c];if(_[_0xb6b1('0x3d')](_0x22be21[_0xb6b1('0x42')][util[_0xb6b1('0x21')](_0xb6b1('0x25'),_0x19853f[_0xb6b1('0x26')])])){_0x22be21[_0xb6b1('0x42')][util[_0xb6b1('0x21')](_0xb6b1('0x25'),_0x19853f['name'])]=new Trunk(_0x19853f);}else{_0x22be21[_0xb6b1('0x3c')](_0x22be21['trunks'][util[_0xb6b1('0x21')](_0xb6b1('0x25'),_0x19853f[_0xb6b1('0x26')])],_0x19853f);}}}return _0x22be21[_0xb6b1('0x42')];};};Realtime[_0xb6b1('0x3b')][_0xb6b1('0x43')]=function(){var _0x571214=this;return function(_0x1d1c92){if(_0x1d1c92){freeIsNotKey(_0x1d1c92,_0x571214[_0xb6b1('0x44')],'name');for(var _0x27bf19=0x0,_0x4ff402={},_0x2f64ab={};_0x27bf19<_0x1d1c92[_0xb6b1('0x40')];_0x27bf19+=0x1){_0x4ff402=_0x1d1c92[_0x27bf19];if(_[_0xb6b1('0x3d')](_0x571214[_0xb6b1('0x44')][_0x4ff402[_0xb6b1('0x26')]])){_0x571214[_0xb6b1('0x44')][_0x4ff402[_0xb6b1('0x26')]]=new VoiceQueue(_0x4ff402);}else{_0x571214[_0xb6b1('0x3c')](_0x571214[_0xb6b1('0x44')][_0x4ff402['name']],_0x4ff402);}}}return _0x571214['voiceQueues'];};};Realtime[_0xb6b1('0x3b')][_0xb6b1('0x45')]=function(){var _0x5959ca=this;return function(_0x29cf46){if(_0x29cf46){freeIsNotKey(_0x29cf46,_0x5959ca[_0xb6b1('0x46')],'id');for(var _0x6f7b41=0x0,_0x1a95cf={},_0x7cebdc={};_0x6f7b41<_0x29cf46['length'];_0x6f7b41+=0x1){_0x1a95cf=_0x29cf46[_0x6f7b41];if(_[_0xb6b1('0x3d')](_0x5959ca[_0xb6b1('0x46')][_0x1a95cf['id']])){_0x5959ca[_0xb6b1('0x46')][_0x1a95cf['id']]=new Trigger(_0x1a95cf);}else{_0x5959ca[_0xb6b1('0x3c')](_0x5959ca['triggers'][_0x1a95cf['id']],_0x1a95cf);}}}return _0x5959ca['triggers'];};};Realtime[_0xb6b1('0x3b')]['initTemplates']=function(){var _0x2be9e7=this;return function(_0x3f09dc){if(_0x3f09dc){freeIsNotKey(_0x3f09dc,_0x2be9e7['templates'],'id');for(var _0x1de68b=0x0,_0x48d4ff={},_0x2191f0={};_0x1de68b<_0x3f09dc[_0xb6b1('0x40')];_0x1de68b+=0x1){_0x48d4ff=_0x3f09dc[_0x1de68b];if(_[_0xb6b1('0x3d')](_0x2be9e7[_0xb6b1('0x12')][_0x48d4ff['id']])){_0x2be9e7[_0xb6b1('0x12')][_0x48d4ff['id']]=new Template(_0x48d4ff);}else{_0x2be9e7[_0xb6b1('0x3c')](_0x2be9e7[_0xb6b1('0x12')][_0x48d4ff['id']],_0x48d4ff);}}}return _0x2be9e7[_0xb6b1('0x12')];};};Realtime[_0xb6b1('0x3b')][_0xb6b1('0x47')]=function(){var _0x4a9c9b=this;return function(_0x144cc7){if(_0x144cc7){freeIsNotKey(_0x144cc7,_0x4a9c9b[_0xb6b1('0x17')],'id');for(var _0x367679=0x0,_0x39c0d9={},_0x46c4ef={};_0x367679<_0x144cc7[_0xb6b1('0x40')];_0x367679+=0x1){_0x39c0d9=_0x144cc7[_0x367679];if(_[_0xb6b1('0x3d')](_0x4a9c9b[_0xb6b1('0x17')][_0x39c0d9['id']])){_0x4a9c9b[_0xb6b1('0x17')][_0x39c0d9['id']]=new ZendeskAccount(_0x39c0d9);}else{_0x4a9c9b['mergeFromDatabase'](_0x4a9c9b[_0xb6b1('0x17')][_0x39c0d9['id']],_0x39c0d9);}}}return _0x4a9c9b['zendeskAccounts'];};};Realtime['prototype'][_0xb6b1('0x48')]=function(){var _0x2123f5=this;return function(_0x5be7bf){if(_0x5be7bf){freeIsNotKey(_0x5be7bf,_0x2123f5[_0xb6b1('0x18')],'id');for(var _0x323231=0x0,_0x3b218a={},_0x4e8d80={};_0x323231<_0x5be7bf[_0xb6b1('0x40')];_0x323231+=0x1){_0x3b218a=_0x5be7bf[_0x323231];if(_['isUndefined'](_0x2123f5['salesforceAccounts'][_0x3b218a['id']])){_0x2123f5[_0xb6b1('0x18')][_0x3b218a['id']]=new SalesforceAccount(_0x3b218a);}else{_0x2123f5[_0xb6b1('0x3c')](_0x2123f5['salesforceAccounts'][_0x3b218a['id']],_0x3b218a);}}}return _0x2123f5['salesforceAccounts'];};};Realtime['prototype'][_0xb6b1('0x49')]=function(){var _0x5da982=this;return function(_0x54c88f){if(_0x54c88f){freeIsNotKey(_0x54c88f,_0x5da982['freshdeskAccounts'],'id');for(var _0x37591c=0x0,_0x345849={},_0x15aefa={};_0x37591c<_0x54c88f[_0xb6b1('0x40')];_0x37591c+=0x1){_0x345849=_0x54c88f[_0x37591c];if(_[_0xb6b1('0x3d')](_0x5da982[_0xb6b1('0x1a')][_0x345849['id']])){_0x5da982['freshdeskAccounts'][_0x345849['id']]=new FreshdeskAccount(_0x345849);}else{_0x5da982[_0xb6b1('0x3c')](_0x5da982[_0xb6b1('0x1a')][_0x345849['id']],_0x345849);}}}return _0x5da982['freshdeskAccounts'];};};Realtime['prototype'][_0xb6b1('0x4a')]=function(){var _0x15acdd=this;return function(_0x575823){if(_0x575823){freeIsNotKey(_0x575823,_0x15acdd['zohoAccounts'],'id');for(var _0x167a03=0x0,_0x484afc={},_0x463482={};_0x167a03<_0x575823[_0xb6b1('0x40')];_0x167a03+=0x1){_0x484afc=_0x575823[_0x167a03];if(_['isUndefined'](_0x15acdd[_0xb6b1('0x1b')][_0x484afc['id']])){_0x15acdd[_0xb6b1('0x1b')][_0x484afc['id']]=new ZohoAccount(_0x484afc);}else{_0x15acdd[_0xb6b1('0x3c')](_0x15acdd[_0xb6b1('0x1b')][_0x484afc['id']],_0x484afc);}}}return _0x15acdd[_0xb6b1('0x1b')];};};Realtime[_0xb6b1('0x3b')][_0xb6b1('0x4b')]=function(){var _0x35aae0=this;return function(_0x10ef87){if(_0x10ef87){freeIsNotKey(_0x10ef87,_0x35aae0[_0xb6b1('0x1c')],'id');for(var _0x4de50b=0x0,_0x1d6dc1={},_0xe4e416={};_0x4de50b<_0x10ef87[_0xb6b1('0x40')];_0x4de50b+=0x1){_0x1d6dc1=_0x10ef87[_0x4de50b];if(_[_0xb6b1('0x3d')](_0x35aae0['deskAccounts'][_0x1d6dc1['id']])){_0x35aae0[_0xb6b1('0x1c')][_0x1d6dc1['id']]=new DeskAccount(_0x1d6dc1);}else{_0x35aae0[_0xb6b1('0x3c')](_0x35aae0[_0xb6b1('0x1c')][_0x1d6dc1['id']],_0x1d6dc1);}}}return _0x35aae0[_0xb6b1('0x1c')];};};Realtime[_0xb6b1('0x3b')][_0xb6b1('0x4c')]=function(){var _0x122796=this;return function(_0x4e34ef){if(_0x4e34ef){freeIsNotKey(_0x4e34ef,_0x122796['sugarcrmAccounts'],'id');for(var _0x18d264=0x0,_0x51c2ed={},_0x2e91fa={};_0x18d264<_0x4e34ef[_0xb6b1('0x40')];_0x18d264+=0x1){_0x51c2ed=_0x4e34ef[_0x18d264];if(_[_0xb6b1('0x3d')](_0x122796['sugarcrmAccounts'][_0x51c2ed['id']])){_0x122796[_0xb6b1('0x19')][_0x51c2ed['id']]=new SugarcrmAccount(_0x51c2ed);}else{_0x122796[_0xb6b1('0x3c')](_0x122796[_0xb6b1('0x19')][_0x51c2ed['id']],_0x51c2ed);}}}return _0x122796[_0xb6b1('0x19')];};};Realtime[_0xb6b1('0x3b')]['initVtigerAccounts']=function(){var _0x4ddcf3=this;return function(_0x11e94e){if(_0x11e94e){freeIsNotKey(_0x11e94e,_0x4ddcf3[_0xb6b1('0x1d')],'id');for(var _0x872397=0x0,_0x28b4c9={},_0x3824de={};_0x872397<_0x11e94e[_0xb6b1('0x40')];_0x872397+=0x1){_0x28b4c9=_0x11e94e[_0x872397];if(_[_0xb6b1('0x3d')](_0x4ddcf3[_0xb6b1('0x1d')][_0x28b4c9['id']])){_0x4ddcf3[_0xb6b1('0x1d')][_0x28b4c9['id']]=new VtigerAccount(_0x28b4c9);}else{_0x4ddcf3[_0xb6b1('0x3c')](_0x4ddcf3[_0xb6b1('0x1d')][_0x28b4c9['id']],_0x28b4c9);}}}return _0x4ddcf3[_0xb6b1('0x1d')];};};Realtime['prototype'][_0xb6b1('0x4d')]=function(){var _0x49ace7=this;return function(_0x158af7){if(_0x158af7){freeIsNotKey(_0x158af7,_0x49ace7[_0xb6b1('0x1e')],'id');for(var _0xc831ce=0x0,_0x5720bf={},_0x2239b2={};_0xc831ce<_0x158af7['length'];_0xc831ce+=0x1){_0x5720bf=_0x158af7[_0xc831ce];if(_['isUndefined'](_0x49ace7[_0xb6b1('0x1e')][_0x5720bf['id']])){_0x49ace7['servicenowAccounts'][_0x5720bf['id']]=new ServicenowAccount(_0x5720bf);}else{_0x49ace7[_0xb6b1('0x3c')](_0x49ace7[_0xb6b1('0x1e')][_0x5720bf['id']],_0x5720bf);}}}return _0x49ace7['servicenowAccounts'];};};Realtime[_0xb6b1('0x3b')]['initDynamics365Accounts']=function(){var _0x1a40c7=this;return function(_0x43e884){if(_0x43e884){freeIsNotKey(_0x43e884,_0x1a40c7[_0xb6b1('0x1f')],'id');for(var _0x53a85e=0x0,_0x309982={},_0x4ef26a={};_0x53a85e<_0x43e884[_0xb6b1('0x40')];_0x53a85e+=0x1){_0x309982=_0x43e884[_0x53a85e];if(_[_0xb6b1('0x3d')](_0x1a40c7[_0xb6b1('0x1f')][_0x309982['id']])){_0x1a40c7[_0xb6b1('0x1f')][_0x309982['id']]=new Dynamics365Account(_0x309982);}else{_0x1a40c7['mergeFromDatabase'](_0x1a40c7[_0xb6b1('0x1f')][_0x309982['id']],_0x309982);}}}return _0x1a40c7[_0xb6b1('0x1f')];};};Realtime[_0xb6b1('0x3b')][_0xb6b1('0x4e')]=function(){var _0x381793=this;return function(_0x2aa294){if(_0x2aa294){freeIsNotKey(_0x2aa294,_0x381793['freshsalesAccounts'],'id');for(var _0x168c21=0x0,_0x26fbd8={},_0x9fa359={};_0x168c21<_0x2aa294[_0xb6b1('0x40')];_0x168c21+=0x1){_0x26fbd8=_0x2aa294[_0x168c21];if(_['isUndefined'](_0x381793[_0xb6b1('0x4f')][_0x26fbd8['id']])){_0x381793[_0xb6b1('0x4f')][_0x26fbd8['id']]=new FreshsalesAccount(_0x26fbd8);}else{_0x381793['mergeFromDatabase'](_0x381793['freshsalesAccounts'][_0x26fbd8['id']],_0x26fbd8);}}}return _0x381793['freshsalesAccounts'];};};Realtime['prototype'][_0xb6b1('0x50')]=function(){var _0x439b23=this;return function(_0x17ce08){for(var _0xc203ce=0x0;_0xc203ce<_0x17ce08[_0xb6b1('0x40')];_0xc203ce+=0x1){_[_0xb6b1('0x51')](_0x439b23[_0xb6b1('0x44')][_0x17ce08[_0xc203ce]['name']],_0x17ce08[_0xc203ce]);}return _0x439b23[_0xb6b1('0x44')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x15a64f=this;return function(_0x28213e){clearVoiceQueues(_0x15a64f['voiceQueues']);if(_0x28213e){_0x28213e=_[_0xb6b1('0x52')](_0x28213e,_0xb6b1('0x53'));for(var _0x60f433 in _0x28213e){if(_0x28213e[_0xb6b1('0x22')](_0x60f433)){var _0x26a342={};for(var _0x5516c7=0x0;_0x5516c7<_0x28213e[_0x60f433][_0xb6b1('0x40')];_0x5516c7+=0x1){var _0x3af3e2=_0x28213e[_0x60f433][_0x5516c7]['queue'];if(_0x15a64f['voiceQueues'][_0x3af3e2]){if(_0x28213e[_0x60f433][_0x5516c7][_0xb6b1('0x54')]){_0x15a64f[_0xb6b1('0x44')][_0x3af3e2][_0xb6b1('0x55')]+=0x1;}if(_0x28213e[_0x60f433][_0x5516c7][_0xb6b1('0x56')]){_0x15a64f[_0xb6b1('0x44')][_0x3af3e2][_0xb6b1('0x2e')]+=0x1;}_0x15a64f[_0xb6b1('0x44')][_0x3af3e2][_0xb6b1('0x28')]+=moment(_0x28213e[_0x60f433][_0x5516c7][_0xb6b1('0x57')])['diff'](moment(_0x28213e[_0x60f433][_0x5516c7][_0xb6b1('0x58')]),'seconds')||0x0;if(_0x5516c7===_0x28213e[_0x60f433][_0xb6b1('0x40')]-0x1){_0x15a64f[_0xb6b1('0x44')][_0x3af3e2][_0xb6b1('0x2f')]+=moment(_0x28213e[_0x60f433][_0x5516c7]['queuecallercompleteAt']||_0x28213e[_0x60f433][_0x5516c7][_0xb6b1('0x59')]||_0x28213e[_0x60f433][_0x5516c7][_0xb6b1('0x5a')])['diff'](moment(_0x28213e[_0x60f433][_0x5516c7][_0xb6b1('0x58')]),_0xb6b1('0x5b'))||0x0;_0x15a64f['voiceQueues'][_0x3af3e2][_0xb6b1('0x27')]+=0x1;if(_0x28213e[_0x60f433][_0x5516c7]['queuecallercomplete']){_0x15a64f[_0xb6b1('0x44')][_0x3af3e2]['answered']+=0x1;_0x15a64f[_0xb6b1('0x44')][_0x3af3e2][_0xb6b1('0x29')]+=moment(_0x28213e[_0x60f433][_0x5516c7][_0xb6b1('0x5c')])[_0xb6b1('0x5d')](moment(_0x28213e[_0x60f433][_0x5516c7][_0xb6b1('0x57')]),'seconds')||0x0;}}else{_0x15a64f[_0xb6b1('0x44')][_0x3af3e2][_0xb6b1('0x2f')]+=_0x15a64f[_0xb6b1('0x44')][_0x3af3e2][_0xb6b1('0x28')]||0x0;}}}}}}return _0x15a64f[_0xb6b1('0x44')];};};Realtime[_0xb6b1('0x3b')][_0xb6b1('0x5e')]=function(){var _0x1936d4=this;return function(_0x8e1139){clearVoiceCallReports(_0x1936d4[_0xb6b1('0x5f')]);if(_0x8e1139){for(var _0x326133=0x0;_0x326133<_0x8e1139[_0xb6b1('0x40')];_0x326133+=0x1){_0x1936d4['outbound'][_0xb6b1('0x27')]+=0x1;_0x1936d4[_0xb6b1('0x5f')]['sumDuration']+=_0x8e1139[_0x326133][_0xb6b1('0x60')];if(_0x8e1139[_0x326133][_0xb6b1('0x61')]==='ANSWERED'){_0x1936d4[_0xb6b1('0x5f')]['answered']+=0x1;_0x1936d4[_0xb6b1('0x5f')]['sumHoldTime']+=_0x8e1139[_0x326133][_0xb6b1('0x60')]-_0x8e1139[_0x326133]['billableseconds']||0x0;_0x1936d4['outbound'][_0xb6b1('0x29')]+=_0x8e1139[_0x326133][_0xb6b1('0x62')];}}}return _0x1936d4['outbound'];};};Realtime[_0xb6b1('0x3b')][_0xb6b1('0x63')]=function(){var _0x12ebb3=this;return function(_0xac8b8a){if(_0xac8b8a){freeIsNotKey(_0xac8b8a,_0x12ebb3[_0xb6b1('0x11')],_0xb6b1('0x26'));for(var _0x3e7949=0x0,_0x46e4e1={};_0x3e7949<_0xac8b8a[_0xb6b1('0x40')];_0x3e7949+=0x1){_0x46e4e1=_0xac8b8a[_0x3e7949];if(_[_0xb6b1('0x3d')](_0x12ebb3[_0xb6b1('0x11')][_0x46e4e1[_0xb6b1('0x26')]])){_0x12ebb3['campaigns'][_0x46e4e1[_0xb6b1('0x26')]]=new Campaign(_0x46e4e1);}else{_0x12ebb3[_0xb6b1('0x3c')](_0x12ebb3[_0xb6b1('0x11')][_0x46e4e1[_0xb6b1('0x26')]],_0x46e4e1);_0x12ebb3['campaigns'][_0x46e4e1[_0xb6b1('0x26')]][_0xb6b1('0x64')]=_0x46e4e1[_0xb6b1('0x65')]?_0x46e4e1[_0xb6b1('0x65')][_0xb6b1('0x26')]:undefined;}}}return _0x12ebb3[_0xb6b1('0x11')];};};Realtime['prototype'][_0xb6b1('0x66')]=function(){var _0x2c0509=this;return function(_0xe96200){if(_0xe96200){freeIsNotKey(_0xe96200,_0x2c0509[_0xb6b1('0x13')],'id');for(var _0x176461=0x0,_0x101a04={};_0x176461<_0xe96200[_0xb6b1('0x40')];_0x176461+=0x1){_0x101a04=_0xe96200[_0x176461];if(_[_0xb6b1('0x3d')](_0x2c0509[_0xb6b1('0x13')][_0x101a04['id']])){_0x2c0509[_0xb6b1('0x13')][_0x101a04['id']]=new VoiceExtension(_0x101a04);}else{_0x2c0509[_0xb6b1('0x3c')](_0x2c0509[_0xb6b1('0x13')][_0x101a04['id']],_0x101a04);}}}return _0x2c0509['voiceExtensions'];};};Realtime[_0xb6b1('0x3b')][_0xb6b1('0x67')]=function(){var _0x10d789=this;return function(_0x4175f7){clearCampaigns(_0x10d789[_0xb6b1('0x11')]);for(var _0x32b89e=0x0;_0x32b89e<_0x4175f7[_0xb6b1('0x40')];_0x32b89e+=0x1){_[_0xb6b1('0x51')](_0x10d789['campaigns'][_0x4175f7[_0x32b89e][_0xb6b1('0x26')]],_0x4175f7[_0x32b89e]);}return _0x10d789[_0xb6b1('0x11')];};};Realtime[_0xb6b1('0x3b')]['initFaxAccounts']=function(){var _0x8f27ea=this;return function(_0x5ed18d){if(_0x5ed18d){freeIsNotKey(_0x5ed18d,_0x8f27ea['faxAccounts'],'id');for(var _0x13f438=0x0,_0x320c96={},_0xa7b8d2={};_0x13f438<_0x5ed18d[_0xb6b1('0x40')];_0x13f438+=0x1){_0x320c96=_0x5ed18d[_0x13f438];if(_[_0xb6b1('0x3d')](_0x8f27ea[_0xb6b1('0x68')][_0x320c96['id']])){_0x8f27ea['faxAccounts'][_0x320c96['id']]=new FaxAccount(_0x320c96);}else{_0x8f27ea[_0xb6b1('0x3c')](_0x8f27ea[_0xb6b1('0x68')][_0x320c96['id']],_0x320c96);}}}return _0x8f27ea[_0xb6b1('0x68')];};};module[_0xb6b1('0x69')]=Realtime; \ No newline at end of file +var _0x363e=['outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','isUndefined','initTelephones','initTrunks','length','initVoiceQueues','initTriggers','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','vtigerAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','SquareProject','voiceExtensions','initCampaignHopperHistory','exports','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','templates','outbound','channels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay'];(function(_0x20f863,_0x2d9c90){var _0x11841e=function(_0x4052ad){while(--_0x4052ad){_0x20f863['push'](_0x20f863['shift']());}};_0x11841e(++_0x2d9c90);}(_0x363e,0x179));var _0xe363=function(_0x20ad7f,_0x3b8608){_0x20ad7f=_0x20ad7f-0x0;var _0x2d371b=_0x363e[_0x20ad7f];return _0x2d371b;};'use strict';var util=require(_0xe363('0x0'));var _=require(_0xe363('0x1'));var moment=require('moment');var Agent=require(_0xe363('0x2'));var Telephone=require(_0xe363('0x3'));var Trunk=require(_0xe363('0x4'));var VoiceQueue=require(_0xe363('0x5'));var Trigger=require(_0xe363('0x6'));var Template=require(_0xe363('0x7'));var Campaign=require(_0xe363('0x8'));var VoiceExtension=require(_0xe363('0x9'));var ZendeskAccount=require(_0xe363('0xa'));var SalesforceAccount=require(_0xe363('0xb'));var FreshdeskAccount=require(_0xe363('0xc'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xe363('0xd'));var DeskAccount=require(_0xe363('0xe'));var VtigerAccount=require(_0xe363('0xf'));var ServicenowAccount=require(_0xe363('0x10'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0xe363('0x11'));var FaxAccount=require(_0xe363('0x12'));var Realtime=function(){this[_0xe363('0x13')]={};this[_0xe363('0x14')]={};this[_0xe363('0x15')]={};this[_0xe363('0x16')]={};this[_0xe363('0x17')]={};this['campaigns']={};this[_0xe363('0x18')]={};this[_0xe363('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xe363('0x1a')]={};this['queueChannels']={};this['outboundChannels']={};this[_0xe363('0x1b')]={};this[_0xe363('0x1c')]={};this[_0xe363('0x1d')]={};this[_0xe363('0x1e')]={};this[_0xe363('0x1f')]={};this['freshdeskAccounts']={};this[_0xe363('0x20')]={};this[_0xe363('0x21')]={};this['vtigerAccounts']={};this[_0xe363('0x22')]={};this[_0xe363('0x23')]={};this['freshsalesAccounts']={};this[_0xe363('0x24')]={};};function freeIsNotKey(_0x73ef9a,_0x51e1a8,_0xd9d1b1){var _0xc94d0a=_['mapKeys'](_0x73ef9a,function(_0xecbe2c,_0x17606f){return _0xecbe2c[_0xd9d1b1];});for(var _0x2f2c20 in _0x51e1a8){if(_0x51e1a8['hasOwnProperty'](_0x2f2c20)){if(!_0xc94d0a[_0x2f2c20]){delete _0x51e1a8[_0x2f2c20];}}}}function freeIsNotKeySip(_0x287104,_0x470103){var _0x5177f4=_[_0xe363('0x25')](_0x287104,function(_0x110e59,_0x1c4953){return util[_0xe363('0x26')](_0xe363('0x27'),_0x110e59[_0xe363('0x28')]);});for(var _0x4ee855 in _0x470103){if(_0x470103[_0xe363('0x29')](_0x4ee855)){if(!_0x5177f4[_0x4ee855]){delete _0x470103[_0x4ee855];}}}}function freeIsNotKeyAgent(_0x38e694,_0x14ff95){var _0x379b8a=_[_0xe363('0x25')](_0x38e694,function(_0x42928e,_0x24199a){var _0xaff56f=_[_0xe363('0x2a')](_0x42928e[_0xe363('0x2b')])?util[_0xe363('0x26')](_0xe363('0x27'),_0x42928e[_0xe363('0x28')]):_0x42928e[_0xe363('0x2b')];return _0xaff56f;});for(var _0x1ffed7 in _0x14ff95){if(_0x14ff95[_0xe363('0x29')](_0x1ffed7)){if(!_0x379b8a[_0x1ffed7]){delete _0x14ff95[_0x1ffed7];}}}}function clearVoiceCallReports(_0xf9b981){_0xf9b981[_0xe363('0x2c')]=0x0;_0xf9b981[_0xe363('0x2d')]=0x0;_0xf9b981[_0xe363('0x2e')]=0x0;_0xf9b981[_0xe363('0x2f')]=0x0;_0xf9b981[_0xe363('0x30')]=0x0;}function clearCampaigns(_0x5b2b3d){if(!_[_0xe363('0x31')](_0x5b2b3d)){for(var _0x12358b in _0x5b2b3d){if(_0x5b2b3d[_0xe363('0x29')](_0x12358b)){_0x5b2b3d[_0x12358b][_0xe363('0x32')]=0x0;_0x5b2b3d[_0x12358b][_0xe363('0x33')]=0x0;}}}}function clearVoiceQueues(_0x52cafe){if(!_[_0xe363('0x31')](_0x52cafe)){for(var _0x291841 in _0x52cafe){if(_0x52cafe['hasOwnProperty'](_0x291841)){_0x52cafe[_0x291841][_0xe363('0x2c')]=0x0;_0x52cafe[_0x291841]['answered']=0x0;_0x52cafe[_0x291841][_0xe363('0x34')]=0x0;_0x52cafe[_0x291841][_0xe363('0x35')]=0x0;_0x52cafe[_0x291841]['sumHoldTime']=0x0;_0x52cafe[_0x291841][_0xe363('0x2f')]=0x0;_0x52cafe[_0x291841][_0xe363('0x30')]=0x0;_0x52cafe[_0x291841][_0xe363('0x36')]=0x0;_0x52cafe[_0x291841]['outboundNoAnswerCallsDay']=0x0;_0x52cafe[_0x291841][_0xe363('0x37')]=0x0;_0x52cafe[_0x291841][_0xe363('0x38')]=0x0;_0x52cafe[_0x291841][_0xe363('0x39')]=0x0;_0x52cafe[_0x291841][_0xe363('0x3a')]=0x0;_0x52cafe[_0x291841]['outboundDropCallsDayTimeout']=0x0;_0x52cafe[_0x291841][_0xe363('0x3b')]=0x0;_0x52cafe[_0x291841][_0xe363('0x3c')]=0x0;_0x52cafe[_0x291841][_0xe363('0x3d')]=0x0;_0x52cafe[_0x291841][_0xe363('0x3e')]=0x0;_0x52cafe[_0x291841][_0xe363('0x3f')]=0x0;_0x52cafe[_0x291841][_0xe363('0x36')]=0x0;_0x52cafe[_0x291841][_0xe363('0x40')]=0x0;_0x52cafe[_0x291841][_0xe363('0x41')]=!![];}}}}Realtime[_0xe363('0x42')][_0xe363('0x43')]=function(_0x5c9751,_0x4e8776){for(var _0xaff437 in _0x4e8776){if(_0x5c9751[_0xe363('0x29')](_0xaff437)){_0x5c9751[_0xaff437]=_0x4e8776[_0xaff437];}}};Realtime['prototype'][_0xe363('0x44')]=function(){var _0x13eeac=this;return function(_0x54cda9){if(_0x54cda9){freeIsNotKeyAgent(_0x54cda9,_0x13eeac[_0xe363('0x13')]);for(var _0x1ff239=0x0,_0x410126={},_0x1ed87e={};_0x1ff239<_0x54cda9['length'];_0x1ff239+=0x1){_0x410126=_0x54cda9[_0x1ff239];var _0x5362af=_[_0xe363('0x2a')](_0x410126['interface'])?util['format'](_0xe363('0x27'),_0x410126[_0xe363('0x28')]):_0x410126[_0xe363('0x2b')];if(_[_0xe363('0x45')](_0x13eeac[_0xe363('0x13')][_0x5362af])){_0x13eeac[_0xe363('0x13')][_0x5362af]=new Agent(_0x410126);}else{_0x13eeac[_0xe363('0x43')](_0x13eeac[_0xe363('0x13')][_0x5362af],_0x410126);}}}return _0x13eeac[_0xe363('0x13')];};};Realtime[_0xe363('0x42')][_0xe363('0x46')]=function(){var _0x2a8703=this;return function(_0x544532){if(_0x544532){freeIsNotKeySip(_0x544532,_0x2a8703['telephones']);for(var _0x14238f=0x0,_0xe018af={},_0x33ace3={};_0x14238f<_0x544532['length'];_0x14238f+=0x1){_0xe018af=_0x544532[_0x14238f];if(_['isUndefined'](_0x2a8703[_0xe363('0x14')][util[_0xe363('0x26')](_0xe363('0x27'),_0xe018af[_0xe363('0x28')])])){_0x2a8703['telephones'][util[_0xe363('0x26')]('SIP/%s',_0xe018af[_0xe363('0x28')])]=new Telephone(_0xe018af);}else{_0x2a8703[_0xe363('0x43')](_0x2a8703[_0xe363('0x14')][util[_0xe363('0x26')](_0xe363('0x27'),_0xe018af[_0xe363('0x28')])],_0xe018af);}}}return _0x2a8703[_0xe363('0x14')];};};Realtime[_0xe363('0x42')][_0xe363('0x47')]=function(){var _0x518694=this;return function(_0x52fc17){if(_0x52fc17){freeIsNotKeySip(_0x52fc17,_0x518694[_0xe363('0x15')]);for(var _0x44be85=0x0,_0xc7d891={},_0x34a043={};_0x44be85<_0x52fc17[_0xe363('0x48')];_0x44be85+=0x1){_0xc7d891=_0x52fc17[_0x44be85];if(_[_0xe363('0x45')](_0x518694[_0xe363('0x15')][util[_0xe363('0x26')](_0xe363('0x27'),_0xc7d891['name'])])){_0x518694[_0xe363('0x15')][util['format'](_0xe363('0x27'),_0xc7d891['name'])]=new Trunk(_0xc7d891);}else{_0x518694[_0xe363('0x43')](_0x518694[_0xe363('0x15')][util['format'](_0xe363('0x27'),_0xc7d891[_0xe363('0x28')])],_0xc7d891);}}}return _0x518694[_0xe363('0x15')];};};Realtime[_0xe363('0x42')][_0xe363('0x49')]=function(){var _0x450bb9=this;return function(_0x5f4bc0){if(_0x5f4bc0){freeIsNotKey(_0x5f4bc0,_0x450bb9[_0xe363('0x16')],_0xe363('0x28'));for(var _0x218a16=0x0,_0xcab016={},_0x256a1f={};_0x218a16<_0x5f4bc0['length'];_0x218a16+=0x1){_0xcab016=_0x5f4bc0[_0x218a16];if(_[_0xe363('0x45')](_0x450bb9[_0xe363('0x16')][_0xcab016[_0xe363('0x28')]])){_0x450bb9[_0xe363('0x16')][_0xcab016[_0xe363('0x28')]]=new VoiceQueue(_0xcab016);}else{_0x450bb9[_0xe363('0x43')](_0x450bb9[_0xe363('0x16')][_0xcab016['name']],_0xcab016);}}}return _0x450bb9['voiceQueues'];};};Realtime[_0xe363('0x42')][_0xe363('0x4a')]=function(){var _0x8f6a76=this;return function(_0x4aa733){if(_0x4aa733){freeIsNotKey(_0x4aa733,_0x8f6a76[_0xe363('0x17')],'id');for(var _0x381a5c=0x0,_0x4b47ec={},_0x5307e0={};_0x381a5c<_0x4aa733[_0xe363('0x48')];_0x381a5c+=0x1){_0x4b47ec=_0x4aa733[_0x381a5c];if(_[_0xe363('0x45')](_0x8f6a76[_0xe363('0x17')][_0x4b47ec['id']])){_0x8f6a76[_0xe363('0x17')][_0x4b47ec['id']]=new Trigger(_0x4b47ec);}else{_0x8f6a76['mergeFromDatabase'](_0x8f6a76[_0xe363('0x17')][_0x4b47ec['id']],_0x4b47ec);}}}return _0x8f6a76[_0xe363('0x17')];};};Realtime['prototype']['initTemplates']=function(){var _0x306afd=this;return function(_0x238d4a){if(_0x238d4a){freeIsNotKey(_0x238d4a,_0x306afd['templates'],'id');for(var _0x305d6c=0x0,_0x532187={},_0x1043ec={};_0x305d6c<_0x238d4a[_0xe363('0x48')];_0x305d6c+=0x1){_0x532187=_0x238d4a[_0x305d6c];if(_['isUndefined'](_0x306afd[_0xe363('0x18')][_0x532187['id']])){_0x306afd[_0xe363('0x18')][_0x532187['id']]=new Template(_0x532187);}else{_0x306afd['mergeFromDatabase'](_0x306afd[_0xe363('0x18')][_0x532187['id']],_0x532187);}}}return _0x306afd[_0xe363('0x18')];};};Realtime['prototype'][_0xe363('0x4b')]=function(){var _0x5733eb=this;return function(_0x3c9a1b){if(_0x3c9a1b){freeIsNotKey(_0x3c9a1b,_0x5733eb[_0xe363('0x1d')],'id');for(var _0xb843fd=0x0,_0x2abd22={},_0x5bf716={};_0xb843fd<_0x3c9a1b[_0xe363('0x48')];_0xb843fd+=0x1){_0x2abd22=_0x3c9a1b[_0xb843fd];if(_[_0xe363('0x45')](_0x5733eb[_0xe363('0x1d')][_0x2abd22['id']])){_0x5733eb['zendeskAccounts'][_0x2abd22['id']]=new ZendeskAccount(_0x2abd22);}else{_0x5733eb[_0xe363('0x43')](_0x5733eb[_0xe363('0x1d')][_0x2abd22['id']],_0x2abd22);}}}return _0x5733eb[_0xe363('0x1d')];};};Realtime['prototype'][_0xe363('0x4c')]=function(){var _0x3df941=this;return function(_0x5aedb9){if(_0x5aedb9){freeIsNotKey(_0x5aedb9,_0x3df941[_0xe363('0x1e')],'id');for(var _0x25df32=0x0,_0x29112a={},_0x32b8f6={};_0x25df32<_0x5aedb9[_0xe363('0x48')];_0x25df32+=0x1){_0x29112a=_0x5aedb9[_0x25df32];if(_[_0xe363('0x45')](_0x3df941[_0xe363('0x1e')][_0x29112a['id']])){_0x3df941[_0xe363('0x1e')][_0x29112a['id']]=new SalesforceAccount(_0x29112a);}else{_0x3df941[_0xe363('0x43')](_0x3df941[_0xe363('0x1e')][_0x29112a['id']],_0x29112a);}}}return _0x3df941[_0xe363('0x1e')];};};Realtime[_0xe363('0x42')][_0xe363('0x4d')]=function(){var _0x550e89=this;return function(_0x58ba21){if(_0x58ba21){freeIsNotKey(_0x58ba21,_0x550e89[_0xe363('0x4e')],'id');for(var _0x9e2813=0x0,_0x24ec95={},_0xc48c38={};_0x9e2813<_0x58ba21[_0xe363('0x48')];_0x9e2813+=0x1){_0x24ec95=_0x58ba21[_0x9e2813];if(_[_0xe363('0x45')](_0x550e89[_0xe363('0x4e')][_0x24ec95['id']])){_0x550e89[_0xe363('0x4e')][_0x24ec95['id']]=new FreshdeskAccount(_0x24ec95);}else{_0x550e89[_0xe363('0x43')](_0x550e89[_0xe363('0x4e')][_0x24ec95['id']],_0x24ec95);}}}return _0x550e89[_0xe363('0x4e')];};};Realtime[_0xe363('0x42')][_0xe363('0x4f')]=function(){var _0x5b771d=this;return function(_0x1cbad3){if(_0x1cbad3){freeIsNotKey(_0x1cbad3,_0x5b771d[_0xe363('0x20')],'id');for(var _0x333932=0x0,_0x55b769={},_0x17940b={};_0x333932<_0x1cbad3[_0xe363('0x48')];_0x333932+=0x1){_0x55b769=_0x1cbad3[_0x333932];if(_[_0xe363('0x45')](_0x5b771d[_0xe363('0x20')][_0x55b769['id']])){_0x5b771d[_0xe363('0x20')][_0x55b769['id']]=new ZohoAccount(_0x55b769);}else{_0x5b771d['mergeFromDatabase'](_0x5b771d['zohoAccounts'][_0x55b769['id']],_0x55b769);}}}return _0x5b771d[_0xe363('0x20')];};};Realtime['prototype'][_0xe363('0x50')]=function(){var _0x1b9660=this;return function(_0xfcb472){if(_0xfcb472){freeIsNotKey(_0xfcb472,_0x1b9660[_0xe363('0x21')],'id');for(var _0x190842=0x0,_0x157c2c={},_0x4baa52={};_0x190842<_0xfcb472[_0xe363('0x48')];_0x190842+=0x1){_0x157c2c=_0xfcb472[_0x190842];if(_[_0xe363('0x45')](_0x1b9660[_0xe363('0x21')][_0x157c2c['id']])){_0x1b9660[_0xe363('0x21')][_0x157c2c['id']]=new DeskAccount(_0x157c2c);}else{_0x1b9660['mergeFromDatabase'](_0x1b9660[_0xe363('0x21')][_0x157c2c['id']],_0x157c2c);}}}return _0x1b9660[_0xe363('0x21')];};};Realtime[_0xe363('0x42')]['initSugarcrmAccounts']=function(){var _0x2ee264=this;return function(_0x46860f){if(_0x46860f){freeIsNotKey(_0x46860f,_0x2ee264[_0xe363('0x1f')],'id');for(var _0xb6f70d=0x0,_0x24da3a={},_0x1e561a={};_0xb6f70d<_0x46860f[_0xe363('0x48')];_0xb6f70d+=0x1){_0x24da3a=_0x46860f[_0xb6f70d];if(_[_0xe363('0x45')](_0x2ee264[_0xe363('0x1f')][_0x24da3a['id']])){_0x2ee264[_0xe363('0x1f')][_0x24da3a['id']]=new SugarcrmAccount(_0x24da3a);}else{_0x2ee264[_0xe363('0x43')](_0x2ee264['sugarcrmAccounts'][_0x24da3a['id']],_0x24da3a);}}}return _0x2ee264['sugarcrmAccounts'];};};Realtime[_0xe363('0x42')]['initVtigerAccounts']=function(){var _0x142a55=this;return function(_0x127c7e){if(_0x127c7e){freeIsNotKey(_0x127c7e,_0x142a55[_0xe363('0x51')],'id');for(var _0x3caf3e=0x0,_0x5d312a={},_0x5709c2={};_0x3caf3e<_0x127c7e['length'];_0x3caf3e+=0x1){_0x5d312a=_0x127c7e[_0x3caf3e];if(_[_0xe363('0x45')](_0x142a55[_0xe363('0x51')][_0x5d312a['id']])){_0x142a55[_0xe363('0x51')][_0x5d312a['id']]=new VtigerAccount(_0x5d312a);}else{_0x142a55[_0xe363('0x43')](_0x142a55['vtigerAccounts'][_0x5d312a['id']],_0x5d312a);}}}return _0x142a55['vtigerAccounts'];};};Realtime[_0xe363('0x42')]['initServicenowAccounts']=function(){var _0x1c81ce=this;return function(_0x45e6c8){if(_0x45e6c8){freeIsNotKey(_0x45e6c8,_0x1c81ce[_0xe363('0x22')],'id');for(var _0x29b98f=0x0,_0x1190be={},_0xa9aa67={};_0x29b98f<_0x45e6c8[_0xe363('0x48')];_0x29b98f+=0x1){_0x1190be=_0x45e6c8[_0x29b98f];if(_[_0xe363('0x45')](_0x1c81ce['servicenowAccounts'][_0x1190be['id']])){_0x1c81ce[_0xe363('0x22')][_0x1190be['id']]=new ServicenowAccount(_0x1190be);}else{_0x1c81ce[_0xe363('0x43')](_0x1c81ce['servicenowAccounts'][_0x1190be['id']],_0x1190be);}}}return _0x1c81ce[_0xe363('0x22')];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x355df8=this;return function(_0x596f3b){if(_0x596f3b){freeIsNotKey(_0x596f3b,_0x355df8[_0xe363('0x23')],'id');for(var _0x40f665=0x0,_0x52786a={},_0x15d7bc={};_0x40f665<_0x596f3b[_0xe363('0x48')];_0x40f665+=0x1){_0x52786a=_0x596f3b[_0x40f665];if(_[_0xe363('0x45')](_0x355df8[_0xe363('0x23')][_0x52786a['id']])){_0x355df8['dynamics365Accounts'][_0x52786a['id']]=new Dynamics365Account(_0x52786a);}else{_0x355df8[_0xe363('0x43')](_0x355df8['dynamics365Accounts'][_0x52786a['id']],_0x52786a);}}}return _0x355df8['dynamics365Accounts'];};};Realtime[_0xe363('0x42')][_0xe363('0x52')]=function(){var _0x440270=this;return function(_0x38e0a3){if(_0x38e0a3){freeIsNotKey(_0x38e0a3,_0x440270[_0xe363('0x53')],'id');for(var _0x3245d8=0x0,_0x3be5fb={},_0x3cb159={};_0x3245d8<_0x38e0a3[_0xe363('0x48')];_0x3245d8+=0x1){_0x3be5fb=_0x38e0a3[_0x3245d8];if(_[_0xe363('0x45')](_0x440270[_0xe363('0x53')][_0x3be5fb['id']])){_0x440270[_0xe363('0x53')][_0x3be5fb['id']]=new FreshsalesAccount(_0x3be5fb);}else{_0x440270['mergeFromDatabase'](_0x440270[_0xe363('0x53')][_0x3be5fb['id']],_0x3be5fb);}}}return _0x440270[_0xe363('0x53')];};};Realtime[_0xe363('0x42')][_0xe363('0x54')]=function(){var _0x41286a=this;return function(_0x539c39){for(var _0x4de8db=0x0;_0x4de8db<_0x539c39[_0xe363('0x48')];_0x4de8db+=0x1){_[_0xe363('0x55')](_0x41286a[_0xe363('0x16')][_0x539c39[_0x4de8db][_0xe363('0x28')]],_0x539c39[_0x4de8db]);}return _0x41286a[_0xe363('0x16')];};};Realtime[_0xe363('0x42')][_0xe363('0x56')]=function(){var _0x445588=this;return function(_0x5eb128){clearVoiceQueues(_0x445588[_0xe363('0x16')]);if(_0x5eb128){_0x5eb128=_[_0xe363('0x57')](_0x5eb128,_0xe363('0x58'));for(var _0x5e7702 in _0x5eb128){if(_0x5eb128['hasOwnProperty'](_0x5e7702)){var _0x3a4c7e={};for(var _0x5b821f=0x0;_0x5b821f<_0x5eb128[_0x5e7702]['length'];_0x5b821f+=0x1){var _0x283104=_0x5eb128[_0x5e7702][_0x5b821f][_0xe363('0x59')];if(_0x445588[_0xe363('0x16')][_0x283104]){if(_0x5eb128[_0x5e7702][_0x5b821f][_0xe363('0x5a')]){_0x445588['voiceQueues'][_0x283104][_0xe363('0x34')]+=0x1;}if(_0x5eb128[_0x5e7702][_0x5b821f][_0xe363('0x5b')]){_0x445588[_0xe363('0x16')][_0x283104][_0xe363('0x35')]+=0x1;}_0x445588[_0xe363('0x16')][_0x283104][_0xe363('0x2e')]+=moment(_0x5eb128[_0x5e7702][_0x5b821f]['queuecallerleaveAt'])[_0xe363('0x5c')](moment(_0x5eb128[_0x5e7702][_0x5b821f][_0xe363('0x5d')]),_0xe363('0x5e'))||0x0;if(_0x5b821f===_0x5eb128[_0x5e7702][_0xe363('0x48')]-0x1){_0x445588['voiceQueues'][_0x283104][_0xe363('0x2f')]+=moment(_0x5eb128[_0x5e7702][_0x5b821f][_0xe363('0x5f')]||_0x5eb128[_0x5e7702][_0x5b821f][_0xe363('0x60')]||_0x5eb128[_0x5e7702][_0x5b821f]['queuecallerexitAt'])['diff'](moment(_0x5eb128[_0x5e7702][_0x5b821f]['queuecallerjoinAt']),_0xe363('0x5e'))||0x0;_0x445588['voiceQueues'][_0x283104]['total']+=0x1;if(_0x5eb128[_0x5e7702][_0x5b821f][_0xe363('0x61')]){_0x445588[_0xe363('0x16')][_0x283104][_0xe363('0x2d')]+=0x1;_0x445588[_0xe363('0x16')][_0x283104][_0xe363('0x30')]+=moment(_0x5eb128[_0x5e7702][_0x5b821f][_0xe363('0x5f')])[_0xe363('0x5c')](moment(_0x5eb128[_0x5e7702][_0x5b821f]['queuecallerleaveAt']),_0xe363('0x5e'))||0x0;}}else{_0x445588[_0xe363('0x16')][_0x283104][_0xe363('0x2f')]+=_0x445588[_0xe363('0x16')][_0x283104][_0xe363('0x2e')]||0x0;}}}}}}return _0x445588[_0xe363('0x16')];};};Realtime['prototype'][_0xe363('0x62')]=function(){var _0x3ff332=this;return function(_0xb141d6){clearVoiceCallReports(_0x3ff332['outbound']);if(_0xb141d6){for(var _0x314e40=0x0;_0x314e40<_0xb141d6['length'];_0x314e40+=0x1){_0x3ff332[_0xe363('0x19')][_0xe363('0x2c')]+=0x1;_0x3ff332['outbound'][_0xe363('0x2f')]+=_0xb141d6[_0x314e40][_0xe363('0x63')];if(_0xb141d6[_0x314e40][_0xe363('0x64')]===_0xe363('0x65')){_0x3ff332[_0xe363('0x19')][_0xe363('0x2d')]+=0x1;_0x3ff332[_0xe363('0x19')][_0xe363('0x2e')]+=_0xb141d6[_0x314e40][_0xe363('0x63')]-_0xb141d6[_0x314e40][_0xe363('0x66')]||0x0;_0x3ff332[_0xe363('0x19')][_0xe363('0x30')]+=_0xb141d6[_0x314e40][_0xe363('0x66')];}}}return _0x3ff332[_0xe363('0x19')];};};Realtime[_0xe363('0x42')][_0xe363('0x67')]=function(){var _0x11c151=this;return function(_0x319fbc){if(_0x319fbc){freeIsNotKey(_0x319fbc,_0x11c151[_0xe363('0x68')],_0xe363('0x28'));for(var _0x13cbfe=0x0,_0x506b46={};_0x13cbfe<_0x319fbc[_0xe363('0x48')];_0x13cbfe+=0x1){_0x506b46=_0x319fbc[_0x13cbfe];if(_['isUndefined'](_0x11c151[_0xe363('0x68')][_0x506b46[_0xe363('0x28')]])){_0x11c151['campaigns'][_0x506b46[_0xe363('0x28')]]=new Campaign(_0x506b46);}else{_0x11c151[_0xe363('0x43')](_0x11c151[_0xe363('0x68')][_0x506b46[_0xe363('0x28')]],_0x506b46);_0x11c151[_0xe363('0x68')][_0x506b46['name']]['dialQueueProject']=_0x506b46[_0xe363('0x69')]?_0x506b46[_0xe363('0x69')][_0xe363('0x28')]:undefined;}}}return _0x11c151[_0xe363('0x68')];};};Realtime[_0xe363('0x42')]['initVoiceExtensions']=function(){var _0x494374=this;return function(_0x463235){if(_0x463235){freeIsNotKey(_0x463235,_0x494374['voiceExtensions'],'id');for(var _0xe9c4c2=0x0,_0x164bf6={};_0xe9c4c2<_0x463235[_0xe363('0x48')];_0xe9c4c2+=0x1){_0x164bf6=_0x463235[_0xe9c4c2];if(_[_0xe363('0x45')](_0x494374[_0xe363('0x6a')][_0x164bf6['id']])){_0x494374[_0xe363('0x6a')][_0x164bf6['id']]=new VoiceExtension(_0x164bf6);}else{_0x494374[_0xe363('0x43')](_0x494374[_0xe363('0x6a')][_0x164bf6['id']],_0x164bf6);}}}return _0x494374['voiceExtensions'];};};Realtime['prototype'][_0xe363('0x6b')]=function(){var _0x1e9f6a=this;return function(_0x3e484b){clearCampaigns(_0x1e9f6a[_0xe363('0x68')]);for(var _0x4ead7c=0x0;_0x4ead7c<_0x3e484b['length'];_0x4ead7c+=0x1){_[_0xe363('0x55')](_0x1e9f6a[_0xe363('0x68')][_0x3e484b[_0x4ead7c][_0xe363('0x28')]],_0x3e484b[_0x4ead7c]);}return _0x1e9f6a[_0xe363('0x68')];};};Realtime[_0xe363('0x42')]['initFaxAccounts']=function(){var _0x454355=this;return function(_0x48e6bd){if(_0x48e6bd){freeIsNotKey(_0x48e6bd,_0x454355[_0xe363('0x24')],'id');for(var _0x2197cb=0x0,_0x576ab4={},_0x49e93b={};_0x2197cb<_0x48e6bd['length'];_0x2197cb+=0x1){_0x576ab4=_0x48e6bd[_0x2197cb];if(_[_0xe363('0x45')](_0x454355[_0xe363('0x24')][_0x576ab4['id']])){_0x454355[_0xe363('0x24')][_0x576ab4['id']]=new FaxAccount(_0x576ab4);}else{_0x454355['mergeFromDatabase'](_0x454355[_0xe363('0x24')][_0x576ab4['id']],_0x576ab4);}}}return _0x454355['faxAccounts'];};};module[_0xe363('0x6c')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 4c51604..0eb3ede 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 _0x856f=['split','membername','monitor','monitorFilename','monitors','filename','connectedlinename','xcally-motion-dialer','forEach','startsWith','Local','indexOf','mobile','phone','substring','SIP/%s','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','bind','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','interface','connectedlinenum','assigned','isNil','format','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','keys','length','getCallType','channel','getAgentByInternal','calleridnum','internal','destination','exten','type','dialer','lastapplication','queue','lastdata','from-voip-provider','callerid','context','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfereelinkedid','uniqueid','transfers','UserId'];(function(_0x167db1,_0x2ac8ef){var _0x3d5ef7=function(_0x43fb32){while(--_0x43fb32){_0x167db1['push'](_0x167db1['shift']());}};_0x3d5ef7(++_0x2ac8ef);}(_0x856f,0x135));var _0xf856=function(_0x285571,_0x5ac9fd){_0x285571=_0x285571-0x0;var _0x225054=_0x856f[_0x285571];return _0x225054;};'use strict';var _=require(_0xf856('0x0'));var moment=require(_0xf856('0x1'));var util=require(_0xf856('0x2'));var config=require(_0xf856('0x3'));var ami=require(_0xf856('0x4'));var RpcVoiceAgentReport=require(_0xf856('0x5'));var RpcVoiceCallReport=require(_0xf856('0x6'));var RpcVoiceDialReport=require(_0xf856('0x7'));var RpcMemberReport=require(_0xf856('0x8'));var RpcVoiceQueueReport=require(_0xf856('0x9'));var RpcVoiceRecording=require(_0xf856('0xa'));var RpcVoiceTransferReport=require(_0xf856('0xb'));var VoiceQueueReport=require(_0xf856('0xc'));var VoiceCallReport=require(_0xf856('0xd'));var VoiceAgentReport=require(_0xf856('0xe'));var VoiceDialReport=require(_0xf856('0xf'));var UserReport=require('./userReport');function Report(_0x45a382){this[_0xf856('0x10')]=_0x45a382;this[_0xf856('0x11')]=_0x45a382[_0xf856('0x11')];this[_0xf856('0x12')]=_0x45a382['telephones'];}Report['prototype'][_0xf856('0x13')]=function(_0x245597){var _0x50c296=new VoiceQueueReport(this['realtime']);var _0x578a28=new VoiceAgentReport(this[_0xf856('0x10')]);var _0x4958eb=new VoiceDialReport(this[_0xf856('0x10')]);var _0x55af48=new VoiceCallReport(this[_0xf856('0x10')]);var _0x2d29eb=new UserReport(this[_0xf856('0x10')]);if(config[_0xf856('0x14')]&&config[_0xf856('0x14')][_0xf856('0x15')]){ami['on'](_0xf856('0x16'),this[_0xf856('0x17')]['bind'](this));ami['on'](_0xf856('0x18'),this['voiceCallReport'][_0xf856('0x19')](this));ami['on']('custom:voiceAgentReport',this[_0xf856('0x1a')][_0xf856('0x19')](this));ami['on']('custom:voiceDialReport',this[_0xf856('0x1b')][_0xf856('0x19')](this));ami['on'](_0xf856('0x1c'),this[_0xf856('0x1d')][_0xf856('0x19')](this));ami['on'](_0xf856('0x1e'),this[_0xf856('0x1f')][_0xf856('0x19')](this));}};Report[_0xf856('0x20')][_0xf856('0x21')]=function(_0x57a4fa){var _0x5069dd;_0x5069dd=_[_0xf856('0x22')](this[_0xf856('0x11')],function(_0xa43286){return _0xa43286[_0xf856('0x23')]==_0x57a4fa||_0xa43286[_0xf856('0x24')]==_0x57a4fa;});if(_['isNil'](_0x5069dd)){var _0x367427=_[_0xf856('0x22')](this[_0xf856('0x12')],function(_0x348a1e){return _0x348a1e[_0xf856('0x23')]==_0x57a4fa||_0x348a1e['name']==_0x57a4fa;});if(_0x367427){_0x5069dd=_[_0xf856('0x22')](this[_0xf856('0x11')],function(_0x294089){return _0x294089[_0xf856('0x25')]==util['format']('SIP/%s',_0x367427[_0xf856('0x24')]);});}}return _0x5069dd;};Report[_0xf856('0x20')][_0xf856('0x17')]=function(_0x2e34ac){for(var _0x5892c8=0x0;_0x5892c8<_0x2e34ac['length'];_0x5892c8+=0x1){var _0x3d1546=this[_0xf856('0x21')](_0x2e34ac[_0x5892c8][_0xf856('0x26')]);if(_0x3d1546){_0x2e34ac[_0x5892c8]['accountcode']=_0x3d1546['accountcode'];_0x2e34ac[_0x5892c8][_0xf856('0x27')]=!![];_0x2e34ac[_0x5892c8]['lastAssignedTo']=_0x3d1546[_0xf856('0x24')];_0x2e34ac[_0x5892c8]['interface']=_[_0xf856('0x28')](_0x3d1546[_0xf856('0x25')])?util[_0xf856('0x29')]('SIP/%s',_0x3d1546['name']):_0x3d1546[_0xf856('0x25')];if(_0x2e34ac[_0x5892c8][_0xf856('0x2a')]){_0x2e34ac[_0x5892c8]['queuecallercompleteAt']=moment()[_0xf856('0x29')](_0xf856('0x2b'));}if(_0x2e34ac[_0x5892c8][_0xf856('0x2c')]){_0x2e34ac[_0x5892c8][_0xf856('0x2d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x2e34ac[_0x5892c8]);}RpcVoiceQueueReport[_0xf856('0x2e')](_0x2e34ac[_0x5892c8]);}};function extractCalleridNumber(_0xa294d){var _0x3faa83=_0xa294d[_0xf856('0x2f')](/<(.*?)>/);return _0x3faa83?_0x3faa83[0x1]:_0xa294d;}Report[_0xf856('0x20')]['getAgentByInternal']=function(_0x27e78b){for(var _0x213714=0x0;_0x213714','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','getCallType','UserId','split','membername','monitor','monitors','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','substring','indexOf','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime'];(function(_0x26e0aa,_0x2e984d){var _0x27e19d=function(_0x1c42dc){while(--_0x1c42dc){_0x26e0aa['push'](_0x26e0aa['shift']());}};_0x27e19d(++_0x2e984d);}(_0xe212,0x1c4));var _0x2e21=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xe212[_0x20a558];return _0x53d3f7;};'use strict';var _=require(_0x2e21('0x0'));var moment=require(_0x2e21('0x1'));var util=require(_0x2e21('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x2e21('0x3'));var RpcVoiceDialReport=require(_0x2e21('0x4'));var RpcMemberReport=require(_0x2e21('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x2e21('0x6'));var RpcVoiceTransferReport=require(_0x2e21('0x7'));var VoiceQueueReport=require(_0x2e21('0x8'));var VoiceCallReport=require(_0x2e21('0x9'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x2e21('0xa'));var UserReport=require(_0x2e21('0xb'));function Report(_0x406cc1){this[_0x2e21('0xc')]=_0x406cc1;this[_0x2e21('0xd')]=_0x406cc1[_0x2e21('0xd')];this['telephones']=_0x406cc1[_0x2e21('0xe')];}Report[_0x2e21('0xf')][_0x2e21('0x10')]=function(_0x2ddbfc){var _0x303cf3=new VoiceQueueReport(this[_0x2e21('0xc')]);var _0x50954f=new VoiceAgentReport(this[_0x2e21('0xc')]);var _0xccb28=new VoiceDialReport(this[_0x2e21('0xc')]);var _0x1c39ef=new VoiceCallReport(this[_0x2e21('0xc')]);var _0x40aab2=new UserReport(this[_0x2e21('0xc')]);if(config[_0x2e21('0x11')]&&config[_0x2e21('0x11')][_0x2e21('0x12')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0x2e21('0x13')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0x2e21('0x13')](this));ami['on'](_0x2e21('0x14'),this[_0x2e21('0x15')][_0x2e21('0x13')](this));ami['on'](_0x2e21('0x16'),this[_0x2e21('0x17')][_0x2e21('0x13')](this));ami['on'](_0x2e21('0x18'),this[_0x2e21('0x19')][_0x2e21('0x13')](this));ami['on']('attendedtransfer',this[_0x2e21('0x1a')][_0x2e21('0x13')](this));}};Report[_0x2e21('0xf')][_0x2e21('0x1b')]=function(_0x23acd1){var _0x2503c8;_0x2503c8=_[_0x2e21('0x1c')](this[_0x2e21('0xd')],function(_0x4cb98a){return _0x4cb98a[_0x2e21('0x1d')]==_0x23acd1||_0x4cb98a[_0x2e21('0x1e')]==_0x23acd1;});if(_[_0x2e21('0x1f')](_0x2503c8)){var _0x57c9f2=_[_0x2e21('0x1c')](this['telephones'],function(_0x1ca859){return _0x1ca859[_0x2e21('0x1d')]==_0x23acd1||_0x1ca859[_0x2e21('0x1e')]==_0x23acd1;});if(_0x57c9f2){_0x2503c8=_[_0x2e21('0x1c')](this['agents'],function(_0x32228c){return _0x32228c[_0x2e21('0x20')]==util['format'](_0x2e21('0x21'),_0x57c9f2['name']);});}}return _0x2503c8;};Report[_0x2e21('0xf')][_0x2e21('0x22')]=function(_0x1f23a4){for(var _0x3f5dec=0x0;_0x3f5dec<_0x1f23a4[_0x2e21('0x23')];_0x3f5dec+=0x1){var _0x55db4e=this['findAgent'](_0x1f23a4[_0x3f5dec][_0x2e21('0x24')]);if(_0x55db4e){_0x1f23a4[_0x3f5dec][_0x2e21('0x1d')]=_0x55db4e[_0x2e21('0x1d')];_0x1f23a4[_0x3f5dec][_0x2e21('0x25')]=!![];_0x1f23a4[_0x3f5dec][_0x2e21('0x26')]=_0x55db4e[_0x2e21('0x1e')];_0x1f23a4[_0x3f5dec]['interface']=_[_0x2e21('0x1f')](_0x55db4e[_0x2e21('0x20')])?util[_0x2e21('0x27')](_0x2e21('0x21'),_0x55db4e[_0x2e21('0x1e')]):_0x55db4e[_0x2e21('0x20')];if(_0x1f23a4[_0x3f5dec][_0x2e21('0x28')]){_0x1f23a4[_0x3f5dec][_0x2e21('0x29')]=moment()[_0x2e21('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1f23a4[_0x3f5dec]['queuecallerexit']){_0x1f23a4[_0x3f5dec][_0x2e21('0x2a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x2e21('0x22')](_0x1f23a4[_0x3f5dec]);}RpcVoiceQueueReport[_0x2e21('0x2b')](_0x1f23a4[_0x3f5dec]);}};function extractCalleridNumber(_0x1c5412){var _0x2891c8=_0x1c5412[_0x2e21('0x2c')](/<(.*?)>/);return _0x2891c8?_0x2891c8[0x1]:_0x1c5412;}Report[_0x2e21('0xf')][_0x2e21('0x2d')]=function(_0x3e09d4){for(var _0x20e4df=0x0;_0x20e4df0x0?_0x345d84:0x0;this[_0x77e0('0x12')][_0x1871c8[_0x77e0('0x63')]][_0x77e0('0x2d')]=this[_0x77e0('0x12')][_0x1871c8[_0x77e0('0x63')]][_0x77e0('0x2d')]>_[_0x77e0('0x66')](_0x1871c8[_0x77e0('0x67')])?_[_0x77e0('0x66')](_0x1871c8['loggedin']):this[_0x77e0('0x12')][_0x1871c8[_0x77e0('0x63')]][_0x77e0('0x2d')];this[_0x77e0('0x4b')](this[_0x77e0('0x12')][_0x1871c8[_0x77e0('0x63')]],_0x77e0('0x16'));}logger[_0x77e0('0x42')](_0x77e0('0x69'),util[_0x77e0('0x39')](this[_0x77e0('0x12')][_0x1871c8[_0x77e0('0x63')]],{'showHidden':![],'depth':null}));ami[_0x77e0('0x40')](_0x77e0('0x6a'),this[_0x77e0('0x12')][_0x1871c8[_0x77e0('0x63')]]);}}}catch(_0x154c20){logger[_0x77e0('0x5d')](_0x77e0('0x5f'),util['inspect'](_0x154c20,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x77e0('0x1a')]=function(_0x539239){logger[_0x77e0('0x42')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x77e0('0x39')](_0x539239,{'showHidden':![],'depth':null}));ami[_0x77e0('0x40')]('custom:queuesummarycomplete',{});this[_0x77e0('0x13')]=!![];};VoiceQueueReport[_0x77e0('0x9')]['syncQueueCallerJoin']=function(_0x21c208){try{if(this[_0x77e0('0x5a')](_0x21c208)){logger[_0x77e0('0x42')](_0x77e0('0x6b'),_0x21c208[_0x77e0('0x44')],util[_0x77e0('0x39')](_0x21c208,{'showHidden':![],'depth':null}));if(_[_0x77e0('0x5b')](this[_0x77e0('0xe')][_0x21c208[_0x77e0('0x44')]]))this[_0x77e0('0xe')][_0x21c208[_0x77e0('0x44')]]=[];if(_[_0x77e0('0x5b')](this[_0x77e0('0x10')][_0x21c208[_0x77e0('0x44')]]))this[_0x77e0('0x10')][_0x21c208[_0x77e0('0x44')]]={};var _0x447ce9=new QueueReport();_0x447ce9[_0x77e0('0x47')]=_0x21c208[_0x77e0('0x63')];_0x447ce9[_0x77e0('0x51')]=this['voiceQueues'][_0x447ce9[_0x77e0('0x47')]]&&this[_0x77e0('0x12')][_0x447ce9[_0x77e0('0x47')]][_0x77e0('0x51')]?this[_0x77e0('0x12')][_0x447ce9[_0x77e0('0x47')]]['type']||_0x77e0('0x4c'):_0x77e0('0x4c');_0x447ce9[_0x77e0('0x63')]=_0x21c208['queue'];_0x447ce9[_0x77e0('0x6c')]=moment()[_0x77e0('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x447ce9[_0x77e0('0x6d')]=_0x21c208[_0x77e0('0x6d')];_0x447ce9[_0x77e0('0x6e')]=_0x21c208[_0x77e0('0x6e')];_0x447ce9[_0x77e0('0x44')]=_0x21c208['uniqueid'];_0x447ce9['routealias']=this['channels'][_0x21c208[_0x77e0('0x44')]][_0x77e0('0x6f')];logger['info'](_0x77e0('0x70'),_0x447ce9[_0x77e0('0x47')],_0x447ce9[_0x77e0('0x51')]);_[_0x77e0('0x71')](_0x447ce9,_[_0x77e0('0x72')](_0x21c208,_['keys'](_0x447ce9)));this[_0x77e0('0xe')][_0x21c208[_0x77e0('0x44')]][_0x77e0('0x73')](_0x447ce9);this[_0x77e0('0x10')][_0x21c208[_0x77e0('0x44')]]=_0x447ce9;this[_0x77e0('0x41')](_0x447ce9,'queuecallerjoin');}}catch(_0x51d61e){logger['error'](_0x77e0('0x6b'),_0x21c208[_0x77e0('0x44')],util[_0x77e0('0x39')](_0x51d61e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x77e0('0x9')]['syncQueueCallerAbandon']=function(_0xf92af){try{if(this['isNotNull'](_0xf92af)){logger[_0x77e0('0x42')]('[%s][voiceQueueReport][queuecallerabandon]',_0xf92af[_0x77e0('0x44')],util[_0x77e0('0x39')](_0xf92af,{'showHidden':![],'depth':null}));if(this[_0x77e0('0xe')][_0xf92af['uniqueid']]){var _0x5db81e=_['last'](this[_0x77e0('0xe')][_0xf92af[_0x77e0('0x44')]]);_0x5db81e['queuecallercomplete']=![];_0x5db81e[_0x77e0('0x74')]=null;_0x5db81e[_0x77e0('0x75')]=_0xf92af[_0x77e0('0x75')];_0x5db81e[_0x77e0('0x76')]=_0xf92af[_0x77e0('0x76')];_0x5db81e[_0x77e0('0x77')]=!![];_0x5db81e['queuecallerabandonAt']=moment()[_0x77e0('0x45')](_0x77e0('0x78'));_0x5db81e[_0x77e0('0x79')]=_0x77e0('0x7a');_0x5db81e[_0x77e0('0x7b')]=null;logger[_0x77e0('0x61')](_0x77e0('0x7c'),_0x5db81e[_0x77e0('0x47')],_0x5db81e[_0x77e0('0x51')]);this[_0x77e0('0x10')][_0xf92af['uniqueid']]=_0x5db81e;this[_0x77e0('0x3e')](_0x5db81e,_0x77e0('0x77'));}}}catch(_0x1d888a){logger[_0x77e0('0x5d')](_0x77e0('0x7d'),_0xf92af[_0x77e0('0x44')],util['inspect'](_0x1d888a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x77e0('0x9')]['syncQueueCallerLeave']=function(_0x2e849d){try{if(this[_0x77e0('0x5a')](_0x2e849d)){logger[_0x77e0('0x42')]('[%s][voiceQueueReport][queuecallerleave]',_0x2e849d[_0x77e0('0x44')],util[_0x77e0('0x39')](_0x2e849d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2e849d['uniqueid']]){var _0x3c5a5e=_['last'](this['queueReports'][_0x2e849d[_0x77e0('0x44')]]);_0x3c5a5e[_0x77e0('0x7e')]=moment()[_0x77e0('0x45')](_0x77e0('0x78'));_0x3c5a5e[_0x77e0('0x7f')]=_0x2e849d[_0x77e0('0x7f')];_0x3c5a5e[_0x77e0('0x80')]=_0x2e849d[_0x77e0('0x80')];logger[_0x77e0('0x61')](_0x77e0('0x81'),_0x3c5a5e[_0x77e0('0x47')],_0x3c5a5e[_0x77e0('0x51')],_0x2e849d[_0x77e0('0x7f')],_0x2e849d[_0x77e0('0x80')]);this[_0x77e0('0x10')][_0x2e849d[_0x77e0('0x44')]]=_0x3c5a5e;this[_0x77e0('0x41')](_0x3c5a5e,_0x77e0('0x1d'));}}}catch(_0x4c4d63){logger['error'](_0x77e0('0x82'),_0x2e849d[_0x77e0('0x44')],util[_0x77e0('0x39')](_0x4c4d63,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x77e0('0x9')]['syncAgentConnect']=function(_0x2451a0){try{if(this[_0x77e0('0x5a')](_0x2451a0)){logger[_0x77e0('0x42')](_0x77e0('0x83'),_0x2451a0[_0x77e0('0x44')],util[_0x77e0('0x39')](_0x2451a0,{'showHidden':![],'depth':null}));if(this[_0x77e0('0xe')][_0x2451a0[_0x77e0('0x44')]]){var _0x44a737=_['last'](this[_0x77e0('0xe')][_0x2451a0[_0x77e0('0x44')]]);_0x44a737[_0x77e0('0x84')]=!![];_0x44a737[_0x77e0('0x79')]=_0x77e0('0x85');logger[_0x77e0('0x61')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x44a737[_0x77e0('0x47')],_0x44a737[_0x77e0('0x51')]);}}}catch(_0x5c0534){logger['error'](_0x77e0('0x83'),_0x2451a0[_0x77e0('0x44')],util[_0x77e0('0x39')](_0x5c0534,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x77e0('0x9')]['syncAgentComplete']=function(_0x36e15d){try{if(this[_0x77e0('0x5a')](_0x36e15d)){logger[_0x77e0('0x42')](_0x77e0('0x86'),_0x36e15d[_0x77e0('0x44')],util['inspect'](_0x36e15d,{'showHidden':![],'depth':null}));if(this[_0x77e0('0xe')][_0x36e15d[_0x77e0('0x44')]]){var _0x1b627b=_[_0x77e0('0x87')](this[_0x77e0('0xe')][_0x36e15d[_0x77e0('0x44')]]);_0x1b627b['queuecallerabandon']=![];_0x1b627b[_0x77e0('0x88')]=null;_0x1b627b[_0x77e0('0x89')]=!![];_0x1b627b[_0x77e0('0x7b')]=_0x36e15d[_0x77e0('0x8a')];_0x1b627b['holdtime']=_0x36e15d[_0x77e0('0x75')];_0x1b627b['queuecallercomplete']=!![];_0x1b627b[_0x77e0('0x8b')]=![];_0x1b627b[_0x77e0('0x8c')]=null;if(!_0x1b627b['transfer']){if(_0x36e15d[_0x77e0('0x8d')]==_0x77e0('0x8e')){_0x1b627b[_0x77e0('0x79')]=_0x77e0('0x8f');logger[_0x77e0('0x61')](_0x77e0('0x90'),_0x1b627b[_0x77e0('0x47')],_0x1b627b['type']);}else{if(_[_0x77e0('0x91')](_0x36e15d[_0x77e0('0x92')]['toLowerCase'](),_0x77e0('0x93'))){if(this[_0x77e0('0xe')][_0x36e15d[_0x77e0('0x94')]]){var _0x3f9807=_[_0x77e0('0x87')](this[_0x77e0('0xe')][_0x36e15d[_0x77e0('0x94')]]);_0x3f9807[_0x77e0('0x84')]=![];_0x3f9807[_0x77e0('0x8b')]=!![];_0x3f9807[_0x77e0('0x8c')]=moment(_0x1b627b[_0x77e0('0x6c')])['add'](_0x36e15d[_0x77e0('0x75')],'seconds')[_0x77e0('0x45')](_0x77e0('0x78'));_0x3f9807['queuecallerexitreason']=_0x77e0('0x95');_0x3f9807[_0x77e0('0x8e')]=!![];_0x3f9807[_0x77e0('0x96')]='FORWARD';_0x3f9807[_0x77e0('0x97')]=_0x36e15d[_0x77e0('0x98')];_0x3f9807[_0x77e0('0x99')]=_0x36e15d[_0x77e0('0x44')];logger[_0x77e0('0x61')](_0x77e0('0x9a'),_0x3f9807[_0x77e0('0x47')],_0x3f9807['type']);var _0x38fdbd=this[_0x77e0('0xe')][_0x36e15d[_0x77e0('0x94')]];this['queueReports'][_0x36e15d[_0x77e0('0x94')]]=this['queueReports'][_0x36e15d[_0x77e0('0x44')]];this[_0x77e0('0xe')][_0x36e15d[_0x77e0('0x44')]]=_0x38fdbd;}}else{_0x1b627b[_0x77e0('0x79')]=_0x77e0('0x9b')+_0x36e15d[_0x77e0('0x8d')][_0x77e0('0x9c')]();logger['info'](_0x77e0('0x9d'),_0x1b627b[_0x77e0('0x47')],_0x1b627b[_0x77e0('0x51')],_0x1b627b[_0x77e0('0x79')]);}}}this[_0x77e0('0x10')][_0x36e15d[_0x77e0('0x44')]]=_0x1b627b;this['emitVoiceQueueChannelRemove'](_0x1b627b,'agentcomplete');}}}catch(_0x9c3cef){logger[_0x77e0('0x5d')](_0x77e0('0x86'),_0x36e15d['uniqueid'],util[_0x77e0('0x39')](_0x9c3cef,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x77e0('0x9')][_0x77e0('0x21')]=function(_0xf63c6f){try{if(this[_0x77e0('0x5a')](_0xf63c6f)){logger['debug']('[%s][voiceQueueReport][varset]',_0xf63c6f['uniqueid'],util[_0x77e0('0x39')](_0xf63c6f,{'showHidden':![],'depth':null}));this['addVariable'](_0xf63c6f[_0x77e0('0x44')],_['keys'](_0xf63c6f[_0x77e0('0x9e')])[0x0],_0xf63c6f[_0x77e0('0x9f')]);if(this[_0x77e0('0xe')][_0xf63c6f[_0x77e0('0x44')]]){var _0x4b7183=_[_0x77e0('0x87')](this[_0x77e0('0xe')][_0xf63c6f[_0x77e0('0x44')]]);if(_0x4b7183){if(this[_0x77e0('0x5a')](_0xf63c6f['variable'])&&this[_0x77e0('0x5a')](_0xf63c6f[_0x77e0('0x9e')][_0x77e0('0xa0')])){switch(_0xf63c6f[_0x77e0('0x9f')]){case'CONTINUE':_0x4b7183[_0x77e0('0x8b')]=![];_0x4b7183[_0x77e0('0x8c')]=null;break;case _0x77e0('0xa1'):_0x4b7183[_0x77e0('0xa2')]=_0x77e0('0xa3');_0x4b7183[_0x77e0('0x8b')]=!![];_0x4b7183[_0x77e0('0x8c')]=moment()[_0x77e0('0x45')](_0x77e0('0x78'));_0x4b7183[_0x77e0('0x7e')]=moment()[_0x77e0('0x45')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x77e0('0x42')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0xf63c6f[_0x77e0('0x44')],util[_0x77e0('0x39')](_0x4b7183,{'showHidden':![],'depth':null}));ami[_0x77e0('0x40')]('custom:timeout',_0x4b7183);break;default:_0x4b7183[_0x77e0('0x8b')]=!![];_0x4b7183[_0x77e0('0x8c')]=moment()[_0x77e0('0x45')](_0x77e0('0x78'));_0x4b7183[_0x77e0('0x7e')]=moment()[_0x77e0('0x45')](_0x77e0('0x78'));}_0x4b7183['queuecallerabandon']=![];_0x4b7183[_0x77e0('0x88')]=null;_0x4b7183['queuecallerexitreason']=_0xf63c6f[_0x77e0('0x9f')];this[_0x77e0('0x10')][_0xf63c6f['uniqueid']]=_0x4b7183;this[_0x77e0('0x3e')](_0x4b7183,_0x77e0('0x20'));}else if(this[_0x77e0('0x5a')](_0xf63c6f[_0x77e0('0x9e')])&&this['isNotNull'](_0xf63c6f[_0x77e0('0x9e')]['queueposition'])){if(!_0x4b7183[_0x77e0('0x77')]){_0x4b7183[_0x77e0('0x8b')]=!![];_0x4b7183['queuecallerexitAt']=moment()['format'](_0x77e0('0x78'));_0x4b7183['queuecallerexitreason']=_0x77e0('0xa4');_0x4b7183[_0x77e0('0x7e')]=moment()[_0x77e0('0x45')](_0x77e0('0x78'));this[_0x77e0('0x10')][_0xf63c6f[_0x77e0('0x44')]]=_0x4b7183;}}logger[_0x77e0('0x61')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0xf63c6f[_0x77e0('0x44')],_0x4b7183['name'],_0x4b7183[_0x77e0('0x51')],_[_0x77e0('0xa5')](_0xf63c6f[_0x77e0('0x9e')])[0x0],_0xf63c6f[_0x77e0('0x9f')]);_0x4b7183[_0x77e0('0x15')]=this[_0x77e0('0x15')][_0xf63c6f[_0x77e0('0x44')]];}}}}catch(_0x3cea78){logger[_0x77e0('0x5d')](_0x77e0('0xa6'),_0xf63c6f['uniqueid'],util[_0x77e0('0x39')](_0x3cea78,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x77e0('0xa7')]=function(_0x2b40a9,_0x1747e2,_0x1e3489){var _0x4dd22d=[_0x77e0('0xa8'),_0x77e0('0xa9'),_0x77e0('0xaa'),_0x77e0('0xab'),'rtpaudioqosloss',_0x77e0('0xac'),_0x77e0('0xad'),_0x77e0('0xae'),_0x77e0('0xaf'),_0x77e0('0xb0'),_0x77e0('0xb1'),_0x77e0('0xb2'),_0x77e0('0xb3'),_0x77e0('0xb4'),'memberinterface',_0x77e0('0xb5'),_0x77e0('0x8a'),_0x77e0('0xb6'),_0x77e0('0xb7')];if(!_['isNil'](_0x1747e2)&&!_[_0x77e0('0xb8')](_0x4dd22d,_0x1747e2)){if(_['isUndefined'](this[_0x77e0('0x15')][_0x2b40a9])){this[_0x77e0('0x15')][_0x2b40a9]={};}this[_0x77e0('0x15')][_0x2b40a9][_0x1747e2]=_0x1e3489;}};VoiceQueueReport[_0x77e0('0x9')][_0x77e0('0xb9')]=function(_0x78e332,_0x44b008,_0x2a5e23){var _0x26cae5={};for(var _0x507fca=0x0;_0x507fca0x0?_0x544d77:0x0;this[_0x95fb('0x13')][_0x58b0ec['queue']][_0x95fb('0x6c')]=this[_0x95fb('0x13')][_0x58b0ec[_0x95fb('0x65')]]['talking']>_[_0x95fb('0x69')](_0x58b0ec[_0x95fb('0x6a')])?_['toNumber'](_0x58b0ec[_0x95fb('0x6a')]):this['voiceQueues'][_0x58b0ec[_0x95fb('0x65')]]['talking'];this[_0x95fb('0x6d')](this[_0x95fb('0x13')][_0x58b0ec['queue']],'queuesummary');}logger[_0x95fb('0x5b')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x95fb('0x38')](this['voiceQueues'][_0x58b0ec[_0x95fb('0x65')]],{'showHidden':![],'depth':null}));ami[_0x95fb('0x41')](_0x95fb('0x6e'),this[_0x95fb('0x13')][_0x58b0ec[_0x95fb('0x65')]]);}}}catch(_0x455ae5){logger[_0x95fb('0x3a')](_0x95fb('0x6f'),util[_0x95fb('0x38')](_0x455ae5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x95fb('0x2e')]['syncQueueSummaryComplete']=function(_0x367775){logger['debug'](_0x95fb('0x70'),util['inspect'](_0x367775,{'showHidden':![],'depth':null}));ami[_0x95fb('0x41')](_0x95fb('0x71'),{});this['flagQueueSummary']=!![];};VoiceQueueReport[_0x95fb('0x2e')][_0x95fb('0x1a')]=function(_0x5b664f){try{if(this[_0x95fb('0x5e')](_0x5b664f)){logger['debug'](_0x95fb('0x72'),_0x5b664f[_0x95fb('0x4a')],util[_0x95fb('0x38')](_0x5b664f,{'showHidden':![],'depth':null}));if(_[_0x95fb('0x5f')](this[_0x95fb('0x39')][_0x5b664f[_0x95fb('0x4a')]]))this[_0x95fb('0x39')][_0x5b664f[_0x95fb('0x4a')]]=[];if(_[_0x95fb('0x5f')](this[_0x95fb('0x11')][_0x5b664f[_0x95fb('0x4a')]]))this['channels'][_0x5b664f[_0x95fb('0x4a')]]={};var _0x26fad0=new QueueReport();_0x26fad0[_0x95fb('0x47')]=_0x5b664f[_0x95fb('0x65')];_0x26fad0['type']=this['voiceQueues'][_0x26fad0[_0x95fb('0x47')]]&&this['voiceQueues'][_0x26fad0[_0x95fb('0x47')]][_0x95fb('0x4f')]?this[_0x95fb('0x13')][_0x26fad0[_0x95fb('0x47')]][_0x95fb('0x4f')]||_0x95fb('0x50'):'inbound';_0x26fad0[_0x95fb('0x65')]=_0x5b664f[_0x95fb('0x65')];_0x26fad0[_0x95fb('0x73')]=moment()[_0x95fb('0x45')](_0x95fb('0x74'));_0x26fad0['position']=_0x5b664f['position'];_0x26fad0[_0x95fb('0x75')]=_0x5b664f[_0x95fb('0x75')];_0x26fad0['uniqueid']=_0x5b664f[_0x95fb('0x4a')];_0x26fad0['routealias']=this[_0x95fb('0x11')][_0x5b664f['uniqueid']][_0x95fb('0x76')];logger[_0x95fb('0x66')](_0x95fb('0x77'),_0x26fad0[_0x95fb('0x47')],_0x26fad0['type']);_[_0x95fb('0x78')](_0x26fad0,_['pick'](_0x5b664f,_[_0x95fb('0x79')](_0x26fad0)));this[_0x95fb('0x39')][_0x5b664f['uniqueid']][_0x95fb('0x7a')](_0x26fad0);this[_0x95fb('0x11')][_0x5b664f['uniqueid']]=_0x26fad0;this[_0x95fb('0x42')](_0x26fad0,_0x95fb('0x7b'));}}catch(_0x71ac24){logger[_0x95fb('0x3a')]('[%s][voiceQueueReport][queuecallerjoin]',_0x5b664f[_0x95fb('0x4a')],util[_0x95fb('0x38')](_0x71ac24,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x95fb('0x2e')][_0x95fb('0x1b')]=function(_0x569fb4){try{if(this[_0x95fb('0x5e')](_0x569fb4)){logger[_0x95fb('0x5b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x569fb4[_0x95fb('0x4a')],util[_0x95fb('0x38')](_0x569fb4,{'showHidden':![],'depth':null}));if(this[_0x95fb('0x39')][_0x569fb4['uniqueid']]){var _0x17a9be=_[_0x95fb('0x7c')](this['queueReports'][_0x569fb4[_0x95fb('0x4a')]]);_0x17a9be['queuecallercomplete']=![];_0x17a9be[_0x95fb('0x7d')]=null;_0x17a9be[_0x95fb('0x7e')]=_0x569fb4[_0x95fb('0x7e')];_0x17a9be[_0x95fb('0x7f')]=_0x569fb4[_0x95fb('0x7f')];_0x17a9be[_0x95fb('0x80')]=!![];_0x17a9be[_0x95fb('0x81')]=moment()['format'](_0x95fb('0x74'));_0x17a9be[_0x95fb('0x4b')]=_0x95fb('0x82');_0x17a9be[_0x95fb('0x83')]=null;logger[_0x95fb('0x66')](_0x95fb('0x84'),_0x17a9be[_0x95fb('0x47')],_0x17a9be[_0x95fb('0x4f')]);this['channels'][_0x569fb4[_0x95fb('0x4a')]]=_0x17a9be;this[_0x95fb('0x3f')](_0x17a9be,_0x95fb('0x80'));}}}catch(_0x24b7ad){logger[_0x95fb('0x3a')](_0x95fb('0x85'),_0x569fb4[_0x95fb('0x4a')],util[_0x95fb('0x38')](_0x24b7ad,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x95fb('0x2e')][_0x95fb('0x1c')]=function(_0x320423){try{if(this['isNotNull'](_0x320423)){logger['debug'](_0x95fb('0x86'),_0x320423['uniqueid'],util[_0x95fb('0x38')](_0x320423,{'showHidden':![],'depth':null}));if(this[_0x95fb('0x39')][_0x320423[_0x95fb('0x4a')]]){var _0x331690=_[_0x95fb('0x7c')](this[_0x95fb('0x39')][_0x320423['uniqueid']]);_0x331690[_0x95fb('0x87')]=moment()[_0x95fb('0x45')](_0x95fb('0x74'));_0x331690[_0x95fb('0x88')]=_0x320423['connectedlinenum'];_0x331690[_0x95fb('0x89')]=_0x320423[_0x95fb('0x89')];logger[_0x95fb('0x66')](_0x95fb('0x8a'),_0x331690[_0x95fb('0x47')],_0x331690[_0x95fb('0x4f')],_0x320423[_0x95fb('0x88')],_0x320423[_0x95fb('0x89')]);this[_0x95fb('0x11')][_0x320423[_0x95fb('0x4a')]]=_0x331690;this[_0x95fb('0x42')](_0x331690,'queuecallerleave');}}}catch(_0xed7724){logger[_0x95fb('0x3a')](_0x95fb('0x86'),_0x320423[_0x95fb('0x4a')],util[_0x95fb('0x38')](_0xed7724,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x95fb('0x2e')]['syncAgentConnect']=function(_0x308005){try{if(this[_0x95fb('0x5e')](_0x308005)){logger[_0x95fb('0x5b')](_0x95fb('0x8b'),_0x308005[_0x95fb('0x4a')],util[_0x95fb('0x38')](_0x308005,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x308005['uniqueid']]){var _0x1aade6=_[_0x95fb('0x7c')](this[_0x95fb('0x39')][_0x308005[_0x95fb('0x4a')]]);_0x1aade6[_0x95fb('0x8c')]=!![];_0x1aade6[_0x95fb('0x4b')]=_0x95fb('0x8d');logger[_0x95fb('0x66')](_0x95fb('0x8e'),_0x1aade6[_0x95fb('0x47')],_0x1aade6[_0x95fb('0x4f')]);}}}catch(_0x318168){logger[_0x95fb('0x3a')]('[%s][voiceQueueReport][agentconnect]',_0x308005[_0x95fb('0x4a')],util[_0x95fb('0x38')](_0x318168,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x95fb('0x2e')][_0x95fb('0x8f')]=function(_0x278913){try{if(this[_0x95fb('0x5e')](_0x278913)){logger[_0x95fb('0x5b')]('[%s][voiceQueueReport][agentcomplete]',_0x278913[_0x95fb('0x4a')],util[_0x95fb('0x38')](_0x278913,{'showHidden':![],'depth':null}));if(this[_0x95fb('0x39')][_0x278913[_0x95fb('0x4a')]]){var _0x2eed9e=_['last'](this[_0x95fb('0x39')][_0x278913['uniqueid']]);_0x2eed9e['queuecallerabandon']=![];_0x2eed9e[_0x95fb('0x81')]=null;_0x2eed9e['assigned']=!![];_0x2eed9e[_0x95fb('0x83')]=_0x278913[_0x95fb('0x90')];_0x2eed9e[_0x95fb('0x7e')]=_0x278913['holdtime'];_0x2eed9e[_0x95fb('0x8c')]=!![];_0x2eed9e[_0x95fb('0x91')]=![];_0x2eed9e['queuecallerexitAt']=null;if(!_0x2eed9e['transfer']){if(_0x278913[_0x95fb('0x92')]=='transfer'){_0x2eed9e[_0x95fb('0x4b')]=_0x95fb('0x93');logger[_0x95fb('0x66')](_0x95fb('0x94'),_0x2eed9e[_0x95fb('0x47')],_0x2eed9e[_0x95fb('0x4f')]);}else{if(_['startsWith'](_0x278913[_0x95fb('0x95')][_0x95fb('0x96')](),_0x95fb('0x97'))){if(this[_0x95fb('0x39')][_0x278913['linkedid']]){var _0x23c280=_[_0x95fb('0x7c')](this[_0x95fb('0x39')][_0x278913['linkedid']]);_0x23c280[_0x95fb('0x8c')]=![];_0x23c280['queuecallerexit']=!![];_0x23c280[_0x95fb('0x98')]=moment(_0x2eed9e[_0x95fb('0x73')])[_0x95fb('0x99')](_0x278913[_0x95fb('0x7e')],_0x95fb('0x9a'))[_0x95fb('0x45')](_0x95fb('0x74'));_0x23c280[_0x95fb('0x4b')]=_0x95fb('0x9b');_0x23c280[_0x95fb('0x9c')]=!![];_0x23c280['transfertype']=_0x95fb('0x9d');_0x23c280['transferexten']=_0x278913[_0x95fb('0x9e')];_0x23c280[_0x95fb('0x9f')]=_0x278913[_0x95fb('0x4a')];logger['info'](_0x95fb('0xa0'),_0x23c280[_0x95fb('0x47')],_0x23c280[_0x95fb('0x4f')]);var _0x167551=this[_0x95fb('0x39')][_0x278913[_0x95fb('0xa1')]];this[_0x95fb('0x39')][_0x278913[_0x95fb('0xa1')]]=this['queueReports'][_0x278913[_0x95fb('0x4a')]];this[_0x95fb('0x39')][_0x278913['uniqueid']]=_0x167551;}}else{_0x2eed9e[_0x95fb('0x4b')]=_0x95fb('0xa2')+_0x278913[_0x95fb('0x92')]['toUpperCase']();logger['info'](_0x95fb('0xa3'),_0x2eed9e[_0x95fb('0x47')],_0x2eed9e['type'],_0x2eed9e[_0x95fb('0x4b')]);}}}this[_0x95fb('0x11')][_0x278913[_0x95fb('0x4a')]]=_0x2eed9e;this[_0x95fb('0x3f')](_0x2eed9e,'agentcomplete');}}}catch(_0x118d47){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x278913['uniqueid'],util[_0x95fb('0x38')](_0x118d47,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x95fb('0x2e')][_0x95fb('0xa4')]=function(_0x35126c){try{if(this['isNotNull'](_0x35126c)){logger['debug'](_0x95fb('0xa5'),_0x35126c[_0x95fb('0x4a')],util[_0x95fb('0x38')](_0x35126c,{'showHidden':![],'depth':null}));this[_0x95fb('0xa6')](_0x35126c[_0x95fb('0x4a')],_[_0x95fb('0x79')](_0x35126c[_0x95fb('0xa7')])[0x0],_0x35126c[_0x95fb('0xa8')]);if(this['queueReports'][_0x35126c['uniqueid']]){var _0x360f79=_[_0x95fb('0x7c')](this[_0x95fb('0x39')][_0x35126c['uniqueid']]);if(_0x360f79){if(this[_0x95fb('0x5e')](_0x35126c[_0x95fb('0xa7')])&&this['isNotNull'](_0x35126c[_0x95fb('0xa7')]['queuestatus'])){switch(_0x35126c[_0x95fb('0xa8')]){case'CONTINUE':_0x360f79['queuecallerexit']=![];_0x360f79[_0x95fb('0x98')]=null;break;case'TIMEOUT':_0x360f79[_0x95fb('0xa9')]='timeout';_0x360f79[_0x95fb('0x91')]=!![];_0x360f79['queuecallerexitAt']=moment()[_0x95fb('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x360f79[_0x95fb('0x87')]=moment()[_0x95fb('0x45')](_0x95fb('0x74'));logger[_0x95fb('0x5b')](_0x95fb('0xaa'),_0x35126c['uniqueid'],util[_0x95fb('0x38')](_0x360f79,{'showHidden':![],'depth':null}));ami[_0x95fb('0x41')]('custom:timeout',_0x360f79);break;default:_0x360f79[_0x95fb('0x91')]=!![];_0x360f79[_0x95fb('0x98')]=moment()[_0x95fb('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x360f79[_0x95fb('0x87')]=moment()[_0x95fb('0x45')](_0x95fb('0x74'));}_0x360f79[_0x95fb('0x80')]=![];_0x360f79['queuecallerabandonAt']=null;_0x360f79['queuecallerexitreason']=_0x35126c[_0x95fb('0xa8')];this[_0x95fb('0x11')][_0x35126c[_0x95fb('0x4a')]]=_0x360f79;this['emitVoiceQueueChannelRemove'](_0x360f79,_0x95fb('0x1f'));}else if(this[_0x95fb('0x5e')](_0x35126c['variable'])&&this[_0x95fb('0x5e')](_0x35126c['variable']['queueposition'])){if(!_0x360f79[_0x95fb('0x80')]){_0x360f79['queuecallerexit']=!![];_0x360f79['queuecallerexitAt']=moment()[_0x95fb('0x45')](_0x95fb('0x74'));_0x360f79[_0x95fb('0x4b')]=_0x95fb('0xab');_0x360f79[_0x95fb('0x87')]=moment()[_0x95fb('0x45')](_0x95fb('0x74'));this[_0x95fb('0x11')][_0x35126c['uniqueid']]=_0x360f79;}}logger[_0x95fb('0x66')](_0x95fb('0xac'),_0x35126c[_0x95fb('0x4a')],_0x360f79[_0x95fb('0x47')],_0x360f79[_0x95fb('0x4f')],_[_0x95fb('0x79')](_0x35126c['variable'])[0x0],_0x35126c[_0x95fb('0xa8')]);_0x360f79['variables']=this[_0x95fb('0x16')][_0x35126c[_0x95fb('0x4a')]];}}}}catch(_0x459a3){logger[_0x95fb('0x3a')](_0x95fb('0xa5'),_0x35126c[_0x95fb('0x4a')],util[_0x95fb('0x38')](_0x459a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x95fb('0x2e')][_0x95fb('0xa6')]=function(_0x39fe19,_0x3f47c6,_0x558033){var _0x267bba=[_0x95fb('0xad'),_0x95fb('0xae'),_0x95fb('0xaf'),_0x95fb('0xb0'),_0x95fb('0xb1'),_0x95fb('0xb2'),_0x95fb('0xb3'),_0x95fb('0xb4'),'sipcallid','sipuri',_0x95fb('0xb5'),_0x95fb('0xb6'),_0x95fb('0xb7'),_0x95fb('0xb8'),_0x95fb('0xb9'),'memberlastcall','membername',_0x95fb('0xba'),_0x95fb('0xbb')];if(!_[_0x95fb('0x31')](_0x3f47c6)&&!_['includes'](_0x267bba,_0x3f47c6)){if(_[_0x95fb('0x5f')](this[_0x95fb('0x16')][_0x39fe19])){this['variables'][_0x39fe19]={};}this[_0x95fb('0x16')][_0x39fe19][_0x3f47c6]=_0x558033;}};VoiceQueueReport[_0x95fb('0x2e')][_0x95fb('0xbc')]=function(_0x544d0c,_0x588914,_0x5c9993){var _0x50252a={};for(var _0x3eda87=0x0;_0x3eda87=0x0?moment(_0x3c7383[_0x2efb('0x19')])['diff'](_0x3c7383[_0x2efb('0x18')],'seconds'):null,'data1':_0x2efb('0x1b'),'data2':_0x3c7383[_0x2efb('0x12')],'data3':_0x3c7383[_0x2efb('0x1c')],'data4':_0x3c7383[_0x2efb('0x1d')]||null,'role':'agent','internal':_0x3c7383['accountcode']?_['toNumber'](_0x3c7383[_0x2efb('0x12')]):undefined,'uniqueid':_0x3c7383['uniqueid']},'log':_0x2efb('0x7')});}; \ No newline at end of file +var _0x4786=['voiceQueueReport','queuecallercompleteAt','Request','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','membername','starttime','endtime','seconds','outbound','dialstring','CreateMemberReport','moment','lodash','util','../client'];(function(_0x1db529,_0x4028db){var _0x52bc2e=function(_0x29cbef){while(--_0x29cbef){_0x1db529['push'](_0x1db529['shift']());}};_0x52bc2e(++_0x4028db);}(_0x4786,0x78));var _0x6478=function(_0x97667b,_0x8e8d16){_0x97667b=_0x97667b-0x0;var _0x5f4e9c=_0x4786[_0x97667b];return _0x5f4e9c;};'use strict';var moment=require(_0x6478('0x0'));var _=require(_0x6478('0x1'));var util=require(_0x6478('0x2'));var client=require(_0x6478('0x3'));exports[_0x6478('0x4')]=function(_0x458504){var _0x196717=_0x458504[_0x6478('0x5')]||_0x458504['queuecallerexitAt'];return client[_0x6478('0x6')]('CreateMemberReport',{'body':{'channel':_0x6478('0x7'),'membername':_0x458504[_0x6478('0x8')],'interface':_[_0x6478('0x9')](_0x458504[_0x6478('0xa')])?util[_0x6478('0xb')](_0x6478('0xc'),_0x458504[_0x6478('0x8')]):_0x458504['interface'],'type':_0x6478('0xd'),'enterAt':_0x458504[_0x6478('0xe')],'exitAt':_0x196717,'duration':moment(_0x196717)[_0x6478('0xf')](_0x458504[_0x6478('0xe')],'seconds'),'data1':_0x6478('0x10'),'data2':_0x458504[_0x6478('0x11')],'data3':_0x458504[_0x6478('0x12')],'data4':null,'data5':_0x458504[_0x6478('0x13')],'role':_0x6478('0x14'),'internal':_0x458504[_0x6478('0x15')]?_[_0x6478('0x16')](_0x458504[_0x6478('0x15')]):undefined,'uniqueid':_0x458504[_0x6478('0x17')]},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x3e6ca4){return client[_0x6478('0x6')]('CreateMemberReport',{'body':{'channel':_0x6478('0x7'),'membername':_0x3e6ca4[_0x6478('0x18')],'interface':_0x3e6ca4[_0x6478('0xa')],'type':'TALKING','enterAt':_0x3e6ca4[_0x6478('0x19')],'exitAt':_0x3e6ca4[_0x6478('0x1a')],'duration':moment(_0x3e6ca4[_0x6478('0x1a')])['diff'](_0x3e6ca4[_0x6478('0x19')],_0x6478('0x1b'))>=0x0?moment(_0x3e6ca4[_0x6478('0x1a')])['diff'](_0x3e6ca4[_0x6478('0x19')],_0x6478('0x1b')):null,'data1':_0x6478('0x1c'),'data2':_0x3e6ca4[_0x6478('0x15')],'data3':_0x3e6ca4[_0x6478('0x12')],'data4':_0x3e6ca4[_0x6478('0x1d')]||null,'role':_0x6478('0x14'),'internal':_0x3e6ca4[_0x6478('0x15')]?_[_0x6478('0x16')](_0x3e6ca4['accountcode']):undefined,'uniqueid':_0x3e6ca4['uniqueid']},'log':_0x6478('0x1e')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index e3abe62..22fcf3c 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 _0x3d45=['Request','ShowSetting','stopRecordingOnTransfer','GetSettings','../client','getSettings'];(function(_0x379090,_0x2f27dd){var _0x465d1b=function(_0x57bcd3){while(--_0x57bcd3){_0x379090['push'](_0x379090['shift']());}};_0x465d1b(++_0x2f27dd);}(_0x3d45,0x1d2));var _0x53d4=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x3d45[_0x110c3d];return _0x226d67;};'use strict';var client=require(_0x53d4('0x0'));exports[_0x53d4('0x1')]=function(){return client[_0x53d4('0x2')](_0x53d4('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x53d4('0x4'),'previewRecallmeReminderInterval']},'log':_0x53d4('0x5')});}; \ No newline at end of file +var _0x4fc2=['ShowSetting','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request'];(function(_0x4959fd,_0x186515){var _0x97de01=function(_0x29e1d0){while(--_0x29e1d0){_0x4959fd['push'](_0x4959fd['shift']());}};_0x97de01(++_0x186515);}(_0x4fc2,0x111));var _0x24fc=function(_0x21bf22,_0x16172a){_0x21bf22=_0x21bf22-0x0;var _0x144ee9=_0x4fc2[_0x21bf22];return _0x144ee9;};'use strict';var client=require(_0x24fc('0x0'));exports[_0x24fc('0x1')]=function(){return client[_0x24fc('0x2')](_0x24fc('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x24fc('0x4')]},'log':_0x24fc('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 6fd5870..9d4331d 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 _0x830c=['html','../client','getTemplates','Request','GetTemplate','name'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x830c,0xf7));var _0xc830=function(_0x534412,_0x25125e){_0x534412=_0x534412-0x0;var _0x5bc2d5=_0x830c[_0x534412];return _0x5bc2d5;};'use strict';var client=require(_0xc830('0x0'));exports[_0xc830('0x1')]=function(_0x26b520){return function(_0xe81911){return client[_0xc830('0x2')](_0xc830('0x3'),{'options':{'raw':!![],'attributes':['id',_0xc830('0x4'),_0xc830('0x5')]},'log':_0xc830('0x3')});};}; \ No newline at end of file +var _0x1fda=['html','../client','getTemplates','Request','name'];(function(_0xfbc3dc,_0x3a7830){var _0x48c818=function(_0x5e3a9b){while(--_0x5e3a9b){_0xfbc3dc['push'](_0xfbc3dc['shift']());}};_0x48c818(++_0x3a7830);}(_0x1fda,0x74));var _0xa1fd=function(_0x300c19,_0x709d87){_0x300c19=_0x300c19-0x0;var _0x52ccab=_0x1fda[_0x300c19];return _0x52ccab;};'use strict';var client=require(_0xa1fd('0x0'));exports[_0xa1fd('0x1')]=function(_0x577d07){return function(_0x52c188){return client[_0xa1fd('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xa1fd('0x3'),_0xa1fd('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 7ca0842..9a63fb5 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 _0x1462=['Condition','AllConditions','field','operator','AnyConditions','value','Actions','action','data1','data2','data3','data5','getTriggers','Request','GetTrigger','name','channel','status'];(function(_0x3a8b9b,_0x4b1728){var _0x1a3bba=function(_0x37a74e){while(--_0x37a74e){_0x3a8b9b['push'](_0x3a8b9b['shift']());}};_0x1a3bba(++_0x4b1728);}(_0x1462,0xc0));var _0x2146=function(_0x15682b,_0x315ac1){_0x15682b=_0x15682b-0x0;var _0x5188b0=_0x1462[_0x15682b];return _0x5188b0;};'use strict';var client=require('../client');exports[_0x2146('0x0')]=function(_0xcc041c){return function(_0xe84429){return client[_0x2146('0x1')](_0x2146('0x2'),{'options':{'raw':![],'attributes':['id',_0x2146('0x3'),_0x2146('0x4'),_0x2146('0x5')],'include':[{'model':_0x2146('0x6'),'as':_0x2146('0x7'),'attributes':['id',_0x2146('0x8'),_0x2146('0x9'),'value']},{'model':_0x2146('0x6'),'as':_0x2146('0xa'),'attributes':['id',_0x2146('0x8'),_0x2146('0x9'),_0x2146('0xb')]},{'model':'Action','as':_0x2146('0xc'),'attributes':['id',_0x2146('0xd'),_0x2146('0xe'),_0x2146('0xf'),_0x2146('0x10'),'data4',_0x2146('0x11'),'data6','data7']}]},'log':_0x2146('0x2')});};}; \ No newline at end of file +var _0x715a=['GetTrigger','name','status','Condition','AllConditions','operator','value','action','data1','data2','data3','data4','data6','data7','../client','getTriggers'];(function(_0x2c4a45,_0x8836e3){var _0x51c36e=function(_0x396db8){while(--_0x396db8){_0x2c4a45['push'](_0x2c4a45['shift']());}};_0x51c36e(++_0x8836e3);}(_0x715a,0x10e));var _0xa715=function(_0x2ee42d,_0x246391){_0x2ee42d=_0x2ee42d-0x0;var _0x387b81=_0x715a[_0x2ee42d];return _0x387b81;};'use strict';var client=require(_0xa715('0x0'));exports[_0xa715('0x1')]=function(_0x5c5c37){return function(_0x26a6ec){return client['Request'](_0xa715('0x2'),{'options':{'raw':![],'attributes':['id',_0xa715('0x3'),'channel',_0xa715('0x4')],'include':[{'model':_0xa715('0x5'),'as':_0xa715('0x6'),'attributes':['id','field',_0xa715('0x7'),_0xa715('0x8')]},{'model':_0xa715('0x5'),'as':'AnyConditions','attributes':['id','field',_0xa715('0x7'),'value']},{'model':'Action','as':'Actions','attributes':['id',_0xa715('0x9'),_0xa715('0xa'),_0xa715('0xb'),_0xa715('0xc'),_0xa715('0xd'),'data5',_0xa715('0xe'),_0xa715('0xf')]}]},'log':_0xa715('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index f2d76de..805e1f2 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 _0x1666=['Request','GetTrunk','name','registry','defaultuser','../client','getTrunks'];(function(_0x2ee65e,_0x1f97fc){var _0x5975d6=function(_0x691d6e){while(--_0x691d6e){_0x2ee65e['push'](_0x2ee65e['shift']());}};_0x5975d6(++_0x1f97fc);}(_0x1666,0x75));var _0x6166=function(_0xd8efd7,_0x2e064f){_0xd8efd7=_0xd8efd7-0x0;var _0x167526=_0x1666[_0xd8efd7];return _0x167526;};'use strict';var client=require(_0x6166('0x0'));exports[_0x6166('0x1')]=function(_0x4f60ad){return function(_0x18af67){return client[_0x6166('0x2')](_0x6166('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x6166('0x4'),_0x6166('0x5'),_0x6166('0x6')]},'log':_0x6166('0x3')});};}; \ No newline at end of file +var _0x8aa5=['defaultuser','../client','getTrunks','Request','GetTrunk','name','registry'];(function(_0x330124,_0x562fe9){var _0x508c61=function(_0x123995){while(--_0x123995){_0x330124['push'](_0x330124['shift']());}};_0x508c61(++_0x562fe9);}(_0x8aa5,0x78));var _0x58aa=function(_0x9bc461,_0x4cb366){_0x9bc461=_0x9bc461-0x0;var _0x395da3=_0x8aa5[_0x9bc461];return _0x395da3;};'use strict';var client=require(_0x58aa('0x0'));exports[_0x58aa('0x1')]=function(_0x69308c){return function(_0x2e7011){return client[_0x58aa('0x2')](_0x58aa('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x58aa('0x4'),_0x58aa('0x5'),_0x58aa('0x6')]},'log':_0x58aa('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 534ef54..c704bb8 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 _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x72300f,_0x88f9f1){var _0x501d14=function(_0x465444){while(--_0x465444){_0x72300f['push'](_0x72300f['shift']());}};_0x501d14(++_0x88f9f1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0xcb91[_0x48ec91];return _0x22766c;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x4e99ce,_0x52078e){var _0x411bc0=function(_0x1bdfa8){while(--_0x1bdfa8){_0x4e99ce['push'](_0x4e99ce['shift']());}};_0x411bc0(++_0x52078e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4f3c9b,_0x28e078){_0x4f3c9b=_0x4f3c9b-0x0;var _0x84e58a=_0xcb91[_0x4f3c9b];return _0x84e58a;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 9da319d..0484c2e 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 _0x75c8=['Request','update','UpdateVoiceAgentReport','../client','create'];(function(_0x17aa7a,_0x2be8e4){var _0x2321f8=function(_0x2324fc){while(--_0x2324fc){_0x17aa7a['push'](_0x17aa7a['shift']());}};_0x2321f8(++_0x2be8e4);}(_0x75c8,0x1c5));var _0x875c=function(_0x3e28d8,_0x15dc27){_0x3e28d8=_0x3e28d8-0x0;var _0x40d50d=_0x75c8[_0x3e28d8];return _0x40d50d;};'use strict';var client=require(_0x875c('0x0'));exports[_0x875c('0x1')]=function(_0x2e9b07){return client[_0x875c('0x2')]('CreateVoiceAgentReport',{'body':_0x2e9b07,'log':'CreateVoiceAgentReport'});};exports[_0x875c('0x3')]=function(_0x411fee,_0x1fb87,_0x2f35f5){return client[_0x875c('0x2')](_0x875c('0x4'),{'body':_0x411fee,'options':{'where':{'uniqueid':_0x1fb87,'interface':_0x2f35f5,'agentcomplete':!![]}},'log':_0x875c('0x4')});}; \ No newline at end of file +var _0x0270=['create','Request','CreateVoiceAgentReport','../client'];(function(_0x14b8c2,_0x3dbf43){var _0x16eec4=function(_0x343dd2){while(--_0x343dd2){_0x14b8c2['push'](_0x14b8c2['shift']());}};_0x16eec4(++_0x3dbf43);}(_0x0270,0x8f));var _0x0027=function(_0x33ff73,_0x54c687){_0x33ff73=_0x33ff73-0x0;var _0x15f8af=_0x0270[_0x33ff73];return _0x15f8af;};'use strict';var client=require(_0x0027('0x0'));exports[_0x0027('0x1')]=function(_0x3f956a){return client[_0x0027('0x2')](_0x0027('0x3'),{'body':_0x3f956a,'log':_0x0027('0x3')});};exports['update']=function(_0x58afff,_0x31ddbb,_0x2c0955){return client[_0x0027('0x2')]('UpdateVoiceAgentReport',{'body':_0x58afff,'options':{'where':{'uniqueid':_0x31ddbb,'interface':_0x2c0955,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 93fcefc..81888e6 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 _0xcd25=['day','format','endOf','type','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound'];(function(_0x391a42,_0x34f07f){var _0x268d09=function(_0x1ae080){while(--_0x1ae080){_0x391a42['push'](_0x391a42['shift']());}};_0x268d09(++_0x34f07f);}(_0xcd25,0x133));var _0x5cd2=function(_0x3488f2,_0x445819){_0x3488f2=_0x3488f2-0x0;var _0x307105=_0xcd25[_0x3488f2];return _0x307105;};'use strict';var moment=require(_0x5cd2('0x0'));var util=require(_0x5cd2('0x1'));var _=require(_0x5cd2('0x2'));var client=require(_0x5cd2('0x3'));exports[_0x5cd2('0x4')]=function(_0x8892da){return client[_0x5cd2('0x5')](_0x5cd2('0x6'),{'body':_[_0x5cd2('0x7')](_0x8892da,{'source':_0x8892da['calleridnum'],'destinationcontext':_0x8892da[_0x5cd2('0x8')],'callerid':_0x8892da[_0x5cd2('0x9')],'amaflags':_0x5cd2('0xa')}),'log':_0x5cd2('0x6')});};exports[_0x5cd2('0xb')]=function(){return function(){return client[_0x5cd2('0x5')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x5cd2('0xc')],'createdAt':{'$between':[moment()['startOf'](_0x5cd2('0xd'))[_0x5cd2('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x5cd2('0xf')](_0x5cd2('0xd'))[_0x5cd2('0xe')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x5cd2('0x10'),'disposition',_0x5cd2('0x11'),_0x5cd2('0x12')]},'log':_0x5cd2('0x13')});};}; \ No newline at end of file +var _0x03b3=['billableseconds','moment','util','lodash','create','Request','CreateVoiceCallReport','merge','context','callerid','getVoiceCallReports','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','disposition','duration'];(function(_0x34dfb9,_0x4d1e01){var _0x3d879d=function(_0x1589f5){while(--_0x1589f5){_0x34dfb9['push'](_0x34dfb9['shift']());}};_0x3d879d(++_0x4d1e01);}(_0x03b3,0x133));var _0x303b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03b3[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x303b('0x0'));var util=require(_0x303b('0x1'));var _=require(_0x303b('0x2'));var client=require('../client');exports[_0x303b('0x3')]=function(_0x481168){return client[_0x303b('0x4')](_0x303b('0x5'),{'body':_[_0x303b('0x6')](_0x481168,{'source':_0x481168['calleridnum'],'destinationcontext':_0x481168[_0x303b('0x7')],'callerid':_0x481168[_0x303b('0x8')],'amaflags':'DOCUMENTATION'}),'log':_0x303b('0x5')});};exports[_0x303b('0x9')]=function(){return function(){return client[_0x303b('0x4')](_0x303b('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x303b('0xb')](_0x303b('0xc'))[_0x303b('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x303b('0xc'))[_0x303b('0xd')](_0x303b('0xe'))]}},'attributes':['type',_0x303b('0xf'),_0x303b('0x10'),_0x303b('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index be4de43..941270e 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 _0x3c9a=['CreateVoiceDialReport','Request'];(function(_0xc955bb,_0x3fd222){var _0x3c296f=function(_0x4f6372){while(--_0x4f6372){_0xc955bb['push'](_0xc955bb['shift']());}};_0x3c296f(++_0x3fd222);}(_0x3c9a,0x1cb));var _0xa3c9=function(_0x5e8917,_0x3a1df5){_0x5e8917=_0x5e8917-0x0;var _0x20374a=_0x3c9a[_0x5e8917];return _0x20374a;};'use strict';var client=require('../client');exports['create']=function(_0x60fe79){return client[_0xa3c9('0x0')](_0xa3c9('0x1'),{'body':_0x60fe79,'log':_0xa3c9('0x1')});}; \ No newline at end of file +var _0x788f=['CreateVoiceDialReport','Request'];(function(_0x9d77b5,_0x4fcdb3){var _0x4b26d0=function(_0xcb79d4){while(--_0xcb79d4){_0x9d77b5['push'](_0x9d77b5['shift']());}};_0x4b26d0(++_0x4fcdb3);}(_0x788f,0x173));var _0xf788=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x788f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['create']=function(_0x24c006){return client[_0xf788('0x0')](_0xf788('0x1'),{'body':_0x24c006,'log':_0xf788('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 2411038..a6a1674 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 _0xa699=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xa699,0x6b));var _0x9a69=function(_0x3598bb,_0x24befa){_0x3598bb=_0x3598bb-0x0;var _0x13c837=_0xa699[_0x3598bb];return _0x13c837;};'use strict';var client=require(_0x9a69('0x0'));exports[_0x9a69('0x1')]=function(){return function(){return client[_0x9a69('0x2')](_0x9a69('0x3'),{'options':{'raw':!![],'attributes':['id',_0x9a69('0x4'),_0x9a69('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x9a69('0x1')});};}; \ No newline at end of file +var _0x3276=['GetVoiceExtension','exten','recordingFormat','getVoiceExtensions','../client'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x3276,0xc7));var _0x6327=function(_0x122ac2,_0x2b5433){_0x122ac2=_0x122ac2-0x0;var _0x39e26f=_0x3276[_0x122ac2];return _0x39e26f;};'use strict';var client=require(_0x6327('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x6327('0x1'),{'options':{'raw':!![],'attributes':['id',_0x6327('0x2'),_0x6327('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x6327('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 615a0ee..2acc002 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 _0xe79d=['dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','name','acw','monitor_format','type','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt'];(function(_0x8686c9,_0x305a8f){var _0x1dc90c=function(_0x4f9da1){while(--_0x4f9da1){_0x8686c9['push'](_0x8686c9['shift']());}};_0x1dc90c(++_0x305a8f);}(_0xe79d,0x90));var _0xde79=function(_0x3352d4,_0xe5cf04){_0x3352d4=_0x3352d4-0x0;var _0x1931db=_0xe79d[_0x3352d4];return _0x1931db;};'use strict';var client=require(_0xde79('0x0'));exports[_0xde79('0x1')]=function(){return function(){return client[_0xde79('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xde79('0x3'),_0xde79('0x4'),'acwTimeout','autopause',_0xde79('0x5'),_0xde79('0x6'),'dialActive',_0xde79('0x7'),'dialLimitChannel',_0xde79('0x8'),_0xde79('0x9'),'dialPredictiveOptimization',_0xde79('0xa'),_0xde79('0xb'),_0xde79('0xc'),'dialOriginateCallerIdNumber',_0xde79('0xd'),'dialQueueOptions',_0xde79('0xe'),'dialQueueProject',_0xde79('0xf'),_0xde79('0x10'),_0xde79('0x11'),_0xde79('0x12'),_0xde79('0x13'),'dialNoAnswerRetryFrequency',_0xde79('0x14'),'dialTimezone',_0xde79('0x15'),_0xde79('0x16'),'dialCheckDuplicateType',_0xde79('0x17'),_0xde79('0x18'),_0xde79('0x19'),_0xde79('0x1a'),_0xde79('0x1b'),_0xde79('0x1c'),_0xde79('0x1d'),_0xde79('0x1e'),'dialAMDSilenceThreshold',_0xde79('0x1f'),_0xde79('0x20'),_0xde79('0x21'),_0xde79('0x22'),_0xde79('0x23'),'dialAgiAfterHangupAgent',_0xde79('0x24'),_0xde79('0x25'),_0xde79('0x5'),_0xde79('0x26'),'dialRandomLastDigitCallerIdNumber',_0xde79('0x27'),_0xde79('0x28'),_0xde79('0x29'),_0xde79('0x2a'),_0xde79('0x2b'),_0xde79('0x2c'),'dialAbandonedRetryFrequency',_0xde79('0x2d'),_0xde79('0x2e'),_0xde79('0x2f'),_0xde79('0x30'),_0xde79('0x31'),_0xde79('0x32'),_0xde79('0x33'),'dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin'],'include':[{'model':'Trunk','as':_0xde79('0x34'),'attributes':['id',_0xde79('0x3'),_0xde79('0x35'),_0xde79('0x36')]},{'model':'Pause','as':_0xde79('0x37'),'attributes':['id',_0xde79('0x3')]},{'model':_0xde79('0x34'),'as':_0xde79('0x38'),'attributes':['id',_0xde79('0x3'),_0xde79('0x35'),_0xde79('0x36')]},{'model':_0xde79('0x39'),'as':_0xde79('0x39'),'attributes':['id',_0xde79('0x3')],'include':[{'model':_0xde79('0x39'),'as':_0xde79('0x3a'),'attributes':['id',_0xde79('0x3'),_0xde79('0x3b')]}]}]},'log':_0xde79('0x1')});};}; \ No newline at end of file +var _0x5ddd=['dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','timeout','dialRecallInQueue','dialAgiAfterHangupClient','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','callerid','active','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','monitor_format','type','dialLimitChannel','dialLimitQueue','dialPowerLevel'];(function(_0x53f463,_0x25e271){var _0x4f4cdd=function(_0x33254c){while(--_0x33254c){_0x53f463['push'](_0x53f463['shift']());}};_0x4f4cdd(++_0x25e271);}(_0x5ddd,0x1a6));var _0xd5dd=function(_0x875110,_0x7873af){_0x875110=_0x875110-0x0;var _0x39758a=_0x5ddd[_0x875110];return _0x39758a;};'use strict';var client=require(_0xd5dd('0x0'));exports[_0xd5dd('0x1')]=function(){return function(){return client[_0xd5dd('0x2')](_0xd5dd('0x3'),{'options':{'raw':![],'attributes':['id',_0xd5dd('0x4'),_0xd5dd('0x5'),'acwTimeout',_0xd5dd('0x6'),_0xd5dd('0x7'),_0xd5dd('0x8'),'dialActive','dialMethod',_0xd5dd('0x9'),_0xd5dd('0xa'),_0xd5dd('0xb'),'dialPredictiveOptimization',_0xd5dd('0xc'),_0xd5dd('0xd'),_0xd5dd('0xe'),_0xd5dd('0xf'),_0xd5dd('0x10'),_0xd5dd('0x11'),_0xd5dd('0x12'),_0xd5dd('0x13'),_0xd5dd('0x14'),_0xd5dd('0x15'),_0xd5dd('0x16'),_0xd5dd('0x17'),_0xd5dd('0x18'),_0xd5dd('0x19'),_0xd5dd('0x1a'),_0xd5dd('0x1b'),'dialGlobalInterval',_0xd5dd('0x1c'),_0xd5dd('0x1d'),_0xd5dd('0x1e'),_0xd5dd('0x1f'),_0xd5dd('0x20'),_0xd5dd('0x21'),_0xd5dd('0x22'),_0xd5dd('0x23'),_0xd5dd('0x24'),'dialAMDMaximumNumberOfWords',_0xd5dd('0x25'),'dialAMDMaximumWordLength',_0xd5dd('0x26'),'dialRecallMeTimeout',_0xd5dd('0x27'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent',_0xd5dd('0x28'),'dialQueueProject2',_0xd5dd('0x7'),_0xd5dd('0x29'),'dialRandomLastDigitCallerIdNumber',_0xd5dd('0x2a'),_0xd5dd('0x2b'),_0xd5dd('0x2c'),_0xd5dd('0x2d'),_0xd5dd('0x2e'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency',_0xd5dd('0x2f'),_0xd5dd('0x30'),_0xd5dd('0x31'),_0xd5dd('0x32'),_0xd5dd('0x33'),_0xd5dd('0x34'),'dialPredictiveIntervalMinThreshold',_0xd5dd('0x35'),_0xd5dd('0x36'),_0xd5dd('0x37')],'include':[{'model':'Trunk','as':_0xd5dd('0x38'),'attributes':['id',_0xd5dd('0x4'),_0xd5dd('0x39'),_0xd5dd('0x3a')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id','name']},{'model':'Trunk','as':_0xd5dd('0x3b'),'attributes':['id',_0xd5dd('0x4'),_0xd5dd('0x39'),_0xd5dd('0x3a')]},{'model':'Interval','as':'Interval','attributes':['id',_0xd5dd('0x4')],'include':[{'model':_0xd5dd('0x3c'),'as':_0xd5dd('0x3d'),'attributes':['id',_0xd5dd('0x4'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 3dc0ea3..96ecf20 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(_0x3f8961,_0x44acc2){var _0x3b3d5c=function(_0x93cde6){while(--_0x93cde6){_0x3f8961['push'](_0x3f8961['shift']());}};_0x3b3d5c(++_0x44acc2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x426266,_0x276154){var _0x5b1936=function(_0x5dc220){while(--_0x5dc220){_0x426266['push'](_0x426266['shift']());}};_0x5b1936(++_0x276154);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 ed31fca..53b180b 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 _0x55b9=['../client','Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x788c48,_0x5c0e5e){var _0x299c14=function(_0x6be4c){while(--_0x6be4c){_0x788c48['push'](_0x788c48['shift']());}};_0x299c14(++_0x5c0e5e);}(_0x55b9,0x8c));var _0x955b=function(_0x5b1de0,_0x5af2b2){_0x5b1de0=_0x5b1de0-0x0;var _0x698a86=_0x55b9[_0x5b1de0];return _0x698a86;};'use strict';var client=require(_0x955b('0x0'));exports['getVoiceQueueRtPauses']=function(_0x3e191e){return function(){return client[_0x955b('0x1')](_0x955b('0x2'),{'options':{'where':{'VoiceQueueId':_0x3e191e,'paused':!![]},'raw':!![]},'log':_0x955b('0x3')});};}; \ No newline at end of file +var _0xeade=['../client','Request','GetVoiceQueueRtPauses'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xeade,0x198));var _0xeead=function(_0x39f6c5,_0x8e0f4b){_0x39f6c5=_0x39f6c5-0x0;var _0x53a535=_0xeade[_0x39f6c5];return _0x53a535;};'use strict';var client=require(_0xeead('0x0'));exports['getVoiceQueueRtPauses']=function(_0x158216){return function(){return client[_0xeead('0x1')](_0xeead('0x2'),{'options':{'where':{'VoiceQueueId':_0x158216,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index de7c5fa..1c645c8 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(_0x155f92,_0x56666f){var _0xb810b8=function(_0x4dbd79){while(--_0x4dbd79){_0x155f92['push'](_0x155f92['shift']());}};_0xb810b8(++_0x56666f);}(_0x7a54,0x106));var _0x47a5=function(_0x57fedd,_0x2c0bcb){_0x57fedd=_0x57fedd-0x0;var _0x155dbd=_0x7a54[_0x57fedd];return _0x155dbd;};'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 _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x1d99ea,_0x137357){var _0x4d8f56=function(_0x4fbc09){while(--_0x4fbc09){_0x1d99ea['push'](_0x1d99ea['shift']());}};_0x4d8f56(++_0x137357);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index d42b703..54e69b9 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 _0x2c89=['transfereeexten','isexternal','context','blind','result','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','transfers','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeaccountcode','transfereecontext'];(function(_0xaa3653,_0x1d9f02){var _0x146ef2=function(_0x21b7b1){while(--_0x21b7b1){_0xaa3653['push'](_0xaa3653['shift']());}};_0x146ef2(++_0x1d9f02);}(_0x2c89,0x17d));var _0x92c8=function(_0x9c161f,_0x3fe043){_0x9c161f=_0x9c161f-0x0;var _0x163fd8=_0x2c89[_0x9c161f];return _0x163fd8;};'use strict';var client=require('../client');exports[_0x92c8('0x0')]={};exports['blindTransfer']=function(_0x1fe546){return client[_0x92c8('0x1')](_0x92c8('0x2'),{'body':{'result':_0x1fe546['result'],'transfererchannel':_0x1fe546[_0x92c8('0x3')],'transferercalleridnum':_0x1fe546[_0x92c8('0x4')],'transferercalleridname':_0x1fe546[_0x92c8('0x5')],'transfererconnectedlinenum':_0x1fe546[_0x92c8('0x6')],'transfererconnectedlinename':_0x1fe546[_0x92c8('0x7')],'transfereraccountcode':_0x1fe546['transfereraccountcode'],'transferercontext':_0x1fe546[_0x92c8('0x8')],'transfererexten':_0x1fe546['transfererexten'],'transfererlinkedid':_0x1fe546[_0x92c8('0x9')],'transfereechannel':_0x1fe546[_0x92c8('0xa')],'transfereecalleridnum':_0x1fe546[_0x92c8('0xb')],'transfereecalleridname':_0x1fe546[_0x92c8('0xc')],'transfereeconnectedlinenum':_0x1fe546['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x1fe546['transfereeconnectedlinename'],'transfereeaccountcode':_0x1fe546[_0x92c8('0xd')],'transfereecontext':_0x1fe546[_0x92c8('0xe')],'transfereeexten':_0x1fe546[_0x92c8('0xf')],'transfereelinkedid':_0x1fe546['transfereelinkedid'],'isexternal':_0x1fe546[_0x92c8('0x10')],'context':_0x1fe546[_0x92c8('0x11')],'extension':_0x1fe546['extension'],'type':_0x92c8('0x12')},'log':_0x92c8('0x2')});};exports['attendedTransfer']=function(_0x7476c1){return client[_0x92c8('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x7476c1[_0x92c8('0x13')],'transfererchannel':_0x7476c1[_0x92c8('0x14')],'transferercalleridnum':_0x7476c1['origtransferercalleridnum'],'transferercalleridname':_0x7476c1[_0x92c8('0x15')],'transfererconnectedlinenum':_0x7476c1['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x7476c1[_0x92c8('0x16')],'transfereraccountcode':_0x7476c1[_0x92c8('0x17')],'transferercontext':_0x7476c1['secondtransferercontext'],'transfererexten':_0x7476c1[_0x92c8('0x18')],'transfererlinkedid':_0x7476c1[_0x92c8('0x19')],'transfereechannel':_0x7476c1['transfertargetchannel'],'transfereecalleridnum':_0x7476c1[_0x92c8('0x1a')],'transfereecalleridname':_0x7476c1['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x7476c1['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x7476c1[_0x92c8('0x1b')],'transfereeaccountcode':_0x7476c1['transfertargetaccountcode'],'transfereecontext':_0x7476c1['transfertargetcontext'],'transfereeexten':_0x7476c1[_0x92c8('0x1c')],'transfereelinkedid':_0x7476c1[_0x92c8('0x1d')],'isexternal':_0x7476c1[_0x92c8('0x10')],'context':_0x7476c1[_0x92c8('0x1e')],'extension':_0x7476c1[_0x92c8('0x1f')],'type':_0x92c8('0x20')},'log':_0x92c8('0x2')});}; \ No newline at end of file +var _0xee5f=['attended','transfers','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereecontext','transfereeexten','isexternal','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten'];(function(_0x21c7b1,_0x3aab42){var _0x396db6=function(_0x14e351){while(--_0x14e351){_0x21c7b1['push'](_0x21c7b1['shift']());}};_0x396db6(++_0x3aab42);}(_0xee5f,0x121));var _0xfee5=function(_0x4e8c94,_0x27dbad){_0x4e8c94=_0x4e8c94-0x0;var _0x366caa=_0xee5f[_0x4e8c94];return _0x366caa;};'use strict';var client=require('../client');exports[_0xfee5('0x0')]={};exports['blindTransfer']=function(_0x34f4ed){return client[_0xfee5('0x1')](_0xfee5('0x2'),{'body':{'result':_0x34f4ed[_0xfee5('0x3')],'transfererchannel':_0x34f4ed[_0xfee5('0x4')],'transferercalleridnum':_0x34f4ed['transferercalleridnum'],'transferercalleridname':_0x34f4ed[_0xfee5('0x5')],'transfererconnectedlinenum':_0x34f4ed[_0xfee5('0x6')],'transfererconnectedlinename':_0x34f4ed[_0xfee5('0x7')],'transfereraccountcode':_0x34f4ed[_0xfee5('0x8')],'transferercontext':_0x34f4ed[_0xfee5('0x9')],'transfererexten':_0x34f4ed[_0xfee5('0xa')],'transfererlinkedid':_0x34f4ed[_0xfee5('0xb')],'transfereechannel':_0x34f4ed[_0xfee5('0xc')],'transfereecalleridnum':_0x34f4ed[_0xfee5('0xd')],'transfereecalleridname':_0x34f4ed['transfereecalleridname'],'transfereeconnectedlinenum':_0x34f4ed[_0xfee5('0xe')],'transfereeconnectedlinename':_0x34f4ed['transfereeconnectedlinename'],'transfereeaccountcode':_0x34f4ed['transfereeaccountcode'],'transfereecontext':_0x34f4ed[_0xfee5('0xf')],'transfereeexten':_0x34f4ed[_0xfee5('0x10')],'transfereelinkedid':_0x34f4ed['transfereelinkedid'],'isexternal':_0x34f4ed[_0xfee5('0x11')],'context':_0x34f4ed['context'],'extension':_0x34f4ed['extension'],'type':'blind'},'log':_0xfee5('0x2')});};exports['attendedTransfer']=function(_0xa9a28){return client[_0xfee5('0x1')](_0xfee5('0x2'),{'body':{'result':_0xa9a28[_0xfee5('0x3')],'transfererchannel':_0xa9a28[_0xfee5('0x12')],'transferercalleridnum':_0xa9a28[_0xfee5('0x13')],'transferercalleridname':_0xa9a28[_0xfee5('0x14')],'transfererconnectedlinenum':_0xa9a28[_0xfee5('0x15')],'transfererconnectedlinename':_0xa9a28[_0xfee5('0x16')],'transfereraccountcode':_0xa9a28[_0xfee5('0x17')],'transferercontext':_0xa9a28['secondtransferercontext'],'transfererexten':_0xa9a28[_0xfee5('0x18')],'transfererlinkedid':_0xa9a28['origtransfererlinkedid'],'transfereechannel':_0xa9a28[_0xfee5('0x19')],'transfereecalleridnum':_0xa9a28[_0xfee5('0x1a')],'transfereecalleridname':_0xa9a28[_0xfee5('0x1b')],'transfereeconnectedlinenum':_0xa9a28[_0xfee5('0x1c')],'transfereeconnectedlinename':_0xa9a28[_0xfee5('0x1d')],'transfereeaccountcode':_0xa9a28['transfertargetaccountcode'],'transfereecontext':_0xa9a28[_0xfee5('0x1e')],'transfereeexten':_0xa9a28[_0xfee5('0x1f')],'transfereelinkedid':_0xa9a28[_0xfee5('0x20')],'isexternal':_0xa9a28[_0xfee5('0x11')],'context':_0xa9a28[_0xfee5('0x21')],'extension':_0xa9a28[_0xfee5('0x22')],'type':_0xfee5('0x23')},'log':_0xfee5('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index dbd3a3b..8a87844 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 _0xab40=['outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','omit','undefined','channels','voicechannel','validate','map','find','channel','%s.%s','format','wav','ai(mixmonitorid)','monitors','toLowerCase','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','uniqueid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','filename','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','values','telephones','trunks','outbound','campaigns','run','event','emit','custom:','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','../../../config/environment','../properties','../ami','listen','name','timers','timer','updateAcw','agents','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','command','Command','catch','voiceQueues','available','pTalking','sumBillable','total','type','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay'];(function(_0x426192,_0x47cf62){var _0x38f134=function(_0x1eb0fc){while(--_0x1eb0fc){_0x426192['push'](_0x426192['shift']());}};_0x38f134(++_0x47cf62);}(_0xab40,0xcd));var _0x0ab4=function(_0x64ad1c,_0x31f3c5){_0x64ad1c=_0x64ad1c-0x0;var _0x5ee769=_0xab40[_0x64ad1c];return _0x5ee769;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var jayson=require('jayson/promise');var schema=require('validate');var moment=require('moment');var config=require(_0x0ab4('0x2'));var properties=require(_0x0ab4('0x3'));var ami=require(_0x0ab4('0x4'));exports[_0x0ab4('0x5')]=function(_0x14634a,_0x57fac1,_0x5f01aa){return new Promise(function(_0x28b17a,_0x4ba9d2){var _0x10d92b={'QueuePause':function(_0x46d16a){return new Promise(function(_0x11e99f){var _0x6d135d=util['format']('%s/%s','SIP',_0x46d16a[_0x0ab4('0x6')]);if(_0x14634a[_0x0ab4('0x7')]&&_0x14634a[_0x0ab4('0x7')][_0x6d135d]&&_0x14634a[_0x0ab4('0x7')][_0x6d135d][_0x0ab4('0x8')]){_0x14634a[_0x0ab4('0x7')][_0x6d135d][_0x0ab4('0x9')]();}if(_0x14634a[_0x0ab4('0xa')][_0x6d135d]){_0x14634a['agents'][_0x6d135d]['updateStatusRealtime']({'statePause':_0x46d16a[_0x0ab4('0xb')]?!![]:![]});}_0x11e99f({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x249dc3){var _0x45e6fd=this;return new Promise(function(_0x1e7555,_0x1e2b56){if(ami[_0x0ab4('0xc')]()==![]){return _0x1e2b56(_0x45e6fd[_0x0ab4('0xd')](0x1f4,[config[_0x0ab4('0xe')]['ip'],config[_0x0ab4('0xe')][_0x0ab4('0xf')],_0x0ab4('0x10')][_0x0ab4('0x11')]('\x20')));}_0x249dc3=_[_0x0ab4('0x12')](_0x249dc3,_[_0x0ab4('0x13')](properties[_0x0ab4('0x14')]));_0x249dc3[_0x0ab4('0x15')]=_0x0ab4('0x16');return ami[_0x0ab4('0x17')](_0x249dc3)[_0x0ab4('0x18')](function(_0x4f37b6){_0x1e7555({'code':0xc8,'message':_0x4f37b6['message']});})['catch'](function(_0x17422f){_0x1e2b56(_0x45e6fd[_0x0ab4('0xd')](0x1f5,_0x17422f[_0x0ab4('0x19')]));});});},'Command':function(_0x53723c){var _0x1e3fe2=this;return new Promise(function(_0x13ea9f,_0x212ebd){if(ami[_0x0ab4('0xc')]()==![]){return _0x212ebd(_0x1e3fe2['error'](0x1f4,[config['asterisk']['ip'],config[_0x0ab4('0xe')]['username'],_0x0ab4('0x10')][_0x0ab4('0x11')]('\x20')));}_0x53723c=_['pick'](_0x53723c,_0x0ab4('0x1a'));_0x53723c[_0x0ab4('0x15')]=_0x0ab4('0x1b');return ami[_0x0ab4('0x17')](_0x53723c)[_0x0ab4('0x18')](function(_0x52d7d3){_0x13ea9f({'code':0xc8,'message':_0x52d7d3['content']});})[_0x0ab4('0x1c')](function(_0x14087f){_0x212ebd(_0x1e3fe2[_0x0ab4('0xd')](0x1f5,_0x14087f[_0x0ab4('0x19')]));});});},'VoiceQueues':function(){return new Promise(function(_0x4e4b80){var _0x42d2dd=[];for(var _0x3caa9d in _0x14634a[_0x0ab4('0x1d')]){if(_0x14634a['voiceQueues']['hasOwnProperty'](_0x3caa9d)){var _0x176ff1=_0x14634a[_0x0ab4('0x1d')][_0x3caa9d];var _0x1a17ce={'id':_0x176ff1['id'],'name':_0x176ff1['name'],'strategy':_0x176ff1['strategy'],'answered':_0x176ff1['answered'],'available':_0x176ff1[_0x0ab4('0x1e')],'loggedIn':_0x176ff1['loggedIn'],'pTalking':_0x176ff1[_0x0ab4('0x1f')],'sumBillable':_0x176ff1[_0x0ab4('0x20')],'sumDuration':_0x176ff1['sumDuration'],'sumHoldTime':_0x176ff1['sumHoldTime']||0x0,'talking':_0x176ff1['talking'],'total':_0x176ff1[_0x0ab4('0x21')],'type':_0x176ff1[_0x0ab4('0x22')],'unmanaged':_0x176ff1[_0x0ab4('0x23')],'abandoned':_0x176ff1[_0x0ab4('0x24')],'waiting':_0x176ff1[_0x0ab4('0x25')],'loggedInDb':_0x176ff1['loggedInDb']};if(_0x176ff1['type']==='outbound'){_0x1a17ce[_0x0ab4('0x26')]=_0x176ff1[_0x0ab4('0x26')];_0x1a17ce[_0x0ab4('0x27')]=_0x176ff1[_0x0ab4('0x27')];_0x1a17ce[_0x0ab4('0x28')]=_0x176ff1['dialOriginateCallerIdName'];_0x1a17ce['dialOriginateCallerIdNumber']=_0x176ff1[_0x0ab4('0x29')];_0x1a17ce[_0x0ab4('0x2a')]=_0x176ff1[_0x0ab4('0x2a')];_0x1a17ce['dialPrefix']=_0x176ff1['dialPrefix'];_0x1a17ce[_0x0ab4('0x2b')]=_0x176ff1['temp'];_0x1a17ce[_0x0ab4('0x2c')]=_0x176ff1[_0x0ab4('0x2c')];_0x1a17ce[_0x0ab4('0x2d')]=_0x176ff1[_0x0ab4('0x2d')];_0x1a17ce[_0x0ab4('0x2e')]=_0x176ff1[_0x0ab4('0x2e')];_0x1a17ce['outboundBusyCallsDay']=_0x176ff1[_0x0ab4('0x2f')];_0x1a17ce[_0x0ab4('0x30')]=_0x176ff1[_0x0ab4('0x30')];_0x1a17ce[_0x0ab4('0x31')]=_0x176ff1['outboundDropCallsDayACS'];_0x1a17ce['outboundDropCallsDayCallersExit']=_0x176ff1[_0x0ab4('0x32')];_0x1a17ce[_0x0ab4('0x33')]=_0x176ff1[_0x0ab4('0x33')];_0x1a17ce['outboundNoAnswerCallsDay']=_0x176ff1['outboundNoAnswerCallsDay'];_0x1a17ce['outboundNoSuchCallsDay']=_0x176ff1[_0x0ab4('0x34')];_0x1a17ce[_0x0ab4('0x35')]=_0x176ff1[_0x0ab4('0x35')];_0x1a17ce['outboundReCallsDay']=_0x176ff1['outboundReCallsDay'];_0x1a17ce['outboundRejectCallsDay']=_0x176ff1[_0x0ab4('0x36')];_0x1a17ce[_0x0ab4('0x37')]=_0x176ff1[_0x0ab4('0x37')];_0x1a17ce[_0x0ab4('0x38')]=_0x176ff1[_0x0ab4('0x38')];_0x1a17ce[_0x0ab4('0x39')]=_0x176ff1[_0x0ab4('0x39')];_0x1a17ce[_0x0ab4('0x3a')]=_0x176ff1[_0x0ab4('0x3a')];_0x1a17ce[_0x0ab4('0x3b')]=_0x176ff1['predictiveIntervalDroppedCallsCallersExit'];_0x1a17ce[_0x0ab4('0x3c')]=_0x176ff1[_0x0ab4('0x3c')];_0x1a17ce[_0x0ab4('0x3d')]=_0x176ff1[_0x0ab4('0x3d')];_0x1a17ce[_0x0ab4('0x3e')]=_0x176ff1[_0x0ab4('0x3e')];_0x1a17ce[_0x0ab4('0x3f')]=_0x176ff1[_0x0ab4('0x3f')];_0x1a17ce[_0x0ab4('0x40')]=_0x176ff1[_0x0ab4('0x40')];_0x1a17ce[_0x0ab4('0x41')]=_0x176ff1[_0x0ab4('0x41')];_0x1a17ce['predictiveIntervalAvailable']=_0x176ff1[_0x0ab4('0x42')];_0x1a17ce[_0x0ab4('0x43')]=_0x176ff1[_0x0ab4('0x43')];_0x1a17ce[_0x0ab4('0x19')]=_0x176ff1['message'];_0x1a17ce[_0x0ab4('0x44')]=_0x176ff1['originated'];_0x1a17ce[_0x0ab4('0x45')]=_0x176ff1[_0x0ab4('0x45')];_0x1a17ce[_0x0ab4('0x46')]=_0x176ff1[_0x0ab4('0x46')];_0x1a17ce[_0x0ab4('0x47')]=_0x176ff1[_0x0ab4('0x47')];_0x1a17ce['erlangBusyFactor']=_0x176ff1[_0x0ab4('0x48')];_0x1a17ce[_0x0ab4('0x49')]=_0x176ff1[_0x0ab4('0x49')];_0x1a17ce['startProgressive']=_0x176ff1[_0x0ab4('0x4a')];}if(_0x176ff1[_0x0ab4('0x4b')]){_0x1a17ce[_0x0ab4('0x4b')]={'id':_0x176ff1[_0x0ab4('0x4b')]['id'],'name':_0x176ff1[_0x0ab4('0x4b')]['name'],'active':_0x176ff1['Trunk']['active'],'callerid':_0x176ff1[_0x0ab4('0x4b')][_0x0ab4('0x4c')]};}if(_0x176ff1['Interval']){_0x1a17ce[_0x0ab4('0x4d')]={'id':_0x176ff1['Interval']['id'],'name':_0x176ff1[_0x0ab4('0x4d')]['name']};}_0x42d2dd[_0x0ab4('0x4e')](_0x1a17ce);}}_0x4e4b80({'count':_0x42d2dd[_0x0ab4('0x4f')],'rows':_0x42d2dd});});},'UpdateVoiceQueue':function(_0x2872b0){return new Promise(function(_0x188eb7,_0x1e01a7){var _0x14dc1d=_['find'](_0x14634a[_0x0ab4('0x1d')],{'id':parseInt(_0x2872b0['id'])});var _0xfb61b8=_[_0x0ab4('0x50')](_0x2872b0,['id']);if(_0x14dc1d){for(var _0xe022e2 in _0xfb61b8){if(typeof _0xfb61b8[_0xe022e2]!==_0x0ab4('0x51')&&typeof _0x14dc1d[_0xe022e2]!==_0x0ab4('0x51')){_0x14dc1d[_0xe022e2]=_0xfb61b8[_0xe022e2];}}_0x188eb7(_0x14dc1d);}else{_0x1e01a7();}});},'VoiceChannels':function(){return new Promise(function(_0x54c201){var _0x9b2c74=_['values'](_0x14634a[_0x0ab4('0x52')]);_0x54c201({'count':_0x9b2c74[_0x0ab4('0x4f')],'rows':_0x9b2c74});});},'VoiceChannelMixMonitor':function(_0x117079){var _0x518762=this;return new Promise(function(_0x5b09e,_0x1fcc3b){if(ami[_0x0ab4('0xc')]()==![]){return _0x1fcc3b(_0x518762[_0x0ab4('0xd')](0x1f4,[config[_0x0ab4('0xe')]['ip'],config[_0x0ab4('0xe')]['username'],_0x0ab4('0x10')][_0x0ab4('0x11')]('\x20')));}var _0x302894=schema(properties[_0x0ab4('0x53')])[_0x0ab4('0x54')](_0x117079);if(_0x302894[_0x0ab4('0x4f')]>0x0){return _0x1fcc3b(_0x518762[_0x0ab4('0xd')](0x1f4,_[_0x0ab4('0x55')](_0x302894,_0x0ab4('0x19'))[_0x0ab4('0x11')](',\x20')));}var _0x1a9675=_[_0x0ab4('0x56')](_0x14634a[_0x0ab4('0x52')],{'uniqueid':_0x117079['uniqueid']});if(_0x1a9675&&_0x1a9675[_0x0ab4('0x57')]){var _0x354bc=util['format'](_0x0ab4('0x58'),_0x117079['filename']||_0x117079['uniqueid'],_0x117079[_0x0ab4('0x59')]||_0x0ab4('0x5a'));return ami[_0x0ab4('0x17')]({'action':'MixMonitor','channel':_0x1a9675[_0x0ab4('0x57')],'file':_0x354bc,'options':_0x0ab4('0x5b')})[_0x0ab4('0x18')](function(_0xaed2d){var _0x30ba95=_[_0x0ab4('0x56')](_0x1a9675[_0x0ab4('0x5c')],{'filename':'/var/spool/asterisk/monitor/'+_0x354bc[_0x0ab4('0x5d')]()});if(_['isNil'](_0x30ba95)){_0x1a9675[_0x0ab4('0x5c')]['push']({'filename':_0x0ab4('0x5e')+_0x354bc['toLowerCase'](),'createdAt':moment()['format'](_0x0ab4('0x5f')),'mixmonitorid':_0xaed2d[_0x0ab4('0x60')],'status':_0x0ab4('0x61')});}else{_0x30ba95[_0x0ab4('0x60')]=_0xaed2d['mixmonitorid'];_0x30ba95[_0x0ab4('0x62')]=_0x0ab4('0x61');}_0x5b09e({'code':0xc8,'message':[_0x117079[_0x0ab4('0x63')],_0x0ab4('0x64'),_0xaed2d[_0x0ab4('0x60')]][_0x0ab4('0x11')]('\x20'),'mixmonitorid':_0xaed2d[_0x0ab4('0x60')]});})[_0x0ab4('0x1c')](function(_0x2be6df){_0x1fcc3b(_0x518762[_0x0ab4('0xd')](0x1f5,[_0x117079[_0x0ab4('0x63')],_0x2be6df[_0x0ab4('0x19')][_0x0ab4('0x5d')]()][_0x0ab4('0x11')]('\x20')));});}else{return _0x1fcc3b(_0x518762[_0x0ab4('0xd')](0x1f5,_0x0ab4('0x65')));}});},'VoiceChannelStopMixMonitor':function(_0x340558){var _0xd55047=this;return new Promise(function(_0x41f85b,_0x59705f){if(ami[_0x0ab4('0xc')]()==![]){return _0x59705f(_0xd55047[_0x0ab4('0xd')](0x1f4,[config[_0x0ab4('0xe')]['ip'],config[_0x0ab4('0xe')][_0x0ab4('0xf')],_0x0ab4('0x10')][_0x0ab4('0x11')]('\x20')));}var _0x251e4d=schema(properties['voicechannel'])[_0x0ab4('0x54')](_0x340558);if(_0x251e4d[_0x0ab4('0x4f')]>0x0){return _0x59705f(_0xd55047['error'](0x1f4,_['map'](_0x251e4d,_0x0ab4('0x19'))[_0x0ab4('0x11')](',\x20')));}var _0x538a59=_['find'](_0x14634a[_0x0ab4('0x52')],{'uniqueid':_0x340558['uniqueid']});if(_0x538a59){return Promise['resolve']()[_0x0ab4('0x18')](function(){if(_0x538a59[_0x0ab4('0x57')]){return ami[_0x0ab4('0x17')]({'action':_0x0ab4('0x66'),'channel':_0x538a59[_0x0ab4('0x57')],'mixmonitorid':_0x340558[_0x0ab4('0x60')]})[_0x0ab4('0x1c')](function(){});}})['then'](function(){if(_0x538a59[_0x0ab4('0x67')]){return ami[_0x0ab4('0x17')]({'action':_0x0ab4('0x66'),'channel':_0x538a59[_0x0ab4('0x67')],'mixmonitorid':_0x340558[_0x0ab4('0x60')]})[_0x0ab4('0x1c')](function(){});}})['then'](function(){var _0x1b8bf5=_[_0x0ab4('0x56')](_0x538a59['monitors'],{'mixmonitorid':_0x340558[_0x0ab4('0x60')]});if(_0x1b8bf5){_0x1b8bf5['status']=_0x0ab4('0x68');}})['then'](function(){var _0x268b23=util[_0x0ab4('0x59')](_0x0ab4('0x58'),_0x340558[_0x0ab4('0x69')]||_0x340558['uniqueid'],_0x340558['format']||_0x0ab4('0x5a'));var _0x4477ba=_['find'](_0x538a59[_0x0ab4('0x5c')],{'filename':_0x0ab4('0x5e')+_0x268b23[_0x0ab4('0x5d')]()});if(_0x4477ba){_0x4477ba['status']=_0x0ab4('0x68');}})[_0x0ab4('0x18')](function(){_0x41f85b({'code':0xc8,'message':[_0x340558[_0x0ab4('0x63')],_0x0ab4('0x6a')][_0x0ab4('0x11')]('\x20')});})[_0x0ab4('0x1c')](function(_0x413817){_0x59705f(_0xd55047[_0x0ab4('0xd')](0x1f5,[_0x340558['uniqueid'],_0x413817['message'][_0x0ab4('0x5d')]()][_0x0ab4('0x11')]('\x20')));});}else{return _0x59705f(_0xd55047[_0x0ab4('0xd')](0x1f5,_0x0ab4('0x65')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x58c611){var _0x417926=_['values'](_0x14634a[_0x0ab4('0x6b')]);_0x58c611({'count':_0x417926[_0x0ab4('0x4f')],'rows':_0x417926});});},'VoiceQueuesChannel':function(_0x18308f){var _0x3e5f11=this;return new Promise(function(_0x340129,_0x41b65f){var _0x46a008=schema(properties[_0x0ab4('0x6c')])[_0x0ab4('0x54')](_0x18308f);if(_0x46a008['length']>0x0){return _0x41b65f(_0x3e5f11[_0x0ab4('0xd')](0x1f4,_['map'](_0x46a008,_0x0ab4('0x19'))[_0x0ab4('0x11')](',\x20')));}var _0x3a0e36=_[_0x0ab4('0x56')](_0x14634a[_0x0ab4('0x6b')],{'uniqueid':_0x18308f[_0x0ab4('0x63')]});if(_0x3a0e36){_0x340129(_0x3a0e36);}else{return _0x41b65f(_0x3e5f11[_0x0ab4('0xd')](0x1f5,_0x0ab4('0x65')));}});},'VoiceQueuesChannelHangup':function(_0x29839c){var _0x51b0ad=this;return new Promise(function(_0x1d2d2d,_0x9b1a87){if(ami['isConnected']()==![]){return _0x9b1a87(_0x51b0ad[_0x0ab4('0xd')](0x1f4,[config[_0x0ab4('0xe')]['ip'],config[_0x0ab4('0xe')]['username'],_0x0ab4('0x10')][_0x0ab4('0x11')]('\x20')));}var _0x1ed886=schema(properties[_0x0ab4('0x6d')])['validate'](_0x29839c);if(_0x1ed886['length']>0x0){return _0x9b1a87(_0x51b0ad[_0x0ab4('0xd')](0x1f4,_[_0x0ab4('0x55')](_0x1ed886,_0x0ab4('0x19'))[_0x0ab4('0x11')](',\x20')));}var _0x4ef894=_[_0x0ab4('0x56')](_0x14634a[_0x0ab4('0x6b')],{'uniqueid':_0x29839c[_0x0ab4('0x63')]});if(_0x4ef894&&_0x4ef894['channel']){return ami['Action']({'action':_0x0ab4('0x6e'),'channel':_0x4ef894[_0x0ab4('0x57')]})[_0x0ab4('0x18')](function(_0x16ec79){_0x1d2d2d({'code':0xc8,'message':[_0x29839c[_0x0ab4('0x63')],_0x16ec79[_0x0ab4('0x19')][_0x0ab4('0x5d')]()]['join']('\x20')});})[_0x0ab4('0x1c')](function(_0x57ed73){_0x9b1a87(_0x51b0ad['error'](0x1f5,[_0x29839c[_0x0ab4('0x63')],_0x57ed73['message'][_0x0ab4('0x5d')]()][_0x0ab4('0x11')]('\x20')));});}else{return _0x9b1a87(_0x51b0ad[_0x0ab4('0xd')](0x1f5,_0x0ab4('0x65')));}});},'VoiceQueuesChannelRedirect':function(_0x1eec8e){var _0x4bffd4=this;return new Promise(function(_0x586bd6,_0x88787f){if(ami[_0x0ab4('0xc')]()==![]){return _0x88787f(_0x4bffd4['error'](0x1f4,[config['asterisk']['ip'],config[_0x0ab4('0xe')][_0x0ab4('0xf')],'ami\x20disconnected'][_0x0ab4('0x11')]('\x20')));}var _0x142fd9=schema(properties[_0x0ab4('0x6f')])['validate'](_0x1eec8e);if(_0x142fd9[_0x0ab4('0x4f')]>0x0){return _0x88787f(_0x4bffd4[_0x0ab4('0xd')](0x1f4,_[_0x0ab4('0x55')](_0x142fd9,_0x0ab4('0x19'))['join'](',\x20')));}var _0x2936d0=_[_0x0ab4('0x56')](_0x14634a[_0x0ab4('0x6b')],{'uniqueid':_0x1eec8e[_0x0ab4('0x63')]});if(_0x2936d0&&_0x2936d0[_0x0ab4('0x57')]){return ami[_0x0ab4('0x17')]({'action':_0x0ab4('0x70'),'channel':_0x2936d0[_0x0ab4('0x57')],'exten':_0x1eec8e[_0x0ab4('0x71')],'context':_0x1eec8e[_0x0ab4('0x72')]||_0x2936d0['context'],'priority':0x1})[_0x0ab4('0x18')](function(_0x19f0eb){_0x586bd6({'code':0xc8,'message':[_0x1eec8e[_0x0ab4('0x63')],_0x19f0eb[_0x0ab4('0x19')][_0x0ab4('0x5d')]()]['join']('\x20')});})[_0x0ab4('0x1c')](function(_0x88676f){_0x88787f(_0x4bffd4[_0x0ab4('0xd')](0x1f5,[_0x1eec8e[_0x0ab4('0x63')],_0x88676f[_0x0ab4('0x19')][_0x0ab4('0x5d')]()][_0x0ab4('0x11')]('\x20')));});}else{return _0x88787f(_0x4bffd4[_0x0ab4('0xd')](0x1f5,_0x0ab4('0x65')));}});},'Agents':function(_0x23968d){return new Promise(function(_0x34ded4){var _0x1989fd=_[_0x0ab4('0x73')](_0x14634a[_0x0ab4('0xa')]);if(_0x23968d&&_0x23968d['id']){var _0x57bf78=_[_0x0ab4('0x56')](_0x1989fd,function(_0x23040c){return _0x23040c['id']===_0x23968d['id'];});_0x34ded4(_0x57bf78);}else{_0x34ded4({'count':_0x1989fd[_0x0ab4('0x4f')],'rows':_0x1989fd});}});},'Telephones':function(){return new Promise(function(_0x87fee){var _0x51aaa1=_['values'](_0x14634a[_0x0ab4('0x74')]);_0x87fee({'count':_0x51aaa1[_0x0ab4('0x4f')],'rows':_0x51aaa1});});},'Trunks':function(){return new Promise(function(_0x58863e){var _0x4598bb=_[_0x0ab4('0x73')](_0x14634a[_0x0ab4('0x75')]);_0x58863e({'count':_0x4598bb[_0x0ab4('0x4f')],'rows':_0x4598bb});});},'OutboundChannels':function(){return new Promise(function(_0x261700){var _0xc022dd=_[_0x0ab4('0x73')](_0x14634a['outboundChannels']);_0x261700({'count':_0xc022dd[_0x0ab4('0x4f')],'rows':_0xc022dd});});},'Outbound':function(){return new Promise(function(_0x5e0bcd){_0x5e0bcd(_0x14634a[_0x0ab4('0x76')]);});},'Campaigns':function(){return new Promise(function(_0x3ba040){var _0x29982e=_[_0x0ab4('0x73')](_0x14634a[_0x0ab4('0x77')]);_0x3ba040({'count':_0x29982e[_0x0ab4('0x4f')],'rows':_0x29982e});});},'VoiceQueuesPreview':function(_0x16079a){var _0x5eabaf=this;return new Promise(function(_0x11457b,_0x5c1e26){_0x57fac1[_0x0ab4('0x78')](_0x16079a['id'])[_0x0ab4('0x18')](function(_0x33be6){_0x11457b({'code':0xc8,'message':_0x33be6[_0x0ab4('0x19')]});})[_0x0ab4('0x1c')](function(_0x76fa2){_0x5c1e26(_0x5eabaf['error'](0x1f4,_0x76fa2['message']));});});},'EventManager':function(_0x222125){var _0x436189=this;return new Promise(function(_0x5dc6e9,_0x4e2f43){if(!_0x222125[_0x0ab4('0x79')]){return _0x4e2f43(_0x436189[_0x0ab4('0xd')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x0ab4('0x7a')](_0x0ab4('0x7b')+_0x222125[_0x0ab4('0x79')],_0x222125[_0x0ab4('0x19')]);_0x5dc6e9({'code':0xc8,'message':_0x222125});});},'FaxAccounts':function(){return new Promise(function(_0x48012a){var _0x3fefff=_['values'](_0x14634a['faxAccounts']);_0x48012a({'count':_0x3fefff[_0x0ab4('0x4f')],'rows':_0x3fefff});});},'SendFax':function(_0x4c7b6a){var _0xb19c94=this;return new Promise(function(_0x383855,_0xb1cac2){_0x5f01aa['send'](_0x4c7b6a)[_0x0ab4('0x18')](function(_0x8980c0){_0x383855({'code':0xc8,'message':_0x8980c0[_0x0ab4('0x19')]});})[_0x0ab4('0x1c')](function(_0x2bf00c){_0xb1cac2(_0xb19c94[_0x0ab4('0xd')](0x1f4,_0x2bf00c[_0x0ab4('0x19')]));});});},'CheckAfterSend':function(_0x51f02a){var _0x2a25d5=this;return new Promise(function(_0x5c9992,_0x3638d1){_0x5f01aa['checkAfterSend'](_0x51f02a)['then'](function(_0x3ad9d1){_0x5c9992({'code':0xc8,'message':_0x3ad9d1[_0x0ab4('0x19')]});})[_0x0ab4('0x1c')](function(_0x3f1479){_0x3638d1(_0x2a25d5[_0x0ab4('0xd')](0x1f4,_0x3f1479['message']));});});}};var _0x48ad72=jayson[_0x0ab4('0x7c')](_0x10d92b)[_0x0ab4('0x7d')]();_0x48ad72['on']('error',function(_0x1f0aef){return _0x4ba9d2(_0x1f0aef);});_0x48ad72['listen'](0x232a,_0x0ab4('0x7e'),function(){console[_0x0ab4('0x7f')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x28b17a(_0x0ab4('0x80')+0x232a);});});}; \ No newline at end of file +var _0x2bb0=['answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','total','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','push','length','omit','undefined','voicechannel','map','find','channels','uniqueid','channel','%s.%s','filename','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','validate','resolve','StopMixMonitor','destinationchannel','stop','wav','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','listen','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../ami','format','%s/%s','name','timers','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','module','action','then','message','catch','username','Action','content','voiceQueues','hasOwnProperty','strategy'];(function(_0x579105,_0x579832){var _0x53c368=function(_0x13a43f){while(--_0x13a43f){_0x579105['push'](_0x579105['shift']());}};_0x53c368(++_0x579832);}(_0x2bb0,0xf3));var _0x02bb=function(_0x5db223,_0x4ed920){_0x5db223=_0x5db223-0x0;var _0x250519=_0x2bb0[_0x5db223];return _0x250519;};'use strict';var _=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var jayson=require(_0x02bb('0x2'));var schema=require('validate');var moment=require(_0x02bb('0x3'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0x02bb('0x4'));exports['listen']=function(_0x1dff97,_0xe8fdaa,_0x8e4057){return new Promise(function(_0x390ff7,_0x43dbb7){var _0x16bb7c={'QueuePause':function(_0x440f9c){return new Promise(function(_0x47d7ae){var _0x6d064a=util[_0x02bb('0x5')](_0x02bb('0x6'),'SIP',_0x440f9c[_0x02bb('0x7')]);if(_0x1dff97['timers']&&_0x1dff97[_0x02bb('0x8')][_0x6d064a]&&_0x1dff97[_0x02bb('0x8')][_0x6d064a]['timer']){_0x1dff97[_0x02bb('0x8')][_0x6d064a][_0x02bb('0x9')]();}if(_0x1dff97[_0x02bb('0xa')][_0x6d064a]){_0x1dff97['agents'][_0x6d064a][_0x02bb('0xb')]({'statePause':_0x440f9c['pause']?!![]:![]});}_0x47d7ae({'code':0xc8,'message':_0x02bb('0xc')});});},'Reload':function(_0x294078){var _0x1079f9=this;return new Promise(function(_0x5c8728,_0x16330c){if(ami[_0x02bb('0xd')]()==![]){return _0x16330c(_0x1079f9[_0x02bb('0xe')](0x1f4,[config['asterisk']['ip'],config[_0x02bb('0xf')]['username'],_0x02bb('0x10')][_0x02bb('0x11')]('\x20')));}_0x294078=_[_0x02bb('0x12')](_0x294078,_[_0x02bb('0x13')](properties[_0x02bb('0x14')]));_0x294078[_0x02bb('0x15')]='Reload';return ami['Action'](_0x294078)[_0x02bb('0x16')](function(_0x46abfd){_0x5c8728({'code':0xc8,'message':_0x46abfd[_0x02bb('0x17')]});})[_0x02bb('0x18')](function(_0x23da71){_0x16330c(_0x1079f9[_0x02bb('0xe')](0x1f5,_0x23da71['message']));});});},'Command':function(_0x362b16){var _0x4b3f78=this;return new Promise(function(_0xb4415a,_0x298340){if(ami[_0x02bb('0xd')]()==![]){return _0x298340(_0x4b3f78['error'](0x1f4,[config[_0x02bb('0xf')]['ip'],config[_0x02bb('0xf')][_0x02bb('0x19')],'ami\x20disconnected'][_0x02bb('0x11')]('\x20')));}_0x362b16=_[_0x02bb('0x12')](_0x362b16,'command');_0x362b16[_0x02bb('0x15')]='Command';return ami[_0x02bb('0x1a')](_0x362b16)[_0x02bb('0x16')](function(_0x21e550){_0xb4415a({'code':0xc8,'message':_0x21e550[_0x02bb('0x1b')]});})[_0x02bb('0x18')](function(_0x35d2ec){_0x298340(_0x4b3f78[_0x02bb('0xe')](0x1f5,_0x35d2ec['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x58467f){var _0x278fc9=[];for(var _0x5ac511 in _0x1dff97[_0x02bb('0x1c')]){if(_0x1dff97[_0x02bb('0x1c')][_0x02bb('0x1d')](_0x5ac511)){var _0x4d3dad=_0x1dff97[_0x02bb('0x1c')][_0x5ac511];var _0x96298e={'id':_0x4d3dad['id'],'name':_0x4d3dad['name'],'strategy':_0x4d3dad[_0x02bb('0x1e')],'answered':_0x4d3dad[_0x02bb('0x1f')],'available':_0x4d3dad[_0x02bb('0x20')],'loggedIn':_0x4d3dad[_0x02bb('0x21')],'pTalking':_0x4d3dad[_0x02bb('0x22')],'sumBillable':_0x4d3dad[_0x02bb('0x23')],'sumDuration':_0x4d3dad['sumDuration'],'sumHoldTime':_0x4d3dad[_0x02bb('0x24')]||0x0,'talking':_0x4d3dad['talking'],'total':_0x4d3dad[_0x02bb('0x25')],'type':_0x4d3dad[_0x02bb('0x26')],'unmanaged':_0x4d3dad[_0x02bb('0x27')],'abandoned':_0x4d3dad['abandoned'],'waiting':_0x4d3dad[_0x02bb('0x28')],'loggedInDb':_0x4d3dad[_0x02bb('0x29')]};if(_0x4d3dad[_0x02bb('0x26')]==='outbound'){_0x96298e[_0x02bb('0x2a')]=_0x4d3dad[_0x02bb('0x2a')];_0x96298e[_0x02bb('0x2b')]=_0x4d3dad['dialMethod'];_0x96298e['dialOriginateCallerIdName']=_0x4d3dad[_0x02bb('0x2c')];_0x96298e['dialOriginateCallerIdNumber']=_0x4d3dad['dialOriginateCallerIdNumber'];_0x96298e[_0x02bb('0x2d')]=_0x4d3dad[_0x02bb('0x2d')];_0x96298e['dialPrefix']=_0x4d3dad[_0x02bb('0x2e')];_0x96298e[_0x02bb('0x2f')]=_0x4d3dad[_0x02bb('0x2f')];_0x96298e['outboundAnswerAgiCallsDay']=_0x4d3dad[_0x02bb('0x30')];_0x96298e[_0x02bb('0x31')]=_0x4d3dad[_0x02bb('0x31')];_0x96298e[_0x02bb('0x32')]=_0x4d3dad[_0x02bb('0x32')];_0x96298e[_0x02bb('0x33')]=_0x4d3dad[_0x02bb('0x33')];_0x96298e[_0x02bb('0x34')]=_0x4d3dad[_0x02bb('0x34')];_0x96298e[_0x02bb('0x35')]=_0x4d3dad['outboundDropCallsDayACS'];_0x96298e[_0x02bb('0x36')]=_0x4d3dad[_0x02bb('0x36')];_0x96298e['outboundDropCallsDayTimeout']=_0x4d3dad[_0x02bb('0x37')];_0x96298e[_0x02bb('0x38')]=_0x4d3dad[_0x02bb('0x38')];_0x96298e[_0x02bb('0x39')]=_0x4d3dad['outboundNoSuchCallsDay'];_0x96298e[_0x02bb('0x3a')]=_0x4d3dad['outboundOriginateFailureCallsDay'];_0x96298e[_0x02bb('0x3b')]=_0x4d3dad[_0x02bb('0x3b')];_0x96298e[_0x02bb('0x3c')]=_0x4d3dad[_0x02bb('0x3c')];_0x96298e[_0x02bb('0x3d')]=_0x4d3dad[_0x02bb('0x3d')];_0x96298e[_0x02bb('0x3e')]=_0x4d3dad['predictiveIntervalAnsweredCalls'];_0x96298e[_0x02bb('0x3f')]=_0x4d3dad[_0x02bb('0x3f')];_0x96298e['predictiveIntervalAvgTalktime']=_0x4d3dad[_0x02bb('0x40')];_0x96298e[_0x02bb('0x41')]=_0x4d3dad[_0x02bb('0x41')];_0x96298e[_0x02bb('0x42')]=_0x4d3dad[_0x02bb('0x42')];_0x96298e[_0x02bb('0x43')]=_0x4d3dad['predictiveIntervalErlangCalls'];_0x96298e[_0x02bb('0x44')]=_0x4d3dad['predictiveIntervalErlangCallsDroppedCalls'];_0x96298e[_0x02bb('0x45')]=_0x4d3dad[_0x02bb('0x45')];_0x96298e[_0x02bb('0x46')]=_0x4d3dad[_0x02bb('0x46')];_0x96298e[_0x02bb('0x47')]=_0x4d3dad[_0x02bb('0x47')];_0x96298e[_0x02bb('0x48')]=_0x4d3dad[_0x02bb('0x48')];_0x96298e[_0x02bb('0x49')]=_0x4d3dad['predictiveIntervalTotalCalls'];_0x96298e[_0x02bb('0x17')]=_0x4d3dad[_0x02bb('0x17')];_0x96298e['originated']=_0x4d3dad[_0x02bb('0x4a')];_0x96298e[_0x02bb('0x4b')]=_0x4d3dad['erlangCalls'];_0x96298e['erlangCallToSecond']=_0x4d3dad[_0x02bb('0x4c')];_0x96298e[_0x02bb('0x4d')]=_0x4d3dad[_0x02bb('0x4d')];_0x96298e[_0x02bb('0x4e')]=_0x4d3dad[_0x02bb('0x4e')];_0x96298e[_0x02bb('0x4f')]=_0x4d3dad['startPredictive'];_0x96298e[_0x02bb('0x50')]=_0x4d3dad['startProgressive'];}if(_0x4d3dad['Trunk']){_0x96298e[_0x02bb('0x51')]={'id':_0x4d3dad[_0x02bb('0x51')]['id'],'name':_0x4d3dad['Trunk'][_0x02bb('0x7')],'active':_0x4d3dad['Trunk'][_0x02bb('0x52')],'callerid':_0x4d3dad[_0x02bb('0x51')][_0x02bb('0x53')]};}if(_0x4d3dad['Interval']){_0x96298e['Interval']={'id':_0x4d3dad['Interval']['id'],'name':_0x4d3dad['Interval'][_0x02bb('0x7')]};}_0x278fc9[_0x02bb('0x54')](_0x96298e);}}_0x58467f({'count':_0x278fc9[_0x02bb('0x55')],'rows':_0x278fc9});});},'UpdateVoiceQueue':function(_0x5be6b9){return new Promise(function(_0x134482,_0x13a831){var _0x24743e=_['find'](_0x1dff97[_0x02bb('0x1c')],{'id':parseInt(_0x5be6b9['id'])});var _0x40b76c=_[_0x02bb('0x56')](_0x5be6b9,['id']);if(_0x24743e){for(var _0x43ede8 in _0x40b76c){if(typeof _0x40b76c[_0x43ede8]!==_0x02bb('0x57')&&typeof _0x24743e[_0x43ede8]!=='undefined'){_0x24743e[_0x43ede8]=_0x40b76c[_0x43ede8];}}_0x134482(_0x24743e);}else{_0x13a831();}});},'VoiceChannels':function(){return new Promise(function(_0x4cc8dc){var _0x89ef1d=_['values'](_0x1dff97['channels']);_0x4cc8dc({'count':_0x89ef1d[_0x02bb('0x55')],'rows':_0x89ef1d});});},'VoiceChannelMixMonitor':function(_0x11236b){var _0x5e9785=this;return new Promise(function(_0x394626,_0x18dcf7){if(ami[_0x02bb('0xd')]()==![]){return _0x18dcf7(_0x5e9785['error'](0x1f4,[config[_0x02bb('0xf')]['ip'],config[_0x02bb('0xf')][_0x02bb('0x19')],_0x02bb('0x10')][_0x02bb('0x11')]('\x20')));}var _0x186768=schema(properties[_0x02bb('0x58')])['validate'](_0x11236b);if(_0x186768[_0x02bb('0x55')]>0x0){return _0x18dcf7(_0x5e9785[_0x02bb('0xe')](0x1f4,_[_0x02bb('0x59')](_0x186768,_0x02bb('0x17'))['join'](',\x20')));}var _0x171f85=_[_0x02bb('0x5a')](_0x1dff97[_0x02bb('0x5b')],{'uniqueid':_0x11236b[_0x02bb('0x5c')]});if(_0x171f85&&_0x171f85[_0x02bb('0x5d')]){var _0x3fe582=util[_0x02bb('0x5')](_0x02bb('0x5e'),_0x11236b[_0x02bb('0x5f')]||_0x11236b[_0x02bb('0x5c')],_0x11236b[_0x02bb('0x5')]||'wav');return ami[_0x02bb('0x1a')]({'action':'MixMonitor','channel':_0x171f85[_0x02bb('0x5d')],'file':_0x3fe582,'options':_0x02bb('0x60')})[_0x02bb('0x16')](function(_0x121174){var _0x13c357=_[_0x02bb('0x5a')](_0x171f85[_0x02bb('0x61')],{'filename':_0x02bb('0x62')+_0x3fe582['toLowerCase']()});if(_[_0x02bb('0x63')](_0x13c357)){_0x171f85[_0x02bb('0x61')][_0x02bb('0x54')]({'filename':_0x02bb('0x62')+_0x3fe582[_0x02bb('0x64')](),'createdAt':moment()[_0x02bb('0x5')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x121174[_0x02bb('0x65')],'status':_0x02bb('0x66')});}else{_0x13c357[_0x02bb('0x65')]=_0x121174['mixmonitorid'];_0x13c357[_0x02bb('0x67')]='rec';}_0x394626({'code':0xc8,'message':[_0x11236b[_0x02bb('0x5c')],_0x02bb('0x68'),_0x121174[_0x02bb('0x65')]][_0x02bb('0x11')]('\x20'),'mixmonitorid':_0x121174[_0x02bb('0x65')]});})[_0x02bb('0x18')](function(_0x44b3fb){_0x18dcf7(_0x5e9785[_0x02bb('0xe')](0x1f5,[_0x11236b[_0x02bb('0x5c')],_0x44b3fb[_0x02bb('0x17')]['toLowerCase']()][_0x02bb('0x11')]('\x20')));});}else{return _0x18dcf7(_0x5e9785[_0x02bb('0xe')](0x1f5,_0x02bb('0x69')));}});},'VoiceChannelStopMixMonitor':function(_0x59ddf5){var _0x45deef=this;return new Promise(function(_0x337ece,_0x31952){if(ami[_0x02bb('0xd')]()==![]){return _0x31952(_0x45deef[_0x02bb('0xe')](0x1f4,[config['asterisk']['ip'],config[_0x02bb('0xf')][_0x02bb('0x19')],_0x02bb('0x10')][_0x02bb('0x11')]('\x20')));}var _0x27aa4d=schema(properties[_0x02bb('0x58')])[_0x02bb('0x6a')](_0x59ddf5);if(_0x27aa4d[_0x02bb('0x55')]>0x0){return _0x31952(_0x45deef[_0x02bb('0xe')](0x1f4,_[_0x02bb('0x59')](_0x27aa4d,_0x02bb('0x17'))[_0x02bb('0x11')](',\x20')));}var _0x4823ba=_[_0x02bb('0x5a')](_0x1dff97[_0x02bb('0x5b')],{'uniqueid':_0x59ddf5['uniqueid']});if(_0x4823ba){return Promise[_0x02bb('0x6b')]()[_0x02bb('0x16')](function(){if(_0x4823ba[_0x02bb('0x5d')]){return ami[_0x02bb('0x1a')]({'action':_0x02bb('0x6c'),'channel':_0x4823ba[_0x02bb('0x5d')],'mixmonitorid':_0x59ddf5['mixmonitorid']})[_0x02bb('0x18')](function(){});}})[_0x02bb('0x16')](function(){if(_0x4823ba[_0x02bb('0x6d')]){return ami[_0x02bb('0x1a')]({'action':_0x02bb('0x6c'),'channel':_0x4823ba[_0x02bb('0x6d')],'mixmonitorid':_0x59ddf5[_0x02bb('0x65')]})[_0x02bb('0x18')](function(){});}})['then'](function(){var _0x1b8b0a=_[_0x02bb('0x5a')](_0x4823ba['monitors'],{'mixmonitorid':_0x59ddf5[_0x02bb('0x65')]});if(_0x1b8b0a){_0x1b8b0a[_0x02bb('0x67')]=_0x02bb('0x6e');}})[_0x02bb('0x16')](function(){var _0x30428a=util[_0x02bb('0x5')](_0x02bb('0x5e'),_0x59ddf5[_0x02bb('0x5f')]||_0x59ddf5[_0x02bb('0x5c')],_0x59ddf5[_0x02bb('0x5')]||_0x02bb('0x6f'));var _0x2908e5=_[_0x02bb('0x5a')](_0x4823ba[_0x02bb('0x61')],{'filename':_0x02bb('0x62')+_0x30428a[_0x02bb('0x64')]()});if(_0x2908e5){_0x2908e5['status']=_0x02bb('0x6e');}})[_0x02bb('0x16')](function(){_0x337ece({'code':0xc8,'message':[_0x59ddf5[_0x02bb('0x5c')],_0x02bb('0x70')][_0x02bb('0x11')]('\x20')});})[_0x02bb('0x18')](function(_0x13cdf6){_0x31952(_0x45deef['error'](0x1f5,[_0x59ddf5['uniqueid'],_0x13cdf6[_0x02bb('0x17')][_0x02bb('0x64')]()][_0x02bb('0x11')]('\x20')));});}else{return _0x31952(_0x45deef[_0x02bb('0xe')](0x1f5,_0x02bb('0x69')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0xeb2222){var _0x282adc=_[_0x02bb('0x71')](_0x1dff97[_0x02bb('0x72')]);_0xeb2222({'count':_0x282adc['length'],'rows':_0x282adc});});},'VoiceQueuesChannel':function(_0x45ac2e){var _0x33251d=this;return new Promise(function(_0x55bc56,_0x380e52){var _0x35747d=schema(properties['voicequeuechannel'])[_0x02bb('0x6a')](_0x45ac2e);if(_0x35747d['length']>0x0){return _0x380e52(_0x33251d['error'](0x1f4,_['map'](_0x35747d,_0x02bb('0x17'))[_0x02bb('0x11')](',\x20')));}var _0x3b33c1=_[_0x02bb('0x5a')](_0x1dff97['queueChannels'],{'uniqueid':_0x45ac2e[_0x02bb('0x5c')]});if(_0x3b33c1){_0x55bc56(_0x3b33c1);}else{return _0x380e52(_0x33251d[_0x02bb('0xe')](0x1f5,_0x02bb('0x69')));}});},'VoiceQueuesChannelHangup':function(_0x45ede0){var _0x59e519=this;return new Promise(function(_0x2f427b,_0x5ca9e5){if(ami['isConnected']()==![]){return _0x5ca9e5(_0x59e519[_0x02bb('0xe')](0x1f4,[config[_0x02bb('0xf')]['ip'],config['asterisk'][_0x02bb('0x19')],'ami\x20disconnected'][_0x02bb('0x11')]('\x20')));}var _0x4b9b84=schema(properties[_0x02bb('0x73')])[_0x02bb('0x6a')](_0x45ede0);if(_0x4b9b84[_0x02bb('0x55')]>0x0){return _0x5ca9e5(_0x59e519[_0x02bb('0xe')](0x1f4,_[_0x02bb('0x59')](_0x4b9b84,_0x02bb('0x17'))[_0x02bb('0x11')](',\x20')));}var _0x3adeb4=_['find'](_0x1dff97[_0x02bb('0x72')],{'uniqueid':_0x45ede0[_0x02bb('0x5c')]});if(_0x3adeb4&&_0x3adeb4[_0x02bb('0x5d')]){return ami[_0x02bb('0x1a')]({'action':_0x02bb('0x74'),'channel':_0x3adeb4['channel']})['then'](function(_0x37a944){_0x2f427b({'code':0xc8,'message':[_0x45ede0[_0x02bb('0x5c')],_0x37a944['message'][_0x02bb('0x64')]()][_0x02bb('0x11')]('\x20')});})[_0x02bb('0x18')](function(_0x165ac2){_0x5ca9e5(_0x59e519[_0x02bb('0xe')](0x1f5,[_0x45ede0[_0x02bb('0x5c')],_0x165ac2[_0x02bb('0x17')]['toLowerCase']()]['join']('\x20')));});}else{return _0x5ca9e5(_0x59e519[_0x02bb('0xe')](0x1f5,_0x02bb('0x69')));}});},'VoiceQueuesChannelRedirect':function(_0x36be6f){var _0x462c86=this;return new Promise(function(_0x2c177e,_0x940d74){if(ami[_0x02bb('0xd')]()==![]){return _0x940d74(_0x462c86[_0x02bb('0xe')](0x1f4,[config[_0x02bb('0xf')]['ip'],config[_0x02bb('0xf')]['username'],_0x02bb('0x10')]['join']('\x20')));}var _0x839aa3=schema(properties[_0x02bb('0x75')])[_0x02bb('0x6a')](_0x36be6f);if(_0x839aa3[_0x02bb('0x55')]>0x0){return _0x940d74(_0x462c86[_0x02bb('0xe')](0x1f4,_[_0x02bb('0x59')](_0x839aa3,_0x02bb('0x17'))[_0x02bb('0x11')](',\x20')));}var _0x4379b9=_[_0x02bb('0x5a')](_0x1dff97[_0x02bb('0x72')],{'uniqueid':_0x36be6f[_0x02bb('0x5c')]});if(_0x4379b9&&_0x4379b9['channel']){return ami[_0x02bb('0x1a')]({'action':'Redirect','channel':_0x4379b9['channel'],'exten':_0x36be6f[_0x02bb('0x76')],'context':_0x36be6f[_0x02bb('0x77')]||_0x4379b9[_0x02bb('0x77')],'priority':0x1})[_0x02bb('0x16')](function(_0xab6908){_0x2c177e({'code':0xc8,'message':[_0x36be6f[_0x02bb('0x5c')],_0xab6908['message'][_0x02bb('0x64')]()]['join']('\x20')});})['catch'](function(_0x36d35f){_0x940d74(_0x462c86[_0x02bb('0xe')](0x1f5,[_0x36be6f[_0x02bb('0x5c')],_0x36d35f[_0x02bb('0x17')][_0x02bb('0x64')]()][_0x02bb('0x11')]('\x20')));});}else{return _0x940d74(_0x462c86[_0x02bb('0xe')](0x1f5,_0x02bb('0x69')));}});},'Agents':function(_0x138afe){return new Promise(function(_0x4af771){var _0x3837ce=_[_0x02bb('0x71')](_0x1dff97[_0x02bb('0xa')]);if(_0x138afe&&_0x138afe['id']){var _0x52355e=_[_0x02bb('0x5a')](_0x3837ce,function(_0x2bd921){return _0x2bd921['id']===_0x138afe['id'];});_0x4af771(_0x52355e);}else{_0x4af771({'count':_0x3837ce['length'],'rows':_0x3837ce});}});},'Telephones':function(){return new Promise(function(_0x4b07f1){var _0x468c76=_[_0x02bb('0x71')](_0x1dff97[_0x02bb('0x78')]);_0x4b07f1({'count':_0x468c76[_0x02bb('0x55')],'rows':_0x468c76});});},'Trunks':function(){return new Promise(function(_0x27cfe1){var _0xb29a59=_[_0x02bb('0x71')](_0x1dff97[_0x02bb('0x79')]);_0x27cfe1({'count':_0xb29a59[_0x02bb('0x55')],'rows':_0xb29a59});});},'OutboundChannels':function(){return new Promise(function(_0x4f4020){var _0x3b6603=_[_0x02bb('0x71')](_0x1dff97['outboundChannels']);_0x4f4020({'count':_0x3b6603[_0x02bb('0x55')],'rows':_0x3b6603});});},'Outbound':function(){return new Promise(function(_0x281e09){_0x281e09(_0x1dff97[_0x02bb('0x7a')]);});},'Campaigns':function(){return new Promise(function(_0x261b6f){var _0x261ddb=_[_0x02bb('0x71')](_0x1dff97[_0x02bb('0x7b')]);_0x261b6f({'count':_0x261ddb['length'],'rows':_0x261ddb});});},'VoiceQueuesPreview':function(_0x439799){var _0x448a7a=this;return new Promise(function(_0x73d2b3,_0x5d7967){_0xe8fdaa[_0x02bb('0x7c')](_0x439799['id'])[_0x02bb('0x16')](function(_0x569364){_0x73d2b3({'code':0xc8,'message':_0x569364['message']});})[_0x02bb('0x18')](function(_0x2e4b49){_0x5d7967(_0x448a7a['error'](0x1f4,_0x2e4b49[_0x02bb('0x17')]));});});},'EventManager':function(_0xf77848){var _0x2cbe8d=this;return new Promise(function(_0x2926c5,_0x5b6802){if(!_0xf77848[_0x02bb('0x7d')]){return _0x5b6802(_0x2cbe8d[_0x02bb('0xe')](0x1f4,_0x02bb('0x7e')));}ami[_0x02bb('0x7f')](_0x02bb('0x80')+_0xf77848['event'],_0xf77848[_0x02bb('0x17')]);_0x2926c5({'code':0xc8,'message':_0xf77848});});},'FaxAccounts':function(){return new Promise(function(_0x225f46){var _0x1d1b96=_[_0x02bb('0x71')](_0x1dff97[_0x02bb('0x81')]);_0x225f46({'count':_0x1d1b96[_0x02bb('0x55')],'rows':_0x1d1b96});});},'SendFax':function(_0x5ebbcd){var _0x178c48=this;return new Promise(function(_0x12b556,_0x533191){_0x8e4057[_0x02bb('0x82')](_0x5ebbcd)[_0x02bb('0x16')](function(_0x2037d0){_0x12b556({'code':0xc8,'message':_0x2037d0[_0x02bb('0x17')]});})[_0x02bb('0x18')](function(_0x4aec84){_0x533191(_0x178c48[_0x02bb('0xe')](0x1f4,_0x4aec84[_0x02bb('0x17')]));});});},'CheckAfterSend':function(_0x286d69){var _0x15d8bd=this;return new Promise(function(_0x430c2a,_0x2fe1b7){_0x8e4057[_0x02bb('0x83')](_0x286d69)[_0x02bb('0x16')](function(_0x4cd1f6){_0x430c2a({'code':0xc8,'message':_0x4cd1f6[_0x02bb('0x17')]});})[_0x02bb('0x18')](function(_0x4b8e41){_0x2fe1b7(_0x15d8bd[_0x02bb('0xe')](0x1f4,_0x4b8e41['message']));});});}};var _0x1966a9=jayson[_0x02bb('0x84')](_0x16bb7c)['http']();_0x1966a9['on']('error',function(_0x33f291){return _0x43dbb7(_0x33f291);});_0x1966a9[_0x02bb('0x85')](0x232a,_0x02bb('0x86'),function(){console['log'](_0x02bb('0x87'),0x232a);return _0x390ff7(_0x02bb('0x88')+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 e4111c8..1b064b5 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 _0xbaaa=['length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','destcalleridname','Unknown','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','trigger:%s','action','toLowerCase','merge','lodash','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','localhost','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','then','getContacts','isEmpty'];(function(_0x341b90,_0x52271e){var _0x5aee18=function(_0x55e43c){while(--_0x55e43c){_0x341b90['push'](_0x341b90['shift']());}};_0x5aee18(++_0x52271e);}(_0xbaaa,0x137));var _0xabaa=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xbaaa[_0x1cb18a];return _0x22442e;};'use strict';var _=require(_0xabaa('0x0'));var BPromise=require('bluebird');var Redis=require(_0xabaa('0x1'));var util=require(_0xabaa('0x2'));var config=require(_0xabaa('0x3'));var logger=require('../../../../config/logger')(_0xabaa('0x4'));var cmContactRpc=require(_0xabaa('0x5'));config[_0xabaa('0x6')]=_['defaults'](config[_0xabaa('0x6')],{'host':_0xabaa('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xabaa('0x6')]));function emit(_0x4b4960,_0x413554,_0x4e4d67,_0x2f249,_0x3a5789){logger[_0xabaa('0x8')](_0xabaa('0x9'),_0x4b4960,_0x413554['id'],_0x4e4d67,_0x2f249,JSON[_0xabaa('0xa')](_0x3a5789));io['to'](_0x4e4d67)[_0xabaa('0xb')](_0x2f249,_0x3a5789);}exports[_0xabaa('0xc')]=function(_0x318120,_0x20f760,_0x56a533,_0x178f41){var _0x615cb8,_0xf2fe42;var _0x29b78d={};var _0x53fd17;var _0x4a7875=Number(_0x56a533[_0xabaa('0xd')]);var _0x3fed03=_0x56a533['data2']?Boolean(Number(_0x56a533[_0xabaa('0xe')])):![];var _0x5c0bf0;var _0xf452c7=![];if(!_[_0xabaa('0xf')](_0x56a533['data5'])){if(_0x56a533[_0xabaa('0x10')]=='1')_0xf452c7=!![];}if(!_0xf452c7){if(_0x178f41['xmd-contactid']){_0x29b78d['id']=_0x178f41[_0xabaa('0x11')];}}if(!_0x29b78d['id']){_0x29b78d[_0xabaa('0x12')]=_0x4a7875;_0x5c0bf0=_0x56a533[_0xabaa('0x13')]&&_0x56a533[_0xabaa('0x13')]!=='0'?_0x56a533['data3'][_0xabaa('0x14')](','):[_0xabaa('0x15')];_0x29b78d['$or']=_[_0xabaa('0x16')](_0x5c0bf0,function(_0x5a9f2e){var _0x3d0c8a={};_0x3d0c8a[_0x5a9f2e]=_0x178f41[_0xabaa('0x17')]?_0x178f41[_0xabaa('0x18')]:_0x178f41[_0xabaa('0x19')];return _0x3d0c8a;});_0x53fd17=_0x178f41[_0xabaa('0x17')]?_0x178f41[_0xabaa('0x18')]:_0x178f41['calleridnum'];}var _0x3335cf=['id',_0xabaa('0x1a'),_0xabaa('0x1b'),_0xabaa('0x15'),_0xabaa('0x1c'),_0xabaa('0x1d'),_0xabaa('0x12'),_0xabaa('0x1e'),_0xabaa('0x1f'),_0xabaa('0x20')];var _0x3ee7c1=_[_0xabaa('0x21')](_0x3335cf,_0x5c0bf0);BPromise['resolve']()[_0xabaa('0x22')](cmContactRpc[_0xabaa('0x23')]({'attributes':_0x3ee7c1,'where':_0x29b78d,'phone':_0x53fd17}))[_0xabaa('0x22')](function(_0x5040fc){_0xf2fe42=_0x5040fc;if(!_[_0xabaa('0x24')](_0xf2fe42)){if(_0xf2fe42[_0xabaa('0x25')]===0x1){_0x615cb8=_0xf2fe42[0x0];logger[_0xabaa('0x8')](_0xabaa('0x26'),_0x178f41['uniqueid'],_0x20f760['id'],_0x615cb8['id']);}else{logger['info'](_0xabaa('0x27'),_0x178f41[_0xabaa('0x28')],_0x20f760['id'],_['map'](_0xf2fe42,'id')[_0xabaa('0x29')](','));}return;}else{logger[_0xabaa('0x8')](_0xabaa('0x2a'),_0x178f41[_0xabaa('0x28')],_0x20f760['id']);var _0x386ec1={'ListId':_0x4a7875};var _0x2042f3=_0x56a533[_0xabaa('0x2b')]&&_0x56a533[_0xabaa('0x2b')]!=='0'?_0x56a533[_0xabaa('0x2b')]:_0xabaa('0x15');if(_0x3fed03){logger[_0xabaa('0x8')](_0xabaa('0x2c'),_0x178f41[_0xabaa('0x28')],_0x20f760['id']);_0x386ec1[_0x2042f3]=_[_0xabaa('0xf')](_0x178f41[_0xabaa('0x17')])?_0x178f41['calleridnum']:_0x178f41['destcalleridnum'];if(_[_0xabaa('0xf')](_0x178f41[_0xabaa('0x17')])){_0x386ec1[_0xabaa('0x1a')]=_0x178f41[_0xabaa('0x2d')]&&_0x178f41['calleridname']!==_0xabaa('0x2e')?_0x178f41['calleridname']:'Unknown';}else{_0x386ec1['firstName']=_0x178f41[_0xabaa('0x2f')]&&_0x178f41[_0xabaa('0x2f')]!==''?_0x178f41[_0xabaa('0x2f')]:_0xabaa('0x30');}return BPromise[_0xabaa('0x31')]()[_0xabaa('0x22')](cmContactRpc[_0xabaa('0x32')](_0x386ec1))[_0xabaa('0x22')](function(_0x2bfaa8){_0x615cb8=_0x2bfaa8;_0xf2fe42[_0xabaa('0x33')](_0x2bfaa8);if(_0x615cb8){logger[_0xabaa('0x8')](_0xabaa('0x34'),_0x178f41[_0xabaa('0x28')],_0x20f760['id'],_0x615cb8['id']);}return;});}else{logger[_0xabaa('0x8')](_0xabaa('0x35'),_0x178f41[_0xabaa('0x28')],_0x20f760['id']);_0x386ec1[_0x2042f3]=_[_0xabaa('0xf')](_0x178f41['routeId'])?_0x178f41['calleridnum']:_0x178f41[_0xabaa('0x18')];if(_[_0xabaa('0xf')](_0x178f41[_0xabaa('0x17')])){_0x386ec1['firstName']=_0x178f41['calleridname']&&_0x178f41[_0xabaa('0x2d')]!==_0xabaa('0x2e')?_0x178f41[_0xabaa('0x2d')]:_0xabaa('0x30');}else{_0x386ec1[_0xabaa('0x1a')]=_0x178f41[_0xabaa('0x2f')]&&_0x178f41['destcalleridname']!==_0xabaa('0x2e')?_0x178f41[_0xabaa('0x2f')]:_0xabaa('0x30');}_0x615cb8=_0x386ec1;_0xf2fe42[_0xabaa('0x33')](_0x386ec1);return;}}})['then'](function(){if(_0x318120){emit(_0x178f41[_0xabaa('0x28')],_0x20f760,util['format']('user:%s',_0x318120['name']),util['format'](_0xabaa('0x36'),_0x56a533[_0xabaa('0x37')][_0xabaa('0x38')]()),{'evt':_[_0xabaa('0x39')](_0x178f41,{'autoCreate':_0x3fed03}),'contact':_0x615cb8===undefined?{}:_0x615cb8,'contacts':_0xf2fe42[_0xabaa('0x25')]===0x0?undefined:_0xf2fe42});}});}; \ No newline at end of file +var _0xc3b7=['push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','format','trigger:%s','action','toLowerCase','length','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','calleridnum','destcalleridnum','firstName','lastName','mobile','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xc3b7,0xb4));var _0x7c3b=function(_0x110d03,_0x14c8b6){_0x110d03=_0x110d03-0x0;var _0x524c19=_0xc3b7[_0x110d03];return _0x524c19;};'use strict';var _=require('lodash');var BPromise=require(_0x7c3b('0x0'));var Redis=require(_0x7c3b('0x1'));var util=require(_0x7c3b('0x2'));var config=require(_0x7c3b('0x3'));var logger=require(_0x7c3b('0x4'))(_0x7c3b('0x5'));var cmContactRpc=require(_0x7c3b('0x6'));config[_0x7c3b('0x7')]=_[_0x7c3b('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7c3b('0x9'))(new Redis(config[_0x7c3b('0x7')]));function emit(_0x208213,_0x1bc2d8,_0x47d9a7,_0x218be1,_0x1e03c0){logger[_0x7c3b('0xa')](_0x7c3b('0xb'),_0x208213,_0x1bc2d8['id'],_0x47d9a7,_0x218be1,JSON[_0x7c3b('0xc')](_0x1e03c0));io['to'](_0x47d9a7)[_0x7c3b('0xd')](_0x218be1,_0x1e03c0);}exports[_0x7c3b('0xe')]=function(_0x25a9ed,_0xeb699f,_0x220f21,_0x74dc35){var _0xf4883f,_0x160e68;var _0x37a36={};var _0x5e701c;var _0x157e55=Number(_0x220f21[_0x7c3b('0xf')]);var _0x4c7871=_0x220f21[_0x7c3b('0x10')]?Boolean(Number(_0x220f21[_0x7c3b('0x10')])):![];var _0xcac33;var _0x5a4512=![];if(!_[_0x7c3b('0x11')](_0x220f21[_0x7c3b('0x12')])){if(_0x220f21[_0x7c3b('0x12')]=='1')_0x5a4512=!![];}if(!_0x5a4512){if(_0x74dc35[_0x7c3b('0x13')]){_0x37a36['id']=_0x74dc35['xmd-contactid'];}}if(!_0x37a36['id']){_0x37a36[_0x7c3b('0x14')]=_0x157e55;_0xcac33=_0x220f21[_0x7c3b('0x15')]&&_0x220f21['data3']!=='0'?_0x220f21[_0x7c3b('0x15')][_0x7c3b('0x16')](','):[_0x7c3b('0x17')];_0x37a36[_0x7c3b('0x18')]=_[_0x7c3b('0x19')](_0xcac33,function(_0x3113e7){var _0x4e1130={};_0x4e1130[_0x3113e7]=_0x74dc35[_0x7c3b('0x1a')]?_0x74dc35['destcalleridnum']:_0x74dc35[_0x7c3b('0x1b')];return _0x4e1130;});_0x5e701c=_0x74dc35['routeId']?_0x74dc35[_0x7c3b('0x1c')]:_0x74dc35['calleridnum'];}var _0x24fcce=['id',_0x7c3b('0x1d'),_0x7c3b('0x1e'),_0x7c3b('0x17'),_0x7c3b('0x1f'),'fax',_0x7c3b('0x14'),_0x7c3b('0x20'),'scheduledAt',_0x7c3b('0x21')];var _0x558fea=_[_0x7c3b('0x22')](_0x24fcce,_0xcac33);BPromise[_0x7c3b('0x23')]()[_0x7c3b('0x24')](cmContactRpc[_0x7c3b('0x25')]({'attributes':_0x558fea,'where':_0x37a36,'phone':_0x5e701c}))[_0x7c3b('0x24')](function(_0x49b989){_0x160e68=_0x49b989;if(!_[_0x7c3b('0x26')](_0x160e68)){if(_0x160e68['length']===0x1){_0xf4883f=_0x160e68[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0x74dc35[_0x7c3b('0x27')],_0xeb699f['id'],_0xf4883f['id']);}else{logger[_0x7c3b('0xa')](_0x7c3b('0x28'),_0x74dc35[_0x7c3b('0x27')],_0xeb699f['id'],_[_0x7c3b('0x19')](_0x160e68,'id')['join'](','));}return;}else{logger[_0x7c3b('0xa')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x74dc35[_0x7c3b('0x27')],_0xeb699f['id']);var _0x94c0af={'ListId':_0x157e55};var _0x5c4e87=_0x220f21[_0x7c3b('0x29')]&&_0x220f21[_0x7c3b('0x29')]!=='0'?_0x220f21[_0x7c3b('0x29')]:_0x7c3b('0x17');if(_0x4c7871){logger['info'](_0x7c3b('0x2a'),_0x74dc35['uniqueid'],_0xeb699f['id']);_0x94c0af[_0x5c4e87]=_[_0x7c3b('0x11')](_0x74dc35['routeId'])?_0x74dc35[_0x7c3b('0x1b')]:_0x74dc35['destcalleridnum'];if(_[_0x7c3b('0x11')](_0x74dc35[_0x7c3b('0x1a')])){_0x94c0af['firstName']=_0x74dc35[_0x7c3b('0x2b')]&&_0x74dc35[_0x7c3b('0x2b')]!==_0x7c3b('0x2c')?_0x74dc35['calleridname']:_0x7c3b('0x2d');}else{_0x94c0af[_0x7c3b('0x1d')]=_0x74dc35[_0x7c3b('0x2e')]&&_0x74dc35['destcalleridname']!==''?_0x74dc35['destcalleridname']:_0x7c3b('0x2d');}return BPromise['resolve']()['then'](cmContactRpc[_0x7c3b('0x2f')](_0x94c0af))['then'](function(_0x79efe3){_0xf4883f=_0x79efe3;_0x160e68[_0x7c3b('0x30')](_0x79efe3);if(_0xf4883f){logger[_0x7c3b('0xa')](_0x7c3b('0x31'),_0x74dc35[_0x7c3b('0x27')],_0xeb699f['id'],_0xf4883f['id']);}return;});}else{logger['info'](_0x7c3b('0x32'),_0x74dc35[_0x7c3b('0x27')],_0xeb699f['id']);_0x94c0af[_0x5c4e87]=_['isNil'](_0x74dc35[_0x7c3b('0x1a')])?_0x74dc35[_0x7c3b('0x1b')]:_0x74dc35['destcalleridnum'];if(_['isNil'](_0x74dc35['routeId'])){_0x94c0af[_0x7c3b('0x1d')]=_0x74dc35[_0x7c3b('0x2b')]&&_0x74dc35['calleridname']!==''?_0x74dc35[_0x7c3b('0x2b')]:_0x7c3b('0x2d');}else{_0x94c0af[_0x7c3b('0x1d')]=_0x74dc35['destcalleridname']&&_0x74dc35['destcalleridname']!==_0x7c3b('0x2c')?_0x74dc35[_0x7c3b('0x2e')]:_0x7c3b('0x2d');}_0xf4883f=_0x94c0af;_0x160e68[_0x7c3b('0x30')](_0x94c0af);return;}}})[_0x7c3b('0x24')](function(){if(_0x25a9ed){emit(_0x74dc35[_0x7c3b('0x27')],_0xeb699f,util['format'](_0x7c3b('0x33'),_0x25a9ed['name']),util[_0x7c3b('0x34')](_0x7c3b('0x35'),_0x220f21[_0x7c3b('0x36')][_0x7c3b('0x37')]()),{'evt':_['merge'](_0x74dc35,{'autoCreate':_0x4c7871}),'contact':_0xf4883f===undefined?{}:_0xf4883f,'contacts':_0x160e68[_0x7c3b('0x38')]===0x0?undefined:_0x160e68});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 2761949..79958f6 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 _0x3e4d=['lastevent','substatus','offlineMessage','equals','exports','util','url','./integration','./cmContact','./script','../../../config/logger','redis','defaults','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:offlineMessage','emit','stringify','prototype','clone','motionChannel','undefined','voice','checkTriggers','interface','hasOwnProperty','status','Actions','length','motionbar','browser','data1','TemplateId','data2','html','template\x20not\x20found','uri','buildUri','isNil','data3','location','uriLocation','data4','800','data5','windowHeight','data6','winapp','render','format','user:%s','name','trigger:%s:%s','action','merge','trigger:%s','toLowerCase','contactmanager','integration','exec','queue','routeId','script','parse','query','search','replace','checkTrigger','channel','AllConditions','every','AnyConditions','checkConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','membername'];(function(_0x433dcc,_0x24a9bb){var _0x36444c=function(_0x39ceed){while(--_0x39ceed){_0x433dcc['push'](_0x433dcc['shift']());}};_0x36444c(++_0x24a9bb);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x370f27,_0x180767){_0x370f27=_0x370f27-0x0;var _0x275ddf=_0x3e4d[_0x370f27];return _0x275ddf;};'use strict';var util=require(_0xd3e4('0x0'));var _=require('lodash');var url=require(_0xd3e4('0x1'));var Mustache=require('mustache');var Redis=require('ioredis');var urlforward=require('./urlforward');var integration=require(_0xd3e4('0x2'));var cmContact=require(_0xd3e4('0x3'));var script=require(_0xd3e4('0x4'));var config=require('../../../config/environment');var logger=require(_0xd3e4('0x5'))('trigger');var ami=require('../ami');config[_0xd3e4('0x6')]=_[_0xd3e4('0x7')](config[_0xd3e4('0x6')],{'host':_0xd3e4('0x8'),'port':0x18eb});var io=require(_0xd3e4('0x9'))(new Redis(config['redis']));var operators={'equals':function(_0x68d3a8,_0x42d997){return _0x68d3a8==_0x42d997;},'not_equals':function(_0x279f4c,_0x4eead9){return _0x279f4c!=_0x4eead9;}};var barAndWebActions=[_0xd3e4('0xa'),_0xd3e4('0x1'),'winapp'];function Trigger(_0x591359){this[_0xd3e4('0xb')]=_0x591359[_0xd3e4('0xb')];this[_0xd3e4('0xc')]=_0x591359[_0xd3e4('0xc')];this[_0xd3e4('0xd')]=_0x591359[_0xd3e4('0xd')];this[_0xd3e4('0xe')]=_0x591359['templates'];this[_0xd3e4('0xf')]=_0x591359[_0xd3e4('0xf')];this[_0xd3e4('0x10')]=_0x591359['zendeskAccounts'];this['freshdeskAccounts']=_0x591359[_0xd3e4('0x11')];this['salesforceAccounts']=_0x591359[_0xd3e4('0x12')];this[_0xd3e4('0x13')]=_0x591359['sugarcrmAccounts'];this[_0xd3e4('0x14')]=_0x591359[_0xd3e4('0x14')];this['deskAccounts']=_0x591359['deskAccounts'];this['vtigerAccounts']=_0x591359[_0xd3e4('0x15')];this[_0xd3e4('0x16')]=_0x591359[_0xd3e4('0x16')];this[_0xd3e4('0x17')]=_0x591359[_0xd3e4('0x17')];this['freshsalesAccounts']=_0x591359[_0xd3e4('0x18')];this[_0xd3e4('0x19')]={'zendesk':this[_0xd3e4('0x10')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xd3e4('0x11')],'sugarcrm':this[_0xd3e4('0x13')],'zoho':this[_0xd3e4('0x14')],'desk':this['deskAccounts'],'vtiger':this[_0xd3e4('0x15')],'dynamics365':this[_0xd3e4('0x17')],'freshsales':this[_0xd3e4('0x18')],'servicenow':this[_0xd3e4('0x16')]};ami['on'](_0xd3e4('0x1a'),this[_0xd3e4('0x1b')][_0xd3e4('0x1c')](this));ami['on'](_0xd3e4('0x1d'),this[_0xd3e4('0x1b')][_0xd3e4('0x1c')](this));ami['on']('custom:agentringnoanswer',this[_0xd3e4('0x1b')]['bind'](this));ami['on'](_0xd3e4('0x1e'),this[_0xd3e4('0x1b')][_0xd3e4('0x1c')](this));ami['on'](_0xd3e4('0x1f'),this[_0xd3e4('0x1b')][_0xd3e4('0x1c')](this));ami['on'](_0xd3e4('0x20'),this['syncCustomEvent']['bind'](this));ami['on'](_0xd3e4('0x21'),this[_0xd3e4('0x1b')][_0xd3e4('0x1c')](this));ami['on'](_0xd3e4('0x22'),this[_0xd3e4('0x1b')][_0xd3e4('0x1c')](this));ami['on'](_0xd3e4('0x23'),this['syncCustomEvent']['bind'](this));ami['on']('custom:amd',this[_0xd3e4('0x1b')]['bind'](this));ami['on'](_0xd3e4('0x24'),this[_0xd3e4('0x1b')]['bind'](this));ami['on'](_0xd3e4('0x25'),this[_0xd3e4('0x1b')][_0xd3e4('0x1c')](this));ami['on'](_0xd3e4('0x26'),this[_0xd3e4('0x27')][_0xd3e4('0x1c')](this));ami['on'](_0xd3e4('0x28'),this[_0xd3e4('0x27')][_0xd3e4('0x1c')](this));ami['on'](_0xd3e4('0x29'),this['syncAgentDial'][_0xd3e4('0x1c')](this));ami['on']('custom:newinteraction',this[_0xd3e4('0x1b')]['bind'](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0xd3e4('0x1c')](this));ami['on'](_0xd3e4('0x2a'),this[_0xd3e4('0x1b')]['bind'](this));ami['on'](_0xd3e4('0x2b'),this[_0xd3e4('0x1b')][_0xd3e4('0x1c')](this));ami['on'](_0xd3e4('0x2c'),this[_0xd3e4('0x1b')][_0xd3e4('0x1c')](this));ami['on']('custom:acceptmessage',this['syncCustomEvent'][_0xd3e4('0x1c')](this));ami['on']('custom:rejectmessage',this[_0xd3e4('0x1b')][_0xd3e4('0x1c')](this));ami['on'](_0xd3e4('0x2d'),this['syncCustomEvent'][_0xd3e4('0x1c')](this));}Trigger['prototype'][_0xd3e4('0x2e')]=function(_0x361699,_0x47131c,_0x132bbe){logger['info'](_0x361699,_0x47131c,JSON[_0xd3e4('0x2f')](_0x132bbe));io['to'](_0x361699)['emit'](_0x47131c,_0x132bbe);};Trigger[_0xd3e4('0x30')][_0xd3e4('0x1b')]=function(_0x1d4898){var _0x5cd56b=_[_0xd3e4('0x31')](_0x1d4898);if(typeof _0x5cd56b[_0xd3e4('0x32')]===_0xd3e4('0x33')){_0x5cd56b[_0xd3e4('0x32')]=_0xd3e4('0x34');}this[_0xd3e4('0x35')](_0x5cd56b);};Trigger[_0xd3e4('0x30')][_0xd3e4('0x27')]=function(_0x478369){if(this[_0xd3e4('0xc')][_0x478369[_0xd3e4('0x36')]]){this[_0xd3e4('0x1b')](_0x478369);}};Trigger['prototype'][_0xd3e4('0x35')]=function(_0x3458c2){var _0xbb425a;for(var _0x3c79f9 in this[_0xd3e4('0xb')]){if(this[_0xd3e4('0xb')][_0xd3e4('0x37')](_0x3c79f9)){if(this[_0xd3e4('0xb')][_0x3c79f9][_0xd3e4('0x38')]){_0xbb425a=this['checkTrigger'](this[_0xd3e4('0xb')][_0x3c79f9],_0x3458c2);if(_0xbb425a){_['merge'](_0x3458c2,_0x3458c2['variables']);for(var _0x267d11=0x0,_0x518363,_0x33134b,_0x52f496;_0x267d110x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','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','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x3ac549,_0x1d4f07){var _0x4226f4=function(_0x2d3b83){while(--_0x2d3b83){_0x3ac549['push'](_0x3ac549['shift']());}};_0x4226f4(++_0x1d4f07);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ 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 c8a19c9..62fc2ac 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 _0x8f41=['toLowerCase','calleridnum','telephone1','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','toUpperCase',']\x20Enduser\x20created!','string','picklist','type','nameField','customField','idField','indexOf','content','incident','incidents','getString','Subjects','/contacts(','Fields','ticketType','phonecall','/systemusers(','queue','callDirection','Descriptions','odata-entityid','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingFormat','Recording\x20is\x20enabled!','recordingURL','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error','lodash','request-promise','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','modernAuthentication','remoteUri','CloudProvider','data7','data2','resolve','POST','clientId','username','password','then','access_token','catch',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','userEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','destcalleridnum','contacts','4.0','body','headers','substring','lastIndexOf','enduserId'];(function(_0x3e7a79,_0x3aba6a){var _0xfb7240=function(_0x3e4eb6){while(--_0x3e4eb6){_0x3e7a79['push'](_0x3e7a79['shift']());}};_0xfb7240(++_0x3aba6a);}(_0x8f41,0x1e0));var _0x18f4=function(_0x31b936,_0x1a05a6){_0x31b936=_0x31b936-0x0;var _0x5d5f19=_0x8f41[_0x31b936];return _0x5d5f19;};'use strict';var _=require(_0x18f4('0x0'));var rp=require(_0x18f4('0x1'));var util=require(_0x18f4('0x2'));var intUtil=require(_0x18f4('0x3'));var md5=require(_0x18f4('0x4'));var Redis=require('ioredis');var logger=require(_0x18f4('0x5'))(_0x18f4('0x6'));var config=require(_0x18f4('0x7'));config[_0x18f4('0x8')]=_[_0x18f4('0x9')](config['redis'],{'host':_0x18f4('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAuthToken(_0x1b44f1,_0xc85e06,_0x8d2392){if(_0x1b44f1[_0x18f4('0xb')]){_0x1b44f1[_0x18f4('0xc')]=_0x1b44f1[_0x18f4('0xd')][_0x18f4('0xe')];_0x1b44f1['tenantId']=_0x1b44f1['CloudProvider'][_0x18f4('0xf')];return Promise[_0x18f4('0x10')](_0x1b44f1['CloudProvider']['data5']);}var _0x4e8601={'method':_0x18f4('0x11'),'uri':_0xc85e06,'form':{'client_id':_0x1b44f1[_0x18f4('0x12')],'resource':_0x1b44f1['remoteUri'],'username':_0x1b44f1[_0x18f4('0x13')],'password':_0x1b44f1[_0x18f4('0x14')],'grant_type':_0x18f4('0x14'),'client_secret':_0x1b44f1['clientSecret']},'json':!![]};return rp(_0x4e8601)[_0x18f4('0x15')](function(_0x3c4fd4){return _0x3c4fd4[_0x18f4('0x16')];})[_0x18f4('0x17')](function(_0x5ec0d3){logger['error']('['+[_0x8d2392['toUpperCase']()]+_0x18f4('0x18'));return _0x5ec0d3[_0x18f4('0x19')];});}function getUser(_0x39a30c,_0x1ed6d6,_0x218d5d,_0x3e1c82,_0x3fe5ff,_0x2e9ddd){return new Promise(function(_0x8300dc,_0x53d14b){return getAuthToken(_0x1ed6d6,_0x3e1c82,_0x2e9ddd)[_0x18f4('0x15')](function(_0x23bd5f){var _0x4fbc51={'method':_0x18f4('0x1a'),'uri':_0x3fe5ff+_0x18f4('0x1b'),'headers':{'Authorization':_0x18f4('0x1c')+_0x23bd5f,'OData-Version':'4.0'},'json':!![]};return rp(_0x4fbc51);})['then'](function(_0x35eee2){var _0x5eb01c=_0x35eee2[_0x18f4('0x1d')];var _0x592616=![];var _0x251e04=null;if(!_[_0x18f4('0x1e')](_0x218d5d)){if(intUtil[_0x18f4('0x1f')](_0x218d5d['email'])){_0x39a30c[_0x18f4('0x20')]=_0x218d5d[_0x18f4('0x21')];for(_0x251e04=0x0;_0x251e04<_0x5eb01c[_0x18f4('0x22')];_0x251e04++){if(_0x5eb01c[_0x251e04][_0x18f4('0x23')]===_0x218d5d[_0x18f4('0x21')]&&!_0x5eb01c[_0x251e04][_0x18f4('0x24')]){_0x592616=!![];logger[_0x18f4('0x25')]('['+[_0x2e9ddd['toUpperCase']()]+_0x18f4('0x26')+_0x5eb01c[_0x251e04][_0x18f4('0x27')]+'!');_0x39a30c['userId']=_0x5eb01c[_0x251e04][_0x18f4('0x27')];}}}}if(!_0x592616){logger[_0x18f4('0x25')]('['+[_0x2e9ddd['toUpperCase']()]+_0x18f4('0x28'));_0x39a30c[_0x18f4('0x20')]=_0x1ed6d6[_0x18f4('0x13')];for(_0x251e04=0x0;_0x251e04<_0x5eb01c[_0x18f4('0x22')];_0x251e04++){if(_0x5eb01c[_0x251e04][_0x18f4('0x23')]===_0x1ed6d6[_0x18f4('0x13')]){_0x39a30c[_0x18f4('0x29')]=_0x5eb01c[_0x251e04]['systemuserid'];}}}_0x8300dc(_0x39a30c);})['catch'](function(_0x147718){_0x53d14b(_0x147718['message']);});});}function createEndUser(_0x1e4c68,_0x55ab89,_0x4d0564,_0x583f80,_0x15da91,_0x45d8a4,_0x187d57){return new Promise(function(_0x325710,_0x5c98b8){return getAuthToken(_0x55ab89,_0x4d0564,_0x45d8a4)[_0x18f4('0x15')](function(_0xb277c7){var _0x161a28=_0x45d8a4['toLowerCase']()==='outbound'?_0x15da91[_0x18f4('0x2a')]:_0x15da91['calleridnum'];var _0x56512a={'method':'POST','uri':_0x583f80+_0x18f4('0x2b'),'body':{'fullname':_0x161a28,'firstname':_0x161a28,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x1e4c68[_0x18f4('0x29')]+')'},'headers':{'Authorization':_0x18f4('0x1c')+_0xb277c7,'OData-Version':_0x18f4('0x2c')},'json':!![],'resolveWithFullResponse':!![]};_0x56512a[_0x18f4('0x2d')][_0x187d57]=_0x161a28;return rp(_0x56512a);})[_0x18f4('0x15')](function(_0x1ad22c){var _0xa848ae=_0x1ad22c[_0x18f4('0x2e')]['odata-entityid'];var _0x453873=_0xa848ae[_0x18f4('0x2f')](_0xa848ae[_0x18f4('0x30')]('(')+0x1,_0xa848ae[_0x18f4('0x30')](')'));_0x1e4c68[_0x18f4('0x31')]=_0x453873;_0x325710(_0x1e4c68);})[_0x18f4('0x17')](function(_0x152308){_0x5c98b8(_0x152308['message']);});});}function getEndUser(_0x4ae52e,_0x2f611a,_0x2970de,_0x1d42ea,_0x56a633,_0x5cd0af,_0x28f72b,_0x290d74){var _0x530a03=_0x5cd0af[_0x18f4('0x32')]()==='outbound'?_0x56a633[_0x18f4('0x2a')]:_0x56a633[_0x18f4('0x33')];return getAuthToken(_0x2f611a,_0x2970de,_0x5cd0af)['then'](function(_0x47533b){_0x290d74=_0x290d74?_0x290d74:_0x18f4('0x34');var _0x1e4865={'method':_0x18f4('0x1a'),'uri':_0x1d42ea+'contacts?$select='+_0x290d74+'&$filter='+_0x290d74+_0x18f4('0x35')+_0x530a03[_0x18f4('0x36')]('+',_0x18f4('0x37'))+'\x27','headers':{'Authorization':_0x18f4('0x1c')+_0x47533b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1e4865);})['then'](function(_0x41b163){var _0x186648=![];if(!_0x41b163)return _0x186648;var _0x4ad808=_0x41b163[_0x18f4('0x1d')];for(var _0x3ef924=0x0;_0x3ef924<_0x4ad808[_0x18f4('0x22')];_0x3ef924++){if(_0x4ad808[_0x3ef924][_0x290d74]===_0x530a03){_0x186648=!![];_0x4ae52e['enduserId']=_0x4ad808[_0x3ef924][_0x18f4('0x38')];}}return _0x186648;})[_0x18f4('0x15')](function(_0x6c7429){if(_0x6c7429)return _0x4ae52e;if(_0x28f72b===_0x18f4('0x39')){logger[_0x18f4('0x25')]('['+[_0x5cd0af['toUpperCase']()]+_0x18f4('0x3a'));return _0x4ae52e;}return createEndUser(_0x4ae52e,_0x2f611a,_0x2970de,_0x1d42ea,_0x56a633,_0x5cd0af,_0x290d74)['then'](function(_0x48ac34){logger[_0x18f4('0x25')]('['+[_0x5cd0af[_0x18f4('0x3b')]()]+_0x18f4('0x3c'),_0x48ac34['enduserId']);return _0x48ac34;});});}function getCustomFields(_0x42e88d,_0xc23f52,_0xd0efc0){var _0x1d5669={};if(_0x42e88d[_0x18f4('0x22')]>0x0){_['forEach'](_0x42e88d,function(_0x18a5ef){if(_['includes']([_0x18f4('0x3d'),_0x18f4('0x3e')],_0x18a5ef[_0x18f4('0x3f')])&&_0x18a5ef[_0x18f4('0x40')]&&!_0x18a5ef[_0x18f4('0x41')]){var _0x317084=_0x18a5ef[_0x18f4('0x42')][_0x18f4('0x32')]();var _0x51a100=_0x317084[_0x18f4('0x2f')](0x0,_0x317084[_0x18f4('0x43')]('_'));var _0x5b8fad=_0x317084['substring'](_0x317084[_0x18f4('0x43')]('_')+0x1);if(_0x51a100===_0xd0efc0){_0x1d5669[_0x5b8fad]=_0x18a5ef[_0x18f4('0x44')];}}});}return _0x1d5669;}function getTicket(_0x19956e,_0x10feb7,_0x192b7e,_0x44e914,_0x4e0b89,_0x45b3e0,_0x568362){return new Promise(function(_0x31c061,_0x4915a9){var _0x12f9e3;return getAuthToken(_0x10feb7,_0x192b7e,_0x568362)[_0x18f4('0x15')](function(_0x4635a7){if(_0x45b3e0['ticketType']===_0x18f4('0x45')){_0x12f9e3={'method':_0x18f4('0x11'),'uri':_0x44e914+_0x18f4('0x46'),'body':Object['assign']({},{'title':intUtil[_0x18f4('0x47')](_0x45b3e0[_0x18f4('0x48')],_0x4e0b89,'\x20'),'description':intUtil[_0x18f4('0x47')](_0x45b3e0['Descriptions'],_0x4e0b89,'\x0a'),'customerid_contact@odata.bind':_0x19956e[_0x18f4('0x31')]?_0x18f4('0x49')+_0x19956e[_0x18f4('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x19956e[_0x18f4('0x29')]+')','caseorigincode':'1'},getCustomFields(_0x45b3e0[_0x18f4('0x4a')],_0x4e0b89,_0x45b3e0[_0x18f4('0x4b')])),'headers':{'Authorization':_0x18f4('0x1c')+_0x4635a7,'OData-Version':_0x18f4('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x45b3e0[_0x18f4('0x4b')]===_0x18f4('0x4c')){var _0x52df25=_0x19956e[_0x18f4('0x31')]?[{'partyid_systemuser@odata.bind':_0x18f4('0x4d')+_0x19956e[_0x18f4('0x29')]+')','participationtypemask':_0x19956e['callDirection']===_0x18f4('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x19956e[_0x18f4('0x31')]+')','participationtypemask':_0x19956e[_0x18f4('0x4f')]===_0x18f4('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x19956e[_0x18f4('0x29')]+')','participationtypemask':_0x19956e[_0x18f4('0x4f')]===_0x18f4('0x4e')?0x2:0x1}];_0x12f9e3={'method':_0x18f4('0x11'),'uri':_0x44e914+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0x18f4('0x47')](_0x45b3e0[_0x18f4('0x48')],_0x4e0b89,'\x20'),'phonenumber':String(_0x4e0b89[_0x18f4('0x33')]),'description':intUtil['getString'](_0x45b3e0[_0x18f4('0x50')],_0x4e0b89,'\x0a'),'regardingobjectid_contact@odata.bind':_0x19956e[_0x18f4('0x31')]?_0x18f4('0x49')+_0x19956e[_0x18f4('0x31')]+')':undefined,'ownerid@odata.bind':_0x18f4('0x4d')+_0x19956e[_0x18f4('0x29')]+')','directioncode':_0x19956e['callDirection']===_0x18f4('0x4e')?![]:!![],'phonecall_activity_parties':_0x52df25},getCustomFields(_0x45b3e0['Fields'],_0x4e0b89,_0x45b3e0[_0x18f4('0x4b')])),'headers':{'Authorization':_0x18f4('0x1c')+_0x4635a7,'OData-Version':_0x18f4('0x2c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x12f9e3);})[_0x18f4('0x15')](function(_0x4481ce){var _0x292eff=_0x4481ce['headers'][_0x18f4('0x51')];var _0x4310eb=_0x292eff[_0x18f4('0x2f')](_0x292eff[_0x18f4('0x30')]('(')+0x1,_0x292eff[_0x18f4('0x30')](')'));_0x19956e[_0x18f4('0x52')]=_0x4310eb;_0x31c061(_0x19956e);})['catch'](function(_0x8b38a4){_0x4915a9(_0x8b38a4[_0x18f4('0x19')]);});});}function emit(_0x12f84c,_0x41cbd2,_0x290f9b,_0x2173e0){var _0x1be829={'uri':util['format'](_0x18f4('0x53'),_0x12f84c,_0x290f9b,_0x2173e0)};io['to'](util[_0x18f4('0x54')](_0x18f4('0x55'),_0x41cbd2))['emit'](_0x18f4('0x56'),_0x1be829);}exports['cs']=function(_0x5b7460,_0x59db3c,_0x3cce88,_0xe65379,_0x3528b1,_0x472b93,_0x4eedbb,_0x3e0af5){var _0x10f3ff={};_0x472b93[_0x18f4('0xc')]=_0x472b93['modernAuthentication']?intUtil[_0x18f4('0x57')](_0x472b93[_0x18f4('0xd')]['data7']):intUtil[_0x18f4('0x57')](_0x472b93['remoteUri']);_0x472b93[_0x18f4('0x58')]=intUtil[_0x18f4('0x57')](_0x472b93[_0x18f4('0x58')]);_0x10f3ff['callDirection']=_0x3e0af5==='queue'||_0x3e0af5===_0x18f4('0x59')?'queue':'outbound';var _0x2a2e54=_0x472b93[_0x18f4('0xb')]?util[_0x18f4('0x54')](_0x18f4('0x5a'),_0x472b93[_0x18f4('0xd')][_0x18f4('0xe')]):util[_0x18f4('0x54')]('%s/api/data/v9.0/',_0x472b93['remoteUri']);var _0x2080d3=util['format'](_0x18f4('0x5b'),_0x472b93[_0x18f4('0x5c')]);var _0x1f28f8=util['format'](_0x18f4('0x5d'),_0x472b93[_0x18f4('0x58')],_0x59db3c[_0x18f4('0x5e')],md5(_0x59db3c[_0x18f4('0x5e')]));if(_0x3528b1&&_0x3528b1['monitor_format']){logger[_0x18f4('0x25')](_0x18f4('0x5f'),'Recording\x20is\x20enabled!');_0x59db3c['recordingURL']=_0x1f28f8;}else if(_0x4eedbb&&_0x4eedbb[_0x18f4('0x60')]&&_0x4eedbb[_0x18f4('0x60')]!=='none'){logger[_0x18f4('0x25')]('[OUTBOUND]',_0x18f4('0x61'));_0x59db3c[_0x18f4('0x62')]=_0x1f28f8;}else{_0x59db3c[_0x18f4('0x62')]='';}return getUser(_0x10f3ff,_0x472b93,_0xe65379,_0x2080d3,_0x2a2e54,_0x3e0af5)[_0x18f4('0x15')](function(_0x5e0c21){logger[_0x18f4('0x25')]('['+_0x3e0af5[_0x18f4('0x3b')]()+']\x20The\x20User\x20ID\x20is:',_0x5e0c21[_0x18f4('0x29')]);logger[_0x18f4('0x25')]('['+_0x3e0af5[_0x18f4('0x3b')]()+']\x20The\x20User\x20email\x20is:',_0x5e0c21['userEmail']);return getEndUser(_0x5e0c21,_0x472b93,_0x2080d3,_0x2a2e54,_0x59db3c,_0x3e0af5,_0x3cce88[_0x18f4('0x63')],_0x3cce88['additionalSearchContact']);})[_0x18f4('0x15')](function(_0x289599){logger[_0x18f4('0x25')]('['+_0x3e0af5[_0x18f4('0x3b')]()+_0x18f4('0x64'),_0x289599[_0x18f4('0x31')]);logger['info']('['+_0x3e0af5[_0x18f4('0x3b')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x59db3c[_0x18f4('0x33')]);return getTicket(_0x289599,_0x472b93,_0x2080d3,_0x2a2e54,_0x59db3c,_0x3cce88,_0x3e0af5);})[_0x18f4('0x15')](function(_0x710183){logger[_0x18f4('0x25')](util[_0x18f4('0x54')]('['+_0x3e0af5[_0x18f4('0x3b')]()+_0x18f4('0x65'),_0x3cce88[_0x18f4('0x4b')],_0x710183[_0x18f4('0x52')]));logger['info'](util[_0x18f4('0x54')]('['+_0x3e0af5['toUpperCase']()+_0x18f4('0x66'),_0x3e0af5));if(_0x3e0af5!==_0x18f4('0x59')&&_0x3cce88['openNewTab']){logger['info']('['+_0x3e0af5[_0x18f4('0x3b')]()+']',_0x18f4('0x67'));emit(_0x472b93['remoteUri'],_0xe65379[_0x18f4('0x68')],_0x3cce88[_0x18f4('0x4b')],_0x710183[_0x18f4('0x52')]);}})[_0x18f4('0x17')](function(_0x289de7){logger[_0x18f4('0x69')]('['+_0x3e0af5[_0x18f4('0x3b')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x289de7[_0x18f4('0x19')]);console['error']('Error\x20running\x20Dynamics365\x20integration',_0x289de7);});}; \ No newline at end of file +var _0xb2a2=['body','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','outbound','calleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','value','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','string','type','nameField','customField','idField','indexOf','content','ticketType','getString','Descriptions','/contacts(','Fields','phonecall','queue','callDirection','phonecalls','assign','ticketId','format','user:%s','data7','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','request-promise','util','./util','md5','../../../../config/logger','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','CloudProvider','tenantId','resolve','data5','POST','clientId','remoteUri','username','password','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','contacts','/systemusers(','4.0'];(function(_0xee37f1,_0x189f43){var _0x37fd54=function(_0x3c8109){while(--_0x3c8109){_0xee37f1['push'](_0xee37f1['shift']());}};_0x37fd54(++_0x189f43);}(_0xb2a2,0x9f));var _0x2b2a=function(_0x28c617,_0x5520b4){_0x28c617=_0x28c617-0x0;var _0x1181ed=_0xb2a2[_0x28c617];return _0x1181ed;};'use strict';var _=require('lodash');var rp=require(_0x2b2a('0x0'));var util=require(_0x2b2a('0x1'));var intUtil=require(_0x2b2a('0x2'));var md5=require(_0x2b2a('0x3'));var Redis=require('ioredis');var logger=require(_0x2b2a('0x4'))('dynamics365');var config=require(_0x2b2a('0x5'));config[_0x2b2a('0x6')]=_['defaults'](config['redis'],{'host':_0x2b2a('0x7'),'port':0x18eb});var io=require(_0x2b2a('0x8'))(new Redis(config[_0x2b2a('0x6')]));function getAuthToken(_0x5b82fc,_0x527d88,_0x4acdc8){if(_0x5b82fc[_0x2b2a('0x9')]){_0x5b82fc['remoteUri']=_0x5b82fc[_0x2b2a('0xa')]['data7'];_0x5b82fc[_0x2b2a('0xb')]=_0x5b82fc[_0x2b2a('0xa')]['data2'];return Promise[_0x2b2a('0xc')](_0x5b82fc[_0x2b2a('0xa')][_0x2b2a('0xd')]);}var _0xf6597a={'method':_0x2b2a('0xe'),'uri':_0x527d88,'form':{'client_id':_0x5b82fc[_0x2b2a('0xf')],'resource':_0x5b82fc[_0x2b2a('0x10')],'username':_0x5b82fc[_0x2b2a('0x11')],'password':_0x5b82fc[_0x2b2a('0x12')],'grant_type':_0x2b2a('0x12'),'client_secret':_0x5b82fc['clientSecret']},'json':!![]};return rp(_0xf6597a)[_0x2b2a('0x13')](function(_0x4ebc33){return _0x4ebc33[_0x2b2a('0x14')];})[_0x2b2a('0x15')](function(_0x4ccce2){logger[_0x2b2a('0x16')]('['+[_0x4acdc8['toUpperCase']()]+_0x2b2a('0x17'));return _0x4ccce2[_0x2b2a('0x18')];});}function getUser(_0x47a823,_0x58506a,_0x3f7bdd,_0x52a697,_0x505bbb,_0x5e53a0){return new Promise(function(_0x161149,_0x42aa5f){return getAuthToken(_0x58506a,_0x52a697,_0x5e53a0)[_0x2b2a('0x13')](function(_0x2d35a7){var _0x214ecc={'method':_0x2b2a('0x19'),'uri':_0x505bbb+_0x2b2a('0x1a'),'headers':{'Authorization':_0x2b2a('0x1b')+_0x2d35a7,'OData-Version':'4.0'},'json':!![]};return rp(_0x214ecc);})[_0x2b2a('0x13')](function(_0x3ec1d9){var _0x30de22=_0x3ec1d9['value'];var _0x8d7020=![];var _0x576307=null;if(!_['isNil'](_0x3f7bdd)){if(intUtil[_0x2b2a('0x1c')](_0x3f7bdd[_0x2b2a('0x1d')])){_0x47a823[_0x2b2a('0x1e')]=_0x3f7bdd['email'];for(_0x576307=0x0;_0x576307<_0x30de22[_0x2b2a('0x1f')];_0x576307++){if(_0x30de22[_0x576307][_0x2b2a('0x20')]===_0x3f7bdd[_0x2b2a('0x1d')]&&!_0x30de22[_0x576307][_0x2b2a('0x21')]){_0x8d7020=!![];logger[_0x2b2a('0x22')]('['+[_0x5e53a0[_0x2b2a('0x23')]()]+_0x2b2a('0x24')+_0x30de22[_0x576307]['systemuserid']+'!');_0x47a823[_0x2b2a('0x25')]=_0x30de22[_0x576307][_0x2b2a('0x26')];}}}}if(!_0x8d7020){logger['info']('['+[_0x5e53a0[_0x2b2a('0x23')]()]+_0x2b2a('0x27'));_0x47a823[_0x2b2a('0x1e')]=_0x58506a['username'];for(_0x576307=0x0;_0x576307<_0x30de22[_0x2b2a('0x1f')];_0x576307++){if(_0x30de22[_0x576307]['internalemailaddress']===_0x58506a['username']){_0x47a823[_0x2b2a('0x25')]=_0x30de22[_0x576307][_0x2b2a('0x26')];}}}_0x161149(_0x47a823);})[_0x2b2a('0x15')](function(_0x308343){_0x42aa5f(_0x308343[_0x2b2a('0x18')]);});});}function createEndUser(_0x169bc3,_0x3419ab,_0x368d2d,_0x200bda,_0x4eef43,_0x564289,_0x10e6d5){return new Promise(function(_0x53020c,_0x34d765){return getAuthToken(_0x3419ab,_0x368d2d,_0x564289)[_0x2b2a('0x13')](function(_0x547c14){var _0x5e9319=_0x564289['toLowerCase']()==='outbound'?_0x4eef43['destcalleridnum']:_0x4eef43['calleridnum'];var _0x2e5d04={'method':_0x2b2a('0xe'),'uri':_0x200bda+_0x2b2a('0x28'),'body':{'fullname':_0x5e9319,'firstname':_0x5e9319,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2b2a('0x29')+_0x169bc3[_0x2b2a('0x25')]+')'},'headers':{'Authorization':_0x2b2a('0x1b')+_0x547c14,'OData-Version':_0x2b2a('0x2a')},'json':!![],'resolveWithFullResponse':!![]};_0x2e5d04[_0x2b2a('0x2b')][_0x10e6d5]=_0x5e9319;return rp(_0x2e5d04);})[_0x2b2a('0x13')](function(_0x370393){var _0x2706cf=_0x370393[_0x2b2a('0x2c')][_0x2b2a('0x2d')];var _0x4a3e28=_0x2706cf[_0x2b2a('0x2e')](_0x2706cf[_0x2b2a('0x2f')]('(')+0x1,_0x2706cf['lastIndexOf'](')'));_0x169bc3[_0x2b2a('0x30')]=_0x4a3e28;_0x53020c(_0x169bc3);})[_0x2b2a('0x15')](function(_0x5c0340){_0x34d765(_0x5c0340[_0x2b2a('0x18')]);});});}function getEndUser(_0x2a301b,_0x58b551,_0x66e18a,_0x22d309,_0x47a1f2,_0x4856ff,_0x443e01,_0x43a433){var _0x15f56c=_0x4856ff[_0x2b2a('0x31')]()===_0x2b2a('0x32')?_0x47a1f2['destcalleridnum']:_0x47a1f2[_0x2b2a('0x33')];return getAuthToken(_0x58b551,_0x66e18a,_0x4856ff)[_0x2b2a('0x13')](function(_0x4d238e){_0x43a433=_0x43a433?_0x43a433:_0x2b2a('0x34');var _0x209883={'method':_0x2b2a('0x19'),'uri':_0x22d309+_0x2b2a('0x35')+_0x43a433+_0x2b2a('0x36')+_0x43a433+_0x2b2a('0x37')+_0x15f56c[_0x2b2a('0x38')]('+',_0x2b2a('0x39'))+'\x27','headers':{'Authorization':_0x2b2a('0x1b')+_0x4d238e,'If-None-Match':null,'OData-Version':_0x2b2a('0x2a')},'json':!![]};return rp(_0x209883);})[_0x2b2a('0x13')](function(_0x5012f5){var _0x513a57=![];if(!_0x5012f5)return _0x513a57;var _0x47be09=_0x5012f5[_0x2b2a('0x3a')];for(var _0x3f5c25=0x0;_0x3f5c25<_0x47be09[_0x2b2a('0x1f')];_0x3f5c25++){if(_0x47be09[_0x3f5c25][_0x43a433]===_0x15f56c){_0x513a57=!![];_0x2a301b[_0x2b2a('0x30')]=_0x47be09[_0x3f5c25][_0x2b2a('0x3b')];}}return _0x513a57;})[_0x2b2a('0x13')](function(_0x627158){if(_0x627158)return _0x2a301b;if(_0x443e01==='nothing'){logger[_0x2b2a('0x22')]('['+[_0x4856ff[_0x2b2a('0x23')]()]+_0x2b2a('0x3c'));return _0x2a301b;}return createEndUser(_0x2a301b,_0x58b551,_0x66e18a,_0x22d309,_0x47a1f2,_0x4856ff,_0x43a433)['then'](function(_0x54e469){logger['info']('['+[_0x4856ff['toUpperCase']()]+_0x2b2a('0x3d'),_0x54e469[_0x2b2a('0x30')]);return _0x54e469;});});}function getCustomFields(_0x453cb4,_0x30e6dc,_0x2e2ab0){var _0x22d35a={};if(_0x453cb4[_0x2b2a('0x1f')]>0x0){_['forEach'](_0x453cb4,function(_0x2af0ae){if(_['includes']([_0x2b2a('0x3e'),'picklist'],_0x2af0ae[_0x2b2a('0x3f')])&&_0x2af0ae[_0x2b2a('0x40')]&&!_0x2af0ae[_0x2b2a('0x41')]){var _0x2f62c9=_0x2af0ae[_0x2b2a('0x42')][_0x2b2a('0x31')]();var _0xf22a9d=_0x2f62c9[_0x2b2a('0x2e')](0x0,_0x2f62c9[_0x2b2a('0x43')]('_'));var _0x4d938a=_0x2f62c9['substring'](_0x2f62c9[_0x2b2a('0x43')]('_')+0x1);if(_0xf22a9d===_0x2e2ab0){_0x22d35a[_0x4d938a]=_0x2af0ae[_0x2b2a('0x44')];}}});}return _0x22d35a;}function getTicket(_0x47d6d5,_0x53729b,_0x4a4cbc,_0x413b0d,_0x277d06,_0x279b28,_0xe78c4c){return new Promise(function(_0x331715,_0x29dba6){var _0x47bd6c;return getAuthToken(_0x53729b,_0x4a4cbc,_0xe78c4c)[_0x2b2a('0x13')](function(_0x3dd848){if(_0x279b28[_0x2b2a('0x45')]==='incident'){_0x47bd6c={'method':'POST','uri':_0x413b0d+'incidents','body':Object['assign']({},{'title':intUtil[_0x2b2a('0x46')](_0x279b28['Subjects'],_0x277d06,'\x20'),'description':intUtil[_0x2b2a('0x46')](_0x279b28[_0x2b2a('0x47')],_0x277d06,'\x0a'),'customerid_contact@odata.bind':_0x47d6d5[_0x2b2a('0x30')]?_0x2b2a('0x48')+_0x47d6d5[_0x2b2a('0x30')]+')':undefined,'ownerid@odata.bind':_0x2b2a('0x29')+_0x47d6d5['userId']+')','caseorigincode':'1'},getCustomFields(_0x279b28[_0x2b2a('0x49')],_0x277d06,_0x279b28['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x3dd848,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x279b28[_0x2b2a('0x45')]===_0x2b2a('0x4a')){var _0x14015f=_0x47d6d5[_0x2b2a('0x30')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x47d6d5[_0x2b2a('0x25')]+')','participationtypemask':_0x47d6d5['callDirection']===_0x2b2a('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':_0x2b2a('0x48')+_0x47d6d5[_0x2b2a('0x30')]+')','participationtypemask':_0x47d6d5['callDirection']===_0x2b2a('0x4b')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x2b2a('0x29')+_0x47d6d5[_0x2b2a('0x25')]+')','participationtypemask':_0x47d6d5[_0x2b2a('0x4c')]===_0x2b2a('0x4b')?0x2:0x1}];_0x47bd6c={'method':_0x2b2a('0xe'),'uri':_0x413b0d+_0x2b2a('0x4d'),'body':Object[_0x2b2a('0x4e')]({},{'subject':intUtil['getString'](_0x279b28['Subjects'],_0x277d06,'\x20'),'phonenumber':String(_0x277d06[_0x2b2a('0x33')]),'description':intUtil[_0x2b2a('0x46')](_0x279b28[_0x2b2a('0x47')],_0x277d06,'\x0a'),'regardingobjectid_contact@odata.bind':_0x47d6d5[_0x2b2a('0x30')]?_0x2b2a('0x48')+_0x47d6d5[_0x2b2a('0x30')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x47d6d5[_0x2b2a('0x25')]+')','directioncode':_0x47d6d5['callDirection']===_0x2b2a('0x4b')?![]:!![],'phonecall_activity_parties':_0x14015f},getCustomFields(_0x279b28['Fields'],_0x277d06,_0x279b28[_0x2b2a('0x45')])),'headers':{'Authorization':_0x2b2a('0x1b')+_0x3dd848,'OData-Version':_0x2b2a('0x2a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x47bd6c);})[_0x2b2a('0x13')](function(_0x1724b1){var _0x365331=_0x1724b1[_0x2b2a('0x2c')][_0x2b2a('0x2d')];var _0x4bf137=_0x365331[_0x2b2a('0x2e')](_0x365331['lastIndexOf']('(')+0x1,_0x365331[_0x2b2a('0x2f')](')'));_0x47d6d5[_0x2b2a('0x4f')]=_0x4bf137;_0x331715(_0x47d6d5);})[_0x2b2a('0x15')](function(_0x198efa){_0x29dba6(_0x198efa[_0x2b2a('0x18')]);});});}function emit(_0x5290f1,_0x198326,_0x164284,_0x4911d6){var _0x2cef8b={'uri':util[_0x2b2a('0x50')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x5290f1,_0x164284,_0x4911d6)};io['to'](util['format'](_0x2b2a('0x51'),_0x198326))['emit']('trigger:browser:url',_0x2cef8b);}exports['cs']=function(_0x7b5a73,_0x34b910,_0x50cf39,_0xeb001a,_0x284e9b,_0xb0d87b,_0x29b191,_0x121be1){var _0x43182b={};_0xb0d87b[_0x2b2a('0x10')]=_0xb0d87b[_0x2b2a('0x9')]?intUtil['stripTrailingSlash'](_0xb0d87b[_0x2b2a('0xa')][_0x2b2a('0x52')]):intUtil[_0x2b2a('0x53')](_0xb0d87b[_0x2b2a('0x10')]);_0xb0d87b[_0x2b2a('0x54')]=intUtil[_0x2b2a('0x53')](_0xb0d87b[_0x2b2a('0x54')]);_0x43182b[_0x2b2a('0x4c')]=_0x121be1===_0x2b2a('0x4b')||_0x121be1==='unmanaged'?_0x2b2a('0x4b'):_0x2b2a('0x32');var _0x33f0cd=_0xb0d87b[_0x2b2a('0x9')]?util[_0x2b2a('0x50')](_0x2b2a('0x55'),_0xb0d87b['CloudProvider'][_0x2b2a('0x52')]):util['format'](_0x2b2a('0x55'),_0xb0d87b[_0x2b2a('0x10')]);var _0x9d0bf0=util[_0x2b2a('0x50')](_0x2b2a('0x56'),_0xb0d87b[_0x2b2a('0xb')]);var _0x3fd98b=util[_0x2b2a('0x50')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xb0d87b['serverUrl'],_0x34b910[_0x2b2a('0x57')],md5(_0x34b910[_0x2b2a('0x57')]));if(_0x284e9b&&_0x284e9b[_0x2b2a('0x58')]){logger[_0x2b2a('0x22')](_0x2b2a('0x59'),_0x2b2a('0x5a'));_0x34b910[_0x2b2a('0x5b')]=_0x3fd98b;}else if(_0x29b191&&_0x29b191[_0x2b2a('0x5c')]&&_0x29b191['recordingFormat']!==_0x2b2a('0x5d')){logger[_0x2b2a('0x22')]('[OUTBOUND]',_0x2b2a('0x5a'));_0x34b910[_0x2b2a('0x5b')]=_0x3fd98b;}else{_0x34b910[_0x2b2a('0x5b')]='';}return getUser(_0x43182b,_0xb0d87b,_0xeb001a,_0x9d0bf0,_0x33f0cd,_0x121be1)[_0x2b2a('0x13')](function(_0x52a692){logger[_0x2b2a('0x22')]('['+_0x121be1[_0x2b2a('0x23')]()+']\x20The\x20User\x20ID\x20is:',_0x52a692[_0x2b2a('0x25')]);logger[_0x2b2a('0x22')]('['+_0x121be1['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x52a692['userEmail']);return getEndUser(_0x52a692,_0xb0d87b,_0x9d0bf0,_0x33f0cd,_0x34b910,_0x121be1,_0x50cf39[_0x2b2a('0x5e')],_0x50cf39[_0x2b2a('0x5f')]);})[_0x2b2a('0x13')](function(_0x5c533b){logger[_0x2b2a('0x22')]('['+_0x121be1[_0x2b2a('0x23')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x5c533b[_0x2b2a('0x30')]);logger['info']('['+_0x121be1['toUpperCase']()+_0x2b2a('0x60'),_0x34b910[_0x2b2a('0x33')]);return getTicket(_0x5c533b,_0xb0d87b,_0x9d0bf0,_0x33f0cd,_0x34b910,_0x50cf39,_0x121be1);})[_0x2b2a('0x13')](function(_0x444dab){logger['info'](util['format']('['+_0x121be1[_0x2b2a('0x23')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x50cf39[_0x2b2a('0x45')],_0x444dab[_0x2b2a('0x4f')]));logger['info'](util[_0x2b2a('0x50')]('['+_0x121be1[_0x2b2a('0x23')]()+_0x2b2a('0x61'),_0x121be1));if(_0x121be1!==_0x2b2a('0x62')&&_0x50cf39[_0x2b2a('0x63')]){logger[_0x2b2a('0x22')]('['+_0x121be1[_0x2b2a('0x23')]()+']',_0x2b2a('0x64'));emit(_0xb0d87b[_0x2b2a('0x10')],_0xeb001a['name'],_0x50cf39['ticketType'],_0x444dab[_0x2b2a('0x4f')]);}})[_0x2b2a('0x15')](function(_0x111259){logger[_0x2b2a('0x16')]('['+_0x121be1[_0x2b2a('0x23')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x111259[_0x2b2a('0x18')]);console[_0x2b2a('0x16')]('Error\x20running\x20Dynamics365\x20integration',_0x111259);});}; \ 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 bf6fb04..7c9fd3e 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 _0xa304=['keyBy','value','remoteUri','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','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','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','idField','type','variableName','customVariable','Variable','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','serverUrl','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','calleridname','lastevent','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues'];(function(_0x5d1545,_0x313ea0){var _0x1a3cf2=function(_0x21c8b3){while(--_0x21c8b3){_0x5d1545['push'](_0x5d1545['shift']());}};_0x1a3cf2(++_0x313ea0);}(_0xa304,0x1ca));var _0x4a30=function(_0x2dc7c9,_0x3a15f8){_0x2dc7c9=_0x2dc7c9-0x0;var _0x3e6536=_0xa304[_0x2dc7c9];return _0x3e6536;};'use strict';var _=require(_0x4a30('0x0'));var rp=require(_0x4a30('0x1'));var md5=require(_0x4a30('0x2'));var util=require(_0x4a30('0x3'));var Redis=require('ioredis');var intUtil=require(_0x4a30('0x4'));var config=require(_0x4a30('0x5'));var logger=require(_0x4a30('0x6'))(_0x4a30('0x7'));config[_0x4a30('0x8')]=_[_0x4a30('0x9')](config['redis'],{'host':_0x4a30('0xa'),'port':0x18eb});var io=require(_0x4a30('0xb'))(new Redis(config['redis']));var headers={'Content-Type':_0x4a30('0xc'),'Accept':_0x4a30('0xc')};function emit(_0x3fff48,_0x58f359,_0x581f98){io['to'](_0x3fff48)['emit'](_0x58f359,_0x581f98);}function getTicket(_0x3f1062,_0x3554ca,_0x383434,_0x390bd5,_0x13d3bc){logger[_0x4a30('0xd')](_0x4a30('0xe'));var _0x3393e2=_[_0x4a30('0xf')]({'responder_id':_0x3554ca['id'],'requester_id':_0x383434['id'],'name':util[_0x4a30('0x10')](_0x4a30('0x11'),_0x13d3bc['calleridname']),'phone':_0x13d3bc[_0x4a30('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x4a30('0x13')](_0x390bd5[_0x4a30('0x14')],_0x13d3bc,'\x20'),'description':intUtil[_0x4a30('0x13')](_0x390bd5[_0x4a30('0x15')],_0x13d3bc,_0x4a30('0x16')),'tags':getTags(_0x390bd5['Tags'],_0x4a30('0x17'))},getCustomFields(_0x390bd5[_0x4a30('0x18')],_0x13d3bc));_0x3393e2[_0x4a30('0x19')]=_[_0x4a30('0x1a')](_[_0x4a30('0x1b')](_0x3393e2['custom_fields'],'id'),_0x4a30('0x1c'));return request({'uri':util[_0x4a30('0x10')]('%s/api/v2/tickets',_0x3f1062[_0x4a30('0x1d')]),'method':'POST','body':_0x3393e2})[_0x4a30('0x1e')](function(_0x4228ff){logger[_0x4a30('0xd')]('Ticket\x20created!');return _0x4228ff;});}function getUser(_0x498d7c,_0x43858d){if(intUtil[_0x4a30('0x1f')](_0x43858d)){return request({'uri':util[_0x4a30('0x10')](_0x4a30('0x20'),_0x498d7c[_0x4a30('0x1d')]),'qs':{'email':_0x43858d}})[_0x4a30('0x1e')](function(_0x165a06){if(_0x165a06[_0x4a30('0x21')]){logger['info'](_0x4a30('0x22'));return _[_0x4a30('0x23')](_0x165a06,function(_0x1ea4c8){return _0x1ea4c8[_0x4a30('0x24')]['email']===_0x43858d;});}else{logger[_0x4a30('0xd')](_0x4a30('0x25'));return request({'uri':util[_0x4a30('0x10')](_0x4a30('0x26'),_0x498d7c[_0x4a30('0x1d')])})['then'](function(_0x504f79){logger['info'](_0x4a30('0x27'));return _0x504f79;});}});}else{logger[_0x4a30('0xd')](_0x4a30('0x28'));return request({'uri':util[_0x4a30('0x10')](_0x4a30('0x26'),_0x498d7c[_0x4a30('0x1d')])})[_0x4a30('0x1e')](function(_0x32a636){logger['info'](_0x4a30('0x27'));return _0x32a636;});}}function getEndUser(_0x50274d,_0x183840,_0x3fa2f7){logger['info'](_0x4a30('0x29'),_0x3fa2f7);return request({'uri':util['format'](_0x4a30('0x2a'),_0x50274d['remoteUri']),'qs':{'phone':_0x3fa2f7}})['then'](function(_0x14a8fb){if(_0x14a8fb[_0x4a30('0x21')]){logger[_0x4a30('0xd')]('Enduser\x20found!');return _[_0x4a30('0x23')](_0x14a8fb,{'phone':_0x3fa2f7});}else{logger['info'](_0x4a30('0x2b'));return request({'uri':util[_0x4a30('0x10')](_0x4a30('0x2a'),_0x50274d[_0x4a30('0x1d')]),'method':'POST','body':{'name':_0x183840,'phone':_0x3fa2f7}})['then'](function(_0x29a909){logger['info'](_0x4a30('0x2c'));return _0x29a909;});}});}function getAuth(_0x336bc3){return util[_0x4a30('0x10')](_0x4a30('0x2d'),new Buffer(_0x336bc3[_0x4a30('0x2e')]+':X')[_0x4a30('0x2f')](_0x4a30('0x30')));}function request(_0x58b0ae){logger[_0x4a30('0x31')](_0x4a30('0x32'),JSON[_0x4a30('0x33')](_0x58b0ae));return rp(_['defaults'](_0x58b0ae,{'method':_0x4a30('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x30d7b8,_0x4dd325){var _0x3a6bfb=[];if(_0x30d7b8&&_0x30d7b8[_0x4a30('0x21')]>0x0){_0x3a6bfb=_[_0x4a30('0x35')](_0x30d7b8,_0x4dd325);}return _0x3a6bfb;}function getCustomFields(_0xf51f1b,_0x335a81){var _0x23c53b=[];var _0xe1d887={'custom_fields':[]};if(_0xf51f1b[_0x4a30('0x21')]>0x0){_[_0x4a30('0x36')](_0xf51f1b,function(_0x1ced30){if(_[_0x4a30('0x37')]([_0x4a30('0x38'),_0x4a30('0x39')],_0x1ced30['type'])&&_0x1ced30[_0x4a30('0x3a')]&&!_0x1ced30[_0x4a30('0x3b')]){_0xe1d887[_0x1ced30['nameField'][_0x4a30('0x3c')]()]=_0x1ced30[_0x4a30('0x3d')][_0x4a30('0x2f')]();}else if(_['includes']([_0x4a30('0x38'),_0x4a30('0x39')],_0x1ced30['type'])&&_0x1ced30[_0x4a30('0x3e')]&&_0x1ced30[_0x4a30('0x3b')]){_0xe1d887[_0x4a30('0x19')]['push']({'id':_0x1ced30[_0x4a30('0x3e')],'value':_0x1ced30[_0x4a30('0x3d')][_0x4a30('0x2f')]()});}else if(_0x1ced30[_0x4a30('0x3f')]==='variable'&&_0x1ced30[_0x4a30('0x40')]&&_0x1ced30['idField']&&_0x1ced30[_0x4a30('0x3b')]){_0x335a81[_0x1ced30[_0x4a30('0x40')]]&&_0xe1d887[_0x4a30('0x19')]['push']({'id':_0x1ced30['idField'],'value':_0x335a81[_0x1ced30['variableName']][_0x4a30('0x2f')]()});}else if(_0x1ced30['type']===_0x4a30('0x41')&&_0x1ced30['Variable']&&_0x1ced30[_0x4a30('0x42')][_0x4a30('0x17')]&&_0x1ced30['idField']&&_0x1ced30['customField']){_0x335a81[_0x1ced30[_0x4a30('0x42')][_0x4a30('0x17')][_0x4a30('0x3c')]()]&&_0xe1d887[_0x4a30('0x19')]['push']({'id':_0x1ced30['idField'],'value':_0x335a81[_0x1ced30[_0x4a30('0x42')][_0x4a30('0x17')][_0x4a30('0x3c')]()][_0x4a30('0x2f')]()});}});}return _0xe1d887;}exports[_0x4a30('0x43')]=function(_0x521ad9,_0x317afa,_0x4f88e1,_0x5d7b19,_0x24fbe8,_0x20d6dc){var _0x560767,_0x63197b;_0x20d6dc[_0x4a30('0x1d')]=intUtil[_0x4a30('0x44')](_0x20d6dc['remoteUri']);_0x20d6dc['serverUrl']=intUtil[_0x4a30('0x44')](_0x20d6dc['serverUrl']);if(_0x24fbe8&&_0x24fbe8[_0x4a30('0x45')]){logger[_0x4a30('0xd')](_0x4a30('0x46'),_0x4a30('0x47'));_0x317afa[_0x4a30('0x48')]=util[_0x4a30('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x20d6dc['serverUrl'],_0x317afa[_0x4a30('0x49')],md5(_0x317afa['uniqueid']));}else{_0x317afa[_0x4a30('0x48')]='';}headers[_0x4a30('0x4a')]=getAuth(_0x20d6dc);return getUser(_0x20d6dc,_0x5d7b19[_0x4a30('0x4b')])[_0x4a30('0x1e')](function(_0xd76cfe){_0x560767=_0xd76cfe;logger[_0x4a30('0xd')](_0x4a30('0x4c'),_0x560767['id']);return getEndUser(_0x20d6dc,_0x317afa['calleridname'],_0x317afa[_0x4a30('0x12')]);})[_0x4a30('0x1e')](function(_0x179365){_0x63197b=_0x179365;logger['info'](_0x4a30('0x4d'),_0x63197b['id']);return getTicket(_0x20d6dc,_0x560767,_0x63197b,_0x4f88e1,_0x317afa);})['then'](function(_0x3a448){if(_0x3a448&&_0x3a448['id']){logger['info'](_0x4a30('0x4e'));logger['info'](_0x4a30('0x4f'),_0x3a448['id']);logger[_0x4a30('0xd')](_0x4a30('0x46'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x4a30('0x50'),_0x5d7b19[_0x4a30('0x17')]),_0x4a30('0x51'),{'uri':util['format'](_0x4a30('0x52'),_0x20d6dc[_0x4a30('0x1d')],_0x3a448['id'])});}})[_0x4a30('0x53')](function(_0x3673c1){logger[_0x4a30('0x54')](_0x4a30('0x46'),JSON[_0x4a30('0x33')](_0x3673c1));});};exports[_0x4a30('0x55')]=function(_0x244dda,_0x440350,_0x5ae23c,_0x289755,_0xdb4e23,_0x119013,_0x5c6af3){var _0x1714a2,_0x4850fd;_0x119013['remoteUri']=intUtil[_0x4a30('0x44')](_0x119013['remoteUri']);_0x119013[_0x4a30('0x56')]=intUtil[_0x4a30('0x44')](_0x119013['serverUrl']);if(_0x5c6af3&&_0x5c6af3[_0x4a30('0x57')]&&_0x5c6af3['recordingFormat']!==_0x4a30('0x58')){logger[_0x4a30('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x440350[_0x4a30('0x48')]=util[_0x4a30('0x10')](_0x4a30('0x59'),_0x119013[_0x4a30('0x56')],_0x440350[_0x4a30('0x49')],md5(_0x440350['uniqueid']));}headers[_0x4a30('0x4a')]=getAuth(_0x119013);return getUser(_0x119013,_0x289755['email'])['then'](function(_0x12c325){_0x1714a2=_0x12c325;logger[_0x4a30('0xd')]('The\x20User\x20ID\x20is:',_0x1714a2['id']);return getEndUser(_0x119013,_0x440350['destcalleridname'],_0x440350[_0x4a30('0x5a')]);})[_0x4a30('0x1e')](function(_0x317e2a){_0x4850fd=_0x317e2a;logger[_0x4a30('0xd')]('The\x20Enduser\x20ID\x20is:',_0x4850fd['id']);return getTicket(_0x119013,_0x1714a2,_0x4850fd,_0x5ae23c,_0x440350);})[_0x4a30('0x1e')](function(_0x199d67){if(_0x199d67&&_0x199d67['id']){logger['info'](_0x4a30('0x4e'));logger['info'](_0x4a30('0x4f'),_0x199d67['id']);logger['info'](_0x4a30('0x5b'),_0x4a30('0x5c'));emit(util[_0x4a30('0x10')]('user:%s',_0x289755[_0x4a30('0x17')]),'trigger:browser:url',{'uri':util[_0x4a30('0x10')]('%s/helpdesk/tickets/%d',_0x119013['remoteUri'],_0x199d67['id'])});}})[_0x4a30('0x53')](function(_0x3de0fd){logger[_0x4a30('0x54')]('[OUTBOUND]',JSON['stringify'](_0x3de0fd));});};exports[_0x4a30('0x5d')]=function(_0x1ac494,_0x1e909b,_0x477238,_0x53fa5b,_0x2b2c2f,_0x3fe72d){var _0x1fe840,_0x3df42b;_0x3fe72d[_0x4a30('0x1d')]=intUtil['stripTrailingSlash'](_0x3fe72d['remoteUri']);_0x3fe72d[_0x4a30('0x56')]=intUtil[_0x4a30('0x44')](_0x3fe72d[_0x4a30('0x56')]);if(_0x2b2c2f&&_0x2b2c2f[_0x4a30('0x45')]){logger[_0x4a30('0xd')]('['+_0x1e909b['lastevent'][_0x4a30('0x5e')]()+']','Recording\x20is\x20enabled!');_0x1e909b['recordingURL']=util[_0x4a30('0x10')](_0x4a30('0x59'),_0x3fe72d['serverUrl'],_0x1e909b[_0x4a30('0x49')],md5(_0x1e909b[_0x4a30('0x49')]));}else{_0x1e909b['recordingURL']='';}headers[_0x4a30('0x4a')]=getAuth(_0x3fe72d);return getUser(_0x3fe72d,'')['then'](function(_0x577294){_0x1fe840=_0x577294;logger['info'](_0x4a30('0x4c'),_0x1fe840['id']);return getEndUser(_0x3fe72d,_0x1e909b[_0x4a30('0x5f')],_0x1e909b[_0x4a30('0x12')]);})['then'](function(_0x2e2eb7){_0x3df42b=_0x2e2eb7;logger[_0x4a30('0xd')](_0x4a30('0x4d'),_0x3df42b['id']);return getTicket(_0x3fe72d,_0x1fe840,_0x3df42b,_0x477238,_0x1e909b);})[_0x4a30('0x1e')](function(_0x5a3123){if(_0x5a3123){logger[_0x4a30('0xd')](_0x4a30('0x4e'));logger[_0x4a30('0xd')](_0x4a30('0x4f'),_0x5a3123['id']);}})[_0x4a30('0x53')](function(_0x310d89){logger['error']('['+_0x1e909b[_0x4a30('0x60')][_0x4a30('0x5e')]()+']',JSON['stringify'](_0x310d89));});}; \ No newline at end of file +var _0x0fad=['Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','length','find','contact','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!','%s/api/v2/contacts','Enduser\x20created.','apiKey','toString','base64','[HTTP]','stringify','GET','map','forEach','includes','picklist','type','nameField','toLowerCase','string','idField','customField','push','content','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','Authorization','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','The\x20Ticket\x20ID\x20is:','lodash','request-promise','md5','util','./util','../../../../config/environment','freshdesk','redis','defaults','application/json','emit','Creating\x20new\x20ticket...','merge','format'];(function(_0x1beee3,_0x2d8056){var _0x20f726=function(_0x25a44f){while(--_0x25a44f){_0x1beee3['push'](_0x1beee3['shift']());}};_0x20f726(++_0x2d8056);}(_0x0fad,0x1be));var _0xd0fa=function(_0x494a42,_0x1f2103){_0x494a42=_0x494a42-0x0;var _0x254792=_0x0fad[_0x494a42];return _0x254792;};'use strict';var _=require(_0xd0fa('0x0'));var rp=require(_0xd0fa('0x1'));var md5=require(_0xd0fa('0x2'));var util=require(_0xd0fa('0x3'));var Redis=require('ioredis');var intUtil=require(_0xd0fa('0x4'));var config=require(_0xd0fa('0x5'));var logger=require('../../../../config/logger')(_0xd0fa('0x6'));config[_0xd0fa('0x7')]=_[_0xd0fa('0x8')](config[_0xd0fa('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0xd0fa('0x9'),'Accept':_0xd0fa('0x9')};function emit(_0x5c04dd,_0x420d24,_0x582de4){io['to'](_0x5c04dd)[_0xd0fa('0xa')](_0x420d24,_0x582de4);}function getTicket(_0x314cfe,_0x5d1cb3,_0x5c9548,_0x5bd290,_0x9074c2){logger['info'](_0xd0fa('0xb'));var _0x1ee91e=_[_0xd0fa('0xc')]({'responder_id':_0x5d1cb3['id'],'requester_id':_0x5c9548['id'],'name':util[_0xd0fa('0xd')](_0xd0fa('0xe'),_0x9074c2[_0xd0fa('0xf')]),'phone':_0x9074c2[_0xd0fa('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xd0fa('0x11')](_0x5bd290[_0xd0fa('0x12')],_0x9074c2,'\x20'),'description':intUtil[_0xd0fa('0x11')](_0x5bd290[_0xd0fa('0x13')],_0x9074c2,_0xd0fa('0x14')),'tags':getTags(_0x5bd290[_0xd0fa('0x15')],_0xd0fa('0x16'))},getCustomFields(_0x5bd290['Fields'],_0x9074c2));_0x1ee91e[_0xd0fa('0x17')]=_[_0xd0fa('0x18')](_[_0xd0fa('0x19')](_0x1ee91e[_0xd0fa('0x17')],'id'),_0xd0fa('0x1a'));return request({'uri':util[_0xd0fa('0xd')](_0xd0fa('0x1b'),_0x314cfe[_0xd0fa('0x1c')]),'method':_0xd0fa('0x1d'),'body':_0x1ee91e})[_0xd0fa('0x1e')](function(_0x37b253){logger[_0xd0fa('0x1f')](_0xd0fa('0x20'));return _0x37b253;});}function getUser(_0x1323cf,_0x55f04c){if(intUtil[_0xd0fa('0x21')](_0x55f04c)){return request({'uri':util['format']('%s/api/v2/agents',_0x1323cf['remoteUri']),'qs':{'email':_0x55f04c}})[_0xd0fa('0x1e')](function(_0x52f3ff){if(_0x52f3ff[_0xd0fa('0x22')]){logger[_0xd0fa('0x1f')]('Agent\x20found!');return _[_0xd0fa('0x23')](_0x52f3ff,function(_0x316fa1){return _0x316fa1[_0xd0fa('0x24')]['email']===_0x55f04c;});}else{logger[_0xd0fa('0x1f')](_0xd0fa('0x25'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x1323cf[_0xd0fa('0x1c')])})[_0xd0fa('0x1e')](function(_0x175048){logger[_0xd0fa('0x1f')](_0xd0fa('0x26'));return _0x175048;});}});}else{logger[_0xd0fa('0x1f')](_0xd0fa('0x27'));return request({'uri':util[_0xd0fa('0xd')](_0xd0fa('0x28'),_0x1323cf[_0xd0fa('0x1c')])})[_0xd0fa('0x1e')](function(_0x313b4d){logger[_0xd0fa('0x1f')](_0xd0fa('0x26'));return _0x313b4d;});}}function getEndUser(_0x1c94a5,_0x28b373,_0x1a5666){logger['info'](_0xd0fa('0x29'),_0x1a5666);return request({'uri':util[_0xd0fa('0xd')]('%s/api/v2/contacts',_0x1c94a5[_0xd0fa('0x1c')]),'qs':{'phone':_0x1a5666}})[_0xd0fa('0x1e')](function(_0xa04343){if(_0xa04343['length']){logger[_0xd0fa('0x1f')](_0xd0fa('0x2a'));return _[_0xd0fa('0x23')](_0xa04343,{'phone':_0x1a5666});}else{logger[_0xd0fa('0x1f')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0xd0fa('0x2b'),_0x1c94a5[_0xd0fa('0x1c')]),'method':_0xd0fa('0x1d'),'body':{'name':_0x28b373,'phone':_0x1a5666}})[_0xd0fa('0x1e')](function(_0x4c704d){logger[_0xd0fa('0x1f')](_0xd0fa('0x2c'));return _0x4c704d;});}});}function getAuth(_0x276f16){return util[_0xd0fa('0xd')]('Basic\x20%s',new Buffer(_0x276f16[_0xd0fa('0x2d')]+':X')[_0xd0fa('0x2e')](_0xd0fa('0x2f')));}function request(_0x2f076d){logger['debug'](_0xd0fa('0x30'),JSON[_0xd0fa('0x31')](_0x2f076d));return rp(_[_0xd0fa('0x8')](_0x2f076d,{'method':_0xd0fa('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x545671,_0x5731a0){var _0x566cd5=[];if(_0x545671&&_0x545671[_0xd0fa('0x22')]>0x0){_0x566cd5=_[_0xd0fa('0x33')](_0x545671,_0x5731a0);}return _0x566cd5;}function getCustomFields(_0x5dddd6,_0x596702){var _0x132c42=[];var _0x9dd7ce={'custom_fields':[]};if(_0x5dddd6[_0xd0fa('0x22')]>0x0){_[_0xd0fa('0x34')](_0x5dddd6,function(_0x4d1eae){if(_[_0xd0fa('0x35')](['string',_0xd0fa('0x36')],_0x4d1eae[_0xd0fa('0x37')])&&_0x4d1eae[_0xd0fa('0x38')]&&!_0x4d1eae['customField']){_0x9dd7ce[_0x4d1eae[_0xd0fa('0x38')][_0xd0fa('0x39')]()]=_0x4d1eae['content'][_0xd0fa('0x2e')]();}else if(_[_0xd0fa('0x35')]([_0xd0fa('0x3a'),_0xd0fa('0x36')],_0x4d1eae[_0xd0fa('0x37')])&&_0x4d1eae[_0xd0fa('0x3b')]&&_0x4d1eae[_0xd0fa('0x3c')]){_0x9dd7ce[_0xd0fa('0x17')][_0xd0fa('0x3d')]({'id':_0x4d1eae[_0xd0fa('0x3b')],'value':_0x4d1eae[_0xd0fa('0x3e')][_0xd0fa('0x2e')]()});}else if(_0x4d1eae['type']==='variable'&&_0x4d1eae[_0xd0fa('0x3f')]&&_0x4d1eae[_0xd0fa('0x3b')]&&_0x4d1eae['customField']){_0x596702[_0x4d1eae[_0xd0fa('0x3f')]]&&_0x9dd7ce[_0xd0fa('0x17')][_0xd0fa('0x3d')]({'id':_0x4d1eae[_0xd0fa('0x3b')],'value':_0x596702[_0x4d1eae[_0xd0fa('0x3f')]][_0xd0fa('0x2e')]()});}else if(_0x4d1eae[_0xd0fa('0x37')]===_0xd0fa('0x40')&&_0x4d1eae['Variable']&&_0x4d1eae[_0xd0fa('0x41')][_0xd0fa('0x16')]&&_0x4d1eae[_0xd0fa('0x3b')]&&_0x4d1eae[_0xd0fa('0x3c')]){_0x596702[_0x4d1eae[_0xd0fa('0x41')]['name'][_0xd0fa('0x39')]()]&&_0x9dd7ce[_0xd0fa('0x17')][_0xd0fa('0x3d')]({'id':_0x4d1eae[_0xd0fa('0x3b')],'value':_0x596702[_0x4d1eae[_0xd0fa('0x41')][_0xd0fa('0x16')]['toLowerCase']()]['toString']()});}});}return _0x9dd7ce;}exports[_0xd0fa('0x42')]=function(_0x49c423,_0x26a418,_0xdbc3c5,_0x11d113,_0x402126,_0x3011ef){var _0x4ff4eb,_0x5eafa9;_0x3011ef[_0xd0fa('0x1c')]=intUtil[_0xd0fa('0x43')](_0x3011ef[_0xd0fa('0x1c')]);_0x3011ef[_0xd0fa('0x44')]=intUtil[_0xd0fa('0x43')](_0x3011ef['serverUrl']);if(_0x402126&&_0x402126['monitor_format']){logger[_0xd0fa('0x1f')](_0xd0fa('0x45'),'Recording\x20is\x20enabled!');_0x26a418[_0xd0fa('0x46')]=util[_0xd0fa('0xd')](_0xd0fa('0x47'),_0x3011ef[_0xd0fa('0x44')],_0x26a418[_0xd0fa('0x48')],md5(_0x26a418[_0xd0fa('0x48')]));}else{_0x26a418[_0xd0fa('0x46')]='';}headers['Authorization']=getAuth(_0x3011ef);return getUser(_0x3011ef,_0x11d113[_0xd0fa('0x49')])[_0xd0fa('0x1e')](function(_0x5dc1c6){_0x4ff4eb=_0x5dc1c6;logger[_0xd0fa('0x1f')]('The\x20User\x20ID\x20is:',_0x4ff4eb['id']);return getEndUser(_0x3011ef,_0x26a418['calleridname'],_0x26a418[_0xd0fa('0x10')]);})[_0xd0fa('0x1e')](function(_0x1abed7){_0x5eafa9=_0x1abed7;logger[_0xd0fa('0x1f')](_0xd0fa('0x4a'),_0x5eafa9['id']);return getTicket(_0x3011ef,_0x4ff4eb,_0x5eafa9,_0xdbc3c5,_0x26a418);})[_0xd0fa('0x1e')](function(_0x504947){if(_0x504947&&_0x504947['id']){logger[_0xd0fa('0x1f')]('Ticket\x20created!');logger[_0xd0fa('0x1f')]('The\x20Ticket\x20ID\x20is:',_0x504947['id']);logger[_0xd0fa('0x1f')](_0xd0fa('0x45'),_0xd0fa('0x4b'));emit(util[_0xd0fa('0xd')]('user:%s',_0x11d113[_0xd0fa('0x16')]),_0xd0fa('0x4c'),{'uri':util[_0xd0fa('0xd')](_0xd0fa('0x4d'),_0x3011ef[_0xd0fa('0x1c')],_0x504947['id'])});}})['catch'](function(_0x573bc9){logger[_0xd0fa('0x4e')](_0xd0fa('0x45'),JSON[_0xd0fa('0x31')](_0x573bc9));});};exports[_0xd0fa('0x4f')]=function(_0x2f4c7d,_0x56243a,_0x623847,_0xdae181,_0x303351,_0x62bb6e,_0x447827){var _0x45839d,_0x59b8b9;_0x62bb6e[_0xd0fa('0x1c')]=intUtil[_0xd0fa('0x43')](_0x62bb6e[_0xd0fa('0x1c')]);_0x62bb6e[_0xd0fa('0x44')]=intUtil['stripTrailingSlash'](_0x62bb6e[_0xd0fa('0x44')]);if(_0x447827&&_0x447827['recordingFormat']&&_0x447827[_0xd0fa('0x50')]!=='none'){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x56243a['recordingURL']=util[_0xd0fa('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x62bb6e[_0xd0fa('0x44')],_0x56243a[_0xd0fa('0x48')],md5(_0x56243a[_0xd0fa('0x48')]));}headers[_0xd0fa('0x51')]=getAuth(_0x62bb6e);return getUser(_0x62bb6e,_0xdae181[_0xd0fa('0x49')])[_0xd0fa('0x1e')](function(_0x690f4e){_0x45839d=_0x690f4e;logger['info'](_0xd0fa('0x52'),_0x45839d['id']);return getEndUser(_0x62bb6e,_0x56243a[_0xd0fa('0x53')],_0x56243a[_0xd0fa('0x54')]);})[_0xd0fa('0x1e')](function(_0x37f6b4){_0x59b8b9=_0x37f6b4;logger[_0xd0fa('0x1f')](_0xd0fa('0x4a'),_0x59b8b9['id']);return getTicket(_0x62bb6e,_0x45839d,_0x59b8b9,_0x623847,_0x56243a);})[_0xd0fa('0x1e')](function(_0x4012aa){if(_0x4012aa&&_0x4012aa['id']){logger[_0xd0fa('0x1f')](_0xd0fa('0x20'));logger[_0xd0fa('0x1f')]('The\x20Ticket\x20ID\x20is:',_0x4012aa['id']);logger[_0xd0fa('0x1f')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0xdae181[_0xd0fa('0x16')]),_0xd0fa('0x4c'),{'uri':util[_0xd0fa('0xd')](_0xd0fa('0x4d'),_0x62bb6e['remoteUri'],_0x4012aa['id'])});}})[_0xd0fa('0x55')](function(_0x45f0d8){logger[_0xd0fa('0x4e')]('[OUTBOUND]',JSON[_0xd0fa('0x31')](_0x45f0d8));});};exports[_0xd0fa('0x56')]=function(_0x1cd17c,_0x30189d,_0x463002,_0x5341a0,_0x3a4632,_0x4e2052){var _0x3a20f5,_0x547b24;_0x4e2052[_0xd0fa('0x1c')]=intUtil[_0xd0fa('0x43')](_0x4e2052['remoteUri']);_0x4e2052[_0xd0fa('0x44')]=intUtil[_0xd0fa('0x43')](_0x4e2052[_0xd0fa('0x44')]);if(_0x3a4632&&_0x3a4632[_0xd0fa('0x57')]){logger[_0xd0fa('0x1f')]('['+_0x30189d[_0xd0fa('0x58')][_0xd0fa('0x59')]()+']',_0xd0fa('0x5a'));_0x30189d[_0xd0fa('0x46')]=util[_0xd0fa('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4e2052[_0xd0fa('0x44')],_0x30189d[_0xd0fa('0x48')],md5(_0x30189d[_0xd0fa('0x48')]));}else{_0x30189d[_0xd0fa('0x46')]='';}headers[_0xd0fa('0x51')]=getAuth(_0x4e2052);return getUser(_0x4e2052,'')[_0xd0fa('0x1e')](function(_0x32c205){_0x3a20f5=_0x32c205;logger[_0xd0fa('0x1f')]('The\x20User\x20ID\x20is:',_0x3a20f5['id']);return getEndUser(_0x4e2052,_0x30189d[_0xd0fa('0xf')],_0x30189d[_0xd0fa('0x10')]);})[_0xd0fa('0x1e')](function(_0x5d575f){_0x547b24=_0x5d575f;logger[_0xd0fa('0x1f')](_0xd0fa('0x4a'),_0x547b24['id']);return getTicket(_0x4e2052,_0x3a20f5,_0x547b24,_0x463002,_0x30189d);})[_0xd0fa('0x1e')](function(_0x3b013c){if(_0x3b013c){logger[_0xd0fa('0x1f')](_0xd0fa('0x20'));logger['info'](_0xd0fa('0x5b'),_0x3b013c['id']);}})['catch'](function(_0x35d8cf){logger['error']('['+_0x30189d[_0xd0fa('0x58')][_0xd0fa('0x59')]()+']',JSON[_0xd0fa('0x31')](_0x35d8cf));});}; \ 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 00da1b0..9206ad1 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 _0xe6ed=['Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','&entities=contact','find','contacts','format','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','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','ticketId','task','/contacts/','trigger:browser:url','Token\x20token=','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','GET','headers','info','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','agentEmail'];(function(_0x5545c9,_0x42fa27){var _0x5848eb=function(_0x68d730){while(--_0x68d730){_0x5545c9['push'](_0x5545c9['shift']());}};_0x5848eb(++_0x42fa27);}(_0xe6ed,0xe1));var _0xde6e=function(_0x17c9df,_0x4a7609){_0x17c9df=_0x17c9df-0x0;var _0x31fa6f=_0xe6ed[_0x17c9df];return _0x31fa6f;};'use strict';var _=require('lodash');var rp=require(_0xde6e('0x0'));var md5=require(_0xde6e('0x1'));var util=require(_0xde6e('0x2'));var moment=require('moment');var Promise=require(_0xde6e('0x3'));var Redis=require(_0xde6e('0x4'));var intUtil=require(_0xde6e('0x5'));var config=require(_0xde6e('0x6'));var logger=require('../../../../config/logger')(_0xde6e('0x7'));config[_0xde6e('0x8')]=_['defaults'](config[_0xde6e('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xde6e('0x8')]));function getAdminId(_0x37ec2e,_0x590a25,_0x29c78e,_0x549e68){return new Promise(function(_0x4a4f18,_0x13f70b){var _0x24918d=![];var _0x4af785={'method':_0xde6e('0x9'),'uri':_0x549e68+'/api/selector/owners','json':!![]};_0x4af785[_0xde6e('0xa')]=_0x29c78e;logger[_0xde6e('0xb')]('Getting\x20admin\x20information');return rp(_0x4af785)[_0xde6e('0xc')](function(_0x515701){if(_0x515701){var _0x5716e5=_0x515701[_0xde6e('0xd')];var _0x5ec920=null;for(_0x5ec920=0x0;_0x5ec920<_0x5716e5[_0xde6e('0xe')];_0x5ec920++){if(_0x5716e5[_0x5ec920][_0xde6e('0xf')]===_0x37ec2e[_0xde6e('0x10')]){_0x37ec2e[_0xde6e('0x11')]=_0x5716e5[_0x5ec920]['id'];_0x24918d=!![];}}if(_0x24918d){logger[_0xde6e('0xb')](_0xde6e('0x12'),_0x37ec2e[_0xde6e('0x11')]);_0x4a4f18(_0x37ec2e);}else{_0x13f70b({'statusCode':0x194,'message':_0xde6e('0x13')});}}else{_0x13f70b({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xde6e('0x14')](function(_0x2d5eb2){logger[_0xde6e('0x15')]('['+[_0x590a25[_0xde6e('0x16')]()]+']',_0x2d5eb2[_0xde6e('0x17')]);_0x13f70b(_0x2d5eb2);});});}function getUser(_0x62a0c0,_0x263832,_0x3a9baf){return function(_0x1fe2cf){return new Promise(function(_0x20f8a4,_0x8c7c1f){var _0x539f68={'method':_0xde6e('0x9'),'uri':_0x3a9baf+_0xde6e('0x18'),'json':!![]};_0x539f68[_0xde6e('0xa')]=_0x263832;logger[_0xde6e('0xb')](_0xde6e('0x19'));return rp(_0x539f68)['then'](function(_0xaffb92){if(_0xaffb92){var _0x472d92=_0xaffb92[_0xde6e('0xd')];var _0x48ac92=![];var _0x51d2d7=null;if(_0x1fe2cf[_0xde6e('0x1a')]!==null){logger['info'](_0xde6e('0x1b'),_0x1fe2cf[_0xde6e('0x1a')]);_0x1fe2cf[_0xde6e('0x1c')]=_0x1fe2cf[_0xde6e('0x1a')];for(_0x51d2d7=0x0;_0x51d2d7<_0x472d92[_0xde6e('0xe')];_0x51d2d7++){if(_0x472d92[_0x51d2d7]['email']===_0x1fe2cf[_0xde6e('0x1a')]){_0x48ac92=!![];_0x1fe2cf[_0xde6e('0x1d')]=_0x472d92[_0x51d2d7]['id'];logger['info'](_0xde6e('0x1e'),_0x1fe2cf[_0xde6e('0x1d')]);}}}if(!_0x48ac92){logger[_0xde6e('0xb')](_0xde6e('0x1f'));_0x1fe2cf[_0xde6e('0x1c')]=_0x1fe2cf[_0xde6e('0x10')];_0x1fe2cf[_0xde6e('0x1d')]=_0x1fe2cf[_0xde6e('0x11')];_0x48ac92=!![];}if(_0x48ac92){_0x20f8a4(_0x1fe2cf);}else{_0x8c7c1f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x8c7c1f({'statusCode':0x194,'message':_0xde6e('0x13')});}})['catch'](function(_0x1c2663){logger[_0xde6e('0x15')]('['+[_0x62a0c0[_0xde6e('0x16')]()]+']',_0x1c2663[_0xde6e('0x17')]);_0x8c7c1f(_0x1c2663);});});};}function searchContact(_0x439d42,_0x15db3b,_0x17d6bd,_0x277a90){return new Promise(function(_0x2f6396,_0x25d0f5){var _0x3196eb={'method':'GET','headers':_0x15db3b,'uri':_0x439d42+'/api/lookup?q='+_0x277a90+'&f='+_0x17d6bd+_0xde6e('0x20'),'json':!![]};rp(_0x3196eb)[_0xde6e('0xc')](function(_0x13743){var _0x34cba7=_[_0xde6e('0x21')](_0x13743[_0xde6e('0x22')][_0xde6e('0x22')],[_0x17d6bd,_0x277a90]);_0x2f6396(_0x34cba7);})[_0xde6e('0x14')](function(_0xdaad95){_0x25d0f5(_0xdaad95);});});}function getEndUser(_0x1c46b5,_0x2fcce4,_0x470665){return function(_0x33fa31){return new Promise(function(_0x5a0061,_0x35dfb5){logger[_0xde6e('0xb')](util[_0xde6e('0x23')](_0xde6e('0x24'),_0x33fa31[_0xde6e('0x25')]));searchContact(_0x470665,_0x2fcce4,_0xde6e('0x26'),_0x33fa31[_0xde6e('0x25')])[_0xde6e('0xc')](function(_0x5094b6){if(_0x5094b6){_0x33fa31[_0xde6e('0x27')]=_0x5094b6['id'];logger[_0xde6e('0xb')](_0xde6e('0x28'),_0x33fa31[_0xde6e('0x27')]);return _0x5a0061(_0x33fa31);}searchContact(_0x470665,_0x2fcce4,_0xde6e('0x29'),_0x33fa31[_0xde6e('0x25')])[_0xde6e('0xc')](function(_0x4a5bfc){if(_0x4a5bfc){_0x33fa31['endUserId']=_0x4a5bfc['id'];logger['info'](_0xde6e('0x2a'),_0x33fa31[_0xde6e('0x27')]);return _0x5a0061(_0x33fa31);}createEndUser(_0x33fa31,_0x1c46b5,_0x2fcce4,_0x470665)[_0xde6e('0xc')](function(_0x470ab2){logger[_0xde6e('0xb')](_0xde6e('0x2b'),_0x470ab2[_0xde6e('0x27')]);return _0x5a0061(_0x470ab2);});});})[_0xde6e('0x14')](function(_0x56d77c){_0x35dfb5(_0x56d77c);});});};}function createEndUser(_0x2cdf65,_0x9fe53c,_0x4bd136,_0x1a5062){return new Promise(function(_0x1c1b57,_0x2d570e){var _0x58cf7c=moment();var _0x1efefe={'method':_0xde6e('0x2c'),'uri':_0x1a5062+_0xde6e('0x2d'),'body':{'contact':{'last_name':_0x2cdf65[_0xde6e('0x25')],'work_number':_0x2cdf65['contactNumber'],'mobile_number':_0x2cdf65[_0xde6e('0x25')],'owner_id':_0x2cdf65[_0xde6e('0x1d')],'created_at':_0x58cf7c[_0xde6e('0x23')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x1efefe['headers']=_0x4bd136;logger[_0xde6e('0xb')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x1efefe)[_0xde6e('0xc')](function(_0x1073c3){_0x2cdf65[_0xde6e('0x27')]=_0x1073c3[_0xde6e('0x2e')]['id'];_0x1c1b57(_0x2cdf65);})[_0xde6e('0x14')](function(_0x14c215){logger[_0xde6e('0x15')]('['+[_0x9fe53c['toUpperCase']()]+']',_0x14c215['message']);_0x2d570e(_0x14c215['message']);});});}function getTicket(_0x18349b,_0x5190ee,_0x109ff2,_0xae4d61,_0x560942){return function(_0x5c879a){logger[_0xde6e('0xb')](_0xde6e('0x2f'));return new Promise(function(_0x5eea31,_0x764095){var _0x54c0ed=moment();var _0x377c06={'method':'POST','uri':_0x109ff2+_0xde6e('0x30'),'body':{'title':intUtil[_0xde6e('0x31')](_0xae4d61[_0xde6e('0x32')],_0x560942,'\x20'),'description':intUtil[_0xde6e('0x31')](_0xae4d61[_0xde6e('0x33')],_0x560942,'\x0a'),'owner_id':_0x5c879a[_0xde6e('0x1d')],'creater_id':_0x5c879a['adminId'],'targetable_id':_0x5c879a[_0xde6e('0x27')],'targetable_type':_0xde6e('0x34'),'created_at':_0x54c0ed[_0xde6e('0x23')](_0xde6e('0x35')),'due_date':_0x54c0ed['add'](0x1e,'m')[_0xde6e('0x23')](_0xde6e('0x35'))},'json':!![]};_0x377c06[_0xde6e('0xa')]=_0x5190ee;return rp(_0x377c06)[_0xde6e('0xc')](function(_0xcf0ad){_0x5c879a[_0xde6e('0x36')]=_0xcf0ad[_0xde6e('0x37')]['id'];logger['info']('Task\x20created:',_0x5c879a['ticketId']);_0x5eea31(_0x5c879a);})[_0xde6e('0x14')](function(_0x5d82b5){logger[_0xde6e('0x15')]('['+[_0x18349b[_0xde6e('0x16')]()]+']',_0x5d82b5[_0xde6e('0x17')]);_0x764095(_0x5d82b5['message']);});});};}function emit(_0x1b1dc0,_0x86b971,_0x9958be){var _0xfb6c12={'uri':_0x1b1dc0+_0xde6e('0x38')+_0x9958be};io['to'](util[_0xde6e('0x23')]('user:%s',_0x86b971))['emit'](_0xde6e('0x39'),_0xfb6c12);}exports['cs']=function(_0x34ddee,_0x20fd44,_0x2424c3,_0x14437b,_0x9609d7,_0x388f7b,_0x2fc788,_0x21e937){var _0x42d332={};var _0x5efea9={'Authorization':_0xde6e('0x3a')+_0x388f7b['apiKey']};_0x388f7b[_0xde6e('0x3b')]=intUtil['stripTrailingSlash'](_0x388f7b['remoteUri']);_0x388f7b[_0xde6e('0x3c')]=intUtil[_0xde6e('0x3d')](_0x388f7b[_0xde6e('0x3c')]);var _0x5c98a5=_0x388f7b[_0xde6e('0x3b')];_0x42d332[_0xde6e('0x10')]=_0x388f7b[_0xde6e('0x3e')];_0x42d332[_0xde6e('0x25')]=_0x21e937[_0xde6e('0x3f')]()===_0xde6e('0x40')?_0x20fd44[_0xde6e('0x41')]:_0x20fd44[_0xde6e('0x42')];_0x42d332[_0xde6e('0x43')]=_0x21e937===_0xde6e('0x44')||_0x21e937===_0xde6e('0x45')?_0xde6e('0x44'):_0xde6e('0x40');if(_0x14437b){_0x42d332[_0xde6e('0x1a')]=_0x14437b['email'];}var _0x1e836a=util[_0xde6e('0x23')](_0xde6e('0x46'),_0x388f7b['serverUrl'],_0x20fd44['uniqueid'],md5(_0x20fd44[_0xde6e('0x47')]));if(_0x9609d7&&_0x9609d7[_0xde6e('0x48')]){logger[_0xde6e('0xb')](_0xde6e('0x49'),'Recording\x20is\x20enabled!');_0x20fd44['recordingURL']=_0x1e836a;}else if(_0x2fc788&&_0x2fc788[_0xde6e('0x4a')]&&_0x2fc788[_0xde6e('0x4a')]!==_0xde6e('0x4b')){logger[_0xde6e('0xb')](_0xde6e('0x4c'),_0xde6e('0x4d'));_0x20fd44[_0xde6e('0x4e')]=_0x1e836a;}else{_0x20fd44[_0xde6e('0x4e')]='';}return getAdminId(_0x42d332,_0x21e937,_0x5efea9,_0x5c98a5)['then'](getUser(_0x21e937,_0x5efea9,_0x5c98a5))[_0xde6e('0xc')](getEndUser(_0x21e937,_0x5efea9,_0x5c98a5))[_0xde6e('0xc')](getTicket(_0x21e937,_0x5efea9,_0x5c98a5,_0x2424c3,_0x20fd44))['then'](function(_0x33528c){logger[_0xde6e('0xb')](util[_0xde6e('0x23')](_0xde6e('0x4f'),_0x33528c[_0xde6e('0x36')]));if(_0x21e937!==_0xde6e('0x45')){logger[_0xde6e('0xb')]('['+[_0x21e937[_0xde6e('0x16')]()]+']',_0xde6e('0x50'));emit(_0x5c98a5,_0x14437b[_0xde6e('0x51')],_0x33528c['endUserId']);}})[_0xde6e('0x14')](function(_0x1ab7e6){logger[_0xde6e('0x15')]('['+[_0x21e937[_0xde6e('0x16')]()]+_0xde6e('0x52'),util[_0xde6e('0x53')](_0x1ab7e6,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5150=['toUpperCase','message','info','Getting\x20user\x20with\x20email','agentEmail','userEmail','email','userId','User\x20found:','Admin\x20selected','catch','error','/api/lookup?q=','&f=','&entities=contact','find','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','POST','/api/tasks','Subjects','getString','Descriptions','format','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','adminEmail','username','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','bluebird','ioredis','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','GET','headers','then','users','length','adminId','Requested\x20Resource\x20not\x20Found'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x5150,0x195));var _0x0515=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x5150[_0x107f10];return _0x811cab;};'use strict';var _=require('lodash');var rp=require(_0x0515('0x0'));var md5=require('md5');var util=require('util');var moment=require('moment');var Promise=require(_0x0515('0x1'));var Redis=require(_0x0515('0x2'));var intUtil=require('./util');var config=require(_0x0515('0x3'));var logger=require('../../../../config/logger')('freshsales');config['redis']=_[_0x0515('0x4')](config[_0x0515('0x5')],{'host':_0x0515('0x6'),'port':0x18eb});var io=require(_0x0515('0x7'))(new Redis(config['redis']));function getAdminId(_0x5cb8fc,_0x5701d3,_0xda901d,_0x322a0f){return new Promise(function(_0x5f57a3,_0x30c05a){var _0x1f6244=![];var _0x332b6c={'method':_0x0515('0x8'),'uri':_0x322a0f+'/api/selector/owners','json':!![]};_0x332b6c[_0x0515('0x9')]=_0xda901d;logger['info']('Getting\x20admin\x20information');return rp(_0x332b6c)[_0x0515('0xa')](function(_0x717987){if(_0x717987){var _0x526a5e=_0x717987[_0x0515('0xb')];var _0x76036a=null;for(_0x76036a=0x0;_0x76036a<_0x526a5e[_0x0515('0xc')];_0x76036a++){if(_0x526a5e[_0x76036a]['email']===_0x5cb8fc['adminEmail']){_0x5cb8fc[_0x0515('0xd')]=_0x526a5e[_0x76036a]['id'];_0x1f6244=!![];}}if(_0x1f6244){logger['info']('Admin\x20found:',_0x5cb8fc[_0x0515('0xd')]);_0x5f57a3(_0x5cb8fc);}else{_0x30c05a({'statusCode':0x194,'message':_0x0515('0xe')});}}else{_0x30c05a({'statusCode':0x194,'message':_0x0515('0xe')});}})['catch'](function(_0x2a5118){logger['error']('['+[_0x5701d3[_0x0515('0xf')]()]+']',_0x2a5118[_0x0515('0x10')]);_0x30c05a(_0x2a5118);});});}function getUser(_0x31c9c6,_0x5f5f24,_0x54f81e){return function(_0x12b0f1){return new Promise(function(_0x1b6646,_0x3139bd){var _0x1c77a9={'method':_0x0515('0x8'),'uri':_0x54f81e+'/api/selector/owners','json':!![]};_0x1c77a9[_0x0515('0x9')]=_0x5f5f24;logger['info']('Getting\x20user\x20list');return rp(_0x1c77a9)['then'](function(_0x38d790){if(_0x38d790){var _0x497c96=_0x38d790['users'];var _0x12cf8c=![];var _0x58d495=null;if(_0x12b0f1['agentEmail']!==null){logger[_0x0515('0x11')](_0x0515('0x12'),_0x12b0f1[_0x0515('0x13')]);_0x12b0f1[_0x0515('0x14')]=_0x12b0f1[_0x0515('0x13')];for(_0x58d495=0x0;_0x58d495<_0x497c96[_0x0515('0xc')];_0x58d495++){if(_0x497c96[_0x58d495][_0x0515('0x15')]===_0x12b0f1[_0x0515('0x13')]){_0x12cf8c=!![];_0x12b0f1[_0x0515('0x16')]=_0x497c96[_0x58d495]['id'];logger['info'](_0x0515('0x17'),_0x12b0f1[_0x0515('0x16')]);}}}if(!_0x12cf8c){logger[_0x0515('0x11')](_0x0515('0x18'));_0x12b0f1[_0x0515('0x14')]=_0x12b0f1['adminEmail'];_0x12b0f1[_0x0515('0x16')]=_0x12b0f1[_0x0515('0xd')];_0x12cf8c=!![];}if(_0x12cf8c){_0x1b6646(_0x12b0f1);}else{_0x3139bd({'statusCode':0x194,'message':_0x0515('0xe')});}}else{_0x3139bd({'statusCode':0x194,'message':_0x0515('0xe')});}})[_0x0515('0x19')](function(_0x4c9773){logger[_0x0515('0x1a')]('['+[_0x31c9c6[_0x0515('0xf')]()]+']',_0x4c9773[_0x0515('0x10')]);_0x3139bd(_0x4c9773);});});};}function searchContact(_0x13acec,_0x3a73ba,_0x62fc9a,_0x45218c){return new Promise(function(_0x30687e,_0xdd0c3){var _0xa1fa8f={'method':'GET','headers':_0x3a73ba,'uri':_0x13acec+_0x0515('0x1b')+_0x45218c+_0x0515('0x1c')+_0x62fc9a+_0x0515('0x1d'),'json':!![]};rp(_0xa1fa8f)[_0x0515('0xa')](function(_0x2c3356){var _0x869e21=_[_0x0515('0x1e')](_0x2c3356['contacts']['contacts'],[_0x62fc9a,_0x45218c]);_0x30687e(_0x869e21);})['catch'](function(_0x4275f5){_0xdd0c3(_0x4275f5);});});}function getEndUser(_0x2ebb51,_0x445614,_0xdc5015){return function(_0x399415){return new Promise(function(_0x20b1fb,_0x5d6c0b){logger[_0x0515('0x11')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x399415[_0x0515('0x1f')]));searchContact(_0xdc5015,_0x445614,'mobile_number',_0x399415[_0x0515('0x1f')])[_0x0515('0xa')](function(_0x5383c4){if(_0x5383c4){_0x399415[_0x0515('0x20')]=_0x5383c4['id'];logger['info'](_0x0515('0x21'),_0x399415[_0x0515('0x20')]);return _0x20b1fb(_0x399415);}searchContact(_0xdc5015,_0x445614,_0x0515('0x22'),_0x399415[_0x0515('0x1f')])[_0x0515('0xa')](function(_0x47c4ff){if(_0x47c4ff){_0x399415[_0x0515('0x20')]=_0x47c4ff['id'];logger[_0x0515('0x11')]('Contact\x20found\x20work_number:',_0x399415['endUserId']);return _0x20b1fb(_0x399415);}createEndUser(_0x399415,_0x2ebb51,_0x445614,_0xdc5015)[_0x0515('0xa')](function(_0x4755c5){logger[_0x0515('0x11')](_0x0515('0x23'),_0x4755c5[_0x0515('0x20')]);return _0x20b1fb(_0x4755c5);});});})['catch'](function(_0x1db9e1){_0x5d6c0b(_0x1db9e1);});});};}function createEndUser(_0xebc084,_0x8c5488,_0x18106b,_0x4a683b){return new Promise(function(_0x1eb81b,_0x58cccc){var _0x4ccff8=moment();var _0x3050d5={'method':'POST','uri':_0x4a683b+'/api/contacts','body':{'contact':{'last_name':_0xebc084[_0x0515('0x1f')],'work_number':_0xebc084[_0x0515('0x1f')],'mobile_number':_0xebc084[_0x0515('0x1f')],'owner_id':_0xebc084[_0x0515('0x16')],'created_at':_0x4ccff8['format'](_0x0515('0x24'))}},'json':!![]};_0x3050d5['headers']=_0x18106b;logger['info'](_0x0515('0x25'));return rp(_0x3050d5)[_0x0515('0xa')](function(_0x4953db){_0xebc084[_0x0515('0x20')]=_0x4953db[_0x0515('0x26')]['id'];_0x1eb81b(_0xebc084);})['catch'](function(_0x19fcaa){logger[_0x0515('0x1a')]('['+[_0x8c5488[_0x0515('0xf')]()]+']',_0x19fcaa['message']);_0x58cccc(_0x19fcaa[_0x0515('0x10')]);});});}function getTicket(_0x345431,_0x3bad90,_0x5f5d96,_0x579ad5,_0x374e73){return function(_0x213166){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x59325b,_0x399b6b){var _0xf83727=moment();var _0x3e9559={'method':_0x0515('0x27'),'uri':_0x5f5d96+_0x0515('0x28'),'body':{'title':intUtil['getString'](_0x579ad5[_0x0515('0x29')],_0x374e73,'\x20'),'description':intUtil[_0x0515('0x2a')](_0x579ad5[_0x0515('0x2b')],_0x374e73,'\x0a'),'owner_id':_0x213166[_0x0515('0x16')],'creater_id':_0x213166[_0x0515('0xd')],'targetable_id':_0x213166['endUserId'],'targetable_type':'Contact','created_at':_0xf83727[_0x0515('0x2c')](_0x0515('0x24')),'due_date':_0xf83727['add'](0x1e,'m')[_0x0515('0x2c')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x3e9559['headers']=_0x3bad90;return rp(_0x3e9559)[_0x0515('0xa')](function(_0x6a58aa){_0x213166[_0x0515('0x2d')]=_0x6a58aa[_0x0515('0x2e')]['id'];logger['info'](_0x0515('0x2f'),_0x213166[_0x0515('0x2d')]);_0x59325b(_0x213166);})[_0x0515('0x19')](function(_0x4b884e){logger['error']('['+[_0x345431[_0x0515('0xf')]()]+']',_0x4b884e[_0x0515('0x10')]);_0x399b6b(_0x4b884e[_0x0515('0x10')]);});});};}function emit(_0x5403bd,_0x2aa8c1,_0x575056){var _0x1f9778={'uri':_0x5403bd+_0x0515('0x30')+_0x575056};io['to'](util['format'](_0x0515('0x31'),_0x2aa8c1))[_0x0515('0x32')](_0x0515('0x33'),_0x1f9778);}exports['cs']=function(_0x1067bd,_0x1feda5,_0x1029bd,_0x221475,_0x1330cc,_0x4aa072,_0x172737,_0x48fcf4){var _0x5e2c08={};var _0x31add6={'Authorization':'Token\x20token='+_0x4aa072['apiKey']};_0x4aa072['remoteUri']=intUtil[_0x0515('0x34')](_0x4aa072['remoteUri']);_0x4aa072[_0x0515('0x35')]=intUtil[_0x0515('0x34')](_0x4aa072[_0x0515('0x35')]);var _0x4a0e68=_0x4aa072['remoteUri'];_0x5e2c08[_0x0515('0x36')]=_0x4aa072[_0x0515('0x37')];_0x5e2c08['contactNumber']=_0x48fcf4['toLowerCase']()===_0x0515('0x38')?_0x1feda5[_0x0515('0x39')]:_0x1feda5[_0x0515('0x3a')];_0x5e2c08[_0x0515('0x3b')]=_0x48fcf4===_0x0515('0x3c')||_0x48fcf4===_0x0515('0x3d')?_0x0515('0x3c'):_0x0515('0x38');if(_0x221475){_0x5e2c08[_0x0515('0x13')]=_0x221475['email'];}var _0x39b693=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4aa072[_0x0515('0x35')],_0x1feda5[_0x0515('0x3e')],md5(_0x1feda5[_0x0515('0x3e')]));if(_0x1330cc&&_0x1330cc[_0x0515('0x3f')]){logger[_0x0515('0x11')](_0x0515('0x40'),'Recording\x20is\x20enabled!');_0x1feda5[_0x0515('0x41')]=_0x39b693;}else if(_0x172737&&_0x172737[_0x0515('0x42')]&&_0x172737[_0x0515('0x42')]!=='none'){logger[_0x0515('0x11')](_0x0515('0x43'),'Recording\x20is\x20enabled!');_0x1feda5[_0x0515('0x41')]=_0x39b693;}else{_0x1feda5[_0x0515('0x41')]='';}return getAdminId(_0x5e2c08,_0x48fcf4,_0x31add6,_0x4a0e68)[_0x0515('0xa')](getUser(_0x48fcf4,_0x31add6,_0x4a0e68))[_0x0515('0xa')](getEndUser(_0x48fcf4,_0x31add6,_0x4a0e68))[_0x0515('0xa')](getTicket(_0x48fcf4,_0x31add6,_0x4a0e68,_0x1029bd,_0x1feda5))[_0x0515('0xa')](function(_0x307887){logger['info'](util[_0x0515('0x2c')]('The\x20ticket\x20ID\x20is:\x20%s',_0x307887['ticketId']));if(_0x48fcf4!==_0x0515('0x3d')){logger[_0x0515('0x11')]('['+[_0x48fcf4[_0x0515('0xf')]()]+']',_0x0515('0x44'));emit(_0x4a0e68,_0x221475['name'],_0x307887[_0x0515('0x20')]);}})['catch'](function(_0x6d1f73){logger[_0x0515('0x1a')]('['+[_0x48fcf4[_0x0515('0xf')]()]+_0x0515('0x45'),util['inspect'](_0x6d1f73,{'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 a5d37c0..70e5599 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 _0x663a=['./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','desk','vtiger','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','freshdesk','zoho','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','./zoho'];(function(_0x4d37f5,_0x42c8c7){var _0x1aeefd=function(_0xbf4648){while(--_0xbf4648){_0x4d37f5['push'](_0x4d37f5['shift']());}};_0x1aeefd(++_0x42c8c7);}(_0x663a,0xf3));var _0xa663=function(_0x10144c,_0x3baa8e){_0x10144c=_0x10144c-0x0;var _0x171652=_0x663a[_0x10144c];return _0x171652;};'use strict';var _=require(_0xa663('0x0'));var util=require('util');var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0xa663('0x1'));var desk=require('./desk');var vtiger=require(_0xa663('0x2'));var servicenow=require(_0xa663('0x3'));var dynamics365=require('./dynamics365');var freshsales=require(_0xa663('0x4'));var integrations=[_0xa663('0x5'),_0xa663('0x6'),_0xa663('0x7'),'freshdesk','zoho',_0xa663('0x8'),_0xa663('0x9'),'dynamics365',_0xa663('0xa'),_0xa663('0xb')];exports[_0xa663('0xc')]=function(_0x5c14ac,_0x88c925,_0x464dcf,_0x3e891e,_0x5b50bc,_0x23cc04){if(_0x464dcf){if(_[_0xa663('0xd')](integrations,_0x5c14ac[_0xa663('0xe')][_0xa663('0xf')]())){try{var _0x1436d4=null;var _0x29bc16='';var _0x331cd3=_0x464dcf[_0x5c14ac['data1'][_0xa663('0xf')]()];if(_0x331cd3){var _0x5674ac=_0x331cd3[_0x5c14ac[_0xa663('0x10')]];if(_0x5674ac){var _0x1e745d=_[_0xa663('0x11')](_0x5674ac[_0xa663('0x12')],{'id':parseInt(_0x5c14ac[_0xa663('0x13')],0xa)});if(_0x1e745d){if(_0x3e891e){if(_0x5b50bc&&_0x88c925[_0xa663('0x14')]){_0x29bc16='queue';}else if(_0x88c925['routeId']){_0x29bc16=_0xa663('0x15');}else{console[_0xa663('0x16')](_0xa663('0x17'),_0x88c925);}}else{_0x29bc16=_0xa663('0x18');}switch(_0x5c14ac['data1'][_0xa663('0xf')]()){case _0xa663('0x5'):zendesk[_0x29bc16](_0x5c14ac,_0x88c925,_0x1e745d,_0x3e891e,_0x5b50bc,_0x5674ac,_0x23cc04);break;case _0xa663('0x6'):salesforce[_0x29bc16](_0x5c14ac,_0x88c925,_0x1e745d,_0x3e891e,_0x5b50bc,_0x5674ac,_0x23cc04);break;case _0xa663('0x7'):sugarcrm[_0x29bc16](_0x5c14ac,_0x88c925,_0x1e745d,_0x3e891e,_0x5b50bc,_0x5674ac,_0x23cc04);break;case _0xa663('0x19'):freshdesk[_0x29bc16](_0x5c14ac,_0x88c925,_0x1e745d,_0x3e891e,_0x5b50bc,_0x5674ac,_0x23cc04);break;case _0xa663('0x1a'):zoho[_0x29bc16](_0x5c14ac,_0x88c925,_0x1e745d,_0x3e891e,_0x5b50bc,_0x5674ac,_0x23cc04);break;case _0xa663('0x8'):desk[_0x29bc16](_0x5c14ac,_0x88c925,_0x1e745d,_0x3e891e,_0x5b50bc,_0x5674ac,_0x23cc04);break;case _0xa663('0x9'):vtiger[_0x29bc16](_0x5c14ac,_0x88c925,_0x1e745d,_0x3e891e,_0x5b50bc,_0x5674ac,_0x23cc04);break;case _0xa663('0xa'):freshsales['cs'](_0x5c14ac,_0x88c925,_0x1e745d,_0x3e891e,_0x5b50bc,_0x5674ac,_0x23cc04,_0x29bc16);break;case _0xa663('0xb'):servicenow['cs'](_0x5c14ac,_0x88c925,_0x1e745d,_0x3e891e,_0x5b50bc,_0x5674ac,_0x23cc04,_0x29bc16);break;case _0xa663('0x1b'):dynamics365['cs'](_0x5c14ac,_0x88c925,_0x1e745d,_0x3e891e,_0x5b50bc,_0x5674ac,_0x23cc04,_0x29bc16);break;default:console['log'](_0xa663('0x1c'));}}else{_0x1436d4=require(_0xa663('0x1d'))(_0x5c14ac[_0xa663('0xe')]['toLowerCase']());_0x1436d4[_0xa663('0x1e')](_0xa663('0x1f'),util[_0xa663('0x20')](_0xa663('0x21'),_0x5c14ac[_0xa663('0xe')][_0xa663('0xf')](),_0x5c14ac['data3']));}}else{_0x1436d4=require(_0xa663('0x1d'))(_0x5c14ac[_0xa663('0xe')][_0xa663('0xf')]());_0x1436d4[_0xa663('0x1e')](_0xa663('0x1f'),util[_0xa663('0x20')](_0xa663('0x22'),_0x5c14ac[_0xa663('0xe')][_0xa663('0xf')](),_0x5c14ac['data2']));}}else{}}catch(_0x420aca){console['error'](_0x420aca);}}}}; \ No newline at end of file +var _0xe7fa=['desk','freshsales','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./servicenow','./freshsales','salesforce','vtiger','dynamics365','servicenow','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','log','unmanaged','zendesk','sugarcrm'];(function(_0xa0bc4b,_0x56b3bf){var _0x17da95=function(_0x2a29a6){while(--_0x2a29a6){_0xa0bc4b['push'](_0xa0bc4b['shift']());}};_0x17da95(++_0x56b3bf);}(_0xe7fa,0x15c));var _0xae7f=function(_0x11d164,_0x2e0030){_0x11d164=_0x11d164-0x0;var _0xf234bc=_0xe7fa[_0x11d164];return _0xf234bc;};'use strict';var _=require(_0xae7f('0x0'));var util=require(_0xae7f('0x1'));var zendesk=require(_0xae7f('0x2'));var salesforce=require(_0xae7f('0x3'));var sugarcrm=require(_0xae7f('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0xae7f('0x5'));var desk=require(_0xae7f('0x6'));var vtiger=require('./vtiger');var servicenow=require(_0xae7f('0x7'));var dynamics365=require('./dynamics365');var freshsales=require(_0xae7f('0x8'));var integrations=['zendesk',_0xae7f('0x9'),'sugarcrm','freshdesk','zoho','desk',_0xae7f('0xa'),_0xae7f('0xb'),'freshsales',_0xae7f('0xc')];exports['exec']=function(_0x49bfb7,_0x1e102f,_0x236c24,_0x368088,_0x4f45fa,_0x377dc4){if(_0x236c24){if(_[_0xae7f('0xd')](integrations,_0x49bfb7[_0xae7f('0xe')][_0xae7f('0xf')]())){try{var _0x2df91e=null;var _0x441779='';var _0x4e124e=_0x236c24[_0x49bfb7[_0xae7f('0xe')]['toLowerCase']()];if(_0x4e124e){var _0x13dd33=_0x4e124e[_0x49bfb7[_0xae7f('0x10')]];if(_0x13dd33){var _0x4aef6e=_[_0xae7f('0x11')](_0x13dd33[_0xae7f('0x12')],{'id':parseInt(_0x49bfb7[_0xae7f('0x13')],0xa)});if(_0x4aef6e){if(_0x368088){if(_0x4f45fa&&_0x1e102f[_0xae7f('0x14')]){_0x441779=_0xae7f('0x14');}else if(_0x1e102f[_0xae7f('0x15')]){_0x441779='outbound';}else{console[_0xae7f('0x16')]('EVENT\x20UNKNOWN',_0x1e102f);}}else{_0x441779=_0xae7f('0x17');}switch(_0x49bfb7['data1'][_0xae7f('0xf')]()){case _0xae7f('0x18'):zendesk[_0x441779](_0x49bfb7,_0x1e102f,_0x4aef6e,_0x368088,_0x4f45fa,_0x13dd33,_0x377dc4);break;case'salesforce':salesforce[_0x441779](_0x49bfb7,_0x1e102f,_0x4aef6e,_0x368088,_0x4f45fa,_0x13dd33,_0x377dc4);break;case _0xae7f('0x19'):sugarcrm[_0x441779](_0x49bfb7,_0x1e102f,_0x4aef6e,_0x368088,_0x4f45fa,_0x13dd33,_0x377dc4);break;case'freshdesk':freshdesk[_0x441779](_0x49bfb7,_0x1e102f,_0x4aef6e,_0x368088,_0x4f45fa,_0x13dd33,_0x377dc4);break;case'zoho':zoho[_0x441779](_0x49bfb7,_0x1e102f,_0x4aef6e,_0x368088,_0x4f45fa,_0x13dd33,_0x377dc4);break;case _0xae7f('0x1a'):desk[_0x441779](_0x49bfb7,_0x1e102f,_0x4aef6e,_0x368088,_0x4f45fa,_0x13dd33,_0x377dc4);break;case'vtiger':vtiger[_0x441779](_0x49bfb7,_0x1e102f,_0x4aef6e,_0x368088,_0x4f45fa,_0x13dd33,_0x377dc4);break;case _0xae7f('0x1b'):freshsales['cs'](_0x49bfb7,_0x1e102f,_0x4aef6e,_0x368088,_0x4f45fa,_0x13dd33,_0x377dc4,_0x441779);break;case _0xae7f('0xc'):servicenow['cs'](_0x49bfb7,_0x1e102f,_0x4aef6e,_0x368088,_0x4f45fa,_0x13dd33,_0x377dc4,_0x441779);break;case _0xae7f('0xb'):dynamics365['cs'](_0x49bfb7,_0x1e102f,_0x4aef6e,_0x368088,_0x4f45fa,_0x13dd33,_0x377dc4,_0x441779);break;default:console[_0xae7f('0x16')]('unknown\x20integration');}}else{_0x2df91e=require(_0xae7f('0x1c'))(_0x49bfb7[_0xae7f('0xe')]['toLowerCase']());_0x2df91e[_0xae7f('0x1d')]('[EXEC]',util[_0xae7f('0x1e')](_0xae7f('0x1f'),_0x49bfb7[_0xae7f('0xe')][_0xae7f('0xf')](),_0x49bfb7['data3']));}}else{_0x2df91e=require('../../../../config/logger')(_0x49bfb7['data1']['toLowerCase']());_0x2df91e[_0xae7f('0x1d')](_0xae7f('0x20'),util['format'](_0xae7f('0x21'),_0x49bfb7[_0xae7f('0xe')]['toLowerCase'](),_0x49bfb7[_0xae7f('0x10')]));}}else{}}catch(_0x2d4b14){console[_0xae7f('0x1d')](_0x2d4b14);}}}}; \ 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 9657ac8..1eec8b1 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 _0xc389=['Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','isNil','lodash','request-promise','moment','bluebird','jsforce','util','./util','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','lead','WhoId','account','WhatId','Case','contact','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','validateEmail','sobject','User','find','execute','then','Agent\x20%s\x20found.','resolve','Name','identity','user_id','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','first','Phone','type','toLowerCase','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','string','idField','toString','variable','variableName','Variable','name','password','concat','securityToken','Connection','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','queue','stripTrailingSlash','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','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','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0xc389,0x10c));var _0x9c38=function(_0x3c20c9,_0x49d60c){_0x3c20c9=_0x3c20c9-0x0;var _0x173dc3=_0xc389[_0x3c20c9];return _0x173dc3;};'use strict';var _=require(_0x9c38('0x0'));var rp=require(_0x9c38('0x1'));var moment=require(_0x9c38('0x2'));var BPromise=require(_0x9c38('0x3'));var md5=require('md5');var jsforce=require(_0x9c38('0x4'));var util=require(_0x9c38('0x5'));var Redis=require('ioredis');var intUtil=require(_0x9c38('0x6'));var config=require(_0x9c38('0x7'));var logger=require('../../../../config/logger')(_0x9c38('0x8'));config[_0x9c38('0x9')]=_[_0x9c38('0xa')](config[_0x9c38('0x9')],{'host':_0x9c38('0xb'),'port':0x18eb});var io=require(_0x9c38('0xc'))(new Redis(config[_0x9c38('0x9')]));function emit(_0x70b76a,_0x468afe,_0x3433fd){io['to'](_0x70b76a)['emit'](_0x468afe,_0x3433fd);}function getTicket(_0x1e8d91,_0x5a83ed,_0x5a2b0f,_0x7cd3d,_0x1d7513,_0x1765f7,_0x29f057,_0x5b49d4){var _0x4ff370=Object[_0x9c38('0xd')]({},{'OwnerId':_0x5a83ed['id'],'Subject':intUtil[_0x9c38('0xe')](_0x7cd3d[_0x9c38('0xf')],_0x1d7513,'\x20'),'Description':intUtil[_0x9c38('0xe')](_0x7cd3d[_0x9c38('0x10')],_0x1d7513,'\x0a')},getCustomFields(_0x1765f7,_0x1d7513));if(_0x5a2b0f){if(_0x7cd3d[_0x9c38('0x11')]===_0x9c38('0x12')){_0x4ff370[_0x9c38('0x13')]=moment[_0x9c38('0x14')]();_0x4ff370['IsReminderSet']=![];_0x4ff370[_0x9c38('0x15')]=![];if(_0x5a2b0f[_0x9c38('0x16')]==='contact'||_0x5a2b0f[_0x9c38('0x16')]===_0x9c38('0x17')){_0x4ff370[_0x9c38('0x18')]=_0x5a2b0f['id'];}else if(_0x5a2b0f[_0x9c38('0x16')]===_0x9c38('0x19')){_0x4ff370[_0x9c38('0x1a')]=_0x5a2b0f['id'];}}else if(_0x7cd3d['ticketType']===_0x9c38('0x1b')){if(_0x5a2b0f[_0x9c38('0x16')]===_0x9c38('0x1c')){_0x4ff370[_0x9c38('0x1d')]=_0x5a2b0f['id'];}else if(_0x5a2b0f['endUserType']==='account'){_0x4ff370[_0x9c38('0x1e')]=_0x5a2b0f['id'];}else if(_0x5a2b0f[_0x9c38('0x16')]===_0x9c38('0x17')&&_0x7cd3d[_0x9c38('0x1f')]){_0x4ff370[_0x7cd3d[_0x9c38('0x1f')]]=_0x5a2b0f['id'];}else{logger[_0x9c38('0x20')](_0x9c38('0x21'));}}}return _0x29f057['sobject'](_0x7cd3d[_0x9c38('0x11')])[_0x9c38('0x22')](_0x4ff370);}function getUser(_0x4acb5f,_0x1b5aae,_0x23d927){if(!_['isNil'](_0x1b5aae)&&intUtil[_0x9c38('0x23')](_0x1b5aae)){var _0xddb6c8={'Email':_0x1b5aae};var _0x47055f={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x23d927[_0x9c38('0x24')](_0x9c38('0x25'))[_0x9c38('0x26')](_0xddb6c8,_0x47055f)[_0x9c38('0x27')]()[_0x9c38('0x28')](function(_0x15e473){if(_0x15e473['length']){var _0x123166=_[_0x9c38('0x26')](_0x15e473,function(_0x143159){return _0x143159['Email']===_0x1b5aae;});if(_0x123166){logger['info'](_0x9c38('0x29'),_0x1b5aae);return BPromise[_0x9c38('0x2a')]({'id':_0x123166['Id'],'name':_0x123166[_0x9c38('0x2b')]});}}else{logger[_0x9c38('0x20')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x1b5aae);return _0x23d927[_0x9c38('0x2c')]()[_0x9c38('0x28')](function(_0x37debb){return BPromise[_0x9c38('0x2a')]({'id':_0x37debb[_0x9c38('0x2d')],'name':_0x37debb['display_name']});});}});}else{logger['info'](_0x9c38('0x2e'),_0x1b5aae);return _0x23d927['identity']()[_0x9c38('0x28')](function(_0x4c3fb4){return BPromise['resolve']({'id':_0x4c3fb4[_0x9c38('0x2d')],'name':_0x4c3fb4[_0x9c38('0x2f')]});});}}function getEndUser(_0xdc09b9,_0x439a34,_0xdf716b,_0x47e7f8,_0xbbf8a2){var _0x404b4d={'$or':{'Phone':_0x47e7f8}};var _0x67b4bb={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x9c38('0x2a')]()[_0x9c38('0x28')](function(){logger['info'](_0x9c38('0x30'),_0x47e7f8,_0x439a34[_0x9c38('0x31')]);switch(_0x439a34[_0x9c38('0x31')]){case _0x9c38('0x32'):var _0x4f395e=_[_0x9c38('0x33')](_0x404b4d);if(_0x439a34[_0x9c38('0x34')]){var _0x143a20={};_0x143a20[_0x439a34[_0x9c38('0x34')]]=_0x47e7f8;_[_0x9c38('0x35')](_0x4f395e[_0x9c38('0x36')],_0x143a20);}return _0xbbf8a2[_0x9c38('0x24')](_0x9c38('0x37'))['find'](_0x4f395e,_0x67b4bb)[_0x9c38('0x27')]()[_0x9c38('0x28')](function(_0x267bc8){if(_0x267bc8&&_0x267bc8[_0x9c38('0x38')]){return _0x267bc8;}else{var _0x5bb64d=_[_0x9c38('0x33')](_0x404b4d);if(_0x439a34[_0x9c38('0x39')]){var _0x21f698={};_0x21f698[_0x439a34['additionalSearchLead']]=_0x47e7f8;_[_0x9c38('0x35')](_0x5bb64d[_0x9c38('0x36')],_0x21f698);}return _0xbbf8a2[_0x9c38('0x24')](_0x9c38('0x3a'))[_0x9c38('0x26')](_0x5bb64d,_0x67b4bb);}});case _0x9c38('0x3b'):var _0x5a1cbb=_[_0x9c38('0x33')](_0x404b4d);if(_0x439a34[_0x9c38('0x3c')]){var _0x143a20={};_0x143a20[_0x439a34[_0x9c38('0x3c')]]=_0x47e7f8;_['merge'](_0x5a1cbb[_0x9c38('0x36')],_0x143a20);}return _0xbbf8a2[_0x9c38('0x24')]('Account')[_0x9c38('0x26')](_0x5a1cbb,_0x67b4bb)[_0x9c38('0x27')]()['then'](function(_0x4bf06f){if(_0x4bf06f&&_0x4bf06f[_0x9c38('0x38')]){return _0x4bf06f;}else{var _0x2a5536=_[_0x9c38('0x33')](_0x404b4d);if(_0x439a34['additionalSearchContact']){var _0x1b96bc={};_0x1b96bc[_0x439a34[_0x9c38('0x34')]]=_0x47e7f8;_[_0x9c38('0x35')](_0x2a5536[_0x9c38('0x36')],_0x1b96bc);}return _0xbbf8a2[_0x9c38('0x24')](_0x9c38('0x37'))[_0x9c38('0x26')](_0x2a5536,_0x67b4bb)[_0x9c38('0x28')](function(_0x1c3fd5){if(_0x1c3fd5&&_0x1c3fd5[_0x9c38('0x38')]){return _0x1c3fd5;}else{var _0x5b1b25=_[_0x9c38('0x33')](_0x404b4d);if(_0x439a34[_0x9c38('0x39')]){var _0x5bc0bc={};_0x5bc0bc[_0x439a34['additionalSearchLead']]=_0x47e7f8;_[_0x9c38('0x35')](_0x5b1b25[_0x9c38('0x36')],_0x5bc0bc);}return _0xbbf8a2[_0x9c38('0x24')](_0x9c38('0x3a'))['find'](_0x5b1b25,_0x67b4bb);}});}});case _0x9c38('0x1c'):var _0x4f395e=_[_0x9c38('0x33')](_0x404b4d);if(_0x439a34[_0x9c38('0x34')]){var _0x143a20={};_0x143a20[_0x439a34[_0x9c38('0x34')]]=_0x47e7f8;_[_0x9c38('0x35')](_0x4f395e[_0x9c38('0x36')],_0x143a20);}return _0xbbf8a2[_0x9c38('0x24')](_0x9c38('0x37'))[_0x9c38('0x26')](_0x4f395e,_0x67b4bb)[_0x9c38('0x27')]();case _0x9c38('0x17'):var _0x57cb8b=_['cloneDeep'](_0x404b4d);if(_0x439a34[_0x9c38('0x39')]){var _0x143a20={};_0x143a20[_0x439a34[_0x9c38('0x39')]]=_0x47e7f8;_['merge'](_0x57cb8b[_0x9c38('0x36')],_0x143a20);}return _0xbbf8a2[_0x9c38('0x24')]('Lead')['find'](_0x57cb8b,_0x67b4bb);case _0x9c38('0x19'):var _0x5a1cbb=_['cloneDeep'](_0x404b4d);if(_0x439a34[_0x9c38('0x3c')]){var _0x143a20={};_0x143a20[_0x439a34[_0x9c38('0x3c')]]=_0x47e7f8;_[_0x9c38('0x35')](_0x5a1cbb[_0x9c38('0x36')],_0x143a20);}return _0xbbf8a2['sobject']('Account')[_0x9c38('0x26')](_0x5a1cbb,_0x67b4bb);default:return null;}})[_0x9c38('0x28')](function(_0x11a996){if(_0x11a996&&_0x11a996['length']){var _0x44f555=_[_0x9c38('0x3d')](_0x11a996);if(_0x44f555){return BPromise[_0x9c38('0x2a')]({'id':_0x44f555['Id'],'name':_0x44f555[_0x9c38('0x2b')],'phone':_0x44f555[_0x9c38('0x3e')],'endUserType':_0x44f555['attributes'][_0x9c38('0x3f')][_0x9c38('0x40')]()});}}})[_0x9c38('0x28')](function(_0x479889){if(_0x479889){logger[_0x9c38('0x20')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x479889[_0x9c38('0x16')],_0x47e7f8);return BPromise[_0x9c38('0x2a')](_0x479889);}else{logger[_0x9c38('0x20')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x47e7f8);var _0x6f1b70={'Phone':_0x47e7f8};if(_0x439a34[_0x9c38('0x41')]){if(_0x439a34[_0x9c38('0x41')]===_0x9c38('0x1c')){logger[_0x9c38('0x20')](_0x9c38('0x42'),_0x47e7f8,_0x439a34['moduleCreate']);_0x6f1b70[_0x9c38('0x43')]=_0xdf716b!==_0x9c38('0x44')?_0xdf716b:util[_0x9c38('0x45')]('Caller\x20-\x20%s',_0x47e7f8);}else if(_0x439a34[_0x9c38('0x41')]==='lead'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x47e7f8,_0x439a34[_0x9c38('0x41')]);_0x6f1b70[_0x9c38('0x43')]=_0xdf716b!==_0x9c38('0x44')?_0xdf716b:util[_0x9c38('0x45')](_0x9c38('0x46'),_0x47e7f8);_0x6f1b70[_0x9c38('0x47')]=_0x9c38('0x48');}else if(_0x439a34[_0x9c38('0x41')]===_0x9c38('0x19')){logger[_0x9c38('0x20')](_0x9c38('0x42'),_0x47e7f8,_0x439a34[_0x9c38('0x41')]);_0x6f1b70[_0x9c38('0x2b')]=_0xdf716b!==''?_0xdf716b:util[_0x9c38('0x45')](_0x9c38('0x46'),_0x47e7f8);}else{return null;}}return _0xbbf8a2[_0x9c38('0x24')](_[_0x9c38('0x49')](_0x439a34['moduleCreate']))['create'](_0x6f1b70)['then'](function(_0x9826db){return BPromise[_0x9c38('0x2a')]({'id':_0x9826db['id'],'endUserType':_0x439a34['moduleCreate']});});}});}function getCustomFields(_0x323e5d,_0x41d1e6){var _0x3216e3={};if(_0x323e5d[_0x9c38('0x38')]>0x0){_[_0x9c38('0x4a')](_0x323e5d,function(_0x609c41){if(_['includes']([_0x9c38('0x4b'),'picklist'],_0x609c41[_0x9c38('0x3f')])&&_0x609c41[_0x9c38('0x4c')]){_0x3216e3[_0x609c41['idField']]=_0x609c41['content'][_0x9c38('0x4d')]();}else if(_0x609c41['type']===_0x9c38('0x4e')&&_0x609c41[_0x9c38('0x4f')]&&_0x609c41[_0x9c38('0x4c')]){_0x41d1e6[_0x609c41['variableName']]&&(_0x3216e3[_0x609c41[_0x9c38('0x4c')]]=_0x41d1e6[_0x609c41[_0x9c38('0x4f')]][_0x9c38('0x4d')]());}else if(_0x609c41[_0x9c38('0x3f')]==='customVariable'&&_0x609c41[_0x9c38('0x50')]&&_0x609c41[_0x9c38('0x50')][_0x9c38('0x51')]&&_0x609c41[_0x9c38('0x4c')]){_0x41d1e6[_0x609c41[_0x9c38('0x50')][_0x9c38('0x51')]['toLowerCase']()]&&(_0x3216e3[_0x609c41['idField']]=_0x41d1e6[_0x609c41[_0x9c38('0x50')][_0x9c38('0x51')][_0x9c38('0x40')]()]['toString']());}});}return _0x3216e3;}function getConnection(_0x47e0f8){var _0x40da18=_0x47e0f8[_0x9c38('0x52')][_0x9c38('0x53')](_0x47e0f8[_0x9c38('0x54')]);var _0x239485=new jsforce[(_0x9c38('0x55'))]({'oauth2':{'loginUrl':_0x47e0f8[_0x9c38('0x56')]||'https://login.salesforce.com','clientId':_0x47e0f8[_0x9c38('0x57')],'clientSecret':_0x47e0f8[_0x9c38('0x58')]}});return _0x239485[_0x9c38('0x59')](_0x47e0f8[_0x9c38('0x5a')],_0x40da18)['then'](function(){logger[_0x9c38('0x20')](_0x9c38('0x5b'));return _0x239485;});}exports[_0x9c38('0x5c')]=function(_0x5d756e,_0x520e0b,_0x33a6e9,_0x29f21f,_0x541b50,_0x23c7f0){var _0x2af053,_0x452acc,_0x243b78,_0x194cba;_0x23c7f0['serverUrl']=intUtil[_0x9c38('0x5d')](_0x23c7f0['serverUrl']);_0x23c7f0[_0x9c38('0x56')]=intUtil[_0x9c38('0x5d')](_0x23c7f0[_0x9c38('0x56')]);if(_0x541b50&&_0x541b50['monitor_format']){logger[_0x9c38('0x20')]('[QUEUE]','Recording\x20is\x20enabled!');_0x520e0b[_0x9c38('0x5e')]=util[_0x9c38('0x45')](_0x9c38('0x5f'),_0x23c7f0[_0x9c38('0x60')],_0x520e0b[_0x9c38('0x61')],md5(_0x520e0b[_0x9c38('0x61')]));}else{_0x520e0b['recordingURL']='';}return getConnection(_0x23c7f0)['then'](function(_0x3d25af){_0x194cba=_0x3d25af;return getUser(_0x23c7f0,_0x29f21f[_0x9c38('0x62')],_0x194cba);})[_0x9c38('0x28')](function(_0x103aae){_0x2af053=_0x103aae;return getEndUser(_0x23c7f0,_0x33a6e9,_0x520e0b[_0x9c38('0x63')],_0x520e0b[_0x9c38('0x64')],_0x194cba);})[_0x9c38('0x28')](function(_0x509f2b){_0x452acc=_0x509f2b;return getTicket(_0x23c7f0,_0x2af053,_0x452acc,_0x33a6e9,_0x520e0b,_0x33a6e9[_0x9c38('0x65')],_0x194cba,_0x9c38('0x5c'));})[_0x9c38('0x28')](function(_0x52314a){_0x243b78=_0x52314a;logger[_0x9c38('0x20')](_0x9c38('0x66'),_0x243b78['id']);logger[_0x9c38('0x20')](_0x9c38('0x67'),_0x243b78['id'],_0x29f21f[_0x9c38('0x51')],_0x23c7f0[_0x9c38('0x3f')]);switch(_0x23c7f0[_0x9c38('0x3f')]){case _0x9c38('0x68'):emit(util[_0x9c38('0x45')](_0x9c38('0x69'),_0x29f21f[_0x9c38('0x51')]),_0x9c38('0x6a'),{'recordId':_0x243b78['id']});break;case _0x9c38('0x6b'):emit(util[_0x9c38('0x45')](_0x9c38('0x69'),_0x29f21f[_0x9c38('0x51')]),_0x9c38('0x6c'),{'uri':util[_0x9c38('0x45')](_0x9c38('0x6d'),_0x194cba[_0x9c38('0x6e')],_0x243b78['id'])});break;default:logger[_0x9c38('0x6f')](_0x9c38('0x70'));}})[_0x9c38('0x71')](function(_0x1a87ed){logger[_0x9c38('0x6f')](_0x9c38('0x72'),_0x1a87ed);});};exports[_0x9c38('0x73')]=function(_0x29c762,_0x3e749d,_0x195a08,_0x27f531,_0x515a6d,_0x1331ff,_0x3dc86b){var _0x341979,_0x57ebcc,_0x41b72f,_0xe01e5e;_0x1331ff['serverUrl']=intUtil[_0x9c38('0x5d')](_0x1331ff[_0x9c38('0x60')]);_0x1331ff[_0x9c38('0x56')]=intUtil['stripTrailingSlash'](_0x1331ff[_0x9c38('0x56')]);if(_0x3dc86b&&_0x3dc86b['recordingFormat']&&_0x3dc86b[_0x9c38('0x74')]!==_0x9c38('0x75')){logger[_0x9c38('0x20')](_0x9c38('0x76'),_0x9c38('0x77'));_0x3e749d[_0x9c38('0x5e')]=util[_0x9c38('0x45')](_0x9c38('0x5f'),_0x1331ff['serverUrl'],_0x3e749d[_0x9c38('0x61')],md5(_0x3e749d['uniqueid']));}return getConnection(_0x1331ff)[_0x9c38('0x28')](function(_0x14a068){_0xe01e5e=_0x14a068;return getUser(_0x1331ff,_0x27f531[_0x9c38('0x62')],_0xe01e5e);})[_0x9c38('0x28')](function(_0x2eb7a7){_0x341979=_0x2eb7a7;return getEndUser(_0x1331ff,_0x195a08,_0x3e749d[_0x9c38('0x78')],_0x3e749d[_0x9c38('0x79')],_0xe01e5e);})['then'](function(_0x41128c){_0x57ebcc=_0x41128c;return getTicket(_0x1331ff,_0x341979,_0x57ebcc,_0x195a08,_0x3e749d,_0x195a08[_0x9c38('0x65')],_0xe01e5e,_0x9c38('0x73'));})[_0x9c38('0x28')](function(_0x33156c){_0x41b72f=_0x33156c;logger['info'](_0x9c38('0x7a'),_0x41b72f['id']);logger[_0x9c38('0x20')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x41b72f['id'],_0x27f531['name'],_0x1331ff[_0x9c38('0x3f')]);switch(_0x1331ff[_0x9c38('0x3f')]){case _0x9c38('0x68'):emit(util['format'](_0x9c38('0x69'),_0x27f531['name']),_0x9c38('0x6a'),{'recordId':_0x41b72f['id']});break;case _0x9c38('0x6b'):emit(util['format'](_0x9c38('0x69'),_0x27f531[_0x9c38('0x51')]),_0x9c38('0x6c'),{'uri':util[_0x9c38('0x45')](_0x9c38('0x6d'),_0xe01e5e[_0x9c38('0x6e')],_0x41b72f['id'])});break;default:logger[_0x9c38('0x6f')](_0x9c38('0x76'),_0x9c38('0x7b'));}})[_0x9c38('0x71')](function(_0x3c35f3){logger['error'](_0x9c38('0x76'),_0x3c35f3);});};exports[_0x9c38('0x7c')]=function(_0xbc7d91,_0x2744c6,_0x35dfa2,_0x18c4bf,_0x5eab54,_0x1bff2c){var _0x1634d0,_0x48c275,_0x27fbae,_0x352357;_0x1bff2c[_0x9c38('0x60')]=intUtil[_0x9c38('0x5d')](_0x1bff2c[_0x9c38('0x60')]);_0x1bff2c[_0x9c38('0x56')]=intUtil[_0x9c38('0x5d')](_0x1bff2c['remoteUri']);if(_0x5eab54&&_0x5eab54[_0x9c38('0x7d')]){logger[_0x9c38('0x20')]('['+_0x2744c6[_0x9c38('0x7e')][_0x9c38('0x7f')]()+']',_0x9c38('0x77'));_0x2744c6[_0x9c38('0x5e')]=util[_0x9c38('0x45')](_0x9c38('0x5f'),_0x1bff2c['serverUrl'],_0x2744c6[_0x9c38('0x61')],md5(_0x2744c6[_0x9c38('0x61')]));}else{_0x2744c6[_0x9c38('0x5e')]='';}return getConnection(_0x1bff2c)[_0x9c38('0x28')](function(_0x2652ed){_0x352357=_0x2652ed;if(!_[_0x9c38('0x80')](_0x18c4bf)){return getUser(_0x1bff2c,_0x18c4bf[_0x9c38('0x51')],_0x352357);}else{return getUser(_0x1bff2c,null,_0x352357);}})[_0x9c38('0x28')](function(_0x50a547){_0x1634d0=_0x50a547;return getEndUser(_0x1bff2c,_0x35dfa2,_0x2744c6[_0x9c38('0x63')],_0x2744c6[_0x9c38('0x64')],_0x352357);})[_0x9c38('0x28')](function(_0x437aa8){_0x48c275=_0x437aa8;return getTicket(_0x1bff2c,_0x1634d0,_0x48c275,_0x35dfa2,_0x2744c6,_0x35dfa2[_0x9c38('0x65')],_0x352357);})[_0x9c38('0x28')](function(_0x196dcf){_0x27fbae=_0x196dcf;logger['info']('['+_0x2744c6[_0x9c38('0x7e')][_0x9c38('0x7f')]()+']\x20Ticket\x20%s\x20created.',_0x27fbae['id']);logger['info']('['+_0x2744c6[_0x9c38('0x7e')][_0x9c38('0x7f')]()+']\x20Integration\x20account\x20type\x20%s.',_0x1bff2c['type']);})[_0x9c38('0x71')](function(_0x28e1fa){logger[_0x9c38('0x6f')]('['+_0x2744c6[_0x9c38('0x7e')][_0x9c38('0x7f')]()+']',_0x28e1fa);});}; \ No newline at end of file +var _0x1698=['[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','ioredis','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','emit','assign','getString','Subjects','utc','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','ticketType','account','AccountId','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','execute','then','Email','info','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','Contact','length','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','No\x20Company','upperFirst','forEach','includes','string','idField','variable','variableName','toString','customVariable','Variable','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','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','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','[QUEUE]','outbound','stripTrailingSlash','none'];(function(_0x5c42c7,_0x11b1fe){var _0x2fe11f=function(_0x3c9ac6){while(--_0x3c9ac6){_0x5c42c7['push'](_0x5c42c7['shift']());}};_0x2fe11f(++_0x11b1fe);}(_0x1698,0x107));var _0x8169=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x1698[_0x44d9ab];return _0x31485e;};'use strict';var _=require(_0x8169('0x0'));var rp=require(_0x8169('0x1'));var moment=require(_0x8169('0x2'));var BPromise=require(_0x8169('0x3'));var md5=require(_0x8169('0x4'));var jsforce=require('jsforce');var util=require('util');var Redis=require(_0x8169('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x8169('0x6'))(_0x8169('0x7'));config['redis']=_[_0x8169('0x8')](config[_0x8169('0x9')],{'host':_0x8169('0xa'),'port':0x18eb});var io=require(_0x8169('0xb'))(new Redis(config[_0x8169('0x9')]));function emit(_0x12969c,_0x51681e,_0x309252){io['to'](_0x12969c)[_0x8169('0xc')](_0x51681e,_0x309252);}function getTicket(_0x2d5eb0,_0x23907a,_0x2d802c,_0xc23866,_0x269af2,_0x1e7aaf,_0x487357,_0x586769){var _0x577cfc=Object[_0x8169('0xd')]({},{'OwnerId':_0x23907a['id'],'Subject':intUtil[_0x8169('0xe')](_0xc23866[_0x8169('0xf')],_0x269af2,'\x20'),'Description':intUtil[_0x8169('0xe')](_0xc23866['Descriptions'],_0x269af2,'\x0a')},getCustomFields(_0x1e7aaf,_0x269af2));if(_0x2d802c){if(_0xc23866['ticketType']==='Task'){_0x577cfc['ActivityDate']=moment[_0x8169('0x10')]();_0x577cfc[_0x8169('0x11')]=![];_0x577cfc[_0x8169('0x12')]=![];if(_0x2d802c[_0x8169('0x13')]===_0x8169('0x14')||_0x2d802c[_0x8169('0x13')]==='lead'){_0x577cfc[_0x8169('0x15')]=_0x2d802c['id'];}else if(_0x2d802c[_0x8169('0x13')]==='account'){_0x577cfc['WhatId']=_0x2d802c['id'];}}else if(_0xc23866[_0x8169('0x16')]==='Case'){if(_0x2d802c[_0x8169('0x13')]===_0x8169('0x14')){_0x577cfc['ContactId']=_0x2d802c['id'];}else if(_0x2d802c[_0x8169('0x13')]===_0x8169('0x17')){_0x577cfc[_0x8169('0x18')]=_0x2d802c['id'];}else if(_0x2d802c[_0x8169('0x13')]===_0x8169('0x19')&&_0xc23866['leadId']){_0x577cfc[_0xc23866[_0x8169('0x1a')]]=_0x2d802c['id'];}else{logger['info'](_0x8169('0x1b'));}}}return _0x487357[_0x8169('0x1c')](_0xc23866[_0x8169('0x16')])[_0x8169('0x1d')](_0x577cfc);}function getUser(_0xd79142,_0x410bdd,_0x4753e4){if(!_[_0x8169('0x1e')](_0x410bdd)&&intUtil[_0x8169('0x1f')](_0x410bdd)){var _0x32ac70={'Email':_0x410bdd};var _0x43d17c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4753e4['sobject']('User')[_0x8169('0x20')](_0x32ac70,_0x43d17c)[_0x8169('0x21')]()[_0x8169('0x22')](function(_0x1a0415){if(_0x1a0415['length']){var _0x3bf3cb=_[_0x8169('0x20')](_0x1a0415,function(_0x39089a){return _0x39089a[_0x8169('0x23')]===_0x410bdd;});if(_0x3bf3cb){logger[_0x8169('0x24')](_0x8169('0x25'),_0x410bdd);return BPromise['resolve']({'id':_0x3bf3cb['Id'],'name':_0x3bf3cb[_0x8169('0x26')]});}}else{logger[_0x8169('0x24')](_0x8169('0x27'),_0x410bdd);return _0x4753e4['identity']()[_0x8169('0x22')](function(_0x5995f0){return BPromise[_0x8169('0x28')]({'id':_0x5995f0[_0x8169('0x29')],'name':_0x5995f0[_0x8169('0x2a')]});});}});}else{logger[_0x8169('0x24')](_0x8169('0x27'),_0x410bdd);return _0x4753e4[_0x8169('0x2b')]()[_0x8169('0x22')](function(_0x18b620){return BPromise[_0x8169('0x28')]({'id':_0x18b620['user_id'],'name':_0x18b620[_0x8169('0x2a')]});});}}function getEndUser(_0x4b6635,_0x16daec,_0x2c36af,_0x311f9c,_0x36433c){var _0x4eed07={'$or':{'Phone':_0x311f9c}};var _0x1bd23e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x8169('0x28')]()[_0x8169('0x22')](function(){logger[_0x8169('0x24')](_0x8169('0x2c'),_0x311f9c,_0x16daec[_0x8169('0x2d')]);switch(_0x16daec[_0x8169('0x2d')]){case'contact_lead':var _0x5a0375=_[_0x8169('0x2e')](_0x4eed07);if(_0x16daec[_0x8169('0x2f')]){var _0x3d2109={};_0x3d2109[_0x16daec['additionalSearchContact']]=_0x311f9c;_[_0x8169('0x30')](_0x5a0375['$or'],_0x3d2109);}return _0x36433c[_0x8169('0x1c')](_0x8169('0x31'))['find'](_0x5a0375,_0x1bd23e)['execute']()[_0x8169('0x22')](function(_0x1f998c){if(_0x1f998c&&_0x1f998c[_0x8169('0x32')]){return _0x1f998c;}else{var _0x23296d=_[_0x8169('0x2e')](_0x4eed07);if(_0x16daec['additionalSearchLead']){var _0x5565a1={};_0x5565a1[_0x16daec[_0x8169('0x33')]]=_0x311f9c;_[_0x8169('0x30')](_0x23296d[_0x8169('0x34')],_0x5565a1);}return _0x36433c[_0x8169('0x1c')](_0x8169('0x35'))[_0x8169('0x20')](_0x23296d,_0x1bd23e);}});case _0x8169('0x36'):var _0x290003=_['cloneDeep'](_0x4eed07);if(_0x16daec[_0x8169('0x37')]){var _0x3d2109={};_0x3d2109[_0x16daec[_0x8169('0x37')]]=_0x311f9c;_['merge'](_0x290003[_0x8169('0x34')],_0x3d2109);}return _0x36433c[_0x8169('0x1c')](_0x8169('0x38'))[_0x8169('0x20')](_0x290003,_0x1bd23e)[_0x8169('0x21')]()[_0x8169('0x22')](function(_0x190d61){if(_0x190d61&&_0x190d61['length']){return _0x190d61;}else{var _0x1f41cb=_['cloneDeep'](_0x4eed07);if(_0x16daec[_0x8169('0x2f')]){var _0x566700={};_0x566700[_0x16daec[_0x8169('0x2f')]]=_0x311f9c;_['merge'](_0x1f41cb[_0x8169('0x34')],_0x566700);}return _0x36433c[_0x8169('0x1c')]('Contact')[_0x8169('0x20')](_0x1f41cb,_0x1bd23e)[_0x8169('0x22')](function(_0x1760d3){if(_0x1760d3&&_0x1760d3[_0x8169('0x32')]){return _0x1760d3;}else{var _0x1bb05a=_[_0x8169('0x2e')](_0x4eed07);if(_0x16daec[_0x8169('0x33')]){var _0x15d632={};_0x15d632[_0x16daec[_0x8169('0x33')]]=_0x311f9c;_[_0x8169('0x30')](_0x1bb05a['$or'],_0x15d632);}return _0x36433c['sobject'](_0x8169('0x35'))[_0x8169('0x20')](_0x1bb05a,_0x1bd23e);}});}});case _0x8169('0x14'):var _0x5a0375=_['cloneDeep'](_0x4eed07);if(_0x16daec[_0x8169('0x2f')]){var _0x3d2109={};_0x3d2109[_0x16daec[_0x8169('0x2f')]]=_0x311f9c;_[_0x8169('0x30')](_0x5a0375['$or'],_0x3d2109);}return _0x36433c['sobject'](_0x8169('0x31'))[_0x8169('0x20')](_0x5a0375,_0x1bd23e)[_0x8169('0x21')]();case _0x8169('0x19'):var _0x14d725=_['cloneDeep'](_0x4eed07);if(_0x16daec[_0x8169('0x33')]){var _0x3d2109={};_0x3d2109[_0x16daec[_0x8169('0x33')]]=_0x311f9c;_['merge'](_0x14d725['$or'],_0x3d2109);}return _0x36433c[_0x8169('0x1c')]('Lead')[_0x8169('0x20')](_0x14d725,_0x1bd23e);case'account':var _0x290003=_[_0x8169('0x2e')](_0x4eed07);if(_0x16daec[_0x8169('0x37')]){var _0x3d2109={};_0x3d2109[_0x16daec[_0x8169('0x37')]]=_0x311f9c;_[_0x8169('0x30')](_0x290003[_0x8169('0x34')],_0x3d2109);}return _0x36433c['sobject']('Account')[_0x8169('0x20')](_0x290003,_0x1bd23e);default:return null;}})[_0x8169('0x22')](function(_0x70bb66){if(_0x70bb66&&_0x70bb66[_0x8169('0x32')]){var _0x152d09=_['first'](_0x70bb66);if(_0x152d09){return BPromise['resolve']({'id':_0x152d09['Id'],'name':_0x152d09[_0x8169('0x26')],'phone':_0x152d09['Phone'],'endUserType':_0x152d09['attributes'][_0x8169('0x39')][_0x8169('0x3a')]()});}}})[_0x8169('0x22')](function(_0x473331){if(_0x473331){logger[_0x8169('0x24')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x473331['endUserType'],_0x311f9c);return BPromise[_0x8169('0x28')](_0x473331);}else{logger[_0x8169('0x24')](_0x8169('0x3b'),_0x311f9c);var _0x22b667={'Phone':_0x311f9c};if(_0x16daec[_0x8169('0x3c')]){if(_0x16daec[_0x8169('0x3c')]==='contact'){logger[_0x8169('0x24')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x311f9c,_0x16daec[_0x8169('0x3c')]);_0x22b667[_0x8169('0x3d')]=_0x2c36af!==_0x8169('0x3e')?_0x2c36af:util[_0x8169('0x3f')](_0x8169('0x40'),_0x311f9c);}else if(_0x16daec[_0x8169('0x3c')]===_0x8169('0x19')){logger[_0x8169('0x24')](_0x8169('0x41'),_0x311f9c,_0x16daec[_0x8169('0x3c')]);_0x22b667['LastName']=_0x2c36af!==_0x8169('0x3e')?_0x2c36af:util[_0x8169('0x3f')](_0x8169('0x40'),_0x311f9c);_0x22b667['Company']=_0x8169('0x42');}else if(_0x16daec['moduleCreate']===_0x8169('0x17')){logger['info'](_0x8169('0x41'),_0x311f9c,_0x16daec[_0x8169('0x3c')]);_0x22b667[_0x8169('0x26')]=_0x2c36af!==_0x8169('0x3e')?_0x2c36af:util[_0x8169('0x3f')](_0x8169('0x40'),_0x311f9c);}else{return null;}}return _0x36433c[_0x8169('0x1c')](_[_0x8169('0x43')](_0x16daec['moduleCreate']))[_0x8169('0x1d')](_0x22b667)['then'](function(_0x419dc1){return BPromise[_0x8169('0x28')]({'id':_0x419dc1['id'],'endUserType':_0x16daec[_0x8169('0x3c')]});});}});}function getCustomFields(_0x1ef6fc,_0x56acf4){var _0x23943a={};if(_0x1ef6fc[_0x8169('0x32')]>0x0){_[_0x8169('0x44')](_0x1ef6fc,function(_0x2bae3b){if(_[_0x8169('0x45')]([_0x8169('0x46'),'picklist'],_0x2bae3b[_0x8169('0x39')])&&_0x2bae3b[_0x8169('0x47')]){_0x23943a[_0x2bae3b[_0x8169('0x47')]]=_0x2bae3b['content']['toString']();}else if(_0x2bae3b[_0x8169('0x39')]===_0x8169('0x48')&&_0x2bae3b['variableName']&&_0x2bae3b['idField']){_0x56acf4[_0x2bae3b['variableName']]&&(_0x23943a[_0x2bae3b[_0x8169('0x47')]]=_0x56acf4[_0x2bae3b[_0x8169('0x49')]][_0x8169('0x4a')]());}else if(_0x2bae3b[_0x8169('0x39')]===_0x8169('0x4b')&&_0x2bae3b[_0x8169('0x4c')]&&_0x2bae3b[_0x8169('0x4c')][_0x8169('0x4d')]&&_0x2bae3b[_0x8169('0x47')]){_0x56acf4[_0x2bae3b[_0x8169('0x4c')][_0x8169('0x4d')][_0x8169('0x3a')]()]&&(_0x23943a[_0x2bae3b[_0x8169('0x47')]]=_0x56acf4[_0x2bae3b['Variable']['name'][_0x8169('0x3a')]()][_0x8169('0x4a')]());}});}return _0x23943a;}function getConnection(_0x56ad04){var _0x152621=_0x56ad04[_0x8169('0x4e')][_0x8169('0x4f')](_0x56ad04[_0x8169('0x50')]);var _0x3bece5=new jsforce['Connection']({'oauth2':{'loginUrl':_0x56ad04[_0x8169('0x51')]||_0x8169('0x52'),'clientId':_0x56ad04[_0x8169('0x53')],'clientSecret':_0x56ad04[_0x8169('0x54')]}});return _0x3bece5[_0x8169('0x55')](_0x56ad04[_0x8169('0x56')],_0x152621)[_0x8169('0x22')](function(){logger[_0x8169('0x24')](_0x8169('0x57'));return _0x3bece5;});}exports[_0x8169('0x58')]=function(_0x770509,_0x355b70,_0x5f464e,_0x24ca3d,_0x4a17ac,_0x504d93){var _0x1e7f20,_0x43529a,_0x328857,_0x3de1bc;_0x504d93['serverUrl']=intUtil['stripTrailingSlash'](_0x504d93[_0x8169('0x59')]);_0x504d93['remoteUri']=intUtil['stripTrailingSlash'](_0x504d93[_0x8169('0x51')]);if(_0x4a17ac&&_0x4a17ac[_0x8169('0x5a')]){logger[_0x8169('0x24')]('[QUEUE]','Recording\x20is\x20enabled!');_0x355b70['recordingURL']=util[_0x8169('0x3f')](_0x8169('0x5b'),_0x504d93[_0x8169('0x59')],_0x355b70[_0x8169('0x5c')],md5(_0x355b70['uniqueid']));}else{_0x355b70[_0x8169('0x5d')]='';}return getConnection(_0x504d93)[_0x8169('0x22')](function(_0x1f7e28){_0x3de1bc=_0x1f7e28;return getUser(_0x504d93,_0x24ca3d[_0x8169('0x5e')],_0x3de1bc);})[_0x8169('0x22')](function(_0x17ff1f){_0x1e7f20=_0x17ff1f;return getEndUser(_0x504d93,_0x5f464e,_0x355b70[_0x8169('0x5f')],_0x355b70[_0x8169('0x60')],_0x3de1bc);})[_0x8169('0x22')](function(_0x221c05){_0x43529a=_0x221c05;return getTicket(_0x504d93,_0x1e7f20,_0x43529a,_0x5f464e,_0x355b70,_0x5f464e[_0x8169('0x61')],_0x3de1bc,'queue');})[_0x8169('0x22')](function(_0x205de0){_0x328857=_0x205de0;logger[_0x8169('0x24')](_0x8169('0x62'),_0x328857['id']);logger['info'](_0x8169('0x63'),_0x328857['id'],_0x24ca3d['name'],_0x504d93[_0x8169('0x39')]);switch(_0x504d93[_0x8169('0x39')]){case _0x8169('0x64'):emit(util[_0x8169('0x3f')](_0x8169('0x65'),_0x24ca3d['name']),'trigger:salesforce:display',{'recordId':_0x328857['id']});break;case _0x8169('0x66'):emit(util[_0x8169('0x3f')](_0x8169('0x65'),_0x24ca3d['name']),_0x8169('0x67'),{'uri':util[_0x8169('0x3f')](_0x8169('0x68'),_0x3de1bc[_0x8169('0x69')],_0x328857['id'])});break;default:logger[_0x8169('0x6a')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x8169('0x6b')](function(_0x4ef15e){logger[_0x8169('0x6a')](_0x8169('0x6c'),_0x4ef15e);});};exports[_0x8169('0x6d')]=function(_0x519d65,_0x1ccce6,_0x3552c3,_0x5a5498,_0x4cbedd,_0x293706,_0x194048){var _0x1c9125,_0x19f172,_0x2db215,_0x582b4e;_0x293706['serverUrl']=intUtil['stripTrailingSlash'](_0x293706[_0x8169('0x59')]);_0x293706[_0x8169('0x51')]=intUtil[_0x8169('0x6e')](_0x293706[_0x8169('0x51')]);if(_0x194048&&_0x194048['recordingFormat']&&_0x194048['recordingFormat']!==_0x8169('0x6f')){logger[_0x8169('0x24')](_0x8169('0x70'),_0x8169('0x71'));_0x1ccce6[_0x8169('0x5d')]=util[_0x8169('0x3f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x293706['serverUrl'],_0x1ccce6[_0x8169('0x5c')],md5(_0x1ccce6[_0x8169('0x5c')]));}return getConnection(_0x293706)[_0x8169('0x22')](function(_0x62e64d){_0x582b4e=_0x62e64d;return getUser(_0x293706,_0x5a5498[_0x8169('0x5e')],_0x582b4e);})[_0x8169('0x22')](function(_0x31b867){_0x1c9125=_0x31b867;return getEndUser(_0x293706,_0x3552c3,_0x1ccce6[_0x8169('0x72')],_0x1ccce6[_0x8169('0x73')],_0x582b4e);})[_0x8169('0x22')](function(_0x910080){_0x19f172=_0x910080;return getTicket(_0x293706,_0x1c9125,_0x19f172,_0x3552c3,_0x1ccce6,_0x3552c3[_0x8169('0x61')],_0x582b4e,_0x8169('0x6d'));})[_0x8169('0x22')](function(_0x8b0789){_0x2db215=_0x8b0789;logger[_0x8169('0x24')](_0x8169('0x74'),_0x2db215['id']);logger[_0x8169('0x24')](_0x8169('0x75'),_0x2db215['id'],_0x5a5498[_0x8169('0x4d')],_0x293706[_0x8169('0x39')]);switch(_0x293706[_0x8169('0x39')]){case _0x8169('0x64'):emit(util[_0x8169('0x3f')]('user:%s',_0x5a5498[_0x8169('0x4d')]),_0x8169('0x76'),{'recordId':_0x2db215['id']});break;case'newTab':emit(util[_0x8169('0x3f')](_0x8169('0x65'),_0x5a5498[_0x8169('0x4d')]),'trigger:browser:url',{'uri':util['format'](_0x8169('0x68'),_0x582b4e[_0x8169('0x69')],_0x2db215['id'])});break;default:logger[_0x8169('0x6a')](_0x8169('0x70'),_0x8169('0x77'));}})[_0x8169('0x6b')](function(_0x2cf530){logger[_0x8169('0x6a')](_0x8169('0x70'),_0x2cf530);});};exports[_0x8169('0x78')]=function(_0x5b424f,_0x2ef551,_0x196182,_0x1a833e,_0x15b5c,_0x5e312d){var _0x5c6f71,_0x29c7f7,_0x1e35e6,_0x711f02;_0x5e312d[_0x8169('0x59')]=intUtil[_0x8169('0x6e')](_0x5e312d[_0x8169('0x59')]);_0x5e312d[_0x8169('0x51')]=intUtil[_0x8169('0x6e')](_0x5e312d[_0x8169('0x51')]);if(_0x15b5c&&_0x15b5c['monitor_format']){logger[_0x8169('0x24')]('['+_0x2ef551[_0x8169('0x79')][_0x8169('0x7a')]()+']',_0x8169('0x71'));_0x2ef551[_0x8169('0x5d')]=util[_0x8169('0x3f')](_0x8169('0x5b'),_0x5e312d['serverUrl'],_0x2ef551[_0x8169('0x5c')],md5(_0x2ef551[_0x8169('0x5c')]));}else{_0x2ef551[_0x8169('0x5d')]='';}return getConnection(_0x5e312d)[_0x8169('0x22')](function(_0x5ad9b8){_0x711f02=_0x5ad9b8;if(!_[_0x8169('0x1e')](_0x1a833e)){return getUser(_0x5e312d,_0x1a833e[_0x8169('0x4d')],_0x711f02);}else{return getUser(_0x5e312d,null,_0x711f02);}})[_0x8169('0x22')](function(_0x2318b4){_0x5c6f71=_0x2318b4;return getEndUser(_0x5e312d,_0x196182,_0x2ef551[_0x8169('0x5f')],_0x2ef551['calleridnum'],_0x711f02);})[_0x8169('0x22')](function(_0x484391){_0x29c7f7=_0x484391;return getTicket(_0x5e312d,_0x5c6f71,_0x29c7f7,_0x196182,_0x2ef551,_0x196182[_0x8169('0x61')],_0x711f02);})[_0x8169('0x22')](function(_0xc273b7){_0x1e35e6=_0xc273b7;logger[_0x8169('0x24')]('['+_0x2ef551['lastevent'][_0x8169('0x7a')]()+_0x8169('0x7b'),_0x1e35e6['id']);logger[_0x8169('0x24')]('['+_0x2ef551[_0x8169('0x79')][_0x8169('0x7a')]()+_0x8169('0x7c'),_0x5e312d['type']);})[_0x8169('0x6b')](function(_0x263cb8){logger[_0x8169('0x6a')]('['+_0x2ef551[_0x8169('0x79')][_0x8169('0x7a')]()+']',_0x263cb8);});}; \ 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 49760ac..8a2d06f 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 _0xc7b0=['servicenow','redis','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','],\x20getAdminUser\x20crm','catch','error','message','toUpperCase','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','System','endUserNumber','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','content','toString','string','idField','toLowerCase','variableName','customVariable','Variable','name','incident','assign','true','getString','Subjects','Descriptions','ticketId','ticketNumber',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','outbound','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','bluebird','util','md5','./util','../../../../config/logger'];(function(_0x46e510,_0x5897ad){var _0x5bf74c=function(_0xdb2295){while(--_0xdb2295){_0x46e510['push'](_0x46e510['shift']());}};_0x5bf74c(++_0x5897ad);}(_0xc7b0,0x66));var _0x0c7b=function(_0x2f3ed9,_0xdc39a0){_0x2f3ed9=_0x2f3ed9-0x0;var _0xb374d1=_0xc7b0[_0x2f3ed9];return _0xb374d1;};'use strict';var _=require('lodash');var Promise=require(_0x0c7b('0x0'));var rp=require('request-promise');var util=require(_0x0c7b('0x1'));var md5=require(_0x0c7b('0x2'));var Redis=require('ioredis');var intUtil=require(_0x0c7b('0x3'));var config=require('../../../../config/environment');var logger=require(_0x0c7b('0x4'))(_0x0c7b('0x5'));config[_0x0c7b('0x6')]=_['defaults'](config[_0x0c7b('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x0c7b('0x7'))(new Redis(config['redis']));function getAdminUser(_0x53a0a1,_0x2e2020,_0x2c6c9c,_0x25397c,_0xa0557c,_0x4d2d1c){return new Promise(function(_0x5d3fec,_0x375534){var _0x378767={'method':_0x0c7b('0x8'),'uri':_0x25397c+_0x0c7b('0x9')+'&'+_0xa0557c+'&'+_0x4d2d1c,'auth':_0x2e2020,'json':!![]};return rp(_0x378767)[_0x0c7b('0xa')](function(_0x28cf28){if(_0x28cf28[_0x0c7b('0xb')][_0x0c7b('0xc')]>0x0){_0x2c6c9c['adminId']=_0x28cf28[_0x0c7b('0xb')][0x0][_0x0c7b('0xd')];}logger[_0x0c7b('0xe')]('['+[_0x53a0a1['toUpperCase']()]+_0x0c7b('0xf'),_0x2c6c9c);_0x5d3fec(_0x2c6c9c);})[_0x0c7b('0x10')](function(_0x56cdfd){logger[_0x0c7b('0x11')]('['+[_0x53a0a1['toUpperCase']()]+']',_0x56cdfd[_0x0c7b('0x12')]);_0x375534(_0x56cdfd[_0x0c7b('0x12')]);});});}function getUser(_0x40eedf,_0x592f12,_0x581064,_0x207ff,_0xc295c){return function(_0x1cd6c2){logger['info']('['+[_0x40eedf[_0x0c7b('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x1cd6c2);return new Promise(function(_0xd7757e,_0x51107e){if(intUtil[_0x0c7b('0x14')](_0x1cd6c2[_0x0c7b('0x15')])){var _0x4fd1e3={'method':'GET','uri':_0x581064+_0x0c7b('0x16')+_0x1cd6c2[_0x0c7b('0x15')]+'&'+_0x207ff+'&'+_0xc295c,'auth':_0x592f12,'json':!![]};logger[_0x0c7b('0xe')]('['+[_0x40eedf[_0x0c7b('0x13')]()]+_0x0c7b('0x17'),_0x4fd1e3);return rp(_0x4fd1e3)[_0x0c7b('0xa')](function(_0x74d9f8){logger[_0x0c7b('0xe')]('['+[_0x40eedf[_0x0c7b('0x13')]()]+_0x0c7b('0x18'),_0x74d9f8);if(_0x74d9f8[_0x0c7b('0xb')][_0x0c7b('0xc')]>0x0&&String(_0x74d9f8[_0x0c7b('0xb')][0x0][_0x0c7b('0x19')])==='true'){_0x1cd6c2[_0x0c7b('0x1a')]=_0x74d9f8[_0x0c7b('0xb')][0x0][_0x0c7b('0xd')];}else{_0x1cd6c2['userId']=_0x1cd6c2[_0x0c7b('0x1b')];_0x1cd6c2[_0x0c7b('0x15')]=_0x1cd6c2[_0x0c7b('0x1c')];}logger[_0x0c7b('0xe')]('['+[_0x40eedf[_0x0c7b('0x13')]()]+_0x0c7b('0x1d'),_0x1cd6c2);_0xd7757e(_0x1cd6c2);})[_0x0c7b('0x10')](function(_0x3dbb13){logger['error']('['+[_0x40eedf['toUpperCase']()]+']',_0x3dbb13[_0x0c7b('0x12')]);_0x51107e(_0x3dbb13[_0x0c7b('0x12')]);});}else{logger[_0x0c7b('0xe')]('['+[_0x40eedf[_0x0c7b('0x13')]()]+_0x0c7b('0x1e'));_0x1cd6c2['userId']=_0x1cd6c2['adminId'];_0x1cd6c2[_0x0c7b('0x15')]=_0x1cd6c2['adminEmail'];_0xd7757e(_0x1cd6c2);}});};}function createEndUser(_0x5bf52b,_0x3541e7,_0x56c8e7,_0x1e84b6,_0x22347f){logger[_0x0c7b('0xe')]('['+[_0x5bf52b[_0x0c7b('0x13')]()]+_0x0c7b('0x1f'),_0x56c8e7);return new Promise(function(_0x417126,_0x5392ec){var _0x4cee09={'method':_0x0c7b('0x20'),'uri':_0x1e84b6+_0x0c7b('0x21')+_0x22347f,'body':{'user_name':_0x56c8e7['endUserNumber'],'roles':_0x0c7b('0x22'),'first_name':_0x56c8e7['endUserNumber'],'active':'true','date_format':_0x0c7b('0x23'),'phone':_0x56c8e7[_0x0c7b('0x24')]},'auth':_0x3541e7,'json':!![]};return rp(_0x4cee09)['then'](function(_0x461d7c){logger[_0x0c7b('0xe')]('['+[_0x5bf52b[_0x0c7b('0x13')]()]+_0x0c7b('0x25'),_0x461d7c[_0x0c7b('0xb')]);_0x56c8e7[_0x0c7b('0x26')]=_0x461d7c[_0x0c7b('0xb')]['sys_id'];_0x417126(_0x56c8e7);})['catch'](function(_0x126fc7){logger[_0x0c7b('0x11')]('['+[_0x5bf52b[_0x0c7b('0x13')]()]+']',_0x126fc7[_0x0c7b('0x12')]);_0x5392ec(_0x126fc7[_0x0c7b('0x12')]);});});}function getEndUser(_0x5847c8,_0x41b378,_0x1e532d,_0x5292fe,_0x4b57ed){return function(_0x1c0c86){logger[_0x0c7b('0xe')]('['+[_0x5847c8[_0x0c7b('0x13')]()]+_0x0c7b('0x27'),_0x1c0c86);return new Promise(function(_0x2d77a4,_0x1ff7fe){var _0x23e9a4={'method':_0x0c7b('0x8'),'uri':_0x1e532d+_0x0c7b('0x28')+_0x1c0c86[_0x0c7b('0x24')]+'&'+_0x5292fe+'&'+_0x4b57ed,'auth':_0x41b378,'json':!![]};return rp(_0x23e9a4)['then'](function(_0x30c3aa){if(_0x30c3aa[_0x0c7b('0xb')][_0x0c7b('0xc')]>0x0){_0x1c0c86[_0x0c7b('0x26')]=_0x30c3aa[_0x0c7b('0xb')][0x0][_0x0c7b('0xd')];logger[_0x0c7b('0xe')]('['+[_0x5847c8[_0x0c7b('0x13')]()]+_0x0c7b('0x29'),_0x1c0c86);_0x2d77a4(_0x1c0c86);}else{return createEndUser(_0x5847c8,_0x41b378,_0x1c0c86,_0x1e532d,_0x5292fe)[_0x0c7b('0xa')](function(_0x5e93e4){logger['info']('['+[_0x5847c8[_0x0c7b('0x13')]()]+_0x0c7b('0x2a'),_0x5e93e4);_0x2d77a4(_0x5e93e4);});}})[_0x0c7b('0x10')](function(_0xa72495){logger['error']('['+[_0x5847c8[_0x0c7b('0x13')]()]+']',_0xa72495[_0x0c7b('0x12')]);_0x1ff7fe(_0xa72495[_0x0c7b('0x12')]);});});};}function getCustomFields(_0x50c9c4,_0x384adb){var _0x106167={};if(_0x50c9c4['length']>0x0){_[_0x0c7b('0x2b')](_0x50c9c4,function(_0x5aa7e1){if(_[_0x0c7b('0x2c')](['string',_0x0c7b('0x2d')],_0x5aa7e1[_0x0c7b('0x2e')])&&_0x5aa7e1[_0x0c7b('0x2f')]&&!_0x5aa7e1[_0x0c7b('0x30')]){_0x106167[_0x5aa7e1[_0x0c7b('0x2f')]['toLowerCase']()]=_0x5aa7e1[_0x0c7b('0x31')][_0x0c7b('0x32')]();}else if(_[_0x0c7b('0x2c')]([_0x0c7b('0x33'),_0x0c7b('0x2d')],_0x5aa7e1[_0x0c7b('0x2e')])&&_0x5aa7e1[_0x0c7b('0x34')]&&_0x5aa7e1[_0x0c7b('0x30')]){_0x106167[_0x5aa7e1[_0x0c7b('0x34')][_0x0c7b('0x35')]()]=_0x5aa7e1[_0x0c7b('0x31')][_0x0c7b('0x32')]();}else if(_0x5aa7e1[_0x0c7b('0x2e')]==='variable'&&_0x5aa7e1[_0x0c7b('0x36')]&&_0x5aa7e1[_0x0c7b('0x34')]&&_0x5aa7e1[_0x0c7b('0x30')]){_0x106167[_0x5aa7e1['idField'][_0x0c7b('0x35')]()]=_0x384adb[_0x5aa7e1[_0x0c7b('0x36')]][_0x0c7b('0x32')]();}else if(_0x5aa7e1['type']===_0x0c7b('0x37')&&_0x5aa7e1['Variable']&&_0x5aa7e1[_0x0c7b('0x38')][_0x0c7b('0x39')]&&_0x5aa7e1[_0x0c7b('0x34')]&&_0x5aa7e1['customField']){_0x106167[_0x5aa7e1[_0x0c7b('0x34')]['toLowerCase']()]=_0x384adb[_0x5aa7e1[_0x0c7b('0x38')]['name'][_0x0c7b('0x35')]()][_0x0c7b('0x32')]();}});}return _0x106167;}function getTicket(_0x2940f9,_0x3bc748,_0x52d70e,_0x1afdf4,_0x300166,_0x3577f9){return function(_0x1fa6ba){logger[_0x0c7b('0xe')]('['+[_0x2940f9[_0x0c7b('0x13')]()]+']\x20getTicket\x20input\x20crm',_0x1fa6ba);return new Promise(function(_0x206dad,_0x50ac0c){var _0x3b4e10=_0x2940f9[_0x0c7b('0x35')]()==='outbound'?_0x1fa6ba[_0x0c7b('0x1a')]:_0x1fa6ba[_0x0c7b('0x26')];var _0x282497={'method':_0x0c7b('0x20'),'uri':_0x52d70e+_0x0c7b('0x3a')+'?'+_0x3577f9,'body':Object[_0x0c7b('0x3b')]({},{'active':_0x0c7b('0x3c'),'caller_id':_0x3b4e10,'assigned_to':_0x1fa6ba[_0x0c7b('0x1a')],'short_description':intUtil[_0x0c7b('0x3d')](_0x1afdf4[_0x0c7b('0x3e')],_0x300166,'\x20'),'description':intUtil[_0x0c7b('0x3d')](_0x1afdf4[_0x0c7b('0x3f')],_0x300166,'\x0a')},getCustomFields(_0x1afdf4['Fields'],_0x300166)),'auth':_0x3bc748,'json':!![]};return rp(_0x282497)[_0x0c7b('0xa')](function(_0x32114b){logger[_0x0c7b('0xe')]('['+[_0x2940f9['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x32114b['result']);_0x1fa6ba[_0x0c7b('0x40')]=_0x32114b[_0x0c7b('0xb')][_0x0c7b('0xd')];_0x1fa6ba[_0x0c7b('0x41')]=_0x32114b['result']['number'];logger['info']('['+[_0x2940f9[_0x0c7b('0x13')]()]+_0x0c7b('0x42'),_0x1fa6ba);_0x206dad(_0x1fa6ba);})[_0x0c7b('0x10')](function(_0x2f9db7){logger[_0x0c7b('0x11')]('['+[_0x2940f9[_0x0c7b('0x13')]()]+']',_0x2f9db7[_0x0c7b('0x12')]);_0x50ac0c(_0x2f9db7[_0x0c7b('0x12')]);});});};}function createRemoteTag(_0x5c2292,_0x2586cc,_0x514511,_0x2ee5b1){return new Promise(function(_0x586235,_0x3b50ea){var _0x4cce86={'method':_0x0c7b('0x20'),'uri':_0x514511+_0x0c7b('0x43')+'?'+_0x2ee5b1,'body':{'short_description':_0x5c2292,'global':!![],'active':!![],'name':_0x5c2292},'auth':_0x2586cc,'json':!![]};return rp(_0x4cce86)[_0x0c7b('0xa')](function(_0x2416c2){var _0x3779ac=_0x2416c2[_0x0c7b('0xb')][_0x0c7b('0xd')];_0x586235(_0x3779ac);});});}function getRemoteTag(_0x315813,_0x13d13b,_0x3fb41d,_0x2660c0,_0x4cd185){return new Promise(function(_0x11b5d5,_0x4ac94c){var _0x2b6d4a={'method':'GET','uri':_0x3fb41d+_0x0c7b('0x43')+'?sysparm_query=name%3D'+_0x315813+'&'+_0x2660c0,'auth':_0x13d13b,'json':!![]};return rp(_0x2b6d4a)[_0x0c7b('0xa')](function(_0x47d1b7){if(_0x47d1b7[_0x0c7b('0xb')][_0x0c7b('0xc')]>0x0){var _0x4e45f8=_0x47d1b7['result'][0x0]['sys_id'];_0x11b5d5(_0x4e45f8);}else{return createRemoteTag(_0x315813,_0x13d13b,_0x3fb41d,_0x2660c0)[_0x0c7b('0xa')](function(_0x41e962){_0x11b5d5(_0x41e962);});}});});}function assignTagToIncident(_0x41cc9c,_0x45979b,_0x4b1662,_0x5bf832,_0x236a59){return new Promise(function(_0x250045,_0x6d64a){var _0x27d3e7={'method':_0x0c7b('0x20'),'uri':_0x4b1662+_0x0c7b('0x44')+'?'+_0x236a59,'body':{'label':_0x41cc9c,'table':_0x0c7b('0x3a'),'id_type':_0x0c7b('0x45'),'table_key':_0x5bf832[_0x0c7b('0x40')],'title':_0x0c7b('0x46')+_0x5bf832['ticketNumber'],'id_display':_0x5bf832[_0x0c7b('0x41')]},'auth':_0x45979b,'json':!![]};return rp(_0x27d3e7)[_0x0c7b('0xa')](function(_0x3ef67f){_0x250045();})[_0x0c7b('0x10')](function(){_0x250045();});});}function manageTags(_0x32f876,_0x5bf118,_0x44f7e5,_0x4af0bf,_0x5c8b03,_0x74c848,_0x32e48e){return new Promise(function(_0x5e68a6,_0x16114e){var _0x46f91c=[];_0x5bf118[_0x0c7b('0x2b')](function(_0x274be6){_0x46f91c[_0x0c7b('0x47')](getRemoteTag(_0x274be6,_0x44f7e5,_0x4af0bf,_0x74c848,_0x32e48e));});return Promise[_0x0c7b('0x48')](_0x46f91c)[_0x0c7b('0xa')](function(_0x101bc8){if(_0x101bc8[_0x0c7b('0xc')]){logger[_0x0c7b('0xe')]('['+[_0x32f876[_0x0c7b('0x13')]()]+_0x0c7b('0x49'),_0x101bc8);var _0x1b5d8d=[];_0x101bc8[_0x0c7b('0x2b')](function(_0x2b8dde){_0x1b5d8d['push'](assignTagToIncident(_0x2b8dde,_0x44f7e5,_0x4af0bf,_0x5c8b03,_0x74c848));});return Promise['all'](_0x1b5d8d)[_0x0c7b('0xa')](function(){_0x5e68a6();})['catch'](function(){_0x5e68a6();});}else{_0x5e68a6();}});});}function getTags(_0x196b23,_0x232221,_0x2aed9b,_0x2937c8,_0x2e7dbb,_0x7f46b3){return function(_0x395f39){return new Promise(function(_0xb726c4,_0x526a20){var _0x4282dc=[];var _0x2fc6ec=_0x2937c8[_0x0c7b('0x4a')];if(_0x2fc6ec&&_0x2fc6ec[_0x0c7b('0xc')]>0x0){_0x4282dc=_['map'](_0x2fc6ec,'name');}if(_0x4282dc[_0x0c7b('0xc')]>0x0){return manageTags(_0x196b23,_0x4282dc,_0x232221,_0x2aed9b,_0x395f39,_0x2e7dbb,_0x7f46b3)[_0x0c7b('0xa')](function(){_0xb726c4(_0x395f39);});}else{_0xb726c4(_0x395f39);}});};}function emit(_0x471f71,_0x40fa19,_0x23d06d){var _0xef69e4=_0x0c7b('0x4b')+_0x0c7b('0x4c')+_0x0c7b('0x4d')+_0x0c7b('0x4e');var _0x54ad41={'uri':_0x471f71+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x23d06d+_0xef69e4};io['to'](util[_0x0c7b('0x4f')]('user:%s',_0x40fa19))[_0x0c7b('0x50')](_0x0c7b('0x51'),_0x54ad41);}exports['cs']=function(_0x3c6cc2,_0x3ce462,_0x2975eb,_0x163a8f,_0x3ead55,_0x13d0dc,_0x3a143c,_0x22bc3b){var _0x2175a0={};var _0x3b79e2={'user':_0x13d0dc[_0x0c7b('0x52')],'pass':_0x13d0dc[_0x0c7b('0x53')]};var _0x2fdad7=_0x0c7b('0x54');var _0x4f27c6=_0x0c7b('0x55');_0x13d0dc[_0x0c7b('0x56')]=intUtil[_0x0c7b('0x57')](_0x13d0dc[_0x0c7b('0x56')]);_0x13d0dc[_0x0c7b('0x58')]=intUtil[_0x0c7b('0x57')](_0x13d0dc['serverUrl']);var _0x5bc1cf=util[_0x0c7b('0x4f')](_0x0c7b('0x59'),_0x13d0dc['remoteUri']);_0x2175a0[_0x0c7b('0x15')]=!_['isNil'](_0x163a8f)?_0x163a8f['email']:null;_0x2175a0['adminEmail']=_0x13d0dc[_0x0c7b('0x5a')];_0x2175a0[_0x0c7b('0x24')]=_0x22bc3b[_0x0c7b('0x35')]()===_0x0c7b('0x5b')?_0x3ce462['destcalleridnum']:_0x3ce462['calleridnum'];_0x2175a0['callDirection']=_0x22bc3b===_0x0c7b('0x5c')||_0x22bc3b==='unmanaged'?'queue':_0x0c7b('0x5b');var _0x4de0b6=util[_0x0c7b('0x4f')](_0x0c7b('0x5d'),_0x13d0dc[_0x0c7b('0x58')],_0x3ce462[_0x0c7b('0x5e')],md5(_0x3ce462['uniqueid']));if(_0x3ead55&&_0x3ead55[_0x0c7b('0x5f')]){logger[_0x0c7b('0xe')](_0x0c7b('0x60'),_0x0c7b('0x61'));_0x3ce462[_0x0c7b('0x62')]=_0x4de0b6;}else if(_0x3a143c&&_0x3a143c[_0x0c7b('0x63')]&&_0x3a143c[_0x0c7b('0x63')]!==_0x0c7b('0x64')){logger[_0x0c7b('0xe')](_0x0c7b('0x65'),_0x0c7b('0x61'));_0x3ce462[_0x0c7b('0x62')]=_0x4de0b6;}else{_0x3ce462['recordingURL']='';}return getAdminUser(_0x22bc3b,_0x3b79e2,_0x2175a0,_0x5bc1cf,_0x4f27c6,_0x2fdad7)['then'](getUser(_0x22bc3b,_0x3b79e2,_0x5bc1cf,_0x4f27c6,_0x2fdad7))[_0x0c7b('0xa')](getEndUser(_0x22bc3b,_0x3b79e2,_0x5bc1cf,_0x4f27c6,_0x2fdad7))[_0x0c7b('0xa')](getTicket(_0x22bc3b,_0x3b79e2,_0x5bc1cf,_0x2975eb,_0x3ce462,_0x4f27c6))['then'](function(_0x1d2dee){logger[_0x0c7b('0xe')](util['format'](_0x0c7b('0x66'),_0x1d2dee[_0x0c7b('0x40')]));logger['info'](util['format'](_0x0c7b('0x67'),_0x22bc3b));if(_0x22bc3b!==_0x0c7b('0x68')){logger[_0x0c7b('0xe')]('['+[_0x22bc3b[_0x0c7b('0x13')]()]+']',_0x0c7b('0x69'));emit(_0x13d0dc[_0x0c7b('0x56')],_0x163a8f[_0x0c7b('0x39')],_0x1d2dee[_0x0c7b('0x40')]);}})['catch'](function(_0x5478ef){logger[_0x0c7b('0x11')]('['+[_0x22bc3b['toUpperCase']()]+_0x0c7b('0x6a'),util['inspect'](_0x5478ef,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x988d=['label_entry','Incident','Incident\x20-\x20','ticketNumber','forEach','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','map','name','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','email','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','servicenow','defaults','redis','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','],\x20getAdminUser\x20crm','catch','error','message','toUpperCase','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','adminId',']\x20using\x20admin\x20profile','adminEmail','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','includes','string','picklist','type','customField','nameField','toString','idField','toLowerCase','content','variable','variableName','customVariable','Variable',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','POST','label','?sysparm_query=name%3D'];(function(_0x2904df,_0x5e20cb){var _0x6f6920=function(_0x52ed7d){while(--_0x52ed7d){_0x2904df['push'](_0x2904df['shift']());}};_0x6f6920(++_0x5e20cb);}(_0x988d,0x177));var _0xd988=function(_0x189aa7,_0x3dbf9d){_0x189aa7=_0x189aa7-0x0;var _0x10a0c8=_0x988d[_0x189aa7];return _0x10a0c8;};'use strict';var _=require(_0xd988('0x0'));var Promise=require(_0xd988('0x1'));var rp=require(_0xd988('0x2'));var util=require(_0xd988('0x3'));var md5=require(_0xd988('0x4'));var Redis=require(_0xd988('0x5'));var intUtil=require(_0xd988('0x6'));var config=require(_0xd988('0x7'));var logger=require('../../../../config/logger')(_0xd988('0x8'));config['redis']=_[_0xd988('0x9')](config[_0xd988('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xd988('0xb'))(new Redis(config[_0xd988('0xa')]));function getAdminUser(_0x99d030,_0x2bd81d,_0x1b6129,_0x7b38b5,_0x349b63,_0x2a28f4){return new Promise(function(_0x23b443,_0xde53c0){var _0x4f4b53={'method':_0xd988('0xc'),'uri':_0x7b38b5+_0xd988('0xd')+'&'+_0x349b63+'&'+_0x2a28f4,'auth':_0x2bd81d,'json':!![]};return rp(_0x4f4b53)[_0xd988('0xe')](function(_0x2df9a6){if(_0x2df9a6[_0xd988('0xf')][_0xd988('0x10')]>0x0){_0x1b6129['adminId']=_0x2df9a6[_0xd988('0xf')][0x0][_0xd988('0x11')];}logger[_0xd988('0x12')]('['+[_0x99d030['toUpperCase']()]+_0xd988('0x13'),_0x1b6129);_0x23b443(_0x1b6129);})[_0xd988('0x14')](function(_0x41f64a){logger[_0xd988('0x15')]('['+[_0x99d030['toUpperCase']()]+']',_0x41f64a[_0xd988('0x16')]);_0xde53c0(_0x41f64a['message']);});});}function getUser(_0x27de8b,_0x467cc6,_0x27afe2,_0xe3c9e1,_0x4a9bf6){return function(_0x10efc2){logger[_0xd988('0x12')]('['+[_0x27de8b[_0xd988('0x17')]()]+_0xd988('0x18'),_0x10efc2);return new Promise(function(_0x36207c,_0x55b6f8){if(intUtil[_0xd988('0x19')](_0x10efc2[_0xd988('0x1a')])){var _0x2dd316={'method':_0xd988('0xc'),'uri':_0x27afe2+_0xd988('0x1b')+_0x10efc2['userEmail']+'&'+_0xe3c9e1+'&'+_0x4a9bf6,'auth':_0x467cc6,'json':!![]};logger[_0xd988('0x12')]('['+[_0x27de8b[_0xd988('0x17')]()]+_0xd988('0x1c'),_0x2dd316);return rp(_0x2dd316)['then'](function(_0x7f057b){logger[_0xd988('0x12')]('['+[_0x27de8b['toUpperCase']()]+_0xd988('0x1d'),_0x7f057b);if(_0x7f057b[_0xd988('0xf')][_0xd988('0x10')]>0x0&&String(_0x7f057b['result'][0x0][_0xd988('0x1e')])==='true'){_0x10efc2[_0xd988('0x1f')]=_0x7f057b[_0xd988('0xf')][0x0][_0xd988('0x11')];}else{_0x10efc2[_0xd988('0x1f')]=_0x10efc2[_0xd988('0x20')];_0x10efc2[_0xd988('0x1a')]=_0x10efc2['adminEmail'];}logger[_0xd988('0x12')]('['+[_0x27de8b[_0xd988('0x17')]()]+'],\x20getUser\x20crm',_0x10efc2);_0x36207c(_0x10efc2);})[_0xd988('0x14')](function(_0x131c90){logger['error']('['+[_0x27de8b['toUpperCase']()]+']',_0x131c90['message']);_0x55b6f8(_0x131c90[_0xd988('0x16')]);});}else{logger[_0xd988('0x12')]('['+[_0x27de8b[_0xd988('0x17')]()]+_0xd988('0x21'));_0x10efc2['userId']=_0x10efc2[_0xd988('0x20')];_0x10efc2['userEmail']=_0x10efc2[_0xd988('0x22')];_0x36207c(_0x10efc2);}});};}function createEndUser(_0x2dea5f,_0x5ec965,_0x4e47fd,_0x3b9f11,_0x316205){logger[_0xd988('0x12')]('['+[_0x2dea5f[_0xd988('0x17')]()]+'],\x20createEndUser\x20input\x20crm',_0x4e47fd);return new Promise(function(_0x416aa9,_0x594a0a){var _0xa16bd4={'method':'POST','uri':_0x3b9f11+'sys_user?'+_0x316205,'body':{'user_name':_0x4e47fd[_0xd988('0x23')],'roles':_0xd988('0x24'),'first_name':_0x4e47fd['endUserNumber'],'active':_0xd988('0x25'),'date_format':_0xd988('0x26'),'phone':_0x4e47fd['endUserNumber']},'auth':_0x5ec965,'json':!![]};return rp(_0xa16bd4)[_0xd988('0xe')](function(_0x48ba39){logger[_0xd988('0x12')]('['+[_0x2dea5f[_0xd988('0x17')]()]+_0xd988('0x27'),_0x48ba39[_0xd988('0xf')]);_0x4e47fd[_0xd988('0x28')]=_0x48ba39[_0xd988('0xf')][_0xd988('0x11')];_0x416aa9(_0x4e47fd);})[_0xd988('0x14')](function(_0x226621){logger[_0xd988('0x15')]('['+[_0x2dea5f['toUpperCase']()]+']',_0x226621[_0xd988('0x16')]);_0x594a0a(_0x226621[_0xd988('0x16')]);});});}function getEndUser(_0x42b59e,_0x534812,_0xe6e258,_0x3385a5,_0x975fa3){return function(_0x1279dc){logger['info']('['+[_0x42b59e['toUpperCase']()]+_0xd988('0x29'),_0x1279dc);return new Promise(function(_0x24b656,_0x46254f){var _0x58cb25={'method':_0xd988('0xc'),'uri':_0xe6e258+_0xd988('0x2a')+_0x1279dc[_0xd988('0x23')]+'&'+_0x3385a5+'&'+_0x975fa3,'auth':_0x534812,'json':!![]};return rp(_0x58cb25)[_0xd988('0xe')](function(_0x3f98b0){if(_0x3f98b0[_0xd988('0xf')]['length']>0x0){_0x1279dc[_0xd988('0x28')]=_0x3f98b0[_0xd988('0xf')][0x0]['sys_id'];logger[_0xd988('0x12')]('['+[_0x42b59e[_0xd988('0x17')]()]+_0xd988('0x2b'),_0x1279dc);_0x24b656(_0x1279dc);}else{return createEndUser(_0x42b59e,_0x534812,_0x1279dc,_0xe6e258,_0x3385a5)[_0xd988('0xe')](function(_0x451a5f){logger['info']('['+[_0x42b59e['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x451a5f);_0x24b656(_0x451a5f);});}})[_0xd988('0x14')](function(_0x1ca0d4){logger[_0xd988('0x15')]('['+[_0x42b59e[_0xd988('0x17')]()]+']',_0x1ca0d4[_0xd988('0x16')]);_0x46254f(_0x1ca0d4[_0xd988('0x16')]);});});};}function getCustomFields(_0x1d6db7,_0x44185c){var _0x752092={};if(_0x1d6db7[_0xd988('0x10')]>0x0){_['forEach'](_0x1d6db7,function(_0x34a902){if(_[_0xd988('0x2c')]([_0xd988('0x2d'),_0xd988('0x2e')],_0x34a902[_0xd988('0x2f')])&&_0x34a902['nameField']&&!_0x34a902[_0xd988('0x30')]){_0x752092[_0x34a902[_0xd988('0x31')]['toLowerCase']()]=_0x34a902['content'][_0xd988('0x32')]();}else if(_[_0xd988('0x2c')](['string',_0xd988('0x2e')],_0x34a902[_0xd988('0x2f')])&&_0x34a902['idField']&&_0x34a902[_0xd988('0x30')]){_0x752092[_0x34a902[_0xd988('0x33')][_0xd988('0x34')]()]=_0x34a902[_0xd988('0x35')][_0xd988('0x32')]();}else if(_0x34a902['type']===_0xd988('0x36')&&_0x34a902[_0xd988('0x37')]&&_0x34a902[_0xd988('0x33')]&&_0x34a902['customField']){_0x752092[_0x34a902[_0xd988('0x33')][_0xd988('0x34')]()]=_0x44185c[_0x34a902[_0xd988('0x37')]][_0xd988('0x32')]();}else if(_0x34a902[_0xd988('0x2f')]===_0xd988('0x38')&&_0x34a902[_0xd988('0x39')]&&_0x34a902['Variable']['name']&&_0x34a902[_0xd988('0x33')]&&_0x34a902[_0xd988('0x30')]){_0x752092[_0x34a902[_0xd988('0x33')][_0xd988('0x34')]()]=_0x44185c[_0x34a902[_0xd988('0x39')]['name']['toLowerCase']()][_0xd988('0x32')]();}});}return _0x752092;}function getTicket(_0x470199,_0x436c24,_0x130aff,_0xc45bad,_0x466bfb,_0x32abd7){return function(_0x1ac541){logger[_0xd988('0x12')]('['+[_0x470199[_0xd988('0x17')]()]+_0xd988('0x3a'),_0x1ac541);return new Promise(function(_0x1310bb,_0x504aa2){var _0x352a26=_0x470199[_0xd988('0x34')]()===_0xd988('0x3b')?_0x1ac541['userId']:_0x1ac541[_0xd988('0x28')];var _0xeac941={'method':'POST','uri':_0x130aff+_0xd988('0x3c')+'?'+_0x32abd7,'body':Object[_0xd988('0x3d')]({},{'active':'true','caller_id':_0x352a26,'assigned_to':_0x1ac541[_0xd988('0x1f')],'short_description':intUtil[_0xd988('0x3e')](_0xc45bad[_0xd988('0x3f')],_0x466bfb,'\x20'),'description':intUtil[_0xd988('0x3e')](_0xc45bad[_0xd988('0x40')],_0x466bfb,'\x0a')},getCustomFields(_0xc45bad[_0xd988('0x41')],_0x466bfb)),'auth':_0x436c24,'json':!![]};return rp(_0xeac941)[_0xd988('0xe')](function(_0x3cd774){logger[_0xd988('0x12')]('['+[_0x470199[_0xd988('0x17')]()]+_0xd988('0x42'),_0x3cd774[_0xd988('0xf')]);_0x1ac541[_0xd988('0x43')]=_0x3cd774[_0xd988('0xf')][_0xd988('0x11')];_0x1ac541['ticketNumber']=_0x3cd774[_0xd988('0xf')][_0xd988('0x44')];logger['info']('['+[_0x470199[_0xd988('0x17')]()]+_0xd988('0x45'),_0x1ac541);_0x1310bb(_0x1ac541);})[_0xd988('0x14')](function(_0x48436f){logger[_0xd988('0x15')]('['+[_0x470199[_0xd988('0x17')]()]+']',_0x48436f[_0xd988('0x16')]);_0x504aa2(_0x48436f['message']);});});};}function createRemoteTag(_0x165701,_0x45dcf7,_0x44c37a,_0x4e46f2){return new Promise(function(_0x59d65a,_0x4508c){var _0x9ab8a2={'method':_0xd988('0x46'),'uri':_0x44c37a+'label'+'?'+_0x4e46f2,'body':{'short_description':_0x165701,'global':!![],'active':!![],'name':_0x165701},'auth':_0x45dcf7,'json':!![]};return rp(_0x9ab8a2)['then'](function(_0x418ebe){var _0x47d268=_0x418ebe['result'][_0xd988('0x11')];_0x59d65a(_0x47d268);});});}function getRemoteTag(_0x498a6f,_0x31bc4b,_0x34048d,_0x511f1c,_0x4ea2a8){return new Promise(function(_0x46a136,_0x188b97){var _0x14d8e1={'method':_0xd988('0xc'),'uri':_0x34048d+_0xd988('0x47')+_0xd988('0x48')+_0x498a6f+'&'+_0x511f1c,'auth':_0x31bc4b,'json':!![]};return rp(_0x14d8e1)[_0xd988('0xe')](function(_0x189bbb){if(_0x189bbb[_0xd988('0xf')][_0xd988('0x10')]>0x0){var _0x1ca4cd=_0x189bbb[_0xd988('0xf')][0x0]['sys_id'];_0x46a136(_0x1ca4cd);}else{return createRemoteTag(_0x498a6f,_0x31bc4b,_0x34048d,_0x511f1c)[_0xd988('0xe')](function(_0x1a0585){_0x46a136(_0x1a0585);});}});});}function assignTagToIncident(_0x30648f,_0x53e21d,_0x52da80,_0x12409f,_0x2c5e8e){return new Promise(function(_0xa82f46,_0xb82c1e){var _0x121918={'method':_0xd988('0x46'),'uri':_0x52da80+_0xd988('0x49')+'?'+_0x2c5e8e,'body':{'label':_0x30648f,'table':'incident','id_type':_0xd988('0x4a'),'table_key':_0x12409f[_0xd988('0x43')],'title':_0xd988('0x4b')+_0x12409f[_0xd988('0x4c')],'id_display':_0x12409f[_0xd988('0x4c')]},'auth':_0x53e21d,'json':!![]};return rp(_0x121918)['then'](function(_0x2d5b4b){_0xa82f46();})[_0xd988('0x14')](function(){_0xa82f46();});});}function manageTags(_0x34adbf,_0x1e24df,_0x47a470,_0x56bed5,_0x5b2d07,_0xc1382f,_0x3e7958){return new Promise(function(_0x2e0471,_0x44e88c){var _0x1d2dbe=[];_0x1e24df[_0xd988('0x4d')](function(_0x350661){_0x1d2dbe['push'](getRemoteTag(_0x350661,_0x47a470,_0x56bed5,_0xc1382f,_0x3e7958));});return Promise[_0xd988('0x4e')](_0x1d2dbe)[_0xd988('0xe')](function(_0x5b953b){if(_0x5b953b[_0xd988('0x10')]){logger[_0xd988('0x12')]('['+[_0x34adbf[_0xd988('0x17')]()]+_0xd988('0x4f'),_0x5b953b);var _0x49469a=[];_0x5b953b[_0xd988('0x4d')](function(_0x37e251){_0x49469a[_0xd988('0x50')](assignTagToIncident(_0x37e251,_0x47a470,_0x56bed5,_0x5b2d07,_0xc1382f));});return Promise[_0xd988('0x4e')](_0x49469a)[_0xd988('0xe')](function(){_0x2e0471();})[_0xd988('0x14')](function(){_0x2e0471();});}else{_0x2e0471();}});});}function getTags(_0x56f976,_0x3a86de,_0x5146af,_0x430922,_0x472bf4,_0xbf536a){return function(_0x2b31da){return new Promise(function(_0xc115a1,_0x26bda6){var _0x29fe41=[];var _0xf88a1e=_0x430922['Tags'];if(_0xf88a1e&&_0xf88a1e['length']>0x0){_0x29fe41=_[_0xd988('0x51')](_0xf88a1e,_0xd988('0x52'));}if(_0x29fe41[_0xd988('0x10')]>0x0){return manageTags(_0x56f976,_0x29fe41,_0x3a86de,_0x5146af,_0x2b31da,_0x472bf4,_0xbf536a)[_0xd988('0xe')](function(){_0xc115a1(_0x2b31da);});}else{_0xc115a1(_0x2b31da);}});};}function emit(_0x8c34d2,_0x4ab1b1,_0x4df18c){var _0x3f39aa=_0xd988('0x53')+_0xd988('0x54')+_0xd988('0x55')+_0xd988('0x56');var _0x1d3eb2={'uri':_0x8c34d2+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x4df18c+_0x3f39aa};io['to'](util[_0xd988('0x57')](_0xd988('0x58'),_0x4ab1b1))[_0xd988('0x59')]('trigger:browser:url',_0x1d3eb2);}exports['cs']=function(_0x53fa9e,_0x26883d,_0x3f7c79,_0x5c667a,_0x57818b,_0x4b4d76,_0x309f95,_0x3058fc){var _0x109e67={};var _0xacaa0d={'user':_0x4b4d76[_0xd988('0x5a')],'pass':_0x4b4d76[_0xd988('0x5b')]};var _0x5e2750=_0xd988('0x5c');var _0x37f57=_0xd988('0x5d');_0x4b4d76[_0xd988('0x5e')]=intUtil[_0xd988('0x5f')](_0x4b4d76[_0xd988('0x5e')]);_0x4b4d76[_0xd988('0x60')]=intUtil[_0xd988('0x5f')](_0x4b4d76[_0xd988('0x60')]);var _0x5c0127=util[_0xd988('0x57')]('%s/api/now/table/',_0x4b4d76[_0xd988('0x5e')]);_0x109e67[_0xd988('0x1a')]=!_['isNil'](_0x5c667a)?_0x5c667a[_0xd988('0x61')]:null;_0x109e67['adminEmail']=_0x4b4d76[_0xd988('0x61')];_0x109e67[_0xd988('0x23')]=_0x3058fc[_0xd988('0x34')]()===_0xd988('0x3b')?_0x26883d[_0xd988('0x62')]:_0x26883d['calleridnum'];_0x109e67[_0xd988('0x63')]=_0x3058fc===_0xd988('0x64')||_0x3058fc===_0xd988('0x65')?'queue':_0xd988('0x3b');var _0x545a36=util['format'](_0xd988('0x66'),_0x4b4d76[_0xd988('0x60')],_0x26883d['uniqueid'],md5(_0x26883d['uniqueid']));if(_0x57818b&&_0x57818b[_0xd988('0x67')]){logger[_0xd988('0x12')](_0xd988('0x68'),_0xd988('0x69'));_0x26883d[_0xd988('0x6a')]=_0x545a36;}else if(_0x309f95&&_0x309f95[_0xd988('0x6b')]&&_0x309f95[_0xd988('0x6b')]!=='none'){logger[_0xd988('0x12')](_0xd988('0x6c'),_0xd988('0x69'));_0x26883d[_0xd988('0x6a')]=_0x545a36;}else{_0x26883d['recordingURL']='';}return getAdminUser(_0x3058fc,_0xacaa0d,_0x109e67,_0x5c0127,_0x37f57,_0x5e2750)['then'](getUser(_0x3058fc,_0xacaa0d,_0x5c0127,_0x37f57,_0x5e2750))['then'](getEndUser(_0x3058fc,_0xacaa0d,_0x5c0127,_0x37f57,_0x5e2750))[_0xd988('0xe')](getTicket(_0x3058fc,_0xacaa0d,_0x5c0127,_0x3f7c79,_0x26883d,_0x37f57))[_0xd988('0xe')](function(_0x5f3aeb){logger[_0xd988('0x12')](util[_0xd988('0x57')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5f3aeb[_0xd988('0x43')]));logger['info'](util[_0xd988('0x57')](_0xd988('0x6d'),_0x3058fc));if(_0x3058fc!==_0xd988('0x65')){logger[_0xd988('0x12')]('['+[_0x3058fc[_0xd988('0x17')]()]+']',_0xd988('0x6e'));emit(_0x4b4d76[_0xd988('0x5e')],_0x5c667a[_0xd988('0x52')],_0x5f3aeb['ticketId']);}})[_0xd988('0x14')](function(_0x35635f){logger[_0xd988('0x15')]('['+[_0x3058fc[_0xd988('0x17')]()]+_0xd988('0x6f'),util['inspect'](_0x35635f,{'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 45479cb..24d79fc 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 _0xadc5=['format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','user_name','then','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','phone_home','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','merge','map','nameField','customField','content','type','custom_fields','variable','variableName','customVariable','Variable','toLowerCase','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','Calls','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','charAt','%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','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','catch','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','bluebird','md5','util','ioredis','./util','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','push','idField','set_entry','JSON','stringify'];(function(_0x1501e2,_0x271210){var _0xfce8c5=function(_0x343f12){while(--_0x343f12){_0x1501e2['push'](_0x1501e2['shift']());}};_0xfce8c5(++_0x271210);}(_0xadc5,0xd6));var _0x5adc=function(_0x256cf1,_0x19ec6e){_0x256cf1=_0x256cf1-0x0;var _0x2f9003=_0xadc5[_0x256cf1];return _0x2f9003;};'use strict';var _=require(_0x5adc('0x0'));var rp=require(_0x5adc('0x1'));var BPromise=require(_0x5adc('0x2'));var md5=require(_0x5adc('0x3'));var util=require(_0x5adc('0x4'));var Redis=require(_0x5adc('0x5'));var intUtil=require(_0x5adc('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x5adc('0x7'));config['redis']=_[_0x5adc('0x8')](config[_0x5adc('0x9')],{'host':_0x5adc('0xa'),'port':0x18eb});var io=require(_0x5adc('0xb'))(new Redis(config[_0x5adc('0x9')]));var def={'method':_0x5adc('0xc'),'json':!![]};function emit(_0x7955ae,_0x17d2f2,_0x16ead3){io['to'](_0x7955ae)['emit'](_0x17d2f2,_0x16ead3);}function getTicket(_0x88ab03,_0x6dffe4,_0x2a4711,_0x247810,_0xfe7397,_0x25c728,_0x3daf1f,_0x3bc575){logger[_0x5adc('0xd')](_0x5adc('0xe'));var _0x1f6943=new Date();var _0xa276aa=[{'name':'name','value':intUtil[_0x5adc('0xf')](_0x247810[_0x5adc('0x10')],_0xfe7397,'\x20')},{'name':_0x5adc('0x11'),'value':_0x6dffe4['id']},{'name':_0x5adc('0x12'),'value':_0x6dffe4['id']},{'name':_0x5adc('0x13'),'value':intUtil['getString'](_0x247810[_0x5adc('0x14')],_0xfe7397,'\x0a')},{'name':_0x5adc('0x15'),'value':_0x1f6943[_0x5adc('0x16')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x5adc('0x17'),'value':'15'},{'name':_0x5adc('0x18'),'value':_0x2a4711['id']},{'name':_0x5adc('0x19'),'value':_0x5adc('0x1a')},{'name':_0x5adc('0x1b'),'value':_0x2a4711['name']},{'name':_0x5adc('0x1c'),'value':_0x3bc575}];if(_0x25c728[_0x5adc('0x1d')]){_[_0x5adc('0x1e')](_0x25c728,function(_0x5c0165){if(_0xfe7397[_0x5c0165['variableName']]){_0xa276aa[_0x5adc('0x1f')]({'name':_0x5c0165[_0x5adc('0x20')],'value':_0xfe7397[_0x5c0165['variableName']]});}});}return request({'form':{'method':_0x5adc('0x21'),'input_type':_0x5adc('0x22'),'response_type':_0x5adc('0x22'),'rest_data':JSON[_0x5adc('0x23')]({'session':_0x3daf1f['id'],'module_name':'Calls','name_value_list':_0xa276aa})}});}function getAuth(_0x1dee96){return util[_0x5adc('0x24')](_0x5adc('0x25'),new Buffer(_0x1dee96[_0x5adc('0x26')]+':X')[_0x5adc('0x27')](_0x5adc('0x28')));}function getServerInfo(_0x1294e4){return request({'form':{'method':_0x5adc('0x29'),'input_type':_0x5adc('0x22'),'response_type':_0x5adc('0x22'),'rest_data':JSON[_0x5adc('0x23')]({'session':_0x1294e4['id']})}});}function getUser(_0x39f8e6,_0x1e905d,_0x2126e2){if(!_[_0x5adc('0x2a')](_0x1e905d)){logger[_0x5adc('0xd')](_0x5adc('0x2b'),_0x1e905d);return request({'form':{'method':_0x5adc('0x2c'),'input_type':_0x5adc('0x22'),'response_type':_0x5adc('0x22'),'rest_data':JSON[_0x5adc('0x23')]({'session':_0x2126e2['id'],'module_name':_0x5adc('0x2d'),'query':util[_0x5adc('0x24')](_0x5adc('0x2e'),_0x1e905d),'order_by':'','offset':'0','select_fields':['id',_0x5adc('0x2f'),_0x5adc('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5adc('0x31')](function(_0xc22782){if(_0xc22782[_0x5adc('0x32')][_0x5adc('0x1d')]){var _0x2b2a51=_['find'](_0xc22782['entry_list'],function(_0x17eda2){return _0x17eda2[_0x5adc('0x33')][_0x5adc('0x30')][_0x5adc('0x34')]===_0x1e905d;});if(_0x2b2a51){logger[_0x5adc('0xd')](_0x5adc('0x35'));return BPromise[_0x5adc('0x36')]({'id':_0x2b2a51['name_value_list']['id'][_0x5adc('0x34')],'name':_0x2b2a51[_0x5adc('0x33')][_0x5adc('0x2f')][_0x5adc('0x34')]});}}logger[_0x5adc('0xd')](_0x5adc('0x37'));return BPromise[_0x5adc('0x36')]({'id':_0x2126e2['name_value_list'][_0x5adc('0x38')][_0x5adc('0x34')],'name':_0x2126e2['name_value_list']['user_name'][_0x5adc('0x34')]});});}else{logger[_0x5adc('0xd')](_0x5adc('0x39'));return BPromise[_0x5adc('0x36')]({'id':_0x2126e2[_0x5adc('0x33')][_0x5adc('0x38')][_0x5adc('0x34')],'name':_0x2126e2[_0x5adc('0x33')]['user_name'][_0x5adc('0x34')]});}}function getEndUser(_0x15cab0,_0x260a90,_0x41a598,_0x8811a3){logger[_0x5adc('0xd')](_0x5adc('0x3a'),_0x41a598);return request({'form':{'method':_0x5adc('0x2c'),'input_type':_0x5adc('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x8811a3['id'],'module_name':'Contacts','query':util[_0x5adc('0x24')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x41a598),'order_by':'','offset':'0','select_fields':['id',_0x5adc('0x2f'),_0x5adc('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5adc('0x31')](function(_0x4860c1){if(_0x4860c1[_0x5adc('0x32')]['length']){var _0x41ef1f=_[_0x5adc('0x3c')](_0x4860c1[_0x5adc('0x32')],function(_0x4c89ff){return _0x4c89ff['name_value_list'][_0x5adc('0x3b')][_0x5adc('0x34')]===_0x41a598;});if(_0x41ef1f){logger[_0x5adc('0xd')]('Enduser\x20found!');return BPromise[_0x5adc('0x36')]({'id':_0x41ef1f[_0x5adc('0x33')]['id'][_0x5adc('0x34')],'name':_0x41ef1f[_0x5adc('0x33')][_0x5adc('0x2f')][_0x5adc('0x34')],'phone':_0x41ef1f[_0x5adc('0x33')][_0x5adc('0x3b')][_0x5adc('0x34')]});}}else{logger['info'](_0x5adc('0x3d'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x5adc('0x22'),'rest_data':JSON[_0x5adc('0x23')]({'session':_0x8811a3['id'],'module_name':'Contacts','name_value_list':[{'name':_0x5adc('0x3e'),'value':_0x260a90!==_0x5adc('0x3f')?_0x260a90:util[_0x5adc('0x24')](_0x5adc('0x40'),_0x41a598)},{'name':_0x5adc('0x3b'),'value':_0x41a598}]})}})['then'](function(_0xf851b2){logger[_0x5adc('0xd')]('Enduser\x20created.');return BPromise[_0x5adc('0x36')]({'id':_0xf851b2['id'],'name':_0xf851b2[_0x5adc('0x32')][_0x5adc('0x3e')][_0x5adc('0x34')],'phone':_0xf851b2[_0x5adc('0x32')]['phone_home'][_0x5adc('0x34')]});});}});}function request(_0x253811){logger[_0x5adc('0x41')]('[HTTP]',JSON[_0x5adc('0x23')](_0x253811));return rp(_[_0x5adc('0x42')](def,_0x253811));}function getTags(_0x4ea0c3,_0x14c323){var _0x6b3ad0=[];if(_0x4ea0c3&&_0x4ea0c3['length']>0x0){_0x6b3ad0=_[_0x5adc('0x43')](_0x4ea0c3,_0x14c323);}return _0x6b3ad0;}function getCustomFields(_0x294141,_0x60a7ad){var _0x445bab=[];var _0x47d6c0={'custom_fields':[]};if(_0x294141[_0x5adc('0x1d')]>0x0){_[_0x5adc('0x1e')](_0x294141,function(_0x3fb0a7){if(_0x3fb0a7['type']==='string'&&_0x3fb0a7[_0x5adc('0x44')]&&!_0x3fb0a7[_0x5adc('0x45')]){_0x47d6c0[_0x3fb0a7[_0x5adc('0x44')]['toLowerCase']()]=_0x3fb0a7[_0x5adc('0x46')][_0x5adc('0x27')]();}else if(_0x3fb0a7[_0x5adc('0x47')]==='string'&&_0x3fb0a7[_0x5adc('0x20')]&&_0x3fb0a7[_0x5adc('0x45')]){_0x47d6c0[_0x5adc('0x48')]['push']({'id':_0x3fb0a7[_0x5adc('0x20')],'value':_0x3fb0a7['content'][_0x5adc('0x27')]()});}else if(_0x3fb0a7[_0x5adc('0x47')]===_0x5adc('0x49')&&_0x3fb0a7[_0x5adc('0x4a')]&&_0x3fb0a7[_0x5adc('0x20')]&&_0x3fb0a7['customField']){_0x60a7ad[_0x3fb0a7[_0x5adc('0x4a')]]&&_0x47d6c0[_0x5adc('0x48')][_0x5adc('0x1f')]({'id':_0x3fb0a7['idField'],'value':_0x60a7ad[_0x3fb0a7[_0x5adc('0x4a')]][_0x5adc('0x27')]()});}else if(_0x3fb0a7[_0x5adc('0x47')]===_0x5adc('0x4b')&&_0x3fb0a7[_0x5adc('0x4c')]&&_0x3fb0a7[_0x5adc('0x4c')]['name']&&_0x3fb0a7[_0x5adc('0x20')]&&_0x3fb0a7[_0x5adc('0x45')]){_0x60a7ad[_0x3fb0a7[_0x5adc('0x4c')]['name'][_0x5adc('0x4d')]()]&&_0x47d6c0[_0x5adc('0x48')][_0x5adc('0x1f')]({'id':_0x3fb0a7[_0x5adc('0x20')],'value':_0x60a7ad[_0x3fb0a7[_0x5adc('0x4c')]['name']['toLowerCase']()][_0x5adc('0x27')]()});}});}return _0x47d6c0;}function getConnection(_0x1b96e3){return request({'method':_0x5adc('0xc'),'form':{'method':_0x5adc('0x4e'),'input_type':_0x5adc('0x22'),'response_type':_0x5adc('0x22'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x1b96e3[_0x5adc('0x4f')],'password':_0x1b96e3['password'],'encryption':_0x5adc('0x50')},'application':_0x5adc('0x51')})}})[_0x5adc('0x31')](function(_0x47eedb){var _0x4af939=_0x47eedb;if(_0x4af939['id']){def[_0x5adc('0x52')]=_0x4af939['id'];return BPromise[_0x5adc('0x36')](_0x4af939);}else{throw new Error(util[_0x5adc('0x24')]('Account\x20%d\x20is\x20not\x20valid',_0x1b96e3['id']));}});}function setRelationship(_0x4cabb9,_0x156651,_0x46d22a,_0x3742a3){return request({'form':{'method':_0x5adc('0x53'),'input_type':_0x5adc('0x22'),'response_type':_0x5adc('0x22'),'rest_data':JSON[_0x5adc('0x23')]({'session':_0x4cabb9['id'],'module_name':_0x5adc('0x54'),'module_id':_0x46d22a['id'],'link_field_name':_0x3742a3,'related_ids':[_0x156651['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x206fb9,_0x52f7b3,_0x5a6c85,_0x267a5a,_0x3ae8ce,_0x124b53){var _0x1345ff,_0x171ab6,_0x3e9188,_0x187ba7;_0x124b53[_0x5adc('0x55')]=intUtil['stripTrailingSlash'](_0x124b53[_0x5adc('0x55')]);_0x124b53[_0x5adc('0x56')]=intUtil[_0x5adc('0x57')](_0x124b53[_0x5adc('0x56')]);def[_0x5adc('0x58')]=util[_0x5adc('0x24')](_0x5adc('0x59'),_0x124b53['remoteUri']);if(_0x3ae8ce&&_0x3ae8ce[_0x5adc('0x5a')]){logger['info'](_0x5adc('0x5b'),'Recording\x20is\x20enabled!');_0x52f7b3[_0x5adc('0x5c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x124b53[_0x5adc('0x56')],_0x52f7b3['uniqueid'],md5(_0x52f7b3[_0x5adc('0x5d')]));}else{_0x52f7b3[_0x5adc('0x5c')]='';}return getConnection(_0x124b53)['then'](function(_0x7cd065){_0x187ba7=_0x7cd065;return getUser(_0x124b53,_0x267a5a[_0x5adc('0x2f')],_0x187ba7);})[_0x5adc('0x31')](function(_0x6a4e4){_0x1345ff=_0x6a4e4;logger[_0x5adc('0xd')](_0x5adc('0x5e'),_0x1345ff['id']);return getEndUser(_0x124b53,_0x52f7b3[_0x5adc('0x5f')],_0x52f7b3[_0x5adc('0x60')],_0x187ba7);})[_0x5adc('0x31')](function(_0xafc3e2){_0x171ab6=_0xafc3e2;logger[_0x5adc('0xd')](_0x5adc('0x61'),_0x171ab6['id']);return getTicket(_0x124b53,_0x1345ff,_0x171ab6,_0x5a6c85,_0x52f7b3,_0x5a6c85[_0x5adc('0x62')],_0x187ba7,_0x5adc('0x63'));})[_0x5adc('0x31')](function(_0x105a5c){_0x3e9188=_0x105a5c;logger[_0x5adc('0xd')](_0x5adc('0x64'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3e9188['id']);return setRelationship(_0x187ba7,_0x1345ff,_0x3e9188,_0x5adc('0x65'));})[_0x5adc('0x31')](function(){return setRelationship(_0x187ba7,_0x171ab6,_0x3e9188,_0x5adc('0x66'));})[_0x5adc('0x31')](function(){return getServerInfo(_0x187ba7);})[_0x5adc('0x31')](function(_0x325545){var _0x478e58=parseInt(_0x325545['version'][_0x5adc('0x67')](0x0));var _0x168d98=util[_0x5adc('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x124b53[_0x5adc('0x55')],_0x3e9188['id']);if(_0x478e58>0x6){_0x168d98=util[_0x5adc('0x24')](_0x5adc('0x68'),_0x124b53['remoteUri'],_0x3e9188['id']);}logger['info'](_0x5adc('0x5b'),_0x5adc('0x69'));emit(util[_0x5adc('0x24')](_0x5adc('0x6a'),_0x267a5a[_0x5adc('0x2f')]),_0x5adc('0x6b'),{'uri':_0x168d98});})['catch'](function(_0x5a9065){logger[_0x5adc('0x6c')](_0x5adc('0x5b'),JSON['stringify'](_0x5a9065));});};exports[_0x5adc('0x6d')]=function(_0x19c3d9,_0x250b3c,_0x422bec,_0x14c4a5,_0x89cf15,_0x126b6d,_0x47be69){var _0x2de7ac,_0x2fdc83,_0x143f56,_0x1e44b9;_0x126b6d[_0x5adc('0x55')]=intUtil[_0x5adc('0x57')](_0x126b6d['remoteUri']);_0x126b6d[_0x5adc('0x56')]=intUtil[_0x5adc('0x57')](_0x126b6d['serverUrl']);def[_0x5adc('0x58')]=util[_0x5adc('0x24')](_0x5adc('0x59'),_0x126b6d[_0x5adc('0x55')]);if(_0x47be69&&_0x47be69[_0x5adc('0x6e')]&&_0x47be69[_0x5adc('0x6e')]!==_0x5adc('0x6f')){logger['info'](_0x5adc('0x70'),'Recording\x20is\x20enabled!');_0x250b3c[_0x5adc('0x5c')]=util[_0x5adc('0x24')](_0x5adc('0x71'),_0x126b6d[_0x5adc('0x56')],_0x250b3c['uniqueid'],md5(_0x250b3c['uniqueid']));}return getConnection(_0x126b6d)[_0x5adc('0x31')](function(_0x2be8d1){_0x1e44b9=_0x2be8d1;return getUser(_0x126b6d,_0x14c4a5[_0x5adc('0x2f')],_0x1e44b9);})[_0x5adc('0x31')](function(_0x3d7765){_0x2de7ac=_0x3d7765;logger['info'](_0x5adc('0x5e'),_0x2de7ac['id']);return getEndUser(_0x126b6d,_0x250b3c[_0x5adc('0x72')],_0x250b3c[_0x5adc('0x73')],_0x1e44b9);})[_0x5adc('0x31')](function(_0x334b19){_0x2fdc83=_0x334b19;logger[_0x5adc('0xd')]('The\x20Enduser\x20ID\x20is:',_0x2fdc83['id']);return getTicket(_0x126b6d,_0x2de7ac,_0x2fdc83,_0x422bec,_0x250b3c,_0x422bec[_0x5adc('0x62')],_0x1e44b9,_0x5adc('0x74'));})[_0x5adc('0x31')](function(_0x4e4d61){_0x143f56=_0x4e4d61;logger[_0x5adc('0xd')](_0x5adc('0x64'));logger[_0x5adc('0xd')](_0x5adc('0x75'),_0x143f56['id']);return setRelationship(_0x1e44b9,_0x2de7ac,_0x143f56,_0x5adc('0x65'));})['then'](function(){return setRelationship(_0x1e44b9,_0x2fdc83,_0x143f56,_0x5adc('0x66'));})[_0x5adc('0x31')](function(){return getServerInfo(_0x1e44b9);})[_0x5adc('0x31')](function(_0x1d6c9f){var _0x58e8ab=parseInt(_0x1d6c9f[_0x5adc('0x76')][_0x5adc('0x67')](0x0));var _0x267a5d=util[_0x5adc('0x24')](_0x5adc('0x77'),_0x126b6d['remoteUri'],_0x143f56['id']);if(_0x58e8ab>0x6){_0x267a5d=util[_0x5adc('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x126b6d[_0x5adc('0x55')],_0x143f56['id']);}logger[_0x5adc('0xd')](_0x5adc('0x70'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5adc('0x24')](_0x5adc('0x6a'),_0x14c4a5[_0x5adc('0x2f')]),_0x5adc('0x6b'),{'uri':_0x267a5d});})[_0x5adc('0x78')](function(_0x528fcb){logger['error'](_0x5adc('0x70'),JSON['stringify'](_0x528fcb));});};exports[_0x5adc('0x79')]=function(_0x2c6b35,_0xa12b94,_0x36fac0,_0x4ec0f8,_0x53064b,_0x2f52b1){var _0x2bfe4c,_0x35ba85,_0x30dcb9,_0x3d1ceb;_0x2f52b1[_0x5adc('0x55')]=intUtil[_0x5adc('0x57')](_0x2f52b1[_0x5adc('0x55')]);_0x2f52b1[_0x5adc('0x56')]=intUtil[_0x5adc('0x57')](_0x2f52b1['serverUrl']);def[_0x5adc('0x58')]=util[_0x5adc('0x24')](_0x5adc('0x59'),_0x2f52b1[_0x5adc('0x55')]);if(_0x53064b&&_0x53064b['monitor_format']){logger[_0x5adc('0xd')]('['+_0xa12b94[_0x5adc('0x7a')][_0x5adc('0x7b')]()+']',_0x5adc('0x7c'));_0xa12b94['recordingURL']=util['format'](_0x5adc('0x71'),_0x2f52b1[_0x5adc('0x56')],_0xa12b94[_0x5adc('0x5d')],md5(_0xa12b94['uniqueid']));}else{_0xa12b94[_0x5adc('0x5c')]='';}return getConnection(_0x2f52b1)[_0x5adc('0x31')](function(_0x20fde3){_0x3d1ceb=_0x20fde3;if(!_[_0x5adc('0x2a')](_0x4ec0f8)){return getUser(_0x2f52b1,_0x4ec0f8[_0x5adc('0x2f')],_0x3d1ceb);}else{return getUser(_0x2f52b1,null,_0x3d1ceb);}})[_0x5adc('0x31')](function(_0x4fdd3e){_0x2bfe4c=_0x4fdd3e;logger['info'](_0x5adc('0x5e'),_0x2bfe4c['id']);return getEndUser(_0x2f52b1,_0xa12b94[_0x5adc('0x5f')],_0xa12b94[_0x5adc('0x60')],_0x3d1ceb);})['then'](function(_0x35631d){_0x35ba85=_0x35631d;logger['info'](_0x5adc('0x61'),_0x35ba85['id']);return getTicket(_0x2f52b1,_0x2bfe4c,_0x35ba85,_0x36fac0,_0xa12b94,_0x36fac0[_0x5adc('0x62')],_0x3d1ceb,_0x5adc('0x63'));})['then'](function(_0x4fc443){_0x30dcb9=_0x4fc443;logger[_0x5adc('0xd')](_0x5adc('0x64'));logger[_0x5adc('0xd')]('The\x20Ticket\x20ID\x20is:',_0x30dcb9['id']);return setRelationship(_0x3d1ceb,_0x2bfe4c,_0x30dcb9,'users');})[_0x5adc('0x31')](function(){return setRelationship(_0x3d1ceb,_0x35ba85,_0x30dcb9,_0x5adc('0x66'));})['then'](function(){return getServerInfo(_0x3d1ceb);})[_0x5adc('0x78')](function(_0x2239eb){logger[_0x5adc('0x6c')]('['+_0xa12b94[_0x5adc('0x7a')][_0x5adc('0x7b')]()+']',JSON[_0x5adc('0x23')](_0x2239eb));});}; \ No newline at end of file +var _0x2868=['customField','nameField','toLowerCase','toString','type','custom_fields','content','customVariable','Variable','login','username','xCALLY\x20Motion\x20integration','then','sessionID','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','outbound','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','charAt','[OUTBOUND]','user:%s','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','description','Descriptions','toISOString','slice','replace','duration_minutes','parent_id','parent_type','Contacts','length','variableName','push','idField','set_entry','JSON','stringify','Calls','apiKey','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','user_name','entry_list','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','format','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20created.','first_name','debug','[HTTP]','merge','string'];(function(_0x1b6831,_0xcb47a2){var _0x2d00e1=function(_0x1de1e3){while(--_0x1de1e3){_0x1b6831['push'](_0x1b6831['shift']());}};_0x2d00e1(++_0xcb47a2);}(_0x2868,0x186));var _0x8286=function(_0x260454,_0x309852){_0x260454=_0x260454-0x0;var _0x124e65=_0x2868[_0x260454];return _0x124e65;};'use strict';var _=require(_0x8286('0x0'));var rp=require(_0x8286('0x1'));var BPromise=require(_0x8286('0x2'));var md5=require(_0x8286('0x3'));var util=require('util');var Redis=require(_0x8286('0x4'));var intUtil=require('./util');var config=require(_0x8286('0x5'));var logger=require(_0x8286('0x6'))(_0x8286('0x7'));config[_0x8286('0x8')]=_[_0x8286('0x9')](config[_0x8286('0x8')],{'host':_0x8286('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8286('0x8')]));var def={'method':_0x8286('0xb'),'json':!![]};function emit(_0x1dad1a,_0x43f6ed,_0x415084){io['to'](_0x1dad1a)[_0x8286('0xc')](_0x43f6ed,_0x415084);}function getTicket(_0x5a1768,_0x19a985,_0x7b0749,_0x3c99d8,_0x8d0388,_0x2d69bf,_0x504286,_0x2d1e3e){logger[_0x8286('0xd')](_0x8286('0xe'));var _0x5b3ba4=new Date();var _0x4f61b6=[{'name':_0x8286('0xf'),'value':intUtil[_0x8286('0x10')](_0x3c99d8[_0x8286('0x11')],_0x8d0388,'\x20')},{'name':'assigned_user_id','value':_0x19a985['id']},{'name':'created_by','value':_0x19a985['id']},{'name':_0x8286('0x12'),'value':intUtil['getString'](_0x3c99d8[_0x8286('0x13')],_0x8d0388,'\x0a')},{'name':'date_start','value':_0x5b3ba4[_0x8286('0x14')]()[_0x8286('0x15')](0x0,0x13)[_0x8286('0x16')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x8286('0x17'),'value':'15'},{'name':_0x8286('0x18'),'value':_0x7b0749['id']},{'name':_0x8286('0x19'),'value':_0x8286('0x1a')},{'name':'parent_name','value':_0x7b0749[_0x8286('0xf')]},{'name':'direction','value':_0x2d1e3e}];if(_0x2d69bf[_0x8286('0x1b')]){_['forEach'](_0x2d69bf,function(_0x5c4c02){if(_0x8d0388[_0x5c4c02[_0x8286('0x1c')]]){_0x4f61b6[_0x8286('0x1d')]({'name':_0x5c4c02[_0x8286('0x1e')],'value':_0x8d0388[_0x5c4c02['variableName']]});}});}return request({'form':{'method':_0x8286('0x1f'),'input_type':_0x8286('0x20'),'response_type':_0x8286('0x20'),'rest_data':JSON[_0x8286('0x21')]({'session':_0x504286['id'],'module_name':_0x8286('0x22'),'name_value_list':_0x4f61b6})}});}function getAuth(_0x2ced18){return util['format']('Basic\x20%s',new Buffer(_0x2ced18[_0x8286('0x23')]+':X')['toString'](_0x8286('0x24')));}function getServerInfo(_0x192f29){return request({'form':{'method':_0x8286('0x25'),'input_type':_0x8286('0x20'),'response_type':_0x8286('0x20'),'rest_data':JSON[_0x8286('0x21')]({'session':_0x192f29['id']})}});}function getUser(_0x21460d,_0x5c073d,_0x4e5b61){if(!_[_0x8286('0x26')](_0x5c073d)){logger[_0x8286('0xd')](_0x8286('0x27'),_0x5c073d);return request({'form':{'method':_0x8286('0x28'),'input_type':'JSON','response_type':_0x8286('0x20'),'rest_data':JSON['stringify']({'session':_0x4e5b61['id'],'module_name':'Employees','query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x5c073d),'order_by':'','offset':'0','select_fields':['id',_0x8286('0xf'),_0x8286('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x18496d){if(_0x18496d[_0x8286('0x2a')][_0x8286('0x1b')]){var _0x3e0f80=_['find'](_0x18496d[_0x8286('0x2a')],function(_0xf1e7){return _0xf1e7[_0x8286('0x2b')]['user_name'][_0x8286('0x2c')]===_0x5c073d;});if(_0x3e0f80){logger[_0x8286('0xd')]('Agent\x20found!');return BPromise['resolve']({'id':_0x3e0f80[_0x8286('0x2b')]['id']['value'],'name':_0x3e0f80[_0x8286('0x2b')]['name'][_0x8286('0x2c')]});}}logger[_0x8286('0xd')](_0x8286('0x2d'));return BPromise['resolve']({'id':_0x4e5b61[_0x8286('0x2b')][_0x8286('0x2e')][_0x8286('0x2c')],'name':_0x4e5b61[_0x8286('0x2b')][_0x8286('0x29')][_0x8286('0x2c')]});});}else{logger['info'](_0x8286('0x2f'));return BPromise['resolve']({'id':_0x4e5b61[_0x8286('0x2b')][_0x8286('0x2e')][_0x8286('0x2c')],'name':_0x4e5b61[_0x8286('0x2b')][_0x8286('0x29')]['value']});}}function getEndUser(_0x10e170,_0x2f471b,_0x82aa36,_0x4e9c26){logger[_0x8286('0xd')](_0x8286('0x30'),_0x82aa36);return request({'form':{'method':_0x8286('0x28'),'input_type':_0x8286('0x20'),'response_type':_0x8286('0x20'),'rest_data':JSON[_0x8286('0x21')]({'session':_0x4e9c26['id'],'module_name':_0x8286('0x1a'),'query':util[_0x8286('0x31')](_0x8286('0x32'),_0x82aa36),'order_by':'','offset':'0','select_fields':['id',_0x8286('0xf'),_0x8286('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x224f4d){if(_0x224f4d[_0x8286('0x2a')][_0x8286('0x1b')]){var _0x278fae=_['find'](_0x224f4d[_0x8286('0x2a')],function(_0x2ee6d9){return _0x2ee6d9[_0x8286('0x2b')][_0x8286('0x33')][_0x8286('0x2c')]===_0x82aa36;});if(_0x278fae){logger['info']('Enduser\x20found!');return BPromise['resolve']({'id':_0x278fae['name_value_list']['id'][_0x8286('0x2c')],'name':_0x278fae[_0x8286('0x2b')][_0x8286('0xf')]['value'],'phone':_0x278fae[_0x8286('0x2b')]['phone_home'][_0x8286('0x2c')]});}}else{logger[_0x8286('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x8286('0x1f'),'input_type':_0x8286('0x20'),'response_type':_0x8286('0x20'),'rest_data':JSON[_0x8286('0x21')]({'session':_0x4e9c26['id'],'module_name':_0x8286('0x1a'),'name_value_list':[{'name':'first_name','value':_0x2f471b!==''?_0x2f471b:util['format']('Caller\x20-\x20%s',_0x82aa36)},{'name':'phone_home','value':_0x82aa36}]})}})['then'](function(_0x79db6a){logger[_0x8286('0xd')](_0x8286('0x34'));return BPromise['resolve']({'id':_0x79db6a['id'],'name':_0x79db6a['entry_list'][_0x8286('0x35')][_0x8286('0x2c')],'phone':_0x79db6a['entry_list'][_0x8286('0x33')][_0x8286('0x2c')]});});}});}function request(_0x4dcba5){logger[_0x8286('0x36')](_0x8286('0x37'),JSON[_0x8286('0x21')](_0x4dcba5));return rp(_[_0x8286('0x38')](def,_0x4dcba5));}function getTags(_0x19b594,_0x2fd4de){var _0x227524=[];if(_0x19b594&&_0x19b594[_0x8286('0x1b')]>0x0){_0x227524=_['map'](_0x19b594,_0x2fd4de);}return _0x227524;}function getCustomFields(_0x10789a,_0x212d56){var _0x116903=[];var _0x1dbe5b={'custom_fields':[]};if(_0x10789a[_0x8286('0x1b')]>0x0){_['forEach'](_0x10789a,function(_0x16d21c){if(_0x16d21c['type']===_0x8286('0x39')&&_0x16d21c['nameField']&&!_0x16d21c[_0x8286('0x3a')]){_0x1dbe5b[_0x16d21c[_0x8286('0x3b')][_0x8286('0x3c')]()]=_0x16d21c['content'][_0x8286('0x3d')]();}else if(_0x16d21c[_0x8286('0x3e')]==='string'&&_0x16d21c[_0x8286('0x1e')]&&_0x16d21c[_0x8286('0x3a')]){_0x1dbe5b[_0x8286('0x3f')][_0x8286('0x1d')]({'id':_0x16d21c[_0x8286('0x1e')],'value':_0x16d21c[_0x8286('0x40')]['toString']()});}else if(_0x16d21c[_0x8286('0x3e')]==='variable'&&_0x16d21c[_0x8286('0x1c')]&&_0x16d21c['idField']&&_0x16d21c[_0x8286('0x3a')]){_0x212d56[_0x16d21c['variableName']]&&_0x1dbe5b['custom_fields']['push']({'id':_0x16d21c[_0x8286('0x1e')],'value':_0x212d56[_0x16d21c[_0x8286('0x1c')]][_0x8286('0x3d')]()});}else if(_0x16d21c[_0x8286('0x3e')]===_0x8286('0x41')&&_0x16d21c[_0x8286('0x42')]&&_0x16d21c[_0x8286('0x42')][_0x8286('0xf')]&&_0x16d21c['idField']&&_0x16d21c['customField']){_0x212d56[_0x16d21c[_0x8286('0x42')]['name']['toLowerCase']()]&&_0x1dbe5b[_0x8286('0x3f')][_0x8286('0x1d')]({'id':_0x16d21c[_0x8286('0x1e')],'value':_0x212d56[_0x16d21c[_0x8286('0x42')]['name'][_0x8286('0x3c')]()][_0x8286('0x3d')]()});}});}return _0x1dbe5b;}function getConnection(_0xcae180){return request({'method':_0x8286('0xb'),'form':{'method':_0x8286('0x43'),'input_type':_0x8286('0x20'),'response_type':_0x8286('0x20'),'rest_data':JSON[_0x8286('0x21')]({'user_auth':{'user_name':_0xcae180[_0x8286('0x44')],'password':_0xcae180['password'],'encryption':'PLAIN'},'application':_0x8286('0x45')})}})[_0x8286('0x46')](function(_0x5508f8){var _0x3b8613=_0x5508f8;if(_0x3b8613['id']){def[_0x8286('0x47')]=_0x3b8613['id'];return BPromise['resolve'](_0x3b8613);}else{throw new Error(util[_0x8286('0x31')]('Account\x20%d\x20is\x20not\x20valid',_0xcae180['id']));}});}function setRelationship(_0x2f1d0d,_0x51a385,_0x230b71,_0x55dff7){return request({'form':{'method':_0x8286('0x48'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x8286('0x21')]({'session':_0x2f1d0d['id'],'module_name':_0x8286('0x22'),'module_id':_0x230b71['id'],'link_field_name':_0x55dff7,'related_ids':[_0x51a385['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x8286('0x49')]=function(_0x5d03d7,_0x24589b,_0x5b68da,_0x1a9c27,_0x21acb4,_0x55204c){var _0x2859db,_0x3872c7,_0x37e9d9,_0x39d780;_0x55204c['remoteUri']=intUtil['stripTrailingSlash'](_0x55204c[_0x8286('0x4a')]);_0x55204c[_0x8286('0x4b')]=intUtil[_0x8286('0x4c')](_0x55204c[_0x8286('0x4b')]);def[_0x8286('0x4d')]=util['format'](_0x8286('0x4e'),_0x55204c['remoteUri']);if(_0x21acb4&&_0x21acb4[_0x8286('0x4f')]){logger[_0x8286('0xd')]('[QUEUE]',_0x8286('0x50'));_0x24589b['recordingURL']=util[_0x8286('0x31')](_0x8286('0x51'),_0x55204c['serverUrl'],_0x24589b[_0x8286('0x52')],md5(_0x24589b[_0x8286('0x52')]));}else{_0x24589b[_0x8286('0x53')]='';}return getConnection(_0x55204c)[_0x8286('0x46')](function(_0x39370b){_0x39d780=_0x39370b;return getUser(_0x55204c,_0x1a9c27[_0x8286('0xf')],_0x39d780);})['then'](function(_0x5d0430){_0x2859db=_0x5d0430;logger[_0x8286('0xd')](_0x8286('0x54'),_0x2859db['id']);return getEndUser(_0x55204c,_0x24589b['calleridname'],_0x24589b[_0x8286('0x55')],_0x39d780);})[_0x8286('0x46')](function(_0x597a01){_0x3872c7=_0x597a01;logger[_0x8286('0xd')](_0x8286('0x56'),_0x3872c7['id']);return getTicket(_0x55204c,_0x2859db,_0x3872c7,_0x5b68da,_0x24589b,_0x5b68da[_0x8286('0x57')],_0x39d780,_0x8286('0x58'));})['then'](function(_0x3b01ad){_0x37e9d9=_0x3b01ad;logger[_0x8286('0xd')](_0x8286('0x59'));logger[_0x8286('0xd')](_0x8286('0x5a'),_0x37e9d9['id']);return setRelationship(_0x39d780,_0x2859db,_0x37e9d9,_0x8286('0x5b'));})[_0x8286('0x46')](function(){return setRelationship(_0x39d780,_0x3872c7,_0x37e9d9,_0x8286('0x5c'));})[_0x8286('0x46')](function(){return getServerInfo(_0x39d780);})[_0x8286('0x46')](function(_0x15eca3){var _0x171df1=parseInt(_0x15eca3[_0x8286('0x5d')]['charAt'](0x0));var _0x2f41ed=util[_0x8286('0x31')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x55204c[_0x8286('0x4a')],_0x37e9d9['id']);if(_0x171df1>0x6){_0x2f41ed=util[_0x8286('0x31')](_0x8286('0x5e'),_0x55204c['remoteUri'],_0x37e9d9['id']);}logger[_0x8286('0xd')](_0x8286('0x5f'),_0x8286('0x60'));emit(util[_0x8286('0x31')]('user:%s',_0x1a9c27[_0x8286('0xf')]),'trigger:browser:url',{'uri':_0x2f41ed});})[_0x8286('0x61')](function(_0x487413){logger[_0x8286('0x62')](_0x8286('0x5f'),JSON['stringify'](_0x487413));});};exports[_0x8286('0x63')]=function(_0x596062,_0x3a9741,_0x6a2198,_0x566405,_0x346816,_0xa56f74,_0x2b5cdf){var _0x265082,_0x42c208,_0x419e98,_0x44328d;_0xa56f74['remoteUri']=intUtil[_0x8286('0x4c')](_0xa56f74['remoteUri']);_0xa56f74[_0x8286('0x4b')]=intUtil[_0x8286('0x4c')](_0xa56f74['serverUrl']);def[_0x8286('0x4d')]=util[_0x8286('0x31')](_0x8286('0x4e'),_0xa56f74[_0x8286('0x4a')]);if(_0x2b5cdf&&_0x2b5cdf[_0x8286('0x64')]&&_0x2b5cdf[_0x8286('0x64')]!==_0x8286('0x65')){logger[_0x8286('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3a9741[_0x8286('0x53')]=util[_0x8286('0x31')](_0x8286('0x51'),_0xa56f74[_0x8286('0x4b')],_0x3a9741[_0x8286('0x52')],md5(_0x3a9741[_0x8286('0x52')]));}return getConnection(_0xa56f74)[_0x8286('0x46')](function(_0x1bdd09){_0x44328d=_0x1bdd09;return getUser(_0xa56f74,_0x566405[_0x8286('0xf')],_0x44328d);})[_0x8286('0x46')](function(_0x573be6){_0x265082=_0x573be6;logger[_0x8286('0xd')](_0x8286('0x54'),_0x265082['id']);return getEndUser(_0xa56f74,_0x3a9741[_0x8286('0x66')],_0x3a9741[_0x8286('0x67')],_0x44328d);})['then'](function(_0x44ed7f){_0x42c208=_0x44ed7f;logger[_0x8286('0xd')](_0x8286('0x56'),_0x42c208['id']);return getTicket(_0xa56f74,_0x265082,_0x42c208,_0x6a2198,_0x3a9741,_0x6a2198[_0x8286('0x57')],_0x44328d,_0x8286('0x68'));})[_0x8286('0x46')](function(_0x26a479){_0x419e98=_0x26a479;logger[_0x8286('0xd')](_0x8286('0x59'));logger[_0x8286('0xd')](_0x8286('0x5a'),_0x419e98['id']);return setRelationship(_0x44328d,_0x265082,_0x419e98,_0x8286('0x5b'));})[_0x8286('0x46')](function(){return setRelationship(_0x44328d,_0x42c208,_0x419e98,_0x8286('0x5c'));})[_0x8286('0x46')](function(){return getServerInfo(_0x44328d);})['then'](function(_0x323220){var _0x1fd158=parseInt(_0x323220['version'][_0x8286('0x69')](0x0));var _0x59c127=util[_0x8286('0x31')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0xa56f74[_0x8286('0x4a')],_0x419e98['id']);if(_0x1fd158>0x6){_0x59c127=util[_0x8286('0x31')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0xa56f74['remoteUri'],_0x419e98['id']);}logger[_0x8286('0xd')](_0x8286('0x6a'),_0x8286('0x60'));emit(util[_0x8286('0x31')](_0x8286('0x6b'),_0x566405['name']),'trigger:browser:url',{'uri':_0x59c127});})['catch'](function(_0x109464){logger[_0x8286('0x62')](_0x8286('0x6a'),JSON[_0x8286('0x21')](_0x109464));});};exports[_0x8286('0x6c')]=function(_0x17c3c2,_0x53110a,_0x10bf64,_0x2b4160,_0x281969,_0x591817){var _0x3a411f,_0x1499c0,_0x38d325,_0x52cc11;_0x591817[_0x8286('0x4a')]=intUtil[_0x8286('0x4c')](_0x591817[_0x8286('0x4a')]);_0x591817[_0x8286('0x4b')]=intUtil[_0x8286('0x4c')](_0x591817['serverUrl']);def['uri']=util[_0x8286('0x31')](_0x8286('0x4e'),_0x591817[_0x8286('0x4a')]);if(_0x281969&&_0x281969[_0x8286('0x4f')]){logger[_0x8286('0xd')]('['+_0x53110a[_0x8286('0x6d')][_0x8286('0x6e')]()+']','Recording\x20is\x20enabled!');_0x53110a['recordingURL']=util[_0x8286('0x31')](_0x8286('0x51'),_0x591817[_0x8286('0x4b')],_0x53110a[_0x8286('0x52')],md5(_0x53110a[_0x8286('0x52')]));}else{_0x53110a['recordingURL']='';}return getConnection(_0x591817)[_0x8286('0x46')](function(_0x18dbd5){_0x52cc11=_0x18dbd5;if(!_[_0x8286('0x26')](_0x2b4160)){return getUser(_0x591817,_0x2b4160[_0x8286('0xf')],_0x52cc11);}else{return getUser(_0x591817,null,_0x52cc11);}})[_0x8286('0x46')](function(_0x5db24a){_0x3a411f=_0x5db24a;logger['info'](_0x8286('0x54'),_0x3a411f['id']);return getEndUser(_0x591817,_0x53110a[_0x8286('0x6f')],_0x53110a['calleridnum'],_0x52cc11);})['then'](function(_0x221e52){_0x1499c0=_0x221e52;logger[_0x8286('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1499c0['id']);return getTicket(_0x591817,_0x3a411f,_0x1499c0,_0x10bf64,_0x53110a,_0x10bf64[_0x8286('0x57')],_0x52cc11,_0x8286('0x58'));})[_0x8286('0x46')](function(_0x35bd5e){_0x38d325=_0x35bd5e;logger[_0x8286('0xd')]('Ticket\x20created!');logger['info'](_0x8286('0x5a'),_0x38d325['id']);return setRelationship(_0x52cc11,_0x3a411f,_0x38d325,_0x8286('0x5b'));})[_0x8286('0x46')](function(){return setRelationship(_0x52cc11,_0x1499c0,_0x38d325,_0x8286('0x5c'));})[_0x8286('0x46')](function(){return getServerInfo(_0x52cc11);})['catch'](function(_0x44674f){logger[_0x8286('0x62')]('['+_0x53110a[_0x8286('0x6d')][_0x8286('0x6e')]()+']',JSON[_0x8286('0x21')](_0x44674f));});}; \ 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 97c8a4a..679d6f6 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 _0x277a=['isNil','util','getString','length','sortBy','type','string','push','content','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','key','format','%s:\x20%s','keyContent','keyType','variable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail'];(function(_0x2c10fb,_0x380e1b){var _0x23e4c0=function(_0x4fdea5){while(--_0x4fdea5){_0x2c10fb['push'](_0x2c10fb['shift']());}};_0x23e4c0(++_0x380e1b);}(_0x277a,0x1c1));var _0xa277=function(_0x2b7fd4,_0x264eb0){_0x2b7fd4=_0x2b7fd4-0x0;var _0x321788=_0x277a[_0x2b7fd4];return _0x321788;};'use strict';var _=require('lodash');var util=require(_0xa277('0x0'));exports[_0xa277('0x1')]=function(_0x2f6601,_0x281866,_0x395736){var _0x1845f1=[];if(_0x2f6601[_0xa277('0x2')]>0x0){var _0x4f5802=_[_0xa277('0x3')](_0x2f6601,['id']);for(var _0x1c4b2b=0x0;_0x1c4b2b<_0x4f5802['length'];_0x1c4b2b++){var _0x44d21f=_0x4f5802[_0x1c4b2b];if(_0x44d21f[_0xa277('0x4')]===_0xa277('0x5')){_0x1845f1[_0xa277('0x6')](_0x44d21f[_0xa277('0x7')]);}else if(_0x44d21f[_0xa277('0x4')]==='variable'&&_0x44d21f['variableName']){_0x281866[_0x44d21f[_0xa277('0x8')]]&&_0x1845f1[_0xa277('0x6')](_0x281866[_0x44d21f[_0xa277('0x8')]][_0xa277('0x9')]());}else if(_0x44d21f[_0xa277('0x4')]===_0xa277('0xa')&&_0x44d21f[_0xa277('0xb')]&&_0x44d21f[_0xa277('0xb')]['name']){_0x281866[_0x44d21f[_0xa277('0xb')][_0xa277('0xc')][_0xa277('0xd')]()]&&_0x1845f1[_0xa277('0x6')](_0x281866[_0x44d21f[_0xa277('0xb')][_0xa277('0xc')][_0xa277('0xd')]()][_0xa277('0x9')]());}else if(_0x44d21f[_0xa277('0x4')]===_0xa277('0xe')){if(_0x44d21f['keyType']===_0xa277('0x5')&&_0x44d21f[_0xa277('0xf')]){_0x1845f1[_0xa277('0x6')](util[_0xa277('0x10')](_0xa277('0x11'),_0x44d21f[_0xa277('0xf')],_0x44d21f[_0xa277('0x12')]));}else if(_0x44d21f[_0xa277('0x13')]===_0xa277('0x14')&&_0x44d21f['variableName']&&_0x44d21f[_0xa277('0xf')]){_0x281866[_0x44d21f[_0xa277('0x8')]]&&_0x1845f1['push'](util['format'](_0xa277('0x11'),_0x44d21f[_0xa277('0xf')],_0x281866[_0x44d21f[_0xa277('0x8')]]));}else if(_0x44d21f['keyType']===_0xa277('0xa')&&_0x44d21f[_0xa277('0xb')]&&_0x44d21f['Variable'][_0xa277('0xc')]&&_0x44d21f[_0xa277('0xf')]){_0x281866[_0x44d21f[_0xa277('0xb')]['name'][_0xa277('0xd')]()]&&_0x1845f1[_0xa277('0x6')](util[_0xa277('0x10')](_0xa277('0x11'),_0x44d21f['key'],_0x281866[_0x44d21f['Variable']['name']['toLowerCase']()]));}}}}return _0x1845f1[_0xa277('0x15')](_0x395736);};exports[_0xa277('0x16')]=function(_0xd92e83){var _0x13e6cb=_0xd92e83[_0xa277('0x17')](-0x1);if(_0x13e6cb==='/'){_0xd92e83=_0xd92e83[_0xa277('0x18')](0x0,_0xd92e83[_0xa277('0x19')](_0x13e6cb));}return _0xd92e83;};exports[_0xa277('0x1a')]=function(_0x5a9768){if(!_[_0xa277('0x1b')](_0x5a9768)&&_0x5a9768!==''){var _0x564791=/^(([^<>()\[\]\\.,;:\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 _0x564791['test'](String(_0x5a9768)[_0xa277('0xd')]());}else{return![];}}; \ No newline at end of file +var _0xf744=['%s:\x20%s','keyContent','customVariable','join','substring','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','type','string','push','content','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','format'];(function(_0x42f1e7,_0x3a1279){var _0x460d91=function(_0x3e9820){while(--_0x3e9820){_0x42f1e7['push'](_0x42f1e7['shift']());}};_0x460d91(++_0x3a1279);}(_0xf744,0x1e3));var _0x4f74=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xf744[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0x4f74('0x0'));var util=require(_0x4f74('0x1'));exports[_0x4f74('0x2')]=function(_0x8a6f9,_0x265333,_0x5ace54){var _0x589ecb=[];if(_0x8a6f9[_0x4f74('0x3')]>0x0){var _0x484d31=_['sortBy'](_0x8a6f9,['id']);for(var _0x2adb3b=0x0;_0x2adb3b<_0x484d31[_0x4f74('0x3')];_0x2adb3b++){var _0x34eb38=_0x484d31[_0x2adb3b];if(_0x34eb38[_0x4f74('0x4')]===_0x4f74('0x5')){_0x589ecb[_0x4f74('0x6')](_0x34eb38[_0x4f74('0x7')]);}else if(_0x34eb38[_0x4f74('0x4')]==='variable'&&_0x34eb38[_0x4f74('0x8')]){_0x265333[_0x34eb38['variableName']]&&_0x589ecb[_0x4f74('0x6')](_0x265333[_0x34eb38[_0x4f74('0x8')]][_0x4f74('0x9')]());}else if(_0x34eb38[_0x4f74('0x4')]==='customVariable'&&_0x34eb38[_0x4f74('0xa')]&&_0x34eb38[_0x4f74('0xa')][_0x4f74('0xb')]){_0x265333[_0x34eb38['Variable']['name'][_0x4f74('0xc')]()]&&_0x589ecb[_0x4f74('0x6')](_0x265333[_0x34eb38['Variable'][_0x4f74('0xb')]['toLowerCase']()][_0x4f74('0x9')]());}else if(_0x34eb38[_0x4f74('0x4')]===_0x4f74('0xd')){if(_0x34eb38[_0x4f74('0xe')]===_0x4f74('0x5')&&_0x34eb38[_0x4f74('0xf')]){_0x589ecb[_0x4f74('0x6')](util[_0x4f74('0x10')](_0x4f74('0x11'),_0x34eb38[_0x4f74('0xf')],_0x34eb38[_0x4f74('0x12')]));}else if(_0x34eb38[_0x4f74('0xe')]==='variable'&&_0x34eb38['variableName']&&_0x34eb38[_0x4f74('0xf')]){_0x265333[_0x34eb38[_0x4f74('0x8')]]&&_0x589ecb['push'](util[_0x4f74('0x10')](_0x4f74('0x11'),_0x34eb38[_0x4f74('0xf')],_0x265333[_0x34eb38['variableName']]));}else if(_0x34eb38[_0x4f74('0xe')]===_0x4f74('0x13')&&_0x34eb38[_0x4f74('0xa')]&&_0x34eb38[_0x4f74('0xa')][_0x4f74('0xb')]&&_0x34eb38[_0x4f74('0xf')]){_0x265333[_0x34eb38[_0x4f74('0xa')]['name'][_0x4f74('0xc')]()]&&_0x589ecb[_0x4f74('0x6')](util[_0x4f74('0x10')]('%s:\x20%s',_0x34eb38['key'],_0x265333[_0x34eb38['Variable']['name'][_0x4f74('0xc')]()]));}}}}return _0x589ecb[_0x4f74('0x14')](_0x5ace54);};exports['stripTrailingSlash']=function(_0x20ba5a){var _0x4a9df9=_0x20ba5a['slice'](-0x1);if(_0x4a9df9==='/'){_0x20ba5a=_0x20ba5a[_0x4f74('0x15')](0x0,_0x20ba5a[_0x4f74('0x16')](_0x4a9df9));}return _0x20ba5a;};exports[_0x4f74('0x17')]=function(_0x3ac02c){if(!_[_0x4f74('0x18')](_0x3ac02c)&&_0x3ac02c!==''){var _0x1c0a15=/^(([^<>()\[\]\\.,;:\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 _0x1c0a15['test'](String(_0x3ac02c)['toLowerCase']());}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 af92d7a..c65a624 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 _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x1b5a5a,_0x1c3b75){var _0x42b32d=function(_0x3d35ab){while(--_0x3d35ab){_0x1b5a5a['push'](_0x1b5a5a['shift']());}};_0x42b32d(++_0x1c3b75);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('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;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ No newline at end of file +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(_0x17471e,_0x219039){var _0x27fbea=function(_0x4518dd){while(--_0x4518dd){_0x17471e['push'](_0x17471e['shift']());}};_0x27fbea(++_0x219039);}(_0x34e8,0x12c));var _0x834e=function(_0x51f34b,_0x26faa9){_0x51f34b=_0x51f34b-0x0;var _0x3e4b74=_0x34e8[_0x51f34b];return _0x3e4b74;};'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 diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 655d37a..e0ef73f 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 _0x660c=['ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','POST','merge','name','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','results','filter','end-user','length','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','token','Basic\x20%s','toString','[HTTP]','stringify','GET','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField','variable','variableName','custom_fields','push','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','none','[OUTBOUND]','destcalleridname','destcalleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x660c,0xd1));var _0xc660=function(_0x59cab9,_0x3812a4){_0x59cab9=_0x59cab9-0x0;var _0x14d49e=_0x660c[_0x59cab9];return _0x14d49e;};'use strict';var _=require(_0xc660('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require(_0xc660('0x1'));var intUtil=require(_0xc660('0x2'));var config=require('../../../../config/environment');var logger=require(_0xc660('0x3'))(_0xc660('0x4'));config[_0xc660('0x5')]=_[_0xc660('0x6')](config[_0xc660('0x5')],{'host':_0xc660('0x7'),'port':0x18eb});var io=require(_0xc660('0x8'))(new Redis(config[_0xc660('0x5')]));function emit(_0x39c551,_0x3d9e45,_0x356464){io['to'](_0x39c551)[_0xc660('0x9')](_0x3d9e45,_0x356464);}var headers={'Content-Type':_0xc660('0xa'),'Accept':_0xc660('0xa')};function getTicket(_0x1d362b,_0x44fcd3,_0x40fa71,_0x52a449,_0x1a55b8){logger[_0xc660('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xc660('0xc')](_0xc660('0xd'),_0x1d362b['remoteUri']),'method':_0xc660('0xe'),'body':{'ticket':_[_0xc660('0xf')]({'requester_id':_0x40fa71['id'],'submitter_id':_0x44fcd3?_0x44fcd3['id']:undefined,'assignee_id':_0x44fcd3?_0x44fcd3['id']:undefined,'tags':getTags(_0x52a449['Tags'],_0xc660('0x10')),'subject':intUtil[_0xc660('0x11')](_0x52a449['Subjects'],_0x1a55b8,'\x20'),'description':intUtil[_0xc660('0x11')](_0x52a449[_0xc660('0x12')],_0x1a55b8,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc660('0x11')](_0x52a449[_0xc660('0x12')],_0x1a55b8,'\x0a')}},getCustomFields(_0x52a449[_0xc660('0x13')],_0x1a55b8))}})[_0xc660('0x14')](function(_0x30286c){logger[_0xc660('0xb')](_0xc660('0x15'));return _0x30286c[_0xc660('0x16')];});}function getUser(_0x382c43,_0x170ce7){if(intUtil[_0xc660('0x17')](_0x170ce7)){logger[_0xc660('0xb')](_0xc660('0x18'),_0x170ce7);return request({'uri':util[_0xc660('0xc')](_0xc660('0x19'),_0x382c43[_0xc660('0x1a')]),'qs':{'query':util[_0xc660('0xc')]('type:user\x20role:agent\x20email:%s',_0x170ce7)}})[_0xc660('0x14')](function(_0x302db6){if(_0x302db6[_0xc660('0x1b')]){logger['info']('Agent\x20found!');return _[_0xc660('0x1c')](_0x302db6['results'],{'email':_0x170ce7,'role':_0xc660('0x1d')});}else{logger[_0xc660('0xb')](_0xc660('0x1e'));return request({'uri':util['format'](_0xc660('0x1f'),_0x382c43['remoteUri'])})['then'](function(_0x423b4c){logger[_0xc660('0xb')](_0xc660('0x20'));return _0x423b4c[_0xc660('0x21')];});}});}else{logger[_0xc660('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xc660('0x1f'),_0x382c43[_0xc660('0x1a')])})['then'](function(_0x13a579){logger[_0xc660('0xb')](_0xc660('0x20'));return _0x13a579[_0xc660('0x21')];});}}function getEndUser(_0x5bb94e,_0x496680,_0x2b1d97){logger[_0xc660('0xb')]('Searching\x20enduser\x20with\x20phone',_0x2b1d97);return request({'uri':util[_0xc660('0xc')](_0xc660('0x19'),_0x5bb94e['remoteUri']),'qs':{'query':util[_0xc660('0xc')]('type:user\x20role:end-user\x20phone:%s',_0x2b1d97)}})[_0xc660('0x14')](function(_0x46a3be){var _0x5ea815;if(_0x46a3be[_0xc660('0x22')]['length']){_0x46a3be[_0xc660('0x22')]=_[_0xc660('0x23')](_0x46a3be[_0xc660('0x22')],{'suspended':![],'role':_0xc660('0x24')});if(_0x46a3be[_0xc660('0x22')][_0xc660('0x25')]){_0x5ea815=_[_0xc660('0x26')](_0x46a3be['results']);}}if(_0x5ea815){logger[_0xc660('0xb')]('Enduser\x20found!');return _0x5ea815;}else{logger['info'](_0xc660('0x27'));return request({'uri':util[_0xc660('0xc')]('%s/users.json',_0x5bb94e['remoteUri']),'method':_0xc660('0xe'),'body':{'user':{'role':_0xc660('0x24'),'name':util['format']('Caller\x20-\x20%s',_0x496680||_0x2b1d97),'phone':_0x2b1d97}}})[_0xc660('0x14')](function(_0x2094b7){logger['info'](_0xc660('0x28'));return _0x2094b7[_0xc660('0x21')];});}});}function getAuth(_0x1e160e){var _0x37ee76;if(_0x1e160e[_0xc660('0x29')]===_0xc660('0x2a')){_0x37ee76=util[_0xc660('0xc')](_0xc660('0x2b'),_0x1e160e[_0xc660('0x2c')],_0x1e160e[_0xc660('0x2a')]);}else if(_0x1e160e['authType']==='token'){_0x37ee76=util[_0xc660('0xc')](_0xc660('0x2d'),_0x1e160e[_0xc660('0x2c')],_0x1e160e[_0xc660('0x2e')]);}return util[_0xc660('0xc')](_0xc660('0x2f'),new Buffer(_0x37ee76)[_0xc660('0x30')]('base64'));}function request(_0x17173c){logger['debug'](_0xc660('0x31'),JSON[_0xc660('0x32')](_0x17173c));return rp(_[_0xc660('0x6')](_0x17173c,{'method':_0xc660('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x437452,_0x4fde6b){var _0x3c8d0d=[];if(_0x437452&&_0x437452[_0xc660('0x25')]>0x0){_0x3c8d0d=_['map'](_0x437452,_0x4fde6b);}return _0x3c8d0d;}function getCustomFields(_0x2578d4,_0x28307a){var _0x39a25d=[];var _0x451a04={'custom_fields':[]};if(_0x2578d4[_0xc660('0x25')]>0x0){_[_0xc660('0x34')](_0x2578d4,function(_0x37ff9a){if(_[_0xc660('0x35')]([_0xc660('0x36'),_0xc660('0x37')],_0x37ff9a[_0xc660('0x38')])&&_0x37ff9a['nameField']&&!_0x37ff9a[_0xc660('0x39')]){_0x451a04[_0x37ff9a[_0xc660('0x3a')][_0xc660('0x3b')]()]=_0x37ff9a[_0xc660('0x3c')][_0xc660('0x30')]();}else if(_['includes'](['string',_0xc660('0x37')],_0x37ff9a[_0xc660('0x38')])&&_0x37ff9a[_0xc660('0x3d')]&&_0x37ff9a[_0xc660('0x39')]){_0x451a04['custom_fields']['push']({'id':_0x37ff9a[_0xc660('0x3d')],'value':_0x37ff9a[_0xc660('0x3c')][_0xc660('0x30')]()});}else if(_0x37ff9a[_0xc660('0x38')]===_0xc660('0x3e')&&_0x37ff9a['variableName']&&_0x37ff9a[_0xc660('0x3d')]&&_0x37ff9a[_0xc660('0x39')]){_0x28307a[_0x37ff9a[_0xc660('0x3f')]]&&_0x451a04[_0xc660('0x40')][_0xc660('0x41')]({'id':_0x37ff9a[_0xc660('0x3d')],'value':_0x28307a[_0x37ff9a[_0xc660('0x3f')]][_0xc660('0x30')]()});}else if(_0x37ff9a[_0xc660('0x38')]==='customVariable'&&_0x37ff9a[_0xc660('0x42')]&&_0x37ff9a[_0xc660('0x42')]['name']&&_0x37ff9a['idField']&&_0x37ff9a[_0xc660('0x39')]){_0x28307a[_0x37ff9a['Variable'][_0xc660('0x10')]['toLowerCase']()]&&_0x451a04['custom_fields'][_0xc660('0x41')]({'id':_0x37ff9a[_0xc660('0x3d')],'value':_0x28307a[_0x37ff9a[_0xc660('0x42')][_0xc660('0x10')]['toLowerCase']()]['toString']()});}});}return _0x451a04;}exports[_0xc660('0x43')]=function(_0x369e57,_0xb18ad0,_0x1b6448,_0x3c31b3,_0x70a319,_0x4e5326){var _0x5b8cd9,_0x14c142;_0x4e5326[_0xc660('0x1a')]=intUtil[_0xc660('0x44')](_0x4e5326['remoteUri']);_0x4e5326[_0xc660('0x45')]=intUtil['stripTrailingSlash'](_0x4e5326['serverUrl']);if(_0x70a319&&_0x70a319[_0xc660('0x46')]){logger['info'](_0xc660('0x47'),_0xc660('0x48'));_0xb18ad0[_0xc660('0x49')]=util[_0xc660('0xc')](_0xc660('0x4a'),_0x4e5326[_0xc660('0x45')],_0xb18ad0[_0xc660('0x4b')],md5(_0xb18ad0[_0xc660('0x4b')]));}else{_0xb18ad0['recordingURL']='';}headers[_0xc660('0x4c')]=getAuth(_0x4e5326);return getUser(_0x4e5326,_0x3c31b3[_0xc660('0x4d')])[_0xc660('0x14')](function(_0xdf4cc2){_0x5b8cd9=_0xdf4cc2;logger[_0xc660('0xb')](_0xc660('0x4e'),_0x5b8cd9['id']);return getEndUser(_0x4e5326,_0xb18ad0[_0xc660('0x4f')],_0xb18ad0[_0xc660('0x50')]);})[_0xc660('0x14')](function(_0x521313){_0x14c142=_0x521313;logger['info'](_0xc660('0x51'),_0x14c142['id']);return getTicket(_0x4e5326,_0x5b8cd9,_0x14c142,_0x1b6448,_0xb18ad0);})['then'](function(_0x25aae6){if(_0x25aae6){logger[_0xc660('0xb')](_0xc660('0x52'),_0x25aae6['id']);switch(_0x4e5326[_0xc660('0x38')]){case'integrationTab':logger[_0xc660('0xb')](_0xc660('0x47'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xc660('0xc')](_0xc660('0x53'),_0x4e5326[_0xc660('0x1a')],_0x5b8cd9['id'],_0x25aae6['id']),'method':_0xc660('0xe')});case _0xc660('0x54'):logger['info'](_0xc660('0x47'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xc660('0xc')](_0xc660('0x55'),_0x3c31b3[_0xc660('0x10')]),_0xc660('0x56'),{'uri':util['format'](_0xc660('0x57'),_0x4e5326['remoteUri'][_0xc660('0x58')]('/api/v2',''),_0x25aae6['id'])});break;default:logger[_0xc660('0x59')]('[QUEUE]',_0xc660('0x5a'));}}})['catch'](function(_0x1bfebc){logger[_0xc660('0x59')](_0xc660('0x5b'),util[_0xc660('0x5c')](_0x1bfebc,{'showHidden':!![],'depth':null}));});};exports[_0xc660('0x5d')]=function(_0x13d3f7,_0xc79379,_0x4ba11d,_0x398bef,_0x856c56,_0x49c678,_0x565106){var _0x5e67e7,_0x528710;_0x49c678[_0xc660('0x1a')]=intUtil[_0xc660('0x44')](_0x49c678[_0xc660('0x1a')]);_0x49c678[_0xc660('0x45')]=intUtil[_0xc660('0x44')](_0x49c678[_0xc660('0x45')]);if(_0x565106&&_0x565106['recordingFormat']&&_0x565106['recordingFormat']!==_0xc660('0x5e')){logger[_0xc660('0xb')](_0xc660('0x5f'),_0xc660('0x48'));_0xc79379[_0xc660('0x49')]=util['format'](_0xc660('0x4a'),_0x49c678[_0xc660('0x45')],_0xc79379['uniqueid'],md5(_0xc79379[_0xc660('0x4b')]));}headers[_0xc660('0x4c')]=getAuth(_0x49c678);return getUser(_0x49c678,_0x398bef[_0xc660('0x4d')])[_0xc660('0x14')](function(_0x2bbfa9){_0x5e67e7=_0x2bbfa9;logger['info'](_0xc660('0x4e'),_0x5e67e7['id']);return getEndUser(_0x49c678,_0xc79379[_0xc660('0x60')],_0xc79379[_0xc660('0x61')]);})[_0xc660('0x14')](function(_0x5014c5){_0x528710=_0x5014c5;logger[_0xc660('0xb')](_0xc660('0x51'),_0x528710['id']);return getTicket(_0x49c678,_0x5e67e7,_0x528710,_0x4ba11d,_0xc79379);})['then'](function(_0x477a4d){if(_0x477a4d){logger[_0xc660('0xb')](_0xc660('0x52'),_0x477a4d['id']);switch(_0x49c678[_0xc660('0x38')]){case _0xc660('0x62'):logger[_0xc660('0xb')](_0xc660('0x5f'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xc660('0xc')](_0xc660('0x53'),_0x49c678[_0xc660('0x1a')],_0x5e67e7['id'],_0x477a4d['id']),'method':_0xc660('0xe')});case _0xc660('0x54'):logger[_0xc660('0xb')]('[OUTBOUND]',_0xc660('0x63'));emit(util['format'](_0xc660('0x55'),_0x398bef[_0xc660('0x10')]),'trigger:browser:url',{'uri':util[_0xc660('0xc')]('%s/agent/tickets/%s',_0x49c678['remoteUri'][_0xc660('0x58')]('/api/v2',''),_0x477a4d['id'])});break;default:logger['error']('[OUTBOUND]',_0xc660('0x5a'));}}})[_0xc660('0x64')](function(_0x108cb4){logger[_0xc660('0x59')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x108cb4,{'showHidden':!![],'depth':null}));});};exports[_0xc660('0x65')]=function(_0xab7267,_0x2128db,_0x33cd82,_0x205b85,_0x5b2e09,_0x51b137){var _0x10da17,_0x19d855;_0x51b137[_0xc660('0x1a')]=intUtil[_0xc660('0x44')](_0x51b137[_0xc660('0x1a')]);_0x51b137[_0xc660('0x45')]=intUtil[_0xc660('0x44')](_0x51b137[_0xc660('0x45')]);if(_0x5b2e09&&_0x5b2e09[_0xc660('0x46')]){logger[_0xc660('0xb')]('['+_0x2128db[_0xc660('0x66')][_0xc660('0x67')]()+']','Recording\x20is\x20enabled!');_0x2128db[_0xc660('0x49')]=util[_0xc660('0xc')](_0xc660('0x4a'),_0x51b137[_0xc660('0x45')],_0x2128db[_0xc660('0x4b')],md5(_0x2128db[_0xc660('0x4b')]));}else{_0x2128db[_0xc660('0x49')]='';}headers[_0xc660('0x4c')]=getAuth(_0x51b137);return getUser(_0x51b137)[_0xc660('0x14')](function(_0x2be4aa){_0x10da17=_0x2be4aa;logger['info'](_0xc660('0x4e'),_0x10da17['id']);return getEndUser(_0x51b137,_0x2128db['calleridname'],_0x2128db['calleridnum']);})[_0xc660('0x14')](function(_0x3f0b4e){_0x19d855=_0x3f0b4e;logger[_0xc660('0xb')](_0xc660('0x51'),_0x19d855['id']);return getTicket(_0x51b137,_0x10da17,_0x19d855,_0x33cd82,_0x2128db);})[_0xc660('0x14')](function(_0x2ebe5a){if(_0x2ebe5a){logger[_0xc660('0xb')](_0xc660('0x52'),_0x2ebe5a['id']);}})[_0xc660('0x64')](function(_0x150797){logger[_0xc660('0x59')]('['+_0x2128db[_0xc660('0x66')]['toUpperCase']()+']'+_0xc660('0x68'),util[_0xc660('0x5c')](_0x150797,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4107=['Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','%s/users/me.json','remoteUri','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','stringify','GET','type','nameField','customField','toLowerCase','content','includes','string','picklist','custom_fields','idField','push','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','%s/agent/tickets/%s','replace','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0x4107,0x126));var _0x7410=function(_0x4a45b4,_0x59804f){_0x4a45b4=_0x4a45b4-0x0;var _0x1a99c9=_0x4107[_0x4a45b4];return _0x1a99c9;};'use strict';var _=require(_0x7410('0x0'));var rp=require('request-promise');var md5=require(_0x7410('0x1'));var util=require('util');var Redis=require(_0x7410('0x2'));var intUtil=require(_0x7410('0x3'));var config=require('../../../../config/environment');var logger=require(_0x7410('0x4'))(_0x7410('0x5'));config[_0x7410('0x6')]=_[_0x7410('0x7')](config['redis'],{'host':_0x7410('0x8'),'port':0x18eb});var io=require(_0x7410('0x9'))(new Redis(config[_0x7410('0x6')]));function emit(_0x5a346b,_0x52ad4b,_0x8a831e){io['to'](_0x5a346b)['emit'](_0x52ad4b,_0x8a831e);}var headers={'Content-Type':_0x7410('0xa'),'Accept':'application/json'};function getTicket(_0xce1a66,_0x355700,_0x1452d3,_0x51f604,_0x1d1a9b){logger[_0x7410('0xb')](_0x7410('0xc'));return request({'uri':util[_0x7410('0xd')](_0x7410('0xe'),_0xce1a66['remoteUri']),'method':_0x7410('0xf'),'body':{'ticket':_[_0x7410('0x10')]({'requester_id':_0x1452d3['id'],'submitter_id':_0x355700?_0x355700['id']:undefined,'assignee_id':_0x355700?_0x355700['id']:undefined,'tags':getTags(_0x51f604[_0x7410('0x11')],_0x7410('0x12')),'subject':intUtil[_0x7410('0x13')](_0x51f604[_0x7410('0x14')],_0x1d1a9b,'\x20'),'description':intUtil['getString'](_0x51f604[_0x7410('0x15')],_0x1d1a9b,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x51f604[_0x7410('0x15')],_0x1d1a9b,'\x0a')}},getCustomFields(_0x51f604[_0x7410('0x16')],_0x1d1a9b))}})[_0x7410('0x17')](function(_0x5dfdf3){logger[_0x7410('0xb')](_0x7410('0x18'));return _0x5dfdf3['ticket'];});}function getUser(_0x464359,_0x49fe17){if(intUtil[_0x7410('0x19')](_0x49fe17)){logger[_0x7410('0xb')](_0x7410('0x1a'),_0x49fe17);return request({'uri':util[_0x7410('0xd')](_0x7410('0x1b'),_0x464359['remoteUri']),'qs':{'query':util[_0x7410('0xd')](_0x7410('0x1c'),_0x49fe17)}})[_0x7410('0x17')](function(_0x1b1c95){if(_0x1b1c95[_0x7410('0x1d')]){logger[_0x7410('0xb')](_0x7410('0x1e'));return _[_0x7410('0x1f')](_0x1b1c95[_0x7410('0x20')],{'email':_0x49fe17,'role':'agent'});}else{logger[_0x7410('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x7410('0xd')](_0x7410('0x21'),_0x464359[_0x7410('0x22')])})['then'](function(_0x554ba4){logger[_0x7410('0xb')](_0x7410('0x23'));return _0x554ba4[_0x7410('0x24')];});}});}else{logger['info'](_0x7410('0x25'));return request({'uri':util[_0x7410('0xd')]('%s/users/me.json',_0x464359[_0x7410('0x22')])})[_0x7410('0x17')](function(_0x56e274){logger[_0x7410('0xb')]('Admin\x20account\x20selected.');return _0x56e274[_0x7410('0x24')];});}}function getEndUser(_0x1fca95,_0x3d9a50,_0xa5428b){logger[_0x7410('0xb')]('Searching\x20enduser\x20with\x20phone',_0xa5428b);return request({'uri':util[_0x7410('0xd')](_0x7410('0x1b'),_0x1fca95['remoteUri']),'qs':{'query':util[_0x7410('0xd')](_0x7410('0x26'),_0xa5428b)}})[_0x7410('0x17')](function(_0x43d268){var _0x4839cf;if(_0x43d268[_0x7410('0x20')][_0x7410('0x27')]){_0x43d268['results']=_[_0x7410('0x28')](_0x43d268[_0x7410('0x20')],{'suspended':![],'role':_0x7410('0x29')});if(_0x43d268['results']['length']){_0x4839cf=_['first'](_0x43d268['results']);}}if(_0x4839cf){logger[_0x7410('0xb')]('Enduser\x20found!');return _0x4839cf;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x7410('0xd')](_0x7410('0x2a'),_0x1fca95[_0x7410('0x22')]),'method':_0x7410('0xf'),'body':{'user':{'role':_0x7410('0x29'),'name':util[_0x7410('0xd')](_0x7410('0x2b'),_0x3d9a50||_0xa5428b),'phone':_0xa5428b}}})['then'](function(_0x46d8f7){logger[_0x7410('0xb')](_0x7410('0x2c'));return _0x46d8f7[_0x7410('0x24')];});}});}function getAuth(_0x24bc5d){var _0x469790;if(_0x24bc5d['authType']===_0x7410('0x2d')){_0x469790=util[_0x7410('0xd')](_0x7410('0x2e'),_0x24bc5d[_0x7410('0x2f')],_0x24bc5d[_0x7410('0x2d')]);}else if(_0x24bc5d['authType']===_0x7410('0x30')){_0x469790=util[_0x7410('0xd')](_0x7410('0x31'),_0x24bc5d['username'],_0x24bc5d[_0x7410('0x30')]);}return util[_0x7410('0xd')](_0x7410('0x32'),new Buffer(_0x469790)[_0x7410('0x33')](_0x7410('0x34')));}function request(_0x2b5926){logger['debug']('[HTTP]',JSON[_0x7410('0x35')](_0x2b5926));return rp(_[_0x7410('0x7')](_0x2b5926,{'method':_0x7410('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x2a6c71,_0x185776){var _0x38695d=[];if(_0x2a6c71&&_0x2a6c71[_0x7410('0x27')]>0x0){_0x38695d=_['map'](_0x2a6c71,_0x185776);}return _0x38695d;}function getCustomFields(_0x12d6a1,_0xfe9359){var _0x22ebe1=[];var _0x3c4762={'custom_fields':[]};if(_0x12d6a1['length']>0x0){_['forEach'](_0x12d6a1,function(_0x5b4661){if(_['includes'](['string','picklist'],_0x5b4661[_0x7410('0x37')])&&_0x5b4661[_0x7410('0x38')]&&!_0x5b4661[_0x7410('0x39')]){_0x3c4762[_0x5b4661[_0x7410('0x38')][_0x7410('0x3a')]()]=_0x5b4661[_0x7410('0x3b')][_0x7410('0x33')]();}else if(_[_0x7410('0x3c')]([_0x7410('0x3d'),_0x7410('0x3e')],_0x5b4661[_0x7410('0x37')])&&_0x5b4661['idField']&&_0x5b4661[_0x7410('0x39')]){_0x3c4762[_0x7410('0x3f')]['push']({'id':_0x5b4661['idField'],'value':_0x5b4661[_0x7410('0x3b')][_0x7410('0x33')]()});}else if(_0x5b4661[_0x7410('0x37')]==='variable'&&_0x5b4661['variableName']&&_0x5b4661[_0x7410('0x40')]&&_0x5b4661[_0x7410('0x39')]){_0xfe9359[_0x5b4661['variableName']]&&_0x3c4762[_0x7410('0x3f')][_0x7410('0x41')]({'id':_0x5b4661[_0x7410('0x40')],'value':_0xfe9359[_0x5b4661[_0x7410('0x42')]][_0x7410('0x33')]()});}else if(_0x5b4661[_0x7410('0x37')]==='customVariable'&&_0x5b4661[_0x7410('0x43')]&&_0x5b4661[_0x7410('0x43')]['name']&&_0x5b4661[_0x7410('0x40')]&&_0x5b4661['customField']){_0xfe9359[_0x5b4661[_0x7410('0x43')]['name'][_0x7410('0x3a')]()]&&_0x3c4762['custom_fields'][_0x7410('0x41')]({'id':_0x5b4661[_0x7410('0x40')],'value':_0xfe9359[_0x5b4661['Variable'][_0x7410('0x12')][_0x7410('0x3a')]()][_0x7410('0x33')]()});}});}return _0x3c4762;}exports[_0x7410('0x44')]=function(_0x3411c0,_0x104aa5,_0x3103b3,_0x2f2328,_0x2160df,_0x103412){var _0x17b24a,_0x5b83bf;_0x103412['remoteUri']=intUtil[_0x7410('0x45')](_0x103412['remoteUri']);_0x103412[_0x7410('0x46')]=intUtil['stripTrailingSlash'](_0x103412[_0x7410('0x46')]);if(_0x2160df&&_0x2160df[_0x7410('0x47')]){logger[_0x7410('0xb')](_0x7410('0x48'),'Recording\x20is\x20enabled!');_0x104aa5[_0x7410('0x49')]=util[_0x7410('0xd')](_0x7410('0x4a'),_0x103412[_0x7410('0x46')],_0x104aa5[_0x7410('0x4b')],md5(_0x104aa5['uniqueid']));}else{_0x104aa5[_0x7410('0x49')]='';}headers[_0x7410('0x4c')]=getAuth(_0x103412);return getUser(_0x103412,_0x2f2328[_0x7410('0x4d')])[_0x7410('0x17')](function(_0x464184){_0x17b24a=_0x464184;logger[_0x7410('0xb')]('The\x20User\x20ID\x20is:',_0x17b24a['id']);return getEndUser(_0x103412,_0x104aa5['calleridname'],_0x104aa5[_0x7410('0x4e')]);})[_0x7410('0x17')](function(_0x337944){_0x5b83bf=_0x337944;logger[_0x7410('0xb')](_0x7410('0x4f'),_0x5b83bf['id']);return getTicket(_0x103412,_0x17b24a,_0x5b83bf,_0x3103b3,_0x104aa5);})[_0x7410('0x17')](function(_0x5ab7e0){if(_0x5ab7e0){logger[_0x7410('0xb')](_0x7410('0x50'),_0x5ab7e0['id']);switch(_0x103412[_0x7410('0x37')]){case _0x7410('0x51'):logger[_0x7410('0xb')](_0x7410('0x48'),_0x7410('0x52'));return request({'uri':util[_0x7410('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x103412[_0x7410('0x22')],_0x17b24a['id'],_0x5ab7e0['id']),'method':_0x7410('0xf')});case'newTab':logger[_0x7410('0xb')](_0x7410('0x48'),_0x7410('0x53'));emit(util[_0x7410('0xd')](_0x7410('0x54'),_0x2f2328['name']),_0x7410('0x55'),{'uri':util[_0x7410('0xd')]('%s/agent/tickets/%s',_0x103412[_0x7410('0x22')]['replace'](_0x7410('0x56'),''),_0x5ab7e0['id'])});break;default:logger[_0x7410('0x57')](_0x7410('0x48'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x7410('0x58')](function(_0x4543f2){logger[_0x7410('0x57')](_0x7410('0x59'),util[_0x7410('0x5a')](_0x4543f2,{'showHidden':!![],'depth':null}));});};exports[_0x7410('0x5b')]=function(_0x2a18e9,_0x1a036f,_0x55b226,_0x118735,_0x31e236,_0x56f71e,_0x4f1923){var _0x34b9e9,_0x20268c;_0x56f71e['remoteUri']=intUtil[_0x7410('0x45')](_0x56f71e['remoteUri']);_0x56f71e[_0x7410('0x46')]=intUtil[_0x7410('0x45')](_0x56f71e[_0x7410('0x46')]);if(_0x4f1923&&_0x4f1923[_0x7410('0x5c')]&&_0x4f1923[_0x7410('0x5c')]!==_0x7410('0x5d')){logger[_0x7410('0xb')](_0x7410('0x5e'),'Recording\x20is\x20enabled!');_0x1a036f[_0x7410('0x49')]=util[_0x7410('0xd')](_0x7410('0x4a'),_0x56f71e[_0x7410('0x46')],_0x1a036f[_0x7410('0x4b')],md5(_0x1a036f[_0x7410('0x4b')]));}headers[_0x7410('0x4c')]=getAuth(_0x56f71e);return getUser(_0x56f71e,_0x118735[_0x7410('0x4d')])[_0x7410('0x17')](function(_0x4b4141){_0x34b9e9=_0x4b4141;logger['info'](_0x7410('0x5f'),_0x34b9e9['id']);return getEndUser(_0x56f71e,_0x1a036f['destcalleridname'],_0x1a036f[_0x7410('0x60')]);})[_0x7410('0x17')](function(_0x1077fe){_0x20268c=_0x1077fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x20268c['id']);return getTicket(_0x56f71e,_0x34b9e9,_0x20268c,_0x55b226,_0x1a036f);})['then'](function(_0x5b53b3){if(_0x5b53b3){logger['info'](_0x7410('0x50'),_0x5b53b3['id']);switch(_0x56f71e['type']){case _0x7410('0x51'):logger['info'](_0x7410('0x5e'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x7410('0xd')](_0x7410('0x61'),_0x56f71e['remoteUri'],_0x34b9e9['id'],_0x5b53b3['id']),'method':'POST'});case'newTab':logger[_0x7410('0xb')](_0x7410('0x5e'),_0x7410('0x53'));emit(util[_0x7410('0xd')]('user:%s',_0x118735[_0x7410('0x12')]),_0x7410('0x55'),{'uri':util[_0x7410('0xd')](_0x7410('0x62'),_0x56f71e['remoteUri'][_0x7410('0x63')](_0x7410('0x56'),''),_0x5b53b3['id'])});break;default:logger[_0x7410('0x57')]('[OUTBOUND]',_0x7410('0x64'));}}})[_0x7410('0x58')](function(_0x49d521){logger[_0x7410('0x57')](_0x7410('0x65'),util[_0x7410('0x5a')](_0x49d521,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x144cb5,_0xee269,_0x2e2ee7,_0x170645,_0x76b36b,_0x25251c){var _0x13d654,_0x26020c;_0x25251c[_0x7410('0x22')]=intUtil['stripTrailingSlash'](_0x25251c[_0x7410('0x22')]);_0x25251c[_0x7410('0x46')]=intUtil['stripTrailingSlash'](_0x25251c[_0x7410('0x46')]);if(_0x76b36b&&_0x76b36b['monitor_format']){logger[_0x7410('0xb')]('['+_0xee269[_0x7410('0x66')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0xee269[_0x7410('0x49')]=util[_0x7410('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x25251c[_0x7410('0x46')],_0xee269['uniqueid'],md5(_0xee269[_0x7410('0x4b')]));}else{_0xee269['recordingURL']='';}headers[_0x7410('0x4c')]=getAuth(_0x25251c);return getUser(_0x25251c)[_0x7410('0x17')](function(_0x481a90){_0x13d654=_0x481a90;logger[_0x7410('0xb')]('The\x20User\x20ID\x20is:',_0x13d654['id']);return getEndUser(_0x25251c,_0xee269['calleridname'],_0xee269['calleridnum']);})['then'](function(_0x33bc79){_0x26020c=_0x33bc79;logger[_0x7410('0xb')]('The\x20Enduser\x20ID\x20is:',_0x26020c['id']);return getTicket(_0x25251c,_0x13d654,_0x26020c,_0x2e2ee7,_0xee269);})['then'](function(_0x40a16a){if(_0x40a16a){logger['info'](_0x7410('0x50'),_0x40a16a['id']);}})['catch'](function(_0x33da2d){logger[_0x7410('0x57')]('['+_0xee269[_0x7410('0x66')][_0x7410('0x67')]()+']'+_0x7410('0x68'),util[_0x7410('0x5a')](_0x33da2d,{'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 c8a512c..ce5656f 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 _0x8393=['stack','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','com','calleridname','calleridnum','trigger:browser:url','https://crm.','outbound','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','Outbound','[OUTBOUND]','user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','zoho.eu','Inbound','The\x20Call\x20ID\x20is:','lodash','request-promise','md5','util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','emit','debug','[HTTP]','length','forEach','includes','string','picklist','idField','toString','type','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refresh_token','then','add','info','Search\x20user','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','profile','Administrator','user','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','What_Id','utc','talktime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Called','complete','connect','Call_Result','Answered','rejected','abandoned','Abandoned','timeout','Timeout','starttime','Call_Type','merge','/crm/v2/Calls','code','err'];(function(_0x5834c7,_0x596152){var _0x151d83=function(_0x14ec39){while(--_0x14ec39){_0x5834c7['push'](_0x5834c7['shift']());}};_0x151d83(++_0x596152);}(_0x8393,0x1e1));var _0x3839=function(_0x3de703,_0x4b0e56){_0x3de703=_0x3de703-0x0;var _0x14d5e2=_0x8393[_0x3de703];return _0x14d5e2;};'use strict';var _=require(_0x3839('0x0'));var rp=require(_0x3839('0x1'));var md5=require(_0x3839('0x2'));var util=require(_0x3839('0x3'));var intUtil=require('./util');var moment=require(_0x3839('0x4'));var Redis=require('ioredis');var BPromise=require(_0x3839('0x5'));var config=require(_0x3839('0x6'));var logger=require(_0x3839('0x7'))(_0x3839('0x8'));config[_0x3839('0x9')]=_[_0x3839('0xa')](config[_0x3839('0x9')],{'host':_0x3839('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3839('0x9')]));function emit(_0x36caa8,_0x1ec6b3,_0x1e2796){io['to'](_0x36caa8)[_0x3839('0xc')](_0x1ec6b3,_0x1e2796);}function request(_0x578bed){logger[_0x3839('0xd')](_0x3839('0xe'),JSON['stringify'](_0x578bed));return rp(_0x578bed);}function getCustomFields(_0x1842db,_0x39ec22){var _0x17d13f={};if(_0x1842db[_0x3839('0xf')]>0x0){_[_0x3839('0x10')](_0x1842db,function(_0x4541bf){if(_[_0x3839('0x11')]([_0x3839('0x12'),_0x3839('0x13')],_0x4541bf['type'])&&_0x4541bf[_0x3839('0x14')]){_0x17d13f[_0x4541bf['idField']]=_0x4541bf['content'][_0x3839('0x15')]();}else if(_0x4541bf[_0x3839('0x16')]==='variable'&&_0x4541bf[_0x3839('0x17')]&&_0x4541bf[_0x3839('0x14')]&&_0x39ec22[_0x4541bf[_0x3839('0x17')]]){_0x17d13f[_0x4541bf[_0x3839('0x14')]]=_0x39ec22[_0x4541bf[_0x3839('0x17')]][_0x3839('0x15')]();}else if(_0x4541bf[_0x3839('0x16')]===_0x3839('0x18')&&_0x4541bf[_0x3839('0x19')]&&_0x4541bf[_0x3839('0x19')][_0x3839('0x1a')]&&_0x4541bf['idField']&&_0x39ec22[_0x4541bf['Variable'][_0x3839('0x1a')][_0x3839('0x1b')]()]){_0x17d13f[_0x4541bf['idField']]=_0x39ec22[_0x4541bf[_0x3839('0x19')]['name'][_0x3839('0x1b')]()][_0x3839('0x15')]();}});}return _0x17d13f;}function getName(_0x4c9838){if(_0x4c9838[_0x3839('0x1c')]('\x20')>0x0){var _0x19bb04=_0x4c9838['split'](/ (.+)/);if(_0x19bb04[0x1]){return _0x19bb04;}}return[_0x4c9838,_0x4c9838];}var accountsTokens={};function getAccessToken(_0x1e91b6){return new Promise(function(_0xefc744,_0x43da6b){if(!_[_0x3839('0x1d')](accountsTokens[_0x1e91b6['id']])&&!_[_0x3839('0x1d')](accountsTokens[_0x1e91b6['id']][_0x3839('0x1e')])){if(moment()['isBefore'](accountsTokens[_0x1e91b6['id']][_0x3839('0x1f')])){_0xefc744(accountsTokens[_0x1e91b6['id']][_0x3839('0x1e')]);}}var _0x35dff4;switch(_0x1e91b6[_0x3839('0x20')]){case'US':_0x35dff4='https://accounts.zoho.com';break;case'AU':_0x35dff4=_0x3839('0x21');break;case'EU':_0x35dff4=_0x3839('0x22');break;case'IN':_0x35dff4=_0x3839('0x23');break;case'CN':_0x35dff4=_0x3839('0x24');break;default:_0x35dff4='https://accounts.zoho.eu';break;}var _0x43c32d={'method':'POST','uri':_0x35dff4+_0x3839('0x25'),'qs':{'refresh_token':_0x1e91b6['refreshToken'],'client_id':_0x1e91b6['clientId'],'client_secret':_0x1e91b6['clientSecret'],'grant_type':_0x3839('0x26')},'json':!![]};return rp(_0x43c32d)[_0x3839('0x27')](function(_0xf9c3b4){accountsTokens[_0x1e91b6['id']]={'access_token':_0xf9c3b4[_0x3839('0x1e')],'expires_in':moment()[_0x3839('0x28')](_0xf9c3b4['expires_in'],'seconds')};_0xefc744(_0xf9c3b4[_0x3839('0x1e')]);})['catch'](function(_0x2fa615){logger['error']('Failing\x20creating\x20the\x20access_token',_0x2fa615['stack']);_0x43da6b(_0x2fa615);});});}function getUser(_0x1d197f,_0x2e0de1,_0x19a7d1,_0x22b3a0){logger[_0x3839('0x29')](_0x3839('0x2a'));return request({'method':'GET','uri':util[_0x3839('0x2b')]('https://www.zohoapis.%s/crm/v2/users',_0x2e0de1),'qs':{'type':_0x3839('0x2c')},'headers':{'Authorization':_0x3839('0x2d')+_0x1d197f},'json':!![]})[_0x3839('0x27')](function(_0x588cb9){if(_0x588cb9[_0x3839('0x2e')]){var _0x173d69=-0x1;if(_[_0x3839('0x2f')](_0x588cb9[_0x3839('0x2e')])){if(!_[_0x3839('0x1d')](_0x22b3a0)){_0x173d69=_[_0x3839('0x30')](_0x588cb9[_0x3839('0x2e')],function(_0x654a88){return _0x654a88[_0x3839('0x31')]===_0x22b3a0;});}if(_0x173d69>=0x0){logger['info'](_0x3839('0x32'));}else{logger[_0x3839('0x29')]('Using\x20the\x20admin\x20account!');_0x173d69=_['findIndex'](_0x588cb9['users'],function(_0x58a881){return _0x58a881[_0x3839('0x33')][_0x3839('0x1a')]===_0x3839('0x34');});}return _0x588cb9[_0x3839('0x2e')][_0x173d69];}else{if(_0x588cb9['user']['profile']['name']===_0x3839('0x34')){logger[_0x3839('0x29')]('Using\x20the\x20admin\x20account!');user=_0x588cb9[_0x3839('0x35')];return user;}else{logger[_0x3839('0x36')](_0x3839('0x37'),JSON[_0x3839('0x38')](_0x588cb9));throw new Error(_0x3839('0x39')+JSON[_0x3839('0x38')](_0x588cb9));}}}else{logger[_0x3839('0x36')](_0x3839('0x37'),JSON['stringify'](_0x588cb9));throw new Error(_0x3839('0x39')+JSON[_0x3839('0x38')](_0x588cb9));}})[_0x3839('0x3a')](function(_0xd68b88){console[_0x3839('0x36')](_0xd68b88);});}function getZohoUser(_0x3f237c,_0x509619){return new BPromise(function(_0x2fc5cf,_0x2fb7a4){request(_0x3f237c)['then'](function(_0x22525f){var _0x1e1f56=null;if(_0x22525f){_0x1e1f56=_0x22525f[_0x3839('0x3b')][0x0];_0x1e1f56[_0x3839('0x3c')]=_0x509619;}_0x2fc5cf(_0x1e1f56);})[_0x3839('0x3a')](function(_0x4474a6){_0x2fb7a4(_0x4474a6);});});}function createEndUser(_0x2048f6,_0x1e977f,_0x5eec0f,_0x4e22ec,_0x1bdbba,_0x39dae3){var _0x5eec0f=getName(_0x5eec0f);return request({'method':_0x3839('0x3d'),'uri':_0x3839('0x3e')+_0x1e977f+_0x3839('0x3f')+_[_0x3839('0x40')](_0x39dae3[_0x3839('0x41')])+'s','body':{'data':[{'Last_Name':_0x5eec0f[0x1],'First_Name':_0x5eec0f[0x0],'Phone':_0x4e22ec,'Owner':{'name':!_[_0x3839('0x1d')](_0x1bdbba[_0x3839('0x42')][_0x3839('0x1a')])?_0x1bdbba[_0x3839('0x42')][_0x3839('0x1a')]:!_[_0x3839('0x1d')](_0x1bdbba['first_name'])?_0x1bdbba[_0x3839('0x43')]+'\x20'+_0x1bdbba['last_name']:_0x1bdbba[_0x3839('0x44')],'id':_0x1bdbba['id']}}]},'headers':{'Authorization':_0x3839('0x2d')+_0x2048f6},'json':!![]})[_0x3839('0x27')](function(_0x4df94f){if(_0x4df94f&&_0x4df94f[_0x3839('0x3b')][0x0]['code']===_0x3839('0x45')){var _0x37d0dd=_0x4df94f['data'][0x0][_0x3839('0x46')];_0x37d0dd[_0x3839('0x3c')]=_[_0x3839('0x40')](_0x39dae3[_0x3839('0x41')])+'s';return _0x37d0dd;}logger[_0x3839('0x36')](_0x3839('0x37'),JSON[_0x3839('0x38')](data));throw new Error(_0x3839('0x47')+JSON[_0x3839('0x38')](data));})['catch'](function(_0x5642de){console[_0x3839('0x48')](_0x3839('0x49'),_0x5642de);});}function getEndUser(_0x9a1d6,_0x89c37a,_0x1fd8b0,_0x163235,_0x2559a0,_0x1aee6b,_0x4b5b29){var _0x4e8050={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x9a1d6},'json':!![]};switch(_0x4b5b29[_0x3839('0x4a')]){case _0x3839('0x4b'):_0x4e8050[_0x3839('0x4c')]=_0x3839('0x3e')+_0x89c37a+_0x3839('0x4d')+_0x2559a0+'))';return getZohoUser(_0x4e8050,'Contacts')['then'](function(_0x40312d){if(_0x40312d)return _0x40312d;_0x4e8050[_0x3839('0x4c')]='https://www.zohoapis.'+_0x89c37a+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2559a0+'))';return getZohoUser(_0x4e8050,_0x3839('0x4e'))['then'](function(_0x1b7318){if(_0x1b7318)return _0x1b7318;if(_0x4b5b29[_0x3839('0x41')]!=_0x3839('0x4f')){return createEndUser(_0x9a1d6,_0x89c37a,_0x163235,_0x2559a0,_0x1aee6b,_0x4b5b29);}else{return{};}});});break;case _0x3839('0x50'):_0x4e8050[_0x3839('0x4c')]=_0x3839('0x3e')+_0x89c37a+_0x3839('0x4d')+_0x2559a0+'))';return getZohoUser(_0x4e8050,'Contacts')[_0x3839('0x27')](function(_0x34db24){if(_0x34db24)return _0x34db24;if(_0x4b5b29['moduleCreate']!=_0x3839('0x4f')){return createEndUser(_0x9a1d6,_0x89c37a,_0x163235,_0x2559a0,_0x1aee6b,_0x4b5b29);}else{return{};}});break;case'lead':_0x4e8050[_0x3839('0x4c')]='https://www.zohoapis.'+_0x89c37a+_0x3839('0x51')+_0x2559a0+'))';return getZohoUser(_0x4e8050,_0x3839('0x4e'))[_0x3839('0x27')](function(_0x29bb73){if(_0x29bb73)return _0x29bb73;if(_0x4b5b29[_0x3839('0x41')]!=_0x3839('0x4f')){return createEndUser(_0x9a1d6,_0x89c37a,_0x163235,_0x2559a0,_0x1aee6b,_0x4b5b29);}else{return{};}});break;}}function getCall(_0x54c23c,_0x36bd22,_0x378dd1,_0x2a3b39,_0x532d33,_0x375826,_0x4aa69d,_0x5e55a5){logger[_0x3839('0x29')](_0x3839('0x52'));var _0xcba47d={};_0xcba47d[_0x3839('0x53')]={'name':!_['isNil'](_0x2a3b39[_0x3839('0x42')][_0x3839('0x1a')])&&!_[_0x3839('0x1d')](_0x2a3b39[_0x3839('0x33')][_0x3839('0x1a')])&&_0x2a3b39[_0x3839('0x33')][_0x3839('0x1a')]===_0x3839('0x54')?_0x2a3b39[_0x3839('0x42')]['name']:!_[_0x3839('0x1d')](_0x2a3b39[_0x3839('0x43')])?_0x2a3b39[_0x3839('0x43')]+'\x20'+_0x2a3b39[_0x3839('0x44')]:_0x2a3b39[_0x3839('0x44')],'id':_0x2a3b39['id']};_0xcba47d[_0x3839('0x55')]=intUtil[_0x3839('0x56')](_0x375826['Subjects'],_0x4aa69d,'\x20');_0xcba47d[_0x3839('0x57')]=intUtil[_0x3839('0x56')](_0x375826[_0x3839('0x58')],_0x4aa69d,'\x0a');if(_0x532d33[_0x3839('0x3c')]===_0x3839('0x59')){_0xcba47d[_0x3839('0x5a')]={'name':!_['isNil'](_0x532d33[_0x3839('0x5b')])?_0x532d33[_0x3839('0x5b')]:!_[_0x3839('0x1d')](_0x532d33[_0x3839('0x5c')])?_0x532d33[_0x3839('0x5c')]+'\x20'+_0x532d33[_0x3839('0x5d')]:_0x532d33[_0x3839('0x5d')],'id':_0x532d33['id']};}if(_0x532d33[_0x3839('0x3c')]==='Leads'){_0xcba47d[_0x3839('0x5e')]={'name':!_[_0x3839('0x1d')](_0x532d33[_0x3839('0x5b')])?_0x532d33[_0x3839('0x5b')]:!_[_0x3839('0x1d')](_0x532d33[_0x3839('0x5c')])?_0x532d33['First_Name']+'\x20'+_0x532d33[_0x3839('0x5d')]:_0x532d33[_0x3839('0x5d')],'id':_0x532d33['id']};_0xcba47d['$se_module']=_[_0x3839('0x40')](_0x532d33['enduserType']);}if(_0x4aa69d['talktime']){_0xcba47d['Call_Duration']=moment[_0x3839('0x5f')](parseInt(_0x4aa69d[_0x3839('0x60')])*0x3e8)[_0x3839('0x2b')]('mm:ss');}else if(_0x4aa69d['answertime']&&_0x4aa69d[_0x3839('0x61')]){_0xcba47d[_0x3839('0x62')]=moment[_0x3839('0x5f')](moment(_0x4aa69d[_0x3839('0x61')],_0x3839('0x63'))[_0x3839('0x64')](moment(_0x4aa69d['starttime'],_0x3839('0x63'))))[_0x3839('0x2b')]('mm:ss');}switch(_0x4aa69d[_0x3839('0x65')]){case _0x3839('0x66'):_0xcba47d['Call_Result']=_0x3839('0x67');break;case _0x3839('0x68'):case _0x3839('0x69'):_0xcba47d[_0x3839('0x6a')]=_0x3839('0x6b');break;case _0x3839('0x6c'):_0xcba47d['Call_Result']='Rejected';break;case _0x3839('0x6d'):_0xcba47d[_0x3839('0x6a')]=_0x3839('0x6e');break;case _0x3839('0x6f'):_0xcba47d['Call_Result']=_0x3839('0x70');default:}_0xcba47d['Call_Start_Time']=(_0x5e55a5==='outbound'?moment(_0x4aa69d[_0x3839('0x71')])[_0x3839('0x2b')](_0x3839('0x63')):moment(_0x4aa69d['agentcalledAt'])['format'](_0x3839('0x63')))||moment()[_0x3839('0x2b')](_0x3839('0x63'));_0xcba47d[_0x3839('0x72')]=_0x5e55a5||'Inbound';_0xcba47d=_[_0x3839('0x73')](_0xcba47d,getCustomFields(_0x375826['Fields'],_0x4aa69d));return request({'method':_0x3839('0x3d'),'uri':_0x3839('0x3e')+_0x36bd22+_0x3839('0x74'),'headers':{'Authorization':_0x3839('0x2d')+_0x54c23c},'body':{'data':[_0xcba47d]},'json':!![]})[_0x3839('0x27')](function(_0x1d68c1){if(_0x1d68c1&&_0x1d68c1[_0x3839('0x3b')][0x0][_0x3839('0x75')]===_0x3839('0x45')){logger['info']('Call\x20created!');return{'id':_0x1d68c1[_0x3839('0x3b')][0x0][_0x3839('0x46')]['id']};}})['catch'](function(_0x345050){logger[_0x3839('0x29')](_0x3839('0x76'),_0x345050[_0x3839('0x77')]);console[_0x3839('0x48')](_0x3839('0x76'),_0x345050);});}exports[_0x3839('0x78')]=function(_0x5cbc11,_0x4939bb,_0x417a0a,_0x10e2d2,_0x4f92ac,_0x273a77){var _0x6e4eed,_0x2b5bc4,_0x2e4132;_0x273a77[_0x3839('0x79')]=intUtil[_0x3839('0x7a')](_0x273a77['host']);_0x273a77[_0x3839('0x7b')]=intUtil[_0x3839('0x7a')](_0x273a77[_0x3839('0x7b')]);if(_0x4f92ac&&_0x4f92ac[_0x3839('0x7c')]){logger['info'](_0x3839('0x7d'),_0x3839('0x7e'));_0x4939bb['recordingURL']=_0x273a77[_0x3839('0x7b')]+_0x3839('0x7f')+_0x4939bb[_0x3839('0x80')]+_0x3839('0x81')+md5(_0x4939bb[_0x3839('0x80')]);}else{_0x4939bb[_0x3839('0x82')]='';}var _0x55797b=_0x273a77['host']==='zoho.eu'?'eu':_0x3839('0x83');return getAccessToken(_0x273a77)['then'](function(_0x2ff460){_0x2e4132=_0x2ff460;return getUser(_0x2e4132,_0x55797b,_0x273a77,_0x10e2d2[_0x3839('0x31')]);})[_0x3839('0x27')](function(_0x4f78a1){_0x6e4eed=_0x4f78a1;logger[_0x3839('0x29')]('The\x20User\x20ID\x20is:',_0x6e4eed['id']);return getEndUser(_0x2e4132,_0x55797b,_0x273a77,_0x4939bb[_0x3839('0x84')],_0x4939bb[_0x3839('0x85')],_0x6e4eed,_0x417a0a);})[_0x3839('0x27')](function(_0xaaedba){_0x2b5bc4=_0xaaedba;return getCall(_0x2e4132,_0x55797b,_0x273a77,_0x6e4eed,_0x2b5bc4,_0x417a0a,_0x4939bb,'Inbound');})[_0x3839('0x27')](function(_0x5c8c28){if(_0x5c8c28){logger['info']('The\x20Call\x20ID\x20is:',_0x5c8c28['id']);logger[_0x3839('0x29')](_0x3839('0x7d'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3839('0x2b')]('user:%s',_0x10e2d2[_0x3839('0x1a')]),_0x3839('0x86'),{'uri':_0x3839('0x87')+_0x273a77[_0x3839('0x79')]+'/crm/EntityInfo.do?module=Calls&id='+_0x5c8c28['id']});}})[_0x3839('0x3a')](function(_0x1691e4){logger['error'](_0x3839('0x7d'),JSON[_0x3839('0x38')](_0x1691e4));});};exports[_0x3839('0x88')]=function(_0x412b71,_0x2287ac,_0x15b964,_0x548055,_0x10c195,_0x302fff,_0x125cb6){var _0x5505ac,_0x36a3da,_0x29d0b0;_0x302fff['host']=intUtil[_0x3839('0x7a')](_0x302fff[_0x3839('0x79')]);_0x302fff[_0x3839('0x7b')]=intUtil[_0x3839('0x7a')](_0x302fff[_0x3839('0x7b')]);if(_0x125cb6&&_0x125cb6[_0x3839('0x89')]&&_0x125cb6[_0x3839('0x89')]!==_0x3839('0x8a')){logger[_0x3839('0x29')]('[OUTBOUND]',_0x3839('0x7e'));_0x2287ac[_0x3839('0x82')]=_0x302fff['serverUrl']+_0x3839('0x7f')+_0x2287ac[_0x3839('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x2287ac[_0x3839('0x80')]);}var _0xaed1d5=_0x302fff[_0x3839('0x79')]==='zoho.eu'?'eu':_0x3839('0x83');return getAccessToken(_0x302fff)[_0x3839('0x27')](function(_0x5b39d8){_0x29d0b0=_0x5b39d8;return getUser(_0x29d0b0,_0xaed1d5,_0x302fff,_0x548055['email']);})[_0x3839('0x27')](function(_0x557a63){_0x5505ac=_0x557a63;logger['info'](_0x3839('0x8b'),_0x5505ac['id']);return getEndUser(_0x29d0b0,_0xaed1d5,_0x302fff,_0x2287ac[_0x3839('0x8c')],_0x2287ac['destcalleridnum'],_0x5505ac,_0x15b964);})[_0x3839('0x27')](function(_0xe44cde){_0x36a3da=_0xe44cde;return getCall(_0x29d0b0,_0xaed1d5,_0x302fff,_0x5505ac,_0x36a3da,_0x15b964,_0x2287ac,_0x3839('0x8d'));})[_0x3839('0x27')](function(_0x14a0fc){if(_0x14a0fc){logger[_0x3839('0x29')]('The\x20Call\x20ID\x20is:',_0x14a0fc['id']);logger[_0x3839('0x29')](_0x3839('0x8e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3839('0x2b')](_0x3839('0x8f'),_0x548055[_0x3839('0x1a')]),_0x3839('0x86'),{'uri':_0x3839('0x87')+_0x302fff[_0x3839('0x79')]+_0x3839('0x90')+_0x14a0fc['id']});}})[_0x3839('0x3a')](function(_0x536752){logger[_0x3839('0x36')](_0x3839('0x8e'),JSON[_0x3839('0x38')](_0x536752));});};exports[_0x3839('0x91')]=function(_0x41b402,_0x4459e8,_0x253337,_0x2a58ac,_0x526c6e,_0x54b3e6){var _0x483781,_0x144129,_0x3f095a;_0x54b3e6[_0x3839('0x79')]=intUtil[_0x3839('0x7a')](_0x54b3e6[_0x3839('0x79')]);_0x54b3e6[_0x3839('0x7b')]=intUtil['stripTrailingSlash'](_0x54b3e6[_0x3839('0x7b')]);if(_0x526c6e&&_0x526c6e[_0x3839('0x7c')]){logger[_0x3839('0x29')]('['+_0x4459e8['lastevent'][_0x3839('0x92')]()+']',_0x3839('0x7e'));_0x4459e8[_0x3839('0x82')]=_0x54b3e6['serverUrl']+'/api/voice/recordings/'+_0x4459e8['uniqueid']+_0x3839('0x81')+md5(_0x4459e8[_0x3839('0x80')]);}else{_0x4459e8[_0x3839('0x82')]='';}var _0x2a4685=_0x54b3e6[_0x3839('0x79')]===_0x3839('0x93')?'eu':_0x3839('0x83');return getAccessToken(_0x54b3e6)[_0x3839('0x27')](function(_0x1c44c4){_0x3f095a=_0x1c44c4;return getUser(_0x3f095a,_0x2a4685,_0x54b3e6);})[_0x3839('0x27')](function(_0x20f86f){_0x483781=_0x20f86f;logger[_0x3839('0x29')](_0x3839('0x8b'),_0x483781['id']);return getEndUser(_0x3f095a,_0x2a4685,_0x54b3e6,_0x4459e8[_0x3839('0x84')],_0x4459e8['calleridnum'],_0x483781,_0x253337);})[_0x3839('0x27')](function(_0x2959d2){_0x144129=_0x2959d2;return getCall(_0x3f095a,_0x2a4685,_0x54b3e6,_0x483781,_0x144129,_0x253337,_0x4459e8,_0x3839('0x94'));})[_0x3839('0x27')](function(_0x138c97){if(_0x138c97){logger[_0x3839('0x29')](_0x3839('0x95'),_0x138c97['id']);}})[_0x3839('0x3a')](function(_0x210bc0){logger[_0x3839('0x36')]('['+_0x4459e8[_0x3839('0x65')][_0x3839('0x92')]()+']',JSON[_0x3839('0x38')](_0x210bc0));});}; \ No newline at end of file +var _0x2179=['Abandoned','timeout','Timeout','Call_Start_Time','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','host','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/downloads?type=uniqueid&token=','uniqueid','com','email','The\x20User\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','recordingFormat','[OUTBOUND]','/api/voice/recordings/','zoho.eu','destcalleridname','Outbound','The\x20Call\x20ID\x20is:','user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','calleridnum','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','emit','[HTTP]','forEach','includes','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','error','data','enduserType','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','log','GET','moduleSearch','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','uri','https://www.zohoapis.','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','First_Name','Last_Name','Full_Name','startCase','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','format','mm:ss','lastevent','called','Called','connect','Call_Result','Answered','rejected','Rejected','abandoned'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2179,0xc0));var _0x9217=function(_0x2deed4,_0x2793e8){_0x2deed4=_0x2deed4-0x0;var _0xfb91f4=_0x2179[_0x2deed4];return _0xfb91f4;};'use strict';var _=require(_0x9217('0x0'));var rp=require(_0x9217('0x1'));var md5=require(_0x9217('0x2'));var util=require(_0x9217('0x3'));var intUtil=require(_0x9217('0x4'));var moment=require(_0x9217('0x5'));var Redis=require(_0x9217('0x6'));var BPromise=require(_0x9217('0x7'));var config=require(_0x9217('0x8'));var logger=require(_0x9217('0x9'))(_0x9217('0xa'));config[_0x9217('0xb')]=_[_0x9217('0xc')](config[_0x9217('0xb')],{'host':_0x9217('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9217('0xb')]));function emit(_0x38127f,_0x23b2e7,_0x2da50f){io['to'](_0x38127f)[_0x9217('0xe')](_0x23b2e7,_0x2da50f);}function request(_0x5e7d99){logger['debug'](_0x9217('0xf'),JSON['stringify'](_0x5e7d99));return rp(_0x5e7d99);}function getCustomFields(_0x1baed8,_0x3304cb){var _0x43a75c={};if(_0x1baed8['length']>0x0){_[_0x9217('0x10')](_0x1baed8,function(_0x2c9f23){if(_[_0x9217('0x11')]([_0x9217('0x12'),_0x9217('0x13')],_0x2c9f23[_0x9217('0x14')])&&_0x2c9f23[_0x9217('0x15')]){_0x43a75c[_0x2c9f23[_0x9217('0x15')]]=_0x2c9f23['content'][_0x9217('0x16')]();}else if(_0x2c9f23['type']===_0x9217('0x17')&&_0x2c9f23[_0x9217('0x18')]&&_0x2c9f23[_0x9217('0x15')]&&_0x3304cb[_0x2c9f23[_0x9217('0x18')]]){_0x43a75c[_0x2c9f23[_0x9217('0x15')]]=_0x3304cb[_0x2c9f23[_0x9217('0x18')]][_0x9217('0x16')]();}else if(_0x2c9f23[_0x9217('0x14')]===_0x9217('0x19')&&_0x2c9f23[_0x9217('0x1a')]&&_0x2c9f23[_0x9217('0x1a')][_0x9217('0x1b')]&&_0x2c9f23[_0x9217('0x15')]&&_0x3304cb[_0x2c9f23[_0x9217('0x1a')][_0x9217('0x1b')][_0x9217('0x1c')]()]){_0x43a75c[_0x2c9f23[_0x9217('0x15')]]=_0x3304cb[_0x2c9f23[_0x9217('0x1a')][_0x9217('0x1b')][_0x9217('0x1c')]()][_0x9217('0x16')]();}});}return _0x43a75c;}function getName(_0xe81f49){if(_0xe81f49[_0x9217('0x1d')]('\x20')>0x0){var _0x1f5ca6=_0xe81f49[_0x9217('0x1e')](/ (.+)/);if(_0x1f5ca6[0x1]){return _0x1f5ca6;}}return[_0xe81f49,_0xe81f49];}var accountsTokens={};function getAccessToken(_0x3af8ab){return new Promise(function(_0x32c877,_0x3cc2fa){if(!_[_0x9217('0x1f')](accountsTokens[_0x3af8ab['id']])&&!_[_0x9217('0x1f')](accountsTokens[_0x3af8ab['id']]['access_token'])){if(moment()[_0x9217('0x20')](accountsTokens[_0x3af8ab['id']][_0x9217('0x21')])){_0x32c877(accountsTokens[_0x3af8ab['id']][_0x9217('0x22')]);}}var _0x37287f;switch(_0x3af8ab[_0x9217('0x23')]){case'US':_0x37287f=_0x9217('0x24');break;case'AU':_0x37287f='https://accounts.zoho.com.au';break;case'EU':_0x37287f=_0x9217('0x25');break;case'IN':_0x37287f=_0x9217('0x26');break;case'CN':_0x37287f=_0x9217('0x27');break;default:_0x37287f='https://accounts.zoho.eu';break;}var _0x160584={'method':_0x9217('0x28'),'uri':_0x37287f+_0x9217('0x29'),'qs':{'refresh_token':_0x3af8ab[_0x9217('0x2a')],'client_id':_0x3af8ab[_0x9217('0x2b')],'client_secret':_0x3af8ab[_0x9217('0x2c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x160584)[_0x9217('0x2d')](function(_0x1fb79c){accountsTokens[_0x3af8ab['id']]={'access_token':_0x1fb79c['access_token'],'expires_in':moment()['add'](_0x1fb79c['expires_in'],_0x9217('0x2e'))};_0x32c877(_0x1fb79c[_0x9217('0x22')]);})[_0x9217('0x2f')](function(_0x363d18){logger['error'](_0x9217('0x30'),_0x363d18[_0x9217('0x31')]);_0x3cc2fa(_0x363d18);});});}function getUser(_0x5c0563,_0x4ca793,_0xfa9b0f,_0xdbf544){logger[_0x9217('0x32')](_0x9217('0x33'));return request({'method':'GET','uri':util['format'](_0x9217('0x34'),_0x4ca793),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x9217('0x35')+_0x5c0563},'json':!![]})[_0x9217('0x2d')](function(_0xda4e6a){if(_0xda4e6a[_0x9217('0x36')]){var _0x125fbe=-0x1;if(_[_0x9217('0x37')](_0xda4e6a[_0x9217('0x36')])){if(!_['isNil'](_0xdbf544)){_0x125fbe=_[_0x9217('0x38')](_0xda4e6a[_0x9217('0x36')],function(_0x145646){return _0x145646['email']===_0xdbf544;});}if(_0x125fbe>=0x0){logger[_0x9217('0x32')](_0x9217('0x39'));}else{logger['info'](_0x9217('0x3a'));_0x125fbe=_['findIndex'](_0xda4e6a['users'],function(_0x110111){return _0x110111['profile']['name']===_0x9217('0x3b');});}return _0xda4e6a['users'][_0x125fbe];}else{if(_0xda4e6a[_0x9217('0x3c')][_0x9217('0x3d')][_0x9217('0x1b')]==='Administrator'){logger[_0x9217('0x32')](_0x9217('0x3a'));user=_0xda4e6a[_0x9217('0x3c')];return user;}else{logger['error'](_0x9217('0x3e'),JSON['stringify'](_0xda4e6a));throw new Error(_0x9217('0x3f')+JSON[_0x9217('0x40')](_0xda4e6a));}}}else{logger[_0x9217('0x41')]('The\x20failing\x20result\x20is',JSON['stringify'](_0xda4e6a));throw new Error(_0x9217('0x3f')+JSON[_0x9217('0x40')](_0xda4e6a));}})[_0x9217('0x2f')](function(_0x5a0645){console[_0x9217('0x41')](_0x5a0645);});}function getZohoUser(_0x4f3fd4,_0x5dd160){return new BPromise(function(_0x2756fe,_0x51e8cd){request(_0x4f3fd4)[_0x9217('0x2d')](function(_0x5ad8b4){var _0x179f90=null;if(_0x5ad8b4){_0x179f90=_0x5ad8b4[_0x9217('0x42')][0x0];_0x179f90[_0x9217('0x43')]=_0x5dd160;}_0x2756fe(_0x179f90);})['catch'](function(_0x34932f){_0x51e8cd(_0x34932f);});});}function createEndUser(_0x2cbde5,_0x223df1,_0x3fec47,_0x47b77d,_0x257b46,_0x2fe194){var _0x3fec47=getName(_0x3fec47);return request({'method':_0x9217('0x28'),'uri':'https://www.zohoapis.'+_0x223df1+_0x9217('0x44')+_['startCase'](_0x2fe194[_0x9217('0x45')])+'s','body':{'data':[{'Last_Name':_0x3fec47[0x1],'First_Name':_0x3fec47[0x0],'Phone':_0x47b77d,'Owner':{'name':!_['isNil'](_0x257b46[_0x9217('0x46')][_0x9217('0x1b')])?_0x257b46[_0x9217('0x46')]['name']:!_['isNil'](_0x257b46[_0x9217('0x47')])?_0x257b46[_0x9217('0x47')]+'\x20'+_0x257b46[_0x9217('0x48')]:_0x257b46[_0x9217('0x48')],'id':_0x257b46['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2cbde5},'json':!![]})['then'](function(_0x186004){if(_0x186004&&_0x186004[_0x9217('0x42')][0x0][_0x9217('0x49')]===_0x9217('0x4a')){var _0x133ac5=_0x186004[_0x9217('0x42')][0x0][_0x9217('0x4b')];_0x133ac5[_0x9217('0x43')]=_['startCase'](_0x2fe194[_0x9217('0x45')])+'s';return _0x133ac5;}logger['error'](_0x9217('0x3e'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0x9217('0x40')](data));})[_0x9217('0x2f')](function(_0x171a3b){console[_0x9217('0x4c')]('CREATE\x20ERROR',_0x171a3b);});}function getEndUser(_0x420da1,_0x1c4aaf,_0xa7d6f8,_0x54339f,_0x2b4514,_0x404393,_0x15b046){var _0x42612b={'method':_0x9217('0x4d'),'uri':'','headers':{'Authorization':_0x9217('0x35')+_0x420da1},'json':!![]};switch(_0x15b046[_0x9217('0x4e')]){case'contact_lead':_0x42612b['uri']='https://www.zohoapis.'+_0x1c4aaf+_0x9217('0x4f')+_0x2b4514+'))';return getZohoUser(_0x42612b,_0x9217('0x50'))[_0x9217('0x2d')](function(_0x3c39c6){if(_0x3c39c6)return _0x3c39c6;_0x42612b['uri']='https://www.zohoapis.'+_0x1c4aaf+_0x9217('0x51')+_0x2b4514+'))';return getZohoUser(_0x42612b,_0x9217('0x52'))[_0x9217('0x2d')](function(_0x15c4e6){if(_0x15c4e6)return _0x15c4e6;if(_0x15b046[_0x9217('0x45')]!=_0x9217('0x53')){return createEndUser(_0x420da1,_0x1c4aaf,_0x54339f,_0x2b4514,_0x404393,_0x15b046);}else{return{};}});});break;case'contact':_0x42612b[_0x9217('0x54')]=_0x9217('0x55')+_0x1c4aaf+_0x9217('0x4f')+_0x2b4514+'))';return getZohoUser(_0x42612b,_0x9217('0x50'))['then'](function(_0x53e29b){if(_0x53e29b)return _0x53e29b;if(_0x15b046['moduleCreate']!='nothing'){return createEndUser(_0x420da1,_0x1c4aaf,_0x54339f,_0x2b4514,_0x404393,_0x15b046);}else{return{};}});break;case'lead':_0x42612b[_0x9217('0x54')]=_0x9217('0x55')+_0x1c4aaf+_0x9217('0x51')+_0x2b4514+'))';return getZohoUser(_0x42612b,_0x9217('0x52'))[_0x9217('0x2d')](function(_0x17d6b3){if(_0x17d6b3)return _0x17d6b3;if(_0x15b046[_0x9217('0x45')]!=_0x9217('0x53')){return createEndUser(_0x420da1,_0x1c4aaf,_0x54339f,_0x2b4514,_0x404393,_0x15b046);}else{return{};}});break;}}function getCall(_0x3f8331,_0x4a1a37,_0xac1b51,_0x34eba2,_0x30ed77,_0x5d3569,_0x4c9a0c,_0x28722b){logger[_0x9217('0x32')](_0x9217('0x56'));var _0x4aa9d8={};_0x4aa9d8[_0x9217('0x57')]={'name':!_[_0x9217('0x1f')](_0x34eba2[_0x9217('0x46')][_0x9217('0x1b')])&&!_['isNil'](_0x34eba2['profile'][_0x9217('0x1b')])&&_0x34eba2[_0x9217('0x3d')][_0x9217('0x1b')]===_0x9217('0x58')?_0x34eba2['role']['name']:!_['isNil'](_0x34eba2[_0x9217('0x47')])?_0x34eba2['first_name']+'\x20'+_0x34eba2[_0x9217('0x48')]:_0x34eba2[_0x9217('0x48')],'id':_0x34eba2['id']};_0x4aa9d8[_0x9217('0x59')]=intUtil[_0x9217('0x5a')](_0x5d3569[_0x9217('0x5b')],_0x4c9a0c,'\x20');_0x4aa9d8[_0x9217('0x5c')]=intUtil[_0x9217('0x5a')](_0x5d3569[_0x9217('0x5d')],_0x4c9a0c,'\x0a');if(_0x30ed77[_0x9217('0x43')]===_0x9217('0x50')){_0x4aa9d8[_0x9217('0x5e')]={'name':!_[_0x9217('0x1f')](_0x30ed77['Full_Name'])?_0x30ed77['Full_Name']:!_[_0x9217('0x1f')](_0x30ed77[_0x9217('0x5f')])?_0x30ed77[_0x9217('0x5f')]+'\x20'+_0x30ed77[_0x9217('0x60')]:_0x30ed77[_0x9217('0x60')],'id':_0x30ed77['id']};}if(_0x30ed77[_0x9217('0x43')]==='Leads'){_0x4aa9d8['What_Id']={'name':!_[_0x9217('0x1f')](_0x30ed77['Full_Name'])?_0x30ed77[_0x9217('0x61')]:!_['isNil'](_0x30ed77[_0x9217('0x5f')])?_0x30ed77[_0x9217('0x5f')]+'\x20'+_0x30ed77[_0x9217('0x60')]:_0x30ed77[_0x9217('0x60')],'id':_0x30ed77['id']};_0x4aa9d8['$se_module']=_[_0x9217('0x62')](_0x30ed77[_0x9217('0x43')]);}if(_0x4c9a0c[_0x9217('0x63')]){_0x4aa9d8[_0x9217('0x64')]=moment[_0x9217('0x65')](parseInt(_0x4c9a0c[_0x9217('0x63')])*0x3e8)['format']('mm:ss');}else if(_0x4c9a0c[_0x9217('0x66')]&&_0x4c9a0c['endtime']){_0x4aa9d8[_0x9217('0x64')]=moment[_0x9217('0x65')](moment(_0x4c9a0c[_0x9217('0x67')],_0x9217('0x68'))[_0x9217('0x69')](moment(_0x4c9a0c[_0x9217('0x6a')],_0x9217('0x68'))))[_0x9217('0x6b')](_0x9217('0x6c'));}switch(_0x4c9a0c[_0x9217('0x6d')]){case _0x9217('0x6e'):_0x4aa9d8['Call_Result']=_0x9217('0x6f');break;case'complete':case _0x9217('0x70'):_0x4aa9d8[_0x9217('0x71')]=_0x9217('0x72');break;case _0x9217('0x73'):_0x4aa9d8['Call_Result']=_0x9217('0x74');break;case _0x9217('0x75'):_0x4aa9d8['Call_Result']=_0x9217('0x76');break;case _0x9217('0x77'):_0x4aa9d8[_0x9217('0x71')]=_0x9217('0x78');default:}_0x4aa9d8[_0x9217('0x79')]=(_0x28722b==='outbound'?moment(_0x4c9a0c[_0x9217('0x6a')])[_0x9217('0x6b')](_0x9217('0x68')):moment(_0x4c9a0c['agentcalledAt'])['format'](_0x9217('0x68')))||moment()[_0x9217('0x6b')](_0x9217('0x68'));_0x4aa9d8[_0x9217('0x7a')]=_0x28722b||_0x9217('0x7b');_0x4aa9d8=_[_0x9217('0x7c')](_0x4aa9d8,getCustomFields(_0x5d3569[_0x9217('0x7d')],_0x4c9a0c));return request({'method':'POST','uri':_0x9217('0x55')+_0x4a1a37+_0x9217('0x7e'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3f8331},'body':{'data':[_0x4aa9d8]},'json':!![]})[_0x9217('0x2d')](function(_0x417a32){if(_0x417a32&&_0x417a32[_0x9217('0x42')][0x0][_0x9217('0x49')]===_0x9217('0x4a')){logger['info'](_0x9217('0x7f'));return{'id':_0x417a32['data'][0x0][_0x9217('0x4b')]['id']};}})[_0x9217('0x2f')](function(_0x13843f){logger[_0x9217('0x32')](_0x9217('0x80'),_0x13843f[_0x9217('0x31')]);console[_0x9217('0x4c')](_0x9217('0x80'),_0x13843f);});}exports['queue']=function(_0xd9d95,_0x3f6e15,_0x57029b,_0x532a36,_0x3abe43,_0x3d40b2){var _0x424b7b,_0x3d5b4f,_0x405e04;_0x3d40b2[_0x9217('0x81')]=intUtil['stripTrailingSlash'](_0x3d40b2[_0x9217('0x81')]);_0x3d40b2[_0x9217('0x82')]=intUtil[_0x9217('0x83')](_0x3d40b2[_0x9217('0x82')]);if(_0x3abe43&&_0x3abe43['monitor_format']){logger['info'](_0x9217('0x84'),_0x9217('0x85'));_0x3f6e15[_0x9217('0x86')]=_0x3d40b2[_0x9217('0x82')]+'/api/voice/recordings/'+_0x3f6e15['uniqueid']+_0x9217('0x87')+md5(_0x3f6e15[_0x9217('0x88')]);}else{_0x3f6e15[_0x9217('0x86')]='';}var _0x1752ed=_0x3d40b2[_0x9217('0x81')]==='zoho.eu'?'eu':_0x9217('0x89');return getAccessToken(_0x3d40b2)[_0x9217('0x2d')](function(_0xccf656){_0x405e04=_0xccf656;return getUser(_0x405e04,_0x1752ed,_0x3d40b2,_0x532a36[_0x9217('0x8a')]);})[_0x9217('0x2d')](function(_0x253611){_0x424b7b=_0x253611;logger[_0x9217('0x32')](_0x9217('0x8b'),_0x424b7b['id']);return getEndUser(_0x405e04,_0x1752ed,_0x3d40b2,_0x3f6e15['calleridname'],_0x3f6e15['calleridnum'],_0x424b7b,_0x57029b);})[_0x9217('0x2d')](function(_0x3b8622){_0x3d5b4f=_0x3b8622;return getCall(_0x405e04,_0x1752ed,_0x3d40b2,_0x424b7b,_0x3d5b4f,_0x57029b,_0x3f6e15,'Inbound');})[_0x9217('0x2d')](function(_0x55c427){if(_0x55c427){logger['info']('The\x20Call\x20ID\x20is:',_0x55c427['id']);logger[_0x9217('0x32')](_0x9217('0x84'),_0x9217('0x8c'));emit(util['format']('user:%s',_0x532a36[_0x9217('0x1b')]),'trigger:browser:url',{'uri':_0x9217('0x8d')+_0x3d40b2[_0x9217('0x81')]+'/crm/EntityInfo.do?module=Calls&id='+_0x55c427['id']});}})['catch'](function(_0x5447ca){logger[_0x9217('0x41')](_0x9217('0x84'),JSON[_0x9217('0x40')](_0x5447ca));});};exports['outbound']=function(_0x4698a4,_0x1a7253,_0x49eccc,_0x1c2117,_0x2404ad,_0x3992f7,_0x29ee7b){var _0x10536f,_0x522ee1,_0x4cdb0b;_0x3992f7[_0x9217('0x81')]=intUtil[_0x9217('0x83')](_0x3992f7[_0x9217('0x81')]);_0x3992f7[_0x9217('0x82')]=intUtil[_0x9217('0x83')](_0x3992f7['serverUrl']);if(_0x29ee7b&&_0x29ee7b[_0x9217('0x8e')]&&_0x29ee7b[_0x9217('0x8e')]!=='none'){logger[_0x9217('0x32')](_0x9217('0x8f'),_0x9217('0x85'));_0x1a7253[_0x9217('0x86')]=_0x3992f7['serverUrl']+_0x9217('0x90')+_0x1a7253[_0x9217('0x88')]+'/downloads?type=uniqueid&token='+md5(_0x1a7253[_0x9217('0x88')]);}var _0xfb98f3=_0x3992f7[_0x9217('0x81')]===_0x9217('0x91')?'eu':_0x9217('0x89');return getAccessToken(_0x3992f7)['then'](function(_0x535fe2){_0x4cdb0b=_0x535fe2;return getUser(_0x4cdb0b,_0xfb98f3,_0x3992f7,_0x1c2117[_0x9217('0x8a')]);})[_0x9217('0x2d')](function(_0x558c15){_0x10536f=_0x558c15;logger[_0x9217('0x32')](_0x9217('0x8b'),_0x10536f['id']);return getEndUser(_0x4cdb0b,_0xfb98f3,_0x3992f7,_0x1a7253[_0x9217('0x92')],_0x1a7253['destcalleridnum'],_0x10536f,_0x49eccc);})[_0x9217('0x2d')](function(_0x502ab8){_0x522ee1=_0x502ab8;return getCall(_0x4cdb0b,_0xfb98f3,_0x3992f7,_0x10536f,_0x522ee1,_0x49eccc,_0x1a7253,_0x9217('0x93'));})[_0x9217('0x2d')](function(_0x5b7864){if(_0x5b7864){logger['info'](_0x9217('0x94'),_0x5b7864['id']);logger['info']('[OUTBOUND]',_0x9217('0x8c'));emit(util['format'](_0x9217('0x95'),_0x1c2117['name']),'trigger:browser:url',{'uri':'https://crm.'+_0x3992f7[_0x9217('0x81')]+_0x9217('0x96')+_0x5b7864['id']});}})['catch'](function(_0x31a5b0){logger[_0x9217('0x41')](_0x9217('0x8f'),JSON[_0x9217('0x40')](_0x31a5b0));});};exports[_0x9217('0x97')]=function(_0x50b062,_0x30b3cf,_0x1d9718,_0x421894,_0xecc6b,_0x56b691){var _0x7564be,_0x391385,_0x3a9925;_0x56b691['host']=intUtil[_0x9217('0x83')](_0x56b691[_0x9217('0x81')]);_0x56b691[_0x9217('0x82')]=intUtil['stripTrailingSlash'](_0x56b691[_0x9217('0x82')]);if(_0xecc6b&&_0xecc6b[_0x9217('0x98')]){logger['info']('['+_0x30b3cf['lastevent']['toUpperCase']()+']',_0x9217('0x85'));_0x30b3cf[_0x9217('0x86')]=_0x56b691[_0x9217('0x82')]+_0x9217('0x90')+_0x30b3cf[_0x9217('0x88')]+_0x9217('0x87')+md5(_0x30b3cf['uniqueid']);}else{_0x30b3cf['recordingURL']='';}var _0x28d9f0=_0x56b691[_0x9217('0x81')]===_0x9217('0x91')?'eu':'com';return getAccessToken(_0x56b691)['then'](function(_0x5a1fd1){_0x3a9925=_0x5a1fd1;return getUser(_0x3a9925,_0x28d9f0,_0x56b691);})[_0x9217('0x2d')](function(_0x5067cd){_0x7564be=_0x5067cd;logger['info'](_0x9217('0x8b'),_0x7564be['id']);return getEndUser(_0x3a9925,_0x28d9f0,_0x56b691,_0x30b3cf['calleridname'],_0x30b3cf[_0x9217('0x99')],_0x7564be,_0x1d9718);})[_0x9217('0x2d')](function(_0x128117){_0x391385=_0x128117;return getCall(_0x3a9925,_0x28d9f0,_0x56b691,_0x7564be,_0x391385,_0x1d9718,_0x30b3cf,_0x9217('0x7b'));})[_0x9217('0x2d')](function(_0x29c616){if(_0x29c616){logger[_0x9217('0x32')](_0x9217('0x94'),_0x29c616['id']);}})['catch'](function(_0x315aa1){logger[_0x9217('0x41')]('['+_0x30b3cf[_0x9217('0x6d')][_0x9217('0x9a')]()+']',JSON[_0x9217('0x40')](_0x315aa1));});}; \ 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 3fd8a02..1973db5 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 _0xd09a=['data2','Script','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','exec'];(function(_0x2ed96a,_0x1c3d27){var _0x58efae=function(_0x23ae4c){while(--_0x23ae4c){_0x2ed96a['push'](_0x2ed96a['shift']());}};_0x58efae(++_0x1c3d27);}(_0xd09a,0x128));var _0xad09=function(_0x143cad,_0x1fb6fb){_0x143cad=_0x143cad-0x0;var _0x170e8c=_0xd09a[_0x143cad];return _0x170e8c;};'use strict';var util=require(_0xad09('0x0'));var sh=require(_0xad09('0x1'));var Mustache=require(_0xad09('0x2'));var logger=require('../../../../config/logger')('trigger');exports[_0xad09('0x3')]=function(_0x4d9c53,_0x40b22c){var _0x109b05=_0x4d9c53[_0xad09('0x4')]?_0x4d9c53[_0xad09('0x4')]:_0xad09('0x5');var _0x3f3178=_0x4d9c53['data3']?Mustache[_0xad09('0x6')](_0x4d9c53[_0xad09('0x7')],_0x40b22c):_0x40b22c;sh[_0xad09('0x3')](_0x3f3178,function(_0x30e8c1,_0x5d0dea,_0x4e580c){if(_0x30e8c1!==0x0){logger[_0xad09('0x8')](util[_0xad09('0x9')](_0xad09('0xa'),_0x109b05,_0x3f3178,_0x30e8c1,_0x4e580c));}else{logger[_0xad09('0xb')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x109b05,_0x3f3178,_0x5d0dea));}});}; \ No newline at end of file +var _0x795e=['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','exec','data2','Script','data3'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0x795e,0xab));var _0xe795=function(_0x2542ec,_0x2c94c4){_0x2542ec=_0x2542ec-0x0;var _0x67f19=_0x795e[_0x2542ec];return _0x67f19;};'use strict';var util=require(_0xe795('0x0'));var sh=require(_0xe795('0x1'));var Mustache=require(_0xe795('0x2'));var logger=require(_0xe795('0x3'))(_0xe795('0x4'));exports[_0xe795('0x5')]=function(_0x277718,_0x43ed08){var _0x1780f7=_0x277718[_0xe795('0x6')]?_0x277718[_0xe795('0x6')]:_0xe795('0x7');var _0x4a5a45=_0x277718[_0xe795('0x8')]?Mustache[_0xe795('0x9')](_0x277718['data3'],_0x43ed08):_0x43ed08;sh[_0xe795('0x5')](_0x4a5a45,function(_0xaebb9a,_0x4c8253,_0x581c84){if(_0xaebb9a!==0x0){logger[_0xe795('0xa')](util[_0xe795('0xb')](_0xe795('0xc'),_0x1780f7,_0x4a5a45,_0xaebb9a,_0x581c84));}else{logger[_0xe795('0xd')](util[_0xe795('0xb')](_0xe795('0xe'),_0x1780f7,_0x4a5a45,_0x4c8253));}});}; \ 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 af5030d..67c7b3b 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 _0xd9d4=['request-promise','util','lodash','mustache','../../../../config/logger','exec','data1','toUpperCase','data2','data5','number','headers','data6','parse','render','error','stack','DELETE','POST','PUT','data7','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','message'];(function(_0x21275e,_0xe73261){var _0x1474b0=function(_0x3b8e16){while(--_0x3b8e16){_0x21275e['push'](_0x21275e['shift']());}};_0x1474b0(++_0xe73261);}(_0xd9d4,0x1ef));var _0x4d9d=function(_0x47a12a,_0x70f591){_0x47a12a=_0x47a12a-0x0;var _0x30cd40=_0xd9d4[_0x47a12a];return _0x30cd40;};'use strict';var rp=require(_0x4d9d('0x0'));var util=require(_0x4d9d('0x1'));var _=require(_0x4d9d('0x2'));var Mustache=require(_0x4d9d('0x3'));var logger=require(_0x4d9d('0x4'))('trigger');exports[_0x4d9d('0x5')]=function(_0xe32fb9,_0x36e83f){var _0x2c8314,_0x3fc724;var _0x10cd3a={'method':_0xe32fb9[_0x4d9d('0x6')][_0x4d9d('0x7')](),'uri':Mustache['render'](_0xe32fb9[_0x4d9d('0x8')],_0x36e83f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xe32fb9[_0x4d9d('0x9')])===_0x4d9d('0xa')&&parseInt(_0xe32fb9[_0x4d9d('0x9')])>=0x1&&parseInt(_0xe32fb9[_0x4d9d('0x9')])<=0xa?parseInt(_0xe32fb9[_0x4d9d('0x9')])*0x3e8:0x5*0x3e8};try{_0x10cd3a[_0x4d9d('0xb')]=_0xe32fb9[_0x4d9d('0xc')]?JSON[_0x4d9d('0xd')](Mustache[_0x4d9d('0xe')](_0xe32fb9[_0x4d9d('0xc')],_0x36e83f)):{};}catch(_0x2ad4f6){logger[_0x4d9d('0xf')](_0x2ad4f6[_0x4d9d('0x10')]);}switch(_0xe32fb9[_0x4d9d('0x6')][_0x4d9d('0x7')]()){case'GET':case _0x4d9d('0x11'):_0x2c8314=null;_0x10cd3a['qs']=_0x36e83f;break;case _0x4d9d('0x12'):case _0x4d9d('0x13'):if(_0xe32fb9[_0x4d9d('0x14')]){try{_0x2c8314=JSON['parse'](Mustache[_0x4d9d('0xe')](_0xe32fb9[_0x4d9d('0x14')],_0x36e83f));_0x10cd3a[_0x4d9d('0x15')]=_0x2c8314;}catch(_0x368767){logger[_0x4d9d('0xf')](_0x368767[_0x4d9d('0x10')]);logger[_0x4d9d('0xf')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2c8314=_0x36e83f;_0x10cd3a[_0x4d9d('0x15')]=_0x2c8314;}break;}logger[_0x4d9d('0x16')](util[_0x4d9d('0x17')](_0x4d9d('0x18'),_0xe32fb9[_0x4d9d('0x6')],_0xe32fb9[_0x4d9d('0x8')],JSON[_0x4d9d('0x19')](_0x10cd3a)));rp(_0x10cd3a)[_0x4d9d('0x1a')](function(_0x9752f5){_0x2c8314=!_[_0x4d9d('0x1b')](_0x2c8314)?',\x20request\x20body:\x20'+_0x2c8314:'';_0x3fc724=typeof _0x9752f5[_0x4d9d('0x15')]==='object'?JSON['stringify'](_0x9752f5[_0x4d9d('0x15')]):_0x9752f5['body'];logger[_0x4d9d('0x16')](util[_0x4d9d('0x17')](_0x4d9d('0x1c'),_0xe32fb9['data1'],_0xe32fb9[_0x4d9d('0x8')],_0x9752f5[_0x4d9d('0x1d')],_0x3fc724));})[_0x4d9d('0x1e')](function(_0x23181e){logger[_0x4d9d('0xf')](util[_0x4d9d('0x17')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0xe32fb9[_0x4d9d('0x6')],_0xe32fb9[_0x4d9d('0x8')],_0x23181e[_0x4d9d('0x1d')],_0x23181e[_0x4d9d('0x1f')],_0x23181e[_0x4d9d('0x20')]));});}; \ No newline at end of file +var _0xbf7f=['info','format','stringify','then','isNil',',\x20request\x20body:\x20','%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','util','mustache','trigger','exec','toUpperCase','render','data2','number','data5','headers','data6','error','stack','data1','GET','POST','PUT','data7','parse','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body'];(function(_0xd7c1a6,_0x2b2f8f){var _0x3004f=function(_0xe7bed3){while(--_0xe7bed3){_0xd7c1a6['push'](_0xd7c1a6['shift']());}};_0x3004f(++_0x2b2f8f);}(_0xbf7f,0xab));var _0xfbf7=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xbf7f[_0x42245d];return _0x4b211a;};'use strict';var rp=require('request-promise');var util=require(_0xfbf7('0x0'));var _=require('lodash');var Mustache=require(_0xfbf7('0x1'));var logger=require('../../../../config/logger')(_0xfbf7('0x2'));exports[_0xfbf7('0x3')]=function(_0x81cfcc,_0x5e519f){var _0x2b230a,_0x216a4e;var _0x54ad1d={'method':_0x81cfcc['data1'][_0xfbf7('0x4')](),'uri':Mustache[_0xfbf7('0x5')](_0x81cfcc[_0xfbf7('0x6')],_0x5e519f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x81cfcc['data5'])===_0xfbf7('0x7')&&parseInt(_0x81cfcc[_0xfbf7('0x8')])>=0x1&&parseInt(_0x81cfcc['data5'])<=0xa?parseInt(_0x81cfcc[_0xfbf7('0x8')])*0x3e8:0x5*0x3e8};try{_0x54ad1d[_0xfbf7('0x9')]=_0x81cfcc[_0xfbf7('0xa')]?JSON['parse'](Mustache[_0xfbf7('0x5')](_0x81cfcc[_0xfbf7('0xa')],_0x5e519f)):{};}catch(_0x44d849){logger[_0xfbf7('0xb')](_0x44d849[_0xfbf7('0xc')]);}switch(_0x81cfcc[_0xfbf7('0xd')][_0xfbf7('0x4')]()){case _0xfbf7('0xe'):case'DELETE':_0x2b230a=null;_0x54ad1d['qs']=_0x5e519f;break;case _0xfbf7('0xf'):case _0xfbf7('0x10'):if(_0x81cfcc[_0xfbf7('0x11')]){try{_0x2b230a=JSON[_0xfbf7('0x12')](Mustache[_0xfbf7('0x5')](_0x81cfcc[_0xfbf7('0x11')],_0x5e519f));_0x54ad1d['body']=_0x2b230a;}catch(_0x34fe34){logger[_0xfbf7('0xb')](_0x34fe34[_0xfbf7('0xc')]);logger[_0xfbf7('0xb')](_0xfbf7('0x13'));}}else{_0x2b230a=_0x5e519f;_0x54ad1d[_0xfbf7('0x14')]=_0x2b230a;}break;}logger[_0xfbf7('0x15')](util[_0xfbf7('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x81cfcc['data1'],_0x81cfcc[_0xfbf7('0x6')],JSON[_0xfbf7('0x17')](_0x54ad1d)));rp(_0x54ad1d)[_0xfbf7('0x18')](function(_0x3b9004){_0x2b230a=!_[_0xfbf7('0x19')](_0x2b230a)?_0xfbf7('0x1a')+_0x2b230a:'';_0x216a4e=typeof _0x3b9004[_0xfbf7('0x14')]==='object'?JSON[_0xfbf7('0x17')](_0x3b9004[_0xfbf7('0x14')]):_0x3b9004['body'];logger['info'](util[_0xfbf7('0x16')](_0xfbf7('0x1b'),_0x81cfcc['data1'],_0x81cfcc['data2'],_0x3b9004['statusCode'],_0x216a4e));})['catch'](function(_0x472308){logger[_0xfbf7('0xb')](util[_0xfbf7('0x16')](_0xfbf7('0x1c'),_0x81cfcc[_0xfbf7('0xd')],_0x81cfcc[_0xfbf7('0x6')],_0x472308[_0xfbf7('0x1d')],_0x472308[_0xfbf7('0x1e')],_0x472308[_0xfbf7('0x1f')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 644cf07..4f0d6af 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 _0x6b79=['message','exports','../../config/logger','routing','http','request','debug','rpc','error'];(function(_0x1bcd55,_0x136bca){var _0x4b8f02=function(_0x3259dc){while(--_0x3259dc){_0x1bcd55['push'](_0x1bcd55['shift']());}};_0x4b8f02(++_0x136bca);}(_0x6b79,0x1a0));var _0x96b7=function(_0x29db16,_0xd811ad){_0x29db16=_0x29db16-0x0;var _0x4b508e=_0x6b79[_0x29db16];return _0x4b508e;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x96b7('0x0'))(_0x96b7('0x1'));var client=jayson['client'][_0x96b7('0x2')]({'port':0x2329});client['Request']=function(_0x4ffc2d,_0x52e447){return new BPromise(function(_0x1f04d7,_0x48c618){return client[_0x96b7('0x3')](_0x4ffc2d,_0x52e447)['then'](function(_0x2bb845){logger[_0x96b7('0x4')](_0x96b7('0x5'),_0x96b7('0x1'),_0x4ffc2d,_0x52e447,_0x2bb845);if(_0x2bb845['error']){logger[_0x96b7('0x6')](_0x96b7('0x5'),_0x96b7('0x1'),_0x4ffc2d,_0x2bb845['error'][_0x96b7('0x7')],_0x52e447);return _0x48c618(_0x2bb845['error'][_0x96b7('0x7')]);}else{return _0x1f04d7(_0x2bb845['result']);}})['catch'](function(_0x55b5f4){logger['error'](_0x96b7('0x5'),_0x96b7('0x1'),_0x4ffc2d,_0x55b5f4,_0x52e447);return _0x48c618(_0x55b5f4);});});};module[_0x96b7('0x8')]=client; \ No newline at end of file +var _0x51ad=['then','error','rpc','message','result','exports','jayson/promise','../../config/logger','routing','http','Request','request'];(function(_0xc9588b,_0x1fd6ad){var _0x3a6432=function(_0x2c9c59){while(--_0x2c9c59){_0xc9588b['push'](_0xc9588b['shift']());}};_0x3a6432(++_0x1fd6ad);}(_0x51ad,0x1da));var _0xd51a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x51ad[_0x42cae2];return _0x5f256f;};'use strict';var jayson=require(_0xd51a('0x0'));var BPromise=require('bluebird');var logger=require(_0xd51a('0x1'))(_0xd51a('0x2'));var client=jayson['client'][_0xd51a('0x3')]({'port':0x2329});client[_0xd51a('0x4')]=function(_0x3f7267,_0x693407){return new BPromise(function(_0x1091f5,_0x3af62d){return client[_0xd51a('0x5')](_0x3f7267,_0x693407)[_0xd51a('0x6')](function(_0x461d0b){logger['debug']('rpc',_0xd51a('0x2'),_0x3f7267,_0x693407,_0x461d0b);if(_0x461d0b[_0xd51a('0x7')]){logger[_0xd51a('0x7')](_0xd51a('0x8'),_0xd51a('0x2'),_0x3f7267,_0x461d0b['error'][_0xd51a('0x9')],_0x693407);return _0x3af62d(_0x461d0b[_0xd51a('0x7')]['message']);}else{return _0x1091f5(_0x461d0b[_0xd51a('0xa')]);}})['catch'](function(_0x131cd4){logger['error'](_0xd51a('0x8'),'routing',_0x3f7267,_0x131cd4,_0x693407);return _0x3af62d(_0x131cd4);});});};module[_0xd51a('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 794b81a..4317f17 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 _0x8e57=['then','getMailAccounts','initMailAccounts','error','Email\x20service\x20initialization','./server','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve'];(function(_0x3c7570,_0x4001da){var _0x4e5aab=function(_0x3636e1){while(--_0x3636e1){_0x3c7570['push'](_0x3c7570['shift']());}};_0x4e5aab(++_0x4001da);}(_0x8e57,0xdd));var _0x78e5=function(_0x212188,_0x45caed){_0x212188=_0x212188-0x0;var _0x433b1d=_0x8e57[_0x212188];return _0x433b1d;};'use strict';var server=require(_0x78e5('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x78e5('0x1'));var mailAccount=require(_0x78e5('0x2'));var setting=require(_0x78e5('0x3'));var logger=require(_0x78e5('0x4'))(_0x78e5('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x78e5('0x6')]()[_0x78e5('0x7')](mailAccount[_0x78e5('0x8')]())['then'](realtime[_0x78e5('0x9')]())[_0x78e5('0x7')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0x78e5('0x7')](function(){return initRealtime();})[_0x78e5('0x7')](function(){return setting['getSettings']();})[_0x78e5('0x7')](function(_0x548f1b){return setInterval(initRealtime,_0x548f1b['loginMailFrequency']*0x3e8);})['catch'](function(_0x592965){logger[_0x78e5('0xa')](_0x78e5('0xb'),_0x592965);});}main(); \ No newline at end of file +var _0x5830=['initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','email','resolve','then','getMailAccounts'];(function(_0x166e71,_0x3a1cd4){var _0x2ebc75=function(_0x4889d9){while(--_0x4889d9){_0x166e71['push'](_0x166e71['shift']());}};_0x2ebc75(++_0x3a1cd4);}(_0x5830,0x15c));var _0x0583=function(_0x5452a2,_0x37f7b4){_0x5452a2=_0x5452a2-0x0;var _0x1ef3c3=_0x5830[_0x5452a2];return _0x1ef3c3;};'use strict';var server=require(_0x0583('0x0'));var Realtime=require(_0x0583('0x1'));var EmailChannel=require(_0x0583('0x2'));var mailAccount=require(_0x0583('0x3'));var setting=require(_0x0583('0x4'));var logger=require('../../config/logger')(_0x0583('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x0583('0x6')]()[_0x0583('0x7')](mailAccount[_0x0583('0x8')]())['then'](realtime[_0x0583('0x9')]())['then'](function(){email['refresh'](realtime[_0x0583('0xa')]);return realtime;});}function main(){return server[_0x0583('0xb')](realtime,email)[_0x0583('0x7')](function(){return initRealtime();})[_0x0583('0x7')](function(){return setting[_0x0583('0xc')]();})[_0x0583('0x7')](function(_0x247f61){return setInterval(initRealtime,_0x247f61[_0x0583('0xd')]*0x3e8);})[_0x0583('0xe')](function(_0x3e6df7){logger[_0x0583('0xf')](_0x0583('0x10'),_0x3e6df7);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index e24d4c8..838e0ed 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 _0xce62=['custom','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','messageStatus','connected','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','notify','then','info','Mail\x20accepted\x20from\x20routing','catch','stringify','lastSync','sendMail','send','verifySmtp','Smtp','verified','exports','moment','bluebird','md5','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','total','isNil','mailAccount:update','hasOwnProperty','service','provider'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xce62,0x1e3));var _0x2ce6=function(_0x55412f,_0x46d43c){_0x55412f=_0x55412f-0x0;var _0x522371=_0xce62[_0x55412f];return _0x522371;};'use strict';var _=require('lodash');var moment=require(_0x2ce6('0x0'));var BPromise=require(_0x2ce6('0x1'));var md5=require(_0x2ce6('0x2'));var Redis=require('ioredis');var config=require(_0x2ce6('0x3'));var logger=require(_0x2ce6('0x4'))(_0x2ce6('0x5'));config[_0x2ce6('0x6')]=_[_0x2ce6('0x7')](config['redis'],{'host':_0x2ce6('0x8'),'port':0x18eb});var io=require(_0x2ce6('0x9'))(new Redis(config[_0x2ce6('0x6')]));var EmailImap=require(_0x2ce6('0xa'));var EmailSmtp=require(_0x2ce6('0xb'));var mailAccount=require(_0x2ce6('0xc'));var md5Accounts={};function EmailChannel(_0x33bfff){logger['info'](_0x2ce6('0xd'));this[_0x2ce6('0xe')]=_0x33bfff['mailAccounts'];this[_0x2ce6('0xf')]={};this[_0x2ce6('0x10')]=new EmailSmtp();}EmailChannel[_0x2ce6('0x11')][_0x2ce6('0x12')]=function(_0x364aac){var _0x4df24e=this[_0x2ce6('0xe')][_0x364aac];var _0x2888ef={'id':_0x4df24e['id'],'name':_0x4df24e[_0x2ce6('0x13')],'key':_0x4df24e[_0x2ce6('0x14')],'active':_0x4df24e[_0x2ce6('0x15')],'Imap':{'status':_0x4df24e[_0x2ce6('0x16')][_0x2ce6('0x17')],'messageStatus':_0x4df24e[_0x2ce6('0x16')]['messageStatus'],'total':_0x4df24e[_0x2ce6('0x16')][_0x2ce6('0x18')]}};if(_[_0x2ce6('0x19')](md5Accounts[_0x364aac])){md5Accounts[_0x364aac]={};}var _0x1272ab=md5(JSON['stringify'](_0x2888ef));if(md5Accounts[_0x364aac][_0x2ce6('0x2')]!==_0x1272ab){md5Accounts[_0x364aac][_0x2ce6('0x2')]=_0x1272ab;io['emit'](_0x2ce6('0x1a'),_0x2888ef);}};EmailChannel['prototype']['refresh']=function(_0x59ee99){for(var _0x45b6b2 in _0x59ee99){if(_0x59ee99[_0x2ce6('0x1b')](_0x45b6b2)){if(_0x59ee99[_0x45b6b2]['Imap']&&_0x59ee99[_0x45b6b2][_0x2ce6('0x15')]){var _0x1c3165=_0x59ee99[_0x45b6b2][_0x2ce6('0x16')];if(!_0x1c3165[_0x2ce6('0x1c')]&&_0x59ee99[_0x45b6b2][_0x2ce6('0x1d')]!==_0x2ce6('0x1e'))_0x1c3165[_0x2ce6('0x1c')]=_0x59ee99[_0x45b6b2][_0x2ce6('0x1d')];if(!this['imapAccounts'][_0x2ce6('0x1b')](_0x1c3165['id'])){this[_0x2ce6('0xf')][_0x1c3165['id']]=new EmailImap(_0x1c3165,_0x59ee99[_0x45b6b2][_0x2ce6('0x5')]);this['imapAccounts'][_0x1c3165['id']]['on'](_0x2ce6('0x1f'),this[_0x2ce6('0x20')][_0x2ce6('0x21')](this,_0x45b6b2));this[_0x2ce6('0xf')][_0x1c3165['id']]['on']('email',this[_0x2ce6('0x22')]['bind'](this,_0x45b6b2));this['imapAccounts'][_0x1c3165['id']]['on'](_0x2ce6('0x23'),this[_0x2ce6('0x24')][_0x2ce6('0x21')](this,_0x45b6b2));this[_0x2ce6('0xf')][_0x1c3165['id']]['on'](_0x2ce6('0x25'),this[_0x2ce6('0x26')][_0x2ce6('0x21')](this,_0x45b6b2));}}else{if(_[_0x2ce6('0x19')](this[_0x2ce6('0xe')][_0x45b6b2][_0x2ce6('0x16')])){this[_0x2ce6('0xe')][_0x45b6b2][_0x2ce6('0x16')]={};}this[_0x2ce6('0xe')][_0x45b6b2]['Imap'][_0x2ce6('0x17')]=_0x2ce6('0x27');this['mailAccounts'][_0x45b6b2][_0x2ce6('0x16')][_0x2ce6('0x28')]='';this['emit'](_0x45b6b2);}}}};EmailChannel[_0x2ce6('0x11')][_0x2ce6('0x20')]=function(_0x22df7d,_0x209f9d){if(this[_0x2ce6('0xe')][_0x22df7d]){this['mailAccounts'][_0x22df7d]['Imap'][_0x2ce6('0x17')]=_0x2ce6('0x29');this[_0x2ce6('0xe')][_0x22df7d][_0x2ce6('0x16')][_0x2ce6('0x28')]=_0x209f9d[_0x2ce6('0x13')];if(_0x209f9d['messages']){this[_0x2ce6('0xe')][_0x22df7d][_0x2ce6('0x16')][_0x2ce6('0x18')]=_0x209f9d['messages'][_0x2ce6('0x18')];}return this['emit'](_0x22df7d);}};EmailChannel[_0x2ce6('0x11')][_0x2ce6('0x22')]=function(_0x17eb36,_0x18307b){logger['info'](_0x2ce6('0x2a'),_0x18307b['firstName'],_0x18307b['lastName'],_0x18307b[_0x2ce6('0x2b')],_0x17eb36);if(this[_0x2ce6('0xe')][_0x17eb36]){return mailAccount[_0x2ce6('0x2c')](_0x17eb36,_0x18307b)[_0x2ce6('0x2d')](function(_0x1f0e3d){if(_0x1f0e3d){logger[_0x2ce6('0x2e')](_0x2ce6('0x2f'));}})[_0x2ce6('0x30')](function(_0x4f1e75){logger[_0x2ce6('0x25')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x2ce6('0x31')](_0x4f1e75));});}};EmailChannel[_0x2ce6('0x11')][_0x2ce6('0x24')]=function(_0x1a0db3){if(this['mailAccounts'][_0x1a0db3]&&this[_0x2ce6('0xe')][_0x1a0db3][_0x2ce6('0x16')]){if(this[_0x2ce6('0xf')][this[_0x2ce6('0xe')][_0x1a0db3][_0x2ce6('0x16')]['id']]){delete this[_0x2ce6('0xf')][this[_0x2ce6('0xe')][_0x1a0db3][_0x2ce6('0x16')]['id']];}this[_0x2ce6('0xe')][_0x1a0db3][_0x2ce6('0x16')][_0x2ce6('0x32')]=moment();this[_0x2ce6('0x12')](_0x1a0db3);}};EmailChannel[_0x2ce6('0x11')][_0x2ce6('0x26')]=function(_0x1950ea,_0x36e9f3){if(this[_0x2ce6('0xe')][_0x1950ea]){this[_0x2ce6('0xe')][_0x1950ea][_0x2ce6('0x16')]['status']=_0x2ce6('0x25');this[_0x2ce6('0xe')][_0x1950ea][_0x2ce6('0x16')]['messageStatus']=_0x36e9f3;return this[_0x2ce6('0x12')](_0x1950ea);}};EmailChannel[_0x2ce6('0x11')][_0x2ce6('0x33')]=function(_0x3b0525,_0x5acb37){return this[_0x2ce6('0x10')][_0x2ce6('0x34')](_0x3b0525,_0x5acb37);};EmailChannel[_0x2ce6('0x11')][_0x2ce6('0x35')]=function(_0x584c5c){var _0x270e37=this;if(this[_0x2ce6('0xe')][_0x584c5c['id']]){if(_[_0x2ce6('0x19')](this[_0x2ce6('0xe')][_0x584c5c['id']][_0x2ce6('0x36')])){this[_0x2ce6('0xe')][_0x584c5c['id']]['Smtp']={};}this['mailAccounts'][_0x584c5c['id']][_0x2ce6('0x36')][_0x2ce6('0x32')]=moment();return new BPromise(function(_0x55bb86,_0x6bfce7){return _0x270e37[_0x2ce6('0x10')]['verify'](_0x584c5c)[_0x2ce6('0x2d')](function(_0x9b6a8b){_0x270e37[_0x2ce6('0xe')][_0x584c5c['id']][_0x2ce6('0x36')][_0x2ce6('0x17')]=_0x2ce6('0x37');_0x270e37[_0x2ce6('0xe')][_0x584c5c['id']][_0x2ce6('0x36')][_0x2ce6('0x28')]='';_0x270e37[_0x2ce6('0x12')](_0x584c5c['id']);_0x55bb86(_0x9b6a8b);})['catch'](function(_0x42afe0){_0x270e37[_0x2ce6('0xe')][_0x584c5c['id']]['Smtp'][_0x2ce6('0x17')]=_0x2ce6('0x25');_0x270e37['mailAccounts'][_0x584c5c['id']][_0x2ce6('0x36')][_0x2ce6('0x28')]=_0x42afe0;_0x270e37[_0x2ce6('0x12')](_0x584c5c['id']);_0x6bfce7(_0x42afe0);});});}return this[_0x2ce6('0x10')]['verify'](_0x584c5c);};module[_0x2ce6('0x38')]=EmailChannel; \ No newline at end of file +var _0x4685=['smtp','prototype','emit','name','key','active','Imap','status','messageStatus','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','bind','handleImapEmail','end','handleImapEnd','error','disabled','messages','total','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','handleImapError','sendMail','send','verifySmtp','Smtp','lastSync','verify','verified','exports','lodash','moment','md5','ioredis','email','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','mailAccounts','imapAccounts'];(function(_0x529955,_0x4fd509){var _0x503d27=function(_0x6ca3d){while(--_0x6ca3d){_0x529955['push'](_0x529955['shift']());}};_0x503d27(++_0x4fd509);}(_0x4685,0x101));var _0x5468=function(_0x147d4c,_0xc24f70){_0x147d4c=_0x147d4c-0x0;var _0x1811fc=_0x4685[_0x147d4c];return _0x1811fc;};'use strict';var _=require(_0x5468('0x0'));var moment=require(_0x5468('0x1'));var BPromise=require('bluebird');var md5=require(_0x5468('0x2'));var Redis=require(_0x5468('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x5468('0x4'));config[_0x5468('0x5')]=_[_0x5468('0x6')](config[_0x5468('0x5')],{'host':_0x5468('0x7'),'port':0x18eb});var io=require(_0x5468('0x8'))(new Redis(config[_0x5468('0x5')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x5468('0x9'));var mailAccount=require(_0x5468('0xa'));var md5Accounts={};function EmailChannel(_0x39d6cd){logger['info']('start\x20email\x20channel');this[_0x5468('0xb')]=_0x39d6cd[_0x5468('0xb')];this[_0x5468('0xc')]={};this[_0x5468('0xd')]=new EmailSmtp();}EmailChannel[_0x5468('0xe')][_0x5468('0xf')]=function(_0x19074e){var _0x18508f=this[_0x5468('0xb')][_0x19074e];var _0x335655={'id':_0x18508f['id'],'name':_0x18508f[_0x5468('0x10')],'key':_0x18508f[_0x5468('0x11')],'active':_0x18508f[_0x5468('0x12')],'Imap':{'status':_0x18508f[_0x5468('0x13')][_0x5468('0x14')],'messageStatus':_0x18508f[_0x5468('0x13')][_0x5468('0x15')],'total':_0x18508f[_0x5468('0x13')]['total']}};if(_[_0x5468('0x16')](md5Accounts[_0x19074e])){md5Accounts[_0x19074e]={};}var _0x3f9a64=md5(JSON[_0x5468('0x17')](_0x335655));if(md5Accounts[_0x19074e][_0x5468('0x2')]!==_0x3f9a64){md5Accounts[_0x19074e][_0x5468('0x2')]=_0x3f9a64;io[_0x5468('0xf')](_0x5468('0x18'),_0x335655);}};EmailChannel['prototype'][_0x5468('0x19')]=function(_0x182e6d){for(var _0x4400de in _0x182e6d){if(_0x182e6d[_0x5468('0x1a')](_0x4400de)){if(_0x182e6d[_0x4400de][_0x5468('0x13')]&&_0x182e6d[_0x4400de]['active']){var _0x1b46d0=_0x182e6d[_0x4400de][_0x5468('0x13')];if(!_0x1b46d0[_0x5468('0x1b')]&&_0x182e6d[_0x4400de][_0x5468('0x1c')]!==_0x5468('0x1d'))_0x1b46d0[_0x5468('0x1b')]=_0x182e6d[_0x4400de]['provider'];if(!this[_0x5468('0xc')]['hasOwnProperty'](_0x1b46d0['id'])){this[_0x5468('0xc')][_0x1b46d0['id']]=new EmailImap(_0x1b46d0,_0x182e6d[_0x4400de][_0x5468('0x4')]);this[_0x5468('0xc')][_0x1b46d0['id']]['on']('box',this['handleImapBox'][_0x5468('0x1e')](this,_0x4400de));this['imapAccounts'][_0x1b46d0['id']]['on'](_0x5468('0x4'),this[_0x5468('0x1f')][_0x5468('0x1e')](this,_0x4400de));this['imapAccounts'][_0x1b46d0['id']]['on'](_0x5468('0x20'),this[_0x5468('0x21')][_0x5468('0x1e')](this,_0x4400de));this[_0x5468('0xc')][_0x1b46d0['id']]['on'](_0x5468('0x22'),this['handleImapError'][_0x5468('0x1e')](this,_0x4400de));}}else{if(_['isNil'](this[_0x5468('0xb')][_0x4400de]['Imap'])){this[_0x5468('0xb')][_0x4400de][_0x5468('0x13')]={};}this['mailAccounts'][_0x4400de][_0x5468('0x13')][_0x5468('0x14')]=_0x5468('0x23');this[_0x5468('0xb')][_0x4400de]['Imap'][_0x5468('0x15')]='';this['emit'](_0x4400de);}}}};EmailChannel[_0x5468('0xe')]['handleImapBox']=function(_0x148432,_0x5e058a){if(this[_0x5468('0xb')][_0x148432]){this['mailAccounts'][_0x148432][_0x5468('0x13')][_0x5468('0x14')]='connected';this[_0x5468('0xb')][_0x148432]['Imap'][_0x5468('0x15')]=_0x5e058a[_0x5468('0x10')];if(_0x5e058a[_0x5468('0x24')]){this[_0x5468('0xb')][_0x148432][_0x5468('0x13')][_0x5468('0x25')]=_0x5e058a['messages'][_0x5468('0x25')];}return this[_0x5468('0xf')](_0x148432);}};EmailChannel[_0x5468('0xe')][_0x5468('0x1f')]=function(_0x325fb9,_0x1bf283){logger[_0x5468('0x26')](_0x5468('0x27'),_0x1bf283['firstName'],_0x1bf283[_0x5468('0x28')],_0x1bf283[_0x5468('0x29')],_0x325fb9);if(this[_0x5468('0xb')][_0x325fb9]){return mailAccount['notify'](_0x325fb9,_0x1bf283)[_0x5468('0x2a')](function(_0x23f596){if(_0x23f596){logger[_0x5468('0x26')](_0x5468('0x2b'));}})[_0x5468('0x2c')](function(_0x2e66d6){logger[_0x5468('0x22')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x5468('0x17')](_0x2e66d6));});}};EmailChannel[_0x5468('0xe')][_0x5468('0x21')]=function(_0x1e6780){if(this['mailAccounts'][_0x1e6780]&&this['mailAccounts'][_0x1e6780][_0x5468('0x13')]){if(this[_0x5468('0xc')][this[_0x5468('0xb')][_0x1e6780]['Imap']['id']]){delete this['imapAccounts'][this[_0x5468('0xb')][_0x1e6780]['Imap']['id']];}this[_0x5468('0xb')][_0x1e6780][_0x5468('0x13')]['lastSync']=moment();this['emit'](_0x1e6780);}};EmailChannel[_0x5468('0xe')][_0x5468('0x2d')]=function(_0x57408e,_0x58b062){if(this[_0x5468('0xb')][_0x57408e]){this[_0x5468('0xb')][_0x57408e][_0x5468('0x13')]['status']='error';this['mailAccounts'][_0x57408e]['Imap'][_0x5468('0x15')]=_0x58b062;return this[_0x5468('0xf')](_0x57408e);}};EmailChannel[_0x5468('0xe')][_0x5468('0x2e')]=function(_0xf55b55,_0x2b1623){return this[_0x5468('0xd')][_0x5468('0x2f')](_0xf55b55,_0x2b1623);};EmailChannel['prototype'][_0x5468('0x30')]=function(_0x5d61d8){var _0x17a2cb=this;if(this[_0x5468('0xb')][_0x5d61d8['id']]){if(_[_0x5468('0x16')](this[_0x5468('0xb')][_0x5d61d8['id']][_0x5468('0x31')])){this[_0x5468('0xb')][_0x5d61d8['id']][_0x5468('0x31')]={};}this[_0x5468('0xb')][_0x5d61d8['id']][_0x5468('0x31')][_0x5468('0x32')]=moment();return new BPromise(function(_0x1515c4,_0x23f025){return _0x17a2cb[_0x5468('0xd')][_0x5468('0x33')](_0x5d61d8)[_0x5468('0x2a')](function(_0x249223){_0x17a2cb[_0x5468('0xb')][_0x5d61d8['id']][_0x5468('0x31')][_0x5468('0x14')]=_0x5468('0x34');_0x17a2cb[_0x5468('0xb')][_0x5d61d8['id']]['Smtp'][_0x5468('0x15')]='';_0x17a2cb[_0x5468('0xf')](_0x5d61d8['id']);_0x1515c4(_0x249223);})['catch'](function(_0x122fda){_0x17a2cb[_0x5468('0xb')][_0x5d61d8['id']][_0x5468('0x31')][_0x5468('0x14')]=_0x5468('0x22');_0x17a2cb[_0x5468('0xb')][_0x5d61d8['id']]['Smtp']['messageStatus']=_0x122fda;_0x17a2cb[_0x5468('0xf')](_0x5d61d8['id']);_0x23f025(_0x122fda);});});}return this[_0x5468('0xd')][_0x5468('0x33')](_0x5d61d8);};module[_0x5468('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index e88a573..0d349af 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 _0xccdf=['upperFirst','lodash','util','mailparser','Iconv','events','./utils','../../../config/logger','email','mailbox','account','imap','once','ready','end','error','handleError','bind','connect','inherits','prototype','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','handleReady','handleOpenBox','emit','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','handleEnd','stringify','hasOwnProperty'];(function(_0x5aa871,_0x5b2e71){var _0x415516=function(_0x19217e){while(--_0x19217e){_0x5aa871['push'](_0x5aa871['shift']());}};_0x415516(++_0x5b2e71);}(_0xccdf,0xbe));var _0xfccd=function(_0x320fb5,_0x19a9f7){_0x320fb5=_0x320fb5-0x0;var _0x2591e5=_0xccdf[_0x320fb5];return _0x2591e5;};'use strict';var _=require(_0xfccd('0x0'));var util=require(_0xfccd('0x1'));var Imap=require('imap');var simpleParser=require(_0xfccd('0x2'))['simpleParser'];var Iconv=require('iconv')[_0xfccd('0x3')];var EventEmitter=require(_0xfccd('0x4'))['EventEmitter'];var utils=require(_0xfccd('0x5'));var logger=require(_0xfccd('0x6'))(_0xfccd('0x7'));function EmailImap(_0x9485cf,_0x523c54){this[_0xfccd('0x8')]=_0x9485cf['mailbox'];this[_0xfccd('0x9')]=this['getAccount'](_0x9485cf,_0x523c54);this[_0xfccd('0xa')]=new Imap(this[_0xfccd('0x9')]);this[_0xfccd('0xa')][_0xfccd('0xb')](_0xfccd('0xc'),this['handleReady']['bind'](this));this[_0xfccd('0xa')][_0xfccd('0xb')](_0xfccd('0xd'),this['handleEnd']['bind'](this));this[_0xfccd('0xa')]['on'](_0xfccd('0xe'),this[_0xfccd('0xf')][_0xfccd('0x10')](this));this[_0xfccd('0xa')][_0xfccd('0x11')]();}util[_0xfccd('0x12')](EmailImap,EventEmitter);EmailImap[_0xfccd('0x13')][_0xfccd('0x14')]=function(_0x1497b4,_0x2bd703){var _0x261a8d={'connTimeout':_0x1497b4[_0xfccd('0x15')]?_0x1497b4['connTimeout']*0x3e8:0x2710,'authTimeout':_0x1497b4[_0xfccd('0x16')]?_0x1497b4[_0xfccd('0x16')]*0x3e8:0x1388};if(_0x1497b4[_0xfccd('0x17')]){_0x261a8d[_0xfccd('0x18')]=_0x1497b4[_0xfccd('0x18')];if(_0x1497b4[_0xfccd('0x19')]){_0x261a8d[_0xfccd('0x1a')]=utils[_0xfccd('0x1b')](_0x1497b4[_0xfccd('0x1c')]['data5'],_0x1497b4[_0xfccd('0x18')]);}else{_0x261a8d['password']=_0x1497b4[_0xfccd('0x1d')];}}else{if(_0x1497b4[_0xfccd('0x1e')]){_0x261a8d[_0xfccd('0x18')]=_0x1497b4[_0xfccd('0x18')];_0x261a8d[_0xfccd('0x1d')]=_0x1497b4['password'];}}_0x261a8d[_0xfccd('0x7')]=_0x2bd703||_0x1497b4[_0xfccd('0x18')]||_0xfccd('0x1f');_0x261a8d[_0xfccd('0x20')]=_0x1497b4[_0xfccd('0x20')];_0x261a8d['port']=_0x1497b4[_0xfccd('0x21')]||0x3e1;if(_0x1497b4[_0xfccd('0x22')]){_0x261a8d[_0xfccd('0x22')]=!![];}else{_0x261a8d[_0xfccd('0x22')]=![];_0x261a8d[_0xfccd('0x23')]=_0xfccd('0x24');}return _0x261a8d;};EmailImap[_0xfccd('0x13')][_0xfccd('0x25')]=function(){this[_0xfccd('0xa')]['openBox'](this['mailbox'],![],this['handleOpenBox'][_0xfccd('0x10')](this));};EmailImap['prototype'][_0xfccd('0x26')]=function(_0x5d8bae,_0x2efcf1){if(_0x5d8bae){this['handleError'](_0x5d8bae,!![]);}else{this[_0xfccd('0x27')]('box',_0x2efcf1);this['readUnseen']();}};EmailImap[_0xfccd('0x13')][_0xfccd('0x28')]=function(_0x1aaa30){if(_0x1aaa30){this[_0xfccd('0xf')](_0x1aaa30,!![]);}else{this['imap'][_0xfccd('0xd')]();}};EmailImap[_0xfccd('0x13')][_0xfccd('0x29')]=function(){this[_0xfccd('0xa')][_0xfccd('0x2a')]([_0xfccd('0x2b')],this[_0xfccd('0x2c')]['bind'](this));};EmailImap[_0xfccd('0x13')][_0xfccd('0x2c')]=function(_0xfcb81d,_0x528b6a){if(_0xfcb81d){this[_0xfccd('0xf')](_0xfcb81d,!![]);}else{if(_0x528b6a[_0xfccd('0x2d')]){try{var _0x50c192=this['imap'][_0xfccd('0x2e')](_0x528b6a,{'bodies':'','markSeen':!![]});_0x50c192['on'](_0xfccd('0x2f'),this[_0xfccd('0x30')][_0xfccd('0x10')](this));_0x50c192[_0xfccd('0xb')](_0xfccd('0xe'),this[_0xfccd('0x31')]['bind'](this));_0x50c192['once'](_0xfccd('0xd'),this[_0xfccd('0x32')][_0xfccd('0x10')](this));}catch(_0x10b4b0){logger[_0xfccd('0xe')](_0x10b4b0);}}else{this['imap'][_0xfccd('0x33')](!![],this[_0xfccd('0x28')][_0xfccd('0x10')](this));}}};EmailImap[_0xfccd('0x13')][_0xfccd('0x30')]=function(_0x30d21b){_0x30d21b['on'](_0xfccd('0x34'),this[_0xfccd('0x35')][_0xfccd('0x10')](this));_0x30d21b['once'](_0xfccd('0x36'),this['handleMessageAttributes'][_0xfccd('0x10')](this));_0x30d21b[_0xfccd('0xb')](_0xfccd('0xd'),this[_0xfccd('0x37')][_0xfccd('0x10')](this));};EmailImap[_0xfccd('0x13')][_0xfccd('0x35')]=function(_0xd240b5){simpleParser(_0xd240b5,{'Iconv':Iconv},this[_0xfccd('0x38')][_0xfccd('0x10')](this));};EmailImap[_0xfccd('0x13')][_0xfccd('0x39')]=function(){};EmailImap[_0xfccd('0x13')][_0xfccd('0x37')]=function(){};EmailImap[_0xfccd('0x13')][_0xfccd('0x38')]=function(_0x14a8e0,_0x1fb017){if(_0x14a8e0){logger[_0xfccd('0xe')](_0x14a8e0);}else{var _0x6051b3=this;utils[_0xfccd('0x3a')](this[_0xfccd('0x9')],_0x1fb017,function(_0x30a662){_0x6051b3['emit'](_0xfccd('0x7'),_0x30a662);});}};EmailImap[_0xfccd('0x13')]['handleFetchEnd']=function(){this[_0xfccd('0xa')]['closeBox'](!![],this[_0xfccd('0x28')][_0xfccd('0x10')](this));};EmailImap['prototype']['handleFetchError']=function(_0x43ed26){this[_0xfccd('0xf')](_0x43ed26);this[_0xfccd('0xa')][_0xfccd('0x33')](!![],this['handleCloseBox'][_0xfccd('0x10')](this));};EmailImap[_0xfccd('0x13')][_0xfccd('0x3b')]=function(){this['emit'](_0xfccd('0xd'));};EmailImap[_0xfccd('0x13')]['handleError']=function(_0x4249b9,_0x3fc1df){logger[_0xfccd('0xe')](_0xfccd('0xf'),this[_0xfccd('0x9')][_0xfccd('0x7')],JSON[_0xfccd('0x3c')](_0x4249b9));var _0x5ddbca='';if(_0x4249b9){if(_0x4249b9['textCode']){_0x5ddbca=_0x4249b9['textCode'];}else{for(var _0xf9a5ba in _0x4249b9){if(_0x4249b9[_0xfccd('0x3d')](_0xf9a5ba)){_0x5ddbca+=_[_0xfccd('0x3e')](_0xf9a5ba)+':\x20'+_0x4249b9[_0xf9a5ba]+'\x0a';}}}}if(_0x3fc1df){this[_0xfccd('0xa')][_0xfccd('0xd')]();}else{this[_0xfccd('0x27')](_0xfccd('0xe'),_0x5ddbca);this[_0xfccd('0x27')](_0xfccd('0xd'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x5b4f=['events','EventEmitter','./utils','../../../config/logger','mailbox','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','connect','inherits','prototype','connTimeout','authTimeout','user','xoauth2','data5','password','authentication','email','host','port','tls','autotls','required','openBox','handleOpenBox','handleError','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','handleMessageBody','attributes','handleMessageAttributes','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','iconv','Iconv'];(function(_0xf18747,_0x407764){var _0xee883=function(_0x2356c2){while(--_0x2356c2){_0xf18747['push'](_0xf18747['shift']());}};_0xee883(++_0x407764);}(_0x5b4f,0x130));var _0xf5b4=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5b4f[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0xf5b4('0x0'));var util=require(_0xf5b4('0x1'));var Imap=require(_0xf5b4('0x2'));var simpleParser=require(_0xf5b4('0x3'))['simpleParser'];var Iconv=require(_0xf5b4('0x4'))[_0xf5b4('0x5')];var EventEmitter=require(_0xf5b4('0x6'))[_0xf5b4('0x7')];var utils=require(_0xf5b4('0x8'));var logger=require(_0xf5b4('0x9'))('email');function EmailImap(_0x3314c9,_0x309e3c){this[_0xf5b4('0xa')]=_0x3314c9['mailbox'];this[_0xf5b4('0xb')]=this[_0xf5b4('0xc')](_0x3314c9,_0x309e3c);this[_0xf5b4('0x2')]=new Imap(this[_0xf5b4('0xb')]);this[_0xf5b4('0x2')][_0xf5b4('0xd')](_0xf5b4('0xe'),this[_0xf5b4('0xf')][_0xf5b4('0x10')](this));this['imap'][_0xf5b4('0xd')](_0xf5b4('0x11'),this[_0xf5b4('0x12')]['bind'](this));this[_0xf5b4('0x2')]['on'](_0xf5b4('0x13'),this['handleError'][_0xf5b4('0x10')](this));this[_0xf5b4('0x2')][_0xf5b4('0x14')]();}util[_0xf5b4('0x15')](EmailImap,EventEmitter);EmailImap[_0xf5b4('0x16')][_0xf5b4('0xc')]=function(_0x4a6b0c,_0x4563b9){var _0x5c7fad={'connTimeout':_0x4a6b0c[_0xf5b4('0x17')]?_0x4a6b0c['connTimeout']*0x3e8:0x2710,'authTimeout':_0x4a6b0c['authTimeout']?_0x4a6b0c[_0xf5b4('0x18')]*0x3e8:0x1388};if(_0x4a6b0c['service']){_0x5c7fad[_0xf5b4('0x19')]=_0x4a6b0c[_0xf5b4('0x19')];if(_0x4a6b0c['modernAuthentication']){_0x5c7fad[_0xf5b4('0x1a')]=utils['generateXOAuth2Token'](_0x4a6b0c['CloudProvider'][_0xf5b4('0x1b')],_0x4a6b0c[_0xf5b4('0x19')]);}else{_0x5c7fad['password']=_0x4a6b0c[_0xf5b4('0x1c')];}}else{if(_0x4a6b0c[_0xf5b4('0x1d')]){_0x5c7fad[_0xf5b4('0x19')]=_0x4a6b0c[_0xf5b4('0x19')];_0x5c7fad[_0xf5b4('0x1c')]=_0x4a6b0c[_0xf5b4('0x1c')];}}_0x5c7fad[_0xf5b4('0x1e')]=_0x4563b9||_0x4a6b0c[_0xf5b4('0x19')]||'anonymous@xcally.com';_0x5c7fad[_0xf5b4('0x1f')]=_0x4a6b0c[_0xf5b4('0x1f')];_0x5c7fad[_0xf5b4('0x20')]=_0x4a6b0c['port']||0x3e1;if(_0x4a6b0c[_0xf5b4('0x21')]){_0x5c7fad['tls']=!![];}else{_0x5c7fad[_0xf5b4('0x21')]=![];_0x5c7fad[_0xf5b4('0x22')]=_0xf5b4('0x23');}return _0x5c7fad;};EmailImap[_0xf5b4('0x16')][_0xf5b4('0xf')]=function(){this['imap'][_0xf5b4('0x24')](this['mailbox'],![],this[_0xf5b4('0x25')][_0xf5b4('0x10')](this));};EmailImap[_0xf5b4('0x16')]['handleOpenBox']=function(_0x5f5290,_0x2878cf){if(_0x5f5290){this[_0xf5b4('0x26')](_0x5f5290,!![]);}else{this[_0xf5b4('0x27')](_0xf5b4('0x28'),_0x2878cf);this[_0xf5b4('0x29')]();}};EmailImap[_0xf5b4('0x16')]['handleCloseBox']=function(_0x2fdc7f){if(_0x2fdc7f){this[_0xf5b4('0x26')](_0x2fdc7f,!![]);}else{this[_0xf5b4('0x2')]['end']();}};EmailImap[_0xf5b4('0x16')]['readUnseen']=function(){this['imap'][_0xf5b4('0x2a')]([_0xf5b4('0x2b')],this[_0xf5b4('0x2c')][_0xf5b4('0x10')](this));};EmailImap[_0xf5b4('0x16')][_0xf5b4('0x2c')]=function(_0x30924d,_0x23e816){if(_0x30924d){this[_0xf5b4('0x26')](_0x30924d,!![]);}else{if(_0x23e816[_0xf5b4('0x2d')]){try{var _0xab97a1=this[_0xf5b4('0x2')][_0xf5b4('0x2e')](_0x23e816,{'bodies':'','markSeen':!![]});_0xab97a1['on'](_0xf5b4('0x2f'),this[_0xf5b4('0x30')]['bind'](this));_0xab97a1[_0xf5b4('0xd')](_0xf5b4('0x13'),this[_0xf5b4('0x31')][_0xf5b4('0x10')](this));_0xab97a1[_0xf5b4('0xd')](_0xf5b4('0x11'),this[_0xf5b4('0x32')][_0xf5b4('0x10')](this));}catch(_0x2381f9){logger[_0xf5b4('0x13')](_0x2381f9);}}else{this['imap'][_0xf5b4('0x33')](!![],this[_0xf5b4('0x34')][_0xf5b4('0x10')](this));}}};EmailImap['prototype'][_0xf5b4('0x30')]=function(_0x2ecbab){_0x2ecbab['on']('body',this[_0xf5b4('0x35')]['bind'](this));_0x2ecbab[_0xf5b4('0xd')](_0xf5b4('0x36'),this[_0xf5b4('0x37')]['bind'](this));_0x2ecbab[_0xf5b4('0xd')](_0xf5b4('0x11'),this['handleMessageEnd'][_0xf5b4('0x10')](this));};EmailImap[_0xf5b4('0x16')][_0xf5b4('0x35')]=function(_0x680607){simpleParser(_0x680607,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap['prototype'][_0xf5b4('0x37')]=function(){};EmailImap[_0xf5b4('0x16')]['handleMessageEnd']=function(){};EmailImap[_0xf5b4('0x16')]['handleSimpleParser']=function(_0x406249,_0x36c548){if(_0x406249){logger[_0xf5b4('0x13')](_0x406249);}else{var _0x3c121f=this;utils[_0xf5b4('0x38')](this[_0xf5b4('0xb')],_0x36c548,function(_0x3e73c4){_0x3c121f[_0xf5b4('0x27')](_0xf5b4('0x1e'),_0x3e73c4);});}};EmailImap[_0xf5b4('0x16')]['handleFetchEnd']=function(){this[_0xf5b4('0x2')][_0xf5b4('0x33')](!![],this[_0xf5b4('0x34')]['bind'](this));};EmailImap['prototype']['handleFetchError']=function(_0x8f8cdd){this['handleError'](_0x8f8cdd);this[_0xf5b4('0x2')]['closeBox'](!![],this[_0xf5b4('0x34')]['bind'](this));};EmailImap[_0xf5b4('0x16')]['handleEnd']=function(){this[_0xf5b4('0x27')](_0xf5b4('0x11'));};EmailImap[_0xf5b4('0x16')][_0xf5b4('0x26')]=function(_0x197376,_0x2ddb6f){logger[_0xf5b4('0x13')]('handleError',this[_0xf5b4('0xb')][_0xf5b4('0x1e')],JSON[_0xf5b4('0x39')](_0x197376));var _0x25bbf3='';if(_0x197376){if(_0x197376[_0xf5b4('0x3a')]){_0x25bbf3=_0x197376['textCode'];}else{for(var _0x21e66f in _0x197376){if(_0x197376[_0xf5b4('0x3b')](_0x21e66f)){_0x25bbf3+=_[_0xf5b4('0x3c')](_0x21e66f)+':\x20'+_0x197376[_0x21e66f]+'\x0a';}}}}if(_0x2ddb6f){this['imap']['end']();}else{this[_0xf5b4('0x27')](_0xf5b4('0x13'),_0x25bbf3);this['emit'](_0xf5b4('0x11'));}};module[_0xf5b4('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 67c7797..f5bd982 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 _0xf0d4=['verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString'];(function(_0x2ac539,_0x2c1d1e){var _0x1ca090=function(_0x52b5c8){while(--_0x52b5c8){_0x2ac539['push'](_0x2ac539['shift']());}};_0x1ca090(++_0x2c1d1e);}(_0xf0d4,0xd4));var _0x4f0d=function(_0x2a0739,_0x148e11){_0x2a0739=_0x2a0739-0x0;var _0x2c0f19=_0xf0d4[_0x2a0739];return _0x2c0f19;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x4f0d('0x0'));function EmailSmtp(){}EmailSmtp[_0x4f0d('0x1')][_0x4f0d('0x2')]=function(_0x4c45f4,_0x1c9da1){return new Promise(function(_0x420507,_0x51cc00){var _0x2cccbd=nodemailer[_0x4f0d('0x3')](_0x4c45f4);_0x2cccbd[_0x4f0d('0x4')](_0x4f0d('0x5'),inlineBase64());_0x2cccbd[_0x4f0d('0x6')](_0x1c9da1,function(_0x524981,_0x31eb81){if(_0x524981){_0x51cc00(_0x524981[_0x4f0d('0x7')]());}else{_0x420507(_0x31eb81);}});});};EmailSmtp[_0x4f0d('0x1')][_0x4f0d('0x8')]=function(_0x3d364a){return new Promise(function(_0x2ee3a3,_0x58fb0e){var _0x13b8ed=nodemailer[_0x4f0d('0x3')](_0x3d364a);_0x13b8ed['verify'](function(_0x3ec516,_0x5a0b0f){if(_0x3ec516){_0x58fb0e(_0x3ec516[_0x4f0d('0x7')]());}else{if(_0x5a0b0f){_0x2ee3a3(_0x5a0b0f);}else{_0x58fb0e(_0x4f0d('0x9'));}}});});};module[_0x4f0d('0xa')]=EmailSmtp; \ No newline at end of file +var _0xd13e=['compile','toString','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','use'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0xd13e,0xc1));var _0xed13=function(_0x574d3b,_0xdc1ac7){_0x574d3b=_0x574d3b-0x0;var _0x4903bc=_0xd13e[_0x574d3b];return _0x4903bc;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xed13('0x0'));function EmailSmtp(){}EmailSmtp[_0xed13('0x1')][_0xed13('0x2')]=function(_0x728891,_0x184098){return new Promise(function(_0x295a81,_0x13a9ea){var _0x2abc4e=nodemailer[_0xed13('0x3')](_0x728891);_0x2abc4e[_0xed13('0x4')](_0xed13('0x5'),inlineBase64());_0x2abc4e['sendMail'](_0x184098,function(_0x3074c6,_0x2769cd){if(_0x3074c6){_0x13a9ea(_0x3074c6[_0xed13('0x6')]());}else{_0x295a81(_0x2769cd);}});});};EmailSmtp[_0xed13('0x1')]['verify']=function(_0x1cc189){return new Promise(function(_0x300d07,_0x2876b5){var _0x5b623a=nodemailer[_0xed13('0x3')](_0x1cc189);_0x5b623a['verify'](function(_0xcfd323,_0xb7255b){if(_0xcfd323){_0x2876b5(_0xcfd323[_0xed13('0x6')]());}else{if(_0xb7255b){_0x300d07(_0xb7255b);}else{_0x2876b5(_0xed13('0x7'));}}});});};module[_0xed13('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 39a4549..9a4e626 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 _0xe1c1=['generate','name','indexOf','split','length','join','Anonymous','pop','isEmpty','test','html','replace','includes','attachments','push','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x67a7f1['slice'](0x0,-0x1)[_0x1e1c('0x10')]('\x20'):_0x32ec28[_0x1e1c('0xc')];}return _0x1e1c('0x11');}function getLastName(_0x2731c2){var _0x5ef931=_[_0x1e1c('0x7')](_0x2731c2[_0x1e1c('0x8')]);if(_0x5ef931&&_0x5ef931[_0x1e1c('0xc')]){var _0x2c54cd=_0x5ef931[_0x1e1c('0xc')][_0x1e1c('0xe')](/\s+/);return _0x2c54cd['length']>0x1?_0x2c54cd[_0x1e1c('0x12')]():'';}return'';}function getMails(_0x547c70,_0x1b627c){var _0x3c617a='';for(var _0x18fe36=0x0;_0x18fe36<_0x1b627c[_0x1e1c('0x8')][_0x1e1c('0xf')];_0x18fe36+=0x1){if(_0x1b627c['value'][_0x18fe36]['address']!==_0x547c70){if(!_[_0x1e1c('0x13')](_0x3c617a)){_0x3c617a+=',';}_0x3c617a+=_0x1b627c[_0x1e1c('0x8')][_0x18fe36][_0x1e1c('0xc')]||_0x1b627c[_0x1e1c('0x8')][_0x18fe36][_0x1e1c('0x9')]||'';_0x3c617a+='\x20<';_0x3c617a+=_0x1b627c[_0x1e1c('0x8')][_0x18fe36][_0x1e1c('0x9')]?_0x1b627c['value'][_0x18fe36][_0x1e1c('0x9')]:_0x1e1c('0xa')+random['generate'](0x6)+'@xcally.com';_0x3c617a+='>';}}return _0x3c617a;}function parseEmail(_0x6e9e1d,_0x441f8a,_0x1b8da4){if(_0x441f8a['html']){var _0x5f5590=/)<[^<]*)*<\/script>/gi;while(_0x5f5590[_0x1e1c('0x14')](_0x441f8a[_0x1e1c('0x15')])){_0x441f8a[_0x1e1c('0x15')]=_0x441f8a['html'][_0x1e1c('0x16')](_0x5f5590,'');}if(_0x441f8a['html'][_0x1e1c('0x17')]('{_0x4eb0f1[_0x1e1c('0x19')](_0x100321['filename']);});var _0x18876d=/]+>/g;var _0xfbf1f7=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x231795=_0x441f8a[_0x1e1c('0x15')]['replace'](_0xfbf1f7,_0x1e1c('0x1a'));var _0x1710e2=_0x231795[_0x1e1c('0x16')](_0x18876d,_0x1e1c('0x1b'));for(let _0x15e3ac=0x0;_0x15e3ac<_0x4eb0f1['length'];_0x15e3ac++){var _0x4b1193=_0x1710e2['replace']('_IMG',_0x1e1c('0x1c')+_0x4eb0f1[_0x15e3ac]+_0x1e1c('0x1d'));_0x1710e2=_0x4b1193;}_0x441f8a[_0x1e1c('0x15')]=_0x1710e2;}_0x1b8da4[_0x1e1c('0x1e')]=_0x441f8a['html'];}else{_0x1b8da4[_0x1e1c('0x1e')]=_0x441f8a[_0x1e1c('0x1f')];}if(_0x1b8da4[_0x1e1c('0x1e')]){_0x1b8da4[_0x1e1c('0x1e')]=_0x1b8da4[_0x1e1c('0x1e')][_0x1e1c('0x16')](/0x0){var _0x2b01dc=['Auto-Submitted:\x20auto-replied',_0x1e1c('0x2e'),_0x1e1c('0x2f')];for(var _0x192e37=0x0;_0x192e37<_0x441f8a[_0x1e1c('0x2d')]['length'];_0x192e37++){var _0x30b71f=_['indexOf'](_0x2b01dc,_0x441f8a[_0x1e1c('0x2d')][_0x192e37]['line']);if(_0x30b71f>=0x0){_0x1b8da4['isAutoreply']=!![];}}}return _0x1b8da4;}exports['parser']=function(_0x276a50,_0x454282,_0x3618c5){var _0x1a27dc={'from':getAddress(_0x454282[_0x1e1c('0x30')]),'firstName':getFirstName(_0x454282[_0x1e1c('0x30')]),'lastName':getLastName(_0x454282['from']),'mapKey':_0x1e1c('0x5'),'message':{'from':getMails(_0x276a50[_0x1e1c('0x5')],_0x454282[_0x1e1c('0x30')]),'to':_0x276a50[_0x1e1c('0x5')],'cc':'','subject':_0x454282[_0x1e1c('0x31')]||'','messageId':_0x454282['messageId'],'inReplyTo':_0x454282['inReplyTo'],'sentAt':moment(_0x454282[_0x1e1c('0x32')])[_0x1e1c('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x454282[_0x1e1c('0x15')]&&!_0x454282[_0x1e1c('0x1f')]){var _0x433ef0=_['filter'](_0x454282[_0x1e1c('0x18')],{'contentType':_0x1e1c('0x33')});if(_0x433ef0[_0x1e1c('0xf')]){logger[_0x1e1c('0x34')](util[_0x1e1c('0x28')](_0x1e1c('0x35'),_0x454282[_0x1e1c('0x36')]));tnef[_0x1e1c('0x37')](_[_0x1e1c('0x38')](_0x433ef0)['content'],function(_0x30db97,_0x3d9f63){if(_0x3d9f63){_0x454282[_0x1e1c('0x15')]=_0x3d9f63['BodyHTML']||'

Empty\x20message

';if(_0x3d9f63['Attachments']){for(var _0x4562a2=0x0;_0x4562a2<_0x3d9f63['Attachments'][_0x1e1c('0xf')];_0x4562a2++){var _0x430cf5=_0x3d9f63[_0x1e1c('0x39')][_0x4562a2];_0x1a27dc['message'][_0x1e1c('0x18')][_0x1e1c('0x19')]({'filename':_0x430cf5[_0x1e1c('0x3a')],'content':Buffer['from'](_0x430cf5[_0x1e1c('0x3b')])});}}}_0x3618c5(parseEmail(_0x276a50,_0x454282,_0x1a27dc));});}else{_0x454282[_0x1e1c('0x15')]='

Empty\x20message

';_0x3618c5(parseEmail(_0x276a50,_0x454282,_0x1a27dc));}}else{_0x3618c5(parseEmail(_0x276a50,_0x454282,_0x1a27dc));}};exports[_0x1e1c('0x3c')]=function(_0x39faa2,_0x452b6f){var _0x1b02bc=[_0x1e1c('0x3d')+(_0x452b6f||''),'auth=Bearer\x20'+_0x39faa2,'',''];return Buffer[_0x1e1c('0x30')](_0x1b02bc[_0x1e1c('0x10')](''),_0x1e1c('0x3e'))[_0x1e1c('0x3f')](_0x1e1c('0x40'));}; \ No newline at end of file +var _0xcd35=['Attachments','push','Title','Data','user=','auth=Bearer\x20','utf-8','toString','lodash','randomstring','path','util','node-tnef','../../../config/logger','head','value','anonymous','name','address','substring','indexOf','length','slice','join','split','generate','html','test','replace','includes','attachments','filename','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

'];(function(_0x2c1ab6,_0x2748ba){var _0x39be2d=function(_0x21130a){while(--_0x21130a){_0x2c1ab6['push'](_0x2c1ab6['shift']());}};_0x39be2d(++_0x2748ba);}(_0xcd35,0xda));var _0x5cd3=function(_0x2c47e6,_0x43c068){_0x2c47e6=_0x2c47e6-0x0;var _0x1012aa=_0xcd35[_0x2c47e6];return _0x1012aa;};'use strict';var _=require(_0x5cd3('0x0'));var moment=require('moment');var random=require(_0x5cd3('0x1'));var fs=require('fs');var path=require(_0x5cd3('0x2'));var util=require(_0x5cd3('0x3'));var tnef=require(_0x5cd3('0x4'));var logger=require(_0x5cd3('0x5'))('email');var config=require('../../../config/environment');function getAddress(_0x4f00c7){var _0x1142dd=_[_0x5cd3('0x6')](_0x4f00c7[_0x5cd3('0x7')]);return _0x1142dd&&_0x1142dd['address']?_0x1142dd['address']:_0x5cd3('0x8')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0x4c0f9a){var _0xc3ff89=_['head'](_0x4c0f9a['value']);if(_0xc3ff89&&_0xc3ff89[_0x5cd3('0x9')]){if(_0xc3ff89['name']==_0xc3ff89[_0x5cd3('0xa')]){return _0xc3ff89['name'][_0x5cd3('0xb')](0x0,_0xc3ff89[_0x5cd3('0x9')][_0x5cd3('0xc')]('@'));}var _0x14357a=_0xc3ff89[_0x5cd3('0x9')]['split'](/\s+/);return _0x14357a[_0x5cd3('0xd')]>0x1?_0x14357a[_0x5cd3('0xe')](0x0,-0x1)[_0x5cd3('0xf')]('\x20'):_0xc3ff89[_0x5cd3('0x9')];}return'Anonymous';}function getLastName(_0x32c79c){var _0xc13fb7=_[_0x5cd3('0x6')](_0x32c79c[_0x5cd3('0x7')]);if(_0xc13fb7&&_0xc13fb7[_0x5cd3('0x9')]){var _0x235e50=_0xc13fb7[_0x5cd3('0x9')][_0x5cd3('0x10')](/\s+/);return _0x235e50['length']>0x1?_0x235e50['pop']():'';}return'';}function getMails(_0x79c043,_0x8c477f){var _0x7a85c5='';for(var _0x1642fb=0x0;_0x1642fb<_0x8c477f[_0x5cd3('0x7')][_0x5cd3('0xd')];_0x1642fb+=0x1){if(_0x8c477f[_0x5cd3('0x7')][_0x1642fb]['address']!==_0x79c043){if(!_['isEmpty'](_0x7a85c5)){_0x7a85c5+=',';}_0x7a85c5+=_0x8c477f['value'][_0x1642fb]['name']||_0x8c477f[_0x5cd3('0x7')][_0x1642fb]['address']||'';_0x7a85c5+='\x20<';_0x7a85c5+=_0x8c477f[_0x5cd3('0x7')][_0x1642fb][_0x5cd3('0xa')]?_0x8c477f['value'][_0x1642fb][_0x5cd3('0xa')]:_0x5cd3('0x8')+random[_0x5cd3('0x11')](0x6)+'@xcally.com';_0x7a85c5+='>';}}return _0x7a85c5;}function parseEmail(_0x56da28,_0x45aeee,_0x21a8a8){if(_0x45aeee[_0x5cd3('0x12')]){var _0x3a5752=/)<[^<]*)*<\/script>/gi;while(_0x3a5752[_0x5cd3('0x13')](_0x45aeee['html'])){_0x45aeee['html']=_0x45aeee[_0x5cd3('0x12')][_0x5cd3('0x14')](_0x3a5752,'');}if(_0x45aeee[_0x5cd3('0x12')][_0x5cd3('0x15')]('{_0x57dc21['push'](_0x2fef02[_0x5cd3('0x17')]);});var _0x146db2=/]+>/g;var _0x5631f2=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x281616=_0x45aeee[_0x5cd3('0x12')][_0x5cd3('0x14')](_0x5631f2,'_SRC');var _0xa441e6=_0x281616[_0x5cd3('0x14')](_0x146db2,'_IMG');for(let _0x598052=0x0;_0x598052<_0x57dc21[_0x5cd3('0xd')];_0x598052++){var _0x36d08b=_0xa441e6[_0x5cd3('0x14')]('_IMG',_0x5cd3('0x18')+_0x57dc21[_0x598052]+_0x5cd3('0x19'));_0xa441e6=_0x36d08b;}_0x45aeee['html']=_0xa441e6;}_0x21a8a8[_0x5cd3('0x1a')]=_0x45aeee[_0x5cd3('0x12')];}else{_0x21a8a8[_0x5cd3('0x1a')]=_0x45aeee[_0x5cd3('0x1b')];}if(_0x21a8a8[_0x5cd3('0x1a')]){_0x21a8a8['body']=_0x21a8a8[_0x5cd3('0x1a')]['replace'](/0x0){var _0xef6800=[_0x5cd3('0x2e'),_0x5cd3('0x2f'),_0x5cd3('0x30')];for(var _0x20b5cc=0x0;_0x20b5cc<_0x45aeee[_0x5cd3('0x2d')][_0x5cd3('0xd')];_0x20b5cc++){var _0xdd749d=_[_0x5cd3('0xc')](_0xef6800,_0x45aeee[_0x5cd3('0x2d')][_0x20b5cc]['line']);if(_0xdd749d>=0x0){_0x21a8a8['isAutoreply']=!![];}}}return _0x21a8a8;}exports[_0x5cd3('0x31')]=function(_0x5ef46f,_0x3dd34e,_0x5c6d00){var _0x1fb11d={'from':getAddress(_0x3dd34e[_0x5cd3('0x32')]),'firstName':getFirstName(_0x3dd34e[_0x5cd3('0x32')]),'lastName':getLastName(_0x3dd34e[_0x5cd3('0x32')]),'mapKey':_0x5cd3('0x1e'),'message':{'from':getMails(_0x5ef46f[_0x5cd3('0x1e')],_0x3dd34e[_0x5cd3('0x32')]),'to':_0x5ef46f['email'],'cc':'','subject':_0x3dd34e['subject']||'','messageId':_0x3dd34e[_0x5cd3('0x33')],'inReplyTo':_0x3dd34e[_0x5cd3('0x34')],'sentAt':moment(_0x3dd34e[_0x5cd3('0x35')])['format'](_0x5cd3('0x36')),'attach':![],'attachments':[]}};if(!_0x3dd34e[_0x5cd3('0x12')]&&!_0x3dd34e['textAsHtml']){var _0x22f863=_[_0x5cd3('0x37')](_0x3dd34e[_0x5cd3('0x16')],{'contentType':_0x5cd3('0x38')});if(_0x22f863[_0x5cd3('0xd')]){logger['info'](util[_0x5cd3('0x26')](_0x5cd3('0x39'),_0x3dd34e['messageId']));tnef[_0x5cd3('0x3a')](_[_0x5cd3('0x3b')](_0x22f863)[_0x5cd3('0x2b')],function(_0x469545,_0xffdc14){if(_0xffdc14){_0x3dd34e[_0x5cd3('0x12')]=_0xffdc14[_0x5cd3('0x3c')]||_0x5cd3('0x3d');if(_0xffdc14['Attachments']){for(var _0x276b7c=0x0;_0x276b7c<_0xffdc14[_0x5cd3('0x3e')][_0x5cd3('0xd')];_0x276b7c++){var _0x5d18d0=_0xffdc14[_0x5cd3('0x3e')][_0x276b7c];_0x1fb11d[_0x5cd3('0x1d')][_0x5cd3('0x16')][_0x5cd3('0x3f')]({'filename':_0x5d18d0[_0x5cd3('0x40')],'content':Buffer[_0x5cd3('0x32')](_0x5d18d0[_0x5cd3('0x41')])});}}}_0x5c6d00(parseEmail(_0x5ef46f,_0x3dd34e,_0x1fb11d));});}else{_0x3dd34e[_0x5cd3('0x12')]=_0x5cd3('0x3d');_0x5c6d00(parseEmail(_0x5ef46f,_0x3dd34e,_0x1fb11d));}}else{_0x5c6d00(parseEmail(_0x5ef46f,_0x3dd34e,_0x1fb11d));}};exports['generateXOAuth2Token']=function(_0x554a97,_0x2404f4){var _0x5c6ab1=[_0x5cd3('0x42')+(_0x2404f4||''),_0x5cd3('0x43')+_0x554a97,'',''];return Buffer['from'](_0x5c6ab1[_0x5cd3('0xf')](''),_0x5cd3('0x44'))[_0x5cd3('0x45')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index e66b92b..062db87 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 _0x2ea4=['Imap','Smtp','name','Service','key','active'];(function(_0x1aa5c8,_0x3ad8d6){var _0x2f9377=function(_0x2403ac){while(--_0x2403ac){_0x1aa5c8['push'](_0x1aa5c8['shift']());}};_0x2f9377(++_0x3ad8d6);}(_0x2ea4,0xc8));var _0x42ea=function(_0x59b141,_0x3c2191){_0x59b141=_0x59b141-0x0;var _0x79450d=_0x2ea4[_0x59b141];return _0x79450d;};'use strict';var _=require('lodash');function MailAccount(_0x235eb5){this['id']=_0x235eb5['id']||0x0;this[_0x42ea('0x0')]=_0x235eb5[_0x42ea('0x0')]||_0x42ea('0x1');this[_0x42ea('0x2')]=_0x235eb5[_0x42ea('0x2')]||'SERV';this[_0x42ea('0x3')]=_0x235eb5[_0x42ea('0x3')]||![];this['Imap']=_0x235eb5[_0x42ea('0x4')]||[];this[_0x42ea('0x5')]=_0x235eb5[_0x42ea('0x5')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xa73d=['SERV','active','Imap','Smtp','exports','name','Service'];(function(_0x2cd3c6,_0xe882e7){var _0x55e7ad=function(_0x552f27){while(--_0x552f27){_0x2cd3c6['push'](_0x2cd3c6['shift']());}};_0x55e7ad(++_0xe882e7);}(_0xa73d,0x101));var _0xda73=function(_0x18cdce,_0x4c0bd1){_0x18cdce=_0x18cdce-0x0;var _0x157d39=_0xa73d[_0x18cdce];return _0x157d39;};'use strict';var _=require('lodash');function MailAccount(_0x270397){this['id']=_0x270397['id']||0x0;this[_0xda73('0x0')]=_0x270397[_0xda73('0x0')]||_0xda73('0x1');this['key']=_0x270397['key']||_0xda73('0x2');this[_0xda73('0x3')]=_0x270397[_0xda73('0x3')]||![];this[_0xda73('0x4')]=_0x270397[_0xda73('0x4')]||[];this['Smtp']=_0x270397[_0xda73('0x5')]||[];}module[_0xda73('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 037958d..33b81e4 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 _0xbcfd=['prototype','initMailAccounts','length','isUndefined','merge','exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x1b0fc4,_0x4fea19){var _0x549d30=function(_0x54114c){while(--_0x54114c){_0x1b0fc4['push'](_0x1b0fc4['shift']());}};_0x549d30(++_0x4fea19);}(_0xbcfd,0x146));var _0xdbcf=function(_0x39cbd2,_0x2ca475){_0x39cbd2=_0x39cbd2-0x0;var _0x2e81c2=_0xbcfd[_0x39cbd2];return _0x2e81c2;};'use strict';var _=require('lodash');var MailAccount=require(_0xdbcf('0x0'));var Realtime=function(){this[_0xdbcf('0x1')]={};};function freeIsNotKey(_0x3c619b,_0xbbdd99,_0xa86d3d){var _0x4ab9ed=_[_0xdbcf('0x2')](_0x3c619b,function(_0x46ea6f,_0x30f57e){return _0x46ea6f[_0xa86d3d];});for(var _0x2f8c7f in _0xbbdd99){if(_0xbbdd99[_0xdbcf('0x3')](_0x2f8c7f)){if(!_0x4ab9ed[_0x2f8c7f]){delete _0xbbdd99[_0x2f8c7f];}}}}Realtime[_0xdbcf('0x4')]['mergeFromDatabase']=function(_0x30e6ef,_0x146b66){for(var _0x5bd398 in _0x146b66){if(_0x30e6ef['hasOwnProperty'](_0x5bd398)){_0x30e6ef[_0x5bd398]=_0x146b66[_0x5bd398];}}};Realtime[_0xdbcf('0x4')][_0xdbcf('0x5')]=function(){var _0x4cff86=this;return function(_0x521bd0){if(_0x521bd0){freeIsNotKey(_0x521bd0,_0x4cff86[_0xdbcf('0x1')],'id');for(var _0x50481d=0x0,_0x4fd2b9={},_0x312af5={};_0x50481d<_0x521bd0[_0xdbcf('0x6')];_0x50481d+=0x1){_0x4fd2b9=_0x521bd0[_0x50481d];if(_[_0xdbcf('0x7')](_0x4cff86[_0xdbcf('0x1')][_0x4fd2b9['id']])){_0x4cff86['mailAccounts'][_0x4fd2b9['id']]=new MailAccount(_0x4fd2b9);}else{_[_0xdbcf('0x8')](_0x4cff86[_0xdbcf('0x1')][_0x4fd2b9['id']],_0x4fd2b9);}}}return _0x4cff86['mailAccounts'];};};module[_0xdbcf('0x9')]=Realtime; \ No newline at end of file +var _0xe1ad=['mailAccounts','length','isUndefined','exports','lodash','../model/mailAccount','mapKeys','prototype','hasOwnProperty','initMailAccounts'];(function(_0x20b86b,_0x228a66){var _0x51095e=function(_0x1662a1){while(--_0x1662a1){_0x20b86b['push'](_0x20b86b['shift']());}};_0x51095e(++_0x228a66);}(_0xe1ad,0xc2));var _0xde1a=function(_0x48887a,_0x199482){_0x48887a=_0x48887a-0x0;var _0x101b3c=_0xe1ad[_0x48887a];return _0x101b3c;};'use strict';var _=require(_0xde1a('0x0'));var MailAccount=require(_0xde1a('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x52a318,_0x2754fb,_0x48dadb){var _0x2ba12d=_[_0xde1a('0x2')](_0x52a318,function(_0x16b222,_0x571a70){return _0x16b222[_0x48dadb];});for(var _0x3050b6 in _0x2754fb){if(_0x2754fb['hasOwnProperty'](_0x3050b6)){if(!_0x2ba12d[_0x3050b6]){delete _0x2754fb[_0x3050b6];}}}}Realtime[_0xde1a('0x3')]['mergeFromDatabase']=function(_0x124569,_0x1be6b8){for(var _0x49a540 in _0x1be6b8){if(_0x124569[_0xde1a('0x4')](_0x49a540)){_0x124569[_0x49a540]=_0x1be6b8[_0x49a540];}}};Realtime[_0xde1a('0x3')][_0xde1a('0x5')]=function(){var _0x3b844f=this;return function(_0x5ff189){if(_0x5ff189){freeIsNotKey(_0x5ff189,_0x3b844f[_0xde1a('0x6')],'id');for(var _0x26e770=0x0,_0xda3059={},_0x2ea257={};_0x26e770<_0x5ff189[_0xde1a('0x7')];_0x26e770+=0x1){_0xda3059=_0x5ff189[_0x26e770];if(_[_0xde1a('0x8')](_0x3b844f[_0xde1a('0x6')][_0xda3059['id']])){_0x3b844f[_0xde1a('0x6')][_0xda3059['id']]=new MailAccount(_0xda3059);}else{_['merge'](_0x3b844f[_0xde1a('0x6')][_0xda3059['id']],_0xda3059);}}}return _0x3b844f[_0xde1a('0x6')];};};module[_0xde1a('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 25ee864..c92dd25 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 _0x7827=['provider','email','active','key','ListId','Imap','CloudProvider','name','service','type','Smtp','notify','NotifyMailAccount','../client','getMailAccounts','Request'];(function(_0x1a9a86,_0xe309e1){var _0x3108a8=function(_0x8e6176){while(--_0x8e6176){_0x1a9a86['push'](_0x1a9a86['shift']());}};_0x3108a8(++_0xe309e1);}(_0x7827,0x19d));var _0x7782=function(_0x351909,_0x1c723b){_0x351909=_0x351909-0x0;var _0xb70af9=_0x7827[_0x351909];return _0xb70af9;};'use strict';var client=require(_0x7782('0x0'));exports[_0x7782('0x1')]=function(){return function(){return client[_0x7782('0x2')]('GetMailAccount',{'options':{'attributes':['id','name',_0x7782('0x3'),'service',_0x7782('0x4'),_0x7782('0x5'),_0x7782('0x6'),_0x7782('0x7'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0x7782('0x8'),'include':[{'model':_0x7782('0x9'),'attributes':['id',_0x7782('0xa'),_0x7782('0xb'),_0x7782('0xc'),'data5'],'as':_0x7782('0x9')}]},{'model':'MailServerOut','as':_0x7782('0xd'),'include':[{'model':_0x7782('0x9'),'attributes':['id',_0x7782('0xa'),_0x7782('0xb'),_0x7782('0xc'),'data5'],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports[_0x7782('0xe')]=function(_0x1a8493,_0x3f288a){return client['Request'](_0x7782('0xf'),{'account':{'id':_0x1a8493},'body':_0x3f288a,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xe451=['key','TemplateId','MailServerIn','Imap','name','CloudProvider','MailServerOut','Smtp','type','getMailAccount','notify','NotifyMailAccount','Request','service','email','active'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe451,0xec));var _0x1e45=function(_0x1e7cd1,_0x3ece77){_0x1e7cd1=_0x1e7cd1-0x0;var _0x9f924e=_0xe451[_0x1e7cd1];return _0x9f924e;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0x1e45('0x0')]('GetMailAccount',{'options':{'attributes':['id','name','provider',_0x1e45('0x1'),_0x1e45('0x2'),_0x1e45('0x3'),_0x1e45('0x4'),'ListId',_0x1e45('0x5')],'raw':![],'include':[{'model':_0x1e45('0x6'),'as':_0x1e45('0x7'),'include':[{'model':'CloudProvider','attributes':['id',_0x1e45('0x8'),_0x1e45('0x1'),'type','data5'],'as':_0x1e45('0x9')}]},{'model':_0x1e45('0xa'),'as':_0x1e45('0xb'),'include':[{'model':'CloudProvider','attributes':['id',_0x1e45('0x8'),_0x1e45('0x1'),_0x1e45('0xc'),'data5'],'as':'CloudProvider'}]}]},'log':_0x1e45('0xd')});};};exports[_0x1e45('0xe')]=function(_0x1422ae,_0x2d5e0e){return client['Request'](_0x1e45('0xf'),{'account':{'id':_0x1422ae},'body':_0x2d5e0e,'log':_0x1e45('0xf')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 3110e16..e9a4678 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 _0x8e7d=['GetSettings','getSettings','Request','loginMailFrequency'];(function(_0x5641ea,_0x1d9615){var _0x4442f5=function(_0x490ca8){while(--_0x490ca8){_0x5641ea['push'](_0x5641ea['shift']());}};_0x4442f5(++_0x1d9615);}(_0x8e7d,0x141));var _0xd8e7=function(_0x2dc069,_0x9fe901){_0x2dc069=_0x2dc069-0x0;var _0x24a59d=_0x8e7d[_0x2dc069];return _0x24a59d;};'use strict';var client=require('../client');exports[_0xd8e7('0x0')]=function(){return client[_0xd8e7('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd8e7('0x2')]},'log':_0xd8e7('0x3')});}; \ No newline at end of file +var _0x00a3=['GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x00a3,0x1eb));var _0x300a=function(_0x1995e5,_0x5b4680){_0x1995e5=_0x1995e5-0x0;var _0x4d8a9f=_0x00a3[_0x1995e5];return _0x4d8a9f;};'use strict';var client=require(_0x300a('0x0'));exports[_0x300a('0x1')]=function(){return client[_0x300a('0x2')](_0x300a('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x300a('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 391f036..122728f 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 2f8a5e8..82cb051 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 _0xc9c0=['lodash','http','express','sticky-session','ioredis','createServer','listen','polling','redis','defaults','localhost','adapter','default','../../config/socketio','../../config/express','../../routes','once','listening','log','port','exports'];(function(_0x437a96,_0x3e3891){var _0x1ad9db=function(_0x5d7937){while(--_0x5d7937){_0x437a96['push'](_0x437a96['shift']());}};_0x1ad9db(++_0x3e3891);}(_0xc9c0,0x1ce));var _0x0c9c=function(_0x411b8a,_0x1330fe){_0x411b8a=_0x411b8a-0x0;var _0x2f6603=_0xc9c0[_0x411b8a];return _0x2f6603;};'use strict';var _=require(_0x0c9c('0x0'));var http=require(_0x0c9c('0x1'));var express=require(_0x0c9c('0x2'));var sticky=require(_0x0c9c('0x3'));var Redis=require(_0x0c9c('0x4'));var config=require('../../config/environment');var app=express();var server=http[_0x0c9c('0x5')](app);server['timeout']=0xdbba0;if(sticky[_0x0c9c('0x6')](server,config['port'])){var socketio=require('socket.io')(server,{'transports':['websocket',_0x0c9c('0x7')]});config[_0x0c9c('0x8')]=_[_0x0c9c('0x9')](config['redis'],{'host':_0x0c9c('0xa'),'port':0x18eb});socketio[_0x0c9c('0xb')](require('socket.io-redis')({'pubClient':new Redis(config[_0x0c9c('0x8')]),'subClient':new Redis(config[_0x0c9c('0x8')])}));require('../../config/triggers')[_0x0c9c('0xc')]();require(_0x0c9c('0xd'))['default'](socketio);require(_0x0c9c('0xe'))[_0x0c9c('0xc')](app);require(_0x0c9c('0xf'))[_0x0c9c('0xc')](app);}else{server[_0x0c9c('0x10')](_0x0c9c('0x11'),function(){console[_0x0c9c('0x12')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x0c9c('0x13')]);});}exports=module[_0x0c9c('0x14')]=app; \ No newline at end of file +var _0x8810=['sticky-session','../../config/environment','createServer','listen','port','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/socketio','default','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express'];(function(_0x1620bb,_0x1083e1){var _0x41944d=function(_0x4adbd8){while(--_0x4adbd8){_0x1620bb['push'](_0x1620bb['shift']());}};_0x41944d(++_0x1083e1);}(_0x8810,0x1cb));var _0x0881=function(_0x3a1502,_0x428182){_0x3a1502=_0x3a1502-0x0;var _0x48118e=_0x8810[_0x3a1502];return _0x48118e;};'use strict';var _=require(_0x0881('0x0'));var http=require(_0x0881('0x1'));var express=require(_0x0881('0x2'));var sticky=require(_0x0881('0x3'));var Redis=require('ioredis');var config=require(_0x0881('0x4'));var app=express();var server=http[_0x0881('0x5')](app);server['timeout']=0xdbba0;if(sticky[_0x0881('0x6')](server,config[_0x0881('0x7')])){var socketio=require('socket.io')(server,{'transports':[_0x0881('0x8'),_0x0881('0x9')]});config[_0x0881('0xa')]=_[_0x0881('0xb')](config[_0x0881('0xa')],{'host':_0x0881('0xc'),'port':0x18eb});socketio[_0x0881('0xd')](require(_0x0881('0xe'))({'pubClient':new Redis(config[_0x0881('0xa')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')['default']();require(_0x0881('0xf'))['default'](socketio);require('../../config/express')[_0x0881('0x10')](app);require(_0x0881('0x11'))[_0x0881('0x10')](app);}else{server[_0x0881('0x12')]('listening',function(){console[_0x0881('0x13')](_0x0881('0x14'),config[_0x0881('0x7')]);});}exports=module[_0x0881('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index fc2d90d..e0fd4ee 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 _0xc6d7=['client','http','Request','request','then','debug','rpc','error','catch','exports','../../config/logger','routing'];(function(_0x1c6152,_0x139b26){var _0x570e76=function(_0x2ab33c){while(--_0x2ab33c){_0x1c6152['push'](_0x1c6152['shift']());}};_0x570e76(++_0x139b26);}(_0xc6d7,0x15a));var _0x7c6d=function(_0x4997fa,_0x42b0df){_0x4997fa=_0x4997fa-0x0;var _0x469ec9=_0xc6d7[_0x4997fa];return _0x469ec9;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x7c6d('0x0'))(_0x7c6d('0x1'));var client=jayson[_0x7c6d('0x2')][_0x7c6d('0x3')]({'port':0x2329});client[_0x7c6d('0x4')]=function(_0x4b0749,_0x1e6a38){return new BPromise(function(_0x1d2de6,_0x269502){return client[_0x7c6d('0x5')](_0x4b0749,_0x1e6a38)[_0x7c6d('0x6')](function(_0x2f4e48){logger[_0x7c6d('0x7')](_0x7c6d('0x8'),'routing',_0x4b0749,_0x1e6a38,_0x2f4e48);if(_0x2f4e48[_0x7c6d('0x9')]){logger['error'](_0x7c6d('0x8'),'routing',_0x4b0749,_0x2f4e48[_0x7c6d('0x9')]['message'],_0x1e6a38);return _0x269502(_0x2f4e48['error']['message']);}else{return _0x1d2de6(_0x2f4e48['result']);}})[_0x7c6d('0xa')](function(_0x419139){logger['error'](_0x7c6d('0x8'),_0x7c6d('0x1'),_0x4b0749,_0x419139,_0x1e6a38);return _0x269502(_0x419139);});});};module[_0x7c6d('0xb')]=client; \ No newline at end of file +var _0x4f08=['exports','jayson/promise','bluebird','routing','Request','request','then','debug','error','rpc','message','result','catch'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0x4f08,0xaa));var _0x84f0=function(_0x593b19,_0x5b58fe){_0x593b19=_0x593b19-0x0;var _0x560e36=_0x4f08[_0x593b19];return _0x560e36;};'use strict';var jayson=require(_0x84f0('0x0'));var BPromise=require(_0x84f0('0x1'));var logger=require('../../config/logger')(_0x84f0('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0x84f0('0x3')]=function(_0xa0865,_0xb73a24){return new BPromise(function(_0x2495e8,_0x118ee2){return client[_0x84f0('0x4')](_0xa0865,_0xb73a24)[_0x84f0('0x5')](function(_0x94c8b){logger[_0x84f0('0x6')]('rpc',_0x84f0('0x2'),_0xa0865,_0xb73a24,_0x94c8b);if(_0x94c8b[_0x84f0('0x7')]){logger[_0x84f0('0x7')](_0x84f0('0x8'),_0x84f0('0x2'),_0xa0865,_0x94c8b[_0x84f0('0x7')][_0x84f0('0x9')],_0xb73a24);return _0x118ee2(_0x94c8b[_0x84f0('0x7')][_0x84f0('0x9')]);}else{return _0x2495e8(_0x94c8b[_0x84f0('0xa')]);}})[_0x84f0('0xb')](function(_0x44cc3d){logger['error'](_0x84f0('0x8'),_0x84f0('0x2'),_0xa0865,_0x44cc3d,_0xb73a24);return _0x118ee2(_0x44cc3d);});});};module[_0x84f0('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index a7334e7..4026e52 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 _0xa356=['./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/whatsappQueue','resolve','then','initAgents','getOpenchannelQueues','getChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log'];(function(_0x7c7a41,_0x11a170){var _0x5c09d3=function(_0x5dec92){while(--_0x5dec92){_0x7c7a41['push'](_0x7c7a41['shift']());}};_0x5c09d3(++_0x11a170);}(_0xa356,0x134));var _0x6a35=function(_0x15e81a,_0xe8a4f0){_0x15e81a=_0x15e81a-0x0;var _0x512990=_0xa356[_0x15e81a];return _0x512990;};'use strict';var BPromise=require('bluebird');var server=require(_0x6a35('0x0'));var Realtime=require(_0x6a35('0x1'));var user=require(_0x6a35('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x6a35('0x3'));var chatQueue=require(_0x6a35('0x4'));var smsQueue=require(_0x6a35('0x5'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x6a35('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x6a35('0x7')]()[_0x6a35('0x8')](user['getAgents']())[_0x6a35('0x8')](realtime[_0x6a35('0x9')]())[_0x6a35('0x8')](interval['getIntervals']())[_0x6a35('0x8')](realtime['initIntervals']())[_0x6a35('0x8')](openchannelQueue[_0x6a35('0xa')]())[_0x6a35('0x8')](realtime['initOpenchannelQueues']())[_0x6a35('0x8')](chatQueue[_0x6a35('0xb')]())['then'](realtime['initChatQueues']())[_0x6a35('0x8')](smsQueue['getSmsQueues']())[_0x6a35('0x8')](realtime[_0x6a35('0xc')]())[_0x6a35('0x8')](mailQueue[_0x6a35('0xd')]())[_0x6a35('0x8')](realtime[_0x6a35('0xe')]())[_0x6a35('0x8')](faxQueue[_0x6a35('0xf')]())[_0x6a35('0x8')](realtime[_0x6a35('0x10')]())['then'](whatsappQueue[_0x6a35('0x11')]())[_0x6a35('0x8')](realtime[_0x6a35('0x12')]())[_0x6a35('0x8')](function(){return realtime;});}function main(){return server[_0x6a35('0x13')](realtime)[_0x6a35('0x8')](function(_0x308805){return initRealtime();})['then'](function(_0x38367e){return setInterval(initRealtime,0x1388);})[_0x6a35('0x14')](function(_0x17c316){console[_0x6a35('0x15')](_0x17c316);});}main(); \ No newline at end of file +var _0xd096=['initFaxQueues','initWhatsappQueues','catch','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','initAgents','then','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues'];(function(_0x17a5f1,_0x4f2ef2){var _0x46bd7f=function(_0x4b1038){while(--_0x4b1038){_0x17a5f1['push'](_0x17a5f1['shift']());}};_0x46bd7f(++_0x4f2ef2);}(_0xd096,0x162));var _0x6d09=function(_0x491164,_0x4ccbc8){_0x491164=_0x491164-0x0;var _0xecb86b=_0xd096[_0x491164];return _0xecb86b;};'use strict';var BPromise=require(_0x6d09('0x0'));var server=require(_0x6d09('0x1'));var Realtime=require(_0x6d09('0x2'));var user=require(_0x6d09('0x3'));var interval=require(_0x6d09('0x4'));var openchannelQueue=require(_0x6d09('0x5'));var chatQueue=require(_0x6d09('0x6'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x6d09('0x7'));var whatsappQueue=require(_0x6d09('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x6d09('0x9')]()['then'](user[_0x6d09('0xa')]())['then'](realtime[_0x6d09('0xb')]())[_0x6d09('0xc')](interval[_0x6d09('0xd')]())[_0x6d09('0xc')](realtime[_0x6d09('0xe')]())[_0x6d09('0xc')](openchannelQueue[_0x6d09('0xf')]())['then'](realtime[_0x6d09('0x10')]())[_0x6d09('0xc')](chatQueue[_0x6d09('0x11')]())[_0x6d09('0xc')](realtime[_0x6d09('0x12')]())[_0x6d09('0xc')](smsQueue[_0x6d09('0x13')]())[_0x6d09('0xc')](realtime[_0x6d09('0x14')]())[_0x6d09('0xc')](mailQueue[_0x6d09('0x15')]())[_0x6d09('0xc')](realtime[_0x6d09('0x16')]())[_0x6d09('0xc')](faxQueue[_0x6d09('0x17')]())[_0x6d09('0xc')](realtime[_0x6d09('0x18')]())['then'](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0x6d09('0x19')]())[_0x6d09('0xc')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x6d09('0xc')](function(_0x4c3680){return initRealtime();})[_0x6d09('0xc')](function(_0xfa6833){return setInterval(initRealtime,0x1388);})[_0x6d09('0x1a')](function(_0x1d7730){console['log'](_0x1d7730);});}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 566ab5e..783e0fd 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 _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x41f96e,_0x333851){var _0x48a4ac=function(_0xdad934){while(--_0xdad934){_0x41f96e['push'](_0x41f96e['shift']());}};_0x48a4ac(++_0x333851);}(_0x326f,0xd1));var _0xf326=function(_0x4f3c5a,_0x46ba10){_0x4f3c5a=_0x4f3c5a-0x0;var _0x17fb31=_0x326f[_0x4f3c5a];return _0x17fb31;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file +var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x2c6174,_0x654f4b){var _0x346807=function(_0x290941){while(--_0x290941){_0x2c6174['push'](_0x2c6174['shift']());}};_0x346807(++_0x654f4b);}(_0xe14b,0x93));var _0xbe14=function(_0x32cb3a,_0xe95fcd){_0x32cb3a=_0x32cb3a-0x0;var _0x1326d4=_0xe14b[_0x32cb3a];return _0x1326d4;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 9dcad09..138e4db 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 _0x0d51=['bluebird','jayson/promise','client','http','then','error','message','result','catch','sendMailMessage','SendMail'];(function(_0x187924,_0x17e8e1){var _0x434cff=function(_0xf187eb){while(--_0xf187eb){_0x187924['push'](_0x187924['shift']());}};_0x434cff(++_0x17e8e1);}(_0x0d51,0x1ef));var _0x10d5=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0x0d51[_0x1b1a3b];return _0x385347;};'use strict';var BPromise=require(_0x10d5('0x0'));var jayson=require(_0x10d5('0x1'));var client=jayson[_0x10d5('0x2')][_0x10d5('0x3')]({'port':0x232b});function request(_0x243ffa,_0x55ed5e){return new BPromise(function(_0x2fe5df,_0x1293da){return client['request'](_0x243ffa,_0x55ed5e)[_0x10d5('0x4')](function(_0xf982bc){if(_0xf982bc[_0x10d5('0x5')]){return _0x1293da(_0xf982bc[_0x10d5('0x5')][_0x10d5('0x6')]);}else{return _0x2fe5df(_0xf982bc[_0x10d5('0x7')]);}})[_0x10d5('0x8')](function(_0x3136fa){return _0x1293da(_0x3136fa);});});}exports[_0x10d5('0x9')]=function(_0x24e08f,_0x5c94d5){return request(_0x10d5('0xa'),{'account':_0x24e08f,'message':_0x5c94d5});}; \ No newline at end of file +var _0xf585=['bluebird','client','http','request','result','catch','sendMailMessage','SendMail'];(function(_0x2c40bf,_0x5ce37a){var _0x31ab19=function(_0x56303){while(--_0x56303){_0x2c40bf['push'](_0x2c40bf['shift']());}};_0x31ab19(++_0x5ce37a);}(_0xf585,0x148));var _0x5f58=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xf585[_0x18ab2a];return _0x16dcee;};'use strict';var BPromise=require(_0x5f58('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x5f58('0x1')][_0x5f58('0x2')]({'port':0x232b});function request(_0x486ee5,_0x39cca7){return new BPromise(function(_0x46b9e9,_0x5b77b5){return client[_0x5f58('0x3')](_0x486ee5,_0x39cca7)['then'](function(_0x26fd56){if(_0x26fd56['error']){return _0x5b77b5(_0x26fd56['error']['message']);}else{return _0x46b9e9(_0x26fd56[_0x5f58('0x4')]);}})[_0x5f58('0x5')](function(_0x5edd52){return _0x5b77b5(_0x5edd52);});});}exports[_0x5f58('0x6')]=function(_0x5cde8d,_0x2e90fb){return request(_0x5f58('0x7'),{'account':_0x5cde8d,'message':_0x2e90fb});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 87eb211..0f6b491 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 _0x7f15=['smsPause','openchannelPause','chatStatus','chatCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatCurrentCapacity','busy','busyQueue','chatWaitingInteractions','smsWaitingInteractions','emit','user:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','faxPause'];(function(_0x12c425,_0x587f49){var _0x4bf48e=function(_0x56352e){while(--_0x56352e){_0x12c425['push'](_0x12c425['shift']());}};_0x4bf48e(++_0x587f49);}(_0x7f15,0xae));var _0x57f1=function(_0x287731,_0x31dbfb){_0x287731=_0x287731-0x0;var _0x2e92d8=_0x7f15[_0x287731];return _0x2e92d8;};'use strict';var _=require(_0x57f1('0x0'));var moment=require('moment');var md5=require(_0x57f1('0x1'));var Redis=require(_0x57f1('0x2'));var config=require(_0x57f1('0x3'));config[_0x57f1('0x4')]=_[_0x57f1('0x5')](config['redis'],{'host':_0x57f1('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x57f1('0x4')]));function Agent(_0x2ffc7f){this['id']=_0x2ffc7f['id']||0x0;this['name']=_0x2ffc7f[_0x57f1('0x7')]||'';this[_0x57f1('0x8')]=_0x2ffc7f['online']||!![];this[_0x57f1('0x9')]=_0x2ffc7f[_0x57f1('0x9')]||![];this[_0x57f1('0xa')]=_0x2ffc7f[_0x57f1('0xa')]||![];this['mailPause']=_0x2ffc7f['mailPause']||![];this[_0x57f1('0xb')]=_0x2ffc7f[_0x57f1('0xb')]||![];this[_0x57f1('0xc')]=_0x2ffc7f[_0x57f1('0xc')]||![];this[_0x57f1('0xd')]=_0x2ffc7f['openchannelPause']||![];this[_0x57f1('0xe')]='unknown';this['chatStatusTime']=0x0;this[_0x57f1('0xf')]=_0x2ffc7f[_0x57f1('0xf')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x57f1('0x10')]=_0x57f1('0x11');this[_0x57f1('0x12')]=0x0;this[_0x57f1('0x13')]=_0x2ffc7f[_0x57f1('0x13')]||0x0;this[_0x57f1('0x14')]=0x0;this[_0x57f1('0x15')]=_0x57f1('0x11');this[_0x57f1('0x16')]=0x0;this[_0x57f1('0x17')]=_0x2ffc7f[_0x57f1('0x17')]||0x0;this[_0x57f1('0x18')]=0x0;this[_0x57f1('0x19')]=_0x57f1('0x11');this[_0x57f1('0x1a')]=0x0;this['smsCapacity']=_0x2ffc7f[_0x57f1('0x1b')]||0x0;this[_0x57f1('0x1c')]=0x0;this[_0x57f1('0x1d')]='unknown';this[_0x57f1('0x1e')]=0x0;this[_0x57f1('0x1f')]=_0x2ffc7f[_0x57f1('0x1f')]||0x0;this[_0x57f1('0x20')]=0x0;this[_0x57f1('0x21')]='unknown';this[_0x57f1('0x22')]=0x0;this[_0x57f1('0x23')]=_0x2ffc7f[_0x57f1('0x23')]||0x0;this[_0x57f1('0x24')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x57f1('0x1')]='';this['chatWaitingInteractions']={};this[_0x57f1('0x25')]={};this[_0x57f1('0x26')]={};this[_0x57f1('0x27')]={};this['smsWaitingInteractions']={};this[_0x57f1('0x28')]={};this['updateRealtime']();}Agent[_0x57f1('0x29')][_0x57f1('0x2a')]=function(_0x3e2994){if(this[_0x3e2994+_0x57f1('0x2b')]>0x0){if(this[_0x3e2994+_0x57f1('0x2c')]>0x0&&this[_0x3e2994+_0x57f1('0x2b')]>=this[_0x3e2994+'Capacity']){return _0x57f1('0x2d');}else{return _0x57f1('0x2e');}}else{return _0x57f1('0x2f');}};Agent['prototype']['updateRealtime']=function(){var _0x20c14c=['mail','chat','openchannel','fax',_0x57f1('0x30'),_0x57f1('0x31')];for(var _0xa69c97=0x0;_0xa69c97<_0x20c14c[_0x57f1('0x32')];_0xa69c97+=0x1){var _0x4aefed=this['getChannelStatus'](_0x20c14c[_0xa69c97]);if(this[_0x20c14c[_0xa69c97]+_0x57f1('0x33')]!==_0x4aefed){this[_0x20c14c[_0xa69c97]+_0x57f1('0x34')]=_[_0x57f1('0x35')](moment()[_0x57f1('0x36')]('x'));}this[_0x20c14c[_0xa69c97]+_0x57f1('0x33')]=_0x4aefed;}var _0xd2e50b={'id':this['id'],'name':this[_0x57f1('0x7')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0x57f1('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0x57f1('0xc')],'faxPause':this[_0x57f1('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x57f1('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x57f1('0xf')],'chatCurrentCapacity':this[_0x57f1('0x37')],'mailStatus':this[_0x57f1('0x10')],'mailStatusTime':this[_0x57f1('0x12')],'mailCapacity':this[_0x57f1('0x13')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x57f1('0x15')],'faxStatusTime':this[_0x57f1('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x57f1('0x18')],'smsStatus':this[_0x57f1('0x19')],'smsStatusTime':this[_0x57f1('0x1a')],'smsCapacity':this[_0x57f1('0x1b')],'smsCurrentCapacity':this[_0x57f1('0x1c')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x57f1('0x1e')],'whatsappCapacity':this[_0x57f1('0x1f')],'whatsappCurrentCapacity':this[_0x57f1('0x20')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x57f1('0x22')],'openchannelCapacity':this[_0x57f1('0x23')],'openchannelCurrentCapacity':this[_0x57f1('0x24')],'busy':this[_0x57f1('0x38')],'busyQueue':this[_0x57f1('0x39')],'chatWaitingInteractions':this[_0x57f1('0x3a')],'faxWaitingInteractions':this[_0x57f1('0x25')],'mailWaitingInteractions':this[_0x57f1('0x26')],'openchannelWaitingInteractions':this[_0x57f1('0x27')],'smsWaitingInteractions':this[_0x57f1('0x3b')],'whatsappWaitingInteractions':this[_0x57f1('0x28')]};var _0x1e374c=md5(JSON['stringify'](_0xd2e50b));if(this[_0x57f1('0x1')]!==_0x1e374c){this[_0x57f1('0x1')]=_0x1e374c;io[_0x57f1('0x3c')](_0x57f1('0x3d'),_0xd2e50b);}};module['exports']=Agent; \ No newline at end of file +var _0x1248=['faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','updateRealtime','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','fax','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','format','faxStatusTime','smsStatusTime','whatsappStatusTime','openchannelStatus','openchannelCurrentCapacity','chatWaitingInteractions','smsWaitingInteractions','emit','user:save','exports','lodash','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','busy','busyQueue'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1248,0x1f2));var _0x8124=function(_0x53681e,_0x45872a){_0x53681e=_0x53681e-0x0;var _0x50683f=_0x1248[_0x53681e];return _0x50683f;};'use strict';var _=require(_0x8124('0x0'));var moment=require(_0x8124('0x1'));var md5=require(_0x8124('0x2'));var Redis=require(_0x8124('0x3'));var config=require('../../../config/environment');config[_0x8124('0x4')]=_[_0x8124('0x5')](config[_0x8124('0x4')],{'host':_0x8124('0x6'),'port':0x18eb});var io=require(_0x8124('0x7'))(new Redis(config[_0x8124('0x4')]));function Agent(_0x515fa5){this['id']=_0x515fa5['id']||0x0;this[_0x8124('0x8')]=_0x515fa5['name']||'';this[_0x8124('0x9')]=_0x515fa5['online']||!![];this[_0x8124('0xa')]=_0x515fa5[_0x8124('0xa')]||![];this[_0x8124('0xb')]=_0x515fa5['chatPause']||![];this[_0x8124('0xc')]=_0x515fa5['mailPause']||![];this[_0x8124('0xd')]=_0x515fa5[_0x8124('0xd')]||![];this['smsPause']=_0x515fa5[_0x8124('0xe')]||![];this['openchannelPause']=_0x515fa5[_0x8124('0xf')]||![];this[_0x8124('0x10')]=_0x8124('0x11');this[_0x8124('0x12')]=0x0;this['chatCapacity']=_0x515fa5[_0x8124('0x13')]||0x0;this[_0x8124('0x14')]=0x0;this[_0x8124('0x15')]=_0x8124('0x11');this[_0x8124('0x16')]=0x0;this[_0x8124('0x17')]=_0x515fa5['mailCapacity']||0x0;this[_0x8124('0x18')]=0x0;this[_0x8124('0x19')]=_0x8124('0x11');this['faxStatusTime']=0x0;this[_0x8124('0x1a')]=_0x515fa5[_0x8124('0x1a')]||0x0;this[_0x8124('0x1b')]=0x0;this[_0x8124('0x1c')]='unknown';this['smsStatusTime']=0x0;this[_0x8124('0x1d')]=_0x515fa5[_0x8124('0x1d')]||0x0;this[_0x8124('0x1e')]=0x0;this[_0x8124('0x1f')]=_0x8124('0x11');this['whatsappStatusTime']=0x0;this[_0x8124('0x20')]=_0x515fa5['whatsappCapacity']||0x0;this[_0x8124('0x21')]=0x0;this['openchannelStatus']=_0x8124('0x11');this[_0x8124('0x22')]=0x0;this[_0x8124('0x23')]=_0x515fa5['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x8124('0x24')]=![];this[_0x8124('0x25')]=undefined;this[_0x8124('0x2')]='';this['chatWaitingInteractions']={};this[_0x8124('0x26')]={};this[_0x8124('0x27')]={};this[_0x8124('0x28')]={};this['smsWaitingInteractions']={};this[_0x8124('0x29')]={};this[_0x8124('0x2a')]();}Agent['prototype']['getChannelStatus']=function(_0x924efd){if(this[_0x924efd+_0x8124('0x2b')]>0x0){if(this[_0x924efd+_0x8124('0x2c')]>0x0&&this[_0x924efd+_0x8124('0x2b')]>=this[_0x924efd+_0x8124('0x2c')]){return _0x8124('0x2d');}else{return _0x8124('0x2e');}}else{return _0x8124('0x2f');}};Agent['prototype'][_0x8124('0x2a')]=function(){var _0x2d46c1=[_0x8124('0x30'),'chat','openchannel',_0x8124('0x31'),'sms',_0x8124('0x32')];for(var _0x3513cd=0x0;_0x3513cd<_0x2d46c1[_0x8124('0x33')];_0x3513cd+=0x1){var _0x33dfbd=this[_0x8124('0x34')](_0x2d46c1[_0x3513cd]);if(this[_0x2d46c1[_0x3513cd]+_0x8124('0x35')]!==_0x33dfbd){this[_0x2d46c1[_0x3513cd]+_0x8124('0x36')]=_[_0x8124('0x37')](moment()[_0x8124('0x38')]('x'));}this[_0x2d46c1[_0x3513cd]+_0x8124('0x35')]=_0x33dfbd;}var _0xda16cc={'id':this['id'],'name':this[_0x8124('0x8')],'online':this['online'],'voicePause':this[_0x8124('0xa')],'chatPause':this[_0x8124('0xb')],'mailPause':this[_0x8124('0xc')],'smsPause':this[_0x8124('0xe')],'faxPause':this[_0x8124('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x8124('0x10')],'chatStatusTime':this[_0x8124('0x12')],'chatCapacity':this[_0x8124('0x13')],'chatCurrentCapacity':this[_0x8124('0x14')],'mailStatus':this[_0x8124('0x15')],'mailStatusTime':this[_0x8124('0x16')],'mailCapacity':this[_0x8124('0x17')],'mailCurrentCapacity':this[_0x8124('0x18')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x8124('0x39')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x8124('0x1b')],'smsStatus':this[_0x8124('0x1c')],'smsStatusTime':this[_0x8124('0x3a')],'smsCapacity':this[_0x8124('0x1d')],'smsCurrentCapacity':this[_0x8124('0x1e')],'whatsappStatus':this[_0x8124('0x1f')],'whatsappStatusTime':this[_0x8124('0x3b')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x8124('0x3c')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x8124('0x3d')],'busy':this['busy'],'busyQueue':this[_0x8124('0x25')],'chatWaitingInteractions':this[_0x8124('0x3e')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x8124('0x27')],'openchannelWaitingInteractions':this[_0x8124('0x28')],'smsWaitingInteractions':this[_0x8124('0x3f')],'whatsappWaitingInteractions':this[_0x8124('0x29')]};var _0x2042e3=md5(JSON['stringify'](_0xda16cc));if(this[_0x8124('0x2')]!==_0x2042e3){this[_0x8124('0x2')]=_0x2042e3;io[_0x8124('0x40')](_0x8124('0x41'),_0xda16cc);}};module[_0x8124('0x42')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 709bcef..84cccd0 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 _0xce96=['emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','chatPause','available','format'];(function(_0x193dcf,_0x33a3bc){var _0x58481a=function(_0x1360b6){while(--_0x1360b6){_0x193dcf['push'](_0x193dcf['shift']());}};_0x58481a(++_0x33a3bc);}(_0xce96,0x1ef));var _0x6ce9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xce96[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x6ce9('0x0'));var md5=require(_0x6ce9('0x1'));var util=require(_0x6ce9('0x2'));var Redis=require(_0x6ce9('0x3'));var config=require(_0x6ce9('0x4'));config[_0x6ce9('0x5')]=_[_0x6ce9('0x6')](config['redis'],{'host':_0x6ce9('0x7'),'port':0x18eb});var io=require(_0x6ce9('0x8'))(new Redis(config[_0x6ce9('0x5')]));function ChatQueue(_0x32ba87){this['id']=_0x32ba87['id']||0x0;this[_0x6ce9('0x9')]=_0x32ba87[_0x6ce9('0x9')]||'';this[_0x6ce9('0xa')]=_0x32ba87[_0x6ce9('0xa')]||0xa;this[_0x6ce9('0xb')]=_0x32ba87[_0x6ce9('0xb')]||_0x6ce9('0xc');this[_0x6ce9('0xd')]=_0x32ba87['Agents'];this[_0x6ce9('0xe')]={};this[_0x6ce9('0xf')]=0x0;this[_0x6ce9('0x1')]='';this['updateRouting']();this[_0x6ce9('0x10')]();}ChatQueue[_0x6ce9('0x11')][_0x6ce9('0x12')]=function(){var _0x5227bc=this[_0x6ce9('0xe')][_0x6ce9('0x13')];this[_0x6ce9('0xe')]=_[_0x6ce9('0x14')](this[_0x6ce9('0xd')],'id');this[_0x6ce9('0xe')][_0x6ce9('0x13')]=_0x5227bc;};ChatQueue[_0x6ce9('0x11')][_0x6ce9('0x10')]=function(){this[_0x6ce9('0x15')]=0x0;this[_0x6ce9('0x16')]=0x0;for(var _0x17f373=0x0;_0x17f373=0x0?this[_0x6ce9('0x19')]:0x0;var _0x31f270={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6ce9('0x15')],'name':this[_0x6ce9('0x9')],'paused':this[_0x6ce9('0x16')],'waiting':this[_0x6ce9('0xf')]};var _0x430aee=md5(JSON['stringify'](_0x31f270));if(this[_0x6ce9('0x1')]!==_0x430aee){this[_0x6ce9('0x1')]=_0x430aee;io['to'](util[_0x6ce9('0x1a')]('chat:queue:%s',_0x31f270[_0x6ce9('0x9')]))[_0x6ce9('0x1b')]('chat_queue:save',_0x31f270);}};module[_0x6ce9('0x1c')]=ChatQueue; \ No newline at end of file +var _0xa482=['updateRouting','map','prototype','loggedIn','online','chatPause','available','paused','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xa482,0x194));var _0x2a48=function(_0x5b1aa6,_0x40b86d){_0x5b1aa6=_0x5b1aa6-0x0;var _0x23e5b4=_0xa482[_0x5b1aa6];return _0x23e5b4;};'use strict';var _=require(_0x2a48('0x0'));var md5=require(_0x2a48('0x1'));var util=require(_0x2a48('0x2'));var Redis=require(_0x2a48('0x3'));var config=require(_0x2a48('0x4'));config['redis']=_[_0x2a48('0x5')](config[_0x2a48('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x2a48('0x7'))(new Redis(config[_0x2a48('0x6')]));function ChatQueue(_0xf83095){this['id']=_0xf83095['id']||0x0;this['name']=_0xf83095[_0x2a48('0x8')]||'';this[_0x2a48('0x9')]=_0xf83095[_0x2a48('0x9')]||0xa;this[_0x2a48('0xa')]=_0xf83095[_0x2a48('0xa')]||_0x2a48('0xb');this[_0x2a48('0xc')]=_0xf83095[_0x2a48('0xc')];this[_0x2a48('0xd')]={};this[_0x2a48('0xe')]=0x0;this[_0x2a48('0x1')]='';this['updateRouting']();this[_0x2a48('0xf')]();}ChatQueue['prototype'][_0x2a48('0x10')]=function(){var _0x2cd6a3=this[_0x2a48('0xd')]['_rr'];this[_0x2a48('0xd')]=_[_0x2a48('0x11')](this[_0x2a48('0xc')],'id');this[_0x2a48('0xd')]['_rr']=_0x2cd6a3;};ChatQueue[_0x2a48('0x12')][_0x2a48('0xf')]=function(){this[_0x2a48('0x13')]=0x0;this['paused']=0x0;for(var _0x2ec6d6=0x0;_0x2ec6d6=0x0?this[_0x2a48('0x16')]:0x0;var _0x2ed7a5={'id':this['id'],'available':this[_0x2a48('0x16')],'loggedIn':this[_0x2a48('0x13')],'name':this['name'],'paused':this[_0x2a48('0x17')],'waiting':this[_0x2a48('0xe')]};var _0x3a0643=md5(JSON[_0x2a48('0x18')](_0x2ed7a5));if(this['md5']!==_0x3a0643){this[_0x2a48('0x1')]=_0x3a0643;io['to'](util[_0x2a48('0x19')](_0x2a48('0x1a'),_0x2ed7a5[_0x2a48('0x8')]))[_0x2a48('0x1b')](_0x2a48('0x1c'),_0x2ed7a5);}};module[_0x2a48('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 2b529bd..c723a51 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 _0x4bd9=['util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','mapAgentsId','_rr','map','prototype','updateRealtime','loggedIn','paused','faxPause','available','waiting','format','emit','exports','md5'];(function(_0x127d55,_0x90027b){var _0x508ed8=function(_0x252633){while(--_0x252633){_0x127d55['push'](_0x127d55['shift']());}};_0x508ed8(++_0x90027b);}(_0x4bd9,0x103));var _0x94bd=function(_0x30a213,_0x1d5c12){_0x30a213=_0x30a213-0x0;var _0x40eb2d=_0x4bd9[_0x30a213];return _0x40eb2d;};'use strict';var _=require('lodash');var md5=require(_0x94bd('0x0'));var util=require(_0x94bd('0x1'));var Redis=require(_0x94bd('0x2'));var config=require('../../../config/environment');config[_0x94bd('0x3')]=_[_0x94bd('0x4')](config[_0x94bd('0x3')],{'host':_0x94bd('0x5'),'port':0x18eb});var io=require(_0x94bd('0x6'))(new Redis(config[_0x94bd('0x3')]));function FaxQueue(_0x34dfe3){this['id']=_0x34dfe3['id']||0x0;this[_0x94bd('0x7')]=_0x34dfe3[_0x94bd('0x7')]||'';this[_0x94bd('0x8')]=_0x34dfe3[_0x94bd('0x8')]||0xa;this[_0x94bd('0x9')]=_0x34dfe3[_0x94bd('0x9')]||_0x94bd('0xa');this['Agents']=_0x34dfe3[_0x94bd('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x94bd('0x0')]='';this[_0x94bd('0xc')]();this['updateRealtime']();}FaxQueue['prototype']['updateRouting']=function(){var _0x166a3c=this[_0x94bd('0xd')][_0x94bd('0xe')];this[_0x94bd('0xd')]=_[_0x94bd('0xf')](this['Agents'],'id');this['mapAgentsId'][_0x94bd('0xe')]=_0x166a3c;};FaxQueue[_0x94bd('0x10')][_0x94bd('0x11')]=function(){this[_0x94bd('0x12')]=0x0;this[_0x94bd('0x13')]=0x0;for(var _0x4091a2=0x0;_0x4091a2=0x0?this[_0x94bd('0x15')]:0x0;var _0x933430={'id':this['id'],'available':this[_0x94bd('0x15')],'loggedIn':this[_0x94bd('0x12')],'name':this[_0x94bd('0x7')],'paused':this[_0x94bd('0x13')],'waiting':this[_0x94bd('0x16')]};var _0x46b918=md5(JSON['stringify'](_0x933430));if(this[_0x94bd('0x0')]!==_0x46b918){this[_0x94bd('0x0')]=_0x46b918;io['to'](util[_0x94bd('0x17')]('fax:queue:%s',_0x933430['name']))[_0x94bd('0x18')]('fax_queue:save',_0x933430);}};module[_0x94bd('0x19')]=FaxQueue; \ No newline at end of file +var _0x7525=['redis','localhost','socket.io-emitter','name','strategy','beepall','Agents','waiting','updateRouting','mapAgentsId','_rr','map','prototype','loggedIn','length','faxPause','available','paused','stringify','format','fax:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0x7525,0xff));var _0x5752=function(_0x240cca,_0x392017){_0x240cca=_0x240cca-0x0;var _0x118f2c=_0x7525[_0x240cca];return _0x118f2c;};'use strict';var _=require(_0x5752('0x0'));var md5=require(_0x5752('0x1'));var util=require(_0x5752('0x2'));var Redis=require(_0x5752('0x3'));var config=require(_0x5752('0x4'));config['redis']=_[_0x5752('0x5')](config[_0x5752('0x6')],{'host':_0x5752('0x7'),'port':0x18eb});var io=require(_0x5752('0x8'))(new Redis(config[_0x5752('0x6')]));function FaxQueue(_0x250fff){this['id']=_0x250fff['id']||0x0;this['name']=_0x250fff[_0x5752('0x9')]||'';this['timeout']=_0x250fff['timeout']||0xa;this[_0x5752('0xa')]=_0x250fff[_0x5752('0xa')]||_0x5752('0xb');this[_0x5752('0xc')]=_0x250fff[_0x5752('0xc')];this['mapAgentsId']={};this[_0x5752('0xd')]=0x0;this[_0x5752('0x1')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue['prototype'][_0x5752('0xe')]=function(){var _0x5b5c93=this[_0x5752('0xf')][_0x5752('0x10')];this[_0x5752('0xf')]=_[_0x5752('0x11')](this['Agents'],'id');this[_0x5752('0xf')][_0x5752('0x10')]=_0x5b5c93;};FaxQueue[_0x5752('0x12')]['updateRealtime']=function(){this[_0x5752('0x13')]=0x0;this['paused']=0x0;for(var _0x5f1214=0x0;_0x5f1214=0x0?this[_0x5752('0x16')]:0x0;var _0x35d3b1={'id':this['id'],'available':this[_0x5752('0x16')],'loggedIn':this[_0x5752('0x13')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x4a75e5=md5(JSON[_0x5752('0x18')](_0x35d3b1));if(this[_0x5752('0x1')]!==_0x4a75e5){this['md5']=_0x4a75e5;io['to'](util[_0x5752('0x19')](_0x5752('0x1a'),_0x35d3b1['name']))[_0x5752('0x1b')]('fax_queue:save',_0x35d3b1);}};module[_0x5752('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 897d763..32ead59 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 _0x62a6=['Intervals','exports','name'];(function(_0x27efc5,_0x54963e){var _0x3eaaf5=function(_0x4093ca){while(--_0x4093ca){_0x27efc5['push'](_0x27efc5['shift']());}};_0x3eaaf5(++_0x54963e);}(_0x62a6,0x18b));var _0x662a=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x62a6[_0x1d1779];return _0x2377e9;};'use strict';function Interval(_0x55c5a9){this['id']=_0x55c5a9['id']||0x0;this[_0x662a('0x0')]=_0x55c5a9['name']||'';this[_0x662a('0x1')]=_0x55c5a9['Intervals']||{};}module[_0x662a('0x2')]=Interval; \ No newline at end of file +var _0x5ba7=['Intervals','exports','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ba7,0x19d));var _0x75ba=function(_0x4c37d9,_0xa5cf2){_0x4c37d9=_0x4c37d9-0x0;var _0x34ee8c=_0x5ba7[_0x4c37d9];return _0x34ee8c;};'use strict';function Interval(_0x417cff){this['id']=_0x417cff['id']||0x0;this[_0x75ba('0x0')]=_0x417cff[_0x75ba('0x0')]||'';this[_0x75ba('0x1')]=_0x417cff[_0x75ba('0x1')]||{};}module[_0x75ba('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index b00cdfd..ab33786 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 _0x8bbc=['map','loggedIn','paused','Agents','length','online','mailPause','available','waiting','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','util','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','updateRealtime','prototype','updateRouting','_rr'];(function(_0x526e71,_0x1e50ff){var _0x15ea82=function(_0x1e6eae){while(--_0x1e6eae){_0x526e71['push'](_0x526e71['shift']());}};_0x15ea82(++_0x1e50ff);}(_0x8bbc,0xf6));var _0xc8bb=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x8bbc[_0x4314d7];return _0x5c599b;};'use strict';var _=require(_0xc8bb('0x0'));var md5=require(_0xc8bb('0x1'));var util=require(_0xc8bb('0x2'));var Redis=require(_0xc8bb('0x3'));var config=require('../../../config/environment');config[_0xc8bb('0x4')]=_['defaults'](config[_0xc8bb('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xc8bb('0x5'))(new Redis(config[_0xc8bb('0x4')]));function MailQueue(_0x38bfa0){this['id']=_0x38bfa0['id']||0x0;this[_0xc8bb('0x6')]=_0x38bfa0[_0xc8bb('0x6')]||'';this[_0xc8bb('0x7')]=_0x38bfa0[_0xc8bb('0x7')]||0xa;this[_0xc8bb('0x8')]=_0x38bfa0['strategy']||_0xc8bb('0x9');this['Agents']=_0x38bfa0['Agents'];this[_0xc8bb('0xa')]={};this['waiting']=0x0;this[_0xc8bb('0x1')]='';this['updateRouting']();this[_0xc8bb('0xb')]();}MailQueue[_0xc8bb('0xc')][_0xc8bb('0xd')]=function(){var _0x1f8d90=this[_0xc8bb('0xa')][_0xc8bb('0xe')];this[_0xc8bb('0xa')]=_[_0xc8bb('0xf')](this['Agents'],'id');this[_0xc8bb('0xa')][_0xc8bb('0xe')]=_0x1f8d90;};MailQueue[_0xc8bb('0xc')][_0xc8bb('0xb')]=function(){this[_0xc8bb('0x10')]=0x0;this[_0xc8bb('0x11')]=0x0;for(var _0x1a3887=0x0;_0x1a3887=0x0?this[_0xc8bb('0x16')]:0x0;var _0x16378f={'id':this['id'],'available':this[_0xc8bb('0x16')],'loggedIn':this[_0xc8bb('0x10')],'name':this[_0xc8bb('0x6')],'paused':this['paused'],'waiting':this[_0xc8bb('0x17')]};var _0xea4446=md5(JSON[_0xc8bb('0x18')](_0x16378f));if(this[_0xc8bb('0x1')]!==_0xea4446){this['md5']=_0xea4446;io['to'](util[_0xc8bb('0x19')](_0xc8bb('0x1a'),_0x16378f[_0xc8bb('0x6')]))['emit'](_0xc8bb('0x1b'),_0x16378f);}};module[_0xc8bb('0x1c')]=MailQueue; \ No newline at end of file +var _0xe966=['map','updateRealtime','loggedIn','paused','length','available','stringify','emit','lodash','md5','util','ioredis','../../../config/environment','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe966,0xa9));var _0x6e96=function(_0x55de1c,_0x3269b9){_0x55de1c=_0x55de1c-0x0;var _0x852785=_0xe966[_0x55de1c];return _0x852785;};'use strict';var _=require(_0x6e96('0x0'));var md5=require(_0x6e96('0x1'));var util=require(_0x6e96('0x2'));var Redis=require(_0x6e96('0x3'));var config=require(_0x6e96('0x4'));config[_0x6e96('0x5')]=_['defaults'](config[_0x6e96('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6e96('0x5')]));function MailQueue(_0x157ae3){this['id']=_0x157ae3['id']||0x0;this[_0x6e96('0x6')]=_0x157ae3[_0x6e96('0x6')]||'';this[_0x6e96('0x7')]=_0x157ae3[_0x6e96('0x7')]||0xa;this[_0x6e96('0x8')]=_0x157ae3[_0x6e96('0x8')]||_0x6e96('0x9');this['Agents']=_0x157ae3[_0x6e96('0xa')];this[_0x6e96('0xb')]={};this[_0x6e96('0xc')]=0x0;this[_0x6e96('0x1')]='';this[_0x6e96('0xd')]();this['updateRealtime']();}MailQueue[_0x6e96('0xe')][_0x6e96('0xd')]=function(){var _0x3bc1b2=this[_0x6e96('0xb')]['_rr'];this[_0x6e96('0xb')]=_[_0x6e96('0xf')](this[_0x6e96('0xa')],'id');this[_0x6e96('0xb')]['_rr']=_0x3bc1b2;};MailQueue[_0x6e96('0xe')][_0x6e96('0x10')]=function(){this[_0x6e96('0x11')]=0x0;this[_0x6e96('0x12')]=0x0;for(var _0x543f23=0x0;_0x543f23=0x0?this['available']:0x0;var _0xb1e990={'id':this['id'],'available':this[_0x6e96('0x14')],'loggedIn':this[_0x6e96('0x11')],'name':this[_0x6e96('0x6')],'paused':this[_0x6e96('0x12')],'waiting':this['waiting']};var _0x2bd545=md5(JSON[_0x6e96('0x15')](_0xb1e990));if(this['md5']!==_0x2bd545){this[_0x6e96('0x1')]=_0x2bd545;io['to'](util['format']('mail:queue:%s',_0xb1e990['name']))[_0x6e96('0x16')]('mail_queue:save',_0xb1e990);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 4ea40ad..b133b37 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x326f,0xd1));var _0xf326=function(_0x3bf72e,_0x29dffe){_0x3bf72e=_0x3bf72e-0x0;var _0x32636b=_0x326f[_0x3bf72e];return _0x32636b;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0x1261,0x144));var _0x1126=function(_0x21b706,_0x1022f4){_0x21b706=_0x21b706-0x0;var _0x13b94a=_0x1261[_0x21b706];return _0x13b94a;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 9e94712..5aba551 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 _0x207d=['waiting','updateRouting','mapAgentsId','_rr','prototype','updateRealtime','loggedIn','paused','length','online','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','redis','localhost','name','timeout','strategy','beepall','Agents'];(function(_0x29ab8e,_0x67c0c1){var _0xc602a3=function(_0x2782b5){while(--_0x2782b5){_0x29ab8e['push'](_0x29ab8e['shift']());}};_0xc602a3(++_0x67c0c1);}(_0x207d,0x10d));var _0xd207=function(_0x19c0f1,_0x5c5d5f){_0x19c0f1=_0x19c0f1-0x0;var _0x13384d=_0x207d[_0x19c0f1];return _0x13384d;};'use strict';var _=require(_0xd207('0x0'));var md5=require(_0xd207('0x1'));var util=require(_0xd207('0x2'));var Redis=require(_0xd207('0x3'));var config=require('../../../config/environment');config[_0xd207('0x4')]=_['defaults'](config[_0xd207('0x4')],{'host':_0xd207('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd207('0x4')]));function SmsQueue(_0x47386f){this['id']=_0x47386f['id']||0x0;this[_0xd207('0x6')]=_0x47386f[_0xd207('0x6')]||'';this[_0xd207('0x7')]=_0x47386f[_0xd207('0x7')]||0xa;this[_0xd207('0x8')]=_0x47386f[_0xd207('0x8')]||_0xd207('0x9');this[_0xd207('0xa')]=_0x47386f[_0xd207('0xa')];this['mapAgentsId']={};this[_0xd207('0xb')]=0x0;this[_0xd207('0x1')]='';this[_0xd207('0xc')]();this['updateRealtime']();}SmsQueue['prototype'][_0xd207('0xc')]=function(){var _0x260dfd=this[_0xd207('0xd')]['_rr'];this[_0xd207('0xd')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0xd207('0xe')]=_0x260dfd;};SmsQueue[_0xd207('0xf')][_0xd207('0x10')]=function(){this[_0xd207('0x11')]=0x0;this[_0xd207('0x12')]=0x0;for(var _0x450adf=0x0;_0x450adf=0x0?this[_0xd207('0x15')]:0x0;var _0x3e7e60={'id':this['id'],'available':this[_0xd207('0x15')],'loggedIn':this['loggedIn'],'name':this[_0xd207('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x6b7fbd=md5(JSON[_0xd207('0x16')](_0x3e7e60));if(this[_0xd207('0x1')]!==_0x6b7fbd){this[_0xd207('0x1')]=_0x6b7fbd;io['to'](util[_0xd207('0x17')](_0xd207('0x18'),_0x3e7e60[_0xd207('0x6')]))[_0xd207('0x19')](_0xd207('0x1a'),_0x3e7e60);}};module[_0xd207('0x1b')]=SmsQueue; \ No newline at end of file +var _0xd6d6=['util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x22111b,_0x4bffe5){_0x22111b=_0x22111b-0x0;var _0x3b5035=_0xd6d6[_0x22111b];return _0x3b5035;};'use strict';var _=require(_0x6d6d('0x0'));var md5=require(_0x6d6d('0x1'));var util=require(_0x6d6d('0x2'));var Redis=require(_0x6d6d('0x3'));var config=require('../../../config/environment');config[_0x6d6d('0x4')]=_[_0x6d6d('0x5')](config[_0x6d6d('0x4')],{'host':_0x6d6d('0x6'),'port':0x18eb});var io=require(_0x6d6d('0x7'))(new Redis(config[_0x6d6d('0x4')]));function SmsQueue(_0x35a813){this['id']=_0x35a813['id']||0x0;this['name']=_0x35a813[_0x6d6d('0x8')]||'';this[_0x6d6d('0x9')]=_0x35a813[_0x6d6d('0x9')]||0xa;this[_0x6d6d('0xa')]=_0x35a813[_0x6d6d('0xa')]||_0x6d6d('0xb');this[_0x6d6d('0xc')]=_0x35a813['Agents'];this['mapAgentsId']={};this[_0x6d6d('0xd')]=0x0;this[_0x6d6d('0x1')]='';this[_0x6d6d('0xe')]();this[_0x6d6d('0xf')]();}SmsQueue[_0x6d6d('0x10')]['updateRouting']=function(){var _0x1f2b86=this[_0x6d6d('0x11')]['_rr'];this['mapAgentsId']=_[_0x6d6d('0x12')](this[_0x6d6d('0xc')],'id');this[_0x6d6d('0x11')][_0x6d6d('0x13')]=_0x1f2b86;};SmsQueue[_0x6d6d('0x10')][_0x6d6d('0xf')]=function(){this[_0x6d6d('0x14')]=0x0;this[_0x6d6d('0x15')]=0x0;for(var _0x5f4154=0x0;_0x5f4154=0x0?this[_0x6d6d('0x19')]:0x0;var _0x1a75d8={'id':this['id'],'available':this[_0x6d6d('0x19')],'loggedIn':this[_0x6d6d('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x6d6d('0xd')]};var _0x5a5855=md5(JSON[_0x6d6d('0x1a')](_0x1a75d8));if(this[_0x6d6d('0x1')]!==_0x5a5855){this[_0x6d6d('0x1')]=_0x5a5855;io['to'](util[_0x6d6d('0x1b')](_0x6d6d('0x1c'),_0x1a75d8[_0x6d6d('0x8')]))[_0x6d6d('0x1d')](_0x6d6d('0x1e'),_0x1a75d8);}};module[_0x6d6d('0x1f')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 932b353..291f8db 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 _0xd9f9=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd9f9,0x1be));var _0x9d9f=function(_0x166a4b,_0x3e0949){_0x166a4b=_0x166a4b-0x0;var _0x4b4e6e=_0xd9f9[_0x166a4b];return _0x4b4e6e;};'use strict';var _=require(_0x9d9f('0x0'));var md5=require('md5');var util=require(_0x9d9f('0x1'));var Redis=require(_0x9d9f('0x2'));var config=require(_0x9d9f('0x3'));config[_0x9d9f('0x4')]=_[_0x9d9f('0x5')](config[_0x9d9f('0x4')],{'host':_0x9d9f('0x6'),'port':0x18eb});var io=require(_0x9d9f('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x5193b3){this['id']=_0x5193b3['id']||0x0;this[_0x9d9f('0x8')]=_0x5193b3['name']||'';this[_0x9d9f('0x9')]=_0x5193b3[_0x9d9f('0x9')]||0xa;this[_0x9d9f('0xa')]=_0x5193b3['strategy']||'beepall';this['Agents']=_0x5193b3[_0x9d9f('0xb')];this[_0x9d9f('0xc')]={};this[_0x9d9f('0xd')]=0x0;this[_0x9d9f('0xe')]='';this[_0x9d9f('0xf')]();this[_0x9d9f('0x10')]();}WhatsappQueue[_0x9d9f('0x11')][_0x9d9f('0xf')]=function(){var _0x561b37=this[_0x9d9f('0xc')]['_rr'];this[_0x9d9f('0xc')]=_[_0x9d9f('0x12')](this[_0x9d9f('0xb')],'id');this[_0x9d9f('0xc')][_0x9d9f('0x13')]=_0x561b37;};WhatsappQueue[_0x9d9f('0x11')][_0x9d9f('0x10')]=function(){this[_0x9d9f('0x14')]=0x0;this[_0x9d9f('0x15')]=0x0;for(var _0x52e99f=0x0;_0x52e99f=0x0?this['available']:0x0;var _0x1206cb={'id':this['id'],'available':this[_0x9d9f('0x19')],'loggedIn':this[_0x9d9f('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x40ee85=md5(JSON[_0x9d9f('0x1a')](_0x1206cb));if(this[_0x9d9f('0xe')]!==_0x40ee85){this[_0x9d9f('0xe')]=_0x40ee85;io['to'](util[_0x9d9f('0x1b')](_0x9d9f('0x1c'),_0x1206cb[_0x9d9f('0x8')]))[_0x9d9f('0x1d')](_0x9d9f('0x1e'),_0x1206cb);}};module[_0x9d9f('0x1f')]=WhatsappQueue; \ No newline at end of file +var _0x885d=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','map','_rr','prototype','updateRealtime','loggedIn','paused','whatsappPause','available','stringify','md5','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis'];(function(_0x1b76ac,_0x48e491){var _0x219695=function(_0xeb3022){while(--_0xeb3022){_0x1b76ac['push'](_0x1b76ac['shift']());}};_0x219695(++_0x48e491);}(_0x885d,0x163));var _0xd885=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x885d[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xd885('0x0'));var md5=require('md5');var util=require(_0xd885('0x1'));var Redis=require(_0xd885('0x2'));var config=require(_0xd885('0x3'));config[_0xd885('0x4')]=_['defaults'](config[_0xd885('0x4')],{'host':_0xd885('0x5'),'port':0x18eb});var io=require(_0xd885('0x6'))(new Redis(config[_0xd885('0x4')]));function WhatsappQueue(_0x241735){this['id']=_0x241735['id']||0x0;this['name']=_0x241735[_0xd885('0x7')]||'';this[_0xd885('0x8')]=_0x241735[_0xd885('0x8')]||0xa;this[_0xd885('0x9')]=_0x241735['strategy']||_0xd885('0xa');this[_0xd885('0xb')]=_0x241735[_0xd885('0xb')];this[_0xd885('0xc')]={};this[_0xd885('0xd')]=0x0;this['md5']='';this[_0xd885('0xe')]();this['updateRealtime']();}WhatsappQueue['prototype'][_0xd885('0xe')]=function(){var _0x211c1f=this[_0xd885('0xc')]['_rr'];this[_0xd885('0xc')]=_[_0xd885('0xf')](this[_0xd885('0xb')],'id');this[_0xd885('0xc')][_0xd885('0x10')]=_0x211c1f;};WhatsappQueue[_0xd885('0x11')][_0xd885('0x12')]=function(){this[_0xd885('0x13')]=0x0;this[_0xd885('0x14')]=0x0;for(var _0x9855f1=0x0;_0x9855f1=0x0?this['available']:0x0;var _0x4cfc71={'id':this['id'],'available':this[_0xd885('0x16')],'loggedIn':this[_0xd885('0x13')],'name':this[_0xd885('0x7')],'paused':this[_0xd885('0x14')],'waiting':this[_0xd885('0xd')]};var _0x1e28ac=md5(JSON[_0xd885('0x17')](_0x4cfc71));if(this[_0xd885('0x18')]!==_0x1e28ac){this[_0xd885('0x18')]=_0x1e28ac;io['to'](util[_0xd885('0x19')](_0xd885('0x1a'),_0x4cfc71[_0xd885('0x7')]))[_0xd885('0x1b')](_0xd885('0x1c'),_0x4cfc71);}};module[_0xd885('0x1d')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 850a0d1..a6cad5c 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _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(_0x35467f,_0x46ca08){var _0x13405d=function(_0x347216){while(--_0x347216){_0x35467f['push'](_0x35467f['shift']());}};_0x13405d(++_0x46ca08);}(_0xb10b,0x12a));var _0xbb10=function(_0x4ef1a9,_0x59a5fa){_0x4ef1a9=_0x4ef1a9-0x0;var _0x23f201=_0xb10b[_0x4ef1a9];return _0x23f201;};'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 1ea67c7..7d2fdbc 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 _0x82bb=['addTags','AddTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x1cc72e,_0x1eb4f8){var _0x3bc9ed=function(_0xc58d5e){while(--_0xc58d5e){_0x1cc72e['push'](_0x1cc72e['shift']());}};_0x3bc9ed(++_0x1eb4f8);}(_0x82bb,0xa3));var _0xb82b=function(_0x1445bd,_0x2f9f08){_0x1445bd=_0x1445bd-0x0;var _0x52d18=_0x82bb[_0x1445bd];return _0x52d18;};'use strict';var client=require(_0xb82b('0x0'));exports[_0xb82b('0x1')]=function(_0x44a928,_0x5b05f1){return client[_0xb82b('0x2')](_0xb82b('0x3'),{'body':_0x5b05f1,'options':{'where':{'id':_0x44a928}},'log':_0xb82b('0x4')});};exports[_0xb82b('0x5')]=function(_0x59e5f4,_0xf6f25b){return client[_0xb82b('0x2')](_0xb82b('0x6'),{'body':_0xf6f25b,'options':{'where':{'id':_0x59e5f4}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x7777=['AddTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x536d70,_0xa88ce3){var _0x455ed3=function(_0xaa6b){while(--_0xaa6b){_0x536d70['push'](_0x536d70['shift']());}};_0x455ed3(++_0xa88ce3);}(_0x7777,0x1cf));var _0x7777=function(_0x48d12f,_0x5b66db){_0x48d12f=_0x48d12f-0x0;var _0x47fadc=_0x7777[_0x48d12f];return _0x47fadc;};'use strict';var client=require(_0x7777('0x0'));exports[_0x7777('0x1')]=function(_0x42ac20,_0x4f71c8){return client[_0x7777('0x2')](_0x7777('0x3'),{'body':_0x4f71c8,'options':{'where':{'id':_0x42ac20}},'log':_0x7777('0x4')});};exports['addTags']=function(_0x1c0c14,_0x49e65b){return client[_0x7777('0x2')](_0x7777('0x5'),{'body':_0x49e65b,'options':{'where':{'id':_0x1c0c14}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 94a7044..5bde33e 100644 --- a/server/services/routing/rpc/chatMessage.js +++ b/server/services/routing/rpc/chatMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f1e=['createChatMessage','../client','Request'];(function(_0x4b8c67,_0x2ca9b0){var _0x1cbf7d=function(_0x4886c0){while(--_0x4886c0){_0x4b8c67['push'](_0x4b8c67['shift']());}};_0x1cbf7d(++_0x2ca9b0);}(_0x0f1e,0x94));var _0xe0f1=function(_0x598e01,_0x59cf6b){_0x598e01=_0x598e01-0x0;var _0x459b94=_0x0f1e[_0x598e01];return _0x459b94;};'use strict';var client=require(_0xe0f1('0x0'));exports['create']=function(_0x208f78){return client[_0xe0f1('0x1')]('CreateChatMessage',{'body':_0x208f78,'log':_0xe0f1('0x2')});}; \ No newline at end of file +var _0x66ae=['createChatMessage','../client','Request','CreateChatMessage'];(function(_0x5906a5,_0x48af0a){var _0x1b9a31=function(_0x4b72ac){while(--_0x4b72ac){_0x5906a5['push'](_0x5906a5['shift']());}};_0x1b9a31(++_0x48af0a);}(_0x66ae,0x85));var _0xe66a=function(_0x12fd59,_0x3b1f36){_0x12fd59=_0x12fd59-0x0;var _0x2801d6=_0x66ae[_0x12fd59];return _0x2801d6;};'use strict';var client=require(_0xe66a('0x0'));exports['create']=function(_0x2fed2e){return client[_0xe66a('0x1')](_0xe66a('0x2'),{'body':_0x2fed2e,'log':_0xe66a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index f7143e2..bb1e9bb 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 _0xc949=['User','Agents','online','chatPause','getChatQueues','../client','Request','GetChatQueue','name','timeout'];(function(_0x1eafdd,_0x1aeaab){var _0x10a750=function(_0x3ff329){while(--_0x3ff329){_0x1eafdd['push'](_0x1eafdd['shift']());}};_0x10a750(++_0x1aeaab);}(_0xc949,0x181));var _0x9c94=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xc949[_0x3c2a69];return _0x596bc8;};'use strict';var client=require(_0x9c94('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x9c94('0x1')](_0x9c94('0x2'),{'options':{'raw':![],'attributes':['id',_0x9c94('0x3'),_0x9c94('0x4'),'strategy'],'include':[{'model':_0x9c94('0x5'),'as':_0x9c94('0x6'),'attributes':['id','name',_0x9c94('0x7'),_0x9c94('0x8')]}]},'log':_0x9c94('0x9')});};}; \ No newline at end of file +var _0x1e19=['online','chatPause','../client','getChatQueues','Request','GetChatQueue','name'];(function(_0x245601,_0x2d91c9){var _0x2d9599=function(_0x1687e6){while(--_0x1687e6){_0x245601['push'](_0x245601['shift']());}};_0x2d9599(++_0x2d91c9);}(_0x1e19,0x1c9));var _0x91e1=function(_0x586837,_0x4f9ed1){_0x586837=_0x586837-0x0;var _0xea18c3=_0x1e19[_0x586837];return _0xea18c3;};'use strict';var client=require(_0x91e1('0x0'));exports[_0x91e1('0x1')]=function(){return function(){return client[_0x91e1('0x2')](_0x91e1('0x3'),{'options':{'raw':![],'attributes':['id',_0x91e1('0x4'),'timeout','strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x91e1('0x4'),_0x91e1('0x5'),_0x91e1('0x6')]}]},'log':_0x91e1('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 86c9337..2c90448 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 _0x6308=['update','Request','UpdateChatQueueReport','../client','CreateChatQueueReport'];(function(_0x262b56,_0x489281){var _0x106c6e=function(_0x42dd25){while(--_0x42dd25){_0x262b56['push'](_0x262b56['shift']());}};_0x106c6e(++_0x489281);}(_0x6308,0x1f2));var _0x8630=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x6308[_0x2283dc];return _0x16db90;};'use strict';var client=require(_0x8630('0x0'));exports['create']=function(_0x1b6f0f){return client['Request']('CreateChatQueueReport',{'body':_0x1b6f0f,'log':_0x8630('0x1')});};exports[_0x8630('0x2')]=function(_0x89e9db,_0x393f45){return client[_0x8630('0x3')]('UpdateChatQueueReport',{'body':_0x393f45,'options':{'where':{'uniqueid':_0x89e9db},'order':[['id','DESC']],'limit':0x1},'log':_0x8630('0x4')});}; \ No newline at end of file +var _0x4f99=['DESC','../client','create','Request','CreateChatQueueReport','UpdateChatQueueReport'];(function(_0x315463,_0x3227ea){var _0x538955=function(_0x54cbde){while(--_0x54cbde){_0x315463['push'](_0x315463['shift']());}};_0x538955(++_0x3227ea);}(_0x4f99,0x157));var _0x94f9=function(_0x4f3e5a,_0x1ee150){_0x4f3e5a=_0x4f3e5a-0x0;var _0x452880=_0x4f99[_0x4f3e5a];return _0x452880;};'use strict';var client=require(_0x94f9('0x0'));exports[_0x94f9('0x1')]=function(_0x52f499){return client[_0x94f9('0x2')](_0x94f9('0x3'),{'body':_0x52f499,'log':_0x94f9('0x3')});};exports['update']=function(_0x15ff7c,_0x879bc2){return client['Request'](_0x94f9('0x4'),{'body':_0x879bc2,'options':{'where':{'uniqueid':_0x15ff7c},'order':[['id',_0x94f9('0x5')]],'limit':0x1},'log':_0x94f9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index f2be302..868d6df 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(_0x5f4cd7,_0x459c44){var _0x47c93f=function(_0x11f384){while(--_0x11f384){_0x5f4cd7['push'](_0x5f4cd7['shift']());}};_0x47c93f(++_0x459c44);}(_0x7a54,0x106));var _0x47a5=function(_0x5b11cc,_0x9e5a9f){_0x5b11cc=_0x5b11cc-0x0;var _0x4a84ab=_0x7a54[_0x5b11cc];return _0x4a84ab;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x43fe3e,_0x88307d){var _0x22a741=function(_0x509369){while(--_0x509369){_0x43fe3e['push'](_0x43fe3e['shift']());}};_0x22a741(++_0x88307d);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index a253c63..0fabfe5 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 _0x080d=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0x080d,0x182));var _0xd080=function(_0x4e0359,_0x205155){_0x4e0359=_0x4e0359-0x0;var _0x450f0a=_0x080d[_0x4e0359];return _0x450f0a;};'use strict';var client=require(_0xd080('0x0'));exports[_0xd080('0x1')]=function(_0x44fb67){return client[_0xd080('0x2')](_0xd080('0x3'),{'body':_0x44fb67,'log':_0xd080('0x4')});}; \ No newline at end of file +var _0xa068=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa068,0xd9));var _0x8a06=function(_0x1cde4d,_0x43082a){_0x1cde4d=_0x1cde4d-0x0;var _0xa8cd6a=_0xa068[_0x1cde4d];return _0xa8cd6a;};'use strict';var client=require(_0x8a06('0x0'));exports[_0x8a06('0x1')]=function(_0x4a013d){return client[_0x8a06('0x2')](_0x8a06('0x3'),{'body':_0x4a013d,'log':_0x8a06('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index cc8c44b..ad17c7a 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 _0x0861=['strategy','Agents','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x0861,0x159));var _0x1086=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0861[_0x17d9e3];return _0x14192d;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0x1086('0x0')](_0x1086('0x1'),{'options':{'raw':![],'attributes':['id',_0x1086('0x2'),'timeout',_0x1086('0x3')],'include':[{'model':'User','as':_0x1086('0x4'),'attributes':['id',_0x1086('0x2'),'online','faxPause']}]},'log':_0x1086('0x5')});};}; \ No newline at end of file +var _0xde08=['timeout','strategy','User','Agents','online','../client','getFaxQueues','GetFaxQueue'];(function(_0x81697e,_0x552c16){var _0x1f6e36=function(_0x2a6bbd){while(--_0x2a6bbd){_0x81697e['push'](_0x81697e['shift']());}};_0x1f6e36(++_0x552c16);}(_0xde08,0x135));var _0x8de0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde08[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x8de0('0x0'));exports[_0x8de0('0x1')]=function(){return function(){return client['Request'](_0x8de0('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x8de0('0x3'),_0x8de0('0x4')],'include':[{'model':_0x8de0('0x5'),'as':_0x8de0('0x6'),'attributes':['id','name',_0x8de0('0x7'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 20e41dc..a9e81b7 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 _0xfd8e=['UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport','update','DESC'];(function(_0x51cc1d,_0xaa88ae){var _0x2eb9f2=function(_0x1ca525){while(--_0x1ca525){_0x51cc1d['push'](_0x51cc1d['shift']());}};_0x2eb9f2(++_0xaa88ae);}(_0xfd8e,0x1dd));var _0xefd8=function(_0x1f2f2d,_0x957e0d){_0x1f2f2d=_0x1f2f2d-0x0;var _0x35ec86=_0xfd8e[_0x1f2f2d];return _0x35ec86;};'use strict';var client=require(_0xefd8('0x0'));exports[_0xefd8('0x1')]=function(_0x22ec69){return client[_0xefd8('0x2')](_0xefd8('0x3'),{'body':_0x22ec69,'log':'CreateFaxQueueReport'});};exports[_0xefd8('0x4')]=function(_0x1ff4bc,_0x246a31){return client[_0xefd8('0x2')]('UpdateFaxQueueReport',{'body':_0x246a31,'options':{'where':{'uniqueid':_0x1ff4bc},'order':[['id',_0xefd8('0x5')]],'limit':0x1},'log':_0xefd8('0x6')});}; \ No newline at end of file +var _0xb55f=['DESC','create','Request','CreateFaxQueueReport','UpdateFaxQueueReport'];(function(_0x255857,_0x3169c1){var _0x475875=function(_0x598903){while(--_0x598903){_0x255857['push'](_0x255857['shift']());}};_0x475875(++_0x3169c1);}(_0xb55f,0x15f));var _0xfb55=function(_0x56f49f,_0x584970){_0x56f49f=_0x56f49f-0x0;var _0x6d9e13=_0xb55f[_0x56f49f];return _0x6d9e13;};'use strict';var client=require('../client');exports[_0xfb55('0x0')]=function(_0x19692a){return client[_0xfb55('0x1')](_0xfb55('0x2'),{'body':_0x19692a,'log':_0xfb55('0x2')});};exports['update']=function(_0x13770c,_0x333ea5){return client[_0xfb55('0x1')](_0xfb55('0x3'),{'body':_0x333ea5,'options':{'where':{'uniqueid':_0x13770c},'order':[['id',_0xfb55('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index f362f04..b623314 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 _0x46f5=['../client','Request','GetInterval','Interval','Intervals','interval'];(function(_0x278be9,_0x3e0882){var _0x2a1442=function(_0x46b53d){while(--_0x46b53d){_0x278be9['push'](_0x278be9['shift']());}};_0x2a1442(++_0x3e0882);}(_0x46f5,0x9c));var _0x546f=function(_0x3df8b7,_0x49043d){_0x3df8b7=_0x3df8b7-0x0;var _0x11900e=_0x46f5[_0x3df8b7];return _0x11900e;};'use strict';var client=require(_0x546f('0x0'));exports['getIntervals']=function(){return function(){return client[_0x546f('0x1')](_0x546f('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x546f('0x3'),'as':_0x546f('0x4'),'attributes':['id','name',_0x546f('0x5')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x7b72=['Request','GetInterval','name','Interval','interval','../client','getIntervals'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7b72,0x171));var _0x27b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7b72[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x27b7('0x0'));exports[_0x27b7('0x1')]=function(){return function(){return client[_0x27b7('0x2')](_0x27b7('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x27b7('0x4')],'include':[{'model':_0x27b7('0x5'),'as':'Intervals','attributes':['id',_0x27b7('0x4'),_0x27b7('0x6')]}]},'log':_0x27b7('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index be385d2..6db93bd 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 _0x36ee=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','Request','UpdateMailInteraction'];(function(_0x339976,_0x9f0da6){var _0x4101f6=function(_0x4fbc2f){while(--_0x4fbc2f){_0x339976['push'](_0x339976['shift']());}};_0x4101f6(++_0x9f0da6);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'use strict';var client=require('../client');exports['update']=function(_0x34e33c,_0x521ff3){return client[_0xe36e('0x0')](_0xe36e('0x1'),{'body':_0x521ff3,'options':{'where':{'id':_0x34e33c}},'log':_0xe36e('0x2')});};exports[_0xe36e('0x3')]=function(_0x567a84,_0x1118af){return client[_0xe36e('0x0')](_0xe36e('0x4'),{'body':_0x1118af,'options':{'where':{'id':_0x567a84}},'log':_0xe36e('0x5')});}; \ No newline at end of file +var _0xb44a=['AddTagsToMailInteraction','addTagsToChatInteraction','Request','addTags'];(function(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0xb44a,0x1c2));var _0xab44=function(_0x1ffff7,_0x2f9ff6){_0x1ffff7=_0x1ffff7-0x0;var _0x49d017=_0xb44a[_0x1ffff7];return _0x49d017;};'use strict';var client=require('../client');exports['update']=function(_0x93bb2f,_0x492c1a){return client[_0xab44('0x0')]('UpdateMailInteraction',{'body':_0x492c1a,'options':{'where':{'id':_0x93bb2f}},'log':'updateMailInteraction'});};exports[_0xab44('0x1')]=function(_0x5c93b4,_0x1b9e05){return client[_0xab44('0x0')](_0xab44('0x2'),{'body':_0x1b9e05,'options':{'where':{'id':_0x5c93b4}},'log':_0xab44('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 6a3ddfa..8c1224f 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 _0x0bd5=['create','Request','createMailMessage','../client'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0bd5,0x17b));var _0x50bd=function(_0x2aec64,_0x924c87){_0x2aec64=_0x2aec64-0x0;var _0x4a95b2=_0x0bd5[_0x2aec64];return _0x4a95b2;};'use strict';var client=require(_0x50bd('0x0'));exports[_0x50bd('0x1')]=function(_0x14c449){return client[_0x50bd('0x2')]('CreateMailMessage',{'body':_0x14c449,'log':_0x50bd('0x3')});}; \ No newline at end of file +var _0x3bde=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x2556e2,_0x2380d5){var _0x40fdb1=function(_0x3407a1){while(--_0x3407a1){_0x2556e2['push'](_0x2556e2['shift']());}};_0x40fdb1(++_0x2380d5);}(_0x3bde,0x110));var _0xe3bd=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x3bde[_0x20589d];return _0x422de9;};'use strict';var client=require(_0xe3bd('0x0'));exports[_0xe3bd('0x1')]=function(_0x3abb93){return client[_0xe3bd('0x2')](_0xe3bd('0x3'),{'body':_0x3abb93,'log':_0xe3bd('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 445d2bd..3880990 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 _0xb4b1=['online','mailPause','../client','getMailQueues','GetMailQueue','name','timeout','strategy','Agents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4b1,0x13d));var _0x1b4b=function(_0x2dd604,_0x263023){_0x2dd604=_0x2dd604-0x0;var _0x46f8d6=_0xb4b1[_0x2dd604];return _0x46f8d6;};'use strict';var client=require(_0x1b4b('0x0'));exports[_0x1b4b('0x1')]=function(){return function(){return client['Request'](_0x1b4b('0x2'),{'options':{'raw':![],'attributes':['id',_0x1b4b('0x3'),_0x1b4b('0x4'),_0x1b4b('0x5')],'include':[{'model':'User','as':_0x1b4b('0x6'),'attributes':['id',_0x1b4b('0x3'),_0x1b4b('0x7'),_0x1b4b('0x8')]}]},'log':_0x1b4b('0x1')});};}; \ No newline at end of file +var _0xaba8=['online','mailPause','getMailQueues','../client','GetMailQueue','name','timeout','strategy','User','Agents'];(function(_0x44676a,_0x3e7b88){var _0x588695=function(_0x168ed1){while(--_0x168ed1){_0x44676a['push'](_0x44676a['shift']());}};_0x588695(++_0x3e7b88);}(_0xaba8,0x12f));var _0x8aba=function(_0x300667,_0x1eb3c8){_0x300667=_0x300667-0x0;var _0x4ebe59=_0xaba8[_0x300667];return _0x4ebe59;};'use strict';var client=require(_0x8aba('0x0'));exports['getMailQueues']=function(){return function(){return client['Request'](_0x8aba('0x1'),{'options':{'raw':![],'attributes':['id',_0x8aba('0x2'),_0x8aba('0x3'),_0x8aba('0x4')],'include':[{'model':_0x8aba('0x5'),'as':_0x8aba('0x6'),'attributes':['id',_0x8aba('0x2'),_0x8aba('0x7'),_0x8aba('0x8')]}]},'log':_0x8aba('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index f824345..4d5561a 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 _0xd629=['Request','CreateMailQueueReport','update','DESC','UpdateMailQueueReport','../client','create'];(function(_0x5ee217,_0x4877a4){var _0x19fac0=function(_0x2c9270){while(--_0x2c9270){_0x5ee217['push'](_0x5ee217['shift']());}};_0x19fac0(++_0x4877a4);}(_0xd629,0x116));var _0x9d62=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xd629[_0x486f4a];return _0x135d99;};'use strict';var client=require(_0x9d62('0x0'));exports[_0x9d62('0x1')]=function(_0x1c350e){return client[_0x9d62('0x2')](_0x9d62('0x3'),{'body':_0x1c350e,'log':'CreateMailQueueReport'});};exports[_0x9d62('0x4')]=function(_0xf1bc4d,_0x10a140){return client[_0x9d62('0x2')]('UpdateMailQueueReport',{'body':_0x10a140,'options':{'where':{'uniqueid':_0xf1bc4d},'order':[['id',_0x9d62('0x5')]],'limit':0x1},'log':_0x9d62('0x6')});}; \ No newline at end of file +var _0xc3da=['CreateMailQueueReport','UpdateMailQueueReport','DESC','Request'];(function(_0x4e3cd2,_0x525e3a){var _0x39db34=function(_0x5b52da){while(--_0x5b52da){_0x4e3cd2['push'](_0x4e3cd2['shift']());}};_0x39db34(++_0x525e3a);}(_0xc3da,0x1cb));var _0xac3d=function(_0x36adf0,_0x1c5ba0){_0x36adf0=_0x36adf0-0x0;var _0x26c05d=_0xc3da[_0x36adf0];return _0x26c05d;};'use strict';var client=require('../client');exports['create']=function(_0x339cb6){return client[_0xac3d('0x0')](_0xac3d('0x1'),{'body':_0x339cb6,'log':_0xac3d('0x1')});};exports['update']=function(_0x334927,_0xba9948){return client[_0xac3d('0x0')](_0xac3d('0x2'),{'body':_0xba9948,'options':{'where':{'uniqueid':_0x334927},'order':[['id',_0xac3d('0x3')]],'limit':0x1},'log':_0xac3d('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 446aa1d..c0298a8 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 _0x442f=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x521da0,_0x4986a4){var _0x159674=function(_0x59ae8a){while(--_0x59ae8a){_0x521da0['push'](_0x521da0['shift']());}};_0x159674(++_0x4986a4);}(_0x442f,0xbe));var _0xf442=function(_0x2b49ae,_0x2da2bb){_0x2b49ae=_0x2b49ae-0x0;var _0x423ce6=_0x442f[_0x2b49ae];return _0x423ce6;};'use strict';var client=require(_0xf442('0x0'));exports[_0xf442('0x1')]=function(_0x4427de,_0x252571){return client[_0xf442('0x2')](_0xf442('0x3'),{'body':_0x252571,'options':{'where':{'id':_0x4427de}},'log':_0xf442('0x4')});};exports[_0xf442('0x5')]=function(_0x4a4b36,_0x2c3f0b){return client[_0xf442('0x2')](_0xf442('0x6'),{'body':_0x2c3f0b,'options':{'where':{'id':_0x4a4b36}},'log':_0xf442('0x7')});}; \ No newline at end of file +var _0xcfe7=['update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x2ea900,_0xd4c112){var _0x20ab6e=function(_0x4cc0ca){while(--_0x4cc0ca){_0x2ea900['push'](_0x2ea900['shift']());}};_0x20ab6e(++_0xd4c112);}(_0xcfe7,0xfb));var _0x7cfe=function(_0x475e5e,_0x307501){_0x475e5e=_0x475e5e-0x0;var _0x1719bd=_0xcfe7[_0x475e5e];return _0x1719bd;};'use strict';var client=require(_0x7cfe('0x0'));exports[_0x7cfe('0x1')]=function(_0x4f85ea,_0x1245ce){return client[_0x7cfe('0x2')]('UpdateOpenchannelInteraction',{'body':_0x1245ce,'options':{'where':{'id':_0x4f85ea}},'log':_0x7cfe('0x3')});};exports[_0x7cfe('0x4')]=function(_0x6e88cd,_0x47d8e7){return client[_0x7cfe('0x2')](_0x7cfe('0x5'),{'body':_0x47d8e7,'options':{'where':{'id':_0x6e88cd}},'log':_0x7cfe('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 7056089..01bbcd9 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 _0xd08b=['../client','create','Request'];(function(_0x5d84fb,_0x29ae84){var _0x1c6145=function(_0x15b6a7){while(--_0x15b6a7){_0x5d84fb['push'](_0x5d84fb['shift']());}};_0x1c6145(++_0x29ae84);}(_0xd08b,0xdb));var _0xbd08=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0xd08b[_0x22b39b];return _0x280e1d;};'use strict';var client=require(_0xbd08('0x0'));exports[_0xbd08('0x1')]=function(_0x144836){return client[_0xbd08('0x2')]('CreateOpenchannelMessage',{'body':_0x144836,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xe068=['create','Request','CreateOpenchannelMessage','../client'];(function(_0x1649e6,_0xc5c614){var _0x19d346=function(_0x56c631){while(--_0x56c631){_0x1649e6['push'](_0x1649e6['shift']());}};_0x19d346(++_0xc5c614);}(_0xe068,0xbf));var _0x8e06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe068[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x8e06('0x0'));exports[_0x8e06('0x1')]=function(_0x2114c4){return client[_0x8e06('0x2')](_0x8e06('0x3'),{'body':_0x2114c4,'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 88f0de7..53a1070 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 _0x07e5=['name','timeout','strategy','User','online','openchannelPause','getOpenchannelQueues','../client','Request','GetOpenchannelQueue'];(function(_0x5608ce,_0x43436d){var _0x2eda3a=function(_0xd2ebfb){while(--_0xd2ebfb){_0x5608ce['push'](_0x5608ce['shift']());}};_0x2eda3a(++_0x43436d);}(_0x07e5,0xc5));var _0x507e=function(_0x248f22,_0xe4bd18){_0x248f22=_0x248f22-0x0;var _0x22af03=_0x07e5[_0x248f22];return _0x22af03;};'use strict';var client=require(_0x507e('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x507e('0x1')](_0x507e('0x2'),{'options':{'raw':![],'attributes':['id',_0x507e('0x3'),_0x507e('0x4'),_0x507e('0x5')],'include':[{'model':_0x507e('0x6'),'as':'Agents','attributes':['id',_0x507e('0x3'),_0x507e('0x7'),_0x507e('0x8')]}]},'log':_0x507e('0x9')});};}; \ No newline at end of file +var _0x3e0d=['openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','Agents','online'];(function(_0x5dd661,_0xbfefab){var _0x47672e=function(_0x50d5e5){while(--_0x50d5e5){_0x5dd661['push'](_0x5dd661['shift']());}};_0x47672e(++_0xbfefab);}(_0x3e0d,0x1cc));var _0xd3e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e0d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xd3e0('0x0')]=function(){return function(){return client[_0xd3e0('0x1')](_0xd3e0('0x2'),{'options':{'raw':![],'attributes':['id',_0xd3e0('0x3'),_0xd3e0('0x4'),_0xd3e0('0x5')],'include':[{'model':'User','as':_0xd3e0('0x6'),'attributes':['id',_0xd3e0('0x3'),_0xd3e0('0x7'),_0xd3e0('0x8')]}]},'log':_0xd3e0('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index f6ed5b6..0f49f23 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 _0xa67e=['../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa67e,0x19d));var _0xea67=function(_0x274dfe,_0xd2119d){_0x274dfe=_0x274dfe-0x0;var _0x18914d=_0xa67e[_0x274dfe];return _0x18914d;};'use strict';var client=require(_0xea67('0x0'));exports[_0xea67('0x1')]=function(_0xccf73c){return client[_0xea67('0x2')](_0xea67('0x3'),{'body':_0xccf73c,'log':'CreateOpenchannelQueueReport'});};exports[_0xea67('0x4')]=function(_0x10cae3,_0x5e881a){return client[_0xea67('0x2')](_0xea67('0x5'),{'body':_0x5e881a,'options':{'where':{'uniqueid':_0x10cae3},'order':[['id',_0xea67('0x6')]],'limit':0x1},'log':_0xea67('0x5')});}; \ No newline at end of file +var _0x80db=['DESC','../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x167b74,_0x14d016){var _0x497ead=function(_0x207c43){while(--_0x207c43){_0x167b74['push'](_0x167b74['shift']());}};_0x497ead(++_0x14d016);}(_0x80db,0x174));var _0xb80d=function(_0xee89ad,_0x39ca00){_0xee89ad=_0xee89ad-0x0;var _0x16c4bd=_0x80db[_0xee89ad];return _0x16c4bd;};'use strict';var client=require(_0xb80d('0x0'));exports[_0xb80d('0x1')]=function(_0x5d5616){return client[_0xb80d('0x2')](_0xb80d('0x3'),{'body':_0x5d5616,'log':'CreateOpenchannelQueueReport'});};exports[_0xb80d('0x4')]=function(_0x97df,_0x33ebd2){return client[_0xb80d('0x2')](_0xb80d('0x5'),{'body':_0x33ebd2,'options':{'where':{'uniqueid':_0x97df},'order':[['id',_0xb80d('0x6')]],'limit':0x1},'log':_0xb80d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 687af1e..eb0ac0b 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 _0xe94a=['update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x364a36,_0x1e2677){var _0x5cd6fa=function(_0x58d692){while(--_0x58d692){_0x364a36['push'](_0x364a36['shift']());}};_0x5cd6fa(++_0x1e2677);}(_0xe94a,0x1c7));var _0xae94=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0xe94a[_0xfbdff6];return _0x4cb9be;};'use strict';var client=require(_0xae94('0x0'));exports[_0xae94('0x1')]=function(_0x1735f9,_0x59a458){return client[_0xae94('0x2')](_0xae94('0x3'),{'body':_0x59a458,'options':{'where':{'id':_0x1735f9}},'log':_0xae94('0x4')});};exports[_0xae94('0x5')]=function(_0x3bf666,_0xf48ae1){return client['Request'](_0xae94('0x6'),{'body':_0xf48ae1,'options':{'where':{'id':_0x3bf666}},'log':_0xae94('0x7')});}; \ No newline at end of file +var _0xb7fc=['UpdateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request'];(function(_0x550f66,_0x18bbbd){var _0x2ea2a1=function(_0x12687a){while(--_0x12687a){_0x550f66['push'](_0x550f66['shift']());}};_0x2ea2a1(++_0x18bbbd);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x49c6cc,_0x308bdb){_0x49c6cc=_0x49c6cc-0x0;var _0x22e239=_0xb7fc[_0x49c6cc];return _0x22e239;};'use strict';var client=require(_0xcb7f('0x0'));exports['update']=function(_0x52c9f2,_0x189517){return client[_0xcb7f('0x1')](_0xcb7f('0x2'),{'body':_0x189517,'options':{'where':{'id':_0x52c9f2}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x23c877,_0x28247a){return client[_0xcb7f('0x1')](_0xcb7f('0x3'),{'body':_0x28247a,'options':{'where':{'id':_0x23c877}},'log':_0xcb7f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 9926998..90c9439 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 _0xfdb4=['CreateSmsMessage','../client','create'];(function(_0x49a896,_0x27322e){var _0x463840=function(_0x357622){while(--_0x357622){_0x49a896['push'](_0x49a896['shift']());}};_0x463840(++_0x27322e);}(_0xfdb4,0x1db));var _0x4fdb=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xfdb4[_0x456fb1];return _0x4083d6;};'use strict';var client=require(_0x4fdb('0x0'));exports[_0x4fdb('0x1')]=function(_0x348988){return client['Request'](_0x4fdb('0x2'),{'body':_0x348988,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x28e2=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x28e2,0x75));var _0x228e=function(_0x448e33,_0x191c5){_0x448e33=_0x448e33-0x0;var _0x2d35a1=_0x28e2[_0x448e33];return _0x2d35a1;};'use strict';var client=require(_0x228e('0x0'));exports[_0x228e('0x1')]=function(_0x22fb96){return client[_0x228e('0x2')](_0x228e('0x3'),{'body':_0x22fb96,'log':_0x228e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 61c951d..122c43a 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 _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x3d1f21,_0x167f7e){var _0x54f931=function(_0x2a4f49){while(--_0x2a4f49){_0x3d1f21['push'](_0x3d1f21['shift']());}};_0x54f931(++_0x167f7e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xcb91[_0x4a747d];return _0x3a5b5c;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x8d475,_0xb5fb9c){var _0x1b7b21=function(_0x33cba3){while(--_0x33cba3){_0x8d475['push'](_0x8d475['shift']());}};_0x1b7b21(++_0xb5fb9c);}(_0xe706,0xa3));var _0x6e70=function(_0x32443e,_0x2d7d32){_0x32443e=_0x32443e-0x0;var _0x2aa089=_0xe706[_0x32443e];return _0x2aa089;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index f6df9b8..f80ac2c 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x452f5b,_0x5389d1){var _0x33e5e2=function(_0x34b282){while(--_0x34b282){_0x452f5b['push'](_0x452f5b['shift']());}};_0x33e5e2(++_0x5389d1);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});}; \ No newline at end of file +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x30f6f6,_0x5f0f90){var _0x43b46a=function(_0x10004e){while(--_0x10004e){_0x30f6f6['push'](_0x30f6f6['shift']());}};_0x43b46a(++_0x5f0f90);}(_0x55ca,0x126));var _0xa55c=function(_0x3be2e2,_0x5c166d){_0x3be2e2=_0x3be2e2-0x0;var _0x53b9c5=_0x55ca[_0x3be2e2];return _0x53b9c5;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 84a71e6..6244e8a 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(_0x349120,_0x219139){var _0x494325=function(_0x89c697){while(--_0x89c697){_0x349120['push'](_0x349120['shift']());}};_0x494325(++_0x219139);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x8d5cb0,_0x247170){var _0x4e1a60=function(_0x43ac11){while(--_0x43ac11){_0x8d5cb0['push'](_0x8d5cb0['shift']());}};_0x4e1a60(++_0x247170);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 1b28420..76710b7 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 _0xd9fb=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','../client','update','Request'];(function(_0x5a9141,_0x2ccd7f){var _0x1a18a8=function(_0x3c3815){while(--_0x3c3815){_0x5a9141['push'](_0x5a9141['shift']());}};_0x1a18a8(++_0x2ccd7f);}(_0xd9fb,0x189));var _0xbd9f=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xd9fb[_0x138adb];return _0x1b27f2;};'use strict';var client=require(_0xbd9f('0x0'));exports[_0xbd9f('0x1')]=function(_0x288314,_0x1eeb46){return client[_0xbd9f('0x2')](_0xbd9f('0x3'),{'body':_0x1eeb46,'options':{'where':{'id':_0x288314}},'log':_0xbd9f('0x4')});};exports['addTags']=function(_0x2d4213,_0xf146bc){return client['Request'](_0xbd9f('0x5'),{'body':_0xf146bc,'options':{'where':{'id':_0x2d4213}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x68fd=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x2b0bc2,_0x4331f5){var _0x56e5b9=function(_0x4c1b06){while(--_0x4c1b06){_0x2b0bc2['push'](_0x2b0bc2['shift']());}};_0x56e5b9(++_0x4331f5);}(_0x68fd,0x1e9));var _0xd68f=function(_0x2634eb,_0x29e069){_0x2634eb=_0x2634eb-0x0;var _0x3a9456=_0x68fd[_0x2634eb];return _0x3a9456;};'use strict';var client=require(_0xd68f('0x0'));exports['update']=function(_0x17591d,_0x1492a9){return client['Request'](_0xd68f('0x1'),{'body':_0x1492a9,'options':{'where':{'id':_0x17591d}},'log':_0xd68f('0x2')});};exports[_0xd68f('0x3')]=function(_0x3e5e78,_0x37c481){return client[_0xd68f('0x4')](_0xd68f('0x5'),{'body':_0x37c481,'options':{'where':{'id':_0x3e5e78}},'log':_0xd68f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index c267779..9c9279b 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 _0xbb98=['../client','create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x1256d5,_0x5862b8){var _0x246866=function(_0x3da346){while(--_0x3da346){_0x1256d5['push'](_0x1256d5['shift']());}};_0x246866(++_0x5862b8);}(_0xbb98,0x140));var _0x8bb9=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0xbb98[_0x151721];return _0x2deaa7;};'use strict';var client=require(_0x8bb9('0x0'));exports[_0x8bb9('0x1')]=function(_0x19bd08){return client[_0x8bb9('0x2')](_0x8bb9('0x3'),{'body':_0x19bd08,'log':_0x8bb9('0x4')});}; \ No newline at end of file +var _0xd32e=['createWhatsappMessage','../client','create'];(function(_0x3f644f,_0x2e47d0){var _0x4de8ab=function(_0x2c03ad){while(--_0x2c03ad){_0x3f644f['push'](_0x3f644f['shift']());}};_0x4de8ab(++_0x2e47d0);}(_0xd32e,0x1c3));var _0xed32=function(_0x286ba3,_0x45d1c3){_0x286ba3=_0x286ba3-0x0;var _0x4f03ac=_0xd32e[_0x286ba3];return _0x4f03ac;};'use strict';var client=require(_0xed32('0x0'));exports[_0xed32('0x1')]=function(_0x3e3449){return client['Request']('CreateWhatsappMessage',{'body':_0x3e3449,'log':_0xed32('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 589e190..f6267f7 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 _0x3eaa=['whatsappPause','getWhatsappQueues','../client','GetWhatsappQueue','name','strategy','User','online'];(function(_0x5733e1,_0x45d453){var _0x1ec809=function(_0x427a9e){while(--_0x427a9e){_0x5733e1['push'](_0x5733e1['shift']());}};_0x1ec809(++_0x45d453);}(_0x3eaa,0xaa));var _0xa3ea=function(_0x47e5c0,_0xc5fc91){_0x47e5c0=_0x47e5c0-0x0;var _0x2c8206=_0x3eaa[_0x47e5c0];return _0x2c8206;};'use strict';var client=require(_0xa3ea('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0xa3ea('0x1'),{'options':{'raw':![],'attributes':['id',_0xa3ea('0x2'),'timeout',_0xa3ea('0x3')],'include':[{'model':_0xa3ea('0x4'),'as':'Agents','attributes':['id',_0xa3ea('0x2'),_0xa3ea('0x5'),_0xa3ea('0x6')]}]},'log':_0xa3ea('0x7')});};}; \ No newline at end of file +var _0xc3f2=['../client','getWhatsappQueues','timeout','strategy','User','whatsappPause'];(function(_0x4b2dc8,_0x1e0af9){var _0x50d88f=function(_0x1b6288){while(--_0x1b6288){_0x4b2dc8['push'](_0x4b2dc8['shift']());}};_0x50d88f(++_0x1e0af9);}(_0xc3f2,0x6c));var _0x2c3f=function(_0x1844c9,_0x5856f2){_0x1844c9=_0x1844c9-0x0;var _0xa5cfde=_0xc3f2[_0x1844c9];return _0xa5cfde;};'use strict';var client=require(_0x2c3f('0x0'));exports[_0x2c3f('0x1')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name',_0x2c3f('0x2'),_0x2c3f('0x3')],'include':[{'model':_0x2c3f('0x4'),'as':'Agents','attributes':['id','name','online',_0x2c3f('0x5')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 0f1325b..75ec1f0 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 _0x87dc=['update','UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x87dc,0x11c));var _0xc87d=function(_0x1819d1,_0x6151eb){_0x1819d1=_0x1819d1-0x0;var _0x59f1a9=_0x87dc[_0x1819d1];return _0x59f1a9;};'use strict';var client=require(_0xc87d('0x0'));exports[_0xc87d('0x1')]=function(_0x45146b){return client[_0xc87d('0x2')](_0xc87d('0x3'),{'body':_0x45146b,'log':_0xc87d('0x3')});};exports[_0xc87d('0x4')]=function(_0x4f005b,_0x2b3731){return client[_0xc87d('0x2')]('UpdateWhatsappQueueReport',{'body':_0x2b3731,'options':{'where':{'uniqueid':_0x4f005b},'order':[['id','DESC']],'limit':0x1},'log':_0xc87d('0x5')});}; \ No newline at end of file +var _0x47d0=['UpdateWhatsappQueueReport','../client','Request','CreateWhatsappQueueReport','update'];(function(_0x366efc,_0x549882){var _0x118d3f=function(_0x2b35f0){while(--_0x2b35f0){_0x366efc['push'](_0x366efc['shift']());}};_0x118d3f(++_0x549882);}(_0x47d0,0x137));var _0x047d=function(_0x35c5f5,_0x3e52a0){_0x35c5f5=_0x35c5f5-0x0;var _0x280568=_0x47d0[_0x35c5f5];return _0x280568;};'use strict';var client=require(_0x047d('0x0'));exports['create']=function(_0x37740c){return client[_0x047d('0x1')](_0x047d('0x2'),{'body':_0x37740c,'log':'CreateWhatsappQueueReport'});};exports[_0x047d('0x3')]=function(_0x337b4a,_0x68af79){return client[_0x047d('0x1')]('UpdateWhatsappQueueReport',{'body':_0x68af79,'options':{'where':{'uniqueid':_0x337b4a},'order':[['id','DESC']],'limit':0x1},'log':_0x047d('0x4')});}; \ 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 c6db771..164d142 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 _0xf879=['next','agent','log','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','agents','atimeout','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END'];(function(_0x1149e3,_0x1fe79f){var _0x2f8c48=function(_0x2467ff){while(--_0x2467ff){_0x1149e3['push'](_0x1149e3['shift']());}};_0x2f8c48(++_0x1fe79f);}(_0xf879,0xd1));var _0x9f87=function(_0xc813eb,_0x50ed60){_0xc813eb=_0xc813eb-0x0;var _0x3368b5=_0xf879[_0xc813eb];return _0x3368b5;};'use strict';var schema=require(_0x9f87('0x0'));var _=require(_0x9f87('0x1'));var util=require('util');var seqqueue=require(_0x9f87('0x2'));var logger=require('../../../../config/logger')(_0x9f87('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x9f87('0x4'),'required':!![],'message':_0x9f87('0x5')},'timeout':{'type':_0x9f87('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x4b8214,_0xbb0fb2,_0x68c613){return logger[_0x9f87('0x7')](util['format'](_0x9f87('0x8'),_0x4b8214,_0xbb0fb2['name'],_0x68c613));}function handleFindAgent(_0x57e871){return function(_0x2f72c6){return _0x2f72c6[_0x9f87('0x9')][_0x9f87('0xa')]()===_0x57e871[_0x9f87('0xa')]();};}exports[_0x9f87('0xb')]=function(_0x2c4207,_0x387d9c,_0x58ea47,_0x2a1cde){return function(_0x50a331){try{var _0x45aaf2={'name':_0x387d9c[0x0],'timeout':_0x387d9c[0x1]};var _0x10aa20=queue[_0x9f87('0x0')](_0x45aaf2,{'typecast':!![]});if(_0x10aa20[_0x9f87('0xc')]){logger[_0x9f87('0xd')](_0x9f87('0xe'),_0x2c4207,_[_0x9f87('0xf')](_0x10aa20,_0x9f87('0x10'))[_0x9f87('0x11')](',\x20'));_0x50a331[_0x9f87('0x12')]();}else{var _0x191ec4=_['find'](_0x58ea47[_0x9f87('0x13')],handleFindAgent(_0x45aaf2[_0x9f87('0x9')]));if(_0x191ec4){var _0x1b564a=(_0x45aaf2['timeout']||0xa)*0x3e8;var _0x642bc0,_0x217390;var _0x31a16b=seqqueue['createQueue'](_0x1b564a);_0x31a16b['id']=_0x2c4207;_0x31a16b[_0x9f87('0x14')]=_0x1b564a;_0x31a16b[_0x9f87('0x15')]=_0x2a1cde[_0x9f87('0x15')];writeLog(_0x2c4207,_0x191ec4,util[_0x9f87('0x16')](_0x9f87('0x17'),_0x1b564a));_0x58ea47[_0x9f87('0x18')][_0x2c4207]['on'](_0x9f87('0x19'),function(){logger[_0x9f87('0x7')](_0x9f87('0x1a'),_0x2c4207);clearTimeout(_0x217390);_0x217390=undefined;_0x31a16b[_0x9f87('0x1b')]();if(_0x58ea47['rules'][_0x2c4207]){delete _0x58ea47[_0x9f87('0x18')][_0x2c4207];}_0x50a331[_0x9f87('0x12')]();});_0x58ea47[_0x9f87('0x18')][_0x2c4207]['on']('complete',function(){if(_0x58ea47['rules'][_0x2c4207]){delete _0x58ea47['rules'][_0x2c4207];}});_0x217390=setTimeout(function(){logger[_0x9f87('0x7')](_0x9f87('0x1c'),_0x2c4207);clearTimeout(_0x217390);_0x31a16b[_0x9f87('0x1b')]();_0x50a331[_0x9f87('0x1d')]();},_0x1b564a);strategy[_0x9f87('0x1e')](_0x31a16b,_0x191ec4,_0x58ea47,_0x2a1cde);}else{logger[_0x9f87('0xd')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x2c4207,_0x45aaf2[_0x9f87('0x9')]);_0x50a331[_0x9f87('0x12')]();}}}catch(_0x11bf06){console[_0x9f87('0x1f')](_0x11bf06);logger['error'](_0x9f87('0x20'),_0x2c4207,_0x11bf06[_0x9f87('0x21')]);_0x50a331[_0x9f87('0x12')]();}};}; \ No newline at end of file +var _0xf256=['stop','find','timeout','createQueue','atimeout','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','lodash','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','info','format','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','join'];(function(_0x3882b5,_0x384ea5){var _0x34f021=function(_0xc7811d){while(--_0xc7811d){_0x3882b5['push'](_0x3882b5['shift']());}};_0x34f021(++_0x384ea5);}(_0xf256,0x1cf));var _0x6f25=function(_0x1e2b57,_0x5e4c6c){_0x1e2b57=_0x1e2b57-0x0;var _0x4a9a59=_0xf256[_0x1e2b57];return _0x4a9a59;};'use strict';var schema=require('validate');var _=require(_0x6f25('0x0'));var util=require('util');var seqqueue=require(_0x6f25('0x1'));var logger=require(_0x6f25('0x2'))('routing');var strategy=require(_0x6f25('0x3'));var queue=schema({'name':{'type':_0x6f25('0x4'),'required':!![],'message':_0x6f25('0x5')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x21df3a,_0x2579c8,_0x4b689c){return logger[_0x6f25('0x6')](util[_0x6f25('0x7')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x21df3a,_0x2579c8[_0x6f25('0x8')],_0x4b689c));}function handleFindAgent(_0x296edf){return function(_0x2eb698){return _0x2eb698[_0x6f25('0x8')][_0x6f25('0x9')]()===_0x296edf['toLowerCase']();};}exports[_0x6f25('0xa')]=function(_0x989f66,_0x4b2d65,_0x5849d9,_0x1b0619){return function(_0x23ba37){try{var _0xdc0f06={'name':_0x4b2d65[0x0],'timeout':_0x4b2d65[0x1]};var _0x74a9fe=queue[_0x6f25('0xb')](_0xdc0f06,{'typecast':!![]});if(_0x74a9fe[_0x6f25('0xc')]){logger[_0x6f25('0xd')](_0x6f25('0xe'),_0x989f66,_[_0x6f25('0xf')](_0x74a9fe,'message')[_0x6f25('0x10')](',\x20'));_0x23ba37[_0x6f25('0x11')]();}else{var _0x2e9765=_[_0x6f25('0x12')](_0x5849d9['agents'],handleFindAgent(_0xdc0f06[_0x6f25('0x8')]));if(_0x2e9765){var _0x46c077=(_0xdc0f06[_0x6f25('0x13')]||0xa)*0x3e8;var _0x410cfc,_0x19ded2;var _0x17a0f0=seqqueue[_0x6f25('0x14')](_0x46c077);_0x17a0f0['id']=_0x989f66;_0x17a0f0[_0x6f25('0x15')]=_0x46c077;_0x17a0f0['channel']=_0x1b0619['channel'];writeLog(_0x989f66,_0x2e9765,util[_0x6f25('0x7')](_0x6f25('0x16'),_0x46c077));_0x5849d9[_0x6f25('0x17')][_0x989f66]['on'](_0x6f25('0x18'),function(){logger[_0x6f25('0x6')](_0x6f25('0x19'),_0x989f66);clearTimeout(_0x19ded2);_0x19ded2=undefined;_0x17a0f0['close']();if(_0x5849d9[_0x6f25('0x17')][_0x989f66]){delete _0x5849d9['rules'][_0x989f66];}_0x23ba37[_0x6f25('0x11')]();});_0x5849d9[_0x6f25('0x17')][_0x989f66]['on'](_0x6f25('0x1a'),function(){if(_0x5849d9[_0x6f25('0x17')][_0x989f66]){delete _0x5849d9[_0x6f25('0x17')][_0x989f66];}});_0x19ded2=setTimeout(function(){logger[_0x6f25('0x6')]('[%s][AGENT]\x20ROUTING\x20END',_0x989f66);clearTimeout(_0x19ded2);_0x17a0f0['close']();_0x23ba37[_0x6f25('0x1b')]();},_0x46c077);strategy[_0x6f25('0x1c')](_0x17a0f0,_0x2e9765,_0x5849d9,_0x1b0619);}else{logger['error'](_0x6f25('0x1d'),_0x989f66,_0xdc0f06[_0x6f25('0x8')]);_0x23ba37['stop']();}}}catch(_0x546304){console[_0x6f25('0x1e')](_0x546304);logger[_0x6f25('0xd')](_0x6f25('0x1f'),_0x989f66,_0x546304['stack']);_0x23ba37[_0x6f25('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 2030d21..0123c39 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 _0x8ef2=['providerResponse','stringify','dialogState','Failed','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','interaction','ChatWebsiteId','account','upperFirst','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','toString','postText','message','amazonlex'];(function(_0x588e59,_0x3f5e39){var _0x992ca1=function(_0x323c0f){while(--_0x323c0f){_0x588e59['push'](_0x588e59['shift']());}};_0x992ca1(++_0x3f5e39);}(_0x8ef2,0x1e4));var _0x28ef=function(_0x48845d,_0x4338c2){_0x48845d=_0x48845d-0x0;var _0x5bad7d=_0x8ef2[_0x48845d];return _0x5bad7d;};'use strict';var _=require(_0x28ef('0x0'));var moment=require(_0x28ef('0x1'));var AWS=require(_0x28ef('0x2'));var utils=require('./utils');var logger=require(_0x28ef('0x3'))(_0x28ef('0x4'));var rpc={'chatMessage':require(_0x28ef('0x5')),'openchannelMessage':require(_0x28ef('0x6')),'mailMessage':require(_0x28ef('0x7')),'smsMessage':require(_0x28ef('0x8')),'faxMessage':require(_0x28ef('0x9')),'whatsappMessage':require(_0x28ef('0xa'))};exports[_0x28ef('0xb')]=function(_0x45b5a8,_0x2135e3){return function(_0x3d4aa7){try{if(!_[_0x28ef('0xc')](this['interaction']['UserId'])){logger[_0x28ef('0xd')](_0x28ef('0xe'),_0x45b5a8,_0x28ef('0xf'));return _0x3d4aa7[_0x28ef('0x10')]();}var _0x55c682={'ContactId':this[_0x28ef('0x11')]['id'],'sentAt':moment()[_0x28ef('0x12')](_0x28ef('0x13')),'direction':_0x28ef('0x14')};if(this[_0x28ef('0x15')]===_0x28ef('0x16')||this[_0x28ef('0x15')]==='whatsapp'){_0x55c682[_0x28ef('0x17')]=this[_0x28ef('0x18')][_0x28ef('0x17')];}var _0x360507=this[_0x28ef('0x15')];if(_0x360507==='chat'){_0x55c682[_0x28ef('0x19')]=this['account']['id'];}else{_0x55c682[_['upperFirst'](_0x360507)+'AccountId']=this[_0x28ef('0x1a')]['id'];}_0x55c682[_[_0x28ef('0x1b')](_0x360507)+_0x28ef('0x1c')]=this[_0x28ef('0x18')]['id'];if(this[_0x28ef('0x18')]['created']){var _0x38f03b=_0x2135e3[0x4];if(!_[_0x28ef('0x1d')](_0x38f03b)){_0x55c682[_0x28ef('0x1e')]=utils[_0x28ef('0x1f')](_0x38f03b,this);return rpc[_0x360507+_0x28ef('0x20')][_0x28ef('0x21')](_0x55c682)[_0x28ef('0x22')](function(_0x1ff924){logger[_0x28ef('0xd')](_0x28ef('0xe'),_0x45b5a8,_0x55c682[_0x28ef('0x1e')]);})['catch'](function(_0x5cbb1e){logger[_0x28ef('0x23')](_0x28ef('0xe'),_0x45b5a8,JSON['stringify'](_0x5cbb1e));})[_0x28ef('0x24')](function(){logger[_0x28ef('0xd')](_0x28ef('0x25'),_0x45b5a8);_0x3d4aa7[_0x28ef('0x26')]();});}else{logger[_0x28ef('0xd')](_0x28ef('0x27'),_0x45b5a8);_0x3d4aa7[_0x28ef('0x26')]();}}else{var _0x34d738=this;var _0x1b8378=new AWS['LexRuntime']({'accessKeyId':_0x2135e3[0x0],'secretAccessKey':_0x2135e3[0x1],'region':_0x2135e3[0x2]});var _0x331312={'botAlias':'$LATEST','botName':_0x2135e3[0x3],'inputText':this['message'][_0x28ef('0x1e')],'userId':this[_0x28ef('0x15')]+':'+this[_0x28ef('0x18')]['id'][_0x28ef('0x28')]()};_0x1b8378[_0x28ef('0x29')](_0x331312,function(_0x57c1ae,_0x5b78a9){if(_0x57c1ae){logger['error'](_0x28ef('0xe'),_0x45b5a8,_0x57c1ae[_0x28ef('0x2a')]);_0x3d4aa7[_0x28ef('0x10')]();}else if(_0x5b78a9&&_0x5b78a9[_0x28ef('0x2a')]){_0x34d738['body'][_0x28ef('0x2b')]=_0x5b78a9;_0x55c682['body']=_0x5b78a9[_0x28ef('0x2a')];_0x55c682['providerName']='amazonlex';_0x55c682[_0x28ef('0x2c')]=JSON[_0x28ef('0x2d')](_0x5b78a9);return rpc[_0x360507+_0x28ef('0x20')][_0x28ef('0x21')](_0x55c682)[_0x28ef('0x22')](function(_0x58b8ff){logger[_0x28ef('0xd')](_0x28ef('0xe'),_0x45b5a8,_0x55c682['body']);if(_0x5b78a9[_0x28ef('0x2e')]==_0x28ef('0x2f')){_0x3d4aa7[_0x28ef('0x10')]();}else{_0x3d4aa7['stop']();}})['catch'](function(_0x51b730){logger[_0x28ef('0x23')](_0x28ef('0xe'),_0x45b5a8,JSON[_0x28ef('0x2d')](_0x51b730));_0x3d4aa7['next']();});}else{_0x3d4aa7[_0x28ef('0x10')]();}});}}catch(_0x1c1ed9){logger['error'](_0x28ef('0xe'),_0x45b5a8,JSON['stringify'](_0x1c1ed9));_0x3d4aa7[_0x28ef('0x26')]();}};}; \ No newline at end of file +var _0x34b4=['toString','postText','providerResponse','then','dialogState','Failed','stringify','moment','aws-sdk','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','interaction','ChatWebsiteId','account','upperFirst','created','isEmpty','body','getMustacheRender','Message','create','catch','error','[%s][AMAZONLEX]\x20%s','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message'];(function(_0x56d2ce,_0x1d82fd){var _0x1f1051=function(_0x48eb5e){while(--_0x48eb5e){_0x56d2ce['push'](_0x56d2ce['shift']());}};_0x1f1051(++_0x1d82fd);}(_0x34b4,0x10f));var _0x434b=function(_0x43e207,_0x167728){_0x43e207=_0x43e207-0x0;var _0x4239c8=_0x34b4[_0x43e207];return _0x4239c8;};'use strict';var _=require('lodash');var moment=require(_0x434b('0x0'));var AWS=require(_0x434b('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x434b('0x2'));var rpc={'chatMessage':require(_0x434b('0x3')),'openchannelMessage':require(_0x434b('0x4')),'mailMessage':require(_0x434b('0x5')),'smsMessage':require(_0x434b('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x434b('0x7'))};exports[_0x434b('0x8')]=function(_0x3d60f3,_0x9a498e){return function(_0x15b896){try{if(!_[_0x434b('0x9')](this['interaction'][_0x434b('0xa')])){logger[_0x434b('0xb')]('[%s][AMAZONLEX]\x20%s',_0x3d60f3,_0x434b('0xc'));return _0x15b896[_0x434b('0xd')]();}var _0x285b68={'ContactId':this[_0x434b('0xe')]['id'],'sentAt':moment()[_0x434b('0xf')](_0x434b('0x10')),'direction':'out'};if(this[_0x434b('0x11')]==='sms'||this[_0x434b('0x11')]===_0x434b('0x12')){_0x285b68[_0x434b('0x13')]=this[_0x434b('0x14')][_0x434b('0x13')];}var _0x35e0cd=this[_0x434b('0x11')];if(_0x35e0cd==='chat'){_0x285b68[_0x434b('0x15')]=this[_0x434b('0x16')]['id'];}else{_0x285b68[_[_0x434b('0x17')](_0x35e0cd)+'AccountId']=this[_0x434b('0x16')]['id'];}_0x285b68[_[_0x434b('0x17')](_0x35e0cd)+'InteractionId']=this[_0x434b('0x14')]['id'];if(this[_0x434b('0x14')][_0x434b('0x18')]){var _0x9bf03c=_0x9a498e[0x4];if(!_[_0x434b('0x19')](_0x9bf03c)){_0x285b68[_0x434b('0x1a')]=utils[_0x434b('0x1b')](_0x9bf03c,this);return rpc[_0x35e0cd+_0x434b('0x1c')][_0x434b('0x1d')](_0x285b68)['then'](function(_0x497889){logger[_0x434b('0xb')]('[%s][AMAZONLEX]\x20%s',_0x3d60f3,_0x285b68[_0x434b('0x1a')]);})[_0x434b('0x1e')](function(_0x1bb5bf){logger[_0x434b('0x1f')](_0x434b('0x20'),_0x3d60f3,JSON['stringify'](_0x1bb5bf));})['finally'](function(){logger[_0x434b('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3d60f3);_0x15b896[_0x434b('0x21')]();});}else{logger[_0x434b('0xb')](_0x434b('0x22'),_0x3d60f3);_0x15b896[_0x434b('0x21')]();}}else{var _0x323747=this;var _0x4979aa=new AWS[(_0x434b('0x23'))]({'accessKeyId':_0x9a498e[0x0],'secretAccessKey':_0x9a498e[0x1],'region':_0x9a498e[0x2]});var _0x410138={'botAlias':'$LATEST','botName':_0x9a498e[0x3],'inputText':this[_0x434b('0x24')][_0x434b('0x1a')],'userId':this[_0x434b('0x11')]+':'+this['interaction']['id'][_0x434b('0x25')]()};_0x4979aa[_0x434b('0x26')](_0x410138,function(_0x192fc8,_0x266b6e){if(_0x192fc8){logger[_0x434b('0x1f')](_0x434b('0x20'),_0x3d60f3,_0x192fc8[_0x434b('0x24')]);_0x15b896[_0x434b('0xd')]();}else if(_0x266b6e&&_0x266b6e[_0x434b('0x24')]){_0x323747[_0x434b('0x1a')]['amazonlex']=_0x266b6e;_0x285b68[_0x434b('0x1a')]=_0x266b6e[_0x434b('0x24')];_0x285b68['providerName']='amazonlex';_0x285b68[_0x434b('0x27')]=JSON['stringify'](_0x266b6e);return rpc[_0x35e0cd+_0x434b('0x1c')][_0x434b('0x1d')](_0x285b68)[_0x434b('0x28')](function(_0x5d744a){logger['info'](_0x434b('0x20'),_0x3d60f3,_0x285b68[_0x434b('0x1a')]);if(_0x266b6e[_0x434b('0x29')]==_0x434b('0x2a')){_0x15b896[_0x434b('0xd')]();}else{_0x15b896[_0x434b('0x21')]();}})['catch'](function(_0x3d040d){logger[_0x434b('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x3d60f3,JSON[_0x434b('0x2b')](_0x3d040d));_0x15b896[_0x434b('0xd')]();});}else{_0x15b896[_0x434b('0xd')]();}});}}catch(_0x11c513){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3d60f3,JSON[_0x434b('0x2b')](_0x11c513));_0x15b896[_0x434b('0x21')]();}};}; \ 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 6f59213..0a7ea50 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 _0xee80=['isNil','interaction','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','chat','upperFirst','InteractionId','Message','messageId','html','','replace','';_0x1987c7[_0x0ee8('0x30')]={'Auto-Submitted':_0x0ee8('0x31'),'X-Auto-Response-Suppress':_0x0ee8('0x32'),'Precedence':_0x0ee8('0x33')};return mailRpc[_0x0ee8('0x34')](this[_0x0ee8('0x35')][_0x0ee8('0x36')],_0x1987c7)[_0x0ee8('0x37')](function(_0x2ec5a5){logger[_0x0ee8('0x11')](_0x0ee8('0x38'),_0x2076fb);_0x1987c7[_0x0ee8('0x2a')]=_0x2ec5a5[_0x0ee8('0x1f')][_0x0ee8('0x2a')];return rpc[_0x41ca70+_0x0ee8('0x29')]['create'](_0x1987c7);})[_0x0ee8('0x37')](function(_0x1a3006){logger[_0x0ee8('0x11')](_0x0ee8('0x12'),_0x2076fb,JSON['stringify'](_0x1a3006));})['catch'](function(_0x1f40fb){logger[_0x0ee8('0x39')](_0x0ee8('0x3a'),_0x2076fb,JSON[_0x0ee8('0x3b')](_0x1f40fb));})[_0x0ee8('0x3c')](function(){Promise[_0x0ee8('0x3d')]()[_0x0ee8('0x37')](function(){if(_0x45afaf[0x0]!=='2'||_0x50a661['autoreplyExecuted'])return;return rpc[_0x41ca70+_0x0ee8('0x3e')][_0x0ee8('0x3f')](_0x50a661['id'],{'autoreplyExecuted':!![]})[_0x0ee8('0x37')](function(_0x59db3f){logger[_0x0ee8('0x11')](_0x0ee8('0x18'),_0x2076fb,JSON['stringify'](_0x59db3f));})['catch'](function(_0x320183){logger['error'](_0x0ee8('0x40'),_0x2076fb,JSON[_0x0ee8('0x3b')](_0x320183));});})[_0x0ee8('0x37')](function(){_0x29bc1f[_0x0ee8('0x16')]();});});}else{return rpc[this[_0x0ee8('0xd')]+_0x0ee8('0x29')][_0x0ee8('0x41')](_0x1987c7)[_0x0ee8('0x37')](function(){logger[_0x0ee8('0x11')](_0x0ee8('0x12'),_0x2076fb,_0x1987c7[_0x0ee8('0xf')]);})[_0x0ee8('0x42')](function(_0x1a44ab){logger[_0x0ee8('0x39')](_0x0ee8('0x12'),_0x2076fb,JSON['stringify'](_0x1a44ab));})['finally'](function(){Promise['resolve']()[_0x0ee8('0x37')](function(){if(_0x45afaf[0x0]!=='2'||_0x50a661[_0x0ee8('0x17')])return;return rpc[_0x41ca70+_0x0ee8('0x3e')][_0x0ee8('0x3f')](_0x50a661['id'],{'autoreplyExecuted':!![]})['then'](function(_0x354130){logger['info'](_0x0ee8('0x18'),_0x2076fb,JSON[_0x0ee8('0x3b')](_0x354130));})[_0x0ee8('0x42')](function(_0x420bca){logger[_0x0ee8('0x39')](_0x0ee8('0x40'),_0x2076fb,JSON[_0x0ee8('0x3b')](_0x420bca));});})[_0x0ee8('0x37')](function(){_0x29bc1f[_0x0ee8('0x16')]();});});}}}catch(_0x45851b){logger[_0x0ee8('0x39')](_0x0ee8('0x12'),_0x2076fb,JSON[_0x0ee8('0x3b')](_0x45851b));_0x29bc1f['stop']();}};}; \ No newline at end of file +var _0x2ba6=['../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','body','message','from','phone','read','subject','Re:','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','messageId','html','','replace','','auto-replied','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','lodash','moment','./utils','../../../../config/logger','routing'];(function(_0x125735,_0x57f1ac){var _0x567c48=function(_0x149f32){while(--_0x149f32){_0x125735['push'](_0x125735['shift']());}};_0x567c48(++_0x57f1ac);}(_0x2ba6,0xc7));var _0x62ba=function(_0xa7d585,_0x30f4cf){_0xa7d585=_0xa7d585-0x0;var _0x249ad2=_0x2ba6[_0xa7d585];return _0x249ad2;};'use strict';var _=require(_0x62ba('0x0'));var moment=require(_0x62ba('0x1'));var utils=require(_0x62ba('0x2'));var logger=require(_0x62ba('0x3'))(_0x62ba('0x4'));var rpc={'chatMessage':require(_0x62ba('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x62ba('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x62ba('0x7')),'whatsappMessage':require(_0x62ba('0x8')),'chatInteraction':require(_0x62ba('0x9')),'openchannelInteraction':require(_0x62ba('0xa')),'mailInteraction':require(_0x62ba('0xb')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x62ba('0xc')),'whatsappInteraction':require(_0x62ba('0xd'))};var mailRpc=require(_0x62ba('0xe'));exports['consequence']=function(_0x48d7a4,_0x38d6aa,_0x338ac3,_0x39dd36){return function(_0x366994){try{var _0x2ca7d6=this[_0x62ba('0xf')];if(_0x2ca7d6==='mail'&&_0x39dd36['body'][_0x62ba('0x10')]){logger[_0x62ba('0x11')](_0x62ba('0x12'),_0x48d7a4,_0x62ba('0x13'));return _0x366994[_0x62ba('0x14')]();}if(_0x38d6aa[0x0]==='1'&&(_[_0x62ba('0x15')](this[_0x62ba('0x16')][_0x62ba('0x17')])||!this['interaction']['created'])){logger[_0x62ba('0x11')]('[%s][AUTOREPLY]\x20%s',_0x48d7a4,_0x62ba('0x18'));return _0x366994[_0x62ba('0x14')]();}if(_0x38d6aa[0x0]==='2'&&this['interaction'][_0x62ba('0x19')]){logger[_0x62ba('0x11')](_0x62ba('0x1a'),_0x48d7a4,_0x62ba('0x1b'));return _0x366994['next']();}var _0x4d4a64={'ContactId':this[_0x62ba('0x1c')]['id'],'sentAt':moment()[_0x62ba('0x1d')](_0x62ba('0x1e')),'direction':_0x62ba('0x1f')};if(this[_0x62ba('0xf')]==='mail'){_0x4d4a64['body']=utils[_0x62ba('0x20')](_0x38d6aa[0x2],this);}else{_0x4d4a64[_0x62ba('0x21')]=utils[_0x62ba('0x20')](_0x38d6aa[0x1],this);}if(this[_0x62ba('0x22')]){_0x4d4a64['to']=this['message'][_0x62ba('0x23')]||'';if(this['channel']==='mail'&&_0x38d6aa[0x1]==='1'){_0x4d4a64['cc']=this[_0x62ba('0x22')]['cc']||'';}_0x4d4a64[_0x62ba('0x23')]=this[_0x62ba('0x22')]['to']||'';_0x4d4a64[_0x62ba('0x24')]=this['message'][_0x62ba('0x24')]||'';_0x4d4a64[_0x62ba('0x25')]=!![];if(this[_0x62ba('0x22')][_0x62ba('0x26')]){_0x4d4a64[_0x62ba('0x26')]='';_0x4d4a64['subject']+=_['startsWith'](this[_0x62ba('0x22')]['subject'],_0x62ba('0x27'))?'':'Re:\x20';_0x4d4a64['subject']+=this[_0x62ba('0x22')][_0x62ba('0x26')];}}if(this['channel']===_0x62ba('0x28')){_0x4d4a64[_0x62ba('0x29')]=this[_0x62ba('0x2a')]['id'];}else{_0x4d4a64[_[_0x62ba('0x2b')](this[_0x62ba('0xf')])+_0x62ba('0x2c')]=this[_0x62ba('0x2a')]['id'];}_0x4d4a64[_[_0x62ba('0x2b')](this['channel'])+_0x62ba('0x2d')]=this[_0x62ba('0x16')]['id'];var _0x48ef12=this[_0x62ba('0x16')];if(rpc[this[_0x62ba('0xf')]+'Message']){if(this['channel']==='mail'){_0x4d4a64['inReplyTo']=this[_0x62ba('0x22')][_0x62ba('0x2e')];_0x4d4a64[_0x62ba('0x2f')]=_0x62ba('0x30')+_[_0x62ba('0x31')](_0x4d4a64[_0x62ba('0x21')],_0x62ba('0x32'),_0x62ba('0x33'))+_0x62ba('0x34');_0x4d4a64['headers']={'Auto-Submitted':_0x62ba('0x35'),'X-Auto-Response-Suppress':'All','Precedence':'auto_reply'};return mailRpc[_0x62ba('0x36')](this[_0x62ba('0x2a')][_0x62ba('0x37')],_0x4d4a64)[_0x62ba('0x38')](function(_0x2f36ae){logger[_0x62ba('0x11')](_0x62ba('0x39'),_0x48d7a4);_0x4d4a64['messageId']=_0x2f36ae[_0x62ba('0x22')][_0x62ba('0x2e')];return rpc[_0x2ca7d6+_0x62ba('0x3a')][_0x62ba('0x3b')](_0x4d4a64);})['then'](function(_0x30e9e8){logger[_0x62ba('0x11')](_0x62ba('0x12'),_0x48d7a4,JSON[_0x62ba('0x3c')](_0x30e9e8));})[_0x62ba('0x3d')](function(_0x2b2bd8){logger['error'](_0x62ba('0x3e'),_0x48d7a4,JSON[_0x62ba('0x3c')](_0x2b2bd8));})['finally'](function(){Promise['resolve']()[_0x62ba('0x38')](function(){if(_0x38d6aa[0x0]!=='2'||_0x48ef12[_0x62ba('0x19')])return;return rpc[_0x2ca7d6+_0x62ba('0x3f')][_0x62ba('0x40')](_0x48ef12['id'],{'autoreplyExecuted':!![]})[_0x62ba('0x38')](function(_0x41c2b5){logger[_0x62ba('0x11')](_0x62ba('0x1a'),_0x48d7a4,JSON[_0x62ba('0x3c')](_0x41c2b5));})[_0x62ba('0x3d')](function(_0x18cb11){logger[_0x62ba('0x41')](_0x62ba('0x42'),_0x48d7a4,JSON[_0x62ba('0x3c')](_0x18cb11));});})[_0x62ba('0x38')](function(){_0x366994[_0x62ba('0x14')]();});});}else{return rpc[this[_0x62ba('0xf')]+_0x62ba('0x3a')]['create'](_0x4d4a64)[_0x62ba('0x38')](function(){logger[_0x62ba('0x11')](_0x62ba('0x12'),_0x48d7a4,_0x4d4a64[_0x62ba('0x21')]);})[_0x62ba('0x3d')](function(_0x3fd781){logger[_0x62ba('0x41')](_0x62ba('0x12'),_0x48d7a4,JSON['stringify'](_0x3fd781));})['finally'](function(){Promise[_0x62ba('0x43')]()['then'](function(){if(_0x38d6aa[0x0]!=='2'||_0x48ef12[_0x62ba('0x19')])return;return rpc[_0x2ca7d6+_0x62ba('0x3f')][_0x62ba('0x40')](_0x48ef12['id'],{'autoreplyExecuted':!![]})['then'](function(_0x108693){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x48d7a4,JSON['stringify'](_0x108693));})[_0x62ba('0x3d')](function(_0x11151f){logger[_0x62ba('0x41')](_0x62ba('0x42'),_0x48d7a4,JSON[_0x62ba('0x3c')](_0x11151f));});})[_0x62ba('0x38')](function(){_0x366994[_0x62ba('0x14')]();});});}}}catch(_0x2f456a){logger[_0x62ba('0x41')](_0x62ba('0x12'),_0x48d7a4,JSON[_0x62ba('0x3c')](_0x2f456a));_0x366994['stop']();}};}; \ 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 48085fd..bc032a6 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 _0x32a6=['stop','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','system','channel','Interaction','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally'];(function(_0x1ef51d,_0x3b4a48){var _0x993a20=function(_0x4cacc1){while(--_0x4cacc1){_0x1ef51d['push'](_0x1ef51d['shift']());}};_0x993a20(++_0x3b4a48);}(_0x32a6,0x17d));var _0x632a=function(_0x5f28e6,_0x1fda78){_0x5f28e6=_0x5f28e6-0x0;var _0x316c3a=_0x32a6[_0x5f28e6];return _0x316c3a;};'use strict';var moment=require(_0x632a('0x0'));var logger=require(_0x632a('0x1'))(_0x632a('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x632a('0x3')),'smsInteraction':require(_0x632a('0x4')),'mailInteraction':require(_0x632a('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x632a('0x6'))};exports[_0x632a('0x7')]=function(_0x413b2b,_0x2bf24c,_0x1b4c67,_0x180dc7){return function(_0x50a0e0){try{logger[_0x632a('0x8')]('[%s][CLOSE]\x20reason\x20%s',_0x413b2b,_0x2bf24c[0x0]);var _0x508d22={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x632a('0x9'),'disposition':_0x2bf24c[0x0]};if(rpc[_0x180dc7[_0x632a('0xa')]+'Interaction']){rpc[_0x180dc7[_0x632a('0xa')]+_0x632a('0xb')]['update'](_0x180dc7[_0x632a('0xc')]['id'],_0x508d22)['then'](function(_0x1048d7){logger[_0x632a('0x8')](_0x632a('0xd'),_0x413b2b,_0x180dc7['interaction']['id']);})[_0x632a('0xe')](function(_0x3abd04){logger[_0x632a('0xf')](_0x632a('0x10'),_0x413b2b,JSON[_0x632a('0x11')](_0x3abd04));})[_0x632a('0x12')](function(){_0x50a0e0[_0x632a('0x13')]();});}}catch(_0x453f60){logger[_0x632a('0xf')]('[%s][CLOSE]\x20%s',_0x413b2b,JSON[_0x632a('0x11')](_0x453f60));_0x50a0e0['stop']();}};}; \ No newline at end of file +var _0x6588=['routing','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','stringify','finally','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger'];(function(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0x6588,0x1e2));var _0x8658=function(_0x5aaf93,_0x5c0001){_0x5aaf93=_0x5aaf93-0x0;var _0x17d307=_0x6588[_0x5aaf93];return _0x17d307;};'use strict';var moment=require(_0x8658('0x0'));var logger=require(_0x8658('0x1'))(_0x8658('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x8658('0x3')),'mailInteraction':require(_0x8658('0x4')),'faxInteraction':require(_0x8658('0x5')),'whatsappInteraction':require(_0x8658('0x6'))};exports['consequence']=function(_0xb26803,_0x554dd8,_0x9121a6,_0x424550){return function(_0x3b91a0){try{logger[_0x8658('0x7')](_0x8658('0x8'),_0xb26803,_0x554dd8[0x0]);var _0x13cbb8={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x8658('0x9'),'disposition':_0x554dd8[0x0]};if(rpc[_0x424550[_0x8658('0xa')]+_0x8658('0xb')]){rpc[_0x424550['channel']+_0x8658('0xb')][_0x8658('0xc')](_0x424550[_0x8658('0xd')]['id'],_0x13cbb8)[_0x8658('0xe')](function(_0x178d30){logger['info'](_0x8658('0xf'),_0xb26803,_0x424550[_0x8658('0xd')]['id']);})[_0x8658('0x10')](function(_0x165514){logger[_0x8658('0x11')]('[%s][CLOSE]\x20%s',_0xb26803,JSON[_0x8658('0x12')](_0x165514));})[_0x8658('0x13')](function(){_0x3b91a0[_0x8658('0x14')]();});}}catch(_0x402bd2){logger[_0x8658('0x11')](_0x8658('0x15'),_0xb26803,JSON[_0x8658('0x12')](_0x402bd2));_0x3b91a0['stop']();}};}; \ 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 23d2be5..13653b4 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 _0x9f7a=['sms','whatsapp','interaction','chat','upperFirst','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','body','catch','error','stringify','finally','textRequest','dialogflow','result','speech','providerName','metadata','endConversation','stop','message','lodash','moment','apiai-promise','md5','../../../../config/logger','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel'];(function(_0x2b47b6,_0x2c7d83){var _0x5f5ce3=function(_0x41aabc){while(--_0x41aabc){_0x2b47b6['push'](_0x2b47b6['shift']());}};_0x5f5ce3(++_0x2c7d83);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x9f7a[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0xa9f7('0x0'));var moment=require(_0xa9f7('0x1'));var apiai=require(_0xa9f7('0x2'));var md5=require(_0xa9f7('0x3'));var utils=require('./utils');var logger=require(_0xa9f7('0x4'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa9f7('0x5')),'smsMessage':require(_0xa9f7('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xa9f7('0x7')]=function(_0x5497c8,_0x48e791){return function(_0x5bf7ca){try{if(!_[_0xa9f7('0x8')](this['interaction'][_0xa9f7('0x9')])){logger[_0xa9f7('0xa')](_0xa9f7('0xb'),_0x5497c8,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5bf7ca[_0xa9f7('0xc')]();}var _0xdda0e0={'ContactId':this['contact']['id'],'sentAt':moment()[_0xa9f7('0xd')](_0xa9f7('0xe')),'direction':_0xa9f7('0xf')};if(this[_0xa9f7('0x10')]===_0xa9f7('0x11')||this[_0xa9f7('0x10')]===_0xa9f7('0x12')){_0xdda0e0['phone']=this[_0xa9f7('0x13')]['phone'];}var _0x45ffaf=this[_0xa9f7('0x10')];if(_0x45ffaf===_0xa9f7('0x14')){_0xdda0e0['ChatWebsiteId']=this['account']['id'];}else{_0xdda0e0[_[_0xa9f7('0x15')](_0x45ffaf)+'AccountId']=this['account']['id'];}_0xdda0e0[_[_0xa9f7('0x15')](_0x45ffaf)+_0xa9f7('0x16')]=this[_0xa9f7('0x13')]['id'];if(this['interaction'][_0xa9f7('0x17')]){var _0x153493=_0x48e791[0x2];if(!_[_0xa9f7('0x18')](_0x153493)){_0xdda0e0['body']=utils[_0xa9f7('0x19')](_0x153493,this);return rpc[_0x45ffaf+_0xa9f7('0x1a')][_0xa9f7('0x1b')](_0xdda0e0)[_0xa9f7('0x1c')](function(_0x8da225){logger[_0xa9f7('0xa')](_0xa9f7('0xb'),_0x5497c8,_0xdda0e0[_0xa9f7('0x1d')]);})[_0xa9f7('0x1e')](function(_0x4c235e){logger[_0xa9f7('0x1f')](_0xa9f7('0xb'),_0x5497c8,JSON[_0xa9f7('0x20')](_0x4c235e));})[_0xa9f7('0x21')](function(){logger[_0xa9f7('0xa')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5497c8);_0x5bf7ca['stop']();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5497c8);_0x5bf7ca['stop']();}}else{var _0x4b7202=this;var _0x5c9e4f=apiai(_0x48e791[0x0],{'language':_0x48e791[0x1]||'en'});return _0x5c9e4f[_0xa9f7('0x22')](this['message']['body'],{'sessionId':md5(this[_0xa9f7('0x13')]['id'])})['then'](function(_0x502562){_0x4b7202['body'][_0xa9f7('0x23')]=_0x502562;_0xdda0e0[_0xa9f7('0x1d')]=_0x502562[_0xa9f7('0x24')]['fulfillment'][_0xa9f7('0x25')];_0xdda0e0[_0xa9f7('0x26')]=_0xa9f7('0x23');_0xdda0e0['providerResponse']=JSON[_0xa9f7('0x20')](_0x502562);return rpc[_0x45ffaf+'Message'][_0xa9f7('0x1b')](_0xdda0e0)['then'](function(_0x1bf651){logger[_0xa9f7('0xa')](_0xa9f7('0xb'),_0x5497c8,_0xdda0e0[_0xa9f7('0x1d')]);if(_0x502562['result'][_0xa9f7('0x27')][_0xa9f7('0x28')]){_0x5bf7ca[_0xa9f7('0xc')]();}else{_0x5bf7ca[_0xa9f7('0x29')]();}})[_0xa9f7('0x1e')](function(_0x471c3c){logger[_0xa9f7('0x1f')](_0xa9f7('0xb'),_0x5497c8,JSON['stringify'](_0x471c3c));_0x5bf7ca['next']();});})['catch'](function(_0x224f2e){logger[_0xa9f7('0x1f')]('[%s][DIALOGFLOW]\x20%s',_0x5497c8,_0x224f2e[_0xa9f7('0x2a')]);_0x5bf7ca['next']();});}}catch(_0x49805c){logger['error'](_0xa9f7('0xb'),_0x5497c8,JSON['stringify'](_0x49805c));_0x5bf7ca[_0xa9f7('0x29')]();}};}; \ No newline at end of file +var _0x1bce=['channel','phone','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','Message','create','then','info','catch','error','stringify','finally','stop','message','dialogflow','result','fulfillment','speech','providerName','metadata','lodash','moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms'];(function(_0x3328db,_0x298576){var _0x478e6a=function(_0x5a8590){while(--_0x5a8590){_0x3328db['push'](_0x3328db['shift']());}};_0x478e6a(++_0x298576);}(_0x1bce,0x73));var _0xe1bc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1bce[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe1bc('0x0'));var moment=require(_0xe1bc('0x1'));var apiai=require('apiai-promise');var md5=require(_0xe1bc('0x2'));var utils=require(_0xe1bc('0x3'));var logger=require(_0xe1bc('0x4'))(_0xe1bc('0x5'));var rpc={'chatMessage':require(_0xe1bc('0x6')),'openchannelMessage':require(_0xe1bc('0x7')),'mailMessage':require(_0xe1bc('0x8')),'smsMessage':require(_0xe1bc('0x9')),'faxMessage':require(_0xe1bc('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x324c27,_0x4199ff){return function(_0x24b695){try{if(!_[_0xe1bc('0xb')](this[_0xe1bc('0xc')][_0xe1bc('0xd')])){logger['info'](_0xe1bc('0xe'),_0x324c27,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x24b695[_0xe1bc('0xf')]();}var _0x355757={'ContactId':this[_0xe1bc('0x10')]['id'],'sentAt':moment()['format'](_0xe1bc('0x11')),'direction':_0xe1bc('0x12')};if(this['channel']===_0xe1bc('0x13')||this[_0xe1bc('0x14')]==='whatsapp'){_0x355757['phone']=this[_0xe1bc('0xc')][_0xe1bc('0x15')];}var _0x280679=this['channel'];if(_0x280679==='chat'){_0x355757[_0xe1bc('0x16')]=this[_0xe1bc('0x17')]['id'];}else{_0x355757[_[_0xe1bc('0x18')](_0x280679)+'AccountId']=this[_0xe1bc('0x17')]['id'];}_0x355757[_[_0xe1bc('0x18')](_0x280679)+_0xe1bc('0x19')]=this[_0xe1bc('0xc')]['id'];if(this['interaction'][_0xe1bc('0x1a')]){var _0x4a432f=_0x4199ff[0x2];if(!_[_0xe1bc('0x1b')](_0x4a432f)){_0x355757[_0xe1bc('0x1c')]=utils['getMustacheRender'](_0x4a432f,this);return rpc[_0x280679+_0xe1bc('0x1d')][_0xe1bc('0x1e')](_0x355757)[_0xe1bc('0x1f')](function(_0x3fd489){logger[_0xe1bc('0x20')](_0xe1bc('0xe'),_0x324c27,_0x355757['body']);})[_0xe1bc('0x21')](function(_0x4b22ef){logger[_0xe1bc('0x22')](_0xe1bc('0xe'),_0x324c27,JSON[_0xe1bc('0x23')](_0x4b22ef));})[_0xe1bc('0x24')](function(){logger[_0xe1bc('0x20')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x324c27);_0x24b695[_0xe1bc('0x25')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x324c27);_0x24b695[_0xe1bc('0x25')]();}}else{var _0x2a999c=this;var _0x5cc42d=apiai(_0x4199ff[0x0],{'language':_0x4199ff[0x1]||'en'});return _0x5cc42d['textRequest'](this[_0xe1bc('0x26')][_0xe1bc('0x1c')],{'sessionId':md5(this[_0xe1bc('0xc')]['id'])})[_0xe1bc('0x1f')](function(_0x229b43){_0x2a999c[_0xe1bc('0x1c')][_0xe1bc('0x27')]=_0x229b43;_0x355757[_0xe1bc('0x1c')]=_0x229b43[_0xe1bc('0x28')][_0xe1bc('0x29')][_0xe1bc('0x2a')];_0x355757[_0xe1bc('0x2b')]=_0xe1bc('0x27');_0x355757['providerResponse']=JSON['stringify'](_0x229b43);return rpc[_0x280679+_0xe1bc('0x1d')]['create'](_0x355757)[_0xe1bc('0x1f')](function(_0x5f1596){logger[_0xe1bc('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x324c27,_0x355757['body']);if(_0x229b43[_0xe1bc('0x28')][_0xe1bc('0x2c')]['endConversation']){_0x24b695['next']();}else{_0x24b695[_0xe1bc('0x25')]();}})[_0xe1bc('0x21')](function(_0x345da1){logger[_0xe1bc('0x22')](_0xe1bc('0xe'),_0x324c27,JSON[_0xe1bc('0x23')](_0x345da1));_0x24b695[_0xe1bc('0xf')]();});})[_0xe1bc('0x21')](function(_0x32bedb){logger['error'](_0xe1bc('0xe'),_0x324c27,_0x32bedb[_0xe1bc('0x26')]);_0x24b695[_0xe1bc('0xf')]();});}}catch(_0x4dab2a){logger[_0xe1bc('0x22')](_0xe1bc('0xe'),_0x324c27,JSON[_0xe1bc('0x23')](_0x4dab2a));_0x24b695[_0xe1bc('0x25')]();}};}; \ 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 f499d83..80c809a 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 _0xde02=['channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','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','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','lodash','dialogflow','md5','../../../../config/logger','routing','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','info','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out'];(function(_0x51b661,_0x566ef8){var _0x5d1971=function(_0x5cc6b8){while(--_0x5cc6b8){_0x51b661['push'](_0x51b661['shift']());}};_0x5d1971(++_0x566ef8);}(_0xde02,0xd5));var _0x2de0=function(_0x5f5468,_0x220315){_0x5f5468=_0x5f5468-0x0;var _0x203e0e=_0xde02[_0x5f5468];return _0x203e0e;};'use strict';var _=require(_0x2de0('0x0'));var dialogflow=require(_0x2de0('0x1'));var md5=require(_0x2de0('0x2'));var moment=require('moment');var Promise=require('bluebird');var logger=require(_0x2de0('0x3'))(_0x2de0('0x4'));var utils=require(_0x2de0('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2de0('0x6')),'mailMessage':require(_0x2de0('0x7')),'smsMessage':require(_0x2de0('0x8')),'faxMessage':require(_0x2de0('0x9')),'whatsappMessage':require(_0x2de0('0xa'))};function createMessage(_0x4a7cc5,_0x1a658f,_0x182b39,_0x15be24){return new Promise(function(_0x3eee21,_0x203095){var _0x405582=_[_0x2de0('0xb')](_0x182b39);_0x405582[_0x2de0('0xc')]=_0x15be24;return rpc[_0x1a658f+_0x2de0('0xd')][_0x2de0('0xe')](_0x405582)[_0x2de0('0xf')](function(){logger['info'](_0x2de0('0x10'),_0x4a7cc5,_0x405582[_0x2de0('0xc')]);_0x3eee21();})[_0x2de0('0x11')](function(_0x2e7928){logger[_0x2de0('0x12')](_0x2de0('0x10'),_0x4a7cc5,JSON[_0x2de0('0x13')](_0x2e7928));_0x203095(_0x2e7928);});});}exports[_0x2de0('0x14')]=function(_0x378881,_0x56a504){return function(_0xbbc4bf){try{if(!_[_0x2de0('0x15')](this[_0x2de0('0x16')][_0x2de0('0x17')])){logger[_0x2de0('0x18')](_0x2de0('0x10'),_0x378881,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0xbbc4bf[_0x2de0('0x19')]();}var _0x12f3c1={'ContactId':this[_0x2de0('0x1a')]['id'],'sentAt':moment()[_0x2de0('0x1b')](_0x2de0('0x1c')),'direction':_0x2de0('0x1d')};if(this[_0x2de0('0x1e')]===_0x2de0('0x1f')||this[_0x2de0('0x1e')]==='whatsapp'){_0x12f3c1[_0x2de0('0x20')]=this['interaction'][_0x2de0('0x20')];}var _0x20d3cf=this[_0x2de0('0x1e')];if(_0x20d3cf===_0x2de0('0x21')){_0x12f3c1[_0x2de0('0x22')]=this[_0x2de0('0x23')]['id'];}else{_0x12f3c1[_[_0x2de0('0x24')](_0x20d3cf)+_0x2de0('0x25')]=this['account']['id'];}_0x12f3c1[_[_0x2de0('0x24')](_0x20d3cf)+_0x2de0('0x26')]=this[_0x2de0('0x16')]['id'];if(this[_0x2de0('0x16')][_0x2de0('0x27')]){var _0x28f95c=_0x56a504[0x4];if(!_[_0x2de0('0x28')](_0x28f95c)){_0x12f3c1[_0x2de0('0xc')]=utils[_0x2de0('0x29')](_0x28f95c,this);return rpc[_0x20d3cf+_0x2de0('0xd')][_0x2de0('0xe')](_0x12f3c1)[_0x2de0('0xf')](function(_0x1495b9){logger[_0x2de0('0x18')](_0x2de0('0x10'),_0x378881,_0x12f3c1[_0x2de0('0xc')]);})[_0x2de0('0x11')](function(_0x5b5bd6){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x378881,JSON[_0x2de0('0x13')](_0x5b5bd6));})[_0x2de0('0x2a')](function(){logger[_0x2de0('0x18')](_0x2de0('0x2b'),_0x378881);_0xbbc4bf[_0x2de0('0x2c')]();});}else{logger[_0x2de0('0x18')](_0x2de0('0x2d'),_0x378881);_0xbbc4bf[_0x2de0('0x2c')]();}}else{var _0x5e81ce=this;var _0x105c5b=_0x56a504[0x2][_0x2de0('0x2e')](/\\n/g,'\x0a');var _0x2a0e92={'credentials':{'private_key':_0x105c5b,'client_email':_0x56a504[0x1]}};var _0x448cf7=new dialogflow[(_0x2de0('0x2f'))](_0x2a0e92);var _0xc94f43=_0x448cf7[_0x2de0('0x30')](_0x56a504[0x0],md5(_0x5e81ce['interaction']['id']));var _0x982303={'session':_0xc94f43,'queryInput':{'text':{'text':_0x5e81ce[_0x2de0('0x31')][_0x2de0('0xc')],'languageCode':_0x56a504[0x3]||'en'}}};return _0x448cf7[_0x2de0('0x32')](_0x982303)[_0x2de0('0xf')](function(_0x37224e){if(_0x37224e&&_0x37224e[_0x2de0('0x33')]){_0x5e81ce[_0x2de0('0xc')][_0x2de0('0x34')]=_0x37224e;var _0x53c639=_0x37224e[0x0];var _0x47d35a=_0x53c639[_0x2de0('0x35')][_0x2de0('0x36')]&&_0x53c639[_0x2de0('0x35')][_0x2de0('0x36')][_0x2de0('0x37')]?_0x53c639[_0x2de0('0x35')][_0x2de0('0x36')]['fields'][_0x2de0('0x38')][_0x2de0('0x39')]:![];_0x5e81ce[_0x2de0('0xc')][_0x2de0('0x3a')]=_0x53c639[_0x2de0('0x35')][_0x2de0('0x3b')];_0x5e81ce[_0x2de0('0xc')][_0x2de0('0x3c')]=_0x53c639[_0x2de0('0x35')][_0x2de0('0x3d')];_0x5e81ce[_0x2de0('0xc')][_0x2de0('0x3e')]=_0x53c639[_0x2de0('0x35')][_0x2de0('0x36')]&&_0x53c639[_0x2de0('0x35')][_0x2de0('0x36')]['fields']?_0x53c639[_0x2de0('0x35')]['diagnosticInfo']['fields'][_0x2de0('0x38')][_0x2de0('0x39')]:![];_0x5e81ce['body'][_0x2de0('0x3f')]=_0x53c639['queryResult'][_0x2de0('0x40')][_0x2de0('0x41')];_0x5e81ce[_0x2de0('0xc')][_0x2de0('0x42')]=_0x53c639[_0x2de0('0x35')][_0x2de0('0x40')][_0x2de0('0x43')];_0x5e81ce[_0x2de0('0xc')][_0x2de0('0x44')]=_0x53c639['queryResult'][_0x2de0('0x40')][_0x2de0('0x45')];_0x5e81ce[_0x2de0('0xc')][_0x2de0('0x46')]=_0x53c639[_0x2de0('0x35')][_0x2de0('0x47')];_0x5e81ce[_0x2de0('0xc')][_0x2de0('0x48')]=_0x53c639['queryResult'][_0x2de0('0x49')];_0x5e81ce[_0x2de0('0xc')][_0x2de0('0x4a')]=_0x53c639[_0x2de0('0x35')][_0x2de0('0x4b')];_0x12f3c1[_0x2de0('0x4c')]=_0x2de0('0x34');_0x12f3c1[_0x2de0('0x4d')]=JSON[_0x2de0('0x13')](_0x37224e);var _0x2d95c8=[];for(var _0x3c01c0=0x0;_0x3c01c0<_0x37224e[_0x2de0('0x33')];_0x3c01c0++){var _0x1b5081=_0x37224e[_0x3c01c0];if(_0x1b5081&&_0x1b5081[_0x2de0('0x35')]&&_0x1b5081['queryResult'][_0x2de0('0x4e')]){_0x2d95c8[_0x2de0('0x4f')](createMessage(_0x378881,_0x20d3cf,_0x12f3c1,_0x1b5081['queryResult'][_0x2de0('0x4e')]));}}return Promise[_0x2de0('0x50')](_0x2d95c8)[_0x2de0('0xf')](function(){if(_0x47d35a){_0xbbc4bf['next']();}else{_0xbbc4bf['stop']();}})['catch'](function(_0x8caec7){logger[_0x2de0('0x12')](_0x2de0('0x10'),_0x378881,JSON['stringify'](_0x8caec7));_0xbbc4bf[_0x2de0('0x19')]();});}})[_0x2de0('0x11')](function(_0x169e98){logger['error'](_0x2de0('0x10'),_0x378881,_0x169e98[_0x2de0('0x31')]);_0xbbc4bf[_0x2de0('0x19')]();});}}catch(_0x265021){logger[_0x2de0('0x12')](_0x2de0('0x10'),_0x378881,JSON[_0x2de0('0x13')](_0x265021));_0xbbc4bf[_0x2de0('0x2c')]();}};}; \ No newline at end of file +var _0x0385=['info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','consequence','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','create','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','SessionsClient','sessionPath','message','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','all','catch','next','dialogflow','md5','moment','bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','body','Message','then'];(function(_0x5ca81f,_0x26d64c){var _0x1ea8be=function(_0x5bf3b0){while(--_0x5bf3b0){_0x5ca81f['push'](_0x5ca81f['shift']());}};_0x1ea8be(++_0x26d64c);}(_0x0385,0x108));var _0x5038=function(_0x515846,_0x3ebfad){_0x515846=_0x515846-0x0;var _0x38c2ea=_0x0385[_0x515846];return _0x38c2ea;};'use strict';var _=require('lodash');var dialogflow=require(_0x5038('0x0'));var md5=require(_0x5038('0x1'));var moment=require(_0x5038('0x2'));var Promise=require(_0x5038('0x3'));var logger=require(_0x5038('0x4'))('routing');var utils=require(_0x5038('0x5'));var rpc={'chatMessage':require(_0x5038('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x5038('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x5038('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x33e4dc,_0x5b27c5,_0x54177e,_0x14e1d2){return new Promise(function(_0x8d07ce,_0x5d5b39){var _0x2e64bb=_['clone'](_0x54177e);_0x2e64bb[_0x5038('0x9')]=_0x14e1d2;return rpc[_0x5b27c5+_0x5038('0xa')]['create'](_0x2e64bb)[_0x5038('0xb')](function(){logger[_0x5038('0xc')](_0x5038('0xd'),_0x33e4dc,_0x2e64bb[_0x5038('0x9')]);_0x8d07ce();})['catch'](function(_0x76c18a){logger[_0x5038('0xe')](_0x5038('0xd'),_0x33e4dc,JSON[_0x5038('0xf')](_0x76c18a));_0x5d5b39(_0x76c18a);});});}exports[_0x5038('0x10')]=function(_0x353983,_0x292db1){return function(_0x1e868b){try{if(!_[_0x5038('0x11')](this[_0x5038('0x12')]['UserId'])){logger['info'](_0x5038('0xd'),_0x353983,_0x5038('0x13'));return _0x1e868b['next']();}var _0x1ad43a={'ContactId':this[_0x5038('0x14')]['id'],'sentAt':moment()[_0x5038('0x15')](_0x5038('0x16')),'direction':_0x5038('0x17')};if(this[_0x5038('0x18')]===_0x5038('0x19')||this[_0x5038('0x18')]===_0x5038('0x1a')){_0x1ad43a[_0x5038('0x1b')]=this['interaction'][_0x5038('0x1b')];}var _0x1e1c57=this[_0x5038('0x18')];if(_0x1e1c57==='chat'){_0x1ad43a[_0x5038('0x1c')]=this[_0x5038('0x1d')]['id'];}else{_0x1ad43a[_[_0x5038('0x1e')](_0x1e1c57)+_0x5038('0x1f')]=this[_0x5038('0x1d')]['id'];}_0x1ad43a[_[_0x5038('0x1e')](_0x1e1c57)+_0x5038('0x20')]=this[_0x5038('0x12')]['id'];if(this[_0x5038('0x12')][_0x5038('0x21')]){var _0x712401=_0x292db1[0x4];if(!_[_0x5038('0x22')](_0x712401)){_0x1ad43a[_0x5038('0x9')]=utils['getMustacheRender'](_0x712401,this);return rpc[_0x1e1c57+_0x5038('0xa')][_0x5038('0x23')](_0x1ad43a)['then'](function(_0x19b78c){logger[_0x5038('0xc')](_0x5038('0xd'),_0x353983,_0x1ad43a[_0x5038('0x9')]);})['catch'](function(_0x2e8c34){logger['error'](_0x5038('0xd'),_0x353983,JSON[_0x5038('0xf')](_0x2e8c34));})[_0x5038('0x24')](function(){logger[_0x5038('0xc')](_0x5038('0x25'),_0x353983);_0x1e868b['stop']();});}else{logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x353983);_0x1e868b[_0x5038('0x26')]();}}else{var _0x32959b=this;var _0x43fabf=_0x292db1[0x2][_0x5038('0x27')](/\\n/g,'\x0a');var _0x22744c={'credentials':{'private_key':_0x43fabf,'client_email':_0x292db1[0x1]}};var _0x32974b=new dialogflow[(_0x5038('0x28'))](_0x22744c);var _0x8bef0c=_0x32974b[_0x5038('0x29')](_0x292db1[0x0],md5(_0x32959b[_0x5038('0x12')]['id']));var _0x266827={'session':_0x8bef0c,'queryInput':{'text':{'text':_0x32959b[_0x5038('0x2a')][_0x5038('0x9')],'languageCode':_0x292db1[0x3]||'en'}}};return _0x32974b[_0x5038('0x2b')](_0x266827)[_0x5038('0xb')](function(_0x33c71a){if(_0x33c71a&&_0x33c71a[_0x5038('0x2c')]){_0x32959b[_0x5038('0x9')]['dialogflowV2']=_0x33c71a;var _0x408cd8=_0x33c71a[0x0];var _0x4d447d=_0x408cd8[_0x5038('0x2d')][_0x5038('0x2e')]&&_0x408cd8['queryResult'][_0x5038('0x2e')]['fields']?_0x408cd8[_0x5038('0x2d')][_0x5038('0x2e')][_0x5038('0x2f')][_0x5038('0x30')][_0x5038('0x31')]:![];_0x32959b[_0x5038('0x9')]['DIALOGFLOWV2_ACTION']=_0x408cd8[_0x5038('0x2d')][_0x5038('0x32')];_0x32959b[_0x5038('0x9')][_0x5038('0x33')]=_0x408cd8[_0x5038('0x2d')][_0x5038('0x34')];_0x32959b[_0x5038('0x9')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x408cd8[_0x5038('0x2d')]['diagnosticInfo']&&_0x408cd8[_0x5038('0x2d')][_0x5038('0x2e')]['fields']?_0x408cd8[_0x5038('0x2d')][_0x5038('0x2e')][_0x5038('0x2f')][_0x5038('0x30')][_0x5038('0x31')]:![];_0x32959b[_0x5038('0x9')][_0x5038('0x35')]=_0x408cd8[_0x5038('0x2d')][_0x5038('0x36')][_0x5038('0x37')];_0x32959b['body'][_0x5038('0x38')]=_0x408cd8[_0x5038('0x2d')][_0x5038('0x36')][_0x5038('0x39')];_0x32959b[_0x5038('0x9')][_0x5038('0x3a')]=_0x408cd8[_0x5038('0x2d')][_0x5038('0x36')]['isFallback'];_0x32959b['body'][_0x5038('0x3b')]=_0x408cd8[_0x5038('0x2d')]['languageCode'];_0x32959b[_0x5038('0x9')][_0x5038('0x3c')]=_0x408cd8['queryResult'][_0x5038('0x3d')];_0x32959b[_0x5038('0x9')][_0x5038('0x3e')]=_0x408cd8[_0x5038('0x2d')][_0x5038('0x3f')];_0x1ad43a[_0x5038('0x40')]='dialogflowV2';_0x1ad43a[_0x5038('0x41')]=JSON[_0x5038('0xf')](_0x33c71a);var _0x4a12e6=[];for(var _0x5560c3=0x0;_0x5560c3<_0x33c71a[_0x5038('0x2c')];_0x5560c3++){var _0x91347e=_0x33c71a[_0x5560c3];if(_0x91347e&&_0x91347e[_0x5038('0x2d')]&&_0x91347e['queryResult']['fulfillmentText']){_0x4a12e6['push'](createMessage(_0x353983,_0x1e1c57,_0x1ad43a,_0x91347e[_0x5038('0x2d')]['fulfillmentText']));}}return Promise[_0x5038('0x42')](_0x4a12e6)[_0x5038('0xb')](function(){if(_0x4d447d){_0x1e868b['next']();}else{_0x1e868b[_0x5038('0x26')]();}})[_0x5038('0x43')](function(_0x28dbce){logger[_0x5038('0xe')](_0x5038('0xd'),_0x353983,JSON[_0x5038('0xf')](_0x28dbce));_0x1e868b[_0x5038('0x44')]();});}})[_0x5038('0x43')](function(_0x42ced3){logger[_0x5038('0xe')](_0x5038('0xd'),_0x353983,_0x42ced3['message']);_0x1e868b[_0x5038('0x44')]();});}}catch(_0x8e7103){logger[_0x5038('0xe')](_0x5038('0xd'),_0x353983,JSON[_0x5038('0xf')](_0x8e7103));_0x1e868b[_0x5038('0x26')]();}};}; \ 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 c199e1d..ff0e98b 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 _0x26ab=['[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x48f23b,_0x511a32){var _0x372647=function(_0x30d159){while(--_0x30d159){_0x48f23b['push'](_0x48f23b['shift']());}};_0x372647(++_0x511a32);}(_0x26ab,0xd6));var _0xb26a=function(_0x562d77,_0x2cfc5e){_0x562d77=_0x562d77-0x0;var _0x4e9aa7=_0x26ab[_0x562d77];return _0x4e9aa7;};'use strict';var schema=require(_0xb26a('0x0'));var _=require(_0xb26a('0x1'));var htmlToText=require(_0xb26a('0x2'));var utils=require('./utils');var logger=require(_0xb26a('0x3'))(_0xb26a('0x4'));var gotoif=schema({'condition':{'type':_0xb26a('0x5'),'required':!![],'message':_0xb26a('0x6')},'priorityTrue':{'type':_0xb26a('0x7'),'message':_0xb26a('0x8')},'priorityFalse':{'type':_0xb26a('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xb26a('0x9')]=function(_0x4f208f,_0x4b010f){return function(_0x8180f){try{var _0x59675a={'condition':htmlToText[_0xb26a('0xa')](utils['getMustacheRender'](_0x4b010f[0x0],this),{'wordwrap':![]})[_0xb26a('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4b010f[0x1],'priorityFalse':_0x4b010f[0x2]};var _0x51b1ad=gotoif['validate'](_0x59675a,{'typecast':!![]});if(_0x51b1ad[_0xb26a('0xc')]){logger[_0xb26a('0xd')](_0xb26a('0xe'),_0x4f208f,_[_0xb26a('0xf')](_0x51b1ad,_0xb26a('0x10'))[_0xb26a('0x11')](',\x20'));_0x8180f['stop']();}else{try{var _0x343db5=eval('('+_0x59675a[_0xb26a('0x12')]+')');var _0x680b99=_0x343db5?_0x59675a[_0xb26a('0x13')]:_0x59675a[_0xb26a('0x14')];logger[_0xb26a('0x15')](_0xb26a('0x16'),_0x4f208f,_0x59675a[_0xb26a('0x12')],_0x343db5,_0x680b99||_0xb26a('0x17'));if(_0x680b99){var _0x1f5c0f=_['findIndex'](_0x8180f[_0xb26a('0x18')](),{'p':_0x680b99});if(_0x1f5c0f>=0x0){logger[_0xb26a('0x15')](_0xb26a('0x19'),_0x4f208f,_0x680b99||'next',_0x1f5c0f);_0x8180f[_0xb26a('0x17')](_0x1f5c0f);}else{logger['info'](_0xb26a('0x1a'),_0x4f208f,_0x680b99||_0xb26a('0x17'));_0x8180f[_0xb26a('0x1b')]();}}else{_0x8180f[_0xb26a('0x17')]();}}catch(_0x54cf58){logger[_0xb26a('0xd')](_0xb26a('0x1c'),_0x4f208f,_0x54cf58['message']);_0x8180f[_0xb26a('0x1b')]();}}}catch(_0x5023d0){logger[_0xb26a('0xd')](_0xb26a('0xe'),_0x4f208f,JSON[_0xb26a('0x1d')](_0x5023d0));_0x8180f[_0xb26a('0x1b')]();}};}; \ No newline at end of file +var _0xf292=['message','join','condition','priorityTrue','priorityFalse','info','findIndex','rules','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','validate','length'];(function(_0x494c01,_0x5a74fe){var _0x584980=function(_0x1d2ad5){while(--_0x1d2ad5){_0x494c01['push'](_0x494c01['shift']());}};_0x584980(++_0x5a74fe);}(_0xf292,0x114));var _0x2f29=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf292[_0x321bb2];return _0x9c12ed;};'use strict';var schema=require('validate');var _=require(_0x2f29('0x0'));var htmlToText=require(_0x2f29('0x1'));var utils=require(_0x2f29('0x2'));var logger=require(_0x2f29('0x3'))(_0x2f29('0x4'));var gotoif=schema({'condition':{'type':_0x2f29('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x2f29('0x6'),'message':_0x2f29('0x7')}});exports[_0x2f29('0x8')]=function(_0x1e2a9a,_0x8f2f18){return function(_0x47650a){try{var _0x494cc8={'condition':htmlToText[_0x2f29('0x9')](utils[_0x2f29('0xa')](_0x8f2f18[0x0],this),{'wordwrap':![]})[_0x2f29('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x8f2f18[0x1],'priorityFalse':_0x8f2f18[0x2]};var _0x58cfe5=gotoif[_0x2f29('0xc')](_0x494cc8,{'typecast':!![]});if(_0x58cfe5[_0x2f29('0xd')]){logger['error']('[%s][GOTOIF]\x20%s',_0x1e2a9a,_['map'](_0x58cfe5,_0x2f29('0xe'))[_0x2f29('0xf')](',\x20'));_0x47650a['stop']();}else{try{var _0x13f4d7=eval('('+_0x494cc8[_0x2f29('0x10')]+')');var _0x1f3803=_0x13f4d7?_0x494cc8[_0x2f29('0x11')]:_0x494cc8[_0x2f29('0x12')];logger[_0x2f29('0x13')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x1e2a9a,_0x494cc8[_0x2f29('0x10')],_0x13f4d7,_0x1f3803||'next');if(_0x1f3803){var _0x4c6390=_[_0x2f29('0x14')](_0x47650a[_0x2f29('0x15')](),{'p':_0x1f3803});if(_0x4c6390>=0x0){logger[_0x2f29('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1e2a9a,_0x1f3803||_0x2f29('0x16'),_0x4c6390);_0x47650a[_0x2f29('0x16')](_0x4c6390);}else{logger[_0x2f29('0x13')](_0x2f29('0x17'),_0x1e2a9a,_0x1f3803||_0x2f29('0x16'));_0x47650a[_0x2f29('0x18')]();}}else{_0x47650a['next']();}}catch(_0x2ae852){logger[_0x2f29('0x19')](_0x2f29('0x1a'),_0x1e2a9a,_0x2ae852['message']);_0x47650a[_0x2f29('0x18')]();}}}catch(_0x257c3d){logger[_0x2f29('0x19')](_0x2f29('0x1b'),_0x1e2a9a,JSON[_0x2f29('0x1c')](_0x257c3d));_0x47650a[_0x2f29('0x18')]();}};}; \ 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 21fe97d..ad5ab78 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 _0x5305=['validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','join','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify'];(function(_0x232112,_0x3723be){var _0x464032=function(_0x56283d){while(--_0x56283d){_0x232112['push'](_0x232112['shift']());}};_0x464032(++_0x3723be);}(_0x5305,0x154));var _0x5530=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5305[_0x14add3];return _0x4a174f;};'use strict';var schema=require(_0x5530('0x0'));var _=require(_0x5530('0x1'));var logger=require(_0x5530('0x2'))(_0x5530('0x3'));var gotop=schema({'priority':{'type':_0x5530('0x4'),'required':!![],'message':_0x5530('0x5')}});exports[_0x5530('0x6')]=function(_0x50d50c,_0x175aae){return function(_0x3a8ac5){try{var _0x53603d={'priority':_0x175aae[0x0]};var _0xba2418=gotop[_0x5530('0x0')](_0x53603d,{'typecast':!![]});if(_0xba2418['length']){logger[_0x5530('0x7')](_0x5530('0x8'),_0x50d50c,_[_0x5530('0x9')](_0xba2418,'message')[_0x5530('0xa')](',\x20'));_0x3a8ac5['stop']();}else{logger[_0x5530('0xb')](_0x5530('0xc'),_0x50d50c,_0x53603d['priority']);if(_0x53603d[_0x5530('0xd')]){var _0xe6b043=_['findIndex'](_0x3a8ac5[_0x5530('0xe')](),{'p':_0x53603d[_0x5530('0xd')]});if(_0xe6b043>=0x0){logger[_0x5530('0xb')](_0x5530('0xf'),_0x50d50c,_0x53603d['priority']||_0x5530('0x10'),_0xe6b043);_0x3a8ac5['next'](_0xe6b043);}else{logger[_0x5530('0xb')](_0x5530('0x11'),_0x50d50c,_0x53603d[_0x5530('0xd')]||'next');_0x3a8ac5[_0x5530('0x12')]();}}else{_0x3a8ac5['next']();}}}catch(_0x36ed50){logger[_0x5530('0x7')](_0x5530('0x8'),_0x50d50c,JSON[_0x5530('0x13')](_0x36ed50));_0x3a8ac5[_0x5530('0x12')]();}};}; \ No newline at end of file +var _0x98c3=['stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','consequence','length','error','[%s][GOTOP]\x20%s','map','join'];(function(_0x4e59b5,_0x474bb0){var _0x46fbab=function(_0x1d684f){while(--_0x1d684f){_0x4e59b5['push'](_0x4e59b5['shift']());}};_0x46fbab(++_0x474bb0);}(_0x98c3,0x6e));var _0x398c=function(_0x53a49d,_0x2c14ac){_0x53a49d=_0x53a49d-0x0;var _0xca7693=_0x98c3[_0x53a49d];return _0xca7693;};'use strict';var schema=require(_0x398c('0x0'));var _=require(_0x398c('0x1'));var logger=require(_0x398c('0x2'))(_0x398c('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x398c('0x4')]=function(_0xa1b05c,_0x5f0514){return function(_0x4b0e79){try{var _0xf36bf5={'priority':_0x5f0514[0x0]};var _0x32ed1e=gotop[_0x398c('0x0')](_0xf36bf5,{'typecast':!![]});if(_0x32ed1e[_0x398c('0x5')]){logger[_0x398c('0x6')](_0x398c('0x7'),_0xa1b05c,_[_0x398c('0x8')](_0x32ed1e,'message')[_0x398c('0x9')](',\x20'));_0x4b0e79[_0x398c('0xa')]();}else{logger[_0x398c('0xb')](_0x398c('0xc'),_0xa1b05c,_0xf36bf5['priority']);if(_0xf36bf5[_0x398c('0xd')]){var _0x1d42a8=_[_0x398c('0xe')](_0x4b0e79[_0x398c('0xf')](),{'p':_0xf36bf5[_0x398c('0xd')]});if(_0x1d42a8>=0x0){logger[_0x398c('0xb')](_0x398c('0x10'),_0xa1b05c,_0xf36bf5[_0x398c('0xd')]||_0x398c('0x11'),_0x1d42a8);_0x4b0e79[_0x398c('0x11')](_0x1d42a8);}else{logger['info'](_0x398c('0x12'),_0xa1b05c,_0xf36bf5[_0x398c('0xd')]||'next');_0x4b0e79[_0x398c('0xa')]();}}else{_0x4b0e79[_0x398c('0x11')]();}}}catch(_0x344d9c){logger['error'](_0x398c('0x7'),_0xa1b05c,JSON[_0x398c('0x13')](_0x344d9c));_0x4b0e79['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 ecabfcc..145cbbe 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 _0xfe1b=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','contact','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','channel','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','error'];(function(_0x1b5bc2,_0x453d84){var _0x1a5382=function(_0x4ffafb){while(--_0x4ffafb){_0x1b5bc2['push'](_0x1b5bc2['shift']());}};_0x1a5382(++_0x453d84);}(_0xfe1b,0x15e));var _0xbfe1=function(_0x329e73,_0x1d8488){_0x329e73=_0x329e73-0x0;var _0x373ef6=_0xfe1b[_0x329e73];return _0x373ef6;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0xbfe1('0x0'))(_0xbfe1('0x1'));var rpc={'chatMessage':require(_0xbfe1('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xbfe1('0x3')),'smsMessage':require(_0xbfe1('0x4')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xbfe1('0x5')]=function(_0x394b9a,_0x58d0c5){return function(_0x4e5069){try{var _0x26db23={'body':utils['getMustacheRender'](_0x58d0c5[0x0],this),'ContactId':this[_0xbfe1('0x6')]['id']};if(this['channel']===_0xbfe1('0x7')){_0x26db23[_0xbfe1('0x8')]=this[_0xbfe1('0x9')]['id'];}else{_0x26db23[_['upperFirst'](this['channel'])+_0xbfe1('0xa')]=this[_0xbfe1('0x9')]['id'];}_0x26db23[_[_0xbfe1('0xb')](this['channel'])+_0xbfe1('0xc')]=this[_0xbfe1('0xd')]['id'];if(rpc[this[_0xbfe1('0xe')]+_0xbfe1('0xf')]){return rpc[this[_0xbfe1('0xe')]+_0xbfe1('0xf')][_0xbfe1('0x10')](_0x26db23)[_0xbfe1('0x11')](function(_0x470f4e){logger['info'](_0xbfe1('0x12'),_0x394b9a,_0x26db23[_0xbfe1('0x13')]);_0x4e5069[_0xbfe1('0x14')]();})[_0xbfe1('0x15')](function(_0x4cf140){logger['error'](_0xbfe1('0x12'),_0x394b9a,JSON[_0xbfe1('0x16')](_0x4cf140));_0x4e5069[_0xbfe1('0x17')]();});}}catch(_0x1e5f89){logger[_0xbfe1('0x18')](_0xbfe1('0x12'),_0x394b9a,JSON[_0xbfe1('0x16')](_0x1e5f89));_0x4e5069[_0xbfe1('0x17')]();}};}; \ No newline at end of file +var _0x6be1=['chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','lodash','./utils','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel'];(function(_0x5b55ea,_0x365d81){var _0x125c6b=function(_0xa1514e){while(--_0xa1514e){_0x5b55ea['push'](_0x5b55ea['shift']());}};_0x125c6b(++_0x365d81);}(_0x6be1,0x12f));var _0x16be=function(_0x2e2b23,_0x5d2872){_0x2e2b23=_0x2e2b23-0x0;var _0x21c0a1=_0x6be1[_0x2e2b23];return _0x21c0a1;};'use strict';var _=require(_0x16be('0x0'));var utils=require(_0x16be('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x16be('0x2')),'smsMessage':require(_0x16be('0x3')),'faxMessage':require(_0x16be('0x4')),'whatsappMessage':require(_0x16be('0x5'))};exports[_0x16be('0x6')]=function(_0x5743a,_0x36e4da){return function(_0x19754e){try{var _0x2f6c26={'body':utils[_0x16be('0x7')](_0x36e4da[0x0],this),'ContactId':this['contact']['id']};if(this[_0x16be('0x8')]===_0x16be('0x9')){_0x2f6c26[_0x16be('0xa')]=this[_0x16be('0xb')]['id'];}else{_0x2f6c26[_[_0x16be('0xc')](this[_0x16be('0x8')])+_0x16be('0xd')]=this[_0x16be('0xb')]['id'];}_0x2f6c26[_[_0x16be('0xc')](this[_0x16be('0x8')])+_0x16be('0xe')]=this[_0x16be('0xf')]['id'];if(rpc[this[_0x16be('0x8')]+_0x16be('0x10')]){return rpc[this[_0x16be('0x8')]+_0x16be('0x10')]['create'](_0x2f6c26)[_0x16be('0x11')](function(_0xb321f1){logger[_0x16be('0x12')](_0x16be('0x13'),_0x5743a,_0x2f6c26[_0x16be('0x14')]);_0x19754e['next']();})[_0x16be('0x15')](function(_0xcf91fc){logger['error'](_0x16be('0x13'),_0x5743a,JSON['stringify'](_0xcf91fc));_0x19754e['stop']();});}}catch(_0x5f3095){logger[_0x16be('0x16')](_0x16be('0x13'),_0x5743a,JSON[_0x16be('0x17')](_0x5f3095));_0x19754e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index bf43ed5..6654f2d 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 _0xad49=['info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop','./utils','routing','consequence'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xad49,0x141));var _0x9ad4=function(_0x3326f2,_0x30aedb){_0x3326f2=_0x3326f2-0x0;var _0x2385e8=_0xad49[_0x3326f2];return _0x2385e8;};'use strict';var utils=require(_0x9ad4('0x0'));var logger=require('../../../../config/logger')(_0x9ad4('0x1'));exports[_0x9ad4('0x2')]=function(_0x113c54,_0x1b5252){return function(_0x93f237){try{logger[_0x9ad4('0x3')](_0x9ad4('0x4'),_0x113c54,utils[_0x9ad4('0x5')](_0x1b5252[0x0],this));_0x93f237[_0x9ad4('0x6')]();}catch(_0xcf1f37){logger['error'](_0x9ad4('0x4'),_0x113c54,JSON[_0x9ad4('0x7')](_0xcf1f37));_0x93f237[_0x9ad4('0x8')]();}};}; \ No newline at end of file +var _0xd330=['error','stringify','stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd330,0xc1));var _0x0d33=function(_0x3520be,_0x17579){_0x3520be=_0x3520be-0x0;var _0x56a3de=_0xd330[_0x3520be];return _0x56a3de;};'use strict';var utils=require(_0x0d33('0x0'));var logger=require(_0x0d33('0x1'))(_0x0d33('0x2'));exports[_0x0d33('0x3')]=function(_0x295ee2,_0x1d6f1c){return function(_0x53be8f){try{logger[_0x0d33('0x4')](_0x0d33('0x5'),_0x295ee2,utils[_0x0d33('0x6')](_0x1d6f1c[0x0],this));_0x53be8f['next']();}catch(_0x1a3280){logger[_0x0d33('0x7')](_0x0d33('0x5'),_0x295ee2,JSON[_0x0d33('0x8')](_0x1a3280));_0x53be8f[_0x0d33('0x9')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 6555152..e0c3ae2 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 _0x68f1=['capitalize','InteractionId','format','%sQueuesWaitingInteractions','%s:queue:%s','save','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','from','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','WebsiteId','account','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','timeout','[%s][END:QUEUE][NAME:%s]','update','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','qtimeout','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','queue','joinAt','emit','clone'];(function(_0x4e1bd3,_0xda464d){var _0x234e83=function(_0x144f4d){while(--_0x144f4d){_0x4e1bd3['push'](_0x4e1bd3['shift']());}};_0x234e83(++_0xda464d);}(_0x68f1,0x1d6));var _0x168f=function(_0x3bc828,_0x292b02){_0x3bc828=_0x3bc828-0x0;var _0x47feab=_0x68f1[_0x3bc828];return _0x47feab;};'use strict';var schema=require(_0x168f('0x0'));var _=require(_0x168f('0x1'));var util=require('util');var seqqueue=require(_0x168f('0x2'));var moment=require(_0x168f('0x3'));var Redis=require('ioredis');var config=require(_0x168f('0x4'));var logger=require(_0x168f('0x5'))(_0x168f('0x6'));var strategy=require(_0x168f('0x7'));config[_0x168f('0x8')]=_['defaults'](config[_0x168f('0x8')],{'host':_0x168f('0x9'),'port':0x18eb});var io=require(_0x168f('0xa'))(new Redis(config[_0x168f('0x8')]));var attributes=['id',_0x168f('0xb'),'account',_0x168f('0xc'),'from',_0x168f('0xd')];function emit(_0x7dfe28,_0x23af33,_0x3ec8e8){io['to'](_0x7dfe28)[_0x168f('0xe')](_0x23af33,_0x3ec8e8);}function emitChannelQueueInteraction(_0x54b5d2,_0x94dab2,_0x18d3ae,_0x300623,_0x45b62f,_0x41d9ab,_0x5e1160,_0x3b83b4){var _0x5497a6=_[_0x168f('0xf')](_0x18d3ae);_0x5497a6[_0x168f('0xb')]=_0x3b83b4;_0x5497a6[_0x168f('0xc')]=_0x94dab2;_0x5497a6['account']=_0x300623;_0x5497a6['id']=_0x45b62f;if(_0x41d9ab){attributes['push'](_[_0x168f('0x10')](_0x54b5d2)+_0x168f('0x11'));_0x5e1160[util[_0x168f('0x12')](_0x168f('0x13'),_0x54b5d2)][_0x45b62f]=_['pick'](_0x5497a6,attributes);}else{delete _0x5e1160[util[_0x168f('0x12')]('%sQueuesWaitingInteractions',_0x54b5d2)][_0x45b62f];}emit(util[_0x168f('0x12')](_0x168f('0x14'),_0x54b5d2,_0x94dab2),util[_0x168f('0x12')]('%s_queue_waiting_interaction:%s',_0x54b5d2,_0x41d9ab?_0x168f('0x15'):'remove'),_['pick'](_0x5497a6,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x168f('0x16')),'chatQueueReport':require(_0x168f('0x17')),'smsQueueReport':require(_0x168f('0x18')),'faxQueueReport':require(_0x168f('0x19')),'whatsappQueueReport':require(_0x168f('0x1a'))};var queue=schema({'name':{'type':_0x168f('0x1b'),'required':!![],'message':_0x168f('0x1c')},'timeout':{'type':_0x168f('0x1d'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x592de0,_0x4a1ab4,_0x1e7210,_0x3d90e4){if(_0x592de0&&_0x4a1ab4&&_0x1e7210){_0x4a1ab4[_0x168f('0x1e')]+=0x1;var _0x4ac5f5={'uniqueid':_0x592de0,'from':_0x1e7210[_0x168f('0x1f')]?_0x1e7210[_0x168f('0x1f')][_0x168f('0x20')]:'','joinAt':moment()[_0x168f('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1e7210[_0x168f('0x21')]?_0x1e7210[_0x168f('0x21')]['id']:null,'ListId':_0x1e7210[_0x168f('0x22')]?_0x1e7210[_0x168f('0x22')]['id']:null};_0x4ac5f5[_[_0x168f('0x23')](_0x1e7210[_0x168f('0x24')])+_0x168f('0x25')]=_0x4a1ab4['id']||null;_0x4ac5f5[_[_0x168f('0x23')](_0x1e7210[_0x168f('0x24')])+_0x168f('0x11')]=_0x1e7210[_0x168f('0x26')]?_0x1e7210[_0x168f('0x26')]['id']:null;_0x4ac5f5[_[_0x168f('0x23')](_0x1e7210['channel'])+_0x168f('0x27')]=_0x1e7210[_0x168f('0x28')]?_0x1e7210[_0x168f('0x28')]['id']:null;_0x4ac5f5[_[_0x168f('0x23')](_0x1e7210[_0x168f('0x24')])+(_0x1e7210['channel']!==_0x168f('0x29')?'AccountId':_0x168f('0x2a'))]=_0x1e7210['account']?_0x1e7210[_0x168f('0x2b')]['id']:null;logger[_0x168f('0x2c')](util[_0x168f('0x12')](_0x168f('0x2d'),_0x592de0,_0x4a1ab4[_0x168f('0x2e')]));emitChannelQueueInteraction(_0x1e7210['channel'],_0x4a1ab4[_0x168f('0x2e')],_0x4ac5f5,_0x1e7210[_0x168f('0x2b')][_0x168f('0x2e')],_0x1e7210[_0x168f('0x28')]['id'],!![],_0x3d90e4,_0x4a1ab4['id']);if(rpc[_0x1e7210['channel']+_0x168f('0x2f')]){return rpc[_0x1e7210[_0x168f('0x24')]+_0x168f('0x2f')][_0x168f('0x30')](_0x4ac5f5)[_0x168f('0x31')](function(_0x1482a7){logger[_0x168f('0x32')](_0x168f('0x33'));});}}}function stopRouting(_0x2f957b,_0x403ebf,_0xf0006c,_0xc620dc){if(_0x2f957b&&_0x403ebf){_0x403ebf[_0x168f('0x1e')]-=0x1;var _0xe2b088={'leaveAt':moment()[_0x168f('0x12')](_0x168f('0x34')),'acceptAt':moment()[_0x168f('0x12')](_0x168f('0x34')),'reason':_0x168f('0x35')};logger[_0x168f('0x2c')](util[_0x168f('0x12')]('[%s][STOP:QUEUE][NAME:%s]',_0x2f957b,_0x403ebf[_0x168f('0x2e')]));emitChannelQueueInteraction(_0xf0006c[_0x168f('0x24')],_0x403ebf['name'],_0xf0006c[_0x168f('0x1f')],_0xf0006c[_0x168f('0x2b')][_0x168f('0x2e')],_0xf0006c['message']['id'],![],_0xc620dc,_0x403ebf['id']);if(rpc[_0xf0006c[_0x168f('0x24')]+_0x168f('0x2f')]){return rpc[_0xf0006c[_0x168f('0x24')]+_0x168f('0x2f')]['update'](_0x2f957b,_0xe2b088)[_0x168f('0x31')](function(_0xd1f770){logger[_0x168f('0x32')]('update\x20queue\x20report');});}}}function endRouting(_0x173e14,_0x98de6b,_0x3be074,_0x55c6b5){if(_0x173e14&&_0x98de6b){_0x98de6b['waiting']-=0x1;var _0x18be29={'leaveAt':moment()[_0x168f('0x12')](_0x168f('0x34')),'exitAt':moment()[_0x168f('0x12')](_0x168f('0x34')),'reason':_0x168f('0x36')};logger[_0x168f('0x2c')](util['format'](_0x168f('0x37'),_0x173e14,_0x98de6b['name']));emitChannelQueueInteraction(_0x3be074[_0x168f('0x24')],_0x98de6b[_0x168f('0x2e')],_0x3be074[_0x168f('0x1f')],_0x3be074[_0x168f('0x2b')][_0x168f('0x2e')],_0x3be074['message']['id'],![],_0x55c6b5);if(rpc[_0x3be074[_0x168f('0x24')]+_0x168f('0x2f')]){return rpc[_0x3be074['channel']+_0x168f('0x2f')][_0x168f('0x38')](_0x173e14,_0x18be29)[_0x168f('0x31')](function(_0x234daa){logger[_0x168f('0x32')](_0x168f('0x39'));});}}}function handleFindQueue(_0x5dec94){return function(_0xb0dfd){return _0xb0dfd[_0x168f('0x2e')][_0x168f('0x3a')]()===_0x5dec94[_0x168f('0x3a')]();};}exports[_0x168f('0x3b')]=function(_0x23c30b,_0x528445,_0xb00030,_0x54444d){return function(_0x310f17){try{var _0x4870ca={'name':_0x528445[0x0],'timeout':_0x528445[0x1]};var _0x53172e=queue[_0x168f('0x0')](_0x4870ca,{'typecast':!![]});if(_0x53172e[_0x168f('0x3c')]){logger[_0x168f('0x32')](_0x168f('0x3d'),_0x23c30b,_[_0x168f('0x3e')](_0x53172e,_0x168f('0x28'))[_0x168f('0x3f')](',\x20'));_0x310f17[_0x168f('0x40')]();}else{var _0x256ac0=_[_0x168f('0x41')](_0xb00030[_0x54444d[_0x168f('0x24')]+_0x168f('0x42')],handleFindQueue(_0x4870ca['name']));if(_0x256ac0){startRouting(_0x23c30b,_0x256ac0,_0x54444d,_0xb00030);var _0x479051=(_0x256ac0[_0x168f('0x36')]||0xa)*0x3e8;var _0x5f2ad5=(_0x4870ca[_0x168f('0x36')]||0x14)*0x3e8;var _0x478dfe;if(_0x479051>_0x5f2ad5){_0x5f2ad5=_0x479051;}var _0x56bb35=seqqueue[_0x168f('0x43')](_0x479051);_0x56bb35['id']=_0x23c30b;_0x56bb35['atimeout']=_0x479051;_0x56bb35[_0x168f('0x44')]=_0x5f2ad5;_0x56bb35[_0x168f('0x24')]=_0x54444d[_0x168f('0x24')];_0xb00030['rules'][_0x23c30b]['on']('end',function(){logger[_0x168f('0x2c')](_0x168f('0x45'),_0x23c30b);stopRouting(_0x23c30b,_0x256ac0,_0x54444d,_0xb00030);clearTimeout(_0x478dfe);_0x478dfe=undefined;_0x56bb35[_0x168f('0x46')](!![]);if(_0xb00030[_0x168f('0x47')][_0x23c30b]){delete _0xb00030[_0x168f('0x47')][_0x23c30b];}_0x310f17['stop']();});_0xb00030['rules'][_0x23c30b]['on'](_0x168f('0x48'),function(){if(_0xb00030['rules'][_0x23c30b]){delete _0xb00030['rules'][_0x23c30b];}});_0x478dfe=setTimeout(function(){logger[_0x168f('0x2c')](_0x168f('0x49'),_0x23c30b);endRouting(_0x23c30b,_0x256ac0,_0x54444d,_0xb00030);clearTimeout(_0x478dfe);_0x56bb35[_0x168f('0x46')](!![]);_0x310f17[_0x168f('0x4a')]();},_0x5f2ad5);switch(_0x256ac0[_0x168f('0x4b')]){case _0x168f('0x4c'):strategy['rrmemory'](_0x56bb35,_0x256ac0,_0xb00030,_0x54444d);break;default:strategy[_0x168f('0x4d')](_0x56bb35,_0x256ac0,_0xb00030,_0x54444d);}}else{logger['error'](_0x168f('0x4e'),_0x23c30b,_0x4870ca['name']);_0x310f17[_0x168f('0x40')]();}}}catch(_0x365be6){console[_0x168f('0x4f')](_0x365be6);logger['error'](_0x168f('0x3d'),_0x23c30b,_0x365be6[_0x168f('0x50')]);_0x310f17[_0x168f('0x40')]();}};}; \ No newline at end of file +var _0x2250=['[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','YYYY-MM-DD\x20HH:mm:ss','accepted','info','update','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','timeout','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','queue_id','account','from','joinAt','emit','clone','queue','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat'];(function(_0xa43d11,_0x5a70b6){var _0x265ce9=function(_0x366bd5){while(--_0x366bd5){_0xa43d11['push'](_0xa43d11['shift']());}};_0x265ce9(++_0x5a70b6);}(_0x2250,0xba));var _0x0225=function(_0x290ef5,_0x32cfa7){_0x290ef5=_0x290ef5-0x0;var _0x450d92=_0x2250[_0x290ef5];return _0x450d92;};'use strict';var schema=require(_0x0225('0x0'));var _=require(_0x0225('0x1'));var util=require('util');var seqqueue=require(_0x0225('0x2'));var moment=require('moment');var Redis=require(_0x0225('0x3'));var config=require(_0x0225('0x4'));var logger=require(_0x0225('0x5'))(_0x0225('0x6'));var strategy=require('./strategy');config[_0x0225('0x7')]=_[_0x0225('0x8')](config[_0x0225('0x7')],{'host':_0x0225('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x0225('0xa'),_0x0225('0xb'),'queue',_0x0225('0xc'),_0x0225('0xd')];function emit(_0x9f5f20,_0x6fb12,_0x5d9e33){io['to'](_0x9f5f20)[_0x0225('0xe')](_0x6fb12,_0x5d9e33);}function emitChannelQueueInteraction(_0x2ac20c,_0x6007f2,_0x366bbb,_0x34464a,_0x2e25c4,_0x4f0478,_0x4caa74,_0x45b9af){var _0x362443=_[_0x0225('0xf')](_0x366bbb);_0x362443[_0x0225('0xa')]=_0x45b9af;_0x362443[_0x0225('0x10')]=_0x6007f2;_0x362443['account']=_0x34464a;_0x362443['id']=_0x2e25c4;if(_0x4f0478){attributes['push'](_[_0x0225('0x11')](_0x2ac20c)+_0x0225('0x12'));_0x4caa74[util[_0x0225('0x13')](_0x0225('0x14'),_0x2ac20c)][_0x2e25c4]=_[_0x0225('0x15')](_0x362443,attributes);}else{delete _0x4caa74[util[_0x0225('0x13')](_0x0225('0x14'),_0x2ac20c)][_0x2e25c4];}emit(util[_0x0225('0x13')](_0x0225('0x16'),_0x2ac20c,_0x6007f2),util[_0x0225('0x13')](_0x0225('0x17'),_0x2ac20c,_0x4f0478?'save':_0x0225('0x18')),_[_0x0225('0x15')](_0x362443,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x0225('0x19')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x0225('0x1a')),'faxQueueReport':require(_0x0225('0x1b')),'whatsappQueueReport':require(_0x0225('0x1c'))};var queue=schema({'name':{'type':_0x0225('0x1d'),'required':!![],'message':_0x0225('0x1e')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x334b25,_0x299b54,_0x2cc08e,_0x1e58d2){if(_0x334b25&&_0x299b54&&_0x2cc08e){_0x299b54[_0x0225('0x1f')]+=0x1;var _0x4bd7c5={'uniqueid':_0x334b25,'from':_0x2cc08e[_0x0225('0x20')]?_0x2cc08e['body'][_0x0225('0xc')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2cc08e[_0x0225('0x21')]?_0x2cc08e[_0x0225('0x21')]['id']:null,'ListId':_0x2cc08e['list']?_0x2cc08e[_0x0225('0x22')]['id']:null};_0x4bd7c5[_[_0x0225('0x23')](_0x2cc08e[_0x0225('0x24')])+_0x0225('0x25')]=_0x299b54['id']||null;_0x4bd7c5[_[_0x0225('0x23')](_0x2cc08e['channel'])+'InteractionId']=_0x2cc08e['interaction']?_0x2cc08e[_0x0225('0x26')]['id']:null;_0x4bd7c5[_[_0x0225('0x23')](_0x2cc08e['channel'])+_0x0225('0x27')]=_0x2cc08e[_0x0225('0x28')]?_0x2cc08e[_0x0225('0x28')]['id']:null;_0x4bd7c5[_[_0x0225('0x23')](_0x2cc08e['channel'])+(_0x2cc08e[_0x0225('0x24')]!==_0x0225('0x29')?'AccountId':'WebsiteId')]=_0x2cc08e[_0x0225('0xb')]?_0x2cc08e[_0x0225('0xb')]['id']:null;logger['info'](util['format'](_0x0225('0x2a'),_0x334b25,_0x299b54[_0x0225('0x2b')]));emitChannelQueueInteraction(_0x2cc08e[_0x0225('0x24')],_0x299b54[_0x0225('0x2b')],_0x4bd7c5,_0x2cc08e[_0x0225('0xb')][_0x0225('0x2b')],_0x2cc08e[_0x0225('0x28')]['id'],!![],_0x1e58d2,_0x299b54['id']);if(rpc[_0x2cc08e[_0x0225('0x24')]+_0x0225('0x2c')]){return rpc[_0x2cc08e[_0x0225('0x24')]+_0x0225('0x2c')][_0x0225('0x2d')](_0x4bd7c5)[_0x0225('0x2e')](function(_0x307e7e){logger[_0x0225('0x2f')]('create\x20queue\x20report');});}}}function stopRouting(_0x3edd74,_0x48c0c3,_0xdebe93,_0x56ed30){if(_0x3edd74&&_0x48c0c3){_0x48c0c3[_0x0225('0x1f')]-=0x1;var _0x216ab6={'leaveAt':moment()[_0x0225('0x13')](_0x0225('0x30')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x0225('0x31')};logger[_0x0225('0x32')](util[_0x0225('0x13')]('[%s][STOP:QUEUE][NAME:%s]',_0x3edd74,_0x48c0c3['name']));emitChannelQueueInteraction(_0xdebe93[_0x0225('0x24')],_0x48c0c3[_0x0225('0x2b')],_0xdebe93['body'],_0xdebe93[_0x0225('0xb')]['name'],_0xdebe93[_0x0225('0x28')]['id'],![],_0x56ed30,_0x48c0c3['id']);if(rpc[_0xdebe93[_0x0225('0x24')]+_0x0225('0x2c')]){return rpc[_0xdebe93['channel']+_0x0225('0x2c')][_0x0225('0x33')](_0x3edd74,_0x216ab6)[_0x0225('0x2e')](function(_0x1c2239){logger[_0x0225('0x2f')](_0x0225('0x34'));});}}}function endRouting(_0x330eaf,_0x5a1902,_0x5662d8,_0x40d5c2){if(_0x330eaf&&_0x5a1902){_0x5a1902[_0x0225('0x1f')]-=0x1;var _0x3bf154={'leaveAt':moment()[_0x0225('0x13')](_0x0225('0x30')),'exitAt':moment()[_0x0225('0x13')](_0x0225('0x30')),'reason':'timeout'};logger[_0x0225('0x32')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x330eaf,_0x5a1902[_0x0225('0x2b')]));emitChannelQueueInteraction(_0x5662d8[_0x0225('0x24')],_0x5a1902[_0x0225('0x2b')],_0x5662d8[_0x0225('0x20')],_0x5662d8[_0x0225('0xb')][_0x0225('0x2b')],_0x5662d8[_0x0225('0x28')]['id'],![],_0x40d5c2);if(rpc[_0x5662d8[_0x0225('0x24')]+_0x0225('0x2c')]){return rpc[_0x5662d8[_0x0225('0x24')]+'QueueReport'][_0x0225('0x33')](_0x330eaf,_0x3bf154)[_0x0225('0x2e')](function(_0x294d56){logger[_0x0225('0x2f')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x2781f2){return function(_0x376be7){return _0x376be7[_0x0225('0x2b')]['toLowerCase']()===_0x2781f2[_0x0225('0x35')]();};}exports[_0x0225('0x36')]=function(_0x5f0dd1,_0x15019a,_0x3aea4b,_0x66ade){return function(_0x19f17e){try{var _0x4ed4f8={'name':_0x15019a[0x0],'timeout':_0x15019a[0x1]};var _0x1e3138=queue[_0x0225('0x0')](_0x4ed4f8,{'typecast':!![]});if(_0x1e3138[_0x0225('0x37')]){logger[_0x0225('0x2f')](_0x0225('0x38'),_0x5f0dd1,_[_0x0225('0x39')](_0x1e3138,_0x0225('0x28'))['join'](',\x20'));_0x19f17e[_0x0225('0x3a')]();}else{var _0x524fc7=_[_0x0225('0x3b')](_0x3aea4b[_0x66ade[_0x0225('0x24')]+'Queues'],handleFindQueue(_0x4ed4f8[_0x0225('0x2b')]));if(_0x524fc7){startRouting(_0x5f0dd1,_0x524fc7,_0x66ade,_0x3aea4b);var _0x3c8c86=(_0x524fc7[_0x0225('0x3c')]||0xa)*0x3e8;var _0x58048f=(_0x4ed4f8['timeout']||0x14)*0x3e8;var _0x451b9a;if(_0x3c8c86>_0x58048f){_0x58048f=_0x3c8c86;}var _0x577fd8=seqqueue[_0x0225('0x3d')](_0x3c8c86);_0x577fd8['id']=_0x5f0dd1;_0x577fd8[_0x0225('0x3e')]=_0x3c8c86;_0x577fd8[_0x0225('0x3f')]=_0x58048f;_0x577fd8[_0x0225('0x24')]=_0x66ade[_0x0225('0x24')];_0x3aea4b[_0x0225('0x40')][_0x5f0dd1]['on'](_0x0225('0x41'),function(){logger[_0x0225('0x32')](_0x0225('0x42'),_0x5f0dd1);stopRouting(_0x5f0dd1,_0x524fc7,_0x66ade,_0x3aea4b);clearTimeout(_0x451b9a);_0x451b9a=undefined;_0x577fd8[_0x0225('0x43')](!![]);if(_0x3aea4b[_0x0225('0x40')][_0x5f0dd1]){delete _0x3aea4b[_0x0225('0x40')][_0x5f0dd1];}_0x19f17e[_0x0225('0x3a')]();});_0x3aea4b[_0x0225('0x40')][_0x5f0dd1]['on'](_0x0225('0x44'),function(){if(_0x3aea4b['rules'][_0x5f0dd1]){delete _0x3aea4b[_0x0225('0x40')][_0x5f0dd1];}});_0x451b9a=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x5f0dd1);endRouting(_0x5f0dd1,_0x524fc7,_0x66ade,_0x3aea4b);clearTimeout(_0x451b9a);_0x577fd8[_0x0225('0x43')](!![]);_0x19f17e[_0x0225('0x45')]();},_0x58048f);switch(_0x524fc7[_0x0225('0x46')]){case _0x0225('0x47'):strategy['rrmemory'](_0x577fd8,_0x524fc7,_0x3aea4b,_0x66ade);break;default:strategy[_0x0225('0x48')](_0x577fd8,_0x524fc7,_0x3aea4b,_0x66ade);}}else{logger['error'](_0x0225('0x49'),_0x5f0dd1,_0x4ed4f8[_0x0225('0x2b')]);_0x19f17e[_0x0225('0x3a')]();}}}catch(_0x5e8bce){console[_0x0225('0x4a')](_0x5e8bce);logger['error']('[%s][QUEUE]\x20%s',_0x5f0dd1,_0x5e8bce[_0x0225('0x4b')]);_0x19f17e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 8ff3217..4cca70f 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 _0x032e=['hideNotification','removeWaitingNotification','STOP','exports','lodash','./util','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','saveWaitingNotification','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s'];(function(_0x317e4d,_0x14206e){var _0x34c38f=function(_0x4b12d1){while(--_0x4b12d1){_0x317e4d['push'](_0x317e4d['shift']());}};_0x34c38f(++_0x14206e);}(_0x032e,0x124));var _0xe032=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x032e[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0xe032('0x0'));var uuid=require('uuid');var util=require(_0xe032('0x1'));var logger=require(_0xe032('0x2'))('routing');var Agent=function(_0x4afba2,_0x45ab5b,_0x2ce001,_0x2f44f6){this[_0xe032('0x3')]=uuid['v4']();this[_0xe032('0x4')]=_0x4afba2;this[_0xe032('0x5')]=_0x45ab5b;this[_0xe032('0x6')]=_0x2ce001;this[_0xe032('0x7')]=_0x2f44f6;this[_0xe032('0x4')][_0xe032('0x8')](this[_0xe032('0x9')][_0xe032('0xa')](this),this[_0xe032('0xb')][_0xe032('0xa')](this));this[_0xe032('0x4')]['on'](_0xe032('0xc'),this[_0xe032('0xb')][_0xe032('0xa')](this));this['squeue']['on'](_0xe032('0xd'),this[_0xe032('0xe')][_0xe032('0xa')](this));};Agent[_0xe032('0xf')][_0xe032('0x8')]=function(){this[_0xe032('0x4')][_0xe032('0x8')](this['handleRun'][_0xe032('0xa')](this),this[_0xe032('0xb')][_0xe032('0xa')](this));};Agent[_0xe032('0xf')]['handleDrained']=function(){this[_0xe032('0xb')](!![]);};Agent[_0xe032('0xf')][_0xe032('0x9')]=function(){logger[_0xe032('0x10')](_0xe032('0x11'),this[_0xe032('0x4')]['id'],this[_0xe032('0x5')]['id']);if(_['isNil'](this[_0xe032('0x6')][_0xe032('0x12')][this[_0xe032('0x5')]['id']])){logger[_0xe032('0x10')](_0xe032('0x13'),this[_0xe032('0x4')]['id'],this['agent']['id']);setTimeout(this[_0xe032('0x8')][_0xe032('0xa')](this),0x3e8);}else{if(this[_0xe032('0x7')][_0xe032('0x14')]||util[_0xe032('0x15')](this['squeue']['id'],this['realtime']['agents'][this[_0xe032('0x5')]['id']],this['squeue'][_0xe032('0x16')],![])){this[_0xe032('0x6')][_0xe032('0x12')][this[_0xe032('0x5')]['id']][_0xe032('0x17')]=!![];this[_0xe032('0x6')][_0xe032('0x12')][this['agent']['id']][_0xe032('0x18')]=undefined;util[_0xe032('0x19')](this[_0xe032('0x6')],this[_0xe032('0x7')],this[_0xe032('0x5')],this[_0xe032('0x4')][_0xe032('0x16')]);util[_0xe032('0x1a')](this['notificationId'],this['squeue']['id'],this['realtime'][_0xe032('0x12')][this[_0xe032('0x5')]['id']],null,this[_0xe032('0x7')]);util[_0xe032('0x1b')](this[_0xe032('0x4')]['id'],this[_0xe032('0x6')][_0xe032('0x12')][this[_0xe032('0x5')]['id']],_0xe032('0x1c')+(this[_0xe032('0x7')]['forcedOwnership']?_0xe032('0x1d'):''));}else{logger[_0xe032('0x10')](_0xe032('0x1e'),this[_0xe032('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0xe032('0xa')](this),0x3e8);}}};Agent[_0xe032('0xf')][_0xe032('0xb')]=function(_0xae116e){if(_['isNil'](this['realtime']['agents'][this[_0xe032('0x5')]['id']])){return logger[_0xe032('0x10')](_0xe032('0x13'),this[_0xe032('0x4')]['id'],this['agent']['id']);}else{logger[_0xe032('0x10')](_0xe032('0x1f'),this[_0xe032('0x4')]['id'],this[_0xe032('0x5')]['id']);util[_0xe032('0x20')](this['notificationId'],this[_0xe032('0x4')]['id'],this[_0xe032('0x6')][_0xe032('0x12')][this[_0xe032('0x5')]['id']],null,this['routing']);this[_0xe032('0x6')]['agents'][this[_0xe032('0x5')]['id']]['busy']=![];this[_0xe032('0x6')]['agents'][this[_0xe032('0x5')]['id']]['busyQueue']=undefined;util[_0xe032('0x21')](this[_0xe032('0x6')],this['routing'],this[_0xe032('0x5')],this[_0xe032('0x4')][_0xe032('0x16')]);util[_0xe032('0x1b')](this['squeue']['id'],this[_0xe032('0x6')]['agents'][this[_0xe032('0x5')]['id']],_0xae116e?_0xe032('0x22'):'TIMEOUT');}if(!_0xae116e){setTimeout(this[_0xe032('0x8')][_0xe032('0xa')](this),0x3e8);}};function agent(_0x4a4447,_0x3efdef,_0x2cfc49,_0x3cc437){return new Agent(_0x4a4447,_0x3efdef,_0x2cfc49,_0x3cc437);}module[_0xe032('0x23')]=agent; \ No newline at end of file +var _0xe5b3=['exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','handleRun','bind','handleTimeout','drained','handleDrained','prototype','push','[%s][AGENT]\x20try\x20with\x20%s','realtime','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','agents','channel','busy','busyQueue','saveWaitingNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','TIMEOUT'];(function(_0x5aab9b,_0x311667){var _0x11df27=function(_0xcc8d5e){while(--_0xcc8d5e){_0x5aab9b['push'](_0x5aab9b['shift']());}};_0x11df27(++_0x311667);}(_0xe5b3,0x133));var _0x3e5b=function(_0x378ee1,_0x2786a0){_0x378ee1=_0x378ee1-0x0;var _0xdb7a8e=_0xe5b3[_0x378ee1];return _0xdb7a8e;};'use strict';var _=require('lodash');var uuid=require(_0x3e5b('0x0'));var util=require(_0x3e5b('0x1'));var logger=require(_0x3e5b('0x2'))(_0x3e5b('0x3'));var Agent=function(_0x2a71ef,_0x3171c5,_0x7f1cc0,_0x1e58ed){this[_0x3e5b('0x4')]=uuid['v4']();this[_0x3e5b('0x5')]=_0x2a71ef;this[_0x3e5b('0x6')]=_0x3171c5;this['realtime']=_0x7f1cc0;this[_0x3e5b('0x3')]=_0x1e58ed;this[_0x3e5b('0x5')]['push'](this[_0x3e5b('0x7')][_0x3e5b('0x8')](this),this[_0x3e5b('0x9')][_0x3e5b('0x8')](this));this['squeue']['on']('timeout',this[_0x3e5b('0x9')][_0x3e5b('0x8')](this));this[_0x3e5b('0x5')]['on'](_0x3e5b('0xa'),this[_0x3e5b('0xb')]['bind'](this));};Agent[_0x3e5b('0xc')]['push']=function(){this[_0x3e5b('0x5')][_0x3e5b('0xd')](this[_0x3e5b('0x7')][_0x3e5b('0x8')](this),this[_0x3e5b('0x9')][_0x3e5b('0x8')](this));};Agent[_0x3e5b('0xc')]['handleDrained']=function(){this[_0x3e5b('0x9')](!![]);};Agent['prototype']['handleRun']=function(){logger['debug'](_0x3e5b('0xe'),this[_0x3e5b('0x5')]['id'],this[_0x3e5b('0x6')]['id']);if(_['isNil'](this[_0x3e5b('0xf')]['agents'][this['agent']['id']])){logger[_0x3e5b('0x10')](_0x3e5b('0x11'),this['squeue']['id'],this[_0x3e5b('0x6')]['id']);setTimeout(this[_0x3e5b('0xd')]['bind'](this),0x3e8);}else{if(this[_0x3e5b('0x3')][_0x3e5b('0x12')]||util['isAgentAvailable'](this['squeue']['id'],this[_0x3e5b('0xf')][_0x3e5b('0x13')][this[_0x3e5b('0x6')]['id']],this[_0x3e5b('0x5')][_0x3e5b('0x14')],![])){this[_0x3e5b('0xf')][_0x3e5b('0x13')][this[_0x3e5b('0x6')]['id']][_0x3e5b('0x15')]=!![];this[_0x3e5b('0xf')][_0x3e5b('0x13')][this[_0x3e5b('0x6')]['id']][_0x3e5b('0x16')]=undefined;util[_0x3e5b('0x17')](this['realtime'],this[_0x3e5b('0x3')],this[_0x3e5b('0x6')],this[_0x3e5b('0x5')][_0x3e5b('0x14')]);util['showNotification'](this[_0x3e5b('0x4')],this['squeue']['id'],this[_0x3e5b('0xf')][_0x3e5b('0x13')][this['agent']['id']],null,this[_0x3e5b('0x3')]);util[_0x3e5b('0x18')](this[_0x3e5b('0x5')]['id'],this[_0x3e5b('0xf')][_0x3e5b('0x13')][this[_0x3e5b('0x6')]['id']],_0x3e5b('0x19')+(this[_0x3e5b('0x3')]['forcedOwnership']?_0x3e5b('0x1a'):''));}else{logger['debug'](_0x3e5b('0x1b'),this['squeue']['id'],this[_0x3e5b('0x6')]['id']);setTimeout(this[_0x3e5b('0xd')][_0x3e5b('0x8')](this),0x3e8);}}};Agent[_0x3e5b('0xc')][_0x3e5b('0x9')]=function(_0x3cfaf6){if(_[_0x3e5b('0x1c')](this[_0x3e5b('0xf')][_0x3e5b('0x13')][this[_0x3e5b('0x6')]['id']])){return logger[_0x3e5b('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x3e5b('0x5')]['id'],this[_0x3e5b('0x6')]['id']);}else{logger[_0x3e5b('0x10')](_0x3e5b('0x1d'),this[_0x3e5b('0x5')]['id'],this[_0x3e5b('0x6')]['id']);util[_0x3e5b('0x1e')](this['notificationId'],this[_0x3e5b('0x5')]['id'],this['realtime']['agents'][this[_0x3e5b('0x6')]['id']],null,this[_0x3e5b('0x3')]);this['realtime'][_0x3e5b('0x13')][this[_0x3e5b('0x6')]['id']][_0x3e5b('0x15')]=![];this[_0x3e5b('0xf')][_0x3e5b('0x13')][this[_0x3e5b('0x6')]['id']][_0x3e5b('0x16')]=undefined;util[_0x3e5b('0x1f')](this[_0x3e5b('0xf')],this[_0x3e5b('0x3')],this[_0x3e5b('0x6')],this[_0x3e5b('0x5')]['channel']);util[_0x3e5b('0x18')](this[_0x3e5b('0x5')]['id'],this['realtime']['agents'][this[_0x3e5b('0x6')]['id']],_0x3cfaf6?'STOP':_0x3e5b('0x20'));}if(!_0x3cfaf6){setTimeout(this[_0x3e5b('0xd')][_0x3e5b('0x8')](this),0x3e8);}};function agent(_0x32594a,_0x5389e3,_0x18b07f,_0x4cdcb1){return new Agent(_0x32594a,_0x5389e3,_0x18b07f,_0x4cdcb1);}module[_0x3e5b('0x21')]=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 8554f1f..851d106 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 _0x2f7d=['[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','busy','removeWaitingNotification','channel','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','queue','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','writeLog','busyQueue','name','saveWaitingNotification','showNotification','routing'];(function(_0x43c5b0,_0x42f837){var _0x4e5e2d=function(_0x1151a5){while(--_0x1151a5){_0x43c5b0['push'](_0x43c5b0['shift']());}};_0x4e5e2d(++_0x42f837);}(_0x2f7d,0x1b8));var _0xd2f7=function(_0x349707,_0x3e468d){_0x349707=_0x349707-0x0;var _0x33b6b7=_0x2f7d[_0x349707];return _0x33b6b7;};'use strict';var _=require(_0xd2f7('0x0'));var uuid=require(_0xd2f7('0x1'));var util=require(_0xd2f7('0x2'));var logger=require(_0xd2f7('0x3'))('routing');var Beepall=function(_0x2dc815,_0xb398b5,_0x2e2335,_0x97545a){this[_0xd2f7('0x4')]=uuid['v4']();this[_0xd2f7('0x5')]=_0x2dc815;this['queue']=_0xb398b5;this[_0xd2f7('0x6')]=_0x2e2335;this['routing']=_0x97545a;this[_0xd2f7('0x5')][_0xd2f7('0x7')](this[_0xd2f7('0x8')][_0xd2f7('0x9')](this),this[_0xd2f7('0xa')]['bind'](this));this[_0xd2f7('0x5')]['on'](_0xd2f7('0xb'),this[_0xd2f7('0xa')][_0xd2f7('0x9')](this));this[_0xd2f7('0x5')]['on'](_0xd2f7('0xc'),this[_0xd2f7('0xd')][_0xd2f7('0x9')](this));};Beepall[_0xd2f7('0xe')]['push']=function(){this[_0xd2f7('0x5')][_0xd2f7('0x7')](this[_0xd2f7('0x8')][_0xd2f7('0x9')](this),this[_0xd2f7('0xa')]['bind'](this));};Beepall[_0xd2f7('0xe')][_0xd2f7('0xd')]=function(){this['handleTimeout'](!![]);};Beepall[_0xd2f7('0xe')][_0xd2f7('0x8')]=function(){var _0x102db7=!![];if(!_[_0xd2f7('0xf')](this['queue'])&&!_[_0xd2f7('0xf')](this[_0xd2f7('0x10')]['Agents'])&&this[_0xd2f7('0x10')][_0xd2f7('0x11')]['length']>0x0){for(var _0x38d85d=0x0,_0x2a803b;_0x38d85d0x0){for(var _0x4715e3=0x0,_0x2fe383;_0x4715e30x0&&_0x4ac006[_0x2377a9+_0xb78d('0x21')]>=_0x4ac006[_0x2377a9+_0xb78d('0x1f')]){writeLog(_0x68ff9e,_0x4ac006,_0x2377a9[_0xb78d('0x22')]()+_0xb78d('0x23'));return![];}}return!![];};exports['showNotification']=function(_0x6acad0,_0x4343e0,_0x1c4215,_0x4188a9,_0x515b8e){return sendNotification(!![],_0x6acad0,_0x4343e0,_0x1c4215,_0x4188a9,_0x515b8e);};exports[_0xb78d('0x24')]=function(_0x5cfd6b,_0x59c4a2,_0x4212b7,_0x41bd34,_0x4ec655){return sendNotification(![],_0x5cfd6b,_0x59c4a2,_0x4212b7,_0x41bd34,_0x4ec655);};exports[_0xb78d('0x25')]=function(_0x1756f4,_0x1fe6f6,_0x1ae3da){var _0x40174a=_0x1fe6f6[_0xb78d('0x26')][_0xb78d('0x27')];if(!_0x40174a&&_0x1ae3da){_0x40174a=_0x1ae3da['id'];}var _0x1ffc62=_[_0xb78d('0x28')](_0x1756f4[_0x1fe6f6[_0xb78d('0x29')]+'QueuesWaitingInteractions'],function(_0x64d722){var _0x113a74=_[_0xb78d('0x2a')](_0x1fe6f6[_0xb78d('0x29')])+_0xb78d('0x2b');return _0x64d722[_0x113a74]===_0x1fe6f6[_0xb78d('0x26')]['id'];});if(!_0x1ffc62&&_0x40174a){_0x1ffc62=_[_0xb78d('0x28')](_0x1756f4[_0xb78d('0x2c')][_0x40174a][_0x1fe6f6[_0xb78d('0x29')]+_0xb78d('0x2d')],function(_0x250e56){return _0x250e56['id']===_0x1fe6f6[_0xb78d('0x26')]['id'];});}return _0x1ffc62;};exports[_0xb78d('0x2e')]=function(_0x40c2a5,_0x1c0f7e,_0x468c97,_0x1e02ff){_0x40c2a5[_0xb78d('0x2c')][_0x468c97['id']][_0x1e02ff+_0xb78d('0x2d')][_0x1c0f7e[_0xb78d('0x16')]['id']]={'id':_0x1c0f7e[_0xb78d('0x26')]['id']};};exports[_0xb78d('0x2f')]=function(_0x537548,_0x1a5679,_0x3a7dc3,_0x375e71){delete _0x537548['agents'][_0x3a7dc3['id']][_0x375e71+_0xb78d('0x2d')][_0x1a5679[_0xb78d('0x16')]['id']];};exports['writeLog']=writeLog; \ No newline at end of file +var _0xa3cf=['debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','\x20MAXCAPACITY','showNotification','checkWaitingNotifications','UserId','some','channel','QueuesWaitingInteractions','capitalize','interaction','agents','saveWaitingNotification','WaitingInteractions','removeWaitingNotification','writeLog','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','localhost','socket.io-emitter','format','user:%s','name','emit','user:save','split','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','notification:%s','save','remove'];(function(_0x4d924e,_0x3124bc){var _0x10b717=function(_0x59d14a){while(--_0x59d14a){_0x4d924e['push'](_0x4d924e['shift']());}};_0x10b717(++_0x3124bc);}(_0xa3cf,0xed));var _0xfa3c=function(_0xf2222d,_0x37433b){_0xf2222d=_0xf2222d-0x0;var _0x305f7e=_0xa3cf[_0xf2222d];return _0x305f7e;};'use strict';var _=require('lodash');var util=require(_0xfa3c('0x0'));var utils=require(_0xfa3c('0x1'));var Redis=require(_0xfa3c('0x2'));var config=require(_0xfa3c('0x3'));var logger=require(_0xfa3c('0x4'))(_0xfa3c('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0xfa3c('0x6'),'port':0x18eb});var io=require(_0xfa3c('0x7'))(new Redis(config['redis']));function sendNotification(_0xb54ce8,_0x10b812,_0x536e19,_0x4c38c9,_0x2d87ff,_0x4da19d){io['to'](util[_0xfa3c('0x8')](_0xfa3c('0x9'),_0x4c38c9[_0xfa3c('0xa')]))[_0xfa3c('0xb')](_0xfa3c('0xc'),_0x4c38c9);var _0x4baa7f=_0x4da19d||{};var _0x2f4655=_0x536e19[_0xfa3c('0xd')]('.');var _0x1090f3={'uniqueid':_0x10b812,'channel':_0x2f4655[0x0],'id':_0x2f4655[0x1],'title':_0x2f4655[0x0]+'\x20interaction','interactionId':_0x2f4655[0x2],'queue':_0x2d87ff?_0x2d87ff[_0xfa3c('0xa')]:null,'sound':_0x4baa7f[_0xfa3c('0xe')][_0xfa3c('0xf')],'shake':_0x4baa7f['account'][_0xfa3c('0x10')]};try{if(!_0x4baa7f[_0xfa3c('0x11')]){_0x4baa7f[_0xfa3c('0x11')]={};}if(_0x2d87ff){_0x4baa7f[_0xfa3c('0x11')][_0xfa3c('0x12')]=_0x2d87ff;}else if(_0x4baa7f[_0xfa3c('0x11')][_0xfa3c('0x12')]){delete _0x4baa7f[_0xfa3c('0x11')][_0xfa3c('0x12')];}_0x1090f3['msg']=utils[_0xfa3c('0x13')](_0x4baa7f[_0xfa3c('0xe')][_0xfa3c('0x14')],_0x4baa7f);}catch(_0x2befb8){_0x1090f3[_0xfa3c('0x15')]=_0xfa3c('0x16');logger['error'](util[_0xfa3c('0x8')](_0xfa3c('0x17'),_0x10b812,_0x2befb8[_0xfa3c('0x18')]));}io['to'](util['format'](_0xfa3c('0x9'),_0x4c38c9[_0xfa3c('0xa')]))[_0xfa3c('0xb')](util[_0xfa3c('0x8')](_0xfa3c('0x19'),_0xb54ce8?_0xfa3c('0x1a'):_0xfa3c('0x1b')),_0x1090f3);}function writeLog(_0x5cbd0e,_0x35941c,_0x183c25){return logger[_0xfa3c('0x1c')](util[_0xfa3c('0x8')](_0xfa3c('0x1d'),_0x5cbd0e,_0x35941c[_0xfa3c('0xa')],_0x183c25));}exports[_0xfa3c('0x1e')]=function(_0x3849f5,_0x59dc20,_0x3a4f19,_0x367d40){if(_0x59dc20[_0xfa3c('0x1f')]){writeLog(_0x3849f5,_0x59dc20,_0xfa3c('0x20'));return![];}if(!_0x59dc20[_0xfa3c('0x21')]){writeLog(_0x3849f5,_0x59dc20,'OFFLINE');return![];}if(_0x59dc20[_0x3a4f19+_0xfa3c('0x22')]){writeLog(_0x3849f5,_0x59dc20,_0xfa3c('0x23'));return![];}if(_0x367d40&&_0x59dc20['hasOwnProperty'](_0x3a4f19+'Capacity')&&_0x59dc20[_0xfa3c('0x24')](_0x3a4f19+_0xfa3c('0x25'))){if(_0x59dc20[_0x3a4f19+_0xfa3c('0x26')]>0x0&&_0x59dc20[_0x3a4f19+'CurrentCapacity']>=_0x59dc20[_0x3a4f19+'Capacity']){writeLog(_0x3849f5,_0x59dc20,_0x3a4f19['toUpperCase']()+_0xfa3c('0x27'));return![];}}return!![];};exports[_0xfa3c('0x28')]=function(_0x51355,_0x338672,_0x1423bb,_0x17e026,_0x8eae2c){return sendNotification(!![],_0x51355,_0x338672,_0x1423bb,_0x17e026,_0x8eae2c);};exports['hideNotification']=function(_0x441998,_0x58eed0,_0x2f27a8,_0x2aefdd,_0x4a9cd2){return sendNotification(![],_0x441998,_0x58eed0,_0x2f27a8,_0x2aefdd,_0x4a9cd2);};exports[_0xfa3c('0x29')]=function(_0x2105d0,_0x328379,_0x2f2b9a){var _0x5c06f2=_0x328379['interaction'][_0xfa3c('0x2a')];if(!_0x5c06f2&&_0x2f2b9a){_0x5c06f2=_0x2f2b9a['id'];}var _0x19bc51=_[_0xfa3c('0x2b')](_0x2105d0[_0x328379[_0xfa3c('0x2c')]+_0xfa3c('0x2d')],function(_0x4f792a){var _0x547cbc=_[_0xfa3c('0x2e')](_0x328379['channel'])+'InteractionId';return _0x4f792a[_0x547cbc]===_0x328379[_0xfa3c('0x2f')]['id'];});if(!_0x19bc51&&_0x5c06f2){_0x19bc51=_[_0xfa3c('0x2b')](_0x2105d0[_0xfa3c('0x30')][_0x5c06f2][_0x328379[_0xfa3c('0x2c')]+'WaitingInteractions'],function(_0x1bcb05){return _0x1bcb05['id']===_0x328379[_0xfa3c('0x2f')]['id'];});}return _0x19bc51;};exports[_0xfa3c('0x31')]=function(_0x408fe9,_0x5dbd9f,_0x55f245,_0x556f53){_0x408fe9[_0xfa3c('0x30')][_0x55f245['id']][_0x556f53+_0xfa3c('0x32')][_0x5dbd9f[_0xfa3c('0x18')]['id']]={'id':_0x5dbd9f[_0xfa3c('0x2f')]['id']};};exports[_0xfa3c('0x33')]=function(_0x829f93,_0x4e3c16,_0x24a642,_0xdc0fbf){delete _0x829f93[_0xfa3c('0x30')][_0x24a642['id']][_0xdc0fbf+_0xfa3c('0x32')][_0x4e3c16['message']['id']];};exports[_0xfa3c('0x34')]=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 30bab5b..17ff212 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 _0x7b40=['string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b40,0x7c));var _0x07b4=function(_0x25e899,_0x568d9b){_0x25e899=_0x25e899-0x0;var _0x2aa16a=_0x7b40[_0x25e899];return _0x2aa16a;};'use strict';var schema=require(_0x07b4('0x0'));var sh=require(_0x07b4('0x1'));var _=require(_0x07b4('0x2'));var utils=require(_0x07b4('0x3'));var logger=require(_0x07b4('0x4'))(_0x07b4('0x5'));var system=schema({'command':{'type':_0x07b4('0x6'),'required':!![],'message':_0x07b4('0x7')}});exports[_0x07b4('0x8')]=function(_0x4ab696,_0x11d8aa){return function(_0x56aa18){try{var _0x2e7f47={'command':_0x11d8aa[0x0]};var _0xd45f4d=system[_0x07b4('0x0')](_0x2e7f47,{'typecast':!![]});if(_0xd45f4d['length']){logger[_0x07b4('0x9')](_0x07b4('0xa'),_0x4ab696,_[_0x07b4('0xb')](_0xd45f4d,_0x07b4('0xc'))[_0x07b4('0xd')](',\x20'));logger[_0x07b4('0xe')](_0x07b4('0xf'),_0x4ab696);_0x56aa18[_0x07b4('0x10')]();}else{var _0x1c9d33=this;var _0x24c379=utils[_0x07b4('0x11')](_0x11d8aa[0x0],this);logger[_0x07b4('0xe')](_0x07b4('0x12'),_0x4ab696,_0x24c379);sh[_0x07b4('0x13')](_['trim'](_0x24c379),function(_0x362848,_0x46897a){logger['info'](_0x07b4('0x14'),_0x4ab696,_0x362848);if(_0x362848==0x0){var _0x39ddaa=_0x46897a[_0x07b4('0x15')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x11d8aa[0x1])||_[_0x07b4('0x16')](_0x11d8aa[0x1])){logger[_0x07b4('0xe')]('[%s][SYSTEM]\x20no\x20variable',_0x4ab696);_0x1c9d33['body'][_0x11d8aa[0x1]]=_0x39ddaa;}else{logger[_0x07b4('0xe')](_0x07b4('0x17'),_0x4ab696,_0x11d8aa[0x1],_0x39ddaa);_0x1c9d33[_0x07b4('0x18')][_0x11d8aa[0x1]]=_0x39ddaa;}}_0x56aa18[_0x07b4('0x10')]();});}}catch(_0x5b3d2d){logger[_0x07b4('0x9')](_0x07b4('0xa'),_0x4ab696,_['isObject'](_0x5b3d2d)?JSON[_0x07b4('0x19')](_0x5b3d2d):_0x5b3d2d);logger[_0x07b4('0xe')](_0x07b4('0xf'),_0x4ab696);_0x56aa18[_0x07b4('0x10')]();}};}; \ No newline at end of file +var _0x4977=['length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','isObject','stringify','shelljs','lodash','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x2f6fde,_0x139b26){var _0x11d5fc=function(_0x5d7c04){while(--_0x5d7c04){_0x2f6fde['push'](_0x2f6fde['shift']());}};_0x11d5fc(++_0x139b26);}(_0x4977,0x103));var _0x7497=function(_0x208959,_0x10ef71){_0x208959=_0x208959-0x0;var _0x2e5d2d=_0x4977[_0x208959];return _0x2e5d2d;};'use strict';var schema=require('validate');var sh=require(_0x7497('0x0'));var _=require(_0x7497('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x7497('0x2'));var system=schema({'command':{'type':_0x7497('0x3'),'required':!![],'message':_0x7497('0x4')}});exports['consequence']=function(_0x479d74,_0x247327){return function(_0x17ad1e){try{var _0x144e45={'command':_0x247327[0x0]};var _0x1a4215=system['validate'](_0x144e45,{'typecast':!![]});if(_0x1a4215[_0x7497('0x5')]){logger[_0x7497('0x6')](_0x7497('0x7'),_0x479d74,_[_0x7497('0x8')](_0x1a4215,_0x7497('0x9'))[_0x7497('0xa')](',\x20'));logger[_0x7497('0xb')](_0x7497('0xc'),_0x479d74);_0x17ad1e[_0x7497('0xd')]();}else{var _0x221e4d=this;var _0x2dff0d=utils[_0x7497('0xe')](_0x247327[0x0],this);logger[_0x7497('0xb')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x479d74,_0x2dff0d);sh[_0x7497('0xf')](_[_0x7497('0x10')](_0x2dff0d),function(_0x2c6896,_0x3f3405){logger[_0x7497('0xb')](_0x7497('0x11'),_0x479d74,_0x2c6896);if(_0x2c6896==0x0){var _0x7e5ca9=_0x3f3405[_0x7497('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x7497('0x13')](_0x247327[0x1])||_['isEmpty'](_0x247327[0x1])){logger['info'](_0x7497('0x14'),_0x479d74);_0x221e4d[_0x7497('0x15')][_0x247327[0x1]]=_0x7e5ca9;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x479d74,_0x247327[0x1],_0x7e5ca9);_0x221e4d[_0x7497('0x15')][_0x247327[0x1]]=_0x7e5ca9;}}_0x17ad1e[_0x7497('0xd')]();});}}catch(_0x229074){logger[_0x7497('0x6')](_0x7497('0x7'),_0x479d74,_[_0x7497('0x16')](_0x229074)?JSON[_0x7497('0x17')](_0x229074):_0x229074);logger[_0x7497('0xb')](_0x7497('0xc'),_0x479d74);_0x17ad1e['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 4afa1e5..f75a28f 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 _0x9a34=['../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0xfc56ae,_0xe7b760){var _0x5f3273=function(_0x58276e){while(--_0x58276e){_0xfc56ae['push'](_0xfc56ae['shift']());}};_0x5f3273(++_0xe7b760);}(_0x9a34,0x9c));var _0x49a3=function(_0x2cfb21,_0x240c6d){_0x2cfb21=_0x2cfb21-0x0;var _0x50cdf0=_0x9a34[_0x2cfb21];return _0x50cdf0;};'use strict';var schema=require(_0x49a3('0x0'));var _=require(_0x49a3('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x49a3('0x2')),'smsInteraction':require(_0x49a3('0x3')),'mailInteraction':require(_0x49a3('0x4')),'faxInteraction':require(_0x49a3('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x49a3('0x6'))(_0x49a3('0x7'));var tag=schema({'tag':{'type':_0x49a3('0x8'),'required':!![],'message':_0x49a3('0x9')}});exports[_0x49a3('0xa')]=function(_0x5328fa,_0x42762d,_0x483dfb,_0x793b1d){return function(_0x475a94){try{var _0x513a8a={'tag':_0x42762d[0x0]};var _0x1df9f3=tag[_0x49a3('0x0')](_0x513a8a,{'typecast':!![]});if(_0x1df9f3['length']){logger[_0x49a3('0xb')](_0x49a3('0xc'),_0x5328fa,_[_0x49a3('0xd')](_0x1df9f3,_0x49a3('0xe'))['join'](',\x20'));logger[_0x49a3('0xf')](_0x49a3('0x10'),_0x5328fa);_0x475a94[_0x49a3('0x11')]();}else{var _0x60a24e={'ids':[_0x42762d[0x0]]};if(rpc[_0x793b1d[_0x49a3('0x12')]+_0x49a3('0x13')]){rpc[_0x793b1d[_0x49a3('0x12')]+'Interaction'][_0x49a3('0x14')](_0x793b1d[_0x49a3('0x15')]['id'],_0x60a24e)[_0x49a3('0x16')](function(_0x422a9d){logger[_0x49a3('0xf')](_0x49a3('0x17'),_0x5328fa,_0x42762d[0x1],_0x793b1d[_0x49a3('0x12')],_0x793b1d[_0x49a3('0x15')]['id']);})[_0x49a3('0x18')](function(_0x5df7ea){logger[_0x49a3('0xb')](_0x49a3('0xc'),_0x5328fa,JSON[_0x49a3('0x19')](_0x5df7ea));logger[_0x49a3('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5328fa);})['finally'](function(){_0x475a94[_0x49a3('0x11')]();});}}}catch(_0x34f239){logger[_0x49a3('0xb')](_0x49a3('0xc'),_0x5328fa,_[_0x49a3('0x1a')](_0x34f239)?JSON['stringify'](_0x34f239):_0x34f239);logger[_0x49a3('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5328fa);_0x475a94[_0x49a3('0x11')]();}};}; \ No newline at end of file +var _0xdf57=['../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','channel','catch','stringify','finally','next','isObject','validate','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x3ee586,_0x40dab0){var _0x5892de=function(_0x4c5838){while(--_0x4c5838){_0x3ee586['push'](_0x3ee586['shift']());}};_0x5892de(++_0x40dab0);}(_0xdf57,0x174));var _0x7df5=function(_0x32bff9,_0x3f27d5){_0x32bff9=_0x32bff9-0x0;var _0xbab93=_0xdf57[_0x32bff9];return _0xbab93;};'use strict';var schema=require(_0x7df5('0x0'));var _=require('lodash');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x7df5('0x1')),'smsInteraction':require(_0x7df5('0x2')),'mailInteraction':require(_0x7df5('0x3')),'faxInteraction':require(_0x7df5('0x4')),'whatsappInteraction':require(_0x7df5('0x5'))};var logger=require(_0x7df5('0x6'))(_0x7df5('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7df5('0x8')}});exports[_0x7df5('0x9')]=function(_0x3451ba,_0x5340b9,_0x480ddb,_0x213772){return function(_0x43fe68){try{var _0x106376={'tag':_0x5340b9[0x0]};var _0x376269=tag[_0x7df5('0x0')](_0x106376,{'typecast':!![]});if(_0x376269[_0x7df5('0xa')]){logger[_0x7df5('0xb')](_0x7df5('0xc'),_0x3451ba,_[_0x7df5('0xd')](_0x376269,_0x7df5('0xe'))[_0x7df5('0xf')](',\x20'));logger[_0x7df5('0x10')](_0x7df5('0x11'),_0x3451ba);_0x43fe68['next']();}else{var _0x47c838={'ids':[_0x5340b9[0x0]]};if(rpc[_0x213772['channel']+_0x7df5('0x12')]){rpc[_0x213772['channel']+_0x7df5('0x12')][_0x7df5('0x13')](_0x213772[_0x7df5('0x14')]['id'],_0x47c838)[_0x7df5('0x15')](function(_0x35ee5c){logger['info'](_0x7df5('0x16'),_0x3451ba,_0x5340b9[0x1],_0x213772[_0x7df5('0x17')],_0x213772['interaction']['id']);})[_0x7df5('0x18')](function(_0x222fc6){logger[_0x7df5('0xb')](_0x7df5('0xc'),_0x3451ba,JSON[_0x7df5('0x19')](_0x222fc6));logger[_0x7df5('0x10')](_0x7df5('0x11'),_0x3451ba);})[_0x7df5('0x1a')](function(){_0x43fe68[_0x7df5('0x1b')]();});}}}catch(_0xa384e6){logger[_0x7df5('0xb')](_0x7df5('0xc'),_0x3451ba,_[_0x7df5('0x1c')](_0xa384e6)?JSON['stringify'](_0xa384e6):_0xa384e6);logger[_0x7df5('0x10')](_0x7df5('0x11'),_0x3451ba);_0x43fe68[_0x7df5('0x1b')]();}};}; \ 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 b3a0753..d42082a 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 _0x70bc=['&sessionId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','consequence','\x20-\x20','replace','includes','push','?params=','urlOnRing','title','jsonrpc','method','params','stringify','utf8','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x70bc,0x189));var _0xc70b=function(_0x1336f3,_0x2cf47b){_0x1336f3=_0x1336f3-0x0;var _0x4ec0b4=_0x70bc[_0x1336f3];return _0x4ec0b4;};'use strict';var rp=require(_0xc70b('0x0'));var logger=require(_0xc70b('0x1'))(_0xc70b('0x2'));var _=require('lodash');var arr=[];exports[_0xc70b('0x3')]=function(_0x23b1a0,_0x55344){return function(_0x3b3aee){var _0xbc5fb4=_0x55344[0xa];var _0x3644a4=_0x55344[0xb];var _0x1547fa=_0x55344[0xc];var _0x1295de=_0x55344[0xd];var _0x395384=_0x55344[0xe];var _0x2f5188=_0x55344[0xf]['replace'](/\n/g,_0xc70b('0x4'));var _0x1d9c0a=_0x55344[0x10][_0xc70b('0x5')](/\n/g,'\x20');if(!arr[_0xc70b('0x6')](_0x3644a4)){arr[_0xc70b('0x7')](_0x3644a4);var _0x4319f4=_0x55344[0x3];var _0x172ee8=_0x55344[0x4];var _0x3c38c5=_0x55344[0x1];var _0x46b8cf=_0x55344[0x0];var _0x19b7f2={};_0x19b7f2['urlOnAnswer']=_0x55344[0x8]+_0xc70b('0x8')+_0x1547fa+'|'+_0xbc5fb4+'|'+_0x1295de+'|'+_0x3644a4+'|'+_0x395384;_0x19b7f2[_0xc70b('0x9')]=_0x55344[0x7]+_0xc70b('0x8')+_0x1547fa+'|'+_0xbc5fb4+'|'+_0x1295de+'|'+_0x3644a4+'|'+_0x395384+'|'+_0x2f5188+'|'+_0x1d9c0a;_0x19b7f2[_0xc70b('0xa')]=_0x55344[0x9];var _0x3c6612={};_0x3c6612[_0xc70b('0xb')]='2.0';_0x3c6612[_0xc70b('0xc')]='login';var _0x2391b6=[];_0x2391b6[_0xc70b('0x7')](_0x55344[0x2]);_0x2391b6[_0xc70b('0x7')](_0x55344[0x5]);_0x2391b6['push'](_0x55344[0x6]);_0x3c6612[_0xc70b('0xd')]=_0x2391b6;_0x3c6612['id']=0x1;var _0x385588=JSON[_0xc70b('0xe')](_0x3c6612);var _0x50f7c8={'encoding':_0xc70b('0xf'),'method':_0xc70b('0x10'),'timeout':0x2710,'url':_0x4319f4,'headers':{'Content-Type':_0xc70b('0x11')},'body':_0x385588};return rp(_0x50f7c8)[_0xc70b('0x12')](function(_0x5a59b8){const _0x5594e3=JSON[_0xc70b('0x13')](_0x5a59b8);if(!_0x5594e3[_0xc70b('0x14')][_0xc70b('0x15')]){throw new Error(_0xc70b('0x16'));}var _0x46c516=_0x3644a4;var _0x4a4613='channelId='+_0x3c38c5+'&serviceId='+_0x46b8cf+_0xc70b('0x17')+_0x46c516+'&data='+JSON[_0xc70b('0xe')](_0x19b7f2);var _0x18f703=_0x172ee8+'?'+_0x4a4613;return rp(_0x18f703);})['then'](function(_0x16226e){logger[_0xc70b('0x18')](_0xc70b('0x19'),_0x23b1a0,_0x16226e);_0x3b3aee[_0xc70b('0x1a')]();})[_0xc70b('0x1b')](function(_0x3b610b){logger[_0xc70b('0x1c')]('[%s][TVOX]\x20%s',_0x23b1a0,_[_0xc70b('0x1d')](_0x3b610b)?JSON[_0xc70b('0xe')](_0x3b610b):_0x3b610b);_0x3b3aee[_0xc70b('0x1a')]();});}else{logger[_0xc70b('0x18')](_0xc70b('0x1e'),_0x23b1a0);_0x3b3aee[_0xc70b('0x1f')]();}};}; \ No newline at end of file +var _0x253c=['login','push','params','stringify','application/json-rpc','then','parse','result','logged','channelId=','&sessionId=','&data=','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','lodash','consequence','replace','includes','urlOnAnswer','?params=','title','jsonrpc','2.0','method'];(function(_0x426ab4,_0x7e168a){var _0x229d81=function(_0x32e807){while(--_0x32e807){_0x426ab4['push'](_0x426ab4['shift']());}};_0x229d81(++_0x7e168a);}(_0x253c,0xa4));var _0xc253=function(_0x111c47,_0x2c867b){_0x111c47=_0x111c47-0x0;var _0x30790f=_0x253c[_0x111c47];return _0x30790f;};'use strict';var rp=require('request-promise');var logger=require('../../../../config/logger')('routing');var _=require(_0xc253('0x0'));var arr=[];exports[_0xc253('0x1')]=function(_0x4d13fe,_0x321b08){return function(_0x3e64b9){var _0x1fd14c=_0x321b08[0xa];var _0x5b957e=_0x321b08[0xb];var _0x580095=_0x321b08[0xc];var _0x271038=_0x321b08[0xd];var _0x41885b=_0x321b08[0xe];var _0x439df3=_0x321b08[0xf]['replace'](/\n/g,'\x20-\x20');var _0x418877=_0x321b08[0x10][_0xc253('0x2')](/\n/g,'\x20');if(!arr[_0xc253('0x3')](_0x5b957e)){arr['push'](_0x5b957e);var _0x153431=_0x321b08[0x3];var _0x1b861d=_0x321b08[0x4];var _0x4489c9=_0x321b08[0x1];var _0x53cf4c=_0x321b08[0x0];var _0x2a50ff={};_0x2a50ff[_0xc253('0x4')]=_0x321b08[0x8]+'?params='+_0x580095+'|'+_0x1fd14c+'|'+_0x271038+'|'+_0x5b957e+'|'+_0x41885b;_0x2a50ff['urlOnRing']=_0x321b08[0x7]+_0xc253('0x5')+_0x580095+'|'+_0x1fd14c+'|'+_0x271038+'|'+_0x5b957e+'|'+_0x41885b+'|'+_0x439df3+'|'+_0x418877;_0x2a50ff[_0xc253('0x6')]=_0x321b08[0x9];var _0xed9335={};_0xed9335[_0xc253('0x7')]=_0xc253('0x8');_0xed9335[_0xc253('0x9')]=_0xc253('0xa');var _0x525131=[];_0x525131['push'](_0x321b08[0x2]);_0x525131[_0xc253('0xb')](_0x321b08[0x5]);_0x525131[_0xc253('0xb')](_0x321b08[0x6]);_0xed9335[_0xc253('0xc')]=_0x525131;_0xed9335['id']=0x1;var _0x5cef80=JSON[_0xc253('0xd')](_0xed9335);var _0x4a8b8f={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x153431,'headers':{'Content-Type':_0xc253('0xe')},'body':_0x5cef80};return rp(_0x4a8b8f)[_0xc253('0xf')](function(_0x4fd836){const _0x58bf57=JSON[_0xc253('0x10')](_0x4fd836);if(!_0x58bf57[_0xc253('0x11')][_0xc253('0x12')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x275b80=_0x5b957e;var _0x4f51f9=_0xc253('0x13')+_0x4489c9+'&serviceId='+_0x53cf4c+_0xc253('0x14')+_0x275b80+_0xc253('0x15')+JSON[_0xc253('0xd')](_0x2a50ff);var _0x52c161=_0x1b861d+'?'+_0x4f51f9;return rp(_0x52c161);})[_0xc253('0xf')](function(_0x5ecc8c){logger[_0xc253('0x16')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x4d13fe,_0x5ecc8c);_0x3e64b9[_0xc253('0x17')]();})[_0xc253('0x18')](function(_0x385933){logger[_0xc253('0x19')](_0xc253('0x1a'),_0x4d13fe,_[_0xc253('0x1b')](_0x385933)?JSON[_0xc253('0xd')](_0x385933):_0x385933);_0x3e64b9['stop']();});}else{logger[_0xc253('0x16')](_0xc253('0x1c'),_0x4d13fe);_0x3e64b9['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 07cbea8..6d47b17 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(_0x571811,_0x403952){var _0x1d8781=function(_0x59d9cd){while(--_0x59d9cd){_0x571811['push'](_0x571811['shift']());}};_0x1d8781(++_0x403952);}(_0xe706,0xa3));var _0x6e70=function(_0x503bc0,_0x12aeee){_0x503bc0=_0x503bc0-0x0;var _0x383246=_0xe706[_0x503bc0];return _0x383246;};'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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x42e8d3,_0x158aa4){var _0xb3d8ef=function(_0xfbe2d8){while(--_0xfbe2d8){_0x42e8d3['push'](_0x42e8d3['shift']());}};_0xb3d8ef(++_0x158aa4);}(_0xe706,0xa3));var _0x6e70=function(_0x3878e9,_0x14fcf2){_0x3878e9=_0x3878e9-0x0;var _0x2ad526=_0xe706[_0x3878e9];return _0x2ad526;};'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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 270568a..4a8d9f1 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 _0xdbfd=['paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','./applications/utils','./applications/strategy/util','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','rules','channel','message','interaction','checkWaitingNotifications','applications','length','join','app','.js','toLowerCase','appdata','push','slice','dialogflow','split','amazonlex','tag','TagId','tvox','getMustacheRender','account','ContactId','./applications/','consequence','priority','info','on\x20interval','intervals','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xdbfd,0x6b));var _0xddbf=function(_0x55bd0b,_0x711bae){_0x55bd0b=_0x55bd0b-0x0;var _0x5ae09b=_0xdbfd[_0x55bd0b];return _0x5ae09b;};'use strict';var _=require('lodash');var util=require(_0xddbf('0x0'));var path=require(_0xddbf('0x1'));var fs=require('fs');var jayson=require(_0xddbf('0x2'));var BPromise=require('bluebird');var utils=require(_0xddbf('0x3'));var sUtils=require(_0xddbf('0x4'));var logger=require('../../../config/logger')(_0xddbf('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xddbf('0x6')),'chatQueueReport':require(_0xddbf('0x7')),'smsQueueReport':require(_0xddbf('0x8')),'faxQueueReport':require(_0xddbf('0x9')),'whatsappQueueReport':require(_0xddbf('0xa'))};var RuleEngine=require(_0xddbf('0xb'));function getId(_0x88e97c,_0x1b02c5,_0xfaea91){return util[_0xddbf('0xc')](_0xddbf('0xd'),_0x88e97c,_0x1b02c5||0x0,_0xfaea91||0x0);}function getIntervals(_0x3b906e,_0xf9d055){var _0x335714=[];if(!_[_0xddbf('0xe')](_0xf9d055[_0xddbf('0xf')])&&!_[_0xddbf('0xe')](_0x3b906e[_0xf9d055[_0xddbf('0xf')]])&&!_['isNil'](_0x3b906e[_0xf9d055[_0xddbf('0xf')]][_0xddbf('0x10')])){_0x335714=_['map'](_0x3b906e[_0xf9d055['IntervalId']][_0xddbf('0x10')],'interval');}else if(!_['isNil'](_0xf9d055[_0xddbf('0x11')])){_0x335714=[_0xf9d055[_0xddbf('0x11')]];}return _0x335714;}exports['listen']=function(_0x3f84e1){_0x3f84e1[_0xddbf('0x12')]={};return new BPromise(function(_0x5dc304,_0x17b835){var _0x3bf7d0={'Start':function(_0x1ada5c){var _0x192d53=this;return new Promise(function(_0x297af6,_0x430df1){if(_0x1ada5c){try{var _0xdf3470=[];var _0xee2b22=getId(_0x1ada5c[_0xddbf('0x13')],_0x1ada5c[_0xddbf('0x14')]?_0x1ada5c[_0xddbf('0x14')]['id']:0x0,_0x1ada5c[_0xddbf('0x15')]?_0x1ada5c[_0xddbf('0x15')]['id']:0x0);var _0x1aa18e=sUtils[_0xddbf('0x16')](_0x3f84e1,_0x1ada5c);if(!_0x1aa18e&&_0x1ada5c[_0xddbf('0x17')]&&_['isArray'](_0x1ada5c['applications'])&&_0x1ada5c[_0xddbf('0x17')][_0xddbf('0x18')]){for(var _0x25e4d7=0x0;_0x25e4d7<_0x1ada5c[_0xddbf('0x17')]['length'];_0x25e4d7+=0x1){var _0x56a132=_0x1ada5c[_0xddbf('0x17')][_0x25e4d7];if(fs['existsSync'](path[_0xddbf('0x19')](__dirname,'applications',_0x56a132[_0xddbf('0x1a')]+_0xddbf('0x1b')))){var _0x4c378a=[];switch(_0x56a132[_0xddbf('0x1a')][_0xddbf('0x1c')]()){case'autoreply':var _0x1dea61=_0x56a132[_0xddbf('0x1d')]['split'](',');if(_0x1ada5c[_0xddbf('0x13')]==='mail'){_0x4c378a[_0xddbf('0x1e')](_0x1dea61[0x0]);_0x4c378a[_0xddbf('0x1e')](_0x1dea61[0x1]);_0x4c378a[_0xddbf('0x1e')](_0x1dea61[_0xddbf('0x1f')](0x2,_0x1dea61[_0xddbf('0x18')])[_0xddbf('0x19')](','));}else{_0x4c378a[_0xddbf('0x1e')](_0x1dea61[0x0]);_0x4c378a[_0xddbf('0x1e')](_0x1dea61[_0xddbf('0x1f')](0x1,_0x1dea61[_0xddbf('0x18')])[_0xddbf('0x19')](','));}break;case _0xddbf('0x20'):var _0x4dda45=_0x56a132[_0xddbf('0x1d')][_0xddbf('0x21')](',');_0x4c378a[_0xddbf('0x1e')](_0x4dda45[0x0]);_0x4c378a['push'](_0x4dda45[0x1]);_0x4c378a[_0xddbf('0x1e')](_0x4dda45['slice'](0x2,_0x4dda45['length'])[_0xddbf('0x19')](','));break;case'dialogflowv2':var _0x43d0d4=_0x56a132[_0xddbf('0x1d')]['split'](',');_0x4c378a['push'](_0x43d0d4[0x0]);_0x4c378a[_0xddbf('0x1e')](_0x43d0d4[0x1]);_0x4c378a[_0xddbf('0x1e')](_0x43d0d4[0x2]);_0x4c378a[_0xddbf('0x1e')](_0x43d0d4[0x3]);_0x4c378a[_0xddbf('0x1e')](_0x43d0d4[_0xddbf('0x1f')](0x4,_0x43d0d4['length'])[_0xddbf('0x19')](','));break;case _0xddbf('0x22'):var _0x1792e3=_0x56a132['appdata'][_0xddbf('0x21')](',');_0x4c378a[_0xddbf('0x1e')](_0x1792e3[0x0]);_0x4c378a[_0xddbf('0x1e')](_0x1792e3[0x1]);_0x4c378a[_0xddbf('0x1e')](_0x1792e3[0x2]);_0x4c378a[_0xddbf('0x1e')](_0x1792e3[0x3]);_0x4c378a[_0xddbf('0x1e')](_0x1792e3[_0xddbf('0x1f')](0x4,_0x1792e3[_0xddbf('0x18')])[_0xddbf('0x19')](','));break;case'message':_0x4c378a['push'](_0x56a132[_0xddbf('0x1d')]);break;case _0xddbf('0x23'):_0x4c378a[_0xddbf('0x1e')](_0x56a132[_0xddbf('0x24')]);_0x4c378a[_0xddbf('0x1e')](_0x56a132['appdata']);break;case _0xddbf('0x25'):var _0x4ece95=utils[_0xddbf('0x26')](_0x1ada5c[_0xddbf('0x27')]['notificationTemplate'],_0x1ada5c);var _0x1ccf99=_0x56a132['appdata'][_0xddbf('0x21')](',');_0x4c378a[_0xddbf('0x1e')](_0x1ccf99[0x0]);_0x4c378a[_0xddbf('0x1e')](_0x1ccf99[0x1]);_0x4c378a[_0xddbf('0x1e')](_0x1ccf99[0x2]);_0x4c378a[_0xddbf('0x1e')](_0x1ccf99[0x3]);_0x4c378a[_0xddbf('0x1e')](_0x1ccf99[0x4]);_0x4c378a['push'](_0x1ccf99[0x5]);_0x4c378a[_0xddbf('0x1e')](_0x1ccf99[0x6]);_0x4c378a[_0xddbf('0x1e')](_0x1ccf99[0x7]);_0x4c378a[_0xddbf('0x1e')](_0x1ccf99[0x8]);_0x4c378a[_0xddbf('0x1e')](_0x1ccf99[0x9]);_0x4c378a[_0xddbf('0x1e')](_0x1ccf99[0xa]);_0x4c378a['push'](_0x1ada5c[_0xddbf('0x15')]['id']);_0x4c378a[_0xddbf('0x1e')](_0x1ada5c[_0xddbf('0x14')]['id']);_0x4c378a[_0xddbf('0x1e')](_0x56a132['ChatWebsiteId']);_0x4c378a['push'](_0x1ada5c[_0xddbf('0x15')][_0xddbf('0x28')]);_0x4c378a[_0xddbf('0x1e')](_0x1ada5c['body']['body']);_0x4c378a['push'](_0x4ece95);break;default:_0x4c378a=_['isNil'](_0x56a132[_0xddbf('0x1d')])?[]:_0x56a132[_0xddbf('0x1d')]['split'](',');}var _0x32dbf0={'id':util[_0xddbf('0xc')]('%s:%s:%s',_0xee2b22,_0x56a132['id'],_0x56a132[_0xddbf('0x1a')]),'condition':require('./interval')['condition'](_0xee2b22,getIntervals(_0x3f84e1['intervals'],_0x56a132),_0x3f84e1),'consequence':require(_0xddbf('0x29')+_0x56a132[_0xddbf('0x1a')])[_0xddbf('0x2a')](_0xee2b22,_0x4c378a,_0x3f84e1,_0x1ada5c),'p':_0x56a132[_0xddbf('0x2b')]||0x0};logger[_0xddbf('0x2c')]('Push\x20new\x20rule',_0x32dbf0['id'],_0xddbf('0x2d'),getIntervals(_0x3f84e1[_0xddbf('0x2e')],_0x56a132)['join']('\x20|\x20'));_0xdf3470[_0xddbf('0x1e')](_0x32dbf0);}else{logger[_0xddbf('0x2f')](_0xddbf('0x30'),path[_0xddbf('0x19')](__dirname,'applications',_0x56a132[_0xddbf('0x1a')]+_0xddbf('0x1b')));}}_0x3f84e1[_0xddbf('0x12')][_0xee2b22]=new RuleEngine(_0xdf3470);_0x3f84e1[_0xddbf('0x12')][_0xee2b22][_0xddbf('0x31')](_0x1ada5c,function(_0x2d8c4e){logger[_0xddbf('0x2c')]('Applications\x20executed',JSON[_0xddbf('0x32')](_0x2d8c4e['matchPath']));if(_0x3f84e1[_0xddbf('0x12')][_0xee2b22]){_0x3f84e1['rules'][_0xee2b22][_0xddbf('0x33')](_0xddbf('0x34'));}});return _0x297af6({'code':0xc8,'message':_0x1ada5c});}else{if(_0x1aa18e){logger[_0xddbf('0x2c')](util[_0xddbf('0xc')]('Skipped\x20routing\x20for\x20%s',_0xee2b22));}else{logger[_0xddbf('0x2c')](_0xddbf('0x35'));}return _0x297af6({'code':0xc8,'message':_0x1ada5c});}}catch(_0x2661f7){logger['error'](_0x2661f7[_0xddbf('0x36')]);return _0x430df1(_0x192d53[_0xddbf('0x2f')](0x1f4,_0x2661f7));}}return _0x430df1(_0xddbf('0x37'));});},'AcceptMessage':function(_0x566b14){var _0x58d622=this;return new Promise(function(_0x193edb,_0x3a5d99){if(_0x566b14[_0xddbf('0x38')]&&_0x566b14[_0xddbf('0x38')]['id']){if(_0x3f84e1[_0xddbf('0x39')][_0x566b14[_0xddbf('0x38')]['id']]){_0x3f84e1[_0xddbf('0x39')][_0x566b14['agent']['id']][_0xddbf('0x3a')]=![];_0x3f84e1[_0xddbf('0x39')][_0x566b14[_0xddbf('0x38')]['id']][_0xddbf('0x3b')]=undefined;}}if(_0x566b14[_0xddbf('0x14')]&&_0x566b14[_0xddbf('0x14')]['id']){try{var _0x1a1d8e=getId(_0x566b14[_0xddbf('0x13')],_0x566b14[_0xddbf('0x14')]?_0x566b14[_0xddbf('0x14')]['id']:0x0,_0x566b14[_0xddbf('0x15')]?_0x566b14[_0xddbf('0x15')]['id']:0x0);if(_0x3f84e1['rules'][_0x1a1d8e]){_0x3f84e1[_0xddbf('0x12')][_0x1a1d8e][_0xddbf('0x33')](_0xddbf('0x3c'));if(rpc[_0x566b14[_0xddbf('0x13')]+_0xddbf('0x3d')]){rpc[_0x566b14[_0xddbf('0x13')]+_0xddbf('0x3d')][_0xddbf('0x3e')](_0x1a1d8e,{'UserId':_0x566b14[_0xddbf('0x14')]['UserId']})[_0xddbf('0x3f')](function(){logger[_0xddbf('0x2f')](_0xddbf('0x40'));});}}return _0x193edb({'code':0xc8,'message':_0x566b14});}catch(_0x495669){logger[_0xddbf('0x2f')](_0x495669[_0xddbf('0x36')]);return _0x3a5d99(_0x58d622[_0xddbf('0x2f')](0x1f4,_0x495669));}}logger[_0xddbf('0x2f')]('message\x20is\x20empty');return _0x3a5d99(_0x58d622[_0xddbf('0x2f')](0x1f4,_0xddbf('0x41')));});},'RejectMessage':function(_0x31fe1a){var _0x1b8d5a=this;return new Promise(function(_0x3cdd38,_0x1e0144){if(_0x31fe1a[_0xddbf('0x38')]&&_0x31fe1a[_0xddbf('0x38')]['id']){try{if(_0x3f84e1[_0xddbf('0x39')][_0x31fe1a[_0xddbf('0x38')]['id']]){_0x3f84e1[_0xddbf('0x39')][_0x31fe1a['agent']['id']]['busy']=![];_0x3f84e1['agents'][_0x31fe1a[_0xddbf('0x38')]['id']][_0xddbf('0x3b')]=undefined;}return _0x3cdd38({'code':0xc8,'message':_0x31fe1a});}catch(_0x421713){logger[_0xddbf('0x2f')](_0x421713[_0xddbf('0x36')]);return _0x1e0144(_0x1b8d5a[_0xddbf('0x2f')](0x1f4,_0x421713));}}logger['error']('message\x20is\x20empty');return _0x1e0144(_0x1b8d5a[_0xddbf('0x2f')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x629611){var _0x4ec9ce=this;return new Promise(function(_0x8e66f5,_0x44719d){if(_0x629611['channel']&&_0x629611[_0xddbf('0x15')]&&_0x629611[_0xddbf('0x15')]['id']){try{var _0x407f88=getId(_0x629611[_0xddbf('0x13')],_0x629611[_0xddbf('0x14')]?_0x629611['message']['id']:0x0,_0x629611[_0xddbf('0x15')]?_0x629611[_0xddbf('0x15')]['id']:0x0);if(_0x3f84e1['rules'][_0x407f88]){_0x3f84e1[_0xddbf('0x12')][_0x407f88][_0xddbf('0x33')](_0xddbf('0x3c'));}return _0x8e66f5({'code':0xc8,'message':_0x629611});}catch(_0x5ca3e7){logger[_0xddbf('0x2f')](_0x5ca3e7[_0xddbf('0x36')]);return _0x44719d(_0x4ec9ce[_0xddbf('0x2f')](0x1f4,_0x5ca3e7));}}logger[_0xddbf('0x2f')](_0xddbf('0x41'));return _0x44719d(_0x4ec9ce[_0xddbf('0x2f')](0x1f4,_0xddbf('0x41')));});},'AgentCapacity':function(_0x375235){var _0xa58ab5=this;return new Promise(function(_0x44a976,_0x10ff34){if(_0x3f84e1['agents'][_0xddbf('0x42')](_0x375235['id'])){for(var _0x3d2541 in _0x375235[_0xddbf('0x43')]){if(_0x375235[_0xddbf('0x43')]['hasOwnProperty'](_0x3d2541)){if(_0x3f84e1[_0xddbf('0x39')][_0x375235['id']]['hasOwnProperty'](_0x3d2541+'CurrentCapacity')){_0x3f84e1[_0xddbf('0x39')][_0x375235['id']][_0x3d2541+_0xddbf('0x44')]=parseInt(_0x375235['capacity'][_0x3d2541],0xa);}}}_0x3f84e1['agents'][_0x375235['id']][_0xddbf('0x45')]();return _0x44a976({'code':0xc8,'message':_0x3f84e1[_0xddbf('0x39')][_0x375235['id']]});}else{return _0x10ff34(_0xa58ab5[_0xddbf('0x2f')](0x1f4,_0xddbf('0x46')));}});},'Agents':function(_0x5908f3){return new Promise(function(_0x41ccc2){var _0x4258c1=_[_0xddbf('0x47')](_0x3f84e1[_0xddbf('0x39')]);if(_0x5908f3&&_0x5908f3['id']){var _0x80e971=_['find'](_0x4258c1,function(_0x234564){return _0x234564['id']===_0x5908f3['id'];});_0x41ccc2(_0x80e971);}else{_0x41ccc2({'count':_0x4258c1['length'],'rows':_0x4258c1});}});},'ChatQueues':function(){return new Promise(function(_0x10d201){var _0x360498=[];for(var _0x39df91 in _0x3f84e1[_0xddbf('0x48')]){if(_0x3f84e1['chatQueues']['hasOwnProperty'](_0x39df91)){var _0x5e091a=_0x3f84e1['chatQueues'][_0x39df91];var _0x15544d={'id':_0x5e091a['id'],'available':_0x5e091a['available'],'loggedIn':_0x5e091a[_0xddbf('0x49')],'name':_0x5e091a[_0xddbf('0x4a')],'paused':_0x5e091a[_0xddbf('0x4b')],'waiting':_0x5e091a[_0xddbf('0x4c')]};_0x360498[_0xddbf('0x1e')](_0x15544d);}}_0x10d201({'count':_0x360498['length'],'rows':_0x360498});});},'MailQueues':function(){return new Promise(function(_0x334e1e){var _0x333c7b=[];for(var _0x13d1a7 in _0x3f84e1['mailQueues']){if(_0x3f84e1['mailQueues'][_0xddbf('0x42')](_0x13d1a7)){var _0x21851a=_0x3f84e1[_0xddbf('0x4d')][_0x13d1a7];var _0x1f834b={'id':_0x21851a['id'],'available':_0x21851a[_0xddbf('0x4e')],'loggedIn':_0x21851a[_0xddbf('0x49')],'name':_0x21851a[_0xddbf('0x4a')],'paused':_0x21851a[_0xddbf('0x4b')],'waiting':_0x21851a[_0xddbf('0x4c')]};_0x333c7b[_0xddbf('0x1e')](_0x1f834b);}}_0x334e1e({'count':_0x333c7b[_0xddbf('0x18')],'rows':_0x333c7b});});},'OpenchannelQueues':function(){return new Promise(function(_0x230df5){var _0x36f2dc=[];for(var _0x5e8cc7 in _0x3f84e1[_0xddbf('0x4f')]){if(_0x3f84e1[_0xddbf('0x4f')]['hasOwnProperty'](_0x5e8cc7)){var _0x168df5=_0x3f84e1[_0xddbf('0x4f')][_0x5e8cc7];var _0x5859d2={'id':_0x168df5['id'],'available':_0x168df5[_0xddbf('0x4e')],'loggedIn':_0x168df5['loggedIn'],'name':_0x168df5[_0xddbf('0x4a')],'paused':_0x168df5[_0xddbf('0x4b')],'waiting':_0x168df5[_0xddbf('0x4c')]};_0x36f2dc[_0xddbf('0x1e')](_0x5859d2);}}_0x230df5({'count':_0x36f2dc[_0xddbf('0x18')],'rows':_0x36f2dc});});},'SmsQueues':function(){return new Promise(function(_0x22cbcf){var _0x4144f4=[];for(var _0x383343 in _0x3f84e1[_0xddbf('0x50')]){if(_0x3f84e1[_0xddbf('0x50')][_0xddbf('0x42')](_0x383343)){var _0x4db1cb=_0x3f84e1[_0xddbf('0x50')][_0x383343];var _0x335f85={'id':_0x4db1cb['id'],'available':_0x4db1cb[_0xddbf('0x4e')],'loggedIn':_0x4db1cb[_0xddbf('0x49')],'name':_0x4db1cb[_0xddbf('0x4a')],'paused':_0x4db1cb[_0xddbf('0x4b')],'waiting':_0x4db1cb[_0xddbf('0x4c')]};_0x4144f4[_0xddbf('0x1e')](_0x335f85);}}_0x22cbcf({'count':_0x4144f4['length'],'rows':_0x4144f4});});},'FaxQueues':function(){return new Promise(function(_0x1b04c3){var _0x2252a2=[];for(var _0x1f1222 in _0x3f84e1[_0xddbf('0x51')]){if(_0x3f84e1[_0xddbf('0x51')][_0xddbf('0x42')](_0x1f1222)){var _0x5e860b=_0x3f84e1[_0xddbf('0x51')][_0x1f1222];var _0x2514b2={'id':_0x5e860b['id'],'available':_0x5e860b[_0xddbf('0x4e')],'loggedIn':_0x5e860b['loggedIn'],'name':_0x5e860b['name'],'paused':_0x5e860b[_0xddbf('0x4b')],'waiting':_0x5e860b[_0xddbf('0x4c')]};_0x2252a2[_0xddbf('0x1e')](_0x2514b2);}}_0x1b04c3({'count':_0x2252a2['length'],'rows':_0x2252a2});});},'WhatsappQueues':function(){return new Promise(function(_0x23daa8){var _0x342387=[];for(var _0x5c9405 in _0x3f84e1[_0xddbf('0x52')]){if(_0x3f84e1[_0xddbf('0x52')]['hasOwnProperty'](_0x5c9405)){var _0x5e122d=_0x3f84e1['whatsappQueues'][_0x5c9405];var _0xa9be84={'id':_0x5e122d['id'],'available':_0x5e122d[_0xddbf('0x4e')],'loggedIn':_0x5e122d[_0xddbf('0x49')],'name':_0x5e122d[_0xddbf('0x4a')],'paused':_0x5e122d[_0xddbf('0x4b')],'waiting':_0x5e122d[_0xddbf('0x4c')]};_0x342387[_0xddbf('0x1e')](_0xa9be84);}}_0x23daa8({'count':_0x342387[_0xddbf('0x18')],'rows':_0x342387});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x30a2e7){var _0x31a58c=_[_0xddbf('0x47')](_0x3f84e1[_0xddbf('0x53')]);_0x30a2e7({'count':_0x31a58c[_0xddbf('0x18')],'rows':_0x31a58c});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1eb771){var _0x332aea=_[_0xddbf('0x47')](_0x3f84e1[_0xddbf('0x54')]);_0x1eb771({'count':_0x332aea[_0xddbf('0x18')],'rows':_0x332aea});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x13017a){var _0x348307=_[_0xddbf('0x47')](_0x3f84e1[_0xddbf('0x55')]);_0x13017a({'count':_0x348307[_0xddbf('0x18')],'rows':_0x348307});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3bb807){var _0x7e3d27=_[_0xddbf('0x47')](_0x3f84e1['smsQueuesWaitingInteractions']);_0x3bb807({'count':_0x7e3d27[_0xddbf('0x18')],'rows':_0x7e3d27});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3a6031){var _0x1cca20=_[_0xddbf('0x47')](_0x3f84e1['faxQueuesWaitingInteractions']);_0x3a6031({'count':_0x1cca20[_0xddbf('0x18')],'rows':_0x1cca20});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x61f49f){var _0x165d93=_['values'](_0x3f84e1['whatsappQueuesWaitingInteractions']);_0x61f49f({'count':_0x165d93[_0xddbf('0x18')],'rows':_0x165d93});});}};var _0x17a98d=jayson[_0xddbf('0x56')](_0x3bf7d0)[_0xddbf('0x57')]();_0x17a98d['on'](_0xddbf('0x2f'),function(_0x2bd386){logger['error'](JSON[_0xddbf('0x32')](_0x2bd386));return _0x17b835(_0x2bd386);});_0x17a98d['listen'](0x232c,_0xddbf('0x58'),function(){console[_0xddbf('0x59')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x5dc304(_0xddbf('0x5a')+0x232c);});});}; \ No newline at end of file +var _0x3275=['%s:%s:%s','./interval','condition','intervals','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','.js','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','./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','rules','channel','interaction','checkWaitingNotifications','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','push','slice','amazonlex','message','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body'];(function(_0x31d27d,_0x4cc192){var _0x5b4035=function(_0x334028){while(--_0x334028){_0x31d27d['push'](_0x31d27d['shift']());}};_0x5b4035(++_0x4cc192);}(_0x3275,0x105));var _0x5327=function(_0x5ada87,_0x2877b9){_0x5ada87=_0x5ada87-0x0;var _0x12d083=_0x3275[_0x5ada87];return _0x12d083;};'use strict';var _=require(_0x5327('0x0'));var util=require(_0x5327('0x1'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var utils=require(_0x5327('0x2'));var sUtils=require(_0x5327('0x3'));var logger=require(_0x5327('0x4'))(_0x5327('0x5'));var rpc={'openchannelQueueReport':require(_0x5327('0x6')),'mailQueueReport':require(_0x5327('0x7')),'chatQueueReport':require(_0x5327('0x8')),'smsQueueReport':require(_0x5327('0x9')),'faxQueueReport':require(_0x5327('0xa')),'whatsappQueueReport':require(_0x5327('0xb'))};var RuleEngine=require(_0x5327('0xc'));function getId(_0x184ef9,_0x21855b,_0x25fe98){return util[_0x5327('0xd')](_0x5327('0xe'),_0x184ef9,_0x21855b||0x0,_0x25fe98||0x0);}function getIntervals(_0x1053c6,_0x3d3a78){var _0x492091=[];if(!_[_0x5327('0xf')](_0x3d3a78[_0x5327('0x10')])&&!_[_0x5327('0xf')](_0x1053c6[_0x3d3a78['IntervalId']])&&!_[_0x5327('0xf')](_0x1053c6[_0x3d3a78[_0x5327('0x10')]]['Intervals'])){_0x492091=_['map'](_0x1053c6[_0x3d3a78['IntervalId']][_0x5327('0x11')],_0x5327('0x12'));}else if(!_[_0x5327('0xf')](_0x3d3a78[_0x5327('0x12')])){_0x492091=[_0x3d3a78[_0x5327('0x12')]];}return _0x492091;}exports['listen']=function(_0x286679){_0x286679[_0x5327('0x13')]={};return new BPromise(function(_0x5fc4f5,_0x40f2bf){var _0x10a494={'Start':function(_0xa21b29){var _0x34621d=this;return new Promise(function(_0x1d8c44,_0xd01461){if(_0xa21b29){try{var _0x2df6db=[];var _0x9258d5=getId(_0xa21b29[_0x5327('0x14')],_0xa21b29['message']?_0xa21b29['message']['id']:0x0,_0xa21b29[_0x5327('0x15')]?_0xa21b29['interaction']['id']:0x0);var _0x12ff06=sUtils[_0x5327('0x16')](_0x286679,_0xa21b29);if(!_0x12ff06&&_0xa21b29[_0x5327('0x17')]&&_[_0x5327('0x18')](_0xa21b29[_0x5327('0x17')])&&_0xa21b29[_0x5327('0x17')][_0x5327('0x19')]){for(var _0x568ec5=0x0;_0x568ec5<_0xa21b29[_0x5327('0x17')][_0x5327('0x19')];_0x568ec5+=0x1){var _0x377c7f=_0xa21b29['applications'][_0x568ec5];if(fs[_0x5327('0x1a')](path[_0x5327('0x1b')](__dirname,_0x5327('0x17'),_0x377c7f[_0x5327('0x1c')]+'.js'))){var _0x1a25c3=[];switch(_0x377c7f[_0x5327('0x1c')][_0x5327('0x1d')]()){case _0x5327('0x1e'):var _0x581af1=_0x377c7f[_0x5327('0x1f')][_0x5327('0x20')](',');if(_0xa21b29[_0x5327('0x14')]==='mail'){_0x1a25c3['push'](_0x581af1[0x0]);_0x1a25c3[_0x5327('0x21')](_0x581af1[0x1]);_0x1a25c3[_0x5327('0x21')](_0x581af1['slice'](0x2,_0x581af1[_0x5327('0x19')])[_0x5327('0x1b')](','));}else{_0x1a25c3['push'](_0x581af1[0x0]);_0x1a25c3[_0x5327('0x21')](_0x581af1[_0x5327('0x22')](0x1,_0x581af1[_0x5327('0x19')])['join'](','));}break;case'dialogflow':var _0x3c3a9e=_0x377c7f[_0x5327('0x1f')][_0x5327('0x20')](',');_0x1a25c3['push'](_0x3c3a9e[0x0]);_0x1a25c3[_0x5327('0x21')](_0x3c3a9e[0x1]);_0x1a25c3['push'](_0x3c3a9e[_0x5327('0x22')](0x2,_0x3c3a9e['length'])[_0x5327('0x1b')](','));break;case'dialogflowv2':var _0x246758=_0x377c7f[_0x5327('0x1f')][_0x5327('0x20')](',');_0x1a25c3[_0x5327('0x21')](_0x246758[0x0]);_0x1a25c3['push'](_0x246758[0x1]);_0x1a25c3[_0x5327('0x21')](_0x246758[0x2]);_0x1a25c3[_0x5327('0x21')](_0x246758[0x3]);_0x1a25c3['push'](_0x246758[_0x5327('0x22')](0x4,_0x246758['length'])[_0x5327('0x1b')](','));break;case _0x5327('0x23'):var _0x6a39c6=_0x377c7f['appdata'][_0x5327('0x20')](',');_0x1a25c3[_0x5327('0x21')](_0x6a39c6[0x0]);_0x1a25c3[_0x5327('0x21')](_0x6a39c6[0x1]);_0x1a25c3[_0x5327('0x21')](_0x6a39c6[0x2]);_0x1a25c3[_0x5327('0x21')](_0x6a39c6[0x3]);_0x1a25c3[_0x5327('0x21')](_0x6a39c6['slice'](0x4,_0x6a39c6[_0x5327('0x19')])[_0x5327('0x1b')](','));break;case _0x5327('0x24'):_0x1a25c3[_0x5327('0x21')](_0x377c7f[_0x5327('0x1f')]);break;case _0x5327('0x25'):_0x1a25c3[_0x5327('0x21')](_0x377c7f[_0x5327('0x26')]);_0x1a25c3[_0x5327('0x21')](_0x377c7f['appdata']);break;case _0x5327('0x27'):var _0x253e2d=utils[_0x5327('0x28')](_0xa21b29[_0x5327('0x29')]['notificationTemplate'],_0xa21b29);var _0x46e6da=_0x377c7f['appdata'][_0x5327('0x20')](',');_0x1a25c3[_0x5327('0x21')](_0x46e6da[0x0]);_0x1a25c3[_0x5327('0x21')](_0x46e6da[0x1]);_0x1a25c3['push'](_0x46e6da[0x2]);_0x1a25c3[_0x5327('0x21')](_0x46e6da[0x3]);_0x1a25c3[_0x5327('0x21')](_0x46e6da[0x4]);_0x1a25c3[_0x5327('0x21')](_0x46e6da[0x5]);_0x1a25c3[_0x5327('0x21')](_0x46e6da[0x6]);_0x1a25c3[_0x5327('0x21')](_0x46e6da[0x7]);_0x1a25c3[_0x5327('0x21')](_0x46e6da[0x8]);_0x1a25c3['push'](_0x46e6da[0x9]);_0x1a25c3['push'](_0x46e6da[0xa]);_0x1a25c3[_0x5327('0x21')](_0xa21b29[_0x5327('0x15')]['id']);_0x1a25c3[_0x5327('0x21')](_0xa21b29[_0x5327('0x24')]['id']);_0x1a25c3[_0x5327('0x21')](_0x377c7f[_0x5327('0x2a')]);_0x1a25c3['push'](_0xa21b29['interaction'][_0x5327('0x2b')]);_0x1a25c3[_0x5327('0x21')](_0xa21b29[_0x5327('0x2c')][_0x5327('0x2c')]);_0x1a25c3[_0x5327('0x21')](_0x253e2d);break;default:_0x1a25c3=_[_0x5327('0xf')](_0x377c7f[_0x5327('0x1f')])?[]:_0x377c7f[_0x5327('0x1f')][_0x5327('0x20')](',');}var _0x2526a9={'id':util[_0x5327('0xd')](_0x5327('0x2d'),_0x9258d5,_0x377c7f['id'],_0x377c7f['app']),'condition':require(_0x5327('0x2e'))[_0x5327('0x2f')](_0x9258d5,getIntervals(_0x286679[_0x5327('0x30')],_0x377c7f),_0x286679),'consequence':require('./applications/'+_0x377c7f[_0x5327('0x1c')])['consequence'](_0x9258d5,_0x1a25c3,_0x286679,_0xa21b29),'p':_0x377c7f[_0x5327('0x31')]||0x0};logger[_0x5327('0x32')](_0x5327('0x33'),_0x2526a9['id'],_0x5327('0x34'),getIntervals(_0x286679[_0x5327('0x30')],_0x377c7f)[_0x5327('0x1b')](_0x5327('0x35')));_0x2df6db[_0x5327('0x21')](_0x2526a9);}else{logger[_0x5327('0x36')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x5327('0x1b')](__dirname,'applications',_0x377c7f[_0x5327('0x1c')]+_0x5327('0x37')));}}_0x286679[_0x5327('0x13')][_0x9258d5]=new RuleEngine(_0x2df6db);_0x286679['rules'][_0x9258d5][_0x5327('0x38')](_0xa21b29,function(_0x5d9481){logger['info'](_0x5327('0x39'),JSON[_0x5327('0x3a')](_0x5d9481[_0x5327('0x3b')]));if(_0x286679[_0x5327('0x13')][_0x9258d5]){_0x286679[_0x5327('0x13')][_0x9258d5][_0x5327('0x3c')](_0x5327('0x3d'));}});return _0x1d8c44({'code':0xc8,'message':_0xa21b29});}else{if(_0x12ff06){logger[_0x5327('0x32')](util[_0x5327('0xd')](_0x5327('0x3e'),_0x9258d5));}else{logger[_0x5327('0x32')](_0x5327('0x3f'));}return _0x1d8c44({'code':0xc8,'message':_0xa21b29});}}catch(_0x531c8b){logger[_0x5327('0x36')](_0x531c8b[_0x5327('0x40')]);return _0xd01461(_0x34621d['error'](0x1f4,_0x531c8b));}}return _0xd01461(_0x5327('0x41'));});},'AcceptMessage':function(_0x44379e){var _0x3a83c4=this;return new Promise(function(_0x3d20c9,_0x56e6e0){if(_0x44379e[_0x5327('0x42')]&&_0x44379e['agent']['id']){if(_0x286679['agents'][_0x44379e['agent']['id']]){_0x286679[_0x5327('0x43')][_0x44379e[_0x5327('0x42')]['id']][_0x5327('0x44')]=![];_0x286679[_0x5327('0x43')][_0x44379e[_0x5327('0x42')]['id']][_0x5327('0x45')]=undefined;}}if(_0x44379e['message']&&_0x44379e[_0x5327('0x24')]['id']){try{var _0x5b70ec=getId(_0x44379e[_0x5327('0x14')],_0x44379e['message']?_0x44379e['message']['id']:0x0,_0x44379e[_0x5327('0x15')]?_0x44379e[_0x5327('0x15')]['id']:0x0);if(_0x286679['rules'][_0x5b70ec]){_0x286679[_0x5327('0x13')][_0x5b70ec][_0x5327('0x3c')](_0x5327('0x46'));if(rpc[_0x44379e[_0x5327('0x14')]+_0x5327('0x47')]){rpc[_0x44379e[_0x5327('0x14')]+_0x5327('0x47')][_0x5327('0x48')](_0x5b70ec,{'UserId':_0x44379e[_0x5327('0x24')][_0x5327('0x49')]})[_0x5327('0x4a')](function(){logger['error'](_0x5327('0x4b'));});}}return _0x3d20c9({'code':0xc8,'message':_0x44379e});}catch(_0x55ca4e){logger[_0x5327('0x36')](_0x55ca4e['stack']);return _0x56e6e0(_0x3a83c4[_0x5327('0x36')](0x1f4,_0x55ca4e));}}logger[_0x5327('0x36')](_0x5327('0x4c'));return _0x56e6e0(_0x3a83c4[_0x5327('0x36')](0x1f4,_0x5327('0x4c')));});},'RejectMessage':function(_0x28c946){var _0x5e5f0c=this;return new Promise(function(_0x40fa55,_0x11165f){if(_0x28c946[_0x5327('0x42')]&&_0x28c946[_0x5327('0x42')]['id']){try{if(_0x286679['agents'][_0x28c946[_0x5327('0x42')]['id']]){_0x286679['agents'][_0x28c946['agent']['id']][_0x5327('0x44')]=![];_0x286679[_0x5327('0x43')][_0x28c946[_0x5327('0x42')]['id']][_0x5327('0x45')]=undefined;}return _0x40fa55({'code':0xc8,'message':_0x28c946});}catch(_0x4c8b19){logger[_0x5327('0x36')](_0x4c8b19[_0x5327('0x40')]);return _0x11165f(_0x5e5f0c[_0x5327('0x36')](0x1f4,_0x4c8b19));}}logger[_0x5327('0x36')](_0x5327('0x4c'));return _0x11165f(_0x5e5f0c['error'](0x1f4,_0x5327('0x4c')));});},'AbandonInteraction':function(_0x34dd23){var _0x2928a0=this;return new Promise(function(_0x1ddad4,_0x2ac3a9){if(_0x34dd23[_0x5327('0x14')]&&_0x34dd23[_0x5327('0x15')]&&_0x34dd23[_0x5327('0x15')]['id']){try{var _0x11c6e0=getId(_0x34dd23['channel'],_0x34dd23[_0x5327('0x24')]?_0x34dd23[_0x5327('0x24')]['id']:0x0,_0x34dd23['interaction']?_0x34dd23[_0x5327('0x15')]['id']:0x0);if(_0x286679[_0x5327('0x13')][_0x11c6e0]){_0x286679['rules'][_0x11c6e0][_0x5327('0x3c')]('end');}return _0x1ddad4({'code':0xc8,'message':_0x34dd23});}catch(_0x252cdf){logger['error'](_0x252cdf[_0x5327('0x40')]);return _0x2ac3a9(_0x2928a0[_0x5327('0x36')](0x1f4,_0x252cdf));}}logger[_0x5327('0x36')](_0x5327('0x4c'));return _0x2ac3a9(_0x2928a0[_0x5327('0x36')](0x1f4,_0x5327('0x4c')));});},'AgentCapacity':function(_0x2d851e){var _0x46cca5=this;return new Promise(function(_0x1e74b0,_0x432bc4){if(_0x286679[_0x5327('0x43')][_0x5327('0x4d')](_0x2d851e['id'])){for(var _0x3ebcb2 in _0x2d851e['capacity']){if(_0x2d851e[_0x5327('0x4e')][_0x5327('0x4d')](_0x3ebcb2)){if(_0x286679['agents'][_0x2d851e['id']][_0x5327('0x4d')](_0x3ebcb2+_0x5327('0x4f'))){_0x286679[_0x5327('0x43')][_0x2d851e['id']][_0x3ebcb2+_0x5327('0x4f')]=parseInt(_0x2d851e[_0x5327('0x4e')][_0x3ebcb2],0xa);}}}_0x286679[_0x5327('0x43')][_0x2d851e['id']][_0x5327('0x50')]();return _0x1e74b0({'code':0xc8,'message':_0x286679['agents'][_0x2d851e['id']]});}else{return _0x432bc4(_0x46cca5[_0x5327('0x36')](0x1f4,_0x5327('0x51')));}});},'Agents':function(_0x4b45b6){return new Promise(function(_0x353135){var _0x2c1715=_['values'](_0x286679['agents']);if(_0x4b45b6&&_0x4b45b6['id']){var _0x76e5d9=_[_0x5327('0x52')](_0x2c1715,function(_0x2d8d3f){return _0x2d8d3f['id']===_0x4b45b6['id'];});_0x353135(_0x76e5d9);}else{_0x353135({'count':_0x2c1715[_0x5327('0x19')],'rows':_0x2c1715});}});},'ChatQueues':function(){return new Promise(function(_0x4f9357){var _0x7cfea3=[];for(var _0x17d0fc in _0x286679[_0x5327('0x53')]){if(_0x286679[_0x5327('0x53')][_0x5327('0x4d')](_0x17d0fc)){var _0x1d77fe=_0x286679['chatQueues'][_0x17d0fc];var _0x470c78={'id':_0x1d77fe['id'],'available':_0x1d77fe[_0x5327('0x54')],'loggedIn':_0x1d77fe[_0x5327('0x55')],'name':_0x1d77fe[_0x5327('0x56')],'paused':_0x1d77fe[_0x5327('0x57')],'waiting':_0x1d77fe[_0x5327('0x58')]};_0x7cfea3[_0x5327('0x21')](_0x470c78);}}_0x4f9357({'count':_0x7cfea3[_0x5327('0x19')],'rows':_0x7cfea3});});},'MailQueues':function(){return new Promise(function(_0x31e9ba){var _0xccd1b2=[];for(var _0x10a021 in _0x286679[_0x5327('0x59')]){if(_0x286679[_0x5327('0x59')][_0x5327('0x4d')](_0x10a021)){var _0x21a3f9=_0x286679[_0x5327('0x59')][_0x10a021];var _0x26ed0b={'id':_0x21a3f9['id'],'available':_0x21a3f9[_0x5327('0x54')],'loggedIn':_0x21a3f9[_0x5327('0x55')],'name':_0x21a3f9[_0x5327('0x56')],'paused':_0x21a3f9[_0x5327('0x57')],'waiting':_0x21a3f9['waiting']};_0xccd1b2[_0x5327('0x21')](_0x26ed0b);}}_0x31e9ba({'count':_0xccd1b2[_0x5327('0x19')],'rows':_0xccd1b2});});},'OpenchannelQueues':function(){return new Promise(function(_0x3d2bf9){var _0x5ad3f9=[];for(var _0x1a38f2 in _0x286679[_0x5327('0x5a')]){if(_0x286679['openchannelQueues'][_0x5327('0x4d')](_0x1a38f2)){var _0xfd3b15=_0x286679[_0x5327('0x5a')][_0x1a38f2];var _0x3ebae3={'id':_0xfd3b15['id'],'available':_0xfd3b15[_0x5327('0x54')],'loggedIn':_0xfd3b15[_0x5327('0x55')],'name':_0xfd3b15[_0x5327('0x56')],'paused':_0xfd3b15[_0x5327('0x57')],'waiting':_0xfd3b15[_0x5327('0x58')]};_0x5ad3f9['push'](_0x3ebae3);}}_0x3d2bf9({'count':_0x5ad3f9[_0x5327('0x19')],'rows':_0x5ad3f9});});},'SmsQueues':function(){return new Promise(function(_0x1bdd9a){var _0x3e2aed=[];for(var _0x2ab2f4 in _0x286679[_0x5327('0x5b')]){if(_0x286679[_0x5327('0x5b')][_0x5327('0x4d')](_0x2ab2f4)){var _0x3afc64=_0x286679['smsQueues'][_0x2ab2f4];var _0x540e1b={'id':_0x3afc64['id'],'available':_0x3afc64['available'],'loggedIn':_0x3afc64[_0x5327('0x55')],'name':_0x3afc64['name'],'paused':_0x3afc64[_0x5327('0x57')],'waiting':_0x3afc64[_0x5327('0x58')]};_0x3e2aed[_0x5327('0x21')](_0x540e1b);}}_0x1bdd9a({'count':_0x3e2aed[_0x5327('0x19')],'rows':_0x3e2aed});});},'FaxQueues':function(){return new Promise(function(_0x47c150){var _0x679e40=[];for(var _0x341194 in _0x286679[_0x5327('0x5c')]){if(_0x286679[_0x5327('0x5c')][_0x5327('0x4d')](_0x341194)){var _0x303062=_0x286679[_0x5327('0x5c')][_0x341194];var _0x4f41b0={'id':_0x303062['id'],'available':_0x303062[_0x5327('0x54')],'loggedIn':_0x303062[_0x5327('0x55')],'name':_0x303062[_0x5327('0x56')],'paused':_0x303062[_0x5327('0x57')],'waiting':_0x303062[_0x5327('0x58')]};_0x679e40[_0x5327('0x21')](_0x4f41b0);}}_0x47c150({'count':_0x679e40[_0x5327('0x19')],'rows':_0x679e40});});},'WhatsappQueues':function(){return new Promise(function(_0x34e8a5){var _0x272a9b=[];for(var _0x4d58e6 in _0x286679[_0x5327('0x5d')]){if(_0x286679[_0x5327('0x5d')][_0x5327('0x4d')](_0x4d58e6)){var _0x1f187c=_0x286679[_0x5327('0x5d')][_0x4d58e6];var _0x40a01c={'id':_0x1f187c['id'],'available':_0x1f187c[_0x5327('0x54')],'loggedIn':_0x1f187c[_0x5327('0x55')],'name':_0x1f187c[_0x5327('0x56')],'paused':_0x1f187c['paused'],'waiting':_0x1f187c[_0x5327('0x58')]};_0x272a9b[_0x5327('0x21')](_0x40a01c);}}_0x34e8a5({'count':_0x272a9b['length'],'rows':_0x272a9b});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x494323){var _0x5012a6=_[_0x5327('0x5e')](_0x286679[_0x5327('0x5f')]);_0x494323({'count':_0x5012a6[_0x5327('0x19')],'rows':_0x5012a6});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1f4cb4){var _0xf4736f=_['values'](_0x286679['mailQueuesWaitingInteractions']);_0x1f4cb4({'count':_0xf4736f[_0x5327('0x19')],'rows':_0xf4736f});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xfe0205){var _0x7065c4=_[_0x5327('0x5e')](_0x286679['openchannelQueuesWaitingInteractions']);_0xfe0205({'count':_0x7065c4[_0x5327('0x19')],'rows':_0x7065c4});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x53a8a5){var _0x370e84=_[_0x5327('0x5e')](_0x286679[_0x5327('0x60')]);_0x53a8a5({'count':_0x370e84[_0x5327('0x19')],'rows':_0x370e84});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3fc745){var _0xe4dde1=_[_0x5327('0x5e')](_0x286679['faxQueuesWaitingInteractions']);_0x3fc745({'count':_0xe4dde1[_0x5327('0x19')],'rows':_0xe4dde1});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x275fd0){var _0x40879c=_[_0x5327('0x5e')](_0x286679['whatsappQueuesWaitingInteractions']);_0x275fd0({'count':_0x40879c[_0x5327('0x19')],'rows':_0x40879c});});}};var _0x4e8cb6=jayson[_0x5327('0x61')](_0x10a494)['http']();_0x4e8cb6['on'](_0x5327('0x36'),function(_0x1c5565){logger[_0x5327('0x36')](JSON[_0x5327('0x3a')](_0x1c5565));return _0x40f2bf(_0x1c5565);});_0x4e8cb6[_0x5327('0x62')](0x232c,_0x5327('0x63'),function(){console[_0x5327('0x64')](_0x5327('0x65'),0x232c);return _0x5fc4f5('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 9419b5f..f33026e 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 _0x4308=['log','[%s][INTERVAL]\x20%s\x20%s','stack','bluebird','jayson/promise','lodash','routing','client','http','then','error','message','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','some','join','\x20|\x20'];(function(_0x207bdf,_0x5b3c13){var _0x1f93f3=function(_0x55dd20){while(--_0x55dd20){_0x207bdf['push'](_0x207bdf['shift']());}};_0x1f93f3(++_0x5b3c13);}(_0x4308,0x85));var _0x8430=function(_0x239aa5,_0x4c68bd){_0x239aa5=_0x239aa5-0x0;var _0x62033=_0x4308[_0x239aa5];return _0x62033;};'use strict';var util=require('util');var BPromise=require(_0x8430('0x0'));var jayson=require(_0x8430('0x1'));var _=require(_0x8430('0x2'));var logger=require('../../../config/logger')(_0x8430('0x3'));var client=jayson[_0x8430('0x4')][_0x8430('0x5')]({'port':0x232a});function request(_0x3db3cf,_0x36f3ca){return new BPromise(function(_0x33ecc5,_0x50d4d3){return client['request'](_0x3db3cf,_0x36f3ca)[_0x8430('0x6')](function(_0x3b9f74){if(_0x3b9f74[_0x8430('0x7')]){return _0x50d4d3(_0x3b9f74[_0x8430('0x7')][_0x8430('0x8')]);}else{return _0x33ecc5(_0x3b9f74['result']);}})[_0x8430('0x9')](function(_0x11c6d1){return _0x50d4d3(_0x11c6d1);});});}exports['condition']=function(_0x12ae43,_0x14e129,_0x36bae8){return function(_0x12d2ee){if(_0x36bae8[_0x8430('0xa')]&&!_0x36bae8[_0x8430('0xa')][_0x12ae43]){logger[_0x8430('0xb')](_0x8430('0xc'),_0x12ae43);return _0x12d2ee[_0x8430('0xd')]();}var _0x3d997d=[];for(var _0x1ba6f8=0x0;_0x1ba6f8<_0x14e129['length'];_0x1ba6f8+=0x1){_0x3d997d[_0x8430('0xe')](request(_0x8430('0xf'),{'command':util['format'](_0x8430('0x10'),_0x14e129[_0x1ba6f8])})[_0x8430('0x6')](function(_0x4db27c){return _0x4db27c&&_0x4db27c['message']&&_0x4db27c[_0x8430('0x8')][_0x8430('0x11')](_0x8430('0x12'))>=0x0?!![]:![];})[_0x8430('0x9')](function(_0xea9987){logger['error'](_0x8430('0x13'),_0x12ae43,_0x14e129[_0x1ba6f8]);}));}BPromise['all'](_0x3d997d)[_0x8430('0x6')](function(_0x1273c3){var _0x3ec7ab=_[_0x8430('0x14')](_0x1273c3);logger[_0x8430('0xb')]('[%s][INTERVAL]\x20%s\x20%s',_0x12ae43,_0x14e129[_0x8430('0x15')](_0x8430('0x16')),_0x3ec7ab);_0x12d2ee['when'](_0x3ec7ab);})[_0x8430('0x9')](function(_0x22640a){console[_0x8430('0x17')](_0x22640a);logger['error'](_0x8430('0x18'),_0x12ae43,_0x14e129['join'](_0x8430('0x16')),_0x22640a[_0x8430('0x19')]);_0x12d2ee[_0x8430('0xd')]();});};}; \ No newline at end of file +var _0xda10=['stop','push','Command','format','iftime\x20%s','indexOf','catch','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','log','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','message','result','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0xda10,0xab));var _0x0da1=function(_0x31a82e,_0x4a3a35){_0x31a82e=_0x31a82e-0x0;var _0x48d691=_0xda10[_0x31a82e];return _0x48d691;};'use strict';var util=require(_0x0da1('0x0'));var BPromise=require(_0x0da1('0x1'));var jayson=require(_0x0da1('0x2'));var _=require(_0x0da1('0x3'));var logger=require(_0x0da1('0x4'))(_0x0da1('0x5'));var client=jayson[_0x0da1('0x6')][_0x0da1('0x7')]({'port':0x232a});function request(_0x42538e,_0x2840b7){return new BPromise(function(_0x5a5819,_0x4562c8){return client[_0x0da1('0x8')](_0x42538e,_0x2840b7)[_0x0da1('0x9')](function(_0x246a6a){if(_0x246a6a[_0x0da1('0xa')]){return _0x4562c8(_0x246a6a[_0x0da1('0xa')][_0x0da1('0xb')]);}else{return _0x5a5819(_0x246a6a[_0x0da1('0xc')]);}})['catch'](function(_0xc91663){return _0x4562c8(_0xc91663);});});}exports['condition']=function(_0x4b8fcb,_0x3d6934,_0x2cb401){return function(_0x236543){if(_0x2cb401[_0x0da1('0xd')]&&!_0x2cb401[_0x0da1('0xd')][_0x4b8fcb]){logger['info'](_0x0da1('0xe'),_0x4b8fcb);return _0x236543[_0x0da1('0xf')]();}var _0x3722a6=[];for(var _0x194b86=0x0;_0x194b86<_0x3d6934['length'];_0x194b86+=0x1){_0x3722a6[_0x0da1('0x10')](request(_0x0da1('0x11'),{'command':util[_0x0da1('0x12')](_0x0da1('0x13'),_0x3d6934[_0x194b86])})[_0x0da1('0x9')](function(_0x5dd273){return _0x5dd273&&_0x5dd273[_0x0da1('0xb')]&&_0x5dd273[_0x0da1('0xb')][_0x0da1('0x14')]('true')>=0x0?!![]:![];})[_0x0da1('0x15')](function(_0x341796){logger[_0x0da1('0xa')](_0x0da1('0x16'),_0x4b8fcb,_0x3d6934[_0x194b86]);}));}BPromise[_0x0da1('0x17')](_0x3722a6)[_0x0da1('0x9')](function(_0x14159f){var _0x38432a=_[_0x0da1('0x18')](_0x14159f);logger[_0x0da1('0x19')](_0x0da1('0x1a'),_0x4b8fcb,_0x3d6934[_0x0da1('0x1b')]('\x20|\x20'),_0x38432a);_0x236543['when'](_0x38432a);})[_0x0da1('0x15')](function(_0x5c5560){console[_0x0da1('0x1c')](_0x5c5560);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x4b8fcb,_0x3d6934[_0x0da1('0x1b')](_0x0da1('0x1d')),_0x5c5560[_0x0da1('0x1e')]);_0x236543[_0x0da1('0xf')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 89e2f06..bd159bf 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 _0xf4eb=['request','debug','format','[%s][agents][agentcalled]','destuniqueid','now','lastevent','connectedlinename','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentconnect]','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agentcalledAt','agententerreason','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','info','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','then','type','agentacw','agentcomplete','acw','acwTimeout','CreateVoiceAgentReport'];(function(_0x5104ec,_0x11722d){var _0x22b805=function(_0x51bf40){while(--_0x51bf40){_0x5104ec['push'](_0x5104ec['shift']());}};_0x22b805(++_0x11722d);}(_0xf4eb,0xec));var _0xbf4e=function(_0xc90086,_0x1c2b69){_0xc90086=_0xc90086-0x0;var _0xb09b30=_0xf4eb[_0xc90086];return _0xb09b30;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x479210,_0x5ed5b9){utils[_0xbf4e('0x1')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x479210[_0xbf4e('0x2')],_0x479210[_0xbf4e('0x3')],_0x479210[_0xbf4e('0x4')],_0x479210[_0xbf4e('0x5')],_0x479210[_0xbf4e('0x6')],_0x479210[_0xbf4e('0x7')],_0x479210[_0xbf4e('0x8')],_0x479210['lastevent']));if(_0x479210[_0xbf4e('0x4')]){utils['getVoiceQueueByName'](_0x479210['queue'])[_0xbf4e('0x9')](function(_0x3761c1){if(_0x3761c1){_0x479210[_0xbf4e('0xa')]=_0x3761c1[_0xbf4e('0xa')];_0x479210[_0xbf4e('0xb')]=_0x479210[_0xbf4e('0xc')]?_0x3761c1[_0xbf4e('0xd')]:![];_0x479210['acwtime']=_0x479210['agentacw']?_0x3761c1[_0xbf4e('0xe')]:0x0;}utils['request'](_0xbf4e('0xf'),_0x479210);});}else{utils[_0xbf4e('0x10')]('CreateVoiceAgentReport',_0x479210);}if(_0x5ed5b9){delete transfers[_0x479210[_0xbf4e('0x2')]];}else{delete agents[_0x479210['destuniqueid']];}}exports['agentcalled']=function(_0x209b25){try{utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')](_0xbf4e('0x13'),_0x209b25[_0xbf4e('0x2')]),_0x209b25);agents[_0x209b25[_0xbf4e('0x14')]]=_0x209b25;agents[_0x209b25['destuniqueid']]['agentcalledAt']=utils[_0xbf4e('0x15')]();agents[_0x209b25[_0xbf4e('0x14')]][_0xbf4e('0x16')]='called';agents[_0x209b25[_0xbf4e('0x14')]][_0xbf4e('0x8')]=null;agents[_0x209b25[_0xbf4e('0x14')]][_0xbf4e('0x17')]=null;utils['info'](util[_0xbf4e('0x12')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x209b25['uniqueid'],agents[_0x209b25['destuniqueid']]['membername'],_0x209b25[_0xbf4e('0x14')]));}catch(_0x1ca73c){utils[_0xbf4e('0x18')](util['format']('[%s][agents][agentcalled]',_0x209b25[_0xbf4e('0x2')]),_0x1ca73c);}};exports[_0xbf4e('0x19')]=function(_0x3be138){try{if(!_[_0xbf4e('0x1a')](agents[_0x3be138[_0xbf4e('0x14')]])){utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')](_0xbf4e('0x1b'),_0x3be138[_0xbf4e('0x2')]),_0x3be138);utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x3be138[_0xbf4e('0x2')],agents[_0x3be138[_0xbf4e('0x14')]]['membername'],_0x3be138[_0xbf4e('0x14')]));agents[_0x3be138[_0xbf4e('0x14')]][_0xbf4e('0x19')]=!![];agents[_0x3be138[_0xbf4e('0x14')]][_0xbf4e('0x1c')]=utils['now']();agents[_0x3be138[_0xbf4e('0x14')]][_0xbf4e('0x16')]=_0xbf4e('0x1d');agents[_0x3be138['destuniqueid']][_0xbf4e('0x1e')]='timeout';agents[_0x3be138['destuniqueid']][_0xbf4e('0x1f')]=_0x3be138['ringtime']?parseInt(_0x3be138[_0xbf4e('0x20')])/0x3e8:0x0;agents[_0x3be138[_0xbf4e('0x14')]][_0xbf4e('0x21')]=0x0;unanswered[_0xbf4e('0x22')](_0x3be138['destuniqueid']);}}catch(_0x2d4686){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')]('[%s][agents][agentringnoanswer]',_0x3be138[_0xbf4e('0x2')]),_0x2d4686);}};exports['queuecallerabandon']=function(_0x1dfa81){try{_[_0xbf4e('0x23')](agents,function(_0xb8b58e,_0x498dbd){if(_0xb8b58e[_0xbf4e('0x2')]==_0x1dfa81[_0xbf4e('0x2')]&&!_[_0xbf4e('0x24')](unanswered,_0xb8b58e[_0xbf4e('0x14')])){utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')]('[%s][agents][queuecallerabandon]',_0x1dfa81[_0xbf4e('0x2')]),_0x1dfa81);utils[_0xbf4e('0x1')](util['format'](_0xbf4e('0x25'),_0x1dfa81[_0xbf4e('0x2')],_0xb8b58e['membername'],_0xb8b58e[_0xbf4e('0x14')]));_0xb8b58e['agentringnoanswer']=!![];_0xb8b58e[_0xbf4e('0x1c')]=utils['now']();_0xb8b58e[_0xbf4e('0x16')]=_0xbf4e('0x26');_0xb8b58e[_0xbf4e('0x1e')]='abandoned';_0xb8b58e[_0xbf4e('0x1f')]=_0x1dfa81[_0xbf4e('0x1f')];_0xb8b58e[_0xbf4e('0x21')]=0x0;writeDB(_0xb8b58e);}});}catch(_0x29d6aa){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')]('[%s][agents][queuecallerabandon]',_0x1dfa81[_0xbf4e('0x2')]),_0x29d6aa);}};exports[_0xbf4e('0x27')]=function(_0x25b837){try{if(agents[_0x25b837[_0xbf4e('0x14')]]){utils[_0xbf4e('0x11')](util['format']('[%s][agents][agentconnect]',_0x25b837['uniqueid']),_0x25b837);utils['info'](util[_0xbf4e('0x12')](_0xbf4e('0x28'),_0x25b837[_0xbf4e('0x2')],agents[_0x25b837[_0xbf4e('0x14')]][_0xbf4e('0x5')],_0x25b837[_0xbf4e('0x14')]));agents[_0x25b837[_0xbf4e('0x14')]][_0xbf4e('0x29')]=utils[_0xbf4e('0x15')]();agents[_0x25b837['destuniqueid']]['connectedlinenum']=_0x25b837[_0xbf4e('0x8')];agents[_0x25b837[_0xbf4e('0x14')]][_0xbf4e('0x17')]=_0x25b837['connectedlinename'];agents[_0x25b837[_0xbf4e('0x14')]]['holdtime']=_0x25b837[_0xbf4e('0x20')];agents[_0x25b837[_0xbf4e('0x14')]][_0xbf4e('0x16')]=_0xbf4e('0x2a');_['forIn'](agents,function(_0x31d8dc,_0x78ab2d){if(_0x31d8dc[_0xbf4e('0x14')]!=_0x25b837[_0xbf4e('0x14')]&&_0x31d8dc['uniqueid']==_0x25b837[_0xbf4e('0x2')]){_0x31d8dc[_0xbf4e('0x21')]=0x0;_0x31d8dc[_0xbf4e('0x1f')]=_0x25b837[_0xbf4e('0x20')];_0x31d8dc[_0xbf4e('0x19')]=!![];_0x31d8dc[_0xbf4e('0x1c')]=utils[_0xbf4e('0x15')]();_0x31d8dc['lastevent']=_0xbf4e('0x2b');_0x31d8dc[_0xbf4e('0x1e')]='answered_elsewhere';_0x31d8dc['answeredelsewheredestinationuniqueid']=_0x25b837[_0xbf4e('0x14')];_0x31d8dc[_0xbf4e('0x2c')]=_0x25b837['membername'];writeDB(_0x31d8dc);}});}}catch(_0x5bfc4d){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')](_0xbf4e('0x2d'),_0x25b837[_0xbf4e('0x2')]),_0x5bfc4d);}};exports[_0xbf4e('0xc')]=function(_0x3ad0a4){try{if(!_['isNil'](agents[_0x3ad0a4[_0xbf4e('0x14')]])){utils[_0xbf4e('0x11')](util['format']('[%s][agents][agentcomplete]',_0x3ad0a4['uniqueid']),_0x3ad0a4);utils['info'](util[_0xbf4e('0x12')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3ad0a4[_0xbf4e('0x2')],agents[_0x3ad0a4[_0xbf4e('0x14')]]['membername'],_0x3ad0a4['destuniqueid']));agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0xc')]=!![];agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x2e')]=utils[_0xbf4e('0x15')]();agents[_0x3ad0a4['destuniqueid']][_0xbf4e('0x21')]=utils[_0xbf4e('0x2f')](agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x2e')],agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x29')]);agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x1e')]=_0x3ad0a4['reason'];agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x16')]=_0xbf4e('0x30');writeDB(agents[_0x3ad0a4[_0xbf4e('0x14')]]);}}catch(_0x9bc1fe){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')](_0xbf4e('0x31'),_0x3ad0a4[_0xbf4e('0x2')]),_0x9bc1fe);}};exports[_0xbf4e('0x32')]=function(_0x2fdba9){try{if(!_[_0xbf4e('0x1a')](agents[_0x2fdba9[_0xbf4e('0x33')]])){utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')](_0xbf4e('0x34'),_0x2fdba9[_0xbf4e('0x2')]),_0x2fdba9);utils['info'](util[_0xbf4e('0x12')](_0xbf4e('0x35'),_0x2fdba9[_0xbf4e('0x2')],agents[_0x2fdba9['transfereruniqueid']][_0xbf4e('0x5')],agents[_0x2fdba9['transfereruniqueid']]['uniqueid']));agents[_0x2fdba9[_0xbf4e('0x33')]][_0xbf4e('0x36')]=!![];agents[_0x2fdba9['transfereruniqueid']][_0xbf4e('0x37')]=_0xbf4e('0x38');agents[_0x2fdba9[_0xbf4e('0x33')]][_0xbf4e('0x39')]=_0x2fdba9[_0xbf4e('0x3a')];agents[_0x2fdba9[_0xbf4e('0x33')]][_0xbf4e('0x3b')]=agents[_0x2fdba9[_0xbf4e('0x33')]][_0xbf4e('0x2')];}}catch(_0xc058e1){utils[_0xbf4e('0x18')](util['format']('[%s][agents][blindtransfer]',_0x2fdba9[_0xbf4e('0x2')]),_0xc058e1);}};exports[_0xbf4e('0x3c')]=function(_0x3d0b4a){try{utils['debug'](util[_0xbf4e('0x12')](_0xbf4e('0x3d'),_0x3d0b4a['origtransfereruniqueid']),_0x3d0b4a);if(_0x3d0b4a['origtransfereruniqueid']==_0x3d0b4a[_0xbf4e('0x3e')]){if(!_['isNil'](agents[_0x3d0b4a['secondtransfereruniqueid']])){utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')](_0xbf4e('0x3f'),_0x3d0b4a[_0xbf4e('0x40')],agents[_0x3d0b4a[_0xbf4e('0x41')]]['membername']));agents[_0x3d0b4a[_0xbf4e('0x41')]]['transfer']=!![];agents[_0x3d0b4a[_0xbf4e('0x41')]]['transfertype']=_0xbf4e('0x42');agents[_0x3d0b4a['secondtransfereruniqueid']][_0xbf4e('0x39')]=_0x3d0b4a[_0xbf4e('0x43')];agents[_0x3d0b4a[_0xbf4e('0x41')]][_0xbf4e('0x3b')]=_0x3d0b4a[_0xbf4e('0x40')];}if(_0x3d0b4a['transfereeuniqueid']&&agents[_0x3d0b4a['transfereeuniqueid']]){agents[_0x3d0b4a['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x3d0b4a[_0xbf4e('0x44')]]=_[_0xbf4e('0x45')](agents[_0x3d0b4a['transfereeuniqueid']]);transfers[_0x3d0b4a[_0xbf4e('0x44')]][_0xbf4e('0x7')]=agents[_0x3d0b4a[_0xbf4e('0x41')]][_0xbf4e('0x7')];transfers[_0x3d0b4a[_0xbf4e('0x44')]][_0xbf4e('0x46')]=agents[_0x3d0b4a[_0xbf4e('0x41')]]['calleridname'];transfers[_0x3d0b4a[_0xbf4e('0x44')]][_0xbf4e('0x47')]=utils[_0xbf4e('0x15')]();transfers[_0x3d0b4a['transfereeuniqueid']]['agentconnectAt']=utils[_0xbf4e('0x15')]();transfers[_0x3d0b4a[_0xbf4e('0x44')]][_0xbf4e('0x1f')]=0x0;transfers[_0x3d0b4a['transfereeuniqueid']][_0xbf4e('0x48')]=0x2;}}else if(_0x3d0b4a[_0xbf4e('0x41')]==_0x3d0b4a[_0xbf4e('0x49')]){if(!_[_0xbf4e('0x1a')](agents[_0x3d0b4a[_0xbf4e('0x40')]])){utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')](_0xbf4e('0x3f'),_0x3d0b4a[_0xbf4e('0x40')],agents[_0x3d0b4a[_0xbf4e('0x40')]][_0xbf4e('0x5')]));agents[_0x3d0b4a[_0xbf4e('0x40')]]['transfer']=!![];agents[_0x3d0b4a[_0xbf4e('0x40')]]['transfertype']=_0xbf4e('0x42');agents[_0x3d0b4a[_0xbf4e('0x40')]][_0xbf4e('0x39')]=_0x3d0b4a[_0xbf4e('0x4a')];agents[_0x3d0b4a[_0xbf4e('0x40')]][_0xbf4e('0x3b')]=_0x3d0b4a[_0xbf4e('0x41')];}if(_0x3d0b4a[_0xbf4e('0x4b')]&&agents[_0x3d0b4a['transfertargetuniqueid']]){agents[_0x3d0b4a[_0xbf4e('0x4b')]][_0xbf4e('0x48')]=0x1;transfers[_0x3d0b4a[_0xbf4e('0x4b')]]=_[_0xbf4e('0x45')](agents[_0x3d0b4a[_0xbf4e('0x4b')]]);transfers[_0x3d0b4a['transfertargetuniqueid']][_0xbf4e('0x7')]=agents[_0x3d0b4a[_0xbf4e('0x40')]][_0xbf4e('0x7')];transfers[_0x3d0b4a[_0xbf4e('0x4b')]][_0xbf4e('0x46')]=agents[_0x3d0b4a[_0xbf4e('0x40')]]['calleridname'];transfers[_0x3d0b4a[_0xbf4e('0x4b')]]['agentcalledAt']=utils[_0xbf4e('0x15')]();transfers[_0x3d0b4a[_0xbf4e('0x4b')]][_0xbf4e('0x29')]=utils[_0xbf4e('0x15')]();transfers[_0x3d0b4a['transfertargetuniqueid']][_0xbf4e('0x1f')]=0x0;transfers[_0x3d0b4a['transfertargetuniqueid']]['agententerreason']=0x2;}}}catch(_0x2c0dbd){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')]('[%s][agents][attendedtransfer]',_0x3d0b4a[_0xbf4e('0x40')]),_0x2c0dbd);}};exports[_0xbf4e('0x4c')]=function(_0x4d7241){try{utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')](_0xbf4e('0x4d'),_0x4d7241[_0xbf4e('0x2')]),_0x4d7241);if(agents[_0x4d7241[_0xbf4e('0x2')]]&&agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')]===_0xbf4e('0x1d')){if(_0x4d7241[_0xbf4e('0x4e')]==='21'){agents[_0x4d7241['uniqueid']][_0xbf4e('0x1e')]=_0xbf4e('0x4f');agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x16')]='rejected';}utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')](_0xbf4e('0x50'),_0x4d7241[_0xbf4e('0x2')],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x5')],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')],agents[_0x4d7241[_0xbf4e('0x2')]]['lastevent']));writeDB(agents[_0x4d7241[_0xbf4e('0x2')]]);var _0x47ef56=unanswered[_0xbf4e('0x51')](_0x4d7241[_0xbf4e('0x2')]);if(_0x47ef56>-0x1){unanswered[_0xbf4e('0x52')](_0x47ef56,0x1);}}if(transfers[_0x4d7241[_0xbf4e('0x2')]]){transfers[_0x4d7241[_0xbf4e('0x2')]]['agentcomplete']=!![];transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x2e')]=utils[_0xbf4e('0x15')]();transfers[_0x4d7241['uniqueid']][_0xbf4e('0x21')]=utils[_0xbf4e('0x2f')](transfers[_0x4d7241[_0xbf4e('0x2')]]['agentcompleteAt'],transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x29')]);transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')]=_0xbf4e('0x53');transfers[_0x4d7241['uniqueid']][_0xbf4e('0x16')]='complete';utils[_0xbf4e('0x1')](util['format'](_0xbf4e('0x50'),_0x4d7241['uniqueid'],transfers[_0x4d7241[_0xbf4e('0x2')]]['membername'],transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')],transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x16')]));writeDB(transfers[_0x4d7241[_0xbf4e('0x2')]],!![]);}if(agents[_0x4d7241[_0xbf4e('0x2')]]&&agents[_0x4d7241[_0xbf4e('0x2')]]['agentconnectAt']){agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0xc')]=!![];agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x2e')]=utils[_0xbf4e('0x15')]();agents[_0x4d7241[_0xbf4e('0x2')]]['talktime']=utils[_0xbf4e('0x2f')](agents[_0x4d7241[_0xbf4e('0x2')]]['agentcompleteAt'],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x29')]);agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')]=agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x36')]?_0xbf4e('0x36'):_0xbf4e('0x53');agents[_0x4d7241[_0xbf4e('0x2')]]['lastevent']=_0xbf4e('0x30');utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4d7241[_0xbf4e('0x2')],agents[_0x4d7241[_0xbf4e('0x2')]]['membername'],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x16')]));writeDB(agents[_0x4d7241[_0xbf4e('0x2')]]);}}catch(_0x1cc939){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')](_0xbf4e('0x4d'),_0x4d7241[_0xbf4e('0x2')]),_0x1cc939);}}; \ No newline at end of file +var _0x76dc=['origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','agent','complete','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','format','uniqueid','membername','interface','calleridnum','queue','getVoiceQueueByName','type','agentcomplete','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','now','lastevent','called','connectedlinenum','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','talktime','queuecallerabandon','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','ringtime','connect','answered_elsewhere','answeredelsewheremembername','isNil','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][agentcomplete]','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][blindtransfer]','[%s][agents][attendedtransfer]','origtransfereruniqueid'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0x76dc,0x1f2));var _0xc76d=function(_0x46ff4a,_0x1b501b){_0x46ff4a=_0x46ff4a-0x0;var _0x2a2a31=_0x76dc[_0x46ff4a];return _0x2a2a31;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var utils=require(_0xc76d('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x26e85e,_0x49c651){utils[_0xc76d('0x3')](util[_0xc76d('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x26e85e[_0xc76d('0x5')],_0x26e85e['channel'],_0x26e85e['queue'],_0x26e85e[_0xc76d('0x6')],_0x26e85e[_0xc76d('0x7')],_0x26e85e[_0xc76d('0x8')],_0x26e85e['connectedlinenum'],_0x26e85e['lastevent']));if(_0x26e85e[_0xc76d('0x9')]){utils[_0xc76d('0xa')](_0x26e85e[_0xc76d('0x9')])['then'](function(_0x570197){if(_0x570197){_0x26e85e[_0xc76d('0xb')]=_0x570197[_0xc76d('0xb')];_0x26e85e['agentacw']=_0x26e85e[_0xc76d('0xc')]?_0x570197['acw']:![];_0x26e85e[_0xc76d('0xd')]=_0x26e85e[_0xc76d('0xe')]?_0x570197[_0xc76d('0xf')]:0x0;}utils[_0xc76d('0x10')](_0xc76d('0x11'),_0x26e85e);});}else{utils[_0xc76d('0x10')](_0xc76d('0x11'),_0x26e85e);}if(_0x49c651){delete transfers[_0x26e85e[_0xc76d('0x5')]];}else{delete agents[_0x26e85e[_0xc76d('0x12')]];}}exports[_0xc76d('0x13')]=function(_0x1a7b47){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x15'),_0x1a7b47['uniqueid']),_0x1a7b47);agents[_0x1a7b47[_0xc76d('0x12')]]=_0x1a7b47;agents[_0x1a7b47[_0xc76d('0x12')]]['agentcalledAt']=utils[_0xc76d('0x16')]();agents[_0x1a7b47[_0xc76d('0x12')]][_0xc76d('0x17')]=_0xc76d('0x18');agents[_0x1a7b47['destuniqueid']][_0xc76d('0x19')]=null;agents[_0x1a7b47['destuniqueid']]['connectedlinename']=null;utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x1a'),_0x1a7b47[_0xc76d('0x5')],agents[_0x1a7b47[_0xc76d('0x12')]]['membername'],_0x1a7b47[_0xc76d('0x12')]));}catch(_0x361f42){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x15'),_0x1a7b47['uniqueid']),_0x361f42);}};exports[_0xc76d('0x1c')]=function(_0x324db7){try{if(!_['isNil'](agents[_0x324db7[_0xc76d('0x12')]])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x1d'),_0x324db7[_0xc76d('0x5')]),_0x324db7);utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x1e'),_0x324db7[_0xc76d('0x5')],agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x6')],_0x324db7['destuniqueid']));agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x1c')]=!![];agents[_0x324db7['destuniqueid']][_0xc76d('0x1f')]=utils[_0xc76d('0x16')]();agents[_0x324db7['destuniqueid']][_0xc76d('0x17')]=_0xc76d('0x20');agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x21')]=_0xc76d('0x20');agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x22')]=_0x324db7['ringtime']?parseInt(_0x324db7['ringtime'])/0x3e8:0x0;agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x23')]=0x0;unanswered['push'](_0x324db7[_0xc76d('0x12')]);}}catch(_0x52a79a){utils[_0xc76d('0x1b')](util['format'](_0xc76d('0x1d'),_0x324db7['uniqueid']),_0x52a79a);}};exports[_0xc76d('0x24')]=function(_0x18a7fa){try{_['forIn'](agents,function(_0x3d4076,_0x1c68f3){if(_0x3d4076[_0xc76d('0x5')]==_0x18a7fa[_0xc76d('0x5')]&&!_['includes'](unanswered,_0x3d4076[_0xc76d('0x12')])){utils['debug'](util[_0xc76d('0x4')]('[%s][agents][queuecallerabandon]',_0x18a7fa[_0xc76d('0x5')]),_0x18a7fa);utils[_0xc76d('0x3')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x18a7fa['uniqueid'],_0x3d4076['membername'],_0x3d4076[_0xc76d('0x12')]));_0x3d4076[_0xc76d('0x1c')]=!![];_0x3d4076[_0xc76d('0x1f')]=utils[_0xc76d('0x16')]();_0x3d4076[_0xc76d('0x17')]='abandoned';_0x3d4076[_0xc76d('0x21')]='abandoned';_0x3d4076[_0xc76d('0x22')]=_0x18a7fa['holdtime'];_0x3d4076[_0xc76d('0x23')]=0x0;writeDB(_0x3d4076);}});}catch(_0x2332f5){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x25'),_0x18a7fa['uniqueid']),_0x2332f5);}};exports[_0xc76d('0x26')]=function(_0x371306){try{if(agents[_0x371306[_0xc76d('0x12')]]){utils['debug'](util[_0xc76d('0x4')](_0xc76d('0x27'),_0x371306[_0xc76d('0x5')]),_0x371306);utils['info'](util[_0xc76d('0x4')](_0xc76d('0x28'),_0x371306[_0xc76d('0x5')],agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x6')],_0x371306[_0xc76d('0x12')]));agents[_0x371306['destuniqueid']]['agentconnectAt']=utils[_0xc76d('0x16')]();agents[_0x371306['destuniqueid']][_0xc76d('0x19')]=_0x371306[_0xc76d('0x19')];agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x29')]=_0x371306['connectedlinename'];agents[_0x371306['destuniqueid']][_0xc76d('0x22')]=_0x371306[_0xc76d('0x2a')];agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x17')]=_0xc76d('0x2b');_['forIn'](agents,function(_0x42404c,_0xb264b0){if(_0x42404c[_0xc76d('0x12')]!=_0x371306[_0xc76d('0x12')]&&_0x42404c[_0xc76d('0x5')]==_0x371306[_0xc76d('0x5')]){_0x42404c[_0xc76d('0x23')]=0x0;_0x42404c[_0xc76d('0x22')]=_0x371306[_0xc76d('0x2a')];_0x42404c[_0xc76d('0x1c')]=!![];_0x42404c['agentringnoanswerAt']=utils['now']();_0x42404c[_0xc76d('0x17')]=_0xc76d('0x2c');_0x42404c[_0xc76d('0x21')]=_0xc76d('0x2c');_0x42404c['answeredelsewheredestinationuniqueid']=_0x371306['destuniqueid'];_0x42404c[_0xc76d('0x2d')]=_0x371306[_0xc76d('0x6')];writeDB(_0x42404c);}});}}catch(_0x3e471e){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x27'),_0x371306[_0xc76d('0x5')]),_0x3e471e);}};exports[_0xc76d('0xc')]=function(_0x50e922){try{if(!_[_0xc76d('0x2e')](agents[_0x50e922[_0xc76d('0x12')]])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')]('[%s][agents][agentcomplete]',_0x50e922['uniqueid']),_0x50e922);utils['info'](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x50e922['uniqueid'],agents[_0x50e922['destuniqueid']][_0xc76d('0x6')],_0x50e922[_0xc76d('0x12')]));agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0xc')]=!![];agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();agents[_0x50e922[_0xc76d('0x12')]]['talktime']=utils[_0xc76d('0x30')](agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x2f')],agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x31')]);agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x21')]=_0x50e922[_0xc76d('0x21')];agents[_0x50e922[_0xc76d('0x12')]]['lastevent']='complete';writeDB(agents[_0x50e922[_0xc76d('0x12')]]);}}catch(_0x170f47){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x32'),_0x50e922['uniqueid']),_0x170f47);}};exports[_0xc76d('0x33')]=function(_0x1ede13){try{if(!_['isNil'](agents[_0x1ede13['transfereruniqueid']])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')]('[%s][agents][blindtransfer]',_0x1ede13[_0xc76d('0x5')]),_0x1ede13);utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x34'),_0x1ede13[_0xc76d('0x5')],agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x6')],agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x5')]));agents[_0x1ede13[_0xc76d('0x35')]]['transfer']=!![];agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x36')]=_0xc76d('0x37');agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x38')]=_0x1ede13[_0xc76d('0x39')];agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x3a')]=agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x5')];}}catch(_0x12c972){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x3b'),_0x1ede13['uniqueid']),_0x12c972);}};exports['attendedtransfer']=function(_0x5bec6c){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x3c'),_0x5bec6c[_0xc76d('0x3d')]),_0x5bec6c);if(_0x5bec6c[_0xc76d('0x3d')]==_0x5bec6c[_0xc76d('0x3e')]){if(!_['isNil'](agents[_0x5bec6c[_0xc76d('0x3f')]])){utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x40'),_0x5bec6c[_0xc76d('0x3d')],agents[_0x5bec6c['secondtransfereruniqueid']][_0xc76d('0x6')]));agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x41')]=!![];agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x36')]=_0xc76d('0x42');agents[_0x5bec6c['secondtransfereruniqueid']][_0xc76d('0x38')]=_0x5bec6c[_0xc76d('0x43')];agents[_0x5bec6c['secondtransfereruniqueid']]['transferuniqueid']=_0x5bec6c[_0xc76d('0x3d')];}if(_0x5bec6c['transfereeuniqueid']&&agents[_0x5bec6c[_0xc76d('0x44')]]){agents[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x45')]=0x1;transfers[_0x5bec6c[_0xc76d('0x44')]]=_[_0xc76d('0x46')](agents[_0x5bec6c[_0xc76d('0x44')]]);transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x8')]=agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x8')];transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x47')]=agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x47')];transfers[_0x5bec6c['transfereeuniqueid']][_0xc76d('0x48')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x31')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c['transfereeuniqueid']][_0xc76d('0x22')]=0x0;transfers[_0x5bec6c[_0xc76d('0x44')]]['agententerreason']=0x2;}}else if(_0x5bec6c['secondtransfereruniqueid']==_0x5bec6c['secondtransfererlinkedid']){if(!_[_0xc76d('0x2e')](agents[_0x5bec6c[_0xc76d('0x3d')]])){utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x40'),_0x5bec6c[_0xc76d('0x3d')],agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x6')]));agents[_0x5bec6c['origtransfereruniqueid']][_0xc76d('0x41')]=!![];agents[_0x5bec6c['origtransfereruniqueid']]['transfertype']=_0xc76d('0x42');agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x38')]=_0x5bec6c['secondtransfererexten'];agents[_0x5bec6c[_0xc76d('0x3d')]]['transferuniqueid']=_0x5bec6c['secondtransfereruniqueid'];}if(_0x5bec6c['transfertargetuniqueid']&&agents[_0x5bec6c[_0xc76d('0x49')]]){agents[_0x5bec6c[_0xc76d('0x49')]]['agententerreason']=0x1;transfers[_0x5bec6c[_0xc76d('0x49')]]=_[_0xc76d('0x46')](agents[_0x5bec6c[_0xc76d('0x49')]]);transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x8')]=agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x8')];transfers[_0x5bec6c['transfertargetuniqueid']]['calleridname']=agents[_0x5bec6c['origtransfereruniqueid']][_0xc76d('0x47')];transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x48')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x49')]]['agentconnectAt']=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x22')]=0x0;transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x45')]=0x2;}}}catch(_0x2af760){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')]('[%s][agents][attendedtransfer]',_0x5bec6c[_0xc76d('0x3d')]),_0x2af760);}};exports['hangup']=function(_0xa9f2e8){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x4a'),_0xa9f2e8['uniqueid']),_0xa9f2e8);if(agents[_0xa9f2e8[_0xc76d('0x5')]]&&agents[_0xa9f2e8['uniqueid']]['reason']===_0xc76d('0x20')){if(_0xa9f2e8[_0xc76d('0x4b')]==='21'){agents[_0xa9f2e8['uniqueid']][_0xc76d('0x21')]=_0xc76d('0x4c');agents[_0xa9f2e8['uniqueid']][_0xc76d('0x17')]=_0xc76d('0x4c');}utils['info'](util[_0xc76d('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xa9f2e8[_0xc76d('0x5')],agents[_0xa9f2e8[_0xc76d('0x5')]]['membername'],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],agents[_0xa9f2e8['uniqueid']][_0xc76d('0x17')]));writeDB(agents[_0xa9f2e8[_0xc76d('0x5')]]);var _0x277382=unanswered['indexOf'](_0xa9f2e8[_0xc76d('0x5')]);if(_0x277382>-0x1){unanswered['splice'](_0x277382,0x1);}}if(transfers[_0xa9f2e8['uniqueid']]){transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0xc')]=!![];transfers[_0xa9f2e8['uniqueid']][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x23')]=utils[_0xc76d('0x30')](transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]);transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')]=_0xc76d('0x4d');transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x17')]=_0xc76d('0x4e');utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x4f'),_0xa9f2e8[_0xc76d('0x5')],transfers[_0xa9f2e8[_0xc76d('0x5')]]['membername'],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x17')]));writeDB(transfers[_0xa9f2e8[_0xc76d('0x5')]],!![]);}if(agents[_0xa9f2e8[_0xc76d('0x5')]]&&agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]){agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0xc')]=!![];agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x23')]=utils[_0xc76d('0x30')](agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]);agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')]=agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x41')]?'transfer':_0xc76d('0x4d');agents[_0xa9f2e8[_0xc76d('0x5')]]['lastevent']=_0xc76d('0x4e');utils[_0xc76d('0x3')](util['format'](_0xc76d('0x4f'),_0xa9f2e8[_0xc76d('0x5')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x6')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],agents[_0xa9f2e8[_0xc76d('0x5')]]['lastevent']));writeDB(agents[_0xa9f2e8['uniqueid']]);}}catch(_0xe6a1dc){utils[_0xc76d('0x1b')](util['format'](_0xc76d('0x4a'),_0xa9f2e8[_0xc76d('0x5')]),_0xe6a1dc);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index bb260ed..865a0dc 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 _0x5fa9=['application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','includes','noop','execif','lastapplication','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','debug','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','error','[%s][calls][newstate]','hangup','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastdata','queue','[%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','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s'];(function(_0xae0ae9,_0x8ca848){var _0x19e4ff=function(_0x4bc818){while(--_0x4bc818){_0xae0ae9['push'](_0xae0ae9['shift']());}};_0x19e4ff(++_0x8ca848);}(_0x5fa9,0x150));var _0x95fa=function(_0x13e4d6,_0x4d647f){_0x13e4d6=_0x13e4d6-0x0;var _0x395c06=_0x5fa9[_0x13e4d6];return _0x395c06;};'use strict';var _=require(_0x95fa('0x0'));var util=require(_0x95fa('0x1'));var utils=require(_0x95fa('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x95fa('0x3'),_0x95fa('0x4'),'FAILED','NO\x20ANSWER',_0x95fa('0x3'),'NO\x20ANSWER',_0x95fa('0x5'),'BUSY','FAILED',_0x95fa('0x4'),'FAILED'];var channels={};function writeDB(_0x3afc2b){var _0x2937cd;if(transfers[_0x95fa('0x6')][_0x3afc2b['uniqueid']]){_0x2937cd=_0x3afc2b[_0x95fa('0x7')];_0x3afc2b[_0x95fa('0x7')]=transfers['blinds'][_0x3afc2b['uniqueid']]['transfereeuniqueid'];}utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0xa'),_0x3afc2b[_0x95fa('0x7')],_0x3afc2b[_0x95fa('0xb')],_0x3afc2b['queue'],_0x3afc2b[_0x95fa('0xc')],_0x3afc2b['interface'],_0x3afc2b[_0x95fa('0xd')],_0x3afc2b[_0x95fa('0xe')],_0x3afc2b[_0x95fa('0xf')]));if(_0x3afc2b[_0x95fa('0x10')]){utils[_0x95fa('0x11')](_0x3afc2b[_0x95fa('0x10')])[_0x95fa('0x12')](function(_0x30e4b7){if(_0x30e4b7){_0x3afc2b[_0x95fa('0x13')]=_0x30e4b7['id'];}utils['request'](_0x95fa('0x14'),_0x3afc2b);});}else{utils[_0x95fa('0x15')](_0x95fa('0x14'),_0x3afc2b);}if(channels[_0x3afc2b[_0x95fa('0x7')]]){delete channels[_0x3afc2b['uniqueid']];}else if(_0x2937cd&&channels[_0x2937cd]){if(!transfers['blinds'][_0x2937cd]['recording'])delete transfers[_0x95fa('0x6')][_0x2937cd];delete channels[_0x2937cd];}}exports['newchannel']=function(_0x1ae342){try{utils['debug'](util[_0x95fa('0x9')](_0x95fa('0x16'),_0x1ae342[_0x95fa('0x7')]),_0x1ae342);if(_0x1ae342[_0x95fa('0x7')]==_0x1ae342[_0x95fa('0x17')]&&_0x1ae342[_0x95fa('0xb')]!='OutgoingSpoolFailed'){utils['info'](util[_0x95fa('0x9')](_0x95fa('0x18'),_0x1ae342[_0x95fa('0x7')],_0x1ae342[_0x95fa('0x19')],_0x1ae342[_0x95fa('0x1a')]));channels[_0x1ae342[_0x95fa('0x7')]]={'uniqueid':_0x1ae342[_0x95fa('0x7')],'accountcode':_0x1ae342[_0x95fa('0x10')],'source':_0x1ae342['calleridnum'],'destination':_0x1ae342[_0x95fa('0x1a')],'destinationcontext':_0x1ae342['context'],'channel':_0x1ae342[_0x95fa('0xb')],'starttime':utils[_0x95fa('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x95fa('0x3'),'amaflags':_0x95fa('0x1c')};}}catch(_0x4071ff){utils['error'](util['format'](_0x95fa('0x16'),_0x1ae342[_0x95fa('0x7')]),_0x4071ff);}};exports[_0x95fa('0x1d')]=function(_0x384ad6){try{utils[_0x95fa('0x1e')](util[_0x95fa('0x9')]('[%s][calls][newstate]',_0x384ad6[_0x95fa('0x7')]),_0x384ad6);if(!_['isNil'](channels[_0x384ad6[_0x95fa('0x7')]])&&_0x384ad6[_0x95fa('0x1f')]==0x6){utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x20'),_0x384ad6[_0x95fa('0x7')],_0x384ad6[_0x95fa('0x19')],_0x384ad6['channel']));if(_[_0x95fa('0x21')](channels[_0x384ad6[_0x95fa('0x7')]]['systemanswertime'])){channels[_0x384ad6[_0x95fa('0x7')]]['systemanswertime']=utils['now']();}}else if(!_['isNil'](channels[_0x384ad6[_0x95fa('0x17')]])&&_0x384ad6[_0x95fa('0x1f')]==0x6&&_0x384ad6[_0x95fa('0x19')]!='transfer'){utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x22'),_0x384ad6[_0x95fa('0x7')],_0x384ad6[_0x95fa('0x17')],_0x384ad6[_0x95fa('0x19')],_0x384ad6[_0x95fa('0xb')]));channels[_0x384ad6[_0x95fa('0x17')]][_0x95fa('0x10')]=_0x384ad6[_0x95fa('0x10')];channels[_0x384ad6['linkedid']][_0x95fa('0x23')]=_0x384ad6[_0x95fa('0xb')];if(_['isNil'](channels[_0x384ad6[_0x95fa('0x17')]][_0x95fa('0x24')])){channels[_0x384ad6[_0x95fa('0x17')]][_0x95fa('0x24')]=utils[_0x95fa('0x1b')]();}channels[_0x384ad6[_0x95fa('0x17')]]['disposition']=dispositions[_[_0x95fa('0x25')](_0x384ad6[_0x95fa('0x1f')])]||_0x95fa('0x5');}}catch(_0xa06af3){utils[_0x95fa('0x26')](util[_0x95fa('0x9')](_0x95fa('0x27'),_0x384ad6[_0x95fa('0x7')]),_0xa06af3);}};exports[_0x95fa('0x28')]=function(_0x4267cb){try{if(!_['isNil'](channels[_0x4267cb[_0x95fa('0x7')]])){utils['debug'](util[_0x95fa('0x9')]('[%s][calls][hangup]',_0x4267cb[_0x95fa('0x7')]),_0x4267cb);if(_['isNil'](channels[_0x4267cb[_0x95fa('0x7')]]['callerid'])){channels[_0x4267cb[_0x95fa('0x7')]][_0x95fa('0x29')]=_0x4267cb['calleridname']+'\x20<'+_0x4267cb['calleridnum']+'>';}utils[_0x95fa('0x8')](util['format'](_0x95fa('0x2a'),_0x4267cb[_0x95fa('0x7')],channels[_0x4267cb[_0x95fa('0x7')]][_0x95fa('0x29')],_0x4267cb['cause-txt']));channels[_0x4267cb[_0x95fa('0x7')]][_0x95fa('0x2b')]=utils[_0x95fa('0x1b')]();channels[_0x4267cb['uniqueid']][_0x95fa('0x2c')]=utils[_0x95fa('0x2d')](channels[_0x4267cb[_0x95fa('0x7')]]['endtime'],channels[_0x4267cb[_0x95fa('0x7')]][_0x95fa('0x2e')]);channels[_0x4267cb[_0x95fa('0x7')]][_0x95fa('0x2f')]=channels[_0x4267cb[_0x95fa('0x7')]]['answertime']?utils[_0x95fa('0x2d')](channels[_0x4267cb[_0x95fa('0x7')]][_0x95fa('0x2b')],channels[_0x4267cb[_0x95fa('0x7')]][_0x95fa('0x24')]):0x0;writeDB(channels[_0x4267cb[_0x95fa('0x7')]]);}}catch(_0x2afc33){utils[_0x95fa('0x26')](util[_0x95fa('0x9')]('[%s][calls][hangup]',_0x4267cb[_0x95fa('0x7')]),_0x2afc33);}};exports[_0x95fa('0x30')]=function(_0x4c90a2){try{if(!_['isNil'](channels[_0x4c90a2[_0x95fa('0x31')]])){utils[_0x95fa('0x1e')](util[_0x95fa('0x9')]('[%s][calls][attendedtransfer]',_0x4c90a2[_0x95fa('0x32')]),_0x4c90a2);if(channels[_0x4c90a2['localtwolinkedid']][_0x95fa('0xb')]==_0x4c90a2[_0x95fa('0x33')]){utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x34'),_0x4c90a2[_0x95fa('0x32')],_0x4c90a2[_0x95fa('0x31')],_0x4c90a2[_0x95fa('0x35')]));channels[_0x4c90a2[_0x95fa('0x31')]][_0x95fa('0x23')]=_0x4c90a2[_0x95fa('0x35')];channels[_0x4c90a2['localtwolinkedid']][_0x95fa('0x36')]=_0x95fa('0x37');}else if(channels[_0x4c90a2[_0x95fa('0x31')]]['channel']=_0x4c90a2[_0x95fa('0x38')]){utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x34'),_0x4c90a2[_0x95fa('0x32')],_0x4c90a2['localtwolinkedid'],_0x4c90a2['origtransfererchannel']));channels[_0x4c90a2['localtwolinkedid']][_0x95fa('0x23')]=_0x4c90a2[_0x95fa('0x39')];channels[_0x4c90a2[_0x95fa('0x31')]]['userfield']=_0x95fa('0x37');}}}catch(_0x4875cb){utils[_0x95fa('0x26')](util[_0x95fa('0x9')]('[%s][calls][attendedtransfer]',_0x4c90a2[_0x95fa('0x32')]),_0x4875cb);}};exports[_0x95fa('0x3a')]=function(_0x3c0db5){try{if(!_[_0x95fa('0x21')](channels[_0x3c0db5['uniqueid']])){utils[_0x95fa('0x1e')](util[_0x95fa('0x9')](_0x95fa('0x3b'),_0x3c0db5[_0x95fa('0x7')]),_0x3c0db5);channels[_0x3c0db5[_0x95fa('0x7')]][_0x95fa('0x3c')]=utils[_0x95fa('0x1b')]();utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x3d'),_0x3c0db5[_0x95fa('0x7')],channels[_0x3c0db5[_0x95fa('0x7')]][_0x95fa('0x3c')]));}}catch(_0x39d742){utils[_0x95fa('0x26')](util['format']('[%s][calls][musiconholdstart]',_0x3c0db5['uniqueid']),_0x39d742);}};exports[_0x95fa('0x3e')]=function(_0x11d555){try{if(!_[_0x95fa('0x21')](channels[_0x11d555[_0x95fa('0x7')]])){utils[_0x95fa('0x1e')](util['format'](_0x95fa('0x3f'),_0x11d555[_0x95fa('0x7')]),_0x11d555);if(!_[_0x95fa('0x21')](channels[_0x11d555['uniqueid']][_0x95fa('0x3c')])){channels[_0x11d555[_0x95fa('0x7')]][_0x95fa('0x40')]+=utils[_0x95fa('0x2d')](utils[_0x95fa('0x1b')](),channels[_0x11d555[_0x95fa('0x7')]]['musiconholdstartAt']);utils['info'](util[_0x95fa('0x9')](_0x95fa('0x41'),_0x11d555[_0x95fa('0x7')],channels[_0x11d555[_0x95fa('0x7')]][_0x95fa('0x40')]));delete channels[_0x11d555[_0x95fa('0x7')]][_0x95fa('0x3c')];}}}catch(_0x16527a){utils[_0x95fa('0x26')](util[_0x95fa('0x9')](_0x95fa('0x3f'),_0x11d555[_0x95fa('0x7')]),_0x16527a);}};exports[_0x95fa('0x42')]=function(_0x5ee544){try{if(!_['isNil'](channels[_0x5ee544[_0x95fa('0x7')]])){utils['debug'](util[_0x95fa('0x9')](_0x95fa('0x43'),_0x5ee544[_0x95fa('0x7')]),_0x5ee544);if(!_['isNil'](_0x5ee544[_0x95fa('0x44')][_0x95fa('0x45')])){utils[_0x95fa('0x8')](util['format'](_0x95fa('0x46'),_0x5ee544[_0x95fa('0x7')],_0x5ee544[_0x95fa('0x47')]));channels[_0x5ee544[_0x95fa('0x7')]][_0x95fa('0x48')]=_0x5ee544['value'];}if(!_[_0x95fa('0x21')](_0x5ee544['variable'][_0x95fa('0x49')])){utils[_0x95fa('0x8')](util['format'](_0x95fa('0x4a'),_0x5ee544[_0x95fa('0x7')],_0x5ee544[_0x95fa('0x47')]));channels[_0x5ee544[_0x95fa('0x7')]][_0x95fa('0x4b')]=_0x5ee544['value'];channels[_0x5ee544[_0x95fa('0x7')]][_0x95fa('0x29')]='\x22'+_0x5ee544[_0x95fa('0x47')]+_0x95fa('0x4c')+_0x5ee544[_0x95fa('0x47')]+'>';}if(!_['isNil'](_0x5ee544[_0x95fa('0x44')][_0x95fa('0x4d')])||!_[_0x95fa('0x21')](_0x5ee544['variable'][_0x95fa('0x4e')])){utils['info'](util['format'](_0x95fa('0x4f'),_0x5ee544[_0x95fa('0x7')],!_[_0x95fa('0x21')](_0x5ee544[_0x95fa('0x44')][_0x95fa('0x4d')])?_0x95fa('0x4d'):_0x95fa('0x4e'),_0x5ee544['value']));channels[_0x5ee544[_0x95fa('0x7')]][_0x95fa('0x29')]=_0x5ee544['value'];}if(!_[_0x95fa('0x21')](_0x5ee544[_0x95fa('0x44')][_0x95fa('0x50')])||!_[_0x95fa('0x21')](_0x5ee544[_0x95fa('0x44')][_0x95fa('0x51')])){utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x4f'),_0x5ee544['uniqueid'],!_['isNil'](_0x5ee544['variable']['xmd-queue'])?_0x95fa('0x50'):'xmcs-queue',_0x5ee544[_0x95fa('0x47')]));channels[_0x5ee544[_0x95fa('0x7')]]['lastapplication']='Queue';channels[_0x5ee544['uniqueid']][_0x95fa('0x52')]=_0x5ee544['value'];channels[_0x5ee544[_0x95fa('0x7')]][_0x95fa('0x53')]=!![];}if(!_[_0x95fa('0x21')](_0x5ee544['variable']['xmd-contactid'])){utils[_0x95fa('0x8')](util['format'](_0x95fa('0x54'),_0x5ee544[_0x95fa('0x7')],_0x5ee544[_0x95fa('0x47')]));channels[_0x5ee544['uniqueid']][_0x95fa('0x55')]=_0x5ee544[_0x95fa('0x47')];}if(!_[_0x95fa('0x21')](_0x5ee544[_0x95fa('0x44')][_0x95fa('0x56')])){utils['info'](util[_0x95fa('0x9')](_0x95fa('0x57'),_0x5ee544[_0x95fa('0x7')],_0x5ee544[_0x95fa('0x47')]));channels[_0x5ee544[_0x95fa('0x7')]][_0x95fa('0x58')]=_0x5ee544[_0x95fa('0x47')];}if(!_[_0x95fa('0x21')](_0x5ee544['variable'][_0x95fa('0x59')])){utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x5a'),_0x5ee544[_0x95fa('0x7')],_0x5ee544[_0x95fa('0x47')]));channels[_0x5ee544['uniqueid']][_0x95fa('0x5b')]=_0x5ee544[_0x95fa('0x47')];}if(!_[_0x95fa('0x21')](_0x5ee544[_0x95fa('0x44')][_0x95fa('0x5c')])){utils['info'](util[_0x95fa('0x9')](_0x95fa('0x5d'),_0x5ee544[_0x95fa('0x7')],_0x5ee544[_0x95fa('0x47')]));channels[_0x5ee544['uniqueid']]['sipcallid']=_0x5ee544['value'];}}}catch(_0x33e806){utils[_0x95fa('0x26')](util[_0x95fa('0x9')](_0x95fa('0x43'),_0x5ee544['uniqueid']),_0x33e806);}};exports['newexten']=function(_0x545de2){try{if(!_[_0x95fa('0x21')](channels[_0x545de2[_0x95fa('0x7')]])){utils['debug'](util['format'](_0x95fa('0x5e'),_0x545de2[_0x95fa('0x7')]),_0x545de2);utils[_0x95fa('0x8')](util[_0x95fa('0x9')](_0x95fa('0x5f'),_0x545de2[_0x95fa('0x7')],_0x545de2[_0x95fa('0x60')],_0x545de2[_0x95fa('0x61')]));if(_0x545de2['application'][_0x95fa('0x62')]()==_0x95fa('0x63')&&_['startsWith'](_0x545de2['appdata'][_0x95fa('0x62')](),_0x95fa('0x64'))){var _0x6f03b3=_0x545de2['appdata'][_0x95fa('0x65')]('=');var _0x44b0c2=_0x6f03b3[0x0][_0x95fa('0x66')](_0x6f03b3[0x0][_0x95fa('0x67')]('(')+0x1,_0x6f03b3[0x0][_0x95fa('0x67')](')'));var _0x4d65c1=_0x6f03b3[0x1];channels[_0x545de2['uniqueid']][_0x44b0c2]=_0x4d65c1;}if(!_[_0x95fa('0x68')]([_0x95fa('0x28'),_0x95fa('0x69'),_0x95fa('0x6a'),_0x95fa('0x63'),'gotoif'],_0x545de2[_0x95fa('0x60')]['toLowerCase']())){channels[_0x545de2[_0x95fa('0x7')]][_0x95fa('0x6b')]=_0x545de2[_0x95fa('0x60')];channels[_0x545de2[_0x95fa('0x7')]]['lastdata']=_0x545de2['appdata'];}}}catch(_0x323ab8){utils[_0x95fa('0x26')](util[_0x95fa('0x9')]('[%s][calls][newexten]',_0x545de2['uniqueid']),_0x323ab8);}}; \ No newline at end of file +var _0xca61=['[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','noop','set','gotoif','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','connectedlinenum','lastevent','accountcode','UserId','request','CreateVoiceCallReport','recording','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','now','disposition','toNumber','error','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','callerid','cause-txt','endtime','duration','billableseconds','diffTime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','debug','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','_attended','origtransfererchannel','destinationchannel','userfield','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid'];(function(_0x5cd7a3,_0x1aa14f){var _0x21235d=function(_0x3152a9){while(--_0x3152a9){_0x5cd7a3['push'](_0x5cd7a3['shift']());}};_0x21235d(++_0x1aa14f);}(_0xca61,0x1be));var _0x1ca6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xca61[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1ca6('0x0'));var util=require(_0x1ca6('0x1'));var utils=require('./utils');var transfers=require(_0x1ca6('0x2'));var dispositions=[_0x1ca6('0x3'),_0x1ca6('0x4'),'FAILED','NO\x20ANSWER','NO\x20ANSWER',_0x1ca6('0x3'),_0x1ca6('0x5'),'BUSY',_0x1ca6('0x4'),_0x1ca6('0x4'),'FAILED'];var channels={};function writeDB(_0xa6af2b){var _0x7c7bea;if(transfers[_0x1ca6('0x6')][_0xa6af2b[_0x1ca6('0x7')]]){_0x7c7bea=_0xa6af2b['uniqueid'];_0xa6af2b[_0x1ca6('0x7')]=transfers[_0x1ca6('0x6')][_0xa6af2b['uniqueid']][_0x1ca6('0x8')];}utils[_0x1ca6('0x9')](util[_0x1ca6('0xa')](_0x1ca6('0xb'),_0xa6af2b['uniqueid'],_0xa6af2b[_0x1ca6('0xc')],_0xa6af2b[_0x1ca6('0xd')],_0xa6af2b[_0x1ca6('0xe')],_0xa6af2b['interface'],_0xa6af2b['calleridnum'],_0xa6af2b[_0x1ca6('0xf')],_0xa6af2b[_0x1ca6('0x10')]));if(_0xa6af2b['accountcode']){utils['getUserByInternal'](_0xa6af2b[_0x1ca6('0x11')])['then'](function(_0x27c1b5){if(_0x27c1b5){_0xa6af2b[_0x1ca6('0x12')]=_0x27c1b5['id'];}utils[_0x1ca6('0x13')](_0x1ca6('0x14'),_0xa6af2b);});}else{utils[_0x1ca6('0x13')](_0x1ca6('0x14'),_0xa6af2b);}if(channels[_0xa6af2b[_0x1ca6('0x7')]]){delete channels[_0xa6af2b[_0x1ca6('0x7')]];}else if(_0x7c7bea&&channels[_0x7c7bea]){if(!transfers[_0x1ca6('0x6')][_0x7c7bea][_0x1ca6('0x15')])delete transfers[_0x1ca6('0x6')][_0x7c7bea];delete channels[_0x7c7bea];}}exports[_0x1ca6('0x16')]=function(_0x4ad4fa){try{utils['debug'](util[_0x1ca6('0xa')](_0x1ca6('0x17'),_0x4ad4fa[_0x1ca6('0x7')]),_0x4ad4fa);if(_0x4ad4fa['uniqueid']==_0x4ad4fa[_0x1ca6('0x18')]&&_0x4ad4fa[_0x1ca6('0xc')]!=_0x1ca6('0x19')){utils[_0x1ca6('0x9')](util[_0x1ca6('0xa')](_0x1ca6('0x1a'),_0x4ad4fa['uniqueid'],_0x4ad4fa[_0x1ca6('0x1b')],_0x4ad4fa[_0x1ca6('0x1c')]));channels[_0x4ad4fa[_0x1ca6('0x7')]]={'uniqueid':_0x4ad4fa['uniqueid'],'accountcode':_0x4ad4fa[_0x1ca6('0x11')],'source':_0x4ad4fa[_0x1ca6('0x1d')],'destination':_0x4ad4fa[_0x1ca6('0x1c')],'destinationcontext':_0x4ad4fa[_0x1ca6('0x1b')],'channel':_0x4ad4fa[_0x1ca6('0xc')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x1ca6('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x26f107){utils['error'](util[_0x1ca6('0xa')](_0x1ca6('0x17'),_0x4ad4fa[_0x1ca6('0x7')]),_0x26f107);}};exports['newstate']=function(_0x5686de){try{utils['debug'](util[_0x1ca6('0xa')](_0x1ca6('0x1e'),_0x5686de[_0x1ca6('0x7')]),_0x5686de);if(!_[_0x1ca6('0x1f')](channels[_0x5686de['uniqueid']])&&_0x5686de[_0x1ca6('0x20')]==0x6){utils[_0x1ca6('0x9')](util[_0x1ca6('0xa')](_0x1ca6('0x21'),_0x5686de['uniqueid'],_0x5686de[_0x1ca6('0x1b')],_0x5686de['channel']));if(_[_0x1ca6('0x1f')](channels[_0x5686de['uniqueid']][_0x1ca6('0x22')])){channels[_0x5686de[_0x1ca6('0x7')]]['systemanswertime']=utils['now']();}}else if(!_['isNil'](channels[_0x5686de[_0x1ca6('0x18')]])&&_0x5686de[_0x1ca6('0x20')]==0x6&&_0x5686de[_0x1ca6('0x1b')]!=_0x1ca6('0x23')){utils[_0x1ca6('0x9')](util[_0x1ca6('0xa')](_0x1ca6('0x24'),_0x5686de[_0x1ca6('0x7')],_0x5686de['linkedid'],_0x5686de[_0x1ca6('0x1b')],_0x5686de['channel']));channels[_0x5686de[_0x1ca6('0x18')]]['accountcode']=_0x5686de[_0x1ca6('0x11')];channels[_0x5686de['linkedid']]['destinationchannel']=_0x5686de[_0x1ca6('0xc')];if(_[_0x1ca6('0x1f')](channels[_0x5686de['linkedid']][_0x1ca6('0x25')])){channels[_0x5686de[_0x1ca6('0x18')]][_0x1ca6('0x25')]=utils[_0x1ca6('0x26')]();}channels[_0x5686de[_0x1ca6('0x18')]][_0x1ca6('0x27')]=dispositions[_[_0x1ca6('0x28')](_0x5686de[_0x1ca6('0x20')])]||_0x1ca6('0x5');}}catch(_0x516fe4){utils[_0x1ca6('0x29')](util['format'](_0x1ca6('0x1e'),_0x5686de[_0x1ca6('0x7')]),_0x516fe4);}};exports['hangup']=function(_0xef148a){try{if(!_['isNil'](channels[_0xef148a[_0x1ca6('0x7')]])){utils['debug'](util[_0x1ca6('0xa')]('[%s][calls][hangup]',_0xef148a['uniqueid']),_0xef148a);if(_[_0x1ca6('0x1f')](channels[_0xef148a[_0x1ca6('0x7')]]['callerid'])){channels[_0xef148a[_0x1ca6('0x7')]]['callerid']=_0xef148a['calleridname']+'\x20<'+_0xef148a['calleridnum']+'>';}utils['info'](util[_0x1ca6('0xa')](_0x1ca6('0x2a'),_0xef148a[_0x1ca6('0x7')],channels[_0xef148a[_0x1ca6('0x7')]][_0x1ca6('0x2b')],_0xef148a[_0x1ca6('0x2c')]));channels[_0xef148a[_0x1ca6('0x7')]][_0x1ca6('0x2d')]=utils[_0x1ca6('0x26')]();channels[_0xef148a['uniqueid']][_0x1ca6('0x2e')]=utils['diffTime'](channels[_0xef148a[_0x1ca6('0x7')]][_0x1ca6('0x2d')],channels[_0xef148a[_0x1ca6('0x7')]]['starttime']);channels[_0xef148a[_0x1ca6('0x7')]][_0x1ca6('0x2f')]=channels[_0xef148a[_0x1ca6('0x7')]][_0x1ca6('0x25')]?utils[_0x1ca6('0x30')](channels[_0xef148a[_0x1ca6('0x7')]][_0x1ca6('0x2d')],channels[_0xef148a['uniqueid']][_0x1ca6('0x25')]):0x0;writeDB(channels[_0xef148a['uniqueid']]);}}catch(_0x529cb6){utils['error'](util[_0x1ca6('0xa')](_0x1ca6('0x31'),_0xef148a[_0x1ca6('0x7')]),_0x529cb6);}};exports[_0x1ca6('0x32')]=function(_0x5a203d){try{if(!_[_0x1ca6('0x1f')](channels[_0x5a203d[_0x1ca6('0x33')]])){utils[_0x1ca6('0x34')](util[_0x1ca6('0xa')](_0x1ca6('0x35'),_0x5a203d[_0x1ca6('0x36')]),_0x5a203d);if(channels[_0x5a203d[_0x1ca6('0x33')]]['channel']==_0x5a203d[_0x1ca6('0x37')]){utils[_0x1ca6('0x9')](util[_0x1ca6('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5a203d['origtransfereruniqueid'],_0x5a203d[_0x1ca6('0x33')],_0x5a203d[_0x1ca6('0x38')]));channels[_0x5a203d[_0x1ca6('0x33')]]['destinationchannel']=_0x5a203d[_0x1ca6('0x38')];channels[_0x5a203d['localtwolinkedid']]['userfield']=_0x1ca6('0x39');}else if(channels[_0x5a203d[_0x1ca6('0x33')]]['channel']=_0x5a203d['transfertargetchannel']){utils[_0x1ca6('0x9')](util[_0x1ca6('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5a203d[_0x1ca6('0x36')],_0x5a203d[_0x1ca6('0x33')],_0x5a203d[_0x1ca6('0x3a')]));channels[_0x5a203d[_0x1ca6('0x33')]][_0x1ca6('0x3b')]=_0x5a203d[_0x1ca6('0x3a')];channels[_0x5a203d[_0x1ca6('0x33')]][_0x1ca6('0x3c')]=_0x1ca6('0x39');}}}catch(_0xa532a9){utils[_0x1ca6('0x29')](util[_0x1ca6('0xa')](_0x1ca6('0x35'),_0x5a203d[_0x1ca6('0x36')]),_0xa532a9);}};exports[_0x1ca6('0x3d')]=function(_0x4849cf){try{if(!_[_0x1ca6('0x1f')](channels[_0x4849cf[_0x1ca6('0x7')]])){utils[_0x1ca6('0x34')](util[_0x1ca6('0xa')]('[%s][calls][musiconholdstart]',_0x4849cf[_0x1ca6('0x7')]),_0x4849cf);channels[_0x4849cf['uniqueid']][_0x1ca6('0x3e')]=utils[_0x1ca6('0x26')]();utils['info'](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x4849cf['uniqueid'],channels[_0x4849cf[_0x1ca6('0x7')]]['musiconholdstartAt']));}}catch(_0x5607e7){utils[_0x1ca6('0x29')](util['format'](_0x1ca6('0x3f'),_0x4849cf[_0x1ca6('0x7')]),_0x5607e7);}};exports[_0x1ca6('0x40')]=function(_0x22c031){try{if(!_[_0x1ca6('0x1f')](channels[_0x22c031[_0x1ca6('0x7')]])){utils[_0x1ca6('0x34')](util['format'](_0x1ca6('0x41'),_0x22c031[_0x1ca6('0x7')]),_0x22c031);if(!_[_0x1ca6('0x1f')](channels[_0x22c031[_0x1ca6('0x7')]][_0x1ca6('0x3e')])){channels[_0x22c031['uniqueid']][_0x1ca6('0x42')]+=utils[_0x1ca6('0x30')](utils[_0x1ca6('0x26')](),channels[_0x22c031[_0x1ca6('0x7')]][_0x1ca6('0x3e')]);utils[_0x1ca6('0x9')](util[_0x1ca6('0xa')](_0x1ca6('0x43'),_0x22c031[_0x1ca6('0x7')],channels[_0x22c031[_0x1ca6('0x7')]][_0x1ca6('0x42')]));delete channels[_0x22c031[_0x1ca6('0x7')]]['musiconholdstartAt'];}}}catch(_0x15b450){utils[_0x1ca6('0x29')](util[_0x1ca6('0xa')]('[%s][calls][musiconholdstop]',_0x22c031['uniqueid']),_0x15b450);}};exports['varset']=function(_0xb6c150){try{if(!_[_0x1ca6('0x1f')](channels[_0xb6c150[_0x1ca6('0x7')]])){utils[_0x1ca6('0x34')](util[_0x1ca6('0xa')](_0x1ca6('0x44'),_0xb6c150[_0x1ca6('0x7')]),_0xb6c150);if(!_[_0x1ca6('0x1f')](_0xb6c150[_0x1ca6('0x45')]['xmd-originatecalleridnum'])){utils[_0x1ca6('0x9')](util[_0x1ca6('0xa')](_0x1ca6('0x46'),_0xb6c150[_0x1ca6('0x7')],_0xb6c150['value']));channels[_0xb6c150[_0x1ca6('0x7')]][_0x1ca6('0x47')]=_0xb6c150[_0x1ca6('0x48')];}if(!_[_0x1ca6('0x1f')](_0xb6c150[_0x1ca6('0x45')][_0x1ca6('0x49')])){utils[_0x1ca6('0x9')](util[_0x1ca6('0xa')](_0x1ca6('0x4a'),_0xb6c150[_0x1ca6('0x7')],_0xb6c150[_0x1ca6('0x48')]));channels[_0xb6c150[_0x1ca6('0x7')]][_0x1ca6('0x4b')]=_0xb6c150[_0x1ca6('0x48')];channels[_0xb6c150[_0x1ca6('0x7')]][_0x1ca6('0x2b')]='\x22'+_0xb6c150[_0x1ca6('0x48')]+_0x1ca6('0x4c')+_0xb6c150[_0x1ca6('0x48')]+'>';}if(!_[_0x1ca6('0x1f')](_0xb6c150[_0x1ca6('0x45')][_0x1ca6('0x4d')])||!_[_0x1ca6('0x1f')](_0xb6c150[_0x1ca6('0x45')][_0x1ca6('0x4e')])){utils['info'](util[_0x1ca6('0xa')](_0x1ca6('0x4f'),_0xb6c150['uniqueid'],!_[_0x1ca6('0x1f')](_0xb6c150[_0x1ca6('0x45')][_0x1ca6('0x4d')])?_0x1ca6('0x4d'):_0x1ca6('0x4e'),_0xb6c150[_0x1ca6('0x48')]));channels[_0xb6c150[_0x1ca6('0x7')]]['callerid']=_0xb6c150['value'];}if(!_['isNil'](_0xb6c150[_0x1ca6('0x45')][_0x1ca6('0x50')])||!_[_0x1ca6('0x1f')](_0xb6c150[_0x1ca6('0x45')][_0x1ca6('0x51')])){utils[_0x1ca6('0x9')](util[_0x1ca6('0xa')](_0x1ca6('0x4f'),_0xb6c150[_0x1ca6('0x7')],!_[_0x1ca6('0x1f')](_0xb6c150[_0x1ca6('0x45')]['xmd-queue'])?_0x1ca6('0x50'):'xmcs-queue',_0xb6c150['value']));channels[_0xb6c150[_0x1ca6('0x7')]][_0x1ca6('0x52')]=_0x1ca6('0x53');channels[_0xb6c150[_0x1ca6('0x7')]]['lastdata']=_0xb6c150[_0x1ca6('0x48')];channels[_0xb6c150['uniqueid']][_0x1ca6('0xd')]=!![];}if(!_[_0x1ca6('0x1f')](_0xb6c150[_0x1ca6('0x45')][_0x1ca6('0x54')])){utils[_0x1ca6('0x9')](util[_0x1ca6('0xa')](_0x1ca6('0x55'),_0xb6c150[_0x1ca6('0x7')],_0xb6c150['value']));channels[_0xb6c150[_0x1ca6('0x7')]]['ContactId']=_0xb6c150[_0x1ca6('0x48')];}if(!_[_0x1ca6('0x1f')](_0xb6c150['variable']['xmd-cdrtype'])){utils[_0x1ca6('0x9')](util['format'](_0x1ca6('0x56'),_0xb6c150[_0x1ca6('0x7')],_0xb6c150[_0x1ca6('0x48')]));channels[_0xb6c150[_0x1ca6('0x7')]][_0x1ca6('0x57')]=_0xb6c150[_0x1ca6('0x48')];}if(!_[_0x1ca6('0x1f')](_0xb6c150[_0x1ca6('0x45')]['outboundrouteid'])){utils[_0x1ca6('0x9')](util[_0x1ca6('0xa')](_0x1ca6('0x58'),_0xb6c150['uniqueid'],_0xb6c150['value']));channels[_0xb6c150[_0x1ca6('0x7')]][_0x1ca6('0x59')]=_0xb6c150[_0x1ca6('0x48')];}if(!_[_0x1ca6('0x1f')](_0xb6c150[_0x1ca6('0x45')][_0x1ca6('0x5a')])){utils[_0x1ca6('0x9')](util[_0x1ca6('0xa')](_0x1ca6('0x5b'),_0xb6c150['uniqueid'],_0xb6c150['value']));channels[_0xb6c150['uniqueid']][_0x1ca6('0x5a')]=_0xb6c150[_0x1ca6('0x48')];}}}catch(_0x50ad96){utils[_0x1ca6('0x29')](util[_0x1ca6('0xa')](_0x1ca6('0x44'),_0xb6c150[_0x1ca6('0x7')]),_0x50ad96);}};exports['newexten']=function(_0x8edf35){try{if(!_[_0x1ca6('0x1f')](channels[_0x8edf35[_0x1ca6('0x7')]])){utils[_0x1ca6('0x34')](util[_0x1ca6('0xa')](_0x1ca6('0x5c'),_0x8edf35[_0x1ca6('0x7')]),_0x8edf35);utils['info'](util[_0x1ca6('0xa')](_0x1ca6('0x5d'),_0x8edf35[_0x1ca6('0x7')],_0x8edf35[_0x1ca6('0x5e')],_0x8edf35[_0x1ca6('0x5f')]));if(_0x8edf35[_0x1ca6('0x5e')]['toLowerCase']()=='set'&&_[_0x1ca6('0x60')](_0x8edf35[_0x1ca6('0x5f')][_0x1ca6('0x61')](),_0x1ca6('0x62'))){var _0xd340b1=_0x8edf35[_0x1ca6('0x5f')][_0x1ca6('0x63')]('=');var _0x39c0fc=_0xd340b1[0x0][_0x1ca6('0x64')](_0xd340b1[0x0][_0x1ca6('0x65')]('(')+0x1,_0xd340b1[0x0]['lastIndexOf'](')'));var _0x305aee=_0xd340b1[0x1];channels[_0x8edf35['uniqueid']][_0x39c0fc]=_0x305aee;}if(!_['includes'](['hangup',_0x1ca6('0x66'),'execif',_0x1ca6('0x67'),_0x1ca6('0x68')],_0x8edf35['application']['toLowerCase']())){channels[_0x8edf35[_0x1ca6('0x7')]][_0x1ca6('0x52')]=_0x8edf35['application'];channels[_0x8edf35[_0x1ca6('0x7')]]['lastdata']=_0x8edf35[_0x1ca6('0x5f')];}}}catch(_0x123962){utils['error'](util[_0x1ca6('0xa')]('[%s][calls][newexten]',_0x8edf35[_0x1ca6('0x7')]),_0x123962);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index ac7e06d..ec5de16 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 _0x59b2=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','error','[core]\x20error','close','[core]\x20close','./utils','connect','info'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0x59b2,0x1e1));var _0x259b=function(_0x258fb5,_0x47c7f5){_0x258fb5=_0x258fb5-0x0;var _0x124437=_0x59b2[_0x258fb5];return _0x124437;};'use strict';var utils=require(_0x259b('0x0'));exports[_0x259b('0x1')]=function(){utils[_0x259b('0x2')](_0x259b('0x3'));};exports[_0x259b('0x4')]=function(){utils[_0x259b('0x2')](_0x259b('0x5'));};exports[_0x259b('0x6')]=function(){utils[_0x259b('0x2')]('[core]\x20fullybooted');};exports[_0x259b('0x7')]=function(_0x209400){utils['error'](_0x259b('0x8'),_0x209400);};exports[_0x259b('0x9')]=function(){utils[_0x259b('0x2')](_0x259b('0xa'));};exports['managerevent']=function(_0x467df6){}; \ No newline at end of file +var _0x001b=['managerevent','./utils','connect','[core]\x20connected','shutdown','fullybooted','info','[core]\x20fullybooted','close','[core]\x20close'];(function(_0x2525ca,_0x1edd84){var _0x54367d=function(_0x1dffcd){while(--_0x1dffcd){_0x2525ca['push'](_0x2525ca['shift']());}};_0x54367d(++_0x1edd84);}(_0x001b,0x79));var _0xb001=function(_0x15feea,_0x1f1889){_0x15feea=_0x15feea-0x0;var _0x3eb1a8=_0x001b[_0x15feea];return _0x3eb1a8;};'use strict';var utils=require(_0xb001('0x0'));exports[_0xb001('0x1')]=function(){utils['info'](_0xb001('0x2'));};exports[_0xb001('0x3')]=function(){utils['info']('[core]\x20shutdown');};exports[_0xb001('0x4')]=function(){utils[_0xb001('0x5')](_0xb001('0x6'));};exports['error']=function(_0x8f65fc){utils['error']('[core]\x20error',_0x8f65fc);};exports[_0xb001('0x7')]=function(){utils[_0xb001('0x5')](_0xb001('0x8'));};exports[_0xb001('0x9')]=function(_0x399600){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index d90743c..a7ebbdb 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 _0xf2a2=['util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','newexten','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr(routeid)','split','error','varset','debug','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','hangup','cause-txt','complete','duration','diffTime','endtime','billableseconds','[%s][dials][hangup]'];(function(_0x3054df,_0x6ba564){var _0x5c1334=function(_0x3b7e9d){while(--_0x3b7e9d){_0x3054df['push'](_0x3054df['shift']());}};_0x5c1334(++_0x6ba564);}(_0xf2a2,0x142));var _0x2f2a=function(_0x43694d,_0x2fa5ba){_0x43694d=_0x43694d-0x0;var _0x369db2=_0xf2a2[_0x43694d];return _0x369db2;};'use strict';var _=require('lodash');var util=require(_0x2f2a('0x0'));var utils=require(_0x2f2a('0x1'));var dials={};function writeDB(_0xc75691){utils['info'](util[_0x2f2a('0x2')](_0x2f2a('0x3'),_0xc75691[_0x2f2a('0x4')],_0xc75691[_0x2f2a('0x5')],_0xc75691[_0x2f2a('0x6')],_0xc75691[_0x2f2a('0x7')],_0xc75691[_0x2f2a('0x8')],_0xc75691[_0x2f2a('0x9')]));utils['request']('CreateVoiceDialReport',_0xc75691);delete dials[_0xc75691[_0x2f2a('0x4')]];}exports[_0x2f2a('0xa')]=function(_0x2e88a2){try{utils['debug'](util[_0x2f2a('0x2')](_0x2f2a('0xb'),_0x2e88a2[_0x2f2a('0x4')]),_0x2e88a2);utils[_0x2f2a('0xc')](util['format'](_0x2f2a('0xd'),_0x2e88a2[_0x2f2a('0x4')],_0x2e88a2[_0x2f2a('0xe')],_0x2e88a2['appdata']));if(_0x2e88a2[_0x2f2a('0xe')]['toLowerCase']()=='set'&&_['startsWith'](_0x2e88a2[_0x2f2a('0xf')][_0x2f2a('0x10')](),_0x2f2a('0x11'))){var _0x450389=_0x2e88a2[_0x2f2a('0xf')][_0x2f2a('0x12')]('=');dials[_0x2e88a2[_0x2f2a('0x4')]]={'routeId':_0x450389[0x1]};}}catch(_0x4e72a8){utils[_0x2f2a('0x13')](util[_0x2f2a('0x2')](_0x2f2a('0xb'),_0x2e88a2['uniqueid']),_0x4e72a8);}};exports[_0x2f2a('0x14')]=function(_0x5c8d55){try{utils[_0x2f2a('0x15')](util['format'](_0x2f2a('0x16'),_0x5c8d55[_0x2f2a('0x4')]),_0x5c8d55);if(!_[_0x2f2a('0x17')](_0x5c8d55[_0x2f2a('0x18')]['outboundrouteid'])){utils[_0x2f2a('0xc')](util[_0x2f2a('0x2')](_0x2f2a('0x19'),_0x5c8d55[_0x2f2a('0x4')],_0x5c8d55[_0x2f2a('0x1a')]));dials[_0x5c8d55[_0x2f2a('0x4')]]={'routeId':_0x5c8d55[_0x2f2a('0x1a')]};}}catch(_0x3706bd){utils[_0x2f2a('0x13')](util[_0x2f2a('0x2')](_0x2f2a('0x16'),_0x5c8d55['uniqueid']),_0x3706bd);}};exports[_0x2f2a('0x1b')]=function(_0x2a6447){try{if(!_[_0x2f2a('0x17')](dials[_0x2a6447['uniqueid']])){utils['debug'](util[_0x2f2a('0x2')](_0x2f2a('0x1c'),_0x2a6447[_0x2f2a('0x4')]),_0x2a6447);dials[_0x2a6447[_0x2f2a('0x4')]]=_[_0x2f2a('0x1d')](dials[_0x2a6447['uniqueid']],_0x2a6447);dials[_0x2a6447[_0x2f2a('0x4')]][_0x2f2a('0x1e')]=utils[_0x2f2a('0x1f')]();dials[_0x2a6447[_0x2f2a('0x4')]][_0x2f2a('0x20')]='called';utils[_0x2f2a('0xc')](util[_0x2f2a('0x2')](_0x2f2a('0x21'),_0x2a6447[_0x2f2a('0x4')],dials[_0x2a6447[_0x2f2a('0x4')]]['starttime']));}}catch(_0x399bcd){utils[_0x2f2a('0x13')](util[_0x2f2a('0x2')]('[%s][dials][dialbegin]',_0x2a6447[_0x2f2a('0x4')]),_0x399bcd);}};exports[_0x2f2a('0x22')]=function(_0x132bc7){try{if(!_[_0x2f2a('0x17')](dials[_0x132bc7[_0x2f2a('0x4')]])){utils[_0x2f2a('0x15')](util[_0x2f2a('0x2')](_0x2f2a('0x23'),_0x132bc7['uniqueid']),_0x132bc7);dials[_0x132bc7[_0x2f2a('0x4')]][_0x2f2a('0x9')]=_0x132bc7['dialstatus'];if(_0x132bc7[_0x2f2a('0x9')]==_0x2f2a('0x24')){dials[_0x132bc7[_0x2f2a('0x4')]]=_['assign'](dials[_0x132bc7[_0x2f2a('0x4')]],_0x132bc7);dials[_0x132bc7['uniqueid']][_0x2f2a('0x25')]=utils[_0x2f2a('0x1f')]();dials[_0x132bc7[_0x2f2a('0x4')]]['lastevent']='connect';utils['info'](util[_0x2f2a('0x2')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x132bc7[_0x2f2a('0x4')],_0x132bc7[_0x2f2a('0x9')],dials[_0x132bc7[_0x2f2a('0x4')]][_0x2f2a('0x25')]));}else{utils['info'](util[_0x2f2a('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0x132bc7[_0x2f2a('0x4')],_0x132bc7[_0x2f2a('0x9')]));}}}catch(_0x3d094d){utils[_0x2f2a('0x13')](util[_0x2f2a('0x2')](_0x2f2a('0x23'),_0x132bc7['uniqueid']),_0x3d094d);}};exports[_0x2f2a('0x26')]=function(_0x1c850c){try{if(!_[_0x2f2a('0x17')](dials[_0x1c850c[_0x2f2a('0x4')]])){utils[_0x2f2a('0x15')](util[_0x2f2a('0x2')]('[%s][dials][hangup]',_0x1c850c[_0x2f2a('0x4')]),_0x1c850c);utils['info'](util[_0x2f2a('0x2')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x1c850c[_0x2f2a('0x4')],_0x1c850c[_0x2f2a('0x7')],_0x1c850c['calleridname'],_0x1c850c[_0x2f2a('0x27')]));dials[_0x1c850c[_0x2f2a('0x4')]]=_[_0x2f2a('0x1d')](dials[_0x1c850c['uniqueid']],{'endtime':utils[_0x2f2a('0x1f')](),'lastevent':_0x2f2a('0x28')});dials[_0x1c850c['uniqueid']][_0x2f2a('0x29')]=utils[_0x2f2a('0x2a')](dials[_0x1c850c[_0x2f2a('0x4')]][_0x2f2a('0x2b')],dials[_0x1c850c['uniqueid']]['starttime']);dials[_0x1c850c['uniqueid']]['holdtime']=utils[_0x2f2a('0x2a')](dials[_0x1c850c['uniqueid']]['answertime']||dials[_0x1c850c[_0x2f2a('0x4')]][_0x2f2a('0x2b')],dials[_0x1c850c[_0x2f2a('0x4')]][_0x2f2a('0x1e')]);dials[_0x1c850c['uniqueid']][_0x2f2a('0x2c')]=dials[_0x1c850c['uniqueid']]['answertime']?utils[_0x2f2a('0x2a')](dials[_0x1c850c[_0x2f2a('0x4')]][_0x2f2a('0x2b')],dials[_0x1c850c[_0x2f2a('0x4')]]['answertime']):0x0;writeDB(dials[_0x1c850c[_0x2f2a('0x4')]]);}}catch(_0x315e6c){utils[_0x2f2a('0x13')](util[_0x2f2a('0x2')](_0x2f2a('0x2d'),_0x1c850c[_0x2f2a('0x4')]),_0x315e6c);}}; \ No newline at end of file +var _0xc064=['lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','format','application','appdata','set','startsWith','split','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','ANSWER','assign','lastevent','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','holdtime','billableseconds','endtime'];(function(_0x5b0c6b,_0x47fb73){var _0x1d55a6=function(_0x4ac017){while(--_0x4ac017){_0x5b0c6b['push'](_0x5b0c6b['shift']());}};_0x1d55a6(++_0x47fb73);}(_0xc064,0x1d4));var _0x4c06=function(_0x39ef76,_0x5d845b){_0x39ef76=_0x39ef76-0x0;var _0x4ce0f2=_0xc064[_0x39ef76];return _0x4ce0f2;};'use strict';var _=require(_0x4c06('0x0'));var util=require(_0x4c06('0x1'));var utils=require(_0x4c06('0x2'));var dials={};function writeDB(_0xe18780){utils[_0x4c06('0x3')](util['format'](_0x4c06('0x4'),_0xe18780[_0x4c06('0x5')],_0xe18780['channel'],_0xe18780['dialstring'],_0xe18780[_0x4c06('0x6')],_0xe18780[_0x4c06('0x7')],_0xe18780[_0x4c06('0x8')]));utils[_0x4c06('0x9')](_0x4c06('0xa'),_0xe18780);delete dials[_0xe18780[_0x4c06('0x5')]];}exports[_0x4c06('0xb')]=function(_0x4a5ea0){try{utils[_0x4c06('0xc')](util[_0x4c06('0xd')]('[%s][dials][newexten]',_0x4a5ea0[_0x4c06('0x5')]),_0x4a5ea0);utils['info'](util[_0x4c06('0xd')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x4a5ea0['uniqueid'],_0x4a5ea0[_0x4c06('0xe')],_0x4a5ea0[_0x4c06('0xf')]));if(_0x4a5ea0[_0x4c06('0xe')]['toLowerCase']()==_0x4c06('0x10')&&_[_0x4c06('0x11')](_0x4a5ea0[_0x4c06('0xf')]['toLowerCase'](),'cdr(routeid)')){var _0x1cfa2d=_0x4a5ea0[_0x4c06('0xf')][_0x4c06('0x12')]('=');dials[_0x4a5ea0[_0x4c06('0x5')]]={'routeId':_0x1cfa2d[0x1]};}}catch(_0x2b495f){utils['error'](util[_0x4c06('0xd')](_0x4c06('0x13'),_0x4a5ea0[_0x4c06('0x5')]),_0x2b495f);}};exports[_0x4c06('0x14')]=function(_0x3b1810){try{utils[_0x4c06('0xc')](util[_0x4c06('0xd')](_0x4c06('0x15'),_0x3b1810['uniqueid']),_0x3b1810);if(!_[_0x4c06('0x16')](_0x3b1810['variable'][_0x4c06('0x17')])){utils[_0x4c06('0x3')](util[_0x4c06('0xd')](_0x4c06('0x18'),_0x3b1810[_0x4c06('0x5')],_0x3b1810['value']));dials[_0x3b1810[_0x4c06('0x5')]]={'routeId':_0x3b1810[_0x4c06('0x19')]};}}catch(_0x1edcc9){utils[_0x4c06('0x1a')](util[_0x4c06('0xd')]('[%s][dials][varset]',_0x3b1810[_0x4c06('0x5')]),_0x1edcc9);}};exports[_0x4c06('0x1b')]=function(_0x3ecc76){try{if(!_[_0x4c06('0x16')](dials[_0x3ecc76[_0x4c06('0x5')]])){utils[_0x4c06('0xc')](util[_0x4c06('0xd')](_0x4c06('0x1c'),_0x3ecc76[_0x4c06('0x5')]),_0x3ecc76);dials[_0x3ecc76[_0x4c06('0x5')]]=_['assign'](dials[_0x3ecc76[_0x4c06('0x5')]],_0x3ecc76);dials[_0x3ecc76[_0x4c06('0x5')]]['starttime']=utils[_0x4c06('0x1d')]();dials[_0x3ecc76[_0x4c06('0x5')]]['lastevent']=_0x4c06('0x1e');utils[_0x4c06('0x3')](util[_0x4c06('0xd')](_0x4c06('0x1f'),_0x3ecc76['uniqueid'],dials[_0x3ecc76[_0x4c06('0x5')]][_0x4c06('0x20')]));}}catch(_0x45c597){utils[_0x4c06('0x1a')](util[_0x4c06('0xd')](_0x4c06('0x1c'),_0x3ecc76[_0x4c06('0x5')]),_0x45c597);}};exports[_0x4c06('0x21')]=function(_0xef9a50){try{if(!_[_0x4c06('0x16')](dials[_0xef9a50[_0x4c06('0x5')]])){utils[_0x4c06('0xc')](util[_0x4c06('0xd')](_0x4c06('0x22'),_0xef9a50[_0x4c06('0x5')]),_0xef9a50);dials[_0xef9a50[_0x4c06('0x5')]][_0x4c06('0x8')]=_0xef9a50['dialstatus'];if(_0xef9a50[_0x4c06('0x8')]==_0x4c06('0x23')){dials[_0xef9a50[_0x4c06('0x5')]]=_[_0x4c06('0x24')](dials[_0xef9a50['uniqueid']],_0xef9a50);dials[_0xef9a50[_0x4c06('0x5')]]['answertime']=utils['now']();dials[_0xef9a50['uniqueid']][_0x4c06('0x25')]='connect';utils[_0x4c06('0x3')](util[_0x4c06('0xd')](_0x4c06('0x26'),_0xef9a50[_0x4c06('0x5')],_0xef9a50[_0x4c06('0x8')],dials[_0xef9a50[_0x4c06('0x5')]][_0x4c06('0x27')]));}else{utils[_0x4c06('0x3')](util['format'](_0x4c06('0x28'),_0xef9a50[_0x4c06('0x5')],_0xef9a50[_0x4c06('0x8')]));}}}catch(_0x5f2fb5){utils[_0x4c06('0x1a')](util[_0x4c06('0xd')]('[%s][dials][dialend]',_0xef9a50[_0x4c06('0x5')]),_0x5f2fb5);}};exports[_0x4c06('0x29')]=function(_0x3bd4aa){try{if(!_[_0x4c06('0x16')](dials[_0x3bd4aa[_0x4c06('0x5')]])){utils['debug'](util['format'](_0x4c06('0x2a'),_0x3bd4aa['uniqueid']),_0x3bd4aa);utils['info'](util['format'](_0x4c06('0x2b'),_0x3bd4aa['uniqueid'],_0x3bd4aa['calleridnum'],_0x3bd4aa[_0x4c06('0x2c')],_0x3bd4aa[_0x4c06('0x2d')]));dials[_0x3bd4aa[_0x4c06('0x5')]]=_['assign'](dials[_0x3bd4aa['uniqueid']],{'endtime':utils[_0x4c06('0x1d')](),'lastevent':_0x4c06('0x2e')});dials[_0x3bd4aa['uniqueid']][_0x4c06('0x2f')]=utils[_0x4c06('0x30')](dials[_0x3bd4aa[_0x4c06('0x5')]]['endtime'],dials[_0x3bd4aa['uniqueid']][_0x4c06('0x20')]);dials[_0x3bd4aa[_0x4c06('0x5')]][_0x4c06('0x31')]=utils[_0x4c06('0x30')](dials[_0x3bd4aa[_0x4c06('0x5')]][_0x4c06('0x27')]||dials[_0x3bd4aa[_0x4c06('0x5')]]['endtime'],dials[_0x3bd4aa['uniqueid']][_0x4c06('0x20')]);dials[_0x3bd4aa[_0x4c06('0x5')]][_0x4c06('0x32')]=dials[_0x3bd4aa['uniqueid']]['answertime']?utils[_0x4c06('0x30')](dials[_0x3bd4aa[_0x4c06('0x5')]][_0x4c06('0x33')],dials[_0x3bd4aa[_0x4c06('0x5')]]['answertime']):0x0;writeDB(dials[_0x3bd4aa[_0x4c06('0x5')]]);}}catch(_0x2d8201){utils[_0x4c06('0x1a')](util['format']('[%s][dials][hangup]',_0x3bd4aa[_0x4c06('0x5')]),_0x2d8201);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 0ecd059..3b0c3fe 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 _0x1f37=['queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','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]','../../config/environment','util','xdr','disabled','env','production','local','port','asterisk','username','password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','devicestatechange','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]'];(function(_0x4934cc,_0x721dc4){var _0x2e453e=function(_0x4b75f3){while(--_0x4b75f3){_0x4934cc['push'](_0x4934cc['shift']());}};_0x2e453e(++_0x721dc4);}(_0x1f37,0x181));var _0x71f3=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0x1f37[_0x58965a];return _0x254efc;};var AsteriskManager=require('asterisk-manager');var config=require(_0x71f3('0x0'));var utils=require('./utils');var util=require(_0x71f3('0x1'));var isXDREnabled=config['xdr']&&config[_0x71f3('0x2')][_0x71f3('0x3')]?!config[_0x71f3('0x2')][_0x71f3('0x3')]:!![];var isProduction=config[_0x71f3('0x4')]===_0x71f3('0x5')||![];var isLocalAsterisk=config[_0x71f3('0x2')]&&config['xdr'][_0x71f3('0x6')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x71f3('0x7')],config[_0x71f3('0x8')]['ip'],config[_0x71f3('0x8')][_0x71f3('0x9')],config[_0x71f3('0x8')][_0x71f3('0xa')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x71f3('0xb')](_0x71f3('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x71f3('0xb')](_0x71f3('0xd'));}else{var agents=require('./agents.controller');var calls=require(_0x71f3('0xe'));var queues=require(_0x71f3('0xf'));var recordings=require(_0x71f3('0x10'));var members=require('./members.controller');var dials=require(_0x71f3('0x11'));var transfers=require(_0x71f3('0x12'));var core=require(_0x71f3('0x13'));ami['on'](_0x71f3('0x14'),core[_0x71f3('0x14')]);ami['on'](_0x71f3('0x15'),core['shutdown']);ami['on']('fullybooted',core[_0x71f3('0x16')]);ami['on'](_0x71f3('0x17'),core[_0x71f3('0x17')]);ami['on'](_0x71f3('0x18'),core[_0x71f3('0x18')]);ami['on'](_0x71f3('0x19'),core[_0x71f3('0x19')]);ami['on']('devicestatechange',function(_0x13f1e1){try{utils[_0x71f3('0x1a')](util[_0x71f3('0x1b')](_0x71f3('0x1c'),_0x13f1e1['device']),_0x13f1e1);members[_0x71f3('0x1d')](_0x13f1e1);}catch(_0x586baf){utils[_0x71f3('0x17')](util[_0x71f3('0x1b')](_0x71f3('0x1c'),_0x13f1e1[_0x71f3('0x1e')]),_0x586baf);}});ami['on']('agentcalled',function(_0x10b745){try{utils[_0x71f3('0x1a')](util[_0x71f3('0x1b')](_0x71f3('0x1f'),_0x10b745[_0x71f3('0x20')]),_0x10b745);agents[_0x71f3('0x21')](_0x10b745);}catch(_0x19dff1){utils[_0x71f3('0x17')](util['format'](_0x71f3('0x1f'),_0x10b745[_0x71f3('0x20')]),_0x19dff1);}});ami['on'](_0x71f3('0x22'),function(_0x5afd12){try{utils[_0x71f3('0x1a')](util['format']('[%s][index][agentringnoanswer]',_0x5afd12[_0x71f3('0x20')]),_0x5afd12);agents[_0x71f3('0x22')](_0x5afd12);}catch(_0x25fe0c){utils[_0x71f3('0x17')](util[_0x71f3('0x1b')](_0x71f3('0x23'),_0x5afd12[_0x71f3('0x20')]),_0x25fe0c);}});ami['on'](_0x71f3('0x24'),function(_0x1d047b){try{utils['debug'](util[_0x71f3('0x1b')](_0x71f3('0x25'),_0x1d047b[_0x71f3('0x20')]),_0x1d047b);agents['agentconnect'](_0x1d047b);queues[_0x71f3('0x24')](_0x1d047b);}catch(_0xdbf6fa){utils[_0x71f3('0x17')](util[_0x71f3('0x1b')]('[%s][index][agentconnect]',_0x1d047b[_0x71f3('0x20')]),_0xdbf6fa);}});ami['on'](_0x71f3('0x26'),function(_0x1692c9){try{utils['debug'](util[_0x71f3('0x1b')](_0x71f3('0x27'),_0x1692c9[_0x71f3('0x20')]),_0x1692c9);agents['agentcomplete'](_0x1692c9);queues[_0x71f3('0x26')](_0x1692c9);members[_0x71f3('0x26')](_0x1692c9);}catch(_0x3b0647){utils[_0x71f3('0x17')](util[_0x71f3('0x1b')](_0x71f3('0x27'),_0x1692c9[_0x71f3('0x20')]),_0x3b0647);}});ami['on']('queuecallerabandon',function(_0x2f7bc2){try{utils[_0x71f3('0x1a')](util['format'](_0x71f3('0x28'),_0x2f7bc2['uniqueid']),_0x2f7bc2);agents[_0x71f3('0x29')](_0x2f7bc2);queues[_0x71f3('0x29')](_0x2f7bc2);}catch(_0x32bc9d){utils['error'](util[_0x71f3('0x1b')](_0x71f3('0x28'),_0x2f7bc2[_0x71f3('0x20')]),_0x32bc9d);}});ami['on']('queuecallerjoin',function(_0x208309){try{utils[_0x71f3('0x1a')](util[_0x71f3('0x1b')](_0x71f3('0x2a'),_0x208309['uniqueid']),_0x208309);queues[_0x71f3('0x2b')](_0x208309);recordings['queuecallerjoin'](_0x208309);}catch(_0x28084d){utils[_0x71f3('0x17')](util[_0x71f3('0x1b')](_0x71f3('0x2a'),_0x208309[_0x71f3('0x20')]),_0x28084d);}});ami['on'](_0x71f3('0x2c'),function(_0x3ae39f){try{utils[_0x71f3('0x1a')](util[_0x71f3('0x1b')](_0x71f3('0x2d'),_0x3ae39f[_0x71f3('0x20')]),_0x3ae39f);queues['queuecallerleave'](_0x3ae39f);}catch(_0x40c5a5){utils[_0x71f3('0x17')](util[_0x71f3('0x1b')](_0x71f3('0x2d'),_0x3ae39f[_0x71f3('0x20')]),_0x40c5a5);}});ami['on']('musiconholdstart',function(_0x401568){try{utils[_0x71f3('0x1a')](util['format'](_0x71f3('0x2e'),_0x401568[_0x71f3('0x20')]),_0x401568);queues[_0x71f3('0x2f')](_0x401568);calls[_0x71f3('0x2f')](_0x401568);}catch(_0x46d377){utils['error'](util['format'](_0x71f3('0x2e'),_0x401568['uniqueid']),_0x46d377);}});ami['on'](_0x71f3('0x30'),function(_0x38befd){try{utils['debug'](util['format'](_0x71f3('0x31'),_0x38befd[_0x71f3('0x20')]),_0x38befd);queues[_0x71f3('0x30')](_0x38befd);calls[_0x71f3('0x30')](_0x38befd);}catch(_0x3aa231){utils['error'](util[_0x71f3('0x1b')]('[%s][index][musiconholdstop]',_0x38befd[_0x71f3('0x20')]),_0x3aa231);}});ami['on']('newstate',function(_0x23534c){try{utils[_0x71f3('0x1a')](util['format'](_0x71f3('0x32'),_0x23534c[_0x71f3('0x20')]),_0x23534c);calls[_0x71f3('0x33')](_0x23534c);recordings[_0x71f3('0x33')](_0x23534c);}catch(_0x137b58){utils[_0x71f3('0x17')](util[_0x71f3('0x1b')]('[%s][index][newstate]',_0x23534c[_0x71f3('0x20')]),_0x137b58);}});ami['on'](_0x71f3('0x34'),function(_0x3323ac){try{utils[_0x71f3('0x1a')](util[_0x71f3('0x1b')](_0x71f3('0x35'),_0x3323ac['uniqueid']),_0x3323ac);calls[_0x71f3('0x34')](_0x3323ac);recordings['hangup'](_0x3323ac);dials['hangup'](_0x3323ac);agents['hangup'](_0x3323ac);queues[_0x71f3('0x34')](_0x3323ac);}catch(_0x5e7514){utils[_0x71f3('0x17')](util['format']('[%s][index][hangup]',_0x3323ac[_0x71f3('0x20')]),_0x5e7514);}});ami['on'](_0x71f3('0x36'),function(_0x1e4eb6){try{utils['debug'](util[_0x71f3('0x1b')]('[%s][index][cdr]',_0x1e4eb6[_0x71f3('0x20')]),_0x1e4eb6);members['cdr'](_0x1e4eb6);}catch(_0x48146d){utils['error'](util['format'](_0x71f3('0x37'),_0x1e4eb6['uniqueid']),_0x48146d);}});ami['on'](_0x71f3('0x38'),function(_0x31e95b){try{utils[_0x71f3('0x1a')](util[_0x71f3('0x1b')](_0x71f3('0x39'),_0x31e95b[_0x71f3('0x20')]),_0x31e95b);queues['blindtransfer'](_0x31e95b);agents[_0x71f3('0x38')](_0x31e95b);transfers[_0x71f3('0x38')](_0x31e95b);recordings[_0x71f3('0x38')](_0x31e95b);}catch(_0x6ddadb){utils[_0x71f3('0x17')](util[_0x71f3('0x1b')](_0x71f3('0x39'),_0x31e95b[_0x71f3('0x20')]),_0x6ddadb);}});ami['on'](_0x71f3('0x3a'),function(_0x512870){try{utils['debug'](util['format'](_0x71f3('0x3b'),_0x512870['origtransfereruniqueid']),_0x512870);queues[_0x71f3('0x3a')](_0x512870);transfers['attendedtransfer'](_0x512870);agents[_0x71f3('0x3a')](_0x512870);calls['attendedtransfer'](_0x512870);}catch(_0x1d27a6){utils['error'](util[_0x71f3('0x1b')](_0x71f3('0x3b'),_0x512870['origtransfereruniqueid']),_0x1d27a6);}});ami['on'](_0x71f3('0x3c'),function(_0x39500d){try{utils[_0x71f3('0x1a')](util[_0x71f3('0x1b')]('[%s][index][varset]',_0x39500d['uniqueid']),_0x39500d);queues['varset'](_0x39500d);recordings[_0x71f3('0x3c')](_0x39500d);calls[_0x71f3('0x3c')](_0x39500d);dials[_0x71f3('0x3c')](_0x39500d);}catch(_0x127351){utils[_0x71f3('0x17')](util[_0x71f3('0x1b')](_0x71f3('0x3d'),_0x39500d[_0x71f3('0x20')]),_0x127351);}});ami['on'](_0x71f3('0x3e'),function(_0x161279){try{utils[_0x71f3('0x1a')](util[_0x71f3('0x1b')](_0x71f3('0x3f'),_0x161279[_0x71f3('0x20')]),_0x161279);calls[_0x71f3('0x3e')](_0x161279);recordings[_0x71f3('0x3e')](_0x161279);dials['newexten'](_0x161279);}catch(_0x3996a3){utils[_0x71f3('0x17')](util['format'](_0x71f3('0x3f'),_0x161279['uniqueid']),_0x3996a3);}});ami['on'](_0x71f3('0x40'),function(_0x534e3e){try{utils['debug'](util['format'](_0x71f3('0x41'),_0x534e3e[_0x71f3('0x20')]),_0x534e3e);calls[_0x71f3('0x40')](_0x534e3e);recordings['newchannel'](_0x534e3e);}catch(_0xf2239d){utils[_0x71f3('0x17')](util[_0x71f3('0x1b')](_0x71f3('0x41'),_0x534e3e[_0x71f3('0x20')]),_0xf2239d);}});ami['on'](_0x71f3('0x42'),function(_0x572cab){try{utils[_0x71f3('0x1a')](util[_0x71f3('0x1b')](_0x71f3('0x43'),_0x572cab['uniqueid']),_0x572cab);dials['dialbegin'](_0x572cab);}catch(_0x360ea3){utils[_0x71f3('0x17')](util[_0x71f3('0x1b')](_0x71f3('0x44'),_0x572cab[_0x71f3('0x20')]),_0x360ea3);}});ami['on'](_0x71f3('0x45'),function(_0x41ffd5){try{utils[_0x71f3('0x1a')](util['format']('[%s][index][dialend]',_0x41ffd5[_0x71f3('0x20')]),_0x41ffd5);dials[_0x71f3('0x45')](_0x41ffd5);}catch(_0x5b3f52){utils[_0x71f3('0x17')](util[_0x71f3('0x1b')](_0x71f3('0x46'),_0x41ffd5['uniqueid']),_0x5b3f52);}});} \ No newline at end of file +var _0xf308=['format','[%s][index][devicestatechange]','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','device'];(function(_0x4f30bd,_0x2403c0){var _0x3a2b60=function(_0x5202ff){while(--_0x5202ff){_0x4f30bd['push'](_0x4f30bd['shift']());}};_0x3a2b60(++_0x2403c0);}(_0xf308,0x1df));var _0x8f30=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf308[_0x321bb2];return _0x9c12ed;};var AsteriskManager=require(_0x8f30('0x0'));var config=require(_0x8f30('0x1'));var utils=require(_0x8f30('0x2'));var util=require('util');var isXDREnabled=config[_0x8f30('0x3')]&&config[_0x8f30('0x3')][_0x8f30('0x4')]?!config['xdr'][_0x8f30('0x4')]:!![];var isProduction=config[_0x8f30('0x5')]===_0x8f30('0x6')||![];var isLocalAsterisk=config[_0x8f30('0x3')]&&config[_0x8f30('0x3')][_0x8f30('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x8f30('0x8')][_0x8f30('0x9')],config['asterisk']['ip'],config[_0x8f30('0x8')][_0x8f30('0xa')],config['asterisk'][_0x8f30('0xb')],!![]);ami[_0x8f30('0xc')]();if(!isXDREnabled){utils[_0x8f30('0xd')](_0x8f30('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x8f30('0xd')](_0x8f30('0xf'));}else{var agents=require(_0x8f30('0x10'));var calls=require(_0x8f30('0x11'));var queues=require(_0x8f30('0x12'));var recordings=require(_0x8f30('0x13'));var members=require(_0x8f30('0x14'));var dials=require(_0x8f30('0x15'));var transfers=require(_0x8f30('0x16'));var core=require(_0x8f30('0x17'));ami['on']('connect',core[_0x8f30('0x18')]);ami['on']('shutdown',core[_0x8f30('0x19')]);ami['on'](_0x8f30('0x1a'),core[_0x8f30('0x1a')]);ami['on'](_0x8f30('0x1b'),core[_0x8f30('0x1b')]);ami['on'](_0x8f30('0x1c'),core[_0x8f30('0x1c')]);ami['on'](_0x8f30('0x1d'),core[_0x8f30('0x1d')]);ami['on']('devicestatechange',function(_0x5c7d1e){try{utils[_0x8f30('0x1e')](util['format']('[%s][index][devicestatechange]',_0x5c7d1e[_0x8f30('0x1f')]),_0x5c7d1e);members['devicestatechange'](_0x5c7d1e);}catch(_0x4a1e19){utils['error'](util[_0x8f30('0x20')](_0x8f30('0x21'),_0x5c7d1e[_0x8f30('0x1f')]),_0x4a1e19);}});ami['on']('agentcalled',function(_0xbc079b){try{utils['debug'](util[_0x8f30('0x20')](_0x8f30('0x22'),_0xbc079b[_0x8f30('0x23')]),_0xbc079b);agents[_0x8f30('0x24')](_0xbc079b);}catch(_0x13f38d){utils['error'](util[_0x8f30('0x20')](_0x8f30('0x22'),_0xbc079b[_0x8f30('0x23')]),_0x13f38d);}});ami['on'](_0x8f30('0x25'),function(_0x4c19d6){try{utils[_0x8f30('0x1e')](util[_0x8f30('0x20')]('[%s][index][agentringnoanswer]',_0x4c19d6[_0x8f30('0x23')]),_0x4c19d6);agents['agentringnoanswer'](_0x4c19d6);}catch(_0x255d28){utils[_0x8f30('0x1b')](util[_0x8f30('0x20')](_0x8f30('0x26'),_0x4c19d6[_0x8f30('0x23')]),_0x255d28);}});ami['on'](_0x8f30('0x27'),function(_0x1bbf44){try{utils[_0x8f30('0x1e')](util['format'](_0x8f30('0x28'),_0x1bbf44[_0x8f30('0x23')]),_0x1bbf44);agents['agentconnect'](_0x1bbf44);queues[_0x8f30('0x27')](_0x1bbf44);}catch(_0x37e74d){utils['error'](util[_0x8f30('0x20')](_0x8f30('0x28'),_0x1bbf44[_0x8f30('0x23')]),_0x37e74d);}});ami['on'](_0x8f30('0x29'),function(_0x5a4611){try{utils[_0x8f30('0x1e')](util[_0x8f30('0x20')]('[%s][index][agentcomplete]',_0x5a4611[_0x8f30('0x23')]),_0x5a4611);agents[_0x8f30('0x29')](_0x5a4611);queues[_0x8f30('0x29')](_0x5a4611);members[_0x8f30('0x29')](_0x5a4611);}catch(_0x37f42e){utils[_0x8f30('0x1b')](util[_0x8f30('0x20')]('[%s][index][agentcomplete]',_0x5a4611[_0x8f30('0x23')]),_0x37f42e);}});ami['on'](_0x8f30('0x2a'),function(_0x5f15ba){try{utils[_0x8f30('0x1e')](util[_0x8f30('0x20')]('[%s][index][queuecallerabandon]',_0x5f15ba[_0x8f30('0x23')]),_0x5f15ba);agents[_0x8f30('0x2a')](_0x5f15ba);queues[_0x8f30('0x2a')](_0x5f15ba);}catch(_0x421ff6){utils[_0x8f30('0x1b')](util[_0x8f30('0x20')](_0x8f30('0x2b'),_0x5f15ba['uniqueid']),_0x421ff6);}});ami['on'](_0x8f30('0x2c'),function(_0x5ac39a){try{utils[_0x8f30('0x1e')](util['format'](_0x8f30('0x2d'),_0x5ac39a['uniqueid']),_0x5ac39a);queues[_0x8f30('0x2c')](_0x5ac39a);recordings['queuecallerjoin'](_0x5ac39a);}catch(_0x339394){utils[_0x8f30('0x1b')](util[_0x8f30('0x20')](_0x8f30('0x2d'),_0x5ac39a[_0x8f30('0x23')]),_0x339394);}});ami['on'](_0x8f30('0x2e'),function(_0xfb1d68){try{utils['debug'](util['format'](_0x8f30('0x2f'),_0xfb1d68['uniqueid']),_0xfb1d68);queues[_0x8f30('0x2e')](_0xfb1d68);}catch(_0x3f98fd){utils[_0x8f30('0x1b')](util[_0x8f30('0x20')](_0x8f30('0x2f'),_0xfb1d68[_0x8f30('0x23')]),_0x3f98fd);}});ami['on']('musiconholdstart',function(_0x5834dc){try{utils[_0x8f30('0x1e')](util[_0x8f30('0x20')](_0x8f30('0x30'),_0x5834dc[_0x8f30('0x23')]),_0x5834dc);queues[_0x8f30('0x31')](_0x5834dc);calls['musiconholdstart'](_0x5834dc);}catch(_0x14a1c3){utils[_0x8f30('0x1b')](util[_0x8f30('0x20')](_0x8f30('0x30'),_0x5834dc[_0x8f30('0x23')]),_0x14a1c3);}});ami['on'](_0x8f30('0x32'),function(_0x3f352b){try{utils[_0x8f30('0x1e')](util[_0x8f30('0x20')](_0x8f30('0x33'),_0x3f352b[_0x8f30('0x23')]),_0x3f352b);queues[_0x8f30('0x32')](_0x3f352b);calls[_0x8f30('0x32')](_0x3f352b);}catch(_0x5279a2){utils[_0x8f30('0x1b')](util['format'](_0x8f30('0x33'),_0x3f352b[_0x8f30('0x23')]),_0x5279a2);}});ami['on'](_0x8f30('0x34'),function(_0x234f4c){try{utils[_0x8f30('0x1e')](util[_0x8f30('0x20')](_0x8f30('0x35'),_0x234f4c[_0x8f30('0x23')]),_0x234f4c);calls['newstate'](_0x234f4c);recordings['newstate'](_0x234f4c);}catch(_0x51748a){utils[_0x8f30('0x1b')](util[_0x8f30('0x20')](_0x8f30('0x35'),_0x234f4c['uniqueid']),_0x51748a);}});ami['on'](_0x8f30('0x36'),function(_0x2e5ce7){try{utils[_0x8f30('0x1e')](util[_0x8f30('0x20')](_0x8f30('0x37'),_0x2e5ce7[_0x8f30('0x23')]),_0x2e5ce7);calls[_0x8f30('0x36')](_0x2e5ce7);recordings[_0x8f30('0x36')](_0x2e5ce7);dials[_0x8f30('0x36')](_0x2e5ce7);agents[_0x8f30('0x36')](_0x2e5ce7);queues[_0x8f30('0x36')](_0x2e5ce7);}catch(_0x490cb3){utils['error'](util[_0x8f30('0x20')](_0x8f30('0x37'),_0x2e5ce7[_0x8f30('0x23')]),_0x490cb3);}});ami['on'](_0x8f30('0x38'),function(_0x24d145){try{utils['debug'](util[_0x8f30('0x20')](_0x8f30('0x39'),_0x24d145[_0x8f30('0x23')]),_0x24d145);members[_0x8f30('0x38')](_0x24d145);}catch(_0x52804d){utils[_0x8f30('0x1b')](util['format'](_0x8f30('0x39'),_0x24d145[_0x8f30('0x23')]),_0x52804d);}});ami['on']('blindtransfer',function(_0x330b11){try{utils[_0x8f30('0x1e')](util[_0x8f30('0x20')](_0x8f30('0x3a'),_0x330b11[_0x8f30('0x23')]),_0x330b11);queues[_0x8f30('0x3b')](_0x330b11);agents[_0x8f30('0x3b')](_0x330b11);transfers['blindtransfer'](_0x330b11);recordings[_0x8f30('0x3b')](_0x330b11);}catch(_0x13e24b){utils[_0x8f30('0x1b')](util[_0x8f30('0x20')]('[%s][index][blindtransfer]',_0x330b11['uniqueid']),_0x13e24b);}});ami['on'](_0x8f30('0x3c'),function(_0xff5390){try{utils[_0x8f30('0x1e')](util[_0x8f30('0x20')](_0x8f30('0x3d'),_0xff5390['origtransfereruniqueid']),_0xff5390);queues[_0x8f30('0x3c')](_0xff5390);transfers[_0x8f30('0x3c')](_0xff5390);agents[_0x8f30('0x3c')](_0xff5390);calls[_0x8f30('0x3c')](_0xff5390);}catch(_0x58c299){utils[_0x8f30('0x1b')](util['format'](_0x8f30('0x3d'),_0xff5390['origtransfereruniqueid']),_0x58c299);}});ami['on'](_0x8f30('0x3e'),function(_0x43c781){try{utils[_0x8f30('0x1e')](util[_0x8f30('0x20')](_0x8f30('0x3f'),_0x43c781[_0x8f30('0x23')]),_0x43c781);queues['varset'](_0x43c781);recordings[_0x8f30('0x3e')](_0x43c781);calls[_0x8f30('0x3e')](_0x43c781);dials[_0x8f30('0x3e')](_0x43c781);}catch(_0x57a413){utils['error'](util[_0x8f30('0x20')](_0x8f30('0x3f'),_0x43c781['uniqueid']),_0x57a413);}});ami['on']('newexten',function(_0x4e3b1e){try{utils['debug'](util[_0x8f30('0x20')](_0x8f30('0x40'),_0x4e3b1e['uniqueid']),_0x4e3b1e);calls[_0x8f30('0x41')](_0x4e3b1e);recordings[_0x8f30('0x41')](_0x4e3b1e);dials[_0x8f30('0x41')](_0x4e3b1e);}catch(_0x7807a0){utils[_0x8f30('0x1b')](util['format']('[%s][index][newexten]',_0x4e3b1e['uniqueid']),_0x7807a0);}});ami['on'](_0x8f30('0x42'),function(_0x365222){try{utils[_0x8f30('0x1e')](util[_0x8f30('0x20')](_0x8f30('0x43'),_0x365222['uniqueid']),_0x365222);calls[_0x8f30('0x42')](_0x365222);recordings['newchannel'](_0x365222);}catch(_0x5dd106){utils[_0x8f30('0x1b')](util[_0x8f30('0x20')](_0x8f30('0x43'),_0x365222[_0x8f30('0x23')]),_0x5dd106);}});ami['on'](_0x8f30('0x44'),function(_0x2ff851){try{utils[_0x8f30('0x1e')](util[_0x8f30('0x20')](_0x8f30('0x45'),_0x2ff851[_0x8f30('0x23')]),_0x2ff851);dials['dialbegin'](_0x2ff851);}catch(_0x20f3ae){utils[_0x8f30('0x1b')](util[_0x8f30('0x20')](_0x8f30('0x46'),_0x2ff851[_0x8f30('0x23')]),_0x20f3ae);}});ami['on'](_0x8f30('0x47'),function(_0x1a1a1b){try{utils[_0x8f30('0x1e')](util['format'](_0x8f30('0x48'),_0x1a1a1b[_0x8f30('0x23')]),_0x1a1a1b);dials[_0x8f30('0x47')](_0x1a1a1b);}catch(_0x2a744e){utils[_0x8f30('0x1b')](util[_0x8f30('0x20')](_0x8f30('0x48'),_0x1a1a1b[_0x8f30('0x23')]),_0x2a744e);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 1978a75..5b7db93 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 _0xdab2=['[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','isNil','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','then','internal','request','CreateMemberReport','getUserByName','split','error','format','[%s][members][writeDB]','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','exitAt','diffTime','[%s][members][agentcomplete]'];(function(_0xf973b7,_0x46699f){var _0x499087=function(_0x45b42f){while(--_0x45b42f){_0xf973b7['push'](_0xf973b7['shift']());}};_0x499087(++_0x46699f);}(_0xdab2,0x15c));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var utils=require(_0x2dab('0x2'));var members={};var exclude=[_0x2dab('0x3'),_0x2dab('0x4')];function writeDB(_0xf9b7cc){utils[_0x2dab('0x5')](util['format'](_0x2dab('0x6'),_0xf9b7cc[_0x2dab('0x7')],_0xf9b7cc[_0x2dab('0x8')],_0xf9b7cc[_0x2dab('0x9')],_0xf9b7cc[_0x2dab('0xa')],_0xf9b7cc[_0x2dab('0xb')],_0xf9b7cc[_0x2dab('0xc')]));if(_0xf9b7cc['interface']){utils['getUserByInterface'](_0xf9b7cc['interface'])[_0x2dab('0xd')](function(_0x5be29c){if(_0x5be29c){_0xf9b7cc['membername']=_0x5be29c['name'];_0xf9b7cc['internal']=_0x5be29c[_0x2dab('0xe')];utils[_0x2dab('0xf')](_0x2dab('0x10'),_0xf9b7cc);}else{utils[_0x2dab('0x11')](_0xf9b7cc[_0x2dab('0x8')][_0x2dab('0x12')]('/')[0x1])[_0x2dab('0xd')](function(_0x14a42e){if(_0x14a42e){_0xf9b7cc[_0x2dab('0xb')]=_0x14a42e['name'];_0xf9b7cc[_0x2dab('0xe')]=_0x14a42e['internal'];utils[_0x2dab('0xf')](_0x2dab('0x10'),_0xf9b7cc);}});}})['catch'](function(_0x59b78b){utils[_0x2dab('0x13')](util[_0x2dab('0x14')](_0x2dab('0x15'),_0xf9b7cc['uniqueid']),_0x59b78b);});}delete members[_0xf9b7cc[_0x2dab('0x8')]];}function startsWith(_0x5f5791,_0x5d7f73){return _['some'](_0x5f5791,function(_0x5ea60d){return _['startsWith'](_0x5d7f73,_0x5ea60d);});}exports[_0x2dab('0x16')]=function(_0x3c1512){try{utils[_0x2dab('0x17')](util[_0x2dab('0x14')](_0x2dab('0x18'),members[_0x3c1512['device']]?members[_0x3c1512[_0x2dab('0x19')]][_0x2dab('0x7')]:_0x3c1512['device']),_0x3c1512);utils[_0x2dab('0x5')](util[_0x2dab('0x14')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x3c1512[_0x2dab('0x19')]]?members[_0x3c1512[_0x2dab('0x19')]][_0x2dab('0x7')]:_0x3c1512[_0x2dab('0x19')],_0x3c1512[_0x2dab('0x1a')],_0x3c1512[_0x2dab('0x19')]));switch(_0x3c1512[_0x2dab('0x1a')]){case _0x2dab('0x1b'):case _0x2dab('0x1c'):if(!startsWith(exclude,_0x3c1512[_0x2dab('0x19')])){members[_0x3c1512[_0x2dab('0x19')]]={'channel':_0x2dab('0x1d'),'interface':_0x3c1512[_0x2dab('0x19')],'type':_0x2dab('0x1e'),'enterAt':utils[_0x2dab('0x1f')](),'role':'agent'};}break;case _0x2dab('0x20'):if(!_['isNil'](members[_0x3c1512[_0x2dab('0x19')]])){members[_0x3c1512[_0x2dab('0x19')]][_0x2dab('0x21')]=utils[_0x2dab('0x1f')]();members[_0x3c1512[_0x2dab('0x19')]]['duration']=utils[_0x2dab('0x22')](members[_0x3c1512[_0x2dab('0x19')]][_0x2dab('0x21')],members[_0x3c1512[_0x2dab('0x19')]]['enterAt']);if(members[_0x3c1512[_0x2dab('0x19')]][_0x2dab('0x7')]){writeDB(members[_0x3c1512['device']]);}}break;default:break;}}catch(_0x418061){utils[_0x2dab('0x13')](util[_0x2dab('0x14')]('[%s][members][devicestatechange]',members[_0x3c1512[_0x2dab('0x19')]]?members[_0x3c1512['device']][_0x2dab('0x7')]:_0x3c1512[_0x2dab('0x19')]),_0x418061);}};exports['agentcomplete']=function(_0x3401e8){try{if(!_['isNil'](members[_0x3401e8[_0x2dab('0x8')]])){utils['debug'](util['format'](_0x2dab('0x23'),_0x3401e8['uniqueid']),_0x3401e8);utils[_0x2dab('0x5')](util[_0x2dab('0x14')](_0x2dab('0x24'),_0x3401e8['uniqueid'],_0x3401e8[_0x2dab('0x8')],_0x3401e8[_0x2dab('0x25')]));members[_0x3401e8[_0x2dab('0x8')]]=_[_0x2dab('0x26')](members[_0x3401e8[_0x2dab('0x8')]],{'data4':_0x3401e8[_0x2dab('0x25')],'uniqueid':_0x3401e8[_0x2dab('0x7')]});}}catch(_0x45543a){utils[_0x2dab('0x13')](util[_0x2dab('0x14')](_0x2dab('0x23'),_0x3401e8[_0x2dab('0x7')]),_0x45543a);}};exports[_0x2dab('0x27')]=function(_0x3f063c){try{utils[_0x2dab('0x17')](util['format']('[%s][members][cdr]',_0x3f063c['uniqueid']),_0x3f063c);if(_0x3f063c[_0x2dab('0x9')]){var _0x5b4828=_0x3f063c['channel'][_0x2dab('0x12')]('-')[0x0];if(!_[_0x2dab('0x28')](members[_0x5b4828])){members[_0x5b4828]=_[_0x2dab('0x26')](members[_0x5b4828],{'data1':members[_0x5b4828]['data1']||_0x3f063c[_0x2dab('0xc')],'data2':members[_0x5b4828][_0x2dab('0xa')]||_0x3f063c[_0x2dab('0x29')],'data3':members[_0x5b4828][_0x2dab('0x2a')]||_0x3f063c[_0x2dab('0x2b')],'uniqueid':members[_0x5b4828][_0x2dab('0x7')]||_0x3f063c['uniqueid']});utils[_0x2dab('0x5')](util[_0x2dab('0x14')](_0x2dab('0x2c'),_0x3f063c[_0x2dab('0x7')],members[_0x5b4828][_0x2dab('0x2d')],members[_0x5b4828][_0x2dab('0xa')],members[_0x5b4828][_0x2dab('0x2a')]));if(members[_0x5b4828][_0x2dab('0x21')]){writeDB(members[_0x5b4828]);}}}if(_0x3f063c[_0x2dab('0x2e')]){var _0x4a393d=_0x3f063c[_0x2dab('0x2e')][_0x2dab('0x12')]('-')[0x0];if(!_[_0x2dab('0x28')](members[_0x4a393d])){members[_0x4a393d]=_[_0x2dab('0x26')](members[_0x4a393d],{'data1':members[_0x4a393d][_0x2dab('0x2d')]||_0x3f063c[_0x2dab('0xc')],'data2':members[_0x4a393d][_0x2dab('0xa')]||_0x3f063c[_0x2dab('0x29')],'data3':members[_0x4a393d]['data3']||_0x3f063c[_0x2dab('0x2b')],'uniqueid':members[_0x4a393d][_0x2dab('0x7')]||_0x3f063c[_0x2dab('0x7')]});utils[_0x2dab('0x5')](util[_0x2dab('0x14')](_0x2dab('0x2c'),_0x3f063c[_0x2dab('0x7')],members[_0x4a393d][_0x2dab('0x2d')],members[_0x4a393d][_0x2dab('0xa')],members[_0x4a393d]['data3']));if(members[_0x4a393d][_0x2dab('0x21')]){writeDB(members[_0x4a393d]);}}}}catch(_0x54fd6a){utils['error'](util[_0x2dab('0x14')](_0x2dab('0x2f'),_0x3f063c[_0x2dab('0x7')]),_0x54fd6a);}}; \ No newline at end of file +var _0xa581=['[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','interface','channel','type','getUserByInterface','then','membername','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','some','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','now','agent','exitAt','agentcomplete','isNil','debug','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','[%s][members][cdr]','data2','source','data3'];(function(_0x2cc711,_0x300328){var _0x31a52e=function(_0x588378){while(--_0x588378){_0x2cc711['push'](_0x2cc711['shift']());}};_0x31a52e(++_0x300328);}(_0xa581,0x90));var _0x1a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa581[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1a58('0x0'));var util=require(_0x1a58('0x1'));var utils=require(_0x1a58('0x2'));var members={};var exclude=[_0x1a58('0x3'),_0x1a58('0x4')];function writeDB(_0x347630){utils[_0x1a58('0x5')](util[_0x1a58('0x6')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x347630[_0x1a58('0x7')],_0x347630[_0x1a58('0x8')],_0x347630[_0x1a58('0x9')],_0x347630['data2'],_0x347630['membername'],_0x347630[_0x1a58('0xa')]));if(_0x347630[_0x1a58('0x8')]){utils[_0x1a58('0xb')](_0x347630[_0x1a58('0x8')])[_0x1a58('0xc')](function(_0x5190bd){if(_0x5190bd){_0x347630[_0x1a58('0xd')]=_0x5190bd[_0x1a58('0xe')];_0x347630[_0x1a58('0xf')]=_0x5190bd[_0x1a58('0xf')];utils[_0x1a58('0x10')](_0x1a58('0x11'),_0x347630);}else{utils[_0x1a58('0x12')](_0x347630[_0x1a58('0x8')][_0x1a58('0x13')]('/')[0x1])['then'](function(_0x562a6d){if(_0x562a6d){_0x347630[_0x1a58('0xd')]=_0x562a6d[_0x1a58('0xe')];_0x347630[_0x1a58('0xf')]=_0x562a6d[_0x1a58('0xf')];utils[_0x1a58('0x10')](_0x1a58('0x11'),_0x347630);}});}})[_0x1a58('0x14')](function(_0x34be9b){utils[_0x1a58('0x15')](util[_0x1a58('0x6')]('[%s][members][writeDB]',_0x347630[_0x1a58('0x7')]),_0x34be9b);});}delete members[_0x347630['interface']];}function startsWith(_0x39653d,_0x38a578){return _[_0x1a58('0x16')](_0x39653d,function(_0x5761eb){return _['startsWith'](_0x38a578,_0x5761eb);});}exports['devicestatechange']=function(_0x340d84){try{utils['debug'](util[_0x1a58('0x6')](_0x1a58('0x17'),members[_0x340d84[_0x1a58('0x18')]]?members[_0x340d84[_0x1a58('0x18')]][_0x1a58('0x7')]:_0x340d84[_0x1a58('0x18')]),_0x340d84);utils['info'](util[_0x1a58('0x6')](_0x1a58('0x19'),members[_0x340d84[_0x1a58('0x18')]]?members[_0x340d84[_0x1a58('0x18')]][_0x1a58('0x7')]:_0x340d84[_0x1a58('0x18')],_0x340d84[_0x1a58('0x1a')],_0x340d84[_0x1a58('0x18')]));switch(_0x340d84[_0x1a58('0x1a')]){case'INUSE':case _0x1a58('0x1b'):if(!startsWith(exclude,_0x340d84[_0x1a58('0x18')])){members[_0x340d84['device']]={'channel':_0x1a58('0x1c'),'interface':_0x340d84['device'],'type':_0x1a58('0x1d'),'enterAt':utils[_0x1a58('0x1e')](),'role':_0x1a58('0x1f')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x340d84[_0x1a58('0x18')]])){members[_0x340d84['device']][_0x1a58('0x20')]=utils[_0x1a58('0x1e')]();members[_0x340d84[_0x1a58('0x18')]]['duration']=utils['diffTime'](members[_0x340d84[_0x1a58('0x18')]][_0x1a58('0x20')],members[_0x340d84['device']]['enterAt']);if(members[_0x340d84['device']][_0x1a58('0x7')]){writeDB(members[_0x340d84[_0x1a58('0x18')]]);}}break;default:break;}}catch(_0x2a9934){utils[_0x1a58('0x15')](util['format'](_0x1a58('0x17'),members[_0x340d84[_0x1a58('0x18')]]?members[_0x340d84['device']][_0x1a58('0x7')]:_0x340d84[_0x1a58('0x18')]),_0x2a9934);}};exports[_0x1a58('0x21')]=function(_0x9dd938){try{if(!_[_0x1a58('0x22')](members[_0x9dd938['interface']])){utils[_0x1a58('0x23')](util['format']('[%s][members][agentcomplete]',_0x9dd938['uniqueid']),_0x9dd938);utils['info'](util[_0x1a58('0x6')](_0x1a58('0x24'),_0x9dd938[_0x1a58('0x7')],_0x9dd938[_0x1a58('0x8')],_0x9dd938[_0x1a58('0x25')]));members[_0x9dd938[_0x1a58('0x8')]]=_[_0x1a58('0x26')](members[_0x9dd938[_0x1a58('0x8')]],{'data4':_0x9dd938[_0x1a58('0x25')],'uniqueid':_0x9dd938['uniqueid']});}}catch(_0x48450f){utils[_0x1a58('0x15')](util['format'](_0x1a58('0x27'),_0x9dd938[_0x1a58('0x7')]),_0x48450f);}};exports['cdr']=function(_0x2aaf4d){try{utils[_0x1a58('0x23')](util[_0x1a58('0x6')](_0x1a58('0x28'),_0x2aaf4d[_0x1a58('0x7')]),_0x2aaf4d);if(_0x2aaf4d[_0x1a58('0x9')]){var _0x388bbd=_0x2aaf4d[_0x1a58('0x9')]['split']('-')[0x0];if(!_[_0x1a58('0x22')](members[_0x388bbd])){members[_0x388bbd]=_[_0x1a58('0x26')](members[_0x388bbd],{'data1':members[_0x388bbd]['data1']||_0x2aaf4d[_0x1a58('0xa')],'data2':members[_0x388bbd][_0x1a58('0x29')]||_0x2aaf4d[_0x1a58('0x2a')],'data3':members[_0x388bbd][_0x1a58('0x2b')]||_0x2aaf4d['destination'],'uniqueid':members[_0x388bbd][_0x1a58('0x7')]||_0x2aaf4d[_0x1a58('0x7')]});utils['info'](util[_0x1a58('0x6')](_0x1a58('0x2c'),_0x2aaf4d['uniqueid'],members[_0x388bbd]['data1'],members[_0x388bbd]['data2'],members[_0x388bbd][_0x1a58('0x2b')]));if(members[_0x388bbd]['exitAt']){writeDB(members[_0x388bbd]);}}}if(_0x2aaf4d[_0x1a58('0x2d')]){var _0x4fdb01=_0x2aaf4d[_0x1a58('0x2d')][_0x1a58('0x13')]('-')[0x0];if(!_['isNil'](members[_0x4fdb01])){members[_0x4fdb01]=_[_0x1a58('0x26')](members[_0x4fdb01],{'data1':members[_0x4fdb01]['data1']||_0x2aaf4d[_0x1a58('0xa')],'data2':members[_0x4fdb01][_0x1a58('0x29')]||_0x2aaf4d[_0x1a58('0x2a')],'data3':members[_0x4fdb01][_0x1a58('0x2b')]||_0x2aaf4d[_0x1a58('0x2e')],'uniqueid':members[_0x4fdb01][_0x1a58('0x7')]||_0x2aaf4d[_0x1a58('0x7')]});utils[_0x1a58('0x5')](util[_0x1a58('0x6')](_0x1a58('0x2c'),_0x2aaf4d['uniqueid'],members[_0x4fdb01]['data1'],members[_0x4fdb01]['data2'],members[_0x4fdb01][_0x1a58('0x2b')]));if(members[_0x4fdb01]['exitAt']){writeDB(members[_0x4fdb01]);}}}}catch(_0x28dab1){utils['error'](util[_0x1a58('0x6')]('[%s][members][cdr]',_0x2aaf4d[_0x1a58('0x7')]),_0x28dab1);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 929e8c2..89b169d 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 _0xe669=['variable','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','count','connectedlinename','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','accountcode','[%s][queues][agentcomplete]','membername','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','extension','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','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','calleridname','queuecallerjoinAt','holdtime','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','transfertargetuniqueid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','lastAssignedTo','calleridnum','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','uniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','error'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0xe669,0x1df));var _0x9e66=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0xe669[_0x320b8e];return _0x55a10a;};'use strict';var _=require(_0x9e66('0x0'));var util=require('util');var utils=require(_0x9e66('0x1'));var queues={};function writeDB(_0x42cda4){utils[_0x9e66('0x2')](util[_0x9e66('0x3')](_0x9e66('0x4'),_0x42cda4['uniqueid'],_0x42cda4['channel'],_0x42cda4['queue'],_0x42cda4[_0x9e66('0x5')],_0x42cda4[_0x9e66('0x6')],_0x42cda4['accountcode'],_0x42cda4[_0x9e66('0x7')]));if(_0x42cda4[_0x9e66('0x8')]){utils[_0x9e66('0x9')](_0x42cda4[_0x9e66('0x8')])[_0x9e66('0xa')](function(_0x2d4ac0){if(_0x2d4ac0){_0x42cda4[_0x9e66('0xb')]=_0x2d4ac0['type'];}utils[_0x9e66('0xc')]('CreateVoiceQueueReport',_0x42cda4);});}else{utils[_0x9e66('0xc')](_0x9e66('0xd'),_0x42cda4);}if(_0x42cda4[_0x9e66('0xe')]){delete queues[_0x42cda4[_0x9e66('0xe')]];}else{delete queues[_0x42cda4['uniqueid']];}}exports[_0x9e66('0xf')]=function(_0x2841c3){try{utils[_0x9e66('0x10')](util['format']('[%s][queues][queuecallerjoin]',_0x2841c3[_0x9e66('0x11')]),_0x2841c3);utils[_0x9e66('0x2')](util[_0x9e66('0x3')](_0x9e66('0x12'),_0x2841c3[_0x9e66('0x11')],_0x2841c3['queue'],_0x2841c3[_0x9e66('0x13')]));queues[_0x2841c3[_0x9e66('0x11')]]=_[_0x9e66('0x14')](_0x2841c3,{'originalposition':_0x2841c3[_0x9e66('0x13')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x5d7202){utils['error'](util[_0x9e66('0x3')](_0x9e66('0x15'),_0x2841c3[_0x9e66('0x11')]),_0x5d7202);}};exports[_0x9e66('0x16')]=function(_0x139078){try{if(!_[_0x9e66('0x17')](queues[_0x139078[_0x9e66('0x11')]])){utils[_0x9e66('0x10')](util[_0x9e66('0x3')](_0x9e66('0x18'),_0x139078['uniqueid']),_0x139078);if(queues[_0x139078[_0x9e66('0x11')]][_0x9e66('0x19')]){if(!queues[_0x139078[_0x9e66('0x11')]][_0x9e66('0x1a')]&&!queues[_0x139078[_0x9e66('0x11')]][_0x9e66('0x1b')]){queues[_0x139078[_0x9e66('0x11')]][_0x9e66('0x1c')]=!![];queues[_0x139078['uniqueid']][_0x9e66('0x1d')]=utils[_0x9e66('0x1e')]();queues[_0x139078[_0x9e66('0x11')]][_0x9e66('0x7')]=_0x9e66('0x1f');}utils[_0x9e66('0x2')](util[_0x9e66('0x3')](_0x9e66('0x20'),_0x139078['uniqueid'],queues[_0x139078[_0x9e66('0x11')]][_0x9e66('0x21')],queues[_0x139078[_0x9e66('0x11')]][_0x9e66('0x7')]));writeDB(queues[_0x139078[_0x9e66('0x11')]]);}else if(queues[_0x139078[_0x9e66('0x11')]][_0x9e66('0xe')]){utils[_0x9e66('0x2')](util[_0x9e66('0x3')](_0x9e66('0x22'),_0x139078[_0x9e66('0x11')],queues[_0x139078['uniqueid']][_0x9e66('0x21')],queues[_0x139078[_0x9e66('0x11')]][_0x9e66('0xe')]));queues[queues[_0x139078[_0x9e66('0x11')]][_0x9e66('0xe')]]=queues[_0x139078[_0x9e66('0x11')]];queues[queues[_0x139078[_0x9e66('0x11')]][_0x9e66('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x139078[_0x9e66('0x11')]];}}}catch(_0x51e997){utils[_0x9e66('0x23')](util[_0x9e66('0x3')](_0x9e66('0x18'),_0x139078['uniqueid']),_0x51e997);}};exports['varset']=function(_0x2fdb2){try{utils['debug'](util['format']('[%s][queues][varset]',_0x2fdb2[_0x9e66('0x11')]),_0x2fdb2);if(!_[_0x9e66('0x17')](_0x2fdb2[_0x9e66('0x24')][_0x9e66('0x25')])&&_0x2fdb2[_0x9e66('0x26')]['toUpperCase']()!==_0x9e66('0x27')){if(!_[_0x9e66('0x17')](queues[_0x2fdb2[_0x9e66('0x11')]])){queues[_0x2fdb2[_0x9e66('0x11')]][_0x9e66('0x1a')]=![];queues[_0x2fdb2['uniqueid']][_0x9e66('0x28')]=null;queues[_0x2fdb2[_0x9e66('0x11')]][_0x9e66('0x1b')]=!![];queues[_0x2fdb2[_0x9e66('0x11')]][_0x9e66('0x29')]=utils[_0x9e66('0x1e')]();queues[_0x2fdb2[_0x9e66('0x11')]][_0x9e66('0x7')]=_0x2fdb2['value'][_0x9e66('0x2a')]();utils[_0x9e66('0x2')](util[_0x9e66('0x3')](_0x9e66('0x2b'),_0x2fdb2['uniqueid'],queues[_0x2fdb2[_0x9e66('0x11')]][_0x9e66('0x21')],_0x2fdb2[_0x9e66('0x26')],queues[_0x2fdb2[_0x9e66('0x11')]][_0x9e66('0x7')]));writeDB(queues[_0x2fdb2[_0x9e66('0x11')]]);}}else if(!_[_0x9e66('0x17')](_0x2fdb2['variable'][_0x9e66('0x2c')])){if(!_[_0x9e66('0x17')](queues[_0x2fdb2[_0x9e66('0x11')]])&&!queues[_0x2fdb2[_0x9e66('0x11')]][_0x9e66('0x1a')]){queues[_0x2fdb2[_0x9e66('0x11')]][_0x9e66('0x1a')]=![];queues[_0x2fdb2[_0x9e66('0x11')]]['queuecallerabandonAt']=null;queues[_0x2fdb2[_0x9e66('0x11')]][_0x9e66('0x1b')]=!![];queues[_0x2fdb2[_0x9e66('0x11')]][_0x9e66('0x29')]=utils[_0x9e66('0x1e')]();queues[_0x2fdb2[_0x9e66('0x11')]][_0x9e66('0x7')]=_0x9e66('0x2d');utils['info'](util[_0x9e66('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x2fdb2[_0x9e66('0x11')],queues[_0x2fdb2[_0x9e66('0x11')]]['name'],_0x2fdb2[_0x9e66('0x26')],queues[_0x2fdb2[_0x9e66('0x11')]][_0x9e66('0x7')]));}}}catch(_0x4a57e7){utils[_0x9e66('0x23')](util['format']('[%s][queues][varset]',_0x2fdb2['uniqueid']),_0x4a57e7);}};exports[_0x9e66('0x1a')]=function(_0xbb12d9){try{if(!_[_0x9e66('0x17')](queues[_0xbb12d9[_0x9e66('0x11')]])){utils[_0x9e66('0x10')](util[_0x9e66('0x3')](_0x9e66('0x2e'),_0xbb12d9[_0x9e66('0x11')]),_0xbb12d9);queues[_0xbb12d9[_0x9e66('0x11')]][_0x9e66('0x1b')]=![];queues[_0xbb12d9['uniqueid']]['queuecallerexitAt']=null;queues[_0xbb12d9[_0x9e66('0x11')]][_0x9e66('0x1a')]=!![];queues[_0xbb12d9[_0x9e66('0x11')]][_0x9e66('0x28')]=utils[_0x9e66('0x1e')]();queues[_0xbb12d9[_0x9e66('0x11')]][_0x9e66('0x7')]=_0x9e66('0x2f');utils[_0x9e66('0x2')](util['format'](_0x9e66('0x30'),_0xbb12d9[_0x9e66('0x11')],queues[_0xbb12d9[_0x9e66('0x11')]]['name'],queues[_0xbb12d9[_0x9e66('0x11')]]['queuecallerexitreason']));}}catch(_0x1f051c){utils[_0x9e66('0x23')](util[_0x9e66('0x3')](_0x9e66('0x2e'),_0xbb12d9[_0x9e66('0x11')]),_0x1f051c);}};exports[_0x9e66('0x31')]=function(_0x3df685){try{if(!_['isNil'](queues[_0x3df685['uniqueid']])){utils[_0x9e66('0x10')](util[_0x9e66('0x3')](_0x9e66('0x32'),_0x3df685['uniqueid']),_0x3df685);utils[_0x9e66('0x2')](util[_0x9e66('0x3')](_0x9e66('0x33'),_0x3df685['uniqueid'],queues[_0x3df685[_0x9e66('0x11')]][_0x9e66('0x21')],_0x3df685[_0x9e66('0x34')],_0x3df685['connectedlinename']));queues[_0x3df685['uniqueid']][_0x9e66('0x31')]=!![];queues[_0x3df685['uniqueid']]['queuecallerleaveAt']=utils[_0x9e66('0x1e')]();queues[_0x3df685[_0x9e66('0x11')]]['holdtime']=utils['diffTime'](queues[_0x3df685[_0x9e66('0x11')]][_0x9e66('0x19')],queues[_0x3df685[_0x9e66('0x11')]]['queuecallerjoinAt']);queues[_0x3df685[_0x9e66('0x11')]]['position']=_0x3df685[_0x9e66('0x13')];queues[_0x3df685[_0x9e66('0x11')]]['count']=_0x3df685[_0x9e66('0x35')];queues[_0x3df685['uniqueid']][_0x9e66('0x34')]=_0x3df685[_0x9e66('0x34')];queues[_0x3df685[_0x9e66('0x11')]][_0x9e66('0x36')]=_0x3df685[_0x9e66('0x36')];}}catch(_0x586fa5){utils[_0x9e66('0x23')](util[_0x9e66('0x3')]('[%s][queues][queuecallerleave]',_0x3df685[_0x9e66('0x11')]),_0x586fa5);}};exports['agentconnect']=function(_0x43cacf){try{if(!_[_0x9e66('0x17')](queues[_0x43cacf[_0x9e66('0x11')]])){utils[_0x9e66('0x10')](util[_0x9e66('0x3')](_0x9e66('0x37'),_0x43cacf[_0x9e66('0x11')]),_0x43cacf);utils[_0x9e66('0x2')](util[_0x9e66('0x3')](_0x9e66('0x38'),_0x43cacf['uniqueid'],queues[_0x43cacf[_0x9e66('0x11')]][_0x9e66('0x21')],_0x43cacf['membername'],_0x43cacf[_0x9e66('0x39')]));queues[_0x43cacf[_0x9e66('0x11')]][_0x9e66('0x1a')]=![];queues[_0x43cacf[_0x9e66('0x11')]]['queuecallerabandon']=![];queues[_0x43cacf['uniqueid']][_0x9e66('0x28')]=null;queues[_0x43cacf[_0x9e66('0x11')]][_0x9e66('0x1b')]=![];queues[_0x43cacf[_0x9e66('0x11')]]['queuecallerexitreason']=null;queues[_0x43cacf[_0x9e66('0x11')]][_0x9e66('0x29')]=null;queues[_0x43cacf['uniqueid']][_0x9e66('0x3a')]=!![];queues[_0x43cacf[_0x9e66('0x11')]][_0x9e66('0x3b')]=_0x43cacf['destaccountcode'];queues[_0x43cacf['uniqueid']]['lastAssignedTo']=_0x43cacf['membername'];}}catch(_0x45cdda){utils['error'](util['format'](_0x9e66('0x37'),_0x43cacf[_0x9e66('0x11')]),_0x45cdda);}};exports['agentcomplete']=function(_0x5110ef){try{if(!_[_0x9e66('0x17')](queues[_0x5110ef[_0x9e66('0x11')]])){if(queues[_0x5110ef[_0x9e66('0x11')]][_0x9e66('0x19')]){utils[_0x9e66('0x10')](util['format'](_0x9e66('0x3c'),_0x5110ef['uniqueid']),_0x5110ef);queues[_0x5110ef[_0x9e66('0x11')]][_0x9e66('0x1a')]=![];queues[_0x5110ef['uniqueid']]['queuecallerabandon']=![];queues[_0x5110ef[_0x9e66('0x11')]]['queuecallerabandonAt']=null;queues[_0x5110ef[_0x9e66('0x11')]][_0x9e66('0x1b')]=![];queues[_0x5110ef['uniqueid']][_0x9e66('0x29')]=null;queues[_0x5110ef[_0x9e66('0x11')]]['assigned']=!![];queues[_0x5110ef[_0x9e66('0x11')]][_0x9e66('0x5')]=_0x5110ef[_0x9e66('0x3d')];queues[_0x5110ef['uniqueid']]['queuecallercomplete']=!![];queues[_0x5110ef[_0x9e66('0x11')]][_0x9e66('0x1d')]=utils[_0x9e66('0x1e')]();if(_0x5110ef[_0x9e66('0x3e')]==_0x9e66('0x3f')){if(!queues[_0x5110ef['uniqueid']][_0x9e66('0x3f')]){queues[_0x5110ef[_0x9e66('0x11')]][_0x9e66('0x7')]=_0x9e66('0x40');}}else{queues[_0x5110ef[_0x9e66('0x11')]][_0x9e66('0x7')]='COMPLETEDBY'+_0x5110ef[_0x9e66('0x3e')][_0x9e66('0x2a')]();}utils[_0x9e66('0x2')](util[_0x9e66('0x3')](_0x9e66('0x41'),_0x5110ef[_0x9e66('0x11')],queues[_0x5110ef['uniqueid']][_0x9e66('0x21')],_0x5110ef['membername'],queues[_0x5110ef[_0x9e66('0x11')]][_0x9e66('0x7')]));writeDB(queues[_0x5110ef[_0x9e66('0x11')]]);}}}catch(_0x5ebf56){utils[_0x9e66('0x23')](util[_0x9e66('0x3')](_0x9e66('0x3c'),_0x5110ef[_0x9e66('0x11')]),_0x5ebf56);}};exports['blindtransfer']=function(_0x5a1e10){try{if(!_[_0x9e66('0x17')](queues[_0x5a1e10[_0x9e66('0x42')]])){utils[_0x9e66('0x10')](util[_0x9e66('0x3')](_0x9e66('0x43'),_0x5a1e10[_0x9e66('0x11')]),_0x5a1e10);queues[_0x5a1e10['transfereeuniqueid']]['transfer']=!![];queues[_0x5a1e10[_0x9e66('0x42')]][_0x9e66('0x44')]=_0x9e66('0x45');queues[_0x5a1e10[_0x9e66('0x42')]]['transferexten']=_0x5a1e10[_0x9e66('0x46')];queues[_0x5a1e10['transfereeuniqueid']][_0x9e66('0x47')]=_0x5a1e10[_0x9e66('0x42')];queues[_0x5a1e10[_0x9e66('0x42')]][_0x9e66('0x7')]=_0x9e66('0x48');utils['info'](util[_0x9e66('0x3')](_0x9e66('0x49'),_0x5a1e10['uniqueid'],queues[_0x5a1e10['transfereeuniqueid']][_0x9e66('0x21')],_0x5a1e10[_0x9e66('0x42')],_0x5a1e10[_0x9e66('0x46')]));}}catch(_0x30fca6){utils[_0x9e66('0x23')](util[_0x9e66('0x3')](_0x9e66('0x43'),_0x5a1e10[_0x9e66('0x11')]),_0x30fca6);}};exports[_0x9e66('0x4a')]=function(_0x59e4bb){try{utils[_0x9e66('0x10')](util['format'](_0x9e66('0x4b'),_0x59e4bb[_0x9e66('0x4c')]),_0x59e4bb);if(_0x59e4bb['origtransfereruniqueid']==_0x59e4bb[_0x9e66('0x4d')]){if(!_[_0x9e66('0x17')](queues[_0x59e4bb[_0x9e66('0x4e')]])){utils[_0x9e66('0x2')](util[_0x9e66('0x3')](_0x9e66('0x4f'),_0x59e4bb['origtransfereruniqueid'],queues[_0x59e4bb[_0x9e66('0x4e')]][_0x9e66('0x21')],_0x59e4bb[_0x9e66('0x50')]));queues[_0x59e4bb[_0x9e66('0x4e')]][_0x9e66('0x3f')]=!![];queues[_0x59e4bb[_0x9e66('0x4e')]][_0x9e66('0x44')]=_0x9e66('0x51');queues[_0x59e4bb[_0x9e66('0x4e')]]['transferexten']=_0x59e4bb['origtransfererexten'];queues[_0x59e4bb[_0x9e66('0x4e')]][_0x9e66('0x47')]=_0x59e4bb['origtransfereruniqueid'];queues[_0x59e4bb[_0x9e66('0x4e')]][_0x9e66('0x7')]=_0x9e66('0x52');}if(!_[_0x9e66('0x17')](queues[_0x59e4bb['origtransfererlinkedid']])){if(_0x59e4bb['transfereelinkedid']&&queues[_0x59e4bb['transfereelinkedid']]){queues[_0x59e4bb[_0x9e66('0x53')]]['queuecallerenterreason']=0x1;queues[_0x59e4bb[_0x9e66('0x42')]]=_['clone'](queues[_0x59e4bb[_0x9e66('0x53')]]);queues[_0x59e4bb[_0x9e66('0x42')]]['transfereduniqueid']=_0x59e4bb['transfertargetuniqueid'];queues[_0x59e4bb[_0x9e66('0x42')]][_0x9e66('0x54')]=0x2;queues[_0x59e4bb['transfereeuniqueid']]['calleridnum']=queues[_0x59e4bb[_0x9e66('0x4e')]][_0x9e66('0x6')];queues[_0x59e4bb[_0x9e66('0x42')]]['calleridname']=queues[_0x59e4bb[_0x9e66('0x4e')]][_0x9e66('0x55')];queues[_0x59e4bb['transfereeuniqueid']][_0x9e66('0x56')]=utils[_0x9e66('0x1e')]();queues[_0x59e4bb[_0x9e66('0x42')]][_0x9e66('0x19')]=utils[_0x9e66('0x1e')]();queues[_0x59e4bb[_0x9e66('0x42')]][_0x9e66('0x57')]=0x0;queues[_0x59e4bb[_0x9e66('0x42')]]['mohtime']=0x0;utils[_0x9e66('0x2')](util[_0x9e66('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x59e4bb['origtransfereruniqueid'],queues[_0x59e4bb[_0x9e66('0x42')]][_0x9e66('0x21')],queues[_0x59e4bb[_0x9e66('0x42')]][_0x9e66('0x6')],queues[_0x59e4bb[_0x9e66('0x42')]][_0x9e66('0x55')]));}else{utils[_0x9e66('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x59e4bb['origtransfereruniqueid'],queues[_0x59e4bb['origtransfererlinkedid']][_0x9e66('0x21')],_0x59e4bb[_0x9e66('0x4e')]));queues[_0x59e4bb[_0x9e66('0x4d')]][_0x9e66('0xe')]=_0x59e4bb['secondtransfererlinkedid'];}}}else if(_0x59e4bb[_0x9e66('0x58')]==_0x59e4bb[_0x9e66('0x4e')]){if(!_[_0x9e66('0x17')](queues[_0x59e4bb[_0x9e66('0x4d')]])){utils['info'](util[_0x9e66('0x3')](_0x9e66('0x59'),_0x59e4bb[_0x9e66('0x4c')],queues[_0x59e4bb[_0x9e66('0x4d')]][_0x9e66('0x21')],_0x59e4bb[_0x9e66('0x58')],_0x59e4bb[_0x9e66('0x5a')]));queues[_0x59e4bb[_0x9e66('0x4d')]][_0x9e66('0x3f')]=!![];queues[_0x59e4bb[_0x9e66('0x4d')]][_0x9e66('0x44')]='ATTENDED';queues[_0x59e4bb[_0x9e66('0x4d')]]['transferexten']=_0x59e4bb[_0x9e66('0x5a')];queues[_0x59e4bb['origtransfererlinkedid']]['transferuniqueid']=_0x59e4bb[_0x9e66('0x58')];queues[_0x59e4bb[_0x9e66('0x4d')]][_0x9e66('0x7')]=_0x9e66('0x52');}if(!_[_0x9e66('0x17')](queues[_0x59e4bb['secondtransfererlinkedid']])){if(_0x59e4bb['transfertargetlinkedid']&&queues[_0x59e4bb[_0x9e66('0x5b')]]){queues[_0x59e4bb[_0x9e66('0x5b')]][_0x9e66('0x54')]=0x1;queues[_0x59e4bb['transfertargetuniqueid']]=_[_0x9e66('0x5c')](queues[_0x59e4bb['transfertargetlinkedid']]);queues[_0x59e4bb[_0x9e66('0x5d')]]['transfereduniqueid']=_0x59e4bb[_0x9e66('0x5d')];queues[_0x59e4bb['transfertargetuniqueid']][_0x9e66('0x54')]=0x2;queues[_0x59e4bb[_0x9e66('0x5d')]][_0x9e66('0x6')]=queues[_0x59e4bb[_0x9e66('0x4d')]][_0x9e66('0x6')];queues[_0x59e4bb[_0x9e66('0x5d')]]['calleridname']=queues[_0x59e4bb[_0x9e66('0x4d')]][_0x9e66('0x55')];queues[_0x59e4bb[_0x9e66('0x5d')]][_0x9e66('0x56')]=utils[_0x9e66('0x1e')]();queues[_0x59e4bb[_0x9e66('0x5d')]]['queuecallerleaveAt']=utils[_0x9e66('0x1e')]();queues[_0x59e4bb[_0x9e66('0x5d')]]['holdtime']=0x0;queues[_0x59e4bb[_0x9e66('0x5d')]][_0x9e66('0x5e')]=0x0;utils[_0x9e66('0x2')](util['format'](_0x9e66('0x5f'),_0x59e4bb[_0x9e66('0x4c')],queues[_0x59e4bb[_0x9e66('0x5d')]][_0x9e66('0x21')],queues[_0x59e4bb[_0x9e66('0x5d')]][_0x9e66('0xe')],queues[_0x59e4bb[_0x9e66('0x5d')]][_0x9e66('0x6')],queues[_0x59e4bb[_0x9e66('0x5d')]]['calleridname']));}else{utils[_0x9e66('0x2')](util[_0x9e66('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x59e4bb['origtransfereruniqueid'],queues[_0x59e4bb[_0x9e66('0x4e')]][_0x9e66('0x21')],_0x59e4bb[_0x9e66('0x4d')]));queues[_0x59e4bb[_0x9e66('0x4e')]][_0x9e66('0xe')]=_0x59e4bb[_0x9e66('0x4d')];}}}}catch(_0x5a9123){utils[_0x9e66('0x23')](util[_0x9e66('0x3')](_0x9e66('0x4b'),_0x59e4bb[_0x9e66('0x4c')]),_0x5a9123);}};exports[_0x9e66('0x60')]=function(_0x212577){try{if(!_['isNil'](queues[_0x212577[_0x9e66('0x11')]])){utils['debug'](util[_0x9e66('0x3')](_0x9e66('0x61'),_0x212577[_0x9e66('0x11')]),_0x212577);queues[_0x212577[_0x9e66('0x11')]][_0x9e66('0x62')]=utils[_0x9e66('0x1e')]();utils['info'](util[_0x9e66('0x3')](_0x9e66('0x63'),_0x212577[_0x9e66('0x11')],queues[_0x212577[_0x9e66('0x11')]][_0x9e66('0x21')],queues[_0x212577['uniqueid']]['musiconholdstartAt']));}}catch(_0x37894b){utils['error'](util[_0x9e66('0x3')](_0x9e66('0x61'),_0x212577[_0x9e66('0x11')]),_0x37894b);}};exports[_0x9e66('0x64')]=function(_0x994829){try{if(!_[_0x9e66('0x17')](queues[_0x994829['uniqueid']])){if(!_[_0x9e66('0x17')](queues[_0x994829[_0x9e66('0x11')]]['musiconholdstartAt'])){utils['debug'](util[_0x9e66('0x3')](_0x9e66('0x65'),_0x994829[_0x9e66('0x11')]),_0x994829);queues[_0x994829[_0x9e66('0x11')]][_0x9e66('0x5e')]+=utils['diffTime'](utils['now'](),queues[_0x994829['uniqueid']]['musiconholdstartAt']);utils[_0x9e66('0x2')](util[_0x9e66('0x3')](_0x9e66('0x66'),_0x994829[_0x9e66('0x11')],queues[_0x994829[_0x9e66('0x11')]][_0x9e66('0x21')],queues[_0x994829[_0x9e66('0x11')]]['mohtime']));delete queues[_0x994829[_0x9e66('0x11')]][_0x9e66('0x62')];}}}catch(_0x23de9c){utils[_0x9e66('0x23')](util['format'](_0x9e66('0x65'),_0x994829['uniqueid']),_0x23de9c);}}; \ No newline at end of file +var _0xbf96=['EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','holdtime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','membername','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferexten','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertype','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','calleridnum','accountcode','getVoiceQueueByName','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','name','queuecallerexitreason','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexit','queuecallerexitAt'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xbf96,0x1cc));var _0x6bf9=function(_0x4e8940,_0x46ec30){_0x4e8940=_0x4e8940-0x0;var _0x30bc99=_0xbf96[_0x4e8940];return _0x30bc99;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x6bf9('0x0'));var queues={};function writeDB(_0x4f9173){utils[_0x6bf9('0x1')](util[_0x6bf9('0x2')](_0x6bf9('0x3'),_0x4f9173[_0x6bf9('0x4')],_0x4f9173[_0x6bf9('0x5')],_0x4f9173['queue'],_0x4f9173['lastAssignedTo'],_0x4f9173[_0x6bf9('0x6')],_0x4f9173[_0x6bf9('0x7')],_0x4f9173['queuecallerexitreason']));if(_0x4f9173['queue']){utils[_0x6bf9('0x8')](_0x4f9173[_0x6bf9('0x9')])[_0x6bf9('0xa')](function(_0x5a755f){if(_0x5a755f){_0x4f9173['type']=_0x5a755f[_0x6bf9('0xb')];}utils[_0x6bf9('0xc')]('CreateVoiceQueueReport',_0x4f9173);});}else{utils[_0x6bf9('0xc')](_0x6bf9('0xd'),_0x4f9173);}if(_0x4f9173[_0x6bf9('0xe')]){delete queues[_0x4f9173[_0x6bf9('0xe')]];}else{delete queues[_0x4f9173[_0x6bf9('0x4')]];}}exports[_0x6bf9('0xf')]=function(_0x3c2008){try{utils[_0x6bf9('0x10')](util[_0x6bf9('0x2')](_0x6bf9('0x11'),_0x3c2008[_0x6bf9('0x4')]),_0x3c2008);utils[_0x6bf9('0x1')](util[_0x6bf9('0x2')](_0x6bf9('0x12'),_0x3c2008[_0x6bf9('0x4')],_0x3c2008[_0x6bf9('0x9')],_0x3c2008[_0x6bf9('0x13')]));queues[_0x3c2008[_0x6bf9('0x4')]]=_[_0x6bf9('0x14')](_0x3c2008,{'originalposition':_0x3c2008[_0x6bf9('0x13')],'queuecallerjoinAt':utils[_0x6bf9('0x15')](),'mohtime':0x0});}catch(_0x22f8e0){utils[_0x6bf9('0x16')](util[_0x6bf9('0x2')]('[%s][queues][queuecallerjoin]',_0x3c2008[_0x6bf9('0x4')]),_0x22f8e0);}};exports[_0x6bf9('0x17')]=function(_0x79ee3c){try{if(!_[_0x6bf9('0x18')](queues[_0x79ee3c[_0x6bf9('0x4')]])){utils[_0x6bf9('0x10')](util[_0x6bf9('0x2')]('[%s][queues][hangup]',_0x79ee3c[_0x6bf9('0x4')]),_0x79ee3c);if(queues[_0x79ee3c[_0x6bf9('0x4')]][_0x6bf9('0x19')]){if(!queues[_0x79ee3c['uniqueid']]['queuecallerabandon']&&!queues[_0x79ee3c[_0x6bf9('0x4')]]['queuecallerexit']){queues[_0x79ee3c[_0x6bf9('0x4')]][_0x6bf9('0x1a')]=!![];queues[_0x79ee3c[_0x6bf9('0x4')]][_0x6bf9('0x1b')]=utils['now']();queues[_0x79ee3c[_0x6bf9('0x4')]]['queuecallerexitreason']=_0x6bf9('0x1c');}utils['info'](util[_0x6bf9('0x2')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x79ee3c[_0x6bf9('0x4')],queues[_0x79ee3c[_0x6bf9('0x4')]][_0x6bf9('0x1d')],queues[_0x79ee3c[_0x6bf9('0x4')]][_0x6bf9('0x1e')]));writeDB(queues[_0x79ee3c[_0x6bf9('0x4')]]);}else if(queues[_0x79ee3c[_0x6bf9('0x4')]][_0x6bf9('0xe')]){utils['info'](util[_0x6bf9('0x2')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x79ee3c[_0x6bf9('0x4')],queues[_0x79ee3c['uniqueid']][_0x6bf9('0x1d')],queues[_0x79ee3c['uniqueid']][_0x6bf9('0xe')]));queues[queues[_0x79ee3c[_0x6bf9('0x4')]]['transfereduniqueid']]=queues[_0x79ee3c['uniqueid']];queues[queues[_0x79ee3c[_0x6bf9('0x4')]][_0x6bf9('0xe')]][_0x6bf9('0x1f')]=0x2;delete queues[_0x79ee3c[_0x6bf9('0x4')]];}}}catch(_0x1c9cf4){utils[_0x6bf9('0x16')](util[_0x6bf9('0x2')](_0x6bf9('0x20'),_0x79ee3c[_0x6bf9('0x4')]),_0x1c9cf4);}};exports[_0x6bf9('0x21')]=function(_0x5d5f75){try{utils[_0x6bf9('0x10')](util[_0x6bf9('0x2')](_0x6bf9('0x22'),_0x5d5f75[_0x6bf9('0x4')]),_0x5d5f75);if(!_[_0x6bf9('0x18')](_0x5d5f75[_0x6bf9('0x23')]['queuestatus'])&&_0x5d5f75[_0x6bf9('0x24')][_0x6bf9('0x25')]()!==_0x6bf9('0x26')){if(!_['isNil'](queues[_0x5d5f75[_0x6bf9('0x4')]])){queues[_0x5d5f75[_0x6bf9('0x4')]][_0x6bf9('0x27')]=![];queues[_0x5d5f75[_0x6bf9('0x4')]][_0x6bf9('0x28')]=null;queues[_0x5d5f75[_0x6bf9('0x4')]]['queuecallerexit']=!![];queues[_0x5d5f75[_0x6bf9('0x4')]]['queuecallerexitAt']=utils[_0x6bf9('0x15')]();queues[_0x5d5f75[_0x6bf9('0x4')]]['queuecallerexitreason']=_0x5d5f75['value'][_0x6bf9('0x25')]();utils[_0x6bf9('0x1')](util[_0x6bf9('0x2')](_0x6bf9('0x29'),_0x5d5f75[_0x6bf9('0x4')],queues[_0x5d5f75[_0x6bf9('0x4')]][_0x6bf9('0x1d')],_0x5d5f75[_0x6bf9('0x24')],queues[_0x5d5f75['uniqueid']][_0x6bf9('0x1e')]));writeDB(queues[_0x5d5f75[_0x6bf9('0x4')]]);}}else if(!_[_0x6bf9('0x18')](_0x5d5f75[_0x6bf9('0x23')][_0x6bf9('0x2a')])){if(!_[_0x6bf9('0x18')](queues[_0x5d5f75['uniqueid']])&&!queues[_0x5d5f75[_0x6bf9('0x4')]][_0x6bf9('0x27')]){queues[_0x5d5f75[_0x6bf9('0x4')]][_0x6bf9('0x27')]=![];queues[_0x5d5f75[_0x6bf9('0x4')]][_0x6bf9('0x28')]=null;queues[_0x5d5f75[_0x6bf9('0x4')]][_0x6bf9('0x2b')]=!![];queues[_0x5d5f75[_0x6bf9('0x4')]][_0x6bf9('0x2c')]=utils[_0x6bf9('0x15')]();queues[_0x5d5f75[_0x6bf9('0x4')]]['queuecallerexitreason']=_0x6bf9('0x2d');utils[_0x6bf9('0x1')](util[_0x6bf9('0x2')](_0x6bf9('0x2e'),_0x5d5f75[_0x6bf9('0x4')],queues[_0x5d5f75[_0x6bf9('0x4')]][_0x6bf9('0x1d')],_0x5d5f75[_0x6bf9('0x24')],queues[_0x5d5f75['uniqueid']][_0x6bf9('0x1e')]));}}}catch(_0x999d0e){utils[_0x6bf9('0x16')](util['format']('[%s][queues][varset]',_0x5d5f75['uniqueid']),_0x999d0e);}};exports[_0x6bf9('0x27')]=function(_0x2ab18f){try{if(!_[_0x6bf9('0x18')](queues[_0x2ab18f['uniqueid']])){utils['debug'](util[_0x6bf9('0x2')]('[%s][queues][queuecallerabandon]',_0x2ab18f[_0x6bf9('0x4')]),_0x2ab18f);queues[_0x2ab18f[_0x6bf9('0x4')]][_0x6bf9('0x2b')]=![];queues[_0x2ab18f[_0x6bf9('0x4')]][_0x6bf9('0x2c')]=null;queues[_0x2ab18f[_0x6bf9('0x4')]][_0x6bf9('0x27')]=!![];queues[_0x2ab18f[_0x6bf9('0x4')]][_0x6bf9('0x28')]=utils[_0x6bf9('0x15')]();queues[_0x2ab18f[_0x6bf9('0x4')]][_0x6bf9('0x1e')]=_0x6bf9('0x2f');utils['info'](util[_0x6bf9('0x2')](_0x6bf9('0x30'),_0x2ab18f[_0x6bf9('0x4')],queues[_0x2ab18f[_0x6bf9('0x4')]][_0x6bf9('0x1d')],queues[_0x2ab18f['uniqueid']][_0x6bf9('0x1e')]));}}catch(_0x35f242){utils[_0x6bf9('0x16')](util[_0x6bf9('0x2')]('[%s][queues][queuecallerabandon]',_0x2ab18f[_0x6bf9('0x4')]),_0x35f242);}};exports[_0x6bf9('0x31')]=function(_0x379385){try{if(!_[_0x6bf9('0x18')](queues[_0x379385[_0x6bf9('0x4')]])){utils[_0x6bf9('0x10')](util[_0x6bf9('0x2')]('[%s][queues][queuecallerleave]',_0x379385[_0x6bf9('0x4')]),_0x379385);utils[_0x6bf9('0x1')](util[_0x6bf9('0x2')](_0x6bf9('0x32'),_0x379385[_0x6bf9('0x4')],queues[_0x379385['uniqueid']]['name'],_0x379385['connectedlinenum'],_0x379385[_0x6bf9('0x33')]));queues[_0x379385[_0x6bf9('0x4')]][_0x6bf9('0x31')]=!![];queues[_0x379385['uniqueid']]['queuecallerleaveAt']=utils[_0x6bf9('0x15')]();queues[_0x379385[_0x6bf9('0x4')]][_0x6bf9('0x34')]=utils['diffTime'](queues[_0x379385['uniqueid']]['queuecallerleaveAt'],queues[_0x379385[_0x6bf9('0x4')]][_0x6bf9('0x35')]);queues[_0x379385[_0x6bf9('0x4')]][_0x6bf9('0x13')]=_0x379385[_0x6bf9('0x13')];queues[_0x379385[_0x6bf9('0x4')]]['count']=_0x379385[_0x6bf9('0x36')];queues[_0x379385['uniqueid']]['connectedlinenum']=_0x379385[_0x6bf9('0x37')];queues[_0x379385[_0x6bf9('0x4')]][_0x6bf9('0x33')]=_0x379385[_0x6bf9('0x33')];}}catch(_0x32d72c){utils['error'](util[_0x6bf9('0x2')](_0x6bf9('0x38'),_0x379385[_0x6bf9('0x4')]),_0x32d72c);}};exports[_0x6bf9('0x39')]=function(_0x277a7f){try{if(!_[_0x6bf9('0x18')](queues[_0x277a7f[_0x6bf9('0x4')]])){utils[_0x6bf9('0x10')](util[_0x6bf9('0x2')](_0x6bf9('0x3a'),_0x277a7f[_0x6bf9('0x4')]),_0x277a7f);utils['info'](util[_0x6bf9('0x2')](_0x6bf9('0x3b'),_0x277a7f[_0x6bf9('0x4')],queues[_0x277a7f[_0x6bf9('0x4')]][_0x6bf9('0x1d')],_0x277a7f['membername'],_0x277a7f[_0x6bf9('0x3c')]));queues[_0x277a7f[_0x6bf9('0x4')]]['queuecallerabandon']=![];queues[_0x277a7f[_0x6bf9('0x4')]]['queuecallerabandon']=![];queues[_0x277a7f[_0x6bf9('0x4')]][_0x6bf9('0x28')]=null;queues[_0x277a7f['uniqueid']][_0x6bf9('0x2b')]=![];queues[_0x277a7f[_0x6bf9('0x4')]][_0x6bf9('0x1e')]=null;queues[_0x277a7f[_0x6bf9('0x4')]][_0x6bf9('0x2c')]=null;queues[_0x277a7f['uniqueid']][_0x6bf9('0x3d')]=!![];queues[_0x277a7f['uniqueid']][_0x6bf9('0x7')]=_0x277a7f[_0x6bf9('0x3c')];queues[_0x277a7f[_0x6bf9('0x4')]]['lastAssignedTo']=_0x277a7f[_0x6bf9('0x3e')];}}catch(_0x1a3335){utils['error'](util['format'](_0x6bf9('0x3a'),_0x277a7f[_0x6bf9('0x4')]),_0x1a3335);}};exports[_0x6bf9('0x3f')]=function(_0x3069d4){try{if(!_[_0x6bf9('0x18')](queues[_0x3069d4[_0x6bf9('0x4')]])){if(queues[_0x3069d4[_0x6bf9('0x4')]][_0x6bf9('0x19')]){utils[_0x6bf9('0x10')](util[_0x6bf9('0x2')](_0x6bf9('0x40'),_0x3069d4[_0x6bf9('0x4')]),_0x3069d4);queues[_0x3069d4[_0x6bf9('0x4')]][_0x6bf9('0x27')]=![];queues[_0x3069d4['uniqueid']][_0x6bf9('0x27')]=![];queues[_0x3069d4[_0x6bf9('0x4')]][_0x6bf9('0x28')]=null;queues[_0x3069d4[_0x6bf9('0x4')]]['queuecallerexit']=![];queues[_0x3069d4['uniqueid']][_0x6bf9('0x2c')]=null;queues[_0x3069d4[_0x6bf9('0x4')]][_0x6bf9('0x3d')]=!![];queues[_0x3069d4[_0x6bf9('0x4')]]['lastAssignedTo']=_0x3069d4[_0x6bf9('0x3e')];queues[_0x3069d4['uniqueid']][_0x6bf9('0x1a')]=!![];queues[_0x3069d4['uniqueid']][_0x6bf9('0x1b')]=utils[_0x6bf9('0x15')]();if(_0x3069d4['reason']==_0x6bf9('0x41')){if(!queues[_0x3069d4[_0x6bf9('0x4')]][_0x6bf9('0x41')]){queues[_0x3069d4['uniqueid']][_0x6bf9('0x1e')]=_0x6bf9('0x42');}}else{queues[_0x3069d4[_0x6bf9('0x4')]]['queuecallerexitreason']='COMPLETEDBY'+_0x3069d4['reason'][_0x6bf9('0x25')]();}utils[_0x6bf9('0x1')](util[_0x6bf9('0x2')](_0x6bf9('0x43'),_0x3069d4[_0x6bf9('0x4')],queues[_0x3069d4[_0x6bf9('0x4')]][_0x6bf9('0x1d')],_0x3069d4['membername'],queues[_0x3069d4['uniqueid']][_0x6bf9('0x1e')]));writeDB(queues[_0x3069d4['uniqueid']]);}}}catch(_0x51e16e){utils[_0x6bf9('0x16')](util['format'](_0x6bf9('0x40'),_0x3069d4[_0x6bf9('0x4')]),_0x51e16e);}};exports[_0x6bf9('0x44')]=function(_0x4e3b36){try{if(!_[_0x6bf9('0x18')](queues[_0x4e3b36[_0x6bf9('0x45')]])){utils['debug'](util[_0x6bf9('0x2')]('[%s][queues][blindtransfer]',_0x4e3b36[_0x6bf9('0x4')]),_0x4e3b36);queues[_0x4e3b36[_0x6bf9('0x45')]][_0x6bf9('0x41')]=!![];queues[_0x4e3b36[_0x6bf9('0x45')]]['transfertype']=_0x6bf9('0x46');queues[_0x4e3b36[_0x6bf9('0x45')]]['transferexten']=_0x4e3b36[_0x6bf9('0x47')];queues[_0x4e3b36[_0x6bf9('0x45')]][_0x6bf9('0x48')]=_0x4e3b36[_0x6bf9('0x45')];queues[_0x4e3b36[_0x6bf9('0x45')]]['queuecallerexitreason']=_0x6bf9('0x49');utils[_0x6bf9('0x1')](util[_0x6bf9('0x2')](_0x6bf9('0x4a'),_0x4e3b36[_0x6bf9('0x4')],queues[_0x4e3b36['transfereeuniqueid']][_0x6bf9('0x1d')],_0x4e3b36[_0x6bf9('0x45')],_0x4e3b36[_0x6bf9('0x47')]));}}catch(_0x40fabd){utils[_0x6bf9('0x16')](util[_0x6bf9('0x2')]('[%s][queues][blindtransfer]',_0x4e3b36['uniqueid']),_0x40fabd);}};exports[_0x6bf9('0x4b')]=function(_0x32e5d0){try{utils[_0x6bf9('0x10')](util[_0x6bf9('0x2')]('[%s][queues][attendedtransfer]',_0x32e5d0[_0x6bf9('0x4c')]),_0x32e5d0);if(_0x32e5d0[_0x6bf9('0x4c')]==_0x32e5d0[_0x6bf9('0x4d')]){if(!_[_0x6bf9('0x18')](queues[_0x32e5d0[_0x6bf9('0x4e')]])){utils[_0x6bf9('0x1')](util['format'](_0x6bf9('0x4f'),_0x32e5d0[_0x6bf9('0x4c')],queues[_0x32e5d0[_0x6bf9('0x4e')]]['name'],_0x32e5d0[_0x6bf9('0x50')]));queues[_0x32e5d0['secondtransfererlinkedid']]['transfer']=!![];queues[_0x32e5d0['secondtransfererlinkedid']]['transfertype']=_0x6bf9('0x51');queues[_0x32e5d0[_0x6bf9('0x4e')]][_0x6bf9('0x52')]=_0x32e5d0[_0x6bf9('0x50')];queues[_0x32e5d0[_0x6bf9('0x4e')]][_0x6bf9('0x48')]=_0x32e5d0[_0x6bf9('0x4c')];queues[_0x32e5d0[_0x6bf9('0x4e')]][_0x6bf9('0x1e')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x32e5d0[_0x6bf9('0x4d')]])){if(_0x32e5d0[_0x6bf9('0x53')]&&queues[_0x32e5d0[_0x6bf9('0x53')]]){queues[_0x32e5d0[_0x6bf9('0x53')]][_0x6bf9('0x1f')]=0x1;queues[_0x32e5d0[_0x6bf9('0x45')]]=_[_0x6bf9('0x54')](queues[_0x32e5d0[_0x6bf9('0x53')]]);queues[_0x32e5d0[_0x6bf9('0x45')]][_0x6bf9('0xe')]=_0x32e5d0[_0x6bf9('0x55')];queues[_0x32e5d0['transfereeuniqueid']][_0x6bf9('0x1f')]=0x2;queues[_0x32e5d0['transfereeuniqueid']][_0x6bf9('0x6')]=queues[_0x32e5d0[_0x6bf9('0x4e')]]['calleridnum'];queues[_0x32e5d0[_0x6bf9('0x45')]][_0x6bf9('0x56')]=queues[_0x32e5d0['secondtransfererlinkedid']][_0x6bf9('0x56')];queues[_0x32e5d0[_0x6bf9('0x45')]][_0x6bf9('0x35')]=utils[_0x6bf9('0x15')]();queues[_0x32e5d0[_0x6bf9('0x45')]][_0x6bf9('0x19')]=utils[_0x6bf9('0x15')]();queues[_0x32e5d0[_0x6bf9('0x45')]]['holdtime']=0x0;queues[_0x32e5d0['transfereeuniqueid']][_0x6bf9('0x57')]=0x0;utils[_0x6bf9('0x1')](util[_0x6bf9('0x2')](_0x6bf9('0x58'),_0x32e5d0[_0x6bf9('0x4c')],queues[_0x32e5d0[_0x6bf9('0x45')]][_0x6bf9('0x1d')],queues[_0x32e5d0[_0x6bf9('0x45')]][_0x6bf9('0x6')],queues[_0x32e5d0[_0x6bf9('0x45')]][_0x6bf9('0x56')]));}else{utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x32e5d0[_0x6bf9('0x4c')],queues[_0x32e5d0[_0x6bf9('0x4d')]][_0x6bf9('0x1d')],_0x32e5d0[_0x6bf9('0x4e')]));queues[_0x32e5d0[_0x6bf9('0x4d')]][_0x6bf9('0xe')]=_0x32e5d0['secondtransfererlinkedid'];}}}else if(_0x32e5d0[_0x6bf9('0x59')]==_0x32e5d0[_0x6bf9('0x4e')]){if(!_[_0x6bf9('0x18')](queues[_0x32e5d0['origtransfererlinkedid']])){utils[_0x6bf9('0x1')](util['format'](_0x6bf9('0x5a'),_0x32e5d0[_0x6bf9('0x4c')],queues[_0x32e5d0[_0x6bf9('0x4d')]][_0x6bf9('0x1d')],_0x32e5d0['secondtransfereruniqueid'],_0x32e5d0[_0x6bf9('0x5b')]));queues[_0x32e5d0[_0x6bf9('0x4d')]][_0x6bf9('0x41')]=!![];queues[_0x32e5d0['origtransfererlinkedid']][_0x6bf9('0x5c')]='ATTENDED';queues[_0x32e5d0[_0x6bf9('0x4d')]]['transferexten']=_0x32e5d0[_0x6bf9('0x5b')];queues[_0x32e5d0['origtransfererlinkedid']]['transferuniqueid']=_0x32e5d0[_0x6bf9('0x59')];queues[_0x32e5d0[_0x6bf9('0x4d')]][_0x6bf9('0x1e')]='ATTENDEDTRANSFER';}if(!_[_0x6bf9('0x18')](queues[_0x32e5d0[_0x6bf9('0x4e')]])){if(_0x32e5d0[_0x6bf9('0x5d')]&&queues[_0x32e5d0[_0x6bf9('0x5d')]]){queues[_0x32e5d0[_0x6bf9('0x5d')]]['queuecallerenterreason']=0x1;queues[_0x32e5d0[_0x6bf9('0x55')]]=_['clone'](queues[_0x32e5d0[_0x6bf9('0x5d')]]);queues[_0x32e5d0[_0x6bf9('0x55')]][_0x6bf9('0xe')]=_0x32e5d0[_0x6bf9('0x55')];queues[_0x32e5d0['transfertargetuniqueid']][_0x6bf9('0x1f')]=0x2;queues[_0x32e5d0[_0x6bf9('0x55')]][_0x6bf9('0x6')]=queues[_0x32e5d0['origtransfererlinkedid']][_0x6bf9('0x6')];queues[_0x32e5d0[_0x6bf9('0x55')]][_0x6bf9('0x56')]=queues[_0x32e5d0[_0x6bf9('0x4d')]][_0x6bf9('0x56')];queues[_0x32e5d0[_0x6bf9('0x55')]][_0x6bf9('0x35')]=utils[_0x6bf9('0x15')]();queues[_0x32e5d0[_0x6bf9('0x55')]][_0x6bf9('0x19')]=utils[_0x6bf9('0x15')]();queues[_0x32e5d0[_0x6bf9('0x55')]][_0x6bf9('0x34')]=0x0;queues[_0x32e5d0[_0x6bf9('0x55')]][_0x6bf9('0x57')]=0x0;utils['info'](util[_0x6bf9('0x2')](_0x6bf9('0x5e'),_0x32e5d0['origtransfereruniqueid'],queues[_0x32e5d0[_0x6bf9('0x55')]][_0x6bf9('0x1d')],queues[_0x32e5d0[_0x6bf9('0x55')]]['transfereduniqueid'],queues[_0x32e5d0[_0x6bf9('0x55')]][_0x6bf9('0x6')],queues[_0x32e5d0[_0x6bf9('0x55')]][_0x6bf9('0x56')]));}else{utils['info'](util[_0x6bf9('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x32e5d0[_0x6bf9('0x4c')],queues[_0x32e5d0[_0x6bf9('0x4e')]][_0x6bf9('0x1d')],_0x32e5d0[_0x6bf9('0x4d')]));queues[_0x32e5d0[_0x6bf9('0x4e')]]['transfereduniqueid']=_0x32e5d0[_0x6bf9('0x4d')];}}}}catch(_0x59c500){utils[_0x6bf9('0x16')](util[_0x6bf9('0x2')]('[%s][queues][attendedtransfer]',_0x32e5d0[_0x6bf9('0x4c')]),_0x59c500);}};exports[_0x6bf9('0x5f')]=function(_0x6676cb){try{if(!_[_0x6bf9('0x18')](queues[_0x6676cb[_0x6bf9('0x4')]])){utils[_0x6bf9('0x10')](util['format'](_0x6bf9('0x60'),_0x6676cb[_0x6bf9('0x4')]),_0x6676cb);queues[_0x6676cb['uniqueid']]['musiconholdstartAt']=utils[_0x6bf9('0x15')]();utils['info'](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x6676cb[_0x6bf9('0x4')],queues[_0x6676cb['uniqueid']][_0x6bf9('0x1d')],queues[_0x6676cb[_0x6bf9('0x4')]][_0x6bf9('0x61')]));}}catch(_0x49ef0b){utils[_0x6bf9('0x16')](util[_0x6bf9('0x2')](_0x6bf9('0x60'),_0x6676cb[_0x6bf9('0x4')]),_0x49ef0b);}};exports[_0x6bf9('0x62')]=function(_0x191487){try{if(!_['isNil'](queues[_0x191487[_0x6bf9('0x4')]])){if(!_[_0x6bf9('0x18')](queues[_0x191487[_0x6bf9('0x4')]]['musiconholdstartAt'])){utils[_0x6bf9('0x10')](util[_0x6bf9('0x2')](_0x6bf9('0x63'),_0x191487['uniqueid']),_0x191487);queues[_0x191487[_0x6bf9('0x4')]]['mohtime']+=utils[_0x6bf9('0x64')](utils[_0x6bf9('0x15')](),queues[_0x191487[_0x6bf9('0x4')]][_0x6bf9('0x61')]);utils[_0x6bf9('0x1')](util[_0x6bf9('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x191487['uniqueid'],queues[_0x191487[_0x6bf9('0x4')]][_0x6bf9('0x1d')],queues[_0x191487[_0x6bf9('0x4')]][_0x6bf9('0x57')]));delete queues[_0x191487['uniqueid']][_0x6bf9('0x61')];}}}catch(_0x3e16a2){utils['error'](util[_0x6bf9('0x2')]('[%s][queues][musiconholdstop]',_0x191487[_0x6bf9('0x4')]),_0x3e16a2);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 307c71c..1dd35e1 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 _0x479e=['type','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','appdata','toLowerCase','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereruniqueid','recording','lodash','./transfers.controller','info','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','membername','UserId','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','format','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','debug','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename'];(function(_0x147bb9,_0x4c0ff4){var _0x24043b=function(_0x91aa7d){while(--_0x91aa7d){_0x147bb9['push'](_0x147bb9['shift']());}};_0x24043b(++_0x4c0ff4);}(_0x479e,0x12f));var _0xe479=function(_0x1b40a4,_0x1ddcf7){_0x1b40a4=_0x1b40a4-0x0;var _0x8c4a88=_0x479e[_0x1b40a4];return _0x8c4a88;};'use strict';var _=require(_0xe479('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0xe479('0x1'));var recordings={};function writeDB(_0x2388d2){var _0x182165;utils[_0xe479('0x2')](util['format'](_0xe479('0x3'),_0x2388d2[_0xe479('0x4')]));if(transfers[_0xe479('0x5')][_0x2388d2['uniqueid']]){_0x182165=_0x2388d2[_0xe479('0x4')];_0x2388d2[_0xe479('0x4')]=transfers[_0xe479('0x5')][_0x2388d2['uniqueid']][_0xe479('0x6')];}if(_0x2388d2[_0xe479('0x7')]){utils[_0xe479('0x8')](_0x2388d2['accountcode'])['then'](function(_0x4c9db3){if(_0x4c9db3){_0x2388d2[_0xe479('0x9')]=_0x4c9db3['name'];_0x2388d2[_0xe479('0xa')]=_0x4c9db3['id'];}utils['request']('CreateVoiceRecording',_0x2388d2);});}else{utils[_0xe479('0xb')](_0xe479('0xc'),_0x2388d2);}if(_0x182165)delete transfers[_0xe479('0x5')][_0x182165];}exports[_0xe479('0xd')]=function(_0x468ac4){try{utils['debug'](util['format'](_0xe479('0xe'),_0x468ac4[_0xe479('0x4')]),_0x468ac4);if(_0x468ac4[_0xe479('0x4')]==_0x468ac4[_0xe479('0xf')]){utils[_0xe479('0x2')](util['format'](_0xe479('0x10'),_0x468ac4[_0xe479('0x4')],_0x468ac4[_0xe479('0x11')],_0x468ac4['exten']));recordings[_0x468ac4['uniqueid']]={'uniqueid':_0x468ac4[_0xe479('0x4')],'accountcode':_0x468ac4[_0xe479('0x7')],'exten':_0x468ac4[_0xe479('0x12')],'context':_0x468ac4[_0xe479('0x11')],'channel':_0x468ac4[_0xe479('0x13')],'monitors':[]};}}catch(_0x284d45){utils[_0xe479('0x14')](util[_0xe479('0x15')](_0xe479('0xe'),_0x468ac4[_0xe479('0x4')]),_0x284d45);}};exports['newstate']=function(_0x3a996d){try{utils['debug'](util[_0xe479('0x15')](_0xe479('0x16'),_0x3a996d['uniqueid']),_0x3a996d);if(!_[_0xe479('0x17')](recordings[_0x3a996d['uniqueid']])&&_0x3a996d['channelstate']==0x6){utils[_0xe479('0x2')](util[_0xe479('0x15')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x3a996d[_0xe479('0x4')],_0x3a996d[_0xe479('0x11')],_0x3a996d[_0xe479('0x13')]));}else if(!_[_0xe479('0x17')](recordings[_0x3a996d[_0xe479('0xf')]])&&_0x3a996d[_0xe479('0x18')]==0x6&&_0x3a996d['context']!='transfer'){utils[_0xe479('0x2')](util[_0xe479('0x15')](_0xe479('0x19'),_0x3a996d[_0xe479('0x4')],_0x3a996d['linkedid'],_0x3a996d[_0xe479('0x11')],_0x3a996d[_0xe479('0x13')]));recordings[_0x3a996d[_0xe479('0xf')]][_0xe479('0x7')]=_0x3a996d[_0xe479('0x7')];}}catch(_0x95a0f5){utils[_0xe479('0x14')](util[_0xe479('0x15')](_0xe479('0x16'),_0x3a996d[_0xe479('0x4')]),_0x95a0f5);}};exports[_0xe479('0x1a')]=function(_0x5d8457){try{if(!_[_0xe479('0x17')](_0x5d8457[_0xe479('0x1b')])&&!_[_0xe479('0x17')](_0x5d8457['variable'][_0xe479('0x1c')])){utils['debug'](util[_0xe479('0x15')](_0xe479('0x1d'),_0x5d8457[_0xe479('0x4')]),_0x5d8457);utils['info'](util[_0xe479('0x15')](_0xe479('0x1e'),_0x5d8457[_0xe479('0x4')],_0x5d8457[_0xe479('0x1b')],_0x5d8457[_0xe479('0x1f')]));if(_[_0xe479('0x20')](_0x5d8457[_0xe479('0x1f')],_0xe479('0x21'))){_0x5d8457[_0xe479('0x1f')]=_0x5d8457[_0xe479('0x1f')][_0xe479('0x22')](_0xe479('0x21'),_0xe479('0x23'));}if(recordings[_0x5d8457[_0xe479('0xf')]]){var _0x2231aa=_[_0xe479('0x24')](recordings[_0x5d8457[_0xe479('0xf')]][_0xe479('0x25')],{'value':_0x5d8457[_0xe479('0x1f')]});if(_[_0xe479('0x17')](_0x2231aa)){recordings[_0x5d8457[_0xe479('0xf')]][_0xe479('0x25')][_0xe479('0x26')]({'value':_0x5d8457[_0xe479('0x1f')]});}}}}catch(_0x39515d){utils[_0xe479('0x14')](util[_0xe479('0x15')](_0xe479('0x1d'),_0x5d8457[_0xe479('0x4')]),_0x39515d);}};exports[_0xe479('0x27')]=function(_0x1b66d5){try{if(!_[_0xe479('0x17')](recordings[_0x1b66d5['uniqueid']])){utils[_0xe479('0x28')](util[_0xe479('0x15')]('[%s][recordings][hangup]',_0x1b66d5[_0xe479('0x4')]),_0x1b66d5);utils['info'](util[_0xe479('0x15')](_0xe479('0x29'),_0x1b66d5[_0xe479('0x4')],_0x1b66d5[_0xe479('0x2a')],_0x1b66d5[_0xe479('0x2b')],_0x1b66d5[_0xe479('0x2c')]));recordings[_0x1b66d5[_0xe479('0x4')]][_0xe479('0x2a')]=_0x1b66d5['calleridnum'];recordings[_0x1b66d5[_0xe479('0x4')]]['calleridname']=_0x1b66d5[_0xe479('0x2b')];recordings[_0x1b66d5[_0xe479('0x4')]]['connectedlinenum']=_0x1b66d5[_0xe479('0x2d')];recordings[_0x1b66d5[_0xe479('0x4')]][_0xe479('0x2e')]=_0x1b66d5[_0xe479('0x2e')];if(recordings[_0x1b66d5[_0xe479('0x4')]][_0xe479('0x2f')]=='outbound'&&recordings[_0x1b66d5[_0xe479('0x4')]][_0xe479('0x7')]){recordings[_0x1b66d5['uniqueid']]['connectedlinenum']=recordings[_0x1b66d5[_0xe479('0x4')]][_0xe479('0x7')];recordings[_0x1b66d5[_0xe479('0x4')]][_0xe479('0x2e')]='';}recordings[_0x1b66d5[_0xe479('0x4')]][_0xe479('0x25')]['forEach'](function(_0x372cdf){var _0x10c145=_[_0xe479('0x30')](recordings[_0x1b66d5[_0xe479('0x4')]]);_0x10c145[_0xe479('0x1f')]=_0x372cdf[_0xe479('0x1f')];writeDB(_0x10c145);});delete recordings[_0x1b66d5[_0xe479('0x4')]];}}catch(_0x43905c){utils['error'](util[_0xe479('0x15')]('[%s][recordings][hangup]',_0x1b66d5[_0xe479('0x4')]),_0x43905c);}};exports['newexten']=function(_0x1190a9){try{if(!_[_0xe479('0x17')](recordings[_0x1190a9[_0xe479('0x4')]])){utils[_0xe479('0x28')](util[_0xe479('0x15')](_0xe479('0x31'),_0x1190a9['uniqueid']),_0x1190a9);utils['info'](util[_0xe479('0x15')](_0xe479('0x32'),_0x1190a9[_0xe479('0x4')],_0x1190a9[_0xe479('0x33')],_0x1190a9['appdata']));if(_0x1190a9['application']['toLowerCase']()==_0xe479('0x34')&&_[_0xe479('0x35')](_0x1190a9[_0xe479('0x36')][_0xe479('0x37')](),_0xe479('0x38'))){var _0x55c581=_0x1190a9['appdata'][_0xe479('0x39')]('=');var _0x23f4f0=_0x55c581[0x0][_0xe479('0x3a')](_0x55c581[0x0][_0xe479('0x3b')]('(')+0x1,_0x55c581[0x0][_0xe479('0x3b')](')'));var _0xb6287c=_0x55c581[0x1];recordings[_0x1190a9['uniqueid']][_0x23f4f0]=_0xb6287c;}}}catch(_0x560e08){utils['error'](util['format']('[%s][recordings][newexten]',_0x1190a9[_0xe479('0x4')]),_0x560e08);}};exports[_0xe479('0x3c')]=function(_0x3a2ae1){try{if(!_[_0xe479('0x17')](recordings[_0x3a2ae1['uniqueid']])){utils['debug'](util[_0xe479('0x15')]('[%s][recordings][queuecallerjoin]',_0x3a2ae1[_0xe479('0x4')]),_0x3a2ae1);utils['info'](util['format'](_0xe479('0x3d'),_0x3a2ae1[_0xe479('0x4')],_0x3a2ae1[_0xe479('0x3e')]));recordings[_0x3a2ae1[_0xe479('0x4')]]['queue']=_0x3a2ae1[_0xe479('0x3e')];}}catch(_0x11f250){utils[_0xe479('0x14')](util[_0xe479('0x15')](_0xe479('0x3f'),_0x3a2ae1[_0xe479('0x4')]),_0x11f250);}};exports[_0xe479('0x40')]=function(_0x346ff5){try{utils[_0xe479('0x28')](util[_0xe479('0x15')](_0xe479('0x41'),_0x346ff5[_0xe479('0x4')]),_0x346ff5);utils[_0xe479('0x2')](util['format'](_0xe479('0x42'),_0x346ff5[_0xe479('0x4')],_0x346ff5[_0xe479('0x43')],_0x346ff5['transferercalleridname'],_0x346ff5['transfereecalleridnum'],_0x346ff5['transfereecalleridname']));if(recordings[_0x346ff5[_0xe479('0x44')]]&&transfers[_0xe479('0x5')][_0x346ff5[_0xe479('0x44')]]){transfers['blinds'][_0x346ff5[_0xe479('0x44')]][_0xe479('0x45')]=!![];}}catch(_0x3ab364){utils[_0xe479('0x14')](util[_0xe479('0x15')](_0xe479('0x41'),_0x346ff5[_0xe479('0x4')]),_0x3ab364);}}; \ No newline at end of file +var _0x58cc=['[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','getUserByInternal','accountcode','then','membername','name','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','context','channel','error','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer'];(function(_0x56c515,_0x22c67c){var _0x3bb524=function(_0x14c3c2){while(--_0x14c3c2){_0x56c515['push'](_0x56c515['shift']());}};_0x3bb524(++_0x22c67c);}(_0x58cc,0x72));var _0xc58c=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x58cc[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require('lodash');var util=require(_0xc58c('0x0'));var utils=require(_0xc58c('0x1'));var transfers=require(_0xc58c('0x2'));var recordings={};function writeDB(_0x531f56){var _0x28cfc7;utils[_0xc58c('0x3')](util[_0xc58c('0x4')](_0xc58c('0x5'),_0x531f56[_0xc58c('0x6')]));if(transfers['blinds'][_0x531f56[_0xc58c('0x6')]]){_0x28cfc7=_0x531f56[_0xc58c('0x6')];_0x531f56[_0xc58c('0x6')]=transfers[_0xc58c('0x7')][_0x531f56[_0xc58c('0x6')]][_0xc58c('0x8')];}if(_0x531f56['accountcode']){utils[_0xc58c('0x9')](_0x531f56[_0xc58c('0xa')])[_0xc58c('0xb')](function(_0x44c7d9){if(_0x44c7d9){_0x531f56[_0xc58c('0xc')]=_0x44c7d9[_0xc58c('0xd')];_0x531f56[_0xc58c('0xe')]=_0x44c7d9['id'];}utils['request'](_0xc58c('0xf'),_0x531f56);});}else{utils[_0xc58c('0x10')](_0xc58c('0xf'),_0x531f56);}if(_0x28cfc7)delete transfers['blinds'][_0x28cfc7];}exports[_0xc58c('0x11')]=function(_0x16b3f2){try{utils[_0xc58c('0x12')](util[_0xc58c('0x4')](_0xc58c('0x13'),_0x16b3f2[_0xc58c('0x6')]),_0x16b3f2);if(_0x16b3f2['uniqueid']==_0x16b3f2[_0xc58c('0x14')]){utils[_0xc58c('0x3')](util[_0xc58c('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x16b3f2['uniqueid'],_0x16b3f2[_0xc58c('0x15')],_0x16b3f2['exten']));recordings[_0x16b3f2[_0xc58c('0x6')]]={'uniqueid':_0x16b3f2[_0xc58c('0x6')],'accountcode':_0x16b3f2['accountcode'],'exten':_0x16b3f2['exten'],'context':_0x16b3f2[_0xc58c('0x15')],'channel':_0x16b3f2[_0xc58c('0x16')],'monitors':[]};}}catch(_0x33dec9){utils[_0xc58c('0x17')](util[_0xc58c('0x4')](_0xc58c('0x13'),_0x16b3f2[_0xc58c('0x6')]),_0x33dec9);}};exports['newstate']=function(_0x48b1a4){try{utils[_0xc58c('0x12')](util[_0xc58c('0x4')](_0xc58c('0x18'),_0x48b1a4[_0xc58c('0x6')]),_0x48b1a4);if(!_[_0xc58c('0x19')](recordings[_0x48b1a4[_0xc58c('0x6')]])&&_0x48b1a4['channelstate']==0x6){utils[_0xc58c('0x3')](util[_0xc58c('0x4')](_0xc58c('0x1a'),_0x48b1a4[_0xc58c('0x6')],_0x48b1a4[_0xc58c('0x15')],_0x48b1a4[_0xc58c('0x16')]));}else if(!_[_0xc58c('0x19')](recordings[_0x48b1a4[_0xc58c('0x14')]])&&_0x48b1a4['channelstate']==0x6&&_0x48b1a4['context']!=_0xc58c('0x1b')){utils[_0xc58c('0x3')](util['format'](_0xc58c('0x1c'),_0x48b1a4[_0xc58c('0x6')],_0x48b1a4[_0xc58c('0x14')],_0x48b1a4[_0xc58c('0x15')],_0x48b1a4['channel']));recordings[_0x48b1a4['linkedid']]['accountcode']=_0x48b1a4[_0xc58c('0xa')];}}catch(_0x4852b5){utils[_0xc58c('0x17')](util[_0xc58c('0x4')]('[%s][recordings][newstate]',_0x48b1a4[_0xc58c('0x6')]),_0x4852b5);}};exports[_0xc58c('0x1d')]=function(_0x36e215){try{if(!_['isNil'](_0x36e215[_0xc58c('0x1e')])&&!_[_0xc58c('0x19')](_0x36e215[_0xc58c('0x1e')][_0xc58c('0x1f')])){utils[_0xc58c('0x12')](util[_0xc58c('0x4')](_0xc58c('0x20'),_0x36e215[_0xc58c('0x6')]),_0x36e215);utils[_0xc58c('0x3')](util[_0xc58c('0x4')](_0xc58c('0x21'),_0x36e215[_0xc58c('0x6')],_0x36e215['variable'],_0x36e215[_0xc58c('0x22')]));if(_[_0xc58c('0x23')](_0x36e215['value'],_0xc58c('0x24'))){_0x36e215[_0xc58c('0x22')]=_0x36e215[_0xc58c('0x22')][_0xc58c('0x25')](_0xc58c('0x24'),_0xc58c('0x26'));}if(recordings[_0x36e215[_0xc58c('0x14')]]){var _0x478679=_['find'](recordings[_0x36e215[_0xc58c('0x14')]][_0xc58c('0x27')],{'value':_0x36e215['value']});if(_['isNil'](_0x478679)){recordings[_0x36e215[_0xc58c('0x14')]][_0xc58c('0x27')][_0xc58c('0x28')]({'value':_0x36e215[_0xc58c('0x22')]});}}}}catch(_0x111367){utils[_0xc58c('0x17')](util['format'](_0xc58c('0x20'),_0x36e215[_0xc58c('0x6')]),_0x111367);}};exports[_0xc58c('0x29')]=function(_0x5740ac){try{if(!_[_0xc58c('0x19')](recordings[_0x5740ac['uniqueid']])){utils[_0xc58c('0x12')](util[_0xc58c('0x4')]('[%s][recordings][hangup]',_0x5740ac[_0xc58c('0x6')]),_0x5740ac);utils[_0xc58c('0x3')](util[_0xc58c('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x5740ac[_0xc58c('0x6')],_0x5740ac[_0xc58c('0x2a')],_0x5740ac['calleridname'],_0x5740ac['cause-txt']));recordings[_0x5740ac[_0xc58c('0x6')]][_0xc58c('0x2a')]=_0x5740ac[_0xc58c('0x2a')];recordings[_0x5740ac[_0xc58c('0x6')]]['calleridname']=_0x5740ac[_0xc58c('0x2b')];recordings[_0x5740ac['uniqueid']][_0xc58c('0x2c')]=_0x5740ac[_0xc58c('0x2c')];recordings[_0x5740ac['uniqueid']][_0xc58c('0x2d')]=_0x5740ac[_0xc58c('0x2d')];if(recordings[_0x5740ac[_0xc58c('0x6')]][_0xc58c('0x2e')]==_0xc58c('0x2f')&&recordings[_0x5740ac[_0xc58c('0x6')]][_0xc58c('0xa')]){recordings[_0x5740ac[_0xc58c('0x6')]][_0xc58c('0x2c')]=recordings[_0x5740ac[_0xc58c('0x6')]][_0xc58c('0xa')];recordings[_0x5740ac['uniqueid']][_0xc58c('0x2d')]='';}recordings[_0x5740ac[_0xc58c('0x6')]][_0xc58c('0x27')]['forEach'](function(_0x10807f){var _0x10a809=_['clone'](recordings[_0x5740ac[_0xc58c('0x6')]]);_0x10a809[_0xc58c('0x22')]=_0x10807f[_0xc58c('0x22')];writeDB(_0x10a809);});delete recordings[_0x5740ac[_0xc58c('0x6')]];}}catch(_0x44aa5c){utils[_0xc58c('0x17')](util['format'](_0xc58c('0x30'),_0x5740ac[_0xc58c('0x6')]),_0x44aa5c);}};exports[_0xc58c('0x31')]=function(_0x2fe683){try{if(!_[_0xc58c('0x19')](recordings[_0x2fe683[_0xc58c('0x6')]])){utils[_0xc58c('0x12')](util[_0xc58c('0x4')](_0xc58c('0x32'),_0x2fe683[_0xc58c('0x6')]),_0x2fe683);utils[_0xc58c('0x3')](util[_0xc58c('0x4')](_0xc58c('0x33'),_0x2fe683['uniqueid'],_0x2fe683[_0xc58c('0x34')],_0x2fe683[_0xc58c('0x35')]));if(_0x2fe683[_0xc58c('0x34')][_0xc58c('0x36')]()=='set'&&_['startsWith'](_0x2fe683[_0xc58c('0x35')][_0xc58c('0x36')](),_0xc58c('0x37'))){var _0x487ad9=_0x2fe683[_0xc58c('0x35')][_0xc58c('0x38')]('=');var _0x559748=_0x487ad9[0x0]['substring'](_0x487ad9[0x0][_0xc58c('0x39')]('(')+0x1,_0x487ad9[0x0][_0xc58c('0x39')](')'));var _0x41c516=_0x487ad9[0x1];recordings[_0x2fe683[_0xc58c('0x6')]][_0x559748]=_0x41c516;}}}catch(_0x287fd8){utils[_0xc58c('0x17')](util['format'](_0xc58c('0x32'),_0x2fe683[_0xc58c('0x6')]),_0x287fd8);}};exports[_0xc58c('0x3a')]=function(_0x509acf){try{if(!_['isNil'](recordings[_0x509acf[_0xc58c('0x6')]])){utils[_0xc58c('0x12')](util['format'](_0xc58c('0x3b'),_0x509acf['uniqueid']),_0x509acf);utils['info'](util['format'](_0xc58c('0x3c'),_0x509acf['uniqueid'],_0x509acf['queue']));recordings[_0x509acf[_0xc58c('0x6')]][_0xc58c('0x3d')]=_0x509acf['queue'];}}catch(_0x42596c){utils[_0xc58c('0x17')](util[_0xc58c('0x4')](_0xc58c('0x3b'),_0x509acf[_0xc58c('0x6')]),_0x42596c);}};exports[_0xc58c('0x3e')]=function(_0x5d6573){try{utils['debug'](util[_0xc58c('0x4')](_0xc58c('0x3f'),_0x5d6573['uniqueid']),_0x5d6573);utils[_0xc58c('0x3')](util[_0xc58c('0x4')](_0xc58c('0x40'),_0x5d6573[_0xc58c('0x6')],_0x5d6573[_0xc58c('0x41')],_0x5d6573[_0xc58c('0x42')],_0x5d6573[_0xc58c('0x43')],_0x5d6573[_0xc58c('0x44')]));if(recordings[_0x5d6573[_0xc58c('0x45')]]&&transfers[_0xc58c('0x7')][_0x5d6573['transfereruniqueid']]){transfers[_0xc58c('0x7')][_0x5d6573['transfereruniqueid']][_0xc58c('0x46')]=!![];}}catch(_0x35cd3b){utils['error'](util[_0xc58c('0x4')]('[%s][recordings][blindtransfer]',_0x5d6573[_0xc58c('0x6')]),_0x35cd3b);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index bd52c8e..1a208a7 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 _0x589e=['util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','CreateVoiceTransferReport','blinds','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','attendedtransfer','debug','[%s][transfers][attendedtransfer]','origtransfereruniqueid','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash'];(function(_0xfa300f,_0x3203ee){var _0x442911=function(_0x277318){while(--_0x277318){_0xfa300f['push'](_0xfa300f['shift']());}};_0x442911(++_0x3203ee);}(_0x589e,0x133));var _0xe589=function(_0x1ea5a9,_0x6d489){_0x1ea5a9=_0x1ea5a9-0x0;var _0x494cda=_0x589e[_0x1ea5a9];return _0x494cda;};'use strict';var _=require(_0xe589('0x0'));var util=require(_0xe589('0x1'));var utils=require(_0xe589('0x2'));function writeDB(_0x221f91){utils[_0xe589('0x3')](util[_0xe589('0x4')](_0xe589('0x5'),_0x221f91[_0xe589('0x6')]===_0xe589('0x7')?_0x221f91['origtransfereruniqueid']:_0x221f91['uniqueid'],_0x221f91[_0xe589('0x6')]));utils['request'](_0xe589('0x8'),_0x221f91);}exports[_0xe589('0x9')]={};exports['blindtransfer']=function(_0x5de651){try{utils['debug'](util[_0xe589('0x4')](_0xe589('0xa'),_0x5de651[_0xe589('0xb')]),_0x5de651);utils['info'](util[_0xe589('0x4')](_0xe589('0xc'),_0x5de651[_0xe589('0xb')],_0x5de651[_0xe589('0xd')],_0x5de651[_0xe589('0xe')],_0x5de651[_0xe589('0xf')],_0x5de651[_0xe589('0x10')]));_0x5de651['type']=_0xe589('0x11');exports[_0xe589('0x9')][_0x5de651[_0xe589('0x12')]]=_0x5de651;writeDB(_0x5de651);}catch(_0x301d09){utils['error'](util[_0xe589('0x4')](_0xe589('0xa'),_0x5de651[_0xe589('0xb')]),_0x301d09);}};exports[_0xe589('0x13')]=function(_0x234ec8){try{utils[_0xe589('0x14')](util[_0xe589('0x4')](_0xe589('0x15'),_0x234ec8[_0xe589('0x16')]),_0x234ec8);utils[_0xe589('0x3')](util[_0xe589('0x4')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x234ec8[_0xe589('0x16')],_0x234ec8['origtransferercalleridnum'],_0x234ec8['origtransferercalleridname'],_0x234ec8[_0xe589('0x17')],_0x234ec8[_0xe589('0x18')]));_0x234ec8=_[_0xe589('0x19')](_0x234ec8,{'transfererchannel':_0x234ec8[_0xe589('0x1a')],'transferercalleridnum':_0x234ec8[_0xe589('0x1b')],'transferercalleridname':_0x234ec8[_0xe589('0x1c')],'transfererconnectedlinenum':_0x234ec8[_0xe589('0x1d')],'transfererconnectedlinename':_0x234ec8[_0xe589('0x1e')],'transfereraccountcode':_0x234ec8[_0xe589('0x1f')],'transferercontext':_0x234ec8['secondtransferercontext'],'transfererexten':_0x234ec8['secondtransfererexten'],'transfererlinkedid':_0x234ec8['origtransfererlinkedid'],'context':_0x234ec8[_0xe589('0x20')],'extension':_0x234ec8[_0xe589('0x21')],'type':_0xe589('0x7')});if(_[_0xe589('0x22')](_0x234ec8[_0xe589('0x23')])){_0x234ec8=_[_0xe589('0x19')](_0x234ec8,{'transfereechannel':_0x234ec8[_0xe589('0x24')],'transfereecalleridnum':_0x234ec8[_0xe589('0x17')],'transfereecalleridname':_0x234ec8['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x234ec8[_0xe589('0x25')],'transfereeconnectedlinename':_0x234ec8[_0xe589('0x26')],'transfereeaccountcode':_0x234ec8[_0xe589('0x27')],'transfereecontext':_0x234ec8[_0xe589('0x28')],'transfereeexten':_0x234ec8[_0xe589('0x29')],'transfereelinkedid':_0x234ec8[_0xe589('0x2a')]});}writeDB(_0x234ec8);}catch(_0xcfd2ab){utils[_0xe589('0x2b')](util[_0xe589('0x4')]('[%s][transfers][attendedtransfer]',_0x234ec8[_0xe589('0x16')]),_0xcfd2ab);}}; \ No newline at end of file +var _0x6e8a=['origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetaccountcode','transfertargetlinkedid','error','lodash','info','format','[%s][transfers][writeDB]\x20type:%s','type','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','attendedtransfer','debug','[%s][transfers][attendedtransfer]','origtransfereruniqueid','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename'];(function(_0x3e7234,_0x4bbe77){var _0xb3e053=function(_0x2e0bf8){while(--_0x2e0bf8){_0x3e7234['push'](_0x3e7234['shift']());}};_0xb3e053(++_0x4bbe77);}(_0x6e8a,0x124));var _0xa6e8=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x6e8a[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xa6e8('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x27bd73){utils[_0xa6e8('0x1')](util[_0xa6e8('0x2')](_0xa6e8('0x3'),_0x27bd73[_0xa6e8('0x4')]==='attended'?_0x27bd73['origtransfereruniqueid']:_0x27bd73[_0xa6e8('0x5')],_0x27bd73[_0xa6e8('0x4')]));utils[_0xa6e8('0x6')](_0xa6e8('0x7'),_0x27bd73);}exports[_0xa6e8('0x8')]={};exports[_0xa6e8('0x9')]=function(_0x7acaf4){try{utils['debug'](util[_0xa6e8('0x2')](_0xa6e8('0xa'),_0x7acaf4[_0xa6e8('0x5')]),_0x7acaf4);utils[_0xa6e8('0x1')](util[_0xa6e8('0x2')](_0xa6e8('0xb'),_0x7acaf4[_0xa6e8('0x5')],_0x7acaf4[_0xa6e8('0xc')],_0x7acaf4[_0xa6e8('0xd')],_0x7acaf4['transfereecalleridnum'],_0x7acaf4[_0xa6e8('0xe')]));_0x7acaf4[_0xa6e8('0x4')]=_0xa6e8('0xf');exports['blinds'][_0x7acaf4['transfereruniqueid']]=_0x7acaf4;writeDB(_0x7acaf4);}catch(_0xcfc55b){utils['error'](util['format'](_0xa6e8('0xa'),_0x7acaf4[_0xa6e8('0x5')]),_0xcfc55b);}};exports[_0xa6e8('0x10')]=function(_0x4332f5){try{utils[_0xa6e8('0x11')](util[_0xa6e8('0x2')](_0xa6e8('0x12'),_0x4332f5[_0xa6e8('0x13')]),_0x4332f5);utils[_0xa6e8('0x1')](util[_0xa6e8('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4332f5[_0xa6e8('0x13')],_0x4332f5['origtransferercalleridnum'],_0x4332f5['origtransferercalleridname'],_0x4332f5[_0xa6e8('0x14')],_0x4332f5[_0xa6e8('0x15')]));_0x4332f5=_[_0xa6e8('0x16')](_0x4332f5,{'transfererchannel':_0x4332f5[_0xa6e8('0x17')],'transferercalleridnum':_0x4332f5[_0xa6e8('0x18')],'transferercalleridname':_0x4332f5[_0xa6e8('0x19')],'transfererconnectedlinenum':_0x4332f5[_0xa6e8('0x1a')],'transfererconnectedlinename':_0x4332f5[_0xa6e8('0x1b')],'transfereraccountcode':_0x4332f5[_0xa6e8('0x1c')],'transferercontext':_0x4332f5[_0xa6e8('0x1d')],'transfererexten':_0x4332f5[_0xa6e8('0x1e')],'transfererlinkedid':_0x4332f5[_0xa6e8('0x1f')],'context':_0x4332f5[_0xa6e8('0x20')],'extension':_0x4332f5[_0xa6e8('0x21')],'type':_0xa6e8('0x22')});if(_[_0xa6e8('0x23')](_0x4332f5[_0xa6e8('0x24')])){_0x4332f5=_[_0xa6e8('0x16')](_0x4332f5,{'transfereechannel':_0x4332f5['transfertargetchannel'],'transfereecalleridnum':_0x4332f5[_0xa6e8('0x14')],'transfereecalleridname':_0x4332f5[_0xa6e8('0x15')],'transfereeconnectedlinenum':_0x4332f5['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4332f5['transfertargetconnectedlinename'],'transfereeaccountcode':_0x4332f5[_0xa6e8('0x25')],'transfereecontext':_0x4332f5['transfertargetcontext'],'transfereeexten':_0x4332f5['transfertargetexten'],'transfereelinkedid':_0x4332f5[_0xa6e8('0x26')]});}writeDB(_0x4332f5);}catch(_0x3e3019){utils[_0xa6e8('0x27')](util[_0xa6e8('0x2')](_0xa6e8('0x12'),_0x4332f5[_0xa6e8('0x13')]),_0x3e3019);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index c82f2de..e6f41b6 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 _0xea78=['info','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment','http','../../config/logger','xdr','inspect','debug','error','then','[utils][request]\x20name:%s','request','GetUser','internal','interface','[utils][getUser]\x20where:%s','stringify','result','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','catch','getUserByInterface'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xea78,0x162));var _0x8ea7=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0xea78[_0x53c256];return _0x25feb6;};'use strict';var BPromise=require(_0x8ea7('0x0'));var jayson=require(_0x8ea7('0x1'));var moment=require(_0x8ea7('0x2'));var util=require('util');var client=jayson['client'][_0x8ea7('0x3')]({'port':0x2329});var logger=require(_0x8ea7('0x4'))(_0x8ea7('0x5'));exports['info']=function(_0x18aabf,_0x2eaa9f){logger['info'](_0x18aabf,_0x2eaa9f?util[_0x8ea7('0x6')](_0x2eaa9f,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x19d0b2,_0x22f7bb){logger[_0x8ea7('0x7')](_0x19d0b2,_0x22f7bb?util[_0x8ea7('0x6')](_0x22f7bb,{'showHidden':![],'depth':null}):'');};exports[_0x8ea7('0x8')]=function(_0x401fba,_0x2e8c38){logger[_0x8ea7('0x8')](_0x401fba,_0x2e8c38?util[_0x8ea7('0x6')](_0x2e8c38,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x5a05b9,_0x346342){return client['request'](_0x5a05b9,{'body':_0x346342})[_0x8ea7('0x9')](function(_0x281373){logger[_0x8ea7('0x7')]('[utils][request]\x20name:%s',_0x5a05b9,_0x281373?util[_0x8ea7('0x6')](_0x281373,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x388cf1){logger[_0x8ea7('0x8')](_0x8ea7('0xa'),_0x5a05b9,_0x388cf1?util['inspect'](_0x388cf1,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1be2fa){return client[_0x8ea7('0xb')](_0x8ea7('0xc'),{'options':{'raw':!![],'attributes':['id',_0x8ea7('0xd'),'name',_0x8ea7('0xe')],'where':_0x1be2fa,'limit':0x1}})[_0x8ea7('0x9')](function(_0x12061e){logger['debug'](_0x8ea7('0xf'),JSON[_0x8ea7('0x10')](_0x1be2fa),_0x12061e?util[_0x8ea7('0x6')](_0x12061e,{'showHidden':![],'depth':null}):'');return _0x12061e['result']['length']?_0x12061e[_0x8ea7('0x11')][0x0]:null;});}exports['getUserByInternal']=function(_0x554afa){return new BPromise(function(_0x1de6ae,_0x5c9b61){if(_0x554afa){return getUser({'internal':_0x554afa})[_0x8ea7('0x9')](function(_0x2598f7){logger['info'](_0x8ea7('0x12'),_0x554afa,_0x2598f7?'found':_0x8ea7('0x13'));return _0x1de6ae(_0x2598f7);})[_0x8ea7('0x14')](function(_0x46f4e0){logger[_0x8ea7('0x8')]('[utils][getUserByInternal]',_0x46f4e0?util[_0x8ea7('0x6')](_0x46f4e0,{'showHidden':![],'depth':null}):'');return _0x1de6ae(null);});}return _0x1de6ae(null);});};exports[_0x8ea7('0x15')]=function(_0x19309a){return new BPromise(function(_0x339a88,_0x13407d){if(_0x19309a){return getUser({'interface':_0x19309a})[_0x8ea7('0x9')](function(_0x4573fe){logger[_0x8ea7('0x16')](_0x8ea7('0x17'),_0x19309a,_0x4573fe?_0x8ea7('0x18'):_0x8ea7('0x13'));return _0x339a88(_0x4573fe);})[_0x8ea7('0x14')](function(_0xed2989){logger[_0x8ea7('0x8')](_0x8ea7('0x19'),_0xed2989?util[_0x8ea7('0x6')](_0xed2989,{'showHidden':![],'depth':null}):'');return _0x339a88(null);});}return _0x339a88(null);});};exports['getUserByName']=function(_0x29e0df){return new BPromise(function(_0xc46a70,_0x4cdfe8){if(_0x29e0df){return getUser({'name':_0x29e0df})[_0x8ea7('0x9')](function(_0x3c85a5){logger[_0x8ea7('0x16')](_0x8ea7('0x1a'),_0x29e0df,_0x3c85a5?_0x8ea7('0x18'):_0x8ea7('0x13'));return _0xc46a70(_0x3c85a5);})[_0x8ea7('0x14')](function(_0x3c7db3){logger['error'](_0x8ea7('0x1b'),_0x3c7db3?util[_0x8ea7('0x6')](_0x3c7db3,{'showHidden':![],'depth':null}):'');return _0xc46a70(null);});}return _0xc46a70(null);});};exports[_0x8ea7('0x1c')]=function(_0x1f583d){return new BPromise(function(_0x1fd2b3,_0x106a2d){if(_0x1f583d){return client[_0x8ea7('0xb')](_0x8ea7('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x8ea7('0x1e'),_0x8ea7('0x1f'),_0x8ea7('0x20'),'acwTimeout'],'where':{'name':_0x1f583d},'limit':0x1}})[_0x8ea7('0x9')](function(_0x538b08){logger[_0x8ea7('0x7')](_0x8ea7('0x21'),_0x1f583d,_0x538b08?util['inspect'](_0x538b08,{'showHidden':![],'depth':null}):'');logger[_0x8ea7('0x16')](_0x8ea7('0x22'),_0x1f583d,_0x538b08?_0x8ea7('0x18'):'notfound');return _0x1fd2b3(_0x538b08[_0x8ea7('0x11')][_0x8ea7('0x23')]?_0x538b08[_0x8ea7('0x11')][0x0]:null);})[_0x8ea7('0x14')](function(_0x4c9ed3){logger[_0x8ea7('0x8')](_0x8ea7('0x24'),_0x4c9ed3?util[_0x8ea7('0x6')](_0x4c9ed3,{'showHidden':![],'depth':null}):'');return _0x1fd2b3(null);});}return _0x1fd2b3(null);});};exports['addTime']=function(_0x222134,_0x3f3278){return moment(_0x222134)[_0x8ea7('0x25')](_0x3f3278,_0x8ea7('0x26'))[_0x8ea7('0x27')](_0x8ea7('0x28'));};exports['subtractTime']=function(_0x4daa16,_0x39b716){return moment(_0x4daa16)[_0x8ea7('0x29')](_0x39b716,_0x8ea7('0x26'))['format'](_0x8ea7('0x28'));};exports[_0x8ea7('0x2a')]=function(_0x294d65,_0x539d9f){return moment(_0x294d65)[_0x8ea7('0x2b')](moment(_0x539d9f),'seconds');};exports['sumTime']=function(_0x23ad87,_0x134b9e){return parseInt(_0x23ad87,0xa)+parseInt(_0x134b9e,0xa);};exports[_0x8ea7('0x2c')]=function(){return moment()['format'](_0x8ea7('0x28'));};exports[_0x8ea7('0x2d')]=function(_0x48bc4c,_0x41a4ae){if(_0x41a4ae){return moment(_0x48bc4c)[_0x8ea7('0x2d')](_0x41a4ae);}return!![];};exports['isBefore']=function(_0x5723cc,_0x8216c4){if(_0x8216c4){return moment(_0x5723cc)[_0x8ea7('0x2e')](_0x8216c4);}else if(_0x5723cc){return!![];}return![];}; \ No newline at end of file +var _0x64ff=['util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','add','seconds','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment'];(function(_0x4e859c,_0xc2b230){var _0x3b571d=function(_0x40c359){while(--_0x40c359){_0x4e859c['push'](_0x4e859c['shift']());}};_0x3b571d(++_0xc2b230);}(_0x64ff,0xf2));var _0xf64f=function(_0x3a415b,_0x7a1f2c){_0x3a415b=_0x3a415b-0x0;var _0x3c626b=_0x64ff[_0x3a415b];return _0x3c626b;};'use strict';var BPromise=require(_0xf64f('0x0'));var jayson=require(_0xf64f('0x1'));var moment=require(_0xf64f('0x2'));var util=require(_0xf64f('0x3'));var client=jayson[_0xf64f('0x4')][_0xf64f('0x5')]({'port':0x2329});var logger=require(_0xf64f('0x6'))(_0xf64f('0x7'));exports[_0xf64f('0x8')]=function(_0x17de92,_0x2b5e73){logger[_0xf64f('0x8')](_0x17de92,_0x2b5e73?util[_0xf64f('0x9')](_0x2b5e73,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0xeaf1e6,_0x26062d){logger[_0xf64f('0xa')](_0xeaf1e6,_0x26062d?util[_0xf64f('0x9')](_0x26062d,{'showHidden':![],'depth':null}):'');};exports[_0xf64f('0xb')]=function(_0xd6fd24,_0x4eafca){logger[_0xf64f('0xb')](_0xd6fd24,_0x4eafca?util[_0xf64f('0x9')](_0x4eafca,{'showHidden':![],'depth':null}):'');};exports[_0xf64f('0xc')]=function(_0x2c6f62,_0xbc723b){return client[_0xf64f('0xc')](_0x2c6f62,{'body':_0xbc723b})[_0xf64f('0xd')](function(_0x1c52df){logger[_0xf64f('0xa')](_0xf64f('0xe'),_0x2c6f62,_0x1c52df?util['inspect'](_0x1c52df,{'showHidden':![],'depth':null}):'');})[_0xf64f('0xf')](function(_0x182afc){logger[_0xf64f('0xb')]('[utils][request]\x20name:%s',_0x2c6f62,_0x182afc?util['inspect'](_0x182afc,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4efaf6){return client[_0xf64f('0xc')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal','name',_0xf64f('0x10')],'where':_0x4efaf6,'limit':0x1}})[_0xf64f('0xd')](function(_0x31e567){logger[_0xf64f('0xa')](_0xf64f('0x11'),JSON[_0xf64f('0x12')](_0x4efaf6),_0x31e567?util['inspect'](_0x31e567,{'showHidden':![],'depth':null}):'');return _0x31e567[_0xf64f('0x13')]['length']?_0x31e567[_0xf64f('0x13')][0x0]:null;});}exports[_0xf64f('0x14')]=function(_0x9d0ab){return new BPromise(function(_0x195d6b,_0x4c858d){if(_0x9d0ab){return getUser({'internal':_0x9d0ab})[_0xf64f('0xd')](function(_0xc2683c){logger[_0xf64f('0x8')](_0xf64f('0x15'),_0x9d0ab,_0xc2683c?_0xf64f('0x16'):_0xf64f('0x17'));return _0x195d6b(_0xc2683c);})['catch'](function(_0x420169){logger[_0xf64f('0xb')](_0xf64f('0x18'),_0x420169?util[_0xf64f('0x9')](_0x420169,{'showHidden':![],'depth':null}):'');return _0x195d6b(null);});}return _0x195d6b(null);});};exports[_0xf64f('0x19')]=function(_0x1a845a){return new BPromise(function(_0x1a162b,_0x1a3353){if(_0x1a845a){return getUser({'interface':_0x1a845a})['then'](function(_0x2e0931){logger[_0xf64f('0x8')](_0xf64f('0x1a'),_0x1a845a,_0x2e0931?_0xf64f('0x16'):_0xf64f('0x17'));return _0x1a162b(_0x2e0931);})[_0xf64f('0xf')](function(_0x2ebb05){logger['error']('[utils][getUserByInterface]',_0x2ebb05?util[_0xf64f('0x9')](_0x2ebb05,{'showHidden':![],'depth':null}):'');return _0x1a162b(null);});}return _0x1a162b(null);});};exports[_0xf64f('0x1b')]=function(_0x5711ff){return new BPromise(function(_0x3cfe54,_0x1c6b02){if(_0x5711ff){return getUser({'name':_0x5711ff})[_0xf64f('0xd')](function(_0x4e5f64){logger[_0xf64f('0x8')](_0xf64f('0x1c'),_0x5711ff,_0x4e5f64?_0xf64f('0x16'):_0xf64f('0x17'));return _0x3cfe54(_0x4e5f64);})[_0xf64f('0xf')](function(_0x5c93f6){logger[_0xf64f('0xb')](_0xf64f('0x1d'),_0x5c93f6?util['inspect'](_0x5c93f6,{'showHidden':![],'depth':null}):'');return _0x3cfe54(null);});}return _0x3cfe54(null);});};exports[_0xf64f('0x1e')]=function(_0x30769b){return new BPromise(function(_0x16b6f5,_0x51f2e7){if(_0x30769b){return client[_0xf64f('0xc')](_0xf64f('0x1f'),{'options':{'raw':!![],'attributes':['id','name',_0xf64f('0x20'),_0xf64f('0x21'),_0xf64f('0x22')],'where':{'name':_0x30769b},'limit':0x1}})[_0xf64f('0xd')](function(_0x57dbdb){logger[_0xf64f('0xa')](_0xf64f('0x23'),_0x30769b,_0x57dbdb?util['inspect'](_0x57dbdb,{'showHidden':![],'depth':null}):'');logger[_0xf64f('0x8')](_0xf64f('0x24'),_0x30769b,_0x57dbdb?_0xf64f('0x16'):_0xf64f('0x17'));return _0x16b6f5(_0x57dbdb['result'][_0xf64f('0x25')]?_0x57dbdb[_0xf64f('0x13')][0x0]:null);})['catch'](function(_0x1b73d8){logger[_0xf64f('0xb')]('[utils][getVoiceQueueByName]',_0x1b73d8?util['inspect'](_0x1b73d8,{'showHidden':![],'depth':null}):'');return _0x16b6f5(null);});}return _0x16b6f5(null);});};exports['addTime']=function(_0x4370b5,_0x1bd109){return moment(_0x4370b5)[_0xf64f('0x26')](_0x1bd109,_0xf64f('0x27'))[_0xf64f('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xf64f('0x29')]=function(_0x1b8735,_0x362117){return moment(_0x1b8735)[_0xf64f('0x2a')](_0x362117,_0xf64f('0x27'))[_0xf64f('0x28')](_0xf64f('0x2b'));};exports[_0xf64f('0x2c')]=function(_0x1bcd05,_0x42ae3f){return moment(_0x1bcd05)['diff'](moment(_0x42ae3f),_0xf64f('0x27'));};exports[_0xf64f('0x2d')]=function(_0xabf556,_0x43cfc5){return parseInt(_0xabf556,0xa)+parseInt(_0x43cfc5,0xa);};exports[_0xf64f('0x2e')]=function(){return moment()[_0xf64f('0x28')](_0xf64f('0x2b'));};exports[_0xf64f('0x2f')]=function(_0x33d4d0,_0x12cbc2){if(_0x12cbc2){return moment(_0x33d4d0)[_0xf64f('0x2f')](_0x12cbc2);}return!![];};exports['isBefore']=function(_0x1098d6,_0x9aa2b0){if(_0x9aa2b0){return moment(_0x1098d6)[_0xf64f('0x30')](_0x9aa2b0);}else if(_0x1098d6){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 58282e5..ea51f42 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 _0x69c5=['x-forwarded-for','url','statusCode','user','name','role','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)','connection','remoteAddress','other','agent_name','setupLoggers','fs-extra','lodash','./loggers','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','ensureDir','then','no-user','timestamp','catch','use','logger','isEmpty','body','format','method','headers'];(function(_0x50f393,_0x2fd1f0){var _0x17d340=function(_0x3350ab){while(--_0x3350ab){_0x50f393['push'](_0x50f393['shift']());}};_0x17d340(++_0x2fd1f0);}(_0x69c5,0x1c8));var _0x569c=function(_0x864075,_0x2095fa){_0x864075=_0x864075-0x0;var _0x25900b=_0x69c5[_0x864075];return _0x25900b;};var fs=require(_0x569c('0x0'));var _=require(_0x569c('0x1'));var ewinston=require('express-winston');var path=require('path');var util=require('util');var fileLogger=require(_0x569c('0x2'))[_0x569c('0x3')];var safeTemplate=require(_0x569c('0x4'))['safeTemplate'];var maskSensitiveData=require(_0x569c('0x5'))[_0x569c('0x6')];function ClientSideLogger(){function _0x3ce2dc(_0x4a76e3){var _0x591b7b=path[_0x569c('0x7')](_0x569c('0x8'),_0x569c('0x9'),_0x569c('0xa'));var _0x4f6400=path['join'](_0x569c('0xb'),_0x4a76e3['role']+'-'+_0x4a76e3['name']);return fs[_0x569c('0xc')](path['join'](_0x591b7b,_0x4f6400))[_0x569c('0xd')](function(){var _0x4265f8=fileLogger('client',path[_0x569c('0x7')](_0x591b7b,_0x4f6400));return _0x4265f8;})['catch'](function(_0x2ba776){throw _0x2ba776;});}this['log']=function(_0x52aae9,_0x2e3429,_0x301db5,_0x2c1256){return _0x3ce2dc(_0x52aae9['user'])[_0x569c('0xd')](function(_0x181dfc){var _0x16b35e=_0x181dfc[_0x2e3429];return _0x16b35e;})[_0x569c('0xd')](function(_0x53730a){var _0x591676=_0x52aae9['user']?_0x52aae9['user']['id']:_0x569c('0xe');var _0x17de8a=_0x2c1256['data'];var _0x467cd7=_0x2c1256[_0x569c('0xf')];var _0x511d25=new Date(Number(_0x467cd7));return _0x53730a(_0x591676,_0x511d25,_0x301db5,_0x17de8a);})[_0x569c('0x10')](function(_0x134d5c){fileLogger('client')['error'](_0x134d5c);});};}function setupLoggers(_0x24f14d){return new Promise(function(_0x4582f4){var _0x2951d9=new ClientSideLogger();var _0x3e93af=fileLogger('api');var _0x5c6d84=fileLogger('auth');_0x24f14d['set']('client-side-logger',_0x2951d9);_0x24f14d[_0x569c('0x11')](ewinston[_0x569c('0x12')]({'winstonInstance':_0x3e93af,'meta':![],'statusLevels':!![],'msg':function(_0x21dee9,_0x38af7c){var _0xab026d='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x569c('0x13')](_0x21dee9[_0x569c('0x14')])){_0xab026d+='\x20body=%s';var _0x3bcf60=_0x21dee9[_0x569c('0x14')];maskSensitiveData(_0x3bcf60);}return safeTemplate(util[_0x569c('0x15')](_0xab026d,_0x21dee9[_0x569c('0x16')],_0x21dee9[_0x569c('0x17')]['x-forwarded-for']?_0x21dee9[_0x569c('0x17')][_0x569c('0x18')]:_0x21dee9['connection']['remoteAddress']||_0x21dee9['ip'],_0x21dee9[_0x569c('0x19')],_0x38af7c[_0x569c('0x1a')],_0x38af7c['responseTime'],_0x21dee9[_0x569c('0x1b')]?_0x21dee9[_0x569c('0x1b')]['id']:null,_0x21dee9[_0x569c('0x1b')]?_0x21dee9[_0x569c('0x1b')][_0x569c('0x1c')]:null,_0x21dee9['user']?_0x21dee9['user'][_0x569c('0x1d')]:null,_0x3bcf60?util[_0x569c('0x1e')](_0x3bcf60,![],null):''));}}));_0x24f14d[_0x569c('0x11')](ewinston['logger']({'winstonInstance':_0x5c6d84,'meta':![],'statusLevels':!![],'msg':function(_0x3b4e95,_0x306396){var _0x370095=_0x569c('0x1f');if(_0x3b4e95[_0x569c('0x14')]&&_0x3b4e95['body'][_0x569c('0x20')]&&_0x3b4e95['body'][_0x569c('0x21')]){_0x370095=_0x569c('0x22');}return util[_0x569c('0x15')](_0x370095,_0x3b4e95[_0x569c('0x16')],_0x3b4e95['headers'][_0x569c('0x18')]?_0x3b4e95['headers']['x-forwarded-for']:_0x3b4e95[_0x569c('0x23')][_0x569c('0x24')]||_0x3b4e95['ip'],_0x3b4e95[_0x569c('0x19')],_0x306396[_0x569c('0x1a')],_0x306396['responseTime'],_0x3b4e95['user']?_0x3b4e95[_0x569c('0x1b')]['id']:null,_0x3b4e95['user']?_0x3b4e95['user'][_0x569c('0x1c')]:null,_0x3b4e95[_0x569c('0x1b')]?_0x3b4e95[_0x569c('0x1b')][_0x569c('0x1d')]:null,_0x3b4e95[_0x569c('0x14')]&&_0x3b4e95[_0x569c('0x14')][_0x569c('0x20')]?_0x3b4e95[_0x569c('0x14')]['device']:_0x569c('0x25'),_0x3b4e95[_0x569c('0x14')]&&_0x3b4e95['body'][_0x569c('0x21')]?_0x3b4e95[_0x569c('0x14')][_0x569c('0x21')]:'',_0x3b4e95[_0x569c('0x14')]&&_0x3b4e95['body'][_0x569c('0x26')]?_0x3b4e95['body'][_0x569c('0x26')]:'');},'ignoreRoute':function(_0x2b3dea){var _0x117ba2=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x117ba2['test'](_0x2b3dea['url']);}}));return _0x4582f4();});}exports[_0x569c('0x27')]=setupLoggers; \ No newline at end of file +var _0xca40=['lodash','path','util','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','catch','user','then','no-user','data','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','headers','x-forwarded-for','connection','url','statusCode','inspect','device','agent_id','method','other','agent_name','test','setupLoggers'];(function(_0x3b8f83,_0x592fd9){var _0x5aaca0=function(_0x41348e){while(--_0x41348e){_0x3b8f83['push'](_0x3b8f83['shift']());}};_0x5aaca0(++_0x592fd9);}(_0xca40,0x7b));var _0x0ca4=function(_0xa990b7,_0x26c527){_0xa990b7=_0xa990b7-0x0;var _0x52c99c=_0xca40[_0xa990b7];return _0x52c99c;};var fs=require('fs-extra');var _=require(_0x0ca4('0x0'));var ewinston=require('express-winston');var path=require(_0x0ca4('0x1'));var util=require(_0x0ca4('0x2'));var fileLogger=require('./loggers')[_0x0ca4('0x3')];var safeTemplate=require(_0x0ca4('0x4'))['safeTemplate'];var maskSensitiveData=require(_0x0ca4('0x5'))[_0x0ca4('0x6')];function ClientSideLogger(){function _0x5e12d9(_0x3311f1){var _0x15223e=path[_0x0ca4('0x7')](_0x0ca4('0x8'),_0x0ca4('0x9'),_0x0ca4('0xa'));var _0x2ffd40=path[_0x0ca4('0x7')](_0x0ca4('0xb'),_0x3311f1[_0x0ca4('0xc')]+'-'+_0x3311f1[_0x0ca4('0xd')]);return fs[_0x0ca4('0xe')](path[_0x0ca4('0x7')](_0x15223e,_0x2ffd40))['then'](function(){var _0x490a96=fileLogger(_0x0ca4('0xb'),path[_0x0ca4('0x7')](_0x15223e,_0x2ffd40));return _0x490a96;})[_0x0ca4('0xf')](function(_0x2d4bb8){throw _0x2d4bb8;});}this[_0x0ca4('0x9')]=function(_0x2b4ea8,_0x233984,_0x2ba9d2,_0xbf7f83){return _0x5e12d9(_0x2b4ea8[_0x0ca4('0x10')])['then'](function(_0x36d8a2){var _0x5ab07f=_0x36d8a2[_0x233984];return _0x5ab07f;})[_0x0ca4('0x11')](function(_0x37c679){var _0x2be4a5=_0x2b4ea8[_0x0ca4('0x10')]?_0x2b4ea8[_0x0ca4('0x10')]['id']:_0x0ca4('0x12');var _0x1ce642=_0xbf7f83[_0x0ca4('0x13')];var _0x56e5bd=_0xbf7f83['timestamp'];var _0xa793d1=new Date(Number(_0x56e5bd));return _0x37c679(_0x2be4a5,_0xa793d1,_0x2ba9d2,_0x1ce642);})[_0x0ca4('0xf')](function(_0x38eea6){fileLogger(_0x0ca4('0xb'))['error'](_0x38eea6);});};}function setupLoggers(_0x40ea4c){return new Promise(function(_0x2efb8d){var _0xd9863f=new ClientSideLogger();var _0xd0b388=fileLogger('api');var _0xd3d840=fileLogger('auth');_0x40ea4c[_0x0ca4('0x14')](_0x0ca4('0x15'),_0xd9863f);_0x40ea4c[_0x0ca4('0x16')](ewinston[_0x0ca4('0x17')]({'winstonInstance':_0xd0b388,'meta':![],'statusLevels':!![],'msg':function(_0x5c8edc,_0x24df4c){var _0x3f04b6=_0x0ca4('0x18');if(!_['isEmpty'](_0x5c8edc[_0x0ca4('0x19')])){_0x3f04b6+=_0x0ca4('0x1a');var _0x2f3777=_0x5c8edc[_0x0ca4('0x19')];maskSensitiveData(_0x2f3777);}return safeTemplate(util[_0x0ca4('0x1b')](_0x3f04b6,_0x5c8edc['method'],_0x5c8edc[_0x0ca4('0x1c')][_0x0ca4('0x1d')]?_0x5c8edc[_0x0ca4('0x1c')]['x-forwarded-for']:_0x5c8edc[_0x0ca4('0x1e')]['remoteAddress']||_0x5c8edc['ip'],_0x5c8edc[_0x0ca4('0x1f')],_0x24df4c[_0x0ca4('0x20')],_0x24df4c['responseTime'],_0x5c8edc[_0x0ca4('0x10')]?_0x5c8edc[_0x0ca4('0x10')]['id']:null,_0x5c8edc[_0x0ca4('0x10')]?_0x5c8edc[_0x0ca4('0x10')][_0x0ca4('0xd')]:null,_0x5c8edc[_0x0ca4('0x10')]?_0x5c8edc[_0x0ca4('0x10')][_0x0ca4('0xc')]:null,_0x2f3777?util[_0x0ca4('0x21')](_0x2f3777,![],null):''));}}));_0x40ea4c['use'](ewinston[_0x0ca4('0x17')]({'winstonInstance':_0xd3d840,'meta':![],'statusLevels':!![],'msg':function(_0x7b9b80,_0x435219){var _0x40d135='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x7b9b80[_0x0ca4('0x19')]&&_0x7b9b80[_0x0ca4('0x19')][_0x0ca4('0x22')]&&_0x7b9b80[_0x0ca4('0x19')][_0x0ca4('0x23')]){_0x40d135='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x0ca4('0x1b')](_0x40d135,_0x7b9b80[_0x0ca4('0x24')],_0x7b9b80[_0x0ca4('0x1c')]['x-forwarded-for']?_0x7b9b80[_0x0ca4('0x1c')][_0x0ca4('0x1d')]:_0x7b9b80[_0x0ca4('0x1e')]['remoteAddress']||_0x7b9b80['ip'],_0x7b9b80[_0x0ca4('0x1f')],_0x435219['statusCode'],_0x435219['responseTime'],_0x7b9b80[_0x0ca4('0x10')]?_0x7b9b80['user']['id']:null,_0x7b9b80[_0x0ca4('0x10')]?_0x7b9b80['user'][_0x0ca4('0xd')]:null,_0x7b9b80['user']?_0x7b9b80[_0x0ca4('0x10')][_0x0ca4('0xc')]:null,_0x7b9b80[_0x0ca4('0x19')]&&_0x7b9b80['body'][_0x0ca4('0x22')]?_0x7b9b80[_0x0ca4('0x19')][_0x0ca4('0x22')]:_0x0ca4('0x25'),_0x7b9b80['body']&&_0x7b9b80[_0x0ca4('0x19')][_0x0ca4('0x23')]?_0x7b9b80[_0x0ca4('0x19')][_0x0ca4('0x23')]:'',_0x7b9b80['body']&&_0x7b9b80[_0x0ca4('0x19')][_0x0ca4('0x26')]?_0x7b9b80[_0x0ca4('0x19')][_0x0ca4('0x26')]:'');},'ignoreRoute':function(_0x5737eb){var _0x45c10c=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x45c10c[_0x0ca4('0x27')](_0x5737eb[_0x0ca4('0x1f')]);}}));return _0x2efb8d();});}exports[_0x0ca4('0x28')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 3fcc893..b9309f5 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01f7=['warn','%s-%s','error','File','consoleLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','%s-%s.log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console'];(function(_0x30b212,_0x754f88){var _0x40f19b=function(_0x26cdbe){while(--_0x26cdbe){_0x30b212['push'](_0x30b212['shift']());}};_0x40f19b(++_0x754f88);}(_0x01f7,0x107));var _0x701f=function(_0x7d9c0d,_0x165295){_0x7d9c0d=_0x7d9c0d-0x0;var _0x26a3c7=_0x01f7[_0x7d9c0d];return _0x26a3c7;};'use strict';var path=require(_0x701f('0x0'));var util=require(_0x701f('0x1'));var moment=require(_0x701f('0x2'));var winston=require(_0x701f('0x3'));var config=require(_0x701f('0x4'));var debugLevel=config['debugLevel']?config[_0x701f('0x5')][_0x701f('0x6')]():_0x701f('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':_0x701f('0x8'),'error':_0x701f('0x9'),'warn':_0x701f('0xa'),'info':_0x701f('0xb'),'print':_0x701f('0xc'),'success':_0x701f('0xd'),'http':_0x701f('0xe'),'verbose':_0x701f('0xf'),'debug':_0x701f('0x10'),'silly':_0x701f('0x11')};winston[_0x701f('0x12')](XC_LOG_COLORS);function getLogFileName(_0x5379d5,_0x4858c0,_0x2ede1a){var _0x290ec3=_0x5379d5||_0x701f('0x13');return path[_0x701f('0x14')](_0x290ec3,util['format'](_0x701f('0x15'),_0x4858c0,_0x2ede1a));}function formatter(_0x47ffcd,_0x295499){_0x295499['message']=_0x295499[_0x701f('0x16')][_0x701f('0x17')](/@@{/g,_0x701f('0x18'))[_0x701f('0x17')](/}@@/g,_0x701f('0x19'))[_0x701f('0x17')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x701f('0x1a')](_0x701f('0x1b'),moment()[_0x701f('0x1a')](_0x701f('0x1c')),_0x295499[_0x701f('0x1d')][_0x701f('0x1e')](),_0x47ffcd,_0x295499[_0x701f('0x16')]);}function fileFormat(_0x15d51c,_0x8a2e72){_0x8a2e72['message']=_0x8a2e72[_0x701f('0x16')][_0x701f('0x17')](/@@{/g,_0x701f('0x18'))[_0x701f('0x17')](/}@@/g,_0x701f('0x19'))[_0x701f('0x17')](/@{/g,'{{')[_0x701f('0x17')](/}@/g,'}}');var _0x397a75=_0x8a2e72[_0x701f('0x1f')]&&Object['keys'](_0x8a2e72[_0x701f('0x1f')])[_0x701f('0x20')]?'\x0a\x09'+JSON[_0x701f('0x21')](_0x8a2e72[_0x701f('0x1f')]):'';return util[_0x701f('0x1a')](_0x701f('0x22'),moment()[_0x701f('0x1a')](_0x701f('0x1c')),_0x8a2e72[_0x701f('0x1d')]['toUpperCase'](),_0x15d51c,_0x8a2e72[_0x701f('0x16')],_0x397a75);}function consoleLogger(){var _0x5ad546=new winston[(_0x701f('0x23'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x701f('0x24'))][(_0x701f('0x25'))]({'level':_0x701f('0x26'),'json':![],'formatter':function(_0x41c748){return formatter('',_0x41c748);}})]});return _0x5ad546;}function fileLogger(_0x5df3c7,_0x420f82){var _0x264bc7=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x701f('0x24'))]['File']({'name':util[_0x701f('0x1a')](_0x701f('0x27'),_0x5df3c7,_0x701f('0x28')),'filename':getLogFileName(_0x420f82,_0x5df3c7,_0x701f('0x28')),'level':_0x701f('0x28'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1e3f02){return fileFormat(_0x5df3c7,_0x1e3f02);}}),new winston[(_0x701f('0x24'))][(_0x701f('0x29'))]({'name':util[_0x701f('0x1a')](_0x701f('0x27'),_0x5df3c7,debugLevel),'filename':getLogFileName(_0x420f82,_0x5df3c7,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3aff77){return fileFormat(_0x5df3c7,_0x3aff77);}}),new winston[(_0x701f('0x24'))][(_0x701f('0x25'))]({'level':_0x701f('0x26'),'json':![],'formatter':function(_0xe69a30){return fileFormat(_0x5df3c7,_0xe69a30);}})]});return _0x264bc7;}exports[_0x701f('0x2a')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0xb97d=['meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','Console','transports','File','%s-%s','error','warn','consoleLogger','fileLogger','path','moment','winston','../config/environment','toLowerCase','info','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20blue','bold\x20cyan','addColors','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level'];(function(_0x568385,_0x4681e0){var _0x4c583f=function(_0x2b71c1){while(--_0x2b71c1){_0x568385['push'](_0x568385['shift']());}};_0x4c583f(++_0x4681e0);}(_0xb97d,0x146));var _0xdb97=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xb97d[_0xbb091];return _0x467a04;};'use strict';var path=require(_0xdb97('0x0'));var util=require('util');var moment=require(_0xdb97('0x1'));var winston=require(_0xdb97('0x2'));var config=require(_0xdb97('0x3'));var debugLevel=config['debugLevel']?config['debugLevel'][_0xdb97('0x4')]():_0xdb97('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':'redBG\x20white','error':_0xdb97('0x6'),'warn':_0xdb97('0x7'),'info':_0xdb97('0x8'),'print':_0xdb97('0x9'),'success':_0xdb97('0xa'),'http':_0xdb97('0xb'),'verbose':'bold\x20magenta','debug':_0xdb97('0xc'),'silly':_0xdb97('0xd')};winston[_0xdb97('0xe')](XC_LOG_COLORS);function getLogFileName(_0x4b2080,_0x18710b,_0x5ecef5){var _0x2575e8=_0x4b2080||'/var/log/xcally';return path[_0xdb97('0xf')](_0x2575e8,util[_0xdb97('0x10')](_0xdb97('0x11'),_0x18710b,_0x5ecef5));}function formatter(_0x4e4418,_0x1a0e74){_0x1a0e74[_0xdb97('0x12')]=_0x1a0e74['message'][_0xdb97('0x13')](/@@{/g,_0xdb97('0x14'))[_0xdb97('0x13')](/}@@/g,_0xdb97('0x15'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xdb97('0x10')](_0xdb97('0x16'),moment()[_0xdb97('0x10')](_0xdb97('0x17')),_0x1a0e74[_0xdb97('0x18')]['toUpperCase'](),_0x4e4418,_0x1a0e74[_0xdb97('0x12')]);}function fileFormat(_0x57add3,_0x9fce9a){_0x9fce9a[_0xdb97('0x12')]=_0x9fce9a['message']['replace'](/@@{/g,_0xdb97('0x14'))[_0xdb97('0x13')](/}@@/g,_0xdb97('0x15'))[_0xdb97('0x13')](/@{/g,'{{')[_0xdb97('0x13')](/}@/g,'}}');var _0x2fc8ea=_0x9fce9a[_0xdb97('0x19')]&&Object[_0xdb97('0x1a')](_0x9fce9a[_0xdb97('0x19')])[_0xdb97('0x1b')]?'\x0a\x09'+JSON['stringify'](_0x9fce9a[_0xdb97('0x19')]):'';return util[_0xdb97('0x10')](_0xdb97('0x1c'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x9fce9a[_0xdb97('0x18')][_0xdb97('0x1d')](),_0x57add3,_0x9fce9a[_0xdb97('0x12')],_0x2fc8ea);}function consoleLogger(){var _0x1b6cfa=new winston[(_0xdb97('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xdb97('0x1f'))]({'level':'warn','json':![],'formatter':function(_0x26e657){return formatter('',_0x26e657);}})]});return _0x1b6cfa;}function fileLogger(_0xc7e57a,_0x46cc92){var _0x4c17a0=new winston[(_0xdb97('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xdb97('0x20'))][(_0xdb97('0x21'))]({'name':util[_0xdb97('0x10')](_0xdb97('0x22'),_0xc7e57a,_0xdb97('0x23')),'filename':getLogFileName(_0x46cc92,_0xc7e57a,_0xdb97('0x23')),'level':_0xdb97('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5a0fca){return fileFormat(_0xc7e57a,_0x5a0fca);}}),new winston[(_0xdb97('0x20'))][(_0xdb97('0x21'))]({'name':util[_0xdb97('0x10')](_0xdb97('0x22'),_0xc7e57a,debugLevel),'filename':getLogFileName(_0x46cc92,_0xc7e57a,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x198fa7){return fileFormat(_0xc7e57a,_0x198fa7);}}),new winston[(_0xdb97('0x20'))]['Console']({'level':_0xdb97('0x24'),'json':![],'formatter':function(_0x45f3d8){return fileFormat(_0xc7e57a,_0x45f3d8);}})]});return _0x4c17a0;}exports[_0xdb97('0x25')]=consoleLogger;exports[_0xdb97('0x26')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 13aa4c2..54c08f6 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 _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(_0x11f4c7,_0x233ca6){var _0x246c92=function(_0x398c64){while(--_0x398c64){_0x11f4c7['push'](_0x11f4c7['shift']());}};_0x246c92(++_0x233ca6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x38e346,_0x42d04d){_0x38e346=_0x38e346-0x0;var _0x57246a=_0x5f2f[_0x38e346];return _0x57246a;};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 +var _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x4b3395,_0x190bc5){var _0xb85629=function(_0x4f7866){while(--_0x4f7866){_0x4b3395['push'](_0x4b3395['shift']());}};_0xb85629(++_0x190bc5);}(_0xadb5,0xad));var _0x5adb=function(_0x444ab5,_0x53a92c){_0x444ab5=_0x444ab5-0x0;var _0x44e1ff=_0xadb5[_0x444ab5];return _0x44e1ff;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 1e86538..838e5a2 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 _0xb7e7=['reduce','safeTemplate','lodash','{\x20{\x20','string','isArray','map'];(function(_0x43e792,_0xa8168a){var _0x1f750e=function(_0x46ccf8){while(--_0x46ccf8){_0x43e792['push'](_0x43e792['shift']());}};_0x1f750e(++_0xa8168a);}(_0xb7e7,0x121));var _0x7b7e=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0xb7e7[_0xac151d];return _0x111dba;};var _=require(_0x7b7e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x545d7d){return _0x545d7d==='{{'?_0x7b7e('0x1'):'\x20}\x20}';}function safeTemplate(_0x1b7cc7){var _0x54a37f=_0x1b7cc7;if(typeof _0x1b7cc7===_0x7b7e('0x2')){_0x54a37f=_0x1b7cc7['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x7b7e('0x3')](_0x1b7cc7)){_0x54a37f=_0x1b7cc7[_0x7b7e('0x4')](function(_0x1d9384){return safeTemplate(_0x1d9384);});}else if(_['isPlainObject'](_0x1b7cc7)){_0x54a37f=Object['keys'](_0x1b7cc7)[_0x7b7e('0x5')](function(_0x372bde,_0x7f87e0){_0x372bde[_0x7f87e0]=safeTemplate(_0x1b7cc7[_0x7f87e0]);return _0x372bde;},{});}return _0x54a37f;}module['exports'][_0x7b7e('0x6')]=safeTemplate; \ No newline at end of file +var _0x1775=['exports','safeTemplate','{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','reduce'];(function(_0x1dc01f,_0x157a75){var _0x298041=function(_0x47fce1){while(--_0x47fce1){_0x1dc01f['push'](_0x1dc01f['shift']());}};_0x298041(++_0x157a75);}(_0x1775,0x1db));var _0x5177=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1775[_0x17d9e3];return _0x14192d;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0xb5c9b1){return _0xb5c9b1==='{{'?_0x5177('0x0'):_0x5177('0x1');}function safeTemplate(_0x2ca33b){var _0xaad33e=_0x2ca33b;if(typeof _0x2ca33b===_0x5177('0x2')){_0xaad33e=_0x2ca33b[_0x5177('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x5177('0x4')](_0x2ca33b)){_0xaad33e=_0x2ca33b[_0x5177('0x5')](function(_0x51275f){return safeTemplate(_0x51275f);});}else if(_[_0x5177('0x6')](_0x2ca33b)){_0xaad33e=Object[_0x5177('0x7')](_0x2ca33b)[_0x5177('0x8')](function(_0x2ac1c6,_0x300b43){_0x2ac1c6[_0x300b43]=safeTemplate(_0x2ca33b[_0x300b43]);return _0x2ac1c6;},{});}return _0xaad33e;}module[_0x5177('0x9')][_0x5177('0xa')]=safeTemplate; \ No newline at end of file